From 49effa6c35fab2e4572b00321a9c7e9e779a1d3e Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Tue, 14 Dec 2021 15:13:39 +0100 Subject: [PATCH] Built motion from commit 0f96ec74.|2.5.41 --- 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.events.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.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.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 +- 1159 files changed, 1159 insertions(+), 1159 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 87ad68f..5c8e994 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-12-14T13:22:39.007Z", + "time": "2021-12-14T13:48:37.451Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 5bc990f..2385087 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-14T13:22:39.007Z", + "time": "2021-12-14T13:48:37.451Z", "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 84444df..4da71bc 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 _0xcec0=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','jscripty','urlForward','browser','script'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xcec0,0x99));var _0x0cec=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xcec0[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0cec('0x0'));module['exports']={'name':{'type':Sequelize[_0x0cec('0x1')],'get':function(_0x26f03c){return this[_0x0cec('0x2')](_0x0cec('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x0cec('0x4'),'motionbar',_0x0cec('0x5'),_0x0cec('0x6'),_0x0cec('0x7'),'bot',_0x0cec('0x8')]],'msg':_0x0cec('0x9')}},'comment':_0x0cec('0x9')},'data1':{'type':Sequelize[_0x0cec('0xa')](0x1000),'comment':_0x0cec('0xb')},'data2':{'type':Sequelize[_0x0cec('0xa')](0x1000),'comment':_0x0cec('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0cec('0xd')},'data5':{'type':Sequelize[_0x0cec('0xa')](0x1000),'comments':_0x0cec('0xe')},'data6':{'type':Sequelize[_0x0cec('0xa')],'comments':_0x0cec('0xf')},'data7':{'type':Sequelize[_0x0cec('0x10')],'comments':_0x0cec('0x11')}}; \ No newline at end of file +var _0x1ed0=['jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar'];(function(_0x2b430b,_0x2bf0d1){var _0xe9b5ff=function(_0x52e4ac){while(--_0x52e4ac){_0x2b430b['push'](_0x2b430b['shift']());}};_0xe9b5ff(++_0x2bf0d1);}(_0x1ed0,0x1d6));var _0x01ed=function(_0x2cde51,_0x41b85c){_0x2cde51=_0x2cde51-0x0;var _0x37177e=_0x1ed0[_0x2cde51];return _0x37177e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x01ed('0x0')],'get':function(_0x27ad33){return this[_0x01ed('0x1')]('action');}},'action':{'type':Sequelize[_0x01ed('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x01ed('0x3'),_0x01ed('0x4'),_0x01ed('0x5'),_0x01ed('0x6'),_0x01ed('0x7'),_0x01ed('0x8'),_0x01ed('0x9'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x01ed('0xa')},'data1':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comment':_0x01ed('0xb')},'data2':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comment':_0x01ed('0xc')},'data3':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comment':_0x01ed('0xd')},'data4':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comments':_0x01ed('0xe')},'data5':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comments':_0x01ed('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x01ed('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 4706e14..009ac9c 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 _0xb63c=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x40c200,_0x36e661){var _0x46be98=function(_0x20d1b9){while(--_0x20d1b9){_0x40c200['push'](_0x40c200['shift']());}};_0x46be98(++_0x36e661);}(_0xb63c,0xe1));var _0xcb63=function(_0x40b323,_0x14d4e3){_0x40b323=_0x40b323-0x0;var _0x5d77c9=_0xb63c[_0x40b323];return _0x5d77c9;};'use strict';var emlformat=require(_0xcb63('0x0'));var rimraf=require(_0xcb63('0x1'));var zipdir=require(_0xcb63('0x2'));var jsonpatch=require(_0xcb63('0x3'));var rp=require(_0xcb63('0x4'));var moment=require(_0xcb63('0x5'));var BPromise=require(_0xcb63('0x6'));var Mustache=require(_0xcb63('0x7'));var util=require(_0xcb63('0x8'));var path=require(_0xcb63('0x9'));var sox=require(_0xcb63('0xa'));var csv=require(_0xcb63('0xb'));var ejs=require(_0xcb63('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb63('0xd'));var squel=require(_0xcb63('0xe'));var crypto=require(_0xcb63('0xf'));var jsforce=require(_0xcb63('0x10'));var deskjs=require(_0xcb63('0x11'));var toCsv=require(_0xcb63('0xb'));var querystring=require(_0xcb63('0x12'));var Papa=require(_0xcb63('0x13'));var Redis=require('ioredis');var authService=require(_0xcb63('0x14'));var qs=require(_0xcb63('0x15'));var as=require(_0xcb63('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb63('0x17'))(_0xcb63('0x18'));var utils=require(_0xcb63('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xcb63('0x1a'));var db=require(_0xcb63('0x1b'))['db'];function respondWithStatusCode(_0x261f68,_0x35fc47){_0x35fc47=_0x35fc47||0xcc;return function(_0x486538){if(_0x486538){return _0x261f68['sendStatus'](_0x35fc47);}return _0x261f68[_0xcb63('0x1c')](_0x35fc47)[_0xcb63('0x1d')]();};}function respondWithResult(_0x44326b,_0x502bcc){_0x502bcc=_0x502bcc||0xc8;return function(_0x14b905){if(_0x14b905){return _0x44326b['status'](_0x502bcc)['json'](_0x14b905);}};}function respondWithFilteredResult(_0x2bebdb,_0x9fb8bc){return function(_0x5ea2c7){if(_0x5ea2c7){var _0x21aab8=typeof _0x9fb8bc['offset']==='undefined'&&typeof _0x9fb8bc[_0xcb63('0x1e')]===_0xcb63('0x1f');var _0x4bbdf8=_0x5ea2c7[_0xcb63('0x20')];var _0x238b85=_0x21aab8?0x0:_0x9fb8bc[_0xcb63('0x21')];var _0x44f78f=_0x21aab8?_0x5ea2c7[_0xcb63('0x20')]:_0x9fb8bc[_0xcb63('0x21')]+_0x9fb8bc[_0xcb63('0x1e')];var _0x491443;if(_0x44f78f>=_0x4bbdf8){_0x44f78f=_0x4bbdf8;_0x491443=0xc8;}else{_0x491443=0xce;}_0x2bebdb[_0xcb63('0x1c')](_0x491443);return _0x2bebdb['set']('Content-Range',_0x238b85+'-'+_0x44f78f+'/'+_0x4bbdf8)['json'](_0x5ea2c7);}return null;};}function patchUpdates(_0x286c2c){return function(_0x30a22d){try{jsonpatch['apply'](_0x30a22d,_0x286c2c,!![]);}catch(_0x128e22){return BPromise[_0xcb63('0x22')](_0x128e22);}return _0x30a22d[_0xcb63('0x23')]();};}function saveUpdates(_0x41dc77,_0x58246e){return function(_0x30fb6f){if(_0x30fb6f){return _0x30fb6f[_0xcb63('0x24')](_0x41dc77)[_0xcb63('0x25')](function(_0x452231){return _0x452231;});}return null;};}function removeEntity(_0x5f5b,_0x5a7e0a){return function(_0x1c2269){if(_0x1c2269){return _0x1c2269[_0xcb63('0x26')]()[_0xcb63('0x25')](function(){_0x5f5b[_0xcb63('0x1c')](0xcc)[_0xcb63('0x1d')]();});}};}function handleEntityNotFound(_0x98baf6,_0x38ebfc){return function(_0x4ec113){if(!_0x4ec113){_0x98baf6[_0xcb63('0x27')](0x194);}return _0x4ec113;};}function handleError(_0x465c00,_0x1a4aa5){_0x1a4aa5=_0x1a4aa5||0x1f4;return function(_0x57c524){logger[_0xcb63('0x28')](_0x57c524[_0xcb63('0x29')]);if(_0x57c524[_0xcb63('0x2a')]){delete _0x57c524[_0xcb63('0x2a')];}_0x465c00[_0xcb63('0x1c')](_0x1a4aa5)[_0xcb63('0x2b')](_0x57c524);};}exports[_0xcb63('0x24')]=function(_0x1fea19,_0x3adc27){if(_0x1fea19[_0xcb63('0x2c')]['id']){delete _0x1fea19[_0xcb63('0x2c')]['id'];}return db[_0xcb63('0x2d')][_0xcb63('0x2e')]({'where':{'id':_0x1fea19['params']['id']}})['then'](handleEntityNotFound(_0x3adc27,null))['then'](saveUpdates(_0x1fea19[_0xcb63('0x2c')],null))[_0xcb63('0x25')](respondWithResult(_0x3adc27,null))['catch'](handleError(_0x3adc27,null));};exports['destroy']=function(_0x183b82,_0x4d6ac8){return db[_0xcb63('0x2d')]['find']({'where':{'id':_0x183b82['params']['id']}})[_0xcb63('0x25')](handleEntityNotFound(_0x4d6ac8,null))[_0xcb63('0x25')](removeEntity(_0x4d6ac8,null))[_0xcb63('0x2f')](handleError(_0x4d6ac8,null));}; \ No newline at end of file +var _0xed32=['fs-extra','lodash','jsforce','desk.js','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','stack','name','send','update','body','Action','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x55a26f,_0x16f9bd){var _0x32590e=function(_0x52c912){while(--_0x52c912){_0x55a26f['push'](_0x55a26f['shift']());}};_0x32590e(++_0x16f9bd);}(_0xed32,0x1ba));var _0x2ed3=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xed32[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x2ed3('0x0'));var rimraf=require(_0x2ed3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ed3('0x2'));var rp=require('request-promise');var moment=require(_0x2ed3('0x3'));var BPromise=require(_0x2ed3('0x4'));var Mustache=require('mustache');var util=require(_0x2ed3('0x5'));var path=require('path');var sox=require(_0x2ed3('0x6'));var csv=require(_0x2ed3('0x7'));var ejs=require(_0x2ed3('0x8'));var fs=require('fs');var fs_extra=require(_0x2ed3('0x9'));var _=require(_0x2ed3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2ed3('0xb'));var deskjs=require(_0x2ed3('0xc'));var toCsv=require(_0x2ed3('0x7'));var querystring=require('querystring');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(_0x2ed3('0xd'));var logger=require(_0x2ed3('0xe'))('api');var utils=require(_0x2ed3('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x2ed3('0x10'));var db=require(_0x2ed3('0x11'))['db'];function respondWithStatusCode(_0x983ecc,_0x442ff0){_0x442ff0=_0x442ff0||0xcc;return function(_0x556b4a){if(_0x556b4a){return _0x983ecc[_0x2ed3('0x12')](_0x442ff0);}return _0x983ecc[_0x2ed3('0x13')](_0x442ff0)[_0x2ed3('0x14')]();};}function respondWithResult(_0x3d845f,_0x633979){_0x633979=_0x633979||0xc8;return function(_0x2f12b5){if(_0x2f12b5){return _0x3d845f['status'](_0x633979)[_0x2ed3('0x15')](_0x2f12b5);}};}function respondWithFilteredResult(_0x14700b,_0x139c21){return function(_0x19a320){if(_0x19a320){var _0x18d548=typeof _0x139c21['offset']==='undefined'&&typeof _0x139c21[_0x2ed3('0x16')]===_0x2ed3('0x17');var _0x1853f2=_0x19a320[_0x2ed3('0x18')];var _0x30d83a=_0x18d548?0x0:_0x139c21[_0x2ed3('0x19')];var _0xa77875=_0x18d548?_0x19a320[_0x2ed3('0x18')]:_0x139c21['offset']+_0x139c21[_0x2ed3('0x16')];var _0x25acde;if(_0xa77875>=_0x1853f2){_0xa77875=_0x1853f2;_0x25acde=0xc8;}else{_0x25acde=0xce;}_0x14700b[_0x2ed3('0x13')](_0x25acde);return _0x14700b[_0x2ed3('0x1a')](_0x2ed3('0x1b'),_0x30d83a+'-'+_0xa77875+'/'+_0x1853f2)[_0x2ed3('0x15')](_0x19a320);}return null;};}function patchUpdates(_0x1a2565){return function(_0x3e7968){try{jsonpatch[_0x2ed3('0x1c')](_0x3e7968,_0x1a2565,!![]);}catch(_0x1756a2){return BPromise[_0x2ed3('0x1d')](_0x1756a2);}return _0x3e7968['save']();};}function saveUpdates(_0x4ea73f,_0x3be596){return function(_0x427647){if(_0x427647){return _0x427647['update'](_0x4ea73f)['then'](function(_0xebf2c4){return _0xebf2c4;});}return null;};}function removeEntity(_0x486f10,_0x3cb086){return function(_0x410fb1){if(_0x410fb1){return _0x410fb1['destroy']()[_0x2ed3('0x1e')](function(){_0x486f10[_0x2ed3('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1a33,_0x127e33){return function(_0x1d1041){if(!_0x1d1041){_0x5e1a33[_0x2ed3('0x12')](0x194);}return _0x1d1041;};}function handleError(_0x16454d,_0x319715){_0x319715=_0x319715||0x1f4;return function(_0x5c666e){logger['error'](_0x5c666e[_0x2ed3('0x1f')]);if(_0x5c666e[_0x2ed3('0x20')]){delete _0x5c666e[_0x2ed3('0x20')];}_0x16454d[_0x2ed3('0x13')](_0x319715)[_0x2ed3('0x21')](_0x5c666e);};}exports[_0x2ed3('0x22')]=function(_0x1e4ac7,_0x584fdb){if(_0x1e4ac7[_0x2ed3('0x23')]['id']){delete _0x1e4ac7[_0x2ed3('0x23')]['id'];}return db[_0x2ed3('0x24')][_0x2ed3('0x25')]({'where':{'id':_0x1e4ac7[_0x2ed3('0x26')]['id']}})[_0x2ed3('0x1e')](handleEntityNotFound(_0x584fdb,null))[_0x2ed3('0x1e')](saveUpdates(_0x1e4ac7[_0x2ed3('0x23')],null))['then'](respondWithResult(_0x584fdb,null))[_0x2ed3('0x27')](handleError(_0x584fdb,null));};exports[_0x2ed3('0x28')]=function(_0x21dd29,_0x58c55a){return db['Action'][_0x2ed3('0x25')]({'where':{'id':_0x21dd29[_0x2ed3('0x26')]['id']}})['then'](handleEntityNotFound(_0x58c55a,null))[_0x2ed3('0x1e')](removeEntity(_0x58c55a,null))[_0x2ed3('0x27')](handleError(_0x58c55a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index c08091f..e6cf951 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 _0xa57c=['rimraf','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','moment','path'];(function(_0x2c7de4,_0x57370c){var _0x5dc96d=function(_0x498b89){while(--_0x498b89){_0x2c7de4['push'](_0x2c7de4['shift']());}};_0x5dc96d(++_0x57370c);}(_0xa57c,0x1aa));var _0xca57=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xa57c[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0xca57('0x0'));var logger=require(_0xca57('0x1'))('api');var moment=require(_0xca57('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca57('0x3'));var rimraf=require(_0xca57('0x4'));var config=require('../../config/environment');var attributes=require(_0xca57('0x5'));module[_0xca57('0x6')]=function(_0x53ba60,_0x53ee3c){return _0x53ba60[_0xca57('0x7')](_0xca57('0x8'),attributes,{'tableName':_0xca57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf002=['api','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xf002,0xa6));var _0x2f00=function(_0x5e4aaf,_0x4d38e2){_0x5e4aaf=_0x5e4aaf-0x0;var _0x2b4fcc=_0xf002[_0x5e4aaf];return _0x2b4fcc;};'use strict';var _=require(_0x2f00('0x0'));var util=require(_0x2f00('0x1'));var logger=require(_0x2f00('0x2'))(_0x2f00('0x3'));var moment=require('moment');var BPromise=require(_0x2f00('0x4'));var rp=require(_0x2f00('0x5'));var fs=require('fs');var path=require(_0x2f00('0x6'));var rimraf=require('rimraf');var config=require(_0x2f00('0x7'));var attributes=require(_0x2f00('0x8'));module[_0x2f00('0x9')]=function(_0x581ca8,_0x7fd3e7){return _0x581ca8[_0x2f00('0xa')](_0x2f00('0xb'),attributes,{'tableName':_0x2f00('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 03340c7..5f948c3 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x53ec,0x192));var _0xc53e=function(_0xf937d7,_0x59d955){_0xf937d7=_0xf937d7-0x0;var _0x39edc8=_0x53ec[_0xf937d7];return _0x39edc8;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x814b,0x1a2));var _0xb814=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x814b[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 2443e3b..d6c322a 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 _0x4832=['fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4832,0x1a7));var _0x2483=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x4832[_0x4ca333];return _0x13b2e1;};'use strict';var multer=require(_0x2483('0x0'));var util=require(_0x2483('0x1'));var path=require(_0x2483('0x2'));var timeout=require(_0x2483('0x3'));var express=require(_0x2483('0x4'));var router=express[_0x2483('0x5')]();var fs_extra=require(_0x2483('0x6'));var auth=require(_0x2483('0x7'));var interaction=require(_0x2483('0x8'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x2483('0x9')](_0x2483('0xa'),auth[_0x2483('0xb')](),controller[_0x2483('0xc')]);router['delete'](_0x2483('0xa'),auth[_0x2483('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1f2b=['put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x517f64,_0xf28929){var _0x4327ff=function(_0x4fcfa0){while(--_0x4fcfa0){_0x517f64['push'](_0x517f64['shift']());}};_0x4327ff(++_0xf28929);}(_0x1f2b,0xe7));var _0xb1f2=function(_0x36ef70,_0x3e0f69){_0x36ef70=_0x36ef70-0x0;var _0x10d75b=_0x1f2b[_0x36ef70];return _0x10d75b;};'use strict';var multer=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var path=require(_0xb1f2('0x2'));var timeout=require(_0xb1f2('0x3'));var express=require(_0xb1f2('0x4'));var router=express['Router']();var fs_extra=require(_0xb1f2('0x5'));var auth=require(_0xb1f2('0x6'));var interaction=require(_0xb1f2('0x7'));var config=require('../../config/environment');var controller=require(_0xb1f2('0x8'));router[_0xb1f2('0x9')](_0xb1f2('0xa'),auth[_0xb1f2('0xb')](),controller[_0xb1f2('0xc')]);router[_0xb1f2('0xd')](_0xb1f2('0xa'),auth['isAuthenticated'](),controller[_0xb1f2('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d0bbd1e..c816724 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x2adfd4,_0x3fb08c){var _0x3532b6=function(_0x2d525f){while(--_0x2d525f){_0x2adfd4['push'](_0x2adfd4['shift']());}};_0x3532b6(++_0x3fb08c);}(_0x7217,0x19e));var _0x7721=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x7217[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0xbe0d54,_0x5c3362){var _0x13e619=function(_0xfa3e7f){while(--_0xfa3e7f){_0xbe0d54['push'](_0xbe0d54['shift']());}};_0x13e619(++_0x5c3362);}(_0x2eb2,0x19f));var _0x22eb=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x2eb2[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index be6e57d..b538443 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 _0x2c38=['options','includeAll','include','rows','params','rawAttributes','length','find','catch','body','user','role','Reports','autoAssociation','create','CustomReports','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','metric','alias','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','then','destroy','get','error','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0xe33b12,_0x2a9761){var _0x30699d=function(_0x209952){while(--_0x209952){_0xe33b12['push'](_0xe33b12['shift']());}};_0x30699d(++_0x2a9761);}(_0x2c38,0x109));var _0x82c3=function(_0x5e941f,_0x41d741){_0x5e941f=_0x5e941f-0x0;var _0x5b52c4=_0x2c38[_0x5e941f];return _0x5b52c4;};'use strict';var emlformat=require(_0x82c3('0x0'));var rimraf=require(_0x82c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82c3('0x2'));var moment=require(_0x82c3('0x3'));var BPromise=require(_0x82c3('0x4'));var Mustache=require('mustache');var util=require(_0x82c3('0x5'));var path=require(_0x82c3('0x6'));var sox=require(_0x82c3('0x7'));var csv=require(_0x82c3('0x8'));var ejs=require(_0x82c3('0x9'));var fs=require('fs');var fs_extra=require(_0x82c3('0xa'));var _=require('lodash');var squel=require(_0x82c3('0xb'));var crypto=require(_0x82c3('0xc'));var jsforce=require(_0x82c3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x82c3('0x8'));var querystring=require('querystring');var Papa=require(_0x82c3('0xe'));var Redis=require(_0x82c3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x82c3('0x10'));var hardwareService=require(_0x82c3('0x11'));var logger=require(_0x82c3('0x12'))(_0x82c3('0x13'));var utils=require(_0x82c3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x82c3('0x15'));var db=require(_0x82c3('0x16'))['db'];var dbH=require(_0x82c3('0x16'))[_0x82c3('0x17')];function respondWithStatusCode(_0x4f29b0,_0x2e0955){_0x2e0955=_0x2e0955||0xcc;return function(_0x44b214){if(_0x44b214){return _0x4f29b0[_0x82c3('0x18')](_0x2e0955);}return _0x4f29b0['status'](_0x2e0955)[_0x82c3('0x19')]();};}function respondWithResult(_0x144f2d,_0x25afe1){_0x25afe1=_0x25afe1||0xc8;return function(_0x582966){if(_0x582966){return _0x144f2d[_0x82c3('0x1a')](_0x25afe1)[_0x82c3('0x1b')](_0x582966);}};}function respondWithFilteredResult(_0x16ddbd,_0x56bdc9){return function(_0x29ce2c){if(_0x29ce2c){var _0x1aab92=typeof _0x56bdc9[_0x82c3('0x1c')]===_0x82c3('0x1d')&&typeof _0x56bdc9[_0x82c3('0x1e')]===_0x82c3('0x1d');var _0xa2ca3=_0x29ce2c[_0x82c3('0x1f')];var _0x2ac318=_0x1aab92?0x0:_0x56bdc9['offset'];var _0x4ce0b8=_0x1aab92?_0x29ce2c[_0x82c3('0x1f')]:_0x56bdc9[_0x82c3('0x1c')]+_0x56bdc9[_0x82c3('0x1e')];var _0x2c457f;if(_0x4ce0b8>=_0xa2ca3){_0x4ce0b8=_0xa2ca3;_0x2c457f=0xc8;}else{_0x2c457f=0xce;}_0x16ddbd[_0x82c3('0x1a')](_0x2c457f);return _0x16ddbd[_0x82c3('0x20')]('Content-Range',_0x2ac318+'-'+_0x4ce0b8+'/'+_0xa2ca3)[_0x82c3('0x1b')](_0x29ce2c);}return null;};}function patchUpdates(_0x271a74){return function(_0x4f44e3){try{jsonpatch['apply'](_0x4f44e3,_0x271a74,!![]);}catch(_0x478739){return BPromise[_0x82c3('0x21')](_0x478739);}return _0x4f44e3['save']();};}function saveUpdates(_0x446f96,_0x5d68a8){return function(_0x5f3c1d){if(_0x5f3c1d){return _0x5f3c1d['update'](_0x446f96)[_0x82c3('0x22')](function(_0x1ab11e){return _0x1ab11e;});}return null;};}function removeEntity(_0x3e0908,_0x2edb8d){return function(_0x162616){if(_0x162616){return _0x162616[_0x82c3('0x23')]()[_0x82c3('0x22')](function(){var _0x25e4ec=_0x162616[_0x82c3('0x24')]({'plain':!![]});var _0x4e7e06='CustomReports';return db['UserProfileResource'][_0x82c3('0x23')]({'where':{'type':_0x4e7e06,'resourceId':_0x25e4ec['id']}})['then'](function(){return _0x162616;});})['then'](function(){_0x3e0908[_0x82c3('0x1a')](0xcc)[_0x82c3('0x19')]();});}};}function handleEntityNotFound(_0xa06a0b,_0x447185){return function(_0x34c4bd){if(!_0x34c4bd){_0xa06a0b['sendStatus'](0x194);}return _0x34c4bd;};}function handleError(_0x414f4c,_0x4692f4){_0x4692f4=_0x4692f4||0x1f4;return function(_0x472941){logger[_0x82c3('0x25')](_0x472941[_0x82c3('0x26')]);if(_0x472941[_0x82c3('0x27')]){delete _0x472941[_0x82c3('0x27')];}_0x414f4c[_0x82c3('0x1a')](_0x4692f4)['send'](_0x472941);};}exports[_0x82c3('0x28')]=function(_0x157c1c,_0x4d08ff){var _0x4e7739={},_0x4f3978={},_0xdc2711={'count':0x0,'rows':[]};var _0xc944bf=_[_0x82c3('0x29')](db[_0x82c3('0x2a')]['rawAttributes'],function(_0xa84d02){return{'name':_0xa84d02[_0x82c3('0x2b')],'type':_0xa84d02[_0x82c3('0x2c')][_0x82c3('0x2d')]};});_0x4f3978[_0x82c3('0x2e')]=_[_0x82c3('0x29')](_0xc944bf,_0x82c3('0x27'));_0x4f3978[_0x82c3('0x2f')]=_[_0x82c3('0x30')](_0x157c1c['query']);_0x4f3978[_0x82c3('0x31')]=_[_0x82c3('0x32')](_0x4f3978[_0x82c3('0x2e')],_0x4f3978['query']);_0x4e7739[_0x82c3('0x33')]=_[_0x82c3('0x32')](_0x4f3978[_0x82c3('0x2e')],qs[_0x82c3('0x34')](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x34')]));_0x4e7739[_0x82c3('0x33')]=_0x4e7739[_0x82c3('0x33')]['length']?_0x4e7739['attributes']:_0x4f3978[_0x82c3('0x2e')];if(!_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x35')](_0x82c3('0x36'))){_0x4e7739[_0x82c3('0x1e')]=qs['limit'](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x1e')]);_0x4e7739[_0x82c3('0x1c')]=qs[_0x82c3('0x1c')](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x1c')]);}_0x4e7739[_0x82c3('0x37')]=qs[_0x82c3('0x38')](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x38')]);_0x4e7739[_0x82c3('0x39')]=qs[_0x82c3('0x31')](_[_0x82c3('0x3a')](_0x157c1c[_0x82c3('0x2f')],_0x4f3978[_0x82c3('0x31')]),_0xc944bf);if(_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x3b')]){_0x4e7739[_0x82c3('0x39')]=_[_0x82c3('0x3c')](_0x4e7739[_0x82c3('0x39')],{'$or':_['map'](_0xc944bf,function(_0x46b934){if(_0x46b934[_0x82c3('0x2c')]!=='VIRTUAL'){var _0x2093c2={};_0x2093c2[_0x46b934['name']]={'$like':'%'+_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x3b')]+'%'};return _0x2093c2;}})});}_0x4e7739=_['merge']({},_0x4e7739,_0x157c1c[_0x82c3('0x3d')]);var _0x5697a0={'where':_0x4e7739['where']};return db[_0x82c3('0x2a')][_0x82c3('0x1f')](_0x5697a0)[_0x82c3('0x22')](function(_0x341aa6){_0xdc2711[_0x82c3('0x1f')]=_0x341aa6;if(_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x3e')]){_0x4e7739[_0x82c3('0x3f')]=[{'all':!![]}];}return db[_0x82c3('0x2a')]['findAll'](_0x4e7739);})[_0x82c3('0x22')](function(_0x3f4bc5){_0xdc2711[_0x82c3('0x40')]=_0x3f4bc5;return _0xdc2711;})['then'](respondWithFilteredResult(_0x4d08ff,_0x4e7739))['catch'](handleError(_0x4d08ff,null));};exports['show']=function(_0x1aaea4,_0x2013f8){var _0x5a26d7={'raw':![],'where':{'id':_0x1aaea4[_0x82c3('0x41')]['id']}},_0x59543c={};_0x59543c[_0x82c3('0x2e')]=_[_0x82c3('0x30')](db[_0x82c3('0x2a')][_0x82c3('0x42')]);_0x59543c[_0x82c3('0x2f')]=_[_0x82c3('0x30')](_0x1aaea4[_0x82c3('0x2f')]);_0x59543c[_0x82c3('0x31')]=_[_0x82c3('0x32')](_0x59543c['model'],_0x59543c[_0x82c3('0x2f')]);_0x5a26d7[_0x82c3('0x33')]=_[_0x82c3('0x32')](_0x59543c[_0x82c3('0x2e')],qs[_0x82c3('0x34')](_0x1aaea4[_0x82c3('0x2f')][_0x82c3('0x34')]));_0x5a26d7[_0x82c3('0x33')]=_0x5a26d7[_0x82c3('0x33')][_0x82c3('0x43')]?_0x5a26d7[_0x82c3('0x33')]:_0x59543c['model'];if(_0x1aaea4[_0x82c3('0x2f')][_0x82c3('0x3e')]){_0x5a26d7['include']=[{'all':!![]}];}_0x5a26d7=_[_0x82c3('0x3c')]({},_0x5a26d7,_0x1aaea4['options']);return db[_0x82c3('0x2a')][_0x82c3('0x44')](_0x5a26d7)[_0x82c3('0x22')](handleEntityNotFound(_0x2013f8,null))['then'](respondWithResult(_0x2013f8,null))[_0x82c3('0x45')](handleError(_0x2013f8,null));};exports['create']=function(_0x5aa83a,_0x31bbc2){return db[_0x82c3('0x2a')]['create'](_0x5aa83a[_0x82c3('0x46')],{})[_0x82c3('0x22')](function(_0x36ac00){var _0x5b148d=_0x5aa83a[_0x82c3('0x47')][_0x82c3('0x24')]({'plain':!![]});if(!_0x5b148d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b148d[_0x82c3('0x48')]===_0x82c3('0x47')){var _0x2bf3e5=_0x36ac00[_0x82c3('0x24')]({'plain':!![]});var _0x495102=_0x82c3('0x49');return db['UserProfileSection'][_0x82c3('0x44')]({'where':{'name':_0x495102,'userProfileId':_0x5b148d['userProfileId']},'raw':!![]})['then'](function(_0x5e2f63){if(_0x5e2f63&&_0x5e2f63[_0x82c3('0x4a')]===0x0){return db['UserProfileResource'][_0x82c3('0x4b')]({'name':_0x2bf3e5[_0x82c3('0x27')],'resourceId':_0x2bf3e5['id'],'type':_0x82c3('0x4c'),'sectionId':_0x5e2f63['id']},{})[_0x82c3('0x22')](function(){return _0x36ac00;});}else{return _0x36ac00;}})[_0x82c3('0x45')](function(_0x28e709){logger[_0x82c3('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28e709);throw _0x28e709;});}return _0x36ac00;})['then'](respondWithResult(_0x31bbc2,0xc9))[_0x82c3('0x45')](handleError(_0x31bbc2,null));};exports[_0x82c3('0x4d')]=function(_0xc5ffbf,_0x2db356){if(_0xc5ffbf[_0x82c3('0x46')]['id']){delete _0xc5ffbf['body']['id'];}return db[_0x82c3('0x2a')][_0x82c3('0x44')]({'where':{'id':_0xc5ffbf[_0x82c3('0x41')]['id']}})[_0x82c3('0x22')](handleEntityNotFound(_0x2db356,null))[_0x82c3('0x22')](saveUpdates(_0xc5ffbf['body'],null))[_0x82c3('0x22')](respondWithResult(_0x2db356,null))['catch'](handleError(_0x2db356,null));};exports[_0x82c3('0x23')]=function(_0x17da71,_0x501362){return db[_0x82c3('0x2a')]['find']({'where':{'id':_0x17da71[_0x82c3('0x41')]['id']}})[_0x82c3('0x22')](handleEntityNotFound(_0x501362,null))['then'](removeEntity(_0x501362,null))['catch'](handleError(_0x501362,null));};exports[_0x82c3('0x4e')]=function(_0x58de2e,_0x534dd1){var _0x16186d=0xa;var _0x2018c6=[_0x82c3('0x4f'),_0x82c3('0x50'),'right_join',_0x82c3('0x51')];var _0x1914e1={'SUM':_0x82c3('0x52'),'COUNT':_0x82c3('0x53'),'COUNT DISTINCT':_0x82c3('0x54'),'MAX':_0x82c3('0x55'),'MIN':_0x82c3('0x56'),'AVG':_0x82c3('0x57'),'GROUP_CONCAT':_0x82c3('0x58'),'GROUP_CONCAT ASC':_0x82c3('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a124e={'SEC_TO_TIME':_0x82c3('0x5a'),'DATE':_0x82c3('0x5b'),'HOUR':_0x82c3('0x5c'),'ROUND':_0x82c3('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x12d58a=function(_0x5c36b2){return!_[_0x82c3('0x5e')]([_0x82c3('0x5f'),_0x82c3('0x60'),_0x82c3('0x61'),_0x82c3('0x62')],_0x5c36b2);};var _0x5b3b1d=function(_0x3db486){if(!_0x3db486||!_0x3db486[_0x82c3('0x63')][_0x82c3('0x43')]){return'';}for(var _0x4c23a2='(',_0x36ae91=0x0;_0x36ae91<_0x3db486[_0x82c3('0x63')][_0x82c3('0x43')];_0x36ae91+=0x1){_0x36ae91>0x0&&(_0x4c23a2+='\x20'+_0x3db486[_0x82c3('0x64')]+'\x20');_0x4c23a2+=_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x65')]?_0x5b3b1d(_0x3db486[_0x82c3('0x63')][_0x36ae91]['group']):_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x66')]+'\x20'+_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x67')]+(_0x12d58a(_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x67')])?'\x20'+_0x3db486[_0x82c3('0x63')][_0x36ae91]['value']:'');}return _0x4c23a2+')';};var _0x1ff156={'where':{'id':_0x58de2e[_0x82c3('0x41')]['id']}},_0x49d332,_0x4da49a,_0x5ba2d1,_0x2ec994,_0x16c764;_0x1ff156=_[_0x82c3('0x3c')]({},_0x1ff156,_0x58de2e['options']);return db[_0x82c3('0x2a')][_0x82c3('0x44')](_0x1ff156)[_0x82c3('0x22')](function(_0x523fa7){if(_0x523fa7){_0x49d332=_0x523fa7;return _0x523fa7[_0x82c3('0x68')]();}return null;})[_0x82c3('0x22')](function(_0x55ba85){if(_0x55ba85){if(!_0x55ba85[_0x82c3('0x43')]){throw new db[(_0x82c3('0x69'))][(_0x82c3('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4da49a=_0x55ba85;return db['AnalyticMetric'][_0x82c3('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x406cc8){if(_0x406cc8){_0x5ba2d1=_[_0x82c3('0x6c')](_0x406cc8,'id');var _0x35f35a;var _0x1dced4=squel[_0x82c3('0x6d')]();_0x1dced4[_0x82c3('0x6e')](_0x49d332[_0x82c3('0x6f')]);for(var _0x13ef6d=0x0;_0x13ef6d<_0x4da49a['length'];_0x13ef6d+=0x1){_0x35f35a=_0x4da49a[_0x13ef6d][_0x82c3('0x70')]?_0x5ba2d1[_0x4da49a[_0x13ef6d]['MetricId']]['metric']:_0x4da49a[_0x13ef6d][_0x82c3('0x66')];_0x35f35a=_0x4da49a[_0x13ef6d][_0x82c3('0x71')]?_['replace'](_0x1914e1[_0x4da49a[_0x13ef6d][_0x82c3('0x71')]],'%s',_0x35f35a):_0x35f35a;_0x35f35a=_0x4da49a[_0x13ef6d][_0x82c3('0x72')]?_[_0x82c3('0x73')](_0x1a124e[_0x4da49a[_0x13ef6d]['format']],'%s',_0x35f35a):_0x35f35a;if(_0x4da49a[_0x13ef6d][_0x82c3('0x74')]){_0x1dced4[_0x82c3('0x65')](_0x35f35a);}_0x4da49a[_0x13ef6d][_0x82c3('0x75')]&&_0x1dced4['order'](_0x35f35a,_0x4da49a[_0x13ef6d][_0x82c3('0x75')]===_0x82c3('0x76')?![]:!![]);_0x1dced4[_0x82c3('0x66')](_0x35f35a,_0x4da49a[_0x13ef6d]['alias']||_0x35f35a);}if(_0x49d332[_0x82c3('0x77')]){_0x49d332[_0x82c3('0x77')]=JSON['parse'](_0x49d332[_0x82c3('0x77')]);for(var _0x111e1f=0x0;_0x111e1f<_0x49d332[_0x82c3('0x77')][_0x82c3('0x43')];_0x111e1f+=0x1){if(_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x2c')]&&_['includes'](_0x2018c6,_0x49d332[_0x82c3('0x77')][_0x111e1f]['type'])&&_0x49d332[_0x82c3('0x77')][_0x111e1f]['parentKey']&&_0x49d332[_0x82c3('0x77')][_0x111e1f]['foreignTable']&&_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x78')]){_0x1dced4[_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x2c')]](_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x79')],null,util['format'](_0x82c3('0x7a'),_0x49d332[_0x82c3('0x6f')],_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x7b')],_0x49d332[_0x82c3('0x77')][_0x111e1f]['foreignTable'],_0x49d332[_0x82c3('0x77')][_0x111e1f]['foreignKey']));}}}if(_0x49d332[_0x82c3('0x7c')]){_0x49d332[_0x82c3('0x7c')]=JSON[_0x82c3('0x7d')](_0x49d332[_0x82c3('0x7c')]);_0x1dced4[_0x82c3('0x39')](_0x5b3b1d(_0x49d332[_0x82c3('0x7c')][_0x82c3('0x65')]));}_0x16c764=_0x1dced4[_0x82c3('0x7e')]();_0x1dced4[_0x82c3('0x1e')](_0x16186d);_0x1dced4['offset'](0x0);logger[_0x82c3('0x7f')](_0x82c3('0x80'),_0x1dced4[_0x82c3('0x81')]());return dbH[_0x82c3('0x82')]['query'](_0x1dced4[_0x82c3('0x81')](),{'type':dbH['sequelize'][_0x82c3('0x83')][_0x82c3('0x84')]});}})['then'](respondWithResult(_0x534dd1,null))['catch'](handleError(_0x534dd1,null));};function runReport(_0x29b890,_0x412960,_0x1a2d90){var _0x11da75=_0x412960['name'];var _0x2458f1=0xa;var _0x5ea75d=[_0x82c3('0x4f'),_0x82c3('0x50'),_0x82c3('0x85'),_0x82c3('0x51')];var _0x52ae3d={'SUM':_0x82c3('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x82c3('0x54'),'MAX':_0x82c3('0x55'),'MIN':'MIN(%s)','AVG':_0x82c3('0x57'),'GROUP_CONCAT':_0x82c3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x82c3('0x86')};var _0x34fdfb={'SEC_TO_TIME':_0x82c3('0x5a'),'DATE':_0x82c3('0x5b'),'HOUR':_0x82c3('0x5c'),'ROUND':_0x82c3('0x5d'),'UNIX_TIMESTAMP':_0x82c3('0x87')};var _0x1d3745=function(_0x151232){return!_[_0x82c3('0x5e')]([_0x82c3('0x5f'),_0x82c3('0x60'),_0x82c3('0x61'),'IS\x20NOT\x20EMPTY'],_0x151232);};var _0x103a2e=function(_0x4c494d){if(!_0x4c494d||!_0x4c494d[_0x82c3('0x63')]['length']){return'';}for(var _0x1381ee='(',_0x1cfd58=0x0;_0x1cfd58<_0x4c494d['rules'][_0x82c3('0x43')];_0x1cfd58+=0x1){_0x1cfd58>0x0&&(_0x1381ee+='\x20'+_0x4c494d['operator']+'\x20');_0x1381ee+=_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x65')]?_0x103a2e(_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x65')]):_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x66')]+'\x20'+_0x4c494d[_0x82c3('0x63')][_0x1cfd58]['condition']+(_0x1d3745(_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x67')])?'\x20'+_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x88')]:'');}return _0x1381ee+')';};var _0x322984={'where':{'id':_0x29b890['id']}},_0x4a33ed,_0x1b83ae,_0x1356f3,_0x4ad8fa,_0x4767ea;_0x322984=_['merge']({},_0x322984,_0x1a2d90);return db['AnalyticCustomReport'][_0x82c3('0x44')](_0x322984)['then'](function(_0x492ccf){if(_0x492ccf){_0x4a33ed=_0x492ccf;return _0x492ccf['getFields']();}return null;})['then'](function(_0x66ceb9){if(_0x66ceb9){if(!_0x66ceb9[_0x82c3('0x43')]){throw new db[(_0x82c3('0x69'))][(_0x82c3('0x6a'))](_0x82c3('0x89'),0x193);}_0x1b83ae=_0x66ceb9;return db[_0x82c3('0x8a')]['findAll']({'raw':!![]});}return null;})[_0x82c3('0x22')](function(_0x5f4fff){if(_0x5f4fff){_0x1356f3=_[_0x82c3('0x6c')](_0x5f4fff,'id');var _0x53e377;var _0x22a060=squel[_0x82c3('0x6d')]();_0x22a060[_0x82c3('0x6e')](_0x4a33ed['table']);for(var _0xa79212=0x0;_0xa79212<_0x1b83ae[_0x82c3('0x43')];_0xa79212+=0x1){_0x53e377=_0x1b83ae[_0xa79212]['MetricId']?_0x1356f3[_0x1b83ae[_0xa79212]['MetricId']][_0x82c3('0x8b')]:_0x1b83ae[_0xa79212]['field'];_0x53e377=_0x1b83ae[_0xa79212][_0x82c3('0x71')]?_[_0x82c3('0x73')](_0x52ae3d[_0x1b83ae[_0xa79212][_0x82c3('0x71')]],'%s',_0x53e377):_0x53e377;_0x53e377=_0x1b83ae[_0xa79212]['format']?_[_0x82c3('0x73')](_0x34fdfb[_0x1b83ae[_0xa79212][_0x82c3('0x72')]],'%s',_0x53e377):_0x53e377;if(_0x1b83ae[_0xa79212][_0x82c3('0x74')]){_0x22a060['group'](_0x53e377);}_0x1b83ae[_0xa79212][_0x82c3('0x75')]&&_0x22a060[_0x82c3('0x37')](_0x53e377,_0x1b83ae[_0xa79212][_0x82c3('0x75')]===_0x82c3('0x76')?![]:!![]);_0x22a060[_0x82c3('0x66')](_0x53e377,_0x1b83ae[_0xa79212][_0x82c3('0x8c')]||_0x53e377);}if(_0x4a33ed[_0x82c3('0x77')]){_0x4a33ed[_0x82c3('0x77')]=JSON[_0x82c3('0x7d')](_0x4a33ed[_0x82c3('0x77')]);for(var _0x42b254=0x0;_0x42b254<_0x4a33ed[_0x82c3('0x77')]['length'];_0x42b254+=0x1){if(_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x2c')]&&_['includes'](_0x5ea75d,_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x2c')])&&_0x4a33ed['joins'][_0x42b254][_0x82c3('0x7b')]&&_0x4a33ed[_0x82c3('0x77')][_0x42b254]['foreignTable']&&_0x4a33ed['joins'][_0x42b254]['foreignKey']){_0x22a060[_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x2c')]](_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x79')],null,util[_0x82c3('0x72')](_0x82c3('0x7a'),_0x4a33ed[_0x82c3('0x6f')],_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x7b')],_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x79')],_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x78')]));}}}if(_0x4a33ed['conditions']){_0x4a33ed['conditions']=JSON['parse'](_0x4a33ed[_0x82c3('0x7c')]);_0x22a060[_0x82c3('0x39')](_0x103a2e(_0x4a33ed[_0x82c3('0x7c')][_0x82c3('0x65')]));}_0x4767ea=_0x22a060[_0x82c3('0x7e')]();_0x22a060[_0x82c3('0x1e')](_0x2458f1);_0x22a060['offset'](0x0);return;}})[_0x82c3('0x22')](function(){if(_0x412960[_0x82c3('0x8d')]==='web'){return null;}var _0x3099b7=_[_0x82c3('0x3c')](_0x412960,{'name':_0x412960[_0x82c3('0x8e')]||_0x412960[_0x82c3('0x27')]||_0x4a33ed[_0x82c3('0x27')],'basename':_0x11da75,'savename':util[_0x82c3('0x72')](_0x82c3('0x8f'),_0x412960[_0x82c3('0x27')]||_0x4a33ed['name'],require('randomstring')[_0x82c3('0x90')](0x4),_0x412960[_0x82c3('0x8d')]||_0x82c3('0x91')),'reportId':_0x4a33ed['id'],'reportType':_0x82c3('0x92')});return db[_0x82c3('0x93')][_0x82c3('0x4b')](_0x3099b7,{'raw':!![]});})[_0x82c3('0x22')](function(_0x45f76d){if(_0x4a33ed[_0x82c3('0x6f')]===_0x82c3('0x94')){_0x4767ea[_0x82c3('0x39')](_0x4a33ed[_0x82c3('0x6f')]+_0x82c3('0x95'),_0x412960['startDate'],_0x412960[_0x82c3('0x96')]);}else{_0x4767ea['where'](_0x4a33ed[_0x82c3('0x6f')]+_0x82c3('0x97'),_0x412960[_0x82c3('0x98')],_0x412960['endDate']);}if(_0x45f76d){logger[_0x82c3('0x99')]('Run\x20Query:',_0x4767ea['toString']());require(_0x82c3('0x9a'))[_0x82c3('0x9b')](path['join'](__dirname,_0x82c3('0x9c'),_0x45f76d[_0x82c3('0x8d')]),[_0x45f76d['id'],_0x4767ea[_0x82c3('0x81')](),path[_0x82c3('0x4f')](__dirname,_0x82c3('0x9d'),_0x45f76d[_0x82c3('0x9e')]),_0x11da75]);return _0x45f76d;}else{var _0x78c50e=squel[_0x82c3('0x6d')]();_0x78c50e[_0x82c3('0x6e')]('('+_0x4767ea[_0x82c3('0x81')]()+')',_0x82c3('0x9f'));_0x78c50e[_0x82c3('0x66')](_0x82c3('0xa0'),_0x82c3('0x1f'));_0x4767ea['limit'](_0x412960['limit']||_0x2458f1);_0x4767ea[_0x82c3('0x1c')](_0x412960[_0x82c3('0x1c')]||0x0);return dbH[_0x82c3('0x82')]['query'](_0x78c50e[_0x82c3('0x81')](),{'type':dbH[_0x82c3('0x82')][_0x82c3('0x83')][_0x82c3('0x84')]})[_0x82c3('0x22')](function(_0x1d4710){if(!_0x1d4710[_0x82c3('0x43')]){_0x4ad8fa=0x0;}else{_0x4ad8fa=_0x1d4710[0x0][_0x82c3('0x1f')]||0x0;}return dbH['sequelize'][_0x82c3('0x2f')](_0x4767ea[_0x82c3('0x81')](),{'type':dbH[_0x82c3('0x82')][_0x82c3('0x83')][_0x82c3('0x84')]});})[_0x82c3('0x22')](function(_0x2dac7d){return{'rows':_0x2dac7d||[],'count':_0x4ad8fa};});}});}exports[_0x82c3('0xa1')]=function(_0x444390,_0x1c877b){return runReport(_0x444390[_0x82c3('0x41')],_0x444390['query'],_0x444390['options'])[_0x82c3('0x22')](respondWithResult(_0x1c877b,null))[_0x82c3('0x45')](handleError(_0x1c877b,null));};exports[_0x82c3('0xa2')]=runReport;exports[_0x82c3('0x2f')]=function(_0x3f6f53,_0x7d4111){var _0x4cc07d=0xa;var _0x11fa8c=[_0x82c3('0x4f'),'left_join','right_join',_0x82c3('0x51')];var _0x137ee1={'SUM':_0x82c3('0x52'),'COUNT':_0x82c3('0x53'),'COUNT DISTINCT':_0x82c3('0x54'),'MAX':_0x82c3('0x55'),'MIN':_0x82c3('0x56'),'AVG':_0x82c3('0x57'),'GROUP_CONCAT':_0x82c3('0x58'),'GROUP_CONCAT ASC':_0x82c3('0x59'),'GROUP_CONCAT DESC':_0x82c3('0x86')};var _0x1b172a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x82c3('0x5b'),'HOUR':_0x82c3('0x5c'),'ROUND':_0x82c3('0x5d'),'UNIX_TIMESTAMP':_0x82c3('0x87')};var _0x540991=function(_0x3a5c45){return!_[_0x82c3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x3a5c45);};var _0x51a02b=function(_0x4f8326){if(!_0x4f8326||!_0x4f8326[_0x82c3('0x63')][_0x82c3('0x43')]){return'';}for(var _0x11201f='(',_0x345fc7=0x0;_0x345fc7<_0x4f8326[_0x82c3('0x63')]['length'];_0x345fc7+=0x1){_0x345fc7>0x0&&(_0x11201f+='\x20'+_0x4f8326['operator']+'\x20');_0x11201f+=_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x65')]?_0x51a02b(_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x65')]):_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x66')]+'\x20'+_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x67')]+(_0x540991(_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x67')])?'\x20'+_0x4f8326['rules'][_0x345fc7][_0x82c3('0x88')]:'');}return _0x11201f+')';};var _0x11c749={'where':{'id':_0x3f6f53['params']['id']}},_0x27626b,_0x168c7a,_0x1a574d,_0x20a5ba,_0x36081b;_0x11c749=_['merge']({},_0x11c749,_0x3f6f53[_0x82c3('0x3d')]);return db['AnalyticCustomReport'][_0x82c3('0x44')](_0x11c749)[_0x82c3('0x22')](function(_0x30ab9e){if(_0x30ab9e){_0x27626b=_0x30ab9e;return _0x30ab9e[_0x82c3('0x68')]();}return null;})['then'](function(_0x133bc8){if(_0x133bc8){if(!_0x133bc8[_0x82c3('0x43')]){throw new db[(_0x82c3('0x69'))]['ValidationErrorItem'](_0x82c3('0x89'),0x193);}_0x168c7a=_0x133bc8;return db['AnalyticMetric'][_0x82c3('0x6b')]({'raw':!![]});}return null;})[_0x82c3('0x22')](function(_0x2648a5){if(_0x2648a5){_0x1a574d=_[_0x82c3('0x6c')](_0x2648a5,'id');var _0x2f52a0;var _0x26a832=squel[_0x82c3('0x6d')]();_0x26a832[_0x82c3('0x6e')](_0x27626b[_0x82c3('0x6f')]);for(var _0x184018=0x0;_0x184018<_0x168c7a['length'];_0x184018+=0x1){_0x2f52a0=_0x168c7a[_0x184018][_0x82c3('0x70')]?_0x1a574d[_0x168c7a[_0x184018][_0x82c3('0x70')]]['metric']:_0x168c7a[_0x184018][_0x82c3('0x66')];_0x2f52a0=_0x168c7a[_0x184018][_0x82c3('0x71')]?_[_0x82c3('0x73')](_0x137ee1[_0x168c7a[_0x184018][_0x82c3('0x71')]],'%s',_0x2f52a0):_0x2f52a0;_0x2f52a0=_0x168c7a[_0x184018][_0x82c3('0x72')]?_[_0x82c3('0x73')](_0x1b172a[_0x168c7a[_0x184018][_0x82c3('0x72')]],'%s',_0x2f52a0):_0x2f52a0;if(_0x168c7a[_0x184018]['groupBy']){_0x26a832['group'](_0x2f52a0);}_0x168c7a[_0x184018]['orderBy']&&_0x26a832['order'](_0x2f52a0,_0x168c7a[_0x184018][_0x82c3('0x75')]===_0x82c3('0x76')?![]:!![]);_0x26a832[_0x82c3('0x66')](_0x2f52a0,_0x168c7a[_0x184018]['alias']||_0x2f52a0);}if(_0x27626b[_0x82c3('0x77')]){_0x27626b[_0x82c3('0x77')]=JSON[_0x82c3('0x7d')](_0x27626b['joins']);for(var _0x5beec4=0x0;_0x5beec4<_0x27626b['joins']['length'];_0x5beec4+=0x1){if(_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x2c')]&&_[_0x82c3('0x5e')](_0x11fa8c,_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x2c')])&&_0x27626b[_0x82c3('0x77')][_0x5beec4]['parentKey']&&_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x79')]&&_0x27626b['joins'][_0x5beec4][_0x82c3('0x78')]){_0x26a832[_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x2c')]](_0x27626b['joins'][_0x5beec4][_0x82c3('0x79')],null,util[_0x82c3('0x72')](_0x82c3('0x7a'),_0x27626b[_0x82c3('0x6f')],_0x27626b['joins'][_0x5beec4][_0x82c3('0x7b')],_0x27626b[_0x82c3('0x77')][_0x5beec4]['foreignTable'],_0x27626b[_0x82c3('0x77')][_0x5beec4]['foreignKey']));}}}if(_0x27626b['conditions']){_0x27626b['conditions']=JSON[_0x82c3('0x7d')](_0x27626b['conditions']);_0x26a832['where'](_0x51a02b(_0x27626b[_0x82c3('0x7c')][_0x82c3('0x65')]));}_0x36081b=_0x26a832['clone']();_0x26a832[_0x82c3('0x1e')](_0x4cc07d);_0x26a832[_0x82c3('0x1c')](0x0);logger[_0x82c3('0x7f')](_0x82c3('0x80'),_0x26a832[_0x82c3('0x81')]());return dbH['sequelize'][_0x82c3('0x2f')](_0x26a832[_0x82c3('0x81')](),{'type':dbH[_0x82c3('0x82')][_0x82c3('0x83')][_0x82c3('0x84')]});}})['then'](function(){return{'sql':_0x36081b['toString']()};})[_0x82c3('0x22')](respondWithResult(_0x7d4111,null))[_0x82c3('0x45')](handleError(_0x7d4111,null));}; \ No newline at end of file +var _0xfdbf=['group','field','condition','value','getFields','Sequelize','AnalyticMetric','keyBy','select','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','alias','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','output','../../files/reports','savename','countTable','COUNT(*)','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator'];(function(_0x29e8c3,_0x41b386){var _0x5a7ee9=function(_0x108b00){while(--_0x108b00){_0x29e8c3['push'](_0x29e8c3['shift']());}};_0x5a7ee9(++_0x41b386);}(_0xfdbf,0xe1));var _0xffdb=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xfdbf[_0x480bc8];return _0x28c245;};'use strict';var emlformat=require(_0xffdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffdb('0x1'));var jsonpatch=require(_0xffdb('0x2'));var rp=require(_0xffdb('0x3'));var moment=require(_0xffdb('0x4'));var BPromise=require(_0xffdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xffdb('0x6'));var sox=require(_0xffdb('0x7'));var csv=require(_0xffdb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffdb('0x9'));var _=require(_0xffdb('0xa'));var squel=require(_0xffdb('0xb'));var crypto=require(_0xffdb('0xc'));var jsforce=require(_0xffdb('0xd'));var deskjs=require(_0xffdb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xffdb('0xf'));var Papa=require(_0xffdb('0x10'));var Redis=require(_0xffdb('0x11'));var authService=require(_0xffdb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xffdb('0x13'));var hardwareService=require(_0xffdb('0x14'));var logger=require(_0xffdb('0x15'))('api');var utils=require(_0xffdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xffdb('0x17'));var db=require(_0xffdb('0x18'))['db'];var dbH=require(_0xffdb('0x18'))[_0xffdb('0x19')];function respondWithStatusCode(_0x4ce2b2,_0x64dc27){_0x64dc27=_0x64dc27||0xcc;return function(_0x1b5607){if(_0x1b5607){return _0x4ce2b2['sendStatus'](_0x64dc27);}return _0x4ce2b2[_0xffdb('0x1a')](_0x64dc27)[_0xffdb('0x1b')]();};}function respondWithResult(_0x101f71,_0x2ff189){_0x2ff189=_0x2ff189||0xc8;return function(_0x10539c){if(_0x10539c){return _0x101f71[_0xffdb('0x1a')](_0x2ff189)['json'](_0x10539c);}};}function respondWithFilteredResult(_0x14d1a4,_0x40830b){return function(_0x1c2ec8){if(_0x1c2ec8){var _0x3bc9bf=typeof _0x40830b[_0xffdb('0x1c')]===_0xffdb('0x1d')&&typeof _0x40830b[_0xffdb('0x1e')]==='undefined';var _0x237986=_0x1c2ec8[_0xffdb('0x1f')];var _0x3cbad6=_0x3bc9bf?0x0:_0x40830b[_0xffdb('0x1c')];var _0x2e388e=_0x3bc9bf?_0x1c2ec8[_0xffdb('0x1f')]:_0x40830b[_0xffdb('0x1c')]+_0x40830b[_0xffdb('0x1e')];var _0x5478a7;if(_0x2e388e>=_0x237986){_0x2e388e=_0x237986;_0x5478a7=0xc8;}else{_0x5478a7=0xce;}_0x14d1a4['status'](_0x5478a7);return _0x14d1a4[_0xffdb('0x20')](_0xffdb('0x21'),_0x3cbad6+'-'+_0x2e388e+'/'+_0x237986)[_0xffdb('0x22')](_0x1c2ec8);}return null;};}function patchUpdates(_0x1be0de){return function(_0x401d62){try{jsonpatch['apply'](_0x401d62,_0x1be0de,!![]);}catch(_0x43382e){return BPromise['reject'](_0x43382e);}return _0x401d62[_0xffdb('0x23')]();};}function saveUpdates(_0xd3f171,_0x535bb1){return function(_0x478d30){if(_0x478d30){return _0x478d30[_0xffdb('0x24')](_0xd3f171)[_0xffdb('0x25')](function(_0x33fb22){return _0x33fb22;});}return null;};}function removeEntity(_0x2ada72,_0x44be87){return function(_0x487790){if(_0x487790){return _0x487790['destroy']()[_0xffdb('0x25')](function(){var _0x1aaa72=_0x487790[_0xffdb('0x26')]({'plain':!![]});var _0x25dd7c=_0xffdb('0x27');return db[_0xffdb('0x28')][_0xffdb('0x29')]({'where':{'type':_0x25dd7c,'resourceId':_0x1aaa72['id']}})[_0xffdb('0x25')](function(){return _0x487790;});})['then'](function(){_0x2ada72[_0xffdb('0x1a')](0xcc)[_0xffdb('0x1b')]();});}};}function handleEntityNotFound(_0x1d1ff7,_0x5bfe76){return function(_0x5f030e){if(!_0x5f030e){_0x1d1ff7[_0xffdb('0x2a')](0x194);}return _0x5f030e;};}function handleError(_0x423a47,_0x101ebf){_0x101ebf=_0x101ebf||0x1f4;return function(_0x4a45f1){logger[_0xffdb('0x2b')](_0x4a45f1[_0xffdb('0x2c')]);if(_0x4a45f1[_0xffdb('0x2d')]){delete _0x4a45f1[_0xffdb('0x2d')];}_0x423a47['status'](_0x101ebf)[_0xffdb('0x2e')](_0x4a45f1);};}exports['index']=function(_0x57610c,_0x2e5ea7){var _0xccd801={},_0x41a2c1={},_0x3c1f12={'count':0x0,'rows':[]};var _0x47cba5=_[_0xffdb('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5407d1){return{'name':_0x5407d1['fieldName'],'type':_0x5407d1[_0xffdb('0x30')]['key']};});_0x41a2c1[_0xffdb('0x31')]=_[_0xffdb('0x2f')](_0x47cba5,'name');_0x41a2c1[_0xffdb('0x32')]=_[_0xffdb('0x33')](_0x57610c['query']);_0x41a2c1[_0xffdb('0x34')]=_[_0xffdb('0x35')](_0x41a2c1[_0xffdb('0x31')],_0x41a2c1[_0xffdb('0x32')]);_0xccd801['attributes']=_['intersection'](_0x41a2c1[_0xffdb('0x31')],qs[_0xffdb('0x36')](_0x57610c['query'][_0xffdb('0x36')]));_0xccd801[_0xffdb('0x37')]=_0xccd801[_0xffdb('0x37')][_0xffdb('0x38')]?_0xccd801['attributes']:_0x41a2c1['model'];if(!_0x57610c[_0xffdb('0x32')][_0xffdb('0x39')](_0xffdb('0x3a'))){_0xccd801['limit']=qs[_0xffdb('0x1e')](_0x57610c['query']['limit']);_0xccd801['offset']=qs[_0xffdb('0x1c')](_0x57610c[_0xffdb('0x32')][_0xffdb('0x1c')]);}_0xccd801[_0xffdb('0x3b')]=qs[_0xffdb('0x3c')](_0x57610c[_0xffdb('0x32')][_0xffdb('0x3c')]);_0xccd801[_0xffdb('0x3d')]=qs[_0xffdb('0x34')](_[_0xffdb('0x3e')](_0x57610c['query'],_0x41a2c1['filters']),_0x47cba5);if(_0x57610c[_0xffdb('0x32')][_0xffdb('0x3f')]){_0xccd801[_0xffdb('0x3d')]=_[_0xffdb('0x40')](_0xccd801[_0xffdb('0x3d')],{'$or':_[_0xffdb('0x2f')](_0x47cba5,function(_0x3eb3c0){if(_0x3eb3c0[_0xffdb('0x30')]!=='VIRTUAL'){var _0x56c588={};_0x56c588[_0x3eb3c0['name']]={'$like':'%'+_0x57610c[_0xffdb('0x32')][_0xffdb('0x3f')]+'%'};return _0x56c588;}})});}_0xccd801=_[_0xffdb('0x40')]({},_0xccd801,_0x57610c[_0xffdb('0x41')]);var _0x2ec878={'where':_0xccd801[_0xffdb('0x3d')]};return db[_0xffdb('0x42')][_0xffdb('0x1f')](_0x2ec878)['then'](function(_0x3d1333){_0x3c1f12[_0xffdb('0x1f')]=_0x3d1333;if(_0x57610c[_0xffdb('0x32')][_0xffdb('0x43')]){_0xccd801[_0xffdb('0x44')]=[{'all':!![]}];}return db[_0xffdb('0x42')][_0xffdb('0x45')](_0xccd801);})[_0xffdb('0x25')](function(_0x568308){_0x3c1f12['rows']=_0x568308;return _0x3c1f12;})[_0xffdb('0x25')](respondWithFilteredResult(_0x2e5ea7,_0xccd801))[_0xffdb('0x46')](handleError(_0x2e5ea7,null));};exports[_0xffdb('0x47')]=function(_0x212264,_0x2c92cc){var _0x47dfd7={'raw':![],'where':{'id':_0x212264[_0xffdb('0x48')]['id']}},_0x64e9cb={};_0x64e9cb[_0xffdb('0x31')]=_[_0xffdb('0x33')](db['AnalyticCustomReport'][_0xffdb('0x49')]);_0x64e9cb['query']=_['keys'](_0x212264[_0xffdb('0x32')]);_0x64e9cb[_0xffdb('0x34')]=_[_0xffdb('0x35')](_0x64e9cb[_0xffdb('0x31')],_0x64e9cb[_0xffdb('0x32')]);_0x47dfd7[_0xffdb('0x37')]=_[_0xffdb('0x35')](_0x64e9cb[_0xffdb('0x31')],qs[_0xffdb('0x36')](_0x212264[_0xffdb('0x32')][_0xffdb('0x36')]));_0x47dfd7[_0xffdb('0x37')]=_0x47dfd7[_0xffdb('0x37')][_0xffdb('0x38')]?_0x47dfd7[_0xffdb('0x37')]:_0x64e9cb[_0xffdb('0x31')];if(_0x212264[_0xffdb('0x32')][_0xffdb('0x43')]){_0x47dfd7[_0xffdb('0x44')]=[{'all':!![]}];}_0x47dfd7=_[_0xffdb('0x40')]({},_0x47dfd7,_0x212264['options']);return db[_0xffdb('0x42')][_0xffdb('0x4a')](_0x47dfd7)['then'](handleEntityNotFound(_0x2c92cc,null))['then'](respondWithResult(_0x2c92cc,null))[_0xffdb('0x46')](handleError(_0x2c92cc,null));};exports[_0xffdb('0x4b')]=function(_0x4bae17,_0x18370f){return db[_0xffdb('0x42')][_0xffdb('0x4b')](_0x4bae17[_0xffdb('0x4c')],{})['then'](function(_0xdd8ddc){var _0x31df8f=_0x4bae17[_0xffdb('0x4d')][_0xffdb('0x26')]({'plain':!![]});if(!_0x31df8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31df8f[_0xffdb('0x4e')]===_0xffdb('0x4d')){var _0x1e34ac=_0xdd8ddc[_0xffdb('0x26')]({'plain':!![]});var _0x201993='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x201993,'userProfileId':_0x31df8f[_0xffdb('0x4f')]},'raw':!![]})[_0xffdb('0x25')](function(_0x33d382){if(_0x33d382&&_0x33d382[_0xffdb('0x50')]===0x0){return db[_0xffdb('0x28')]['create']({'name':_0x1e34ac['name'],'resourceId':_0x1e34ac['id'],'type':_0xffdb('0x27'),'sectionId':_0x33d382['id']},{})[_0xffdb('0x25')](function(){return _0xdd8ddc;});}else{return _0xdd8ddc;}})[_0xffdb('0x46')](function(_0x3aa232){logger[_0xffdb('0x2b')](_0xffdb('0x51'),_0x3aa232);throw _0x3aa232;});}return _0xdd8ddc;})[_0xffdb('0x25')](respondWithResult(_0x18370f,0xc9))[_0xffdb('0x46')](handleError(_0x18370f,null));};exports[_0xffdb('0x24')]=function(_0x113cbc,_0x24824d){if(_0x113cbc['body']['id']){delete _0x113cbc[_0xffdb('0x4c')]['id'];}return db[_0xffdb('0x42')][_0xffdb('0x4a')]({'where':{'id':_0x113cbc[_0xffdb('0x48')]['id']}})['then'](handleEntityNotFound(_0x24824d,null))[_0xffdb('0x25')](saveUpdates(_0x113cbc['body'],null))[_0xffdb('0x25')](respondWithResult(_0x24824d,null))[_0xffdb('0x46')](handleError(_0x24824d,null));};exports['destroy']=function(_0x16a214,_0x528b20){return db[_0xffdb('0x42')][_0xffdb('0x4a')]({'where':{'id':_0x16a214['params']['id']}})[_0xffdb('0x25')](handleEntityNotFound(_0x528b20,null))[_0xffdb('0x25')](removeEntity(_0x528b20,null))[_0xffdb('0x46')](handleError(_0x528b20,null));};exports[_0xffdb('0x52')]=function(_0xe5cd35,_0x53de75){var _0x59bcba=0xa;var _0x15de8b=[_0xffdb('0x53'),'left_join',_0xffdb('0x54'),_0xffdb('0x55')];var _0x13aa4f={'SUM':_0xffdb('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xffdb('0x57'),'MAX':_0xffdb('0x58'),'MIN':'MIN(%s)','AVG':_0xffdb('0x59'),'GROUP_CONCAT':_0xffdb('0x5a'),'GROUP_CONCAT ASC':_0xffdb('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1db3dd={'SEC_TO_TIME':_0xffdb('0x5c'),'DATE':_0xffdb('0x5d'),'HOUR':_0xffdb('0x5e'),'ROUND':_0xffdb('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x145260=function(_0x9ee98c){return!_[_0xffdb('0x60')]([_0xffdb('0x61'),_0xffdb('0x62'),_0xffdb('0x63'),_0xffdb('0x64')],_0x9ee98c);};var _0x2d97a5=function(_0x5a55e4){if(!_0x5a55e4||!_0x5a55e4[_0xffdb('0x65')][_0xffdb('0x38')]){return'';}for(var _0x343266='(',_0x4f6144=0x0;_0x4f6144<_0x5a55e4[_0xffdb('0x65')]['length'];_0x4f6144+=0x1){_0x4f6144>0x0&&(_0x343266+='\x20'+_0x5a55e4[_0xffdb('0x66')]+'\x20');_0x343266+=_0x5a55e4[_0xffdb('0x65')][_0x4f6144][_0xffdb('0x67')]?_0x2d97a5(_0x5a55e4['rules'][_0x4f6144]['group']):_0x5a55e4[_0xffdb('0x65')][_0x4f6144][_0xffdb('0x68')]+'\x20'+_0x5a55e4['rules'][_0x4f6144][_0xffdb('0x69')]+(_0x145260(_0x5a55e4['rules'][_0x4f6144][_0xffdb('0x69')])?'\x20'+_0x5a55e4[_0xffdb('0x65')][_0x4f6144][_0xffdb('0x6a')]:'');}return _0x343266+')';};var _0x30f90e={'where':{'id':_0xe5cd35[_0xffdb('0x48')]['id']}},_0x25de9c,_0x33d01f,_0x51342a,_0x326d34,_0x29e444;_0x30f90e=_['merge']({},_0x30f90e,_0xe5cd35[_0xffdb('0x41')]);return db['AnalyticCustomReport'][_0xffdb('0x4a')](_0x30f90e)[_0xffdb('0x25')](function(_0xb61a87){if(_0xb61a87){_0x25de9c=_0xb61a87;return _0xb61a87[_0xffdb('0x6b')]();}return null;})[_0xffdb('0x25')](function(_0x2dc432){if(_0x2dc432){if(!_0x2dc432[_0xffdb('0x38')]){throw new db[(_0xffdb('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x33d01f=_0x2dc432;return db[_0xffdb('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xffdb('0x25')](function(_0x122918){if(_0x122918){_0x51342a=_[_0xffdb('0x6e')](_0x122918,'id');var _0x551d1e;var _0x56abb1=squel[_0xffdb('0x6f')]();_0x56abb1['from'](_0x25de9c['table']);for(var _0x276f28=0x0;_0x276f28<_0x33d01f[_0xffdb('0x38')];_0x276f28+=0x1){_0x551d1e=_0x33d01f[_0x276f28][_0xffdb('0x70')]?_0x51342a[_0x33d01f[_0x276f28][_0xffdb('0x70')]][_0xffdb('0x71')]:_0x33d01f[_0x276f28]['field'];_0x551d1e=_0x33d01f[_0x276f28]['function']?_[_0xffdb('0x72')](_0x13aa4f[_0x33d01f[_0x276f28][_0xffdb('0x73')]],'%s',_0x551d1e):_0x551d1e;_0x551d1e=_0x33d01f[_0x276f28]['format']?_[_0xffdb('0x72')](_0x1db3dd[_0x33d01f[_0x276f28][_0xffdb('0x74')]],'%s',_0x551d1e):_0x551d1e;if(_0x33d01f[_0x276f28][_0xffdb('0x75')]){_0x56abb1[_0xffdb('0x67')](_0x551d1e);}_0x33d01f[_0x276f28][_0xffdb('0x76')]&&_0x56abb1[_0xffdb('0x3b')](_0x551d1e,_0x33d01f[_0x276f28][_0xffdb('0x76')]===_0xffdb('0x77')?![]:!![]);_0x56abb1['field'](_0x551d1e,_0x33d01f[_0x276f28]['alias']||_0x551d1e);}if(_0x25de9c[_0xffdb('0x78')]){_0x25de9c['joins']=JSON[_0xffdb('0x79')](_0x25de9c[_0xffdb('0x78')]);for(var _0x4ccc65=0x0;_0x4ccc65<_0x25de9c[_0xffdb('0x78')][_0xffdb('0x38')];_0x4ccc65+=0x1){if(_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x30')]&&_['includes'](_0x15de8b,_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x30')])&&_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7a')]&&_0x25de9c['joins'][_0x4ccc65][_0xffdb('0x7b')]&&_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7c')]){_0x56abb1[_0x25de9c['joins'][_0x4ccc65][_0xffdb('0x30')]](_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7b')],null,util[_0xffdb('0x74')](_0xffdb('0x7d'),_0x25de9c[_0xffdb('0x7e')],_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7a')],_0x25de9c[_0xffdb('0x78')][_0x4ccc65]['foreignTable'],_0x25de9c['joins'][_0x4ccc65][_0xffdb('0x7c')]));}}}if(_0x25de9c[_0xffdb('0x7f')]){_0x25de9c['conditions']=JSON[_0xffdb('0x79')](_0x25de9c[_0xffdb('0x7f')]);_0x56abb1['where'](_0x2d97a5(_0x25de9c[_0xffdb('0x7f')][_0xffdb('0x67')]));}_0x29e444=_0x56abb1['clone']();_0x56abb1[_0xffdb('0x1e')](_0x59bcba);_0x56abb1[_0xffdb('0x1c')](0x0);logger[_0xffdb('0x80')]('Limited\x20Query:',_0x56abb1[_0xffdb('0x81')]());return dbH[_0xffdb('0x82')][_0xffdb('0x32')](_0x56abb1[_0xffdb('0x81')](),{'type':dbH['sequelize'][_0xffdb('0x83')][_0xffdb('0x84')]});}})[_0xffdb('0x25')](respondWithResult(_0x53de75,null))['catch'](handleError(_0x53de75,null));};function runReport(_0x4bc298,_0x266bac,_0x2efef4){var _0xdf130d=_0x266bac[_0xffdb('0x2d')];var _0x8b5959=0xa;var _0x32f907=[_0xffdb('0x53'),_0xffdb('0x85'),'right_join','cross_join'];var _0x4260b2={'SUM':_0xffdb('0x56'),'COUNT':_0xffdb('0x86'),'COUNT DISTINCT':_0xffdb('0x57'),'MAX':_0xffdb('0x58'),'MIN':_0xffdb('0x87'),'AVG':_0xffdb('0x59'),'GROUP_CONCAT':_0xffdb('0x5a'),'GROUP_CONCAT ASC':_0xffdb('0x5b'),'GROUP_CONCAT DESC':_0xffdb('0x88')};var _0x16a64b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xffdb('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xffdb('0x5f'),'UNIX_TIMESTAMP':_0xffdb('0x89')};var _0x4929ce=function(_0x3b0188){return!_[_0xffdb('0x60')]([_0xffdb('0x61'),_0xffdb('0x62'),_0xffdb('0x63'),_0xffdb('0x64')],_0x3b0188);};var _0x28cbbf=function(_0x31ce59){if(!_0x31ce59||!_0x31ce59[_0xffdb('0x65')][_0xffdb('0x38')]){return'';}for(var _0x32e3a8='(',_0x359fe3=0x0;_0x359fe3<_0x31ce59[_0xffdb('0x65')]['length'];_0x359fe3+=0x1){_0x359fe3>0x0&&(_0x32e3a8+='\x20'+_0x31ce59[_0xffdb('0x66')]+'\x20');_0x32e3a8+=_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x67')]?_0x28cbbf(_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x67')]):_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x68')]+'\x20'+_0x31ce59['rules'][_0x359fe3][_0xffdb('0x69')]+(_0x4929ce(_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x69')])?'\x20'+_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x6a')]:'');}return _0x32e3a8+')';};var _0x3b471a={'where':{'id':_0x4bc298['id']}},_0x2b985f,_0x2c5c18,_0x19cdb8,_0x1f85ca,_0x11a24b;_0x3b471a=_[_0xffdb('0x40')]({},_0x3b471a,_0x2efef4);return db[_0xffdb('0x42')][_0xffdb('0x4a')](_0x3b471a)[_0xffdb('0x25')](function(_0x4da720){if(_0x4da720){_0x2b985f=_0x4da720;return _0x4da720['getFields']();}return null;})[_0xffdb('0x25')](function(_0x2498d9){if(_0x2498d9){if(!_0x2498d9[_0xffdb('0x38')]){throw new db[(_0xffdb('0x6c'))][(_0xffdb('0x8a'))](_0xffdb('0x8b'),0x193);}_0x2c5c18=_0x2498d9;return db[_0xffdb('0x6d')][_0xffdb('0x45')]({'raw':!![]});}return null;})[_0xffdb('0x25')](function(_0x1da0b7){if(_0x1da0b7){_0x19cdb8=_[_0xffdb('0x6e')](_0x1da0b7,'id');var _0x583fb1;var _0x431391=squel[_0xffdb('0x6f')]();_0x431391[_0xffdb('0x8c')](_0x2b985f['table']);for(var _0x26db5a=0x0;_0x26db5a<_0x2c5c18[_0xffdb('0x38')];_0x26db5a+=0x1){_0x583fb1=_0x2c5c18[_0x26db5a]['MetricId']?_0x19cdb8[_0x2c5c18[_0x26db5a][_0xffdb('0x70')]]['metric']:_0x2c5c18[_0x26db5a]['field'];_0x583fb1=_0x2c5c18[_0x26db5a][_0xffdb('0x73')]?_[_0xffdb('0x72')](_0x4260b2[_0x2c5c18[_0x26db5a][_0xffdb('0x73')]],'%s',_0x583fb1):_0x583fb1;_0x583fb1=_0x2c5c18[_0x26db5a][_0xffdb('0x74')]?_['replace'](_0x16a64b[_0x2c5c18[_0x26db5a][_0xffdb('0x74')]],'%s',_0x583fb1):_0x583fb1;if(_0x2c5c18[_0x26db5a][_0xffdb('0x75')]){_0x431391[_0xffdb('0x67')](_0x583fb1);}_0x2c5c18[_0x26db5a][_0xffdb('0x76')]&&_0x431391['order'](_0x583fb1,_0x2c5c18[_0x26db5a][_0xffdb('0x76')]===_0xffdb('0x77')?![]:!![]);_0x431391['field'](_0x583fb1,_0x2c5c18[_0x26db5a][_0xffdb('0x8d')]||_0x583fb1);}if(_0x2b985f['joins']){_0x2b985f[_0xffdb('0x78')]=JSON[_0xffdb('0x79')](_0x2b985f[_0xffdb('0x78')]);for(var _0x431527=0x0;_0x431527<_0x2b985f[_0xffdb('0x78')][_0xffdb('0x38')];_0x431527+=0x1){if(_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x30')]&&_['includes'](_0x32f907,_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x30')])&&_0x2b985f['joins'][_0x431527]['parentKey']&&_0x2b985f[_0xffdb('0x78')][_0x431527]['foreignTable']&&_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7c')]){_0x431391[_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x30')]](_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7b')],null,util['format'](_0xffdb('0x7d'),_0x2b985f[_0xffdb('0x7e')],_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7a')],_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7b')],_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7c')]));}}}if(_0x2b985f[_0xffdb('0x7f')]){_0x2b985f[_0xffdb('0x7f')]=JSON[_0xffdb('0x79')](_0x2b985f[_0xffdb('0x7f')]);_0x431391['where'](_0x28cbbf(_0x2b985f['conditions'][_0xffdb('0x67')]));}_0x11a24b=_0x431391['clone']();_0x431391['limit'](_0x8b5959);_0x431391[_0xffdb('0x1c')](0x0);return;}})[_0xffdb('0x25')](function(){if(_0x266bac['output']===_0xffdb('0x8e')){return null;}var _0xd27cdd=_['merge'](_0x266bac,{'name':_0x266bac[_0xffdb('0x8f')]||_0x266bac['name']||_0x2b985f['name'],'basename':_0xdf130d,'savename':util[_0xffdb('0x74')](_0xffdb('0x90'),_0x266bac[_0xffdb('0x2d')]||_0x2b985f[_0xffdb('0x2d')],require(_0xffdb('0x91'))[_0xffdb('0x92')](0x4),_0x266bac['output']||_0xffdb('0x93')),'reportId':_0x2b985f['id'],'reportType':_0xffdb('0x94')});return db[_0xffdb('0x95')][_0xffdb('0x4b')](_0xd27cdd,{'raw':!![]});})[_0xffdb('0x25')](function(_0x37d720){if(_0x2b985f[_0xffdb('0x7e')]===_0xffdb('0x96')){_0x11a24b[_0xffdb('0x3d')](_0x2b985f['table']+_0xffdb('0x97'),_0x266bac[_0xffdb('0x98')],_0x266bac[_0xffdb('0x99')]);}else{_0x11a24b['where'](_0x2b985f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x266bac[_0xffdb('0x98')],_0x266bac[_0xffdb('0x99')]);}if(_0x37d720){logger[_0xffdb('0x9a')](_0xffdb('0x9b'),_0x11a24b[_0xffdb('0x81')]());require(_0xffdb('0x9c'))[_0xffdb('0x9d')](path[_0xffdb('0x53')](__dirname,'../../components/export/',_0x37d720[_0xffdb('0x9e')]),[_0x37d720['id'],_0x11a24b[_0xffdb('0x81')](),path['join'](__dirname,_0xffdb('0x9f'),_0x37d720[_0xffdb('0xa0')]),_0xdf130d]);return _0x37d720;}else{var _0x49b9bd=squel[_0xffdb('0x6f')]();_0x49b9bd['from']('('+_0x11a24b[_0xffdb('0x81')]()+')',_0xffdb('0xa1'));_0x49b9bd[_0xffdb('0x68')](_0xffdb('0xa2'),_0xffdb('0x1f'));_0x11a24b[_0xffdb('0x1e')](_0x266bac[_0xffdb('0x1e')]||_0x8b5959);_0x11a24b[_0xffdb('0x1c')](_0x266bac[_0xffdb('0x1c')]||0x0);return dbH[_0xffdb('0x82')][_0xffdb('0x32')](_0x49b9bd['toString'](),{'type':dbH[_0xffdb('0x82')]['QueryTypes'][_0xffdb('0x84')]})[_0xffdb('0x25')](function(_0x4608bd){if(!_0x4608bd[_0xffdb('0x38')]){_0x1f85ca=0x0;}else{_0x1f85ca=_0x4608bd[0x0]['count']||0x0;}return dbH[_0xffdb('0x82')][_0xffdb('0x32')](_0x11a24b[_0xffdb('0x81')](),{'type':dbH[_0xffdb('0x82')]['QueryTypes'][_0xffdb('0x84')]});})['then'](function(_0x3a156a){return{'rows':_0x3a156a||[],'count':_0x1f85ca};});}});}exports['run']=function(_0x2b0620,_0x3bc640){return runReport(_0x2b0620[_0xffdb('0x48')],_0x2b0620[_0xffdb('0x32')],_0x2b0620['options'])['then'](respondWithResult(_0x3bc640,null))[_0xffdb('0x46')](handleError(_0x3bc640,null));};exports['runReport']=runReport;exports[_0xffdb('0x32')]=function(_0x2664c1,_0x52439e){var _0x494782=0xa;var _0x1e4d1c=['join',_0xffdb('0x85'),_0xffdb('0x54'),_0xffdb('0x55')];var _0x266a7a={'SUM':_0xffdb('0x56'),'COUNT':_0xffdb('0x86'),'COUNT DISTINCT':_0xffdb('0x57'),'MAX':'MAX(%s)','MIN':_0xffdb('0x87'),'AVG':_0xffdb('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xffdb('0x5b'),'GROUP_CONCAT DESC':_0xffdb('0x88')};var _0x396e1f={'SEC_TO_TIME':_0xffdb('0x5c'),'DATE':_0xffdb('0x5d'),'HOUR':_0xffdb('0x5e'),'ROUND':_0xffdb('0x5f'),'UNIX_TIMESTAMP':_0xffdb('0x89')};var _0x2c6c78=function(_0x2dd600){return!_[_0xffdb('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xffdb('0x63'),'IS\x20NOT\x20EMPTY'],_0x2dd600);};var _0x5b88be=function(_0x463614){if(!_0x463614||!_0x463614['rules'][_0xffdb('0x38')]){return'';}for(var _0x441f75='(',_0x1479a0=0x0;_0x1479a0<_0x463614[_0xffdb('0x65')][_0xffdb('0x38')];_0x1479a0+=0x1){_0x1479a0>0x0&&(_0x441f75+='\x20'+_0x463614[_0xffdb('0x66')]+'\x20');_0x441f75+=_0x463614[_0xffdb('0x65')][_0x1479a0][_0xffdb('0x67')]?_0x5b88be(_0x463614[_0xffdb('0x65')][_0x1479a0][_0xffdb('0x67')]):_0x463614['rules'][_0x1479a0][_0xffdb('0x68')]+'\x20'+_0x463614['rules'][_0x1479a0]['condition']+(_0x2c6c78(_0x463614['rules'][_0x1479a0]['condition'])?'\x20'+_0x463614[_0xffdb('0x65')][_0x1479a0]['value']:'');}return _0x441f75+')';};var _0xd2c540={'where':{'id':_0x2664c1[_0xffdb('0x48')]['id']}},_0xad0113,_0x46ef35,_0x5d4390,_0x2c327e,_0x4cb1b4;_0xd2c540=_['merge']({},_0xd2c540,_0x2664c1[_0xffdb('0x41')]);return db['AnalyticCustomReport'][_0xffdb('0x4a')](_0xd2c540)['then'](function(_0x421c71){if(_0x421c71){_0xad0113=_0x421c71;return _0x421c71[_0xffdb('0x6b')]();}return null;})[_0xffdb('0x25')](function(_0xa0483c){if(_0xa0483c){if(!_0xa0483c['length']){throw new db[(_0xffdb('0x6c'))][(_0xffdb('0x8a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x46ef35=_0xa0483c;return db[_0xffdb('0x6d')][_0xffdb('0x45')]({'raw':!![]});}return null;})[_0xffdb('0x25')](function(_0x32a75b){if(_0x32a75b){_0x5d4390=_['keyBy'](_0x32a75b,'id');var _0x262e7e;var _0x54f32f=squel[_0xffdb('0x6f')]();_0x54f32f['from'](_0xad0113[_0xffdb('0x7e')]);for(var _0x127de5=0x0;_0x127de5<_0x46ef35[_0xffdb('0x38')];_0x127de5+=0x1){_0x262e7e=_0x46ef35[_0x127de5]['MetricId']?_0x5d4390[_0x46ef35[_0x127de5][_0xffdb('0x70')]][_0xffdb('0x71')]:_0x46ef35[_0x127de5]['field'];_0x262e7e=_0x46ef35[_0x127de5]['function']?_['replace'](_0x266a7a[_0x46ef35[_0x127de5]['function']],'%s',_0x262e7e):_0x262e7e;_0x262e7e=_0x46ef35[_0x127de5][_0xffdb('0x74')]?_[_0xffdb('0x72')](_0x396e1f[_0x46ef35[_0x127de5][_0xffdb('0x74')]],'%s',_0x262e7e):_0x262e7e;if(_0x46ef35[_0x127de5]['groupBy']){_0x54f32f['group'](_0x262e7e);}_0x46ef35[_0x127de5][_0xffdb('0x76')]&&_0x54f32f[_0xffdb('0x3b')](_0x262e7e,_0x46ef35[_0x127de5][_0xffdb('0x76')]===_0xffdb('0x77')?![]:!![]);_0x54f32f[_0xffdb('0x68')](_0x262e7e,_0x46ef35[_0x127de5][_0xffdb('0x8d')]||_0x262e7e);}if(_0xad0113[_0xffdb('0x78')]){_0xad0113[_0xffdb('0x78')]=JSON[_0xffdb('0x79')](_0xad0113[_0xffdb('0x78')]);for(var _0x2db6b6=0x0;_0x2db6b6<_0xad0113[_0xffdb('0x78')][_0xffdb('0x38')];_0x2db6b6+=0x1){if(_0xad0113[_0xffdb('0x78')][_0x2db6b6][_0xffdb('0x30')]&&_[_0xffdb('0x60')](_0x1e4d1c,_0xad0113['joins'][_0x2db6b6]['type'])&&_0xad0113['joins'][_0x2db6b6][_0xffdb('0x7a')]&&_0xad0113[_0xffdb('0x78')][_0x2db6b6][_0xffdb('0x7b')]&&_0xad0113['joins'][_0x2db6b6][_0xffdb('0x7c')]){_0x54f32f[_0xad0113[_0xffdb('0x78')][_0x2db6b6][_0xffdb('0x30')]](_0xad0113['joins'][_0x2db6b6]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0xad0113[_0xffdb('0x7e')],_0xad0113[_0xffdb('0x78')][_0x2db6b6]['parentKey'],_0xad0113[_0xffdb('0x78')][_0x2db6b6]['foreignTable'],_0xad0113['joins'][_0x2db6b6][_0xffdb('0x7c')]));}}}if(_0xad0113[_0xffdb('0x7f')]){_0xad0113[_0xffdb('0x7f')]=JSON[_0xffdb('0x79')](_0xad0113[_0xffdb('0x7f')]);_0x54f32f[_0xffdb('0x3d')](_0x5b88be(_0xad0113['conditions'][_0xffdb('0x67')]));}_0x4cb1b4=_0x54f32f[_0xffdb('0xa3')]();_0x54f32f[_0xffdb('0x1e')](_0x494782);_0x54f32f[_0xffdb('0x1c')](0x0);logger[_0xffdb('0x80')]('Limited\x20Query:',_0x54f32f[_0xffdb('0x81')]());return dbH['sequelize'][_0xffdb('0x32')](_0x54f32f[_0xffdb('0x81')](),{'type':dbH[_0xffdb('0x82')][_0xffdb('0x83')]['SELECT']});}})['then'](function(){return{'sql':_0x4cb1b4['toString']()};})['then'](respondWithResult(_0x52439e,null))[_0xffdb('0x46')](handleError(_0x52439e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9274514..9226713 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 _0x506f=['analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport'];(function(_0x673239,_0x31f6ef){var _0x555941=function(_0x55eca9){while(--_0x55eca9){_0x673239['push'](_0x673239['shift']());}};_0x555941(++_0x31f6ef);}(_0x506f,0x145));var _0xf506=function(_0x1290c5,_0x39106e){_0x1290c5=_0x1290c5-0x0;var _0x74284c=_0x506f[_0x1290c5];return _0x74284c;};'use strict';var _=require(_0xf506('0x0'));var util=require(_0xf506('0x1'));var logger=require('../../config/logger')(_0xf506('0x2'));var moment=require(_0xf506('0x3'));var BPromise=require(_0xf506('0x4'));var rp=require(_0xf506('0x5'));var fs=require('fs');var path=require(_0xf506('0x6'));var rimraf=require(_0xf506('0x7'));var config=require(_0xf506('0x8'));var attributes=require(_0xf506('0x9'));module['exports']=function(_0x395c17,_0x318a70){return _0x395c17['define'](_0xf506('0xa'),attributes,{'tableName':_0xf506('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b72=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x5d1134,_0x28ef08){var _0x20e1b4=function(_0xade472){while(--_0xade472){_0x5d1134['push'](_0x5d1134['shift']());}};_0x20e1b4(++_0x28ef08);}(_0x6b72,0xbd));var _0x26b7=function(_0x4f8938,_0x50bcff){_0x4f8938=_0x4f8938-0x0;var _0xdc2e3f=_0x6b72[_0x4f8938];return _0xdc2e3f;};'use strict';var _=require(_0x26b7('0x0'));var util=require(_0x26b7('0x1'));var logger=require(_0x26b7('0x2'))('api');var moment=require(_0x26b7('0x3'));var BPromise=require(_0x26b7('0x4'));var rp=require(_0x26b7('0x5'));var fs=require('fs');var path=require(_0x26b7('0x6'));var rimraf=require(_0x26b7('0x7'));var config=require(_0x26b7('0x8'));var attributes=require(_0x26b7('0x9'));module['exports']=function(_0x2aa80e,_0x55e5a0){return _0x2aa80e['define'](_0x26b7('0xa'),attributes,{'tableName':_0x26b7('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 70a05c9..60b80c2 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 _0xea52=['info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xea52,0x7d));var _0x2ea5=function(_0x2700d5,_0x1b113b){_0x2700d5=_0x2700d5-0x0;var _0xdc3338=_0xea52[_0x2700d5];return _0xdc3338;};'use strict';var _=require(_0x2ea5('0x0'));var util=require('util');var moment=require(_0x2ea5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ea5('0x2'));var db=require(_0x2ea5('0x3'))['db'];var utils=require(_0x2ea5('0x4'));var logger=require(_0x2ea5('0x5'))(_0x2ea5('0x6'));var config=require(_0x2ea5('0x7'));var jayson=require(_0x2ea5('0x8'));var client=jayson[_0x2ea5('0x9')][_0x2ea5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55aaf4,_0x1916b0,_0x282059){return new BPromise(function(_0x8eb0f5,_0x10f2b8){return client[_0x2ea5('0xb')](_0x55aaf4,_0x282059)[_0x2ea5('0xc')](function(_0x4f23e8){logger[_0x2ea5('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1916b0,_0x2ea5('0xe'));logger[_0x2ea5('0xf')](_0x2ea5('0x10'),_0x1916b0,_0x2ea5('0xe'),JSON[_0x2ea5('0x11')](_0x4f23e8));if(_0x4f23e8[_0x2ea5('0x12')]){if(_0x4f23e8[_0x2ea5('0x12')]['code']===0x1f4){logger[_0x2ea5('0x12')](_0x2ea5('0x13'),_0x1916b0,_0x4f23e8[_0x2ea5('0x12')][_0x2ea5('0x14')]);return _0x10f2b8(_0x4f23e8[_0x2ea5('0x12')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1916b0,_0x4f23e8[_0x2ea5('0x12')]['message']);return _0x8eb0f5(_0x4f23e8[_0x2ea5('0x12')]['message']);}else{logger[_0x2ea5('0xd')](_0x2ea5('0x13'),_0x1916b0,'request\x20sent');_0x8eb0f5(_0x4f23e8[_0x2ea5('0x15')]['message']);}})[_0x2ea5('0x16')](function(_0x3e1b96){logger[_0x2ea5('0x12')](_0x2ea5('0x13'),_0x1916b0,_0x3e1b96);_0x10f2b8(_0x3e1b96);});});} \ No newline at end of file +var _0x97a5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x436179,_0x3a9480){var _0x4b7f84=function(_0x556ae0){while(--_0x556ae0){_0x436179['push'](_0x436179['shift']());}};_0x4b7f84(++_0x3a9480);}(_0x97a5,0x157));var _0x597a=function(_0x3cf23e,_0x39dfbe){_0x3cf23e=_0x3cf23e-0x0;var _0x1a20e6=_0x97a5[_0x3cf23e];return _0x1a20e6;};'use strict';var _=require(_0x597a('0x0'));var util=require(_0x597a('0x1'));var moment=require(_0x597a('0x2'));var BPromise=require(_0x597a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597a('0x4'));var db=require(_0x597a('0x5'))['db'];var utils=require(_0x597a('0x6'));var logger=require(_0x597a('0x7'))(_0x597a('0x8'));var config=require(_0x597a('0x9'));var jayson=require(_0x597a('0xa'));var client=jayson[_0x597a('0xb')][_0x597a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28989b,_0x4ad340,_0x24fc88){return new BPromise(function(_0xa34d11,_0x267b56){return client[_0x597a('0xd')](_0x28989b,_0x24fc88)[_0x597a('0xe')](function(_0xc1993e){logger[_0x597a('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ad340,_0x597a('0x10'));logger[_0x597a('0x11')](_0x597a('0x12'),_0x4ad340,_0x597a('0x10'),JSON['stringify'](_0xc1993e));if(_0xc1993e['error']){if(_0xc1993e[_0x597a('0x13')][_0x597a('0x14')]===0x1f4){logger[_0x597a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ad340,_0xc1993e[_0x597a('0x13')]['message']);return _0x267b56(_0xc1993e[_0x597a('0x13')][_0x597a('0x15')]);}logger[_0x597a('0x13')](_0x597a('0x16'),_0x4ad340,_0xc1993e[_0x597a('0x13')][_0x597a('0x15')]);return _0xa34d11(_0xc1993e[_0x597a('0x13')][_0x597a('0x15')]);}else{logger[_0x597a('0xf')](_0x597a('0x16'),_0x4ad340,_0x597a('0x10'));_0xa34d11(_0xc1993e[_0x597a('0x17')][_0x597a('0x15')]);}})[_0x597a('0x18')](function(_0x50c209){logger[_0x597a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ad340,_0x50c209);_0x267b56(_0x50c209);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0a3887c..4517f6b 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 _0x2dd4=['/:id/run','/:id/query','put','update','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview'];(function(_0x5ad67c,_0x144860){var _0xccce2e=function(_0x2dd95c){while(--_0x2dd95c){_0x5ad67c['push'](_0x5ad67c['shift']());}};_0xccce2e(++_0x144860);}(_0x2dd4,0x101));var _0x42dd=function(_0x16a059,_0x46bc2b){_0x16a059=_0x16a059-0x0;var _0x57f7a6=_0x2dd4[_0x16a059];return _0x57f7a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x42dd('0x0'));var timeout=require('connect-timeout');var express=require(_0x42dd('0x1'));var router=express[_0x42dd('0x2')]();var fs_extra=require(_0x42dd('0x3'));var auth=require(_0x42dd('0x4'));var interaction=require(_0x42dd('0x5'));var config=require(_0x42dd('0x6'));var controller=require(_0x42dd('0x7'));router[_0x42dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x42dd('0x8')](_0x42dd('0x9'),auth[_0x42dd('0xa')](),controller[_0x42dd('0xb')]);router[_0x42dd('0x8')](_0x42dd('0xc'),auth[_0x42dd('0xa')](),controller['preview']);router['get'](_0x42dd('0xd'),auth[_0x42dd('0xa')](),controller['run']);router[_0x42dd('0x8')](_0x42dd('0xe'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x42dd('0xa')](),controller['create']);router[_0x42dd('0xf')](_0x42dd('0x9'),auth[_0x42dd('0xa')](),controller[_0x42dd('0x10')]);router['delete']('/:id',auth[_0x42dd('0xa')](),controller[_0x42dd('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf30f=['show','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2251c9,_0x2a2091){var _0x56d17b=function(_0x3fd083){while(--_0x3fd083){_0x2251c9['push'](_0x2251c9['shift']());}};_0x56d17b(++_0x2a2091);}(_0xf30f,0x19c));var _0xff30=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xf30f[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xff30('0x0'));var util=require(_0xff30('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xff30('0x2'));var router=express[_0xff30('0x3')]();var fs_extra=require(_0xff30('0x4'));var auth=require(_0xff30('0x5'));var interaction=require(_0xff30('0x6'));var config=require(_0xff30('0x7'));var controller=require(_0xff30('0x8'));router[_0xff30('0x9')]('/',auth[_0xff30('0xa')](),controller[_0xff30('0xb')]);router['get'](_0xff30('0xc'),auth['isAuthenticated'](),controller[_0xff30('0xd')]);router[_0xff30('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xff30('0xe')]);router[_0xff30('0x9')](_0xff30('0xf'),auth[_0xff30('0xa')](),controller[_0xff30('0x10')]);router[_0xff30('0x9')](_0xff30('0x11'),auth[_0xff30('0xa')](),controller[_0xff30('0x12')]);router[_0xff30('0x13')]('/',auth['isAuthenticated'](),controller[_0xff30('0x14')]);router['put'](_0xff30('0xc'),auth[_0xff30('0xa')](),controller[_0xff30('0x15')]);router[_0xff30('0x16')](_0xff30('0xc'),auth[_0xff30('0xa')](),controller[_0xff30('0x17')]);module[_0xff30('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0f81f61..7ff3029 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0xf44777,_0x419161){var _0x4a38cc=function(_0x190381){while(--_0x190381){_0xf44777['push'](_0xf44777['shift']());}};_0x4a38cc(++_0x419161);}(_0xac9d,0x14d));var _0xdac9=function(_0x3c2863,_0x1b2cee){_0x3c2863=_0x3c2863-0x0;var _0x2c3d27=_0xac9d[_0x3c2863];return _0x2c3d27;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x1532ae,_0xa14bcc){var _0x5c09d1=function(_0x35167a){while(--_0x35167a){_0x1532ae['push'](_0x1532ae['shift']());}};_0x5c09d1(++_0xa14bcc);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x35832e,_0x4a20fe){_0x35832e=_0x35832e-0x0;var _0xa1308d=_0x3eea[_0x35832e];return _0xa1308d;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 5af249b..531bb7e 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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d38,0x1ef));var _0x86d3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6d38[_0x19e35c];return _0x3e1fe8;};'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 _0x187d=['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','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x200830,_0x36e4e1){var _0xd91b01=function(_0x16ff4a){while(--_0x16ff4a){_0x200830['push'](_0x200830['shift']());}};_0xd91b01(++_0x36e4e1);}(_0x187d,0x93));var _0xd187=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x187d[_0x5b561d];return _0x431060;};'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'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a204647..a75f64d 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 _0xb449=['bluebird','request-promise','path','rimraf','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api'];(function(_0x42c8ec,_0x5e9d39){var _0x2c3932=function(_0x29b1a9){while(--_0x29b1a9){_0x42c8ec['push'](_0x42c8ec['shift']());}};_0x2c3932(++_0x5e9d39);}(_0xb449,0x8b));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require(_0x9b44('0x2'))(_0x9b44('0x3'));var moment=require('moment');var BPromise=require(_0x9b44('0x4'));var rp=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require(_0x9b44('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x9b44('0x8')]=function(_0x15cce5,_0x359d9c){return _0x15cce5[_0x9b44('0x9')](_0x9b44('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xced9=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0xb25d31,_0x53c622){var _0x5f070f=function(_0xcecf4){while(--_0xcecf4){_0xb25d31['push'](_0xb25d31['shift']());}};_0x5f070f(++_0x53c622);}(_0xced9,0x11b));var _0x9ced=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xced9[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x9ced('0x0'));var util=require(_0x9ced('0x1'));var logger=require(_0x9ced('0x2'))(_0x9ced('0x3'));var moment=require(_0x9ced('0x4'));var BPromise=require(_0x9ced('0x5'));var rp=require(_0x9ced('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ced('0x7'));var config=require(_0x9ced('0x8'));var attributes=require(_0x9ced('0x9'));module[_0x9ced('0xa')]=function(_0x3414f4,_0x6775ce){return _0x3414f4[_0x9ced('0xb')](_0x9ced('0xc'),attributes,{'tableName':_0x9ced('0xd'),'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 22b57b5..ce3ed4e 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 _0xdf73=['../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a0354,_0x49dcee){var _0x20daba=function(_0x598154){while(--_0x598154){_0x5a0354['push'](_0x5a0354['shift']());}};_0x20daba(++_0x49dcee);}(_0xdf73,0x10b));var _0x3df7=function(_0x3f35a2,_0x3cc674){_0x3f35a2=_0x3f35a2-0x0;var _0x580e49=_0xdf73[_0x3f35a2];return _0x580e49;};'use strict';var _=require(_0x3df7('0x0'));var util=require(_0x3df7('0x1'));var moment=require(_0x3df7('0x2'));var BPromise=require('bluebird');var rs=require(_0x3df7('0x3'));var fs=require('fs');var Redis=require(_0x3df7('0x4'));var db=require(_0x3df7('0x5'))['db'];var utils=require(_0x3df7('0x6'));var logger=require(_0x3df7('0x7'))(_0x3df7('0x8'));var config=require(_0x3df7('0x9'));var jayson=require(_0x3df7('0xa'));var client=jayson['client'][_0x3df7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42cd76,_0x56cff0,_0x227d2a){return new BPromise(function(_0x217601,_0x3f691b){return client[_0x3df7('0xc')](_0x42cd76,_0x227d2a)[_0x3df7('0xd')](function(_0x4188de){logger[_0x3df7('0xe')](_0x3df7('0xf'),_0x56cff0,_0x3df7('0x10'));logger['debug'](_0x3df7('0x11'),_0x56cff0,_0x3df7('0x10'),JSON[_0x3df7('0x12')](_0x4188de));if(_0x4188de[_0x3df7('0x13')]){if(_0x4188de[_0x3df7('0x13')][_0x3df7('0x14')]===0x1f4){logger[_0x3df7('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x56cff0,_0x4188de[_0x3df7('0x13')][_0x3df7('0x15')]);return _0x3f691b(_0x4188de['error'][_0x3df7('0x15')]);}logger[_0x3df7('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x56cff0,_0x4188de['error']['message']);return _0x217601(_0x4188de[_0x3df7('0x13')][_0x3df7('0x15')]);}else{logger[_0x3df7('0xe')](_0x3df7('0xf'),_0x56cff0,_0x3df7('0x10'));_0x217601(_0x4188de['result'][_0x3df7('0x15')]);}})[_0x3df7('0x16')](function(_0x38ecb9){logger[_0x3df7('0x13')](_0x3df7('0xf'),_0x56cff0,_0x38ecb9);_0x3f691b(_0x38ecb9);});});} \ No newline at end of file +var _0xd779=['result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x574a32,_0x4b9abf){var _0x3c1730=function(_0x112aa4){while(--_0x112aa4){_0x574a32['push'](_0x574a32['shift']());}};_0x3c1730(++_0x4b9abf);}(_0xd779,0x106));var _0x9d77=function(_0xd19088,_0x419744){_0xd19088=_0xd19088-0x0;var _0x3b42e5=_0xd779[_0xd19088];return _0x3b42e5;};'use strict';var _=require(_0x9d77('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9d77('0x1'));var rs=require(_0x9d77('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d77('0x3'))['db'];var utils=require(_0x9d77('0x4'));var logger=require(_0x9d77('0x5'))(_0x9d77('0x6'));var config=require(_0x9d77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d77('0x8')][_0x9d77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b3352,_0x105367,_0x57f9cb){return new BPromise(function(_0x524e2e,_0xb16b42){return client['request'](_0x9b3352,_0x57f9cb)['then'](function(_0x2435ab){logger[_0x9d77('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x105367,_0x9d77('0xb'));logger[_0x9d77('0xc')](_0x9d77('0xd'),_0x105367,_0x9d77('0xb'),JSON['stringify'](_0x2435ab));if(_0x2435ab[_0x9d77('0xe')]){if(_0x2435ab[_0x9d77('0xe')][_0x9d77('0xf')]===0x1f4){logger[_0x9d77('0xe')](_0x9d77('0x10'),_0x105367,_0x2435ab[_0x9d77('0xe')][_0x9d77('0x11')]);return _0xb16b42(_0x2435ab[_0x9d77('0xe')][_0x9d77('0x11')]);}logger[_0x9d77('0xe')](_0x9d77('0x10'),_0x105367,_0x2435ab['error'][_0x9d77('0x11')]);return _0x524e2e(_0x2435ab[_0x9d77('0xe')][_0x9d77('0x11')]);}else{logger[_0x9d77('0xa')](_0x9d77('0x10'),_0x105367,_0x9d77('0xb'));_0x524e2e(_0x2435ab[_0x9d77('0x12')][_0x9d77('0x11')]);}})[_0x9d77('0x13')](function(_0x1db7a2){logger['error'](_0x9d77('0x10'),_0x105367,_0x1db7a2);_0xb16b42(_0x1db7a2);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 0888808..1049693 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 _0x6659=['preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview'];(function(_0x338ed6,_0xf71072){var _0x297378=function(_0xc9dc4e){while(--_0xc9dc4e){_0x338ed6['push'](_0x338ed6['shift']());}};_0x297378(++_0xf71072);}(_0x6659,0x171));var _0x9665=function(_0x414751,_0x2c1fcc){_0x414751=_0x414751-0x0;var _0x28db10=_0x6659[_0x414751];return _0x28db10;};'use strict';var multer=require('multer');var util=require(_0x9665('0x0'));var path=require(_0x9665('0x1'));var timeout=require(_0x9665('0x2'));var express=require(_0x9665('0x3'));var router=express['Router']();var fs_extra=require(_0x9665('0x4'));var auth=require(_0x9665('0x5'));var interaction=require(_0x9665('0x6'));var config=require(_0x9665('0x7'));var controller=require(_0x9665('0x8'));router[_0x9665('0x9')]('/',auth['isAuthenticated'](),controller[_0x9665('0xa')]);router['get'](_0x9665('0xb'),auth[_0x9665('0xc')](),controller[_0x9665('0xd')]);router[_0x9665('0x9')](_0x9665('0xe'),auth[_0x9665('0xc')](),controller[_0x9665('0xf')]);router['get'](_0x9665('0x10'),auth['isAuthenticated'](),controller[_0x9665('0x11')]);router['get'](_0x9665('0x12'),auth[_0x9665('0xc')](),controller[_0x9665('0x13')]);router[_0x9665('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9665('0x15')](_0x9665('0xb'),auth[_0x9665('0xc')](),controller['update']);router[_0x9665('0x16')]('/:id',auth[_0x9665('0xc')](),controller[_0x9665('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe55d=['preview','run','query','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview'];(function(_0x26bc36,_0x95e54){var _0x173490=function(_0xc1dacb){while(--_0xc1dacb){_0x26bc36['push'](_0x26bc36['shift']());}};_0x173490(++_0x95e54);}(_0xe55d,0x126));var _0xde55=function(_0x1d63da,_0x3ed35b){_0x1d63da=_0x1d63da-0x0;var _0x1d0e27=_0xe55d[_0x1d63da];return _0x1d0e27;};'use strict';var multer=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var path=require('path');var timeout=require(_0xde55('0x2'));var express=require(_0xde55('0x3'));var router=express[_0xde55('0x4')]();var fs_extra=require(_0xde55('0x5'));var auth=require(_0xde55('0x6'));var interaction=require(_0xde55('0x7'));var config=require('../../config/environment');var controller=require(_0xde55('0x8'));router[_0xde55('0x9')]('/',auth[_0xde55('0xa')](),controller['index']);router[_0xde55('0x9')](_0xde55('0xb'),auth[_0xde55('0xa')](),controller[_0xde55('0xc')]);router[_0xde55('0x9')](_0xde55('0xd'),auth['isAuthenticated'](),controller[_0xde55('0xe')]);router[_0xde55('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xde55('0xf')]);router[_0xde55('0x9')]('/:id/query',auth[_0xde55('0xa')](),controller[_0xde55('0x10')]);router['post']('/',auth[_0xde55('0xa')](),controller[_0xde55('0x11')]);router[_0xde55('0x12')]('/:id',auth[_0xde55('0xa')](),controller[_0xde55('0x13')]);router[_0xde55('0x14')](_0xde55('0xb'),auth[_0xde55('0xa')](),controller[_0xde55('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index d0f5888..4d9080a 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 _0x681f=['INTEGER','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled'];(function(_0x1fd615,_0x2b0f2b){var _0x1e1914=function(_0x1dfe46){while(--_0x1dfe46){_0x1fd615['push'](_0x1fd615['shift']());}};_0x1e1914(++_0x2b0f2b);}(_0x681f,0xc7));var _0xf681=function(_0x18a63a,_0x259cec){_0x18a63a=_0x18a63a-0x0;var _0x2cca04=_0x681f[_0x18a63a];return _0x2cca04;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf681('0x0'));module[_0xf681('0x1')]={'name':{'type':Sequelize[_0xf681('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf681('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf681('0x3')](_0xf681('0x4'),_0xf681('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf681('0x4')},'savename':{'type':Sequelize[_0xf681('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf681('0x6')]},'endDate':{'type':Sequelize[_0xf681('0x6')]},'status':{'type':Sequelize[_0xf681('0x2')],'defaultValue':_0xf681('0x7')},'type':{'type':Sequelize[_0xf681('0x3')](_0xf681('0x8'),_0xf681('0x9')),'allowNull':![],'defaultValue':_0xf681('0x8')},'reportId':{'type':Sequelize[_0xf681('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xf681('0x2')]}}; \ No newline at end of file +var _0x3e71=['INTEGER','sequelize','moment','STRING','csv','xlsx','DATE','Loading','ENUM','manual'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x3e71,0x123));var _0x13e7=function(_0x52a0c6,_0x244632){_0x52a0c6=_0x52a0c6-0x0;var _0x29d78c=_0x3e71[_0x52a0c6];return _0x29d78c;};'use strict';var Sequelize=require(_0x13e7('0x0'));var moment=require(_0x13e7('0x1'));module['exports']={'name':{'type':Sequelize[_0x13e7('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x13e7('0x3'),'pdf',_0x13e7('0x4')),'allowNull':![],'defaultValue':_0x13e7('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x13e7('0x5')]},'endDate':{'type':Sequelize[_0x13e7('0x5')]},'status':{'type':Sequelize[_0x13e7('0x2')],'defaultValue':_0x13e7('0x6')},'type':{'type':Sequelize[_0x13e7('0x7')](_0x13e7('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x13e7('0x8')},'reportId':{'type':Sequelize[_0x13e7('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x13e7('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4e45756..9e4c941 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 _0xe4a7=['rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','fields','length','find','user','role','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','%s.%s','basename','output','toLowerCase','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport'];(function(_0x2c2c91,_0x5907e5){var _0x3d9736=function(_0x15573c){while(--_0x15573c){_0x2c2c91['push'](_0x2c2c91['shift']());}};_0x3d9736(++_0x5907e5);}(_0xe4a7,0x14e));var _0x7e4a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe4a7[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x7e4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e4a('0x1'));var rp=require(_0x7e4a('0x2'));var moment=require(_0x7e4a('0x3'));var BPromise=require(_0x7e4a('0x4'));var Mustache=require(_0x7e4a('0x5'));var util=require(_0x7e4a('0x6'));var path=require('path');var sox=require(_0x7e4a('0x7'));var csv=require(_0x7e4a('0x8'));var ejs=require(_0x7e4a('0x9'));var fs=require('fs');var fs_extra=require(_0x7e4a('0xa'));var _=require(_0x7e4a('0xb'));var squel=require(_0x7e4a('0xc'));var crypto=require(_0x7e4a('0xd'));var jsforce=require(_0x7e4a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7e4a('0x8'));var querystring=require(_0x7e4a('0xf'));var Papa=require('papaparse');var Redis=require(_0x7e4a('0x10'));var authService=require(_0x7e4a('0x11'));var qs=require(_0x7e4a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e4a('0x13'));var logger=require(_0x7e4a('0x14'))('api');var utils=require(_0x7e4a('0x15'));var config=require(_0x7e4a('0x16'));var licenseUtil=require(_0x7e4a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x512945,_0x5b4ba3){_0x5b4ba3=_0x5b4ba3||0xcc;return function(_0x3973bc){if(_0x3973bc){return _0x512945[_0x7e4a('0x18')](_0x5b4ba3);}return _0x512945[_0x7e4a('0x19')](_0x5b4ba3)[_0x7e4a('0x1a')]();};}function respondWithResult(_0x56e027,_0x3950d){_0x3950d=_0x3950d||0xc8;return function(_0x50bba5){if(_0x50bba5){return _0x56e027[_0x7e4a('0x19')](_0x3950d)[_0x7e4a('0x1b')](_0x50bba5);}};}function respondWithFilteredResult(_0x3d623c,_0x52b23b){return function(_0x557ea4){if(_0x557ea4){var _0x186fec=typeof _0x52b23b[_0x7e4a('0x1c')]==='undefined'&&typeof _0x52b23b['limit']===_0x7e4a('0x1d');var _0x1b9beb=_0x557ea4[_0x7e4a('0x1e')];var _0x22118e=_0x186fec?0x0:_0x52b23b['offset'];var _0xf71c73=_0x186fec?_0x557ea4['count']:_0x52b23b[_0x7e4a('0x1c')]+_0x52b23b[_0x7e4a('0x1f')];var _0x2ff71a;if(_0xf71c73>=_0x1b9beb){_0xf71c73=_0x1b9beb;_0x2ff71a=0xc8;}else{_0x2ff71a=0xce;}_0x3d623c[_0x7e4a('0x19')](_0x2ff71a);return _0x3d623c[_0x7e4a('0x20')]('Content-Range',_0x22118e+'-'+_0xf71c73+'/'+_0x1b9beb)['json'](_0x557ea4);}return null;};}function patchUpdates(_0x2f3b2f){return function(_0x1570fd){try{jsonpatch['apply'](_0x1570fd,_0x2f3b2f,!![]);}catch(_0xa51720){return BPromise[_0x7e4a('0x21')](_0xa51720);}return _0x1570fd[_0x7e4a('0x22')]();};}function saveUpdates(_0x44dfd4,_0x3c3e6c){return function(_0x18c0a1){if(_0x18c0a1){return _0x18c0a1[_0x7e4a('0x23')](_0x44dfd4)[_0x7e4a('0x24')](function(_0x42525b){return _0x42525b;});}return null;};}function removeEntity(_0x28ad0f,_0x3562bd){return function(_0x2f408b){if(_0x2f408b){return _0x2f408b[_0x7e4a('0x25')]()[_0x7e4a('0x24')](function(){var _0xebfa7e=_0x2f408b['get']({'plain':!![]});var _0x3830e5=_0x7e4a('0x26');return db[_0x7e4a('0x27')]['destroy']({'where':{'type':_0x3830e5,'resourceId':_0xebfa7e['id']}})[_0x7e4a('0x24')](function(){return _0x2f408b;});})['then'](function(){_0x28ad0f[_0x7e4a('0x19')](0xcc)[_0x7e4a('0x1a')]();});}};}function handleEntityNotFound(_0x54ffb6,_0x56c3f3){return function(_0x95402b){if(!_0x95402b){_0x54ffb6[_0x7e4a('0x18')](0x194);}return _0x95402b;};}function handleError(_0x29b5ec,_0x11d7bf){_0x11d7bf=_0x11d7bf||0x1f4;return function(_0x3543e2){logger['error'](_0x3543e2[_0x7e4a('0x28')]);if(_0x3543e2[_0x7e4a('0x29')]){delete _0x3543e2[_0x7e4a('0x29')];}_0x29b5ec[_0x7e4a('0x19')](_0x11d7bf)[_0x7e4a('0x2a')](_0x3543e2);};}exports[_0x7e4a('0x2b')]=function(_0x42b57a,_0xe6b5c){var _0x12ffc1={},_0xc4220={},_0x732c67={'count':0x0,'rows':[]};var _0x1533c6=_[_0x7e4a('0x2c')](db[_0x7e4a('0x2d')][_0x7e4a('0x2e')],function(_0x40aba3){return{'name':_0x40aba3[_0x7e4a('0x2f')],'type':_0x40aba3[_0x7e4a('0x30')][_0x7e4a('0x31')]};});_0xc4220['model']=_[_0x7e4a('0x2c')](_0x1533c6,'name');_0xc4220[_0x7e4a('0x32')]=_[_0x7e4a('0x33')](_0x42b57a[_0x7e4a('0x32')]);_0xc4220[_0x7e4a('0x34')]=_['intersection'](_0xc4220[_0x7e4a('0x35')],_0xc4220['query']);_0x12ffc1['attributes']=_[_0x7e4a('0x36')](_0xc4220[_0x7e4a('0x35')],qs['fields'](_0x42b57a['query']['fields']));_0x12ffc1[_0x7e4a('0x37')]=_0x12ffc1[_0x7e4a('0x37')]['length']?_0x12ffc1[_0x7e4a('0x37')]:_0xc4220[_0x7e4a('0x35')];if(!_0x42b57a[_0x7e4a('0x32')][_0x7e4a('0x38')]('nolimit')){_0x12ffc1['limit']=qs['limit'](_0x42b57a['query'][_0x7e4a('0x1f')]);_0x12ffc1[_0x7e4a('0x1c')]=qs[_0x7e4a('0x1c')](_0x42b57a['query'][_0x7e4a('0x1c')]);}_0x12ffc1['order']=qs['sort'](_0x42b57a[_0x7e4a('0x32')][_0x7e4a('0x39')]);_0x12ffc1[_0x7e4a('0x3a')]=qs[_0x7e4a('0x34')](_[_0x7e4a('0x3b')](_0x42b57a['query'],_0xc4220[_0x7e4a('0x34')]),_0x1533c6);if(_0x42b57a[_0x7e4a('0x32')]['filter']){_0x12ffc1[_0x7e4a('0x3a')]=_['merge'](_0x12ffc1[_0x7e4a('0x3a')],{'$or':_[_0x7e4a('0x2c')](_0x1533c6,function(_0x55cdbb){if(_0x55cdbb['type']!==_0x7e4a('0x3c')){var _0x3b1844={};_0x3b1844[_0x55cdbb['name']]={'$like':'%'+_0x42b57a['query'][_0x7e4a('0x3d')]+'%'};return _0x3b1844;}})});}_0x12ffc1=_[_0x7e4a('0x3e')]({},_0x12ffc1,_0x42b57a[_0x7e4a('0x3f')]);var _0x43e9ce={'where':_0x12ffc1[_0x7e4a('0x3a')]};return db[_0x7e4a('0x2d')][_0x7e4a('0x1e')](_0x43e9ce)[_0x7e4a('0x24')](function(_0x1b6fa8){_0x732c67['count']=_0x1b6fa8;if(_0x42b57a[_0x7e4a('0x32')][_0x7e4a('0x40')]){_0x12ffc1[_0x7e4a('0x41')]=[{'all':!![]}];}return db[_0x7e4a('0x2d')][_0x7e4a('0x42')](_0x12ffc1);})[_0x7e4a('0x24')](function(_0x1fcf13){_0x732c67[_0x7e4a('0x43')]=_0x1fcf13;return _0x732c67;})[_0x7e4a('0x24')](respondWithFilteredResult(_0xe6b5c,_0x12ffc1))[_0x7e4a('0x44')](handleError(_0xe6b5c,null));};exports['show']=function(_0x330715,_0x5690ed){var _0x4ef707={'raw':!![],'where':{'id':_0x330715['params']['id']}},_0x560cf5={};_0x560cf5[_0x7e4a('0x35')]=_['keys'](db[_0x7e4a('0x2d')][_0x7e4a('0x2e')]);_0x560cf5[_0x7e4a('0x32')]=_[_0x7e4a('0x33')](_0x330715[_0x7e4a('0x32')]);_0x560cf5['filters']=_['intersection'](_0x560cf5[_0x7e4a('0x35')],_0x560cf5[_0x7e4a('0x32')]);_0x4ef707['attributes']=_[_0x7e4a('0x36')](_0x560cf5['model'],qs[_0x7e4a('0x45')](_0x330715[_0x7e4a('0x32')][_0x7e4a('0x45')]));_0x4ef707[_0x7e4a('0x37')]=_0x4ef707[_0x7e4a('0x37')][_0x7e4a('0x46')]?_0x4ef707[_0x7e4a('0x37')]:_0x560cf5[_0x7e4a('0x35')];if(_0x330715[_0x7e4a('0x32')][_0x7e4a('0x40')]){_0x4ef707[_0x7e4a('0x41')]=[{'all':!![]}];}_0x4ef707=_[_0x7e4a('0x3e')]({},_0x4ef707,_0x330715[_0x7e4a('0x3f')]);return db['AnalyticExtractedReport'][_0x7e4a('0x47')](_0x4ef707)[_0x7e4a('0x24')](handleEntityNotFound(_0x5690ed,null))[_0x7e4a('0x24')](respondWithResult(_0x5690ed,null))[_0x7e4a('0x44')](handleError(_0x5690ed,null));};exports['create']=function(_0xc8535,_0x35c70a){return db[_0x7e4a('0x2d')]['create'](_0xc8535['body'],{})[_0x7e4a('0x24')](function(_0x419710){var _0x3b7813=_0xc8535[_0x7e4a('0x48')]['get']({'plain':!![]});if(!_0x3b7813)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b7813[_0x7e4a('0x49')]==='user'){var _0x1d7de0=_0x419710['get']({'plain':!![]});var _0x5096f4=_0x7e4a('0x26');return db[_0x7e4a('0x4a')][_0x7e4a('0x47')]({'where':{'name':_0x5096f4,'userProfileId':_0x3b7813['userProfileId']},'raw':!![]})['then'](function(_0x39fdf0){if(_0x39fdf0&&_0x39fdf0[_0x7e4a('0x4b')]===0x0){return db['UserProfileResource'][_0x7e4a('0x4c')]({'name':_0x1d7de0[_0x7e4a('0x29')],'resourceId':_0x1d7de0['id'],'type':_0x39fdf0[_0x7e4a('0x29')],'sectionId':_0x39fdf0['id']},{})[_0x7e4a('0x24')](function(){return _0x419710;});}else{return _0x419710;}})['catch'](function(_0x45fdab){logger[_0x7e4a('0x4d')](_0x7e4a('0x4e'),_0x45fdab);throw _0x45fdab;});}return _0x419710;})[_0x7e4a('0x24')](respondWithResult(_0x35c70a,0xc9))['catch'](handleError(_0x35c70a,null));};exports[_0x7e4a('0x23')]=function(_0x4c21d5,_0x28ec63){if(_0x4c21d5['body']['id']){delete _0x4c21d5[_0x7e4a('0x4f')]['id'];}return db[_0x7e4a('0x2d')][_0x7e4a('0x47')]({'where':{'id':_0x4c21d5[_0x7e4a('0x50')]['id']}})[_0x7e4a('0x24')](handleEntityNotFound(_0x28ec63,null))[_0x7e4a('0x24')](saveUpdates(_0x4c21d5[_0x7e4a('0x4f')],null))[_0x7e4a('0x24')](respondWithResult(_0x28ec63,null))[_0x7e4a('0x44')](handleError(_0x28ec63,null));};exports[_0x7e4a('0x25')]=function(_0x6b115a,_0x54f505){return db[_0x7e4a('0x2d')][_0x7e4a('0x47')]({'where':{'id':_0x6b115a[_0x7e4a('0x50')]['id']}})[_0x7e4a('0x24')](handleEntityNotFound(_0x54f505,null))['then'](removeEntity(_0x54f505,null))[_0x7e4a('0x44')](handleError(_0x54f505,null));};exports[_0x7e4a('0x51')]=function(_0x476e3c,_0x5ce052,_0x10a13a){return db[_0x7e4a('0x2d')][_0x7e4a('0x47')]({'where':{'id':_0x476e3c['params']['id']},'attributes':[_0x7e4a('0x29'),'basename',_0x7e4a('0x52'),'output'],'raw':!![]})[_0x7e4a('0x24')](handleEntityNotFound(_0x5ce052,null))['then'](function(_0x1521d0){if(_0x1521d0){if(!fs[_0x7e4a('0x53')](path[_0x7e4a('0x54')](config['root'],_0x7e4a('0x55'),_0x1521d0[_0x7e4a('0x52')]))){throw new db[(_0x7e4a('0x56'))][(_0x7e4a('0x57'))](_0x7e4a('0x58'));}if(_0x476e3c[_0x7e4a('0x32')][_0x7e4a('0x59')]){return _0x5ce052[_0x7e4a('0x18')](0xc8);}return _0x5ce052[_0x7e4a('0x51')](path[_0x7e4a('0x54')](config[_0x7e4a('0x5a')],_0x7e4a('0x55'),_0x1521d0['savename']),util['format'](_0x7e4a('0x5b'),_0x1521d0[_0x7e4a('0x5c')]||_0x1521d0[_0x7e4a('0x29')],_0x1521d0[_0x7e4a('0x5d')][_0x7e4a('0x5e')]()));}})[_0x7e4a('0x44')](handleError(_0x5ce052,null));}; \ No newline at end of file +var _0x63cc=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','%s.%s','toLowerCase','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','then','get','ExtractedReports','UserProfileResource','end','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x115aa2,_0x12d812){var _0x5890a5=function(_0x2e5fdb){while(--_0x2e5fdb){_0x115aa2['push'](_0x115aa2['shift']());}};_0x5890a5(++_0x12d812);}(_0x63cc,0x1ec));var _0xc63c=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x63cc[_0x4bb581];return _0x316bf5;};'use strict';var emlformat=require(_0xc63c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc63c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc63c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc63c('0x3'));var util=require(_0xc63c('0x4'));var path=require(_0xc63c('0x5'));var sox=require(_0xc63c('0x6'));var csv=require(_0xc63c('0x7'));var ejs=require(_0xc63c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc63c('0x9'));var squel=require(_0xc63c('0xa'));var crypto=require(_0xc63c('0xb'));var jsforce=require(_0xc63c('0xc'));var deskjs=require(_0xc63c('0xd'));var toCsv=require(_0xc63c('0x7'));var querystring=require(_0xc63c('0xe'));var Papa=require(_0xc63c('0xf'));var Redis=require('ioredis');var authService=require(_0xc63c('0x10'));var qs=require(_0xc63c('0x11'));var as=require(_0xc63c('0x12'));var hardwareService=require(_0xc63c('0x13'));var logger=require(_0xc63c('0x14'))(_0xc63c('0x15'));var utils=require(_0xc63c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc63c('0x17'));var db=require(_0xc63c('0x18'))['db'];function respondWithStatusCode(_0x6c4adf,_0x447245){_0x447245=_0x447245||0xcc;return function(_0x6dfc9f){if(_0x6dfc9f){return _0x6c4adf[_0xc63c('0x19')](_0x447245);}return _0x6c4adf['status'](_0x447245)['end']();};}function respondWithResult(_0x5e405b,_0x2cc3c8){_0x2cc3c8=_0x2cc3c8||0xc8;return function(_0x4366b2){if(_0x4366b2){return _0x5e405b[_0xc63c('0x1a')](_0x2cc3c8)['json'](_0x4366b2);}};}function respondWithFilteredResult(_0x5d3a14,_0x32045b){return function(_0x1c1cdf){if(_0x1c1cdf){var _0x1b1948=typeof _0x32045b[_0xc63c('0x1b')]===_0xc63c('0x1c')&&typeof _0x32045b['limit']==='undefined';var _0x28b577=_0x1c1cdf[_0xc63c('0x1d')];var _0x16c7d2=_0x1b1948?0x0:_0x32045b[_0xc63c('0x1b')];var _0x57c910=_0x1b1948?_0x1c1cdf[_0xc63c('0x1d')]:_0x32045b[_0xc63c('0x1b')]+_0x32045b[_0xc63c('0x1e')];var _0x8eb59;if(_0x57c910>=_0x28b577){_0x57c910=_0x28b577;_0x8eb59=0xc8;}else{_0x8eb59=0xce;}_0x5d3a14[_0xc63c('0x1a')](_0x8eb59);return _0x5d3a14['set'](_0xc63c('0x1f'),_0x16c7d2+'-'+_0x57c910+'/'+_0x28b577)[_0xc63c('0x20')](_0x1c1cdf);}return null;};}function patchUpdates(_0x51791f){return function(_0x3ce58d){try{jsonpatch[_0xc63c('0x21')](_0x3ce58d,_0x51791f,!![]);}catch(_0x3129be){return BPromise['reject'](_0x3129be);}return _0x3ce58d[_0xc63c('0x22')]();};}function saveUpdates(_0x52d823,_0x2226fc){return function(_0x3c4e87){if(_0x3c4e87){return _0x3c4e87[_0xc63c('0x23')](_0x52d823)['then'](function(_0x4de078){return _0x4de078;});}return null;};}function removeEntity(_0x58d118,_0x2f7125){return function(_0x5b4979){if(_0x5b4979){return _0x5b4979[_0xc63c('0x24')]()[_0xc63c('0x25')](function(){var _0x53b1b5=_0x5b4979[_0xc63c('0x26')]({'plain':!![]});var _0x1acc7b=_0xc63c('0x27');return db[_0xc63c('0x28')][_0xc63c('0x24')]({'where':{'type':_0x1acc7b,'resourceId':_0x53b1b5['id']}})[_0xc63c('0x25')](function(){return _0x5b4979;});})[_0xc63c('0x25')](function(){_0x58d118[_0xc63c('0x1a')](0xcc)[_0xc63c('0x29')]();});}};}function handleEntityNotFound(_0x5b94ba,_0x9c1a2b){return function(_0x2a16de){if(!_0x2a16de){_0x5b94ba['sendStatus'](0x194);}return _0x2a16de;};}function handleError(_0x4c0a1f,_0x31e0ab){_0x31e0ab=_0x31e0ab||0x1f4;return function(_0x59170c){logger['error'](_0x59170c['stack']);if(_0x59170c[_0xc63c('0x2a')]){delete _0x59170c[_0xc63c('0x2a')];}_0x4c0a1f[_0xc63c('0x1a')](_0x31e0ab)[_0xc63c('0x2b')](_0x59170c);};}exports['index']=function(_0x56d022,_0x4076c9){var _0x5da78a={},_0x3b28f4={},_0x3894fa={'count':0x0,'rows':[]};var _0x397fdf=_[_0xc63c('0x2c')](db[_0xc63c('0x2d')]['rawAttributes'],function(_0x26f388){return{'name':_0x26f388[_0xc63c('0x2e')],'type':_0x26f388[_0xc63c('0x2f')][_0xc63c('0x30')]};});_0x3b28f4[_0xc63c('0x31')]=_[_0xc63c('0x2c')](_0x397fdf,_0xc63c('0x2a'));_0x3b28f4[_0xc63c('0x32')]=_['keys'](_0x56d022[_0xc63c('0x32')]);_0x3b28f4[_0xc63c('0x33')]=_['intersection'](_0x3b28f4[_0xc63c('0x31')],_0x3b28f4[_0xc63c('0x32')]);_0x5da78a[_0xc63c('0x34')]=_['intersection'](_0x3b28f4['model'],qs['fields'](_0x56d022[_0xc63c('0x32')][_0xc63c('0x35')]));_0x5da78a['attributes']=_0x5da78a['attributes'][_0xc63c('0x36')]?_0x5da78a['attributes']:_0x3b28f4[_0xc63c('0x31')];if(!_0x56d022[_0xc63c('0x32')][_0xc63c('0x37')](_0xc63c('0x38'))){_0x5da78a[_0xc63c('0x1e')]=qs[_0xc63c('0x1e')](_0x56d022['query'][_0xc63c('0x1e')]);_0x5da78a['offset']=qs[_0xc63c('0x1b')](_0x56d022[_0xc63c('0x32')]['offset']);}_0x5da78a[_0xc63c('0x39')]=qs['sort'](_0x56d022[_0xc63c('0x32')][_0xc63c('0x3a')]);_0x5da78a[_0xc63c('0x3b')]=qs[_0xc63c('0x33')](_[_0xc63c('0x3c')](_0x56d022[_0xc63c('0x32')],_0x3b28f4[_0xc63c('0x33')]),_0x397fdf);if(_0x56d022[_0xc63c('0x32')][_0xc63c('0x3d')]){_0x5da78a[_0xc63c('0x3b')]=_[_0xc63c('0x3e')](_0x5da78a['where'],{'$or':_[_0xc63c('0x2c')](_0x397fdf,function(_0x3409e8){if(_0x3409e8[_0xc63c('0x2f')]!=='VIRTUAL'){var _0x540774={};_0x540774[_0x3409e8[_0xc63c('0x2a')]]={'$like':'%'+_0x56d022[_0xc63c('0x32')][_0xc63c('0x3d')]+'%'};return _0x540774;}})});}_0x5da78a=_[_0xc63c('0x3e')]({},_0x5da78a,_0x56d022[_0xc63c('0x3f')]);var _0x390bae={'where':_0x5da78a['where']};return db[_0xc63c('0x2d')][_0xc63c('0x1d')](_0x390bae)[_0xc63c('0x25')](function(_0x248500){_0x3894fa[_0xc63c('0x1d')]=_0x248500;if(_0x56d022['query'][_0xc63c('0x40')]){_0x5da78a[_0xc63c('0x41')]=[{'all':!![]}];}return db[_0xc63c('0x2d')][_0xc63c('0x42')](_0x5da78a);})[_0xc63c('0x25')](function(_0x1a7b9d){_0x3894fa[_0xc63c('0x43')]=_0x1a7b9d;return _0x3894fa;})['then'](respondWithFilteredResult(_0x4076c9,_0x5da78a))[_0xc63c('0x44')](handleError(_0x4076c9,null));};exports['show']=function(_0x437c8a,_0x563ae3){var _0x403b47={'raw':!![],'where':{'id':_0x437c8a[_0xc63c('0x45')]['id']}},_0x59c20c={};_0x59c20c[_0xc63c('0x31')]=_[_0xc63c('0x46')](db[_0xc63c('0x2d')][_0xc63c('0x47')]);_0x59c20c[_0xc63c('0x32')]=_[_0xc63c('0x46')](_0x437c8a[_0xc63c('0x32')]);_0x59c20c[_0xc63c('0x33')]=_[_0xc63c('0x48')](_0x59c20c[_0xc63c('0x31')],_0x59c20c[_0xc63c('0x32')]);_0x403b47[_0xc63c('0x34')]=_[_0xc63c('0x48')](_0x59c20c[_0xc63c('0x31')],qs[_0xc63c('0x35')](_0x437c8a[_0xc63c('0x32')][_0xc63c('0x35')]));_0x403b47[_0xc63c('0x34')]=_0x403b47[_0xc63c('0x34')][_0xc63c('0x36')]?_0x403b47['attributes']:_0x59c20c['model'];if(_0x437c8a[_0xc63c('0x32')]['includeAll']){_0x403b47[_0xc63c('0x41')]=[{'all':!![]}];}_0x403b47=_[_0xc63c('0x3e')]({},_0x403b47,_0x437c8a['options']);return db[_0xc63c('0x2d')][_0xc63c('0x49')](_0x403b47)[_0xc63c('0x25')](handleEntityNotFound(_0x563ae3,null))[_0xc63c('0x25')](respondWithResult(_0x563ae3,null))[_0xc63c('0x44')](handleError(_0x563ae3,null));};exports[_0xc63c('0x4a')]=function(_0x30b084,_0x183f32){return db[_0xc63c('0x2d')]['create'](_0x30b084['body'],{})[_0xc63c('0x25')](function(_0x3cc99c){var _0x12fa18=_0x30b084[_0xc63c('0x4b')]['get']({'plain':!![]});if(!_0x12fa18)throw new Error(_0xc63c('0x4c'));if(_0x12fa18[_0xc63c('0x4d')]===_0xc63c('0x4b')){var _0x32d33d=_0x3cc99c[_0xc63c('0x26')]({'plain':!![]});var _0xfa982a='ExtractedReports';return db[_0xc63c('0x4e')][_0xc63c('0x49')]({'where':{'name':_0xfa982a,'userProfileId':_0x12fa18[_0xc63c('0x4f')]},'raw':!![]})['then'](function(_0xe5a52c){if(_0xe5a52c&&_0xe5a52c[_0xc63c('0x50')]===0x0){return db[_0xc63c('0x28')]['create']({'name':_0x32d33d[_0xc63c('0x2a')],'resourceId':_0x32d33d['id'],'type':_0xe5a52c[_0xc63c('0x2a')],'sectionId':_0xe5a52c['id']},{})['then'](function(){return _0x3cc99c;});}else{return _0x3cc99c;}})['catch'](function(_0x1bcbe1){logger['error'](_0xc63c('0x51'),_0x1bcbe1);throw _0x1bcbe1;});}return _0x3cc99c;})[_0xc63c('0x25')](respondWithResult(_0x183f32,0xc9))[_0xc63c('0x44')](handleError(_0x183f32,null));};exports[_0xc63c('0x23')]=function(_0x5445d5,_0x2b0c7b){if(_0x5445d5[_0xc63c('0x52')]['id']){delete _0x5445d5[_0xc63c('0x52')]['id'];}return db[_0xc63c('0x2d')][_0xc63c('0x49')]({'where':{'id':_0x5445d5['params']['id']}})[_0xc63c('0x25')](handleEntityNotFound(_0x2b0c7b,null))[_0xc63c('0x25')](saveUpdates(_0x5445d5[_0xc63c('0x52')],null))[_0xc63c('0x25')](respondWithResult(_0x2b0c7b,null))[_0xc63c('0x44')](handleError(_0x2b0c7b,null));};exports[_0xc63c('0x24')]=function(_0x2b0dd1,_0xbf56e){return db[_0xc63c('0x2d')][_0xc63c('0x49')]({'where':{'id':_0x2b0dd1[_0xc63c('0x45')]['id']}})[_0xc63c('0x25')](handleEntityNotFound(_0xbf56e,null))[_0xc63c('0x25')](removeEntity(_0xbf56e,null))[_0xc63c('0x44')](handleError(_0xbf56e,null));};exports['download']=function(_0x525bb4,_0x2fcacd,_0x2d6c74){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x525bb4[_0xc63c('0x45')]['id']},'attributes':[_0xc63c('0x2a'),_0xc63c('0x53'),_0xc63c('0x54'),_0xc63c('0x55')],'raw':!![]})[_0xc63c('0x25')](handleEntityNotFound(_0x2fcacd,null))[_0xc63c('0x25')](function(_0x55700c){if(_0x55700c){if(!fs[_0xc63c('0x56')](path[_0xc63c('0x57')](config[_0xc63c('0x58')],_0xc63c('0x59'),_0x55700c[_0xc63c('0x54')]))){throw new db[(_0xc63c('0x5a'))][(_0xc63c('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x525bb4['query'][_0xc63c('0x5c')]){return _0x2fcacd[_0xc63c('0x19')](0xc8);}return _0x2fcacd['download'](path[_0xc63c('0x57')](config[_0xc63c('0x58')],_0xc63c('0x59'),_0x55700c[_0xc63c('0x54')]),util['format'](_0xc63c('0x5d'),_0x55700c[_0xc63c('0x53')]||_0x55700c[_0xc63c('0x2a')],_0x55700c[_0xc63c('0x55')][_0xc63c('0x5e')]()));}})['catch'](handleError(_0x2fcacd,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 069a535..90c5ce7 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 _0xe0d7=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x22afbf,_0x1ce599){var _0x258eb2=function(_0x5a60d9){while(--_0x5a60d9){_0x22afbf['push'](_0x22afbf['shift']());}};_0x258eb2(++_0x1ce599);}(_0xe0d7,0xd1));var _0x7e0d=function(_0x196dad,_0x46c9be){_0x196dad=_0x196dad-0x0;var _0x2a57f9=_0xe0d7[_0x196dad];return _0x2a57f9;};'use strict';var _=require(_0x7e0d('0x0'));var util=require(_0x7e0d('0x1'));var logger=require('../../config/logger')(_0x7e0d('0x2'));var moment=require(_0x7e0d('0x3'));var BPromise=require(_0x7e0d('0x4'));var rp=require(_0x7e0d('0x5'));var fs=require('fs');var path=require(_0x7e0d('0x6'));var rimraf=require(_0x7e0d('0x7'));var config=require(_0x7e0d('0x8'));var attributes=require(_0x7e0d('0x9'));module[_0x7e0d('0xa')]=function(_0x49e20b,_0x478182){return _0x49e20b[_0x7e0d('0xb')](_0x7e0d('0xc'),attributes,{'tableName':_0x7e0d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe266=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0xe266,0x1e1));var _0x6e26=function(_0x5d4887,_0xef1c71){_0x5d4887=_0x5d4887-0x0;var _0x255855=_0xe266[_0x5d4887];return _0x255855;};'use strict';var _=require(_0x6e26('0x0'));var util=require('util');var logger=require(_0x6e26('0x1'))(_0x6e26('0x2'));var moment=require(_0x6e26('0x3'));var BPromise=require(_0x6e26('0x4'));var rp=require(_0x6e26('0x5'));var fs=require('fs');var path=require(_0x6e26('0x6'));var rimraf=require(_0x6e26('0x7'));var config=require('../../config/environment');var attributes=require(_0x6e26('0x8'));module[_0x6e26('0x9')]=function(_0x394146,_0x2ffb09){return _0x394146[_0x6e26('0xa')](_0x6e26('0xb'),attributes,{'tableName':_0x6e26('0xc'),'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 a1d5117..d81eddd 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 _0x884c=['request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x445d86,_0x436422){var _0xcc6c76=function(_0x5137df){while(--_0x5137df){_0x445d86['push'](_0x445d86['shift']());}};_0xcc6c76(++_0x436422);}(_0x884c,0x1bd));var _0xc884=function(_0x311907,_0x87dc1d){_0x311907=_0x311907-0x0;var _0x3548e7=_0x884c[_0x311907];return _0x3548e7;};'use strict';var _=require(_0xc884('0x0'));var util=require(_0xc884('0x1'));var moment=require(_0xc884('0x2'));var BPromise=require(_0xc884('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc884('0x4'));var db=require(_0xc884('0x5'))['db'];var utils=require(_0xc884('0x6'));var logger=require(_0xc884('0x7'))(_0xc884('0x8'));var config=require(_0xc884('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc884('0xa')][_0xc884('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28365a,_0x526712,_0x493eff){return new BPromise(function(_0x4ddce5,_0x218fd7){return client[_0xc884('0xc')](_0x28365a,_0x493eff)['then'](function(_0x22f550){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x526712,'request\x20sent');logger[_0xc884('0xd')](_0xc884('0xe'),_0x526712,_0xc884('0xf'),JSON[_0xc884('0x10')](_0x22f550));if(_0x22f550[_0xc884('0x11')]){if(_0x22f550['error'][_0xc884('0x12')]===0x1f4){logger[_0xc884('0x11')](_0xc884('0x13'),_0x526712,_0x22f550[_0xc884('0x11')]['message']);return _0x218fd7(_0x22f550[_0xc884('0x11')]['message']);}logger[_0xc884('0x11')](_0xc884('0x13'),_0x526712,_0x22f550[_0xc884('0x11')][_0xc884('0x14')]);return _0x4ddce5(_0x22f550['error']['message']);}else{logger['info'](_0xc884('0x13'),_0x526712,_0xc884('0xf'));_0x4ddce5(_0x22f550[_0xc884('0x15')][_0xc884('0x14')]);}})[_0xc884('0x16')](function(_0x127856){logger[_0xc884('0x11')](_0xc884('0x13'),_0x526712,_0x127856);_0x218fd7(_0x127856);});});} \ No newline at end of file +var _0x6582=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6582,0x108));var _0x2658=function(_0x3f9715,_0x431051){_0x3f9715=_0x3f9715-0x0;var _0x2d1e42=_0x6582[_0x3f9715];return _0x2d1e42;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e211569..8a133fe 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 _0x6306=['fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router'];(function(_0xf7fcc2,_0x13a418){var _0xc2d347=function(_0x470250){while(--_0x470250){_0xf7fcc2['push'](_0xf7fcc2['shift']());}};_0xc2d347(++_0x13a418);}(_0x6306,0x188));var _0x6630=function(_0x25b5c1,_0x15f706){_0x25b5c1=_0x25b5c1-0x0;var _0x15cb0d=_0x6306[_0x25b5c1];return _0x15cb0d;};'use strict';var multer=require(_0x6630('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6630('0x1'));var express=require(_0x6630('0x2'));var router=express[_0x6630('0x3')]();var fs_extra=require(_0x6630('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6630('0x5'));var config=require(_0x6630('0x6'));var controller=require(_0x6630('0x7'));router[_0x6630('0x8')]('/',auth['isAuthenticated'](),controller[_0x6630('0x9')]);router[_0x6630('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6630('0xa')]);router[_0x6630('0x8')](_0x6630('0xb'),auth[_0x6630('0xc')](),controller[_0x6630('0xd')]);router[_0x6630('0xe')]('/',auth[_0x6630('0xc')](),controller[_0x6630('0xf')]);router[_0x6630('0x10')]('/:id',auth[_0x6630('0xc')](),controller[_0x6630('0x11')]);router[_0x6630('0x12')](_0x6630('0x13'),auth[_0x6630('0xc')](),controller[_0x6630('0x14')]);module[_0x6630('0x15')]=router; \ No newline at end of file +var _0x0762=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','delete','destroy'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0762,0x168));var _0x2076=function(_0x138136,_0x1fbe02){_0x138136=_0x138136-0x0;var _0xad8864=_0x0762[_0x138136];return _0xad8864;};'use strict';var multer=require('multer');var util=require(_0x2076('0x0'));var path=require(_0x2076('0x1'));var timeout=require(_0x2076('0x2'));var express=require('express');var router=express[_0x2076('0x3')]();var fs_extra=require(_0x2076('0x4'));var auth=require(_0x2076('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2076('0x6'));var controller=require(_0x2076('0x7'));router[_0x2076('0x8')]('/',auth[_0x2076('0x9')](),controller['index']);router[_0x2076('0x8')](_0x2076('0xa'),auth[_0x2076('0x9')](),controller[_0x2076('0xb')]);router['get'](_0x2076('0xc'),auth[_0x2076('0x9')](),controller[_0x2076('0xd')]);router[_0x2076('0xe')]('/',auth[_0x2076('0x9')](),controller[_0x2076('0xf')]);router['put'](_0x2076('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2076('0x10')](_0x2076('0xa'),auth[_0x2076('0x9')](),controller[_0x2076('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index dd9644f..dbfeed0 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 _0x8f94=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f94,0xd3));var _0x48f9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f94[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x48f9('0x0'));module[_0x48f9('0x1')]={'field':{'type':Sequelize[_0x48f9('0x2')]},'alias':{'type':Sequelize[_0x48f9('0x3')]},'function':{'type':Sequelize[_0x48f9('0x3')]},'format':{'type':Sequelize[_0x48f9('0x3')]},'groupBy':{'type':Sequelize[_0x48f9('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x48f9('0x3')]},'custom':{'type':Sequelize[_0x48f9('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xd2b2=['BOOLEAN','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2b2,0x11b));var _0x2d2b=function(_0x1ccf4f,_0x18ce33){_0x1ccf4f=_0x1ccf4f-0x0;var _0x3f747c=_0xd2b2[_0x1ccf4f];return _0x3f747c;};'use strict';var Sequelize=require(_0x2d2b('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x2d2b('0x1')]},'format':{'type':Sequelize[_0x2d2b('0x1')]},'groupBy':{'type':Sequelize[_0x2d2b('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2d2b('0x1')]},'custom':{'type':Sequelize[_0x2d2b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index f706ba1..a0794c1 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 _0x9933=['mustache','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','AnalyticFieldReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','bulkCreate','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9933,0xe5));var _0x3993=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9933[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x3993('0x0'));var rimraf=require(_0x3993('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3993('0x2'));var rp=require('request-promise');var moment=require(_0x3993('0x3'));var BPromise=require(_0x3993('0x4'));var Mustache=require(_0x3993('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3993('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3993('0x7'));var _=require(_0x3993('0x8'));var squel=require(_0x3993('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3993('0xa'));var toCsv=require(_0x3993('0x6'));var querystring=require(_0x3993('0xb'));var Papa=require(_0x3993('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3993('0xd'));var as=require(_0x3993('0xe'));var hardwareService=require(_0x3993('0xf'));var logger=require('../../config/logger')(_0x3993('0x10'));var utils=require(_0x3993('0x11'));var config=require(_0x3993('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3993('0x13'))['db'];function respondWithStatusCode(_0x53b36a,_0x2f2550){_0x2f2550=_0x2f2550||0xcc;return function(_0x43f79f){if(_0x43f79f){return _0x53b36a[_0x3993('0x14')](_0x2f2550);}return _0x53b36a[_0x3993('0x15')](_0x2f2550)[_0x3993('0x16')]();};}function respondWithResult(_0x246754,_0x5d72c5){_0x5d72c5=_0x5d72c5||0xc8;return function(_0x323e7e){if(_0x323e7e){return _0x246754[_0x3993('0x15')](_0x5d72c5)['json'](_0x323e7e);}};}function respondWithFilteredResult(_0x3426db,_0x10d64b){return function(_0x35b0a3){if(_0x35b0a3){var _0x5415a4=typeof _0x10d64b[_0x3993('0x17')]===_0x3993('0x18')&&typeof _0x10d64b[_0x3993('0x19')]==='undefined';var _0x3bc0e9=_0x35b0a3[_0x3993('0x1a')];var _0x13569f=_0x5415a4?0x0:_0x10d64b[_0x3993('0x17')];var _0xcfdc67=_0x5415a4?_0x35b0a3[_0x3993('0x1a')]:_0x10d64b[_0x3993('0x17')]+_0x10d64b[_0x3993('0x19')];var _0x919c93;if(_0xcfdc67>=_0x3bc0e9){_0xcfdc67=_0x3bc0e9;_0x919c93=0xc8;}else{_0x919c93=0xce;}_0x3426db[_0x3993('0x15')](_0x919c93);return _0x3426db[_0x3993('0x1b')](_0x3993('0x1c'),_0x13569f+'-'+_0xcfdc67+'/'+_0x3bc0e9)[_0x3993('0x1d')](_0x35b0a3);}return null;};}function patchUpdates(_0x389f01){return function(_0x508a29){try{jsonpatch[_0x3993('0x1e')](_0x508a29,_0x389f01,!![]);}catch(_0x552a8f){return BPromise[_0x3993('0x1f')](_0x552a8f);}return _0x508a29[_0x3993('0x20')]();};}function saveUpdates(_0x215cdc,_0x443405){return function(_0x468150){if(_0x468150){return _0x468150[_0x3993('0x21')](_0x215cdc)[_0x3993('0x22')](function(_0x267db9){return _0x267db9;});}return null;};}function removeEntity(_0x14fbf4,_0x5b528d){return function(_0x3f2305){if(_0x3f2305){return _0x3f2305[_0x3993('0x23')]()['then'](function(){_0x14fbf4[_0x3993('0x15')](0xcc)[_0x3993('0x16')]();});}};}function handleEntityNotFound(_0x54c9bd,_0x43e935){return function(_0x189831){if(!_0x189831){_0x54c9bd[_0x3993('0x14')](0x194);}return _0x189831;};}function handleError(_0x47886c,_0x2d5bb6){_0x2d5bb6=_0x2d5bb6||0x1f4;return function(_0xede592){logger[_0x3993('0x24')](_0xede592[_0x3993('0x25')]);if(_0xede592[_0x3993('0x26')]){delete _0xede592[_0x3993('0x26')];}_0x47886c[_0x3993('0x15')](_0x2d5bb6)[_0x3993('0x27')](_0xede592);};}exports['index']=function(_0x2f52c4,_0x1c7fe9){var _0x32c80c={},_0x4fd8d7={},_0x353ccc={'count':0x0,'rows':[]};var _0x18880a=_['map'](db[_0x3993('0x28')]['rawAttributes'],function(_0x1ca9d7){return{'name':_0x1ca9d7[_0x3993('0x29')],'type':_0x1ca9d7[_0x3993('0x2a')]['key']};});_0x4fd8d7[_0x3993('0x2b')]=_[_0x3993('0x2c')](_0x18880a,_0x3993('0x26'));_0x4fd8d7[_0x3993('0x2d')]=_['keys'](_0x2f52c4['query']);_0x4fd8d7[_0x3993('0x2e')]=_[_0x3993('0x2f')](_0x4fd8d7[_0x3993('0x2b')],_0x4fd8d7[_0x3993('0x2d')]);_0x32c80c[_0x3993('0x30')]=_['intersection'](_0x4fd8d7['model'],qs[_0x3993('0x31')](_0x2f52c4[_0x3993('0x2d')][_0x3993('0x31')]));_0x32c80c[_0x3993('0x30')]=_0x32c80c[_0x3993('0x30')][_0x3993('0x32')]?_0x32c80c[_0x3993('0x30')]:_0x4fd8d7[_0x3993('0x2b')];if(!_0x2f52c4[_0x3993('0x2d')][_0x3993('0x33')]('nolimit')){_0x32c80c[_0x3993('0x19')]=qs[_0x3993('0x19')](_0x2f52c4[_0x3993('0x2d')][_0x3993('0x19')]);_0x32c80c[_0x3993('0x17')]=qs[_0x3993('0x17')](_0x2f52c4['query']['offset']);}_0x32c80c[_0x3993('0x34')]=qs[_0x3993('0x35')](_0x2f52c4[_0x3993('0x2d')][_0x3993('0x35')]);_0x32c80c[_0x3993('0x36')]=qs[_0x3993('0x2e')](_[_0x3993('0x37')](_0x2f52c4['query'],_0x4fd8d7[_0x3993('0x2e')]),_0x18880a);if(_0x2f52c4[_0x3993('0x2d')][_0x3993('0x38')]){_0x32c80c[_0x3993('0x36')]=_[_0x3993('0x39')](_0x32c80c[_0x3993('0x36')],{'$or':_[_0x3993('0x2c')](_0x18880a,function(_0xcd8a5){if(_0xcd8a5[_0x3993('0x2a')]!==_0x3993('0x3a')){var _0xcc03d7={};_0xcc03d7[_0xcd8a5[_0x3993('0x26')]]={'$like':'%'+_0x2f52c4[_0x3993('0x2d')][_0x3993('0x38')]+'%'};return _0xcc03d7;}})});}_0x32c80c=_[_0x3993('0x39')]({},_0x32c80c,_0x2f52c4[_0x3993('0x3b')]);var _0x5dbbd8={'where':_0x32c80c['where']};return db[_0x3993('0x28')][_0x3993('0x1a')](_0x5dbbd8)[_0x3993('0x22')](function(_0x89e478){_0x353ccc[_0x3993('0x1a')]=_0x89e478;if(_0x2f52c4[_0x3993('0x2d')]['includeAll']){_0x32c80c['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3993('0x3c')](_0x32c80c);})[_0x3993('0x22')](function(_0x575952){_0x353ccc[_0x3993('0x3d')]=_0x575952;return _0x353ccc;})[_0x3993('0x22')](respondWithFilteredResult(_0x1c7fe9,_0x32c80c))[_0x3993('0x3e')](handleError(_0x1c7fe9,null));};exports[_0x3993('0x3f')]=function(_0x48138e,_0x509cb0){var _0x3c7a47={'raw':![],'where':{'id':_0x48138e[_0x3993('0x40')]['id']}},_0x3a5512={};_0x3a5512[_0x3993('0x2b')]=_[_0x3993('0x41')](db['AnalyticFieldReport'][_0x3993('0x42')]);_0x3a5512[_0x3993('0x2d')]=_[_0x3993('0x41')](_0x48138e[_0x3993('0x2d')]);_0x3a5512[_0x3993('0x2e')]=_[_0x3993('0x2f')](_0x3a5512[_0x3993('0x2b')],_0x3a5512[_0x3993('0x2d')]);_0x3c7a47[_0x3993('0x30')]=_[_0x3993('0x2f')](_0x3a5512[_0x3993('0x2b')],qs['fields'](_0x48138e[_0x3993('0x2d')][_0x3993('0x31')]));_0x3c7a47[_0x3993('0x30')]=_0x3c7a47[_0x3993('0x30')][_0x3993('0x32')]?_0x3c7a47['attributes']:_0x3a5512[_0x3993('0x2b')];if(_0x48138e['query']['includeAll']){_0x3c7a47[_0x3993('0x43')]=[{'all':!![]}];}_0x3c7a47=_[_0x3993('0x39')]({},_0x3c7a47,_0x48138e['options']);return db['AnalyticFieldReport'][_0x3993('0x44')](_0x3c7a47)['then'](handleEntityNotFound(_0x509cb0,null))[_0x3993('0x22')](respondWithResult(_0x509cb0,null))['catch'](handleError(_0x509cb0,null));};exports[_0x3993('0x45')]=function(_0x321296,_0x22c169){return db[_0x3993('0x28')][_0x3993('0x45')](_0x321296[_0x3993('0x46')],{})['then'](respondWithResult(_0x22c169,0xc9))['catch'](handleError(_0x22c169,null));};exports[_0x3993('0x47')]=function(_0x1d0cc5,_0x46dc5a){return db[_0x3993('0x28')][_0x3993('0x47')](_0x1d0cc5[_0x3993('0x46')],{'raw':![],'individualHooks':!![]})[_0x3993('0x22')](respondWithResult(_0x46dc5a,0xc9))[_0x3993('0x3e')](handleError(_0x46dc5a,null));};exports[_0x3993('0x21')]=function(_0x18b243,_0x3c8f43){if(_0x18b243['body']['id']){delete _0x18b243[_0x3993('0x46')]['id'];}return db[_0x3993('0x28')]['find']({'where':{'id':_0x18b243[_0x3993('0x40')]['id']}})[_0x3993('0x22')](handleEntityNotFound(_0x3c8f43,null))['then'](saveUpdates(_0x18b243[_0x3993('0x46')],null))[_0x3993('0x22')](respondWithResult(_0x3c8f43,null))[_0x3993('0x3e')](handleError(_0x3c8f43,null));};exports[_0x3993('0x23')]=function(_0x18711a,_0x404931){return db[_0x3993('0x28')][_0x3993('0x44')]({'where':{'id':_0x18711a[_0x3993('0x40')]['id']}})['then'](handleEntityNotFound(_0x404931,null))[_0x3993('0x22')](removeEntity(_0x404931,null))[_0x3993('0x3e')](handleError(_0x404931,null));};exports[_0x3993('0x48')]=function(_0x49099d,_0x39c267){return db[_0x3993('0x28')]['destroy']({'where':{'id':_0x49099d[_0x3993('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x39c267,0xcc))[_0x3993('0x3e')](handleError(_0x39c267,null));};exports[_0x3993('0x49')]=function(_0x4eb387,_0x5ca468,_0x46c78d){return db['AnalyticCustomReport'][_0x3993('0x4a')]({'where':{'id':_0x4eb387[_0x3993('0x40')]['id']}})[_0x3993('0x22')](handleEntityNotFound(_0x5ca468,null))[_0x3993('0x22')](function(_0x1e4095){if(_0x1e4095){return db[_0x3993('0x4b')][_0x3993('0x4c')](function(_0x4840e7){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4eb387[_0x3993('0x40')]['id']},'transaction':_0x4840e7})['then'](function(_0x50be49){var _0x12b9c4=_[_0x3993('0x2c')](_0x4eb387['body'],function(_0x4a8571){delete _0x4a8571['id'];_0x4a8571[_0x3993('0x4d')]=_0x4eb387['params']['id'];return _0x4a8571;});return db[_0x3993('0x28')]['bulkCreate'](_0x12b9c4,{'transaction':_0x4840e7});});})[_0x3993('0x22')](function(){return db[_0x3993('0x28')][_0x3993('0x3c')]({'where':{'CustomReportId':_0x4eb387[_0x3993('0x40')]['id']}});});}})[_0x3993('0x22')](respondWithResult(_0x5ca468,null))[_0x3993('0x3e')](handleError(_0x5ca468,null));}; \ No newline at end of file +var _0xe387=['AnalyticFieldReport','fieldName','key','model','keys','intersection','fields','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','rawAttributes','filters','length','options','find','create','bulkCreate','update','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe387,0x7e));var _0x7e38=function(_0x2d5ca8,_0x35e491){_0x2d5ca8=_0x2d5ca8-0x0;var _0x2dea00=_0xe387[_0x2d5ca8];return _0x2dea00;};'use strict';var emlformat=require(_0x7e38('0x0'));var rimraf=require(_0x7e38('0x1'));var zipdir=require(_0x7e38('0x2'));var jsonpatch=require(_0x7e38('0x3'));var rp=require('request-promise');var moment=require(_0x7e38('0x4'));var BPromise=require(_0x7e38('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e38('0x6'));var sox=require(_0x7e38('0x7'));var csv=require(_0x7e38('0x8'));var ejs=require(_0x7e38('0x9'));var fs=require('fs');var fs_extra=require(_0x7e38('0xa'));var _=require(_0x7e38('0xb'));var squel=require(_0x7e38('0xc'));var crypto=require(_0x7e38('0xd'));var jsforce=require(_0x7e38('0xe'));var deskjs=require(_0x7e38('0xf'));var toCsv=require(_0x7e38('0x8'));var querystring=require(_0x7e38('0x10'));var Papa=require(_0x7e38('0x11'));var Redis=require(_0x7e38('0x12'));var authService=require(_0x7e38('0x13'));var qs=require(_0x7e38('0x14'));var as=require(_0x7e38('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e38('0x16'))(_0x7e38('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7e38('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa5d6d8,_0x36f3dd){_0x36f3dd=_0x36f3dd||0xcc;return function(_0x8e1b68){if(_0x8e1b68){return _0xa5d6d8[_0x7e38('0x19')](_0x36f3dd);}return _0xa5d6d8['status'](_0x36f3dd)[_0x7e38('0x1a')]();};}function respondWithResult(_0x2291fa,_0x11fa90){_0x11fa90=_0x11fa90||0xc8;return function(_0x32ea71){if(_0x32ea71){return _0x2291fa[_0x7e38('0x1b')](_0x11fa90)[_0x7e38('0x1c')](_0x32ea71);}};}function respondWithFilteredResult(_0xa571bb,_0x43b8f4){return function(_0x33b088){if(_0x33b088){var _0x7c48fa=typeof _0x43b8f4[_0x7e38('0x1d')]===_0x7e38('0x1e')&&typeof _0x43b8f4[_0x7e38('0x1f')]==='undefined';var _0xa5a008=_0x33b088['count'];var _0x5d63e9=_0x7c48fa?0x0:_0x43b8f4[_0x7e38('0x1d')];var _0x212d87=_0x7c48fa?_0x33b088[_0x7e38('0x20')]:_0x43b8f4['offset']+_0x43b8f4['limit'];var _0x423d73;if(_0x212d87>=_0xa5a008){_0x212d87=_0xa5a008;_0x423d73=0xc8;}else{_0x423d73=0xce;}_0xa571bb[_0x7e38('0x1b')](_0x423d73);return _0xa571bb[_0x7e38('0x21')](_0x7e38('0x22'),_0x5d63e9+'-'+_0x212d87+'/'+_0xa5a008)[_0x7e38('0x1c')](_0x33b088);}return null;};}function patchUpdates(_0x4ea295){return function(_0x3582d1){try{jsonpatch[_0x7e38('0x23')](_0x3582d1,_0x4ea295,!![]);}catch(_0x115352){return BPromise[_0x7e38('0x24')](_0x115352);}return _0x3582d1[_0x7e38('0x25')]();};}function saveUpdates(_0x2471e6,_0x2764bf){return function(_0x459093){if(_0x459093){return _0x459093['update'](_0x2471e6)[_0x7e38('0x26')](function(_0xcff430){return _0xcff430;});}return null;};}function removeEntity(_0x4b94e5,_0x25b9af){return function(_0x2f6fbe){if(_0x2f6fbe){return _0x2f6fbe[_0x7e38('0x27')]()[_0x7e38('0x26')](function(){_0x4b94e5[_0x7e38('0x1b')](0xcc)[_0x7e38('0x1a')]();});}};}function handleEntityNotFound(_0x4d5812,_0x1dbdda){return function(_0x25008c){if(!_0x25008c){_0x4d5812[_0x7e38('0x19')](0x194);}return _0x25008c;};}function handleError(_0x5c914d,_0x503389){_0x503389=_0x503389||0x1f4;return function(_0x5d8d75){logger[_0x7e38('0x28')](_0x5d8d75[_0x7e38('0x29')]);if(_0x5d8d75[_0x7e38('0x2a')]){delete _0x5d8d75[_0x7e38('0x2a')];}_0x5c914d[_0x7e38('0x1b')](_0x503389)[_0x7e38('0x2b')](_0x5d8d75);};}exports[_0x7e38('0x2c')]=function(_0x302d5e,_0x303561){var _0x32c6c4={},_0x53fc8d={},_0x22f05b={'count':0x0,'rows':[]};var _0x283cc3=_[_0x7e38('0x2d')](db[_0x7e38('0x2e')]['rawAttributes'],function(_0x4fd767){return{'name':_0x4fd767[_0x7e38('0x2f')],'type':_0x4fd767['type'][_0x7e38('0x30')]};});_0x53fc8d[_0x7e38('0x31')]=_[_0x7e38('0x2d')](_0x283cc3,_0x7e38('0x2a'));_0x53fc8d['query']=_[_0x7e38('0x32')](_0x302d5e['query']);_0x53fc8d['filters']=_[_0x7e38('0x33')](_0x53fc8d[_0x7e38('0x31')],_0x53fc8d['query']);_0x32c6c4['attributes']=_[_0x7e38('0x33')](_0x53fc8d[_0x7e38('0x31')],qs[_0x7e38('0x34')](_0x302d5e[_0x7e38('0x35')][_0x7e38('0x34')]));_0x32c6c4[_0x7e38('0x36')]=_0x32c6c4[_0x7e38('0x36')]['length']?_0x32c6c4[_0x7e38('0x36')]:_0x53fc8d[_0x7e38('0x31')];if(!_0x302d5e['query'][_0x7e38('0x37')](_0x7e38('0x38'))){_0x32c6c4[_0x7e38('0x1f')]=qs[_0x7e38('0x1f')](_0x302d5e[_0x7e38('0x35')][_0x7e38('0x1f')]);_0x32c6c4[_0x7e38('0x1d')]=qs[_0x7e38('0x1d')](_0x302d5e[_0x7e38('0x35')]['offset']);}_0x32c6c4[_0x7e38('0x39')]=qs['sort'](_0x302d5e[_0x7e38('0x35')][_0x7e38('0x3a')]);_0x32c6c4[_0x7e38('0x3b')]=qs['filters'](_[_0x7e38('0x3c')](_0x302d5e['query'],_0x53fc8d['filters']),_0x283cc3);if(_0x302d5e[_0x7e38('0x35')][_0x7e38('0x3d')]){_0x32c6c4[_0x7e38('0x3b')]=_[_0x7e38('0x3e')](_0x32c6c4['where'],{'$or':_[_0x7e38('0x2d')](_0x283cc3,function(_0x12caeb){if(_0x12caeb[_0x7e38('0x3f')]!==_0x7e38('0x40')){var _0x330696={};_0x330696[_0x12caeb[_0x7e38('0x2a')]]={'$like':'%'+_0x302d5e[_0x7e38('0x35')][_0x7e38('0x3d')]+'%'};return _0x330696;}})});}_0x32c6c4=_[_0x7e38('0x3e')]({},_0x32c6c4,_0x302d5e['options']);var _0x4e53cf={'where':_0x32c6c4[_0x7e38('0x3b')]};return db[_0x7e38('0x2e')]['count'](_0x4e53cf)[_0x7e38('0x26')](function(_0x1ad7ac){_0x22f05b[_0x7e38('0x20')]=_0x1ad7ac;if(_0x302d5e[_0x7e38('0x35')][_0x7e38('0x41')]){_0x32c6c4[_0x7e38('0x42')]=[{'all':!![]}];}return db[_0x7e38('0x2e')]['findAll'](_0x32c6c4);})[_0x7e38('0x26')](function(_0x238d60){_0x22f05b[_0x7e38('0x43')]=_0x238d60;return _0x22f05b;})[_0x7e38('0x26')](respondWithFilteredResult(_0x303561,_0x32c6c4))[_0x7e38('0x44')](handleError(_0x303561,null));};exports['show']=function(_0x374fef,_0x7417c2){var _0x44e1d3={'raw':![],'where':{'id':_0x374fef['params']['id']}},_0x31189c={};_0x31189c['model']=_[_0x7e38('0x32')](db[_0x7e38('0x2e')][_0x7e38('0x45')]);_0x31189c['query']=_[_0x7e38('0x32')](_0x374fef[_0x7e38('0x35')]);_0x31189c[_0x7e38('0x46')]=_['intersection'](_0x31189c[_0x7e38('0x31')],_0x31189c[_0x7e38('0x35')]);_0x44e1d3[_0x7e38('0x36')]=_[_0x7e38('0x33')](_0x31189c[_0x7e38('0x31')],qs[_0x7e38('0x34')](_0x374fef[_0x7e38('0x35')][_0x7e38('0x34')]));_0x44e1d3[_0x7e38('0x36')]=_0x44e1d3[_0x7e38('0x36')][_0x7e38('0x47')]?_0x44e1d3[_0x7e38('0x36')]:_0x31189c[_0x7e38('0x31')];if(_0x374fef[_0x7e38('0x35')][_0x7e38('0x41')]){_0x44e1d3['include']=[{'all':!![]}];}_0x44e1d3=_[_0x7e38('0x3e')]({},_0x44e1d3,_0x374fef[_0x7e38('0x48')]);return db['AnalyticFieldReport'][_0x7e38('0x49')](_0x44e1d3)[_0x7e38('0x26')](handleEntityNotFound(_0x7417c2,null))[_0x7e38('0x26')](respondWithResult(_0x7417c2,null))[_0x7e38('0x44')](handleError(_0x7417c2,null));};exports[_0x7e38('0x4a')]=function(_0x3691c8,_0x556e86){return db[_0x7e38('0x2e')][_0x7e38('0x4a')](_0x3691c8['body'],{})[_0x7e38('0x26')](respondWithResult(_0x556e86,0xc9))['catch'](handleError(_0x556e86,null));};exports[_0x7e38('0x4b')]=function(_0x10466d,_0x587081){return db[_0x7e38('0x2e')][_0x7e38('0x4b')](_0x10466d['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x587081,0xc9))[_0x7e38('0x44')](handleError(_0x587081,null));};exports[_0x7e38('0x4c')]=function(_0x46bd24,_0x136af8){if(_0x46bd24[_0x7e38('0x4d')]['id']){delete _0x46bd24[_0x7e38('0x4d')]['id'];}return db[_0x7e38('0x2e')][_0x7e38('0x49')]({'where':{'id':_0x46bd24['params']['id']}})[_0x7e38('0x26')](handleEntityNotFound(_0x136af8,null))['then'](saveUpdates(_0x46bd24['body'],null))[_0x7e38('0x26')](respondWithResult(_0x136af8,null))['catch'](handleError(_0x136af8,null));};exports[_0x7e38('0x27')]=function(_0x2dc8e2,_0x29c8d6){return db[_0x7e38('0x2e')]['find']({'where':{'id':_0x2dc8e2[_0x7e38('0x4e')]['id']}})[_0x7e38('0x26')](handleEntityNotFound(_0x29c8d6,null))[_0x7e38('0x26')](removeEntity(_0x29c8d6,null))['catch'](handleError(_0x29c8d6,null));};exports[_0x7e38('0x4f')]=function(_0x28476f,_0x1d33da){return db['AnalyticFieldReport'][_0x7e38('0x27')]({'where':{'id':_0x28476f[_0x7e38('0x35')][_0x7e38('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1d33da,0xcc))[_0x7e38('0x44')](handleError(_0x1d33da,null));};exports[_0x7e38('0x51')]=function(_0x2bcffb,_0x3e47ec,_0x1150ac){return db[_0x7e38('0x52')]['findOne']({'where':{'id':_0x2bcffb[_0x7e38('0x4e')]['id']}})[_0x7e38('0x26')](handleEntityNotFound(_0x3e47ec,null))[_0x7e38('0x26')](function(_0x183977){if(_0x183977){return db['sequelize'][_0x7e38('0x53')](function(_0x12e41e){return db[_0x7e38('0x2e')][_0x7e38('0x27')]({'where':{'CustomReportId':_0x2bcffb[_0x7e38('0x4e')]['id']},'transaction':_0x12e41e})[_0x7e38('0x26')](function(_0x126190){var _0xfc652c=_['map'](_0x2bcffb[_0x7e38('0x4d')],function(_0x10c311){delete _0x10c311['id'];_0x10c311[_0x7e38('0x54')]=_0x2bcffb[_0x7e38('0x4e')]['id'];return _0x10c311;});return db['AnalyticFieldReport'][_0x7e38('0x4b')](_0xfc652c,{'transaction':_0x12e41e});});})[_0x7e38('0x26')](function(){return db[_0x7e38('0x2e')][_0x7e38('0x55')]({'where':{'CustomReportId':_0x2bcffb['params']['id']}});});}})[_0x7e38('0x26')](respondWithResult(_0x3e47ec,null))[_0x7e38('0x44')](handleError(_0x3e47ec,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3917ac2..cef031b 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 _0x5144=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x56b030,_0x16defc){var _0x3fecc0=function(_0x3cbef9){while(--_0x3cbef9){_0x56b030['push'](_0x56b030['shift']());}};_0x3fecc0(++_0x16defc);}(_0x5144,0x1d4));var _0x4514=function(_0x54d561,_0x18b976){_0x54d561=_0x54d561-0x0;var _0x508f1e=_0x5144[_0x54d561];return _0x508f1e;};'use strict';var _=require(_0x4514('0x0'));var util=require(_0x4514('0x1'));var logger=require(_0x4514('0x2'))('api');var moment=require(_0x4514('0x3'));var BPromise=require(_0x4514('0x4'));var rp=require(_0x4514('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4514('0x6'));var config=require(_0x4514('0x7'));var attributes=require(_0x4514('0x8'));module[_0x4514('0x9')]=function(_0x3ef01d,_0x403405){return _0x3ef01d[_0x4514('0xa')](_0x4514('0xb'),attributes,{'tableName':_0x4514('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10d5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x10d5,0xc2));var _0x510d=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x10d5[_0xa8883];return _0x479426;};'use strict';var _=require(_0x510d('0x0'));var util=require(_0x510d('0x1'));var logger=require(_0x510d('0x2'))(_0x510d('0x3'));var moment=require(_0x510d('0x4'));var BPromise=require(_0x510d('0x5'));var rp=require(_0x510d('0x6'));var fs=require('fs');var path=require(_0x510d('0x7'));var rimraf=require(_0x510d('0x8'));var config=require(_0x510d('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0x510d('0xa')]=function(_0x476086,_0x56bb97){return _0x476086[_0x510d('0xb')](_0x510d('0xc'),attributes,{'tableName':_0x510d('0xd'),'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 c427e0e..c7a27db 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 _0xa3eb=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa3eb,0x14f));var _0xba3e=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xa3eb[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var moment=require('moment');var BPromise=require(_0xba3e('0x2'));var rs=require(_0xba3e('0x3'));var fs=require('fs');var Redis=require(_0xba3e('0x4'));var db=require(_0xba3e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba3e('0x6'))(_0xba3e('0x7'));var config=require(_0xba3e('0x8'));var jayson=require(_0xba3e('0x9'));var client=jayson[_0xba3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15b0dc,_0x30a64b,_0x17b564){return new BPromise(function(_0x50944f,_0x1ef043){return client[_0xba3e('0xb')](_0x15b0dc,_0x17b564)[_0xba3e('0xc')](function(_0x90aa8a){logger['info'](_0xba3e('0xd'),_0x30a64b,_0xba3e('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x30a64b,'request\x20sent',JSON[_0xba3e('0xf')](_0x90aa8a));if(_0x90aa8a[_0xba3e('0x10')]){if(_0x90aa8a[_0xba3e('0x10')][_0xba3e('0x11')]===0x1f4){logger['error'](_0xba3e('0xd'),_0x30a64b,_0x90aa8a[_0xba3e('0x10')][_0xba3e('0x12')]);return _0x1ef043(_0x90aa8a[_0xba3e('0x10')]['message']);}logger[_0xba3e('0x10')](_0xba3e('0xd'),_0x30a64b,_0x90aa8a[_0xba3e('0x10')]['message']);return _0x50944f(_0x90aa8a[_0xba3e('0x10')][_0xba3e('0x12')]);}else{logger['info'](_0xba3e('0xd'),_0x30a64b,_0xba3e('0xe'));_0x50944f(_0x90aa8a[_0xba3e('0x13')]['message']);}})[_0xba3e('0x14')](function(_0xd422e){logger['error'](_0xba3e('0xd'),_0x30a64b,_0xd422e);_0x1ef043(_0xd422e);});});} \ No newline at end of file +var _0xce27=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x4bc591,_0x51c82a){var _0x7e5129=function(_0xda5f10){while(--_0xda5f10){_0x4bc591['push'](_0x4bc591['shift']());}};_0x7e5129(++_0x51c82a);}(_0xce27,0x13b));var _0x7ce2=function(_0x11d19a,_0x2f075c){_0x11d19a=_0x11d19a-0x0;var _0xb8b113=_0xce27[_0x11d19a];return _0xb8b113;};'use strict';var _=require(_0x7ce2('0x0'));var util=require(_0x7ce2('0x1'));var moment=require('moment');var BPromise=require(_0x7ce2('0x2'));var rs=require(_0x7ce2('0x3'));var fs=require('fs');var Redis=require(_0x7ce2('0x4'));var db=require(_0x7ce2('0x5'))['db'];var utils=require(_0x7ce2('0x6'));var logger=require('../../config/logger')(_0x7ce2('0x7'));var config=require(_0x7ce2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7ce2('0x9')][_0x7ce2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dcc01,_0x3b1eaa,_0x3bb23a){return new BPromise(function(_0x1400c1,_0xc8f0a1){return client['request'](_0x3dcc01,_0x3bb23a)['then'](function(_0x3f1b08){logger['info'](_0x7ce2('0xb'),_0x3b1eaa,_0x7ce2('0xc'));logger[_0x7ce2('0xd')](_0x7ce2('0xe'),_0x3b1eaa,_0x7ce2('0xc'),JSON[_0x7ce2('0xf')](_0x3f1b08));if(_0x3f1b08[_0x7ce2('0x10')]){if(_0x3f1b08[_0x7ce2('0x10')][_0x7ce2('0x11')]===0x1f4){logger[_0x7ce2('0x10')](_0x7ce2('0xb'),_0x3b1eaa,_0x3f1b08['error'][_0x7ce2('0x12')]);return _0xc8f0a1(_0x3f1b08['error'][_0x7ce2('0x12')]);}logger[_0x7ce2('0x10')](_0x7ce2('0xb'),_0x3b1eaa,_0x3f1b08[_0x7ce2('0x10')][_0x7ce2('0x12')]);return _0x1400c1(_0x3f1b08[_0x7ce2('0x10')][_0x7ce2('0x12')]);}else{logger[_0x7ce2('0x13')](_0x7ce2('0xb'),_0x3b1eaa,_0x7ce2('0xc'));_0x1400c1(_0x3f1b08['result'][_0x7ce2('0x12')]);}})[_0x7ce2('0x14')](function(_0x3c552b){logger[_0x7ce2('0x10')](_0x7ce2('0xb'),_0x3b1eaa,_0x3c552b);_0xc8f0a1(_0x3c552b);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ef74b39..60160c3 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(_0x55281e,_0x5d57c4){var _0x139bd6=function(_0x2684ee){while(--_0x2684ee){_0x55281e['push'](_0x55281e['shift']());}};_0x139bd6(++_0x5d57c4);}(_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'));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(_0x4375aa,_0x166edf){var _0x120fdf=function(_0x366807){while(--_0x366807){_0x4375aa['push'](_0x4375aa['shift']());}};_0x120fdf(++_0x166edf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 2d4f215..937500a 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 _0xac7f=['STRING','name','sequelize'];(function(_0x100358,_0x1388d4){var _0x22e1d0=function(_0x14bf53){while(--_0x14bf53){_0x100358['push'](_0x100358['shift']());}};_0x22e1d0(++_0x1388d4);}(_0xac7f,0x1e2));var _0xfac7=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xac7f[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0xfac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xfac7('0x1')],'allowNull':![],'unique':_0xfac7('0x2')},'table':{'type':Sequelize[_0xfac7('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xfac7('0x1')]}}; \ No newline at end of file +var _0x56bd=['TEXT','exports','STRING','name'];(function(_0x4fcd26,_0x38243d){var _0x4076c6=function(_0x18958f){while(--_0x18958f){_0x4fcd26['push'](_0x4fcd26['shift']());}};_0x4076c6(++_0x38243d);}(_0x56bd,0xe9));var _0xd56b=function(_0x3462f4,_0x151dc1){_0x3462f4=_0x3462f4-0x0;var _0xe06930=_0x56bd[_0x3462f4];return _0xe06930;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'name':{'type':Sequelize[_0xd56b('0x1')],'allowNull':![],'unique':_0xd56b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd56b('0x3')]},'description':{'type':Sequelize[_0xd56b('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index db7f31a..6ff8f66 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 _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file +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(_0x5dc9f5,_0x5362c7){var _0x4faea5=function(_0x5e2d0d){while(--_0x5e2d0d){_0x5dc9f5['push'](_0x5dc9f5['shift']());}};_0x4faea5(++_0x5362c7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x140db8,_0x110d14){_0x140db8=_0x140db8-0x0;var _0x123ebf=_0x8d0e[_0x140db8];return _0x123ebf;};'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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d23991b..fd52989 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 _0x9b69=['../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x3bf3d5,_0x16a802){var _0x51dee1=function(_0x36b773){while(--_0x36b773){_0x3bf3d5['push'](_0x3bf3d5['shift']());}};_0x51dee1(++_0x16a802);}(_0x9b69,0xa3));var _0x99b6=function(_0x14f154,_0x327c57){_0x14f154=_0x14f154-0x0;var _0x3fd3c0=_0x9b69[_0x14f154];return _0x3fd3c0;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var logger=require(_0x99b6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x99b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99b6('0x4'));var rimraf=require(_0x99b6('0x5'));var config=require(_0x99b6('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x99b6('0x7')]=function(_0x5c4062,_0xbcd357){return _0x5c4062[_0x99b6('0x8')](_0x99b6('0x9'),attributes,{'tableName':_0x99b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cd0=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','moment','path','rimraf'];(function(_0x130c67,_0x5dcc79){var _0x4e06c7=function(_0x122ea9){while(--_0x122ea9){_0x130c67['push'](_0x130c67['shift']());}};_0x4e06c7(++_0x5dcc79);}(_0x2cd0,0x8a));var _0x02cd=function(_0x30638f,_0x33b6ec){_0x30638f=_0x30638f-0x0;var _0xed4d2=_0x2cd0[_0x30638f];return _0xed4d2;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x02cd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x02cd('0x3'));var rimraf=require(_0x02cd('0x4'));var config=require(_0x02cd('0x5'));var attributes=require(_0x02cd('0x6'));module[_0x02cd('0x7')]=function(_0x35144b,_0x222904){return _0x35144b[_0x02cd('0x8')](_0x02cd('0x9'),attributes,{'tableName':_0x02cd('0xa'),'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 ef4b4e6..0daced3 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 _0xb1cc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','lodash','util','moment'];(function(_0x1d6cc1,_0x3b9927){var _0x224ecb=function(_0x5d5c08){while(--_0x5d5c08){_0x1d6cc1['push'](_0x1d6cc1['shift']());}};_0x224ecb(++_0x3b9927);}(_0xb1cc,0x131));var _0xcb1c=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xb1cc[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xcb1c('0x0'));var util=require(_0xcb1c('0x1'));var moment=require(_0xcb1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb1c('0x3'));var fs=require('fs');var Redis=require(_0xcb1c('0x4'));var db=require(_0xcb1c('0x5'))['db'];var utils=require(_0xcb1c('0x6'));var logger=require(_0xcb1c('0x7'))(_0xcb1c('0x8'));var config=require(_0xcb1c('0x9'));var jayson=require(_0xcb1c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x541324,_0x382b65,_0x2bfc6a){return new BPromise(function(_0x259ae9,_0x444e5e){return client[_0xcb1c('0xb')](_0x541324,_0x2bfc6a)[_0xcb1c('0xc')](function(_0x3352a0){logger[_0xcb1c('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x382b65,_0xcb1c('0xe'));logger[_0xcb1c('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x382b65,_0xcb1c('0xe'),JSON[_0xcb1c('0x10')](_0x3352a0));if(_0x3352a0[_0xcb1c('0x11')]){if(_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x12')]===0x1f4){logger[_0xcb1c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x382b65,_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x13')]);return _0x444e5e(_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x13')]);}logger['error'](_0xcb1c('0x14'),_0x382b65,_0x3352a0[_0xcb1c('0x11')]['message']);return _0x259ae9(_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x382b65,_0xcb1c('0xe'));_0x259ae9(_0x3352a0[_0xcb1c('0x15')][_0xcb1c('0x13')]);}})['catch'](function(_0xcd595e){logger[_0xcb1c('0x11')](_0xcb1c('0x14'),_0x382b65,_0xcd595e);_0x444e5e(_0xcd595e);});});} \ No newline at end of file +var _0x13f8=['code','message','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x94dd49,_0x2661bc){var _0x44571f=function(_0x397528){while(--_0x397528){_0x94dd49['push'](_0x94dd49['shift']());}};_0x44571f(++_0x2661bc);}(_0x13f8,0x66));var _0x813f=function(_0x4c566d,_0x3c7b50){_0x4c566d=_0x4c566d-0x0;var _0x4b5f8d=_0x13f8[_0x4c566d];return _0x4b5f8d;};'use strict';var _=require(_0x813f('0x0'));var util=require('util');var moment=require(_0x813f('0x1'));var BPromise=require('bluebird');var rs=require(_0x813f('0x2'));var fs=require('fs');var Redis=require(_0x813f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x813f('0x4'))(_0x813f('0x5'));var config=require('../../config/environment');var jayson=require(_0x813f('0x6'));var client=jayson[_0x813f('0x7')][_0x813f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ed54f,_0x401242,_0x2ca373){return new BPromise(function(_0x75b783,_0x1270fa){return client[_0x813f('0x9')](_0x2ed54f,_0x2ca373)[_0x813f('0xa')](function(_0x53d1e1){logger[_0x813f('0xb')](_0x813f('0xc'),_0x401242,_0x813f('0xd'));logger[_0x813f('0xe')](_0x813f('0xf'),_0x401242,_0x813f('0xd'),JSON[_0x813f('0x10')](_0x53d1e1));if(_0x53d1e1[_0x813f('0x11')]){if(_0x53d1e1[_0x813f('0x11')][_0x813f('0x12')]===0x1f4){logger[_0x813f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x401242,_0x53d1e1[_0x813f('0x11')][_0x813f('0x13')]);return _0x1270fa(_0x53d1e1[_0x813f('0x11')][_0x813f('0x13')]);}logger[_0x813f('0x11')](_0x813f('0xc'),_0x401242,_0x53d1e1['error'][_0x813f('0x13')]);return _0x75b783(_0x53d1e1[_0x813f('0x11')][_0x813f('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x401242,'request\x20sent');_0x75b783(_0x53d1e1['result'][_0x813f('0x13')]);}})['catch'](function(_0x19c9ca){logger[_0x813f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x401242,_0x19c9ca);_0x1270fa(_0x19c9ca);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8796683..7a77c73 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 _0x00e0=['put','update','delete','multer','util','path','express','fs-extra','get','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e0,0x1e3));var _0x000e=function(_0x5ac43a,_0x3d47d3){_0x5ac43a=_0x5ac43a-0x0;var _0x55530e=_0x00e0[_0x5ac43a];return _0x55530e;};'use strict';var multer=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var path=require(_0x000e('0x2'));var timeout=require('connect-timeout');var express=require(_0x000e('0x3'));var router=express['Router']();var fs_extra=require(_0x000e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x000e('0x5')]('/',auth[_0x000e('0x6')](),controller['index']);router[_0x000e('0x5')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0x8')]);router['post']('/',auth[_0x000e('0x6')](),controller['create']);router[_0x000e('0x9')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0xa')]);router[_0x000e('0xb')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x63b6=['get','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x273a8b,_0x2c8482){var _0x3264c0=function(_0x3ae50e){while(--_0x3ae50e){_0x273a8b['push'](_0x273a8b['shift']());}};_0x3264c0(++_0x2c8482);}(_0x63b6,0x127));var _0x663b=function(_0x9b24a5,_0x47c37a){_0x9b24a5=_0x9b24a5-0x0;var _0x3f4434=_0x63b6[_0x9b24a5];return _0x3f4434;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require(_0x663b('0x2'));var timeout=require('connect-timeout');var express=require(_0x663b('0x3'));var router=express['Router']();var fs_extra=require(_0x663b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var controller=require(_0x663b('0x7'));router['get']('/',auth[_0x663b('0x8')](),controller['index']);router[_0x663b('0x9')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xa')]);router[_0x663b('0xb')]('/',auth[_0x663b('0x8')](),controller[_0x663b('0xc')]);router[_0x663b('0xd')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xe')]);router[_0x663b('0xf')](_0x663b('0x10'),auth[_0x663b('0x8')](),controller[_0x663b('0x11')]);module[_0x663b('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a16c571..265243d 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 _0x783c=['TEXT','sequelize','exports'];(function(_0x50d027,_0x1845f6){var _0x39172d=function(_0x11a428){while(--_0x11a428){_0x50d027['push'](_0x50d027['shift']());}};_0x39172d(++_0x1845f6);}(_0x783c,0x94));var _0xc783=function(_0x56260c,_0x203125){_0x56260c=_0x56260c-0x0;var _0x5e36ce=_0x783c[_0x56260c];return _0x5e36ce;};'use strict';var Sequelize=require(_0xc783('0x0'));module[_0xc783('0x1')]={'tree':{'type':Sequelize[_0xc783('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe102=['sequelize','exports'];(function(_0x18a4eb,_0x1a6f5c){var _0x4ca102=function(_0x15b047){while(--_0x15b047){_0x18a4eb['push'](_0x18a4eb['shift']());}};_0x4ca102(++_0x1a6f5c);}(_0xe102,0x156));var _0x2e10=function(_0x1079cf,_0x2014d8){_0x1079cf=_0x1079cf-0x0;var _0x564336=_0xe102[_0x1079cf];return _0x564336;};'use strict';var Sequelize=require(_0x2e10('0x0'));module[_0x2e10('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 97695c4..35ac325 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 _0x6a1e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x369ee0,_0x57a15c){var _0x493a06=function(_0x570aaf){while(--_0x570aaf){_0x369ee0['push'](_0x369ee0['shift']());}};_0x493a06(++_0x57a15c);}(_0x6a1e,0x124));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe6a1('0x0'));var rimraf=require(_0xe6a1('0x1'));var zipdir=require(_0xe6a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6a1('0x3'));var moment=require(_0xe6a1('0x4'));var BPromise=require(_0xe6a1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe6a1('0x6'));var sox=require(_0xe6a1('0x7'));var csv=require(_0xe6a1('0x8'));var ejs=require(_0xe6a1('0x9'));var fs=require('fs');var fs_extra=require(_0xe6a1('0xa'));var _=require(_0xe6a1('0xb'));var squel=require(_0xe6a1('0xc'));var crypto=require(_0xe6a1('0xd'));var jsforce=require(_0xe6a1('0xe'));var deskjs=require(_0xe6a1('0xf'));var toCsv=require(_0xe6a1('0x8'));var querystring=require(_0xe6a1('0x10'));var Papa=require(_0xe6a1('0x11'));var Redis=require(_0xe6a1('0x12'));var authService=require(_0xe6a1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe6a1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6a1('0x15'))('api');var utils=require(_0xe6a1('0x16'));var config=require(_0xe6a1('0x17'));var licenseUtil=require(_0xe6a1('0x18'));var db=require(_0xe6a1('0x19'))['db'];function respondWithStatusCode(_0x341081,_0x2a7d98){_0x2a7d98=_0x2a7d98||0xcc;return function(_0x7ec6bf){if(_0x7ec6bf){return _0x341081[_0xe6a1('0x1a')](_0x2a7d98);}return _0x341081[_0xe6a1('0x1b')](_0x2a7d98)['end']();};}function respondWithResult(_0x19b941,_0x3b838d){_0x3b838d=_0x3b838d||0xc8;return function(_0x5dc1ad){if(_0x5dc1ad){return _0x19b941['status'](_0x3b838d)[_0xe6a1('0x1c')](_0x5dc1ad);}};}function respondWithFilteredResult(_0x175c74,_0x1c3468){return function(_0x1977f5){if(_0x1977f5){var _0x49d127=typeof _0x1c3468[_0xe6a1('0x1d')]==='undefined'&&typeof _0x1c3468['limit']===_0xe6a1('0x1e');var _0x53d41b=_0x1977f5[_0xe6a1('0x1f')];var _0x612f4d=_0x49d127?0x0:_0x1c3468[_0xe6a1('0x1d')];var _0x2deebb=_0x49d127?_0x1977f5[_0xe6a1('0x1f')]:_0x1c3468[_0xe6a1('0x1d')]+_0x1c3468['limit'];var _0x1e0c4c;if(_0x2deebb>=_0x53d41b){_0x2deebb=_0x53d41b;_0x1e0c4c=0xc8;}else{_0x1e0c4c=0xce;}_0x175c74[_0xe6a1('0x1b')](_0x1e0c4c);return _0x175c74[_0xe6a1('0x20')](_0xe6a1('0x21'),_0x612f4d+'-'+_0x2deebb+'/'+_0x53d41b)[_0xe6a1('0x1c')](_0x1977f5);}return null;};}function patchUpdates(_0x2df25a){return function(_0x55f538){try{jsonpatch[_0xe6a1('0x22')](_0x55f538,_0x2df25a,!![]);}catch(_0x30ba1d){return BPromise['reject'](_0x30ba1d);}return _0x55f538['save']();};}function saveUpdates(_0x58ec46,_0x3b6081){return function(_0x2d2acf){if(_0x2d2acf){return _0x2d2acf[_0xe6a1('0x23')](_0x58ec46)[_0xe6a1('0x24')](function(_0x5b2198){return _0x5b2198;});}return null;};}function removeEntity(_0x5d3754,_0x282e0b){return function(_0x57b7aa){if(_0x57b7aa){return _0x57b7aa[_0xe6a1('0x25')]()[_0xe6a1('0x24')](function(){_0x5d3754[_0xe6a1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6058,_0xc047a8){return function(_0xe20304){if(!_0xe20304){_0x2f6058[_0xe6a1('0x1a')](0x194);}return _0xe20304;};}function handleError(_0x392c93,_0x28cee5){_0x28cee5=_0x28cee5||0x1f4;return function(_0x463515){logger[_0xe6a1('0x26')](_0x463515['stack']);if(_0x463515['name']){delete _0x463515['name'];}_0x392c93[_0xe6a1('0x1b')](_0x28cee5)[_0xe6a1('0x27')](_0x463515);};}exports[_0xe6a1('0x28')]=function(_0x321e9b,_0x2132f4){var _0x4468c7={},_0x1d74e1={},_0x182cc8={'count':0x0,'rows':[]};var _0x452536=_['map'](db[_0xe6a1('0x29')][_0xe6a1('0x2a')],function(_0x21f434){return{'name':_0x21f434[_0xe6a1('0x2b')],'type':_0x21f434[_0xe6a1('0x2c')][_0xe6a1('0x2d')]};});_0x1d74e1[_0xe6a1('0x2e')]=_[_0xe6a1('0x2f')](_0x452536,_0xe6a1('0x30'));_0x1d74e1['query']=_[_0xe6a1('0x31')](_0x321e9b[_0xe6a1('0x32')]);_0x1d74e1[_0xe6a1('0x33')]=_[_0xe6a1('0x34')](_0x1d74e1['model'],_0x1d74e1['query']);_0x4468c7[_0xe6a1('0x35')]=_[_0xe6a1('0x34')](_0x1d74e1['model'],qs[_0xe6a1('0x36')](_0x321e9b[_0xe6a1('0x32')][_0xe6a1('0x36')]));_0x4468c7[_0xe6a1('0x35')]=_0x4468c7[_0xe6a1('0x35')][_0xe6a1('0x37')]?_0x4468c7[_0xe6a1('0x35')]:_0x1d74e1['model'];if(!_0x321e9b['query'][_0xe6a1('0x38')](_0xe6a1('0x39'))){_0x4468c7['limit']=qs['limit'](_0x321e9b[_0xe6a1('0x32')][_0xe6a1('0x3a')]);_0x4468c7['offset']=qs[_0xe6a1('0x1d')](_0x321e9b[_0xe6a1('0x32')][_0xe6a1('0x1d')]);}_0x4468c7[_0xe6a1('0x3b')]=qs[_0xe6a1('0x3c')](_0x321e9b['query']['sort']);_0x4468c7[_0xe6a1('0x3d')]=qs[_0xe6a1('0x33')](_['pick'](_0x321e9b[_0xe6a1('0x32')],_0x1d74e1[_0xe6a1('0x33')]),_0x452536);if(_0x321e9b['query'][_0xe6a1('0x3e')]){_0x4468c7[_0xe6a1('0x3d')]=_[_0xe6a1('0x3f')](_0x4468c7[_0xe6a1('0x3d')],{'$or':_[_0xe6a1('0x2f')](_0x452536,function(_0x43972e){if(_0x43972e[_0xe6a1('0x2c')]!==_0xe6a1('0x40')){var _0x6109f6={};_0x6109f6[_0x43972e[_0xe6a1('0x30')]]={'$like':'%'+_0x321e9b[_0xe6a1('0x32')]['filter']+'%'};return _0x6109f6;}})});}_0x4468c7=_[_0xe6a1('0x3f')]({},_0x4468c7,_0x321e9b[_0xe6a1('0x41')]);var _0x12279a={'where':_0x4468c7[_0xe6a1('0x3d')]};return db['AnalyticTreeReport'][_0xe6a1('0x1f')](_0x12279a)[_0xe6a1('0x24')](function(_0x3bd511){_0x182cc8[_0xe6a1('0x1f')]=_0x3bd511;if(_0x321e9b['query'][_0xe6a1('0x42')]){_0x4468c7[_0xe6a1('0x43')]=[{'all':!![]}];}return db[_0xe6a1('0x29')][_0xe6a1('0x44')](_0x4468c7);})[_0xe6a1('0x24')](function(_0x247502){_0x182cc8[_0xe6a1('0x45')]=_0x247502;return _0x182cc8;})[_0xe6a1('0x24')](respondWithFilteredResult(_0x2132f4,_0x4468c7))['catch'](handleError(_0x2132f4,null));};exports[_0xe6a1('0x46')]=function(_0x6b9409,_0x1d45af){var _0x3cb72d={'raw':!![],'where':{'id':_0x6b9409[_0xe6a1('0x47')]['id']}},_0x25eb10={};_0x25eb10[_0xe6a1('0x2e')]=_[_0xe6a1('0x31')](db['AnalyticTreeReport'][_0xe6a1('0x2a')]);_0x25eb10[_0xe6a1('0x32')]=_[_0xe6a1('0x31')](_0x6b9409['query']);_0x25eb10[_0xe6a1('0x33')]=_[_0xe6a1('0x34')](_0x25eb10[_0xe6a1('0x2e')],_0x25eb10[_0xe6a1('0x32')]);_0x3cb72d[_0xe6a1('0x35')]=_['intersection'](_0x25eb10[_0xe6a1('0x2e')],qs[_0xe6a1('0x36')](_0x6b9409['query'][_0xe6a1('0x36')]));_0x3cb72d[_0xe6a1('0x35')]=_0x3cb72d['attributes'][_0xe6a1('0x37')]?_0x3cb72d['attributes']:_0x25eb10[_0xe6a1('0x2e')];if(_0x6b9409[_0xe6a1('0x32')][_0xe6a1('0x42')]){_0x3cb72d[_0xe6a1('0x43')]=[{'all':!![]}];}_0x3cb72d=_[_0xe6a1('0x3f')]({},_0x3cb72d,_0x6b9409[_0xe6a1('0x41')]);return db[_0xe6a1('0x29')]['find'](_0x3cb72d)[_0xe6a1('0x24')](handleEntityNotFound(_0x1d45af,null))['then'](respondWithResult(_0x1d45af,null))['catch'](handleError(_0x1d45af,null));};exports[_0xe6a1('0x48')]=function(_0x5a27d4,_0x41f8ac){return db[_0xe6a1('0x29')]['create'](_0x5a27d4[_0xe6a1('0x49')],{})[_0xe6a1('0x24')](respondWithResult(_0x41f8ac,0xc9))[_0xe6a1('0x4a')](handleError(_0x41f8ac,null));};exports[_0xe6a1('0x23')]=function(_0x61f24a,_0x14139c){if(_0x61f24a[_0xe6a1('0x49')]['id']){delete _0x61f24a[_0xe6a1('0x49')]['id'];}return db[_0xe6a1('0x29')][_0xe6a1('0x4b')]({'where':{'id':_0x61f24a['params']['id']}})[_0xe6a1('0x24')](handleEntityNotFound(_0x14139c,null))[_0xe6a1('0x24')](saveUpdates(_0x61f24a[_0xe6a1('0x49')],null))[_0xe6a1('0x24')](respondWithResult(_0x14139c,null))[_0xe6a1('0x4a')](handleError(_0x14139c,null));};exports[_0xe6a1('0x25')]=function(_0x3bce91,_0x305a4e){return db[_0xe6a1('0x29')]['find']({'where':{'id':_0x3bce91[_0xe6a1('0x47')]['id']}})[_0xe6a1('0x24')](handleEntityNotFound(_0x305a4e,null))[_0xe6a1('0x24')](removeEntity(_0x305a4e,null))[_0xe6a1('0x4a')](handleError(_0x305a4e,null));}; \ No newline at end of file +var _0x09b5=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3b0215,_0x5463b3){var _0x135ffa=function(_0x191ee9){while(--_0x191ee9){_0x3b0215['push'](_0x3b0215['shift']());}};_0x135ffa(++_0x5463b3);}(_0x09b5,0x1bc));var _0x509b=function(_0x21a4d4,_0x2f8fe4){_0x21a4d4=_0x21a4d4-0x0;var _0x107024=_0x09b5[_0x21a4d4];return _0x107024;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x509b('0x0'));var zipdir=require(_0x509b('0x1'));var jsonpatch=require(_0x509b('0x2'));var rp=require(_0x509b('0x3'));var moment=require(_0x509b('0x4'));var BPromise=require(_0x509b('0x5'));var Mustache=require(_0x509b('0x6'));var util=require(_0x509b('0x7'));var path=require(_0x509b('0x8'));var sox=require('sox');var csv=require(_0x509b('0x9'));var ejs=require(_0x509b('0xa'));var fs=require('fs');var fs_extra=require(_0x509b('0xb'));var _=require(_0x509b('0xc'));var squel=require(_0x509b('0xd'));var crypto=require(_0x509b('0xe'));var jsforce=require(_0x509b('0xf'));var deskjs=require(_0x509b('0x10'));var toCsv=require(_0x509b('0x9'));var querystring=require(_0x509b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x509b('0x12'));var qs=require(_0x509b('0x13'));var as=require(_0x509b('0x14'));var hardwareService=require(_0x509b('0x15'));var logger=require(_0x509b('0x16'))(_0x509b('0x17'));var utils=require(_0x509b('0x18'));var config=require(_0x509b('0x19'));var licenseUtil=require(_0x509b('0x1a'));var db=require(_0x509b('0x1b'))['db'];function respondWithStatusCode(_0x3ca961,_0x3281ac){_0x3281ac=_0x3281ac||0xcc;return function(_0x5615a4){if(_0x5615a4){return _0x3ca961[_0x509b('0x1c')](_0x3281ac);}return _0x3ca961[_0x509b('0x1d')](_0x3281ac)[_0x509b('0x1e')]();};}function respondWithResult(_0x141fba,_0x101235){_0x101235=_0x101235||0xc8;return function(_0x5e4060){if(_0x5e4060){return _0x141fba['status'](_0x101235)[_0x509b('0x1f')](_0x5e4060);}};}function respondWithFilteredResult(_0x492609,_0x39fe7a){return function(_0x73d3e4){if(_0x73d3e4){var _0x518bed=typeof _0x39fe7a[_0x509b('0x20')]===_0x509b('0x21')&&typeof _0x39fe7a[_0x509b('0x22')]===_0x509b('0x21');var _0x37cb56=_0x73d3e4['count'];var _0x3cf067=_0x518bed?0x0:_0x39fe7a['offset'];var _0x5c6269=_0x518bed?_0x73d3e4[_0x509b('0x23')]:_0x39fe7a[_0x509b('0x20')]+_0x39fe7a[_0x509b('0x22')];var _0x111400;if(_0x5c6269>=_0x37cb56){_0x5c6269=_0x37cb56;_0x111400=0xc8;}else{_0x111400=0xce;}_0x492609[_0x509b('0x1d')](_0x111400);return _0x492609[_0x509b('0x24')](_0x509b('0x25'),_0x3cf067+'-'+_0x5c6269+'/'+_0x37cb56)[_0x509b('0x1f')](_0x73d3e4);}return null;};}function patchUpdates(_0x2cafa7){return function(_0x5bf251){try{jsonpatch['apply'](_0x5bf251,_0x2cafa7,!![]);}catch(_0xd544c2){return BPromise[_0x509b('0x26')](_0xd544c2);}return _0x5bf251[_0x509b('0x27')]();};}function saveUpdates(_0x41b351,_0x3a7b05){return function(_0x3feca9){if(_0x3feca9){return _0x3feca9['update'](_0x41b351)[_0x509b('0x28')](function(_0x2613a9){return _0x2613a9;});}return null;};}function removeEntity(_0x237a79,_0x7db210){return function(_0x4817d8){if(_0x4817d8){return _0x4817d8[_0x509b('0x29')]()[_0x509b('0x28')](function(){_0x237a79[_0x509b('0x1d')](0xcc)[_0x509b('0x1e')]();});}};}function handleEntityNotFound(_0x244d03,_0x4e567f){return function(_0x1200f0){if(!_0x1200f0){_0x244d03[_0x509b('0x1c')](0x194);}return _0x1200f0;};}function handleError(_0xaea86c,_0x541575){_0x541575=_0x541575||0x1f4;return function(_0x2d2a78){logger[_0x509b('0x2a')](_0x2d2a78['stack']);if(_0x2d2a78[_0x509b('0x2b')]){delete _0x2d2a78[_0x509b('0x2b')];}_0xaea86c[_0x509b('0x1d')](_0x541575)[_0x509b('0x2c')](_0x2d2a78);};}exports[_0x509b('0x2d')]=function(_0x155fc7,_0x255a6a){var _0x137767={},_0x5547b9={},_0x5712ad={'count':0x0,'rows':[]};var _0x47d7fb=_[_0x509b('0x2e')](db[_0x509b('0x2f')][_0x509b('0x30')],function(_0x2aecf5){return{'name':_0x2aecf5[_0x509b('0x31')],'type':_0x2aecf5['type'][_0x509b('0x32')]};});_0x5547b9[_0x509b('0x33')]=_[_0x509b('0x2e')](_0x47d7fb,_0x509b('0x2b'));_0x5547b9[_0x509b('0x34')]=_[_0x509b('0x35')](_0x155fc7['query']);_0x5547b9[_0x509b('0x36')]=_[_0x509b('0x37')](_0x5547b9[_0x509b('0x33')],_0x5547b9['query']);_0x137767[_0x509b('0x38')]=_[_0x509b('0x37')](_0x5547b9[_0x509b('0x33')],qs[_0x509b('0x39')](_0x155fc7[_0x509b('0x34')][_0x509b('0x39')]));_0x137767[_0x509b('0x38')]=_0x137767[_0x509b('0x38')][_0x509b('0x3a')]?_0x137767[_0x509b('0x38')]:_0x5547b9['model'];if(!_0x155fc7[_0x509b('0x34')][_0x509b('0x3b')](_0x509b('0x3c'))){_0x137767[_0x509b('0x22')]=qs[_0x509b('0x22')](_0x155fc7[_0x509b('0x34')]['limit']);_0x137767[_0x509b('0x20')]=qs[_0x509b('0x20')](_0x155fc7[_0x509b('0x34')][_0x509b('0x20')]);}_0x137767[_0x509b('0x3d')]=qs['sort'](_0x155fc7[_0x509b('0x34')][_0x509b('0x3e')]);_0x137767[_0x509b('0x3f')]=qs[_0x509b('0x36')](_[_0x509b('0x40')](_0x155fc7[_0x509b('0x34')],_0x5547b9[_0x509b('0x36')]),_0x47d7fb);if(_0x155fc7['query'][_0x509b('0x41')]){_0x137767[_0x509b('0x3f')]=_[_0x509b('0x42')](_0x137767[_0x509b('0x3f')],{'$or':_['map'](_0x47d7fb,function(_0xa33fdc){if(_0xa33fdc['type']!==_0x509b('0x43')){var _0x329542={};_0x329542[_0xa33fdc[_0x509b('0x2b')]]={'$like':'%'+_0x155fc7['query'][_0x509b('0x41')]+'%'};return _0x329542;}})});}_0x137767=_[_0x509b('0x42')]({},_0x137767,_0x155fc7[_0x509b('0x44')]);var _0x487740={'where':_0x137767[_0x509b('0x3f')]};return db['AnalyticTreeReport']['count'](_0x487740)[_0x509b('0x28')](function(_0x176fd3){_0x5712ad[_0x509b('0x23')]=_0x176fd3;if(_0x155fc7['query']['includeAll']){_0x137767[_0x509b('0x45')]=[{'all':!![]}];}return db[_0x509b('0x2f')][_0x509b('0x46')](_0x137767);})[_0x509b('0x28')](function(_0x5d3591){_0x5712ad[_0x509b('0x47')]=_0x5d3591;return _0x5712ad;})['then'](respondWithFilteredResult(_0x255a6a,_0x137767))[_0x509b('0x48')](handleError(_0x255a6a,null));};exports['show']=function(_0x2c8646,_0x3a9b85){var _0x12ea33={'raw':!![],'where':{'id':_0x2c8646[_0x509b('0x49')]['id']}},_0x55d691={};_0x55d691[_0x509b('0x33')]=_[_0x509b('0x35')](db[_0x509b('0x2f')][_0x509b('0x30')]);_0x55d691[_0x509b('0x34')]=_[_0x509b('0x35')](_0x2c8646[_0x509b('0x34')]);_0x55d691[_0x509b('0x36')]=_['intersection'](_0x55d691[_0x509b('0x33')],_0x55d691[_0x509b('0x34')]);_0x12ea33[_0x509b('0x38')]=_[_0x509b('0x37')](_0x55d691[_0x509b('0x33')],qs[_0x509b('0x39')](_0x2c8646[_0x509b('0x34')][_0x509b('0x39')]));_0x12ea33[_0x509b('0x38')]=_0x12ea33[_0x509b('0x38')][_0x509b('0x3a')]?_0x12ea33['attributes']:_0x55d691[_0x509b('0x33')];if(_0x2c8646[_0x509b('0x34')]['includeAll']){_0x12ea33['include']=[{'all':!![]}];}_0x12ea33=_[_0x509b('0x42')]({},_0x12ea33,_0x2c8646[_0x509b('0x44')]);return db['AnalyticTreeReport']['find'](_0x12ea33)[_0x509b('0x28')](handleEntityNotFound(_0x3a9b85,null))[_0x509b('0x28')](respondWithResult(_0x3a9b85,null))[_0x509b('0x48')](handleError(_0x3a9b85,null));};exports[_0x509b('0x4a')]=function(_0x299f68,_0x8685){return db[_0x509b('0x2f')]['create'](_0x299f68[_0x509b('0x4b')],{})[_0x509b('0x28')](respondWithResult(_0x8685,0xc9))[_0x509b('0x48')](handleError(_0x8685,null));};exports[_0x509b('0x4c')]=function(_0x25a6b8,_0x418825){if(_0x25a6b8[_0x509b('0x4b')]['id']){delete _0x25a6b8[_0x509b('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x509b('0x4d')]({'where':{'id':_0x25a6b8['params']['id']}})[_0x509b('0x28')](handleEntityNotFound(_0x418825,null))[_0x509b('0x28')](saveUpdates(_0x25a6b8[_0x509b('0x4b')],null))[_0x509b('0x28')](respondWithResult(_0x418825,null))[_0x509b('0x48')](handleError(_0x418825,null));};exports[_0x509b('0x29')]=function(_0x2dfa94,_0x3b118f){return db['AnalyticTreeReport'][_0x509b('0x4d')]({'where':{'id':_0x2dfa94[_0x509b('0x49')]['id']}})[_0x509b('0x28')](handleEntityNotFound(_0x3b118f,null))['then'](removeEntity(_0x3b118f,null))[_0x509b('0x48')](handleError(_0x3b118f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 9daf013..31d8d8e 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 _0xfab1=['rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xfab1,0x157));var _0x1fab=function(_0x23dc09,_0x5ab018){_0x23dc09=_0x23dc09-0x0;var _0x2e81ea=_0xfab1[_0x23dc09];return _0x2e81ea;};'use strict';var _=require(_0x1fab('0x0'));var util=require(_0x1fab('0x1'));var logger=require(_0x1fab('0x2'))(_0x1fab('0x3'));var moment=require(_0x1fab('0x4'));var BPromise=require(_0x1fab('0x5'));var rp=require(_0x1fab('0x6'));var fs=require('fs');var path=require(_0x1fab('0x7'));var rimraf=require(_0x1fab('0x8'));var config=require(_0x1fab('0x9'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3ae582,_0x334da6){return _0x3ae582[_0x1fab('0xa')](_0x1fab('0xb'),attributes,{'tableName':_0x1fab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d88=['../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','api','bluebird','request-promise','path'];(function(_0x1e7e77,_0x15fa51){var _0x105fd1=function(_0x28a947){while(--_0x28a947){_0x1e7e77['push'](_0x1e7e77['shift']());}};_0x105fd1(++_0x15fa51);}(_0x3d88,0x91));var _0x83d8=function(_0x13d3c2,_0x5ca5d4){_0x13d3c2=_0x13d3c2-0x0;var _0x2883bb=_0x3d88[_0x13d3c2];return _0x2883bb;};'use strict';var _=require(_0x83d8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x83d8('0x1'));var moment=require('moment');var BPromise=require(_0x83d8('0x2'));var rp=require(_0x83d8('0x3'));var fs=require('fs');var path=require(_0x83d8('0x4'));var rimraf=require('rimraf');var config=require(_0x83d8('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x83d8('0x6')]=function(_0x5f22e7,_0x43c38f){return _0x5f22e7[_0x83d8('0x7')](_0x83d8('0x8'),attributes,{'tableName':_0x83d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index a10ba0a..452ccf3 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x79324e,_0x4af67e){var _0x555666=function(_0x15d9c2){while(--_0x15d9c2){_0x79324e['push'](_0x79324e['shift']());}};_0x555666(++_0x4af67e);}(_0xadb5,0xad));var _0x5adb=function(_0x5122aa,_0x165c78){_0x5122aa=_0x5122aa-0x0;var _0x9c27c7=_0xadb5[_0x5122aa];return _0x9c27c7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e48ef,_0xe216f9){_0x4e48ef=_0x4e48ef-0x0;var _0x580797=_0x7a54[_0x4e48ef];return _0x580797;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 0116f27..d2f78d3 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 _0xd736=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','update','delete'];(function(_0x195918,_0x1ade71){var _0x580e56=function(_0x368751){while(--_0x368751){_0x195918['push'](_0x195918['shift']());}};_0x580e56(++_0x1ade71);}(_0xd736,0x1ca));var _0x6d73=function(_0x332ec2,_0x1bbc56){_0x332ec2=_0x332ec2-0x0;var _0x289be8=_0xd736[_0x332ec2];return _0x289be8;};'use strict';var multer=require(_0x6d73('0x0'));var util=require(_0x6d73('0x1'));var path=require(_0x6d73('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d73('0x3'));var router=express[_0x6d73('0x4')]();var fs_extra=require(_0x6d73('0x5'));var auth=require(_0x6d73('0x6'));var interaction=require(_0x6d73('0x7'));var config=require(_0x6d73('0x8'));var controller=require(_0x6d73('0x9'));router[_0x6d73('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d73('0xb')]);router['get']('/:id',auth[_0x6d73('0xc')](),controller[_0x6d73('0xd')]);router[_0x6d73('0xe')]('/',auth[_0x6d73('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6d73('0xf')]);router[_0x6d73('0x10')]('/:id',auth[_0x6d73('0xc')](),controller[_0x6d73('0x11')]);module[_0x6d73('0x12')]=router; \ No newline at end of file +var _0x828c=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x828c,0x13f));var _0xc828=function(_0x29548c,_0x21279f){_0x29548c=_0x29548c-0x0;var _0x3f6b63=_0x828c[_0x29548c];return _0x3f6b63;};'use strict';var multer=require(_0xc828('0x0'));var util=require(_0xc828('0x1'));var path=require(_0xc828('0x2'));var timeout=require(_0xc828('0x3'));var express=require(_0xc828('0x4'));var router=express[_0xc828('0x5')]();var fs_extra=require(_0xc828('0x6'));var auth=require(_0xc828('0x7'));var interaction=require(_0xc828('0x8'));var config=require(_0xc828('0x9'));var controller=require(_0xc828('0xa'));router[_0xc828('0xb')]('/',auth[_0xc828('0xc')](),controller[_0xc828('0xd')]);router[_0xc828('0xb')](_0xc828('0xe'),auth[_0xc828('0xc')](),controller[_0xc828('0xf')]);router[_0xc828('0x10')]('/',auth[_0xc828('0xc')](),controller['create']);router[_0xc828('0x11')](_0xc828('0xe'),auth[_0xc828('0xc')](),controller[_0xc828('0x12')]);router['delete'](_0xc828('0xe'),auth[_0xc828('0xc')](),controller[_0xc828('0x13')]);module[_0xc828('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 6eea736..68ae5da 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 _0xa4ba=['STRING','exports'];(function(_0x16cb9b,_0x5f25a3){var _0xe2cfc=function(_0x5589e4){while(--_0x5589e4){_0x16cb9b['push'](_0x16cb9b['shift']());}};_0xe2cfc(++_0x5f25a3);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa4ba[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require('sequelize');module[_0xaa4b('0x0')]={'name':{'type':Sequelize[_0xaa4b('0x1')]},'basename':{'type':Sequelize[_0xaa4b('0x1')]},'type':{'type':Sequelize[_0xaa4b('0x1')]}}; \ No newline at end of file +var _0xb2b3=['exports','STRING','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb2b3,0x71));var _0x3b2b=function(_0x3a5394,_0x1e8e00){_0x3a5394=_0x3a5394-0x0;var _0x3f5227=_0xb2b3[_0x3a5394];return _0x3f5227;};'use strict';var Sequelize=require(_0x3b2b('0x0'));module[_0x3b2b('0x1')]={'name':{'type':Sequelize[_0x3b2b('0x2')]},'basename':{'type':Sequelize[_0x3b2b('0x2')]},'type':{'type':Sequelize[_0x3b2b('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 8d27ffe..b3ae1ec 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 _0x5075=['get','omit','updatedAt','body','createdAt','file','basename','filename','mimetype','create','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','Attachment','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','show','includeAll','options','find','params'];(function(_0x283a75,_0x3cd042){var _0x31b812=function(_0x1c509a){while(--_0x1c509a){_0x283a75['push'](_0x283a75['shift']());}};_0x31b812(++_0x3cd042);}(_0x5075,0x1c9));var _0x5507=function(_0x10b4b8,_0x450fea){_0x10b4b8=_0x10b4b8-0x0;var _0x424293=_0x5075[_0x10b4b8];return _0x424293;};'use strict';var emlformat=require(_0x5507('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5507('0x1'));var jsonpatch=require(_0x5507('0x2'));var rp=require('request-promise');var moment=require(_0x5507('0x3'));var BPromise=require(_0x5507('0x4'));var Mustache=require(_0x5507('0x5'));var util=require('util');var path=require(_0x5507('0x6'));var sox=require(_0x5507('0x7'));var csv=require(_0x5507('0x8'));var ejs=require(_0x5507('0x9'));var fs=require('fs');var fs_extra=require(_0x5507('0xa'));var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require(_0x5507('0x13'));var hardwareService=require(_0x5507('0x14'));var logger=require(_0x5507('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5507('0x16'));var db=require(_0x5507('0x17'))['db'];function respondWithStatusCode(_0x126393,_0x19efc1){_0x19efc1=_0x19efc1||0xcc;return function(_0x4957ed){if(_0x4957ed){return _0x126393[_0x5507('0x18')](_0x19efc1);}return _0x126393[_0x5507('0x19')](_0x19efc1)[_0x5507('0x1a')]();};}function respondWithResult(_0x457a5c,_0x113dad){_0x113dad=_0x113dad||0xc8;return function(_0x3a110b){if(_0x3a110b){return _0x457a5c[_0x5507('0x19')](_0x113dad)[_0x5507('0x1b')](_0x3a110b);}};}function respondWithFilteredResult(_0x816d2e,_0x4172ce){return function(_0x292ba2){if(_0x292ba2){var _0x49842d=typeof _0x4172ce['offset']===_0x5507('0x1c')&&typeof _0x4172ce[_0x5507('0x1d')]===_0x5507('0x1c');var _0x2e08b2=_0x292ba2[_0x5507('0x1e')];var _0x1e9399=_0x49842d?0x0:_0x4172ce['offset'];var _0x3497b9=_0x49842d?_0x292ba2[_0x5507('0x1e')]:_0x4172ce[_0x5507('0x1f')]+_0x4172ce[_0x5507('0x1d')];var _0x1a3817;if(_0x3497b9>=_0x2e08b2){_0x3497b9=_0x2e08b2;_0x1a3817=0xc8;}else{_0x1a3817=0xce;}_0x816d2e['status'](_0x1a3817);return _0x816d2e['set'](_0x5507('0x20'),_0x1e9399+'-'+_0x3497b9+'/'+_0x2e08b2)[_0x5507('0x1b')](_0x292ba2);}return null;};}function patchUpdates(_0x3f94b9){return function(_0x24610e){try{jsonpatch[_0x5507('0x21')](_0x24610e,_0x3f94b9,!![]);}catch(_0x6ff8b8){return BPromise[_0x5507('0x22')](_0x6ff8b8);}return _0x24610e[_0x5507('0x23')]();};}function saveUpdates(_0x346e6d,_0x84b6c7){return function(_0x57ea8f){if(_0x57ea8f){return _0x57ea8f[_0x5507('0x24')](_0x346e6d)[_0x5507('0x25')](function(_0x45c355){return _0x45c355;});}return null;};}function removeEntity(_0xfb1c1a,_0x24dbde){return function(_0x2d0f6e){if(_0x2d0f6e){return _0x2d0f6e[_0x5507('0x26')]()[_0x5507('0x25')](function(){_0xfb1c1a[_0x5507('0x19')](0xcc)[_0x5507('0x1a')]();});}};}function handleEntityNotFound(_0x698d29,_0x694eb9){return function(_0x4811cf){if(!_0x4811cf){_0x698d29['sendStatus'](0x194);}return _0x4811cf;};}function handleError(_0x1b0fef,_0x4c5906){_0x4c5906=_0x4c5906||0x1f4;return function(_0x3298ec){logger[_0x5507('0x27')](_0x3298ec['stack']);if(_0x3298ec[_0x5507('0x28')]){delete _0x3298ec[_0x5507('0x28')];}_0x1b0fef[_0x5507('0x19')](_0x4c5906)[_0x5507('0x29')](_0x3298ec);};}exports['index']=function(_0x31b54e,_0x323252){var _0x427bdb={},_0x48c92b={},_0x40b752={'count':0x0,'rows':[]};var _0x3105ea=_[_0x5507('0x2a')](db[_0x5507('0x2b')][_0x5507('0x2c')],function(_0x3a9446){return{'name':_0x3a9446['fieldName'],'type':_0x3a9446[_0x5507('0x2d')][_0x5507('0x2e')]};});_0x48c92b[_0x5507('0x2f')]=_['map'](_0x3105ea,_0x5507('0x28'));_0x48c92b['query']=_[_0x5507('0x30')](_0x31b54e['query']);_0x48c92b[_0x5507('0x31')]=_[_0x5507('0x32')](_0x48c92b['model'],_0x48c92b['query']);_0x427bdb[_0x5507('0x33')]=_[_0x5507('0x32')](_0x48c92b[_0x5507('0x2f')],qs[_0x5507('0x34')](_0x31b54e[_0x5507('0x35')]['fields']));_0x427bdb[_0x5507('0x33')]=_0x427bdb['attributes'][_0x5507('0x36')]?_0x427bdb[_0x5507('0x33')]:_0x48c92b['model'];if(!_0x31b54e[_0x5507('0x35')][_0x5507('0x37')]('nolimit')){_0x427bdb[_0x5507('0x1d')]=qs[_0x5507('0x1d')](_0x31b54e[_0x5507('0x35')][_0x5507('0x1d')]);_0x427bdb[_0x5507('0x1f')]=qs[_0x5507('0x1f')](_0x31b54e[_0x5507('0x35')]['offset']);}_0x427bdb[_0x5507('0x38')]=qs[_0x5507('0x39')](_0x31b54e['query'][_0x5507('0x39')]);_0x427bdb[_0x5507('0x3a')]=qs['filters'](_[_0x5507('0x3b')](_0x31b54e[_0x5507('0x35')],_0x48c92b[_0x5507('0x31')]),_0x3105ea);if(_0x31b54e[_0x5507('0x35')]['filter']){_0x427bdb[_0x5507('0x3a')]=_[_0x5507('0x3c')](_0x427bdb[_0x5507('0x3a')],{'$or':_[_0x5507('0x2a')](_0x3105ea,function(_0x374848){if(_0x374848['type']!==_0x5507('0x3d')){var _0x4947aa={};_0x4947aa[_0x374848[_0x5507('0x28')]]={'$like':'%'+_0x31b54e['query'][_0x5507('0x3e')]+'%'};return _0x4947aa;}})});}_0x427bdb=_['merge']({},_0x427bdb,_0x31b54e['options']);var _0x170496={'where':_0x427bdb[_0x5507('0x3a')]};return db[_0x5507('0x2b')][_0x5507('0x1e')](_0x170496)[_0x5507('0x25')](function(_0x555cc4){_0x40b752['count']=_0x555cc4;if(_0x31b54e['query']['includeAll']){_0x427bdb[_0x5507('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x5507('0x40')](_0x427bdb);})[_0x5507('0x25')](function(_0x58918d){_0x40b752['rows']=_0x58918d;return _0x40b752;})['then'](respondWithFilteredResult(_0x323252,_0x427bdb))[_0x5507('0x41')](handleError(_0x323252,null));};exports[_0x5507('0x42')]=function(_0x5c8d84,_0x3daf60){var _0x564df6={'raw':!![],'where':{'id':_0x5c8d84['params']['id']}},_0x4894bb={};_0x4894bb[_0x5507('0x2f')]=_[_0x5507('0x30')](db[_0x5507('0x2b')][_0x5507('0x2c')]);_0x4894bb[_0x5507('0x35')]=_['keys'](_0x5c8d84['query']);_0x4894bb[_0x5507('0x31')]=_[_0x5507('0x32')](_0x4894bb[_0x5507('0x2f')],_0x4894bb[_0x5507('0x35')]);_0x564df6['attributes']=_[_0x5507('0x32')](_0x4894bb[_0x5507('0x2f')],qs['fields'](_0x5c8d84['query']['fields']));_0x564df6[_0x5507('0x33')]=_0x564df6[_0x5507('0x33')][_0x5507('0x36')]?_0x564df6[_0x5507('0x33')]:_0x4894bb['model'];if(_0x5c8d84[_0x5507('0x35')][_0x5507('0x43')]){_0x564df6[_0x5507('0x3f')]=[{'all':!![]}];}_0x564df6=_[_0x5507('0x3c')]({},_0x564df6,_0x5c8d84[_0x5507('0x44')]);return db[_0x5507('0x2b')][_0x5507('0x45')](_0x564df6)[_0x5507('0x25')](handleEntityNotFound(_0x3daf60,null))[_0x5507('0x25')](respondWithResult(_0x3daf60,null))[_0x5507('0x41')](handleError(_0x3daf60,null));};exports['clone']=function(_0x7273ed,_0xe0bdb7){var _0x54b806={'where':{'id':_0x7273ed[_0x5507('0x46')]['id']}},_0x4323f7={};_0x4323f7[_0x5507('0x2f')]=_[_0x5507('0x30')](db[_0x5507('0x2b')][_0x5507('0x2c')]);_0x54b806[_0x5507('0x33')]=_[_0x5507('0x32')](_0x4323f7['model'],qs[_0x5507('0x34')](_0x7273ed[_0x5507('0x35')][_0x5507('0x34')]));_0x54b806[_0x5507('0x33')]=_0x54b806[_0x5507('0x33')][_0x5507('0x36')]?_0x54b806[_0x5507('0x33')]:_0x4323f7[_0x5507('0x2f')];if(_0x7273ed[_0x5507('0x35')][_0x5507('0x43')]){_0x54b806['include']=[{'all':!![]}];}_0x54b806=_[_0x5507('0x3c')]({},_0x54b806,_0x7273ed['options']);return db[_0x5507('0x2b')]['find'](_0x54b806)[_0x5507('0x25')](handleEntityNotFound(_0xe0bdb7,null))[_0x5507('0x25')](function(_0x42a3b3){if(_0x42a3b3){var _0x19d03f=_0x42a3b3[_0x5507('0x47')]({'plain':!![]});_0x19d03f=qs[_0x5507('0x48')](_0x19d03f,['id','createdAt',_0x5507('0x49')]);_0x7273ed[_0x5507('0x4a')]=_[_0x5507('0x48')](_0x7273ed[_0x5507('0x4a')],['id',_0x5507('0x4b'),'updatedAt']);return db['Attachment']['create'](_[_0x5507('0x3c')](_0x19d03f,_0x7273ed[_0x5507('0x4a')]),{'include':_0x7273ed[_0x5507('0x35')][_0x5507('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xe0bdb7,0xc9))[_0x5507('0x41')](handleError(_0xe0bdb7,null));};exports[_0x5507('0x24')]=function(_0x377a97,_0x20d893){if(_0x377a97[_0x5507('0x4a')]['id']){delete _0x377a97[_0x5507('0x4a')]['id'];}return db['Attachment'][_0x5507('0x45')]({'where':{'id':_0x377a97['params']['id']}})[_0x5507('0x25')](handleEntityNotFound(_0x20d893,null))[_0x5507('0x25')](saveUpdates(_0x377a97[_0x5507('0x4a')],null))[_0x5507('0x25')](respondWithResult(_0x20d893,null))[_0x5507('0x41')](handleError(_0x20d893,null));};exports[_0x5507('0x26')]=function(_0xfa5465,_0x507b87){return db[_0x5507('0x2b')][_0x5507('0x45')]({'where':{'id':_0xfa5465['params']['id']}})[_0x5507('0x25')](handleEntityNotFound(_0x507b87,null))[_0x5507('0x25')](removeEntity(_0x507b87,null))[_0x5507('0x41')](handleError(_0x507b87,null));};exports['create']=function(_0x5c16c6,_0x4007d4,_0x2707b4){_0x5c16c6['body'][_0x5507('0x28')]=_0x5c16c6[_0x5507('0x4c')]['originalname'];_0x5c16c6['body'][_0x5507('0x4d')]=_0x5c16c6['file'][_0x5507('0x4e')];_0x5c16c6[_0x5507('0x4a')]['type']=_0x5c16c6[_0x5507('0x4c')][_0x5507('0x4f')];return db[_0x5507('0x2b')][_0x5507('0x50')](_0x5c16c6[_0x5507('0x4a')])['then'](respondWithResult(_0x4007d4,0xc9))[_0x5507('0x41')](handleError(_0x4007d4,null));};exports[_0x5507('0x51')]=function(_0x88e8d1,_0x26ffce,_0x2bd598){return db['Attachment'][_0x5507('0x52')]({'where':{'id':_0x88e8d1['params']['id']},'raw':!![]})[_0x5507('0x25')](handleEntityNotFound(_0x26ffce,null))[_0x5507('0x25')](function(_0x67deb2){if(_0x67deb2){var _0x586460=_0x67deb2[_0x5507('0x53')]!==null;var _0x18da01=path['join'](config[_0x5507('0x54')],_0x5507('0x55'));if(_0x586460){_0x18da01=path[_0x5507('0x56')](_0x18da01,_0x5507('0x57'));}var _0x5c25e3=path[_0x5507('0x56')](_0x18da01,_0x67deb2[_0x5507('0x4d')]);return _0x26ffce[_0x5507('0x51')](_0x5c25e3);}})[_0x5507('0x41')](handleError(_0x26ffce,null));}; \ No newline at end of file +var _0xd8ea=['findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','Attachment','rows','catch','show','keys','rawAttributes','find','params','get','omit','body','createdAt','create','update','file','originalname','basename','filename','mimetype','download'];(function(_0x46384e,_0xe14bf1){var _0x3a3682=function(_0x3e75a3){while(--_0x3e75a3){_0x46384e['push'](_0x46384e['shift']());}};_0x3a3682(++_0xe14bf1);}(_0xd8ea,0x16c));var _0xad8e=function(_0x2eab12,_0xbc1637){_0x2eab12=_0x2eab12-0x0;var _0x348fb=_0xd8ea[_0x2eab12];return _0x348fb;};'use strict';var emlformat=require(_0xad8e('0x0'));var rimraf=require(_0xad8e('0x1'));var zipdir=require(_0xad8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad8e('0x3'));var moment=require(_0xad8e('0x4'));var BPromise=require(_0xad8e('0x5'));var Mustache=require(_0xad8e('0x6'));var util=require(_0xad8e('0x7'));var path=require(_0xad8e('0x8'));var sox=require(_0xad8e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad8e('0xa'));var _=require(_0xad8e('0xb'));var squel=require(_0xad8e('0xc'));var crypto=require('crypto');var jsforce=require(_0xad8e('0xd'));var deskjs=require(_0xad8e('0xe'));var toCsv=require(_0xad8e('0xf'));var querystring=require(_0xad8e('0x10'));var Papa=require(_0xad8e('0x11'));var Redis=require(_0xad8e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xad8e('0x13'));var as=require(_0xad8e('0x14'));var hardwareService=require(_0xad8e('0x15'));var logger=require(_0xad8e('0x16'))(_0xad8e('0x17'));var utils=require(_0xad8e('0x18'));var config=require(_0xad8e('0x19'));var licenseUtil=require(_0xad8e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26f979,_0x1a5b19){_0x1a5b19=_0x1a5b19||0xcc;return function(_0x35e69c){if(_0x35e69c){return _0x26f979[_0xad8e('0x1b')](_0x1a5b19);}return _0x26f979[_0xad8e('0x1c')](_0x1a5b19)[_0xad8e('0x1d')]();};}function respondWithResult(_0x54f9e8,_0x5a0aa5){_0x5a0aa5=_0x5a0aa5||0xc8;return function(_0x13e701){if(_0x13e701){return _0x54f9e8['status'](_0x5a0aa5)[_0xad8e('0x1e')](_0x13e701);}};}function respondWithFilteredResult(_0x1c52d7,_0x4489cd){return function(_0x2992c3){if(_0x2992c3){var _0x5aeda2=typeof _0x4489cd[_0xad8e('0x1f')]===_0xad8e('0x20')&&typeof _0x4489cd[_0xad8e('0x21')]==='undefined';var _0x2f969f=_0x2992c3['count'];var _0x504a5b=_0x5aeda2?0x0:_0x4489cd[_0xad8e('0x1f')];var _0x3f7c40=_0x5aeda2?_0x2992c3[_0xad8e('0x22')]:_0x4489cd[_0xad8e('0x1f')]+_0x4489cd[_0xad8e('0x21')];var _0x15c8ba;if(_0x3f7c40>=_0x2f969f){_0x3f7c40=_0x2f969f;_0x15c8ba=0xc8;}else{_0x15c8ba=0xce;}_0x1c52d7[_0xad8e('0x1c')](_0x15c8ba);return _0x1c52d7['set'](_0xad8e('0x23'),_0x504a5b+'-'+_0x3f7c40+'/'+_0x2f969f)[_0xad8e('0x1e')](_0x2992c3);}return null;};}function patchUpdates(_0x1af6f1){return function(_0x7492b){try{jsonpatch[_0xad8e('0x24')](_0x7492b,_0x1af6f1,!![]);}catch(_0x9b59c2){return BPromise[_0xad8e('0x25')](_0x9b59c2);}return _0x7492b[_0xad8e('0x26')]();};}function saveUpdates(_0x57979e,_0x1bc534){return function(_0x2c888f){if(_0x2c888f){return _0x2c888f['update'](_0x57979e)[_0xad8e('0x27')](function(_0x374ddc){return _0x374ddc;});}return null;};}function removeEntity(_0x2eab22,_0x3612ac){return function(_0x5c9126){if(_0x5c9126){return _0x5c9126[_0xad8e('0x28')]()['then'](function(){_0x2eab22[_0xad8e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330ef0,_0x166f4d){return function(_0xfb2d8a){if(!_0xfb2d8a){_0x330ef0[_0xad8e('0x1b')](0x194);}return _0xfb2d8a;};}function handleError(_0xd27a9d,_0x503e64){_0x503e64=_0x503e64||0x1f4;return function(_0x586561){logger[_0xad8e('0x29')](_0x586561[_0xad8e('0x2a')]);if(_0x586561[_0xad8e('0x2b')]){delete _0x586561[_0xad8e('0x2b')];}_0xd27a9d[_0xad8e('0x1c')](_0x503e64)['send'](_0x586561);};}exports[_0xad8e('0x2c')]=function(_0x37aa19,_0x59d40a){var _0x16824d={},_0x78c90={},_0x3e7049={'count':0x0,'rows':[]};var _0x1aab10=_[_0xad8e('0x2d')](db['Attachment']['rawAttributes'],function(_0x218cb1){return{'name':_0x218cb1['fieldName'],'type':_0x218cb1[_0xad8e('0x2e')][_0xad8e('0x2f')]};});_0x78c90[_0xad8e('0x30')]=_[_0xad8e('0x2d')](_0x1aab10,_0xad8e('0x2b'));_0x78c90['query']=_['keys'](_0x37aa19[_0xad8e('0x31')]);_0x78c90['filters']=_[_0xad8e('0x32')](_0x78c90['model'],_0x78c90['query']);_0x16824d[_0xad8e('0x33')]=_[_0xad8e('0x32')](_0x78c90[_0xad8e('0x30')],qs[_0xad8e('0x34')](_0x37aa19[_0xad8e('0x31')]['fields']));_0x16824d[_0xad8e('0x33')]=_0x16824d['attributes'][_0xad8e('0x35')]?_0x16824d[_0xad8e('0x33')]:_0x78c90[_0xad8e('0x30')];if(!_0x37aa19[_0xad8e('0x31')][_0xad8e('0x36')](_0xad8e('0x37'))){_0x16824d[_0xad8e('0x21')]=qs['limit'](_0x37aa19[_0xad8e('0x31')][_0xad8e('0x21')]);_0x16824d[_0xad8e('0x1f')]=qs['offset'](_0x37aa19['query'][_0xad8e('0x1f')]);}_0x16824d[_0xad8e('0x38')]=qs['sort'](_0x37aa19[_0xad8e('0x31')]['sort']);_0x16824d[_0xad8e('0x39')]=qs[_0xad8e('0x3a')](_[_0xad8e('0x3b')](_0x37aa19[_0xad8e('0x31')],_0x78c90[_0xad8e('0x3a')]),_0x1aab10);if(_0x37aa19[_0xad8e('0x31')][_0xad8e('0x3c')]){_0x16824d[_0xad8e('0x39')]=_[_0xad8e('0x3d')](_0x16824d[_0xad8e('0x39')],{'$or':_[_0xad8e('0x2d')](_0x1aab10,function(_0x54fdce){if(_0x54fdce[_0xad8e('0x2e')]!==_0xad8e('0x3e')){var _0xb6e6cc={};_0xb6e6cc[_0x54fdce[_0xad8e('0x2b')]]={'$like':'%'+_0x37aa19[_0xad8e('0x31')][_0xad8e('0x3c')]+'%'};return _0xb6e6cc;}})});}_0x16824d=_[_0xad8e('0x3d')]({},_0x16824d,_0x37aa19[_0xad8e('0x3f')]);var _0x378ef9={'where':_0x16824d['where']};return db['Attachment']['count'](_0x378ef9)[_0xad8e('0x27')](function(_0x415005){_0x3e7049[_0xad8e('0x22')]=_0x415005;if(_0x37aa19['query'][_0xad8e('0x40')]){_0x16824d[_0xad8e('0x41')]=[{'all':!![]}];}return db[_0xad8e('0x42')]['findAll'](_0x16824d);})[_0xad8e('0x27')](function(_0x5610c5){_0x3e7049[_0xad8e('0x43')]=_0x5610c5;return _0x3e7049;})[_0xad8e('0x27')](respondWithFilteredResult(_0x59d40a,_0x16824d))[_0xad8e('0x44')](handleError(_0x59d40a,null));};exports[_0xad8e('0x45')]=function(_0x28a0d3,_0x387147){var _0x4a2895={'raw':!![],'where':{'id':_0x28a0d3['params']['id']}},_0x49b70f={};_0x49b70f[_0xad8e('0x30')]=_[_0xad8e('0x46')](db[_0xad8e('0x42')][_0xad8e('0x47')]);_0x49b70f[_0xad8e('0x31')]=_['keys'](_0x28a0d3[_0xad8e('0x31')]);_0x49b70f[_0xad8e('0x3a')]=_[_0xad8e('0x32')](_0x49b70f['model'],_0x49b70f[_0xad8e('0x31')]);_0x4a2895[_0xad8e('0x33')]=_[_0xad8e('0x32')](_0x49b70f['model'],qs[_0xad8e('0x34')](_0x28a0d3[_0xad8e('0x31')][_0xad8e('0x34')]));_0x4a2895['attributes']=_0x4a2895[_0xad8e('0x33')][_0xad8e('0x35')]?_0x4a2895[_0xad8e('0x33')]:_0x49b70f[_0xad8e('0x30')];if(_0x28a0d3[_0xad8e('0x31')][_0xad8e('0x40')]){_0x4a2895[_0xad8e('0x41')]=[{'all':!![]}];}_0x4a2895=_['merge']({},_0x4a2895,_0x28a0d3[_0xad8e('0x3f')]);return db['Attachment'][_0xad8e('0x48')](_0x4a2895)[_0xad8e('0x27')](handleEntityNotFound(_0x387147,null))['then'](respondWithResult(_0x387147,null))[_0xad8e('0x44')](handleError(_0x387147,null));};exports['clone']=function(_0x3019c6,_0x52fcab){var _0x3e8334={'where':{'id':_0x3019c6[_0xad8e('0x49')]['id']}},_0x9912eb={};_0x9912eb['model']=_[_0xad8e('0x46')](db[_0xad8e('0x42')][_0xad8e('0x47')]);_0x3e8334[_0xad8e('0x33')]=_['intersection'](_0x9912eb['model'],qs[_0xad8e('0x34')](_0x3019c6['query'][_0xad8e('0x34')]));_0x3e8334['attributes']=_0x3e8334[_0xad8e('0x33')][_0xad8e('0x35')]?_0x3e8334[_0xad8e('0x33')]:_0x9912eb[_0xad8e('0x30')];if(_0x3019c6[_0xad8e('0x31')][_0xad8e('0x40')]){_0x3e8334[_0xad8e('0x41')]=[{'all':!![]}];}_0x3e8334=_[_0xad8e('0x3d')]({},_0x3e8334,_0x3019c6[_0xad8e('0x3f')]);return db[_0xad8e('0x42')][_0xad8e('0x48')](_0x3e8334)[_0xad8e('0x27')](handleEntityNotFound(_0x52fcab,null))[_0xad8e('0x27')](function(_0xc9f465){if(_0xc9f465){var _0x52acb0=_0xc9f465[_0xad8e('0x4a')]({'plain':!![]});_0x52acb0=qs[_0xad8e('0x4b')](_0x52acb0,['id','createdAt','updatedAt']);_0x3019c6[_0xad8e('0x4c')]=_[_0xad8e('0x4b')](_0x3019c6['body'],['id',_0xad8e('0x4d'),'updatedAt']);return db[_0xad8e('0x42')][_0xad8e('0x4e')](_[_0xad8e('0x3d')](_0x52acb0,_0x3019c6['body']),{'include':_0x3019c6[_0xad8e('0x31')][_0xad8e('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x52fcab,0xc9))[_0xad8e('0x44')](handleError(_0x52fcab,null));};exports[_0xad8e('0x4f')]=function(_0x5a6c64,_0x3cff4a){if(_0x5a6c64[_0xad8e('0x4c')]['id']){delete _0x5a6c64[_0xad8e('0x4c')]['id'];}return db[_0xad8e('0x42')][_0xad8e('0x48')]({'where':{'id':_0x5a6c64[_0xad8e('0x49')]['id']}})[_0xad8e('0x27')](handleEntityNotFound(_0x3cff4a,null))[_0xad8e('0x27')](saveUpdates(_0x5a6c64['body'],null))[_0xad8e('0x27')](respondWithResult(_0x3cff4a,null))[_0xad8e('0x44')](handleError(_0x3cff4a,null));};exports['destroy']=function(_0x16657e,_0x54a715){return db[_0xad8e('0x42')][_0xad8e('0x48')]({'where':{'id':_0x16657e[_0xad8e('0x49')]['id']}})['then'](handleEntityNotFound(_0x54a715,null))[_0xad8e('0x27')](removeEntity(_0x54a715,null))[_0xad8e('0x44')](handleError(_0x54a715,null));};exports['create']=function(_0x36b2c6,_0x3a7002,_0x24245d){_0x36b2c6[_0xad8e('0x4c')][_0xad8e('0x2b')]=_0x36b2c6[_0xad8e('0x50')][_0xad8e('0x51')];_0x36b2c6[_0xad8e('0x4c')][_0xad8e('0x52')]=_0x36b2c6[_0xad8e('0x50')][_0xad8e('0x53')];_0x36b2c6[_0xad8e('0x4c')][_0xad8e('0x2e')]=_0x36b2c6[_0xad8e('0x50')][_0xad8e('0x54')];return db[_0xad8e('0x42')][_0xad8e('0x4e')](_0x36b2c6['body'])[_0xad8e('0x27')](respondWithResult(_0x3a7002,0xc9))[_0xad8e('0x44')](handleError(_0x3a7002,null));};exports[_0xad8e('0x55')]=function(_0x168c56,_0x40134a,_0x545593){return db[_0xad8e('0x42')][_0xad8e('0x56')]({'where':{'id':_0x168c56[_0xad8e('0x49')]['id']},'raw':!![]})[_0xad8e('0x27')](handleEntityNotFound(_0x40134a,null))[_0xad8e('0x27')](function(_0x4045f2){if(_0x4045f2){var _0xc04688=_0x4045f2[_0xad8e('0x57')]!==null;var _0x58a419=path[_0xad8e('0x58')](config['root'],_0xad8e('0x59'));if(_0xc04688){_0x58a419=path[_0xad8e('0x58')](_0x58a419,'offline-chat/');}var _0x3213a9=path['join'](_0x58a419,_0x4045f2[_0xad8e('0x52')]);return _0x40134a[_0xad8e('0x55')](_0x3213a9);}})['catch'](handleError(_0x40134a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index c006818..1dc40c5 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 _0x24c9=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x24c9,0xfe));var _0x924c=function(_0x44ca95,_0x1756fd){_0x44ca95=_0x44ca95-0x0;var _0x42fd3e=_0x24c9[_0x44ca95];return _0x42fd3e;};'use strict';var _=require(_0x924c('0x0'));var util=require(_0x924c('0x1'));var logger=require(_0x924c('0x2'))(_0x924c('0x3'));var moment=require('moment');var BPromise=require(_0x924c('0x4'));var rp=require(_0x924c('0x5'));var fs=require('fs');var path=require(_0x924c('0x6'));var rimraf=require('rimraf');var config=require(_0x924c('0x7'));var attributes=require(_0x924c('0x8'));module[_0x924c('0x9')]=function(_0x213efa,_0x48e852){return _0x213efa[_0x924c('0xa')](_0x924c('0xb'),attributes,{'tableName':_0x924c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce77=['../../config/logger','api','moment','request-promise','./attachment.attributes','define','attachments','util'];(function(_0x538102,_0x1ee338){var _0x4758e2=function(_0x1df6bf){while(--_0x1df6bf){_0x538102['push'](_0x538102['shift']());}};_0x4758e2(++_0x1ee338);}(_0xce77,0x87));var _0x7ce7=function(_0x219336,_0x430668){_0x219336=_0x219336-0x0;var _0x5c7f22=_0xce77[_0x219336];return _0x5c7f22;};'use strict';var _=require('lodash');var util=require(_0x7ce7('0x0'));var logger=require(_0x7ce7('0x1'))(_0x7ce7('0x2'));var moment=require(_0x7ce7('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ce7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7ce7('0x5'));module['exports']=function(_0x44736f,_0x31d939){return _0x44736f[_0x7ce7('0x6')]('Attachment',attributes,{'tableName':_0x7ce7('0x7'),'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 ce19478..f9ebf85 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 _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x4f726a,_0x3425c3){var _0x1a512c=function(_0x30b775){while(--_0x30b775){_0x4f726a['push'](_0x4f726a['shift']());}};_0x1a512c(++_0x3425c3);}(_0xb201,0x1b1));var _0x1b20=function(_0x7eba85,_0x59df95){_0x7eba85=_0x7eba85-0x0;var _0x1d117a=_0xb201[_0x7eba85];return _0x1d117a;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});}; \ No newline at end of file +var _0xa902=['raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','create','body','options'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa902,0x8d));var _0x2a90=function(_0x2891c3,_0x4caed3){_0x2891c3=_0x2891c3-0x0;var _0x17690a=_0xa902[_0x2891c3];return _0x17690a;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('Attachment,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('Attachment,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['Attachment'][_0x2a90('0x18')](_0x5c3e4b[_0x2a90('0x19')],{'raw':_0x5c3e4b[_0x2a90('0x1a')]?_0x5c3e4b[_0x2a90('0x1a')][_0x2a90('0x1b')]===undefined?!![]:![]:!![]})[_0x2a90('0xc')](function(_0x312cd5){logger[_0x2a90('0xd')](_0x2a90('0x17'),_0x5c3e4b);logger[_0x2a90('0xf')](_0x2a90('0x17'),_0x5c3e4b,JSON[_0x2a90('0x12')](_0x312cd5));_0x1d9a28(_0x312cd5);})['catch'](function(_0x3da7d0){logger[_0x2a90('0x13')](_0x2a90('0x17'),_0x3da7d0[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3da7d0[_0x2a90('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1c3b354..33e871a 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x6badde,_0x3355c7){_0x6badde=_0x6badde-0x0;var _0x2c5ad0=_0xdb28[_0x6badde];return _0x2c5ad0;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 7ee24b8..d4dff82 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 _0xe8a1=['../../config/logger','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','online','name','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','login','signToken','use','ad-login','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x395007,_0x225eeb){var _0x34e1d0=function(_0x4eab12){while(--_0x4eab12){_0x395007['push'](_0x395007['shift']());}};_0x34e1d0(++_0x225eeb);}(_0xe8a1,0xf8));var _0x1e8a=function(_0x54f1ef,_0x3afe49){_0x54f1ef=_0x54f1ef-0x0;var _0x766919=_0xe8a1[_0x54f1ef];return _0x766919;};'use strict';var passport=require(_0x1e8a('0x0'));var LocalStrategy=require(_0x1e8a('0x1'))[_0x1e8a('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x1e8a('0x3'));var BPromise=require(_0x1e8a('0x4'));var util=require(_0x1e8a('0x5'));var db=require(_0x1e8a('0x6'))['db'];var authService=require(_0x1e8a('0x7'));var utils=require(_0x1e8a('0x8'));var config=require(_0x1e8a('0x9'));var logger=require(_0x1e8a('0xa'))('api');function isActiveDirectoryConfigured(_0x21821f){var _0x4efec5=![];if(typeof _0x21821f[_0x1e8a('0xb')]!==_0x1e8a('0xc')){_0x4efec5=_0x21821f[_0x1e8a('0xb')]['baseDN']&&_0x21821f[_0x1e8a('0xb')][_0x1e8a('0xd')]&&_0x21821f[_0x1e8a('0xb')][_0x1e8a('0xe')];}return _0x4efec5;}function adAuthenticate(_0x26ae1e,_0x125931,_0x1a2eb1){return new BPromise(function(_0x4aa92b,_0x3d762f){try{var _0x98f189=new ActiveDirectory(_0x26ae1e);_0x98f189[_0x1e8a('0xf')](_0x125931,_0x1a2eb1,function(_0x472d9b,_0x58f70d){if(_0x472d9b){logger[_0x1e8a('0x10')](_0x1e8a('0x11'),_0x125931,util[_0x1e8a('0x12')](_0x472d9b,{'showHidden':![],'depth':null}));_0x3d762f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x58f70d){logger[_0x1e8a('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x125931);_0x3d762f(_0x1e8a('0x13'));}else{_0x4aa92b(_0x58f70d);}});}catch(_0xca77d6){_0x3d762f(_0xca77d6);}});}function ActiveDirectoryAuthenticate(_0x3a7f3e,_0xe0aecb,_0x8b6084,_0x5b3fac){var _0x561342,_0x5c9507;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xe0aecb);return _0x5b3fac(null,![],{'message':_0x1e8a('0x13')});}return db[_0x1e8a('0x14')][_0x1e8a('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x1e8a('0x16')],'raw':!![]})[_0x1e8a('0x17')](function(_0x5971c7){_0x561342=_0x5971c7;if(!_0x561342[_0x1e8a('0x18')]){logger[_0x1e8a('0x10')](_0x1e8a('0x19'),_0xe0aecb);throw new Error(_0x1e8a('0x13'));}return _0x3a7f3e[_0x1e8a('0x15')]({'logging':!![],'attributes':['id','name',_0x1e8a('0x1a'),_0x1e8a('0x1b'),_0x1e8a('0x1c'),'disabled',_0x1e8a('0x1d'),'blockedAt',_0x1e8a('0x1e')],'where':{'name':_0xe0aecb,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})[_0x1e8a('0x17')](function(_0x12ac18){if(!_0x12ac18||_0x12ac18&&_0x12ac18[_0x1e8a('0x1f')]!==_0xe0aecb){throw new Error(_0x1e8a('0x13'));}_0x5c9507=_0x12ac18;var _0x594c5c=_0x5c9507[_0x1e8a('0x1f')]+'@'+config[_0x1e8a('0xb')][_0x1e8a('0xe')];return adAuthenticate(config[_0x1e8a('0xb')],_0x594c5c,_0x8b6084);})[_0x1e8a('0x17')](function(_0x50986f){if(_0x5c9507['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x561342[_0x1e8a('0x16')]>0x0){if(_0x5c9507[_0x1e8a('0x1d')]){if(moment(_0x5c9507[_0x1e8a('0x20')])[_0x1e8a('0x21')](_0x561342['blockDuration'],_0x1e8a('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x1e8a('0x23')](_0x5c9507,0x0,![],null)[_0x1e8a('0x17')](function(){return utils[_0x1e8a('0x24')](_0x5c9507);})[_0x1e8a('0x17')](function(){return _0x5b3fac(null,_0x5c9507);});}else{return utils['getLicense'](_0x5c9507)[_0x1e8a('0x17')](function(){return _0x5b3fac(null,_0x5c9507);});}}else{return utils[_0x1e8a('0x24')](_0x5c9507)[_0x1e8a('0x17')](function(){return _0x5b3fac(null,_0x5c9507);});}})[_0x1e8a('0x25')](function(_0x16b4ef){return _0x5b3fac(null,![],_0x16b4ef);});}function handleError(_0x55a55b,_0x5eace6,_0x353bb2){return _0x55a55b[_0x1e8a('0x26')](_0x5eace6||0x1f4)['send']({'message':_0x353bb2?_0x353bb2['message']||_0x353bb2:''});}exports[_0x1e8a('0x27')]=function(_0xd85fc6,_0x5b1d6d,_0x7e0013){passport['authenticate']('ad-login',function(_0x4e304c,_0x2b39a3,_0x99dc23){var _0x5bdd31=_0x4e304c||_0x99dc23;if(_0x5bdd31){return handleError(_0x5b1d6d,0x191,_0x5bdd31);}if(!_0x2b39a3){return handleError(_0x5b1d6d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3063ca={'payload':{'id':_0x2b39a3['id'],'role':_0x2b39a3[_0x1e8a('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x1e8a('0x28')](_0x3063ca)[_0x1e8a('0x17')](function(_0x15dfe4){_0x5b1d6d['json']({'id':_0x2b39a3['id'],'token':_0x15dfe4,'statusCall':'','isAlreadyLogged':_0x2b39a3['online']});});}})(_0xd85fc6,_0x5b1d6d,_0x7e0013);};passport[_0x1e8a('0x29')](_0x1e8a('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x1e8a('0x1a')},function(_0x55b98b,_0x2b40f0,_0x1a8a6c){return ActiveDirectoryAuthenticate(db['User'],_0x55b98b,_0x2b40f0,_0x1a8a6c);})); \ No newline at end of file +var _0x22c4=['activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','then','password','role','disabled','online','admin','user','agent','name','blockDuration','blocked','blockedAt','minutes','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','ad-login','User','passport','Strategy','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined'];(function(_0x5d184b,_0x1b04c5){var _0x5cee64=function(_0x393f88){while(--_0x393f88){_0x5d184b['push'](_0x5d184b['shift']());}};_0x5cee64(++_0x1b04c5);}(_0x22c4,0xb5));var _0x422c=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0x22c4[_0x53ddab];return _0x5819ac;};'use strict';var passport=require(_0x422c('0x0'));var LocalStrategy=require('passport-local')[_0x422c('0x1')];var moment=require(_0x422c('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x422c('0x3'));var db=require(_0x422c('0x4'))['db'];var authService=require(_0x422c('0x5'));var utils=require(_0x422c('0x6'));var config=require(_0x422c('0x7'));var logger=require(_0x422c('0x8'))(_0x422c('0x9'));function isActiveDirectoryConfigured(_0xf9062){var _0x5de0b6=![];if(typeof _0xf9062['activedirectory']!==_0x422c('0xa')){_0x5de0b6=_0xf9062[_0x422c('0xb')][_0x422c('0xc')]&&_0xf9062[_0x422c('0xb')][_0x422c('0xd')]&&_0xf9062[_0x422c('0xb')][_0x422c('0xe')];}return _0x5de0b6;}function adAuthenticate(_0x3339be,_0x80b3a9,_0x162922){return new BPromise(function(_0xc5036b,_0x1abeae){try{var _0x2acd58=new ActiveDirectory(_0x3339be);_0x2acd58[_0x422c('0xf')](_0x80b3a9,_0x162922,function(_0x336bd0,_0x308469){if(_0x336bd0){logger[_0x422c('0x10')](_0x422c('0x11'),_0x80b3a9,util[_0x422c('0x12')](_0x336bd0,{'showHidden':![],'depth':null}));_0x1abeae(_0x422c('0x13'));}else if(!_0x308469){logger[_0x422c('0x10')](_0x422c('0x14'),_0x80b3a9);_0x1abeae(_0x422c('0x13'));}else{_0xc5036b(_0x308469);}});}catch(_0x2a56e9){_0x1abeae(_0x2a56e9);}});}function ActiveDirectoryAuthenticate(_0x48eb42,_0x5c5ad4,_0x222342,_0xe1878e){var _0x3ad3c7,_0x3b327a;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x5c5ad4);return _0xe1878e(null,![],{'message':_0x422c('0x13')});}return db[_0x422c('0x15')][_0x422c('0x16')]({'where':{'id':0x1},'attributes':[_0x422c('0x17'),'blockDuration'],'raw':!![]})[_0x422c('0x18')](function(_0x5cb684){_0x3ad3c7=_0x5cb684;if(!_0x3ad3c7['adSsoEnabled']){logger[_0x422c('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x5c5ad4);throw new Error(_0x422c('0x13'));}return _0x48eb42[_0x422c('0x16')]({'logging':!![],'attributes':['id','name',_0x422c('0x19'),'salt',_0x422c('0x1a'),_0x422c('0x1b'),'blocked','blockedAt',_0x422c('0x1c')],'where':{'name':_0x5c5ad4,'role':{'$or':[_0x422c('0x1d'),_0x422c('0x1e'),_0x422c('0x1f')]},'adSsoEnabled':!![]}});})[_0x422c('0x18')](function(_0x89cd8e){if(!_0x89cd8e||_0x89cd8e&&_0x89cd8e[_0x422c('0x20')]!==_0x5c5ad4){throw new Error(_0x422c('0x13'));}_0x3b327a=_0x89cd8e;var _0x87a916=_0x3b327a['name']+'@'+config[_0x422c('0xb')][_0x422c('0xe')];return adAuthenticate(config[_0x422c('0xb')],_0x87a916,_0x222342);})['then'](function(_0x29ee62){if(_0x3b327a['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3ad3c7[_0x422c('0x21')]>0x0){if(_0x3b327a[_0x422c('0x22')]){if(moment(_0x3b327a[_0x422c('0x23')])['add'](_0x3ad3c7[_0x422c('0x21')],_0x422c('0x24'))>moment()){throw new Error(_0x422c('0x13'));}return utils['clearBlockUser'](_0x3b327a,0x0,![],null)[_0x422c('0x18')](function(){return utils[_0x422c('0x25')](_0x3b327a);})['then'](function(){return _0xe1878e(null,_0x3b327a);});}else{return utils['getLicense'](_0x3b327a)['then'](function(){return _0xe1878e(null,_0x3b327a);});}}else{return utils['getLicense'](_0x3b327a)[_0x422c('0x18')](function(){return _0xe1878e(null,_0x3b327a);});}})[_0x422c('0x26')](function(_0x560a5d){return _0xe1878e(null,![],_0x560a5d);});}function handleError(_0x3a56be,_0x183059,_0x15718){return _0x3a56be[_0x422c('0x27')](_0x183059||0x1f4)[_0x422c('0x28')]({'message':_0x15718?_0x15718[_0x422c('0x29')]||_0x15718:''});}exports[_0x422c('0x2a')]=function(_0xd1dcfe,_0x33f026,_0x298a1e){passport['authenticate']('ad-login',function(_0x36b848,_0x1e2051,_0x16ec82){var _0x1a0398=_0x36b848||_0x16ec82;if(_0x1a0398){return handleError(_0x33f026,0x191,_0x1a0398);}if(!_0x1e2051){return handleError(_0x33f026,0x194,{'message':_0x422c('0x2b')});}else{var _0xaf5f01={'payload':{'id':_0x1e2051['id'],'role':_0x1e2051[_0x422c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x422c('0x2c')](_0xaf5f01)['then'](function(_0x3ed568){_0x33f026['json']({'id':_0x1e2051['id'],'token':_0x3ed568,'statusCall':'','isAlreadyLogged':_0x1e2051[_0x422c('0x1c')]});});}})(_0xd1dcfe,_0x33f026,_0x298a1e);};passport[_0x422c('0x2d')](_0x422c('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x5df5b0,_0x461fc2,_0x14a699){return ActiveDirectoryAuthenticate(db[_0x422c('0x2f')],_0x5df5b0,_0x461fc2,_0x14a699);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 555e8f5..93d78bb 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 _0xa846=['Router','post','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa846,0x17c));var _0x6a84=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0xa846[_0xb725be];return _0x2f2424;};'use strict';var express=require(_0x6a84('0x0'));var router=express[_0x6a84('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x6a84('0x2')]('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0xc974=['post','login','express','Router'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0xc974,0xb6));var _0x4c97=function(_0x220d8b,_0x31412f){_0x220d8b=_0x220d8b-0x0;var _0x4afcc5=_0xc974[_0x220d8b];return _0x4afcc5;};'use strict';var express=require(_0x4c97('0x0'));var router=express[_0x4c97('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x4c97('0x2')]('/',controller[_0x4c97('0x3')]);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 712ab6a..4e96d1e 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(_0x4648fe,_0x4b9f0d){var _0x48ee97=function(_0x2be78a){while(--_0x2be78a){_0x4648fe['push'](_0x4648fe['shift']());}};_0x48ee97(++_0x4b9f0d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x222ae4,_0x261760){var _0x4f0a2c=function(_0x1ed50d){while(--_0x1ed50d){_0x222ae4['push'](_0x222ae4['shift']());}};_0x4f0a2c(++_0x261760);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 8f19fa7..31a35a9 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 _0x34f8=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','setTokenCookie'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x34f8,0xbc));var _0x834f=function(_0xaccdae,_0x445e78){_0xaccdae=_0xaccdae-0x0;var _0x545e40=_0x34f8[_0xaccdae];return _0x545e40;};'use strict';var express=require(_0x834f('0x0'));var passport=require(_0x834f('0x1'));var router=express['Router']();var controller=require(_0x834f('0x2'));var userController=require(_0x834f('0x3'));var authService=require(_0x834f('0x4'));router['get']('/',controller[_0x834f('0x5')]);router[_0x834f('0x6')](_0x834f('0x7'),controller[_0x834f('0x8')],authService['isMiddleware'],userController[_0x834f('0x5')],authService[_0x834f('0x9')]);module[_0x834f('0xa')]=router; \ No newline at end of file +var _0x80b9=['isMiddleware','setTokenCookie','exports','Router','../../components/auth/service','get','login','/callback','callback'];(function(_0x3c94d1,_0x222960){var _0x50f3cd=function(_0x559c2e){while(--_0x559c2e){_0x3c94d1['push'](_0x3c94d1['shift']());}};_0x50f3cd(++_0x222960);}(_0x80b9,0x123));var _0x980b=function(_0x4e2300,_0x1c050b){_0x4e2300=_0x4e2300-0x0;var _0x5028ab=_0x80b9[_0x4e2300];return _0x5028ab;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x980b('0x0')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x980b('0x1'));router[_0x980b('0x2')]('/',controller[_0x980b('0x3')]);router[_0x980b('0x2')](_0x980b('0x4'),controller[_0x980b('0x5')],authService[_0x980b('0x6')],userController[_0x980b('0x3')],authService[_0x980b('0x7')]);module[_0x980b('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ef99ab0..71a3045 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 _0x9e45=['service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','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/','status','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','resetPasswordExpires','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','blockDuration','then','findOne','name','password','salt','role','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x131dbb,_0x11ca7d){var _0x32ca78=function(_0x2decb1){while(--_0x2decb1){_0x131dbb['push'](_0x131dbb['shift']());}};_0x32ca78(++_0x11ca7d);}(_0x9e45,0x1ee));var _0x59e4=function(_0x50748b,_0x599d6d){_0x50748b=_0x50748b-0x0;var _0x5688d7=_0x9e45[_0x50748b];return _0x5688d7;};'use strict';var util=require(_0x59e4('0x0'));var passport=require(_0x59e4('0x1'));var LocalStrategy=require(_0x59e4('0x2'))['Strategy'];var jayson=require(_0x59e4('0x3'));var _=require(_0x59e4('0x4'));var rs=require(_0x59e4('0x5'));var moment=require(_0x59e4('0x6'));var db=require(_0x59e4('0x7'))['db'];var authService=require(_0x59e4('0x8'));var utils=require(_0x59e4('0x9'));var client=jayson[_0x59e4('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x489219,_0x266cf9,_0x26b551,_0x3d4414){var _0x514d76,_0x2308ea;return db[_0x59e4('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x59e4('0xc')],'raw':!![]})[_0x59e4('0xd')](function(_0x29fe30){_0x514d76=_0x29fe30;return _0x489219[_0x59e4('0xe')]({'attributes':['id',_0x59e4('0xf'),_0x59e4('0x10'),_0x59e4('0x11'),_0x59e4('0x12'),'disabled',_0x59e4('0x13'),'blockedAt',_0x59e4('0x14')],'where':{'name':_0x266cf9,'role':{'$or':[_0x59e4('0x15'),_0x59e4('0x16'),_0x59e4('0x17')]}}});})[_0x59e4('0xd')](function(_0x1f2b36){if(!_0x1f2b36||_0x1f2b36&&_0x1f2b36[_0x59e4('0xf')]!==_0x266cf9){throw new Error(_0x59e4('0x18'));}else{_0x2308ea=_0x1f2b36;return _0x2308ea;}})['then'](function(){_0x2308ea[_0x59e4('0x19')](_0x26b551,function(_0x5df651,_0x11e833){var _0xc10b1f=_0x2308ea[_0x59e4('0x14')]+0x1;if(_0x5df651){return _0x3d4414(_0x5df651);}else if(!_0x11e833){if(_0x2308ea[_0x59e4('0x1a')]){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else if(_0x514d76[_0x59e4('0x1b')]>0x0){if(_0x2308ea[_0x59e4('0x13')]){if(_0x514d76[_0x59e4('0xc')]>0x0){if(moment(_0x2308ea[_0x59e4('0x1c')])[_0x59e4('0x1d')](_0x514d76[_0x59e4('0xc')],_0x59e4('0x1e'))>moment()){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else{return utils['clearBlockUser'](_0x2308ea,_0xc10b1f,![],null)[_0x59e4('0xd')](function(){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});});}}else{return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}}else{if(_0xc10b1f>=_0x514d76['allowedLoginAttempts']){return utils[_0x59e4('0x1f')](_0x2308ea,0x0,!![],moment())['then'](function(){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});});}else{return utils[_0x59e4('0x1f')](_0x2308ea,_0xc10b1f,![],null)[_0x59e4('0xd')](function(){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});});}}}else{return _0x3d4414(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2308ea['disabled']){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else if(_0x514d76[_0x59e4('0x1b')]>0x0){if(_0x2308ea[_0x59e4('0x13')]){if(_0x514d76[_0x59e4('0xc')]>0x0){if(moment(_0x2308ea[_0x59e4('0x1c')])[_0x59e4('0x1d')](_0x514d76[_0x59e4('0xc')],_0x59e4('0x1e'))>moment()){return _0x3d4414(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x59e4('0x1f')](_0x2308ea,0x0,![],null)[_0x59e4('0xd')](function(){return utils[_0x59e4('0x20')](_0x2308ea);})[_0x59e4('0xd')](function(){return _0x3d4414(null,_0x2308ea);});}}else{return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}}else{return utils[_0x59e4('0x1f')](_0x2308ea,0x0,![],null)[_0x59e4('0xd')](function(){return utils[_0x59e4('0x20')](_0x2308ea);})['then'](function(){return _0x3d4414(null,_0x2308ea);})['catch'](function(_0x2de256){return _0x3d4414(null,![],_0x2de256);});}}else{if(_0x2308ea[_0x59e4('0x13')]){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else{return utils['getLicense'](_0x2308ea)[_0x59e4('0xd')](function(){return _0x3d4414(null,_0x2308ea);});}}}});})[_0x59e4('0x21')](function(_0x1995f4){return _0x3d4414(null,![],_0x1995f4);});}function sendServiceMail(_0x1aaf83){return db[_0x59e4('0x22')][_0x59e4('0x23')]({'where':{'service':!![]},'attributes':['id',_0x59e4('0xf'),_0x59e4('0x24')],'include':[{'model':db[_0x59e4('0x25')],'as':_0x59e4('0x26')}]})['then'](function(_0x12f733){if(!_0x12f733){throw new Error(_0x59e4('0x27'));}var _0x6ce3ab={'tls':{'rejectUnauthorized':![]}};if(_0x12f733['Smtp'][_0x59e4('0x28')]){_0x6ce3ab[_0x59e4('0x28')]=_0x12f733['Smtp'][_0x59e4('0x28')];}else{_0x6ce3ab[_0x59e4('0x29')]=_0x12f733[_0x59e4('0x26')][_0x59e4('0x29')];_0x6ce3ab[_0x59e4('0x2a')]=_0x12f733[_0x59e4('0x26')][_0x59e4('0x2a')];_0x6ce3ab[_0x59e4('0x2b')]=_0x12f733['Smtp']['secure'];}if(_0x12f733[_0x59e4('0x26')][_0x59e4('0x2c')]){_0x6ce3ab[_0x59e4('0x2d')]={'user':_0x12f733[_0x59e4('0x26')]['user'],'pass':_0x12f733[_0x59e4('0x26')][_0x59e4('0x2e')]};}var _0x1dba82={'account':_0x6ce3ab,'message':_[_0x59e4('0x2f')]({'from':util[_0x59e4('0x30')](_0x59e4('0x31'),_0x12f733[_0x59e4('0xf')],_0x12f733[_0x59e4('0x24')]||_0x12f733['Smtp'][_0x59e4('0x16')])},_0x1aaf83)};return client[_0x59e4('0x32')](_0x59e4('0x33'),_0x1dba82);})['then'](function(_0x1fa04d){if(_0x1fa04d[_0x59e4('0x34')]){throw new Error(util[_0x59e4('0x30')](_0x59e4('0x35'),_0x1fa04d[_0x59e4('0x34')]['message']||JSON[_0x59e4('0x36')](_0x1fa04d[_0x59e4('0x34')])));}return!![];});}function handleError(_0xba2cd3,_0x15ef50,_0x51daa8){return _0xba2cd3['status'](_0x15ef50||0x1f4)[_0x59e4('0x37')]({'message':_0x51daa8?_0x51daa8[_0x59e4('0x38')]||_0x51daa8:''});}exports[_0x59e4('0x39')]=function(_0x107582,_0x3f312a,_0x446abf){passport[_0x59e4('0x19')]('local-login',function(_0x152553,_0x3a10a2,_0x272476){var _0x1f67a3=_0x152553||_0x272476;if(_0x1f67a3){return handleError(_0x3f312a,0x191,_0x1f67a3);}if(!_0x3a10a2){return handleError(_0x3f312a,0x194,{'message':_0x59e4('0x3a')});}else{var _0x1e4de1={'payload':{'id':_0x3a10a2['id'],'role':_0x3a10a2['role']},'options':{'expiresIn':0x15180}};return authService[_0x59e4('0x3b')](_0x1e4de1)[_0x59e4('0xd')](function(_0x50501a){_0x3f312a[_0x59e4('0x3c')]({'id':_0x3a10a2['id'],'token':_0x50501a,'statusCall':'','isAlreadyLogged':_0x3a10a2[_0x59e4('0x3d')]});});}})(_0x107582,_0x3f312a,_0x446abf);};exports['forgot']=function(_0xaab7f2,_0x286f75,_0xe52ee6){if(!_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')]){return handleError(_0x286f75,0x1f4,{'message':_0x59e4('0x3f')});}var _0x1f1ec5=rs[_0x59e4('0x40')]();_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')]=_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')][_0x59e4('0x41')]()['toLowerCase']();var _0x1ef0b3;return db[_0x59e4('0xb')][_0x59e4('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x59e4('0xc')],'raw':!![]})[_0x59e4('0xd')](function(_0x5ae684){_0x1ef0b3=_0x5ae684;return db[_0x59e4('0x42')][_0x59e4('0x23')]({'where':{'email':_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')]}});})[_0x59e4('0xd')](function(_0x627251){if(!_0x627251){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x627251['disabled']){throw new Error(_0x59e4('0x43'));}if(_0x627251[_0x59e4('0x13')]){if(moment(_0x627251[_0x59e4('0x1c')])[_0x59e4('0x1d')](_0x1ef0b3[_0x59e4('0xc')],_0x59e4('0x1e'))>moment()){throw new Error(_0x59e4('0x44'));}else{_0x627251[_0x59e4('0x13')]=![];_0x627251[_0x59e4('0x1c')]=null;}}_0x627251[_0x59e4('0x45')]=_0x1f1ec5;_0x627251['resetPasswordExpires']=Date[_0x59e4('0x46')]()+0x36ee80;return _0x627251['save']();})[_0x59e4('0xd')](function(){return sendServiceMail({'to':_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x59e4('0x47')+_0x59e4('0x48')+_0x59e4('0x49')+_0xaab7f2['headers']['host']+_0x59e4('0x4a')+_0x1f1ec5+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x59e4('0xd')](function(){_0x286f75[_0x59e4('0x4b')](0xc8)[_0x59e4('0x37')]({'message':'Reset\x20Email\x20sent!'});})[_0x59e4('0x21')](function(_0x7d9702){return handleError(_0x286f75,0x1f4,_0x7d9702);});};exports[_0x59e4('0x4c')]=function(_0x11a22f,_0x347061,_0x45112b){return db[_0x59e4('0x42')][_0x59e4('0x23')]({'where':{'resetPasswordToken':_0x11a22f[_0x59e4('0x4d')][_0x59e4('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x59e4('0x46')]()}}})[_0x59e4('0xd')](function(_0x3ac4c6){if(!_0x3ac4c6){throw new Error(_0x59e4('0x4f'));}return db[_0x59e4('0xb')]['findOne']({'attributes':['id',_0x59e4('0x50'),_0x59e4('0x51'),_0x59e4('0x52')]})[_0x59e4('0xd')](function(_0x259543){if(_0x259543[_0x59e4('0x50')])authService[_0x59e4('0x53')](_0x11a22f[_0x59e4('0x3e')][_0x59e4('0x10')]);if(!_0x259543[_0x59e4('0x51')]||!_0x3ac4c6['previousPasswords'])return _0x3ac4c6;authService['validatePasswordHistory'](_0x11a22f[_0x59e4('0x3e')][_0x59e4('0x10')],_0x3ac4c6['previousPasswords'],_0x259543[_0x59e4('0x52')]);return _0x3ac4c6;})[_0x59e4('0xd')](function(){_0x3ac4c6[_0x59e4('0x10')]=_0x11a22f['body'][_0x59e4('0x10')];_0x3ac4c6['resetPasswordToken']=null;_0x3ac4c6[_0x59e4('0x54')]=null;return _0x3ac4c6[_0x59e4('0x55')]();});})[_0x59e4('0xd')](function(){_0x347061['status'](0xc8)[_0x59e4('0x37')]({'message':_0x59e4('0x56')});})[_0x59e4('0x21')](function(_0x1b4f75){return handleError(_0x347061,0x1f4,_0x1b4f75);});};passport[_0x59e4('0x57')](_0x59e4('0x58'),new LocalStrategy({'usernameField':_0x59e4('0xf'),'passwordField':_0x59e4('0x10')},function(_0x115be8,_0x2ed853,_0x5f4eda){return localAuthenticate(db[_0x59e4('0x42')],_0x115be8,_0x2ed853,_0x5f4eda);})); \ No newline at end of file +var _0x55bc=['request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','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','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','catch','find','name','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','email'];(function(_0x5d8792,_0x4f5438){var _0x986d0e=function(_0x1d4b83){while(--_0x1d4b83){_0x5d8792['push'](_0x5d8792['shift']());}};_0x986d0e(++_0x4f5438);}(_0x55bc,0x18b));var _0xc55b=function(_0xc696f9,_0x189337){_0xc696f9=_0xc696f9-0x0;var _0x568003=_0x55bc[_0xc696f9];return _0x568003;};'use strict';var util=require(_0xc55b('0x0'));var passport=require(_0xc55b('0x1'));var LocalStrategy=require(_0xc55b('0x2'))[_0xc55b('0x3')];var jayson=require(_0xc55b('0x4'));var _=require(_0xc55b('0x5'));var rs=require('randomstring');var moment=require(_0xc55b('0x6'));var db=require(_0xc55b('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc55b('0x8'));var client=jayson[_0xc55b('0x9')][_0xc55b('0xa')]({'port':0x232b});function localAuthenticate(_0x54ab89,_0x2626f2,_0x13f783,_0x3dfb8b){var _0x487d73,_0xdec0b9;return db[_0xc55b('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xc55b('0xc'),_0xc55b('0xd')],'raw':!![]})[_0xc55b('0xe')](function(_0x1af068){_0x487d73=_0x1af068;return _0x54ab89[_0xc55b('0xf')]({'attributes':['id','name',_0xc55b('0x10'),_0xc55b('0x11'),_0xc55b('0x12'),_0xc55b('0x13'),_0xc55b('0x14'),_0xc55b('0x15'),_0xc55b('0x16')],'where':{'name':_0x2626f2,'role':{'$or':['admin',_0xc55b('0x17'),_0xc55b('0x18')]}}});})[_0xc55b('0xe')](function(_0x432cc2){if(!_0x432cc2||_0x432cc2&&_0x432cc2['name']!==_0x2626f2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xdec0b9=_0x432cc2;return _0xdec0b9;}})[_0xc55b('0xe')](function(){_0xdec0b9['authenticate'](_0x13f783,function(_0x289719,_0x2e24ab){var _0x19c132=_0xdec0b9[_0xc55b('0x16')]+0x1;if(_0x289719){return _0x3dfb8b(_0x289719);}else if(!_0x2e24ab){if(_0xdec0b9['disabled']){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else if(_0x487d73[_0xc55b('0xc')]>0x0){if(_0xdec0b9[_0xc55b('0x14')]){if(_0x487d73[_0xc55b('0xd')]>0x0){if(moment(_0xdec0b9[_0xc55b('0x15')])[_0xc55b('0x1a')](_0x487d73['blockDuration'],'minutes')>moment()){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else{return utils[_0xc55b('0x1b')](_0xdec0b9,_0x19c132,![],null)['then'](function(){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});});}}else{return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}}else{if(_0x19c132>=_0x487d73['allowedLoginAttempts']){return utils[_0xc55b('0x1b')](_0xdec0b9,0x0,!![],moment())[_0xc55b('0xe')](function(){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});});}else{return utils[_0xc55b('0x1b')](_0xdec0b9,_0x19c132,![],null)[_0xc55b('0xe')](function(){return _0x3dfb8b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}}else{if(_0xdec0b9['disabled']){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else if(_0x487d73[_0xc55b('0xc')]>0x0){if(_0xdec0b9[_0xc55b('0x14')]){if(_0x487d73[_0xc55b('0xd')]>0x0){if(moment(_0xdec0b9['blockedAt'])[_0xc55b('0x1a')](_0x487d73[_0xc55b('0xd')],_0xc55b('0x1c'))>moment()){return _0x3dfb8b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0xdec0b9,0x0,![],null)[_0xc55b('0xe')](function(){return utils[_0xc55b('0x1d')](_0xdec0b9);})[_0xc55b('0xe')](function(){return _0x3dfb8b(null,_0xdec0b9);});}}else{return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}}else{return utils[_0xc55b('0x1b')](_0xdec0b9,0x0,![],null)[_0xc55b('0xe')](function(){return utils['getLicense'](_0xdec0b9);})['then'](function(){return _0x3dfb8b(null,_0xdec0b9);})[_0xc55b('0x1e')](function(_0x55390c){return _0x3dfb8b(null,![],_0x55390c);});}}else{if(_0xdec0b9[_0xc55b('0x14')]){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else{return utils['getLicense'](_0xdec0b9)[_0xc55b('0xe')](function(){return _0x3dfb8b(null,_0xdec0b9);});}}}});})[_0xc55b('0x1e')](function(_0xeeb3ac){return _0x3dfb8b(null,![],_0xeeb3ac);});}function sendServiceMail(_0x12a3f8){return db['MailAccount'][_0xc55b('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xc55b('0x20'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xc55b('0x21')}]})[_0xc55b('0xe')](function(_0x2dadaf){if(!_0x2dadaf){throw new Error(_0xc55b('0x22'));}var _0x184f1a={'tls':{'rejectUnauthorized':![]}};if(_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x23')]){_0x184f1a[_0xc55b('0x23')]=_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x23')];}else{_0x184f1a[_0xc55b('0x24')]=_0x2dadaf['Smtp'][_0xc55b('0x24')];_0x184f1a[_0xc55b('0x25')]=_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x25')];_0x184f1a['secure']=_0x2dadaf['Smtp'][_0xc55b('0x26')];}if(_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x27')]){_0x184f1a[_0xc55b('0x28')]={'user':_0x2dadaf[_0xc55b('0x21')]['user'],'pass':_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x29')]};}var _0x514bc8={'account':_0x184f1a,'message':_[_0xc55b('0x2a')]({'from':util[_0xc55b('0x2b')]('\x22%s\x22\x20<%s>',_0x2dadaf[_0xc55b('0x20')],_0x2dadaf[_0xc55b('0x2c')]||_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x17')])},_0x12a3f8)};return client[_0xc55b('0x2d')](_0xc55b('0x2e'),_0x514bc8);})[_0xc55b('0xe')](function(_0x158c47){if(_0x158c47[_0xc55b('0x2f')]){throw new Error(util['format'](_0xc55b('0x30'),_0x158c47[_0xc55b('0x2f')][_0xc55b('0x31')]||JSON['stringify'](_0x158c47[_0xc55b('0x2f')])));}return!![];});}function handleError(_0x3fd670,_0x112e3c,_0x56fef7){return _0x3fd670[_0xc55b('0x32')](_0x112e3c||0x1f4)['send']({'message':_0x56fef7?_0x56fef7[_0xc55b('0x31')]||_0x56fef7:''});}exports[_0xc55b('0x33')]=function(_0x5aa5da,_0x132ea2,_0x215665){passport[_0xc55b('0x34')](_0xc55b('0x35'),function(_0x5f350f,_0x25405e,_0x31935d){var _0x2a783a=_0x5f350f||_0x31935d;if(_0x2a783a){return handleError(_0x132ea2,0x191,_0x2a783a);}if(!_0x25405e){return handleError(_0x132ea2,0x194,{'message':_0xc55b('0x36')});}else{var _0x2d1bba={'payload':{'id':_0x25405e['id'],'role':_0x25405e[_0xc55b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xc55b('0x37')](_0x2d1bba)[_0xc55b('0xe')](function(_0x412040){_0x132ea2['json']({'id':_0x25405e['id'],'token':_0x412040,'statusCall':'','isAlreadyLogged':_0x25405e[_0xc55b('0x38')]});});}})(_0x5aa5da,_0x132ea2,_0x215665);};exports[_0xc55b('0x39')]=function(_0x437724,_0x1fc2a3,_0x564371){if(!_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')]){return handleError(_0x1fc2a3,0x1f4,{'message':_0xc55b('0x3b')});}var _0x4dec0f=rs[_0xc55b('0x3c')]();_0x437724['body'][_0xc55b('0x2c')]=_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')]['trim']()['toLowerCase']();var _0x4d6471;return db[_0xc55b('0xb')][_0xc55b('0xf')]({'where':{'id':0x1},'attributes':[_0xc55b('0xc'),_0xc55b('0xd')],'raw':!![]})[_0xc55b('0xe')](function(_0x34fb5d){_0x4d6471=_0x34fb5d;return db[_0xc55b('0x3d')]['find']({'where':{'email':_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')]}});})[_0xc55b('0xe')](function(_0x3891cd){if(!_0x3891cd){throw new Error(_0xc55b('0x3e'));}if(_0x3891cd[_0xc55b('0x13')]){throw new Error(_0xc55b('0x3f'));}if(_0x3891cd[_0xc55b('0x14')]){if(moment(_0x3891cd['blockedAt'])[_0xc55b('0x1a')](_0x4d6471['blockDuration'],_0xc55b('0x1c'))>moment()){throw new Error(_0xc55b('0x40'));}else{_0x3891cd[_0xc55b('0x14')]=![];_0x3891cd[_0xc55b('0x15')]=null;}}_0x3891cd[_0xc55b('0x41')]=_0x4dec0f;_0x3891cd['resetPasswordExpires']=Date[_0xc55b('0x42')]()+0x36ee80;return _0x3891cd[_0xc55b('0x43')]();})[_0xc55b('0xe')](function(){return sendServiceMail({'to':_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')],'subject':_0xc55b('0x44'),'text':_0xc55b('0x45')+_0xc55b('0x46')+_0xc55b('0x47')+_0x437724['headers'][_0xc55b('0x24')]+_0xc55b('0x48')+_0x4dec0f+'\x0a\x0a'+_0xc55b('0x49')});})[_0xc55b('0xe')](function(){_0x1fc2a3['status'](0xc8)[_0xc55b('0x4a')]({'message':_0xc55b('0x4b')});})[_0xc55b('0x1e')](function(_0x11c59d){return handleError(_0x1fc2a3,0x1f4,_0x11c59d);});};exports[_0xc55b('0x4c')]=function(_0x5e3282,_0x2c71ea,_0x1deffb){return db[_0xc55b('0x3d')][_0xc55b('0x1f')]({'where':{'resetPasswordToken':_0x5e3282[_0xc55b('0x4d')][_0xc55b('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xc55b('0x42')]()}}})[_0xc55b('0xe')](function(_0x2dcdfc){if(!_0x2dcdfc){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xc55b('0xf')]({'attributes':['id',_0xc55b('0x4f'),'enforcePasswordHistory',_0xc55b('0x50')]})[_0xc55b('0xe')](function(_0x51a114){if(_0x51a114[_0xc55b('0x4f')])authService[_0xc55b('0x51')](_0x5e3282[_0xc55b('0x3a')][_0xc55b('0x10')]);if(!_0x51a114[_0xc55b('0x52')]||!_0x2dcdfc[_0xc55b('0x53')])return _0x2dcdfc;authService[_0xc55b('0x54')](_0x5e3282['body'][_0xc55b('0x10')],_0x2dcdfc[_0xc55b('0x53')],_0x51a114[_0xc55b('0x50')]);return _0x2dcdfc;})[_0xc55b('0xe')](function(){_0x2dcdfc[_0xc55b('0x10')]=_0x5e3282['body'][_0xc55b('0x10')];_0x2dcdfc[_0xc55b('0x41')]=null;_0x2dcdfc[_0xc55b('0x55')]=null;return _0x2dcdfc[_0xc55b('0x43')]();});})[_0xc55b('0xe')](function(){_0x2c71ea[_0xc55b('0x32')](0xc8)['send']({'message':_0xc55b('0x56')});})[_0xc55b('0x1e')](function(_0x1dd8d9){return handleError(_0x2c71ea,0x1f4,_0x1dd8d9);});};passport[_0xc55b('0x57')](_0xc55b('0x35'),new LocalStrategy({'usernameField':_0xc55b('0x20'),'passwordField':_0xc55b('0x10')},function(_0x30ef56,_0x80c5fb,_0x4dd6f1){return localAuthenticate(db[_0xc55b('0x3d')],_0x30ef56,_0x80c5fb,_0x4dd6f1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4dd43c3..3dd34ae 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 _0x63e5=['post','login','/forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0xc19320,_0xe54afe){var _0x33a689=function(_0x47e68f){while(--_0x47e68f){_0xc19320['push'](_0xc19320['shift']());}};_0x33a689(++_0xe54afe);}(_0x63e5,0xb5));var _0x563e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x63e5[_0x4d8ed9];return _0x1e2140;};'use strict';var express=require(_0x563e('0x0'));var router=express[_0x563e('0x1')]();var controller=require(_0x563e('0x2'));router[_0x563e('0x3')]('/',controller[_0x563e('0x4')]);router[_0x563e('0x3')](_0x563e('0x5'),controller['forgot']);router[_0x563e('0x3')]('/reset/:token',controller[_0x563e('0x6')]);module[_0x563e('0x7')]=router; \ No newline at end of file +var _0x63f7=['login','/forgot','forgot','post','/reset/:token','reset','exports','express','Router'];(function(_0x17cb3d,_0x183c94){var _0x5c2c21=function(_0x43e22d){while(--_0x43e22d){_0x17cb3d['push'](_0x17cb3d['shift']());}};_0x5c2c21(++_0x183c94);}(_0x63f7,0x178));var _0x763f=function(_0x4dd1f4,_0x5ea5f9){_0x4dd1f4=_0x4dd1f4-0x0;var _0x467a0a=_0x63f7[_0x4dd1f4];return _0x467a0a;};'use strict';var express=require(_0x763f('0x0'));var router=express[_0x763f('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x763f('0x2')]);router['post'](_0x763f('0x3'),controller[_0x763f('0x4')]);router[_0x763f('0x5')](_0x763f('0x6'),controller[_0x763f('0x7')]);module[_0x763f('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 abe0b7e..71f906a 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 _0x171a=['INTEGER','sequelize','exports','STRING'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x171a,0x119));var _0xa171=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x171a[_0x954b3a];return _0x3a313e;};'use strict';var Sequelize=require(_0xa171('0x0'));module[_0xa171('0x1')]={'name':{'type':Sequelize[_0xa171('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa171('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa171('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x2399=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x3d92b4,_0x53b21f){var _0x397b8f=function(_0x53ef38){while(--_0x53ef38){_0x3d92b4['push'](_0x3d92b4['shift']());}};_0x397b8f(++_0x53b21f);}(_0x2399,0x1aa));var _0x9239=function(_0x833312,_0x532c1c){_0x833312=_0x833312-0x0;var _0x55f830=_0x2399[_0x833312];return _0x55f830;};'use strict';var Sequelize=require(_0x9239('0x0'));module['exports']={'name':{'type':Sequelize[_0x9239('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9239('0x1')]},'status':{'type':Sequelize[_0x9239('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9239('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 6b305d5..089fff8 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 _0xf1df=['attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','catch','create','body','params','addConditions','Condition','ids','omit','findOne','order','getConditions','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','sendStatus','error','stack','name','send','map','Automation','fieldName','type','query','filters','intersection','model','fields'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0xf1df,0x120));var _0xff1d=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xf1df[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xff1d('0x0'));var rimraf=require(_0xff1d('0x1'));var zipdir=require(_0xff1d('0x2'));var jsonpatch=require(_0xff1d('0x3'));var rp=require(_0xff1d('0x4'));var moment=require(_0xff1d('0x5'));var BPromise=require(_0xff1d('0x6'));var Mustache=require('mustache');var util=require(_0xff1d('0x7'));var path=require(_0xff1d('0x8'));var sox=require(_0xff1d('0x9'));var csv=require(_0xff1d('0xa'));var ejs=require(_0xff1d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff1d('0xc'));var squel=require(_0xff1d('0xd'));var crypto=require(_0xff1d('0xe'));var jsforce=require(_0xff1d('0xf'));var deskjs=require(_0xff1d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xff1d('0x11'));var Papa=require(_0xff1d('0x12'));var Redis=require('ioredis');var authService=require(_0xff1d('0x13'));var qs=require(_0xff1d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xff1d('0x15'))(_0xff1d('0x16'));var utils=require(_0xff1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff1d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4369bd,_0x580c7d){_0x580c7d=_0x580c7d||0xcc;return function(_0x439223){if(_0x439223){return _0x4369bd['sendStatus'](_0x580c7d);}return _0x4369bd[_0xff1d('0x19')](_0x580c7d)['end']();};}function respondWithResult(_0x280a35,_0x55b5db){_0x55b5db=_0x55b5db||0xc8;return function(_0x453421){if(_0x453421){return _0x280a35[_0xff1d('0x19')](_0x55b5db)[_0xff1d('0x1a')](_0x453421);}};}function respondWithFilteredResult(_0x45db33,_0x590673){return function(_0x14af3d){if(_0x14af3d){var _0x2290ef=typeof _0x590673[_0xff1d('0x1b')]===_0xff1d('0x1c')&&typeof _0x590673[_0xff1d('0x1d')]===_0xff1d('0x1c');var _0x28ae57=_0x14af3d[_0xff1d('0x1e')];var _0x2aa8e6=_0x2290ef?0x0:_0x590673[_0xff1d('0x1b')];var _0x5cea3e=_0x2290ef?_0x14af3d[_0xff1d('0x1e')]:_0x590673[_0xff1d('0x1b')]+_0x590673[_0xff1d('0x1d')];var _0x564483;if(_0x5cea3e>=_0x28ae57){_0x5cea3e=_0x28ae57;_0x564483=0xc8;}else{_0x564483=0xce;}_0x45db33['status'](_0x564483);return _0x45db33[_0xff1d('0x1f')](_0xff1d('0x20'),_0x2aa8e6+'-'+_0x5cea3e+'/'+_0x28ae57)[_0xff1d('0x1a')](_0x14af3d);}return null;};}function patchUpdates(_0x44eaa3){return function(_0x2c7517){try{jsonpatch['apply'](_0x2c7517,_0x44eaa3,!![]);}catch(_0x482aad){return BPromise[_0xff1d('0x21')](_0x482aad);}return _0x2c7517[_0xff1d('0x22')]();};}function saveUpdates(_0x3edf61,_0x5efeff){return function(_0x19f88b){if(_0x19f88b){return _0x19f88b[_0xff1d('0x23')](_0x3edf61)[_0xff1d('0x24')](function(_0x2d5d1e){return _0x2d5d1e;});}return null;};}function removeEntity(_0x16289d,_0x52101a){return function(_0x186a91){if(_0x186a91){return _0x186a91['destroy']()[_0xff1d('0x24')](function(){_0x16289d[_0xff1d('0x19')](0xcc)[_0xff1d('0x25')]();});}};}function handleEntityNotFound(_0x17ad15,_0x583bc1){return function(_0x531970){if(!_0x531970){_0x17ad15[_0xff1d('0x26')](0x194);}return _0x531970;};}function handleError(_0xa533e,_0x35c492){_0x35c492=_0x35c492||0x1f4;return function(_0x1fd7b9){logger[_0xff1d('0x27')](_0x1fd7b9[_0xff1d('0x28')]);if(_0x1fd7b9['name']){delete _0x1fd7b9[_0xff1d('0x29')];}_0xa533e[_0xff1d('0x19')](_0x35c492)[_0xff1d('0x2a')](_0x1fd7b9);};}exports['index']=function(_0x183d7f,_0x376ff9){var _0x2cf683={},_0x25f65d={},_0xab1958={'count':0x0,'rows':[]};var _0x2c7a1e=_[_0xff1d('0x2b')](db[_0xff1d('0x2c')]['rawAttributes'],function(_0x1cc11a){return{'name':_0x1cc11a[_0xff1d('0x2d')],'type':_0x1cc11a[_0xff1d('0x2e')]['key']};});_0x25f65d['model']=_[_0xff1d('0x2b')](_0x2c7a1e,_0xff1d('0x29'));_0x25f65d['query']=_['keys'](_0x183d7f[_0xff1d('0x2f')]);_0x25f65d[_0xff1d('0x30')]=_[_0xff1d('0x31')](_0x25f65d[_0xff1d('0x32')],_0x25f65d[_0xff1d('0x2f')]);_0x2cf683['attributes']=_[_0xff1d('0x31')](_0x25f65d[_0xff1d('0x32')],qs[_0xff1d('0x33')](_0x183d7f['query'][_0xff1d('0x33')]));_0x2cf683[_0xff1d('0x34')]=_0x2cf683[_0xff1d('0x34')][_0xff1d('0x35')]?_0x2cf683['attributes']:_0x25f65d[_0xff1d('0x32')];if(!_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x36')]('nolimit')){_0x2cf683['limit']=qs[_0xff1d('0x1d')](_0x183d7f[_0xff1d('0x2f')]['limit']);_0x2cf683[_0xff1d('0x1b')]=qs['offset'](_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x1b')]);}_0x2cf683['order']=qs[_0xff1d('0x37')](_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x37')]);_0x2cf683[_0xff1d('0x38')]=qs[_0xff1d('0x30')](_[_0xff1d('0x39')](_0x183d7f[_0xff1d('0x2f')],_0x25f65d['filters']),_0x2c7a1e);if(_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x3a')]){_0x2cf683[_0xff1d('0x38')]=_[_0xff1d('0x3b')](_0x2cf683[_0xff1d('0x38')],{'$or':_[_0xff1d('0x2b')](_0x2c7a1e,function(_0x95f3fd){if(_0x95f3fd[_0xff1d('0x2e')]!==_0xff1d('0x3c')){var _0x951d11={};_0x951d11[_0x95f3fd['name']]={'$like':'%'+_0x183d7f[_0xff1d('0x2f')]['filter']+'%'};return _0x951d11;}})});}_0x2cf683=_[_0xff1d('0x3b')]({},_0x2cf683,_0x183d7f['options']);var _0x371e85={'where':_0x2cf683[_0xff1d('0x38')]};return db[_0xff1d('0x2c')][_0xff1d('0x1e')](_0x371e85)[_0xff1d('0x24')](function(_0x9d5090){_0xab1958['count']=_0x9d5090;if(_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x3d')]){_0x2cf683[_0xff1d('0x3e')]=[{'all':!![]}];}return db[_0xff1d('0x2c')][_0xff1d('0x3f')](_0x2cf683);})[_0xff1d('0x24')](function(_0x5e495c){_0xab1958[_0xff1d('0x40')]=_0x5e495c;return _0xab1958;})[_0xff1d('0x24')](respondWithFilteredResult(_0x376ff9,_0x2cf683))['catch'](handleError(_0x376ff9,null));};exports[_0xff1d('0x41')]=function(_0x1c8b22,_0x3166ec){var _0x160c8c={'raw':![],'where':{'id':_0x1c8b22['params']['id']}},_0x4d3212={};_0x4d3212['model']=_[_0xff1d('0x42')](db[_0xff1d('0x2c')][_0xff1d('0x43')]);_0x4d3212['query']=_[_0xff1d('0x42')](_0x1c8b22[_0xff1d('0x2f')]);_0x4d3212[_0xff1d('0x30')]=_[_0xff1d('0x31')](_0x4d3212['model'],_0x4d3212[_0xff1d('0x2f')]);_0x160c8c[_0xff1d('0x34')]=_[_0xff1d('0x31')](_0x4d3212['model'],qs['fields'](_0x1c8b22[_0xff1d('0x2f')][_0xff1d('0x33')]));_0x160c8c[_0xff1d('0x34')]=_0x160c8c[_0xff1d('0x34')][_0xff1d('0x35')]?_0x160c8c[_0xff1d('0x34')]:_0x4d3212[_0xff1d('0x32')];if(_0x1c8b22[_0xff1d('0x2f')][_0xff1d('0x3d')]){_0x160c8c[_0xff1d('0x3e')]=[{'all':!![]}];}_0x160c8c=_[_0xff1d('0x3b')]({},_0x160c8c,_0x1c8b22[_0xff1d('0x44')]);return db[_0xff1d('0x2c')][_0xff1d('0x45')](_0x160c8c)[_0xff1d('0x24')](handleEntityNotFound(_0x3166ec,null))['then'](respondWithResult(_0x3166ec,null))[_0xff1d('0x46')](handleError(_0x3166ec,null));};exports[_0xff1d('0x47')]=function(_0x4f43bf,_0x482810){return db[_0xff1d('0x2c')][_0xff1d('0x47')](_0x4f43bf[_0xff1d('0x48')],{})[_0xff1d('0x24')](respondWithResult(_0x482810,0xc9))[_0xff1d('0x46')](handleError(_0x482810,null));};exports['update']=function(_0x2dd719,_0x2455dc){if(_0x2dd719['body']['id']){delete _0x2dd719[_0xff1d('0x48')]['id'];}return db[_0xff1d('0x2c')]['find']({'where':{'id':_0x2dd719[_0xff1d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2455dc,null))[_0xff1d('0x24')](saveUpdates(_0x2dd719['body'],null))['then'](respondWithResult(_0x2455dc,null))['catch'](handleError(_0x2455dc,null));};exports['destroy']=function(_0x4972df,_0x455035){return db[_0xff1d('0x2c')][_0xff1d('0x45')]({'where':{'id':_0x4972df[_0xff1d('0x49')]['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x455035,null))[_0xff1d('0x24')](removeEntity(_0x455035,null))[_0xff1d('0x46')](handleError(_0x455035,null));};exports[_0xff1d('0x4a')]=function(_0x8a0dcc,_0x5ae423,_0x12a775){return db[_0xff1d('0x4b')][_0xff1d('0x45')]({'where':{'id':_0x8a0dcc['params']['id']}})['then'](handleEntityNotFound(_0x5ae423,null))[_0xff1d('0x24')](function(_0x4857a8){if(_0x4857a8){return _0x4857a8['addConditions'](_0x8a0dcc[_0xff1d('0x48')][_0xff1d('0x4c')],_[_0xff1d('0x4d')](_0x8a0dcc[_0xff1d('0x48')],[_0xff1d('0x4c'),'id'])||{});}})[_0xff1d('0x24')](respondWithResult(_0x5ae423,null))['catch'](handleError(_0x5ae423,null));};exports['getConditions']=function(_0x11ee8c,_0x52bd02,_0x1567a2){var _0x2dce28={};var _0x5a86a6={};var _0x58db6f;var _0x452948;return db['Automation'][_0xff1d('0x4e')]({'where':{'id':_0x11ee8c[_0xff1d('0x49')]['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x52bd02,null))[_0xff1d('0x24')](function(_0x30aac7){if(_0x30aac7){_0x58db6f=_0x30aac7;_0x5a86a6[_0xff1d('0x32')]=_['keys'](db[_0xff1d('0x4b')][_0xff1d('0x43')]);_0x5a86a6[_0xff1d('0x2f')]=_[_0xff1d('0x42')](_0x11ee8c[_0xff1d('0x2f')]);_0x5a86a6[_0xff1d('0x30')]=_['intersection'](_0x5a86a6['model'],_0x5a86a6[_0xff1d('0x2f')]);_0x2dce28[_0xff1d('0x34')]=_[_0xff1d('0x31')](_0x5a86a6[_0xff1d('0x32')],qs[_0xff1d('0x33')](_0x11ee8c[_0xff1d('0x2f')][_0xff1d('0x33')]));_0x2dce28[_0xff1d('0x34')]=_0x2dce28['attributes']['length']?_0x2dce28[_0xff1d('0x34')]:_0x5a86a6['model'];_0x2dce28[_0xff1d('0x4f')]=qs['sort'](_0x11ee8c['query'][_0xff1d('0x37')]);_0x2dce28[_0xff1d('0x38')]=qs[_0xff1d('0x30')](_[_0xff1d('0x39')](_0x11ee8c[_0xff1d('0x2f')],_0x5a86a6[_0xff1d('0x30')]));if(_0x11ee8c[_0xff1d('0x2f')]['filter']){_0x2dce28[_0xff1d('0x38')]=_[_0xff1d('0x3b')](_0x2dce28['where'],{'$or':_[_0xff1d('0x2b')](_0x2dce28[_0xff1d('0x34')],function(_0x2670af){var _0x4af003={};_0x4af003[_0x2670af]={'$like':'%'+_0x11ee8c[_0xff1d('0x2f')]['filter']+'%'};return _0x4af003;})});}_0x2dce28=_[_0xff1d('0x3b')]({},_0x2dce28,_0x11ee8c['options']);return _0x58db6f[_0xff1d('0x50')](_0x2dce28);}})['then'](function(_0x4dbf2f){if(_0x4dbf2f){_0x452948=_0x4dbf2f[_0xff1d('0x35')];if(!_0x11ee8c[_0xff1d('0x2f')]['hasOwnProperty'](_0xff1d('0x51'))){_0x2dce28['limit']=qs['limit'](_0x11ee8c[_0xff1d('0x2f')][_0xff1d('0x1d')]);_0x2dce28[_0xff1d('0x1b')]=qs[_0xff1d('0x1b')](_0x11ee8c['query']['offset']);}return _0x58db6f[_0xff1d('0x50')](_0x2dce28);}})[_0xff1d('0x24')](function(_0x4b43e8){if(_0x4b43e8){return _0x4b43e8?{'count':_0x452948,'rows':_0x4b43e8}:null;}})['then'](respondWithResult(_0x52bd02,null))[_0xff1d('0x46')](handleError(_0x52bd02,null));};exports[_0xff1d('0x52')]=function(_0x3e841e,_0x2bc698,_0x11a921){return db[_0xff1d('0x53')][_0xff1d('0x45')]({'where':{'id':_0x3e841e['params']['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x2bc698,null))['then'](function(_0x24e20f){if(_0x24e20f){return _0x24e20f[_0xff1d('0x52')](_0x3e841e[_0xff1d('0x48')][_0xff1d('0x4c')],_[_0xff1d('0x4d')](_0x3e841e[_0xff1d('0x48')],[_0xff1d('0x4c'),'id'])||{});}})[_0xff1d('0x24')](respondWithResult(_0x2bc698,null))[_0xff1d('0x46')](handleError(_0x2bc698,null));};exports[_0xff1d('0x54')]=function(_0x212135,_0x53a1fe,_0x4f5550){var _0x1f961c={};var _0x36af4d={};var _0x23e081;var _0x4e1398;return db['Automation'][_0xff1d('0x4e')]({'where':{'id':_0x212135['params']['id']}})['then'](handleEntityNotFound(_0x53a1fe,null))['then'](function(_0x4648da){if(_0x4648da){_0x23e081=_0x4648da;_0x36af4d[_0xff1d('0x32')]=_[_0xff1d('0x42')](db[_0xff1d('0x53')][_0xff1d('0x43')]);_0x36af4d[_0xff1d('0x2f')]=_['keys'](_0x212135[_0xff1d('0x2f')]);_0x36af4d[_0xff1d('0x30')]=_[_0xff1d('0x31')](_0x36af4d[_0xff1d('0x32')],_0x36af4d[_0xff1d('0x2f')]);_0x1f961c[_0xff1d('0x34')]=_[_0xff1d('0x31')](_0x36af4d['model'],qs[_0xff1d('0x33')](_0x212135['query']['fields']));_0x1f961c[_0xff1d('0x34')]=_0x1f961c['attributes'][_0xff1d('0x35')]?_0x1f961c['attributes']:_0x36af4d[_0xff1d('0x32')];_0x1f961c[_0xff1d('0x4f')]=qs[_0xff1d('0x37')](_0x212135[_0xff1d('0x2f')]['sort']);_0x1f961c[_0xff1d('0x38')]=qs[_0xff1d('0x30')](_['pick'](_0x212135[_0xff1d('0x2f')],_0x36af4d[_0xff1d('0x30')]));if(_0x212135[_0xff1d('0x2f')][_0xff1d('0x3a')]){_0x1f961c[_0xff1d('0x38')]=_[_0xff1d('0x3b')](_0x1f961c[_0xff1d('0x38')],{'$or':_[_0xff1d('0x2b')](_0x1f961c['attributes'],function(_0x15f37a){var _0x5c9f3f={};_0x5c9f3f[_0x15f37a]={'$like':'%'+_0x212135['query'][_0xff1d('0x3a')]+'%'};return _0x5c9f3f;})});}_0x1f961c=_['merge']({},_0x1f961c,_0x212135[_0xff1d('0x44')]);return _0x23e081[_0xff1d('0x54')](_0x1f961c);}})[_0xff1d('0x24')](function(_0x2d43fa){if(_0x2d43fa){_0x4e1398=_0x2d43fa[_0xff1d('0x35')];if(!_0x212135[_0xff1d('0x2f')][_0xff1d('0x36')](_0xff1d('0x51'))){_0x1f961c['limit']=qs[_0xff1d('0x1d')](_0x212135['query'][_0xff1d('0x1d')]);_0x1f961c[_0xff1d('0x1b')]=qs['offset'](_0x212135['query'][_0xff1d('0x1b')]);}return _0x23e081[_0xff1d('0x54')](_0x1f961c);}})[_0xff1d('0x24')](function(_0x55ded2){if(_0x55ded2){return _0x55ded2?{'count':_0x4e1398,'rows':_0x55ded2}:null;}})[_0xff1d('0x24')](respondWithResult(_0x53a1fe,null))['catch'](handleError(_0x53a1fe,null));}; \ No newline at end of file +var _0x0e42=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','options','create','body','find','params','destroy','addConditions','omit','ids','Condition','getConditions','addActions','Action','getActions','findOne','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x13e792,_0x1b23e7){var _0xcf57f7=function(_0x3350d0){while(--_0x3350d0){_0x13e792['push'](_0x13e792['shift']());}};_0xcf57f7(++_0x1b23e7);}(_0x0e42,0xf1));var _0x20e4=function(_0x14a1f6,_0x2b89ab){_0x14a1f6=_0x14a1f6-0x0;var _0x4a8aa7=_0x0e42[_0x14a1f6];return _0x4a8aa7;};'use strict';var emlformat=require(_0x20e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20e4('0x1'));var jsonpatch=require(_0x20e4('0x2'));var rp=require(_0x20e4('0x3'));var moment=require(_0x20e4('0x4'));var BPromise=require(_0x20e4('0x5'));var Mustache=require(_0x20e4('0x6'));var util=require(_0x20e4('0x7'));var path=require(_0x20e4('0x8'));var sox=require(_0x20e4('0x9'));var csv=require(_0x20e4('0xa'));var ejs=require(_0x20e4('0xb'));var fs=require('fs');var fs_extra=require(_0x20e4('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20e4('0xd'));var jsforce=require(_0x20e4('0xe'));var deskjs=require(_0x20e4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x20e4('0x10'));var Papa=require(_0x20e4('0x11'));var Redis=require(_0x20e4('0x12'));var authService=require(_0x20e4('0x13'));var qs=require(_0x20e4('0x14'));var as=require(_0x20e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20e4('0x16'))(_0x20e4('0x17'));var utils=require(_0x20e4('0x18'));var config=require(_0x20e4('0x19'));var licenseUtil=require(_0x20e4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f769,_0x3776a2){_0x3776a2=_0x3776a2||0xcc;return function(_0x2319e4){if(_0x2319e4){return _0x11f769[_0x20e4('0x1b')](_0x3776a2);}return _0x11f769[_0x20e4('0x1c')](_0x3776a2)[_0x20e4('0x1d')]();};}function respondWithResult(_0x5a7820,_0xe82ed2){_0xe82ed2=_0xe82ed2||0xc8;return function(_0x481211){if(_0x481211){return _0x5a7820['status'](_0xe82ed2)['json'](_0x481211);}};}function respondWithFilteredResult(_0x39e658,_0x124135){return function(_0x335421){if(_0x335421){var _0x41b92f=typeof _0x124135['offset']===_0x20e4('0x1e')&&typeof _0x124135['limit']===_0x20e4('0x1e');var _0x22ef4e=_0x335421['count'];var _0x41749e=_0x41b92f?0x0:_0x124135[_0x20e4('0x1f')];var _0x3f3495=_0x41b92f?_0x335421[_0x20e4('0x20')]:_0x124135['offset']+_0x124135[_0x20e4('0x21')];var _0x72d5a9;if(_0x3f3495>=_0x22ef4e){_0x3f3495=_0x22ef4e;_0x72d5a9=0xc8;}else{_0x72d5a9=0xce;}_0x39e658['status'](_0x72d5a9);return _0x39e658[_0x20e4('0x22')](_0x20e4('0x23'),_0x41749e+'-'+_0x3f3495+'/'+_0x22ef4e)[_0x20e4('0x24')](_0x335421);}return null;};}function patchUpdates(_0x1893b3){return function(_0x578fba){try{jsonpatch[_0x20e4('0x25')](_0x578fba,_0x1893b3,!![]);}catch(_0x8721d9){return BPromise[_0x20e4('0x26')](_0x8721d9);}return _0x578fba[_0x20e4('0x27')]();};}function saveUpdates(_0x2e999b,_0x34f790){return function(_0x4a0bd0){if(_0x4a0bd0){return _0x4a0bd0[_0x20e4('0x28')](_0x2e999b)[_0x20e4('0x29')](function(_0x460a81){return _0x460a81;});}return null;};}function removeEntity(_0x203dfc,_0x474497){return function(_0x43e6e9){if(_0x43e6e9){return _0x43e6e9['destroy']()[_0x20e4('0x29')](function(){_0x203dfc[_0x20e4('0x1c')](0xcc)[_0x20e4('0x1d')]();});}};}function handleEntityNotFound(_0x510a21,_0x535be0){return function(_0x34cc38){if(!_0x34cc38){_0x510a21[_0x20e4('0x1b')](0x194);}return _0x34cc38;};}function handleError(_0xda5456,_0x6d7195){_0x6d7195=_0x6d7195||0x1f4;return function(_0x4dc939){logger[_0x20e4('0x2a')](_0x4dc939[_0x20e4('0x2b')]);if(_0x4dc939[_0x20e4('0x2c')]){delete _0x4dc939[_0x20e4('0x2c')];}_0xda5456[_0x20e4('0x1c')](_0x6d7195)['send'](_0x4dc939);};}exports[_0x20e4('0x2d')]=function(_0x38ff66,_0x242b8f){var _0x44bd10={},_0x1f6eed={},_0x582f4c={'count':0x0,'rows':[]};var _0x36c6ee=_[_0x20e4('0x2e')](db[_0x20e4('0x2f')][_0x20e4('0x30')],function(_0x2de529){return{'name':_0x2de529[_0x20e4('0x31')],'type':_0x2de529[_0x20e4('0x32')][_0x20e4('0x33')]};});_0x1f6eed[_0x20e4('0x34')]=_[_0x20e4('0x2e')](_0x36c6ee,_0x20e4('0x2c'));_0x1f6eed[_0x20e4('0x35')]=_[_0x20e4('0x36')](_0x38ff66['query']);_0x1f6eed[_0x20e4('0x37')]=_[_0x20e4('0x38')](_0x1f6eed[_0x20e4('0x34')],_0x1f6eed['query']);_0x44bd10['attributes']=_[_0x20e4('0x38')](_0x1f6eed[_0x20e4('0x34')],qs[_0x20e4('0x39')](_0x38ff66[_0x20e4('0x35')][_0x20e4('0x39')]));_0x44bd10[_0x20e4('0x3a')]=_0x44bd10[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x44bd10[_0x20e4('0x3a')]:_0x1f6eed[_0x20e4('0x34')];if(!_0x38ff66[_0x20e4('0x35')][_0x20e4('0x3c')](_0x20e4('0x3d'))){_0x44bd10[_0x20e4('0x21')]=qs[_0x20e4('0x21')](_0x38ff66['query'][_0x20e4('0x21')]);_0x44bd10[_0x20e4('0x1f')]=qs[_0x20e4('0x1f')](_0x38ff66[_0x20e4('0x35')][_0x20e4('0x1f')]);}_0x44bd10['order']=qs[_0x20e4('0x3e')](_0x38ff66['query'][_0x20e4('0x3e')]);_0x44bd10[_0x20e4('0x3f')]=qs[_0x20e4('0x37')](_['pick'](_0x38ff66[_0x20e4('0x35')],_0x1f6eed[_0x20e4('0x37')]),_0x36c6ee);if(_0x38ff66[_0x20e4('0x35')][_0x20e4('0x40')]){_0x44bd10[_0x20e4('0x3f')]=_[_0x20e4('0x41')](_0x44bd10['where'],{'$or':_[_0x20e4('0x2e')](_0x36c6ee,function(_0x15d976){if(_0x15d976[_0x20e4('0x32')]!==_0x20e4('0x42')){var _0x23dacf={};_0x23dacf[_0x15d976[_0x20e4('0x2c')]]={'$like':'%'+_0x38ff66[_0x20e4('0x35')][_0x20e4('0x40')]+'%'};return _0x23dacf;}})});}_0x44bd10=_[_0x20e4('0x41')]({},_0x44bd10,_0x38ff66['options']);var _0x43efc6={'where':_0x44bd10[_0x20e4('0x3f')]};return db[_0x20e4('0x2f')][_0x20e4('0x20')](_0x43efc6)[_0x20e4('0x29')](function(_0x3b8476){_0x582f4c[_0x20e4('0x20')]=_0x3b8476;if(_0x38ff66['query'][_0x20e4('0x43')]){_0x44bd10[_0x20e4('0x44')]=[{'all':!![]}];}return db[_0x20e4('0x2f')][_0x20e4('0x45')](_0x44bd10);})[_0x20e4('0x29')](function(_0x6df77e){_0x582f4c['rows']=_0x6df77e;return _0x582f4c;})[_0x20e4('0x29')](respondWithFilteredResult(_0x242b8f,_0x44bd10))[_0x20e4('0x46')](handleError(_0x242b8f,null));};exports[_0x20e4('0x47')]=function(_0x2a84bc,_0x532b9f){var _0x158eaf={'raw':![],'where':{'id':_0x2a84bc['params']['id']}},_0x23f8d2={};_0x23f8d2[_0x20e4('0x34')]=_[_0x20e4('0x36')](db[_0x20e4('0x2f')][_0x20e4('0x30')]);_0x23f8d2['query']=_[_0x20e4('0x36')](_0x2a84bc['query']);_0x23f8d2[_0x20e4('0x37')]=_[_0x20e4('0x38')](_0x23f8d2[_0x20e4('0x34')],_0x23f8d2[_0x20e4('0x35')]);_0x158eaf['attributes']=_[_0x20e4('0x38')](_0x23f8d2['model'],qs[_0x20e4('0x39')](_0x2a84bc[_0x20e4('0x35')][_0x20e4('0x39')]));_0x158eaf['attributes']=_0x158eaf[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x158eaf[_0x20e4('0x3a')]:_0x23f8d2[_0x20e4('0x34')];if(_0x2a84bc[_0x20e4('0x35')]['includeAll']){_0x158eaf['include']=[{'all':!![]}];}_0x158eaf=_[_0x20e4('0x41')]({},_0x158eaf,_0x2a84bc[_0x20e4('0x48')]);return db['Automation']['find'](_0x158eaf)['then'](handleEntityNotFound(_0x532b9f,null))[_0x20e4('0x29')](respondWithResult(_0x532b9f,null))[_0x20e4('0x46')](handleError(_0x532b9f,null));};exports[_0x20e4('0x49')]=function(_0x2b8463,_0x3050e8){return db[_0x20e4('0x2f')][_0x20e4('0x49')](_0x2b8463['body'],{})[_0x20e4('0x29')](respondWithResult(_0x3050e8,0xc9))['catch'](handleError(_0x3050e8,null));};exports['update']=function(_0x7d1ef8,_0x55ff7c){if(_0x7d1ef8[_0x20e4('0x4a')]['id']){delete _0x7d1ef8[_0x20e4('0x4a')]['id'];}return db[_0x20e4('0x2f')][_0x20e4('0x4b')]({'where':{'id':_0x7d1ef8[_0x20e4('0x4c')]['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x55ff7c,null))[_0x20e4('0x29')](saveUpdates(_0x7d1ef8[_0x20e4('0x4a')],null))[_0x20e4('0x29')](respondWithResult(_0x55ff7c,null))[_0x20e4('0x46')](handleError(_0x55ff7c,null));};exports[_0x20e4('0x4d')]=function(_0x5eb53,_0x45265b){return db[_0x20e4('0x2f')]['find']({'where':{'id':_0x5eb53[_0x20e4('0x4c')]['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x45265b,null))[_0x20e4('0x29')](removeEntity(_0x45265b,null))[_0x20e4('0x46')](handleError(_0x45265b,null));};exports[_0x20e4('0x4e')]=function(_0xb0573f,_0x4389d0,_0x39e83d){return db['Condition'][_0x20e4('0x4b')]({'where':{'id':_0xb0573f[_0x20e4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4389d0,null))[_0x20e4('0x29')](function(_0x45b447){if(_0x45b447){return _0x45b447[_0x20e4('0x4e')](_0xb0573f[_0x20e4('0x4a')]['ids'],_[_0x20e4('0x4f')](_0xb0573f[_0x20e4('0x4a')],[_0x20e4('0x50'),'id'])||{});}})['then'](respondWithResult(_0x4389d0,null))[_0x20e4('0x46')](handleError(_0x4389d0,null));};exports['getConditions']=function(_0x4414c6,_0x370a18,_0xb7d54e){var _0x179640={};var _0x39faa8={};var _0x223ebf;var _0x132746;return db[_0x20e4('0x2f')]['findOne']({'where':{'id':_0x4414c6['params']['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x370a18,null))[_0x20e4('0x29')](function(_0x343a7b){if(_0x343a7b){_0x223ebf=_0x343a7b;_0x39faa8[_0x20e4('0x34')]=_[_0x20e4('0x36')](db[_0x20e4('0x51')][_0x20e4('0x30')]);_0x39faa8[_0x20e4('0x35')]=_[_0x20e4('0x36')](_0x4414c6['query']);_0x39faa8[_0x20e4('0x37')]=_['intersection'](_0x39faa8[_0x20e4('0x34')],_0x39faa8[_0x20e4('0x35')]);_0x179640[_0x20e4('0x3a')]=_[_0x20e4('0x38')](_0x39faa8['model'],qs[_0x20e4('0x39')](_0x4414c6[_0x20e4('0x35')][_0x20e4('0x39')]));_0x179640[_0x20e4('0x3a')]=_0x179640[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x179640[_0x20e4('0x3a')]:_0x39faa8[_0x20e4('0x34')];_0x179640['order']=qs[_0x20e4('0x3e')](_0x4414c6[_0x20e4('0x35')][_0x20e4('0x3e')]);_0x179640[_0x20e4('0x3f')]=qs[_0x20e4('0x37')](_['pick'](_0x4414c6[_0x20e4('0x35')],_0x39faa8[_0x20e4('0x37')]));if(_0x4414c6[_0x20e4('0x35')][_0x20e4('0x40')]){_0x179640[_0x20e4('0x3f')]=_['merge'](_0x179640[_0x20e4('0x3f')],{'$or':_[_0x20e4('0x2e')](_0x179640[_0x20e4('0x3a')],function(_0x287f37){var _0x814bf6={};_0x814bf6[_0x287f37]={'$like':'%'+_0x4414c6[_0x20e4('0x35')][_0x20e4('0x40')]+'%'};return _0x814bf6;})});}_0x179640=_['merge']({},_0x179640,_0x4414c6[_0x20e4('0x48')]);return _0x223ebf[_0x20e4('0x52')](_0x179640);}})[_0x20e4('0x29')](function(_0x120e71){if(_0x120e71){_0x132746=_0x120e71[_0x20e4('0x3b')];if(!_0x4414c6[_0x20e4('0x35')][_0x20e4('0x3c')](_0x20e4('0x3d'))){_0x179640[_0x20e4('0x21')]=qs['limit'](_0x4414c6['query']['limit']);_0x179640[_0x20e4('0x1f')]=qs[_0x20e4('0x1f')](_0x4414c6[_0x20e4('0x35')]['offset']);}return _0x223ebf['getConditions'](_0x179640);}})[_0x20e4('0x29')](function(_0x22e11f){if(_0x22e11f){return _0x22e11f?{'count':_0x132746,'rows':_0x22e11f}:null;}})[_0x20e4('0x29')](respondWithResult(_0x370a18,null))[_0x20e4('0x46')](handleError(_0x370a18,null));};exports[_0x20e4('0x53')]=function(_0x11bd98,_0x3418dc,_0x282fcc){return db[_0x20e4('0x54')]['find']({'where':{'id':_0x11bd98[_0x20e4('0x4c')]['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x3418dc,null))[_0x20e4('0x29')](function(_0x7ae5e0){if(_0x7ae5e0){return _0x7ae5e0['addActions'](_0x11bd98['body'][_0x20e4('0x50')],_[_0x20e4('0x4f')](_0x11bd98[_0x20e4('0x4a')],['ids','id'])||{});}})[_0x20e4('0x29')](respondWithResult(_0x3418dc,null))[_0x20e4('0x46')](handleError(_0x3418dc,null));};exports[_0x20e4('0x55')]=function(_0x51f721,_0x49c154,_0x5c96e9){var _0x4d9a49={};var _0x353bf0={};var _0x916124;var _0x67bb36;return db[_0x20e4('0x2f')][_0x20e4('0x56')]({'where':{'id':_0x51f721['params']['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x49c154,null))[_0x20e4('0x29')](function(_0x168c88){if(_0x168c88){_0x916124=_0x168c88;_0x353bf0[_0x20e4('0x34')]=_['keys'](db[_0x20e4('0x54')][_0x20e4('0x30')]);_0x353bf0[_0x20e4('0x35')]=_[_0x20e4('0x36')](_0x51f721[_0x20e4('0x35')]);_0x353bf0[_0x20e4('0x37')]=_[_0x20e4('0x38')](_0x353bf0[_0x20e4('0x34')],_0x353bf0['query']);_0x4d9a49[_0x20e4('0x3a')]=_[_0x20e4('0x38')](_0x353bf0[_0x20e4('0x34')],qs[_0x20e4('0x39')](_0x51f721[_0x20e4('0x35')]['fields']));_0x4d9a49[_0x20e4('0x3a')]=_0x4d9a49[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x4d9a49['attributes']:_0x353bf0['model'];_0x4d9a49[_0x20e4('0x57')]=qs[_0x20e4('0x3e')](_0x51f721[_0x20e4('0x35')]['sort']);_0x4d9a49[_0x20e4('0x3f')]=qs['filters'](_['pick'](_0x51f721['query'],_0x353bf0[_0x20e4('0x37')]));if(_0x51f721[_0x20e4('0x35')][_0x20e4('0x40')]){_0x4d9a49['where']=_['merge'](_0x4d9a49[_0x20e4('0x3f')],{'$or':_[_0x20e4('0x2e')](_0x4d9a49[_0x20e4('0x3a')],function(_0x1b8291){var _0x8175fd={};_0x8175fd[_0x1b8291]={'$like':'%'+_0x51f721[_0x20e4('0x35')][_0x20e4('0x40')]+'%'};return _0x8175fd;})});}_0x4d9a49=_[_0x20e4('0x41')]({},_0x4d9a49,_0x51f721[_0x20e4('0x48')]);return _0x916124[_0x20e4('0x55')](_0x4d9a49);}})[_0x20e4('0x29')](function(_0x364200){if(_0x364200){_0x67bb36=_0x364200[_0x20e4('0x3b')];if(!_0x51f721['query'][_0x20e4('0x3c')]('nolimit')){_0x4d9a49[_0x20e4('0x21')]=qs[_0x20e4('0x21')](_0x51f721[_0x20e4('0x35')][_0x20e4('0x21')]);_0x4d9a49['offset']=qs[_0x20e4('0x1f')](_0x51f721['query'][_0x20e4('0x1f')]);}return _0x916124[_0x20e4('0x55')](_0x4d9a49);}})[_0x20e4('0x29')](function(_0x9f60b0){if(_0x9f60b0){return _0x9f60b0?{'count':_0x67bb36,'rows':_0x9f60b0}:null;}})['then'](respondWithResult(_0x49c154,null))[_0x20e4('0x46')](handleError(_0x49c154,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3d6a7af..24fe615 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 _0xf874=['./automation.attributes','exports','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1eb41e,_0x4f0ee8){var _0x6d8ace=function(_0x5deada){while(--_0x5deada){_0x1eb41e['push'](_0x1eb41e['shift']());}};_0x6d8ace(++_0x4f0ee8);}(_0xf874,0x10b));var _0x4f87=function(_0x44be6e,_0x1c4d3c){_0x44be6e=_0x44be6e-0x0;var _0x8f58ba=_0xf874[_0x44be6e];return _0x8f58ba;};'use strict';var _=require(_0x4f87('0x0'));var util=require(_0x4f87('0x1'));var logger=require(_0x4f87('0x2'))('api');var moment=require(_0x4f87('0x3'));var BPromise=require(_0x4f87('0x4'));var rp=require(_0x4f87('0x5'));var fs=require('fs');var path=require(_0x4f87('0x6'));var rimraf=require(_0x4f87('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f87('0x8'));module[_0x4f87('0x9')]=function(_0x3299de,_0x19ac66){return _0x3299de['define']('Automation',attributes,{'tableName':_0x4f87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd6d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfd6d,0x1ce));var _0xdfd6=function(_0xa5f911,_0x4881a0){_0xa5f911=_0xa5f911-0x0;var _0xe3521d=_0xfd6d[_0xa5f911];return _0xe3521d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdfd6('0x0'))('api');var moment=require(_0xdfd6('0x1'));var BPromise=require(_0xdfd6('0x2'));var rp=require(_0xdfd6('0x3'));var fs=require('fs');var path=require(_0xdfd6('0x4'));var rimraf=require(_0xdfd6('0x5'));var config=require(_0xdfd6('0x6'));var attributes=require(_0xdfd6('0x7'));module[_0xdfd6('0x8')]=function(_0x10210b,_0x1a630c){return _0x10210b['define'](_0xdfd6('0x9'),attributes,{'tableName':_0xdfd6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 0f98eec..17987c2 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 _0xf277=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf277,0x1e1));var _0x7f27=function(_0x3f1250,_0x4aeaf6){_0x3f1250=_0x3f1250-0x0;var _0xd9eb25=_0xf277[_0x3f1250];return _0xd9eb25;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var moment=require('moment');var BPromise=require(_0x7f27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f27('0x3'));var db=require(_0x7f27('0x4'))['db'];var utils=require(_0x7f27('0x5'));var logger=require(_0x7f27('0x6'))(_0x7f27('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f27('0x8'));var client=jayson['client'][_0x7f27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39dcee,_0x480cd6,_0x23dbcc){return new BPromise(function(_0x25c4dc,_0x5c0dbb){return client[_0x7f27('0xa')](_0x39dcee,_0x23dbcc)[_0x7f27('0xb')](function(_0x8ecc84){logger[_0x7f27('0xc')]('Automation,\x20%s,\x20%s',_0x480cd6,'request\x20sent');logger[_0x7f27('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'),JSON[_0x7f27('0xf')](_0x8ecc84));if(_0x8ecc84[_0x7f27('0x10')]){if(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x11')]===0x1f4){logger[_0x7f27('0x10')]('Automation,\x20%s,\x20%s',_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x5c0dbb(_0x8ecc84['error'][_0x7f27('0x12')]);}logger[_0x7f27('0x10')](_0x7f27('0x13'),_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x25c4dc(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);}else{logger[_0x7f27('0xc')]('Automation,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'));_0x25c4dc(_0x8ecc84[_0x7f27('0x14')]['message']);}})[_0x7f27('0x15')](function(_0x402610){logger['error'](_0x7f27('0x13'),_0x480cd6,_0x402610);_0x5c0dbb(_0x402610);});});} \ No newline at end of file +var _0x1d63=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x1d63,0xa4));var _0x31d6=function(_0x1b2697,_0x401cc6){_0x1b2697=_0x1b2697-0x0;var _0x3e56cb=_0x1d63[_0x1b2697];return _0x3e56cb;};'use strict';var _=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var moment=require(_0x31d6('0x2'));var BPromise=require(_0x31d6('0x3'));var rs=require(_0x31d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31d6('0x5'))['db'];var utils=require(_0x31d6('0x6'));var logger=require(_0x31d6('0x7'))(_0x31d6('0x8'));var config=require(_0x31d6('0x9'));var jayson=require(_0x31d6('0xa'));var client=jayson[_0x31d6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36b549,_0x6cc83b,_0x4fee16){return new BPromise(function(_0x34a5e3,_0x2c1b36){return client['request'](_0x36b549,_0x4fee16)['then'](function(_0x4b32f8){logger[_0x31d6('0xc')](_0x31d6('0xd'),_0x6cc83b,_0x31d6('0xe'));logger['debug'](_0x31d6('0xf'),_0x6cc83b,_0x31d6('0xe'),JSON[_0x31d6('0x10')](_0x4b32f8));if(_0x4b32f8[_0x31d6('0x11')]){if(_0x4b32f8[_0x31d6('0x11')]['code']===0x1f4){logger[_0x31d6('0x11')](_0x31d6('0xd'),_0x6cc83b,_0x4b32f8[_0x31d6('0x11')][_0x31d6('0x12')]);return _0x2c1b36(_0x4b32f8[_0x31d6('0x11')][_0x31d6('0x12')]);}logger['error'](_0x31d6('0xd'),_0x6cc83b,_0x4b32f8[_0x31d6('0x11')][_0x31d6('0x12')]);return _0x34a5e3(_0x4b32f8[_0x31d6('0x11')]['message']);}else{logger[_0x31d6('0xc')]('Automation,\x20%s,\x20%s',_0x6cc83b,_0x31d6('0xe'));_0x34a5e3(_0x4b32f8[_0x31d6('0x13')][_0x31d6('0x12')]);}})[_0x31d6('0x14')](function(_0x189784){logger[_0x31d6('0x11')]('Automation,\x20%s,\x20%s',_0x6cc83b,_0x189784);_0x2c1b36(_0x189784);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 3eb1012..a2ef366 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 _0x10eb=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getConditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','destroy','exports','multer','path'];(function(_0x4ee664,_0x4e8df5){var _0x292dcb=function(_0x473f50){while(--_0x473f50){_0x4ee664['push'](_0x4ee664['shift']());}};_0x292dcb(++_0x4e8df5);}(_0x10eb,0x71));var _0xb10e=function(_0x424ecd,_0x3a8667){_0x424ecd=_0x424ecd-0x0;var _0x280e69=_0x10eb[_0x424ecd];return _0x280e69;};'use strict';var multer=require(_0xb10e('0x0'));var util=require('util');var path=require(_0xb10e('0x1'));var timeout=require(_0xb10e('0x2'));var express=require(_0xb10e('0x3'));var router=express[_0xb10e('0x4')]();var fs_extra=require(_0xb10e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb10e('0x6'));var config=require(_0xb10e('0x7'));var controller=require('./automation.controller');router['get']('/',auth[_0xb10e('0x8')](),controller[_0xb10e('0x9')]);router[_0xb10e('0xa')](_0xb10e('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0xb10e('0xc')]);router[_0xb10e('0xa')](_0xb10e('0xd'),auth[_0xb10e('0x8')](),controller[_0xb10e('0xe')]);router[_0xb10e('0xf')]('/',auth[_0xb10e('0x8')](),controller[_0xb10e('0x10')]);router[_0xb10e('0xf')]('/:id/conditions',auth[_0xb10e('0x8')](),controller[_0xb10e('0x11')]);router[_0xb10e('0xf')]('/:id/actions',auth[_0xb10e('0x8')](),controller['addActions']);router[_0xb10e('0x12')](_0xb10e('0xb'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x13')]);router[_0xb10e('0x14')](_0xb10e('0xb'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x15')]);module[_0xb10e('0x16')]=router; \ No newline at end of file +var _0x4f29=['/:id','isAuthenticated','show','getActions','post','/:id/conditions','addConditions','/:id/actions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0xe58b5,_0x48dec0){var _0x1366c6=function(_0x2df8b2){while(--_0x2df8b2){_0xe58b5['push'](_0xe58b5['shift']());}};_0x1366c6(++_0x48dec0);}(_0x4f29,0xfd));var _0x94f2=function(_0x19b121,_0x4a10a7){_0x19b121=_0x19b121-0x0;var _0x3a8c15=_0x4f29[_0x19b121];return _0x3a8c15;};'use strict';var multer=require('multer');var util=require(_0x94f2('0x0'));var path=require(_0x94f2('0x1'));var timeout=require(_0x94f2('0x2'));var express=require(_0x94f2('0x3'));var router=express[_0x94f2('0x4')]();var fs_extra=require(_0x94f2('0x5'));var auth=require(_0x94f2('0x6'));var interaction=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var controller=require(_0x94f2('0x9'));router[_0x94f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x94f2('0xa')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller[_0x94f2('0xd')]);router[_0x94f2('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x94f2('0xa')]('/:id/actions',auth[_0x94f2('0xc')](),controller[_0x94f2('0xe')]);router[_0x94f2('0xf')]('/',auth[_0x94f2('0xc')](),controller['create']);router[_0x94f2('0xf')](_0x94f2('0x10'),auth[_0x94f2('0xc')](),controller[_0x94f2('0x11')]);router[_0x94f2('0xf')](_0x94f2('0x12'),auth[_0x94f2('0xc')](),controller['addActions']);router[_0x94f2('0x13')]('/:id',auth[_0x94f2('0xc')](),controller[_0x94f2('0x14')]);router[_0x94f2('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x94f2('0x16')]);module[_0x94f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f4a2c92..e113f62 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 _0x8747=['STRING','name','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8747,0x1ba));var _0x7874=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x8747[_0x48e1ec];return _0x3b33eb;};'use strict';var Sequelize=require(_0x7874('0x0'));module[_0x7874('0x1')]={'name':{'type':Sequelize[_0x7874('0x2')],'unique':_0x7874('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7874('0x2')]},'active':{'type':Sequelize[_0x7874('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x7874('0x5')](0x4)[_0x7874('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7874('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7874('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7874('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7874('0x6')],'defaultValue':0x3,'comment':_0x7874('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7874('0xd')},'dialTimezone':{'type':Sequelize[_0x7874('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7874('0x2')],'defaultValue':_0x7874('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x7874('0xf'),_0x7874('0x10'),'onlyIfOpen'),'defaultValue':_0x7874('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7874('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7874('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7874('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7874('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7874('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7874('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7874('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7874('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7874('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7874('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7874('0x19')](_0x7874('0x1a'),_0x7874('0x1b')),'defaultValue':_0x7874('0x1a')},'dialPrefix':{'type':Sequelize[_0x7874('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7874('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7874('0x1c')},'dialCutDigit':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x24')}}; \ No newline at end of file +var _0xf161=['#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)','#Machine\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','STRING','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\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)','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)'];(function(_0x494452,_0x5b9635){var _0x456e08=function(_0xf79cd4){while(--_0xf79cd4){_0x494452['push'](_0x494452['shift']());}};_0x456e08(++_0x5b9635);}(_0xf161,0x1e2));var _0x1f16=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xf161[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require(_0x1f16('0x0'));module[_0x1f16('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1f16('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1f16('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1f16('0x4')]},'active':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1f16('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1f16('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1f16('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1f16('0xe')},'dialTimezone':{'type':Sequelize[_0x1f16('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1f16('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1f16('0xf'),_0x1f16('0x10'),'onlyIfOpen'),'defaultValue':_0x1f16('0xf')},'dialAMDActive':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':0x0,'comment':_0x1f16('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1f16('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1f16('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1f16('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f16('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1f16('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1f16('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1f16('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1f16('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f16('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1f16('0x3')](_0x1f16('0x18'),_0x1f16('0x19')),'defaultValue':_0x1f16('0x18')},'dialPrefix':{'type':Sequelize[_0x1f16('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f16('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f16('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f16('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 6214f48..de79d2c 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 _0x79f9=['role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','clone','params','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','getHopperHistories','findOne','CmHopperHistory','nolimit','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','ListId','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','all','removeLists','getBlackLists','addBlackLists','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get','IvrCampaigns','stack','name','send','map','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','create','body','user'];(function(_0x5063ad,_0x102ace){var _0x5b48cd=function(_0x29eb8a){while(--_0x29eb8a){_0x5063ad['push'](_0x5063ad['shift']());}};_0x5b48cd(++_0x102ace);}(_0x79f9,0xba));var _0x979f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x79f9[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x979f('0x0'));var rimraf=require(_0x979f('0x1'));var zipdir=require(_0x979f('0x2'));var jsonpatch=require(_0x979f('0x3'));var rp=require(_0x979f('0x4'));var moment=require('moment');var BPromise=require(_0x979f('0x5'));var Mustache=require(_0x979f('0x6'));var util=require(_0x979f('0x7'));var path=require(_0x979f('0x8'));var sox=require('sox');var csv=require(_0x979f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x979f('0xa'));var _=require('lodash');var squel=require(_0x979f('0xb'));var crypto=require('crypto');var jsforce=require(_0x979f('0xc'));var deskjs=require(_0x979f('0xd'));var toCsv=require(_0x979f('0x9'));var querystring=require('querystring');var Papa=require(_0x979f('0xe'));var Redis=require('ioredis');var authService=require(_0x979f('0xf'));var qs=require(_0x979f('0x10'));var as=require(_0x979f('0x11'));var hardwareService=require(_0x979f('0x12'));var logger=require(_0x979f('0x13'))(_0x979f('0x14'));var utils=require(_0x979f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121814,_0x5b20a6){_0x5b20a6=_0x5b20a6||0xcc;return function(_0xd60c0d){if(_0xd60c0d){return _0x121814[_0x979f('0x16')](_0x5b20a6);}return _0x121814[_0x979f('0x17')](_0x5b20a6)[_0x979f('0x18')]();};}function respondWithResult(_0x19f99a,_0xfd2fdb){_0xfd2fdb=_0xfd2fdb||0xc8;return function(_0x47f4ef){if(_0x47f4ef){return _0x19f99a['status'](_0xfd2fdb)[_0x979f('0x19')](_0x47f4ef);}};}function respondWithFilteredResult(_0x462da3,_0x492252){return function(_0x4d69f6){if(_0x4d69f6){var _0x2a6674=typeof _0x492252[_0x979f('0x1a')]===_0x979f('0x1b')&&typeof _0x492252['limit']==='undefined';var _0x5f1887=_0x4d69f6[_0x979f('0x1c')];var _0x147685=_0x2a6674?0x0:_0x492252[_0x979f('0x1a')];var _0x4a9eeb=_0x2a6674?_0x4d69f6[_0x979f('0x1c')]:_0x492252['offset']+_0x492252['limit'];var _0xfb9bf7;if(_0x4a9eeb>=_0x5f1887){_0x4a9eeb=_0x5f1887;_0xfb9bf7=0xc8;}else{_0xfb9bf7=0xce;}_0x462da3[_0x979f('0x17')](_0xfb9bf7);return _0x462da3[_0x979f('0x1d')](_0x979f('0x1e'),_0x147685+'-'+_0x4a9eeb+'/'+_0x5f1887)['json'](_0x4d69f6);}return null;};}function patchUpdates(_0x9dadaf){return function(_0x132c7c){try{jsonpatch[_0x979f('0x1f')](_0x132c7c,_0x9dadaf,!![]);}catch(_0x3922d0){return BPromise[_0x979f('0x20')](_0x3922d0);}return _0x132c7c['save']();};}function saveUpdates(_0x34269d,_0x428d56){return function(_0x57b847){if(_0x57b847){return _0x57b847['update'](_0x34269d)[_0x979f('0x21')](function(_0x44eec8){return _0x44eec8;});}return null;};}function removeEntity(_0x3ebde7,_0x4d4595){return function(_0x4400bb){if(_0x4400bb){return _0x4400bb[_0x979f('0x22')]()['then'](function(){var _0x2bf9b0=_0x4400bb[_0x979f('0x23')]({'plain':!![]});var _0x523061=_0x979f('0x24');return db['UserProfileResource'][_0x979f('0x22')]({'where':{'type':_0x523061,'resourceId':_0x2bf9b0['id']}})[_0x979f('0x21')](function(){return _0x4400bb;});})['then'](function(){_0x3ebde7[_0x979f('0x17')](0xcc)[_0x979f('0x18')]();});}};}function handleEntityNotFound(_0x429320,_0x2bf025){return function(_0x42fc1a){if(!_0x42fc1a){_0x429320[_0x979f('0x16')](0x194);}return _0x42fc1a;};}function handleError(_0x5152d8,_0x55bf0b){_0x55bf0b=_0x55bf0b||0x1f4;return function(_0x2d71bb){logger['error'](_0x2d71bb[_0x979f('0x25')]);if(_0x2d71bb[_0x979f('0x26')]){delete _0x2d71bb[_0x979f('0x26')];}_0x5152d8[_0x979f('0x17')](_0x55bf0b)[_0x979f('0x27')](_0x2d71bb);};}exports['index']=function(_0x4c8bc0,_0x59ed0f){var _0x451b4e={},_0x22bb1a={},_0x19609c={'count':0x0,'rows':[]};var _0x3a381c=_[_0x979f('0x28')](db['Campaign']['rawAttributes'],function(_0x2992e6){return{'name':_0x2992e6[_0x979f('0x29')],'type':_0x2992e6[_0x979f('0x2a')]['key']};});_0x22bb1a[_0x979f('0x2b')]=_['map'](_0x3a381c,_0x979f('0x26'));_0x22bb1a['query']=_['keys'](_0x4c8bc0['query']);_0x22bb1a[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x22bb1a[_0x979f('0x2b')],_0x22bb1a[_0x979f('0x2e')]);_0x451b4e[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x22bb1a['model'],qs[_0x979f('0x30')](_0x4c8bc0['query'][_0x979f('0x30')]));_0x451b4e[_0x979f('0x2f')]=_0x451b4e[_0x979f('0x2f')][_0x979f('0x31')]?_0x451b4e[_0x979f('0x2f')]:_0x22bb1a[_0x979f('0x2b')];if(!_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x32')]('nolimit')){_0x451b4e[_0x979f('0x33')]=qs[_0x979f('0x33')](_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x33')]);_0x451b4e['offset']=qs[_0x979f('0x1a')](_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x1a')]);}_0x451b4e[_0x979f('0x34')]=qs[_0x979f('0x35')](_0x4c8bc0[_0x979f('0x2e')]['sort']);_0x451b4e[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x4c8bc0['query'],_0x22bb1a[_0x979f('0x2c')]),_0x3a381c);if(_0x4c8bc0['query']['filter']){_0x451b4e[_0x979f('0x36')]=_[_0x979f('0x38')](_0x451b4e[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x3a381c,function(_0xf2acb1){if(_0xf2acb1[_0x979f('0x2a')]!==_0x979f('0x39')){var _0x53c7f8={};_0x53c7f8[_0xf2acb1['name']]={'$like':'%'+_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x53c7f8;}})});}_0x451b4e=_[_0x979f('0x38')]({},_0x451b4e,_0x4c8bc0[_0x979f('0x3b')]);var _0x477f2e={'where':_0x451b4e[_0x979f('0x36')]};return db[_0x979f('0x3c')][_0x979f('0x1c')](_0x477f2e)[_0x979f('0x21')](function(_0x28788c){_0x19609c[_0x979f('0x1c')]=_0x28788c;if(_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x3d')]){_0x451b4e[_0x979f('0x3e')]=[{'all':!![]}];}return db[_0x979f('0x3c')][_0x979f('0x3f')](_0x451b4e);})['then'](function(_0x2a9437){_0x19609c[_0x979f('0x40')]=_0x2a9437;return _0x19609c;})['then'](respondWithFilteredResult(_0x59ed0f,_0x451b4e))[_0x979f('0x41')](handleError(_0x59ed0f,null));};exports[_0x979f('0x42')]=function(_0x260a91,_0x4d6907){var _0x40f3c5={'raw':![],'where':{'id':_0x260a91['params']['id']}},_0x282276={};_0x282276['model']=_['keys'](db[_0x979f('0x3c')][_0x979f('0x43')]);_0x282276[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x260a91[_0x979f('0x2e')]);_0x282276[_0x979f('0x2c')]=_['intersection'](_0x282276[_0x979f('0x2b')],_0x282276[_0x979f('0x2e')]);_0x40f3c5[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x282276[_0x979f('0x2b')],qs[_0x979f('0x30')](_0x260a91[_0x979f('0x2e')][_0x979f('0x30')]));_0x40f3c5[_0x979f('0x2f')]=_0x40f3c5[_0x979f('0x2f')][_0x979f('0x31')]?_0x40f3c5[_0x979f('0x2f')]:_0x282276[_0x979f('0x2b')];if(_0x260a91[_0x979f('0x2e')]['includeAll']){_0x40f3c5['include']=[{'all':!![]}];}_0x40f3c5=_[_0x979f('0x38')]({},_0x40f3c5,_0x260a91[_0x979f('0x3b')]);return db[_0x979f('0x3c')]['find'](_0x40f3c5)[_0x979f('0x21')](handleEntityNotFound(_0x4d6907,null))[_0x979f('0x21')](respondWithResult(_0x4d6907,null))[_0x979f('0x41')](handleError(_0x4d6907,null));};exports[_0x979f('0x45')]=function(_0x48297f,_0x347afa){return db[_0x979f('0x3c')][_0x979f('0x45')](_0x48297f[_0x979f('0x46')],{})['then'](function(_0x2ee098){var _0x4853ba=_0x48297f[_0x979f('0x47')][_0x979f('0x23')]({'plain':!![]});if(!_0x4853ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4853ba[_0x979f('0x48')]===_0x979f('0x47')){var _0x1aa4f1=_0x2ee098[_0x979f('0x23')]({'plain':!![]});var _0x46a09e='IvrCampaigns';return db[_0x979f('0x49')][_0x979f('0x4a')]({'where':{'name':_0x46a09e,'userProfileId':_0x4853ba[_0x979f('0x4b')]},'raw':!![]})[_0x979f('0x21')](function(_0x53bbb6){if(_0x53bbb6&&_0x53bbb6[_0x979f('0x4c')]===0x0){return db[_0x979f('0x4d')][_0x979f('0x45')]({'name':_0x1aa4f1[_0x979f('0x26')],'resourceId':_0x1aa4f1['id'],'type':_0x53bbb6[_0x979f('0x26')],'sectionId':_0x53bbb6['id']},{})[_0x979f('0x21')](function(){return _0x2ee098;});}else{return _0x2ee098;}})[_0x979f('0x41')](function(_0x2c1e4d){logger[_0x979f('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c1e4d);throw _0x2c1e4d;});}return _0x2ee098;})['then'](respondWithResult(_0x347afa,0xc9))[_0x979f('0x41')](handleError(_0x347afa,null));};exports[_0x979f('0x4f')]=function(_0xe4cf1a,_0x36e101){var _0x1f4798={'where':{'id':_0xe4cf1a[_0x979f('0x50')]['id']}},_0x4f56e7={};_0x4f56e7[_0x979f('0x2b')]=_[_0x979f('0x44')](db['Campaign'][_0x979f('0x43')]);_0x1f4798[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x4f56e7[_0x979f('0x2b')],qs[_0x979f('0x30')](_0xe4cf1a[_0x979f('0x2e')][_0x979f('0x30')]));_0x1f4798[_0x979f('0x2f')]=_0x1f4798[_0x979f('0x2f')][_0x979f('0x31')]?_0x1f4798[_0x979f('0x2f')]:_0x4f56e7[_0x979f('0x2b')];if(_0xe4cf1a[_0x979f('0x2e')][_0x979f('0x3d')]){_0x1f4798[_0x979f('0x3e')]=[{'all':!![]}];}_0x1f4798=_[_0x979f('0x38')]({},_0x1f4798,_0xe4cf1a['options']);return db['Campaign'][_0x979f('0x4a')](_0x1f4798)[_0x979f('0x21')](handleEntityNotFound(_0x36e101,null))[_0x979f('0x21')](function(_0x489331){if(_0x489331){var _0x4b5be7=_0x489331[_0x979f('0x23')]({'plain':!![]});_0x4b5be7=qs[_0x979f('0x51')](_0x4b5be7,['id',_0x979f('0x52'),_0x979f('0x53')]);_0xe4cf1a[_0x979f('0x46')]=_['omit'](_0xe4cf1a[_0x979f('0x46')],['id',_0x979f('0x52'),_0x979f('0x53')]);return db[_0x979f('0x3c')][_0x979f('0x45')](_[_0x979f('0x38')](_0x4b5be7,_0xe4cf1a[_0x979f('0x46')]),{'include':_0xe4cf1a['query'][_0x979f('0x3d')]?[{'all':!![]}]:undefined})[_0x979f('0x21')](function(_0x142a73){var _0x57e004=_0xe4cf1a['user'][_0x979f('0x23')]({'plain':!![]});if(!_0x57e004)throw new Error(_0x979f('0x54'));if(_0x57e004[_0x979f('0x48')]===_0x979f('0x47')){var _0x446708=_0x142a73['get']({'plain':!![]});var _0x30d305='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x30d305,'userProfileId':_0x57e004[_0x979f('0x4b')]},'raw':!![]})['then'](function(_0x14fa8f){if(_0x14fa8f&&_0x14fa8f[_0x979f('0x4c')]===0x0){return db[_0x979f('0x4d')][_0x979f('0x45')]({'name':_0x446708[_0x979f('0x26')],'resourceId':_0x446708['id'],'type':_0x14fa8f[_0x979f('0x26')],'sectionId':_0x14fa8f['id']},{})[_0x979f('0x21')](function(){return _0x142a73;});}else{return _0x142a73;}})[_0x979f('0x41')](function(_0x2b82ea){logger[_0x979f('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b82ea);throw _0x2b82ea;});}return _0x142a73;});}})[_0x979f('0x21')](respondWithResult(_0x36e101,0xc9))['catch'](handleError(_0x36e101,null));};exports['update']=function(_0x3e3c54,_0x221295){if(_0x3e3c54[_0x979f('0x46')]['id']){delete _0x3e3c54[_0x979f('0x46')]['id'];}return db['Campaign'][_0x979f('0x4a')]({'where':{'id':_0x3e3c54['params']['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x221295,null))[_0x979f('0x21')](saveUpdates(_0x3e3c54[_0x979f('0x46')],null))[_0x979f('0x21')](respondWithResult(_0x221295,null))['catch'](handleError(_0x221295,null));};exports[_0x979f('0x22')]=function(_0x2cc00d,_0x2b306f){return db[_0x979f('0x3c')][_0x979f('0x4a')]({'where':{'id':_0x2cc00d['params']['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x2b306f,null))[_0x979f('0x21')](removeEntity(_0x2b306f,null))['catch'](handleError(_0x2b306f,null));};exports[_0x979f('0x55')]=function(_0x29166d,_0x1c3c73,_0x5c2b66){var _0x1580e0={'raw':!![],'where':{}};var _0x3a67cb={};var _0x451981={'count':0x0,'rows':[]};return db[_0x979f('0x3c')]['findOne']({'where':{'id':_0x29166d[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x1c3c73,null))[_0x979f('0x21')](function(_0x3ed354){if(_0x3ed354){_0x3a67cb[_0x979f('0x2b')]=_['keys'](db['CmHopper'][_0x979f('0x43')]);_0x3a67cb[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x29166d[_0x979f('0x2e')]);_0x3a67cb[_0x979f('0x2c')]=_['intersection'](_0x3a67cb['model'],_0x3a67cb[_0x979f('0x2e')]);_0x1580e0[_0x979f('0x2f')]=_['intersection'](_0x3a67cb['model'],qs['fields'](_0x29166d['query']['fields']));_0x1580e0[_0x979f('0x2f')]=_0x1580e0['attributes']['length']?_0x1580e0[_0x979f('0x2f')]:_0x3a67cb[_0x979f('0x2b')];if(!_0x29166d[_0x979f('0x2e')][_0x979f('0x32')]('nolimit')){_0x1580e0[_0x979f('0x33')]=qs[_0x979f('0x33')](_0x29166d[_0x979f('0x2e')][_0x979f('0x33')]);_0x1580e0[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x29166d['query'][_0x979f('0x1a')]);}_0x1580e0['order']=qs['sort'](_0x29166d[_0x979f('0x2e')][_0x979f('0x35')]);_0x1580e0[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x29166d[_0x979f('0x2e')],_0x3a67cb[_0x979f('0x2c')]));_0x1580e0[_0x979f('0x36')]['CampaignId']=_0x3ed354['id'];if(_0x29166d['query'][_0x979f('0x3a')]){_0x1580e0[_0x979f('0x36')]=_[_0x979f('0x38')](_0x1580e0[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x1580e0[_0x979f('0x2f')],function(_0x481b06){var _0x3d0e0a={};_0x3d0e0a[_0x481b06]={'$like':'%'+_0x29166d[_0x979f('0x2e')]['filter']+'%'};return _0x3d0e0a;})});}_0x1580e0=_['merge']({},_0x1580e0,_0x29166d[_0x979f('0x3b')]);return db['CmHopper'][_0x979f('0x1c')]({'where':_0x1580e0[_0x979f('0x36')]})[_0x979f('0x21')](function(_0x520d66){_0x451981['count']=_0x520d66;if(_0x29166d[_0x979f('0x2e')]['includeAll']){_0x1580e0[_0x979f('0x3e')]=[{'all':!![]}];}return db[_0x979f('0x56')][_0x979f('0x3f')](_0x1580e0);})['then'](function(_0x57ace4){_0x451981[_0x979f('0x40')]=_0x57ace4;return _0x451981;});}})[_0x979f('0x21')](respondWithFilteredResult(_0x1c3c73,_0x1580e0))[_0x979f('0x41')](handleError(_0x1c3c73,null));};exports[_0x979f('0x57')]=function(_0xa60531,_0x32d3c5,_0x248716){var _0x134aeb={'raw':!![],'where':{}};var _0x12e182={};var _0x32026f={'count':0x0,'rows':[]};return db['Campaign'][_0x979f('0x58')]({'where':{'id':_0xa60531[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x32d3c5,null))['then'](function(_0x4b6340){if(_0x4b6340){_0x12e182[_0x979f('0x2b')]=_[_0x979f('0x44')](db[_0x979f('0x59')][_0x979f('0x43')]);_0x12e182['query']=_[_0x979f('0x44')](_0xa60531['query']);_0x12e182[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x12e182['model'],_0x12e182['query']);_0x134aeb[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x12e182[_0x979f('0x2b')],qs[_0x979f('0x30')](_0xa60531[_0x979f('0x2e')][_0x979f('0x30')]));_0x134aeb[_0x979f('0x2f')]=_0x134aeb[_0x979f('0x2f')][_0x979f('0x31')]?_0x134aeb[_0x979f('0x2f')]:_0x12e182[_0x979f('0x2b')];if(!_0xa60531['query'][_0x979f('0x32')](_0x979f('0x5a'))){_0x134aeb[_0x979f('0x33')]=qs[_0x979f('0x33')](_0xa60531['query'][_0x979f('0x33')]);_0x134aeb['offset']=qs[_0x979f('0x1a')](_0xa60531[_0x979f('0x2e')][_0x979f('0x1a')]);}_0x134aeb['order']=qs['sort'](_0xa60531[_0x979f('0x2e')][_0x979f('0x35')]);_0x134aeb[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0xa60531['query'],_0x12e182[_0x979f('0x2c')]));_0x134aeb['where'][_0x979f('0x5b')]=_0x4b6340['id'];if(_0xa60531[_0x979f('0x2e')]['filter']){_0x134aeb[_0x979f('0x36')]=_[_0x979f('0x38')](_0x134aeb[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x134aeb[_0x979f('0x2f')],function(_0x5d8801){var _0x24cf23={};_0x24cf23[_0x5d8801]={'$like':'%'+_0xa60531[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x24cf23;})});}_0x134aeb=_[_0x979f('0x38')]({},_0x134aeb,_0xa60531[_0x979f('0x3b')]);return db[_0x979f('0x59')][_0x979f('0x1c')]({'where':_0x134aeb[_0x979f('0x36')]})['then'](function(_0x27b03b){_0x32026f[_0x979f('0x1c')]=_0x27b03b;if(_0xa60531[_0x979f('0x2e')][_0x979f('0x3d')]){_0x134aeb['include']=[{'all':!![]}];}return db[_0x979f('0x59')][_0x979f('0x3f')](_0x134aeb);})[_0x979f('0x21')](function(_0x474f21){_0x32026f[_0x979f('0x40')]=_0x474f21;return _0x32026f;});}})[_0x979f('0x21')](respondWithFilteredResult(_0x32d3c5,_0x134aeb))[_0x979f('0x41')](handleError(_0x32d3c5,null));};exports[_0x979f('0x5c')]=function(_0x45f724,_0x51a16e,_0x4cfe86){var _0x1edfb6={'raw':!![],'where':{}};var _0xb35d43={};var _0x3e5e13={'count':0x0,'rows':[]};return db[_0x979f('0x3c')][_0x979f('0x58')]({'where':{'id':_0x45f724[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x51a16e,null))[_0x979f('0x21')](function(_0x12adda){if(_0x12adda){_0xb35d43[_0x979f('0x2b')]=_['keys'](db['CmHopperFinal'][_0x979f('0x43')]);_0xb35d43[_0x979f('0x2e')]=_['keys'](_0x45f724[_0x979f('0x2e')]);_0xb35d43['filters']=_[_0x979f('0x2d')](_0xb35d43[_0x979f('0x2b')],_0xb35d43[_0x979f('0x2e')]);_0x1edfb6['attributes']=_['intersection'](_0xb35d43['model'],qs[_0x979f('0x30')](_0x45f724[_0x979f('0x2e')]['fields']));_0x1edfb6['attributes']=_0x1edfb6[_0x979f('0x2f')][_0x979f('0x31')]?_0x1edfb6[_0x979f('0x2f')]:_0xb35d43[_0x979f('0x2b')];if(!_0x45f724[_0x979f('0x2e')][_0x979f('0x32')](_0x979f('0x5a'))){_0x1edfb6['limit']=qs[_0x979f('0x33')](_0x45f724[_0x979f('0x2e')][_0x979f('0x33')]);_0x1edfb6[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x45f724['query']['offset']);}_0x1edfb6[_0x979f('0x34')]=qs[_0x979f('0x35')](_0x45f724['query'][_0x979f('0x35')]);_0x1edfb6['where']=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x45f724[_0x979f('0x2e')],_0xb35d43[_0x979f('0x2c')]));_0x1edfb6[_0x979f('0x36')][_0x979f('0x5b')]=_0x12adda['id'];if(_0x45f724[_0x979f('0x2e')][_0x979f('0x3a')]){_0x1edfb6['where']=_[_0x979f('0x38')](_0x1edfb6['where'],{'$or':_[_0x979f('0x28')](_0x1edfb6['attributes'],function(_0x36dd4){var _0x53db6a={};_0x53db6a[_0x36dd4]={'$like':'%'+_0x45f724[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x53db6a;})});}_0x1edfb6=_['merge']({},_0x1edfb6,_0x45f724[_0x979f('0x3b')]);return db[_0x979f('0x5d')][_0x979f('0x1c')]({'where':_0x1edfb6[_0x979f('0x36')]})[_0x979f('0x21')](function(_0x169ed7){_0x3e5e13['count']=_0x169ed7;if(_0x45f724[_0x979f('0x2e')][_0x979f('0x3d')]){_0x1edfb6[_0x979f('0x3e')]=[{'all':!![]}];}return db[_0x979f('0x5d')][_0x979f('0x3f')](_0x1edfb6);})['then'](function(_0x41d676){_0x3e5e13[_0x979f('0x40')]=_0x41d676;return _0x3e5e13;});}})['then'](respondWithFilteredResult(_0x51a16e,_0x1edfb6))[_0x979f('0x41')](handleError(_0x51a16e,null));};exports['getHopperBlacks']=function(_0x26f04f,_0x426d4b,_0x586ada){var _0x273007={'raw':!![],'where':{}};var _0x154ae4={};var _0xa864a7={'count':0x0,'rows':[]};return db[_0x979f('0x3c')][_0x979f('0x58')]({'where':{'id':_0x26f04f[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x426d4b,null))['then'](function(_0x566546){if(_0x566546){_0x154ae4[_0x979f('0x2b')]=_[_0x979f('0x44')](db[_0x979f('0x5e')]['rawAttributes']);_0x154ae4[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x26f04f[_0x979f('0x2e')]);_0x154ae4[_0x979f('0x2c')]=_['intersection'](_0x154ae4[_0x979f('0x2b')],_0x154ae4[_0x979f('0x2e')]);_0x273007[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x154ae4[_0x979f('0x2b')],qs['fields'](_0x26f04f[_0x979f('0x2e')][_0x979f('0x30')]));_0x273007[_0x979f('0x2f')]=_0x273007[_0x979f('0x2f')][_0x979f('0x31')]?_0x273007[_0x979f('0x2f')]:_0x154ae4['model'];if(!_0x26f04f[_0x979f('0x2e')]['hasOwnProperty'](_0x979f('0x5a'))){_0x273007[_0x979f('0x33')]=qs['limit'](_0x26f04f[_0x979f('0x2e')][_0x979f('0x33')]);_0x273007[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x26f04f['query'][_0x979f('0x1a')]);}_0x273007['order']=qs['sort'](_0x26f04f[_0x979f('0x2e')]['sort']);_0x273007['where']=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x26f04f[_0x979f('0x2e')],_0x154ae4['filters']));_0x273007[_0x979f('0x36')]['CampaignId']=_0x566546['id'];if(_0x26f04f[_0x979f('0x2e')]['filter']){_0x273007[_0x979f('0x36')]=_[_0x979f('0x38')](_0x273007[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x273007[_0x979f('0x2f')],function(_0xc26bd6){var _0x2ff3d1={};_0x2ff3d1[_0xc26bd6]={'$like':'%'+_0x26f04f['query'][_0x979f('0x3a')]+'%'};return _0x2ff3d1;})});}_0x273007=_['merge']({},_0x273007,_0x26f04f[_0x979f('0x3b')]);return db[_0x979f('0x5e')]['count']({'where':_0x273007[_0x979f('0x36')]})[_0x979f('0x21')](function(_0x2b537e){_0xa864a7[_0x979f('0x1c')]=_0x2b537e;if(_0x26f04f[_0x979f('0x2e')][_0x979f('0x3d')]){_0x273007['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x979f('0x3f')](_0x273007);})[_0x979f('0x21')](function(_0x3798f0){_0xa864a7[_0x979f('0x40')]=_0x3798f0;return _0xa864a7;});}})['then'](respondWithFilteredResult(_0x426d4b,_0x273007))[_0x979f('0x41')](handleError(_0x426d4b,null));};exports['getLists']=function(_0x5c996c,_0x5043f2,_0xaeaaef){var _0x12ea8e={};var _0x39cb27={};var _0x280d26;var _0x3d7ec4;return db[_0x979f('0x3c')][_0x979f('0x58')]({'where':{'id':_0x5c996c['params']['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x5043f2,null))[_0x979f('0x21')](function(_0xe69a09){if(_0xe69a09){_0x280d26=_0xe69a09;_0x39cb27[_0x979f('0x2b')]=_[_0x979f('0x44')](db[_0x979f('0x5f')][_0x979f('0x43')]);_0x39cb27[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x5c996c[_0x979f('0x2e')]);_0x39cb27[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x39cb27[_0x979f('0x2b')],_0x39cb27[_0x979f('0x2e')]);_0x12ea8e[_0x979f('0x2f')]=_['intersection'](_0x39cb27['model'],qs[_0x979f('0x30')](_0x5c996c[_0x979f('0x2e')]['fields']));_0x12ea8e[_0x979f('0x2f')]=_0x12ea8e['attributes'][_0x979f('0x31')]?_0x12ea8e[_0x979f('0x2f')]:_0x39cb27['model'];_0x12ea8e['order']=qs[_0x979f('0x35')](_0x5c996c[_0x979f('0x2e')][_0x979f('0x35')]);_0x12ea8e[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x5c996c[_0x979f('0x2e')],_0x39cb27[_0x979f('0x2c')]));if(_0x5c996c['query'][_0x979f('0x3a')]){_0x12ea8e['where']=_[_0x979f('0x38')](_0x12ea8e[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x12ea8e[_0x979f('0x2f')],function(_0x462e5e){var _0x55683e={};_0x55683e[_0x462e5e]={'$like':'%'+_0x5c996c[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x55683e;})});}_0x12ea8e=_[_0x979f('0x38')]({},_0x12ea8e,_0x5c996c[_0x979f('0x3b')]);return _0x280d26[_0x979f('0x60')](_0x12ea8e);}})[_0x979f('0x21')](function(_0xcd4325){if(_0xcd4325){_0x3d7ec4=_0xcd4325[_0x979f('0x31')];if(!_0x5c996c[_0x979f('0x2e')]['hasOwnProperty'](_0x979f('0x5a'))){_0x12ea8e[_0x979f('0x33')]=qs[_0x979f('0x33')](_0x5c996c['query'][_0x979f('0x33')]);_0x12ea8e[_0x979f('0x1a')]=qs['offset'](_0x5c996c['query'][_0x979f('0x1a')]);}return _0x280d26['getLists'](_0x12ea8e);}})[_0x979f('0x21')](function(_0x32885d){if(_0x32885d){return _0x32885d?{'count':_0x3d7ec4,'rows':_0x32885d}:null;}})[_0x979f('0x21')](respondWithResult(_0x5043f2,null))[_0x979f('0x41')](handleError(_0x5043f2,null));};exports[_0x979f('0x61')]=function(_0x40d3e5,_0x5a7c70,_0x52cacc){var _0x462124,_0x20e519;return db[_0x979f('0x3c')][_0x979f('0x4a')]({'where':{'id':_0x40d3e5[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x5a7c70,null))[_0x979f('0x21')](function(_0x10976d){if(_0x10976d){_0x20e519=_0x10976d;return _0x10976d[_0x979f('0x61')](_0x40d3e5[_0x979f('0x46')]['ids'],_[_0x979f('0x51')](_0x40d3e5[_0x979f('0x46')],[_0x979f('0x62'),'id'])||{});}return null;})[_0x979f('0x63')](function(_0x46b374){var _0x5c094a;_0x462124=_0x46b374||[];var _0x19df1e=[];if(_0x46b374){for(var _0x557ce9=0x0;_0x557ce9<_0x46b374[_0x979f('0x31')];_0x557ce9+=0x1){var _0x20e4af=_0x46b374[_0x557ce9][_0x979f('0x23')]({'plain':!![]});_0x20e519['dialCheckDuplicateType']=_0x40d3e5[_0x979f('0x46')][_0x979f('0x64')]?_0x40d3e5[_0x979f('0x46')][_0x979f('0x64')]:_0x20e519[_0x979f('0x64')];switch(_0x20e519[_0x979f('0x64')]){case'always':_0x5c094a=squel[_0x979f('0x65')]()[_0x979f('0x66')](_0x979f('0x67'))[_0x979f('0x68')]([_0x979f('0x69'),_0x979f('0x6a'),_0x979f('0x6b'),'ListId',_0x979f('0x5b'),'createdAt',_0x979f('0x53')],squel[_0x979f('0x6c')]()[_0x979f('0x6d')](_0x979f('0x69'),'phone')[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x6a'))['field']('id','ContactId')['field'](_0x20e4af['CmListId']['toString'](),_0x979f('0x6f'))['field'](_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')](),'CampaignId')[_0x979f('0x6d')](_0x979f('0x6e'),'createdAt')['field'](_0x979f('0x6e'),_0x979f('0x53'))[_0x979f('0x71')](_0x979f('0x72'))[_0x979f('0x36')]('deletedAt\x20IS\x20NULL')['where'](_0x979f('0x73'),_0x20e4af[_0x979f('0x74')][_0x979f('0x70')]())[_0x979f('0x36')](_0x979f('0x75'))[_0x979f('0x36')](_0x979f('0x76'),squel[_0x979f('0x6c')]()[_0x979f('0x6d')](_0x979f('0x77'))[_0x979f('0x71')]('cm_hopper_final')[_0x979f('0x36')](_0x979f('0x78'),_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')]()))[_0x979f('0x36')](_0x979f('0x76'),squel[_0x979f('0x6c')]()['field'](_0x979f('0x79'))[_0x979f('0x71')](_0x979f('0x67'))[_0x979f('0x36')](_0x979f('0x78'),_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')]())))[_0x979f('0x70')]();break;case'onlyIfOpen':_0x5c094a=squel[_0x979f('0x65')]()['into'](_0x979f('0x67'))['fromQuery'](['phone',_0x979f('0x6a'),_0x979f('0x6b'),'ListId',_0x979f('0x5b'),_0x979f('0x52'),_0x979f('0x53')],squel[_0x979f('0x6c')]()[_0x979f('0x6d')](_0x979f('0x69'),_0x979f('0x69'))[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x6a'))['field']('id',_0x979f('0x6b'))['field'](_0x20e4af[_0x979f('0x74')]['toString'](),_0x979f('0x6f'))[_0x979f('0x6d')](_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')](),_0x979f('0x5b'))[_0x979f('0x6d')]('NOW()','createdAt')[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x53'))[_0x979f('0x71')]('cm_contacts')['where'](_0x979f('0x7a'))['where']('ListId\x20=\x20?',_0x20e4af[_0x979f('0x74')][_0x979f('0x70')]())[_0x979f('0x36')](_0x979f('0x75'))[_0x979f('0x36')](_0x979f('0x76'),squel['select']()[_0x979f('0x6d')](_0x979f('0x79'))[_0x979f('0x71')](_0x979f('0x67'))[_0x979f('0x36')](_0x979f('0x78'),_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')]())))[_0x979f('0x70')]();break;default:_0x5c094a=squel[_0x979f('0x65')]()[_0x979f('0x66')](_0x979f('0x67'))[_0x979f('0x68')](['phone',_0x979f('0x6a'),_0x979f('0x6b'),'ListId',_0x979f('0x5b'),_0x979f('0x52'),_0x979f('0x53')],squel[_0x979f('0x6c')]()[_0x979f('0x6d')]('phone','phone')['field'](_0x979f('0x6e'),'scheduledAt')[_0x979f('0x6d')]('id','ContactId')['field'](_0x20e4af[_0x979f('0x74')][_0x979f('0x70')](),_0x979f('0x6f'))['field'](_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')](),_0x979f('0x5b'))[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x52'))[_0x979f('0x6d')]('NOW()',_0x979f('0x53'))[_0x979f('0x71')](_0x979f('0x72'))[_0x979f('0x36')](_0x979f('0x7a'))['where']('ListId\x20=\x20?',_0x20e4af[_0x979f('0x74')][_0x979f('0x70')]())['where'](_0x979f('0x75')))[_0x979f('0x70')]();}_0x19df1e['push'](db['sequelize'][_0x979f('0x2e')](_0x5c094a));}return BPromise[_0x979f('0x7b')](_0x19df1e);}})['then'](function(){return _0x462124;})[_0x979f('0x21')](respondWithResult(_0x5a7c70,null))[_0x979f('0x41')](handleError(_0x5a7c70,null));};exports[_0x979f('0x7c')]=function(_0x521e80,_0x2f2f8b,_0x6cbb07){return db[_0x979f('0x3c')][_0x979f('0x4a')]({'where':{'id':_0x521e80[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f2f8b,null))[_0x979f('0x21')](function(_0x29d740){if(_0x29d740){return _0x29d740['removeLists'](_0x521e80[_0x979f('0x2e')][_0x979f('0x62')]);}})[_0x979f('0x21')](function(_0x489c47){if(_0x489c47){return db['CmHopper']['destroy']({'where':{'ListId':_0x521e80['query'][_0x979f('0x62')],'CampaignId':_0x521e80[_0x979f('0x50')]['id']}})['then'](function(){return _0x489c47;});}})[_0x979f('0x21')](respondWithStatusCode(_0x2f2f8b,null))['catch'](handleError(_0x2f2f8b,null));};exports['getBlackLists']=function(_0x55607e,_0x316530,_0x2ae8ed){var _0x504360={};var _0x220f01={};var _0x8500c3;var _0x194c04;return db['Campaign']['findOne']({'where':{'id':_0x55607e[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x316530,null))[_0x979f('0x21')](function(_0x2653f2){if(_0x2653f2){_0x8500c3=_0x2653f2;_0x220f01['model']=_[_0x979f('0x44')](db['CmList']['rawAttributes']);_0x220f01[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x55607e['query']);_0x220f01[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x220f01[_0x979f('0x2b')],_0x220f01[_0x979f('0x2e')]);_0x504360[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x220f01['model'],qs[_0x979f('0x30')](_0x55607e['query'][_0x979f('0x30')]));_0x504360[_0x979f('0x2f')]=_0x504360[_0x979f('0x2f')]['length']?_0x504360[_0x979f('0x2f')]:_0x220f01[_0x979f('0x2b')];_0x504360['order']=qs[_0x979f('0x35')](_0x55607e['query'][_0x979f('0x35')]);_0x504360[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x55607e['query'],_0x220f01[_0x979f('0x2c')]));if(_0x55607e['query'][_0x979f('0x3a')]){_0x504360['where']=_[_0x979f('0x38')](_0x504360['where'],{'$or':_['map'](_0x504360['attributes'],function(_0x518b44){var _0x2ae1a7={};_0x2ae1a7[_0x518b44]={'$like':'%'+_0x55607e['query'][_0x979f('0x3a')]+'%'};return _0x2ae1a7;})});}_0x504360=_[_0x979f('0x38')]({},_0x504360,_0x55607e[_0x979f('0x3b')]);return _0x8500c3[_0x979f('0x7d')](_0x504360);}})[_0x979f('0x21')](function(_0x3823e5){if(_0x3823e5){_0x194c04=_0x3823e5[_0x979f('0x31')];if(!_0x55607e[_0x979f('0x2e')]['hasOwnProperty'](_0x979f('0x5a'))){_0x504360['limit']=qs[_0x979f('0x33')](_0x55607e[_0x979f('0x2e')][_0x979f('0x33')]);_0x504360[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x55607e[_0x979f('0x2e')]['offset']);}return _0x8500c3[_0x979f('0x7d')](_0x504360);}})[_0x979f('0x21')](function(_0x5982e9){if(_0x5982e9){return _0x5982e9?{'count':_0x194c04,'rows':_0x5982e9}:null;}})[_0x979f('0x21')](respondWithResult(_0x316530,null))[_0x979f('0x41')](handleError(_0x316530,null));};exports[_0x979f('0x7e')]=function(_0x3fdffe,_0x5ae648,_0x4db4a1){var _0x163e34,_0x35dac6;return db['Campaign'][_0x979f('0x4a')]({'where':{'id':_0x3fdffe[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x5ae648,null))[_0x979f('0x21')](function(_0x199f6d){if(_0x199f6d){_0x35dac6=_0x199f6d;return _0x199f6d['addBlackLists'](_0x3fdffe[_0x979f('0x46')]['ids'],_['omit'](_0x3fdffe[_0x979f('0x46')],[_0x979f('0x62'),'id'])||{});}return null;})[_0x979f('0x63')](function(_0x5013b3){var _0x2cf78a;_0x163e34=_0x5013b3||[];var _0xa7069a=[];if(_0x5013b3){for(var _0x53910a=0x0;_0x53910a<_0x5013b3[_0x979f('0x31')];_0x53910a+=0x1){var _0x133ae5=_0x5013b3[_0x53910a][_0x979f('0x23')]({'plain':!![]});_0x2cf78a=squel[_0x979f('0x65')]()[_0x979f('0x66')]('cm_hopper_black')[_0x979f('0x68')](['phone','ContactId',_0x979f('0x6f'),'CampaignId',_0x979f('0x52'),_0x979f('0x53')],squel['select']()['field'](_0x979f('0x69'),_0x979f('0x69'))['field']('id','ContactId')['field'](_0x133ae5[_0x979f('0x74')][_0x979f('0x70')](),_0x979f('0x6f'))[_0x979f('0x6d')](_0x3fdffe[_0x979f('0x50')]['id'][_0x979f('0x70')](),_0x979f('0x5b'))[_0x979f('0x6d')](_0x979f('0x6e'),'createdAt')[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x53'))['from'](_0x979f('0x72'))[_0x979f('0x36')](_0x979f('0x7a'))['where'](_0x979f('0x73'),_0x133ae5['CmListId'][_0x979f('0x70')]())[_0x979f('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0x979f('0x70')]();_0xa7069a['push'](db[_0x979f('0x7f')][_0x979f('0x2e')](_0x2cf78a));}return BPromise['all'](_0xa7069a);}})[_0x979f('0x21')](function(){return _0x163e34;})['then'](respondWithResult(_0x5ae648,null))['catch'](handleError(_0x5ae648,null));};exports['removeBlackLists']=function(_0x30a3ac,_0x3283ea,_0x568df0){return db['Campaign'][_0x979f('0x4a')]({'where':{'id':_0x30a3ac[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x3283ea,null))[_0x979f('0x21')](function(_0x293e0a){if(_0x293e0a){return _0x293e0a[_0x979f('0x80')](_0x30a3ac['query'][_0x979f('0x62')]);}})[_0x979f('0x21')](function(_0x39b6f4){if(_0x39b6f4){return db[_0x979f('0x5e')][_0x979f('0x22')]({'where':{'ListId':_0x30a3ac['query'][_0x979f('0x62')],'CampaignId':_0x30a3ac[_0x979f('0x50')]['id']}})[_0x979f('0x21')](function(){return _0x39b6f4;});}})[_0x979f('0x21')](respondWithStatusCode(_0x3283ea,null))[_0x979f('0x41')](handleError(_0x3283ea,null));}; \ No newline at end of file +var _0x2a37=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','IvrCampaigns','UserProfileResource','destroy','end','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Campaign','include','findAll','rows','show','params','find','catch','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getHoppers','CmHopper','pick','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','rawAttributes','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x438c94,_0x59a291){var _0x43defa=function(_0x207ac5){while(--_0x207ac5){_0x438c94['push'](_0x438c94['shift']());}};_0x43defa(++_0x59a291);}(_0x2a37,0x10b));var _0x72a3=function(_0x2216c2,_0x4b504a){_0x2216c2=_0x2216c2-0x0;var _0xda7f7c=_0x2a37[_0x2216c2];return _0xda7f7c;};'use strict';var emlformat=require(_0x72a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72a3('0x1'));var jsonpatch=require(_0x72a3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x72a3('0x3'));var Mustache=require(_0x72a3('0x4'));var util=require(_0x72a3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x72a3('0x6'));var ejs=require(_0x72a3('0x7'));var fs=require('fs');var fs_extra=require(_0x72a3('0x8'));var _=require(_0x72a3('0x9'));var squel=require(_0x72a3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72a3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x72a3('0xc'));var Papa=require(_0x72a3('0xd'));var Redis=require(_0x72a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x72a3('0xf'));var as=require(_0x72a3('0x10'));var hardwareService=require(_0x72a3('0x11'));var logger=require(_0x72a3('0x12'))(_0x72a3('0x13'));var utils=require(_0x72a3('0x14'));var config=require(_0x72a3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a3('0x16'))['db'];function respondWithStatusCode(_0x571c01,_0x11537b){_0x11537b=_0x11537b||0xcc;return function(_0x3b7c32){if(_0x3b7c32){return _0x571c01[_0x72a3('0x17')](_0x11537b);}return _0x571c01[_0x72a3('0x18')](_0x11537b)['end']();};}function respondWithResult(_0x454cbb,_0xe63f34){_0xe63f34=_0xe63f34||0xc8;return function(_0x2b4660){if(_0x2b4660){return _0x454cbb[_0x72a3('0x18')](_0xe63f34)[_0x72a3('0x19')](_0x2b4660);}};}function respondWithFilteredResult(_0xf595c4,_0x589df6){return function(_0x16d879){if(_0x16d879){var _0x5c17a2=typeof _0x589df6['offset']===_0x72a3('0x1a')&&typeof _0x589df6[_0x72a3('0x1b')]==='undefined';var _0x39e5ce=_0x16d879[_0x72a3('0x1c')];var _0x55bce3=_0x5c17a2?0x0:_0x589df6[_0x72a3('0x1d')];var _0x48c013=_0x5c17a2?_0x16d879[_0x72a3('0x1c')]:_0x589df6['offset']+_0x589df6[_0x72a3('0x1b')];var _0x3223d9;if(_0x48c013>=_0x39e5ce){_0x48c013=_0x39e5ce;_0x3223d9=0xc8;}else{_0x3223d9=0xce;}_0xf595c4['status'](_0x3223d9);return _0xf595c4[_0x72a3('0x1e')](_0x72a3('0x1f'),_0x55bce3+'-'+_0x48c013+'/'+_0x39e5ce)['json'](_0x16d879);}return null;};}function patchUpdates(_0xb01ba9){return function(_0x3af3bf){try{jsonpatch[_0x72a3('0x20')](_0x3af3bf,_0xb01ba9,!![]);}catch(_0x1dbd2f){return BPromise[_0x72a3('0x21')](_0x1dbd2f);}return _0x3af3bf[_0x72a3('0x22')]();};}function saveUpdates(_0x37c7dd,_0x28b658){return function(_0x305a38){if(_0x305a38){return _0x305a38[_0x72a3('0x23')](_0x37c7dd)[_0x72a3('0x24')](function(_0x7eb3fb){return _0x7eb3fb;});}return null;};}function removeEntity(_0x337a8c,_0x5ee479){return function(_0x495458){if(_0x495458){return _0x495458['destroy']()[_0x72a3('0x24')](function(){var _0x3aa42=_0x495458['get']({'plain':!![]});var _0x111f02=_0x72a3('0x25');return db[_0x72a3('0x26')][_0x72a3('0x27')]({'where':{'type':_0x111f02,'resourceId':_0x3aa42['id']}})[_0x72a3('0x24')](function(){return _0x495458;});})[_0x72a3('0x24')](function(){_0x337a8c[_0x72a3('0x18')](0xcc)[_0x72a3('0x28')]();});}};}function handleEntityNotFound(_0x34dbd4,_0x3c5a04){return function(_0x200f25){if(!_0x200f25){_0x34dbd4[_0x72a3('0x17')](0x194);}return _0x200f25;};}function handleError(_0x2532a2,_0x1798f3){_0x1798f3=_0x1798f3||0x1f4;return function(_0x3f18fb){logger[_0x72a3('0x29')](_0x3f18fb[_0x72a3('0x2a')]);if(_0x3f18fb['name']){delete _0x3f18fb[_0x72a3('0x2b')];}_0x2532a2['status'](_0x1798f3)[_0x72a3('0x2c')](_0x3f18fb);};}exports['index']=function(_0x159f21,_0x5ad124){var _0x40a4eb={},_0xbbacda={},_0x111c2d={'count':0x0,'rows':[]};var _0x3c6a8b=_[_0x72a3('0x2d')](db['Campaign']['rawAttributes'],function(_0x4f0b2a){return{'name':_0x4f0b2a[_0x72a3('0x2e')],'type':_0x4f0b2a[_0x72a3('0x2f')][_0x72a3('0x30')]};});_0xbbacda['model']=_[_0x72a3('0x2d')](_0x3c6a8b,'name');_0xbbacda[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x159f21['query']);_0xbbacda[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0xbbacda['model'],_0xbbacda[_0x72a3('0x31')]);_0x40a4eb[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0xbbacda[_0x72a3('0x36')],qs['fields'](_0x159f21[_0x72a3('0x31')][_0x72a3('0x37')]));_0x40a4eb[_0x72a3('0x35')]=_0x40a4eb['attributes'][_0x72a3('0x38')]?_0x40a4eb[_0x72a3('0x35')]:_0xbbacda[_0x72a3('0x36')];if(!_0x159f21[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x40a4eb[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x159f21[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x40a4eb[_0x72a3('0x1d')]=qs['offset'](_0x159f21[_0x72a3('0x31')][_0x72a3('0x1d')]);}_0x40a4eb[_0x72a3('0x3b')]=qs['sort'](_0x159f21[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x40a4eb[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_['pick'](_0x159f21['query'],_0xbbacda[_0x72a3('0x33')]),_0x3c6a8b);if(_0x159f21[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x40a4eb[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x40a4eb[_0x72a3('0x3d')],{'$or':_['map'](_0x3c6a8b,function(_0x315170){if(_0x315170[_0x72a3('0x2f')]!==_0x72a3('0x40')){var _0x45b061={};_0x45b061[_0x315170['name']]={'$like':'%'+_0x159f21[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x45b061;}})});}_0x40a4eb=_[_0x72a3('0x3f')]({},_0x40a4eb,_0x159f21[_0x72a3('0x41')]);var _0x537450={'where':_0x40a4eb[_0x72a3('0x3d')]};return db[_0x72a3('0x42')][_0x72a3('0x1c')](_0x537450)['then'](function(_0x8408f2){_0x111c2d[_0x72a3('0x1c')]=_0x8408f2;if(_0x159f21[_0x72a3('0x31')]['includeAll']){_0x40a4eb[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x42')][_0x72a3('0x44')](_0x40a4eb);})[_0x72a3('0x24')](function(_0x37a7d){_0x111c2d[_0x72a3('0x45')]=_0x37a7d;return _0x111c2d;})[_0x72a3('0x24')](respondWithFilteredResult(_0x5ad124,_0x40a4eb))['catch'](handleError(_0x5ad124,null));};exports[_0x72a3('0x46')]=function(_0x375297,_0x1c3390){var _0x432296={'raw':![],'where':{'id':_0x375297[_0x72a3('0x47')]['id']}},_0x59f1dd={};_0x59f1dd[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x42')]['rawAttributes']);_0x59f1dd[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x375297[_0x72a3('0x31')]);_0x59f1dd['filters']=_[_0x72a3('0x34')](_0x59f1dd[_0x72a3('0x36')],_0x59f1dd[_0x72a3('0x31')]);_0x432296[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x59f1dd['model'],qs[_0x72a3('0x37')](_0x375297[_0x72a3('0x31')][_0x72a3('0x37')]));_0x432296[_0x72a3('0x35')]=_0x432296[_0x72a3('0x35')][_0x72a3('0x38')]?_0x432296[_0x72a3('0x35')]:_0x59f1dd[_0x72a3('0x36')];if(_0x375297[_0x72a3('0x31')]['includeAll']){_0x432296['include']=[{'all':!![]}];}_0x432296=_[_0x72a3('0x3f')]({},_0x432296,_0x375297[_0x72a3('0x41')]);return db[_0x72a3('0x42')][_0x72a3('0x48')](_0x432296)[_0x72a3('0x24')](handleEntityNotFound(_0x1c3390,null))['then'](respondWithResult(_0x1c3390,null))[_0x72a3('0x49')](handleError(_0x1c3390,null));};exports[_0x72a3('0x4a')]=function(_0x1acb0c,_0x674729){return db[_0x72a3('0x42')][_0x72a3('0x4a')](_0x1acb0c[_0x72a3('0x4b')],{})[_0x72a3('0x24')](function(_0x1dcfe7){var _0x550960=_0x1acb0c[_0x72a3('0x4c')][_0x72a3('0x4d')]({'plain':!![]});if(!_0x550960)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x550960[_0x72a3('0x4e')]===_0x72a3('0x4c')){var _0x470bc5=_0x1dcfe7[_0x72a3('0x4d')]({'plain':!![]});var _0x1ef1d1=_0x72a3('0x25');return db[_0x72a3('0x4f')]['find']({'where':{'name':_0x1ef1d1,'userProfileId':_0x550960['userProfileId']},'raw':!![]})[_0x72a3('0x24')](function(_0x4ee1e3){if(_0x4ee1e3&&_0x4ee1e3[_0x72a3('0x50')]===0x0){return db[_0x72a3('0x26')][_0x72a3('0x4a')]({'name':_0x470bc5[_0x72a3('0x2b')],'resourceId':_0x470bc5['id'],'type':_0x4ee1e3[_0x72a3('0x2b')],'sectionId':_0x4ee1e3['id']},{})[_0x72a3('0x24')](function(){return _0x1dcfe7;});}else{return _0x1dcfe7;}})['catch'](function(_0x526f13){logger[_0x72a3('0x29')](_0x72a3('0x51'),_0x526f13);throw _0x526f13;});}return _0x1dcfe7;})[_0x72a3('0x24')](respondWithResult(_0x674729,0xc9))[_0x72a3('0x49')](handleError(_0x674729,null));};exports[_0x72a3('0x52')]=function(_0x1933e5,_0x121532){var _0x59284c={'where':{'id':_0x1933e5[_0x72a3('0x47')]['id']}},_0x3b9be6={};_0x3b9be6[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x42')]['rawAttributes']);_0x59284c['attributes']=_['intersection'](_0x3b9be6[_0x72a3('0x36')],qs[_0x72a3('0x37')](_0x1933e5['query']['fields']));_0x59284c[_0x72a3('0x35')]=_0x59284c[_0x72a3('0x35')][_0x72a3('0x38')]?_0x59284c[_0x72a3('0x35')]:_0x3b9be6[_0x72a3('0x36')];if(_0x1933e5[_0x72a3('0x31')][_0x72a3('0x53')]){_0x59284c[_0x72a3('0x43')]=[{'all':!![]}];}_0x59284c=_[_0x72a3('0x3f')]({},_0x59284c,_0x1933e5[_0x72a3('0x41')]);return db[_0x72a3('0x42')][_0x72a3('0x48')](_0x59284c)[_0x72a3('0x24')](handleEntityNotFound(_0x121532,null))[_0x72a3('0x24')](function(_0x5db6d2){if(_0x5db6d2){var _0x3ae15c=_0x5db6d2[_0x72a3('0x4d')]({'plain':!![]});_0x3ae15c=qs[_0x72a3('0x54')](_0x3ae15c,['id',_0x72a3('0x55'),_0x72a3('0x56')]);_0x1933e5[_0x72a3('0x4b')]=_[_0x72a3('0x54')](_0x1933e5[_0x72a3('0x4b')],['id',_0x72a3('0x55'),_0x72a3('0x56')]);return db[_0x72a3('0x42')][_0x72a3('0x4a')](_['merge'](_0x3ae15c,_0x1933e5['body']),{'include':_0x1933e5[_0x72a3('0x31')][_0x72a3('0x53')]?[{'all':!![]}]:undefined})[_0x72a3('0x24')](function(_0xb41289){var _0x33ffb4=_0x1933e5[_0x72a3('0x4c')][_0x72a3('0x4d')]({'plain':!![]});if(!_0x33ffb4)throw new Error(_0x72a3('0x57'));if(_0x33ffb4[_0x72a3('0x4e')]===_0x72a3('0x4c')){var _0x7da0fb=_0xb41289[_0x72a3('0x4d')]({'plain':!![]});var _0x2549e0=_0x72a3('0x25');return db[_0x72a3('0x4f')][_0x72a3('0x48')]({'where':{'name':_0x2549e0,'userProfileId':_0x33ffb4[_0x72a3('0x58')]},'raw':!![]})[_0x72a3('0x24')](function(_0x4778cc){if(_0x4778cc&&_0x4778cc[_0x72a3('0x50')]===0x0){return db['UserProfileResource'][_0x72a3('0x4a')]({'name':_0x7da0fb['name'],'resourceId':_0x7da0fb['id'],'type':_0x4778cc['name'],'sectionId':_0x4778cc['id']},{})[_0x72a3('0x24')](function(){return _0xb41289;});}else{return _0xb41289;}})[_0x72a3('0x49')](function(_0x37df09){logger[_0x72a3('0x29')](_0x72a3('0x51'),_0x37df09);throw _0x37df09;});}return _0xb41289;});}})[_0x72a3('0x24')](respondWithResult(_0x121532,0xc9))[_0x72a3('0x49')](handleError(_0x121532,null));};exports[_0x72a3('0x23')]=function(_0x539d23,_0x3f3a9a){if(_0x539d23[_0x72a3('0x4b')]['id']){delete _0x539d23[_0x72a3('0x4b')]['id'];}return db[_0x72a3('0x42')]['find']({'where':{'id':_0x539d23['params']['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x3f3a9a,null))[_0x72a3('0x24')](saveUpdates(_0x539d23['body'],null))[_0x72a3('0x24')](respondWithResult(_0x3f3a9a,null))['catch'](handleError(_0x3f3a9a,null));};exports[_0x72a3('0x27')]=function(_0x5c9c4c,_0x16f70c){return db[_0x72a3('0x42')][_0x72a3('0x48')]({'where':{'id':_0x5c9c4c[_0x72a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x16f70c,null))[_0x72a3('0x24')](removeEntity(_0x16f70c,null))[_0x72a3('0x49')](handleError(_0x16f70c,null));};exports[_0x72a3('0x59')]=function(_0x2a78ca,_0x4d4fda,_0x415020){var _0x276345={'raw':!![],'where':{}};var _0xf32031={};var _0x26ad58={'count':0x0,'rows':[]};return db[_0x72a3('0x42')]['findOne']({'where':{'id':_0x2a78ca[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x4d4fda,null))['then'](function(_0x9965c1){if(_0x9965c1){_0xf32031[_0x72a3('0x36')]=_['keys'](db[_0x72a3('0x5a')]['rawAttributes']);_0xf32031['query']=_[_0x72a3('0x32')](_0x2a78ca[_0x72a3('0x31')]);_0xf32031[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0xf32031[_0x72a3('0x36')],_0xf32031[_0x72a3('0x31')]);_0x276345['attributes']=_['intersection'](_0xf32031[_0x72a3('0x36')],qs[_0x72a3('0x37')](_0x2a78ca[_0x72a3('0x31')]['fields']));_0x276345[_0x72a3('0x35')]=_0x276345['attributes'][_0x72a3('0x38')]?_0x276345[_0x72a3('0x35')]:_0xf32031[_0x72a3('0x36')];if(!_0x2a78ca['query']['hasOwnProperty'](_0x72a3('0x3a'))){_0x276345[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x2a78ca['query'][_0x72a3('0x1b')]);_0x276345[_0x72a3('0x1d')]=qs[_0x72a3('0x1d')](_0x2a78ca['query'][_0x72a3('0x1d')]);}_0x276345[_0x72a3('0x3b')]=qs['sort'](_0x2a78ca[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x276345[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x2a78ca[_0x72a3('0x31')],_0xf32031['filters']));_0x276345['where']['CampaignId']=_0x9965c1['id'];if(_0x2a78ca[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x276345[_0x72a3('0x3d')]=_['merge'](_0x276345[_0x72a3('0x3d')],{'$or':_['map'](_0x276345[_0x72a3('0x35')],function(_0x361bf1){var _0x2ab955={};_0x2ab955[_0x361bf1]={'$like':'%'+_0x2a78ca[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x2ab955;})});}_0x276345=_[_0x72a3('0x3f')]({},_0x276345,_0x2a78ca[_0x72a3('0x41')]);return db[_0x72a3('0x5a')][_0x72a3('0x1c')]({'where':_0x276345[_0x72a3('0x3d')]})[_0x72a3('0x24')](function(_0x5f8351){_0x26ad58['count']=_0x5f8351;if(_0x2a78ca['query'][_0x72a3('0x53')]){_0x276345['include']=[{'all':!![]}];}return db[_0x72a3('0x5a')]['findAll'](_0x276345);})[_0x72a3('0x24')](function(_0x5c1409){_0x26ad58[_0x72a3('0x45')]=_0x5c1409;return _0x26ad58;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x4d4fda,_0x276345))['catch'](handleError(_0x4d4fda,null));};exports[_0x72a3('0x5c')]=function(_0x28eba1,_0x4eb02a,_0x5836ec){var _0x13c295={'raw':!![],'where':{}};var _0x3cdfbc={};var _0x120d90={'count':0x0,'rows':[]};return db[_0x72a3('0x42')]['findOne']({'where':{'id':_0x28eba1[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x4eb02a,null))[_0x72a3('0x24')](function(_0x3dc3c4){if(_0x3dc3c4){_0x3cdfbc[_0x72a3('0x36')]=_[_0x72a3('0x32')](db['CmHopperHistory']['rawAttributes']);_0x3cdfbc['query']=_['keys'](_0x28eba1['query']);_0x3cdfbc[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x3cdfbc['model'],_0x3cdfbc[_0x72a3('0x31')]);_0x13c295[_0x72a3('0x35')]=_['intersection'](_0x3cdfbc['model'],qs[_0x72a3('0x37')](_0x28eba1['query'][_0x72a3('0x37')]));_0x13c295[_0x72a3('0x35')]=_0x13c295[_0x72a3('0x35')][_0x72a3('0x38')]?_0x13c295[_0x72a3('0x35')]:_0x3cdfbc['model'];if(!_0x28eba1[_0x72a3('0x31')]['hasOwnProperty'](_0x72a3('0x3a'))){_0x13c295[_0x72a3('0x1b')]=qs['limit'](_0x28eba1[_0x72a3('0x31')]['limit']);_0x13c295['offset']=qs[_0x72a3('0x1d')](_0x28eba1[_0x72a3('0x31')][_0x72a3('0x1d')]);}_0x13c295[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x28eba1['query']['sort']);_0x13c295[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x28eba1[_0x72a3('0x31')],_0x3cdfbc[_0x72a3('0x33')]));_0x13c295[_0x72a3('0x3d')][_0x72a3('0x5d')]=_0x3dc3c4['id'];if(_0x28eba1[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x13c295[_0x72a3('0x3d')]=_['merge'](_0x13c295[_0x72a3('0x3d')],{'$or':_[_0x72a3('0x2d')](_0x13c295['attributes'],function(_0x2944f7){var _0x27f68c={};_0x27f68c[_0x2944f7]={'$like':'%'+_0x28eba1[_0x72a3('0x31')]['filter']+'%'};return _0x27f68c;})});}_0x13c295=_[_0x72a3('0x3f')]({},_0x13c295,_0x28eba1[_0x72a3('0x41')]);return db[_0x72a3('0x5e')][_0x72a3('0x1c')]({'where':_0x13c295[_0x72a3('0x3d')]})['then'](function(_0x101f0c){_0x120d90[_0x72a3('0x1c')]=_0x101f0c;if(_0x28eba1[_0x72a3('0x31')][_0x72a3('0x53')]){_0x13c295[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x5e')]['findAll'](_0x13c295);})[_0x72a3('0x24')](function(_0x46cfc4){_0x120d90['rows']=_0x46cfc4;return _0x120d90;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x4eb02a,_0x13c295))['catch'](handleError(_0x4eb02a,null));};exports[_0x72a3('0x5f')]=function(_0x5c9ada,_0x175f59,_0x5b69b8){var _0x78ecf3={'raw':!![],'where':{}};var _0x355892={};var _0x33d14f={'count':0x0,'rows':[]};return db['Campaign'][_0x72a3('0x60')]({'where':{'id':_0x5c9ada['params']['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x175f59,null))[_0x72a3('0x24')](function(_0x1463d8){if(_0x1463d8){_0x355892[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x61')][_0x72a3('0x62')]);_0x355892[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x5c9ada['query']);_0x355892[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x355892[_0x72a3('0x36')],_0x355892['query']);_0x78ecf3[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x355892[_0x72a3('0x36')],qs['fields'](_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x37')]));_0x78ecf3[_0x72a3('0x35')]=_0x78ecf3[_0x72a3('0x35')][_0x72a3('0x38')]?_0x78ecf3[_0x72a3('0x35')]:_0x355892['model'];if(!_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x78ecf3[_0x72a3('0x1b')]=qs['limit'](_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x78ecf3[_0x72a3('0x1d')]=qs[_0x72a3('0x1d')](_0x5c9ada[_0x72a3('0x31')]['offset']);}_0x78ecf3[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x78ecf3[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x5c9ada['query'],_0x355892[_0x72a3('0x33')]));_0x78ecf3[_0x72a3('0x3d')]['CampaignId']=_0x1463d8['id'];if(_0x5c9ada[_0x72a3('0x31')]['filter']){_0x78ecf3[_0x72a3('0x3d')]=_['merge'](_0x78ecf3['where'],{'$or':_['map'](_0x78ecf3[_0x72a3('0x35')],function(_0x3d7d43){var _0x13537b={};_0x13537b[_0x3d7d43]={'$like':'%'+_0x5c9ada['query'][_0x72a3('0x3e')]+'%'};return _0x13537b;})});}_0x78ecf3=_[_0x72a3('0x3f')]({},_0x78ecf3,_0x5c9ada[_0x72a3('0x41')]);return db[_0x72a3('0x61')][_0x72a3('0x1c')]({'where':_0x78ecf3[_0x72a3('0x3d')]})['then'](function(_0x2ea177){_0x33d14f[_0x72a3('0x1c')]=_0x2ea177;if(_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x53')]){_0x78ecf3[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x61')][_0x72a3('0x44')](_0x78ecf3);})[_0x72a3('0x24')](function(_0x1ac67b){_0x33d14f[_0x72a3('0x45')]=_0x1ac67b;return _0x33d14f;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x175f59,_0x78ecf3))[_0x72a3('0x49')](handleError(_0x175f59,null));};exports[_0x72a3('0x63')]=function(_0x59a6f5,_0x32dd3e,_0x10bdfe){var _0x399e10={'raw':!![],'where':{}};var _0x59045f={};var _0x57860f={'count':0x0,'rows':[]};return db['Campaign'][_0x72a3('0x60')]({'where':{'id':_0x59a6f5['params']['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x32dd3e,null))[_0x72a3('0x24')](function(_0x135601){if(_0x135601){_0x59045f[_0x72a3('0x36')]=_[_0x72a3('0x32')](db['CmHopperBlack'][_0x72a3('0x62')]);_0x59045f[_0x72a3('0x31')]=_['keys'](_0x59a6f5[_0x72a3('0x31')]);_0x59045f[_0x72a3('0x33')]=_['intersection'](_0x59045f[_0x72a3('0x36')],_0x59045f['query']);_0x399e10[_0x72a3('0x35')]=_['intersection'](_0x59045f[_0x72a3('0x36')],qs[_0x72a3('0x37')](_0x59a6f5[_0x72a3('0x31')]['fields']));_0x399e10['attributes']=_0x399e10[_0x72a3('0x35')][_0x72a3('0x38')]?_0x399e10[_0x72a3('0x35')]:_0x59045f[_0x72a3('0x36')];if(!_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x399e10[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x399e10['offset']=qs['offset'](_0x59a6f5['query'][_0x72a3('0x1d')]);}_0x399e10[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x59a6f5['query'][_0x72a3('0x3c')]);_0x399e10['where']=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x59a6f5[_0x72a3('0x31')],_0x59045f[_0x72a3('0x33')]));_0x399e10[_0x72a3('0x3d')][_0x72a3('0x5d')]=_0x135601['id'];if(_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x399e10[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x399e10[_0x72a3('0x3d')],{'$or':_['map'](_0x399e10[_0x72a3('0x35')],function(_0x124428){var _0x101eee={};_0x101eee[_0x124428]={'$like':'%'+_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x101eee;})});}_0x399e10=_[_0x72a3('0x3f')]({},_0x399e10,_0x59a6f5[_0x72a3('0x41')]);return db[_0x72a3('0x64')][_0x72a3('0x1c')]({'where':_0x399e10[_0x72a3('0x3d')]})['then'](function(_0x34505e){_0x57860f[_0x72a3('0x1c')]=_0x34505e;if(_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x53')]){_0x399e10[_0x72a3('0x43')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x72a3('0x44')](_0x399e10);})[_0x72a3('0x24')](function(_0x31c9ea){_0x57860f[_0x72a3('0x45')]=_0x31c9ea;return _0x57860f;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x32dd3e,_0x399e10))['catch'](handleError(_0x32dd3e,null));};exports[_0x72a3('0x65')]=function(_0x3286c3,_0x3a0bc1,_0x39338f){var _0x35f62e={};var _0x13fcc3={};var _0xf144f7;var _0x3d2b2b;return db[_0x72a3('0x42')][_0x72a3('0x60')]({'where':{'id':_0x3286c3[_0x72a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a0bc1,null))['then'](function(_0x4660a4){if(_0x4660a4){_0xf144f7=_0x4660a4;_0x13fcc3[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x66')]['rawAttributes']);_0x13fcc3['query']=_['keys'](_0x3286c3[_0x72a3('0x31')]);_0x13fcc3[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x13fcc3['model'],_0x13fcc3[_0x72a3('0x31')]);_0x35f62e[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x13fcc3[_0x72a3('0x36')],qs['fields'](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x37')]));_0x35f62e[_0x72a3('0x35')]=_0x35f62e['attributes'][_0x72a3('0x38')]?_0x35f62e[_0x72a3('0x35')]:_0x13fcc3[_0x72a3('0x36')];_0x35f62e[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x35f62e[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x3286c3[_0x72a3('0x31')],_0x13fcc3[_0x72a3('0x33')]));if(_0x3286c3[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x35f62e[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x35f62e[_0x72a3('0x3d')],{'$or':_[_0x72a3('0x2d')](_0x35f62e[_0x72a3('0x35')],function(_0x5ecc7c){var _0x6201ed={};_0x6201ed[_0x5ecc7c]={'$like':'%'+_0x3286c3[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x6201ed;})});}_0x35f62e=_[_0x72a3('0x3f')]({},_0x35f62e,_0x3286c3[_0x72a3('0x41')]);return _0xf144f7[_0x72a3('0x65')](_0x35f62e);}})[_0x72a3('0x24')](function(_0x29abc8){if(_0x29abc8){_0x3d2b2b=_0x29abc8[_0x72a3('0x38')];if(!_0x3286c3[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x35f62e[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x35f62e['offset']=qs[_0x72a3('0x1d')](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x1d')]);}return _0xf144f7[_0x72a3('0x65')](_0x35f62e);}})['then'](function(_0x84bcf4){if(_0x84bcf4){return _0x84bcf4?{'count':_0x3d2b2b,'rows':_0x84bcf4}:null;}})[_0x72a3('0x24')](respondWithResult(_0x3a0bc1,null))['catch'](handleError(_0x3a0bc1,null));};exports[_0x72a3('0x67')]=function(_0x5e6709,_0x5c3e23,_0x3c22a7){var _0x5c1714,_0x535c70;return db[_0x72a3('0x42')]['find']({'where':{'id':_0x5e6709[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x5c3e23,null))[_0x72a3('0x24')](function(_0x1fa674){if(_0x1fa674){_0x535c70=_0x1fa674;return _0x1fa674[_0x72a3('0x67')](_0x5e6709[_0x72a3('0x4b')][_0x72a3('0x68')],_[_0x72a3('0x54')](_0x5e6709[_0x72a3('0x4b')],[_0x72a3('0x68'),'id'])||{});}return null;})[_0x72a3('0x69')](function(_0x5a6ea5){var _0x3cbd6d;_0x5c1714=_0x5a6ea5||[];var _0x2d1a70=[];if(_0x5a6ea5){for(var _0x233b41=0x0;_0x233b41<_0x5a6ea5[_0x72a3('0x38')];_0x233b41+=0x1){var _0xdcc2f3=_0x5a6ea5[_0x233b41][_0x72a3('0x4d')]({'plain':!![]});_0x535c70[_0x72a3('0x6a')]=_0x5e6709[_0x72a3('0x4b')][_0x72a3('0x6a')]?_0x5e6709['body']['dialCheckDuplicateType']:_0x535c70[_0x72a3('0x6a')];switch(_0x535c70['dialCheckDuplicateType']){case _0x72a3('0x6b'):_0x3cbd6d=squel[_0x72a3('0x6c')]()[_0x72a3('0x6d')](_0x72a3('0x6e'))[_0x72a3('0x6f')]([_0x72a3('0x70'),_0x72a3('0x71'),_0x72a3('0x72'),_0x72a3('0x73'),_0x72a3('0x5d'),'createdAt',_0x72a3('0x56')],squel[_0x72a3('0x74')]()[_0x72a3('0x75')]('phone',_0x72a3('0x70'))['field'](_0x72a3('0x76'),_0x72a3('0x71'))['field']('id','ContactId')[_0x72a3('0x75')](_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')](),_0x72a3('0x73'))['field'](_0x5e6709[_0x72a3('0x47')]['id']['toString'](),_0x72a3('0x5d'))[_0x72a3('0x75')](_0x72a3('0x76'),'createdAt')[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x56'))[_0x72a3('0x79')](_0x72a3('0x7a'))[_0x72a3('0x3d')]('deletedAt\x20IS\x20NULL')[_0x72a3('0x3d')](_0x72a3('0x7b'),_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')]())[_0x72a3('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x72a3('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x72a3('0x74')]()['field'](_0x72a3('0x7c'))[_0x72a3('0x79')](_0x72a3('0x7d'))[_0x72a3('0x3d')](_0x72a3('0x7e'),_0x5e6709[_0x72a3('0x47')]['id'][_0x72a3('0x78')]()))[_0x72a3('0x3d')](_0x72a3('0x7f'),squel[_0x72a3('0x74')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x72a3('0x3d')]('CampaignId\x20=\x20?',_0x5e6709[_0x72a3('0x47')]['id']['toString']())))['toString']();break;case _0x72a3('0x80'):_0x3cbd6d=squel[_0x72a3('0x6c')]()['into']('cm_hopper')[_0x72a3('0x6f')]([_0x72a3('0x70'),_0x72a3('0x71'),'ContactId',_0x72a3('0x73'),_0x72a3('0x5d'),_0x72a3('0x55'),_0x72a3('0x56')],squel[_0x72a3('0x74')]()[_0x72a3('0x75')](_0x72a3('0x70'),_0x72a3('0x70'))[_0x72a3('0x75')]('NOW()',_0x72a3('0x71'))[_0x72a3('0x75')]('id',_0x72a3('0x72'))['field'](_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')](),_0x72a3('0x73'))['field'](_0x5e6709[_0x72a3('0x47')]['id']['toString'](),_0x72a3('0x5d'))['field'](_0x72a3('0x76'),'createdAt')[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x56'))[_0x72a3('0x79')](_0x72a3('0x7a'))[_0x72a3('0x3d')](_0x72a3('0x81'))[_0x72a3('0x3d')](_0x72a3('0x7b'),_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')]())[_0x72a3('0x3d')](_0x72a3('0x82'))[_0x72a3('0x3d')](_0x72a3('0x7f'),squel[_0x72a3('0x74')]()[_0x72a3('0x75')](_0x72a3('0x83'))[_0x72a3('0x79')](_0x72a3('0x6e'))[_0x72a3('0x3d')](_0x72a3('0x7e'),_0x5e6709['params']['id'][_0x72a3('0x78')]())))[_0x72a3('0x78')]();break;default:_0x3cbd6d=squel[_0x72a3('0x6c')]()['into'](_0x72a3('0x6e'))[_0x72a3('0x6f')]([_0x72a3('0x70'),'scheduledAt',_0x72a3('0x72'),_0x72a3('0x73'),'CampaignId',_0x72a3('0x55'),_0x72a3('0x56')],squel[_0x72a3('0x74')]()['field']('phone',_0x72a3('0x70'))['field']('NOW()',_0x72a3('0x71'))[_0x72a3('0x75')]('id',_0x72a3('0x72'))[_0x72a3('0x75')](_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')](),_0x72a3('0x73'))[_0x72a3('0x75')](_0x5e6709[_0x72a3('0x47')]['id'][_0x72a3('0x78')](),_0x72a3('0x5d'))[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x55'))['field']('NOW()',_0x72a3('0x56'))[_0x72a3('0x79')](_0x72a3('0x7a'))['where'](_0x72a3('0x81'))[_0x72a3('0x3d')](_0x72a3('0x7b'),_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')]())[_0x72a3('0x3d')](_0x72a3('0x82')))[_0x72a3('0x78')]();}_0x2d1a70[_0x72a3('0x84')](db[_0x72a3('0x85')][_0x72a3('0x31')](_0x3cbd6d));}return BPromise[_0x72a3('0x86')](_0x2d1a70);}})['then'](function(){return _0x5c1714;})['then'](respondWithResult(_0x5c3e23,null))['catch'](handleError(_0x5c3e23,null));};exports['removeLists']=function(_0x5ee648,_0x33cadc,_0x2521fe){return db['Campaign']['find']({'where':{'id':_0x5ee648[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x33cadc,null))[_0x72a3('0x24')](function(_0x3db49d){if(_0x3db49d){return _0x3db49d['removeLists'](_0x5ee648[_0x72a3('0x31')]['ids']);}})['then'](function(_0x10ad20){if(_0x10ad20){return db['CmHopper'][_0x72a3('0x27')]({'where':{'ListId':_0x5ee648['query']['ids'],'CampaignId':_0x5ee648[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](function(){return _0x10ad20;});}})[_0x72a3('0x24')](respondWithStatusCode(_0x33cadc,null))[_0x72a3('0x49')](handleError(_0x33cadc,null));};exports['getBlackLists']=function(_0x29a96a,_0x3a22af,_0x316e50){var _0x58d8fc={};var _0x7311e4={};var _0x5d2ff5;var _0x4f119b;return db[_0x72a3('0x42')][_0x72a3('0x60')]({'where':{'id':_0x29a96a[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x3a22af,null))[_0x72a3('0x24')](function(_0x122e2d){if(_0x122e2d){_0x5d2ff5=_0x122e2d;_0x7311e4['model']=_[_0x72a3('0x32')](db[_0x72a3('0x66')][_0x72a3('0x62')]);_0x7311e4[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x29a96a[_0x72a3('0x31')]);_0x7311e4[_0x72a3('0x33')]=_['intersection'](_0x7311e4[_0x72a3('0x36')],_0x7311e4[_0x72a3('0x31')]);_0x58d8fc[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x7311e4[_0x72a3('0x36')],qs['fields'](_0x29a96a['query'][_0x72a3('0x37')]));_0x58d8fc[_0x72a3('0x35')]=_0x58d8fc[_0x72a3('0x35')][_0x72a3('0x38')]?_0x58d8fc[_0x72a3('0x35')]:_0x7311e4[_0x72a3('0x36')];_0x58d8fc[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x29a96a[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x58d8fc[_0x72a3('0x3d')]=qs['filters'](_['pick'](_0x29a96a[_0x72a3('0x31')],_0x7311e4[_0x72a3('0x33')]));if(_0x29a96a[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x58d8fc[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x58d8fc[_0x72a3('0x3d')],{'$or':_['map'](_0x58d8fc[_0x72a3('0x35')],function(_0x26e068){var _0x33b449={};_0x33b449[_0x26e068]={'$like':'%'+_0x29a96a[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x33b449;})});}_0x58d8fc=_[_0x72a3('0x3f')]({},_0x58d8fc,_0x29a96a['options']);return _0x5d2ff5[_0x72a3('0x87')](_0x58d8fc);}})[_0x72a3('0x24')](function(_0x1f12ab){if(_0x1f12ab){_0x4f119b=_0x1f12ab['length'];if(!_0x29a96a[_0x72a3('0x31')]['hasOwnProperty']('nolimit')){_0x58d8fc['limit']=qs['limit'](_0x29a96a[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x58d8fc[_0x72a3('0x1d')]=qs[_0x72a3('0x1d')](_0x29a96a['query']['offset']);}return _0x5d2ff5['getBlackLists'](_0x58d8fc);}})['then'](function(_0x462357){if(_0x462357){return _0x462357?{'count':_0x4f119b,'rows':_0x462357}:null;}})['then'](respondWithResult(_0x3a22af,null))[_0x72a3('0x49')](handleError(_0x3a22af,null));};exports[_0x72a3('0x88')]=function(_0x5d536d,_0x3e7b69,_0xf1ad58){var _0x1f75a5,_0x22fdaf;return db[_0x72a3('0x42')]['find']({'where':{'id':_0x5d536d[_0x72a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e7b69,null))[_0x72a3('0x24')](function(_0x543298){if(_0x543298){_0x22fdaf=_0x543298;return _0x543298['addBlackLists'](_0x5d536d['body'][_0x72a3('0x68')],_[_0x72a3('0x54')](_0x5d536d[_0x72a3('0x4b')],[_0x72a3('0x68'),'id'])||{});}return null;})[_0x72a3('0x69')](function(_0x5efff0){var _0x4df3c2;_0x1f75a5=_0x5efff0||[];var _0xc5947e=[];if(_0x5efff0){for(var _0x3e397a=0x0;_0x3e397a<_0x5efff0[_0x72a3('0x38')];_0x3e397a+=0x1){var _0x3c6c5d=_0x5efff0[_0x3e397a][_0x72a3('0x4d')]({'plain':!![]});_0x4df3c2=squel['insert']()['into'](_0x72a3('0x89'))['fromQuery']([_0x72a3('0x70'),_0x72a3('0x72'),_0x72a3('0x73'),_0x72a3('0x5d'),_0x72a3('0x55'),_0x72a3('0x56')],squel[_0x72a3('0x74')]()[_0x72a3('0x75')](_0x72a3('0x70'),_0x72a3('0x70'))[_0x72a3('0x75')]('id',_0x72a3('0x72'))[_0x72a3('0x75')](_0x3c6c5d[_0x72a3('0x77')]['toString'](),_0x72a3('0x73'))[_0x72a3('0x75')](_0x5d536d['params']['id'][_0x72a3('0x78')](),_0x72a3('0x5d'))[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x55'))[_0x72a3('0x75')]('NOW()','updatedAt')['from']('cm_contacts')['where'](_0x72a3('0x81'))[_0x72a3('0x3d')](_0x72a3('0x7b'),_0x3c6c5d[_0x72a3('0x77')]['toString']())[_0x72a3('0x3d')](_0x72a3('0x82')))['toString']();_0xc5947e[_0x72a3('0x84')](db['sequelize']['query'](_0x4df3c2));}return BPromise[_0x72a3('0x86')](_0xc5947e);}})[_0x72a3('0x24')](function(){return _0x1f75a5;})[_0x72a3('0x24')](respondWithResult(_0x3e7b69,null))[_0x72a3('0x49')](handleError(_0x3e7b69,null));};exports[_0x72a3('0x8a')]=function(_0x591cb4,_0x3339b8,_0x3b6406){return db[_0x72a3('0x42')][_0x72a3('0x48')]({'where':{'id':_0x591cb4[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x3339b8,null))[_0x72a3('0x24')](function(_0x202746){if(_0x202746){return _0x202746['removeBlackLists'](_0x591cb4[_0x72a3('0x31')][_0x72a3('0x68')]);}})[_0x72a3('0x24')](function(_0xd00c28){if(_0xd00c28){return db[_0x72a3('0x64')][_0x72a3('0x27')]({'where':{'ListId':_0x591cb4['query'][_0x72a3('0x68')],'CampaignId':_0x591cb4[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](function(){return _0xd00c28;});}})[_0x72a3('0x24')](respondWithStatusCode(_0x3339b8,null))['catch'](handleError(_0x3339b8,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 4962b80..f4a8e61 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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_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':'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 70a2356..7096599 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 _0x9b83=['raw','where','attributes','include','map','model','then','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','options'];(function(_0x55ebd1,_0x19eae0){var _0x4010ce=function(_0x13890c){while(--_0x13890c){_0x55ebd1['push'](_0x55ebd1['shift']());}};_0x4010ce(++_0x19eae0);}(_0x9b83,0x84));var _0x39b8=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x9b83[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var moment=require(_0x39b8('0x2'));var BPromise=require(_0x39b8('0x3'));var rs=require(_0x39b8('0x4'));var fs=require('fs');var Redis=require(_0x39b8('0x5'));var db=require(_0x39b8('0x6'))['db'];var utils=require(_0x39b8('0x7'));var logger=require(_0x39b8('0x8'))(_0x39b8('0x9'));var config=require('../../config/environment');var jayson=require(_0x39b8('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4006c2,_0x3eee6d,_0x4be201){return new BPromise(function(_0x20928d,_0x2477b7){return client['request'](_0x4006c2,_0x4be201)['then'](function(_0x480788){logger[_0x39b8('0xb')](_0x39b8('0xc'),_0x3eee6d,_0x39b8('0xd'));logger[_0x39b8('0xe')](_0x39b8('0xf'),_0x3eee6d,_0x39b8('0xd'),JSON[_0x39b8('0x10')](_0x480788));if(_0x480788[_0x39b8('0x11')]){if(_0x480788[_0x39b8('0x11')]['code']===0x1f4){logger[_0x39b8('0x11')]('Campaign,\x20%s,\x20%s',_0x3eee6d,_0x480788[_0x39b8('0x11')][_0x39b8('0x12')]);return _0x2477b7(_0x480788[_0x39b8('0x11')][_0x39b8('0x12')]);}logger['error'](_0x39b8('0xc'),_0x3eee6d,_0x480788[_0x39b8('0x11')][_0x39b8('0x12')]);return _0x20928d(_0x480788[_0x39b8('0x11')]['message']);}else{logger[_0x39b8('0xb')]('Campaign,\x20%s,\x20%s',_0x3eee6d,_0x39b8('0xd'));_0x20928d(_0x480788[_0x39b8('0x13')][_0x39b8('0x12')]);}})[_0x39b8('0x14')](function(_0x54242e){logger['error'](_0x39b8('0xc'),_0x3eee6d,_0x54242e);_0x2477b7(_0x54242e);});});}exports['GetCampaign']=function(_0x47a309){var _0x5cdb26=this;return new Promise(function(_0x2a66df,_0x5d1dd1){return db[_0x39b8('0x15')]['findAll']({'raw':_0x47a309[_0x39b8('0x16')]?_0x47a309[_0x39b8('0x16')][_0x39b8('0x17')]===undefined?!![]:![]:!![],'where':_0x47a309['options']?_0x47a309[_0x39b8('0x16')][_0x39b8('0x18')]||null:null,'attributes':_0x47a309[_0x39b8('0x16')]?_0x47a309['options'][_0x39b8('0x19')]||null:null,'limit':_0x47a309['options']?_0x47a309[_0x39b8('0x16')]['limit']||null:null,'include':_0x47a309[_0x39b8('0x16')]?_0x47a309[_0x39b8('0x16')][_0x39b8('0x1a')]?_[_0x39b8('0x1b')](_0x47a309[_0x39b8('0x16')]['include'],function(_0x3235e6){return{'model':db[_0x3235e6['model']],'as':_0x3235e6['as'],'attributes':_0x3235e6[_0x39b8('0x19')],'include':_0x3235e6[_0x39b8('0x1a')]?_[_0x39b8('0x1b')](_0x3235e6[_0x39b8('0x1a')],function(_0x51aa13){return{'model':db[_0x51aa13[_0x39b8('0x1c')]],'as':_0x51aa13['as'],'attributes':_0x51aa13[_0x39b8('0x19')],'include':_0x51aa13[_0x39b8('0x1a')]?_[_0x39b8('0x1b')](_0x51aa13[_0x39b8('0x1a')],function(_0x28a373){return{'model':db[_0x28a373[_0x39b8('0x1c')]],'as':_0x28a373['as'],'attributes':_0x28a373['attributes']};}):[]};}):[]};}):[]:[]})[_0x39b8('0x1d')](function(_0x5d6a8a){logger[_0x39b8('0xb')]('GetCampaign',_0x47a309);logger[_0x39b8('0xe')](_0x39b8('0x1e'),_0x47a309,JSON[_0x39b8('0x10')](_0x5d6a8a));_0x2a66df(_0x5d6a8a);})[_0x39b8('0x14')](function(_0x2a288c){logger[_0x39b8('0x11')](_0x39b8('0x1e'),_0x2a288c[_0x39b8('0x12')],_0x47a309);_0x5d1dd1(_0x5cdb26['error'](0x1f4,_0x2a288c[_0x39b8('0x12')]));});});}; \ No newline at end of file +var _0x24cd=['include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit'];(function(_0x465856,_0x335382){var _0x447123=function(_0x1e8210){while(--_0x1e8210){_0x465856['push'](_0x465856['shift']());}};_0x447123(++_0x335382);}(_0x24cd,0x83));var _0xd24c=function(_0xdf754b,_0x34c91d){_0xdf754b=_0xdf754b-0x0;var _0x48148d=_0x24cd[_0xdf754b];return _0x48148d;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var moment=require('moment');var BPromise=require(_0xd24c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd24c('0x3'));var db=require(_0xd24c('0x4'))['db'];var utils=require(_0xd24c('0x5'));var logger=require('../../config/logger')(_0xd24c('0x6'));var config=require(_0xd24c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd24c('0x8')][_0xd24c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a432a,_0x95eb94,_0x3d4d20){return new BPromise(function(_0x411706,_0x3df525){return client[_0xd24c('0xa')](_0x2a432a,_0x3d4d20)['then'](function(_0x4c4455){logger[_0xd24c('0xb')](_0xd24c('0xc'),_0x95eb94,_0xd24c('0xd'));logger[_0xd24c('0xe')](_0xd24c('0xf'),_0x95eb94,_0xd24c('0xd'),JSON[_0xd24c('0x10')](_0x4c4455));if(_0x4c4455[_0xd24c('0x11')]){if(_0x4c4455['error'][_0xd24c('0x12')]===0x1f4){logger[_0xd24c('0x11')]('Campaign,\x20%s,\x20%s',_0x95eb94,_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);return _0x3df525(_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);}logger[_0xd24c('0x11')](_0xd24c('0xc'),_0x95eb94,_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);return _0x411706(_0x4c4455['error'][_0xd24c('0x13')]);}else{logger[_0xd24c('0xb')]('Campaign,\x20%s,\x20%s',_0x95eb94,_0xd24c('0xd'));_0x411706(_0x4c4455[_0xd24c('0x14')][_0xd24c('0x13')]);}})[_0xd24c('0x15')](function(_0x509992){logger['error'](_0xd24c('0xc'),_0x95eb94,_0x509992);_0x3df525(_0x509992);});});}exports[_0xd24c('0x16')]=function(_0x170d59){var _0x524158=this;return new Promise(function(_0x9f2d2d,_0x190fc1){return db[_0xd24c('0x17')][_0xd24c('0x18')]({'raw':_0x170d59['options']?_0x170d59[_0xd24c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x170d59[_0xd24c('0x19')]?_0x170d59[_0xd24c('0x19')][_0xd24c('0x1a')]||null:null,'attributes':_0x170d59[_0xd24c('0x19')]?_0x170d59[_0xd24c('0x19')][_0xd24c('0x1b')]||null:null,'limit':_0x170d59[_0xd24c('0x19')]?_0x170d59[_0xd24c('0x19')][_0xd24c('0x1c')]||null:null,'include':_0x170d59[_0xd24c('0x19')]?_0x170d59['options'][_0xd24c('0x1d')]?_[_0xd24c('0x1e')](_0x170d59[_0xd24c('0x19')]['include'],function(_0x44471f){return{'model':db[_0x44471f[_0xd24c('0x1f')]],'as':_0x44471f['as'],'attributes':_0x44471f[_0xd24c('0x1b')],'include':_0x44471f['include']?_[_0xd24c('0x1e')](_0x44471f[_0xd24c('0x1d')],function(_0x848e0e){return{'model':db[_0x848e0e[_0xd24c('0x1f')]],'as':_0x848e0e['as'],'attributes':_0x848e0e['attributes'],'include':_0x848e0e['include']?_[_0xd24c('0x1e')](_0x848e0e['include'],function(_0x13a9a7){return{'model':db[_0x13a9a7[_0xd24c('0x1f')]],'as':_0x13a9a7['as'],'attributes':_0x13a9a7[_0xd24c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cb1b3){logger[_0xd24c('0xb')](_0xd24c('0x16'),_0x170d59);logger[_0xd24c('0xe')](_0xd24c('0x16'),_0x170d59,JSON[_0xd24c('0x10')](_0x4cb1b3));_0x9f2d2d(_0x4cb1b3);})[_0xd24c('0x15')](function(_0x1be144){logger[_0xd24c('0x11')](_0xd24c('0x16'),_0x1be144[_0xd24c('0x13')],_0x170d59);_0x190fc1(_0x524158[_0xd24c('0x11')](0x1f4,_0x1be144['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 351c490..85f25dc 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 _0x5e3f=['/:id/clone','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/lists','post'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x5e3f,0x110));var _0xf5e3=function(_0x28e3c6,_0x31cf69){_0x28e3c6=_0x28e3c6-0x0;var _0x206c18=_0x5e3f[_0x28e3c6];return _0x206c18;};'use strict';var multer=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var path=require(_0xf5e3('0x2'));var timeout=require(_0xf5e3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf5e3('0x4'));var auth=require(_0xf5e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf5e3('0x6'));var controller=require(_0xf5e3('0x7'));router[_0xf5e3('0x8')]('/',auth[_0xf5e3('0x9')](),controller[_0xf5e3('0xa')]);router[_0xf5e3('0x8')](_0xf5e3('0xb'),auth[_0xf5e3('0x9')](),controller['show']);router[_0xf5e3('0x8')](_0xf5e3('0xc'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0xd')]);router['get'](_0xf5e3('0xe'),auth[_0xf5e3('0x9')](),controller['getHopperHistories']);router[_0xf5e3('0x8')](_0xf5e3('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xf5e3('0x9')](),controller['getHopperBlacks']);router[_0xf5e3('0x8')](_0xf5e3('0x10'),auth[_0xf5e3('0x9')](),controller['getLists']);router[_0xf5e3('0x8')]('/:id/blacklists',auth[_0xf5e3('0x9')](),controller['getBlackLists']);router[_0xf5e3('0x11')]('/',auth[_0xf5e3('0x9')](),controller['create']);router[_0xf5e3('0x11')](_0xf5e3('0x12'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x13')]);router[_0xf5e3('0x11')](_0xf5e3('0x10'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x14')]);router[_0xf5e3('0x11')](_0xf5e3('0x15'),auth[_0xf5e3('0x9')](),controller['addBlackLists']);router[_0xf5e3('0x16')](_0xf5e3('0xb'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x17')]);router[_0xf5e3('0x18')](_0xf5e3('0xb'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x19')]);router[_0xf5e3('0x18')]('/:id/lists',auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x1a')]);router[_0xf5e3('0x18')](_0xf5e3('0x15'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x1b')]);module[_0xf5e3('0x1c')]=router; \ No newline at end of file +var _0xcd3a=['getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','/:id/clone','/:id/lists','addLists','addBlackLists','put','destroy','delete','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals'];(function(_0x5c3911,_0x4a0911){var _0x120c8d=function(_0x1ad7fe){while(--_0x1ad7fe){_0x5c3911['push'](_0x5c3911['shift']());}};_0x120c8d(++_0x4a0911);}(_0xcd3a,0xcf));var _0xacd3=function(_0x32db4e,_0x38bc24){_0x32db4e=_0x32db4e-0x0;var _0x21276a=_0xcd3a[_0x32db4e];return _0x21276a;};'use strict';var multer=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var path=require(_0xacd3('0x2'));var timeout=require(_0xacd3('0x3'));var express=require(_0xacd3('0x4'));var router=express[_0xacd3('0x5')]();var fs_extra=require(_0xacd3('0x6'));var auth=require(_0xacd3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xacd3('0x8'));var controller=require(_0xacd3('0x9'));router[_0xacd3('0xa')]('/',auth[_0xacd3('0xb')](),controller['index']);router['get'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xd')]);router['get'](_0xacd3('0xe'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xf')]);router[_0xacd3('0xa')]('/:id/hopper_histories',auth[_0xacd3('0xb')](),controller['getHopperHistories']);router[_0xacd3('0xa')](_0xacd3('0x10'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x11')]);router['get'](_0xacd3('0x12'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x13')]);router['get']('/:id/lists',auth[_0xacd3('0xb')](),controller[_0xacd3('0x14')]);router['get'](_0xacd3('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xacd3('0x16')]('/',auth[_0xacd3('0xb')](),controller['create']);router[_0xacd3('0x16')](_0xacd3('0x17'),auth[_0xacd3('0xb')](),controller['clone']);router[_0xacd3('0x16')](_0xacd3('0x18'),auth['isAuthenticated'](),controller[_0xacd3('0x19')]);router[_0xacd3('0x16')](_0xacd3('0x15'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x1a')]);router[_0xacd3('0x1b')](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller['update']);router['delete'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x1c')]);router[_0xacd3('0x1d')](_0xacd3('0x18'),auth['isAuthenticated'](),controller[_0xacd3('0x1e')]);router[_0xacd3('0x1d')](_0xacd3('0x15'),auth[_0xacd3('0xb')](),controller['removeBlackLists']);module[_0xacd3('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6d6c118..e03f0e1 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 _0x2227=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0xbf3522,_0x306da0){var _0x47c693=function(_0x18c5c7){while(--_0x18c5c7){_0xbf3522['push'](_0xbf3522['shift']());}};_0x47c693(++_0x306da0);}(_0x2227,0x1a4));var _0x7222=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2227[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x7222('0x0'));module[_0x7222('0x1')]={'key':{'type':Sequelize[_0x7222('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7222('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7222('0x4')],'get':function(){return this[_0x7222('0x5')]('key');}}}; \ No newline at end of file +var _0xd827=['TEXT','VIRTUAL','exports','STRING'];(function(_0x201bb7,_0xb4ae42){var _0x463e3b=function(_0x4d7920){while(--_0x4d7920){_0x201bb7['push'](_0x201bb7['shift']());}};_0x463e3b(++_0xb4ae42);}(_0xd827,0x1a6));var _0x7d82=function(_0x1afedc,_0x17ee2f){_0x1afedc=_0x1afedc-0x0;var _0x3520db=_0xd827[_0x1afedc];return _0x3520db;};'use strict';var Sequelize=require('sequelize');module[_0x7d82('0x0')]={'key':{'type':Sequelize[_0x7d82('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7d82('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7d82('0x1')]},'name':{'type':Sequelize[_0x7d82('0x3')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 15bc83a..f9106b1 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 _0xe86d=['destroy','get','end','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','include','CannedAnswer','findAll','rows','catch','show','params','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe86d,0x90));var _0xde86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe86d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xde86('0x0'));var rimraf=require(_0xde86('0x1'));var zipdir=require(_0xde86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde86('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xde86('0x4'));var util=require(_0xde86('0x5'));var path=require(_0xde86('0x6'));var sox=require(_0xde86('0x7'));var csv=require('to-csv');var ejs=require(_0xde86('0x8'));var fs=require('fs');var fs_extra=require(_0xde86('0x9'));var _=require(_0xde86('0xa'));var squel=require(_0xde86('0xb'));var crypto=require('crypto');var jsforce=require(_0xde86('0xc'));var deskjs=require(_0xde86('0xd'));var toCsv=require(_0xde86('0xe'));var querystring=require('querystring');var Papa=require(_0xde86('0xf'));var Redis=require(_0xde86('0x10'));var authService=require(_0xde86('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xde86('0x12'));var hardwareService=require(_0xde86('0x13'));var logger=require(_0xde86('0x14'))(_0xde86('0x15'));var utils=require(_0xde86('0x16'));var config=require(_0xde86('0x17'));var licenseUtil=require(_0xde86('0x18'));var db=require(_0xde86('0x19'))['db'];function respondWithStatusCode(_0xd1c2cd,_0x444016){_0x444016=_0x444016||0xcc;return function(_0x6bb311){if(_0x6bb311){return _0xd1c2cd[_0xde86('0x1a')](_0x444016);}return _0xd1c2cd[_0xde86('0x1b')](_0x444016)['end']();};}function respondWithResult(_0x352baf,_0x702339){_0x702339=_0x702339||0xc8;return function(_0x150615){if(_0x150615){return _0x352baf[_0xde86('0x1b')](_0x702339)[_0xde86('0x1c')](_0x150615);}};}function respondWithFilteredResult(_0x529918,_0x21f5aa){return function(_0x31e10d){if(_0x31e10d){var _0x58aa37=typeof _0x21f5aa[_0xde86('0x1d')]===_0xde86('0x1e')&&typeof _0x21f5aa[_0xde86('0x1f')]==='undefined';var _0x3f87a4=_0x31e10d[_0xde86('0x20')];var _0x1c9254=_0x58aa37?0x0:_0x21f5aa[_0xde86('0x1d')];var _0x236654=_0x58aa37?_0x31e10d[_0xde86('0x20')]:_0x21f5aa['offset']+_0x21f5aa['limit'];var _0x2a0cf4;if(_0x236654>=_0x3f87a4){_0x236654=_0x3f87a4;_0x2a0cf4=0xc8;}else{_0x2a0cf4=0xce;}_0x529918[_0xde86('0x1b')](_0x2a0cf4);return _0x529918[_0xde86('0x21')]('Content-Range',_0x1c9254+'-'+_0x236654+'/'+_0x3f87a4)['json'](_0x31e10d);}return null;};}function patchUpdates(_0x1139df){return function(_0x3904e6){try{jsonpatch[_0xde86('0x22')](_0x3904e6,_0x1139df,!![]);}catch(_0x4ad053){return BPromise['reject'](_0x4ad053);}return _0x3904e6[_0xde86('0x23')]();};}function saveUpdates(_0x40d7ee,_0x1122f1){return function(_0x3c44d0){if(_0x3c44d0){return _0x3c44d0[_0xde86('0x24')](_0x40d7ee)[_0xde86('0x25')](function(_0x79a81b){return _0x79a81b;});}return null;};}function removeEntity(_0x1ba777,_0x3ba609){return function(_0x19752d){if(_0x19752d){return _0x19752d[_0xde86('0x26')]()['then'](function(){var _0x10d731=_0x19752d[_0xde86('0x27')]({'plain':!![]});var _0xf6fbc='CannedAnswers';return db['UserProfileResource'][_0xde86('0x26')]({'where':{'type':_0xf6fbc,'resourceId':_0x10d731['id']}})['then'](function(){return _0x19752d;});})['then'](function(){_0x1ba777[_0xde86('0x1b')](0xcc)[_0xde86('0x28')]();});}};}function handleEntityNotFound(_0x120107,_0x4b7d75){return function(_0x4104a9){if(!_0x4104a9){_0x120107['sendStatus'](0x194);}return _0x4104a9;};}function handleError(_0x43b9e3,_0x1d2797){_0x1d2797=_0x1d2797||0x1f4;return function(_0x1afd60){logger[_0xde86('0x29')](_0x1afd60[_0xde86('0x2a')]);if(_0x1afd60['name']){delete _0x1afd60[_0xde86('0x2b')];}_0x43b9e3['status'](_0x1d2797)[_0xde86('0x2c')](_0x1afd60);};}exports['index']=function(_0x3c1d6b,_0x2ad3e7){var _0x33abae={},_0x2efae9={},_0x56d242={'count':0x0,'rows':[]};var _0x2a1aad=_['map'](db['CannedAnswer'][_0xde86('0x2d')],function(_0x40757d){return{'name':_0x40757d[_0xde86('0x2e')],'type':_0x40757d[_0xde86('0x2f')][_0xde86('0x30')]};});_0x2efae9['model']=_[_0xde86('0x31')](_0x2a1aad,_0xde86('0x2b'));_0x2efae9[_0xde86('0x32')]=_[_0xde86('0x33')](_0x3c1d6b[_0xde86('0x32')]);_0x2efae9[_0xde86('0x34')]=_[_0xde86('0x35')](_0x2efae9['model'],_0x2efae9[_0xde86('0x32')]);_0x33abae[_0xde86('0x36')]=_[_0xde86('0x35')](_0x2efae9[_0xde86('0x37')],qs[_0xde86('0x38')](_0x3c1d6b['query']['fields']));_0x33abae[_0xde86('0x36')]=_0x33abae['attributes'][_0xde86('0x39')]?_0x33abae[_0xde86('0x36')]:_0x2efae9['model'];if(!_0x3c1d6b[_0xde86('0x32')][_0xde86('0x3a')](_0xde86('0x3b'))){_0x33abae[_0xde86('0x1f')]=qs['limit'](_0x3c1d6b[_0xde86('0x32')][_0xde86('0x1f')]);_0x33abae['offset']=qs[_0xde86('0x1d')](_0x3c1d6b[_0xde86('0x32')]['offset']);}_0x33abae['order']=qs['sort'](_0x3c1d6b[_0xde86('0x32')][_0xde86('0x3c')]);_0x33abae[_0xde86('0x3d')]=qs[_0xde86('0x34')](_['pick'](_0x3c1d6b[_0xde86('0x32')],_0x2efae9[_0xde86('0x34')]),_0x2a1aad);if(_0x3c1d6b['query']['filter']){_0x33abae['where']=_[_0xde86('0x3e')](_0x33abae[_0xde86('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3c1d6b[_0xde86('0x32')][_0xde86('0x3f')]+'%'}},{'value':{'$like':'%'+_0x3c1d6b[_0xde86('0x32')]['filter']+'%'}}]});}_0x33abae=_[_0xde86('0x3e')]({},_0x33abae,_0x3c1d6b[_0xde86('0x40')]);var _0x3ed5f9={'where':_0x33abae[_0xde86('0x3d')]};return db['CannedAnswer'][_0xde86('0x20')](_0x3ed5f9)[_0xde86('0x25')](function(_0x3f1f33){_0x56d242['count']=_0x3f1f33;if(_0x3c1d6b[_0xde86('0x32')]['includeAll']){_0x33abae[_0xde86('0x41')]=[{'all':!![]}];}return db[_0xde86('0x42')][_0xde86('0x43')](_0x33abae);})[_0xde86('0x25')](function(_0x5ff4a8){_0x56d242[_0xde86('0x44')]=_0x5ff4a8;return _0x56d242;})[_0xde86('0x25')](respondWithFilteredResult(_0x2ad3e7,_0x33abae))[_0xde86('0x45')](handleError(_0x2ad3e7,null));};exports[_0xde86('0x46')]=function(_0x4eba27,_0x19567c){var _0x29ac8f={'raw':!![],'where':{'id':_0x4eba27[_0xde86('0x47')]['id']}},_0x42dfe1={};_0x42dfe1[_0xde86('0x37')]=_[_0xde86('0x33')](db[_0xde86('0x42')]['rawAttributes']);_0x42dfe1['query']=_[_0xde86('0x33')](_0x4eba27[_0xde86('0x32')]);_0x42dfe1['filters']=_[_0xde86('0x35')](_0x42dfe1[_0xde86('0x37')],_0x42dfe1['query']);_0x29ac8f[_0xde86('0x36')]=_['intersection'](_0x42dfe1[_0xde86('0x37')],qs[_0xde86('0x38')](_0x4eba27[_0xde86('0x32')][_0xde86('0x38')]));_0x29ac8f['attributes']=_0x29ac8f[_0xde86('0x36')]['length']?_0x29ac8f[_0xde86('0x36')]:_0x42dfe1[_0xde86('0x37')];if(_0x4eba27['query'][_0xde86('0x48')]){_0x29ac8f[_0xde86('0x41')]=[{'all':!![]}];}_0x29ac8f=_['merge']({},_0x29ac8f,_0x4eba27['options']);return db[_0xde86('0x42')][_0xde86('0x49')](_0x29ac8f)[_0xde86('0x25')](handleEntityNotFound(_0x19567c,null))[_0xde86('0x25')](respondWithResult(_0x19567c,null))['catch'](handleError(_0x19567c,null));};exports[_0xde86('0x24')]=function(_0x21fdb2,_0x2565b9){if(_0x21fdb2[_0xde86('0x4a')]['id']){delete _0x21fdb2[_0xde86('0x4a')]['id'];}return db['CannedAnswer'][_0xde86('0x49')]({'where':{'id':_0x21fdb2[_0xde86('0x47')]['id']}})[_0xde86('0x25')](handleEntityNotFound(_0x2565b9,null))[_0xde86('0x25')](saveUpdates(_0x21fdb2[_0xde86('0x4a')],null))[_0xde86('0x25')](respondWithResult(_0x2565b9,null))[_0xde86('0x45')](handleError(_0x2565b9,null));};exports[_0xde86('0x26')]=function(_0x43b621,_0x6ad368){return db[_0xde86('0x42')]['find']({'where':{'id':_0x43b621[_0xde86('0x47')]['id']}})[_0xde86('0x25')](handleEntityNotFound(_0x6ad368,null))[_0xde86('0x25')](removeEntity(_0x6ad368,null))[_0xde86('0x45')](handleError(_0x6ad368,null));};exports[_0xde86('0x4b')]=function(_0x4e1fb0,_0x2ffe2f){var _0x469a68={'key':_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x30')]};if(_0x4e1fb0['body'][_0xde86('0x4c')]){_0x469a68[_0xde86('0x4c')]=_0x4e1fb0[_0xde86('0x4a')]['MailAccountId'];}else if(_0x4e1fb0[_0xde86('0x4a')]['SmsAccountId']){_0x469a68['SmsAccountId']=_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x4d')];}else if(_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x4e')]){_0x469a68['OpenchannelAccountId']=_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x4e')];}else if(_0x4e1fb0['body'][_0xde86('0x4f')]){_0x469a68[_0xde86('0x4f')]=_0x4e1fb0[_0xde86('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x469a68})[_0xde86('0x25')](function(_0x369d80){if(_0x369d80){throw new db[(_0xde86('0x50'))][(_0xde86('0x51'))](_0xde86('0x52'));}return db[_0xde86('0x42')][_0xde86('0x4b')](_0x4e1fb0[_0xde86('0x4a')]);})[_0xde86('0x25')](function(_0x141c5d){var _0x5c26a6=_0x4e1fb0[_0xde86('0x53')][_0xde86('0x27')]({'plain':!![]});if(!_0x5c26a6)throw new Error(_0xde86('0x54'));if(_0x5c26a6['role']==='user'){var _0x5ed9d3=_0x141c5d[_0xde86('0x27')]({'plain':!![]});return db[_0xde86('0x55')][_0xde86('0x49')]({'where':{'name':_0xde86('0x56'),'userProfileId':_0x5c26a6[_0xde86('0x57')]},'raw':!![]})['then'](function(_0x3cd7e1){if(_0x3cd7e1&&_0x3cd7e1[_0xde86('0x58')]===0x0){return db[_0xde86('0x59')]['create']({'name':_0x5ed9d3[_0xde86('0x2b')],'resourceId':_0x5ed9d3['id'],'type':_0x3cd7e1[_0xde86('0x2b')],'sectionId':_0x3cd7e1['id']},{})[_0xde86('0x25')](function(){return _0x141c5d;});}else{return _0x141c5d;}})[_0xde86('0x45')](function(_0x4ca7aa){logger['error'](_0xde86('0x5a'),_0x4ca7aa);throw _0x4ca7aa;});}return _0x141c5d;})[_0xde86('0x25')](respondWithResult(_0x2ffe2f,0xc9))[_0xde86('0x45')](handleError(_0x2ffe2f,null));}; \ No newline at end of file +var _0x5f53=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','reject','update','then','destroy','get','CannedAnswers','end','sendStatus','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','body','create','MailAccountId'];(function(_0x63c9b5,_0x5e9ef1){var _0x4b50fd=function(_0x10a37d){while(--_0x10a37d){_0x63c9b5['push'](_0x63c9b5['shift']());}};_0x4b50fd(++_0x5e9ef1);}(_0x5f53,0x16c));var _0x35f5=function(_0x3fe1ba,_0x1a33c5){_0x3fe1ba=_0x3fe1ba-0x0;var _0x5df1b4=_0x5f53[_0x3fe1ba];return _0x5df1b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x35f5('0x0'));var jsonpatch=require(_0x35f5('0x1'));var rp=require(_0x35f5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35f5('0x3'));var util=require('util');var path=require(_0x35f5('0x4'));var sox=require(_0x35f5('0x5'));var csv=require(_0x35f5('0x6'));var ejs=require(_0x35f5('0x7'));var fs=require('fs');var fs_extra=require(_0x35f5('0x8'));var _=require(_0x35f5('0x9'));var squel=require(_0x35f5('0xa'));var crypto=require('crypto');var jsforce=require(_0x35f5('0xb'));var deskjs=require(_0x35f5('0xc'));var toCsv=require(_0x35f5('0x6'));var querystring=require(_0x35f5('0xd'));var Papa=require(_0x35f5('0xe'));var Redis=require(_0x35f5('0xf'));var authService=require(_0x35f5('0x10'));var qs=require(_0x35f5('0x11'));var as=require(_0x35f5('0x12'));var hardwareService=require(_0x35f5('0x13'));var logger=require(_0x35f5('0x14'))(_0x35f5('0x15'));var utils=require(_0x35f5('0x16'));var config=require(_0x35f5('0x17'));var licenseUtil=require(_0x35f5('0x18'));var db=require(_0x35f5('0x19'))['db'];function respondWithStatusCode(_0x5ec872,_0x234bea){_0x234bea=_0x234bea||0xcc;return function(_0x12ed6c){if(_0x12ed6c){return _0x5ec872['sendStatus'](_0x234bea);}return _0x5ec872[_0x35f5('0x1a')](_0x234bea)['end']();};}function respondWithResult(_0xd386d1,_0xab27bc){_0xab27bc=_0xab27bc||0xc8;return function(_0x50778e){if(_0x50778e){return _0xd386d1['status'](_0xab27bc)['json'](_0x50778e);}};}function respondWithFilteredResult(_0x3ef14e,_0x5e0dc5){return function(_0x1f7193){if(_0x1f7193){var _0x15e7cf=typeof _0x5e0dc5[_0x35f5('0x1b')]===_0x35f5('0x1c')&&typeof _0x5e0dc5[_0x35f5('0x1d')]===_0x35f5('0x1c');var _0x5883f1=_0x1f7193[_0x35f5('0x1e')];var _0x1d8b9b=_0x15e7cf?0x0:_0x5e0dc5[_0x35f5('0x1b')];var _0x5e72c7=_0x15e7cf?_0x1f7193[_0x35f5('0x1e')]:_0x5e0dc5[_0x35f5('0x1b')]+_0x5e0dc5['limit'];var _0x48ce20;if(_0x5e72c7>=_0x5883f1){_0x5e72c7=_0x5883f1;_0x48ce20=0xc8;}else{_0x48ce20=0xce;}_0x3ef14e[_0x35f5('0x1a')](_0x48ce20);return _0x3ef14e['set']('Content-Range',_0x1d8b9b+'-'+_0x5e72c7+'/'+_0x5883f1)[_0x35f5('0x1f')](_0x1f7193);}return null;};}function patchUpdates(_0x5f51c9){return function(_0x1a09dc){try{jsonpatch['apply'](_0x1a09dc,_0x5f51c9,!![]);}catch(_0x34724f){return BPromise[_0x35f5('0x20')](_0x34724f);}return _0x1a09dc['save']();};}function saveUpdates(_0x471b9f,_0x42d87b){return function(_0x24eaed){if(_0x24eaed){return _0x24eaed[_0x35f5('0x21')](_0x471b9f)[_0x35f5('0x22')](function(_0x162e4a){return _0x162e4a;});}return null;};}function removeEntity(_0x54551c,_0x15ba52){return function(_0xd7b6e3){if(_0xd7b6e3){return _0xd7b6e3[_0x35f5('0x23')]()['then'](function(){var _0x15106e=_0xd7b6e3[_0x35f5('0x24')]({'plain':!![]});var _0x363273=_0x35f5('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x363273,'resourceId':_0x15106e['id']}})[_0x35f5('0x22')](function(){return _0xd7b6e3;});})[_0x35f5('0x22')](function(){_0x54551c['status'](0xcc)[_0x35f5('0x26')]();});}};}function handleEntityNotFound(_0xd2e63,_0x546f05){return function(_0x98c737){if(!_0x98c737){_0xd2e63[_0x35f5('0x27')](0x194);}return _0x98c737;};}function handleError(_0x521d54,_0x32fd4f){_0x32fd4f=_0x32fd4f||0x1f4;return function(_0x9fb9f4){logger[_0x35f5('0x28')](_0x9fb9f4[_0x35f5('0x29')]);if(_0x9fb9f4[_0x35f5('0x2a')]){delete _0x9fb9f4['name'];}_0x521d54[_0x35f5('0x1a')](_0x32fd4f)[_0x35f5('0x2b')](_0x9fb9f4);};}exports[_0x35f5('0x2c')]=function(_0xda6f32,_0x198298){var _0x1bc7d0={},_0x4990ed={},_0xfffe2={'count':0x0,'rows':[]};var _0x35a514=_[_0x35f5('0x2d')](db[_0x35f5('0x2e')]['rawAttributes'],function(_0x15eb2f){return{'name':_0x15eb2f[_0x35f5('0x2f')],'type':_0x15eb2f[_0x35f5('0x30')][_0x35f5('0x31')]};});_0x4990ed[_0x35f5('0x32')]=_[_0x35f5('0x2d')](_0x35a514,_0x35f5('0x2a'));_0x4990ed['query']=_['keys'](_0xda6f32[_0x35f5('0x33')]);_0x4990ed[_0x35f5('0x34')]=_[_0x35f5('0x35')](_0x4990ed[_0x35f5('0x32')],_0x4990ed['query']);_0x1bc7d0[_0x35f5('0x36')]=_[_0x35f5('0x35')](_0x4990ed['model'],qs[_0x35f5('0x37')](_0xda6f32[_0x35f5('0x33')][_0x35f5('0x37')]));_0x1bc7d0[_0x35f5('0x36')]=_0x1bc7d0[_0x35f5('0x36')][_0x35f5('0x38')]?_0x1bc7d0[_0x35f5('0x36')]:_0x4990ed[_0x35f5('0x32')];if(!_0xda6f32['query']['hasOwnProperty'](_0x35f5('0x39'))){_0x1bc7d0[_0x35f5('0x1d')]=qs['limit'](_0xda6f32[_0x35f5('0x33')][_0x35f5('0x1d')]);_0x1bc7d0[_0x35f5('0x1b')]=qs[_0x35f5('0x1b')](_0xda6f32[_0x35f5('0x33')][_0x35f5('0x1b')]);}_0x1bc7d0[_0x35f5('0x3a')]=qs[_0x35f5('0x3b')](_0xda6f32['query'][_0x35f5('0x3b')]);_0x1bc7d0[_0x35f5('0x3c')]=qs['filters'](_['pick'](_0xda6f32['query'],_0x4990ed[_0x35f5('0x34')]),_0x35a514);if(_0xda6f32[_0x35f5('0x33')]['filter']){_0x1bc7d0['where']=_[_0x35f5('0x3d')](_0x1bc7d0[_0x35f5('0x3c')],{'$or':[{'key':{'$like':'%'+_0xda6f32['query']['filter']+'%'}},{'value':{'$like':'%'+_0xda6f32[_0x35f5('0x33')][_0x35f5('0x3e')]+'%'}}]});}_0x1bc7d0=_['merge']({},_0x1bc7d0,_0xda6f32[_0x35f5('0x3f')]);var _0x537bc1={'where':_0x1bc7d0[_0x35f5('0x3c')]};return db[_0x35f5('0x2e')]['count'](_0x537bc1)[_0x35f5('0x22')](function(_0x2444b6){_0xfffe2[_0x35f5('0x1e')]=_0x2444b6;if(_0xda6f32[_0x35f5('0x33')][_0x35f5('0x40')]){_0x1bc7d0[_0x35f5('0x41')]=[{'all':!![]}];}return db[_0x35f5('0x2e')][_0x35f5('0x42')](_0x1bc7d0);})[_0x35f5('0x22')](function(_0x17731a){_0xfffe2[_0x35f5('0x43')]=_0x17731a;return _0xfffe2;})[_0x35f5('0x22')](respondWithFilteredResult(_0x198298,_0x1bc7d0))[_0x35f5('0x44')](handleError(_0x198298,null));};exports[_0x35f5('0x45')]=function(_0x2e4c59,_0x7addae){var _0x152803={'raw':!![],'where':{'id':_0x2e4c59[_0x35f5('0x46')]['id']}},_0x4be52a={};_0x4be52a[_0x35f5('0x32')]=_[_0x35f5('0x47')](db[_0x35f5('0x2e')][_0x35f5('0x48')]);_0x4be52a['query']=_['keys'](_0x2e4c59[_0x35f5('0x33')]);_0x4be52a[_0x35f5('0x34')]=_['intersection'](_0x4be52a[_0x35f5('0x32')],_0x4be52a[_0x35f5('0x33')]);_0x152803['attributes']=_[_0x35f5('0x35')](_0x4be52a[_0x35f5('0x32')],qs[_0x35f5('0x37')](_0x2e4c59[_0x35f5('0x33')][_0x35f5('0x37')]));_0x152803[_0x35f5('0x36')]=_0x152803['attributes'][_0x35f5('0x38')]?_0x152803[_0x35f5('0x36')]:_0x4be52a[_0x35f5('0x32')];if(_0x2e4c59['query']['includeAll']){_0x152803['include']=[{'all':!![]}];}_0x152803=_['merge']({},_0x152803,_0x2e4c59[_0x35f5('0x3f')]);return db[_0x35f5('0x2e')]['find'](_0x152803)[_0x35f5('0x22')](handleEntityNotFound(_0x7addae,null))['then'](respondWithResult(_0x7addae,null))[_0x35f5('0x44')](handleError(_0x7addae,null));};exports[_0x35f5('0x21')]=function(_0x4dfc0b,_0x405421){if(_0x4dfc0b['body']['id']){delete _0x4dfc0b[_0x35f5('0x49')]['id'];}return db[_0x35f5('0x2e')]['find']({'where':{'id':_0x4dfc0b[_0x35f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x405421,null))['then'](saveUpdates(_0x4dfc0b[_0x35f5('0x49')],null))[_0x35f5('0x22')](respondWithResult(_0x405421,null))['catch'](handleError(_0x405421,null));};exports[_0x35f5('0x23')]=function(_0x4d539b,_0x4d6ad3){return db[_0x35f5('0x2e')]['find']({'where':{'id':_0x4d539b[_0x35f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d6ad3,null))[_0x35f5('0x22')](removeEntity(_0x4d6ad3,null))[_0x35f5('0x44')](handleError(_0x4d6ad3,null));};exports[_0x35f5('0x4a')]=function(_0x1699a7,_0x55b7f1){var _0x34b87c={'key':_0x1699a7['body'][_0x35f5('0x31')]};if(_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4b')]){_0x34b87c[_0x35f5('0x4b')]=_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4b')];}else if(_0x1699a7[_0x35f5('0x49')]['SmsAccountId']){_0x34b87c[_0x35f5('0x4c')]=_0x1699a7[_0x35f5('0x49')]['SmsAccountId'];}else if(_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4d')]){_0x34b87c[_0x35f5('0x4d')]=_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4d')];}else if(_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4e')]){_0x34b87c[_0x35f5('0x4e')]=_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4e')];}return db[_0x35f5('0x2e')][_0x35f5('0x4f')]({'where':_0x34b87c})['then'](function(_0x5ad125){if(_0x5ad125){throw new db[(_0x35f5('0x50'))]['ValidationError'](_0x35f5('0x51'));}return db[_0x35f5('0x2e')]['create'](_0x1699a7['body']);})[_0x35f5('0x22')](function(_0x16c21e){var _0x5647d7=_0x1699a7[_0x35f5('0x52')][_0x35f5('0x24')]({'plain':!![]});if(!_0x5647d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5647d7[_0x35f5('0x53')]===_0x35f5('0x52')){var _0x724e46=_0x16c21e[_0x35f5('0x24')]({'plain':!![]});return db[_0x35f5('0x54')][_0x35f5('0x4f')]({'where':{'name':'CannedAnswers','userProfileId':_0x5647d7['userProfileId']},'raw':!![]})[_0x35f5('0x22')](function(_0x40ddd9){if(_0x40ddd9&&_0x40ddd9[_0x35f5('0x55')]===0x0){return db[_0x35f5('0x56')][_0x35f5('0x4a')]({'name':_0x724e46[_0x35f5('0x2a')],'resourceId':_0x724e46['id'],'type':_0x40ddd9[_0x35f5('0x2a')],'sectionId':_0x40ddd9['id']},{})[_0x35f5('0x22')](function(){return _0x16c21e;});}else{return _0x16c21e;}})[_0x35f5('0x44')](function(_0x5d2e9f){logger[_0x35f5('0x28')](_0x35f5('0x57'),_0x5d2e9f);throw _0x5d2e9f;});}return _0x16c21e;})[_0x35f5('0x22')](respondWithResult(_0x55b7f1,0xc9))[_0x35f5('0x44')](handleError(_0x55b7f1,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 89826a1..573a9a2 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 _0x0f6d=['request-promise','path','rimraf','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x57d9fe,_0x47b607){var _0x2a7839=function(_0xa60873){while(--_0xa60873){_0x57d9fe['push'](_0x57d9fe['shift']());}};_0x2a7839(++_0x47b607);}(_0x0f6d,0xe5));var _0xd0f6=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0x0f6d[_0x1ac6ec];return _0x48a489;};'use strict';var _=require(_0xd0f6('0x0'));var util=require(_0xd0f6('0x1'));var logger=require(_0xd0f6('0x2'))(_0xd0f6('0x3'));var moment=require(_0xd0f6('0x4'));var BPromise=require('bluebird');var rp=require(_0xd0f6('0x5'));var fs=require('fs');var path=require(_0xd0f6('0x6'));var rimraf=require(_0xd0f6('0x7'));var config=require('../../config/environment');var attributes=require(_0xd0f6('0x8'));module['exports']=function(_0x268250,_0x1f8f4e){return _0x268250[_0xd0f6('0x9')](_0xd0f6('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd0f6('0xb'),'collate':_0xd0f6('0xc')});}; \ No newline at end of file +var _0x48a1=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3bb4c7,_0x1a6eae){var _0x134ef1=function(_0x4c3e4c){while(--_0x4c3e4c){_0x3bb4c7['push'](_0x3bb4c7['shift']());}};_0x134ef1(++_0x1a6eae);}(_0x48a1,0xf5));var _0x148a=function(_0x58d17e,_0x2f4fdb){_0x58d17e=_0x58d17e-0x0;var _0x30a6da=_0x48a1[_0x58d17e];return _0x30a6da;};'use strict';var _=require(_0x148a('0x0'));var util=require(_0x148a('0x1'));var logger=require(_0x148a('0x2'))(_0x148a('0x3'));var moment=require(_0x148a('0x4'));var BPromise=require(_0x148a('0x5'));var rp=require(_0x148a('0x6'));var fs=require('fs');var path=require(_0x148a('0x7'));var rimraf=require(_0x148a('0x8'));var config=require(_0x148a('0x9'));var attributes=require(_0x148a('0xa'));module[_0x148a('0xb')]=function(_0x4f3872,_0x3503cc){return _0x4f3872[_0x148a('0xc')]('CannedAnswer',attributes,{'tableName':_0x148a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a3df853..a6a6c05 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(_0x59ac1d,_0x2b5602){var _0x1f854d=function(_0x46944d){while(--_0x46944d){_0x59ac1d['push'](_0x59ac1d['shift']());}};_0x1f854d(++_0x2b5602);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _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(_0x19d0c4,_0x22d026){var _0x49d038=function(_0x9dcd35){while(--_0x9dcd35){_0x19d0c4['push'](_0x19d0c4['shift']());}};_0x49d038(++_0x22d026);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 a0de84c..ad949e8 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 _0x4d8d=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','create','put','update','delete','destroy'];(function(_0x5ce313,_0x503c5d){var _0x5c8ea4=function(_0x3c19d3){while(--_0x3c19d3){_0x5ce313['push'](_0x5ce313['shift']());}};_0x5c8ea4(++_0x503c5d);}(_0x4d8d,0x1dc));var _0xd4d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4d8d[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xd4d8('0x0'));var path=require(_0xd4d8('0x1'));var timeout=require(_0xd4d8('0x2'));var express=require(_0xd4d8('0x3'));var router=express[_0xd4d8('0x4')]();var fs_extra=require(_0xd4d8('0x5'));var auth=require(_0xd4d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd4d8('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd4d8('0x8')]);router[_0xd4d8('0x9')](_0xd4d8('0xa'),auth[_0xd4d8('0xb')](),controller[_0xd4d8('0xc')]);router['post']('/',auth[_0xd4d8('0xb')](),controller[_0xd4d8('0xd')]);router[_0xd4d8('0xe')](_0xd4d8('0xa'),auth['isAuthenticated'](),controller[_0xd4d8('0xf')]);router[_0xd4d8('0x10')](_0xd4d8('0xa'),auth[_0xd4d8('0xb')](),controller[_0xd4d8('0x11')]);module[_0xd4d8('0x12')]=router; \ No newline at end of file +var _0x259c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','/:id','show','create','put','update','delete','isAuthenticated','destroy','exports','util','connect-timeout'];(function(_0x21ac49,_0x1e6c08){var _0x256831=function(_0x4ea219){while(--_0x4ea219){_0x21ac49['push'](_0x21ac49['shift']());}};_0x256831(++_0x1e6c08);}(_0x259c,0x17a));var _0xc259=function(_0x5aa1fc,_0x2f6b2e){_0x5aa1fc=_0x5aa1fc-0x0;var _0x4a2248=_0x259c[_0x5aa1fc];return _0x4a2248;};'use strict';var multer=require('multer');var util=require(_0xc259('0x0'));var path=require('path');var timeout=require(_0xc259('0x1'));var express=require(_0xc259('0x2'));var router=express[_0xc259('0x3')]();var fs_extra=require(_0xc259('0x4'));var auth=require(_0xc259('0x5'));var interaction=require(_0xc259('0x6'));var config=require('../../config/environment');var controller=require(_0xc259('0x7'));router[_0xc259('0x8')]('/',auth['isAuthenticated'](),controller[_0xc259('0x9')]);router[_0xc259('0x8')](_0xc259('0xa'),auth['isAuthenticated'](),controller[_0xc259('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc259('0xc')]);router[_0xc259('0xd')](_0xc259('0xa'),auth['isAuthenticated'](),controller[_0xc259('0xe')]);router[_0xc259('0xf')](_0xc259('0xa'),auth[_0xc259('0x10')](),controller[_0xc259('0x11')]);module[_0xc259('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4148018..a71bb75 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 _0xa101=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x4c9237,_0x5b8622){var _0x374b49=function(_0x18a22c){while(--_0x18a22c){_0x4c9237['push'](_0x4c9237['shift']());}};_0x374b49(++_0x5b8622);}(_0xa101,0x15f));var _0x1a10=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xa101[_0x51cc1d];return _0x2eb9f2;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x1a10('0x2')},'clid':{'type':Sequelize[_0x1a10('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x1a10('0x3')]},'dcontext':{'type':Sequelize[_0x1a10('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x1a10('0x3')]},'lastapp':{'type':Sequelize[_0x1a10('0x3')]},'lastdata':{'type':Sequelize[_0x1a10('0x3')]},'duration':{'type':Sequelize[_0x1a10('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1a10('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1a10('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1a10('0x3')]},'uniqueid':{'type':Sequelize[_0x1a10('0x3')]},'linkedid':{'type':Sequelize[_0x1a10('0x3')]},'sequence':{'type':Sequelize[_0x1a10('0x3')]},'peeraccount':{'type':Sequelize[_0x1a10('0x3')]},'type':{'type':Sequelize[_0x1a10('0x3')]},'tag':{'type':Sequelize[_0x1a10('0x3')]}}; \ No newline at end of file +var _0x0712=['1970-01-01\x2000:00:01','STRING','INTEGER','DATE'];(function(_0x4dd7c2,_0x5e86af){var _0x48ae97=function(_0x477727){while(--_0x477727){_0x4dd7c2['push'](_0x4dd7c2['shift']());}};_0x48ae97(++_0x5e86af);}(_0x0712,0x147));var _0x2071=function(_0x543b35,_0x4310bf){_0x543b35=_0x543b35-0x0;var _0x32a9df=_0x0712[_0x543b35];return _0x32a9df;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x2071('0x0')],'allowNull':![],'defaultValue':_0x2071('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x2071('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x2071('0x2')]},'channel':{'type':Sequelize[_0x2071('0x2')]},'dstchannel':{'type':Sequelize[_0x2071('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2071('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2071('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2071('0x2')]},'userfield':{'type':Sequelize[_0x2071('0x2')]},'uniqueid':{'type':Sequelize[_0x2071('0x2')]},'linkedid':{'type':Sequelize[_0x2071('0x2')]},'sequence':{'type':Sequelize[_0x2071('0x2')]},'peeraccount':{'type':Sequelize[_0x2071('0x2')]},'type':{'type':Sequelize[_0x2071('0x2')]},'tag':{'type':Sequelize[_0x2071('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 2cfe283..df2cc26 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 _0x31c2=['then','destroy','error','name','send','index','map','Cdr','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0x31c2,0x1e1));var _0x231c=function(_0x3a4105,_0x4386a2){_0x3a4105=_0x3a4105-0x0;var _0x578907=_0x31c2[_0x3a4105];return _0x578907;};'use strict';var emlformat=require(_0x231c('0x0'));var rimraf=require(_0x231c('0x1'));var zipdir=require(_0x231c('0x2'));var jsonpatch=require(_0x231c('0x3'));var rp=require(_0x231c('0x4'));var moment=require(_0x231c('0x5'));var BPromise=require(_0x231c('0x6'));var Mustache=require(_0x231c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x231c('0x8'));var csv=require(_0x231c('0x9'));var ejs=require(_0x231c('0xa'));var fs=require('fs');var fs_extra=require(_0x231c('0xb'));var _=require('lodash');var squel=require(_0x231c('0xc'));var crypto=require('crypto');var jsforce=require(_0x231c('0xd'));var deskjs=require(_0x231c('0xe'));var toCsv=require(_0x231c('0x9'));var querystring=require('querystring');var Papa=require(_0x231c('0xf'));var Redis=require(_0x231c('0x10'));var authService=require(_0x231c('0x11'));var qs=require(_0x231c('0x12'));var as=require(_0x231c('0x13'));var hardwareService=require(_0x231c('0x14'));var logger=require(_0x231c('0x15'))('api');var utils=require(_0x231c('0x16'));var config=require(_0x231c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x231c('0x18'))['db'];function respondWithStatusCode(_0x43c270,_0x871ed1){_0x871ed1=_0x871ed1||0xcc;return function(_0x1aa3fe){if(_0x1aa3fe){return _0x43c270[_0x231c('0x19')](_0x871ed1);}return _0x43c270[_0x231c('0x1a')](_0x871ed1)[_0x231c('0x1b')]();};}function respondWithResult(_0x3355f6,_0xc09de5){_0xc09de5=_0xc09de5||0xc8;return function(_0x311218){if(_0x311218){return _0x3355f6[_0x231c('0x1a')](_0xc09de5)[_0x231c('0x1c')](_0x311218);}};}function respondWithFilteredResult(_0xe37de8,_0x1f7764){return function(_0x12a6ad){if(_0x12a6ad){var _0x210f2e=typeof _0x1f7764[_0x231c('0x1d')]===_0x231c('0x1e')&&typeof _0x1f7764[_0x231c('0x1f')]===_0x231c('0x1e');var _0x51b8ca=_0x12a6ad[_0x231c('0x20')];var _0x341645=_0x210f2e?0x0:_0x1f7764[_0x231c('0x1d')];var _0xadea80=_0x210f2e?_0x12a6ad[_0x231c('0x20')]:_0x1f7764[_0x231c('0x1d')]+_0x1f7764[_0x231c('0x1f')];var _0x172d50;if(_0xadea80>=_0x51b8ca){_0xadea80=_0x51b8ca;_0x172d50=0xc8;}else{_0x172d50=0xce;}_0xe37de8[_0x231c('0x1a')](_0x172d50);return _0xe37de8[_0x231c('0x21')]('Content-Range',_0x341645+'-'+_0xadea80+'/'+_0x51b8ca)[_0x231c('0x1c')](_0x12a6ad);}return null;};}function patchUpdates(_0x5e8a53){return function(_0x872034){try{jsonpatch['apply'](_0x872034,_0x5e8a53,!![]);}catch(_0x42cca3){return BPromise[_0x231c('0x22')](_0x42cca3);}return _0x872034[_0x231c('0x23')]();};}function saveUpdates(_0x3267f9,_0x255671){return function(_0x309393){if(_0x309393){return _0x309393[_0x231c('0x24')](_0x3267f9)[_0x231c('0x25')](function(_0x54566f){return _0x54566f;});}return null;};}function removeEntity(_0x128112,_0x3336d8){return function(_0x4af49b){if(_0x4af49b){return _0x4af49b[_0x231c('0x26')]()[_0x231c('0x25')](function(){_0x128112['status'](0xcc)[_0x231c('0x1b')]();});}};}function handleEntityNotFound(_0x564939,_0x3ea0cd){return function(_0x454f70){if(!_0x454f70){_0x564939[_0x231c('0x19')](0x194);}return _0x454f70;};}function handleError(_0x2a673c,_0x449d74){_0x449d74=_0x449d74||0x1f4;return function(_0x131cfd){logger[_0x231c('0x27')](_0x131cfd['stack']);if(_0x131cfd[_0x231c('0x28')]){delete _0x131cfd[_0x231c('0x28')];}_0x2a673c['status'](_0x449d74)[_0x231c('0x29')](_0x131cfd);};}exports[_0x231c('0x2a')]=function(_0x45ced8,_0xeeddfc){var _0x271635={},_0x15a9bb={},_0x40f76e={'count':0x0,'rows':[]};var _0x4dfaa3=_[_0x231c('0x2b')](db[_0x231c('0x2c')]['rawAttributes'],function(_0x4be2e2){return{'name':_0x4be2e2['fieldName'],'type':_0x4be2e2[_0x231c('0x2d')]['key']};});_0x15a9bb[_0x231c('0x2e')]=_['map'](_0x4dfaa3,_0x231c('0x28'));_0x15a9bb[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x45ced8[_0x231c('0x2f')]);_0x15a9bb['filters']=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],_0x15a9bb[_0x231c('0x2f')]);_0x271635[_0x231c('0x32')]=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x45ced8[_0x231c('0x2f')]['fields']));_0x271635['attributes']=_0x271635[_0x231c('0x32')][_0x231c('0x34')]?_0x271635[_0x231c('0x32')]:_0x15a9bb[_0x231c('0x2e')];if(!_0x45ced8[_0x231c('0x2f')][_0x231c('0x35')]('nolimit')){_0x271635[_0x231c('0x1f')]=qs[_0x231c('0x1f')](_0x45ced8['query']['limit']);_0x271635[_0x231c('0x1d')]=qs['offset'](_0x45ced8[_0x231c('0x2f')]['offset']);}_0x271635[_0x231c('0x36')]=qs[_0x231c('0x37')](_0x45ced8['query'][_0x231c('0x37')]);_0x271635[_0x231c('0x38')]=qs[_0x231c('0x39')](_['pick'](_0x45ced8[_0x231c('0x2f')],_0x15a9bb[_0x231c('0x39')]),_0x4dfaa3);if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3a')]){_0x271635[_0x231c('0x38')]=_[_0x231c('0x3b')](_0x271635[_0x231c('0x38')],{'$or':_[_0x231c('0x2b')](_0x4dfaa3,function(_0x409b01){if(_0x409b01[_0x231c('0x2d')]!==_0x231c('0x3c')){var _0x2c8033={};_0x2c8033[_0x409b01[_0x231c('0x28')]]={'$like':'%'+_0x45ced8['query'][_0x231c('0x3a')]+'%'};return _0x2c8033;}})});}_0x271635=_[_0x231c('0x3b')]({},_0x271635,_0x45ced8[_0x231c('0x3d')]);var _0x2f763d={'where':_0x271635[_0x231c('0x38')]};return db['Cdr'][_0x231c('0x20')](_0x2f763d)[_0x231c('0x25')](function(_0x229953){_0x40f76e['count']=_0x229953;if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3e')]){_0x271635[_0x231c('0x3f')]=[{'all':!![]}];}return db[_0x231c('0x2c')][_0x231c('0x40')](_0x271635);})[_0x231c('0x25')](function(_0x5d46eb){_0x40f76e[_0x231c('0x41')]=_0x5d46eb;return _0x40f76e;})[_0x231c('0x25')](respondWithFilteredResult(_0xeeddfc,_0x271635))[_0x231c('0x42')](handleError(_0xeeddfc,null));};exports[_0x231c('0x43')]=function(_0x518011,_0x33396b){var _0x523339={'raw':!![],'where':{'id':_0x518011['params']['id']}},_0x26bfd2={};_0x26bfd2[_0x231c('0x2e')]=_[_0x231c('0x30')](db[_0x231c('0x2c')][_0x231c('0x44')]);_0x26bfd2[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x518011['query']);_0x26bfd2[_0x231c('0x39')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],_0x26bfd2['query']);_0x523339[_0x231c('0x32')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x518011['query'][_0x231c('0x33')]));_0x523339['attributes']=_0x523339[_0x231c('0x32')][_0x231c('0x34')]?_0x523339[_0x231c('0x32')]:_0x26bfd2[_0x231c('0x2e')];if(_0x518011[_0x231c('0x2f')][_0x231c('0x3e')]){_0x523339[_0x231c('0x3f')]=[{'all':!![]}];}_0x523339=_[_0x231c('0x3b')]({},_0x523339,_0x518011[_0x231c('0x3d')]);return db[_0x231c('0x2c')][_0x231c('0x45')](_0x523339)[_0x231c('0x25')](handleEntityNotFound(_0x33396b,null))[_0x231c('0x25')](respondWithResult(_0x33396b,null))[_0x231c('0x42')](handleError(_0x33396b,null));};exports['create']=function(_0x18aaca,_0x293de2){return db[_0x231c('0x2c')][_0x231c('0x46')](_0x18aaca[_0x231c('0x47')],{})['then'](respondWithResult(_0x293de2,0xc9))['catch'](handleError(_0x293de2,null));};exports[_0x231c('0x24')]=function(_0x56a885,_0x419f63){if(_0x56a885[_0x231c('0x47')]['id']){delete _0x56a885[_0x231c('0x47')]['id'];}return db['Cdr'][_0x231c('0x45')]({'where':{'id':_0x56a885['params']['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x419f63,null))[_0x231c('0x25')](saveUpdates(_0x56a885['body'],null))[_0x231c('0x25')](respondWithResult(_0x419f63,null))[_0x231c('0x42')](handleError(_0x419f63,null));};exports[_0x231c('0x26')]=function(_0x5d2d20,_0x49baac){return db['Cdr'][_0x231c('0x45')]({'where':{'id':_0x5d2d20[_0x231c('0x48')]['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x49baac,null))['then'](removeEntity(_0x49baac,null))[_0x231c('0x42')](handleError(_0x49baac,null));};exports[_0x231c('0x49')]=function(_0x4fd60b,_0xf225d0){return db[_0x231c('0x2c')][_0x231c('0x49')]()[_0x231c('0x25')](respondWithResult(_0xf225d0,null))[_0x231c('0x42')](handleError(_0xf225d0,null));}; \ No newline at end of file +var _0x33c5=['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','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','create','body','catch','find','describe','rimraf','zip-dir','request-promise','moment'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x33c5,0xe6));var _0x533c=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x33c5[_0x1deee5];return _0x1d6c3a;};'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('0x2f')](_0x2fc7fa,_0x533c('0x2c'));_0x38d886[_0x533c('0x34')]=_[_0x533c('0x35')](_0x425f60[_0x533c('0x34')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x34')]);_0x212d1b[_0x533c('0x38')]=_[_0x533c('0x37')](_0x38d886[_0x533c('0x33')],qs['fields'](_0x425f60[_0x533c('0x34')][_0x533c('0x39')]));_0x212d1b[_0x533c('0x38')]=_0x212d1b[_0x533c('0x38')]['length']?_0x212d1b[_0x533c('0x38')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x34')][_0x533c('0x3a')](_0x533c('0x3b'))){_0x212d1b['limit']=qs['limit'](_0x425f60['query']['limit']);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b['order']=qs[_0x533c('0x3c')](_0x425f60[_0x533c('0x34')][_0x533c('0x3c')]);_0x212d1b['where']=qs[_0x533c('0x36')](_[_0x533c('0x3d')](_0x425f60[_0x533c('0x34')],_0x38d886['filters']),_0x2fc7fa);if(_0x425f60[_0x533c('0x34')][_0x533c('0x3e')]){_0x212d1b[_0x533c('0x3f')]=_['merge'](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x2cd02f){if(_0x2cd02f[_0x533c('0x31')]!==_0x533c('0x40')){var _0x4154f9={};_0x4154f9[_0x2cd02f[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x34')][_0x533c('0x3e')]+'%'};return _0x4154f9;}})});}_0x212d1b=_[_0x533c('0x41')]({},_0x212d1b,_0x425f60[_0x533c('0x42')]);var _0x55af6e={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x55af6e)[_0x533c('0x29')](function(_0x29b4c6){_0x3c559b[_0x533c('0x23')]=_0x29b4c6;if(_0x425f60['query'][_0x533c('0x43')]){_0x212d1b[_0x533c('0x44')]=[{'all':!![]}];}return db[_0x533c('0x30')]['findAll'](_0x212d1b);})[_0x533c('0x29')](function(_0x4170e4){_0x3c559b[_0x533c('0x45')]=_0x4170e4;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x4f5e26,_0x22447d){var _0x39034e={'raw':!![],'where':{'id':_0x4f5e26[_0x533c('0x47')]['id']}},_0x55a372={};_0x55a372[_0x533c('0x33')]=_[_0x533c('0x35')](db['Cdr']['rawAttributes']);_0x55a372['query']=_['keys'](_0x4f5e26[_0x533c('0x34')]);_0x55a372['filters']=_[_0x533c('0x37')](_0x55a372['model'],_0x55a372[_0x533c('0x34')]);_0x39034e['attributes']=_[_0x533c('0x37')](_0x55a372[_0x533c('0x33')],qs['fields'](_0x4f5e26[_0x533c('0x34')][_0x533c('0x39')]));_0x39034e[_0x533c('0x38')]=_0x39034e[_0x533c('0x38')][_0x533c('0x48')]?_0x39034e['attributes']:_0x55a372[_0x533c('0x33')];if(_0x4f5e26[_0x533c('0x34')][_0x533c('0x43')]){_0x39034e[_0x533c('0x44')]=[{'all':!![]}];}_0x39034e=_['merge']({},_0x39034e,_0x4f5e26[_0x533c('0x42')]);return db[_0x533c('0x30')]['find'](_0x39034e)['then'](handleEntityNotFound(_0x22447d,null))[_0x533c('0x29')](respondWithResult(_0x22447d,null))['catch'](handleError(_0x22447d,null));};exports[_0x533c('0x49')]=function(_0x2a9186,_0x19878d){return db[_0x533c('0x30')][_0x533c('0x49')](_0x2a9186[_0x533c('0x4a')],{})[_0x533c('0x29')](respondWithResult(_0x19878d,0xc9))[_0x533c('0x4b')](handleError(_0x19878d,null));};exports['update']=function(_0x19ccc0,_0x6b16e1){if(_0x19ccc0[_0x533c('0x4a')]['id']){delete _0x19ccc0['body']['id'];}return db[_0x533c('0x30')][_0x533c('0x4c')]({'where':{'id':_0x19ccc0['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x6b16e1,null))['then'](saveUpdates(_0x19ccc0[_0x533c('0x4a')],null))[_0x533c('0x29')](respondWithResult(_0x6b16e1,null))[_0x533c('0x4b')](handleError(_0x6b16e1,null));};exports[_0x533c('0x2a')]=function(_0x32d110,_0x3c46f3){return db[_0x533c('0x30')]['find']({'where':{'id':_0x32d110[_0x533c('0x47')]['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x3c46f3,null))[_0x533c('0x29')](removeEntity(_0x3c46f3,null))[_0x533c('0x4b')](handleError(_0x3c46f3,null));};exports[_0x533c('0x4d')]=function(_0x1558ef,_0x3eb174){return db['Cdr']['describe']()['then'](respondWithResult(_0x3eb174,null))['catch'](handleError(_0x3eb174,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a6f3266..1b443e5 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(_0x908ae1,_0x41fb27){var _0x4e54af=function(_0x3a1fe8){while(--_0x3a1fe8){_0x908ae1['push'](_0x908ae1['shift']());}};_0x4e54af(++_0x41fb27);}(_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':'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x779d4d,_0x5c0aa0){var _0x1194ec=function(_0x5281a9){while(--_0x5281a9){_0x779d4d['push'](_0x779d4d['shift']());}};_0x1194ec(++_0x5c0aa0);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 3dfd540..afad438 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 _0xcfce=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4d0f11,_0xa2db49){var _0x326505=function(_0x37b941){while(--_0x37b941){_0x4d0f11['push'](_0x4d0f11['shift']());}};_0x326505(++_0xa2db49);}(_0xcfce,0x125));var _0xecfc=function(_0x2e14f2,_0x377d0d){_0x2e14f2=_0x2e14f2-0x0;var _0x12cc03=_0xcfce[_0x2e14f2];return _0x12cc03;};'use strict';var _=require('lodash');var util=require(_0xecfc('0x0'));var moment=require(_0xecfc('0x1'));var BPromise=require(_0xecfc('0x2'));var rs=require(_0xecfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecfc('0x4'))['db'];var utils=require(_0xecfc('0x5'));var logger=require(_0xecfc('0x6'))('rpc');var config=require(_0xecfc('0x7'));var jayson=require(_0xecfc('0x8'));var client=jayson[_0xecfc('0x9')][_0xecfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x300d59,_0x422f35,_0xd760cd){return new BPromise(function(_0x3ac7eb,_0x2ab697){return client['request'](_0x300d59,_0xd760cd)[_0xecfc('0xb')](function(_0x4d1157){logger[_0xecfc('0xc')](_0xecfc('0xd'),_0x422f35,'request\x20sent');logger[_0xecfc('0xe')](_0xecfc('0xf'),_0x422f35,_0xecfc('0x10'),JSON[_0xecfc('0x11')](_0x4d1157));if(_0x4d1157[_0xecfc('0x12')]){if(_0x4d1157[_0xecfc('0x12')][_0xecfc('0x13')]===0x1f4){logger[_0xecfc('0x12')](_0xecfc('0xd'),_0x422f35,_0x4d1157[_0xecfc('0x12')]['message']);return _0x2ab697(_0x4d1157[_0xecfc('0x12')][_0xecfc('0x14')]);}logger[_0xecfc('0x12')](_0xecfc('0xd'),_0x422f35,_0x4d1157['error'][_0xecfc('0x14')]);return _0x3ac7eb(_0x4d1157[_0xecfc('0x12')][_0xecfc('0x14')]);}else{logger[_0xecfc('0xc')](_0xecfc('0xd'),_0x422f35,_0xecfc('0x10'));_0x3ac7eb(_0x4d1157[_0xecfc('0x15')][_0xecfc('0x14')]);}})[_0xecfc('0x16')](function(_0x5ab90d){logger[_0xecfc('0x12')](_0xecfc('0xd'),_0x422f35,_0x5ab90d);_0x2ab697(_0x5ab90d);});});} \ No newline at end of file +var _0xe6b2=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0xe6b2,0x15a));var _0x2e6b=function(_0x274a03,_0xa661ae){_0x274a03=_0x274a03-0x0;var _0x53b6dc=_0xe6b2[_0x274a03];return _0x53b6dc;};'use strict';var _=require('lodash');var util=require(_0x2e6b('0x0'));var moment=require(_0x2e6b('0x1'));var BPromise=require(_0x2e6b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e6b('0x3'));var db=require(_0x2e6b('0x4'))['db'];var utils=require(_0x2e6b('0x5'));var logger=require(_0x2e6b('0x6'))('rpc');var config=require(_0x2e6b('0x7'));var jayson=require(_0x2e6b('0x8'));var client=jayson[_0x2e6b('0x9')][_0x2e6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d11b,_0x47c6b9,_0x19e15d){return new BPromise(function(_0x2bc51e,_0x58480e){return client[_0x2e6b('0xb')](_0x16d11b,_0x19e15d)[_0x2e6b('0xc')](function(_0x5f26e2){logger[_0x2e6b('0xd')](_0x2e6b('0xe'),_0x47c6b9,_0x2e6b('0xf'));logger[_0x2e6b('0x10')](_0x2e6b('0x11'),_0x47c6b9,'request\x20sent',JSON[_0x2e6b('0x12')](_0x5f26e2));if(_0x5f26e2[_0x2e6b('0x13')]){if(_0x5f26e2[_0x2e6b('0x13')]['code']===0x1f4){logger[_0x2e6b('0x13')](_0x2e6b('0xe'),_0x47c6b9,_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);return _0x58480e(_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);}logger['error'](_0x2e6b('0xe'),_0x47c6b9,_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);return _0x2bc51e(_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);}else{logger[_0x2e6b('0xd')](_0x2e6b('0xe'),_0x47c6b9,'request\x20sent');_0x2bc51e(_0x5f26e2[_0x2e6b('0x15')][_0x2e6b('0x14')]);}})[_0x2e6b('0x16')](function(_0x181571){logger[_0x2e6b('0x13')](_0x2e6b('0xe'),_0x47c6b9,_0x181571);_0x58480e(_0x181571);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index e9978a2..21c9259 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(_0x33bf01,_0x1898f9){var _0x1d1cd2=function(_0x21dbc1){while(--_0x21dbc1){_0x33bf01['push'](_0x33bf01['shift']());}};_0x1d1cd2(++_0x1898f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xeb723,_0x404c45){var _0x541575=function(_0x41a16f){while(--_0x41a16f){_0xeb723['push'](_0xeb723['shift']());}};_0x541575(++_0x404c45);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f6037,_0x8e0a90){_0x4f6037=_0x4f6037-0x0;var _0x2542e2=_0xb10b[_0x4f6037];return _0x2542e2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index fe472a2..571c9d2 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 _0x71e1=['sequelize','exports','STRING','noop'];(function(_0x5addef,_0x161e9f){var _0x4078e3=function(_0xc62542){while(--_0xc62542){_0x5addef['push'](_0x5addef['shift']());}};_0x4078e3(++_0x161e9f);}(_0x71e1,0x104));var _0x171e=function(_0x3d6c3e,_0x1e6893){_0x3d6c3e=_0x3d6c3e-0x0;var _0x32eb9b=_0x71e1[_0x3d6c3e];return _0x32eb9b;};'use strict';var Sequelize=require(_0x171e('0x0'));module[_0x171e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x171e('0x2')],'allowNull':![],'defaultValue':_0x171e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x171e('0x2')]},'interval':{'type':Sequelize[_0x171e('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x31a7=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x31a7,0xeb));var _0x731a=function(_0x2ba7e8,_0x3ab3df){_0x2ba7e8=_0x2ba7e8-0x0;var _0x9a646b=_0x31a7[_0x2ba7e8];return _0x9a646b;};'use strict';var Sequelize=require(_0x731a('0x0'));module[_0x731a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x731a('0x2')],'allowNull':![],'defaultValue':_0x731a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x731a('0x2')]},'interval':{'type':Sequelize[_0x731a('0x2')],'defaultValue':_0x731a('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 655e56d..2c079b9 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 _0xd0b5=['send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','update','destroy','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','Content-Range','apply','reject','save','then','stack','name'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x4acc70,_0x384893){_0x4acc70=_0x4acc70-0x0;var _0x391f31=_0xd0b5[_0x4acc70];return _0x391f31;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5d0b('0x0'));var jsonpatch=require(_0x5d0b('0x1'));var rp=require('request-promise');var moment=require(_0x5d0b('0x2'));var BPromise=require(_0x5d0b('0x3'));var Mustache=require(_0x5d0b('0x4'));var util=require(_0x5d0b('0x5'));var path=require(_0x5d0b('0x6'));var sox=require(_0x5d0b('0x7'));var csv=require(_0x5d0b('0x8'));var ejs=require(_0x5d0b('0x9'));var fs=require('fs');var fs_extra=require(_0x5d0b('0xa'));var _=require(_0x5d0b('0xb'));var squel=require(_0x5d0b('0xc'));var crypto=require(_0x5d0b('0xd'));var jsforce=require(_0x5d0b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d0b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d0b('0xf'));var authService=require(_0x5d0b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5d0b('0x11'));var hardwareService=require(_0x5d0b('0x12'));var logger=require('../../config/logger')(_0x5d0b('0x13'));var utils=require(_0x5d0b('0x14'));var config=require(_0x5d0b('0x15'));var licenseUtil=require(_0x5d0b('0x16'));var db=require(_0x5d0b('0x17'))['db'];function respondWithStatusCode(_0x1361c9,_0x490886){_0x490886=_0x490886||0xcc;return function(_0x1894d4){if(_0x1894d4){return _0x1361c9[_0x5d0b('0x18')](_0x490886);}return _0x1361c9[_0x5d0b('0x19')](_0x490886)[_0x5d0b('0x1a')]();};}function respondWithResult(_0x5eacb2,_0x13ed44){_0x13ed44=_0x13ed44||0xc8;return function(_0x2c6996){if(_0x2c6996){return _0x5eacb2['status'](_0x13ed44)[_0x5d0b('0x1b')](_0x2c6996);}};}function respondWithFilteredResult(_0x4d5256,_0x4ef01f){return function(_0x2956ef){if(_0x2956ef){var _0x411ed2=typeof _0x4ef01f[_0x5d0b('0x1c')]===_0x5d0b('0x1d')&&typeof _0x4ef01f['limit']===_0x5d0b('0x1d');var _0x4732d8=_0x2956ef[_0x5d0b('0x1e')];var _0x32f522=_0x411ed2?0x0:_0x4ef01f[_0x5d0b('0x1c')];var _0x2299ad=_0x411ed2?_0x2956ef[_0x5d0b('0x1e')]:_0x4ef01f[_0x5d0b('0x1c')]+_0x4ef01f[_0x5d0b('0x1f')];var _0x32cb2d;if(_0x2299ad>=_0x4732d8){_0x2299ad=_0x4732d8;_0x32cb2d=0xc8;}else{_0x32cb2d=0xce;}_0x4d5256[_0x5d0b('0x19')](_0x32cb2d);return _0x4d5256[_0x5d0b('0x20')](_0x5d0b('0x21'),_0x32f522+'-'+_0x2299ad+'/'+_0x4732d8)['json'](_0x2956ef);}return null;};}function patchUpdates(_0x4c6fb2){return function(_0x7d619b){try{jsonpatch[_0x5d0b('0x22')](_0x7d619b,_0x4c6fb2,!![]);}catch(_0x308e85){return BPromise[_0x5d0b('0x23')](_0x308e85);}return _0x7d619b[_0x5d0b('0x24')]();};}function saveUpdates(_0x5975c1,_0xd710a9){return function(_0x41afe3){if(_0x41afe3){return _0x41afe3['update'](_0x5975c1)[_0x5d0b('0x25')](function(_0x24bb6){return _0x24bb6;});}return null;};}function removeEntity(_0x458ae3,_0x2a304c){return function(_0x49a5bb){if(_0x49a5bb){return _0x49a5bb['destroy']()[_0x5d0b('0x25')](function(){_0x458ae3[_0x5d0b('0x19')](0xcc)[_0x5d0b('0x1a')]();});}};}function handleEntityNotFound(_0x2bdf03,_0x2d9d8b){return function(_0x45c97f){if(!_0x45c97f){_0x2bdf03[_0x5d0b('0x18')](0x194);}return _0x45c97f;};}function handleError(_0x482525,_0x3ca47f){_0x3ca47f=_0x3ca47f||0x1f4;return function(_0x5b2adc){logger['error'](_0x5b2adc[_0x5d0b('0x26')]);if(_0x5b2adc[_0x5d0b('0x27')]){delete _0x5b2adc[_0x5d0b('0x27')];}_0x482525['status'](_0x3ca47f)[_0x5d0b('0x28')](_0x5b2adc);};}exports[_0x5d0b('0x29')]=function(_0x4bfcc2,_0x20e28b){var _0x15e418={'raw':!![],'where':{'id':_0x4bfcc2['params']['id']}},_0x2504b8={};_0x2504b8[_0x5d0b('0x2a')]=_[_0x5d0b('0x2b')](db[_0x5d0b('0x2c')][_0x5d0b('0x2d')]);_0x2504b8[_0x5d0b('0x2e')]=_[_0x5d0b('0x2b')](_0x4bfcc2['query']);_0x2504b8[_0x5d0b('0x2f')]=_[_0x5d0b('0x30')](_0x2504b8['model'],_0x2504b8[_0x5d0b('0x2e')]);_0x15e418[_0x5d0b('0x31')]=_[_0x5d0b('0x30')](_0x2504b8[_0x5d0b('0x2a')],qs[_0x5d0b('0x32')](_0x4bfcc2[_0x5d0b('0x2e')]['fields']));_0x15e418[_0x5d0b('0x31')]=_0x15e418[_0x5d0b('0x31')][_0x5d0b('0x33')]?_0x15e418['attributes']:_0x2504b8['model'];if(_0x4bfcc2[_0x5d0b('0x2e')][_0x5d0b('0x34')]){_0x15e418['include']=[{'all':!![]}];}_0x15e418=_[_0x5d0b('0x35')]({},_0x15e418,_0x4bfcc2[_0x5d0b('0x36')]);return db[_0x5d0b('0x2c')][_0x5d0b('0x37')](_0x15e418)[_0x5d0b('0x25')](handleEntityNotFound(_0x20e28b,null))[_0x5d0b('0x25')](respondWithResult(_0x20e28b,null))[_0x5d0b('0x38')](handleError(_0x20e28b,null));};exports[_0x5d0b('0x39')]=function(_0x4bcae6,_0x2f2e34){if(_0x4bcae6['body']['id']){delete _0x4bcae6['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x4bcae6['params']['id']}})[_0x5d0b('0x25')](handleEntityNotFound(_0x2f2e34,null))[_0x5d0b('0x25')](saveUpdates(_0x4bcae6['body'],null))[_0x5d0b('0x25')](respondWithResult(_0x2f2e34,null))[_0x5d0b('0x38')](handleError(_0x2f2e34,null));};exports[_0x5d0b('0x3a')]=function(_0x4fc272,_0x109c61){return db[_0x5d0b('0x2c')][_0x5d0b('0x37')]({'where':{'id':_0x4fc272[_0x5d0b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x109c61,null))[_0x5d0b('0x25')](removeEntity(_0x109c61,null))[_0x5d0b('0x38')](handleError(_0x109c61,null));}; \ No newline at end of file +var _0x915a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','include','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','sendStatus','error','stack','name','send'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x915a,0x1d2));var _0xa915=function(_0x503e1f,_0x283b79){_0x503e1f=_0x503e1f-0x0;var _0x3d3a87=_0x915a[_0x503e1f];return _0x3d3a87;};'use strict';var emlformat=require(_0xa915('0x0'));var rimraf=require(_0xa915('0x1'));var zipdir=require(_0xa915('0x2'));var jsonpatch=require(_0xa915('0x3'));var rp=require(_0xa915('0x4'));var moment=require('moment');var BPromise=require(_0xa915('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa915('0x6'));var sox=require(_0xa915('0x7'));var csv=require(_0xa915('0x8'));var ejs=require(_0xa915('0x9'));var fs=require('fs');var fs_extra=require(_0xa915('0xa'));var _=require(_0xa915('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa915('0xc'));var deskjs=require(_0xa915('0xd'));var toCsv=require(_0xa915('0x8'));var querystring=require(_0xa915('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa915('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa915('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa915('0x11'))(_0xa915('0x12'));var utils=require(_0xa915('0x13'));var config=require(_0xa915('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3edd93,_0x5d7c09){_0x5d7c09=_0x5d7c09||0xcc;return function(_0x274f4d){if(_0x274f4d){return _0x3edd93['sendStatus'](_0x5d7c09);}return _0x3edd93[_0xa915('0x15')](_0x5d7c09)[_0xa915('0x16')]();};}function respondWithResult(_0x22b588,_0x21d782){_0x21d782=_0x21d782||0xc8;return function(_0x3ecf23){if(_0x3ecf23){return _0x22b588[_0xa915('0x15')](_0x21d782)['json'](_0x3ecf23);}};}function respondWithFilteredResult(_0x23ecd8,_0x19889d){return function(_0xf9f02c){if(_0xf9f02c){var _0x590be6=typeof _0x19889d[_0xa915('0x17')]===_0xa915('0x18')&&typeof _0x19889d[_0xa915('0x19')]===_0xa915('0x18');var _0x3f5aff=_0xf9f02c[_0xa915('0x1a')];var _0x23d0df=_0x590be6?0x0:_0x19889d[_0xa915('0x17')];var _0x339335=_0x590be6?_0xf9f02c[_0xa915('0x1a')]:_0x19889d[_0xa915('0x17')]+_0x19889d['limit'];var _0x24af34;if(_0x339335>=_0x3f5aff){_0x339335=_0x3f5aff;_0x24af34=0xc8;}else{_0x24af34=0xce;}_0x23ecd8['status'](_0x24af34);return _0x23ecd8[_0xa915('0x1b')](_0xa915('0x1c'),_0x23d0df+'-'+_0x339335+'/'+_0x3f5aff)[_0xa915('0x1d')](_0xf9f02c);}return null;};}function patchUpdates(_0x414d36){return function(_0x15c3e0){try{jsonpatch['apply'](_0x15c3e0,_0x414d36,!![]);}catch(_0xa93602){return BPromise[_0xa915('0x1e')](_0xa93602);}return _0x15c3e0[_0xa915('0x1f')]();};}function saveUpdates(_0x3d94d1,_0x12c054){return function(_0x226c30){if(_0x226c30){return _0x226c30['update'](_0x3d94d1)[_0xa915('0x20')](function(_0x3e4726){return _0x3e4726;});}return null;};}function removeEntity(_0x220d66,_0x23515d){return function(_0x5a3eac){if(_0x5a3eac){return _0x5a3eac['destroy']()[_0xa915('0x20')](function(){_0x220d66['status'](0xcc)[_0xa915('0x16')]();});}};}function handleEntityNotFound(_0x3b8cbb,_0x3898cc){return function(_0x462b94){if(!_0x462b94){_0x3b8cbb[_0xa915('0x21')](0x194);}return _0x462b94;};}function handleError(_0x28b71a,_0x116246){_0x116246=_0x116246||0x1f4;return function(_0x525f55){logger[_0xa915('0x22')](_0x525f55[_0xa915('0x23')]);if(_0x525f55['name']){delete _0x525f55[_0xa915('0x24')];}_0x28b71a[_0xa915('0x15')](_0x116246)[_0xa915('0x25')](_0x525f55);};}exports[_0xa915('0x26')]=function(_0x5a62c0,_0x3cca8e){var _0x427742={'raw':!![],'where':{'id':_0x5a62c0[_0xa915('0x27')]['id']}},_0x486ca1={};_0x486ca1[_0xa915('0x28')]=_[_0xa915('0x29')](db[_0xa915('0x2a')][_0xa915('0x2b')]);_0x486ca1[_0xa915('0x2c')]=_['keys'](_0x5a62c0[_0xa915('0x2c')]);_0x486ca1[_0xa915('0x2d')]=_[_0xa915('0x2e')](_0x486ca1['model'],_0x486ca1[_0xa915('0x2c')]);_0x427742[_0xa915('0x2f')]=_[_0xa915('0x2e')](_0x486ca1['model'],qs[_0xa915('0x30')](_0x5a62c0[_0xa915('0x2c')][_0xa915('0x30')]));_0x427742[_0xa915('0x2f')]=_0x427742['attributes']['length']?_0x427742[_0xa915('0x2f')]:_0x486ca1[_0xa915('0x28')];if(_0x5a62c0[_0xa915('0x2c')]['includeAll']){_0x427742[_0xa915('0x31')]=[{'all':!![]}];}_0x427742=_['merge']({},_0x427742,_0x5a62c0[_0xa915('0x32')]);return db[_0xa915('0x2a')][_0xa915('0x33')](_0x427742)[_0xa915('0x20')](handleEntityNotFound(_0x3cca8e,null))[_0xa915('0x20')](respondWithResult(_0x3cca8e,null))[_0xa915('0x34')](handleError(_0x3cca8e,null));};exports[_0xa915('0x35')]=function(_0x4fe01c,_0x252643){if(_0x4fe01c[_0xa915('0x36')]['id']){delete _0x4fe01c[_0xa915('0x36')]['id'];}return db[_0xa915('0x2a')][_0xa915('0x33')]({'where':{'id':_0x4fe01c[_0xa915('0x27')]['id']}})['then'](handleEntityNotFound(_0x252643,null))[_0xa915('0x20')](saveUpdates(_0x4fe01c[_0xa915('0x36')],null))[_0xa915('0x20')](respondWithResult(_0x252643,null))[_0xa915('0x34')](handleError(_0x252643,null));};exports[_0xa915('0x37')]=function(_0x38e3ea,_0x2dccf7){return db['ChatApplication']['find']({'where':{'id':_0x38e3ea['params']['id']}})[_0xa915('0x20')](handleEntityNotFound(_0x2dccf7,null))[_0xa915('0x20')](removeEntity(_0x2dccf7,null))[_0xa915('0x34')](handleError(_0x2dccf7,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 8f19192..c72574c 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 _0x4958=['rimraf','../../config/environment','./chatApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path'];(function(_0x47fbdd,_0x487e75){var _0x39172c=function(_0x32d8e2){while(--_0x32d8e2){_0x47fbdd['push'](_0x47fbdd['shift']());}};_0x39172c(++_0x487e75);}(_0x4958,0x192));var _0x8495=function(_0x4004f0,_0x5242ae){_0x4004f0=_0x4004f0-0x0;var _0x1b7347=_0x4958[_0x4004f0];return _0x1b7347;};'use strict';var _=require('lodash');var util=require(_0x8495('0x0'));var logger=require(_0x8495('0x1'))(_0x8495('0x2'));var moment=require(_0x8495('0x3'));var BPromise=require(_0x8495('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8495('0x5'));var rimraf=require(_0x8495('0x6'));var config=require(_0x8495('0x7'));var attributes=require(_0x8495('0x8'));module['exports']=function(_0x25e49b,_0x443681){return _0x25e49b[_0x8495('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8495('0xa'),'collate':_0x8495('0xb')});}; \ No newline at end of file +var _0x9901=['api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9901,0x15e));var _0x1990=function(_0x2fe85a,_0x28c346){_0x2fe85a=_0x2fe85a-0x0;var _0x468e0f=_0x9901[_0x2fe85a];return _0x468e0f;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var logger=require('../../config/logger')(_0x1990('0x1'));var moment=require(_0x1990('0x2'));var BPromise=require(_0x1990('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1990('0x4'));var rimraf=require(_0x1990('0x5'));var config=require(_0x1990('0x6'));var attributes=require(_0x1990('0x7'));module[_0x1990('0x8')]=function(_0x44db1e,_0x29f5fb){return _0x44db1e[_0x1990('0x9')](_0x1990('0xa'),attributes,{'tableName':_0x1990('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1990('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index c6a24cc..ff854b8 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 _0xf0ac=['info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xf0ac,0x75));var _0xcf0a=function(_0x2ea913,_0x39c232){_0x2ea913=_0x2ea913-0x0;var _0x40228a=_0xf0ac[_0x2ea913];return _0x40228a;};'use strict';var _=require('lodash');var util=require(_0xcf0a('0x0'));var moment=require(_0xcf0a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf0a('0x2'));var db=require(_0xcf0a('0x3'))['db'];var utils=require(_0xcf0a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf0a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcf0a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2ad3,_0x52fd13,_0x4f9244){return new BPromise(function(_0x515593,_0xaa0e6d){return client[_0xcf0a('0x7')](_0x2d2ad3,_0x4f9244)[_0xcf0a('0x8')](function(_0x5c0d0e){logger['info']('ChatApplication,\x20%s,\x20%s',_0x52fd13,_0xcf0a('0x9'));logger[_0xcf0a('0xa')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x52fd13,_0xcf0a('0x9'),JSON[_0xcf0a('0xb')](_0x5c0d0e));if(_0x5c0d0e[_0xcf0a('0xc')]){if(_0x5c0d0e['error'][_0xcf0a('0xd')]===0x1f4){logger['error'](_0xcf0a('0xe'),_0x52fd13,_0x5c0d0e[_0xcf0a('0xc')][_0xcf0a('0xf')]);return _0xaa0e6d(_0x5c0d0e[_0xcf0a('0xc')][_0xcf0a('0xf')]);}logger[_0xcf0a('0xc')](_0xcf0a('0xe'),_0x52fd13,_0x5c0d0e[_0xcf0a('0xc')][_0xcf0a('0xf')]);return _0x515593(_0x5c0d0e['error']['message']);}else{logger[_0xcf0a('0x10')](_0xcf0a('0xe'),_0x52fd13,'request\x20sent');_0x515593(_0x5c0d0e[_0xcf0a('0x11')][_0xcf0a('0xf')]);}})[_0xcf0a('0x12')](function(_0x10dcc7){logger[_0xcf0a('0xc')](_0xcf0a('0xe'),_0x52fd13,_0x10dcc7);_0xaa0e6d(_0x10dcc7);});});} \ No newline at end of file +var _0x307f=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x27ac32,_0x42771f){var _0x20c811=function(_0x12d837){while(--_0x12d837){_0x27ac32['push'](_0x27ac32['shift']());}};_0x20c811(++_0x42771f);}(_0x307f,0x9b));var _0xf307=function(_0x1f0cda,_0x3ebda9){_0x1f0cda=_0x1f0cda-0x0;var _0xc941fc=_0x307f[_0x1f0cda];return _0xc941fc;};'use strict';var _=require(_0xf307('0x0'));var util=require(_0xf307('0x1'));var moment=require(_0xf307('0x2'));var BPromise=require('bluebird');var rs=require(_0xf307('0x3'));var fs=require('fs');var Redis=require(_0xf307('0x4'));var db=require(_0xf307('0x5'))['db'];var utils=require(_0xf307('0x6'));var logger=require(_0xf307('0x7'))(_0xf307('0x8'));var config=require(_0xf307('0x9'));var jayson=require(_0xf307('0xa'));var client=jayson[_0xf307('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3543f5,_0x1c0233,_0x54026d){return new BPromise(function(_0x11583a,_0xbd71f4){return client[_0xf307('0xc')](_0x3543f5,_0x54026d)[_0xf307('0xd')](function(_0x2267af){logger[_0xf307('0xe')](_0xf307('0xf'),_0x1c0233,'request\x20sent');logger[_0xf307('0x10')](_0xf307('0x11'),_0x1c0233,_0xf307('0x12'),JSON[_0xf307('0x13')](_0x2267af));if(_0x2267af[_0xf307('0x14')]){if(_0x2267af[_0xf307('0x14')][_0xf307('0x15')]===0x1f4){logger[_0xf307('0x14')](_0xf307('0xf'),_0x1c0233,_0x2267af[_0xf307('0x14')][_0xf307('0x16')]);return _0xbd71f4(_0x2267af[_0xf307('0x14')]['message']);}logger[_0xf307('0x14')](_0xf307('0xf'),_0x1c0233,_0x2267af['error'][_0xf307('0x16')]);return _0x11583a(_0x2267af['error'][_0xf307('0x16')]);}else{logger[_0xf307('0xe')](_0xf307('0xf'),_0x1c0233,_0xf307('0x12'));_0x11583a(_0x2267af[_0xf307('0x17')][_0xf307('0x16')]);}})[_0xf307('0x18')](function(_0x3e9ab3){logger['error'](_0xf307('0xf'),_0x1c0233,_0x3e9ab3);_0xbd71f4(_0x3e9ab3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e4e4115..10d479c 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 _0x95a7=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4e1bf1,_0x1ac344){var _0x28e750=function(_0x37975a){while(--_0x37975a){_0x4e1bf1['push'](_0x4e1bf1['shift']());}};_0x28e750(++_0x1ac344);}(_0x95a7,0x181));var _0x795a=function(_0x4367a3,_0x1d2146){_0x4367a3=_0x4367a3-0x0;var _0x3d52e2=_0x95a7[_0x4367a3];return _0x3d52e2;};'use strict';var multer=require(_0x795a('0x0'));var util=require('util');var path=require(_0x795a('0x1'));var timeout=require(_0x795a('0x2'));var express=require('express');var router=express[_0x795a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x795a('0x4'));var interaction=require(_0x795a('0x5'));var config=require(_0x795a('0x6'));var controller=require(_0x795a('0x7'));router[_0x795a('0x8')](_0x795a('0x9'),auth[_0x795a('0xa')](),controller['show']);router[_0x795a('0xb')](_0x795a('0x9'),auth[_0x795a('0xa')](),controller['update']);router[_0x795a('0xc')]('/:id',auth[_0x795a('0xa')](),controller[_0x795a('0xd')]);module[_0x795a('0xe')]=router; \ No newline at end of file +var _0xe068=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','show','put','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x3aa3a6,_0x21740f){var _0x27b78c=function(_0x58719e){while(--_0x58719e){_0x3aa3a6['push'](_0x3aa3a6['shift']());}};_0x27b78c(++_0x21740f);}(_0xe068,0xed));var _0x8e06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe068[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8e06('0x0'));var util=require(_0x8e06('0x1'));var path=require(_0x8e06('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e06('0x3'));var router=express[_0x8e06('0x4')]();var fs_extra=require(_0x8e06('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e06('0x6'));var config=require(_0x8e06('0x7'));var controller=require(_0x8e06('0x8'));router['get'](_0x8e06('0x9'),auth['isAuthenticated'](),controller[_0x8e06('0xa')]);router[_0x8e06('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8e06('0xc')]('/:id',auth[_0x8e06('0xd')](),controller[_0x8e06('0xe')]);module[_0x8e06('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index bacb798..13baf89 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 _0xa7ee=['exports','STRING','sequelize'];(function(_0x2e8b46,_0x1b50a0){var _0x360c07=function(_0x11cd01){while(--_0x11cd01){_0x2e8b46['push'](_0x2e8b46['shift']());}};_0x360c07(++_0x1b50a0);}(_0xa7ee,0x167));var _0xea7e=function(_0x19cf1f,_0x4105e3){_0x19cf1f=_0x19cf1f-0x0;var _0x234028=_0xa7ee[_0x19cf1f];return _0x234028;};'use strict';var Sequelize=require(_0xea7e('0x0'));module[_0xea7e('0x1')]={'name':{'type':Sequelize[_0xea7e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xea7e('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xea7e=['STRING','BOOLEAN','exports'];(function(_0x3a177b,_0x10d9fe){var _0x205959=function(_0x39f5fe){while(--_0x39f5fe){_0x3a177b['push'](_0x3a177b['shift']());}};_0x205959(++_0x10d9fe);}(_0xea7e,0x143));var _0xeea7=function(_0x53acc7,_0x32b7cc){_0x53acc7=_0x53acc7-0x0;var _0x3d5879=_0xea7e[_0x53acc7];return _0x3d5879;};'use strict';var Sequelize=require('sequelize');module[_0xeea7('0x0')]={'name':{'type':Sequelize[_0xeea7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xeea7('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index b3a595e..18f9704 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 _0x5ba3=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','end','stack','name','send','index','map','key','query','keys','intersection','model','attributes','fields','length','order','sort','filters','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format'];(function(_0x3028e6,_0x5e03c5){var _0x40dfb4=function(_0x5a3b1e){while(--_0x5a3b1e){_0x3028e6['push'](_0x3028e6['shift']());}};_0x40dfb4(++_0x5e03c5);}(_0x5ba3,0x120));var _0x35ba=function(_0x1435f1,_0x18f762){_0x1435f1=_0x1435f1-0x0;var _0x5c7770=_0x5ba3[_0x1435f1];return _0x5c7770;};'use strict';var emlformat=require(_0x35ba('0x0'));var rimraf=require(_0x35ba('0x1'));var zipdir=require(_0x35ba('0x2'));var jsonpatch=require(_0x35ba('0x3'));var rp=require(_0x35ba('0x4'));var moment=require(_0x35ba('0x5'));var BPromise=require(_0x35ba('0x6'));var Mustache=require(_0x35ba('0x7'));var util=require(_0x35ba('0x8'));var path=require(_0x35ba('0x9'));var sox=require('sox');var csv=require(_0x35ba('0xa'));var ejs=require(_0x35ba('0xb'));var fs=require('fs');var fs_extra=require(_0x35ba('0xc'));var _=require(_0x35ba('0xd'));var squel=require(_0x35ba('0xe'));var crypto=require('crypto');var jsforce=require(_0x35ba('0xf'));var deskjs=require(_0x35ba('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x35ba('0x11'));var Redis=require(_0x35ba('0x12'));var authService=require(_0x35ba('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ba('0x14'));var logger=require(_0x35ba('0x15'))(_0x35ba('0x16'));var utils=require(_0x35ba('0x17'));var config=require(_0x35ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x35ba('0x19'))['db'];config[_0x35ba('0x1a')]=_[_0x35ba('0x1b')](config[_0x35ba('0x1a')],{'host':_0x35ba('0x1c'),'port':0x18eb});var socket=require(_0x35ba('0x1d'))(new Redis(config[_0x35ba('0x1a')]));require(_0x35ba('0x1e'))[_0x35ba('0x1f')](socket);function respondWithStatusCode(_0x1545ce,_0x54d2ac){_0x54d2ac=_0x54d2ac||0xcc;return function(_0x4b120c){if(_0x4b120c){return _0x1545ce[_0x35ba('0x20')](_0x54d2ac);}return _0x1545ce['status'](_0x54d2ac)['end']();};}function respondWithResult(_0x5f527a,_0x1fe1da){_0x1fe1da=_0x1fe1da||0xc8;return function(_0x4b4c66){if(_0x4b4c66){return _0x5f527a[_0x35ba('0x21')](_0x1fe1da)[_0x35ba('0x22')](_0x4b4c66);}};}function respondWithFilteredResult(_0x202f5f,_0x4eb190){return function(_0x129257){if(_0x129257){var _0x486680=typeof _0x4eb190[_0x35ba('0x23')]===_0x35ba('0x24')&&typeof _0x4eb190[_0x35ba('0x25')]==='undefined';var _0x526a20=_0x129257[_0x35ba('0x26')];var _0x54ba8a=_0x486680?0x0:_0x4eb190[_0x35ba('0x23')];var _0x51b374=_0x486680?_0x129257[_0x35ba('0x26')]:_0x4eb190[_0x35ba('0x23')]+_0x4eb190['limit'];var _0x413ffa;if(_0x51b374>=_0x526a20){_0x51b374=_0x526a20;_0x413ffa=0xc8;}else{_0x413ffa=0xce;}_0x202f5f[_0x35ba('0x21')](_0x413ffa);return _0x202f5f['set']('Content-Range',_0x54ba8a+'-'+_0x51b374+'/'+_0x526a20)[_0x35ba('0x22')](_0x129257);}return null;};}function patchUpdates(_0x3c7df3){return function(_0x325b73){try{jsonpatch['apply'](_0x325b73,_0x3c7df3,!![]);}catch(_0x4ccad8){return BPromise[_0x35ba('0x27')](_0x4ccad8);}return _0x325b73[_0x35ba('0x28')]();};}function saveUpdates(_0x41c9ad,_0x3505a4){return function(_0x50c40f){if(_0x50c40f){return _0x50c40f[_0x35ba('0x29')](_0x41c9ad)[_0x35ba('0x2a')](function(_0x2d521e){return _0x2d521e;});}return null;};}function removeEntity(_0x39a243,_0x147849){return function(_0x395d38){if(_0x395d38){return _0x395d38[_0x35ba('0x2b')]()[_0x35ba('0x2a')](function(){_0x39a243[_0x35ba('0x21')](0xcc)[_0x35ba('0x2c')]();});}};}function handleEntityNotFound(_0x28aa04,_0x85012d){return function(_0xf18ed0){if(!_0xf18ed0){_0x28aa04[_0x35ba('0x20')](0x194);}return _0xf18ed0;};}function handleError(_0x1d8999,_0x4bc28b){_0x4bc28b=_0x4bc28b||0x1f4;return function(_0x79041f){logger['error'](_0x79041f[_0x35ba('0x2d')]);if(_0x79041f[_0x35ba('0x2e')]){delete _0x79041f[_0x35ba('0x2e')];}_0x1d8999[_0x35ba('0x21')](_0x4bc28b)[_0x35ba('0x2f')](_0x79041f);};}exports[_0x35ba('0x30')]=function(_0x5044ff,_0x39b1b8){var _0x33d2a0={},_0x35feda={},_0x3c5daa={'count':0x0,'rows':[]};var _0x4258b3=_[_0x35ba('0x31')](db['ChatGroup']['rawAttributes'],function(_0x44a050){return{'name':_0x44a050['fieldName'],'type':_0x44a050['type'][_0x35ba('0x32')]};});_0x35feda['model']=_[_0x35ba('0x31')](_0x4258b3,_0x35ba('0x2e'));_0x35feda[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x5044ff[_0x35ba('0x33')]);_0x35feda['filters']=_[_0x35ba('0x35')](_0x35feda[_0x35ba('0x36')],_0x35feda[_0x35ba('0x33')]);_0x33d2a0[_0x35ba('0x37')]=_[_0x35ba('0x35')](_0x35feda[_0x35ba('0x36')],qs['fields'](_0x5044ff[_0x35ba('0x33')][_0x35ba('0x38')]));_0x33d2a0[_0x35ba('0x37')]=_0x33d2a0['attributes'][_0x35ba('0x39')]?_0x33d2a0[_0x35ba('0x37')]:_0x35feda[_0x35ba('0x36')];if(!_0x5044ff[_0x35ba('0x33')]['hasOwnProperty']('nolimit')){_0x33d2a0[_0x35ba('0x25')]=qs[_0x35ba('0x25')](_0x5044ff[_0x35ba('0x33')][_0x35ba('0x25')]);_0x33d2a0[_0x35ba('0x23')]=qs[_0x35ba('0x23')](_0x5044ff[_0x35ba('0x33')]['offset']);}_0x33d2a0[_0x35ba('0x3a')]=qs[_0x35ba('0x3b')](_0x5044ff[_0x35ba('0x33')][_0x35ba('0x3b')]);_0x33d2a0['where']=qs[_0x35ba('0x3c')](_['pick'](_0x5044ff['query'],_0x35feda[_0x35ba('0x3c')]),_0x4258b3);if(_0x5044ff[_0x35ba('0x33')][_0x35ba('0x3d')]){_0x33d2a0[_0x35ba('0x3e')]=_[_0x35ba('0x3f')](_0x33d2a0['where'],{'$or':_[_0x35ba('0x31')](_0x4258b3,function(_0x2497d5){if(_0x2497d5[_0x35ba('0x40')]!==_0x35ba('0x41')){var _0x315e77={};_0x315e77[_0x2497d5[_0x35ba('0x2e')]]={'$like':'%'+_0x5044ff[_0x35ba('0x33')]['filter']+'%'};return _0x315e77;}})});}_0x33d2a0=_[_0x35ba('0x3f')]({},_0x33d2a0,_0x5044ff[_0x35ba('0x42')]);var _0x505a11={'where':_0x33d2a0[_0x35ba('0x3e')]};return db[_0x35ba('0x43')][_0x35ba('0x26')](_0x505a11)[_0x35ba('0x2a')](function(_0x67e16){_0x3c5daa[_0x35ba('0x26')]=_0x67e16;if(_0x5044ff['query'][_0x35ba('0x44')]){_0x33d2a0[_0x35ba('0x45')]=[{'all':!![]}];}return db[_0x35ba('0x43')]['findAll'](_0x33d2a0);})[_0x35ba('0x2a')](function(_0x5aadf0){_0x3c5daa[_0x35ba('0x46')]=_0x5aadf0;return _0x3c5daa;})[_0x35ba('0x2a')](respondWithFilteredResult(_0x39b1b8,_0x33d2a0))[_0x35ba('0x47')](handleError(_0x39b1b8,null));};exports[_0x35ba('0x48')]=function(_0x239993,_0x1b8fbc){var _0x1a6e7e={'raw':!![],'where':{'id':_0x239993[_0x35ba('0x49')]['id']}},_0x2dc72d={};_0x2dc72d[_0x35ba('0x36')]=_[_0x35ba('0x34')](db[_0x35ba('0x43')][_0x35ba('0x4a')]);_0x2dc72d[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x239993[_0x35ba('0x33')]);_0x2dc72d['filters']=_[_0x35ba('0x35')](_0x2dc72d[_0x35ba('0x36')],_0x2dc72d[_0x35ba('0x33')]);_0x1a6e7e[_0x35ba('0x37')]=_[_0x35ba('0x35')](_0x2dc72d['model'],qs['fields'](_0x239993[_0x35ba('0x33')]['fields']));_0x1a6e7e[_0x35ba('0x37')]=_0x1a6e7e[_0x35ba('0x37')][_0x35ba('0x39')]?_0x1a6e7e[_0x35ba('0x37')]:_0x2dc72d[_0x35ba('0x36')];if(_0x239993[_0x35ba('0x33')][_0x35ba('0x44')]){_0x1a6e7e[_0x35ba('0x45')]=[{'all':!![]}];}_0x1a6e7e=_[_0x35ba('0x3f')]({},_0x1a6e7e,_0x239993[_0x35ba('0x42')]);return db[_0x35ba('0x43')][_0x35ba('0x4b')](_0x1a6e7e)['then'](handleEntityNotFound(_0x1b8fbc,null))['then'](respondWithResult(_0x1b8fbc,null))[_0x35ba('0x47')](handleError(_0x1b8fbc,null));};exports[_0x35ba('0x4c')]=function(_0x3863e2,_0x58e2bf){return db['ChatGroup'][_0x35ba('0x4c')](_0x3863e2[_0x35ba('0x4d')],{})[_0x35ba('0x2a')](respondWithResult(_0x58e2bf,0xc9))['catch'](handleError(_0x58e2bf,null));};exports[_0x35ba('0x29')]=function(_0x3c86cf,_0x4356f5){if(_0x3c86cf[_0x35ba('0x4d')]['id']){delete _0x3c86cf[_0x35ba('0x4d')]['id'];}return db[_0x35ba('0x43')][_0x35ba('0x4b')]({'where':{'id':_0x3c86cf[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x4356f5,null))[_0x35ba('0x2a')](saveUpdates(_0x3c86cf[_0x35ba('0x4d')],null))['then'](respondWithResult(_0x4356f5,null))[_0x35ba('0x47')](handleError(_0x4356f5,null));};exports[_0x35ba('0x2b')]=function(_0x3facae,_0x46ebd0){return db[_0x35ba('0x43')]['find']({'where':{'id':_0x3facae[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x46ebd0,null))[_0x35ba('0x2a')](removeEntity(_0x46ebd0,null))[_0x35ba('0x47')](handleError(_0x46ebd0,null));};exports[_0x35ba('0x4e')]=function(_0x12ba2b,_0x2d66b7){return db[_0x35ba('0x43')][_0x35ba('0x4e')]()[_0x35ba('0x2a')](respondWithResult(_0x2d66b7,null))[_0x35ba('0x47')](handleError(_0x2d66b7,null));};exports[_0x35ba('0x4f')]=function(_0x304106,_0x219ced,_0x5a4d7f){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x304106[_0x35ba('0x49')]['id'],'ToId':_0x304106[_0x35ba('0x50')]['id'],'read':![]}})[_0x35ba('0x2a')](function(_0x54c67e){return{'id':_[_0x35ba('0x51')](_0x304106['params']['id']),'count':_0x54c67e};})['then'](respondWithResult(_0x219ced,null))[_0x35ba('0x47')](handleError(_0x219ced,null));};exports[_0x35ba('0x52')]=function(_0x2de5d9,_0x48063f,_0x3fd926){return db[_0x35ba('0x43')][_0x35ba('0x4b')]({'where':{'id':_0x2de5d9['params']['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x48063f,null))[_0x35ba('0x2a')](function(_0x5c5774){if(_0x5c5774){return _0x5c5774[_0x35ba('0x52')](_0x2de5d9[_0x35ba('0x4d')][_0x35ba('0x53')],_['omit'](_0x2de5d9['body'],['ids','id'])||{});}})[_0x35ba('0x2a')](respondWithResult(_0x48063f,null))['catch'](handleError(_0x48063f,null));};exports[_0x35ba('0x54')]=function(_0x52b345,_0xf1d833,_0x548866){var _0x1552be={};var _0x5b4bfb={};var _0x4f18b7;var _0x2d83e6;return db[_0x35ba('0x43')][_0x35ba('0x55')]({'where':{'id':_0x52b345[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0xf1d833,null))[_0x35ba('0x2a')](function(_0x10a304){if(_0x10a304){_0x4f18b7=_0x10a304;_0x5b4bfb[_0x35ba('0x36')]=_['keys'](db['User'][_0x35ba('0x4a')]);_0x5b4bfb[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x52b345[_0x35ba('0x33')]);_0x5b4bfb[_0x35ba('0x3c')]=_[_0x35ba('0x35')](_0x5b4bfb['model'],_0x5b4bfb[_0x35ba('0x33')]);_0x1552be['attributes']=_[_0x35ba('0x35')](_0x5b4bfb[_0x35ba('0x36')],qs[_0x35ba('0x38')](_0x52b345['query']['fields']));_0x1552be[_0x35ba('0x37')]=_0x1552be[_0x35ba('0x37')][_0x35ba('0x39')]?_0x1552be[_0x35ba('0x37')]:_0x5b4bfb['model'];_0x1552be[_0x35ba('0x3a')]=qs[_0x35ba('0x3b')](_0x52b345['query'][_0x35ba('0x3b')]);_0x1552be[_0x35ba('0x3e')]=qs[_0x35ba('0x3c')](_[_0x35ba('0x56')](_0x52b345[_0x35ba('0x33')],_0x5b4bfb[_0x35ba('0x3c')]));if(_0x52b345[_0x35ba('0x33')][_0x35ba('0x3d')]){_0x1552be[_0x35ba('0x3e')]=_[_0x35ba('0x3f')](_0x1552be[_0x35ba('0x3e')],{'$or':_[_0x35ba('0x31')](_0x1552be[_0x35ba('0x37')],function(_0x3b996b){var _0x36b875={};_0x36b875[_0x3b996b]={'$like':'%'+_0x52b345[_0x35ba('0x33')][_0x35ba('0x3d')]+'%'};return _0x36b875;})});}_0x1552be=_[_0x35ba('0x3f')]({},_0x1552be,_0x52b345[_0x35ba('0x42')]);return _0x4f18b7[_0x35ba('0x54')](_0x1552be);}})[_0x35ba('0x2a')](function(_0x267df4){if(_0x267df4){_0x2d83e6=_0x267df4[_0x35ba('0x39')];if(!_0x52b345[_0x35ba('0x33')][_0x35ba('0x57')]('nolimit')){_0x1552be[_0x35ba('0x25')]=qs[_0x35ba('0x25')](_0x52b345[_0x35ba('0x33')][_0x35ba('0x25')]);_0x1552be[_0x35ba('0x23')]=qs[_0x35ba('0x23')](_0x52b345[_0x35ba('0x33')][_0x35ba('0x23')]);}return _0x4f18b7[_0x35ba('0x54')](_0x1552be);}})['then'](function(_0x42bfbc){if(_0x42bfbc){return _0x42bfbc?{'count':_0x2d83e6,'rows':_0x42bfbc}:null;}})[_0x35ba('0x2a')](respondWithResult(_0xf1d833,null))[_0x35ba('0x47')](handleError(_0xf1d833,null));};exports['removeMembers']=function(_0x47077c,_0x484b86,_0x467a14){return db['ChatGroup'][_0x35ba('0x4b')]({'where':{'id':_0x47077c[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x484b86,null))['then'](function(_0x2c3069){if(_0x2c3069){return _0x2c3069[_0x35ba('0x58')](_0x47077c['query']['ids']);}})[_0x35ba('0x2a')](respondWithStatusCode(_0x484b86,null))[_0x35ba('0x47')](handleError(_0x484b86,null));};exports[_0x35ba('0x59')]=function(_0x159e27,_0x503299,_0x548b99){if(_0x159e27[_0x35ba('0x4d')]['id']){delete _0x159e27[_0x35ba('0x4d')]['id'];}return db[_0x35ba('0x43')][_0x35ba('0x4b')]({'where':{'id':_0x159e27[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x503299,null))[_0x35ba('0x2a')](function(_0x4dbbec){if(_0x4dbbec){_0x159e27[_0x35ba('0x4d')][_0x35ba('0x5a')]=_0x4dbbec['id'];return db[_0x35ba('0x5b')]['create'](_0x159e27['body']);}})[_0x35ba('0x2a')](respondWithResult(_0x503299,null))[_0x35ba('0x47')](handleError(_0x503299,null));};exports[_0x35ba('0x5c')]=function(_0x5c37fd,_0x2c7141,_0x169fe2){var _0x3700a8={};var _0x109b01={};var _0x54db90;var _0xbc5fb4;return db[_0x35ba('0x43')][_0x35ba('0x55')]({'where':{'id':_0x5c37fd[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x2c7141,null))[_0x35ba('0x2a')](function(_0x34fbb5){if(_0x34fbb5){_0x54db90=_0x34fbb5;_0x109b01[_0x35ba('0x36')]=_[_0x35ba('0x34')](db[_0x35ba('0x5b')][_0x35ba('0x4a')]);_0x109b01[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x5c37fd['query']);_0x109b01[_0x35ba('0x3c')]=_['intersection'](_0x109b01['model'],_0x109b01['query']);_0x3700a8[_0x35ba('0x37')]=_[_0x35ba('0x35')](_0x109b01[_0x35ba('0x36')],qs['fields'](_0x5c37fd[_0x35ba('0x33')]['fields']));_0x3700a8['attributes']=_0x3700a8[_0x35ba('0x37')][_0x35ba('0x39')]?_0x3700a8[_0x35ba('0x37')]:_0x109b01[_0x35ba('0x36')];_0x3700a8['order']=qs['sort'](_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x3b')]);_0x3700a8['where']=qs['filters'](_[_0x35ba('0x56')](_0x5c37fd[_0x35ba('0x33')],_0x109b01[_0x35ba('0x3c')]));if(_0x5c37fd['query'][_0x35ba('0x3d')]){_0x3700a8[_0x35ba('0x3e')]=_['merge'](_0x3700a8['where'],{'$or':_[_0x35ba('0x31')](_0x3700a8[_0x35ba('0x37')],function(_0x26d3eb){var _0x28695c={};_0x28695c[_0x26d3eb]={'$like':'%'+_0x5c37fd['query'][_0x35ba('0x3d')]+'%'};return _0x28695c;})});}if(_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x5d')]){var _0x5a1c4e=_0x5c37fd[_0x35ba('0x33')]['$gte'][_0x35ba('0x5e')](',');var _0x26d731={};_0x26d731[_0x5a1c4e[0x0]]={'$gte':moment(_0x5a1c4e[0x1])[_0x35ba('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3700a8['where']=_[_0x35ba('0x3f')](_0x3700a8[_0x35ba('0x3e')],_0x26d731);}_0x3700a8=_[_0x35ba('0x3f')]({},_0x3700a8,_0x5c37fd[_0x35ba('0x42')]);return _0x54db90[_0x35ba('0x5c')](_0x3700a8);}})[_0x35ba('0x2a')](function(_0x1cbd30){if(_0x1cbd30){_0xbc5fb4=_0x1cbd30[_0x35ba('0x39')];if(!_0x5c37fd[_0x35ba('0x33')]['hasOwnProperty']('nolimit')){_0x3700a8[_0x35ba('0x25')]=qs['limit'](_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x25')]);_0x3700a8[_0x35ba('0x23')]=qs[_0x35ba('0x23')](_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x23')]);}return _0x54db90['getMessages'](_0x3700a8);}})[_0x35ba('0x2a')](function(_0x4d07db){if(_0x4d07db){return _0x4d07db?{'count':_0xbc5fb4,'rows':_0x4d07db}:null;}})[_0x35ba('0x2a')](respondWithResult(_0x2c7141,null))[_0x35ba('0x47')](handleError(_0x2c7141,null));}; \ No newline at end of file +var _0x0c4b=['undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','ChatGroup','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','nolimit','removeMembers','addMessage','getMessages','findOne','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','limit'];(function(_0x13b746,_0x35da0d){var _0x39e1b4=function(_0x409293){while(--_0x409293){_0x13b746['push'](_0x13b746['shift']());}};_0x39e1b4(++_0x35da0d);}(_0x0c4b,0x14f));var _0xb0c4=function(_0x5a7b40,_0x585230){_0x5a7b40=_0x5a7b40-0x0;var _0x463559=_0x0c4b[_0x5a7b40];return _0x463559;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0c4('0x0'));var zipdir=require(_0xb0c4('0x1'));var jsonpatch=require(_0xb0c4('0x2'));var rp=require(_0xb0c4('0x3'));var moment=require(_0xb0c4('0x4'));var BPromise=require(_0xb0c4('0x5'));var Mustache=require('mustache');var util=require(_0xb0c4('0x6'));var path=require(_0xb0c4('0x7'));var sox=require('sox');var csv=require(_0xb0c4('0x8'));var ejs=require(_0xb0c4('0x9'));var fs=require('fs');var fs_extra=require(_0xb0c4('0xa'));var _=require(_0xb0c4('0xb'));var squel=require(_0xb0c4('0xc'));var crypto=require('crypto');var jsforce=require(_0xb0c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb0c4('0x8'));var querystring=require(_0xb0c4('0xe'));var Papa=require(_0xb0c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb0c4('0x10'));var as=require(_0xb0c4('0x11'));var hardwareService=require(_0xb0c4('0x12'));var logger=require(_0xb0c4('0x13'))(_0xb0c4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0c4('0x15'))['db'];config['redis']=_['defaults'](config[_0xb0c4('0x16')],{'host':_0xb0c4('0x17'),'port':0x18eb});var socket=require(_0xb0c4('0x18'))(new Redis(config[_0xb0c4('0x16')]));require(_0xb0c4('0x19'))[_0xb0c4('0x1a')](socket);function respondWithStatusCode(_0x12f99f,_0x1c81b1){_0x1c81b1=_0x1c81b1||0xcc;return function(_0x5cbf85){if(_0x5cbf85){return _0x12f99f[_0xb0c4('0x1b')](_0x1c81b1);}return _0x12f99f['status'](_0x1c81b1)[_0xb0c4('0x1c')]();};}function respondWithResult(_0x3b4155,_0x2cc6aa){_0x2cc6aa=_0x2cc6aa||0xc8;return function(_0x15a234){if(_0x15a234){return _0x3b4155[_0xb0c4('0x1d')](_0x2cc6aa)[_0xb0c4('0x1e')](_0x15a234);}};}function respondWithFilteredResult(_0x323ad9,_0x2ad0f9){return function(_0x187e15){if(_0x187e15){var _0x343b7c=typeof _0x2ad0f9[_0xb0c4('0x1f')]==='undefined'&&typeof _0x2ad0f9[_0xb0c4('0x20')]===_0xb0c4('0x21');var _0x18b4a1=_0x187e15['count'];var _0x39b1cc=_0x343b7c?0x0:_0x2ad0f9['offset'];var _0x18d497=_0x343b7c?_0x187e15[_0xb0c4('0x22')]:_0x2ad0f9['offset']+_0x2ad0f9[_0xb0c4('0x20')];var _0x187051;if(_0x18d497>=_0x18b4a1){_0x18d497=_0x18b4a1;_0x187051=0xc8;}else{_0x187051=0xce;}_0x323ad9[_0xb0c4('0x1d')](_0x187051);return _0x323ad9[_0xb0c4('0x23')](_0xb0c4('0x24'),_0x39b1cc+'-'+_0x18d497+'/'+_0x18b4a1)[_0xb0c4('0x1e')](_0x187e15);}return null;};}function patchUpdates(_0x1e2734){return function(_0x2e3b56){try{jsonpatch[_0xb0c4('0x25')](_0x2e3b56,_0x1e2734,!![]);}catch(_0x43b6b0){return BPromise['reject'](_0x43b6b0);}return _0x2e3b56[_0xb0c4('0x26')]();};}function saveUpdates(_0x3e80e9,_0x315317){return function(_0x5dcc80){if(_0x5dcc80){return _0x5dcc80[_0xb0c4('0x27')](_0x3e80e9)[_0xb0c4('0x28')](function(_0x348122){return _0x348122;});}return null;};}function removeEntity(_0x1476b3,_0x49101b){return function(_0xf5c4a9){if(_0xf5c4a9){return _0xf5c4a9[_0xb0c4('0x29')]()['then'](function(){_0x1476b3[_0xb0c4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583faa,_0x1e199f){return function(_0x39ab4d){if(!_0x39ab4d){_0x583faa['sendStatus'](0x194);}return _0x39ab4d;};}function handleError(_0x4d6be4,_0x551e8a){_0x551e8a=_0x551e8a||0x1f4;return function(_0x5ec2d8){logger[_0xb0c4('0x2a')](_0x5ec2d8[_0xb0c4('0x2b')]);if(_0x5ec2d8[_0xb0c4('0x2c')]){delete _0x5ec2d8[_0xb0c4('0x2c')];}_0x4d6be4[_0xb0c4('0x1d')](_0x551e8a)[_0xb0c4('0x2d')](_0x5ec2d8);};}exports['index']=function(_0x33077f,_0x440009){var _0x309b59={},_0x29fc13={},_0x4f4f33={'count':0x0,'rows':[]};var _0x18f78e=_[_0xb0c4('0x2e')](db['ChatGroup']['rawAttributes'],function(_0x217e80){return{'name':_0x217e80['fieldName'],'type':_0x217e80[_0xb0c4('0x2f')]['key']};});_0x29fc13[_0xb0c4('0x30')]=_[_0xb0c4('0x2e')](_0x18f78e,_0xb0c4('0x2c'));_0x29fc13[_0xb0c4('0x31')]=_['keys'](_0x33077f['query']);_0x29fc13['filters']=_['intersection'](_0x29fc13[_0xb0c4('0x30')],_0x29fc13[_0xb0c4('0x31')]);_0x309b59['attributes']=_[_0xb0c4('0x32')](_0x29fc13['model'],qs[_0xb0c4('0x33')](_0x33077f[_0xb0c4('0x31')]['fields']));_0x309b59['attributes']=_0x309b59[_0xb0c4('0x34')][_0xb0c4('0x35')]?_0x309b59[_0xb0c4('0x34')]:_0x29fc13[_0xb0c4('0x30')];if(!_0x33077f['query'][_0xb0c4('0x36')]('nolimit')){_0x309b59[_0xb0c4('0x20')]=qs[_0xb0c4('0x20')](_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x20')]);_0x309b59[_0xb0c4('0x1f')]=qs[_0xb0c4('0x1f')](_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x1f')]);}_0x309b59[_0xb0c4('0x37')]=qs[_0xb0c4('0x38')](_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x38')]);_0x309b59[_0xb0c4('0x39')]=qs[_0xb0c4('0x3a')](_[_0xb0c4('0x3b')](_0x33077f['query'],_0x29fc13[_0xb0c4('0x3a')]),_0x18f78e);if(_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x3c')]){_0x309b59[_0xb0c4('0x39')]=_[_0xb0c4('0x3d')](_0x309b59[_0xb0c4('0x39')],{'$or':_[_0xb0c4('0x2e')](_0x18f78e,function(_0x4549c0){if(_0x4549c0[_0xb0c4('0x2f')]!=='VIRTUAL'){var _0x4194fc={};_0x4194fc[_0x4549c0[_0xb0c4('0x2c')]]={'$like':'%'+_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x3c')]+'%'};return _0x4194fc;}})});}_0x309b59=_['merge']({},_0x309b59,_0x33077f['options']);var _0x1c41ca={'where':_0x309b59[_0xb0c4('0x39')]};return db['ChatGroup']['count'](_0x1c41ca)['then'](function(_0xa2811c){_0x4f4f33[_0xb0c4('0x22')]=_0xa2811c;if(_0x33077f['query'][_0xb0c4('0x3e')]){_0x309b59['include']=[{'all':!![]}];}return db[_0xb0c4('0x3f')][_0xb0c4('0x40')](_0x309b59);})[_0xb0c4('0x28')](function(_0xc7aed6){_0x4f4f33[_0xb0c4('0x41')]=_0xc7aed6;return _0x4f4f33;})[_0xb0c4('0x28')](respondWithFilteredResult(_0x440009,_0x309b59))[_0xb0c4('0x42')](handleError(_0x440009,null));};exports[_0xb0c4('0x43')]=function(_0xc0ccc2,_0x520e95){var _0x8303f0={'raw':!![],'where':{'id':_0xc0ccc2[_0xb0c4('0x44')]['id']}},_0x2c7f29={};_0x2c7f29['model']=_[_0xb0c4('0x45')](db[_0xb0c4('0x3f')][_0xb0c4('0x46')]);_0x2c7f29[_0xb0c4('0x31')]=_[_0xb0c4('0x45')](_0xc0ccc2['query']);_0x2c7f29[_0xb0c4('0x3a')]=_[_0xb0c4('0x32')](_0x2c7f29[_0xb0c4('0x30')],_0x2c7f29['query']);_0x8303f0['attributes']=_[_0xb0c4('0x32')](_0x2c7f29[_0xb0c4('0x30')],qs[_0xb0c4('0x33')](_0xc0ccc2['query'][_0xb0c4('0x33')]));_0x8303f0[_0xb0c4('0x34')]=_0x8303f0[_0xb0c4('0x34')]['length']?_0x8303f0[_0xb0c4('0x34')]:_0x2c7f29[_0xb0c4('0x30')];if(_0xc0ccc2[_0xb0c4('0x31')][_0xb0c4('0x3e')]){_0x8303f0['include']=[{'all':!![]}];}_0x8303f0=_[_0xb0c4('0x3d')]({},_0x8303f0,_0xc0ccc2[_0xb0c4('0x47')]);return db[_0xb0c4('0x3f')][_0xb0c4('0x48')](_0x8303f0)['then'](handleEntityNotFound(_0x520e95,null))['then'](respondWithResult(_0x520e95,null))[_0xb0c4('0x42')](handleError(_0x520e95,null));};exports[_0xb0c4('0x49')]=function(_0x3fb112,_0x264930){return db[_0xb0c4('0x3f')][_0xb0c4('0x49')](_0x3fb112[_0xb0c4('0x4a')],{})[_0xb0c4('0x28')](respondWithResult(_0x264930,0xc9))[_0xb0c4('0x42')](handleError(_0x264930,null));};exports[_0xb0c4('0x27')]=function(_0x551347,_0x1d461c){if(_0x551347[_0xb0c4('0x4a')]['id']){delete _0x551347[_0xb0c4('0x4a')]['id'];}return db[_0xb0c4('0x3f')][_0xb0c4('0x48')]({'where':{'id':_0x551347[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x1d461c,null))[_0xb0c4('0x28')](saveUpdates(_0x551347[_0xb0c4('0x4a')],null))[_0xb0c4('0x28')](respondWithResult(_0x1d461c,null))['catch'](handleError(_0x1d461c,null));};exports['destroy']=function(_0x4cca5c,_0x4de00e){return db['ChatGroup'][_0xb0c4('0x48')]({'where':{'id':_0x4cca5c['params']['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x4de00e,null))['then'](removeEntity(_0x4de00e,null))[_0xb0c4('0x42')](handleError(_0x4de00e,null));};exports[_0xb0c4('0x4b')]=function(_0x3cd7cf,_0x4b7656){return db[_0xb0c4('0x3f')][_0xb0c4('0x4b')]()[_0xb0c4('0x28')](respondWithResult(_0x4b7656,null))[_0xb0c4('0x42')](handleError(_0x4b7656,null));};exports[_0xb0c4('0x4c')]=function(_0x383f90,_0x5b6d1e,_0x26c520){return db[_0xb0c4('0x4d')][_0xb0c4('0x22')]({'where':{'ChatGroupId':_0x383f90[_0xb0c4('0x44')]['id'],'ToId':_0x383f90[_0xb0c4('0x4e')]['id'],'read':![]}})[_0xb0c4('0x28')](function(_0x1b2c02){return{'id':_[_0xb0c4('0x4f')](_0x383f90['params']['id']),'count':_0x1b2c02};})[_0xb0c4('0x28')](respondWithResult(_0x5b6d1e,null))['catch'](handleError(_0x5b6d1e,null));};exports['addMembers']=function(_0x2725ec,_0x488998,_0x16774a){return db[_0xb0c4('0x3f')]['find']({'where':{'id':_0x2725ec[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x488998,null))[_0xb0c4('0x28')](function(_0x22a254){if(_0x22a254){return _0x22a254[_0xb0c4('0x50')](_0x2725ec[_0xb0c4('0x4a')][_0xb0c4('0x51')],_[_0xb0c4('0x52')](_0x2725ec[_0xb0c4('0x4a')],['ids','id'])||{});}})[_0xb0c4('0x28')](respondWithResult(_0x488998,null))['catch'](handleError(_0x488998,null));};exports[_0xb0c4('0x53')]=function(_0x5610d1,_0x3567ab,_0x4bc908){var _0x5de416={};var _0x5f279f={};var _0x1164c1;var _0x116d65;return db[_0xb0c4('0x3f')]['findOne']({'where':{'id':_0x5610d1[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x3567ab,null))['then'](function(_0xa6f3f4){if(_0xa6f3f4){_0x1164c1=_0xa6f3f4;_0x5f279f[_0xb0c4('0x30')]=_['keys'](db['User'][_0xb0c4('0x46')]);_0x5f279f[_0xb0c4('0x31')]=_[_0xb0c4('0x45')](_0x5610d1[_0xb0c4('0x31')]);_0x5f279f[_0xb0c4('0x3a')]=_[_0xb0c4('0x32')](_0x5f279f[_0xb0c4('0x30')],_0x5f279f['query']);_0x5de416[_0xb0c4('0x34')]=_[_0xb0c4('0x32')](_0x5f279f[_0xb0c4('0x30')],qs['fields'](_0x5610d1[_0xb0c4('0x31')]['fields']));_0x5de416[_0xb0c4('0x34')]=_0x5de416[_0xb0c4('0x34')][_0xb0c4('0x35')]?_0x5de416[_0xb0c4('0x34')]:_0x5f279f[_0xb0c4('0x30')];_0x5de416['order']=qs[_0xb0c4('0x38')](_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x38')]);_0x5de416[_0xb0c4('0x39')]=qs['filters'](_[_0xb0c4('0x3b')](_0x5610d1[_0xb0c4('0x31')],_0x5f279f[_0xb0c4('0x3a')]));if(_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x3c')]){_0x5de416[_0xb0c4('0x39')]=_[_0xb0c4('0x3d')](_0x5de416['where'],{'$or':_[_0xb0c4('0x2e')](_0x5de416['attributes'],function(_0x1ffefb){var _0x3802b8={};_0x3802b8[_0x1ffefb]={'$like':'%'+_0x5610d1['query'][_0xb0c4('0x3c')]+'%'};return _0x3802b8;})});}_0x5de416=_['merge']({},_0x5de416,_0x5610d1[_0xb0c4('0x47')]);return _0x1164c1['getMembers'](_0x5de416);}})[_0xb0c4('0x28')](function(_0x136553){if(_0x136553){_0x116d65=_0x136553['length'];if(!_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x36')](_0xb0c4('0x54'))){_0x5de416['limit']=qs[_0xb0c4('0x20')](_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x20')]);_0x5de416[_0xb0c4('0x1f')]=qs['offset'](_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x1f')]);}return _0x1164c1[_0xb0c4('0x53')](_0x5de416);}})[_0xb0c4('0x28')](function(_0x55941b){if(_0x55941b){return _0x55941b?{'count':_0x116d65,'rows':_0x55941b}:null;}})[_0xb0c4('0x28')](respondWithResult(_0x3567ab,null))[_0xb0c4('0x42')](handleError(_0x3567ab,null));};exports[_0xb0c4('0x55')]=function(_0x1d674c,_0x5afba5,_0x5f0d70){return db['ChatGroup'][_0xb0c4('0x48')]({'where':{'id':_0x1d674c[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x5afba5,null))[_0xb0c4('0x28')](function(_0x196417){if(_0x196417){return _0x196417['removeMembers'](_0x1d674c[_0xb0c4('0x31')]['ids']);}})[_0xb0c4('0x28')](respondWithStatusCode(_0x5afba5,null))[_0xb0c4('0x42')](handleError(_0x5afba5,null));};exports[_0xb0c4('0x56')]=function(_0x39f440,_0x74ed1b,_0x1ea5ab){if(_0x39f440['body']['id']){delete _0x39f440['body']['id'];}return db['ChatGroup'][_0xb0c4('0x48')]({'where':{'id':_0x39f440[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x74ed1b,null))['then'](function(_0x171f42){if(_0x171f42){_0x39f440[_0xb0c4('0x4a')]['ChatGroupId']=_0x171f42['id'];return db[_0xb0c4('0x4d')]['create'](_0x39f440[_0xb0c4('0x4a')]);}})['then'](respondWithResult(_0x74ed1b,null))[_0xb0c4('0x42')](handleError(_0x74ed1b,null));};exports[_0xb0c4('0x57')]=function(_0x573028,_0x57ee03,_0x269305){var _0x5b7306={};var _0x21f542={};var _0x78fe03;var _0x377bab;return db['ChatGroup'][_0xb0c4('0x58')]({'where':{'id':_0x573028[_0xb0c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x57ee03,null))[_0xb0c4('0x28')](function(_0x330d21){if(_0x330d21){_0x78fe03=_0x330d21;_0x21f542['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x21f542[_0xb0c4('0x31')]=_[_0xb0c4('0x45')](_0x573028['query']);_0x21f542[_0xb0c4('0x3a')]=_[_0xb0c4('0x32')](_0x21f542[_0xb0c4('0x30')],_0x21f542['query']);_0x5b7306[_0xb0c4('0x34')]=_['intersection'](_0x21f542[_0xb0c4('0x30')],qs['fields'](_0x573028[_0xb0c4('0x31')][_0xb0c4('0x33')]));_0x5b7306['attributes']=_0x5b7306[_0xb0c4('0x34')][_0xb0c4('0x35')]?_0x5b7306['attributes']:_0x21f542[_0xb0c4('0x30')];_0x5b7306['order']=qs[_0xb0c4('0x38')](_0x573028['query']['sort']);_0x5b7306[_0xb0c4('0x39')]=qs[_0xb0c4('0x3a')](_[_0xb0c4('0x3b')](_0x573028[_0xb0c4('0x31')],_0x21f542[_0xb0c4('0x3a')]));if(_0x573028[_0xb0c4('0x31')][_0xb0c4('0x3c')]){_0x5b7306[_0xb0c4('0x39')]=_['merge'](_0x5b7306['where'],{'$or':_[_0xb0c4('0x2e')](_0x5b7306[_0xb0c4('0x34')],function(_0x1f4a41){var _0x3e3905={};_0x3e3905[_0x1f4a41]={'$like':'%'+_0x573028[_0xb0c4('0x31')][_0xb0c4('0x3c')]+'%'};return _0x3e3905;})});}if(_0x573028[_0xb0c4('0x31')]['$gte']){var _0x12d9cd=_0x573028[_0xb0c4('0x31')][_0xb0c4('0x59')][_0xb0c4('0x5a')](',');var _0x466ae3={};_0x466ae3[_0x12d9cd[0x0]]={'$gte':moment(_0x12d9cd[0x1])[_0xb0c4('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b7306['where']=_[_0xb0c4('0x3d')](_0x5b7306[_0xb0c4('0x39')],_0x466ae3);}_0x5b7306=_['merge']({},_0x5b7306,_0x573028['options']);return _0x78fe03['getMessages'](_0x5b7306);}})['then'](function(_0x678bd0){if(_0x678bd0){_0x377bab=_0x678bd0[_0xb0c4('0x35')];if(!_0x573028[_0xb0c4('0x31')]['hasOwnProperty'](_0xb0c4('0x54'))){_0x5b7306[_0xb0c4('0x20')]=qs['limit'](_0x573028[_0xb0c4('0x31')][_0xb0c4('0x20')]);_0x5b7306[_0xb0c4('0x1f')]=qs[_0xb0c4('0x1f')](_0x573028['query'][_0xb0c4('0x1f')]);}return _0x78fe03[_0xb0c4('0x57')](_0x5b7306);}})['then'](function(_0x30acdc){if(_0x30acdc){return _0x30acdc?{'count':_0x377bab,'rows':_0x30acdc}:null;}})[_0xb0c4('0x28')](respondWithResult(_0x57ee03,null))['catch'](handleError(_0x57ee03,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6311c34..c14d285 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 _0x5226=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x52113f,_0x29d37b){var _0x2575e5=function(_0xcf2aeb){while(--_0xcf2aeb){_0x52113f['push'](_0x52113f['shift']());}};_0x2575e5(++_0x29d37b);}(_0x5226,0x137));var _0x6522=function(_0x3b8251,_0x2e024c){_0x3b8251=_0x3b8251-0x0;var _0x23033a=_0x5226[_0x3b8251];return _0x23033a;};'use strict';var EventEmitter=require(_0x6522('0x0'));var ChatGroup=require(_0x6522('0x1'))['db'][_0x6522('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6522('0x3')](0x0);var events={'afterCreate':_0x6522('0x4'),'afterUpdate':'update','afterDestroy':_0x6522('0x5')};function emitEvent(_0x43f913){return function(_0x12dffe,_0x48d4db,_0x228009){ChatGroupEvents['emit'](_0x43f913+':'+_0x12dffe['id'],_0x12dffe);ChatGroupEvents[_0x6522('0x6')](_0x43f913,_0x12dffe);_0x228009(null);};}for(var e in events){if(events[_0x6522('0x7')](e)){var event=events[e];ChatGroup[_0x6522('0x8')](e,emitEvent(event));}}module[_0x6522('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x5cd6=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x5cd6,0xfa));var _0x65cd=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x5cd6[_0x23e7c1];return _0x1add43;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65cd('0x0'))['db'][_0x65cd('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65cd('0x2')](0x0);var events={'afterCreate':_0x65cd('0x3'),'afterUpdate':_0x65cd('0x4'),'afterDestroy':'remove'};function emitEvent(_0xdf7a0b){return function(_0x1000cd,_0x21fe79,_0x827479){ChatGroupEvents[_0x65cd('0x5')](_0xdf7a0b+':'+_0x1000cd['id'],_0x1000cd);ChatGroupEvents[_0x65cd('0x5')](_0xdf7a0b,_0x1000cd);_0x827479(null);};}for(var e in events){if(events[_0x65cd('0x6')](e)){var event=events[e];ChatGroup[_0x65cd('0x7')](e,emitEvent(event));}}module[_0x65cd('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 28bdf53..277c0ac 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 _0xdfde=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','../../config/logger'];(function(_0x4bd56c,_0x3f21fb){var _0x12f6a6=function(_0x120a0f){while(--_0x120a0f){_0x4bd56c['push'](_0x4bd56c['shift']());}};_0x12f6a6(++_0x3f21fb);}(_0xdfde,0x1ed));var _0xedfd=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0xdfde[_0x328bd3];return _0x458149;};'use strict';var _=require(_0xedfd('0x0'));var util=require('util');var logger=require(_0xedfd('0x1'))(_0xedfd('0x2'));var moment=require(_0xedfd('0x3'));var BPromise=require(_0xedfd('0x4'));var rp=require(_0xedfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedfd('0x6'));var config=require(_0xedfd('0x7'));var attributes=require(_0xedfd('0x8'));module['exports']=function(_0x19fb63,_0x3fbb90){return _0x19fb63['define'](_0xedfd('0x9'),attributes,{'tableName':_0xedfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4265=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x4265,0x15a));var _0x5426=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x4265[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var logger=require('../../config/logger')(_0x5426('0x2'));var moment=require(_0x5426('0x3'));var BPromise=require(_0x5426('0x4'));var rp=require(_0x5426('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5426('0x6'));var config=require(_0x5426('0x7'));var attributes=require('./chatGroup.attributes');module[_0x5426('0x8')]=function(_0x5ea6ba,_0x4ef7c0){return _0x5ea6ba[_0x5426('0x9')](_0x5426('0xa'),attributes,{'tableName':_0x5426('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index cfd680f..d7fe0fc 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 _0x4422=['socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0xde3f0e,_0x57ab89){var _0x4b1f70=function(_0x11a26a){while(--_0x11a26a){_0xde3f0e['push'](_0xde3f0e['shift']());}};_0x4b1f70(++_0x57ab89);}(_0x4422,0xab));var _0x2442=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4422[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2442('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2442('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2442('0x2'));var db=require(_0x2442('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2442('0x4'));var config=require(_0x2442('0x5'));var jayson=require(_0x2442('0x6'));var client=jayson[_0x2442('0x7')]['http']({'port':0x232a});config[_0x2442('0x8')]=_[_0x2442('0x9')](config[_0x2442('0x8')],{'host':_0x2442('0xa'),'port':0x18eb});var socket=require(_0x2442('0xb'))(new Redis(config[_0x2442('0x8')]));require('./chatGroup.socket')[_0x2442('0xc')](socket);function respondWithRpcPromise(_0x3ca25d,_0x4197c8,_0x1ac048){return new BPromise(function(_0x1cd807,_0x628677){return client[_0x2442('0xd')](_0x3ca25d,_0x1ac048)[_0x2442('0xe')](function(_0x49153c){logger[_0x2442('0xf')](_0x2442('0x10'),_0x4197c8,_0x2442('0x11'));logger[_0x2442('0x12')](_0x2442('0x13'),_0x4197c8,_0x2442('0x11'),JSON[_0x2442('0x14')](_0x49153c));if(_0x49153c['error']){if(_0x49153c[_0x2442('0x15')][_0x2442('0x16')]===0x1f4){logger[_0x2442('0x15')](_0x2442('0x10'),_0x4197c8,_0x49153c['error'][_0x2442('0x17')]);return _0x628677(_0x49153c[_0x2442('0x15')]['message']);}logger[_0x2442('0x15')](_0x2442('0x10'),_0x4197c8,_0x49153c['error'][_0x2442('0x17')]);return _0x1cd807(_0x49153c[_0x2442('0x15')][_0x2442('0x17')]);}else{logger[_0x2442('0xf')](_0x2442('0x10'),_0x4197c8,'request\x20sent');_0x1cd807(_0x49153c[_0x2442('0x18')][_0x2442('0x17')]);}})[_0x2442('0x19')](function(_0x58c725){logger[_0x2442('0x15')](_0x2442('0x10'),_0x4197c8,_0x58c725);_0x628677(_0x58c725);});});} \ No newline at end of file +var _0x4812=['register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4812,0x10a));var _0x2481=function(_0x5259a7,_0x48d57c){_0x5259a7=_0x5259a7-0x0;var _0x2b5084=_0x4812[_0x5259a7];return _0x2b5084;};'use strict';var _=require(_0x2481('0x0'));var util=require(_0x2481('0x1'));var moment=require('moment');var BPromise=require(_0x2481('0x2'));var rs=require(_0x2481('0x3'));var fs=require('fs');var Redis=require(_0x2481('0x4'));var db=require(_0x2481('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2481('0x6'))('rpc');var config=require(_0x2481('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2481('0x8')][_0x2481('0x9')]({'port':0x232a});config[_0x2481('0xa')]=_[_0x2481('0xb')](config[_0x2481('0xa')],{'host':_0x2481('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2481('0xd'))[_0x2481('0xe')](socket);function respondWithRpcPromise(_0x1c19dd,_0xf7029f,_0x1a1ee3){return new BPromise(function(_0x5922e5,_0x189f7b){return client[_0x2481('0xf')](_0x1c19dd,_0x1a1ee3)[_0x2481('0x10')](function(_0x197b6d){logger[_0x2481('0x11')](_0x2481('0x12'),_0xf7029f,'request\x20sent');logger[_0x2481('0x13')](_0x2481('0x14'),_0xf7029f,_0x2481('0x15'),JSON[_0x2481('0x16')](_0x197b6d));if(_0x197b6d[_0x2481('0x17')]){if(_0x197b6d[_0x2481('0x17')][_0x2481('0x18')]===0x1f4){logger[_0x2481('0x17')]('ChatGroup,\x20%s,\x20%s',_0xf7029f,_0x197b6d[_0x2481('0x17')][_0x2481('0x19')]);return _0x189f7b(_0x197b6d[_0x2481('0x17')][_0x2481('0x19')]);}logger[_0x2481('0x17')]('ChatGroup,\x20%s,\x20%s',_0xf7029f,_0x197b6d[_0x2481('0x17')][_0x2481('0x19')]);return _0x5922e5(_0x197b6d[_0x2481('0x17')]['message']);}else{logger[_0x2481('0x11')]('ChatGroup,\x20%s,\x20%s',_0xf7029f,_0x2481('0x15'));_0x5922e5(_0x197b6d[_0x2481('0x1a')][_0x2481('0x19')]);}})[_0x2481('0x1b')](function(_0x186abb){logger[_0x2481('0x17')](_0x2481('0x12'),_0xf7029f,_0x186abb);_0x189f7b(_0x186abb);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ca12b36..834795d 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 _0x6026=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x6026,0x141));var _0x6602=function(_0x3e7689,_0xdf5f7f){_0x3e7689=_0x3e7689-0x0;var _0x4a3008=_0x6026[_0x3e7689];return _0x4a3008;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6602('0x0'),_0x6602('0x1'),_0x6602('0x2')];function createListener(_0xf12504,_0x4b2b12){return function(_0xf2c6c2){_0x4b2b12[_0x6602('0x3')](_0xf12504,_0xf2c6c2);};}function removeListener(_0x2a3b41,_0x7dbcbb){return function(){ChatGroupEvents[_0x6602('0x4')](_0x2a3b41,_0x7dbcbb);};}exports[_0x6602('0x5')]=function(_0x1e5503){for(var _0x206241=0x0,_0x38906=events[_0x6602('0x6')];_0x206241<_0x38906;_0x206241++){var _0x4e6827=events[_0x206241];var _0x14180f=createListener(_0x6602('0x7')+_0x4e6827,_0x1e5503);ChatGroupEvents['on'](_0x4e6827,_0x14180f);}}; \ No newline at end of file +var _0x5054=['emit','length','./chatGroup.events','update'];(function(_0x4ddb61,_0x37b9b7){var _0x23ba67=function(_0x498e91){while(--_0x498e91){_0x4ddb61['push'](_0x4ddb61['shift']());}};_0x23ba67(++_0x37b9b7);}(_0x5054,0x17a));var _0x4505=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5054[_0x20a584];return _0x4b41a8;};'use strict';var ChatGroupEvents=require(_0x4505('0x0'));var events=['save','remove',_0x4505('0x1')];function createListener(_0x520ddf,_0x5e4154){return function(_0x5402c0){_0x5e4154[_0x4505('0x2')](_0x520ddf,_0x5402c0);};}function removeListener(_0x4b48c3,_0xbc729e){return function(){ChatGroupEvents['removeListener'](_0x4b48c3,_0xbc729e);};}exports['register']=function(_0x44a026){for(var _0x4d1efd=0x0,_0x44ba04=events[_0x4505('0x3')];_0x4d1efd<_0x44ba04;_0x4d1efd++){var _0x226cb1=events[_0x4d1efd];var _0x459ef9=createListener('chatGroup:'+_0x226cb1,_0x44a026);ChatGroupEvents['on'](_0x226cb1,_0x459ef9);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 2f5f498..b22b4bb 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 _0xd1e8=['post','addMessage','put','/:id','update','destroy','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x537b95,_0x3a77ea){var _0x5af140=function(_0x223a60){while(--_0x223a60){_0x537b95['push'](_0x537b95['shift']());}};_0x5af140(++_0x3a77ea);}(_0xd1e8,0xd8));var _0x8d1e=function(_0x1f1c17,_0x4ed89e){_0x1f1c17=_0x1f1c17-0x0;var _0x59109b=_0xd1e8[_0x1f1c17];return _0x59109b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d1e('0x0'));var timeout=require(_0x8d1e('0x1'));var express=require('express');var router=express[_0x8d1e('0x2')]();var fs_extra=require(_0x8d1e('0x3'));var auth=require(_0x8d1e('0x4'));var interaction=require(_0x8d1e('0x5'));var config=require(_0x8d1e('0x6'));var controller=require(_0x8d1e('0x7'));router[_0x8d1e('0x8')]('/',auth[_0x8d1e('0x9')](),controller['index']);router[_0x8d1e('0x8')](_0x8d1e('0xa'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0xb')]);router[_0x8d1e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8d1e('0xc')]);router[_0x8d1e('0x8')](_0x8d1e('0xd'),auth['isAuthenticated'](),controller[_0x8d1e('0xe')]);router[_0x8d1e('0x8')](_0x8d1e('0xf'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0x10')]);router[_0x8d1e('0x8')](_0x8d1e('0x11'),auth[_0x8d1e('0x9')](),controller['getMessages']);router['post']('/',auth[_0x8d1e('0x9')](),controller['create']);router['post']('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x8d1e('0x12')](_0x8d1e('0x11'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0x13')]);router[_0x8d1e('0x14')](_0x8d1e('0x15'),auth['isAuthenticated'](),controller[_0x8d1e('0x16')]);router['delete'](_0x8d1e('0x15'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0x17')]);router[_0x8d1e('0x18')](_0x8d1e('0xf'),auth[_0x8d1e('0x9')](),controller['removeMembers']);module[_0x8d1e('0x19')]=router; \ No newline at end of file +var _0xf448=['/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show'];(function(_0x5599aa,_0x1b9ffe){var _0x4b0f34=function(_0xbd81f0){while(--_0xbd81f0){_0x5599aa['push'](_0x5599aa['shift']());}};_0x4b0f34(++_0x1b9ffe);}(_0xf448,0x66));var _0x8f44=function(_0x589eab,_0xc40cd1){_0x589eab=_0x589eab-0x0;var _0xe66536=_0xf448[_0x589eab];return _0xe66536;};'use strict';var multer=require(_0x8f44('0x0'));var util=require(_0x8f44('0x1'));var path=require(_0x8f44('0x2'));var timeout=require(_0x8f44('0x3'));var express=require(_0x8f44('0x4'));var router=express['Router']();var fs_extra=require(_0x8f44('0x5'));var auth=require(_0x8f44('0x6'));var interaction=require(_0x8f44('0x7'));var config=require(_0x8f44('0x8'));var controller=require('./chatGroup.controller');router[_0x8f44('0x9')]('/',auth[_0x8f44('0xa')](),controller[_0x8f44('0xb')]);router[_0x8f44('0x9')]('/describe',auth[_0x8f44('0xa')](),controller[_0x8f44('0xc')]);router[_0x8f44('0x9')]('/:id',auth[_0x8f44('0xa')](),controller[_0x8f44('0xd')]);router['get'](_0x8f44('0xe'),auth['isAuthenticated'](),controller[_0x8f44('0xf')]);router[_0x8f44('0x9')](_0x8f44('0x10'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x11')]);router[_0x8f44('0x9')](_0x8f44('0x12'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x13')]);router[_0x8f44('0x14')]('/',auth[_0x8f44('0xa')](),controller[_0x8f44('0x15')]);router['post']('/:id/members',auth[_0x8f44('0xa')](),controller['addMembers']);router['post'](_0x8f44('0x12'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x16')]);router[_0x8f44('0x17')](_0x8f44('0x18'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x19')]);router[_0x8f44('0x1a')](_0x8f44('0x18'),auth['isAuthenticated'](),controller[_0x8f44('0x1b')]);router[_0x8f44('0x1a')](_0x8f44('0x10'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 46ed441..3e9c3fa 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 _0x352e=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x352e,0x1a6));var _0xe352=function(_0x53d0d5,_0x34f8d4){_0x53d0d5=_0x53d0d5-0x0;var _0x146297=_0x352e[_0x53d0d5];return _0x146297;};'use strict';var Sequelize=require(_0xe352('0x0'));module[_0xe352('0x1')]={'closed':{'type':Sequelize[_0xe352('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe352('0x3')]},'ratingType':{'type':Sequelize[_0xe352('0x4')](_0xe352('0x5'),_0xe352('0x6')),'defaultValue':_0xe352('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe352('0x7')]},'mailTranscript':{'type':Sequelize[_0xe352('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe352('0x8')]},'secondDisposition':{'type':Sequelize[_0xe352('0x8')]},'thirdDisposition':{'type':Sequelize[_0xe352('0x8')]},'note':{'type':Sequelize[_0xe352('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xe352('0x8')]},'osName':{'type':Sequelize[_0xe352('0x8')]},'osVersion':{'type':Sequelize[_0xe352('0x8')]},'deviceModel':{'type':Sequelize[_0xe352('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xe352('0x8')]},'referer':{'type':Sequelize[_0xe352('0x7')]},'customerIp':{'type':Sequelize[_0xe352('0x8')]},'formData':{'type':Sequelize[_0xe352('0x7')](_0xe352('0x9'))},'read1stAt':{'type':Sequelize[_0xe352('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe352('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe352('0x8')]},'customerPort':{'type':Sequelize[_0xe352('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xe352('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xe352('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x757a=['thumb','star','TEXT','STRING','DATE','long','exports','BOOLEAN'];(function(_0x49b465,_0x497bb7){var _0x9a3fea=function(_0x51a5b1){while(--_0x51a5b1){_0x49b465['push'](_0x49b465['shift']());}};_0x9a3fea(++_0x497bb7);}(_0x757a,0xde));var _0xa757=function(_0x58cd5e,_0x4b7fb5){_0x58cd5e=_0x58cd5e-0x0;var _0x4fe64e=_0x757a[_0x58cd5e];return _0x4fe64e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'closed':{'type':Sequelize[_0xa757('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0xa757('0x2')),'defaultValue':_0xa757('0x3')},'ratingMessage':{'type':Sequelize[_0xa757('0x4')]},'pathTranscript':{'type':Sequelize[_0xa757('0x4')]},'mailTranscript':{'type':Sequelize[_0xa757('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa757('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa757('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa757('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa757('0x5')]},'browserVersion':{'type':Sequelize[_0xa757('0x5')]},'osName':{'type':Sequelize[_0xa757('0x5')]},'osVersion':{'type':Sequelize[_0xa757('0x5')]},'deviceModel':{'type':Sequelize[_0xa757('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa757('0x5')]},'referer':{'type':Sequelize[_0xa757('0x4')]},'customerIp':{'type':Sequelize[_0xa757('0x5')]},'formData':{'type':Sequelize[_0xa757('0x4')](_0xa757('0x7'))},'read1stAt':{'type':Sequelize[_0xa757('0x6')]},'lastMsgAt':{'type':Sequelize[_0xa757('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa757('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4363b94..9062f51 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 _0x9134=['ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','contact','POST','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','abandon','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','offline-chat/','close','mailTranscript','join','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','CmContact','format','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','findAll','addTags','setTags','spread','emit','removeTags','server','files','tmp','attachments','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','osName','referer','customerIp','customerPort','basename','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','sendStatus','stack','name','render','merge','agent','account','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','unmanaged','abandoned','total','closed','UserId','disposition','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','unreadMessages','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9134,0x1b7));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4913('0x0'));var rimraf=require(_0x4913('0x1'));var zipdir=require(_0x4913('0x2'));var jsonpatch=require(_0x4913('0x3'));var rp=require(_0x4913('0x4'));var moment=require(_0x4913('0x5'));var BPromise=require(_0x4913('0x6'));var Mustache=require(_0x4913('0x7'));var util=require('util');var path=require(_0x4913('0x8'));var sox=require(_0x4913('0x9'));var csv=require(_0x4913('0xa'));var ejs=require(_0x4913('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4913('0xc'));var squel=require(_0x4913('0xd'));var crypto=require(_0x4913('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4913('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4913('0x10'));var Redis=require(_0x4913('0x11'));var authService=require(_0x4913('0x12'));var qs=require(_0x4913('0x13'));var as=require(_0x4913('0x14'));var pdf=require(_0x4913('0x15'));var hardwareService=require(_0x4913('0x16'));var logger=require(_0x4913('0x17'))(_0x4913('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4913('0x19'))['db'];config[_0x4913('0x1a')]=_[_0x4913('0x1b')](config[_0x4913('0x1a')],{'host':_0x4913('0x1c'),'port':0x18eb});var socket=require(_0x4913('0x1d'))(new Redis(config[_0x4913('0x1a')]));require(_0x4913('0x1e'))[_0x4913('0x1f')](socket);var jayson=require(_0x4913('0x20'));var client=jayson[_0x4913('0x21')][_0x4913('0x22')]({'port':0x232b});var client9004=jayson[_0x4913('0x21')][_0x4913('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x318a1c,_0x22319a,_0x5a2296,_0x23d05d){return new BPromise(function(_0x4c1945,_0x29f2a1){var _0x45edf1=_0x23d05d||client;return _0x45edf1[_0x4913('0x23')](_0x318a1c,_0x5a2296)['then'](function(_0x4f03ab){logger[_0x4913('0x24')](_0x4913('0x25'),_0x22319a,_0x4913('0x26'));logger['debug'](_0x4913('0x27'),_0x22319a,_0x4913('0x26'),JSON[_0x4913('0x28')](_0x4f03ab));if(_0x4f03ab['error']){if(_0x4f03ab[_0x4913('0x29')][_0x4913('0x2a')]===0x1f4){logger[_0x4913('0x29')](_0x4913('0x25'),_0x22319a,_0x4f03ab[_0x4913('0x29')]['message']);return _0x29f2a1(_0x4f03ab['error'][_0x4913('0x2b')]);}logger[_0x4913('0x29')](_0x4913('0x25'),_0x22319a,_0x4f03ab[_0x4913('0x29')][_0x4913('0x2b')]);return _0x4c1945(_0x4f03ab[_0x4913('0x29')]['message']);}else{logger[_0x4913('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x22319a,_0x4913('0x26'));_0x4c1945(_0x4f03ab[_0x4913('0x2c')][_0x4913('0x2b')]);}})['catch'](function(_0x37c158){logger[_0x4913('0x29')](_0x4913('0x25'),_0x22319a,_0x37c158);_0x29f2a1(_0x37c158);});});}function respondWithStatusCode(_0x23cf35,_0x14a526){_0x14a526=_0x14a526||0xcc;return function(_0x413a4a){if(_0x413a4a){return _0x23cf35['sendStatus'](_0x14a526);}return _0x23cf35[_0x4913('0x2d')](_0x14a526)[_0x4913('0x2e')]();};}function respondWithResult(_0x33f540,_0x5dd634){_0x5dd634=_0x5dd634||0xc8;return function(_0x336063){if(_0x336063){return _0x33f540[_0x4913('0x2d')](_0x5dd634)[_0x4913('0x2f')](_0x336063);}};}function respondWithFilteredResult(_0x524605,_0x156ebb){return function(_0x38b8ae){if(_0x38b8ae){var _0x290509=typeof _0x156ebb[_0x4913('0x30')]===_0x4913('0x31')&&typeof _0x156ebb[_0x4913('0x32')]===_0x4913('0x31');var _0x336110=_0x38b8ae['count'];var _0x33c9d0=_0x290509?0x0:_0x156ebb[_0x4913('0x30')];var _0x374907=_0x290509?_0x38b8ae[_0x4913('0x33')]:_0x156ebb[_0x4913('0x30')]+_0x156ebb[_0x4913('0x32')];var _0x3778dc;if(_0x374907>=_0x336110){_0x374907=_0x336110;_0x3778dc=0xc8;}else{_0x3778dc=0xce;}_0x524605[_0x4913('0x2d')](_0x3778dc);return _0x524605[_0x4913('0x34')](_0x4913('0x35'),_0x33c9d0+'-'+_0x374907+'/'+_0x336110)[_0x4913('0x2f')](_0x38b8ae);}return null;};}function patchUpdates(_0x185e6e){return function(_0x40a226){try{jsonpatch[_0x4913('0x36')](_0x40a226,_0x185e6e,!![]);}catch(_0x40f784){return BPromise['reject'](_0x40f784);}return _0x40a226['save']();};}function saveUpdates(_0x205541,_0x2dad0f){return function(_0x223e7b){if(_0x223e7b){return _0x223e7b['update'](_0x205541)['then'](function(_0x276226){return _0x276226;});}return null;};}function removeEntity(_0x5937f5,_0x491cc3){return function(_0x406758){if(_0x406758){return _0x406758['destroy']()[_0x4913('0x37')](function(){_0x5937f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ba82,_0x4cd281){return function(_0x364e58){if(!_0x364e58){_0x56ba82[_0x4913('0x38')](0x194);}return _0x364e58;};}function handleError(_0x2d65c9,_0x78d5eb){_0x78d5eb=_0x78d5eb||0x1f4;return function(_0x4fd35b){logger[_0x4913('0x29')](_0x4fd35b[_0x4913('0x39')]);if(_0x4fd35b['name']){delete _0x4fd35b[_0x4913('0x3a')];}_0x2d65c9['status'](_0x78d5eb)['send'](_0x4fd35b);};}function getMustacheRender(_0x79dbe7,_0x359d9a){return Mustache[_0x4913('0x3b')](_0x79dbe7,_[_0x4913('0x3c')](_0x359d9a['body'],{'contact':_0x359d9a['contact'],'message':_0x359d9a[_0x4913('0x2b')],'agent':_0x359d9a[_0x4913('0x3d')],'interaction':_0x359d9a['interaction'],'account':_0x359d9a[_0x4913('0x3e')]}))||'';}function getInteractionUsers(_0x5d607c,_0x5b5800){return new BPromise(function(_0x3929f1,_0x3c4279){try{if(_0x5b5800[_0x5d607c['id']]){_0x5d607c[_0x4913('0x3f')]=_[_0x4913('0x40')](_0x5b5800[_0x5d607c['id']],function(_0x59075a){return{'id':_0x59075a['id'],'fullname':_0x59075a[_0x4913('0x41')]};});}}catch(_0x4f78a6){_0x3c4279(_0x4f78a6);}_0x3929f1(_0x5d607c);});}function getInteractionTags(_0xbbc8d3,_0x4a2012){return new BPromise(function(_0x446908,_0x35e177){try{if(_0xbbc8d3[_0x4913('0x42')]){_0xbbc8d3[_0x4913('0x43')]=[];_0xbbc8d3[_0x4913('0x42')][_0x4913('0x44')](',')[_0x4913('0x45')](function(_0xaa3ce3){_0xbbc8d3[_0x4913('0x43')]['push'](_0x4a2012[_0xaa3ce3]);});}delete _0xbbc8d3[_0x4913('0x42')];}catch(_0x1cdb58){_0x35e177(_0x1cdb58);}_0x446908(_0xbbc8d3);});}function updateChatInteraction(_0x521acc,_0x3fee7c,_0x16d7ff){return new BPromise(function(_0x54a525,_0x460a8a){return getInteractionUsers(_0x521acc,_0x16d7ff)[_0x4913('0x37')](function(_0x33287d){return getInteractionTags(_0x33287d,_0x3fee7c);})[_0x4913('0x37')](function(_0x43fcaf){return getStateInteraction(_0x43fcaf);})[_0x4913('0x37')](function(_0x2986e5){_0x54a525(_0x2986e5);})[_0x4913('0x46')](function(_0x4e127b){_0x460a8a(_0x4e127b);});});}function getStateInteraction(_0x79f6f7){return new BPromise(function(_0x4fcdb8){_0x79f6f7[_0x4913('0x47')]=0x0;_0x79f6f7[_0x4913('0x48')]=0x0;_0x79f6f7['answered']=0x0;_0x79f6f7[_0x4913('0x49')]=0x0;_0x79f6f7[_0x4913('0x4a')]=0x0;_0x79f6f7[_0x4913('0x4b')]=0x0;if(!_0x79f6f7[_0x4913('0x4c')]&&!_0x79f6f7[_0x4913('0x4d')]){_0x79f6f7[_0x4913('0x47')]+=0x1;}if(!_0x79f6f7[_0x4913('0x4c')]&&_0x79f6f7['UserId']){_0x79f6f7[_0x4913('0x48')]+=0x1;if(_0x79f6f7[_0x4913('0x47')]){_0x79f6f7['waiting']-=0x1;}}if(_0x79f6f7[_0x4913('0x4c')]&&_0x79f6f7[_0x4913('0x4e')]==='abandoned'){_0x79f6f7['abandoned']+=0x1;if(_0x79f6f7['waiting']){_0x79f6f7[_0x4913('0x47')]-=0x1;}}else if(_0x79f6f7['closed']&&!_0x79f6f7[_0x4913('0x4d')]&&_0x79f6f7[_0x4913('0x4e')]){_0x79f6f7[_0x4913('0x49')]+=0x1;if(_0x79f6f7['waiting']){_0x79f6f7[_0x4913('0x47')]-=0x1;}}else if(_0x79f6f7['closed']&&_0x79f6f7[_0x4913('0x4d')]){_0x79f6f7['answered']+=0x1;if(_0x79f6f7[_0x4913('0x48')]){_0x79f6f7[_0x4913('0x48')]-=0x1;}}_0x79f6f7[_0x4913('0x4b')]+=0x1;_0x4fcdb8(_0x79f6f7);});}exports[_0x4913('0x4f')]=function(_0xe0538f,_0x113a0a){var _0x525c7a={},_0x2c20d4={},_0x4526f0={'count':0x0,'rows':[]};var _0x51b03=_['map'](db[_0x4913('0x50')]['rawAttributes'],function(_0x40afc3){return{'name':_0x40afc3[_0x4913('0x51')],'type':_0x40afc3[_0x4913('0x52')][_0x4913('0x53')]};});_0x2c20d4[_0x4913('0x54')]=_[_0x4913('0x40')](_0x51b03,_0x4913('0x3a'));_0x2c20d4[_0x4913('0x55')]=_[_0x4913('0x56')](_0xe0538f[_0x4913('0x55')]);_0x2c20d4[_0x4913('0x57')]=_[_0x4913('0x58')](_0x2c20d4[_0x4913('0x54')],_0x2c20d4[_0x4913('0x55')]);_0x525c7a[_0x4913('0x59')]=_[_0x4913('0x58')](_0x2c20d4[_0x4913('0x54')],qs[_0x4913('0x5a')](_0xe0538f[_0x4913('0x55')][_0x4913('0x5a')]));_0x525c7a[_0x4913('0x59')]=_0x525c7a[_0x4913('0x59')][_0x4913('0x5b')]?_0x525c7a[_0x4913('0x59')]:_0x2c20d4[_0x4913('0x54')];if(!_0xe0538f['query'][_0x4913('0x5c')](_0x4913('0x5d'))){_0x525c7a[_0x4913('0x32')]=qs[_0x4913('0x32')](_0xe0538f['query'][_0x4913('0x32')]);_0x525c7a[_0x4913('0x30')]=qs['offset'](_0xe0538f[_0x4913('0x55')][_0x4913('0x30')]);}_0x525c7a[_0x4913('0x5e')]=qs[_0x4913('0x5f')](_0xe0538f[_0x4913('0x55')][_0x4913('0x5f')]);_0x525c7a[_0x4913('0x60')]=qs['filters'](_[_0x4913('0x61')](_0xe0538f[_0x4913('0x55')],_0x2c20d4[_0x4913('0x57')]),_0x51b03);var _0x174f4a=[];var _0x542226=squel['select']()[_0x4913('0x62')]('id')[_0x4913('0x62')]('name')[_0x4913('0x62')](_0x4913('0x63'))[_0x4913('0x64')](_0x4913('0x65'));var _0x4ff863=squel[_0x4913('0x66')]()[_0x4913('0x62')](_0x4913('0x67'))[_0x4913('0x62')](_0x4913('0x68'))[_0x4913('0x62')]('ui.ChatInteractionId')[_0x4913('0x64')](_0x4913('0x69'),'ui')[_0x4913('0x6a')](_0x4913('0x6b'),'u',_0x4913('0x6c'));var _0x52032f=squel[_0x4913('0x66')]()[_0x4913('0x64')](_0x4913('0x6d'),'i')[_0x4913('0x6a')]('cm_contacts','c',_0x4913('0x6e'))['left_join'](_0x4913('0x6b'),'o',_0x4913('0x6f'))[_0x4913('0x6a')]('chat_websites','a',_0x4913('0x70'))['left_join']('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x4913('0x6a')]('chat_interaction_has_tags','it',_0x4913('0x71'))[_0x4913('0x6a')](_0x4913('0x65'),'t',_0x4913('0x72'));var _0x2d1bb7=squel[_0x4913('0x73')]();var _0xd1a2fb=[];var _0x241292=squel[_0x4913('0x73')]();var _0x393a28;if(_0xe0538f['query'][_0x4913('0x74')]){_0x393a28=as[_0x4913('0x75')](_0xe0538f['query']['search']);var _0xc12de5=_0x393a28[_0x4913('0x76')];for(var _0x42b5cd=0x0;_0x42b5cd<_0x393a28[_0x4913('0x77')][_0x4913('0x5b')];_0x42b5cd++){var _0x162932=_0x393a28[_0x4913('0x77')][_0x42b5cd];var _0x2b6ee2='i';var _0x67a070=_[_0x4913('0x78')](_0x51b03,['name',_0x162932[_0x4913('0x62')]]);if(!_0x67a070){switch(_0x162932[_0x4913('0x62')]){case'unreadMessages':if(_0x162932[_0x4913('0x79')]==0x1){_0x52032f[_0x4913('0x7a')]('`'+_0x162932[_0x4913('0x62')]+_0x4913('0x7b'));}else{_0x52032f[_0x4913('0x7a')]('`'+_0x162932['field']+_0x4913('0x7c'));}break;case'Contact':if(_0x162932[_0x4913('0x7d')]==='$substring'){if(_0x162932[_0x4913('0x79')][_0x4913('0x44')]('\x20')[_0x4913('0x5b')]>0x1){_0x2d1bb7[_0xc12de5](_0x4913('0x7e'),qs['getFullTextValue'](_0x162932['value']),null);}else{var _0x11c4a7='%'+_0x162932[_0x4913('0x79')]+'%';_0x2d1bb7[_0xc12de5](_0x4913('0x7f'),_0x11c4a7,_0x11c4a7,_0x11c4a7);}}else{_0x67a070=_[_0x4913('0x78')](_0x51b03,[_0x4913('0x3a'),'ContactId']);_0x162932[_0x4913('0x62')]=_0x4913('0x80');_0x344324=as[_0x4913('0x81')](_0x2b6ee2,_0x67a070[_0x4913('0x52')],_0x162932);_0x2d1bb7[_0xc12de5](_0x344324[_0x4913('0x82')],_0x344324[_0x4913('0x79')][_0x4913('0x83')],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);}break;case _0x4913('0x84'):var _0x770ac0=_0x162932[_0x4913('0x79')][_0x4913('0x44')](',')[_0x4913('0x40')](function(_0x37c793){return Number(_0x37c793);});_0x770ac0[_0x4913('0x45')](function(_0x2f842d){_0x241292['or'](_0x4913('0x85'),'%,'+_0x2f842d+',%');});_0xd1a2fb=_[_0x4913('0x86')](_0xd1a2fb,_0x770ac0);break;case _0x4913('0x87'):if(_0x162932[_0x4913('0x7d')]===_0x4913('0x88')){_0x2d1bb7[_0xc12de5](_0x4913('0x89'),'%'+_0x162932[_0x4913('0x79')]+'%',null);}else{_0x67a070=_[_0x4913('0x78')](_0x51b03,['name',_0x4913('0x4d')]);_0x162932['field']=_0x4913('0x4d');_0x344324=as['buildExpression'](_0x2b6ee2,_0x67a070[_0x4913('0x52')],_0x162932);_0x2d1bb7[_0xc12de5](_0x344324[_0x4913('0x82')],_0x344324[_0x4913('0x79')]['start'],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);}break;case _0x4913('0x8a'):_0x344324=as[_0x4913('0x81')]('me',null,_0x162932);_0x2d1bb7[_0xc12de5](_0x344324[_0x4913('0x82')],_0x344324[_0x4913('0x79')][_0x4913('0x83')],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);break;}}else{var _0x344324=as[_0x4913('0x81')](_0x2b6ee2,_0x67a070[_0x4913('0x52')],_0x162932);_0x2d1bb7[_0xc12de5](_0x344324['text'],_0x344324[_0x4913('0x79')][_0x4913('0x83')],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);}}}else{var _0x2cc70f=_(_0xe0538f[_0x4913('0x55')])['keys']()['map'](function(_0x17f7ab){return _[_0x4913('0x8b')](_0x51b03,[_0x4913('0x3a'),_0x17f7ab])?_0x17f7ab:undefined;})['compact']()[_0x4913('0x79')]();if(!_['isEmpty'](_0x2cc70f)){_0x2cc70f['forEach'](function(_0x419449){if(_0x419449==='ChatWebsiteId'){_0x52032f[_0x4913('0x60')](_0x4913('0x8c'),[]['concat'](_0xe0538f[_0x4913('0x55')][_0x419449]));}else if(_0x419449===_0x4913('0x8d')){var _0x572d65=JSON[_0x4913('0x8e')](_0xe0538f[_0x4913('0x55')][_0x419449])[_0x4913('0x8f')];var _0x448754=JSON[_0x4913('0x8e')](_0xe0538f[_0x4913('0x55')][_0x419449])[_0x4913('0x90')];_0x52032f[_0x4913('0x60')](_0x4913('0x91'),_0x572d65,_0x448754);}else{if(_0xe0538f[_0x4913('0x55')][_0x419449]===_0x4913('0x92')){_0x52032f['where']('i.'+_0x419449+_0x4913('0x93'));}else{_0x52032f['where']('i.'+_0x419449+_0x4913('0x94'),_0xe0538f[_0x4913('0x55')][_0x419449]);}}});}if(_0xe0538f[_0x4913('0x55')][_0x4913('0x95')]){if(_0xe0538f[_0x4913('0x55')][_0x4913('0x95')]==0x1){_0x52032f[_0x4913('0x7a')](_0x4913('0x96'));}else{_0x52032f[_0x4913('0x7a')]('`unreadMessages`\x20>\x200');}}if(_0xe0538f[_0x4913('0x55')][_0x4913('0x97')]){_0xd1a2fb=_[_0x4913('0x98')](_0xe0538f[_0x4913('0x55')][_0x4913('0x97')])?_0xe0538f['query'][_0x4913('0x97')]:new Array(_0xe0538f[_0x4913('0x55')]['tag']);_0xd1a2fb[_0x4913('0x45')](function(_0x1cb5a3){_0x241292['or'](_0x4913('0x85'),'%,'+_0x1cb5a3+',%');});}if(_0xe0538f[_0x4913('0x55')][_0x4913('0x99')]){var _0x1216b1=_0xe0538f[_0x4913('0x55')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1216b1)){_0x2d1bb7['or'](_0x4913('0x9a'),_0x1216b1+'%');}else{_0x2d1bb7['or'](_0x4913('0x9b'),qs[_0x4913('0x9c')](_0x1216b1))['or'](_0x4913('0x9d'),_0x1216b1+'%');}}}_0x52032f[_0x4913('0x60')](_0x2d1bb7);_0x52032f[_0x4913('0x9e')](_0x4913('0x9f'));var _0x3ae1ce={'type':db[_0x4913('0xa0')]['QueryTypes'][_0x4913('0xa1')],'raw':!![]};var _0x3e5ea0=_0x52032f[_0x4913('0xa2')]();_0x3e5ea0[_0x4913('0x62')](_0x4913('0x9f'));_0x3e5ea0[_0x4913('0x62')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4913('0xa3'));if(_0x525c7a[_0x4913('0x5e')]){_0x525c7a[_0x4913('0x5e')]['forEach'](function(_0x46f21f){var _0x3ba129=_0x46f21f[0x0]==='contactName'?_0x46f21f[0x0]:'i.'+_0x46f21f[0x0];_0x52032f['order'](_0x3ba129,_0x46f21f[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xd1a2fb)){_0x52032f[_0x4913('0x7a')](_0x241292);_0x3e5ea0[_0x4913('0x60')](_0x4913('0xa4'),_0xd1a2fb);}BPromise['resolve']()[_0x4913('0x37')](function(){if(!_0x393a28){if(_0xe0538f[_0x4913('0x55')][_0x4913('0xa5')])return;_0x3e5ea0['where'](_0x4913('0xa6'));_0x52032f[_0x4913('0x60')](_0x4913('0xa6'));return;}if(_0xe0538f['user'][_0x4913('0xa7')]!==_0x4913('0x3d'))return;return _0xe0538f[_0x4913('0xa8')][_0x4913('0xa9')]({'attributes':['id'],'raw':!![]})[_0x4913('0x37')](function(_0x2b309e){if(_['isEmpty'](_0x2b309e)){_0x3e5ea0[_0x4913('0x60')](_0x4913('0xaa'));_0x52032f['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3e5ea0['where'](_0x4913('0x8c'),_[_0x4913('0x40')](_0x2b309e,'id'));_0x52032f[_0x4913('0x60')](_0x4913('0x8c'),_[_0x4913('0x40')](_0x2b309e,'id'));}});})['then'](function(){if(_0xe0538f[_0x4913('0xa8')]['role']===_0x4913('0x3d')&&!_0x393a28&&!_0xe0538f[_0x4913('0x55')][_0x4913('0xa5')])return[];return db[_0x4913('0xab')][_0x4913('0x55')](_0x3e5ea0[_0x4913('0xac')](),_0x3ae1ce);})[_0x4913('0x37')](function(_0x4b4c69){_0x4526f0[_0x4913('0x33')]=_0x4b4c69[_0x4913('0x5b')];if(_0x4526f0['count']===0x0)return[];return db['sequelize']['query'](_0x542226[_0x4913('0xac')](),_0x3ae1ce)[_0x4913('0x37')](function(_0x42b719){_0x174f4a=_[_0x4913('0xad')](_0x42b719,'id');_0x3ae1ce=_[_0x4913('0x3c')](_0x3ae1ce,{'model':db[_0x4913('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe0538f['query'][_0x4913('0x5a')]){_0x525c7a[_0x4913('0x59')][_0x4913('0x45')](function(_0x21fc98){_0x52032f[_0x4913('0x62')]('i.'+_0x21fc98);});}else{_0x52032f[_0x4913('0x62')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4913('0xa3'));_0x52032f['field'](_0x4913('0xae'),_0x4913('0xaf'));_0x52032f[_0x4913('0x62')]('a.mandatoryDisposition',_0x4913('0xb0'));_0x52032f['field'](_0x4913('0xb1'),_0x4913('0xb2'));_0x52032f[_0x4913('0x62')](_0x4913('0xb3'));_0x52032f[_0x4913('0x62')]('c.firstName',_0x4913('0xb4'));_0x52032f[_0x4913('0x62')](_0x4913('0xb5'),_0x4913('0xb6'));_0x52032f[_0x4913('0x62')](_0x4913('0xb7'),_0x4913('0xb8'));_0x52032f[_0x4913('0x62')](_0x4913('0xb9'),'Contact.phone');_0x52032f[_0x4913('0x62')](_0x4913('0xba'),_0x4913('0xbb'));_0x52032f[_0x4913('0x62')]('c.fax','Contact.fax');_0x52032f[_0x4913('0x62')](_0x4913('0xbc'),'Owner.fullname');_0x52032f['field'](_0x4913('0xbd'),_0x4913('0xbe'));_0x52032f[_0x4913('0x62')](_0x4913('0xbf'),_0x4913('0x42'));}if(_0x525c7a[_0x4913('0x32')])_0x52032f[_0x4913('0x32')](_0x525c7a[_0x4913('0x32')]);if(_0x525c7a[_0x4913('0x30')])_0x52032f[_0x4913('0x30')](_0x525c7a[_0x4913('0x30')]);return db[_0x4913('0xab')][_0x4913('0x55')](_0x52032f[_0x4913('0xac')](),_0x3ae1ce);})[_0x4913('0x37')](function(_0x2a22cb){if(_0x2a22cb[_0x4913('0x5b')]>0x0)_0x4ff863[_0x4913('0x60')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x2a22cb,'id'));return db[_0x4913('0xab')][_0x4913('0x55')](_0x4ff863['toString'](),_0x3ae1ce)[_0x4913('0x37')](function(_0xd409a6){var _0x3b3c42=_[_0x4913('0xc0')](_0xd409a6,_0x4913('0xc1'));var _0x5a4cd7=[];_0x2a22cb[_0x4913('0x45')](function(_0x3fdc74){_0x5a4cd7[_0x4913('0xc2')](updateChatInteraction(_0x3fdc74,_0x174f4a,_0x3b3c42));});return BPromise[_0x4913('0xc3')](_0x5a4cd7);});});})['then'](function(_0x2345ea){_0x4526f0[_0x4913('0xc4')]=_0x2345ea;return _0x4526f0;})[_0x4913('0x37')](respondWithFilteredResult(_0x113a0a,_0x525c7a))['catch'](handleError(_0x113a0a,null));};exports['show']=function(_0x4dcc47,_0x5d277f){var _0x55aa={'raw':![],'where':{'id':_0x4dcc47[_0x4913('0xc5')]['id']}},_0x5a9f9a={};_0x5a9f9a[_0x4913('0x54')]=_[_0x4913('0x56')](db['ChatInteraction'][_0x4913('0xc6')]);_0x5a9f9a[_0x4913('0x55')]=_[_0x4913('0x56')](_0x4dcc47['query']);_0x5a9f9a['filters']=_['intersection'](_0x5a9f9a[_0x4913('0x54')],_0x5a9f9a[_0x4913('0x55')]);_0x55aa[_0x4913('0x59')]=_[_0x4913('0x58')](_0x5a9f9a[_0x4913('0x54')],qs[_0x4913('0x5a')](_0x4dcc47[_0x4913('0x55')][_0x4913('0x5a')]));_0x55aa[_0x4913('0x59')]=_0x55aa['attributes'][_0x4913('0x5b')]?_0x55aa[_0x4913('0x59')]:_0x5a9f9a['model'];if(_0x4dcc47[_0x4913('0x55')][_0x4913('0xc7')]){_0x55aa[_0x4913('0xc8')]=[{'all':!![]}];}_0x55aa=_['merge']({},_0x55aa,_0x4dcc47[_0x4913('0xc9')]);return db[_0x4913('0x50')][_0x4913('0x78')](_0x55aa)[_0x4913('0x37')](handleEntityNotFound(_0x5d277f,null))['then'](respondWithResult(_0x5d277f,null))[_0x4913('0x46')](handleError(_0x5d277f,null));};exports[_0x4913('0xca')]=function(_0x4e509b,_0x4abf13){return db[_0x4913('0x50')]['create'](_0x4e509b[_0x4913('0x8a')],{})[_0x4913('0x37')](respondWithResult(_0x4abf13,0xc9))['catch'](handleError(_0x4abf13,null));};exports[_0x4913('0xcb')]=function(_0x4c1b01,_0x4942ce){if(_0x4c1b01[_0x4913('0x8a')]['id']){delete _0x4c1b01[_0x4913('0x8a')]['id'];}return db['ChatInteraction'][_0x4913('0x78')]({'where':{'id':_0x4c1b01[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x4942ce,null))[_0x4913('0x37')](saveUpdates(_0x4c1b01['body'],null))['then'](respondWithResult(_0x4942ce,null))[_0x4913('0x46')](handleError(_0x4942ce,null));};exports['destroy']=function(_0xd48421,_0x101732){return db['ChatInteraction'][_0x4913('0x78')]({'where':{'id':_0xd48421[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x101732,null))[_0x4913('0x37')](removeEntity(_0x101732,null))[_0x4913('0x46')](handleError(_0x101732,null));};exports[_0x4913('0xcc')]=function(_0x28a72c,_0x189d11){return db[_0x4913('0x50')][_0x4913('0xcc')]()[_0x4913('0x37')](respondWithResult(_0x189d11,null))[_0x4913('0x46')](handleError(_0x189d11,null));};exports[_0x4913('0xcd')]=function(_0x1ec59e,_0x54a314){var _0x421a81=_0x1ec59e['params']['id'];var _0xd8f459;var _0x7d803a;var _0x30a777;return db[_0x4913('0x50')][_0x4913('0xce')]({'where':{'id':_0x421a81}})[_0x4913('0x37')](function(_0x2bef62){_0xd8f459=_0x2bef62;return db[_0x4913('0xcf')][_0x4913('0xce')]({'where':{'id':_0x2bef62['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x4913('0xd0'),_0x4913('0xd1'),'vidaooNote',_0x4913('0xd2')],'raw':!![]});})['then'](function(_0x2d6bf4){if(_0x2d6bf4&&_0x2d6bf4[_0x4913('0xd3')]&&_0x2d6bf4['vidaooEscalation']){_0x7d803a=_0x2d6bf4;var _0x1d839d={'interaction':{'id':_0x421a81},'agent':{'id':_0x1ec59e['user']['id'],'name':_0x1ec59e['user'][_0x4913('0x3a')],'fullname':_0x1ec59e[_0x4913('0xa8')][_0x4913('0x41')],'email':_0x1ec59e['user']['email']},'contact':_0x1ec59e['body'][_0x4913('0xd4')],'account':_0x1ec59e[_0x4913('0x8a')][_0x4913('0x3e')]};var _0x40b097={'rejectUnauthorized':![],'method':_0x4913('0xd5'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2d6bf4[_0x4913('0xd3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ec59e['user']['email']],'buttons':null,'topic':_0x7d803a[_0x4913('0xd1')],'note':_[_0x4913('0xd6')](_0x7d803a[_0x4913('0xd7')])?null:getMustacheRender(_0x7d803a[_0x4913('0xd7')],_0x1d839d),'metadata':null},'redirect':_0x4913('0xd8'),'json':!![]};try{if(!_[_0x4913('0xd6')](_0x7d803a[_0x4913('0xd2')])){var _0x540f3e=getMustacheRender(_0x7d803a[_0x4913('0xd2')],_0x1d839d);var _0x4612af=JSON[_0x4913('0x8e')](_0x540f3e);_0x40b097[_0x4913('0x8a')]['metadata']=_0x4612af;}}catch(_0x2250ee){throw new db[(_0x4913('0xa0'))][(_0x4913('0xd9'))](_0x4913('0xda'));}return rp(_0x40b097);}else{throw new db['Sequelize']['ValidationError'](_0x4913('0xdb'));}})[_0x4913('0x37')](function(_0x33587a){_0x30a777=_0x33587a;if(_0x30a777['id']){var _0x1b3cf5={'body':_0x30a777[_0x4913('0xdc')],'ChatWebsiteId':_0x7d803a['id'],'ChatInteractionId':_0xd8f459['id'],'direction':_0x4913('0xdd'),'UserId':_0x1ec59e[_0x4913('0xa8')]['id']};return db[_0x4913('0xde')][_0x4913('0xca')](_0x1b3cf5,{});}else{throw new db['Sequelize'][(_0x4913('0xd9'))](_0x4913('0xdf'));}})['then'](function(){return _0xd8f459[_0x4913('0xe0')]({'vidaooSessionId':_0x30a777['id']});})['then'](respondWithResult(_0x54a314,null))['catch'](handleError(_0x54a314,null));};exports[_0x4913('0xe1')]=function(_0x3706e7,_0x246226){if(_0x3706e7[_0x4913('0x8a')]['id']){delete _0x3706e7[_0x4913('0x8a')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3706e7[_0x4913('0xc5')]['id']},'include':[{'model':db['CmContact'],'as':_0x4913('0xe2')}]})['then'](handleEntityNotFound(_0x246226,null))[_0x4913('0x37')](saveUpdates(_0x3706e7[_0x4913('0x8a')],null))[_0x4913('0x37')](respondWithResult(_0x246226,null))['catch'](handleError(_0x246226,null));};exports['abandon']=function(_0x4284d8,_0x4fdbb9,_0x13fd9a){if(_0x4284d8[_0x4913('0x8a')]['id']){delete _0x4284d8[_0x4913('0x8a')]['id'];}return db['ChatInteraction'][_0x4913('0x78')]({'where':{'id':_0x4284d8[_0x4913('0xc5')]['id']}})['then'](function(_0x4d329c){if(!_0x4d329c){logger[_0x4913('0x29')](_0x4913('0xe3'),'abandon',0x194,_0x4913('0xe4'));_0x4fdbb9[_0x4913('0x38')](0x194);}else{if(_0x4d329c[_0x4913('0x4d')]){throw new db['Sequelize'][(_0x4913('0xd9'))](_0x4913('0xe5'));}}return _0x4d329c;})[_0x4913('0x37')](function(_0x5b7c16){if(_0x5b7c16){return _0x5b7c16['update']({'closed':_0x4284d8[_0x4913('0x8a')][_0x4913('0x4c')],'disposition':_0x4284d8[_0x4913('0x8a')]['disposition']})[_0x4913('0x37')](function(_0x5aed53){return _0x5aed53;});}})['then'](function(_0x5a3ea8){return respondWithRpcPromise(_0x4913('0xe6'),_0x4913('0xe7'),_0x4284d8[_0x4913('0x8a')],client9004);})[_0x4913('0x37')](respondWithResult(_0x4fdbb9,null))[_0x4913('0x46')](handleError(_0x4fdbb9,null));};exports['attachmentUpload']=function(_0x3c95a7,_0x1f2ac7,_0x345507){_0x3c95a7[_0x4913('0x8a')][_0x4913('0x3a')]=_0x3c95a7[_0x4913('0xe8')][_0x4913('0xe9')];_0x3c95a7['body']['basename']=_0x3c95a7[_0x4913('0xe8')]['filename'];_0x3c95a7[_0x4913('0x8a')][_0x4913('0x52')]=_0x3c95a7['file'][_0x4913('0xea')];return db[_0x4913('0xeb')][_0x4913('0xca')](_0x3c95a7[_0x4913('0x8a')])['then'](respondWithResult(_0x1f2ac7,0xc9))[_0x4913('0x46')](handleError(_0x1f2ac7,null));};exports[_0x4913('0xec')]=function(_0x5ef5c9,_0x567f38,_0x37a067){return db[_0x4913('0x50')][_0x4913('0xce')]({'where':{'id':_0x5ef5c9[_0x4913('0xc5')]['id']},'raw':!![]})[_0x4913('0x37')](handleEntityNotFound(_0x567f38,null))[_0x4913('0x37')](function(_0xcc799c){if(_0xcc799c){if(_0xcc799c[_0x4913('0x4c')]){return _0x567f38[_0x4913('0x2d')](0x193)[_0x4913('0x2f')]({'status':0x193,'message':_0x4913('0xed')});}return db[_0x4913('0xeb')]['findOne']({'where':{'id':_0x5ef5c9[_0x4913('0x55')][_0x4913('0xee')]},'raw':!![]})['then'](handleEntityNotFound(_0x567f38,null));}})[_0x4913('0x37')](function(_0xd21764){if(_0xd21764){var _0x2d99f5=_0xd21764[_0x4913('0xef')]!==null;var _0x73f110=path['join'](config[_0x4913('0xf0')],'server/files/attachments/');if(_0x2d99f5){_0x73f110=path['join'](_0x73f110,_0x4913('0xf1'));}var _0x59226d=path['join'](_0x73f110,_0xd21764['basename']);return _0x567f38['download'](_0x59226d);}})[_0x4913('0x46')](handleError(_0x567f38,null));};exports[_0x4913('0xf2')]=function(_0x32ccd1,_0x14581d){var _0x10ec32=null;var _0x385972=null;var _0xe0ea68=null;var _0x71f5fd=null;if(_0x32ccd1[_0x4913('0x8a')]['id']){delete _0x32ccd1['body']['id'];}if(_0x32ccd1['body'][_0x4913('0xf3')]){_0x71f5fd=path[_0x4913('0xf4')](config['root'],_0x4913('0xf5'),util['format'](_0x4913('0xf6'),Date[_0x4913('0xf7')]()));_0x32ccd1['body'][_0x4913('0xf8')]=_0x71f5fd;}return db[_0x4913('0x50')]['find']({'where':{'id':_0x32ccd1[_0x4913('0xc5')]['id']},'include':[{'model':db[_0x4913('0xde')],'as':_0x4913('0xf9'),'include':[{'model':db[_0x4913('0x87')],'as':_0x4913('0x87')}]}]})['then'](handleEntityNotFound(_0x14581d,null))['then'](saveUpdates(_0x32ccd1[_0x4913('0x8a')],null))[_0x4913('0x37')](function(_0x15aca2){if(_0x15aca2){_0x10ec32=_0x15aca2;return db[_0x4913('0xcf')]['find']({'where':{'id':_0x10ec32[_0x4913('0xa5')]}});}})[_0x4913('0x37')](function(_0x496b91){if(_0x496b91){_0xe0ea68=_0x496b91;return db[_0x4913('0xfa')]['find']({'where':{'id':_0x10ec32[_0x4913('0x80')]}});}})[_0x4913('0x37')](function(_0x42ee00){if(_0x42ee00){_0x385972=_0x42ee00;if(_0x71f5fd){var _0x36b7fa=null;for(var _0x14436e=0x1;_0x14436e<_0x10ec32[_0x4913('0xf9')][_0x4913('0x5b')];++_0x14436e){_0x36b7fa=_0x10ec32[_0x4913('0xf9')][_0x14436e];var _0x298ca0=_0x36b7fa['UserId']?util[_0x4913('0xfb')](_0x4913('0xfc'),_0xe0ea68[_0x4913('0xfd')],_0x36b7fa[_0x4913('0x4d')]):_0x4913('0xfe');var _0x5f00bf=_0x32ccd1[_0x4913('0x8a')][_0x4913('0xff')]||util[_0x4913('0xfb')]('%s%d',_0x4913('0x100'),_0x36b7fa[_0x4913('0x80')]);switch(_0xe0ea68['agentIdentifier']){case _0x4913('0x101'):_0x298ca0=_0x36b7fa['UserId']?util[_0x4913('0xfb')](_0x4913('0xfc'),_0xe0ea68[_0x4913('0xfd')],_0x36b7fa[_0x4913('0x4d')]):_0x4913('0xfe');break;case'agent_alias':_0x298ca0=_0x36b7fa[_0x4913('0x4d')]?_0x36b7fa[_0x4913('0x87')][_0x4913('0x102')]||_0x36b7fa[_0x4913('0x87')]['fullname']:_0x4913('0xfe');break;case'agent_fullname':_0x298ca0=_0x36b7fa['UserId']?_0x36b7fa['User']['fullname']:_0x4913('0xfe');break;default:_0x298ca0=_0x36b7fa[_0x4913('0x4d')]?util['format'](_0x4913('0xfc'),_0xe0ea68['agentAlias'],_0x36b7fa[_0x4913('0x4d')]):_0x4913('0xfe');}var _0x4c70a7=util[_0x4913('0xfb')](_0x4913('0x103'),moment(_0x36b7fa[_0x4913('0x8d')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x36b7fa[_0x4913('0x104')]==='in'?_0x5f00bf:_0x298ca0,_0x36b7fa[_0x4913('0x8a')]);if(!_0x36b7fa['secret']){fs[_0x4913('0x105')](_0x71f5fd,_0x4c70a7);}}return db[_0x4913('0x106')][_0x4913('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x4913('0x107')],'as':'Smtp','raw':!![]}]});}}})[_0x4913('0x37')](function(_0xc2898b){if(_0xc2898b&&_0xc2898b[_0x4913('0x108')]&&_0x32ccd1[_0x4913('0x8a')]){var _0xf8676={'tls':{'rejectUnauthorized':![]}};if(_0xc2898b[_0x4913('0x108')][_0x4913('0x109')]){_0xf8676['service']=_0xc2898b['Smtp'][_0x4913('0x109')];}else{_0xf8676['host']=_0xc2898b[_0x4913('0x108')]['host'];_0xf8676[_0x4913('0x10a')]=_0xc2898b[_0x4913('0x108')]['port'];_0xf8676['secure']=_0xc2898b['Smtp'][_0x4913('0x10b')];}if(_0xc2898b[_0x4913('0x108')][_0x4913('0x10c')]){_0xf8676[_0x4913('0x10d')]={'user':_0xc2898b[_0x4913('0x108')][_0x4913('0xa8')],'pass':_0xc2898b['Smtp'][_0x4913('0x10e')]};}return respondWithRpcPromise(_0x4913('0x10f'),_0x4913('0x110'),{'account':_0xf8676,'message':{'from':util['format'](_0x4913('0x111'),_0xc2898b[_0x4913('0x3a')],_0xc2898b[_0x4913('0x112')]||_0xc2898b['Smtp']['user']),'to':_0x32ccd1[_0x4913('0x8a')][_0x4913('0xf3')],'subject':_0x4913('0x113'),'text':util[_0x4913('0xfb')](_0x4913('0x114'),_0x32ccd1[_0x4913('0x8a')]['mailTranscript']),'attachments':[{'path':_0x71f5fd}]}})[_0x4913('0x37')](function(){return _0x10ec32;})[_0x4913('0x46')](function(_0x47f51f){console[_0x4913('0x29')](_0x47f51f);});}else{return _0x10ec32;}})[_0x4913('0x37')](respondWithStatusCode(_0x14581d,0xc8))[_0x4913('0x46')](handleError(_0x14581d,null));};exports[_0x4913('0x115')]=function(_0x63f2e9,_0x1844bc,_0x499252){return db[_0x4913('0xde')][_0x4913('0x78')]({'where':{'id':_0x63f2e9[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x1844bc,null))[_0x4913('0x37')](function(_0x52b70e){if(_0x52b70e){return _0x52b70e[_0x4913('0x115')](_0x63f2e9[_0x4913('0x8a')][_0x4913('0x116')],_['omit'](_0x63f2e9[_0x4913('0x8a')],[_0x4913('0x116'),'id'])||{});}})[_0x4913('0x37')](respondWithResult(_0x1844bc,null))[_0x4913('0x46')](handleError(_0x1844bc,null));};exports['getMessages']=function(_0x338885,_0x58f957,_0xce57e){var _0x1479d2={'raw':![],'where':{}};var _0x17f31d={};var _0x1acf8a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4913('0xce')]({'where':{'id':_0x338885[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x58f957,null))[_0x4913('0x37')](function(_0x26ac42){if(_0x26ac42){_0x17f31d[_0x4913('0x54')]=_[_0x4913('0x56')](db[_0x4913('0xde')][_0x4913('0xc6')]);_0x17f31d[_0x4913('0x55')]=_[_0x4913('0x56')](_0x338885[_0x4913('0x55')]);_0x17f31d[_0x4913('0x57')]=_[_0x4913('0x58')](_0x17f31d['model'],_0x17f31d[_0x4913('0x55')]);_0x1479d2[_0x4913('0x59')]=_[_0x4913('0x58')](_0x17f31d['model'],qs[_0x4913('0x5a')](_0x338885[_0x4913('0x55')][_0x4913('0x5a')]));_0x1479d2[_0x4913('0x59')]=_0x1479d2[_0x4913('0x59')][_0x4913('0x5b')]?_0x1479d2[_0x4913('0x59')]:_0x17f31d[_0x4913('0x54')];if(!_0x338885[_0x4913('0x55')][_0x4913('0x5c')](_0x4913('0x5d'))){_0x1479d2[_0x4913('0x32')]=qs[_0x4913('0x32')](_0x338885[_0x4913('0x55')][_0x4913('0x32')]);_0x1479d2[_0x4913('0x30')]=qs[_0x4913('0x30')](_0x338885[_0x4913('0x55')]['offset']);}_0x1479d2['order']=qs['sort'](_0x338885[_0x4913('0x55')]['sort']);_0x1479d2['where']=qs[_0x4913('0x57')](_[_0x4913('0x61')](_0x338885['query'],_0x17f31d['filters']));_0x1479d2[_0x4913('0x60')][_0x4913('0xc1')]=_0x26ac42['id'];if(_0x338885[_0x4913('0x55')][_0x4913('0x99')]){_0x1479d2[_0x4913('0x60')]=_[_0x4913('0x3c')](_0x1479d2[_0x4913('0x60')],{'$or':_[_0x4913('0x40')](_0x1479d2[_0x4913('0x59')],function(_0x1f082a){var _0x16d7b6={};_0x16d7b6[_0x1f082a]={'$like':'%'+_0x338885[_0x4913('0x55')][_0x4913('0x99')]+'%'};return _0x16d7b6;})});}if(_0x338885[_0x4913('0x55')][_0x4913('0x8f')]){var _0xc8bf57=_0x338885['query'][_0x4913('0x8f')][_0x4913('0x44')](',');var _0x5c3e27={};_0x5c3e27[_0xc8bf57[0x0]]={'$gte':moment(_0xc8bf57[0x1])[_0x4913('0xfb')](_0x4913('0x117'))};_0x1479d2[_0x4913('0x60')]=_[_0x4913('0x3c')](_0x1479d2[_0x4913('0x60')],_0x5c3e27);}_0x1479d2=_[_0x4913('0x3c')]({},_0x1479d2,_0x338885[_0x4913('0xc9')]);return db[_0x4913('0xde')][_0x4913('0x33')]({'where':_0x1479d2[_0x4913('0x60')]})[_0x4913('0x37')](function(_0xba6218){_0x1acf8a[_0x4913('0x33')]=_0xba6218;if(_0x338885[_0x4913('0x55')]['includeAll']){_0x1479d2[_0x4913('0xc8')]=[{'all':!![]}];}return db[_0x4913('0xde')]['findAll'](_0x1479d2);})[_0x4913('0x37')](function(_0x5a6542){_0x1acf8a[_0x4913('0xc4')]=_0x5a6542;return _0x1acf8a;});}})[_0x4913('0x37')](respondWithFilteredResult(_0x58f957,_0x1479d2))['catch'](handleError(_0x58f957,null));};exports[_0x4913('0x118')]=function(_0x30c5fb,_0x4f0fb0,_0x372e6f){var _0x599721={'where':{}},_0x42fd66={},_0x29920={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4913('0xce')]({'where':{'id':_0x30c5fb[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x4f0fb0,null))['then'](function(_0x28e9a6){if(_0x28e9a6){_0x42fd66[_0x4913('0x54')]=_['keys'](db[_0x4913('0xde')][_0x4913('0xc6')]);_0x42fd66[_0x4913('0x55')]=_[_0x4913('0x56')](_0x30c5fb[_0x4913('0x55')]);_0x42fd66['filters']=_[_0x4913('0x58')](_0x42fd66['model'],_0x42fd66['query']);_0x599721[_0x4913('0x59')]=_['intersection'](_0x42fd66[_0x4913('0x54')],qs[_0x4913('0x5a')](_0x30c5fb[_0x4913('0x55')][_0x4913('0x5a')]));_0x599721[_0x4913('0x59')]=_0x599721[_0x4913('0x59')][_0x4913('0x5b')]?_0x599721[_0x4913('0x59')]:_0x42fd66['model'];if(!_0x30c5fb[_0x4913('0x55')][_0x4913('0x5c')](_0x4913('0x5d'))){_0x599721[_0x4913('0x32')]=qs['limit'](_0x30c5fb[_0x4913('0x55')]['limit']);_0x599721[_0x4913('0x30')]=qs['offset'](_0x30c5fb[_0x4913('0x55')]['offset']);}_0x599721['order']=qs[_0x4913('0x5f')](_0x30c5fb[_0x4913('0x55')][_0x4913('0x5f')]);_0x599721[_0x4913('0x60')]=qs[_0x4913('0x57')](_[_0x4913('0x61')](_0x30c5fb['query'],_0x42fd66[_0x4913('0x57')]));_0x599721['where']['ChatInteractionId']=_0x28e9a6['id'];if(_0x30c5fb[_0x4913('0x55')][_0x4913('0x99')]){_0x599721[_0x4913('0x60')]=_[_0x4913('0x3c')](_0x599721[_0x4913('0x60')],{'$or':_['map'](_0x599721['attributes'],function(_0x34a444){var _0x1e855c={};_0x1e855c[_0x34a444]={'$like':'%'+_0x30c5fb[_0x4913('0x55')]['filter']+'%'};return _0x1e855c;})});}_0x599721[_0x4913('0x60')][_0x4913('0x119')]=![];if(_0x30c5fb['query']['id']){_0x599721[_0x4913('0x60')]['id']={'$gt':_0x30c5fb['query']['id']};}_0x599721=_[_0x4913('0x3c')]({},_0x599721,_0x30c5fb[_0x4913('0xc9')]);return db['ChatMessage'][_0x4913('0x33')]({'where':_0x599721[_0x4913('0x60')]})[_0x4913('0x37')](function(_0x18399c){_0x29920[_0x4913('0x33')]=_0x18399c;_0x599721[_0x4913('0xc8')]=[];if(_0x30c5fb['query']['includeAgent']){_0x599721[_0x4913('0xc8')][_0x4913('0xc2')]({'model':db[_0x4913('0x87')],'as':_0x4913('0x87'),'attributes':['id',_0x4913('0x41'),'alias']});}if(_0x30c5fb[_0x4913('0x55')][_0x4913('0xc7')]){_0x599721[_0x4913('0xc8')]=[{'all':!![]}];}return db[_0x4913('0xde')][_0x4913('0x11a')](_0x599721);})[_0x4913('0x37')](function(_0xaa71b0){_0x29920[_0x4913('0xc4')]=_0xaa71b0;return _0x29920;});}})[_0x4913('0x37')](respondWithFilteredResult(_0x4f0fb0,_0x599721))['catch'](handleError(_0x4f0fb0,null));};exports[_0x4913('0x11b')]=function(_0x59b430,_0x47b483,_0x264fcc){return db[_0x4913('0x50')][_0x4913('0x78')]({'where':{'id':_0x59b430['params']['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x47b483,null))[_0x4913('0x37')](function(_0x246d80){if(_0x246d80){return _0x246d80[_0x4913('0x11c')](_0x59b430[_0x4913('0x8a')][_0x4913('0x116')],_['omit'](_0x59b430[_0x4913('0x8a')],['ids','id'])||{})[_0x4913('0x11d')](function(){return db['Tag'][_0x4913('0x11a')]({'attributes':['id',_0x4913('0x3a'),_0x4913('0x63')],'where':{'id':_0x59b430[_0x4913('0x8a')][_0x4913('0x116')]}});})['then'](function(_0x5a9659){socket[_0x4913('0x11e')]('chatInteractionTags:save',{'id':Number(_0x59b430[_0x4913('0xc5')]['id']),'tags':_0x5a9659||[]});return{'id':Number(_0x59b430['params']['id']),'tags':_0x5a9659||[]};});}})[_0x4913('0x37')](respondWithResult(_0x47b483,null))['catch'](handleError(_0x47b483,null));};exports[_0x4913('0x11f')]=function(_0x3b7881,_0x5b541c,_0x35ec7a){return db[_0x4913('0x50')][_0x4913('0x78')]({'where':{'id':_0x3b7881[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x5b541c,null))[_0x4913('0x37')](function(_0x49a556){if(_0x49a556){return _0x49a556['removeTags'](_0x3b7881[_0x4913('0x55')][_0x4913('0x116')]);}})[_0x4913('0x37')](respondWithStatusCode(_0x5b541c,null))[_0x4913('0x46')](handleError(_0x5b541c,null));};exports['download']=function(_0x558e18,_0x3c4d9d){var _0x3fac0f=moment()['unix']()[_0x4913('0xac')]();var _0xcf17a4=path[_0x4913('0xf4')](config[_0x4913('0xf0')],_0x4913('0x120'),_0x4913('0x121'),_0x4913('0x122'));var _0x52d7af=path[_0x4913('0xf4')](config['root'],'server','files',_0x4913('0x123'));var _0x1042f5=path[_0x4913('0xf4')](_0xcf17a4,_0x3fac0f);var _0x5d5600=util[_0x4913('0xfb')]('transcript-%d-%s.zip',_0x558e18['params']['id'],_0x3fac0f);var _0x190c93=path[_0x4913('0xf4')](_0xcf17a4,_0x5d5600);var _0x53d554=[];_0x53d554[_0x4913('0xc2')]({'model':db[_0x4913('0x87')],'as':_0x4913('0x87'),'attributes':['id',_0x4913('0x41')],'raw':!![]});_0x53d554[_0x4913('0xc2')]({'model':db[_0x4913('0xfa')],'as':_0x4913('0xe2'),'attributes':['id',_0x4913('0x124'),_0x4913('0x125')],'raw':!![]});if(_0x558e18['query']['attachments']){_0x53d554[_0x4913('0xc2')]({'model':db[_0x4913('0xeb')],'as':_0x4913('0xeb'),'raw':!![]});}var _0x2d44a4=[{'model':db[_0x4913('0xde')],'as':'Messages','attributes':['id',_0x4913('0x8a'),_0x4913('0x8d'),_0x4913('0x104'),_0x4913('0x119'),_0x4913('0x95')],'include':_0x53d554}];_0x2d44a4['push']({'model':db['ChatWebsite'],'as':_0x4913('0x126'),'attributes':['id',_0x4913('0x3a')]});_0x2d44a4['push']({'model':db[_0x4913('0x87')],'as':_0x4913('0x127'),'attributes':['id','fullname']});return db[_0x4913('0x50')][_0x4913('0x78')]({'where':{'id':_0x558e18[_0x4913('0xc5')]['id']},'include':_0x2d44a4})[_0x4913('0x37')](handleEntityNotFound(_0x3c4d9d,null))[_0x4913('0x37')](function(_0x428f39){if(_0x428f39){var _0x58168c=_0x428f39[_0x4913('0x128')]({'plain':!![]});fs[_0x4913('0x129')](_0x1042f5);var _0x18d7ad={'channel':_0x4913('0x12a'),'account':_0x58168c[_0x4913('0x126')][_0x4913('0x3a')],'agent':_0x58168c[_0x4913('0x127')]?_0x58168c[_0x4913('0x127')][_0x4913('0x41')]:_0x4913('0x12b'),'createdAt':moment(_0x58168c['createdAt'])[_0x4913('0xfb')](_0x4913('0x117'))[_0x4913('0xac')](),'closedAt':_0x58168c[_0x4913('0x4c')]?moment(_0x58168c['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4913('0xac')]():'','disposition':_0x58168c['disposition'],'chatInfo':{'browser':_0x58168c['browserName'],'os':_0x58168c[_0x4913('0x12c')],'referer':_0x58168c[_0x4913('0x12d')],'customerIp':_0x58168c[_0x4913('0x12e')],'customerPort':_0x58168c[_0x4913('0x12f')]?_0x58168c[_0x4913('0x12f')]:_0x4913('0x12b')},'messages':_(_0x58168c[_0x4913('0xf9')])['tail']()[_0x4913('0x99')]({'secret':![]})[_0x4913('0x40')](function(_0x4eae42){if(_0x4eae42[_0x4913('0xeb')]){var _0xdf8f8a=path[_0x4913('0xf4')](_0x52d7af,_0x4eae42[_0x4913('0xeb')][_0x4913('0x130')]);if(fs[_0x4913('0x131')](_0xdf8f8a)){fs[_0x4913('0x132')](_0xdf8f8a)[_0x4913('0x133')](fs[_0x4913('0x134')](path[_0x4913('0xf4')](_0x1042f5,_0x4eae42[_0x4913('0xeb')][_0x4913('0x130')])));}}return{'date':moment(_0x4eae42[_0x4913('0x8d')])[_0x4913('0xfb')](_0x4913('0x117'))[_0x4913('0xac')](),'sender':_0x4eae42[_0x4913('0x104')]===_0x4913('0xdd')?_0x4eae42[_0x4913('0x87')]?_0x4eae42[_0x4913('0x87')]['fullname']:_0x4913('0xfe'):_0x4eae42['Contact'][_0x4913('0x124')]+(_0x4eae42[_0x4913('0xe2')][_0x4913('0x125')]?'\x20'+_0x4eae42[_0x4913('0xe2')][_0x4913('0x125')]:''),'body':_0x4eae42['Attachment']?_0x4eae42[_0x4913('0xeb')]['basename']:_0x4eae42['body'],'direction':_0x4eae42[_0x4913('0x104')]===_0x4913('0xdd')?'A':'C','secret':_0x4eae42[_0x4913('0x119')],'read':_0x4eae42[_0x4913('0x95')],'attachment':_0x4eae42['Attachment']};})[_0x4913('0x79')]()};return ejs[_0x4913('0x135')](path[_0x4913('0xf4')](config[_0x4913('0xf0')],_0x4913('0x120'),_0x4913('0x136'),'downloadInteraction.ejs'),{'interaction':_0x18d7ad})[_0x4913('0x37')](function(_0x502246){var _0x386131=path[_0x4913('0xf4')](_0x1042f5,'transcript-'+_0x58168c['id']+'-'+_0x3fac0f+_0x4913('0x137'));var _0x3a519f={'path':_0x386131,'channel':_0x4913('0x12a'),'interactionId':_0x58168c['id']};return pdf[_0x4913('0x138')](_0x502246,_0x3a519f);})['then'](function(){return new BPromise(function(_0x35fa8a,_0x38f9df){zipdir(_0x1042f5,{'saveTo':_0x190c93},function(_0x2fab25,_0x5eb475){if(_0x2fab25)return _0x38f9df(_0x2fab25);return _0x35fa8a(_0x5eb475);});})[_0x4913('0x37')](function(){return new BPromise(function(_0xc09ed4,_0x48184c){rimraf(_0x1042f5,function(_0x1a4ec4){if(_0x1a4ec4)_0x48184c(_0x1a4ec4);return _0xc09ed4();});});})[_0x4913('0x37')](function(){return _0x3c4d9d[_0x4913('0x139')](_0x190c93,_0x5d5600,function(_0x10543d){if(_0x10543d){console['log'](_0x4913('0x13a'),_0x10543d);}else{fs[_0x4913('0x13b')](_0x190c93);}});});});}else{return _0x3c4d9d[_0x4913('0x38')](0xc8);}})['catch'](handleError(_0x3c4d9d,null));}; \ No newline at end of file +var _0x9980=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','sendStatus','stack','name','send','render','merge','body','contact','agent','account','fullname','TagIds','Tags','split','forEach','push','waiting','abandoned','total','closed','UserId','talking','disposition','answered','index','map','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','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','$substring','text','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','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','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','isNull','vidaooNote','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','AbandonInteraction','file','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','format','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','ids','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','addTags','setTags','omit','spread','color','emit','removeTags','unix','server','files','tmp','firstName','lastName','Account','Owner','get','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','pipe','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash'];(function(_0x54d8bc,_0x18e265){var _0x4bb5e4=function(_0x50ed03){while(--_0x50ed03){_0x54d8bc['push'](_0x54d8bc['shift']());}};_0x4bb5e4(++_0x18e265);}(_0x9980,0x125));var _0x0998=function(_0x552b9f,_0x544356){_0x552b9f=_0x552b9f-0x0;var _0x23ddef=_0x9980[_0x552b9f];return _0x23ddef;};'use strict';var emlformat=require(_0x0998('0x0'));var rimraf=require(_0x0998('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0998('0x2'));var rp=require(_0x0998('0x3'));var moment=require(_0x0998('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0998('0x5'));var path=require(_0x0998('0x6'));var sox=require(_0x0998('0x7'));var csv=require(_0x0998('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0998('0x9'));var squel=require(_0x0998('0xa'));var crypto=require(_0x0998('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0998('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0998('0xd'));var Papa=require(_0x0998('0xe'));var Redis=require(_0x0998('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0998('0x10'));var as=require(_0x0998('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0998('0x12'))(_0x0998('0x13'));var utils=require(_0x0998('0x14'));var config=require(_0x0998('0x15'));var licenseUtil=require(_0x0998('0x16'));var db=require(_0x0998('0x17'))['db'];config[_0x0998('0x18')]=_['defaults'](config[_0x0998('0x18')],{'host':_0x0998('0x19'),'port':0x18eb});var socket=require(_0x0998('0x1a'))(new Redis(config[_0x0998('0x18')]));require(_0x0998('0x1b'))['register'](socket);var jayson=require(_0x0998('0x1c'));var client=jayson[_0x0998('0x1d')]['http']({'port':0x232b});var client9004=jayson['client'][_0x0998('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x23c7ab,_0x3c5958,_0x57c28b,_0x2e6ea8){return new BPromise(function(_0x4329e0,_0xb97bfd){var _0x23b7d2=_0x2e6ea8||client;return _0x23b7d2['request'](_0x23c7ab,_0x57c28b)[_0x0998('0x1f')](function(_0x8f8832){logger['info'](_0x0998('0x20'),_0x3c5958,_0x0998('0x21'));logger[_0x0998('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3c5958,_0x0998('0x21'),JSON[_0x0998('0x23')](_0x8f8832));if(_0x8f8832[_0x0998('0x24')]){if(_0x8f8832[_0x0998('0x24')][_0x0998('0x25')]===0x1f4){logger['error'](_0x0998('0x20'),_0x3c5958,_0x8f8832[_0x0998('0x24')][_0x0998('0x26')]);return _0xb97bfd(_0x8f8832[_0x0998('0x24')][_0x0998('0x26')]);}logger[_0x0998('0x24')](_0x0998('0x20'),_0x3c5958,_0x8f8832['error'][_0x0998('0x26')]);return _0x4329e0(_0x8f8832[_0x0998('0x24')][_0x0998('0x26')]);}else{logger[_0x0998('0x27')](_0x0998('0x20'),_0x3c5958,'request\x20sent');_0x4329e0(_0x8f8832[_0x0998('0x28')][_0x0998('0x26')]);}})[_0x0998('0x29')](function(_0xaa3ac0){logger[_0x0998('0x24')](_0x0998('0x20'),_0x3c5958,_0xaa3ac0);_0xb97bfd(_0xaa3ac0);});});}function respondWithStatusCode(_0x5ae698,_0x2dee11){_0x2dee11=_0x2dee11||0xcc;return function(_0x5320ac){if(_0x5320ac){return _0x5ae698['sendStatus'](_0x2dee11);}return _0x5ae698[_0x0998('0x2a')](_0x2dee11)[_0x0998('0x2b')]();};}function respondWithResult(_0x14bef1,_0xa2e7fc){_0xa2e7fc=_0xa2e7fc||0xc8;return function(_0x15591e){if(_0x15591e){return _0x14bef1[_0x0998('0x2a')](_0xa2e7fc)[_0x0998('0x2c')](_0x15591e);}};}function respondWithFilteredResult(_0x2ece55,_0x5e207b){return function(_0x507d8e){if(_0x507d8e){var _0x10464a=typeof _0x5e207b[_0x0998('0x2d')]===_0x0998('0x2e')&&typeof _0x5e207b['limit']===_0x0998('0x2e');var _0x561897=_0x507d8e['count'];var _0x4eecbf=_0x10464a?0x0:_0x5e207b[_0x0998('0x2d')];var _0x2225d3=_0x10464a?_0x507d8e[_0x0998('0x2f')]:_0x5e207b[_0x0998('0x2d')]+_0x5e207b[_0x0998('0x30')];var _0x3b1f71;if(_0x2225d3>=_0x561897){_0x2225d3=_0x561897;_0x3b1f71=0xc8;}else{_0x3b1f71=0xce;}_0x2ece55[_0x0998('0x2a')](_0x3b1f71);return _0x2ece55['set']('Content-Range',_0x4eecbf+'-'+_0x2225d3+'/'+_0x561897)['json'](_0x507d8e);}return null;};}function patchUpdates(_0x424186){return function(_0x1ead2c){try{jsonpatch[_0x0998('0x31')](_0x1ead2c,_0x424186,!![]);}catch(_0x43e069){return BPromise[_0x0998('0x32')](_0x43e069);}return _0x1ead2c[_0x0998('0x33')]();};}function saveUpdates(_0x222c37,_0x2b5b52){return function(_0x68c5ef){if(_0x68c5ef){return _0x68c5ef[_0x0998('0x34')](_0x222c37)[_0x0998('0x1f')](function(_0x3f51e0){return _0x3f51e0;});}return null;};}function removeEntity(_0x349c21,_0x146b17){return function(_0x4ce0b9){if(_0x4ce0b9){return _0x4ce0b9[_0x0998('0x35')]()[_0x0998('0x1f')](function(){_0x349c21[_0x0998('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5d8f,_0x2b2232){return function(_0x167ade){if(!_0x167ade){_0x4b5d8f[_0x0998('0x36')](0x194);}return _0x167ade;};}function handleError(_0x422da2,_0xab90db){_0xab90db=_0xab90db||0x1f4;return function(_0x50afc7){logger['error'](_0x50afc7[_0x0998('0x37')]);if(_0x50afc7[_0x0998('0x38')]){delete _0x50afc7['name'];}_0x422da2['status'](_0xab90db)[_0x0998('0x39')](_0x50afc7);};}function getMustacheRender(_0x576111,_0x326cda){return Mustache[_0x0998('0x3a')](_0x576111,_[_0x0998('0x3b')](_0x326cda[_0x0998('0x3c')],{'contact':_0x326cda[_0x0998('0x3d')],'message':_0x326cda[_0x0998('0x26')],'agent':_0x326cda[_0x0998('0x3e')],'interaction':_0x326cda['interaction'],'account':_0x326cda[_0x0998('0x3f')]}))||'';}function getInteractionUsers(_0xbbfb3,_0x47d9f7){return new BPromise(function(_0x4ec41f,_0x17414e){try{if(_0x47d9f7[_0xbbfb3['id']]){_0xbbfb3['Users']=_['map'](_0x47d9f7[_0xbbfb3['id']],function(_0x1055e7){return{'id':_0x1055e7['id'],'fullname':_0x1055e7[_0x0998('0x40')]};});}}catch(_0x5ba3e6){_0x17414e(_0x5ba3e6);}_0x4ec41f(_0xbbfb3);});}function getInteractionTags(_0x20adc9,_0x1fb89a){return new BPromise(function(_0x1d4f68,_0x174419){try{if(_0x20adc9[_0x0998('0x41')]){_0x20adc9[_0x0998('0x42')]=[];_0x20adc9[_0x0998('0x41')][_0x0998('0x43')](',')[_0x0998('0x44')](function(_0x58349e){_0x20adc9[_0x0998('0x42')][_0x0998('0x45')](_0x1fb89a[_0x58349e]);});}delete _0x20adc9['TagIds'];}catch(_0x174b2b){_0x174419(_0x174b2b);}_0x1d4f68(_0x20adc9);});}function updateChatInteraction(_0x27f35e,_0x143754,_0x49d206){return new BPromise(function(_0x5a623e,_0x1346b0){return getInteractionUsers(_0x27f35e,_0x49d206)['then'](function(_0x235212){return getInteractionTags(_0x235212,_0x143754);})[_0x0998('0x1f')](function(_0x22bea4){return getStateInteraction(_0x22bea4);})[_0x0998('0x1f')](function(_0x389641){_0x5a623e(_0x389641);})['catch'](function(_0x313625){_0x1346b0(_0x313625);});});}function getStateInteraction(_0x59b41c){return new BPromise(function(_0x48b27d){_0x59b41c[_0x0998('0x46')]=0x0;_0x59b41c['talking']=0x0;_0x59b41c['answered']=0x0;_0x59b41c['unmanaged']=0x0;_0x59b41c[_0x0998('0x47')]=0x0;_0x59b41c[_0x0998('0x48')]=0x0;if(!_0x59b41c[_0x0998('0x49')]&&!_0x59b41c[_0x0998('0x4a')]){_0x59b41c[_0x0998('0x46')]+=0x1;}if(!_0x59b41c['closed']&&_0x59b41c[_0x0998('0x4a')]){_0x59b41c[_0x0998('0x4b')]+=0x1;if(_0x59b41c[_0x0998('0x46')]){_0x59b41c['waiting']-=0x1;}}if(_0x59b41c['closed']&&_0x59b41c['disposition']==='abandoned'){_0x59b41c[_0x0998('0x47')]+=0x1;if(_0x59b41c[_0x0998('0x46')]){_0x59b41c['waiting']-=0x1;}}else if(_0x59b41c['closed']&&!_0x59b41c[_0x0998('0x4a')]&&_0x59b41c[_0x0998('0x4c')]){_0x59b41c['unmanaged']+=0x1;if(_0x59b41c[_0x0998('0x46')]){_0x59b41c['waiting']-=0x1;}}else if(_0x59b41c[_0x0998('0x49')]&&_0x59b41c['UserId']){_0x59b41c[_0x0998('0x4d')]+=0x1;if(_0x59b41c[_0x0998('0x4b')]){_0x59b41c[_0x0998('0x4b')]-=0x1;}}_0x59b41c['total']+=0x1;_0x48b27d(_0x59b41c);});}exports[_0x0998('0x4e')]=function(_0x6402dd,_0x3eefe4){var _0x2c83c8={},_0x3ae478={},_0x28b1bd={'count':0x0,'rows':[]};var _0x3a87e1=_[_0x0998('0x4f')](db[_0x0998('0x50')]['rawAttributes'],function(_0x29d233){return{'name':_0x29d233[_0x0998('0x51')],'type':_0x29d233[_0x0998('0x52')][_0x0998('0x53')]};});_0x3ae478[_0x0998('0x54')]=_[_0x0998('0x4f')](_0x3a87e1,_0x0998('0x38'));_0x3ae478[_0x0998('0x55')]=_[_0x0998('0x56')](_0x6402dd[_0x0998('0x55')]);_0x3ae478[_0x0998('0x57')]=_[_0x0998('0x58')](_0x3ae478[_0x0998('0x54')],_0x3ae478[_0x0998('0x55')]);_0x2c83c8[_0x0998('0x59')]=_[_0x0998('0x58')](_0x3ae478[_0x0998('0x54')],qs[_0x0998('0x5a')](_0x6402dd[_0x0998('0x55')]['fields']));_0x2c83c8[_0x0998('0x59')]=_0x2c83c8[_0x0998('0x59')][_0x0998('0x5b')]?_0x2c83c8[_0x0998('0x59')]:_0x3ae478[_0x0998('0x54')];if(!_0x6402dd[_0x0998('0x55')][_0x0998('0x5c')](_0x0998('0x5d'))){_0x2c83c8[_0x0998('0x30')]=qs[_0x0998('0x30')](_0x6402dd[_0x0998('0x55')][_0x0998('0x30')]);_0x2c83c8[_0x0998('0x2d')]=qs[_0x0998('0x2d')](_0x6402dd[_0x0998('0x55')][_0x0998('0x2d')]);}_0x2c83c8[_0x0998('0x5e')]=qs[_0x0998('0x5f')](_0x6402dd['query'][_0x0998('0x5f')]);_0x2c83c8[_0x0998('0x60')]=qs[_0x0998('0x57')](_[_0x0998('0x61')](_0x6402dd[_0x0998('0x55')],_0x3ae478[_0x0998('0x57')]),_0x3a87e1);var _0x5ecddb=[];var _0x5e92f3=squel[_0x0998('0x62')]()[_0x0998('0x63')]('id')[_0x0998('0x63')](_0x0998('0x38'))['field']('color')[_0x0998('0x64')](_0x0998('0x65'));var _0x2ca200=squel[_0x0998('0x62')]()['field'](_0x0998('0x66'))[_0x0998('0x63')](_0x0998('0x67'))[_0x0998('0x63')](_0x0998('0x68'))[_0x0998('0x64')]('user_has_chat_interactions','ui')[_0x0998('0x69')](_0x0998('0x6a'),'u',_0x0998('0x6b'));var _0x2d6044=squel[_0x0998('0x62')]()[_0x0998('0x64')](_0x0998('0x6c'),'i')['left_join'](_0x0998('0x6d'),'c',_0x0998('0x6e'))[_0x0998('0x69')](_0x0998('0x6a'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0x0998('0x6f'))[_0x0998('0x69')](_0x0998('0x70'),'me',_0x0998('0x71'))[_0x0998('0x69')]('chat_interaction_has_tags','it',_0x0998('0x72'))[_0x0998('0x69')]('tools_tags','t',_0x0998('0x73'));var _0x45a4cb=squel[_0x0998('0x74')]();var _0x29164b=[];var _0x32b878=squel[_0x0998('0x74')]();var _0x5435e9;if(_0x6402dd['query'][_0x0998('0x75')]){_0x5435e9=as[_0x0998('0x76')](_0x6402dd[_0x0998('0x55')][_0x0998('0x75')]);var _0x26e8af=_0x5435e9['sqlOperator'];for(var _0x1caaa6=0x0;_0x1caaa6<_0x5435e9['conditions'][_0x0998('0x5b')];_0x1caaa6++){var _0x56afa6=_0x5435e9['conditions'][_0x1caaa6];var _0x2b115c='i';var _0x44497d=_[_0x0998('0x77')](_0x3a87e1,[_0x0998('0x38'),_0x56afa6[_0x0998('0x63')]]);if(!_0x44497d){switch(_0x56afa6[_0x0998('0x63')]){case _0x0998('0x78'):if(_0x56afa6[_0x0998('0x79')]==0x1){_0x2d6044['having']('`'+_0x56afa6[_0x0998('0x63')]+_0x0998('0x7a'));}else{_0x2d6044[_0x0998('0x7b')]('`'+_0x56afa6[_0x0998('0x63')]+_0x0998('0x7c'));}break;case _0x0998('0x7d'):if(_0x56afa6[_0x0998('0x7e')]==='$substring'){if(_0x56afa6[_0x0998('0x79')]['split']('\x20')[_0x0998('0x5b')]>0x1){_0x45a4cb[_0x26e8af](_0x0998('0x7f'),qs[_0x0998('0x80')](_0x56afa6[_0x0998('0x79')]),null);}else{var _0x18771b='%'+_0x56afa6['value']+'%';_0x45a4cb[_0x26e8af](_0x0998('0x81'),_0x18771b,_0x18771b,_0x18771b);}}else{_0x44497d=_[_0x0998('0x77')](_0x3a87e1,['name','ContactId']);_0x56afa6['field']=_0x0998('0x82');_0x51c7c3=as[_0x0998('0x83')](_0x2b115c,_0x44497d[_0x0998('0x52')],_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3['text'],_0x51c7c3[_0x0998('0x79')][_0x0998('0x84')],_0x51c7c3[_0x0998('0x79')][_0x0998('0x2b')]);}break;case _0x0998('0x85'):var _0x33a186=_0x56afa6[_0x0998('0x79')][_0x0998('0x43')](',')[_0x0998('0x4f')](function(_0x578ccf){return Number(_0x578ccf);});_0x33a186['forEach'](function(_0x265ad3){_0x32b878['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x265ad3+',%');});_0x29164b=_['union'](_0x29164b,_0x33a186);break;case'User':if(_0x56afa6['operator']===_0x0998('0x86')){_0x45a4cb[_0x26e8af]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x56afa6[_0x0998('0x79')]+'%',null);}else{_0x44497d=_['find'](_0x3a87e1,[_0x0998('0x38'),_0x0998('0x4a')]);_0x56afa6[_0x0998('0x63')]=_0x0998('0x4a');_0x51c7c3=as[_0x0998('0x83')](_0x2b115c,_0x44497d[_0x0998('0x52')],_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3[_0x0998('0x87')],_0x51c7c3[_0x0998('0x79')]['start'],_0x51c7c3[_0x0998('0x79')]['end']);}break;case'body':_0x51c7c3=as[_0x0998('0x83')]('me',null,_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3[_0x0998('0x87')],_0x51c7c3[_0x0998('0x79')]['start'],_0x51c7c3[_0x0998('0x79')][_0x0998('0x2b')]);break;}}else{var _0x51c7c3=as[_0x0998('0x83')](_0x2b115c,_0x44497d[_0x0998('0x52')],_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3[_0x0998('0x87')],_0x51c7c3['value'][_0x0998('0x84')],_0x51c7c3['value'][_0x0998('0x2b')]);}}}else{var _0x92b5b4=_(_0x6402dd[_0x0998('0x55')])[_0x0998('0x56')]()[_0x0998('0x4f')](function(_0x1749cf){return _[_0x0998('0x88')](_0x3a87e1,['name',_0x1749cf])?_0x1749cf:undefined;})[_0x0998('0x89')]()[_0x0998('0x79')]();if(!_[_0x0998('0x8a')](_0x92b5b4)){_0x92b5b4['forEach'](function(_0x305347){if(_0x305347==='ChatWebsiteId'){_0x2d6044['where'](_0x0998('0x8b'),[][_0x0998('0x8c')](_0x6402dd[_0x0998('0x55')][_0x305347]));}else if(_0x305347===_0x0998('0x8d')){var _0x19b259=JSON[_0x0998('0x8e')](_0x6402dd[_0x0998('0x55')][_0x305347])['$gte'];var _0x4fcc5b=JSON[_0x0998('0x8e')](_0x6402dd['query'][_0x305347])['$lte'];_0x2d6044[_0x0998('0x60')](_0x0998('0x8f'),_0x19b259,_0x4fcc5b);}else{if(_0x6402dd[_0x0998('0x55')][_0x305347]===_0x0998('0x90')){_0x2d6044[_0x0998('0x60')]('i.'+_0x305347+_0x0998('0x91'));}else{_0x2d6044[_0x0998('0x60')]('i.'+_0x305347+_0x0998('0x92'),_0x6402dd[_0x0998('0x55')][_0x305347]);}}});}if(_0x6402dd[_0x0998('0x55')][_0x0998('0x93')]){if(_0x6402dd[_0x0998('0x55')][_0x0998('0x93')]==0x1){_0x2d6044[_0x0998('0x7b')]('`unreadMessages`\x20=\x200');}else{_0x2d6044['having'](_0x0998('0x94'));}}if(_0x6402dd[_0x0998('0x55')][_0x0998('0x95')]){_0x29164b=_['isArray'](_0x6402dd['query'][_0x0998('0x95')])?_0x6402dd['query'][_0x0998('0x95')]:new Array(_0x6402dd[_0x0998('0x55')][_0x0998('0x95')]);_0x29164b[_0x0998('0x44')](function(_0x19887d){_0x32b878['or'](_0x0998('0x96'),'%,'+_0x19887d+',%');});}if(_0x6402dd['query'][_0x0998('0x97')]){var _0x162b38=_0x6402dd[_0x0998('0x55')][_0x0998('0x97')][_0x0998('0x98')]('\x5c','\x5c\x5c')[_0x0998('0x98')](/'/g,'\x27\x27');if(qs[_0x0998('0x99')](_0x162b38)){_0x45a4cb['or'](_0x0998('0x9a'),_0x162b38+'%');}else{_0x45a4cb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0998('0x80')](_0x162b38))['or'](_0x0998('0x9b'),_0x162b38+'%');}}}_0x2d6044['where'](_0x45a4cb);_0x2d6044[_0x0998('0x9c')](_0x0998('0x9d'));var _0x335498={'type':db[_0x0998('0x9e')][_0x0998('0x9f')][_0x0998('0xa0')],'raw':!![]};var _0x5eac63=_0x2d6044[_0x0998('0xa1')]();_0x5eac63[_0x0998('0x63')](_0x0998('0x9d'));_0x5eac63[_0x0998('0x63')](_0x0998('0xa2'),'unreadMessages');if(_0x2c83c8[_0x0998('0x5e')]){_0x2c83c8[_0x0998('0x5e')][_0x0998('0x44')](function(_0x5e6cce){var _0x283df8=_0x5e6cce[0x0]===_0x0998('0xa3')?_0x5e6cce[0x0]:'i.'+_0x5e6cce[0x0];_0x2d6044['order'](_0x283df8,_0x5e6cce[0x1]===_0x0998('0xa4')?![]:!![]);});}if(!_['isEmpty'](_0x29164b)){_0x2d6044[_0x0998('0x7b')](_0x32b878);_0x5eac63[_0x0998('0x60')]('t.id\x20IN\x20?',_0x29164b);}BPromise['resolve']()[_0x0998('0x1f')](function(){if(!_0x5435e9){if(_0x6402dd[_0x0998('0x55')][_0x0998('0xa5')])return;_0x5eac63[_0x0998('0x60')](_0x0998('0xa6'));_0x2d6044[_0x0998('0x60')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x6402dd[_0x0998('0xa7')]['role']!==_0x0998('0x3e'))return;return _0x6402dd[_0x0998('0xa7')][_0x0998('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9f662e){if(_[_0x0998('0x8a')](_0x9f662e)){_0x5eac63[_0x0998('0x60')](_0x0998('0xa9'));_0x2d6044[_0x0998('0x60')](_0x0998('0xa9'));}else{_0x5eac63['where'](_0x0998('0x8b'),_[_0x0998('0x4f')](_0x9f662e,'id'));_0x2d6044['where'](_0x0998('0x8b'),_[_0x0998('0x4f')](_0x9f662e,'id'));}});})[_0x0998('0x1f')](function(){if(_0x6402dd[_0x0998('0xa7')][_0x0998('0xaa')]==='agent'&&!_0x5435e9&&!_0x6402dd[_0x0998('0x55')][_0x0998('0xa5')])return[];return db[_0x0998('0xab')]['query'](_0x5eac63[_0x0998('0xac')](),_0x335498);})['then'](function(_0x1bcdb7){_0x28b1bd[_0x0998('0x2f')]=_0x1bcdb7[_0x0998('0x5b')];if(_0x28b1bd[_0x0998('0x2f')]===0x0)return[];return db[_0x0998('0xab')][_0x0998('0x55')](_0x5e92f3['toString'](),_0x335498)[_0x0998('0x1f')](function(_0x3ee33f){_0x5ecddb=_[_0x0998('0xad')](_0x3ee33f,'id');_0x335498=_[_0x0998('0x3b')](_0x335498,{'model':db[_0x0998('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6402dd[_0x0998('0x55')]['fields']){_0x2c83c8[_0x0998('0x59')][_0x0998('0x44')](function(_0x393aad){_0x2d6044[_0x0998('0x63')]('i.'+_0x393aad);});}else{_0x2d6044[_0x0998('0x63')](_0x0998('0xa2'),_0x0998('0x78'));_0x2d6044[_0x0998('0x63')]('a.key','Account.key');_0x2d6044[_0x0998('0x63')]('a.mandatoryDisposition',_0x0998('0xae'));_0x2d6044[_0x0998('0x63')]('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');_0x2d6044[_0x0998('0x63')]('i.*');_0x2d6044[_0x0998('0x63')](_0x0998('0xaf'),_0x0998('0xb0'));_0x2d6044[_0x0998('0x63')](_0x0998('0xb1'),'Contact.lastName');_0x2d6044['field']('c.email','Contact.email');_0x2d6044[_0x0998('0x63')](_0x0998('0xb2'),'Contact.phone');_0x2d6044['field'](_0x0998('0xb3'),_0x0998('0xb4'));_0x2d6044[_0x0998('0x63')]('c.fax',_0x0998('0xb5'));_0x2d6044[_0x0998('0x63')]('o.fullname','Owner.fullname');_0x2d6044[_0x0998('0x63')](_0x0998('0xb6'),_0x0998('0xb7'));_0x2d6044[_0x0998('0x63')](_0x0998('0xb8'),_0x0998('0x41'));}if(_0x2c83c8['limit'])_0x2d6044['limit'](_0x2c83c8[_0x0998('0x30')]);if(_0x2c83c8[_0x0998('0x2d')])_0x2d6044[_0x0998('0x2d')](_0x2c83c8[_0x0998('0x2d')]);return db[_0x0998('0xab')]['query'](_0x2d6044[_0x0998('0xac')](),_0x335498);})[_0x0998('0x1f')](function(_0xc18718){if(_0xc18718[_0x0998('0x5b')]>0x0)_0x2ca200[_0x0998('0x60')](_0x0998('0xb9'),_['map'](_0xc18718,'id'));return db[_0x0998('0xab')][_0x0998('0x55')](_0x2ca200[_0x0998('0xac')](),_0x335498)[_0x0998('0x1f')](function(_0x21ed99){var _0x26036c=_[_0x0998('0xba')](_0x21ed99,'ChatInteractionId');var _0x2e03b4=[];_0xc18718[_0x0998('0x44')](function(_0x4e4800){_0x2e03b4[_0x0998('0x45')](updateChatInteraction(_0x4e4800,_0x5ecddb,_0x26036c));});return BPromise[_0x0998('0xbb')](_0x2e03b4);});});})[_0x0998('0x1f')](function(_0x5a19bf){_0x28b1bd[_0x0998('0xbc')]=_0x5a19bf;return _0x28b1bd;})['then'](respondWithFilteredResult(_0x3eefe4,_0x2c83c8))[_0x0998('0x29')](handleError(_0x3eefe4,null));};exports['show']=function(_0x4bd3ac,_0x5378a6){var _0x20457={'raw':![],'where':{'id':_0x4bd3ac[_0x0998('0xbd')]['id']}},_0x5cbd8b={};_0x5cbd8b[_0x0998('0x54')]=_[_0x0998('0x56')](db[_0x0998('0x50')][_0x0998('0xbe')]);_0x5cbd8b[_0x0998('0x55')]=_['keys'](_0x4bd3ac['query']);_0x5cbd8b[_0x0998('0x57')]=_[_0x0998('0x58')](_0x5cbd8b[_0x0998('0x54')],_0x5cbd8b['query']);_0x20457[_0x0998('0x59')]=_['intersection'](_0x5cbd8b['model'],qs[_0x0998('0x5a')](_0x4bd3ac[_0x0998('0x55')]['fields']));_0x20457[_0x0998('0x59')]=_0x20457[_0x0998('0x59')][_0x0998('0x5b')]?_0x20457['attributes']:_0x5cbd8b[_0x0998('0x54')];if(_0x4bd3ac[_0x0998('0x55')][_0x0998('0xbf')]){_0x20457[_0x0998('0xc0')]=[{'all':!![]}];}_0x20457=_[_0x0998('0x3b')]({},_0x20457,_0x4bd3ac[_0x0998('0xc1')]);return db['ChatInteraction'][_0x0998('0x77')](_0x20457)[_0x0998('0x1f')](handleEntityNotFound(_0x5378a6,null))[_0x0998('0x1f')](respondWithResult(_0x5378a6,null))[_0x0998('0x29')](handleError(_0x5378a6,null));};exports[_0x0998('0xc2')]=function(_0x2a3a84,_0x3460a4){return db['ChatInteraction'][_0x0998('0xc2')](_0x2a3a84[_0x0998('0x3c')],{})[_0x0998('0x1f')](respondWithResult(_0x3460a4,0xc9))[_0x0998('0x29')](handleError(_0x3460a4,null));};exports[_0x0998('0x34')]=function(_0x1fc2ca,_0x5e1eb8){if(_0x1fc2ca[_0x0998('0x3c')]['id']){delete _0x1fc2ca[_0x0998('0x3c')]['id'];}return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x1fc2ca[_0x0998('0xbd')]['id']}})['then'](handleEntityNotFound(_0x5e1eb8,null))[_0x0998('0x1f')](saveUpdates(_0x1fc2ca[_0x0998('0x3c')],null))['then'](respondWithResult(_0x5e1eb8,null))[_0x0998('0x29')](handleError(_0x5e1eb8,null));};exports[_0x0998('0x35')]=function(_0x1531d9,_0x338230){return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x1531d9[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x338230,null))[_0x0998('0x1f')](removeEntity(_0x338230,null))[_0x0998('0x29')](handleError(_0x338230,null));};exports[_0x0998('0xc3')]=function(_0x222aaf,_0x38e29b){return db[_0x0998('0x50')][_0x0998('0xc3')]()[_0x0998('0x1f')](respondWithResult(_0x38e29b,null))['catch'](handleError(_0x38e29b,null));};exports[_0x0998('0xc4')]=function(_0x5e24b6,_0x254f56){var _0x5b5d6f=_0x5e24b6[_0x0998('0xbd')]['id'];var _0x3d8f33;var _0x4b840f;var _0x5cb847;return db[_0x0998('0x50')]['findOne']({'where':{'id':_0x5b5d6f}})[_0x0998('0x1f')](function(_0x4a1f32){_0x3d8f33=_0x4a1f32;return db[_0x0998('0xc5')][_0x0998('0xc6')]({'where':{'id':_0x4a1f32[_0x0998('0xa5')]},'attributes':['id',_0x0998('0xc7'),_0x0998('0xc8'),_0x0998('0xc9'),'vidaooNote',_0x0998('0xca')],'raw':!![]});})[_0x0998('0x1f')](function(_0x4900e5){if(_0x4900e5&&_0x4900e5[_0x0998('0xc7')]&&_0x4900e5[_0x0998('0xc8')]){_0x4b840f=_0x4900e5;var _0x3d1a3d={'interaction':{'id':_0x5b5d6f},'agent':{'id':_0x5e24b6['user']['id'],'name':_0x5e24b6[_0x0998('0xa7')][_0x0998('0x38')],'fullname':_0x5e24b6[_0x0998('0xa7')][_0x0998('0x40')],'email':_0x5e24b6[_0x0998('0xa7')]['email']},'contact':_0x5e24b6[_0x0998('0x3c')]['contact'],'account':_0x5e24b6[_0x0998('0x3c')]['account']};var _0x5755d7={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4900e5[_0x0998('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e24b6[_0x0998('0xa7')][_0x0998('0xcb')]],'buttons':null,'topic':_0x4b840f[_0x0998('0xc9')],'note':_[_0x0998('0xcc')](_0x4b840f[_0x0998('0xcd')])?null:getMustacheRender(_0x4b840f[_0x0998('0xcd')],_0x3d1a3d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x0998('0xcc')](_0x4b840f[_0x0998('0xca')])){var _0x1c82fe=getMustacheRender(_0x4b840f[_0x0998('0xca')],_0x3d1a3d);var _0x2f0edc=JSON[_0x0998('0x8e')](_0x1c82fe);_0x5755d7[_0x0998('0x3c')][_0x0998('0xce')]=_0x2f0edc;}}catch(_0xcc5524){throw new db[(_0x0998('0x9e'))][(_0x0998('0xcf'))](_0x0998('0xd0'));}return rp(_0x5755d7);}else{throw new db[(_0x0998('0x9e'))]['ValidationError'](_0x0998('0xd1'));}})[_0x0998('0x1f')](function(_0xc696e7){_0x5cb847=_0xc696e7;if(_0x5cb847['id']){var _0x41228a={'body':_0x5cb847[_0x0998('0xd2')],'ChatWebsiteId':_0x4b840f['id'],'ChatInteractionId':_0x3d8f33['id'],'direction':_0x0998('0xd3'),'UserId':_0x5e24b6[_0x0998('0xa7')]['id']};return db['ChatMessage'][_0x0998('0xc2')](_0x41228a,{});}else{throw new db[(_0x0998('0x9e'))][(_0x0998('0xcf'))](_0x0998('0xd4'));}})[_0x0998('0x1f')](function(){return _0x3d8f33[_0x0998('0xd5')]({'vidaooSessionId':_0x5cb847['id']});})[_0x0998('0x1f')](respondWithResult(_0x254f56,null))[_0x0998('0x29')](handleError(_0x254f56,null));};exports[_0x0998('0xd6')]=function(_0x561f9a,_0x12a20e){if(_0x561f9a['body']['id']){delete _0x561f9a['body']['id'];}return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x561f9a[_0x0998('0xbd')]['id']},'include':[{'model':db[_0x0998('0xd7')],'as':_0x0998('0x7d')}]})[_0x0998('0x1f')](handleEntityNotFound(_0x12a20e,null))[_0x0998('0x1f')](saveUpdates(_0x561f9a['body'],null))[_0x0998('0x1f')](respondWithResult(_0x12a20e,null))[_0x0998('0x29')](handleError(_0x12a20e,null));};exports['abandon']=function(_0x1154db,_0x10c34f,_0x28a815){if(_0x1154db['body']['id']){delete _0x1154db[_0x0998('0x3c')]['id'];}return db['ChatInteraction'][_0x0998('0x77')]({'where':{'id':_0x1154db[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](function(_0x575060){if(!_0x575060){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0998('0xd8'),0x194,_0x0998('0xd9'));_0x10c34f['sendStatus'](0x194);}else{if(_0x575060[_0x0998('0x4a')]){throw new db[(_0x0998('0x9e'))][(_0x0998('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x575060;})[_0x0998('0x1f')](function(_0x4a77ce){if(_0x4a77ce){return _0x4a77ce['update']({'closed':_0x1154db[_0x0998('0x3c')][_0x0998('0x49')],'disposition':_0x1154db[_0x0998('0x3c')][_0x0998('0x4c')]})['then'](function(_0x24057b){return _0x24057b;});}})['then'](function(_0xc9a9e8){return respondWithRpcPromise(_0x0998('0xda'),_0x0998('0xd8'),_0x1154db[_0x0998('0x3c')],client9004);})['then'](respondWithResult(_0x10c34f,null))['catch'](handleError(_0x10c34f,null));};exports['attachmentUpload']=function(_0x4cb800,_0x42940a,_0x135988){_0x4cb800[_0x0998('0x3c')][_0x0998('0x38')]=_0x4cb800[_0x0998('0xdb')]['originalname'];_0x4cb800[_0x0998('0x3c')]['basename']=_0x4cb800[_0x0998('0xdb')]['filename'];_0x4cb800[_0x0998('0x3c')][_0x0998('0x52')]=_0x4cb800['file']['mimetype'];return db[_0x0998('0xdc')]['create'](_0x4cb800[_0x0998('0x3c')])[_0x0998('0x1f')](respondWithResult(_0x42940a,0xc9))[_0x0998('0x29')](handleError(_0x42940a,null));};exports[_0x0998('0xdd')]=function(_0x40fc29,_0x28cde6,_0x285084){return db['ChatInteraction'][_0x0998('0xc6')]({'where':{'id':_0x40fc29[_0x0998('0xbd')]['id']},'raw':!![]})[_0x0998('0x1f')](handleEntityNotFound(_0x28cde6,null))[_0x0998('0x1f')](function(_0x3f455d){if(_0x3f455d){if(_0x3f455d['closed']){return _0x28cde6['status'](0x193)[_0x0998('0x2c')]({'status':0x193,'message':_0x0998('0xde')});}return db[_0x0998('0xdc')][_0x0998('0xc6')]({'where':{'id':_0x40fc29[_0x0998('0x55')]['attachId']},'raw':!![]})[_0x0998('0x1f')](handleEntityNotFound(_0x28cde6,null));}})[_0x0998('0x1f')](function(_0x9ef68d){if(_0x9ef68d){var _0x5883f6=_0x9ef68d[_0x0998('0xdf')]!==null;var _0x3ca49c=path[_0x0998('0xe0')](config[_0x0998('0xe1')],_0x0998('0xe2'));if(_0x5883f6){_0x3ca49c=path[_0x0998('0xe0')](_0x3ca49c,_0x0998('0xe3'));}var _0x56ef7b=path[_0x0998('0xe0')](_0x3ca49c,_0x9ef68d[_0x0998('0xe4')]);return _0x28cde6[_0x0998('0xe5')](_0x56ef7b);}})[_0x0998('0x29')](handleError(_0x28cde6,null));};exports[_0x0998('0xe6')]=function(_0xb0ad12,_0x250e66){var _0x4c370e=null;var _0x13d80a=null;var _0x4c1cd6=null;var _0x7e4e9c=null;if(_0xb0ad12[_0x0998('0x3c')]['id']){delete _0xb0ad12['body']['id'];}if(_0xb0ad12[_0x0998('0x3c')][_0x0998('0xe7')]){_0x7e4e9c=path[_0x0998('0xe0')](config[_0x0998('0xe1')],_0x0998('0xe8'),util['format'](_0x0998('0xe9'),Date[_0x0998('0xea')]()));_0xb0ad12[_0x0998('0x3c')]['pathTranscript']=_0x7e4e9c;}return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0xb0ad12['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0998('0xeb'),'include':[{'model':db[_0x0998('0xec')],'as':_0x0998('0xec')}]}]})[_0x0998('0x1f')](handleEntityNotFound(_0x250e66,null))[_0x0998('0x1f')](saveUpdates(_0xb0ad12[_0x0998('0x3c')],null))[_0x0998('0x1f')](function(_0xc61ead){if(_0xc61ead){_0x4c370e=_0xc61ead;return db['ChatWebsite'][_0x0998('0x77')]({'where':{'id':_0x4c370e[_0x0998('0xa5')]}});}})[_0x0998('0x1f')](function(_0x11c519){if(_0x11c519){_0x4c1cd6=_0x11c519;return db[_0x0998('0xd7')][_0x0998('0x77')]({'where':{'id':_0x4c370e['ContactId']}});}})[_0x0998('0x1f')](function(_0xdf447a){if(_0xdf447a){_0x13d80a=_0xdf447a;if(_0x7e4e9c){var _0x25281c=null;for(var _0x4a626f=0x1;_0x4a626f<_0x4c370e[_0x0998('0xeb')][_0x0998('0x5b')];++_0x4a626f){_0x25281c=_0x4c370e['Messages'][_0x4a626f];var _0x125037=_0x25281c[_0x0998('0x4a')]?util[_0x0998('0xed')](_0x0998('0xee'),_0x4c1cd6[_0x0998('0xef')],_0x25281c[_0x0998('0x4a')]):_0x0998('0xf0');var _0x3a08a9=_0xb0ad12[_0x0998('0x3c')]['customer']||util[_0x0998('0xed')](_0x0998('0xee'),_0x0998('0xf1'),_0x25281c['ContactId']);switch(_0x4c1cd6[_0x0998('0xf2')]){case _0x0998('0xf3'):_0x125037=_0x25281c[_0x0998('0x4a')]?util[_0x0998('0xed')](_0x0998('0xee'),_0x4c1cd6['agentAlias'],_0x25281c['UserId']):_0x0998('0xf0');break;case'agent_alias':_0x125037=_0x25281c[_0x0998('0x4a')]?_0x25281c[_0x0998('0xec')]['alias']||_0x25281c['User'][_0x0998('0x40')]:_0x0998('0xf0');break;case _0x0998('0xf4'):_0x125037=_0x25281c['UserId']?_0x25281c['User']['fullname']:_0x0998('0xf0');break;default:_0x125037=_0x25281c['UserId']?util[_0x0998('0xed')](_0x0998('0xee'),_0x4c1cd6[_0x0998('0xef')],_0x25281c['UserId']):_0x0998('0xf0');}var _0xb711f=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x25281c[_0x0998('0x8d')])[_0x0998('0xed')]('MM/DD/YYYY\x20HH:mm:ss'),_0x25281c[_0x0998('0xf5')]==='in'?_0x3a08a9:_0x125037,_0x25281c[_0x0998('0x3c')]);if(!_0x25281c[_0x0998('0xf6')]){fs[_0x0998('0xf7')](_0x7e4e9c,_0xb711f);}}return db[_0x0998('0xf8')][_0x0998('0xc6')]({'where':{'service':!![]},'include':[{'model':db[_0x0998('0xf9')],'as':_0x0998('0xfa'),'raw':!![]}]});}}})['then'](function(_0x22dad5){if(_0x22dad5&&_0x22dad5['Smtp']&&_0xb0ad12[_0x0998('0x3c')]){var _0x40ed7f={'tls':{'rejectUnauthorized':![]}};if(_0x22dad5[_0x0998('0xfa')][_0x0998('0xfb')]){_0x40ed7f[_0x0998('0xfb')]=_0x22dad5[_0x0998('0xfa')][_0x0998('0xfb')];}else{_0x40ed7f[_0x0998('0xfc')]=_0x22dad5[_0x0998('0xfa')][_0x0998('0xfc')];_0x40ed7f['port']=_0x22dad5['Smtp'][_0x0998('0xfd')];_0x40ed7f[_0x0998('0xfe')]=_0x22dad5[_0x0998('0xfa')][_0x0998('0xfe')];}if(_0x22dad5['Smtp'][_0x0998('0xff')]){_0x40ed7f[_0x0998('0x100')]={'user':_0x22dad5[_0x0998('0xfa')][_0x0998('0xa7')],'pass':_0x22dad5['Smtp'][_0x0998('0x101')]};}return respondWithRpcPromise('SendMail',_0x0998('0x102'),{'account':_0x40ed7f,'message':{'from':util[_0x0998('0xed')](_0x0998('0x103'),_0x22dad5['name'],_0x22dad5[_0x0998('0xcb')]||_0x22dad5[_0x0998('0xfa')][_0x0998('0xa7')]),'to':_0xb0ad12[_0x0998('0x3c')][_0x0998('0xe7')],'subject':_0x0998('0x104'),'text':util[_0x0998('0xed')](_0x0998('0x105'),_0xb0ad12[_0x0998('0x3c')][_0x0998('0xe7')]),'attachments':[{'path':_0x7e4e9c}]}})['then'](function(){return _0x4c370e;})[_0x0998('0x29')](function(_0x56644e){console[_0x0998('0x24')](_0x56644e);});}else{return _0x4c370e;}})[_0x0998('0x1f')](respondWithStatusCode(_0x250e66,0xc8))[_0x0998('0x29')](handleError(_0x250e66,null));};exports['addMessage']=function(_0x238cf0,_0x440379,_0x4f41b3){return db[_0x0998('0x106')][_0x0998('0x77')]({'where':{'id':_0x238cf0[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x440379,null))['then'](function(_0x35abb6){if(_0x35abb6){return _0x35abb6[_0x0998('0x107')](_0x238cf0['body']['ids'],_['omit'](_0x238cf0[_0x0998('0x3c')],[_0x0998('0x108'),'id'])||{});}})[_0x0998('0x1f')](respondWithResult(_0x440379,null))[_0x0998('0x29')](handleError(_0x440379,null));};exports['getMessages']=function(_0x172930,_0x271198,_0x5b3181){var _0x19e704={'raw':![],'where':{}};var _0x23c447={};var _0x209f83={'count':0x0,'rows':[]};return db[_0x0998('0x50')][_0x0998('0xc6')]({'where':{'id':_0x172930[_0x0998('0xbd')]['id']}})['then'](handleEntityNotFound(_0x271198,null))[_0x0998('0x1f')](function(_0xd68c44){if(_0xd68c44){_0x23c447['model']=_[_0x0998('0x56')](db[_0x0998('0x106')][_0x0998('0xbe')]);_0x23c447[_0x0998('0x55')]=_[_0x0998('0x56')](_0x172930[_0x0998('0x55')]);_0x23c447[_0x0998('0x57')]=_[_0x0998('0x58')](_0x23c447['model'],_0x23c447[_0x0998('0x55')]);_0x19e704[_0x0998('0x59')]=_[_0x0998('0x58')](_0x23c447['model'],qs[_0x0998('0x5a')](_0x172930['query'][_0x0998('0x5a')]));_0x19e704[_0x0998('0x59')]=_0x19e704['attributes'][_0x0998('0x5b')]?_0x19e704['attributes']:_0x23c447[_0x0998('0x54')];if(!_0x172930[_0x0998('0x55')][_0x0998('0x5c')]('nolimit')){_0x19e704[_0x0998('0x30')]=qs['limit'](_0x172930[_0x0998('0x55')][_0x0998('0x30')]);_0x19e704[_0x0998('0x2d')]=qs[_0x0998('0x2d')](_0x172930['query'][_0x0998('0x2d')]);}_0x19e704[_0x0998('0x5e')]=qs[_0x0998('0x5f')](_0x172930['query'][_0x0998('0x5f')]);_0x19e704[_0x0998('0x60')]=qs['filters'](_[_0x0998('0x61')](_0x172930[_0x0998('0x55')],_0x23c447[_0x0998('0x57')]));_0x19e704[_0x0998('0x60')][_0x0998('0x109')]=_0xd68c44['id'];if(_0x172930[_0x0998('0x55')][_0x0998('0x97')]){_0x19e704[_0x0998('0x60')]=_[_0x0998('0x3b')](_0x19e704[_0x0998('0x60')],{'$or':_['map'](_0x19e704['attributes'],function(_0x599044){var _0x5b141e={};_0x5b141e[_0x599044]={'$like':'%'+_0x172930[_0x0998('0x55')][_0x0998('0x97')]+'%'};return _0x5b141e;})});}if(_0x172930['query'][_0x0998('0x10a')]){var _0x34a36a=_0x172930[_0x0998('0x55')][_0x0998('0x10a')][_0x0998('0x43')](',');var _0x440dee={};_0x440dee[_0x34a36a[0x0]]={'$gte':moment(_0x34a36a[0x1])['format'](_0x0998('0x10b'))};_0x19e704[_0x0998('0x60')]=_[_0x0998('0x3b')](_0x19e704[_0x0998('0x60')],_0x440dee);}_0x19e704=_[_0x0998('0x3b')]({},_0x19e704,_0x172930[_0x0998('0xc1')]);return db[_0x0998('0x106')][_0x0998('0x2f')]({'where':_0x19e704[_0x0998('0x60')]})[_0x0998('0x1f')](function(_0xd341ba){_0x209f83[_0x0998('0x2f')]=_0xd341ba;if(_0x172930[_0x0998('0x55')][_0x0998('0xbf')]){_0x19e704[_0x0998('0xc0')]=[{'all':!![]}];}return db[_0x0998('0x106')]['findAll'](_0x19e704);})['then'](function(_0x3466c9){_0x209f83[_0x0998('0xbc')]=_0x3466c9;return _0x209f83;});}})['then'](respondWithFilteredResult(_0x271198,_0x19e704))[_0x0998('0x29')](handleError(_0x271198,null));};exports['getMyMessages']=function(_0x20c3af,_0x2fa70d,_0xff967f){var _0x34f674={'where':{}},_0x2b2d09={},_0x3ed31a={'count':0x0,'rows':[]};return db[_0x0998('0x50')][_0x0998('0xc6')]({'where':{'id':_0x20c3af[_0x0998('0xbd')]['id']}})['then'](handleEntityNotFound(_0x2fa70d,null))[_0x0998('0x1f')](function(_0xdbffd3){if(_0xdbffd3){_0x2b2d09['model']=_['keys'](db[_0x0998('0x106')][_0x0998('0xbe')]);_0x2b2d09[_0x0998('0x55')]=_[_0x0998('0x56')](_0x20c3af[_0x0998('0x55')]);_0x2b2d09[_0x0998('0x57')]=_[_0x0998('0x58')](_0x2b2d09[_0x0998('0x54')],_0x2b2d09[_0x0998('0x55')]);_0x34f674[_0x0998('0x59')]=_[_0x0998('0x58')](_0x2b2d09['model'],qs[_0x0998('0x5a')](_0x20c3af[_0x0998('0x55')]['fields']));_0x34f674['attributes']=_0x34f674[_0x0998('0x59')][_0x0998('0x5b')]?_0x34f674[_0x0998('0x59')]:_0x2b2d09[_0x0998('0x54')];if(!_0x20c3af[_0x0998('0x55')]['hasOwnProperty']('nolimit')){_0x34f674['limit']=qs[_0x0998('0x30')](_0x20c3af[_0x0998('0x55')][_0x0998('0x30')]);_0x34f674[_0x0998('0x2d')]=qs['offset'](_0x20c3af[_0x0998('0x55')][_0x0998('0x2d')]);}_0x34f674[_0x0998('0x5e')]=qs['sort'](_0x20c3af[_0x0998('0x55')][_0x0998('0x5f')]);_0x34f674[_0x0998('0x60')]=qs[_0x0998('0x57')](_[_0x0998('0x61')](_0x20c3af['query'],_0x2b2d09[_0x0998('0x57')]));_0x34f674[_0x0998('0x60')][_0x0998('0x109')]=_0xdbffd3['id'];if(_0x20c3af[_0x0998('0x55')][_0x0998('0x97')]){_0x34f674[_0x0998('0x60')]=_['merge'](_0x34f674[_0x0998('0x60')],{'$or':_['map'](_0x34f674[_0x0998('0x59')],function(_0x29f796){var _0x5039d3={};_0x5039d3[_0x29f796]={'$like':'%'+_0x20c3af[_0x0998('0x55')][_0x0998('0x97')]+'%'};return _0x5039d3;})});}_0x34f674['where'][_0x0998('0xf6')]=![];if(_0x20c3af[_0x0998('0x55')]['id']){_0x34f674[_0x0998('0x60')]['id']={'$gt':_0x20c3af[_0x0998('0x55')]['id']};}_0x34f674=_[_0x0998('0x3b')]({},_0x34f674,_0x20c3af['options']);return db['ChatMessage'][_0x0998('0x2f')]({'where':_0x34f674[_0x0998('0x60')]})['then'](function(_0x23f1ef){_0x3ed31a['count']=_0x23f1ef;_0x34f674[_0x0998('0xc0')]=[];if(_0x20c3af[_0x0998('0x55')][_0x0998('0x10c')]){_0x34f674[_0x0998('0xc0')][_0x0998('0x45')]({'model':db[_0x0998('0xec')],'as':_0x0998('0xec'),'attributes':['id','fullname',_0x0998('0x10d')]});}if(_0x20c3af[_0x0998('0x55')]['includeAll']){_0x34f674[_0x0998('0xc0')]=[{'all':!![]}];}return db[_0x0998('0x106')][_0x0998('0x10e')](_0x34f674);})[_0x0998('0x1f')](function(_0x5e1e41){_0x3ed31a[_0x0998('0xbc')]=_0x5e1e41;return _0x3ed31a;});}})[_0x0998('0x1f')](respondWithFilteredResult(_0x2fa70d,_0x34f674))[_0x0998('0x29')](handleError(_0x2fa70d,null));};exports[_0x0998('0x10f')]=function(_0x33476a,_0x124129,_0x360773){return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x33476a[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x124129,null))['then'](function(_0x271360){if(_0x271360){return _0x271360[_0x0998('0x110')](_0x33476a['body'][_0x0998('0x108')],_[_0x0998('0x111')](_0x33476a[_0x0998('0x3c')],[_0x0998('0x108'),'id'])||{})[_0x0998('0x112')](function(){return db['Tag'][_0x0998('0x10e')]({'attributes':['id',_0x0998('0x38'),_0x0998('0x113')],'where':{'id':_0x33476a[_0x0998('0x3c')]['ids']}});})[_0x0998('0x1f')](function(_0x145e3b){socket[_0x0998('0x114')]('chatInteractionTags:save',{'id':Number(_0x33476a['params']['id']),'tags':_0x145e3b||[]});return{'id':Number(_0x33476a[_0x0998('0xbd')]['id']),'tags':_0x145e3b||[]};});}})[_0x0998('0x1f')](respondWithResult(_0x124129,null))[_0x0998('0x29')](handleError(_0x124129,null));};exports[_0x0998('0x115')]=function(_0x3573c7,_0x321708,_0xd3a4){return db[_0x0998('0x50')]['find']({'where':{'id':_0x3573c7[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x321708,null))['then'](function(_0x376566){if(_0x376566){return _0x376566[_0x0998('0x115')](_0x3573c7[_0x0998('0x55')][_0x0998('0x108')]);}})[_0x0998('0x1f')](respondWithStatusCode(_0x321708,null))[_0x0998('0x29')](handleError(_0x321708,null));};exports[_0x0998('0xe5')]=function(_0x2fcea5,_0x3c1f60){var _0x5ad48d=moment()[_0x0998('0x116')]()['toString']();var _0x2fd5a3=path['join'](config[_0x0998('0xe1')],_0x0998('0x117'),_0x0998('0x118'),_0x0998('0x119'));var _0x4ab343=path[_0x0998('0xe0')](config[_0x0998('0xe1')],'server',_0x0998('0x118'),'attachments');var _0x38c323=path['join'](_0x2fd5a3,_0x5ad48d);var _0x6b7242=util[_0x0998('0xed')]('transcript-%d-%s.zip',_0x2fcea5['params']['id'],_0x5ad48d);var _0x341f06=path[_0x0998('0xe0')](_0x2fd5a3,_0x6b7242);var _0x30c149=[];_0x30c149['push']({'model':db[_0x0998('0xec')],'as':'User','attributes':['id',_0x0998('0x40')],'raw':!![]});_0x30c149[_0x0998('0x45')]({'model':db[_0x0998('0xd7')],'as':_0x0998('0x7d'),'attributes':['id',_0x0998('0x11a'),_0x0998('0x11b')],'raw':!![]});if(_0x2fcea5[_0x0998('0x55')]['attachments']){_0x30c149['push']({'model':db[_0x0998('0xdc')],'as':_0x0998('0xdc'),'raw':!![]});}var _0x158154=[{'model':db[_0x0998('0x106')],'as':_0x0998('0xeb'),'attributes':['id','body',_0x0998('0x8d'),'direction',_0x0998('0xf6'),_0x0998('0x93')],'include':_0x30c149}];_0x158154['push']({'model':db[_0x0998('0xc5')],'as':_0x0998('0x11c'),'attributes':['id',_0x0998('0x38')]});_0x158154[_0x0998('0x45')]({'model':db[_0x0998('0xec')],'as':_0x0998('0x11d'),'attributes':['id',_0x0998('0x40')]});return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x2fcea5[_0x0998('0xbd')]['id']},'include':_0x158154})[_0x0998('0x1f')](handleEntityNotFound(_0x3c1f60,null))[_0x0998('0x1f')](function(_0xe68cf5){if(_0xe68cf5){var _0x1dab60=_0xe68cf5[_0x0998('0x11e')]({'plain':!![]});fs['mkdirSync'](_0x38c323);var _0x4270fe={'channel':_0x0998('0x11f'),'account':_0x1dab60[_0x0998('0x11c')][_0x0998('0x38')],'agent':_0x1dab60[_0x0998('0x11d')]?_0x1dab60[_0x0998('0x11d')][_0x0998('0x40')]:_0x0998('0x120'),'createdAt':moment(_0x1dab60[_0x0998('0x8d')])[_0x0998('0xed')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0998('0xac')](),'closedAt':_0x1dab60[_0x0998('0x49')]?moment(_0x1dab60[_0x0998('0x121')])[_0x0998('0xed')](_0x0998('0x10b'))['toString']():'','disposition':_0x1dab60['disposition'],'chatInfo':{'browser':_0x1dab60[_0x0998('0x122')],'os':_0x1dab60[_0x0998('0x123')],'referer':_0x1dab60['referer'],'customerIp':_0x1dab60[_0x0998('0x124')],'customerPort':_0x1dab60[_0x0998('0x125')]?_0x1dab60[_0x0998('0x125')]:_0x0998('0x120')},'messages':_(_0x1dab60[_0x0998('0xeb')])[_0x0998('0x126')]()['filter']({'secret':![]})[_0x0998('0x4f')](function(_0x104388){if(_0x104388[_0x0998('0xdc')]){var _0x2d4df4=path[_0x0998('0xe0')](_0x4ab343,_0x104388['Attachment'][_0x0998('0xe4')]);if(fs[_0x0998('0x127')](_0x2d4df4)){fs['createReadStream'](_0x2d4df4)[_0x0998('0x128')](fs['createWriteStream'](path['join'](_0x38c323,_0x104388[_0x0998('0xdc')][_0x0998('0xe4')])));}}return{'date':moment(_0x104388['createdAt'])[_0x0998('0xed')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0998('0xac')](),'sender':_0x104388[_0x0998('0xf5')]==='out'?_0x104388[_0x0998('0xec')]?_0x104388['User']['fullname']:_0x0998('0xf0'):_0x104388['Contact'][_0x0998('0x11a')]+(_0x104388[_0x0998('0x7d')][_0x0998('0x11b')]?'\x20'+_0x104388[_0x0998('0x7d')][_0x0998('0x11b')]:''),'body':_0x104388['Attachment']?_0x104388[_0x0998('0xdc')][_0x0998('0xe4')]:_0x104388[_0x0998('0x3c')],'direction':_0x104388[_0x0998('0xf5')]===_0x0998('0xd3')?'A':'C','secret':_0x104388['secret'],'read':_0x104388['read'],'attachment':_0x104388[_0x0998('0xdc')]};})[_0x0998('0x79')]()};return ejs['renderFile'](path[_0x0998('0xe0')](config['root'],_0x0998('0x117'),_0x0998('0x129'),_0x0998('0x12a')),{'interaction':_0x4270fe})['then'](function(_0x1d0d84){var _0x201a84=path[_0x0998('0xe0')](_0x38c323,'transcript-'+_0x1dab60['id']+'-'+_0x5ad48d+_0x0998('0x12b'));var _0x27ee9e={'path':_0x201a84,'channel':_0x0998('0x11f'),'interactionId':_0x1dab60['id']};return pdf['createPdfFromHTML'](_0x1d0d84,_0x27ee9e);})[_0x0998('0x1f')](function(){return new BPromise(function(_0xd4a2cd,_0x57abaa){zipdir(_0x38c323,{'saveTo':_0x341f06},function(_0x47cff9,_0x4a7c39){if(_0x47cff9)return _0x57abaa(_0x47cff9);return _0xd4a2cd(_0x4a7c39);});})[_0x0998('0x1f')](function(){return new BPromise(function(_0x3bb1b2,_0x1a8c31){rimraf(_0x38c323,function(_0x3a1bc1){if(_0x3a1bc1)_0x1a8c31(_0x3a1bc1);return _0x3bb1b2();});});})['then'](function(){return _0x3c1f60[_0x0998('0xe5')](_0x341f06,_0x6b7242,function(_0x2be0cd){if(_0x2be0cd){console[_0x0998('0x12c')](_0x0998('0x12d'),_0x2be0cd);}else{fs[_0x0998('0x12e')](_0x341f06);}});});});}else{return _0x3c1f60[_0x0998('0x36')](0xc8);}})['catch'](handleError(_0x3c1f60,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 48400b7..75f29a3 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 _0xe65e=['hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','Users','findAll','setDataValue','length','emit','hasOwnProperty'];(function(_0x2da0ce,_0x128df2){var _0x21edc6=function(_0x1a5f09){while(--_0x1a5f09){_0x2da0ce['push'](_0x2da0ce['shift']());}};_0x21edc6(++_0x128df2);}(_0xe65e,0x1e2));var _0xee65=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xe65e[_0x273c39];return _0x46d6b5;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xee65('0x0')];var ChatMessage=require(_0xee65('0x1'))['db'][_0xee65('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xee65('0x3')](0x0);var events={'afterCreate':_0xee65('0x4'),'afterUpdate':'update','afterDestroy':_0xee65('0x5')};function emitEvent(_0xd8be36){return function(_0x30d8d3,_0x185b6d,_0x2ed08a){_0x30d8d3[_0xee65('0x6')]({'attributes':['id'],'raw':!![]})[_0xee65('0x7')](function(_0xfd8451){_0x30d8d3['setDataValue'](_0xee65('0x8'),_0xfd8451['map'](function(_0x4dd9c6){return{'id':_0x4dd9c6['id']};}));return ChatMessage[_0xee65('0x9')]({'where':{'ChatInteractionId':_0x30d8d3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xee65('0x7')](function(_0xc9da14){_0x30d8d3[_0xee65('0xa')]('unreadMessages',_0xc9da14[_0xee65('0xb')]);ChatInteractionEvents[_0xee65('0xc')](_0xd8be36+':'+_0x30d8d3['id'],_0x30d8d3);ChatInteractionEvents['emit'](_0xd8be36,_0x30d8d3);_0x2ed08a(null);})['catch'](_0x2ed08a(null));};}for(var e in events){if(events[_0xee65('0xd')](e)){var event=events[e];ChatInteraction[_0xee65('0xe')](e,emitEvent(event));}}module[_0xee65('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0xd53e=['hasOwnProperty','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','map','setDataValue','unreadMessages','length','emit','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53e,0x81));var _0xed53=function(_0x564f26,_0x1a44dc){_0x564f26=_0x564f26-0x0;var _0x5799a1=_0xd53e[_0x564f26];return _0x5799a1;};'use strict';var EventEmitter=require(_0xed53('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xed53('0x1')];var ChatMessage=require(_0xed53('0x2'))['db'][_0xed53('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xed53('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed53('0x5'),'afterDestroy':_0xed53('0x6')};function emitEvent(_0x1f9db3){return function(_0x9b6c78,_0x18c159,_0x49e3c5){_0x9b6c78[_0xed53('0x7')]({'attributes':['id'],'raw':!![]})[_0xed53('0x8')](function(_0x22201b){_0x9b6c78['setDataValue']('Users',_0x22201b[_0xed53('0x9')](function(_0x5e28cb){return{'id':_0x5e28cb['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x9b6c78['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed53('0x8')](function(_0x143358){_0x9b6c78[_0xed53('0xa')](_0xed53('0xb'),_0x143358[_0xed53('0xc')]);ChatInteractionEvents[_0xed53('0xd')](_0x1f9db3+':'+_0x9b6c78['id'],_0x9b6c78);ChatInteractionEvents[_0xed53('0xd')](_0x1f9db3,_0x9b6c78);_0x49e3c5(null);})[_0xed53('0xe')](_0x49e3c5(null));};}for(var e in events){if(events[_0xed53('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f358498..c39c976 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 _0xbd09=['moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1286e5,_0x2b912b){var _0x313a52=function(_0x53a9e2){while(--_0x53a9e2){_0x1286e5['push'](_0x1286e5['shift']());}};_0x313a52(++_0x2b912b);}(_0xbd09,0x75));var _0x9bd0=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xbd09[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x9bd0('0x0'));var util=require(_0x9bd0('0x1'));var logger=require('../../config/logger')(_0x9bd0('0x2'));var moment=require(_0x9bd0('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bd0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bd0('0x5'));var config=require(_0x9bd0('0x6'));var attributes=require(_0x9bd0('0x7'));module['exports']=function(_0x147fe0,_0x7f0bc9){return _0x147fe0[_0x9bd0('0x8')](_0x9bd0('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44fe43,_0x387407,_0x20e916){if(_0x44fe43[_0x9bd0('0xa')](_0x9bd0('0xb'))){_0x44fe43[_0x9bd0('0xc')]=moment()['format'](_0x9bd0('0xd'));}_0x20e916(null,_0x44fe43);}},'charset':'utf8mb4','collate':_0x9bd0('0xe')});}; \ No newline at end of file +var _0x3946=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x3946,0x1ca));var _0x6394=function(_0x5ea7e2,_0x15836c){_0x5ea7e2=_0x5ea7e2-0x0;var _0x1788b4=_0x3946[_0x5ea7e2];return _0x1788b4;};'use strict';var _=require(_0x6394('0x0'));var util=require(_0x6394('0x1'));var logger=require('../../config/logger')(_0x6394('0x2'));var moment=require('moment');var BPromise=require(_0x6394('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6394('0x4'));var rimraf=require(_0x6394('0x5'));var config=require(_0x6394('0x6'));var attributes=require(_0x6394('0x7'));module[_0x6394('0x8')]=function(_0xbaf76b,_0xb891bc){return _0xbaf76b[_0x6394('0x9')](_0x6394('0xa'),attributes,{'tableName':_0x6394('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x389142,_0x1ed24e,_0x1145b0){if(_0x389142['changed'](_0x6394('0xc'))){_0x389142['closedAt']=moment()['format'](_0x6394('0xd'));}_0x1145b0(null,_0x389142);}},'charset':_0x6394('0xe'),'collate':_0x6394('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 29549f0..f5008a7 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 _0x2d3a=['request\x20sent','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2d3a,0x12d));var _0xa2d3=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x2d3a[_0x30f030];return _0xf7614f;};'use strict';var _=require(_0xa2d3('0x0'));var util=require('util');var moment=require(_0xa2d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2d3('0x2'));var fs=require('fs');var Redis=require(_0xa2d3('0x3'));var db=require(_0xa2d3('0x4'))['db'];var utils=require(_0xa2d3('0x5'));var logger=require(_0xa2d3('0x6'))('rpc');var config=require(_0xa2d3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2d3('0x8')][_0xa2d3('0x9')]({'port':0x232a});config[_0xa2d3('0xa')]=_[_0xa2d3('0xb')](config[_0xa2d3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2d3('0xc'))(new Redis(config[_0xa2d3('0xa')]));require(_0xa2d3('0xd'))[_0xa2d3('0xe')](socket);function respondWithRpcPromise(_0x218949,_0x2c9b7b,_0x4c5def){return new BPromise(function(_0x318d1b,_0x388c8d){return client['request'](_0x218949,_0x4c5def)[_0xa2d3('0xf')](function(_0xfecfee){logger['info'](_0xa2d3('0x10'),_0x2c9b7b,'request\x20sent');logger[_0xa2d3('0x11')](_0xa2d3('0x12'),_0x2c9b7b,_0xa2d3('0x13'),JSON[_0xa2d3('0x14')](_0xfecfee));if(_0xfecfee[_0xa2d3('0x15')]){if(_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x16')]===0x1f4){logger['error'](_0xa2d3('0x10'),_0x2c9b7b,_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x17')]);return _0x388c8d(_0xfecfee['error'][_0xa2d3('0x17')]);}logger['error'](_0xa2d3('0x10'),_0x2c9b7b,_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x17')]);return _0x318d1b(_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x17')]);}else{logger[_0xa2d3('0x18')](_0xa2d3('0x10'),_0x2c9b7b,'request\x20sent');_0x318d1b(_0xfecfee[_0xa2d3('0x19')][_0xa2d3('0x17')]);}})['catch'](function(_0xcc79c5){logger[_0xa2d3('0x15')](_0xa2d3('0x10'),_0x2c9b7b,_0xcc79c5);_0x388c8d(_0xcc79c5);});});}exports[_0xa2d3('0x1a')]=function(_0x5c2c34){var _0x4a4e37=this;return new Promise(function(_0xd2310f,_0x43a778){return db[_0xa2d3('0x1b')]['update'](_0x5c2c34[_0xa2d3('0x1c')],{'raw':_0x5c2c34['options']?_0x5c2c34[_0xa2d3('0x1d')][_0xa2d3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2c34[_0xa2d3('0x1d')]?_0x5c2c34[_0xa2d3('0x1d')][_0xa2d3('0x1f')]||null:null,'attributes':_0x5c2c34['options']?_0x5c2c34[_0xa2d3('0x1d')][_0xa2d3('0x20')]||null:null,'limit':_0x5c2c34[_0xa2d3('0x1d')]?_0x5c2c34['options'][_0xa2d3('0x21')]||null:null})[_0xa2d3('0xf')](function(_0x51f71f){logger[_0xa2d3('0x18')](_0xa2d3('0x1a'),_0x5c2c34);logger[_0xa2d3('0x11')](_0xa2d3('0x1a'),_0x5c2c34,JSON[_0xa2d3('0x14')](_0x51f71f));_0xd2310f(_0x51f71f);})[_0xa2d3('0x22')](function(_0xaee19c){logger['error']('UpdateChatInteraction',_0xaee19c[_0xa2d3('0x17')],_0x5c2c34);_0x43a778(_0x4a4e37['error'](0x1f4,_0xaee19c[_0xa2d3('0x17')]));});});};exports[_0xa2d3('0x23')]=function(_0x4f17fb){return new Promise(function(_0x1117f6,_0x201abb){return db[_0xa2d3('0x1b')][_0xa2d3('0x24')]({'where':_0x4f17fb[_0xa2d3('0x1d')]?_0x4f17fb[_0xa2d3('0x1d')][_0xa2d3('0x1f')]||null:null})[_0xa2d3('0xf')](function(_0x48ce74){if(_0x48ce74){return _0x48ce74['addTags'](_0x4f17fb[_0xa2d3('0x1c')][_0xa2d3('0x25')],_[_0xa2d3('0x26')](_0x4f17fb[_0xa2d3('0x1c')],[_0xa2d3('0x25'),'id'])||{});}})['spread'](function(_0xdb53d3){logger['info'](_0xa2d3('0x27'),_0x4f17fb);logger[_0xa2d3('0x11')]('AddTags',_0x4f17fb,JSON['stringify'](_0xdb53d3));_0x1117f6(_0xdb53d3);})['catch'](function(_0x204565){logger[_0xa2d3('0x15')](_0xa2d3('0x27'),_0x204565[_0xa2d3('0x17')],_0x4f17fb);_0x201abb(_this['error'](0x1f4,_0x204565[_0xa2d3('0x17')]));});});}; \ No newline at end of file +var _0x384a=['omit','ids','spread','AddTags','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','then','debug','find','where','addTags'];(function(_0x229231,_0x24cfb2){var _0x295a4a=function(_0x3f3724){while(--_0x3f3724){_0x229231['push'](_0x229231['shift']());}};_0x295a4a(++_0x24cfb2);}(_0x384a,0x16c));var _0xa384=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x384a[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xa384('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa384('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa384('0x2'))['db'];var utils=require(_0xa384('0x3'));var logger=require(_0xa384('0x4'))(_0xa384('0x5'));var config=require(_0xa384('0x6'));var jayson=require(_0xa384('0x7'));var client=jayson[_0xa384('0x8')]['http']({'port':0x232a});config[_0xa384('0x9')]=_[_0xa384('0xa')](config[_0xa384('0x9')],{'host':_0xa384('0xb'),'port':0x18eb});var socket=require(_0xa384('0xc'))(new Redis(config[_0xa384('0x9')]));require(_0xa384('0xd'))[_0xa384('0xe')](socket);function respondWithRpcPromise(_0xb09b7,_0x5c87f6,_0x777441){return new BPromise(function(_0x35bbd5,_0x41feb1){return client['request'](_0xb09b7,_0x777441)['then'](function(_0x552770){logger[_0xa384('0xf')](_0xa384('0x10'),_0x5c87f6,_0xa384('0x11'));logger['debug'](_0xa384('0x12'),_0x5c87f6,_0xa384('0x11'),JSON[_0xa384('0x13')](_0x552770));if(_0x552770[_0xa384('0x14')]){if(_0x552770[_0xa384('0x14')][_0xa384('0x15')]===0x1f4){logger[_0xa384('0x14')](_0xa384('0x10'),_0x5c87f6,_0x552770['error']['message']);return _0x41feb1(_0x552770['error'][_0xa384('0x16')]);}logger[_0xa384('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5c87f6,_0x552770[_0xa384('0x14')][_0xa384('0x16')]);return _0x35bbd5(_0x552770['error']['message']);}else{logger[_0xa384('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x5c87f6,_0xa384('0x11'));_0x35bbd5(_0x552770[_0xa384('0x17')][_0xa384('0x16')]);}})[_0xa384('0x18')](function(_0x18a835){logger[_0xa384('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5c87f6,_0x18a835);_0x41feb1(_0x18a835);});});}exports[_0xa384('0x19')]=function(_0x10cd9d){var _0x5d7a8c=this;return new Promise(function(_0x20797b,_0x1b92e4){return db[_0xa384('0x1a')][_0xa384('0x1b')](_0x10cd9d[_0xa384('0x1c')],{'raw':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')]['where']||null:null,'attributes':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')][_0xa384('0x1e')]||null:null,'limit':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')]['limit']||null:null})[_0xa384('0x1f')](function(_0x32c4fa){logger[_0xa384('0xf')](_0xa384('0x19'),_0x10cd9d);logger[_0xa384('0x20')](_0xa384('0x19'),_0x10cd9d,JSON[_0xa384('0x13')](_0x32c4fa));_0x20797b(_0x32c4fa);})[_0xa384('0x18')](function(_0x463d5b){logger[_0xa384('0x14')](_0xa384('0x19'),_0x463d5b['message'],_0x10cd9d);_0x1b92e4(_0x5d7a8c[_0xa384('0x14')](0x1f4,_0x463d5b[_0xa384('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x1ef238){return new Promise(function(_0x5d65bf,_0x4b56fc){return db[_0xa384('0x1a')][_0xa384('0x21')]({'where':_0x1ef238[_0xa384('0x1d')]?_0x1ef238[_0xa384('0x1d')][_0xa384('0x22')]||null:null})[_0xa384('0x1f')](function(_0x24a9cf){if(_0x24a9cf){return _0x24a9cf[_0xa384('0x23')](_0x1ef238[_0xa384('0x1c')]['ids'],_[_0xa384('0x24')](_0x1ef238[_0xa384('0x1c')],[_0xa384('0x25'),'id'])||{});}})[_0xa384('0x26')](function(_0x121688){logger['info'](_0xa384('0x27'),_0x1ef238);logger[_0xa384('0x20')](_0xa384('0x27'),_0x1ef238,JSON[_0xa384('0x13')](_0x121688));_0x5d65bf(_0x121688);})[_0xa384('0x18')](function(_0x473ff5){logger[_0xa384('0x14')]('AddTags',_0x473ff5[_0xa384('0x16')],_0x1ef238);_0x4b56fc(_this[_0xa384('0x14')](0x1f4,_0x473ff5['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index af14173..a172005 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 _0xf70e=['chatInteraction:','./chatInteraction.events','save','emit','removeListener','register'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf70e,0xd9));var _0xef70=function(_0x563d77,_0x305794){_0x563d77=_0x563d77-0x0;var _0x24cfdf=_0xf70e[_0x563d77];return _0x24cfdf;};'use strict';var ChatInteractionEvents=require(_0xef70('0x0'));var events=[_0xef70('0x1'),'remove','update'];function createListener(_0x4ece88,_0x1d9e28){return function(_0x5877ca){_0x1d9e28[_0xef70('0x2')](_0x4ece88,_0x5877ca);};}function removeListener(_0x179db6,_0x1afc2f){return function(){ChatInteractionEvents[_0xef70('0x3')](_0x179db6,_0x1afc2f);};}exports[_0xef70('0x4')]=function(_0x113fff){for(var _0x1fd1df=0x0,_0x35897b=events['length'];_0x1fd1df<_0x35897b;_0x1fd1df++){var _0x33384c=events[_0x1fd1df];var _0x50927d=createListener(_0xef70('0x5')+_0x33384c,_0x113fff);ChatInteractionEvents['on'](_0x33384c,_0x50927d);}}; \ No newline at end of file +var _0x69ec=['chatInteraction:','save','remove','update','emit','removeListener','register'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x69ec,0xbe));var _0xc69e=function(_0x124817,_0x1888f2){_0x124817=_0x124817-0x0;var _0x1d80a9=_0x69ec[_0x124817];return _0x1d80a9;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xc69e('0x0'),_0xc69e('0x1'),_0xc69e('0x2')];function createListener(_0xc476b3,_0x3551d5){return function(_0x10e914){_0x3551d5[_0xc69e('0x3')](_0xc476b3,_0x10e914);};}function removeListener(_0xc2512d,_0x416e44){return function(){ChatInteractionEvents[_0xc69e('0x4')](_0xc2512d,_0x416e44);};}exports[_0xc69e('0x5')]=function(_0x4aaf35){for(var _0x573547=0x0,_0x452419=events['length'];_0x573547<_0x452419;_0x573547++){var _0x3c6f32=events[_0x573547];var _0x42c120=createListener(_0xc69e('0x6')+_0x3c6f32,_0x4aaf35);ChatInteractionEvents['on'](_0x3c6f32,_0x42c120);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 3797d51..080533a 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 _0xabb7=['format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','getMessages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/'];(function(_0x22a735,_0x22be08){var _0x25f5b4=function(_0x337cc9){while(--_0x337cc9){_0x22a735['push'](_0x22a735['shift']());}};_0x25f5b4(++_0x22be08);}(_0xabb7,0x8e));var _0x7abb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xabb7[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x7abb('0x0'));var util=require(_0x7abb('0x1'));var path=require(_0x7abb('0x2'));var timeout=require(_0x7abb('0x3'));var express=require(_0x7abb('0x4'));var router=express[_0x7abb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7abb('0x6'));var interaction=require(_0x7abb('0x7'));var config=require(_0x7abb('0x8'));var controller=require(_0x7abb('0x9'));router[_0x7abb('0xa')]('/',auth[_0x7abb('0xb')](),controller[_0x7abb('0xc')]);router[_0x7abb('0xa')]('/describe',auth[_0x7abb('0xb')](),controller[_0x7abb('0xd')]);router[_0x7abb('0xa')](_0x7abb('0xe'),auth[_0x7abb('0xf')](),controller['show']);router[_0x7abb('0xa')](_0x7abb('0x10'),auth[_0x7abb('0xf')](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x7abb('0xb')](),controller[_0x7abb('0x11')]);router[_0x7abb('0xa')]('/:id/my_messages',auth[_0x7abb('0xf')](),controller[_0x7abb('0x12')]);router[_0x7abb('0xa')](_0x7abb('0x13'),auth[_0x7abb('0xb')](),controller[_0x7abb('0x14')]);router['post']('/',auth[_0x7abb('0xb')](),controller[_0x7abb('0x15')]);router[_0x7abb('0x16')](_0x7abb('0x17'),auth[_0x7abb('0xb')](),controller[_0x7abb('0x18')]);var upload=multer({'storage':multer[_0x7abb('0x19')]({'destination':function(_0x2f25fb,_0x1dfca8,_0x420716){_0x420716(null,path[_0x7abb('0x1a')](config[_0x7abb('0x1b')],_0x7abb('0x1c')));},'filename':function(_0x579985,_0x4a14cd,_0x48508c){_0x48508c(null,util[_0x7abb('0x1d')](_0x7abb('0x1e'),Date[_0x7abb('0x1f')](),_0x4a14cd[_0x7abb('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7abb('0x21'),upload[_0x7abb('0x22')](_0x7abb('0x23')),controller[_0x7abb('0x24')]);router[_0x7abb('0x16')](_0x7abb('0x25'),auth[_0x7abb('0xf')](),controller[_0x7abb('0x26')]);router['post'](_0x7abb('0x27'),auth[_0x7abb('0xb')](),interaction[_0x7abb('0x28')](_0x7abb('0x29'),_0x7abb('0x2a')),controller[_0x7abb('0x2b')]);router[_0x7abb('0x2c')](_0x7abb('0xe'),auth['isAuthenticated'](),interaction[_0x7abb('0x28')](_0x7abb('0x29'),_0x7abb('0x2d')),controller[_0x7abb('0x2e')]);router['put'](_0x7abb('0x2f'),controller[_0x7abb('0x30')]);router[_0x7abb('0x2c')](_0x7abb('0x31'),auth['isChatInteractionAuthorized'](),controller['abandon']);router['put'](_0x7abb('0x32'),controller[_0x7abb('0x33')]);router[_0x7abb('0x34')](_0x7abb('0xe'),auth['isAuthenticated'](),interaction[_0x7abb('0x28')]('chat',_0x7abb('0x35')),controller[_0x7abb('0x36')]);router[_0x7abb('0x34')](_0x7abb('0x27'),auth['isAuthenticated'](),controller[_0x7abb('0x37')]);module[_0x7abb('0x38')]=router; \ No newline at end of file +var _0x132c=['download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','get','/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x1cf9d4,_0x5e32b6){var _0x4ed306=function(_0x4c5dcf){while(--_0x4c5dcf){_0x1cf9d4['push'](_0x1cf9d4['shift']());}};_0x4ed306(++_0x5e32b6);}(_0x132c,0x18b));var _0xc132=function(_0x4271b9,_0x12effa){_0x4271b9=_0x4271b9-0x0;var _0x133c0d=_0x132c[_0x4271b9];return _0x133c0d;};'use strict';var multer=require(_0xc132('0x0'));var util=require(_0xc132('0x1'));var path=require(_0xc132('0x2'));var timeout=require(_0xc132('0x3'));var express=require('express');var router=express[_0xc132('0x4')]();var fs_extra=require(_0xc132('0x5'));var auth=require(_0xc132('0x6'));var interaction=require(_0xc132('0x7'));var config=require(_0xc132('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xc132('0x9')](),controller[_0xc132('0xa')]);router['get']('/describe',auth[_0xc132('0x9')](),controller[_0xc132('0xb')]);router['get'](_0xc132('0xc'),auth[_0xc132('0xd')](),controller[_0xc132('0xe')]);router[_0xc132('0xf')](_0xc132('0x10'),auth[_0xc132('0xd')](),controller[_0xc132('0x11')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xc132('0xf')](_0xc132('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xc132('0x13')]);router[_0xc132('0xf')](_0xc132('0x14'),auth[_0xc132('0x9')](),controller[_0xc132('0x15')]);router[_0xc132('0x16')]('/',auth[_0xc132('0x9')](),controller[_0xc132('0x17')]);router['post']('/:id/vidaoo',auth[_0xc132('0x9')](),controller[_0xc132('0x18')]);var upload=multer({'storage':multer[_0xc132('0x19')]({'destination':function(_0x4593ea,_0x1ffc7f,_0x5a8320){_0x5a8320(null,path['join'](config[_0xc132('0x1a')],_0xc132('0x1b')));},'filename':function(_0x3c5683,_0x369e07,_0x5411eb){_0x5411eb(null,util[_0xc132('0x1c')](_0xc132('0x1d'),Date['now'](),_0x369e07[_0xc132('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc132('0x16')](_0xc132('0x1f'),upload[_0xc132('0x20')](_0xc132('0x21')),controller[_0xc132('0x22')]);router['post'](_0xc132('0x23'),auth[_0xc132('0xd')](),controller[_0xc132('0x24')]);router[_0xc132('0x16')]('/:id/tags',auth[_0xc132('0x9')](),interaction[_0xc132('0x25')](_0xc132('0x26'),_0xc132('0x27')),controller[_0xc132('0x28')]);router[_0xc132('0x29')](_0xc132('0xc'),auth[_0xc132('0x9')](),interaction[_0xc132('0x25')](_0xc132('0x26'),_0xc132('0x2a')),controller[_0xc132('0x2b')]);router[_0xc132('0x29')](_0xc132('0x2c'),controller['customUpdate']);router[_0xc132('0x29')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xc132('0x2d')]);router[_0xc132('0x29')](_0xc132('0x2e'),controller['close']);router[_0xc132('0x2f')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xc132('0x26'),'chatinteraction:destroy'),controller[_0xc132('0x30')]);router[_0xc132('0x2f')](_0xc132('0x31'),auth[_0xc132('0x9')](),controller[_0xc132('0x32')]);module[_0xc132('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 060d2d2..3568f49 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 _0xaad4=['TEXT','BOOLEAN','sequelize','exports'];(function(_0x3be47a,_0x20de8a){var _0x195e0b=function(_0x38b88){while(--_0x38b88){_0x3be47a['push'](_0x3be47a['shift']());}};_0x195e0b(++_0x20de8a);}(_0xaad4,0x15e));var _0x4aad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaad4[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4aad('0x0'));module[_0x4aad('0x1')]={'body':{'type':Sequelize[_0x4aad('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4aad('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbf88=['INTEGER','exports','medium','BOOLEAN'];(function(_0x1f5b95,_0x4ffe11){var _0x576970=function(_0x3926ea){while(--_0x3926ea){_0x1f5b95['push'](_0x1f5b95['shift']());}};_0x576970(++_0x4ffe11);}(_0xbf88,0x139));var _0x8bf8=function(_0x408300,_0x33fda2){_0x408300=_0x408300-0x0;var _0x375af0=_0xbf88[_0x408300];return _0x375af0;};'use strict';var Sequelize=require('sequelize');module[_0x8bf8('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8bf8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x8bf8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8bf8('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index f792295..f5bd813 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 _0x9cc5=['nolimit','sort','pick','merge','where','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','autoAssociation','UserProfileResource','resourceId','push','length','FromId','ToId','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty'];(function(_0xe3aaed,_0x3238b9){var _0x5ecbb6=function(_0x48bc8a){while(--_0x48bc8a){_0xe3aaed['push'](_0xe3aaed['shift']());}};_0x5ecbb6(++_0x3238b9);}(_0x9cc5,0x111));var _0x59cc=function(_0xcd61bc,_0x230d59){_0xcd61bc=_0xcd61bc-0x0;var _0x3221c1=_0x9cc5[_0xcd61bc];return _0x3221c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x59cc('0x0'));var jsonpatch=require(_0x59cc('0x1'));var rp=require(_0x59cc('0x2'));var moment=require(_0x59cc('0x3'));var BPromise=require(_0x59cc('0x4'));var Mustache=require(_0x59cc('0x5'));var util=require(_0x59cc('0x6'));var path=require(_0x59cc('0x7'));var sox=require(_0x59cc('0x8'));var csv=require(_0x59cc('0x9'));var ejs=require(_0x59cc('0xa'));var fs=require('fs');var fs_extra=require(_0x59cc('0xb'));var _=require(_0x59cc('0xc'));var squel=require(_0x59cc('0xd'));var crypto=require(_0x59cc('0xe'));var jsforce=require(_0x59cc('0xf'));var deskjs=require(_0x59cc('0x10'));var toCsv=require(_0x59cc('0x9'));var querystring=require(_0x59cc('0x11'));var Papa=require(_0x59cc('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x59cc('0x13'));var as=require(_0x59cc('0x14'));var hardwareService=require(_0x59cc('0x15'));var logger=require(_0x59cc('0x16'))(_0x59cc('0x17'));var utils=require(_0x59cc('0x18'));var config=require(_0x59cc('0x19'));var licenseUtil=require(_0x59cc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x59cc('0x1b')]=_[_0x59cc('0x1c')](config[_0x59cc('0x1b')],{'host':_0x59cc('0x1d'),'port':0x18eb});var socket=require(_0x59cc('0x1e'))(new Redis(config['redis']));require(_0x59cc('0x1f'))['register'](socket);function respondWithStatusCode(_0x39e5e2,_0x53c8e3){_0x53c8e3=_0x53c8e3||0xcc;return function(_0x2dd5d1){if(_0x2dd5d1){return _0x39e5e2['sendStatus'](_0x53c8e3);}return _0x39e5e2[_0x59cc('0x20')](_0x53c8e3)[_0x59cc('0x21')]();};}function respondWithResult(_0x259f66,_0x3bd315){_0x3bd315=_0x3bd315||0xc8;return function(_0x41dfa2){if(_0x41dfa2){return _0x259f66[_0x59cc('0x20')](_0x3bd315)['json'](_0x41dfa2);}};}function respondWithFilteredResult(_0x31018e,_0xc30bd0){return function(_0x5d5540){if(_0x5d5540){var _0x2da55b=typeof _0xc30bd0['offset']===_0x59cc('0x22')&&typeof _0xc30bd0[_0x59cc('0x23')]===_0x59cc('0x22');var _0x3cefa0=_0x5d5540['count'];var _0x1e62cd=_0x2da55b?0x0:_0xc30bd0[_0x59cc('0x24')];var _0x1ca55e=_0x2da55b?_0x5d5540[_0x59cc('0x25')]:_0xc30bd0['offset']+_0xc30bd0[_0x59cc('0x23')];var _0x279099;if(_0x1ca55e>=_0x3cefa0){_0x1ca55e=_0x3cefa0;_0x279099=0xc8;}else{_0x279099=0xce;}_0x31018e['status'](_0x279099);return _0x31018e['set'](_0x59cc('0x26'),_0x1e62cd+'-'+_0x1ca55e+'/'+_0x3cefa0)[_0x59cc('0x27')](_0x5d5540);}return null;};}function patchUpdates(_0xc3476a){return function(_0x27f74d){try{jsonpatch[_0x59cc('0x28')](_0x27f74d,_0xc3476a,!![]);}catch(_0x40f087){return BPromise[_0x59cc('0x29')](_0x40f087);}return _0x27f74d['save']();};}function saveUpdates(_0xcfacc0,_0x5315f4){return function(_0x3d3bee){if(_0x3d3bee){return _0x3d3bee[_0x59cc('0x2a')](_0xcfacc0)['then'](function(_0x33e265){return _0x33e265;});}return null;};}function removeEntity(_0x3532fd,_0x3c509a){return function(_0x115615){if(_0x115615){return _0x115615[_0x59cc('0x2b')]()[_0x59cc('0x2c')](function(){_0x3532fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5826d5,_0x543ecc){return function(_0x16efa5){if(!_0x16efa5){_0x5826d5['sendStatus'](0x194);}return _0x16efa5;};}function handleError(_0x3c19d3,_0x3b4e74){_0x3b4e74=_0x3b4e74||0x1f4;return function(_0x1699b3){logger[_0x59cc('0x2d')](_0x1699b3[_0x59cc('0x2e')]);if(_0x1699b3[_0x59cc('0x2f')]){delete _0x1699b3[_0x59cc('0x2f')];}_0x3c19d3[_0x59cc('0x20')](_0x3b4e74)[_0x59cc('0x30')](_0x1699b3);};}exports['index']=function(_0x326022,_0x1abc48){var _0x40c46b={},_0xc65fd7={},_0x22cb04={'count':0x0,'rows':[]};var _0x10e5f6=_[_0x59cc('0x31')](db[_0x59cc('0x32')][_0x59cc('0x33')],function(_0x2df545){return{'name':_0x2df545[_0x59cc('0x34')],'type':_0x2df545[_0x59cc('0x35')][_0x59cc('0x36')]};});_0xc65fd7['model']=_[_0x59cc('0x31')](_0x10e5f6,_0x59cc('0x2f'));_0xc65fd7[_0x59cc('0x37')]=_[_0x59cc('0x38')](_0x326022[_0x59cc('0x37')]);_0xc65fd7[_0x59cc('0x39')]=_['intersection'](_0xc65fd7[_0x59cc('0x3a')],_0xc65fd7[_0x59cc('0x37')]);_0x40c46b[_0x59cc('0x3b')]=_[_0x59cc('0x3c')](_0xc65fd7[_0x59cc('0x3a')],qs[_0x59cc('0x3d')](_0x326022[_0x59cc('0x37')][_0x59cc('0x3d')]));_0x40c46b['attributes']=_0x40c46b[_0x59cc('0x3b')]['length']?_0x40c46b['attributes']:_0xc65fd7['model'];if(!_0x326022[_0x59cc('0x37')][_0x59cc('0x3e')](_0x59cc('0x3f'))){_0x40c46b['limit']=qs[_0x59cc('0x23')](_0x326022['query'][_0x59cc('0x23')]);_0x40c46b[_0x59cc('0x24')]=qs[_0x59cc('0x24')](_0x326022[_0x59cc('0x37')][_0x59cc('0x24')]);}_0x40c46b['order']=qs[_0x59cc('0x40')](_0x326022['query']['sort']);_0x40c46b['where']=qs[_0x59cc('0x39')](_[_0x59cc('0x41')](_0x326022['query'],_0xc65fd7['filters']),_0x10e5f6);if(_0x326022['query']['filter']){_0x40c46b['where']=_[_0x59cc('0x42')](_0x40c46b[_0x59cc('0x43')],{'$or':_['map'](_0x10e5f6,function(_0x410ef2){if(_0x410ef2['type']!=='VIRTUAL'){var _0x2700f7={};_0x2700f7[_0x410ef2[_0x59cc('0x2f')]]={'$like':'%'+_0x326022[_0x59cc('0x37')][_0x59cc('0x44')]+'%'};return _0x2700f7;}})});}_0x40c46b=_[_0x59cc('0x42')]({},_0x40c46b,_0x326022[_0x59cc('0x45')]);var _0x2019c8={'where':_0x40c46b[_0x59cc('0x43')]};return db['ChatInternalMessage'][_0x59cc('0x25')](_0x2019c8)[_0x59cc('0x2c')](function(_0x3f26ef){_0x22cb04[_0x59cc('0x25')]=_0x3f26ef;if(_0x326022[_0x59cc('0x37')][_0x59cc('0x46')]){_0x40c46b[_0x59cc('0x47')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x59cc('0x48')](_0x40c46b);})[_0x59cc('0x2c')](function(_0x2e11c0){_0x22cb04['rows']=_0x2e11c0;return _0x22cb04;})[_0x59cc('0x2c')](respondWithFilteredResult(_0x1abc48,_0x40c46b))[_0x59cc('0x49')](handleError(_0x1abc48,null));};exports[_0x59cc('0x4a')]=function(_0xd5c8aa,_0x1e2e2c){var _0x321c56={'raw':!![],'where':{'id':_0xd5c8aa[_0x59cc('0x4b')]['id']}},_0x4bb3de={};_0x4bb3de[_0x59cc('0x3a')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x4bb3de['query']=_['keys'](_0xd5c8aa[_0x59cc('0x37')]);_0x4bb3de[_0x59cc('0x39')]=_[_0x59cc('0x3c')](_0x4bb3de[_0x59cc('0x3a')],_0x4bb3de[_0x59cc('0x37')]);_0x321c56['attributes']=_[_0x59cc('0x3c')](_0x4bb3de['model'],qs[_0x59cc('0x3d')](_0xd5c8aa[_0x59cc('0x37')][_0x59cc('0x3d')]));_0x321c56[_0x59cc('0x3b')]=_0x321c56['attributes']['length']?_0x321c56['attributes']:_0x4bb3de['model'];if(_0xd5c8aa[_0x59cc('0x37')][_0x59cc('0x46')]){_0x321c56[_0x59cc('0x47')]=[{'all':!![]}];}_0x321c56=_[_0x59cc('0x42')]({},_0x321c56,_0xd5c8aa[_0x59cc('0x45')]);return db[_0x59cc('0x32')][_0x59cc('0x4c')](_0x321c56)['then'](handleEntityNotFound(_0x1e2e2c,null))[_0x59cc('0x2c')](respondWithResult(_0x1e2e2c,null))[_0x59cc('0x49')](handleError(_0x1e2e2c,null));};exports['create']=function(_0x3c72db,_0x43c22d){return db['ChatInternalMessage'][_0x59cc('0x4d')](_0x3c72db[_0x59cc('0x4e')],{})['then'](respondWithResult(_0x43c22d,0xc9))['catch'](handleError(_0x43c22d,null));};exports[_0x59cc('0x2a')]=function(_0x48211e,_0xe1840){if(_0x48211e['body']['id']){delete _0x48211e[_0x59cc('0x4e')]['id'];}return db[_0x59cc('0x32')][_0x59cc('0x4c')]({'where':{'id':_0x48211e['params']['id']}})[_0x59cc('0x2c')](handleEntityNotFound(_0xe1840,null))[_0x59cc('0x2c')](saveUpdates(_0x48211e[_0x59cc('0x4e')],null))['then'](respondWithResult(_0xe1840,null))['catch'](handleError(_0xe1840,null));};exports['destroy']=function(_0x3680e8,_0x529c3f){return db[_0x59cc('0x32')][_0x59cc('0x4c')]({'where':{'id':_0x3680e8['params']['id']}})[_0x59cc('0x2c')](handleEntityNotFound(_0x529c3f,null))[_0x59cc('0x2c')](removeEntity(_0x529c3f,null))[_0x59cc('0x49')](handleError(_0x529c3f,null));};exports[_0x59cc('0x4f')]=function(_0xf2e5dd,_0x1ff51e){return db[_0x59cc('0x32')]['describe']()[_0x59cc('0x2c')](respondWithResult(_0x1ff51e,null))[_0x59cc('0x49')](handleError(_0x1ff51e,null));};function wrapUser(_0x5ea3d2){return function(_0x5d72ae){var _0x4618d4=_0x5ea3d2[_0x59cc('0x50')]({'plain':!![]});_0x4618d4[_0x59cc('0x51')]=[];if(_0x5d72ae){_0x4618d4[_0x59cc('0x52')]=_0x5d72ae['createdAt'];_0x4618d4[_0x59cc('0x53')]=_0x5d72ae;}else{_0x4618d4[_0x59cc('0x52')]=moment(0x0)[_0x59cc('0x54')](_0x59cc('0x55'));_0x4618d4[_0x59cc('0x53')]={};}return _0x4618d4;};}exports[_0x59cc('0x56')]=function(_0x595018,_0xe07234,_0x1c7141){var _0x1ce1bf=[];return db[_0x59cc('0x57')][_0x59cc('0x48')]({'where':{'role':[_0x59cc('0x58'),_0x59cc('0x59'),'user']},'attributes':['id',_0x59cc('0x5a'),_0x59cc('0x2f'),'role',_0x59cc('0x5b'),_0x59cc('0x5c'),_0x59cc('0x5d'),_0x59cc('0x5e'),'allowmessenger',_0x59cc('0x5f')],'order':qs[_0x59cc('0x40')](_0x59cc('0x60')),'include':[{'model':db[_0x59cc('0x61')],'as':_0x59cc('0x62'),'attributes':['id','name',_0x59cc('0x35')],'through':{'attributes':[]}}]})[_0x59cc('0x2c')](function(_0x2078f6){if(_0x2078f6){var _0x5e2f23=_0x595018[_0x59cc('0x63')][_0x59cc('0x50')]({'plain':!![]});if(!_0x5e2f23)throw new Error(_0x59cc('0x64'));if(_0x5e2f23[_0x59cc('0x65')]===_0x59cc('0x63')){return db['UserProfileSection'][_0x59cc('0x4c')]({'where':{'name':_0x59cc('0x66'),'userProfileId':_0x5e2f23['userProfileId']},'raw':!![]})['then'](function(_0x3f1d9c){if(_0x3f1d9c){if(_0x3f1d9c[_0x59cc('0x67')]===0x0){return db[_0x59cc('0x68')][_0x59cc('0x48')]({'where':{'sectionId':_0x3f1d9c['id']},'raw':!![]})[_0x59cc('0x2c')](function(_0x4d0ee3){var _0x1544f1=[];if(_['isEmpty'](_0x4d0ee3)){_0x1544f1=_[_0x59cc('0x44')](_0x2078f6,function(_0x5dc7ed){if(_0x5dc7ed[_0x59cc('0x65')]!=='agent'){return _0x5dc7ed;}});return _0x1544f1;}else{for(var _0x233060=0x0;_0x233060<_0x2078f6['length'];_0x233060++){var _0x4abd51=_0x2078f6[_0x233060];if(_0x4abd51['role']===_0x59cc('0x58')){var _0x5c3881=_[_0x59cc('0x4c')](_0x4d0ee3,function(_0xdb29d8){return _0xdb29d8[_0x59cc('0x69')]===_0x4abd51['id'];});if(_0x5c3881)_0x1544f1['push'](_0x4abd51);}else{_0x1544f1[_0x59cc('0x6a')](_0x4abd51);}}return _0x1544f1;}});}else{return _0x2078f6;}}else{var _0x1f6b10=_[_0x59cc('0x44')](_0x2078f6,function(_0x56146a){if(_0x56146a[_0x59cc('0x65')]!==_0x59cc('0x58')){return _0x56146a;}});return _0x1f6b10;}});}else{return _0x2078f6;}}})[_0x59cc('0x2c')](function(_0x20c18d){var _0x1b451b=[];if(_0x20c18d){_0x1ce1bf=_0x20c18d;for(var _0x41508b=0x0;_0x41508b<_0x20c18d[_0x59cc('0x6b')];_0x41508b+=0x1){_0x1ce1bf[_0x41508b][_0x59cc('0x51')]=[];_0x1b451b[_0x59cc('0x6a')](db[_0x59cc('0x32')][_0x59cc('0x4c')]({'where':{'FromId':[_0x595018[_0x59cc('0x63')]['id'],_0x20c18d[_0x41508b]['id']],'ToId':[_0x595018[_0x59cc('0x63')]['id'],_0x20c18d[_0x41508b]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x59cc('0x6c'),_0x59cc('0x6d'),'read','body'],'order':qs['sort'](_0x59cc('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x20c18d[_0x41508b])));}return BPromise[_0x59cc('0x6f')](_0x1b451b);}return[];})['then'](function(_0x4eb0fc){return{'rows':_0x4eb0fc,'count':_0x4eb0fc[_0x59cc('0x6b')]};})['then'](respondWithResult(_0xe07234,null))[_0x59cc('0x49')](handleError(_0xe07234,null));}; \ No newline at end of file +var _0xbab8=['api','../../config/utils','../../config/environment','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','includeAll','options','find','create','body','params','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','length','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xbab8,0x1a9));var _0x8bab=function(_0x2afadf,_0x57fb00){_0x2afadf=_0x2afadf-0x0;var _0x3f0571=_0xbab8[_0x2afadf];return _0x3f0571;};'use strict';var emlformat=require(_0x8bab('0x0'));var rimraf=require(_0x8bab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bab('0x2'));var rp=require(_0x8bab('0x3'));var moment=require(_0x8bab('0x4'));var BPromise=require(_0x8bab('0x5'));var Mustache=require(_0x8bab('0x6'));var util=require(_0x8bab('0x7'));var path=require(_0x8bab('0x8'));var sox=require(_0x8bab('0x9'));var csv=require(_0x8bab('0xa'));var ejs=require(_0x8bab('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bab('0xc'));var squel=require('squel');var crypto=require(_0x8bab('0xd'));var jsforce=require(_0x8bab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8bab('0xa'));var querystring=require(_0x8bab('0xf'));var Papa=require(_0x8bab('0x10'));var Redis=require(_0x8bab('0x11'));var authService=require(_0x8bab('0x12'));var qs=require(_0x8bab('0x13'));var as=require(_0x8bab('0x14'));var hardwareService=require(_0x8bab('0x15'));var logger=require(_0x8bab('0x16'))(_0x8bab('0x17'));var utils=require(_0x8bab('0x18'));var config=require(_0x8bab('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8bab('0x1a')]=_['defaults'](config[_0x8bab('0x1a')],{'host':_0x8bab('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bab('0x1a')]));require(_0x8bab('0x1c'))[_0x8bab('0x1d')](socket);function respondWithStatusCode(_0x56f461,_0xf2996e){_0xf2996e=_0xf2996e||0xcc;return function(_0x57d8bf){if(_0x57d8bf){return _0x56f461[_0x8bab('0x1e')](_0xf2996e);}return _0x56f461['status'](_0xf2996e)[_0x8bab('0x1f')]();};}function respondWithResult(_0x51a431,_0x2a674c){_0x2a674c=_0x2a674c||0xc8;return function(_0x1b6937){if(_0x1b6937){return _0x51a431['status'](_0x2a674c)[_0x8bab('0x20')](_0x1b6937);}};}function respondWithFilteredResult(_0x155dad,_0x3088b9){return function(_0x3ec238){if(_0x3ec238){var _0x2f407b=typeof _0x3088b9[_0x8bab('0x21')]===_0x8bab('0x22')&&typeof _0x3088b9[_0x8bab('0x23')]==='undefined';var _0x445b26=_0x3ec238['count'];var _0x511ad4=_0x2f407b?0x0:_0x3088b9[_0x8bab('0x21')];var _0x5cf245=_0x2f407b?_0x3ec238[_0x8bab('0x24')]:_0x3088b9[_0x8bab('0x21')]+_0x3088b9[_0x8bab('0x23')];var _0x5a60cd;if(_0x5cf245>=_0x445b26){_0x5cf245=_0x445b26;_0x5a60cd=0xc8;}else{_0x5a60cd=0xce;}_0x155dad[_0x8bab('0x25')](_0x5a60cd);return _0x155dad[_0x8bab('0x26')](_0x8bab('0x27'),_0x511ad4+'-'+_0x5cf245+'/'+_0x445b26)[_0x8bab('0x20')](_0x3ec238);}return null;};}function patchUpdates(_0x28e208){return function(_0x43b35c){try{jsonpatch[_0x8bab('0x28')](_0x43b35c,_0x28e208,!![]);}catch(_0x3719d0){return BPromise['reject'](_0x3719d0);}return _0x43b35c[_0x8bab('0x29')]();};}function saveUpdates(_0x6dfe4a,_0x5ab9da){return function(_0x48e5e4){if(_0x48e5e4){return _0x48e5e4[_0x8bab('0x2a')](_0x6dfe4a)[_0x8bab('0x2b')](function(_0x4e3780){return _0x4e3780;});}return null;};}function removeEntity(_0x3d9090,_0x2bc8db){return function(_0x2108e9){if(_0x2108e9){return _0x2108e9[_0x8bab('0x2c')]()[_0x8bab('0x2b')](function(){_0x3d9090['status'](0xcc)[_0x8bab('0x1f')]();});}};}function handleEntityNotFound(_0x2a657d,_0x592e4e){return function(_0x401902){if(!_0x401902){_0x2a657d[_0x8bab('0x1e')](0x194);}return _0x401902;};}function handleError(_0x337ef6,_0x3c436e){_0x3c436e=_0x3c436e||0x1f4;return function(_0x28fa1a){logger[_0x8bab('0x2d')](_0x28fa1a['stack']);if(_0x28fa1a[_0x8bab('0x2e')]){delete _0x28fa1a[_0x8bab('0x2e')];}_0x337ef6['status'](_0x3c436e)[_0x8bab('0x2f')](_0x28fa1a);};}exports['index']=function(_0x55dff0,_0x10b031){var _0x490f79={},_0x7713d2={},_0x3b8f9d={'count':0x0,'rows':[]};var _0x37c510=_[_0x8bab('0x30')](db[_0x8bab('0x31')][_0x8bab('0x32')],function(_0x3cc735){return{'name':_0x3cc735[_0x8bab('0x33')],'type':_0x3cc735[_0x8bab('0x34')][_0x8bab('0x35')]};});_0x7713d2[_0x8bab('0x36')]=_['map'](_0x37c510,'name');_0x7713d2[_0x8bab('0x37')]=_[_0x8bab('0x38')](_0x55dff0[_0x8bab('0x37')]);_0x7713d2[_0x8bab('0x39')]=_['intersection'](_0x7713d2[_0x8bab('0x36')],_0x7713d2[_0x8bab('0x37')]);_0x490f79[_0x8bab('0x3a')]=_[_0x8bab('0x3b')](_0x7713d2[_0x8bab('0x36')],qs['fields'](_0x55dff0[_0x8bab('0x37')][_0x8bab('0x3c')]));_0x490f79[_0x8bab('0x3a')]=_0x490f79[_0x8bab('0x3a')]['length']?_0x490f79[_0x8bab('0x3a')]:_0x7713d2[_0x8bab('0x36')];if(!_0x55dff0[_0x8bab('0x37')][_0x8bab('0x3d')]('nolimit')){_0x490f79[_0x8bab('0x23')]=qs['limit'](_0x55dff0[_0x8bab('0x37')][_0x8bab('0x23')]);_0x490f79[_0x8bab('0x21')]=qs[_0x8bab('0x21')](_0x55dff0['query']['offset']);}_0x490f79[_0x8bab('0x3e')]=qs['sort'](_0x55dff0[_0x8bab('0x37')][_0x8bab('0x3f')]);_0x490f79[_0x8bab('0x40')]=qs[_0x8bab('0x39')](_[_0x8bab('0x41')](_0x55dff0[_0x8bab('0x37')],_0x7713d2[_0x8bab('0x39')]),_0x37c510);if(_0x55dff0['query']['filter']){_0x490f79[_0x8bab('0x40')]=_[_0x8bab('0x42')](_0x490f79[_0x8bab('0x40')],{'$or':_[_0x8bab('0x30')](_0x37c510,function(_0x345498){if(_0x345498[_0x8bab('0x34')]!==_0x8bab('0x43')){var _0x1d2387={};_0x1d2387[_0x345498[_0x8bab('0x2e')]]={'$like':'%'+_0x55dff0['query'][_0x8bab('0x44')]+'%'};return _0x1d2387;}})});}_0x490f79=_[_0x8bab('0x42')]({},_0x490f79,_0x55dff0['options']);var _0xa4ee8d={'where':_0x490f79[_0x8bab('0x40')]};return db[_0x8bab('0x31')][_0x8bab('0x24')](_0xa4ee8d)[_0x8bab('0x2b')](function(_0x3a3850){_0x3b8f9d[_0x8bab('0x24')]=_0x3a3850;if(_0x55dff0[_0x8bab('0x37')]['includeAll']){_0x490f79[_0x8bab('0x45')]=[{'all':!![]}];}return db[_0x8bab('0x31')][_0x8bab('0x46')](_0x490f79);})[_0x8bab('0x2b')](function(_0x265282){_0x3b8f9d['rows']=_0x265282;return _0x3b8f9d;})[_0x8bab('0x2b')](respondWithFilteredResult(_0x10b031,_0x490f79))[_0x8bab('0x47')](handleError(_0x10b031,null));};exports['show']=function(_0x5bfefc,_0x1aec2f){var _0xae76f2={'raw':!![],'where':{'id':_0x5bfefc['params']['id']}},_0x461770={};_0x461770['model']=_[_0x8bab('0x38')](db[_0x8bab('0x31')][_0x8bab('0x32')]);_0x461770['query']=_[_0x8bab('0x38')](_0x5bfefc['query']);_0x461770[_0x8bab('0x39')]=_[_0x8bab('0x3b')](_0x461770[_0x8bab('0x36')],_0x461770['query']);_0xae76f2[_0x8bab('0x3a')]=_[_0x8bab('0x3b')](_0x461770[_0x8bab('0x36')],qs[_0x8bab('0x3c')](_0x5bfefc[_0x8bab('0x37')][_0x8bab('0x3c')]));_0xae76f2[_0x8bab('0x3a')]=_0xae76f2[_0x8bab('0x3a')]['length']?_0xae76f2[_0x8bab('0x3a')]:_0x461770[_0x8bab('0x36')];if(_0x5bfefc[_0x8bab('0x37')][_0x8bab('0x48')]){_0xae76f2['include']=[{'all':!![]}];}_0xae76f2=_['merge']({},_0xae76f2,_0x5bfefc[_0x8bab('0x49')]);return db[_0x8bab('0x31')][_0x8bab('0x4a')](_0xae76f2)[_0x8bab('0x2b')](handleEntityNotFound(_0x1aec2f,null))[_0x8bab('0x2b')](respondWithResult(_0x1aec2f,null))[_0x8bab('0x47')](handleError(_0x1aec2f,null));};exports[_0x8bab('0x4b')]=function(_0x54de49,_0x2d7b04){return db['ChatInternalMessage'][_0x8bab('0x4b')](_0x54de49[_0x8bab('0x4c')],{})[_0x8bab('0x2b')](respondWithResult(_0x2d7b04,0xc9))[_0x8bab('0x47')](handleError(_0x2d7b04,null));};exports['update']=function(_0x145c69,_0x4ed244){if(_0x145c69[_0x8bab('0x4c')]['id']){delete _0x145c69[_0x8bab('0x4c')]['id'];}return db['ChatInternalMessage'][_0x8bab('0x4a')]({'where':{'id':_0x145c69[_0x8bab('0x4d')]['id']}})[_0x8bab('0x2b')](handleEntityNotFound(_0x4ed244,null))['then'](saveUpdates(_0x145c69[_0x8bab('0x4c')],null))[_0x8bab('0x2b')](respondWithResult(_0x4ed244,null))[_0x8bab('0x47')](handleError(_0x4ed244,null));};exports['destroy']=function(_0x982fa3,_0x308aa2){return db['ChatInternalMessage'][_0x8bab('0x4a')]({'where':{'id':_0x982fa3[_0x8bab('0x4d')]['id']}})[_0x8bab('0x2b')](handleEntityNotFound(_0x308aa2,null))[_0x8bab('0x2b')](removeEntity(_0x308aa2,null))[_0x8bab('0x47')](handleError(_0x308aa2,null));};exports[_0x8bab('0x4e')]=function(_0x30c108,_0x2e694c){return db[_0x8bab('0x31')]['describe']()[_0x8bab('0x2b')](respondWithResult(_0x2e694c,null))[_0x8bab('0x47')](handleError(_0x2e694c,null));};function wrapUser(_0x1fda55){return function(_0x1766e3){var _0x3b7e8b=_0x1fda55[_0x8bab('0x4f')]({'plain':!![]});_0x3b7e8b[_0x8bab('0x50')]=[];if(_0x1766e3){_0x3b7e8b[_0x8bab('0x51')]=_0x1766e3['createdAt'];_0x3b7e8b[_0x8bab('0x52')]=_0x1766e3;}else{_0x3b7e8b['lastMessageAt']=moment(0x0)[_0x8bab('0x53')](_0x8bab('0x54'));_0x3b7e8b[_0x8bab('0x52')]={};}return _0x3b7e8b;};}exports[_0x8bab('0x55')]=function(_0x8534ad,_0x1a459a,_0xf45e8c){var _0x130dee=[];return db[_0x8bab('0x56')]['findAll']({'where':{'role':[_0x8bab('0x57'),_0x8bab('0x58'),_0x8bab('0x59')]},'attributes':['id','fullname',_0x8bab('0x2e'),_0x8bab('0x5a'),_0x8bab('0x5b'),_0x8bab('0x5c'),_0x8bab('0x5d'),_0x8bab('0x5e'),_0x8bab('0x5f'),_0x8bab('0x60')],'order':qs[_0x8bab('0x3f')](_0x8bab('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x8bab('0x62'),'attributes':['id','name',_0x8bab('0x34')],'through':{'attributes':[]}}]})[_0x8bab('0x2b')](function(_0x16f828){if(_0x16f828){var _0x5f01c1=_0x8534ad['user']['get']({'plain':!![]});if(!_0x5f01c1)throw new Error(_0x8bab('0x63'));if(_0x5f01c1[_0x8bab('0x5a')]===_0x8bab('0x59')){return db[_0x8bab('0x64')][_0x8bab('0x4a')]({'where':{'name':_0x8bab('0x65'),'userProfileId':_0x5f01c1[_0x8bab('0x66')]},'raw':!![]})[_0x8bab('0x2b')](function(_0x523c35){if(_0x523c35){if(_0x523c35[_0x8bab('0x67')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x523c35['id']},'raw':!![]})[_0x8bab('0x2b')](function(_0x44dfa9){var _0x72bb33=[];if(_[_0x8bab('0x68')](_0x44dfa9)){_0x72bb33=_['filter'](_0x16f828,function(_0x51dff6){if(_0x51dff6[_0x8bab('0x5a')]!==_0x8bab('0x57')){return _0x51dff6;}});return _0x72bb33;}else{for(var _0x32046d=0x0;_0x32046d<_0x16f828[_0x8bab('0x69')];_0x32046d++){var _0x684f16=_0x16f828[_0x32046d];if(_0x684f16['role']===_0x8bab('0x57')){var _0x3ecd68=_[_0x8bab('0x4a')](_0x44dfa9,function(_0x24e595){return _0x24e595[_0x8bab('0x6a')]===_0x684f16['id'];});if(_0x3ecd68)_0x72bb33[_0x8bab('0x6b')](_0x684f16);}else{_0x72bb33[_0x8bab('0x6b')](_0x684f16);}}return _0x72bb33;}});}else{return _0x16f828;}}else{var _0x3028ef=_['filter'](_0x16f828,function(_0xf009e0){if(_0xf009e0[_0x8bab('0x5a')]!==_0x8bab('0x57')){return _0xf009e0;}});return _0x3028ef;}});}else{return _0x16f828;}}})[_0x8bab('0x2b')](function(_0x322bad){var _0x4c0507=[];if(_0x322bad){_0x130dee=_0x322bad;for(var _0x5525f0=0x0;_0x5525f0<_0x322bad[_0x8bab('0x69')];_0x5525f0+=0x1){_0x130dee[_0x5525f0][_0x8bab('0x50')]=[];_0x4c0507[_0x8bab('0x6b')](db[_0x8bab('0x31')]['find']({'where':{'FromId':[_0x8534ad[_0x8bab('0x59')]['id'],_0x322bad[_0x5525f0]['id']],'ToId':[_0x8534ad[_0x8bab('0x59')]['id'],_0x322bad[_0x5525f0]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x8bab('0x6c'),_0x8bab('0x6d'),'body'],'order':qs['sort'](_0x8bab('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8bab('0x2b')](wrapUser(_0x322bad[_0x5525f0])));}return BPromise[_0x8bab('0x6f')](_0x4c0507);}return[];})[_0x8bab('0x2b')](function(_0x489722){return{'rows':_0x489722,'count':_0x489722[_0x8bab('0x69')]};})['then'](respondWithResult(_0x1a459a,null))[_0x8bab('0x47')](handleError(_0x1a459a,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 3808b1c..e6cc384 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 _0x1833=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1833,0x1c5));var _0x3183=function(_0x255a85,_0x43ea4c){_0x255a85=_0x255a85-0x0;var _0x5ee089=_0x1833[_0x255a85];return _0x5ee089;};'use strict';var EventEmitter=require(_0x3183('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x3183('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3183('0x2')](0x0);var events={'afterCreate':_0x3183('0x3'),'afterUpdate':_0x3183('0x4'),'afterDestroy':_0x3183('0x5')};function emitEvent(_0xa85c8e){return function(_0x2c7562,_0x3490fe,_0x41278b){ChatInternalMessageEvents[_0x3183('0x6')](_0xa85c8e+':'+_0x2c7562['id'],_0x2c7562);ChatInternalMessageEvents['emit'](_0xa85c8e,_0x2c7562);_0x41278b(null);};}for(var e in events){if(events[_0x3183('0x7')](e)){var event=events[e];ChatInternalMessage[_0x3183('0x8')](e,emitEvent(event));}}module[_0x3183('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xca31=['hasOwnProperty','hook','events','ChatInternalMessage','save','update','remove','emit'];(function(_0x593f71,_0x5a1195){var _0x16496d=function(_0x5ecae7){while(--_0x5ecae7){_0x593f71['push'](_0x593f71['shift']());}};_0x16496d(++_0x5a1195);}(_0xca31,0x18a));var _0x1ca3=function(_0x4b8fc7,_0x5022fc){_0x4b8fc7=_0x4b8fc7-0x0;var _0x249f4a=_0xca31[_0x4b8fc7];return _0x249f4a;};'use strict';var EventEmitter=require(_0x1ca3('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1ca3('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ca3('0x2'),'afterUpdate':_0x1ca3('0x3'),'afterDestroy':_0x1ca3('0x4')};function emitEvent(_0x291c3c){return function(_0x437ff8,_0x3810a8,_0x178368){ChatInternalMessageEvents[_0x1ca3('0x5')](_0x291c3c+':'+_0x437ff8['id'],_0x437ff8);ChatInternalMessageEvents[_0x1ca3('0x5')](_0x291c3c,_0x437ff8);_0x178368(null);};}for(var e in events){if(events[_0x1ca3('0x6')](e)){var event=events[e];ChatInternalMessage[_0x1ca3('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c8e5580..56028bc 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 _0x9220=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','utf8mb4_unicode_ci'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x9220,0x168));var _0x0922=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x9220[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x0922('0x0'));var util=require('util');var logger=require(_0x0922('0x1'))(_0x0922('0x2'));var moment=require(_0x0922('0x3'));var BPromise=require('bluebird');var rp=require(_0x0922('0x4'));var fs=require('fs');var path=require(_0x0922('0x5'));var rimraf=require('rimraf');var config=require(_0x0922('0x6'));var attributes=require(_0x0922('0x7'));module['exports']=function(_0x938df5,_0xf6992e){return _0x938df5['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0922('0x8')});}; \ No newline at end of file +var _0xca9d=['ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','moment','path','./chatInternalMessage.attributes','exports','define'];(function(_0x586b29,_0xd64934){var _0x21ed04=function(_0xe0c5e3){while(--_0xe0c5e3){_0x586b29['push'](_0x586b29['shift']());}};_0x21ed04(++_0xd64934);}(_0xca9d,0x1e3));var _0xdca9=function(_0x225a00,_0x5b9f00){_0x225a00=_0x225a00-0x0;var _0x5f446f=_0xca9d[_0x225a00];return _0x5f446f;};'use strict';var _=require(_0xdca9('0x0'));var util=require(_0xdca9('0x1'));var logger=require(_0xdca9('0x2'))(_0xdca9('0x3'));var moment=require(_0xdca9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdca9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdca9('0x6'));module[_0xdca9('0x7')]=function(_0xf119f0,_0x285b4e){return _0xf119f0[_0xdca9('0x8')](_0xdca9('0x9'),attributes,{'tableName':_0xdca9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdca9('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 62dd7c1..1831067 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 _0x1c73=['stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x17616c,_0x164437){var _0x98b3b9=function(_0x5d153b){while(--_0x5d153b){_0x17616c['push'](_0x17616c['shift']());}};_0x98b3b9(++_0x164437);}(_0x1c73,0x76));var _0x31c7=function(_0x752093,_0x2e2670){_0x752093=_0x752093-0x0;var _0x3a6ab5=_0x1c73[_0x752093];return _0x3a6ab5;};'use strict';var _=require('lodash');var util=require(_0x31c7('0x0'));var moment=require(_0x31c7('0x1'));var BPromise=require('bluebird');var rs=require(_0x31c7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31c7('0x3'))['db'];var utils=require(_0x31c7('0x4'));var logger=require(_0x31c7('0x5'))(_0x31c7('0x6'));var config=require(_0x31c7('0x7'));var jayson=require(_0x31c7('0x8'));var client=jayson[_0x31c7('0x9')][_0x31c7('0xa')]({'port':0x232a});config[_0x31c7('0xb')]=_[_0x31c7('0xc')](config['redis'],{'host':_0x31c7('0xd'),'port':0x18eb});var socket=require(_0x31c7('0xe'))(new Redis(config[_0x31c7('0xb')]));require('./chatInternalMessage.socket')[_0x31c7('0xf')](socket);function respondWithRpcPromise(_0x4fcecc,_0x3adf59,_0x24a6fd){return new BPromise(function(_0x21da54,_0x39cb12){return client['request'](_0x4fcecc,_0x24a6fd)[_0x31c7('0x10')](function(_0x52de0d){logger[_0x31c7('0x11')](_0x31c7('0x12'),_0x3adf59,_0x31c7('0x13'));logger[_0x31c7('0x14')](_0x31c7('0x15'),_0x3adf59,_0x31c7('0x13'),JSON[_0x31c7('0x16')](_0x52de0d));if(_0x52de0d[_0x31c7('0x17')]){if(_0x52de0d[_0x31c7('0x17')][_0x31c7('0x18')]===0x1f4){logger[_0x31c7('0x17')](_0x31c7('0x12'),_0x3adf59,_0x52de0d[_0x31c7('0x17')]['message']);return _0x39cb12(_0x52de0d[_0x31c7('0x17')]['message']);}logger[_0x31c7('0x17')](_0x31c7('0x12'),_0x3adf59,_0x52de0d[_0x31c7('0x17')][_0x31c7('0x19')]);return _0x21da54(_0x52de0d['error'][_0x31c7('0x19')]);}else{logger[_0x31c7('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x3adf59,_0x31c7('0x13'));_0x21da54(_0x52de0d[_0x31c7('0x1a')][_0x31c7('0x19')]);}})[_0x31c7('0x1b')](function(_0x1510c5){logger[_0x31c7('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3adf59,_0x1510c5);_0x39cb12(_0x1510c5);});});} \ No newline at end of file +var _0x0c0d=['rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatInternalMessage,\x20%s,\x20%s','info','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21b57f,_0x9ba5fb){var _0x3dac6f=function(_0x449042){while(--_0x449042){_0x21b57f['push'](_0x21b57f['shift']());}};_0x3dac6f(++_0x9ba5fb);}(_0x0c0d,0x1b4));var _0xd0c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0c0d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd0c0('0x0'));var util=require(_0xd0c0('0x1'));var moment=require(_0xd0c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0c0('0x3'))['db'];var utils=require(_0xd0c0('0x4'));var logger=require(_0xd0c0('0x5'))(_0xd0c0('0x6'));var config=require(_0xd0c0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0c0('0x8')][_0xd0c0('0x9')]({'port':0x232a});config['redis']=_[_0xd0c0('0xa')](config[_0xd0c0('0xb')],{'host':_0xd0c0('0xc'),'port':0x18eb});var socket=require(_0xd0c0('0xd'))(new Redis(config[_0xd0c0('0xb')]));require(_0xd0c0('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c379b,_0x328e84,_0x2ab98e){return new BPromise(function(_0x43cf7f,_0x2a5d3d){return client[_0xd0c0('0xf')](_0x2c379b,_0x2ab98e)[_0xd0c0('0x10')](function(_0x10b009){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x328e84,_0xd0c0('0x11'));logger[_0xd0c0('0x12')](_0xd0c0('0x13'),_0x328e84,_0xd0c0('0x11'),JSON['stringify'](_0x10b009));if(_0x10b009[_0xd0c0('0x14')]){if(_0x10b009['error'][_0xd0c0('0x15')]===0x1f4){logger[_0xd0c0('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x328e84,_0x10b009[_0xd0c0('0x14')][_0xd0c0('0x16')]);return _0x2a5d3d(_0x10b009[_0xd0c0('0x14')][_0xd0c0('0x16')]);}logger['error'](_0xd0c0('0x17'),_0x328e84,_0x10b009[_0xd0c0('0x14')]['message']);return _0x43cf7f(_0x10b009['error']['message']);}else{logger[_0xd0c0('0x18')](_0xd0c0('0x17'),_0x328e84,_0xd0c0('0x11'));_0x43cf7f(_0x10b009[_0xd0c0('0x19')][_0xd0c0('0x16')]);}})['catch'](function(_0x44b068){logger[_0xd0c0('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x328e84,_0x44b068);_0x2a5d3d(_0x44b068);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 255202b..3a09daa 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 _0x0471=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x581c55,_0x5b74d7){var _0x57b8a9=function(_0xc9efc4){while(--_0xc9efc4){_0x581c55['push'](_0x581c55['shift']());}};_0x57b8a9(++_0x5b74d7);}(_0x0471,0x1c6));var _0x1047=function(_0x56fa66,_0x574504){_0x56fa66=_0x56fa66-0x0;var _0x1ba609=_0x0471[_0x56fa66];return _0x1ba609;};'use strict';var ChatInternalMessageEvents=require(_0x1047('0x0'));var events=[_0x1047('0x1'),_0x1047('0x2'),_0x1047('0x3')];function createListener(_0x513545,_0x56ba73){return function(_0x64c078){_0x56ba73[_0x1047('0x4')](_0x513545,_0x64c078);};}function removeListener(_0xe2d334,_0x1e2823){return function(){ChatInternalMessageEvents[_0x1047('0x5')](_0xe2d334,_0x1e2823);};}exports[_0x1047('0x6')]=function(_0x51489a){for(var _0x2a973c=0x0,_0x160369=events[_0x1047('0x7')];_0x2a973c<_0x160369;_0x2a973c++){var _0x450d0e=events[_0x2a973c];var _0x8b1da0=createListener('chatInternalMessage:'+_0x450d0e,_0x51489a);ChatInternalMessageEvents['on'](_0x450d0e,_0x8b1da0);}}; \ No newline at end of file +var _0x22d4=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x22d4,0x19a));var _0x422d=function(_0x268e0c,_0x1ef7d1){_0x268e0c=_0x268e0c-0x0;var _0x97a5fb=_0x22d4[_0x268e0c];return _0x97a5fb;};'use strict';var ChatInternalMessageEvents=require(_0x422d('0x0'));var events=[_0x422d('0x1'),_0x422d('0x2'),_0x422d('0x3')];function createListener(_0x2753b3,_0x51fbf0){return function(_0x504930){_0x51fbf0[_0x422d('0x4')](_0x2753b3,_0x504930);};}function removeListener(_0x55708f,_0x4fc65e){return function(){ChatInternalMessageEvents[_0x422d('0x5')](_0x55708f,_0x4fc65e);};}exports[_0x422d('0x6')]=function(_0x5794c6){for(var _0x41e833=0x0,_0x6bda32=events[_0x422d('0x7')];_0x41e833<_0x6bda32;_0x41e833++){var _0x142212=events[_0x41e833];var _0x3b311f=createListener(_0x422d('0x8')+_0x142212,_0x5794c6);ChatInternalMessageEvents['on'](_0x142212,_0x3b311f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e6ee395..7b23f11 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 _0x4a04=['post','put','/:id','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','/describe','getUsers','show'];(function(_0x52f0d2,_0x4e3071){var _0x23f388=function(_0x238fac){while(--_0x238fac){_0x52f0d2['push'](_0x52f0d2['shift']());}};_0x23f388(++_0x4e3071);}(_0x4a04,0x18c));var _0x44a0=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x4a04[_0x5ac0f0];return _0x4aceec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x44a0('0x0'));var timeout=require(_0x44a0('0x1'));var express=require(_0x44a0('0x2'));var router=express[_0x44a0('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x44a0('0x4'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x44a0('0x5')]('/',auth[_0x44a0('0x6')](),controller['index']);router['get'](_0x44a0('0x7'),auth[_0x44a0('0x6')](),controller['describe']);router['get']('/users',auth[_0x44a0('0x6')](),controller[_0x44a0('0x8')]);router[_0x44a0('0x5')]('/:id',auth[_0x44a0('0x6')](),controller[_0x44a0('0x9')]);router[_0x44a0('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x44a0('0xb')](_0x44a0('0xc'),controller['update']);router['delete'](_0x44a0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x44a0('0xd')]=router; \ No newline at end of file +var _0xda26=['/:id','show','post','create','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe','getUsers'];(function(_0x1311ff,_0x3989de){var _0x33e544=function(_0x3666f1){while(--_0x3666f1){_0x1311ff['push'](_0x1311ff['shift']());}};_0x33e544(++_0x3989de);}(_0xda26,0xf4));var _0x6da2=function(_0x2301b4,_0x3c0cdf){_0x2301b4=_0x2301b4-0x0;var _0x2bd394=_0xda26[_0x2301b4];return _0x2bd394;};'use strict';var multer=require('multer');var util=require(_0x6da2('0x0'));var path=require(_0x6da2('0x1'));var timeout=require(_0x6da2('0x2'));var express=require(_0x6da2('0x3'));var router=express[_0x6da2('0x4')]();var fs_extra=require(_0x6da2('0x5'));var auth=require(_0x6da2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x6da2('0x7')](),controller['index']);router[_0x6da2('0x8')](_0x6da2('0x9'),auth[_0x6da2('0x7')](),controller['describe']);router[_0x6da2('0x8')]('/users',auth[_0x6da2('0x7')](),controller[_0x6da2('0xa')]);router[_0x6da2('0x8')](_0x6da2('0xb'),auth[_0x6da2('0x7')](),controller[_0x6da2('0xc')]);router[_0x6da2('0xd')]('/',auth[_0x6da2('0x7')](),controller[_0x6da2('0xe')]);router['put']('/:id',controller['update']);router[_0x6da2('0xf')](_0x6da2('0xb'),auth[_0x6da2('0x7')](),controller['destroy']);module[_0x6da2('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index ef8e534..34fcbf5 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 _0x7269=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x7269,0x76));var _0x9726=function(_0x40fac1,_0x3eb487){_0x40fac1=_0x40fac1-0x0;var _0x19f481=_0x7269[_0x40fac1];return _0x19f481;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'body':{'type':Sequelize[_0x9726('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9726('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9726('0x4')]('in','out'),'defaultValue':_0x9726('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9726('0x6')]},'providerName':{'type':Sequelize[_0x9726('0x7')]},'providerResponse':{'type':Sequelize[_0x9726('0x2')]}}; \ No newline at end of file +var _0x9c32=['STRING','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x23ff18,_0x24a203){var _0x37f748=function(_0x5b25e5){while(--_0x5b25e5){_0x23ff18['push'](_0x23ff18['shift']());}};_0x37f748(++_0x24a203);}(_0x9c32,0x15d));var _0x29c3=function(_0x3bb0cf,_0x1d2000){_0x3bb0cf=_0x3bb0cf-0x0;var _0x4d88f7=_0x9c32[_0x3bb0cf];return _0x4d88f7;};'use strict';var Sequelize=require(_0x29c3('0x0'));module[_0x29c3('0x1')]={'body':{'type':Sequelize[_0x29c3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x29c3('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x29c3('0x4')),'defaultValue':_0x29c3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x29c3('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 87ba5fd..81fbe2c 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 _0x60f7=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','params','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','acceptmessage','parse','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x60f7,0xf2));var _0x760f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x60f7[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x760f('0x0'));var rimraf=require(_0x760f('0x1'));var zipdir=require(_0x760f('0x2'));var jsonpatch=require(_0x760f('0x3'));var rp=require('request-promise');var moment=require(_0x760f('0x4'));var BPromise=require(_0x760f('0x5'));var Mustache=require('mustache');var util=require(_0x760f('0x6'));var path=require(_0x760f('0x7'));var sox=require(_0x760f('0x8'));var csv=require(_0x760f('0x9'));var ejs=require(_0x760f('0xa'));var fs=require('fs');var fs_extra=require(_0x760f('0xb'));var _=require(_0x760f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x760f('0xd'));var deskjs=require(_0x760f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x760f('0xf'));var Papa=require(_0x760f('0x10'));var Redis=require(_0x760f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x760f('0x12'));var as=require(_0x760f('0x13'));var hardwareService=require(_0x760f('0x14'));var logger=require(_0x760f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x760f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x760f('0x17'))['db'];config[_0x760f('0x18')]=_[_0x760f('0x19')](config[_0x760f('0x18')],{'host':_0x760f('0x1a'),'port':0x18eb});var socket=require(_0x760f('0x1b'))(new Redis(config[_0x760f('0x18')]));require(_0x760f('0x1c'))[_0x760f('0x1d')](socket);var jayson=require(_0x760f('0x1e'));var client=jayson[_0x760f('0x1f')][_0x760f('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x760f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x19e9a4,_0x36cfb2,_0x2a76f8,_0x5094c9){return new BPromise(function(_0x32a834,_0x4f4285){var _0x4acf38=_0x5094c9||client;return _0x4acf38[_0x760f('0x21')](_0x19e9a4,_0x2a76f8)[_0x760f('0x22')](function(_0x48431c){logger[_0x760f('0x23')]('ChatMessage,\x20%s,\x20%s',_0x36cfb2,_0x760f('0x24'));logger[_0x760f('0x25')](_0x760f('0x26'),_0x36cfb2,_0x760f('0x24'),JSON[_0x760f('0x27')](_0x48431c));if(_0x48431c[_0x760f('0x28')]){if(_0x48431c[_0x760f('0x28')]['code']===0x1f4){logger[_0x760f('0x28')](_0x760f('0x29'),_0x36cfb2,_0x48431c[_0x760f('0x28')][_0x760f('0x2a')]);return _0x4f4285(_0x48431c['error'][_0x760f('0x2a')]);}logger['error'](_0x760f('0x29'),_0x36cfb2,_0x48431c[_0x760f('0x28')][_0x760f('0x2a')]);return _0x32a834(_0x48431c[_0x760f('0x28')][_0x760f('0x2a')]);}else{logger['info'](_0x760f('0x29'),_0x36cfb2,_0x760f('0x24'));_0x32a834(_0x48431c[_0x760f('0x2b')][_0x760f('0x2a')]);}})[_0x760f('0x2c')](function(_0x58bfae){logger[_0x760f('0x28')](_0x760f('0x29'),_0x36cfb2,_0x58bfae);_0x4f4285(_0x58bfae);});});}function respondWithStatusCode(_0x4d9e05,_0x4e05f1){_0x4e05f1=_0x4e05f1||0xcc;return function(_0x59ba6f){if(_0x59ba6f){return _0x4d9e05[_0x760f('0x2d')](_0x4e05f1);}return _0x4d9e05[_0x760f('0x2e')](_0x4e05f1)[_0x760f('0x2f')]();};}function respondWithResult(_0xdf26a3,_0x181d37){_0x181d37=_0x181d37||0xc8;return function(_0x264b70){if(_0x264b70){return _0xdf26a3[_0x760f('0x2e')](_0x181d37)[_0x760f('0x30')](_0x264b70);}};}function respondWithFilteredResult(_0x51cb09,_0x70e253){return function(_0x4f3f8c){if(_0x4f3f8c){var _0x1c18bd=typeof _0x70e253[_0x760f('0x31')]==='undefined'&&typeof _0x70e253[_0x760f('0x32')]===_0x760f('0x33');var _0x5a7b34=_0x4f3f8c[_0x760f('0x34')];var _0x138aac=_0x1c18bd?0x0:_0x70e253['offset'];var _0x4e0ac6=_0x1c18bd?_0x4f3f8c[_0x760f('0x34')]:_0x70e253[_0x760f('0x31')]+_0x70e253[_0x760f('0x32')];var _0x51dd99;if(_0x4e0ac6>=_0x5a7b34){_0x4e0ac6=_0x5a7b34;_0x51dd99=0xc8;}else{_0x51dd99=0xce;}_0x51cb09['status'](_0x51dd99);return _0x51cb09[_0x760f('0x35')](_0x760f('0x36'),_0x138aac+'-'+_0x4e0ac6+'/'+_0x5a7b34)[_0x760f('0x30')](_0x4f3f8c);}return null;};}function patchUpdates(_0x174390){return function(_0x58b96a){try{jsonpatch[_0x760f('0x37')](_0x58b96a,_0x174390,!![]);}catch(_0x332b1d){return BPromise[_0x760f('0x38')](_0x332b1d);}return _0x58b96a[_0x760f('0x39')]();};}function saveUpdates(_0x5de0a3,_0x2b9130){return function(_0x125f0c){if(_0x125f0c){return _0x125f0c[_0x760f('0x3a')](_0x5de0a3)[_0x760f('0x22')](function(_0x375513){return _0x375513;});}return null;};}function removeEntity(_0x433c47,_0x47af39){return function(_0x268886){if(_0x268886){return _0x268886[_0x760f('0x3b')]()[_0x760f('0x22')](function(){_0x433c47['status'](0xcc)[_0x760f('0x2f')]();});}};}function handleEntityNotFound(_0x4fd517,_0x1e5be2){return function(_0x30e137){if(!_0x30e137){_0x4fd517[_0x760f('0x2d')](0x194);}return _0x30e137;};}function handleError(_0x3a1b3f,_0x479a37){_0x479a37=_0x479a37||0x1f4;return function(_0xf2a649){logger[_0x760f('0x28')](_0xf2a649[_0x760f('0x3c')]);if(_0xf2a649[_0x760f('0x3d')]){delete _0xf2a649[_0x760f('0x3d')];}_0x3a1b3f['status'](_0x479a37)[_0x760f('0x3e')](_0xf2a649);};}exports[_0x760f('0x3f')]=function(_0x5b371b,_0x1b0548){var _0x357a4c={},_0x5a9314={},_0xa63e3c={'count':0x0,'rows':[]};var _0x2e9999=_[_0x760f('0x40')](db[_0x760f('0x41')][_0x760f('0x42')],function(_0x53d087){return{'name':_0x53d087['fieldName'],'type':_0x53d087[_0x760f('0x43')][_0x760f('0x44')]};});_0x5a9314[_0x760f('0x45')]=_[_0x760f('0x40')](_0x2e9999,_0x760f('0x3d'));_0x5a9314[_0x760f('0x46')]=_[_0x760f('0x47')](_0x5b371b[_0x760f('0x46')]);_0x5a9314[_0x760f('0x48')]=_[_0x760f('0x49')](_0x5a9314['model'],_0x5a9314[_0x760f('0x46')]);_0x357a4c[_0x760f('0x4a')]=_['intersection'](_0x5a9314[_0x760f('0x45')],qs[_0x760f('0x4b')](_0x5b371b['query']['fields']));_0x357a4c['attributes']=_0x357a4c['attributes'][_0x760f('0x4c')]?_0x357a4c[_0x760f('0x4a')]:_0x5a9314[_0x760f('0x45')];if(!_0x5b371b[_0x760f('0x46')]['hasOwnProperty']('nolimit')){_0x357a4c[_0x760f('0x32')]=qs['limit'](_0x5b371b[_0x760f('0x46')][_0x760f('0x32')]);_0x357a4c['offset']=qs[_0x760f('0x31')](_0x5b371b[_0x760f('0x46')]['offset']);}_0x357a4c['order']=qs[_0x760f('0x4d')](_0x5b371b[_0x760f('0x46')]['sort']);_0x357a4c['where']=qs['filters'](_['pick'](_0x5b371b[_0x760f('0x46')],_0x5a9314['filters']),_0x2e9999);if(_0x5b371b[_0x760f('0x46')][_0x760f('0x4e')]){_0x357a4c['where']=_[_0x760f('0x4f')](_0x357a4c[_0x760f('0x50')],{'$or':_[_0x760f('0x40')](_0x2e9999,function(_0x2a348f){if(_0x2a348f[_0x760f('0x43')]!==_0x760f('0x51')){var _0x382c50={};_0x382c50[_0x2a348f[_0x760f('0x3d')]]={'$like':'%'+_0x5b371b[_0x760f('0x46')]['filter']+'%'};return _0x382c50;}})});}_0x357a4c=_[_0x760f('0x4f')]({},_0x357a4c,_0x5b371b[_0x760f('0x52')]);var _0x579dd4={'where':_0x357a4c['where']};return db[_0x760f('0x41')][_0x760f('0x34')](_0x579dd4)[_0x760f('0x22')](function(_0x1c9581){_0xa63e3c[_0x760f('0x34')]=_0x1c9581;if(_0x5b371b['query'][_0x760f('0x53')]){_0x357a4c[_0x760f('0x54')]=[{'all':!![]}];}return db[_0x760f('0x41')][_0x760f('0x55')](_0x357a4c);})[_0x760f('0x22')](function(_0x9ae91){_0xa63e3c[_0x760f('0x56')]=_0x9ae91;return _0xa63e3c;})[_0x760f('0x22')](respondWithFilteredResult(_0x1b0548,_0x357a4c))[_0x760f('0x2c')](handleError(_0x1b0548,null));};exports['show']=function(_0x4c303f,_0x46aac2){var _0x15e3bc={'raw':!![],'where':{'id':_0x4c303f['params']['id']}},_0xda4dc8={};_0xda4dc8[_0x760f('0x45')]=_[_0x760f('0x47')](db[_0x760f('0x41')][_0x760f('0x42')]);_0xda4dc8[_0x760f('0x46')]=_[_0x760f('0x47')](_0x4c303f['query']);_0xda4dc8[_0x760f('0x48')]=_[_0x760f('0x49')](_0xda4dc8['model'],_0xda4dc8[_0x760f('0x46')]);_0x15e3bc[_0x760f('0x4a')]=_[_0x760f('0x49')](_0xda4dc8[_0x760f('0x45')],qs[_0x760f('0x4b')](_0x4c303f[_0x760f('0x46')][_0x760f('0x4b')]));_0x15e3bc[_0x760f('0x4a')]=_0x15e3bc['attributes'][_0x760f('0x4c')]?_0x15e3bc[_0x760f('0x4a')]:_0xda4dc8[_0x760f('0x45')];if(_0x4c303f[_0x760f('0x46')][_0x760f('0x53')]){_0x15e3bc['include']=[{'all':!![]}];}_0x15e3bc=_[_0x760f('0x4f')]({},_0x15e3bc,_0x4c303f['options']);return db[_0x760f('0x41')][_0x760f('0x57')](_0x15e3bc)['then'](handleEntityNotFound(_0x46aac2,null))[_0x760f('0x22')](respondWithResult(_0x46aac2,null))[_0x760f('0x2c')](handleError(_0x46aac2,null));};exports[_0x760f('0x58')]=function(_0x189996,_0x2e6365){return db['ChatMessage'][_0x760f('0x58')](_0x189996[_0x760f('0x59')],{})[_0x760f('0x22')](respondWithResult(_0x2e6365,0xc9))[_0x760f('0x2c')](handleError(_0x2e6365,null));};exports[_0x760f('0x3a')]=function(_0x234875,_0x4c9383){if(_0x234875[_0x760f('0x59')]['id']){delete _0x234875[_0x760f('0x59')]['id'];}return db[_0x760f('0x41')]['find']({'where':{'id':_0x234875[_0x760f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c9383,null))[_0x760f('0x22')](saveUpdates(_0x234875[_0x760f('0x59')],null))[_0x760f('0x22')](respondWithResult(_0x4c9383,null))[_0x760f('0x2c')](handleError(_0x4c9383,null));};exports[_0x760f('0x3b')]=function(_0x1fecec,_0x32122f){return db['ChatMessage'][_0x760f('0x57')]({'where':{'id':_0x1fecec[_0x760f('0x5a')]['id']}})[_0x760f('0x22')](handleEntityNotFound(_0x32122f,null))[_0x760f('0x22')](removeEntity(_0x32122f,null))[_0x760f('0x2c')](handleError(_0x32122f,null));};exports['describe']=function(_0x1fbcc8,_0x3e983c){return db[_0x760f('0x41')]['describe']()[_0x760f('0x22')](respondWithResult(_0x3e983c,null))[_0x760f('0x2c')](handleError(_0x3e983c,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x56d984,_0xab966,_0x1c01c7){var _0x561b4b={'agent':{},'channel':_0x760f('0x5b')};if(_0x56d984[_0x760f('0x59')]['id']){delete _0x56d984[_0x760f('0x59')]['id'];}_0x56d984[_0x760f('0x59')][_0x760f('0x5c')]=!![];_0x56d984[_0x760f('0x59')][_0x760f('0x5d')]=moment()['format'](_0x760f('0x5e'));_0x56d984[_0x760f('0x59')][_0x760f('0x5f')]=_0x56d984[_0x760f('0x59')][_0x760f('0x5f')]||_0x56d984[_0x760f('0x60')]['id'];_0x561b4b['agent']['id']=_0x56d984[_0x760f('0x59')][_0x760f('0x5f')];return db[_0x760f('0x41')][_0x760f('0x57')]({'where':{'id':_0x56d984[_0x760f('0x5a')]['id'],'UserId':null}})[_0x760f('0x22')](handleEntityNotFound(_0xab966,null))[_0x760f('0x22')](saveUpdates(_0x56d984[_0x760f('0x59')],null))[_0x760f('0x22')](function(_0x4a0723){if(_0x4a0723){_0x561b4b[_0x760f('0x2a')]=_0x4a0723['get']({'plain':!![]});return db[_0x760f('0x61')][_0x760f('0x57')]({'where':{'id':_0x4a0723[_0x760f('0x62')]}});}return null;})['then'](handleEntityNotFound(_0xab966,null))[_0x760f('0x22')](function(_0x513f1d){if(_0x513f1d){return _0x513f1d[_0x760f('0x3a')]({'UserId':_0x56d984['body'][_0x760f('0x5f')],'read1stAt':_[_0x760f('0x63')](_0x513f1d[_0x760f('0x64')])?moment()[_0x760f('0x65')](_0x760f('0x5e')):undefined});}return null;})[_0x760f('0x22')](function(_0x3d6db1){if(_0x3d6db1){_0x561b4b[_0x760f('0x66')]=_0x3d6db1['get']({'plain':!![]});interaction_log[_0x760f('0x23')](_0x760f('0x67'),_0x56d984[_0x760f('0x60')]['id'],_0x56d984[_0x760f('0x60')][_0x760f('0x3d')],_0x56d984[_0x760f('0x60')][_0x760f('0x68')],_0x561b4b['interaction']['id'],_0x56d984[_0x760f('0x59')]?JSON[_0x760f('0x27')](_0x56d984[_0x760f('0x59')]):_0x760f('0x69'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x561b4b);}return null;})['then'](function(_0x424c52){var _0x3453aa=_0x760f('0x6a')+_0x424c52['message'][_0x760f('0x6b')];return db[_0x760f('0x6c')][_0x760f('0x46')](_0x3453aa,{'type':db[_0x760f('0x6d')][_0x760f('0x6e')][_0x760f('0x6f')],'raw':!![]})[_0x760f('0x22')](function(_0x4495b6){return _0x4495b6;});})[_0x760f('0x22')](function(_0x21fd20){if(_0x21fd20){_0x561b4b[_0x760f('0x2a')][_0x760f('0x70')]=_0x21fd20[0x0];if(!_0x56d984[_0x760f('0x59')]['UserId'])return;return db[_0x760f('0x71')][_0x760f('0x57')]({'where':{'id':_0x56d984['body'][_0x760f('0x5f')],'role':_0x760f('0x72')},'attributes':['id','name',_0x760f('0x73'),_0x760f('0x74'),'internal'],'raw':!![]});}return null;})[_0x760f('0x22')](function(_0x4a173d){if(!_0x4a173d)return null;_0x561b4b[_0x760f('0x2a')][_0x760f('0x72')]=_0x4a173d;return _0x561b4b;})[_0x760f('0x22')](function(_0x1237ad){if(_0x1237ad){if(_0x56d984[_0x760f('0x59')][_0x760f('0x75')]){_0x561b4b[_0x760f('0x2a')][_0x760f('0x76')]=util[_0x760f('0x65')](_0x760f('0x77'),_0x56d984['user'][_0x760f('0x3d')]);_0x561b4b[_0x760f('0x2a')][_0x760f('0x78')]=_0x561b4b[_0x760f('0x78')];_0x561b4b[_0x760f('0x2a')][_0x760f('0x79')]=_0x561b4b[_0x760f('0x78')];_0x561b4b[_0x760f('0x2a')][_0x760f('0x7a')]=_0x760f('0x7b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x760f('0x7c'),'message':_[_0x760f('0x4f')](_0x561b4b[_0x760f('0x2a')],JSON[_0x760f('0x7d')](_0x561b4b[_0x760f('0x66')]['formData']))},client9002)['then'](function(){return _0x561b4b;});}return _0x561b4b;}return null;})[_0x760f('0x22')](respondWithResult(_0xab966,null))[_0x760f('0x2c')](handleError(_0xab966,null));};var interaction_log=require(_0x760f('0x15'))(_0x760f('0x7e'));exports['reject']=function(_0x54ca1b,_0x3d66c5,_0xd9bbff){var _0x2048e6={'agent':{},'channel':_0x760f('0x5b')};if(_0x54ca1b[_0x760f('0x59')]['id']){delete _0x54ca1b[_0x760f('0x59')]['id'];}_0x54ca1b['body'][_0x760f('0x5f')]=_0x54ca1b[_0x760f('0x59')]['UserId']||_0x54ca1b[_0x760f('0x60')]['id'];_0x2048e6[_0x760f('0x72')]['id']=_0x54ca1b[_0x760f('0x59')][_0x760f('0x5f')];return db[_0x760f('0x41')][_0x760f('0x57')]({'where':{'id':_0x54ca1b[_0x760f('0x5a')]['id'],'UserId':null}})[_0x760f('0x22')](handleEntityNotFound(_0x3d66c5,null))[_0x760f('0x22')](function(_0x410d39){if(_0x410d39){_0x2048e6[_0x760f('0x2a')]=_0x410d39[_0x760f('0x7f')]({'plain':!![]});return db[_0x760f('0x61')]['find']({'where':{'id':_0x410d39['ChatInteractionId']}});}return null;})[_0x760f('0x22')](handleEntityNotFound(_0x3d66c5,null))['then'](function(_0x27d8dc){if(_0x27d8dc){_0x2048e6[_0x760f('0x66')]=_0x27d8dc['get']({'plain':!![]});interaction_log[_0x760f('0x23')](_0x760f('0x80'),_0x54ca1b['user']['id'],_0x54ca1b['user'][_0x760f('0x3d')],_0x54ca1b[_0x760f('0x60')][_0x760f('0x68')],_0x2048e6['interaction']['id'],_0x54ca1b[_0x760f('0x59')]?JSON['stringify'](_0x54ca1b[_0x760f('0x59')]):_0x760f('0x69'));return respondWithRpcPromise(_0x760f('0x81'),_0x760f('0x82'),_0x2048e6);}return null;})[_0x760f('0x22')](function(_0x511eeb){var _0x26a20e=_0x760f('0x6a')+_0x511eeb[_0x760f('0x2a')][_0x760f('0x6b')];return db[_0x760f('0x6c')]['query'](_0x26a20e,{'type':db[_0x760f('0x6d')][_0x760f('0x6e')][_0x760f('0x6f')],'raw':!![]})[_0x760f('0x22')](function(_0x2da5ef){return _0x2da5ef;});})[_0x760f('0x22')](function(_0x6b2d56){if(_0x6b2d56){_0x2048e6['message']['contact']=_0x6b2d56[0x0];if(!_0x54ca1b['body'][_0x760f('0x5f')])return;return db[_0x760f('0x71')][_0x760f('0x57')]({'where':{'id':_0x54ca1b[_0x760f('0x59')]['UserId'],'role':_0x760f('0x72')},'attributes':['id',_0x760f('0x3d'),_0x760f('0x73'),_0x760f('0x74'),'internal'],'raw':!![]});}return null;})[_0x760f('0x22')](function(_0x35562f){if(!_0x35562f)return null;_0x2048e6[_0x760f('0x2a')]['agent']=_0x35562f;return _0x2048e6;})[_0x760f('0x22')](function(_0x34d7d7){if(_0x34d7d7){_0x34d7d7[_0x760f('0x2a')][_0x760f('0x76')]=util[_0x760f('0x65')](_0x760f('0x77'),_0x54ca1b[_0x760f('0x60')][_0x760f('0x3d')]);_0x34d7d7['message'][_0x760f('0x78')]=_0x2048e6[_0x760f('0x78')];_0x34d7d7[_0x760f('0x2a')]['motionChannel']=_0x2048e6[_0x760f('0x78')];_0x34d7d7[_0x760f('0x2a')]['event']=_0x760f('0x38');respondWithRpcPromise(_0x760f('0x83'),_0x760f('0x83'),{'event':_0x760f('0x84'),'message':_[_0x760f('0x4f')](_0x2048e6[_0x760f('0x2a')],JSON[_0x760f('0x7d')](_0x2048e6[_0x760f('0x66')]['formData']))},client9002);return _0x2048e6;}return null;})['then'](respondWithResult(_0x3d66c5,null))[_0x760f('0x2c')](handleError(_0x3d66c5,null));}; \ No newline at end of file +var _0x9328=['create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','RejectMessage','rejectMessage','contact','interface','reject','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9328,0x132));var _0x8932=function(_0x4619e0,_0x1a3451){_0x4619e0=_0x4619e0-0x0;var _0x47fe6e=_0x9328[_0x4619e0];return _0x47fe6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8932('0x0'));var zipdir=require(_0x8932('0x1'));var jsonpatch=require(_0x8932('0x2'));var rp=require(_0x8932('0x3'));var moment=require('moment');var BPromise=require(_0x8932('0x4'));var Mustache=require(_0x8932('0x5'));var util=require(_0x8932('0x6'));var path=require(_0x8932('0x7'));var sox=require('sox');var csv=require(_0x8932('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8932('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8932('0xa'));var jsforce=require(_0x8932('0xb'));var deskjs=require(_0x8932('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8932('0xd'));var Redis=require(_0x8932('0xe'));var authService=require(_0x8932('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8932('0x10'));var logger=require(_0x8932('0x11'))(_0x8932('0x12'));var utils=require(_0x8932('0x13'));var config=require(_0x8932('0x14'));var licenseUtil=require(_0x8932('0x15'));var db=require(_0x8932('0x16'))['db'];config['redis']=_['defaults'](config[_0x8932('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8932('0x18'))(new Redis(config[_0x8932('0x17')]));require('./chatMessage.socket')[_0x8932('0x19')](socket);var jayson=require(_0x8932('0x1a'));var client=jayson[_0x8932('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x8932('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4075,_0x275a4a,_0x549a29,_0x49e8c3){return new BPromise(function(_0x32799b,_0x95a154){var _0xda5ae1=_0x49e8c3||client;return _0xda5ae1[_0x8932('0x1c')](_0x1b4075,_0x549a29)[_0x8932('0x1d')](function(_0x321b14){logger[_0x8932('0x1e')](_0x8932('0x1f'),_0x275a4a,_0x8932('0x20'));logger['debug'](_0x8932('0x21'),_0x275a4a,'request\x20sent',JSON['stringify'](_0x321b14));if(_0x321b14[_0x8932('0x22')]){if(_0x321b14[_0x8932('0x22')][_0x8932('0x23')]===0x1f4){logger['error'](_0x8932('0x1f'),_0x275a4a,_0x321b14[_0x8932('0x22')][_0x8932('0x24')]);return _0x95a154(_0x321b14[_0x8932('0x22')][_0x8932('0x24')]);}logger[_0x8932('0x22')](_0x8932('0x1f'),_0x275a4a,_0x321b14[_0x8932('0x22')][_0x8932('0x24')]);return _0x32799b(_0x321b14[_0x8932('0x22')]['message']);}else{logger[_0x8932('0x1e')](_0x8932('0x1f'),_0x275a4a,'request\x20sent');_0x32799b(_0x321b14['result'][_0x8932('0x24')]);}})[_0x8932('0x25')](function(_0x59b5d5){logger[_0x8932('0x22')](_0x8932('0x1f'),_0x275a4a,_0x59b5d5);_0x95a154(_0x59b5d5);});});}function respondWithStatusCode(_0x4e579f,_0x49b2e5){_0x49b2e5=_0x49b2e5||0xcc;return function(_0x56d750){if(_0x56d750){return _0x4e579f[_0x8932('0x26')](_0x49b2e5);}return _0x4e579f[_0x8932('0x27')](_0x49b2e5)[_0x8932('0x28')]();};}function respondWithResult(_0x2203b4,_0x216126){_0x216126=_0x216126||0xc8;return function(_0x21dcfc){if(_0x21dcfc){return _0x2203b4['status'](_0x216126)[_0x8932('0x29')](_0x21dcfc);}};}function respondWithFilteredResult(_0x1f1242,_0x91d35c){return function(_0x5df794){if(_0x5df794){var _0x32e0ea=typeof _0x91d35c['offset']===_0x8932('0x2a')&&typeof _0x91d35c[_0x8932('0x2b')]===_0x8932('0x2a');var _0x14c77d=_0x5df794[_0x8932('0x2c')];var _0x396ec6=_0x32e0ea?0x0:_0x91d35c['offset'];var _0x4a702c=_0x32e0ea?_0x5df794[_0x8932('0x2c')]:_0x91d35c[_0x8932('0x2d')]+_0x91d35c[_0x8932('0x2b')];var _0x2cf174;if(_0x4a702c>=_0x14c77d){_0x4a702c=_0x14c77d;_0x2cf174=0xc8;}else{_0x2cf174=0xce;}_0x1f1242[_0x8932('0x27')](_0x2cf174);return _0x1f1242[_0x8932('0x2e')](_0x8932('0x2f'),_0x396ec6+'-'+_0x4a702c+'/'+_0x14c77d)['json'](_0x5df794);}return null;};}function patchUpdates(_0x1bed0f){return function(_0x38a2ed){try{jsonpatch[_0x8932('0x30')](_0x38a2ed,_0x1bed0f,!![]);}catch(_0x4ed93c){return BPromise['reject'](_0x4ed93c);}return _0x38a2ed[_0x8932('0x31')]();};}function saveUpdates(_0x39a9fd,_0x49fc89){return function(_0x10a24b){if(_0x10a24b){return _0x10a24b[_0x8932('0x32')](_0x39a9fd)[_0x8932('0x1d')](function(_0x39f30c){return _0x39f30c;});}return null;};}function removeEntity(_0x472cf7,_0x29df97){return function(_0x560694){if(_0x560694){return _0x560694[_0x8932('0x33')]()['then'](function(){_0x472cf7[_0x8932('0x27')](0xcc)[_0x8932('0x28')]();});}};}function handleEntityNotFound(_0x41f2d9,_0x1f1893){return function(_0x52e3a8){if(!_0x52e3a8){_0x41f2d9[_0x8932('0x26')](0x194);}return _0x52e3a8;};}function handleError(_0x5f1c5d,_0x5aef9e){_0x5aef9e=_0x5aef9e||0x1f4;return function(_0x47ab1d){logger[_0x8932('0x22')](_0x47ab1d[_0x8932('0x34')]);if(_0x47ab1d['name']){delete _0x47ab1d['name'];}_0x5f1c5d[_0x8932('0x27')](_0x5aef9e)['send'](_0x47ab1d);};}exports[_0x8932('0x35')]=function(_0x5d620a,_0x586564){var _0x1c2c40={},_0x304f7d={},_0x334701={'count':0x0,'rows':[]};var _0x5de2c9=_[_0x8932('0x36')](db[_0x8932('0x37')][_0x8932('0x38')],function(_0x25e0ea){return{'name':_0x25e0ea[_0x8932('0x39')],'type':_0x25e0ea[_0x8932('0x3a')][_0x8932('0x3b')]};});_0x304f7d[_0x8932('0x3c')]=_['map'](_0x5de2c9,_0x8932('0x3d'));_0x304f7d[_0x8932('0x3e')]=_[_0x8932('0x3f')](_0x5d620a[_0x8932('0x3e')]);_0x304f7d[_0x8932('0x40')]=_[_0x8932('0x41')](_0x304f7d['model'],_0x304f7d[_0x8932('0x3e')]);_0x1c2c40[_0x8932('0x42')]=_['intersection'](_0x304f7d['model'],qs[_0x8932('0x43')](_0x5d620a[_0x8932('0x3e')][_0x8932('0x43')]));_0x1c2c40['attributes']=_0x1c2c40[_0x8932('0x42')][_0x8932('0x44')]?_0x1c2c40[_0x8932('0x42')]:_0x304f7d[_0x8932('0x3c')];if(!_0x5d620a['query'][_0x8932('0x45')](_0x8932('0x46'))){_0x1c2c40[_0x8932('0x2b')]=qs[_0x8932('0x2b')](_0x5d620a[_0x8932('0x3e')][_0x8932('0x2b')]);_0x1c2c40['offset']=qs[_0x8932('0x2d')](_0x5d620a[_0x8932('0x3e')]['offset']);}_0x1c2c40['order']=qs[_0x8932('0x47')](_0x5d620a[_0x8932('0x3e')]['sort']);_0x1c2c40[_0x8932('0x48')]=qs['filters'](_[_0x8932('0x49')](_0x5d620a[_0x8932('0x3e')],_0x304f7d[_0x8932('0x40')]),_0x5de2c9);if(_0x5d620a[_0x8932('0x3e')][_0x8932('0x4a')]){_0x1c2c40[_0x8932('0x48')]=_[_0x8932('0x4b')](_0x1c2c40['where'],{'$or':_[_0x8932('0x36')](_0x5de2c9,function(_0x19df57){if(_0x19df57[_0x8932('0x3a')]!==_0x8932('0x4c')){var _0x46bb42={};_0x46bb42[_0x19df57['name']]={'$like':'%'+_0x5d620a[_0x8932('0x3e')]['filter']+'%'};return _0x46bb42;}})});}_0x1c2c40=_[_0x8932('0x4b')]({},_0x1c2c40,_0x5d620a[_0x8932('0x4d')]);var _0x2b8105={'where':_0x1c2c40[_0x8932('0x48')]};return db['ChatMessage']['count'](_0x2b8105)[_0x8932('0x1d')](function(_0x59f875){_0x334701[_0x8932('0x2c')]=_0x59f875;if(_0x5d620a[_0x8932('0x3e')][_0x8932('0x4e')]){_0x1c2c40[_0x8932('0x4f')]=[{'all':!![]}];}return db[_0x8932('0x37')][_0x8932('0x50')](_0x1c2c40);})['then'](function(_0x249f83){_0x334701['rows']=_0x249f83;return _0x334701;})[_0x8932('0x1d')](respondWithFilteredResult(_0x586564,_0x1c2c40))['catch'](handleError(_0x586564,null));};exports[_0x8932('0x51')]=function(_0xda7ddf,_0x2c0d00){var _0x4caedf={'raw':!![],'where':{'id':_0xda7ddf[_0x8932('0x52')]['id']}},_0x453292={};_0x453292['model']=_[_0x8932('0x3f')](db[_0x8932('0x37')][_0x8932('0x38')]);_0x453292['query']=_[_0x8932('0x3f')](_0xda7ddf[_0x8932('0x3e')]);_0x453292[_0x8932('0x40')]=_[_0x8932('0x41')](_0x453292[_0x8932('0x3c')],_0x453292[_0x8932('0x3e')]);_0x4caedf[_0x8932('0x42')]=_[_0x8932('0x41')](_0x453292['model'],qs[_0x8932('0x43')](_0xda7ddf[_0x8932('0x3e')][_0x8932('0x43')]));_0x4caedf[_0x8932('0x42')]=_0x4caedf[_0x8932('0x42')]['length']?_0x4caedf[_0x8932('0x42')]:_0x453292[_0x8932('0x3c')];if(_0xda7ddf[_0x8932('0x3e')][_0x8932('0x4e')]){_0x4caedf[_0x8932('0x4f')]=[{'all':!![]}];}_0x4caedf=_['merge']({},_0x4caedf,_0xda7ddf[_0x8932('0x4d')]);return db['ChatMessage'][_0x8932('0x53')](_0x4caedf)[_0x8932('0x1d')](handleEntityNotFound(_0x2c0d00,null))[_0x8932('0x1d')](respondWithResult(_0x2c0d00,null))['catch'](handleError(_0x2c0d00,null));};exports[_0x8932('0x54')]=function(_0x3f3318,_0x1ddc01){return db[_0x8932('0x37')][_0x8932('0x54')](_0x3f3318[_0x8932('0x55')],{})[_0x8932('0x1d')](respondWithResult(_0x1ddc01,0xc9))['catch'](handleError(_0x1ddc01,null));};exports[_0x8932('0x32')]=function(_0x183718,_0x4a90dd){if(_0x183718[_0x8932('0x55')]['id']){delete _0x183718[_0x8932('0x55')]['id'];}return db[_0x8932('0x37')][_0x8932('0x53')]({'where':{'id':_0x183718['params']['id']}})[_0x8932('0x1d')](handleEntityNotFound(_0x4a90dd,null))[_0x8932('0x1d')](saveUpdates(_0x183718[_0x8932('0x55')],null))[_0x8932('0x1d')](respondWithResult(_0x4a90dd,null))[_0x8932('0x25')](handleError(_0x4a90dd,null));};exports[_0x8932('0x33')]=function(_0x57af6c,_0x49b9c4){return db['ChatMessage']['find']({'where':{'id':_0x57af6c[_0x8932('0x52')]['id']}})[_0x8932('0x1d')](handleEntityNotFound(_0x49b9c4,null))[_0x8932('0x1d')](removeEntity(_0x49b9c4,null))[_0x8932('0x25')](handleError(_0x49b9c4,null));};exports[_0x8932('0x56')]=function(_0x5a47dc,_0x4296dd){return db[_0x8932('0x37')][_0x8932('0x56')]()['then'](respondWithResult(_0x4296dd,null))['catch'](handleError(_0x4296dd,null));};var interaction_log=require(_0x8932('0x11'))(_0x8932('0x57'));exports[_0x8932('0x58')]=function(_0x5cd1ab,_0x4d2654,_0xa12ca){var _0x292faf={'agent':{},'channel':_0x8932('0x59')};if(_0x5cd1ab[_0x8932('0x55')]['id']){delete _0x5cd1ab[_0x8932('0x55')]['id'];}_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5a')]=!![];_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5b')]=moment()[_0x8932('0x5c')](_0x8932('0x5d'));_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')]=_0x5cd1ab['body'][_0x8932('0x5e')]||_0x5cd1ab[_0x8932('0x5f')]['id'];_0x292faf['agent']['id']=_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')];return db[_0x8932('0x37')]['find']({'where':{'id':_0x5cd1ab[_0x8932('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d2654,null))[_0x8932('0x1d')](saveUpdates(_0x5cd1ab[_0x8932('0x55')],null))['then'](function(_0x167b85){if(_0x167b85){_0x292faf[_0x8932('0x24')]=_0x167b85[_0x8932('0x60')]({'plain':!![]});return db[_0x8932('0x61')][_0x8932('0x53')]({'where':{'id':_0x167b85[_0x8932('0x62')]}});}return null;})[_0x8932('0x1d')](handleEntityNotFound(_0x4d2654,null))['then'](function(_0x1f55fd){if(_0x1f55fd){return _0x1f55fd[_0x8932('0x32')]({'UserId':_0x5cd1ab['body'][_0x8932('0x5e')],'read1stAt':_[_0x8932('0x63')](_0x1f55fd[_0x8932('0x64')])?moment()[_0x8932('0x5c')](_0x8932('0x5d')):undefined});}return null;})[_0x8932('0x1d')](function(_0x182ef4){if(_0x182ef4){_0x292faf[_0x8932('0x65')]=_0x182ef4[_0x8932('0x60')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5cd1ab[_0x8932('0x5f')]['id'],_0x5cd1ab[_0x8932('0x5f')][_0x8932('0x3d')],_0x5cd1ab[_0x8932('0x5f')][_0x8932('0x66')],_0x292faf['interaction']['id'],_0x5cd1ab[_0x8932('0x55')]?JSON['stringify'](_0x5cd1ab[_0x8932('0x55')]):_0x8932('0x67'));return respondWithRpcPromise(_0x8932('0x68'),'acceptMessage',_0x292faf);}return null;})[_0x8932('0x1d')](function(_0x1c6408){var _0x352d7a=_0x8932('0x69')+_0x1c6408[_0x8932('0x24')][_0x8932('0x6a')];return db[_0x8932('0x6b')][_0x8932('0x3e')](_0x352d7a,{'type':db[_0x8932('0x6c')][_0x8932('0x6d')][_0x8932('0x6e')],'raw':!![]})[_0x8932('0x1d')](function(_0x2940e5){return _0x2940e5;});})[_0x8932('0x1d')](function(_0x2309ae){if(_0x2309ae){_0x292faf[_0x8932('0x24')]['contact']=_0x2309ae[0x0];if(!_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')])return;return db[_0x8932('0x6f')][_0x8932('0x53')]({'where':{'id':_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')],'role':_0x8932('0x70')},'attributes':['id',_0x8932('0x3d'),_0x8932('0x71'),_0x8932('0x72'),_0x8932('0x73')],'raw':!![]});}return null;})[_0x8932('0x1d')](function(_0x4f5584){if(!_0x4f5584)return null;_0x292faf[_0x8932('0x24')][_0x8932('0x70')]=_0x4f5584;return _0x292faf;})[_0x8932('0x1d')](function(_0x1066ac){if(_0x1066ac){if(_0x5cd1ab['body'][_0x8932('0x74')]){_0x292faf[_0x8932('0x24')]['interface']=util[_0x8932('0x5c')](_0x8932('0x75'),_0x5cd1ab['user'][_0x8932('0x3d')]);_0x292faf[_0x8932('0x24')][_0x8932('0x76')]=_0x292faf[_0x8932('0x76')];_0x292faf[_0x8932('0x24')]['motionChannel']=_0x292faf[_0x8932('0x76')];_0x292faf[_0x8932('0x24')][_0x8932('0x77')]=_0x8932('0x58');return respondWithRpcPromise('EventManager',_0x8932('0x78'),{'event':_0x8932('0x79'),'message':_[_0x8932('0x4b')](_0x292faf[_0x8932('0x24')],JSON[_0x8932('0x7a')](_0x292faf['interaction'][_0x8932('0x7b')]))},client9002)['then'](function(){return _0x292faf;});}return _0x292faf;}return null;})['then'](respondWithResult(_0x4d2654,null))[_0x8932('0x25')](handleError(_0x4d2654,null));};var interaction_log=require(_0x8932('0x11'))(_0x8932('0x57'));exports['reject']=function(_0x530551,_0x45c9f1,_0x6399f5){var _0x1b0ec9={'agent':{},'channel':_0x8932('0x59')};if(_0x530551[_0x8932('0x55')]['id']){delete _0x530551['body']['id'];}_0x530551[_0x8932('0x55')][_0x8932('0x5e')]=_0x530551[_0x8932('0x55')][_0x8932('0x5e')]||_0x530551['user']['id'];_0x1b0ec9['agent']['id']=_0x530551[_0x8932('0x55')]['UserId'];return db[_0x8932('0x37')]['find']({'where':{'id':_0x530551[_0x8932('0x52')]['id'],'UserId':null}})[_0x8932('0x1d')](handleEntityNotFound(_0x45c9f1,null))[_0x8932('0x1d')](function(_0x862868){if(_0x862868){_0x1b0ec9['message']=_0x862868['get']({'plain':!![]});return db[_0x8932('0x61')][_0x8932('0x53')]({'where':{'id':_0x862868[_0x8932('0x62')]}});}return null;})[_0x8932('0x1d')](handleEntityNotFound(_0x45c9f1,null))['then'](function(_0x63e50d){if(_0x63e50d){_0x1b0ec9[_0x8932('0x65')]=_0x63e50d['get']({'plain':!![]});interaction_log[_0x8932('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x530551[_0x8932('0x5f')]['id'],_0x530551[_0x8932('0x5f')][_0x8932('0x3d')],_0x530551[_0x8932('0x5f')]['role'],_0x1b0ec9[_0x8932('0x65')]['id'],_0x530551[_0x8932('0x55')]?JSON['stringify'](_0x530551['body']):'null');return respondWithRpcPromise(_0x8932('0x7c'),_0x8932('0x7d'),_0x1b0ec9);}return null;})['then'](function(_0x30c847){var _0x1a5027='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30c847[_0x8932('0x24')][_0x8932('0x6a')];return db[_0x8932('0x6b')][_0x8932('0x3e')](_0x1a5027,{'type':db[_0x8932('0x6c')][_0x8932('0x6d')][_0x8932('0x6e')],'raw':!![]})[_0x8932('0x1d')](function(_0x42de10){return _0x42de10;});})['then'](function(_0x162b36){if(_0x162b36){_0x1b0ec9[_0x8932('0x24')][_0x8932('0x7e')]=_0x162b36[0x0];if(!_0x530551[_0x8932('0x55')][_0x8932('0x5e')])return;return db[_0x8932('0x6f')]['find']({'where':{'id':_0x530551['body'][_0x8932('0x5e')],'role':_0x8932('0x70')},'attributes':['id',_0x8932('0x3d'),_0x8932('0x71'),_0x8932('0x72'),_0x8932('0x73')],'raw':!![]});}return null;})[_0x8932('0x1d')](function(_0x28e520){if(!_0x28e520)return null;_0x1b0ec9[_0x8932('0x24')][_0x8932('0x70')]=_0x28e520;return _0x1b0ec9;})['then'](function(_0x570fe7){if(_0x570fe7){_0x570fe7['message'][_0x8932('0x7f')]=util[_0x8932('0x5c')]('SIP/%s',_0x530551[_0x8932('0x5f')][_0x8932('0x3d')]);_0x570fe7[_0x8932('0x24')][_0x8932('0x76')]=_0x1b0ec9[_0x8932('0x76')];_0x570fe7['message']['motionChannel']=_0x1b0ec9[_0x8932('0x76')];_0x570fe7['message'][_0x8932('0x77')]=_0x8932('0x80');respondWithRpcPromise('EventManager',_0x8932('0x78'),{'event':_0x8932('0x81'),'message':_[_0x8932('0x4b')](_0x1b0ec9[_0x8932('0x24')],JSON[_0x8932('0x7a')](_0x1b0ec9['interaction'][_0x8932('0x7b')]))},client9002);return _0x1b0ec9;}return null;})['then'](respondWithResult(_0x45c9f1,null))[_0x8932('0x25')](handleError(_0x45c9f1,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 5228969..63a9440 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 _0x26b4=['../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0xbf9116,_0x1cb5b9){var _0x2dac1a=function(_0x1094f9){while(--_0x1094f9){_0xbf9116['push'](_0xbf9116['shift']());}};_0x2dac1a(++_0x1cb5b9);}(_0x26b4,0x1c6));var _0x426b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x26b4[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0x426b('0x0'));var ChatMessage=require(_0x426b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x426b('0x2')](0x0);var events={'afterCreate':_0x426b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x14fb08){return function(_0x438327,_0x1f7ee0,_0x55be5c){ChatMessageEvents[_0x426b('0x4')](_0x14fb08+':'+_0x438327['id'],_0x438327);ChatMessageEvents['emit'](_0x14fb08,_0x438327);_0x55be5c(null);};}for(var e in events){if(events[_0x426b('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x426b('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x0305=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x141e24,_0x371df2){var _0x4ca264=function(_0x1ca374){while(--_0x1ca374){_0x141e24['push'](_0x141e24['shift']());}};_0x4ca264(++_0x371df2);}(_0x0305,0x1c2));var _0x5030=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x0305[_0x186376];return _0x2dbdd9;};'use strict';var EventEmitter=require(_0x5030('0x0'));var ChatMessage=require(_0x5030('0x1'))['db'][_0x5030('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5030('0x3')](0x0);var events={'afterCreate':_0x5030('0x4'),'afterUpdate':'update','afterDestroy':_0x5030('0x5')};function emitEvent(_0x549538){return function(_0x2be260,_0x5902b7,_0x57916e){ChatMessageEvents[_0x5030('0x6')](_0x549538+':'+_0x2be260['id'],_0x2be260);ChatMessageEvents['emit'](_0x549538,_0x2be260);_0x57916e(null);};}for(var e in events){if(events[_0x5030('0x7')](e)){var event=events[e];ChatMessage[_0x5030('0x8')](e,emitEvent(event));}}module[_0x5030('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index c9714ef..0438cdc 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 _0x677b=['define','fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0x677b,0xc8));var _0xb677=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x677b[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xb677('0x0'));var util=require(_0xb677('0x1'));var logger=require(_0xb677('0x2'))(_0xb677('0x3'));var moment=require('moment');var BPromise=require(_0xb677('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb677('0x5'));var config=require(_0xb677('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1810ec,_0x1cb5f9){return _0x1810ec[_0xb677('0x7')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xb677('0x8'),'fields':[_0xb677('0x9')],'type':_0xb677('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42b7db,_0x5e0a78,_0x178ea7){var _0x1449fd=_0x1810ec[_0xb677('0xb')];var _0x3dba01=_0x42b7db['get']({'plain':!![]});if(_0x3dba01['direction'][_0xb677('0xc')]()==='in'||_0x3dba01[_0xb677('0xd')]['toLowerCase']()==='out'&&!_0x3dba01[_0xb677('0xe')]&&!_[_0xb677('0xf')](_0x3dba01[_0xb677('0x10')])){_0x1449fd[_0xb677('0x11')][_0xb677('0x12')]({'where':{'id':_0x3dba01['ChatInteractionId']}})[_0xb677('0x13')](function(_0x6c1dc1){if(_0x6c1dc1){_0x6c1dc1[_0xb677('0x14')]({'lastMsgAt':_0x3dba01[_0xb677('0x15')],'lastMsgDirection':_0x3dba01[_0xb677('0xd')]['toLowerCase']()});}})[_0xb677('0x16')](function(_0xe0ba6a){console['error'](_0xe0ba6a);});}_0x178ea7();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf418=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','get','direction','toLowerCase','out'];(function(_0x407398,_0x4555b0){var _0x5f2b5a=function(_0x38f13c){while(--_0x38f13c){_0x407398['push'](_0x407398['shift']());}};_0x5f2b5a(++_0x4555b0);}(_0xf418,0x1e3));var _0x8f41=function(_0x367800,_0x250785){_0x367800=_0x367800-0x0;var _0x30be0c=_0xf418[_0x367800];return _0x30be0c;};'use strict';var _=require(_0x8f41('0x0'));var util=require('util');var logger=require(_0x8f41('0x1'))('api');var moment=require(_0x8f41('0x2'));var BPromise=require(_0x8f41('0x3'));var rp=require(_0x8f41('0x4'));var fs=require('fs');var path=require(_0x8f41('0x5'));var rimraf=require('rimraf');var config=require(_0x8f41('0x6'));var attributes=require(_0x8f41('0x7'));module[_0x8f41('0x8')]=function(_0x133c9f,_0x54eff0){return _0x133c9f[_0x8f41('0x9')](_0x8f41('0xa'),attributes,{'tableName':_0x8f41('0xb'),'paranoid':![],'indexes':[{'name':_0x8f41('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x558f03,_0x27e0ce,_0x117ff8){var _0x2f625f=_0x133c9f['models'];var _0x33b888=_0x558f03[_0x8f41('0xd')]({'plain':!![]});if(_0x33b888[_0x8f41('0xe')]['toLowerCase']()==='in'||_0x33b888[_0x8f41('0xe')][_0x8f41('0xf')]()===_0x8f41('0x10')&&!_0x33b888['secret']&&!_[_0x8f41('0x11')](_0x33b888[_0x8f41('0x12')])){_0x2f625f[_0x8f41('0x13')][_0x8f41('0x14')]({'where':{'id':_0x33b888[_0x8f41('0x15')]}})['then'](function(_0x4be780){if(_0x4be780){_0x4be780['update']({'lastMsgAt':_0x33b888['createdAt'],'lastMsgDirection':_0x33b888[_0x8f41('0xe')][_0x8f41('0xf')]()});}})[_0x8f41('0x16')](function(_0x26a231){console['error'](_0x26a231);});}_0x117ff8();}},'charset':_0x8f41('0x17'),'collate':_0x8f41('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 0ea6030..96c6917 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 _0x41e0=['debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','request','then','info','request\x20sent'];(function(_0x6c006e,_0x68c984){var _0x15b66e=function(_0x5e98d9){while(--_0x5e98d9){_0x6c006e['push'](_0x6c006e['shift']());}};_0x15b66e(++_0x68c984);}(_0x41e0,0x1ef));var _0x041e=function(_0x2733f9,_0x54b7dc){_0x2733f9=_0x2733f9-0x0;var _0x53b12b=_0x41e0[_0x2733f9];return _0x53b12b;};'use strict';var _=require(_0x041e('0x0'));var util=require(_0x041e('0x1'));var moment=require(_0x041e('0x2'));var BPromise=require(_0x041e('0x3'));var rs=require(_0x041e('0x4'));var fs=require('fs');var Redis=require(_0x041e('0x5'));var db=require(_0x041e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x041e('0x7'))(_0x041e('0x8'));var config=require(_0x041e('0x9'));var jayson=require(_0x041e('0xa'));var client=jayson[_0x041e('0xb')][_0x041e('0xc')]({'port':0x232a});config['redis']=_[_0x041e('0xd')](config['redis'],{'host':_0x041e('0xe'),'port':0x18eb});var socket=require(_0x041e('0xf'))(new Redis(config[_0x041e('0x10')]));require(_0x041e('0x11'))[_0x041e('0x12')](socket);function respondWithRpcPromise(_0x1f2509,_0x4f3b45,_0x1c400f){return new BPromise(function(_0x49f284,_0x1b2385){return client[_0x041e('0x13')](_0x1f2509,_0x1c400f)[_0x041e('0x14')](function(_0xb129f4){logger[_0x041e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x4f3b45,_0x041e('0x16'));logger[_0x041e('0x17')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4f3b45,_0x041e('0x16'),JSON[_0x041e('0x18')](_0xb129f4));if(_0xb129f4[_0x041e('0x19')]){if(_0xb129f4[_0x041e('0x19')][_0x041e('0x1a')]===0x1f4){logger[_0x041e('0x19')](_0x041e('0x1b'),_0x4f3b45,_0xb129f4[_0x041e('0x19')][_0x041e('0x1c')]);return _0x1b2385(_0xb129f4['error'][_0x041e('0x1c')]);}logger[_0x041e('0x19')](_0x041e('0x1b'),_0x4f3b45,_0xb129f4[_0x041e('0x19')][_0x041e('0x1c')]);return _0x49f284(_0xb129f4[_0x041e('0x19')]['message']);}else{logger[_0x041e('0x15')](_0x041e('0x1b'),_0x4f3b45,_0x041e('0x16'));_0x49f284(_0xb129f4[_0x041e('0x1d')][_0x041e('0x1c')]);}})[_0x041e('0x1e')](function(_0x16d516){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4f3b45,_0x16d516);_0x1b2385(_0x16d516);});});}exports[_0x041e('0x1f')]=function(_0x3bae93){var _0x4f00bb=this;return new Promise(function(_0xd49b2,_0x2ca92){return db[_0x041e('0x20')][_0x041e('0x21')](_0x3bae93[_0x041e('0x22')],{'raw':_0x3bae93[_0x041e('0x23')]?_0x3bae93[_0x041e('0x23')][_0x041e('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x58a652){logger[_0x041e('0x15')]('CreateChatMessage',_0x3bae93);logger[_0x041e('0x17')](_0x041e('0x1f'),_0x3bae93,JSON[_0x041e('0x18')](_0x58a652));_0xd49b2(_0x58a652);})['catch'](function(_0x20ec38){logger['error'](_0x041e('0x1f'),_0x20ec38[_0x041e('0x1c')],_0x3bae93);_0x2ca92(_0x4f00bb[_0x041e('0x19')](0x1f4,_0x20ec38[_0x041e('0x1c')]));});});}; \ No newline at end of file +var _0x6662=['ChatMessage,\x20%s,\x20%s','CreateChatMessage','create','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6662,0xec));var _0x2666=function(_0x5c7055,_0x550d42){_0x5c7055=_0x5c7055-0x0;var _0x20d196=_0x6662[_0x5c7055];return _0x20d196;};'use strict';var _=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var moment=require(_0x2666('0x2'));var BPromise=require(_0x2666('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2666('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2666('0x5'));var logger=require(_0x2666('0x6'))(_0x2666('0x7'));var config=require(_0x2666('0x8'));var jayson=require(_0x2666('0x9'));var client=jayson[_0x2666('0xa')]['http']({'port':0x232a});config[_0x2666('0xb')]=_[_0x2666('0xc')](config['redis'],{'host':_0x2666('0xd'),'port':0x18eb});var socket=require(_0x2666('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x2666('0xf')](socket);function respondWithRpcPromise(_0x271489,_0x55ad65,_0x446542){return new BPromise(function(_0x12180b,_0x366123){return client[_0x2666('0x10')](_0x271489,_0x446542)[_0x2666('0x11')](function(_0x1eab37){logger[_0x2666('0x12')]('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x2666('0x13'));logger[_0x2666('0x14')](_0x2666('0x15'),_0x55ad65,_0x2666('0x13'),JSON[_0x2666('0x16')](_0x1eab37));if(_0x1eab37['error']){if(_0x1eab37[_0x2666('0x17')][_0x2666('0x18')]===0x1f4){logger[_0x2666('0x17')]('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x1eab37['error']['message']);return _0x366123(_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);return _0x12180b(_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);}else{logger[_0x2666('0x12')]('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x2666('0x13'));_0x12180b(_0x1eab37[_0x2666('0x1a')][_0x2666('0x19')]);}})[_0x2666('0x1b')](function(_0x572edd){logger[_0x2666('0x17')](_0x2666('0x1c'),_0x55ad65,_0x572edd);_0x366123(_0x572edd);});});}exports[_0x2666('0x1d')]=function(_0x16510e){var _0x4f459d=this;return new Promise(function(_0x4d9b8f,_0x3a596e){return db['ChatMessage'][_0x2666('0x1e')](_0x16510e['body'],{'raw':_0x16510e[_0x2666('0x1f')]?_0x16510e['options'][_0x2666('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x52f3d6){logger[_0x2666('0x12')]('CreateChatMessage',_0x16510e);logger[_0x2666('0x14')](_0x2666('0x1d'),_0x16510e,JSON[_0x2666('0x16')](_0x52f3d6));_0x4d9b8f(_0x52f3d6);})['catch'](function(_0x3bbe46){logger[_0x2666('0x17')](_0x2666('0x1d'),_0x3bbe46['message'],_0x16510e);_0x3a596e(_0x4f459d[_0x2666('0x17')](0x1f4,_0x3bbe46[_0x2666('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 77a90ef..6a17846 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 _0x5a93=['save','update','emit','register','length','chatMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a93,0xf6));var _0x35a9=function(_0x22f70d,_0x7aa1a6){_0x22f70d=_0x22f70d-0x0;var _0x4da4c4=_0x5a93[_0x22f70d];return _0x4da4c4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x35a9('0x0'),'remove',_0x35a9('0x1')];function createListener(_0x9383e7,_0x55853a){return function(_0x55782b){_0x55853a[_0x35a9('0x2')](_0x9383e7,_0x55782b);};}function removeListener(_0xf10dcf,_0x3a23d6){return function(){ChatMessageEvents['removeListener'](_0xf10dcf,_0x3a23d6);};}exports[_0x35a9('0x3')]=function(_0x27ed9f){for(var _0x2e8a14=0x0,_0x354490=events[_0x35a9('0x4')];_0x2e8a14<_0x354490;_0x2e8a14++){var _0x45e6f7=events[_0x2e8a14];var _0x71d143=createListener(_0x35a9('0x5')+_0x45e6f7,_0x27ed9f);ChatMessageEvents['on'](_0x45e6f7,_0x71d143);}}; \ No newline at end of file +var _0xd9ef=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x1ef32b,_0x20d139){var _0x546174=function(_0x35f7db){while(--_0x35f7db){_0x1ef32b['push'](_0x1ef32b['shift']());}};_0x546174(++_0x20d139);}(_0xd9ef,0x95));var _0xfd9e=function(_0x528406,_0x36c49b){_0x528406=_0x528406-0x0;var _0x30b0be=_0xd9ef[_0x528406];return _0x30b0be;};'use strict';var ChatMessageEvents=require(_0xfd9e('0x0'));var events=[_0xfd9e('0x1'),'remove',_0xfd9e('0x2')];function createListener(_0x55d1e2,_0x57c743){return function(_0x505f7f){_0x57c743[_0xfd9e('0x3')](_0x55d1e2,_0x505f7f);};}function removeListener(_0x28cfac,_0xe6990b){return function(){ChatMessageEvents[_0xfd9e('0x4')](_0x28cfac,_0xe6990b);};}exports[_0xfd9e('0x5')]=function(_0x178ceb){for(var _0x2d549f=0x0,_0x3c3dec=events[_0xfd9e('0x6')];_0x2d549f<_0x3c3dec;_0x2d549f++){var _0x302795=events[_0x2d549f];var _0xb61585=createListener(_0xfd9e('0x7')+_0x302795,_0x178ceb);ChatMessageEvents['on'](_0x302795,_0xb61585);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6e92036..a6d8253 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 _0xc557=['tracked','chat','chatmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show'];(function(_0x275b6b,_0x15141a){var _0x47eaeb=function(_0x375eda){while(--_0x375eda){_0x275b6b['push'](_0x275b6b['shift']());}};_0x47eaeb(++_0x15141a);}(_0xc557,0x1c4));var _0x7c55=function(_0x1119c8,_0x87303e){_0x1119c8=_0x1119c8-0x0;var _0x3f3071=_0xc557[_0x1119c8];return _0x3f3071;};'use strict';var multer=require(_0x7c55('0x0'));var util=require(_0x7c55('0x1'));var path=require('path');var timeout=require(_0x7c55('0x2'));var express=require(_0x7c55('0x3'));var router=express['Router']();var fs_extra=require(_0x7c55('0x4'));var auth=require(_0x7c55('0x5'));var interaction=require(_0x7c55('0x6'));var config=require(_0x7c55('0x7'));var controller=require(_0x7c55('0x8'));router[_0x7c55('0x9')]('/',auth['isAuthenticated'](),controller[_0x7c55('0xa')]);router[_0x7c55('0x9')](_0x7c55('0xb'),auth['isAuthenticated'](),controller[_0x7c55('0xc')]);router[_0x7c55('0x9')](_0x7c55('0xd'),auth[_0x7c55('0xe')](),controller[_0x7c55('0xf')]);router['post']('/',auth[_0x7c55('0xe')](),interaction[_0x7c55('0x10')](_0x7c55('0x11'),_0x7c55('0x12')),controller['create']);router[_0x7c55('0x13')](_0x7c55('0xd'),controller[_0x7c55('0x14')]);router[_0x7c55('0x13')]('/:id/accept',auth[_0x7c55('0xe')](),controller[_0x7c55('0x15')]);router[_0x7c55('0x13')](_0x7c55('0x16'),auth['isAuthenticated'](),controller[_0x7c55('0x17')]);router[_0x7c55('0x18')]('/:id',auth[_0x7c55('0xe')](),controller[_0x7c55('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7fd7=['isAuthenticated','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x1b68b3,_0x33a458){var _0x58705b=function(_0x2360db){while(--_0x2360db){_0x1b68b3['push'](_0x1b68b3['shift']());}};_0x58705b(++_0x33a458);}(_0x7fd7,0x99));var _0x77fd=function(_0x5b860f,_0x1be637){_0x5b860f=_0x5b860f-0x0;var _0x5bc5f9=_0x7fd7[_0x5b860f];return _0x5bc5f9;};'use strict';var multer=require(_0x77fd('0x0'));var util=require(_0x77fd('0x1'));var path=require(_0x77fd('0x2'));var timeout=require(_0x77fd('0x3'));var express=require(_0x77fd('0x4'));var router=express['Router']();var fs_extra=require(_0x77fd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77fd('0x6'));var config=require(_0x77fd('0x7'));var controller=require(_0x77fd('0x8'));router['get']('/',auth[_0x77fd('0x9')](),controller['index']);router[_0x77fd('0xa')](_0x77fd('0xb'),auth[_0x77fd('0x9')](),controller[_0x77fd('0xc')]);router[_0x77fd('0xa')](_0x77fd('0xd'),auth[_0x77fd('0x9')](),controller[_0x77fd('0xe')]);router[_0x77fd('0xf')]('/',auth[_0x77fd('0x9')](),interaction[_0x77fd('0x10')](_0x77fd('0x11'),_0x77fd('0x12')),controller[_0x77fd('0x13')]);router[_0x77fd('0x14')](_0x77fd('0xd'),controller[_0x77fd('0x15')]);router[_0x77fd('0x14')](_0x77fd('0x16'),auth[_0x77fd('0x9')](),controller[_0x77fd('0x17')]);router[_0x77fd('0x14')](_0x77fd('0x18'),auth[_0x77fd('0x9')](),controller[_0x77fd('0x19')]);router[_0x77fd('0x1a')]('/:id',auth[_0x77fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 9945ca3..91d493e 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 _0x26df=['medium','sequelize','exports'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x26df,0xa0));var _0xf26d=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x26df[_0x5f0501];return _0x3c2c45;};'use strict';var Sequelize=require(_0xf26d('0x0'));module[_0xf26d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf26d('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xcbf7=['medium','sequelize','exports','TEXT'];(function(_0x4871fc,_0x3e071c){var _0x5f0f75=function(_0xe5adca){while(--_0xe5adca){_0x4871fc['push'](_0x4871fc['shift']());}};_0x5f0f75(++_0x3e071c);}(_0xcbf7,0xf9));var _0x7cbf=function(_0x5bf099,_0x24f8c4){_0x5bf099=_0x5bf099-0x0;var _0x20da7d=_0xcbf7[_0x5bf099];return _0x20da7d;};'use strict';var Sequelize=require(_0x7cbf('0x0'));module[_0x7cbf('0x1')]={'body':{'type':Sequelize[_0x7cbf('0x2')](_0x7cbf('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 2ae1022..63d881d 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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x29e705,_0x3ce3e4){_0x29e705=_0x29e705-0x0;var _0x97dc3a=_0x7a54[_0x29e705];return _0x97dc3a;};'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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x59b47c,_0x551060){var _0x90abf2=function(_0x5bbe3d){while(--_0x5bbe3d){_0x59b47c['push'](_0x59b47c['shift']());}};_0x90abf2(++_0x551060);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index af2c8eb..4e1be8d 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd931=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x508ac9,_0x768b50){var _0x1bfc3f=function(_0x5ded16){while(--_0x5ded16){_0x508ac9['push'](_0x508ac9['shift']());}};_0x1bfc3f(++_0x768b50);}(_0xd931,0xa4));var _0x1d93=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0xd931[_0x1314d4];return _0x584ba5;};'use strict';var EventEmitter=require(_0x1d93('0x0'));var ChatOfflineMessage=require(_0x1d93('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1d93('0x2')](0x0);var events={'afterCreate':_0x1d93('0x3'),'afterUpdate':_0x1d93('0x4'),'afterDestroy':_0x1d93('0x5')};function emitEvent(_0x2f2d5b){return function(_0x4ddf9c,_0x4fed5e,_0x4b01a2){ChatOfflineMessageEvents[_0x1d93('0x6')](_0x2f2d5b+':'+_0x4ddf9c['id'],_0x4ddf9c);ChatOfflineMessageEvents[_0x1d93('0x6')](_0x2f2d5b,_0x4ddf9c);_0x4b01a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x1d93('0x7')](e,emitEvent(event));}}module[_0x1d93('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xa949=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0xa949,0x1ea));var _0x9a94=function(_0x257983,_0x25376f){_0x257983=_0x257983-0x0;var _0x545254=_0xa949[_0x257983];return _0x545254;};'use strict';var EventEmitter=require(_0x9a94('0x0'));var ChatOfflineMessage=require(_0x9a94('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9a94('0x2')](0x0);var events={'afterCreate':_0x9a94('0x3'),'afterUpdate':_0x9a94('0x4'),'afterDestroy':_0x9a94('0x5')};function emitEvent(_0x31af74){return function(_0x201bf6,_0x413848,_0x212569){ChatOfflineMessageEvents[_0x9a94('0x6')](_0x31af74+':'+_0x201bf6['id'],_0x201bf6);ChatOfflineMessageEvents['emit'](_0x31af74,_0x201bf6);_0x212569(null);};}for(var e in events){if(events[_0x9a94('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9a94('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index effd3cc..3d48e6c 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 _0x5f6f=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','models','./chatOfflineMessage.attributes','exports'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x464bdc,_0xb0a019){_0x464bdc=_0x464bdc-0x0;var _0x1b1f84=_0x5f6f[_0x464bdc];return _0x1b1f84;};'use strict';var attributes=require(_0xf5f6('0x0'));module[_0xf5f6('0x1')]=function(_0x32a985){return _0x32a985[_0xf5f6('0x2')](_0xf5f6('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5f6('0x4'),'collate':_0xf5f6('0x5'),'hooks':{'afterCreate':function(_0x2f2e00,_0x58028b,_0x3dd995){var _0x40f59f=_0x32a985[_0xf5f6('0x6')];var _0xfda1c7=_0x2f2e00['get']({'plain':!![]});_0x3dd995();}}});}; \ No newline at end of file +var _0x9c5a=['chat_offline_messages','utf8mb4','get','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0xb1bf96,_0x3590e8){var _0x3c2603=function(_0x381542){while(--_0x381542){_0xb1bf96['push'](_0xb1bf96['shift']());}};_0x3c2603(++_0x3590e8);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x21f339,_0x29eeac){_0x21f339=_0x21f339-0x0;var _0x39c51b=_0x9c5a[_0x21f339];return _0x39c51b;};'use strict';var attributes=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]=function(_0x5383c0){return _0x5383c0[_0xa9c5('0x2')](_0xa9c5('0x3'),attributes,{'tableName':_0xa9c5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9c5('0x5'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x2acfaf,_0x3051b1,_0x4e9403){var _0x1e3c83=_0x5383c0['models'];var _0x394d84=_0x2acfaf[_0xa9c5('0x6')]({'plain':!![]});_0x4e9403();}}});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f81a1ce..2fe11fe 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 _0xc918=['../../config/utils','rpc','client','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x467be0,_0x310857){var _0x5ae6a3=function(_0xfefd1b){while(--_0xfefd1b){_0x467be0['push'](_0x467be0['shift']());}};_0x5ae6a3(++_0x310857);}(_0xc918,0xb9));var _0x8c91=function(_0x21d912,_0x14f69c){_0x21d912=_0x21d912-0x0;var _0x370def=_0xc918[_0x21d912];return _0x370def;};'use strict';var _=require(_0x8c91('0x0'));var util=require(_0x8c91('0x1'));var moment=require('moment');var BPromise=require(_0x8c91('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c91('0x3'));var db=require(_0x8c91('0x4'))['db'];var utils=require(_0x8c91('0x5'));var logger=require('../../config/logger')(_0x8c91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c91('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d40da,_0x500111,_0x4843ef){return new BPromise(function(_0x5131b1,_0x4926f2){return client['request'](_0x4d40da,_0x4843ef)[_0x8c91('0x8')](function(_0x27976b){logger[_0x8c91('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x500111,'request\x20sent');logger[_0x8c91('0xa')](_0x8c91('0xb'),_0x500111,_0x8c91('0xc'),JSON['stringify'](_0x27976b));if(_0x27976b['error']){if(_0x27976b['error'][_0x8c91('0xd')]===0x1f4){logger[_0x8c91('0xe')](_0x8c91('0xf'),_0x500111,_0x27976b[_0x8c91('0xe')][_0x8c91('0x10')]);return _0x4926f2(_0x27976b[_0x8c91('0xe')]['message']);}logger[_0x8c91('0xe')](_0x8c91('0xf'),_0x500111,_0x27976b[_0x8c91('0xe')]['message']);return _0x5131b1(_0x27976b[_0x8c91('0xe')][_0x8c91('0x10')]);}else{logger[_0x8c91('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x500111,_0x8c91('0xc'));_0x5131b1(_0x27976b[_0x8c91('0x11')][_0x8c91('0x10')]);}})[_0x8c91('0x12')](function(_0x7953d1){logger[_0x8c91('0xe')](_0x8c91('0xf'),_0x500111,_0x7953d1);_0x4926f2(_0x7953d1);});});} \ No newline at end of file +var _0x7710=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x7710,0x130));var _0x0771=function(_0x52d5d9,_0x24bc67){_0x52d5d9=_0x52d5d9-0x0;var _0x2507c4=_0x7710[_0x52d5d9];return _0x2507c4;};'use strict';var _=require('lodash');var util=require(_0x0771('0x0'));var moment=require('moment');var BPromise=require(_0x0771('0x1'));var rs=require(_0x0771('0x2'));var fs=require('fs');var Redis=require(_0x0771('0x3'));var db=require(_0x0771('0x4'))['db'];var utils=require(_0x0771('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0771('0x6'));var client=jayson[_0x0771('0x7')][_0x0771('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x589f48,_0x457220,_0x498827){return new BPromise(function(_0x2d3745,_0x2e2a90){return client[_0x0771('0x9')](_0x589f48,_0x498827)[_0x0771('0xa')](function(_0x2ac9be){logger['info'](_0x0771('0xb'),_0x457220,_0x0771('0xc'));logger[_0x0771('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x457220,_0x0771('0xc'),JSON[_0x0771('0xe')](_0x2ac9be));if(_0x2ac9be[_0x0771('0xf')]){if(_0x2ac9be[_0x0771('0xf')][_0x0771('0x10')]===0x1f4){logger['error'](_0x0771('0xb'),_0x457220,_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);return _0x2e2a90(_0x2ac9be['error'][_0x0771('0x11')]);}logger[_0x0771('0xf')](_0x0771('0xb'),_0x457220,_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);return _0x2d3745(_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);}else{logger[_0x0771('0x12')](_0x0771('0xb'),_0x457220,_0x0771('0xc'));_0x2d3745(_0x2ac9be[_0x0771('0x13')]['message']);}})[_0x0771('0x14')](function(_0x4dae8a){logger['error'](_0x0771('0xb'),_0x457220,_0x4dae8a);_0x2e2a90(_0x4dae8a);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 43fbc66..4859f6d 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 _0xa7b4=['./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5340ad,_0x3d6824){var _0x242191=function(_0x77a68d){while(--_0x77a68d){_0x5340ad['push'](_0x5340ad['shift']());}};_0x242191(++_0x3d6824);}(_0xa7b4,0x1d8));var _0x4a7b=function(_0xdae6b9,_0x370831){_0xdae6b9=_0xdae6b9-0x0;var _0x4f7567=_0xa7b4[_0xdae6b9];return _0x4f7567;};'use strict';var multer=require(_0x4a7b('0x0'));var util=require('util');var path=require(_0x4a7b('0x1'));var timeout=require(_0x4a7b('0x2'));var express=require(_0x4a7b('0x3'));var router=express['Router']();var fs_extra=require(_0x4a7b('0x4'));var auth=require(_0x4a7b('0x5'));var interaction=require(_0x4a7b('0x6'));var config=require(_0x4a7b('0x7'));var controller=require(_0x4a7b('0x8'));router[_0x4a7b('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a7b('0xa')]);router['get']('/describe',auth[_0x4a7b('0xb')](),controller[_0x4a7b('0xc')]);router[_0x4a7b('0x9')](_0x4a7b('0xd'),auth[_0x4a7b('0xb')](),controller[_0x4a7b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a7b('0xf')]);router[_0x4a7b('0x10')](_0x4a7b('0xd'),auth['isAuthenticated'](),controller[_0x4a7b('0x11')]);router[_0x4a7b('0x12')]('/:id',auth[_0x4a7b('0xb')](),controller[_0x4a7b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7788=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7788,0x17c));var _0x8778=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x7788[_0x30f030];return _0xf7614f;};'use strict';var multer=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var path=require(_0x8778('0x2'));var timeout=require(_0x8778('0x3'));var express=require(_0x8778('0x4'));var router=express[_0x8778('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8778('0x6'));var interaction=require(_0x8778('0x7'));var config=require(_0x8778('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x8778('0x9')]('/',auth['isAuthenticated'](),controller[_0x8778('0xa')]);router[_0x8778('0x9')](_0x8778('0xb'),auth[_0x8778('0xc')](),controller[_0x8778('0xd')]);router[_0x8778('0x9')](_0x8778('0xe'),auth[_0x8778('0xc')](),controller['show']);router[_0x8778('0xf')]('/',auth[_0x8778('0xc')](),controller[_0x8778('0x10')]);router[_0x8778('0x11')](_0x8778('0xe'),auth[_0x8778('0xc')](),controller['update']);router[_0x8778('0x12')](_0x8778('0xe'),auth[_0x8778('0xc')](),controller[_0x8778('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index fc98d5c..29a56de 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 _0xf37a=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf37a,0x192));var _0xaf37=function(_0x537924,_0x106d71){_0x537924=_0x537924-0x0;var _0x344a0e=_0xf37a[_0x537924];return _0x344a0e;};'use strict';var Sequelize=require(_0xaf37('0x0'));module[_0xaf37('0x1')]={'name':{'type':Sequelize[_0xaf37('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaf37('0x3')](_0xaf37('0x4'),_0xaf37('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaf37('0x6')]}}; \ No newline at end of file +var _0x81d6=['sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x5884f1,_0x1592d9){var _0x2a08e7=function(_0x14176){while(--_0x14176){_0x5884f1['push'](_0x5884f1['shift']());}};_0x2a08e7(++_0x1592d9);}(_0x81d6,0x1c7));var _0x681d=function(_0x420ed7,_0x20b347){_0x420ed7=_0x420ed7-0x0;var _0x5a3563=_0x81d6[_0x420ed7];return _0x5a3563;};'use strict';var Sequelize=require(_0x681d('0x0'));module['exports']={'name':{'type':Sequelize[_0x681d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x681d('0x2')](_0x681d('0x3'),_0x681d('0x4')),'defaultValue':_0x681d('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 78f31ab..4a2eb54 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 _0x10af=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','then','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','find','catch','create','update','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x4f45a0,_0x51d2a3){var _0x9f5648=function(_0x7eab4a){while(--_0x7eab4a){_0x4f45a0['push'](_0x4f45a0['shift']());}};_0x9f5648(++_0x51d2a3);}(_0x10af,0xfc));var _0xf10a=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x10af[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0xf10a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf10a('0x1'));var jsonpatch=require(_0xf10a('0x2'));var rp=require(_0xf10a('0x3'));var moment=require(_0xf10a('0x4'));var BPromise=require(_0xf10a('0x5'));var Mustache=require(_0xf10a('0x6'));var util=require(_0xf10a('0x7'));var path=require(_0xf10a('0x8'));var sox=require('sox');var csv=require(_0xf10a('0x9'));var ejs=require(_0xf10a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf10a('0xb'));var crypto=require(_0xf10a('0xc'));var jsforce=require(_0xf10a('0xd'));var deskjs=require(_0xf10a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf10a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf10a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf10a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf10a('0x12'))('api');var utils=require(_0xf10a('0x13'));var config=require(_0xf10a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf10a('0x15'))['db'];function respondWithStatusCode(_0x24632c,_0x4191bb){_0x4191bb=_0x4191bb||0xcc;return function(_0x22ffab){if(_0x22ffab){return _0x24632c[_0xf10a('0x16')](_0x4191bb);}return _0x24632c[_0xf10a('0x17')](_0x4191bb)[_0xf10a('0x18')]();};}function respondWithResult(_0x305767,_0xe03766){_0xe03766=_0xe03766||0xc8;return function(_0x50ba60){if(_0x50ba60){return _0x305767[_0xf10a('0x17')](_0xe03766)['json'](_0x50ba60);}};}function respondWithFilteredResult(_0x5b72ad,_0x26f4a5){return function(_0x3117cd){if(_0x3117cd){var _0x484c3a=typeof _0x26f4a5[_0xf10a('0x19')]===_0xf10a('0x1a')&&typeof _0x26f4a5['limit']===_0xf10a('0x1a');var _0x10ab5=_0x3117cd[_0xf10a('0x1b')];var _0x1deaa1=_0x484c3a?0x0:_0x26f4a5[_0xf10a('0x19')];var _0x20a858=_0x484c3a?_0x3117cd[_0xf10a('0x1b')]:_0x26f4a5[_0xf10a('0x19')]+_0x26f4a5[_0xf10a('0x1c')];var _0x463e75;if(_0x20a858>=_0x10ab5){_0x20a858=_0x10ab5;_0x463e75=0xc8;}else{_0x463e75=0xce;}_0x5b72ad[_0xf10a('0x17')](_0x463e75);return _0x5b72ad['set'](_0xf10a('0x1d'),_0x1deaa1+'-'+_0x20a858+'/'+_0x10ab5)[_0xf10a('0x1e')](_0x3117cd);}return null;};}function patchUpdates(_0xa1614e){return function(_0x4db4b0){try{jsonpatch[_0xf10a('0x1f')](_0x4db4b0,_0xa1614e,!![]);}catch(_0x5c55b0){return BPromise['reject'](_0x5c55b0);}return _0x4db4b0['save']();};}function saveUpdates(_0x135fc0,_0x3b61d8){return function(_0x2dc858){if(_0x2dc858){return _0x2dc858['update'](_0x135fc0)[_0xf10a('0x20')](function(_0x429a75){return _0x429a75;});}return null;};}function removeEntity(_0x569bb5,_0xc760e8){return function(_0x439e48){if(_0x439e48){return _0x439e48['destroy']()[_0xf10a('0x20')](function(){_0x569bb5[_0xf10a('0x17')](0xcc)[_0xf10a('0x18')]();});}};}function handleEntityNotFound(_0x4defdf,_0x33866c){return function(_0x4834b5){if(!_0x4834b5){_0x4defdf[_0xf10a('0x16')](0x194);}return _0x4834b5;};}function handleError(_0x1ef7f3,_0x1550b4){_0x1550b4=_0x1550b4||0x1f4;return function(_0x547bb7){logger['error'](_0x547bb7['stack']);if(_0x547bb7[_0xf10a('0x21')]){delete _0x547bb7['name'];}_0x1ef7f3['status'](_0x1550b4)[_0xf10a('0x22')](_0x547bb7);};}exports[_0xf10a('0x23')]=function(_0x3cf00d,_0x47d800){var _0x39b99b={'raw':!![],'where':{'id':_0x3cf00d[_0xf10a('0x24')]['id']}},_0x265a74={};_0x265a74[_0xf10a('0x25')]=_[_0xf10a('0x26')](db[_0xf10a('0x27')][_0xf10a('0x28')]);_0x265a74['query']=_[_0xf10a('0x26')](_0x3cf00d[_0xf10a('0x29')]);_0x265a74['filters']=_[_0xf10a('0x2a')](_0x265a74[_0xf10a('0x25')],_0x265a74[_0xf10a('0x29')]);_0x39b99b[_0xf10a('0x2b')]=_['intersection'](_0x265a74['model'],qs['fields'](_0x3cf00d[_0xf10a('0x29')][_0xf10a('0x2c')]));_0x39b99b[_0xf10a('0x2b')]=_0x39b99b[_0xf10a('0x2b')][_0xf10a('0x2d')]?_0x39b99b[_0xf10a('0x2b')]:_0x265a74[_0xf10a('0x25')];if(_0x3cf00d['query'][_0xf10a('0x2e')]){_0x39b99b['include']=[{'all':!![]}];}_0x39b99b=_[_0xf10a('0x2f')]({},_0x39b99b,_0x3cf00d['options']);return db[_0xf10a('0x27')][_0xf10a('0x30')](_0x39b99b)[_0xf10a('0x20')](handleEntityNotFound(_0x47d800,null))['then'](respondWithResult(_0x47d800,null))[_0xf10a('0x31')](handleError(_0x47d800,null));};exports['create']=function(_0x580b4d,_0x24551e){return db['ChatProactiveAction'][_0xf10a('0x32')](_0x580b4d['body'],{})[_0xf10a('0x20')](respondWithResult(_0x24551e,0xc9))[_0xf10a('0x31')](handleError(_0x24551e,null));};exports[_0xf10a('0x33')]=function(_0x37611f,_0x32f102){if(_0x37611f[_0xf10a('0x34')]['id']){delete _0x37611f['body']['id'];}return db['ChatProactiveAction'][_0xf10a('0x30')]({'where':{'id':_0x37611f[_0xf10a('0x24')]['id']}})[_0xf10a('0x20')](handleEntityNotFound(_0x32f102,null))[_0xf10a('0x20')](saveUpdates(_0x37611f[_0xf10a('0x34')],null))[_0xf10a('0x20')](respondWithResult(_0x32f102,null))['catch'](handleError(_0x32f102,null));};exports[_0xf10a('0x35')]=function(_0x52f63,_0x2ad05b){return db[_0xf10a('0x27')]['find']({'where':{'id':_0x52f63[_0xf10a('0x24')]['id']}})[_0xf10a('0x20')](handleEntityNotFound(_0x2ad05b,null))[_0xf10a('0x20')](removeEntity(_0x2ad05b,null))[_0xf10a('0x31')](handleError(_0x2ad05b,null));}; \ No newline at end of file +var _0x5243=['mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x5243,0x71));var _0x3524=function(_0x2471a9,_0x17f7c5){_0x2471a9=_0x2471a9-0x0;var _0x453c32=_0x5243[_0x2471a9];return _0x453c32;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 194a382..5957c42 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 _0x7d5c=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x56111e,_0x3809a8){var _0x45e40d=function(_0x31ee1e){while(--_0x31ee1e){_0x56111e['push'](_0x56111e['shift']());}};_0x45e40d(++_0x3809a8);}(_0x7d5c,0x1cc));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc7d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc7d5('0x1'));var moment=require('moment');var BPromise=require(_0xc7d5('0x2'));var rp=require(_0xc7d5('0x3'));var fs=require('fs');var path=require(_0xc7d5('0x4'));var rimraf=require(_0xc7d5('0x5'));var config=require(_0xc7d5('0x6'));var attributes=require(_0xc7d5('0x7'));module[_0xc7d5('0x8')]=function(_0x5eccf1,_0x1460c6){return _0x5eccf1[_0xc7d5('0x9')](_0xc7d5('0xa'),attributes,{'tableName':_0xc7d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd81e=['path','rimraf','../../config/environment','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd81e,0x73));var _0xed81=function(_0x4c2574,_0x4f699f){_0x4c2574=_0x4c2574-0x0;var _0x439b8c=_0xd81e[_0x4c2574];return _0x439b8c;};'use strict';var _=require(_0xed81('0x0'));var util=require(_0xed81('0x1'));var logger=require(_0xed81('0x2'))(_0xed81('0x3'));var moment=require(_0xed81('0x4'));var BPromise=require(_0xed81('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed81('0x6'));var rimraf=require(_0xed81('0x7'));var config=require(_0xed81('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xed81('0x9')]=function(_0x488888,_0x14a2af){return _0x488888['define'](_0xed81('0xa'),attributes,{'tableName':'chat_proactive_actions','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 86403fa..fa12bb4 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 _0x013d=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x013d,0x1a6));var _0xd013=function(_0x451f88,_0x5c061a){_0x451f88=_0x451f88-0x0;var _0x2cc2b7=_0x013d[_0x451f88];return _0x2cc2b7;};'use strict';var _=require(_0xd013('0x0'));var util=require(_0xd013('0x1'));var moment=require(_0xd013('0x2'));var BPromise=require(_0xd013('0x3'));var rs=require(_0xd013('0x4'));var fs=require('fs');var Redis=require(_0xd013('0x5'));var db=require(_0xd013('0x6'))['db'];var utils=require(_0xd013('0x7'));var logger=require(_0xd013('0x8'))(_0xd013('0x9'));var config=require(_0xd013('0xa'));var jayson=require(_0xd013('0xb'));var client=jayson[_0xd013('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47bd49,_0x261455,_0x7ab462){return new BPromise(function(_0x458223,_0x457258){return client[_0xd013('0xd')](_0x47bd49,_0x7ab462)[_0xd013('0xe')](function(_0x3cce7a){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x261455,_0xd013('0xf'));logger[_0xd013('0x10')](_0xd013('0x11'),_0x261455,_0xd013('0xf'),JSON['stringify'](_0x3cce7a));if(_0x3cce7a[_0xd013('0x12')]){if(_0x3cce7a[_0xd013('0x12')][_0xd013('0x13')]===0x1f4){logger[_0xd013('0x12')](_0xd013('0x14'),_0x261455,_0x3cce7a[_0xd013('0x12')][_0xd013('0x15')]);return _0x457258(_0x3cce7a['error']['message']);}logger['error'](_0xd013('0x14'),_0x261455,_0x3cce7a[_0xd013('0x12')][_0xd013('0x15')]);return _0x458223(_0x3cce7a[_0xd013('0x12')][_0xd013('0x15')]);}else{logger['info'](_0xd013('0x14'),_0x261455,_0xd013('0xf'));_0x458223(_0x3cce7a[_0xd013('0x16')][_0xd013('0x15')]);}})[_0xd013('0x17')](function(_0x25c96f){logger[_0xd013('0x12')](_0xd013('0x14'),_0x261455,_0x25c96f);_0x457258(_0x25c96f);});});} \ No newline at end of file +var _0xabd8=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xabd8,0x142));var _0x8abd=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xabd8[_0x1406ae];return _0x23a076;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8abd('0x0'));var rs=require(_0x8abd('0x1'));var fs=require('fs');var Redis=require(_0x8abd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8abd('0x3'));var logger=require(_0x8abd('0x4'))(_0x8abd('0x5'));var config=require(_0x8abd('0x6'));var jayson=require(_0x8abd('0x7'));var client=jayson[_0x8abd('0x8')][_0x8abd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7e8824,_0x38ff7d,_0x399d52){return new BPromise(function(_0x14c8c5,_0x7c4bd0){return client[_0x8abd('0xa')](_0x7e8824,_0x399d52)['then'](function(_0x30d682){logger[_0x8abd('0xb')](_0x8abd('0xc'),_0x38ff7d,_0x8abd('0xd'));logger[_0x8abd('0xe')](_0x8abd('0xf'),_0x38ff7d,_0x8abd('0xd'),JSON[_0x8abd('0x10')](_0x30d682));if(_0x30d682[_0x8abd('0x11')]){if(_0x30d682[_0x8abd('0x11')]['code']===0x1f4){logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x38ff7d,_0x30d682[_0x8abd('0x11')]['message']);return _0x7c4bd0(_0x30d682[_0x8abd('0x11')][_0x8abd('0x12')]);}logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x38ff7d,_0x30d682[_0x8abd('0x11')][_0x8abd('0x12')]);return _0x14c8c5(_0x30d682[_0x8abd('0x11')][_0x8abd('0x12')]);}else{logger['info'](_0x8abd('0xc'),_0x38ff7d,_0x8abd('0xd'));_0x14c8c5(_0x30d682[_0x8abd('0x13')][_0x8abd('0x12')]);}})[_0x8abd('0x14')](function(_0x29b1e1){logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x38ff7d,_0x29b1e1);_0x7c4bd0(_0x29b1e1);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 8ac6cb9..6d2fc70 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x5e3521,_0x290718){var _0xd780a4=function(_0xded1f4){while(--_0xded1f4){_0x5e3521['push'](_0x5e3521['shift']());}};_0xd780a4(++_0x290718);}(_0xeda8,0x104));var _0x8eda=function(_0x42d4a7,_0x4b1dbe){_0x42d4a7=_0x42d4a7-0x0;var _0x8d7ec8=_0xeda8[_0x42d4a7];return _0x8d7ec8;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router; \ No newline at end of file +var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41caa5,_0x1f6d8b){var _0x4cab93=function(_0x2d271a){while(--_0x2d271a){_0x41caa5['push'](_0x41caa5['shift']());}};_0x4cab93(++_0x1f6d8b);}(_0x326f,0xd1));var _0xf326=function(_0x3c2b38,_0x1cc6d4){_0x3c2b38=_0x3c2b38-0x0;var _0x5eec52=_0x326f[_0x3c2b38];return _0x5eec52;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f4b5bb6..9c1d4a0 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 _0x9252=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x129a61,_0x5848a1){var _0x39b8db=function(_0x319ec1){while(--_0x319ec1){_0x129a61['push'](_0x129a61['shift']());}};_0x39b8db(++_0x5848a1);}(_0x9252,0x169));var _0x2925=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x9252[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0x2925('0x0'));module[_0x2925('0x1')]={'name':{'type':Sequelize[_0x2925('0x2')],'unique':_0x2925('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2925('0x2')]},'timeout':{'type':Sequelize[_0x2925('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2925('0x5')](_0x2925('0x6'),'beepall',_0x2925('0x7'))}}; \ No newline at end of file +var _0x08fc=['exports','STRING','name','ENUM','rrmemory','sequelize'];(function(_0x1d949e,_0x37e295){var _0x5af2dc=function(_0x130e93){while(--_0x130e93){_0x1d949e['push'](_0x1d949e['shift']());}};_0x5af2dc(++_0x37e295);}(_0x08fc,0x7d));var _0xc08f=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x08fc[_0x31c19c];return _0x1a87f7;};'use strict';var Sequelize=require(_0xc08f('0x0'));module[_0xc08f('0x1')]={'name':{'type':Sequelize[_0xc08f('0x2')],'unique':_0xc08f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc08f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc08f('0x4')](_0xc08f('0x5'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index cd0662e..0b2022d 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 _0x2005=['message','info','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','intersection','length','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','UserId','agent','chatPause','createdAt','format','SIP','getTeams','addTeams','Agents','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','compact','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s'];(function(_0xb77404,_0x2987e8){var _0xa12c19=function(_0x55b759){while(--_0x55b759){_0xb77404['push'](_0xb77404['shift']());}};_0xa12c19(++_0x2987e8);}(_0x2005,0xfb));var _0x5200=function(_0x2880d8,_0x284ded){_0x2880d8=_0x2880d8-0x0;var _0x51f5a9=_0x2005[_0x2880d8];return _0x51f5a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5200('0x0'));var zipdir=require(_0x5200('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5200('0x2'));var moment=require(_0x5200('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5200('0x4'));var util=require(_0x5200('0x5'));var path=require('path');var sox=require(_0x5200('0x6'));var csv=require(_0x5200('0x7'));var ejs=require(_0x5200('0x8'));var fs=require('fs');var fs_extra=require(_0x5200('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5200('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5200('0xb'));var toCsv=require(_0x5200('0x7'));var querystring=require(_0x5200('0xc'));var Papa=require(_0x5200('0xd'));var Redis=require(_0x5200('0xe'));var authService=require(_0x5200('0xf'));var qs=require(_0x5200('0x10'));var as=require(_0x5200('0x11'));var hardwareService=require(_0x5200('0x12'));var logger=require('../../config/logger')(_0x5200('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5200('0x14'));var db=require('../../mysqldb')['db'];config[_0x5200('0x15')]=_[_0x5200('0x16')](config[_0x5200('0x15')],{'host':_0x5200('0x17'),'port':0x18eb});var socket=require(_0x5200('0x18'))(new Redis(config['redis']));require(_0x5200('0x19'))[_0x5200('0x1a')](socket);var jayson=require(_0x5200('0x1b'));var client=jayson[_0x5200('0x1c')][_0x5200('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xef92a3,_0x55a845,_0x2046c0,_0x493902){return new BPromise(function(_0x36157e,_0x14c4d6){var _0x3e6629=_0x493902||client;return _0x3e6629['request'](_0xef92a3,_0x2046c0)[_0x5200('0x1e')](function(_0xec07f){logger['info']('ChatQueue,\x20%s,\x20%s',_0x55a845,_0x5200('0x1f'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x55a845,_0x5200('0x1f'),JSON[_0x5200('0x20')](_0xec07f));if(_0xec07f[_0x5200('0x21')]){if(_0xec07f['error']['code']===0x1f4){logger[_0x5200('0x21')](_0x5200('0x22'),_0x55a845,_0xec07f[_0x5200('0x21')][_0x5200('0x23')]);return _0x14c4d6(_0xec07f['error'][_0x5200('0x23')]);}logger['error'](_0x5200('0x22'),_0x55a845,_0xec07f[_0x5200('0x21')]['message']);return _0x36157e(_0xec07f[_0x5200('0x21')]['message']);}else{logger[_0x5200('0x24')]('ChatQueue,\x20%s,\x20%s',_0x55a845,_0x5200('0x1f'));_0x36157e(_0xec07f[_0x5200('0x25')]['message']);}})['catch'](function(_0x40af71){logger[_0x5200('0x21')](_0x5200('0x22'),_0x55a845,_0x40af71);_0x14c4d6(_0x40af71);});});}function respondWithStatusCode(_0xde5321,_0x141bfe){_0x141bfe=_0x141bfe||0xcc;return function(_0x54c2da){if(_0x54c2da){return _0xde5321[_0x5200('0x26')](_0x141bfe);}return _0xde5321[_0x5200('0x27')](_0x141bfe)[_0x5200('0x28')]();};}function respondWithResult(_0x1a8e6f,_0x661523){_0x661523=_0x661523||0xc8;return function(_0x5bedd){if(_0x5bedd){return _0x1a8e6f['status'](_0x661523)['json'](_0x5bedd);}};}function respondWithFilteredResult(_0x51c418,_0x2a1f60){return function(_0x5521fe){if(_0x5521fe){var _0x1c6c24=typeof _0x2a1f60[_0x5200('0x29')]===_0x5200('0x2a')&&typeof _0x2a1f60[_0x5200('0x2b')]===_0x5200('0x2a');var _0x3d40a1=_0x5521fe[_0x5200('0x2c')];var _0x59e4ba=_0x1c6c24?0x0:_0x2a1f60[_0x5200('0x29')];var _0x4938ce=_0x1c6c24?_0x5521fe[_0x5200('0x2c')]:_0x2a1f60['offset']+_0x2a1f60[_0x5200('0x2b')];var _0x17e999;if(_0x4938ce>=_0x3d40a1){_0x4938ce=_0x3d40a1;_0x17e999=0xc8;}else{_0x17e999=0xce;}_0x51c418[_0x5200('0x27')](_0x17e999);return _0x51c418[_0x5200('0x2d')](_0x5200('0x2e'),_0x59e4ba+'-'+_0x4938ce+'/'+_0x3d40a1)[_0x5200('0x2f')](_0x5521fe);}return null;};}function patchUpdates(_0x22e271){return function(_0x108070){try{jsonpatch[_0x5200('0x30')](_0x108070,_0x22e271,!![]);}catch(_0x40cd28){return BPromise[_0x5200('0x31')](_0x40cd28);}return _0x108070[_0x5200('0x32')]();};}function saveUpdates(_0x4d0beb,_0x34978b){return function(_0x28b9dd){if(_0x28b9dd){return _0x28b9dd[_0x5200('0x33')](_0x4d0beb)['then'](function(_0x288033){return _0x288033;});}return null;};}function removeEntity(_0x5bbe2d,_0x1cedb6){return function(_0x5e1bdf){if(_0x5e1bdf){return _0x5e1bdf[_0x5200('0x34')]()['then'](function(){var _0x1ca13e=_0x5e1bdf['get']({'plain':!![]});var _0x369893=_0x5200('0x35');return db[_0x5200('0x36')]['destroy']({'where':{'type':_0x369893,'resourceId':_0x1ca13e['id']}})['then'](function(){return _0x5e1bdf;});})['then'](function(){_0x5bbe2d[_0x5200('0x27')](0xcc)[_0x5200('0x28')]();});}};}function handleEntityNotFound(_0x50b8d6,_0x2ec51f){return function(_0x3552c4){if(!_0x3552c4){_0x50b8d6['sendStatus'](0x194);}return _0x3552c4;};}function handleError(_0x510823,_0x18173e){_0x18173e=_0x18173e||0x1f4;return function(_0x184f9f){logger[_0x5200('0x21')](_0x184f9f[_0x5200('0x37')]);if(_0x184f9f[_0x5200('0x38')]){delete _0x184f9f[_0x5200('0x38')];}_0x510823[_0x5200('0x27')](_0x18173e)[_0x5200('0x39')](_0x184f9f);};}exports[_0x5200('0x3a')]=function(_0x250b13,_0x328f0d){var _0x4e4ab6={},_0x190c9f={},_0x4f2341={'count':0x0,'rows':[]};var _0x5e920f=_[_0x5200('0x3b')](db[_0x5200('0x3c')][_0x5200('0x3d')],function(_0x53ca93){return{'name':_0x53ca93['fieldName'],'type':_0x53ca93[_0x5200('0x3e')][_0x5200('0x3f')]};});_0x190c9f[_0x5200('0x40')]=_[_0x5200('0x3b')](_0x5e920f,_0x5200('0x38'));_0x190c9f['query']=_['keys'](_0x250b13[_0x5200('0x41')]);_0x190c9f[_0x5200('0x42')]=_['intersection'](_0x190c9f[_0x5200('0x40')],_0x190c9f[_0x5200('0x41')]);_0x4e4ab6[_0x5200('0x43')]=_['intersection'](_0x190c9f[_0x5200('0x40')],qs[_0x5200('0x44')](_0x250b13[_0x5200('0x41')][_0x5200('0x44')]));_0x4e4ab6[_0x5200('0x43')]=_0x4e4ab6[_0x5200('0x43')]['length']?_0x4e4ab6[_0x5200('0x43')]:_0x190c9f[_0x5200('0x40')];if(!_0x250b13[_0x5200('0x41')]['hasOwnProperty'](_0x5200('0x45'))){_0x4e4ab6[_0x5200('0x2b')]=qs['limit'](_0x250b13[_0x5200('0x41')]['limit']);_0x4e4ab6[_0x5200('0x29')]=qs[_0x5200('0x29')](_0x250b13[_0x5200('0x41')][_0x5200('0x29')]);}_0x4e4ab6[_0x5200('0x46')]=qs[_0x5200('0x47')](_0x250b13['query'][_0x5200('0x47')]);_0x4e4ab6[_0x5200('0x48')]=qs['filters'](_[_0x5200('0x49')](_0x250b13[_0x5200('0x41')],_0x190c9f[_0x5200('0x42')]),_0x5e920f);if(_0x250b13[_0x5200('0x41')][_0x5200('0x4a')]){_0x4e4ab6[_0x5200('0x48')]=_[_0x5200('0x4b')](_0x4e4ab6[_0x5200('0x48')],{'$or':_[_0x5200('0x3b')](_0x5e920f,function(_0x588234){if(_0x588234[_0x5200('0x3e')]!==_0x5200('0x4c')){var _0x22b9f1={};_0x22b9f1[_0x588234[_0x5200('0x38')]]={'$like':'%'+_0x250b13[_0x5200('0x41')][_0x5200('0x4a')]+'%'};return _0x22b9f1;}})});}_0x4e4ab6=_['merge']({},_0x4e4ab6,_0x250b13[_0x5200('0x4d')]);var _0x35be5f={'where':_0x4e4ab6['where']};return db[_0x5200('0x3c')][_0x5200('0x2c')](_0x35be5f)[_0x5200('0x1e')](function(_0x141396){_0x4f2341[_0x5200('0x2c')]=_0x141396;if(_0x250b13[_0x5200('0x41')]['includeAll']){_0x4e4ab6['include']=[{'all':!![]}];}return db[_0x5200('0x3c')][_0x5200('0x4e')](_0x4e4ab6);})['then'](function(_0x1b31e4){_0x4f2341[_0x5200('0x4f')]=_0x1b31e4;return _0x4f2341;})['then'](respondWithFilteredResult(_0x328f0d,_0x4e4ab6))[_0x5200('0x50')](handleError(_0x328f0d,null));};exports[_0x5200('0x51')]=function(_0x1177a9,_0x16fef1){var _0x31d922={'raw':!![],'where':{'id':_0x1177a9[_0x5200('0x52')]['id']}},_0x5df57b={};_0x5df57b[_0x5200('0x40')]=_[_0x5200('0x53')](db['ChatQueue'][_0x5200('0x3d')]);_0x5df57b['query']=_['keys'](_0x1177a9['query']);_0x5df57b[_0x5200('0x42')]=_[_0x5200('0x54')](_0x5df57b[_0x5200('0x40')],_0x5df57b[_0x5200('0x41')]);_0x31d922[_0x5200('0x43')]=_['intersection'](_0x5df57b['model'],qs[_0x5200('0x44')](_0x1177a9[_0x5200('0x41')][_0x5200('0x44')]));_0x31d922['attributes']=_0x31d922[_0x5200('0x43')][_0x5200('0x55')]?_0x31d922[_0x5200('0x43')]:_0x5df57b[_0x5200('0x40')];if(_0x1177a9[_0x5200('0x41')][_0x5200('0x56')]){_0x31d922[_0x5200('0x57')]=[{'all':!![]}];}_0x31d922=_[_0x5200('0x4b')]({},_0x31d922,_0x1177a9[_0x5200('0x4d')]);return db[_0x5200('0x3c')][_0x5200('0x58')](_0x31d922)[_0x5200('0x1e')](handleEntityNotFound(_0x16fef1,null))[_0x5200('0x1e')](respondWithResult(_0x16fef1,null))['catch'](handleError(_0x16fef1,null));};exports[_0x5200('0x59')]=function(_0x3a370c,_0x51f04b){return db[_0x5200('0x3c')]['create'](_0x3a370c[_0x5200('0x5a')],{})[_0x5200('0x1e')](function(_0x2b9a8d){var _0x3f853f=_0x3a370c['user'][_0x5200('0x5b')]({'plain':!![]});if(!_0x3f853f)throw new Error(_0x5200('0x5c'));if(_0x3f853f['role']===_0x5200('0x5d')){var _0x3bd191=_0x2b9a8d[_0x5200('0x5b')]({'plain':!![]});var _0x416c1f='ChatQueues';return db[_0x5200('0x5e')][_0x5200('0x58')]({'where':{'name':_0x416c1f,'userProfileId':_0x3f853f[_0x5200('0x5f')]},'raw':!![]})[_0x5200('0x1e')](function(_0x4c586d){if(_0x4c586d&&_0x4c586d[_0x5200('0x60')]===0x0){return db[_0x5200('0x36')][_0x5200('0x59')]({'name':_0x3bd191[_0x5200('0x38')],'resourceId':_0x3bd191['id'],'type':_0x4c586d[_0x5200('0x38')],'sectionId':_0x4c586d['id']},{})['then'](function(){return _0x2b9a8d;});}else{return _0x2b9a8d;}})[_0x5200('0x50')](function(_0x4f99a4){logger['error'](_0x5200('0x61'),_0x4f99a4);throw _0x4f99a4;});}return _0x2b9a8d;})[_0x5200('0x1e')](respondWithResult(_0x51f04b,0xc9))[_0x5200('0x50')](handleError(_0x51f04b,null));};exports[_0x5200('0x33')]=function(_0x1c47a1,_0x53dcd6){if(_0x1c47a1['body']['id']){delete _0x1c47a1[_0x5200('0x5a')]['id'];}return db[_0x5200('0x3c')]['find']({'where':{'id':_0x1c47a1[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x53dcd6,null))['then'](saveUpdates(_0x1c47a1[_0x5200('0x5a')],null))[_0x5200('0x1e')](respondWithResult(_0x53dcd6,null))[_0x5200('0x50')](handleError(_0x53dcd6,null));};exports[_0x5200('0x34')]=function(_0x1ec7f2,_0x2eb685){return db[_0x5200('0x3c')]['find']({'where':{'id':_0x1ec7f2[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x2eb685,null))['then'](removeEntity(_0x2eb685,null))['catch'](handleError(_0x2eb685,null));};exports[_0x5200('0x62')]=function(_0x2b2dd9,_0x7c3ce7){return db['ChatQueue'][_0x5200('0x62')]()['then'](respondWithResult(_0x7c3ce7,null))[_0x5200('0x50')](handleError(_0x7c3ce7,null));};exports[_0x5200('0x63')]=function(_0x4897ea,_0x5556a9,_0x2c49be){var _0x3f9489={'raw':!![],'where':{}},_0x388a65={},_0x3ef5a7;return db[_0x5200('0x3c')][_0x5200('0x64')]({'where':{'id':_0x4897ea[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x5556a9,null))['then'](function(_0x2916c9){if(_0x2916c9){_0x3ef5a7=_0x2916c9[_0x5200('0x5b')]({'plain':!![]});_0x388a65[_0x5200('0x40')]=_[_0x5200('0x53')](db[_0x5200('0x65')]['rawAttributes']);_0x388a65[_0x5200('0x41')]=_['keys'](_0x4897ea['query']);_0x388a65[_0x5200('0x42')]=_[_0x5200('0x54')](_0x388a65[_0x5200('0x40')],_0x388a65[_0x5200('0x41')]);_0x3f9489[_0x5200('0x43')]=_[_0x5200('0x54')](_0x388a65[_0x5200('0x40')],qs[_0x5200('0x44')](_0x4897ea[_0x5200('0x41')][_0x5200('0x44')]));_0x3f9489[_0x5200('0x43')]=_0x3f9489[_0x5200('0x43')]['length']?_0x3f9489[_0x5200('0x43')]:_0x388a65[_0x5200('0x40')];if(!_0x4897ea[_0x5200('0x41')][_0x5200('0x66')](_0x5200('0x45'))){_0x3f9489[_0x5200('0x2b')]=qs[_0x5200('0x2b')](_0x4897ea[_0x5200('0x41')][_0x5200('0x2b')]);_0x3f9489[_0x5200('0x29')]=qs['offset'](_0x4897ea['query'][_0x5200('0x29')]);}_0x3f9489[_0x5200('0x46')]=qs[_0x5200('0x47')](_0x4897ea[_0x5200('0x41')][_0x5200('0x47')]);_0x3f9489[_0x5200('0x48')]=qs['filters'](_['pick'](_0x4897ea[_0x5200('0x41')],_0x388a65[_0x5200('0x42')]));_0x3f9489['where'][_0x5200('0x67')]=_0x2916c9['id'];if(_0x4897ea['query']['filter']){_0x3f9489['where']=_['merge'](_0x3f9489[_0x5200('0x48')],{'$or':_[_0x5200('0x3b')](_0x3f9489[_0x5200('0x43')],function(_0x143be1){var _0x1bdf60={};_0x1bdf60[_0x143be1]={'$like':'%'+_0x4897ea[_0x5200('0x41')][_0x5200('0x4a')]+'%'};return _0x1bdf60;})});}_0x3f9489=_[_0x5200('0x4b')]({},_0x3f9489,_0x4897ea[_0x5200('0x4d')]);return db[_0x5200('0x65')]['findAll'](_0x3f9489);}})[_0x5200('0x1e')](function(_0x6970a7){if(_0x6970a7){return db[_0x5200('0x68')]['findAndCountAll']({'where':{'id':_[_0x5200('0x3b')](_0x6970a7,_0x5200('0x69')),'role':_0x5200('0x6a')},'attributes':['id',_0x5200('0x38'),_0x5200('0x6b'),'updatedAt',_0x5200('0x6c')]});}})[_0x5200('0x1e')](function(_0x48fb79){if(_0x48fb79){return{'count':_0x48fb79[_0x5200('0x2c')],'rows':_['map'](_0x48fb79[_0x5200('0x4f')],function(_0x27c62a){return{'membername':_0x27c62a[_0x5200('0x38')],'UserId':_0x27c62a['id'],'queue_name':_0x3ef5a7[_0x5200('0x38')],'ChatQueueId':_0x3ef5a7['id'],'interface':util[_0x5200('0x6d')]('%s/%s',_0x5200('0x6e'),_0x27c62a['name']),'penalty':0x0,'paused':_0x27c62a['chatPause'],'createdAt':_0x27c62a[_0x5200('0x6c')],'updatedAt':_0x27c62a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5200('0x1e')](respondWithFilteredResult(_0x5556a9,_0x3f9489))['catch'](handleError(_0x5556a9,null));};exports[_0x5200('0x6f')]=function(_0x3482ac,_0x5812be,_0x5d995e){var _0x9b945e={};var _0x397f9c={};var _0x300b67;var _0x22f515;return db[_0x5200('0x3c')][_0x5200('0x64')]({'where':{'id':_0x3482ac[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x5812be,null))[_0x5200('0x1e')](function(_0x389f5d){if(_0x389f5d){_0x300b67=_0x389f5d;_0x397f9c[_0x5200('0x40')]=_[_0x5200('0x53')](db['Team']['rawAttributes']);_0x397f9c[_0x5200('0x41')]=_[_0x5200('0x53')](_0x3482ac[_0x5200('0x41')]);_0x397f9c[_0x5200('0x42')]=_['intersection'](_0x397f9c[_0x5200('0x40')],_0x397f9c[_0x5200('0x41')]);_0x9b945e[_0x5200('0x43')]=_[_0x5200('0x54')](_0x397f9c[_0x5200('0x40')],qs[_0x5200('0x44')](_0x3482ac['query'][_0x5200('0x44')]));_0x9b945e[_0x5200('0x43')]=_0x9b945e[_0x5200('0x43')][_0x5200('0x55')]?_0x9b945e['attributes']:_0x397f9c[_0x5200('0x40')];_0x9b945e['order']=qs['sort'](_0x3482ac[_0x5200('0x41')][_0x5200('0x47')]);_0x9b945e[_0x5200('0x48')]=qs[_0x5200('0x42')](_[_0x5200('0x49')](_0x3482ac[_0x5200('0x41')],_0x397f9c[_0x5200('0x42')]));if(_0x3482ac[_0x5200('0x41')]['filter']){_0x9b945e[_0x5200('0x48')]=_['merge'](_0x9b945e[_0x5200('0x48')],{'$or':_['map'](_0x9b945e['attributes'],function(_0x1f46d7){var _0x3894ab={};_0x3894ab[_0x1f46d7]={'$like':'%'+_0x3482ac[_0x5200('0x41')][_0x5200('0x4a')]+'%'};return _0x3894ab;})});}_0x9b945e=_['merge']({},_0x9b945e,_0x3482ac[_0x5200('0x4d')]);return _0x300b67['getTeams'](_0x9b945e);}})[_0x5200('0x1e')](function(_0x29e6f4){if(_0x29e6f4){_0x22f515=_0x29e6f4['length'];if(!_0x3482ac['query'][_0x5200('0x66')]('nolimit')){_0x9b945e[_0x5200('0x2b')]=qs[_0x5200('0x2b')](_0x3482ac[_0x5200('0x41')][_0x5200('0x2b')]);_0x9b945e['offset']=qs[_0x5200('0x29')](_0x3482ac[_0x5200('0x41')][_0x5200('0x29')]);}return _0x300b67[_0x5200('0x6f')](_0x9b945e);}})['then'](function(_0x508a31){if(_0x508a31){return _0x508a31?{'count':_0x22f515,'rows':_0x508a31}:null;}})[_0x5200('0x1e')](respondWithResult(_0x5812be,null))[_0x5200('0x50')](handleError(_0x5812be,null));};exports[_0x5200('0x70')]=function(_0x1923d9,_0x368329,_0xe0b38b){var _0x2de69f=_0x1923d9[_0x5200('0x5a')]['ids'];return db['Team'][_0x5200('0x4e')]({'where':{'id':_0x2de69f},'attributes':['id'],'include':[{'model':db[_0x5200('0x68')],'as':_0x5200('0x71'),'attributes':['id',_0x5200('0x38'),'online','voicePause','interface'],'raw':!![]}]})[_0x5200('0x1e')](function(_0x5b6816){if(_0x5b6816){var _0x412d2f=_[_0x5200('0x72')](_0x5b6816,function(_0x55b972){var _0x477946=_0x55b972[_0x5200('0x5b')]({'plain':!![]});return _0x477946['Agents'];});return db['ChatQueue'][_0x5200('0x58')]({'where':{'id':_0x1923d9['params']['id']}})[_0x5200('0x1e')](function(_0x2ab2c8){return db[_0x5200('0x73')][_0x5200('0x74')](function(_0x57ba4f){return _0x2ab2c8[_0x5200('0x70')](_0x2de69f,{'transaction':_0x57ba4f})['then'](function(){return BPromise[_0x5200('0x75')](_0x412d2f,function(_0x48f742){return db[_0x5200('0x65')][_0x5200('0x76')]({'where':{'UserId':_0x48f742['id'],'ChatQueueId':_0x1923d9[_0x5200('0x52')]['id']},'transaction':_0x57ba4f});});})[_0x5200('0x1e')](function(){_0x412d2f[_0x5200('0x77')](function(_0x3d49de){socket[_0x5200('0x78')](_0x5200('0x79'),{'UserId':_0x3d49de['id'],'ChatQueueId':_0x2ab2c8['id']});});});});});}})['then'](respondWithStatusCode(_0x368329,null))[_0x5200('0x50')](handleError(_0x368329,null));};exports[_0x5200('0x7a')]=function(_0x2972cb,_0x4ca58f,_0x478515){return db['Team'][_0x5200('0x4e')]({'where':{'id':_0x2972cb[_0x5200('0x41')][_0x5200('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x5200('0x68')],'as':_0x5200('0x71'),'attributes':['id'],'raw':!![]}]})[_0x5200('0x1e')](handleEntityNotFound(_0x4ca58f,null))[_0x5200('0x1e')](function(_0x6be7ec){var _0x1a8518=_['map'](_0x6be7ec,'id');var _0xea16d2=[];var _0x51c28b=[];var _0x40bfdd=squel[_0x5200('0x7c')]();_0x40bfdd[_0x5200('0x7d')](_0x5200('0x7e'))['from'](_0x5200('0x7f'),'tq')['join'](_0x5200('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5200('0x48')]('ChatQueueId\x20=\x20?',_0x2972cb[_0x5200('0x52')]['id']);for(var _0x5b879d=0x0;_0x5b879d<_0x6be7ec['length'];_0x5b879d+=0x1){let _0x58afd0=_0x6be7ec[_0x5b879d];for(var _0x393feb=0x0;_0x393feb<_0x58afd0[_0x5200('0x71')][_0x5200('0x55')];_0x393feb+=0x1){let _0x31dff7=_0x58afd0[_0x5200('0x71')][_0x393feb];var _0x14e65d=_0x40bfdd['clone']();_0x14e65d[_0x5200('0x48')](_0x5200('0x81'),_0x31dff7['id']);_0x51c28b['push'](db[_0x5200('0x73')][_0x5200('0x41')](_0x14e65d[_0x5200('0x82')](),{'type':db[_0x5200('0x73')]['QueryTypes'][_0x5200('0x83')]})[_0x5200('0x1e')](function(_0xd3314b){if(_0xd3314b['length']===0x1){return _0x31dff7['id'];}else{var _0x295107=_[_0x5200('0x84')](_['map'](_0xd3314b,_0x5200('0x85')),function(_0x28aed8){return _[_0x5200('0x86')](_0x1a8518,_0x28aed8);});if(_0x295107){return _0x31dff7['id'];}}}));}}return BPromise[_0x5200('0x87')](_0x51c28b)['then'](function(_0xb1fae7){_0xea16d2=_(_0xea16d2)['union'](_0xb1fae7)[_0x5200('0x88')]()['value']();return db[_0x5200('0x3c')][_0x5200('0x58')]({'where':{'id':_0x2972cb['params']['id']}})['then'](function(_0x43262b){return db[_0x5200('0x73')]['transaction'](function(_0x328ec3){return _0x43262b[_0x5200('0x7a')](_0x2972cb['query'][_0x5200('0x7b')],{'transaction':_0x328ec3})[_0x5200('0x1e')](function(){if(!_['isEmpty'](_0xea16d2)){return _0x43262b[_0x5200('0x89')](_0xea16d2,{'transaction':_0x328ec3});}})[_0x5200('0x1e')](function(){_0xea16d2[_0x5200('0x77')](function(_0x1e1c5d){socket[_0x5200('0x78')](_0x5200('0x8a'),{'UserId':_0x1e1c5d,'ChatQueueId':_0x43262b['id']});});});});});});})[_0x5200('0x1e')](respondWithStatusCode(_0x4ca58f,null))['catch'](handleError(_0x4ca58f,null));};exports[_0x5200('0x8b')]=function(_0x585e87,_0x24c9e8,_0x323817){return db[_0x5200('0x3c')][_0x5200('0x58')]({'where':{'id':_0x585e87['params']['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x24c9e8,null))[_0x5200('0x1e')](function(_0x3d703e){if(_0x3d703e){return _0x3d703e[_0x5200('0x8b')](_0x585e87[_0x5200('0x5a')]['ids'],_['omit'](_0x585e87[_0x5200('0x5a')],['ids','id'])||{})[_0x5200('0x8c')](function(_0x2016ab){for(var _0x23f5d0=0x0;_0x23f5d0<_0x585e87[_0x5200('0x5a')][_0x5200('0x7b')][_0x5200('0x55')];_0x23f5d0+=0x1){socket[_0x5200('0x78')](_0x5200('0x79'),{'UserId':Number(_0x585e87[_0x5200('0x5a')]['ids'][_0x23f5d0]),'ChatQueueId':Number(_0x585e87[_0x5200('0x52')]['id'])});}return _0x2016ab;});}})[_0x5200('0x1e')](respondWithResult(_0x24c9e8,null))[_0x5200('0x50')](handleError(_0x24c9e8,null));};exports[_0x5200('0x89')]=function(_0x1a801a,_0x5cd3c6,_0x2510e1){return db[_0x5200('0x3c')][_0x5200('0x58')]({'where':{'id':_0x1a801a[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x5cd3c6,null))[_0x5200('0x1e')](function(_0x2a4d04){if(_0x2a4d04){return _0x2a4d04[_0x5200('0x89')](_0x1a801a[_0x5200('0x41')][_0x5200('0x7b')])['then'](function(){if(_[_0x5200('0x8d')](_0x1a801a[_0x5200('0x41')]['ids'])){for(var _0x3f5f84=0x0;_0x3f5f84<_0x1a801a[_0x5200('0x41')][_0x5200('0x7b')][_0x5200('0x55')];_0x3f5f84+=0x1){socket[_0x5200('0x78')](_0x5200('0x8a'),{'UserId':Number(_0x1a801a[_0x5200('0x41')][_0x5200('0x7b')][_0x3f5f84]),'ChatQueueId':Number(_0x1a801a[_0x5200('0x52')]['id'])});}}else{socket[_0x5200('0x78')](_0x5200('0x8a'),{'UserId':Number(_0x1a801a['query'][_0x5200('0x7b')]),'ChatQueueId':Number(_0x1a801a[_0x5200('0x52')]['id'])});}});}})[_0x5200('0x1e')](respondWithStatusCode(_0x5cd3c6,null))['catch'](handleError(_0x5cd3c6,null));};exports[_0x5200('0x8e')]=function(_0x298863,_0xbf4b69,_0x4a823c){var _0x405cfb={};var _0xd3d7ce={};var _0x1017f9;var _0x85adcd;return db[_0x5200('0x3c')][_0x5200('0x64')]({'where':{'id':_0x298863[_0x5200('0x52')]['id']}})['then'](handleEntityNotFound(_0xbf4b69,null))[_0x5200('0x1e')](function(_0x4878bf){if(_0x4878bf){_0x1017f9=_0x4878bf;_0xd3d7ce['model']=_[_0x5200('0x53')](db[_0x5200('0x68')][_0x5200('0x3d')]);_0xd3d7ce['query']=_[_0x5200('0x53')](_0x298863[_0x5200('0x41')]);_0xd3d7ce[_0x5200('0x42')]=_[_0x5200('0x54')](_0xd3d7ce[_0x5200('0x40')],_0xd3d7ce[_0x5200('0x41')]);_0x405cfb[_0x5200('0x43')]=_[_0x5200('0x54')](_0xd3d7ce['model'],qs[_0x5200('0x44')](_0x298863[_0x5200('0x41')][_0x5200('0x44')]));_0x405cfb[_0x5200('0x43')]=_0x405cfb[_0x5200('0x43')][_0x5200('0x55')]?_0x405cfb[_0x5200('0x43')]:_0xd3d7ce[_0x5200('0x40')];_0x405cfb[_0x5200('0x46')]=qs[_0x5200('0x47')](_0x298863[_0x5200('0x41')]['sort']);_0x405cfb[_0x5200('0x48')]=qs[_0x5200('0x42')](_[_0x5200('0x49')](_0x298863['query'],_0xd3d7ce['filters']));if(_0x298863[_0x5200('0x41')][_0x5200('0x4a')]){_0x405cfb[_0x5200('0x48')]=_['merge'](_0x405cfb[_0x5200('0x48')],{'$or':_[_0x5200('0x3b')](_0x405cfb[_0x5200('0x43')],function(_0x14a066){var _0x4322d5={};_0x4322d5[_0x14a066]={'$like':'%'+_0x298863['query'][_0x5200('0x4a')]+'%'};return _0x4322d5;})});}_0x405cfb=_[_0x5200('0x4b')]({},_0x405cfb,_0x298863[_0x5200('0x4d')]);return _0x1017f9[_0x5200('0x8e')](_0x405cfb);}})['then'](function(_0x4ae854){if(_0x4ae854){_0x85adcd=_0x4ae854[_0x5200('0x55')];if(!_0x298863[_0x5200('0x41')]['hasOwnProperty']('nolimit')){_0x405cfb['limit']=qs[_0x5200('0x2b')](_0x298863['query'][_0x5200('0x2b')]);_0x405cfb[_0x5200('0x29')]=qs[_0x5200('0x29')](_0x298863[_0x5200('0x41')]['offset']);}return _0x1017f9[_0x5200('0x8e')](_0x405cfb);}})[_0x5200('0x1e')](function(_0x3ae976){if(_0x3ae976){return _0x3ae976?{'count':_0x85adcd,'rows':_0x3ae976}:null;}})[_0x5200('0x1e')](respondWithResult(_0xbf4b69,null))['catch'](handleError(_0xbf4b69,null));}; \ No newline at end of file +var _0x13d5=['show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','findAll','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','removeTeams','ids','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','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','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','limit','count','Content-Range','json','save','update','then','get','ChatQueues','UserProfileResource','end','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x13d5,0x182));var _0x513d=function(_0x3948b4,_0x398699){_0x3948b4=_0x3948b4-0x0;var _0x32a452=_0x13d5[_0x3948b4];return _0x32a452;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x513d('0x0'));var zipdir=require(_0x513d('0x1'));var jsonpatch=require(_0x513d('0x2'));var rp=require('request-promise');var moment=require(_0x513d('0x3'));var BPromise=require(_0x513d('0x4'));var Mustache=require(_0x513d('0x5'));var util=require(_0x513d('0x6'));var path=require(_0x513d('0x7'));var sox=require(_0x513d('0x8'));var csv=require(_0x513d('0x9'));var ejs=require(_0x513d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x513d('0xb'));var squel=require(_0x513d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x513d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x513d('0xe'));var Papa=require('papaparse');var Redis=require(_0x513d('0xf'));var authService=require(_0x513d('0x10'));var qs=require(_0x513d('0x11'));var as=require(_0x513d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x513d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x513d('0x14'));var licenseUtil=require(_0x513d('0x15'));var db=require(_0x513d('0x16'))['db'];config[_0x513d('0x17')]=_[_0x513d('0x18')](config[_0x513d('0x17')],{'host':_0x513d('0x19'),'port':0x18eb});var socket=require(_0x513d('0x1a'))(new Redis(config[_0x513d('0x17')]));require(_0x513d('0x1b'))['register'](socket);var jayson=require(_0x513d('0x1c'));var client=jayson[_0x513d('0x1d')][_0x513d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3c95eb,_0x14129d,_0x51e664,_0x480509){return new BPromise(function(_0x4ccace,_0x125019){var _0xfadd6f=_0x480509||client;return _0xfadd6f[_0x513d('0x1f')](_0x3c95eb,_0x51e664)['then'](function(_0x109fa5){logger['info'](_0x513d('0x20'),_0x14129d,'request\x20sent');logger[_0x513d('0x21')](_0x513d('0x22'),_0x14129d,_0x513d('0x23'),JSON[_0x513d('0x24')](_0x109fa5));if(_0x109fa5[_0x513d('0x25')]){if(_0x109fa5[_0x513d('0x25')][_0x513d('0x26')]===0x1f4){logger[_0x513d('0x25')](_0x513d('0x20'),_0x14129d,_0x109fa5[_0x513d('0x25')][_0x513d('0x27')]);return _0x125019(_0x109fa5['error']['message']);}logger[_0x513d('0x25')](_0x513d('0x20'),_0x14129d,_0x109fa5[_0x513d('0x25')][_0x513d('0x27')]);return _0x4ccace(_0x109fa5[_0x513d('0x25')][_0x513d('0x27')]);}else{logger[_0x513d('0x28')](_0x513d('0x20'),_0x14129d,_0x513d('0x23'));_0x4ccace(_0x109fa5[_0x513d('0x29')][_0x513d('0x27')]);}})['catch'](function(_0x553166){logger[_0x513d('0x25')](_0x513d('0x20'),_0x14129d,_0x553166);_0x125019(_0x553166);});});}function respondWithStatusCode(_0x49c9e3,_0x2dc610){_0x2dc610=_0x2dc610||0xcc;return function(_0x355e8c){if(_0x355e8c){return _0x49c9e3[_0x513d('0x2a')](_0x2dc610);}return _0x49c9e3[_0x513d('0x2b')](_0x2dc610)['end']();};}function respondWithResult(_0x3ea667,_0xa04b61){_0xa04b61=_0xa04b61||0xc8;return function(_0x1e64ad){if(_0x1e64ad){return _0x3ea667['status'](_0xa04b61)['json'](_0x1e64ad);}};}function respondWithFilteredResult(_0x3a1147,_0x4f43b8){return function(_0x2337ac){if(_0x2337ac){var _0x53865a=typeof _0x4f43b8[_0x513d('0x2c')]===_0x513d('0x2d')&&typeof _0x4f43b8[_0x513d('0x2e')]===_0x513d('0x2d');var _0x954072=_0x2337ac[_0x513d('0x2f')];var _0x20771b=_0x53865a?0x0:_0x4f43b8[_0x513d('0x2c')];var _0x3c4487=_0x53865a?_0x2337ac[_0x513d('0x2f')]:_0x4f43b8[_0x513d('0x2c')]+_0x4f43b8[_0x513d('0x2e')];var _0x45c9b1;if(_0x3c4487>=_0x954072){_0x3c4487=_0x954072;_0x45c9b1=0xc8;}else{_0x45c9b1=0xce;}_0x3a1147['status'](_0x45c9b1);return _0x3a1147['set'](_0x513d('0x30'),_0x20771b+'-'+_0x3c4487+'/'+_0x954072)[_0x513d('0x31')](_0x2337ac);}return null;};}function patchUpdates(_0x4ac904){return function(_0x195f7e){try{jsonpatch['apply'](_0x195f7e,_0x4ac904,!![]);}catch(_0x204c3c){return BPromise['reject'](_0x204c3c);}return _0x195f7e[_0x513d('0x32')]();};}function saveUpdates(_0x527029,_0x40f697){return function(_0xfdd438){if(_0xfdd438){return _0xfdd438[_0x513d('0x33')](_0x527029)[_0x513d('0x34')](function(_0xf1c37d){return _0xf1c37d;});}return null;};}function removeEntity(_0x2a5cc0,_0x317dc3){return function(_0x3a3173){if(_0x3a3173){return _0x3a3173['destroy']()[_0x513d('0x34')](function(){var _0xa6b15c=_0x3a3173[_0x513d('0x35')]({'plain':!![]});var _0x4629ea=_0x513d('0x36');return db[_0x513d('0x37')]['destroy']({'where':{'type':_0x4629ea,'resourceId':_0xa6b15c['id']}})[_0x513d('0x34')](function(){return _0x3a3173;});})[_0x513d('0x34')](function(){_0x2a5cc0[_0x513d('0x2b')](0xcc)[_0x513d('0x38')]();});}};}function handleEntityNotFound(_0x246346,_0x5ce53e){return function(_0x487b8e){if(!_0x487b8e){_0x246346['sendStatus'](0x194);}return _0x487b8e;};}function handleError(_0x54c5ec,_0x46efe7){_0x46efe7=_0x46efe7||0x1f4;return function(_0x55247d){logger[_0x513d('0x25')](_0x55247d['stack']);if(_0x55247d[_0x513d('0x39')]){delete _0x55247d[_0x513d('0x39')];}_0x54c5ec['status'](_0x46efe7)[_0x513d('0x3a')](_0x55247d);};}exports[_0x513d('0x3b')]=function(_0xf79bd,_0x44d669){var _0x31615f={},_0x6d772d={},_0x4cb7eb={'count':0x0,'rows':[]};var _0x54e195=_['map'](db[_0x513d('0x3c')][_0x513d('0x3d')],function(_0x422276){return{'name':_0x422276[_0x513d('0x3e')],'type':_0x422276[_0x513d('0x3f')][_0x513d('0x40')]};});_0x6d772d[_0x513d('0x41')]=_[_0x513d('0x42')](_0x54e195,_0x513d('0x39'));_0x6d772d[_0x513d('0x43')]=_[_0x513d('0x44')](_0xf79bd[_0x513d('0x43')]);_0x6d772d[_0x513d('0x45')]=_['intersection'](_0x6d772d[_0x513d('0x41')],_0x6d772d['query']);_0x31615f['attributes']=_[_0x513d('0x46')](_0x6d772d['model'],qs[_0x513d('0x47')](_0xf79bd[_0x513d('0x43')][_0x513d('0x47')]));_0x31615f['attributes']=_0x31615f[_0x513d('0x48')][_0x513d('0x49')]?_0x31615f['attributes']:_0x6d772d['model'];if(!_0xf79bd[_0x513d('0x43')]['hasOwnProperty'](_0x513d('0x4a'))){_0x31615f[_0x513d('0x2e')]=qs[_0x513d('0x2e')](_0xf79bd[_0x513d('0x43')]['limit']);_0x31615f[_0x513d('0x2c')]=qs['offset'](_0xf79bd['query']['offset']);}_0x31615f[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0xf79bd[_0x513d('0x43')][_0x513d('0x4c')]);_0x31615f[_0x513d('0x4d')]=qs['filters'](_[_0x513d('0x4e')](_0xf79bd[_0x513d('0x43')],_0x6d772d[_0x513d('0x45')]),_0x54e195);if(_0xf79bd['query'][_0x513d('0x4f')]){_0x31615f[_0x513d('0x4d')]=_[_0x513d('0x50')](_0x31615f[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x54e195,function(_0xb04503){if(_0xb04503[_0x513d('0x3f')]!==_0x513d('0x51')){var _0x1aaea8={};_0x1aaea8[_0xb04503[_0x513d('0x39')]]={'$like':'%'+_0xf79bd['query'][_0x513d('0x4f')]+'%'};return _0x1aaea8;}})});}_0x31615f=_[_0x513d('0x50')]({},_0x31615f,_0xf79bd[_0x513d('0x52')]);var _0x57c14e={'where':_0x31615f[_0x513d('0x4d')]};return db[_0x513d('0x3c')][_0x513d('0x2f')](_0x57c14e)[_0x513d('0x34')](function(_0x416932){_0x4cb7eb[_0x513d('0x2f')]=_0x416932;if(_0xf79bd['query'][_0x513d('0x53')]){_0x31615f[_0x513d('0x54')]=[{'all':!![]}];}return db[_0x513d('0x3c')]['findAll'](_0x31615f);})[_0x513d('0x34')](function(_0x1029a2){_0x4cb7eb['rows']=_0x1029a2;return _0x4cb7eb;})[_0x513d('0x34')](respondWithFilteredResult(_0x44d669,_0x31615f))['catch'](handleError(_0x44d669,null));};exports[_0x513d('0x55')]=function(_0x204bcd,_0x4c99ad){var _0x8b7c9f={'raw':!![],'where':{'id':_0x204bcd[_0x513d('0x56')]['id']}},_0x1e6338={};_0x1e6338[_0x513d('0x41')]=_[_0x513d('0x44')](db['ChatQueue']['rawAttributes']);_0x1e6338['query']=_[_0x513d('0x44')](_0x204bcd[_0x513d('0x43')]);_0x1e6338[_0x513d('0x45')]=_['intersection'](_0x1e6338[_0x513d('0x41')],_0x1e6338[_0x513d('0x43')]);_0x8b7c9f[_0x513d('0x48')]=_[_0x513d('0x46')](_0x1e6338['model'],qs[_0x513d('0x47')](_0x204bcd[_0x513d('0x43')][_0x513d('0x47')]));_0x8b7c9f[_0x513d('0x48')]=_0x8b7c9f['attributes']['length']?_0x8b7c9f['attributes']:_0x1e6338['model'];if(_0x204bcd['query'][_0x513d('0x53')]){_0x8b7c9f[_0x513d('0x54')]=[{'all':!![]}];}_0x8b7c9f=_['merge']({},_0x8b7c9f,_0x204bcd[_0x513d('0x52')]);return db[_0x513d('0x3c')][_0x513d('0x57')](_0x8b7c9f)[_0x513d('0x34')](handleEntityNotFound(_0x4c99ad,null))[_0x513d('0x34')](respondWithResult(_0x4c99ad,null))[_0x513d('0x58')](handleError(_0x4c99ad,null));};exports[_0x513d('0x59')]=function(_0x2aa86a,_0x496fe6){return db[_0x513d('0x3c')][_0x513d('0x59')](_0x2aa86a['body'],{})[_0x513d('0x34')](function(_0x2a5de2){var _0x41f507=_0x2aa86a[_0x513d('0x5a')][_0x513d('0x35')]({'plain':!![]});if(!_0x41f507)throw new Error(_0x513d('0x5b'));if(_0x41f507[_0x513d('0x5c')]===_0x513d('0x5a')){var _0x13712c=_0x2a5de2[_0x513d('0x35')]({'plain':!![]});var _0x22b017='ChatQueues';return db[_0x513d('0x5d')][_0x513d('0x57')]({'where':{'name':_0x22b017,'userProfileId':_0x41f507[_0x513d('0x5e')]},'raw':!![]})[_0x513d('0x34')](function(_0x5f1b16){if(_0x5f1b16&&_0x5f1b16[_0x513d('0x5f')]===0x0){return db[_0x513d('0x37')]['create']({'name':_0x13712c[_0x513d('0x39')],'resourceId':_0x13712c['id'],'type':_0x5f1b16[_0x513d('0x39')],'sectionId':_0x5f1b16['id']},{})[_0x513d('0x34')](function(){return _0x2a5de2;});}else{return _0x2a5de2;}})[_0x513d('0x58')](function(_0x3e7049){logger['error'](_0x513d('0x60'),_0x3e7049);throw _0x3e7049;});}return _0x2a5de2;})[_0x513d('0x34')](respondWithResult(_0x496fe6,0xc9))[_0x513d('0x58')](handleError(_0x496fe6,null));};exports[_0x513d('0x33')]=function(_0xd8ad8f,_0x1aeaa9){if(_0xd8ad8f[_0x513d('0x61')]['id']){delete _0xd8ad8f[_0x513d('0x61')]['id'];}return db[_0x513d('0x3c')][_0x513d('0x57')]({'where':{'id':_0xd8ad8f[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x1aeaa9,null))[_0x513d('0x34')](saveUpdates(_0xd8ad8f[_0x513d('0x61')],null))[_0x513d('0x34')](respondWithResult(_0x1aeaa9,null))[_0x513d('0x58')](handleError(_0x1aeaa9,null));};exports[_0x513d('0x62')]=function(_0x5078e3,_0x1a4d1a){return db['ChatQueue'][_0x513d('0x57')]({'where':{'id':_0x5078e3[_0x513d('0x56')]['id']}})['then'](handleEntityNotFound(_0x1a4d1a,null))['then'](removeEntity(_0x1a4d1a,null))['catch'](handleError(_0x1a4d1a,null));};exports[_0x513d('0x63')]=function(_0x4c1f77,_0x1c3fbf){return db[_0x513d('0x3c')]['describe']()[_0x513d('0x34')](respondWithResult(_0x1c3fbf,null))['catch'](handleError(_0x1c3fbf,null));};exports[_0x513d('0x64')]=function(_0xb20e68,_0x125a95,_0x35d321){var _0x30e8b0={'raw':!![],'where':{}},_0x40cd12={},_0x40056c;return db[_0x513d('0x3c')][_0x513d('0x65')]({'where':{'id':_0xb20e68[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x125a95,null))[_0x513d('0x34')](function(_0x5a3580){if(_0x5a3580){_0x40056c=_0x5a3580[_0x513d('0x35')]({'plain':!![]});_0x40cd12[_0x513d('0x41')]=_[_0x513d('0x44')](db[_0x513d('0x66')]['rawAttributes']);_0x40cd12[_0x513d('0x43')]=_[_0x513d('0x44')](_0xb20e68[_0x513d('0x43')]);_0x40cd12[_0x513d('0x45')]=_[_0x513d('0x46')](_0x40cd12[_0x513d('0x41')],_0x40cd12[_0x513d('0x43')]);_0x30e8b0[_0x513d('0x48')]=_[_0x513d('0x46')](_0x40cd12[_0x513d('0x41')],qs[_0x513d('0x47')](_0xb20e68[_0x513d('0x43')][_0x513d('0x47')]));_0x30e8b0['attributes']=_0x30e8b0[_0x513d('0x48')]['length']?_0x30e8b0['attributes']:_0x40cd12[_0x513d('0x41')];if(!_0xb20e68['query'][_0x513d('0x67')](_0x513d('0x4a'))){_0x30e8b0['limit']=qs['limit'](_0xb20e68[_0x513d('0x43')][_0x513d('0x2e')]);_0x30e8b0[_0x513d('0x2c')]=qs[_0x513d('0x2c')](_0xb20e68[_0x513d('0x43')][_0x513d('0x2c')]);}_0x30e8b0[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0xb20e68[_0x513d('0x43')][_0x513d('0x4c')]);_0x30e8b0['where']=qs[_0x513d('0x45')](_['pick'](_0xb20e68[_0x513d('0x43')],_0x40cd12['filters']));_0x30e8b0['where']['ChatQueueId']=_0x5a3580['id'];if(_0xb20e68[_0x513d('0x43')]['filter']){_0x30e8b0['where']=_[_0x513d('0x50')](_0x30e8b0[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x30e8b0[_0x513d('0x48')],function(_0x3d06a0){var _0x6cabb0={};_0x6cabb0[_0x3d06a0]={'$like':'%'+_0xb20e68[_0x513d('0x43')]['filter']+'%'};return _0x6cabb0;})});}_0x30e8b0=_[_0x513d('0x50')]({},_0x30e8b0,_0xb20e68[_0x513d('0x52')]);return db[_0x513d('0x66')][_0x513d('0x68')](_0x30e8b0);}})[_0x513d('0x34')](function(_0x4da859){if(_0x4da859){return db[_0x513d('0x69')][_0x513d('0x6a')]({'where':{'id':_['map'](_0x4da859,_0x513d('0x6b')),'role':'agent'},'attributes':['id',_0x513d('0x39'),_0x513d('0x6c'),_0x513d('0x6d'),_0x513d('0x6e')]});}})[_0x513d('0x34')](function(_0x3e559c){if(_0x3e559c){return{'count':_0x3e559c[_0x513d('0x2f')],'rows':_[_0x513d('0x42')](_0x3e559c[_0x513d('0x6f')],function(_0x19d890){return{'membername':_0x19d890[_0x513d('0x39')],'UserId':_0x19d890['id'],'queue_name':_0x40056c[_0x513d('0x39')],'ChatQueueId':_0x40056c['id'],'interface':util[_0x513d('0x70')](_0x513d('0x71'),_0x513d('0x72'),_0x19d890[_0x513d('0x39')]),'penalty':0x0,'paused':_0x19d890[_0x513d('0x6c')],'createdAt':_0x19d890['createdAt'],'updatedAt':_0x19d890[_0x513d('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x513d('0x34')](respondWithFilteredResult(_0x125a95,_0x30e8b0))['catch'](handleError(_0x125a95,null));};exports['getTeams']=function(_0x369597,_0x5e8b95,_0x58e467){var _0x528f3f={};var _0x7e0213={};var _0x3bbd27;var _0x5e90d4;return db[_0x513d('0x3c')][_0x513d('0x65')]({'where':{'id':_0x369597['params']['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x5e8b95,null))[_0x513d('0x34')](function(_0x3c8273){if(_0x3c8273){_0x3bbd27=_0x3c8273;_0x7e0213[_0x513d('0x41')]=_['keys'](db[_0x513d('0x73')]['rawAttributes']);_0x7e0213[_0x513d('0x43')]=_[_0x513d('0x44')](_0x369597[_0x513d('0x43')]);_0x7e0213['filters']=_[_0x513d('0x46')](_0x7e0213[_0x513d('0x41')],_0x7e0213[_0x513d('0x43')]);_0x528f3f['attributes']=_['intersection'](_0x7e0213[_0x513d('0x41')],qs['fields'](_0x369597[_0x513d('0x43')][_0x513d('0x47')]));_0x528f3f[_0x513d('0x48')]=_0x528f3f['attributes'][_0x513d('0x49')]?_0x528f3f['attributes']:_0x7e0213[_0x513d('0x41')];_0x528f3f[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0x369597[_0x513d('0x43')][_0x513d('0x4c')]);_0x528f3f[_0x513d('0x4d')]=qs[_0x513d('0x45')](_[_0x513d('0x4e')](_0x369597['query'],_0x7e0213[_0x513d('0x45')]));if(_0x369597[_0x513d('0x43')][_0x513d('0x4f')]){_0x528f3f[_0x513d('0x4d')]=_[_0x513d('0x50')](_0x528f3f[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x528f3f[_0x513d('0x48')],function(_0x37c068){var _0x5b21b6={};_0x5b21b6[_0x37c068]={'$like':'%'+_0x369597[_0x513d('0x43')][_0x513d('0x4f')]+'%'};return _0x5b21b6;})});}_0x528f3f=_['merge']({},_0x528f3f,_0x369597[_0x513d('0x52')]);return _0x3bbd27['getTeams'](_0x528f3f);}})[_0x513d('0x34')](function(_0x149a19){if(_0x149a19){_0x5e90d4=_0x149a19[_0x513d('0x49')];if(!_0x369597[_0x513d('0x43')][_0x513d('0x67')](_0x513d('0x4a'))){_0x528f3f[_0x513d('0x2e')]=qs[_0x513d('0x2e')](_0x369597[_0x513d('0x43')][_0x513d('0x2e')]);_0x528f3f[_0x513d('0x2c')]=qs[_0x513d('0x2c')](_0x369597[_0x513d('0x43')][_0x513d('0x2c')]);}return _0x3bbd27[_0x513d('0x74')](_0x528f3f);}})[_0x513d('0x34')](function(_0x31d3ed){if(_0x31d3ed){return _0x31d3ed?{'count':_0x5e90d4,'rows':_0x31d3ed}:null;}})[_0x513d('0x34')](respondWithResult(_0x5e8b95,null))[_0x513d('0x58')](handleError(_0x5e8b95,null));};exports[_0x513d('0x75')]=function(_0x1849e0,_0x49dbd4,_0x4bba05){var _0x160ab7=_0x1849e0['body']['ids'];return db[_0x513d('0x73')]['findAll']({'where':{'id':_0x160ab7},'attributes':['id'],'include':[{'model':db[_0x513d('0x69')],'as':_0x513d('0x76'),'attributes':['id',_0x513d('0x39'),_0x513d('0x77'),_0x513d('0x78'),_0x513d('0x79')],'raw':!![]}]})['then'](function(_0x3ee42b){if(_0x3ee42b){var _0x3862c7=_[_0x513d('0x7a')](_0x3ee42b,function(_0x805e93){var _0x23191f=_0x805e93[_0x513d('0x35')]({'plain':!![]});return _0x23191f[_0x513d('0x76')];});return db['ChatQueue'][_0x513d('0x57')]({'where':{'id':_0x1849e0[_0x513d('0x56')]['id']}})['then'](function(_0x3200a8){return db[_0x513d('0x7b')][_0x513d('0x7c')](function(_0x37230a){return _0x3200a8[_0x513d('0x75')](_0x160ab7,{'transaction':_0x37230a})[_0x513d('0x34')](function(){return BPromise[_0x513d('0x7d')](_0x3862c7,function(_0x10b30b){return db[_0x513d('0x66')][_0x513d('0x7e')]({'where':{'UserId':_0x10b30b['id'],'ChatQueueId':_0x1849e0[_0x513d('0x56')]['id']},'transaction':_0x37230a});});})[_0x513d('0x34')](function(){_0x3862c7['forEach'](function(_0x2f26e7){socket['emit']('userChatQueue:save',{'UserId':_0x2f26e7['id'],'ChatQueueId':_0x3200a8['id']});});});});});}})[_0x513d('0x34')](respondWithStatusCode(_0x49dbd4,null))[_0x513d('0x58')](handleError(_0x49dbd4,null));};exports[_0x513d('0x7f')]=function(_0x5bc83e,_0x29a914,_0x211658){return db[_0x513d('0x73')][_0x513d('0x68')]({'where':{'id':_0x5bc83e[_0x513d('0x43')][_0x513d('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x513d('0x34')](handleEntityNotFound(_0x29a914,null))[_0x513d('0x34')](function(_0x2e7e71){var _0x1edff0=_[_0x513d('0x42')](_0x2e7e71,'id');var _0x158e02=[];var _0xcb4469=[];var _0x3ba62e=squel[_0x513d('0x81')]();_0x3ba62e[_0x513d('0x82')](_0x513d('0x83'))['from'](_0x513d('0x84'),'tq')['join'](_0x513d('0x85'),'ut',_0x513d('0x86'))[_0x513d('0x4d')](_0x513d('0x87'),_0x5bc83e[_0x513d('0x56')]['id']);for(var _0xbcbf64=0x0;_0xbcbf64<_0x2e7e71[_0x513d('0x49')];_0xbcbf64+=0x1){let _0x22554a=_0x2e7e71[_0xbcbf64];for(var _0x3eab60=0x0;_0x3eab60<_0x22554a[_0x513d('0x76')][_0x513d('0x49')];_0x3eab60+=0x1){let _0x69f3e6=_0x22554a[_0x513d('0x76')][_0x3eab60];var _0x395681=_0x3ba62e[_0x513d('0x88')]();_0x395681['where'](_0x513d('0x89'),_0x69f3e6['id']);_0xcb4469['push'](db[_0x513d('0x7b')][_0x513d('0x43')](_0x395681['toString'](),{'type':db['sequelize'][_0x513d('0x8a')][_0x513d('0x8b')]})[_0x513d('0x34')](function(_0xb92bf7){if(_0xb92bf7[_0x513d('0x49')]===0x1){return _0x69f3e6['id'];}else{var _0x225e06=_[_0x513d('0x8c')](_[_0x513d('0x42')](_0xb92bf7,_0x513d('0x8d')),function(_0x3a0684){return _[_0x513d('0x8e')](_0x1edff0,_0x3a0684);});if(_0x225e06){return _0x69f3e6['id'];}}}));}}return BPromise[_0x513d('0x8f')](_0xcb4469)['then'](function(_0x1752b4){_0x158e02=_(_0x158e02)[_0x513d('0x90')](_0x1752b4)['compact']()[_0x513d('0x91')]();return db[_0x513d('0x3c')][_0x513d('0x57')]({'where':{'id':_0x5bc83e[_0x513d('0x56')]['id']}})[_0x513d('0x34')](function(_0x25a887){return db[_0x513d('0x7b')][_0x513d('0x7c')](function(_0x61c4af){return _0x25a887[_0x513d('0x7f')](_0x5bc83e[_0x513d('0x43')][_0x513d('0x80')],{'transaction':_0x61c4af})[_0x513d('0x34')](function(){if(!_[_0x513d('0x92')](_0x158e02)){return _0x25a887[_0x513d('0x93')](_0x158e02,{'transaction':_0x61c4af});}})[_0x513d('0x34')](function(){_0x158e02[_0x513d('0x94')](function(_0x54ec23){socket[_0x513d('0x95')](_0x513d('0x96'),{'UserId':_0x54ec23,'ChatQueueId':_0x25a887['id']});});});});});});})[_0x513d('0x34')](respondWithStatusCode(_0x29a914,null))[_0x513d('0x58')](handleError(_0x29a914,null));};exports[_0x513d('0x97')]=function(_0x15e0c5,_0x56a690,_0x23bbe6){return db[_0x513d('0x3c')]['find']({'where':{'id':_0x15e0c5[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x56a690,null))[_0x513d('0x34')](function(_0x5b22dc){if(_0x5b22dc){return _0x5b22dc[_0x513d('0x97')](_0x15e0c5['body'][_0x513d('0x80')],_[_0x513d('0x98')](_0x15e0c5[_0x513d('0x61')],[_0x513d('0x80'),'id'])||{})[_0x513d('0x99')](function(_0x2d706c){for(var _0x2020b0=0x0;_0x2020b0<_0x15e0c5[_0x513d('0x61')]['ids']['length'];_0x2020b0+=0x1){socket[_0x513d('0x95')](_0x513d('0x9a'),{'UserId':Number(_0x15e0c5[_0x513d('0x61')][_0x513d('0x80')][_0x2020b0]),'ChatQueueId':Number(_0x15e0c5[_0x513d('0x56')]['id'])});}return _0x2d706c;});}})[_0x513d('0x34')](respondWithResult(_0x56a690,null))['catch'](handleError(_0x56a690,null));};exports[_0x513d('0x93')]=function(_0x4a5004,_0x868d0d,_0x1089e2){return db[_0x513d('0x3c')]['find']({'where':{'id':_0x4a5004[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x868d0d,null))[_0x513d('0x34')](function(_0xda19b4){if(_0xda19b4){return _0xda19b4[_0x513d('0x93')](_0x4a5004[_0x513d('0x43')][_0x513d('0x80')])[_0x513d('0x34')](function(){if(_[_0x513d('0x9b')](_0x4a5004['query']['ids'])){for(var _0x168022=0x0;_0x168022<_0x4a5004['query']['ids']['length'];_0x168022+=0x1){socket[_0x513d('0x95')]('userChatQueue:remove',{'UserId':Number(_0x4a5004['query']['ids'][_0x168022]),'ChatQueueId':Number(_0x4a5004[_0x513d('0x56')]['id'])});}}else{socket[_0x513d('0x95')](_0x513d('0x96'),{'UserId':Number(_0x4a5004[_0x513d('0x43')][_0x513d('0x80')]),'ChatQueueId':Number(_0x4a5004[_0x513d('0x56')]['id'])});}});}})[_0x513d('0x34')](respondWithStatusCode(_0x868d0d,null))['catch'](handleError(_0x868d0d,null));};exports[_0x513d('0x9c')]=function(_0x3e407c,_0x860c2e,_0x85d548){var _0x5df9be={};var _0x2c0d25={};var _0x182a41;var _0x29c401;return db[_0x513d('0x3c')][_0x513d('0x65')]({'where':{'id':_0x3e407c['params']['id']}})['then'](handleEntityNotFound(_0x860c2e,null))[_0x513d('0x34')](function(_0x1bb9c0){if(_0x1bb9c0){_0x182a41=_0x1bb9c0;_0x2c0d25['model']=_[_0x513d('0x44')](db[_0x513d('0x69')][_0x513d('0x3d')]);_0x2c0d25[_0x513d('0x43')]=_['keys'](_0x3e407c[_0x513d('0x43')]);_0x2c0d25['filters']=_[_0x513d('0x46')](_0x2c0d25[_0x513d('0x41')],_0x2c0d25[_0x513d('0x43')]);_0x5df9be['attributes']=_[_0x513d('0x46')](_0x2c0d25['model'],qs[_0x513d('0x47')](_0x3e407c[_0x513d('0x43')][_0x513d('0x47')]));_0x5df9be['attributes']=_0x5df9be[_0x513d('0x48')][_0x513d('0x49')]?_0x5df9be[_0x513d('0x48')]:_0x2c0d25['model'];_0x5df9be[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0x3e407c[_0x513d('0x43')][_0x513d('0x4c')]);_0x5df9be[_0x513d('0x4d')]=qs['filters'](_['pick'](_0x3e407c[_0x513d('0x43')],_0x2c0d25[_0x513d('0x45')]));if(_0x3e407c[_0x513d('0x43')][_0x513d('0x4f')]){_0x5df9be[_0x513d('0x4d')]=_[_0x513d('0x50')](_0x5df9be[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x5df9be[_0x513d('0x48')],function(_0x272dc6){var _0x587c24={};_0x587c24[_0x272dc6]={'$like':'%'+_0x3e407c[_0x513d('0x43')]['filter']+'%'};return _0x587c24;})});}_0x5df9be=_[_0x513d('0x50')]({},_0x5df9be,_0x3e407c[_0x513d('0x52')]);return _0x182a41[_0x513d('0x9c')](_0x5df9be);}})['then'](function(_0x288820){if(_0x288820){_0x29c401=_0x288820[_0x513d('0x49')];if(!_0x3e407c[_0x513d('0x43')][_0x513d('0x67')]('nolimit')){_0x5df9be[_0x513d('0x2e')]=qs[_0x513d('0x2e')](_0x3e407c[_0x513d('0x43')][_0x513d('0x2e')]);_0x5df9be['offset']=qs['offset'](_0x3e407c[_0x513d('0x43')][_0x513d('0x2c')]);}return _0x182a41['getAgents'](_0x5df9be);}})[_0x513d('0x34')](function(_0x3c51aa){if(_0x3c51aa){return _0x3c51aa?{'count':_0x29c401,'rows':_0x3c51aa}:null;}})[_0x513d('0x34')](respondWithResult(_0x860c2e,null))[_0x513d('0x58')](handleError(_0x860c2e,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 1071701..fa6cd3e 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 _0x7140=['events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7140,0xd8));var _0x0714=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0x7140[_0x146be0];return _0x1bcc25;};'use strict';var EventEmitter=require(_0x0714('0x0'));var ChatQueue=require(_0x0714('0x1'))['db'][_0x0714('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0714('0x3')](0x0);var events={'afterCreate':_0x0714('0x4'),'afterUpdate':'update','afterDestroy':_0x0714('0x5')};function emitEvent(_0x4506b5){return function(_0x5205dc,_0x34e4c4,_0x593f68){ChatQueueEvents['emit'](_0x4506b5+':'+_0x5205dc['id'],_0x5205dc);ChatQueueEvents[_0x0714('0x6')](_0x4506b5,_0x5205dc);_0x593f68(null);};}for(var e in events){if(events[_0x0714('0x7')](e)){var event=events[e];ChatQueue[_0x0714('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x8ff5=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x568aff,_0x160dad){var _0x140c14=function(_0x29aa1e){while(--_0x29aa1e){_0x568aff['push'](_0x568aff['shift']());}};_0x140c14(++_0x160dad);}(_0x8ff5,0x78));var _0x58ff=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8ff5[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x58ff('0x0'));var ChatQueue=require(_0x58ff('0x1'))['db'][_0x58ff('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x58ff('0x3')](0x0);var events={'afterCreate':_0x58ff('0x4'),'afterUpdate':_0x58ff('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1009be){return function(_0x75f931,_0x4d0046,_0x1f5c74){ChatQueueEvents[_0x58ff('0x6')](_0x1009be+':'+_0x75f931['id'],_0x75f931);ChatQueueEvents['emit'](_0x1009be,_0x75f931);_0x1f5c74(null);};}for(var e in events){if(events[_0x58ff('0x7')](e)){var event=events[e];ChatQueue[_0x58ff('0x8')](e,emitEvent(event));}}module[_0x58ff('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cf5d22f..b9ee20d 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 _0xe32b=['bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','api','moment'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xe32b,0xec));var _0xbe32=function(_0x46055f,_0x15e5c6){_0x46055f=_0x46055f-0x0;var _0x4ceef5=_0xe32b[_0x46055f];return _0x4ceef5;};'use strict';var _=require(_0xbe32('0x0'));var util=require(_0xbe32('0x1'));var logger=require('../../config/logger')(_0xbe32('0x2'));var moment=require(_0xbe32('0x3'));var BPromise=require(_0xbe32('0x4'));var rp=require(_0xbe32('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe32('0x6'));var config=require(_0xbe32('0x7'));var attributes=require(_0xbe32('0x8'));module['exports']=function(_0x4c4b51,_0x1a540f){return _0x4c4b51[_0xbe32('0x9')](_0xbe32('0xa'),attributes,{'tableName':_0xbe32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c2d=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x551d43,_0x5081eb){var _0x27b4b4=function(_0x58aa6c){while(--_0x58aa6c){_0x551d43['push'](_0x551d43['shift']());}};_0x27b4b4(++_0x5081eb);}(_0x3c2d,0x8f));var _0xd3c2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3c2d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd3c2('0x0'));var util=require(_0xd3c2('0x1'));var logger=require(_0xd3c2('0x2'))(_0xd3c2('0x3'));var moment=require('moment');var BPromise=require(_0xd3c2('0x4'));var rp=require(_0xd3c2('0x5'));var fs=require('fs');var path=require(_0xd3c2('0x6'));var rimraf=require(_0xd3c2('0x7'));var config=require(_0xd3c2('0x8'));var attributes=require(_0xd3c2('0x9'));module[_0xd3c2('0xa')]=function(_0x474d68,_0x208eb1){return _0x474d68[_0xd3c2('0xb')](_0xd3c2('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 4f4b411..cfaf127 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 _0x1399=['findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetChatQueue','ChatQueue'];(function(_0x45c1ed,_0x56e8dd){var _0x4dd55a=function(_0xac4822){while(--_0xac4822){_0x45c1ed['push'](_0x45c1ed['shift']());}};_0x4dd55a(++_0x56e8dd);}(_0x1399,0x16c));var _0x9139=function(_0x419aa4,_0x5926a7){_0x419aa4=_0x419aa4-0x0;var _0x557d9b=_0x1399[_0x419aa4];return _0x557d9b;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});config[_0x9139('0xa')]=_[_0x9139('0xb')](config['redis'],{'host':_0x9139('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9139('0xd'))[_0x9139('0xe')](socket);function respondWithRpcPromise(_0x4830cd,_0x315de8,_0x1bfa6b){return new BPromise(function(_0x5c90eb,_0x4f7f3a){return client[_0x9139('0xf')](_0x4830cd,_0x1bfa6b)[_0x9139('0x10')](function(_0x23357c){logger[_0x9139('0x11')](_0x9139('0x12'),_0x315de8,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'),JSON['stringify'](_0x23357c));if(_0x23357c[_0x9139('0x14')]){if(_0x23357c[_0x9139('0x14')][_0x9139('0x15')]===0x1f4){logger[_0x9139('0x14')]('ChatQueue,\x20%s,\x20%s',_0x315de8,_0x23357c[_0x9139('0x14')]['message']);return _0x4f7f3a(_0x23357c['error']['message']);}logger[_0x9139('0x14')](_0x9139('0x12'),_0x315de8,_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);return _0x5c90eb(_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'));_0x5c90eb(_0x23357c[_0x9139('0x17')]['message']);}})['catch'](function(_0x30a363){logger[_0x9139('0x14')]('ChatQueue,\x20%s,\x20%s',_0x315de8,_0x30a363);_0x4f7f3a(_0x30a363);});});}exports[_0x9139('0x18')]=function(_0x1ef57b){var _0x1a592e=this;return new Promise(function(_0x3c8296,_0xd2eb33){return db[_0x9139('0x19')][_0x9139('0x1a')]({'raw':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1d')]||null:null,'attributes':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1e')]||null:null,'limit':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1f')]||null:null,'include':_0x1ef57b['options']?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x20')]?_['map'](_0x1ef57b[_0x9139('0x1b')][_0x9139('0x20')],function(_0x10bfa0){return{'model':db[_0x10bfa0['model']],'as':_0x10bfa0['as'],'attributes':_0x10bfa0[_0x9139('0x1e')],'include':_0x10bfa0[_0x9139('0x20')]?_['map'](_0x10bfa0[_0x9139('0x20')],function(_0x39e8cf){return{'model':db[_0x39e8cf[_0x9139('0x21')]],'as':_0x39e8cf['as'],'attributes':_0x39e8cf['attributes'],'include':_0x39e8cf[_0x9139('0x20')]?_[_0x9139('0x22')](_0x39e8cf[_0x9139('0x20')],function(_0x22994c){return{'model':db[_0x22994c[_0x9139('0x21')]],'as':_0x22994c['as'],'attributes':_0x22994c[_0x9139('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9139('0x10')](function(_0x573a05){logger['info'](_0x9139('0x18'),_0x1ef57b);logger[_0x9139('0x23')](_0x9139('0x18'),_0x1ef57b,JSON['stringify'](_0x573a05));_0x3c8296(_0x573a05);})['catch'](function(_0x24e8d5){logger[_0x9139('0x14')](_0x9139('0x18'),_0x24e8d5[_0x9139('0x16')],_0x1ef57b);_0xd2eb33(_0x1a592e[_0x9139('0x14')](0x1f4,_0x24e8d5['message']));});});};exports['ShowChatQueue']=function(_0x2f26de){var _0x57a6fb=this;return new Promise(function(_0x4de1a2,_0x222429){return db[_0x9139('0x19')]['find']({'raw':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')][_0x9139('0x1d')]||null:null,'attributes':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')][_0x9139('0x1e')]||null:null,'include':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')][_0x9139('0x20')]?_[_0x9139('0x22')](_0x2f26de[_0x9139('0x1b')]['include'],function(_0x2f554a){return{'model':db[_0x2f554a[_0x9139('0x21')]],'as':_0x2f554a['as'],'attributes':_0x2f554a['attributes'],'include':_0x2f554a[_0x9139('0x20')]?_[_0x9139('0x22')](_0x2f554a[_0x9139('0x20')],function(_0x47b937){return{'model':db[_0x47b937[_0x9139('0x21')]],'as':_0x47b937['as'],'attributes':_0x47b937[_0x9139('0x1e')],'include':_0x47b937[_0x9139('0x20')]?_[_0x9139('0x22')](_0x47b937[_0x9139('0x20')],function(_0x3ee061){return{'model':db[_0x3ee061[_0x9139('0x21')]],'as':_0x3ee061['as'],'attributes':_0x3ee061[_0x9139('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9139('0x10')](function(_0x22b074){logger['info'](_0x9139('0x24'),_0x2f26de);logger[_0x9139('0x23')](_0x9139('0x24'),_0x2f26de,JSON[_0x9139('0x25')](_0x22b074));_0x4de1a2(_0x22b074);})[_0x9139('0x26')](function(_0x369ab9){logger[_0x9139('0x14')]('ShowChatQueue',_0x369ab9[_0x9139('0x16')],_0x2f26de);_0x222429(_0x57a6fb['error'](0x1f4,_0x369ab9[_0x9139('0x16')]));});});}; \ No newline at end of file +var _0x88c3=['./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','catch','options','where','limit','include','map','attributes','model','GetChatQueue','stringify','ShowChatQueue','ChatQueue','find','raw','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x2c294b,_0x37ba09){var _0x5e379f=function(_0x44c2d9){while(--_0x44c2d9){_0x2c294b['push'](_0x2c294b['shift']());}};_0x5e379f(++_0x37ba09);}(_0x88c3,0x1ee));var _0x388c=function(_0x208a7f,_0x9766d8){_0x208a7f=_0x208a7f-0x0;var _0xb13b3b=_0x88c3[_0x208a7f];return _0xb13b3b;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var moment=require(_0x388c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x388c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x388c('0x3'))(_0x388c('0x4'));var config=require(_0x388c('0x5'));var jayson=require(_0x388c('0x6'));var client=jayson[_0x388c('0x7')][_0x388c('0x8')]({'port':0x232a});config['redis']=_[_0x388c('0x9')](config[_0x388c('0xa')],{'host':_0x388c('0xb'),'port':0x18eb});var socket=require(_0x388c('0xc'))(new Redis(config[_0x388c('0xa')]));require(_0x388c('0xd'))[_0x388c('0xe')](socket);function respondWithRpcPromise(_0x31963c,_0x4f1639,_0x39604c){return new BPromise(function(_0x4f0a81,_0x58659e){return client[_0x388c('0xf')](_0x31963c,_0x39604c)[_0x388c('0x10')](function(_0x31b893){logger[_0x388c('0x11')](_0x388c('0x12'),_0x4f1639,_0x388c('0x13'));logger[_0x388c('0x14')](_0x388c('0x15'),_0x4f1639,_0x388c('0x13'),JSON['stringify'](_0x31b893));if(_0x31b893['error']){if(_0x31b893['error'][_0x388c('0x16')]===0x1f4){logger[_0x388c('0x17')]('ChatQueue,\x20%s,\x20%s',_0x4f1639,_0x31b893[_0x388c('0x17')][_0x388c('0x18')]);return _0x58659e(_0x31b893['error']['message']);}logger[_0x388c('0x17')](_0x388c('0x12'),_0x4f1639,_0x31b893[_0x388c('0x17')]['message']);return _0x4f0a81(_0x31b893[_0x388c('0x17')]['message']);}else{logger[_0x388c('0x11')](_0x388c('0x12'),_0x4f1639,'request\x20sent');_0x4f0a81(_0x31b893['result'][_0x388c('0x18')]);}})[_0x388c('0x19')](function(_0x671bb5){logger['error'](_0x388c('0x12'),_0x4f1639,_0x671bb5);_0x58659e(_0x671bb5);});});}exports['GetChatQueue']=function(_0x1f6c2e){var _0x2c9df3=this;return new Promise(function(_0x37a5dd,_0x5b3031){return db['ChatQueue']['findAll']({'raw':_0x1f6c2e['options']?_0x1f6c2e[_0x388c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6c2e[_0x388c('0x1a')]?_0x1f6c2e['options'][_0x388c('0x1b')]||null:null,'attributes':_0x1f6c2e['options']?_0x1f6c2e[_0x388c('0x1a')]['attributes']||null:null,'limit':_0x1f6c2e[_0x388c('0x1a')]?_0x1f6c2e[_0x388c('0x1a')][_0x388c('0x1c')]||null:null,'include':_0x1f6c2e[_0x388c('0x1a')]?_0x1f6c2e[_0x388c('0x1a')][_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x1f6c2e[_0x388c('0x1a')][_0x388c('0x1d')],function(_0x522ecd){return{'model':db[_0x522ecd['model']],'as':_0x522ecd['as'],'attributes':_0x522ecd[_0x388c('0x1f')],'include':_0x522ecd['include']?_['map'](_0x522ecd['include'],function(_0x201ecd){return{'model':db[_0x201ecd[_0x388c('0x20')]],'as':_0x201ecd['as'],'attributes':_0x201ecd[_0x388c('0x1f')],'include':_0x201ecd[_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x201ecd[_0x388c('0x1d')],function(_0x3032f5){return{'model':db[_0x3032f5[_0x388c('0x20')]],'as':_0x3032f5['as'],'attributes':_0x3032f5[_0x388c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x388c('0x10')](function(_0x43e7fc){logger[_0x388c('0x11')]('GetChatQueue',_0x1f6c2e);logger['debug'](_0x388c('0x21'),_0x1f6c2e,JSON[_0x388c('0x22')](_0x43e7fc));_0x37a5dd(_0x43e7fc);})[_0x388c('0x19')](function(_0x5a647f){logger[_0x388c('0x17')](_0x388c('0x21'),_0x5a647f[_0x388c('0x18')],_0x1f6c2e);_0x5b3031(_0x2c9df3['error'](0x1f4,_0x5a647f[_0x388c('0x18')]));});});};exports[_0x388c('0x23')]=function(_0x155863){var _0x540fbb=this;return new Promise(function(_0x5b75fa,_0x54504b){return db[_0x388c('0x24')][_0x388c('0x25')]({'raw':_0x155863['options']?_0x155863[_0x388c('0x1a')][_0x388c('0x26')]===undefined?!![]:![]:!![],'where':_0x155863['options']?_0x155863[_0x388c('0x1a')][_0x388c('0x1b')]||null:null,'attributes':_0x155863[_0x388c('0x1a')]?_0x155863[_0x388c('0x1a')][_0x388c('0x1f')]||null:null,'include':_0x155863[_0x388c('0x1a')]?_0x155863['options'][_0x388c('0x1d')]?_['map'](_0x155863['options']['include'],function(_0x3f8797){return{'model':db[_0x3f8797[_0x388c('0x20')]],'as':_0x3f8797['as'],'attributes':_0x3f8797[_0x388c('0x1f')],'include':_0x3f8797[_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x3f8797[_0x388c('0x1d')],function(_0x3259b2){return{'model':db[_0x3259b2['model']],'as':_0x3259b2['as'],'attributes':_0x3259b2['attributes'],'include':_0x3259b2[_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x3259b2[_0x388c('0x1d')],function(_0x279437){return{'model':db[_0x279437[_0x388c('0x20')]],'as':_0x279437['as'],'attributes':_0x279437[_0x388c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x388c('0x10')](function(_0x1db033){logger[_0x388c('0x11')](_0x388c('0x23'),_0x155863);logger[_0x388c('0x14')]('ShowChatQueue',_0x155863,JSON[_0x388c('0x22')](_0x1db033));_0x5b75fa(_0x1db033);})[_0x388c('0x19')](function(_0x543b54){logger[_0x388c('0x17')]('ShowChatQueue',_0x543b54[_0x388c('0x18')],_0x155863);_0x54504b(_0x540fbb[_0x388c('0x17')](0x1f4,_0x543b54[_0x388c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 199d75f..ad75f8c 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 _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x3225c3,_0x3e09ea){var _0x3fa610=function(_0x3f0027){while(--_0x3f0027){_0x3225c3['push'](_0x3225c3['shift']());}};_0x3fa610(++_0x3e09ea);}(_0xe107,0xb3));var _0x7e10=function(_0x5c1832,_0x299bd1){_0x5c1832=_0x5c1832-0x0;var _0x3d05ff=_0xe107[_0x5c1832];return _0x3d05ff;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}}; \ No newline at end of file +var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x697d20,_0x51339a){var _0x308725=function(_0xe7d5e4){while(--_0xe7d5e4){_0x697d20['push'](_0x697d20['shift']());}};_0x308725(++_0x51339a);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2b7248,_0x17b24e){_0x2b7248=_0x2b7248-0x0;var _0x418838=_0xd0bb[_0x2b7248];return _0x418838;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index c87561d..c27b711 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x576693,_0x568dfb){var _0x55c349=function(_0x5ac215){while(--_0x5ac215){_0x576693['push'](_0x576693['shift']());}};_0x55c349(++_0x568dfb);}(_0x008c,0x188));var _0xc008=function(_0x404b9a,_0xca0480){_0x404b9a=_0x404b9a-0x0;var _0x30ba61=_0x008c[_0x404b9a];return _0x30ba61;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x373096,_0x4d37aa){_0x373096=_0x373096-0x0;var _0x14a6d0=_0x5fc3[_0x373096];return _0x14a6d0;};'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/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2de475b..7a017a1 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 _0x9e6b=['STRING','moment','sequelize'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9e6b,0x76));var _0xb9e6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9e6b[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0xb9e6('0x0'));var Sequelize=require(_0xb9e6('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb9e6('0x2')]}}; \ No newline at end of file +var _0x4d39=['DATE','exports','STRING'];(function(_0x2fc0d9,_0x464716){var _0x5a2012=function(_0x19089a){while(--_0x19089a){_0x2fc0d9['push'](_0x2fc0d9['shift']());}};_0x5a2012(++_0x464716);}(_0x4d39,0xb2));var _0x94d3=function(_0x153077,_0x2d1a73){_0x153077=_0x153077-0x0;var _0x23a4e2=_0x4d39[_0x153077];return _0x23a4e2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x94d3('0x0')]={'uniqueid':{'type':Sequelize[_0x94d3('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x94d3('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x94d3('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7638fd9..56426df 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 _0x3dba=['reject','save','update','then','destroy','end','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','filters','find','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x1e399a,_0x351c59){var _0x539897=function(_0x2986fa){while(--_0x2986fa){_0x1e399a['push'](_0x1e399a['shift']());}};_0x539897(++_0x351c59);}(_0x3dba,0x73));var _0xa3db=function(_0x119b4b,_0x322a87){_0x119b4b=_0x119b4b-0x0;var _0x2ca4d5=_0x3dba[_0x119b4b];return _0x2ca4d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa3db('0x0'));var rp=require(_0xa3db('0x1'));var moment=require('moment');var BPromise=require(_0xa3db('0x2'));var Mustache=require(_0xa3db('0x3'));var util=require(_0xa3db('0x4'));var path=require(_0xa3db('0x5'));var sox=require(_0xa3db('0x6'));var csv=require(_0xa3db('0x7'));var ejs=require(_0xa3db('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(_0xa3db('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa3db('0xa'));var Redis=require(_0xa3db('0xb'));var authService=require(_0xa3db('0xc'));var qs=require(_0xa3db('0xd'));var as=require(_0xa3db('0xe'));var hardwareService=require(_0xa3db('0xf'));var logger=require(_0xa3db('0x10'))(_0xa3db('0x11'));var utils=require(_0xa3db('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa3db('0x13'));var db=require(_0xa3db('0x14'))['db'];function respondWithStatusCode(_0x56c636,_0x20f91f){_0x20f91f=_0x20f91f||0xcc;return function(_0x42f8e0){if(_0x42f8e0){return _0x56c636[_0xa3db('0x15')](_0x20f91f);}return _0x56c636['status'](_0x20f91f)['end']();};}function respondWithResult(_0x221695,_0x302c34){_0x302c34=_0x302c34||0xc8;return function(_0x4f323b){if(_0x4f323b){return _0x221695[_0xa3db('0x16')](_0x302c34)[_0xa3db('0x17')](_0x4f323b);}};}function respondWithFilteredResult(_0xb75bcc,_0x1d07c5){return function(_0xaa5756){if(_0xaa5756){var _0xd53611=typeof _0x1d07c5[_0xa3db('0x18')]===_0xa3db('0x19')&&typeof _0x1d07c5[_0xa3db('0x1a')]==='undefined';var _0x558581=_0xaa5756[_0xa3db('0x1b')];var _0x278c2a=_0xd53611?0x0:_0x1d07c5[_0xa3db('0x18')];var _0x3f5e3e=_0xd53611?_0xaa5756['count']:_0x1d07c5[_0xa3db('0x18')]+_0x1d07c5[_0xa3db('0x1a')];var _0x356f63;if(_0x3f5e3e>=_0x558581){_0x3f5e3e=_0x558581;_0x356f63=0xc8;}else{_0x356f63=0xce;}_0xb75bcc[_0xa3db('0x16')](_0x356f63);return _0xb75bcc[_0xa3db('0x1c')](_0xa3db('0x1d'),_0x278c2a+'-'+_0x3f5e3e+'/'+_0x558581)[_0xa3db('0x17')](_0xaa5756);}return null;};}function patchUpdates(_0x2c817c){return function(_0x1eee9e){try{jsonpatch[_0xa3db('0x1e')](_0x1eee9e,_0x2c817c,!![]);}catch(_0x2581e2){return BPromise[_0xa3db('0x1f')](_0x2581e2);}return _0x1eee9e[_0xa3db('0x20')]();};}function saveUpdates(_0x5de05c,_0x195f57){return function(_0x16bc03){if(_0x16bc03){return _0x16bc03[_0xa3db('0x21')](_0x5de05c)[_0xa3db('0x22')](function(_0x989eed){return _0x989eed;});}return null;};}function removeEntity(_0x55a7cf,_0x3eab0c){return function(_0x49bc1b){if(_0x49bc1b){return _0x49bc1b[_0xa3db('0x23')]()[_0xa3db('0x22')](function(){_0x55a7cf['status'](0xcc)[_0xa3db('0x24')]();});}};}function handleEntityNotFound(_0xe0be83,_0x415d61){return function(_0x5e71f2){if(!_0x5e71f2){_0xe0be83[_0xa3db('0x15')](0x194);}return _0x5e71f2;};}function handleError(_0x374d03,_0x34f314){_0x34f314=_0x34f314||0x1f4;return function(_0x1f0d0e){logger[_0xa3db('0x25')](_0x1f0d0e['stack']);if(_0x1f0d0e[_0xa3db('0x26')]){delete _0x1f0d0e[_0xa3db('0x26')];}_0x374d03[_0xa3db('0x16')](_0x34f314)[_0xa3db('0x27')](_0x1f0d0e);};}exports[_0xa3db('0x28')]=function(_0x2f8602,_0x2f08da){var _0x3416bc={},_0x19a858={},_0x2ecde3={'count':0x0,'rows':[]};var _0x52578a=_[_0xa3db('0x29')](db[_0xa3db('0x2a')][_0xa3db('0x2b')],function(_0x551010){return{'name':_0x551010[_0xa3db('0x2c')],'type':_0x551010[_0xa3db('0x2d')]['key']};});_0x19a858[_0xa3db('0x2e')]=_[_0xa3db('0x29')](_0x52578a,_0xa3db('0x26'));_0x19a858['query']=_[_0xa3db('0x2f')](_0x2f8602[_0xa3db('0x30')]);_0x19a858['filters']=_['intersection'](_0x19a858[_0xa3db('0x2e')],_0x19a858[_0xa3db('0x30')]);_0x3416bc[_0xa3db('0x31')]=_[_0xa3db('0x32')](_0x19a858[_0xa3db('0x2e')],qs[_0xa3db('0x33')](_0x2f8602[_0xa3db('0x30')][_0xa3db('0x33')]));_0x3416bc['attributes']=_0x3416bc[_0xa3db('0x31')]['length']?_0x3416bc[_0xa3db('0x31')]:_0x19a858[_0xa3db('0x2e')];if(!_0x2f8602[_0xa3db('0x30')][_0xa3db('0x34')](_0xa3db('0x35'))){_0x3416bc[_0xa3db('0x1a')]=qs[_0xa3db('0x1a')](_0x2f8602[_0xa3db('0x30')]['limit']);_0x3416bc[_0xa3db('0x18')]=qs[_0xa3db('0x18')](_0x2f8602[_0xa3db('0x30')]['offset']);}_0x3416bc[_0xa3db('0x36')]=qs[_0xa3db('0x37')](_0x2f8602[_0xa3db('0x30')][_0xa3db('0x37')]);_0x3416bc[_0xa3db('0x38')]=qs['filters'](_[_0xa3db('0x39')](_0x2f8602['query'],_0x19a858['filters']),_0x52578a);if(_0x2f8602[_0xa3db('0x30')][_0xa3db('0x3a')]){_0x3416bc[_0xa3db('0x38')]=_[_0xa3db('0x3b')](_0x3416bc[_0xa3db('0x38')],{'$or':_[_0xa3db('0x29')](_0x52578a,function(_0xa3b488){if(_0xa3b488[_0xa3db('0x2d')]!==_0xa3db('0x3c')){var _0x23c94b={};_0x23c94b[_0xa3b488[_0xa3db('0x26')]]={'$like':'%'+_0x2f8602[_0xa3db('0x30')]['filter']+'%'};return _0x23c94b;}})});}_0x3416bc=_[_0xa3db('0x3b')]({},_0x3416bc,_0x2f8602[_0xa3db('0x3d')]);var _0xe24bd1={'where':_0x3416bc[_0xa3db('0x38')]};return db[_0xa3db('0x2a')]['count'](_0xe24bd1)['then'](function(_0x414745){_0x2ecde3[_0xa3db('0x1b')]=_0x414745;if(_0x2f8602[_0xa3db('0x30')][_0xa3db('0x3e')]){_0x3416bc[_0xa3db('0x3f')]=[{'all':!![]}];}return db[_0xa3db('0x2a')][_0xa3db('0x40')](_0x3416bc);})[_0xa3db('0x22')](function(_0x57350f){_0x2ecde3['rows']=_0x57350f;return _0x2ecde3;})[_0xa3db('0x22')](respondWithFilteredResult(_0x2f08da,_0x3416bc))[_0xa3db('0x41')](handleError(_0x2f08da,null));};exports[_0xa3db('0x42')]=function(_0x4ef9d1,_0x4cf5e8){var _0x3d612d={'raw':!![],'where':{'id':_0x4ef9d1[_0xa3db('0x43')]['id']}},_0x47e625={};_0x47e625['model']=_[_0xa3db('0x2f')](db[_0xa3db('0x2a')][_0xa3db('0x2b')]);_0x47e625[_0xa3db('0x30')]=_[_0xa3db('0x2f')](_0x4ef9d1[_0xa3db('0x30')]);_0x47e625[_0xa3db('0x44')]=_['intersection'](_0x47e625[_0xa3db('0x2e')],_0x47e625[_0xa3db('0x30')]);_0x3d612d[_0xa3db('0x31')]=_[_0xa3db('0x32')](_0x47e625['model'],qs[_0xa3db('0x33')](_0x4ef9d1['query'][_0xa3db('0x33')]));_0x3d612d[_0xa3db('0x31')]=_0x3d612d['attributes']['length']?_0x3d612d[_0xa3db('0x31')]:_0x47e625['model'];if(_0x4ef9d1[_0xa3db('0x30')][_0xa3db('0x3e')]){_0x3d612d[_0xa3db('0x3f')]=[{'all':!![]}];}_0x3d612d=_[_0xa3db('0x3b')]({},_0x3d612d,_0x4ef9d1['options']);return db[_0xa3db('0x2a')][_0xa3db('0x45')](_0x3d612d)[_0xa3db('0x22')](handleEntityNotFound(_0x4cf5e8,null))[_0xa3db('0x22')](respondWithResult(_0x4cf5e8,null))[_0xa3db('0x41')](handleError(_0x4cf5e8,null));};exports[_0xa3db('0x46')]=function(_0x572bbf,_0x3cb6c0){return db[_0xa3db('0x2a')]['create'](_0x572bbf[_0xa3db('0x47')],{})['then'](respondWithResult(_0x3cb6c0,0xc9))[_0xa3db('0x41')](handleError(_0x3cb6c0,null));};exports[_0xa3db('0x21')]=function(_0x2207e9,_0x4b55a9){if(_0x2207e9[_0xa3db('0x47')]['id']){delete _0x2207e9[_0xa3db('0x47')]['id'];}return db[_0xa3db('0x2a')][_0xa3db('0x45')]({'where':{'id':_0x2207e9['params']['id']}})[_0xa3db('0x22')](handleEntityNotFound(_0x4b55a9,null))[_0xa3db('0x22')](saveUpdates(_0x2207e9[_0xa3db('0x47')],null))[_0xa3db('0x22')](respondWithResult(_0x4b55a9,null))[_0xa3db('0x41')](handleError(_0x4b55a9,null));};exports[_0xa3db('0x23')]=function(_0x40a45b,_0x3f2463){return db['ChatQueueReport']['find']({'where':{'id':_0x40a45b[_0xa3db('0x43')]['id']}})[_0xa3db('0x22')](handleEntityNotFound(_0x3f2463,null))[_0xa3db('0x22')](removeEntity(_0x3f2463,null))[_0xa3db('0x41')](handleError(_0x3f2463,null));};exports['describe']=function(_0x8d54e9,_0x40c6cd){return db[_0xa3db('0x2a')][_0xa3db('0x48')]()[_0xa3db('0x22')](respondWithResult(_0x40c6cd,null))['catch'](handleError(_0x40c6cd,null));}; \ No newline at end of file +var _0xb0e5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs'];(function(_0x56d3cb,_0x2c77c1){var _0x4ecbce=function(_0x346555){while(--_0x346555){_0x56d3cb['push'](_0x56d3cb['shift']());}};_0x4ecbce(++_0x2c77c1);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0xe0aa03,_0x2cfd1d){_0xe0aa03=_0xe0aa03-0x0;var _0x521c13=_0xb0e5[_0xe0aa03];return _0x521c13;};'use strict';var emlformat=require(_0x5b0e('0x0'));var rimraf=require(_0x5b0e('0x1'));var zipdir=require(_0x5b0e('0x2'));var jsonpatch=require(_0x5b0e('0x3'));var rp=require(_0x5b0e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b0e('0x5'));var util=require('util');var path=require(_0x5b0e('0x6'));var sox=require('sox');var csv=require(_0x5b0e('0x7'));var ejs=require(_0x5b0e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0e('0x9'));var crypto=require(_0x5b0e('0xa'));var jsforce=require(_0x5b0e('0xb'));var deskjs=require(_0x5b0e('0xc'));var toCsv=require(_0x5b0e('0x7'));var querystring=require(_0x5b0e('0xd'));var Papa=require(_0x5b0e('0xe'));var Redis=require(_0x5b0e('0xf'));var authService=require(_0x5b0e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5b0e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5b0e('0x12'));var utils=require(_0x5b0e('0x13'));var config=require(_0x5b0e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b0e('0x15'))['db'];function respondWithStatusCode(_0x47ee76,_0x4e37dd){_0x4e37dd=_0x4e37dd||0xcc;return function(_0x1e20b8){if(_0x1e20b8){return _0x47ee76[_0x5b0e('0x16')](_0x4e37dd);}return _0x47ee76[_0x5b0e('0x17')](_0x4e37dd)[_0x5b0e('0x18')]();};}function respondWithResult(_0x3aa726,_0x3a6fcf){_0x3a6fcf=_0x3a6fcf||0xc8;return function(_0x3d2606){if(_0x3d2606){return _0x3aa726[_0x5b0e('0x17')](_0x3a6fcf)[_0x5b0e('0x19')](_0x3d2606);}};}function respondWithFilteredResult(_0x2893f8,_0x1f8ced){return function(_0xb8e854){if(_0xb8e854){var _0x3fe6cc=typeof _0x1f8ced[_0x5b0e('0x1a')]===_0x5b0e('0x1b')&&typeof _0x1f8ced[_0x5b0e('0x1c')]===_0x5b0e('0x1b');var _0x22036a=_0xb8e854[_0x5b0e('0x1d')];var _0x3c876a=_0x3fe6cc?0x0:_0x1f8ced[_0x5b0e('0x1a')];var _0x17ac8f=_0x3fe6cc?_0xb8e854['count']:_0x1f8ced['offset']+_0x1f8ced[_0x5b0e('0x1c')];var _0x211053;if(_0x17ac8f>=_0x22036a){_0x17ac8f=_0x22036a;_0x211053=0xc8;}else{_0x211053=0xce;}_0x2893f8[_0x5b0e('0x17')](_0x211053);return _0x2893f8['set']('Content-Range',_0x3c876a+'-'+_0x17ac8f+'/'+_0x22036a)[_0x5b0e('0x19')](_0xb8e854);}return null;};}function patchUpdates(_0x570a09){return function(_0x1a145e){try{jsonpatch[_0x5b0e('0x1e')](_0x1a145e,_0x570a09,!![]);}catch(_0x10cc05){return BPromise[_0x5b0e('0x1f')](_0x10cc05);}return _0x1a145e['save']();};}function saveUpdates(_0x4e3941,_0x48c484){return function(_0x497aa2){if(_0x497aa2){return _0x497aa2[_0x5b0e('0x20')](_0x4e3941)[_0x5b0e('0x21')](function(_0x3662fc){return _0x3662fc;});}return null;};}function removeEntity(_0x46fb47,_0x80c8f9){return function(_0x496624){if(_0x496624){return _0x496624[_0x5b0e('0x22')]()['then'](function(){_0x46fb47[_0x5b0e('0x17')](0xcc)[_0x5b0e('0x18')]();});}};}function handleEntityNotFound(_0x22f0fd,_0x4a2abf){return function(_0x341476){if(!_0x341476){_0x22f0fd[_0x5b0e('0x16')](0x194);}return _0x341476;};}function handleError(_0x1fc287,_0x1e8221){_0x1e8221=_0x1e8221||0x1f4;return function(_0x3b9321){logger[_0x5b0e('0x23')](_0x3b9321[_0x5b0e('0x24')]);if(_0x3b9321[_0x5b0e('0x25')]){delete _0x3b9321[_0x5b0e('0x25')];}_0x1fc287[_0x5b0e('0x17')](_0x1e8221)[_0x5b0e('0x26')](_0x3b9321);};}exports[_0x5b0e('0x27')]=function(_0x17a648,_0xeb84a8){var _0x20cabc={},_0x333786={},_0x54d2e4={'count':0x0,'rows':[]};var _0x3a6e13=_[_0x5b0e('0x28')](db[_0x5b0e('0x29')][_0x5b0e('0x2a')],function(_0x322f22){return{'name':_0x322f22['fieldName'],'type':_0x322f22[_0x5b0e('0x2b')][_0x5b0e('0x2c')]};});_0x333786[_0x5b0e('0x2d')]=_[_0x5b0e('0x28')](_0x3a6e13,_0x5b0e('0x25'));_0x333786[_0x5b0e('0x2e')]=_[_0x5b0e('0x2f')](_0x17a648['query']);_0x333786[_0x5b0e('0x30')]=_[_0x5b0e('0x31')](_0x333786['model'],_0x333786[_0x5b0e('0x2e')]);_0x20cabc[_0x5b0e('0x32')]=_[_0x5b0e('0x31')](_0x333786[_0x5b0e('0x2d')],qs[_0x5b0e('0x33')](_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x33')]));_0x20cabc[_0x5b0e('0x32')]=_0x20cabc[_0x5b0e('0x32')][_0x5b0e('0x34')]?_0x20cabc[_0x5b0e('0x32')]:_0x333786['model'];if(!_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x35')](_0x5b0e('0x36'))){_0x20cabc[_0x5b0e('0x1c')]=qs[_0x5b0e('0x1c')](_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x1c')]);_0x20cabc[_0x5b0e('0x1a')]=qs[_0x5b0e('0x1a')](_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x1a')]);}_0x20cabc['order']=qs[_0x5b0e('0x37')](_0x17a648['query'][_0x5b0e('0x37')]);_0x20cabc[_0x5b0e('0x38')]=qs['filters'](_[_0x5b0e('0x39')](_0x17a648[_0x5b0e('0x2e')],_0x333786[_0x5b0e('0x30')]),_0x3a6e13);if(_0x17a648[_0x5b0e('0x2e')]['filter']){_0x20cabc[_0x5b0e('0x38')]=_[_0x5b0e('0x3a')](_0x20cabc[_0x5b0e('0x38')],{'$or':_[_0x5b0e('0x28')](_0x3a6e13,function(_0x39d88f){if(_0x39d88f[_0x5b0e('0x2b')]!==_0x5b0e('0x3b')){var _0x4f274f={};_0x4f274f[_0x39d88f[_0x5b0e('0x25')]]={'$like':'%'+_0x17a648['query'][_0x5b0e('0x3c')]+'%'};return _0x4f274f;}})});}_0x20cabc=_[_0x5b0e('0x3a')]({},_0x20cabc,_0x17a648[_0x5b0e('0x3d')]);var _0x2addf3={'where':_0x20cabc[_0x5b0e('0x38')]};return db[_0x5b0e('0x29')][_0x5b0e('0x1d')](_0x2addf3)[_0x5b0e('0x21')](function(_0x43122a){_0x54d2e4['count']=_0x43122a;if(_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x3e')]){_0x20cabc[_0x5b0e('0x3f')]=[{'all':!![]}];}return db[_0x5b0e('0x29')][_0x5b0e('0x40')](_0x20cabc);})['then'](function(_0x56f2be){_0x54d2e4[_0x5b0e('0x41')]=_0x56f2be;return _0x54d2e4;})[_0x5b0e('0x21')](respondWithFilteredResult(_0xeb84a8,_0x20cabc))[_0x5b0e('0x42')](handleError(_0xeb84a8,null));};exports[_0x5b0e('0x43')]=function(_0x494951,_0x17e4a7){var _0x333db7={'raw':!![],'where':{'id':_0x494951[_0x5b0e('0x44')]['id']}},_0x5c8836={};_0x5c8836[_0x5b0e('0x2d')]=_[_0x5b0e('0x2f')](db['ChatQueueReport'][_0x5b0e('0x2a')]);_0x5c8836[_0x5b0e('0x2e')]=_[_0x5b0e('0x2f')](_0x494951['query']);_0x5c8836[_0x5b0e('0x30')]=_[_0x5b0e('0x31')](_0x5c8836[_0x5b0e('0x2d')],_0x5c8836['query']);_0x333db7[_0x5b0e('0x32')]=_['intersection'](_0x5c8836[_0x5b0e('0x2d')],qs[_0x5b0e('0x33')](_0x494951[_0x5b0e('0x2e')][_0x5b0e('0x33')]));_0x333db7[_0x5b0e('0x32')]=_0x333db7['attributes']['length']?_0x333db7[_0x5b0e('0x32')]:_0x5c8836[_0x5b0e('0x2d')];if(_0x494951['query']['includeAll']){_0x333db7[_0x5b0e('0x3f')]=[{'all':!![]}];}_0x333db7=_[_0x5b0e('0x3a')]({},_0x333db7,_0x494951['options']);return db[_0x5b0e('0x29')][_0x5b0e('0x45')](_0x333db7)[_0x5b0e('0x21')](handleEntityNotFound(_0x17e4a7,null))['then'](respondWithResult(_0x17e4a7,null))[_0x5b0e('0x42')](handleError(_0x17e4a7,null));};exports['create']=function(_0xbe7994,_0x2dee5c){return db[_0x5b0e('0x29')][_0x5b0e('0x46')](_0xbe7994['body'],{})['then'](respondWithResult(_0x2dee5c,0xc9))[_0x5b0e('0x42')](handleError(_0x2dee5c,null));};exports['update']=function(_0xff8263,_0x560b1e){if(_0xff8263[_0x5b0e('0x47')]['id']){delete _0xff8263[_0x5b0e('0x47')]['id'];}return db[_0x5b0e('0x29')][_0x5b0e('0x45')]({'where':{'id':_0xff8263[_0x5b0e('0x44')]['id']}})[_0x5b0e('0x21')](handleEntityNotFound(_0x560b1e,null))[_0x5b0e('0x21')](saveUpdates(_0xff8263['body'],null))[_0x5b0e('0x21')](respondWithResult(_0x560b1e,null))[_0x5b0e('0x42')](handleError(_0x560b1e,null));};exports[_0x5b0e('0x22')]=function(_0x7b402,_0x19a91){return db[_0x5b0e('0x29')][_0x5b0e('0x45')]({'where':{'id':_0x7b402['params']['id']}})[_0x5b0e('0x21')](handleEntityNotFound(_0x19a91,null))[_0x5b0e('0x21')](removeEntity(_0x19a91,null))[_0x5b0e('0x42')](handleError(_0x19a91,null));};exports[_0x5b0e('0x48')]=function(_0x12529d,_0x9d1f7d){return db['ChatQueueReport']['describe']()[_0x5b0e('0x21')](respondWithResult(_0x9d1f7d,null))[_0x5b0e('0x42')](handleError(_0x9d1f7d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 574d4ba..c5308ed 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45cf25,_0x3586e0){var _0x51a766=function(_0x516664){while(--_0x516664){_0x45cf25['push'](_0x45cf25['shift']());}};_0x51a766(++_0x3586e0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x40b6b1,_0x598d7b){var _0x4dc921=function(_0x406ce2){while(--_0x406ce2){_0x40b6b1['push'](_0x40b6b1['shift']());}};_0x4dc921(++_0x598d7b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b922091..7ebb717 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 _0xb974=['../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xb974,0x123));var _0x4b97=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb974[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x4b97('0x0'));var util=require(_0x4b97('0x1'));var moment=require(_0x4b97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b97('0x3'))['db'];var utils=require(_0x4b97('0x4'));var logger=require(_0x4b97('0x5'))('rpc');var config=require(_0x4b97('0x6'));var jayson=require(_0x4b97('0x7'));var client=jayson[_0x4b97('0x8')][_0x4b97('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f26bb,_0x51fb65,_0x24b9e2){return new BPromise(function(_0x48bc10,_0xec4d1a){return client[_0x4b97('0xa')](_0x3f26bb,_0x24b9e2)[_0x4b97('0xb')](function(_0x677aa1){logger[_0x4b97('0xc')](_0x4b97('0xd'),_0x51fb65,'request\x20sent');logger[_0x4b97('0xe')](_0x4b97('0xf'),_0x51fb65,'request\x20sent',JSON['stringify'](_0x677aa1));if(_0x677aa1[_0x4b97('0x10')]){if(_0x677aa1[_0x4b97('0x10')][_0x4b97('0x11')]===0x1f4){logger[_0x4b97('0x10')](_0x4b97('0xd'),_0x51fb65,_0x677aa1[_0x4b97('0x10')]['message']);return _0xec4d1a(_0x677aa1[_0x4b97('0x10')][_0x4b97('0x12')]);}logger[_0x4b97('0x10')](_0x4b97('0xd'),_0x51fb65,_0x677aa1[_0x4b97('0x10')][_0x4b97('0x12')]);return _0x48bc10(_0x677aa1[_0x4b97('0x10')][_0x4b97('0x12')]);}else{logger[_0x4b97('0xc')](_0x4b97('0xd'),_0x51fb65,_0x4b97('0x13'));_0x48bc10(_0x677aa1[_0x4b97('0x14')][_0x4b97('0x12')]);}})['catch'](function(_0x32d51e){logger['error'](_0x4b97('0xd'),_0x51fb65,_0x32d51e);_0xec4d1a(_0x32d51e);});});}exports[_0x4b97('0x15')]=function(_0x5df007){var _0x55a0ac=this;return new Promise(function(_0x276794,_0x59debf){return db[_0x4b97('0x16')][_0x4b97('0x17')](_0x5df007[_0x4b97('0x18')],{'raw':_0x5df007[_0x4b97('0x19')]?_0x5df007[_0x4b97('0x19')][_0x4b97('0x1a')]===undefined?!![]:![]:!![]})[_0x4b97('0xb')](function(_0x4e0284){logger[_0x4b97('0xc')](_0x4b97('0x15'),_0x5df007);logger[_0x4b97('0xe')](_0x4b97('0x15'),_0x5df007,JSON[_0x4b97('0x1b')](_0x4e0284));_0x276794(_0x4e0284);})[_0x4b97('0x1c')](function(_0x52c351){logger[_0x4b97('0x10')](_0x4b97('0x15'),_0x52c351[_0x4b97('0x12')],_0x5df007);_0x59debf(_0x55a0ac[_0x4b97('0x10')](0x1f4,_0x52c351[_0x4b97('0x12')]));});});};exports[_0x4b97('0x1d')]=function(_0x19ca05){var _0x4ea25c=this;return new Promise(function(_0xd7849a,_0x576075){return db[_0x4b97('0x16')][_0x4b97('0x1e')](_0x19ca05[_0x4b97('0x18')],{'raw':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')][_0x4b97('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')][_0x4b97('0x1f')]||null:null,'attributes':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')][_0x4b97('0x20')]||null:null,'limit':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')]['limit']||null:null})['then'](function(_0x342fe8){logger[_0x4b97('0xc')](_0x4b97('0x1d'),_0x19ca05);logger['debug'](_0x4b97('0x1d'),_0x19ca05,JSON['stringify'](_0x342fe8));_0xd7849a(_0x342fe8);})[_0x4b97('0x1c')](function(_0x3a642f){logger[_0x4b97('0x10')](_0x4b97('0x1d'),_0x3a642f[_0x4b97('0x12')],_0x19ca05);_0x576075(_0x4ea25c[_0x4b97('0x10')](0x1f4,_0x3a642f[_0x4b97('0x12')]));});});}; \ No newline at end of file +var _0xb2d8=['http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','ChatQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb2d8,0x188));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b2d('0x0'));var BPromise=require(_0x8b2d('0x1'));var rs=require(_0x8b2d('0x2'));var fs=require('fs');var Redis=require(_0x8b2d('0x3'));var db=require(_0x8b2d('0x4'))['db'];var utils=require(_0x8b2d('0x5'));var logger=require(_0x8b2d('0x6'))(_0x8b2d('0x7'));var config=require(_0x8b2d('0x8'));var jayson=require(_0x8b2d('0x9'));var client=jayson[_0x8b2d('0xa')][_0x8b2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1261fe,_0x50ac88,_0x3d32bd){return new BPromise(function(_0x4002fa,_0x199a96){return client[_0x8b2d('0xc')](_0x1261fe,_0x3d32bd)['then'](function(_0x17a370){logger[_0x8b2d('0xd')](_0x8b2d('0xe'),_0x50ac88,_0x8b2d('0xf'));logger[_0x8b2d('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x50ac88,_0x8b2d('0xf'),JSON[_0x8b2d('0x11')](_0x17a370));if(_0x17a370[_0x8b2d('0x12')]){if(_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x13')]===0x1f4){logger[_0x8b2d('0x12')](_0x8b2d('0xe'),_0x50ac88,_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);return _0x199a96(_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);}logger[_0x8b2d('0x12')](_0x8b2d('0xe'),_0x50ac88,_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);return _0x4002fa(_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);}else{logger[_0x8b2d('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x50ac88,_0x8b2d('0xf'));_0x4002fa(_0x17a370[_0x8b2d('0x15')][_0x8b2d('0x14')]);}})[_0x8b2d('0x16')](function(_0x77975c){logger[_0x8b2d('0x12')](_0x8b2d('0xe'),_0x50ac88,_0x77975c);_0x199a96(_0x77975c);});});}exports[_0x8b2d('0x17')]=function(_0x427b61){var _0x38ff25=this;return new Promise(function(_0x5cf1e2,_0x24b417){return db['ChatQueueReport'][_0x8b2d('0x18')](_0x427b61[_0x8b2d('0x19')],{'raw':_0x427b61[_0x8b2d('0x1a')]?_0x427b61['options'][_0x8b2d('0x1b')]===undefined?!![]:![]:!![]})[_0x8b2d('0x1c')](function(_0x19c76f){logger['info'](_0x8b2d('0x17'),_0x427b61);logger[_0x8b2d('0x10')](_0x8b2d('0x17'),_0x427b61,JSON[_0x8b2d('0x11')](_0x19c76f));_0x5cf1e2(_0x19c76f);})[_0x8b2d('0x16')](function(_0x8b6c0b){logger[_0x8b2d('0x12')](_0x8b2d('0x17'),_0x8b6c0b['message'],_0x427b61);_0x24b417(_0x38ff25[_0x8b2d('0x12')](0x1f4,_0x8b6c0b[_0x8b2d('0x14')]));});});};exports[_0x8b2d('0x1d')]=function(_0x19dd66){var _0x736175=this;return new Promise(function(_0x3db31d,_0x377e57){return db[_0x8b2d('0x1e')]['update'](_0x19dd66[_0x8b2d('0x19')],{'raw':_0x19dd66[_0x8b2d('0x1a')]?_0x19dd66[_0x8b2d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19dd66['options']?_0x19dd66[_0x8b2d('0x1a')]['where']||null:null,'attributes':_0x19dd66[_0x8b2d('0x1a')]?_0x19dd66['options']['attributes']||null:null,'limit':_0x19dd66[_0x8b2d('0x1a')]?_0x19dd66[_0x8b2d('0x1a')]['limit']||null:null})[_0x8b2d('0x1c')](function(_0x2372bf){logger[_0x8b2d('0xd')](_0x8b2d('0x1d'),_0x19dd66);logger[_0x8b2d('0x10')](_0x8b2d('0x1d'),_0x19dd66,JSON['stringify'](_0x2372bf));_0x3db31d(_0x2372bf);})['catch'](function(_0x4fde3c){logger[_0x8b2d('0x12')]('UpdateChatQueueReport',_0x4fde3c[_0x8b2d('0x14')],_0x19dd66);_0x377e57(_0x736175[_0x8b2d('0x12')](0x1f4,_0x4fde3c[_0x8b2d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 3f7c31e..2e2a8db 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 _0xcc9b=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_0xcc9b,0x152));var _0xbcc9=function(_0x6d0012,_0x6ce00e){_0x6d0012=_0x6d0012-0x0;var _0x34286c=_0xcc9b[_0x6d0012];return _0x34286c;};'use strict';var multer=require(_0xbcc9('0x0'));var util=require(_0xbcc9('0x1'));var path=require(_0xbcc9('0x2'));var timeout=require(_0xbcc9('0x3'));var express=require(_0xbcc9('0x4'));var router=express[_0xbcc9('0x5')]();var fs_extra=require(_0xbcc9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbcc9('0x7'));var config=require('../../config/environment');var controller=require(_0xbcc9('0x8'));router['get']('/',auth[_0xbcc9('0x9')](),controller['index']);router[_0xbcc9('0xa')]('/describe',auth[_0xbcc9('0x9')](),controller[_0xbcc9('0xb')]);router[_0xbcc9('0xa')](_0xbcc9('0xc'),auth['isAuthenticated'](),controller[_0xbcc9('0xd')]);router['post']('/',auth[_0xbcc9('0x9')](),controller[_0xbcc9('0xe')]);router[_0xbcc9('0xf')](_0xbcc9('0xc'),auth[_0xbcc9('0x9')](),controller[_0xbcc9('0x10')]);router[_0xbcc9('0x11')](_0xbcc9('0xc'),auth[_0xbcc9('0x9')](),controller[_0xbcc9('0x12')]);module[_0xbcc9('0x13')]=router; \ No newline at end of file +var _0xd8bf=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','destroy'];(function(_0x24f625,_0x132f17){var _0x40d9cb=function(_0x5b5d8a){while(--_0x5b5d8a){_0x24f625['push'](_0x24f625['shift']());}};_0x40d9cb(++_0x132f17);}(_0xd8bf,0x130));var _0xfd8b=function(_0x21f5b6,_0x3074d2){_0x21f5b6=_0x21f5b6-0x0;var _0x216a9c=_0xd8bf[_0x21f5b6];return _0x216a9c;};'use strict';var multer=require(_0xfd8b('0x0'));var util=require(_0xfd8b('0x1'));var path=require(_0xfd8b('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd8b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfd8b('0x4'));var interaction=require(_0xfd8b('0x5'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xfd8b('0x6')](),controller['index']);router[_0xfd8b('0x7')](_0xfd8b('0x8'),auth[_0xfd8b('0x6')](),controller[_0xfd8b('0x9')]);router[_0xfd8b('0x7')](_0xfd8b('0xa'),auth['isAuthenticated'](),controller[_0xfd8b('0xb')]);router[_0xfd8b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfd8b('0xd')]('/:id',auth[_0xfd8b('0x6')](),controller[_0xfd8b('0xe')]);router['delete'](_0xfd8b('0xa'),auth[_0xfd8b('0x6')](),controller[_0xfd8b('0xf')]);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 8d1a3c6..76a7072 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5846b6,_0x299729){var _0x5b4ba4=function(_0x50357f){while(--_0x50357f){_0x5846b6['push'](_0x5846b6['shift']());}};_0x5b4ba4(++_0x299729);}(_0x008c,0x188));var _0xc008=function(_0x3168e1,_0xa046e0){_0x3168e1=_0x3168e1-0x0;var _0x13ad69=_0x008c[_0x3168e1];return _0x13ad69;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x9f4205,_0x3fcdb4){var _0x4ae15b=function(_0x279a8f){while(--_0x279a8f){_0x9f4205['push'](_0x9f4205['shift']());}};_0x4ae15b(++_0x3fcdb4);}(_0x70e0,0x17b));var _0x070e=function(_0x2c5031,_0x66e416){_0x2c5031=_0x2c5031-0x0;var _0x3317d5=_0x70e0[_0x2c5031];return _0x3317d5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index acf879d..6181bfe 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 _0xdafc=['send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','then','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdafc,0x71));var _0xcdaf=function(_0x381608,_0x8b3166){_0x381608=_0x381608-0x0;var _0xb273a5=_0xdafc[_0x381608];return _0xb273a5;};'use strict';var emlformat=require(_0xcdaf('0x0'));var rimraf=require(_0xcdaf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcdaf('0x2'));var rp=require(_0xcdaf('0x3'));var moment=require('moment');var BPromise=require(_0xcdaf('0x4'));var Mustache=require(_0xcdaf('0x5'));var util=require('util');var path=require(_0xcdaf('0x6'));var sox=require(_0xcdaf('0x7'));var csv=require(_0xcdaf('0x8'));var ejs=require(_0xcdaf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdaf('0xa'));var squel=require(_0xcdaf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcdaf('0xc'));var toCsv=require(_0xcdaf('0x8'));var querystring=require(_0xcdaf('0xd'));var Papa=require(_0xcdaf('0xe'));var Redis=require(_0xcdaf('0xf'));var authService=require(_0xcdaf('0x10'));var qs=require(_0xcdaf('0x11'));var as=require(_0xcdaf('0x12'));var hardwareService=require(_0xcdaf('0x13'));var logger=require(_0xcdaf('0x14'))(_0xcdaf('0x15'));var utils=require('../../config/utils');var config=require(_0xcdaf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdaf('0x17'))['db'];function respondWithStatusCode(_0x4121e7,_0x228f70){_0x228f70=_0x228f70||0xcc;return function(_0xd42ca1){if(_0xd42ca1){return _0x4121e7[_0xcdaf('0x18')](_0x228f70);}return _0x4121e7[_0xcdaf('0x19')](_0x228f70)[_0xcdaf('0x1a')]();};}function respondWithResult(_0x568de2,_0x31f445){_0x31f445=_0x31f445||0xc8;return function(_0x3eb602){if(_0x3eb602){return _0x568de2[_0xcdaf('0x19')](_0x31f445)[_0xcdaf('0x1b')](_0x3eb602);}};}function respondWithFilteredResult(_0x1e23ba,_0x196d43){return function(_0x1fd4a5){if(_0x1fd4a5){var _0x3ed249=typeof _0x196d43[_0xcdaf('0x1c')]===_0xcdaf('0x1d')&&typeof _0x196d43[_0xcdaf('0x1e')]===_0xcdaf('0x1d');var _0x50f6ff=_0x1fd4a5['count'];var _0x18b2b5=_0x3ed249?0x0:_0x196d43[_0xcdaf('0x1c')];var _0x18baed=_0x3ed249?_0x1fd4a5[_0xcdaf('0x1f')]:_0x196d43[_0xcdaf('0x1c')]+_0x196d43[_0xcdaf('0x1e')];var _0x42256e;if(_0x18baed>=_0x50f6ff){_0x18baed=_0x50f6ff;_0x42256e=0xc8;}else{_0x42256e=0xce;}_0x1e23ba['status'](_0x42256e);return _0x1e23ba[_0xcdaf('0x20')](_0xcdaf('0x21'),_0x18b2b5+'-'+_0x18baed+'/'+_0x50f6ff)[_0xcdaf('0x1b')](_0x1fd4a5);}return null;};}function patchUpdates(_0x48d870){return function(_0x18015b){try{jsonpatch[_0xcdaf('0x22')](_0x18015b,_0x48d870,!![]);}catch(_0x2fb1e1){return BPromise[_0xcdaf('0x23')](_0x2fb1e1);}return _0x18015b[_0xcdaf('0x24')]();};}function saveUpdates(_0x130d89,_0x271cf6){return function(_0x40423d){if(_0x40423d){return _0x40423d[_0xcdaf('0x25')](_0x130d89)['then'](function(_0x2682bc){return _0x2682bc;});}return null;};}function removeEntity(_0x20b0e6,_0x16795b){return function(_0x2500fb){if(_0x2500fb){return _0x2500fb[_0xcdaf('0x26')]()['then'](function(){_0x20b0e6[_0xcdaf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe32a45,_0x3dbeea){return function(_0x4549ee){if(!_0x4549ee){_0xe32a45[_0xcdaf('0x18')](0x194);}return _0x4549ee;};}function handleError(_0x2f7d52,_0x22ca5e){_0x22ca5e=_0x22ca5e||0x1f4;return function(_0x508a1d){logger['error'](_0x508a1d[_0xcdaf('0x27')]);if(_0x508a1d[_0xcdaf('0x28')]){delete _0x508a1d['name'];}_0x2f7d52[_0xcdaf('0x19')](_0x22ca5e)[_0xcdaf('0x29')](_0x508a1d);};}exports[_0xcdaf('0x2a')]=function(_0x44d1ee,_0x470c9c){var _0x7fb0b9={},_0x1b626f={},_0x5498ac={'count':0x0,'rows':[]};var _0xbd1627=_[_0xcdaf('0x2b')](db[_0xcdaf('0x2c')][_0xcdaf('0x2d')],function(_0x2ebcb1){return{'name':_0x2ebcb1[_0xcdaf('0x2e')],'type':_0x2ebcb1[_0xcdaf('0x2f')][_0xcdaf('0x30')]};});_0x1b626f[_0xcdaf('0x31')]=_['map'](_0xbd1627,_0xcdaf('0x28'));_0x1b626f[_0xcdaf('0x32')]=_[_0xcdaf('0x33')](_0x44d1ee[_0xcdaf('0x32')]);_0x1b626f[_0xcdaf('0x34')]=_['intersection'](_0x1b626f[_0xcdaf('0x31')],_0x1b626f[_0xcdaf('0x32')]);_0x7fb0b9[_0xcdaf('0x35')]=_[_0xcdaf('0x36')](_0x1b626f[_0xcdaf('0x31')],qs[_0xcdaf('0x37')](_0x44d1ee[_0xcdaf('0x32')][_0xcdaf('0x37')]));_0x7fb0b9[_0xcdaf('0x35')]=_0x7fb0b9[_0xcdaf('0x35')]['length']?_0x7fb0b9[_0xcdaf('0x35')]:_0x1b626f['model'];if(!_0x44d1ee[_0xcdaf('0x32')][_0xcdaf('0x38')](_0xcdaf('0x39'))){_0x7fb0b9['limit']=qs[_0xcdaf('0x1e')](_0x44d1ee[_0xcdaf('0x32')]['limit']);_0x7fb0b9[_0xcdaf('0x1c')]=qs[_0xcdaf('0x1c')](_0x44d1ee[_0xcdaf('0x32')]['offset']);}_0x7fb0b9[_0xcdaf('0x3a')]=qs[_0xcdaf('0x3b')](_0x44d1ee[_0xcdaf('0x32')]['sort']);_0x7fb0b9[_0xcdaf('0x3c')]=qs['filters'](_[_0xcdaf('0x3d')](_0x44d1ee['query'],_0x1b626f['filters']),_0xbd1627);if(_0x44d1ee['query']['filter']){_0x7fb0b9['where']=_[_0xcdaf('0x3e')](_0x7fb0b9[_0xcdaf('0x3c')],{'$or':_[_0xcdaf('0x2b')](_0xbd1627,function(_0x50bfc3){if(_0x50bfc3[_0xcdaf('0x2f')]!=='VIRTUAL'){var _0x3e2ca4={};_0x3e2ca4[_0x50bfc3[_0xcdaf('0x28')]]={'$like':'%'+_0x44d1ee['query']['filter']+'%'};return _0x3e2ca4;}})});}_0x7fb0b9=_[_0xcdaf('0x3e')]({},_0x7fb0b9,_0x44d1ee['options']);var _0x5836db={'where':_0x7fb0b9[_0xcdaf('0x3c')]};return db[_0xcdaf('0x2c')]['count'](_0x5836db)[_0xcdaf('0x3f')](function(_0x5d041e){_0x5498ac['count']=_0x5d041e;if(_0x44d1ee['query'][_0xcdaf('0x40')]){_0x7fb0b9[_0xcdaf('0x41')]=[{'all':!![]}];}return db[_0xcdaf('0x2c')][_0xcdaf('0x42')](_0x7fb0b9);})[_0xcdaf('0x3f')](function(_0x2015fd){_0x5498ac[_0xcdaf('0x43')]=_0x2015fd;return _0x5498ac;})[_0xcdaf('0x3f')](respondWithFilteredResult(_0x470c9c,_0x7fb0b9))[_0xcdaf('0x44')](handleError(_0x470c9c,null));};exports[_0xcdaf('0x45')]=function(_0x85018c,_0x3972ce){var _0x11108d={'raw':!![],'where':{'id':_0x85018c[_0xcdaf('0x46')]['id']}},_0x16e215={};_0x16e215['model']=_[_0xcdaf('0x33')](db['ChatTransferReport'][_0xcdaf('0x2d')]);_0x16e215[_0xcdaf('0x32')]=_['keys'](_0x85018c['query']);_0x16e215['filters']=_['intersection'](_0x16e215['model'],_0x16e215[_0xcdaf('0x32')]);_0x11108d['attributes']=_['intersection'](_0x16e215[_0xcdaf('0x31')],qs[_0xcdaf('0x37')](_0x85018c[_0xcdaf('0x32')][_0xcdaf('0x37')]));_0x11108d[_0xcdaf('0x35')]=_0x11108d[_0xcdaf('0x35')][_0xcdaf('0x47')]?_0x11108d[_0xcdaf('0x35')]:_0x16e215['model'];if(_0x85018c[_0xcdaf('0x32')][_0xcdaf('0x40')]){_0x11108d[_0xcdaf('0x41')]=[{'all':!![]}];}_0x11108d=_[_0xcdaf('0x3e')]({},_0x11108d,_0x85018c[_0xcdaf('0x48')]);return db[_0xcdaf('0x2c')][_0xcdaf('0x49')](_0x11108d)[_0xcdaf('0x3f')](handleEntityNotFound(_0x3972ce,null))[_0xcdaf('0x3f')](respondWithResult(_0x3972ce,null))['catch'](handleError(_0x3972ce,null));};exports[_0xcdaf('0x4a')]=function(_0x450bcd,_0x42f292){return db[_0xcdaf('0x2c')][_0xcdaf('0x4a')](_0x450bcd['body'],{})['then'](respondWithResult(_0x42f292,0xc9))[_0xcdaf('0x44')](handleError(_0x42f292,null));};exports[_0xcdaf('0x25')]=function(_0x3ed849,_0x305228){if(_0x3ed849[_0xcdaf('0x4b')]['id']){delete _0x3ed849[_0xcdaf('0x4b')]['id'];}return db[_0xcdaf('0x2c')][_0xcdaf('0x49')]({'where':{'id':_0x3ed849[_0xcdaf('0x46')]['id']}})[_0xcdaf('0x3f')](handleEntityNotFound(_0x305228,null))[_0xcdaf('0x3f')](saveUpdates(_0x3ed849[_0xcdaf('0x4b')],null))[_0xcdaf('0x3f')](respondWithResult(_0x305228,null))[_0xcdaf('0x44')](handleError(_0x305228,null));};exports['destroy']=function(_0x11d8b7,_0x50f744){return db[_0xcdaf('0x2c')][_0xcdaf('0x49')]({'where':{'id':_0x11d8b7['params']['id']}})['then'](handleEntityNotFound(_0x50f744,null))[_0xcdaf('0x3f')](removeEntity(_0x50f744,null))[_0xcdaf('0x44')](handleError(_0x50f744,null));};exports[_0xcdaf('0x4c')]=function(_0x1c401c,_0x24dff4){return db[_0xcdaf('0x2c')][_0xcdaf('0x4c')]()[_0xcdaf('0x3f')](respondWithResult(_0x24dff4,null))[_0xcdaf('0x44')](handleError(_0x24dff4,null));}; \ No newline at end of file +var _0x524c=['find','create','body','destroy','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','error','name','send','ChatTransferReport','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','count','includeAll','findAll','catch','show','params','options'];(function(_0x4a2707,_0x56a7aa){var _0x2eb468=function(_0x5ef08d){while(--_0x5ef08d){_0x4a2707['push'](_0x4a2707['shift']());}};_0x2eb468(++_0x56a7aa);}(_0x524c,0xe0));var _0xc524=function(_0x484025,_0x470843){_0x484025=_0x484025-0x0;var _0x5d1768=_0x524c[_0x484025];return _0x5d1768;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc524('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc524('0x1'));var moment=require(_0xc524('0x2'));var BPromise=require(_0xc524('0x3'));var Mustache=require(_0xc524('0x4'));var util=require(_0xc524('0x5'));var path=require(_0xc524('0x6'));var sox=require(_0xc524('0x7'));var csv=require(_0xc524('0x8'));var ejs=require(_0xc524('0x9'));var fs=require('fs');var fs_extra=require(_0xc524('0xa'));var _=require(_0xc524('0xb'));var squel=require(_0xc524('0xc'));var crypto=require(_0xc524('0xd'));var jsforce=require(_0xc524('0xe'));var deskjs=require(_0xc524('0xf'));var toCsv=require(_0xc524('0x8'));var querystring=require(_0xc524('0x10'));var Papa=require('papaparse');var Redis=require(_0xc524('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc524('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc524('0x13'));var logger=require(_0xc524('0x14'))('api');var utils=require(_0xc524('0x15'));var config=require(_0xc524('0x16'));var licenseUtil=require(_0xc524('0x17'));var db=require(_0xc524('0x18'))['db'];function respondWithStatusCode(_0x1914ad,_0x597ce6){_0x597ce6=_0x597ce6||0xcc;return function(_0x229713){if(_0x229713){return _0x1914ad['sendStatus'](_0x597ce6);}return _0x1914ad['status'](_0x597ce6)[_0xc524('0x19')]();};}function respondWithResult(_0x1c5c06,_0x4d58b5){_0x4d58b5=_0x4d58b5||0xc8;return function(_0x2148ce){if(_0x2148ce){return _0x1c5c06[_0xc524('0x1a')](_0x4d58b5)[_0xc524('0x1b')](_0x2148ce);}};}function respondWithFilteredResult(_0x3aa097,_0x507155){return function(_0x255faf){if(_0x255faf){var _0x229250=typeof _0x507155[_0xc524('0x1c')]===_0xc524('0x1d')&&typeof _0x507155[_0xc524('0x1e')]===_0xc524('0x1d');var _0x3884bd=_0x255faf['count'];var _0x5a7094=_0x229250?0x0:_0x507155[_0xc524('0x1c')];var _0x4d464f=_0x229250?_0x255faf['count']:_0x507155[_0xc524('0x1c')]+_0x507155[_0xc524('0x1e')];var _0x217400;if(_0x4d464f>=_0x3884bd){_0x4d464f=_0x3884bd;_0x217400=0xc8;}else{_0x217400=0xce;}_0x3aa097[_0xc524('0x1a')](_0x217400);return _0x3aa097['set'](_0xc524('0x1f'),_0x5a7094+'-'+_0x4d464f+'/'+_0x3884bd)['json'](_0x255faf);}return null;};}function patchUpdates(_0xaacff9){return function(_0x37d620){try{jsonpatch[_0xc524('0x20')](_0x37d620,_0xaacff9,!![]);}catch(_0x265319){return BPromise['reject'](_0x265319);}return _0x37d620[_0xc524('0x21')]();};}function saveUpdates(_0x34b25c,_0x3540c8){return function(_0x1ad93c){if(_0x1ad93c){return _0x1ad93c[_0xc524('0x22')](_0x34b25c)[_0xc524('0x23')](function(_0xde3e27){return _0xde3e27;});}return null;};}function removeEntity(_0x3cfb56,_0x34aa09){return function(_0x4a275f){if(_0x4a275f){return _0x4a275f['destroy']()[_0xc524('0x23')](function(){_0x3cfb56[_0xc524('0x1a')](0xcc)[_0xc524('0x19')]();});}};}function handleEntityNotFound(_0x18f344,_0x5b6784){return function(_0xb6034b){if(!_0xb6034b){_0x18f344['sendStatus'](0x194);}return _0xb6034b;};}function handleError(_0x498376,_0x3bfcdf){_0x3bfcdf=_0x3bfcdf||0x1f4;return function(_0x2e4093){logger[_0xc524('0x24')](_0x2e4093['stack']);if(_0x2e4093[_0xc524('0x25')]){delete _0x2e4093[_0xc524('0x25')];}_0x498376[_0xc524('0x1a')](_0x3bfcdf)[_0xc524('0x26')](_0x2e4093);};}exports['index']=function(_0x4af084,_0x3c8149){var _0x254e88={},_0x110ece={},_0x43e675={'count':0x0,'rows':[]};var _0x4c4499=_['map'](db[_0xc524('0x27')][_0xc524('0x28')],function(_0x35abae){return{'name':_0x35abae[_0xc524('0x29')],'type':_0x35abae['type']['key']};});_0x110ece[_0xc524('0x2a')]=_[_0xc524('0x2b')](_0x4c4499,_0xc524('0x25'));_0x110ece['query']=_[_0xc524('0x2c')](_0x4af084[_0xc524('0x2d')]);_0x110ece[_0xc524('0x2e')]=_['intersection'](_0x110ece[_0xc524('0x2a')],_0x110ece['query']);_0x254e88[_0xc524('0x2f')]=_[_0xc524('0x30')](_0x110ece[_0xc524('0x2a')],qs[_0xc524('0x31')](_0x4af084[_0xc524('0x2d')][_0xc524('0x31')]));_0x254e88[_0xc524('0x2f')]=_0x254e88[_0xc524('0x2f')][_0xc524('0x32')]?_0x254e88[_0xc524('0x2f')]:_0x110ece[_0xc524('0x2a')];if(!_0x4af084[_0xc524('0x2d')][_0xc524('0x33')](_0xc524('0x34'))){_0x254e88[_0xc524('0x1e')]=qs['limit'](_0x4af084['query'][_0xc524('0x1e')]);_0x254e88[_0xc524('0x1c')]=qs[_0xc524('0x1c')](_0x4af084[_0xc524('0x2d')][_0xc524('0x1c')]);}_0x254e88[_0xc524('0x35')]=qs['sort'](_0x4af084[_0xc524('0x2d')][_0xc524('0x36')]);_0x254e88['where']=qs[_0xc524('0x2e')](_[_0xc524('0x37')](_0x4af084[_0xc524('0x2d')],_0x110ece['filters']),_0x4c4499);if(_0x4af084['query'][_0xc524('0x38')]){_0x254e88['where']=_[_0xc524('0x39')](_0x254e88[_0xc524('0x3a')],{'$or':_[_0xc524('0x2b')](_0x4c4499,function(_0x11a52a){if(_0x11a52a[_0xc524('0x3b')]!==_0xc524('0x3c')){var _0x1db9c7={};_0x1db9c7[_0x11a52a[_0xc524('0x25')]]={'$like':'%'+_0x4af084['query'][_0xc524('0x38')]+'%'};return _0x1db9c7;}})});}_0x254e88=_[_0xc524('0x39')]({},_0x254e88,_0x4af084['options']);var _0x4a2815={'where':_0x254e88[_0xc524('0x3a')]};return db[_0xc524('0x27')]['count'](_0x4a2815)[_0xc524('0x23')](function(_0x32c2a2){_0x43e675[_0xc524('0x3d')]=_0x32c2a2;if(_0x4af084['query'][_0xc524('0x3e')]){_0x254e88['include']=[{'all':!![]}];}return db[_0xc524('0x27')][_0xc524('0x3f')](_0x254e88);})[_0xc524('0x23')](function(_0x5686fc){_0x43e675['rows']=_0x5686fc;return _0x43e675;})['then'](respondWithFilteredResult(_0x3c8149,_0x254e88))[_0xc524('0x40')](handleError(_0x3c8149,null));};exports[_0xc524('0x41')]=function(_0x4e201a,_0x68caed){var _0x235d76={'raw':!![],'where':{'id':_0x4e201a[_0xc524('0x42')]['id']}},_0x316f5c={};_0x316f5c['model']=_[_0xc524('0x2c')](db[_0xc524('0x27')][_0xc524('0x28')]);_0x316f5c['query']=_[_0xc524('0x2c')](_0x4e201a[_0xc524('0x2d')]);_0x316f5c[_0xc524('0x2e')]=_[_0xc524('0x30')](_0x316f5c[_0xc524('0x2a')],_0x316f5c['query']);_0x235d76[_0xc524('0x2f')]=_[_0xc524('0x30')](_0x316f5c[_0xc524('0x2a')],qs[_0xc524('0x31')](_0x4e201a[_0xc524('0x2d')][_0xc524('0x31')]));_0x235d76['attributes']=_0x235d76[_0xc524('0x2f')]['length']?_0x235d76[_0xc524('0x2f')]:_0x316f5c[_0xc524('0x2a')];if(_0x4e201a[_0xc524('0x2d')][_0xc524('0x3e')]){_0x235d76['include']=[{'all':!![]}];}_0x235d76=_['merge']({},_0x235d76,_0x4e201a[_0xc524('0x43')]);return db[_0xc524('0x27')][_0xc524('0x44')](_0x235d76)[_0xc524('0x23')](handleEntityNotFound(_0x68caed,null))[_0xc524('0x23')](respondWithResult(_0x68caed,null))['catch'](handleError(_0x68caed,null));};exports[_0xc524('0x45')]=function(_0x12b8bd,_0x478fbe){return db[_0xc524('0x27')][_0xc524('0x45')](_0x12b8bd[_0xc524('0x46')],{})[_0xc524('0x23')](respondWithResult(_0x478fbe,0xc9))[_0xc524('0x40')](handleError(_0x478fbe,null));};exports[_0xc524('0x22')]=function(_0x3656b6,_0x59298c){if(_0x3656b6['body']['id']){delete _0x3656b6[_0xc524('0x46')]['id'];}return db[_0xc524('0x27')][_0xc524('0x44')]({'where':{'id':_0x3656b6['params']['id']}})[_0xc524('0x23')](handleEntityNotFound(_0x59298c,null))['then'](saveUpdates(_0x3656b6['body'],null))[_0xc524('0x23')](respondWithResult(_0x59298c,null))['catch'](handleError(_0x59298c,null));};exports[_0xc524('0x47')]=function(_0x1df8d2,_0x408198){return db[_0xc524('0x27')][_0xc524('0x44')]({'where':{'id':_0x1df8d2[_0xc524('0x42')]['id']}})['then'](handleEntityNotFound(_0x408198,null))[_0xc524('0x23')](removeEntity(_0x408198,null))[_0xc524('0x40')](handleError(_0x408198,null));};exports[_0xc524('0x48')]=function(_0x394151,_0x24847f){return db[_0xc524('0x27')][_0xc524('0x48')]()['then'](respondWithResult(_0x24847f,null))[_0xc524('0x40')](handleError(_0x24847f,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2110520..d0c2541 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 _0x33cd=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash','util','api','bluebird','path','rimraf'];(function(_0x58f6c0,_0x210594){var _0x2431a0=function(_0x159c8b){while(--_0x159c8b){_0x58f6c0['push'](_0x58f6c0['shift']());}};_0x2431a0(++_0x210594);}(_0x33cd,0x1a7));var _0xd33c=function(_0x1f4719,_0x58a021){_0x1f4719=_0x1f4719-0x0;var _0x320527=_0x33cd[_0x1f4719];return _0x320527;};'use strict';var _=require(_0xd33c('0x0'));var util=require(_0xd33c('0x1'));var logger=require('../../config/logger')(_0xd33c('0x2'));var moment=require('moment');var BPromise=require(_0xd33c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd33c('0x4'));var rimraf=require(_0xd33c('0x5'));var config=require(_0xd33c('0x6'));var attributes=require(_0xd33c('0x7'));module[_0xd33c('0x8')]=function(_0x21cf67,_0x48f5dc){return _0x21cf67['define'](_0xd33c('0x9'),attributes,{'tableName':_0xd33c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x45a9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x45a9,0x192));var _0x945a=function(_0x3a0856,_0x508d57){_0x3a0856=_0x3a0856-0x0;var _0x18cf7e=_0x45a9[_0x3a0856];return _0x18cf7e;};'use strict';var _=require(_0x945a('0x0'));var util=require('util');var logger=require(_0x945a('0x1'))(_0x945a('0x2'));var moment=require(_0x945a('0x3'));var BPromise=require(_0x945a('0x4'));var rp=require(_0x945a('0x5'));var fs=require('fs');var path=require(_0x945a('0x6'));var rimraf=require(_0x945a('0x7'));var config=require(_0x945a('0x8'));var attributes=require(_0x945a('0x9'));module[_0x945a('0xa')]=function(_0x58a71d,_0x12ebad){return _0x58a71d[_0x945a('0xb')](_0x945a('0xc'),attributes,{'tableName':_0x945a('0xd'),'paranoid':![],'indexes':[{'name':_0x945a('0xe'),'fields':[_0x945a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 59804ec..8213666 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 _0x442a=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x442a,0xaf));var _0xa442=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x442a[_0x28d18d];return _0x470640;};'use strict';var _=require('lodash');var util=require(_0xa442('0x0'));var moment=require(_0xa442('0x1'));var BPromise=require('bluebird');var rs=require(_0xa442('0x2'));var fs=require('fs');var Redis=require(_0xa442('0x3'));var db=require(_0xa442('0x4'))['db'];var utils=require(_0xa442('0x5'));var logger=require('../../config/logger')(_0xa442('0x6'));var config=require(_0xa442('0x7'));var jayson=require(_0xa442('0x8'));var client=jayson['client'][_0xa442('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af5b3,_0x16ff3d,_0x1e4e79){return new BPromise(function(_0xdec22e,_0x1f6af0){return client[_0xa442('0xa')](_0x2af5b3,_0x1e4e79)['then'](function(_0x37f50c){logger[_0xa442('0xb')](_0xa442('0xc'),_0x16ff3d,_0xa442('0xd'));logger['debug'](_0xa442('0xe'),_0x16ff3d,_0xa442('0xd'),JSON['stringify'](_0x37f50c));if(_0x37f50c[_0xa442('0xf')]){if(_0x37f50c[_0xa442('0xf')][_0xa442('0x10')]===0x1f4){logger[_0xa442('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x16ff3d,_0x37f50c[_0xa442('0xf')][_0xa442('0x11')]);return _0x1f6af0(_0x37f50c[_0xa442('0xf')][_0xa442('0x11')]);}logger[_0xa442('0xf')](_0xa442('0xc'),_0x16ff3d,_0x37f50c[_0xa442('0xf')]['message']);return _0xdec22e(_0x37f50c[_0xa442('0xf')]['message']);}else{logger[_0xa442('0xb')](_0xa442('0xc'),_0x16ff3d,_0xa442('0xd'));_0xdec22e(_0x37f50c[_0xa442('0x12')][_0xa442('0x11')]);}})[_0xa442('0x13')](function(_0x487380){logger['error'](_0xa442('0xc'),_0x16ff3d,_0x487380);_0x1f6af0(_0x487380);});});} \ No newline at end of file +var _0xa03d=['result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info'];(function(_0x5742d6,_0x41b7db){var _0x536b75=function(_0x2b3161){while(--_0x2b3161){_0x5742d6['push'](_0x5742d6['shift']());}};_0x536b75(++_0x41b7db);}(_0xa03d,0xa2));var _0xda03=function(_0x477889,_0x1d514d){_0x477889=_0x477889-0x0;var _0x460d7a=_0xa03d[_0x477889];return _0x460d7a;};'use strict';var _=require(_0xda03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xda03('0x1'));var fs=require('fs');var Redis=require(_0xda03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xda03('0x3'));var logger=require(_0xda03('0x4'))('rpc');var config=require(_0xda03('0x5'));var jayson=require(_0xda03('0x6'));var client=jayson[_0xda03('0x7')][_0xda03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4079f3,_0x466b62,_0x16634d){return new BPromise(function(_0x4d1b62,_0x2b23b8){return client['request'](_0x4079f3,_0x16634d)[_0xda03('0x9')](function(_0x506c7b){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x466b62,_0xda03('0xa'));logger['debug'](_0xda03('0xb'),_0x466b62,_0xda03('0xa'),JSON[_0xda03('0xc')](_0x506c7b));if(_0x506c7b[_0xda03('0xd')]){if(_0x506c7b[_0xda03('0xd')][_0xda03('0xe')]===0x1f4){logger[_0xda03('0xd')](_0xda03('0xf'),_0x466b62,_0x506c7b['error'][_0xda03('0x10')]);return _0x2b23b8(_0x506c7b['error'][_0xda03('0x10')]);}logger[_0xda03('0xd')](_0xda03('0xf'),_0x466b62,_0x506c7b['error'][_0xda03('0x10')]);return _0x4d1b62(_0x506c7b[_0xda03('0xd')][_0xda03('0x10')]);}else{logger[_0xda03('0x11')](_0xda03('0xf'),_0x466b62,_0xda03('0xa'));_0x4d1b62(_0x506c7b[_0xda03('0x12')]['message']);}})[_0xda03('0x13')](function(_0x617730){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x466b62,_0x617730);_0x2b23b8(_0x617730);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index be09645..1350255 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 _0xb609=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x4d0a8e,_0x338a7b){var _0x55d9ee=function(_0xa9b558){while(--_0xa9b558){_0x4d0a8e['push'](_0x4d0a8e['shift']());}};_0x55d9ee(++_0x338a7b);}(_0xb609,0xd5));var _0x9b60=function(_0x1cc0b5,_0x384d5f){_0x1cc0b5=_0x1cc0b5-0x0;var _0x45b6f3=_0xb609[_0x1cc0b5];return _0x45b6f3;};'use strict';var multer=require(_0x9b60('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b60('0x1'));var router=express[_0x9b60('0x2')]();var fs_extra=require(_0x9b60('0x3'));var auth=require(_0x9b60('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9b60('0x5'));var controller=require(_0x9b60('0x6'));router[_0x9b60('0x7')]('/',auth[_0x9b60('0x8')](),controller[_0x9b60('0x9')]);router[_0x9b60('0x7')](_0x9b60('0xa'),auth[_0x9b60('0x8')](),controller['describe']);router['get'](_0x9b60('0xb'),auth[_0x9b60('0x8')](),controller[_0x9b60('0xc')]);router[_0x9b60('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b60('0xe')]);router[_0x9b60('0xf')](_0x9b60('0xb'),auth[_0x9b60('0x8')](),controller[_0x9b60('0x10')]);router[_0x9b60('0x11')](_0x9b60('0xb'),auth[_0x9b60('0x8')](),controller[_0x9b60('0x12')]);module[_0x9b60('0x13')]=router; \ No newline at end of file +var _0x3318=['put','update','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3318,0xb7));var _0x8331=function(_0x194b5c,_0x3e4893){_0x194b5c=_0x194b5c-0x0;var _0x2badf6=_0x3318[_0x194b5c];return _0x2badf6;};'use strict';var multer=require('multer');var util=require(_0x8331('0x0'));var path=require(_0x8331('0x1'));var timeout=require('connect-timeout');var express=require(_0x8331('0x2'));var router=express[_0x8331('0x3')]();var fs_extra=require(_0x8331('0x4'));var auth=require(_0x8331('0x5'));var interaction=require(_0x8331('0x6'));var config=require(_0x8331('0x7'));var controller=require(_0x8331('0x8'));router[_0x8331('0x9')]('/',auth[_0x8331('0xa')](),controller[_0x8331('0xb')]);router[_0x8331('0x9')]('/describe',auth[_0x8331('0xa')](),controller['describe']);router['get'](_0x8331('0xc'),auth[_0x8331('0xa')](),controller['show']);router[_0x8331('0xd')]('/',auth[_0x8331('0xa')](),controller[_0x8331('0xe')]);router[_0x8331('0xf')](_0x8331('0xc'),auth[_0x8331('0xa')](),controller[_0x8331('0x10')]);router[_0x8331('0x11')](_0x8331('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 32afbed..26ba327 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 _0x2891=['Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2891,0x159));var _0x1289=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2891[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x1289('0x0'));var rs=require(_0x1289('0x1'));module['exports']={'name':{'type':Sequelize[_0x1289('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1289('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x4')},'mapKeyOffline':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x1289('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x5')},'customerAlias':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1289('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1289('0x2')]},'animation':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1289('0xa')](_0x1289('0xb'),_0x1289('0xc')),'defaultValue':_0x1289('0xb')},'header_online':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0xe')},'header_offline':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0xf')},'download_transcript':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1289('0x11')]},'closingQuestion':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x14')},'noteTitle':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x16')},'closingMessage':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0xe')},'skipMessageButton':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x17')},'conditionAgreement':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x18')},'ratingType':{'type':Sequelize[_0x1289('0xa')](_0x1289('0x19'),_0x1289('0x1a')),'defaultValue':_0x1289('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1289('0x11')],'defaultValue':function(){return JSON[_0x1289('0x1b')]({'items':[{'type':_0x1289('0x1c'),'variable':null,'config':{'placeholder':_0x1289('0x1d'),'type':_0x1289('0x1e'),'required':!![]},'props':{'title':_0x1289('0x1d'),'helpText':''}},{'type':_0x1289('0x1c'),'props':{'title':_0x1289('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1289('0x4'),'type':_0x1289('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1289('0x1f')](_0x1289('0x20'))?JSON[_0x1289('0x21')](this['getDataValue'](_0x1289('0x20'))):{};},'set':function(_0x24ae7b){return this[_0x1289('0x22')](_0x1289('0x20'),JSON[_0x1289('0x1b')](_0x24ae7b));}},'offlineForm':{'type':Sequelize[_0x1289('0x11')],'defaultValue':function(){return JSON[_0x1289('0x1b')]({'items':[{'type':_0x1289('0x1c'),'props':{'title':_0x1289('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1289('0x4'),'type':'email'},'variable':null},{'type':_0x1289('0x23'),'config':{'placeholder':_0x1289('0x24')},'props':{'title':_0x1289('0x24'),'helpText':_0x1289('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x1289('0x1f')](_0x1289('0x26'))?JSON[_0x1289('0x21')](this['getDataValue'](_0x1289('0x26'))):{};},'set':function(_0x3268e2){return this[_0x1289('0x22')]('offlineForm',JSON[_0x1289('0x1b')](_0x3268e2));}},'token':{'type':Sequelize[_0x1289('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1289('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1289('0x2')]},'waitingTitle':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1289('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1289('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1289('0x11')],'defaultValue':function(){return _0x1289('0x2a');}},'notificationSound':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x2b')},'verticalAlignment':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x2c')},'messagesAlignment':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x2d')},'defaultTitle':{'type':Sequelize[_0x1289('0x2')]},'customerAvatar':{'type':Sequelize[_0x1289('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1289('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x2f')},'systemAvatar':{'type':Sequelize[_0x1289('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1289('0x8')],'comment':_0x1289('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![],'comment':_0x1289('0x31'),'set':function(_0x3deeea){if(!_0x3deeea)this[_0x1289('0x22')]('mandatoryDispositionPauseId',null);this[_0x1289('0x22')](_0x1289('0x32'),_0x3deeea);}},'vidaooEscalation':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1289('0x2')]},'vidaooTopic':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x33')},'vidaooNote':{'type':Sequelize[_0x1289('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc4eb=['Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','rounded','squared','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note'];(function(_0xe91fe7,_0x5682c8){var _0x5674db=function(_0x254b1b){while(--_0x254b1b){_0xe91fe7['push'](_0xe91fe7['shift']());}};_0x5674db(++_0x5682c8);}(_0xc4eb,0x1f4));var _0xbc4e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc4eb[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xbc4e('0x0'));var rs=require(_0xbc4e('0x1'));module[_0xbc4e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'unique':_0xbc4e('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x5')},'key':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':_0xbc4e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':_0xbc4e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbc4e('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xbc4e('0x9'),_0xbc4e('0xa')),'defaultValue':_0xbc4e('0x9')},'header_online':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xb')},'offline_chat_button':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0xd')},'download_transcript':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbc4e('0xf')]},'closingQuestion':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x13')},'placeholderMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xc')},'skipMessageButton':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x14')},'conditionAgreement':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x15')},'ratingType':{'type':Sequelize[_0xbc4e('0x16')](_0xbc4e('0x17'),_0xbc4e('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbc4e('0xf')],'defaultValue':function(){return JSON[_0xbc4e('0x19')]({'items':[{'type':_0xbc4e('0x1a'),'variable':null,'config':{'placeholder':_0xbc4e('0x1b'),'type':'text','required':!![]},'props':{'title':_0xbc4e('0x1b'),'helpText':''}},{'type':_0xbc4e('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbc4e('0x5'),'type':_0xbc4e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbc4e('0x1c')](_0xbc4e('0x1d'))?JSON[_0xbc4e('0x1e')](this[_0xbc4e('0x1c')](_0xbc4e('0x1d'))):{};},'set':function(_0x117b32){return this[_0xbc4e('0x1f')]('onlineForm',JSON['stringify'](_0x117b32));}},'offlineForm':{'type':Sequelize[_0xbc4e('0xf')],'defaultValue':function(){return JSON[_0xbc4e('0x19')]({'items':[{'type':'input','props':{'title':_0xbc4e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xbc4e('0x5'),'type':_0xbc4e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xbc4e('0x20')},'props':{'title':'Comments','helpText':_0xbc4e('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xbc4e('0x22'))?JSON[_0xbc4e('0x1e')](this[_0xbc4e('0x1c')](_0xbc4e('0x22'))):{};},'set':function(_0x55839b){return this['setDataValue']('offlineForm',JSON[_0xbc4e('0x19')](_0x55839b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbc4e('0x23')]();}},'autoclose':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbc4e('0x3')]},'forwardOffline':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbc4e('0x3')]},'waitingTitle':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x24')},'waitingMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x26')},'offlineMessageBody':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x28')},'skipUnmanaged':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbc4e('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbc4e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbc4e('0x29');}},'notificationSound':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbc4e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x2b')},'verticalAlignment':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x2c')},'messagesAlignment':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x2d')},'defaultTitle':{'type':Sequelize[_0xbc4e('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc4e('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbc4e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbc4e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbc4e('0x8')],'comment':_0xbc4e('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![],'comment':_0xbc4e('0x30'),'set':function(_0xc0a351){if(!_0xc0a351)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xbc4e('0x1f')](_0xbc4e('0x31'),_0xc0a351);}},'vidaooEscalation':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbc4e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':_0xbc4e('0x32')},'vidaooNote':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':function(){return _0xbc4e('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xbc4e('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbc4e('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ad2bdf4..be2df28 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 _0xff12=['server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','mapKey','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','autoclose','push','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','bulkCreate','Smtp','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','color','tag','getSnippet','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','Intervals','all','some','remote','connection','replace','alignment','verticalAlignment','labelText','color_button','backgroundColor','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','fs-extra','lodash','querystring','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','info','debug','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','offset','limit','undefined','count','set','Content-Range','json','update','get','ChatWebsites','UserProfileResource','destroy','then','end','name','send','index','Pause','map','ChatWebsite','rawAttributes','type','query','attributes','model','fields','length','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','show','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xff12,0xa8));var _0x2ff1=function(_0x3316d0,_0x357e55){_0x3316d0=_0x3316d0-0x0;var _0x252405=_0xff12[_0x3316d0];return _0x252405;};'use strict';var BPromise=require(_0x2ff1('0x0'));var Mustache=require(_0x2ff1('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ff1('0x2'));var _=require(_0x2ff1('0x3'));var querystring=require(_0x2ff1('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2ff1('0x5'))(_0x2ff1('0x6'));var config=require('../../config/environment');var db=require(_0x2ff1('0x7'))['db'];config['redis']=_[_0x2ff1('0x8')](config['redis'],{'host':_0x2ff1('0x9'),'port':0x18eb});var socket=require(_0x2ff1('0xa'))(new Redis(config[_0x2ff1('0xb')]));require('./chatWebsite.socket')[_0x2ff1('0xc')](socket);var jayson=require(_0x2ff1('0xd'));var client=jayson[_0x2ff1('0xe')][_0x2ff1('0xf')]({'port':0x232c});var client9002=jayson['client'][_0x2ff1('0xf')]({'port':0x232a});var client9003=jayson[_0x2ff1('0xe')][_0x2ff1('0xf')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x47d960,_0x4ea7ec,_0x522d49,_0x4fce4c){return new BPromise(function(_0x2a8c73,_0x47bee4){var _0x12129d=_0x4fce4c||client;return _0x12129d[_0x2ff1('0x10')](_0x47d960,_0x522d49)['then'](function(_0x599b6e){logger[_0x2ff1('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4ea7ec,'request\x20sent');logger[_0x2ff1('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ea7ec,_0x2ff1('0x13'),JSON['stringify'](_0x599b6e));if(_0x599b6e[_0x2ff1('0x14')]){if(_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x15')]===0x1f4){logger[_0x2ff1('0x14')](_0x2ff1('0x16'),_0x4ea7ec,_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);return _0x47bee4(_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);}logger['error'](_0x2ff1('0x16'),_0x4ea7ec,_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);return _0x2a8c73(_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);}else{logger[_0x2ff1('0x11')](_0x2ff1('0x16'),_0x4ea7ec,_0x2ff1('0x13'));_0x2a8c73(_0x599b6e[_0x2ff1('0x18')][_0x2ff1('0x17')]);}})[_0x2ff1('0x19')](function(_0x3dd42d){logger[_0x2ff1('0x14')](_0x2ff1('0x16'),_0x4ea7ec,_0x3dd42d);_0x47bee4(_0x3dd42d);});});}function respondWithStatusCode(_0x393e76,_0x16b875){_0x16b875=_0x16b875||0xcc;return function(_0x10cf11){if(_0x10cf11){return _0x393e76['sendStatus'](_0x16b875);}return _0x393e76[_0x2ff1('0x1a')](_0x16b875)['end']();};}function respondWithResult(_0x5eaad1,_0x2d2390){_0x2d2390=_0x2d2390||0xc8;return function(_0x29a5e9){if(_0x29a5e9){return _0x5eaad1[_0x2ff1('0x1a')](_0x2d2390)['json'](_0x29a5e9);}};}function respondWithFilteredResult(_0x56bcdc,_0x1961c9){return function(_0x1f588d){if(_0x1f588d){var _0x31e1e7=typeof _0x1961c9[_0x2ff1('0x1b')]==='undefined'&&typeof _0x1961c9[_0x2ff1('0x1c')]===_0x2ff1('0x1d');var _0x183956=_0x1f588d[_0x2ff1('0x1e')];var _0x397e59=_0x31e1e7?0x0:_0x1961c9[_0x2ff1('0x1b')];var _0x3b39c0=_0x31e1e7?_0x1f588d[_0x2ff1('0x1e')]:_0x1961c9['offset']+_0x1961c9[_0x2ff1('0x1c')];var _0x3b7c97;if(_0x3b39c0>=_0x183956){_0x3b39c0=_0x183956;_0x3b7c97=0xc8;}else{_0x3b7c97=0xce;}_0x56bcdc[_0x2ff1('0x1a')](_0x3b7c97);return _0x56bcdc[_0x2ff1('0x1f')](_0x2ff1('0x20'),_0x397e59+'-'+_0x3b39c0+'/'+_0x183956)[_0x2ff1('0x21')](_0x1f588d);}return null;};}function saveUpdates(_0x1da355){return function(_0x37ec33){if(_0x37ec33){return _0x37ec33[_0x2ff1('0x22')](_0x1da355)['then'](function(_0x3aa2b8){return _0x3aa2b8;});}return null;};}function removeEntity(_0x23cb85){return function(_0x408ad0){if(_0x408ad0){return _0x408ad0['destroy']()['then'](function(){var _0xe3cffb=_0x408ad0[_0x2ff1('0x23')]({'plain':!![]});var _0x14c5f1=_0x2ff1('0x24');return db[_0x2ff1('0x25')][_0x2ff1('0x26')]({'where':{'type':_0x14c5f1,'resourceId':_0xe3cffb['id']}})[_0x2ff1('0x27')](function(){return _0x408ad0;});})[_0x2ff1('0x27')](function(){_0x23cb85[_0x2ff1('0x1a')](0xcc)[_0x2ff1('0x28')]();});}};}function handleEntityNotFound(_0x364a25){return function(_0x50315f){if(!_0x50315f){_0x364a25['sendStatus'](0x194);}return _0x50315f;};}function handleError(_0x4b5400,_0x55999b){_0x55999b=_0x55999b||0x1f4;return function(_0x471e25){logger[_0x2ff1('0x14')](_0x471e25['stack']);if(_0x471e25[_0x2ff1('0x29')]){delete _0x471e25['name'];}_0x4b5400['status'](_0x55999b)[_0x2ff1('0x2a')](_0x471e25);};}exports[_0x2ff1('0x2b')]=function(_0x360cfb,_0x35f45a){var _0x393ee5={'include':[{'model':db[_0x2ff1('0x2c')],'as':'mandatoryDispositionPause'}]},_0x55e0bf={},_0x44f5e3={'count':0x0,'rows':[]};var _0x1378d7=_[_0x2ff1('0x2d')](db[_0x2ff1('0x2e')][_0x2ff1('0x2f')],function(_0x1f6df6){return{'name':_0x1f6df6['fieldName'],'type':_0x1f6df6[_0x2ff1('0x30')]['key']};});_0x55e0bf['model']=_['map'](_0x1378d7,_0x2ff1('0x29'));_0x55e0bf[_0x2ff1('0x31')]=_['keys'](_0x360cfb['query']);_0x55e0bf['filters']=_['intersection'](_0x55e0bf['model'],_0x55e0bf[_0x2ff1('0x31')]);_0x393ee5[_0x2ff1('0x32')]=_['intersection'](_0x55e0bf[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x393ee5['attributes']=_0x393ee5[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x393ee5[_0x2ff1('0x32')]:_0x55e0bf[_0x2ff1('0x33')];if(!_0x360cfb[_0x2ff1('0x31')]['hasOwnProperty']('nolimit')){_0x393ee5[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x393ee5[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}_0x393ee5['order']=qs[_0x2ff1('0x36')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x36')]);_0x393ee5['where']=qs['filters'](_[_0x2ff1('0x37')](_0x360cfb[_0x2ff1('0x31')],_0x55e0bf[_0x2ff1('0x38')]),_0x1378d7);if(_0x360cfb['query'][_0x2ff1('0x39')]){_0x393ee5[_0x2ff1('0x3a')]=_['merge'](_0x393ee5[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x1378d7,function(_0xfb1776){if(_0xfb1776[_0x2ff1('0x30')]!=='VIRTUAL'){var _0xcc97={};_0xcc97[_0xfb1776[_0x2ff1('0x29')]]={'$like':'%'+_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0xcc97;}})});}_0x393ee5=_[_0x2ff1('0x3b')]({},_0x393ee5,_0x360cfb[_0x2ff1('0x3c')]);var _0x4c3e6c={'where':_0x393ee5[_0x2ff1('0x3a')]};return db[_0x2ff1('0x2e')]['count'](_0x4c3e6c)[_0x2ff1('0x27')](function(_0x447bac){_0x44f5e3[_0x2ff1('0x1e')]=_0x447bac;if(_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x393ee5[_0x2ff1('0x3e')]=[{'all':!![]}];}return db[_0x2ff1('0x2e')][_0x2ff1('0x3f')](_0x393ee5);})['then'](function(_0x1cccbc){_0x44f5e3['rows']=_0x1cccbc;return _0x44f5e3;})[_0x2ff1('0x27')](respondWithFilteredResult(_0x35f45a,_0x393ee5))[_0x2ff1('0x19')](handleError(_0x35f45a,null));};exports[_0x2ff1('0x40')]=function(_0x28604,_0x45d3fe){var _0x4f4412={'raw':![],'where':{'id':_0x28604['params']['id']},'include':[{'model':db[_0x2ff1('0x2c')],'as':'mandatoryDispositionPause'}]},_0x10dffc={};_0x10dffc[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db['ChatWebsite']['rawAttributes']);_0x10dffc[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x28604['query']);_0x10dffc[_0x2ff1('0x38')]=_['intersection'](_0x10dffc[_0x2ff1('0x33')],_0x10dffc[_0x2ff1('0x31')]);_0x4f4412[_0x2ff1('0x32')]=_[_0x2ff1('0x42')](_0x10dffc['model'],qs[_0x2ff1('0x34')](_0x28604[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x4f4412[_0x2ff1('0x32')]=_0x4f4412[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x4f4412[_0x2ff1('0x32')]:_0x10dffc[_0x2ff1('0x33')];if(_0x28604[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x4f4412[_0x2ff1('0x3e')]=[{'all':!![]}];}_0x4f4412=_[_0x2ff1('0x3b')]({},_0x4f4412,_0x28604[_0x2ff1('0x3c')]);return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x4f4412)[_0x2ff1('0x27')](handleEntityNotFound(_0x45d3fe,null))[_0x2ff1('0x27')](respondWithResult(_0x45d3fe,null))[_0x2ff1('0x19')](handleError(_0x45d3fe,null));};exports[_0x2ff1('0x44')]=function(_0x139ee9,_0x28491b){return db['ChatWebsite'][_0x2ff1('0x44')](_0x139ee9['body'],{})['then'](function(_0x12a512){var _0x316e4c=_0x139ee9[_0x2ff1('0x45')]['get']({'plain':!![]});if(!_0x316e4c)throw new Error(_0x2ff1('0x46'));if(_0x316e4c[_0x2ff1('0x47')]===_0x2ff1('0x45')){var _0x8d757c=_0x12a512[_0x2ff1('0x23')]({'plain':!![]});var _0x256f9d='ChatWebsites';return db[_0x2ff1('0x48')]['find']({'where':{'name':_0x256f9d,'userProfileId':_0x316e4c['userProfileId']},'raw':!![]})[_0x2ff1('0x27')](function(_0x37356d){if(_0x37356d&&_0x37356d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x8d757c[_0x2ff1('0x29')],'resourceId':_0x8d757c['id'],'type':_0x37356d[_0x2ff1('0x29')],'sectionId':_0x37356d['id']},{})[_0x2ff1('0x27')](function(){return _0x12a512;});}else{return _0x12a512;}})[_0x2ff1('0x19')](function(_0x4c2364){logger[_0x2ff1('0x14')](_0x2ff1('0x49'),_0x4c2364);throw _0x4c2364;});}return _0x12a512;})[_0x2ff1('0x27')](respondWithResult(_0x28491b,0xc9))[_0x2ff1('0x19')](handleError(_0x28491b,null));};exports[_0x2ff1('0x22')]=function(_0x484c69,_0x430e3a){if(_0x484c69[_0x2ff1('0x4a')]['id']){delete _0x484c69[_0x2ff1('0x4a')]['id'];}return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x484c69[_0x2ff1('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x2ff1('0x4c')}]})[_0x2ff1('0x27')](handleEntityNotFound(_0x430e3a,null))[_0x2ff1('0x27')](saveUpdates(_0x484c69[_0x2ff1('0x4a')],null))[_0x2ff1('0x27')](respondWithResult(_0x430e3a,null))[_0x2ff1('0x19')](handleError(_0x430e3a,null));};exports['destroy']=function(_0x52c7a5,_0x4bc0d5){return db[_0x2ff1('0x2e')]['find']({'where':{'id':_0x52c7a5[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x4bc0d5,null))[_0x2ff1('0x27')](removeEntity(_0x4bc0d5,null))['catch'](handleError(_0x4bc0d5,null));};exports['describe']=function(_0x10970d,_0xc8bdde){return db[_0x2ff1('0x2e')][_0x2ff1('0x4d')]()[_0x2ff1('0x27')](respondWithResult(_0xc8bdde,null))['catch'](handleError(_0xc8bdde,null));};exports[_0x2ff1('0x4e')]=function(_0x2ecf54,_0x30cf30){if(_0x2ecf54['body']['id']){delete _0x2ecf54['body']['id'];}return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x2ecf54[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x30cf30,null))[_0x2ff1('0x27')](function(_0x227462){if(_0x227462){_0x2ecf54[_0x2ff1('0x4a')]['ChatWebsiteId']=_0x227462['id'];return db[_0x2ff1('0x4f')][_0x2ff1('0x44')](_0x2ecf54[_0x2ff1('0x4a')]);}})[_0x2ff1('0x27')](respondWithResult(_0x30cf30,null))['catch'](handleError(_0x30cf30,null));};exports[_0x2ff1('0x50')]=function(_0x397a54,_0x2552b8){var _0x1acdc1={'raw':![],'where':{}};var _0x49ddd9={};var _0x54c701={'count':0x0,'rows':[]};return db[_0x2ff1('0x2e')][_0x2ff1('0x51')]({'where':{'id':_0x397a54[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x2552b8,null))[_0x2ff1('0x27')](function(_0x200e27){if(_0x200e27){_0x49ddd9[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x4f')][_0x2ff1('0x2f')]);_0x49ddd9[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x397a54[_0x2ff1('0x31')]);_0x49ddd9[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x49ddd9[_0x2ff1('0x33')],_0x49ddd9[_0x2ff1('0x31')]);_0x1acdc1['attributes']=_[_0x2ff1('0x42')](_0x49ddd9[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x1acdc1[_0x2ff1('0x32')]=_0x1acdc1['attributes'][_0x2ff1('0x35')]?_0x1acdc1['attributes']:_0x49ddd9[_0x2ff1('0x33')];if(!_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x1acdc1[_0x2ff1('0x1c')]=qs['limit'](_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x1acdc1[_0x2ff1('0x1b')]=qs['offset'](_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}_0x1acdc1[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x397a54[_0x2ff1('0x31')]['sort']);_0x1acdc1[_0x2ff1('0x3a')]=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0x397a54[_0x2ff1('0x31')],_0x49ddd9[_0x2ff1('0x38')]));_0x1acdc1[_0x2ff1('0x3a')][_0x2ff1('0x55')]=_0x200e27['id'];if(_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x39')]){_0x1acdc1[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x1acdc1['where'],{'$or':_[_0x2ff1('0x2d')](_0x1acdc1[_0x2ff1('0x32')],function(_0x37802e){var _0x11f346={};_0x11f346[_0x37802e]={'$like':'%'+_0x397a54['query'][_0x2ff1('0x39')]+'%'};return _0x11f346;})});}_0x1acdc1=_[_0x2ff1('0x3b')]({},_0x1acdc1,_0x397a54[_0x2ff1('0x3c')]);return db[_0x2ff1('0x4f')]['count']({'where':_0x1acdc1['where']})[_0x2ff1('0x27')](function(_0x2cba05){_0x54c701[_0x2ff1('0x1e')]=_0x2cba05;if(_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x1acdc1[_0x2ff1('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x2ff1('0x3f')](_0x1acdc1);})[_0x2ff1('0x27')](function(_0x2662f6){_0x54c701[_0x2ff1('0x56')]=_0x2662f6;return _0x54c701;});}})[_0x2ff1('0x27')](respondWithFilteredResult(_0x2552b8,_0x1acdc1))[_0x2ff1('0x19')](handleError(_0x2552b8,null));};exports[_0x2ff1('0x57')]=function(_0xc64060,_0xafe319){return db[_0x2ff1('0x2e')]['find']({'where':{'id':_0xc64060[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0xafe319,null))['then'](function(_0x54a89f){if(_0x54a89f){return _0x54a89f[_0x2ff1('0x57')](_0xc64060['query'][_0x2ff1('0x58')]);}})[_0x2ff1('0x27')](respondWithStatusCode(_0xafe319,null))[_0x2ff1('0x19')](handleError(_0xafe319,null));};exports[_0x2ff1('0x59')]=function(_0x239fb3,_0x85a3c3){if(_0x239fb3['body']['id']){delete _0x239fb3[_0x2ff1('0x4a')]['id'];}return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x239fb3[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x85a3c3,null))[_0x2ff1('0x27')](function(_0x1312df){if(_0x1312df){_0x239fb3[_0x2ff1('0x4a')][_0x2ff1('0x55')]=_0x1312df['id'];return db['CannedAnswer']['create'](_0x239fb3[_0x2ff1('0x4a')]);}})[_0x2ff1('0x27')](respondWithResult(_0x85a3c3,null))['catch'](handleError(_0x85a3c3,null));};exports[_0x2ff1('0x5a')]=function(_0xbe8188,_0x41396a){var _0x3dd5eb={'raw':![],'where':{}};var _0x37ca3a={};var _0x47133a={'count':0x0,'rows':[]};return db[_0x2ff1('0x2e')][_0x2ff1('0x51')]({'where':{'id':_0xbe8188[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41396a,null))['then'](function(_0x385c11){if(_0x385c11){_0x37ca3a[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x5b')][_0x2ff1('0x2f')]);_0x37ca3a[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0xbe8188[_0x2ff1('0x31')]);_0x37ca3a[_0x2ff1('0x38')]=_['intersection'](_0x37ca3a['model'],_0x37ca3a[_0x2ff1('0x31')]);_0x3dd5eb[_0x2ff1('0x32')]=_['intersection'](_0x37ca3a[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x3dd5eb[_0x2ff1('0x32')]=_0x3dd5eb['attributes'][_0x2ff1('0x35')]?_0x3dd5eb['attributes']:_0x37ca3a['model'];if(!_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x3dd5eb[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0xbe8188['query'][_0x2ff1('0x1c')]);_0x3dd5eb['offset']=qs[_0x2ff1('0x1b')](_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}_0x3dd5eb[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x36')]);_0x3dd5eb['where']=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0xbe8188[_0x2ff1('0x31')],_0x37ca3a[_0x2ff1('0x38')]));_0x3dd5eb[_0x2ff1('0x3a')][_0x2ff1('0x55')]=_0x385c11['id'];if(_0xbe8188['query'][_0x2ff1('0x39')]){_0x3dd5eb[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x3dd5eb[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x3dd5eb[_0x2ff1('0x32')],function(_0x34c0af){var _0x5ee22d={};_0x5ee22d[_0x34c0af]={'$like':'%'+_0xbe8188['query'][_0x2ff1('0x39')]+'%'};return _0x5ee22d;})});}_0x3dd5eb=_['merge']({},_0x3dd5eb,_0xbe8188[_0x2ff1('0x3c')]);return db[_0x2ff1('0x5b')][_0x2ff1('0x1e')]({'where':_0x3dd5eb['where']})[_0x2ff1('0x27')](function(_0x1b653c){_0x47133a['count']=_0x1b653c;if(_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x3dd5eb[_0x2ff1('0x3e')]=[{'all':!![]}];}return db[_0x2ff1('0x5b')][_0x2ff1('0x3f')](_0x3dd5eb);})[_0x2ff1('0x27')](function(_0x24647e){_0x47133a[_0x2ff1('0x56')]=_0x24647e;return _0x47133a;});}})['then'](respondWithFilteredResult(_0x41396a,_0x3dd5eb))[_0x2ff1('0x19')](handleError(_0x41396a,null));};exports[_0x2ff1('0x5c')]=function(_0x4e62ec,_0x42f9bc){return db[_0x2ff1('0x2e')]['find']({'where':{'id':_0x4e62ec[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x42f9bc,null))['then'](function(_0x3bdbbc){if(_0x3bdbbc){return _0x3bdbbc['removeAnswers'](_0x4e62ec['query'][_0x2ff1('0x58')]);}})[_0x2ff1('0x27')](respondWithStatusCode(_0x42f9bc,null))['catch'](handleError(_0x42f9bc,null));};exports[_0x2ff1('0x5d')]=function(_0x31e1f0,_0x4596d5){_0x31e1f0[_0x2ff1('0x4a')]['sitepic']=_0x31e1f0['file'][_0x2ff1('0x5e')];return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x31e1f0[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4596d5,null))[_0x2ff1('0x27')](saveUpdates(_0x31e1f0[_0x2ff1('0x4a')],null))['then'](respondWithResult(_0x4596d5,null))['catch'](handleError(_0x4596d5,null));};exports[_0x2ff1('0x5f')]=function(_0x5e2bcf,_0x1dc8ec){_0x5e2bcf['body'][_0x2ff1('0x60')]=_0x5e2bcf[_0x2ff1('0x61')][_0x2ff1('0x5e')];return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x5e2bcf[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x1dc8ec,null))[_0x2ff1('0x27')](saveUpdates(_0x5e2bcf[_0x2ff1('0x4a')],null))[_0x2ff1('0x27')](respondWithResult(_0x1dc8ec,null))[_0x2ff1('0x19')](handleError(_0x1dc8ec,null));};exports[_0x2ff1('0x62')]=function(_0x2e0d80,_0x508232){_0x2e0d80[_0x2ff1('0x4a')][_0x2ff1('0x63')]=_0x2e0d80[_0x2ff1('0x61')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2e0d80[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x508232,null))[_0x2ff1('0x27')](saveUpdates(_0x2e0d80['body'],null))[_0x2ff1('0x27')](respondWithResult(_0x508232,null))[_0x2ff1('0x19')](handleError(_0x508232,null));};exports['addSystemAvatar']=function(_0x211ec7,_0x27192f){_0x211ec7['body'][_0x2ff1('0x64')]=_0x211ec7['file'][_0x2ff1('0x5e')];return db['ChatWebsite']['find']({'where':{'id':_0x211ec7[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x27192f,null))['then'](saveUpdates(_0x211ec7[_0x2ff1('0x4a')],null))[_0x2ff1('0x27')](respondWithResult(_0x27192f,null))[_0x2ff1('0x19')](handleError(_0x27192f,null));};exports[_0x2ff1('0x65')]=function(_0x1f1094,_0x97bfc8){var _0xb20b6c=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x68'));var _0x483851={'where':{'id':_0x1f1094[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x69')],'raw':!![]};var _0x261e5e=![];return require(_0x2ff1('0x6a'))[_0x2ff1('0x6b')]()[_0x2ff1('0x27')](function(_0x5d8325){if(_0x5d8325){_0x261e5e=_0x5d8325[_0x2ff1('0x6c')];}})[_0x2ff1('0x27')](function(){return db[_0x2ff1('0x2e')]['find'](_0x483851);})['then'](handleEntityNotFound(_0x97bfc8,null))[_0x2ff1('0x27')](function(_0x3a0b0a){if(_0x3a0b0a){if(!_[_0x2ff1('0x6d')](_0x3a0b0a['sitepic'])){if(fs['existsSync'](path[_0x2ff1('0x66')](config['root'],_0x2ff1('0x6e'),_0x3a0b0a[_0x2ff1('0x69')]))&&_0x261e5e){_0xb20b6c=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x6e'),_0x3a0b0a[_0x2ff1('0x69')]);}}return _0x97bfc8['download'](_0xb20b6c);}})[_0x2ff1('0x19')](handleError(_0x97bfc8,null));};exports[_0x2ff1('0x6f')]=function(_0x1ca9b1,_0x1f6ccd){var _0x43866d=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x70'));var _0x1ab94f={'where':{'id':_0x1ca9b1[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x60')],'raw':!![]};return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x1ab94f)[_0x2ff1('0x27')](handleEntityNotFound(_0x1f6ccd,null))[_0x2ff1('0x27')](function(_0x4366ec){if(_0x4366ec){if(!_[_0x2ff1('0x6d')](_0x4366ec['agentAvatar'])){if(fs[_0x2ff1('0x71')](path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x4366ec['agentAvatar']))){_0x43866d=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x4366ec[_0x2ff1('0x60')]);}}return _0x1f6ccd[_0x2ff1('0x73')](_0x43866d);}})[_0x2ff1('0x19')](handleError(_0x1f6ccd,null));};exports['getCustomerAvatar']=function(_0x294c25,_0x33e5ba){var _0x322fbd=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x74'));var _0x1c5016={'where':{'id':_0x294c25[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x63'),'showCustomerAvatar'],'raw':!![]};return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x1c5016)[_0x2ff1('0x27')](handleEntityNotFound(_0x33e5ba,null))[_0x2ff1('0x27')](function(_0x2f8a05){if(_0x2f8a05){if(!_[_0x2ff1('0x6d')](_0x2f8a05[_0x2ff1('0x63')])){if(fs[_0x2ff1('0x71')](path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x2f8a05[_0x2ff1('0x63')]))&&_0x2f8a05['showCustomerAvatar']){_0x322fbd=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x2f8a05[_0x2ff1('0x63')]);}}return _0x33e5ba[_0x2ff1('0x73')](_0x322fbd);}})[_0x2ff1('0x19')](handleError(_0x33e5ba,null));};exports['getSystemAvatar']=function(_0x370946,_0xc0f4f9){var _0x145199=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x75'));var _0x2ee3db={'where':{'id':_0x370946[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x64')],'raw':!![]};return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x2ee3db)[_0x2ff1('0x27')](handleEntityNotFound(_0xc0f4f9,null))['then'](function(_0x552ac6){if(_0x552ac6){if(!_[_0x2ff1('0x6d')](_0x552ac6['systemAvatar'])){if(fs[_0x2ff1('0x71')](path[_0x2ff1('0x66')](config['root'],_0x2ff1('0x72'),_0x552ac6['systemAvatar']))){_0x145199=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x552ac6[_0x2ff1('0x64')]);}}return _0xc0f4f9[_0x2ff1('0x73')](_0x145199);}})[_0x2ff1('0x19')](handleError(_0xc0f4f9,null));};exports[_0x2ff1('0x76')]=function(_0x7968e7,_0x2241b8){var _0x289f27=require(_0x2ff1('0x77'));var _0x601964=new _0x289f27();var _0x4846e2=_0x601964[_0x2ff1('0x78')](_0x7968e7[_0x2ff1('0x79')]['user-agent'])[_0x2ff1('0x7a')]();var _0x3f948f={'body':_0x7968e7[_0x2ff1('0x4a')],'channel':_0x2ff1('0x7b')};var _0x4b3d91=[];var _0x1dc61d=[];var _0x278e4a={};var _0x2d2067=![];return db[_0x2ff1('0x7c')][_0x2ff1('0x4d')]()['then'](function(_0x32ea2e){if(!_0x32ea2e){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))](_0x2ff1('0x7f'));}_0x4b3d91=_[_0x2ff1('0x80')](_[_0x2ff1('0x41')](_0x32ea2e),[_0x2ff1('0x81'),_0x2ff1('0x82')]);_0x1dc61d=_[_0x2ff1('0x80')](_['keys'](_0x32ea2e),[_0x2ff1('0x81'),'updatedAt',_0x2ff1('0x83'),_0x2ff1('0x84')]);if(_0x7968e7['body']['id']){delete _0x7968e7[_0x2ff1('0x4a')]['id'];}if(_[_0x2ff1('0x6d')](_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x85')])){throw new db[(_0x2ff1('0x7d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x2ff1('0x6d')](_0x7968e7[_0x2ff1('0x4a')]['body'])||_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x4a')]===''){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2ff1('0x6d')](_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x86')])){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dc61d);}if(!_[_0x2ff1('0x87')](_0x1dc61d,_0x7968e7[_0x2ff1('0x4a')]['mapKey'])){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dc61d);}_0x278e4a[_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x86')]]=_0x7968e7[_0x2ff1('0x4a')]['from'];})[_0x2ff1('0x27')](function(){return db['ChatWebsite'][_0x2ff1('0x43')]({'where':{'id':_0x7968e7[_0x2ff1('0x4b')]['id']},'include':[{'model':db[_0x2ff1('0x88')],'as':_0x2ff1('0x89'),'include':[{'model':db[_0x2ff1('0x7c')],'as':_0x2ff1('0x8a'),'where':_0x278e4a,'limit':0x1,'order':[[_0x2ff1('0x82'),_0x2ff1('0x8b')]]}]},{'model':db[_0x2ff1('0x8c')],'as':_0x2ff1('0x8d')}]});})[_0x2ff1('0x27')](handleEntityNotFound(_0x2241b8,null))[_0x2ff1('0x27')](function(_0xdc181e){if(_0xdc181e&&_0xdc181e[_0x2ff1('0x89')]){_0x3f948f[_0x2ff1('0x8e')]=_0xdc181e;_0x3f948f[_0x2ff1('0x8f')]=_0xdc181e[_0x2ff1('0x8d')];_0x3f948f[_0x2ff1('0x90')]=_0xdc181e['List'];_0x3f948f[_0x2ff1('0x8f')]=_['orderBy'](_0x3f948f[_0x2ff1('0x8f')],[_0x2ff1('0x91')],['asc']);if(_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x8d')]){delete _0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x8d')];}if(_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x89')]&&_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x89')][_0x2ff1('0x8a')][_0x2ff1('0x35')]){return _0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x89')][_0x2ff1('0x8a')][0x0];}var _0x1ff4e8=_['defaults'](_0x7968e7[_0x2ff1('0x4a')],{'firstName':_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x85')],'ListId':_0xdc181e['ListId']});_0x1ff4e8[_0x7968e7['body'][_0x2ff1('0x86')]]=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x85')];return db[_0x2ff1('0x7c')]['create'](_0x1ff4e8,{'fields':_0x4b3d91,'raw':!![]});}})[_0x2ff1('0x27')](handleEntityNotFound(_0x2241b8,null))[_0x2ff1('0x27')](function(_0x2c9a00){_0x3f948f[_0x2ff1('0x92')]=_0x2c9a00;var _0x312d65=_0x7968e7['body'][_0x2ff1('0x93')];if(_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x94')]){_0x312d65=_0x7968e7[_0x2ff1('0x79')]['cf-connecting-ip'];}else if(_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x95')]){_0x312d65=_[_0x2ff1('0x96')](_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x95')][_0x2ff1('0x97')](','));}if(_0x2c9a00){var _0x4dcc46={'ContactId':_0x2c9a00['id'],'ChatWebsiteId':_0x7968e7[_0x2ff1('0x4b')]['id'],'from':(_0x2c9a00[_0x2ff1('0x98')]||'')+'\x20'+(_0x2c9a00[_0x2ff1('0x99')]||''),'customerIp':_0x312d65,'customerPort':_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x9a')]?_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x9a')]:null,'referer':_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x9b')],'browserName':_0x4846e2['browser'][_0x2ff1('0x29')]&&_0x4846e2['browser'][_0x2ff1('0x9c')]?util['format'](_0x2ff1('0x9d'),_0x4846e2[_0x2ff1('0x9e')][_0x2ff1('0x29')],_0x4846e2[_0x2ff1('0x9e')][_0x2ff1('0x9c')]):'unknown','browserVersion':_0x4846e2[_0x2ff1('0x9e')][_0x2ff1('0x9c')]||_0x2ff1('0x9f'),'osName':util[_0x2ff1('0xa0')](_0x2ff1('0x9d'),_0x4846e2['os'][_0x2ff1('0x29')],_0x4846e2['os'][_0x2ff1('0x9c')]),'osVersion':_0x4846e2['os'][_0x2ff1('0x9c')],'deviceModel':_0x4846e2[_0x2ff1('0xa1')][_0x2ff1('0x33')]&&_0x4846e2['device'][_0x2ff1('0xa2')]?util[_0x2ff1('0xa0')](_0x2ff1('0xa3'),_0x4846e2[_0x2ff1('0xa1')][_0x2ff1('0x33')],_0x4846e2[_0x2ff1('0xa1')][_0x2ff1('0xa2')],_0x4846e2['device'][_0x2ff1('0x30')]):null,'deviceVendor':_0x4846e2['device'][_0x2ff1('0xa2')],'deviceType':_0x4846e2[_0x2ff1('0xa1')]['type'],'formData':JSON[_0x2ff1('0xa4')](_0x7968e7[_0x2ff1('0x4a')])};var _0x5396e9={'ChatWebsiteId':_0x7968e7['params']['id'],'closed':![]};if(_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa5')]){_0x5396e9[_0x2ff1('0xa5')]=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa5')];return db['ChatInteraction'][_0x2ff1('0x43')]({'where':_0x5396e9})[_0x2ff1('0x27')](function(_0xee8850){if(_0xee8850){return[_0xee8850,![]];}_0x4dcc46['threadId']=_0x7968e7['body']['threadId'];_0x4dcc46['externalUrl']=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa6')];return db[_0x2ff1('0xa7')][_0x2ff1('0x44')](_0x4dcc46)[_0x2ff1('0x27')](function(_0xca340f){return[_0xca340f,!![]];});});}_0x5396e9['ContactId']=_0x2c9a00['id'];if(_0x7968e7[_0x2ff1('0x4a')]['interaction']&&_0x7968e7['body']['interaction']['id']){_0x5396e9['id']=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa8')]['id'];return db[_0x2ff1('0xa7')][_0x2ff1('0x43')]({'where':_0x5396e9})[_0x2ff1('0x27')](function(_0x24079b){if(_0x24079b){return[_0x24079b,![]];}return db['ChatInteraction'][_0x2ff1('0x44')](_0x4dcc46)[_0x2ff1('0x27')](function(_0x1f53da){return[_0x1f53da,!![]];});});}return db[_0x2ff1('0xa7')][_0x2ff1('0x44')](_0x4dcc46)['then'](function(_0x5a77e1){return[_0x5a77e1,!![]];});}})[_0x2ff1('0xa9')](function(_0x4b4fd6,_0x2c035a){if(_0x4b4fd6){_0x2d2067=_0x2c035a;if(!_0x2c035a){var _0x3a7521={'from':(_0x3f948f[_0x2ff1('0x92')][_0x2ff1('0x98')]||'')+'\x20'+(_0x3f948f[_0x2ff1('0x92')][_0x2ff1('0x99')]||'')};if(_0x7968e7[_0x2ff1('0x4a')]['threadId']&&_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xaa')]&&_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa5')]!=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xaa')]){_0x3a7521[_0x2ff1('0xa5')]=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xaa')];}return _0x4b4fd6['update'](_0x3a7521);}else{return _0x4b4fd6;}}})[_0x2ff1('0x27')](function(_0x1d59b7){_0x3f948f[_0x2ff1('0xa8')]=_0x1d59b7[_0x2ff1('0x23')]({'plain':!![]});_0x3f948f['interaction'][_0x2ff1('0xab')]=_0x2d2067;if(_0x3f948f[_0x2ff1('0xa8')][_0x2ff1('0xab')]){if(_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0xac')]){_0x3f948f[_0x2ff1('0x8f')][_0x2ff1('0xad')]({'id':0x0,'priority':_0x3f948f[_0x2ff1('0x8f')][_0x2ff1('0x35')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x2ff1('0xae')});}}return db[_0x2ff1('0xaf')][_0x2ff1('0x44')]({'body':_0x7968e7[_0x2ff1('0x4a')]['body'],'ChatWebsiteId':_0x7968e7[_0x2ff1('0x4b')]['id'],'ChatInteractionId':_0x1d59b7['id'],'direction':'in','ContactId':_0x3f948f[_0x2ff1('0x92')]['id'],'AttachmentId':_0x7968e7[_0x2ff1('0x4a')]['AttachmentId']});})['then'](function(_0x5cd7c5){_0x3f948f[_0x2ff1('0x17')]=_0x5cd7c5;if(_0x3f948f[_0x2ff1('0xa8')][_0x2ff1('0xb0')]){return db[_0x2ff1('0xb1')]['find']({'attributes':['id',_0x2ff1('0x29')],'where':{'id':_0x3f948f[_0x2ff1('0xa8')][_0x2ff1('0xb0')]}})[_0x2ff1('0x27')](function(_0x29fa3f){if(_0x29fa3f){_0x3f948f['applications'][_0x2ff1('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x29fa3f[_0x2ff1('0x29')]+','+(_0x3f948f['account'][_0x2ff1('0xb3')]||0xa),'interval':'*,*,*,*'});_0x3f948f[_0x2ff1('0xb4')]=!![];}return respondWithRpcPromise(_0x2ff1('0xb5'),_0x2ff1('0xb6'),_0x3f948f);});}return respondWithRpcPromise(_0x2ff1('0xb5'),_0x2ff1('0xb6'),_0x3f948f);})[_0x2ff1('0x27')](function(_0x52aed6){respondWithRpcPromise(_0x2ff1('0xb7'),_0x2ff1('0xb7'),{'event':_0x2ff1('0x76'),'message':_0x52aed6},client9002);return _0x52aed6;})['then'](respondWithResult(_0x2241b8,null))[_0x2ff1('0x19')](handleError(_0x2241b8,null));};exports[_0x2ff1('0xb8')]=function(_0x3c62c0,_0x5b6518){var _0x3817eb,_0x5a9f24,_0x384e4c;var _0x298d1f=[];var _0x4b9a1a={};var _0x4fdfbd=_0x3c62c0[_0x2ff1('0xb9')]||[];var _0x3e3d2a=[];var _0x2db80e;return db['CmContact'][_0x2ff1('0x4d')]()['then'](function(_0x5241e8){if(!_0x5241e8){throw new db['Sequelize'][(_0x2ff1('0x7e'))]('no\x20available\x20attributes');}_0x298d1f=_[_0x2ff1('0x80')](_[_0x2ff1('0x41')](_0x5241e8),[_0x2ff1('0x81'),_0x2ff1('0x82'),_0x2ff1('0x83'),'ListId']);if(_0x3c62c0[_0x2ff1('0x4a')]['id']){delete _0x3c62c0[_0x2ff1('0x4a')]['id'];}if(_['isNil'](_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')])){throw _0x5b6518['status'](0x1f4)[_0x2ff1('0x2a')](new db[(_0x2ff1('0x7d'))]['ValidationError'](_0x2ff1('0xba')));}if(_[_0x2ff1('0x6d')](_0x3c62c0['body'][_0x2ff1('0x4a')])||_0x3c62c0['body']['body']===''){throw _0x5b6518[_0x2ff1('0x1a')](0x1f4)[_0x2ff1('0x2a')](new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))](_0x2ff1('0xbb')));}if(_['isNil'](_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0xbc')])){throw _0x5b6518[_0x2ff1('0x1a')](0x1f4)['send'](new db['Sequelize'][(_0x2ff1('0x7e'))](_0x2ff1('0xbd')+_0x298d1f));}if(!_[_0x2ff1('0x87')](_0x298d1f,_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0xbc')])){throw _0x5b6518[_0x2ff1('0x1a')](0x1f4)['send'](new db[(_0x2ff1('0x7d'))]['ValidationError'](_0x2ff1('0xbe')+_0x298d1f));}_0x4b9a1a[_0x3c62c0['body'][_0x2ff1('0xbc')]]=_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')];})[_0x2ff1('0x27')](function(){return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x3c62c0[_0x2ff1('0x4b')]['id']},'include':[{'model':db[_0x2ff1('0x88')],'as':_0x2ff1('0x89')},{'model':db[_0x2ff1('0xbf')],'as':_0x2ff1('0xbf')}]});})['then'](handleEntityNotFound(_0x5b6518,null))[_0x2ff1('0x27')](function(_0xe89be0){if(_0xe89be0&&_0xe89be0[_0x2ff1('0x89')]){_0x5a9f24=_0xe89be0;var _0x5a8ba8=_[_0x2ff1('0x8')](_0x3c62c0[_0x2ff1('0x4a')],{'firstName':_0x3c62c0['body'][_0x2ff1('0x85')],'phone':_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')],'ListId':_0xe89be0[_0x2ff1('0x84')]});_0x5a8ba8[_0x3c62c0['body']['mapKeyOffline']]=_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')];return db['CmContact']['findOrCreate']({'where':_0x4b9a1a,'defaults':_0x5a8ba8});}})['spread'](function(_0x42a743){if(_0x42a743){_0x384e4c=_0x42a743;var _0x1d3323=fs[_0x2ff1('0xc0')](path['join'](config[_0x2ff1('0x67')],_0x2ff1('0xc1')),_0x2ff1('0xc2'));var _0x555b27=ejs[_0x2ff1('0xc3')](_0x1d3323,{'body':_[_0x2ff1('0xc4')](_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x4a')]),'bodyTitle':_0x5a9f24['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2ff1('0x44')]({'body':_0x555b27,'ContactId':_0x42a743['id'],'ChatWebsiteId':_0x5a9f24['id']});}})[_0x2ff1('0x27')](function(_0x4ae16b){_0x2db80e=_0x4ae16b;if(_0x4fdfbd[_0x2ff1('0x35')]){var _0x61dc07=_0x4fdfbd['map'](function(_0x32a488){return{'name':_0x32a488[_0x2ff1('0xc5')],'basename':_0x32a488[_0x2ff1('0x5e')],'type':_0x32a488[_0x2ff1('0xc6')],'ChatOfflineMessageId':_0x4ae16b['id']};});_0x3e3d2a=_0x61dc07['map'](_0xf0ea91=>{var _0x3d31cd={'filename':_0xf0ea91[_0x2ff1('0x29')],'path':path['join'](config[_0x2ff1('0x67')],_0x2ff1('0xc7'),_0x2ff1('0xb9'),_0x2ff1('0xc8'),_0x2ff1('0xc9'),_0xf0ea91[_0x2ff1('0xca')])};return _0x3d31cd;});if(!_0x5a9f24[_0x2ff1('0xcb')]){return db['sequelize']['transaction'](function(_0x18c940){return db['Attachment'][_0x2ff1('0xcc')](_0x61dc07,{'transaction':_0x18c940});});}}})['then'](function(){if(_0x2db80e){_0x3817eb=_0x2db80e;return db[_0x2ff1('0xbf')][_0x2ff1('0x51')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2ff1('0xcd'),'raw':!![]}]});}})['then'](function(_0x14bb2b){if(_0x14bb2b&&_0x14bb2b[_0x2ff1('0xcd')]&&_0x5a9f24['forwardOffline']&&_0x5a9f24['forwardOfflineAddress']){var _0xb35cd4={'tls':{'rejectUnauthorized':![]}};if(_0x14bb2b[_0x2ff1('0xcd')]['service']){_0xb35cd4['service']=_0x14bb2b[_0x2ff1('0xcd')]['service'];}else{_0xb35cd4['host']=_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0xce')];_0xb35cd4[_0x2ff1('0xcf')]=_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0xcf')];_0xb35cd4['secure']=_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0xd0')];}if(_0x14bb2b[_0x2ff1('0xcd')]['authentication']){_0xb35cd4[_0x2ff1('0xd1')]={'user':_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0x45')],'pass':_0x14bb2b['Smtp'][_0x2ff1('0xd2')]};}return respondWithRpcPromise('SendMail',_0x2ff1('0xd3'),{'account':_0xb35cd4,'message':{'from':util[_0x2ff1('0xa0')](_0x2ff1('0xd4'),_0x14bb2b[_0x2ff1('0x29')],_0x14bb2b['email']||_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0x45')]),'to':_0x5a9f24[_0x2ff1('0xd5')],'subject':_0x5a9f24[_0x2ff1('0xd6')],'html':_0x3817eb[_0x2ff1('0x4a')],'attachments':_0x3e3d2a}},client9003)[_0x2ff1('0x27')](function(){return _0x3817eb;})[_0x2ff1('0x19')](function(_0x382f52){console[_0x2ff1('0x14')](_0x382f52);});}})[_0x2ff1('0x27')](function(){if(_0x5a9f24&&_0x5a9f24[_0x2ff1('0xcb')]&&_0x5a9f24[_0x2ff1('0xd7')]){var _0x1cc3b2=[];if(_0x4fdfbd['length']){_0x1cc3b2=_0x4fdfbd[_0x2ff1('0x2d')](function(_0x5c3e40){return{'name':_0x5c3e40[_0x2ff1('0xc5')],'basename':_0x5c3e40['filename'],'type':_0x5c3e40[_0x2ff1('0xc6')],'ChatOfflineMessageId':_0x2db80e['id']};});}var _0x304a16;if(!_['isNil'](_0x5a9f24['subjectOffline'])){var _0x296f57=_[_0x2ff1('0x2d')](_0x3c62c0[_0x2ff1('0x4a')],function(_0x471663){return _0x471663;});var _0x2d0614=_[_0x2ff1('0xd8')](_0x296f57)[0x0];var _0x570805=_[_0x2ff1('0xd9')](_0x2d0614,function(_0x202f72){return _0x202f72;});_0x304a16=_0x570805[0x1][_0x5a9f24[_0x2ff1('0xda')]];}var _0x5ec63f={'from':_0x384e4c['email'],'firstName':_0x384e4c[_0x2ff1('0x98')],'lastName':_0x384e4c[_0x2ff1('0x99')],'mapKey':_0x2ff1('0xdb'),'message':{'from':_0x384e4c[_0x2ff1('0xdb')],'to':_0x5a9f24['MailAccount'][_0x2ff1('0xdb')],'cc':'','subject':_['isNil'](_0x304a16)?_0x5a9f24[_0x2ff1('0xd6')]:_0x304a16,'messageId':'','sentAt':new Date(),'attach':_0x1cc3b2[_0x2ff1('0x35')],'attachments':_0x1cc3b2,'originChannel':_0x2ff1('0xdc'),'ChatWebsiteId':_0x5a9f24['id'],'ChatOfflineMessageId':_0x3817eb['id'],'originTo':_0x5a9f24[_0x2ff1('0xbf')]['email']},'body':_0x3817eb[_0x2ff1('0x4a')]};var _0x202552={'account':{'id':_0x5a9f24[_0x2ff1('0xd7')]},'body':_0x5ec63f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x2ff1('0xdd'),_0x2ff1('0xde'),_0x202552,client9001)['then'](function(){return _0x3817eb;})[_0x2ff1('0x19')](function(_0x4d3bce){console[_0x2ff1('0x14')](_0x4d3bce);});}return;})[_0x2ff1('0x27')](function(){if(_0x3817eb){return _0x3817eb;}})[_0x2ff1('0x27')](respondWithResult(_0x5b6518,null))[_0x2ff1('0x19')](function(_0x332133){console[_0x2ff1('0x14')](_0x2ff1('0x19'),_0x332133);for(var _0x40e306 of _0x4fdfbd){var _0x5a6a60=path[_0x2ff1('0x66')](config['root'],_0x2ff1('0xc7'),_0x2ff1('0xb9'),_0x2ff1('0xc8'),'offline-chat',_0x40e306['filename']);fs_extra[_0x2ff1('0xdf')](_0x5a6a60)[_0x2ff1('0x19')](function(_0x22cf24){console[_0x2ff1('0x14')](_0x2ff1('0xe0'),_0x5a6a60,_0x22cf24);});}});};exports['addInteraction']=function(_0x3a8931,_0x352426){return db['ChatInteraction'][_0x2ff1('0x43')]({'where':{'id':_0x3a8931['params']['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x352426,null))[_0x2ff1('0x27')](function(_0x45d1a9){if(_0x45d1a9){return _0x45d1a9[_0x2ff1('0xe1')](_0x3a8931[_0x2ff1('0x4a')][_0x2ff1('0x58')],_[_0x2ff1('0xe2')](_0x3a8931[_0x2ff1('0x4a')],['ids','id'])||{});}})[_0x2ff1('0x27')](respondWithResult(_0x352426,null))['catch'](handleError(_0x352426,null));};exports[_0x2ff1('0xe3')]=function(_0x14027d,_0x129cc3){var _0x40b5d2={'raw':![],'where':{}};var _0x282517={};var _0x1db306={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x14027d[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x129cc3,null))['then'](function(_0x3aee78){if(_0x3aee78){_0x282517[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0xa7')][_0x2ff1('0x2f')]);_0x282517['query']=_[_0x2ff1('0x41')](_0x14027d[_0x2ff1('0x31')]);_0x282517[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x282517[_0x2ff1('0x33')],_0x282517['query']);_0x40b5d2[_0x2ff1('0x32')]=_['intersection'](_0x282517['model'],qs[_0x2ff1('0x34')](_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x40b5d2[_0x2ff1('0x32')]=_0x40b5d2[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x40b5d2['attributes']:_0x282517[_0x2ff1('0x33')];if(!_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x40b5d2[_0x2ff1('0x1c')]=qs['limit'](_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x40b5d2[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x14027d[_0x2ff1('0x31')]['offset']);}_0x40b5d2[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x14027d['query'][_0x2ff1('0x36')]);_0x40b5d2['where']=qs['filters'](_[_0x2ff1('0x37')](_0x14027d['query'],_0x282517['filters']));_0x40b5d2[_0x2ff1('0x3a')][_0x2ff1('0x55')]=_0x3aee78['id'];if(_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x39')]){_0x40b5d2['where']=_[_0x2ff1('0x3b')](_0x40b5d2[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x40b5d2[_0x2ff1('0x32')],function(_0x494780){var _0x3f2f6c={};_0x3f2f6c[_0x494780]={'$like':'%'+_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0x3f2f6c;})});}_0x40b5d2=_['merge']({},_0x40b5d2,_0x14027d[_0x2ff1('0x3c')]);return db[_0x2ff1('0xa7')][_0x2ff1('0x1e')]({'where':_0x40b5d2['where']})[_0x2ff1('0x27')](function(_0xf4bc38){_0x1db306[_0x2ff1('0x1e')]=_0xf4bc38;if(_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x40b5d2['include']=[{'model':db[_0x2ff1('0x7c')],'as':_0x2ff1('0xe4'),'required':![]},{'model':db[_0x2ff1('0xb1')],'as':_0x2ff1('0xe5'),'attributes':[_0x2ff1('0x29'),_0x2ff1('0xe6'),'internal'],'required':![]},{'model':db[_0x2ff1('0xe7')],'as':'Tags','attributes':['id','name',_0x2ff1('0xe8')],'where':_0x14027d['query'][_0x2ff1('0xe9')]?{'id':_0x14027d[_0x2ff1('0x31')][_0x2ff1('0xe9')]}:undefined,'required':_0x14027d['query'][_0x2ff1('0xe9')]?!![]:![]}];}return db[_0x2ff1('0xa7')][_0x2ff1('0x3f')](_0x40b5d2);})[_0x2ff1('0x27')](function(_0x5f3136){_0x1db306['rows']=_0x5f3136;return _0x1db306;});}})['then'](respondWithFilteredResult(_0x129cc3,_0x40b5d2))['catch'](handleError(_0x129cc3,null));};function iftimePromise(_0x1c6d7c,_0x16dfa5){return respondWithRpcPromise('Command',_0x2ff1('0xea'),{'command':_0x16dfa5[_0x2ff1('0xeb')]?util[_0x2ff1('0xa0')]('iftime\x20%s,%s',_0x1c6d7c['interval'],_0x16dfa5['timezone']):util[_0x2ff1('0xa0')](_0x2ff1('0xec'),_0x1c6d7c[_0x2ff1('0xed')])},client9002)[_0x2ff1('0x27')](function(_0x60d2c0){var _0x14091b=_0x60d2c0&&_0x60d2c0[_0x2ff1('0xee')]('true')>=0x0?!![]:![];logger[_0x2ff1('0x11')](_0x2ff1('0xef'),_0x16dfa5['id'],_0x1c6d7c['id'],_0x1c6d7c[_0x2ff1('0xed')],_0x14091b?_0x2ff1('0xf0'):_0x2ff1('0xf1'),_0x16dfa5[_0x2ff1('0xeb')]?_0x16dfa5[_0x2ff1('0xeb')]:_0x2ff1('0xf2'));return _0x14091b;})[_0x2ff1('0x19')](function(_0x44549a){logger[_0x2ff1('0x14')](_0x2ff1('0xef'),_0x16dfa5['id'],_0x1c6d7c['id'],_0x1c6d7c['interval'],util['inspect'](_0x44549a,{'showHidden':![],'depth':null}),_0x16dfa5[_0x2ff1('0xeb')]?_0x16dfa5[_0x2ff1('0xeb')]:_0x2ff1('0xf2'));return![];});}exports[_0x2ff1('0xea')]=function(_0x20c406,_0x1461b7){var _0x1442a8=0x0;var _0x330693=0x0;var _0x4ec8b0=![];var _0x254efc;var _0x59c9aa;return db['ChatWebsite']['find']({'where':{'id':_0x20c406[_0x2ff1('0x4b')]['id']},'include':[{'model':db['Interval'],'as':_0x2ff1('0xf3'),'include':[{'model':db[_0x2ff1('0xf3')],'as':'Intervals','attributes':['id',_0x2ff1('0xed')],'raw':!![]}]}]})[_0x2ff1('0x27')](handleEntityNotFound(_0x1461b7,null))[_0x2ff1('0x27')](function(_0x4c8a29){if(_0x4c8a29){_0x254efc=_0x4c8a29;return _0x4c8a29[_0x2ff1('0xf4')]({'raw':!![]});}})[_0x2ff1('0x27')](function(_0x53e344){if(_0x254efc){if(_0x53e344){_0x59c9aa=_0x53e344;}}return require(_0x2ff1('0x6a'))[_0x2ff1('0x6b')]();})['then'](function(_0x1b0422){if(_0x1b0422){_0x330693=_0x1b0422[_0x2ff1('0xf5')];_0x4ec8b0=_0x1b0422['custom'];}})[_0x2ff1('0x27')](function(){return db[_0x2ff1('0xa7')]['count']({'where':{'closed':![]}});})['then'](function(_0x504480){_0x1442a8=_0x504480;if(_0x330693&&_0x504480>_0x330693){return db[_0x2ff1('0xf6')][_0x2ff1('0x51')]({'where':{'id':0x1}})[_0x2ff1('0x27')](function(_0x576aeb){if(_0x576aeb){_0x576aeb[_0x2ff1('0xf7')]('chatLicenseExceeded');}});}})[_0x2ff1('0x27')](function(){if(_0x254efc[_0x2ff1('0xf3')]&&_0x254efc[_0x2ff1('0xf3')][_0x2ff1('0xf8')]){var _0x2b5c7e=[];for(var _0x5e3ddb=0x0;_0x5e3ddb<_0x254efc[_0x2ff1('0xf3')][_0x2ff1('0xf8')][_0x2ff1('0x35')];_0x5e3ddb++){var _0x2a1062=_0x254efc[_0x2ff1('0xf3')][_0x2ff1('0xf8')][_0x5e3ddb][_0x2ff1('0x23')]({'plain':!![]});_0x2b5c7e[_0x2ff1('0xad')](iftimePromise(_0x2a1062,_0x254efc));}return BPromise[_0x2ff1('0xf9')](_0x2b5c7e)[_0x2ff1('0x27')](function(_0x2dfd1f){return _[_0x2ff1('0xfa')](_0x2dfd1f);});}else{return!![];}})['then'](function(_0x545e7c){var _0x90fba3=fs[_0x2ff1('0xc0')](path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],'server/files/chat/iframe.ejs'),_0x2ff1('0xc2'));var _0x4a3d89={'remote':_0x254efc[_0x2ff1('0xfb')],'query':querystring[_0x2ff1('0xa4')](_[_0x2ff1('0x3b')](_0x254efc[_0x2ff1('0x23')]({'plain':!![]}),{'customerIp':_0x20c406[_0x2ff1('0x79')][_0x2ff1('0x95')]||_0x20c406[_0x2ff1('0x79')]['x-real-ip']||_0x20c406[_0x2ff1('0xfc')]['remoteAddress']||_0x20c406['ip'],'referer':_0x20c406[_0x2ff1('0x79')]['referer'],'openedInteractions':_0x1442a8,'maxInteractions':_0x330693,'virtual':_0x4ec8b0[_0x2ff1('0xf5')],'online':_0x545e7c,'custom':_0x4ec8b0}))[_0x2ff1('0xfd')](/'/g,'\x5c\x27')};_0x1461b7['send'](ejs[_0x2ff1('0xc3')](Mustache[_0x2ff1('0xc3')](_0x90fba3,_0x4a3d89),{'proactiveActions':_0x59c9aa,'alignment':_0x254efc[_0x2ff1('0xfe')],'verticalAlignment':_0x254efc[_0x2ff1('0xff')],'div_color':_0x254efc['color'],'labelText':_0x254efc[_0x2ff1('0x100')],'text_color':_0x254efc['textColor'],'button_color':_0x254efc[_0x2ff1('0x101')],'background_color':_0x254efc[_0x2ff1('0x102')]}));})['catch'](handleError(_0x1461b7,null));};exports[_0x2ff1('0x103')]=function(_0x5db472,_0x34d08b){var _0x3307eb=_0x5db472[_0x2ff1('0x4b')]['id'];var _0x5bc44e=_0x5db472[_0x2ff1('0x4a')];var _0xf21af5=0xc8;var _0x2c5fd1=null;return db['sequelize'][_0x2ff1('0x104')]({'isolationLevel':db[_0x2ff1('0x105')]['Transaction'][_0x2ff1('0x106')][_0x2ff1('0x107')]},function(_0x5b9073){return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x3307eb},'transaction':_0x5b9073})['then'](function(_0x32512a){if(_0x32512a){return db['ChatApplication'][_0x2ff1('0x26')]({'where':{'ChatWebsiteId':_0x3307eb},'transaction':_0x5b9073})['then'](function(){var _0x29fb71=_[_0x2ff1('0x2d')](_0x5bc44e,function(_0x5c313e){_0x5c313e[_0x2ff1('0x55')]=_0x3307eb;return _0x5c313e;});return db[_0x2ff1('0x8c')][_0x2ff1('0xcc')](_0x29fb71,{'transaction':_0x5b9073});});}else{_0xf21af5=0x194;_0x2c5fd1=[];}});})[_0x2ff1('0x27')](function(){if(_0xf21af5!==0x194){return db[_0x2ff1('0x8c')][_0x2ff1('0x108')]({'where':{'ChatWebsiteId':_0x3307eb},'order':_0x2ff1('0x91')})['then'](function(_0x332d8c){_0x2c5fd1=_0x332d8c;});}})[_0x2ff1('0x19')](function(_0x543c41){_0xf21af5=0x1f4;logger['error'](_0x543c41[_0x2ff1('0x109')]);if(_0x543c41[_0x2ff1('0x29')]){delete _0x543c41['name'];}_0x2c5fd1=_0x543c41;})[_0x2ff1('0x10a')](function(){if(_0x2c5fd1===null){_0x34d08b[_0x2ff1('0x10b')](_0xf21af5);}else{if(_0xf21af5===0x1f4){_0x34d08b[_0x2ff1('0x1a')](_0xf21af5)[_0x2ff1('0x2a')](_0x2c5fd1);}else{_0x34d08b[_0x2ff1('0x1a')](_0xf21af5)[_0x2ff1('0x21')](_0x2c5fd1);}}});};exports[_0x2ff1('0x10c')]=function(_0x5834f6,_0x2859ca){var _0x416832={};var _0x26110e={};var _0x5f2b4b;var _0x359983;return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x5834f6['params']['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x2859ca,null))['then'](function(_0x471870){if(_0x471870){_0x5f2b4b=_0x471870;_0x26110e[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x8c')][_0x2ff1('0x2f')]);_0x26110e[_0x2ff1('0x31')]=_['keys'](_0x5834f6[_0x2ff1('0x31')]);_0x26110e['filters']=_['intersection'](_0x26110e['model'],_0x26110e['query']);_0x416832['attributes']=_['intersection'](_0x26110e[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x5834f6['query']['fields']));_0x416832[_0x2ff1('0x32')]=_0x416832[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x416832[_0x2ff1('0x32')]:_0x26110e[_0x2ff1('0x33')];_0x416832['order']=qs['sort'](_0x5834f6[_0x2ff1('0x31')]['sort']);_0x416832[_0x2ff1('0x3a')]=qs['filters'](_[_0x2ff1('0x37')](_0x5834f6[_0x2ff1('0x31')],_0x26110e[_0x2ff1('0x38')]));if(_0x5834f6['query']['filter']){_0x416832[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x416832[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x416832[_0x2ff1('0x32')],function(_0x18146a){var _0x2b428a={};_0x2b428a[_0x18146a]={'$like':'%'+_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0x2b428a;})});}_0x416832=_['merge']({},_0x416832,_0x5834f6[_0x2ff1('0x3c')]);return _0x5f2b4b[_0x2ff1('0x10c')](_0x416832);}})[_0x2ff1('0x27')](function(_0x1c87ee){if(_0x1c87ee){_0x359983=_0x1c87ee[_0x2ff1('0x35')];if(!_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x416832[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x416832['offset']=qs[_0x2ff1('0x1b')](_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}return _0x5f2b4b[_0x2ff1('0x10c')](_0x416832);}})[_0x2ff1('0x27')](function(_0xb5a105){if(_0xb5a105){return _0xb5a105?{'count':_0x359983,'rows':_0xb5a105}:null;}})['then'](respondWithResult(_0x2859ca,null))[_0x2ff1('0x19')](handleError(_0x2859ca,null));};exports[_0x2ff1('0x10d')]=function(_0x2422e0,_0x77737a){return db[_0x2ff1('0x10e')]['find']({'where':{'id':_0x2422e0[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x77737a,null))[_0x2ff1('0x27')](function(_0x338fb2){if(_0x338fb2){return _0x338fb2[_0x2ff1('0x10d')](_0x2422e0[_0x2ff1('0x4a')][_0x2ff1('0x58')],_[_0x2ff1('0xe2')](_0x2422e0[_0x2ff1('0x4a')],['ids','id'])||{});}})[_0x2ff1('0x27')](respondWithResult(_0x77737a,null))[_0x2ff1('0x19')](handleError(_0x77737a,null));};exports[_0x2ff1('0xf4')]=function(_0x6af13,_0x4bc0b7){var _0x554661={};var _0x2f6259={};var _0x2e35d9;var _0x54a73a;return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x6af13['params']['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x4bc0b7,null))[_0x2ff1('0x27')](function(_0x28d52a){if(_0x28d52a){_0x2e35d9=_0x28d52a;_0x2f6259[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db['ChatProactiveAction'][_0x2ff1('0x2f')]);_0x2f6259['query']=_[_0x2ff1('0x41')](_0x6af13['query']);_0x2f6259['filters']=_['intersection'](_0x2f6259[_0x2ff1('0x33')],_0x2f6259[_0x2ff1('0x31')]);_0x554661['attributes']=_[_0x2ff1('0x42')](_0x2f6259['model'],qs['fields'](_0x6af13[_0x2ff1('0x31')]['fields']));_0x554661[_0x2ff1('0x32')]=_0x554661[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x554661[_0x2ff1('0x32')]:_0x2f6259[_0x2ff1('0x33')];_0x554661[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x6af13['query'][_0x2ff1('0x36')]);_0x554661[_0x2ff1('0x3a')]=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0x6af13[_0x2ff1('0x31')],_0x2f6259[_0x2ff1('0x38')]));if(_0x6af13['query'][_0x2ff1('0x39')]){_0x554661[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x554661[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x554661[_0x2ff1('0x32')],function(_0x2fd065){var _0x5b5962={};_0x5b5962[_0x2fd065]={'$like':'%'+_0x6af13['query'][_0x2ff1('0x39')]+'%'};return _0x5b5962;})});}_0x554661=_[_0x2ff1('0x3b')]({},_0x554661,_0x6af13['options']);return _0x2e35d9[_0x2ff1('0xf4')](_0x554661);}})[_0x2ff1('0x27')](function(_0x3f1d38){if(_0x3f1d38){_0x54a73a=_0x3f1d38[_0x2ff1('0x35')];if(!_0x6af13[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x554661[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x6af13['query'][_0x2ff1('0x1c')]);_0x554661[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x6af13[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}return _0x2e35d9[_0x2ff1('0xf4')](_0x554661);}})[_0x2ff1('0x27')](function(_0x50cd42){if(_0x50cd42){return _0x50cd42?{'count':_0x54a73a,'rows':_0x50cd42}:null;}})[_0x2ff1('0x27')](respondWithResult(_0x4bc0b7,null))[_0x2ff1('0x19')](handleError(_0x4bc0b7,null));};exports[_0x2ff1('0x10f')]=function(_0x14acff,_0x77225e){var _0x1886e1=_0x14acff[_0x2ff1('0x31')]['online']===_0x2ff1('0x110')?_0x2ff1('0x111'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x1886e1],'where':{'id':_0x14acff[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x77225e,null))[_0x2ff1('0x27')](function(_0x30ba77){if(_0x30ba77){var _0x3e8095=_0x30ba77[_0x1886e1];var _0x244882=_0x3e8095&&_0x3e8095['items']?_0x3e8095[_0x2ff1('0x112')]:[];_0x77225e['send']({'fromKey':_[_0x2ff1('0x6d')](_0x3e8095[_0x2ff1('0x113')])?undefined:_0x3e8095[_0x2ff1('0x113')],'count':_0x244882[_0x2ff1('0x35')],'rows':_0x244882});}})['catch'](handleError(_0x77225e,null));};exports[_0x2ff1('0x114')]=function(_0x1764f4,_0xe71487){var _0x28c1c4={'raw':![],'where':{}};var _0x361f9b={};var _0x4b311f={'count':0x0,'rows':[]};return db[_0x2ff1('0x2e')][_0x2ff1('0x51')]({'where':{'id':_0x1764f4[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe71487,null))[_0x2ff1('0x27')](function(_0x4172c8){if(_0x4172c8){_0x361f9b[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x115')][_0x2ff1('0x2f')]);_0x361f9b[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x1764f4['query']);_0x361f9b[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x361f9b['model'],_0x361f9b[_0x2ff1('0x31')]);_0x28c1c4[_0x2ff1('0x32')]=_[_0x2ff1('0x42')](_0x361f9b[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x1764f4['query'][_0x2ff1('0x34')]));_0x28c1c4['attributes']=_0x28c1c4[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x28c1c4[_0x2ff1('0x32')]:_0x361f9b[_0x2ff1('0x33')];if(!_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x28c1c4[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x28c1c4[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x1764f4['query'][_0x2ff1('0x1b')]);}_0x28c1c4[_0x2ff1('0x54')]=qs['sort'](_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x36')]);_0x28c1c4['where']=qs['filters'](_[_0x2ff1('0x37')](_0x1764f4[_0x2ff1('0x31')],_0x361f9b[_0x2ff1('0x38')]));_0x28c1c4['where'][_0x2ff1('0x55')]=_0x4172c8['id'];if(_0x1764f4['query']['filter']){_0x28c1c4[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x28c1c4['where'],{'$or':_[_0x2ff1('0x2d')](_0x28c1c4['attributes'],function(_0x163a67){var _0xf2f6fb={};_0xf2f6fb[_0x163a67]={'$like':'%'+_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0xf2f6fb;})});}_0x28c1c4=_[_0x2ff1('0x3b')]({},_0x28c1c4,_0x1764f4[_0x2ff1('0x3c')]);return db[_0x2ff1('0x115')][_0x2ff1('0x1e')]({'where':_0x28c1c4[_0x2ff1('0x3a')]})['then'](function(_0x550bdc){_0x4b311f[_0x2ff1('0x1e')]=_0x550bdc;if(_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x28c1c4[_0x2ff1('0x3e')]=[{'all':!![]}];}else{_0x28c1c4[_0x2ff1('0x3e')]=[{'model':db['CmContact'],'as':_0x2ff1('0xe4'),'required':![]},{'model':db['Attachment'],'as':_0x2ff1('0x116'),'required':![]}];}return db['ChatOfflineMessage'][_0x2ff1('0x3f')](_0x28c1c4);})[_0x2ff1('0x27')](function(_0x35f8e3){_0x4b311f['rows']=_0x35f8e3;return _0x4b311f;});}})[_0x2ff1('0x27')](respondWithFilteredResult(_0xe71487,_0x28c1c4))[_0x2ff1('0x19')](handleError(_0xe71487,null));};exports['addAgents']=function(_0x18221d,_0xc5f5ea){return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x18221d[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0xc5f5ea,null))['then'](function(_0x16e50a){if(_0x16e50a){return _0x16e50a[_0x2ff1('0x117')](_0x18221d[_0x2ff1('0x4a')][_0x2ff1('0x58')],_[_0x2ff1('0xe2')](_0x18221d[_0x2ff1('0x4a')],[_0x2ff1('0x58'),'id'])||{})[_0x2ff1('0xa9')](function(_0x3fb7d7){for(var _0x424023=0x0;_0x424023<_0x18221d['body']['ids'][_0x2ff1('0x35')];_0x424023+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x18221d[_0x2ff1('0x4a')][_0x2ff1('0x58')][_0x424023]),'ChatWebsiteId':Number(_0x18221d[_0x2ff1('0x4b')]['id'])});}return _0x3fb7d7;});}})['then'](respondWithResult(_0xc5f5ea,null))[_0x2ff1('0x19')](handleError(_0xc5f5ea,null));};exports['removeAgents']=function(_0x1515f2,_0x39f127){return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x1515f2[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x39f127,null))[_0x2ff1('0x27')](function(_0x3fc7ee){if(_0x3fc7ee){return _0x3fc7ee[_0x2ff1('0x118')](_0x1515f2['query'][_0x2ff1('0x58')])[_0x2ff1('0x27')](function(){if(_[_0x2ff1('0x119')](_0x1515f2[_0x2ff1('0x31')][_0x2ff1('0x58')])){for(var _0x320887=0x0;_0x320887<_0x1515f2[_0x2ff1('0x31')]['ids'][_0x2ff1('0x35')];_0x320887+=0x1){socket[_0x2ff1('0x11a')](_0x2ff1('0x11b'),{'UserId':Number(_0x1515f2[_0x2ff1('0x31')][_0x2ff1('0x58')][_0x320887]),'ChatWebsiteId':Number(_0x1515f2[_0x2ff1('0x4b')]['id'])});}}else{socket['emit'](_0x2ff1('0x11b'),{'UserId':Number(_0x1515f2[_0x2ff1('0x31')][_0x2ff1('0x58')]),'ChatWebsiteId':Number(_0x1515f2['params']['id'])});}});}})[_0x2ff1('0x27')](respondWithStatusCode(_0x39f127,null))[_0x2ff1('0x19')](handleError(_0x39f127,null));};exports[_0x2ff1('0x11c')]=function(_0x13f30b,_0x46f356){var _0x4a7abf={};var _0x5d26b5={};var _0x3672e7;var _0x501224;return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x13f30b[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x46f356,null))[_0x2ff1('0x27')](function(_0x3d4850){if(_0x3d4850){_0x3672e7=_0x3d4850;_0x5d26b5[_0x2ff1('0x33')]=_['keys'](db[_0x2ff1('0xb1')][_0x2ff1('0x2f')]);_0x5d26b5[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x13f30b[_0x2ff1('0x31')]);_0x5d26b5[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x5d26b5['model'],_0x5d26b5[_0x2ff1('0x31')]);_0x4a7abf[_0x2ff1('0x32')]=_['intersection'](_0x5d26b5['model'],qs[_0x2ff1('0x34')](_0x13f30b[_0x2ff1('0x31')]['fields']));_0x4a7abf[_0x2ff1('0x32')]=_0x4a7abf[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x4a7abf[_0x2ff1('0x32')]:_0x5d26b5['model'];_0x4a7abf[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x13f30b['query'][_0x2ff1('0x36')]);_0x4a7abf[_0x2ff1('0x3a')]=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0x13f30b[_0x2ff1('0x31')],_0x5d26b5[_0x2ff1('0x38')]));if(_0x13f30b[_0x2ff1('0x31')]['filter']){_0x4a7abf[_0x2ff1('0x3a')]=_['merge'](_0x4a7abf['where'],{'$or':_[_0x2ff1('0x2d')](_0x4a7abf['attributes'],function(_0x4f852b){var _0x59bacd={};_0x59bacd[_0x4f852b]={'$like':'%'+_0x13f30b['query'][_0x2ff1('0x39')]+'%'};return _0x59bacd;})});}_0x4a7abf=_[_0x2ff1('0x3b')]({},_0x4a7abf,_0x13f30b[_0x2ff1('0x3c')]);return _0x3672e7[_0x2ff1('0x11c')](_0x4a7abf);}})[_0x2ff1('0x27')](function(_0x55a471){if(_0x55a471){_0x501224=_0x55a471[_0x2ff1('0x35')];if(!_0x13f30b['query'][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x4a7abf[_0x2ff1('0x1c')]=qs['limit'](_0x13f30b[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x4a7abf[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x13f30b[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}return _0x3672e7[_0x2ff1('0x11c')](_0x4a7abf);}})[_0x2ff1('0x27')](function(_0x7baf22){if(_0x7baf22){return _0x7baf22?{'count':_0x501224,'rows':_0x7baf22}:null;}})[_0x2ff1('0x27')](respondWithResult(_0x46f356,null))[_0x2ff1('0x19')](handleError(_0x46f356,null));}; \ No newline at end of file +var _0xf874=['where','filters','filter','merge','options','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','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','notify','user-agent-parser','setUA','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','applications','Applications','orderBy','asc','account','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','interaction','messageId','created','push','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','sendMail','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','nolimit','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','License','all','server/files/chat/iframe.ejs','utf8','x-real-ip','connection','remoteAddress','virtual','replace','verticalAlignment','color','labelText','textColor','color_button','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','priority','stack','finally','getApplications','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','Contact','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','undefined','limit','count','offset','set','update','then','destroy','ChatWebsites','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','intersection','attributes','fields','query','length','hasOwnProperty','order','sort'];(function(_0x1da42a,_0x2f4a8b){var _0x189a3d=function(_0x56e376){while(--_0x56e376){_0x1da42a['push'](_0x1da42a['shift']());}};_0x189a3d(++_0x2f4a8b);}(_0xf874,0xed));var _0x4f87=function(_0x1ec443,_0x100928){_0x1ec443=_0x1ec443-0x0;var _0x149857=_0xf874[_0x1ec443];return _0x149857;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f87('0x0'));var path=require(_0x4f87('0x1'));var ejs=require(_0x4f87('0x2'));var fs=require('fs');var fs_extra=require(_0x4f87('0x3'));var _=require(_0x4f87('0x4'));var querystring=require(_0x4f87('0x5'));var Redis=require('ioredis');var qs=require(_0x4f87('0x6'));var logger=require(_0x4f87('0x7'))(_0x4f87('0x8'));var config=require(_0x4f87('0x9'));var db=require(_0x4f87('0xa'))['db'];config[_0x4f87('0xb')]=_['defaults'](config[_0x4f87('0xb')],{'host':_0x4f87('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f87('0xb')]));require(_0x4f87('0xd'))['register'](socket);var jayson=require(_0x4f87('0xe'));var client=jayson[_0x4f87('0xf')][_0x4f87('0x10')]({'port':0x232c});var client9002=jayson[_0x4f87('0xf')][_0x4f87('0x10')]({'port':0x232a});var client9003=jayson[_0x4f87('0xf')][_0x4f87('0x10')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x1b5c2c,_0x285481,_0x107d98,_0x5e6d04){return new BPromise(function(_0x4ebb6a,_0x1cfc27){var _0x430bc4=_0x5e6d04||client;return _0x430bc4[_0x4f87('0x11')](_0x1b5c2c,_0x107d98)['then'](function(_0x2f11d2){logger['info'](_0x4f87('0x12'),_0x285481,_0x4f87('0x13'));logger['debug'](_0x4f87('0x14'),_0x285481,_0x4f87('0x13'),JSON[_0x4f87('0x15')](_0x2f11d2));if(_0x2f11d2[_0x4f87('0x16')]){if(_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x17')]===0x1f4){logger['error'](_0x4f87('0x12'),_0x285481,_0x2f11d2['error'][_0x4f87('0x18')]);return _0x1cfc27(_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x18')]);}logger[_0x4f87('0x16')](_0x4f87('0x12'),_0x285481,_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x18')]);return _0x4ebb6a(_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x18')]);}else{logger[_0x4f87('0x19')](_0x4f87('0x12'),_0x285481,_0x4f87('0x13'));_0x4ebb6a(_0x2f11d2[_0x4f87('0x1a')]['message']);}})['catch'](function(_0x3cb630){logger[_0x4f87('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x285481,_0x3cb630);_0x1cfc27(_0x3cb630);});});}function respondWithStatusCode(_0x592edd,_0x30636d){_0x30636d=_0x30636d||0xcc;return function(_0x5d1e62){if(_0x5d1e62){return _0x592edd['sendStatus'](_0x30636d);}return _0x592edd[_0x4f87('0x1b')](_0x30636d)[_0x4f87('0x1c')]();};}function respondWithResult(_0x2a382c,_0x3cf180){_0x3cf180=_0x3cf180||0xc8;return function(_0x17bdbd){if(_0x17bdbd){return _0x2a382c[_0x4f87('0x1b')](_0x3cf180)[_0x4f87('0x1d')](_0x17bdbd);}};}function respondWithFilteredResult(_0x5c5861,_0x234106){return function(_0x11eb83){if(_0x11eb83){var _0x207988=typeof _0x234106['offset']===_0x4f87('0x1e')&&typeof _0x234106[_0x4f87('0x1f')]==='undefined';var _0x19e3ba=_0x11eb83[_0x4f87('0x20')];var _0x3eab48=_0x207988?0x0:_0x234106[_0x4f87('0x21')];var _0x4b4daf=_0x207988?_0x11eb83['count']:_0x234106[_0x4f87('0x21')]+_0x234106[_0x4f87('0x1f')];var _0xeaaf08;if(_0x4b4daf>=_0x19e3ba){_0x4b4daf=_0x19e3ba;_0xeaaf08=0xc8;}else{_0xeaaf08=0xce;}_0x5c5861[_0x4f87('0x1b')](_0xeaaf08);return _0x5c5861[_0x4f87('0x22')]('Content-Range',_0x3eab48+'-'+_0x4b4daf+'/'+_0x19e3ba)[_0x4f87('0x1d')](_0x11eb83);}return null;};}function saveUpdates(_0x4ca7c2){return function(_0x33c93e){if(_0x33c93e){return _0x33c93e[_0x4f87('0x23')](_0x4ca7c2)[_0x4f87('0x24')](function(_0x430cf9){return _0x430cf9;});}return null;};}function removeEntity(_0x3e04ce){return function(_0x23e54a){if(_0x23e54a){return _0x23e54a[_0x4f87('0x25')]()['then'](function(){var _0x22ccac=_0x23e54a['get']({'plain':!![]});var _0x1d3bec=_0x4f87('0x26');return db[_0x4f87('0x27')][_0x4f87('0x25')]({'where':{'type':_0x1d3bec,'resourceId':_0x22ccac['id']}})[_0x4f87('0x24')](function(){return _0x23e54a;});})[_0x4f87('0x24')](function(){_0x3e04ce[_0x4f87('0x1b')](0xcc)[_0x4f87('0x1c')]();});}};}function handleEntityNotFound(_0xddddfb){return function(_0xd8d3c0){if(!_0xd8d3c0){_0xddddfb[_0x4f87('0x28')](0x194);}return _0xd8d3c0;};}function handleError(_0x112ffd,_0x4ded68){_0x4ded68=_0x4ded68||0x1f4;return function(_0x386ffc){logger[_0x4f87('0x16')](_0x386ffc['stack']);if(_0x386ffc[_0x4f87('0x29')]){delete _0x386ffc[_0x4f87('0x29')];}_0x112ffd[_0x4f87('0x1b')](_0x4ded68)['send'](_0x386ffc);};}exports[_0x4f87('0x2a')]=function(_0x6669a5,_0x50a387){var _0x237265={'include':[{'model':db[_0x4f87('0x2b')],'as':_0x4f87('0x2c')}]},_0x588bc2={},_0x139ec3={'count':0x0,'rows':[]};var _0x49f7d0=_[_0x4f87('0x2d')](db['ChatWebsite']['rawAttributes'],function(_0x45651a){return{'name':_0x45651a[_0x4f87('0x2e')],'type':_0x45651a['type'][_0x4f87('0x2f')]};});_0x588bc2[_0x4f87('0x30')]=_[_0x4f87('0x2d')](_0x49f7d0,_0x4f87('0x29'));_0x588bc2['query']=_['keys'](_0x6669a5['query']);_0x588bc2['filters']=_[_0x4f87('0x31')](_0x588bc2[_0x4f87('0x30')],_0x588bc2['query']);_0x237265[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x588bc2[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x6669a5[_0x4f87('0x34')][_0x4f87('0x33')]));_0x237265['attributes']=_0x237265[_0x4f87('0x32')][_0x4f87('0x35')]?_0x237265['attributes']:_0x588bc2[_0x4f87('0x30')];if(!_0x6669a5[_0x4f87('0x34')][_0x4f87('0x36')]('nolimit')){_0x237265[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x6669a5['query'][_0x4f87('0x1f')]);_0x237265[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x6669a5[_0x4f87('0x34')][_0x4f87('0x21')]);}_0x237265[_0x4f87('0x37')]=qs['sort'](_0x6669a5[_0x4f87('0x34')][_0x4f87('0x38')]);_0x237265[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_['pick'](_0x6669a5[_0x4f87('0x34')],_0x588bc2['filters']),_0x49f7d0);if(_0x6669a5[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x237265[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x237265['where'],{'$or':_['map'](_0x49f7d0,function(_0x5b6bf4){if(_0x5b6bf4['type']!=='VIRTUAL'){var _0x51bd2e={};_0x51bd2e[_0x5b6bf4[_0x4f87('0x29')]]={'$like':'%'+_0x6669a5[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x51bd2e;}})});}_0x237265=_[_0x4f87('0x3c')]({},_0x237265,_0x6669a5[_0x4f87('0x3d')]);var _0x1232c4={'where':_0x237265[_0x4f87('0x39')]};return db[_0x4f87('0x3e')]['count'](_0x1232c4)[_0x4f87('0x24')](function(_0x3bb587){_0x139ec3[_0x4f87('0x20')]=_0x3bb587;if(_0x6669a5[_0x4f87('0x34')][_0x4f87('0x3f')]){_0x237265[_0x4f87('0x40')]=[{'all':!![]}];}return db[_0x4f87('0x3e')][_0x4f87('0x41')](_0x237265);})[_0x4f87('0x24')](function(_0x2f22f2){_0x139ec3[_0x4f87('0x42')]=_0x2f22f2;return _0x139ec3;})[_0x4f87('0x24')](respondWithFilteredResult(_0x50a387,_0x237265))[_0x4f87('0x43')](handleError(_0x50a387,null));};exports[_0x4f87('0x44')]=function(_0x11e6fb,_0x3b6e13){var _0x8ed232={'raw':![],'where':{'id':_0x11e6fb[_0x4f87('0x45')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4f8886={};_0x4f8886[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x3e')][_0x4f87('0x47')]);_0x4f8886[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x11e6fb[_0x4f87('0x34')]);_0x4f8886[_0x4f87('0x3a')]=_[_0x4f87('0x31')](_0x4f8886[_0x4f87('0x30')],_0x4f8886['query']);_0x8ed232['attributes']=_[_0x4f87('0x31')](_0x4f8886[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x11e6fb['query']['fields']));_0x8ed232[_0x4f87('0x32')]=_0x8ed232[_0x4f87('0x32')][_0x4f87('0x35')]?_0x8ed232[_0x4f87('0x32')]:_0x4f8886[_0x4f87('0x30')];if(_0x11e6fb[_0x4f87('0x34')]['includeAll']){_0x8ed232[_0x4f87('0x40')]=[{'all':!![]}];}_0x8ed232=_['merge']({},_0x8ed232,_0x11e6fb[_0x4f87('0x3d')]);return db['ChatWebsite'][_0x4f87('0x48')](_0x8ed232)[_0x4f87('0x24')](handleEntityNotFound(_0x3b6e13,null))[_0x4f87('0x24')](respondWithResult(_0x3b6e13,null))[_0x4f87('0x43')](handleError(_0x3b6e13,null));};exports[_0x4f87('0x49')]=function(_0x27fa0b,_0x22c389){return db['ChatWebsite'][_0x4f87('0x49')](_0x27fa0b[_0x4f87('0x4a')],{})[_0x4f87('0x24')](function(_0x59a0d5){var _0x2e718b=_0x27fa0b['user'][_0x4f87('0x4b')]({'plain':!![]});if(!_0x2e718b)throw new Error(_0x4f87('0x4c'));if(_0x2e718b[_0x4f87('0x4d')]===_0x4f87('0x4e')){var _0x20cab1=_0x59a0d5['get']({'plain':!![]});var _0x16e323=_0x4f87('0x26');return db['UserProfileSection'][_0x4f87('0x48')]({'where':{'name':_0x16e323,'userProfileId':_0x2e718b[_0x4f87('0x4f')]},'raw':!![]})[_0x4f87('0x24')](function(_0x24c024){if(_0x24c024&&_0x24c024[_0x4f87('0x50')]===0x0){return db[_0x4f87('0x27')][_0x4f87('0x49')]({'name':_0x20cab1[_0x4f87('0x29')],'resourceId':_0x20cab1['id'],'type':_0x24c024[_0x4f87('0x29')],'sectionId':_0x24c024['id']},{})[_0x4f87('0x24')](function(){return _0x59a0d5;});}else{return _0x59a0d5;}})[_0x4f87('0x43')](function(_0x365b33){logger[_0x4f87('0x16')](_0x4f87('0x51'),_0x365b33);throw _0x365b33;});}return _0x59a0d5;})[_0x4f87('0x24')](respondWithResult(_0x22c389,0xc9))[_0x4f87('0x43')](handleError(_0x22c389,null));};exports[_0x4f87('0x23')]=function(_0x3e3871,_0x4080b3){if(_0x3e3871[_0x4f87('0x4a')]['id']){delete _0x3e3871[_0x4f87('0x4a')]['id'];}return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x3e3871[_0x4f87('0x45')]['id']},'include':[{'model':db[_0x4f87('0x2b')],'as':_0x4f87('0x2c')}]})[_0x4f87('0x24')](handleEntityNotFound(_0x4080b3,null))[_0x4f87('0x24')](saveUpdates(_0x3e3871[_0x4f87('0x4a')],null))[_0x4f87('0x24')](respondWithResult(_0x4080b3,null))[_0x4f87('0x43')](handleError(_0x4080b3,null));};exports[_0x4f87('0x25')]=function(_0x46b9bc,_0xa63692){return db['ChatWebsite']['find']({'where':{'id':_0x46b9bc[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0xa63692,null))[_0x4f87('0x24')](removeEntity(_0xa63692,null))['catch'](handleError(_0xa63692,null));};exports[_0x4f87('0x52')]=function(_0xdb7fe7,_0x4f9828){return db['ChatWebsite'][_0x4f87('0x52')]()[_0x4f87('0x24')](respondWithResult(_0x4f9828,null))[_0x4f87('0x43')](handleError(_0x4f9828,null));};exports['addDisposition']=function(_0x3475fa,_0x341617){if(_0x3475fa[_0x4f87('0x4a')]['id']){delete _0x3475fa[_0x4f87('0x4a')]['id'];}return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x3475fa['params']['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x341617,null))[_0x4f87('0x24')](function(_0x46e86f){if(_0x46e86f){_0x3475fa['body'][_0x4f87('0x53')]=_0x46e86f['id'];return db[_0x4f87('0x54')][_0x4f87('0x49')](_0x3475fa['body']);}})[_0x4f87('0x24')](respondWithResult(_0x341617,null))[_0x4f87('0x43')](handleError(_0x341617,null));};exports[_0x4f87('0x55')]=function(_0x4f52b4,_0x7c5884){var _0x211417={'raw':![],'where':{}};var _0x4fb630={};var _0x825496={'count':0x0,'rows':[]};return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x4f52b4[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x7c5884,null))[_0x4f87('0x24')](function(_0x44aea0){if(_0x44aea0){_0x4fb630[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x54')][_0x4f87('0x47')]);_0x4fb630[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x4f52b4[_0x4f87('0x34')]);_0x4fb630[_0x4f87('0x3a')]=_[_0x4f87('0x31')](_0x4fb630['model'],_0x4fb630[_0x4f87('0x34')]);_0x211417[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x4fb630[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x4f52b4[_0x4f87('0x34')][_0x4f87('0x33')]));_0x211417['attributes']=_0x211417[_0x4f87('0x32')][_0x4f87('0x35')]?_0x211417[_0x4f87('0x32')]:_0x4fb630[_0x4f87('0x30')];if(!_0x4f52b4[_0x4f87('0x34')][_0x4f87('0x36')]('nolimit')){_0x211417[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x4f52b4[_0x4f87('0x34')]['limit']);_0x211417[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x4f52b4['query']['offset']);}_0x211417[_0x4f87('0x37')]=qs['sort'](_0x4f52b4[_0x4f87('0x34')]['sort']);_0x211417[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_['pick'](_0x4f52b4['query'],_0x4fb630[_0x4f87('0x3a')]));_0x211417[_0x4f87('0x39')][_0x4f87('0x53')]=_0x44aea0['id'];if(_0x4f52b4['query']['filter']){_0x211417[_0x4f87('0x39')]=_['merge'](_0x211417[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x211417[_0x4f87('0x32')],function(_0x3885f6){var _0x66ce79={};_0x66ce79[_0x3885f6]={'$like':'%'+_0x4f52b4[_0x4f87('0x34')]['filter']+'%'};return _0x66ce79;})});}_0x211417=_[_0x4f87('0x3c')]({},_0x211417,_0x4f52b4[_0x4f87('0x3d')]);return db[_0x4f87('0x54')]['count']({'where':_0x211417[_0x4f87('0x39')]})[_0x4f87('0x24')](function(_0x437642){_0x825496['count']=_0x437642;if(_0x4f52b4[_0x4f87('0x34')]['includeAll']){_0x211417[_0x4f87('0x40')]=[{'all':!![]}];}return db[_0x4f87('0x54')][_0x4f87('0x41')](_0x211417);})['then'](function(_0x41879f){_0x825496['rows']=_0x41879f;return _0x825496;});}})[_0x4f87('0x24')](respondWithFilteredResult(_0x7c5884,_0x211417))[_0x4f87('0x43')](handleError(_0x7c5884,null));};exports[_0x4f87('0x57')]=function(_0x3a52d2,_0x2b0e50){return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x3a52d2[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x2b0e50,null))[_0x4f87('0x24')](function(_0x12f372){if(_0x12f372){return _0x12f372[_0x4f87('0x57')](_0x3a52d2[_0x4f87('0x34')]['ids']);}})[_0x4f87('0x24')](respondWithStatusCode(_0x2b0e50,null))['catch'](handleError(_0x2b0e50,null));};exports[_0x4f87('0x58')]=function(_0x4b8e39,_0x49bcb1){if(_0x4b8e39['body']['id']){delete _0x4b8e39[_0x4f87('0x4a')]['id'];}return db[_0x4f87('0x3e')]['find']({'where':{'id':_0x4b8e39['params']['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x49bcb1,null))[_0x4f87('0x24')](function(_0x5e7bf0){if(_0x5e7bf0){_0x4b8e39[_0x4f87('0x4a')][_0x4f87('0x53')]=_0x5e7bf0['id'];return db[_0x4f87('0x59')][_0x4f87('0x49')](_0x4b8e39[_0x4f87('0x4a')]);}})[_0x4f87('0x24')](respondWithResult(_0x49bcb1,null))[_0x4f87('0x43')](handleError(_0x49bcb1,null));};exports[_0x4f87('0x5a')]=function(_0x54b994,_0x473028){var _0x415914={'raw':![],'where':{}};var _0x576565={};var _0x555945={'count':0x0,'rows':[]};return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x54b994[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x473028,null))[_0x4f87('0x24')](function(_0x9250d2){if(_0x9250d2){_0x576565[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x59')]['rawAttributes']);_0x576565[_0x4f87('0x34')]=_['keys'](_0x54b994[_0x4f87('0x34')]);_0x576565['filters']=_[_0x4f87('0x31')](_0x576565[_0x4f87('0x30')],_0x576565[_0x4f87('0x34')]);_0x415914[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x576565[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x54b994[_0x4f87('0x34')]['fields']));_0x415914[_0x4f87('0x32')]=_0x415914[_0x4f87('0x32')][_0x4f87('0x35')]?_0x415914['attributes']:_0x576565[_0x4f87('0x30')];if(!_0x54b994[_0x4f87('0x34')]['hasOwnProperty']('nolimit')){_0x415914[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x54b994['query'][_0x4f87('0x1f')]);_0x415914[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x54b994[_0x4f87('0x34')][_0x4f87('0x21')]);}_0x415914['order']=qs[_0x4f87('0x38')](_0x54b994['query'][_0x4f87('0x38')]);_0x415914[_0x4f87('0x39')]=qs['filters'](_[_0x4f87('0x5b')](_0x54b994[_0x4f87('0x34')],_0x576565[_0x4f87('0x3a')]));_0x415914[_0x4f87('0x39')][_0x4f87('0x53')]=_0x9250d2['id'];if(_0x54b994[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x415914[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x415914['where'],{'$or':_[_0x4f87('0x2d')](_0x415914[_0x4f87('0x32')],function(_0xa018bb){var _0x34c9b5={};_0x34c9b5[_0xa018bb]={'$like':'%'+_0x54b994[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x34c9b5;})});}_0x415914=_['merge']({},_0x415914,_0x54b994['options']);return db[_0x4f87('0x59')][_0x4f87('0x20')]({'where':_0x415914[_0x4f87('0x39')]})[_0x4f87('0x24')](function(_0x46929b){_0x555945[_0x4f87('0x20')]=_0x46929b;if(_0x54b994[_0x4f87('0x34')]['includeAll']){_0x415914['include']=[{'all':!![]}];}return db[_0x4f87('0x59')]['findAll'](_0x415914);})[_0x4f87('0x24')](function(_0x30b099){_0x555945[_0x4f87('0x42')]=_0x30b099;return _0x555945;});}})[_0x4f87('0x24')](respondWithFilteredResult(_0x473028,_0x415914))[_0x4f87('0x43')](handleError(_0x473028,null));};exports['removeAnswers']=function(_0xc7da8a,_0x1bff99){return db[_0x4f87('0x3e')]['find']({'where':{'id':_0xc7da8a[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bff99,null))['then'](function(_0x3699b3){if(_0x3699b3){return _0x3699b3['removeAnswers'](_0xc7da8a[_0x4f87('0x34')][_0x4f87('0x5c')]);}})[_0x4f87('0x24')](respondWithStatusCode(_0x1bff99,null))[_0x4f87('0x43')](handleError(_0x1bff99,null));};exports[_0x4f87('0x5d')]=function(_0x1e11df,_0x50de0a){_0x1e11df[_0x4f87('0x4a')][_0x4f87('0x5e')]=_0x1e11df[_0x4f87('0x5f')][_0x4f87('0x60')];return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x1e11df[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x50de0a,null))['then'](saveUpdates(_0x1e11df[_0x4f87('0x4a')],null))['then'](respondWithResult(_0x50de0a,null))[_0x4f87('0x43')](handleError(_0x50de0a,null));};exports[_0x4f87('0x61')]=function(_0x107bbc,_0x2078be){_0x107bbc[_0x4f87('0x4a')][_0x4f87('0x62')]=_0x107bbc[_0x4f87('0x5f')][_0x4f87('0x60')];return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x107bbc[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x2078be,null))[_0x4f87('0x24')](saveUpdates(_0x107bbc['body'],null))[_0x4f87('0x24')](respondWithResult(_0x2078be,null))[_0x4f87('0x43')](handleError(_0x2078be,null));};exports[_0x4f87('0x63')]=function(_0x2f3dd2,_0x146f3e){_0x2f3dd2[_0x4f87('0x4a')][_0x4f87('0x64')]=_0x2f3dd2[_0x4f87('0x5f')][_0x4f87('0x60')];return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x2f3dd2['params']['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x146f3e,null))[_0x4f87('0x24')](saveUpdates(_0x2f3dd2[_0x4f87('0x4a')],null))[_0x4f87('0x24')](respondWithResult(_0x146f3e,null))[_0x4f87('0x43')](handleError(_0x146f3e,null));};exports[_0x4f87('0x65')]=function(_0xc3e8fc,_0x35e798){_0xc3e8fc['body'][_0x4f87('0x66')]=_0xc3e8fc[_0x4f87('0x5f')][_0x4f87('0x60')];return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0xc3e8fc['params']['id']}})['then'](handleEntityNotFound(_0x35e798,null))[_0x4f87('0x24')](saveUpdates(_0xc3e8fc[_0x4f87('0x4a')],null))[_0x4f87('0x24')](respondWithResult(_0x35e798,null))[_0x4f87('0x43')](handleError(_0x35e798,null));};exports[_0x4f87('0x67')]=function(_0x30fca2,_0xf82bad){var _0x291aa9=path[_0x4f87('0x68')](config['root'],_0x4f87('0x69'));var _0x5e7d48={'where':{'id':_0x30fca2[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x5e')],'raw':!![]};var _0x1b184a=![];return require(_0x4f87('0x6a'))[_0x4f87('0x6b')]()['then'](function(_0x52345a){if(_0x52345a){_0x1b184a=_0x52345a[_0x4f87('0x6c')];}})[_0x4f87('0x24')](function(){return db[_0x4f87('0x3e')][_0x4f87('0x48')](_0x5e7d48);})[_0x4f87('0x24')](handleEntityNotFound(_0xf82bad,null))[_0x4f87('0x24')](function(_0x3dd003){if(_0x3dd003){if(!_[_0x4f87('0x6d')](_0x3dd003[_0x4f87('0x5e')])){if(fs[_0x4f87('0x6e')](path[_0x4f87('0x68')](config[_0x4f87('0x6f')],'server/files/images/logos/',_0x3dd003[_0x4f87('0x5e')]))&&_0x1b184a){_0x291aa9=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x70'),_0x3dd003['sitepic']);}}return _0xf82bad[_0x4f87('0x71')](_0x291aa9);}})[_0x4f87('0x43')](handleError(_0xf82bad,null));};exports[_0x4f87('0x72')]=function(_0x3a3865,_0x4da978){var _0x5137bd=path['join'](config['root'],_0x4f87('0x73'));var _0x2f178a={'where':{'id':_0x3a3865[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x62')],'raw':!![]};return db[_0x4f87('0x3e')][_0x4f87('0x48')](_0x2f178a)[_0x4f87('0x24')](handleEntityNotFound(_0x4da978,null))['then'](function(_0x1b01b1){if(_0x1b01b1){if(!_[_0x4f87('0x6d')](_0x1b01b1['agentAvatar'])){if(fs['existsSync'](path[_0x4f87('0x68')](config['root'],'server/files/images/avatars/',_0x1b01b1[_0x4f87('0x62')]))){_0x5137bd=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x1b01b1['agentAvatar']);}}return _0x4da978[_0x4f87('0x71')](_0x5137bd);}})[_0x4f87('0x43')](handleError(_0x4da978,null));};exports[_0x4f87('0x75')]=function(_0x1efa7c,_0x46274d){var _0x5ba9ae=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x76'));var _0x2593e1={'where':{'id':_0x1efa7c[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x64'),_0x4f87('0x77')],'raw':!![]};return db[_0x4f87('0x3e')][_0x4f87('0x48')](_0x2593e1)[_0x4f87('0x24')](handleEntityNotFound(_0x46274d,null))[_0x4f87('0x24')](function(_0x2fe1a7){if(_0x2fe1a7){if(!_[_0x4f87('0x6d')](_0x2fe1a7[_0x4f87('0x64')])){if(fs[_0x4f87('0x6e')](path['join'](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x2fe1a7[_0x4f87('0x64')]))&&_0x2fe1a7[_0x4f87('0x77')]){_0x5ba9ae=path['join'](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x2fe1a7[_0x4f87('0x64')]);}}return _0x46274d[_0x4f87('0x71')](_0x5ba9ae);}})[_0x4f87('0x43')](handleError(_0x46274d,null));};exports[_0x4f87('0x78')]=function(_0x90dca9,_0x38505f){var _0x509796=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x79'));var _0x238e91={'where':{'id':_0x90dca9[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x66')],'raw':!![]};return db['ChatWebsite'][_0x4f87('0x48')](_0x238e91)[_0x4f87('0x24')](handleEntityNotFound(_0x38505f,null))[_0x4f87('0x24')](function(_0x4c78a5){if(_0x4c78a5){if(!_[_0x4f87('0x6d')](_0x4c78a5['systemAvatar'])){if(fs['existsSync'](path[_0x4f87('0x68')](config[_0x4f87('0x6f')],'server/files/images/avatars/',_0x4c78a5[_0x4f87('0x66')]))){_0x509796=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x4c78a5[_0x4f87('0x66')]);}}return _0x38505f[_0x4f87('0x71')](_0x509796);}})[_0x4f87('0x43')](handleError(_0x38505f,null));};exports[_0x4f87('0x7a')]=function(_0x18b018,_0x178fa9){var _0x5bb7ff=require(_0x4f87('0x7b'));var _0x1a93f9=new _0x5bb7ff();var _0x362e17=_0x1a93f9[_0x4f87('0x7c')](_0x18b018['headers'][_0x4f87('0x7d')])['getResult']();var _0x1bb08d={'body':_0x18b018[_0x4f87('0x4a')],'channel':'chat'};var _0x1a1061=[];var _0x1ff904=[];var _0x3be33e={};var _0x466f1d=![];return db[_0x4f87('0x7e')][_0x4f87('0x52')]()[_0x4f87('0x24')](function(_0x5db2e5){if(!_0x5db2e5){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x81'));}_0x1a1061=_['difference'](_[_0x4f87('0x46')](_0x5db2e5),['createdAt',_0x4f87('0x82')]);_0x1ff904=_[_0x4f87('0x83')](_['keys'](_0x5db2e5),[_0x4f87('0x84'),_0x4f87('0x82'),_0x4f87('0x85'),_0x4f87('0x86')]);if(_0x18b018['body']['id']){delete _0x18b018['body']['id'];}if(_['isNil'](_0x18b018[_0x4f87('0x4a')][_0x4f87('0x87')])){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x88'));}if(_['isNil'](_0x18b018[_0x4f87('0x4a')][_0x4f87('0x4a')])||_0x18b018[_0x4f87('0x4a')][_0x4f87('0x4a')]===''){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x89'));}if(_[_0x4f87('0x6d')](_0x18b018['body']['mapKey'])){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x8a')+_0x1ff904);}if(!_[_0x4f87('0x8b')](_0x1ff904,_0x18b018[_0x4f87('0x4a')][_0x4f87('0x8c')])){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x8d')+_0x1ff904);}_0x3be33e[_0x18b018[_0x4f87('0x4a')][_0x4f87('0x8c')]]=_0x18b018[_0x4f87('0x4a')][_0x4f87('0x87')];})[_0x4f87('0x24')](function(){return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x18b018[_0x4f87('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0x4f87('0x8e'),'include':[{'model':db['CmContact'],'as':_0x4f87('0x8f'),'where':_0x3be33e,'limit':0x1,'order':[[_0x4f87('0x82'),_0x4f87('0x90')]]}]},{'model':db[_0x4f87('0x91')],'as':'Applications'}]});})[_0x4f87('0x24')](handleEntityNotFound(_0x178fa9,null))[_0x4f87('0x24')](function(_0x5d26ad){if(_0x5d26ad&&_0x5d26ad[_0x4f87('0x8e')]){_0x1bb08d['account']=_0x5d26ad;_0x1bb08d[_0x4f87('0x92')]=_0x5d26ad[_0x4f87('0x93')];_0x1bb08d['list']=_0x5d26ad[_0x4f87('0x8e')];_0x1bb08d[_0x4f87('0x92')]=_[_0x4f87('0x94')](_0x1bb08d[_0x4f87('0x92')],['priority'],[_0x4f87('0x95')]);if(_0x1bb08d[_0x4f87('0x96')]['Applications']){delete _0x1bb08d[_0x4f87('0x96')][_0x4f87('0x93')];}if(_0x1bb08d['account'][_0x4f87('0x8e')]&&_0x1bb08d[_0x4f87('0x96')]['List'][_0x4f87('0x8f')][_0x4f87('0x35')]){return _0x1bb08d[_0x4f87('0x96')][_0x4f87('0x8e')][_0x4f87('0x8f')][0x0];}var _0xa84886=_['defaults'](_0x18b018['body'],{'firstName':_0x18b018[_0x4f87('0x4a')]['from'],'ListId':_0x5d26ad['ListId']});_0xa84886[_0x18b018[_0x4f87('0x4a')]['mapKey']]=_0x18b018[_0x4f87('0x4a')][_0x4f87('0x87')];return db[_0x4f87('0x7e')][_0x4f87('0x49')](_0xa84886,{'fields':_0x1a1061,'raw':!![]});}})['then'](handleEntityNotFound(_0x178fa9,null))[_0x4f87('0x24')](function(_0x16a89c){_0x1bb08d[_0x4f87('0x97')]=_0x16a89c;var _0x1685f6=_0x18b018[_0x4f87('0x4a')][_0x4f87('0x98')];if(_0x18b018[_0x4f87('0x99')][_0x4f87('0x9a')]){_0x1685f6=_0x18b018['headers'][_0x4f87('0x9a')];}else if(_0x18b018[_0x4f87('0x99')]['x-forwarded-for']){_0x1685f6=_[_0x4f87('0x9b')](_0x18b018[_0x4f87('0x99')][_0x4f87('0x9c')][_0x4f87('0x9d')](','));}if(_0x16a89c){var _0xa40668={'ContactId':_0x16a89c['id'],'ChatWebsiteId':_0x18b018[_0x4f87('0x45')]['id'],'from':(_0x16a89c[_0x4f87('0x9e')]||'')+'\x20'+(_0x16a89c[_0x4f87('0x9f')]||''),'customerIp':_0x1685f6,'customerPort':_0x18b018[_0x4f87('0x99')][_0x4f87('0xa0')]?_0x18b018[_0x4f87('0x99')][_0x4f87('0xa0')]:null,'referer':_0x18b018['body'][_0x4f87('0xa1')],'browserName':_0x362e17[_0x4f87('0xa2')][_0x4f87('0x29')]&&_0x362e17[_0x4f87('0xa2')][_0x4f87('0xa3')]?util['format']('%s\x20%s',_0x362e17['browser'][_0x4f87('0x29')],_0x362e17[_0x4f87('0xa2')][_0x4f87('0xa3')]):'unknown','browserVersion':_0x362e17[_0x4f87('0xa2')][_0x4f87('0xa3')]||_0x4f87('0xa4'),'osName':util[_0x4f87('0xa5')](_0x4f87('0xa6'),_0x362e17['os'][_0x4f87('0x29')],_0x362e17['os'][_0x4f87('0xa3')]),'osVersion':_0x362e17['os']['version'],'deviceModel':_0x362e17[_0x4f87('0xa7')]['model']&&_0x362e17[_0x4f87('0xa7')][_0x4f87('0xa8')]?util[_0x4f87('0xa5')](_0x4f87('0xa9'),_0x362e17[_0x4f87('0xa7')][_0x4f87('0x30')],_0x362e17['device']['vendor'],_0x362e17['device']['type']):null,'deviceVendor':_0x362e17['device']['vendor'],'deviceType':_0x362e17[_0x4f87('0xa7')][_0x4f87('0xaa')],'formData':JSON[_0x4f87('0x15')](_0x18b018[_0x4f87('0x4a')])};var _0x527ede={'ChatWebsiteId':_0x18b018[_0x4f87('0x45')]['id'],'closed':![]};if(_0x18b018[_0x4f87('0x4a')][_0x4f87('0xab')]){_0x527ede[_0x4f87('0xab')]=_0x18b018[_0x4f87('0x4a')][_0x4f87('0xab')];return db[_0x4f87('0xac')]['find']({'where':_0x527ede})['then'](function(_0x5637f5){if(_0x5637f5){return[_0x5637f5,![]];}_0xa40668['threadId']=_0x18b018[_0x4f87('0x4a')]['threadId'];_0xa40668[_0x4f87('0xad')]=_0x18b018['body'][_0x4f87('0xad')];return db['ChatInteraction']['create'](_0xa40668)[_0x4f87('0x24')](function(_0x19b662){return[_0x19b662,!![]];});});}_0x527ede['ContactId']=_0x16a89c['id'];if(_0x18b018[_0x4f87('0x4a')]['interaction']&&_0x18b018[_0x4f87('0x4a')][_0x4f87('0xae')]['id']){_0x527ede['id']=_0x18b018[_0x4f87('0x4a')][_0x4f87('0xae')]['id'];return db[_0x4f87('0xac')][_0x4f87('0x48')]({'where':_0x527ede})[_0x4f87('0x24')](function(_0xfe546c){if(_0xfe546c){return[_0xfe546c,![]];}return db[_0x4f87('0xac')][_0x4f87('0x49')](_0xa40668)[_0x4f87('0x24')](function(_0x43b201){return[_0x43b201,!![]];});});}return db[_0x4f87('0xac')][_0x4f87('0x49')](_0xa40668)[_0x4f87('0x24')](function(_0x439fc7){return[_0x439fc7,!![]];});}})['spread'](function(_0x1319f8,_0x306f69){if(_0x1319f8){_0x466f1d=_0x306f69;if(!_0x306f69){var _0x35baeb={'from':(_0x1bb08d[_0x4f87('0x97')][_0x4f87('0x9e')]||'')+'\x20'+(_0x1bb08d[_0x4f87('0x97')][_0x4f87('0x9f')]||'')};if(_0x18b018['body'][_0x4f87('0xab')]&&_0x18b018[_0x4f87('0x4a')][_0x4f87('0xaf')]&&_0x18b018['body'][_0x4f87('0xab')]!=_0x18b018[_0x4f87('0x4a')]['messageId']){_0x35baeb['threadId']=_0x18b018[_0x4f87('0x4a')][_0x4f87('0xaf')];}return _0x1319f8[_0x4f87('0x23')](_0x35baeb);}else{return _0x1319f8;}}})[_0x4f87('0x24')](function(_0x59aabb){_0x1bb08d[_0x4f87('0xae')]=_0x59aabb[_0x4f87('0x4b')]({'plain':!![]});_0x1bb08d[_0x4f87('0xae')]['created']=_0x466f1d;if(_0x1bb08d[_0x4f87('0xae')][_0x4f87('0xb0')]){if(_0x1bb08d[_0x4f87('0x96')]['autoclose']){_0x1bb08d[_0x4f87('0x92')][_0x4f87('0xb1')]({'id':0x0,'priority':_0x1bb08d[_0x4f87('0x92')][_0x4f87('0x35')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x4f87('0xb2')][_0x4f87('0x49')]({'body':_0x18b018[_0x4f87('0x4a')][_0x4f87('0x4a')],'ChatWebsiteId':_0x18b018[_0x4f87('0x45')]['id'],'ChatInteractionId':_0x59aabb['id'],'direction':'in','ContactId':_0x1bb08d[_0x4f87('0x97')]['id'],'AttachmentId':_0x18b018[_0x4f87('0x4a')][_0x4f87('0xb3')]});})[_0x4f87('0x24')](function(_0xf0c23c){_0x1bb08d['message']=_0xf0c23c;if(_0x1bb08d[_0x4f87('0xae')][_0x4f87('0xb4')]){return db[_0x4f87('0xb5')][_0x4f87('0x48')]({'attributes':['id','name'],'where':{'id':_0x1bb08d[_0x4f87('0xae')][_0x4f87('0xb4')]}})[_0x4f87('0x24')](function(_0x476ab1){if(_0x476ab1){_0x1bb08d[_0x4f87('0x92')][_0x4f87('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x476ab1[_0x4f87('0x29')]+','+(_0x1bb08d[_0x4f87('0x96')][_0x4f87('0xb7')]||0xa),'interval':_0x4f87('0xb8')});_0x1bb08d[_0x4f87('0xb9')]=!![];}return respondWithRpcPromise(_0x4f87('0xba'),'startRouting',_0x1bb08d);});}return respondWithRpcPromise('Start',_0x4f87('0xbb'),_0x1bb08d);})[_0x4f87('0x24')](function(_0x35e380){respondWithRpcPromise(_0x4f87('0xbc'),_0x4f87('0xbc'),{'event':'notify','message':_0x35e380},client9002);return _0x35e380;})[_0x4f87('0x24')](respondWithResult(_0x178fa9,null))['catch'](handleError(_0x178fa9,null));};exports[_0x4f87('0xbd')]=function(_0x34c94f,_0x520406){var _0x562ec8,_0x241873,_0x964e89;var _0x47c175=[];var _0x20fce4={};var _0x290074=_0x34c94f[_0x4f87('0xbe')]||[];var _0x4de4b5=[];var _0x5742c1;return db['CmContact'][_0x4f87('0x52')]()[_0x4f87('0x24')](function(_0x33aa12){if(!_0x33aa12){throw new db[(_0x4f87('0x7f'))]['ValidationError'](_0x4f87('0x81'));}_0x47c175=_['difference'](_[_0x4f87('0x46')](_0x33aa12),['createdAt',_0x4f87('0x82'),_0x4f87('0x85'),_0x4f87('0x86')]);if(_0x34c94f[_0x4f87('0x4a')]['id']){delete _0x34c94f[_0x4f87('0x4a')]['id'];}if(_[_0x4f87('0x6d')](_0x34c94f['body'][_0x4f87('0x87')])){throw _0x520406[_0x4f87('0x1b')](0x1f4)['send'](new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x88')));}if(_[_0x4f87('0x6d')](_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x4a')])||_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x4a')]===''){throw _0x520406[_0x4f87('0x1b')](0x1f4)[_0x4f87('0xbf')](new db['Sequelize'][(_0x4f87('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4f87('0x6d')](_0x34c94f[_0x4f87('0x4a')]['mapKeyOffline'])){throw _0x520406[_0x4f87('0x1b')](0x1f4)['send'](new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0xc0')+_0x47c175));}if(!_[_0x4f87('0x8b')](_0x47c175,_0x34c94f[_0x4f87('0x4a')][_0x4f87('0xc1')])){throw _0x520406[_0x4f87('0x1b')](0x1f4)[_0x4f87('0xbf')](new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0xc2')+_0x47c175));}_0x20fce4[_0x34c94f[_0x4f87('0x4a')]['mapKeyOffline']]=_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x87')];})[_0x4f87('0x24')](function(){return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x34c94f[_0x4f87('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0x4f87('0x8e')},{'model':db[_0x4f87('0xc3')],'as':_0x4f87('0xc3')}]});})[_0x4f87('0x24')](handleEntityNotFound(_0x520406,null))['then'](function(_0x14d3e5){if(_0x14d3e5&&_0x14d3e5[_0x4f87('0x8e')]){_0x241873=_0x14d3e5;var _0x3064a9=_['defaults'](_0x34c94f[_0x4f87('0x4a')],{'firstName':_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x87')],'phone':_0x34c94f['body'][_0x4f87('0x87')],'ListId':_0x14d3e5[_0x4f87('0x86')]});_0x3064a9[_0x34c94f[_0x4f87('0x4a')][_0x4f87('0xc1')]]=_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x87')];return db[_0x4f87('0x7e')][_0x4f87('0xc4')]({'where':_0x20fce4,'defaults':_0x3064a9});}})[_0x4f87('0xc5')](function(_0x12949b){if(_0x12949b){_0x964e89=_0x12949b;var _0x3dc252=fs[_0x4f87('0xc6')](path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0xc7')),'utf8');var _0x389a97=ejs[_0x4f87('0xc8')](_0x3dc252,{'body':_['toPairs'](_0x34c94f['body'][_0x4f87('0x4a')]),'bodyTitle':_0x241873[_0x4f87('0xc9')]});return db[_0x4f87('0xca')]['create']({'body':_0x389a97,'ContactId':_0x12949b['id'],'ChatWebsiteId':_0x241873['id']});}})[_0x4f87('0x24')](function(_0x4583b9){_0x5742c1=_0x4583b9;if(_0x290074[_0x4f87('0x35')]){var _0x845e7=_0x290074['map'](function(_0x1d22b4){return{'name':_0x1d22b4[_0x4f87('0xcb')],'basename':_0x1d22b4[_0x4f87('0x60')],'type':_0x1d22b4['mimetype'],'ChatOfflineMessageId':_0x4583b9['id']};});_0x4de4b5=_0x845e7[_0x4f87('0x2d')](_0x19a017=>{var _0x4c8200={'filename':_0x19a017[_0x4f87('0x29')],'path':path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0xcc'),_0x4f87('0xbe'),_0x4f87('0xcd'),'offline-chat',_0x19a017[_0x4f87('0xce')])};return _0x4c8200;});if(!_0x241873[_0x4f87('0xcf')]){return db[_0x4f87('0xd0')][_0x4f87('0xd1')](function(_0x18bf00){return db[_0x4f87('0xd2')]['bulkCreate'](_0x845e7,{'transaction':_0x18bf00});});}}})['then'](function(){if(_0x5742c1){_0x562ec8=_0x5742c1;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x4f87('0x24')](function(_0xb69fde){if(_0xb69fde&&_0xb69fde[_0x4f87('0xd3')]&&_0x241873[_0x4f87('0xd4')]&&_0x241873[_0x4f87('0xd5')]){var _0x207431={'tls':{'rejectUnauthorized':![]}};if(_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd6')]){_0x207431[_0x4f87('0xd6')]=_0xb69fde[_0x4f87('0xd3')]['service'];}else{_0x207431[_0x4f87('0xd7')]=_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd7')];_0x207431['port']=_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd8')];_0x207431['secure']=_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd9')];}if(_0xb69fde[_0x4f87('0xd3')]['authentication']){_0x207431[_0x4f87('0xda')]={'user':_0xb69fde[_0x4f87('0xd3')][_0x4f87('0x4e')],'pass':_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xdb')]};}return respondWithRpcPromise('SendMail',_0x4f87('0xdc'),{'account':_0x207431,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xb69fde[_0x4f87('0x29')],_0xb69fde['email']||_0xb69fde['Smtp']['user']),'to':_0x241873['forwardOfflineAddress'],'subject':_0x241873['offlineMessageSubject'],'html':_0x562ec8[_0x4f87('0x4a')],'attachments':_0x4de4b5}},client9003)['then'](function(){return _0x562ec8;})[_0x4f87('0x43')](function(_0x4d92c0){console[_0x4f87('0x16')](_0x4d92c0);});}})['then'](function(){if(_0x241873&&_0x241873['openNewInteraction']&&_0x241873[_0x4f87('0xdd')]){var _0x1ea453=[];if(_0x290074['length']){_0x1ea453=_0x290074[_0x4f87('0x2d')](function(_0x2c2077){return{'name':_0x2c2077[_0x4f87('0xcb')],'basename':_0x2c2077[_0x4f87('0x60')],'type':_0x2c2077[_0x4f87('0xde')],'ChatOfflineMessageId':_0x5742c1['id']};});}var _0xb6217b;if(!_['isNil'](_0x241873[_0x4f87('0xdf')])){var _0x398acb=_[_0x4f87('0x2d')](_0x34c94f[_0x4f87('0x4a')],function(_0x24cf30){return _0x24cf30;});var _0x16d3f2=_[_0x4f87('0xe0')](_0x398acb)[0x0];var _0x63e061=_[_0x4f87('0xe1')](_0x16d3f2,function(_0x1d0838){return _0x1d0838;});_0xb6217b=_0x63e061[0x1][_0x241873[_0x4f87('0xdf')]];}var _0x487008={'from':_0x964e89[_0x4f87('0xe2')],'firstName':_0x964e89[_0x4f87('0x9e')],'lastName':_0x964e89[_0x4f87('0x9f')],'mapKey':_0x4f87('0xe2'),'message':{'from':_0x964e89[_0x4f87('0xe2')],'to':_0x241873['MailAccount'][_0x4f87('0xe2')],'cc':'','subject':_['isNil'](_0xb6217b)?_0x241873[_0x4f87('0xe3')]:_0xb6217b,'messageId':'','sentAt':new Date(),'attach':_0x1ea453[_0x4f87('0x35')],'attachments':_0x1ea453,'originChannel':_0x4f87('0xe4'),'ChatWebsiteId':_0x241873['id'],'ChatOfflineMessageId':_0x562ec8['id'],'originTo':_0x241873['MailAccount'][_0x4f87('0xe2')]},'body':_0x562ec8[_0x4f87('0x4a')]};var _0x55a909={'account':{'id':_0x241873['MailAccountId']},'body':_0x487008,'log':_0x4f87('0xe5')};return respondWithRpcPromise(_0x4f87('0xe5'),_0x4f87('0xe6'),_0x55a909,client9001)[_0x4f87('0x24')](function(){return _0x562ec8;})['catch'](function(_0x3e53fc){console[_0x4f87('0x16')](_0x3e53fc);});}return;})[_0x4f87('0x24')](function(){if(_0x562ec8){return _0x562ec8;}})[_0x4f87('0x24')](respondWithResult(_0x520406,null))['catch'](function(_0x128225){console[_0x4f87('0x16')](_0x4f87('0x43'),_0x128225);for(var _0x2adf07 of _0x290074){var _0x4a7620=path[_0x4f87('0x68')](config['root'],_0x4f87('0xcc'),'files','attachments','offline-chat',_0x2adf07[_0x4f87('0x60')]);fs_extra[_0x4f87('0xe7')](_0x4a7620)[_0x4f87('0x43')](function(_0x23f6e2){console[_0x4f87('0x16')](_0x4f87('0xe8'),_0x4a7620,_0x23f6e2);});}});};exports[_0x4f87('0xe9')]=function(_0x1b75e5,_0x1b3977){return db[_0x4f87('0xac')][_0x4f87('0x48')]({'where':{'id':_0x1b75e5[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x1b3977,null))['then'](function(_0x409b08){if(_0x409b08){return _0x409b08['addInteraction'](_0x1b75e5[_0x4f87('0x4a')]['ids'],_[_0x4f87('0xea')](_0x1b75e5[_0x4f87('0x4a')],['ids','id'])||{});}})[_0x4f87('0x24')](respondWithResult(_0x1b3977,null))[_0x4f87('0x43')](handleError(_0x1b3977,null));};exports[_0x4f87('0xeb')]=function(_0x147bc9,_0x56de83){var _0x2d9fc7={'raw':![],'where':{}};var _0x87d5c={};var _0x541c73={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4f87('0x56')]({'where':{'id':_0x147bc9[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x56de83,null))[_0x4f87('0x24')](function(_0xf46968){if(_0xf46968){_0x87d5c[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0xac')][_0x4f87('0x47')]);_0x87d5c[_0x4f87('0x34')]=_['keys'](_0x147bc9[_0x4f87('0x34')]);_0x87d5c['filters']=_[_0x4f87('0x31')](_0x87d5c['model'],_0x87d5c[_0x4f87('0x34')]);_0x2d9fc7[_0x4f87('0x32')]=_['intersection'](_0x87d5c['model'],qs['fields'](_0x147bc9[_0x4f87('0x34')][_0x4f87('0x33')]));_0x2d9fc7[_0x4f87('0x32')]=_0x2d9fc7['attributes'][_0x4f87('0x35')]?_0x2d9fc7[_0x4f87('0x32')]:_0x87d5c[_0x4f87('0x30')];if(!_0x147bc9['query']['hasOwnProperty'](_0x4f87('0xec'))){_0x2d9fc7[_0x4f87('0x1f')]=qs['limit'](_0x147bc9[_0x4f87('0x34')]['limit']);_0x2d9fc7['offset']=qs['offset'](_0x147bc9['query'][_0x4f87('0x21')]);}_0x2d9fc7[_0x4f87('0x37')]=qs[_0x4f87('0x38')](_0x147bc9[_0x4f87('0x34')][_0x4f87('0x38')]);_0x2d9fc7[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_[_0x4f87('0x5b')](_0x147bc9['query'],_0x87d5c['filters']));_0x2d9fc7[_0x4f87('0x39')][_0x4f87('0x53')]=_0xf46968['id'];if(_0x147bc9[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x2d9fc7[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x2d9fc7[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x2d9fc7['attributes'],function(_0x4da842){var _0x43bc7e={};_0x43bc7e[_0x4da842]={'$like':'%'+_0x147bc9[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x43bc7e;})});}_0x2d9fc7=_[_0x4f87('0x3c')]({},_0x2d9fc7,_0x147bc9[_0x4f87('0x3d')]);return db[_0x4f87('0xac')][_0x4f87('0x20')]({'where':_0x2d9fc7['where']})[_0x4f87('0x24')](function(_0x42e8c9){_0x541c73[_0x4f87('0x20')]=_0x42e8c9;if(_0x147bc9[_0x4f87('0x34')][_0x4f87('0x3f')]){_0x2d9fc7[_0x4f87('0x40')]=[{'model':db[_0x4f87('0x7e')],'as':'Contact','required':![]},{'model':db[_0x4f87('0xb5')],'as':_0x4f87('0xed'),'attributes':[_0x4f87('0x29'),'fullname',_0x4f87('0xee')],'required':![]},{'model':db[_0x4f87('0xef')],'as':_0x4f87('0xf0'),'attributes':['id',_0x4f87('0x29'),'color'],'where':_0x147bc9[_0x4f87('0x34')][_0x4f87('0xf1')]?{'id':_0x147bc9['query']['tag']}:undefined,'required':_0x147bc9[_0x4f87('0x34')][_0x4f87('0xf1')]?!![]:![]}];}return db[_0x4f87('0xac')][_0x4f87('0x41')](_0x2d9fc7);})[_0x4f87('0x24')](function(_0x1c5bdc){_0x541c73[_0x4f87('0x42')]=_0x1c5bdc;return _0x541c73;});}})[_0x4f87('0x24')](respondWithFilteredResult(_0x56de83,_0x2d9fc7))[_0x4f87('0x43')](handleError(_0x56de83,null));};function iftimePromise(_0x40158f,_0x5015f7){return respondWithRpcPromise(_0x4f87('0xf2'),_0x4f87('0xf3'),{'command':_0x5015f7[_0x4f87('0xf4')]?util[_0x4f87('0xa5')](_0x4f87('0xf5'),_0x40158f[_0x4f87('0xf6')],_0x5015f7[_0x4f87('0xf4')]):util['format'](_0x4f87('0xf7'),_0x40158f[_0x4f87('0xf6')])},client9002)[_0x4f87('0x24')](function(_0xd3ab28){var _0x5a0fa1=_0xd3ab28&&_0xd3ab28[_0x4f87('0xf8')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5015f7['id'],_0x40158f['id'],_0x40158f[_0x4f87('0xf6')],_0x5a0fa1?_0x4f87('0xf9'):'OFFLINE',_0x5015f7[_0x4f87('0xf4')]?_0x5015f7[_0x4f87('0xf4')]:_0x4f87('0xfa'));return _0x5a0fa1;})[_0x4f87('0x43')](function(_0x54a2f4){logger[_0x4f87('0x16')](_0x4f87('0xfb'),_0x5015f7['id'],_0x40158f['id'],_0x40158f[_0x4f87('0xf6')],util[_0x4f87('0xfc')](_0x54a2f4,{'showHidden':![],'depth':null}),_0x5015f7['timezone']?_0x5015f7[_0x4f87('0xf4')]:_0x4f87('0xfa'));return![];});}exports[_0x4f87('0xf3')]=function(_0x1a8752,_0x1b479d){var _0x549396=0x0;var _0x36a416=0x0;var _0x382a9e=![];var _0x2c6b8a;var _0x4e4b38;return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x1a8752[_0x4f87('0x45')]['id']},'include':[{'model':db['Interval'],'as':_0x4f87('0xfd'),'include':[{'model':db[_0x4f87('0xfd')],'as':_0x4f87('0xfe'),'attributes':['id',_0x4f87('0xf6')],'raw':!![]}]}]})[_0x4f87('0x24')](handleEntityNotFound(_0x1b479d,null))[_0x4f87('0x24')](function(_0x1ff285){if(_0x1ff285){_0x2c6b8a=_0x1ff285;return _0x1ff285[_0x4f87('0xff')]({'raw':!![]});}})[_0x4f87('0x24')](function(_0x5a8165){if(_0x2c6b8a){if(_0x5a8165){_0x4e4b38=_0x5a8165;}}return require(_0x4f87('0x6a'))[_0x4f87('0x6b')]();})[_0x4f87('0x24')](function(_0x40bdf8){if(_0x40bdf8){_0x36a416=_0x40bdf8['virtual'];_0x382a9e=_0x40bdf8['custom'];}})['then'](function(){return db[_0x4f87('0xac')]['count']({'where':{'closed':![]}});})[_0x4f87('0x24')](function(_0x38bfe0){_0x549396=_0x38bfe0;if(_0x36a416&&_0x38bfe0>_0x36a416){return db[_0x4f87('0x100')][_0x4f87('0x56')]({'where':{'id':0x1}})[_0x4f87('0x24')](function(_0x40f578){if(_0x40f578){_0x40f578['increment']('chatLicenseExceeded');}});}})[_0x4f87('0x24')](function(){if(_0x2c6b8a[_0x4f87('0xfd')]&&_0x2c6b8a[_0x4f87('0xfd')][_0x4f87('0xfe')]){var _0x5add89=[];for(var _0x9e06d4=0x0;_0x9e06d4<_0x2c6b8a[_0x4f87('0xfd')][_0x4f87('0xfe')]['length'];_0x9e06d4++){var _0x62646a=_0x2c6b8a['Interval'][_0x4f87('0xfe')][_0x9e06d4][_0x4f87('0x4b')]({'plain':!![]});_0x5add89[_0x4f87('0xb1')](iftimePromise(_0x62646a,_0x2c6b8a));}return BPromise[_0x4f87('0x101')](_0x5add89)[_0x4f87('0x24')](function(_0x4a74e3){return _['some'](_0x4a74e3);});}else{return!![];}})[_0x4f87('0x24')](function(_0x10f7ee){var _0x1e6b03=fs[_0x4f87('0xc6')](path[_0x4f87('0x68')](config['root'],_0x4f87('0x102')),_0x4f87('0x103'));var _0x2bd875={'remote':_0x2c6b8a['remote'],'query':querystring[_0x4f87('0x15')](_[_0x4f87('0x3c')](_0x2c6b8a[_0x4f87('0x4b')]({'plain':!![]}),{'customerIp':_0x1a8752[_0x4f87('0x99')][_0x4f87('0x9c')]||_0x1a8752[_0x4f87('0x99')][_0x4f87('0x104')]||_0x1a8752[_0x4f87('0x105')][_0x4f87('0x106')]||_0x1a8752['ip'],'referer':_0x1a8752[_0x4f87('0x99')][_0x4f87('0xa1')],'openedInteractions':_0x549396,'maxInteractions':_0x36a416,'virtual':_0x382a9e[_0x4f87('0x107')],'online':_0x10f7ee,'custom':_0x382a9e}))[_0x4f87('0x108')](/'/g,'\x5c\x27')};_0x1b479d['send'](ejs['render'](Mustache[_0x4f87('0xc8')](_0x1e6b03,_0x2bd875),{'proactiveActions':_0x4e4b38,'alignment':_0x2c6b8a['alignment'],'verticalAlignment':_0x2c6b8a[_0x4f87('0x109')],'div_color':_0x2c6b8a[_0x4f87('0x10a')],'labelText':_0x2c6b8a[_0x4f87('0x10b')],'text_color':_0x2c6b8a[_0x4f87('0x10c')],'button_color':_0x2c6b8a[_0x4f87('0x10d')],'background_color':_0x2c6b8a[_0x4f87('0x10e')]}));})[_0x4f87('0x43')](handleError(_0x1b479d,null));};exports[_0x4f87('0x10f')]=function(_0x3cc692,_0x26d04a){var _0x32d95b=_0x3cc692['params']['id'];var _0x34ab80=_0x3cc692['body'];var _0x406938=0xc8;var _0x458bc6=null;return db[_0x4f87('0xd0')][_0x4f87('0xd1')]({'isolationLevel':db['sequelize']['Transaction'][_0x4f87('0x110')][_0x4f87('0x111')]},function(_0x33f66c){return db[_0x4f87('0x3e')]['findOne']({'where':{'id':_0x32d95b},'transaction':_0x33f66c})['then'](function(_0xebae92){if(_0xebae92){return db[_0x4f87('0x91')][_0x4f87('0x25')]({'where':{'ChatWebsiteId':_0x32d95b},'transaction':_0x33f66c})[_0x4f87('0x24')](function(){var _0x26f10c=_[_0x4f87('0x2d')](_0x34ab80,function(_0x3ae17b){_0x3ae17b['ChatWebsiteId']=_0x32d95b;return _0x3ae17b;});return db[_0x4f87('0x91')]['bulkCreate'](_0x26f10c,{'transaction':_0x33f66c});});}else{_0x406938=0x194;_0x458bc6=[];}});})['then'](function(){if(_0x406938!==0x194){return db[_0x4f87('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x32d95b},'order':_0x4f87('0x112')})[_0x4f87('0x24')](function(_0x26f0ab){_0x458bc6=_0x26f0ab;});}})[_0x4f87('0x43')](function(_0x406137){_0x406938=0x1f4;logger[_0x4f87('0x16')](_0x406137[_0x4f87('0x113')]);if(_0x406137[_0x4f87('0x29')]){delete _0x406137[_0x4f87('0x29')];}_0x458bc6=_0x406137;})[_0x4f87('0x114')](function(){if(_0x458bc6===null){_0x26d04a[_0x4f87('0x28')](_0x406938);}else{if(_0x406938===0x1f4){_0x26d04a['status'](_0x406938)['send'](_0x458bc6);}else{_0x26d04a['status'](_0x406938)[_0x4f87('0x1d')](_0x458bc6);}}});};exports['getApplications']=function(_0x248d5f,_0x57cafc){var _0x310a04={};var _0x279913={};var _0xb3d7ef;var _0x2095c1;return db['ChatWebsite'][_0x4f87('0x56')]({'where':{'id':_0x248d5f[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x57cafc,null))['then'](function(_0x1ece40){if(_0x1ece40){_0xb3d7ef=_0x1ece40;_0x279913[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x91')]['rawAttributes']);_0x279913[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x248d5f[_0x4f87('0x34')]);_0x279913['filters']=_[_0x4f87('0x31')](_0x279913[_0x4f87('0x30')],_0x279913[_0x4f87('0x34')]);_0x310a04[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x279913['model'],qs[_0x4f87('0x33')](_0x248d5f[_0x4f87('0x34')][_0x4f87('0x33')]));_0x310a04[_0x4f87('0x32')]=_0x310a04['attributes']['length']?_0x310a04[_0x4f87('0x32')]:_0x279913[_0x4f87('0x30')];_0x310a04[_0x4f87('0x37')]=qs[_0x4f87('0x38')](_0x248d5f[_0x4f87('0x34')][_0x4f87('0x38')]);_0x310a04['where']=qs['filters'](_[_0x4f87('0x5b')](_0x248d5f['query'],_0x279913[_0x4f87('0x3a')]));if(_0x248d5f[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x310a04[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x310a04[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x310a04[_0x4f87('0x32')],function(_0x2a3d3d){var _0x25e468={};_0x25e468[_0x2a3d3d]={'$like':'%'+_0x248d5f['query'][_0x4f87('0x3b')]+'%'};return _0x25e468;})});}_0x310a04=_['merge']({},_0x310a04,_0x248d5f['options']);return _0xb3d7ef['getApplications'](_0x310a04);}})[_0x4f87('0x24')](function(_0x2a29c3){if(_0x2a29c3){_0x2095c1=_0x2a29c3[_0x4f87('0x35')];if(!_0x248d5f[_0x4f87('0x34')][_0x4f87('0x36')](_0x4f87('0xec'))){_0x310a04[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x248d5f[_0x4f87('0x34')]['limit']);_0x310a04[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x248d5f['query'][_0x4f87('0x21')]);}return _0xb3d7ef[_0x4f87('0x115')](_0x310a04);}})[_0x4f87('0x24')](function(_0x5a10df){if(_0x5a10df){return _0x5a10df?{'count':_0x2095c1,'rows':_0x5a10df}:null;}})['then'](respondWithResult(_0x57cafc,null))[_0x4f87('0x43')](handleError(_0x57cafc,null));};exports['addProactiveActions']=function(_0x905302,_0x319eab){return db[_0x4f87('0x116')]['find']({'where':{'id':_0x905302[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x319eab,null))['then'](function(_0x264f9b){if(_0x264f9b){return _0x264f9b['addProactiveActions'](_0x905302[_0x4f87('0x4a')][_0x4f87('0x5c')],_[_0x4f87('0xea')](_0x905302[_0x4f87('0x4a')],[_0x4f87('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x319eab,null))['catch'](handleError(_0x319eab,null));};exports[_0x4f87('0xff')]=function(_0x850f22,_0x183a8c){var _0x3e6437={};var _0x23c19b={};var _0x20cfd2;var _0x482a83;return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x850f22[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x183a8c,null))[_0x4f87('0x24')](function(_0x1b4668){if(_0x1b4668){_0x20cfd2=_0x1b4668;_0x23c19b[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x117')]['rawAttributes']);_0x23c19b[_0x4f87('0x34')]=_['keys'](_0x850f22['query']);_0x23c19b['filters']=_[_0x4f87('0x31')](_0x23c19b['model'],_0x23c19b[_0x4f87('0x34')]);_0x3e6437[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x23c19b[_0x4f87('0x30')],qs['fields'](_0x850f22[_0x4f87('0x34')][_0x4f87('0x33')]));_0x3e6437[_0x4f87('0x32')]=_0x3e6437[_0x4f87('0x32')]['length']?_0x3e6437[_0x4f87('0x32')]:_0x23c19b[_0x4f87('0x30')];_0x3e6437[_0x4f87('0x37')]=qs['sort'](_0x850f22['query'][_0x4f87('0x38')]);_0x3e6437[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_[_0x4f87('0x5b')](_0x850f22[_0x4f87('0x34')],_0x23c19b['filters']));if(_0x850f22[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x3e6437[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x3e6437[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x3e6437[_0x4f87('0x32')],function(_0x5a4d19){var _0x38521b={};_0x38521b[_0x5a4d19]={'$like':'%'+_0x850f22[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x38521b;})});}_0x3e6437=_[_0x4f87('0x3c')]({},_0x3e6437,_0x850f22[_0x4f87('0x3d')]);return _0x20cfd2['getProactiveActions'](_0x3e6437);}})[_0x4f87('0x24')](function(_0x365056){if(_0x365056){_0x482a83=_0x365056[_0x4f87('0x35')];if(!_0x850f22[_0x4f87('0x34')][_0x4f87('0x36')](_0x4f87('0xec'))){_0x3e6437['limit']=qs[_0x4f87('0x1f')](_0x850f22['query'][_0x4f87('0x1f')]);_0x3e6437[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x850f22[_0x4f87('0x34')][_0x4f87('0x21')]);}return _0x20cfd2[_0x4f87('0xff')](_0x3e6437);}})['then'](function(_0x34ab19){if(_0x34ab19){return _0x34ab19?{'count':_0x482a83,'rows':_0x34ab19}:null;}})[_0x4f87('0x24')](respondWithResult(_0x183a8c,null))[_0x4f87('0x43')](handleError(_0x183a8c,null));};exports['getFields']=function(_0x3f38ca,_0x14757c){var _0x925473=_0x3f38ca[_0x4f87('0x34')][_0x4f87('0x118')]===_0x4f87('0x119')?_0x4f87('0x11a'):_0x4f87('0x11b');return db[_0x4f87('0x3e')]['find']({'attributes':['id',_0x925473],'where':{'id':_0x3f38ca[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x14757c,null))['then'](function(_0x3ab47d){if(_0x3ab47d){var _0x481c97=_0x3ab47d[_0x925473];var _0x22b34d=_0x481c97&&_0x481c97[_0x4f87('0x11c')]?_0x481c97[_0x4f87('0x11c')]:[];_0x14757c['send']({'fromKey':_[_0x4f87('0x6d')](_0x481c97['fromKey'])?undefined:_0x481c97[_0x4f87('0x11d')],'count':_0x22b34d[_0x4f87('0x35')],'rows':_0x22b34d});}})['catch'](handleError(_0x14757c,null));};exports['getOfflineMessages']=function(_0x27d6ec,_0x1e1b5d){var _0x884e73={'raw':![],'where':{}};var _0x190b94={};var _0x32879a={'count':0x0,'rows':[]};return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x27d6ec[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x1e1b5d,null))[_0x4f87('0x24')](function(_0x107b30){if(_0x107b30){_0x190b94['model']=_[_0x4f87('0x46')](db[_0x4f87('0xca')][_0x4f87('0x47')]);_0x190b94[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x27d6ec[_0x4f87('0x34')]);_0x190b94[_0x4f87('0x3a')]=_['intersection'](_0x190b94[_0x4f87('0x30')],_0x190b94['query']);_0x884e73[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x190b94[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x33')]));_0x884e73[_0x4f87('0x32')]=_0x884e73[_0x4f87('0x32')][_0x4f87('0x35')]?_0x884e73['attributes']:_0x190b94[_0x4f87('0x30')];if(!_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x36')]('nolimit')){_0x884e73[_0x4f87('0x1f')]=qs['limit'](_0x27d6ec[_0x4f87('0x34')]['limit']);_0x884e73[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x27d6ec['query']['offset']);}_0x884e73[_0x4f87('0x37')]=qs['sort'](_0x27d6ec['query'][_0x4f87('0x38')]);_0x884e73[_0x4f87('0x39')]=qs['filters'](_[_0x4f87('0x5b')](_0x27d6ec['query'],_0x190b94['filters']));_0x884e73[_0x4f87('0x39')]['ChatWebsiteId']=_0x107b30['id'];if(_0x27d6ec['query']['filter']){_0x884e73[_0x4f87('0x39')]=_['merge'](_0x884e73['where'],{'$or':_[_0x4f87('0x2d')](_0x884e73[_0x4f87('0x32')],function(_0x5ba688){var _0x4859da={};_0x4859da[_0x5ba688]={'$like':'%'+_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x4859da;})});}_0x884e73=_[_0x4f87('0x3c')]({},_0x884e73,_0x27d6ec[_0x4f87('0x3d')]);return db[_0x4f87('0xca')][_0x4f87('0x20')]({'where':_0x884e73[_0x4f87('0x39')]})[_0x4f87('0x24')](function(_0x58bb3d){_0x32879a[_0x4f87('0x20')]=_0x58bb3d;if(_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x3f')]){_0x884e73[_0x4f87('0x40')]=[{'all':!![]}];}else{_0x884e73['include']=[{'model':db['CmContact'],'as':_0x4f87('0x11e'),'required':![]},{'model':db[_0x4f87('0xd2')],'as':_0x4f87('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0x4f87('0x41')](_0x884e73);})[_0x4f87('0x24')](function(_0x4e7fc7){_0x32879a[_0x4f87('0x42')]=_0x4e7fc7;return _0x32879a;});}})['then'](respondWithFilteredResult(_0x1e1b5d,_0x884e73))[_0x4f87('0x43')](handleError(_0x1e1b5d,null));};exports['addAgents']=function(_0x1df1c6,_0x85f22a){return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x1df1c6[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x85f22a,null))[_0x4f87('0x24')](function(_0x9897a1){if(_0x9897a1){return _0x9897a1['addAgents'](_0x1df1c6[_0x4f87('0x4a')][_0x4f87('0x5c')],_['omit'](_0x1df1c6[_0x4f87('0x4a')],[_0x4f87('0x5c'),'id'])||{})[_0x4f87('0xc5')](function(_0x2dba45){for(var _0x39da50=0x0;_0x39da50<_0x1df1c6['body'][_0x4f87('0x5c')][_0x4f87('0x35')];_0x39da50+=0x1){socket[_0x4f87('0x120')](_0x4f87('0x121'),{'UserId':Number(_0x1df1c6[_0x4f87('0x4a')][_0x4f87('0x5c')][_0x39da50]),'ChatWebsiteId':Number(_0x1df1c6[_0x4f87('0x45')]['id'])});}return _0x2dba45;});}})['then'](respondWithResult(_0x85f22a,null))[_0x4f87('0x43')](handleError(_0x85f22a,null));};exports['removeAgents']=function(_0x48b2a3,_0x779ec2){return db[_0x4f87('0x3e')]['find']({'where':{'id':_0x48b2a3[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x779ec2,null))[_0x4f87('0x24')](function(_0x332e7c){if(_0x332e7c){return _0x332e7c[_0x4f87('0x122')](_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')])[_0x4f87('0x24')](function(){if(_[_0x4f87('0x123')](_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')])){for(var _0x43cb75=0x0;_0x43cb75<_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')][_0x4f87('0x35')];_0x43cb75+=0x1){socket[_0x4f87('0x120')](_0x4f87('0x124'),{'UserId':Number(_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')][_0x43cb75]),'ChatWebsiteId':Number(_0x48b2a3[_0x4f87('0x45')]['id'])});}}else{socket[_0x4f87('0x120')](_0x4f87('0x124'),{'UserId':Number(_0x48b2a3['query']['ids']),'ChatWebsiteId':Number(_0x48b2a3[_0x4f87('0x45')]['id'])});}});}})[_0x4f87('0x24')](respondWithStatusCode(_0x779ec2,null))[_0x4f87('0x43')](handleError(_0x779ec2,null));};exports['getAgents']=function(_0x12dea3,_0x451c9e){var _0x4a4df5={};var _0xa64e84={};var _0x5924c5;var _0x5f0eb1;return db[_0x4f87('0x3e')]['findOne']({'where':{'id':_0x12dea3[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x451c9e,null))[_0x4f87('0x24')](function(_0x528a6f){if(_0x528a6f){_0x5924c5=_0x528a6f;_0xa64e84[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0xb5')][_0x4f87('0x47')]);_0xa64e84[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x12dea3[_0x4f87('0x34')]);_0xa64e84[_0x4f87('0x3a')]=_[_0x4f87('0x31')](_0xa64e84[_0x4f87('0x30')],_0xa64e84['query']);_0x4a4df5[_0x4f87('0x32')]=_['intersection'](_0xa64e84[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x12dea3[_0x4f87('0x34')][_0x4f87('0x33')]));_0x4a4df5[_0x4f87('0x32')]=_0x4a4df5[_0x4f87('0x32')]['length']?_0x4a4df5[_0x4f87('0x32')]:_0xa64e84[_0x4f87('0x30')];_0x4a4df5['order']=qs[_0x4f87('0x38')](_0x12dea3[_0x4f87('0x34')][_0x4f87('0x38')]);_0x4a4df5[_0x4f87('0x39')]=qs['filters'](_[_0x4f87('0x5b')](_0x12dea3[_0x4f87('0x34')],_0xa64e84[_0x4f87('0x3a')]));if(_0x12dea3[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x4a4df5[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x4a4df5[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x4a4df5[_0x4f87('0x32')],function(_0x9356bf){var _0x3fb5b6={};_0x3fb5b6[_0x9356bf]={'$like':'%'+_0x12dea3[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x3fb5b6;})});}_0x4a4df5=_[_0x4f87('0x3c')]({},_0x4a4df5,_0x12dea3[_0x4f87('0x3d')]);return _0x5924c5[_0x4f87('0x125')](_0x4a4df5);}})[_0x4f87('0x24')](function(_0x2255a1){if(_0x2255a1){_0x5f0eb1=_0x2255a1[_0x4f87('0x35')];if(!_0x12dea3[_0x4f87('0x34')]['hasOwnProperty'](_0x4f87('0xec'))){_0x4a4df5['limit']=qs['limit'](_0x12dea3[_0x4f87('0x34')][_0x4f87('0x1f')]);_0x4a4df5[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x12dea3['query'][_0x4f87('0x21')]);}return _0x5924c5['getAgents'](_0x4a4df5);}})['then'](function(_0x49169c){if(_0x49169c){return _0x49169c?{'count':_0x5f0eb1,'rows':_0x49169c}:null;}})[_0x4f87('0x24')](respondWithResult(_0x451c9e,null))[_0x4f87('0x43')](handleError(_0x451c9e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 41c1a3a..f25068a 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 _0x1cc7=['emit','hook','exports','events','../../mysqldb','ChatWebsite','remove'];(function(_0x142210,_0x47a448){var _0x27c4b1=function(_0x561d67){while(--_0x561d67){_0x142210['push'](_0x142210['shift']());}};_0x27c4b1(++_0x47a448);}(_0x1cc7,0x15a));var _0x71cc=function(_0x303c7e,_0x619dd1){_0x303c7e=_0x303c7e-0x0;var _0x3b0e85=_0x1cc7[_0x303c7e];return _0x3b0e85;};'use strict';var EventEmitter=require(_0x71cc('0x0'));var ChatWebsite=require(_0x71cc('0x1'))['db'][_0x71cc('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x71cc('0x3')};function emitEvent(_0x1fac93){return function(_0x402191,_0x5431e1,_0x5dfed9){ChatWebsiteEvents['emit'](_0x1fac93+':'+_0x402191['id'],_0x402191);ChatWebsiteEvents[_0x71cc('0x4')](_0x1fac93,_0x402191);_0x5dfed9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x71cc('0x5')](e,emitEvent(event));}}module[_0x71cc('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1af3=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5519e0,_0xec8f68){var _0x14dfb2=function(_0x46b753){while(--_0x46b753){_0x5519e0['push'](_0x5519e0['shift']());}};_0x14dfb2(++_0xec8f68);}(_0x1af3,0x1ca));var _0x31af=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x1af3[_0x191154];return _0x3dcd73;};'use strict';var EventEmitter=require(_0x31af('0x0'));var ChatWebsite=require(_0x31af('0x1'))['db'][_0x31af('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31af('0x3')](0x0);var events={'afterCreate':_0x31af('0x4'),'afterUpdate':_0x31af('0x5'),'afterDestroy':_0x31af('0x6')};function emitEvent(_0x1a6ea6){return function(_0x3d64ae,_0xc098ee,_0x4f989c){ChatWebsiteEvents[_0x31af('0x7')](_0x1a6ea6+':'+_0x3d64ae['id'],_0x3d64ae);ChatWebsiteEvents[_0x31af('0x7')](_0x1a6ea6,_0x3d64ae);_0x4f989c(null);};}for(var e in events){if(events[_0x31af('0x8')](e)){var event=events[e];ChatWebsite[_0x31af('0x9')](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 86d2a79..5f62fac 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 _0x0a4a=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3a412f,_0x1634db){var _0x41ddbf=function(_0x1a8737){while(--_0x1a8737){_0x3a412f['push'](_0x3a412f['shift']());}};_0x41ddbf(++_0x1634db);}(_0x0a4a,0x1ab));var _0xa0a4=function(_0x1bacb2,_0x3362fc){_0x1bacb2=_0x1bacb2-0x0;var _0x80294b=_0x0a4a[_0x1bacb2];return _0x80294b;};'use strict';var _=require(_0xa0a4('0x0'));var util=require(_0xa0a4('0x1'));var logger=require(_0xa0a4('0x2'))('api');var moment=require(_0xa0a4('0x3'));var BPromise=require(_0xa0a4('0x4'));var rp=require(_0xa0a4('0x5'));var fs=require('fs');var path=require(_0xa0a4('0x6'));var rimraf=require('rimraf');var config=require(_0xa0a4('0x7'));var attributes=require(_0xa0a4('0x8'));module[_0xa0a4('0x9')]=function(_0x1d01f6,_0x584e64){return _0x1d01f6[_0xa0a4('0xa')]('ChatWebsite',attributes,{'tableName':_0xa0a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43c9=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x43c9,0x128));var _0x943c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x943c('0x0'));var util=require(_0x943c('0x1'));var logger=require(_0x943c('0x2'))(_0x943c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x943c('0x4'));var fs=require('fs');var path=require(_0x943c('0x5'));var rimraf=require('rimraf');var config=require(_0x943c('0x6'));var attributes=require(_0x943c('0x7'));module[_0x943c('0x8')]=function(_0x17906f,_0x25b4a1){return _0x17906f[_0x943c('0x9')](_0x943c('0xa'),attributes,{'tableName':_0x943c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 65ec288..b7fc6c3 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 _0x670a=['localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0xf8ef96,_0x5f0b18){var _0x36cb2b=function(_0x57b796){while(--_0x57b796){_0xf8ef96['push'](_0xf8ef96['shift']());}};_0x36cb2b(++_0x5f0b18);}(_0x670a,0x15e));var _0xa670=function(_0x1c3a19,_0x1ea1da){_0x1c3a19=_0x1c3a19-0x0;var _0xf36c1=_0x670a[_0x1c3a19];return _0xf36c1;};'use strict';var _=require(_0xa670('0x0'));var util=require(_0xa670('0x1'));var moment=require(_0xa670('0x2'));var BPromise=require(_0xa670('0x3'));var rs=require(_0xa670('0x4'));var fs=require('fs');var Redis=require(_0xa670('0x5'));var db=require(_0xa670('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa670('0x7'));var config=require(_0xa670('0x8'));var jayson=require(_0xa670('0x9'));var client=jayson[_0xa670('0xa')][_0xa670('0xb')]({'port':0x232a});config[_0xa670('0xc')]=_[_0xa670('0xd')](config[_0xa670('0xc')],{'host':_0xa670('0xe'),'port':0x18eb});var socket=require(_0xa670('0xf'))(new Redis(config[_0xa670('0xc')]));require(_0xa670('0x10'))['register'](socket);function respondWithRpcPromise(_0x39fb87,_0x13f19e,_0x562c6e){return new BPromise(function(_0x121bee,_0x46798a){return client[_0xa670('0x11')](_0x39fb87,_0x562c6e)[_0xa670('0x12')](function(_0x4d61ae){logger[_0xa670('0x13')](_0xa670('0x14'),_0x13f19e,_0xa670('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x13f19e,_0xa670('0x15'),JSON[_0xa670('0x16')](_0x4d61ae));if(_0x4d61ae['error']){if(_0x4d61ae['error'][_0xa670('0x17')]===0x1f4){logger[_0xa670('0x18')](_0xa670('0x14'),_0x13f19e,_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);return _0x46798a(_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);}logger['error'](_0xa670('0x14'),_0x13f19e,_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);return _0x121bee(_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);}else{logger['info'](_0xa670('0x14'),_0x13f19e,'request\x20sent');_0x121bee(_0x4d61ae[_0xa670('0x1a')][_0xa670('0x19')]);}})[_0xa670('0x1b')](function(_0x54b5fb){logger[_0xa670('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x13f19e,_0x54b5fb);_0x46798a(_0x54b5fb);});});} \ No newline at end of file +var _0xe000=['then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x114463,_0xbe6dd9){var _0x138c9a=function(_0x487413){while(--_0x487413){_0x114463['push'](_0x114463['shift']());}};_0x138c9a(++_0xbe6dd9);}(_0xe000,0xcf));var _0x0e00=function(_0x57a35a,_0x7eb9b1){_0x57a35a=_0x57a35a-0x0;var _0x4abe87=_0xe000[_0x57a35a];return _0x4abe87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e00('0x0'));var BPromise=require(_0x0e00('0x1'));var rs=require(_0x0e00('0x2'));var fs=require('fs');var Redis=require(_0x0e00('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e00('0x4'));var logger=require(_0x0e00('0x5'))(_0x0e00('0x6'));var config=require(_0x0e00('0x7'));var jayson=require(_0x0e00('0x8'));var client=jayson['client'][_0x0e00('0x9')]({'port':0x232a});config['redis']=_[_0x0e00('0xa')](config[_0x0e00('0xb')],{'host':_0x0e00('0xc'),'port':0x18eb});var socket=require(_0x0e00('0xd'))(new Redis(config[_0x0e00('0xb')]));require(_0x0e00('0xe'))[_0x0e00('0xf')](socket);function respondWithRpcPromise(_0x3ae47b,_0x17a66c,_0x313991){return new BPromise(function(_0x1f687b,_0x495f09){return client[_0x0e00('0x10')](_0x3ae47b,_0x313991)[_0x0e00('0x11')](function(_0x26f776){logger['info'](_0x0e00('0x12'),_0x17a66c,_0x0e00('0x13'));logger[_0x0e00('0x14')](_0x0e00('0x15'),_0x17a66c,_0x0e00('0x13'),JSON[_0x0e00('0x16')](_0x26f776));if(_0x26f776[_0x0e00('0x17')]){if(_0x26f776['error']['code']===0x1f4){logger[_0x0e00('0x17')](_0x0e00('0x12'),_0x17a66c,_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);return _0x495f09(_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);}logger[_0x0e00('0x17')](_0x0e00('0x12'),_0x17a66c,_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);return _0x1f687b(_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);}else{logger[_0x0e00('0x19')](_0x0e00('0x12'),_0x17a66c,_0x0e00('0x13'));_0x1f687b(_0x26f776[_0x0e00('0x1a')][_0x0e00('0x18')]);}})[_0x0e00('0x1b')](function(_0x82a407){logger[_0x0e00('0x17')](_0x0e00('0x12'),_0x17a66c,_0x82a407);_0x495f09(_0x82a407);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 1304874..d7c602c 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 _0xe9e9=['update','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x529d21,_0x192e46){var _0x5dd275=function(_0x16b59a){while(--_0x16b59a){_0x529d21['push'](_0x529d21['shift']());}};_0x5dd275(++_0x192e46);}(_0xe9e9,0x1d2));var _0x9e9e=function(_0x490515,_0x180324){_0x490515=_0x490515-0x0;var _0x45a918=_0xe9e9[_0x490515];return _0x45a918;};'use strict';var ChatWebsiteEvents=require(_0x9e9e('0x0'));var events=[_0x9e9e('0x1'),_0x9e9e('0x2'),_0x9e9e('0x3')];function createListener(_0x418718,_0x29ed10){return function(_0xaff2bc){_0x29ed10['emit'](_0x418718,_0xaff2bc);};}function removeListener(_0x528439,_0xa4ef7){return function(){ChatWebsiteEvents['removeListener'](_0x528439,_0xa4ef7);};}exports[_0x9e9e('0x4')]=function(_0x223a6c){for(var _0x44b4f2=0x0,_0x18880a=events[_0x9e9e('0x5')];_0x44b4f2<_0x18880a;_0x44b4f2++){var _0x54bc0c=events[_0x44b4f2];var _0x171897=createListener(_0x9e9e('0x6')+_0x54bc0c,_0x223a6c);ChatWebsiteEvents['on'](_0x54bc0c,_0x171897);}}; \ No newline at end of file +var _0x0c06=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x2cf887,_0x3ff497){var _0x197ecc=function(_0x113de6){while(--_0x113de6){_0x2cf887['push'](_0x2cf887['shift']());}};_0x197ecc(++_0x3ff497);}(_0x0c06,0xbb));var _0x60c0=function(_0x1c2c64,_0x267d8e){_0x1c2c64=_0x1c2c64-0x0;var _0x23a68c=_0x0c06[_0x1c2c64];return _0x23a68c;};'use strict';var ChatWebsiteEvents=require(_0x60c0('0x0'));var events=[_0x60c0('0x1'),_0x60c0('0x2'),_0x60c0('0x3')];function createListener(_0x4a17c5,_0x10a1c2){return function(_0x1d4ebd){_0x10a1c2['emit'](_0x4a17c5,_0x1d4ebd);};}function removeListener(_0x5f5ccd,_0x50b4a6){return function(){ChatWebsiteEvents[_0x60c0('0x4')](_0x5f5ccd,_0x50b4a6);};}exports[_0x60c0('0x5')]=function(_0x566015){for(var _0x32de75=0x0,_0x4e449f=events[_0x60c0('0x6')];_0x32de75<_0x4e449f;_0x32de75++){var _0x1ea3b7=events[_0x32de75];var _0x2c4355=createListener(_0x60c0('0x7')+_0x1ea3b7,_0x566015);ChatWebsiteEvents['on'](_0x1ea3b7,_0x2c4355);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 9760045..fe44320 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 _0x574e=['/:id/applications','getApplications','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now','originalname','file','addLogo','join','format','single','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet'];(function(_0xde59d0,_0x2c0517){var _0x759330=function(_0x2922ad){while(--_0x2922ad){_0xde59d0['push'](_0xde59d0['shift']());}};_0x759330(++_0x2c0517);}(_0x574e,0x1db));var _0xe574=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x574e[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xe574('0x0'));var util=require(_0xe574('0x1'));var path=require(_0xe574('0x2'));var timeout=require(_0xe574('0x3'));var express=require(_0xe574('0x4'));var router=express['Router']();var fs_extra=require(_0xe574('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe574('0x6'));var config=require(_0xe574('0x7'));var controller=require(_0xe574('0x8'));router['get']('/',auth[_0xe574('0x9')](),controller[_0xe574('0xa')]);router[_0xe574('0xb')](_0xe574('0xc'),auth[_0xe574('0x9')](),controller[_0xe574('0xd')]);router[_0xe574('0xb')](_0xe574('0xe'),auth['isAuthenticated'](),controller[_0xe574('0xf')]);router[_0xe574('0xb')](_0xe574('0x10'),auth[_0xe574('0x9')](),controller[_0xe574('0x11')]);router[_0xe574('0xb')](_0xe574('0x12'),auth[_0xe574('0x9')](),controller[_0xe574('0x13')]);router['get'](_0xe574('0x14'),controller[_0xe574('0x15')]);router[_0xe574('0xb')](_0xe574('0x16'),controller[_0xe574('0x17')]);router[_0xe574('0xb')](_0xe574('0x18'),controller['getCustomerAvatar']);router[_0xe574('0xb')]('/:id/system_avatar',controller[_0xe574('0x19')]);router[_0xe574('0xb')](_0xe574('0x1a'),auth[_0xe574('0x9')](),controller[_0xe574('0x1b')]);router['get']('/:id/snippet',controller[_0xe574('0x1c')]);router[_0xe574('0xb')](_0xe574('0x1d'),auth[_0xe574('0x9')](),controller[_0xe574('0x1e')]);router[_0xe574('0xb')]('/:id/proactive_actions',auth[_0xe574('0x9')](),controller['getProactiveActions']);router[_0xe574('0xb')](_0xe574('0x1f'),controller[_0xe574('0x20')]);router[_0xe574('0xb')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xe574('0xb')](_0xe574('0x21'),auth[_0xe574('0x9')](),controller[_0xe574('0x22')]);router[_0xe574('0x23')]('/',auth[_0xe574('0x9')](),controller[_0xe574('0x24')]);router['post'](_0xe574('0x10'),auth['isAuthenticated'](),controller[_0xe574('0x25')]);router[_0xe574('0x23')](_0xe574('0x12'),auth[_0xe574('0x9')](),controller[_0xe574('0x26')]);var upload=multer({'storage':multer[_0xe574('0x27')]({'destination':function(_0x2bb26c,_0x2db9e1,_0x397632){_0x397632(null,path['join'](config[_0xe574('0x28')],'server/files/images/logos/'));},'filename':function(_0x3f12f1,_0x3fce26,_0x1e3909){_0x1e3909(null,util['format'](_0xe574('0x29'),Date[_0xe574('0x2a')](),_0x3fce26[_0xe574('0x2b')]));}})});router[_0xe574('0x23')]('/:id/logo',upload['single'](_0xe574('0x2c')),controller[_0xe574('0x2d')]);var upload=multer({'storage':multer[_0xe574('0x27')]({'destination':function(_0x1ca1d0,_0x461bff,_0x28aa2a){_0x28aa2a(null,path[_0xe574('0x2e')](config[_0xe574('0x28')],'server/files/images/avatars/'));},'filename':function(_0x57458f,_0x1a6909,_0x550602){_0x550602(null,util[_0xe574('0x2f')]('%s-%s',Date[_0xe574('0x2a')](),_0x1a6909['originalname']));}})});router[_0xe574('0x23')](_0xe574('0x16'),upload[_0xe574('0x30')](_0xe574('0x2c')),controller[_0xe574('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5261dc,_0x3755f3,_0x439ea2){_0x439ea2(null,path[_0xe574('0x2e')](config[_0xe574('0x28')],_0xe574('0x32')));},'filename':function(_0x41bcb2,_0x458c3e,_0x418e4a){_0x418e4a(null,util[_0xe574('0x2f')](_0xe574('0x29'),Date[_0xe574('0x2a')](),_0x458c3e['originalname']));}})});router[_0xe574('0x23')](_0xe574('0x18'),upload[_0xe574('0x30')](_0xe574('0x2c')),controller[_0xe574('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42347c,_0x12079f,_0x57d016){_0x57d016(null,path[_0xe574('0x2e')](config[_0xe574('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3f69fe,_0x425a46,_0x4b45a2){_0x4b45a2(null,util[_0xe574('0x2f')]('%s-%s',Date[_0xe574('0x2a')](),_0x425a46[_0xe574('0x2b')]));}})});router[_0xe574('0x23')](_0xe574('0x34'),upload[_0xe574('0x30')](_0xe574('0x2c')),controller[_0xe574('0x35')]);router[_0xe574('0x23')](_0xe574('0x36'),controller[_0xe574('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xe574('0x27')]({'destination':function(_0x3f280f,_0x4fb14f,_0x47fd83){const _0x33c1f5=path[_0xe574('0x2e')](config[_0xe574('0x28')],_0xe574('0x38'),'attachments',_0xe574('0x39'));fs_extra['ensureDir'](_0x33c1f5,function(){_0x47fd83(null,_0x33c1f5);});},'filename':function(_0x4ee541,_0x3c1ab8,_0x280e4c){const _0x2933b4=_0x3c1ab8['originalname'][_0xe574('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2e5ddc=path['extname'](_0x2933b4);const _0xdff715=Date[_0xe574('0x2a')]()+'-'+_0x2933b4['replace'](_0x2e5ddc,'')+_0x2e5ddc;_0x280e4c(null,_0xdff715);}})});router['post'](_0xe574('0x3b'),offlineUploadMulter[_0xe574('0x3c')](),controller[_0xe574('0x3d')]);router[_0xe574('0x23')](_0xe574('0x1a'),auth[_0xe574('0x9')](),controller[_0xe574('0x3e')]);router[_0xe574('0x23')]('/:id/applications',auth[_0xe574('0x9')](),controller[_0xe574('0x3f')]);router[_0xe574('0x23')](_0xe574('0x40'),auth[_0xe574('0x9')](),controller['addProactiveActions']);router[_0xe574('0x23')](_0xe574('0x21'),auth[_0xe574('0x9')](),controller[_0xe574('0x41')]);router[_0xe574('0x42')](_0xe574('0xe'),auth['isAuthenticated'](),controller[_0xe574('0x43')]);router[_0xe574('0x44')](_0xe574('0xe'),auth[_0xe574('0x9')](),controller['destroy']);router[_0xe574('0x44')](_0xe574('0x10'),auth[_0xe574('0x9')](),controller[_0xe574('0x45')]);router[_0xe574('0x44')](_0xe574('0x12'),auth[_0xe574('0x9')](),controller[_0xe574('0x46')]);router[_0xe574('0x44')]('/:id/users',auth[_0xe574('0x9')](),controller[_0xe574('0x47')]);module['exports']=router; \ No newline at end of file +var _0x3813=['put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','getAgents','create','post','addDisposition','diskStorage','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','join','server/files/images/avatars/','format','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','/:id/users'];(function(_0x15b78c,_0x364a98){var _0x46804e=function(_0x15b153){while(--_0x15b153){_0x15b78c['push'](_0x15b78c['shift']());}};_0x46804e(++_0x364a98);}(_0x3813,0xe3));var _0x3381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3813[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3381('0x0'));var util=require('util');var path=require(_0x3381('0x1'));var timeout=require(_0x3381('0x2'));var express=require(_0x3381('0x3'));var router=express[_0x3381('0x4')]();var fs_extra=require(_0x3381('0x5'));var auth=require(_0x3381('0x6'));var interaction=require(_0x3381('0x7'));var config=require(_0x3381('0x8'));var controller=require('./chatWebsite.controller');router[_0x3381('0x9')]('/',auth[_0x3381('0xa')](),controller[_0x3381('0xb')]);router['get'](_0x3381('0xc'),auth['isAuthenticated'](),controller[_0x3381('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3381('0xe')]);router['get'](_0x3381('0xf'),auth[_0x3381('0xa')](),controller[_0x3381('0x10')]);router[_0x3381('0x9')](_0x3381('0x11'),auth['isAuthenticated'](),controller[_0x3381('0x12')]);router['get'](_0x3381('0x13'),controller[_0x3381('0x14')]);router[_0x3381('0x9')]('/:id/avatar',controller[_0x3381('0x15')]);router['get'](_0x3381('0x16'),controller[_0x3381('0x17')]);router[_0x3381('0x9')](_0x3381('0x18'),controller[_0x3381('0x19')]);router[_0x3381('0x9')](_0x3381('0x1a'),auth['isAuthenticated'](),controller[_0x3381('0x1b')]);router[_0x3381('0x9')](_0x3381('0x1c'),controller[_0x3381('0x1d')]);router['get'](_0x3381('0x1e'),auth['isAuthenticated'](),controller['getApplications']);router[_0x3381('0x9')](_0x3381('0x1f'),auth['isAuthenticated'](),controller[_0x3381('0x20')]);router[_0x3381('0x9')](_0x3381('0x21'),controller['getFields']);router[_0x3381('0x9')]('/:id/offline_messages',auth[_0x3381('0xa')](),controller[_0x3381('0x22')]);router['get']('/:id/users',auth[_0x3381('0xa')](),controller[_0x3381('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3381('0x24')]);router[_0x3381('0x25')](_0x3381('0xf'),auth[_0x3381('0xa')](),controller[_0x3381('0x26')]);router[_0x3381('0x25')]('/:id/canned_answers',auth[_0x3381('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x3381('0x27')]({'destination':function(_0x327aed,_0x2ebef0,_0x45f47b){_0x45f47b(null,path['join'](config[_0x3381('0x28')],_0x3381('0x29')));},'filename':function(_0x3fb94d,_0x19633e,_0x27da98){_0x27da98(null,util['format'](_0x3381('0x2a'),Date['now'](),_0x19633e[_0x3381('0x2b')]));}})});router['post']('/:id/logo',upload[_0x3381('0x2c')](_0x3381('0x2d')),controller[_0x3381('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1944eb,_0x269677,_0x1ec20d){_0x1ec20d(null,path[_0x3381('0x2f')](config[_0x3381('0x28')],_0x3381('0x30')));},'filename':function(_0x4fbc74,_0x142110,_0x3708b8){_0x3708b8(null,util[_0x3381('0x31')]('%s-%s',Date[_0x3381('0x32')](),_0x142110[_0x3381('0x2b')]));}})});router['post'](_0x3381('0x33'),upload[_0x3381('0x2c')]('file'),controller[_0x3381('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51fa7d,_0x1d1b01,_0x57fd0e){_0x57fd0e(null,path[_0x3381('0x2f')](config[_0x3381('0x28')],_0x3381('0x30')));},'filename':function(_0x1b0c68,_0xce7641,_0x580d95){_0x580d95(null,util[_0x3381('0x31')](_0x3381('0x2a'),Date['now'](),_0xce7641[_0x3381('0x2b')]));}})});router[_0x3381('0x25')]('/:id/customer_avatar',upload[_0x3381('0x2c')](_0x3381('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3381('0x27')]({'destination':function(_0x15ab31,_0x343201,_0x2461c8){_0x2461c8(null,path['join'](config[_0x3381('0x28')],_0x3381('0x30')));},'filename':function(_0x38cb4b,_0x36fe4f,_0x4f077e){_0x4f077e(null,util[_0x3381('0x31')](_0x3381('0x2a'),Date[_0x3381('0x32')](),_0x36fe4f[_0x3381('0x2b')]));}})});router['post'](_0x3381('0x18'),upload[_0x3381('0x2c')](_0x3381('0x2d')),controller[_0x3381('0x35')]);router['post'](_0x3381('0x36'),controller[_0x3381('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x3381('0x27')]({'destination':function(_0x2ec737,_0x553ac9,_0x515266){const _0x4f3a7c=path[_0x3381('0x2f')](config[_0x3381('0x28')],'server/files',_0x3381('0x38'),_0x3381('0x39'));fs_extra[_0x3381('0x3a')](_0x4f3a7c,function(){_0x515266(null,_0x4f3a7c);});},'filename':function(_0x303705,_0x5e9cd7,_0x25c157){const _0x18b42c=_0x5e9cd7['originalname'][_0x3381('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5d6112=path['extname'](_0x18b42c);const _0x54ca8f=Date[_0x3381('0x32')]()+'-'+_0x18b42c[_0x3381('0x3b')](_0x5d6112,'')+_0x5d6112;_0x25c157(null,_0x54ca8f);}})});router[_0x3381('0x25')](_0x3381('0x3c'),offlineUploadMulter['any'](),controller[_0x3381('0x3d')]);router[_0x3381('0x25')](_0x3381('0x1a'),auth[_0x3381('0xa')](),controller['addInteraction']);router[_0x3381('0x25')](_0x3381('0x1e'),auth['isAuthenticated'](),controller[_0x3381('0x3e')]);router[_0x3381('0x25')](_0x3381('0x1f'),auth['isAuthenticated'](),controller[_0x3381('0x3f')]);router[_0x3381('0x25')](_0x3381('0x40'),auth[_0x3381('0xa')](),controller['addAgents']);router[_0x3381('0x41')](_0x3381('0x42'),auth[_0x3381('0xa')](),controller[_0x3381('0x43')]);router[_0x3381('0x44')]('/:id',auth[_0x3381('0xa')](),controller[_0x3381('0x45')]);router[_0x3381('0x44')]('/:id/dispositions',auth[_0x3381('0xa')](),controller[_0x3381('0x46')]);router[_0x3381('0x44')](_0x3381('0x11'),auth[_0x3381('0xa')](),controller['removeAnswers']);router[_0x3381('0x44')](_0x3381('0x40'),auth[_0x3381('0xa')](),controller[_0x3381('0x47')]);module[_0x3381('0x48')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index f7d7f37..5a0eab3 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 _0xa002=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xca909d,_0x389ce3){var _0x3f5682=function(_0x2e5e06){while(--_0x2e5e06){_0xca909d['push'](_0xca909d['shift']());}};_0x3f5682(++_0x389ce3);}(_0xa002,0xc8));var _0x2a00=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa002[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x2a00('0x0'));module[_0x2a00('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2a00('0x2')](_0x2a00('0x3'),'Google',_0x2a00('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2a00('0x2')](_0x2a00('0x5'),_0x2a00('0x6'))},'data1':{'type':Sequelize[_0x2a00('0x7')],'comment':_0x2a00('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x2a00('0x7')],'comment':_0x2a00('0x9')},'data4':{'type':Sequelize[_0x2a00('0x7')],'comment':_0x2a00('0xa')},'data5':{'type':Sequelize[_0x2a00('0xb')],'comment':_0x2a00('0xc')},'data6':{'type':Sequelize[_0x2a00('0xb')],'comment':_0x2a00('0xd')},'data7':{'type':Sequelize[_0x2a00('0xb')],'comment':_0x2a00('0xe')}}; \ No newline at end of file +var _0xa311=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','exports','STRING','ENUM','Google'];(function(_0x5c5366,_0x57f3d8){var _0x28db22=function(_0x4fa327){while(--_0x4fa327){_0x5c5366['push'](_0x5c5366['shift']());}};_0x28db22(++_0x57f3d8);}(_0xa311,0x8c));var _0x1a31=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0xa311[_0x401676];return _0x4f13fe;};'use strict';var Sequelize=require('sequelize');module[_0x1a31('0x0')]={'name':{'type':Sequelize[_0x1a31('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1a31('0x2')]('AmazonAWS',_0x1a31('0x3'),_0x1a31('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1a31('0x2')](_0x1a31('0x5'),_0x1a31('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x1a31('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x1a31('0x8')},'data3':{'type':Sequelize[_0x1a31('0x1')],'comment':_0x1a31('0x9')},'data4':{'type':Sequelize[_0x1a31('0x1')],'comment':_0x1a31('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x1a31('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x1a31('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index de16ca2..fcbe849 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 _0xde31=['query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','rawAttributes','keys','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','update','destroy','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','error','stack','name','send','index','CloudProvider','type','key'];(function(_0x5afcbc,_0x98df37){var _0x469714=function(_0xc519fb){while(--_0xc519fb){_0x5afcbc['push'](_0x5afcbc['shift']());}};_0x469714(++_0x98df37);}(_0xde31,0x103));var _0x1de3=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xde31[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x1de3('0x0'));var Redis=require(_0x1de3('0x1'));var qs=require(_0x1de3('0x2'));var encryptor=require(_0x1de3('0x3'));var config=require(_0x1de3('0x4'));var logger=require(_0x1de3('0x5'))(_0x1de3('0x6'));var db=require(_0x1de3('0x7'))['db'];var oauth=require(_0x1de3('0x8'));config[_0x1de3('0x9')]=_[_0x1de3('0xa')](config[_0x1de3('0x9')],{'host':_0x1de3('0xb'),'port':0x18eb});var socket=require(_0x1de3('0xc'))(new Redis(config['redis']));var redis=new Redis(config[_0x1de3('0x9')]);function respondWithStatusCode(_0x172a02,_0x94af5d){_0x94af5d=_0x94af5d||0xcc;return function(_0x10d33d){if(_0x10d33d){return _0x172a02[_0x1de3('0xd')](_0x94af5d);}return _0x172a02[_0x1de3('0xe')](_0x94af5d)[_0x1de3('0xf')]();};}function respondWithResult(_0x36fb97,_0x53bf71){_0x53bf71=_0x53bf71||0xc8;return function(_0x1e8a40){if(_0x1e8a40){return _0x36fb97[_0x1de3('0xe')](_0x53bf71)[_0x1de3('0x10')](_0x1e8a40);}};}function respondWithFilteredResult(_0x53964c,_0x185fc1){return function(_0x1f2fe5){if(_0x1f2fe5){var _0x13c915=typeof _0x185fc1[_0x1de3('0x11')]===_0x1de3('0x12')&&typeof _0x185fc1[_0x1de3('0x13')]==='undefined';var _0x46cae2=_0x1f2fe5['count'];var _0x2ac503=_0x13c915?0x0:_0x185fc1['offset'];var _0x42baa0=_0x13c915?_0x1f2fe5[_0x1de3('0x14')]:_0x185fc1[_0x1de3('0x11')]+_0x185fc1[_0x1de3('0x13')];var _0x17965b;if(_0x42baa0>=_0x46cae2){_0x42baa0=_0x46cae2;_0x17965b=0xc8;}else{_0x17965b=0xce;}_0x53964c[_0x1de3('0xe')](_0x17965b);return _0x53964c[_0x1de3('0x15')](_0x1de3('0x16'),_0x2ac503+'-'+_0x42baa0+'/'+_0x46cae2)[_0x1de3('0x10')](_0x1f2fe5);}return null;};}function saveUpdates(_0xdd1967){return function(_0x14374a){if(_0x14374a){return _0x14374a['update'](_0xdd1967)[_0x1de3('0x17')](function(_0x462acf){return _0x462acf;});}return null;};}function removeEntity(_0x4609c7){return function(_0x9fbbc2){if(_0x9fbbc2){return _0x9fbbc2['destroy']()[_0x1de3('0x17')](function(){_0x4609c7[_0x1de3('0xe')](0xcc)[_0x1de3('0xf')]();});}};}function handleEntityNotFound(_0x52db9e){return function(_0x4aab3e){if(!_0x4aab3e){_0x52db9e['sendStatus'](0x194);}return _0x4aab3e;};}function handleError(_0x25ae6b,_0x4cb6f1){_0x4cb6f1=_0x4cb6f1||0x1f4;return function(_0x204b89){logger[_0x1de3('0x18')](_0x204b89[_0x1de3('0x19')]);if(_0x204b89[_0x1de3('0x1a')]){delete _0x204b89[_0x1de3('0x1a')];}_0x25ae6b[_0x1de3('0xe')](_0x4cb6f1)[_0x1de3('0x1b')](_0x204b89);};}function maskClientSecret(_0x332802){return _['padEnd'](_0x332802['slice'](0x0,0x3),0x14,'*');}exports[_0x1de3('0x1c')]=function(_0x542b5c,_0x54b847){var _0x58c563={},_0x58272e={},_0x4c9875={'count':0x0,'rows':[]};var _0x39c159=_['map'](db[_0x1de3('0x1d')]['rawAttributes'],function(_0xbb0ff1){return{'name':_0xbb0ff1['fieldName'],'type':_0xbb0ff1[_0x1de3('0x1e')][_0x1de3('0x1f')]};});_0x58272e['model']=_['map'](_0x39c159,'name');_0x58272e[_0x1de3('0x20')]=_['keys'](_0x542b5c[_0x1de3('0x20')]);_0x58272e['filters']=_[_0x1de3('0x21')](_0x58272e[_0x1de3('0x22')],_0x58272e[_0x1de3('0x20')]);_0x58c563['attributes']=_[_0x1de3('0x21')](_0x58272e[_0x1de3('0x22')],qs['fields'](_0x542b5c[_0x1de3('0x20')][_0x1de3('0x23')]));_0x58c563[_0x1de3('0x24')]=_0x58c563[_0x1de3('0x24')][_0x1de3('0x25')]?_0x58c563[_0x1de3('0x24')]:_0x58272e['model'];if(!_0x542b5c['query'][_0x1de3('0x26')](_0x1de3('0x27'))){_0x58c563['limit']=qs[_0x1de3('0x13')](_0x542b5c[_0x1de3('0x20')][_0x1de3('0x13')]);_0x58c563[_0x1de3('0x11')]=qs[_0x1de3('0x11')](_0x542b5c['query']['offset']);}_0x58c563[_0x1de3('0x28')]=qs[_0x1de3('0x29')](_0x542b5c['query'][_0x1de3('0x29')]);_0x58c563[_0x1de3('0x2a')]=qs[_0x1de3('0x2b')](_[_0x1de3('0x2c')](_0x542b5c['query'],_0x58272e[_0x1de3('0x2b')]),_0x39c159);if(_0x542b5c[_0x1de3('0x20')][_0x1de3('0x2d')]){_0x58c563['where']=_[_0x1de3('0x2e')](_0x58c563[_0x1de3('0x2a')],{'$or':_[_0x1de3('0x2f')](_0x39c159,function(_0x49d13c){if(_0x49d13c[_0x1de3('0x1e')]!==_0x1de3('0x30')){var _0x4430bf={};_0x4430bf[_0x49d13c[_0x1de3('0x1a')]]={'$like':'%'+_0x542b5c[_0x1de3('0x20')][_0x1de3('0x2d')]+'%'};return _0x4430bf;}})});}_0x58c563=_['merge']({},_0x58c563,_0x542b5c[_0x1de3('0x31')]);var _0x492086={'where':_0x58c563[_0x1de3('0x2a')]};return db[_0x1de3('0x1d')][_0x1de3('0x14')](_0x492086)[_0x1de3('0x17')](function(_0x1995f5){_0x4c9875[_0x1de3('0x14')]=_0x1995f5;if(_0x542b5c[_0x1de3('0x20')][_0x1de3('0x32')]){_0x58c563[_0x1de3('0x33')]=[{'all':!![]}];}return db[_0x1de3('0x1d')][_0x1de3('0x34')](_0x58c563);})[_0x1de3('0x17')](function(_0x1fac7c){_0x4c9875[_0x1de3('0x35')]=_['map'](_0x1fac7c,function(_0x13109b){if(_0x13109b[_0x1de3('0x36')]===_0x1de3('0x37')){var _0x1bcae9=encryptor[_0x1de3('0x38')](_0x13109b[_0x1de3('0x39')]);_0x13109b[_0x1de3('0x39')]=maskClientSecret(_0x1bcae9);}return _0x13109b;});return _0x4c9875;})[_0x1de3('0x17')](respondWithFilteredResult(_0x54b847,_0x58c563))['catch'](handleError(_0x54b847,null));};exports[_0x1de3('0x3a')]=function(_0x27d179,_0x5467ac){var _0x3a12de={'raw':!![],'where':{'id':_0x27d179[_0x1de3('0x3b')]['id']}},_0x542d7e={};_0x542d7e['model']=_['keys'](db[_0x1de3('0x1d')][_0x1de3('0x3c')]);_0x542d7e['query']=_[_0x1de3('0x3d')](_0x27d179[_0x1de3('0x20')]);_0x542d7e['filters']=_[_0x1de3('0x21')](_0x542d7e['model'],_0x542d7e[_0x1de3('0x20')]);_0x3a12de['attributes']=_[_0x1de3('0x21')](_0x542d7e['model'],qs[_0x1de3('0x23')](_0x27d179[_0x1de3('0x20')][_0x1de3('0x23')]));_0x3a12de[_0x1de3('0x24')]=_0x3a12de[_0x1de3('0x24')][_0x1de3('0x25')]?_0x3a12de[_0x1de3('0x24')]:_0x542d7e[_0x1de3('0x22')];if(_0x27d179[_0x1de3('0x20')]['includeAll']){_0x3a12de[_0x1de3('0x33')]=[{'all':!![]}];}_0x3a12de=_[_0x1de3('0x2e')]({},_0x3a12de,_0x27d179[_0x1de3('0x31')]);return db[_0x1de3('0x1d')][_0x1de3('0x3e')](_0x3a12de)['then'](handleEntityNotFound(_0x5467ac,null))['then'](function(_0x5722d5){if(_0x5722d5[_0x1de3('0x36')]===_0x1de3('0x37')){var _0x143165=encryptor[_0x1de3('0x38')](_0x5722d5['data3']);_0x5722d5[_0x1de3('0x39')]=maskClientSecret(_0x143165);}return _0x5722d5;})[_0x1de3('0x17')](respondWithResult(_0x5467ac,null))['catch'](handleError(_0x5467ac,null));};exports[_0x1de3('0x3f')]=function(_0x334487,_0x4bbe65){if(!_0x334487[_0x1de3('0x40')][_0x1de3('0x1a')])throw new Error(_0x1de3('0x41'));if(!_0x334487[_0x1de3('0x40')][_0x1de3('0x36')])throw new Error(_0x1de3('0x42'));var _0x234828=db[_0x1de3('0x1d')][_0x1de3('0x3c')][_0x1de3('0x36')][_0x1de3('0x43')];if(!_0x234828[_0x1de3('0x44')](_0x334487[_0x1de3('0x40')][_0x1de3('0x36')]))throw new Error(_0x1de3('0x45')+_0x234828[_0x1de3('0x46')](',\x20'));if(_0x334487[_0x1de3('0x40')]['service']===_0x1de3('0x37')&&_0x334487[_0x1de3('0x40')]['data3']){_0x334487[_0x1de3('0x40')][_0x1de3('0x39')]=encryptor[_0x1de3('0x47')](_0x334487[_0x1de3('0x40')]['data3']);}return db[_0x1de3('0x1d')][_0x1de3('0x3f')](_0x334487[_0x1de3('0x40')],{})['then'](respondWithResult(_0x4bbe65,0xc9))[_0x1de3('0x48')](handleError(_0x4bbe65,null));};exports[_0x1de3('0x49')]=function(_0x3e0e56,_0x3c0958){if(_0x3e0e56[_0x1de3('0x40')]['id']){delete _0x3e0e56[_0x1de3('0x40')]['id'];}return db[_0x1de3('0x1d')][_0x1de3('0x3e')]({'where':{'id':_0x3e0e56[_0x1de3('0x3b')]['id']}})[_0x1de3('0x17')](handleEntityNotFound(_0x3c0958,null))[_0x1de3('0x17')](function(_0x1f0a5d){if(_0x1f0a5d[_0x1de3('0x36')]==='MicrosoftAzure'&&_0x3e0e56[_0x1de3('0x40')][_0x1de3('0x39')]){_0x3e0e56[_0x1de3('0x40')][_0x1de3('0x39')]=encryptor[_0x1de3('0x47')](_0x3e0e56[_0x1de3('0x40')][_0x1de3('0x39')]);}return _0x1f0a5d;})[_0x1de3('0x17')](saveUpdates(_0x3e0e56[_0x1de3('0x40')],null))[_0x1de3('0x17')](respondWithResult(_0x3c0958,null))['catch'](handleError(_0x3c0958,null));};exports[_0x1de3('0x4a')]=function(_0x5641a2,_0x4aa392){return db['CloudProvider'][_0x1de3('0x3e')]({'where':{'id':_0x5641a2[_0x1de3('0x3b')]['id']}})[_0x1de3('0x17')](handleEntityNotFound(_0x4aa392,null))[_0x1de3('0x17')](removeEntity(_0x4aa392,null))['catch'](handleError(_0x4aa392,null));};exports['oauth2MicrosoftAuthorize']=function(_0x50389a,_0x11c2d9){return db[_0x1de3('0x1d')]['findOne']({'where':{'id':_0x50389a[_0x1de3('0x3b')]['id']},'raw':!![]})[_0x1de3('0x17')](function(_0xdbf886){if(!_0xdbf886)return _0x11c2d9[_0x1de3('0xd')](0x194);return{'url':oauth[_0x1de3('0x4b')](_0xdbf886,_0x50389a[_0x1de3('0x4c')]['id'])};})[_0x1de3('0x17')](respondWithResult(_0x11c2d9,null))[_0x1de3('0x48')](handleError(_0x11c2d9,null));};exports[_0x1de3('0x4d')]=function(_0x47f2a6,_0x575a27){var _0x47f31b=_0x47f2a6['body'];var _0x1b5fad;var _0x2f17cb;if(_0x47f31b[_0x1de3('0x18')])throw _0x47f31b;redis['get'](_0x47f31b[_0x1de3('0x4e')])[_0x1de3('0x17')](function(_0x1f766f){if(!_0x1f766f)throw new Error(_0x1de3('0x4f'));_0x1b5fad=JSON[_0x1de3('0x50')](_0x1f766f);var _0x214d4f=Buffer[_0x1de3('0x51')](_0x47f31b['state'],_0x1de3('0x52'))[_0x1de3('0x53')](_0x1de3('0x54'));_0x2f17cb=JSON[_0x1de3('0x50')](_0x214d4f);if(!oauth['isValidIdToken'](_0x47f31b[_0x1de3('0x55')],_0x1b5fad['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x1de3('0x56')](_0x47f31b[_0x1de3('0x4e')]);return oauth[_0x1de3('0x57')](_0x47f31b['code'],_0x1b5fad);})[_0x1de3('0x17')](function(_0x1ffe19){_0x1b5fad['data5']=_0x1ffe19[_0x1de3('0x58')];_0x1b5fad[_0x1de3('0x59')]=_0x1ffe19[_0x1de3('0x5a')];return db['CloudProvider'][_0x1de3('0x49')]({'data5':_0x1b5fad['data5'],'data6':_0x1b5fad['data6']},{'where':{'id':_0x1b5fad['id']}});})['then'](function(){oauth[_0x1de3('0x5b')](_0x1b5fad);socket[_0x1de3('0x5c')](_0x1de3('0x5d'),{'id':_0x2f17cb['id']});return;})[_0x1de3('0x17')](respondWithStatusCode(_0x575a27,null))[_0x1de3('0x48')](function(_0x5a083c){if(_0x2f17cb){socket[_0x1de3('0x5c')]('microsoftAuthorization:error',{'id':_0x2f17cb['id']});}if(!_0x1b5fad){logger[_0x1de3('0x18')](_0x1de3('0x5e'),_0x5a083c);return _0x575a27[_0x1de3('0xe')](0x1f4)['send'](_0x5a083c[_0x1de3('0x5f')]);}logger[_0x1de3('0x18')](_0x1de3('0x60'),_0x1b5fad['id'],_0x5a083c);});}; \ No newline at end of file +var _0xe868=['pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','destroy','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','set','Content-Range','json','update','then','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters'];(function(_0x35c4b6,_0x3f462e){var _0x444f74=function(_0xee09cb){while(--_0xee09cb){_0x35c4b6['push'](_0x35c4b6['shift']());}};_0x444f74(++_0x3f462e);}(_0xe868,0xf8));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e86('0x0'));var Redis=require(_0x8e86('0x1'));var qs=require(_0x8e86('0x2'));var encryptor=require(_0x8e86('0x3'));var config=require(_0x8e86('0x4'));var logger=require(_0x8e86('0x5'))(_0x8e86('0x6'));var db=require(_0x8e86('0x7'))['db'];var oauth=require(_0x8e86('0x8'));config['redis']=_[_0x8e86('0x9')](config[_0x8e86('0xa')],{'host':_0x8e86('0xb'),'port':0x18eb});var socket=require(_0x8e86('0xc'))(new Redis(config['redis']));var redis=new Redis(config[_0x8e86('0xa')]);function respondWithStatusCode(_0x573cb0,_0x2f6628){_0x2f6628=_0x2f6628||0xcc;return function(_0x585f61){if(_0x585f61){return _0x573cb0[_0x8e86('0xd')](_0x2f6628);}return _0x573cb0[_0x8e86('0xe')](_0x2f6628)['end']();};}function respondWithResult(_0x2cb7e2,_0x510386){_0x510386=_0x510386||0xc8;return function(_0x5ea43f){if(_0x5ea43f){return _0x2cb7e2[_0x8e86('0xe')](_0x510386)['json'](_0x5ea43f);}};}function respondWithFilteredResult(_0x8edb88,_0x26459d){return function(_0x98f41f){if(_0x98f41f){var _0x3645d4=typeof _0x26459d[_0x8e86('0xf')]===_0x8e86('0x10')&&typeof _0x26459d[_0x8e86('0x11')]===_0x8e86('0x10');var _0x172716=_0x98f41f['count'];var _0x4af768=_0x3645d4?0x0:_0x26459d[_0x8e86('0xf')];var _0x1ebd9d=_0x3645d4?_0x98f41f['count']:_0x26459d[_0x8e86('0xf')]+_0x26459d[_0x8e86('0x11')];var _0x556e78;if(_0x1ebd9d>=_0x172716){_0x1ebd9d=_0x172716;_0x556e78=0xc8;}else{_0x556e78=0xce;}_0x8edb88['status'](_0x556e78);return _0x8edb88[_0x8e86('0x12')](_0x8e86('0x13'),_0x4af768+'-'+_0x1ebd9d+'/'+_0x172716)[_0x8e86('0x14')](_0x98f41f);}return null;};}function saveUpdates(_0x5e457f){return function(_0x2d5b02){if(_0x2d5b02){return _0x2d5b02[_0x8e86('0x15')](_0x5e457f)[_0x8e86('0x16')](function(_0x426f45){return _0x426f45;});}return null;};}function removeEntity(_0x24ef18){return function(_0x5d7609){if(_0x5d7609){return _0x5d7609['destroy']()[_0x8e86('0x16')](function(){_0x24ef18[_0x8e86('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445ed3){return function(_0xa9c06d){if(!_0xa9c06d){_0x445ed3[_0x8e86('0xd')](0x194);}return _0xa9c06d;};}function handleError(_0x30b46b,_0x212c4a){_0x212c4a=_0x212c4a||0x1f4;return function(_0x4ff1c7){logger['error'](_0x4ff1c7['stack']);if(_0x4ff1c7[_0x8e86('0x17')]){delete _0x4ff1c7[_0x8e86('0x17')];}_0x30b46b[_0x8e86('0xe')](_0x212c4a)['send'](_0x4ff1c7);};}function maskClientSecret(_0x14f0f4){return _['padEnd'](_0x14f0f4[_0x8e86('0x18')](0x0,0x3),0x14,'*');}exports[_0x8e86('0x19')]=function(_0x44e222,_0x35a70e){var _0x4631d0={},_0x8e2ad5={},_0x1b4777={'count':0x0,'rows':[]};var _0x107eb0=_[_0x8e86('0x1a')](db[_0x8e86('0x1b')][_0x8e86('0x1c')],function(_0x13ff2d){return{'name':_0x13ff2d[_0x8e86('0x1d')],'type':_0x13ff2d[_0x8e86('0x1e')][_0x8e86('0x1f')]};});_0x8e2ad5[_0x8e86('0x20')]=_[_0x8e86('0x1a')](_0x107eb0,_0x8e86('0x17'));_0x8e2ad5[_0x8e86('0x21')]=_[_0x8e86('0x22')](_0x44e222[_0x8e86('0x21')]);_0x8e2ad5['filters']=_['intersection'](_0x8e2ad5['model'],_0x8e2ad5['query']);_0x4631d0[_0x8e86('0x23')]=_[_0x8e86('0x24')](_0x8e2ad5['model'],qs['fields'](_0x44e222[_0x8e86('0x21')][_0x8e86('0x25')]));_0x4631d0[_0x8e86('0x23')]=_0x4631d0[_0x8e86('0x23')][_0x8e86('0x26')]?_0x4631d0[_0x8e86('0x23')]:_0x8e2ad5[_0x8e86('0x20')];if(!_0x44e222[_0x8e86('0x21')][_0x8e86('0x27')]('nolimit')){_0x4631d0[_0x8e86('0x11')]=qs[_0x8e86('0x11')](_0x44e222[_0x8e86('0x21')][_0x8e86('0x11')]);_0x4631d0[_0x8e86('0xf')]=qs[_0x8e86('0xf')](_0x44e222[_0x8e86('0x21')][_0x8e86('0xf')]);}_0x4631d0[_0x8e86('0x28')]=qs['sort'](_0x44e222['query']['sort']);_0x4631d0[_0x8e86('0x29')]=qs[_0x8e86('0x2a')](_[_0x8e86('0x2b')](_0x44e222[_0x8e86('0x21')],_0x8e2ad5[_0x8e86('0x2a')]),_0x107eb0);if(_0x44e222[_0x8e86('0x21')][_0x8e86('0x2c')]){_0x4631d0[_0x8e86('0x29')]=_[_0x8e86('0x2d')](_0x4631d0['where'],{'$or':_[_0x8e86('0x1a')](_0x107eb0,function(_0x3e2383){if(_0x3e2383[_0x8e86('0x1e')]!==_0x8e86('0x2e')){var _0x509797={};_0x509797[_0x3e2383[_0x8e86('0x17')]]={'$like':'%'+_0x44e222[_0x8e86('0x21')][_0x8e86('0x2c')]+'%'};return _0x509797;}})});}_0x4631d0=_[_0x8e86('0x2d')]({},_0x4631d0,_0x44e222['options']);var _0x517dfa={'where':_0x4631d0['where']};return db[_0x8e86('0x1b')][_0x8e86('0x2f')](_0x517dfa)[_0x8e86('0x16')](function(_0x15f4de){_0x1b4777[_0x8e86('0x2f')]=_0x15f4de;if(_0x44e222[_0x8e86('0x21')][_0x8e86('0x30')]){_0x4631d0[_0x8e86('0x31')]=[{'all':!![]}];}return db[_0x8e86('0x1b')][_0x8e86('0x32')](_0x4631d0);})['then'](function(_0x1edc24){_0x1b4777[_0x8e86('0x33')]=_['map'](_0x1edc24,function(_0x2f8575){if(_0x2f8575['service']===_0x8e86('0x34')){var _0x1bea74=encryptor[_0x8e86('0x35')](_0x2f8575['data3']);_0x2f8575[_0x8e86('0x36')]=maskClientSecret(_0x1bea74);}return _0x2f8575;});return _0x1b4777;})[_0x8e86('0x16')](respondWithFilteredResult(_0x35a70e,_0x4631d0))[_0x8e86('0x37')](handleError(_0x35a70e,null));};exports[_0x8e86('0x38')]=function(_0x57490a,_0x492ba1){var _0xbe1179={'raw':!![],'where':{'id':_0x57490a[_0x8e86('0x39')]['id']}},_0x53aa76={};_0x53aa76[_0x8e86('0x20')]=_[_0x8e86('0x22')](db[_0x8e86('0x1b')][_0x8e86('0x1c')]);_0x53aa76[_0x8e86('0x21')]=_['keys'](_0x57490a[_0x8e86('0x21')]);_0x53aa76['filters']=_[_0x8e86('0x24')](_0x53aa76[_0x8e86('0x20')],_0x53aa76[_0x8e86('0x21')]);_0xbe1179[_0x8e86('0x23')]=_['intersection'](_0x53aa76[_0x8e86('0x20')],qs['fields'](_0x57490a[_0x8e86('0x21')][_0x8e86('0x25')]));_0xbe1179[_0x8e86('0x23')]=_0xbe1179[_0x8e86('0x23')]['length']?_0xbe1179[_0x8e86('0x23')]:_0x53aa76[_0x8e86('0x20')];if(_0x57490a[_0x8e86('0x21')]['includeAll']){_0xbe1179[_0x8e86('0x31')]=[{'all':!![]}];}_0xbe1179=_[_0x8e86('0x2d')]({},_0xbe1179,_0x57490a[_0x8e86('0x3a')]);return db[_0x8e86('0x1b')][_0x8e86('0x3b')](_0xbe1179)['then'](handleEntityNotFound(_0x492ba1,null))['then'](function(_0x993dae){if(_0x993dae['service']===_0x8e86('0x34')){var _0x5528db=encryptor[_0x8e86('0x35')](_0x993dae[_0x8e86('0x36')]);_0x993dae['data3']=maskClientSecret(_0x5528db);}return _0x993dae;})[_0x8e86('0x16')](respondWithResult(_0x492ba1,null))[_0x8e86('0x37')](handleError(_0x492ba1,null));};exports[_0x8e86('0x3c')]=function(_0x549467,_0x5a09a4){if(!_0x549467['body'][_0x8e86('0x17')])throw new Error(_0x8e86('0x3d'));if(!_0x549467['body'][_0x8e86('0x3e')])throw new Error(_0x8e86('0x3f'));var _0x438541=db[_0x8e86('0x1b')][_0x8e86('0x1c')][_0x8e86('0x3e')][_0x8e86('0x40')];if(!_0x438541[_0x8e86('0x41')](_0x549467[_0x8e86('0x42')]['service']))throw new Error(_0x8e86('0x43')+_0x438541['join'](',\x20'));if(_0x549467[_0x8e86('0x42')]['service']===_0x8e86('0x34')&&_0x549467[_0x8e86('0x42')][_0x8e86('0x36')]){_0x549467['body']['data3']=encryptor[_0x8e86('0x44')](_0x549467[_0x8e86('0x42')][_0x8e86('0x36')]);}return db[_0x8e86('0x1b')][_0x8e86('0x3c')](_0x549467[_0x8e86('0x42')],{})[_0x8e86('0x16')](respondWithResult(_0x5a09a4,0xc9))['catch'](handleError(_0x5a09a4,null));};exports[_0x8e86('0x15')]=function(_0x33cb84,_0x515b09){if(_0x33cb84[_0x8e86('0x42')]['id']){delete _0x33cb84['body']['id'];}return db['CloudProvider'][_0x8e86('0x3b')]({'where':{'id':_0x33cb84[_0x8e86('0x39')]['id']}})['then'](handleEntityNotFound(_0x515b09,null))['then'](function(_0x52c8b2){if(_0x52c8b2[_0x8e86('0x3e')]==='MicrosoftAzure'&&_0x33cb84[_0x8e86('0x42')][_0x8e86('0x36')]){_0x33cb84[_0x8e86('0x42')]['data3']=encryptor[_0x8e86('0x44')](_0x33cb84[_0x8e86('0x42')]['data3']);}return _0x52c8b2;})['then'](saveUpdates(_0x33cb84[_0x8e86('0x42')],null))[_0x8e86('0x16')](respondWithResult(_0x515b09,null))[_0x8e86('0x37')](handleError(_0x515b09,null));};exports[_0x8e86('0x45')]=function(_0x1bb0f4,_0x4ca417){return db[_0x8e86('0x1b')][_0x8e86('0x3b')]({'where':{'id':_0x1bb0f4['params']['id']}})[_0x8e86('0x16')](handleEntityNotFound(_0x4ca417,null))[_0x8e86('0x16')](removeEntity(_0x4ca417,null))[_0x8e86('0x37')](handleError(_0x4ca417,null));};exports['oauth2MicrosoftAuthorize']=function(_0x7990d3,_0x3a97b1){return db['CloudProvider']['findOne']({'where':{'id':_0x7990d3[_0x8e86('0x39')]['id']},'raw':!![]})[_0x8e86('0x16')](function(_0x1404c4){if(!_0x1404c4)return _0x3a97b1[_0x8e86('0xd')](0x194);return{'url':oauth[_0x8e86('0x46')](_0x1404c4,_0x7990d3[_0x8e86('0x47')]['id'])};})[_0x8e86('0x16')](respondWithResult(_0x3a97b1,null))['catch'](handleError(_0x3a97b1,null));};exports[_0x8e86('0x48')]=function(_0x40b1cb,_0x2131e1){var _0x56fa30=_0x40b1cb[_0x8e86('0x42')];var _0x5b94bf;var _0x44c85c;if(_0x56fa30[_0x8e86('0x49')])throw _0x56fa30;redis[_0x8e86('0x4a')](_0x56fa30[_0x8e86('0x4b')])[_0x8e86('0x16')](function(_0x36ef3b){if(!_0x36ef3b)throw new Error(_0x8e86('0x4c'));_0x5b94bf=JSON['parse'](_0x36ef3b);var _0x518925=Buffer[_0x8e86('0x4d')](_0x56fa30[_0x8e86('0x4b')],_0x8e86('0x4e'))[_0x8e86('0x4f')]('ascii');_0x44c85c=JSON[_0x8e86('0x50')](_0x518925);if(!oauth[_0x8e86('0x51')](_0x56fa30[_0x8e86('0x52')],_0x5b94bf[_0x8e86('0x53')]))throw new Error(_0x8e86('0x54'));redis[_0x8e86('0x55')](_0x56fa30['state']);return oauth[_0x8e86('0x56')](_0x56fa30[_0x8e86('0x57')],_0x5b94bf);})[_0x8e86('0x16')](function(_0x716818){_0x5b94bf['data5']=_0x716818[_0x8e86('0x58')];_0x5b94bf[_0x8e86('0x59')]=_0x716818[_0x8e86('0x5a')];return db['CloudProvider']['update']({'data5':_0x5b94bf['data5'],'data6':_0x5b94bf[_0x8e86('0x59')]},{'where':{'id':_0x5b94bf['id']}});})['then'](function(){oauth[_0x8e86('0x5b')](_0x5b94bf);socket[_0x8e86('0x5c')]('microsoftAuthorization:success',{'id':_0x44c85c['id']});return;})[_0x8e86('0x16')](respondWithStatusCode(_0x2131e1,null))['catch'](function(_0x5020f4){if(_0x44c85c){socket[_0x8e86('0x5c')](_0x8e86('0x5d'),{'id':_0x44c85c['id']});}if(!_0x5b94bf){logger[_0x8e86('0x49')](_0x8e86('0x5e'),_0x5020f4);return _0x2131e1[_0x8e86('0xe')](0x1f4)[_0x8e86('0x5f')](_0x5020f4[_0x8e86('0x60')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s',_0x5b94bf['id'],_0x5020f4);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 5fa7e33..8718e07 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 _0x9a82=['request-promise','path','rimraf','../../config/environment','define','CloudProvider','lodash','util','api','moment'];(function(_0x1506fc,_0x5ed6a2){var _0x4b6b57=function(_0x4ae156){while(--_0x4ae156){_0x1506fc['push'](_0x1506fc['shift']());}};_0x4b6b57(++_0x5ed6a2);}(_0x9a82,0x178));var _0x29a8=function(_0x3c600b,_0x2fba6b){_0x3c600b=_0x3c600b-0x0;var _0xaf7ffd=_0x9a82[_0x3c600b];return _0xaf7ffd;};'use strict';var _=require(_0x29a8('0x0'));var util=require(_0x29a8('0x1'));var logger=require('../../config/logger')(_0x29a8('0x2'));var moment=require(_0x29a8('0x3'));var BPromise=require('bluebird');var rp=require(_0x29a8('0x4'));var fs=require('fs');var path=require(_0x29a8('0x5'));var rimraf=require(_0x29a8('0x6'));var config=require(_0x29a8('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x15f956,_0x28719e){return _0x15f956[_0x29a8('0x8')](_0x29a8('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb531=['../../config/logger','api','moment','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util'];(function(_0x4ac266,_0x197dab){var _0x3c8fe3=function(_0x500837){while(--_0x500837){_0x4ac266['push'](_0x4ac266['shift']());}};_0x3c8fe3(++_0x197dab);}(_0xb531,0x112));var _0x1b53=function(_0x7cdfb5,_0x530cbb){_0x7cdfb5=_0x7cdfb5-0x0;var _0xb1ba04=_0xb531[_0x7cdfb5];return _0xb1ba04;};'use strict';var _=require(_0x1b53('0x0'));var util=require(_0x1b53('0x1'));var logger=require(_0x1b53('0x2'))(_0x1b53('0x3'));var moment=require(_0x1b53('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b53('0x5'));var rimraf=require(_0x1b53('0x6'));var config=require(_0x1b53('0x7'));var attributes=require(_0x1b53('0x8'));module[_0x1b53('0x9')]=function(_0x5c46cf,_0x4e402e){return _0x5c46cf['define'](_0x1b53('0xa'),attributes,{'tableName':_0x1b53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 958725e..a79ccf9 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x324f=['redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','value','oauth2Claims','replace','oauth2/','set','decode','payload','issuer','aud','isAfter','unix','resolve','then','data6','findOne','decryptString','data3','POST','data5','access_token','refresh_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','request-promise','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider'];(function(_0x54124c,_0x393bee){var _0x44aab2=function(_0x5aa5fa){while(--_0x5aa5fa){_0x54124c['push'](_0x54124c['shift']());}};_0x44aab2(++_0x393bee);}(_0x324f,0x94));var _0xf324=function(_0x21c460,_0x12b0f7){_0x21c460=_0x21c460-0x0;var _0x10c857=_0x324f[_0x21c460];return _0x10c857;};'use strict';var _=require(_0xf324('0x0'));var crypto=require(_0xf324('0x1'));var jwt=require(_0xf324('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xf324('0x3'));var util=require('util');var encryptor=require(_0xf324('0x4'));var config=require(_0xf324('0x5'));var logger=require('../../config/logger')(_0xf324('0x6'));var schedule=require(_0xf324('0x7'));var db=require('../../mysqldb')['db'];config[_0xf324('0x8')]=_[_0xf324('0x9')](config[_0xf324('0x8')],{'host':_0xf324('0xa'),'port':0x18eb});var redis=new Redis(config[_0xf324('0x8')]);var MICROSOFT_AUTH_URL=_0xf324('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf324('0xc'),_0xf324('0xd'),_0xf324('0xe'),'offline_access',_0xf324('0xf'),_0xf324('0x10'),_0xf324('0x11')],'Dynamics365':[_0xf324('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf324('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xf324('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x229d23){var _0x295e0e=_[_0xf324('0x14')](AZURE_AUTH_SCOPES[_0x229d23[_0xf324('0x15')]]);if(_0x229d23[_0xf324('0x15')]===_0xf324('0x16'))_0x295e0e[_0xf324('0x17')](_0x229d23[_0xf324('0x18')]+'/.default');return _0x295e0e['join']('\x20');}function getAccessTokenScope(_0x52c645){if(_0x52c645['type']===_0xf324('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x52c645[_0xf324('0x15')]==='Dynamics365')return _0x52c645[_0xf324('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x29a123,_0x3aa231){var _0x1121bc=MICROSOFT_AUTH_URL['replace'](_0xf324('0x1a'),_0x29a123[_0xf324('0x1b')]);var _0x39ca8e=[_0xf324('0x1c'),_0xf324('0x1d')];var _0x89bcbd=Buffer[_0xf324('0x1e')](JSON[_0xf324('0x1f')]({'id':_0x3aa231}))[_0xf324('0x20')](_0xf324('0x21'));var _0x32ee7a=crypto[_0xf324('0x22')](0x10)['toString'](_0xf324('0x23'));var _0xe5afd8=getAuthorizationScopes(_0x29a123);var _0x5b6c90=[{'key':'client_id','value':_0x29a123[_0xf324('0x24')]},{'key':_0xf324('0x25'),'value':encodeURIComponent(_0x39ca8e[_0xf324('0x26')]('\x20'))},{'key':_0xf324('0x27'),'value':_0x29a123[_0xf324('0x28')]},{'key':_0xf324('0x29'),'value':_0xf324('0x2a')},{'key':_0xf324('0x2b'),'value':encodeURIComponent(_0xe5afd8)},{'key':'state','value':_0x89bcbd},{'key':_0xf324('0x2c'),'value':_0x32ee7a},{'key':_0xf324('0x2d'),'value':'login'}];var _0x4420b9=_0x1121bc+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf324('0x14')](_0x5b6c90,function(_0x89d969){return _0x89d969['key']+'='+_0x89d969[_0xf324('0x2e')];})[_0xf324('0x26')]('&');_0x29a123[_0xf324('0x2f')]={'issuer':_0x1121bc[_0xf324('0x30')](_0xf324('0x31'),''),'audience':_0x29a123[_0xf324('0x24')],'state':_0x89bcbd,'nonce':_0x32ee7a};redis[_0xf324('0x32')](_0x89bcbd,JSON[_0xf324('0x1f')](_0x29a123));return _0x4420b9;}function isValidIdToken(_0x16ddac,_0x391476){try{var _0x298f92=jwt[_0xf324('0x33')](_0x16ddac,{'complete':!![]});var _0x2c45bc=_0x298f92[_0xf324('0x34')];if(_0x2c45bc['iss']!==_0x391476[_0xf324('0x35')])return![];if(_0x2c45bc[_0xf324('0x36')]!==_0x391476['audience'])return![];if(_0x2c45bc[_0xf324('0x2c')]!==_0x391476[_0xf324('0x2c')])return![];if(moment()[_0xf324('0x37')](moment[_0xf324('0x38')](_0x2c45bc['exp'])))return![];return!![];}catch(_0x2992bb){throw _0x2992bb;}}function refreshOauth2MicrosoftAccessToken(_0x5175d3){return Promise[_0xf324('0x39')]()[_0xf324('0x3a')](function(){if(_0x5175d3[_0xf324('0x3b')])return _0x5175d3;return db['CloudProvider'][_0xf324('0x3c')]({'where':{'id':_0x5175d3['id']},'raw':!![]});})[_0xf324('0x3a')](function(_0x4a5e40){var _0x347ee2={'grant_type':'refresh_token','refresh_token':_0x4a5e40[_0xf324('0x3b')],'scope':getAccessTokenScope(_0x4a5e40),'redirect_uri':_0x4a5e40[_0xf324('0x28')],'client_id':_0x4a5e40['data1'],'client_secret':encryptor[_0xf324('0x3d')](_0x4a5e40[_0xf324('0x3e')])};var _0x2ee0c4={'method':_0xf324('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf324('0x30')]('{TENANT_ID}',_0x4a5e40[_0xf324('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x347ee2,'json':!![]};return rp(_0x2ee0c4);})[_0xf324('0x3a')](function(_0x1bb177){_0x5175d3[_0xf324('0x40')]=_0x1bb177[_0xf324('0x41')];_0x5175d3[_0xf324('0x3b')]=_0x1bb177[_0xf324('0x42')];return db[_0xf324('0x43')][_0xf324('0x44')]({'data5':_0x5175d3[_0xf324('0x40')],'data6':_0x5175d3[_0xf324('0x3b')]},{'where':{'id':_0x5175d3['id']}});})[_0xf324('0x3a')](function(){return _0x5175d3;})[_0xf324('0x45')](function(_0x4d3eaf){logger[_0xf324('0x46')](_0xf324('0x47'),_0x5175d3['id'],_0x4d3eaf);});}function getOauth2MicrosoftAccessToken(_0x128aa6,_0x2fa6b2){var _0x4116a8={'grant_type':_0xf324('0x48'),'code':_0x128aa6,'scope':getAccessTokenScope(_0x2fa6b2),'redirect_uri':_0x2fa6b2[_0xf324('0x28')],'client_id':_0x2fa6b2['data1'],'client_secret':encryptor[_0xf324('0x3d')](_0x2fa6b2[_0xf324('0x3e')])};var _0x52f39c={'method':_0xf324('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf324('0x30')](_0xf324('0x1a'),_0x2fa6b2[_0xf324('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4116a8,'json':!![]};return rp(_0x52f39c);}function startRefreshInterval(_0x413bfa){var _0x4ea2bb=schedule[_0xf324('0x49')];if(_0x4ea2bb[_0x413bfa['id']])clearInterval(_0x4ea2bb[_0x413bfa['id']]);_0x4ea2bb[_0x413bfa['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x413bfa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf324('0x49')]=_0x4ea2bb;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xf324('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf324('0x3a')](function(_0x5f29de){var _0x4f10d1=_0x5f29de[_0xf324('0x14')](function(_0x1c01a1){return refreshOauth2MicrosoftAccessToken(_0x1c01a1)[_0xf324('0x3a')](function(_0x5937a5){startRefreshInterval(_0x5937a5);});});return Promise[_0xf324('0x4b')](_0x4f10d1);})[_0xf324('0x45')](function(_0x3c950c){var _0x2165e0=_0x3c950c?util['inspect'](_0x3c950c,{'showHidden':![],'depth':null}):'';logger[_0xf324('0x46')](_0xf324('0x4c'),_0x2165e0);});}module[_0xf324('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x851a=['intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','hex','client_id','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','data1','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data6','CloudProvider','findOne','refresh_token','decryptString','data3','POST','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','bind'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x851a,0x19b));var _0xa851=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x851a[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xa851('0x0'));var crypto=require('crypto');var jwt=require(_0xa851('0x1'));var moment=require(_0xa851('0x2'));var Redis=require(_0xa851('0x3'));var rp=require(_0xa851('0x4'));var util=require(_0xa851('0x5'));var encryptor=require(_0xa851('0x6'));var config=require(_0xa851('0x7'));var logger=require(_0xa851('0x8'))('api');var schedule=require(_0xa851('0x9'));var db=require('../../mysqldb')['db'];config[_0xa851('0xa')]=_[_0xa851('0xb')](config[_0xa851('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xa851('0xa')]);var MICROSOFT_AUTH_URL=_0xa851('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa851('0xd'),_0xa851('0xe'),'email',_0xa851('0xf'),_0xa851('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xa851('0x11')],'Dynamics365':[_0xa851('0xd'),_0xa851('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xa851('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xa851('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3316aa){var _0x18059e=_[_0xa851('0x14')](AZURE_AUTH_SCOPES[_0x3316aa[_0xa851('0x15')]]);if(_0x3316aa[_0xa851('0x15')]===_0xa851('0x16'))_0x18059e[_0xa851('0x17')](_0x3316aa[_0xa851('0x18')]+_0xa851('0x19'));return _0x18059e[_0xa851('0x1a')]('\x20');}function getAccessTokenScope(_0x2ad4b2){if(_0x2ad4b2[_0xa851('0x15')]===_0xa851('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2ad4b2[_0xa851('0x15')]===_0xa851('0x16'))return _0x2ad4b2[_0xa851('0x18')]+_0xa851('0x19');}function generateMicrosoftAuthorizationUrl(_0x5be85d,_0x905e2a){var _0x1f38da=MICROSOFT_AUTH_URL[_0xa851('0x1c')](_0xa851('0x1d'),_0x5be85d[_0xa851('0x1e')]);var _0x51ebac=[_0xa851('0x1f'),'id_token'];var _0x23d32d=Buffer[_0xa851('0x20')](JSON[_0xa851('0x21')]({'id':_0x905e2a}))[_0xa851('0x22')](_0xa851('0x23'));var _0x1fd056=crypto[_0xa851('0x24')](0x10)[_0xa851('0x22')](_0xa851('0x25'));var _0x5bfe0e=getAuthorizationScopes(_0x5be85d);var _0x394f7d=[{'key':_0xa851('0x26'),'value':_0x5be85d['data1']},{'key':_0xa851('0x27'),'value':encodeURIComponent(_0x51ebac[_0xa851('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x5be85d[_0xa851('0x28')]},{'key':_0xa851('0x29'),'value':_0xa851('0x2a')},{'key':_0xa851('0x2b'),'value':encodeURIComponent(_0x5bfe0e)},{'key':_0xa851('0x2c'),'value':_0x23d32d},{'key':_0xa851('0x2d'),'value':_0x1fd056},{'key':_0xa851('0x2e'),'value':_0xa851('0x2f')}];var _0x10d602=_0x1f38da+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa851('0x14')](_0x394f7d,function(_0x23c3ef){return _0x23c3ef[_0xa851('0x30')]+'='+_0x23c3ef['value'];})[_0xa851('0x1a')]('&');_0x5be85d[_0xa851('0x31')]={'issuer':_0x1f38da[_0xa851('0x1c')]('oauth2/',''),'audience':_0x5be85d[_0xa851('0x32')],'state':_0x23d32d,'nonce':_0x1fd056};redis['set'](_0x23d32d,JSON[_0xa851('0x21')](_0x5be85d));return _0x10d602;}function isValidIdToken(_0x4f49fe,_0x10935d){try{var _0x455f93=jwt['decode'](_0x4f49fe,{'complete':!![]});var _0x40457c=_0x455f93[_0xa851('0x33')];if(_0x40457c[_0xa851('0x34')]!==_0x10935d[_0xa851('0x35')])return![];if(_0x40457c[_0xa851('0x36')]!==_0x10935d[_0xa851('0x37')])return![];if(_0x40457c['nonce']!==_0x10935d[_0xa851('0x2d')])return![];if(moment()[_0xa851('0x38')](moment[_0xa851('0x39')](_0x40457c['exp'])))return![];return!![];}catch(_0x1788a6){throw _0x1788a6;}}function refreshOauth2MicrosoftAccessToken(_0x126e37){return Promise[_0xa851('0x3a')]()[_0xa851('0x3b')](function(){if(_0x126e37[_0xa851('0x3c')])return _0x126e37;return db[_0xa851('0x3d')][_0xa851('0x3e')]({'where':{'id':_0x126e37['id']},'raw':!![]});})[_0xa851('0x3b')](function(_0xfbb23a){var _0x2cc9bc={'grant_type':_0xa851('0x3f'),'refresh_token':_0xfbb23a[_0xa851('0x3c')],'scope':getAccessTokenScope(_0xfbb23a),'redirect_uri':_0xfbb23a['data4'],'client_id':_0xfbb23a[_0xa851('0x32')],'client_secret':encryptor[_0xa851('0x40')](_0xfbb23a[_0xa851('0x41')])};var _0x17f3fe={'method':_0xa851('0x42'),'uri':MICROSOFT_AUTH_URL[_0xa851('0x1c')]('{TENANT_ID}',_0xfbb23a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cc9bc,'json':!![]};return rp(_0x17f3fe);})[_0xa851('0x3b')](function(_0x37c8b3){_0x126e37['data5']=_0x37c8b3[_0xa851('0x43')];_0x126e37[_0xa851('0x3c')]=_0x37c8b3[_0xa851('0x3f')];return db[_0xa851('0x3d')][_0xa851('0x44')]({'data5':_0x126e37[_0xa851('0x45')],'data6':_0x126e37[_0xa851('0x3c')]},{'where':{'id':_0x126e37['id']}});})[_0xa851('0x3b')](function(){return _0x126e37;})[_0xa851('0x46')](function(_0x49ab4c){logger[_0xa851('0x47')](_0xa851('0x48'),_0x126e37['id'],_0x49ab4c);});}function getOauth2MicrosoftAccessToken(_0x284a1f,_0x394230){var _0x1a0425={'grant_type':_0xa851('0x49'),'code':_0x284a1f,'scope':getAccessTokenScope(_0x394230),'redirect_uri':_0x394230['data4'],'client_id':_0x394230[_0xa851('0x32')],'client_secret':encryptor[_0xa851('0x40')](_0x394230['data3'])};var _0x39dce0={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa851('0x1c')](_0xa851('0x1d'),_0x394230[_0xa851('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a0425,'json':!![]};return rp(_0x39dce0);}function startRefreshInterval(_0x50f3a3){var _0x3bcde2=schedule['intervals'];if(_0x3bcde2[_0x50f3a3['id']])clearInterval(_0x3bcde2[_0x50f3a3['id']]);_0x3bcde2[_0x50f3a3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa851('0x4a')](this,{'id':_0x50f3a3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa851('0x4b')]=_0x3bcde2;}function startAllRefreshIntervals(){return db[_0xa851('0x3d')][_0xa851('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa851('0x3b')](function(_0x10d51b){var _0x3d8588=_0x10d51b[_0xa851('0x14')](function(_0x272568){return refreshOauth2MicrosoftAccessToken(_0x272568)[_0xa851('0x3b')](function(_0x16fa69){startRefreshInterval(_0x16fa69);});});return Promise[_0xa851('0x4d')](_0x3d8588);})[_0xa851('0x46')](function(_0x3597e1){var _0x3de1a4=_0x3597e1?util[_0xa851('0x4e')](_0x3597e1,{'showHidden':![],'depth':null}):'';logger[_0xa851('0x47')](_0xa851('0x4f'),_0x3de1a4);});}module[_0xa851('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 5919e09..e5f827c 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 _0x753c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x753c,0x96));var _0xc753=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x753c[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf96e73,_0xd7ee43,_0x44e544){return new BPromise(function(_0xb80bea,_0x3866e8){return client[_0xc753('0xc')](_0xf96e73,_0x44e544)[_0xc753('0xd')](function(_0x128610){logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,_0xc753('0x10'));logger[_0xc753('0x11')](_0xc753('0x12'),_0xd7ee43,'request\x20sent',JSON[_0xc753('0x13')](_0x128610));if(_0x128610[_0xc753('0x14')]){if(_0x128610['error'][_0xc753('0x15')]===0x1f4){logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610[_0xc753('0x14')][_0xc753('0x16')]);return _0x3866e8(_0x128610['error'][_0xc753('0x16')]);}logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610['error'][_0xc753('0x16')]);return _0xb80bea(_0x128610[_0xc753('0x14')][_0xc753('0x16')]);}else{logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,'request\x20sent');_0xb80bea(_0x128610[_0xc753('0x17')][_0xc753('0x16')]);}})[_0xc753('0x18')](function(_0x2e056c){logger[_0xc753('0x14')](_0xc753('0xf'),_0xd7ee43,_0x2e056c);_0x3866e8(_0x2e056c);});});} \ No newline at end of file +var _0x07fa=['../../config/utils','../../config/logger','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x580c7f,_0x22bd0f){var _0x27b5e9=function(_0x3636f7){while(--_0x3636f7){_0x580c7f['push'](_0x580c7f['shift']());}};_0x27b5e9(++_0x22bd0f);}(_0x07fa,0x177));var _0xa07f=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x07fa[_0x101e7b];return _0x4995c0;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var moment=require(_0xa07f('0x1'));var BPromise=require(_0xa07f('0x2'));var rs=require(_0xa07f('0x3'));var fs=require('fs');var Redis=require(_0xa07f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa07f('0x5'));var logger=require(_0xa07f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa07f('0x7')][_0xa07f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x509d7a,_0x2ad2ff,_0x575be1){return new BPromise(function(_0x4eea76,_0x5d82e9){return client['request'](_0x509d7a,_0x575be1)[_0xa07f('0x9')](function(_0x288476){logger['info'](_0xa07f('0xa'),_0x2ad2ff,_0xa07f('0xb'));logger[_0xa07f('0xc')](_0xa07f('0xd'),_0x2ad2ff,_0xa07f('0xb'),JSON[_0xa07f('0xe')](_0x288476));if(_0x288476[_0xa07f('0xf')]){if(_0x288476[_0xa07f('0xf')]['code']===0x1f4){logger[_0xa07f('0xf')](_0xa07f('0xa'),_0x2ad2ff,_0x288476['error'][_0xa07f('0x10')]);return _0x5d82e9(_0x288476[_0xa07f('0xf')][_0xa07f('0x10')]);}logger['error'](_0xa07f('0xa'),_0x2ad2ff,_0x288476['error'][_0xa07f('0x10')]);return _0x4eea76(_0x288476[_0xa07f('0xf')][_0xa07f('0x10')]);}else{logger[_0xa07f('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2ad2ff,_0xa07f('0xb'));_0x4eea76(_0x288476[_0xa07f('0x12')][_0xa07f('0x10')]);}})[_0xa07f('0x13')](function(_0x4090a1){logger['error'](_0xa07f('0xa'),_0x2ad2ff,_0x4090a1);_0x5d82e9(_0x4090a1);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index e34ccfa..7ad59d5 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b1a74,_0x431559){_0x3b1a74=_0x3b1a74-0x0;var _0x58b051=_0x5f2f[_0x3b1a74];return _0x58b051;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x1261,0x144));var _0x1126=function(_0x1b640f,_0x215390){_0x1b640f=_0x1b640f-0x0;var _0x560770=_0x1261[_0x1b640f];return _0x560770;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 7333768..dc38b20 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 _0x1e65=['STRING','sequelize','exports','name'];(function(_0x3a3daf,_0x379493){var _0x19eabe=function(_0x16b63d){while(--_0x16b63d){_0x3a3daf['push'](_0x3a3daf['shift']());}};_0x19eabe(++_0x379493);}(_0x1e65,0xed));var _0x51e6=function(_0xfc7786,_0x3fc5e9){_0xfc7786=_0xfc7786-0x0;var _0x2d5f07=_0x1e65[_0xfc7786];return _0x2d5f07;};'use strict';var Sequelize=require(_0x51e6('0x0'));module[_0x51e6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x51e6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x51e6('0x3')]},'companyId':{'type':Sequelize[_0x51e6('0x3')]},'website':{'type':Sequelize[_0x51e6('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x51e6('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x51e6('0x3')]},'city':{'type':Sequelize[_0x51e6('0x3')]},'country':{'type':Sequelize[_0x51e6('0x3')]},'email':{'type':Sequelize[_0x51e6('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x51e6('0x3')]},'sStreet':{'type':Sequelize[_0x51e6('0x3')]},'sPostalCode':{'type':Sequelize[_0x51e6('0x3')]},'sCity':{'type':Sequelize[_0x51e6('0x3')]},'sCountry':{'type':Sequelize[_0x51e6('0x3')]},'description':{'type':Sequelize[_0x51e6('0x3')]}}; \ No newline at end of file +var _0x3600=['name','sequelize','STRING'];(function(_0x46553d,_0x12a55d){var _0x43b6cf=function(_0x253742){while(--_0x253742){_0x46553d['push'](_0x46553d['shift']());}};_0x43b6cf(++_0x12a55d);}(_0x3600,0x13f));var _0x0360=function(_0x10970e,_0x474896){_0x10970e=_0x10970e-0x0;var _0x2ac428=_0x3600[_0x10970e];return _0x2ac428;};'use strict';var Sequelize=require(_0x0360('0x0'));module['exports']={'name':{'type':Sequelize[_0x0360('0x1')],'unique':_0x0360('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0360('0x1')]},'companyId':{'type':Sequelize[_0x0360('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0360('0x1')]},'fax':{'type':Sequelize[_0x0360('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0360('0x1')]},'postalCode':{'type':Sequelize[_0x0360('0x1')]},'city':{'type':Sequelize[_0x0360('0x1')]},'country':{'type':Sequelize[_0x0360('0x1')]},'email':{'type':Sequelize[_0x0360('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x0360('0x1')]},'sPostalCode':{'type':Sequelize[_0x0360('0x1')]},'sCity':{'type':Sequelize[_0x0360('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0360('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e345332..743ace8 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 _0x75a3=['Companies','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','ids','omit','getContacts','findOne','CmContact','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','CmCompany','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x5c5bf2,_0x1dfb92){var _0x28780f=function(_0x23d779){while(--_0x23d779){_0x5c5bf2['push'](_0x5c5bf2['shift']());}};_0x28780f(++_0x1dfb92);}(_0x75a3,0x6d));var _0x375a=function(_0x296b3d,_0x404cce){_0x296b3d=_0x296b3d-0x0;var _0x44a4cd=_0x75a3[_0x296b3d];return _0x44a4cd;};'use strict';var emlformat=require(_0x375a('0x0'));var rimraf=require(_0x375a('0x1'));var zipdir=require(_0x375a('0x2'));var jsonpatch=require(_0x375a('0x3'));var rp=require(_0x375a('0x4'));var moment=require(_0x375a('0x5'));var BPromise=require(_0x375a('0x6'));var Mustache=require(_0x375a('0x7'));var util=require(_0x375a('0x8'));var path=require(_0x375a('0x9'));var sox=require(_0x375a('0xa'));var csv=require(_0x375a('0xb'));var ejs=require(_0x375a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x375a('0xd'));var squel=require(_0x375a('0xe'));var crypto=require(_0x375a('0xf'));var jsforce=require(_0x375a('0x10'));var deskjs=require(_0x375a('0x11'));var toCsv=require(_0x375a('0xb'));var querystring=require(_0x375a('0x12'));var Papa=require(_0x375a('0x13'));var Redis=require(_0x375a('0x14'));var authService=require(_0x375a('0x15'));var qs=require(_0x375a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x375a('0x17'));var logger=require('../../config/logger')(_0x375a('0x18'));var utils=require(_0x375a('0x19'));var config=require(_0x375a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x375a('0x1b'))['db'];function respondWithStatusCode(_0xede579,_0x371a08){_0x371a08=_0x371a08||0xcc;return function(_0x4c1926){if(_0x4c1926){return _0xede579[_0x375a('0x1c')](_0x371a08);}return _0xede579[_0x375a('0x1d')](_0x371a08)['end']();};}function respondWithResult(_0x1dd9a9,_0x26002f){_0x26002f=_0x26002f||0xc8;return function(_0x5185ba){if(_0x5185ba){return _0x1dd9a9[_0x375a('0x1d')](_0x26002f)[_0x375a('0x1e')](_0x5185ba);}};}function respondWithFilteredResult(_0x32add6,_0x4a556f){return function(_0xed2d7f){if(_0xed2d7f){var _0x2d8982=typeof _0x4a556f[_0x375a('0x1f')]===_0x375a('0x20')&&typeof _0x4a556f[_0x375a('0x21')]===_0x375a('0x20');var _0x12cdab=_0xed2d7f['count'];var _0x2ce6ec=_0x2d8982?0x0:_0x4a556f[_0x375a('0x1f')];var _0x1cc674=_0x2d8982?_0xed2d7f[_0x375a('0x22')]:_0x4a556f[_0x375a('0x1f')]+_0x4a556f[_0x375a('0x21')];var _0x59123b;if(_0x1cc674>=_0x12cdab){_0x1cc674=_0x12cdab;_0x59123b=0xc8;}else{_0x59123b=0xce;}_0x32add6[_0x375a('0x1d')](_0x59123b);return _0x32add6[_0x375a('0x23')](_0x375a('0x24'),_0x2ce6ec+'-'+_0x1cc674+'/'+_0x12cdab)['json'](_0xed2d7f);}return null;};}function patchUpdates(_0x5b7dca){return function(_0xa27aa){try{jsonpatch[_0x375a('0x25')](_0xa27aa,_0x5b7dca,!![]);}catch(_0x47d38d){return BPromise['reject'](_0x47d38d);}return _0xa27aa[_0x375a('0x26')]();};}function saveUpdates(_0x484932,_0x3f362d){return function(_0xd590b4){if(_0xd590b4){return _0xd590b4[_0x375a('0x27')](_0x484932)[_0x375a('0x28')](function(_0x301ce9){return _0x301ce9;});}return null;};}function removeEntity(_0x8b48e,_0xe0d868){return function(_0x599eae){if(_0x599eae){return _0x599eae[_0x375a('0x29')]()[_0x375a('0x28')](function(){var _0x3c666f=_0x599eae[_0x375a('0x2a')]({'plain':!![]});var _0x1185e2='Companies';return db[_0x375a('0x2b')][_0x375a('0x29')]({'where':{'type':_0x1185e2,'resourceId':_0x3c666f['id']}})['then'](function(){return _0x599eae;});})['then'](function(){_0x8b48e[_0x375a('0x1d')](0xcc)[_0x375a('0x2c')]();});}};}function handleEntityNotFound(_0x15fda2,_0x3d567c){return function(_0x307efb){if(!_0x307efb){_0x15fda2[_0x375a('0x1c')](0x194);}return _0x307efb;};}function handleError(_0x3fb9c1,_0x40184e){_0x40184e=_0x40184e||0x1f4;return function(_0x50fe35){logger['error'](_0x50fe35[_0x375a('0x2d')]);if(_0x50fe35['name']){delete _0x50fe35[_0x375a('0x2e')];}_0x3fb9c1[_0x375a('0x1d')](_0x40184e)[_0x375a('0x2f')](_0x50fe35);};}exports[_0x375a('0x30')]=function(_0x1df059,_0xe3cd51){var _0x361f30={},_0x1de132={},_0x278d75={'count':0x0,'rows':[]};return db[_0x375a('0x31')]['describe']()[_0x375a('0x28')](function(_0x475f1b){_0x1de132['model']=_['keys'](_0x475f1b);_0x1de132[_0x375a('0x32')]=_[_0x375a('0x33')](_0x1df059[_0x375a('0x32')]);_0x1de132['filters']=_[_0x375a('0x34')](_0x1de132[_0x375a('0x35')],_0x1de132[_0x375a('0x32')]);_0x361f30['attributes']=_['intersection'](_0x1de132[_0x375a('0x35')],qs[_0x375a('0x36')](_0x1df059[_0x375a('0x32')][_0x375a('0x36')]));_0x361f30[_0x375a('0x37')]=_0x361f30[_0x375a('0x37')][_0x375a('0x38')]?_0x361f30[_0x375a('0x37')]:_0x1de132['model'];if(!_0x1df059['query'][_0x375a('0x39')](_0x375a('0x3a'))){_0x361f30['limit']=qs[_0x375a('0x21')](_0x1df059[_0x375a('0x32')][_0x375a('0x21')]);_0x361f30[_0x375a('0x1f')]=qs[_0x375a('0x1f')](_0x1df059[_0x375a('0x32')][_0x375a('0x1f')]);}_0x361f30[_0x375a('0x3b')]=qs['sort'](_0x1df059[_0x375a('0x32')][_0x375a('0x3c')]);_0x361f30[_0x375a('0x3d')]=qs[_0x375a('0x3e')](_[_0x375a('0x3f')](_0x1df059[_0x375a('0x32')],_0x1de132[_0x375a('0x3e')]),_0x475f1b);if(_0x1df059[_0x375a('0x32')][_0x375a('0x40')]){_0x361f30[_0x375a('0x3d')]=_[_0x375a('0x41')](_0x361f30[_0x375a('0x3d')],{'$or':_[_0x375a('0x42')](_0x361f30[_0x375a('0x37')],function(_0x4cb727){var _0x2520ad={};_0x2520ad[_0x4cb727]={'$like':'%'+_0x1df059['query']['filter']+'%'};return _0x2520ad;})});}_0x361f30=_['merge']({},_0x361f30,_0x1df059[_0x375a('0x43')]);var _0x64fa53={'where':_0x361f30[_0x375a('0x3d')]};return db['CmCompany']['count'](_0x64fa53)[_0x375a('0x28')](function(_0x21ee25){_0x278d75[_0x375a('0x22')]=_0x21ee25;if(_0x1df059[_0x375a('0x32')][_0x375a('0x44')]){_0x361f30[_0x375a('0x45')]=[{'all':!![]}];}return db[_0x375a('0x31')][_0x375a('0x46')](_0x361f30);})[_0x375a('0x28')](function(_0xeb0123){_0x278d75[_0x375a('0x47')]=_0xeb0123;return _0x278d75;})[_0x375a('0x28')](respondWithFilteredResult(_0xe3cd51,_0x361f30))['catch'](handleError(_0xe3cd51,null));})[_0x375a('0x48')](handleError(_0xe3cd51,null));};exports[_0x375a('0x49')]=function(_0x1f37c4,_0xfe202c){var _0x5adbb1={'raw':![],'where':{'id':_0x1f37c4[_0x375a('0x4a')]['id']}},_0x23460e={};_0x23460e[_0x375a('0x35')]=_[_0x375a('0x33')](db[_0x375a('0x31')]['rawAttributes']);_0x23460e[_0x375a('0x32')]=_[_0x375a('0x33')](_0x1f37c4[_0x375a('0x32')]);_0x23460e['filters']=_[_0x375a('0x34')](_0x23460e[_0x375a('0x35')],_0x23460e['query']);_0x5adbb1[_0x375a('0x37')]=_[_0x375a('0x34')](_0x23460e[_0x375a('0x35')],qs[_0x375a('0x36')](_0x1f37c4[_0x375a('0x32')][_0x375a('0x36')]));_0x5adbb1[_0x375a('0x37')]=_0x5adbb1[_0x375a('0x37')]['length']?_0x5adbb1[_0x375a('0x37')]:_0x23460e['model'];if(_0x1f37c4[_0x375a('0x32')][_0x375a('0x44')]){_0x5adbb1['include']=[{'all':!![]}];}_0x5adbb1=_[_0x375a('0x41')]({},_0x5adbb1,_0x1f37c4['options']);return db['CmCompany']['find'](_0x5adbb1)[_0x375a('0x28')](handleEntityNotFound(_0xfe202c,null))[_0x375a('0x28')](respondWithResult(_0xfe202c,null))['catch'](handleError(_0xfe202c,null));};exports['create']=function(_0x5b16c0,_0x55651d){return db[_0x375a('0x31')][_0x375a('0x4b')](_0x5b16c0[_0x375a('0x4c')],{})[_0x375a('0x28')](function(_0x3c2da3){var _0x45e4de=_0x5b16c0['user'][_0x375a('0x2a')]({'plain':!![]});if(!_0x45e4de)throw new Error(_0x375a('0x4d'));if(_0x45e4de['role']===_0x375a('0x4e')){var _0x2c558b=_0x3c2da3[_0x375a('0x2a')]({'plain':!![]});var _0x538a5a=_0x375a('0x4f');return db[_0x375a('0x50')]['find']({'where':{'name':_0x538a5a,'userProfileId':_0x45e4de[_0x375a('0x51')]},'raw':!![]})['then'](function(_0x3611d6){if(_0x3611d6&&_0x3611d6[_0x375a('0x52')]===0x0){return db[_0x375a('0x2b')][_0x375a('0x4b')]({'name':_0x2c558b[_0x375a('0x2e')],'resourceId':_0x2c558b['id'],'type':_0x3611d6['name'],'sectionId':_0x3611d6['id']},{})[_0x375a('0x28')](function(){return _0x3c2da3;});}else{return _0x3c2da3;}})[_0x375a('0x48')](function(_0x5db899){logger[_0x375a('0x53')](_0x375a('0x54'),_0x5db899);throw _0x5db899;});}return _0x3c2da3;})[_0x375a('0x28')](respondWithResult(_0x55651d,0xc9))['catch'](handleError(_0x55651d,null));};exports['update']=function(_0x2bfb02,_0x4c7e76){if(_0x2bfb02[_0x375a('0x4c')]['id']){delete _0x2bfb02[_0x375a('0x4c')]['id'];}return db[_0x375a('0x31')][_0x375a('0x55')]({'where':{'id':_0x2bfb02[_0x375a('0x4a')]['id']}})[_0x375a('0x28')](handleEntityNotFound(_0x4c7e76,null))[_0x375a('0x28')](saveUpdates(_0x2bfb02[_0x375a('0x4c')],null))[_0x375a('0x28')](respondWithResult(_0x4c7e76,null))[_0x375a('0x48')](handleError(_0x4c7e76,null));};exports[_0x375a('0x29')]=function(_0x58171d,_0x2bb4fa){return db['CmCompany'][_0x375a('0x55')]({'where':{'id':_0x58171d[_0x375a('0x4a')]['id']}})[_0x375a('0x28')](handleEntityNotFound(_0x2bb4fa,null))[_0x375a('0x28')](removeEntity(_0x2bb4fa,null))[_0x375a('0x48')](handleError(_0x2bb4fa,null));};exports['describe']=function(_0x43341c,_0x5cdd2f){return db[_0x375a('0x31')][_0x375a('0x56')]()['then'](respondWithResult(_0x5cdd2f,null))[_0x375a('0x48')](handleError(_0x5cdd2f,null));};exports[_0x375a('0x57')]=function(_0x7aa24b,_0x390648,_0x663ab0){return db['CmContact']['find']({'where':{'id':_0x7aa24b['params']['id']}})['then'](handleEntityNotFound(_0x390648,null))[_0x375a('0x28')](function(_0xecee74){if(_0xecee74){return _0xecee74[_0x375a('0x57')](_0x7aa24b[_0x375a('0x4c')][_0x375a('0x58')],_[_0x375a('0x59')](_0x7aa24b[_0x375a('0x4c')],[_0x375a('0x58'),'id'])||{});}})[_0x375a('0x28')](respondWithResult(_0x390648,null))[_0x375a('0x48')](handleError(_0x390648,null));};exports[_0x375a('0x5a')]=function(_0xf0112a,_0x20419f,_0x3ee3b1){var _0x565979={};var _0x63382e={};var _0x36b6ad;var _0x186c4d;return db[_0x375a('0x31')][_0x375a('0x5b')]({'where':{'id':_0xf0112a[_0x375a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20419f,null))['then'](function(_0x499138){if(_0x499138){_0x36b6ad=_0x499138;_0x63382e['model']=_[_0x375a('0x33')](db[_0x375a('0x5c')][_0x375a('0x5d')]);_0x63382e[_0x375a('0x32')]=_[_0x375a('0x33')](_0xf0112a[_0x375a('0x32')]);_0x63382e[_0x375a('0x3e')]=_[_0x375a('0x34')](_0x63382e[_0x375a('0x35')],_0x63382e[_0x375a('0x32')]);_0x565979[_0x375a('0x37')]=_['intersection'](_0x63382e[_0x375a('0x35')],qs[_0x375a('0x36')](_0xf0112a[_0x375a('0x32')]['fields']));_0x565979[_0x375a('0x37')]=_0x565979[_0x375a('0x37')]['length']?_0x565979['attributes']:_0x63382e[_0x375a('0x35')];_0x565979[_0x375a('0x3b')]=qs[_0x375a('0x3c')](_0xf0112a[_0x375a('0x32')][_0x375a('0x3c')]);_0x565979[_0x375a('0x3d')]=qs[_0x375a('0x3e')](_[_0x375a('0x3f')](_0xf0112a[_0x375a('0x32')],_0x63382e[_0x375a('0x3e')]));if(_0xf0112a[_0x375a('0x32')][_0x375a('0x40')]){_0x565979[_0x375a('0x3d')]=_['merge'](_0x565979[_0x375a('0x3d')],{'$or':_[_0x375a('0x42')](_0x565979[_0x375a('0x37')],function(_0x406970){var _0x49de0c={};_0x49de0c[_0x406970]={'$like':'%'+_0xf0112a[_0x375a('0x32')][_0x375a('0x40')]+'%'};return _0x49de0c;})});}_0x565979=_[_0x375a('0x41')]({},_0x565979,_0xf0112a[_0x375a('0x43')]);return _0x36b6ad['getContacts'](_0x565979);}})[_0x375a('0x28')](function(_0x292815){if(_0x292815){_0x186c4d=_0x292815['length'];if(!_0xf0112a[_0x375a('0x32')]['hasOwnProperty']('nolimit')){_0x565979['limit']=qs[_0x375a('0x21')](_0xf0112a[_0x375a('0x32')][_0x375a('0x21')]);_0x565979[_0x375a('0x1f')]=qs['offset'](_0xf0112a['query'][_0x375a('0x1f')]);}return _0x36b6ad[_0x375a('0x5a')](_0x565979);}})[_0x375a('0x28')](function(_0x42580d){if(_0x42580d){return _0x42580d?{'count':_0x186c4d,'rows':_0x42580d}:null;}})[_0x375a('0x28')](respondWithResult(_0x20419f,null))[_0x375a('0x48')](handleError(_0x20419f,null));}; \ No newline at end of file +var _0x7504=['keys','rawAttributes','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','omit','getContacts','pick','filter','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','save','destroy','get','Companies','UserProfileResource','then','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','options','findAll','rows','catch','show','params'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0x7504,0x119));var _0x4750=function(_0x58f345,_0x1ca759){_0x58f345=_0x58f345-0x0;var _0x273825=_0x7504[_0x58f345];return _0x273825;};'use strict';var emlformat=require(_0x4750('0x0'));var rimraf=require(_0x4750('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4750('0x2'));var rp=require('request-promise');var moment=require(_0x4750('0x3'));var BPromise=require(_0x4750('0x4'));var Mustache=require(_0x4750('0x5'));var util=require('util');var path=require(_0x4750('0x6'));var sox=require(_0x4750('0x7'));var csv=require(_0x4750('0x8'));var ejs=require(_0x4750('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4750('0xa'));var squel=require(_0x4750('0xb'));var crypto=require(_0x4750('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4750('0xd'));var Papa=require(_0x4750('0xe'));var Redis=require(_0x4750('0xf'));var authService=require(_0x4750('0x10'));var qs=require(_0x4750('0x11'));var as=require(_0x4750('0x12'));var hardwareService=require(_0x4750('0x13'));var logger=require(_0x4750('0x14'))('api');var utils=require(_0x4750('0x15'));var config=require(_0x4750('0x16'));var licenseUtil=require(_0x4750('0x17'));var db=require(_0x4750('0x18'))['db'];function respondWithStatusCode(_0x4cb885,_0x4be216){_0x4be216=_0x4be216||0xcc;return function(_0xbe024){if(_0xbe024){return _0x4cb885['sendStatus'](_0x4be216);}return _0x4cb885[_0x4750('0x19')](_0x4be216)[_0x4750('0x1a')]();};}function respondWithResult(_0x5f0992,_0x3adf3c){_0x3adf3c=_0x3adf3c||0xc8;return function(_0x456be2){if(_0x456be2){return _0x5f0992[_0x4750('0x19')](_0x3adf3c)['json'](_0x456be2);}};}function respondWithFilteredResult(_0x1ea736,_0x520433){return function(_0x50e9bc){if(_0x50e9bc){var _0x2f9032=typeof _0x520433[_0x4750('0x1b')]===_0x4750('0x1c')&&typeof _0x520433['limit']===_0x4750('0x1c');var _0xd67d55=_0x50e9bc['count'];var _0x42743f=_0x2f9032?0x0:_0x520433[_0x4750('0x1b')];var _0x35df59=_0x2f9032?_0x50e9bc[_0x4750('0x1d')]:_0x520433[_0x4750('0x1b')]+_0x520433['limit'];var _0xed3cd4;if(_0x35df59>=_0xd67d55){_0x35df59=_0xd67d55;_0xed3cd4=0xc8;}else{_0xed3cd4=0xce;}_0x1ea736[_0x4750('0x19')](_0xed3cd4);return _0x1ea736[_0x4750('0x1e')](_0x4750('0x1f'),_0x42743f+'-'+_0x35df59+'/'+_0xd67d55)['json'](_0x50e9bc);}return null;};}function patchUpdates(_0x37be60){return function(_0x468175){try{jsonpatch[_0x4750('0x20')](_0x468175,_0x37be60,!![]);}catch(_0x12b12c){return BPromise['reject'](_0x12b12c);}return _0x468175[_0x4750('0x21')]();};}function saveUpdates(_0x5d6284,_0x5613ac){return function(_0x7e2d){if(_0x7e2d){return _0x7e2d['update'](_0x5d6284)['then'](function(_0x5699c5){return _0x5699c5;});}return null;};}function removeEntity(_0xbf53af,_0x59b9ac){return function(_0x570c41){if(_0x570c41){return _0x570c41[_0x4750('0x22')]()['then'](function(){var _0x203287=_0x570c41[_0x4750('0x23')]({'plain':!![]});var _0x5e1dd7=_0x4750('0x24');return db[_0x4750('0x25')]['destroy']({'where':{'type':_0x5e1dd7,'resourceId':_0x203287['id']}})['then'](function(){return _0x570c41;});})[_0x4750('0x26')](function(){_0xbf53af['status'](0xcc)[_0x4750('0x1a')]();});}};}function handleEntityNotFound(_0x596b86,_0x1ffe7f){return function(_0x4dec51){if(!_0x4dec51){_0x596b86[_0x4750('0x27')](0x194);}return _0x4dec51;};}function handleError(_0x154991,_0x184431){_0x184431=_0x184431||0x1f4;return function(_0x42fb36){logger[_0x4750('0x28')](_0x42fb36[_0x4750('0x29')]);if(_0x42fb36[_0x4750('0x2a')]){delete _0x42fb36[_0x4750('0x2a')];}_0x154991['status'](_0x184431)[_0x4750('0x2b')](_0x42fb36);};}exports[_0x4750('0x2c')]=function(_0x1e7435,_0xd68080){var _0x1db08f={},_0x4ec871={},_0x2deb28={'count':0x0,'rows':[]};return db[_0x4750('0x2d')][_0x4750('0x2e')]()['then'](function(_0x2bccf3){_0x4ec871[_0x4750('0x2f')]=_['keys'](_0x2bccf3);_0x4ec871[_0x4750('0x30')]=_['keys'](_0x1e7435[_0x4750('0x30')]);_0x4ec871[_0x4750('0x31')]=_[_0x4750('0x32')](_0x4ec871[_0x4750('0x2f')],_0x4ec871[_0x4750('0x30')]);_0x1db08f[_0x4750('0x33')]=_[_0x4750('0x32')](_0x4ec871['model'],qs[_0x4750('0x34')](_0x1e7435[_0x4750('0x30')][_0x4750('0x34')]));_0x1db08f[_0x4750('0x33')]=_0x1db08f[_0x4750('0x33')]['length']?_0x1db08f['attributes']:_0x4ec871[_0x4750('0x2f')];if(!_0x1e7435[_0x4750('0x30')][_0x4750('0x35')](_0x4750('0x36'))){_0x1db08f[_0x4750('0x37')]=qs['limit'](_0x1e7435['query'][_0x4750('0x37')]);_0x1db08f[_0x4750('0x1b')]=qs[_0x4750('0x1b')](_0x1e7435['query'][_0x4750('0x1b')]);}_0x1db08f[_0x4750('0x38')]=qs['sort'](_0x1e7435[_0x4750('0x30')][_0x4750('0x39')]);_0x1db08f['where']=qs[_0x4750('0x31')](_['pick'](_0x1e7435[_0x4750('0x30')],_0x4ec871[_0x4750('0x31')]),_0x2bccf3);if(_0x1e7435[_0x4750('0x30')]['filter']){_0x1db08f[_0x4750('0x3a')]=_[_0x4750('0x3b')](_0x1db08f[_0x4750('0x3a')],{'$or':_[_0x4750('0x3c')](_0x1db08f[_0x4750('0x33')],function(_0x2872d3){var _0x360d7b={};_0x360d7b[_0x2872d3]={'$like':'%'+_0x1e7435[_0x4750('0x30')]['filter']+'%'};return _0x360d7b;})});}_0x1db08f=_[_0x4750('0x3b')]({},_0x1db08f,_0x1e7435[_0x4750('0x3d')]);var _0x376dda={'where':_0x1db08f[_0x4750('0x3a')]};return db[_0x4750('0x2d')][_0x4750('0x1d')](_0x376dda)[_0x4750('0x26')](function(_0x544091){_0x2deb28[_0x4750('0x1d')]=_0x544091;if(_0x1e7435[_0x4750('0x30')]['includeAll']){_0x1db08f['include']=[{'all':!![]}];}return db[_0x4750('0x2d')][_0x4750('0x3e')](_0x1db08f);})[_0x4750('0x26')](function(_0x4bf157){_0x2deb28[_0x4750('0x3f')]=_0x4bf157;return _0x2deb28;})['then'](respondWithFilteredResult(_0xd68080,_0x1db08f))['catch'](handleError(_0xd68080,null));})[_0x4750('0x40')](handleError(_0xd68080,null));};exports[_0x4750('0x41')]=function(_0x30cf4d,_0x51d131){var _0x5ce9ec={'raw':![],'where':{'id':_0x30cf4d[_0x4750('0x42')]['id']}},_0x5cda03={};_0x5cda03[_0x4750('0x2f')]=_[_0x4750('0x43')](db['CmCompany'][_0x4750('0x44')]);_0x5cda03[_0x4750('0x30')]=_[_0x4750('0x43')](_0x30cf4d[_0x4750('0x30')]);_0x5cda03[_0x4750('0x31')]=_[_0x4750('0x32')](_0x5cda03[_0x4750('0x2f')],_0x5cda03[_0x4750('0x30')]);_0x5ce9ec['attributes']=_[_0x4750('0x32')](_0x5cda03[_0x4750('0x2f')],qs[_0x4750('0x34')](_0x30cf4d['query'][_0x4750('0x34')]));_0x5ce9ec[_0x4750('0x33')]=_0x5ce9ec[_0x4750('0x33')][_0x4750('0x45')]?_0x5ce9ec[_0x4750('0x33')]:_0x5cda03[_0x4750('0x2f')];if(_0x30cf4d['query'][_0x4750('0x46')]){_0x5ce9ec[_0x4750('0x47')]=[{'all':!![]}];}_0x5ce9ec=_[_0x4750('0x3b')]({},_0x5ce9ec,_0x30cf4d[_0x4750('0x3d')]);return db[_0x4750('0x2d')]['find'](_0x5ce9ec)['then'](handleEntityNotFound(_0x51d131,null))['then'](respondWithResult(_0x51d131,null))[_0x4750('0x40')](handleError(_0x51d131,null));};exports[_0x4750('0x48')]=function(_0x294fd4,_0x5fb78f){return db['CmCompany']['create'](_0x294fd4['body'],{})['then'](function(_0x29ecc8){var _0x267a3d=_0x294fd4[_0x4750('0x49')][_0x4750('0x23')]({'plain':!![]});if(!_0x267a3d)throw new Error(_0x4750('0x4a'));if(_0x267a3d['role']===_0x4750('0x49')){var _0x457990=_0x29ecc8[_0x4750('0x23')]({'plain':!![]});var _0x4b77fc='Companies';return db[_0x4750('0x4b')][_0x4750('0x4c')]({'where':{'name':_0x4b77fc,'userProfileId':_0x267a3d['userProfileId']},'raw':!![]})[_0x4750('0x26')](function(_0x343a97){if(_0x343a97&&_0x343a97[_0x4750('0x4d')]===0x0){return db[_0x4750('0x25')][_0x4750('0x48')]({'name':_0x457990[_0x4750('0x2a')],'resourceId':_0x457990['id'],'type':_0x343a97['name'],'sectionId':_0x343a97['id']},{})[_0x4750('0x26')](function(){return _0x29ecc8;});}else{return _0x29ecc8;}})[_0x4750('0x40')](function(_0x3e48a4){logger[_0x4750('0x28')](_0x4750('0x4e'),_0x3e48a4);throw _0x3e48a4;});}return _0x29ecc8;})[_0x4750('0x26')](respondWithResult(_0x5fb78f,0xc9))['catch'](handleError(_0x5fb78f,null));};exports[_0x4750('0x4f')]=function(_0x389bbf,_0x1e50c1){if(_0x389bbf[_0x4750('0x50')]['id']){delete _0x389bbf[_0x4750('0x50')]['id'];}return db[_0x4750('0x2d')][_0x4750('0x4c')]({'where':{'id':_0x389bbf[_0x4750('0x42')]['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x1e50c1,null))[_0x4750('0x26')](saveUpdates(_0x389bbf[_0x4750('0x50')],null))[_0x4750('0x26')](respondWithResult(_0x1e50c1,null))[_0x4750('0x40')](handleError(_0x1e50c1,null));};exports[_0x4750('0x22')]=function(_0x587bd6,_0x1e0dc7){return db[_0x4750('0x2d')][_0x4750('0x4c')]({'where':{'id':_0x587bd6[_0x4750('0x42')]['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x1e0dc7,null))[_0x4750('0x26')](removeEntity(_0x1e0dc7,null))[_0x4750('0x40')](handleError(_0x1e0dc7,null));};exports['describe']=function(_0x3cba5b,_0x630488){return db[_0x4750('0x2d')][_0x4750('0x2e')]()['then'](respondWithResult(_0x630488,null))[_0x4750('0x40')](handleError(_0x630488,null));};exports[_0x4750('0x51')]=function(_0x1b257a,_0x307675,_0x5588a5){return db[_0x4750('0x52')]['find']({'where':{'id':_0x1b257a[_0x4750('0x42')]['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x307675,null))[_0x4750('0x26')](function(_0x300a9a){if(_0x300a9a){return _0x300a9a[_0x4750('0x51')](_0x1b257a[_0x4750('0x50')]['ids'],_[_0x4750('0x53')](_0x1b257a['body'],['ids','id'])||{});}})[_0x4750('0x26')](respondWithResult(_0x307675,null))['catch'](handleError(_0x307675,null));};exports[_0x4750('0x54')]=function(_0x463e34,_0x525600,_0x53c20a){var _0x1f20a1={};var _0x174ed9={};var _0x3bf0ce;var _0x3fc3b1;return db[_0x4750('0x2d')]['findOne']({'where':{'id':_0x463e34['params']['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x525600,null))[_0x4750('0x26')](function(_0x373b2b){if(_0x373b2b){_0x3bf0ce=_0x373b2b;_0x174ed9['model']=_[_0x4750('0x43')](db[_0x4750('0x52')][_0x4750('0x44')]);_0x174ed9[_0x4750('0x30')]=_[_0x4750('0x43')](_0x463e34['query']);_0x174ed9[_0x4750('0x31')]=_[_0x4750('0x32')](_0x174ed9['model'],_0x174ed9[_0x4750('0x30')]);_0x1f20a1[_0x4750('0x33')]=_[_0x4750('0x32')](_0x174ed9[_0x4750('0x2f')],qs['fields'](_0x463e34[_0x4750('0x30')][_0x4750('0x34')]));_0x1f20a1[_0x4750('0x33')]=_0x1f20a1[_0x4750('0x33')][_0x4750('0x45')]?_0x1f20a1[_0x4750('0x33')]:_0x174ed9[_0x4750('0x2f')];_0x1f20a1['order']=qs[_0x4750('0x39')](_0x463e34[_0x4750('0x30')][_0x4750('0x39')]);_0x1f20a1[_0x4750('0x3a')]=qs[_0x4750('0x31')](_[_0x4750('0x55')](_0x463e34[_0x4750('0x30')],_0x174ed9['filters']));if(_0x463e34[_0x4750('0x30')]['filter']){_0x1f20a1[_0x4750('0x3a')]=_[_0x4750('0x3b')](_0x1f20a1[_0x4750('0x3a')],{'$or':_[_0x4750('0x3c')](_0x1f20a1[_0x4750('0x33')],function(_0x5d25fe){var _0x530e02={};_0x530e02[_0x5d25fe]={'$like':'%'+_0x463e34[_0x4750('0x30')][_0x4750('0x56')]+'%'};return _0x530e02;})});}_0x1f20a1=_['merge']({},_0x1f20a1,_0x463e34['options']);return _0x3bf0ce[_0x4750('0x54')](_0x1f20a1);}})[_0x4750('0x26')](function(_0x5c6ac3){if(_0x5c6ac3){_0x3fc3b1=_0x5c6ac3[_0x4750('0x45')];if(!_0x463e34['query']['hasOwnProperty'](_0x4750('0x36'))){_0x1f20a1[_0x4750('0x37')]=qs['limit'](_0x463e34[_0x4750('0x30')][_0x4750('0x37')]);_0x1f20a1['offset']=qs['offset'](_0x463e34[_0x4750('0x30')][_0x4750('0x1b')]);}return _0x3bf0ce[_0x4750('0x54')](_0x1f20a1);}})[_0x4750('0x26')](function(_0x1679b1){if(_0x1679b1){return _0x1679b1?{'count':_0x3fc3b1,'rows':_0x1679b1}:null;}})[_0x4750('0x26')](respondWithResult(_0x525600,null))[_0x4750('0x40')](handleError(_0x525600,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 8e8ed48..d809c21 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 _0x10f5=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x52ab8e,_0x3fa0b4){var _0x45fad2=function(_0x58a826){while(--_0x58a826){_0x52ab8e['push'](_0x52ab8e['shift']());}};_0x45fad2(++_0x3fa0b4);}(_0x10f5,0x179));var _0x510f=function(_0x3f4574,_0x4f6461){_0x3f4574=_0x3f4574-0x0;var _0x4d139a=_0x10f5[_0x3f4574];return _0x4d139a;};'use strict';var _=require(_0x510f('0x0'));var util=require('util');var logger=require(_0x510f('0x1'))(_0x510f('0x2'));var moment=require(_0x510f('0x3'));var BPromise=require(_0x510f('0x4'));var rp=require(_0x510f('0x5'));var fs=require('fs');var path=require(_0x510f('0x6'));var rimraf=require('rimraf');var config=require(_0x510f('0x7'));var attributes=require(_0x510f('0x8'));module[_0x510f('0x9')]=function(_0x197eca,_0x3a9509){return _0x197eca[_0x510f('0xa')](_0x510f('0xb'),attributes,{'tableName':_0x510f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb601=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api'];(function(_0x40b241,_0x2ce6cc){var _0x22b4b1=function(_0x83fc40){while(--_0x83fc40){_0x40b241['push'](_0x40b241['shift']());}};_0x22b4b1(++_0x2ce6cc);}(_0xb601,0xa6));var _0x1b60=function(_0x1b68ff,_0x5e68a2){_0x1b68ff=_0x1b68ff-0x0;var _0x4b3b07=_0xb601[_0x1b68ff];return _0x4b3b07;};'use strict';var _=require('lodash');var util=require(_0x1b60('0x0'));var logger=require(_0x1b60('0x1'))(_0x1b60('0x2'));var moment=require(_0x1b60('0x3'));var BPromise=require(_0x1b60('0x4'));var rp=require(_0x1b60('0x5'));var fs=require('fs');var path=require(_0x1b60('0x6'));var rimraf=require(_0x1b60('0x7'));var config=require(_0x1b60('0x8'));var attributes=require(_0x1b60('0x9'));module[_0x1b60('0xa')]=function(_0x1779b4,_0x3e085c){return _0x1779b4[_0x1b60('0xb')](_0x1b60('0xc'),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 ed2455e..73e82ff 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 _0x87d5=['message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x1e3a75,_0x2214ab){var _0x343613=function(_0x1ed92e){while(--_0x1ed92e){_0x1e3a75['push'](_0x1e3a75['shift']());}};_0x343613(++_0x2214ab);}(_0x87d5,0x12f));var _0x587d=function(_0x334fa0,_0x36282b){_0x334fa0=_0x334fa0-0x0;var _0x3e5ede=_0x87d5[_0x334fa0];return _0x3e5ede;};'use strict';var _=require(_0x587d('0x0'));var util=require(_0x587d('0x1'));var moment=require(_0x587d('0x2'));var BPromise=require(_0x587d('0x3'));var rs=require(_0x587d('0x4'));var fs=require('fs');var Redis=require(_0x587d('0x5'));var db=require(_0x587d('0x6'))['db'];var utils=require(_0x587d('0x7'));var logger=require(_0x587d('0x8'))('rpc');var config=require(_0x587d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x587d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6a819,_0x21c065,_0x1e8e8b){return new BPromise(function(_0x291c4d,_0x334418){return client[_0x587d('0xb')](_0xa6a819,_0x1e8e8b)[_0x587d('0xc')](function(_0x15c63f){logger[_0x587d('0xd')]('CmCompany,\x20%s,\x20%s',_0x21c065,'request\x20sent');logger[_0x587d('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x21c065,_0x587d('0xf'),JSON[_0x587d('0x10')](_0x15c63f));if(_0x15c63f['error']){if(_0x15c63f[_0x587d('0x11')][_0x587d('0x12')]===0x1f4){logger[_0x587d('0x11')]('CmCompany,\x20%s,\x20%s',_0x21c065,_0x15c63f['error'][_0x587d('0x13')]);return _0x334418(_0x15c63f[_0x587d('0x11')][_0x587d('0x13')]);}logger['error'](_0x587d('0x14'),_0x21c065,_0x15c63f[_0x587d('0x11')]['message']);return _0x291c4d(_0x15c63f[_0x587d('0x11')][_0x587d('0x13')]);}else{logger[_0x587d('0xd')](_0x587d('0x14'),_0x21c065,_0x587d('0xf'));_0x291c4d(_0x15c63f[_0x587d('0x15')][_0x587d('0x13')]);}})[_0x587d('0x16')](function(_0x3ac2e0){logger[_0x587d('0x11')](_0x587d('0x14'),_0x21c065,_0x3ac2e0);_0x334418(_0x3ac2e0);});});} \ No newline at end of file +var _0xb07e=['request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmCompany,\x20%s,\x20%s'];(function(_0x108c2f,_0x3fa957){var _0x38f2c8=function(_0x43b7dc){while(--_0x43b7dc){_0x108c2f['push'](_0x108c2f['shift']());}};_0x38f2c8(++_0x3fa957);}(_0xb07e,0x15b));var _0xeb07=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb07e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xeb07('0x0'));var util=require('util');var moment=require(_0xeb07('0x1'));var BPromise=require(_0xeb07('0x2'));var rs=require(_0xeb07('0x3'));var fs=require('fs');var Redis=require(_0xeb07('0x4'));var db=require(_0xeb07('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb07('0x6'))(_0xeb07('0x7'));var config=require(_0xeb07('0x8'));var jayson=require(_0xeb07('0x9'));var client=jayson['client'][_0xeb07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47eed7,_0x1e88a9,_0xe5063c){return new BPromise(function(_0x12a6cf,_0x5f7645){return client[_0xeb07('0xb')](_0x47eed7,_0xe5063c)['then'](function(_0x406895){logger['info'](_0xeb07('0xc'),_0x1e88a9,_0xeb07('0xd'));logger['debug'](_0xeb07('0xe'),_0x1e88a9,'request\x20sent',JSON[_0xeb07('0xf')](_0x406895));if(_0x406895[_0xeb07('0x10')]){if(_0x406895[_0xeb07('0x10')][_0xeb07('0x11')]===0x1f4){logger[_0xeb07('0x10')](_0xeb07('0xc'),_0x1e88a9,_0x406895[_0xeb07('0x10')]['message']);return _0x5f7645(_0x406895[_0xeb07('0x10')]['message']);}logger['error'](_0xeb07('0xc'),_0x1e88a9,_0x406895[_0xeb07('0x10')][_0xeb07('0x12')]);return _0x12a6cf(_0x406895[_0xeb07('0x10')][_0xeb07('0x12')]);}else{logger['info'](_0xeb07('0xc'),_0x1e88a9,_0xeb07('0xd'));_0x12a6cf(_0x406895[_0xeb07('0x13')][_0xeb07('0x12')]);}})['catch'](function(_0x2b04fc){logger[_0xeb07('0x10')]('CmCompany,\x20%s,\x20%s',_0x1e88a9,_0x2b04fc);_0x5f7645(_0x2b04fc);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9e64c31..cbf62f0 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 _0x769b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','show','getContacts','post','/:id/contacts','put','update','delete','destroy','exports','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x769b,0x1e3));var _0xb769=function(_0x51c5d3,_0x13e47c){_0x51c5d3=_0x51c5d3-0x0;var _0xf47a28=_0x769b[_0x51c5d3];return _0xf47a28;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb769('0x0'));var timeout=require(_0xb769('0x1'));var express=require(_0xb769('0x2'));var router=express[_0xb769('0x3')]();var fs_extra=require(_0xb769('0x4'));var auth=require(_0xb769('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb769('0x6'));var controller=require(_0xb769('0x7'));router['get']('/',auth[_0xb769('0x8')](),controller[_0xb769('0x9')]);router[_0xb769('0xa')](_0xb769('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb769('0xa')](_0xb769('0xc'),auth['isAuthenticated'](),controller[_0xb769('0xd')]);router[_0xb769('0xa')]('/:id/contacts',auth[_0xb769('0x8')](),controller[_0xb769('0xe')]);router[_0xb769('0xf')]('/',auth[_0xb769('0x8')](),controller['create']);router[_0xb769('0xf')](_0xb769('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0xb769('0x11')]('/:id',auth[_0xb769('0x8')](),controller[_0xb769('0x12')]);router[_0xb769('0x13')]('/:id',auth[_0xb769('0x8')](),controller[_0xb769('0x14')]);module[_0xb769('0x15')]=router; \ No newline at end of file +var _0x4f73=['/:id','/:id/contacts','getContacts','post','create','addContacts','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x4f73,0x168));var _0x34f7=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x4f73[_0x57cb4f];return _0x29bb45;};'use strict';var multer=require(_0x34f7('0x0'));var util=require(_0x34f7('0x1'));var path=require('path');var timeout=require(_0x34f7('0x2'));var express=require(_0x34f7('0x3'));var router=express[_0x34f7('0x4')]();var fs_extra=require(_0x34f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x34f7('0x6'));var config=require(_0x34f7('0x7'));var controller=require(_0x34f7('0x8'));router[_0x34f7('0x9')]('/',auth[_0x34f7('0xa')](),controller[_0x34f7('0xb')]);router[_0x34f7('0x9')](_0x34f7('0xc'),auth[_0x34f7('0xa')](),controller[_0x34f7('0xd')]);router[_0x34f7('0x9')](_0x34f7('0xe'),auth[_0x34f7('0xa')](),controller['show']);router[_0x34f7('0x9')](_0x34f7('0xf'),auth[_0x34f7('0xa')](),controller[_0x34f7('0x10')]);router[_0x34f7('0x11')]('/',auth[_0x34f7('0xa')](),controller[_0x34f7('0x12')]);router['post']('/:id/contacts',auth[_0x34f7('0xa')](),controller[_0x34f7('0x13')]);router['put'](_0x34f7('0xe'),auth['isAuthenticated'](),controller[_0x34f7('0x14')]);router['delete'](_0x34f7('0xe'),auth[_0x34f7('0xa')](),controller['destroy']);module[_0x34f7('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index cef25fe..9a15dc0 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 _0xca35=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x1832db,_0x353897){var _0xbdc485=function(_0x40920d){while(--_0x40920d){_0x1832db['push'](_0x1832db['shift']());}};_0xbdc485(++_0x353897);}(_0xca35,0x1b7));var _0x5ca3=function(_0xab6a2b,_0x403a6b){_0xab6a2b=_0xab6a2b-0x0;var _0x33edba=_0xca35[_0xab6a2b];return _0x33edba;};'use strict';var _=require(_0x5ca3('0x0'));var Sequelize=require(_0x5ca3('0x1'));module[_0x5ca3('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5ca3('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5ca3('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5ca3('0x4')]},'phone':{'type':Sequelize[_0x5ca3('0x3')]},'mobile':{'type':Sequelize[_0x5ca3('0x3')]},'fax':{'type':Sequelize[_0x5ca3('0x3')]},'email':{'type':Sequelize[_0x5ca3('0x3')]},'url':{'type':Sequelize[_0x5ca3('0x3')]},'facebook':{'type':Sequelize[_0x5ca3('0x3')]},'fb_data':{'type':Sequelize[_0x5ca3('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x5ca3('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x5ca3('0x3')]},'line':{'type':Sequelize[_0x5ca3('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x5ca3('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x5ca3('0x5')](0x2)[_0x5ca3('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5ca3('0x7')],'defaultValue':Sequelize[_0x5ca3('0x8')]}}; \ No newline at end of file +var _0x4606=['INTEGER','DATE','NOW','sequelize','exports','STRING'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x4606,0x81));var _0x6460=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4606[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var Sequelize=require(_0x6460('0x0'));module[_0x6460('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x6460('0x2')]},'street':{'type':Sequelize[_0x6460('0x2')]},'postalCode':{'type':Sequelize[_0x6460('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6460('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6460('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6460('0x2')]},'fax':{'type':Sequelize[_0x6460('0x2')]},'email':{'type':Sequelize[_0x6460('0x2')]},'url':{'type':Sequelize[_0x6460('0x2')]},'facebook':{'type':Sequelize[_0x6460('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x6460('0x2')]},'teams':{'type':Sequelize[_0x6460('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x6460('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x6460('0x2')]},'UserId':{'type':Sequelize[_0x6460('0x3')]},'priority':{'type':Sequelize[_0x6460('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6460('0x4')],'defaultValue':Sequelize[_0x6460('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 32e6e73..6be0793 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 _0x4017=['sequelize','toString','fields','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','params','catch','columnName','findAll','alias','custom','values','merge','body','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','get','$and','cf_%d','omit','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','pick','options','nolimit','setTags','findOne','ids','getHoppers','CmHopper','ContactId','includeAll','include','CmHopperHistory','getHopperFinals','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','CompanyId','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','duration','note','userThirdDisposition','UserId','fullname','VoiceCallReport','startCase','Website','Account','closed','disposition','secondDisposition','thirdDisposition','Owner','createdAt','customerPort','osName','ratingMessage','ratingType','ratingValue','mail','subject','substatus','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','parseSearch','search','sqlOperator','conditions','find','Tag','value','map','union','User','and','dateOfBirth','datetime','castTo','text','start','filter','isNil','Contact','push','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','QueryTypes','clone','c.id','DESC','having','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL'];(function(_0x1f67bc,_0x3e86b4){var _0x2959aa=function(_0x472da1){while(--_0x472da1){_0x1f67bc['push'](_0x1f67bc['shift']());}};_0x2959aa(++_0x3e86b4);}(_0x4017,0xa0));var _0x7401=function(_0xe5dd64,_0x73a5ea){_0xe5dd64=_0xe5dd64-0x0;var _0x124d3f=_0x4017[_0xe5dd64];return _0x124d3f;};'use strict';var moment=require('moment');var BPromise=require(_0x7401('0x0'));var util=require(_0x7401('0x1'));var path=require(_0x7401('0x2'));var fs=require('fs');var _=require(_0x7401('0x3'));var squel=require(_0x7401('0x4'));var Papa=require(_0x7401('0x5'));var Redis=require(_0x7401('0x6'));var qs=require(_0x7401('0x7'));var as=require(_0x7401('0x8'));var logger=require(_0x7401('0x9'))('api');var config=require(_0x7401('0xa'));var db=require('../../mysqldb')['db'];config[_0x7401('0xb')]=_[_0x7401('0xc')](config['redis'],{'host':_0x7401('0xd'),'port':0x18eb});var socket=require(_0x7401('0xe'))(new Redis(config[_0x7401('0xb')]));require(_0x7401('0xf'))[_0x7401('0x10')](socket);function respondWithResult(_0x82532,_0x48ff83){_0x48ff83=_0x48ff83||0xc8;return function(_0x444431){if(_0x444431){return _0x82532[_0x7401('0x11')](_0x48ff83)[_0x7401('0x12')](_0x444431);}};}function respondWithFilteredResult(_0x1e948d,_0x34631a){return function(_0x165a14){if(_0x165a14){var _0x56fd36=typeof _0x34631a[_0x7401('0x13')]===_0x7401('0x14')&&typeof _0x34631a[_0x7401('0x15')]==='undefined';var _0x1a3c9c=_0x165a14[_0x7401('0x16')];var _0x363455=_0x56fd36?0x0:_0x34631a[_0x7401('0x13')];var _0xa56308=_0x56fd36?_0x165a14[_0x7401('0x16')]:_0x34631a[_0x7401('0x13')]+_0x34631a[_0x7401('0x15')];var _0x39130d;if(_0xa56308>=_0x1a3c9c){_0xa56308=_0x1a3c9c;_0x39130d=0xc8;}else{_0x39130d=0xce;}_0x1e948d[_0x7401('0x11')](_0x39130d);return _0x1e948d[_0x7401('0x17')](_0x7401('0x18'),_0x363455+'-'+_0xa56308+'/'+_0x1a3c9c)[_0x7401('0x12')](_0x165a14);}return null;};}function saveUpdates(_0x3c4ffc){return function(_0x40dde2){if(_0x40dde2){return _0x40dde2[_0x7401('0x19')](_0x3c4ffc)[_0x7401('0x1a')](function(_0x47ebf0){return _0x47ebf0;});}return null;};}function removeEntity(_0x34c5d){return function(_0x443fc2){if(_0x443fc2){return _0x443fc2[_0x7401('0x1b')]()['then'](function(){_0x34c5d[_0x7401('0x11')](0xcc)[_0x7401('0x1c')]();});}};}function handleEntityNotFound(_0x13acc0){return function(_0x47cf51){if(!_0x47cf51){_0x13acc0['sendStatus'](0x194);}return _0x47cf51;};}function handleError(_0x31443e,_0x185ebb){_0x185ebb=_0x185ebb||0x1f4;return function(_0x3c5f7d){logger[_0x7401('0x1d')](_0x3c5f7d[_0x7401('0x1e')]);if(_0x3c5f7d['name']){delete _0x3c5f7d[_0x7401('0x1f')];}_0x31443e[_0x7401('0x11')](_0x185ebb)[_0x7401('0x20')](_0x3c5f7d);};}exports[_0x7401('0x21')]=function(_0x34a4b6,_0xfa6d9b){var _0xbe16b1={},_0x26c0d9={},_0x368814={'count':0x0,'rows':[]};return db[_0x7401('0x22')][_0x7401('0x23')]()['then'](function(_0x5be95e){var _0x2eebb5=[];for(var _0x2d3521=0x0;_0x2d35210x1){_0x2856aa['or'](_0x7401('0x5e'),qs['getFullTextValue'](_0x55febd),null);}else{if(qs[_0x7401('0x5f')](_0x55febd)){_0x2856aa['or'](_0x7401('0x60'),_0x55febd+'%');_0x2856aa['or'](_0x7401('0x61'),_0x55febd+'%');_0x2856aa['or']('c.mobile\x20LIKE\x20?',_0x55febd+'%');_0x2856aa['or'](_0x7401('0x62'),_0x55febd+'%');}else if(qs[_0x7401('0x63')](_0x55febd)){_0x2856aa['or'](_0x7401('0x64'),_0x55febd+'%');}else{_0x2856aa['or'](_0x7401('0x65'),'%'+_0x55febd+'%');_0x2856aa['or']('c.lastName\x20LIKE\x20?','%'+_0x55febd+'%');_0x2856aa['or']('c.email\x20LIKE\x20?','%'+_0x55febd+'%');}}}}_0x3fe090[_0x7401('0x35')](_0x2856aa);_0x3fe090[_0x7401('0x66')]('c.id');var _0x2adb18={'type':db['Sequelize'][_0x7401('0x67')]['SELECT'],'raw':!![]};var _0x2e2de1=_0x3fe090[_0x7401('0x68')]()[_0x7401('0x37')](_0x7401('0x69'));if(_0xbe16b1[_0x7401('0x33')]){_0xbe16b1['order'][_0x7401('0x55')](function(_0x5b09a8){_0x3fe090[_0x7401('0x33')]('c.'+_0x5b09a8[0x0],_0x5b09a8[0x1]===_0x7401('0x6a')?![]:!![]);});}if(!_[_0x7401('0x54')](_0xae4062)){_0x3fe090[_0x7401('0x6b')](_0x26cbf7);_0x2e2de1['where']('t.id\x20IN\x20?',_0xae4062);}BPromise[_0x7401('0x6c')]()['then'](function(){if(!_0x3b9aa7)return;if(_0x34a4b6[_0x7401('0x6d')][_0x7401('0x6e')]!==_0x7401('0x6f'))return;if(!_[_0x7401('0x70')](_0x3b9aa7[_0x7401('0x43')],[_0x7401('0x37'),_0x7401('0x49')])){return _0x34a4b6[_0x7401('0x6d')]['getLists']({'attributes':['id'],'raw':!![]})[_0x7401('0x1a')](function(_0x2ccbd5){if(_[_0x7401('0x54')](_0x2ccbd5)){_0x2e2de1['where']('c.ListId\x20IS\x20NULL');_0x3fe090['where'](_0x7401('0x71'));}else{_0x2e2de1['where'](_0x7401('0x57'),_['map'](_0x2ccbd5,'id'));_0x3fe090[_0x7401('0x35')](_0x7401('0x57'),_[_0x7401('0x47')](_0x2ccbd5,'id'));}});}})['then'](function(){if(_0x34a4b6[_0x7401('0x6d')]['role']===_0x7401('0x6f')&&!_0x3b9aa7&&!_0x34a4b6[_0x7401('0x2d')][_0x7401('0x56')])return[];return db[_0x7401('0x72')][_0x7401('0x2d')](_0x2e2de1['toString'](),_0x2adb18);})['then'](function(_0x1d2ba4){_0x368814['count']=_0x1d2ba4[_0x7401('0x31')];if(_0x368814[_0x7401('0x16')]===0x0)return[];return db[_0x7401('0x72')][_0x7401('0x2d')](_0x141dc5[_0x7401('0x73')](),_0x2adb18)[_0x7401('0x1a')](function(_0x25ddc6){_0x38a5cc=_['keyBy'](_0x25ddc6,'id');_0x2adb18=_['merge'](_0x2adb18,{'model':db[_0x7401('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x34a4b6[_0x7401('0x2d')][_0x7401('0x74')]){_0xbe16b1[_0x7401('0x30')]['forEach'](function(_0x2f3997){_0x3fe090[_0x7401('0x37')]('c.'+_0x2f3997);});}else{_0x3fe090[_0x7401('0x37')](_0x7401('0x69'));_0x3fe090['field'](_0x7401('0x75'));_0x3fe090['field']('c.lastName');_0x3fe090['field'](_0x7401('0x76'));_0x3fe090['field'](_0x7401('0x77'));_0x3fe090['field'](_0x7401('0x78'));_0x3fe090['field'](_0x7401('0x79'));_0x3fe090[_0x7401('0x37')](_0x7401('0x7a'));_0x3fe090[_0x7401('0x37')](_0x7401('0x7b'));_0x3fe090[_0x7401('0x37')](_0x7401('0x7c'));_0x3fe090['field'](_0x7401('0x7d'));_0x3fe090['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7401('0x7e'));}if(_0xbe16b1[_0x7401('0x15')])_0x3fe090[_0x7401('0x15')](_0xbe16b1[_0x7401('0x15')]);if(_0xbe16b1[_0x7401('0x13')])_0x3fe090[_0x7401('0x13')](_0xbe16b1[_0x7401('0x13')]);return db[_0x7401('0x72')][_0x7401('0x2d')](_0x3fe090[_0x7401('0x73')](),_0x2adb18);});})[_0x7401('0x1a')](function(_0x379f0a){_0x379f0a[_0x7401('0x55')](function(_0x7a8248){if(_0x7a8248['TagIds']){_0x7a8248['Tags']=[];_0x7a8248[_0x7401('0x7e')]['split'](',')['forEach'](function(_0x2f99f6){_0x7a8248[_0x7401('0x7f')]['push'](_0x38a5cc[_0x2f99f6]);});}delete _0x7a8248[_0x7401('0x7e')];});_0x368814[_0x7401('0x80')]=_0x379f0a;return _0x368814;})[_0x7401('0x1a')](respondWithFilteredResult(_0xfa6d9b,_0xbe16b1));})['catch'](handleError(_0xfa6d9b,null));};exports[_0x7401('0x1b')]=function(_0x1eb32c,_0x579dc6){return db['CmContact'][_0x7401('0x44')]({'where':{'id':_0x1eb32c[_0x7401('0x81')]['id']}})[_0x7401('0x1a')](handleEntityNotFound(_0x579dc6,null))[_0x7401('0x1a')](removeEntity(_0x579dc6,null))[_0x7401('0x82')](handleError(_0x579dc6,null));};exports['describe']=function(_0x2abdc6,_0x5dd7b3){return db[_0x7401('0x22')][_0x7401('0x23')]()[_0x7401('0x1a')](function(_0x3e2005){delete _0x3e2005['tags'];for(var _0x43ff0c=0x0;_0x43ff0c=_0x3efef7){_0x5a2f06=_0x3efef7;_0x196e93=0xc8;}else{_0x196e93=0xce;}_0xc43243[_0x4c03('0xe')](_0x196e93);return _0xc43243[_0x4c03('0x12')]('Content-Range',_0x281156+'-'+_0x5a2f06+'/'+_0x3efef7)[_0x4c03('0x13')](_0x3a88fc);}return null;};}function saveUpdates(_0x290399){return function(_0x2dd680){if(_0x2dd680){return _0x2dd680[_0x4c03('0x14')](_0x290399)['then'](function(_0x23309d){return _0x23309d;});}return null;};}function removeEntity(_0x59c2d0){return function(_0x19f3c6){if(_0x19f3c6){return _0x19f3c6['destroy']()[_0x4c03('0x15')](function(){_0x59c2d0[_0x4c03('0xe')](0xcc)[_0x4c03('0x16')]();});}};}function handleEntityNotFound(_0x491152){return function(_0x2a48c2){if(!_0x2a48c2){_0x491152[_0x4c03('0x17')](0x194);}return _0x2a48c2;};}function handleError(_0x5698c0,_0x13b312){_0x13b312=_0x13b312||0x1f4;return function(_0x73a70e){logger[_0x4c03('0x18')](_0x73a70e[_0x4c03('0x19')]);if(_0x73a70e[_0x4c03('0x1a')]){delete _0x73a70e[_0x4c03('0x1a')];}_0x5698c0[_0x4c03('0xe')](_0x13b312)['send'](_0x73a70e);};}exports[_0x4c03('0x1b')]=function(_0x2ec899,_0x3c26a3){var _0x3e466f={},_0x2b8a5f={},_0x1a7738={'count':0x0,'rows':[]};return db['CmContact'][_0x4c03('0x1c')]()[_0x4c03('0x15')](function(_0x46d895){var _0x55aaa9=[];for(var _0xfa46b2=0x0;_0xfa46b20x1){_0x517f18['or'](_0x4c03('0x55'),qs[_0x4c03('0x56')](_0x90f039),null);}else{if(qs['isNumeric'](_0x90f039)){_0x517f18['or'](_0x4c03('0x57'),_0x90f039+'%');_0x517f18['or'](_0x4c03('0x58'),_0x90f039+'%');_0x517f18['or'](_0x4c03('0x59'),_0x90f039+'%');_0x517f18['or'](_0x4c03('0x5a'),_0x90f039+'%');}else if(qs[_0x4c03('0x5b')](_0x90f039)){_0x517f18['or'](_0x4c03('0x5c'),_0x90f039+'%');}else{_0x517f18['or']('c.firstName\x20LIKE\x20?','%'+_0x90f039+'%');_0x517f18['or']('c.lastName\x20LIKE\x20?','%'+_0x90f039+'%');_0x517f18['or'](_0x4c03('0x5c'),'%'+_0x90f039+'%');}}}}_0xa29ab6[_0x4c03('0x36')](_0x517f18);_0xa29ab6[_0x4c03('0x5d')]('c.id');var _0x1841b7={'type':db[_0x4c03('0x5e')][_0x4c03('0x5f')][_0x4c03('0x60')],'raw':!![]};var _0x3ba228=_0xa29ab6['clone']()['field']('c.id');if(_0x3e466f[_0x4c03('0x61')]){_0x3e466f[_0x4c03('0x61')][_0x4c03('0x3d')](function(_0x2ef8e7){_0xa29ab6[_0x4c03('0x61')]('c.'+_0x2ef8e7[0x0],_0x2ef8e7[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4c03('0x4d')](_0x181fec)){_0xa29ab6[_0x4c03('0x62')](_0x5f7ac1);_0x3ba228[_0x4c03('0x36')](_0x4c03('0x63'),_0x181fec);}BPromise[_0x4c03('0x64')]()['then'](function(){if(!_0x5807ee)return;if(_0x2ec899['user'][_0x4c03('0x65')]!=='agent')return;if(!_[_0x4c03('0x66')](_0x5807ee[_0x4c03('0x3a')],[_0x4c03('0x2e'),_0x4c03('0x67')])){return _0x2ec899[_0x4c03('0x68')][_0x4c03('0x69')]({'attributes':['id'],'raw':!![]})[_0x4c03('0x15')](function(_0x26fb8f){if(_[_0x4c03('0x4d')](_0x26fb8f)){_0x3ba228[_0x4c03('0x36')](_0x4c03('0x6a'));_0xa29ab6[_0x4c03('0x36')](_0x4c03('0x6a'));}else{_0x3ba228[_0x4c03('0x36')](_0x4c03('0x4f'),_[_0x4c03('0x48')](_0x26fb8f,'id'));_0xa29ab6[_0x4c03('0x36')](_0x4c03('0x4f'),_[_0x4c03('0x48')](_0x26fb8f,'id'));}});}})[_0x4c03('0x15')](function(){if(_0x2ec899[_0x4c03('0x68')]['role']===_0x4c03('0x6b')&&!_0x5807ee&&!_0x2ec899[_0x4c03('0x24')][_0x4c03('0x4e')])return[];return db[_0x4c03('0x6c')]['query'](_0x3ba228[_0x4c03('0x6d')](),_0x1841b7);})[_0x4c03('0x15')](function(_0x5d8c15){_0x1a7738[_0x4c03('0x11')]=_0x5d8c15['length'];if(_0x1a7738[_0x4c03('0x11')]===0x0)return[];return db['sequelize'][_0x4c03('0x24')](_0x4fec81['toString'](),_0x1841b7)[_0x4c03('0x15')](function(_0x24faab){_0x3c2631=_[_0x4c03('0x6e')](_0x24faab,'id');_0x1841b7=_['merge'](_0x1841b7,{'model':db[_0x4c03('0x6f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ec899[_0x4c03('0x24')]['fields']){_0x3e466f[_0x4c03('0x27')][_0x4c03('0x3d')](function(_0x40091e){_0xa29ab6[_0x4c03('0x2e')]('c.'+_0x40091e);});}else{_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x70'));_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x71'));_0xa29ab6[_0x4c03('0x2e')]('c.lastName');_0xa29ab6[_0x4c03('0x2e')]('c.phone');_0xa29ab6['field'](_0x4c03('0x72'));_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x73'));_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x74'));_0xa29ab6['field']('c.ListId');_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x75'));_0xa29ab6['field'](_0x4c03('0x76'));_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x77'));_0xa29ab6[_0x4c03('0x2e')](_0x4c03('0x78'),_0x4c03('0x79'));}if(_0x3e466f['limit'])_0xa29ab6['limit'](_0x3e466f['limit']);if(_0x3e466f['offset'])_0xa29ab6[_0x4c03('0xf')](_0x3e466f[_0x4c03('0xf')]);return db[_0x4c03('0x6c')][_0x4c03('0x24')](_0xa29ab6[_0x4c03('0x6d')](),_0x1841b7);});})[_0x4c03('0x15')](function(_0x3dc3f7){_0x3dc3f7[_0x4c03('0x3d')](function(_0x57f753){if(_0x57f753[_0x4c03('0x79')]){_0x57f753[_0x4c03('0x7a')]=[];_0x57f753[_0x4c03('0x79')]['split'](',')[_0x4c03('0x3d')](function(_0x2ded0f){_0x57f753[_0x4c03('0x7a')][_0x4c03('0x4c')](_0x3c2631[_0x2ded0f]);});}delete _0x57f753[_0x4c03('0x79')];});_0x1a7738[_0x4c03('0x7b')]=_0x3dc3f7;return _0x1a7738;})[_0x4c03('0x15')](respondWithFilteredResult(_0x3c26a3,_0x3e466f));})[_0x4c03('0x7c')](handleError(_0x3c26a3,null));};exports['destroy']=function(_0x1a1981,_0x1b2f72){return db[_0x4c03('0x6f')][_0x4c03('0x7d')]({'where':{'id':_0x1a1981[_0x4c03('0x7e')]['id']}})[_0x4c03('0x15')](handleEntityNotFound(_0x1b2f72,null))[_0x4c03('0x15')](removeEntity(_0x1b2f72,null))[_0x4c03('0x7c')](handleError(_0x1b2f72,null));};exports['describe']=function(_0x5ca0f1,_0x3f52e1){return db[_0x4c03('0x6f')][_0x4c03('0x1c')]()[_0x4c03('0x15')](function(_0x3ee4b6){delete _0x3ee4b6['tags'];for(var _0x500a74=0x0;_0x500a74{}\s\\|]/g,'-');_0x45ac20(null,util[_0x310a('0x22')]('%s-%s%s',path[_0x310a('0x23')](_0x53cd81[_0x310a('0x20')],path[_0x310a('0x24')](_0x53cd81[_0x310a('0x20')])),Date[_0x310a('0x25')](),path['extname'](_0x53cd81['originalname'])));}})});router[_0x310a('0x16')]('/csv',upload[_0x310a('0x26')](_0x310a('0x27')),controller[_0x310a('0x28')]);var upload=multer({'storage':multer[_0x310a('0x29')]({'destination':function(_0xf99ec2,_0x2a4655,_0x2919fe){_0x2919fe(null,path[_0x310a('0x1d')](config[_0x310a('0x1e')],_0x310a('0x1f')));},'filename':function(_0x255a71,_0x5da3f7,_0x5199af){_0x5da3f7[_0x310a('0x20')]=_0x5da3f7['originalname'][_0x310a('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5199af(null,util[_0x310a('0x22')](_0x310a('0x2a'),path['basename'](_0x5da3f7['originalname'],path[_0x310a('0x24')](_0x5da3f7['originalname'])),Date[_0x310a('0x25')](),path[_0x310a('0x24')](_0x5da3f7[_0x310a('0x20')])));}})});router[_0x310a('0x16')]('/upload',upload[_0x310a('0x26')](_0x310a('0x27')),controller[_0x310a('0x2b')]);router[_0x310a('0x16')]('/upload/:id',auth['isAuthenticated'](),controller['import']);router[_0x310a('0x2c')](_0x310a('0xa'),auth['isAuthenticated'](),controller[_0x310a('0x2d')]);router[_0x310a('0x2e')](_0x310a('0xa'),auth[_0x310a('0x8')](),controller['destroy']);module[_0x310a('0x2f')]=router; \ No newline at end of file +var _0x0b14=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getJscriptySessions','/:id/journey','getJourney','post','/merge','create','/create_many','join','server/files/tmp','originalname','replace','format','%s-%s%s','extname','now','single','diskStorage','root','basename','/upload','file','/upload/:id','put','update','/:id','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x51c446,_0x3bcab0){var _0x2a9e54=function(_0x58a2e9){while(--_0x58a2e9){_0x51c446['push'](_0x51c446['shift']());}};_0x2a9e54(++_0x3bcab0);}(_0x0b14,0x168));var _0x40b1=function(_0x411315,_0x383367){_0x411315=_0x411315-0x0;var _0x5210a7=_0x0b14[_0x411315];return _0x5210a7;};'use strict';var multer=require(_0x40b1('0x0'));var util=require(_0x40b1('0x1'));var path=require(_0x40b1('0x2'));var timeout=require(_0x40b1('0x3'));var express=require(_0x40b1('0x4'));var router=express[_0x40b1('0x5')]();var fs_extra=require(_0x40b1('0x6'));var auth=require(_0x40b1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x40b1('0x8'));var controller=require('./cmContact.controller');router[_0x40b1('0x9')]('/',auth[_0x40b1('0xa')](),controller[_0x40b1('0xb')]);router['get'](_0x40b1('0xc'),auth[_0x40b1('0xa')](),controller[_0x40b1('0xd')]);router['get']('/:id',auth[_0x40b1('0xa')](),controller[_0x40b1('0xe')]);router[_0x40b1('0x9')](_0x40b1('0xf'),auth[_0x40b1('0xa')](),controller['getTags']);router[_0x40b1('0x9')](_0x40b1('0x10'),auth[_0x40b1('0xa')](),controller[_0x40b1('0x11')]);router[_0x40b1('0x9')](_0x40b1('0x12'),auth[_0x40b1('0xa')](),controller[_0x40b1('0x13')]);router['get'](_0x40b1('0x14'),auth[_0x40b1('0xa')](),controller['getHopperFinals']);router[_0x40b1('0x9')]('/:id/jscripty_sessions',auth[_0x40b1('0xa')](),controller[_0x40b1('0x15')]);router[_0x40b1('0x9')](_0x40b1('0x16'),auth['isAuthenticated'](),controller[_0x40b1('0x17')]);router[_0x40b1('0x18')](_0x40b1('0x19'),auth[_0x40b1('0xa')](),controller['merge']);router['post']('/',auth['isAuthenticated'](),controller[_0x40b1('0x1a')]);router['post'](_0x40b1('0x1b'),auth[_0x40b1('0xa')](),controller['bulkCreate']);router[_0x40b1('0x18')](_0x40b1('0xf'),auth[_0x40b1('0xa')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54f07c,_0x58c72d,_0x102432){_0x102432(null,path[_0x40b1('0x1c')](config['root'],_0x40b1('0x1d')));},'filename':function(_0x1cfe00,_0x5d7b0d,_0x6ba6a4){_0x5d7b0d[_0x40b1('0x1e')]=_0x5d7b0d['originalname'][_0x40b1('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6ba6a4(null,util[_0x40b1('0x20')](_0x40b1('0x21'),path['basename'](_0x5d7b0d[_0x40b1('0x1e')],path[_0x40b1('0x22')](_0x5d7b0d[_0x40b1('0x1e')])),Date[_0x40b1('0x23')](),path[_0x40b1('0x22')](_0x5d7b0d[_0x40b1('0x1e')])));}})});router[_0x40b1('0x18')]('/csv',upload[_0x40b1('0x24')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x40b1('0x25')]({'destination':function(_0x3c807a,_0x59a85c,_0x1d17a2){_0x1d17a2(null,path[_0x40b1('0x1c')](config[_0x40b1('0x26')],_0x40b1('0x1d')));},'filename':function(_0x1cce13,_0x53c6e2,_0x513a60){_0x53c6e2[_0x40b1('0x1e')]=_0x53c6e2[_0x40b1('0x1e')][_0x40b1('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x513a60(null,util['format'](_0x40b1('0x21'),path[_0x40b1('0x27')](_0x53c6e2[_0x40b1('0x1e')],path[_0x40b1('0x22')](_0x53c6e2['originalname'])),Date[_0x40b1('0x23')](),path[_0x40b1('0x22')](_0x53c6e2[_0x40b1('0x1e')])));}})});router[_0x40b1('0x18')](_0x40b1('0x28'),upload['single'](_0x40b1('0x29')),controller['upload']);router['post'](_0x40b1('0x2a'),auth['isAuthenticated'](),controller['import']);router[_0x40b1('0x2b')]('/:id',auth[_0x40b1('0xa')](),controller[_0x40b1('0x2c')]);router['delete'](_0x40b1('0x2d'),auth[_0x40b1('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index b4abe36..91b0245 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 _0x81f1=['lodash','exports','getDataValue','alias','setDataValue','STRING','TEXT','long','type','parse','values','isArray','stringify','BOOLEAN','voice','sequelize'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x81f1,0x17f));var _0x181f=function(_0x4489c9,_0x6736c5){_0x4489c9=_0x4489c9-0x0;var _0x2f347f=_0x81f1[_0x4489c9];return _0x2f347f;};'use strict';var Sequelize=require(_0x181f('0x0'));var _=require(_0x181f('0x1'));module[_0x181f('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5299e9){return this[_0x181f('0x3')](_0x181f('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1a4f8c){this[_0x181f('0x5')](_0x181f('0x4'),_0x1a4f8c?_0x1a4f8c:this[_0x181f('0x3')]('name'));}},'type':{'type':Sequelize[_0x181f('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x181f('0x7')](_0x181f('0x8')),'get':function(){if(this[_0x181f('0x3')](_0x181f('0x9'))==='select'){return JSON[_0x181f('0xa')](this[_0x181f('0x3')](_0x181f('0xb')));}else{return this[_0x181f('0x3')](_0x181f('0xb'));}},'set':function(_0x3b279a){if(Array[_0x181f('0xc')](_0x3b279a)){this[_0x181f('0x5')](_0x181f('0xb'),JSON[_0x181f('0xd')](_0x3b279a));}else{this[_0x181f('0x5')](_0x181f('0xb'),_0x3b279a);}}},'required':{'type':Sequelize[_0x181f('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x181f('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x181f('0xf'))}}; \ No newline at end of file +var _0xe3dc=['setDataValue','getDataValue','name','TEXT','long','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','lodash','exports','alias','STRING'];(function(_0x58e8b8,_0x3529f0){var _0xf67427=function(_0x3bee89){while(--_0x3bee89){_0x58e8b8['push'](_0x58e8b8['shift']());}};_0xf67427(++_0x3529f0);}(_0xe3dc,0xc8));var _0xce3d=function(_0x167348,_0x3081eb){_0x167348=_0x167348-0x0;var _0x4ab4d0=_0xe3dc[_0x167348];return _0x4ab4d0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xce3d('0x0'));module[_0xce3d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4049f3){return this['getDataValue'](_0xce3d('0x2'));}},'alias':{'type':Sequelize[_0xce3d('0x3')],'allowNull':![],'set':function(_0x4711e9){this[_0xce3d('0x4')](_0xce3d('0x2'),_0x4711e9?_0x4711e9:this[_0xce3d('0x5')](_0xce3d('0x6')));}},'type':{'type':Sequelize[_0xce3d('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xce3d('0x7')](_0xce3d('0x8')),'get':function(){if(this['getDataValue'](_0xce3d('0x9'))===_0xce3d('0xa')){return JSON[_0xce3d('0xb')](this[_0xce3d('0x5')](_0xce3d('0xc')));}else{return this['getDataValue'](_0xce3d('0xc'));}},'set':function(_0x15551b){if(Array['isArray'](_0x15551b)){this[_0xce3d('0x4')](_0xce3d('0xc'),JSON[_0xce3d('0xd')](_0x15551b));}else{this[_0xce3d('0x4')](_0xce3d('0xc'),_0x15551b);}}},'required':{'type':Sequelize[_0xce3d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xce3d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xce3d('0xf')](_0xce3d('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index cafd33d..b4a5d20 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 _0xd66f=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','then','catch','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','error','stack','name','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xd66f,0x11c));var _0xfd66=function(_0x558bfe,_0x361b4f){_0x558bfe=_0x558bfe-0x0;var _0x5c761e=_0xd66f[_0x558bfe];return _0x5c761e;};'use strict';var emlformat=require(_0xfd66('0x0'));var rimraf=require(_0xfd66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd66('0x2'));var moment=require('moment');var BPromise=require(_0xfd66('0x3'));var Mustache=require(_0xfd66('0x4'));var util=require(_0xfd66('0x5'));var path=require(_0xfd66('0x6'));var sox=require('sox');var csv=require(_0xfd66('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd66('0x8'));var _=require(_0xfd66('0x9'));var squel=require(_0xfd66('0xa'));var crypto=require(_0xfd66('0xb'));var jsforce=require(_0xfd66('0xc'));var deskjs=require(_0xfd66('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfd66('0xe'));var Papa=require(_0xfd66('0xf'));var Redis=require('ioredis');var authService=require(_0xfd66('0x10'));var qs=require(_0xfd66('0x11'));var as=require(_0xfd66('0x12'));var hardwareService=require(_0xfd66('0x13'));var logger=require(_0xfd66('0x14'))(_0xfd66('0x15'));var utils=require(_0xfd66('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfd66('0x17'));var db=require(_0xfd66('0x18'))['db'];function respondWithStatusCode(_0x1b2d43,_0x353639){_0x353639=_0x353639||0xcc;return function(_0x4a2a64){if(_0x4a2a64){return _0x1b2d43[_0xfd66('0x19')](_0x353639);}return _0x1b2d43[_0xfd66('0x1a')](_0x353639)[_0xfd66('0x1b')]();};}function respondWithResult(_0x5e21a5,_0x26f457){_0x26f457=_0x26f457||0xc8;return function(_0x5b17a4){if(_0x5b17a4){return _0x5e21a5[_0xfd66('0x1a')](_0x26f457)[_0xfd66('0x1c')](_0x5b17a4);}};}function respondWithFilteredResult(_0x23033d,_0x56546a){return function(_0x5d086b){if(_0x5d086b){var _0x26bd8b=typeof _0x56546a[_0xfd66('0x1d')]===_0xfd66('0x1e')&&typeof _0x56546a['limit']===_0xfd66('0x1e');var _0x35669f=_0x5d086b[_0xfd66('0x1f')];var _0xdbb678=_0x26bd8b?0x0:_0x56546a[_0xfd66('0x1d')];var _0x412f4f=_0x26bd8b?_0x5d086b['count']:_0x56546a[_0xfd66('0x1d')]+_0x56546a[_0xfd66('0x20')];var _0x2dd96b;if(_0x412f4f>=_0x35669f){_0x412f4f=_0x35669f;_0x2dd96b=0xc8;}else{_0x2dd96b=0xce;}_0x23033d[_0xfd66('0x1a')](_0x2dd96b);return _0x23033d[_0xfd66('0x21')]('Content-Range',_0xdbb678+'-'+_0x412f4f+'/'+_0x35669f)[_0xfd66('0x1c')](_0x5d086b);}return null;};}function patchUpdates(_0x23681e){return function(_0x43eaed){try{jsonpatch[_0xfd66('0x22')](_0x43eaed,_0x23681e,!![]);}catch(_0x291489){return BPromise[_0xfd66('0x23')](_0x291489);}return _0x43eaed[_0xfd66('0x24')]();};}function saveUpdates(_0x173b03,_0x594fc8){return function(_0x398e77){if(_0x398e77){return _0x398e77['update'](_0x173b03)['then'](function(_0x24a150){return _0x24a150;});}return null;};}function removeEntity(_0x1dbea4,_0x4b0fcd){return function(_0x5190ec){if(_0x5190ec){return _0x5190ec[_0xfd66('0x25')]()['then'](function(){_0x1dbea4[_0xfd66('0x1a')](0xcc)[_0xfd66('0x1b')]();});}};}function handleEntityNotFound(_0x55a325,_0x35d20a){return function(_0x1a7a60){if(!_0x1a7a60){_0x55a325['sendStatus'](0x194);}return _0x1a7a60;};}function handleError(_0x256d98,_0x1b787e){_0x1b787e=_0x1b787e||0x1f4;return function(_0x1db6cc){logger[_0xfd66('0x26')](_0x1db6cc[_0xfd66('0x27')]);if(_0x1db6cc[_0xfd66('0x28')]){delete _0x1db6cc[_0xfd66('0x28')];}_0x256d98[_0xfd66('0x1a')](_0x1b787e)['send'](_0x1db6cc);};}exports['index']=function(_0x1fe05c,_0x25c8ba){var _0x1f6506={},_0x292464={},_0x1bd3dc={'count':0x0,'rows':[]};var _0x1f46f9=_[_0xfd66('0x29')](db[_0xfd66('0x2a')][_0xfd66('0x2b')],function(_0x34d9b5){return{'name':_0x34d9b5[_0xfd66('0x2c')],'type':_0x34d9b5[_0xfd66('0x2d')][_0xfd66('0x2e')]};});_0x292464[_0xfd66('0x2f')]=_[_0xfd66('0x30')](_[_0xfd66('0x29')](_0x1f46f9,'name'),[_0xfd66('0x28')]);_0x292464[_0xfd66('0x31')]=_[_0xfd66('0x32')](_0x1fe05c[_0xfd66('0x31')]);_0x292464[_0xfd66('0x33')]=_[_0xfd66('0x34')](_0x292464['model'],_0x292464['query']);_0x1f6506[_0xfd66('0x35')]=_[_0xfd66('0x34')](_0x292464['model'],qs[_0xfd66('0x36')](_0x1fe05c['query'][_0xfd66('0x36')]));_0x1f6506[_0xfd66('0x35')]=_0x1f6506['attributes']['length']?_0x1f6506[_0xfd66('0x35')]:_0x292464[_0xfd66('0x2f')];if(!_0x1fe05c[_0xfd66('0x31')][_0xfd66('0x37')](_0xfd66('0x38'))){_0x1f6506[_0xfd66('0x20')]=qs[_0xfd66('0x20')](_0x1fe05c[_0xfd66('0x31')][_0xfd66('0x20')]);_0x1f6506[_0xfd66('0x1d')]=qs[_0xfd66('0x1d')](_0x1fe05c[_0xfd66('0x31')]['offset']);}_0x1f6506[_0xfd66('0x39')]=qs[_0xfd66('0x3a')](_0x1fe05c[_0xfd66('0x31')]['sort']);_0x1f6506[_0xfd66('0x3b')]=qs[_0xfd66('0x33')](_[_0xfd66('0x3c')](_0x1fe05c[_0xfd66('0x31')],_0x292464[_0xfd66('0x33')]),_0x1f46f9);if(_0x1fe05c[_0xfd66('0x31')][_0xfd66('0x3d')]){_0x1f6506[_0xfd66('0x3b')]=_[_0xfd66('0x3e')](_0x1f6506['where'],{'$or':_[_0xfd66('0x29')](_0x1f46f9,function(_0x4c59b9){if(_0x4c59b9[_0xfd66('0x2d')]!==_0xfd66('0x3f')){var _0x479461={};_0x479461[_0x4c59b9[_0xfd66('0x28')]]={'$like':'%'+_0x1fe05c[_0xfd66('0x31')][_0xfd66('0x3d')]+'%'};return _0x479461;}})});}_0x1f6506=_[_0xfd66('0x3e')]({},_0x1f6506,_0x1fe05c[_0xfd66('0x40')]);var _0x27dfd9={'where':_0x1f6506[_0xfd66('0x3b')]};return db[_0xfd66('0x2a')][_0xfd66('0x1f')](_0x27dfd9)['then'](function(_0x5aee24){_0x1bd3dc['count']=_0x5aee24;if(_0x1fe05c['query'][_0xfd66('0x41')]){_0x1f6506[_0xfd66('0x42')]=[{'all':!![]}];}return db[_0xfd66('0x2a')]['findAll'](_0x1f6506);})['then'](function(_0x44b820){_0x1bd3dc[_0xfd66('0x43')]=_0x44b820;return _0x1bd3dc;})[_0xfd66('0x44')](respondWithFilteredResult(_0x25c8ba,_0x1f6506))[_0xfd66('0x45')](handleError(_0x25c8ba,null));};exports['show']=function(_0x3b07a9,_0x4985cd){var _0x4a6d67={'raw':!![],'where':{'id':_0x3b07a9['params']['id']}},_0x2d21ac={};_0x2d21ac[_0xfd66('0x2f')]=_[_0xfd66('0x32')](db[_0xfd66('0x2a')][_0xfd66('0x2b')]);_0x2d21ac[_0xfd66('0x31')]=_[_0xfd66('0x32')](_0x3b07a9[_0xfd66('0x31')]);_0x2d21ac['filters']=_['intersection'](_0x2d21ac[_0xfd66('0x2f')],_0x2d21ac[_0xfd66('0x31')]);_0x4a6d67[_0xfd66('0x35')]=_[_0xfd66('0x34')](_0x2d21ac[_0xfd66('0x2f')],qs[_0xfd66('0x36')](_0x3b07a9[_0xfd66('0x31')]['fields']));_0x4a6d67[_0xfd66('0x35')]=_0x4a6d67['attributes']['length']?_0x4a6d67['attributes']:_0x2d21ac['model'];if(_0x3b07a9['query'][_0xfd66('0x41')]){_0x4a6d67[_0xfd66('0x42')]=[{'all':!![]}];}_0x4a6d67=_['merge']({},_0x4a6d67,_0x3b07a9[_0xfd66('0x40')]);return db[_0xfd66('0x2a')][_0xfd66('0x46')](_0x4a6d67)[_0xfd66('0x44')](handleEntityNotFound(_0x4985cd,null))['then'](respondWithResult(_0x4985cd,null))['catch'](handleError(_0x4985cd,null));};exports['update']=function(_0x307c37,_0x48b541){if(_0x307c37[_0xfd66('0x47')]['id']){delete _0x307c37['body']['id'];}return db['CmCustomField'][_0xfd66('0x46')]({'where':{'id':_0x307c37[_0xfd66('0x48')]['id']}})['then'](handleEntityNotFound(_0x48b541,null))[_0xfd66('0x44')](saveUpdates(_0x307c37[_0xfd66('0x47')],null))['then'](respondWithResult(_0x48b541,null))['catch'](handleError(_0x48b541,null));};exports[_0xfd66('0x25')]=function(_0x48996d,_0xe119bf){return db[_0xfd66('0x2a')][_0xfd66('0x46')]({'where':{'id':_0x48996d[_0xfd66('0x48')]['id']}})[_0xfd66('0x44')](handleEntityNotFound(_0xe119bf,null))[_0xfd66('0x44')](removeEntity(_0xe119bf,null))[_0xfd66('0x45')](handleError(_0xe119bf,null));};exports[_0xfd66('0x49')]=function(_0x2c4553,_0x2c8975){var _0x22c529;return db[_0xfd66('0x4a')][_0xfd66('0x4b')](function(_0x3971b9){return db[_0xfd66('0x2a')][_0xfd66('0x49')](_0x2c4553[_0xfd66('0x47')],{'transaction':_0x3971b9})[_0xfd66('0x44')](function(_0x4d3794){_0x22c529=_0x4d3794;var _0x45d21f={'type':db[_0xfd66('0x4c')][_0xfd66('0x4d')],'transaction':_0x3971b9};switch(_0x2c4553[_0xfd66('0x47')][_0xfd66('0x2d')]){case _0xfd66('0x4e'):_0x45d21f[_0xfd66('0x2d')]=db[_0xfd66('0x4c')]['TEXT'];break;case'number':_0x45d21f[_0xfd66('0x2d')]=db[_0xfd66('0x4c')][_0xfd66('0x4f')];break;case _0xfd66('0x50'):_0x45d21f[_0xfd66('0x2d')]=db[_0xfd66('0x4c')][_0xfd66('0x51')];_0x45d21f[_0xfd66('0x52')]=![];break;default:}return db['sequelize'][_0xfd66('0x53')]['addColumn'](_0xfd66('0x54'),util[_0xfd66('0x55')]('cf_%d',_0x22c529['id']),_0x45d21f);})[_0xfd66('0x44')](function(){return _0x22c529;});})[_0xfd66('0x44')](respondWithResult(_0x2c8975,0xc9))[_0xfd66('0x45')](handleError(_0x2c8975,null));}; \ No newline at end of file +var _0x9f05=['offset','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','body','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9f05,0x94));var _0x59f0=function(_0x57638f,_0x3db601){_0x57638f=_0x57638f-0x0;var _0x468d05=_0x9f05[_0x57638f];return _0x468d05;};'use strict';var emlformat=require(_0x59f0('0x0'));var rimraf=require(_0x59f0('0x1'));var zipdir=require(_0x59f0('0x2'));var jsonpatch=require(_0x59f0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x59f0('0x4'));var util=require(_0x59f0('0x5'));var path=require(_0x59f0('0x6'));var sox=require(_0x59f0('0x7'));var csv=require('to-csv');var ejs=require(_0x59f0('0x8'));var fs=require('fs');var fs_extra=require(_0x59f0('0x9'));var _=require(_0x59f0('0xa'));var squel=require(_0x59f0('0xb'));var crypto=require('crypto');var jsforce=require(_0x59f0('0xc'));var deskjs=require(_0x59f0('0xd'));var toCsv=require(_0x59f0('0xe'));var querystring=require(_0x59f0('0xf'));var Papa=require('papaparse');var Redis=require(_0x59f0('0x10'));var authService=require(_0x59f0('0x11'));var qs=require(_0x59f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59f0('0x13'));var logger=require('../../config/logger')(_0x59f0('0x14'));var utils=require('../../config/utils');var config=require(_0x59f0('0x15'));var licenseUtil=require(_0x59f0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xed6d08,_0x4eb681){_0x4eb681=_0x4eb681||0xcc;return function(_0x31f294){if(_0x31f294){return _0xed6d08['sendStatus'](_0x4eb681);}return _0xed6d08['status'](_0x4eb681)[_0x59f0('0x17')]();};}function respondWithResult(_0x29cc95,_0x2c686b){_0x2c686b=_0x2c686b||0xc8;return function(_0x1a1764){if(_0x1a1764){return _0x29cc95[_0x59f0('0x18')](_0x2c686b)[_0x59f0('0x19')](_0x1a1764);}};}function respondWithFilteredResult(_0x51ae79,_0x432789){return function(_0x2fa6d4){if(_0x2fa6d4){var _0x1e60e2=typeof _0x432789[_0x59f0('0x1a')]==='undefined'&&typeof _0x432789[_0x59f0('0x1b')]==='undefined';var _0x3937dd=_0x2fa6d4[_0x59f0('0x1c')];var _0x51d921=_0x1e60e2?0x0:_0x432789['offset'];var _0x227d16=_0x1e60e2?_0x2fa6d4['count']:_0x432789[_0x59f0('0x1a')]+_0x432789['limit'];var _0x28814f;if(_0x227d16>=_0x3937dd){_0x227d16=_0x3937dd;_0x28814f=0xc8;}else{_0x28814f=0xce;}_0x51ae79[_0x59f0('0x18')](_0x28814f);return _0x51ae79[_0x59f0('0x1d')]('Content-Range',_0x51d921+'-'+_0x227d16+'/'+_0x3937dd)[_0x59f0('0x19')](_0x2fa6d4);}return null;};}function patchUpdates(_0x51ea95){return function(_0x59e5e7){try{jsonpatch[_0x59f0('0x1e')](_0x59e5e7,_0x51ea95,!![]);}catch(_0x27d158){return BPromise[_0x59f0('0x1f')](_0x27d158);}return _0x59e5e7[_0x59f0('0x20')]();};}function saveUpdates(_0xceafb2,_0x2f0dd3){return function(_0x25a1cd){if(_0x25a1cd){return _0x25a1cd[_0x59f0('0x21')](_0xceafb2)[_0x59f0('0x22')](function(_0x1375e9){return _0x1375e9;});}return null;};}function removeEntity(_0x3fd746,_0x1cb281){return function(_0x596cfb){if(_0x596cfb){return _0x596cfb[_0x59f0('0x23')]()[_0x59f0('0x22')](function(){_0x3fd746[_0x59f0('0x18')](0xcc)[_0x59f0('0x17')]();});}};}function handleEntityNotFound(_0x483f25,_0x4ab140){return function(_0x1e9b79){if(!_0x1e9b79){_0x483f25[_0x59f0('0x24')](0x194);}return _0x1e9b79;};}function handleError(_0x1055ba,_0x56f25f){_0x56f25f=_0x56f25f||0x1f4;return function(_0x4d8716){logger[_0x59f0('0x25')](_0x4d8716[_0x59f0('0x26')]);if(_0x4d8716[_0x59f0('0x27')]){delete _0x4d8716[_0x59f0('0x27')];}_0x1055ba['status'](_0x56f25f)['send'](_0x4d8716);};}exports[_0x59f0('0x28')]=function(_0xc6eab2,_0xfdcabf){var _0x24b5a5={},_0x5967c6={},_0x2748ea={'count':0x0,'rows':[]};var _0x38f6c2=_[_0x59f0('0x29')](db[_0x59f0('0x2a')][_0x59f0('0x2b')],function(_0x5c6ef9){return{'name':_0x5c6ef9[_0x59f0('0x2c')],'type':_0x5c6ef9[_0x59f0('0x2d')][_0x59f0('0x2e')]};});_0x5967c6[_0x59f0('0x2f')]=_[_0x59f0('0x30')](_[_0x59f0('0x29')](_0x38f6c2,_0x59f0('0x27')),[_0x59f0('0x27')]);_0x5967c6[_0x59f0('0x31')]=_['keys'](_0xc6eab2[_0x59f0('0x31')]);_0x5967c6['filters']=_[_0x59f0('0x32')](_0x5967c6[_0x59f0('0x2f')],_0x5967c6['query']);_0x24b5a5[_0x59f0('0x33')]=_[_0x59f0('0x32')](_0x5967c6[_0x59f0('0x2f')],qs[_0x59f0('0x34')](_0xc6eab2[_0x59f0('0x31')][_0x59f0('0x34')]));_0x24b5a5[_0x59f0('0x33')]=_0x24b5a5[_0x59f0('0x33')][_0x59f0('0x35')]?_0x24b5a5[_0x59f0('0x33')]:_0x5967c6['model'];if(!_0xc6eab2[_0x59f0('0x31')][_0x59f0('0x36')]('nolimit')){_0x24b5a5[_0x59f0('0x1b')]=qs[_0x59f0('0x1b')](_0xc6eab2[_0x59f0('0x31')][_0x59f0('0x1b')]);_0x24b5a5[_0x59f0('0x1a')]=qs[_0x59f0('0x1a')](_0xc6eab2[_0x59f0('0x31')][_0x59f0('0x1a')]);}_0x24b5a5['order']=qs[_0x59f0('0x37')](_0xc6eab2[_0x59f0('0x31')][_0x59f0('0x37')]);_0x24b5a5['where']=qs[_0x59f0('0x38')](_['pick'](_0xc6eab2[_0x59f0('0x31')],_0x5967c6['filters']),_0x38f6c2);if(_0xc6eab2['query']['filter']){_0x24b5a5[_0x59f0('0x39')]=_[_0x59f0('0x3a')](_0x24b5a5[_0x59f0('0x39')],{'$or':_['map'](_0x38f6c2,function(_0x2aba6d){if(_0x2aba6d[_0x59f0('0x2d')]!==_0x59f0('0x3b')){var _0x25573a={};_0x25573a[_0x2aba6d[_0x59f0('0x27')]]={'$like':'%'+_0xc6eab2['query']['filter']+'%'};return _0x25573a;}})});}_0x24b5a5=_[_0x59f0('0x3a')]({},_0x24b5a5,_0xc6eab2[_0x59f0('0x3c')]);var _0x590f49={'where':_0x24b5a5[_0x59f0('0x39')]};return db[_0x59f0('0x2a')][_0x59f0('0x1c')](_0x590f49)[_0x59f0('0x22')](function(_0x5a91c3){_0x2748ea['count']=_0x5a91c3;if(_0xc6eab2[_0x59f0('0x31')][_0x59f0('0x3d')]){_0x24b5a5['include']=[{'all':!![]}];}return db['CmCustomField'][_0x59f0('0x3e')](_0x24b5a5);})[_0x59f0('0x22')](function(_0x41b65f){_0x2748ea[_0x59f0('0x3f')]=_0x41b65f;return _0x2748ea;})['then'](respondWithFilteredResult(_0xfdcabf,_0x24b5a5))['catch'](handleError(_0xfdcabf,null));};exports[_0x59f0('0x40')]=function(_0x1a7191,_0x5d7e50){var _0x2d47c8={'raw':!![],'where':{'id':_0x1a7191[_0x59f0('0x41')]['id']}},_0xba5af7={};_0xba5af7['model']=_[_0x59f0('0x42')](db[_0x59f0('0x2a')][_0x59f0('0x2b')]);_0xba5af7['query']=_[_0x59f0('0x42')](_0x1a7191[_0x59f0('0x31')]);_0xba5af7['filters']=_['intersection'](_0xba5af7[_0x59f0('0x2f')],_0xba5af7['query']);_0x2d47c8[_0x59f0('0x33')]=_['intersection'](_0xba5af7[_0x59f0('0x2f')],qs[_0x59f0('0x34')](_0x1a7191['query'][_0x59f0('0x34')]));_0x2d47c8[_0x59f0('0x33')]=_0x2d47c8['attributes'][_0x59f0('0x35')]?_0x2d47c8[_0x59f0('0x33')]:_0xba5af7[_0x59f0('0x2f')];if(_0x1a7191['query'][_0x59f0('0x3d')]){_0x2d47c8[_0x59f0('0x43')]=[{'all':!![]}];}_0x2d47c8=_[_0x59f0('0x3a')]({},_0x2d47c8,_0x1a7191['options']);return db[_0x59f0('0x2a')][_0x59f0('0x44')](_0x2d47c8)[_0x59f0('0x22')](handleEntityNotFound(_0x5d7e50,null))[_0x59f0('0x22')](respondWithResult(_0x5d7e50,null))[_0x59f0('0x45')](handleError(_0x5d7e50,null));};exports['update']=function(_0x48d032,_0x5009de){if(_0x48d032[_0x59f0('0x46')]['id']){delete _0x48d032[_0x59f0('0x46')]['id'];}return db[_0x59f0('0x2a')][_0x59f0('0x44')]({'where':{'id':_0x48d032[_0x59f0('0x41')]['id']}})[_0x59f0('0x22')](handleEntityNotFound(_0x5009de,null))[_0x59f0('0x22')](saveUpdates(_0x48d032[_0x59f0('0x46')],null))['then'](respondWithResult(_0x5009de,null))[_0x59f0('0x45')](handleError(_0x5009de,null));};exports[_0x59f0('0x23')]=function(_0xa480a0,_0xba94cc){return db[_0x59f0('0x2a')]['find']({'where':{'id':_0xa480a0[_0x59f0('0x41')]['id']}})[_0x59f0('0x22')](handleEntityNotFound(_0xba94cc,null))[_0x59f0('0x22')](removeEntity(_0xba94cc,null))[_0x59f0('0x45')](handleError(_0xba94cc,null));};exports[_0x59f0('0x47')]=function(_0x11c4bc,_0x32c864){var _0x240c05;return db[_0x59f0('0x48')][_0x59f0('0x49')](function(_0x247e97){return db[_0x59f0('0x2a')][_0x59f0('0x47')](_0x11c4bc[_0x59f0('0x46')],{'transaction':_0x247e97})[_0x59f0('0x22')](function(_0x207c95){_0x240c05=_0x207c95;var _0x28e13a={'type':db['Sequelize'][_0x59f0('0x4a')],'transaction':_0x247e97};switch(_0x11c4bc[_0x59f0('0x46')][_0x59f0('0x2d')]){case _0x59f0('0x4b'):_0x28e13a[_0x59f0('0x2d')]=db[_0x59f0('0x4c')][_0x59f0('0x4a')];break;case _0x59f0('0x4d'):_0x28e13a[_0x59f0('0x2d')]=db[_0x59f0('0x4c')][_0x59f0('0x4e')];break;case _0x59f0('0x4f'):_0x28e13a[_0x59f0('0x2d')]=db[_0x59f0('0x4c')][_0x59f0('0x50')];_0x28e13a[_0x59f0('0x51')]=![];break;default:}return db[_0x59f0('0x48')][_0x59f0('0x52')][_0x59f0('0x53')](_0x59f0('0x54'),util[_0x59f0('0x55')](_0x59f0('0x56'),_0x240c05['id']),_0x28e13a);})[_0x59f0('0x22')](function(){return _0x240c05;});})[_0x59f0('0x22')](respondWithResult(_0x32c864,0xc9))[_0x59f0('0x45')](handleError(_0x32c864,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index df1e64a..61c9e49 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 _0x6276=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3eb37a,_0x2e4c0f){var _0x81c8d=function(_0xaa6158){while(--_0xaa6158){_0x3eb37a['push'](_0x3eb37a['shift']());}};_0x81c8d(++_0x2e4c0f);}(_0x6276,0x181));var _0x6627=function(_0x44a344,_0x2c258a){_0x44a344=_0x44a344-0x0;var _0x2be283=_0x6276[_0x44a344];return _0x2be283;};'use strict';var _=require(_0x6627('0x0'));var util=require(_0x6627('0x1'));var logger=require(_0x6627('0x2'))(_0x6627('0x3'));var moment=require(_0x6627('0x4'));var BPromise=require(_0x6627('0x5'));var rp=require(_0x6627('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6627('0x7'));var config=require(_0x6627('0x8'));var attributes=require(_0x6627('0x9'));module[_0x6627('0xa')]=function(_0x3b126b,_0x22a992){return _0x3b126b[_0x6627('0xb')](_0x6627('0xc'),attributes,{'tableName':_0x6627('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc713=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird'];(function(_0x142055,_0xc786ce){var _0x458ed9=function(_0xeb9375){while(--_0xeb9375){_0x142055['push'](_0x142055['shift']());}};_0x458ed9(++_0xc786ce);}(_0xc713,0xdb));var _0x3c71=function(_0x5050fc,_0x166a92){_0x5050fc=_0x5050fc-0x0;var _0x57fc2b=_0xc713[_0x5050fc];return _0x57fc2b;};'use strict';var _=require(_0x3c71('0x0'));var util=require(_0x3c71('0x1'));var logger=require('../../config/logger')(_0x3c71('0x2'));var moment=require(_0x3c71('0x3'));var BPromise=require(_0x3c71('0x4'));var rp=require(_0x3c71('0x5'));var fs=require('fs');var path=require(_0x3c71('0x6'));var rimraf=require(_0x3c71('0x7'));var config=require(_0x3c71('0x8'));var attributes=require(_0x3c71('0x9'));module[_0x3c71('0xa')]=function(_0x17a0e5,_0x21846f){return _0x17a0e5[_0x3c71('0xb')](_0x3c71('0xc'),attributes,{'tableName':_0x3c71('0xd'),'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 815d317..bf5aae2 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 _0xf807=['code','message','info','catch','util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x38dca6,_0x471cb7){var _0x29bcd7=function(_0x174c5d){while(--_0x174c5d){_0x38dca6['push'](_0x38dca6['shift']());}};_0x29bcd7(++_0x471cb7);}(_0xf807,0x134));var _0x7f80=function(_0x2eb47c,_0x43bdf3){_0x2eb47c=_0x2eb47c-0x0;var _0x13097b=_0xf807[_0x2eb47c];return _0x13097b;};'use strict';var _=require('lodash');var util=require(_0x7f80('0x0'));var moment=require(_0x7f80('0x1'));var BPromise=require(_0x7f80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f80('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7f80('0x5'));var client=jayson[_0x7f80('0x6')][_0x7f80('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x568513,_0x49666a,_0x1d565b){return new BPromise(function(_0x25a8fc,_0x30e0fb){return client[_0x7f80('0x8')](_0x568513,_0x1d565b)[_0x7f80('0x9')](function(_0x4f2435){logger['info'](_0x7f80('0xa'),_0x49666a,_0x7f80('0xb'));logger[_0x7f80('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x49666a,_0x7f80('0xb'),JSON[_0x7f80('0xd')](_0x4f2435));if(_0x4f2435[_0x7f80('0xe')]){if(_0x4f2435[_0x7f80('0xe')][_0x7f80('0xf')]===0x1f4){logger[_0x7f80('0xe')]('CmCustomField,\x20%s,\x20%s',_0x49666a,_0x4f2435[_0x7f80('0xe')][_0x7f80('0x10')]);return _0x30e0fb(_0x4f2435[_0x7f80('0xe')][_0x7f80('0x10')]);}logger[_0x7f80('0xe')]('CmCustomField,\x20%s,\x20%s',_0x49666a,_0x4f2435[_0x7f80('0xe')]['message']);return _0x25a8fc(_0x4f2435[_0x7f80('0xe')][_0x7f80('0x10')]);}else{logger[_0x7f80('0x11')](_0x7f80('0xa'),_0x49666a,'request\x20sent');_0x25a8fc(_0x4f2435['result'][_0x7f80('0x10')]);}})[_0x7f80('0x12')](function(_0x2d10ca){logger[_0x7f80('0xe')](_0x7f80('0xa'),_0x49666a,_0x2d10ca);_0x30e0fb(_0x2d10ca);});});} \ No newline at end of file +var _0xf54b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf54b,0x11f));var _0xbf54=function(_0x47ace0,_0x5799a7){_0x47ace0=_0x47ace0-0x0;var _0x54f124=_0xf54b[_0x47ace0];return _0x54f124;};'use strict';var _=require(_0xbf54('0x0'));var util=require('util');var moment=require(_0xbf54('0x1'));var BPromise=require(_0xbf54('0x2'));var rs=require(_0xbf54('0x3'));var fs=require('fs');var Redis=require(_0xbf54('0x4'));var db=require(_0xbf54('0x5'))['db'];var utils=require(_0xbf54('0x6'));var logger=require(_0xbf54('0x7'))(_0xbf54('0x8'));var config=require(_0xbf54('0x9'));var jayson=require(_0xbf54('0xa'));var client=jayson[_0xbf54('0xb')][_0xbf54('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d766d,_0x2afb64,_0x5cd32d){return new BPromise(function(_0xf37a1b,_0x5e3e2c){return client[_0xbf54('0xd')](_0x1d766d,_0x5cd32d)['then'](function(_0x3c137e){logger[_0xbf54('0xe')](_0xbf54('0xf'),_0x2afb64,_0xbf54('0x10'));logger[_0xbf54('0x11')](_0xbf54('0x12'),_0x2afb64,_0xbf54('0x10'),JSON[_0xbf54('0x13')](_0x3c137e));if(_0x3c137e[_0xbf54('0x14')]){if(_0x3c137e['error']['code']===0x1f4){logger[_0xbf54('0x14')](_0xbf54('0xf'),_0x2afb64,_0x3c137e[_0xbf54('0x14')][_0xbf54('0x15')]);return _0x5e3e2c(_0x3c137e[_0xbf54('0x14')]['message']);}logger[_0xbf54('0x14')](_0xbf54('0xf'),_0x2afb64,_0x3c137e['error'][_0xbf54('0x15')]);return _0xf37a1b(_0x3c137e[_0xbf54('0x14')][_0xbf54('0x15')]);}else{logger[_0xbf54('0xe')](_0xbf54('0xf'),_0x2afb64,_0xbf54('0x10'));_0xf37a1b(_0x3c137e[_0xbf54('0x16')][_0xbf54('0x15')]);}})[_0xbf54('0x17')](function(_0x2ecae9){logger[_0xbf54('0x14')](_0xbf54('0xf'),_0x2afb64,_0x2ecae9);_0x5e3e2c(_0x2ecae9);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 071018b..9e836df 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 _0x8c32=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x8c32,0x130));var _0x28c3=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x8c32[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var path=require(_0x28c3('0x2'));var timeout=require(_0x28c3('0x3'));var express=require(_0x28c3('0x4'));var router=express[_0x28c3('0x5')]();var fs_extra=require(_0x28c3('0x6'));var auth=require(_0x28c3('0x7'));var interaction=require(_0x28c3('0x8'));var config=require(_0x28c3('0x9'));var controller=require(_0x28c3('0xa'));router[_0x28c3('0xb')]('/',auth['isAuthenticated'](),controller[_0x28c3('0xc')]);router[_0x28c3('0xb')](_0x28c3('0xd'),auth[_0x28c3('0xe')](),controller[_0x28c3('0xf')]);router[_0x28c3('0x10')]('/',auth['isAuthenticated'](),controller[_0x28c3('0x11')]);router[_0x28c3('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x28c3('0x13')](_0x28c3('0xd'),auth['isAuthenticated'](),controller[_0x28c3('0x14')]);module[_0x28c3('0x15')]=router; \ No newline at end of file +var _0x5cd7=['get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cd7,0x102));var _0x75cd=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x5cd7[_0x5c811c];return _0x5df3af;};'use strict';var multer=require(_0x75cd('0x0'));var util=require('util');var path=require(_0x75cd('0x1'));var timeout=require(_0x75cd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x75cd('0x3'));var auth=require(_0x75cd('0x4'));var interaction=require(_0x75cd('0x5'));var config=require(_0x75cd('0x6'));var controller=require(_0x75cd('0x7'));router[_0x75cd('0x8')]('/',auth[_0x75cd('0x9')](),controller[_0x75cd('0xa')]);router[_0x75cd('0x8')]('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0xb')]);router[_0x75cd('0xc')]('/',auth[_0x75cd('0x9')](),controller[_0x75cd('0xd')]);router[_0x75cd('0xe')](_0x75cd('0xf'),auth[_0x75cd('0x9')](),controller[_0x75cd('0x10')]);router[_0x75cd('0x11')]('/:id',auth[_0x75cd('0x9')](),controller['destroy']);module[_0x75cd('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7f886c1..6e1900d 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 _0x1ff4=['sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x7d5fd9,_0x3ca872){var _0x2c4e47=function(_0x11b51c){while(--_0x11b51c){_0x7d5fd9['push'](_0x7d5fd9['shift']());}};_0x2c4e47(++_0x3ca872);}(_0x1ff4,0xdb));var _0x41ff=function(_0x4cb596,_0x180558){_0x4cb596=_0x4cb596-0x0;var _0x124c0b=_0x1ff4[_0x4cb596];return _0x124c0b;};'use strict';var moment=require(_0x41ff('0x0'));var Sequelize=require(_0x41ff('0x1'));module[_0x41ff('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x41ff('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x41ff('0x4')],'defaultValue':moment()[_0x41ff('0x5')](_0x41ff('0x6'))},'countbusyretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x41ff('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x41ff('0x4')]},'priority':{'type':Sequelize[_0x41ff('0x7')](0x2)[_0x41ff('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x41ff('0x9')},'ListId':{'type':Sequelize[_0x41ff('0x7')],'unique':_0x41ff('0x9')},'UserId':{'type':Sequelize[_0x41ff('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x41ff('0x7')],'unique':_0x41ff('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':0x0},'recallmeNotifiedDate':{'type':Sequelize[_0x41ff('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x4493=['BOOLEAN','contactListQueue','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x2a0181,_0x311647){var _0x13cfba=function(_0x1fc588){while(--_0x1fc588){_0x2a0181['push'](_0x2a0181['shift']());}};_0x13cfba(++_0x311647);}(_0x4493,0x160));var _0x3449=function(_0x269715,_0x5495e7){_0x269715=_0x269715-0x0;var _0x4feeb4=_0x4493[_0x269715];return _0x4feeb4;};'use strict';var moment=require(_0x3449('0x0'));var Sequelize=require('sequelize');module[_0x3449('0x1')]={'phone':{'type':Sequelize[_0x3449('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3449('0x3')],'defaultValue':moment()[_0x3449('0x4')](_0x3449('0x5'))},'countbusyretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x3449('0x6')](0x2)[_0x3449('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3449('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3449('0x9')},'ListId':{'type':Sequelize[_0x3449('0x6')],'unique':_0x3449('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3449('0x6')],'unique':_0x3449('0x9')},'CampaignId':{'type':Sequelize[_0x3449('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3449('0x6')],'defaultValue':0x0},'recallmeNotifiedDate':{'type':Sequelize[_0x3449('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index a82004b..b56ea0d 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 _0x6da0=['CmHopper','fieldName','type','model','query','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$in','$notIn','$like','$notLike','$notILike','$overlap','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','rawAttributes','include','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','updatedAt','state','statedesc','deleted','campaign','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','getPreview','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','recallme','UPDATE','Company','CmList','List','Queue','getPreviewRecall','outbound','hopperId','LOCK','getOpenContacts','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','name','send','index','map'];(function(_0x50e716,_0x5ac680){var _0x1d269b=function(_0xc99706){while(--_0xc99706){_0x50e716['push'](_0x50e716['shift']());}};_0x1d269b(++_0x5ac680);}(_0x6da0,0x191));var _0x06da=function(_0x39bac7,_0x1fb58d){_0x39bac7=_0x39bac7-0x0;var _0x115151=_0x6da0[_0x39bac7];return _0x115151;};'use strict';var emlformat=require(_0x06da('0x0'));var rimraf=require(_0x06da('0x1'));var zipdir=require(_0x06da('0x2'));var jsonpatch=require(_0x06da('0x3'));var rp=require('request-promise');var moment=require(_0x06da('0x4'));var BPromise=require(_0x06da('0x5'));var Mustache=require(_0x06da('0x6'));var util=require(_0x06da('0x7'));var path=require(_0x06da('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x06da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06da('0xa'));var squel=require(_0x06da('0xb'));var crypto=require(_0x06da('0xc'));var jsforce=require(_0x06da('0xd'));var deskjs=require(_0x06da('0xe'));var toCsv=require(_0x06da('0xf'));var querystring=require(_0x06da('0x10'));var Papa=require(_0x06da('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x06da('0x12'));var as=require(_0x06da('0x13'));var hardwareService=require(_0x06da('0x14'));var logger=require('../../config/logger')(_0x06da('0x15'));var utils=require(_0x06da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x06da('0x17'));var db=require(_0x06da('0x18'))['db'];function respondWithStatusCode(_0xfb00c1,_0x1cdc6f){_0x1cdc6f=_0x1cdc6f||0xcc;return function(_0x391f84){if(_0x391f84){return _0xfb00c1[_0x06da('0x19')](_0x1cdc6f);}return _0xfb00c1[_0x06da('0x1a')](_0x1cdc6f)[_0x06da('0x1b')]();};}function respondWithResult(_0x2532f3,_0x57d403){_0x57d403=_0x57d403||0xc8;return function(_0x41f061){if(_0x41f061){return _0x2532f3[_0x06da('0x1a')](_0x57d403)[_0x06da('0x1c')](_0x41f061);}};}function respondWithFilteredResult(_0x3707a4,_0x25653e){return function(_0x5e23c1){if(_0x5e23c1){var _0x411af3=typeof _0x25653e[_0x06da('0x1d')]===_0x06da('0x1e')&&typeof _0x25653e[_0x06da('0x1f')]===_0x06da('0x1e');var _0x4a18cb=_0x5e23c1[_0x06da('0x20')];var _0x4664f7=_0x411af3?0x0:_0x25653e[_0x06da('0x1d')];var _0x3b39a6=_0x411af3?_0x5e23c1[_0x06da('0x20')]:_0x25653e[_0x06da('0x1d')]+_0x25653e[_0x06da('0x1f')];var _0x42584f;if(_0x3b39a6>=_0x4a18cb){_0x3b39a6=_0x4a18cb;_0x42584f=0xc8;}else{_0x42584f=0xce;}_0x3707a4[_0x06da('0x1a')](_0x42584f);return _0x3707a4['set'](_0x06da('0x21'),_0x4664f7+'-'+_0x3b39a6+'/'+_0x4a18cb)[_0x06da('0x1c')](_0x5e23c1);}return null;};}function patchUpdates(_0x11610){return function(_0x19d2a9){try{jsonpatch[_0x06da('0x22')](_0x19d2a9,_0x11610,!![]);}catch(_0x199329){return BPromise[_0x06da('0x23')](_0x199329);}return _0x19d2a9['save']();};}function saveUpdates(_0x5549f3,_0x3c0c5b){return function(_0x351473){if(_0x351473){return _0x351473[_0x06da('0x24')](_0x5549f3)[_0x06da('0x25')](function(_0x3a8a0a){return _0x3a8a0a;});}return null;};}function removeEntity(_0x988d0a,_0x203293){return function(_0x356ad1){if(_0x356ad1){return _0x356ad1[_0x06da('0x26')]()[_0x06da('0x25')](function(){_0x988d0a[_0x06da('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d271,_0x3b6cd1){return function(_0x14c622){if(!_0x14c622){_0x59d271['sendStatus'](0x194);}return _0x14c622;};}function handleError(_0x5adb40,_0x3cc928){_0x3cc928=_0x3cc928||0x1f4;return function(_0x43d1d2){logger['error'](_0x43d1d2['stack']);if(_0x43d1d2[_0x06da('0x27')]){delete _0x43d1d2[_0x06da('0x27')];}_0x5adb40[_0x06da('0x1a')](_0x3cc928)[_0x06da('0x28')](_0x43d1d2);};}exports[_0x06da('0x29')]=function(_0x20e43f,_0x4de90f){var _0x57b8bb={},_0x460a5e={},_0x9b2cba={'count':0x0,'rows':[]};var _0x5bdbd0=_[_0x06da('0x2a')](db[_0x06da('0x2b')]['rawAttributes'],function(_0x51f18d){return{'name':_0x51f18d[_0x06da('0x2c')],'type':_0x51f18d[_0x06da('0x2d')]['key']};});_0x460a5e[_0x06da('0x2e')]=_[_0x06da('0x2a')](_0x5bdbd0,'name');_0x460a5e[_0x06da('0x2f')]=_['keys'](_0x20e43f['query']);_0x460a5e[_0x06da('0x30')]=_['intersection'](_0x460a5e[_0x06da('0x2e')],_0x460a5e[_0x06da('0x2f')]);_0x460a5e['filters']=_[_0x06da('0x31')](_0x460a5e[_0x06da('0x30')],[_0x06da('0x32'),_0x06da('0x33'),_0x06da('0x34'),_0x06da('0x35'),_0x06da('0x36'),_0x06da('0x37'),_0x06da('0x38'),'$eq',_0x06da('0x39'),_0x06da('0x3a'),'$notBetween',_0x06da('0x3b'),_0x06da('0x3c'),_0x06da('0x3d'),_0x06da('0x3e'),'$iLike',_0x06da('0x3f'),_0x06da('0x3d'),_0x06da('0x40'),'$contains',_0x06da('0x41'),'$any']);_0x57b8bb[_0x06da('0x42')]=_[_0x06da('0x43')](_0x460a5e[_0x06da('0x2e')],qs['fields'](_0x20e43f[_0x06da('0x2f')][_0x06da('0x44')]));_0x57b8bb[_0x06da('0x42')]=_0x57b8bb[_0x06da('0x42')][_0x06da('0x45')]?_0x57b8bb[_0x06da('0x42')]:_0x460a5e[_0x06da('0x2e')];if(!_0x20e43f[_0x06da('0x2f')][_0x06da('0x46')](_0x06da('0x47'))){_0x57b8bb[_0x06da('0x1f')]=qs[_0x06da('0x1f')](_0x20e43f[_0x06da('0x2f')][_0x06da('0x1f')]);_0x57b8bb[_0x06da('0x1d')]=qs[_0x06da('0x1d')](_0x20e43f[_0x06da('0x2f')][_0x06da('0x1d')]);}_0x57b8bb[_0x06da('0x48')]=qs[_0x06da('0x49')](_0x20e43f[_0x06da('0x2f')][_0x06da('0x49')]);_0x57b8bb[_0x06da('0x4a')]=qs[_0x06da('0x30')](_[_0x06da('0x4b')](_0x20e43f['query'],_0x460a5e['filters']),_0x5bdbd0);if(_0x20e43f[_0x06da('0x2f')][_0x06da('0x4c')]){_0x57b8bb[_0x06da('0x4a')]=_[_0x06da('0x4d')](_0x57b8bb[_0x06da('0x4a')],{'$or':_[_0x06da('0x2a')](_0x5bdbd0,function(_0x3e4a7e){if(_0x3e4a7e[_0x06da('0x2d')]!==_0x06da('0x4e')){var _0x5d3718={};_0x5d3718[_0x3e4a7e[_0x06da('0x27')]]={'$like':'%'+_0x20e43f[_0x06da('0x2f')][_0x06da('0x4c')]+'%'};return _0x5d3718;}})});}_0x57b8bb=_[_0x06da('0x4d')]({},_0x57b8bb,_0x20e43f[_0x06da('0x4f')]);var _0x5e870c={'where':_0x57b8bb['where']};return db[_0x06da('0x2b')]['count'](_0x5e870c)[_0x06da('0x25')](function(_0x270524){_0x9b2cba[_0x06da('0x20')]=_0x270524;if(_0x20e43f[_0x06da('0x2f')][_0x06da('0x50')]){_0x57b8bb['include']=[{'all':!![]}];}return db[_0x06da('0x2b')]['findAll'](_0x57b8bb);})['then'](function(_0x2e1e85){_0x9b2cba[_0x06da('0x51')]=_0x2e1e85;return _0x9b2cba;})[_0x06da('0x25')](respondWithFilteredResult(_0x4de90f,_0x57b8bb))[_0x06da('0x52')](handleError(_0x4de90f,null));};exports['show']=function(_0x2bdbab,_0x24a8a4){var _0x1714b0={'raw':!![],'where':{'id':_0x2bdbab[_0x06da('0x53')]['id']}},_0x1350f0={};_0x1350f0[_0x06da('0x2e')]=_[_0x06da('0x54')](db[_0x06da('0x2b')][_0x06da('0x55')]);_0x1350f0[_0x06da('0x2f')]=_[_0x06da('0x54')](_0x2bdbab['query']);_0x1350f0['filters']=_[_0x06da('0x43')](_0x1350f0['model'],_0x1350f0['query']);_0x1714b0[_0x06da('0x42')]=_[_0x06da('0x43')](_0x1350f0['model'],qs['fields'](_0x2bdbab[_0x06da('0x2f')][_0x06da('0x44')]));_0x1714b0[_0x06da('0x42')]=_0x1714b0[_0x06da('0x42')][_0x06da('0x45')]?_0x1714b0[_0x06da('0x42')]:_0x1350f0[_0x06da('0x2e')];if(_0x2bdbab[_0x06da('0x2f')][_0x06da('0x50')]){_0x1714b0[_0x06da('0x56')]=[{'all':!![]}];}_0x1714b0=_['merge']({},_0x1714b0,_0x2bdbab[_0x06da('0x4f')]);return db[_0x06da('0x2b')][_0x06da('0x57')](_0x1714b0)[_0x06da('0x25')](handleEntityNotFound(_0x24a8a4,null))['then'](respondWithResult(_0x24a8a4,null))[_0x06da('0x52')](handleError(_0x24a8a4,null));};exports['create']=function(_0x248091,_0x5c1ce2){return db[_0x06da('0x2b')][_0x06da('0x58')](_0x248091['body'],{})[_0x06da('0x25')](respondWithResult(_0x5c1ce2,0xc9))[_0x06da('0x52')](handleError(_0x5c1ce2,null));};exports['update']=function(_0x4853ca,_0x8efd91){if(_0x4853ca['body']['id']){delete _0x4853ca[_0x06da('0x59')]['id'];}return db[_0x06da('0x2b')]['find']({'where':{'id':_0x4853ca['params']['id']}})['then'](handleEntityNotFound(_0x8efd91,null))['then'](saveUpdates(_0x4853ca[_0x06da('0x59')],null))[_0x06da('0x25')](respondWithResult(_0x8efd91,null))[_0x06da('0x52')](handleError(_0x8efd91,null));};exports[_0x06da('0x5a')]=function(_0x58cd79,_0x4b288f){return db[_0x06da('0x2b')][_0x06da('0x5a')]()[_0x06da('0x25')](respondWithResult(_0x4b288f,null))['catch'](handleError(_0x4b288f,null));};exports['destroy']=function(_0x2ef2b2,_0x260baf){var _0x47550b;return db[_0x06da('0x2b')][_0x06da('0x57')]({'where':{'id':_0x2ef2b2[_0x06da('0x53')]['id']}})[_0x06da('0x25')](handleEntityNotFound(_0x260baf,null))[_0x06da('0x25')](function(_0x53dac7){if(_0x53dac7){return _0x53dac7[_0x06da('0x26')]()['then'](function(_0x937a74){return _0x937a74;});}})[_0x06da('0x25')](function(_0x1ecc16){_0x47550b=_0x1ecc16;if(_0x1ecc16){if(_0x1ecc16[_0x06da('0x5b')]||_0x1ecc16[_0x06da('0x5c')]){return db[_0x1ecc16['VoiceQueueId']?_0x06da('0x5d'):_0x06da('0x5e')][_0x06da('0x57')]({'where':{'id':_0x1ecc16[_0x06da('0x5b')]?_0x1ecc16[_0x06da('0x5b')]:_0x1ecc16[_0x06da('0x5c')]},'attributes':['id',_0x06da('0x27')],'raw':!![]});}}})['then'](function(_0x3d3d93){var _0x10c27b={};if(_0x3d3d93){_['merge'](_0x10c27b,_[_0x06da('0x5f')](_0x47550b['dataValues'],['createdAt',_0x06da('0x60'),'id']));_0x10c27b[_0x06da('0x61')]=0x15;_0x10c27b[_0x06da('0x62')]=_0x06da('0x63');_0x10c27b[_0x06da('0x64')]=_0x3d3d93[_0x06da('0x27')];_0x10c27b[_0x06da('0x65')]=_0x2ef2b2['user']['name'];_0x10c27b[_0x06da('0x66')]=_0x2ef2b2[_0x06da('0x67')]['id'];_0x10c27b['deleted']=!![];_0x10c27b['deletedat']=moment()[_0x06da('0x68')](_0x06da('0x69'));_0x10c27b[_0x06da('0x6a')]=_0x47550b['phone'];_0x10c27b[_0x06da('0x6b')]=_0x47550b[_0x06da('0x5b')]?_0x06da('0x6c'):_0x06da('0x6d');return db[_0x06da('0x6e')][_0x06da('0x57')]({'where':{'id':_0x10c27b['ContactId']},'attributes':[_0x06da('0x6f'),_0x06da('0x70')]})[_0x06da('0x25')](function(_0x4b7316){if(!_['isNil'](_0x260baf)&&!_[_0x06da('0x71')](_0x4b7316['firstName'])){_0x10c27b[_0x06da('0x72')]=_0x4b7316[_0x06da('0x6f')];if(!_[_0x06da('0x71')](_0x4b7316[_0x06da('0x70')])){_0x10c27b[_0x06da('0x72')]+='\x20'+_0x4b7316[_0x06da('0x70')];}}})[_0x06da('0x73')](function(){return db['CmHopperFinal'][_0x06da('0x58')](_0x10c27b);});}})['then'](function(){return _0x260baf[_0x06da('0x1a')](0xcc)[_0x06da('0x1b')]();})[_0x06da('0x52')](handleError(_0x260baf,null));};exports[_0x06da('0x74')]=function(_0x11f48f,_0x109368,_0x1c7d37){var _0x4c1db5=[];return db[_0x06da('0x6e')][_0x06da('0x5a')]()['then'](function(_0x23dc10){_0x4c1db5=_[_0x06da('0x54')](_0x23dc10);return _0x11f48f['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x06da('0x75')},'attributes':['id','dialOrderByScheduledAt',_0x06da('0x76')],'raw':!![]});})['then'](function(_0x1d6f12){if(_0x1d6f12&&_0x1d6f12[_0x06da('0x45')]){return db[_0x06da('0x77')][_0x06da('0x78')](function(_0x418175){var _0x2fe62e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x06da('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x06da('0x2a')](_0x1d6f12,'id')},'$or':[{'UserId':null},{'UserId':_0x11f48f['user']['id']}]};var _0x506bcc={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1d6f12)[_0x06da('0x4c')]([_0x06da('0x76'),0x0])[_0x06da('0x2a')]('id')[_0x06da('0x79')]()},'$or':[{'UserId':null},{'UserId':_0x11f48f['user']['id']}]};var _0x2fc172={'$or':[_0x2fe62e,_0x506bcc]};var _0x2229ad=[];if(_0x11f48f[_0x06da('0x59')]['direction']&&_0x11f48f[_0x06da('0x59')]['direction']===_0x06da('0x7a')){if(!_[_0x06da('0x7b')](_0x11f48f[_0x06da('0x59')][_0x06da('0x7c')])){_0x2fc172['id']={'$in':_0x11f48f[_0x06da('0x59')][_0x06da('0x7c')]};}_0x2229ad=[[_0x06da('0x7d'),_0x06da('0x7e')],['scheduledAt',_0x1d6f12[0x0]['dialOrderByScheduledAt']==='ASC'?_0x06da('0x7f'):_0x06da('0x7e')],db[_0x06da('0x77')][_0x06da('0x80')](_0x06da('0x81')),['id',_0x06da('0x7f')]];}else{if(!_['isEmpty'](_0x11f48f['body'][_0x06da('0x7c')])){_0x2fc172['id']={'$notIn':_0x11f48f['body'][_0x06da('0x7c')]};}_0x2229ad=[[_0x06da('0x7d'),'DESC'],[_0x06da('0x82'),_0x1d6f12[0x0]['dialOrderByScheduledAt']],db[_0x06da('0x77')][_0x06da('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x06da('0x7e')]];}return db[_0x06da('0x2b')][_0x06da('0x83')]({'attributes':['id',_0x06da('0x84'),_0x06da('0x85')],'where':_0x2fc172,'order':_0x2229ad,'transaction':_0x418175,'lock':_0x418175['LOCK'][_0x06da('0x86')],'include':[{'model':db[_0x06da('0x6e')],'as':'Contact','attributes':_0x4c1db5,'include':[{'model':db['CmCompany'],'as':_0x06da('0x87'),'attributes':['id',_0x06da('0x27')]}]},{'model':db[_0x06da('0x88')],'as':_0x06da('0x89'),'attributes':['id',_0x06da('0x27')]},{'model':db['VoiceQueue'],'as':_0x06da('0x8a'),'attributes':['id',_0x06da('0x27'),'dialActive']}]})[_0x06da('0x25')](function(_0x375245){if(_0x375245){return _0x375245[_0x06da('0x24')]({'UserId':_0x11f48f[_0x06da('0x67')]['id']},{'transaction':_0x418175});}});});}})[_0x06da('0x25')](handleEntityNotFound(_0x109368,null))['then'](respondWithResult(_0x109368,null))[_0x06da('0x52')](handleError(_0x109368,null));};exports[_0x06da('0x8b')]=function(_0x34b1dc,_0x2ea5f9,_0x49dede){var _0x18e330=[];return db[_0x06da('0x6e')][_0x06da('0x5a')]()[_0x06da('0x25')](function(_0x1c9694){_0x18e330=_['keys'](_0x1c9694);return _0x34b1dc[_0x06da('0x67')]['getVoiceQueues']({'where':{'type':_0x06da('0x8c'),'dialActive':!![],'dialMethod':_0x06da('0x75')},'attributes':['id','dialOrderByScheduledAt',_0x06da('0x76')],'raw':!![]});})[_0x06da('0x25')](function(_0x4c6dec){if(_0x4c6dec&&_0x4c6dec[_0x06da('0x45')]){return db['sequelize'][_0x06da('0x78')](function(_0x18b2d7){var _0x4b5aed={'active':![],'recallme':!![],'id':_0x34b1dc[_0x06da('0x59')][_0x06da('0x8d')]};return db['CmHopper']['findOne']({'attributes':['id',_0x06da('0x84'),'recallme'],'where':_0x4b5aed,'transaction':_0x18b2d7,'lock':_0x18b2d7[_0x06da('0x8e')]['UPDATE'],'include':[{'model':db[_0x06da('0x6e')],'as':'Contact','attributes':_0x18e330,'include':[{'model':db['CmCompany'],'as':_0x06da('0x87'),'attributes':['id',_0x06da('0x27')]}]},{'model':db[_0x06da('0x88')],'as':_0x06da('0x89'),'attributes':['id',_0x06da('0x27')]},{'model':db['VoiceQueue'],'as':_0x06da('0x8a'),'attributes':['id',_0x06da('0x27'),'dialActive']}]})[_0x06da('0x25')](function(_0x381b7a){if(_0x381b7a){return _0x381b7a[_0x06da('0x24')]({'UserId':_0x34b1dc['user']['id']},{'transaction':_0x18b2d7});}});});}})['then'](handleEntityNotFound(_0x2ea5f9,null))[_0x06da('0x25')](respondWithResult(_0x2ea5f9,null))[_0x06da('0x52')](handleError(_0x2ea5f9,null));};exports[_0x06da('0x8f')]=function(_0x65559c,_0x19b5a9,_0x39ca56){return _0x65559c[_0x06da('0x67')]['getVoiceQueues']({'where':{'type':_0x06da('0x8c'),'dialActive':!![],'dialMethod':_0x06da('0x75')},'attributes':['id'],'raw':!![]})['then'](function(_0x39c642){if(_0x39c642&&_0x39c642[_0x06da('0x45')]){return db[_0x06da('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x06da('0x68')](_0x06da('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x39c642,'id')},'$or':[{'UserId':null},{'UserId':_0x65559c[_0x06da('0x67')]['id']}]}});}return 0x0;})[_0x06da('0x25')](function(_0xa6ccf3){if(!_[_0x06da('0x71')](_0xa6ccf3)&&_[_0x06da('0x90')](_0xa6ccf3)){return _0x19b5a9['status'](0xc8)['json']({'contacts':_0xa6ccf3});}else{logger[_0x06da('0x91')](_0x06da('0x92'),_0x06da('0x8f'),0x194,_0x06da('0x93'));_0x19b5a9['sendStatus'](0x194);}})[_0x06da('0x52')](handleError(_0x19b5a9,null));}; \ No newline at end of file +var _0x8e9d=['List','Queue','hopperId','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','zip-dir','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','key','query','keys','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$between','$in','$notLike','$iLike','$notILike','$like','$overlap','$contained','$any','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','CmList'];(function(_0x5f2031,_0x3e60fc){var _0x2e49e3=function(_0x2fd543){while(--_0x2fd543){_0x5f2031['push'](_0x5f2031['shift']());}};_0x2e49e3(++_0x3e60fc);}(_0x8e9d,0x12b));var _0xd8e9=function(_0x24ef45,_0x2d88cb){_0x24ef45=_0x24ef45-0x0;var _0x39084c=_0x8e9d[_0x24ef45];return _0x39084c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8e9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd8e9('0x1'));var BPromise=require(_0xd8e9('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8e9('0x3'));var sox=require(_0xd8e9('0x4'));var csv=require(_0xd8e9('0x5'));var ejs=require(_0xd8e9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd8e9('0x7'));var crypto=require(_0xd8e9('0x8'));var jsforce=require(_0xd8e9('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd8e9('0x5'));var querystring=require('querystring');var Papa=require(_0xd8e9('0xa'));var Redis=require(_0xd8e9('0xb'));var authService=require(_0xd8e9('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e9('0xd'));var hardwareService=require(_0xd8e9('0xe'));var logger=require(_0xd8e9('0xf'))(_0xd8e9('0x10'));var utils=require(_0xd8e9('0x11'));var config=require(_0xd8e9('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c9170,_0x248ee1){_0x248ee1=_0x248ee1||0xcc;return function(_0x362356){if(_0x362356){return _0x3c9170[_0xd8e9('0x13')](_0x248ee1);}return _0x3c9170[_0xd8e9('0x14')](_0x248ee1)[_0xd8e9('0x15')]();};}function respondWithResult(_0x4d7b25,_0x596cd2){_0x596cd2=_0x596cd2||0xc8;return function(_0x5f0d04){if(_0x5f0d04){return _0x4d7b25[_0xd8e9('0x14')](_0x596cd2)[_0xd8e9('0x16')](_0x5f0d04);}};}function respondWithFilteredResult(_0x4de234,_0x4c130f){return function(_0x4b3ad2){if(_0x4b3ad2){var _0x2f7fe7=typeof _0x4c130f[_0xd8e9('0x17')]===_0xd8e9('0x18')&&typeof _0x4c130f[_0xd8e9('0x19')]===_0xd8e9('0x18');var _0x1166da=_0x4b3ad2[_0xd8e9('0x1a')];var _0xd0a50b=_0x2f7fe7?0x0:_0x4c130f[_0xd8e9('0x17')];var _0x51941d=_0x2f7fe7?_0x4b3ad2['count']:_0x4c130f[_0xd8e9('0x17')]+_0x4c130f[_0xd8e9('0x19')];var _0xea8bb;if(_0x51941d>=_0x1166da){_0x51941d=_0x1166da;_0xea8bb=0xc8;}else{_0xea8bb=0xce;}_0x4de234['status'](_0xea8bb);return _0x4de234[_0xd8e9('0x1b')](_0xd8e9('0x1c'),_0xd0a50b+'-'+_0x51941d+'/'+_0x1166da)[_0xd8e9('0x16')](_0x4b3ad2);}return null;};}function patchUpdates(_0x3ad98b){return function(_0x4b0337){try{jsonpatch[_0xd8e9('0x1d')](_0x4b0337,_0x3ad98b,!![]);}catch(_0x10b3f1){return BPromise[_0xd8e9('0x1e')](_0x10b3f1);}return _0x4b0337[_0xd8e9('0x1f')]();};}function saveUpdates(_0x5c157d,_0x592931){return function(_0x3873d3){if(_0x3873d3){return _0x3873d3[_0xd8e9('0x20')](_0x5c157d)[_0xd8e9('0x21')](function(_0x425030){return _0x425030;});}return null;};}function removeEntity(_0x20ede0,_0x547c3e){return function(_0x94f0ee){if(_0x94f0ee){return _0x94f0ee[_0xd8e9('0x22')]()['then'](function(){_0x20ede0[_0xd8e9('0x14')](0xcc)[_0xd8e9('0x15')]();});}};}function handleEntityNotFound(_0x28bcc1,_0x31fd2d){return function(_0xe49a1f){if(!_0xe49a1f){_0x28bcc1['sendStatus'](0x194);}return _0xe49a1f;};}function handleError(_0x2c065c,_0x7fd5c){_0x7fd5c=_0x7fd5c||0x1f4;return function(_0x5b5065){logger['error'](_0x5b5065['stack']);if(_0x5b5065['name']){delete _0x5b5065[_0xd8e9('0x23')];}_0x2c065c[_0xd8e9('0x14')](_0x7fd5c)[_0xd8e9('0x24')](_0x5b5065);};}exports[_0xd8e9('0x25')]=function(_0x55e8b8,_0x2a96d2){var _0x1fa9ba={},_0x38304a={},_0xb86103={'count':0x0,'rows':[]};var _0x3e1207=_[_0xd8e9('0x26')](db['CmHopper']['rawAttributes'],function(_0x39f9b1){return{'name':_0x39f9b1['fieldName'],'type':_0x39f9b1['type'][_0xd8e9('0x27')]};});_0x38304a['model']=_['map'](_0x3e1207,'name');_0x38304a[_0xd8e9('0x28')]=_[_0xd8e9('0x29')](_0x55e8b8[_0xd8e9('0x28')]);_0x38304a['filters']=_['intersection'](_0x38304a['model'],_0x38304a[_0xd8e9('0x28')]);_0x38304a[_0xd8e9('0x2a')]=_[_0xd8e9('0x2b')](_0x38304a['filters'],[_0xd8e9('0x2c'),_0xd8e9('0x2d'),'$gt',_0xd8e9('0x2e'),_0xd8e9('0x2f'),_0xd8e9('0x30'),_0xd8e9('0x31'),'$eq','$not',_0xd8e9('0x32'),'$notBetween',_0xd8e9('0x33'),'$notIn','$like',_0xd8e9('0x34'),_0xd8e9('0x35'),_0xd8e9('0x36'),_0xd8e9('0x37'),_0xd8e9('0x38'),'$contains',_0xd8e9('0x39'),_0xd8e9('0x3a')]);_0x1fa9ba[_0xd8e9('0x3b')]=_['intersection'](_0x38304a[_0xd8e9('0x3c')],qs[_0xd8e9('0x3d')](_0x55e8b8[_0xd8e9('0x28')][_0xd8e9('0x3d')]));_0x1fa9ba['attributes']=_0x1fa9ba[_0xd8e9('0x3b')][_0xd8e9('0x3e')]?_0x1fa9ba[_0xd8e9('0x3b')]:_0x38304a[_0xd8e9('0x3c')];if(!_0x55e8b8[_0xd8e9('0x28')][_0xd8e9('0x3f')](_0xd8e9('0x40'))){_0x1fa9ba['limit']=qs[_0xd8e9('0x19')](_0x55e8b8[_0xd8e9('0x28')]['limit']);_0x1fa9ba[_0xd8e9('0x17')]=qs['offset'](_0x55e8b8[_0xd8e9('0x28')][_0xd8e9('0x17')]);}_0x1fa9ba[_0xd8e9('0x41')]=qs[_0xd8e9('0x42')](_0x55e8b8[_0xd8e9('0x28')][_0xd8e9('0x42')]);_0x1fa9ba[_0xd8e9('0x43')]=qs[_0xd8e9('0x2a')](_[_0xd8e9('0x44')](_0x55e8b8[_0xd8e9('0x28')],_0x38304a[_0xd8e9('0x2a')]),_0x3e1207);if(_0x55e8b8['query'][_0xd8e9('0x45')]){_0x1fa9ba['where']=_['merge'](_0x1fa9ba[_0xd8e9('0x43')],{'$or':_[_0xd8e9('0x26')](_0x3e1207,function(_0x5d62d4){if(_0x5d62d4[_0xd8e9('0x46')]!==_0xd8e9('0x47')){var _0x43d209={};_0x43d209[_0x5d62d4['name']]={'$like':'%'+_0x55e8b8[_0xd8e9('0x28')][_0xd8e9('0x45')]+'%'};return _0x43d209;}})});}_0x1fa9ba=_[_0xd8e9('0x48')]({},_0x1fa9ba,_0x55e8b8[_0xd8e9('0x49')]);var _0x63a6ce={'where':_0x1fa9ba[_0xd8e9('0x43')]};return db[_0xd8e9('0x4a')][_0xd8e9('0x1a')](_0x63a6ce)[_0xd8e9('0x21')](function(_0x556359){_0xb86103[_0xd8e9('0x1a')]=_0x556359;if(_0x55e8b8['query'][_0xd8e9('0x4b')]){_0x1fa9ba[_0xd8e9('0x4c')]=[{'all':!![]}];}return db[_0xd8e9('0x4a')][_0xd8e9('0x4d')](_0x1fa9ba);})[_0xd8e9('0x21')](function(_0x470323){_0xb86103[_0xd8e9('0x4e')]=_0x470323;return _0xb86103;})[_0xd8e9('0x21')](respondWithFilteredResult(_0x2a96d2,_0x1fa9ba))[_0xd8e9('0x4f')](handleError(_0x2a96d2,null));};exports['show']=function(_0x4cf323,_0x43adb8){var _0x15cf97={'raw':!![],'where':{'id':_0x4cf323[_0xd8e9('0x50')]['id']}},_0x3eafb7={};_0x3eafb7[_0xd8e9('0x3c')]=_[_0xd8e9('0x29')](db[_0xd8e9('0x4a')]['rawAttributes']);_0x3eafb7[_0xd8e9('0x28')]=_['keys'](_0x4cf323['query']);_0x3eafb7[_0xd8e9('0x2a')]=_[_0xd8e9('0x51')](_0x3eafb7[_0xd8e9('0x3c')],_0x3eafb7[_0xd8e9('0x28')]);_0x15cf97[_0xd8e9('0x3b')]=_['intersection'](_0x3eafb7[_0xd8e9('0x3c')],qs[_0xd8e9('0x3d')](_0x4cf323[_0xd8e9('0x28')][_0xd8e9('0x3d')]));_0x15cf97[_0xd8e9('0x3b')]=_0x15cf97[_0xd8e9('0x3b')][_0xd8e9('0x3e')]?_0x15cf97[_0xd8e9('0x3b')]:_0x3eafb7[_0xd8e9('0x3c')];if(_0x4cf323[_0xd8e9('0x28')][_0xd8e9('0x4b')]){_0x15cf97[_0xd8e9('0x4c')]=[{'all':!![]}];}_0x15cf97=_[_0xd8e9('0x48')]({},_0x15cf97,_0x4cf323[_0xd8e9('0x49')]);return db[_0xd8e9('0x4a')][_0xd8e9('0x52')](_0x15cf97)[_0xd8e9('0x21')](handleEntityNotFound(_0x43adb8,null))[_0xd8e9('0x21')](respondWithResult(_0x43adb8,null))['catch'](handleError(_0x43adb8,null));};exports[_0xd8e9('0x53')]=function(_0x5a8f80,_0x43fefd){return db[_0xd8e9('0x4a')][_0xd8e9('0x53')](_0x5a8f80[_0xd8e9('0x54')],{})[_0xd8e9('0x21')](respondWithResult(_0x43fefd,0xc9))[_0xd8e9('0x4f')](handleError(_0x43fefd,null));};exports[_0xd8e9('0x20')]=function(_0x3c11ba,_0x503ddc){if(_0x3c11ba[_0xd8e9('0x54')]['id']){delete _0x3c11ba[_0xd8e9('0x54')]['id'];}return db[_0xd8e9('0x4a')]['find']({'where':{'id':_0x3c11ba[_0xd8e9('0x50')]['id']}})['then'](handleEntityNotFound(_0x503ddc,null))[_0xd8e9('0x21')](saveUpdates(_0x3c11ba[_0xd8e9('0x54')],null))[_0xd8e9('0x21')](respondWithResult(_0x503ddc,null))['catch'](handleError(_0x503ddc,null));};exports[_0xd8e9('0x55')]=function(_0x5c9820,_0xc0e4a8){return db[_0xd8e9('0x4a')][_0xd8e9('0x55')]()[_0xd8e9('0x21')](respondWithResult(_0xc0e4a8,null))[_0xd8e9('0x4f')](handleError(_0xc0e4a8,null));};exports[_0xd8e9('0x22')]=function(_0x4d9861,_0x41969a){var _0x20e1f8;return db[_0xd8e9('0x4a')][_0xd8e9('0x52')]({'where':{'id':_0x4d9861[_0xd8e9('0x50')]['id']}})[_0xd8e9('0x21')](handleEntityNotFound(_0x41969a,null))[_0xd8e9('0x21')](function(_0xe8488a){if(_0xe8488a){return _0xe8488a[_0xd8e9('0x22')]()['then'](function(_0x4541eb){return _0x4541eb;});}})[_0xd8e9('0x21')](function(_0x111cc2){_0x20e1f8=_0x111cc2;if(_0x111cc2){if(_0x111cc2['VoiceQueueId']||_0x111cc2[_0xd8e9('0x56')]){return db[_0x111cc2[_0xd8e9('0x57')]?_0xd8e9('0x58'):'Campaign'][_0xd8e9('0x52')]({'where':{'id':_0x111cc2['VoiceQueueId']?_0x111cc2[_0xd8e9('0x57')]:_0x111cc2['CampaignId']},'attributes':['id',_0xd8e9('0x23')],'raw':!![]});}}})[_0xd8e9('0x21')](function(_0x1021af){var _0x4f0f29={};if(_0x1021af){_['merge'](_0x4f0f29,_[_0xd8e9('0x59')](_0x20e1f8[_0xd8e9('0x5a')],[_0xd8e9('0x5b'),_0xd8e9('0x5c'),'id']));_0x4f0f29['state']=0x15;_0x4f0f29[_0xd8e9('0x5d')]=_0xd8e9('0x5e');_0x4f0f29[_0xd8e9('0x5f')]=_0x1021af[_0xd8e9('0x23')];_0x4f0f29['membername']=_0x4d9861[_0xd8e9('0x60')][_0xd8e9('0x23')];_0x4f0f29[_0xd8e9('0x61')]=_0x4d9861[_0xd8e9('0x60')]['id'];_0x4f0f29[_0xd8e9('0x5e')]=!![];_0x4f0f29['deletedat']=moment()[_0xd8e9('0x62')](_0xd8e9('0x63'));_0x4f0f29[_0xd8e9('0x64')]=_0x20e1f8[_0xd8e9('0x65')];_0x4f0f29[_0xd8e9('0x66')]=_0x20e1f8[_0xd8e9('0x57')]?_0xd8e9('0x67'):_0xd8e9('0x68');return db[_0xd8e9('0x69')]['find']({'where':{'id':_0x4f0f29[_0xd8e9('0x6a')]},'attributes':[_0xd8e9('0x6b'),_0xd8e9('0x6c')]})[_0xd8e9('0x21')](function(_0x51d8c5){if(!_[_0xd8e9('0x6d')](_0x41969a)&&!_['isNil'](_0x51d8c5[_0xd8e9('0x6b')])){_0x4f0f29[_0xd8e9('0x6e')]=_0x51d8c5[_0xd8e9('0x6b')];if(!_['isNil'](_0x51d8c5[_0xd8e9('0x6c')])){_0x4f0f29[_0xd8e9('0x6e')]+='\x20'+_0x51d8c5[_0xd8e9('0x6c')];}}})[_0xd8e9('0x6f')](function(){return db[_0xd8e9('0x70')]['create'](_0x4f0f29);});}})[_0xd8e9('0x21')](function(){return _0x41969a['status'](0xcc)[_0xd8e9('0x15')]();})[_0xd8e9('0x4f')](handleError(_0x41969a,null));};exports['getPreview']=function(_0x11dda3,_0x4c5d90,_0x25ff2a){var _0x41f03c=[];return db[_0xd8e9('0x69')][_0xd8e9('0x55')]()[_0xd8e9('0x21')](function(_0x235fe6){_0x41f03c=_[_0xd8e9('0x29')](_0x235fe6);return _0x11dda3[_0xd8e9('0x60')][_0xd8e9('0x71')]({'where':{'type':_0xd8e9('0x72'),'dialActive':!![],'dialMethod':_0xd8e9('0x73')},'attributes':['id','dialOrderByScheduledAt',_0xd8e9('0x74')],'raw':!![]});})['then'](function(_0x56d68c){if(_0x56d68c&&_0x56d68c['length']){return db[_0xd8e9('0x75')][_0xd8e9('0x76')](function(_0x4f5a1b){var _0x39ca05={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd8e9('0x62')](_0xd8e9('0x63'))},'VoiceQueueId':{'$in':_['map'](_0x56d68c,'id')},'$or':[{'UserId':null},{'UserId':_0x11dda3[_0xd8e9('0x60')]['id']}]};var _0x54f14c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x56d68c)[_0xd8e9('0x45')]([_0xd8e9('0x74'),0x0])[_0xd8e9('0x26')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x11dda3['user']['id']}]};var _0x5f3556={'$or':[_0x39ca05,_0x54f14c]};var _0x28cfba=[];if(_0x11dda3[_0xd8e9('0x54')][_0xd8e9('0x77')]&&_0x11dda3['body'][_0xd8e9('0x77')]===_0xd8e9('0x78')){if(!_['isEmpty'](_0x11dda3['body'][_0xd8e9('0x79')])){_0x5f3556['id']={'$in':_0x11dda3[_0xd8e9('0x54')][_0xd8e9('0x79')]};}_0x28cfba=[[_0xd8e9('0x7a'),'ASC'],[_0xd8e9('0x7b'),_0x56d68c[0x0][_0xd8e9('0x7c')]===_0xd8e9('0x7d')?_0xd8e9('0x7e'):_0xd8e9('0x7d')],db[_0xd8e9('0x75')][_0xd8e9('0x7f')](_0xd8e9('0x80')),['id',_0xd8e9('0x7e')]];}else{if(!_[_0xd8e9('0x81')](_0x11dda3[_0xd8e9('0x54')]['hopperIds'])){_0x5f3556['id']={'$notIn':_0x11dda3[_0xd8e9('0x54')][_0xd8e9('0x79')]};}_0x28cfba=[[_0xd8e9('0x7a'),_0xd8e9('0x7e')],[_0xd8e9('0x7b'),_0x56d68c[0x0][_0xd8e9('0x7c')]],db[_0xd8e9('0x75')][_0xd8e9('0x7f')](_0xd8e9('0x82')),['id',_0xd8e9('0x7d')]];}return db[_0xd8e9('0x4a')][_0xd8e9('0x83')]({'attributes':['id',_0xd8e9('0x84'),_0xd8e9('0x85')],'where':_0x5f3556,'order':_0x28cfba,'transaction':_0x4f5a1b,'lock':_0x4f5a1b[_0xd8e9('0x86')]['UPDATE'],'include':[{'model':db[_0xd8e9('0x69')],'as':_0xd8e9('0x87'),'attributes':_0x41f03c,'include':[{'model':db[_0xd8e9('0x88')],'as':_0xd8e9('0x89'),'attributes':['id','name']}]},{'model':db[_0xd8e9('0x8a')],'as':_0xd8e9('0x8b'),'attributes':['id',_0xd8e9('0x23')]},{'model':db[_0xd8e9('0x58')],'as':_0xd8e9('0x8c'),'attributes':['id','name','dialActive']}]})[_0xd8e9('0x21')](function(_0x2a772d){if(_0x2a772d){return _0x2a772d[_0xd8e9('0x20')]({'UserId':_0x11dda3[_0xd8e9('0x60')]['id']},{'transaction':_0x4f5a1b});}});});}})[_0xd8e9('0x21')](handleEntityNotFound(_0x4c5d90,null))[_0xd8e9('0x21')](respondWithResult(_0x4c5d90,null))[_0xd8e9('0x4f')](handleError(_0x4c5d90,null));};exports['getPreviewRecall']=function(_0x3e6054,_0x593ed1,_0x3adb49){var _0x473fbd=[];return db[_0xd8e9('0x69')][_0xd8e9('0x55')]()['then'](function(_0x28e23c){_0x473fbd=_[_0xd8e9('0x29')](_0x28e23c);return _0x3e6054['user']['getVoiceQueues']({'where':{'type':_0xd8e9('0x72'),'dialActive':!![],'dialMethod':_0xd8e9('0x73')},'attributes':['id',_0xd8e9('0x7c'),_0xd8e9('0x74')],'raw':!![]});})['then'](function(_0x100c69){if(_0x100c69&&_0x100c69[_0xd8e9('0x3e')]){return db[_0xd8e9('0x75')][_0xd8e9('0x76')](function(_0x17f871){var _0x4b019b={'active':![],'recallme':!![],'id':_0x3e6054[_0xd8e9('0x54')][_0xd8e9('0x8d')]};return db['CmHopper']['findOne']({'attributes':['id',_0xd8e9('0x84'),_0xd8e9('0x85')],'where':_0x4b019b,'transaction':_0x17f871,'lock':_0x17f871[_0xd8e9('0x86')]['UPDATE'],'include':[{'model':db[_0xd8e9('0x69')],'as':_0xd8e9('0x87'),'attributes':_0x473fbd,'include':[{'model':db[_0xd8e9('0x88')],'as':_0xd8e9('0x89'),'attributes':['id','name']}]},{'model':db[_0xd8e9('0x8a')],'as':_0xd8e9('0x8b'),'attributes':['id',_0xd8e9('0x23')]},{'model':db[_0xd8e9('0x58')],'as':_0xd8e9('0x8c'),'attributes':['id','name',_0xd8e9('0x8e')]}]})[_0xd8e9('0x21')](function(_0x5eef6c){if(_0x5eef6c){return _0x5eef6c[_0xd8e9('0x20')]({'UserId':_0x3e6054[_0xd8e9('0x60')]['id']},{'transaction':_0x17f871});}});});}})[_0xd8e9('0x21')](handleEntityNotFound(_0x593ed1,null))[_0xd8e9('0x21')](respondWithResult(_0x593ed1,null))[_0xd8e9('0x4f')](handleError(_0x593ed1,null));};exports[_0xd8e9('0x8f')]=function(_0x1d1644,_0x46ce77,_0x37eb29){return _0x1d1644['user'][_0xd8e9('0x71')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xd8e9('0x73')},'attributes':['id'],'raw':!![]})[_0xd8e9('0x21')](function(_0x3dd5a8){if(_0x3dd5a8&&_0x3dd5a8[_0xd8e9('0x3e')]){return db[_0xd8e9('0x4a')][_0xd8e9('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd8e9('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3dd5a8,'id')},'$or':[{'UserId':null},{'UserId':_0x1d1644['user']['id']}]}});}return 0x0;})['then'](function(_0x3a8063){if(!_['isNil'](_0x3a8063)&&_[_0xd8e9('0x90')](_0x3a8063)){return _0x46ce77[_0xd8e9('0x14')](0xc8)[_0xd8e9('0x16')]({'contacts':_0x3a8063});}else{logger['error'](_0xd8e9('0x91'),_0xd8e9('0x8f'),0x194,'entity\x20not\x20found');_0x46ce77[_0xd8e9('0x13')](0x194);}})[_0xd8e9('0x4f')](handleError(_0x46ce77,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 5543790..1a12e4e 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 _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x46ae1a,_0x341746){var _0x554118=function(_0x38d898){while(--_0x38d898){_0x46ae1a['push'](_0x46ae1a['shift']());}};_0x554118(++_0x341746);}(_0xf494,0x1c6));var _0x4f49=function(_0x2ff0f5,_0x5388e1){_0x2ff0f5=_0x2ff0f5-0x0;var _0x304017=_0xf494[_0x2ff0f5];return _0x304017;};'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')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','cm_hopper','scheduledat','phone','priority','lodash'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xabce,0x103));var _0xeabc=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xabce[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./cmHopper.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('CmHopper',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]},{'name':'phone','fields':[_0xeabc('0xb')]},{'name':_0xeabc('0xc'),'fields':[_0xeabc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bfa5a68..d42dbe2 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 _0xd29f=['Contact','keys','User','Agent','voicePause','length','UserId','push','update','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','all','GetCmHopperPreview','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','CmList','List','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','twilio/lib/webhooks/webhooks','client','then','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes','include','map','model','debug','ShowCmHopper','find','CreateCmHopper','CmHopper','create','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','describe','transaction','order','LOCK','CmContact'];(function(_0x5d93c4,_0x39178d){var _0x2f45d2=function(_0x2d170e){while(--_0x2d170e){_0x5d93c4['push'](_0x5d93c4['shift']());}};_0x2f45d2(++_0x39178d);}(_0xd29f,0x1c2));var _0xfd29=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xd29f[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xfd29('0x0'));var util=require(_0xfd29('0x1'));var moment=require(_0xfd29('0x2'));var BPromise=require(_0xfd29('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd29('0x4'));var logger=require(_0xfd29('0x5'))(_0xfd29('0x6'));var config=require('../../config/environment');var jayson=require(_0xfd29('0x7'));const {validateExpressRequest}=require(_0xfd29('0x8'));var client=jayson[_0xfd29('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x289a77,_0x2365cd,_0x481150){return new BPromise(function(_0x176714,_0x24cf76){return client['request'](_0x289a77,_0x481150)[_0xfd29('0xa')](function(_0x2ae33c){logger[_0xfd29('0xb')]('CmHopper,\x20%s,\x20%s',_0x2365cd,_0xfd29('0xc'));logger['debug'](_0xfd29('0xd'),_0x2365cd,_0xfd29('0xc'),JSON[_0xfd29('0xe')](_0x2ae33c));if(_0x2ae33c[_0xfd29('0xf')]){if(_0x2ae33c[_0xfd29('0xf')][_0xfd29('0x10')]===0x1f4){logger[_0xfd29('0xf')](_0xfd29('0x11'),_0x2365cd,_0x2ae33c[_0xfd29('0xf')]['message']);return _0x24cf76(_0x2ae33c[_0xfd29('0xf')]['message']);}logger[_0xfd29('0xf')](_0xfd29('0x11'),_0x2365cd,_0x2ae33c['error']['message']);return _0x176714(_0x2ae33c['error'][_0xfd29('0x12')]);}else{logger[_0xfd29('0xb')](_0xfd29('0x11'),_0x2365cd,_0xfd29('0xc'));_0x176714(_0x2ae33c[_0xfd29('0x13')]['message']);}})[_0xfd29('0x14')](function(_0x5c6082){logger[_0xfd29('0xf')](_0xfd29('0x11'),_0x2365cd,_0x5c6082);_0x24cf76(_0x5c6082);});});}exports[_0xfd29('0x15')]=function(_0x48984f){var _0x1b75af=this;return new Promise(function(_0x357c3f,_0x45d717){return db['CmHopper'][_0xfd29('0x16')]({'raw':_0x48984f[_0xfd29('0x17')]?_0x48984f[_0xfd29('0x17')][_0xfd29('0x18')]===undefined?!![]:![]:!![],'where':_0x48984f[_0xfd29('0x17')]?_0x48984f[_0xfd29('0x17')][_0xfd29('0x19')]||null:null,'attributes':_0x48984f[_0xfd29('0x17')]?_0x48984f['options'][_0xfd29('0x1a')]||null:null,'limit':_0x48984f['options']?_0x48984f[_0xfd29('0x17')]['limit']||null:null,'include':_0x48984f[_0xfd29('0x17')]?_0x48984f[_0xfd29('0x17')][_0xfd29('0x1b')]?_[_0xfd29('0x1c')](_0x48984f[_0xfd29('0x17')][_0xfd29('0x1b')],function(_0x2b6dfd){return{'model':db[_0x2b6dfd['model']],'as':_0x2b6dfd['as'],'attributes':_0x2b6dfd[_0xfd29('0x1a')],'include':_0x2b6dfd['include']?_['map'](_0x2b6dfd[_0xfd29('0x1b')],function(_0x3935d2){return{'model':db[_0x3935d2[_0xfd29('0x1d')]],'as':_0x3935d2['as'],'attributes':_0x3935d2[_0xfd29('0x1a')],'include':_0x3935d2['include']?_[_0xfd29('0x1c')](_0x3935d2[_0xfd29('0x1b')],function(_0x5193f8){return{'model':db[_0x5193f8[_0xfd29('0x1d')]],'as':_0x5193f8['as'],'attributes':_0x5193f8[_0xfd29('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfd29('0xa')](function(_0x19a1b3){logger['info'](_0xfd29('0x15'),_0x48984f);logger[_0xfd29('0x1e')](_0xfd29('0x15'),_0x48984f,JSON['stringify'](_0x19a1b3));_0x357c3f(_0x19a1b3);})[_0xfd29('0x14')](function(_0x3be607){logger[_0xfd29('0xf')](_0xfd29('0x15'),_0x3be607[_0xfd29('0x12')],_0x48984f);_0x45d717(_0x1b75af[_0xfd29('0xf')](0x1f4,_0x3be607[_0xfd29('0x12')]));});});};exports[_0xfd29('0x1f')]=function(_0xcc1cdc){var _0x458f2a=this;return new Promise(function(_0x4fdf52,_0x398b22){return db['CmHopper'][_0xfd29('0x20')]({'raw':_0xcc1cdc[_0xfd29('0x17')]?_0xcc1cdc[_0xfd29('0x17')][_0xfd29('0x18')]===undefined?!![]:![]:!![],'where':_0xcc1cdc[_0xfd29('0x17')]?_0xcc1cdc['options'][_0xfd29('0x19')]||null:null,'attributes':_0xcc1cdc[_0xfd29('0x17')]?_0xcc1cdc[_0xfd29('0x17')][_0xfd29('0x1a')]||null:null,'include':_0xcc1cdc['options']?_0xcc1cdc[_0xfd29('0x17')][_0xfd29('0x1b')]?_[_0xfd29('0x1c')](_0xcc1cdc[_0xfd29('0x17')][_0xfd29('0x1b')],function(_0x307672){return{'model':db[_0x307672[_0xfd29('0x1d')]],'as':_0x307672['as'],'attributes':_0x307672[_0xfd29('0x1a')],'include':_0x307672[_0xfd29('0x1b')]?_[_0xfd29('0x1c')](_0x307672[_0xfd29('0x1b')],function(_0x3d4753){return{'model':db[_0x3d4753[_0xfd29('0x1d')]],'as':_0x3d4753['as'],'attributes':_0x3d4753[_0xfd29('0x1a')],'include':_0x3d4753[_0xfd29('0x1b')]?_['map'](_0x3d4753[_0xfd29('0x1b')],function(_0x1b0237){return{'model':db[_0x1b0237['model']],'as':_0x1b0237['as'],'attributes':_0x1b0237['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47d4e5){logger[_0xfd29('0xb')]('ShowCmHopper',_0xcc1cdc);logger['debug'](_0xfd29('0x1f'),_0xcc1cdc,JSON[_0xfd29('0xe')](_0x47d4e5));_0x4fdf52(_0x47d4e5);})[_0xfd29('0x14')](function(_0x2360d5){logger[_0xfd29('0xf')]('ShowCmHopper',_0x2360d5[_0xfd29('0x12')],_0xcc1cdc);_0x398b22(_0x458f2a[_0xfd29('0xf')](0x1f4,_0x2360d5[_0xfd29('0x12')]));});});};exports[_0xfd29('0x21')]=function(_0x52c36b){var _0x5f5926=this;return new Promise(function(_0x824926,_0xd850ea){return db[_0xfd29('0x22')][_0xfd29('0x23')](_0x52c36b[_0xfd29('0x24')],{'raw':_0x52c36b[_0xfd29('0x17')]?_0x52c36b[_0xfd29('0x17')][_0xfd29('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4fcf94){logger['info']('CreateCmHopper',_0x52c36b);logger['debug']('CreateCmHopper',_0x52c36b,JSON['stringify'](_0x4fcf94));_0x824926(_0x4fcf94);})[_0xfd29('0x14')](function(_0x2ad1f2){logger[_0xfd29('0xf')](_0xfd29('0x21'),_0x2ad1f2[_0xfd29('0x12')],_0x52c36b);_0xd850ea(_0x5f5926[_0xfd29('0xf')](0x1f4,_0x2ad1f2[_0xfd29('0x12')]));});});};exports[_0xfd29('0x25')]=function(_0x2c5e4e){var _0x239d18=this;return new Promise(function(_0x5b5299,_0x3a1c7b){return db[_0xfd29('0x22')]['update'](_0x2c5e4e[_0xfd29('0x24')],{'raw':_0x2c5e4e[_0xfd29('0x17')]?_0x2c5e4e[_0xfd29('0x17')][_0xfd29('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5e4e[_0xfd29('0x17')]?_0x2c5e4e[_0xfd29('0x17')][_0xfd29('0x19')]||null:null,'attributes':_0x2c5e4e[_0xfd29('0x17')]?_0x2c5e4e[_0xfd29('0x17')][_0xfd29('0x1a')]||null:null,'limit':_0x2c5e4e[_0xfd29('0x17')]?_0x2c5e4e[_0xfd29('0x17')][_0xfd29('0x26')]||null:null})[_0xfd29('0xa')](function(_0x2b0401){logger[_0xfd29('0xb')](_0xfd29('0x25'),_0x2c5e4e);logger[_0xfd29('0xb')](_0xfd29('0x27'),JSON[_0xfd29('0xe')](_0x2c5e4e[_0xfd29('0x17')]['where']),_0x2c5e4e[_0xfd29('0x24')]['active']);logger[_0xfd29('0x1e')]('UpdateCmHopper',_0x2c5e4e,JSON[_0xfd29('0xe')](_0x2b0401));_0x5b5299(_0x2b0401);})[_0xfd29('0x14')](function(_0x5d63e0){logger[_0xfd29('0xf')](_0xfd29('0x25'),_0x5d63e0['message'],_0x2c5e4e);_0x3a1c7b(_0x239d18[_0xfd29('0xf')](0x1f4,_0x5d63e0[_0xfd29('0x12')]));});});};exports[_0xfd29('0x28')]=function(_0x1e676b){var _0x2dae31=this;return new Promise(function(_0x2e5ed4,_0x260d59){return db[_0xfd29('0x22')][_0xfd29('0x29')]({'where':_0x1e676b[_0xfd29('0x17')]?_0x1e676b[_0xfd29('0x17')][_0xfd29('0x19')]||null:null})[_0xfd29('0xa')](function(_0x3d2a16){logger[_0xfd29('0xb')](_0xfd29('0x28'),_0x1e676b);logger[_0xfd29('0x1e')]('DestroyCmHopper',_0x1e676b,JSON['stringify'](_0x3d2a16));_0x2e5ed4(_0x3d2a16);})[_0xfd29('0x14')](function(_0x498602){logger[_0xfd29('0xf')](_0xfd29('0x28'),_0x498602[_0xfd29('0x12')],_0x1e676b);_0x260d59(_0x2dae31['error'](0x1f4,_0x498602[_0xfd29('0x12')]));});});};exports[_0xfd29('0x2a')]=function(_0x4aeb07){var _0x43682a=this;return new Promise(function(_0x4b09ee,_0x738cd3){return db['CmContact'][_0xfd29('0x2b')]()['then'](function(_0x28bd9b){return db['sequelize'][_0xfd29('0x2c')](function(_0x1357f8){return db[_0xfd29('0x22')][_0xfd29('0x16')]({'where':_0x4aeb07[_0xfd29('0x17')]?_0x4aeb07[_0xfd29('0x17')][_0xfd29('0x19')]||null:null,'attributes':_0x4aeb07[_0xfd29('0x17')]?_0x4aeb07[_0xfd29('0x17')]['attributes']||null:null,'limit':_0x4aeb07[_0xfd29('0x17')]?_0x4aeb07['options'][_0xfd29('0x26')]||null:null,'order':_0x4aeb07[_0xfd29('0x17')]?_0x4aeb07['options'][_0xfd29('0x2d')]||null:null,'transaction':_0x1357f8,'lock':_0x1357f8[_0xfd29('0x2e')]['UPDATE'],'include':[{'model':db[_0xfd29('0x2f')],'as':_0xfd29('0x30'),'attributes':_[_0xfd29('0x31')](_0x28bd9b)},{'model':db[_0xfd29('0x32')],'as':_0xfd29('0x33'),'attributes':['id','name',_0xfd29('0x34')]}]})['then'](function(_0x5d0374){var _0x5308d5=[];var _0x515466=[];for(var _0x5b6c41=0x0;_0x5b6c41<_0x5d0374[_0xfd29('0x35')];_0x5b6c41+=0x1){var _0x33b024=_0x5d0374[_0x5b6c41][_0xfd29('0x36')];if(_0x33b024===null){_0x5308d5[_0xfd29('0x37')](_0x5d0374[_0x5b6c41][_0xfd29('0x38')](_0x4aeb07['body'],{'transaction':_0x1357f8}));}else if(!_0x515466['includes'](_0x33b024)){_0x515466['push'](_0x33b024);_0x5308d5[_0xfd29('0x37')](_0x5d0374[_0x5b6c41][_0xfd29('0x38')](_0x4aeb07[_0xfd29('0x24')],{'transaction':_0x1357f8}));}}return BPromise['all'](_0x5308d5);});})[_0xfd29('0xa')](function(_0x18d945){logger[_0xfd29('0xb')](_0xfd29('0x2a'),_0x4aeb07);if(_0x18d945['length']>0x0){logger[_0xfd29('0xb')](_0xfd29('0x39'),_0x18d945[0x0]['dataValues']['id'],_0x18d945[0x0][_0xfd29('0x3a')]['ContactId'],_0x18d945[0x0][_0xfd29('0x3a')]['active']);}logger[_0xfd29('0x1e')](_0xfd29('0x2a'),_0x4aeb07,JSON[_0xfd29('0xe')](_0x18d945));_0x4b09ee(_0x18d945);})[_0xfd29('0x14')](function(_0xd4d2c2){logger[_0xfd29('0xf')](_0xfd29('0x2a'),_0xd4d2c2['message'],_0x4aeb07);_0x738cd3(_0x43682a[_0xfd29('0xf')](0x1f4,_0xd4d2c2['message']));});});});};exports['MoveContactManagedDialer']=function(_0x1589e3){var _0x3e2875=this;return new Promise(function(_0x150a78,_0x562eb8){return db[_0xfd29('0x3b')]['transaction'](function(_0x6115f3){return db['CmHopperFinal'][_0xfd29('0x23')](_0x1589e3[_0xfd29('0x24')],{'raw':_0x1589e3[_0xfd29('0x17')]?_0x1589e3[_0xfd29('0x17')][_0xfd29('0x18')]===undefined?!![]:![]:!![],'transaction':_0x6115f3})[_0xfd29('0xa')](function(){logger['info'](_0xfd29('0x3c'),JSON[_0xfd29('0xe')](_0x1589e3[_0xfd29('0x17')][_0xfd29('0x19')]),_0x1589e3[_0xfd29('0x17')][_0xfd29('0x19')]['active']);return db[_0xfd29('0x22')][_0xfd29('0x29')]({'where':_0x1589e3[_0xfd29('0x17')]?_0x1589e3['options'][_0xfd29('0x19')]||null:null,'transaction':_0x6115f3});});})[_0xfd29('0xa')](function(_0x14aef9){logger[_0xfd29('0xb')](_0xfd29('0x3d'),_0x1589e3);logger[_0xfd29('0x1e')](_0xfd29('0x3d'),_0x1589e3,JSON[_0xfd29('0xe')](_0x14aef9));_0x150a78(_0x14aef9);})[_0xfd29('0x14')](function(_0x39b2da){logger['error'](_0xfd29('0x3d'),_0x39b2da[_0xfd29('0x12')],_0x1589e3);_0x562eb8(_0x3e2875['error'](0x1f4,_0x39b2da[_0xfd29('0x12')]));});});};exports[_0xfd29('0x3e')]=function(_0xe8c17a){var _0x5335c7=this;return new Promise(function(_0x292cae,_0x249df2){return db[_0xfd29('0x22')][_0xfd29('0x16')]({'raw':_0xe8c17a[_0xfd29('0x17')]?_0xe8c17a[_0xfd29('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe8c17a[_0xfd29('0x17')]?_0xe8c17a[_0xfd29('0x17')][_0xfd29('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0xfd29('0x3f'),db[_0xfd29('0x3b')]['fn']('IF',db['sequelize'][_0xfd29('0x40')](_0xfd29('0x41')+util[_0xfd29('0x42')]('\x22%s\x22',moment()['format'](_0xfd29('0x43')))+_0xfd29('0x44')))),_0xfd29('0x45')]]})['then'](function(_0x39847b){logger[_0xfd29('0xb')](_0xfd29('0x3e'),_0xe8c17a);logger[_0xfd29('0x1e')]('CountReScheduled',_0xe8c17a,JSON[_0xfd29('0xe')](_0x39847b));_0x292cae(_0x39847b);})[_0xfd29('0x14')](function(_0x2719f1){logger[_0xfd29('0xf')](_0xfd29('0x3e'),_0x2719f1[_0xfd29('0x12')],_0xe8c17a);_0x249df2(_0x5335c7[_0xfd29('0xf')](0x1f4,_0x2719f1['message']));});});};exports[_0xfd29('0x46')]=function(_0x4f78b2){var _0x25d7f1=this;return new Promise(function(_0xe08524,_0x5dd7c2){return db['CmContact']['describe']()[_0xfd29('0xa')](function(_0x13ff48){return db[_0xfd29('0x3b')][_0xfd29('0x2c')](function(_0x2adac7){return db['CmHopper'][_0xfd29('0x16')]({'where':_0x4f78b2[_0xfd29('0x17')]?_0x4f78b2[_0xfd29('0x17')][_0xfd29('0x19')]||null:null,'attributes':_0x4f78b2['options']?_0x4f78b2[_0xfd29('0x17')][_0xfd29('0x1a')]||null:null,'limit':0x1,'order':_0x4f78b2[_0xfd29('0x17')]?_0x4f78b2[_0xfd29('0x17')][_0xfd29('0x2d')]||null:null,'group':db[_0xfd29('0x22')][_0xfd29('0x36')],'transaction':_0x2adac7,'lock':_0x2adac7[_0xfd29('0x2e')][_0xfd29('0x47')],'include':_0x4f78b2['options']?_0x4f78b2[_0xfd29('0x17')]['include']?_[_0xfd29('0x1c')](_0x4f78b2[_0xfd29('0x17')][_0xfd29('0x1b')],function(_0x1720c7){return{'model':db[_0x1720c7[_0xfd29('0x1d')]],'as':_0x1720c7['as'],'attributes':_0x1720c7[_0xfd29('0x1a')],'include':_0x1720c7[_0xfd29('0x1b')]?_[_0xfd29('0x1c')](_0x1720c7[_0xfd29('0x1b')],function(_0x466da0){return{'model':db[_0x466da0[_0xfd29('0x1d')]],'as':_0x466da0['as'],'attributes':_0x466da0['attributes'],'include':_0x466da0[_0xfd29('0x1b')]?_['map'](_0x466da0[_0xfd29('0x1b')],function(_0x30eabe){return{'model':db[_0x30eabe['model']],'as':_0x30eabe['as'],'attributes':_0x30eabe[_0xfd29('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c728f){var _0x30045a=[];for(var _0x4e378f=0x0;_0x4e378f<_0x5c728f['length'];_0x4e378f+=0x1){_0x30045a['push'](_0x5c728f[_0x4e378f]['update'](_0x4f78b2['body'],{'transaction':_0x2adac7}));}return BPromise[_0xfd29('0x48')](_0x30045a);});})[_0xfd29('0xa')](function(_0x3ac54b){logger[_0xfd29('0xb')](_0xfd29('0x46'),_0x4f78b2);logger['debug'](_0xfd29('0x46'),_0x4f78b2,JSON['stringify'](_0x3ac54b));_0xe08524(_0x3ac54b);})['catch'](function(_0xdacfad){logger[_0xfd29('0xf')](_0xfd29('0x46'),_0xdacfad['message'],_0x4f78b2);_0x5dd7c2(_0x25d7f1[_0xfd29('0xf')](0x1f4,_0xdacfad[_0xfd29('0x12')]));});});});};exports[_0xfd29('0x49')]=function(_0x12be1c){var _0x5648d7=this;return new Promise(function(_0x155d3c,_0x4c26fd){db[_0xfd29('0x2f')]['describe']()[_0xfd29('0xa')](function(_0x58e9d7){return db[_0xfd29('0x22')]['findAll']({'raw':_0x12be1c[_0xfd29('0x17')]?_0x12be1c[_0xfd29('0x17')][_0xfd29('0x18')]===undefined?!![]:![]:!![],'where':_0x12be1c[_0xfd29('0x17')]?_0x12be1c['options'][_0xfd29('0x19')]||null:null,'attributes':_0x12be1c[_0xfd29('0x17')]?_0x12be1c['options'][_0xfd29('0x1a')]||null:null,'limit':_0x12be1c[_0xfd29('0x17')]?_0x12be1c['options'][_0xfd29('0x26')]||null:null,'include':_0x12be1c[_0xfd29('0x17')]?_0x12be1c[_0xfd29('0x17')][_0xfd29('0x1b')]?_['map'](_0x12be1c['options'][_0xfd29('0x1b')],function(_0x132954){return{'model':db[_0x132954[_0xfd29('0x1d')]],'as':_0x132954['as'],'attributes':_0x132954['as']===_0xfd29('0x30')?_[_0xfd29('0x31')](_0x58e9d7):_0x132954['attributes'],'include':_0x132954[_0xfd29('0x1b')]?_[_0xfd29('0x1c')](_0x132954['include'],function(_0x4d97f0){return{'model':db[_0x4d97f0['model']],'as':_0x4d97f0['as'],'attributes':_0x4d97f0[_0xfd29('0x1a')],'include':_0x4d97f0['include']?_['map'](_0x4d97f0['include'],function(_0x3edaae){return{'model':db[_0x3edaae[_0xfd29('0x1d')]],'as':_0x3edaae['as'],'attributes':_0x3edaae['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd29('0xa')](function(_0x447d52){logger['info'](_0xfd29('0x15'),_0x12be1c);logger[_0xfd29('0x1e')]('GetCmHopper',_0x12be1c,JSON[_0xfd29('0xe')](_0x447d52));_0x155d3c(_0x447d52);})[_0xfd29('0x14')](function(_0x4d246b){logger[_0xfd29('0xf')]('GetCmHopper',_0x4d246b[_0xfd29('0x12')],_0x12be1c);_0x4c26fd(_0x5648d7[_0xfd29('0xf')](0x1f4,_0x4d246b[_0xfd29('0x12')]));});});});};exports[_0xfd29('0x4a')]=function(_0x3ca356){var _0x15b816=this;return new Promise(function(_0x99f0e3,_0x3279b2){return db['sequelize'][_0xfd29('0x2c')](function(_0x19915c){return db[_0xfd29('0x22')][_0xfd29('0x38')]({'active':![]},{'where':{},'transaction':_0x19915c})[_0xfd29('0xa')](function(_0x24b84f){logger[_0xfd29('0xb')](_0xfd29('0x4a'),_0x3ca356);logger['debug'](_0xfd29('0x4a'),_0x3ca356,JSON[_0xfd29('0xe')](_0x24b84f));_0x99f0e3(_0x24b84f);})['catch'](function(_0x52bd4e){logger[_0xfd29('0xf')]('ResetActiveCalls',_0x52bd4e[_0xfd29('0x12')],_0x3ca356);_0x3279b2(_0x15b816[_0xfd29('0xf')](0x1f4,_0x52bd4e[_0xfd29('0x12')]));});});});};exports[_0xfd29('0x4b')]=function(_0x1d4ad5){var _0x985dd5=this;var _0x5142b0=_0x1d4ad5['body']['where'][_0xfd29('0x4c')];var _0x3721dd=_0x1d4ad5['body'][_0xfd29('0x19')][_0xfd29('0x4d')];return new Promise(function(_0x22acc6,_0x40015e){return db[_0xfd29('0x22')]['findAll']({'where':{'voiceQueueId':_0x5142b0,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xfd29('0x3b')][_0xfd29('0x40')](_0xfd29('0x4e')+_0x3721dd+_0xfd29('0x4f'))}},'include':[{'model':db['CmContact'],'as':_0xfd29('0x30')},{'model':db[_0xfd29('0x32')],'as':'Agent','attributes':['id',_0xfd29('0x50'),_0xfd29('0x34')]},{'model':db[_0xfd29('0x51')],'as':_0xfd29('0x52')}]})[_0xfd29('0xa')](function(_0xa112ae){return db[_0xfd29('0x3b')]['transaction'](function(_0x4ee7b9){return db[_0xfd29('0x22')][_0xfd29('0x38')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x5142b0,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xfd29('0x3b')][_0xfd29('0x40')](_0xfd29('0x4e')+_0x3721dd+'\x20MINUTE')}},'transaction':_0x4ee7b9})[_0xfd29('0xa')](function(_0xd38e97){_0x22acc6(_0xa112ae);})[_0xfd29('0x14')](function(_0x4ca62c){logger['error'](_0xfd29('0x4b'),_0x4ca62c[_0xfd29('0x12')],_0x1d4ad5);_0x40015e(validateExpressRequest);});});})[_0xfd29('0x14')](function(_0x4652cb){logger[_0xfd29('0xf')]('CmHopperHandlePreviewRecallNotifications',_0x4652cb[_0xfd29('0x12')],_0x1d4ad5);_0x40015e(_0x985dd5[_0xfd29('0xf')](0x1f4,_0x4652cb[_0xfd29('0x12')]));});});}; \ No newline at end of file +var _0x6f18=['jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCmHopper','findAll','options','raw','where','include','model','attributes','map','debug','ShowCmHopper','CmHopper','find','CreateCmHopper','UpdateCmHopper','update','body','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','describe','transaction','order','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','UserId','push','includes','all','GetContactDialer','dataValues','MoveContactManagedDialer','sequelize','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','length','GetContactRecallMe','GetCmHopperPreview','CmContact','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','\x20MINUTE','User','CmList','List','NOW()\x20+\x20INTERVAL\x20','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x25a3c3,_0x5ee510){var _0x565067=function(_0x2b26de){while(--_0x2b26de){_0x25a3c3['push'](_0x25a3c3['shift']());}};_0x565067(++_0x5ee510);}(_0x6f18,0x14b));var _0x86f1=function(_0x58daab,_0x2da6e0){_0x58daab=_0x58daab-0x0;var _0x5e564f=_0x6f18[_0x58daab];return _0x5e564f;};'use strict';var _=require(_0x86f1('0x0'));var util=require(_0x86f1('0x1'));var moment=require(_0x86f1('0x2'));var BPromise=require(_0x86f1('0x3'));var rs=require(_0x86f1('0x4'));var fs=require('fs');var Redis=require(_0x86f1('0x5'));var db=require(_0x86f1('0x6'))['db'];var utils=require(_0x86f1('0x7'));var logger=require(_0x86f1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x86f1('0x9'));const {validateExpressRequest}=require(_0x86f1('0xa'));var client=jayson[_0x86f1('0xb')][_0x86f1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d4f11,_0x1846c9,_0x3ff2d9){return new BPromise(function(_0x385f1d,_0x2e4fe0){return client[_0x86f1('0xd')](_0x2d4f11,_0x3ff2d9)[_0x86f1('0xe')](function(_0x5a6515){logger[_0x86f1('0xf')](_0x86f1('0x10'),_0x1846c9,_0x86f1('0x11'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x1846c9,_0x86f1('0x11'),JSON[_0x86f1('0x12')](_0x5a6515));if(_0x5a6515['error']){if(_0x5a6515[_0x86f1('0x13')]['code']===0x1f4){logger[_0x86f1('0x13')](_0x86f1('0x10'),_0x1846c9,_0x5a6515[_0x86f1('0x13')][_0x86f1('0x14')]);return _0x2e4fe0(_0x5a6515[_0x86f1('0x13')][_0x86f1('0x14')]);}logger['error'](_0x86f1('0x10'),_0x1846c9,_0x5a6515['error'][_0x86f1('0x14')]);return _0x385f1d(_0x5a6515[_0x86f1('0x13')]['message']);}else{logger[_0x86f1('0xf')](_0x86f1('0x10'),_0x1846c9,_0x86f1('0x11'));_0x385f1d(_0x5a6515[_0x86f1('0x15')][_0x86f1('0x14')]);}})[_0x86f1('0x16')](function(_0xa4f628){logger[_0x86f1('0x13')](_0x86f1('0x10'),_0x1846c9,_0xa4f628);_0x2e4fe0(_0xa4f628);});});}exports[_0x86f1('0x17')]=function(_0x5ce4bd){var _0x104bc7=this;return new Promise(function(_0x3a456b,_0x4b088d){return db['CmHopper'][_0x86f1('0x18')]({'raw':_0x5ce4bd[_0x86f1('0x19')]?_0x5ce4bd[_0x86f1('0x19')][_0x86f1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ce4bd[_0x86f1('0x19')]?_0x5ce4bd[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'attributes':_0x5ce4bd[_0x86f1('0x19')]?_0x5ce4bd[_0x86f1('0x19')]['attributes']||null:null,'limit':_0x5ce4bd[_0x86f1('0x19')]?_0x5ce4bd[_0x86f1('0x19')]['limit']||null:null,'include':_0x5ce4bd[_0x86f1('0x19')]?_0x5ce4bd[_0x86f1('0x19')][_0x86f1('0x1c')]?_['map'](_0x5ce4bd[_0x86f1('0x19')][_0x86f1('0x1c')],function(_0x3d2a15){return{'model':db[_0x3d2a15[_0x86f1('0x1d')]],'as':_0x3d2a15['as'],'attributes':_0x3d2a15[_0x86f1('0x1e')],'include':_0x3d2a15[_0x86f1('0x1c')]?_['map'](_0x3d2a15['include'],function(_0x57e456){return{'model':db[_0x57e456[_0x86f1('0x1d')]],'as':_0x57e456['as'],'attributes':_0x57e456[_0x86f1('0x1e')],'include':_0x57e456[_0x86f1('0x1c')]?_[_0x86f1('0x1f')](_0x57e456['include'],function(_0x396492){return{'model':db[_0x396492['model']],'as':_0x396492['as'],'attributes':_0x396492['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47c3eb){logger[_0x86f1('0xf')]('GetCmHopper',_0x5ce4bd);logger[_0x86f1('0x20')]('GetCmHopper',_0x5ce4bd,JSON[_0x86f1('0x12')](_0x47c3eb));_0x3a456b(_0x47c3eb);})[_0x86f1('0x16')](function(_0x3a000a){logger[_0x86f1('0x13')](_0x86f1('0x17'),_0x3a000a[_0x86f1('0x14')],_0x5ce4bd);_0x4b088d(_0x104bc7['error'](0x1f4,_0x3a000a[_0x86f1('0x14')]));});});};exports[_0x86f1('0x21')]=function(_0x20c02d){var _0x3c719c=this;return new Promise(function(_0x2ff69f,_0x26daaf){return db[_0x86f1('0x22')][_0x86f1('0x23')]({'raw':_0x20c02d['options']?_0x20c02d[_0x86f1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x20c02d[_0x86f1('0x19')]?_0x20c02d[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'attributes':_0x20c02d['options']?_0x20c02d[_0x86f1('0x19')][_0x86f1('0x1e')]||null:null,'include':_0x20c02d[_0x86f1('0x19')]?_0x20c02d[_0x86f1('0x19')]['include']?_['map'](_0x20c02d[_0x86f1('0x19')][_0x86f1('0x1c')],function(_0xa36a3a){return{'model':db[_0xa36a3a[_0x86f1('0x1d')]],'as':_0xa36a3a['as'],'attributes':_0xa36a3a[_0x86f1('0x1e')],'include':_0xa36a3a['include']?_[_0x86f1('0x1f')](_0xa36a3a[_0x86f1('0x1c')],function(_0x3d4347){return{'model':db[_0x3d4347[_0x86f1('0x1d')]],'as':_0x3d4347['as'],'attributes':_0x3d4347[_0x86f1('0x1e')],'include':_0x3d4347[_0x86f1('0x1c')]?_[_0x86f1('0x1f')](_0x3d4347[_0x86f1('0x1c')],function(_0x483476){return{'model':db[_0x483476[_0x86f1('0x1d')]],'as':_0x483476['as'],'attributes':_0x483476[_0x86f1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x86f1('0xe')](function(_0x46610f){logger[_0x86f1('0xf')](_0x86f1('0x21'),_0x20c02d);logger[_0x86f1('0x20')](_0x86f1('0x21'),_0x20c02d,JSON[_0x86f1('0x12')](_0x46610f));_0x2ff69f(_0x46610f);})[_0x86f1('0x16')](function(_0x214aa6){logger[_0x86f1('0x13')]('ShowCmHopper',_0x214aa6[_0x86f1('0x14')],_0x20c02d);_0x26daaf(_0x3c719c['error'](0x1f4,_0x214aa6[_0x86f1('0x14')]));});});};exports[_0x86f1('0x24')]=function(_0x35b342){var _0x5a4403=this;return new Promise(function(_0x3bdac7,_0x4626bd){return db[_0x86f1('0x22')]['create'](_0x35b342['body'],{'raw':_0x35b342[_0x86f1('0x19')]?_0x35b342[_0x86f1('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x57b94b){logger['info'](_0x86f1('0x24'),_0x35b342);logger[_0x86f1('0x20')](_0x86f1('0x24'),_0x35b342,JSON[_0x86f1('0x12')](_0x57b94b));_0x3bdac7(_0x57b94b);})[_0x86f1('0x16')](function(_0x59b703){logger[_0x86f1('0x13')](_0x86f1('0x24'),_0x59b703[_0x86f1('0x14')],_0x35b342);_0x4626bd(_0x5a4403['error'](0x1f4,_0x59b703[_0x86f1('0x14')]));});});};exports[_0x86f1('0x25')]=function(_0x55bf3c){var _0x4d0ef5=this;return new Promise(function(_0x19e4e2,_0x2d6704){return db['CmHopper'][_0x86f1('0x26')](_0x55bf3c[_0x86f1('0x27')],{'raw':_0x55bf3c['options']?_0x55bf3c[_0x86f1('0x19')][_0x86f1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55bf3c[_0x86f1('0x19')]?_0x55bf3c[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'attributes':_0x55bf3c['options']?_0x55bf3c[_0x86f1('0x19')]['attributes']||null:null,'limit':_0x55bf3c['options']?_0x55bf3c['options'][_0x86f1('0x28')]||null:null})[_0x86f1('0xe')](function(_0x5e9ba3){logger['info'](_0x86f1('0x25'),_0x55bf3c);logger[_0x86f1('0xf')](_0x86f1('0x29'),JSON[_0x86f1('0x12')](_0x55bf3c[_0x86f1('0x19')][_0x86f1('0x1b')]),_0x55bf3c[_0x86f1('0x27')][_0x86f1('0x2a')]);logger['debug'](_0x86f1('0x25'),_0x55bf3c,JSON[_0x86f1('0x12')](_0x5e9ba3));_0x19e4e2(_0x5e9ba3);})[_0x86f1('0x16')](function(_0x48100c){logger['error'](_0x86f1('0x25'),_0x48100c['message'],_0x55bf3c);_0x2d6704(_0x4d0ef5[_0x86f1('0x13')](0x1f4,_0x48100c[_0x86f1('0x14')]));});});};exports['DestroyCmHopper']=function(_0x561f65){var _0x449036=this;return new Promise(function(_0x2291f8,_0x1864e2){return db['CmHopper'][_0x86f1('0x2b')]({'where':_0x561f65[_0x86f1('0x19')]?_0x561f65[_0x86f1('0x19')]['where']||null:null})[_0x86f1('0xe')](function(_0x5dfe0d){logger[_0x86f1('0xf')](_0x86f1('0x2c'),_0x561f65);logger[_0x86f1('0x20')]('DestroyCmHopper',_0x561f65,JSON[_0x86f1('0x12')](_0x5dfe0d));_0x2291f8(_0x5dfe0d);})[_0x86f1('0x16')](function(_0x503ce7){logger[_0x86f1('0x13')](_0x86f1('0x2c'),_0x503ce7[_0x86f1('0x14')],_0x561f65);_0x1864e2(_0x449036['error'](0x1f4,_0x503ce7[_0x86f1('0x14')]));});});};exports['GetContactDialer']=function(_0x4779a6){var _0x12dbca=this;return new Promise(function(_0x50ae29,_0x420667){return db['CmContact'][_0x86f1('0x2d')]()['then'](function(_0x3c98d2){return db['sequelize'][_0x86f1('0x2e')](function(_0x6772b5){return db[_0x86f1('0x22')][_0x86f1('0x18')]({'where':_0x4779a6['options']?_0x4779a6[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'attributes':_0x4779a6[_0x86f1('0x19')]?_0x4779a6[_0x86f1('0x19')][_0x86f1('0x1e')]||null:null,'limit':_0x4779a6['options']?_0x4779a6[_0x86f1('0x19')]['limit']||null:null,'order':_0x4779a6[_0x86f1('0x19')]?_0x4779a6[_0x86f1('0x19')][_0x86f1('0x2f')]||null:null,'transaction':_0x6772b5,'lock':_0x6772b5[_0x86f1('0x30')][_0x86f1('0x31')],'include':[{'model':db['CmContact'],'as':_0x86f1('0x32'),'attributes':_[_0x86f1('0x33')](_0x3c98d2)},{'model':db['User'],'as':_0x86f1('0x34'),'attributes':['id',_0x86f1('0x35'),_0x86f1('0x36')]}]})[_0x86f1('0xe')](function(_0x146ec8){var _0x54ce67=[];var _0x2d3273=[];for(var _0x217aef=0x0;_0x217aef<_0x146ec8['length'];_0x217aef+=0x1){var _0x302f31=_0x146ec8[_0x217aef][_0x86f1('0x37')];if(_0x302f31===null){_0x54ce67[_0x86f1('0x38')](_0x146ec8[_0x217aef]['update'](_0x4779a6[_0x86f1('0x27')],{'transaction':_0x6772b5}));}else if(!_0x2d3273[_0x86f1('0x39')](_0x302f31)){_0x2d3273[_0x86f1('0x38')](_0x302f31);_0x54ce67[_0x86f1('0x38')](_0x146ec8[_0x217aef][_0x86f1('0x26')](_0x4779a6['body'],{'transaction':_0x6772b5}));}}return BPromise[_0x86f1('0x3a')](_0x54ce67);});})['then'](function(_0x312c1f){logger[_0x86f1('0xf')](_0x86f1('0x3b'),_0x4779a6);if(_0x312c1f['length']>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x312c1f[0x0][_0x86f1('0x3c')]['id'],_0x312c1f[0x0][_0x86f1('0x3c')]['ContactId'],_0x312c1f[0x0][_0x86f1('0x3c')][_0x86f1('0x2a')]);}logger[_0x86f1('0x20')](_0x86f1('0x3b'),_0x4779a6,JSON[_0x86f1('0x12')](_0x312c1f));_0x50ae29(_0x312c1f);})['catch'](function(_0x2937b2){logger[_0x86f1('0x13')](_0x86f1('0x3b'),_0x2937b2[_0x86f1('0x14')],_0x4779a6);_0x420667(_0x12dbca[_0x86f1('0x13')](0x1f4,_0x2937b2[_0x86f1('0x14')]));});});});};exports[_0x86f1('0x3d')]=function(_0x35eb9d){var _0x1853f5=this;return new Promise(function(_0x35a0a4,_0x3b7c25){return db[_0x86f1('0x3e')]['transaction'](function(_0x5c1573){return db[_0x86f1('0x3f')][_0x86f1('0x40')](_0x35eb9d[_0x86f1('0x27')],{'raw':_0x35eb9d['options']?_0x35eb9d['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x5c1573})[_0x86f1('0xe')](function(){logger['info'](_0x86f1('0x41'),JSON[_0x86f1('0x12')](_0x35eb9d['options'][_0x86f1('0x1b')]),_0x35eb9d[_0x86f1('0x19')][_0x86f1('0x1b')]['active']);return db[_0x86f1('0x22')]['destroy']({'where':_0x35eb9d['options']?_0x35eb9d[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'transaction':_0x5c1573});});})[_0x86f1('0xe')](function(_0x509468){logger[_0x86f1('0xf')]('MoveContactManagedDialer',_0x35eb9d);logger[_0x86f1('0x20')](_0x86f1('0x3d'),_0x35eb9d,JSON[_0x86f1('0x12')](_0x509468));_0x35a0a4(_0x509468);})[_0x86f1('0x16')](function(_0x52684f){logger[_0x86f1('0x13')](_0x86f1('0x3d'),_0x52684f['message'],_0x35eb9d);_0x3b7c25(_0x1853f5[_0x86f1('0x13')](0x1f4,_0x52684f[_0x86f1('0x14')]));});});};exports[_0x86f1('0x42')]=function(_0x116b78){var _0x5f1d22=this;return new Promise(function(_0x484b22,_0x53d900){return db['CmHopper'][_0x86f1('0x18')]({'raw':_0x116b78[_0x86f1('0x19')]?_0x116b78[_0x86f1('0x19')][_0x86f1('0x1a')]===undefined?!![]:![]:!![],'where':_0x116b78[_0x86f1('0x19')]?_0x116b78['options'][_0x86f1('0x1b')]||null:null,'attributes':[[db[_0x86f1('0x3e')]['fn'](_0x86f1('0x43'),db[_0x86f1('0x3e')]['fn']('IF',db[_0x86f1('0x3e')][_0x86f1('0x44')](_0x86f1('0x45')+util['format'](_0x86f1('0x46'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x86f1('0x47')))),_0x86f1('0x48')]]})[_0x86f1('0xe')](function(_0x290f54){logger['info']('CountReScheduled',_0x116b78);logger[_0x86f1('0x20')](_0x86f1('0x42'),_0x116b78,JSON[_0x86f1('0x12')](_0x290f54));_0x484b22(_0x290f54);})[_0x86f1('0x16')](function(_0x251e9d){logger['error'](_0x86f1('0x42'),_0x251e9d[_0x86f1('0x14')],_0x116b78);_0x53d900(_0x5f1d22[_0x86f1('0x13')](0x1f4,_0x251e9d[_0x86f1('0x14')]));});});};exports['GetContactRecallMe']=function(_0x30be15){var _0x4599ac=this;return new Promise(function(_0x558482,_0xb05013){return db['CmContact'][_0x86f1('0x2d')]()[_0x86f1('0xe')](function(_0x5558de){return db[_0x86f1('0x3e')][_0x86f1('0x2e')](function(_0x114ffe){return db['CmHopper'][_0x86f1('0x18')]({'where':_0x30be15[_0x86f1('0x19')]?_0x30be15[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'attributes':_0x30be15[_0x86f1('0x19')]?_0x30be15[_0x86f1('0x19')][_0x86f1('0x1e')]||null:null,'limit':0x1,'order':_0x30be15[_0x86f1('0x19')]?_0x30be15[_0x86f1('0x19')][_0x86f1('0x2f')]||null:null,'group':db[_0x86f1('0x22')]['UserId'],'transaction':_0x114ffe,'lock':_0x114ffe[_0x86f1('0x30')][_0x86f1('0x31')],'include':_0x30be15[_0x86f1('0x19')]?_0x30be15[_0x86f1('0x19')][_0x86f1('0x1c')]?_[_0x86f1('0x1f')](_0x30be15['options'][_0x86f1('0x1c')],function(_0x410cf6){return{'model':db[_0x410cf6[_0x86f1('0x1d')]],'as':_0x410cf6['as'],'attributes':_0x410cf6[_0x86f1('0x1e')],'include':_0x410cf6[_0x86f1('0x1c')]?_['map'](_0x410cf6[_0x86f1('0x1c')],function(_0x12e72f){return{'model':db[_0x12e72f['model']],'as':_0x12e72f['as'],'attributes':_0x12e72f['attributes'],'include':_0x12e72f[_0x86f1('0x1c')]?_['map'](_0x12e72f[_0x86f1('0x1c')],function(_0x401655){return{'model':db[_0x401655[_0x86f1('0x1d')]],'as':_0x401655['as'],'attributes':_0x401655[_0x86f1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x86f1('0xe')](function(_0x1b67bd){var _0x2952df=[];for(var _0x56640a=0x0;_0x56640a<_0x1b67bd[_0x86f1('0x49')];_0x56640a+=0x1){_0x2952df[_0x86f1('0x38')](_0x1b67bd[_0x56640a]['update'](_0x30be15[_0x86f1('0x27')],{'transaction':_0x114ffe}));}return BPromise[_0x86f1('0x3a')](_0x2952df);});})[_0x86f1('0xe')](function(_0x572a44){logger[_0x86f1('0xf')](_0x86f1('0x4a'),_0x30be15);logger[_0x86f1('0x20')](_0x86f1('0x4a'),_0x30be15,JSON['stringify'](_0x572a44));_0x558482(_0x572a44);})[_0x86f1('0x16')](function(_0x3e6f99){logger[_0x86f1('0x13')](_0x86f1('0x4a'),_0x3e6f99[_0x86f1('0x14')],_0x30be15);_0xb05013(_0x4599ac[_0x86f1('0x13')](0x1f4,_0x3e6f99[_0x86f1('0x14')]));});});});};exports[_0x86f1('0x4b')]=function(_0x250cd2){var _0x3fb827=this;return new Promise(function(_0x288582,_0xd5a790){db[_0x86f1('0x4c')][_0x86f1('0x2d')]()[_0x86f1('0xe')](function(_0x1591d8){return db['CmHopper']['findAll']({'raw':_0x250cd2[_0x86f1('0x19')]?_0x250cd2[_0x86f1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x250cd2[_0x86f1('0x19')]?_0x250cd2[_0x86f1('0x19')][_0x86f1('0x1b')]||null:null,'attributes':_0x250cd2[_0x86f1('0x19')]?_0x250cd2[_0x86f1('0x19')][_0x86f1('0x1e')]||null:null,'limit':_0x250cd2[_0x86f1('0x19')]?_0x250cd2[_0x86f1('0x19')][_0x86f1('0x28')]||null:null,'include':_0x250cd2[_0x86f1('0x19')]?_0x250cd2[_0x86f1('0x19')]['include']?_[_0x86f1('0x1f')](_0x250cd2[_0x86f1('0x19')][_0x86f1('0x1c')],function(_0x500732){return{'model':db[_0x500732['model']],'as':_0x500732['as'],'attributes':_0x500732['as']===_0x86f1('0x32')?_['keys'](_0x1591d8):_0x500732['attributes'],'include':_0x500732[_0x86f1('0x1c')]?_[_0x86f1('0x1f')](_0x500732['include'],function(_0xcb474d){return{'model':db[_0xcb474d[_0x86f1('0x1d')]],'as':_0xcb474d['as'],'attributes':_0xcb474d[_0x86f1('0x1e')],'include':_0xcb474d[_0x86f1('0x1c')]?_['map'](_0xcb474d[_0x86f1('0x1c')],function(_0x2ba31b){return{'model':db[_0x2ba31b[_0x86f1('0x1d')]],'as':_0x2ba31b['as'],'attributes':_0x2ba31b[_0x86f1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x86f1('0xe')](function(_0x511c70){logger[_0x86f1('0xf')](_0x86f1('0x17'),_0x250cd2);logger[_0x86f1('0x20')](_0x86f1('0x17'),_0x250cd2,JSON['stringify'](_0x511c70));_0x288582(_0x511c70);})[_0x86f1('0x16')](function(_0x556a16){logger[_0x86f1('0x13')]('GetCmHopper',_0x556a16[_0x86f1('0x14')],_0x250cd2);_0xd5a790(_0x3fb827[_0x86f1('0x13')](0x1f4,_0x556a16[_0x86f1('0x14')]));});});});};exports[_0x86f1('0x4d')]=function(_0x5aa2c6){var _0x437488=this;return new Promise(function(_0x3d0b46,_0xedd491){return db['sequelize'][_0x86f1('0x2e')](function(_0x4d52d1){return db['CmHopper'][_0x86f1('0x26')]({'active':![]},{'where':{},'transaction':_0x4d52d1})[_0x86f1('0xe')](function(_0x194403){logger['info'](_0x86f1('0x4d'),_0x5aa2c6);logger[_0x86f1('0x20')](_0x86f1('0x4d'),_0x5aa2c6,JSON['stringify'](_0x194403));_0x3d0b46(_0x194403);})[_0x86f1('0x16')](function(_0x2e50e9){logger[_0x86f1('0x13')](_0x86f1('0x4d'),_0x2e50e9[_0x86f1('0x14')],_0x5aa2c6);_0xedd491(_0x437488[_0x86f1('0x13')](0x1f4,_0x2e50e9[_0x86f1('0x14')]));});});});};exports[_0x86f1('0x4e')]=function(_0x2f6a6a){var _0x514741=this;var _0x3c9087=_0x2f6a6a[_0x86f1('0x27')]['where'][_0x86f1('0x4f')];var _0x144842=_0x2f6a6a[_0x86f1('0x27')][_0x86f1('0x1b')]['interval'];return new Promise(function(_0x4826b9,_0x3f3d5d){return db[_0x86f1('0x22')][_0x86f1('0x18')]({'where':{'voiceQueueId':_0x3c9087,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x86f1('0x3e')][_0x86f1('0x44')]('NOW()\x20+\x20INTERVAL\x20'+_0x144842+_0x86f1('0x50'))}},'include':[{'model':db[_0x86f1('0x4c')],'as':_0x86f1('0x32')},{'model':db[_0x86f1('0x51')],'as':_0x86f1('0x34'),'attributes':['id',_0x86f1('0x35'),_0x86f1('0x36')]},{'model':db[_0x86f1('0x52')],'as':_0x86f1('0x53')}]})[_0x86f1('0xe')](function(_0x3d2b7e){return db[_0x86f1('0x3e')][_0x86f1('0x2e')](function(_0x281f75){return db[_0x86f1('0x22')][_0x86f1('0x26')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x3c9087,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x86f1('0x3e')][_0x86f1('0x44')](_0x86f1('0x54')+_0x144842+_0x86f1('0x50'))}},'transaction':_0x281f75})[_0x86f1('0xe')](function(_0x13324d){_0x4826b9(_0x3d2b7e);})[_0x86f1('0x16')](function(_0x1919f0){logger[_0x86f1('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x1919f0[_0x86f1('0x14')],_0x2f6a6a);_0x3f3d5d(validateExpressRequest);});});})[_0x86f1('0x16')](function(_0x3624e9){logger['error'](_0x86f1('0x4e'),_0x3624e9[_0x86f1('0x14')],_0x2f6a6a);_0x3f3d5d(_0x514741[_0x86f1('0x13')](0x1f4,_0x3624e9[_0x86f1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index cb83dc0..431a98b 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 _0x21b9=['index','get','/describe','show','post','create','getPreview','/previewrecall','getPreviewRecall','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopper.controller','isAuthenticated'];(function(_0x28d1ea,_0x426311){var _0x1667b6=function(_0x136219){while(--_0x136219){_0x28d1ea['push'](_0x28d1ea['shift']());}};_0x1667b6(++_0x426311);}(_0x21b9,0x70));var _0x921b=function(_0x46a55e,_0xe095bf){_0x46a55e=_0x46a55e-0x0;var _0x2648a8=_0x21b9[_0x46a55e];return _0x2648a8;};'use strict';var multer=require('multer');var util=require(_0x921b('0x0'));var path=require(_0x921b('0x1'));var timeout=require(_0x921b('0x2'));var express=require(_0x921b('0x3'));var router=express[_0x921b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x921b('0x5'));var config=require('../../config/environment');var controller=require(_0x921b('0x6'));router['get']('/',auth[_0x921b('0x7')](),controller[_0x921b('0x8')]);router[_0x921b('0x9')](_0x921b('0xa'),auth[_0x921b('0x7')](),controller['describe']);router['get']('/opencontacts',auth[_0x921b('0x7')](),controller['getOpenContacts']);router[_0x921b('0x9')]('/:id',auth[_0x921b('0x7')](),controller[_0x921b('0xb')]);router[_0x921b('0xc')]('/',auth['isAuthenticated'](),controller[_0x921b('0xd')]);router[_0x921b('0xc')]('/preview',auth[_0x921b('0x7')](),controller[_0x921b('0xe')]);router[_0x921b('0xc')](_0x921b('0xf'),auth[_0x921b('0x7')](),controller[_0x921b('0x10')]);router['put']('/:id',auth[_0x921b('0x7')](),controller['update']);router['delete'](_0x921b('0x11'),auth[_0x921b('0x7')](),controller[_0x921b('0x12')]);module[_0x921b('0x13')]=router; \ No newline at end of file +var _0x3afa=['isAuthenticated','index','describe','getOpenContacts','show','post','/preview','/previewrecall','getPreviewRecall','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x3afa,0x1bd));var _0xa3af=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x3afa[_0x56ba92];return _0x8fe94d;};'use strict';var multer=require(_0xa3af('0x0'));var util=require(_0xa3af('0x1'));var path=require(_0xa3af('0x2'));var timeout=require(_0xa3af('0x3'));var express=require(_0xa3af('0x4'));var router=express['Router']();var fs_extra=require(_0xa3af('0x5'));var auth=require(_0xa3af('0x6'));var interaction=require(_0xa3af('0x7'));var config=require(_0xa3af('0x8'));var controller=require(_0xa3af('0x9'));router[_0xa3af('0xa')]('/',auth[_0xa3af('0xb')](),controller[_0xa3af('0xc')]);router[_0xa3af('0xa')]('/describe',auth[_0xa3af('0xb')](),controller[_0xa3af('0xd')]);router[_0xa3af('0xa')]('/opencontacts',auth[_0xa3af('0xb')](),controller[_0xa3af('0xe')]);router[_0xa3af('0xa')]('/:id',auth[_0xa3af('0xb')](),controller[_0xa3af('0xf')]);router[_0xa3af('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa3af('0x10')](_0xa3af('0x11'),auth[_0xa3af('0xb')](),controller['getPreview']);router[_0xa3af('0x10')](_0xa3af('0x12'),auth[_0xa3af('0xb')](),controller[_0xa3af('0x13')]);router['put']('/:id',auth[_0xa3af('0xb')](),controller['update']);router[_0xa3af('0x14')](_0xa3af('0x15'),auth[_0xa3af('0xb')](),controller[_0xa3af('0x16')]);module[_0xa3af('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 995b5f9..5f39a20 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 _0x9a5e=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9a5e,0xee));var _0xe9a5=function(_0x35d772,_0x1416a3){_0x35d772=_0x35d772-0x0;var _0x289ac7=_0x9a5e[_0x35d772];return _0x289ac7;};'use strict';var moment=require(_0xe9a5('0x0'));var Sequelize=require(_0xe9a5('0x1'));module[_0xe9a5('0x2')]={'phone':{'type':Sequelize[_0xe9a5('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe9a5('0x4')],'unique':_0xe9a5('0x5')},'ListId':{'type':Sequelize[_0xe9a5('0x4')],'unique':_0xe9a5('0x5')},'VoiceQueueId':{'type':Sequelize[_0xe9a5('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xedbf=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x1e2e9f,_0x27a946){var _0x5e1bd9=function(_0x432129){while(--_0x432129){_0x1e2e9f['push'](_0x1e2e9f['shift']());}};_0x5e1bd9(++_0x27a946);}(_0xedbf,0x103));var _0xfedb=function(_0x3ef3ca,_0x4556f3){_0x3ef3ca=_0x3ef3ca-0x0;var _0x4a9930=_0xedbf[_0x3ef3ca];return _0x4a9930;};'use strict';var moment=require(_0xfedb('0x0'));var Sequelize=require(_0xfedb('0x1'));module[_0xfedb('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfedb('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xfedb('0x3')],'unique':_0xfedb('0x4')},'VoiceQueueId':{'type':Sequelize[_0xfedb('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2bc52d1..126a5cd 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 _0x54e5=['../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','sendStatus','error','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','keys','find','catch','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x56846d,_0x33e88f){var _0x3d680e=function(_0x1f6a92){while(--_0x1f6a92){_0x56846d['push'](_0x56846d['shift']());}};_0x3d680e(++_0x33e88f);}(_0x54e5,0x7e));var _0x554e=function(_0x28a245,_0x1d817a){_0x28a245=_0x28a245-0x0;var _0x1bfce6=_0x54e5[_0x28a245];return _0x1bfce6;};'use strict';var emlformat=require(_0x554e('0x0'));var rimraf=require(_0x554e('0x1'));var zipdir=require(_0x554e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x554e('0x3'));var moment=require(_0x554e('0x4'));var BPromise=require(_0x554e('0x5'));var Mustache=require(_0x554e('0x6'));var util=require(_0x554e('0x7'));var path=require(_0x554e('0x8'));var sox=require(_0x554e('0x9'));var csv=require('to-csv');var ejs=require(_0x554e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x554e('0xb'));var crypto=require(_0x554e('0xc'));var jsforce=require(_0x554e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x554e('0xe'));var Papa=require(_0x554e('0xf'));var Redis=require(_0x554e('0x10'));var authService=require(_0x554e('0x11'));var qs=require(_0x554e('0x12'));var as=require(_0x554e('0x13'));var hardwareService=require(_0x554e('0x14'));var logger=require('../../config/logger')(_0x554e('0x15'));var utils=require('../../config/utils');var config=require(_0x554e('0x16'));var licenseUtil=require(_0x554e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200d6e,_0x5aca15){_0x5aca15=_0x5aca15||0xcc;return function(_0x1e41e5){if(_0x1e41e5){return _0x200d6e['sendStatus'](_0x5aca15);}return _0x200d6e[_0x554e('0x18')](_0x5aca15)[_0x554e('0x19')]();};}function respondWithResult(_0x60b719,_0x37f63c){_0x37f63c=_0x37f63c||0xc8;return function(_0x1186cc){if(_0x1186cc){return _0x60b719[_0x554e('0x18')](_0x37f63c)[_0x554e('0x1a')](_0x1186cc);}};}function respondWithFilteredResult(_0x7c8ecc,_0x5981ec){return function(_0x15a480){if(_0x15a480){var _0x2fb26b=typeof _0x5981ec[_0x554e('0x1b')]==='undefined'&&typeof _0x5981ec[_0x554e('0x1c')]==='undefined';var _0x5e98ca=_0x15a480[_0x554e('0x1d')];var _0x584f07=_0x2fb26b?0x0:_0x5981ec[_0x554e('0x1b')];var _0x30eef1=_0x2fb26b?_0x15a480[_0x554e('0x1d')]:_0x5981ec['offset']+_0x5981ec[_0x554e('0x1c')];var _0x58ed2b;if(_0x30eef1>=_0x5e98ca){_0x30eef1=_0x5e98ca;_0x58ed2b=0xc8;}else{_0x58ed2b=0xce;}_0x7c8ecc[_0x554e('0x18')](_0x58ed2b);return _0x7c8ecc[_0x554e('0x1e')]('Content-Range',_0x584f07+'-'+_0x30eef1+'/'+_0x5e98ca)[_0x554e('0x1a')](_0x15a480);}return null;};}function patchUpdates(_0x295925){return function(_0x5b90d8){try{jsonpatch[_0x554e('0x1f')](_0x5b90d8,_0x295925,!![]);}catch(_0x533840){return BPromise[_0x554e('0x20')](_0x533840);}return _0x5b90d8[_0x554e('0x21')]();};}function saveUpdates(_0x2fb689,_0x4a33eb){return function(_0x155b46){if(_0x155b46){return _0x155b46[_0x554e('0x22')](_0x2fb689)['then'](function(_0x4376f9){return _0x4376f9;});}return null;};}function removeEntity(_0x54c949,_0x4994ae){return function(_0xe3ae1c){if(_0xe3ae1c){return _0xe3ae1c[_0x554e('0x23')]()['then'](function(){_0x54c949[_0x554e('0x18')](0xcc)[_0x554e('0x19')]();});}};}function handleEntityNotFound(_0x59be5c,_0x5936bc){return function(_0x5ce5d3){if(!_0x5ce5d3){_0x59be5c[_0x554e('0x24')](0x194);}return _0x5ce5d3;};}function handleError(_0x505653,_0x43e966){_0x43e966=_0x43e966||0x1f4;return function(_0x48c1de){logger[_0x554e('0x25')](_0x48c1de['stack']);if(_0x48c1de[_0x554e('0x26')]){delete _0x48c1de['name'];}_0x505653[_0x554e('0x18')](_0x43e966)['send'](_0x48c1de);};}exports[_0x554e('0x27')]=function(_0x13b004,_0x4d77ef){var _0x3ff0f1={},_0x1fb7c8={},_0x393f95={'count':0x0,'rows':[]};var _0x501579=_[_0x554e('0x28')](db[_0x554e('0x29')][_0x554e('0x2a')],function(_0x28ac2e){return{'name':_0x28ac2e[_0x554e('0x2b')],'type':_0x28ac2e[_0x554e('0x2c')][_0x554e('0x2d')]};});_0x1fb7c8[_0x554e('0x2e')]=_[_0x554e('0x28')](_0x501579,_0x554e('0x26'));_0x1fb7c8[_0x554e('0x2f')]=_['keys'](_0x13b004[_0x554e('0x2f')]);_0x1fb7c8[_0x554e('0x30')]=_[_0x554e('0x31')](_0x1fb7c8[_0x554e('0x2e')],_0x1fb7c8['query']);_0x3ff0f1[_0x554e('0x32')]=_[_0x554e('0x31')](_0x1fb7c8[_0x554e('0x2e')],qs[_0x554e('0x33')](_0x13b004[_0x554e('0x2f')]['fields']));_0x3ff0f1['attributes']=_0x3ff0f1[_0x554e('0x32')][_0x554e('0x34')]?_0x3ff0f1[_0x554e('0x32')]:_0x1fb7c8[_0x554e('0x2e')];if(!_0x13b004[_0x554e('0x2f')][_0x554e('0x35')](_0x554e('0x36'))){_0x3ff0f1['limit']=qs[_0x554e('0x1c')](_0x13b004[_0x554e('0x2f')]['limit']);_0x3ff0f1[_0x554e('0x1b')]=qs[_0x554e('0x1b')](_0x13b004[_0x554e('0x2f')]['offset']);}_0x3ff0f1['order']=qs[_0x554e('0x37')](_0x13b004[_0x554e('0x2f')]['sort']);_0x3ff0f1[_0x554e('0x38')]=qs[_0x554e('0x30')](_[_0x554e('0x39')](_0x13b004[_0x554e('0x2f')],_0x1fb7c8['filters']),_0x501579);if(_0x13b004[_0x554e('0x2f')][_0x554e('0x3a')]){_0x3ff0f1[_0x554e('0x38')]=_[_0x554e('0x3b')](_0x3ff0f1['where'],{'$or':_[_0x554e('0x28')](_0x501579,function(_0x21bdea){if(_0x21bdea[_0x554e('0x2c')]!==_0x554e('0x3c')){var _0x2d01fa={};_0x2d01fa[_0x21bdea['name']]={'$like':'%'+_0x13b004[_0x554e('0x2f')][_0x554e('0x3a')]+'%'};return _0x2d01fa;}})});}_0x3ff0f1=_[_0x554e('0x3b')]({},_0x3ff0f1,_0x13b004[_0x554e('0x3d')]);var _0xe16741={'where':_0x3ff0f1[_0x554e('0x38')]};return db['CmHopperBlack'][_0x554e('0x1d')](_0xe16741)[_0x554e('0x3e')](function(_0x144bc9){_0x393f95['count']=_0x144bc9;if(_0x13b004[_0x554e('0x2f')][_0x554e('0x3f')]){_0x3ff0f1[_0x554e('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x554e('0x41')](_0x3ff0f1);})[_0x554e('0x3e')](function(_0x2eb39f){_0x393f95[_0x554e('0x42')]=_0x2eb39f;return _0x393f95;})[_0x554e('0x3e')](respondWithFilteredResult(_0x4d77ef,_0x3ff0f1))['catch'](handleError(_0x4d77ef,null));};exports[_0x554e('0x43')]=function(_0x3f6116,_0x169703){var _0x5baa30={'raw':!![],'where':{'id':_0x3f6116['params']['id']}},_0x5bd26c={};_0x5bd26c[_0x554e('0x2e')]=_['keys'](db[_0x554e('0x29')][_0x554e('0x2a')]);_0x5bd26c[_0x554e('0x2f')]=_[_0x554e('0x44')](_0x3f6116[_0x554e('0x2f')]);_0x5bd26c[_0x554e('0x30')]=_[_0x554e('0x31')](_0x5bd26c[_0x554e('0x2e')],_0x5bd26c['query']);_0x5baa30[_0x554e('0x32')]=_[_0x554e('0x31')](_0x5bd26c[_0x554e('0x2e')],qs[_0x554e('0x33')](_0x3f6116['query'][_0x554e('0x33')]));_0x5baa30[_0x554e('0x32')]=_0x5baa30[_0x554e('0x32')]['length']?_0x5baa30[_0x554e('0x32')]:_0x5bd26c[_0x554e('0x2e')];if(_0x3f6116[_0x554e('0x2f')]['includeAll']){_0x5baa30[_0x554e('0x40')]=[{'all':!![]}];}_0x5baa30=_['merge']({},_0x5baa30,_0x3f6116[_0x554e('0x3d')]);return db[_0x554e('0x29')][_0x554e('0x45')](_0x5baa30)['then'](handleEntityNotFound(_0x169703,null))[_0x554e('0x3e')](respondWithResult(_0x169703,null))[_0x554e('0x46')](handleError(_0x169703,null));};exports[_0x554e('0x22')]=function(_0x4ddbb7,_0x34c754){if(_0x4ddbb7[_0x554e('0x47')]['id']){delete _0x4ddbb7[_0x554e('0x47')]['id'];}return db[_0x554e('0x29')][_0x554e('0x45')]({'where':{'id':_0x4ddbb7[_0x554e('0x48')]['id']}})[_0x554e('0x3e')](handleEntityNotFound(_0x34c754,null))['then'](saveUpdates(_0x4ddbb7[_0x554e('0x47')],null))[_0x554e('0x3e')](respondWithResult(_0x34c754,null))[_0x554e('0x46')](handleError(_0x34c754,null));};exports['destroy']=function(_0x120c0e,_0x24f2ab){return db[_0x554e('0x29')]['find']({'where':{'id':_0x120c0e[_0x554e('0x48')]['id']}})[_0x554e('0x3e')](handleEntityNotFound(_0x24f2ab,null))[_0x554e('0x3e')](removeEntity(_0x24f2ab,null))[_0x554e('0x46')](handleError(_0x24f2ab,null));};exports[_0x554e('0x49')]=function(_0xe83ed0,_0x27766a){return db['CmHopperBlack']['describe']()[_0x554e('0x3e')](respondWithResult(_0x27766a,null))[_0x554e('0x46')](handleError(_0x27766a,null));}; \ No newline at end of file +var _0x1cbb=['undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4457dc,_0x4a80e8){var _0x58f08d=function(_0x4be52f){while(--_0x4be52f){_0x4457dc['push'](_0x4457dc['shift']());}};_0x58f08d(++_0x4a80e8);}(_0x1cbb,0x7a));var _0xb1cb=function(_0x51439d,_0x3f111d){_0x51439d=_0x51439d-0x0;var _0x526a8c=_0x1cbb[_0x51439d];return _0x526a8c;};'use strict';var emlformat=require(_0xb1cb('0x0'));var rimraf=require(_0xb1cb('0x1'));var zipdir=require(_0xb1cb('0x2'));var jsonpatch=require(_0xb1cb('0x3'));var rp=require('request-promise');var moment=require(_0xb1cb('0x4'));var BPromise=require(_0xb1cb('0x5'));var Mustache=require(_0xb1cb('0x6'));var util=require(_0xb1cb('0x7'));var path=require(_0xb1cb('0x8'));var sox=require(_0xb1cb('0x9'));var csv=require(_0xb1cb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1cb('0xb'));var _=require(_0xb1cb('0xc'));var squel=require(_0xb1cb('0xd'));var crypto=require(_0xb1cb('0xe'));var jsforce=require(_0xb1cb('0xf'));var deskjs=require(_0xb1cb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb1cb('0x11'));var Papa=require(_0xb1cb('0x12'));var Redis=require(_0xb1cb('0x13'));var authService=require(_0xb1cb('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1cb('0x15'));var logger=require(_0xb1cb('0x16'))(_0xb1cb('0x17'));var utils=require(_0xb1cb('0x18'));var config=require(_0xb1cb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1cb('0x1a'))['db'];function respondWithStatusCode(_0x188532,_0x4e7a63){_0x4e7a63=_0x4e7a63||0xcc;return function(_0x326aa2){if(_0x326aa2){return _0x188532[_0xb1cb('0x1b')](_0x4e7a63);}return _0x188532[_0xb1cb('0x1c')](_0x4e7a63)[_0xb1cb('0x1d')]();};}function respondWithResult(_0x4765ce,_0xe4b53c){_0xe4b53c=_0xe4b53c||0xc8;return function(_0x34b4a8){if(_0x34b4a8){return _0x4765ce['status'](_0xe4b53c)[_0xb1cb('0x1e')](_0x34b4a8);}};}function respondWithFilteredResult(_0x9fc636,_0x452b29){return function(_0x4c62f2){if(_0x4c62f2){var _0x3e1d5c=typeof _0x452b29[_0xb1cb('0x1f')]===_0xb1cb('0x20')&&typeof _0x452b29[_0xb1cb('0x21')]===_0xb1cb('0x20');var _0x52457c=_0x4c62f2[_0xb1cb('0x22')];var _0x347817=_0x3e1d5c?0x0:_0x452b29[_0xb1cb('0x1f')];var _0x44c7ed=_0x3e1d5c?_0x4c62f2[_0xb1cb('0x22')]:_0x452b29[_0xb1cb('0x1f')]+_0x452b29[_0xb1cb('0x21')];var _0x37370a;if(_0x44c7ed>=_0x52457c){_0x44c7ed=_0x52457c;_0x37370a=0xc8;}else{_0x37370a=0xce;}_0x9fc636[_0xb1cb('0x1c')](_0x37370a);return _0x9fc636['set'](_0xb1cb('0x23'),_0x347817+'-'+_0x44c7ed+'/'+_0x52457c)['json'](_0x4c62f2);}return null;};}function patchUpdates(_0x1e2582){return function(_0x187886){try{jsonpatch['apply'](_0x187886,_0x1e2582,!![]);}catch(_0x4bc4d6){return BPromise[_0xb1cb('0x24')](_0x4bc4d6);}return _0x187886[_0xb1cb('0x25')]();};}function saveUpdates(_0x1f16bd,_0x31803a){return function(_0x2db728){if(_0x2db728){return _0x2db728[_0xb1cb('0x26')](_0x1f16bd)['then'](function(_0x1a2012){return _0x1a2012;});}return null;};}function removeEntity(_0x328b83,_0x1c546b){return function(_0xfb31fd){if(_0xfb31fd){return _0xfb31fd['destroy']()[_0xb1cb('0x27')](function(){_0x328b83[_0xb1cb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x223655,_0x400bef){return function(_0x1a5719){if(!_0x1a5719){_0x223655[_0xb1cb('0x1b')](0x194);}return _0x1a5719;};}function handleError(_0x15d58d,_0x28dbdf){_0x28dbdf=_0x28dbdf||0x1f4;return function(_0x5d4139){logger[_0xb1cb('0x28')](_0x5d4139[_0xb1cb('0x29')]);if(_0x5d4139[_0xb1cb('0x2a')]){delete _0x5d4139['name'];}_0x15d58d[_0xb1cb('0x1c')](_0x28dbdf)[_0xb1cb('0x2b')](_0x5d4139);};}exports[_0xb1cb('0x2c')]=function(_0x579ad1,_0x14c3b){var _0x25b0cc={},_0x2af4ff={},_0x185113={'count':0x0,'rows':[]};var _0x4988ac=_[_0xb1cb('0x2d')](db[_0xb1cb('0x2e')][_0xb1cb('0x2f')],function(_0x405c0f){return{'name':_0x405c0f[_0xb1cb('0x30')],'type':_0x405c0f[_0xb1cb('0x31')]['key']};});_0x2af4ff[_0xb1cb('0x32')]=_[_0xb1cb('0x2d')](_0x4988ac,_0xb1cb('0x2a'));_0x2af4ff['query']=_[_0xb1cb('0x33')](_0x579ad1[_0xb1cb('0x34')]);_0x2af4ff['filters']=_[_0xb1cb('0x35')](_0x2af4ff[_0xb1cb('0x32')],_0x2af4ff[_0xb1cb('0x34')]);_0x25b0cc['attributes']=_[_0xb1cb('0x35')](_0x2af4ff[_0xb1cb('0x32')],qs[_0xb1cb('0x36')](_0x579ad1[_0xb1cb('0x34')][_0xb1cb('0x36')]));_0x25b0cc[_0xb1cb('0x37')]=_0x25b0cc[_0xb1cb('0x37')][_0xb1cb('0x38')]?_0x25b0cc['attributes']:_0x2af4ff[_0xb1cb('0x32')];if(!_0x579ad1['query'][_0xb1cb('0x39')](_0xb1cb('0x3a'))){_0x25b0cc['limit']=qs['limit'](_0x579ad1['query'][_0xb1cb('0x21')]);_0x25b0cc['offset']=qs[_0xb1cb('0x1f')](_0x579ad1[_0xb1cb('0x34')][_0xb1cb('0x1f')]);}_0x25b0cc[_0xb1cb('0x3b')]=qs[_0xb1cb('0x3c')](_0x579ad1[_0xb1cb('0x34')][_0xb1cb('0x3c')]);_0x25b0cc[_0xb1cb('0x3d')]=qs[_0xb1cb('0x3e')](_[_0xb1cb('0x3f')](_0x579ad1[_0xb1cb('0x34')],_0x2af4ff['filters']),_0x4988ac);if(_0x579ad1['query']['filter']){_0x25b0cc[_0xb1cb('0x3d')]=_[_0xb1cb('0x40')](_0x25b0cc['where'],{'$or':_['map'](_0x4988ac,function(_0xaef77e){if(_0xaef77e['type']!==_0xb1cb('0x41')){var _0x4f999c={};_0x4f999c[_0xaef77e[_0xb1cb('0x2a')]]={'$like':'%'+_0x579ad1['query'][_0xb1cb('0x42')]+'%'};return _0x4f999c;}})});}_0x25b0cc=_[_0xb1cb('0x40')]({},_0x25b0cc,_0x579ad1[_0xb1cb('0x43')]);var _0x314348={'where':_0x25b0cc['where']};return db[_0xb1cb('0x2e')][_0xb1cb('0x22')](_0x314348)[_0xb1cb('0x27')](function(_0x317569){_0x185113[_0xb1cb('0x22')]=_0x317569;if(_0x579ad1[_0xb1cb('0x34')][_0xb1cb('0x44')]){_0x25b0cc['include']=[{'all':!![]}];}return db[_0xb1cb('0x2e')][_0xb1cb('0x45')](_0x25b0cc);})[_0xb1cb('0x27')](function(_0x13234f){_0x185113['rows']=_0x13234f;return _0x185113;})['then'](respondWithFilteredResult(_0x14c3b,_0x25b0cc))['catch'](handleError(_0x14c3b,null));};exports[_0xb1cb('0x46')]=function(_0x43d224,_0x3d028d){var _0x51f631={'raw':!![],'where':{'id':_0x43d224[_0xb1cb('0x47')]['id']}},_0x4ecaf6={};_0x4ecaf6[_0xb1cb('0x32')]=_[_0xb1cb('0x33')](db[_0xb1cb('0x2e')][_0xb1cb('0x2f')]);_0x4ecaf6['query']=_['keys'](_0x43d224['query']);_0x4ecaf6[_0xb1cb('0x3e')]=_['intersection'](_0x4ecaf6['model'],_0x4ecaf6[_0xb1cb('0x34')]);_0x51f631[_0xb1cb('0x37')]=_[_0xb1cb('0x35')](_0x4ecaf6[_0xb1cb('0x32')],qs[_0xb1cb('0x36')](_0x43d224['query']['fields']));_0x51f631[_0xb1cb('0x37')]=_0x51f631[_0xb1cb('0x37')][_0xb1cb('0x38')]?_0x51f631['attributes']:_0x4ecaf6[_0xb1cb('0x32')];if(_0x43d224['query']['includeAll']){_0x51f631[_0xb1cb('0x48')]=[{'all':!![]}];}_0x51f631=_['merge']({},_0x51f631,_0x43d224[_0xb1cb('0x43')]);return db['CmHopperBlack']['find'](_0x51f631)[_0xb1cb('0x27')](handleEntityNotFound(_0x3d028d,null))[_0xb1cb('0x27')](respondWithResult(_0x3d028d,null))['catch'](handleError(_0x3d028d,null));};exports[_0xb1cb('0x26')]=function(_0x54dd1f,_0x20a2b3){if(_0x54dd1f[_0xb1cb('0x49')]['id']){delete _0x54dd1f['body']['id'];}return db[_0xb1cb('0x2e')]['find']({'where':{'id':_0x54dd1f[_0xb1cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x20a2b3,null))[_0xb1cb('0x27')](saveUpdates(_0x54dd1f[_0xb1cb('0x49')],null))['then'](respondWithResult(_0x20a2b3,null))[_0xb1cb('0x4a')](handleError(_0x20a2b3,null));};exports[_0xb1cb('0x4b')]=function(_0x148f7d,_0x157f64){return db[_0xb1cb('0x2e')]['find']({'where':{'id':_0x148f7d['params']['id']}})[_0xb1cb('0x27')](handleEntityNotFound(_0x157f64,null))[_0xb1cb('0x27')](removeEntity(_0x157f64,null))[_0xb1cb('0x4a')](handleError(_0x157f64,null));};exports['describe']=function(_0x3d4bf2,_0x5cc288){return db[_0xb1cb('0x2e')][_0xb1cb('0x4c')]()[_0xb1cb('0x27')](respondWithResult(_0x5cc288,null))[_0xb1cb('0x4a')](handleError(_0x5cc288,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index d9d9637..3817b5b 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 _0x9502=['lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x9502,0xc8));var _0x2950=function(_0x22656e,_0x1163dc){_0x22656e=_0x22656e-0x0;var _0x3e4255=_0x9502[_0x22656e];return _0x3e4255;};'use strict';var _=require(_0x2950('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2950('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2950('0x2'));var fs=require('fs');var path=require(_0x2950('0x3'));var rimraf=require(_0x2950('0x4'));var config=require(_0x2950('0x5'));var attributes=require(_0x2950('0x6'));module['exports']=function(_0x254a5e,_0x27995f){return _0x254a5e[_0x2950('0x7')](_0x2950('0x8'),attributes,{'tableName':_0x2950('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x533a=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black'];(function(_0x34dea4,_0x2dae41){var _0x5eed38=function(_0x162242){while(--_0x162242){_0x34dea4['push'](_0x34dea4['shift']());}};_0x5eed38(++_0x2dae41);}(_0x533a,0xea));var _0xa533=function(_0x1a4861,_0x510d80){_0x1a4861=_0x1a4861-0x0;var _0x55c004=_0x533a[_0x1a4861];return _0x55c004;};'use strict';var _=require('lodash');var util=require(_0xa533('0x0'));var logger=require(_0xa533('0x1'))('api');var moment=require(_0xa533('0x2'));var BPromise=require(_0xa533('0x3'));var rp=require(_0xa533('0x4'));var fs=require('fs');var path=require(_0xa533('0x5'));var rimraf=require(_0xa533('0x6'));var config=require(_0xa533('0x7'));var attributes=require(_0xa533('0x8'));module[_0xa533('0x9')]=function(_0x12af36,_0x8142fd){return _0x12af36[_0xa533('0xa')](_0xa533('0xb'),attributes,{'tableName':_0xa533('0xc'),'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 c5c956d..11a0d04 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 _0xc8da=['CmHopperBlack','findAll','raw','options','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','GetCmHopperBlack'];(function(_0x38565a,_0x582b2e){var _0x464712=function(_0x12d00c){while(--_0x12d00c){_0x38565a['push'](_0x38565a['shift']());}};_0x464712(++_0x582b2e);}(_0xc8da,0xcc));var _0xac8d=function(_0x446bb7,_0x25952e){_0x446bb7=_0x446bb7-0x0;var _0x35fce6=_0xc8da[_0x446bb7];return _0x35fce6;};'use strict';var _=require(_0xac8d('0x0'));var util=require(_0xac8d('0x1'));var moment=require(_0xac8d('0x2'));var BPromise=require(_0xac8d('0x3'));var rs=require(_0xac8d('0x4'));var fs=require('fs');var Redis=require(_0xac8d('0x5'));var db=require(_0xac8d('0x6'))['db'];var utils=require(_0xac8d('0x7'));var logger=require(_0xac8d('0x8'))('rpc');var config=require(_0xac8d('0x9'));var jayson=require(_0xac8d('0xa'));var client=jayson[_0xac8d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x972447,_0x480422,_0x3f52c4){return new BPromise(function(_0x3a9a71,_0x50a530){return client[_0xac8d('0xc')](_0x972447,_0x3f52c4)[_0xac8d('0xd')](function(_0x34feb0){logger[_0xac8d('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x480422,_0xac8d('0xf'));logger[_0xac8d('0x10')](_0xac8d('0x11'),_0x480422,_0xac8d('0xf'),JSON[_0xac8d('0x12')](_0x34feb0));if(_0x34feb0[_0xac8d('0x13')]){if(_0x34feb0[_0xac8d('0x13')][_0xac8d('0x14')]===0x1f4){logger[_0xac8d('0x13')](_0xac8d('0x15'),_0x480422,_0x34feb0['error'][_0xac8d('0x16')]);return _0x50a530(_0x34feb0[_0xac8d('0x13')][_0xac8d('0x16')]);}logger[_0xac8d('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x480422,_0x34feb0[_0xac8d('0x13')]['message']);return _0x3a9a71(_0x34feb0[_0xac8d('0x13')][_0xac8d('0x16')]);}else{logger['info'](_0xac8d('0x15'),_0x480422,_0xac8d('0xf'));_0x3a9a71(_0x34feb0['result'][_0xac8d('0x16')]);}})['catch'](function(_0x3d9670){logger[_0xac8d('0x13')](_0xac8d('0x15'),_0x480422,_0x3d9670);_0x50a530(_0x3d9670);});});}exports[_0xac8d('0x17')]=function(_0x2e0c6c){var _0x1f2a97=this;return new Promise(function(_0x56cedb,_0x31201f){return db[_0xac8d('0x18')][_0xac8d('0x19')]({'raw':_0x2e0c6c['options']?_0x2e0c6c['options'][_0xac8d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e0c6c[_0xac8d('0x1b')]?_0x2e0c6c['options'][_0xac8d('0x1c')]||null:null,'attributes':_0x2e0c6c[_0xac8d('0x1b')]?_0x2e0c6c[_0xac8d('0x1b')][_0xac8d('0x1d')]||null:null,'limit':_0x2e0c6c['options']?_0x2e0c6c[_0xac8d('0x1b')][_0xac8d('0x1e')]||null:null,'include':_0x2e0c6c['options']?_0x2e0c6c[_0xac8d('0x1b')][_0xac8d('0x1f')]?_[_0xac8d('0x20')](_0x2e0c6c[_0xac8d('0x1b')][_0xac8d('0x1f')],function(_0x4ad9ee){return{'model':db[_0x4ad9ee[_0xac8d('0x21')]],'as':_0x4ad9ee['as'],'attributes':_0x4ad9ee[_0xac8d('0x1d')],'include':_0x4ad9ee[_0xac8d('0x1f')]?_[_0xac8d('0x20')](_0x4ad9ee[_0xac8d('0x1f')],function(_0x4a80f4){return{'model':db[_0x4a80f4[_0xac8d('0x21')]],'as':_0x4a80f4['as'],'attributes':_0x4a80f4[_0xac8d('0x1d')],'include':_0x4a80f4[_0xac8d('0x1f')]?_[_0xac8d('0x20')](_0x4a80f4[_0xac8d('0x1f')],function(_0x4e5e96){return{'model':db[_0x4e5e96['model']],'as':_0x4e5e96['as'],'attributes':_0x4e5e96['attributes']};}):[]};}):[]};}):[]:[]})[_0xac8d('0xd')](function(_0x5d6b8a){logger[_0xac8d('0xe')](_0xac8d('0x17'),_0x2e0c6c);logger[_0xac8d('0x10')](_0xac8d('0x17'),_0x2e0c6c,JSON[_0xac8d('0x12')](_0x5d6b8a));_0x56cedb(_0x5d6b8a);})[_0xac8d('0x22')](function(_0x189291){logger[_0xac8d('0x13')](_0xac8d('0x17'),_0x189291[_0xac8d('0x16')],_0x2e0c6c);_0x31201f(_0x1f2a97['error'](0x1f4,_0x189291['message']));});});};exports[_0xac8d('0x23')]=function(_0xe34825){var _0x3482f1=this;return new Promise(function(_0x108c09,_0x1d34e4){return db[_0xac8d('0x18')]['update'](_0xe34825['body'],{'raw':_0xe34825[_0xac8d('0x1b')]?_0xe34825[_0xac8d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe34825[_0xac8d('0x1b')]?_0xe34825[_0xac8d('0x1b')][_0xac8d('0x1c')]||null:null,'attributes':_0xe34825[_0xac8d('0x1b')]?_0xe34825['options'][_0xac8d('0x1d')]||null:null,'limit':_0xe34825['options']?_0xe34825[_0xac8d('0x1b')][_0xac8d('0x1e')]||null:null})['then'](function(_0xf8aa12){logger[_0xac8d('0xe')](_0xac8d('0x23'),_0xe34825);logger['debug'](_0xac8d('0x23'),_0xe34825,JSON[_0xac8d('0x12')](_0xf8aa12));_0x108c09(_0xf8aa12);})[_0xac8d('0x22')](function(_0x101225){logger[_0xac8d('0x13')](_0xac8d('0x23'),_0x101225[_0xac8d('0x16')],_0xe34825);_0x1d34e4(_0x3482f1[_0xac8d('0x13')](0x1f4,_0x101225['message']));});});};exports['DestroyCmHopperBlack']=function(_0x1f3de9){var _0x2007b=this;return new Promise(function(_0x8653af,_0x4f6226){return db[_0xac8d('0x18')][_0xac8d('0x24')]({'where':_0x1f3de9[_0xac8d('0x1b')]?_0x1f3de9['options'][_0xac8d('0x1c')]||null:null})['then'](function(_0x512898){logger[_0xac8d('0xe')](_0xac8d('0x25'),_0x1f3de9);logger[_0xac8d('0x10')](_0xac8d('0x25'),_0x1f3de9,JSON[_0xac8d('0x12')](_0x512898));_0x8653af(_0x512898);})['catch'](function(_0x1f5dd3){logger[_0xac8d('0x13')](_0xac8d('0x25'),_0x1f5dd3[_0xac8d('0x16')],_0x1f3de9);_0x4f6226(_0x2007b[_0xac8d('0x13')](0x1f4,_0x1f5dd3[_0xac8d('0x16')]));});});}; \ No newline at end of file +var _0x5d86=['limit','map','include','model','stringify','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','attributes'];(function(_0x4dbe43,_0x4ef002){var _0x4f4622=function(_0x5e5fc1){while(--_0x5e5fc1){_0x4dbe43['push'](_0x4dbe43['shift']());}};_0x4f4622(++_0x4ef002);}(_0x5d86,0x7e));var _0x65d8=function(_0x457299,_0xfba058){_0x457299=_0x457299-0x0;var _0x445d10=_0x5d86[_0x457299];return _0x445d10;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var moment=require('moment');var BPromise=require(_0x65d8('0x2'));var rs=require(_0x65d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65d8('0x4'))['db'];var utils=require(_0x65d8('0x5'));var logger=require(_0x65d8('0x6'))(_0x65d8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x65d8('0x8')][_0x65d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8e0158,_0x6f013c,_0x4aac50){return new BPromise(function(_0x57f5be,_0x50da52){return client[_0x65d8('0xa')](_0x8e0158,_0x4aac50)[_0x65d8('0xb')](function(_0x59d538){logger[_0x65d8('0xc')](_0x65d8('0xd'),_0x6f013c,_0x65d8('0xe'));logger[_0x65d8('0xf')](_0x65d8('0x10'),_0x6f013c,_0x65d8('0xe'),JSON['stringify'](_0x59d538));if(_0x59d538['error']){if(_0x59d538[_0x65d8('0x11')][_0x65d8('0x12')]===0x1f4){logger[_0x65d8('0x11')](_0x65d8('0xd'),_0x6f013c,_0x59d538[_0x65d8('0x11')][_0x65d8('0x13')]);return _0x50da52(_0x59d538[_0x65d8('0x11')][_0x65d8('0x13')]);}logger['error'](_0x65d8('0xd'),_0x6f013c,_0x59d538[_0x65d8('0x11')][_0x65d8('0x13')]);return _0x57f5be(_0x59d538[_0x65d8('0x11')][_0x65d8('0x13')]);}else{logger['info'](_0x65d8('0xd'),_0x6f013c,_0x65d8('0xe'));_0x57f5be(_0x59d538[_0x65d8('0x14')][_0x65d8('0x13')]);}})[_0x65d8('0x15')](function(_0x24d390){logger['error'](_0x65d8('0xd'),_0x6f013c,_0x24d390);_0x50da52(_0x24d390);});});}exports[_0x65d8('0x16')]=function(_0x225a94){var _0x7f3588=this;return new Promise(function(_0x4fbfa6,_0x374b4b){return db[_0x65d8('0x17')]['findAll']({'raw':_0x225a94['options']?_0x225a94[_0x65d8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x225a94[_0x65d8('0x18')]?_0x225a94[_0x65d8('0x18')]['where']||null:null,'attributes':_0x225a94[_0x65d8('0x18')]?_0x225a94[_0x65d8('0x18')][_0x65d8('0x19')]||null:null,'limit':_0x225a94['options']?_0x225a94[_0x65d8('0x18')][_0x65d8('0x1a')]||null:null,'include':_0x225a94[_0x65d8('0x18')]?_0x225a94['options']['include']?_[_0x65d8('0x1b')](_0x225a94[_0x65d8('0x18')][_0x65d8('0x1c')],function(_0x5d36b1){return{'model':db[_0x5d36b1['model']],'as':_0x5d36b1['as'],'attributes':_0x5d36b1['attributes'],'include':_0x5d36b1[_0x65d8('0x1c')]?_[_0x65d8('0x1b')](_0x5d36b1[_0x65d8('0x1c')],function(_0x4e03a2){return{'model':db[_0x4e03a2['model']],'as':_0x4e03a2['as'],'attributes':_0x4e03a2[_0x65d8('0x19')],'include':_0x4e03a2[_0x65d8('0x1c')]?_[_0x65d8('0x1b')](_0x4e03a2['include'],function(_0xdc5216){return{'model':db[_0xdc5216[_0x65d8('0x1d')]],'as':_0xdc5216['as'],'attributes':_0xdc5216[_0x65d8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x65d8('0xb')](function(_0x26771a){logger[_0x65d8('0xc')](_0x65d8('0x16'),_0x225a94);logger[_0x65d8('0xf')](_0x65d8('0x16'),_0x225a94,JSON[_0x65d8('0x1e')](_0x26771a));_0x4fbfa6(_0x26771a);})[_0x65d8('0x15')](function(_0x470361){logger[_0x65d8('0x11')](_0x65d8('0x16'),_0x470361[_0x65d8('0x13')],_0x225a94);_0x374b4b(_0x7f3588['error'](0x1f4,_0x470361[_0x65d8('0x13')]));});});};exports[_0x65d8('0x1f')]=function(_0x35280e){var _0x2b2ee9=this;return new Promise(function(_0x2dec17,_0x3b4d4e){return db['CmHopperBlack'][_0x65d8('0x20')](_0x35280e[_0x65d8('0x21')],{'raw':_0x35280e['options']?_0x35280e[_0x65d8('0x18')][_0x65d8('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35280e[_0x65d8('0x18')]?_0x35280e['options']['where']||null:null,'attributes':_0x35280e[_0x65d8('0x18')]?_0x35280e[_0x65d8('0x18')]['attributes']||null:null,'limit':_0x35280e[_0x65d8('0x18')]?_0x35280e[_0x65d8('0x18')][_0x65d8('0x1a')]||null:null})[_0x65d8('0xb')](function(_0x4bab21){logger[_0x65d8('0xc')](_0x65d8('0x1f'),_0x35280e);logger[_0x65d8('0xf')](_0x65d8('0x1f'),_0x35280e,JSON[_0x65d8('0x1e')](_0x4bab21));_0x2dec17(_0x4bab21);})['catch'](function(_0x447ce3){logger[_0x65d8('0x11')](_0x65d8('0x1f'),_0x447ce3[_0x65d8('0x13')],_0x35280e);_0x3b4d4e(_0x2b2ee9[_0x65d8('0x11')](0x1f4,_0x447ce3[_0x65d8('0x13')]));});});};exports[_0x65d8('0x23')]=function(_0x5ac598){var _0xb5925d=this;return new Promise(function(_0x237909,_0x565ae7){return db[_0x65d8('0x17')][_0x65d8('0x24')]({'where':_0x5ac598['options']?_0x5ac598[_0x65d8('0x18')][_0x65d8('0x25')]||null:null})['then'](function(_0x5e8798){logger[_0x65d8('0xc')](_0x65d8('0x23'),_0x5ac598);logger[_0x65d8('0xf')](_0x65d8('0x23'),_0x5ac598,JSON['stringify'](_0x5e8798));_0x237909(_0x5e8798);})['catch'](function(_0x3a6856){logger[_0x65d8('0x11')](_0x65d8('0x23'),_0x3a6856[_0x65d8('0x13')],_0x5ac598);_0x565ae7(_0xb5925d[_0x65d8('0x11')](0x1f4,_0x3a6856['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ddc30d6..19b2db0 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 _0x5496=['../../config/environment','./cmHopperBlack.controller','index','get','isAuthenticated','describe','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x56557f,_0xc4df7a){var _0x28ae74=function(_0x140cca){while(--_0x140cca){_0x56557f['push'](_0x56557f['shift']());}};_0x28ae74(++_0xc4df7a);}(_0x5496,0x175));var _0x6549=function(_0x310e1f,_0x46d1e6){_0x310e1f=_0x310e1f-0x0;var _0x408761=_0x5496[_0x310e1f];return _0x408761;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var fs_extra=require(_0x6549('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var controller=require(_0x6549('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6549('0x9')]);router[_0x6549('0xa')]('/describe',auth[_0x6549('0xb')](),controller[_0x6549('0xc')]);router[_0x6549('0xa')]('/:id',auth[_0x6549('0xb')](),controller[_0x6549('0xd')]);router[_0x6549('0xe')](_0x6549('0xf'),auth[_0x6549('0xb')](),controller[_0x6549('0x10')]);router['delete']('/:id',auth[_0x6549('0xb')](),controller[_0x6549('0x11')]);module[_0x6549('0x12')]=router; \ No newline at end of file +var _0x6a55=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','multer','express','../../components/auth/service','../../config/environment','get'];(function(_0x224a72,_0x72683){var _0x51848a=function(_0x4bd7da){while(--_0x4bd7da){_0x224a72['push'](_0x224a72['shift']());}};_0x51848a(++_0x72683);}(_0x6a55,0xdb));var _0x56a5=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x6a55[_0x1b8d87];return _0x182b74;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./cmHopperBlack.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x4')]('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0x9')]);router[_0x56a5('0xa')](_0x56a5('0xb'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xc')]);router[_0x56a5('0xd')](_0x56a5('0xb'),auth[_0x56a5('0x5')](),controller['destroy']);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 99ca64b..acd2ae4 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 _0xa19a=['endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0xa19a,0x125));var _0xaa19=function(_0x1bed3d,_0xb7d3b3){_0x1bed3d=_0x1bed3d-0x0;var _0x30a48b=_0xa19a[_0x1bed3d];return _0x30a48b;};'use strict';var Sequelize=require(_0xaa19('0x0'));var moment=require(_0xaa19('0x1'));module[_0xaa19('0x2')]={'state':{'type':Sequelize[_0xaa19('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xaa19('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xaa19('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xaa19('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xaa19('0x5')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaa19('0x5')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xaa19('0x4')]},'answertime':{'type':Sequelize[_0xaa19('0x4')]},'droptime':{'type':Sequelize[_0xaa19('0x4')]},'endtime':{'type':Sequelize[_0xaa19('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xaa19('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xaa19('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xaa19('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xaa19('0x5')]},'campaign':{'type':Sequelize[_0xaa19('0x5')]},'campaigntype':{'type':Sequelize[_0xaa19('0x5')]},'membername':{'type':Sequelize[_0xaa19('0x5')]},'reason':{'type':Sequelize[_0xaa19('0x5')]},'disposition':{'type':Sequelize[_0xaa19('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaa19('0x5')]},'dispositionat':{'type':Sequelize[_0xaa19('0x4')],'set':function(_0x34befd){var _0x351604=this[_0xaa19('0x6')](_0xaa19('0x7'));if(_0x351604&&_0x34befd){this[_0xaa19('0x8')]('followuptime',moment(_0x34befd)[_0xaa19('0x9')](moment(_0x351604),_0xaa19('0xa')));}return this['setDataValue']('dispositionat',_0x34befd);}},'amd':{'type':Sequelize[_0xaa19('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xaa19('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xaa19('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xaa19('0x4')]},'callback':{'type':Sequelize[_0xaa19('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xaa19('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xaa19('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xaa19('0x4')]},'recallme':{'type':Sequelize[_0xaa19('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xaa19('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xaa19('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e42=['moment','exports','INTEGER','STRING','DATE','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x294f4d,_0x35032d){var _0x3519ce=function(_0x3b2115){while(--_0x3b2115){_0x294f4d['push'](_0x294f4d['shift']());}};_0x3519ce(++_0x35032d);}(_0x3e42,0x77));var _0x23e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e42[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x23e4('0x0'));var moment=require(_0x23e4('0x1'));module[_0x23e4('0x2')]={'state':{'type':Sequelize[_0x23e4('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x23e4('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x23e4('0x4')]},'originatecalleridname':{'type':Sequelize[_0x23e4('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x23e4('0x5')]},'answertime':{'type':Sequelize[_0x23e4('0x5')]},'droptime':{'type':Sequelize[_0x23e4('0x5')]},'endtime':{'type':Sequelize[_0x23e4('0x5')]},'ringtime':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x23e4('0x4')]},'campaign':{'type':Sequelize[_0x23e4('0x4')]},'campaigntype':{'type':Sequelize[_0x23e4('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x23e4('0x4')]},'disposition':{'type':Sequelize[_0x23e4('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x23e4('0x4')]},'dispositionat':{'type':Sequelize[_0x23e4('0x5')],'set':function(_0x3ca380){var _0xf783a4=this['getDataValue']('endtime');if(_0xf783a4&&_0x3ca380){this[_0x23e4('0x6')](_0x23e4('0x7'),moment(_0x3ca380)[_0x23e4('0x8')](moment(_0xf783a4),_0x23e4('0x9')));}return this[_0x23e4('0x6')](_0x23e4('0xa'),_0x3ca380);}},'amd':{'type':Sequelize[_0x23e4('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x23e4('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x23e4('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x23e4('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x23e4('0x5')]},'deleted':{'type':Sequelize[_0x23e4('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x23e4('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x23e4('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x23e4('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 55e861c..c0f6dc6 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 _0xc6ac=['key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','CmHopperFinal','rawAttributes','fieldName','type'];(function(_0x8c981f,_0x5986c6){var _0x23424f=function(_0x27f7d6){while(--_0x27f7d6){_0x8c981f['push'](_0x8c981f['shift']());}};_0x23424f(++_0x5986c6);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3330ec,_0x1cc42b){_0x3330ec=_0x3330ec-0x0;var _0x5d8fd2=_0xc6ac[_0x3330ec];return _0x5d8fd2;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['describe']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')]()[_0xcc6a('0x27')](respondWithResult(_0x47c999,null))[_0xcc6a('0x4b')](handleError(_0x47c999,null));};exports['update']=function(_0x1c3bb8,_0x5e7bab){if(_0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')]){delete _0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'uniqueid':_0x1c3bb8['params']['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5e7bab,null))[_0xcc6a('0x27')](saveUpdates(_0x1c3bb8[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x5e7bab,null))[_0xcc6a('0x4b')](handleError(_0x5e7bab,null));};exports[_0xcc6a('0x4f')]=function(_0x431684,_0x392805,_0x31987f){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x431684[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db['sequelize']['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal'](_0xcc6a('0x59')))),'abandonedContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x2022,\x201,\x20null'))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})[_0xcc6a('0x27')](handleEntityNotFound(_0x392805,null))[_0xcc6a('0x27')](respondWithResult(_0x392805,null))[_0xcc6a('0x4b')](handleError(_0x392805,null));};exports[_0xcc6a('0x5d')]=function(_0x3e76d7,_0x42bbc7,_0x2ad9a6){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x3e76d7[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x5e')))),_0xcc6a('0x5f')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x59')))),_0xcc6a('0x60')],[db[_0xcc6a('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x61')))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})['then'](handleEntityNotFound(_0x42bbc7,null))[_0xcc6a('0x27')](respondWithResult(_0x42bbc7,null))[_0xcc6a('0x4b')](handleError(_0x42bbc7,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x72e53a,_0x5b61df,_0x3b4ce0){return db['VoiceQueue'][_0xcc6a('0x4a')]({'where':{'id':_0x72e53a[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5b61df,null))['then'](function(_0x3ce1eb){var _0x51390a;if(_0x3ce1eb){_0x51390a=squel[_0xcc6a('0x62')]()['into'](_0xcc6a('0x63'))[_0xcc6a('0x64')]([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'VoiceQueueId',_0xcc6a('0x69'),_0xcc6a('0x6a')],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),'phone')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'scheduledAt')['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(VoiceQueueId)',_0xcc6a('0x71'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x69'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'updatedAt')['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x72e53a['body'][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x65'))[_0xcc6a('0x79')]('cm_hopper')[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())['where'](_0xcc6a('0x7b')))[_0xcc6a('0x7c')](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0x51390a);}return[];})['then'](respondWithResult(_0x5b61df,null))['catch'](handleError(_0x5b61df,null));};exports[_0xcc6a('0x7d')]=function(_0x5be65b,_0xb42e9,_0x35a798){return db[_0xcc6a('0x7e')][_0xcc6a('0x4a')]({'where':{'id':_0x5be65b[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0xb42e9,null))[_0xcc6a('0x27')](function(_0x1746d8){var _0xc0d194;if(_0x1746d8){_0xc0d194=squel[_0xcc6a('0x62')]()[_0xcc6a('0x7f')](_0xcc6a('0x63'))['fromQuery']([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'CampaignId',_0xcc6a('0x69'),'updatedAt'],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),_0xcc6a('0x65'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x66'))['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(CampaignId)',_0xcc6a('0x80'))[_0xcc6a('0x6c')]('NOW()','createdAt')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x6a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))['where'](_0xcc6a('0x81'),_0x5be65b['params']['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x5be65b[_0xcc6a('0x4d')][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))['where'](_0xcc6a('0x78'),squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')]('phone')[_0xcc6a('0x79')](_0xcc6a('0x63'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id']['toString']())['where'](_0xcc6a('0x7b')))['group'](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0xc0d194);}return[];})[_0xcc6a('0x27')](respondWithResult(_0xb42e9,null))[_0xcc6a('0x4b')](handleError(_0xb42e9,null));};exports[_0xcc6a('0x82')]=function(_0x48b6e3,_0x10d731,_0x537e2b){return db['CmHopper'][_0xcc6a('0x83')]({'where':{'VoiceQueueId':_0x48b6e3['body'][_0xcc6a('0x71')],'CampaignId':_0x48b6e3[_0xcc6a('0x4d')]['CampaignId'],'ContactId':_0x48b6e3['body'][_0xcc6a('0x67')]}})['then'](handleEntityNotFound(_0x10d731,null))[_0xcc6a('0x27')](function(_0x3df510){if(_0x3df510){return _0x3df510;}return null;})[_0xcc6a('0x27')](respondWithResult(_0x10d731,null))[_0xcc6a('0x4b')](handleError(_0x10d731,null));}; \ No newline at end of file +var _0x4137=['squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','literal','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['CmHopperFinal'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['describe']=function(_0x513657,_0x3c1f1a){return db['CmHopperFinal']['describe']()[_0x7413('0x25')](respondWithResult(_0x3c1f1a,null))[_0x7413('0x47')](handleError(_0x3c1f1a,null));};exports['update']=function(_0x2aa12c,_0x586d25){if(_0x2aa12c['body'][_0x7413('0x48')]){delete _0x2aa12c['body'][_0x7413('0x48')];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'uniqueid':_0x2aa12c[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x586d25,null))[_0x7413('0x25')](saveUpdates(_0x2aa12c[_0x7413('0x49')],null))[_0x7413('0x25')](respondWithResult(_0x586d25,null))[_0x7413('0x47')](handleError(_0x586d25,null));};exports[_0x7413('0x4a')]=function(_0x50a27d,_0x369891,_0x501407){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x50a27d[_0x7413('0x43')]['id']},'attributes':[[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x7413('0x4d')))),'noSuchContacts'],[db[_0x7413('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x7413('0x4e')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')]['literal'](_0x7413('0x4f')))),_0x7413('0x50')],[db[_0x7413('0x4b')]['fn']('COUNT',db[_0x7413('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x7413('0x51')))),_0x7413('0x52')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')]['literal'](_0x7413('0x53')))),'dropContacts'],[db[_0x7413('0x4b')]['fn']('COUNT',db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x55')))),'abandonedContacts'],[db[_0x7413('0x4b')]['fn']('COUNT',db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')]['literal'](_0x7413('0x56')))),_0x7413('0x57')],[db['sequelize']['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x58')))),_0x7413('0x59')]]})[_0x7413('0x25')](handleEntityNotFound(_0x369891,null))[_0x7413('0x25')](respondWithResult(_0x369891,null))[_0x7413('0x47')](handleError(_0x369891,null));};exports[_0x7413('0x5a')]=function(_0x28130e,_0x593571,_0x35f7e8){return db['CmHopperFinal'][_0x7413('0x41')]({'raw':![],'where':{'CampaignId':_0x28130e[_0x7413('0x43')]['id']},'attributes':[[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x5b')))),_0x7413('0x4e')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x4f')))),_0x7413('0x50')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x51')))),'congestionContacts'],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x53')))),'dropContacts'],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db['sequelize']['fn']('IF',db[_0x7413('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7413('0x5c')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x56')))),_0x7413('0x57')],[db['sequelize']['fn'](_0x7413('0x4c'),db['sequelize']['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x58')))),_0x7413('0x59')]]})[_0x7413('0x25')](handleEntityNotFound(_0x593571,null))[_0x7413('0x25')](respondWithResult(_0x593571,null))[_0x7413('0x47')](handleError(_0x593571,null));};exports[_0x7413('0x5d')]=function(_0x2c504e,_0x50910a,_0x5988bd){return db[_0x7413('0x5e')]['find']({'where':{'id':_0x2c504e[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x50910a,null))['then'](function(_0x2be9b1){var _0x4b676a;if(_0x2be9b1){_0x4b676a=squel[_0x7413('0x5f')]()[_0x7413('0x60')]('cm_hopper')['fromQuery']([_0x7413('0x61'),_0x7413('0x62'),_0x7413('0x63'),'ListId',_0x7413('0x64'),_0x7413('0x65'),_0x7413('0x66')],squel[_0x7413('0x67')]()[_0x7413('0x68')](_0x7413('0x69'),'phone')[_0x7413('0x68')](_0x7413('0x6a'),_0x7413('0x62'))['field'](_0x7413('0x6b'),_0x7413('0x63'))[_0x7413('0x68')](_0x7413('0x6c'),_0x7413('0x6d'))[_0x7413('0x68')](_0x7413('0x6e'),_0x7413('0x64'))[_0x7413('0x68')]('NOW()',_0x7413('0x65'))[_0x7413('0x68')](_0x7413('0x6a'),_0x7413('0x66'))[_0x7413('0x6f')](_0x7413('0x70'))['where'](_0x7413('0x71'),_0x2c504e['params']['id']['toString']())[_0x7413('0x3b')](_0x7413('0x72'),_0x2c504e['body'][_0x7413('0x73')][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x75'))[_0x7413('0x3b')](_0x7413('0x76'),squel[_0x7413('0x67')]()[_0x7413('0x68')]('phone')[_0x7413('0x6f')]('cm_hopper')[_0x7413('0x3b')](_0x7413('0x71'),_0x2c504e['params']['id'][_0x7413('0x74')]()))[_0x7413('0x3b')](_0x7413('0x76'),squel[_0x7413('0x67')]()[_0x7413('0x68')](_0x7413('0x77'))[_0x7413('0x6f')](_0x7413('0x70'))[_0x7413('0x3b')](_0x7413('0x71'),_0x2c504e['params']['id'][_0x7413('0x74')]())[_0x7413('0x3b')]('state\x20=\x204'))['group']('ContactId'))[_0x7413('0x74')]();return db['sequelize'][_0x7413('0x32')](_0x4b676a);}return[];})[_0x7413('0x25')](respondWithResult(_0x50910a,null))[_0x7413('0x47')](handleError(_0x50910a,null));};exports[_0x7413('0x78')]=function(_0x470c21,_0x17c115,_0xbba3c7){return db[_0x7413('0x79')][_0x7413('0x46')]({'where':{'id':_0x470c21['params']['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x17c115,null))[_0x7413('0x25')](function(_0x38bb4e){var _0x4ea60e;if(_0x38bb4e){_0x4ea60e=squel[_0x7413('0x5f')]()[_0x7413('0x60')](_0x7413('0x7a'))[_0x7413('0x7b')]([_0x7413('0x61'),_0x7413('0x62'),_0x7413('0x63'),_0x7413('0x6d'),_0x7413('0x7c'),_0x7413('0x65'),'updatedAt'],squel[_0x7413('0x67')]()[_0x7413('0x68')]('ANY_VALUE(calleridnum)',_0x7413('0x61'))[_0x7413('0x68')]('NOW()',_0x7413('0x62'))[_0x7413('0x68')](_0x7413('0x6b'),'ContactId')[_0x7413('0x68')]('ANY_VALUE(ListId)',_0x7413('0x6d'))[_0x7413('0x68')](_0x7413('0x7d'),_0x7413('0x7c'))[_0x7413('0x68')](_0x7413('0x6a'),'createdAt')[_0x7413('0x68')](_0x7413('0x6a'),_0x7413('0x66'))[_0x7413('0x6f')](_0x7413('0x70'))['where'](_0x7413('0x7e'),_0x470c21[_0x7413('0x43')]['id'][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x72'),_0x470c21['body']['state'][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x75'))[_0x7413('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x7413('0x68')](_0x7413('0x61'))[_0x7413('0x6f')]('cm_hopper')['where'](_0x7413('0x7e'),_0x470c21[_0x7413('0x43')]['id'][_0x7413('0x74')]()))[_0x7413('0x3b')](_0x7413('0x76'),squel[_0x7413('0x67')]()[_0x7413('0x68')]('calleridnum')['from'](_0x7413('0x70'))[_0x7413('0x3b')]('CampaignId\x20=\x20?',_0x470c21[_0x7413('0x43')]['id'][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x7f')))[_0x7413('0x80')](_0x7413('0x63')))[_0x7413('0x74')]();return db[_0x7413('0x4b')][_0x7413('0x32')](_0x4ea60e);}return[];})['then'](respondWithResult(_0x17c115,null))[_0x7413('0x47')](handleError(_0x17c115,null));};exports[_0x7413('0x81')]=function(_0x59d665,_0x1f3e26,_0xccd480){return db[_0x7413('0x82')]['findOne']({'where':{'VoiceQueueId':_0x59d665['body']['VoiceQueueId'],'CampaignId':_0x59d665[_0x7413('0x49')][_0x7413('0x7c')],'ContactId':_0x59d665[_0x7413('0x49')][_0x7413('0x63')]}})[_0x7413('0x25')](handleEntityNotFound(_0x1f3e26,null))[_0x7413('0x25')](function(_0x207293){if(_0x207293){return _0x207293;}return null;})[_0x7413('0x25')](respondWithResult(_0x1f3e26,null))['catch'](handleError(_0x1f3e26,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 53b594d..294b305 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 _0x7bea=['../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bea,0x14b));var _0xa7be=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x7bea[_0x4e783c];return _0x2fbd6d;};'use strict';var _=require('lodash');var util=require(_0xa7be('0x0'));var logger=require(_0xa7be('0x1'))('api');var moment=require(_0xa7be('0x2'));var BPromise=require(_0xa7be('0x3'));var rp=require(_0xa7be('0x4'));var fs=require('fs');var path=require(_0xa7be('0x5'));var rimraf=require(_0xa7be('0x6'));var config=require(_0xa7be('0x7'));var attributes=require(_0xa7be('0x8'));module[_0xa7be('0x9')]=function(_0x106ec1,_0x29d83a){return _0x106ec1[_0xa7be('0xa')](_0xa7be('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0xa7be('0xc'),'fields':[_0xa7be('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3d3=['cm_hopper_final','uniqueid','util','api','moment','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xe3d3,0xda));var _0x3e3d=function(_0x272797,_0x324389){_0x272797=_0x272797-0x0;var _0xd9281c=_0xe3d3[_0x272797];return _0xd9281c;};'use strict';var _=require('lodash');var util=require(_0x3e3d('0x0'));var logger=require('../../config/logger')(_0x3e3d('0x1'));var moment=require(_0x3e3d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e3d('0x3'));var attributes=require(_0x3e3d('0x4'));module[_0x3e3d('0x5')]=function(_0x23808b,_0x3d493d){return _0x23808b['define']('CmHopperFinal',attributes,{'tableName':_0x3e3d('0x6'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x3e3d('0x7'),'fields':[_0x3e3d('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index ec9e299..437773c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c6dc3,_0x451b82){var _0x291cb9=function(_0x230416){while(--_0x230416){_0x5c6dc3['push'](_0x5c6dc3['shift']());}};_0x291cb9(++_0x451b82);}(_0x7a54,0x106));var _0x47a5=function(_0x50d7fd,_0x2d85c5){_0x50d7fd=_0x50d7fd-0x0;var _0x1d0ee5=_0x7a54[_0x50d7fd];return _0x1d0ee5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x17eec3,_0x13a578){var _0x53df37=function(_0x505f69){while(--_0x505f69){_0x17eec3['push'](_0x17eec3['shift']());}};_0x53df37(++_0x13a578);}(_0x7a54,0x106));var _0x47a5=function(_0x5ba391,_0x3aa1a9){_0x5ba391=_0x5ba391-0x0;var _0x21d920=_0x7a54[_0x5ba391];return _0x21d920;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e92a2ea..6bc42c2 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 _0xb385=['/:id','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','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get'];(function(_0x1dd93c,_0x556a7c){var _0x42f63f=function(_0x30c495){while(--_0x30c495){_0x1dd93c['push'](_0x1dd93c['shift']());}};_0x42f63f(++_0x556a7c);}(_0xb385,0xa1));var _0x5b38=function(_0x41d56b,_0x182618){_0x41d56b=_0x41d56b-0x0;var _0x5ca01d=_0xb385[_0x41d56b];return _0x5ca01d;};'use strict';var multer=require(_0x5b38('0x0'));var util=require(_0x5b38('0x1'));var path=require(_0x5b38('0x2'));var timeout=require(_0x5b38('0x3'));var express=require('express');var router=express[_0x5b38('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5b38('0x5'));var interaction=require(_0x5b38('0x6'));var config=require(_0x5b38('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x5b38('0x8')](),controller[_0x5b38('0x9')]);router['get'](_0x5b38('0xa'),auth[_0x5b38('0x8')](),controller[_0x5b38('0xb')]);router[_0x5b38('0xc')](_0x5b38('0xd'),auth[_0x5b38('0x8')](),controller[_0x5b38('0xe')]);router[_0x5b38('0xc')](_0x5b38('0xf'),auth[_0x5b38('0x8')](),controller[_0x5b38('0x10')]);router[_0x5b38('0xc')](_0x5b38('0x11'),auth[_0x5b38('0x8')](),controller[_0x5b38('0x12')]);router[_0x5b38('0x13')](_0x5b38('0x14'),auth['isAuthenticated'](),controller[_0x5b38('0x15')]);router[_0x5b38('0x13')](_0x5b38('0x16'),auth[_0x5b38('0x8')](),controller[_0x5b38('0x17')]);router[_0x5b38('0x13')](_0x5b38('0x18'),auth[_0x5b38('0x8')](),controller[_0x5b38('0x19')]);router[_0x5b38('0x1a')](_0x5b38('0xd'),auth['isAuthenticated'](),controller[_0x5b38('0x1b')]);module[_0x5b38('0x1c')]=router; \ No newline at end of file +var _0xd366=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','multer'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd366,0x112));var _0x6d36=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0xd366[_0x3a2a3c];return _0x50ac9a;};'use strict';var multer=require(_0x6d36('0x0'));var util=require(_0x6d36('0x1'));var path=require(_0x6d36('0x2'));var timeout=require(_0x6d36('0x3'));var express=require('express');var router=express[_0x6d36('0x4')]();var fs_extra=require(_0x6d36('0x5'));var auth=require(_0x6d36('0x6'));var interaction=require(_0x6d36('0x7'));var config=require(_0x6d36('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x6d36('0x9')](),controller['index']);router[_0x6d36('0xa')](_0x6d36('0xb'),auth[_0x6d36('0x9')](),controller[_0x6d36('0xc')]);router[_0x6d36('0xa')](_0x6d36('0xd'),auth['isAuthenticated'](),controller[_0x6d36('0xe')]);router[_0x6d36('0xa')](_0x6d36('0xf'),auth['isAuthenticated'](),controller[_0x6d36('0x10')]);router['get'](_0x6d36('0x11'),auth['isAuthenticated'](),controller[_0x6d36('0x12')]);router[_0x6d36('0x13')]('/voice/queue/moveContacts/:id',auth[_0x6d36('0x9')](),controller[_0x6d36('0x14')]);router[_0x6d36('0x13')](_0x6d36('0x15'),auth[_0x6d36('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x6d36('0x13')](_0x6d36('0x16'),auth[_0x6d36('0x9')](),controller[_0x6d36('0x17')]);router[_0x6d36('0x18')](_0x6d36('0xd'),auth['isAuthenticated'](),controller['update']);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 733fed7..b117f77 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 _0x2186=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x401d96,_0x31d181){var _0xd6ec1f=function(_0x55a045){while(--_0x55a045){_0x401d96['push'](_0x401d96['shift']());}};_0xd6ec1f(++_0x31d181);}(_0x2186,0x1d4));var _0x6218=function(_0x5a7137,_0x912b51){_0x5a7137=_0x5a7137-0x0;var _0x367211=_0x2186[_0x5a7137];return _0x367211;};'use strict';var Sequelize=require(_0x6218('0x0'));module[_0x6218('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6218('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6218('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x6218('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6218('0x2')]},'calleridname':{'type':Sequelize[_0x6218('0x2')]},'starttime':{'type':Sequelize[_0x6218('0x4')]},'responsetime':{'type':Sequelize[_0x6218('0x4')]},'answertime':{'type':Sequelize[_0x6218('0x4')]},'droptime':{'type':Sequelize[_0x6218('0x4')]},'endtime':{'type':Sequelize[_0x6218('0x4')]},'ringtime':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6218('0x2')]},'campaign':{'type':Sequelize[_0x6218('0x2')]},'campaigntype':{'type':Sequelize[_0x6218('0x2')]},'membername':{'type':Sequelize[_0x6218('0x2')]},'reason':{'type':Sequelize[_0x6218('0x2')]},'amd':{'type':Sequelize[_0x6218('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6218('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6218('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6218('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6218('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6218('0x4')]},'edited':{'type':Sequelize[_0x6218('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6218('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa852=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x5c2d09,_0x4cbb23){var _0x321e59=function(_0x5ec2bf){while(--_0x5ec2bf){_0x5c2d09['push'](_0x5c2d09['shift']());}};_0x321e59(++_0x4cbb23);}(_0xa852,0x11f));var _0x2a85=function(_0x42d501,_0x2c4c1c){_0x42d501=_0x42d501-0x0;var _0x2af569=_0xa852[_0x42d501];return _0x2af569;};'use strict';var Sequelize=require(_0x2a85('0x0'));module[_0x2a85('0x1')]={'state':{'type':Sequelize[_0x2a85('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x2a85('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2a85('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2a85('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2a85('0x4')]},'responsetime':{'type':Sequelize[_0x2a85('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2a85('0x4')]},'endtime':{'type':Sequelize[_0x2a85('0x4')]},'ringtime':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x2a85('0x3')]},'campaigntype':{'type':Sequelize[_0x2a85('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x2a85('0x3')]},'amd':{'type':Sequelize[_0x2a85('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2a85('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2a85('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2a85('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2a85('0x4')]},'recallme':{'type':Sequelize[_0x2a85('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 15944da..ee78a79 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 _0x9166=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','CmHopperHistory','type','keys','query','filters','model'];(function(_0x2ce923,_0x5918ff){var _0x1cb193=function(_0x3340ae){while(--_0x3340ae){_0x2ce923['push'](_0x2ce923['shift']());}};_0x1cb193(++_0x5918ff);}(_0x9166,0x1e2));var _0x6916=function(_0x1ca4c3,_0x554126){_0x1ca4c3=_0x1ca4c3-0x0;var _0x4426a6=_0x9166[_0x1ca4c3];return _0x4426a6;};'use strict';var emlformat=require(_0x6916('0x0'));var rimraf=require(_0x6916('0x1'));var zipdir=require(_0x6916('0x2'));var jsonpatch=require(_0x6916('0x3'));var rp=require(_0x6916('0x4'));var moment=require(_0x6916('0x5'));var BPromise=require(_0x6916('0x6'));var Mustache=require(_0x6916('0x7'));var util=require(_0x6916('0x8'));var path=require(_0x6916('0x9'));var sox=require('sox');var csv=require(_0x6916('0xa'));var ejs=require(_0x6916('0xb'));var fs=require('fs');var fs_extra=require(_0x6916('0xc'));var _=require(_0x6916('0xd'));var squel=require(_0x6916('0xe'));var crypto=require(_0x6916('0xf'));var jsforce=require(_0x6916('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6916('0x11'));var Redis=require(_0x6916('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6916('0x13'));var as=require(_0x6916('0x14'));var hardwareService=require(_0x6916('0x15'));var logger=require(_0x6916('0x16'))('api');var utils=require(_0x6916('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6916('0x18'))['db'];function respondWithStatusCode(_0x55711b,_0xb6f72e){_0xb6f72e=_0xb6f72e||0xcc;return function(_0x27341a){if(_0x27341a){return _0x55711b[_0x6916('0x19')](_0xb6f72e);}return _0x55711b[_0x6916('0x1a')](_0xb6f72e)[_0x6916('0x1b')]();};}function respondWithResult(_0x134ef1,_0x41170e){_0x41170e=_0x41170e||0xc8;return function(_0x27c7dd){if(_0x27c7dd){return _0x134ef1[_0x6916('0x1a')](_0x41170e)[_0x6916('0x1c')](_0x27c7dd);}};}function respondWithFilteredResult(_0x48f64d,_0x3373c1){return function(_0x4530e8){if(_0x4530e8){var _0x3323cf=typeof _0x3373c1[_0x6916('0x1d')]==='undefined'&&typeof _0x3373c1[_0x6916('0x1e')]===_0x6916('0x1f');var _0x5bcd2a=_0x4530e8[_0x6916('0x20')];var _0x114cf7=_0x3323cf?0x0:_0x3373c1[_0x6916('0x1d')];var _0x47be90=_0x3323cf?_0x4530e8[_0x6916('0x20')]:_0x3373c1['offset']+_0x3373c1[_0x6916('0x1e')];var _0x536751;if(_0x47be90>=_0x5bcd2a){_0x47be90=_0x5bcd2a;_0x536751=0xc8;}else{_0x536751=0xce;}_0x48f64d[_0x6916('0x1a')](_0x536751);return _0x48f64d[_0x6916('0x21')](_0x6916('0x22'),_0x114cf7+'-'+_0x47be90+'/'+_0x5bcd2a)[_0x6916('0x1c')](_0x4530e8);}return null;};}function patchUpdates(_0x45a2dd){return function(_0xac87f5){try{jsonpatch[_0x6916('0x23')](_0xac87f5,_0x45a2dd,!![]);}catch(_0x12de5e){return BPromise[_0x6916('0x24')](_0x12de5e);}return _0xac87f5['save']();};}function saveUpdates(_0x456259,_0x12e5c7){return function(_0x77857){if(_0x77857){return _0x77857['update'](_0x456259)[_0x6916('0x25')](function(_0x2b6049){return _0x2b6049;});}return null;};}function removeEntity(_0x330810,_0x2d952f){return function(_0x2bd4bf){if(_0x2bd4bf){return _0x2bd4bf[_0x6916('0x26')]()[_0x6916('0x25')](function(){_0x330810[_0x6916('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2acb49,_0x3d1d09){return function(_0x27229a){if(!_0x27229a){_0x2acb49['sendStatus'](0x194);}return _0x27229a;};}function handleError(_0x229d31,_0x1343b7){_0x1343b7=_0x1343b7||0x1f4;return function(_0x420dd7){logger[_0x6916('0x27')](_0x420dd7['stack']);if(_0x420dd7[_0x6916('0x28')]){delete _0x420dd7['name'];}_0x229d31[_0x6916('0x1a')](_0x1343b7)[_0x6916('0x29')](_0x420dd7);};}exports[_0x6916('0x2a')]=function(_0x10bf38,_0x2be2c9){var _0x3b6aff={},_0x2f3be4={},_0x503ab8={'count':0x0,'rows':[]};var _0x273a8d=_[_0x6916('0x2b')](db[_0x6916('0x2c')]['rawAttributes'],function(_0x4ace19){return{'name':_0x4ace19['fieldName'],'type':_0x4ace19[_0x6916('0x2d')]['key']};});_0x2f3be4['model']=_[_0x6916('0x2b')](_0x273a8d,_0x6916('0x28'));_0x2f3be4['query']=_[_0x6916('0x2e')](_0x10bf38[_0x6916('0x2f')]);_0x2f3be4[_0x6916('0x30')]=_['intersection'](_0x2f3be4[_0x6916('0x31')],_0x2f3be4[_0x6916('0x2f')]);_0x3b6aff[_0x6916('0x32')]=_['intersection'](_0x2f3be4[_0x6916('0x31')],qs[_0x6916('0x33')](_0x10bf38[_0x6916('0x2f')][_0x6916('0x33')]));_0x3b6aff['attributes']=_0x3b6aff[_0x6916('0x32')][_0x6916('0x34')]?_0x3b6aff['attributes']:_0x2f3be4[_0x6916('0x31')];if(!_0x10bf38[_0x6916('0x2f')][_0x6916('0x35')](_0x6916('0x36'))){_0x3b6aff[_0x6916('0x1e')]=qs[_0x6916('0x1e')](_0x10bf38[_0x6916('0x2f')][_0x6916('0x1e')]);_0x3b6aff[_0x6916('0x1d')]=qs[_0x6916('0x1d')](_0x10bf38[_0x6916('0x2f')][_0x6916('0x1d')]);}_0x3b6aff['order']=qs[_0x6916('0x37')](_0x10bf38['query'][_0x6916('0x37')]);_0x3b6aff[_0x6916('0x38')]=qs[_0x6916('0x30')](_[_0x6916('0x39')](_0x10bf38[_0x6916('0x2f')],_0x2f3be4['filters']),_0x273a8d);if(_0x10bf38[_0x6916('0x2f')][_0x6916('0x3a')]){_0x3b6aff[_0x6916('0x38')]=_[_0x6916('0x3b')](_0x3b6aff[_0x6916('0x38')],{'$or':_[_0x6916('0x2b')](_0x273a8d,function(_0x4c4731){if(_0x4c4731[_0x6916('0x2d')]!==_0x6916('0x3c')){var _0xcd4bf0={};_0xcd4bf0[_0x4c4731[_0x6916('0x28')]]={'$like':'%'+_0x10bf38[_0x6916('0x2f')][_0x6916('0x3a')]+'%'};return _0xcd4bf0;}})});}_0x3b6aff=_['merge']({},_0x3b6aff,_0x10bf38['options']);var _0x4cc5e7={'where':_0x3b6aff[_0x6916('0x38')]};return db[_0x6916('0x2c')][_0x6916('0x20')](_0x4cc5e7)[_0x6916('0x25')](function(_0x50d2c1){_0x503ab8[_0x6916('0x20')]=_0x50d2c1;if(_0x10bf38[_0x6916('0x2f')][_0x6916('0x3d')]){_0x3b6aff[_0x6916('0x3e')]=[{'all':!![]}];}return db[_0x6916('0x2c')][_0x6916('0x3f')](_0x3b6aff);})['then'](function(_0x7dd4aa){_0x503ab8[_0x6916('0x40')]=_0x7dd4aa;return _0x503ab8;})['then'](respondWithFilteredResult(_0x2be2c9,_0x3b6aff))[_0x6916('0x41')](handleError(_0x2be2c9,null));};exports[_0x6916('0x42')]=function(_0x27a016,_0x5c9a3d){var _0x685407={'raw':!![],'where':{'id':_0x27a016[_0x6916('0x43')]['id']}},_0x2bd7f4={};_0x2bd7f4['model']=_[_0x6916('0x2e')](db[_0x6916('0x2c')]['rawAttributes']);_0x2bd7f4[_0x6916('0x2f')]=_[_0x6916('0x2e')](_0x27a016['query']);_0x2bd7f4[_0x6916('0x30')]=_[_0x6916('0x44')](_0x2bd7f4[_0x6916('0x31')],_0x2bd7f4['query']);_0x685407[_0x6916('0x32')]=_['intersection'](_0x2bd7f4[_0x6916('0x31')],qs['fields'](_0x27a016[_0x6916('0x2f')][_0x6916('0x33')]));_0x685407[_0x6916('0x32')]=_0x685407['attributes']['length']?_0x685407[_0x6916('0x32')]:_0x2bd7f4['model'];if(_0x27a016[_0x6916('0x2f')][_0x6916('0x3d')]){_0x685407[_0x6916('0x3e')]=[{'all':!![]}];}_0x685407=_['merge']({},_0x685407,_0x27a016[_0x6916('0x45')]);return db[_0x6916('0x2c')][_0x6916('0x46')](_0x685407)[_0x6916('0x25')](handleEntityNotFound(_0x5c9a3d,null))['then'](respondWithResult(_0x5c9a3d,null))[_0x6916('0x41')](handleError(_0x5c9a3d,null));};exports[_0x6916('0x47')]=function(_0x47ba9c,_0x5cd03e){return db[_0x6916('0x2c')]['create'](_0x47ba9c[_0x6916('0x48')],{})[_0x6916('0x25')](respondWithResult(_0x5cd03e,0xc9))[_0x6916('0x41')](handleError(_0x5cd03e,null));};exports[_0x6916('0x49')]=function(_0x1953c9,_0x195af7){return db[_0x6916('0x2c')][_0x6916('0x49')]()[_0x6916('0x25')](respondWithResult(_0x195af7,null))[_0x6916('0x41')](handleError(_0x195af7,null));};exports[_0x6916('0x4a')]=function(_0xa7f8e9,_0x30a80b){if(_0xa7f8e9[_0x6916('0x48')][_0x6916('0x4b')]){delete _0xa7f8e9[_0x6916('0x48')]['uniqueid'];}return db[_0x6916('0x2c')][_0x6916('0x46')]({'where':{'uniqueid':_0xa7f8e9[_0x6916('0x43')]['id']}})['then'](handleEntityNotFound(_0x30a80b,null))[_0x6916('0x25')](saveUpdates(_0xa7f8e9[_0x6916('0x48')],null))[_0x6916('0x25')](respondWithResult(_0x30a80b,null))[_0x6916('0x41')](handleError(_0x30a80b,null));}; \ No newline at end of file +var _0xadb9=['order','sort','pick','where','merge','type','VIRTUAL','filter','include','CmHopperHistory','findAll','catch','show','find','create','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0xadb9,0x13d));var _0x9adb=function(_0xb247e3,_0x1319d1){_0xb247e3=_0xb247e3-0x0;var _0x57fb7b=_0xadb9[_0xb247e3];return _0x57fb7b;};'use strict';var emlformat=require(_0x9adb('0x0'));var rimraf=require(_0x9adb('0x1'));var zipdir=require(_0x9adb('0x2'));var jsonpatch=require(_0x9adb('0x3'));var rp=require(_0x9adb('0x4'));var moment=require(_0x9adb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9adb('0x6'));var util=require(_0x9adb('0x7'));var path=require('path');var sox=require(_0x9adb('0x8'));var csv=require('to-csv');var ejs=require(_0x9adb('0x9'));var fs=require('fs');var fs_extra=require(_0x9adb('0xa'));var _=require('lodash');var squel=require(_0x9adb('0xb'));var crypto=require(_0x9adb('0xc'));var jsforce=require(_0x9adb('0xd'));var deskjs=require(_0x9adb('0xe'));var toCsv=require(_0x9adb('0xf'));var querystring=require(_0x9adb('0x10'));var Papa=require(_0x9adb('0x11'));var Redis=require(_0x9adb('0x12'));var authService=require(_0x9adb('0x13'));var qs=require(_0x9adb('0x14'));var as=require(_0x9adb('0x15'));var hardwareService=require(_0x9adb('0x16'));var logger=require('../../config/logger')(_0x9adb('0x17'));var utils=require(_0x9adb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9adb('0x19'));var db=require(_0x9adb('0x1a'))['db'];function respondWithStatusCode(_0x2acb28,_0x3c0f39){_0x3c0f39=_0x3c0f39||0xcc;return function(_0x5225d4){if(_0x5225d4){return _0x2acb28[_0x9adb('0x1b')](_0x3c0f39);}return _0x2acb28[_0x9adb('0x1c')](_0x3c0f39)[_0x9adb('0x1d')]();};}function respondWithResult(_0x48beb3,_0x132b52){_0x132b52=_0x132b52||0xc8;return function(_0x20372d){if(_0x20372d){return _0x48beb3[_0x9adb('0x1c')](_0x132b52)[_0x9adb('0x1e')](_0x20372d);}};}function respondWithFilteredResult(_0x3f46dc,_0x4185f7){return function(_0x372ea1){if(_0x372ea1){var _0x8e1311=typeof _0x4185f7['offset']===_0x9adb('0x1f')&&typeof _0x4185f7[_0x9adb('0x20')]===_0x9adb('0x1f');var _0x1f513b=_0x372ea1[_0x9adb('0x21')];var _0x33ffd5=_0x8e1311?0x0:_0x4185f7[_0x9adb('0x22')];var _0xceb32e=_0x8e1311?_0x372ea1[_0x9adb('0x21')]:_0x4185f7[_0x9adb('0x22')]+_0x4185f7['limit'];var _0x5a3ddf;if(_0xceb32e>=_0x1f513b){_0xceb32e=_0x1f513b;_0x5a3ddf=0xc8;}else{_0x5a3ddf=0xce;}_0x3f46dc[_0x9adb('0x1c')](_0x5a3ddf);return _0x3f46dc['set'](_0x9adb('0x23'),_0x33ffd5+'-'+_0xceb32e+'/'+_0x1f513b)[_0x9adb('0x1e')](_0x372ea1);}return null;};}function patchUpdates(_0x309c08){return function(_0x422f4b){try{jsonpatch['apply'](_0x422f4b,_0x309c08,!![]);}catch(_0x3872d4){return BPromise[_0x9adb('0x24')](_0x3872d4);}return _0x422f4b[_0x9adb('0x25')]();};}function saveUpdates(_0x36baaf,_0x5e59ff){return function(_0x35f2a2){if(_0x35f2a2){return _0x35f2a2[_0x9adb('0x26')](_0x36baaf)['then'](function(_0x12631b){return _0x12631b;});}return null;};}function removeEntity(_0x260715,_0x433c5a){return function(_0x56e6b7){if(_0x56e6b7){return _0x56e6b7['destroy']()[_0x9adb('0x27')](function(){_0x260715[_0x9adb('0x1c')](0xcc)[_0x9adb('0x1d')]();});}};}function handleEntityNotFound(_0x5625ec,_0x3783ff){return function(_0xc89269){if(!_0xc89269){_0x5625ec[_0x9adb('0x1b')](0x194);}return _0xc89269;};}function handleError(_0x57c025,_0x41ec44){_0x41ec44=_0x41ec44||0x1f4;return function(_0x301f9b){logger[_0x9adb('0x28')](_0x301f9b[_0x9adb('0x29')]);if(_0x301f9b[_0x9adb('0x2a')]){delete _0x301f9b[_0x9adb('0x2a')];}_0x57c025['status'](_0x41ec44)[_0x9adb('0x2b')](_0x301f9b);};}exports[_0x9adb('0x2c')]=function(_0x447774,_0x5ce335){var _0x59fbe6={},_0x6ac42c={},_0x43abd7={'count':0x0,'rows':[]};var _0x8a312f=_['map'](db['CmHopperHistory'][_0x9adb('0x2d')],function(_0xeba322){return{'name':_0xeba322[_0x9adb('0x2e')],'type':_0xeba322['type'][_0x9adb('0x2f')]};});_0x6ac42c[_0x9adb('0x30')]=_[_0x9adb('0x31')](_0x8a312f,_0x9adb('0x2a'));_0x6ac42c[_0x9adb('0x32')]=_[_0x9adb('0x33')](_0x447774[_0x9adb('0x32')]);_0x6ac42c[_0x9adb('0x34')]=_[_0x9adb('0x35')](_0x6ac42c[_0x9adb('0x30')],_0x6ac42c[_0x9adb('0x32')]);_0x59fbe6[_0x9adb('0x36')]=_[_0x9adb('0x35')](_0x6ac42c[_0x9adb('0x30')],qs['fields'](_0x447774[_0x9adb('0x32')][_0x9adb('0x37')]));_0x59fbe6[_0x9adb('0x36')]=_0x59fbe6[_0x9adb('0x36')][_0x9adb('0x38')]?_0x59fbe6[_0x9adb('0x36')]:_0x6ac42c['model'];if(!_0x447774[_0x9adb('0x32')]['hasOwnProperty'](_0x9adb('0x39'))){_0x59fbe6[_0x9adb('0x20')]=qs[_0x9adb('0x20')](_0x447774[_0x9adb('0x32')][_0x9adb('0x20')]);_0x59fbe6[_0x9adb('0x22')]=qs[_0x9adb('0x22')](_0x447774[_0x9adb('0x32')][_0x9adb('0x22')]);}_0x59fbe6[_0x9adb('0x3a')]=qs['sort'](_0x447774[_0x9adb('0x32')][_0x9adb('0x3b')]);_0x59fbe6['where']=qs[_0x9adb('0x34')](_[_0x9adb('0x3c')](_0x447774[_0x9adb('0x32')],_0x6ac42c[_0x9adb('0x34')]),_0x8a312f);if(_0x447774[_0x9adb('0x32')]['filter']){_0x59fbe6[_0x9adb('0x3d')]=_[_0x9adb('0x3e')](_0x59fbe6[_0x9adb('0x3d')],{'$or':_[_0x9adb('0x31')](_0x8a312f,function(_0x17f576){if(_0x17f576[_0x9adb('0x3f')]!==_0x9adb('0x40')){var _0x178ccc={};_0x178ccc[_0x17f576['name']]={'$like':'%'+_0x447774['query'][_0x9adb('0x41')]+'%'};return _0x178ccc;}})});}_0x59fbe6=_['merge']({},_0x59fbe6,_0x447774['options']);var _0x3ca9dc={'where':_0x59fbe6[_0x9adb('0x3d')]};return db['CmHopperHistory'][_0x9adb('0x21')](_0x3ca9dc)['then'](function(_0x2a76f7){_0x43abd7[_0x9adb('0x21')]=_0x2a76f7;if(_0x447774['query']['includeAll']){_0x59fbe6[_0x9adb('0x42')]=[{'all':!![]}];}return db[_0x9adb('0x43')][_0x9adb('0x44')](_0x59fbe6);})[_0x9adb('0x27')](function(_0xabe1aa){_0x43abd7['rows']=_0xabe1aa;return _0x43abd7;})[_0x9adb('0x27')](respondWithFilteredResult(_0x5ce335,_0x59fbe6))[_0x9adb('0x45')](handleError(_0x5ce335,null));};exports[_0x9adb('0x46')]=function(_0x5333ea,_0x556f0c){var _0x4b07f9={'raw':!![],'where':{'id':_0x5333ea['params']['id']}},_0x589ecc={};_0x589ecc[_0x9adb('0x30')]=_[_0x9adb('0x33')](db[_0x9adb('0x43')][_0x9adb('0x2d')]);_0x589ecc[_0x9adb('0x32')]=_[_0x9adb('0x33')](_0x5333ea[_0x9adb('0x32')]);_0x589ecc[_0x9adb('0x34')]=_[_0x9adb('0x35')](_0x589ecc['model'],_0x589ecc[_0x9adb('0x32')]);_0x4b07f9['attributes']=_[_0x9adb('0x35')](_0x589ecc[_0x9adb('0x30')],qs[_0x9adb('0x37')](_0x5333ea[_0x9adb('0x32')][_0x9adb('0x37')]));_0x4b07f9['attributes']=_0x4b07f9[_0x9adb('0x36')][_0x9adb('0x38')]?_0x4b07f9['attributes']:_0x589ecc[_0x9adb('0x30')];if(_0x5333ea['query']['includeAll']){_0x4b07f9['include']=[{'all':!![]}];}_0x4b07f9=_['merge']({},_0x4b07f9,_0x5333ea['options']);return db[_0x9adb('0x43')][_0x9adb('0x47')](_0x4b07f9)['then'](handleEntityNotFound(_0x556f0c,null))['then'](respondWithResult(_0x556f0c,null))[_0x9adb('0x45')](handleError(_0x556f0c,null));};exports[_0x9adb('0x48')]=function(_0x400f06,_0x26a506){return db[_0x9adb('0x43')][_0x9adb('0x48')](_0x400f06['body'],{})['then'](respondWithResult(_0x26a506,0xc9))['catch'](handleError(_0x26a506,null));};exports['describe']=function(_0x445056,_0x5acf0c){return db[_0x9adb('0x43')]['describe']()['then'](respondWithResult(_0x5acf0c,null))[_0x9adb('0x45')](handleError(_0x5acf0c,null));};exports[_0x9adb('0x26')]=function(_0x28fdde,_0x49228e){if(_0x28fdde[_0x9adb('0x49')]['uniqueid']){delete _0x28fdde[_0x9adb('0x49')][_0x9adb('0x4a')];}return db[_0x9adb('0x43')][_0x9adb('0x47')]({'where':{'uniqueid':_0x28fdde['params']['id']}})['then'](handleEntityNotFound(_0x49228e,null))[_0x9adb('0x27')](saveUpdates(_0x28fdde[_0x9adb('0x49')],null))['then'](respondWithResult(_0x49228e,null))[_0x9adb('0x45')](handleError(_0x49228e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ecb8646..4f8d143 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 _0x8579=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','bluebird','request-promise','exports','define'];(function(_0x32f2d2,_0x11c3e4){var _0x25df36=function(_0x54a1c5){while(--_0x54a1c5){_0x32f2d2['push'](_0x32f2d2['shift']());}};_0x25df36(++_0x11c3e4);}(_0x8579,0x16c));var _0x9857=function(_0x1478ab,_0x42f1e8){_0x1478ab=_0x1478ab-0x0;var _0x452ec6=_0x8579[_0x1478ab];return _0x452ec6;};'use strict';var _=require(_0x9857('0x0'));var util=require(_0x9857('0x1'));var logger=require('../../config/logger')(_0x9857('0x2'));var moment=require(_0x9857('0x3'));var BPromise=require(_0x9857('0x4'));var rp=require(_0x9857('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x9857('0x6')]=function(_0x1e72cd,_0x472eab){return _0x1e72cd[_0x9857('0x7')](_0x9857('0x8'),attributes,{'tableName':_0x9857('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x9857('0xa')]},{'name':_0x9857('0xb'),'fields':[_0x9857('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79bf=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','util','api'];(function(_0x250372,_0x121bab){var _0xfb7b48=function(_0x1d9c37){while(--_0x1d9c37){_0x250372['push'](_0x250372['shift']());}};_0xfb7b48(++_0x121bab);}(_0x79bf,0x1df));var _0xf79b=function(_0xeb7786,_0x53a053){_0xeb7786=_0xeb7786-0x0;var _0x120bbc=_0x79bf[_0xeb7786];return _0x120bbc;};'use strict';var _=require('lodash');var util=require(_0xf79b('0x0'));var logger=require('../../config/logger')(_0xf79b('0x1'));var moment=require('moment');var BPromise=require(_0xf79b('0x2'));var rp=require(_0xf79b('0x3'));var fs=require('fs');var path=require(_0xf79b('0x4'));var rimraf=require(_0xf79b('0x5'));var config=require(_0xf79b('0x6'));var attributes=require(_0xf79b('0x7'));module[_0xf79b('0x8')]=function(_0x5de87a,_0x377b85){return _0x5de87a[_0xf79b('0x9')](_0xf79b('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xf79b('0xb'),'fields':[_0xf79b('0xb')]},{'name':_0xf79b('0xc'),'fields':[_0xf79b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9e94db4..c0c6266 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 _0xf6fb=['stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','debug','AvgHandleTime','findAll','raw','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`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','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x176a45,_0x3b5f02){var _0x53ae1c=function(_0x307502){while(--_0x307502){_0x176a45['push'](_0x176a45['shift']());}};_0x53ae1c(++_0x3b5f02);}(_0xf6fb,0x111));var _0xbf6f=function(_0x5b9252,_0x4bc2f8){_0x5b9252=_0x5b9252-0x0;var _0x1a4284=_0xf6fb[_0x5b9252];return _0x1a4284;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6f('0x0'));var BPromise=require(_0xbf6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require(_0xbf6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x4'))('rpc');var config=require(_0xbf6f('0x5'));var jayson=require(_0xbf6f('0x6'));var client=jayson[_0xbf6f('0x7')][_0xbf6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ecf,_0x26bc7b,_0x9d0c63){return new BPromise(function(_0x43d56b,_0x5948cf){return client[_0xbf6f('0x9')](_0x3d8ecf,_0x9d0c63)[_0xbf6f('0xa')](function(_0x2ac2f8){logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,'request\x20sent');logger['debug'](_0xbf6f('0xd'),_0x26bc7b,_0xbf6f('0xe'),JSON[_0xbf6f('0xf')](_0x2ac2f8));if(_0x2ac2f8['error']){if(_0x2ac2f8[_0xbf6f('0x10')]['code']===0x1f4){logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')]['message']);return _0x5948cf(_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);}logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);return _0x43d56b(_0x2ac2f8['error'][_0xbf6f('0x11')]);}else{logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,_0xbf6f('0xe'));_0x43d56b(_0x2ac2f8[_0xbf6f('0x12')][_0xbf6f('0x11')]);}})[_0xbf6f('0x13')](function(_0x586f33){logger['error'](_0xbf6f('0xc'),_0x26bc7b,_0x586f33);_0x5948cf(_0x586f33);});});}exports[_0xbf6f('0x14')]=function(_0x21b485){var _0x4b3c33=this;return new Promise(function(_0x56b4da,_0x2a0537){return db[_0xbf6f('0x15')][_0xbf6f('0x16')](_0x21b485[_0xbf6f('0x17')],{'raw':_0x21b485[_0xbf6f('0x18')]?_0x21b485['options']['raw']===undefined?!![]:![]:!![]})[_0xbf6f('0xa')](function(_0x5985ac){logger[_0xbf6f('0xb')](_0xbf6f('0x14'),_0x21b485);logger[_0xbf6f('0x19')]('CreateCmHopperHistory',_0x21b485,JSON[_0xbf6f('0xf')](_0x5985ac));_0x56b4da(_0x5985ac);})[_0xbf6f('0x13')](function(_0x3a0087){logger['error'](_0xbf6f('0x14'),_0x3a0087['message'],_0x21b485);_0x2a0537(_0x4b3c33[_0xbf6f('0x10')](0x1f4,_0x3a0087[_0xbf6f('0x11')]));});});};exports[_0xbf6f('0x1a')]=function(_0x49979a){var _0x28d8f6=this;return new Promise(function(_0x406320,_0x29415d){return db[_0xbf6f('0x15')][_0xbf6f('0x1b')]({'raw':_0x49979a[_0xbf6f('0x18')]?_0x49979a['options'][_0xbf6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x49979a[_0xbf6f('0x18')]?_0x49979a['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xbf6f('0x1d'),db['sequelize'][_0xbf6f('0x1e')]('id')),_0xbf6f('0x1f')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db['sequelize']['fn']('IF',db[_0xbf6f('0x20')]['literal'](_0xbf6f('0x22')))),_0xbf6f('0x23')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x24')))),_0xbf6f('0x25')],[db[_0xbf6f('0x20')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x26')))),_0xbf6f('0x27')],[db['sequelize']['fn'](_0xbf6f('0x28'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x29')))),'predictiveIntervalAvgTalktime']]})[_0xbf6f('0xa')](function(_0x39f2b1){logger[_0xbf6f('0xb')]('AvgHandleTime',_0x49979a);logger[_0xbf6f('0x19')]('AvgHandleTime',_0x49979a,JSON[_0xbf6f('0xf')](_0x39f2b1));_0x406320(_0x39f2b1);})[_0xbf6f('0x13')](function(_0x1ef492){logger[_0xbf6f('0x10')](_0xbf6f('0x1a'),_0x1ef492[_0xbf6f('0x11')],_0x49979a);_0x29415d(_0x28d8f6[_0xbf6f('0x10')](0x1f4,_0x1ef492[_0xbf6f('0x11')]));});});};exports[_0xbf6f('0x2a')]=function(_0xa926eb){var _0x2bf61e=this;return new Promise(function(_0x1057b1,_0x5f0fab){return db[_0xbf6f('0x15')][_0xbf6f('0x1b')]({'raw':_0xa926eb[_0xbf6f('0x18')]?_0xa926eb[_0xbf6f('0x18')][_0xbf6f('0x1c')]===undefined?!![]:![]:!![],'where':_0xa926eb[_0xbf6f('0x18')]?_0xa926eb[_0xbf6f('0x18')]['where']||null:null,'attributes':[[_0xbf6f('0x2b'),_0xbf6f('0x2c')],[db[_0xbf6f('0x20')]['fn']('COUNT',db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0xbf6f('0x2d')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x2e')))),_0xbf6f('0x2f')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x30')))),'outboundAnswerCallsDay'],[db[_0xbf6f('0x20')]['fn']('COUNT',db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')]['literal'](_0xbf6f('0x31')))),'outboundBusyCallsDay'],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x32')))),_0xbf6f('0x33')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x34')))),_0xbf6f('0x35')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x36')))),_0xbf6f('0x37')],[db['sequelize']['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db['sequelize'][_0xbf6f('0x21')](_0xbf6f('0x38')))),_0xbf6f('0x39')],[db[_0xbf6f('0x20')]['fn']('COUNT',db[_0xbf6f('0x20')]['fn']('IF',db['sequelize'][_0xbf6f('0x21')](_0xbf6f('0x3a')))),_0xbf6f('0x3b')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db['sequelize']['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x3c')))),_0xbf6f('0x3d')],[db['sequelize']['fn']('COUNT',db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x3e')))),_0xbf6f('0x3f')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x40')))),_0xbf6f('0x41')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')][_0xbf6f('0x21')](_0xbf6f('0x42')))),_0xbf6f('0x3f')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db['sequelize'][_0xbf6f('0x21')](_0xbf6f('0x43')))),'outboundReCallsDay']],'group':[_0xbf6f('0x2b')]})[_0xbf6f('0xa')](function(_0x24c1b9){logger[_0xbf6f('0xb')](_0xbf6f('0x2a'),_0xa926eb);logger['debug'](_0xbf6f('0x2a'),_0xa926eb,JSON['stringify'](_0x24c1b9));_0x1057b1(_0x24c1b9);})[_0xbf6f('0x13')](function(_0x2e5a1a){logger['error'](_0xbf6f('0x2a'),_0x2e5a1a[_0xbf6f('0x11')],_0xa926eb);_0x5f0fab(_0x2bf61e[_0xbf6f('0x10')](0x1f4,_0x2e5a1a[_0xbf6f('0x11')]));});});};exports[_0xbf6f('0x44')]=function(_0x449283){var _0x20af23=this;return new Promise(function(_0xb72af7,_0x3e7211){return db[_0xbf6f('0x15')]['findAll']({'raw':_0x449283[_0xbf6f('0x18')]?_0x449283[_0xbf6f('0x18')][_0xbf6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x449283['options']?_0x449283[_0xbf6f('0x18')][_0xbf6f('0x45')]||null:null,'attributes':[[_0xbf6f('0x2b'),_0xbf6f('0x2c')],[db[_0xbf6f('0x20')]['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')][_0xbf6f('0x1e')]('id')),_0xbf6f('0x46')],[db['sequelize']['fn'](_0xbf6f('0x1d'),db[_0xbf6f('0x20')]['fn']('IF',db[_0xbf6f('0x20')]['literal'](_0xbf6f('0x30')))),_0xbf6f('0x47')]],'group':[_0xbf6f('0x2b')]})[_0xbf6f('0xa')](function(_0x5b0258){logger[_0xbf6f('0xb')](_0xbf6f('0x44'),_0x449283);logger[_0xbf6f('0x19')](_0xbf6f('0x44'),_0x449283,JSON['stringify'](_0x5b0258));_0xb72af7(_0x5b0258);})[_0xbf6f('0x13')](function(_0x44d6f4){logger[_0xbf6f('0x10')]('GetCampaignHopperHistory',_0x44d6f4[_0xbf6f('0x11')],_0x449283);_0x3e7211(_0x20af23[_0xbf6f('0x10')](0x1f4,_0x44d6f4['message']));});});}; \ No newline at end of file +var _0x8369=['outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperHistory','create','body','options','raw','debug','AvgHandleTime','CmHopperHistory','findAll','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','then','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0x8369,0x10b));var _0x9836=function(_0x3e54c6,_0x320637){_0x3e54c6=_0x3e54c6-0x0;var _0x5a2a02=_0x8369[_0x3e54c6];return _0x5a2a02;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var moment=require(_0x9836('0x2'));var BPromise=require(_0x9836('0x3'));var rs=require(_0x9836('0x4'));var fs=require('fs');var Redis=require(_0x9836('0x5'));var db=require(_0x9836('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9836('0x7'))('rpc');var config=require(_0x9836('0x8'));var jayson=require(_0x9836('0x9'));var client=jayson['client'][_0x9836('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4979,_0x52ae78,_0x37214e){return new BPromise(function(_0x3007ed,_0x16db95){return client[_0x9836('0xb')](_0x2e4979,_0x37214e)['then'](function(_0x30bc66){logger[_0x9836('0xc')](_0x9836('0xd'),_0x52ae78,_0x9836('0xe'));logger['debug'](_0x9836('0xf'),_0x52ae78,_0x9836('0xe'),JSON[_0x9836('0x10')](_0x30bc66));if(_0x30bc66[_0x9836('0x11')]){if(_0x30bc66[_0x9836('0x11')]['code']===0x1f4){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);return _0x16db95(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66['error'][_0x9836('0x12')]);return _0x3007ed(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}else{logger['info'](_0x9836('0xd'),_0x52ae78,'request\x20sent');_0x3007ed(_0x30bc66[_0x9836('0x13')]['message']);}})[_0x9836('0x14')](function(_0x22f9b5){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x22f9b5);_0x16db95(_0x22f9b5);});});}exports[_0x9836('0x15')]=function(_0x2afe17){var _0x5d1d9c=this;return new Promise(function(_0x1b01b9,_0x45bd78){return db['CmHopperHistory'][_0x9836('0x16')](_0x2afe17[_0x9836('0x17')],{'raw':_0x2afe17[_0x9836('0x18')]?_0x2afe17['options'][_0x9836('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x472ab4){logger[_0x9836('0xc')](_0x9836('0x15'),_0x2afe17);logger[_0x9836('0x1a')](_0x9836('0x15'),_0x2afe17,JSON['stringify'](_0x472ab4));_0x1b01b9(_0x472ab4);})['catch'](function(_0x4e51b9){logger[_0x9836('0x11')](_0x9836('0x15'),_0x4e51b9[_0x9836('0x12')],_0x2afe17);_0x45bd78(_0x5d1d9c['error'](0x1f4,_0x4e51b9[_0x9836('0x12')]));});});};exports[_0x9836('0x1b')]=function(_0x110044){var _0x1050aa=this;return new Promise(function(_0x521eb5,_0x242b10){return db[_0x9836('0x1c')][_0x9836('0x1d')]({'raw':_0x110044[_0x9836('0x18')]?_0x110044[_0x9836('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x110044[_0x9836('0x18')]?_0x110044[_0x9836('0x18')]['where']||null:null,'attributes':[[db[_0x9836('0x1e')]['fn']('COUNT',db[_0x9836('0x1e')]['col']('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x21')))),_0x9836('0x22')],[db[_0x9836('0x1e')]['fn']('COUNT',db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x23')))),_0x9836('0x24')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')]['literal'](_0x9836('0x25')))),_0x9836('0x26')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x27'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x28')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0x9836('0x27'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x9836('0x29')](function(_0x5aaaae){logger[_0x9836('0xc')](_0x9836('0x1b'),_0x110044);logger['debug']('AvgHandleTime',_0x110044,JSON[_0x9836('0x10')](_0x5aaaae));_0x521eb5(_0x5aaaae);})[_0x9836('0x14')](function(_0x2ce437){logger[_0x9836('0x11')](_0x9836('0x1b'),_0x2ce437['message'],_0x110044);_0x242b10(_0x1050aa['error'](0x1f4,_0x2ce437[_0x9836('0x12')]));});});};exports[_0x9836('0x2a')]=function(_0x1fc14b){var _0x40d95f=this;return new Promise(function(_0x41c03a,_0x32f95e){return db['CmHopperHistory'][_0x9836('0x1d')]({'raw':_0x1fc14b['options']?_0x1fc14b[_0x9836('0x18')][_0x9836('0x19')]===undefined?!![]:![]:!![],'where':_0x1fc14b[_0x9836('0x18')]?_0x1fc14b[_0x9836('0x18')][_0x9836('0x2b')]||null:null,'attributes':[[_0x9836('0x2c'),_0x9836('0x2d')],[db['sequelize']['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x9836('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x2e')))),_0x9836('0x2f')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db['sequelize'][_0x9836('0x20')](_0x9836('0x21')))),_0x9836('0x30')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db['sequelize']['fn']('IF',db[_0x9836('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x31')))),'outboundCongestionCallsDay'],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x32')))),_0x9836('0x33')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x9836('0x20')](_0x9836('0x34')))),'outboundDropCallsDayCallersExit'],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x35')))),'outboundUnknownCallsDay'],[db[_0x9836('0x1e')]['fn']('COUNT',db[_0x9836('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x9836('0x36')))),'outboundBlacklistCallsDay'],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x37')))),_0x9836('0x38')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0x9836('0x39')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')]['literal'](_0x9836('0x3a')))),'outboundAnswerAgiCallsDay'],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db[_0x9836('0x1e')]['literal'](_0x9836('0x3b')))),_0x9836('0x39')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['fn']('IF',db['sequelize'][_0x9836('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x9836('0x3c')]],'group':[_0x9836('0x2c')]})[_0x9836('0x29')](function(_0x140fbe){logger['info']('GetVoiceQueueHopperHistory',_0x1fc14b);logger[_0x9836('0x1a')](_0x9836('0x2a'),_0x1fc14b,JSON[_0x9836('0x10')](_0x140fbe));_0x41c03a(_0x140fbe);})['catch'](function(_0x406a9f){logger[_0x9836('0x11')](_0x9836('0x2a'),_0x406a9f[_0x9836('0x12')],_0x1fc14b);_0x32f95e(_0x40d95f[_0x9836('0x11')](0x1f4,_0x406a9f[_0x9836('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0xb721af){var _0x3904a3=this;return new Promise(function(_0x2456cf,_0x158ecc){return db[_0x9836('0x1c')][_0x9836('0x1d')]({'raw':_0xb721af['options']?_0xb721af[_0x9836('0x18')][_0x9836('0x19')]===undefined?!![]:![]:!![],'where':_0xb721af['options']?_0xb721af[_0x9836('0x18')][_0x9836('0x2b')]||null:null,'attributes':[[_0x9836('0x2c'),'name'],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db[_0x9836('0x1e')]['col']('id')),_0x9836('0x3d')],[db[_0x9836('0x1e')]['fn'](_0x9836('0x1f'),db['sequelize']['fn']('IF',db[_0x9836('0x1e')][_0x9836('0x20')](_0x9836('0x21')))),'ivrAnswerCallsDay']],'group':['campaign']})['then'](function(_0x2e4cd3){logger['info'](_0x9836('0x3e'),_0xb721af);logger['debug'](_0x9836('0x3e'),_0xb721af,JSON[_0x9836('0x10')](_0x2e4cd3));_0x2456cf(_0x2e4cd3);})['catch'](function(_0x37daa2){logger['error'](_0x9836('0x3e'),_0x37daa2[_0x9836('0x12')],_0xb721af);_0x158ecc(_0x3904a3[_0x9836('0x11')](0x1f4,_0x37daa2[_0x9836('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 60a5603..f38430d 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 _0x2886=['/describe','isAuthenticated','create','put','/:id','update','express','fs-extra','../../components/auth/service','./cmHopperHistory.controller','get'];(function(_0x28a668,_0x2c5a16){var _0xa65337=function(_0x1e053e){while(--_0x1e053e){_0x28a668['push'](_0x28a668['shift']());}};_0xa65337(++_0x2c5a16);}(_0x2886,0xcc));var _0x6288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2886[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6288('0x0'));var router=express['Router']();var fs_extra=require(_0x6288('0x1'));var auth=require(_0x6288('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6288('0x3'));router[_0x6288('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6288('0x4')](_0x6288('0x5'),auth[_0x6288('0x6')](),controller['describe']);router[_0x6288('0x4')]('/:id',auth[_0x6288('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6288('0x7')]);router[_0x6288('0x8')](_0x6288('0x9'),auth[_0x6288('0x6')](),controller[_0x6288('0xa')]);module['exports']=router; \ No newline at end of file +var _0xf196=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','/:id','post','put'];(function(_0x459baf,_0x332707){var _0x4a5970=function(_0x28ac61){while(--_0x28ac61){_0x459baf['push'](_0x459baf['shift']());}};_0x4a5970(++_0x332707);}(_0xf196,0x79));var _0x6f19=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf196[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x6f19('0x0'));var util=require(_0x6f19('0x1'));var path=require(_0x6f19('0x2'));var timeout=require(_0x6f19('0x3'));var express=require(_0x6f19('0x4'));var router=express[_0x6f19('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6f19('0x6'));var config=require('../../config/environment');var controller=require(_0x6f19('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f19('0x8')]);router[_0x6f19('0x9')](_0x6f19('0xa'),auth[_0x6f19('0xb')](),controller['describe']);router[_0x6f19('0x9')](_0x6f19('0xc'),auth[_0x6f19('0xb')](),controller['show']);router[_0x6f19('0xd')]('/',auth[_0x6f19('0xb')](),controller['create']);router[_0x6f19('0xe')](_0x6f19('0xc'),auth[_0x6f19('0xb')](),controller[_0x6f19('0xf')]);module[_0x6f19('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ef0fc85..1f5c394 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 _0x5301=['name','exports','STRING'];(function(_0x44047b,_0x45b47c){var _0x47105b=function(_0x56112e){while(--_0x56112e){_0x44047b['push'](_0x44047b['shift']());}};_0x47105b(++_0x45b47c);}(_0x5301,0x157));var _0x1530=function(_0x2f52b8,_0x18812e){_0x2f52b8=_0x2f52b8-0x0;var _0x1b3114=_0x5301[_0x2f52b8];return _0x1b3114;};'use strict';var Sequelize=require('sequelize');module[_0x1530('0x0')]={'name':{'type':Sequelize[_0x1530('0x1')],'unique':_0x1530('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1530('0x1')]},'dialPrefix':{'type':Sequelize[_0x1530('0x1')]}}; \ No newline at end of file +var _0xe2cc=['sequelize','exports','STRING'];(function(_0x13610a,_0x4f866c){var _0x150ecc=function(_0x383f46){while(--_0x383f46){_0x13610a['push'](_0x13610a['shift']());}};_0x150ecc(++_0x4f866c);}(_0xe2cc,0x69));var _0xce2c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe2cc[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xce2c('0x0'));module[_0xce2c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xce2c('0x2')]},'dialPrefix':{'type':Sequelize[_0xce2c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 79041ae..ce46e5e 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 _0xb335=['list_%d_%s.csv','Content-type','addCustomField','addCustomFields','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','index','map','CmList','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ListId','getDispositions','findOne','Disposition','pick','removeDispositions','ids','describe','tags','join','isArray','push','each','CmContact','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','raw','options','CmCustomField','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename='];(function(_0x363319,_0x4fa1a1){var _0x182a62=function(_0x78f65b){while(--_0x78f65b){_0x363319['push'](_0x363319['shift']());}};_0x182a62(++_0x4fa1a1);}(_0xb335,0x132));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5b33('0x0'));var rimraf=require(_0x5b33('0x1'));var zipdir=require(_0x5b33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b33('0x3'));var moment=require(_0x5b33('0x4'));var BPromise=require(_0x5b33('0x5'));var Mustache=require(_0x5b33('0x6'));var util=require('util');var path=require(_0x5b33('0x7'));var sox=require(_0x5b33('0x8'));var csv=require('to-csv');var ejs=require(_0x5b33('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b33('0xa'));var squel=require(_0x5b33('0xb'));var crypto=require(_0x5b33('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5b33('0xd'));var toCsv=require(_0x5b33('0xe'));var querystring=require(_0x5b33('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b33('0x10'));var qs=require(_0x5b33('0x11'));var as=require(_0x5b33('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b33('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5b33('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5b33('0x15')]=_['defaults'](config['redis'],{'host':_0x5b33('0x16'),'port':0x18eb});var socket=require(_0x5b33('0x17'))(new Redis(config[_0x5b33('0x15')]));require(_0x5b33('0x18'))[_0x5b33('0x19')](socket);function respondWithStatusCode(_0x2fcca0,_0x428e97){_0x428e97=_0x428e97||0xcc;return function(_0x365afb){if(_0x365afb){return _0x2fcca0[_0x5b33('0x1a')](_0x428e97);}return _0x2fcca0[_0x5b33('0x1b')](_0x428e97)['end']();};}function respondWithResult(_0x5237d0,_0x4624a5){_0x4624a5=_0x4624a5||0xc8;return function(_0x23dd74){if(_0x23dd74){return _0x5237d0[_0x5b33('0x1b')](_0x4624a5)[_0x5b33('0x1c')](_0x23dd74);}};}function respondWithFilteredResult(_0x5acd6c,_0x344e33){return function(_0x483e45){if(_0x483e45){var _0x4c4892=typeof _0x344e33[_0x5b33('0x1d')]===_0x5b33('0x1e')&&typeof _0x344e33[_0x5b33('0x1f')]===_0x5b33('0x1e');var _0x2f8735=_0x483e45[_0x5b33('0x20')];var _0x23dd7b=_0x4c4892?0x0:_0x344e33['offset'];var _0x50c73f=_0x4c4892?_0x483e45[_0x5b33('0x20')]:_0x344e33[_0x5b33('0x1d')]+_0x344e33[_0x5b33('0x1f')];var _0x1854df;if(_0x50c73f>=_0x2f8735){_0x50c73f=_0x2f8735;_0x1854df=0xc8;}else{_0x1854df=0xce;}_0x5acd6c[_0x5b33('0x1b')](_0x1854df);return _0x5acd6c['set'](_0x5b33('0x21'),_0x23dd7b+'-'+_0x50c73f+'/'+_0x2f8735)[_0x5b33('0x1c')](_0x483e45);}return null;};}function patchUpdates(_0xe9b803){return function(_0x1eeff5){try{jsonpatch[_0x5b33('0x22')](_0x1eeff5,_0xe9b803,!![]);}catch(_0x5d3cd2){return BPromise[_0x5b33('0x23')](_0x5d3cd2);}return _0x1eeff5[_0x5b33('0x24')]();};}function saveUpdates(_0x279ef3,_0x26da78){return function(_0x43cf1c){if(_0x43cf1c){return _0x43cf1c[_0x5b33('0x25')](_0x279ef3)[_0x5b33('0x26')](function(_0x3cfc07){return _0x3cfc07;});}return null;};}function removeEntity(_0x370ce1,_0x411953){return function(_0x5dd1de){if(_0x5dd1de){return _0x5dd1de[_0x5b33('0x27')]()[_0x5b33('0x26')](function(){var _0x314106=_0x5dd1de[_0x5b33('0x28')]({'plain':!![]});var _0x3cd012=_0x5b33('0x29');return db[_0x5b33('0x2a')][_0x5b33('0x27')]({'where':{'type':_0x3cd012,'resourceId':_0x314106['id']}})['then'](function(){return _0x5dd1de;});})[_0x5b33('0x26')](function(){_0x370ce1['status'](0xcc)[_0x5b33('0x2b')]();});}};}function handleEntityNotFound(_0x455801,_0x57bda7){return function(_0x5d9b1f){if(!_0x5d9b1f){_0x455801[_0x5b33('0x1a')](0x194);}return _0x5d9b1f;};}function handleError(_0x8e0dee,_0x153385){_0x153385=_0x153385||0x1f4;return function(_0xe31313){logger[_0x5b33('0x2c')](_0xe31313[_0x5b33('0x2d')]);if(_0xe31313['name']){delete _0xe31313['name'];}_0x8e0dee['status'](_0x153385)['send'](_0xe31313);};}exports[_0x5b33('0x2e')]=function(_0x2289da,_0x5f5464){var _0x795dbf={},_0x11f031={},_0x116a06={'count':0x0,'rows':[]};var _0x278ed5=_[_0x5b33('0x2f')](db[_0x5b33('0x30')][_0x5b33('0x31')],function(_0x47a350){return{'name':_0x47a350[_0x5b33('0x32')],'type':_0x47a350[_0x5b33('0x33')][_0x5b33('0x34')]};});_0x11f031[_0x5b33('0x35')]=_[_0x5b33('0x2f')](_0x278ed5,_0x5b33('0x36'));_0x11f031[_0x5b33('0x37')]=_[_0x5b33('0x38')](_0x2289da[_0x5b33('0x37')]);_0x11f031[_0x5b33('0x39')]=_[_0x5b33('0x3a')](_0x11f031['model'],_0x11f031[_0x5b33('0x37')]);_0x795dbf['attributes']=_[_0x5b33('0x3a')](_0x11f031[_0x5b33('0x35')],qs['fields'](_0x2289da[_0x5b33('0x37')][_0x5b33('0x3b')]));_0x795dbf[_0x5b33('0x3c')]=_0x795dbf['attributes'][_0x5b33('0x3d')]?_0x795dbf[_0x5b33('0x3c')]:_0x11f031[_0x5b33('0x35')];if(!_0x2289da['query'][_0x5b33('0x3e')](_0x5b33('0x3f'))){_0x795dbf[_0x5b33('0x1f')]=qs[_0x5b33('0x1f')](_0x2289da[_0x5b33('0x37')][_0x5b33('0x1f')]);_0x795dbf[_0x5b33('0x1d')]=qs[_0x5b33('0x1d')](_0x2289da[_0x5b33('0x37')][_0x5b33('0x1d')]);}_0x795dbf[_0x5b33('0x40')]=qs[_0x5b33('0x41')](_0x2289da['query']['sort']);_0x795dbf['where']=qs[_0x5b33('0x39')](_['pick'](_0x2289da[_0x5b33('0x37')],_0x11f031[_0x5b33('0x39')]),_0x278ed5);if(_0x2289da[_0x5b33('0x37')][_0x5b33('0x42')]){_0x795dbf[_0x5b33('0x43')]=_[_0x5b33('0x44')](_0x795dbf[_0x5b33('0x43')],{'$or':_[_0x5b33('0x2f')](_0x278ed5,function(_0x3cb167){if(_0x3cb167['type']!=='VIRTUAL'){var _0xc134cc={};_0xc134cc[_0x3cb167['name']]={'$like':'%'+_0x2289da[_0x5b33('0x37')][_0x5b33('0x42')]+'%'};return _0xc134cc;}})});}_0x795dbf=_[_0x5b33('0x44')]({},_0x795dbf,_0x2289da['options']);var _0x25565d={'where':_0x795dbf[_0x5b33('0x43')]};return db['CmList']['count'](_0x25565d)[_0x5b33('0x26')](function(_0x1f00de){_0x116a06[_0x5b33('0x20')]=_0x1f00de;if(_0x2289da[_0x5b33('0x37')][_0x5b33('0x45')]){_0x795dbf[_0x5b33('0x46')]=[{'all':!![]}];}return db[_0x5b33('0x30')][_0x5b33('0x47')](_0x795dbf);})[_0x5b33('0x26')](function(_0x1b6776){_0x116a06[_0x5b33('0x48')]=_0x1b6776;return _0x116a06;})[_0x5b33('0x26')](respondWithFilteredResult(_0x5f5464,_0x795dbf))[_0x5b33('0x49')](handleError(_0x5f5464,null));};exports[_0x5b33('0x4a')]=function(_0x4766b2,_0x38cf7f){var _0x18c695={'raw':![],'where':{'id':_0x4766b2[_0x5b33('0x4b')]['id']}},_0x3ab977={};_0x3ab977['model']=_[_0x5b33('0x38')](db[_0x5b33('0x30')][_0x5b33('0x31')]);_0x3ab977[_0x5b33('0x37')]=_['keys'](_0x4766b2['query']);_0x3ab977[_0x5b33('0x39')]=_[_0x5b33('0x3a')](_0x3ab977[_0x5b33('0x35')],_0x3ab977[_0x5b33('0x37')]);_0x18c695[_0x5b33('0x3c')]=_[_0x5b33('0x3a')](_0x3ab977[_0x5b33('0x35')],qs[_0x5b33('0x3b')](_0x4766b2[_0x5b33('0x37')]['fields']));_0x18c695[_0x5b33('0x3c')]=_0x18c695['attributes'][_0x5b33('0x3d')]?_0x18c695[_0x5b33('0x3c')]:_0x3ab977[_0x5b33('0x35')];if(_0x4766b2[_0x5b33('0x37')][_0x5b33('0x45')]){_0x18c695['include']=[{'all':!![]}];}_0x18c695=_['merge']({},_0x18c695,_0x4766b2['options']);return db[_0x5b33('0x30')]['find'](_0x18c695)[_0x5b33('0x26')](handleEntityNotFound(_0x38cf7f,null))[_0x5b33('0x26')](respondWithResult(_0x38cf7f,null))[_0x5b33('0x49')](handleError(_0x38cf7f,null));};exports[_0x5b33('0x4c')]=function(_0x277559,_0x2451a2){return db[_0x5b33('0x30')][_0x5b33('0x4c')](_0x277559[_0x5b33('0x4d')],{})['then'](function(_0x4348c3){var _0x5f3557=_0x277559[_0x5b33('0x4e')][_0x5b33('0x28')]({'plain':!![]});if(!_0x5f3557)throw new Error(_0x5b33('0x4f'));if(_0x5f3557[_0x5b33('0x50')]==='user'){var _0x7e7e87=_0x4348c3[_0x5b33('0x28')]({'plain':!![]});var _0x39bcbb='Lists';return db[_0x5b33('0x51')][_0x5b33('0x52')]({'where':{'name':_0x39bcbb,'userProfileId':_0x5f3557[_0x5b33('0x53')]},'raw':!![]})['then'](function(_0x199eaa){if(_0x199eaa&&_0x199eaa[_0x5b33('0x54')]===0x0){return db[_0x5b33('0x2a')]['create']({'name':_0x7e7e87[_0x5b33('0x36')],'resourceId':_0x7e7e87['id'],'type':_0x199eaa[_0x5b33('0x36')],'sectionId':_0x199eaa['id']},{})['then'](function(){return _0x4348c3;});}else{return _0x4348c3;}})[_0x5b33('0x49')](function(_0x49a4a3){logger[_0x5b33('0x2c')](_0x5b33('0x55'),_0x49a4a3);throw _0x49a4a3;});}return _0x4348c3;})[_0x5b33('0x26')](respondWithResult(_0x2451a2,0xc9))[_0x5b33('0x49')](handleError(_0x2451a2,null));};exports[_0x5b33('0x25')]=function(_0x52f61c,_0x1eb26e){if(_0x52f61c[_0x5b33('0x4d')]['id']){delete _0x52f61c['body']['id'];}return db[_0x5b33('0x30')][_0x5b33('0x52')]({'where':{'id':_0x52f61c[_0x5b33('0x4b')]['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x1eb26e,null))[_0x5b33('0x26')](saveUpdates(_0x52f61c[_0x5b33('0x4d')],null))[_0x5b33('0x26')](respondWithResult(_0x1eb26e,null))[_0x5b33('0x49')](handleError(_0x1eb26e,null));};exports['destroy']=function(_0x24cb27,_0x303a0f){return db['CmList']['find']({'where':{'id':_0x24cb27[_0x5b33('0x4b')]['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x303a0f,null))['then'](removeEntity(_0x303a0f,null))[_0x5b33('0x49')](handleError(_0x303a0f,null));};exports['describe']=function(_0x5a45d5,_0x58572c){return db[_0x5b33('0x30')]['describe']()['then'](respondWithResult(_0x58572c,null))['catch'](handleError(_0x58572c,null));};exports[_0x5b33('0x56')]=function(_0x5f54db,_0x3e7e22,_0x374649){if(_0x5f54db['body']['id']){delete _0x5f54db['body']['id'];}return db[_0x5b33('0x30')][_0x5b33('0x52')]({'where':{'id':_0x5f54db[_0x5b33('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e7e22,null))['then'](function(_0x419f3e){if(_0x419f3e){_0x5f54db[_0x5b33('0x4d')][_0x5b33('0x57')]=_0x419f3e['id'];return db['Disposition'][_0x5b33('0x4c')](_0x5f54db[_0x5b33('0x4d')]);}})['then'](respondWithResult(_0x3e7e22,null))['catch'](handleError(_0x3e7e22,null));};exports[_0x5b33('0x58')]=function(_0x39dc00,_0x8c7af8,_0x2266d1){var _0x327bde={'raw':![],'where':{}};var _0x176abd={};var _0x512072={'count':0x0,'rows':[]};return db[_0x5b33('0x30')][_0x5b33('0x59')]({'where':{'id':_0x39dc00['params']['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x8c7af8,null))['then'](function(_0x2d717e){if(_0x2d717e){_0x176abd[_0x5b33('0x35')]=_[_0x5b33('0x38')](db[_0x5b33('0x5a')][_0x5b33('0x31')]);_0x176abd[_0x5b33('0x37')]=_['keys'](_0x39dc00[_0x5b33('0x37')]);_0x176abd[_0x5b33('0x39')]=_[_0x5b33('0x3a')](_0x176abd[_0x5b33('0x35')],_0x176abd['query']);_0x327bde[_0x5b33('0x3c')]=_['intersection'](_0x176abd[_0x5b33('0x35')],qs[_0x5b33('0x3b')](_0x39dc00[_0x5b33('0x37')][_0x5b33('0x3b')]));_0x327bde[_0x5b33('0x3c')]=_0x327bde[_0x5b33('0x3c')][_0x5b33('0x3d')]?_0x327bde[_0x5b33('0x3c')]:_0x176abd[_0x5b33('0x35')];if(!_0x39dc00['query']['hasOwnProperty'](_0x5b33('0x3f'))){_0x327bde['limit']=qs[_0x5b33('0x1f')](_0x39dc00['query'][_0x5b33('0x1f')]);_0x327bde[_0x5b33('0x1d')]=qs[_0x5b33('0x1d')](_0x39dc00[_0x5b33('0x37')][_0x5b33('0x1d')]);}_0x327bde[_0x5b33('0x40')]=qs['sort'](_0x39dc00['query']['sort']);_0x327bde['where']=qs[_0x5b33('0x39')](_[_0x5b33('0x5b')](_0x39dc00[_0x5b33('0x37')],_0x176abd[_0x5b33('0x39')]));_0x327bde['where'][_0x5b33('0x57')]=_0x2d717e['id'];if(_0x39dc00[_0x5b33('0x37')][_0x5b33('0x42')]){_0x327bde[_0x5b33('0x43')]=_[_0x5b33('0x44')](_0x327bde[_0x5b33('0x43')],{'$or':_[_0x5b33('0x2f')](_0x327bde[_0x5b33('0x3c')],function(_0xa4f89e){var _0x525849={};_0x525849[_0xa4f89e]={'$like':'%'+_0x39dc00[_0x5b33('0x37')][_0x5b33('0x42')]+'%'};return _0x525849;})});}_0x327bde=_[_0x5b33('0x44')]({},_0x327bde,_0x39dc00['options']);return db['Disposition'][_0x5b33('0x20')]({'where':_0x327bde['where']})[_0x5b33('0x26')](function(_0x20841a){_0x512072['count']=_0x20841a;if(_0x39dc00['query']['includeAll']){_0x327bde[_0x5b33('0x46')]=[{'all':!![]}];}return db[_0x5b33('0x5a')]['findAll'](_0x327bde);})[_0x5b33('0x26')](function(_0x5e51b2){_0x512072[_0x5b33('0x48')]=_0x5e51b2;return _0x512072;});}})[_0x5b33('0x26')](respondWithFilteredResult(_0x8c7af8,_0x327bde))[_0x5b33('0x49')](handleError(_0x8c7af8,null));};exports[_0x5b33('0x5c')]=function(_0x1edfd7,_0x93d0ed,_0xc0598a){return db[_0x5b33('0x30')][_0x5b33('0x52')]({'where':{'id':_0x1edfd7['params']['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x93d0ed,null))['then'](function(_0x30c7ad){if(_0x30c7ad){return _0x30c7ad[_0x5b33('0x5c')](_0x1edfd7[_0x5b33('0x37')][_0x5b33('0x5d')]);}})[_0x5b33('0x26')](respondWithStatusCode(_0x93d0ed,null))[_0x5b33('0x49')](handleError(_0x93d0ed,null));};exports['addContacts']=function(_0x58e0b0,_0x411abf,_0x416873){return db[_0x5b33('0x30')][_0x5b33('0x52')]({'where':{'id':_0x58e0b0['params']['id']}})['then'](handleEntityNotFound(_0x411abf,null))[_0x5b33('0x26')](function(_0x29eadd){if(_0x29eadd){var _0x41a3af=[];var _0x2400f4={'success':[],'errors':[]};return db['CmContact'][_0x5b33('0x5e')]()[_0x5b33('0x26')](function(_0x4cc154){if(_0x58e0b0['body'][_0x5b33('0x5f')]&&_['isArray'](_0x58e0b0['body'][_0x5b33('0x5f')])){if(_0x58e0b0['body']['tags'][_0x5b33('0x3d')]){_0x58e0b0[_0x5b33('0x4d')][_0x5b33('0x5f')]=_0x58e0b0[_0x5b33('0x4d')][_0x5b33('0x5f')][_0x5b33('0x60')](';')+';';}else{_0x58e0b0[_0x5b33('0x4d')]['tags']=null;}}else{_0x58e0b0[_0x5b33('0x4d')][_0x5b33('0x5f')]=null;}if(_0x58e0b0[_0x5b33('0x4d')]&&_[_0x5b33('0x61')](_0x58e0b0[_0x5b33('0x4d')])){for(var _0x281184=0x0;_0x281184<_0x58e0b0[_0x5b33('0x4d')]['length'];_0x281184+=0x1){_0x58e0b0[_0x5b33('0x4d')][_0x281184][_0x5b33('0x57')]=_0x58e0b0[_0x5b33('0x4b')]['id'];_0x41a3af[_0x5b33('0x62')](_0x58e0b0[_0x5b33('0x4d')][_0x281184]);}return BPromise[_0x5b33('0x63')](_0x41a3af,function(_0x28c00b){return db[_0x5b33('0x64')][_0x5b33('0x4c')](_[_0x5b33('0x65')](_0x28c00b,['ids','id'])||{},{'fields':_[_0x5b33('0x38')](_0x4cc154),'raw':!![]})[_0x5b33('0x26')](function(_0x5b086c){_0x2400f4[_0x5b33('0x66')]['push'](_0x5b086c['dataValues']);})[_0x5b33('0x49')](function(_0x528ac8){_0x2400f4[_0x5b33('0x67')]['push']({'data':_0x28c00b,'error':_0x528ac8[_0x5b33('0x68')]});});})['then'](function(_0x532988){return _0x2400f4;})['catch'](function(_0x5ddf6c){return _0x5ddf6c;});}else{_0x411abf[_0x5b33('0x1b')](0x190)['json']({'message':_0x5b33('0x69')});}});}})[_0x5b33('0x26')](respondWithResult(_0x411abf,null))[_0x5b33('0x49')](handleError(_0x411abf,null));};exports[_0x5b33('0x6a')]=function(_0x12d35d,_0x4fc3f2,_0xe3792){var _0x4d73c6;return db['CmList'][_0x5b33('0x52')]({'where':{'id':_0x12d35d[_0x5b33('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x5b33('0x6b')}]})[_0x5b33('0x26')](handleEntityNotFound(_0x4fc3f2,null))['then'](function(_0xbd59b8){if(_0xbd59b8){_0x4d73c6=_0xbd59b8;return db[_0x5b33('0x64')]['rawAttributes'];}})['then'](function(_0xf63248){if(_0xf63248){var _0xc8ecd6={};var _0x2a3c57={};_0x2a3c57[_0x5b33('0x35')]=_[_0x5b33('0x6c')](_[_0x5b33('0x38')](_0xf63248),_['map'](_0x4d73c6[_0x5b33('0x6b')],function(_0x573ea4){return util[_0x5b33('0x6d')](_0x5b33('0x6e'),_0x573ea4['id']);}));_0x2a3c57[_0x5b33('0x37')]=_[_0x5b33('0x38')](_0x12d35d[_0x5b33('0x37')]);_0x2a3c57[_0x5b33('0x39')]=_[_0x5b33('0x3a')](_0x2a3c57[_0x5b33('0x35')],_0x2a3c57[_0x5b33('0x37')]);_0xc8ecd6[_0x5b33('0x3c')]=_[_0x5b33('0x3a')](_0x2a3c57['model'],qs[_0x5b33('0x3b')](_0x12d35d[_0x5b33('0x37')][_0x5b33('0x3b')]));_0xc8ecd6[_0x5b33('0x3c')]=_0xc8ecd6[_0x5b33('0x3c')][_0x5b33('0x3d')]?_0xc8ecd6['attributes']:_0x2a3c57[_0x5b33('0x35')];if(!_0x12d35d[_0x5b33('0x37')][_0x5b33('0x3e')](_0x5b33('0x3f'))){_0xc8ecd6['limit']=qs[_0x5b33('0x1f')](_0x12d35d[_0x5b33('0x37')]['limit']);_0xc8ecd6[_0x5b33('0x1d')]=qs[_0x5b33('0x1d')](_0x12d35d[_0x5b33('0x37')][_0x5b33('0x1d')]);}_0xc8ecd6[_0x5b33('0x40')]=qs[_0x5b33('0x41')](_0x12d35d['query']['sort']);_0xc8ecd6[_0x5b33('0x43')]=qs[_0x5b33('0x39')](_['pick'](_0x12d35d[_0x5b33('0x37')],_0x2a3c57['filters']));_0xc8ecd6[_0x5b33('0x6f')]=!![];if(_0x12d35d[_0x5b33('0x37')]['filter']){_0xc8ecd6['where']=_[_0x5b33('0x44')](_0xc8ecd6[_0x5b33('0x43')],{'$or':_['map'](_0xc8ecd6[_0x5b33('0x3c')],function(_0x3cd6ca){var _0x1d0dcc={};_0x1d0dcc[_0x3cd6ca]={'$like':'%'+_0x12d35d[_0x5b33('0x37')][_0x5b33('0x42')]+'%'};return _0x1d0dcc;})});}_0xc8ecd6=_[_0x5b33('0x44')]({},_0xc8ecd6,_0x12d35d[_0x5b33('0x70')]);return _0x4d73c6[_0x5b33('0x6a')](_0xc8ecd6);}})[_0x5b33('0x26')](respondWithResult(_0x4fc3f2,null))[_0x5b33('0x49')](handleError(_0x4fc3f2,null));};exports['getContactsCsv']=function(_0x49cb5f,_0x3012f2,_0x1b8d08){var _0x30bf24;return db[_0x5b33('0x30')][_0x5b33('0x52')]({'where':{'id':_0x49cb5f['params']['id']},'include':[{'model':db[_0x5b33('0x71')],'as':_0x5b33('0x6b')}]})['then'](handleEntityNotFound(_0x3012f2,null))[_0x5b33('0x26')](function(_0x22f40a){if(_0x22f40a){_0x30bf24=_0x22f40a;return db[_0x5b33('0x64')][_0x5b33('0x31')];}})['then'](function(_0x559b25){if(_0x559b25){var _0x4838cc={};var _0x10959e={};_0x10959e['model']=_[_0x5b33('0x6c')](_['keys'](_0x559b25),_[_0x5b33('0x2f')](_0x30bf24[_0x5b33('0x6b')],function(_0xfd427b){return util[_0x5b33('0x6d')]('cf_%d',_0xfd427b['id']);}));_0x10959e['query']=_[_0x5b33('0x38')](_0x49cb5f[_0x5b33('0x37')]);_0x10959e['filters']=_[_0x5b33('0x3a')](_0x10959e['model'],_0x10959e[_0x5b33('0x37')]);_0x4838cc[_0x5b33('0x3c')]=_[_0x5b33('0x3a')](_0x10959e[_0x5b33('0x35')],qs[_0x5b33('0x3b')](_0x49cb5f[_0x5b33('0x37')][_0x5b33('0x3b')]));_0x4838cc['attributes']=_0x4838cc['attributes'][_0x5b33('0x3d')]?_0x4838cc[_0x5b33('0x3c')]:_0x10959e[_0x5b33('0x35')];if(!_0x49cb5f[_0x5b33('0x37')][_0x5b33('0x3e')](_0x5b33('0x3f'))){_0x4838cc[_0x5b33('0x1f')]=qs[_0x5b33('0x1f')](_0x49cb5f['query'][_0x5b33('0x1f')]);_0x4838cc['offset']=qs['offset'](_0x49cb5f[_0x5b33('0x37')][_0x5b33('0x1d')]);}_0x4838cc[_0x5b33('0x40')]=qs[_0x5b33('0x41')](_0x49cb5f[_0x5b33('0x37')][_0x5b33('0x41')]);_0x4838cc[_0x5b33('0x43')]=qs['filters'](_['pick'](_0x49cb5f['query'],_0x10959e[_0x5b33('0x39')]));_0x4838cc[_0x5b33('0x6f')]=!![];if(_0x49cb5f[_0x5b33('0x37')][_0x5b33('0x42')]){_0x4838cc['where']=_[_0x5b33('0x44')](_0x4838cc[_0x5b33('0x43')],{'$or':_[_0x5b33('0x2f')](_0x4838cc[_0x5b33('0x3c')],function(_0x5732cd){var _0x32774b={};_0x32774b[_0x5732cd]={'$like':'%'+_0x49cb5f['query'][_0x5b33('0x42')]+'%'};return _0x32774b;})});}_0x4838cc=_[_0x5b33('0x44')]({},_0x4838cc,_0x49cb5f['options']);return _0x30bf24['getContacts'](_0x4838cc);}})['then'](function(_0x4dc4af){if(!_[_0x5b33('0x72')](_0x4dc4af)){var _0x331c0f=toCsv(_0x4dc4af);var _0x41ed72=Date[_0x5b33('0x73')]();fs['writeFileSync'](util[_0x5b33('0x6d')](_0x5b33('0x74'),_0x30bf24['id'],_0x41ed72),_0x331c0f);_0x3012f2[_0x5b33('0x75')](_0x5b33('0x76'),_0x5b33('0x77')+util['format'](_0x5b33('0x78'),_0x30bf24['id'],_0x41ed72));_0x3012f2[_0x5b33('0x75')](_0x5b33('0x79'),'text/csv');return _0x3012f2['download'](util[_0x5b33('0x6d')](_0x5b33('0x74'),_0x30bf24['id'],_0x41ed72));}else{return _0x3012f2['sendStatus'](0xcc);}})[_0x5b33('0x49')](handleError(_0x3012f2,null));};exports[_0x5b33('0x7a')]=function(_0x360311,_0x5775d9,_0x5bfaf8){var _0x18b127;delete _0x360311[_0x5b33('0x4d')]['id'];return db['CmList'][_0x5b33('0x59')]({'where':{'id':_0x360311[_0x5b33('0x4b')]['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x5775d9,null))[_0x5b33('0x26')](function(_0x320478){if(_0x320478){return db['sequelize']['transaction'](function(_0x1da561){return db[_0x5b33('0x71')][_0x5b33('0x4c')](_0x360311['body'],{'transaction':_0x1da561})['then'](function(_0x2329ee){_0x18b127=_0x2329ee;return _0x320478[_0x5b33('0x7b')](_0x2329ee,{'transaction':_0x1da561});})[_0x5b33('0x26')](function(){var _0x3cb5a6={'type':db[_0x5b33('0x7c')][_0x5b33('0x7d')],'transaction':_0x1da561};switch(_0x360311['body'][_0x5b33('0x33')]){case'text':_0x3cb5a6[_0x5b33('0x33')]=db['Sequelize'][_0x5b33('0x7d')];break;case _0x5b33('0x7e'):_0x3cb5a6[_0x5b33('0x33')]=db[_0x5b33('0x7c')][_0x5b33('0x7f')];break;case'switch':_0x3cb5a6[_0x5b33('0x33')]=db['Sequelize'][_0x5b33('0x80')];_0x3cb5a6[_0x5b33('0x81')]=![];break;default:}return db[_0x5b33('0x82')][_0x5b33('0x83')]['addColumn']('cm_contacts',util[_0x5b33('0x6d')](_0x5b33('0x84'),_0x18b127['id']),_0x3cb5a6);})[_0x5b33('0x26')](function(){return _0x18b127;});});}})['then'](respondWithResult(_0x5775d9,null))['catch'](handleError(_0x5775d9,null));};exports[_0x5b33('0x85')]=function(_0x1431b7,_0xe8b5a,_0x13299f){var _0x99445c={};var _0x24f289={};var _0x413734;var _0x452c2f;return db[_0x5b33('0x30')]['findOne']({'where':{'id':_0x1431b7[_0x5b33('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe8b5a,null))[_0x5b33('0x26')](function(_0x3c212f){if(_0x3c212f){_0x413734=_0x3c212f;_0x24f289[_0x5b33('0x35')]=_[_0x5b33('0x38')](db[_0x5b33('0x71')][_0x5b33('0x31')]);_0x24f289[_0x5b33('0x37')]=_[_0x5b33('0x38')](_0x1431b7['query']);_0x24f289[_0x5b33('0x39')]=_[_0x5b33('0x3a')](_0x24f289[_0x5b33('0x35')],_0x24f289[_0x5b33('0x37')]);_0x99445c[_0x5b33('0x3c')]=_[_0x5b33('0x3a')](_0x24f289[_0x5b33('0x35')],qs[_0x5b33('0x3b')](_0x1431b7[_0x5b33('0x37')][_0x5b33('0x3b')]));_0x99445c[_0x5b33('0x3c')]=_0x99445c[_0x5b33('0x3c')][_0x5b33('0x3d')]?_0x99445c[_0x5b33('0x3c')]:_0x24f289['model'];_0x99445c[_0x5b33('0x40')]=qs['sort'](_0x1431b7[_0x5b33('0x37')][_0x5b33('0x41')]);_0x99445c[_0x5b33('0x43')]=qs[_0x5b33('0x39')](_[_0x5b33('0x5b')](_0x1431b7[_0x5b33('0x37')],_0x24f289['filters']));_0x99445c[_0x5b33('0x43')]=_[_0x5b33('0x44')](_0x99445c[_0x5b33('0x43')],{'$or':[{'ListId':_0x3c212f['id']},{'ListId':null}]});if(_0x1431b7[_0x5b33('0x37')]['filter']){_0x99445c[_0x5b33('0x43')]=_[_0x5b33('0x44')](_0x99445c[_0x5b33('0x43')],{'$or':_[_0x5b33('0x2f')](_0x99445c[_0x5b33('0x3c')],function(_0x8cd5f0){var _0xaeb1af={};_0xaeb1af[_0x8cd5f0]={'$like':'%'+_0x1431b7['query'][_0x5b33('0x42')]+'%'};return _0xaeb1af;})});}_0x99445c=_[_0x5b33('0x44')]({},_0x99445c,_0x1431b7[_0x5b33('0x70')]);return db[_0x5b33('0x71')][_0x5b33('0x86')](_0x99445c);}})[_0x5b33('0x26')](respondWithResult(_0xe8b5a,null))[_0x5b33('0x49')](handleError(_0xe8b5a,null));};exports[_0x5b33('0x87')]=function(_0x196a7a,_0x304402,_0x423716){return db['CmList'][_0x5b33('0x52')]({'where':{'id':_0x196a7a['params']['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x304402,null))[_0x5b33('0x26')](function(_0x25556c){if(_0x25556c){return _0x25556c['addAgents'](_0x196a7a[_0x5b33('0x4d')][_0x5b33('0x5d')],_[_0x5b33('0x65')](_0x196a7a[_0x5b33('0x4d')],[_0x5b33('0x5d'),'id'])||{})['spread'](function(_0xb0953b){for(var _0x58c778=0x0;_0x58c778<_0x196a7a[_0x5b33('0x4d')][_0x5b33('0x5d')]['length'];_0x58c778+=0x1){socket[_0x5b33('0x88')](_0x5b33('0x89'),{'UserId':Number(_0x196a7a[_0x5b33('0x4d')]['ids'][_0x58c778]),'CmListId':Number(_0x196a7a[_0x5b33('0x4b')]['id'])});}return _0xb0953b;});}})[_0x5b33('0x26')](respondWithResult(_0x304402,null))[_0x5b33('0x49')](handleError(_0x304402,null));};exports['removeAgents']=function(_0x288240,_0x2d5b98,_0x28dd4e){return db[_0x5b33('0x30')][_0x5b33('0x52')]({'where':{'id':_0x288240[_0x5b33('0x4b')]['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x2d5b98,null))[_0x5b33('0x26')](function(_0x12a527){if(_0x12a527){return _0x12a527[_0x5b33('0x8a')](_0x288240[_0x5b33('0x37')][_0x5b33('0x5d')])[_0x5b33('0x26')](function(){if(_[_0x5b33('0x61')](_0x288240[_0x5b33('0x37')]['ids'])){for(var _0x3d2df7=0x0;_0x3d2df7<_0x288240[_0x5b33('0x37')][_0x5b33('0x5d')]['length'];_0x3d2df7+=0x1){socket[_0x5b33('0x88')](_0x5b33('0x8b'),{'UserId':Number(_0x288240[_0x5b33('0x37')]['ids'][_0x3d2df7]),'CmListId':Number(_0x288240[_0x5b33('0x4b')]['id'])});}}else{socket[_0x5b33('0x88')](_0x5b33('0x8b'),{'UserId':Number(_0x288240[_0x5b33('0x37')][_0x5b33('0x5d')]),'CmListId':Number(_0x288240[_0x5b33('0x4b')]['id'])});}});}})[_0x5b33('0x26')](respondWithStatusCode(_0x2d5b98,null))['catch'](handleError(_0x2d5b98,null));};exports['getAgents']=function(_0x4841a2,_0x1a19d2,_0x55d4fe){var _0x296718={};var _0x116560={};var _0x441c76;var _0x2e9b25;return db[_0x5b33('0x30')]['findOne']({'where':{'id':_0x4841a2[_0x5b33('0x4b')]['id']}})[_0x5b33('0x26')](handleEntityNotFound(_0x1a19d2,null))['then'](function(_0x52069f){if(_0x52069f){_0x441c76=_0x52069f;_0x116560[_0x5b33('0x35')]=_[_0x5b33('0x38')](db[_0x5b33('0x8c')][_0x5b33('0x31')]);_0x116560['query']=_['keys'](_0x4841a2['query']);_0x116560[_0x5b33('0x39')]=_[_0x5b33('0x3a')](_0x116560[_0x5b33('0x35')],_0x116560[_0x5b33('0x37')]);_0x296718[_0x5b33('0x3c')]=_['intersection'](_0x116560[_0x5b33('0x35')],qs[_0x5b33('0x3b')](_0x4841a2[_0x5b33('0x37')]['fields']));_0x296718[_0x5b33('0x3c')]=_0x296718[_0x5b33('0x3c')][_0x5b33('0x3d')]?_0x296718[_0x5b33('0x3c')]:_0x116560[_0x5b33('0x35')];_0x296718[_0x5b33('0x40')]=qs[_0x5b33('0x41')](_0x4841a2[_0x5b33('0x37')][_0x5b33('0x41')]);_0x296718[_0x5b33('0x43')]=qs[_0x5b33('0x39')](_['pick'](_0x4841a2['query'],_0x116560[_0x5b33('0x39')]));if(_0x4841a2[_0x5b33('0x37')][_0x5b33('0x42')]){_0x296718[_0x5b33('0x43')]=_[_0x5b33('0x44')](_0x296718[_0x5b33('0x43')],{'$or':_[_0x5b33('0x2f')](_0x296718['attributes'],function(_0x460375){var _0x34a8a8={};_0x34a8a8[_0x460375]={'$like':'%'+_0x4841a2[_0x5b33('0x37')]['filter']+'%'};return _0x34a8a8;})});}_0x296718=_[_0x5b33('0x44')]({},_0x296718,_0x4841a2['options']);return _0x441c76[_0x5b33('0x8d')](_0x296718);}})[_0x5b33('0x26')](function(_0x250102){if(_0x250102){_0x2e9b25=_0x250102[_0x5b33('0x3d')];if(!_0x4841a2[_0x5b33('0x37')]['hasOwnProperty'](_0x5b33('0x3f'))){_0x296718['limit']=qs['limit'](_0x4841a2['query']['limit']);_0x296718[_0x5b33('0x1d')]=qs['offset'](_0x4841a2[_0x5b33('0x37')][_0x5b33('0x1d')]);}return _0x441c76[_0x5b33('0x8d')](_0x296718);}})[_0x5b33('0x26')](function(_0x20b4c3){if(_0x20b4c3){return _0x20b4c3?{'count':_0x2e9b25,'rows':_0x20b4c3}:null;}})[_0x5b33('0x26')](respondWithResult(_0x1a19d2,null))[_0x5b33('0x49')](handleError(_0x1a19d2,null));}; \ No newline at end of file +var _0x23b9=['removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','CmList','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','type','options','include','rows','catch','params','keys','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','findAll','removeDispositions','ids','addContacts','tags','isArray','join','push','CmContact','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save'];(function(_0x11cb2f,_0x5c409f){var _0x5800fc=function(_0x27f3a5){while(--_0x27f3a5){_0x11cb2f['push'](_0x11cb2f['shift']());}};_0x5800fc(++_0x5c409f);}(_0x23b9,0x99));var _0x923b=function(_0xda923a,_0x3fc92e){_0xda923a=_0xda923a-0x0;var _0x93c136=_0x23b9[_0xda923a];return _0x93c136;};'use strict';var emlformat=require(_0x923b('0x0'));var rimraf=require(_0x923b('0x1'));var zipdir=require(_0x923b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x923b('0x3'));var moment=require(_0x923b('0x4'));var BPromise=require(_0x923b('0x5'));var Mustache=require(_0x923b('0x6'));var util=require(_0x923b('0x7'));var path=require('path');var sox=require(_0x923b('0x8'));var csv=require(_0x923b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x923b('0xa'));var _=require(_0x923b('0xb'));var squel=require(_0x923b('0xc'));var crypto=require(_0x923b('0xd'));var jsforce=require(_0x923b('0xe'));var deskjs=require(_0x923b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x923b('0x10'));var Papa=require(_0x923b('0x11'));var Redis=require(_0x923b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x923b('0x13'));var as=require(_0x923b('0x14'));var hardwareService=require(_0x923b('0x15'));var logger=require(_0x923b('0x16'))('api');var utils=require(_0x923b('0x17'));var config=require(_0x923b('0x18'));var licenseUtil=require(_0x923b('0x19'));var db=require('../../mysqldb')['db'];config[_0x923b('0x1a')]=_[_0x923b('0x1b')](config[_0x923b('0x1a')],{'host':_0x923b('0x1c'),'port':0x18eb});var socket=require(_0x923b('0x1d'))(new Redis(config[_0x923b('0x1a')]));require(_0x923b('0x1e'))[_0x923b('0x1f')](socket);function respondWithStatusCode(_0x2da8f9,_0x3e3004){_0x3e3004=_0x3e3004||0xcc;return function(_0x1a6c53){if(_0x1a6c53){return _0x2da8f9[_0x923b('0x20')](_0x3e3004);}return _0x2da8f9[_0x923b('0x21')](_0x3e3004)[_0x923b('0x22')]();};}function respondWithResult(_0x56c4d0,_0x51f61b){_0x51f61b=_0x51f61b||0xc8;return function(_0x518fce){if(_0x518fce){return _0x56c4d0[_0x923b('0x21')](_0x51f61b)[_0x923b('0x23')](_0x518fce);}};}function respondWithFilteredResult(_0x1d5175,_0xdf818a){return function(_0x20800f){if(_0x20800f){var _0x41b77b=typeof _0xdf818a[_0x923b('0x24')]===_0x923b('0x25')&&typeof _0xdf818a[_0x923b('0x26')]===_0x923b('0x25');var _0x434441=_0x20800f[_0x923b('0x27')];var _0x3382cd=_0x41b77b?0x0:_0xdf818a[_0x923b('0x24')];var _0x5ecb43=_0x41b77b?_0x20800f[_0x923b('0x27')]:_0xdf818a[_0x923b('0x24')]+_0xdf818a[_0x923b('0x26')];var _0x395b33;if(_0x5ecb43>=_0x434441){_0x5ecb43=_0x434441;_0x395b33=0xc8;}else{_0x395b33=0xce;}_0x1d5175[_0x923b('0x21')](_0x395b33);return _0x1d5175[_0x923b('0x28')](_0x923b('0x29'),_0x3382cd+'-'+_0x5ecb43+'/'+_0x434441)['json'](_0x20800f);}return null;};}function patchUpdates(_0x9c0063){return function(_0x2409ad){try{jsonpatch[_0x923b('0x2a')](_0x2409ad,_0x9c0063,!![]);}catch(_0x237c97){return BPromise[_0x923b('0x2b')](_0x237c97);}return _0x2409ad[_0x923b('0x2c')]();};}function saveUpdates(_0x1bcc0a,_0xba63d0){return function(_0x3af190){if(_0x3af190){return _0x3af190[_0x923b('0x2d')](_0x1bcc0a)[_0x923b('0x2e')](function(_0x42eaf6){return _0x42eaf6;});}return null;};}function removeEntity(_0x3cd17c,_0x2fcc4f){return function(_0x2de186){if(_0x2de186){return _0x2de186[_0x923b('0x2f')]()['then'](function(){var _0x1b05bb=_0x2de186['get']({'plain':!![]});var _0x2087e5='Lists';return db['UserProfileResource'][_0x923b('0x2f')]({'where':{'type':_0x2087e5,'resourceId':_0x1b05bb['id']}})[_0x923b('0x2e')](function(){return _0x2de186;});})['then'](function(){_0x3cd17c[_0x923b('0x21')](0xcc)[_0x923b('0x22')]();});}};}function handleEntityNotFound(_0x424a19,_0x4ac8b3){return function(_0x378cc2){if(!_0x378cc2){_0x424a19[_0x923b('0x20')](0x194);}return _0x378cc2;};}function handleError(_0x536168,_0x4ed85d){_0x4ed85d=_0x4ed85d||0x1f4;return function(_0x11e1f3){logger['error'](_0x11e1f3[_0x923b('0x30')]);if(_0x11e1f3[_0x923b('0x31')]){delete _0x11e1f3[_0x923b('0x31')];}_0x536168[_0x923b('0x21')](_0x4ed85d)['send'](_0x11e1f3);};}exports[_0x923b('0x32')]=function(_0x2c26e0,_0x40c01f){var _0x534886={},_0x39f503={},_0x46adef={'count':0x0,'rows':[]};var _0x336bb8=_[_0x923b('0x33')](db[_0x923b('0x34')][_0x923b('0x35')],function(_0x1e7528){return{'name':_0x1e7528['fieldName'],'type':_0x1e7528['type']['key']};});_0x39f503[_0x923b('0x36')]=_[_0x923b('0x33')](_0x336bb8,_0x923b('0x31'));_0x39f503[_0x923b('0x37')]=_['keys'](_0x2c26e0['query']);_0x39f503[_0x923b('0x38')]=_[_0x923b('0x39')](_0x39f503[_0x923b('0x36')],_0x39f503['query']);_0x534886['attributes']=_[_0x923b('0x39')](_0x39f503['model'],qs['fields'](_0x2c26e0['query'][_0x923b('0x3a')]));_0x534886[_0x923b('0x3b')]=_0x534886[_0x923b('0x3b')][_0x923b('0x3c')]?_0x534886[_0x923b('0x3b')]:_0x39f503[_0x923b('0x36')];if(!_0x2c26e0[_0x923b('0x37')]['hasOwnProperty'](_0x923b('0x3d'))){_0x534886[_0x923b('0x26')]=qs[_0x923b('0x26')](_0x2c26e0[_0x923b('0x37')]['limit']);_0x534886[_0x923b('0x24')]=qs[_0x923b('0x24')](_0x2c26e0[_0x923b('0x37')][_0x923b('0x24')]);}_0x534886['order']=qs[_0x923b('0x3e')](_0x2c26e0[_0x923b('0x37')]['sort']);_0x534886[_0x923b('0x3f')]=qs['filters'](_['pick'](_0x2c26e0['query'],_0x39f503[_0x923b('0x38')]),_0x336bb8);if(_0x2c26e0[_0x923b('0x37')][_0x923b('0x40')]){_0x534886[_0x923b('0x3f')]=_[_0x923b('0x41')](_0x534886[_0x923b('0x3f')],{'$or':_[_0x923b('0x33')](_0x336bb8,function(_0x47f9cd){if(_0x47f9cd[_0x923b('0x42')]!=='VIRTUAL'){var _0x647c99={};_0x647c99[_0x47f9cd[_0x923b('0x31')]]={'$like':'%'+_0x2c26e0[_0x923b('0x37')]['filter']+'%'};return _0x647c99;}})});}_0x534886=_['merge']({},_0x534886,_0x2c26e0[_0x923b('0x43')]);var _0x1be81a={'where':_0x534886['where']};return db['CmList'][_0x923b('0x27')](_0x1be81a)['then'](function(_0x4fb1c7){_0x46adef[_0x923b('0x27')]=_0x4fb1c7;if(_0x2c26e0[_0x923b('0x37')]['includeAll']){_0x534886[_0x923b('0x44')]=[{'all':!![]}];}return db[_0x923b('0x34')]['findAll'](_0x534886);})[_0x923b('0x2e')](function(_0x3116d7){_0x46adef[_0x923b('0x45')]=_0x3116d7;return _0x46adef;})['then'](respondWithFilteredResult(_0x40c01f,_0x534886))[_0x923b('0x46')](handleError(_0x40c01f,null));};exports['show']=function(_0x115294,_0x131f64){var _0x36413e={'raw':![],'where':{'id':_0x115294[_0x923b('0x47')]['id']}},_0x48c28f={};_0x48c28f['model']=_['keys'](db[_0x923b('0x34')]['rawAttributes']);_0x48c28f[_0x923b('0x37')]=_[_0x923b('0x48')](_0x115294[_0x923b('0x37')]);_0x48c28f['filters']=_[_0x923b('0x39')](_0x48c28f['model'],_0x48c28f[_0x923b('0x37')]);_0x36413e[_0x923b('0x3b')]=_[_0x923b('0x39')](_0x48c28f[_0x923b('0x36')],qs[_0x923b('0x3a')](_0x115294[_0x923b('0x37')][_0x923b('0x3a')]));_0x36413e['attributes']=_0x36413e[_0x923b('0x3b')][_0x923b('0x3c')]?_0x36413e[_0x923b('0x3b')]:_0x48c28f[_0x923b('0x36')];if(_0x115294[_0x923b('0x37')][_0x923b('0x49')]){_0x36413e[_0x923b('0x44')]=[{'all':!![]}];}_0x36413e=_['merge']({},_0x36413e,_0x115294[_0x923b('0x43')]);return db[_0x923b('0x34')][_0x923b('0x4a')](_0x36413e)['then'](handleEntityNotFound(_0x131f64,null))[_0x923b('0x2e')](respondWithResult(_0x131f64,null))[_0x923b('0x46')](handleError(_0x131f64,null));};exports[_0x923b('0x4b')]=function(_0x154b29,_0x20b3e5){return db[_0x923b('0x34')][_0x923b('0x4b')](_0x154b29[_0x923b('0x4c')],{})[_0x923b('0x2e')](function(_0x3fa617){var _0x38224d=_0x154b29['user'][_0x923b('0x4d')]({'plain':!![]});if(!_0x38224d)throw new Error(_0x923b('0x4e'));if(_0x38224d['role']===_0x923b('0x4f')){var _0xc34d70=_0x3fa617['get']({'plain':!![]});var _0x4a1b72=_0x923b('0x50');return db[_0x923b('0x51')]['find']({'where':{'name':_0x4a1b72,'userProfileId':_0x38224d[_0x923b('0x52')]},'raw':!![]})[_0x923b('0x2e')](function(_0x279a27){if(_0x279a27&&_0x279a27[_0x923b('0x53')]===0x0){return db[_0x923b('0x54')][_0x923b('0x4b')]({'name':_0xc34d70[_0x923b('0x31')],'resourceId':_0xc34d70['id'],'type':_0x279a27['name'],'sectionId':_0x279a27['id']},{})[_0x923b('0x2e')](function(){return _0x3fa617;});}else{return _0x3fa617;}})['catch'](function(_0x50f4d0){logger['error'](_0x923b('0x55'),_0x50f4d0);throw _0x50f4d0;});}return _0x3fa617;})[_0x923b('0x2e')](respondWithResult(_0x20b3e5,0xc9))['catch'](handleError(_0x20b3e5,null));};exports[_0x923b('0x2d')]=function(_0x2a6554,_0x2ae667){if(_0x2a6554[_0x923b('0x4c')]['id']){delete _0x2a6554[_0x923b('0x4c')]['id'];}return db[_0x923b('0x34')]['find']({'where':{'id':_0x2a6554['params']['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x2ae667,null))['then'](saveUpdates(_0x2a6554[_0x923b('0x4c')],null))['then'](respondWithResult(_0x2ae667,null))[_0x923b('0x46')](handleError(_0x2ae667,null));};exports[_0x923b('0x2f')]=function(_0x470f59,_0x3fc3c5){return db['CmList'][_0x923b('0x4a')]({'where':{'id':_0x470f59[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x3fc3c5,null))[_0x923b('0x2e')](removeEntity(_0x3fc3c5,null))[_0x923b('0x46')](handleError(_0x3fc3c5,null));};exports[_0x923b('0x56')]=function(_0x4344d3,_0x25a641){return db['CmList']['describe']()[_0x923b('0x2e')](respondWithResult(_0x25a641,null))['catch'](handleError(_0x25a641,null));};exports[_0x923b('0x57')]=function(_0x51b687,_0x4b567f,_0x77a0df){if(_0x51b687[_0x923b('0x4c')]['id']){delete _0x51b687[_0x923b('0x4c')]['id'];}return db['CmList'][_0x923b('0x4a')]({'where':{'id':_0x51b687[_0x923b('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b567f,null))[_0x923b('0x2e')](function(_0x24c216){if(_0x24c216){_0x51b687[_0x923b('0x4c')][_0x923b('0x58')]=_0x24c216['id'];return db[_0x923b('0x59')]['create'](_0x51b687[_0x923b('0x4c')]);}})[_0x923b('0x2e')](respondWithResult(_0x4b567f,null))['catch'](handleError(_0x4b567f,null));};exports[_0x923b('0x5a')]=function(_0x459c9f,_0x408a9f,_0x426e7a){var _0x2afa0b={'raw':![],'where':{}};var _0x5ddd2a={};var _0x119940={'count':0x0,'rows':[]};return db[_0x923b('0x34')][_0x923b('0x5b')]({'where':{'id':_0x459c9f[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x408a9f,null))[_0x923b('0x2e')](function(_0x5da348){if(_0x5da348){_0x5ddd2a['model']=_[_0x923b('0x48')](db[_0x923b('0x59')][_0x923b('0x35')]);_0x5ddd2a['query']=_[_0x923b('0x48')](_0x459c9f[_0x923b('0x37')]);_0x5ddd2a[_0x923b('0x38')]=_['intersection'](_0x5ddd2a['model'],_0x5ddd2a[_0x923b('0x37')]);_0x2afa0b['attributes']=_[_0x923b('0x39')](_0x5ddd2a[_0x923b('0x36')],qs[_0x923b('0x3a')](_0x459c9f[_0x923b('0x37')][_0x923b('0x3a')]));_0x2afa0b[_0x923b('0x3b')]=_0x2afa0b[_0x923b('0x3b')][_0x923b('0x3c')]?_0x2afa0b[_0x923b('0x3b')]:_0x5ddd2a[_0x923b('0x36')];if(!_0x459c9f[_0x923b('0x37')][_0x923b('0x5c')](_0x923b('0x3d'))){_0x2afa0b[_0x923b('0x26')]=qs[_0x923b('0x26')](_0x459c9f[_0x923b('0x37')][_0x923b('0x26')]);_0x2afa0b[_0x923b('0x24')]=qs['offset'](_0x459c9f[_0x923b('0x37')]['offset']);}_0x2afa0b[_0x923b('0x5d')]=qs[_0x923b('0x3e')](_0x459c9f['query'][_0x923b('0x3e')]);_0x2afa0b[_0x923b('0x3f')]=qs['filters'](_[_0x923b('0x5e')](_0x459c9f[_0x923b('0x37')],_0x5ddd2a[_0x923b('0x38')]));_0x2afa0b['where'][_0x923b('0x58')]=_0x5da348['id'];if(_0x459c9f[_0x923b('0x37')]['filter']){_0x2afa0b['where']=_['merge'](_0x2afa0b[_0x923b('0x3f')],{'$or':_['map'](_0x2afa0b['attributes'],function(_0x8493f6){var _0x55229e={};_0x55229e[_0x8493f6]={'$like':'%'+_0x459c9f['query']['filter']+'%'};return _0x55229e;})});}_0x2afa0b=_[_0x923b('0x41')]({},_0x2afa0b,_0x459c9f[_0x923b('0x43')]);return db[_0x923b('0x59')][_0x923b('0x27')]({'where':_0x2afa0b[_0x923b('0x3f')]})['then'](function(_0x21d006){_0x119940['count']=_0x21d006;if(_0x459c9f['query'][_0x923b('0x49')]){_0x2afa0b[_0x923b('0x44')]=[{'all':!![]}];}return db[_0x923b('0x59')][_0x923b('0x5f')](_0x2afa0b);})[_0x923b('0x2e')](function(_0x553cde){_0x119940[_0x923b('0x45')]=_0x553cde;return _0x119940;});}})[_0x923b('0x2e')](respondWithFilteredResult(_0x408a9f,_0x2afa0b))[_0x923b('0x46')](handleError(_0x408a9f,null));};exports[_0x923b('0x60')]=function(_0x518f42,_0x46dc6c,_0x1fe919){return db['CmList'][_0x923b('0x4a')]({'where':{'id':_0x518f42[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x46dc6c,null))[_0x923b('0x2e')](function(_0x57b0c5){if(_0x57b0c5){return _0x57b0c5[_0x923b('0x60')](_0x518f42[_0x923b('0x37')][_0x923b('0x61')]);}})[_0x923b('0x2e')](respondWithStatusCode(_0x46dc6c,null))[_0x923b('0x46')](handleError(_0x46dc6c,null));};exports[_0x923b('0x62')]=function(_0x14aae3,_0x4bc9cf,_0x31b8f3){return db[_0x923b('0x34')][_0x923b('0x4a')]({'where':{'id':_0x14aae3['params']['id']}})['then'](handleEntityNotFound(_0x4bc9cf,null))['then'](function(_0x39349b){if(_0x39349b){var _0x36f851=[];var _0x22a2b7={'success':[],'errors':[]};return db['CmContact'][_0x923b('0x56')]()['then'](function(_0x3dce36){if(_0x14aae3[_0x923b('0x4c')][_0x923b('0x63')]&&_[_0x923b('0x64')](_0x14aae3['body']['tags'])){if(_0x14aae3['body']['tags']['length']){_0x14aae3[_0x923b('0x4c')]['tags']=_0x14aae3['body'][_0x923b('0x63')][_0x923b('0x65')](';')+';';}else{_0x14aae3['body'][_0x923b('0x63')]=null;}}else{_0x14aae3['body'][_0x923b('0x63')]=null;}if(_0x14aae3['body']&&_[_0x923b('0x64')](_0x14aae3[_0x923b('0x4c')])){for(var _0x5feb87=0x0;_0x5feb87<_0x14aae3[_0x923b('0x4c')][_0x923b('0x3c')];_0x5feb87+=0x1){_0x14aae3[_0x923b('0x4c')][_0x5feb87][_0x923b('0x58')]=_0x14aae3[_0x923b('0x47')]['id'];_0x36f851[_0x923b('0x66')](_0x14aae3[_0x923b('0x4c')][_0x5feb87]);}return BPromise['each'](_0x36f851,function(_0x3244d4){return db[_0x923b('0x67')]['create'](_[_0x923b('0x68')](_0x3244d4,[_0x923b('0x61'),'id'])||{},{'fields':_['keys'](_0x3dce36),'raw':!![]})['then'](function(_0x11b7e3){_0x22a2b7[_0x923b('0x69')]['push'](_0x11b7e3[_0x923b('0x6a')]);})[_0x923b('0x46')](function(_0x4fa37a){_0x22a2b7[_0x923b('0x6b')][_0x923b('0x66')]({'data':_0x3244d4,'error':_0x4fa37a['message']});});})[_0x923b('0x2e')](function(_0x2c3326){return _0x22a2b7;})['catch'](function(_0x585729){return _0x585729;});}else{_0x4bc9cf[_0x923b('0x21')](0x190)['json']({'message':_0x923b('0x6c')});}});}})[_0x923b('0x2e')](respondWithResult(_0x4bc9cf,null))['catch'](handleError(_0x4bc9cf,null));};exports[_0x923b('0x6d')]=function(_0x3e7c57,_0x5cd0e8,_0x338b8a){var _0x3c7e4f;return db[_0x923b('0x34')]['find']({'where':{'id':_0x3e7c57[_0x923b('0x47')]['id']},'include':[{'model':db[_0x923b('0x6e')],'as':_0x923b('0x6f')}]})[_0x923b('0x2e')](handleEntityNotFound(_0x5cd0e8,null))['then'](function(_0x34102f){if(_0x34102f){_0x3c7e4f=_0x34102f;return db[_0x923b('0x67')]['rawAttributes'];}})['then'](function(_0x93c55f){if(_0x93c55f){var _0x1ba5e4={};var _0x46d858={};_0x46d858[_0x923b('0x36')]=_[_0x923b('0x70')](_[_0x923b('0x48')](_0x93c55f),_[_0x923b('0x33')](_0x3c7e4f[_0x923b('0x6f')],function(_0x26fef5){return util['format'](_0x923b('0x71'),_0x26fef5['id']);}));_0x46d858[_0x923b('0x37')]=_[_0x923b('0x48')](_0x3e7c57[_0x923b('0x37')]);_0x46d858[_0x923b('0x38')]=_[_0x923b('0x39')](_0x46d858[_0x923b('0x36')],_0x46d858[_0x923b('0x37')]);_0x1ba5e4[_0x923b('0x3b')]=_['intersection'](_0x46d858['model'],qs[_0x923b('0x3a')](_0x3e7c57[_0x923b('0x37')][_0x923b('0x3a')]));_0x1ba5e4['attributes']=_0x1ba5e4[_0x923b('0x3b')][_0x923b('0x3c')]?_0x1ba5e4[_0x923b('0x3b')]:_0x46d858[_0x923b('0x36')];if(!_0x3e7c57[_0x923b('0x37')][_0x923b('0x5c')](_0x923b('0x3d'))){_0x1ba5e4[_0x923b('0x26')]=qs['limit'](_0x3e7c57['query'][_0x923b('0x26')]);_0x1ba5e4[_0x923b('0x24')]=qs[_0x923b('0x24')](_0x3e7c57[_0x923b('0x37')][_0x923b('0x24')]);}_0x1ba5e4['order']=qs[_0x923b('0x3e')](_0x3e7c57[_0x923b('0x37')]['sort']);_0x1ba5e4[_0x923b('0x3f')]=qs[_0x923b('0x38')](_[_0x923b('0x5e')](_0x3e7c57[_0x923b('0x37')],_0x46d858[_0x923b('0x38')]));_0x1ba5e4[_0x923b('0x72')]=!![];if(_0x3e7c57[_0x923b('0x37')]['filter']){_0x1ba5e4[_0x923b('0x3f')]=_['merge'](_0x1ba5e4[_0x923b('0x3f')],{'$or':_['map'](_0x1ba5e4['attributes'],function(_0x5bf273){var _0x4d5d3a={};_0x4d5d3a[_0x5bf273]={'$like':'%'+_0x3e7c57['query'][_0x923b('0x40')]+'%'};return _0x4d5d3a;})});}_0x1ba5e4=_[_0x923b('0x41')]({},_0x1ba5e4,_0x3e7c57[_0x923b('0x43')]);return _0x3c7e4f['getContacts'](_0x1ba5e4);}})['then'](respondWithResult(_0x5cd0e8,null))[_0x923b('0x46')](handleError(_0x5cd0e8,null));};exports[_0x923b('0x73')]=function(_0x1cccb1,_0x2c46fd,_0x4b7422){var _0xee64f8;return db[_0x923b('0x34')]['find']({'where':{'id':_0x1cccb1[_0x923b('0x47')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x923b('0x6f')}]})['then'](handleEntityNotFound(_0x2c46fd,null))[_0x923b('0x2e')](function(_0x32d594){if(_0x32d594){_0xee64f8=_0x32d594;return db[_0x923b('0x67')][_0x923b('0x35')];}})[_0x923b('0x2e')](function(_0x2fe6b4){if(_0x2fe6b4){var _0x5e4cc4={};var _0x42c3aa={};_0x42c3aa[_0x923b('0x36')]=_['concat'](_[_0x923b('0x48')](_0x2fe6b4),_['map'](_0xee64f8[_0x923b('0x6f')],function(_0x48451e){return util[_0x923b('0x74')](_0x923b('0x71'),_0x48451e['id']);}));_0x42c3aa[_0x923b('0x37')]=_[_0x923b('0x48')](_0x1cccb1[_0x923b('0x37')]);_0x42c3aa[_0x923b('0x38')]=_[_0x923b('0x39')](_0x42c3aa[_0x923b('0x36')],_0x42c3aa['query']);_0x5e4cc4[_0x923b('0x3b')]=_[_0x923b('0x39')](_0x42c3aa[_0x923b('0x36')],qs[_0x923b('0x3a')](_0x1cccb1[_0x923b('0x37')][_0x923b('0x3a')]));_0x5e4cc4[_0x923b('0x3b')]=_0x5e4cc4[_0x923b('0x3b')][_0x923b('0x3c')]?_0x5e4cc4[_0x923b('0x3b')]:_0x42c3aa[_0x923b('0x36')];if(!_0x1cccb1[_0x923b('0x37')][_0x923b('0x5c')](_0x923b('0x3d'))){_0x5e4cc4[_0x923b('0x26')]=qs[_0x923b('0x26')](_0x1cccb1[_0x923b('0x37')][_0x923b('0x26')]);_0x5e4cc4[_0x923b('0x24')]=qs[_0x923b('0x24')](_0x1cccb1['query']['offset']);}_0x5e4cc4[_0x923b('0x5d')]=qs[_0x923b('0x3e')](_0x1cccb1[_0x923b('0x37')][_0x923b('0x3e')]);_0x5e4cc4[_0x923b('0x3f')]=qs[_0x923b('0x38')](_['pick'](_0x1cccb1[_0x923b('0x37')],_0x42c3aa[_0x923b('0x38')]));_0x5e4cc4['raw']=!![];if(_0x1cccb1['query'][_0x923b('0x40')]){_0x5e4cc4['where']=_[_0x923b('0x41')](_0x5e4cc4[_0x923b('0x3f')],{'$or':_['map'](_0x5e4cc4[_0x923b('0x3b')],function(_0x6a15d0){var _0x359960={};_0x359960[_0x6a15d0]={'$like':'%'+_0x1cccb1[_0x923b('0x37')][_0x923b('0x40')]+'%'};return _0x359960;})});}_0x5e4cc4=_[_0x923b('0x41')]({},_0x5e4cc4,_0x1cccb1[_0x923b('0x43')]);return _0xee64f8[_0x923b('0x6d')](_0x5e4cc4);}})[_0x923b('0x2e')](function(_0x10aeec){if(!_[_0x923b('0x75')](_0x10aeec)){var _0x401af6=toCsv(_0x10aeec);var _0x115e0d=Date[_0x923b('0x76')]();fs[_0x923b('0x77')](util[_0x923b('0x74')](_0x923b('0x78'),_0xee64f8['id'],_0x115e0d),_0x401af6);_0x2c46fd[_0x923b('0x79')](_0x923b('0x7a'),_0x923b('0x7b')+util[_0x923b('0x74')](_0x923b('0x7c'),_0xee64f8['id'],_0x115e0d));_0x2c46fd['setHeader'](_0x923b('0x7d'),_0x923b('0x7e'));return _0x2c46fd['download'](util[_0x923b('0x74')](_0x923b('0x78'),_0xee64f8['id'],_0x115e0d));}else{return _0x2c46fd[_0x923b('0x20')](0xcc);}})[_0x923b('0x46')](handleError(_0x2c46fd,null));};exports[_0x923b('0x7f')]=function(_0x7b1022,_0x4442ad,_0x1bd029){var _0x179970;delete _0x7b1022[_0x923b('0x4c')]['id'];return db[_0x923b('0x34')][_0x923b('0x5b')]({'where':{'id':_0x7b1022[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x4442ad,null))[_0x923b('0x2e')](function(_0x2c4565){if(_0x2c4565){return db[_0x923b('0x80')][_0x923b('0x81')](function(_0x4ac7a9){return db['CmCustomField'][_0x923b('0x4b')](_0x7b1022['body'],{'transaction':_0x4ac7a9})[_0x923b('0x2e')](function(_0x1834b3){_0x179970=_0x1834b3;return _0x2c4565['addCustomFields'](_0x1834b3,{'transaction':_0x4ac7a9});})[_0x923b('0x2e')](function(){var _0x310b02={'type':db[_0x923b('0x82')][_0x923b('0x83')],'transaction':_0x4ac7a9};switch(_0x7b1022[_0x923b('0x4c')][_0x923b('0x42')]){case _0x923b('0x84'):_0x310b02[_0x923b('0x42')]=db[_0x923b('0x82')][_0x923b('0x83')];break;case _0x923b('0x85'):_0x310b02[_0x923b('0x42')]=db[_0x923b('0x82')][_0x923b('0x86')];break;case'switch':_0x310b02['type']=db[_0x923b('0x82')]['BOOLEAN'];_0x310b02[_0x923b('0x87')]=![];break;default:}return db[_0x923b('0x80')][_0x923b('0x88')][_0x923b('0x89')](_0x923b('0x8a'),util[_0x923b('0x74')]('cf_%s',_0x179970['id']),_0x310b02);})[_0x923b('0x2e')](function(){return _0x179970;});});}})[_0x923b('0x2e')](respondWithResult(_0x4442ad,null))[_0x923b('0x46')](handleError(_0x4442ad,null));};exports[_0x923b('0x8b')]=function(_0xf94fcd,_0x144b4f,_0x2a38da){var _0x20f8ab={};var _0xc3f946={};var _0x1b81a8;var _0x32a6eb;return db[_0x923b('0x34')][_0x923b('0x5b')]({'where':{'id':_0xf94fcd[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x144b4f,null))[_0x923b('0x2e')](function(_0x8509c3){if(_0x8509c3){_0x1b81a8=_0x8509c3;_0xc3f946[_0x923b('0x36')]=_['keys'](db[_0x923b('0x6e')][_0x923b('0x35')]);_0xc3f946['query']=_[_0x923b('0x48')](_0xf94fcd[_0x923b('0x37')]);_0xc3f946[_0x923b('0x38')]=_['intersection'](_0xc3f946[_0x923b('0x36')],_0xc3f946[_0x923b('0x37')]);_0x20f8ab[_0x923b('0x3b')]=_[_0x923b('0x39')](_0xc3f946['model'],qs[_0x923b('0x3a')](_0xf94fcd[_0x923b('0x37')]['fields']));_0x20f8ab[_0x923b('0x3b')]=_0x20f8ab['attributes']['length']?_0x20f8ab[_0x923b('0x3b')]:_0xc3f946['model'];_0x20f8ab[_0x923b('0x5d')]=qs[_0x923b('0x3e')](_0xf94fcd[_0x923b('0x37')]['sort']);_0x20f8ab[_0x923b('0x3f')]=qs['filters'](_['pick'](_0xf94fcd[_0x923b('0x37')],_0xc3f946[_0x923b('0x38')]));_0x20f8ab['where']=_[_0x923b('0x41')](_0x20f8ab['where'],{'$or':[{'ListId':_0x8509c3['id']},{'ListId':null}]});if(_0xf94fcd[_0x923b('0x37')][_0x923b('0x40')]){_0x20f8ab['where']=_['merge'](_0x20f8ab[_0x923b('0x3f')],{'$or':_[_0x923b('0x33')](_0x20f8ab[_0x923b('0x3b')],function(_0x28b056){var _0x3eddc8={};_0x3eddc8[_0x28b056]={'$like':'%'+_0xf94fcd[_0x923b('0x37')][_0x923b('0x40')]+'%'};return _0x3eddc8;})});}_0x20f8ab=_[_0x923b('0x41')]({},_0x20f8ab,_0xf94fcd[_0x923b('0x43')]);return db['CmCustomField'][_0x923b('0x8c')](_0x20f8ab);}})[_0x923b('0x2e')](respondWithResult(_0x144b4f,null))[_0x923b('0x46')](handleError(_0x144b4f,null));};exports[_0x923b('0x8d')]=function(_0x49e956,_0x4fbdbc,_0x5f0b26){return db[_0x923b('0x34')][_0x923b('0x4a')]({'where':{'id':_0x49e956[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x4fbdbc,null))[_0x923b('0x2e')](function(_0x567301){if(_0x567301){return _0x567301[_0x923b('0x8d')](_0x49e956['body'][_0x923b('0x61')],_[_0x923b('0x68')](_0x49e956[_0x923b('0x4c')],[_0x923b('0x61'),'id'])||{})[_0x923b('0x8e')](function(_0x21a3ef){for(var _0x491c2e=0x0;_0x491c2e<_0x49e956[_0x923b('0x4c')][_0x923b('0x61')][_0x923b('0x3c')];_0x491c2e+=0x1){socket[_0x923b('0x8f')](_0x923b('0x90'),{'UserId':Number(_0x49e956[_0x923b('0x4c')][_0x923b('0x61')][_0x491c2e]),'CmListId':Number(_0x49e956[_0x923b('0x47')]['id'])});}return _0x21a3ef;});}})[_0x923b('0x2e')](respondWithResult(_0x4fbdbc,null))[_0x923b('0x46')](handleError(_0x4fbdbc,null));};exports[_0x923b('0x91')]=function(_0x21f538,_0x3d2b08,_0x15a9f4){return db[_0x923b('0x34')]['find']({'where':{'id':_0x21f538[_0x923b('0x47')]['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x3d2b08,null))[_0x923b('0x2e')](function(_0x33453f){if(_0x33453f){return _0x33453f[_0x923b('0x91')](_0x21f538[_0x923b('0x37')]['ids'])[_0x923b('0x2e')](function(){if(_[_0x923b('0x64')](_0x21f538[_0x923b('0x37')][_0x923b('0x61')])){for(var _0x4c6d0b=0x0;_0x4c6d0b<_0x21f538[_0x923b('0x37')][_0x923b('0x61')]['length'];_0x4c6d0b+=0x1){socket[_0x923b('0x8f')]('userCmList:remove',{'UserId':Number(_0x21f538[_0x923b('0x37')][_0x923b('0x61')][_0x4c6d0b]),'CmListId':Number(_0x21f538[_0x923b('0x47')]['id'])});}}else{socket['emit'](_0x923b('0x92'),{'UserId':Number(_0x21f538[_0x923b('0x37')][_0x923b('0x61')]),'CmListId':Number(_0x21f538['params']['id'])});}});}})[_0x923b('0x2e')](respondWithStatusCode(_0x3d2b08,null))[_0x923b('0x46')](handleError(_0x3d2b08,null));};exports[_0x923b('0x93')]=function(_0x58ddcf,_0x3a6ff0,_0xcda84c){var _0x4cba5a={};var _0x57c1e7={};var _0x4c0191;var _0x2315a2;return db[_0x923b('0x34')][_0x923b('0x5b')]({'where':{'id':_0x58ddcf['params']['id']}})[_0x923b('0x2e')](handleEntityNotFound(_0x3a6ff0,null))['then'](function(_0x419864){if(_0x419864){_0x4c0191=_0x419864;_0x57c1e7[_0x923b('0x36')]=_['keys'](db[_0x923b('0x94')][_0x923b('0x35')]);_0x57c1e7[_0x923b('0x37')]=_[_0x923b('0x48')](_0x58ddcf['query']);_0x57c1e7['filters']=_['intersection'](_0x57c1e7[_0x923b('0x36')],_0x57c1e7[_0x923b('0x37')]);_0x4cba5a[_0x923b('0x3b')]=_[_0x923b('0x39')](_0x57c1e7[_0x923b('0x36')],qs[_0x923b('0x3a')](_0x58ddcf['query'][_0x923b('0x3a')]));_0x4cba5a[_0x923b('0x3b')]=_0x4cba5a[_0x923b('0x3b')][_0x923b('0x3c')]?_0x4cba5a['attributes']:_0x57c1e7['model'];_0x4cba5a['order']=qs[_0x923b('0x3e')](_0x58ddcf[_0x923b('0x37')]['sort']);_0x4cba5a[_0x923b('0x3f')]=qs[_0x923b('0x38')](_[_0x923b('0x5e')](_0x58ddcf[_0x923b('0x37')],_0x57c1e7['filters']));if(_0x58ddcf['query'][_0x923b('0x40')]){_0x4cba5a['where']=_[_0x923b('0x41')](_0x4cba5a[_0x923b('0x3f')],{'$or':_['map'](_0x4cba5a['attributes'],function(_0x5fdad7){var _0x3f4ab3={};_0x3f4ab3[_0x5fdad7]={'$like':'%'+_0x58ddcf[_0x923b('0x37')][_0x923b('0x40')]+'%'};return _0x3f4ab3;})});}_0x4cba5a=_[_0x923b('0x41')]({},_0x4cba5a,_0x58ddcf[_0x923b('0x43')]);return _0x4c0191[_0x923b('0x93')](_0x4cba5a);}})[_0x923b('0x2e')](function(_0x4dc6a1){if(_0x4dc6a1){_0x2315a2=_0x4dc6a1['length'];if(!_0x58ddcf[_0x923b('0x37')]['hasOwnProperty'](_0x923b('0x3d'))){_0x4cba5a[_0x923b('0x26')]=qs[_0x923b('0x26')](_0x58ddcf[_0x923b('0x37')]['limit']);_0x4cba5a[_0x923b('0x24')]=qs[_0x923b('0x24')](_0x58ddcf[_0x923b('0x37')]['offset']);}return _0x4c0191[_0x923b('0x93')](_0x4cba5a);}})[_0x923b('0x2e')](function(_0x6b756){if(_0x6b756){return _0x6b756?{'count':_0x2315a2,'rows':_0x6b756}:null;}})['then'](respondWithResult(_0x3a6ff0,null))['catch'](handleError(_0x3a6ff0,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c2c618e..0536951 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x55ca,0x126));var _0xa55c=function(_0x44c844,_0x1e3d7d){_0x44c844=_0x44c844-0x0;var _0x1d51b7=_0x55ca[_0x44c844];return _0x1d51b7;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe14b,0x93));var _0xbe14=function(_0x46e081,_0x8e4803){_0x46e081=_0x46e081-0x0;var _0x3f2c87=_0xe14b[_0x46e081];return _0x3f2c87;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d949e65..2b91354 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','api','bluebird'];(function(_0x344e94,_0xe90c95){var _0xa08e35=function(_0x35e27a){while(--_0x35e27a){_0x344e94['push'](_0x344e94['shift']());}};_0xa08e35(++_0xe90c95);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2f4b0f,_0x32805d){_0x2f4b0f=_0x2f4b0f-0x0;var _0x203266=_0x9bde[_0x2f4b0f];return _0x203266;};'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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash'];(function(_0x896df9,_0x17e2ab){var _0x1a0853=function(_0x266334){while(--_0x266334){_0x896df9['push'](_0x896df9['shift']());}};_0x1a0853(++_0x17e2ab);}(_0xaa88,0x137));var _0x8aa8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xaa88[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'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 7fab8bb..95a6e1b 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 _0x4cb1=['./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter'];(function(_0x5d4b6c,_0x1fb42a){var _0xa621e8=function(_0xc45100){while(--_0xc45100){_0x5d4b6c['push'](_0x5d4b6c['shift']());}};_0xa621e8(++_0x1fb42a);}(_0x4cb1,0x179));var _0x14cb=function(_0x5a83cd,_0x30e558){_0x5a83cd=_0x5a83cd-0x0;var _0x4cb4b8=_0x4cb1[_0x5a83cd];return _0x4cb4b8;};'use strict';var _=require(_0x14cb('0x0'));var util=require(_0x14cb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x14cb('0x2'));var fs=require('fs');var Redis=require(_0x14cb('0x3'));var db=require(_0x14cb('0x4'))['db'];var utils=require(_0x14cb('0x5'));var logger=require(_0x14cb('0x6'))(_0x14cb('0x7'));var config=require(_0x14cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x14cb('0x9')]['http']({'port':0x232a});config['redis']=_[_0x14cb('0xa')](config['redis'],{'host':_0x14cb('0xb'),'port':0x18eb});var socket=require(_0x14cb('0xc'))(new Redis(config['redis']));require(_0x14cb('0xd'))['register'](socket);function respondWithRpcPromise(_0x161f54,_0x34bcf4,_0x37b830){return new BPromise(function(_0x4d35b9,_0x1fdffd){return client[_0x14cb('0xe')](_0x161f54,_0x37b830)[_0x14cb('0xf')](function(_0x5919fd){logger[_0x14cb('0x10')](_0x14cb('0x11'),_0x34bcf4,_0x14cb('0x12'));logger[_0x14cb('0x13')](_0x14cb('0x14'),_0x34bcf4,'request\x20sent',JSON[_0x14cb('0x15')](_0x5919fd));if(_0x5919fd['error']){if(_0x5919fd[_0x14cb('0x16')]['code']===0x1f4){logger[_0x14cb('0x16')](_0x14cb('0x11'),_0x34bcf4,_0x5919fd['error']['message']);return _0x1fdffd(_0x5919fd[_0x14cb('0x16')][_0x14cb('0x17')]);}logger['error'](_0x14cb('0x11'),_0x34bcf4,_0x5919fd[_0x14cb('0x16')][_0x14cb('0x17')]);return _0x4d35b9(_0x5919fd['error'][_0x14cb('0x17')]);}else{logger['info'](_0x14cb('0x11'),_0x34bcf4,_0x14cb('0x12'));_0x4d35b9(_0x5919fd[_0x14cb('0x18')][_0x14cb('0x17')]);}})[_0x14cb('0x19')](function(_0x4ae9e6){logger['error']('CmList,\x20%s,\x20%s',_0x34bcf4,_0x4ae9e6);_0x1fdffd(_0x4ae9e6);});});} \ No newline at end of file +var _0x6b87=['jayson/promise','client','http','redis','localhost','./cmList.socket','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x6b87,0x14a));var _0x76b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76b8('0x0'));var util=require(_0x76b8('0x1'));var moment=require(_0x76b8('0x2'));var BPromise=require(_0x76b8('0x3'));var rs=require(_0x76b8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x76b8('0x5'))(_0x76b8('0x6'));var config=require(_0x76b8('0x7'));var jayson=require(_0x76b8('0x8'));var client=jayson[_0x76b8('0x9')][_0x76b8('0xa')]({'port':0x232a});config[_0x76b8('0xb')]=_['defaults'](config['redis'],{'host':_0x76b8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76b8('0xb')]));require(_0x76b8('0xd'))['register'](socket);function respondWithRpcPromise(_0x335c2b,_0x373ffb,_0x3505e9){return new BPromise(function(_0x2c5977,_0x4864c8){return client[_0x76b8('0xe')](_0x335c2b,_0x3505e9)['then'](function(_0x16eeb2){logger[_0x76b8('0xf')](_0x76b8('0x10'),_0x373ffb,_0x76b8('0x11'));logger[_0x76b8('0x12')](_0x76b8('0x13'),_0x373ffb,_0x76b8('0x11'),JSON[_0x76b8('0x14')](_0x16eeb2));if(_0x16eeb2[_0x76b8('0x15')]){if(_0x16eeb2[_0x76b8('0x15')][_0x76b8('0x16')]===0x1f4){logger[_0x76b8('0x15')](_0x76b8('0x10'),_0x373ffb,_0x16eeb2[_0x76b8('0x15')][_0x76b8('0x17')]);return _0x4864c8(_0x16eeb2[_0x76b8('0x15')]['message']);}logger[_0x76b8('0x15')](_0x76b8('0x10'),_0x373ffb,_0x16eeb2[_0x76b8('0x15')][_0x76b8('0x17')]);return _0x2c5977(_0x16eeb2['error'][_0x76b8('0x17')]);}else{logger[_0x76b8('0xf')]('CmList,\x20%s,\x20%s',_0x373ffb,_0x76b8('0x11'));_0x2c5977(_0x16eeb2[_0x76b8('0x18')][_0x76b8('0x17')]);}})[_0x76b8('0x19')](function(_0x3681a6){logger[_0x76b8('0x15')](_0x76b8('0x10'),_0x373ffb,_0x3681a6);_0x4864c8(_0x3681a6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4c7b9db..ed8c1ac 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 _0xb20e=['length','cmList:','./cmList.events','save','update','emit','removeListener','register'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xb20e,0xd2));var _0xeb20=function(_0x41fd50,_0x3df38a){_0x41fd50=_0x41fd50-0x0;var _0x1d99c5=_0xb20e[_0x41fd50];return _0x1d99c5;};'use strict';var CmListEvents=require(_0xeb20('0x0'));var events=[_0xeb20('0x1'),'remove',_0xeb20('0x2')];function createListener(_0x2f122c,_0x37b177){return function(_0x5ba786){_0x37b177[_0xeb20('0x3')](_0x2f122c,_0x5ba786);};}function removeListener(_0x6134fd,_0x766610){return function(){CmListEvents[_0xeb20('0x4')](_0x6134fd,_0x766610);};}exports[_0xeb20('0x5')]=function(_0x3898d8){for(var _0x20f322=0x0,_0x2125d9=events[_0xeb20('0x6')];_0x20f322<_0x2125d9;_0x20f322++){var _0x296e19=events[_0x20f322];var _0x38e975=createListener(_0xeb20('0x7')+_0x296e19,_0x3898d8);CmListEvents['on'](_0x296e19,_0x38e975);}}; \ No newline at end of file +var _0x8c5d=['register','./cmList.events','remove','update','emit','removeListener'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x8c5d,0x187));var _0xd8c5=function(_0x115edd,_0x505f03){_0x115edd=_0x115edd-0x0;var _0x255f84=_0x8c5d[_0x115edd];return _0x255f84;};'use strict';var CmListEvents=require(_0xd8c5('0x0'));var events=['save',_0xd8c5('0x1'),_0xd8c5('0x2')];function createListener(_0x308892,_0x4381df){return function(_0x3a4ce0){_0x4381df[_0xd8c5('0x3')](_0x308892,_0x3a4ce0);};}function removeListener(_0x596144,_0xcfc125){return function(){CmListEvents[_0xd8c5('0x4')](_0x596144,_0xcfc125);};}exports[_0xd8c5('0x5')]=function(_0x534dbb){for(var _0x190f64=0x0,_0x5e1bda=events['length'];_0x190f64<_0x5e1bda;_0x190f64++){var _0x3c55d0=events[_0x190f64];var _0x330661=createListener('cmList:'+_0x3c55d0,_0x534dbb);CmListEvents['on'](_0x3c55d0,_0x330661);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 873f093..e06b272 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 _0xc989=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','addDisposition','/:id/contacts','addContacts','/:id/fields','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents'];(function(_0x258726,_0x2a9edd){var _0x32d793=function(_0xf9be2b){while(--_0xf9be2b){_0x258726['push'](_0x258726['shift']());}};_0x32d793(++_0x2a9edd);}(_0xc989,0x155));var _0x9c98=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc989[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x9c98('0x0'));var util=require(_0x9c98('0x1'));var path=require(_0x9c98('0x2'));var timeout=require(_0x9c98('0x3'));var express=require(_0x9c98('0x4'));var router=express[_0x9c98('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9c98('0x6'));var interaction=require(_0x9c98('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x9c98('0x8')](),controller['index']);router[_0x9c98('0x9')](_0x9c98('0xa'),auth['isAuthenticated'](),controller[_0x9c98('0xb')]);router[_0x9c98('0x9')](_0x9c98('0xc'),auth['isAuthenticated'](),controller[_0x9c98('0xd')]);router[_0x9c98('0x9')](_0x9c98('0xe'),auth[_0x9c98('0x8')](),controller[_0x9c98('0xf')]);router[_0x9c98('0x9')]('/:id/contacts',auth[_0x9c98('0x8')](),controller[_0x9c98('0x10')]);router[_0x9c98('0x9')](_0x9c98('0x11'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x12')]);router[_0x9c98('0x9')]('/:id/fields',auth[_0x9c98('0x8')](),controller['getCustomFields']);router[_0x9c98('0x9')](_0x9c98('0x13'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x14')]);router[_0x9c98('0x15')]('/',auth[_0x9c98('0x8')](),controller['create']);router[_0x9c98('0x15')](_0x9c98('0xe'),auth['isAuthenticated'](),controller[_0x9c98('0x16')]);router[_0x9c98('0x15')](_0x9c98('0x17'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x18')]);router[_0x9c98('0x15')](_0x9c98('0x19'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x1a')]);router['post'](_0x9c98('0x13'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x1b')]);router[_0x9c98('0x1c')]('/:id',auth[_0x9c98('0x8')](),controller['update']);router[_0x9c98('0x1d')](_0x9c98('0xc'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x1e')]);router[_0x9c98('0x1d')](_0x9c98('0xe'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x1f')]);router[_0x9c98('0x1d')](_0x9c98('0x13'),auth[_0x9c98('0x8')](),controller[_0x9c98('0x20')]);module[_0x9c98('0x21')]=router; \ No newline at end of file +var _0x27d4=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','addContacts','/:id/fields','addCustomField','addAgents','put','delete','/:id','removeDispositions','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x1f3bd4,_0x38029f){var _0x41d3d0=function(_0x339ed9){while(--_0x339ed9){_0x1f3bd4['push'](_0x1f3bd4['shift']());}};_0x41d3d0(++_0x38029f);}(_0x27d4,0x1cc));var _0x427d=function(_0x552e59,_0x5c4591){_0x552e59=_0x552e59-0x0;var _0x5e15ad=_0x27d4[_0x552e59];return _0x5e15ad;};'use strict';var multer=require(_0x427d('0x0'));var util=require(_0x427d('0x1'));var path=require('path');var timeout=require(_0x427d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x427d('0x3'));var auth=require(_0x427d('0x4'));var interaction=require(_0x427d('0x5'));var config=require(_0x427d('0x6'));var controller=require('./cmList.controller');router[_0x427d('0x7')]('/',auth[_0x427d('0x8')](),controller[_0x427d('0x9')]);router[_0x427d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x427d('0xa')]);router[_0x427d('0x7')]('/:id',auth[_0x427d('0x8')](),controller['show']);router[_0x427d('0x7')](_0x427d('0xb'),auth[_0x427d('0x8')](),controller[_0x427d('0xc')]);router['get'](_0x427d('0xd'),auth[_0x427d('0x8')](),controller[_0x427d('0xe')]);router[_0x427d('0x7')](_0x427d('0xf'),auth[_0x427d('0x8')](),controller[_0x427d('0x10')]);router[_0x427d('0x7')]('/:id/fields',auth[_0x427d('0x8')](),controller[_0x427d('0x11')]);router[_0x427d('0x7')](_0x427d('0x12'),auth[_0x427d('0x8')](),controller['getAgents']);router[_0x427d('0x13')]('/',auth[_0x427d('0x8')](),controller[_0x427d('0x14')]);router[_0x427d('0x13')](_0x427d('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x427d('0xd'),auth[_0x427d('0x8')](),controller[_0x427d('0x15')]);router[_0x427d('0x13')](_0x427d('0x16'),auth[_0x427d('0x8')](),controller[_0x427d('0x17')]);router[_0x427d('0x13')](_0x427d('0x12'),auth[_0x427d('0x8')](),controller[_0x427d('0x18')]);router[_0x427d('0x19')]('/:id',auth[_0x427d('0x8')](),controller['update']);router[_0x427d('0x1a')](_0x427d('0x1b'),auth['isAuthenticated'](),controller['destroy']);router[_0x427d('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x427d('0x1c')]);router['delete'](_0x427d('0x12'),auth['isAuthenticated'](),controller[_0x427d('0x1d')]);module[_0x427d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ffe7cb6..48f5649 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 _0x50a6=['VIRTUAL','getDataValue','STRING','exports'];(function(_0x8a90c0,_0x51fa91){var _0x14f0e2=function(_0x48c4da){while(--_0x48c4da){_0x8a90c0['push'](_0x8a90c0['shift']());}};_0x14f0e2(++_0x51fa91);}(_0x50a6,0x7f));var _0x650a=function(_0x258aa2,_0x5ba123){_0x258aa2=_0x258aa2-0x0;var _0x3a7d14=_0x50a6[_0x258aa2];return _0x3a7d14;};'use strict';var Sequelize=require('sequelize');module[_0x650a('0x0')]={'name':{'type':Sequelize[_0x650a('0x1')],'get':function(_0x3e47c7){return this[_0x650a('0x2')]('field');}},'field':{'type':Sequelize[_0x650a('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x650a('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x650a('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x7871=['exports','getDataValue','field','STRING','sequelize'];(function(_0x591df1,_0xd2030b){var _0x28f068=function(_0x38bbd8){while(--_0x38bbd8){_0x591df1['push'](_0x591df1['shift']());}};_0x28f068(++_0xd2030b);}(_0x7871,0xb8));var _0x1787=function(_0xa0f276,_0x124d9a){_0xa0f276=_0xa0f276-0x0;var _0x4db3d4=_0x7871[_0xa0f276];return _0x4db3d4;};'use strict';var Sequelize=require(_0x1787('0x0'));module[_0x1787('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2a3560){return this[_0x1787('0x2')](_0x1787('0x3'));}},'field':{'type':Sequelize[_0x1787('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x1787('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 6845360..334cc9e 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(_0x243d37,_0x5f6158){var _0x5d2919=function(_0x16c870){while(--_0x16c870){_0x243d37['push'](_0x243d37['shift']());}};_0x5d2919(++_0x5f6158);}(_0x7a54,0x106));var _0x47a5=function(_0x502f25,_0x466b91){_0x502f25=_0x502f25-0x0;var _0x116d69=_0x7a54[_0x502f25];return _0x116d69;};'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(_0x482632,_0x2ff64d){var _0x2923e6=function(_0x15c13c){while(--_0x15c13c){_0x482632['push'](_0x482632['shift']());}};_0x2923e6(++_0x2ff64d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 90a67b8..6513b71 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 _0xd4a9=['exports','Condition','tools_conditions','lodash','util','../../config/logger','bluebird','rimraf','./condition.attributes'];(function(_0x16acb4,_0x492fd2){var _0x3b71d6=function(_0x536bb1){while(--_0x536bb1){_0x16acb4['push'](_0x16acb4['shift']());}};_0x3b71d6(++_0x492fd2);}(_0xd4a9,0x13e));var _0x9d4a=function(_0x1690f2,_0x1b21a9){_0x1690f2=_0x1690f2-0x0;var _0x43c645=_0xd4a9[_0x1690f2];return _0x43c645;};'use strict';var _=require(_0x9d4a('0x0'));var util=require(_0x9d4a('0x1'));var logger=require(_0x9d4a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9d4a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d4a('0x4'));var config=require('../../config/environment');var attributes=require(_0x9d4a('0x5'));module[_0x9d4a('0x6')]=function(_0xf84567,_0x4af648){return _0xf84567['define'](_0x9d4a('0x7'),attributes,{'tableName':_0x9d4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa72b=['rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','../../config/logger','moment','path'];(function(_0xc59397,_0x439029){var _0x25588c=function(_0x5812d0){while(--_0x5812d0){_0xc59397['push'](_0xc59397['shift']());}};_0x25588c(++_0x439029);}(_0xa72b,0x17f));var _0xba72=function(_0x23f392,_0x5ae893){_0x23f392=_0x23f392-0x0;var _0x28a68d=_0xa72b[_0x23f392];return _0x28a68d;};'use strict';var _=require(_0xba72('0x0'));var util=require('util');var logger=require(_0xba72('0x1'))('api');var moment=require(_0xba72('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba72('0x3'));var rimraf=require(_0xba72('0x4'));var config=require(_0xba72('0x5'));var attributes=require(_0xba72('0x6'));module['exports']=function(_0x2e34d7,_0x18273c){return _0x2e34d7['define'](_0xba72('0x7'),attributes,{'tableName':_0xba72('0x8'),'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 b32bc18..644e142 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 _0x17ee=['client','request','info','request\x20sent','stringify','error','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise'];(function(_0x1027f2,_0x317923){var _0x245878=function(_0x399a29){while(--_0x399a29){_0x1027f2['push'](_0x1027f2['shift']());}};_0x245878(++_0x317923);}(_0x17ee,0x1cc));var _0xe17e=function(_0x52bd10,_0x192e9f){_0x52bd10=_0x52bd10-0x0;var _0x457cf2=_0x17ee[_0x52bd10];return _0x457cf2;};'use strict';var _=require(_0xe17e('0x0'));var util=require(_0xe17e('0x1'));var moment=require(_0xe17e('0x2'));var BPromise=require(_0xe17e('0x3'));var rs=require(_0xe17e('0x4'));var fs=require('fs');var Redis=require(_0xe17e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe17e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe17e('0x7'));var client=jayson[_0xe17e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d62a,_0x90b64d,_0x113c02){return new BPromise(function(_0x96606,_0x1af2b4){return client[_0xe17e('0x9')](_0x12d62a,_0x113c02)['then'](function(_0x56c366){logger[_0xe17e('0xa')]('Condition,\x20%s,\x20%s',_0x90b64d,_0xe17e('0xb'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x90b64d,_0xe17e('0xb'),JSON[_0xe17e('0xc')](_0x56c366));if(_0x56c366['error']){if(_0x56c366[_0xe17e('0xd')]['code']===0x1f4){logger[_0xe17e('0xd')]('Condition,\x20%s,\x20%s',_0x90b64d,_0x56c366[_0xe17e('0xd')][_0xe17e('0xe')]);return _0x1af2b4(_0x56c366[_0xe17e('0xd')][_0xe17e('0xe')]);}logger[_0xe17e('0xd')](_0xe17e('0xf'),_0x90b64d,_0x56c366[_0xe17e('0xd')][_0xe17e('0xe')]);return _0x96606(_0x56c366['error'][_0xe17e('0xe')]);}else{logger[_0xe17e('0xa')](_0xe17e('0xf'),_0x90b64d,_0xe17e('0xb'));_0x96606(_0x56c366[_0xe17e('0x10')][_0xe17e('0xe')]);}})[_0xe17e('0x11')](function(_0x48744c){logger[_0xe17e('0xd')](_0xe17e('0xf'),_0x90b64d,_0x48744c);_0x1af2b4(_0x48744c);});});} \ No newline at end of file +var _0x3a30=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3a30,0xf6));var _0x03a3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3a30[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x03a3('0x0'));var util=require(_0x03a3('0x1'));var moment=require('moment');var BPromise=require(_0x03a3('0x2'));var rs=require(_0x03a3('0x3'));var fs=require('fs');var Redis=require(_0x03a3('0x4'));var db=require(_0x03a3('0x5'))['db'];var utils=require(_0x03a3('0x6'));var logger=require(_0x03a3('0x7'))('rpc');var config=require(_0x03a3('0x8'));var jayson=require(_0x03a3('0x9'));var client=jayson[_0x03a3('0xa')][_0x03a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11065f,_0x1ca0fb,_0x59c12f){return new BPromise(function(_0x266c2d,_0x1e4389){return client[_0x03a3('0xc')](_0x11065f,_0x59c12f)[_0x03a3('0xd')](function(_0x5edccc){logger[_0x03a3('0xe')](_0x03a3('0xf'),_0x1ca0fb,_0x03a3('0x10'));logger[_0x03a3('0x11')]('Condition,\x20%s,\x20%s,\x20%s',_0x1ca0fb,_0x03a3('0x10'),JSON['stringify'](_0x5edccc));if(_0x5edccc['error']){if(_0x5edccc[_0x03a3('0x12')][_0x03a3('0x13')]===0x1f4){logger[_0x03a3('0x12')](_0x03a3('0xf'),_0x1ca0fb,_0x5edccc[_0x03a3('0x12')][_0x03a3('0x14')]);return _0x1e4389(_0x5edccc[_0x03a3('0x12')][_0x03a3('0x14')]);}logger[_0x03a3('0x12')](_0x03a3('0xf'),_0x1ca0fb,_0x5edccc[_0x03a3('0x12')]['message']);return _0x266c2d(_0x5edccc[_0x03a3('0x12')][_0x03a3('0x14')]);}else{logger[_0x03a3('0xe')](_0x03a3('0xf'),_0x1ca0fb,'request\x20sent');_0x266c2d(_0x5edccc['result'][_0x03a3('0x14')]);}})[_0x03a3('0x15')](function(_0x1b2f4e){logger[_0x03a3('0x12')](_0x03a3('0xf'),_0x1ca0fb,_0x1b2f4e);_0x1e4389(_0x1b2f4e);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 0151a26..3bdbee0 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 _0xb34e=['put','/:id','update','isAuthenticated','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller'];(function(_0x253c95,_0x39fd4a){var _0x5934d4=function(_0x214023){while(--_0x214023){_0x253c95['push'](_0x253c95['shift']());}};_0x5934d4(++_0x39fd4a);}(_0xb34e,0x75));var _0xeb34=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb34e[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0xeb34('0x0'));var util=require('util');var path=require(_0xeb34('0x1'));var timeout=require(_0xeb34('0x2'));var express=require(_0xeb34('0x3'));var router=express[_0xeb34('0x4')]();var fs_extra=require(_0xeb34('0x5'));var auth=require(_0xeb34('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb34('0x7'));var controller=require(_0xeb34('0x8'));router[_0xeb34('0x9')](_0xeb34('0xa'),auth['isAuthenticated'](),controller[_0xeb34('0xb')]);router['delete'](_0xeb34('0xa'),auth[_0xeb34('0xc')](),controller[_0xeb34('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1588=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','exports'];(function(_0x5aa31d,_0x93ab1b){var _0x4d3e9a=function(_0x5efd4d){while(--_0x5efd4d){_0x5aa31d['push'](_0x5aa31d['shift']());}};_0x4d3e9a(++_0x93ab1b);}(_0x1588,0x14a));var _0x8158=function(_0x4ce27d,_0x4713c5){_0x4ce27d=_0x4ce27d-0x0;var _0x595cc7=_0x1588[_0x4ce27d];return _0x595cc7;};'use strict';var multer=require(_0x8158('0x0'));var util=require(_0x8158('0x1'));var path=require('path');var timeout=require(_0x8158('0x2'));var express=require(_0x8158('0x3'));var router=express[_0x8158('0x4')]();var fs_extra=require(_0x8158('0x5'));var auth=require(_0x8158('0x6'));var interaction=require(_0x8158('0x7'));var config=require(_0x8158('0x8'));var controller=require('./condition.controller');router[_0x8158('0x9')](_0x8158('0xa'),auth[_0x8158('0xb')](),controller[_0x8158('0xc')]);router[_0x8158('0xd')](_0x8158('0xa'),auth[_0x8158('0xb')](),controller['destroy']);module[_0x8158('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 69f5c7e..9f5d7b1 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x18d3e5,_0xd79ec7){var _0x55a672=function(_0x423b26){while(--_0x423b26){_0x18d3e5['push'](_0x18d3e5['shift']());}};_0x55a672(++_0xd79ec7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6692020..fd0baac 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 _0x72ba=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','findAll','rows','show','params','keys','Dashboard','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','addItem','DashboardItem','getItems','findOne','pick','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x1f5a1d,_0x5521f4){var _0xd893cc=function(_0xb1e3cf){while(--_0xb1e3cf){_0x1f5a1d['push'](_0x1f5a1d['shift']());}};_0xd893cc(++_0x5521f4);}(_0x72ba,0xcb));var _0xa72b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x72ba[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xa72b('0x0'));var rimraf=require(_0xa72b('0x1'));var zipdir=require(_0xa72b('0x2'));var jsonpatch=require(_0xa72b('0x3'));var rp=require(_0xa72b('0x4'));var moment=require(_0xa72b('0x5'));var BPromise=require(_0xa72b('0x6'));var Mustache=require(_0xa72b('0x7'));var util=require(_0xa72b('0x8'));var path=require(_0xa72b('0x9'));var sox=require(_0xa72b('0xa'));var csv=require(_0xa72b('0xb'));var ejs=require(_0xa72b('0xc'));var fs=require('fs');var fs_extra=require(_0xa72b('0xd'));var _=require(_0xa72b('0xe'));var squel=require(_0xa72b('0xf'));var crypto=require('crypto');var jsforce=require(_0xa72b('0x10'));var deskjs=require(_0xa72b('0x11'));var toCsv=require(_0xa72b('0xb'));var querystring=require(_0xa72b('0x12'));var Papa=require(_0xa72b('0x13'));var Redis=require(_0xa72b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xa72b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa72b('0x16'));var logger=require('../../config/logger')(_0xa72b('0x17'));var utils=require(_0xa72b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa72b('0x19'));var db=require(_0xa72b('0x1a'))['db'];config[_0xa72b('0x1b')]=_[_0xa72b('0x1c')](config[_0xa72b('0x1b')],{'host':_0xa72b('0x1d'),'port':0x18eb});var socket=require(_0xa72b('0x1e'))(new Redis(config[_0xa72b('0x1b')]));require('./dashboard.socket')[_0xa72b('0x1f')](socket);function respondWithStatusCode(_0x4fb6df,_0x240e52){_0x240e52=_0x240e52||0xcc;return function(_0x1d2706){if(_0x1d2706){return _0x4fb6df[_0xa72b('0x20')](_0x240e52);}return _0x4fb6df[_0xa72b('0x21')](_0x240e52)[_0xa72b('0x22')]();};}function respondWithResult(_0x2b28b7,_0x34fca9){_0x34fca9=_0x34fca9||0xc8;return function(_0x47e4fb){if(_0x47e4fb){return _0x2b28b7[_0xa72b('0x21')](_0x34fca9)[_0xa72b('0x23')](_0x47e4fb);}};}function respondWithFilteredResult(_0x14cdbd,_0x60bf32){return function(_0x52e6ac){if(_0x52e6ac){var _0x153232=typeof _0x60bf32[_0xa72b('0x24')]==='undefined'&&typeof _0x60bf32[_0xa72b('0x25')]==='undefined';var _0x433992=_0x52e6ac[_0xa72b('0x26')];var _0xdea40d=_0x153232?0x0:_0x60bf32['offset'];var _0xa73a4e=_0x153232?_0x52e6ac[_0xa72b('0x26')]:_0x60bf32[_0xa72b('0x24')]+_0x60bf32['limit'];var _0x5d52b3;if(_0xa73a4e>=_0x433992){_0xa73a4e=_0x433992;_0x5d52b3=0xc8;}else{_0x5d52b3=0xce;}_0x14cdbd[_0xa72b('0x21')](_0x5d52b3);return _0x14cdbd['set']('Content-Range',_0xdea40d+'-'+_0xa73a4e+'/'+_0x433992)['json'](_0x52e6ac);}return null;};}function patchUpdates(_0x45c4fd){return function(_0x4be12d){try{jsonpatch[_0xa72b('0x27')](_0x4be12d,_0x45c4fd,!![]);}catch(_0x2a764f){return BPromise[_0xa72b('0x28')](_0x2a764f);}return _0x4be12d[_0xa72b('0x29')]();};}function saveUpdates(_0x2e6621,_0x122c81){return function(_0x3b7d9e){if(_0x3b7d9e){return _0x3b7d9e[_0xa72b('0x2a')](_0x2e6621)[_0xa72b('0x2b')](function(_0x1da744){return _0x1da744;});}return null;};}function removeEntity(_0x47d73c,_0x23be70){return function(_0x59292b){if(_0x59292b){return _0x59292b[_0xa72b('0x2c')]()[_0xa72b('0x2b')](function(){var _0x29f72c=_0x59292b[_0xa72b('0x2d')]({'plain':!![]});var _0x48e196=_0xa72b('0x2e');return db[_0xa72b('0x2f')][_0xa72b('0x2c')]({'where':{'type':_0x48e196,'resourceId':_0x29f72c['id']}})[_0xa72b('0x2b')](function(){return _0x59292b;});})['then'](function(){_0x47d73c[_0xa72b('0x21')](0xcc)[_0xa72b('0x22')]();});}};}function handleEntityNotFound(_0xc4e739,_0x18c2f0){return function(_0x2c4f8d){if(!_0x2c4f8d){_0xc4e739['sendStatus'](0x194);}return _0x2c4f8d;};}function handleError(_0x76b291,_0x5ffc65){_0x5ffc65=_0x5ffc65||0x1f4;return function(_0x58f292){logger[_0xa72b('0x30')](_0x58f292[_0xa72b('0x31')]);if(_0x58f292['name']){delete _0x58f292[_0xa72b('0x32')];}_0x76b291['status'](_0x5ffc65)[_0xa72b('0x33')](_0x58f292);};}exports[_0xa72b('0x34')]=function(_0x3f2b5b,_0x4816e9){var _0x850de1={},_0x4c7318={},_0x4f19c5={'count':0x0,'rows':[]};var _0x37743e=_[_0xa72b('0x35')](db['Dashboard'][_0xa72b('0x36')],function(_0x535720){return{'name':_0x535720[_0xa72b('0x37')],'type':_0x535720[_0xa72b('0x38')][_0xa72b('0x39')]};});_0x4c7318[_0xa72b('0x3a')]=_['map'](_0x37743e,_0xa72b('0x32'));_0x4c7318[_0xa72b('0x3b')]=_['keys'](_0x3f2b5b['query']);_0x4c7318[_0xa72b('0x3c')]=_[_0xa72b('0x3d')](_0x4c7318['model'],_0x4c7318['query']);_0x850de1[_0xa72b('0x3e')]=_[_0xa72b('0x3d')](_0x4c7318[_0xa72b('0x3a')],qs[_0xa72b('0x3f')](_0x3f2b5b[_0xa72b('0x3b')][_0xa72b('0x3f')]));_0x850de1[_0xa72b('0x3e')]=_0x850de1[_0xa72b('0x3e')][_0xa72b('0x40')]?_0x850de1['attributes']:_0x4c7318[_0xa72b('0x3a')];if(!_0x3f2b5b[_0xa72b('0x3b')][_0xa72b('0x41')](_0xa72b('0x42'))){_0x850de1[_0xa72b('0x25')]=qs[_0xa72b('0x25')](_0x3f2b5b[_0xa72b('0x3b')][_0xa72b('0x25')]);_0x850de1[_0xa72b('0x24')]=qs[_0xa72b('0x24')](_0x3f2b5b[_0xa72b('0x3b')][_0xa72b('0x24')]);}_0x850de1[_0xa72b('0x43')]=qs[_0xa72b('0x44')](_0x3f2b5b[_0xa72b('0x3b')][_0xa72b('0x44')]);_0x850de1['where']=qs[_0xa72b('0x3c')](_['pick'](_0x3f2b5b[_0xa72b('0x3b')],_0x4c7318[_0xa72b('0x3c')]),_0x37743e);if(_0x3f2b5b[_0xa72b('0x3b')][_0xa72b('0x45')]){_0x850de1[_0xa72b('0x46')]=_[_0xa72b('0x47')](_0x850de1[_0xa72b('0x46')],{'$or':_[_0xa72b('0x35')](_0x37743e,function(_0x3f9239){if(_0x3f9239[_0xa72b('0x38')]!=='VIRTUAL'){var _0x676fef={};_0x676fef[_0x3f9239[_0xa72b('0x32')]]={'$like':'%'+_0x3f2b5b['query'][_0xa72b('0x45')]+'%'};return _0x676fef;}})});}_0x850de1=_[_0xa72b('0x47')]({},_0x850de1,_0x3f2b5b[_0xa72b('0x48')]);var _0x33b480={'where':_0x850de1['where']};return db['Dashboard'][_0xa72b('0x26')](_0x33b480)['then'](function(_0x51bb00){_0x4f19c5[_0xa72b('0x26')]=_0x51bb00;if(_0x3f2b5b[_0xa72b('0x3b')]['includeAll']){_0x850de1['include']=[{'all':!![]}];}return db['Dashboard'][_0xa72b('0x49')](_0x850de1);})['then'](function(_0x4f9f90){_0x4f19c5[_0xa72b('0x4a')]=_0x4f9f90;return _0x4f19c5;})[_0xa72b('0x2b')](respondWithFilteredResult(_0x4816e9,_0x850de1))['catch'](handleError(_0x4816e9,null));};exports[_0xa72b('0x4b')]=function(_0x3968fa,_0x2dc1a8){var _0x25d194={'raw':![],'where':{'id':_0x3968fa[_0xa72b('0x4c')]['id']}},_0x3cc1fb={};_0x3cc1fb[_0xa72b('0x3a')]=_[_0xa72b('0x4d')](db[_0xa72b('0x4e')][_0xa72b('0x36')]);_0x3cc1fb['query']=_[_0xa72b('0x4d')](_0x3968fa[_0xa72b('0x3b')]);_0x3cc1fb[_0xa72b('0x3c')]=_[_0xa72b('0x3d')](_0x3cc1fb[_0xa72b('0x3a')],_0x3cc1fb['query']);_0x25d194[_0xa72b('0x3e')]=_['intersection'](_0x3cc1fb['model'],qs[_0xa72b('0x3f')](_0x3968fa['query'][_0xa72b('0x3f')]));_0x25d194['attributes']=_0x25d194[_0xa72b('0x3e')]['length']?_0x25d194['attributes']:_0x3cc1fb['model'];if(_0x3968fa[_0xa72b('0x3b')][_0xa72b('0x4f')]){_0x25d194[_0xa72b('0x50')]=[{'all':!![]}];}_0x25d194=_[_0xa72b('0x47')]({},_0x25d194,_0x3968fa['options']);return db[_0xa72b('0x4e')][_0xa72b('0x51')](_0x25d194)[_0xa72b('0x2b')](handleEntityNotFound(_0x2dc1a8,null))[_0xa72b('0x2b')](respondWithResult(_0x2dc1a8,null))[_0xa72b('0x52')](handleError(_0x2dc1a8,null));};exports[_0xa72b('0x53')]=function(_0x1860e8,_0x289d3d){return db[_0xa72b('0x4e')][_0xa72b('0x53')](_0x1860e8[_0xa72b('0x54')],{})[_0xa72b('0x2b')](function(_0xcb487e){var _0x1cea77=_0x1860e8[_0xa72b('0x55')][_0xa72b('0x2d')]({'plain':!![]});if(!_0x1cea77)throw new Error(_0xa72b('0x56'));if(_0x1cea77[_0xa72b('0x57')]===_0xa72b('0x55')){var _0x11c588=_0xcb487e[_0xa72b('0x2d')]({'plain':!![]});var _0x3da22d=_0xa72b('0x2e');return db['UserProfileSection'][_0xa72b('0x51')]({'where':{'name':_0x3da22d,'userProfileId':_0x1cea77[_0xa72b('0x58')]},'raw':!![]})[_0xa72b('0x2b')](function(_0x14e6b2){if(_0x14e6b2&&_0x14e6b2[_0xa72b('0x59')]===0x0){return db[_0xa72b('0x2f')]['create']({'name':_0x11c588[_0xa72b('0x32')],'resourceId':_0x11c588['id'],'type':_0x14e6b2[_0xa72b('0x32')],'sectionId':_0x14e6b2['id']},{})[_0xa72b('0x2b')](function(){return _0xcb487e;});}else{return _0xcb487e;}})[_0xa72b('0x52')](function(_0x450a79){logger['error'](_0xa72b('0x5a'),_0x450a79);throw _0x450a79;});}return _0xcb487e;})[_0xa72b('0x2b')](respondWithResult(_0x289d3d,0xc9))['catch'](handleError(_0x289d3d,null));};exports[_0xa72b('0x5b')]=function(_0x87cacf,_0x32c3c2){var _0x56b600={'where':{'id':_0x87cacf[_0xa72b('0x4c')]['id']}},_0x2c41bb={};_0x2c41bb['model']=_[_0xa72b('0x4d')](db['Dashboard'][_0xa72b('0x36')]);_0x56b600[_0xa72b('0x3e')]=_[_0xa72b('0x3d')](_0x2c41bb[_0xa72b('0x3a')],qs[_0xa72b('0x3f')](_0x87cacf[_0xa72b('0x3b')]['fields']));_0x56b600[_0xa72b('0x3e')]=_0x56b600[_0xa72b('0x3e')][_0xa72b('0x40')]?_0x56b600['attributes']:_0x2c41bb[_0xa72b('0x3a')];if(_0x87cacf[_0xa72b('0x3b')][_0xa72b('0x4f')]){_0x56b600[_0xa72b('0x50')]=[{'all':!![]}];}_0x56b600=_[_0xa72b('0x47')]({},_0x56b600,_0x87cacf[_0xa72b('0x48')]);return db[_0xa72b('0x4e')][_0xa72b('0x51')](_0x56b600)[_0xa72b('0x2b')](handleEntityNotFound(_0x32c3c2,null))[_0xa72b('0x2b')](function(_0x2a598d){if(_0x2a598d){var _0x7ef28f=_0x2a598d['get']({'plain':!![]});_0x7ef28f=qs[_0xa72b('0x5c')](_0x7ef28f,['id',_0xa72b('0x5d'),_0xa72b('0x5e')]);_0x87cacf['body']=_[_0xa72b('0x5c')](_0x87cacf[_0xa72b('0x54')],['id',_0xa72b('0x5d'),_0xa72b('0x5e')]);return db[_0xa72b('0x4e')][_0xa72b('0x53')](_[_0xa72b('0x47')](_0x7ef28f,_0x87cacf['body']),{'include':_0x87cacf[_0xa72b('0x3b')][_0xa72b('0x4f')]?[{'all':!![]}]:undefined})[_0xa72b('0x2b')](function(_0x356f3d){var _0x3bc858=_0x87cacf['user'][_0xa72b('0x2d')]({'plain':!![]});if(!_0x3bc858)throw new Error(_0xa72b('0x56'));if(_0x3bc858[_0xa72b('0x57')]==='user'){var _0x93f590=_0x356f3d[_0xa72b('0x2d')]({'plain':!![]});var _0x31cf5a=_0xa72b('0x2e');return db['UserProfileSection'][_0xa72b('0x51')]({'where':{'name':_0x31cf5a,'userProfileId':_0x3bc858[_0xa72b('0x58')]},'raw':!![]})[_0xa72b('0x2b')](function(_0x3ee414){if(_0x3ee414&&_0x3ee414[_0xa72b('0x59')]===0x0){return db[_0xa72b('0x2f')][_0xa72b('0x53')]({'name':_0x93f590[_0xa72b('0x32')],'resourceId':_0x93f590['id'],'type':_0x3ee414[_0xa72b('0x32')],'sectionId':_0x3ee414['id']},{})['then'](function(){return _0x356f3d;});}else{return _0x356f3d;}})[_0xa72b('0x52')](function(_0x3f253b){logger['error'](_0xa72b('0x5a'),_0x3f253b);throw _0x3f253b;});}return _0x356f3d;});}})['then'](respondWithResult(_0x32c3c2,0xc9))[_0xa72b('0x52')](handleError(_0x32c3c2,null));};exports[_0xa72b('0x2a')]=function(_0x466cd7,_0x4c3624){if(_0x466cd7['body']['id']){delete _0x466cd7[_0xa72b('0x54')]['id'];}return db['Dashboard'][_0xa72b('0x51')]({'where':{'id':_0x466cd7[_0xa72b('0x4c')]['id']}})[_0xa72b('0x2b')](handleEntityNotFound(_0x4c3624,null))['then'](saveUpdates(_0x466cd7[_0xa72b('0x54')],null))[_0xa72b('0x2b')](respondWithResult(_0x4c3624,null))['catch'](handleError(_0x4c3624,null));};exports[_0xa72b('0x2c')]=function(_0x20f4fd,_0x111aeb){return db[_0xa72b('0x4e')][_0xa72b('0x51')]({'where':{'id':_0x20f4fd['params']['id']}})[_0xa72b('0x2b')](handleEntityNotFound(_0x111aeb,null))['then'](removeEntity(_0x111aeb,null))[_0xa72b('0x52')](handleError(_0x111aeb,null));};function widgetAttributes(_0x285732){try{switch(_0x285732[_0xa72b('0x38')]){case _0xa72b('0x5f'):return[{'name':_0xa72b('0x60'),'value':_0x285732[_0xa72b('0x60')]||(_0x285732[_0xa72b('0x61')]&&_0x285732['attrs'][0x0]?_0x285732['attrs'][0x0][_0xa72b('0x62')]:undefined)||_0xa72b('0x63')}];case _0xa72b('0x64'):return[{'name':_0xa72b('0x65'),'value':_0x285732[_0xa72b('0x65')]||(_0x285732['attrs']&&_0x285732['attrs'][0x0]?_0x285732[_0xa72b('0x61')][0x0][_0xa72b('0x62')]:undefined)||''}];case _0xa72b('0x66'):return[{'name':_0xa72b('0x67'),'value':_0x285732['attrHourFormat']||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x0]?_0x285732[_0xa72b('0x61')][0x0][_0xa72b('0x62')]:undefined)||'HH:mm:ss'},{'name':_0xa72b('0x68'),'value':_0x285732[_0xa72b('0x68')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x1]?_0x285732['attrs'][0x1][_0xa72b('0x62')]:undefined)||_0xa72b('0x69')},{'name':_0xa72b('0x6a'),'value':_0x285732[_0xa72b('0x6a')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x2]?_0x285732[_0xa72b('0x61')][0x2]['value']:undefined)||0xc}];case _0xa72b('0x6b'):return[{'name':_0xa72b('0x6c'),'value':_0x285732['attrMetric']||(_0x285732[_0xa72b('0x61')]&&_0x285732['attrs'][0x0]?_0x285732[_0xa72b('0x61')][0x0][_0xa72b('0x62')]:undefined)||_0xa72b('0x6d')},{'name':_0xa72b('0x6e'),'value':_0x285732['attrVoiceQueues']||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x1]?_0x285732['attrs'][0x1][_0xa72b('0x62')]:undefined)||[]},{'name':'attrFontSize','value':_0x285732['attrFontSize']||(_0x285732[_0xa72b('0x61')]&&_0x285732['attrs'][0x2]?_0x285732['attrs'][0x2][_0xa72b('0x62')]:undefined)||0x14},{'name':_0xa72b('0x6f'),'value':_0x285732['attrChannel']||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x3]?_0x285732['attrs'][0x3][_0xa72b('0x62')]:undefined)||_0xa72b('0x70')},{'name':_0xa72b('0x71'),'value':_0x285732[_0xa72b('0x71')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x4]?_0x285732[_0xa72b('0x61')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x285732[_0xa72b('0x72')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x5]?_0x285732[_0xa72b('0x61')][0x5][_0xa72b('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x285732[_0xa72b('0x73')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x6]?_0x285732['attrs'][0x6][_0xa72b('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x285732[_0xa72b('0x74')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x7]?_0x285732[_0xa72b('0x61')][0x7][_0xa72b('0x62')]:undefined)||''},{'name':_0xa72b('0x75'),'value':_0x285732['attrWhatsappAccounts']||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x8]?_0x285732[_0xa72b('0x61')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x285732[_0xa72b('0x76')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x9]?_0x285732['attrs'][0x9][_0xa72b('0x62')]:undefined)||''}];case'multibar-chart':case _0xa72b('0x77'):return[{'name':_0xa72b('0x78'),'value':_0x285732[_0xa72b('0x78')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x0]?_0x285732[_0xa72b('0x61')][0x0][_0xa72b('0x62')]:undefined)||_0xa72b('0x6d')},{'name':_0xa72b('0x79'),'value':_0x285732[_0xa72b('0x79')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x1]?_0x285732[_0xa72b('0x61')][0x1][_0xa72b('0x62')]:undefined)||null},{'name':_0xa72b('0x7a'),'value':_0x285732[_0xa72b('0x7a')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x2]?_0x285732[_0xa72b('0x61')][0x2][_0xa72b('0x62')]:undefined)||null},{'name':_0xa72b('0x6e'),'value':_0x285732[_0xa72b('0x6e')]||(_0x285732[_0xa72b('0x61')]&&_0x285732['attrs'][0x3]?_0x285732[_0xa72b('0x61')][0x3][_0xa72b('0x62')]:undefined)||[]},{'name':_0xa72b('0x6f'),'value':_0x285732[_0xa72b('0x6f')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x4]?_0x285732['attrs'][0x4][_0xa72b('0x62')]:undefined)||_0xa72b('0x70')},{'name':_0xa72b('0x71'),'value':_0x285732[_0xa72b('0x71')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x5]?_0x285732[_0xa72b('0x61')][0x5]['value']:undefined)||''},{'name':_0xa72b('0x72'),'value':_0x285732[_0xa72b('0x72')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x6]?_0x285732['attrs'][0x6][_0xa72b('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x285732[_0xa72b('0x73')]||(_0x285732[_0xa72b('0x61')]&&_0x285732['attrs'][0x7]?_0x285732['attrs'][0x7][_0xa72b('0x62')]:undefined)||''},{'name':_0xa72b('0x74'),'value':_0x285732[_0xa72b('0x74')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x8]?_0x285732[_0xa72b('0x61')][0x8][_0xa72b('0x62')]:undefined)||''},{'name':_0xa72b('0x75'),'value':_0x285732[_0xa72b('0x75')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x9]?_0x285732[_0xa72b('0x61')][0x9][_0xa72b('0x62')]:undefined)||''},{'name':_0xa72b('0x76'),'value':_0x285732['attrChatWebsites']||(_0x285732['attrs']&&_0x285732['attrs'][0xa]?_0x285732['attrs'][0xa][_0xa72b('0x62')]:undefined)||''}];case _0xa72b('0x7b'):return[{'name':_0xa72b('0x7c'),'type':_0x285732['reportType']||(_0x285732[_0xa72b('0x61')]&&_0x285732['attrs'][0x0]?_0x285732[_0xa72b('0x61')][0x0]['type']:undefined)||null,'value':_0x285732[_0xa72b('0x7c')]||(_0x285732[_0xa72b('0x61')]&&_0x285732[_0xa72b('0x61')][0x0]?_0x285732[_0xa72b('0x61')][0x0][_0xa72b('0x62')]:undefined)||null},{'name':_0xa72b('0x7d'),'value':_0x285732[_0xa72b('0x7d')]||(_0x285732['attrs']&&_0x285732[_0xa72b('0x61')][0x1]?_0x285732[_0xa72b('0x61')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xc36b2b){logger[_0xa72b('0x30')]('widgetAttributes:\x20%s',JSON['stringify'](_0xc36b2b));return[];}}exports[_0xa72b('0x7e')]=function(_0xf91ad9,_0x41ae8e,_0xe802dc){if(_0xf91ad9[_0xa72b('0x54')]['id']){delete _0xf91ad9[_0xa72b('0x54')]['id'];}return db[_0xa72b('0x4e')][_0xa72b('0x51')]({'where':{'id':_0xf91ad9[_0xa72b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x41ae8e,null))[_0xa72b('0x2b')](function(_0x447bfc){if(_0x447bfc){_0xf91ad9[_0xa72b('0x54')]['DashboardId']=_0x447bfc['id'];_0xf91ad9[_0xa72b('0x54')][_0xa72b('0x61')]=widgetAttributes(_0xf91ad9[_0xa72b('0x54')]);return db[_0xa72b('0x7f')][_0xa72b('0x53')](_0xf91ad9[_0xa72b('0x54')]);}})['then'](respondWithResult(_0x41ae8e,null))[_0xa72b('0x52')](handleError(_0x41ae8e,null));};exports[_0xa72b('0x80')]=function(_0x31c99a,_0x483311,_0x51231a){var _0x108c29={};var _0x28bf90={};var _0x5f3ee5;var _0x2dddc2;return db[_0xa72b('0x4e')][_0xa72b('0x81')]({'where':{'id':_0x31c99a[_0xa72b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x483311,null))[_0xa72b('0x2b')](function(_0x501265){if(_0x501265){_0x5f3ee5=_0x501265;_0x28bf90[_0xa72b('0x3a')]=_['keys'](db[_0xa72b('0x7f')][_0xa72b('0x36')]);_0x28bf90[_0xa72b('0x3b')]=_[_0xa72b('0x4d')](_0x31c99a[_0xa72b('0x3b')]);_0x28bf90[_0xa72b('0x3c')]=_[_0xa72b('0x3d')](_0x28bf90[_0xa72b('0x3a')],_0x28bf90[_0xa72b('0x3b')]);_0x108c29[_0xa72b('0x3e')]=_[_0xa72b('0x3d')](_0x28bf90['model'],qs[_0xa72b('0x3f')](_0x31c99a[_0xa72b('0x3b')][_0xa72b('0x3f')]));_0x108c29[_0xa72b('0x3e')]=_0x108c29['attributes']['length']?_0x108c29['attributes']:_0x28bf90[_0xa72b('0x3a')];_0x108c29['order']=qs['sort'](_0x31c99a[_0xa72b('0x3b')][_0xa72b('0x44')]);_0x108c29[_0xa72b('0x46')]=qs[_0xa72b('0x3c')](_[_0xa72b('0x82')](_0x31c99a[_0xa72b('0x3b')],_0x28bf90['filters']));if(_0x31c99a[_0xa72b('0x3b')]['filter']){_0x108c29[_0xa72b('0x46')]=_[_0xa72b('0x47')](_0x108c29[_0xa72b('0x46')],{'$or':_['map'](_0x108c29[_0xa72b('0x3e')],function(_0x45193e){var _0x8d4e9d={};_0x8d4e9d[_0x45193e]={'$like':'%'+_0x31c99a[_0xa72b('0x3b')]['filter']+'%'};return _0x8d4e9d;})});}_0x108c29=_[_0xa72b('0x47')]({},_0x108c29,_0x31c99a[_0xa72b('0x48')]);return _0x5f3ee5[_0xa72b('0x80')](_0x108c29);}})[_0xa72b('0x2b')](function(_0x46e35e){if(_0x46e35e){_0x2dddc2=_0x46e35e[_0xa72b('0x40')];if(!_0x31c99a[_0xa72b('0x3b')][_0xa72b('0x41')](_0xa72b('0x42'))){_0x108c29[_0xa72b('0x25')]=qs[_0xa72b('0x25')](_0x31c99a[_0xa72b('0x3b')][_0xa72b('0x25')]);_0x108c29['offset']=qs['offset'](_0x31c99a[_0xa72b('0x3b')][_0xa72b('0x24')]);}return _0x5f3ee5['getItems'](_0x108c29);}})[_0xa72b('0x2b')](function(_0x10d668){if(_0x10d668){return _0x10d668?{'count':_0x2dddc2,'rows':_0x10d668}:null;}})['then'](respondWithResult(_0x483311,null))[_0xa72b('0x52')](handleError(_0x483311,null));}; \ No newline at end of file +var _0xd5d1=['sendStatus','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','params','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource'];(function(_0x4a3bb8,_0x126fae){var _0xa4e1e6=function(_0x1d4796){while(--_0x1d4796){_0x4a3bb8['push'](_0x4a3bb8['shift']());}};_0xa4e1e6(++_0x126fae);}(_0xd5d1,0x15f));var _0x1d5d=function(_0x4ef71a,_0x86d437){_0x4ef71a=_0x4ef71a-0x0;var _0x10a97c=_0xd5d1[_0x4ef71a];return _0x10a97c;};'use strict';var emlformat=require(_0x1d5d('0x0'));var rimraf=require(_0x1d5d('0x1'));var zipdir=require(_0x1d5d('0x2'));var jsonpatch=require(_0x1d5d('0x3'));var rp=require(_0x1d5d('0x4'));var moment=require(_0x1d5d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d5d('0x6'));var path=require('path');var sox=require(_0x1d5d('0x7'));var csv=require(_0x1d5d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d5d('0x9'));var _=require(_0x1d5d('0xa'));var squel=require(_0x1d5d('0xb'));var crypto=require(_0x1d5d('0xc'));var jsforce=require(_0x1d5d('0xd'));var deskjs=require(_0x1d5d('0xe'));var toCsv=require(_0x1d5d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d5d('0xf'));var authService=require(_0x1d5d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d5d('0x11'));var logger=require(_0x1d5d('0x12'))(_0x1d5d('0x13'));var utils=require(_0x1d5d('0x14'));var config=require(_0x1d5d('0x15'));var licenseUtil=require(_0x1d5d('0x16'));var db=require(_0x1d5d('0x17'))['db'];config['redis']=_[_0x1d5d('0x18')](config[_0x1d5d('0x19')],{'host':_0x1d5d('0x1a'),'port':0x18eb});var socket=require(_0x1d5d('0x1b'))(new Redis(config[_0x1d5d('0x19')]));require(_0x1d5d('0x1c'))[_0x1d5d('0x1d')](socket);function respondWithStatusCode(_0x519cb1,_0x3ef6f8){_0x3ef6f8=_0x3ef6f8||0xcc;return function(_0x41f740){if(_0x41f740){return _0x519cb1['sendStatus'](_0x3ef6f8);}return _0x519cb1[_0x1d5d('0x1e')](_0x3ef6f8)[_0x1d5d('0x1f')]();};}function respondWithResult(_0x3302fb,_0x4c5c66){_0x4c5c66=_0x4c5c66||0xc8;return function(_0x26c833){if(_0x26c833){return _0x3302fb['status'](_0x4c5c66)[_0x1d5d('0x20')](_0x26c833);}};}function respondWithFilteredResult(_0x5ef376,_0x1ed5d3){return function(_0x248220){if(_0x248220){var _0x3d6762=typeof _0x1ed5d3['offset']===_0x1d5d('0x21')&&typeof _0x1ed5d3['limit']===_0x1d5d('0x21');var _0x2f7293=_0x248220[_0x1d5d('0x22')];var _0x3b22bc=_0x3d6762?0x0:_0x1ed5d3['offset'];var _0x4c8621=_0x3d6762?_0x248220[_0x1d5d('0x22')]:_0x1ed5d3['offset']+_0x1ed5d3[_0x1d5d('0x23')];var _0xde0ac4;if(_0x4c8621>=_0x2f7293){_0x4c8621=_0x2f7293;_0xde0ac4=0xc8;}else{_0xde0ac4=0xce;}_0x5ef376['status'](_0xde0ac4);return _0x5ef376[_0x1d5d('0x24')](_0x1d5d('0x25'),_0x3b22bc+'-'+_0x4c8621+'/'+_0x2f7293)[_0x1d5d('0x20')](_0x248220);}return null;};}function patchUpdates(_0x167db8){return function(_0x48712b){try{jsonpatch[_0x1d5d('0x26')](_0x48712b,_0x167db8,!![]);}catch(_0x35ca11){return BPromise[_0x1d5d('0x27')](_0x35ca11);}return _0x48712b[_0x1d5d('0x28')]();};}function saveUpdates(_0x196a44,_0xb24693){return function(_0x284b2f){if(_0x284b2f){return _0x284b2f[_0x1d5d('0x29')](_0x196a44)[_0x1d5d('0x2a')](function(_0x1983a9){return _0x1983a9;});}return null;};}function removeEntity(_0x2f0ba0,_0x56389f){return function(_0x1cbe10){if(_0x1cbe10){return _0x1cbe10['destroy']()[_0x1d5d('0x2a')](function(){var _0x205b05=_0x1cbe10[_0x1d5d('0x2b')]({'plain':!![]});var _0x170724='CustomDashboards';return db[_0x1d5d('0x2c')]['destroy']({'where':{'type':_0x170724,'resourceId':_0x205b05['id']}})[_0x1d5d('0x2a')](function(){return _0x1cbe10;});})[_0x1d5d('0x2a')](function(){_0x2f0ba0[_0x1d5d('0x1e')](0xcc)[_0x1d5d('0x1f')]();});}};}function handleEntityNotFound(_0x2f51ed,_0x1e1811){return function(_0x5dbc32){if(!_0x5dbc32){_0x2f51ed[_0x1d5d('0x2d')](0x194);}return _0x5dbc32;};}function handleError(_0x3a0c9e,_0x2af5b4){_0x2af5b4=_0x2af5b4||0x1f4;return function(_0x40c094){logger[_0x1d5d('0x2e')](_0x40c094[_0x1d5d('0x2f')]);if(_0x40c094['name']){delete _0x40c094[_0x1d5d('0x30')];}_0x3a0c9e['status'](_0x2af5b4)[_0x1d5d('0x31')](_0x40c094);};}exports[_0x1d5d('0x32')]=function(_0x1d5655,_0x393529){var _0x434d71={},_0x38a85a={},_0x5974e8={'count':0x0,'rows':[]};var _0x2a713f=_['map'](db[_0x1d5d('0x33')][_0x1d5d('0x34')],function(_0x2410ba){return{'name':_0x2410ba[_0x1d5d('0x35')],'type':_0x2410ba[_0x1d5d('0x36')][_0x1d5d('0x37')]};});_0x38a85a[_0x1d5d('0x38')]=_[_0x1d5d('0x39')](_0x2a713f,_0x1d5d('0x30'));_0x38a85a[_0x1d5d('0x3a')]=_[_0x1d5d('0x3b')](_0x1d5655[_0x1d5d('0x3a')]);_0x38a85a[_0x1d5d('0x3c')]=_[_0x1d5d('0x3d')](_0x38a85a[_0x1d5d('0x38')],_0x38a85a[_0x1d5d('0x3a')]);_0x434d71[_0x1d5d('0x3e')]=_[_0x1d5d('0x3d')](_0x38a85a[_0x1d5d('0x38')],qs[_0x1d5d('0x3f')](_0x1d5655['query']['fields']));_0x434d71[_0x1d5d('0x3e')]=_0x434d71[_0x1d5d('0x3e')][_0x1d5d('0x40')]?_0x434d71[_0x1d5d('0x3e')]:_0x38a85a[_0x1d5d('0x38')];if(!_0x1d5655[_0x1d5d('0x3a')]['hasOwnProperty']('nolimit')){_0x434d71[_0x1d5d('0x23')]=qs['limit'](_0x1d5655[_0x1d5d('0x3a')][_0x1d5d('0x23')]);_0x434d71['offset']=qs[_0x1d5d('0x41')](_0x1d5655[_0x1d5d('0x3a')][_0x1d5d('0x41')]);}_0x434d71[_0x1d5d('0x42')]=qs[_0x1d5d('0x43')](_0x1d5655['query'][_0x1d5d('0x43')]);_0x434d71[_0x1d5d('0x44')]=qs[_0x1d5d('0x3c')](_[_0x1d5d('0x45')](_0x1d5655[_0x1d5d('0x3a')],_0x38a85a['filters']),_0x2a713f);if(_0x1d5655[_0x1d5d('0x3a')][_0x1d5d('0x46')]){_0x434d71[_0x1d5d('0x44')]=_['merge'](_0x434d71[_0x1d5d('0x44')],{'$or':_['map'](_0x2a713f,function(_0x4b375c){if(_0x4b375c[_0x1d5d('0x36')]!==_0x1d5d('0x47')){var _0x5c3905={};_0x5c3905[_0x4b375c[_0x1d5d('0x30')]]={'$like':'%'+_0x1d5655[_0x1d5d('0x3a')][_0x1d5d('0x46')]+'%'};return _0x5c3905;}})});}_0x434d71=_[_0x1d5d('0x48')]({},_0x434d71,_0x1d5655[_0x1d5d('0x49')]);var _0x27bfaf={'where':_0x434d71[_0x1d5d('0x44')]};return db[_0x1d5d('0x33')]['count'](_0x27bfaf)[_0x1d5d('0x2a')](function(_0x50bfd2){_0x5974e8[_0x1d5d('0x22')]=_0x50bfd2;if(_0x1d5655[_0x1d5d('0x3a')][_0x1d5d('0x4a')]){_0x434d71[_0x1d5d('0x4b')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x434d71);})[_0x1d5d('0x2a')](function(_0x58cbc0){_0x5974e8[_0x1d5d('0x4c')]=_0x58cbc0;return _0x5974e8;})['then'](respondWithFilteredResult(_0x393529,_0x434d71))['catch'](handleError(_0x393529,null));};exports[_0x1d5d('0x4d')]=function(_0x413702,_0x13b84a){var _0x554fb7={'raw':![],'where':{'id':_0x413702['params']['id']}},_0xfa2d7d={};_0xfa2d7d[_0x1d5d('0x38')]=_['keys'](db[_0x1d5d('0x33')][_0x1d5d('0x34')]);_0xfa2d7d[_0x1d5d('0x3a')]=_[_0x1d5d('0x3b')](_0x413702['query']);_0xfa2d7d[_0x1d5d('0x3c')]=_['intersection'](_0xfa2d7d[_0x1d5d('0x38')],_0xfa2d7d['query']);_0x554fb7['attributes']=_[_0x1d5d('0x3d')](_0xfa2d7d[_0x1d5d('0x38')],qs[_0x1d5d('0x3f')](_0x413702[_0x1d5d('0x3a')]['fields']));_0x554fb7[_0x1d5d('0x3e')]=_0x554fb7[_0x1d5d('0x3e')][_0x1d5d('0x40')]?_0x554fb7['attributes']:_0xfa2d7d[_0x1d5d('0x38')];if(_0x413702[_0x1d5d('0x3a')]['includeAll']){_0x554fb7[_0x1d5d('0x4b')]=[{'all':!![]}];}_0x554fb7=_[_0x1d5d('0x48')]({},_0x554fb7,_0x413702['options']);return db['Dashboard'][_0x1d5d('0x4e')](_0x554fb7)[_0x1d5d('0x2a')](handleEntityNotFound(_0x13b84a,null))[_0x1d5d('0x2a')](respondWithResult(_0x13b84a,null))[_0x1d5d('0x4f')](handleError(_0x13b84a,null));};exports['create']=function(_0x53c0ca,_0x1ac2cf){return db['Dashboard'][_0x1d5d('0x50')](_0x53c0ca[_0x1d5d('0x51')],{})[_0x1d5d('0x2a')](function(_0x5ada3a){var _0x6c4fbf=_0x53c0ca[_0x1d5d('0x52')][_0x1d5d('0x2b')]({'plain':!![]});if(!_0x6c4fbf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6c4fbf['role']===_0x1d5d('0x52')){var _0x1eea70=_0x5ada3a['get']({'plain':!![]});var _0x31b71c=_0x1d5d('0x53');return db[_0x1d5d('0x54')][_0x1d5d('0x4e')]({'where':{'name':_0x31b71c,'userProfileId':_0x6c4fbf[_0x1d5d('0x55')]},'raw':!![]})['then'](function(_0x527a51){if(_0x527a51&&_0x527a51[_0x1d5d('0x56')]===0x0){return db['UserProfileResource'][_0x1d5d('0x50')]({'name':_0x1eea70[_0x1d5d('0x30')],'resourceId':_0x1eea70['id'],'type':_0x527a51[_0x1d5d('0x30')],'sectionId':_0x527a51['id']},{})[_0x1d5d('0x2a')](function(){return _0x5ada3a;});}else{return _0x5ada3a;}})[_0x1d5d('0x4f')](function(_0x1acba8){logger[_0x1d5d('0x2e')](_0x1d5d('0x57'),_0x1acba8);throw _0x1acba8;});}return _0x5ada3a;})[_0x1d5d('0x2a')](respondWithResult(_0x1ac2cf,0xc9))[_0x1d5d('0x4f')](handleError(_0x1ac2cf,null));};exports[_0x1d5d('0x58')]=function(_0x4ce519,_0x1df4bb){var _0x38e019={'where':{'id':_0x4ce519['params']['id']}},_0x5ae05d={};_0x5ae05d[_0x1d5d('0x38')]=_[_0x1d5d('0x3b')](db[_0x1d5d('0x33')][_0x1d5d('0x34')]);_0x38e019[_0x1d5d('0x3e')]=_[_0x1d5d('0x3d')](_0x5ae05d[_0x1d5d('0x38')],qs[_0x1d5d('0x3f')](_0x4ce519['query'][_0x1d5d('0x3f')]));_0x38e019['attributes']=_0x38e019[_0x1d5d('0x3e')][_0x1d5d('0x40')]?_0x38e019[_0x1d5d('0x3e')]:_0x5ae05d[_0x1d5d('0x38')];if(_0x4ce519[_0x1d5d('0x3a')][_0x1d5d('0x4a')]){_0x38e019['include']=[{'all':!![]}];}_0x38e019=_[_0x1d5d('0x48')]({},_0x38e019,_0x4ce519[_0x1d5d('0x49')]);return db[_0x1d5d('0x33')][_0x1d5d('0x4e')](_0x38e019)[_0x1d5d('0x2a')](handleEntityNotFound(_0x1df4bb,null))[_0x1d5d('0x2a')](function(_0x2a3c02){if(_0x2a3c02){var _0x447cf4=_0x2a3c02[_0x1d5d('0x2b')]({'plain':!![]});_0x447cf4=qs[_0x1d5d('0x59')](_0x447cf4,['id',_0x1d5d('0x5a'),'updatedAt']);_0x4ce519[_0x1d5d('0x51')]=_[_0x1d5d('0x59')](_0x4ce519['body'],['id',_0x1d5d('0x5a'),'updatedAt']);return db[_0x1d5d('0x33')][_0x1d5d('0x50')](_[_0x1d5d('0x48')](_0x447cf4,_0x4ce519[_0x1d5d('0x51')]),{'include':_0x4ce519[_0x1d5d('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x1d5d('0x2a')](function(_0x5b1f88){var _0x2493c7=_0x4ce519[_0x1d5d('0x52')]['get']({'plain':!![]});if(!_0x2493c7)throw new Error(_0x1d5d('0x5b'));if(_0x2493c7[_0x1d5d('0x5c')]===_0x1d5d('0x52')){var _0x1ab643=_0x5b1f88['get']({'plain':!![]});var _0x31e3a8='CustomDashboards';return db['UserProfileSection'][_0x1d5d('0x4e')]({'where':{'name':_0x31e3a8,'userProfileId':_0x2493c7[_0x1d5d('0x55')]},'raw':!![]})[_0x1d5d('0x2a')](function(_0x532006){if(_0x532006&&_0x532006[_0x1d5d('0x56')]===0x0){return db['UserProfileResource'][_0x1d5d('0x50')]({'name':_0x1ab643['name'],'resourceId':_0x1ab643['id'],'type':_0x532006[_0x1d5d('0x30')],'sectionId':_0x532006['id']},{})[_0x1d5d('0x2a')](function(){return _0x5b1f88;});}else{return _0x5b1f88;}})['catch'](function(_0x25def5){logger[_0x1d5d('0x2e')](_0x1d5d('0x57'),_0x25def5);throw _0x25def5;});}return _0x5b1f88;});}})[_0x1d5d('0x2a')](respondWithResult(_0x1df4bb,0xc9))[_0x1d5d('0x4f')](handleError(_0x1df4bb,null));};exports[_0x1d5d('0x29')]=function(_0x269aa2,_0x7ac766){if(_0x269aa2['body']['id']){delete _0x269aa2[_0x1d5d('0x51')]['id'];}return db[_0x1d5d('0x33')][_0x1d5d('0x4e')]({'where':{'id':_0x269aa2[_0x1d5d('0x5d')]['id']}})[_0x1d5d('0x2a')](handleEntityNotFound(_0x7ac766,null))[_0x1d5d('0x2a')](saveUpdates(_0x269aa2['body'],null))[_0x1d5d('0x2a')](respondWithResult(_0x7ac766,null))[_0x1d5d('0x4f')](handleError(_0x7ac766,null));};exports['destroy']=function(_0x1cd0bc,_0x2242c7){return db[_0x1d5d('0x33')][_0x1d5d('0x4e')]({'where':{'id':_0x1cd0bc['params']['id']}})['then'](handleEntityNotFound(_0x2242c7,null))['then'](removeEntity(_0x2242c7,null))[_0x1d5d('0x4f')](handleError(_0x2242c7,null));};function widgetAttributes(_0x5a4c4d){try{switch(_0x5a4c4d[_0x1d5d('0x36')]){case'iframe':return[{'name':_0x1d5d('0x5e'),'value':_0x5a4c4d[_0x1d5d('0x5e')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x0]?_0x5a4c4d['attrs'][0x0][_0x1d5d('0x60')]:undefined)||_0x1d5d('0x61')}];case'custom':return[{'name':_0x1d5d('0x62'),'value':_0x5a4c4d[_0x1d5d('0x62')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x0]?_0x5a4c4d[_0x1d5d('0x5f')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x1d5d('0x63'),'value':_0x5a4c4d[_0x1d5d('0x63')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x0]?_0x5a4c4d[_0x1d5d('0x5f')][0x0][_0x1d5d('0x60')]:undefined)||_0x1d5d('0x64')},{'name':_0x1d5d('0x65'),'value':_0x5a4c4d[_0x1d5d('0x65')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x1]?_0x5a4c4d[_0x1d5d('0x5f')][0x1][_0x1d5d('0x60')]:undefined)||_0x1d5d('0x66')},{'name':_0x1d5d('0x67'),'value':_0x5a4c4d[_0x1d5d('0x67')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x2]?_0x5a4c4d[_0x1d5d('0x5f')][0x2]['value']:undefined)||0xc}];case _0x1d5d('0x68'):return[{'name':_0x1d5d('0x69'),'value':_0x5a4c4d[_0x1d5d('0x69')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x0]?_0x5a4c4d[_0x1d5d('0x5f')][0x0]['value']:undefined)||_0x1d5d('0x6a')},{'name':_0x1d5d('0x6b'),'value':_0x5a4c4d[_0x1d5d('0x6b')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x1]?_0x5a4c4d[_0x1d5d('0x5f')][0x1][_0x1d5d('0x60')]:undefined)||[]},{'name':_0x1d5d('0x67'),'value':_0x5a4c4d[_0x1d5d('0x67')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x2]?_0x5a4c4d[_0x1d5d('0x5f')][0x2]['value']:undefined)||0x14},{'name':_0x1d5d('0x6c'),'value':_0x5a4c4d[_0x1d5d('0x6c')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x3]?_0x5a4c4d['attrs'][0x3][_0x1d5d('0x60')]:undefined)||_0x1d5d('0x6d')},{'name':_0x1d5d('0x6e'),'value':_0x5a4c4d[_0x1d5d('0x6e')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x4]?_0x5a4c4d[_0x1d5d('0x5f')][0x4][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x6f'),'value':_0x5a4c4d['attrFaxAccounts']||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x5]?_0x5a4c4d[_0x1d5d('0x5f')][0x5][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x70'),'value':_0x5a4c4d[_0x1d5d('0x70')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x6]?_0x5a4c4d['attrs'][0x6][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x71'),'value':_0x5a4c4d['attrOpenchannelAccounts']||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x7]?_0x5a4c4d[_0x1d5d('0x5f')][0x7][_0x1d5d('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5a4c4d[_0x1d5d('0x72')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x8]?_0x5a4c4d[_0x1d5d('0x5f')][0x8][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x73'),'value':_0x5a4c4d['attrChatWebsites']||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x9]?_0x5a4c4d['attrs'][0x9][_0x1d5d('0x60')]:undefined)||''}];case'multibar-chart':case _0x1d5d('0x74'):return[{'name':'attrSerie1','value':_0x5a4c4d[_0x1d5d('0x75')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d['attrs'][0x0]?_0x5a4c4d[_0x1d5d('0x5f')][0x0]['value']:undefined)||_0x1d5d('0x6a')},{'name':_0x1d5d('0x76'),'value':_0x5a4c4d[_0x1d5d('0x76')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x1]?_0x5a4c4d[_0x1d5d('0x5f')][0x1][_0x1d5d('0x60')]:undefined)||null},{'name':_0x1d5d('0x77'),'value':_0x5a4c4d[_0x1d5d('0x77')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x2]?_0x5a4c4d[_0x1d5d('0x5f')][0x2][_0x1d5d('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5a4c4d['attrVoiceQueues']||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x3]?_0x5a4c4d[_0x1d5d('0x5f')][0x3]['value']:undefined)||[]},{'name':_0x1d5d('0x6c'),'value':_0x5a4c4d[_0x1d5d('0x6c')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x4]?_0x5a4c4d[_0x1d5d('0x5f')][0x4][_0x1d5d('0x60')]:undefined)||'voice'},{'name':_0x1d5d('0x6e'),'value':_0x5a4c4d[_0x1d5d('0x6e')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x5]?_0x5a4c4d[_0x1d5d('0x5f')][0x5]['value']:undefined)||''},{'name':_0x1d5d('0x6f'),'value':_0x5a4c4d[_0x1d5d('0x6f')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x6]?_0x5a4c4d[_0x1d5d('0x5f')][0x6][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x70'),'value':_0x5a4c4d[_0x1d5d('0x70')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x7]?_0x5a4c4d[_0x1d5d('0x5f')][0x7][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x71'),'value':_0x5a4c4d[_0x1d5d('0x71')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x8]?_0x5a4c4d[_0x1d5d('0x5f')][0x8]['value']:undefined)||''},{'name':_0x1d5d('0x72'),'value':_0x5a4c4d['attrWhatsappAccounts']||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x9]?_0x5a4c4d[_0x1d5d('0x5f')][0x9][_0x1d5d('0x60')]:undefined)||''},{'name':_0x1d5d('0x73'),'value':_0x5a4c4d[_0x1d5d('0x73')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d['attrs'][0xa]?_0x5a4c4d[_0x1d5d('0x5f')][0xa]['value']:undefined)||''}];case _0x1d5d('0x78'):return[{'name':_0x1d5d('0x79'),'type':_0x5a4c4d[_0x1d5d('0x7a')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x0]?_0x5a4c4d['attrs'][0x0]['type']:undefined)||null,'value':_0x5a4c4d[_0x1d5d('0x79')]||(_0x5a4c4d[_0x1d5d('0x5f')]&&_0x5a4c4d[_0x1d5d('0x5f')][0x0]?_0x5a4c4d[_0x1d5d('0x5f')][0x0][_0x1d5d('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x5a4c4d[_0x1d5d('0x7b')]||(_0x5a4c4d['attrs']&&_0x5a4c4d[_0x1d5d('0x5f')][0x1]?_0x5a4c4d[_0x1d5d('0x5f')][0x1][_0x1d5d('0x60')]:undefined)||0x0}];default:return[];}}catch(_0xc7582c){logger[_0x1d5d('0x2e')](_0x1d5d('0x7c'),JSON[_0x1d5d('0x7d')](_0xc7582c));return[];}}exports[_0x1d5d('0x7e')]=function(_0x3ac671,_0x2ba0bf,_0x37a560){if(_0x3ac671[_0x1d5d('0x51')]['id']){delete _0x3ac671[_0x1d5d('0x51')]['id'];}return db[_0x1d5d('0x33')][_0x1d5d('0x4e')]({'where':{'id':_0x3ac671[_0x1d5d('0x5d')]['id']}})[_0x1d5d('0x2a')](handleEntityNotFound(_0x2ba0bf,null))['then'](function(_0x3e0c97){if(_0x3e0c97){_0x3ac671[_0x1d5d('0x51')]['DashboardId']=_0x3e0c97['id'];_0x3ac671[_0x1d5d('0x51')]['attrs']=widgetAttributes(_0x3ac671[_0x1d5d('0x51')]);return db[_0x1d5d('0x7f')][_0x1d5d('0x50')](_0x3ac671[_0x1d5d('0x51')]);}})[_0x1d5d('0x2a')](respondWithResult(_0x2ba0bf,null))[_0x1d5d('0x4f')](handleError(_0x2ba0bf,null));};exports[_0x1d5d('0x80')]=function(_0x22c3a0,_0x1aee2c,_0x1e34ee){var _0x58c840={};var _0x6e8114={};var _0x45828c;var _0x28e1d8;return db[_0x1d5d('0x33')][_0x1d5d('0x81')]({'where':{'id':_0x22c3a0['params']['id']}})[_0x1d5d('0x2a')](handleEntityNotFound(_0x1aee2c,null))['then'](function(_0x4f6f33){if(_0x4f6f33){_0x45828c=_0x4f6f33;_0x6e8114[_0x1d5d('0x38')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x6e8114['query']=_[_0x1d5d('0x3b')](_0x22c3a0['query']);_0x6e8114[_0x1d5d('0x3c')]=_[_0x1d5d('0x3d')](_0x6e8114[_0x1d5d('0x38')],_0x6e8114['query']);_0x58c840[_0x1d5d('0x3e')]=_['intersection'](_0x6e8114[_0x1d5d('0x38')],qs[_0x1d5d('0x3f')](_0x22c3a0['query'][_0x1d5d('0x3f')]));_0x58c840[_0x1d5d('0x3e')]=_0x58c840[_0x1d5d('0x3e')][_0x1d5d('0x40')]?_0x58c840[_0x1d5d('0x3e')]:_0x6e8114[_0x1d5d('0x38')];_0x58c840['order']=qs['sort'](_0x22c3a0[_0x1d5d('0x3a')][_0x1d5d('0x43')]);_0x58c840[_0x1d5d('0x44')]=qs[_0x1d5d('0x3c')](_[_0x1d5d('0x45')](_0x22c3a0[_0x1d5d('0x3a')],_0x6e8114['filters']));if(_0x22c3a0[_0x1d5d('0x3a')]['filter']){_0x58c840[_0x1d5d('0x44')]=_[_0x1d5d('0x48')](_0x58c840[_0x1d5d('0x44')],{'$or':_[_0x1d5d('0x39')](_0x58c840[_0x1d5d('0x3e')],function(_0x43d12e){var _0xad3286={};_0xad3286[_0x43d12e]={'$like':'%'+_0x22c3a0['query']['filter']+'%'};return _0xad3286;})});}_0x58c840=_[_0x1d5d('0x48')]({},_0x58c840,_0x22c3a0['options']);return _0x45828c['getItems'](_0x58c840);}})['then'](function(_0x2d852e){if(_0x2d852e){_0x28e1d8=_0x2d852e[_0x1d5d('0x40')];if(!_0x22c3a0[_0x1d5d('0x3a')][_0x1d5d('0x82')](_0x1d5d('0x83'))){_0x58c840[_0x1d5d('0x23')]=qs[_0x1d5d('0x23')](_0x22c3a0[_0x1d5d('0x3a')][_0x1d5d('0x23')]);_0x58c840['offset']=qs[_0x1d5d('0x41')](_0x22c3a0['query']['offset']);}return _0x45828c['getItems'](_0x58c840);}})[_0x1d5d('0x2a')](function(_0x334eb2){if(_0x334eb2){return _0x334eb2?{'count':_0x28e1d8,'rows':_0x334eb2}:null;}})[_0x1d5d('0x2a')](respondWithResult(_0x1aee2c,null))[_0x1d5d('0x4f')](handleError(_0x1aee2c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1460d7c..b67d87c 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 _0xd420=['update','remove','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x46b6f7,_0x281386){var _0x42675d=function(_0x426271){while(--_0x426271){_0x46b6f7['push'](_0x46b6f7['shift']());}};_0x42675d(++_0x281386);}(_0xd420,0x89));var _0x0d42=function(_0x7e2049,_0x3d6273){_0x7e2049=_0x7e2049-0x0;var _0x47543d=_0xd420[_0x7e2049];return _0x47543d;};'use strict';var EventEmitter=require(_0x0d42('0x0'));var Dashboard=require(_0x0d42('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0d42('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d42('0x3'),'afterDestroy':_0x0d42('0x4')};function emitEvent(_0x2c3b8e){return function(_0x343231,_0x2c4c49,_0x3f6ae3){DashboardEvents['emit'](_0x2c3b8e+':'+_0x343231['id'],_0x343231);DashboardEvents['emit'](_0x2c3b8e,_0x343231);_0x3f6ae3(null);};}for(var e in events){if(events[_0x0d42('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x0d42('0x6')]=DashboardEvents; \ No newline at end of file +var _0x64cb=['save','remove','emit','hook','exports','../../mysqldb','Dashboard'];(function(_0x6904ea,_0x4e3f8e){var _0x45e783=function(_0x25dcc3){while(--_0x25dcc3){_0x6904ea['push'](_0x6904ea['shift']());}};_0x45e783(++_0x4e3f8e);}(_0x64cb,0x163));var _0xb64c=function(_0x135112,_0x1b20b9){_0x135112=_0x135112-0x0;var _0x22dfb9=_0x64cb[_0x135112];return _0x22dfb9;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xb64c('0x0'))['db'][_0xb64c('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb64c('0x2'),'afterUpdate':'update','afterDestroy':_0xb64c('0x3')};function emitEvent(_0x1c32f5){return function(_0x375929,_0x48aeca,_0x591f24){DashboardEvents[_0xb64c('0x4')](_0x1c32f5+':'+_0x375929['id'],_0x375929);DashboardEvents['emit'](_0x1c32f5,_0x375929);_0x591f24(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xb64c('0x5')](e,emitEvent(event));}}module[_0xb64c('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5d92f0d..30876fa 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 _0x691a=['moment','bluebird','request-promise','path','rimraf','exports','define','Dashboard','dashboards','lodash','util','api'];(function(_0x2a9a61,_0x2c1ce2){var _0x5a12de=function(_0x37e4f4){while(--_0x37e4f4){_0x2a9a61['push'](_0x2a9a61['shift']());}};_0x5a12de(++_0x2c1ce2);}(_0x691a,0xed));var _0xa691=function(_0x9535d4,_0x10f219){_0x9535d4=_0x9535d4-0x0;var _0x4081ae=_0x691a[_0x9535d4];return _0x4081ae;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var logger=require('../../config/logger')(_0xa691('0x2'));var moment=require(_0xa691('0x3'));var BPromise=require(_0xa691('0x4'));var rp=require(_0xa691('0x5'));var fs=require('fs');var path=require(_0xa691('0x6'));var rimraf=require(_0xa691('0x7'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0xa691('0x8')]=function(_0x13fcd8,_0x991e88){return _0x13fcd8[_0xa691('0x9')](_0xa691('0xa'),attributes,{'tableName':_0xa691('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc041=['path','rimraf','../../config/environment','./dashboard.attributes','Dashboard','dashboards','lodash','util','api','bluebird','request-promise'];(function(_0x2d357a,_0x71186e){var _0x3de81a=function(_0x6f9e4){while(--_0x6f9e4){_0x2d357a['push'](_0x2d357a['shift']());}};_0x3de81a(++_0x71186e);}(_0xc041,0x1ea));var _0x1c04=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xc041[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var logger=require('../../config/logger')(_0x1c04('0x2'));var moment=require('moment');var BPromise=require(_0x1c04('0x3'));var rp=require(_0x1c04('0x4'));var fs=require('fs');var path=require(_0x1c04('0x5'));var rimraf=require(_0x1c04('0x6'));var config=require(_0x1c04('0x7'));var attributes=require(_0x1c04('0x8'));module['exports']=function(_0x2a7bb2,_0x5acee0){return _0x2a7bb2['define'](_0x1c04('0x9'),attributes,{'tableName':_0x1c04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index cdd772a..f982fb8 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 _0x4bce=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4bce,0x1e5));var _0xe4bc=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0x4bce[_0x3dfeb9];return _0x412314;};'use strict';var _=require(_0xe4bc('0x0'));var util=require(_0xe4bc('0x1'));var moment=require(_0xe4bc('0x2'));var BPromise=require(_0xe4bc('0x3'));var rs=require(_0xe4bc('0x4'));var fs=require('fs');var Redis=require(_0xe4bc('0x5'));var db=require(_0xe4bc('0x6'))['db'];var utils=require(_0xe4bc('0x7'));var logger=require(_0xe4bc('0x8'))(_0xe4bc('0x9'));var config=require('../../config/environment');var jayson=require(_0xe4bc('0xa'));var client=jayson[_0xe4bc('0xb')][_0xe4bc('0xc')]({'port':0x232a});config[_0xe4bc('0xd')]=_[_0xe4bc('0xe')](config[_0xe4bc('0xd')],{'host':_0xe4bc('0xf'),'port':0x18eb});var socket=require(_0xe4bc('0x10'))(new Redis(config[_0xe4bc('0xd')]));require('./dashboard.socket')[_0xe4bc('0x11')](socket);function respondWithRpcPromise(_0x3fc275,_0xeb3f70,_0x4845dc){return new BPromise(function(_0x302f58,_0x529cdd){return client[_0xe4bc('0x12')](_0x3fc275,_0x4845dc)[_0xe4bc('0x13')](function(_0x77bd87){logger['info'](_0xe4bc('0x14'),_0xeb3f70,_0xe4bc('0x15'));logger[_0xe4bc('0x16')](_0xe4bc('0x17'),_0xeb3f70,_0xe4bc('0x15'),JSON['stringify'](_0x77bd87));if(_0x77bd87[_0xe4bc('0x18')]){if(_0x77bd87[_0xe4bc('0x18')][_0xe4bc('0x19')]===0x1f4){logger[_0xe4bc('0x18')]('Dashboard,\x20%s,\x20%s',_0xeb3f70,_0x77bd87[_0xe4bc('0x18')][_0xe4bc('0x1a')]);return _0x529cdd(_0x77bd87[_0xe4bc('0x18')][_0xe4bc('0x1a')]);}logger[_0xe4bc('0x18')]('Dashboard,\x20%s,\x20%s',_0xeb3f70,_0x77bd87[_0xe4bc('0x18')]['message']);return _0x302f58(_0x77bd87[_0xe4bc('0x18')][_0xe4bc('0x1a')]);}else{logger[_0xe4bc('0x1b')](_0xe4bc('0x14'),_0xeb3f70,'request\x20sent');_0x302f58(_0x77bd87[_0xe4bc('0x1c')][_0xe4bc('0x1a')]);}})[_0xe4bc('0x1d')](function(_0x278f1d){logger[_0xe4bc('0x18')](_0xe4bc('0x14'),_0xeb3f70,_0x278f1d);_0x529cdd(_0x278f1d);});});} \ No newline at end of file +var _0x1608=['../../config/environment','jayson/promise','client','http','redis','defaults','./dashboard.socket','register','request','request\x20sent','debug','error','code','message','Dashboard,\x20%s,\x20%s','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4a0dd3,_0x5000d5){var _0xfca249=function(_0x27c605){while(--_0x27c605){_0x4a0dd3['push'](_0x4a0dd3['shift']());}};_0xfca249(++_0x5000d5);}(_0x1608,0xc1));var _0x8160=function(_0x15d8bd,_0x515e30){_0x15d8bd=_0x15d8bd-0x0;var _0x3b57d7=_0x1608[_0x15d8bd];return _0x3b57d7;};'use strict';var _=require(_0x8160('0x0'));var util=require(_0x8160('0x1'));var moment=require(_0x8160('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8160('0x3'));var db=require(_0x8160('0x4'))['db'];var utils=require(_0x8160('0x5'));var logger=require('../../config/logger')(_0x8160('0x6'));var config=require(_0x8160('0x7'));var jayson=require(_0x8160('0x8'));var client=jayson[_0x8160('0x9')][_0x8160('0xa')]({'port':0x232a});config[_0x8160('0xb')]=_[_0x8160('0xc')](config[_0x8160('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8160('0xb')]));require(_0x8160('0xd'))[_0x8160('0xe')](socket);function respondWithRpcPromise(_0x985648,_0x1894d6,_0x4c7e04){return new BPromise(function(_0x29ed1a,_0x3b7324){return client[_0x8160('0xf')](_0x985648,_0x4c7e04)['then'](function(_0x366450){logger['info']('Dashboard,\x20%s,\x20%s',_0x1894d6,_0x8160('0x10'));logger[_0x8160('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x1894d6,_0x8160('0x10'),JSON['stringify'](_0x366450));if(_0x366450[_0x8160('0x12')]){if(_0x366450['error'][_0x8160('0x13')]===0x1f4){logger[_0x8160('0x12')]('Dashboard,\x20%s,\x20%s',_0x1894d6,_0x366450[_0x8160('0x12')][_0x8160('0x14')]);return _0x3b7324(_0x366450[_0x8160('0x12')][_0x8160('0x14')]);}logger[_0x8160('0x12')](_0x8160('0x15'),_0x1894d6,_0x366450[_0x8160('0x12')][_0x8160('0x14')]);return _0x29ed1a(_0x366450['error'][_0x8160('0x14')]);}else{logger[_0x8160('0x16')](_0x8160('0x15'),_0x1894d6,'request\x20sent');_0x29ed1a(_0x366450[_0x8160('0x17')][_0x8160('0x14')]);}})[_0x8160('0x18')](function(_0x1d9aa4){logger[_0x8160('0x12')](_0x8160('0x15'),_0x1894d6,_0x1d9aa4);_0x3b7324(_0x1d9aa4);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index e81c777..e4006e1 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 _0x4fe8=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x590352,_0xdd8247){var _0x5a2c15=function(_0x8ebbe2){while(--_0x8ebbe2){_0x590352['push'](_0x590352['shift']());}};_0x5a2c15(++_0xdd8247);}(_0x4fe8,0x8e));var _0x84fe=function(_0x310996,_0x42a77c){_0x310996=_0x310996-0x0;var _0x3ca8cf=_0x4fe8[_0x310996];return _0x3ca8cf;};'use strict';var DashboardEvents=require(_0x84fe('0x0'));var events=[_0x84fe('0x1'),_0x84fe('0x2'),_0x84fe('0x3')];function createListener(_0x2abf57,_0x5c8038){return function(_0x3c96fc){_0x5c8038[_0x84fe('0x4')](_0x2abf57,_0x3c96fc);};}function removeListener(_0x45fcf6,_0x422bb2){return function(){DashboardEvents[_0x84fe('0x5')](_0x45fcf6,_0x422bb2);};}exports[_0x84fe('0x6')]=function(_0x120f16){for(var _0x5af1f0=0x0,_0x57d7dd=events[_0x84fe('0x7')];_0x5af1f0<_0x57d7dd;_0x5af1f0++){var _0x11053e=events[_0x5af1f0];var _0x3ffe8b=createListener(_0x84fe('0x8')+_0x11053e,_0x120f16);DashboardEvents['on'](_0x11053e,_0x3ffe8b);}}; \ No newline at end of file +var _0x1d8a=['dashboard:','./dashboard.events','save','update','emit','removeListener','register'];(function(_0x1face5,_0x40e068){var _0x3fc0f9=function(_0x251c1c){while(--_0x251c1c){_0x1face5['push'](_0x1face5['shift']());}};_0x3fc0f9(++_0x40e068);}(_0x1d8a,0x10b));var _0xa1d8=function(_0x5936c9,_0x35cc37){_0x5936c9=_0x5936c9-0x0;var _0x8b723e=_0x1d8a[_0x5936c9];return _0x8b723e;};'use strict';var DashboardEvents=require(_0xa1d8('0x0'));var events=[_0xa1d8('0x1'),'remove',_0xa1d8('0x2')];function createListener(_0x565f78,_0x520c97){return function(_0x1ff82f){_0x520c97[_0xa1d8('0x3')](_0x565f78,_0x1ff82f);};}function removeListener(_0x6a5f6,_0x1953b3){return function(){DashboardEvents[_0xa1d8('0x4')](_0x6a5f6,_0x1953b3);};}exports[_0xa1d8('0x5')]=function(_0x1ccc02){for(var _0x2409b0=0x0,_0x517f13=events['length'];_0x2409b0<_0x517f13;_0x2409b0++){var _0x31aec6=events[_0x2409b0];var _0x256ed8=createListener(_0xa1d8('0x6')+_0x31aec6,_0x1ccc02);DashboardEvents['on'](_0x31aec6,_0x256ed8);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 791e046..acb30ff 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 _0xaa90=['create','/:id/clone','clone','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','isAuthenticated','show','/:id/items','getItems','post'];(function(_0x555f69,_0x27543e){var _0x4ab429=function(_0xf5a81b){while(--_0xf5a81b){_0x555f69['push'](_0x555f69['shift']());}};_0x4ab429(++_0x27543e);}(_0xaa90,0x7a));var _0x0aa9=function(_0x271575,_0x1b421c){_0x271575=_0x271575-0x0;var _0x2c919f=_0xaa90[_0x271575];return _0x2c919f;};'use strict';var multer=require(_0x0aa9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0aa9('0x1'));var express=require(_0x0aa9('0x2'));var router=express[_0x0aa9('0x3')]();var fs_extra=require(_0x0aa9('0x4'));var auth=require(_0x0aa9('0x5'));var interaction=require(_0x0aa9('0x6'));var config=require(_0x0aa9('0x7'));var controller=require(_0x0aa9('0x8'));router[_0x0aa9('0x9')]('/',auth['isAuthenticated'](),controller[_0x0aa9('0xa')]);router[_0x0aa9('0x9')]('/:id',auth[_0x0aa9('0xb')](),controller[_0x0aa9('0xc')]);router['get'](_0x0aa9('0xd'),auth[_0x0aa9('0xb')](),controller[_0x0aa9('0xe')]);router[_0x0aa9('0xf')]('/',auth[_0x0aa9('0xb')](),controller[_0x0aa9('0x10')]);router[_0x0aa9('0xf')](_0x0aa9('0x11'),auth['isAuthenticated'](),controller[_0x0aa9('0x12')]);router[_0x0aa9('0xf')](_0x0aa9('0xd'),auth['isAuthenticated'](),controller['addItem']);router['put'](_0x0aa9('0x13'),auth[_0x0aa9('0xb')](),controller['update']);router[_0x0aa9('0x14')](_0x0aa9('0x13'),auth[_0x0aa9('0xb')](),controller[_0x0aa9('0x15')]);module[_0x0aa9('0x16')]=router; \ No newline at end of file +var _0x14a8=['/:id','/:id/items','post','/:id/clone','addItem','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index'];(function(_0x25df9a,_0x12a0c2){var _0x104242=function(_0x135a40){while(--_0x135a40){_0x25df9a['push'](_0x25df9a['shift']());}};_0x104242(++_0x12a0c2);}(_0x14a8,0x15f));var _0x814a=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x14a8[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require('multer');var util=require(_0x814a('0x0'));var path=require(_0x814a('0x1'));var timeout=require('connect-timeout');var express=require(_0x814a('0x2'));var router=express['Router']();var fs_extra=require(_0x814a('0x3'));var auth=require(_0x814a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x814a('0x5'));var controller=require(_0x814a('0x6'));router[_0x814a('0x7')]('/',auth[_0x814a('0x8')](),controller[_0x814a('0x9')]);router[_0x814a('0x7')](_0x814a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x814a('0x7')](_0x814a('0xb'),auth[_0x814a('0x8')](),controller['getItems']);router[_0x814a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x814a('0xc')](_0x814a('0xd'),auth[_0x814a('0x8')](),controller['clone']);router[_0x814a('0xc')]('/:id/items',auth['isAuthenticated'](),controller[_0x814a('0xe')]);router[_0x814a('0xf')](_0x814a('0xa'),auth['isAuthenticated'](),controller[_0x814a('0x10')]);router['delete'](_0x814a('0xa'),auth[_0x814a('0x8')](),controller[_0x814a('0x11')]);module[_0x814a('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index f08417e..46ac2f2 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 _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x480e53,_0x5c8da4){var _0x12c12f=function(_0x1a6c28){while(--_0x1a6c28){_0x480e53['push'](_0x480e53['shift']());}};_0x12c12f(++_0x5c8da4);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x21e137,_0x5a1fa3){_0x21e137=_0x21e137-0x0;var _0x5109f7=_0xc6ac[_0x21e137];return _0x5109f7;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x1623=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','exports','STRING','TEXT','long'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x1623,0xab));var _0x3162=function(_0x19067d,_0x185bca){_0x19067d=_0x19067d-0x0;var _0x31c4eb=_0x1623[_0x19067d];return _0x31c4eb;};'use strict';var Sequelize=require(_0x3162('0x0'));var squel=require('squel');var _=require('lodash');module[_0x3162('0x1')]={'title':{'type':Sequelize[_0x3162('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3162('0x5')));}catch(_0x4b77c4){return[];}},'set':function(_0x1b55f2){try{this[_0x3162('0x6')]('attrs',JSON[_0x3162('0x7')](_0x1b55f2));}catch(_0x2dc07e){this[_0x3162('0x6')](_0x3162('0x5'),JSON[_0x3162('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3162('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3162('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3162('0x2')],'allowNull':![],'defaultValue':_0x3162('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3162('0x2')]},'titleFontSize':{'type':Sequelize[_0x3162('0x8')],'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 5bc2ad6..983106a 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 _0x1a0b=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','set','apply','reject','update','then','destroy','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','find','catch','type','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts'];(function(_0x465b74,_0xa0c223){var _0xde98ea=function(_0x3c2af9){while(--_0x3c2af9){_0x465b74['push'](_0x465b74['shift']());}};_0xde98ea(++_0xa0c223);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x3316ea,_0xc0293){_0x3316ea=_0x3316ea-0x0;var _0x4c17de=_0x1a0b[_0x3316ea];return _0x4c17de;};'use strict';var emlformat=require(_0xb1a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1a0('0x1'));var jsonpatch=require(_0xb1a0('0x2'));var rp=require(_0xb1a0('0x3'));var moment=require(_0xb1a0('0x4'));var BPromise=require(_0xb1a0('0x5'));var Mustache=require(_0xb1a0('0x6'));var util=require(_0xb1a0('0x7'));var path=require(_0xb1a0('0x8'));var sox=require(_0xb1a0('0x9'));var csv=require(_0xb1a0('0xa'));var ejs=require(_0xb1a0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb1a0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb1a0('0xd'));var toCsv=require(_0xb1a0('0xa'));var querystring=require(_0xb1a0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb1a0('0xf'));var qs=require(_0xb1a0('0x10'));var as=require(_0xb1a0('0x11'));var hardwareService=require(_0xb1a0('0x12'));var logger=require(_0xb1a0('0x13'))(_0xb1a0('0x14'));var utils=require('../../config/utils');var config=require(_0xb1a0('0x15'));var licenseUtil=require(_0xb1a0('0x16'));var db=require(_0xb1a0('0x17'))['db'];config['redis']=_[_0xb1a0('0x18')](config[_0xb1a0('0x19')],{'host':_0xb1a0('0x1a'),'port':0x18eb});var socket=require(_0xb1a0('0x1b'))(new Redis(config['redis']));require(_0xb1a0('0x1c'))[_0xb1a0('0x1d')](socket);function respondWithStatusCode(_0x171d06,_0x209b89){_0x209b89=_0x209b89||0xcc;return function(_0x11a472){if(_0x11a472){return _0x171d06[_0xb1a0('0x1e')](_0x209b89);}return _0x171d06[_0xb1a0('0x1f')](_0x209b89)[_0xb1a0('0x20')]();};}function respondWithResult(_0x393c2e,_0x437d8a){_0x437d8a=_0x437d8a||0xc8;return function(_0x104389){if(_0x104389){return _0x393c2e[_0xb1a0('0x1f')](_0x437d8a)[_0xb1a0('0x21')](_0x104389);}};}function respondWithFilteredResult(_0x3e6d71,_0x28e571){return function(_0x223b14){if(_0x223b14){var _0x2c3d0e=typeof _0x28e571['offset']==='undefined'&&typeof _0x28e571['limit']==='undefined';var _0x5152e7=_0x223b14['count'];var _0x5e6930=_0x2c3d0e?0x0:_0x28e571['offset'];var _0xefc9d3=_0x2c3d0e?_0x223b14[_0xb1a0('0x22')]:_0x28e571[_0xb1a0('0x23')]+_0x28e571['limit'];var _0x5020ac;if(_0xefc9d3>=_0x5152e7){_0xefc9d3=_0x5152e7;_0x5020ac=0xc8;}else{_0x5020ac=0xce;}_0x3e6d71[_0xb1a0('0x1f')](_0x5020ac);return _0x3e6d71[_0xb1a0('0x24')]('Content-Range',_0x5e6930+'-'+_0xefc9d3+'/'+_0x5152e7)[_0xb1a0('0x21')](_0x223b14);}return null;};}function patchUpdates(_0x59fa26){return function(_0x3b7443){try{jsonpatch[_0xb1a0('0x25')](_0x3b7443,_0x59fa26,!![]);}catch(_0x3b2623){return BPromise[_0xb1a0('0x26')](_0x3b2623);}return _0x3b7443['save']();};}function saveUpdates(_0x15c01d,_0x572ef8){return function(_0x1bf4de){if(_0x1bf4de){return _0x1bf4de[_0xb1a0('0x27')](_0x15c01d)[_0xb1a0('0x28')](function(_0x10e675){return _0x10e675;});}return null;};}function removeEntity(_0x45a486,_0xadb652){return function(_0xb64c7d){if(_0xb64c7d){return _0xb64c7d[_0xb1a0('0x29')]()[_0xb1a0('0x28')](function(){_0x45a486['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44dd93,_0x1006dc){return function(_0x3b8900){if(!_0x3b8900){_0x44dd93['sendStatus'](0x194);}return _0x3b8900;};}function handleError(_0x1d5f19,_0x4b3fe8){_0x4b3fe8=_0x4b3fe8||0x1f4;return function(_0x3fff58){logger['error'](_0x3fff58[_0xb1a0('0x2a')]);if(_0x3fff58[_0xb1a0('0x2b')]){delete _0x3fff58[_0xb1a0('0x2b')];}_0x1d5f19[_0xb1a0('0x1f')](_0x4b3fe8)[_0xb1a0('0x2c')](_0x3fff58);};}exports[_0xb1a0('0x2d')]=function(_0x320e38,_0x2d997c){var _0x1abda5={'raw':![],'where':{'id':_0x320e38[_0xb1a0('0x2e')]['id']}},_0x50309c={};_0x50309c[_0xb1a0('0x2f')]=_[_0xb1a0('0x30')](db[_0xb1a0('0x31')][_0xb1a0('0x32')]);_0x50309c[_0xb1a0('0x33')]=_[_0xb1a0('0x30')](_0x320e38['query']);_0x50309c['filters']=_[_0xb1a0('0x34')](_0x50309c[_0xb1a0('0x2f')],_0x50309c['query']);_0x1abda5[_0xb1a0('0x35')]=_[_0xb1a0('0x34')](_0x50309c[_0xb1a0('0x2f')],qs[_0xb1a0('0x36')](_0x320e38[_0xb1a0('0x33')][_0xb1a0('0x36')]));_0x1abda5[_0xb1a0('0x35')]=_0x1abda5[_0xb1a0('0x35')][_0xb1a0('0x37')]?_0x1abda5[_0xb1a0('0x35')]:_0x50309c[_0xb1a0('0x2f')];if(_0x320e38[_0xb1a0('0x33')][_0xb1a0('0x38')]){_0x1abda5[_0xb1a0('0x39')]=[{'all':!![]}];}_0x1abda5=_[_0xb1a0('0x3a')]({},_0x1abda5,_0x320e38['options']);return db[_0xb1a0('0x31')][_0xb1a0('0x3b')](_0x1abda5)[_0xb1a0('0x28')](handleEntityNotFound(_0x2d997c,null))[_0xb1a0('0x28')](respondWithResult(_0x2d997c,null))[_0xb1a0('0x3c')](handleError(_0x2d997c,null));};exports['destroy']=function(_0x5e5f88,_0x3973b1){return db[_0xb1a0('0x31')][_0xb1a0('0x3b')]({'where':{'id':_0x5e5f88[_0xb1a0('0x2e')]['id']}})[_0xb1a0('0x28')](handleEntityNotFound(_0x3973b1,null))[_0xb1a0('0x28')](removeEntity(_0x3973b1,null))['catch'](handleError(_0x3973b1,null));};function widgetAttributes(_0x21ba57){try{switch(_0x21ba57[_0xb1a0('0x3d')]){case'iframe':return[{'name':'attrUrl','value':_0x21ba57['attrUrl']||(_0x21ba57['attrs']&&_0x21ba57[_0xb1a0('0x3e')][0x0]?_0x21ba57['attrs'][0x0][_0xb1a0('0x3f')]:undefined)||_0xb1a0('0x40')}];case _0xb1a0('0x41'):return[{'name':_0xb1a0('0x42'),'value':_0x21ba57[_0xb1a0('0x42')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x0]?_0x21ba57[_0xb1a0('0x3e')][0x0][_0xb1a0('0x3f')]:undefined)||''}];case _0xb1a0('0x43'):return[{'name':_0xb1a0('0x44'),'value':_0x21ba57[_0xb1a0('0x44')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x0]?_0x21ba57['attrs'][0x0]['value']:undefined)||_0xb1a0('0x45')},{'name':_0xb1a0('0x46'),'value':_0x21ba57[_0xb1a0('0x46')]||(_0x21ba57['attrs']&&_0x21ba57['attrs'][0x1]?_0x21ba57[_0xb1a0('0x3e')][0x1][_0xb1a0('0x3f')]:undefined)||_0xb1a0('0x47')},{'name':_0xb1a0('0x48'),'value':_0x21ba57[_0xb1a0('0x48')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x2]?_0x21ba57[_0xb1a0('0x3e')][0x2]['value']:undefined)||0xc}];case _0xb1a0('0x49'):return[{'name':'attrMetric','value':_0x21ba57[_0xb1a0('0x4a')]||(_0x21ba57['attrs']&&_0x21ba57[_0xb1a0('0x3e')][0x0]?_0x21ba57[_0xb1a0('0x3e')][0x0][_0xb1a0('0x3f')]:undefined)||_0xb1a0('0x4b')},{'name':'attrVoiceQueues','value':_0x21ba57['attrVoiceQueues']||(_0x21ba57['attrs']&&_0x21ba57['attrs'][0x1]?_0x21ba57['attrs'][0x1][_0xb1a0('0x3f')]:undefined)||[]},{'name':_0xb1a0('0x48'),'value':_0x21ba57[_0xb1a0('0x48')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x2]?_0x21ba57['attrs'][0x2][_0xb1a0('0x3f')]:undefined)||0x14},{'name':_0xb1a0('0x4c'),'value':_0x21ba57[_0xb1a0('0x4c')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x3]?_0x21ba57[_0xb1a0('0x3e')][0x3]['value']:undefined)||_0xb1a0('0x4d')},{'name':_0xb1a0('0x4e'),'value':_0x21ba57['attrEmailAccounts']||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x4]?_0x21ba57[_0xb1a0('0x3e')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x21ba57[_0xb1a0('0x4f')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57['attrs'][0x5]?_0x21ba57[_0xb1a0('0x3e')][0x5][_0xb1a0('0x3f')]:undefined)||''},{'name':_0xb1a0('0x50'),'value':_0x21ba57[_0xb1a0('0x50')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x6]?_0x21ba57[_0xb1a0('0x3e')][0x6][_0xb1a0('0x3f')]:undefined)||''},{'name':_0xb1a0('0x51'),'value':_0x21ba57[_0xb1a0('0x51')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57['attrs'][0x7]?_0x21ba57[_0xb1a0('0x3e')][0x7]['value']:undefined)||''},{'name':_0xb1a0('0x52'),'value':_0x21ba57[_0xb1a0('0x52')]||(_0x21ba57['attrs']&&_0x21ba57[_0xb1a0('0x3e')][0x8]?_0x21ba57[_0xb1a0('0x3e')][0x8][_0xb1a0('0x3f')]:undefined)||''},{'name':_0xb1a0('0x53'),'value':_0x21ba57[_0xb1a0('0x53')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x9]?_0x21ba57[_0xb1a0('0x3e')][0x9][_0xb1a0('0x3f')]:undefined)||''}];case _0xb1a0('0x54'):case'pie-chart':return[{'name':'attrSerie1','value':_0x21ba57[_0xb1a0('0x55')]||(_0x21ba57['attrs']&&_0x21ba57['attrs'][0x0]?_0x21ba57[_0xb1a0('0x3e')][0x0][_0xb1a0('0x3f')]:undefined)||_0xb1a0('0x4b')},{'name':_0xb1a0('0x56'),'value':_0x21ba57[_0xb1a0('0x56')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57['attrs'][0x1]?_0x21ba57['attrs'][0x1][_0xb1a0('0x3f')]:undefined)||null},{'name':_0xb1a0('0x57'),'value':_0x21ba57[_0xb1a0('0x57')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x2]?_0x21ba57[_0xb1a0('0x3e')][0x2][_0xb1a0('0x3f')]:undefined)||null},{'name':_0xb1a0('0x58'),'value':_0x21ba57[_0xb1a0('0x58')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57['attrs'][0x3]?_0x21ba57[_0xb1a0('0x3e')][0x3][_0xb1a0('0x3f')]:undefined)||[]},{'name':_0xb1a0('0x4c'),'value':_0x21ba57[_0xb1a0('0x4c')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x4]?_0x21ba57[_0xb1a0('0x3e')][0x4][_0xb1a0('0x3f')]:undefined)||_0xb1a0('0x4d')},{'name':'attrEmailAccounts','value':_0x21ba57['attrEmailAccounts']||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x5]?_0x21ba57[_0xb1a0('0x3e')][0x5][_0xb1a0('0x3f')]:undefined)||''},{'name':_0xb1a0('0x4f'),'value':_0x21ba57[_0xb1a0('0x4f')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x6]?_0x21ba57[_0xb1a0('0x3e')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x21ba57['attrSmsAccounts']||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x7]?_0x21ba57[_0xb1a0('0x3e')][0x7]['value']:undefined)||''},{'name':_0xb1a0('0x51'),'value':_0x21ba57['attrOpenchannelAccounts']||(_0x21ba57['attrs']&&_0x21ba57[_0xb1a0('0x3e')][0x8]?_0x21ba57[_0xb1a0('0x3e')][0x8][_0xb1a0('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x21ba57[_0xb1a0('0x52')]||(_0x21ba57['attrs']&&_0x21ba57[_0xb1a0('0x3e')][0x9]?_0x21ba57[_0xb1a0('0x3e')][0x9][_0xb1a0('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x21ba57[_0xb1a0('0x53')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0xa]?_0x21ba57[_0xb1a0('0x3e')][0xa][_0xb1a0('0x3f')]:undefined)||''}];case'web-report':return[{'name':_0xb1a0('0x59'),'type':_0x21ba57['reportType']||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x0]?_0x21ba57[_0xb1a0('0x3e')][0x0][_0xb1a0('0x3d')]:undefined)||null,'value':_0x21ba57['attrReport']||(_0x21ba57['attrs']&&_0x21ba57[_0xb1a0('0x3e')][0x0]?_0x21ba57[_0xb1a0('0x3e')][0x0]['value']:undefined)||null},{'name':_0xb1a0('0x5a'),'value':_0x21ba57[_0xb1a0('0x5a')]||(_0x21ba57[_0xb1a0('0x3e')]&&_0x21ba57[_0xb1a0('0x3e')][0x1]?_0x21ba57[_0xb1a0('0x3e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x161dd9){logger[_0xb1a0('0x5b')](_0xb1a0('0x5c'),JSON[_0xb1a0('0x5d')](_0x161dd9));return[];}}exports[_0xb1a0('0x5e')]=function(_0x2a209b,_0x161ef0){if(_0x2a209b[_0xb1a0('0x5f')]){_0x2a209b['body'][_0xb1a0('0x3e')]=widgetAttributes(_0x2a209b['body']);}return db[_0xb1a0('0x31')]['create'](_0x2a209b[_0xb1a0('0x5f')],{})[_0xb1a0('0x28')](respondWithResult(_0x161ef0,0xc9))[_0xb1a0('0x3c')](handleError(_0x161ef0,null));};exports[_0xb1a0('0x27')]=function(_0x35b902,_0x5d2887){if(_0x35b902[_0xb1a0('0x5f')]['id']){delete _0x35b902[_0xb1a0('0x5f')]['id'];}_0x35b902['body'][_0xb1a0('0x3e')]=widgetAttributes(_0x35b902[_0xb1a0('0x5f')]);return db[_0xb1a0('0x31')][_0xb1a0('0x3b')]({'where':{'id':_0x35b902[_0xb1a0('0x2e')]['id']}})[_0xb1a0('0x28')](handleEntityNotFound(_0x5d2887,null))[_0xb1a0('0x28')](saveUpdates(_0x35b902[_0xb1a0('0x5f')],null))[_0xb1a0('0x28')](respondWithResult(_0x5d2887,null))[_0xb1a0('0x3c')](handleError(_0x5d2887,null));}; \ No newline at end of file +var _0xb89c=['attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','end','stack','name','send','show','params','DashboardItem','rawAttributes','keys','query','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00'];(function(_0x2b78f4,_0x3dd69c){var _0x2e99b3=function(_0x42c294){while(--_0x42c294){_0x2b78f4['push'](_0x2b78f4['shift']());}};_0x2e99b3(++_0x3dd69c);}(_0xb89c,0x198));var _0xcb89=function(_0x17ba04,_0x401730){_0x17ba04=_0x17ba04-0x0;var _0x3fe767=_0xb89c[_0x17ba04];return _0x3fe767;};'use strict';var emlformat=require(_0xcb89('0x0'));var rimraf=require(_0xcb89('0x1'));var zipdir=require(_0xcb89('0x2'));var jsonpatch=require(_0xcb89('0x3'));var rp=require('request-promise');var moment=require(_0xcb89('0x4'));var BPromise=require(_0xcb89('0x5'));var Mustache=require('mustache');var util=require(_0xcb89('0x6'));var path=require(_0xcb89('0x7'));var sox=require(_0xcb89('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb89('0x9'));var _=require(_0xcb89('0xa'));var squel=require(_0xcb89('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb89('0xc'));var deskjs=require(_0xcb89('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcb89('0xe'));var Redis=require('ioredis');var authService=require(_0xcb89('0xf'));var qs=require(_0xcb89('0x10'));var as=require(_0xcb89('0x11'));var hardwareService=require(_0xcb89('0x12'));var logger=require(_0xcb89('0x13'))(_0xcb89('0x14'));var utils=require('../../config/utils');var config=require(_0xcb89('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb89('0x16'))['db'];config[_0xcb89('0x17')]=_[_0xcb89('0x18')](config[_0xcb89('0x17')],{'host':_0xcb89('0x19'),'port':0x18eb});var socket=require(_0xcb89('0x1a'))(new Redis(config[_0xcb89('0x17')]));require('./dashboardItem.socket')[_0xcb89('0x1b')](socket);function respondWithStatusCode(_0x90a9eb,_0x5686ac){_0x5686ac=_0x5686ac||0xcc;return function(_0x335236){if(_0x335236){return _0x90a9eb[_0xcb89('0x1c')](_0x5686ac);}return _0x90a9eb[_0xcb89('0x1d')](_0x5686ac)['end']();};}function respondWithResult(_0x8b9afa,_0x4efa27){_0x4efa27=_0x4efa27||0xc8;return function(_0x5a17a3){if(_0x5a17a3){return _0x8b9afa[_0xcb89('0x1d')](_0x4efa27)[_0xcb89('0x1e')](_0x5a17a3);}};}function respondWithFilteredResult(_0x254d38,_0xd9fec8){return function(_0x3ace69){if(_0x3ace69){var _0x37aece=typeof _0xd9fec8[_0xcb89('0x1f')]===_0xcb89('0x20')&&typeof _0xd9fec8['limit']===_0xcb89('0x20');var _0x2bcb0b=_0x3ace69['count'];var _0x4c3fb9=_0x37aece?0x0:_0xd9fec8[_0xcb89('0x1f')];var _0x2f335b=_0x37aece?_0x3ace69[_0xcb89('0x21')]:_0xd9fec8[_0xcb89('0x1f')]+_0xd9fec8[_0xcb89('0x22')];var _0x355994;if(_0x2f335b>=_0x2bcb0b){_0x2f335b=_0x2bcb0b;_0x355994=0xc8;}else{_0x355994=0xce;}_0x254d38[_0xcb89('0x1d')](_0x355994);return _0x254d38[_0xcb89('0x23')]('Content-Range',_0x4c3fb9+'-'+_0x2f335b+'/'+_0x2bcb0b)[_0xcb89('0x1e')](_0x3ace69);}return null;};}function patchUpdates(_0x1dc399){return function(_0xfd8b0b){try{jsonpatch[_0xcb89('0x24')](_0xfd8b0b,_0x1dc399,!![]);}catch(_0x5d164c){return BPromise[_0xcb89('0x25')](_0x5d164c);}return _0xfd8b0b['save']();};}function saveUpdates(_0x189ada,_0x556b08){return function(_0x3f9e5c){if(_0x3f9e5c){return _0x3f9e5c[_0xcb89('0x26')](_0x189ada)[_0xcb89('0x27')](function(_0x52bed3){return _0x52bed3;});}return null;};}function removeEntity(_0x3b4d44,_0x6925c7){return function(_0x304824){if(_0x304824){return _0x304824[_0xcb89('0x28')]()[_0xcb89('0x27')](function(){_0x3b4d44[_0xcb89('0x1d')](0xcc)[_0xcb89('0x29')]();});}};}function handleEntityNotFound(_0x21b739,_0x2eb18f){return function(_0x52ec43){if(!_0x52ec43){_0x21b739[_0xcb89('0x1c')](0x194);}return _0x52ec43;};}function handleError(_0x5c1a2f,_0x20e570){_0x20e570=_0x20e570||0x1f4;return function(_0x557dd4){logger['error'](_0x557dd4[_0xcb89('0x2a')]);if(_0x557dd4[_0xcb89('0x2b')]){delete _0x557dd4[_0xcb89('0x2b')];}_0x5c1a2f[_0xcb89('0x1d')](_0x20e570)[_0xcb89('0x2c')](_0x557dd4);};}exports[_0xcb89('0x2d')]=function(_0xb5eae,_0x240258){var _0x1d545a={'raw':![],'where':{'id':_0xb5eae[_0xcb89('0x2e')]['id']}},_0x850eb1={};_0x850eb1['model']=_['keys'](db[_0xcb89('0x2f')][_0xcb89('0x30')]);_0x850eb1['query']=_[_0xcb89('0x31')](_0xb5eae[_0xcb89('0x32')]);_0x850eb1['filters']=_[_0xcb89('0x33')](_0x850eb1[_0xcb89('0x34')],_0x850eb1[_0xcb89('0x32')]);_0x1d545a['attributes']=_[_0xcb89('0x33')](_0x850eb1['model'],qs['fields'](_0xb5eae[_0xcb89('0x32')][_0xcb89('0x35')]));_0x1d545a[_0xcb89('0x36')]=_0x1d545a['attributes'][_0xcb89('0x37')]?_0x1d545a[_0xcb89('0x36')]:_0x850eb1[_0xcb89('0x34')];if(_0xb5eae['query'][_0xcb89('0x38')]){_0x1d545a[_0xcb89('0x39')]=[{'all':!![]}];}_0x1d545a=_[_0xcb89('0x3a')]({},_0x1d545a,_0xb5eae[_0xcb89('0x3b')]);return db[_0xcb89('0x2f')][_0xcb89('0x3c')](_0x1d545a)['then'](handleEntityNotFound(_0x240258,null))[_0xcb89('0x27')](respondWithResult(_0x240258,null))[_0xcb89('0x3d')](handleError(_0x240258,null));};exports['destroy']=function(_0x4be348,_0x3d5bb7){return db[_0xcb89('0x2f')]['find']({'where':{'id':_0x4be348[_0xcb89('0x2e')]['id']}})[_0xcb89('0x27')](handleEntityNotFound(_0x3d5bb7,null))[_0xcb89('0x27')](removeEntity(_0x3d5bb7,null))[_0xcb89('0x3d')](handleError(_0x3d5bb7,null));};function widgetAttributes(_0x2c5348){try{switch(_0x2c5348['type']){case'iframe':return[{'name':_0xcb89('0x3e'),'value':_0x2c5348[_0xcb89('0x3e')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x0]?_0x2c5348['attrs'][0x0]['value']:undefined)||_0xcb89('0x40')}];case'custom':return[{'name':_0xcb89('0x41'),'value':_0x2c5348[_0xcb89('0x41')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x0]?_0x2c5348['attrs'][0x0][_0xcb89('0x42')]:undefined)||''}];case _0xcb89('0x43'):return[{'name':_0xcb89('0x44'),'value':_0x2c5348[_0xcb89('0x44')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x0]?_0x2c5348[_0xcb89('0x3f')][0x0]['value']:undefined)||_0xcb89('0x45')},{'name':_0xcb89('0x46'),'value':_0x2c5348['attrTimezone']||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0x1]?_0x2c5348[_0xcb89('0x3f')][0x1][_0xcb89('0x42')]:undefined)||_0xcb89('0x47')},{'name':_0xcb89('0x48'),'value':_0x2c5348[_0xcb89('0x48')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0x2]?_0x2c5348['attrs'][0x2]['value']:undefined)||0xc}];case _0xcb89('0x49'):return[{'name':_0xcb89('0x4a'),'value':_0x2c5348[_0xcb89('0x4a')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0x0]?_0x2c5348[_0xcb89('0x3f')][0x0][_0xcb89('0x42')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2c5348[_0xcb89('0x4b')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x1]?_0x2c5348[_0xcb89('0x3f')][0x1]['value']:undefined)||[]},{'name':_0xcb89('0x48'),'value':_0x2c5348[_0xcb89('0x48')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x2]?_0x2c5348['attrs'][0x2][_0xcb89('0x42')]:undefined)||0x14},{'name':'attrChannel','value':_0x2c5348[_0xcb89('0x4c')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x3]?_0x2c5348[_0xcb89('0x3f')][0x3][_0xcb89('0x42')]:undefined)||'voice'},{'name':_0xcb89('0x4d'),'value':_0x2c5348[_0xcb89('0x4d')]||(_0x2c5348['attrs']&&_0x2c5348[_0xcb89('0x3f')][0x4]?_0x2c5348[_0xcb89('0x3f')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x2c5348[_0xcb89('0x4e')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x5]?_0x2c5348[_0xcb89('0x3f')][0x5][_0xcb89('0x42')]:undefined)||''},{'name':_0xcb89('0x4f'),'value':_0x2c5348[_0xcb89('0x4f')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0x6]?_0x2c5348[_0xcb89('0x3f')][0x6][_0xcb89('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c5348[_0xcb89('0x50')]||(_0x2c5348['attrs']&&_0x2c5348[_0xcb89('0x3f')][0x7]?_0x2c5348[_0xcb89('0x3f')][0x7][_0xcb89('0x42')]:undefined)||''},{'name':_0xcb89('0x51'),'value':_0x2c5348['attrWhatsappAccounts']||(_0x2c5348['attrs']&&_0x2c5348[_0xcb89('0x3f')][0x8]?_0x2c5348[_0xcb89('0x3f')][0x8][_0xcb89('0x42')]:undefined)||''},{'name':_0xcb89('0x52'),'value':_0x2c5348[_0xcb89('0x52')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x9]?_0x2c5348[_0xcb89('0x3f')][0x9][_0xcb89('0x42')]:undefined)||''}];case'multibar-chart':case _0xcb89('0x53'):return[{'name':_0xcb89('0x54'),'value':_0x2c5348[_0xcb89('0x54')]||(_0x2c5348['attrs']&&_0x2c5348[_0xcb89('0x3f')][0x0]?_0x2c5348['attrs'][0x0][_0xcb89('0x42')]:undefined)||_0xcb89('0x55')},{'name':_0xcb89('0x56'),'value':_0x2c5348[_0xcb89('0x56')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x1]?_0x2c5348[_0xcb89('0x3f')][0x1][_0xcb89('0x42')]:undefined)||null},{'name':_0xcb89('0x57'),'value':_0x2c5348[_0xcb89('0x57')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x2]?_0x2c5348[_0xcb89('0x3f')][0x2][_0xcb89('0x42')]:undefined)||null},{'name':_0xcb89('0x4b'),'value':_0x2c5348['attrVoiceQueues']||(_0x2c5348['attrs']&&_0x2c5348[_0xcb89('0x3f')][0x3]?_0x2c5348[_0xcb89('0x3f')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x2c5348[_0xcb89('0x4c')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x4]?_0x2c5348[_0xcb89('0x3f')][0x4][_0xcb89('0x42')]:undefined)||_0xcb89('0x58')},{'name':_0xcb89('0x4d'),'value':_0x2c5348[_0xcb89('0x4d')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x5]?_0x2c5348[_0xcb89('0x3f')][0x5][_0xcb89('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2c5348[_0xcb89('0x4e')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0x6]?_0x2c5348[_0xcb89('0x3f')][0x6][_0xcb89('0x42')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2c5348[_0xcb89('0x4f')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x7]?_0x2c5348['attrs'][0x7][_0xcb89('0x42')]:undefined)||''},{'name':_0xcb89('0x50'),'value':_0x2c5348[_0xcb89('0x50')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x8]?_0x2c5348['attrs'][0x8]['value']:undefined)||''},{'name':_0xcb89('0x51'),'value':_0x2c5348[_0xcb89('0x51')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x9]?_0x2c5348['attrs'][0x9][_0xcb89('0x42')]:undefined)||''},{'name':_0xcb89('0x52'),'value':_0x2c5348[_0xcb89('0x52')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0xa]?_0x2c5348[_0xcb89('0x3f')][0xa][_0xcb89('0x42')]:undefined)||''}];case _0xcb89('0x59'):return[{'name':_0xcb89('0x5a'),'type':_0x2c5348[_0xcb89('0x5b')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348['attrs'][0x0]?_0x2c5348[_0xcb89('0x3f')][0x0]['type']:undefined)||null,'value':_0x2c5348[_0xcb89('0x5a')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x0]?_0x2c5348['attrs'][0x0][_0xcb89('0x42')]:undefined)||null},{'name':'attrRefresh','value':_0x2c5348[_0xcb89('0x5c')]||(_0x2c5348[_0xcb89('0x3f')]&&_0x2c5348[_0xcb89('0x3f')][0x1]?_0x2c5348[_0xcb89('0x3f')][0x1][_0xcb89('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x13b49f){logger['error']('widgetAttributes:\x20%s',JSON[_0xcb89('0x5d')](_0x13b49f));return[];}}exports['create']=function(_0x2c3ffd,_0x3a53c2){if(_0x2c3ffd[_0xcb89('0x5e')]){_0x2c3ffd[_0xcb89('0x5e')]['attrs']=widgetAttributes(_0x2c3ffd[_0xcb89('0x5e')]);}return db[_0xcb89('0x2f')][_0xcb89('0x5f')](_0x2c3ffd[_0xcb89('0x5e')],{})[_0xcb89('0x27')](respondWithResult(_0x3a53c2,0xc9))[_0xcb89('0x3d')](handleError(_0x3a53c2,null));};exports[_0xcb89('0x26')]=function(_0x41d1c2,_0x16b5c7){if(_0x41d1c2['body']['id']){delete _0x41d1c2[_0xcb89('0x5e')]['id'];}_0x41d1c2[_0xcb89('0x5e')][_0xcb89('0x3f')]=widgetAttributes(_0x41d1c2[_0xcb89('0x5e')]);return db[_0xcb89('0x2f')][_0xcb89('0x3c')]({'where':{'id':_0x41d1c2[_0xcb89('0x2e')]['id']}})[_0xcb89('0x27')](handleEntityNotFound(_0x16b5c7,null))[_0xcb89('0x27')](saveUpdates(_0x41d1c2[_0xcb89('0x5e')],null))[_0xcb89('0x27')](respondWithResult(_0x16b5c7,null))[_0xcb89('0x3d')](handleError(_0x16b5c7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 6ac696e..fc61ba6 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 _0x687c=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x44f781,_0x1b984e){var _0x1b0b31=function(_0x50819f){while(--_0x50819f){_0x44f781['push'](_0x44f781['shift']());}};_0x1b0b31(++_0x1b984e);}(_0x687c,0x1b9));var _0xc687=function(_0x227b33,_0xf8f741){_0x227b33=_0x227b33-0x0;var _0x5281fa=_0x687c[_0x227b33];return _0x5281fa;};'use strict';var EventEmitter=require(_0xc687('0x0'));var DashboardItem=require(_0xc687('0x1'))['db'][_0xc687('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc687('0x3')](0x0);var events={'afterCreate':_0xc687('0x4'),'afterUpdate':_0xc687('0x5'),'afterDestroy':_0xc687('0x6')};function emitEvent(_0x717b88){return function(_0x5da58b,_0x19763b,_0x3e6cc4){DashboardItemEvents[_0xc687('0x7')](_0x717b88+':'+_0x5da58b['id'],_0x5da58b);DashboardItemEvents[_0xc687('0x7')](_0x717b88,_0x5da58b);_0x3e6cc4(null);};}for(var e in events){if(events[_0xc687('0x8')](e)){var event=events[e];DashboardItem[_0xc687('0x9')](e,emitEvent(event));}}module[_0xc687('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x95b6=['emit','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove'];(function(_0x564b7f,_0x162734){var _0x194ae6=function(_0x25fe6b){while(--_0x25fe6b){_0x564b7f['push'](_0x564b7f['shift']());}};_0x194ae6(++_0x162734);}(_0x95b6,0x1b3));var _0x695b=function(_0xf35983,_0x16ec52){_0xf35983=_0xf35983-0x0;var _0x278def=_0x95b6[_0xf35983];return _0x278def;};'use strict';var EventEmitter=require(_0x695b('0x0'));var DashboardItem=require(_0x695b('0x1'))['db'][_0x695b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x695b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x695b('0x4'),'afterDestroy':_0x695b('0x5')};function emitEvent(_0x11573a){return function(_0x5b3ea8,_0x3da173,_0x4fc28f){DashboardItemEvents[_0x695b('0x6')](_0x11573a+':'+_0x5b3ea8['id'],_0x5b3ea8);DashboardItemEvents['emit'](_0x11573a,_0x5b3ea8);_0x4fc28f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index f8b5d9f..6c4e6f2 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 _0x8a81=['path','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5b770d,_0x1adc88){var _0x4ee575=function(_0x4e0b6b){while(--_0x4e0b6b){_0x5b770d['push'](_0x5b770d['shift']());}};_0x4ee575(++_0x1adc88);}(_0x8a81,0x1da));var _0x18a8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8a81[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x18a8('0x0'));var util=require(_0x18a8('0x1'));var logger=require(_0x18a8('0x2'))(_0x18a8('0x3'));var moment=require('moment');var BPromise=require(_0x18a8('0x4'));var rp=require(_0x18a8('0x5'));var fs=require('fs');var path=require(_0x18a8('0x6'));var rimraf=require(_0x18a8('0x7'));var config=require(_0x18a8('0x8'));var attributes=require(_0x18a8('0x9'));module['exports']=function(_0x2b6bea,_0x43e2c0){return _0x2b6bea[_0x18a8('0xa')]('DashboardItem',attributes,{'tableName':_0x18a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a72=['rimraf','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a72,0x7d));var _0x27a7=function(_0x1c6c93,_0x57cedc){_0x1c6c93=_0x1c6c93-0x0;var _0x328239=_0x7a72[_0x1c6c93];return _0x328239;};'use strict';var _=require(_0x27a7('0x0'));var util=require(_0x27a7('0x1'));var logger=require(_0x27a7('0x2'))(_0x27a7('0x3'));var moment=require(_0x27a7('0x4'));var BPromise=require(_0x27a7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27a7('0x6'));var rimraf=require(_0x27a7('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x27a7('0x8')]=function(_0xe75b57,_0x54c9af){return _0xe75b57['define'](_0x27a7('0x9'),attributes,{'tableName':_0x27a7('0xa'),'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 0b9aa39..fe51e50 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 _0x1dfa=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x1dfa,0x120));var _0xa1df=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x1dfa[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xa1df('0x0'));var util=require(_0xa1df('0x1'));var moment=require(_0xa1df('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1df('0x3'));var fs=require('fs');var Redis=require(_0xa1df('0x4'));var db=require(_0xa1df('0x5'))['db'];var utils=require(_0xa1df('0x6'));var logger=require(_0xa1df('0x7'))(_0xa1df('0x8'));var config=require('../../config/environment');var jayson=require(_0xa1df('0x9'));var client=jayson[_0xa1df('0xa')][_0xa1df('0xb')]({'port':0x232a});config[_0xa1df('0xc')]=_['defaults'](config[_0xa1df('0xc')],{'host':_0xa1df('0xd'),'port':0x18eb});var socket=require(_0xa1df('0xe'))(new Redis(config[_0xa1df('0xc')]));require(_0xa1df('0xf'))[_0xa1df('0x10')](socket);function respondWithRpcPromise(_0x53f878,_0x43b37e,_0x1d15b9){return new BPromise(function(_0x181491,_0x57bea0){return client['request'](_0x53f878,_0x1d15b9)['then'](function(_0x1df9d4){logger[_0xa1df('0x11')](_0xa1df('0x12'),_0x43b37e,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x43b37e,_0xa1df('0x13'),JSON['stringify'](_0x1df9d4));if(_0x1df9d4[_0xa1df('0x14')]){if(_0x1df9d4['error'][_0xa1df('0x15')]===0x1f4){logger[_0xa1df('0x14')](_0xa1df('0x12'),_0x43b37e,_0x1df9d4['error'][_0xa1df('0x16')]);return _0x57bea0(_0x1df9d4[_0xa1df('0x14')][_0xa1df('0x16')]);}logger[_0xa1df('0x14')](_0xa1df('0x12'),_0x43b37e,_0x1df9d4[_0xa1df('0x14')]['message']);return _0x181491(_0x1df9d4[_0xa1df('0x14')]['message']);}else{logger['info'](_0xa1df('0x12'),_0x43b37e,_0xa1df('0x13'));_0x181491(_0x1df9d4[_0xa1df('0x17')]['message']);}})['catch'](function(_0x1c8e3c){logger[_0xa1df('0x14')]('DashboardItem,\x20%s,\x20%s',_0x43b37e,_0x1c8e3c);_0x57bea0(_0x1c8e3c);});});} \ No newline at end of file +var _0xdf1d=['message','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf1d,0xd2));var _0xddf1=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xdf1d[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xddf1('0x0'));var util=require('util');var moment=require(_0xddf1('0x1'));var BPromise=require(_0xddf1('0x2'));var rs=require(_0xddf1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xddf1('0x4'));var logger=require('../../config/logger')(_0xddf1('0x5'));var config=require(_0xddf1('0x6'));var jayson=require(_0xddf1('0x7'));var client=jayson[_0xddf1('0x8')][_0xddf1('0x9')]({'port':0x232a});config[_0xddf1('0xa')]=_[_0xddf1('0xb')](config[_0xddf1('0xa')],{'host':_0xddf1('0xc'),'port':0x18eb});var socket=require(_0xddf1('0xd'))(new Redis(config[_0xddf1('0xa')]));require('./dashboardItem.socket')[_0xddf1('0xe')](socket);function respondWithRpcPromise(_0x190239,_0x3e34d1,_0x51fed2){return new BPromise(function(_0x13fee8,_0x59ef01){return client[_0xddf1('0xf')](_0x190239,_0x51fed2)[_0xddf1('0x10')](function(_0x4253c3){logger[_0xddf1('0x11')](_0xddf1('0x12'),_0x3e34d1,_0xddf1('0x13'));logger[_0xddf1('0x14')](_0xddf1('0x15'),_0x3e34d1,'request\x20sent',JSON[_0xddf1('0x16')](_0x4253c3));if(_0x4253c3['error']){if(_0x4253c3[_0xddf1('0x17')]['code']===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x3e34d1,_0x4253c3['error']['message']);return _0x59ef01(_0x4253c3['error'][_0xddf1('0x18')]);}logger[_0xddf1('0x17')](_0xddf1('0x12'),_0x3e34d1,_0x4253c3[_0xddf1('0x17')][_0xddf1('0x18')]);return _0x13fee8(_0x4253c3[_0xddf1('0x17')][_0xddf1('0x18')]);}else{logger[_0xddf1('0x11')](_0xddf1('0x12'),_0x3e34d1,'request\x20sent');_0x13fee8(_0x4253c3[_0xddf1('0x19')][_0xddf1('0x18')]);}})['catch'](function(_0x293f3f){logger[_0xddf1('0x17')](_0xddf1('0x12'),_0x3e34d1,_0x293f3f);_0x59ef01(_0x293f3f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index d775ceb..ebbd917 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 _0x2f8b=['update','emit','removeListener','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x34a3be,_0x165352){var _0x4c53c7=function(_0x5a4580){while(--_0x5a4580){_0x34a3be['push'](_0x34a3be['shift']());}};_0x4c53c7(++_0x165352);}(_0x2f8b,0xd5));var _0xb2f8=function(_0x5ce90e,_0x3f3f61){_0x5ce90e=_0x5ce90e-0x0;var _0x23128b=_0x2f8b[_0x5ce90e];return _0x23128b;};'use strict';var DashboardItemEvents=require(_0xb2f8('0x0'));var events=[_0xb2f8('0x1'),_0xb2f8('0x2'),_0xb2f8('0x3')];function createListener(_0x94ab32,_0x140d73){return function(_0x3c6cb9){_0x140d73[_0xb2f8('0x4')](_0x94ab32,_0x3c6cb9);};}function removeListener(_0x1fe044,_0x305afd){return function(){DashboardItemEvents[_0xb2f8('0x5')](_0x1fe044,_0x305afd);};}exports['register']=function(_0x4fe684){for(var _0x27748c=0x0,_0x36171f=events[_0xb2f8('0x6')];_0x27748c<_0x36171f;_0x27748c++){var _0x16adaa=events[_0x27748c];var _0x1e22be=createListener(_0xb2f8('0x7')+_0x16adaa,_0x4fe684);DashboardItemEvents['on'](_0x16adaa,_0x1e22be);}}; \ No newline at end of file +var _0xb7ed=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0x12d93a,_0x460b08){var _0x5e0913=function(_0x353783){while(--_0x353783){_0x12d93a['push'](_0x12d93a['shift']());}};_0x5e0913(++_0x460b08);}(_0xb7ed,0xc9));var _0xdb7e=function(_0x132887,_0x8a429e){_0x132887=_0x132887-0x0;var _0x4edd79=_0xb7ed[_0x132887];return _0x4edd79;};'use strict';var DashboardItemEvents=require(_0xdb7e('0x0'));var events=[_0xdb7e('0x1'),_0xdb7e('0x2'),_0xdb7e('0x3')];function createListener(_0x12067c,_0x19bb81){return function(_0x12b1e7){_0x19bb81[_0xdb7e('0x4')](_0x12067c,_0x12b1e7);};}function removeListener(_0xbd9b14,_0x13c016){return function(){DashboardItemEvents[_0xdb7e('0x5')](_0xbd9b14,_0x13c016);};}exports[_0xdb7e('0x6')]=function(_0x454926){for(var _0x23a25c=0x0,_0x4dbcb3=events['length'];_0x23a25c<_0x4dbcb3;_0x23a25c++){var _0x3608a4=events[_0x23a25c];var _0x5c0b21=createListener(_0xdb7e('0x7')+_0x3608a4,_0x454926);DashboardItemEvents['on'](_0x3608a4,_0x5c0b21);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 2c2a0df..2ebed64 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 _0x1a5e=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','create','update','delete'];(function(_0x31e527,_0x4cfdb4){var _0x3794c7=function(_0x5c89fa){while(--_0x5c89fa){_0x31e527['push'](_0x31e527['shift']());}};_0x3794c7(++_0x4cfdb4);}(_0x1a5e,0x1ee));var _0xe1a5=function(_0x443b72,_0x1245cb){_0x443b72=_0x443b72-0x0;var _0x5714f3=_0x1a5e[_0x443b72];return _0x5714f3;};'use strict';var multer=require(_0xe1a5('0x0'));var util=require(_0xe1a5('0x1'));var path=require(_0xe1a5('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1a5('0x3'));var router=express[_0xe1a5('0x4')]();var fs_extra=require(_0xe1a5('0x5'));var auth=require(_0xe1a5('0x6'));var interaction=require(_0xe1a5('0x7'));var config=require(_0xe1a5('0x8'));var controller=require('./dashboardItem.controller');router[_0xe1a5('0x9')](_0xe1a5('0xa'),auth[_0xe1a5('0xb')](),controller[_0xe1a5('0xc')]);router['post']('/',auth[_0xe1a5('0xb')](),controller[_0xe1a5('0xd')]);router['put'](_0xe1a5('0xa'),auth['isAuthenticated'](),controller[_0xe1a5('0xe')]);router[_0xe1a5('0xf')](_0xe1a5('0xa'),auth[_0xe1a5('0xb')](),controller[_0xe1a5('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd583=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xd583,0x166));var _0x3d58=function(_0x7aef65,_0x14a04d){_0x7aef65=_0x7aef65-0x0;var _0x1ab3b5=_0xd583[_0x7aef65];return _0x1ab3b5;};'use strict';var multer=require(_0x3d58('0x0'));var util=require(_0x3d58('0x1'));var path=require(_0x3d58('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d58('0x3'));var router=express[_0x3d58('0x4')]();var fs_extra=require(_0x3d58('0x5'));var auth=require(_0x3d58('0x6'));var interaction=require(_0x3d58('0x7'));var config=require(_0x3d58('0x8'));var controller=require(_0x3d58('0x9'));router[_0x3d58('0xa')](_0x3d58('0xb'),auth[_0x3d58('0xc')](),controller[_0x3d58('0xd')]);router[_0x3d58('0xe')]('/',auth[_0x3d58('0xc')](),controller[_0x3d58('0xf')]);router['put'](_0x3d58('0xb'),auth[_0x3d58('0xc')](),controller[_0x3d58('0x10')]);router[_0x3d58('0x11')](_0x3d58('0xb'),auth[_0x3d58('0xc')](),controller[_0x3d58('0x12')]);module[_0x3d58('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 e176855..fce5a57 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 _0xe06f=['second','sequelize','exports','STRING','ENUM','first'];(function(_0x29974f,_0x327260){var _0x4f656b=function(_0x4b80c8){while(--_0x4b80c8){_0x29974f['push'](_0x29974f['shift']());}};_0x4f656b(++_0x327260);}(_0xe06f,0x1e1));var _0xfe06=function(_0x58fb2f,_0xf45456){_0x58fb2f=_0x58fb2f-0x0;var _0x569fa6=_0xe06f[_0x58fb2f];return _0x569fa6;};'use strict';var Sequelize=require(_0xfe06('0x0'));module[_0xfe06('0x1')]={'name':{'type':Sequelize[_0xfe06('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xfe06('0x3')](_0xfe06('0x4'),_0xfe06('0x5'),'third'),'allowNull':![],'defaultValue':_0xfe06('0x4')},'description':{'type':Sequelize[_0xfe06('0x2')]}}; \ No newline at end of file +var _0x905d=['ENUM','first','second','third','sequelize','exports','STRING'];(function(_0x47856e,_0x56949d){var _0x311ece=function(_0x9f7354){while(--_0x9f7354){_0x47856e['push'](_0x47856e['shift']());}};_0x311ece(++_0x56949d);}(_0x905d,0x100));var _0xd905=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x905d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd905('0x0'));module[_0xd905('0x1')]={'name':{'type':Sequelize[_0xd905('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xd905('0x3')](_0xd905('0x4'),_0xd905('0x5'),_0xd905('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d43cab3..a166fd4 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 _0xb194=['sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','then','destroy','get','Dispositions','error','stack','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xb194,0x1b2));var _0x4b19=function(_0x3ac6a3,_0x3dc212){_0x3ac6a3=_0x3ac6a3-0x0;var _0x16951c=_0xb194[_0x3ac6a3];return _0x16951c;};'use strict';var emlformat=require(_0x4b19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b19('0x1'));var jsonpatch=require(_0x4b19('0x2'));var rp=require(_0x4b19('0x3'));var moment=require(_0x4b19('0x4'));var BPromise=require(_0x4b19('0x5'));var Mustache=require('mustache');var util=require(_0x4b19('0x6'));var path=require(_0x4b19('0x7'));var sox=require('sox');var csv=require(_0x4b19('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b19('0x9'));var _=require('lodash');var squel=require(_0x4b19('0xa'));var crypto=require(_0x4b19('0xb'));var jsforce=require(_0x4b19('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4b19('0xd'));var Papa=require('papaparse');var Redis=require(_0x4b19('0xe'));var authService=require(_0x4b19('0xf'));var qs=require(_0x4b19('0x10'));var as=require(_0x4b19('0x11'));var hardwareService=require(_0x4b19('0x12'));var logger=require(_0x4b19('0x13'))(_0x4b19('0x14'));var utils=require(_0x4b19('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4b19('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5be1b2,_0x1ba972){_0x1ba972=_0x1ba972||0xcc;return function(_0x5167ae){if(_0x5167ae){return _0x5be1b2[_0x4b19('0x17')](_0x1ba972);}return _0x5be1b2['status'](_0x1ba972)[_0x4b19('0x18')]();};}function respondWithResult(_0x820063,_0x317d3b){_0x317d3b=_0x317d3b||0xc8;return function(_0x3a3af4){if(_0x3a3af4){return _0x820063[_0x4b19('0x19')](_0x317d3b)['json'](_0x3a3af4);}};}function respondWithFilteredResult(_0xcaaaf6,_0xffedd7){return function(_0x17c334){if(_0x17c334){var _0x3a19cf=typeof _0xffedd7[_0x4b19('0x1a')]===_0x4b19('0x1b')&&typeof _0xffedd7['limit']===_0x4b19('0x1b');var _0xd3f210=_0x17c334[_0x4b19('0x1c')];var _0xe7696a=_0x3a19cf?0x0:_0xffedd7[_0x4b19('0x1a')];var _0x17c7da=_0x3a19cf?_0x17c334[_0x4b19('0x1c')]:_0xffedd7[_0x4b19('0x1a')]+_0xffedd7['limit'];var _0x28a433;if(_0x17c7da>=_0xd3f210){_0x17c7da=_0xd3f210;_0x28a433=0xc8;}else{_0x28a433=0xce;}_0xcaaaf6['status'](_0x28a433);return _0xcaaaf6[_0x4b19('0x1d')](_0x4b19('0x1e'),_0xe7696a+'-'+_0x17c7da+'/'+_0xd3f210)[_0x4b19('0x1f')](_0x17c334);}return null;};}function patchUpdates(_0x2f2082){return function(_0x37cb0a){try{jsonpatch[_0x4b19('0x20')](_0x37cb0a,_0x2f2082,!![]);}catch(_0x56b421){return BPromise[_0x4b19('0x21')](_0x56b421);}return _0x37cb0a['save']();};}function saveUpdates(_0x19db04,_0x10d407){return function(_0x234632){if(_0x234632){return _0x234632['update'](_0x19db04)[_0x4b19('0x22')](function(_0x52e144){return _0x52e144;});}return null;};}function removeEntity(_0x313108,_0x18d376){return function(_0x53f903){if(_0x53f903){return _0x53f903[_0x4b19('0x23')]()[_0x4b19('0x22')](function(){var _0x569946=_0x53f903[_0x4b19('0x24')]({'plain':!![]});var _0x4c5f27=_0x4b19('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4c5f27,'resourceId':_0x569946['id']}})[_0x4b19('0x22')](function(){return _0x53f903;});})['then'](function(){_0x313108[_0x4b19('0x19')](0xcc)[_0x4b19('0x18')]();});}};}function handleEntityNotFound(_0x28ae60,_0x29ea36){return function(_0x5c6741){if(!_0x5c6741){_0x28ae60[_0x4b19('0x17')](0x194);}return _0x5c6741;};}function handleError(_0xcf1850,_0x5987d6){_0x5987d6=_0x5987d6||0x1f4;return function(_0x2e1fab){logger[_0x4b19('0x26')](_0x2e1fab[_0x4b19('0x27')]);if(_0x2e1fab['name']){delete _0x2e1fab['name'];}_0xcf1850[_0x4b19('0x19')](_0x5987d6)[_0x4b19('0x28')](_0x2e1fab);};}exports[_0x4b19('0x29')]=function(_0x22798d,_0x1d63a3){var _0x4b4463={},_0x15d240={},_0x1b75c={'count':0x0,'rows':[]};var _0x5e8685=_[_0x4b19('0x2a')](db[_0x4b19('0x2b')][_0x4b19('0x2c')],function(_0x2549e5){return{'name':_0x2549e5[_0x4b19('0x2d')],'type':_0x2549e5[_0x4b19('0x2e')][_0x4b19('0x2f')]};});_0x15d240[_0x4b19('0x30')]=_[_0x4b19('0x2a')](_0x5e8685,'name');_0x15d240[_0x4b19('0x31')]=_['keys'](_0x22798d[_0x4b19('0x31')]);_0x15d240[_0x4b19('0x32')]=_['intersection'](_0x15d240[_0x4b19('0x30')],_0x15d240[_0x4b19('0x31')]);_0x4b4463[_0x4b19('0x33')]=_[_0x4b19('0x34')](_0x15d240[_0x4b19('0x30')],qs[_0x4b19('0x35')](_0x22798d[_0x4b19('0x31')][_0x4b19('0x35')]));_0x4b4463[_0x4b19('0x33')]=_0x4b4463[_0x4b19('0x33')][_0x4b19('0x36')]?_0x4b4463[_0x4b19('0x33')]:_0x15d240[_0x4b19('0x30')];if(!_0x22798d['query'][_0x4b19('0x37')]('nolimit')){_0x4b4463['limit']=qs[_0x4b19('0x38')](_0x22798d[_0x4b19('0x31')][_0x4b19('0x38')]);_0x4b4463[_0x4b19('0x1a')]=qs[_0x4b19('0x1a')](_0x22798d[_0x4b19('0x31')][_0x4b19('0x1a')]);}_0x4b4463[_0x4b19('0x39')]=qs[_0x4b19('0x3a')](_0x22798d[_0x4b19('0x31')][_0x4b19('0x3a')]);_0x4b4463['where']=qs[_0x4b19('0x32')](_[_0x4b19('0x3b')](_0x22798d['query'],_0x15d240['filters']),_0x5e8685);if(_0x22798d[_0x4b19('0x31')][_0x4b19('0x3c')]){_0x4b4463[_0x4b19('0x3d')]=_[_0x4b19('0x3e')](_0x4b4463[_0x4b19('0x3d')],{'$or':_['map'](_0x5e8685,function(_0x5171c0){if(_0x5171c0[_0x4b19('0x2e')]!==_0x4b19('0x3f')){var _0x3d4611={};_0x3d4611[_0x5171c0[_0x4b19('0x40')]]={'$like':'%'+_0x22798d[_0x4b19('0x31')][_0x4b19('0x3c')]+'%'};return _0x3d4611;}})});}_0x4b4463=_[_0x4b19('0x3e')]({},_0x4b4463,_0x22798d[_0x4b19('0x41')]);var _0x280863={'where':_0x4b4463[_0x4b19('0x3d')]};return db[_0x4b19('0x2b')][_0x4b19('0x1c')](_0x280863)[_0x4b19('0x22')](function(_0x516999){_0x1b75c[_0x4b19('0x1c')]=_0x516999;if(_0x22798d[_0x4b19('0x31')][_0x4b19('0x42')]){_0x4b4463['include']=[{'all':!![]}];}return db[_0x4b19('0x2b')][_0x4b19('0x43')](_0x4b4463);})[_0x4b19('0x22')](function(_0x30023b){_0x1b75c[_0x4b19('0x44')]=_0x30023b;return _0x1b75c;})['then'](respondWithFilteredResult(_0x1d63a3,_0x4b4463))[_0x4b19('0x45')](handleError(_0x1d63a3,null));};exports['show']=function(_0x45d91c,_0x78a534){var _0x351035={'raw':!![],'where':{'id':_0x45d91c[_0x4b19('0x46')]['id']}},_0x54f535={};_0x54f535[_0x4b19('0x30')]=_[_0x4b19('0x47')](db[_0x4b19('0x2b')]['rawAttributes']);_0x54f535['query']=_['keys'](_0x45d91c[_0x4b19('0x31')]);_0x54f535[_0x4b19('0x32')]=_[_0x4b19('0x34')](_0x54f535['model'],_0x54f535[_0x4b19('0x31')]);_0x351035['attributes']=_[_0x4b19('0x34')](_0x54f535[_0x4b19('0x30')],qs[_0x4b19('0x35')](_0x45d91c[_0x4b19('0x31')][_0x4b19('0x35')]));_0x351035[_0x4b19('0x33')]=_0x351035['attributes'][_0x4b19('0x36')]?_0x351035[_0x4b19('0x33')]:_0x54f535[_0x4b19('0x30')];if(_0x45d91c[_0x4b19('0x31')][_0x4b19('0x42')]){_0x351035['include']=[{'all':!![]}];}_0x351035=_['merge']({},_0x351035,_0x45d91c[_0x4b19('0x41')]);return db[_0x4b19('0x2b')][_0x4b19('0x48')](_0x351035)[_0x4b19('0x22')](handleEntityNotFound(_0x78a534,null))['then'](respondWithResult(_0x78a534,null))['catch'](handleError(_0x78a534,null));};exports[_0x4b19('0x49')]=function(_0xe70530,_0x53b0df){return db['Disposition'][_0x4b19('0x49')](_0xe70530[_0x4b19('0x4a')],{})[_0x4b19('0x22')](function(_0x3ca5f8){var _0x15f970=_0xe70530['user'][_0x4b19('0x24')]({'plain':!![]});if(!_0x15f970)throw new Error(_0x4b19('0x4b'));if(_0x15f970['role']===_0x4b19('0x4c')){var _0x4314ff=_0x3ca5f8['get']({'plain':!![]});var _0x47521b=_0x4b19('0x25');return db[_0x4b19('0x4d')][_0x4b19('0x48')]({'where':{'name':_0x47521b,'userProfileId':_0x15f970[_0x4b19('0x4e')]},'raw':!![]})[_0x4b19('0x22')](function(_0x1b696e){if(_0x1b696e&&_0x1b696e[_0x4b19('0x4f')]===0x0){return db[_0x4b19('0x50')][_0x4b19('0x49')]({'name':_0x4314ff[_0x4b19('0x40')],'resourceId':_0x4314ff['id'],'type':_0x1b696e[_0x4b19('0x40')],'sectionId':_0x1b696e['id']},{})['then'](function(){return _0x3ca5f8;});}else{return _0x3ca5f8;}})[_0x4b19('0x45')](function(_0x40d1dc){logger[_0x4b19('0x26')](_0x4b19('0x51'),_0x40d1dc);throw _0x40d1dc;});}return _0x3ca5f8;})[_0x4b19('0x22')](respondWithResult(_0x53b0df,0xc9))[_0x4b19('0x45')](handleError(_0x53b0df,null));};exports['update']=function(_0x13568b,_0x5b0490){if(_0x13568b[_0x4b19('0x4a')]['id']){delete _0x13568b[_0x4b19('0x4a')]['id'];}return db[_0x4b19('0x2b')]['find']({'where':{'id':_0x13568b[_0x4b19('0x46')]['id']}})[_0x4b19('0x22')](handleEntityNotFound(_0x5b0490,null))[_0x4b19('0x22')](saveUpdates(_0x13568b['body'],null))['then'](respondWithResult(_0x5b0490,null))[_0x4b19('0x45')](handleError(_0x5b0490,null));};exports[_0x4b19('0x23')]=function(_0x3b700b,_0x44a82d){return db['Disposition'][_0x4b19('0x48')]({'where':{'id':_0x3b700b[_0x4b19('0x46')]['id']}})['then'](handleEntityNotFound(_0x44a82d,null))[_0x4b19('0x22')](removeEntity(_0x44a82d,null))['catch'](handleError(_0x44a82d,null));}; \ No newline at end of file +var _0x3975=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','UserProfileResource','end','error','stack','name','send','Disposition','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3975,0x197));var _0x5397=function(_0x562b53,_0x9ec463){_0x562b53=_0x562b53-0x0;var _0x3f99be=_0x3975[_0x562b53];return _0x3f99be;};'use strict';var emlformat=require(_0x5397('0x0'));var rimraf=require(_0x5397('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5397('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5397('0x3'));var Mustache=require(_0x5397('0x4'));var util=require('util');var path=require(_0x5397('0x5'));var sox=require(_0x5397('0x6'));var csv=require(_0x5397('0x7'));var ejs=require(_0x5397('0x8'));var fs=require('fs');var fs_extra=require(_0x5397('0x9'));var _=require(_0x5397('0xa'));var squel=require(_0x5397('0xb'));var crypto=require(_0x5397('0xc'));var jsforce=require(_0x5397('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5397('0xe'));var Papa=require('papaparse');var Redis=require(_0x5397('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5397('0x10'));var as=require(_0x5397('0x11'));var hardwareService=require(_0x5397('0x12'));var logger=require(_0x5397('0x13'))(_0x5397('0x14'));var utils=require(_0x5397('0x15'));var config=require(_0x5397('0x16'));var licenseUtil=require(_0x5397('0x17'));var db=require(_0x5397('0x18'))['db'];function respondWithStatusCode(_0x2aaea6,_0x32b41a){_0x32b41a=_0x32b41a||0xcc;return function(_0x51046b){if(_0x51046b){return _0x2aaea6[_0x5397('0x19')](_0x32b41a);}return _0x2aaea6[_0x5397('0x1a')](_0x32b41a)['end']();};}function respondWithResult(_0x2cb8fd,_0x4e8bed){_0x4e8bed=_0x4e8bed||0xc8;return function(_0x299ea1){if(_0x299ea1){return _0x2cb8fd[_0x5397('0x1a')](_0x4e8bed)['json'](_0x299ea1);}};}function respondWithFilteredResult(_0x13d561,_0x1e53b0){return function(_0x2c9c59){if(_0x2c9c59){var _0x520116=typeof _0x1e53b0[_0x5397('0x1b')]===_0x5397('0x1c')&&typeof _0x1e53b0[_0x5397('0x1d')]===_0x5397('0x1c');var _0x46888a=_0x2c9c59[_0x5397('0x1e')];var _0x5da886=_0x520116?0x0:_0x1e53b0[_0x5397('0x1b')];var _0x954aa9=_0x520116?_0x2c9c59[_0x5397('0x1e')]:_0x1e53b0[_0x5397('0x1b')]+_0x1e53b0['limit'];var _0x472624;if(_0x954aa9>=_0x46888a){_0x954aa9=_0x46888a;_0x472624=0xc8;}else{_0x472624=0xce;}_0x13d561[_0x5397('0x1a')](_0x472624);return _0x13d561[_0x5397('0x1f')](_0x5397('0x20'),_0x5da886+'-'+_0x954aa9+'/'+_0x46888a)['json'](_0x2c9c59);}return null;};}function patchUpdates(_0x105a9d){return function(_0x2c5a5f){try{jsonpatch[_0x5397('0x21')](_0x2c5a5f,_0x105a9d,!![]);}catch(_0x102b13){return BPromise[_0x5397('0x22')](_0x102b13);}return _0x2c5a5f[_0x5397('0x23')]();};}function saveUpdates(_0x51d386,_0x3b6086){return function(_0x428c46){if(_0x428c46){return _0x428c46[_0x5397('0x24')](_0x51d386)['then'](function(_0x3ab290){return _0x3ab290;});}return null;};}function removeEntity(_0x4994dc,_0x425e13){return function(_0x5ddfa3){if(_0x5ddfa3){return _0x5ddfa3[_0x5397('0x25')]()[_0x5397('0x26')](function(){var _0x3c576d=_0x5ddfa3['get']({'plain':!![]});var _0x3abd3b=_0x5397('0x27');return db[_0x5397('0x28')]['destroy']({'where':{'type':_0x3abd3b,'resourceId':_0x3c576d['id']}})['then'](function(){return _0x5ddfa3;});})[_0x5397('0x26')](function(){_0x4994dc[_0x5397('0x1a')](0xcc)[_0x5397('0x29')]();});}};}function handleEntityNotFound(_0x30f2ed,_0x13f5e1){return function(_0x2e64a7){if(!_0x2e64a7){_0x30f2ed[_0x5397('0x19')](0x194);}return _0x2e64a7;};}function handleError(_0x3b3a10,_0x59af35){_0x59af35=_0x59af35||0x1f4;return function(_0x103dc2){logger[_0x5397('0x2a')](_0x103dc2[_0x5397('0x2b')]);if(_0x103dc2[_0x5397('0x2c')]){delete _0x103dc2[_0x5397('0x2c')];}_0x3b3a10[_0x5397('0x1a')](_0x59af35)[_0x5397('0x2d')](_0x103dc2);};}exports['index']=function(_0x10850d,_0x5c589f){var _0x23c30f={},_0x3b6df0={},_0x3243b9={'count':0x0,'rows':[]};var _0x1ce1e9=_['map'](db[_0x5397('0x2e')][_0x5397('0x2f')],function(_0x19fed3){return{'name':_0x19fed3[_0x5397('0x30')],'type':_0x19fed3['type']['key']};});_0x3b6df0['model']=_[_0x5397('0x31')](_0x1ce1e9,'name');_0x3b6df0[_0x5397('0x32')]=_[_0x5397('0x33')](_0x10850d['query']);_0x3b6df0[_0x5397('0x34')]=_[_0x5397('0x35')](_0x3b6df0[_0x5397('0x36')],_0x3b6df0[_0x5397('0x32')]);_0x23c30f[_0x5397('0x37')]=_[_0x5397('0x35')](_0x3b6df0[_0x5397('0x36')],qs[_0x5397('0x38')](_0x10850d[_0x5397('0x32')][_0x5397('0x38')]));_0x23c30f[_0x5397('0x37')]=_0x23c30f[_0x5397('0x37')][_0x5397('0x39')]?_0x23c30f[_0x5397('0x37')]:_0x3b6df0[_0x5397('0x36')];if(!_0x10850d[_0x5397('0x32')]['hasOwnProperty'](_0x5397('0x3a'))){_0x23c30f[_0x5397('0x1d')]=qs[_0x5397('0x1d')](_0x10850d[_0x5397('0x32')][_0x5397('0x1d')]);_0x23c30f[_0x5397('0x1b')]=qs[_0x5397('0x1b')](_0x10850d['query'][_0x5397('0x1b')]);}_0x23c30f[_0x5397('0x3b')]=qs[_0x5397('0x3c')](_0x10850d['query'][_0x5397('0x3c')]);_0x23c30f[_0x5397('0x3d')]=qs[_0x5397('0x34')](_[_0x5397('0x3e')](_0x10850d['query'],_0x3b6df0[_0x5397('0x34')]),_0x1ce1e9);if(_0x10850d['query'][_0x5397('0x3f')]){_0x23c30f[_0x5397('0x3d')]=_[_0x5397('0x40')](_0x23c30f['where'],{'$or':_[_0x5397('0x31')](_0x1ce1e9,function(_0x2bfd28){if(_0x2bfd28[_0x5397('0x41')]!==_0x5397('0x42')){var _0x3e5f02={};_0x3e5f02[_0x2bfd28['name']]={'$like':'%'+_0x10850d['query']['filter']+'%'};return _0x3e5f02;}})});}_0x23c30f=_[_0x5397('0x40')]({},_0x23c30f,_0x10850d[_0x5397('0x43')]);var _0x2685ce={'where':_0x23c30f[_0x5397('0x3d')]};return db[_0x5397('0x2e')][_0x5397('0x1e')](_0x2685ce)['then'](function(_0x307e27){_0x3243b9[_0x5397('0x1e')]=_0x307e27;if(_0x10850d['query'][_0x5397('0x44')]){_0x23c30f['include']=[{'all':!![]}];}return db[_0x5397('0x2e')][_0x5397('0x45')](_0x23c30f);})[_0x5397('0x26')](function(_0x39211b){_0x3243b9[_0x5397('0x46')]=_0x39211b;return _0x3243b9;})['then'](respondWithFilteredResult(_0x5c589f,_0x23c30f))[_0x5397('0x47')](handleError(_0x5c589f,null));};exports[_0x5397('0x48')]=function(_0x24793c,_0x4d7c90){var _0x6a8a8a={'raw':!![],'where':{'id':_0x24793c[_0x5397('0x49')]['id']}},_0x1ff194={};_0x1ff194[_0x5397('0x36')]=_[_0x5397('0x33')](db[_0x5397('0x2e')]['rawAttributes']);_0x1ff194[_0x5397('0x32')]=_[_0x5397('0x33')](_0x24793c[_0x5397('0x32')]);_0x1ff194[_0x5397('0x34')]=_[_0x5397('0x35')](_0x1ff194[_0x5397('0x36')],_0x1ff194[_0x5397('0x32')]);_0x6a8a8a[_0x5397('0x37')]=_['intersection'](_0x1ff194[_0x5397('0x36')],qs[_0x5397('0x38')](_0x24793c[_0x5397('0x32')][_0x5397('0x38')]));_0x6a8a8a[_0x5397('0x37')]=_0x6a8a8a[_0x5397('0x37')][_0x5397('0x39')]?_0x6a8a8a[_0x5397('0x37')]:_0x1ff194['model'];if(_0x24793c[_0x5397('0x32')][_0x5397('0x44')]){_0x6a8a8a[_0x5397('0x4a')]=[{'all':!![]}];}_0x6a8a8a=_[_0x5397('0x40')]({},_0x6a8a8a,_0x24793c[_0x5397('0x43')]);return db[_0x5397('0x2e')][_0x5397('0x4b')](_0x6a8a8a)[_0x5397('0x26')](handleEntityNotFound(_0x4d7c90,null))[_0x5397('0x26')](respondWithResult(_0x4d7c90,null))[_0x5397('0x47')](handleError(_0x4d7c90,null));};exports[_0x5397('0x4c')]=function(_0x49fa38,_0x48154e){return db[_0x5397('0x2e')][_0x5397('0x4c')](_0x49fa38[_0x5397('0x4d')],{})[_0x5397('0x26')](function(_0x1498ae){var _0x5d97e5=_0x49fa38[_0x5397('0x4e')]['get']({'plain':!![]});if(!_0x5d97e5)throw new Error(_0x5397('0x4f'));if(_0x5d97e5[_0x5397('0x50')]===_0x5397('0x4e')){var _0x527825=_0x1498ae['get']({'plain':!![]});var _0x53703f='Dispositions';return db[_0x5397('0x51')][_0x5397('0x4b')]({'where':{'name':_0x53703f,'userProfileId':_0x5d97e5[_0x5397('0x52')]},'raw':!![]})['then'](function(_0x36b114){if(_0x36b114&&_0x36b114[_0x5397('0x53')]===0x0){return db[_0x5397('0x28')][_0x5397('0x4c')]({'name':_0x527825[_0x5397('0x2c')],'resourceId':_0x527825['id'],'type':_0x36b114[_0x5397('0x2c')],'sectionId':_0x36b114['id']},{})[_0x5397('0x26')](function(){return _0x1498ae;});}else{return _0x1498ae;}})['catch'](function(_0x417037){logger[_0x5397('0x2a')](_0x5397('0x54'),_0x417037);throw _0x417037;});}return _0x1498ae;})[_0x5397('0x26')](respondWithResult(_0x48154e,0xc9))['catch'](handleError(_0x48154e,null));};exports[_0x5397('0x24')]=function(_0x3789ae,_0x3d3c5c){if(_0x3789ae[_0x5397('0x4d')]['id']){delete _0x3789ae['body']['id'];}return db[_0x5397('0x2e')]['find']({'where':{'id':_0x3789ae['params']['id']}})[_0x5397('0x26')](handleEntityNotFound(_0x3d3c5c,null))[_0x5397('0x26')](saveUpdates(_0x3789ae[_0x5397('0x4d')],null))[_0x5397('0x26')](respondWithResult(_0x3d3c5c,null))[_0x5397('0x47')](handleError(_0x3d3c5c,null));};exports['destroy']=function(_0x1839bf,_0x38970b){return db[_0x5397('0x2e')]['find']({'where':{'id':_0x1839bf['params']['id']}})['then'](handleEntityNotFound(_0x38970b,null))[_0x5397('0x26')](removeEntity(_0x38970b,null))['catch'](handleError(_0x38970b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index bdb90b3..754af1e 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 _0x6289=['name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x2a718b,_0x24b439){var _0xb13700=function(_0x41358b){while(--_0x41358b){_0x2a718b['push'](_0x2a718b['shift']());}};_0xb13700(++_0x24b439);}(_0x6289,0xb6));var _0x9628=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x6289[_0x3825a8];return _0xabc9bc;};'use strict';var _=require(_0x9628('0x0'));var util=require(_0x9628('0x1'));var logger=require(_0x9628('0x2'))(_0x9628('0x3'));var moment=require(_0x9628('0x4'));var BPromise=require(_0x9628('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9628('0x6'));var rimraf=require(_0x9628('0x7'));var config=require(_0x9628('0x8'));var attributes=require(_0x9628('0x9'));module[_0x9628('0xa')]=function(_0x22cfb2,_0x132ea0){return _0x22cfb2[_0x9628('0xb')](_0x9628('0xc'),attributes,{'tableName':_0x9628('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9628('0xe'),'fields':[_0x9628('0xf'),_0x9628('0x10')]},{'unique':!![],'name':_0x9628('0x11'),'fields':['name',_0x9628('0x12')]},{'unique':!![],'name':_0x9628('0x13'),'fields':[_0x9628('0xf'),_0x9628('0x14')]},{'unique':!![],'name':_0x9628('0x15'),'fields':[_0x9628('0xf'),_0x9628('0x16')]},{'unique':!![],'name':_0x9628('0x17'),'fields':[_0x9628('0xf'),_0x9628('0x18')]},{'unique':!![],'name':_0x9628('0x19'),'fields':[_0x9628('0xf'),_0x9628('0x1a')]},{'unique':!![],'name':_0x9628('0x1b'),'fields':[_0x9628('0xf'),_0x9628('0x1c')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb73a=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name_chat','ChatWebsiteId','name','MailAccountId','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb73a,0xf0));var _0xab73=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0xb73a[_0x5712f8];return _0x14a364;};'use strict';var _=require(_0xab73('0x0'));var util=require(_0xab73('0x1'));var logger=require(_0xab73('0x2'))(_0xab73('0x3'));var moment=require(_0xab73('0x4'));var BPromise=require(_0xab73('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab73('0x6'));var rimraf=require(_0xab73('0x7'));var config=require('../../config/environment');var attributes=require(_0xab73('0x8'));module[_0xab73('0x9')]=function(_0x21a233,_0x537a17){return _0x21a233['define'](_0xab73('0xa'),attributes,{'tableName':_0xab73('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xab73('0xc'),'fields':['name',_0xab73('0xd')]},{'unique':!![],'name':_0xab73('0xe'),'fields':['name',_0xab73('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0xab73('0x10'),_0xab73('0x11')]},{'unique':!![],'name':_0xab73('0x12'),'fields':[_0xab73('0x10'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0xab73('0x13')]},{'unique':!![],'name':_0xab73('0x14'),'fields':[_0xab73('0x10'),_0xab73('0x15')]},{'unique':!![],'name':_0xab73('0x16'),'fields':[_0xab73('0x10'),_0xab73('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 fc19f66..19ce466 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(_0x590b1e,_0x1bd90e){var _0x25a3e9=function(_0x107430){while(--_0x107430){_0x590b1e['push'](_0x590b1e['shift']());}};_0x25a3e9(++_0x1bd90e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2140ac,_0x11bc27){var _0x108da4=function(_0x29b48f){while(--_0x29b48f){_0x2140ac['push'](_0x2140ac['shift']());}};_0x108da4(++_0x11bc27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 847ebb5..fb90cbe 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 _0x02a2=['./disposition.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x574284,_0x1e072e){var _0x19335e=function(_0x2c1a97){while(--_0x2c1a97){_0x574284['push'](_0x574284['shift']());}};_0x19335e(++_0x1e072e);}(_0x02a2,0x15a));var _0x202a=function(_0x5744b2,_0x1d7aad){_0x5744b2=_0x5744b2-0x0;var _0x2f3a26=_0x02a2[_0x5744b2];return _0x2f3a26;};'use strict';var multer=require(_0x202a('0x0'));var util=require(_0x202a('0x1'));var path=require('path');var timeout=require(_0x202a('0x2'));var express=require(_0x202a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x202a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x202a('0x5'));var controller=require(_0x202a('0x6'));router[_0x202a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x202a('0x7')](_0x202a('0x8'),auth[_0x202a('0x9')](),controller[_0x202a('0xa')]);router[_0x202a('0xb')]('/',auth[_0x202a('0x9')](),controller['create']);router[_0x202a('0xc')](_0x202a('0x8'),auth[_0x202a('0x9')](),controller[_0x202a('0xd')]);router['delete'](_0x202a('0x8'),auth[_0x202a('0x9')](),controller[_0x202a('0xe')]);module[_0x202a('0xf')]=router; \ No newline at end of file +var _0xf079=['create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','show'];(function(_0x29d9d5,_0x5a1bd8){var _0x1be395=function(_0x54e84f){while(--_0x54e84f){_0x29d9d5['push'](_0x29d9d5['shift']());}};_0x1be395(++_0x5a1bd8);}(_0xf079,0x193));var _0x9f07=function(_0x1c34ee,_0x28e116){_0x1c34ee=_0x1c34ee-0x0;var _0x58f2ca=_0xf079[_0x1c34ee];return _0x58f2ca;};'use strict';var multer=require(_0x9f07('0x0'));var util=require('util');var path=require(_0x9f07('0x1'));var timeout=require(_0x9f07('0x2'));var express=require('express');var router=express[_0x9f07('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9f07('0x4'));var interaction=require(_0x9f07('0x5'));var config=require(_0x9f07('0x6'));var controller=require(_0x9f07('0x7'));router[_0x9f07('0x8')]('/',auth[_0x9f07('0x9')](),controller['index']);router[_0x9f07('0x8')]('/:id',auth[_0x9f07('0x9')](),controller[_0x9f07('0xa')]);router['post']('/',auth[_0x9f07('0x9')](),controller[_0x9f07('0xb')]);router[_0x9f07('0xc')](_0x9f07('0xd'),auth[_0x9f07('0x9')](),controller[_0x9f07('0xe')]);router[_0x9f07('0xf')](_0x9f07('0xd'),auth[_0x9f07('0x9')](),controller[_0x9f07('0x10')]);module[_0x9f07('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9e8ec36..ed35174 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 _0xd5a0=['12000','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','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','STRING','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600'];(function(_0x3e7804,_0x121853){var _0x56efda=function(_0x1996f3){while(--_0x1996f3){_0x3e7804['push'](_0x3e7804['shift']());}};_0x56efda(++_0x121853);}(_0xd5a0,0xa9));var _0x0d5a=function(_0x1dcc1c,_0x261670){_0x1dcc1c=_0x1dcc1c-0x0;var _0x4ada9a=_0xd5a0[_0x1dcc1c];return _0x4ada9a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0d5a('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0d5a('0x0')]},'ecm':{'type':Sequelize['ENUM'](_0x0d5a('0x1'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0d5a('0x0')],'defaultValue':_0x0d5a('0x2')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0x0d5a('0x3'),_0x0d5a('0x4'),_0x0d5a('0x5'),_0x0d5a('0x6'),'12000','14400'),'defaultValue':_0x0d5a('0x4')},'maxrate':{'type':Sequelize['ENUM'](_0x0d5a('0x3'),_0x0d5a('0x4'),'7200',_0x0d5a('0x6'),_0x0d5a('0x7'),_0x0d5a('0x8')),'defaultValue':_0x0d5a('0x8')},'modem':{'type':Sequelize[_0x0d5a('0x0')],'defaultValue':_0x0d5a('0x9')},'gateway':{'type':Sequelize[_0x0d5a('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0d5a('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x0d5a('0xa'),_0x0d5a('0xb'),_0x0d5a('0xc'),_0x0d5a('0xd')),'defaultValue':_0x0d5a('0xa')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0d5a('0xe');}},'notificationSound':{'type':Sequelize[_0x0d5a('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0d5a('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0d5a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0d5a('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0d5a('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0d5a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0d5a('0x10')],'allowNull':!![],'defaultValue':null,'comment':_0x0d5a('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x0d5a('0xf')],'defaultValue':![],'comment':_0x0d5a('0x12'),'set':function(_0x450a83){if(!_0x450a83)this[_0x0d5a('0x13')](_0x0d5a('0x14'),null);this[_0x0d5a('0x13')](_0x0d5a('0x15'),_0x450a83);}}}; \ No newline at end of file +var _0xa293=['localstationid','2400','4800','7200','9600','12000','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','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x59139f,_0x2b1bd7){var _0xa99b4f=function(_0x4728dd){while(--_0x4728dd){_0x59139f['push'](_0x59139f['shift']());}};_0xa99b4f(++_0x2b1bd7);}(_0xa293,0x16a));var _0x3a29=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa293[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x3a29('0x0'));module[_0x3a29('0x1')]={'name':{'type':Sequelize[_0x3a29('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3a29('0x2')]},'ecm':{'type':Sequelize[_0x3a29('0x3')]('yes','no'),'defaultValue':_0x3a29('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x3a29('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x3a29('0x6')},'minrate':{'type':Sequelize[_0x3a29('0x3')](_0x3a29('0x7'),_0x3a29('0x8'),_0x3a29('0x9'),_0x3a29('0xa'),_0x3a29('0xb'),_0x3a29('0xc')),'defaultValue':_0x3a29('0x8')},'maxrate':{'type':Sequelize[_0x3a29('0x3')](_0x3a29('0x7'),'4800',_0x3a29('0x9'),_0x3a29('0xa'),'12000',_0x3a29('0xc')),'defaultValue':_0x3a29('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x3a29('0xd')},'gateway':{'type':Sequelize[_0x3a29('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3a29('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x3a29('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x3a29('0x3')](_0x3a29('0xf'),'IAX','DADHI','KHOMP'),'defaultValue':_0x3a29('0xf')},'key':{'type':Sequelize[_0x3a29('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3a29('0x10')],'defaultValue':function(){return _0x3a29('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a29('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3a29('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3a29('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a29('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3a29('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a29('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x3a29('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x3a29('0x12')],'defaultValue':![],'comment':_0x3a29('0x14'),'set':function(_0x12d98d){if(!_0x12d98d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x3a29('0x15')](_0x3a29('0x16'),_0x12d98d);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index b0a438b..7754851 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 _0x40de=['sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','create','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','findOne','CannedAnswer','pick','removeAnswers','addInteraction','omit','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','finally','getApplications','context','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','FaxMessage','CmList','List','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','spread','out','ContactId','dataValues','Messages','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','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x239a69,_0x3ec41f){var _0x1a791f=function(_0x29289c){while(--_0x29289c){_0x239a69['push'](_0x239a69['shift']());}};_0x1a791f(++_0x3ec41f);}(_0x40de,0x73));var _0xe40d=function(_0x4362c4,_0x57b51f){_0x4362c4=_0x4362c4-0x0;var _0x4e2876=_0x40de[_0x4362c4];return _0x4e2876;};'use strict';var emlformat=require(_0xe40d('0x0'));var rimraf=require(_0xe40d('0x1'));var zipdir=require(_0xe40d('0x2'));var jsonpatch=require(_0xe40d('0x3'));var rp=require(_0xe40d('0x4'));var moment=require(_0xe40d('0x5'));var BPromise=require(_0xe40d('0x6'));var Mustache=require(_0xe40d('0x7'));var util=require(_0xe40d('0x8'));var path=require(_0xe40d('0x9'));var sox=require('sox');var csv=require(_0xe40d('0xa'));var ejs=require(_0xe40d('0xb'));var fs=require('fs');var fs_extra=require(_0xe40d('0xc'));var _=require(_0xe40d('0xd'));var squel=require(_0xe40d('0xe'));var crypto=require(_0xe40d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe40d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe40d('0x11'));var Papa=require(_0xe40d('0x12'));var Redis=require(_0xe40d('0x13'));var authService=require(_0xe40d('0x14'));var qs=require(_0xe40d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe40d('0x16'));var logger=require(_0xe40d('0x17'))(_0xe40d('0x18'));var utils=require(_0xe40d('0x19'));var config=require(_0xe40d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe40d('0x1b')]=_[_0xe40d('0x1c')](config[_0xe40d('0x1b')],{'host':_0xe40d('0x1d'),'port':0x18eb});var socket=require(_0xe40d('0x1e'))(new Redis(config[_0xe40d('0x1b')]));require(_0xe40d('0x1f'))[_0xe40d('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe40d('0x21')]({'port':0x232c});var client9002=jayson[_0xe40d('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd10255,_0x5862ba,_0x2de944,_0x415d7b){return new BPromise(function(_0x3d2acd,_0x55bb41){var _0x2ad5d2=_0x415d7b||client;return _0x2ad5d2[_0xe40d('0x23')](_0xd10255,_0x2de944)[_0xe40d('0x24')](function(_0x506752){logger[_0xe40d('0x25')](_0xe40d('0x26'),_0x5862ba,_0xe40d('0x27'));logger[_0xe40d('0x28')](_0xe40d('0x29'),_0x5862ba,_0xe40d('0x27'),JSON[_0xe40d('0x2a')](_0x506752));if(_0x506752[_0xe40d('0x2b')]){if(_0x506752[_0xe40d('0x2b')][_0xe40d('0x2c')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5862ba,_0x506752['error']['message']);return _0x55bb41(_0x506752[_0xe40d('0x2b')][_0xe40d('0x2d')]);}logger['error'](_0xe40d('0x26'),_0x5862ba,_0x506752[_0xe40d('0x2b')][_0xe40d('0x2d')]);return _0x3d2acd(_0x506752[_0xe40d('0x2b')][_0xe40d('0x2d')]);}else{logger[_0xe40d('0x25')](_0xe40d('0x26'),_0x5862ba,_0xe40d('0x27'));_0x3d2acd(_0x506752['result'][_0xe40d('0x2d')]);}})[_0xe40d('0x2e')](function(_0x2c0f9a){logger[_0xe40d('0x2b')](_0xe40d('0x26'),_0x5862ba,_0x2c0f9a);_0x55bb41(_0x2c0f9a);});});}function respondWithStatusCode(_0x4647ab,_0x119076){_0x119076=_0x119076||0xcc;return function(_0x255cbd){if(_0x255cbd){return _0x4647ab['sendStatus'](_0x119076);}return _0x4647ab[_0xe40d('0x2f')](_0x119076)[_0xe40d('0x30')]();};}function respondWithResult(_0x1c9c28,_0x51a6a2){_0x51a6a2=_0x51a6a2||0xc8;return function(_0xc7dc1c){if(_0xc7dc1c){return _0x1c9c28[_0xe40d('0x2f')](_0x51a6a2)[_0xe40d('0x31')](_0xc7dc1c);}};}function respondWithFilteredResult(_0x2bad91,_0x1e6a02){return function(_0xb012be){if(_0xb012be){var _0x31f48b=typeof _0x1e6a02[_0xe40d('0x32')]===_0xe40d('0x33')&&typeof _0x1e6a02[_0xe40d('0x34')]==='undefined';var _0x212925=_0xb012be[_0xe40d('0x35')];var _0x21d617=_0x31f48b?0x0:_0x1e6a02[_0xe40d('0x32')];var _0x194206=_0x31f48b?_0xb012be[_0xe40d('0x35')]:_0x1e6a02[_0xe40d('0x32')]+_0x1e6a02[_0xe40d('0x34')];var _0x1756df;if(_0x194206>=_0x212925){_0x194206=_0x212925;_0x1756df=0xc8;}else{_0x1756df=0xce;}_0x2bad91[_0xe40d('0x2f')](_0x1756df);return _0x2bad91['set']('Content-Range',_0x21d617+'-'+_0x194206+'/'+_0x212925)[_0xe40d('0x31')](_0xb012be);}return null;};}function patchUpdates(_0x3e2f83){return function(_0x240e3b){try{jsonpatch[_0xe40d('0x36')](_0x240e3b,_0x3e2f83,!![]);}catch(_0x516aae){return BPromise[_0xe40d('0x37')](_0x516aae);}return _0x240e3b['save']();};}function saveUpdates(_0x46bbb6,_0x4fa8e3){return function(_0x260f0e){if(_0x260f0e){return _0x260f0e[_0xe40d('0x38')](_0x46bbb6)[_0xe40d('0x24')](function(_0x10b541){return _0x10b541;});}return null;};}function removeEntity(_0x31bf41,_0x558b20){return function(_0x556c6e){if(_0x556c6e){return _0x556c6e[_0xe40d('0x39')]()[_0xe40d('0x24')](function(){var _0x3a53b0=_0x556c6e[_0xe40d('0x3a')]({'plain':!![]});var _0x32d9ac=_0xe40d('0x3b');return db[_0xe40d('0x3c')][_0xe40d('0x39')]({'where':{'type':_0x32d9ac,'resourceId':_0x3a53b0['id']}})[_0xe40d('0x24')](function(){return _0x556c6e;});})[_0xe40d('0x24')](function(){_0x31bf41['status'](0xcc)[_0xe40d('0x30')]();});}};}function handleEntityNotFound(_0x25053b,_0x5e47c4){return function(_0x44e573){if(!_0x44e573){_0x25053b[_0xe40d('0x3d')](0x194);}return _0x44e573;};}function handleError(_0x567d3d,_0xc4ae7f){_0xc4ae7f=_0xc4ae7f||0x1f4;return function(_0xa8c77a){logger['error'](_0xa8c77a[_0xe40d('0x3e')]);if(_0xa8c77a['name']){delete _0xa8c77a['name'];}_0x567d3d[_0xe40d('0x2f')](_0xc4ae7f)[_0xe40d('0x3f')](_0xa8c77a);};}exports[_0xe40d('0x40')]=function(_0x31638b,_0x1e90d7){var _0x1fb0ba={'include':[{'model':db[_0xe40d('0x41')],'as':_0xe40d('0x42')}]},_0x39f1a6={},_0x592ec0={'count':0x0,'rows':[]};var _0x48b5e3=_[_0xe40d('0x43')](db[_0xe40d('0x44')][_0xe40d('0x45')],function(_0x3a9440){return{'name':_0x3a9440[_0xe40d('0x46')],'type':_0x3a9440[_0xe40d('0x47')]['key']};});_0x39f1a6[_0xe40d('0x48')]=_[_0xe40d('0x43')](_0x48b5e3,_0xe40d('0x49'));_0x39f1a6[_0xe40d('0x4a')]=_[_0xe40d('0x4b')](_0x31638b[_0xe40d('0x4a')]);_0x39f1a6[_0xe40d('0x4c')]=_[_0xe40d('0x4d')](_0x39f1a6[_0xe40d('0x48')],_0x39f1a6[_0xe40d('0x4a')]);_0x1fb0ba['attributes']=_[_0xe40d('0x4d')](_0x39f1a6[_0xe40d('0x48')],qs[_0xe40d('0x4e')](_0x31638b['query'][_0xe40d('0x4e')]));_0x1fb0ba[_0xe40d('0x4f')]=_0x1fb0ba[_0xe40d('0x4f')][_0xe40d('0x50')]?_0x1fb0ba[_0xe40d('0x4f')]:_0x39f1a6[_0xe40d('0x48')];if(!_0x31638b[_0xe40d('0x4a')][_0xe40d('0x51')](_0xe40d('0x52'))){_0x1fb0ba['limit']=qs[_0xe40d('0x34')](_0x31638b[_0xe40d('0x4a')]['limit']);_0x1fb0ba[_0xe40d('0x32')]=qs[_0xe40d('0x32')](_0x31638b[_0xe40d('0x4a')][_0xe40d('0x32')]);}_0x1fb0ba[_0xe40d('0x53')]=qs[_0xe40d('0x54')](_0x31638b['query'][_0xe40d('0x54')]);_0x1fb0ba['where']=qs['filters'](_['pick'](_0x31638b[_0xe40d('0x4a')],_0x39f1a6[_0xe40d('0x4c')]),_0x48b5e3);if(_0x31638b[_0xe40d('0x4a')][_0xe40d('0x55')]){_0x1fb0ba['where']=_['merge'](_0x1fb0ba[_0xe40d('0x56')],{'$or':_[_0xe40d('0x43')](_0x48b5e3,function(_0x4a3395){if(_0x4a3395['type']!==_0xe40d('0x57')){var _0x133539={};_0x133539[_0x4a3395[_0xe40d('0x49')]]={'$like':'%'+_0x31638b[_0xe40d('0x4a')][_0xe40d('0x55')]+'%'};return _0x133539;}})});}_0x1fb0ba=_[_0xe40d('0x58')]({},_0x1fb0ba,_0x31638b['options']);var _0x3b4713={'where':_0x1fb0ba[_0xe40d('0x56')]};return db[_0xe40d('0x44')][_0xe40d('0x35')](_0x3b4713)[_0xe40d('0x24')](function(_0x18eed7){_0x592ec0['count']=_0x18eed7;if(_0x31638b[_0xe40d('0x4a')][_0xe40d('0x59')]){_0x1fb0ba[_0xe40d('0x5a')]=[{'all':!![]}];}return db[_0xe40d('0x44')][_0xe40d('0x5b')](_0x1fb0ba);})[_0xe40d('0x24')](function(_0x32f629){_0x592ec0[_0xe40d('0x5c')]=_0x32f629;return _0x592ec0;})['then'](respondWithFilteredResult(_0x1e90d7,_0x1fb0ba))[_0xe40d('0x2e')](handleError(_0x1e90d7,null));};exports[_0xe40d('0x5d')]=function(_0x5b888e,_0xf0554c){var _0x27b442={'raw':![],'where':{'id':_0x5b888e[_0xe40d('0x5e')]['id']},'include':[{'model':db[_0xe40d('0x41')],'as':'mandatoryDispositionPause'}]},_0x56caa5={};_0x56caa5[_0xe40d('0x48')]=_[_0xe40d('0x4b')](db[_0xe40d('0x44')][_0xe40d('0x45')]);_0x56caa5['query']=_[_0xe40d('0x4b')](_0x5b888e[_0xe40d('0x4a')]);_0x56caa5[_0xe40d('0x4c')]=_[_0xe40d('0x4d')](_0x56caa5[_0xe40d('0x48')],_0x56caa5['query']);_0x27b442[_0xe40d('0x4f')]=_[_0xe40d('0x4d')](_0x56caa5['model'],qs['fields'](_0x5b888e['query'][_0xe40d('0x4e')]));_0x27b442['attributes']=_0x27b442['attributes'][_0xe40d('0x50')]?_0x27b442[_0xe40d('0x4f')]:_0x56caa5[_0xe40d('0x48')];if(_0x5b888e['query']['includeAll']){_0x27b442[_0xe40d('0x5a')]=[{'all':!![]}];}_0x27b442=_[_0xe40d('0x58')]({},_0x27b442,_0x5b888e[_0xe40d('0x5f')]);return db['FaxAccount'][_0xe40d('0x60')](_0x27b442)[_0xe40d('0x24')](handleEntityNotFound(_0xf0554c,null))['then'](respondWithResult(_0xf0554c,null))[_0xe40d('0x2e')](handleError(_0xf0554c,null));};exports[_0xe40d('0x61')]=function(_0x3a0036,_0x2cfcc4){return db['FaxAccount'][_0xe40d('0x61')](_0x3a0036['body'],{})['then'](function(_0x2a4ec5){var _0x1b95b3=_0x3a0036['user'][_0xe40d('0x3a')]({'plain':!![]});if(!_0x1b95b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b95b3['role']===_0xe40d('0x62')){var _0x5b4bb3=_0x2a4ec5[_0xe40d('0x3a')]({'plain':!![]});var _0x258c8b=_0xe40d('0x3b');return db['UserProfileSection'][_0xe40d('0x60')]({'where':{'name':_0x258c8b,'userProfileId':_0x1b95b3[_0xe40d('0x63')]},'raw':!![]})[_0xe40d('0x24')](function(_0x50d743){if(_0x50d743&&_0x50d743['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5b4bb3['name'],'resourceId':_0x5b4bb3['id'],'type':_0x50d743['name'],'sectionId':_0x50d743['id']},{})[_0xe40d('0x24')](function(){return _0x2a4ec5;});}else{return _0x2a4ec5;}})['catch'](function(_0xd7ea49){logger[_0xe40d('0x2b')](_0xe40d('0x64'),_0xd7ea49);throw _0xd7ea49;});}return _0x2a4ec5;})[_0xe40d('0x24')](respondWithResult(_0x2cfcc4,0xc9))[_0xe40d('0x2e')](handleError(_0x2cfcc4,null));};exports[_0xe40d('0x38')]=function(_0x50cbc8,_0x29a5d3){if(_0x50cbc8['body']['id']){delete _0x50cbc8[_0xe40d('0x65')]['id'];}return db[_0xe40d('0x44')]['find']({'where':{'id':_0x50cbc8[_0xe40d('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xe40d('0x42')}]})[_0xe40d('0x24')](handleEntityNotFound(_0x29a5d3,null))[_0xe40d('0x24')](saveUpdates(_0x50cbc8[_0xe40d('0x65')],null))['then'](respondWithResult(_0x29a5d3,null))['catch'](handleError(_0x29a5d3,null));};exports[_0xe40d('0x39')]=function(_0x4f0d6e,_0x54f818){return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x4f0d6e['params']['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x54f818,null))[_0xe40d('0x24')](removeEntity(_0x54f818,null))[_0xe40d('0x2e')](handleError(_0x54f818,null));};exports[_0xe40d('0x66')]=function(_0x8295f4,_0x59b85f){return db[_0xe40d('0x44')][_0xe40d('0x66')]()[_0xe40d('0x24')](respondWithResult(_0x59b85f,null))[_0xe40d('0x2e')](handleError(_0x59b85f,null));};exports[_0xe40d('0x67')]=function(_0x130b7e,_0x5115e4,_0x712f8c){if(_0x130b7e[_0xe40d('0x65')]['id']){delete _0x130b7e[_0xe40d('0x65')]['id'];}return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x130b7e['params']['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x5115e4,null))[_0xe40d('0x24')](function(_0x572a5a){if(_0x572a5a){_0x130b7e[_0xe40d('0x65')][_0xe40d('0x68')]=_0x572a5a['id'];return db[_0xe40d('0x69')][_0xe40d('0x61')](_0x130b7e[_0xe40d('0x65')]);}})[_0xe40d('0x24')](respondWithResult(_0x5115e4,null))[_0xe40d('0x2e')](handleError(_0x5115e4,null));};exports[_0xe40d('0x6a')]=function(_0x57ea5f,_0x4ad1c6,_0x132127){var _0x9f6b2c={'raw':![],'where':{}};var _0x192266={};var _0x5eb8a8={'count':0x0,'rows':[]};return db[_0xe40d('0x44')]['findOne']({'where':{'id':_0x57ea5f[_0xe40d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4ad1c6,null))['then'](function(_0x26f5f7){if(_0x26f5f7){_0x192266['model']=_[_0xe40d('0x4b')](db['Disposition'][_0xe40d('0x45')]);_0x192266[_0xe40d('0x4a')]=_[_0xe40d('0x4b')](_0x57ea5f[_0xe40d('0x4a')]);_0x192266[_0xe40d('0x4c')]=_['intersection'](_0x192266[_0xe40d('0x48')],_0x192266[_0xe40d('0x4a')]);_0x9f6b2c[_0xe40d('0x4f')]=_[_0xe40d('0x4d')](_0x192266[_0xe40d('0x48')],qs[_0xe40d('0x4e')](_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x4e')]));_0x9f6b2c[_0xe40d('0x4f')]=_0x9f6b2c[_0xe40d('0x4f')][_0xe40d('0x50')]?_0x9f6b2c['attributes']:_0x192266[_0xe40d('0x48')];if(!_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x51')](_0xe40d('0x52'))){_0x9f6b2c['limit']=qs['limit'](_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x34')]);_0x9f6b2c[_0xe40d('0x32')]=qs[_0xe40d('0x32')](_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x32')]);}_0x9f6b2c[_0xe40d('0x53')]=qs[_0xe40d('0x54')](_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x54')]);_0x9f6b2c[_0xe40d('0x56')]=qs[_0xe40d('0x4c')](_['pick'](_0x57ea5f['query'],_0x192266[_0xe40d('0x4c')]));_0x9f6b2c[_0xe40d('0x56')][_0xe40d('0x68')]=_0x26f5f7['id'];if(_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x55')]){_0x9f6b2c[_0xe40d('0x56')]=_[_0xe40d('0x58')](_0x9f6b2c['where'],{'$or':_['map'](_0x9f6b2c['attributes'],function(_0x8125e8){var _0x1e1d64={};_0x1e1d64[_0x8125e8]={'$like':'%'+_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x55')]+'%'};return _0x1e1d64;})});}_0x9f6b2c=_[_0xe40d('0x58')]({},_0x9f6b2c,_0x57ea5f[_0xe40d('0x5f')]);return db[_0xe40d('0x69')][_0xe40d('0x35')]({'where':_0x9f6b2c[_0xe40d('0x56')]})['then'](function(_0x303341){_0x5eb8a8[_0xe40d('0x35')]=_0x303341;if(_0x57ea5f[_0xe40d('0x4a')][_0xe40d('0x59')]){_0x9f6b2c[_0xe40d('0x5a')]=[{'all':!![]}];}return db[_0xe40d('0x69')]['findAll'](_0x9f6b2c);})[_0xe40d('0x24')](function(_0x27fcfe){_0x5eb8a8[_0xe40d('0x5c')]=_0x27fcfe;return _0x5eb8a8;});}})[_0xe40d('0x24')](respondWithFilteredResult(_0x4ad1c6,_0x9f6b2c))[_0xe40d('0x2e')](handleError(_0x4ad1c6,null));};exports[_0xe40d('0x6b')]=function(_0x454ed2,_0x348670,_0x413334){return db[_0xe40d('0x44')]['find']({'where':{'id':_0x454ed2['params']['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x348670,null))['then'](function(_0x1a797a){if(_0x1a797a){return _0x1a797a[_0xe40d('0x6b')](_0x454ed2[_0xe40d('0x4a')][_0xe40d('0x6c')]);}})[_0xe40d('0x24')](respondWithStatusCode(_0x348670,null))[_0xe40d('0x2e')](handleError(_0x348670,null));};exports[_0xe40d('0x6d')]=function(_0x1e7ec7,_0x5b0d34,_0xd04377){if(_0x1e7ec7[_0xe40d('0x65')]['id']){delete _0x1e7ec7['body']['id'];}return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x1e7ec7[_0xe40d('0x5e')]['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x5b0d34,null))[_0xe40d('0x24')](function(_0x55c22b){if(_0x55c22b){_0x1e7ec7[_0xe40d('0x65')][_0xe40d('0x68')]=_0x55c22b['id'];return db['CannedAnswer'][_0xe40d('0x61')](_0x1e7ec7[_0xe40d('0x65')]);}})[_0xe40d('0x24')](respondWithResult(_0x5b0d34,null))[_0xe40d('0x2e')](handleError(_0x5b0d34,null));};exports['getAnswers']=function(_0x61b195,_0x148263,_0x334bc7){var _0x342c77={'raw':![],'where':{}};var _0x1aacf8={};var _0x2ec1ff={'count':0x0,'rows':[]};return db[_0xe40d('0x44')][_0xe40d('0x6e')]({'where':{'id':_0x61b195[_0xe40d('0x5e')]['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x148263,null))[_0xe40d('0x24')](function(_0x51d855){if(_0x51d855){_0x1aacf8[_0xe40d('0x48')]=_[_0xe40d('0x4b')](db[_0xe40d('0x6f')]['rawAttributes']);_0x1aacf8['query']=_['keys'](_0x61b195['query']);_0x1aacf8[_0xe40d('0x4c')]=_[_0xe40d('0x4d')](_0x1aacf8['model'],_0x1aacf8[_0xe40d('0x4a')]);_0x342c77['attributes']=_[_0xe40d('0x4d')](_0x1aacf8['model'],qs['fields'](_0x61b195[_0xe40d('0x4a')][_0xe40d('0x4e')]));_0x342c77['attributes']=_0x342c77[_0xe40d('0x4f')][_0xe40d('0x50')]?_0x342c77['attributes']:_0x1aacf8[_0xe40d('0x48')];if(!_0x61b195['query'][_0xe40d('0x51')]('nolimit')){_0x342c77[_0xe40d('0x34')]=qs[_0xe40d('0x34')](_0x61b195['query'][_0xe40d('0x34')]);_0x342c77[_0xe40d('0x32')]=qs[_0xe40d('0x32')](_0x61b195[_0xe40d('0x4a')][_0xe40d('0x32')]);}_0x342c77['order']=qs[_0xe40d('0x54')](_0x61b195[_0xe40d('0x4a')][_0xe40d('0x54')]);_0x342c77['where']=qs[_0xe40d('0x4c')](_[_0xe40d('0x70')](_0x61b195[_0xe40d('0x4a')],_0x1aacf8['filters']));_0x342c77[_0xe40d('0x56')][_0xe40d('0x68')]=_0x51d855['id'];if(_0x61b195[_0xe40d('0x4a')][_0xe40d('0x55')]){_0x342c77[_0xe40d('0x56')]=_[_0xe40d('0x58')](_0x342c77['where'],{'$or':_[_0xe40d('0x43')](_0x342c77[_0xe40d('0x4f')],function(_0x198baa){var _0x4e82bb={};_0x4e82bb[_0x198baa]={'$like':'%'+_0x61b195[_0xe40d('0x4a')][_0xe40d('0x55')]+'%'};return _0x4e82bb;})});}_0x342c77=_[_0xe40d('0x58')]({},_0x342c77,_0x61b195[_0xe40d('0x5f')]);return db[_0xe40d('0x6f')]['count']({'where':_0x342c77[_0xe40d('0x56')]})[_0xe40d('0x24')](function(_0x20a472){_0x2ec1ff['count']=_0x20a472;if(_0x61b195[_0xe40d('0x4a')]['includeAll']){_0x342c77[_0xe40d('0x5a')]=[{'all':!![]}];}return db[_0xe40d('0x6f')][_0xe40d('0x5b')](_0x342c77);})[_0xe40d('0x24')](function(_0x167420){_0x2ec1ff[_0xe40d('0x5c')]=_0x167420;return _0x2ec1ff;});}})[_0xe40d('0x24')](respondWithFilteredResult(_0x148263,_0x342c77))[_0xe40d('0x2e')](handleError(_0x148263,null));};exports[_0xe40d('0x71')]=function(_0x8bb821,_0x5d3f86,_0x564eb4){return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x8bb821[_0xe40d('0x5e')]['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x5d3f86,null))[_0xe40d('0x24')](function(_0x47677a){if(_0x47677a){return _0x47677a['removeAnswers'](_0x8bb821[_0xe40d('0x4a')]['ids']);}})[_0xe40d('0x24')](respondWithStatusCode(_0x5d3f86,null))['catch'](handleError(_0x5d3f86,null));};exports[_0xe40d('0x72')]=function(_0xf94f88,_0xd702ce,_0x2ae141){return db['FaxInteraction'][_0xe40d('0x60')]({'where':{'id':_0xf94f88['params']['id']}})['then'](handleEntityNotFound(_0xd702ce,null))['then'](function(_0x1551f3){if(_0x1551f3){return _0x1551f3['addInteraction'](_0xf94f88[_0xe40d('0x65')][_0xe40d('0x6c')],_[_0xe40d('0x73')](_0xf94f88[_0xe40d('0x65')],[_0xe40d('0x6c'),'id'])||{});}})[_0xe40d('0x24')](respondWithResult(_0xd702ce,null))['catch'](handleError(_0xd702ce,null));};exports['getInteractions']=function(_0x2314e6,_0x5bcac8,_0x2aaf09){var _0x58551e={'raw':![],'where':{}};var _0x551bf4={};var _0x57e727={'count':0x0,'rows':[]};return db[_0xe40d('0x44')]['findOne']({'where':{'id':_0x2314e6[_0xe40d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5bcac8,null))[_0xe40d('0x24')](function(_0x5676e8){if(_0x5676e8){_0x551bf4['model']=_[_0xe40d('0x4b')](db[_0xe40d('0x74')]['rawAttributes']);_0x551bf4['query']=_[_0xe40d('0x4b')](_0x2314e6[_0xe40d('0x4a')]);_0x551bf4[_0xe40d('0x4c')]=_[_0xe40d('0x4d')](_0x551bf4[_0xe40d('0x48')],_0x551bf4[_0xe40d('0x4a')]);_0x58551e[_0xe40d('0x4f')]=_[_0xe40d('0x4d')](_0x551bf4['model'],qs['fields'](_0x2314e6[_0xe40d('0x4a')][_0xe40d('0x4e')]));_0x58551e[_0xe40d('0x4f')]=_0x58551e[_0xe40d('0x4f')][_0xe40d('0x50')]?_0x58551e[_0xe40d('0x4f')]:_0x551bf4['model'];if(!_0x2314e6[_0xe40d('0x4a')]['hasOwnProperty']('nolimit')){_0x58551e['limit']=qs[_0xe40d('0x34')](_0x2314e6[_0xe40d('0x4a')]['limit']);_0x58551e['offset']=qs[_0xe40d('0x32')](_0x2314e6[_0xe40d('0x4a')][_0xe40d('0x32')]);}_0x58551e[_0xe40d('0x53')]=qs[_0xe40d('0x54')](_0x2314e6[_0xe40d('0x4a')][_0xe40d('0x54')]);_0x58551e[_0xe40d('0x56')]=qs[_0xe40d('0x4c')](_[_0xe40d('0x70')](_0x2314e6[_0xe40d('0x4a')],_0x551bf4[_0xe40d('0x4c')]));_0x58551e[_0xe40d('0x56')][_0xe40d('0x68')]=_0x5676e8['id'];if(_0x2314e6[_0xe40d('0x4a')]['filter']){_0x58551e['where']=_[_0xe40d('0x58')](_0x58551e['where'],{'$or':_[_0xe40d('0x43')](_0x58551e[_0xe40d('0x4f')],function(_0x4c3484){var _0x42a670={};_0x42a670[_0x4c3484]={'$like':'%'+_0x2314e6['query']['filter']+'%'};return _0x42a670;})});}_0x58551e=_['merge']({},_0x58551e,_0x2314e6['options']);return db[_0xe40d('0x74')][_0xe40d('0x35')]({'where':_0x58551e[_0xe40d('0x56')]})['then'](function(_0x43e548){_0x57e727[_0xe40d('0x35')]=_0x43e548;if(_0x2314e6[_0xe40d('0x4a')]['includeAll']){_0x58551e[_0xe40d('0x5a')]=[{'model':db[_0xe40d('0x75')],'as':_0xe40d('0x76'),'required':![]},{'model':db[_0xe40d('0x77')],'as':_0xe40d('0x78'),'attributes':[_0xe40d('0x49'),_0xe40d('0x79'),_0xe40d('0x7a')],'required':![]},{'model':db[_0xe40d('0x7b')],'as':_0xe40d('0x7c'),'attributes':['id','name','color'],'where':_0x2314e6[_0xe40d('0x4a')][_0xe40d('0x7d')]?{'id':_0x2314e6['query']['tag']}:undefined,'required':_0x2314e6[_0xe40d('0x4a')][_0xe40d('0x7d')]?!![]:![]}];}return db[_0xe40d('0x74')][_0xe40d('0x5b')](_0x58551e);})[_0xe40d('0x24')](function(_0x891d36){_0x57e727['rows']=_0x891d36;return _0x57e727;});}})[_0xe40d('0x24')](respondWithFilteredResult(_0x5bcac8,_0x58551e))['catch'](handleError(_0x5bcac8,null));};exports[_0xe40d('0x7e')]=function(_0x709d27,_0x2111b7){var _0x22a77b=_0x709d27[_0xe40d('0x5e')]['id'];var _0x849ec0=_0x709d27['body'];var _0x699ad7=0xc8;var _0x533cb7=null;return db['sequelize'][_0xe40d('0x7f')]({'isolationLevel':db[_0xe40d('0x80')][_0xe40d('0x81')][_0xe40d('0x82')][_0xe40d('0x83')]},function(_0x5f0938){return db[_0xe40d('0x44')]['findOne']({'where':{'id':_0x22a77b},'transaction':_0x5f0938})[_0xe40d('0x24')](function(_0x58a14e){if(_0x58a14e){return db[_0xe40d('0x84')]['destroy']({'where':{'FaxAccountId':_0x22a77b},'transaction':_0x5f0938})[_0xe40d('0x24')](function(){var _0x134b95=_[_0xe40d('0x43')](_0x849ec0,function(_0x1c7dc3){_0x1c7dc3[_0xe40d('0x68')]=_0x22a77b;return _0x1c7dc3;});return db[_0xe40d('0x84')]['bulkCreate'](_0x134b95,{'transaction':_0x5f0938});});}else{_0x699ad7=0x194;_0x533cb7=[];}});})['then'](function(){if(_0x699ad7!==0x194){return db[_0xe40d('0x84')][_0xe40d('0x85')]({'where':{'FaxAccountId':_0x22a77b},'order':'priority'})[_0xe40d('0x24')](function(_0x42d18f){_0x533cb7=_0x42d18f;});}})['catch'](function(_0x108bc9){_0x699ad7=0x1f4;logger[_0xe40d('0x2b')](_0x108bc9[_0xe40d('0x3e')]);if(_0x108bc9[_0xe40d('0x49')]){delete _0x108bc9[_0xe40d('0x49')];}_0x533cb7=_0x108bc9;})[_0xe40d('0x86')](function(){if(_0x533cb7===null){_0x2111b7[_0xe40d('0x3d')](_0x699ad7);}else{if(_0x699ad7===0x1f4){_0x2111b7[_0xe40d('0x2f')](_0x699ad7)['send'](_0x533cb7);}else{_0x2111b7['status'](_0x699ad7)[_0xe40d('0x31')](_0x533cb7);}}});};exports[_0xe40d('0x87')]=function(_0x32895e,_0x2ead28,_0x1aaad2){var _0x455089={};var _0x3bebd2={};var _0x1bbf80;var _0x1e1acd;return db[_0xe40d('0x44')]['findOne']({'where':{'id':_0x32895e[_0xe40d('0x5e')]['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x2ead28,null))['then'](function(_0x404312){if(_0x404312){_0x1bbf80=_0x404312;_0x3bebd2[_0xe40d('0x48')]=_[_0xe40d('0x4b')](db[_0xe40d('0x84')][_0xe40d('0x45')]);_0x3bebd2['query']=_[_0xe40d('0x4b')](_0x32895e[_0xe40d('0x4a')]);_0x3bebd2[_0xe40d('0x4c')]=_['intersection'](_0x3bebd2[_0xe40d('0x48')],_0x3bebd2[_0xe40d('0x4a')]);_0x455089['attributes']=_[_0xe40d('0x4d')](_0x3bebd2[_0xe40d('0x48')],qs[_0xe40d('0x4e')](_0x32895e[_0xe40d('0x4a')]['fields']));_0x455089[_0xe40d('0x4f')]=_0x455089['attributes']['length']?_0x455089[_0xe40d('0x4f')]:_0x3bebd2[_0xe40d('0x48')];_0x455089[_0xe40d('0x53')]=qs[_0xe40d('0x54')](_0x32895e[_0xe40d('0x4a')][_0xe40d('0x54')]);_0x455089[_0xe40d('0x56')]=qs[_0xe40d('0x4c')](_[_0xe40d('0x70')](_0x32895e[_0xe40d('0x4a')],_0x3bebd2[_0xe40d('0x4c')]));if(_0x32895e['query'][_0xe40d('0x55')]){_0x455089[_0xe40d('0x56')]=_[_0xe40d('0x58')](_0x455089[_0xe40d('0x56')],{'$or':_[_0xe40d('0x43')](_0x455089['attributes'],function(_0x537b9e){var _0x463533={};_0x463533[_0x537b9e]={'$like':'%'+_0x32895e['query'][_0xe40d('0x55')]+'%'};return _0x463533;})});}_0x455089=_[_0xe40d('0x58')]({},_0x455089,_0x32895e[_0xe40d('0x5f')]);return _0x1bbf80['getApplications'](_0x455089);}})[_0xe40d('0x24')](function(_0x222b4a){if(_0x222b4a){_0x1e1acd=_0x222b4a[_0xe40d('0x50')];if(!_0x32895e[_0xe40d('0x4a')][_0xe40d('0x51')]('nolimit')){_0x455089[_0xe40d('0x34')]=qs[_0xe40d('0x34')](_0x32895e[_0xe40d('0x4a')][_0xe40d('0x34')]);_0x455089['offset']=qs['offset'](_0x32895e[_0xe40d('0x4a')]['offset']);}return _0x1bbf80[_0xe40d('0x87')](_0x455089);}})['then'](function(_0x461304){if(_0x461304){return _0x461304?{'count':_0x1e1acd,'rows':_0x461304}:null;}})['then'](respondWithResult(_0x2ead28,null))[_0xe40d('0x2e')](handleError(_0x2ead28,null));};function Extension(_0x21dafa,_0x5a04d5,_0x1c95c5,_0x1764ba){this[_0xe40d('0x88')]='from-voip-provider';this['exten']=_0x21dafa[_0xe40d('0x89')];this[_0xe40d('0x8a')]=_0x1764ba;this['type']=_0xe40d('0x8b');this[_0xe40d('0x8c')]=_0xe40d('0x8d');this[_0xe40d('0x68')]=_0x21dafa['id'];this[_0xe40d('0x8e')]=_0x5a04d5;this[_0xe40d('0x8f')]=_0x1c95c5;}function createExtensionsReciveFax(_0x114db9){var _0x472396=0x1;var _0xbc21cf=[];_0xbc21cf['push'](new Extension(_0x114db9,_0x472396,'','Answer'));_0x472396+=0x1;_0xbc21cf[_0xe40d('0x90')](new Extension(_0x114db9,_0x472396,_0xe40d('0x91'),_0xe40d('0x92')));_0x472396+=0x1;for(var _0x381cda in _0x114db9){if(_0x114db9[_0xe40d('0x51')](_0x381cda)&&(_0x381cda===_0xe40d('0x93')||_0x381cda==='localstationid'||_0x381cda===_0xe40d('0x94')||_0x381cda===_0xe40d('0x95')||_0x381cda===_0xe40d('0x96')||_0x381cda===_0xe40d('0x97')||_0x381cda===_0xe40d('0x98')||_0x381cda===_0xe40d('0x99')||_0x381cda===_0xe40d('0x9a'))){_0xbc21cf['push'](new Extension(_0x114db9,_0x472396,_0xe40d('0x9b')+_0x381cda+')='+_0x114db9[_0x381cda],'Set'));_0x472396+=0x1;}}_0xbc21cf[_0xe40d('0x90')](new Extension(_0x114db9,_0x472396,'6',_0xe40d('0x9c')));_0x472396+=0x1;_0xbc21cf[_0xe40d('0x90')](new Extension(_0x114db9,_0x472396,'/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',_0xe40d('0x9d')));_0x472396=0x0;return _0xbc21cf;}exports['addAccountApplications']=function(_0x25f722,_0x1852ee,_0x2f6d05){var _0x58f3cd;return db[_0xe40d('0x80')][_0xe40d('0x7f')](function(_0x537377){return db[_0xe40d('0x44')][_0xe40d('0x61')](_0x25f722[_0xe40d('0x65')],{'transaction':_0x537377})[_0xe40d('0x24')](function(_0x502e13){_0x58f3cd=_0x502e13[_0xe40d('0x3a')]({'plain':!![]});return db[_0xe40d('0x9e')][_0xe40d('0x9f')](createExtensionsReciveFax(_0x58f3cd),{'transaction':_0x537377});});})[_0xe40d('0x24')](function(){return _0x58f3cd;})['then'](respondWithResult(_0x1852ee,null))[_0xe40d('0x2e')](handleError(_0x1852ee,null));};exports[_0xe40d('0xa0')]=function(_0x4029c1,_0x2f9d37,_0x2ce7aa){var _0x5319a2;return db[_0xe40d('0x80')][_0xe40d('0x7f')](function(_0x4c82e3){return db[_0xe40d('0x44')][_0xe40d('0x38')](_0x4029c1[_0xe40d('0x65')],{'where':{'id':_0x4029c1[_0xe40d('0x65')]['id']},'transaction':_0x4c82e3})['then'](function(_0x3a4453){return db[_0xe40d('0x9e')][_0xe40d('0x39')]({'where':{'FaxAccountId':_0x4029c1['body']['id']},'transaction':_0x4c82e3})[_0xe40d('0x24')](function(_0x578cfd){return db[_0xe40d('0x9e')][_0xe40d('0x9f')](createExtensionsReciveFax(_[_0xe40d('0x73')](_0x4029c1[_0xe40d('0x65')],[_0xe40d('0xa1'),'key',_0xe40d('0xa2'),_0xe40d('0xa3'),_0xe40d('0xa4'),_0xe40d('0xa5')])),{'transaction':_0x4c82e3});});});})[_0xe40d('0x24')](function(){return db[_0xe40d('0x44')][_0xe40d('0xa6')](_0x4029c1['body']['id']);})['then'](respondWithResult(_0x2f9d37,null))['catch'](handleError(_0x2f9d37,null));};exports[_0xe40d('0xa7')]=function(_0x34551c,_0x46477e,_0x4ca091){var _0x5cdb38={'raw':!![],'where':{}};var _0xeed176={};var _0x1e16e1={'count':0x0,'rows':[]};return db[_0xe40d('0x44')][_0xe40d('0x6e')]({'where':{'id':_0x34551c[_0xe40d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x46477e,null))[_0xe40d('0x24')](function(_0x23dcaf){if(_0x23dcaf){_0xeed176[_0xe40d('0x48')]=_[_0xe40d('0x4b')](db['FaxMessage'][_0xe40d('0x45')]);_0xeed176['query']=_['keys'](_0x34551c[_0xe40d('0x4a')]);_0xeed176['filters']=_[_0xe40d('0x4d')](_0xeed176[_0xe40d('0x48')],_0xeed176[_0xe40d('0x4a')]);_0x5cdb38[_0xe40d('0x4f')]=_[_0xe40d('0x4d')](_0xeed176['model'],qs[_0xe40d('0x4e')](_0x34551c['query'][_0xe40d('0x4e')]));_0x5cdb38[_0xe40d('0x4f')]=_0x5cdb38[_0xe40d('0x4f')][_0xe40d('0x50')]?_0x5cdb38[_0xe40d('0x4f')]:_0xeed176[_0xe40d('0x48')];if(!_0x34551c[_0xe40d('0x4a')]['hasOwnProperty'](_0xe40d('0x52'))){_0x5cdb38[_0xe40d('0x34')]=qs[_0xe40d('0x34')](_0x34551c[_0xe40d('0x4a')]['limit']);_0x5cdb38[_0xe40d('0x32')]=qs[_0xe40d('0x32')](_0x34551c[_0xe40d('0x4a')]['offset']);}_0x5cdb38[_0xe40d('0x53')]=qs[_0xe40d('0x54')](_0x34551c['query'][_0xe40d('0x54')]);_0x5cdb38[_0xe40d('0x56')]=qs[_0xe40d('0x4c')](_[_0xe40d('0x70')](_0x34551c['query'],_0xeed176[_0xe40d('0x4c')]));_0x5cdb38['where'][_0xe40d('0x68')]=_0x23dcaf['id'];if(_0x34551c['query'][_0xe40d('0x55')]){_0x5cdb38[_0xe40d('0x56')]=_[_0xe40d('0x58')](_0x5cdb38['where'],{'$or':_[_0xe40d('0x43')](_0x5cdb38['attributes'],function(_0x45debb){var _0x18e036={};_0x18e036[_0x45debb]={'$like':'%'+_0x34551c[_0xe40d('0x4a')][_0xe40d('0x55')]+'%'};return _0x18e036;})});}if(_0x34551c[_0xe40d('0x4a')]['$gte']){var _0x578b06=_0x34551c[_0xe40d('0x4a')][_0xe40d('0xa8')][_0xe40d('0xa9')](',');var _0x270327={};_0x270327[_0x578b06[0x0]]={'$gte':moment(_0x578b06[0x1])[_0xe40d('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5cdb38[_0xe40d('0x56')]=_['merge'](_0x5cdb38['where'],_0x270327);}_0x5cdb38=_['merge']({},_0x5cdb38,_0x34551c[_0xe40d('0x5f')]);return db[_0xe40d('0xab')][_0xe40d('0x35')]({'where':_0x5cdb38[_0xe40d('0x56')]})['then'](function(_0x17e8a4){_0x1e16e1['count']=_0x17e8a4;if(_0x34551c['query'][_0xe40d('0x59')]){_0x5cdb38['include']=[{'all':!![]}];}return db[_0xe40d('0xab')][_0xe40d('0x5b')](_0x5cdb38);})[_0xe40d('0x24')](function(_0x222abb){_0x1e16e1[_0xe40d('0x5c')]=_0x222abb;return _0x1e16e1;});}})[_0xe40d('0x24')](respondWithFilteredResult(_0x46477e,_0x5cdb38))['catch'](handleError(_0x46477e,null));};exports[_0xe40d('0x3f')]=function(_0x2b9db9,_0x19e789,_0x583747){var _0x4cc2e5,_0x179bfa={},_0x2cde90;if(_0x2b9db9['body']['to']){_0x2cde90=_0x2b9db9[_0xe40d('0x65')]['to'][0x0];}return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x2b9db9[_0xe40d('0x5e')]['id']},'include':[{'model':db[_0xe40d('0xac')],'as':_0xe40d('0xad'),'include':[{'model':db['CmContact'],'as':_0xe40d('0xae'),'where':{'fax':_0x2cde90},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x19e789,null))[_0xe40d('0x24')](function(_0x4fd4e6){_0x4cc2e5=_0x4fd4e6;if(_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')]&&_0x2b9db9['body'][_0xe40d('0xaf')][_0xe40d('0x50')]){for(var _0x8fecaa=0x0;_0x8fecaa<_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][_0xe40d('0x50')];_0x8fecaa+=0x1){_0x2b9db9['body'][_0xe40d('0xaf')][_0x8fecaa]={'filename':_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][_0x8fecaa]['name'],'id':_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][_0x8fecaa]['id'],'path':path[_0xe40d('0xb0')](config[_0xe40d('0xb1')],_0xe40d('0xb2'),_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][_0x8fecaa]['basename'])};}}return respondWithRpcPromise(_0xe40d('0xb3'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x2b9db9[_0xe40d('0x5e')]['id'])?undefined:_0x2b9db9[_0xe40d('0x5e')]['id'],'path':_[_0xe40d('0xb4')](_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0][_0xe40d('0x9')])?undefined:_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0][_0xe40d('0x9')],'fax':_[_0xe40d('0xb4')](_0x2b9db9['body']['to'][0x0])?undefined:_0x2b9db9['body']['to'][0x0]},client9002);})['then'](function(){if(_0x4cc2e5){if(_[_0xe40d('0xb4')](_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xb5')])){_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xb5')]=util['format']('\x22%s\x22\x20<%s>',_0x4cc2e5['name'],_0x4cc2e5['fax']);}if(_0x4cc2e5[_0xe40d('0xad')]){if(_0x4cc2e5[_0xe40d('0xad')][_0xe40d('0xae')][_0xe40d('0x50')]){return _0x4cc2e5[_0xe40d('0xad')][_0xe40d('0xae')][0x0];}else{return db['CmContact']['create'](_[_0xe40d('0x1c')](_0x2b9db9[_0xe40d('0x65')],{'firstName':_0x2b9db9[_0xe40d('0x65')]['to'][0x0],'phone':_0x2b9db9['body']['to'][0x0],'fax':_0x2b9db9[_0xe40d('0x65')]['to'][0x0],'ListId':_0x4cc2e5['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xe40d('0xb6'));}})[_0xe40d('0x24')](function(_0x227f75){if(_0x227f75){return db[_0xe40d('0x74')]['find']({'where':{'ContactId':_0x227f75['id'],'closed':![],'FaxAccountId':_0x4cc2e5['id']}})[_0xe40d('0x24')](function(_0xb9e9ae){if(_0xb9e9ae){return[_0xb9e9ae,![]];}return db[_0xe40d('0x74')][_0xe40d('0x61')]({'UserId':_0x2b9db9[_0xe40d('0x62')]['id'],'ContactId':_0x227f75['id'],'FaxAccountId':_0x4cc2e5['id'],'fax':_0x2b9db9[_0xe40d('0x65')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xe40d('0x58')](_0x2b9db9[_0xe40d('0x65')],{'read':![],'body':_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0][_0xe40d('0xb7')],'FaxAccountId':_0x4cc2e5['id'],'UserId':_0x2b9db9['user']['id'],'ContactId':_0x227f75['id'],'AttachmentId':_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0]['id']})]},{'include':[{'model':db[_0xe40d('0xab')],'as':'Messages'}]})[_0xe40d('0x24')](function(_0x1f9df4){return[_0x1f9df4,!![]];});});}else{throw new Error(_0xe40d('0xb8'));}})[_0xe40d('0xb9')](function(_0x195aab,_0x4ddadf){if(_0x4ddadf){return _0x195aab;}return db[_0xe40d('0xab')][_0xe40d('0x61')]({'direction':_0xe40d('0xba'),'read':![],'body':_0x2b9db9['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x4cc2e5['id'],'FaxInteractionId':_0x195aab['id'],'UserId':_0x2b9db9[_0xe40d('0x62')]['id'],'ContactId':_0x195aab[_0xe40d('0xbb')],'AttachmentId':_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0]['id']})['then'](function(_0x14c6e8){_0x195aab[_0xe40d('0xbc')]['Messages']=[];_0x195aab[_0xe40d('0xbc')][_0xe40d('0xbd')]['push'](_0x14c6e8[_0xe40d('0xbc')]);return _0x195aab;});})[_0xe40d('0x24')](function(_0x336b62){respondWithRpcPromise(_0xe40d('0xbe'),_0xe40d('0xbe'),{'FaxAccountId':_['isNil'](_0x2b9db9[_0xe40d('0x5e')]['id'])?undefined:_0x2b9db9[_0xe40d('0x5e')]['id'],'path':_['isNil'](_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0][_0xe40d('0x9')])?undefined:_0x2b9db9[_0xe40d('0x65')][_0xe40d('0xaf')][0x0][_0xe40d('0x9')],'fax':_[_0xe40d('0xb4')](_0x2b9db9['body']['to'][0x0])?undefined:_0x2b9db9[_0xe40d('0x65')]['to'][0x0],'AttachmentId':_0x2b9db9['body'][_0xe40d('0xaf')][0x0]['id']},client9002)['then'](function(_0xfc6097){logger[_0xe40d('0x25')]('SendFaxRpc,\x20%s',_0xfc6097);})[_0xe40d('0x2e')](function(_0x46600e){logger['info'](_0xe40d('0xbf'),_0x46600e);});return _0x336b62;})[_0xe40d('0x24')](respondWithResult(_0x19e789,null))['catch'](handleError(_0x19e789,null));};exports['addAgents']=function(_0x3a6320,_0x47ee17,_0x2da3f8){return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x3a6320[_0xe40d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x47ee17,null))[_0xe40d('0x24')](function(_0x5e6566){if(_0x5e6566){return _0x5e6566[_0xe40d('0xc0')](_0x3a6320['body']['ids'],_[_0xe40d('0x73')](_0x3a6320[_0xe40d('0x65')],[_0xe40d('0x6c'),'id'])||{})[_0xe40d('0xb9')](function(_0xce53d4){for(var _0x565e47=0x0;_0x565e47<_0x3a6320['body']['ids']['length'];_0x565e47+=0x1){socket[_0xe40d('0xc1')](_0xe40d('0xc2'),{'UserId':Number(_0x3a6320['body'][_0xe40d('0x6c')][_0x565e47]),'FaxAccountId':Number(_0x3a6320[_0xe40d('0x5e')]['id'])});}return _0xce53d4;});}})[_0xe40d('0x24')](respondWithResult(_0x47ee17,null))[_0xe40d('0x2e')](handleError(_0x47ee17,null));};exports[_0xe40d('0xc3')]=function(_0x2069b8,_0x49fef7,_0x186424){return db[_0xe40d('0x44')][_0xe40d('0x60')]({'where':{'id':_0x2069b8[_0xe40d('0x5e')]['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x49fef7,null))[_0xe40d('0x24')](function(_0xd7c815){if(_0xd7c815){return _0xd7c815[_0xe40d('0xc3')](_0x2069b8[_0xe40d('0x4a')]['ids'])[_0xe40d('0x24')](function(){if(_[_0xe40d('0xc4')](_0x2069b8[_0xe40d('0x4a')][_0xe40d('0x6c')])){for(var _0x3941e0=0x0;_0x3941e0<_0x2069b8[_0xe40d('0x4a')][_0xe40d('0x6c')][_0xe40d('0x50')];_0x3941e0+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x2069b8['query']['ids'][_0x3941e0]),'FaxAccountId':Number(_0x2069b8[_0xe40d('0x5e')]['id'])});}}else{socket[_0xe40d('0xc1')](_0xe40d('0xc5'),{'UserId':Number(_0x2069b8[_0xe40d('0x4a')][_0xe40d('0x6c')]),'FaxAccountId':Number(_0x2069b8[_0xe40d('0x5e')]['id'])});}});}})[_0xe40d('0x24')](respondWithStatusCode(_0x49fef7,null))[_0xe40d('0x2e')](handleError(_0x49fef7,null));};exports[_0xe40d('0xc6')]=function(_0x3cf2f1,_0x53b239,_0x49293f){var _0x1fc2d3={};var _0x2135e0={};var _0x5249c5;var _0x2c28b2;return db[_0xe40d('0x44')]['findOne']({'where':{'id':_0x3cf2f1['params']['id']}})[_0xe40d('0x24')](handleEntityNotFound(_0x53b239,null))[_0xe40d('0x24')](function(_0x197e8f){if(_0x197e8f){_0x5249c5=_0x197e8f;_0x2135e0[_0xe40d('0x48')]=_[_0xe40d('0x4b')](db[_0xe40d('0x77')][_0xe40d('0x45')]);_0x2135e0[_0xe40d('0x4a')]=_[_0xe40d('0x4b')](_0x3cf2f1['query']);_0x2135e0[_0xe40d('0x4c')]=_[_0xe40d('0x4d')](_0x2135e0['model'],_0x2135e0[_0xe40d('0x4a')]);_0x1fc2d3[_0xe40d('0x4f')]=_['intersection'](_0x2135e0[_0xe40d('0x48')],qs[_0xe40d('0x4e')](_0x3cf2f1['query'][_0xe40d('0x4e')]));_0x1fc2d3['attributes']=_0x1fc2d3[_0xe40d('0x4f')][_0xe40d('0x50')]?_0x1fc2d3[_0xe40d('0x4f')]:_0x2135e0[_0xe40d('0x48')];_0x1fc2d3[_0xe40d('0x53')]=qs[_0xe40d('0x54')](_0x3cf2f1[_0xe40d('0x4a')]['sort']);_0x1fc2d3[_0xe40d('0x56')]=qs['filters'](_[_0xe40d('0x70')](_0x3cf2f1[_0xe40d('0x4a')],_0x2135e0[_0xe40d('0x4c')]));if(_0x3cf2f1[_0xe40d('0x4a')]['filter']){_0x1fc2d3[_0xe40d('0x56')]=_[_0xe40d('0x58')](_0x1fc2d3[_0xe40d('0x56')],{'$or':_[_0xe40d('0x43')](_0x1fc2d3['attributes'],function(_0xda2c7){var _0x39a272={};_0x39a272[_0xda2c7]={'$like':'%'+_0x3cf2f1[_0xe40d('0x4a')]['filter']+'%'};return _0x39a272;})});}_0x1fc2d3=_[_0xe40d('0x58')]({},_0x1fc2d3,_0x3cf2f1[_0xe40d('0x5f')]);return _0x5249c5[_0xe40d('0xc6')](_0x1fc2d3);}})[_0xe40d('0x24')](function(_0xfe5b2f){if(_0xfe5b2f){_0x2c28b2=_0xfe5b2f[_0xe40d('0x50')];if(!_0x3cf2f1[_0xe40d('0x4a')]['hasOwnProperty']('nolimit')){_0x1fc2d3['limit']=qs[_0xe40d('0x34')](_0x3cf2f1[_0xe40d('0x4a')][_0xe40d('0x34')]);_0x1fc2d3[_0xe40d('0x32')]=qs[_0xe40d('0x32')](_0x3cf2f1[_0xe40d('0x4a')]['offset']);}return _0x5249c5[_0xe40d('0xc6')](_0x1fc2d3);}})[_0xe40d('0x24')](function(_0x364d0a){if(_0x364d0a){return _0x364d0a?{'count':_0x2c28b2,'rows':_0x364d0a}:null;}})[_0xe40d('0x24')](respondWithResult(_0x53b239,null))[_0xe40d('0x2e')](handleError(_0x53b239,null));}; \ No newline at end of file +var _0xe7dd=['where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','Pause','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','FaxAccountId','getDispositions','Disposition','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addInteraction','omit','getInteractions','findOne','FaxInteraction','CmContact','Contact','User','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','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','VoiceExtension','bulkCreate','tech','createdAt','TrunkId','ListId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','Contacts','updatedAt','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','format','fax','List\x20not\x20found','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','util','path','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x3240d4,_0x4d12ba){var _0x28cc05=function(_0x405ef8){while(--_0x405ef8){_0x3240d4['push'](_0x3240d4['shift']());}};_0x28cc05(++_0x4d12ba);}(_0xe7dd,0x13d));var _0xde7d=function(_0x520e49,_0x4c4d70){_0x520e49=_0x520e49-0x0;var _0x549d48=_0xe7dd[_0x520e49];return _0x549d48;};'use strict';var emlformat=require(_0xde7d('0x0'));var rimraf=require(_0xde7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde7d('0x2'));var moment=require(_0xde7d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xde7d('0x4'));var path=require(_0xde7d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde7d('0x6'));var fs=require('fs');var fs_extra=require(_0xde7d('0x7'));var _=require(_0xde7d('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xde7d('0x9'));var toCsv=require(_0xde7d('0xa'));var querystring=require('querystring');var Papa=require(_0xde7d('0xb'));var Redis=require('ioredis');var authService=require(_0xde7d('0xc'));var qs=require(_0xde7d('0xd'));var as=require(_0xde7d('0xe'));var hardwareService=require(_0xde7d('0xf'));var logger=require(_0xde7d('0x10'))(_0xde7d('0x11'));var utils=require('../../config/utils');var config=require(_0xde7d('0x12'));var licenseUtil=require(_0xde7d('0x13'));var db=require(_0xde7d('0x14'))['db'];config['redis']=_[_0xde7d('0x15')](config[_0xde7d('0x16')],{'host':_0xde7d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde7d('0x16')]));require(_0xde7d('0x18'))[_0xde7d('0x19')](socket);var jayson=require(_0xde7d('0x1a'));var client=jayson[_0xde7d('0x1b')][_0xde7d('0x1c')]({'port':0x232c});var client9002=jayson[_0xde7d('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45baa1,_0x1fa0b0,_0x2a37f9,_0x6a9658){return new BPromise(function(_0x55aeb8,_0x1577c9){var _0x4178bf=_0x6a9658||client;return _0x4178bf[_0xde7d('0x1d')](_0x45baa1,_0x2a37f9)['then'](function(_0x38cdb2){logger['info'](_0xde7d('0x1e'),_0x1fa0b0,'request\x20sent');logger[_0xde7d('0x1f')](_0xde7d('0x20'),_0x1fa0b0,_0xde7d('0x21'),JSON[_0xde7d('0x22')](_0x38cdb2));if(_0x38cdb2[_0xde7d('0x23')]){if(_0x38cdb2[_0xde7d('0x23')]['code']===0x1f4){logger['error'](_0xde7d('0x1e'),_0x1fa0b0,_0x38cdb2[_0xde7d('0x23')]['message']);return _0x1577c9(_0x38cdb2[_0xde7d('0x23')][_0xde7d('0x24')]);}logger[_0xde7d('0x23')](_0xde7d('0x1e'),_0x1fa0b0,_0x38cdb2['error'][_0xde7d('0x24')]);return _0x55aeb8(_0x38cdb2[_0xde7d('0x23')][_0xde7d('0x24')]);}else{logger[_0xde7d('0x25')](_0xde7d('0x1e'),_0x1fa0b0,_0xde7d('0x21'));_0x55aeb8(_0x38cdb2[_0xde7d('0x26')][_0xde7d('0x24')]);}})['catch'](function(_0x1c6e02){logger[_0xde7d('0x23')]('FaxAccount,\x20%s,\x20%s',_0x1fa0b0,_0x1c6e02);_0x1577c9(_0x1c6e02);});});}function respondWithStatusCode(_0x2e5ed9,_0x144b4e){_0x144b4e=_0x144b4e||0xcc;return function(_0x743e19){if(_0x743e19){return _0x2e5ed9[_0xde7d('0x27')](_0x144b4e);}return _0x2e5ed9['status'](_0x144b4e)[_0xde7d('0x28')]();};}function respondWithResult(_0x3c08b9,_0x5c58b7){_0x5c58b7=_0x5c58b7||0xc8;return function(_0x1f541f){if(_0x1f541f){return _0x3c08b9[_0xde7d('0x29')](_0x5c58b7)[_0xde7d('0x2a')](_0x1f541f);}};}function respondWithFilteredResult(_0x236b34,_0x247aa3){return function(_0x41c641){if(_0x41c641){var _0x433d46=typeof _0x247aa3[_0xde7d('0x2b')]===_0xde7d('0x2c')&&typeof _0x247aa3[_0xde7d('0x2d')]==='undefined';var _0x5c3eac=_0x41c641[_0xde7d('0x2e')];var _0x4a09ce=_0x433d46?0x0:_0x247aa3[_0xde7d('0x2b')];var _0x3f8fe3=_0x433d46?_0x41c641[_0xde7d('0x2e')]:_0x247aa3[_0xde7d('0x2b')]+_0x247aa3[_0xde7d('0x2d')];var _0x247b97;if(_0x3f8fe3>=_0x5c3eac){_0x3f8fe3=_0x5c3eac;_0x247b97=0xc8;}else{_0x247b97=0xce;}_0x236b34['status'](_0x247b97);return _0x236b34[_0xde7d('0x2f')](_0xde7d('0x30'),_0x4a09ce+'-'+_0x3f8fe3+'/'+_0x5c3eac)['json'](_0x41c641);}return null;};}function patchUpdates(_0x5973f5){return function(_0x4b164f){try{jsonpatch[_0xde7d('0x31')](_0x4b164f,_0x5973f5,!![]);}catch(_0x5a77d1){return BPromise[_0xde7d('0x32')](_0x5a77d1);}return _0x4b164f['save']();};}function saveUpdates(_0x598f7a,_0xf9b9b9){return function(_0x169481){if(_0x169481){return _0x169481['update'](_0x598f7a)[_0xde7d('0x33')](function(_0x3ea0de){return _0x3ea0de;});}return null;};}function removeEntity(_0xe674bc,_0x324580){return function(_0x455081){if(_0x455081){return _0x455081[_0xde7d('0x34')]()[_0xde7d('0x33')](function(){var _0x25bb21=_0x455081['get']({'plain':!![]});var _0x3df351=_0xde7d('0x35');return db[_0xde7d('0x36')]['destroy']({'where':{'type':_0x3df351,'resourceId':_0x25bb21['id']}})['then'](function(){return _0x455081;});})[_0xde7d('0x33')](function(){_0xe674bc[_0xde7d('0x29')](0xcc)[_0xde7d('0x28')]();});}};}function handleEntityNotFound(_0xfb9c88,_0x149b9a){return function(_0x212355){if(!_0x212355){_0xfb9c88[_0xde7d('0x27')](0x194);}return _0x212355;};}function handleError(_0x1c42cb,_0xf63b35){_0xf63b35=_0xf63b35||0x1f4;return function(_0x193115){logger[_0xde7d('0x23')](_0x193115[_0xde7d('0x37')]);if(_0x193115[_0xde7d('0x38')]){delete _0x193115[_0xde7d('0x38')];}_0x1c42cb['status'](_0xf63b35)[_0xde7d('0x39')](_0x193115);};}exports[_0xde7d('0x3a')]=function(_0x16f95a,_0x499283){var _0x382bfe={'include':[{'model':db['Pause'],'as':_0xde7d('0x3b')}]},_0x3b5f3a={},_0x5b2c2f={'count':0x0,'rows':[]};var _0x527a93=_[_0xde7d('0x3c')](db[_0xde7d('0x3d')][_0xde7d('0x3e')],function(_0x3084fb){return{'name':_0x3084fb[_0xde7d('0x3f')],'type':_0x3084fb['type'][_0xde7d('0x40')]};});_0x3b5f3a[_0xde7d('0x41')]=_[_0xde7d('0x3c')](_0x527a93,_0xde7d('0x38'));_0x3b5f3a[_0xde7d('0x42')]=_[_0xde7d('0x43')](_0x16f95a[_0xde7d('0x42')]);_0x3b5f3a[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x3b5f3a['model'],_0x3b5f3a[_0xde7d('0x42')]);_0x382bfe[_0xde7d('0x46')]=_[_0xde7d('0x45')](_0x3b5f3a['model'],qs['fields'](_0x16f95a[_0xde7d('0x42')][_0xde7d('0x47')]));_0x382bfe[_0xde7d('0x46')]=_0x382bfe['attributes'][_0xde7d('0x48')]?_0x382bfe[_0xde7d('0x46')]:_0x3b5f3a[_0xde7d('0x41')];if(!_0x16f95a[_0xde7d('0x42')][_0xde7d('0x49')]('nolimit')){_0x382bfe[_0xde7d('0x2d')]=qs[_0xde7d('0x2d')](_0x16f95a['query']['limit']);_0x382bfe['offset']=qs[_0xde7d('0x2b')](_0x16f95a[_0xde7d('0x42')][_0xde7d('0x2b')]);}_0x382bfe['order']=qs[_0xde7d('0x4a')](_0x16f95a[_0xde7d('0x42')][_0xde7d('0x4a')]);_0x382bfe[_0xde7d('0x4b')]=qs['filters'](_[_0xde7d('0x4c')](_0x16f95a[_0xde7d('0x42')],_0x3b5f3a['filters']),_0x527a93);if(_0x16f95a[_0xde7d('0x42')][_0xde7d('0x4d')]){_0x382bfe[_0xde7d('0x4b')]=_[_0xde7d('0x4e')](_0x382bfe['where'],{'$or':_[_0xde7d('0x3c')](_0x527a93,function(_0x4b398f){if(_0x4b398f[_0xde7d('0x4f')]!==_0xde7d('0x50')){var _0x39330c={};_0x39330c[_0x4b398f[_0xde7d('0x38')]]={'$like':'%'+_0x16f95a[_0xde7d('0x42')]['filter']+'%'};return _0x39330c;}})});}_0x382bfe=_[_0xde7d('0x4e')]({},_0x382bfe,_0x16f95a[_0xde7d('0x51')]);var _0x4cac7b={'where':_0x382bfe['where']};return db[_0xde7d('0x3d')][_0xde7d('0x2e')](_0x4cac7b)['then'](function(_0x2928b1){_0x5b2c2f['count']=_0x2928b1;if(_0x16f95a[_0xde7d('0x42')][_0xde7d('0x52')]){_0x382bfe[_0xde7d('0x53')]=[{'all':!![]}];}return db['FaxAccount'][_0xde7d('0x54')](_0x382bfe);})[_0xde7d('0x33')](function(_0x40f30a){_0x5b2c2f[_0xde7d('0x55')]=_0x40f30a;return _0x5b2c2f;})['then'](respondWithFilteredResult(_0x499283,_0x382bfe))[_0xde7d('0x56')](handleError(_0x499283,null));};exports['show']=function(_0x4919e8,_0x7e49a9){var _0x5dfc85={'raw':![],'where':{'id':_0x4919e8['params']['id']},'include':[{'model':db[_0xde7d('0x57')],'as':_0xde7d('0x3b')}]},_0x1e264c={};_0x1e264c['model']=_[_0xde7d('0x43')](db[_0xde7d('0x3d')][_0xde7d('0x3e')]);_0x1e264c[_0xde7d('0x42')]=_['keys'](_0x4919e8[_0xde7d('0x42')]);_0x1e264c[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x1e264c[_0xde7d('0x41')],_0x1e264c['query']);_0x5dfc85[_0xde7d('0x46')]=_[_0xde7d('0x45')](_0x1e264c[_0xde7d('0x41')],qs[_0xde7d('0x47')](_0x4919e8['query'][_0xde7d('0x47')]));_0x5dfc85[_0xde7d('0x46')]=_0x5dfc85['attributes'][_0xde7d('0x48')]?_0x5dfc85['attributes']:_0x1e264c[_0xde7d('0x41')];if(_0x4919e8[_0xde7d('0x42')][_0xde7d('0x52')]){_0x5dfc85[_0xde7d('0x53')]=[{'all':!![]}];}_0x5dfc85=_[_0xde7d('0x4e')]({},_0x5dfc85,_0x4919e8[_0xde7d('0x51')]);return db['FaxAccount']['find'](_0x5dfc85)[_0xde7d('0x33')](handleEntityNotFound(_0x7e49a9,null))[_0xde7d('0x33')](respondWithResult(_0x7e49a9,null))[_0xde7d('0x56')](handleError(_0x7e49a9,null));};exports[_0xde7d('0x58')]=function(_0x42c4d9,_0x5b5ede){return db[_0xde7d('0x3d')][_0xde7d('0x58')](_0x42c4d9[_0xde7d('0x59')],{})[_0xde7d('0x33')](function(_0x5c21c0){var _0x803171=_0x42c4d9['user'][_0xde7d('0x5a')]({'plain':!![]});if(!_0x803171)throw new Error(_0xde7d('0x5b'));if(_0x803171[_0xde7d('0x5c')]===_0xde7d('0x5d')){var _0x58c12c=_0x5c21c0['get']({'plain':!![]});var _0x5aa29a=_0xde7d('0x35');return db[_0xde7d('0x5e')][_0xde7d('0x5f')]({'where':{'name':_0x5aa29a,'userProfileId':_0x803171[_0xde7d('0x60')]},'raw':!![]})[_0xde7d('0x33')](function(_0x3764cc){if(_0x3764cc&&_0x3764cc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x58c12c['name'],'resourceId':_0x58c12c['id'],'type':_0x3764cc[_0xde7d('0x38')],'sectionId':_0x3764cc['id']},{})[_0xde7d('0x33')](function(){return _0x5c21c0;});}else{return _0x5c21c0;}})[_0xde7d('0x56')](function(_0x4e2693){logger[_0xde7d('0x23')](_0xde7d('0x61'),_0x4e2693);throw _0x4e2693;});}return _0x5c21c0;})[_0xde7d('0x33')](respondWithResult(_0x5b5ede,0xc9))[_0xde7d('0x56')](handleError(_0x5b5ede,null));};exports[_0xde7d('0x62')]=function(_0x2bd5dd,_0x5782f3){if(_0x2bd5dd[_0xde7d('0x59')]['id']){delete _0x2bd5dd[_0xde7d('0x59')]['id'];}return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x2bd5dd[_0xde7d('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0xde7d('0x3b')}]})[_0xde7d('0x33')](handleEntityNotFound(_0x5782f3,null))[_0xde7d('0x33')](saveUpdates(_0x2bd5dd['body'],null))['then'](respondWithResult(_0x5782f3,null))[_0xde7d('0x56')](handleError(_0x5782f3,null));};exports[_0xde7d('0x34')]=function(_0x2207f3,_0x4dd611){return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x2207f3['params']['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x4dd611,null))[_0xde7d('0x33')](removeEntity(_0x4dd611,null))[_0xde7d('0x56')](handleError(_0x4dd611,null));};exports[_0xde7d('0x64')]=function(_0x474889,_0x137f4e){return db['FaxAccount']['describe']()[_0xde7d('0x33')](respondWithResult(_0x137f4e,null))['catch'](handleError(_0x137f4e,null));};exports[_0xde7d('0x65')]=function(_0x2a83d,_0x57a814,_0x387649){if(_0x2a83d['body']['id']){delete _0x2a83d[_0xde7d('0x59')]['id'];}return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x2a83d['params']['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x57a814,null))['then'](function(_0x4a9a65){if(_0x4a9a65){_0x2a83d[_0xde7d('0x59')][_0xde7d('0x66')]=_0x4a9a65['id'];return db['Disposition'][_0xde7d('0x58')](_0x2a83d[_0xde7d('0x59')]);}})[_0xde7d('0x33')](respondWithResult(_0x57a814,null))[_0xde7d('0x56')](handleError(_0x57a814,null));};exports[_0xde7d('0x67')]=function(_0xd5e71f,_0x551b80,_0x286057){var _0x4ea7cb={'raw':![],'where':{}};var _0x613933={};var _0x41a28e={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xd5e71f[_0xde7d('0x63')]['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x551b80,null))[_0xde7d('0x33')](function(_0x3cb6c6){if(_0x3cb6c6){_0x613933[_0xde7d('0x41')]=_[_0xde7d('0x43')](db[_0xde7d('0x68')][_0xde7d('0x3e')]);_0x613933[_0xde7d('0x42')]=_[_0xde7d('0x43')](_0xd5e71f[_0xde7d('0x42')]);_0x613933[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x613933['model'],_0x613933[_0xde7d('0x42')]);_0x4ea7cb['attributes']=_['intersection'](_0x613933[_0xde7d('0x41')],qs[_0xde7d('0x47')](_0xd5e71f[_0xde7d('0x42')][_0xde7d('0x47')]));_0x4ea7cb[_0xde7d('0x46')]=_0x4ea7cb[_0xde7d('0x46')][_0xde7d('0x48')]?_0x4ea7cb['attributes']:_0x613933['model'];if(!_0xd5e71f['query'][_0xde7d('0x49')](_0xde7d('0x69'))){_0x4ea7cb['limit']=qs['limit'](_0xd5e71f['query'][_0xde7d('0x2d')]);_0x4ea7cb[_0xde7d('0x2b')]=qs['offset'](_0xd5e71f[_0xde7d('0x42')][_0xde7d('0x2b')]);}_0x4ea7cb['order']=qs[_0xde7d('0x4a')](_0xd5e71f['query']['sort']);_0x4ea7cb[_0xde7d('0x4b')]=qs[_0xde7d('0x44')](_[_0xde7d('0x4c')](_0xd5e71f[_0xde7d('0x42')],_0x613933[_0xde7d('0x44')]));_0x4ea7cb[_0xde7d('0x4b')][_0xde7d('0x66')]=_0x3cb6c6['id'];if(_0xd5e71f['query'][_0xde7d('0x4d')]){_0x4ea7cb['where']=_[_0xde7d('0x4e')](_0x4ea7cb[_0xde7d('0x4b')],{'$or':_[_0xde7d('0x3c')](_0x4ea7cb['attributes'],function(_0x203104){var _0x2f488={};_0x2f488[_0x203104]={'$like':'%'+_0xd5e71f[_0xde7d('0x42')][_0xde7d('0x4d')]+'%'};return _0x2f488;})});}_0x4ea7cb=_[_0xde7d('0x4e')]({},_0x4ea7cb,_0xd5e71f['options']);return db[_0xde7d('0x68')][_0xde7d('0x2e')]({'where':_0x4ea7cb[_0xde7d('0x4b')]})['then'](function(_0x5233f6){_0x41a28e['count']=_0x5233f6;if(_0xd5e71f[_0xde7d('0x42')]['includeAll']){_0x4ea7cb[_0xde7d('0x53')]=[{'all':!![]}];}return db[_0xde7d('0x68')][_0xde7d('0x54')](_0x4ea7cb);})[_0xde7d('0x33')](function(_0x3d28c4){_0x41a28e[_0xde7d('0x55')]=_0x3d28c4;return _0x41a28e;});}})[_0xde7d('0x33')](respondWithFilteredResult(_0x551b80,_0x4ea7cb))[_0xde7d('0x56')](handleError(_0x551b80,null));};exports[_0xde7d('0x6a')]=function(_0x3c6d55,_0x43f5f0,_0x576031){return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x3c6d55[_0xde7d('0x63')]['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x43f5f0,null))[_0xde7d('0x33')](function(_0x12400a){if(_0x12400a){return _0x12400a[_0xde7d('0x6a')](_0x3c6d55['query'][_0xde7d('0x6b')]);}})['then'](respondWithStatusCode(_0x43f5f0,null))[_0xde7d('0x56')](handleError(_0x43f5f0,null));};exports[_0xde7d('0x6c')]=function(_0x2c5bd6,_0xde5a48,_0x440063){if(_0x2c5bd6[_0xde7d('0x59')]['id']){delete _0x2c5bd6[_0xde7d('0x59')]['id'];}return db[_0xde7d('0x3d')]['find']({'where':{'id':_0x2c5bd6[_0xde7d('0x63')]['id']}})['then'](handleEntityNotFound(_0xde5a48,null))[_0xde7d('0x33')](function(_0x1f61bb){if(_0x1f61bb){_0x2c5bd6[_0xde7d('0x59')][_0xde7d('0x66')]=_0x1f61bb['id'];return db[_0xde7d('0x6d')][_0xde7d('0x58')](_0x2c5bd6[_0xde7d('0x59')]);}})[_0xde7d('0x33')](respondWithResult(_0xde5a48,null))[_0xde7d('0x56')](handleError(_0xde5a48,null));};exports[_0xde7d('0x6e')]=function(_0x3cfe07,_0x1a4888,_0x4ccb85){var _0x106956={'raw':![],'where':{}};var _0x444d72={};var _0x304118={'count':0x0,'rows':[]};return db[_0xde7d('0x3d')]['findOne']({'where':{'id':_0x3cfe07[_0xde7d('0x63')]['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x1a4888,null))[_0xde7d('0x33')](function(_0x3696f5){if(_0x3696f5){_0x444d72['model']=_['keys'](db[_0xde7d('0x6d')][_0xde7d('0x3e')]);_0x444d72['query']=_[_0xde7d('0x43')](_0x3cfe07[_0xde7d('0x42')]);_0x444d72[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x444d72[_0xde7d('0x41')],_0x444d72[_0xde7d('0x42')]);_0x106956[_0xde7d('0x46')]=_[_0xde7d('0x45')](_0x444d72[_0xde7d('0x41')],qs[_0xde7d('0x47')](_0x3cfe07[_0xde7d('0x42')]['fields']));_0x106956[_0xde7d('0x46')]=_0x106956[_0xde7d('0x46')]['length']?_0x106956[_0xde7d('0x46')]:_0x444d72[_0xde7d('0x41')];if(!_0x3cfe07[_0xde7d('0x42')][_0xde7d('0x49')](_0xde7d('0x69'))){_0x106956[_0xde7d('0x2d')]=qs['limit'](_0x3cfe07[_0xde7d('0x42')][_0xde7d('0x2d')]);_0x106956[_0xde7d('0x2b')]=qs[_0xde7d('0x2b')](_0x3cfe07[_0xde7d('0x42')][_0xde7d('0x2b')]);}_0x106956[_0xde7d('0x6f')]=qs['sort'](_0x3cfe07[_0xde7d('0x42')][_0xde7d('0x4a')]);_0x106956[_0xde7d('0x4b')]=qs[_0xde7d('0x44')](_['pick'](_0x3cfe07['query'],_0x444d72[_0xde7d('0x44')]));_0x106956['where'][_0xde7d('0x66')]=_0x3696f5['id'];if(_0x3cfe07[_0xde7d('0x42')]['filter']){_0x106956[_0xde7d('0x4b')]=_[_0xde7d('0x4e')](_0x106956['where'],{'$or':_[_0xde7d('0x3c')](_0x106956[_0xde7d('0x46')],function(_0x1b0d2e){var _0x47b4b6={};_0x47b4b6[_0x1b0d2e]={'$like':'%'+_0x3cfe07[_0xde7d('0x42')][_0xde7d('0x4d')]+'%'};return _0x47b4b6;})});}_0x106956=_['merge']({},_0x106956,_0x3cfe07[_0xde7d('0x51')]);return db['CannedAnswer'][_0xde7d('0x2e')]({'where':_0x106956[_0xde7d('0x4b')]})[_0xde7d('0x33')](function(_0x59c7c7){_0x304118[_0xde7d('0x2e')]=_0x59c7c7;if(_0x3cfe07[_0xde7d('0x42')][_0xde7d('0x52')]){_0x106956['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xde7d('0x54')](_0x106956);})['then'](function(_0x11b2c5){_0x304118['rows']=_0x11b2c5;return _0x304118;});}})['then'](respondWithFilteredResult(_0x1a4888,_0x106956))['catch'](handleError(_0x1a4888,null));};exports[_0xde7d('0x70')]=function(_0x1e4e40,_0x3a1462,_0x425787){return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x1e4e40[_0xde7d('0x63')]['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x3a1462,null))[_0xde7d('0x33')](function(_0x200b4c){if(_0x200b4c){return _0x200b4c[_0xde7d('0x70')](_0x1e4e40[_0xde7d('0x42')][_0xde7d('0x6b')]);}})['then'](respondWithStatusCode(_0x3a1462,null))[_0xde7d('0x56')](handleError(_0x3a1462,null));};exports[_0xde7d('0x71')]=function(_0x1a5311,_0x1db4c1,_0x50f064){return db['FaxInteraction']['find']({'where':{'id':_0x1a5311[_0xde7d('0x63')]['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x1db4c1,null))[_0xde7d('0x33')](function(_0x198577){if(_0x198577){return _0x198577[_0xde7d('0x71')](_0x1a5311[_0xde7d('0x59')]['ids'],_[_0xde7d('0x72')](_0x1a5311['body'],[_0xde7d('0x6b'),'id'])||{});}})[_0xde7d('0x33')](respondWithResult(_0x1db4c1,null))[_0xde7d('0x56')](handleError(_0x1db4c1,null));};exports[_0xde7d('0x73')]=function(_0x1c1fa8,_0x3312c0,_0x3ef464){var _0x5d6fbd={'raw':![],'where':{}};var _0x34a21d={};var _0x542a56={'count':0x0,'rows':[]};return db[_0xde7d('0x3d')][_0xde7d('0x74')]({'where':{'id':_0x1c1fa8[_0xde7d('0x63')]['id']}})['then'](handleEntityNotFound(_0x3312c0,null))[_0xde7d('0x33')](function(_0x32e8a8){if(_0x32e8a8){_0x34a21d[_0xde7d('0x41')]=_[_0xde7d('0x43')](db[_0xde7d('0x75')][_0xde7d('0x3e')]);_0x34a21d['query']=_[_0xde7d('0x43')](_0x1c1fa8['query']);_0x34a21d[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x34a21d['model'],_0x34a21d[_0xde7d('0x42')]);_0x5d6fbd[_0xde7d('0x46')]=_[_0xde7d('0x45')](_0x34a21d[_0xde7d('0x41')],qs[_0xde7d('0x47')](_0x1c1fa8['query']['fields']));_0x5d6fbd[_0xde7d('0x46')]=_0x5d6fbd[_0xde7d('0x46')]['length']?_0x5d6fbd[_0xde7d('0x46')]:_0x34a21d[_0xde7d('0x41')];if(!_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x49')]('nolimit')){_0x5d6fbd[_0xde7d('0x2d')]=qs[_0xde7d('0x2d')](_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x2d')]);_0x5d6fbd[_0xde7d('0x2b')]=qs['offset'](_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x2b')]);}_0x5d6fbd['order']=qs[_0xde7d('0x4a')](_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x4a')]);_0x5d6fbd[_0xde7d('0x4b')]=qs[_0xde7d('0x44')](_[_0xde7d('0x4c')](_0x1c1fa8[_0xde7d('0x42')],_0x34a21d[_0xde7d('0x44')]));_0x5d6fbd[_0xde7d('0x4b')]['FaxAccountId']=_0x32e8a8['id'];if(_0x1c1fa8['query']['filter']){_0x5d6fbd[_0xde7d('0x4b')]=_[_0xde7d('0x4e')](_0x5d6fbd['where'],{'$or':_[_0xde7d('0x3c')](_0x5d6fbd[_0xde7d('0x46')],function(_0x21ae2a){var _0x111b1d={};_0x111b1d[_0x21ae2a]={'$like':'%'+_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x4d')]+'%'};return _0x111b1d;})});}_0x5d6fbd=_[_0xde7d('0x4e')]({},_0x5d6fbd,_0x1c1fa8[_0xde7d('0x51')]);return db[_0xde7d('0x75')]['count']({'where':_0x5d6fbd['where']})[_0xde7d('0x33')](function(_0x3bc229){_0x542a56['count']=_0x3bc229;if(_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x52')]){_0x5d6fbd[_0xde7d('0x53')]=[{'model':db[_0xde7d('0x76')],'as':_0xde7d('0x77'),'required':![]},{'model':db[_0xde7d('0x78')],'as':'Owner','attributes':[_0xde7d('0x38'),'fullname','internal'],'required':![]},{'model':db[_0xde7d('0x79')],'as':'Tags','attributes':['id',_0xde7d('0x38'),_0xde7d('0x7a')],'where':_0x1c1fa8['query'][_0xde7d('0x7b')]?{'id':_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x7b')]}:undefined,'required':_0x1c1fa8[_0xde7d('0x42')][_0xde7d('0x7b')]?!![]:![]}];}return db[_0xde7d('0x75')][_0xde7d('0x54')](_0x5d6fbd);})['then'](function(_0x49eec2){_0x542a56[_0xde7d('0x55')]=_0x49eec2;return _0x542a56;});}})[_0xde7d('0x33')](respondWithFilteredResult(_0x3312c0,_0x5d6fbd))[_0xde7d('0x56')](handleError(_0x3312c0,null));};exports[_0xde7d('0x7c')]=function(_0x194f9d,_0x567018){var _0x2b4663=_0x194f9d[_0xde7d('0x63')]['id'];var _0xf20f34=_0x194f9d[_0xde7d('0x59')];var _0xfabbca=0xc8;var _0x361c87=null;return db[_0xde7d('0x7d')][_0xde7d('0x7e')]({'isolationLevel':db[_0xde7d('0x7d')][_0xde7d('0x7f')][_0xde7d('0x80')][_0xde7d('0x81')]},function(_0x146b25){return db[_0xde7d('0x3d')][_0xde7d('0x74')]({'where':{'id':_0x2b4663},'transaction':_0x146b25})[_0xde7d('0x33')](function(_0x109488){if(_0x109488){return db[_0xde7d('0x82')]['destroy']({'where':{'FaxAccountId':_0x2b4663},'transaction':_0x146b25})['then'](function(){var _0x41b625=_['map'](_0xf20f34,function(_0x52edef){_0x52edef[_0xde7d('0x66')]=_0x2b4663;return _0x52edef;});return db['FaxApplication']['bulkCreate'](_0x41b625,{'transaction':_0x146b25});});}else{_0xfabbca=0x194;_0x361c87=[];}});})[_0xde7d('0x33')](function(){if(_0xfabbca!==0x194){return db[_0xde7d('0x82')]['findAndCountAll']({'where':{'FaxAccountId':_0x2b4663},'order':'priority'})[_0xde7d('0x33')](function(_0x548cef){_0x361c87=_0x548cef;});}})['catch'](function(_0x240170){_0xfabbca=0x1f4;logger[_0xde7d('0x23')](_0x240170['stack']);if(_0x240170[_0xde7d('0x38')]){delete _0x240170['name'];}_0x361c87=_0x240170;})[_0xde7d('0x83')](function(){if(_0x361c87===null){_0x567018[_0xde7d('0x27')](_0xfabbca);}else{if(_0xfabbca===0x1f4){_0x567018[_0xde7d('0x29')](_0xfabbca)['send'](_0x361c87);}else{_0x567018[_0xde7d('0x29')](_0xfabbca)[_0xde7d('0x2a')](_0x361c87);}}});};exports[_0xde7d('0x84')]=function(_0x3361d5,_0x548cd2,_0x323828){var _0x138485={};var _0x4d36c3={};var _0x245d9c;var _0x55b0d7;return db[_0xde7d('0x3d')][_0xde7d('0x74')]({'where':{'id':_0x3361d5[_0xde7d('0x63')]['id']}})['then'](handleEntityNotFound(_0x548cd2,null))[_0xde7d('0x33')](function(_0x393abd){if(_0x393abd){_0x245d9c=_0x393abd;_0x4d36c3[_0xde7d('0x41')]=_[_0xde7d('0x43')](db[_0xde7d('0x82')]['rawAttributes']);_0x4d36c3[_0xde7d('0x42')]=_[_0xde7d('0x43')](_0x3361d5[_0xde7d('0x42')]);_0x4d36c3[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x4d36c3[_0xde7d('0x41')],_0x4d36c3[_0xde7d('0x42')]);_0x138485[_0xde7d('0x46')]=_[_0xde7d('0x45')](_0x4d36c3[_0xde7d('0x41')],qs[_0xde7d('0x47')](_0x3361d5[_0xde7d('0x42')][_0xde7d('0x47')]));_0x138485[_0xde7d('0x46')]=_0x138485[_0xde7d('0x46')][_0xde7d('0x48')]?_0x138485['attributes']:_0x4d36c3['model'];_0x138485[_0xde7d('0x6f')]=qs[_0xde7d('0x4a')](_0x3361d5['query'][_0xde7d('0x4a')]);_0x138485[_0xde7d('0x4b')]=qs['filters'](_[_0xde7d('0x4c')](_0x3361d5['query'],_0x4d36c3[_0xde7d('0x44')]));if(_0x3361d5[_0xde7d('0x42')][_0xde7d('0x4d')]){_0x138485[_0xde7d('0x4b')]=_[_0xde7d('0x4e')](_0x138485['where'],{'$or':_[_0xde7d('0x3c')](_0x138485['attributes'],function(_0x12f32e){var _0x1e9b29={};_0x1e9b29[_0x12f32e]={'$like':'%'+_0x3361d5['query'][_0xde7d('0x4d')]+'%'};return _0x1e9b29;})});}_0x138485=_['merge']({},_0x138485,_0x3361d5[_0xde7d('0x51')]);return _0x245d9c['getApplications'](_0x138485);}})[_0xde7d('0x33')](function(_0x5abdb1){if(_0x5abdb1){_0x55b0d7=_0x5abdb1[_0xde7d('0x48')];if(!_0x3361d5[_0xde7d('0x42')][_0xde7d('0x49')](_0xde7d('0x69'))){_0x138485['limit']=qs[_0xde7d('0x2d')](_0x3361d5['query']['limit']);_0x138485[_0xde7d('0x2b')]=qs[_0xde7d('0x2b')](_0x3361d5[_0xde7d('0x42')][_0xde7d('0x2b')]);}return _0x245d9c[_0xde7d('0x84')](_0x138485);}})[_0xde7d('0x33')](function(_0x4e9719){if(_0x4e9719){return _0x4e9719?{'count':_0x55b0d7,'rows':_0x4e9719}:null;}})[_0xde7d('0x33')](respondWithResult(_0x548cd2,null))['catch'](handleError(_0x548cd2,null));};function Extension(_0x3565e4,_0x202b08,_0x3beaa0,_0x217890){this[_0xde7d('0x85')]=_0xde7d('0x86');this['exten']=_0x3565e4[_0xde7d('0x87')];this[_0xde7d('0x88')]=_0x217890;this[_0xde7d('0x4f')]=_0xde7d('0x89');this[_0xde7d('0x8a')]='Fax\x20Extension';this[_0xde7d('0x66')]=_0x3565e4['id'];this[_0xde7d('0x8b')]=_0x202b08;this[_0xde7d('0x8c')]=_0x3beaa0;}function createExtensionsReciveFax(_0x42005b){var _0x520351=0x1;var _0x3cd53d=[];_0x3cd53d[_0xde7d('0x8d')](new Extension(_0x42005b,_0x520351,'',_0xde7d('0x8e')));_0x520351+=0x1;_0x3cd53d[_0xde7d('0x8d')](new Extension(_0x42005b,_0x520351,_0xde7d('0x8f'),_0xde7d('0x90')));_0x520351+=0x1;for(var _0x10de1 in _0x42005b){if(_0x42005b['hasOwnProperty'](_0x10de1)&&(_0x10de1===_0xde7d('0x91')||_0x10de1===_0xde7d('0x87')||_0x10de1===_0xde7d('0x92')||_0x10de1===_0xde7d('0x93')||_0x10de1===_0xde7d('0x94')||_0x10de1===_0xde7d('0x95')||_0x10de1===_0xde7d('0x96')||_0x10de1==='modem'||_0x10de1===_0xde7d('0x97'))){_0x3cd53d[_0xde7d('0x8d')](new Extension(_0x42005b,_0x520351,_0xde7d('0x98')+_0x10de1+')='+_0x42005b[_0x10de1],_0xde7d('0x90')));_0x520351+=0x1;}}_0x3cd53d[_0xde7d('0x8d')](new Extension(_0x42005b,_0x520351,'6',_0xde7d('0x99')));_0x520351+=0x1;_0x3cd53d['push'](new Extension(_0x42005b,_0x520351,_0xde7d('0x9a'),_0xde7d('0x9b')));_0x520351=0x0;return _0x3cd53d;}exports['addAccountApplications']=function(_0x22ef02,_0x484b62,_0x4241b5){var _0x271678;return db[_0xde7d('0x7d')][_0xde7d('0x7e')](function(_0x439100){return db[_0xde7d('0x3d')][_0xde7d('0x58')](_0x22ef02[_0xde7d('0x59')],{'transaction':_0x439100})['then'](function(_0x3839d6){_0x271678=_0x3839d6[_0xde7d('0x5a')]({'plain':!![]});return db[_0xde7d('0x9c')][_0xde7d('0x9d')](createExtensionsReciveFax(_0x271678),{'transaction':_0x439100});});})[_0xde7d('0x33')](function(){return _0x271678;})['then'](respondWithResult(_0x484b62,null))[_0xde7d('0x56')](handleError(_0x484b62,null));};exports['updateAccountApplications']=function(_0x4bb6d2,_0x1af59c,_0x218e42){var _0x36634e;return db['sequelize'][_0xde7d('0x7e')](function(_0x46e628){return db[_0xde7d('0x3d')][_0xde7d('0x62')](_0x4bb6d2[_0xde7d('0x59')],{'where':{'id':_0x4bb6d2[_0xde7d('0x59')]['id']},'transaction':_0x46e628})[_0xde7d('0x33')](function(_0x1daf0d){return db[_0xde7d('0x9c')][_0xde7d('0x34')]({'where':{'FaxAccountId':_0x4bb6d2[_0xde7d('0x59')]['id']},'transaction':_0x46e628})[_0xde7d('0x33')](function(_0x5d050e){return db[_0xde7d('0x9c')][_0xde7d('0x9d')](createExtensionsReciveFax(_[_0xde7d('0x72')](_0x4bb6d2['body'],[_0xde7d('0x9e'),_0xde7d('0x40'),_0xde7d('0x9f'),'updatedAt',_0xde7d('0xa0'),_0xde7d('0xa1')])),{'transaction':_0x46e628});});});})[_0xde7d('0x33')](function(){return db[_0xde7d('0x3d')]['findById'](_0x4bb6d2[_0xde7d('0x59')]['id']);})[_0xde7d('0x33')](respondWithResult(_0x1af59c,null))[_0xde7d('0x56')](handleError(_0x1af59c,null));};exports[_0xde7d('0xa2')]=function(_0x2427c8,_0x31d786,_0xb5107d){var _0x265621={'raw':!![],'where':{}};var _0x32ec15={};var _0x40ff24={'count':0x0,'rows':[]};return db[_0xde7d('0x3d')][_0xde7d('0x74')]({'where':{'id':_0x2427c8[_0xde7d('0x63')]['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x31d786,null))[_0xde7d('0x33')](function(_0x398fde){if(_0x398fde){_0x32ec15[_0xde7d('0x41')]=_[_0xde7d('0x43')](db['FaxMessage'][_0xde7d('0x3e')]);_0x32ec15[_0xde7d('0x42')]=_[_0xde7d('0x43')](_0x2427c8['query']);_0x32ec15['filters']=_[_0xde7d('0x45')](_0x32ec15[_0xde7d('0x41')],_0x32ec15[_0xde7d('0x42')]);_0x265621[_0xde7d('0x46')]=_['intersection'](_0x32ec15[_0xde7d('0x41')],qs['fields'](_0x2427c8[_0xde7d('0x42')]['fields']));_0x265621[_0xde7d('0x46')]=_0x265621[_0xde7d('0x46')][_0xde7d('0x48')]?_0x265621[_0xde7d('0x46')]:_0x32ec15[_0xde7d('0x41')];if(!_0x2427c8['query'][_0xde7d('0x49')](_0xde7d('0x69'))){_0x265621[_0xde7d('0x2d')]=qs[_0xde7d('0x2d')](_0x2427c8[_0xde7d('0x42')][_0xde7d('0x2d')]);_0x265621[_0xde7d('0x2b')]=qs['offset'](_0x2427c8[_0xde7d('0x42')][_0xde7d('0x2b')]);}_0x265621[_0xde7d('0x6f')]=qs[_0xde7d('0x4a')](_0x2427c8[_0xde7d('0x42')][_0xde7d('0x4a')]);_0x265621['where']=qs[_0xde7d('0x44')](_[_0xde7d('0x4c')](_0x2427c8[_0xde7d('0x42')],_0x32ec15[_0xde7d('0x44')]));_0x265621['where'][_0xde7d('0x66')]=_0x398fde['id'];if(_0x2427c8[_0xde7d('0x42')]['filter']){_0x265621['where']=_[_0xde7d('0x4e')](_0x265621['where'],{'$or':_[_0xde7d('0x3c')](_0x265621[_0xde7d('0x46')],function(_0x2e4cd3){var _0x3d44af={};_0x3d44af[_0x2e4cd3]={'$like':'%'+_0x2427c8[_0xde7d('0x42')][_0xde7d('0x4d')]+'%'};return _0x3d44af;})});}if(_0x2427c8[_0xde7d('0x42')][_0xde7d('0xa3')]){var _0x5cb3c9=_0x2427c8[_0xde7d('0x42')]['$gte'][_0xde7d('0xa4')](',');var _0x2ac63c={};_0x2ac63c[_0x5cb3c9[0x0]]={'$gte':moment(_0x5cb3c9[0x1])['format'](_0xde7d('0xa5'))};_0x265621[_0xde7d('0x4b')]=_[_0xde7d('0x4e')](_0x265621['where'],_0x2ac63c);}_0x265621=_['merge']({},_0x265621,_0x2427c8[_0xde7d('0x51')]);return db[_0xde7d('0xa6')][_0xde7d('0x2e')]({'where':_0x265621[_0xde7d('0x4b')]})[_0xde7d('0x33')](function(_0x3972e5){_0x40ff24[_0xde7d('0x2e')]=_0x3972e5;if(_0x2427c8[_0xde7d('0x42')]['includeAll']){_0x265621['include']=[{'all':!![]}];}return db[_0xde7d('0xa6')]['findAll'](_0x265621);})['then'](function(_0x556dfa){_0x40ff24[_0xde7d('0x55')]=_0x556dfa;return _0x40ff24;});}})[_0xde7d('0x33')](respondWithFilteredResult(_0x31d786,_0x265621))[_0xde7d('0x56')](handleError(_0x31d786,null));};exports[_0xde7d('0x39')]=function(_0x16b6f2,_0x3b8f6f,_0xb2c9e7){var _0x46161e,_0x1e9427={},_0x1d9b00;if(_0x16b6f2[_0xde7d('0x59')]['to']){_0x1d9b00=_0x16b6f2[_0xde7d('0x59')]['to'][0x0];}return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x16b6f2['params']['id']},'include':[{'model':db['CmList'],'as':_0xde7d('0xa7'),'include':[{'model':db[_0xde7d('0x76')],'as':_0xde7d('0xa8'),'where':{'fax':_0x1d9b00},'limit':0x1,'order':[[_0xde7d('0xa9'),_0xde7d('0xaa')]]}]}]})[_0xde7d('0x33')](handleEntityNotFound(_0x3b8f6f,null))[_0xde7d('0x33')](function(_0x2c3b52){_0x46161e=_0x2c3b52;if(_0x16b6f2['body'][_0xde7d('0xab')]&&_0x16b6f2[_0xde7d('0x59')]['attachments']['length']){for(var _0x280b69=0x0;_0x280b69<_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][_0xde7d('0x48')];_0x280b69+=0x1){_0x16b6f2[_0xde7d('0x59')]['attachments'][_0x280b69]={'filename':_0x16b6f2['body']['attachments'][_0x280b69][_0xde7d('0x38')],'id':_0x16b6f2['body'][_0xde7d('0xab')][_0x280b69]['id'],'path':path['join'](config['root'],_0xde7d('0xac'),_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][_0x280b69][_0xde7d('0xad')])};}}return respondWithRpcPromise(_0xde7d('0xae'),_0xde7d('0xae'),{'FaxAccountId':_[_0xde7d('0xaf')](_0x16b6f2['params']['id'])?undefined:_0x16b6f2[_0xde7d('0x63')]['id'],'path':_['isNil'](_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][0x0]['path'])?undefined:_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][0x0][_0xde7d('0x5')],'fax':_[_0xde7d('0xaf')](_0x16b6f2['body']['to'][0x0])?undefined:_0x16b6f2[_0xde7d('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x46161e){if(_['isNil'](_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xb0')])){_0x16b6f2['body'][_0xde7d('0xb0')]=util[_0xde7d('0xb1')]('\x22%s\x22\x20<%s>',_0x46161e['name'],_0x46161e[_0xde7d('0xb2')]);}if(_0x46161e[_0xde7d('0xa7')]){if(_0x46161e[_0xde7d('0xa7')]['Contacts']['length']){return _0x46161e[_0xde7d('0xa7')][_0xde7d('0xa8')][0x0];}else{return db[_0xde7d('0x76')][_0xde7d('0x58')](_['defaults'](_0x16b6f2['body'],{'firstName':_0x16b6f2[_0xde7d('0x59')]['to'][0x0],'phone':_0x16b6f2[_0xde7d('0x59')]['to'][0x0],'fax':_0x16b6f2['body']['to'][0x0],'ListId':_0x46161e[_0xde7d('0xa1')]}));}}else{throw new Error(_0xde7d('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xde7d('0x33')](function(_0x4a7cc7){if(_0x4a7cc7){return db[_0xde7d('0x75')][_0xde7d('0x5f')]({'where':{'ContactId':_0x4a7cc7['id'],'closed':![],'FaxAccountId':_0x46161e['id']}})[_0xde7d('0x33')](function(_0x15a318){if(_0x15a318){return[_0x15a318,![]];}return db[_0xde7d('0x75')][_0xde7d('0x58')]({'UserId':_0x16b6f2[_0xde7d('0x5d')]['id'],'ContactId':_0x4a7cc7['id'],'FaxAccountId':_0x46161e['id'],'fax':_0x16b6f2[_0xde7d('0x59')]['to'][0x0],'firstMsgDirection':_0xde7d('0xb4'),'Messages':[_[_0xde7d('0x4e')](_0x16b6f2[_0xde7d('0x59')],{'read':![],'body':_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][0x0]['filename'],'FaxAccountId':_0x46161e['id'],'UserId':_0x16b6f2[_0xde7d('0x5d')]['id'],'ContactId':_0x4a7cc7['id'],'AttachmentId':_0x16b6f2['body'][_0xde7d('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xde7d('0xa6')],'as':_0xde7d('0xb5')}]})[_0xde7d('0x33')](function(_0x36703f){return[_0x36703f,!![]];});});}else{throw new Error(_0xde7d('0xb6'));}})[_0xde7d('0xb7')](function(_0x369a39,_0x2b722c){if(_0x2b722c){return _0x369a39;}return db['FaxMessage'][_0xde7d('0x58')]({'direction':'out','read':![],'body':_0x16b6f2[_0xde7d('0x59')]['attachments'][0x0][_0xde7d('0xb8')],'FaxAccountId':_0x46161e['id'],'FaxInteractionId':_0x369a39['id'],'UserId':_0x16b6f2['user']['id'],'ContactId':_0x369a39[_0xde7d('0xb9')],'AttachmentId':_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][0x0]['id']})[_0xde7d('0x33')](function(_0x1ad98d){_0x369a39[_0xde7d('0xba')][_0xde7d('0xb5')]=[];_0x369a39[_0xde7d('0xba')]['Messages'][_0xde7d('0x8d')](_0x1ad98d['dataValues']);return _0x369a39;});})[_0xde7d('0x33')](function(_0x361544){respondWithRpcPromise(_0xde7d('0xbb'),_0xde7d('0xbb'),{'FaxAccountId':_[_0xde7d('0xaf')](_0x16b6f2[_0xde7d('0x63')]['id'])?undefined:_0x16b6f2[_0xde7d('0x63')]['id'],'path':_[_0xde7d('0xaf')](_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][0x0][_0xde7d('0x5')])?undefined:_0x16b6f2[_0xde7d('0x59')][_0xde7d('0xab')][0x0][_0xde7d('0x5')],'fax':_[_0xde7d('0xaf')](_0x16b6f2[_0xde7d('0x59')]['to'][0x0])?undefined:_0x16b6f2[_0xde7d('0x59')]['to'][0x0],'AttachmentId':_0x16b6f2['body'][_0xde7d('0xab')][0x0]['id']},client9002)['then'](function(_0x5ea0cb){logger[_0xde7d('0x25')](_0xde7d('0xbc'),_0x5ea0cb);})['catch'](function(_0x8e3f7f){logger[_0xde7d('0x25')]('SendFaxRpc,\x20%s',_0x8e3f7f);});return _0x361544;})[_0xde7d('0x33')](respondWithResult(_0x3b8f6f,null))[_0xde7d('0x56')](handleError(_0x3b8f6f,null));};exports[_0xde7d('0xbd')]=function(_0x51fd3c,_0x1269b,_0x418704){return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x51fd3c['params']['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x1269b,null))[_0xde7d('0x33')](function(_0x2d904b){if(_0x2d904b){return _0x2d904b[_0xde7d('0xbd')](_0x51fd3c[_0xde7d('0x59')][_0xde7d('0x6b')],_[_0xde7d('0x72')](_0x51fd3c['body'],[_0xde7d('0x6b'),'id'])||{})[_0xde7d('0xb7')](function(_0x592d81){for(var _0x4b9228=0x0;_0x4b9228<_0x51fd3c['body'][_0xde7d('0x6b')]['length'];_0x4b9228+=0x1){socket['emit'](_0xde7d('0xbe'),{'UserId':Number(_0x51fd3c[_0xde7d('0x59')]['ids'][_0x4b9228]),'FaxAccountId':Number(_0x51fd3c['params']['id'])});}return _0x592d81;});}})[_0xde7d('0x33')](respondWithResult(_0x1269b,null))[_0xde7d('0x56')](handleError(_0x1269b,null));};exports['removeAgents']=function(_0x44437e,_0x21221e,_0x249689){return db[_0xde7d('0x3d')][_0xde7d('0x5f')]({'where':{'id':_0x44437e['params']['id']}})[_0xde7d('0x33')](handleEntityNotFound(_0x21221e,null))[_0xde7d('0x33')](function(_0x2b4811){if(_0x2b4811){return _0x2b4811[_0xde7d('0xbf')](_0x44437e[_0xde7d('0x42')][_0xde7d('0x6b')])['then'](function(){if(_[_0xde7d('0xc0')](_0x44437e['query']['ids'])){for(var _0x1a564c=0x0;_0x1a564c<_0x44437e[_0xde7d('0x42')][_0xde7d('0x6b')]['length'];_0x1a564c+=0x1){socket[_0xde7d('0xc1')](_0xde7d('0xc2'),{'UserId':Number(_0x44437e['query'][_0xde7d('0x6b')][_0x1a564c]),'FaxAccountId':Number(_0x44437e[_0xde7d('0x63')]['id'])});}}else{socket[_0xde7d('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x44437e[_0xde7d('0x42')][_0xde7d('0x6b')]),'FaxAccountId':Number(_0x44437e[_0xde7d('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x21221e,null))[_0xde7d('0x56')](handleError(_0x21221e,null));};exports[_0xde7d('0xc3')]=function(_0x3c4b3d,_0x2dde25,_0x584c3b){var _0x10404e={};var _0x5870c7={};var _0x1b261e;var _0x30ccd3;return db[_0xde7d('0x3d')][_0xde7d('0x74')]({'where':{'id':_0x3c4b3d[_0xde7d('0x63')]['id']}})['then'](handleEntityNotFound(_0x2dde25,null))[_0xde7d('0x33')](function(_0x3bb6ab){if(_0x3bb6ab){_0x1b261e=_0x3bb6ab;_0x5870c7[_0xde7d('0x41')]=_[_0xde7d('0x43')](db[_0xde7d('0x78')][_0xde7d('0x3e')]);_0x5870c7[_0xde7d('0x42')]=_[_0xde7d('0x43')](_0x3c4b3d[_0xde7d('0x42')]);_0x5870c7[_0xde7d('0x44')]=_[_0xde7d('0x45')](_0x5870c7['model'],_0x5870c7[_0xde7d('0x42')]);_0x10404e[_0xde7d('0x46')]=_[_0xde7d('0x45')](_0x5870c7[_0xde7d('0x41')],qs[_0xde7d('0x47')](_0x3c4b3d[_0xde7d('0x42')][_0xde7d('0x47')]));_0x10404e[_0xde7d('0x46')]=_0x10404e[_0xde7d('0x46')][_0xde7d('0x48')]?_0x10404e[_0xde7d('0x46')]:_0x5870c7[_0xde7d('0x41')];_0x10404e[_0xde7d('0x6f')]=qs[_0xde7d('0x4a')](_0x3c4b3d[_0xde7d('0x42')][_0xde7d('0x4a')]);_0x10404e[_0xde7d('0x4b')]=qs[_0xde7d('0x44')](_[_0xde7d('0x4c')](_0x3c4b3d[_0xde7d('0x42')],_0x5870c7[_0xde7d('0x44')]));if(_0x3c4b3d['query'][_0xde7d('0x4d')]){_0x10404e[_0xde7d('0x4b')]=_['merge'](_0x10404e[_0xde7d('0x4b')],{'$or':_[_0xde7d('0x3c')](_0x10404e[_0xde7d('0x46')],function(_0x449804){var _0x553cf9={};_0x553cf9[_0x449804]={'$like':'%'+_0x3c4b3d['query'][_0xde7d('0x4d')]+'%'};return _0x553cf9;})});}_0x10404e=_['merge']({},_0x10404e,_0x3c4b3d['options']);return _0x1b261e[_0xde7d('0xc3')](_0x10404e);}})[_0xde7d('0x33')](function(_0x5cf2e7){if(_0x5cf2e7){_0x30ccd3=_0x5cf2e7[_0xde7d('0x48')];if(!_0x3c4b3d[_0xde7d('0x42')][_0xde7d('0x49')]('nolimit')){_0x10404e['limit']=qs['limit'](_0x3c4b3d[_0xde7d('0x42')][_0xde7d('0x2d')]);_0x10404e[_0xde7d('0x2b')]=qs[_0xde7d('0x2b')](_0x3c4b3d[_0xde7d('0x42')][_0xde7d('0x2b')]);}return _0x1b261e['getAgents'](_0x10404e);}})[_0xde7d('0x33')](function(_0x599273){if(_0x599273){return _0x599273?{'count':_0x30ccd3,'rows':_0x599273}:null;}})[_0xde7d('0x33')](respondWithResult(_0x2dde25,null))[_0xde7d('0x56')](handleError(_0x2dde25,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ff63ac2..4d45c9e 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 _0xdfda=['exports','events','update','emit','hook'];(function(_0x2d6af0,_0x90cf24){var _0x3671ad=function(_0x2009ac){while(--_0x2009ac){_0x2d6af0['push'](_0x2d6af0['shift']());}};_0x3671ad(++_0x90cf24);}(_0xdfda,0x10a));var _0xadfd=function(_0x2b2902,_0x1f6f4a){_0x2b2902=_0x2b2902-0x0;var _0x303d29=_0xdfda[_0x2b2902];return _0x303d29;};'use strict';var EventEmitter=require(_0xadfd('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xadfd('0x1'),'afterDestroy':'remove'};function emitEvent(_0x5674a8){return function(_0xdc4d55,_0x3b7484,_0x2a76ce){FaxAccountEvents[_0xadfd('0x2')](_0x5674a8+':'+_0xdc4d55['id'],_0xdc4d55);FaxAccountEvents[_0xadfd('0x2')](_0x5674a8,_0xdc4d55);_0x2a76ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xadfd('0x3')](e,emitEvent(event));}}module[_0xadfd('0x4')]=FaxAccountEvents; \ No newline at end of file +var _0xb32f=['emit','hook','exports','events','FaxAccount','save','remove'];(function(_0x59b702,_0x20e94a){var _0x1b0a55=function(_0x3f5652){while(--_0x3f5652){_0x59b702['push'](_0x59b702['shift']());}};_0x1b0a55(++_0x20e94a);}(_0xb32f,0x14c));var _0xfb32=function(_0x28a476,_0x2bbb1a){_0x28a476=_0x28a476-0x0;var _0x125579=_0xb32f[_0x28a476];return _0x125579;};'use strict';var EventEmitter=require(_0xfb32('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xfb32('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb32('0x2'),'afterUpdate':'update','afterDestroy':_0xfb32('0x3')};function emitEvent(_0x314766){return function(_0x121222,_0x175b37,_0xb7f45c){FaxAccountEvents[_0xfb32('0x4')](_0x314766+':'+_0x121222['id'],_0x121222);FaxAccountEvents[_0xfb32('0x4')](_0x314766,_0x121222);_0xb7f45c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xfb32('0x5')](e,emitEvent(event));}}module[_0xfb32('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index ab88d50..1d1951a 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 _0x6b32=['exports','define','FaxAccount','fax_accounts','util','../../config/logger','api','request-promise','rimraf'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0x6b32,0x1d8));var _0x26b3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6b32[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x26b3('0x0'));var logger=require(_0x26b3('0x1'))(_0x26b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x26b3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26b3('0x4'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x26b3('0x5')]=function(_0x26707a,_0x5c6978){return _0x26707a[_0x26b3('0x6')](_0x26b3('0x7'),attributes,{'tableName':_0x26b3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55bb=['request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x573500,_0x20e275){var _0x2b49c9=function(_0x2c4011){while(--_0x2c4011){_0x573500['push'](_0x573500['shift']());}};_0x2b49c9(++_0x20e275);}(_0x55bb,0x73));var _0xb55b=function(_0x438791,_0x662f2){_0x438791=_0x438791-0x0;var _0x39263d=_0x55bb[_0x438791];return _0x39263d;};'use strict';var _=require(_0xb55b('0x0'));var util=require(_0xb55b('0x1'));var logger=require(_0xb55b('0x2'))('api');var moment=require(_0xb55b('0x3'));var BPromise=require(_0xb55b('0x4'));var rp=require(_0xb55b('0x5'));var fs=require('fs');var path=require(_0xb55b('0x6'));var rimraf=require(_0xb55b('0x7'));var config=require(_0xb55b('0x8'));var attributes=require(_0xb55b('0x9'));module[_0xb55b('0xa')]=function(_0x4eea0d,_0x20bcab){return _0x4eea0d[_0xb55b('0xb')]('FaxAccount',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 3537843..22c47d3 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 _0x4fdd=['CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','CmContact','Contacts','DESC','FaxApplication','Applications','List','get','account','list','applications','orderBy','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','attributes','limit','include','map','model','GetFaxAccount','debug','body','fax','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0x4fdd,0x12b));var _0xd4fd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4fdd[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xd4fd('0x0'));var util=require(_0xd4fd('0x1'));var moment=require('moment');var BPromise=require(_0xd4fd('0x2'));var rs=require(_0xd4fd('0x3'));var fs=require('fs');var Redis=require(_0xd4fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4fd('0x5'));var logger=require(_0xd4fd('0x6'))(_0xd4fd('0x7'));var config=require(_0xd4fd('0x8'));var jayson=require(_0xd4fd('0x9'));var client=jayson[_0xd4fd('0xa')]['http']({'port':0x232c});config[_0xd4fd('0xb')]=_[_0xd4fd('0xc')](config['redis'],{'host':_0xd4fd('0xd'),'port':0x18eb});var socket=require(_0xd4fd('0xe'))(new Redis(config[_0xd4fd('0xb')]));require(_0xd4fd('0xf'))[_0xd4fd('0x10')](socket);function respondWithRpcPromise(_0x5e3bed,_0x5a8d7c,_0x59ecfb){return new BPromise(function(_0x5d4f44,_0xfe0706){return client[_0xd4fd('0x11')](_0x5e3bed,_0x59ecfb)[_0xd4fd('0x12')](function(_0x15e868){logger[_0xd4fd('0x13')](_0xd4fd('0x14'),_0x5a8d7c,_0xd4fd('0x15'));logger['debug'](_0xd4fd('0x16'),_0x5a8d7c,_0xd4fd('0x15'),JSON[_0xd4fd('0x17')](_0x15e868));if(_0x15e868[_0xd4fd('0x18')]){if(_0x15e868[_0xd4fd('0x18')]['code']===0x1f4){logger[_0xd4fd('0x18')](_0xd4fd('0x14'),_0x5a8d7c,_0x15e868[_0xd4fd('0x18')][_0xd4fd('0x19')]);return _0xfe0706(_0x15e868['error']['message']);}logger[_0xd4fd('0x18')]('FaxAccount,\x20%s,\x20%s',_0x5a8d7c,_0x15e868[_0xd4fd('0x18')][_0xd4fd('0x19')]);return _0x5d4f44(_0x15e868[_0xd4fd('0x18')][_0xd4fd('0x19')]);}else{logger[_0xd4fd('0x13')](_0xd4fd('0x14'),_0x5a8d7c,_0xd4fd('0x15'));_0x5d4f44(_0x15e868['result']['message']);}})[_0xd4fd('0x1a')](function(_0x5e32dc){logger[_0xd4fd('0x18')]('FaxAccount,\x20%s,\x20%s',_0x5a8d7c,_0x5e32dc);_0xfe0706(_0x5e32dc);});});}exports['GetFaxAccount']=function(_0x13916d){var _0x47e44c=this;return new Promise(function(_0x5521b8,_0x5b15dc){return db['FaxAccount'][_0xd4fd('0x1b')]({'raw':_0x13916d[_0xd4fd('0x1c')]?_0x13916d[_0xd4fd('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x13916d['options']?_0x13916d[_0xd4fd('0x1c')]['where']||null:null,'attributes':_0x13916d['options']?_0x13916d['options'][_0xd4fd('0x1d')]||null:null,'limit':_0x13916d[_0xd4fd('0x1c')]?_0x13916d[_0xd4fd('0x1c')][_0xd4fd('0x1e')]||null:null,'include':_0x13916d['options']?_0x13916d[_0xd4fd('0x1c')][_0xd4fd('0x1f')]?_[_0xd4fd('0x20')](_0x13916d[_0xd4fd('0x1c')][_0xd4fd('0x1f')],function(_0xf5ea9e){return{'model':db[_0xf5ea9e[_0xd4fd('0x21')]],'as':_0xf5ea9e['as'],'attributes':_0xf5ea9e[_0xd4fd('0x1d')],'include':_0xf5ea9e[_0xd4fd('0x1f')]?_[_0xd4fd('0x20')](_0xf5ea9e[_0xd4fd('0x1f')],function(_0x3cc8ca){return{'model':db[_0x3cc8ca[_0xd4fd('0x21')]],'as':_0x3cc8ca['as'],'attributes':_0x3cc8ca[_0xd4fd('0x1d')],'include':_0x3cc8ca[_0xd4fd('0x1f')]?_['map'](_0x3cc8ca[_0xd4fd('0x1f')],function(_0x1168e3){return{'model':db[_0x1168e3['model']],'as':_0x1168e3['as'],'attributes':_0x1168e3[_0xd4fd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd4fd('0x12')](function(_0x43beae){logger[_0xd4fd('0x13')](_0xd4fd('0x22'),_0x13916d);logger[_0xd4fd('0x23')]('GetFaxAccount',_0x13916d,JSON[_0xd4fd('0x17')](_0x43beae));_0x5521b8(_0x43beae);})[_0xd4fd('0x1a')](function(_0x1f228c){logger[_0xd4fd('0x18')](_0xd4fd('0x22'),_0x1f228c[_0xd4fd('0x19')],_0x13916d);_0x5b15dc(_0x47e44c['error'](0x1f4,_0x1f228c[_0xd4fd('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x25c066,_0x5047ee,_0x9aa858){var _0x2489f8=this;return new Promise(function(_0x1e5c5b,_0x1777d1){var _0x3c739d={'body':_0x25c066[_0xd4fd('0x24')],'channel':_0xd4fd('0x25')};var _0x5c5ea4=[];var _0x31151d=[];var _0x1a176c={};return db['CmContact']['describe']()[_0xd4fd('0x12')](function(_0x543f09){if(!_0x543f09){throw new db[(_0xd4fd('0x26'))][(_0xd4fd('0x27'))](_0xd4fd('0x28'));}_0x5c5ea4=_[_0xd4fd('0x29')](_[_0xd4fd('0x2a')](_0x543f09),[_0xd4fd('0x2b'),_0xd4fd('0x2c')]);_0x31151d=_[_0xd4fd('0x29')](_[_0xd4fd('0x2a')](_0x543f09),['createdAt',_0xd4fd('0x2c'),_0xd4fd('0x2d'),_0xd4fd('0x2e')]);if(_0x25c066[_0xd4fd('0x24')]['id']){delete _0x25c066[_0xd4fd('0x24')]['id'];}if(_[_0xd4fd('0x2f')](_0x25c066[_0xd4fd('0x24')][_0xd4fd('0x30')])){throw new db[(_0xd4fd('0x26'))][(_0xd4fd('0x27'))](_0xd4fd('0x31'));}if(_['isNil'](_0x25c066[_0xd4fd('0x24')]['body'])||_0x25c066[_0xd4fd('0x24')][_0xd4fd('0x24')]===''){throw new db[(_0xd4fd('0x26'))][(_0xd4fd('0x27'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd4fd('0x2f')](_0x25c066[_0xd4fd('0x24')]['mapKey'])){throw new db[(_0xd4fd('0x26'))][(_0xd4fd('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31151d);}if(!_['includes'](_0x31151d,_0x25c066[_0xd4fd('0x24')]['mapKey'])){throw new db[(_0xd4fd('0x26'))][(_0xd4fd('0x27'))](_0xd4fd('0x32')+_0x31151d);}_0x1a176c[_0x25c066['body'][_0xd4fd('0x33')]]=_0x25c066[_0xd4fd('0x24')]['from'];})['then'](function(){return db['FaxAccount'][_0xd4fd('0x34')]({'where':{'id':_0x25c066['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xd4fd('0x35')],'as':_0xd4fd('0x36'),'where':_0x1a176c,'limit':0x1,'order':[['updatedAt',_0xd4fd('0x37')]]}]},{'model':db[_0xd4fd('0x38')],'as':_0xd4fd('0x39')}]});})[_0xd4fd('0x12')](function(_0x3408a9){if(_0x3408a9&&_0x3408a9[_0xd4fd('0x3a')]){var _0x5dae4b=_0x3408a9[_0xd4fd('0x3b')]({'plain':!![]});_0x3c739d[_0xd4fd('0x3c')]=_0x5dae4b;_0x3c739d['applications']=_0x5dae4b[_0xd4fd('0x39')];_0x3c739d[_0xd4fd('0x3d')]=_0x5dae4b[_0xd4fd('0x3a')];_0x3c739d[_0xd4fd('0x3e')]=_[_0xd4fd('0x3f')](_0x3c739d[_0xd4fd('0x3e')],[_0xd4fd('0x40')],[_0xd4fd('0x41')]);if(_0x3c739d[_0xd4fd('0x3c')][_0xd4fd('0x39')]){delete _0x3c739d[_0xd4fd('0x3c')][_0xd4fd('0x39')];}if(_0x3c739d[_0xd4fd('0x3c')]['List']&&_0x3c739d[_0xd4fd('0x3c')][_0xd4fd('0x3a')][_0xd4fd('0x36')]['length']){return _0x3c739d['account']['List'][_0xd4fd('0x36')][0x0];}var _0x4d55e0=_[_0xd4fd('0xc')](_0x25c066[_0xd4fd('0x24')],{'firstName':_0x25c066[_0xd4fd('0x24')][_0xd4fd('0x30')],'ListId':_0x5dae4b['ListId']});_0x4d55e0[_0x25c066[_0xd4fd('0x24')]['mapKey']]=_0x25c066[_0xd4fd('0x24')][_0xd4fd('0x30')];return db['CmContact'][_0xd4fd('0x42')](_0x4d55e0,{'fields':_0x5c5ea4,'raw':!![]});}})[_0xd4fd('0x12')](function(_0x1dff74){_0x3c739d[_0xd4fd('0x43')]=_0x1dff74;if(_0x1dff74){var _0x4b3acb={'ContactId':_0x1dff74['id'],'FaxAccountId':_0x25c066[_0xd4fd('0x3c')]['id'],'fax':_0x1dff74['fax']};return db[_0xd4fd('0x44')][_0xd4fd('0x34')]({'where':{'ContactId':_0x1dff74['id'],'closed':![],'FaxAccountId':_0x25c066[_0xd4fd('0x3c')]['id']}})[_0xd4fd('0x12')](function(_0x473a80){if(_0x473a80){return[_0x473a80,![]];}return db[_0xd4fd('0x44')][_0xd4fd('0x42')](_0x4b3acb)[_0xd4fd('0x12')](function(_0x2f5ecb){return[_0x2f5ecb,!![]];});});}else{throw new Error(_0xd4fd('0x45'));}})[_0xd4fd('0x46')](function(_0x19be72,_0x3ed45c){var _0x56e340=_0x19be72[_0xd4fd('0x3b')]({'plain':!![]});if(_0x3ed45c){if(_0x3c739d[_0xd4fd('0x3c')][_0xd4fd('0x47')]){_0x3c739d[_0xd4fd('0x3e')][_0xd4fd('0x48')]({'id':0x0,'priority':_0x3c739d[_0xd4fd('0x3e')][_0xd4fd('0x49')]+0x1,'app':_0xd4fd('0x4a'),'appdata':'unmanaged','interval':_0xd4fd('0x4b')});}_0x56e340[_0xd4fd('0x4c')]=!![];}else{_0x56e340[_0xd4fd('0x4c')]=![];}_0x3c739d['interaction']=_0x56e340;return db['FaxMessage'][_0xd4fd('0x42')]({'body':_0x25c066[_0xd4fd('0x24')]['body'],'FaxAccountId':_0x25c066[_0xd4fd('0x3c')]['id'],'FaxInteractionId':_0x19be72['id'],'direction':'in','ContactId':_0x19be72[_0xd4fd('0x4d')],'AttachmentId':_0x25c066[_0xd4fd('0x24')][_0xd4fd('0x4e')]});})['then'](function(_0x4f0814){_0x3c739d['message']=_0x4f0814;if(_0x3c739d[_0xd4fd('0x4f')][_0xd4fd('0x50')]){return db[_0xd4fd('0x51')][_0xd4fd('0x34')]({'attributes':['id',_0xd4fd('0x52')],'where':{'id':_0x3c739d[_0xd4fd('0x4f')][_0xd4fd('0x50')]}})[_0xd4fd('0x12')](function(_0x2405be){if(_0x2405be){_0x3c739d[_0xd4fd('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2405be['name']+','+(_0x3c739d[_0xd4fd('0x3c')][_0xd4fd('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x3c739d);});}return respondWithRpcPromise(_0xd4fd('0x54'),_0xd4fd('0x55'),_0x3c739d);})[_0xd4fd('0x12')](function(_0x3f54f2){_0x1e5c5b(_0x3f54f2);})[_0xd4fd('0x1a')](function(_0x42f859){_0x1777d1(_0x2489f8[_0xd4fd('0x18')](0x1f4,_0x42f859[_0xd4fd('0x19')]));});});}; \ No newline at end of file +var _0x6033=['FaxInteraction','autoclose','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','agent','name','Start','startRouting','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','raw','options','where','attributes','limit','map','include','model','then','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','Sequelize','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','find','account','CmList','List','DESC','FaxApplication','get','applications','list','asc','Applications','length','Contacts','ListId','create'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0x6033,0x1c0));var _0x3603=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6033[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x3603('0x0'));var util=require(_0x3603('0x1'));var moment=require('moment');var BPromise=require(_0x3603('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3603('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3603('0x4'));var logger=require(_0x3603('0x5'))(_0x3603('0x6'));var config=require(_0x3603('0x7'));var jayson=require(_0x3603('0x8'));var client=jayson['client'][_0x3603('0x9')]({'port':0x232c});config[_0x3603('0xa')]=_[_0x3603('0xb')](config[_0x3603('0xa')],{'host':_0x3603('0xc'),'port':0x18eb});var socket=require(_0x3603('0xd'))(new Redis(config['redis']));require(_0x3603('0xe'))[_0x3603('0xf')](socket);function respondWithRpcPromise(_0x29bae7,_0x1d5449,_0x25ebee){return new BPromise(function(_0x4f865c,_0x122784){return client[_0x3603('0x10')](_0x29bae7,_0x25ebee)['then'](function(_0x178241){logger[_0x3603('0x11')](_0x3603('0x12'),_0x1d5449,_0x3603('0x13'));logger[_0x3603('0x14')](_0x3603('0x15'),_0x1d5449,_0x3603('0x13'),JSON[_0x3603('0x16')](_0x178241));if(_0x178241[_0x3603('0x17')]){if(_0x178241[_0x3603('0x17')]['code']===0x1f4){logger[_0x3603('0x17')](_0x3603('0x12'),_0x1d5449,_0x178241[_0x3603('0x17')][_0x3603('0x18')]);return _0x122784(_0x178241[_0x3603('0x17')][_0x3603('0x18')]);}logger['error'](_0x3603('0x12'),_0x1d5449,_0x178241['error'][_0x3603('0x18')]);return _0x4f865c(_0x178241[_0x3603('0x17')][_0x3603('0x18')]);}else{logger['info'](_0x3603('0x12'),_0x1d5449,_0x3603('0x13'));_0x4f865c(_0x178241[_0x3603('0x19')][_0x3603('0x18')]);}})[_0x3603('0x1a')](function(_0xeb5afd){logger[_0x3603('0x17')](_0x3603('0x12'),_0x1d5449,_0xeb5afd);_0x122784(_0xeb5afd);});});}exports[_0x3603('0x1b')]=function(_0x1d1fd4){var _0x443c64=this;return new Promise(function(_0x4f61c1,_0x210901){return db[_0x3603('0x1c')][_0x3603('0x1d')]({'raw':_0x1d1fd4['options']?_0x1d1fd4['options'][_0x3603('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d1fd4['options']?_0x1d1fd4[_0x3603('0x1f')][_0x3603('0x20')]||null:null,'attributes':_0x1d1fd4[_0x3603('0x1f')]?_0x1d1fd4[_0x3603('0x1f')][_0x3603('0x21')]||null:null,'limit':_0x1d1fd4['options']?_0x1d1fd4[_0x3603('0x1f')][_0x3603('0x22')]||null:null,'include':_0x1d1fd4[_0x3603('0x1f')]?_0x1d1fd4[_0x3603('0x1f')]['include']?_[_0x3603('0x23')](_0x1d1fd4[_0x3603('0x1f')][_0x3603('0x24')],function(_0x532289){return{'model':db[_0x532289['model']],'as':_0x532289['as'],'attributes':_0x532289[_0x3603('0x21')],'include':_0x532289[_0x3603('0x24')]?_[_0x3603('0x23')](_0x532289[_0x3603('0x24')],function(_0x11fe89){return{'model':db[_0x11fe89['model']],'as':_0x11fe89['as'],'attributes':_0x11fe89[_0x3603('0x21')],'include':_0x11fe89[_0x3603('0x24')]?_[_0x3603('0x23')](_0x11fe89[_0x3603('0x24')],function(_0x424099){return{'model':db[_0x424099[_0x3603('0x25')]],'as':_0x424099['as'],'attributes':_0x424099['attributes']};}):[]};}):[]};}):[]:[]})[_0x3603('0x26')](function(_0x12c9ae){logger[_0x3603('0x11')]('GetFaxAccount',_0x1d1fd4);logger[_0x3603('0x14')](_0x3603('0x1b'),_0x1d1fd4,JSON[_0x3603('0x16')](_0x12c9ae));_0x4f61c1(_0x12c9ae);})['catch'](function(_0x132858){logger['error'](_0x3603('0x1b'),_0x132858[_0x3603('0x18')],_0x1d1fd4);_0x210901(_0x443c64['error'](0x1f4,_0x132858[_0x3603('0x18')]));});});};exports[_0x3603('0x27')]=function(_0x50115a,_0xfe2cd,_0x1b688a){var _0x4d9376=this;return new Promise(function(_0x1df4d8,_0x4544e9){var _0x5db705={'body':_0x50115a[_0x3603('0x28')],'channel':_0x3603('0x29')};var _0x13a6ae=[];var _0x3b199b=[];var _0x28cbeb={};return db[_0x3603('0x2a')][_0x3603('0x2b')]()[_0x3603('0x26')](function(_0x35b326){if(!_0x35b326){throw new db['Sequelize'][(_0x3603('0x2c'))](_0x3603('0x2d'));}_0x13a6ae=_[_0x3603('0x2e')](_[_0x3603('0x2f')](_0x35b326),[_0x3603('0x30'),_0x3603('0x31')]);_0x3b199b=_[_0x3603('0x2e')](_['keys'](_0x35b326),[_0x3603('0x30'),'updatedAt',_0x3603('0x32'),'ListId']);if(_0x50115a[_0x3603('0x28')]['id']){delete _0x50115a[_0x3603('0x28')]['id'];}if(_[_0x3603('0x33')](_0x50115a[_0x3603('0x28')]['from'])){throw new db[(_0x3603('0x34'))][(_0x3603('0x2c'))]('from\x20is\x20mandatory');}if(_[_0x3603('0x33')](_0x50115a[_0x3603('0x28')]['body'])||_0x50115a[_0x3603('0x28')][_0x3603('0x28')]===''){throw new db[(_0x3603('0x34'))]['ValidationError'](_0x3603('0x35'));}if(_['isNil'](_0x50115a[_0x3603('0x28')][_0x3603('0x36')])){throw new db[(_0x3603('0x34'))][(_0x3603('0x2c'))](_0x3603('0x37')+_0x3b199b);}if(!_[_0x3603('0x38')](_0x3b199b,_0x50115a[_0x3603('0x28')]['mapKey'])){throw new db[(_0x3603('0x34'))][(_0x3603('0x2c'))](_0x3603('0x39')+_0x3b199b);}_0x28cbeb[_0x50115a['body']['mapKey']]=_0x50115a[_0x3603('0x28')][_0x3603('0x3a')];})[_0x3603('0x26')](function(){return db['FaxAccount'][_0x3603('0x3b')]({'where':{'id':_0x50115a[_0x3603('0x3c')]['id']},'include':[{'model':db[_0x3603('0x3d')],'as':_0x3603('0x3e'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x28cbeb,'limit':0x1,'order':[[_0x3603('0x31'),_0x3603('0x3f')]]}]},{'model':db[_0x3603('0x40')],'as':'Applications'}]});})[_0x3603('0x26')](function(_0x2fa9f5){if(_0x2fa9f5&&_0x2fa9f5[_0x3603('0x3e')]){var _0x2cb5bb=_0x2fa9f5[_0x3603('0x41')]({'plain':!![]});_0x5db705[_0x3603('0x3c')]=_0x2cb5bb;_0x5db705[_0x3603('0x42')]=_0x2cb5bb['Applications'];_0x5db705[_0x3603('0x43')]=_0x2cb5bb[_0x3603('0x3e')];_0x5db705[_0x3603('0x42')]=_['orderBy'](_0x5db705['applications'],['priority'],[_0x3603('0x44')]);if(_0x5db705[_0x3603('0x3c')][_0x3603('0x45')]){delete _0x5db705['account'][_0x3603('0x45')];}if(_0x5db705[_0x3603('0x3c')][_0x3603('0x3e')]&&_0x5db705[_0x3603('0x3c')][_0x3603('0x3e')]['Contacts'][_0x3603('0x46')]){return _0x5db705['account']['List'][_0x3603('0x47')][0x0];}var _0x5de55c=_[_0x3603('0xb')](_0x50115a[_0x3603('0x28')],{'firstName':_0x50115a[_0x3603('0x28')][_0x3603('0x3a')],'ListId':_0x2cb5bb[_0x3603('0x48')]});_0x5de55c[_0x50115a[_0x3603('0x28')][_0x3603('0x36')]]=_0x50115a[_0x3603('0x28')]['from'];return db['CmContact'][_0x3603('0x49')](_0x5de55c,{'fields':_0x13a6ae,'raw':!![]});}})[_0x3603('0x26')](function(_0xfe62){_0x5db705['contact']=_0xfe62;if(_0xfe62){var _0x5f3d87={'ContactId':_0xfe62['id'],'FaxAccountId':_0x50115a[_0x3603('0x3c')]['id'],'fax':_0xfe62['fax']};return db[_0x3603('0x4a')][_0x3603('0x3b')]({'where':{'ContactId':_0xfe62['id'],'closed':![],'FaxAccountId':_0x50115a[_0x3603('0x3c')]['id']}})[_0x3603('0x26')](function(_0x13fbf5){if(_0x13fbf5){return[_0x13fbf5,![]];}return db[_0x3603('0x4a')][_0x3603('0x49')](_0x5f3d87)[_0x3603('0x26')](function(_0xbe5585){return[_0xbe5585,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5aa5b3,_0x19023b){var _0x502f4b=_0x5aa5b3[_0x3603('0x41')]({'plain':!![]});if(_0x19023b){if(_0x5db705[_0x3603('0x3c')][_0x3603('0x4b')]){_0x5db705['applications']['push']({'id':0x0,'priority':_0x5db705[_0x3603('0x42')][_0x3603('0x46')]+0x1,'app':'close','appdata':_0x3603('0x4c'),'interval':_0x3603('0x4d')});}_0x502f4b[_0x3603('0x4e')]=!![];}else{_0x502f4b[_0x3603('0x4e')]=![];}_0x5db705[_0x3603('0x4f')]=_0x502f4b;return db['FaxMessage'][_0x3603('0x49')]({'body':_0x50115a['body']['body'],'FaxAccountId':_0x50115a['account']['id'],'FaxInteractionId':_0x5aa5b3['id'],'direction':'in','ContactId':_0x5aa5b3[_0x3603('0x50')],'AttachmentId':_0x50115a[_0x3603('0x28')][_0x3603('0x51')]});})['then'](function(_0x5e0f8d){_0x5db705[_0x3603('0x18')]=_0x5e0f8d;if(_0x5db705[_0x3603('0x4f')][_0x3603('0x52')]){return db['User'][_0x3603('0x3b')]({'attributes':['id','name'],'where':{'id':_0x5db705[_0x3603('0x4f')][_0x3603('0x52')]}})[_0x3603('0x26')](function(_0x42c214){if(_0x42c214){_0x5db705[_0x3603('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3603('0x53'),'appdata':_0x42c214[_0x3603('0x54')]+','+(_0x5db705[_0x3603('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0x3603('0x4d')});}return respondWithRpcPromise(_0x3603('0x55'),_0x3603('0x56'),_0x5db705);});}return respondWithRpcPromise(_0x3603('0x55'),'startRouting',_0x5db705);})[_0x3603('0x26')](function(_0x350338){_0x1df4d8(_0x350338);})[_0x3603('0x1a')](function(_0x46ea00){_0x4544e9(_0x4d9376[_0x3603('0x17')](0x1f4,_0x46ea00['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index dc7a57a..9da26ed 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 _0xe76d=['faxAccount:','save','remove','update','emit','removeListener','length'];(function(_0xa8e763,_0x585f1d){var _0x6daccb=function(_0x24c1de){while(--_0x24c1de){_0xa8e763['push'](_0xa8e763['shift']());}};_0x6daccb(++_0x585f1d);}(_0xe76d,0xb7));var _0xde76=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe76d[_0xc4001c];return _0x49f7bc;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xde76('0x0'),_0xde76('0x1'),_0xde76('0x2')];function createListener(_0x1b23ec,_0x49d755){return function(_0x159770){_0x49d755[_0xde76('0x3')](_0x1b23ec,_0x159770);};}function removeListener(_0x1f6d62,_0x314967){return function(){FaxAccountEvents[_0xde76('0x4')](_0x1f6d62,_0x314967);};}exports['register']=function(_0x840e83){for(var _0x479cac=0x0,_0x268f63=events[_0xde76('0x5')];_0x479cac<_0x268f63;_0x479cac++){var _0x3dc487=events[_0x479cac];var _0x187a33=createListener(_0xde76('0x6')+_0x3dc487,_0x840e83);FaxAccountEvents['on'](_0x3dc487,_0x187a33);}}; \ No newline at end of file +var _0x7dcc=['emit','removeListener','register','./faxAccount.events','save','update'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x7dcc,0xed));var _0xc7dc=function(_0xf8e45b,_0x336e08){_0xf8e45b=_0xf8e45b-0x0;var _0xb38c41=_0x7dcc[_0xf8e45b];return _0xb38c41;};'use strict';var FaxAccountEvents=require(_0xc7dc('0x0'));var events=[_0xc7dc('0x1'),'remove',_0xc7dc('0x2')];function createListener(_0xf978cd,_0xbdf6ed){return function(_0x1e37ca){_0xbdf6ed[_0xc7dc('0x3')](_0xf978cd,_0x1e37ca);};}function removeListener(_0x57c746,_0x5ca867){return function(){FaxAccountEvents[_0xc7dc('0x4')](_0x57c746,_0x5ca867);};}exports[_0xc7dc('0x5')]=function(_0x567e29){for(var _0x21e2fc=0x0,_0x20a87f=events['length'];_0x21e2fc<_0x20a87f;_0x21e2fc++){var _0x4d6c52=events[_0x21e2fc];var _0x3b7370=createListener('faxAccount:'+_0x4d6c52,_0x567e29);FaxAccountEvents['on'](_0x4d6c52,_0x3b7370);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2cef9b8..26f5c65 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(_0x1eadbe,_0x4621f9){var _0x68f6c5=function(_0xac8038){while(--_0xac8038){_0x1eadbe['push'](_0x1eadbe['shift']());}};_0x68f6c5(++_0x4621f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x1f04dd,_0x2c8e56){var _0x39a9ad=function(_0xaed644){while(--_0xaed644){_0x1f04dd['push'](_0x1f04dd['shift']());}};_0x39a9ad(++_0x2c8e56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 9901c59..dc5fbe2 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 _0xf702=['STRING','noop','TEXT','*,*,*,*','INTEGER'];(function(_0x3c82db,_0x323aa5){var _0x2581a1=function(_0xb87575){while(--_0xb87575){_0x3c82db['push'](_0x3c82db['shift']());}};_0x2581a1(++_0x323aa5);}(_0xf702,0xc7));var _0x2f70=function(_0x24ad64,_0x5bc7e2){_0x24ad64=_0x24ad64-0x0;var _0x16e0f6=_0xf702[_0x24ad64];return _0x16e0f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2f70('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2f70('0x1')],'allowNull':![],'defaultValue':_0x2f70('0x2')},'appdata':{'type':Sequelize[_0x2f70('0x3')]()},'description':{'type':Sequelize[_0x2f70('0x1')]},'interval':{'type':Sequelize[_0x2f70('0x1')],'defaultValue':_0x2f70('0x4')}}; \ No newline at end of file +var _0x047d=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x352a01,_0x34fab1){var _0x113e18=function(_0x2126fa){while(--_0x2126fa){_0x352a01['push'](_0x352a01['shift']());}};_0x113e18(++_0x34fab1);}(_0x047d,0x150));var _0xd047=function(_0x3caa1d,_0x598d08){_0x3caa1d=_0x3caa1d-0x0;var _0x1194e6=_0x047d[_0x3caa1d];return _0x1194e6;};'use strict';var Sequelize=require(_0xd047('0x0'));module[_0xd047('0x1')]={'priority':{'type':Sequelize[_0xd047('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd047('0x3')],'allowNull':![],'defaultValue':_0xd047('0x4')},'appdata':{'type':Sequelize[_0xd047('0x5')]()},'description':{'type':Sequelize[_0xd047('0x3')]},'interval':{'type':Sequelize[_0xd047('0x3')],'defaultValue':_0xd047('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 629a22d..e90e994 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 _0xbca0=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x398299,_0x1efd0f){var _0x167a17=function(_0x5c09c9){while(--_0x5c09c9){_0x398299['push'](_0x398299['shift']());}};_0x167a17(++_0x1efd0f);}(_0xbca0,0x81));var _0x0bca=function(_0x1c7d2d,_0x4159c7){_0x1c7d2d=_0x1c7d2d-0x0;var _0x35c991=_0xbca0[_0x1c7d2d];return _0x35c991;};'use strict';var emlformat=require(_0x0bca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bca('0x1'));var jsonpatch=require(_0x0bca('0x2'));var rp=require(_0x0bca('0x3'));var moment=require('moment');var BPromise=require(_0x0bca('0x4'));var Mustache=require(_0x0bca('0x5'));var util=require(_0x0bca('0x6'));var path=require(_0x0bca('0x7'));var sox=require('sox');var csv=require(_0x0bca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bca('0x9'));var _=require(_0x0bca('0xa'));var squel=require('squel');var crypto=require(_0x0bca('0xb'));var jsforce=require(_0x0bca('0xc'));var deskjs=require(_0x0bca('0xd'));var toCsv=require(_0x0bca('0x8'));var querystring=require('querystring');var Papa=require(_0x0bca('0xe'));var Redis=require(_0x0bca('0xf'));var authService=require(_0x0bca('0x10'));var qs=require(_0x0bca('0x11'));var as=require(_0x0bca('0x12'));var hardwareService=require(_0x0bca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0bca('0x14'));var config=require(_0x0bca('0x15'));var licenseUtil=require(_0x0bca('0x16'));var db=require(_0x0bca('0x17'))['db'];function respondWithStatusCode(_0x36a962,_0x201124){_0x201124=_0x201124||0xcc;return function(_0x4b1712){if(_0x4b1712){return _0x36a962[_0x0bca('0x18')](_0x201124);}return _0x36a962['status'](_0x201124)[_0x0bca('0x19')]();};}function respondWithResult(_0x37304c,_0x3fd981){_0x3fd981=_0x3fd981||0xc8;return function(_0x45ed7a){if(_0x45ed7a){return _0x37304c[_0x0bca('0x1a')](_0x3fd981)[_0x0bca('0x1b')](_0x45ed7a);}};}function respondWithFilteredResult(_0x1334ba,_0x2936a2){return function(_0xc7a670){if(_0xc7a670){var _0x4b8be3=typeof _0x2936a2['offset']==='undefined'&&typeof _0x2936a2[_0x0bca('0x1c')]==='undefined';var _0x4be7a9=_0xc7a670[_0x0bca('0x1d')];var _0xc20491=_0x4b8be3?0x0:_0x2936a2[_0x0bca('0x1e')];var _0x281542=_0x4b8be3?_0xc7a670['count']:_0x2936a2['offset']+_0x2936a2[_0x0bca('0x1c')];var _0x34207c;if(_0x281542>=_0x4be7a9){_0x281542=_0x4be7a9;_0x34207c=0xc8;}else{_0x34207c=0xce;}_0x1334ba[_0x0bca('0x1a')](_0x34207c);return _0x1334ba[_0x0bca('0x1f')](_0x0bca('0x20'),_0xc20491+'-'+_0x281542+'/'+_0x4be7a9)[_0x0bca('0x1b')](_0xc7a670);}return null;};}function patchUpdates(_0xf8a7bf){return function(_0xe1fb88){try{jsonpatch[_0x0bca('0x21')](_0xe1fb88,_0xf8a7bf,!![]);}catch(_0x2d0007){return BPromise[_0x0bca('0x22')](_0x2d0007);}return _0xe1fb88[_0x0bca('0x23')]();};}function saveUpdates(_0x3c1575,_0x3e4b88){return function(_0x28cdab){if(_0x28cdab){return _0x28cdab['update'](_0x3c1575)[_0x0bca('0x24')](function(_0x32b69c){return _0x32b69c;});}return null;};}function removeEntity(_0x2aed5c,_0x2323f5){return function(_0x17f47b){if(_0x17f47b){return _0x17f47b[_0x0bca('0x25')]()['then'](function(){_0x2aed5c[_0x0bca('0x1a')](0xcc)[_0x0bca('0x19')]();});}};}function handleEntityNotFound(_0x4fbcbc,_0x3a1853){return function(_0x51f67a){if(!_0x51f67a){_0x4fbcbc[_0x0bca('0x18')](0x194);}return _0x51f67a;};}function handleError(_0x123479,_0x337674){_0x337674=_0x337674||0x1f4;return function(_0x55b128){logger['error'](_0x55b128['stack']);if(_0x55b128[_0x0bca('0x26')]){delete _0x55b128[_0x0bca('0x26')];}_0x123479[_0x0bca('0x1a')](_0x337674)[_0x0bca('0x27')](_0x55b128);};}exports[_0x0bca('0x28')]=function(_0x1c3cfd,_0x5a5ecd){var _0xffebf1={},_0x4ad782={},_0x2bf49a={'count':0x0,'rows':[]};var _0x2fbff0=_['map'](db[_0x0bca('0x29')][_0x0bca('0x2a')],function(_0x8e7027){return{'name':_0x8e7027[_0x0bca('0x2b')],'type':_0x8e7027[_0x0bca('0x2c')][_0x0bca('0x2d')]};});_0x4ad782[_0x0bca('0x2e')]=_[_0x0bca('0x2f')](_0x2fbff0,_0x0bca('0x26'));_0x4ad782[_0x0bca('0x30')]=_[_0x0bca('0x31')](_0x1c3cfd[_0x0bca('0x30')]);_0x4ad782['filters']=_[_0x0bca('0x32')](_0x4ad782[_0x0bca('0x2e')],_0x4ad782[_0x0bca('0x30')]);_0xffebf1['attributes']=_[_0x0bca('0x32')](_0x4ad782[_0x0bca('0x2e')],qs['fields'](_0x1c3cfd[_0x0bca('0x30')][_0x0bca('0x33')]));_0xffebf1[_0x0bca('0x34')]=_0xffebf1[_0x0bca('0x34')]['length']?_0xffebf1[_0x0bca('0x34')]:_0x4ad782[_0x0bca('0x2e')];if(!_0x1c3cfd[_0x0bca('0x30')][_0x0bca('0x35')](_0x0bca('0x36'))){_0xffebf1[_0x0bca('0x1c')]=qs['limit'](_0x1c3cfd[_0x0bca('0x30')][_0x0bca('0x1c')]);_0xffebf1[_0x0bca('0x1e')]=qs[_0x0bca('0x1e')](_0x1c3cfd['query'][_0x0bca('0x1e')]);}_0xffebf1[_0x0bca('0x37')]=qs[_0x0bca('0x38')](_0x1c3cfd['query'][_0x0bca('0x38')]);_0xffebf1[_0x0bca('0x39')]=qs[_0x0bca('0x3a')](_['pick'](_0x1c3cfd[_0x0bca('0x30')],_0x4ad782[_0x0bca('0x3a')]),_0x2fbff0);if(_0x1c3cfd[_0x0bca('0x30')][_0x0bca('0x3b')]){_0xffebf1[_0x0bca('0x39')]=_[_0x0bca('0x3c')](_0xffebf1[_0x0bca('0x39')],{'$or':_[_0x0bca('0x2f')](_0x2fbff0,function(_0x320a07){if(_0x320a07[_0x0bca('0x2c')]!==_0x0bca('0x3d')){var _0xc11493={};_0xc11493[_0x320a07[_0x0bca('0x26')]]={'$like':'%'+_0x1c3cfd[_0x0bca('0x30')]['filter']+'%'};return _0xc11493;}})});}_0xffebf1=_[_0x0bca('0x3c')]({},_0xffebf1,_0x1c3cfd[_0x0bca('0x3e')]);var _0x4a5e3e={'where':_0xffebf1[_0x0bca('0x39')]};return db[_0x0bca('0x29')][_0x0bca('0x1d')](_0x4a5e3e)[_0x0bca('0x24')](function(_0x5c6270){_0x2bf49a['count']=_0x5c6270;if(_0x1c3cfd[_0x0bca('0x30')][_0x0bca('0x3f')]){_0xffebf1['include']=[{'all':!![]}];}return db[_0x0bca('0x29')][_0x0bca('0x40')](_0xffebf1);})[_0x0bca('0x24')](function(_0x503022){_0x2bf49a[_0x0bca('0x41')]=_0x503022;return _0x2bf49a;})[_0x0bca('0x24')](respondWithFilteredResult(_0x5a5ecd,_0xffebf1))[_0x0bca('0x42')](handleError(_0x5a5ecd,null));};exports[_0x0bca('0x43')]=function(_0x487dcd,_0x21192c){var _0x3cbc90={'raw':!![],'where':{'id':_0x487dcd[_0x0bca('0x44')]['id']}},_0x1e15dd={};_0x1e15dd[_0x0bca('0x2e')]=_[_0x0bca('0x31')](db[_0x0bca('0x29')][_0x0bca('0x2a')]);_0x1e15dd[_0x0bca('0x30')]=_[_0x0bca('0x31')](_0x487dcd['query']);_0x1e15dd['filters']=_[_0x0bca('0x32')](_0x1e15dd[_0x0bca('0x2e')],_0x1e15dd[_0x0bca('0x30')]);_0x3cbc90[_0x0bca('0x34')]=_[_0x0bca('0x32')](_0x1e15dd[_0x0bca('0x2e')],qs['fields'](_0x487dcd[_0x0bca('0x30')][_0x0bca('0x33')]));_0x3cbc90[_0x0bca('0x34')]=_0x3cbc90[_0x0bca('0x34')][_0x0bca('0x45')]?_0x3cbc90[_0x0bca('0x34')]:_0x1e15dd[_0x0bca('0x2e')];if(_0x487dcd[_0x0bca('0x30')][_0x0bca('0x3f')]){_0x3cbc90[_0x0bca('0x46')]=[{'all':!![]}];}_0x3cbc90=_[_0x0bca('0x3c')]({},_0x3cbc90,_0x487dcd[_0x0bca('0x3e')]);return db[_0x0bca('0x29')][_0x0bca('0x47')](_0x3cbc90)[_0x0bca('0x24')](handleEntityNotFound(_0x21192c,null))[_0x0bca('0x24')](respondWithResult(_0x21192c,null))['catch'](handleError(_0x21192c,null));};exports['create']=function(_0x4b06fd,_0x15f945){return db['FaxApplication'][_0x0bca('0x48')](_0x4b06fd[_0x0bca('0x49')],{})[_0x0bca('0x24')](respondWithResult(_0x15f945,0xc9))[_0x0bca('0x42')](handleError(_0x15f945,null));};exports['update']=function(_0x3ee25f,_0x2ddb18){if(_0x3ee25f[_0x0bca('0x49')]['id']){delete _0x3ee25f['body']['id'];}return db[_0x0bca('0x29')][_0x0bca('0x47')]({'where':{'id':_0x3ee25f[_0x0bca('0x44')]['id']}})[_0x0bca('0x24')](handleEntityNotFound(_0x2ddb18,null))[_0x0bca('0x24')](saveUpdates(_0x3ee25f[_0x0bca('0x49')],null))[_0x0bca('0x24')](respondWithResult(_0x2ddb18,null))['catch'](handleError(_0x2ddb18,null));};exports[_0x0bca('0x25')]=function(_0x570260,_0x1febcb){return db['FaxApplication'][_0x0bca('0x47')]({'where':{'id':_0x570260['params']['id']}})[_0x0bca('0x24')](handleEntityNotFound(_0x1febcb,null))[_0x0bca('0x24')](removeEntity(_0x1febcb,null))[_0x0bca('0x42')](handleError(_0x1febcb,null));}; \ No newline at end of file +var _0x3827=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','where','pick','merge','filter','includeAll','findAll','rows','show','params','fields','catch','create','update','body','find','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','papaparse','ioredis'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x3827,0x1d4));var _0x7382=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3827[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7382('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7382('0x1'));var jsonpatch=require(_0x7382('0x2'));var rp=require('request-promise');var moment=require(_0x7382('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7382('0x4'));var util=require(_0x7382('0x5'));var path=require(_0x7382('0x6'));var sox=require(_0x7382('0x7'));var csv=require('to-csv');var ejs=require(_0x7382('0x8'));var fs=require('fs');var fs_extra=require(_0x7382('0x9'));var _=require('lodash');var squel=require(_0x7382('0xa'));var crypto=require('crypto');var jsforce=require(_0x7382('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7382('0xc'));var querystring=require('querystring');var Papa=require(_0x7382('0xd'));var Redis=require(_0x7382('0xe'));var authService=require(_0x7382('0xf'));var qs=require(_0x7382('0x10'));var as=require(_0x7382('0x11'));var hardwareService=require(_0x7382('0x12'));var logger=require(_0x7382('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7382('0x14'));var db=require(_0x7382('0x15'))['db'];function respondWithStatusCode(_0x442c69,_0x586071){_0x586071=_0x586071||0xcc;return function(_0x1600bb){if(_0x1600bb){return _0x442c69[_0x7382('0x16')](_0x586071);}return _0x442c69[_0x7382('0x17')](_0x586071)[_0x7382('0x18')]();};}function respondWithResult(_0x51848d,_0x47da98){_0x47da98=_0x47da98||0xc8;return function(_0x3d477f){if(_0x3d477f){return _0x51848d[_0x7382('0x17')](_0x47da98)[_0x7382('0x19')](_0x3d477f);}};}function respondWithFilteredResult(_0x2c60a4,_0x46dbe4){return function(_0x47a1b3){if(_0x47a1b3){var _0x4349af=typeof _0x46dbe4[_0x7382('0x1a')]===_0x7382('0x1b')&&typeof _0x46dbe4[_0x7382('0x1c')]===_0x7382('0x1b');var _0x3588b1=_0x47a1b3['count'];var _0x38001d=_0x4349af?0x0:_0x46dbe4[_0x7382('0x1a')];var _0xf6a5b1=_0x4349af?_0x47a1b3[_0x7382('0x1d')]:_0x46dbe4[_0x7382('0x1a')]+_0x46dbe4[_0x7382('0x1c')];var _0xa3e8f5;if(_0xf6a5b1>=_0x3588b1){_0xf6a5b1=_0x3588b1;_0xa3e8f5=0xc8;}else{_0xa3e8f5=0xce;}_0x2c60a4[_0x7382('0x17')](_0xa3e8f5);return _0x2c60a4[_0x7382('0x1e')](_0x7382('0x1f'),_0x38001d+'-'+_0xf6a5b1+'/'+_0x3588b1)[_0x7382('0x19')](_0x47a1b3);}return null;};}function patchUpdates(_0x5ee5a5){return function(_0x1dd94f){try{jsonpatch[_0x7382('0x20')](_0x1dd94f,_0x5ee5a5,!![]);}catch(_0x1cb7e0){return BPromise[_0x7382('0x21')](_0x1cb7e0);}return _0x1dd94f[_0x7382('0x22')]();};}function saveUpdates(_0x59eaf1,_0x2f25ee){return function(_0x437a14){if(_0x437a14){return _0x437a14['update'](_0x59eaf1)[_0x7382('0x23')](function(_0x1e99d4){return _0x1e99d4;});}return null;};}function removeEntity(_0x3787ac,_0x35599f){return function(_0xcc29f6){if(_0xcc29f6){return _0xcc29f6[_0x7382('0x24')]()[_0x7382('0x23')](function(){_0x3787ac['status'](0xcc)[_0x7382('0x18')]();});}};}function handleEntityNotFound(_0xfa8c1c,_0x1e975e){return function(_0x18257e){if(!_0x18257e){_0xfa8c1c[_0x7382('0x16')](0x194);}return _0x18257e;};}function handleError(_0x188b3d,_0x2aab74){_0x2aab74=_0x2aab74||0x1f4;return function(_0x1ac892){logger['error'](_0x1ac892[_0x7382('0x25')]);if(_0x1ac892[_0x7382('0x26')]){delete _0x1ac892[_0x7382('0x26')];}_0x188b3d['status'](_0x2aab74)['send'](_0x1ac892);};}exports['index']=function(_0x36413c,_0x1ae349){var _0x368d74={},_0x171af5={},_0x25673d={'count':0x0,'rows':[]};var _0x308b01=_['map'](db[_0x7382('0x27')][_0x7382('0x28')],function(_0x585572){return{'name':_0x585572[_0x7382('0x29')],'type':_0x585572[_0x7382('0x2a')][_0x7382('0x2b')]};});_0x171af5[_0x7382('0x2c')]=_[_0x7382('0x2d')](_0x308b01,'name');_0x171af5[_0x7382('0x2e')]=_[_0x7382('0x2f')](_0x36413c[_0x7382('0x2e')]);_0x171af5[_0x7382('0x30')]=_[_0x7382('0x31')](_0x171af5[_0x7382('0x2c')],_0x171af5[_0x7382('0x2e')]);_0x368d74[_0x7382('0x32')]=_[_0x7382('0x31')](_0x171af5[_0x7382('0x2c')],qs['fields'](_0x36413c[_0x7382('0x2e')]['fields']));_0x368d74[_0x7382('0x32')]=_0x368d74[_0x7382('0x32')][_0x7382('0x33')]?_0x368d74[_0x7382('0x32')]:_0x171af5[_0x7382('0x2c')];if(!_0x36413c[_0x7382('0x2e')]['hasOwnProperty'](_0x7382('0x34'))){_0x368d74['limit']=qs['limit'](_0x36413c[_0x7382('0x2e')][_0x7382('0x1c')]);_0x368d74[_0x7382('0x1a')]=qs[_0x7382('0x1a')](_0x36413c[_0x7382('0x2e')][_0x7382('0x1a')]);}_0x368d74[_0x7382('0x35')]=qs['sort'](_0x36413c[_0x7382('0x2e')]['sort']);_0x368d74[_0x7382('0x36')]=qs['filters'](_[_0x7382('0x37')](_0x36413c[_0x7382('0x2e')],_0x171af5['filters']),_0x308b01);if(_0x36413c[_0x7382('0x2e')]['filter']){_0x368d74[_0x7382('0x36')]=_[_0x7382('0x38')](_0x368d74['where'],{'$or':_[_0x7382('0x2d')](_0x308b01,function(_0x27417e){if(_0x27417e[_0x7382('0x2a')]!=='VIRTUAL'){var _0x6bd55a={};_0x6bd55a[_0x27417e['name']]={'$like':'%'+_0x36413c[_0x7382('0x2e')][_0x7382('0x39')]+'%'};return _0x6bd55a;}})});}_0x368d74=_[_0x7382('0x38')]({},_0x368d74,_0x36413c['options']);var _0x3df1ba={'where':_0x368d74[_0x7382('0x36')]};return db[_0x7382('0x27')]['count'](_0x3df1ba)['then'](function(_0x40b050){_0x25673d[_0x7382('0x1d')]=_0x40b050;if(_0x36413c[_0x7382('0x2e')][_0x7382('0x3a')]){_0x368d74['include']=[{'all':!![]}];}return db[_0x7382('0x27')][_0x7382('0x3b')](_0x368d74);})[_0x7382('0x23')](function(_0x42357f){_0x25673d[_0x7382('0x3c')]=_0x42357f;return _0x25673d;})[_0x7382('0x23')](respondWithFilteredResult(_0x1ae349,_0x368d74))['catch'](handleError(_0x1ae349,null));};exports[_0x7382('0x3d')]=function(_0x24dcf3,_0x303205){var _0xcf758c={'raw':!![],'where':{'id':_0x24dcf3[_0x7382('0x3e')]['id']}},_0x50729c={};_0x50729c[_0x7382('0x2c')]=_[_0x7382('0x2f')](db[_0x7382('0x27')]['rawAttributes']);_0x50729c[_0x7382('0x2e')]=_['keys'](_0x24dcf3[_0x7382('0x2e')]);_0x50729c[_0x7382('0x30')]=_[_0x7382('0x31')](_0x50729c[_0x7382('0x2c')],_0x50729c[_0x7382('0x2e')]);_0xcf758c[_0x7382('0x32')]=_[_0x7382('0x31')](_0x50729c[_0x7382('0x2c')],qs[_0x7382('0x3f')](_0x24dcf3[_0x7382('0x2e')][_0x7382('0x3f')]));_0xcf758c[_0x7382('0x32')]=_0xcf758c[_0x7382('0x32')][_0x7382('0x33')]?_0xcf758c['attributes']:_0x50729c[_0x7382('0x2c')];if(_0x24dcf3[_0x7382('0x2e')][_0x7382('0x3a')]){_0xcf758c['include']=[{'all':!![]}];}_0xcf758c=_['merge']({},_0xcf758c,_0x24dcf3['options']);return db[_0x7382('0x27')]['find'](_0xcf758c)['then'](handleEntityNotFound(_0x303205,null))['then'](respondWithResult(_0x303205,null))[_0x7382('0x40')](handleError(_0x303205,null));};exports[_0x7382('0x41')]=function(_0xc14314,_0x38539b){return db[_0x7382('0x27')][_0x7382('0x41')](_0xc14314['body'],{})[_0x7382('0x23')](respondWithResult(_0x38539b,0xc9))[_0x7382('0x40')](handleError(_0x38539b,null));};exports[_0x7382('0x42')]=function(_0x41effc,_0x3b6cbd){if(_0x41effc[_0x7382('0x43')]['id']){delete _0x41effc[_0x7382('0x43')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x41effc['params']['id']}})[_0x7382('0x23')](handleEntityNotFound(_0x3b6cbd,null))[_0x7382('0x23')](saveUpdates(_0x41effc[_0x7382('0x43')],null))[_0x7382('0x23')](respondWithResult(_0x3b6cbd,null))['catch'](handleError(_0x3b6cbd,null));};exports[_0x7382('0x24')]=function(_0x3a341c,_0x5ec82a){return db['FaxApplication'][_0x7382('0x44')]({'where':{'id':_0x3a341c['params']['id']}})['then'](handleEntityNotFound(_0x5ec82a,null))[_0x7382('0x23')](removeEntity(_0x5ec82a,null))['catch'](handleError(_0x5ec82a,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9460823..5359a7f 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 _0xdf89=['bluebird','request-promise','path','rimraf','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf89,0x64));var _0x9df8=function(_0x191fd2,_0x558a6d){_0x191fd2=_0x191fd2-0x0;var _0x2d115f=_0xdf89[_0x191fd2];return _0x2d115f;};'use strict';var _=require(_0x9df8('0x0'));var util=require(_0x9df8('0x1'));var logger=require(_0x9df8('0x2'))(_0x9df8('0x3'));var moment=require('moment');var BPromise=require(_0x9df8('0x4'));var rp=require(_0x9df8('0x5'));var fs=require('fs');var path=require(_0x9df8('0x6'));var rimraf=require(_0x9df8('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x9df8('0x8')]=function(_0x1cf950,_0x2d7793){return _0x1cf950[_0x9df8('0x9')](_0x9df8('0xa'),attributes,{'tableName':_0x9df8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9df8('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7cc3=['./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d37fc,_0x4db492){var _0x652aa6=function(_0x34f767){while(--_0x34f767){_0x1d37fc['push'](_0x1d37fc['shift']());}};_0x652aa6(++_0x4db492);}(_0x7cc3,0x1a7));var _0x37cc=function(_0x377a55,_0x1d314e){_0x377a55=_0x377a55-0x0;var _0x193b4c=_0x7cc3[_0x377a55];return _0x193b4c;};'use strict';var _=require(_0x37cc('0x0'));var util=require(_0x37cc('0x1'));var logger=require(_0x37cc('0x2'))('api');var moment=require(_0x37cc('0x3'));var BPromise=require(_0x37cc('0x4'));var rp=require(_0x37cc('0x5'));var fs=require('fs');var path=require(_0x37cc('0x6'));var rimraf=require(_0x37cc('0x7'));var config=require(_0x37cc('0x8'));var attributes=require(_0x37cc('0x9'));module[_0x37cc('0xa')]=function(_0x110f60,_0x3af9e7){return _0x110f60[_0x37cc('0xb')](_0x37cc('0xc'),attributes,{'tableName':_0x37cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x37cc('0xe'),'collate':_0x37cc('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 83ec9d0..9a2382e 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 _0x46c3=['UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x46c3,0x13e));var _0x346c=function(_0x3058c0,_0x185229){_0x3058c0=_0x3058c0-0x0;var _0x5a75eb=_0x46c3[_0x3058c0];return _0x5a75eb;};'use strict';var _=require(_0x346c('0x0'));var util=require(_0x346c('0x1'));var moment=require('moment');var BPromise=require(_0x346c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x346c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x346c('0x4'));var logger=require(_0x346c('0x5'))(_0x346c('0x6'));var config=require(_0x346c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x346c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x529f3d,_0x5de1fd,_0x4e84ad){return new BPromise(function(_0x2dbd49,_0x337349){return client['request'](_0x529f3d,_0x4e84ad)[_0x346c('0x9')](function(_0x38c2d2){logger['info'](_0x346c('0xa'),_0x5de1fd,_0x346c('0xb'));logger[_0x346c('0xc')](_0x346c('0xd'),_0x5de1fd,'request\x20sent',JSON[_0x346c('0xe')](_0x38c2d2));if(_0x38c2d2[_0x346c('0xf')]){if(_0x38c2d2['error']['code']===0x1f4){logger[_0x346c('0xf')](_0x346c('0xa'),_0x5de1fd,_0x38c2d2[_0x346c('0xf')][_0x346c('0x10')]);return _0x337349(_0x38c2d2[_0x346c('0xf')]['message']);}logger[_0x346c('0xf')](_0x346c('0xa'),_0x5de1fd,_0x38c2d2['error']['message']);return _0x2dbd49(_0x38c2d2[_0x346c('0xf')][_0x346c('0x10')]);}else{logger[_0x346c('0x11')](_0x346c('0xa'),_0x5de1fd,'request\x20sent');_0x2dbd49(_0x38c2d2['result'][_0x346c('0x10')]);}})['catch'](function(_0x57da26){logger[_0x346c('0xf')](_0x346c('0xa'),_0x5de1fd,_0x57da26);_0x337349(_0x57da26);});});}exports[_0x346c('0x12')]=function(_0x1cbe54){var _0x27f7a5=this;return new Promise(function(_0x28adce,_0x538c37){return db[_0x346c('0x13')][_0x346c('0x14')](_0x1cbe54[_0x346c('0x15')],{'raw':_0x1cbe54[_0x346c('0x16')]?_0x1cbe54[_0x346c('0x16')][_0x346c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbe54[_0x346c('0x16')]?_0x1cbe54[_0x346c('0x16')][_0x346c('0x18')]||null:null,'attributes':_0x1cbe54[_0x346c('0x16')]?_0x1cbe54[_0x346c('0x16')][_0x346c('0x19')]||null:null,'limit':_0x1cbe54[_0x346c('0x16')]?_0x1cbe54[_0x346c('0x16')][_0x346c('0x1a')]||null:null})[_0x346c('0x9')](function(_0xc418cb){logger[_0x346c('0x11')](_0x346c('0x12'),_0x1cbe54);logger[_0x346c('0xc')](_0x346c('0x12'),_0x1cbe54,JSON[_0x346c('0xe')](_0xc418cb));_0x28adce(_0xc418cb);})[_0x346c('0x1b')](function(_0x36a3f4){logger[_0x346c('0xf')]('UpdateFaxApplication',_0x36a3f4[_0x346c('0x10')],_0x1cbe54);_0x538c37(_0x27f7a5[_0x346c('0xf')](0x1f4,_0x36a3f4[_0x346c('0x10')]));});});}; \ No newline at end of file +var _0xa81a=['code','message','result','catch','UpdateFaxApplication','update','body','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x478c3a,_0x3a8b46){var _0x1e997e=function(_0x1e281e){while(--_0x1e281e){_0x478c3a['push'](_0x478c3a['shift']());}};_0x1e997e(++_0x3a8b46);}(_0xa81a,0xbf));var _0xaa81=function(_0xc25ac6,_0x3e406b){_0xc25ac6=_0xc25ac6-0x0;var _0xa2ffa2=_0xa81a[_0xc25ac6];return _0xa2ffa2;};'use strict';var _=require(_0xaa81('0x0'));var util=require(_0xaa81('0x1'));var moment=require('moment');var BPromise=require(_0xaa81('0x2'));var rs=require(_0xaa81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaa81('0x4'))(_0xaa81('0x5'));var config=require(_0xaa81('0x6'));var jayson=require(_0xaa81('0x7'));var client=jayson[_0xaa81('0x8')][_0xaa81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43b968,_0x4afb80,_0x4b18f5){return new BPromise(function(_0x3ce411,_0x5d261f){return client[_0xaa81('0xa')](_0x43b968,_0x4b18f5)[_0xaa81('0xb')](function(_0x1a8750){logger[_0xaa81('0xc')](_0xaa81('0xd'),_0x4afb80,_0xaa81('0xe'));logger[_0xaa81('0xf')](_0xaa81('0x10'),_0x4afb80,_0xaa81('0xe'),JSON[_0xaa81('0x11')](_0x1a8750));if(_0x1a8750[_0xaa81('0x12')]){if(_0x1a8750[_0xaa81('0x12')][_0xaa81('0x13')]===0x1f4){logger[_0xaa81('0x12')](_0xaa81('0xd'),_0x4afb80,_0x1a8750[_0xaa81('0x12')][_0xaa81('0x14')]);return _0x5d261f(_0x1a8750[_0xaa81('0x12')][_0xaa81('0x14')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x4afb80,_0x1a8750[_0xaa81('0x12')][_0xaa81('0x14')]);return _0x3ce411(_0x1a8750['error'][_0xaa81('0x14')]);}else{logger[_0xaa81('0xc')](_0xaa81('0xd'),_0x4afb80,_0xaa81('0xe'));_0x3ce411(_0x1a8750[_0xaa81('0x15')][_0xaa81('0x14')]);}})[_0xaa81('0x16')](function(_0x2f6936){logger['error'](_0xaa81('0xd'),_0x4afb80,_0x2f6936);_0x5d261f(_0x2f6936);});});}exports[_0xaa81('0x17')]=function(_0xb50005){var _0x264c8a=this;return new Promise(function(_0x5cd2da,_0x3fb575){return db['FaxApplication'][_0xaa81('0x18')](_0xb50005[_0xaa81('0x19')],{'raw':_0xb50005[_0xaa81('0x1a')]?_0xb50005[_0xaa81('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb50005['options']?_0xb50005[_0xaa81('0x1a')][_0xaa81('0x1b')]||null:null,'attributes':_0xb50005[_0xaa81('0x1a')]?_0xb50005['options'][_0xaa81('0x1c')]||null:null,'limit':_0xb50005[_0xaa81('0x1a')]?_0xb50005[_0xaa81('0x1a')][_0xaa81('0x1d')]||null:null})[_0xaa81('0xb')](function(_0x298e55){logger[_0xaa81('0xc')](_0xaa81('0x17'),_0xb50005);logger[_0xaa81('0xf')](_0xaa81('0x17'),_0xb50005,JSON[_0xaa81('0x11')](_0x298e55));_0x5cd2da(_0x298e55);})[_0xaa81('0x16')](function(_0x52cb2d){logger[_0xaa81('0x12')](_0xaa81('0x17'),_0x52cb2d[_0xaa81('0x14')],_0xb50005);_0x3fb575(_0x264c8a[_0xaa81('0x12')](0x1f4,_0x52cb2d[_0xaa81('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 975fe62..6974cc5 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 _0x1775=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6604ba,_0x2a8142){var _0x39fb08=function(_0x3b2cfa){while(--_0x3b2cfa){_0x6604ba['push'](_0x6604ba['shift']());}};_0x39fb08(++_0x2a8142);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xf')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0x11')](_0x5177('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5177('0x12')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router; \ No newline at end of file +var _0x96cc=['isAuthenticated','/:id','show','post','create','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x96cc,0x16c));var _0xc96c=function(_0x4e79ea,_0x2852cd){_0x4e79ea=_0x4e79ea-0x0;var _0x13ef80=_0x96cc[_0x4e79ea];return _0x13ef80;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0xd')]('/',auth[_0xc96c('0xa')](),controller[_0xc96c('0xe')]);router['put'](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xf')]);router['delete'](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f3cf811..3fb5e72 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 _0x25d3=['out','sequelize','BOOLEAN','STRING'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x25d3,0xc5));var _0x325d=function(_0x5ea99a,_0x6e7b48){_0x5ea99a=_0x5ea99a-0x0;var _0x4cf23a=_0x25d3[_0x5ea99a];return _0x4cf23a;};'use strict';var Sequelize=require(_0x325d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x325d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x325d('0x2')]},'secondDisposition':{'type':Sequelize[_0x325d('0x2')]},'thirdDisposition':{'type':Sequelize[_0x325d('0x2')]},'note':{'type':Sequelize[_0x325d('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x325d('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x325d('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x325d('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x2c67=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x467e8f,_0x1bd8d2){var _0x8fb935=function(_0x5b3d8d){while(--_0x5b3d8d){_0x467e8f['push'](_0x467e8f['shift']());}};_0x8fb935(++_0x1bd8d2);}(_0x2c67,0x13a));var _0x72c6=function(_0x2b998f,_0x2eff59){_0x2b998f=_0x2b998f-0x0;var _0x37cc22=_0x2c67[_0x2b998f];return _0x37cc22;};'use strict';var Sequelize=require(_0x72c6('0x0'));module[_0x72c6('0x1')]={'closed':{'type':Sequelize[_0x72c6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x72c6('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x72c6('0x4')]},'note':{'type':Sequelize[_0x72c6('0x4')]},'read1stAt':{'type':Sequelize[_0x72c6('0x3')]},'fax':{'type':Sequelize[_0x72c6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x72c6('0x5')]('in',_0x72c6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x72c6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x72c6('0x5')]('in',_0x72c6('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f3738c4..3e680cd 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 _0x59ec=['value','having','`\x20>\x200','Contact','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','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','isEmpty','concat','createdAt','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','merge','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','includeAll','include','options','describe','addMessage','FaxMessage','ids','findOne','$gte','findAll','rows','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','pipe','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','FaxInteraction','rawAttributes','fieldName','type','key','keys','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages'];(function(_0x1e0995,_0x19e3db){var _0x463f20=function(_0xd573bb){while(--_0xd573bb){_0x1e0995['push'](_0x1e0995['shift']());}};_0x463f20(++_0x19e3db);}(_0x59ec,0x71));var _0xc59e=function(_0x1a0574,_0x35f1a1){_0x1a0574=_0x1a0574-0x0;var _0xee3e9f=_0x59ec[_0x1a0574];return _0xee3e9f;};'use strict';var emlformat=require(_0xc59e('0x0'));var rimraf=require(_0xc59e('0x1'));var zipdir=require(_0xc59e('0x2'));var jsonpatch=require(_0xc59e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc59e('0x4'));var path=require('path');var sox=require(_0xc59e('0x5'));var csv=require(_0xc59e('0x6'));var ejs=require(_0xc59e('0x7'));var fs=require('fs');var fs_extra=require(_0xc59e('0x8'));var _=require(_0xc59e('0x9'));var squel=require('squel');var crypto=require(_0xc59e('0xa'));var jsforce=require(_0xc59e('0xb'));var deskjs=require(_0xc59e('0xc'));var toCsv=require(_0xc59e('0x6'));var querystring=require('querystring');var Papa=require(_0xc59e('0xd'));var Redis=require(_0xc59e('0xe'));var authService=require(_0xc59e('0xf'));var qs=require(_0xc59e('0x10'));var as=require(_0xc59e('0x11'));var hardwareService=require(_0xc59e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc59e('0x13'));var config=require(_0xc59e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc59e('0x15')]=_['defaults'](config[_0xc59e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc59e('0x16'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xc59e('0x17')](socket);function respondWithStatusCode(_0x30781e,_0x275a21){_0x275a21=_0x275a21||0xcc;return function(_0x3059e8){if(_0x3059e8){return _0x30781e[_0xc59e('0x18')](_0x275a21);}return _0x30781e[_0xc59e('0x19')](_0x275a21)[_0xc59e('0x1a')]();};}function respondWithResult(_0x39306a,_0x1092ca){_0x1092ca=_0x1092ca||0xc8;return function(_0x19d8c4){if(_0x19d8c4){return _0x39306a['status'](_0x1092ca)['json'](_0x19d8c4);}};}function respondWithFilteredResult(_0x22a6ee,_0x502c98){return function(_0x548a96){if(_0x548a96){var _0x233b7d=typeof _0x502c98['offset']===_0xc59e('0x1b')&&typeof _0x502c98[_0xc59e('0x1c')]==='undefined';var _0x522443=_0x548a96[_0xc59e('0x1d')];var _0x4b924f=_0x233b7d?0x0:_0x502c98[_0xc59e('0x1e')];var _0x58d0bf=_0x233b7d?_0x548a96[_0xc59e('0x1d')]:_0x502c98[_0xc59e('0x1e')]+_0x502c98[_0xc59e('0x1c')];var _0x3d8091;if(_0x58d0bf>=_0x522443){_0x58d0bf=_0x522443;_0x3d8091=0xc8;}else{_0x3d8091=0xce;}_0x22a6ee['status'](_0x3d8091);return _0x22a6ee[_0xc59e('0x1f')](_0xc59e('0x20'),_0x4b924f+'-'+_0x58d0bf+'/'+_0x522443)[_0xc59e('0x21')](_0x548a96);}return null;};}function patchUpdates(_0x246816){return function(_0x215c11){try{jsonpatch[_0xc59e('0x22')](_0x215c11,_0x246816,!![]);}catch(_0xada1ca){return BPromise[_0xc59e('0x23')](_0xada1ca);}return _0x215c11[_0xc59e('0x24')]();};}function saveUpdates(_0x599f22,_0x216131){return function(_0xc29fdd){if(_0xc29fdd){return _0xc29fdd[_0xc59e('0x25')](_0x599f22)[_0xc59e('0x26')](function(_0x28669a){return _0x28669a;});}return null;};}function removeEntity(_0x42817e,_0x5b3c4c){return function(_0x3fa867){if(_0x3fa867){return _0x3fa867['destroy']()[_0xc59e('0x26')](function(){_0x42817e['status'](0xcc)[_0xc59e('0x1a')]();});}};}function handleEntityNotFound(_0x26e0ed,_0x1624ed){return function(_0x42e22e){if(!_0x42e22e){_0x26e0ed[_0xc59e('0x18')](0x194);}return _0x42e22e;};}function handleError(_0x2e4362,_0x3ca163){_0x3ca163=_0x3ca163||0x1f4;return function(_0x4f2be0){logger[_0xc59e('0x27')](_0x4f2be0[_0xc59e('0x28')]);if(_0x4f2be0[_0xc59e('0x29')]){delete _0x4f2be0[_0xc59e('0x29')];}_0x2e4362[_0xc59e('0x19')](_0x3ca163)[_0xc59e('0x2a')](_0x4f2be0);};}function getInteractionUsers(_0x389b35,_0x3a578b){return new BPromise(function(_0x15a6f0,_0x4a35b9){try{if(_0x3a578b[_0x389b35['id']]){_0x389b35[_0xc59e('0x2b')]=_[_0xc59e('0x2c')](_0x3a578b[_0x389b35['id']],function(_0x5532fe){return{'id':_0x5532fe['id'],'fullname':_0x5532fe['fullname']};});}}catch(_0x2146f3){_0x4a35b9(_0x2146f3);}_0x15a6f0(_0x389b35);});}function getInteractionTags(_0xf432f6,_0x174c29){return new BPromise(function(_0x5d5f7b,_0x5c730b){try{if(_0xf432f6[_0xc59e('0x2d')]){_0xf432f6[_0xc59e('0x2e')]=[];_0xf432f6[_0xc59e('0x2d')][_0xc59e('0x2f')](',')[_0xc59e('0x30')](function(_0x14f98b){_0xf432f6['Tags'][_0xc59e('0x31')](_0x174c29[_0x14f98b]);});}delete _0xf432f6['TagIds'];}catch(_0x1a9900){_0x5c730b(_0x1a9900);}_0x5d5f7b(_0xf432f6);});}function updateFaxInteraction(_0x2146cd,_0x5db0ac,_0x193036){return new BPromise(function(_0x511eb0,_0x26f322){return getInteractionUsers(_0x2146cd,_0x193036)['then'](function(_0x4746ec){return getInteractionTags(_0x4746ec,_0x5db0ac);})[_0xc59e('0x26')](function(_0xe4de06){return getStateInteraction(_0xe4de06);})[_0xc59e('0x26')](function(_0x2e24c5){_0x511eb0(_0x2e24c5);})[_0xc59e('0x32')](function(_0x11e27f){_0x26f322(_0x11e27f);});});}function getStateInteraction(_0x4e6d55){return new BPromise(function(_0x8667f9){_0x4e6d55[_0xc59e('0x33')]=0x0;_0x4e6d55[_0xc59e('0x34')]=0x0;_0x4e6d55[_0xc59e('0x35')]=0x0;_0x4e6d55['unmanaged']=0x0;_0x4e6d55[_0xc59e('0x36')]=0x0;if(!_0x4e6d55[_0xc59e('0x37')]&&!_0x4e6d55['UserId']){_0x4e6d55[_0xc59e('0x33')]+=0x1;}if(!_0x4e6d55['closed']&&_0x4e6d55['UserId']){_0x4e6d55['talking']+=0x1;if(_0x4e6d55['waiting']){_0x4e6d55[_0xc59e('0x33')]-=0x1;}}if(_0x4e6d55['closed']&&_0x4e6d55[_0xc59e('0x38')]){_0x4e6d55[_0xc59e('0x35')]+=0x1;if(_0x4e6d55[_0xc59e('0x34')]){_0x4e6d55[_0xc59e('0x34')]-=0x1;}}if(_0x4e6d55[_0xc59e('0x37')]&&!_0x4e6d55['UserId']){_0x4e6d55[_0xc59e('0x39')]+=0x1;if(_0x4e6d55[_0xc59e('0x33')]){_0x4e6d55[_0xc59e('0x33')]-=0x1;}}_0x4e6d55[_0xc59e('0x36')]+=0x1;_0x8667f9(_0x4e6d55);});}exports[_0xc59e('0x3a')]=function(_0x29b8fa,_0x182eed){var _0x34b86b={},_0x402f63={},_0x73a85e={'count':0x0,'rows':[]};var _0x8055a1=_['map'](db[_0xc59e('0x3b')][_0xc59e('0x3c')],function(_0x4efab1){return{'name':_0x4efab1[_0xc59e('0x3d')],'type':_0x4efab1[_0xc59e('0x3e')][_0xc59e('0x3f')]};});_0x402f63['model']=_['map'](_0x8055a1,'name');_0x402f63['query']=_[_0xc59e('0x40')](_0x29b8fa['query']);_0x402f63[_0xc59e('0x41')]=_['intersection'](_0x402f63[_0xc59e('0x42')],_0x402f63['query']);_0x34b86b[_0xc59e('0x43')]=_[_0xc59e('0x44')](_0x402f63[_0xc59e('0x42')],qs[_0xc59e('0x45')](_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x45')]));_0x34b86b['attributes']=_0x34b86b[_0xc59e('0x43')][_0xc59e('0x47')]?_0x34b86b['attributes']:_0x402f63[_0xc59e('0x42')];if(!_0x29b8fa['query'][_0xc59e('0x48')](_0xc59e('0x49'))){_0x34b86b[_0xc59e('0x1c')]=qs['limit'](_0x29b8fa[_0xc59e('0x46')]['limit']);_0x34b86b['offset']=qs['offset'](_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x1e')]);}_0x34b86b[_0xc59e('0x4a')]=qs[_0xc59e('0x4b')](_0x29b8fa['query'][_0xc59e('0x4b')]);_0x34b86b[_0xc59e('0x4c')]=qs[_0xc59e('0x41')](_[_0xc59e('0x4d')](_0x29b8fa['query'],_0x402f63[_0xc59e('0x41')]),_0x8055a1);var _0x18d1ce=[];var _0x86e640=squel[_0xc59e('0x4e')]()[_0xc59e('0x4f')]('id')[_0xc59e('0x4f')](_0xc59e('0x29'))['field'](_0xc59e('0x50'))['from'](_0xc59e('0x51'));var _0x3ab1a6=squel[_0xc59e('0x4e')]()[_0xc59e('0x4f')](_0xc59e('0x52'))['field'](_0xc59e('0x53'))['field'](_0xc59e('0x54'))[_0xc59e('0x55')](_0xc59e('0x56'),'ui')[_0xc59e('0x57')](_0xc59e('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x519bd4=squel['select']()[_0xc59e('0x55')]('fax_interactions','i')[_0xc59e('0x57')](_0xc59e('0x59'),'c',_0xc59e('0x5a'))[_0xc59e('0x57')]('users','o',_0xc59e('0x5b'))['left_join'](_0xc59e('0x5c'),'a',_0xc59e('0x5d'))[_0xc59e('0x57')](_0xc59e('0x5e'),'me',_0xc59e('0x5f'))['left_join'](_0xc59e('0x60'),'it',_0xc59e('0x61'))[_0xc59e('0x57')](_0xc59e('0x51'),'t','t.id\x20=\x20it.TagId');var _0x2e0e43=squel[_0xc59e('0x62')]();var _0x39ccb4=[];var _0x2609fe=squel[_0xc59e('0x62')]();var _0x3f4055;if(_0x29b8fa['query'][_0xc59e('0x63')]){_0x3f4055=as[_0xc59e('0x64')](_0x29b8fa[_0xc59e('0x46')]['search']);var _0x4bd0c8=_0x3f4055[_0xc59e('0x65')];for(var _0x2da806=0x0;_0x2da806<_0x3f4055[_0xc59e('0x66')][_0xc59e('0x47')];_0x2da806++){var _0x56812c=_0x3f4055[_0xc59e('0x66')][_0x2da806];var _0x288457='i';var _0x4c28e8=_[_0xc59e('0x67')](_0x8055a1,[_0xc59e('0x29'),_0x56812c[_0xc59e('0x4f')]]);if(!_0x4c28e8){switch(_0x56812c['field']){case _0xc59e('0x68'):if(_0x56812c[_0xc59e('0x69')]==0x1){_0x519bd4[_0xc59e('0x6a')]('`'+_0x56812c[_0xc59e('0x4f')]+'`\x20=\x200');}else{_0x519bd4[_0xc59e('0x6a')]('`'+_0x56812c['field']+_0xc59e('0x6b'));}break;case _0xc59e('0x6c'):if(_0x56812c['operator']==='$substring'){if(_0x56812c[_0xc59e('0x69')][_0xc59e('0x2f')]('\x20')[_0xc59e('0x47')]>0x1){_0x2e0e43[_0x4bd0c8](_0xc59e('0x6d'),qs['getFullTextValue'](_0x56812c[_0xc59e('0x69')]),null);}else{var _0x3fd988='%'+_0x56812c[_0xc59e('0x69')]+'%';_0x2e0e43[_0x4bd0c8](_0xc59e('0x6e'),_0x3fd988,_0x3fd988,_0x3fd988);}}else{_0x4c28e8=_[_0xc59e('0x67')](_0x8055a1,[_0xc59e('0x29'),_0xc59e('0x6f')]);_0x56812c[_0xc59e('0x4f')]=_0xc59e('0x6f');_0x27a785=as[_0xc59e('0x70')](_0x288457,_0x4c28e8[_0xc59e('0x3e')],_0x56812c);_0x2e0e43[_0x4bd0c8](_0x27a785[_0xc59e('0x71')],_0x27a785[_0xc59e('0x69')][_0xc59e('0x72')],_0x27a785[_0xc59e('0x69')][_0xc59e('0x1a')]);}break;case _0xc59e('0x73'):var _0x1e8594=_0x56812c[_0xc59e('0x69')][_0xc59e('0x2f')](',')['map'](function(_0x108605){return Number(_0x108605);});_0x1e8594['forEach'](function(_0x1b826c){_0x2609fe['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b826c+',%');});_0x39ccb4=_[_0xc59e('0x74')](_0x39ccb4,_0x1e8594);break;case _0xc59e('0x75'):if(_0x56812c[_0xc59e('0x76')]===_0xc59e('0x77')){_0x2e0e43[_0x4bd0c8](_0xc59e('0x78'),'%'+_0x56812c['value']+'%',null);}else{_0x4c28e8=_[_0xc59e('0x67')](_0x8055a1,['name','UserId']);_0x56812c[_0xc59e('0x4f')]=_0xc59e('0x38');_0x27a785=as[_0xc59e('0x70')](_0x288457,_0x4c28e8[_0xc59e('0x3e')],_0x56812c);_0x2e0e43[_0x4bd0c8](_0x27a785[_0xc59e('0x71')],_0x27a785[_0xc59e('0x69')]['start'],_0x27a785['value'][_0xc59e('0x1a')]);}break;case _0xc59e('0x79'):_0x27a785=as[_0xc59e('0x70')]('me',null,_0x56812c);_0x2e0e43[_0x4bd0c8](_0x27a785[_0xc59e('0x71')],_0x27a785[_0xc59e('0x69')]['start'],_0x27a785[_0xc59e('0x69')]['end']);break;}}else{var _0x27a785=as[_0xc59e('0x70')](_0x288457,_0x4c28e8[_0xc59e('0x3e')],_0x56812c);_0x2e0e43[_0x4bd0c8](_0x27a785['text'],_0x27a785[_0xc59e('0x69')][_0xc59e('0x72')],_0x27a785[_0xc59e('0x69')][_0xc59e('0x1a')]);}}}else{var _0x4d2f67=_(_0x29b8fa[_0xc59e('0x46')])[_0xc59e('0x40')]()[_0xc59e('0x2c')](function(_0x55c88b){return _[_0xc59e('0x7a')](_0x8055a1,[_0xc59e('0x29'),_0x55c88b])?_0x55c88b:undefined;})['compact']()[_0xc59e('0x69')]();if(!_[_0xc59e('0x7b')](_0x4d2f67)){_0x4d2f67['forEach'](function(_0x566178){if(_0x566178==='FaxAccountId'){_0x519bd4[_0xc59e('0x4c')]('i.FaxAccountId\x20IN\x20?',[][_0xc59e('0x7c')](_0x29b8fa[_0xc59e('0x46')][_0x566178]));}else if(_0x566178===_0xc59e('0x7d')){var _0x12d3ba=JSON[_0xc59e('0x7e')](_0x29b8fa[_0xc59e('0x46')][_0x566178])['$gte'];var _0x2ba42f=JSON[_0xc59e('0x7e')](_0x29b8fa[_0xc59e('0x46')][_0x566178])[_0xc59e('0x7f')];_0x519bd4['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12d3ba,_0x2ba42f);}else{if(_0x29b8fa[_0xc59e('0x46')][_0x566178]===_0xc59e('0x80')){_0x519bd4[_0xc59e('0x4c')]('i.'+_0x566178+'\x20IS\x20NULL');}else{_0x519bd4[_0xc59e('0x4c')]('i.'+_0x566178+_0xc59e('0x81'),_0x29b8fa['query'][_0x566178]);}}});}if(_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x82')]){if(_0x29b8fa['query'][_0xc59e('0x82')]==0x1){_0x519bd4[_0xc59e('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x519bd4[_0xc59e('0x6a')](_0xc59e('0x83'));}}if(_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x84')]){_0x39ccb4=_[_0xc59e('0x85')](_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x84')])?_0x29b8fa['query'][_0xc59e('0x84')]:new Array(_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x84')]);_0x39ccb4[_0xc59e('0x30')](function(_0x3e83a7){_0x2609fe['or'](_0xc59e('0x86'),'%,'+_0x3e83a7+',%');});}if(_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x87')]){var _0xf93f51=_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x87')][_0xc59e('0x88')]('\x5c','\x5c\x5c')[_0xc59e('0x88')](/'/g,'\x27\x27');if(qs[_0xc59e('0x89')](_0xf93f51)){_0x2e0e43['or'](_0xc59e('0x8a'),_0xf93f51+'%')['or'](_0xc59e('0x8b'),_0xf93f51+'%');}_0x2e0e43['or'](_0xc59e('0x8c'),_0xf93f51+'%');}}_0x519bd4[_0xc59e('0x4c')](_0x2e0e43);_0x519bd4[_0xc59e('0x8d')](_0xc59e('0x8e'));var _0x593094={'type':db[_0xc59e('0x8f')]['QueryTypes'][_0xc59e('0x90')],'raw':!![]};var _0x759933=_0x519bd4[_0xc59e('0x91')]();_0x759933[_0xc59e('0x4f')](_0xc59e('0x8e'));_0x759933['field'](_0xc59e('0x92'),_0xc59e('0x68'));if(_0x34b86b[_0xc59e('0x4a')]){_0x34b86b[_0xc59e('0x4a')][_0xc59e('0x30')](function(_0xca5c26){var _0x5aa398=_0xca5c26[0x0]===_0xc59e('0x93')?_0xca5c26[0x0]:'i.'+_0xca5c26[0x0];_0x519bd4[_0xc59e('0x4a')](_0x5aa398,_0xca5c26[0x1]===_0xc59e('0x94')?![]:!![]);});}if(!_[_0xc59e('0x7b')](_0x39ccb4)){_0x519bd4[_0xc59e('0x6a')](_0x2609fe);_0x759933[_0xc59e('0x4c')]('t.id\x20IN\x20?',_0x39ccb4);}BPromise[_0xc59e('0x95')]()[_0xc59e('0x26')](function(){if(!_0x3f4055){if(_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x96')])return;_0x759933[_0xc59e('0x4c')](_0xc59e('0x97'));_0x519bd4['where'](_0xc59e('0x97'));return;}if(_0x29b8fa[_0xc59e('0x98')][_0xc59e('0x99')]!==_0xc59e('0x9a'))return;return _0x29b8fa['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xc59e('0x26')](function(_0x19839a){if(_['isEmpty'](_0x19839a)){_0x759933['where'](_0xc59e('0x9b'));_0x519bd4[_0xc59e('0x4c')](_0xc59e('0x9b'));}else{_0x759933[_0xc59e('0x4c')](_0xc59e('0x9c'),_['map'](_0x19839a,'id'));_0x519bd4['where'](_0xc59e('0x9c'),_[_0xc59e('0x2c')](_0x19839a,'id'));}});})[_0xc59e('0x26')](function(){if(_0x29b8fa[_0xc59e('0x98')][_0xc59e('0x99')]===_0xc59e('0x9a')&&!_0x3f4055&&!_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x96')])return[];return db[_0xc59e('0x9d')][_0xc59e('0x46')](_0x759933['toString'](),_0x593094);})[_0xc59e('0x26')](function(_0x23d8ce){_0x73a85e['count']=_0x23d8ce['length'];if(_0x73a85e['count']===0x0)return[];return db[_0xc59e('0x9d')][_0xc59e('0x46')](_0x86e640['toString'](),_0x593094)[_0xc59e('0x26')](function(_0x13a036){_0x18d1ce=_['keyBy'](_0x13a036,'id');_0x593094=_[_0xc59e('0x9e')](_0x593094,{'model':db[_0xc59e('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29b8fa[_0xc59e('0x46')][_0xc59e('0x45')]){_0x34b86b[_0xc59e('0x43')][_0xc59e('0x30')](function(_0x1ab1c8){_0x519bd4[_0xc59e('0x4f')]('i.'+_0x1ab1c8);});}else{_0x519bd4[_0xc59e('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc59e('0x68'));_0x519bd4['field'](_0xc59e('0x9f'),'Account.key');_0x519bd4[_0xc59e('0x4f')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa0'),_0xc59e('0x93'));_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa1'));_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa2'),_0xc59e('0xa3'));_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa4'),_0xc59e('0xa5'));_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa6'),'Contact.email');_0x519bd4[_0xc59e('0x4f')]('c.phone','Contact.phone');_0x519bd4[_0xc59e('0x4f')]('c.mobile',_0xc59e('0xa7'));_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa8'),'Contact.fax');_0x519bd4[_0xc59e('0x4f')](_0xc59e('0xa9'),_0xc59e('0xaa'));_0x519bd4['field'](_0xc59e('0xab'),_0xc59e('0xac'));_0x519bd4['field'](_0xc59e('0xad'),_0xc59e('0x2d'));}if(_0x34b86b[_0xc59e('0x1c')])_0x519bd4['limit'](_0x34b86b['limit']);if(_0x34b86b[_0xc59e('0x1e')])_0x519bd4[_0xc59e('0x1e')](_0x34b86b[_0xc59e('0x1e')]);return db['sequelize'][_0xc59e('0x46')](_0x519bd4[_0xc59e('0xae')](),_0x593094);})[_0xc59e('0x26')](function(_0x51c87e){if(_0x51c87e['length']>0x0)_0x3ab1a6[_0xc59e('0x4c')](_0xc59e('0xaf'),_['map'](_0x51c87e,'id'));return db[_0xc59e('0x9d')][_0xc59e('0x46')](_0x3ab1a6['toString'](),_0x593094)[_0xc59e('0x26')](function(_0x64da7f){var _0x62878d=_[_0xc59e('0xb0')](_0x64da7f,_0xc59e('0xb1'));var _0x3e26cf=[];_0x51c87e[_0xc59e('0x30')](function(_0x1f3356){_0x3e26cf['push'](updateFaxInteraction(_0x1f3356,_0x18d1ce,_0x62878d));});return BPromise[_0xc59e('0xb2')](_0x3e26cf);});});})[_0xc59e('0x26')](function(_0xbde7f7){_0x73a85e['rows']=_0xbde7f7;return _0x73a85e;})['then'](respondWithFilteredResult(_0x182eed,_0x34b86b))[_0xc59e('0x32')](handleError(_0x182eed,null));};exports[_0xc59e('0xb3')]=function(_0x4808b7,_0x336f46){var _0x41521e={'raw':![],'where':{'id':_0x4808b7[_0xc59e('0xb4')]['id']}},_0x59a80a={};_0x59a80a[_0xc59e('0x42')]=_[_0xc59e('0x40')](db[_0xc59e('0x3b')][_0xc59e('0x3c')]);_0x59a80a['query']=_['keys'](_0x4808b7['query']);_0x59a80a[_0xc59e('0x41')]=_['intersection'](_0x59a80a[_0xc59e('0x42')],_0x59a80a['query']);_0x41521e[_0xc59e('0x43')]=_['intersection'](_0x59a80a['model'],qs['fields'](_0x4808b7[_0xc59e('0x46')][_0xc59e('0x45')]));_0x41521e[_0xc59e('0x43')]=_0x41521e['attributes'][_0xc59e('0x47')]?_0x41521e['attributes']:_0x59a80a['model'];if(_0x4808b7[_0xc59e('0x46')][_0xc59e('0xb5')]){_0x41521e[_0xc59e('0xb6')]=[{'all':!![]}];}_0x41521e=_[_0xc59e('0x9e')]({},_0x41521e,_0x4808b7[_0xc59e('0xb7')]);return db[_0xc59e('0x3b')]['find'](_0x41521e)[_0xc59e('0x26')](handleEntityNotFound(_0x336f46,null))[_0xc59e('0x26')](respondWithResult(_0x336f46,null))['catch'](handleError(_0x336f46,null));};exports['create']=function(_0x23d9f1,_0x5c265a){return db[_0xc59e('0x3b')]['create'](_0x23d9f1[_0xc59e('0x79')],{})['then'](respondWithResult(_0x5c265a,0xc9))[_0xc59e('0x32')](handleError(_0x5c265a,null));};exports['update']=function(_0x1049b5,_0x5d6f89){if(_0x1049b5[_0xc59e('0x79')]['id']){delete _0x1049b5[_0xc59e('0x79')]['id'];}return db[_0xc59e('0x3b')][_0xc59e('0x67')]({'where':{'id':_0x1049b5['params']['id']}})['then'](handleEntityNotFound(_0x5d6f89,null))['then'](saveUpdates(_0x1049b5[_0xc59e('0x79')],null))[_0xc59e('0x26')](respondWithResult(_0x5d6f89,null))[_0xc59e('0x32')](handleError(_0x5d6f89,null));};exports['destroy']=function(_0x89e1cd,_0x57ac22){return db[_0xc59e('0x3b')][_0xc59e('0x67')]({'where':{'id':_0x89e1cd[_0xc59e('0xb4')]['id']}})[_0xc59e('0x26')](handleEntityNotFound(_0x57ac22,null))[_0xc59e('0x26')](removeEntity(_0x57ac22,null))[_0xc59e('0x32')](handleError(_0x57ac22,null));};exports[_0xc59e('0xb8')]=function(_0x49e36d,_0x555112){return db[_0xc59e('0x3b')][_0xc59e('0xb8')]()['then'](respondWithResult(_0x555112,null))['catch'](handleError(_0x555112,null));};exports[_0xc59e('0xb9')]=function(_0xad6203,_0x532e69,_0x2c4621){return db[_0xc59e('0xba')]['find']({'where':{'id':_0xad6203[_0xc59e('0xb4')]['id']}})[_0xc59e('0x26')](handleEntityNotFound(_0x532e69,null))['then'](function(_0x2f7172){if(_0x2f7172){return _0x2f7172[_0xc59e('0xb9')](_0xad6203[_0xc59e('0x79')][_0xc59e('0xbb')],_['omit'](_0xad6203['body'],['ids','id'])||{});}})[_0xc59e('0x26')](respondWithResult(_0x532e69,null))[_0xc59e('0x32')](handleError(_0x532e69,null));};exports['getMessages']=function(_0x5c89a3,_0xf998ef,_0x3e00dd){var _0x10f5dd={'raw':![],'where':{}};var _0x6bb884={};var _0x1b2b8e={'count':0x0,'rows':[]};return db[_0xc59e('0x3b')][_0xc59e('0xbc')]({'where':{'id':_0x5c89a3[_0xc59e('0xb4')]['id']}})[_0xc59e('0x26')](handleEntityNotFound(_0xf998ef,null))[_0xc59e('0x26')](function(_0x381be6){if(_0x381be6){_0x6bb884['model']=_['keys'](db[_0xc59e('0xba')][_0xc59e('0x3c')]);_0x6bb884[_0xc59e('0x46')]=_[_0xc59e('0x40')](_0x5c89a3[_0xc59e('0x46')]);_0x6bb884[_0xc59e('0x41')]=_['intersection'](_0x6bb884['model'],_0x6bb884[_0xc59e('0x46')]);_0x10f5dd[_0xc59e('0x43')]=_[_0xc59e('0x44')](_0x6bb884['model'],qs[_0xc59e('0x45')](_0x5c89a3['query'][_0xc59e('0x45')]));_0x10f5dd[_0xc59e('0x43')]=_0x10f5dd['attributes'][_0xc59e('0x47')]?_0x10f5dd[_0xc59e('0x43')]:_0x6bb884[_0xc59e('0x42')];if(!_0x5c89a3[_0xc59e('0x46')][_0xc59e('0x48')](_0xc59e('0x49'))){_0x10f5dd['limit']=qs[_0xc59e('0x1c')](_0x5c89a3['query'][_0xc59e('0x1c')]);_0x10f5dd[_0xc59e('0x1e')]=qs[_0xc59e('0x1e')](_0x5c89a3[_0xc59e('0x46')]['offset']);}_0x10f5dd[_0xc59e('0x4a')]=qs[_0xc59e('0x4b')](_0x5c89a3[_0xc59e('0x46')][_0xc59e('0x4b')]);_0x10f5dd[_0xc59e('0x4c')]=qs[_0xc59e('0x41')](_[_0xc59e('0x4d')](_0x5c89a3[_0xc59e('0x46')],_0x6bb884[_0xc59e('0x41')]));_0x10f5dd[_0xc59e('0x4c')][_0xc59e('0xb1')]=_0x381be6['id'];if(_0x5c89a3[_0xc59e('0x46')][_0xc59e('0x87')]){_0x10f5dd[_0xc59e('0x4c')]=_[_0xc59e('0x9e')](_0x10f5dd[_0xc59e('0x4c')],{'$or':_[_0xc59e('0x2c')](_0x10f5dd['attributes'],function(_0x3da8e){var _0x5a603f={};_0x5a603f[_0x3da8e]={'$like':'%'+_0x5c89a3[_0xc59e('0x46')]['filter']+'%'};return _0x5a603f;})});}if(_0x5c89a3[_0xc59e('0x46')][_0xc59e('0xbd')]){var _0x406118=_0x5c89a3['query']['$gte'][_0xc59e('0x2f')](',');var _0x430ac4={};_0x430ac4[_0x406118[0x0]]={'$gte':moment(_0x406118[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x10f5dd[_0xc59e('0x4c')]=_[_0xc59e('0x9e')](_0x10f5dd['where'],_0x430ac4);}_0x10f5dd=_[_0xc59e('0x9e')]({},_0x10f5dd,_0x5c89a3[_0xc59e('0xb7')]);return db[_0xc59e('0xba')]['count']({'where':_0x10f5dd[_0xc59e('0x4c')]})[_0xc59e('0x26')](function(_0x160f11){_0x1b2b8e['count']=_0x160f11;if(_0x5c89a3[_0xc59e('0x46')]['includeAll']){_0x10f5dd['include']=[{'all':!![]}];}return db[_0xc59e('0xba')][_0xc59e('0xbe')](_0x10f5dd);})[_0xc59e('0x26')](function(_0x29298d){_0x1b2b8e[_0xc59e('0xbf')]=_0x29298d;return _0x1b2b8e;});}})[_0xc59e('0x26')](respondWithFilteredResult(_0xf998ef,_0x10f5dd))[_0xc59e('0x32')](handleError(_0xf998ef,null));};exports[_0xc59e('0xc0')]=function(_0x4fd5cf,_0x35f155,_0xcae750){return db['FaxInteraction'][_0xc59e('0x67')]({'where':{'id':_0x4fd5cf[_0xc59e('0xb4')]['id']}})[_0xc59e('0x26')](handleEntityNotFound(_0x35f155,null))[_0xc59e('0x26')](function(_0x6b8572){if(_0x6b8572){return _0x6b8572[_0xc59e('0xc1')](_0x4fd5cf[_0xc59e('0x79')]['ids'],_[_0xc59e('0xc2')](_0x4fd5cf[_0xc59e('0x79')],['ids','id'])||{})[_0xc59e('0xc3')](function(){return db[_0xc59e('0x73')][_0xc59e('0xbe')]({'attributes':['id',_0xc59e('0x29'),_0xc59e('0x50')],'where':{'id':_0x4fd5cf[_0xc59e('0x79')][_0xc59e('0xbb')]}});})[_0xc59e('0x26')](function(_0x1d9174){socket[_0xc59e('0xc4')](_0xc59e('0xc5'),{'id':Number(_0x4fd5cf['params']['id']),'tags':_0x1d9174||[]});return{'id':Number(_0x4fd5cf[_0xc59e('0xb4')]['id']),'tags':_0x1d9174||[]};});}})['then'](respondWithResult(_0x35f155,null))[_0xc59e('0x32')](handleError(_0x35f155,null));};exports[_0xc59e('0xc6')]=function(_0xdbbb08,_0x15d0fb,_0x3be978){return db[_0xc59e('0x3b')]['find']({'where':{'id':_0xdbbb08['params']['id']}})['then'](handleEntityNotFound(_0x15d0fb,null))[_0xc59e('0x26')](function(_0x36e7ce){if(_0x36e7ce){return _0x36e7ce['removeTags'](_0xdbbb08[_0xc59e('0x46')][_0xc59e('0xbb')]);}})['then'](respondWithStatusCode(_0x15d0fb,null))[_0xc59e('0x32')](handleError(_0x15d0fb,null));};exports[_0xc59e('0xc7')]=function(_0x92417e,_0x2c440a){var _0x3f387b=moment()[_0xc59e('0xc8')]()[_0xc59e('0xae')]();var _0x32140c=path[_0xc59e('0xc9')](config[_0xc59e('0xca')],_0xc59e('0xcb'),_0xc59e('0xcc'),_0xc59e('0xcd'));var _0xd07c27=path[_0xc59e('0xc9')](config[_0xc59e('0xca')],_0xc59e('0xcb'),_0xc59e('0xcc'),_0xc59e('0xce'));var _0x402ce5=path['join'](_0x32140c,_0x3f387b);var _0x4b04c4=util[_0xc59e('0xcf')](_0xc59e('0xd0'),_0x92417e[_0xc59e('0xb4')]['id'],_0x3f387b);var _0x57fb50=path[_0xc59e('0xc9')](_0x32140c,_0x4b04c4);var _0x3bfcd9=[];_0x3bfcd9[_0xc59e('0x31')]({'model':db[_0xc59e('0xd1')],'as':_0xc59e('0xd1'),'raw':!![]});var _0x224155=[{'model':db[_0xc59e('0xba')],'as':'Messages','attributes':['id',_0xc59e('0x79'),_0xc59e('0x7d')],'include':_0x3bfcd9}];return db['FaxInteraction'][_0xc59e('0x67')]({'where':{'id':_0x92417e['params']['id']},'include':_0x224155})[_0xc59e('0x26')](handleEntityNotFound(_0x2c440a,null))[_0xc59e('0x26')](function(_0x3b7699){if(_0x3b7699&&_0x3b7699[_0xc59e('0xd2')]){var _0x593cc3=_0x3b7699['get']({'plain':!![]});fs['mkdirSync'](_0x402ce5);for(var _0x1e889d=0x0;_0x1e889d<_0x593cc3[_0xc59e('0xd2')][_0xc59e('0x47')];_0x1e889d++){var _0x20b43b=_0x593cc3[_0xc59e('0xd2')][_0x1e889d][_0xc59e('0xd1')];if(_0x20b43b){var _0x112d65=path[_0xc59e('0xc9')](_0xd07c27,_0x20b43b[_0xc59e('0xd3')]);if(fs[_0xc59e('0xd4')](_0x112d65)){fs[_0xc59e('0xd5')](_0x112d65)[_0xc59e('0xd6')](fs['createWriteStream'](path[_0xc59e('0xc9')](_0x402ce5,_0x20b43b[_0xc59e('0xd3')])));}}}return BPromise[_0xc59e('0x95')]()[_0xc59e('0x26')](function(){return new BPromise(function(_0x1bc776,_0x2af573){zipdir(_0x402ce5,{'saveTo':_0x57fb50},function(_0x4b8ae8,_0x52e865){if(_0x4b8ae8)return _0x2af573(_0x4b8ae8);return _0x1bc776(_0x52e865);});})[_0xc59e('0x26')](function(){return new BPromise(function(_0x79737f,_0x13d24a){rimraf(_0x402ce5,function(_0x205682){if(_0x205682)_0x13d24a(_0x205682);return _0x79737f();});});})[_0xc59e('0x26')](function(){return _0x2c440a['download'](_0x57fb50,_0x4b04c4,function(_0x3d6e3d){if(_0x3d6e3d){console[_0xc59e('0xd7')](_0xc59e('0xd8'),_0x3d6e3d);}else{fs[_0xc59e('0xd9')](_0x57fb50);}});});});}else{return _0x2c440a[_0xc59e('0x18')](0xc8);}})[_0xc59e('0x32')](handleError(_0x2c440a,null));}; \ No newline at end of file +var _0x6ca3=['i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','create','describe','addMessage','ids','findOne','FaxMessage','options','include','findAll','setTags','omit','spread','faxInteractionTags:save','removeTags','download','join','files','tmp','root','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','./faxInteraction.socket','register','sendStatus','status','json','undefined','offset','count','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','Users','map','TagIds','split','Tags','push','catch','talking','answered','total','closed','UserId','waiting','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','FaxAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL'];(function(_0xc7d92f,_0x2f2193){var _0x3a17ea=function(_0x4315de){while(--_0x4315de){_0xc7d92f['push'](_0xc7d92f['shift']());}};_0x3a17ea(++_0x2f2193);}(_0x6ca3,0x1e5));var _0x36ca=function(_0x9553a2,_0x5424d9){_0x9553a2=_0x9553a2-0x0;var _0x3e398c=_0x6ca3[_0x9553a2];return _0x3e398c;};'use strict';var emlformat=require(_0x36ca('0x0'));var rimraf=require(_0x36ca('0x1'));var zipdir=require(_0x36ca('0x2'));var jsonpatch=require(_0x36ca('0x3'));var rp=require(_0x36ca('0x4'));var moment=require(_0x36ca('0x5'));var BPromise=require(_0x36ca('0x6'));var Mustache=require(_0x36ca('0x7'));var util=require(_0x36ca('0x8'));var path=require('path');var sox=require(_0x36ca('0x9'));var csv=require(_0x36ca('0xa'));var ejs=require(_0x36ca('0xb'));var fs=require('fs');var fs_extra=require(_0x36ca('0xc'));var _=require(_0x36ca('0xd'));var squel=require(_0x36ca('0xe'));var crypto=require(_0x36ca('0xf'));var jsforce=require(_0x36ca('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x36ca('0x11'));var Papa=require(_0x36ca('0x12'));var Redis=require(_0x36ca('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x36ca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36ca('0x15'));var logger=require(_0x36ca('0x16'))('api');var utils=require(_0x36ca('0x17'));var config=require(_0x36ca('0x18'));var licenseUtil=require(_0x36ca('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x36ca('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x36ca('0x1b'))[_0x36ca('0x1c')](socket);function respondWithStatusCode(_0x24e119,_0x44ea13){_0x44ea13=_0x44ea13||0xcc;return function(_0x3cfbf3){if(_0x3cfbf3){return _0x24e119[_0x36ca('0x1d')](_0x44ea13);}return _0x24e119[_0x36ca('0x1e')](_0x44ea13)['end']();};}function respondWithResult(_0x70f32b,_0x55bae0){_0x55bae0=_0x55bae0||0xc8;return function(_0x29e0aa){if(_0x29e0aa){return _0x70f32b[_0x36ca('0x1e')](_0x55bae0)[_0x36ca('0x1f')](_0x29e0aa);}};}function respondWithFilteredResult(_0x124ecd,_0xb96de4){return function(_0xd2fbcc){if(_0xd2fbcc){var _0x199860=typeof _0xb96de4['offset']==='undefined'&&typeof _0xb96de4['limit']===_0x36ca('0x20');var _0xc2435=_0xd2fbcc['count'];var _0x538afb=_0x199860?0x0:_0xb96de4[_0x36ca('0x21')];var _0x1fcbcc=_0x199860?_0xd2fbcc[_0x36ca('0x22')]:_0xb96de4[_0x36ca('0x21')]+_0xb96de4['limit'];var _0x50d532;if(_0x1fcbcc>=_0xc2435){_0x1fcbcc=_0xc2435;_0x50d532=0xc8;}else{_0x50d532=0xce;}_0x124ecd[_0x36ca('0x1e')](_0x50d532);return _0x124ecd[_0x36ca('0x23')](_0x36ca('0x24'),_0x538afb+'-'+_0x1fcbcc+'/'+_0xc2435)[_0x36ca('0x1f')](_0xd2fbcc);}return null;};}function patchUpdates(_0x163f13){return function(_0x5a5000){try{jsonpatch[_0x36ca('0x25')](_0x5a5000,_0x163f13,!![]);}catch(_0x3e0087){return BPromise['reject'](_0x3e0087);}return _0x5a5000['save']();};}function saveUpdates(_0x17e864,_0x465028){return function(_0xd774f2){if(_0xd774f2){return _0xd774f2[_0x36ca('0x26')](_0x17e864)[_0x36ca('0x27')](function(_0x10c5ce){return _0x10c5ce;});}return null;};}function removeEntity(_0x41ac45,_0x49a427){return function(_0x716dc5){if(_0x716dc5){return _0x716dc5[_0x36ca('0x28')]()[_0x36ca('0x27')](function(){_0x41ac45[_0x36ca('0x1e')](0xcc)[_0x36ca('0x29')]();});}};}function handleEntityNotFound(_0x161881,_0x5ac638){return function(_0x472c95){if(!_0x472c95){_0x161881['sendStatus'](0x194);}return _0x472c95;};}function handleError(_0x6862e2,_0x4fd5c9){_0x4fd5c9=_0x4fd5c9||0x1f4;return function(_0x3ccec4){logger[_0x36ca('0x2a')](_0x3ccec4[_0x36ca('0x2b')]);if(_0x3ccec4[_0x36ca('0x2c')]){delete _0x3ccec4[_0x36ca('0x2c')];}_0x6862e2[_0x36ca('0x1e')](_0x4fd5c9)[_0x36ca('0x2d')](_0x3ccec4);};}function getInteractionUsers(_0x36ebe7,_0x14f996){return new BPromise(function(_0x2e2b82,_0x58594c){try{if(_0x14f996[_0x36ebe7['id']]){_0x36ebe7[_0x36ca('0x2e')]=_[_0x36ca('0x2f')](_0x14f996[_0x36ebe7['id']],function(_0x512310){return{'id':_0x512310['id'],'fullname':_0x512310['fullname']};});}}catch(_0x55498b){_0x58594c(_0x55498b);}_0x2e2b82(_0x36ebe7);});}function getInteractionTags(_0x2386d6,_0x37facb){return new BPromise(function(_0x58d8a9,_0x3a5dff){try{if(_0x2386d6['TagIds']){_0x2386d6['Tags']=[];_0x2386d6[_0x36ca('0x30')][_0x36ca('0x31')](',')['forEach'](function(_0xc9157c){_0x2386d6[_0x36ca('0x32')][_0x36ca('0x33')](_0x37facb[_0xc9157c]);});}delete _0x2386d6[_0x36ca('0x30')];}catch(_0x449cdf){_0x3a5dff(_0x449cdf);}_0x58d8a9(_0x2386d6);});}function updateFaxInteraction(_0x53db47,_0xc6294d,_0x2e719f){return new BPromise(function(_0x1c047c,_0x305ba4){return getInteractionUsers(_0x53db47,_0x2e719f)[_0x36ca('0x27')](function(_0x5c7ecf){return getInteractionTags(_0x5c7ecf,_0xc6294d);})['then'](function(_0x461ddb){return getStateInteraction(_0x461ddb);})[_0x36ca('0x27')](function(_0x3b90af){_0x1c047c(_0x3b90af);})[_0x36ca('0x34')](function(_0x4ba288){_0x305ba4(_0x4ba288);});});}function getStateInteraction(_0x204430){return new BPromise(function(_0x31eb20){_0x204430['waiting']=0x0;_0x204430[_0x36ca('0x35')]=0x0;_0x204430[_0x36ca('0x36')]=0x0;_0x204430['unmanaged']=0x0;_0x204430[_0x36ca('0x37')]=0x0;if(!_0x204430[_0x36ca('0x38')]&&!_0x204430[_0x36ca('0x39')]){_0x204430[_0x36ca('0x3a')]+=0x1;}if(!_0x204430[_0x36ca('0x38')]&&_0x204430[_0x36ca('0x39')]){_0x204430[_0x36ca('0x35')]+=0x1;if(_0x204430[_0x36ca('0x3a')]){_0x204430[_0x36ca('0x3a')]-=0x1;}}if(_0x204430['closed']&&_0x204430[_0x36ca('0x39')]){_0x204430[_0x36ca('0x36')]+=0x1;if(_0x204430[_0x36ca('0x35')]){_0x204430['talking']-=0x1;}}if(_0x204430['closed']&&!_0x204430[_0x36ca('0x39')]){_0x204430['unmanaged']+=0x1;if(_0x204430[_0x36ca('0x3a')]){_0x204430['waiting']-=0x1;}}_0x204430[_0x36ca('0x37')]+=0x1;_0x31eb20(_0x204430);});}exports[_0x36ca('0x3b')]=function(_0x1aa8c2,_0x45e982){var _0x516986={},_0x286257={},_0x41f6a9={'count':0x0,'rows':[]};var _0x2448ec=_[_0x36ca('0x2f')](db['FaxInteraction'][_0x36ca('0x3c')],function(_0x3e3c74){return{'name':_0x3e3c74[_0x36ca('0x3d')],'type':_0x3e3c74[_0x36ca('0x3e')][_0x36ca('0x3f')]};});_0x286257[_0x36ca('0x40')]=_[_0x36ca('0x2f')](_0x2448ec,_0x36ca('0x2c'));_0x286257[_0x36ca('0x41')]=_['keys'](_0x1aa8c2['query']);_0x286257[_0x36ca('0x42')]=_[_0x36ca('0x43')](_0x286257['model'],_0x286257[_0x36ca('0x41')]);_0x516986[_0x36ca('0x44')]=_[_0x36ca('0x43')](_0x286257[_0x36ca('0x40')],qs[_0x36ca('0x45')](_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x45')]));_0x516986[_0x36ca('0x44')]=_0x516986[_0x36ca('0x44')][_0x36ca('0x46')]?_0x516986['attributes']:_0x286257[_0x36ca('0x40')];if(!_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x47')](_0x36ca('0x48'))){_0x516986['limit']=qs[_0x36ca('0x49')](_0x1aa8c2[_0x36ca('0x41')]['limit']);_0x516986['offset']=qs['offset'](_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x21')]);}_0x516986[_0x36ca('0x4a')]=qs[_0x36ca('0x4b')](_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x4b')]);_0x516986[_0x36ca('0x4c')]=qs[_0x36ca('0x42')](_[_0x36ca('0x4d')](_0x1aa8c2[_0x36ca('0x41')],_0x286257['filters']),_0x2448ec);var _0x18ed13=[];var _0x4c94ac=squel[_0x36ca('0x4e')]()[_0x36ca('0x4f')]('id')[_0x36ca('0x4f')](_0x36ca('0x2c'))['field'](_0x36ca('0x50'))[_0x36ca('0x51')](_0x36ca('0x52'));var _0x52ec68=squel[_0x36ca('0x4e')]()['field'](_0x36ca('0x53'))[_0x36ca('0x4f')](_0x36ca('0x54'))[_0x36ca('0x4f')]('ui.FaxInteractionId')['from']('user_has_fax_interactions','ui')[_0x36ca('0x55')](_0x36ca('0x56'),'u',_0x36ca('0x57'));var _0x135b26=squel['select']()[_0x36ca('0x51')](_0x36ca('0x58'),'i')[_0x36ca('0x55')]('cm_contacts','c',_0x36ca('0x59'))[_0x36ca('0x55')](_0x36ca('0x56'),'o','o.id\x20=\x20i.UserId')[_0x36ca('0x55')]('fax_accounts','a',_0x36ca('0x5a'))['left_join'](_0x36ca('0x5b'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x36ca('0x55')](_0x36ca('0x5c'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x36ca('0x55')]('tools_tags','t',_0x36ca('0x5d'));var _0x1f8b22=squel[_0x36ca('0x5e')]();var _0x283ba8=[];var _0x11a00c=squel[_0x36ca('0x5e')]();var _0x5c4a88;if(_0x1aa8c2['query'][_0x36ca('0x5f')]){_0x5c4a88=as['parseSearch'](_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x5f')]);var _0xc3b7c1=_0x5c4a88[_0x36ca('0x60')];for(var _0x3a6a5e=0x0;_0x3a6a5e<_0x5c4a88[_0x36ca('0x61')]['length'];_0x3a6a5e++){var _0x4ba80b=_0x5c4a88[_0x36ca('0x61')][_0x3a6a5e];var _0x1745fc='i';var _0xeb56b=_[_0x36ca('0x62')](_0x2448ec,[_0x36ca('0x2c'),_0x4ba80b['field']]);if(!_0xeb56b){switch(_0x4ba80b[_0x36ca('0x4f')]){case _0x36ca('0x63'):if(_0x4ba80b[_0x36ca('0x64')]==0x1){_0x135b26[_0x36ca('0x65')]('`'+_0x4ba80b['field']+'`\x20=\x200');}else{_0x135b26[_0x36ca('0x65')]('`'+_0x4ba80b[_0x36ca('0x4f')]+_0x36ca('0x66'));}break;case _0x36ca('0x67'):if(_0x4ba80b['operator']===_0x36ca('0x68')){if(_0x4ba80b['value'][_0x36ca('0x31')]('\x20')[_0x36ca('0x46')]>0x1){_0x1f8b22[_0xc3b7c1](_0x36ca('0x69'),qs['getFullTextValue'](_0x4ba80b[_0x36ca('0x64')]),null);}else{var _0x30c5cb='%'+_0x4ba80b[_0x36ca('0x64')]+'%';_0x1f8b22[_0xc3b7c1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x30c5cb,_0x30c5cb,_0x30c5cb);}}else{_0xeb56b=_[_0x36ca('0x62')](_0x2448ec,[_0x36ca('0x2c'),_0x36ca('0x6a')]);_0x4ba80b[_0x36ca('0x4f')]=_0x36ca('0x6a');_0x1b91c9=as[_0x36ca('0x6b')](_0x1745fc,_0xeb56b[_0x36ca('0x3e')],_0x4ba80b);_0x1f8b22[_0xc3b7c1](_0x1b91c9[_0x36ca('0x6c')],_0x1b91c9[_0x36ca('0x64')][_0x36ca('0x6d')],_0x1b91c9[_0x36ca('0x64')]['end']);}break;case _0x36ca('0x6e'):var _0x1fd794=_0x4ba80b[_0x36ca('0x64')][_0x36ca('0x31')](',')['map'](function(_0x524735){return Number(_0x524735);});_0x1fd794[_0x36ca('0x6f')](function(_0x529613){_0x11a00c['or'](_0x36ca('0x70'),'%,'+_0x529613+',%');});_0x283ba8=_[_0x36ca('0x71')](_0x283ba8,_0x1fd794);break;case _0x36ca('0x72'):if(_0x4ba80b[_0x36ca('0x73')]===_0x36ca('0x68')){_0x1f8b22[_0xc3b7c1](_0x36ca('0x74'),'%'+_0x4ba80b[_0x36ca('0x64')]+'%',null);}else{_0xeb56b=_['find'](_0x2448ec,['name',_0x36ca('0x39')]);_0x4ba80b[_0x36ca('0x4f')]=_0x36ca('0x39');_0x1b91c9=as[_0x36ca('0x6b')](_0x1745fc,_0xeb56b[_0x36ca('0x3e')],_0x4ba80b);_0x1f8b22[_0xc3b7c1](_0x1b91c9['text'],_0x1b91c9['value'][_0x36ca('0x6d')],_0x1b91c9[_0x36ca('0x64')][_0x36ca('0x29')]);}break;case _0x36ca('0x75'):_0x1b91c9=as['buildExpression']('me',null,_0x4ba80b);_0x1f8b22[_0xc3b7c1](_0x1b91c9[_0x36ca('0x6c')],_0x1b91c9[_0x36ca('0x64')]['start'],_0x1b91c9[_0x36ca('0x64')][_0x36ca('0x29')]);break;}}else{var _0x1b91c9=as[_0x36ca('0x6b')](_0x1745fc,_0xeb56b[_0x36ca('0x3e')],_0x4ba80b);_0x1f8b22[_0xc3b7c1](_0x1b91c9[_0x36ca('0x6c')],_0x1b91c9[_0x36ca('0x64')][_0x36ca('0x6d')],_0x1b91c9[_0x36ca('0x64')][_0x36ca('0x29')]);}}}else{var _0x1ae359=_(_0x1aa8c2[_0x36ca('0x41')])[_0x36ca('0x76')]()[_0x36ca('0x2f')](function(_0x2d7e19){return _[_0x36ca('0x77')](_0x2448ec,['name',_0x2d7e19])?_0x2d7e19:undefined;})[_0x36ca('0x78')]()[_0x36ca('0x64')]();if(!_[_0x36ca('0x79')](_0x1ae359)){_0x1ae359[_0x36ca('0x6f')](function(_0x43daa5){if(_0x43daa5===_0x36ca('0x7a')){_0x135b26['where']('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x1aa8c2[_0x36ca('0x41')][_0x43daa5]));}else if(_0x43daa5===_0x36ca('0x7b')){var _0x1b6a12=JSON[_0x36ca('0x7c')](_0x1aa8c2[_0x36ca('0x41')][_0x43daa5])[_0x36ca('0x7d')];var _0x47a415=JSON[_0x36ca('0x7c')](_0x1aa8c2[_0x36ca('0x41')][_0x43daa5])[_0x36ca('0x7e')];_0x135b26['where'](_0x36ca('0x7f'),_0x1b6a12,_0x47a415);}else{if(_0x1aa8c2['query'][_0x43daa5]===_0x36ca('0x80')){_0x135b26['where']('i.'+_0x43daa5+_0x36ca('0x81'));}else{_0x135b26[_0x36ca('0x4c')]('i.'+_0x43daa5+'\x20=\x20?',_0x1aa8c2[_0x36ca('0x41')][_0x43daa5]);}}});}if(_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x82')]){if(_0x1aa8c2['query'][_0x36ca('0x82')]==0x1){_0x135b26['having'](_0x36ca('0x83'));}else{_0x135b26['having'](_0x36ca('0x84'));}}if(_0x1aa8c2[_0x36ca('0x41')]['tag']){_0x283ba8=_[_0x36ca('0x85')](_0x1aa8c2['query'][_0x36ca('0x86')])?_0x1aa8c2[_0x36ca('0x41')]['tag']:new Array(_0x1aa8c2[_0x36ca('0x41')]['tag']);_0x283ba8[_0x36ca('0x6f')](function(_0x42a73f){_0x11a00c['or'](_0x36ca('0x70'),'%,'+_0x42a73f+',%');});}if(_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x87')]){var _0xde9a2a=_0x1aa8c2[_0x36ca('0x41')]['filter'][_0x36ca('0x88')]('\x5c','\x5c\x5c')[_0x36ca('0x88')](/'/g,'\x27\x27');if(qs[_0x36ca('0x89')](_0xde9a2a)){_0x1f8b22['or'](_0x36ca('0x8a'),_0xde9a2a+'%')['or'](_0x36ca('0x8b'),_0xde9a2a+'%');}_0x1f8b22['or'](_0x36ca('0x8c'),_0xde9a2a+'%');}}_0x135b26[_0x36ca('0x4c')](_0x1f8b22);_0x135b26[_0x36ca('0x8d')]('i.id');var _0x4254c2={'type':db[_0x36ca('0x8e')][_0x36ca('0x8f')]['SELECT'],'raw':!![]};var _0x1f2e65=_0x135b26[_0x36ca('0x90')]();_0x1f2e65[_0x36ca('0x4f')](_0x36ca('0x91'));_0x1f2e65[_0x36ca('0x4f')](_0x36ca('0x92'),_0x36ca('0x63'));if(_0x516986[_0x36ca('0x4a')]){_0x516986[_0x36ca('0x4a')][_0x36ca('0x6f')](function(_0x108b69){var _0x16635e=_0x108b69[0x0]===_0x36ca('0x93')?_0x108b69[0x0]:'i.'+_0x108b69[0x0];_0x135b26[_0x36ca('0x4a')](_0x16635e,_0x108b69[0x1]===_0x36ca('0x94')?![]:!![]);});}if(!_[_0x36ca('0x79')](_0x283ba8)){_0x135b26[_0x36ca('0x65')](_0x11a00c);_0x1f2e65[_0x36ca('0x4c')](_0x36ca('0x95'),_0x283ba8);}BPromise[_0x36ca('0x96')]()[_0x36ca('0x27')](function(){if(!_0x5c4a88){if(_0x1aa8c2[_0x36ca('0x41')]['FaxAccountId'])return;_0x1f2e65[_0x36ca('0x4c')](_0x36ca('0x97'));_0x135b26[_0x36ca('0x4c')](_0x36ca('0x97'));return;}if(_0x1aa8c2[_0x36ca('0x98')][_0x36ca('0x99')]!==_0x36ca('0x9a'))return;return _0x1aa8c2['user'][_0x36ca('0x9b')]({'attributes':['id'],'raw':!![]})[_0x36ca('0x27')](function(_0x2727e1){if(_[_0x36ca('0x79')](_0x2727e1)){_0x1f2e65[_0x36ca('0x4c')](_0x36ca('0x9c'));_0x135b26[_0x36ca('0x4c')](_0x36ca('0x9c'));}else{_0x1f2e65[_0x36ca('0x4c')](_0x36ca('0x9d'),_[_0x36ca('0x2f')](_0x2727e1,'id'));_0x135b26[_0x36ca('0x4c')](_0x36ca('0x9d'),_[_0x36ca('0x2f')](_0x2727e1,'id'));}});})['then'](function(){if(_0x1aa8c2['user'][_0x36ca('0x99')]==='agent'&&!_0x5c4a88&&!_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x7a')])return[];return db[_0x36ca('0x9e')][_0x36ca('0x41')](_0x1f2e65[_0x36ca('0x9f')](),_0x4254c2);})[_0x36ca('0x27')](function(_0x34c5e6){_0x41f6a9[_0x36ca('0x22')]=_0x34c5e6[_0x36ca('0x46')];if(_0x41f6a9[_0x36ca('0x22')]===0x0)return[];return db[_0x36ca('0x9e')][_0x36ca('0x41')](_0x4c94ac['toString'](),_0x4254c2)[_0x36ca('0x27')](function(_0xa4002d){_0x18ed13=_[_0x36ca('0xa0')](_0xa4002d,'id');_0x4254c2=_[_0x36ca('0xa1')](_0x4254c2,{'model':db[_0x36ca('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1aa8c2[_0x36ca('0x41')][_0x36ca('0x45')]){_0x516986[_0x36ca('0x44')][_0x36ca('0x6f')](function(_0x2fa2e1){_0x135b26['field']('i.'+_0x2fa2e1);});}else{_0x135b26['field'](_0x36ca('0x92'),_0x36ca('0x63'));_0x135b26[_0x36ca('0x4f')](_0x36ca('0xa3'),_0x36ca('0xa4'));_0x135b26['field'](_0x36ca('0xa5'),'Account.mandatoryDisposition');_0x135b26[_0x36ca('0x4f')](_0x36ca('0xa6'),_0x36ca('0x93'));_0x135b26[_0x36ca('0x4f')](_0x36ca('0xa7'));_0x135b26[_0x36ca('0x4f')](_0x36ca('0xa8'),'Contact.firstName');_0x135b26[_0x36ca('0x4f')]('c.lastName','Contact.lastName');_0x135b26[_0x36ca('0x4f')](_0x36ca('0xa9'),_0x36ca('0xaa'));_0x135b26[_0x36ca('0x4f')](_0x36ca('0xab'),_0x36ca('0xac'));_0x135b26[_0x36ca('0x4f')](_0x36ca('0xad'),_0x36ca('0xae'));_0x135b26[_0x36ca('0x4f')](_0x36ca('0xaf'),'Contact.fax');_0x135b26['field']('o.fullname',_0x36ca('0xb0'));_0x135b26[_0x36ca('0x4f')]('o.internal',_0x36ca('0xb1'));_0x135b26[_0x36ca('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x36ca('0x30'));}if(_0x516986['limit'])_0x135b26[_0x36ca('0x49')](_0x516986[_0x36ca('0x49')]);if(_0x516986[_0x36ca('0x21')])_0x135b26[_0x36ca('0x21')](_0x516986[_0x36ca('0x21')]);return db['sequelize'][_0x36ca('0x41')](_0x135b26[_0x36ca('0x9f')](),_0x4254c2);})['then'](function(_0x208bef){if(_0x208bef['length']>0x0)_0x52ec68['where'](_0x36ca('0xb2'),_[_0x36ca('0x2f')](_0x208bef,'id'));return db[_0x36ca('0x9e')][_0x36ca('0x41')](_0x52ec68[_0x36ca('0x9f')](),_0x4254c2)['then'](function(_0x39fc78){var _0x18fd92=_[_0x36ca('0xb3')](_0x39fc78,_0x36ca('0xb4'));var _0x333b8f=[];_0x208bef['forEach'](function(_0x5b6bf4){_0x333b8f['push'](updateFaxInteraction(_0x5b6bf4,_0x18ed13,_0x18fd92));});return BPromise[_0x36ca('0xb5')](_0x333b8f);});});})[_0x36ca('0x27')](function(_0x2997e8){_0x41f6a9[_0x36ca('0xb6')]=_0x2997e8;return _0x41f6a9;})[_0x36ca('0x27')](respondWithFilteredResult(_0x45e982,_0x516986))[_0x36ca('0x34')](handleError(_0x45e982,null));};exports[_0x36ca('0xb7')]=function(_0xb09598,_0x164d24){var _0x542909={'raw':![],'where':{'id':_0xb09598[_0x36ca('0xb8')]['id']}},_0x535e89={};_0x535e89[_0x36ca('0x40')]=_[_0x36ca('0x76')](db[_0x36ca('0xa2')][_0x36ca('0x3c')]);_0x535e89['query']=_[_0x36ca('0x76')](_0xb09598[_0x36ca('0x41')]);_0x535e89[_0x36ca('0x42')]=_[_0x36ca('0x43')](_0x535e89[_0x36ca('0x40')],_0x535e89[_0x36ca('0x41')]);_0x542909[_0x36ca('0x44')]=_[_0x36ca('0x43')](_0x535e89['model'],qs[_0x36ca('0x45')](_0xb09598['query'][_0x36ca('0x45')]));_0x542909['attributes']=_0x542909[_0x36ca('0x44')][_0x36ca('0x46')]?_0x542909[_0x36ca('0x44')]:_0x535e89[_0x36ca('0x40')];if(_0xb09598['query'][_0x36ca('0xb9')]){_0x542909['include']=[{'all':!![]}];}_0x542909=_[_0x36ca('0xa1')]({},_0x542909,_0xb09598['options']);return db[_0x36ca('0xa2')][_0x36ca('0x62')](_0x542909)[_0x36ca('0x27')](handleEntityNotFound(_0x164d24,null))[_0x36ca('0x27')](respondWithResult(_0x164d24,null))['catch'](handleError(_0x164d24,null));};exports[_0x36ca('0xba')]=function(_0x58081f,_0x3006dd){return db[_0x36ca('0xa2')][_0x36ca('0xba')](_0x58081f[_0x36ca('0x75')],{})[_0x36ca('0x27')](respondWithResult(_0x3006dd,0xc9))[_0x36ca('0x34')](handleError(_0x3006dd,null));};exports['update']=function(_0x2f77a4,_0x37de3e){if(_0x2f77a4['body']['id']){delete _0x2f77a4['body']['id'];}return db['FaxInteraction'][_0x36ca('0x62')]({'where':{'id':_0x2f77a4[_0x36ca('0xb8')]['id']}})[_0x36ca('0x27')](handleEntityNotFound(_0x37de3e,null))['then'](saveUpdates(_0x2f77a4['body'],null))[_0x36ca('0x27')](respondWithResult(_0x37de3e,null))['catch'](handleError(_0x37de3e,null));};exports[_0x36ca('0x28')]=function(_0x3fcc3b,_0x418405){return db[_0x36ca('0xa2')][_0x36ca('0x62')]({'where':{'id':_0x3fcc3b[_0x36ca('0xb8')]['id']}})['then'](handleEntityNotFound(_0x418405,null))['then'](removeEntity(_0x418405,null))[_0x36ca('0x34')](handleError(_0x418405,null));};exports[_0x36ca('0xbb')]=function(_0x24c884,_0x36621d){return db['FaxInteraction'][_0x36ca('0xbb')]()[_0x36ca('0x27')](respondWithResult(_0x36621d,null))[_0x36ca('0x34')](handleError(_0x36621d,null));};exports[_0x36ca('0xbc')]=function(_0x570ed5,_0x3dc4b3,_0x32beed){return db['FaxMessage'][_0x36ca('0x62')]({'where':{'id':_0x570ed5[_0x36ca('0xb8')]['id']}})[_0x36ca('0x27')](handleEntityNotFound(_0x3dc4b3,null))[_0x36ca('0x27')](function(_0x2ae3a2){if(_0x2ae3a2){return _0x2ae3a2[_0x36ca('0xbc')](_0x570ed5[_0x36ca('0x75')][_0x36ca('0xbd')],_['omit'](_0x570ed5['body'],[_0x36ca('0xbd'),'id'])||{});}})[_0x36ca('0x27')](respondWithResult(_0x3dc4b3,null))['catch'](handleError(_0x3dc4b3,null));};exports['getMessages']=function(_0x56570c,_0x25e1e7,_0x146915){var _0x39176e={'raw':![],'where':{}};var _0x4c1af1={};var _0x53248e={'count':0x0,'rows':[]};return db[_0x36ca('0xa2')][_0x36ca('0xbe')]({'where':{'id':_0x56570c['params']['id']}})[_0x36ca('0x27')](handleEntityNotFound(_0x25e1e7,null))[_0x36ca('0x27')](function(_0x1cbefd){if(_0x1cbefd){_0x4c1af1[_0x36ca('0x40')]=_[_0x36ca('0x76')](db[_0x36ca('0xbf')][_0x36ca('0x3c')]);_0x4c1af1[_0x36ca('0x41')]=_[_0x36ca('0x76')](_0x56570c[_0x36ca('0x41')]);_0x4c1af1['filters']=_[_0x36ca('0x43')](_0x4c1af1[_0x36ca('0x40')],_0x4c1af1[_0x36ca('0x41')]);_0x39176e[_0x36ca('0x44')]=_[_0x36ca('0x43')](_0x4c1af1[_0x36ca('0x40')],qs[_0x36ca('0x45')](_0x56570c[_0x36ca('0x41')][_0x36ca('0x45')]));_0x39176e[_0x36ca('0x44')]=_0x39176e['attributes']['length']?_0x39176e[_0x36ca('0x44')]:_0x4c1af1[_0x36ca('0x40')];if(!_0x56570c[_0x36ca('0x41')][_0x36ca('0x47')](_0x36ca('0x48'))){_0x39176e[_0x36ca('0x49')]=qs[_0x36ca('0x49')](_0x56570c['query'][_0x36ca('0x49')]);_0x39176e[_0x36ca('0x21')]=qs['offset'](_0x56570c[_0x36ca('0x41')][_0x36ca('0x21')]);}_0x39176e[_0x36ca('0x4a')]=qs[_0x36ca('0x4b')](_0x56570c[_0x36ca('0x41')]['sort']);_0x39176e[_0x36ca('0x4c')]=qs[_0x36ca('0x42')](_[_0x36ca('0x4d')](_0x56570c[_0x36ca('0x41')],_0x4c1af1[_0x36ca('0x42')]));_0x39176e[_0x36ca('0x4c')][_0x36ca('0xb4')]=_0x1cbefd['id'];if(_0x56570c[_0x36ca('0x41')][_0x36ca('0x87')]){_0x39176e[_0x36ca('0x4c')]=_[_0x36ca('0xa1')](_0x39176e[_0x36ca('0x4c')],{'$or':_[_0x36ca('0x2f')](_0x39176e[_0x36ca('0x44')],function(_0x403985){var _0x50b306={};_0x50b306[_0x403985]={'$like':'%'+_0x56570c[_0x36ca('0x41')][_0x36ca('0x87')]+'%'};return _0x50b306;})});}if(_0x56570c[_0x36ca('0x41')]['$gte']){var _0x212905=_0x56570c[_0x36ca('0x41')][_0x36ca('0x7d')]['split'](',');var _0x6f0184={};_0x6f0184[_0x212905[0x0]]={'$gte':moment(_0x212905[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x39176e[_0x36ca('0x4c')]=_[_0x36ca('0xa1')](_0x39176e[_0x36ca('0x4c')],_0x6f0184);}_0x39176e=_[_0x36ca('0xa1')]({},_0x39176e,_0x56570c[_0x36ca('0xc0')]);return db['FaxMessage'][_0x36ca('0x22')]({'where':_0x39176e[_0x36ca('0x4c')]})[_0x36ca('0x27')](function(_0x155aff){_0x53248e[_0x36ca('0x22')]=_0x155aff;if(_0x56570c[_0x36ca('0x41')][_0x36ca('0xb9')]){_0x39176e[_0x36ca('0xc1')]=[{'all':!![]}];}return db[_0x36ca('0xbf')][_0x36ca('0xc2')](_0x39176e);})[_0x36ca('0x27')](function(_0x14eccd){_0x53248e[_0x36ca('0xb6')]=_0x14eccd;return _0x53248e;});}})[_0x36ca('0x27')](respondWithFilteredResult(_0x25e1e7,_0x39176e))[_0x36ca('0x34')](handleError(_0x25e1e7,null));};exports['addTags']=function(_0x5b10db,_0x16450f,_0x514743){return db[_0x36ca('0xa2')][_0x36ca('0x62')]({'where':{'id':_0x5b10db[_0x36ca('0xb8')]['id']}})[_0x36ca('0x27')](handleEntityNotFound(_0x16450f,null))['then'](function(_0x26f907){if(_0x26f907){return _0x26f907[_0x36ca('0xc3')](_0x5b10db['body'][_0x36ca('0xbd')],_[_0x36ca('0xc4')](_0x5b10db[_0x36ca('0x75')],[_0x36ca('0xbd'),'id'])||{})[_0x36ca('0xc5')](function(){return db['Tag'][_0x36ca('0xc2')]({'attributes':['id',_0x36ca('0x2c'),_0x36ca('0x50')],'where':{'id':_0x5b10db['body'][_0x36ca('0xbd')]}});})[_0x36ca('0x27')](function(_0x3eb206){socket['emit'](_0x36ca('0xc6'),{'id':Number(_0x5b10db['params']['id']),'tags':_0x3eb206||[]});return{'id':Number(_0x5b10db[_0x36ca('0xb8')]['id']),'tags':_0x3eb206||[]};});}})['then'](respondWithResult(_0x16450f,null))[_0x36ca('0x34')](handleError(_0x16450f,null));};exports[_0x36ca('0xc7')]=function(_0x51201a,_0x2df553,_0x344947){return db[_0x36ca('0xa2')][_0x36ca('0x62')]({'where':{'id':_0x51201a[_0x36ca('0xb8')]['id']}})[_0x36ca('0x27')](handleEntityNotFound(_0x2df553,null))['then'](function(_0x33b875){if(_0x33b875){return _0x33b875[_0x36ca('0xc7')](_0x51201a[_0x36ca('0x41')][_0x36ca('0xbd')]);}})[_0x36ca('0x27')](respondWithStatusCode(_0x2df553,null))[_0x36ca('0x34')](handleError(_0x2df553,null));};exports[_0x36ca('0xc8')]=function(_0x1ef9b4,_0x1cd7a6){var _0x3c78a4=moment()['unix']()[_0x36ca('0x9f')]();var _0x56ebec=path[_0x36ca('0xc9')](config['root'],'server',_0x36ca('0xca'),_0x36ca('0xcb'));var _0x3eccbd=path[_0x36ca('0xc9')](config[_0x36ca('0xcc')],'server',_0x36ca('0xca'),'attachments');var _0x424adf=path[_0x36ca('0xc9')](_0x56ebec,_0x3c78a4);var _0x1a6144=util['format']('transcript-%d-%s.zip',_0x1ef9b4[_0x36ca('0xb8')]['id'],_0x3c78a4);var _0x32dc96=path[_0x36ca('0xc9')](_0x56ebec,_0x1a6144);var _0x42c8be=[];_0x42c8be[_0x36ca('0x33')]({'model':db[_0x36ca('0xcd')],'as':_0x36ca('0xcd'),'raw':!![]});var _0x42b6d8=[{'model':db['FaxMessage'],'as':_0x36ca('0xce'),'attributes':['id',_0x36ca('0x75'),'createdAt'],'include':_0x42c8be}];return db[_0x36ca('0xa2')][_0x36ca('0x62')]({'where':{'id':_0x1ef9b4[_0x36ca('0xb8')]['id']},'include':_0x42b6d8})[_0x36ca('0x27')](handleEntityNotFound(_0x1cd7a6,null))[_0x36ca('0x27')](function(_0x1050a6){if(_0x1050a6&&_0x1050a6[_0x36ca('0xce')]){var _0x5b56e9=_0x1050a6[_0x36ca('0xcf')]({'plain':!![]});fs[_0x36ca('0xd0')](_0x424adf);for(var _0x10fc40=0x0;_0x10fc40<_0x5b56e9['Messages'][_0x36ca('0x46')];_0x10fc40++){var _0x42aee3=_0x5b56e9['Messages'][_0x10fc40][_0x36ca('0xcd')];if(_0x42aee3){var _0x24a4a5=path[_0x36ca('0xc9')](_0x3eccbd,_0x42aee3[_0x36ca('0xd1')]);if(fs[_0x36ca('0xd2')](_0x24a4a5)){fs[_0x36ca('0xd3')](_0x24a4a5)[_0x36ca('0xd4')](fs['createWriteStream'](path[_0x36ca('0xc9')](_0x424adf,_0x42aee3[_0x36ca('0xd1')])));}}}return BPromise[_0x36ca('0x96')]()[_0x36ca('0x27')](function(){return new BPromise(function(_0x85b933,_0x5a7007){zipdir(_0x424adf,{'saveTo':_0x32dc96},function(_0x2dcbde,_0x4bfee6){if(_0x2dcbde)return _0x5a7007(_0x2dcbde);return _0x85b933(_0x4bfee6);});})[_0x36ca('0x27')](function(){return new BPromise(function(_0x9a92dc,_0x5a9fd2){rimraf(_0x424adf,function(_0x51d070){if(_0x51d070)_0x5a9fd2(_0x51d070);return _0x9a92dc();});});})[_0x36ca('0x27')](function(){return _0x1cd7a6['download'](_0x32dc96,_0x1a6144,function(_0x37855b){if(_0x37855b){console[_0x36ca('0xd5')]('err',_0x37855b);}else{fs['unlinkSync'](_0x32dc96);}});});});}else{return _0x1cd7a6[_0x36ca('0x1d')](0xc8);}})[_0x36ca('0x34')](handleError(_0x1cd7a6,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 291b6e7..9fa1dfc 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 _0x3b19=['then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','getUsers'];(function(_0x122020,_0xf9ebf4){var _0x38af41=function(_0xcf3c72){while(--_0xcf3c72){_0x122020['push'](_0x122020['shift']());}};_0x38af41(++_0xf9ebf4);}(_0x3b19,0x113));var _0x93b1=function(_0x1e2977,_0x2b2057){_0x1e2977=_0x1e2977-0x0;var _0x3b7c36=_0x3b19[_0x1e2977];return _0x3b7c36;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x93b1('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x93b1('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x93b1('0x1')](0x0);var events={'afterCreate':_0x93b1('0x2'),'afterUpdate':_0x93b1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4e62f3){return function(_0x234d10,_0xf60938,_0x995fa3){_0x234d10[_0x93b1('0x4')]({'attributes':['id'],'raw':!![]})[_0x93b1('0x5')](function(_0x135b9f){_0x234d10[_0x93b1('0x6')]('Users',_0x135b9f[_0x93b1('0x7')](function(_0x2ab50e){return{'id':_0x2ab50e['id']};}));return FaxMessage[_0x93b1('0x8')]({'where':{'FaxInteractionId':_0x234d10['id'],'direction':'in','read':![]},'raw':!![]});})[_0x93b1('0x5')](function(_0x6b41e4){_0x234d10['setDataValue'](_0x93b1('0x9'),_0x6b41e4['length']);FaxInteractionEvents[_0x93b1('0xa')](_0x4e62f3+':'+_0x234d10['id'],_0x234d10);FaxInteractionEvents[_0x93b1('0xa')](_0x4e62f3,_0x234d10);_0x995fa3(null);})[_0x93b1('0xb')](_0x995fa3(null));};}for(var e in events){if(events[_0x93b1('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x93b1('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0xd15e=['FaxMessage','setMaxListeners','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x5e4fcb,_0x4d4b1f){var _0x60d949=function(_0x3a22ae){while(--_0x3a22ae){_0x5e4fcb['push'](_0x5e4fcb['shift']());}};_0x60d949(++_0x4d4b1f);}(_0xd15e,0x19f));var _0xed15=function(_0x30fcd7,_0x46cef3){_0x30fcd7=_0x30fcd7-0x0;var _0x38d8cf=_0xd15e[_0x30fcd7];return _0x38d8cf;};'use strict';var EventEmitter=require(_0xed15('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xed15('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xed15('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xed15('0x3')};function emitEvent(_0x5ddda0){return function(_0x7b7793,_0x17ae3b,_0x4e479c){_0x7b7793[_0xed15('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x7e4cf4){_0x7b7793[_0xed15('0x5')](_0xed15('0x6'),_0x7e4cf4[_0xed15('0x7')](function(_0x2685ce){return{'id':_0x2685ce['id']};}));return FaxMessage[_0xed15('0x8')]({'where':{'FaxInteractionId':_0x7b7793['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed15('0x9')](function(_0x3fa3f1){_0x7b7793[_0xed15('0x5')](_0xed15('0xa'),_0x3fa3f1[_0xed15('0xb')]);FaxInteractionEvents[_0xed15('0xc')](_0x5ddda0+':'+_0x7b7793['id'],_0x7b7793);FaxInteractionEvents[_0xed15('0xc')](_0x5ddda0,_0x7b7793);_0x4e479c(null);})[_0xed15('0xd')](_0x4e479c(null));};}for(var e in events){if(events[_0xed15('0xe')](e)){var event=events[e];FaxInteraction[_0xed15('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 1992b60..4c94228 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 _0x97ac=['bluebird','path','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment'];(function(_0x3e56b2,_0x2820b8){var _0x7a5a7=function(_0x474adb){while(--_0x474adb){_0x3e56b2['push'](_0x3e56b2['shift']());}};_0x7a5a7(++_0x2820b8);}(_0x97ac,0xa1));var _0xc97a=function(_0x41f4c5,_0x201e9e){_0x41f4c5=_0x41f4c5-0x0;var _0x4be87e=_0x97ac[_0x41f4c5];return _0x4be87e;};'use strict';var _=require(_0xc97a('0x0'));var util=require(_0xc97a('0x1'));var logger=require(_0xc97a('0x2'))('api');var moment=require(_0xc97a('0x3'));var BPromise=require(_0xc97a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc97a('0x5'));var rimraf=require(_0xc97a('0x6'));var config=require(_0xc97a('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xc97a('0x8')]=function(_0x624a37,_0x2d6639){return _0x624a37[_0xc97a('0x9')](_0xc97a('0xa'),attributes,{'tableName':_0xc97a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e9d9c,_0x48ea80,_0x2f1216){if(_0x4e9d9c['changed'](_0xc97a('0xc'))){_0x4e9d9c[_0xc97a('0xd')]=moment()['format'](_0xc97a('0xe'));}_0x2f1216(null,_0x4e9d9c);}}});}; \ No newline at end of file +var _0xf69f=['api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','util','../../config/logger'];(function(_0x53cb49,_0x233b67){var _0x39c114=function(_0x231a95){while(--_0x231a95){_0x53cb49['push'](_0x53cb49['shift']());}};_0x39c114(++_0x233b67);}(_0xf69f,0x85));var _0xff69=function(_0x32b981,_0x4d8b13){_0x32b981=_0x32b981-0x0;var _0x1209cf=_0xf69f[_0x32b981];return _0x1209cf;};'use strict';var _=require('lodash');var util=require(_0xff69('0x0'));var logger=require(_0xff69('0x1'))(_0xff69('0x2'));var moment=require(_0xff69('0x3'));var BPromise=require(_0xff69('0x4'));var rp=require(_0xff69('0x5'));var fs=require('fs');var path=require(_0xff69('0x6'));var rimraf=require('rimraf');var config=require(_0xff69('0x7'));var attributes=require(_0xff69('0x8'));module[_0xff69('0x9')]=function(_0x5b1174,_0x11b10f){return _0x5b1174['define'](_0xff69('0xa'),attributes,{'tableName':_0xff69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4aabc6,_0x21c3db,_0x4e6176){if(_0x4aabc6[_0xff69('0xc')](_0xff69('0xd'))){_0x4aabc6[_0xff69('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4e6176(null,_0x4aabc6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 6b2f79e..ca9a33f 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 _0xadd8=['UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','where','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','raw','attributes','limit','then'];(function(_0x473c79,_0x3421bd){var _0x2054b3=function(_0x2e4957){while(--_0x2e4957){_0x473c79['push'](_0x473c79['shift']());}};_0x2054b3(++_0x3421bd);}(_0xadd8,0x150));var _0x8add=function(_0xf1d255,_0x6f0c81){_0xf1d255=_0xf1d255-0x0;var _0x12bbaf=_0xadd8[_0xf1d255];return _0x12bbaf;};'use strict';var _=require('lodash');var util=require(_0x8add('0x0'));var moment=require(_0x8add('0x1'));var BPromise=require(_0x8add('0x2'));var rs=require(_0x8add('0x3'));var fs=require('fs');var Redis=require(_0x8add('0x4'));var db=require(_0x8add('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8add('0x6'));var config=require(_0x8add('0x7'));var jayson=require(_0x8add('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x8add('0x9')]=_[_0x8add('0xa')](config['redis'],{'host':_0x8add('0xb'),'port':0x18eb});var socket=require(_0x8add('0xc'))(new Redis(config[_0x8add('0x9')]));require(_0x8add('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b64df,_0x3783dc,_0x28ec91){return new BPromise(function(_0xaa4f90,_0x3deaed){return client[_0x8add('0xe')](_0x1b64df,_0x28ec91)['then'](function(_0x18c9e6){logger[_0x8add('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x3783dc,_0x8add('0x10'));logger[_0x8add('0x11')](_0x8add('0x12'),_0x3783dc,_0x8add('0x10'),JSON[_0x8add('0x13')](_0x18c9e6));if(_0x18c9e6[_0x8add('0x14')]){if(_0x18c9e6[_0x8add('0x14')][_0x8add('0x15')]===0x1f4){logger[_0x8add('0x14')](_0x8add('0x16'),_0x3783dc,_0x18c9e6['error'][_0x8add('0x17')]);return _0x3deaed(_0x18c9e6['error'][_0x8add('0x17')]);}logger[_0x8add('0x14')](_0x8add('0x16'),_0x3783dc,_0x18c9e6[_0x8add('0x14')][_0x8add('0x17')]);return _0xaa4f90(_0x18c9e6['error']['message']);}else{logger['info'](_0x8add('0x16'),_0x3783dc,_0x8add('0x10'));_0xaa4f90(_0x18c9e6[_0x8add('0x18')][_0x8add('0x17')]);}})[_0x8add('0x19')](function(_0x2e6866){logger[_0x8add('0x14')](_0x8add('0x16'),_0x3783dc,_0x2e6866);_0x3deaed(_0x2e6866);});});}exports['UpdateFaxInteraction']=function(_0x3b39cd){var _0xb73c31=this;return new Promise(function(_0x2734e7,_0x51facf){return db['FaxInteraction'][_0x8add('0x1a')](_0x3b39cd[_0x8add('0x1b')],{'raw':_0x3b39cd['options']?_0x3b39cd[_0x8add('0x1c')][_0x8add('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b39cd[_0x8add('0x1c')]?_0x3b39cd[_0x8add('0x1c')]['where']||null:null,'attributes':_0x3b39cd[_0x8add('0x1c')]?_0x3b39cd[_0x8add('0x1c')][_0x8add('0x1e')]||null:null,'limit':_0x3b39cd[_0x8add('0x1c')]?_0x3b39cd['options'][_0x8add('0x1f')]||null:null})[_0x8add('0x20')](function(_0x410485){logger[_0x8add('0xf')]('UpdateFaxInteraction',_0x3b39cd);logger[_0x8add('0x11')](_0x8add('0x21'),_0x3b39cd,JSON[_0x8add('0x13')](_0x410485));_0x2734e7(_0x410485);})[_0x8add('0x19')](function(_0x33fc97){logger['error'](_0x8add('0x21'),_0x33fc97[_0x8add('0x17')],_0x3b39cd);_0x51facf(_0xb73c31[_0x8add('0x14')](0x1f4,_0x33fc97[_0x8add('0x17')]));});});};exports[_0x8add('0x22')]=function(_0x5ea1c9){return new Promise(function(_0x164c74,_0x4f73da){return db[_0x8add('0x23')][_0x8add('0x24')]({'where':_0x5ea1c9['options']?_0x5ea1c9[_0x8add('0x1c')][_0x8add('0x25')]||null:null})[_0x8add('0x20')](function(_0x3272a3){if(_0x3272a3){return _0x3272a3['addTags'](_0x5ea1c9[_0x8add('0x1b')]['ids'],_['omit'](_0x5ea1c9[_0x8add('0x1b')],[_0x8add('0x26'),'id'])||{});}})[_0x8add('0x27')](function(_0x2590ab){logger[_0x8add('0xf')](_0x8add('0x28'),_0x5ea1c9);logger[_0x8add('0x11')](_0x8add('0x28'),_0x5ea1c9,JSON[_0x8add('0x13')](_0x2590ab));_0x164c74(_0x2590ab);})[_0x8add('0x19')](function(_0x1ce023){logger[_0x8add('0x14')](_0x8add('0x28'),_0x1ce023[_0x8add('0x17')],_0x5ea1c9);_0x4f73da(_this[_0x8add('0x14')](0x1f4,_0x1ce023[_0x8add('0x17')]));});});}; \ No newline at end of file +var _0xd775=['request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxInteraction','options','raw','attributes','limit','stringify','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','body','omit','ids','spread','AddTags','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s'];(function(_0x15ad6a,_0x511136){var _0x414b2d=function(_0xb220d7){while(--_0xb220d7){_0x15ad6a['push'](_0x15ad6a['shift']());}};_0x414b2d(++_0x511136);}(_0xd775,0x70));var _0x5d77=function(_0x1d937a,_0x36b41a){_0x1d937a=_0x1d937a-0x0;var _0x2dbe8b=_0xd775[_0x1d937a];return _0x2dbe8b;};'use strict';var _=require(_0x5d77('0x0'));var util=require('util');var moment=require(_0x5d77('0x1'));var BPromise=require(_0x5d77('0x2'));var rs=require(_0x5d77('0x3'));var fs=require('fs');var Redis=require(_0x5d77('0x4'));var db=require(_0x5d77('0x5'))['db'];var utils=require(_0x5d77('0x6'));var logger=require(_0x5d77('0x7'))(_0x5d77('0x8'));var config=require(_0x5d77('0x9'));var jayson=require(_0x5d77('0xa'));var client=jayson['client'][_0x5d77('0xb')]({'port':0x232a});config[_0x5d77('0xc')]=_[_0x5d77('0xd')](config[_0x5d77('0xc')],{'host':_0x5d77('0xe'),'port':0x18eb});var socket=require(_0x5d77('0xf'))(new Redis(config[_0x5d77('0xc')]));require('./faxInteraction.socket')[_0x5d77('0x10')](socket);function respondWithRpcPromise(_0x1fb19c,_0x3891b4,_0x26fc16){return new BPromise(function(_0x5cfdfe,_0x1226fd){return client['request'](_0x1fb19c,_0x26fc16)[_0x5d77('0x11')](function(_0x248b21){logger[_0x5d77('0x12')](_0x5d77('0x13'),_0x3891b4,_0x5d77('0x14'));logger[_0x5d77('0x15')](_0x5d77('0x16'),_0x3891b4,_0x5d77('0x14'),JSON['stringify'](_0x248b21));if(_0x248b21[_0x5d77('0x17')]){if(_0x248b21['error'][_0x5d77('0x18')]===0x1f4){logger[_0x5d77('0x17')](_0x5d77('0x13'),_0x3891b4,_0x248b21[_0x5d77('0x17')][_0x5d77('0x19')]);return _0x1226fd(_0x248b21[_0x5d77('0x17')][_0x5d77('0x19')]);}logger['error'](_0x5d77('0x13'),_0x3891b4,_0x248b21['error'][_0x5d77('0x19')]);return _0x5cfdfe(_0x248b21[_0x5d77('0x17')]['message']);}else{logger[_0x5d77('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x3891b4,_0x5d77('0x14'));_0x5cfdfe(_0x248b21[_0x5d77('0x1a')][_0x5d77('0x19')]);}})['catch'](function(_0x30cc5c){logger[_0x5d77('0x17')](_0x5d77('0x13'),_0x3891b4,_0x30cc5c);_0x1226fd(_0x30cc5c);});});}exports[_0x5d77('0x1b')]=function(_0x508f46){var _0x2b06b9=this;return new Promise(function(_0x1b9f5b,_0x1f9859){return db['FaxInteraction']['update'](_0x508f46['body'],{'raw':_0x508f46[_0x5d77('0x1c')]?_0x508f46['options'][_0x5d77('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x508f46['options']?_0x508f46[_0x5d77('0x1c')]['where']||null:null,'attributes':_0x508f46[_0x5d77('0x1c')]?_0x508f46[_0x5d77('0x1c')][_0x5d77('0x1e')]||null:null,'limit':_0x508f46[_0x5d77('0x1c')]?_0x508f46['options'][_0x5d77('0x1f')]||null:null})['then'](function(_0x21c431){logger[_0x5d77('0x12')](_0x5d77('0x1b'),_0x508f46);logger[_0x5d77('0x15')]('UpdateFaxInteraction',_0x508f46,JSON[_0x5d77('0x20')](_0x21c431));_0x1b9f5b(_0x21c431);})['catch'](function(_0x1b5d96){logger['error'](_0x5d77('0x1b'),_0x1b5d96[_0x5d77('0x19')],_0x508f46);_0x1f9859(_0x2b06b9['error'](0x1f4,_0x1b5d96[_0x5d77('0x19')]));});});};exports[_0x5d77('0x21')]=function(_0x44fa9d){return new Promise(function(_0x147d22,_0x2d2ecf){return db[_0x5d77('0x22')][_0x5d77('0x23')]({'where':_0x44fa9d[_0x5d77('0x1c')]?_0x44fa9d[_0x5d77('0x1c')][_0x5d77('0x24')]||null:null})[_0x5d77('0x11')](function(_0x418bb7){if(_0x418bb7){return _0x418bb7[_0x5d77('0x25')](_0x44fa9d[_0x5d77('0x26')]['ids'],_[_0x5d77('0x27')](_0x44fa9d['body'],[_0x5d77('0x28'),'id'])||{});}})[_0x5d77('0x29')](function(_0x37be06){logger['info'](_0x5d77('0x2a'),_0x44fa9d);logger[_0x5d77('0x15')]('AddTags',_0x44fa9d,JSON[_0x5d77('0x20')](_0x37be06));_0x147d22(_0x37be06);})[_0x5d77('0x2b')](function(_0x21c62e){logger[_0x5d77('0x17')](_0x5d77('0x2a'),_0x21c62e[_0x5d77('0x19')],_0x44fa9d);_0x2d2ecf(_this[_0x5d77('0x17')](0x1f4,_0x21c62e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 6ed4604..840430c 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 _0x6178=['faxInteraction:','save','remove','update','emit','removeListener'];(function(_0x505b94,_0x2bb67e){var _0x5201d4=function(_0x356bce){while(--_0x356bce){_0x505b94['push'](_0x505b94['shift']());}};_0x5201d4(++_0x2bb67e);}(_0x6178,0x109));var _0x8617=function(_0x10e23f,_0x4101e5){_0x10e23f=_0x10e23f-0x0;var _0x3a14fc=_0x6178[_0x10e23f];return _0x3a14fc;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x8617('0x0'),_0x8617('0x1'),_0x8617('0x2')];function createListener(_0x15edcf,_0x4e6bcc){return function(_0x3da6c3){_0x4e6bcc[_0x8617('0x3')](_0x15edcf,_0x3da6c3);};}function removeListener(_0x21e8f1,_0x5d1183){return function(){FaxInteractionEvents[_0x8617('0x4')](_0x21e8f1,_0x5d1183);};}exports['register']=function(_0x35aa10){for(var _0x24ff9f=0x0,_0x38c3c8=events['length'];_0x24ff9f<_0x38c3c8;_0x24ff9f++){var _0x4ee274=events[_0x24ff9f];var _0x47b2a2=createListener(_0x8617('0x5')+_0x4ee274,_0x35aa10);FaxInteractionEvents['on'](_0x4ee274,_0x47b2a2);}}; \ No newline at end of file +var _0xaa49=['save','remove','update','emit','removeListener','register','length'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0xaa49,0x12d));var _0x9aa4=function(_0x2d5382,_0x4f2f31){_0x2d5382=_0x2d5382-0x0;var _0xced5d7=_0xaa49[_0x2d5382];return _0xced5d7;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x9aa4('0x0'),_0x9aa4('0x1'),_0x9aa4('0x2')];function createListener(_0x309ed0,_0x2f5b30){return function(_0x5b76aa){_0x2f5b30[_0x9aa4('0x3')](_0x309ed0,_0x5b76aa);};}function removeListener(_0x28ec0c,_0x2b7119){return function(){FaxInteractionEvents[_0x9aa4('0x4')](_0x28ec0c,_0x2b7119);};}exports[_0x9aa4('0x5')]=function(_0x1cb163){for(var _0x4a8318=0x0,_0x5eb92b=events[_0x9aa4('0x6')];_0x4a8318<_0x5eb92b;_0x4a8318++){var _0x51ccbb=events[_0x4a8318];var _0x44c88d=createListener('faxInteraction:'+_0x51ccbb,_0x1cb163);FaxInteractionEvents['on'](_0x51ccbb,_0x44c88d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e8b445f..0e2300a 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 _0xdc28=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','fax','faxinteraction:addtags','put','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x3676b4,_0x5462cc){var _0x13bcd1=function(_0x43cf11){while(--_0x43cf11){_0x3676b4['push'](_0x3676b4['shift']());}};_0x13bcd1(++_0x5462cc);}(_0xdc28,0x12d));var _0x8dc2=function(_0x159fbb,_0x29fd53){_0x159fbb=_0x159fbb-0x0;var _0x2f6d72=_0xdc28[_0x159fbb];return _0x2f6d72;};'use strict';var multer=require(_0x8dc2('0x0'));var util=require(_0x8dc2('0x1'));var path=require(_0x8dc2('0x2'));var timeout=require(_0x8dc2('0x3'));var express=require(_0x8dc2('0x4'));var router=express[_0x8dc2('0x5')]();var fs_extra=require(_0x8dc2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8dc2('0x7'));var config=require(_0x8dc2('0x8'));var controller=require('./faxInteraction.controller');router[_0x8dc2('0x9')]('/',auth[_0x8dc2('0xa')](),controller[_0x8dc2('0xb')]);router['get'](_0x8dc2('0xc'),auth[_0x8dc2('0xa')](),controller[_0x8dc2('0xd')]);router['get'](_0x8dc2('0xe'),auth[_0x8dc2('0xa')](),controller[_0x8dc2('0xf')]);router[_0x8dc2('0x9')]('/:id/messages',auth[_0x8dc2('0xa')](),controller[_0x8dc2('0x10')]);router[_0x8dc2('0x9')](_0x8dc2('0x11'),auth[_0x8dc2('0xa')](),controller[_0x8dc2('0x12')]);router[_0x8dc2('0x13')]('/',auth[_0x8dc2('0xa')](),controller[_0x8dc2('0x14')]);router[_0x8dc2('0x13')](_0x8dc2('0x15'),auth['isAuthenticated'](),controller[_0x8dc2('0x16')]);router[_0x8dc2('0x13')]('/:id/tags',auth[_0x8dc2('0xa')](),interaction[_0x8dc2('0x17')](_0x8dc2('0x18'),_0x8dc2('0x19')),controller['addTags']);router[_0x8dc2('0x1a')](_0x8dc2('0xe'),auth[_0x8dc2('0xa')](),interaction['tracked'](_0x8dc2('0x18'),'faxinteraction:update'),controller[_0x8dc2('0x1b')]);router[_0x8dc2('0x1c')]('/:id',auth[_0x8dc2('0xa')](),interaction[_0x8dc2('0x17')](_0x8dc2('0x18'),_0x8dc2('0x1d')),controller[_0x8dc2('0x1e')]);router[_0x8dc2('0x1c')](_0x8dc2('0x1f'),auth['isAuthenticated'](),controller[_0x8dc2('0x20')]);module[_0x8dc2('0x21')]=router; \ No newline at end of file +var _0x4a25=['delete','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','/:id','fax','faxinteraction:update','update'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4a25,0x1d4));var _0x54a2=function(_0x41b0a8,_0x1b05cc){_0x41b0a8=_0x41b0a8-0x0;var _0x3a83d4=_0x4a25[_0x41b0a8];return _0x3a83d4;};'use strict';var multer=require(_0x54a2('0x0'));var util=require('util');var path=require(_0x54a2('0x1'));var timeout=require('connect-timeout');var express=require(_0x54a2('0x2'));var router=express[_0x54a2('0x3')]();var fs_extra=require(_0x54a2('0x4'));var auth=require(_0x54a2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x54a2('0x6'));var controller=require(_0x54a2('0x7'));router[_0x54a2('0x8')]('/',auth[_0x54a2('0x9')](),controller[_0x54a2('0xa')]);router['get'](_0x54a2('0xb'),auth[_0x54a2('0x9')](),controller[_0x54a2('0xc')]);router['get']('/:id',auth[_0x54a2('0x9')](),controller['show']);router[_0x54a2('0x8')](_0x54a2('0xd'),auth['isAuthenticated'](),controller[_0x54a2('0xe')]);router[_0x54a2('0x8')]('/:id/download',auth[_0x54a2('0x9')](),controller[_0x54a2('0xf')]);router['post']('/',auth[_0x54a2('0x9')](),controller[_0x54a2('0x10')]);router[_0x54a2('0x11')](_0x54a2('0xd'),auth[_0x54a2('0x9')](),controller[_0x54a2('0x12')]);router[_0x54a2('0x11')](_0x54a2('0x13'),auth['isAuthenticated'](),interaction[_0x54a2('0x14')]('fax',_0x54a2('0x15')),controller[_0x54a2('0x16')]);router[_0x54a2('0x17')](_0x54a2('0x18'),auth[_0x54a2('0x9')](),interaction[_0x54a2('0x14')](_0x54a2('0x19'),_0x54a2('0x1a')),controller[_0x54a2('0x1b')]);router[_0x54a2('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x54a2('0x19'),'faxinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x54a2('0x9')](),controller[_0x54a2('0x1d')]);module[_0x54a2('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index bf8392e..40c9e58 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 _0xd2ea=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2a8122,_0xd957e){_0x2a8122=_0x2a8122-0x0;var _0x49a5c7=_0xd2ea[_0x2a8122];return _0x49a5c7;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'body':{'type':Sequelize[_0xad2e('0x2')](_0xad2e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xad2e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xad2e('0x5')),'defaultValue':_0xad2e('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xad2e('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xad2e('0x6')]}}; \ No newline at end of file +var _0x0487=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x1b43f3,_0x5403ca){var _0x25960=function(_0x3cdc36){while(--_0x3cdc36){_0x1b43f3['push'](_0x1b43f3['shift']());}};_0x25960(++_0x5403ca);}(_0x0487,0x14f));var _0x7048=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x0487[_0x25662e];return _0x59b7bc;};'use strict';var Sequelize=require(_0x7048('0x0'));module[_0x7048('0x1')]={'body':{'type':Sequelize[_0x7048('0x2')](_0x7048('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7048('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7048('0x5')]('in','out'),'defaultValue':_0x7048('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7048('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d8c8063..22cba37 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 _0x7c1c=['limit','undefined','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','FaxMessage','fieldName','type','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','body','describe','../../config/logger','fax-interactions','accept','fax','readAt','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','event','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','server','files','basename','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7c1c,0xec));var _0xc7c1=function(_0x137556,_0x253216){_0x137556=_0x137556-0x0;var _0x41dc31=_0x7c1c[_0x137556];return _0x41dc31;};'use strict';var emlformat=require(_0xc7c1('0x0'));var rimraf=require(_0xc7c1('0x1'));var zipdir=require(_0xc7c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7c1('0x3'));var moment=require(_0xc7c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc7c1('0x5'));var util=require(_0xc7c1('0x6'));var path=require(_0xc7c1('0x7'));var sox=require(_0xc7c1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc7c1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc7c1('0xa'));var toCsv=require(_0xc7c1('0xb'));var querystring=require(_0xc7c1('0xc'));var Papa=require(_0xc7c1('0xd'));var Redis=require(_0xc7c1('0xe'));var authService=require(_0xc7c1('0xf'));var qs=require(_0xc7c1('0x10'));var as=require(_0xc7c1('0x11'));var hardwareService=require(_0xc7c1('0x12'));var logger=require('../../config/logger')(_0xc7c1('0x13'));var utils=require(_0xc7c1('0x14'));var config=require(_0xc7c1('0x15'));var licenseUtil=require(_0xc7c1('0x16'));var db=require(_0xc7c1('0x17'))['db'];config[_0xc7c1('0x18')]=_[_0xc7c1('0x19')](config[_0xc7c1('0x18')],{'host':_0xc7c1('0x1a'),'port':0x18eb});var socket=require(_0xc7c1('0x1b'))(new Redis(config[_0xc7c1('0x18')]));require(_0xc7c1('0x1c'))[_0xc7c1('0x1d')](socket);var jayson=require(_0xc7c1('0x1e'));var client=jayson[_0xc7c1('0x1f')][_0xc7c1('0x20')]({'port':0x232c});var client9002=jayson[_0xc7c1('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf58f2,_0x12caed,_0xe0ec65,_0x3888b6){return new BPromise(function(_0x4ff0f3,_0x2b96d5){var _0xb6e53c=_0x3888b6||client;return _0xb6e53c[_0xc7c1('0x21')](_0xaf58f2,_0xe0ec65)[_0xc7c1('0x22')](function(_0x11e253){logger[_0xc7c1('0x23')](_0xc7c1('0x24'),_0x12caed,'request\x20sent');logger[_0xc7c1('0x25')](_0xc7c1('0x26'),_0x12caed,'request\x20sent',JSON[_0xc7c1('0x27')](_0x11e253));if(_0x11e253['error']){if(_0x11e253[_0xc7c1('0x28')]['code']===0x1f4){logger['error'](_0xc7c1('0x24'),_0x12caed,_0x11e253['error'][_0xc7c1('0x29')]);return _0x2b96d5(_0x11e253[_0xc7c1('0x28')][_0xc7c1('0x29')]);}logger['error'](_0xc7c1('0x24'),_0x12caed,_0x11e253['error'][_0xc7c1('0x29')]);return _0x4ff0f3(_0x11e253['error'][_0xc7c1('0x29')]);}else{logger[_0xc7c1('0x23')](_0xc7c1('0x24'),_0x12caed,_0xc7c1('0x2a'));_0x4ff0f3(_0x11e253[_0xc7c1('0x2b')][_0xc7c1('0x29')]);}})[_0xc7c1('0x2c')](function(_0x18ce55){logger[_0xc7c1('0x28')](_0xc7c1('0x24'),_0x12caed,_0x18ce55);_0x2b96d5(_0x18ce55);});});}function respondWithStatusCode(_0x52e9fc,_0x5579cc){_0x5579cc=_0x5579cc||0xcc;return function(_0x1b9a6f){if(_0x1b9a6f){return _0x52e9fc[_0xc7c1('0x2d')](_0x5579cc);}return _0x52e9fc[_0xc7c1('0x2e')](_0x5579cc)[_0xc7c1('0x2f')]();};}function respondWithResult(_0x5a79e4,_0x29b3f4){_0x29b3f4=_0x29b3f4||0xc8;return function(_0x40bb20){if(_0x40bb20){return _0x5a79e4[_0xc7c1('0x2e')](_0x29b3f4)[_0xc7c1('0x30')](_0x40bb20);}};}function respondWithFilteredResult(_0x526777,_0x4012b5){return function(_0x23f44a){if(_0x23f44a){var _0x49bcc3=typeof _0x4012b5[_0xc7c1('0x31')]==='undefined'&&typeof _0x4012b5[_0xc7c1('0x32')]===_0xc7c1('0x33');var _0x146194=_0x23f44a['count'];var _0x3d604=_0x49bcc3?0x0:_0x4012b5[_0xc7c1('0x31')];var _0x207fae=_0x49bcc3?_0x23f44a[_0xc7c1('0x34')]:_0x4012b5[_0xc7c1('0x31')]+_0x4012b5[_0xc7c1('0x32')];var _0x37a4a5;if(_0x207fae>=_0x146194){_0x207fae=_0x146194;_0x37a4a5=0xc8;}else{_0x37a4a5=0xce;}_0x526777[_0xc7c1('0x2e')](_0x37a4a5);return _0x526777[_0xc7c1('0x35')](_0xc7c1('0x36'),_0x3d604+'-'+_0x207fae+'/'+_0x146194)['json'](_0x23f44a);}return null;};}function patchUpdates(_0x6cde0c){return function(_0x3b3bfd){try{jsonpatch[_0xc7c1('0x37')](_0x3b3bfd,_0x6cde0c,!![]);}catch(_0x58b245){return BPromise['reject'](_0x58b245);}return _0x3b3bfd[_0xc7c1('0x38')]();};}function saveUpdates(_0x2c4796,_0xd3acf1){return function(_0x4cd2bb){if(_0x4cd2bb){return _0x4cd2bb[_0xc7c1('0x39')](_0x2c4796)[_0xc7c1('0x22')](function(_0x337ac5){return _0x337ac5;});}return null;};}function removeEntity(_0x2e6f0d,_0x2531e6){return function(_0x3824de){if(_0x3824de){return _0x3824de[_0xc7c1('0x3a')]()[_0xc7c1('0x22')](function(){_0x2e6f0d[_0xc7c1('0x2e')](0xcc)[_0xc7c1('0x2f')]();});}};}function handleEntityNotFound(_0x541b5f,_0x4e985e){return function(_0x178dd5){if(!_0x178dd5){_0x541b5f[_0xc7c1('0x2d')](0x194);}return _0x178dd5;};}function handleError(_0x213cf0,_0x466ecf){_0x466ecf=_0x466ecf||0x1f4;return function(_0x1befa9){logger[_0xc7c1('0x28')](_0x1befa9[_0xc7c1('0x3b')]);if(_0x1befa9['name']){delete _0x1befa9[_0xc7c1('0x3c')];}_0x213cf0[_0xc7c1('0x2e')](_0x466ecf)[_0xc7c1('0x3d')](_0x1befa9);};}exports[_0xc7c1('0x3e')]=function(_0x34e26f,_0x4e39cc){var _0x109546={},_0x9b829a={},_0x310e06={'count':0x0,'rows':[]};var _0x82662e=_[_0xc7c1('0x3f')](db[_0xc7c1('0x40')]['rawAttributes'],function(_0x47814b){return{'name':_0x47814b[_0xc7c1('0x41')],'type':_0x47814b[_0xc7c1('0x42')][_0xc7c1('0x43')]};});_0x9b829a[_0xc7c1('0x44')]=_['map'](_0x82662e,_0xc7c1('0x3c'));_0x9b829a['query']=_['keys'](_0x34e26f['query']);_0x9b829a[_0xc7c1('0x45')]=_[_0xc7c1('0x46')](_0x9b829a[_0xc7c1('0x44')],_0x9b829a['query']);_0x109546[_0xc7c1('0x47')]=_['intersection'](_0x9b829a['model'],qs[_0xc7c1('0x48')](_0x34e26f[_0xc7c1('0x49')][_0xc7c1('0x48')]));_0x109546[_0xc7c1('0x47')]=_0x109546[_0xc7c1('0x47')][_0xc7c1('0x4a')]?_0x109546['attributes']:_0x9b829a[_0xc7c1('0x44')];if(!_0x34e26f['query'][_0xc7c1('0x4b')](_0xc7c1('0x4c'))){_0x109546['limit']=qs[_0xc7c1('0x32')](_0x34e26f[_0xc7c1('0x49')]['limit']);_0x109546[_0xc7c1('0x31')]=qs[_0xc7c1('0x31')](_0x34e26f['query'][_0xc7c1('0x31')]);}_0x109546[_0xc7c1('0x4d')]=qs['sort'](_0x34e26f[_0xc7c1('0x49')][_0xc7c1('0x4e')]);_0x109546[_0xc7c1('0x4f')]=qs[_0xc7c1('0x45')](_['pick'](_0x34e26f[_0xc7c1('0x49')],_0x9b829a[_0xc7c1('0x45')]),_0x82662e);if(_0x34e26f[_0xc7c1('0x49')]['filter']){_0x109546[_0xc7c1('0x4f')]=_[_0xc7c1('0x50')](_0x109546[_0xc7c1('0x4f')],{'$or':_['map'](_0x82662e,function(_0x57eded){if(_0x57eded[_0xc7c1('0x42')]!==_0xc7c1('0x51')){var _0x252579={};_0x252579[_0x57eded[_0xc7c1('0x3c')]]={'$like':'%'+_0x34e26f[_0xc7c1('0x49')]['filter']+'%'};return _0x252579;}})});}_0x109546=_[_0xc7c1('0x50')]({},_0x109546,_0x34e26f[_0xc7c1('0x52')]);var _0x2a073a={'where':_0x109546[_0xc7c1('0x4f')]};return db[_0xc7c1('0x40')][_0xc7c1('0x34')](_0x2a073a)['then'](function(_0x2798d8){_0x310e06[_0xc7c1('0x34')]=_0x2798d8;if(_0x34e26f[_0xc7c1('0x49')]['includeAll']){_0x109546[_0xc7c1('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0xc7c1('0x54')](_0x109546);})[_0xc7c1('0x22')](function(_0x2df30d){_0x310e06[_0xc7c1('0x55')]=_0x2df30d;return _0x310e06;})[_0xc7c1('0x22')](respondWithFilteredResult(_0x4e39cc,_0x109546))[_0xc7c1('0x2c')](handleError(_0x4e39cc,null));};exports[_0xc7c1('0x56')]=function(_0x30c882,_0x163595){var _0x43b8be={'raw':!![],'where':{'id':_0x30c882[_0xc7c1('0x57')]['id']}},_0x847555={};_0x847555[_0xc7c1('0x44')]=_[_0xc7c1('0x58')](db['FaxMessage'][_0xc7c1('0x59')]);_0x847555[_0xc7c1('0x49')]=_[_0xc7c1('0x58')](_0x30c882[_0xc7c1('0x49')]);_0x847555[_0xc7c1('0x45')]=_['intersection'](_0x847555['model'],_0x847555[_0xc7c1('0x49')]);_0x43b8be[_0xc7c1('0x47')]=_[_0xc7c1('0x46')](_0x847555['model'],qs[_0xc7c1('0x48')](_0x30c882[_0xc7c1('0x49')][_0xc7c1('0x48')]));_0x43b8be['attributes']=_0x43b8be['attributes'][_0xc7c1('0x4a')]?_0x43b8be['attributes']:_0x847555[_0xc7c1('0x44')];if(_0x30c882[_0xc7c1('0x49')][_0xc7c1('0x5a')]){_0x43b8be[_0xc7c1('0x53')]=[{'all':!![]}];}_0x43b8be=_[_0xc7c1('0x50')]({},_0x43b8be,_0x30c882[_0xc7c1('0x52')]);return db[_0xc7c1('0x40')][_0xc7c1('0x5b')](_0x43b8be)[_0xc7c1('0x22')](handleEntityNotFound(_0x163595,null))['then'](respondWithResult(_0x163595,null))[_0xc7c1('0x2c')](handleError(_0x163595,null));};exports[_0xc7c1('0x39')]=function(_0x180c42,_0x6be866){if(_0x180c42[_0xc7c1('0x5c')]['id']){delete _0x180c42[_0xc7c1('0x5c')]['id'];}return db[_0xc7c1('0x40')][_0xc7c1('0x5b')]({'where':{'id':_0x180c42[_0xc7c1('0x57')]['id']}})[_0xc7c1('0x22')](handleEntityNotFound(_0x6be866,null))[_0xc7c1('0x22')](saveUpdates(_0x180c42[_0xc7c1('0x5c')],null))['then'](respondWithResult(_0x6be866,null))[_0xc7c1('0x2c')](handleError(_0x6be866,null));};exports[_0xc7c1('0x3a')]=function(_0x2a3c4b,_0x283a34){return db['FaxMessage'][_0xc7c1('0x5b')]({'where':{'id':_0x2a3c4b[_0xc7c1('0x57')]['id']}})[_0xc7c1('0x22')](handleEntityNotFound(_0x283a34,null))[_0xc7c1('0x22')](removeEntity(_0x283a34,null))[_0xc7c1('0x2c')](handleError(_0x283a34,null));};exports[_0xc7c1('0x5d')]=function(_0xa4e42f,_0x191f50){return db[_0xc7c1('0x40')][_0xc7c1('0x5d')]()[_0xc7c1('0x22')](respondWithResult(_0x191f50,null))[_0xc7c1('0x2c')](handleError(_0x191f50,null));};var interaction_log=require(_0xc7c1('0x5e'))(_0xc7c1('0x5f'));exports[_0xc7c1('0x60')]=function(_0x171030,_0x4d8831,_0x413246){var _0x3470cb={'agent':{},'channel':_0xc7c1('0x61')};if(_0x171030['body']['id']){delete _0x171030[_0xc7c1('0x5c')]['id'];}_0x171030[_0xc7c1('0x5c')]['read']=!![];_0x171030['body'][_0xc7c1('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x171030[_0xc7c1('0x5c')][_0xc7c1('0x63')]=_0x171030[_0xc7c1('0x5c')][_0xc7c1('0x63')]||_0x171030[_0xc7c1('0x64')]['id'];_0x3470cb[_0xc7c1('0x65')]['id']=_0x171030['body'][_0xc7c1('0x63')];return db[_0xc7c1('0x40')]['find']({'where':{'id':_0x171030[_0xc7c1('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d8831,null))[_0xc7c1('0x22')](saveUpdates(_0x171030[_0xc7c1('0x5c')],null))[_0xc7c1('0x22')](function(_0x2092b7){if(_0x2092b7){_0x3470cb['message']=_0x2092b7[_0xc7c1('0x66')]({'plain':!![]});return db[_0xc7c1('0x67')][_0xc7c1('0x5b')]({'where':{'id':_0x2092b7[_0xc7c1('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x4d8831,null))[_0xc7c1('0x22')](function(_0x524753){if(_0x524753){return _0x524753[_0xc7c1('0x39')]({'UserId':_0x171030[_0xc7c1('0x5c')][_0xc7c1('0x63')],'read1stAt':_[_0xc7c1('0x69')](_0x524753[_0xc7c1('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc7c1('0x22')](function(_0x3ac17f){if(_0x3ac17f){_0x3470cb[_0xc7c1('0x6b')]=_0x3ac17f[_0xc7c1('0x66')]({'plain':!![]});interaction_log[_0xc7c1('0x23')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x171030[_0xc7c1('0x64')]['id'],_0x171030[_0xc7c1('0x64')][_0xc7c1('0x3c')],_0x171030[_0xc7c1('0x64')][_0xc7c1('0x6c')],_0x3470cb[_0xc7c1('0x6b')]['id'],_0x171030[_0xc7c1('0x5c')]?JSON['stringify'](_0x171030[_0xc7c1('0x5c')]):_0xc7c1('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3470cb);}return null;})[_0xc7c1('0x22')](function(_0x564aac){var _0x1a4755=_0xc7c1('0x6e')+_0x564aac['message'][_0xc7c1('0x6f')];return db[_0xc7c1('0x70')][_0xc7c1('0x49')](_0x1a4755,{'type':db[_0xc7c1('0x71')][_0xc7c1('0x72')][_0xc7c1('0x73')],'raw':!![]})[_0xc7c1('0x22')](function(_0x1058e0){return _0x1058e0;});})['then'](function(_0x421775){if(_0x421775){_0x3470cb[_0xc7c1('0x29')][_0xc7c1('0x74')]=_0x421775[0x0];if(!_0x171030[_0xc7c1('0x5c')][_0xc7c1('0x63')])return;return db[_0xc7c1('0x75')][_0xc7c1('0x5b')]({'where':{'id':_0x171030['body'][_0xc7c1('0x63')],'role':_0xc7c1('0x65')},'attributes':['id',_0xc7c1('0x3c'),'fullname',_0xc7c1('0x76'),_0xc7c1('0x77')],'raw':!![]});}return null;})['then'](function(_0x4fbd10){if(!_0x4fbd10)return null;_0x3470cb[_0xc7c1('0x29')][_0xc7c1('0x65')]=_0x4fbd10;return _0x3470cb;})[_0xc7c1('0x22')](function(_0x26bdb4){if(_0x26bdb4){if(_0x171030[_0xc7c1('0x5c')]['manual']){_0x3470cb[_0xc7c1('0x29')][_0xc7c1('0x78')]=util[_0xc7c1('0x79')](_0xc7c1('0x7a'),_0x171030[_0xc7c1('0x64')][_0xc7c1('0x3c')]);_0x3470cb[_0xc7c1('0x29')][_0xc7c1('0x7b')]=_0x3470cb[_0xc7c1('0x7b')];_0x3470cb[_0xc7c1('0x29')][_0xc7c1('0x7c')]=_0x3470cb[_0xc7c1('0x7b')];_0x3470cb[_0xc7c1('0x29')]['event']=_0xc7c1('0x60');return respondWithRpcPromise(_0xc7c1('0x7d'),_0xc7c1('0x7d'),{'event':_0xc7c1('0x7e'),'message':_0x3470cb['message']},client9002)[_0xc7c1('0x22')](function(){return _0x3470cb;});}return _0x3470cb;}return null;})[_0xc7c1('0x22')](respondWithResult(_0x4d8831,null))[_0xc7c1('0x2c')](handleError(_0x4d8831,null));};var interaction_log=require(_0xc7c1('0x5e'))('fax-interactions');exports[_0xc7c1('0x7f')]=function(_0x3292db,_0x309a3e,_0x342211){var _0x175c0f={'agent':{},'channel':_0xc7c1('0x61')};if(_0x3292db[_0xc7c1('0x5c')]['id']){delete _0x3292db[_0xc7c1('0x5c')]['id'];}_0x3292db[_0xc7c1('0x5c')][_0xc7c1('0x63')]=_0x3292db[_0xc7c1('0x5c')][_0xc7c1('0x63')]||_0x3292db['user']['id'];_0x175c0f[_0xc7c1('0x65')]['id']=_0x3292db[_0xc7c1('0x5c')]['UserId'];return db['FaxMessage'][_0xc7c1('0x5b')]({'where':{'id':_0x3292db[_0xc7c1('0x57')]['id'],'UserId':null}})[_0xc7c1('0x22')](handleEntityNotFound(_0x309a3e,null))[_0xc7c1('0x22')](function(_0x4affa9){if(_0x4affa9){_0x175c0f[_0xc7c1('0x29')]=_0x4affa9[_0xc7c1('0x66')]({'plain':!![]});return db[_0xc7c1('0x67')][_0xc7c1('0x5b')]({'where':{'id':_0x4affa9[_0xc7c1('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x309a3e,null))[_0xc7c1('0x22')](function(_0x3addec){if(_0x3addec){_0x175c0f[_0xc7c1('0x6b')]=_0x3addec[_0xc7c1('0x66')]({'plain':!![]});interaction_log[_0xc7c1('0x23')](_0xc7c1('0x80'),_0x3292db[_0xc7c1('0x64')]['id'],_0x3292db[_0xc7c1('0x64')][_0xc7c1('0x3c')],_0x3292db[_0xc7c1('0x64')][_0xc7c1('0x6c')],_0x175c0f[_0xc7c1('0x6b')]['id'],_0x3292db[_0xc7c1('0x5c')]?JSON[_0xc7c1('0x27')](_0x3292db['body']):_0xc7c1('0x6d'));return respondWithRpcPromise(_0xc7c1('0x81'),'rejectMessage',_0x175c0f);}return null;})[_0xc7c1('0x22')](function(_0x30c492){var _0x2dfdb3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30c492[_0xc7c1('0x29')][_0xc7c1('0x6f')];return db[_0xc7c1('0x70')][_0xc7c1('0x49')](_0x2dfdb3,{'type':db['Sequelize'][_0xc7c1('0x72')]['SELECT'],'raw':!![]})[_0xc7c1('0x22')](function(_0x223005){return _0x223005;});})['then'](function(_0x386ad2){if(_0x386ad2){_0x175c0f[_0xc7c1('0x29')][_0xc7c1('0x74')]=_0x386ad2[0x0];if(!_0x3292db[_0xc7c1('0x5c')]['UserId'])return;return db[_0xc7c1('0x75')][_0xc7c1('0x5b')]({'where':{'id':_0x3292db['body'][_0xc7c1('0x63')],'role':_0xc7c1('0x65')},'attributes':['id',_0xc7c1('0x3c'),'fullname',_0xc7c1('0x76'),_0xc7c1('0x77')],'raw':!![]});}return null;})[_0xc7c1('0x22')](function(_0x2ec57e){if(!_0x2ec57e)return null;_0x175c0f['message']['agent']=_0x2ec57e;return _0x175c0f;})[_0xc7c1('0x22')](function(_0x56b3fb){if(_0x56b3fb){_0x56b3fb['message'][_0xc7c1('0x78')]=util['format'](_0xc7c1('0x7a'),_0x3292db[_0xc7c1('0x64')][_0xc7c1('0x3c')]);_0x56b3fb[_0xc7c1('0x29')][_0xc7c1('0x7b')]=_0x175c0f['channel'];_0x56b3fb['message']['motionChannel']=_0x175c0f[_0xc7c1('0x7b')];_0x56b3fb[_0xc7c1('0x29')][_0xc7c1('0x82')]=_0xc7c1('0x7f');respondWithRpcPromise(_0xc7c1('0x7d'),_0xc7c1('0x7d'),{'event':_0xc7c1('0x83'),'message':_0x56b3fb[_0xc7c1('0x29')]},client9002);return _0x175c0f;}return null;})[_0xc7c1('0x22')](respondWithResult(_0x309a3e,null))[_0xc7c1('0x2c')](handleError(_0x309a3e,null));};exports[_0xc7c1('0x84')]=function(_0x3efd23,_0x33c8cd){var _0x25f412;return db['FaxMessage']['create'](_0x3efd23[_0xc7c1('0x5c')],{})['then'](function(_0x3bb354){_0x25f412=_0x3bb354;return db['CmContact'][_0xc7c1('0x85')]({'where':{'id':_0x25f412['ContactId']}});})['then'](function(_0x4ea20e){if(_[_0xc7c1('0x69')](_0x4ea20e)){return;}else{_0x25f412[_0xc7c1('0x61')]=_0x4ea20e[_0xc7c1('0x61')];return db[_0xc7c1('0x86')]['findOne']({'where':{'id':_0x25f412[_0xc7c1('0x87')]}});}})[_0xc7c1('0x22')](function(_0x4cb712){return respondWithRpcPromise(_0xc7c1('0x88'),'SendFax',{'FaxAccountId':_[_0xc7c1('0x69')](_0x3efd23[_0xc7c1('0x5c')])?undefined:_0x3efd23[_0xc7c1('0x5c')]['FaxAccountId'],'path':_[_0xc7c1('0x69')](_0x4cb712)?undefined:util['format'](_0xc7c1('0x89'),_0x4cb712['basename']),'fax':_[_0xc7c1('0x69')](_0x25f412[_0xc7c1('0x61')])?undefined:_0x25f412[_0xc7c1('0x61')],'AttachmentId':_0x25f412[_0xc7c1('0x87')]},client9002);})[_0xc7c1('0x22')](respondWithResult(_0x33c8cd,0xc9))[_0xc7c1('0x2c')](handleError(_0x33c8cd,null));};exports[_0xc7c1('0x8a')]=function(_0x53e78d,_0x340945){var _0x1296bc=path[_0xc7c1('0x8b')](config['root'],_0xc7c1('0x8c'),_0xc7c1('0x8d'),'attachments');return db[_0xc7c1('0x40')]['find']({'where':{'id':_0x53e78d['params']['id']},'include':[{'model':db[_0xc7c1('0x86')],'as':_0xc7c1('0x86')}]})['then'](handleEntityNotFound(_0x340945,null))[_0xc7c1('0x22')](function(_0x44e3e8){if(_0x44e3e8){return _0x340945['download'](path[_0xc7c1('0x8b')](_0x1296bc,_0x44e3e8[_0xc7c1('0x86')][_0xc7c1('0x8e')]));}})[_0xc7c1('0x2c')](handleError(_0x340945,null));}; \ No newline at end of file +var _0x7a59=['basename','download','join','root','server','files','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','index','map','FaxMessage','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','show','rawAttributes','length','include','body','find','params','fax-interactions','accept','read','readAt','format','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','FaxInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','fullname','motionChannel','event','rejectmessage','create','CmContact','findOne','fax','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x7a59,0x96));var _0x97a5=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x7a59[_0x365e54];return _0x13317a;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require('mustache');var util=require(_0x97a5('0x5'));var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require(_0x97a5('0x9'));var fs=require('fs');var fs_extra=require(_0x97a5('0xa'));var _=require(_0x97a5('0xb'));var squel=require(_0x97a5('0xc'));var crypto=require('crypto');var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require(_0x97a5('0xf'));var Papa=require(_0x97a5('0x10'));var Redis=require(_0x97a5('0x11'));var authService=require(_0x97a5('0x12'));var qs=require(_0x97a5('0x13'));var as=require(_0x97a5('0x14'));var hardwareService=require(_0x97a5('0x15'));var logger=require(_0x97a5('0x16'))('api');var utils=require(_0x97a5('0x17'));var config=require(_0x97a5('0x18'));var licenseUtil=require(_0x97a5('0x19'));var db=require(_0x97a5('0x1a'))['db'];config['redis']=_[_0x97a5('0x1b')](config[_0x97a5('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x97a5('0x1d'))(new Redis(config['redis']));require(_0x97a5('0x1e'))[_0x97a5('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x97a5('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x97a5('0x20')][_0x97a5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1ef963,_0x3fda79,_0x2b8250,_0x24df9e){return new BPromise(function(_0x361955,_0x1c1c34){var _0x1d1898=_0x24df9e||client;return _0x1d1898[_0x97a5('0x22')](_0x1ef963,_0x2b8250)[_0x97a5('0x23')](function(_0x3eff5a){logger[_0x97a5('0x24')](_0x97a5('0x25'),_0x3fda79,'request\x20sent');logger[_0x97a5('0x26')](_0x97a5('0x27'),_0x3fda79,_0x97a5('0x28'),JSON[_0x97a5('0x29')](_0x3eff5a));if(_0x3eff5a['error']){if(_0x3eff5a[_0x97a5('0x2a')][_0x97a5('0x2b')]===0x1f4){logger[_0x97a5('0x2a')](_0x97a5('0x25'),_0x3fda79,_0x3eff5a[_0x97a5('0x2a')][_0x97a5('0x2c')]);return _0x1c1c34(_0x3eff5a[_0x97a5('0x2a')][_0x97a5('0x2c')]);}logger['error'](_0x97a5('0x25'),_0x3fda79,_0x3eff5a[_0x97a5('0x2a')][_0x97a5('0x2c')]);return _0x361955(_0x3eff5a[_0x97a5('0x2a')][_0x97a5('0x2c')]);}else{logger[_0x97a5('0x24')](_0x97a5('0x25'),_0x3fda79,'request\x20sent');_0x361955(_0x3eff5a[_0x97a5('0x2d')][_0x97a5('0x2c')]);}})[_0x97a5('0x2e')](function(_0x154e0e){logger['error'](_0x97a5('0x25'),_0x3fda79,_0x154e0e);_0x1c1c34(_0x154e0e);});});}function respondWithStatusCode(_0x5ca207,_0x2d2564){_0x2d2564=_0x2d2564||0xcc;return function(_0x588910){if(_0x588910){return _0x5ca207[_0x97a5('0x2f')](_0x2d2564);}return _0x5ca207[_0x97a5('0x30')](_0x2d2564)[_0x97a5('0x31')]();};}function respondWithResult(_0xde4e0c,_0x4b8fd7){_0x4b8fd7=_0x4b8fd7||0xc8;return function(_0x3efac5){if(_0x3efac5){return _0xde4e0c[_0x97a5('0x30')](_0x4b8fd7)[_0x97a5('0x32')](_0x3efac5);}};}function respondWithFilteredResult(_0x2ec389,_0x57fd68){return function(_0x30d581){if(_0x30d581){var _0x4a6ec1=typeof _0x57fd68[_0x97a5('0x33')]===_0x97a5('0x34')&&typeof _0x57fd68[_0x97a5('0x35')]===_0x97a5('0x34');var _0x51c0d6=_0x30d581[_0x97a5('0x36')];var _0x34a68d=_0x4a6ec1?0x0:_0x57fd68[_0x97a5('0x33')];var _0x3f2ccb=_0x4a6ec1?_0x30d581['count']:_0x57fd68['offset']+_0x57fd68[_0x97a5('0x35')];var _0x26d4ee;if(_0x3f2ccb>=_0x51c0d6){_0x3f2ccb=_0x51c0d6;_0x26d4ee=0xc8;}else{_0x26d4ee=0xce;}_0x2ec389[_0x97a5('0x30')](_0x26d4ee);return _0x2ec389[_0x97a5('0x37')](_0x97a5('0x38'),_0x34a68d+'-'+_0x3f2ccb+'/'+_0x51c0d6)[_0x97a5('0x32')](_0x30d581);}return null;};}function patchUpdates(_0x143d15){return function(_0x183eff){try{jsonpatch['apply'](_0x183eff,_0x143d15,!![]);}catch(_0xab6349){return BPromise[_0x97a5('0x39')](_0xab6349);}return _0x183eff['save']();};}function saveUpdates(_0x29e71c,_0xcf0c11){return function(_0x18aff2){if(_0x18aff2){return _0x18aff2[_0x97a5('0x3a')](_0x29e71c)[_0x97a5('0x23')](function(_0x3980b3){return _0x3980b3;});}return null;};}function removeEntity(_0x304aa5,_0x549974){return function(_0x2319d3){if(_0x2319d3){return _0x2319d3[_0x97a5('0x3b')]()[_0x97a5('0x23')](function(){_0x304aa5[_0x97a5('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f67d,_0xcf958d){return function(_0x147f50){if(!_0x147f50){_0x33f67d[_0x97a5('0x2f')](0x194);}return _0x147f50;};}function handleError(_0x3eae9,_0x10089b){_0x10089b=_0x10089b||0x1f4;return function(_0x5991fe){logger[_0x97a5('0x2a')](_0x5991fe[_0x97a5('0x3c')]);if(_0x5991fe[_0x97a5('0x3d')]){delete _0x5991fe[_0x97a5('0x3d')];}_0x3eae9[_0x97a5('0x30')](_0x10089b)['send'](_0x5991fe);};}exports[_0x97a5('0x3e')]=function(_0x33699c,_0x227f2b){var _0x5ce779={},_0x3abd19={},_0x510057={'count':0x0,'rows':[]};var _0x2cf030=_[_0x97a5('0x3f')](db[_0x97a5('0x40')]['rawAttributes'],function(_0x3100f8){return{'name':_0x3100f8[_0x97a5('0x41')],'type':_0x3100f8[_0x97a5('0x42')]['key']};});_0x3abd19[_0x97a5('0x43')]=_['map'](_0x2cf030,'name');_0x3abd19[_0x97a5('0x44')]=_[_0x97a5('0x45')](_0x33699c[_0x97a5('0x44')]);_0x3abd19[_0x97a5('0x46')]=_['intersection'](_0x3abd19[_0x97a5('0x43')],_0x3abd19[_0x97a5('0x44')]);_0x5ce779[_0x97a5('0x47')]=_[_0x97a5('0x48')](_0x3abd19[_0x97a5('0x43')],qs[_0x97a5('0x49')](_0x33699c[_0x97a5('0x44')][_0x97a5('0x49')]));_0x5ce779[_0x97a5('0x47')]=_0x5ce779['attributes']['length']?_0x5ce779[_0x97a5('0x47')]:_0x3abd19[_0x97a5('0x43')];if(!_0x33699c[_0x97a5('0x44')][_0x97a5('0x4a')](_0x97a5('0x4b'))){_0x5ce779[_0x97a5('0x35')]=qs[_0x97a5('0x35')](_0x33699c[_0x97a5('0x44')][_0x97a5('0x35')]);_0x5ce779['offset']=qs[_0x97a5('0x33')](_0x33699c[_0x97a5('0x44')][_0x97a5('0x33')]);}_0x5ce779[_0x97a5('0x4c')]=qs[_0x97a5('0x4d')](_0x33699c[_0x97a5('0x44')][_0x97a5('0x4d')]);_0x5ce779['where']=qs[_0x97a5('0x46')](_['pick'](_0x33699c[_0x97a5('0x44')],_0x3abd19['filters']),_0x2cf030);if(_0x33699c['query'][_0x97a5('0x4e')]){_0x5ce779[_0x97a5('0x4f')]=_[_0x97a5('0x50')](_0x5ce779['where'],{'$or':_[_0x97a5('0x3f')](_0x2cf030,function(_0xc4c3b7){if(_0xc4c3b7[_0x97a5('0x42')]!==_0x97a5('0x51')){var _0x50397c={};_0x50397c[_0xc4c3b7[_0x97a5('0x3d')]]={'$like':'%'+_0x33699c[_0x97a5('0x44')]['filter']+'%'};return _0x50397c;}})});}_0x5ce779=_[_0x97a5('0x50')]({},_0x5ce779,_0x33699c[_0x97a5('0x52')]);var _0x237a7e={'where':_0x5ce779[_0x97a5('0x4f')]};return db['FaxMessage'][_0x97a5('0x36')](_0x237a7e)[_0x97a5('0x23')](function(_0x2c8ba2){_0x510057[_0x97a5('0x36')]=_0x2c8ba2;if(_0x33699c[_0x97a5('0x44')]['includeAll']){_0x5ce779['include']=[{'all':!![]}];}return db[_0x97a5('0x40')][_0x97a5('0x53')](_0x5ce779);})['then'](function(_0x417466){_0x510057['rows']=_0x417466;return _0x510057;})[_0x97a5('0x23')](respondWithFilteredResult(_0x227f2b,_0x5ce779))['catch'](handleError(_0x227f2b,null));};exports[_0x97a5('0x54')]=function(_0x17d9dc,_0x4201ed){var _0x1e2679={'raw':!![],'where':{'id':_0x17d9dc['params']['id']}},_0x2b9ecc={};_0x2b9ecc[_0x97a5('0x43')]=_[_0x97a5('0x45')](db[_0x97a5('0x40')][_0x97a5('0x55')]);_0x2b9ecc[_0x97a5('0x44')]=_[_0x97a5('0x45')](_0x17d9dc[_0x97a5('0x44')]);_0x2b9ecc[_0x97a5('0x46')]=_['intersection'](_0x2b9ecc[_0x97a5('0x43')],_0x2b9ecc[_0x97a5('0x44')]);_0x1e2679[_0x97a5('0x47')]=_[_0x97a5('0x48')](_0x2b9ecc[_0x97a5('0x43')],qs[_0x97a5('0x49')](_0x17d9dc['query'][_0x97a5('0x49')]));_0x1e2679[_0x97a5('0x47')]=_0x1e2679[_0x97a5('0x47')][_0x97a5('0x56')]?_0x1e2679[_0x97a5('0x47')]:_0x2b9ecc[_0x97a5('0x43')];if(_0x17d9dc[_0x97a5('0x44')]['includeAll']){_0x1e2679[_0x97a5('0x57')]=[{'all':!![]}];}_0x1e2679=_[_0x97a5('0x50')]({},_0x1e2679,_0x17d9dc[_0x97a5('0x52')]);return db[_0x97a5('0x40')]['find'](_0x1e2679)[_0x97a5('0x23')](handleEntityNotFound(_0x4201ed,null))[_0x97a5('0x23')](respondWithResult(_0x4201ed,null))[_0x97a5('0x2e')](handleError(_0x4201ed,null));};exports[_0x97a5('0x3a')]=function(_0x5e7f52,_0x9181cf){if(_0x5e7f52[_0x97a5('0x58')]['id']){delete _0x5e7f52[_0x97a5('0x58')]['id'];}return db[_0x97a5('0x40')][_0x97a5('0x59')]({'where':{'id':_0x5e7f52[_0x97a5('0x5a')]['id']}})[_0x97a5('0x23')](handleEntityNotFound(_0x9181cf,null))['then'](saveUpdates(_0x5e7f52['body'],null))[_0x97a5('0x23')](respondWithResult(_0x9181cf,null))[_0x97a5('0x2e')](handleError(_0x9181cf,null));};exports[_0x97a5('0x3b')]=function(_0x33ae62,_0x146564){return db['FaxMessage'][_0x97a5('0x59')]({'where':{'id':_0x33ae62[_0x97a5('0x5a')]['id']}})[_0x97a5('0x23')](handleEntityNotFound(_0x146564,null))[_0x97a5('0x23')](removeEntity(_0x146564,null))[_0x97a5('0x2e')](handleError(_0x146564,null));};exports['describe']=function(_0x2acacd,_0x2b27e0){return db[_0x97a5('0x40')]['describe']()[_0x97a5('0x23')](respondWithResult(_0x2b27e0,null))[_0x97a5('0x2e')](handleError(_0x2b27e0,null));};var interaction_log=require('../../config/logger')(_0x97a5('0x5b'));exports[_0x97a5('0x5c')]=function(_0x427753,_0x4fb813,_0x12c72c){var _0x3b8530={'agent':{},'channel':'fax'};if(_0x427753[_0x97a5('0x58')]['id']){delete _0x427753['body']['id'];}_0x427753[_0x97a5('0x58')][_0x97a5('0x5d')]=!![];_0x427753[_0x97a5('0x58')][_0x97a5('0x5e')]=moment()[_0x97a5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x427753[_0x97a5('0x58')][_0x97a5('0x60')]=_0x427753[_0x97a5('0x58')][_0x97a5('0x60')]||_0x427753[_0x97a5('0x61')]['id'];_0x3b8530[_0x97a5('0x62')]['id']=_0x427753[_0x97a5('0x58')][_0x97a5('0x60')];return db[_0x97a5('0x40')][_0x97a5('0x59')]({'where':{'id':_0x427753['params']['id'],'UserId':null}})[_0x97a5('0x23')](handleEntityNotFound(_0x4fb813,null))[_0x97a5('0x23')](saveUpdates(_0x427753['body'],null))[_0x97a5('0x23')](function(_0x39eddc){if(_0x39eddc){_0x3b8530[_0x97a5('0x2c')]=_0x39eddc[_0x97a5('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x97a5('0x59')]({'where':{'id':_0x39eddc[_0x97a5('0x64')]}});}return null;})[_0x97a5('0x23')](handleEntityNotFound(_0x4fb813,null))[_0x97a5('0x23')](function(_0x3c6f){if(_0x3c6f){return _0x3c6f[_0x97a5('0x3a')]({'UserId':_0x427753['body'][_0x97a5('0x60')],'read1stAt':_[_0x97a5('0x65')](_0x3c6f[_0x97a5('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x97a5('0x23')](function(_0x1b778c){if(_0x1b778c){_0x3b8530[_0x97a5('0x67')]=_0x1b778c['get']({'plain':!![]});interaction_log['info'](_0x97a5('0x68'),_0x427753['user']['id'],_0x427753[_0x97a5('0x61')][_0x97a5('0x3d')],_0x427753[_0x97a5('0x61')][_0x97a5('0x69')],_0x3b8530[_0x97a5('0x67')]['id'],_0x427753[_0x97a5('0x58')]?JSON['stringify'](_0x427753[_0x97a5('0x58')]):_0x97a5('0x6a'));return respondWithRpcPromise(_0x97a5('0x6b'),_0x97a5('0x6c'),_0x3b8530);}return null;})[_0x97a5('0x23')](function(_0x3aa694){var _0x39821d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3aa694['message']['ContactId'];return db[_0x97a5('0x6d')]['query'](_0x39821d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x97a5('0x23')](function(_0x1f2b82){return _0x1f2b82;});})[_0x97a5('0x23')](function(_0x4f9c4c){if(_0x4f9c4c){_0x3b8530[_0x97a5('0x2c')][_0x97a5('0x6e')]=_0x4f9c4c[0x0];if(!_0x427753[_0x97a5('0x58')]['UserId'])return;return db[_0x97a5('0x6f')][_0x97a5('0x59')]({'where':{'id':_0x427753[_0x97a5('0x58')][_0x97a5('0x60')],'role':_0x97a5('0x62')},'attributes':['id',_0x97a5('0x3d'),'fullname',_0x97a5('0x70'),_0x97a5('0x71')],'raw':!![]});}return null;})[_0x97a5('0x23')](function(_0x33ad08){if(!_0x33ad08)return null;_0x3b8530[_0x97a5('0x2c')][_0x97a5('0x62')]=_0x33ad08;return _0x3b8530;})[_0x97a5('0x23')](function(_0x3ae866){if(_0x3ae866){if(_0x427753[_0x97a5('0x58')][_0x97a5('0x72')]){_0x3b8530[_0x97a5('0x2c')][_0x97a5('0x73')]=util['format'](_0x97a5('0x74'),_0x427753['user']['name']);_0x3b8530['message'][_0x97a5('0x75')]=_0x3b8530['channel'];_0x3b8530[_0x97a5('0x2c')]['motionChannel']=_0x3b8530[_0x97a5('0x75')];_0x3b8530[_0x97a5('0x2c')]['event']='accept';return respondWithRpcPromise(_0x97a5('0x76'),'EventManager',{'event':_0x97a5('0x77'),'message':_0x3b8530[_0x97a5('0x2c')]},client9002)[_0x97a5('0x23')](function(){return _0x3b8530;});}return _0x3b8530;}return null;})['then'](respondWithResult(_0x4fb813,null))[_0x97a5('0x2e')](handleError(_0x4fb813,null));};var interaction_log=require(_0x97a5('0x16'))(_0x97a5('0x5b'));exports[_0x97a5('0x39')]=function(_0x343784,_0x195f22,_0x45ac57){var _0x2eda77={'agent':{},'channel':'fax'};if(_0x343784[_0x97a5('0x58')]['id']){delete _0x343784[_0x97a5('0x58')]['id'];}_0x343784[_0x97a5('0x58')]['UserId']=_0x343784[_0x97a5('0x58')][_0x97a5('0x60')]||_0x343784[_0x97a5('0x61')]['id'];_0x2eda77[_0x97a5('0x62')]['id']=_0x343784['body'][_0x97a5('0x60')];return db[_0x97a5('0x40')][_0x97a5('0x59')]({'where':{'id':_0x343784[_0x97a5('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x195f22,null))[_0x97a5('0x23')](function(_0x5eb3a5){if(_0x5eb3a5){_0x2eda77[_0x97a5('0x2c')]=_0x5eb3a5['get']({'plain':!![]});return db[_0x97a5('0x78')][_0x97a5('0x59')]({'where':{'id':_0x5eb3a5['FaxInteractionId']}});}return null;})[_0x97a5('0x23')](handleEntityNotFound(_0x195f22,null))[_0x97a5('0x23')](function(_0x359577){if(_0x359577){_0x2eda77['interaction']=_0x359577[_0x97a5('0x63')]({'plain':!![]});interaction_log[_0x97a5('0x24')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x343784[_0x97a5('0x61')]['id'],_0x343784['user'][_0x97a5('0x3d')],_0x343784[_0x97a5('0x61')]['role'],_0x2eda77[_0x97a5('0x67')]['id'],_0x343784['body']?JSON[_0x97a5('0x29')](_0x343784[_0x97a5('0x58')]):_0x97a5('0x6a'));return respondWithRpcPromise(_0x97a5('0x79'),_0x97a5('0x7a'),_0x2eda77);}return null;})[_0x97a5('0x23')](function(_0x49b0ee){var _0x3b3113=_0x97a5('0x7b')+_0x49b0ee['message'][_0x97a5('0x7c')];return db[_0x97a5('0x6d')][_0x97a5('0x44')](_0x3b3113,{'type':db['Sequelize'][_0x97a5('0x7d')]['SELECT'],'raw':!![]})[_0x97a5('0x23')](function(_0x337a1e){return _0x337a1e;});})[_0x97a5('0x23')](function(_0x8232cc){if(_0x8232cc){_0x2eda77[_0x97a5('0x2c')][_0x97a5('0x6e')]=_0x8232cc[0x0];if(!_0x343784[_0x97a5('0x58')][_0x97a5('0x60')])return;return db['User']['find']({'where':{'id':_0x343784[_0x97a5('0x58')][_0x97a5('0x60')],'role':_0x97a5('0x62')},'attributes':['id',_0x97a5('0x3d'),_0x97a5('0x7e'),_0x97a5('0x70'),_0x97a5('0x71')],'raw':!![]});}return null;})[_0x97a5('0x23')](function(_0x481a5f){if(!_0x481a5f)return null;_0x2eda77[_0x97a5('0x2c')][_0x97a5('0x62')]=_0x481a5f;return _0x2eda77;})[_0x97a5('0x23')](function(_0x1c21e0){if(_0x1c21e0){_0x1c21e0[_0x97a5('0x2c')][_0x97a5('0x73')]=util[_0x97a5('0x5f')]('SIP/%s',_0x343784[_0x97a5('0x61')][_0x97a5('0x3d')]);_0x1c21e0[_0x97a5('0x2c')][_0x97a5('0x75')]=_0x2eda77['channel'];_0x1c21e0[_0x97a5('0x2c')][_0x97a5('0x7f')]=_0x2eda77[_0x97a5('0x75')];_0x1c21e0[_0x97a5('0x2c')][_0x97a5('0x80')]=_0x97a5('0x39');respondWithRpcPromise(_0x97a5('0x76'),_0x97a5('0x76'),{'event':_0x97a5('0x81'),'message':_0x1c21e0[_0x97a5('0x2c')]},client9002);return _0x2eda77;}return null;})[_0x97a5('0x23')](respondWithResult(_0x195f22,null))['catch'](handleError(_0x195f22,null));};exports[_0x97a5('0x82')]=function(_0xa0c182,_0xb51f0b){var _0x2ba61b;return db[_0x97a5('0x40')][_0x97a5('0x82')](_0xa0c182[_0x97a5('0x58')],{})['then'](function(_0xd9b19e){_0x2ba61b=_0xd9b19e;return db[_0x97a5('0x83')][_0x97a5('0x84')]({'where':{'id':_0x2ba61b[_0x97a5('0x7c')]}});})[_0x97a5('0x23')](function(_0x3561bb){if(_['isNil'](_0x3561bb)){return;}else{_0x2ba61b[_0x97a5('0x85')]=_0x3561bb[_0x97a5('0x85')];return db[_0x97a5('0x86')][_0x97a5('0x84')]({'where':{'id':_0x2ba61b[_0x97a5('0x87')]}});}})[_0x97a5('0x23')](function(_0x1840a1){return respondWithRpcPromise(_0x97a5('0x88'),'SendFax',{'FaxAccountId':_[_0x97a5('0x65')](_0xa0c182[_0x97a5('0x58')])?undefined:_0xa0c182[_0x97a5('0x58')]['FaxAccountId'],'path':_[_0x97a5('0x65')](_0x1840a1)?undefined:util[_0x97a5('0x5f')](_0x97a5('0x89'),_0x1840a1[_0x97a5('0x8a')]),'fax':_[_0x97a5('0x65')](_0x2ba61b[_0x97a5('0x85')])?undefined:_0x2ba61b['fax'],'AttachmentId':_0x2ba61b[_0x97a5('0x87')]},client9002);})[_0x97a5('0x23')](respondWithResult(_0xb51f0b,0xc9))['catch'](handleError(_0xb51f0b,null));};exports[_0x97a5('0x8b')]=function(_0x45fa44,_0x55f114){var _0x2559d3=path[_0x97a5('0x8c')](config[_0x97a5('0x8d')],_0x97a5('0x8e'),_0x97a5('0x8f'),'attachments');return db[_0x97a5('0x40')]['find']({'where':{'id':_0x45fa44['params']['id']},'include':[{'model':db['Attachment'],'as':_0x97a5('0x86')}]})[_0x97a5('0x23')](handleEntityNotFound(_0x55f114,null))[_0x97a5('0x23')](function(_0x5ba85d){if(_0x5ba85d){return _0x55f114[_0x97a5('0x8b')](path[_0x97a5('0x8c')](_0x2559d3,_0x5ba85d[_0x97a5('0x86')][_0x97a5('0x8a')]));}})[_0x97a5('0x2e')](handleError(_0x55f114,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 66d52ff..2779652 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 _0x78f4=['../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x3cca9a,_0x5c4578){var _0x3ea97d=function(_0x369faa){while(--_0x369faa){_0x3cca9a['push'](_0x3cca9a['shift']());}};_0x3ea97d(++_0x5c4578);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x478f('0x0'))['db'][_0x478f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x478f('0x2')](0x0);var events={'afterCreate':_0x478f('0x3'),'afterUpdate':'update','afterDestroy':_0x478f('0x4')};function emitEvent(_0x4d004a){return function(_0x1965e3,_0xc3eb,_0x229f69){FaxMessageEvents['emit'](_0x4d004a+':'+_0x1965e3['id'],_0x1965e3);FaxMessageEvents[_0x478f('0x5')](_0x4d004a,_0x1965e3);_0x229f69(null);};}for(var e in events){if(events[_0x478f('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x478f('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x29eb=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update','remove','emit'];(function(_0x2434d4,_0x2daca6){var _0x41ed1e=function(_0xd58c74){while(--_0xd58c74){_0x2434d4['push'](_0x2434d4['shift']());}};_0x41ed1e(++_0x2daca6);}(_0x29eb,0x1c5));var _0xb29e=function(_0x2a297a,_0x3bbf2c){_0x2a297a=_0x2a297a-0x0;var _0x2dfcf6=_0x29eb[_0x2a297a];return _0x2dfcf6;};'use strict';var EventEmitter=require(_0xb29e('0x0'));var FaxMessage=require(_0xb29e('0x1'))['db'][_0xb29e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb29e('0x3'),'afterUpdate':_0xb29e('0x4'),'afterDestroy':_0xb29e('0x5')};function emitEvent(_0x4a9b91){return function(_0x29356f,_0x4c648e,_0x14c35b){FaxMessageEvents[_0xb29e('0x6')](_0x4a9b91+':'+_0x29356f['id'],_0x29356f);FaxMessageEvents[_0xb29e('0x6')](_0x4a9b91,_0x29356f);_0x14c35b(null);};}for(var e in events){if(events[_0xb29e('0x7')](e)){var event=events[e];FaxMessage[_0xb29e('0x8')](e,emitEvent(event));}}module[_0xb29e('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 bea7117..b6413ea 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 _0xcfe5=['models','get','toLowerCase','out','secret','UserId','findOne','FaxInteractionId','then','update','createdAt','direction','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','fti_fax_messages','body'];(function(_0x5d4390,_0x21b7d8){var _0x4f3e01=function(_0x42372f){while(--_0x42372f){_0x5d4390['push'](_0x5d4390['shift']());}};_0x4f3e01(++_0x21b7d8);}(_0xcfe5,0x1da));var _0x5cfe=function(_0x47cd7b,_0x5630af){_0x47cd7b=_0x47cd7b-0x0;var _0x3e6dbf=_0xcfe5[_0x47cd7b];return _0x3e6dbf;};'use strict';var _=require(_0x5cfe('0x0'));var util=require(_0x5cfe('0x1'));var logger=require(_0x5cfe('0x2'))('api');var moment=require(_0x5cfe('0x3'));var BPromise=require(_0x5cfe('0x4'));var rp=require(_0x5cfe('0x5'));var fs=require('fs');var path=require(_0x5cfe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5cfe('0x7'));module[_0x5cfe('0x8')]=function(_0x51cdd7,_0x372ecf){return _0x51cdd7[_0x5cfe('0x9')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5cfe('0xa'),'fields':[_0x5cfe('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x463739,_0x2632e4,_0x11a74f){var _0x583c4b=_0x51cdd7[_0x5cfe('0xc')];var _0x5862c3=_0x463739[_0x5cfe('0xd')]({'plain':!![]});if(_0x5862c3['direction'][_0x5cfe('0xe')]()==='in'||_0x5862c3['direction']['toLowerCase']()===_0x5cfe('0xf')&&!_0x5862c3[_0x5cfe('0x10')]&&!_['isNil'](_0x5862c3[_0x5cfe('0x11')])){_0x583c4b['FaxInteraction'][_0x5cfe('0x12')]({'where':{'id':_0x5862c3[_0x5cfe('0x13')]}})[_0x5cfe('0x14')](function(_0x45f0b1){if(_0x45f0b1){_0x45f0b1[_0x5cfe('0x15')]({'lastMsgAt':_0x5862c3[_0x5cfe('0x16')],'lastMsgDirection':_0x5862c3[_0x5cfe('0x17')][_0x5cfe('0xe')]()});}})[_0x5cfe('0x18')](function(_0x31c3ec){console[_0x5cfe('0x19')](_0x31c3ec);});}_0x11a74f();}},'charset':'utf8mb4','collate':_0x5cfe('0x1a')});}; \ No newline at end of file +var _0xe7c7=['toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','direction'];(function(_0x38605b,_0x3a41fd){var _0x14c334=function(_0x31c9da){while(--_0x31c9da){_0x38605b['push'](_0x38605b['shift']());}};_0x14c334(++_0x3a41fd);}(_0xe7c7,0xc2));var _0x7e7c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe7c7[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x7e7c('0x0'));var logger=require(_0x7e7c('0x1'))(_0x7e7c('0x2'));var moment=require(_0x7e7c('0x3'));var BPromise=require(_0x7e7c('0x4'));var rp=require(_0x7e7c('0x5'));var fs=require('fs');var path=require(_0x7e7c('0x6'));var rimraf=require(_0x7e7c('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e7c('0x8'));module[_0x7e7c('0x9')]=function(_0x251db4,_0xf1c30a){return _0x251db4[_0x7e7c('0xa')](_0x7e7c('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x7e7c('0xc'),'fields':[_0x7e7c('0xd')],'type':_0x7e7c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x167ca7,_0x2fea86,_0xf7ae71){var _0x96ba80=_0x251db4['models'];var _0x1ad56b=_0x167ca7['get']({'plain':!![]});if(_0x1ad56b[_0x7e7c('0xf')][_0x7e7c('0x10')]()==='in'||_0x1ad56b[_0x7e7c('0xf')]['toLowerCase']()===_0x7e7c('0x11')&&!_0x1ad56b[_0x7e7c('0x12')]&&!_[_0x7e7c('0x13')](_0x1ad56b[_0x7e7c('0x14')])){_0x96ba80[_0x7e7c('0x15')][_0x7e7c('0x16')]({'where':{'id':_0x1ad56b[_0x7e7c('0x17')]}})[_0x7e7c('0x18')](function(_0x1d982e){if(_0x1d982e){_0x1d982e['update']({'lastMsgAt':_0x1ad56b[_0x7e7c('0x19')],'lastMsgDirection':_0x1ad56b['direction'][_0x7e7c('0x10')]()});}})[_0x7e7c('0x1a')](function(_0xea0d11){console[_0x7e7c('0x1b')](_0xea0d11);});}_0xf7ae71();}},'charset':_0x7e7c('0x1c'),'collate':_0x7e7c('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index cd5ef9c..6dbee44 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 _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./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','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x21880f,_0x51525d){var _0x5d59e8=function(_0x72f159){while(--_0x72f159){_0x21880f['push'](_0x21880f['shift']());}};_0x5d59e8(++_0x51525d);}(_0xac31,0xca));var _0x1ac3=function(_0x1a88b7,_0x4b9255){_0x1a88b7=_0x1a88b7-0x0;var _0x440615=_0xac31[_0x1a88b7];return _0x440615;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file +var _0x70e0=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','update','raw','where','limit','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x174977,_0x117c44){var _0x2d400b=function(_0x3c4c8f){while(--_0x3c4c8f){_0x174977['push'](_0x174977['shift']());}};_0x2d400b(++_0x117c44);}(_0x70e0,0x17b));var _0x070e=function(_0x2142bc,_0xc01b40){_0x2142bc=_0x2142bc-0x0;var _0x23959b=_0x70e0[_0x2142bc];return _0x23959b;};'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});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')](_0x259893[_0x070e('0x1b')],{'raw':_0x259893['options']?_0x259893[_0x070e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x070e('0xf')](function(_0x3f6985){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')](_0x070e('0x18'),_0x259893,JSON[_0x070e('0x1d')](_0x3f6985));_0x5b2f48(_0x3f6985);})[_0x070e('0x1e')](function(_0x595c7e){logger[_0x070e('0x15')](_0x070e('0x18'),_0x595c7e[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd['error'](0x1f4,_0x595c7e[_0x070e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x4a2dbd){var _0x2ccbd7=this;return new Promise(function(_0x25f6e,_0x41deb1){return db[_0x070e('0x19')][_0x070e('0x1f')](_0x4a2dbd['body'],{'raw':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x21')]||null:null,'attributes':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')]['attributes']||null:null,'limit':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x22')]||null:null})['then'](function(_0x5c5f0d){logger[_0x070e('0x10')](_0x070e('0x23'),_0x4a2dbd);logger[_0x070e('0x13')]('UpdateFaxMessage',_0x4a2dbd,JSON[_0x070e('0x1d')](_0x5c5f0d));_0x25f6e(_0x5c5f0d);})[_0x070e('0x1e')](function(_0x3a9425){logger[_0x070e('0x15')]('UpdateFaxMessage',_0x3a9425['message'],_0x4a2dbd);_0x41deb1(_0x2ccbd7['error'](0x1f4,_0x3a9425['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index f80d691..8233743 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 _0x53a5=['length','faxMessage:','./faxMessage.events','save','remove','register'];(function(_0x5ef377,_0x9647db){var _0x245c7c=function(_0x131877){while(--_0x131877){_0x5ef377['push'](_0x5ef377['shift']());}};_0x245c7c(++_0x9647db);}(_0x53a5,0x13a));var _0x553a=function(_0x287024,_0x5a31e4){_0x287024=_0x287024-0x0;var _0x557a30=_0x53a5[_0x287024];return _0x557a30;};'use strict';var FaxMessageEvents=require(_0x553a('0x0'));var events=[_0x553a('0x1'),_0x553a('0x2'),'update'];function createListener(_0x1ad6f4,_0x519a39){return function(_0x41c99f){_0x519a39['emit'](_0x1ad6f4,_0x41c99f);};}function removeListener(_0x477b49,_0x513598){return function(){FaxMessageEvents['removeListener'](_0x477b49,_0x513598);};}exports[_0x553a('0x3')]=function(_0x1b9ce9){for(var _0x1cd967=0x0,_0xf2defc=events[_0x553a('0x4')];_0x1cd967<_0xf2defc;_0x1cd967++){var _0x56517f=events[_0x1cd967];var _0x11924e=createListener(_0x553a('0x5')+_0x56517f,_0x1b9ce9);FaxMessageEvents['on'](_0x56517f,_0x11924e);}}; \ No newline at end of file +var _0xc90b=['removeListener','register','length','faxMessage:','remove','update'];(function(_0x4c6abb,_0x8f43d5){var _0x3d1312=function(_0x497240){while(--_0x497240){_0x4c6abb['push'](_0x4c6abb['shift']());}};_0x3d1312(++_0x8f43d5);}(_0xc90b,0xd6));var _0xbc90=function(_0x2babc4,_0x2770cd){_0x2babc4=_0x2babc4-0x0;var _0x531258=_0xc90b[_0x2babc4];return _0x531258;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0xbc90('0x0'),_0xbc90('0x1')];function createListener(_0x13f2bf,_0x33721c){return function(_0x3fadc6){_0x33721c['emit'](_0x13f2bf,_0x3fadc6);};}function removeListener(_0x531283,_0x549acb){return function(){FaxMessageEvents[_0xbc90('0x2')](_0x531283,_0x549acb);};}exports[_0xbc90('0x3')]=function(_0x42ca71){for(var _0x59839e=0x0,_0x5e421a=events[_0xbc90('0x4')];_0x59839e<_0x5e421a;_0x59839e++){var _0x43b52a=events[_0x59839e];var _0xa23e54=createListener(_0xbc90('0x5')+_0x43b52a,_0x42ca71);FaxMessageEvents['on'](_0x43b52a,_0xa23e54);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 632b164..871f7de 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 _0x222f=['/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','fax','create','put','update','/:id/accept'];(function(_0x4f51e2,_0x4508cd){var _0x3d1fd6=function(_0x17ca41){while(--_0x17ca41){_0x4f51e2['push'](_0x4f51e2['shift']());}};_0x3d1fd6(++_0x4508cd);}(_0x222f,0x1a4));var _0xf222=function(_0x208d6f,_0x576241){_0x208d6f=_0x208d6f-0x0;var _0x398bbf=_0x222f[_0x208d6f];return _0x398bbf;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./faxMessage.controller');router[_0xf222('0x8')]('/',auth['isAuthenticated'](),controller[_0xf222('0x9')]);router[_0xf222('0x8')]('/describe',auth[_0xf222('0xa')](),controller[_0xf222('0xb')]);router['get'](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0xd')]);router[_0xf222('0x8')](_0xf222('0xe'),auth[_0xf222('0xa')](),controller['download']);router[_0xf222('0xf')]('/',auth[_0xf222('0xa')](),interaction[_0xf222('0x10')](_0xf222('0x11'),'faxmessage:create'),controller[_0xf222('0x12')]);router[_0xf222('0x13')](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x14')]);router[_0xf222('0x13')](_0xf222('0x15'),auth[_0xf222('0xa')](),controller['accept']);router['put'](_0xf222('0x16'),auth[_0xf222('0xa')](),controller['reject']);router[_0xf222('0x17')](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x18')]);module[_0xf222('0x19')]=router; \ No newline at end of file +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(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x668b,0x140));var _0xb668=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x668b[_0xdbb6cb];return _0x476b50;};'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 diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0c88c62..9f55f9a 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 _0x3e5b=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x1d9193,_0x2e400f){var _0x3f4516=function(_0x51b61b){while(--_0x51b61b){_0x1d9193['push'](_0x1d9193['shift']());}};_0x3f4516(++_0x2e400f);}(_0x3e5b,0x188));var _0xb3e5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x3e5b[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xb3e5('0x0'));module[_0xb3e5('0x1')]={'name':{'type':Sequelize[_0xb3e5('0x2')],'unique':_0xb3e5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb3e5('0x2')]},'timeout':{'type':Sequelize[_0xb3e5('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3e5('0x5')]('rrmemory',_0xb3e5('0x6'),_0xb3e5('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb3e5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6216=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4cb100,_0x4bdfc9){var _0x493d0c=function(_0x5e586b){while(--_0x5e586b){_0x4cb100['push'](_0x4cb100['shift']());}};_0x493d0c(++_0x4bdfc9);}(_0x6216,0x90));var _0x6621=function(_0x2360b8,_0x4f4f03){_0x2360b8=_0x2360b8-0x0;var _0x1cfe64=_0x6216[_0x2360b8];return _0x1cfe64;};'use strict';var Sequelize=require(_0x6621('0x0'));module[_0x6621('0x1')]={'name':{'type':Sequelize[_0x6621('0x2')],'unique':_0x6621('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6621('0x2')]},'timeout':{'type':Sequelize[_0x6621('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6621('0x5')](_0x6621('0x6'),_0x6621('0x7'),_0x6621('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6621('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 1aeb2e5..955162e 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 _0xc83e=['util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','sendStatus','error','stack','send','index','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','FaxQueue','params','keys','rawAttributes','find','catch','create','user','userProfileId','autoAssociation','body','getMembers','findOne','UserFaxQueue','findAll','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userFaxQueue:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x10d902,_0x1fd462){var _0x1abcf0=function(_0x3b2174){while(--_0x3b2174){_0x10d902['push'](_0x10d902['shift']());}};_0x1abcf0(++_0x1fd462);}(_0xc83e,0x7f));var _0xec83=function(_0x50068c,_0x38a87a){_0x50068c=_0x50068c-0x0;var _0x11826a=_0xc83e[_0x50068c];return _0x11826a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec83('0x0'));var zipdir=require(_0xec83('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec83('0x2'));var moment=require(_0xec83('0x3'));var BPromise=require(_0xec83('0x4'));var Mustache=require('mustache');var util=require(_0xec83('0x5'));var path=require(_0xec83('0x6'));var sox=require(_0xec83('0x7'));var csv=require(_0xec83('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec83('0x9'));var _=require(_0xec83('0xa'));var squel=require(_0xec83('0xb'));var crypto=require('crypto');var jsforce=require(_0xec83('0xc'));var deskjs=require(_0xec83('0xd'));var toCsv=require(_0xec83('0x8'));var querystring=require(_0xec83('0xe'));var Papa=require(_0xec83('0xf'));var Redis=require(_0xec83('0x10'));var authService=require(_0xec83('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xec83('0x12'));var hardwareService=require(_0xec83('0x13'));var logger=require(_0xec83('0x14'))('api');var utils=require(_0xec83('0x15'));var config=require(_0xec83('0x16'));var licenseUtil=require(_0xec83('0x17'));var db=require(_0xec83('0x18'))['db'];config[_0xec83('0x19')]=_[_0xec83('0x1a')](config[_0xec83('0x19')],{'host':_0xec83('0x1b'),'port':0x18eb});var socket=require(_0xec83('0x1c'))(new Redis(config[_0xec83('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x34f276,_0x3499ec){_0x3499ec=_0x3499ec||0xcc;return function(_0x308de7){if(_0x308de7){return _0x34f276['sendStatus'](_0x3499ec);}return _0x34f276[_0xec83('0x1d')](_0x3499ec)['end']();};}function respondWithResult(_0x311be2,_0x3f3255){_0x3f3255=_0x3f3255||0xc8;return function(_0x377563){if(_0x377563){return _0x311be2[_0xec83('0x1d')](_0x3f3255)['json'](_0x377563);}};}function respondWithFilteredResult(_0x59fdc4,_0x125b29){return function(_0x4a4ed4){if(_0x4a4ed4){var _0x4d2166=typeof _0x125b29[_0xec83('0x1e')]===_0xec83('0x1f')&&typeof _0x125b29[_0xec83('0x20')]===_0xec83('0x1f');var _0x2067ba=_0x4a4ed4[_0xec83('0x21')];var _0x534ff5=_0x4d2166?0x0:_0x125b29['offset'];var _0x524027=_0x4d2166?_0x4a4ed4['count']:_0x125b29[_0xec83('0x1e')]+_0x125b29['limit'];var _0x3414f6;if(_0x524027>=_0x2067ba){_0x524027=_0x2067ba;_0x3414f6=0xc8;}else{_0x3414f6=0xce;}_0x59fdc4['status'](_0x3414f6);return _0x59fdc4[_0xec83('0x22')](_0xec83('0x23'),_0x534ff5+'-'+_0x524027+'/'+_0x2067ba)[_0xec83('0x24')](_0x4a4ed4);}return null;};}function patchUpdates(_0x3d79a5){return function(_0x101414){try{jsonpatch['apply'](_0x101414,_0x3d79a5,!![]);}catch(_0x5a0fea){return BPromise[_0xec83('0x25')](_0x5a0fea);}return _0x101414[_0xec83('0x26')]();};}function saveUpdates(_0x2afd33,_0x4a68c7){return function(_0x39c2ca){if(_0x39c2ca){return _0x39c2ca[_0xec83('0x27')](_0x2afd33)[_0xec83('0x28')](function(_0x3de2cc){return _0x3de2cc;});}return null;};}function removeEntity(_0x32aa08,_0x32e6b2){return function(_0x894c8){if(_0x894c8){return _0x894c8[_0xec83('0x29')]()[_0xec83('0x28')](function(){var _0x211209=_0x894c8[_0xec83('0x2a')]({'plain':!![]});var _0x50f646=_0xec83('0x2b');return db[_0xec83('0x2c')][_0xec83('0x29')]({'where':{'type':_0x50f646,'resourceId':_0x211209['id']}})[_0xec83('0x28')](function(){return _0x894c8;});})['then'](function(){_0x32aa08[_0xec83('0x1d')](0xcc)[_0xec83('0x2d')]();});}};}function handleEntityNotFound(_0x128ab2,_0x1e5cc6){return function(_0x53a560){if(!_0x53a560){_0x128ab2[_0xec83('0x2e')](0x194);}return _0x53a560;};}function handleError(_0xe36453,_0x4f5dbc){_0x4f5dbc=_0x4f5dbc||0x1f4;return function(_0x22c41e){logger[_0xec83('0x2f')](_0x22c41e[_0xec83('0x30')]);if(_0x22c41e['name']){delete _0x22c41e['name'];}_0xe36453[_0xec83('0x1d')](_0x4f5dbc)[_0xec83('0x31')](_0x22c41e);};}exports[_0xec83('0x32')]=function(_0x17fce1,_0x17e869){var _0x15463a={},_0x245ef7={},_0x3b2ab9={'count':0x0,'rows':[]};var _0x2f959b=_['map'](db['FaxQueue']['rawAttributes'],function(_0x4940f4){return{'name':_0x4940f4[_0xec83('0x33')],'type':_0x4940f4[_0xec83('0x34')]['key']};});_0x245ef7[_0xec83('0x35')]=_[_0xec83('0x36')](_0x2f959b,'name');_0x245ef7[_0xec83('0x37')]=_['keys'](_0x17fce1[_0xec83('0x37')]);_0x245ef7[_0xec83('0x38')]=_[_0xec83('0x39')](_0x245ef7['model'],_0x245ef7[_0xec83('0x37')]);_0x15463a[_0xec83('0x3a')]=_[_0xec83('0x39')](_0x245ef7[_0xec83('0x35')],qs[_0xec83('0x3b')](_0x17fce1[_0xec83('0x37')]['fields']));_0x15463a['attributes']=_0x15463a[_0xec83('0x3a')][_0xec83('0x3c')]?_0x15463a[_0xec83('0x3a')]:_0x245ef7[_0xec83('0x35')];if(!_0x17fce1[_0xec83('0x37')][_0xec83('0x3d')](_0xec83('0x3e'))){_0x15463a[_0xec83('0x20')]=qs[_0xec83('0x20')](_0x17fce1[_0xec83('0x37')][_0xec83('0x20')]);_0x15463a[_0xec83('0x1e')]=qs[_0xec83('0x1e')](_0x17fce1[_0xec83('0x37')]['offset']);}_0x15463a[_0xec83('0x3f')]=qs[_0xec83('0x40')](_0x17fce1[_0xec83('0x37')][_0xec83('0x40')]);_0x15463a[_0xec83('0x41')]=qs['filters'](_[_0xec83('0x42')](_0x17fce1[_0xec83('0x37')],_0x245ef7['filters']),_0x2f959b);if(_0x17fce1[_0xec83('0x37')][_0xec83('0x43')]){_0x15463a[_0xec83('0x41')]=_[_0xec83('0x44')](_0x15463a[_0xec83('0x41')],{'$or':_['map'](_0x2f959b,function(_0x853569){if(_0x853569[_0xec83('0x34')]!==_0xec83('0x45')){var _0x11b325={};_0x11b325[_0x853569[_0xec83('0x46')]]={'$like':'%'+_0x17fce1[_0xec83('0x37')][_0xec83('0x43')]+'%'};return _0x11b325;}})});}_0x15463a=_[_0xec83('0x44')]({},_0x15463a,_0x17fce1[_0xec83('0x47')]);var _0x165110={'where':_0x15463a['where']};return db['FaxQueue'][_0xec83('0x21')](_0x165110)[_0xec83('0x28')](function(_0x2ce0f7){_0x3b2ab9[_0xec83('0x21')]=_0x2ce0f7;if(_0x17fce1[_0xec83('0x37')][_0xec83('0x48')]){_0x15463a[_0xec83('0x49')]=[{'all':!![]}];}return db[_0xec83('0x4a')]['findAll'](_0x15463a);})['then'](function(_0x55bbca){_0x3b2ab9['rows']=_0x55bbca;return _0x3b2ab9;})[_0xec83('0x28')](respondWithFilteredResult(_0x17e869,_0x15463a))['catch'](handleError(_0x17e869,null));};exports['show']=function(_0x4b20d6,_0x53cb5c){var _0x22d3d6={'raw':!![],'where':{'id':_0x4b20d6[_0xec83('0x4b')]['id']}},_0x5c581a={};_0x5c581a[_0xec83('0x35')]=_[_0xec83('0x4c')](db['FaxQueue'][_0xec83('0x4d')]);_0x5c581a['query']=_['keys'](_0x4b20d6['query']);_0x5c581a[_0xec83('0x38')]=_[_0xec83('0x39')](_0x5c581a[_0xec83('0x35')],_0x5c581a[_0xec83('0x37')]);_0x22d3d6[_0xec83('0x3a')]=_[_0xec83('0x39')](_0x5c581a['model'],qs[_0xec83('0x3b')](_0x4b20d6[_0xec83('0x37')][_0xec83('0x3b')]));_0x22d3d6[_0xec83('0x3a')]=_0x22d3d6[_0xec83('0x3a')][_0xec83('0x3c')]?_0x22d3d6['attributes']:_0x5c581a[_0xec83('0x35')];if(_0x4b20d6['query']['includeAll']){_0x22d3d6[_0xec83('0x49')]=[{'all':!![]}];}_0x22d3d6=_[_0xec83('0x44')]({},_0x22d3d6,_0x4b20d6[_0xec83('0x47')]);return db['FaxQueue'][_0xec83('0x4e')](_0x22d3d6)[_0xec83('0x28')](handleEntityNotFound(_0x53cb5c,null))[_0xec83('0x28')](respondWithResult(_0x53cb5c,null))[_0xec83('0x4f')](handleError(_0x53cb5c,null));};exports[_0xec83('0x50')]=function(_0x42ce29,_0x4eee29){return db[_0xec83('0x4a')]['create'](_0x42ce29['body'],{})[_0xec83('0x28')](function(_0xd9facf){var _0x261c53=_0x42ce29[_0xec83('0x51')][_0xec83('0x2a')]({'plain':!![]});if(!_0x261c53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x261c53['role']===_0xec83('0x51')){var _0x2e6282=_0xd9facf['get']({'plain':!![]});var _0x5b9a6e=_0xec83('0x2b');return db['UserProfileSection'][_0xec83('0x4e')]({'where':{'name':_0x5b9a6e,'userProfileId':_0x261c53[_0xec83('0x52')]},'raw':!![]})[_0xec83('0x28')](function(_0x239b52){if(_0x239b52&&_0x239b52[_0xec83('0x53')]===0x0){return db[_0xec83('0x2c')]['create']({'name':_0x2e6282['name'],'resourceId':_0x2e6282['id'],'type':_0x239b52[_0xec83('0x46')],'sectionId':_0x239b52['id']},{})[_0xec83('0x28')](function(){return _0xd9facf;});}else{return _0xd9facf;}})[_0xec83('0x4f')](function(_0x204fdd){logger[_0xec83('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x204fdd);throw _0x204fdd;});}return _0xd9facf;})[_0xec83('0x28')](respondWithResult(_0x4eee29,0xc9))[_0xec83('0x4f')](handleError(_0x4eee29,null));};exports[_0xec83('0x27')]=function(_0x5e304f,_0x59285a){if(_0x5e304f['body']['id']){delete _0x5e304f[_0xec83('0x54')]['id'];}return db[_0xec83('0x4a')][_0xec83('0x4e')]({'where':{'id':_0x5e304f['params']['id']}})['then'](handleEntityNotFound(_0x59285a,null))[_0xec83('0x28')](saveUpdates(_0x5e304f['body'],null))[_0xec83('0x28')](respondWithResult(_0x59285a,null))[_0xec83('0x4f')](handleError(_0x59285a,null));};exports['destroy']=function(_0x5218e8,_0x344e49){return db[_0xec83('0x4a')][_0xec83('0x4e')]({'where':{'id':_0x5218e8['params']['id']}})['then'](handleEntityNotFound(_0x344e49,null))[_0xec83('0x28')](removeEntity(_0x344e49,null))[_0xec83('0x4f')](handleError(_0x344e49,null));};exports['describe']=function(_0x34b4ea,_0x55b4dc){return db['FaxQueue']['describe']()[_0xec83('0x28')](respondWithResult(_0x55b4dc,null))[_0xec83('0x4f')](handleError(_0x55b4dc,null));};exports[_0xec83('0x55')]=function(_0x3197cd,_0x592561,_0x5c73cd){var _0x289f9f={'raw':!![],'where':{}},_0xce3a43={},_0x1d65eb;return db[_0xec83('0x4a')][_0xec83('0x56')]({'where':{'id':_0x3197cd[_0xec83('0x4b')]['id']}})['then'](handleEntityNotFound(_0x592561,null))[_0xec83('0x28')](function(_0xb57027){if(_0xb57027){_0x1d65eb=_0xb57027[_0xec83('0x2a')]({'plain':!![]});_0xce3a43[_0xec83('0x35')]=_[_0xec83('0x4c')](db[_0xec83('0x57')][_0xec83('0x4d')]);_0xce3a43['query']=_[_0xec83('0x4c')](_0x3197cd[_0xec83('0x37')]);_0xce3a43['filters']=_['intersection'](_0xce3a43[_0xec83('0x35')],_0xce3a43[_0xec83('0x37')]);_0x289f9f[_0xec83('0x3a')]=_[_0xec83('0x39')](_0xce3a43['model'],qs[_0xec83('0x3b')](_0x3197cd['query'][_0xec83('0x3b')]));_0x289f9f[_0xec83('0x3a')]=_0x289f9f[_0xec83('0x3a')][_0xec83('0x3c')]?_0x289f9f['attributes']:_0xce3a43[_0xec83('0x35')];if(!_0x3197cd[_0xec83('0x37')][_0xec83('0x3d')](_0xec83('0x3e'))){_0x289f9f[_0xec83('0x20')]=qs['limit'](_0x3197cd['query']['limit']);_0x289f9f['offset']=qs[_0xec83('0x1e')](_0x3197cd[_0xec83('0x37')][_0xec83('0x1e')]);}_0x289f9f[_0xec83('0x3f')]=qs[_0xec83('0x40')](_0x3197cd['query'][_0xec83('0x40')]);_0x289f9f['where']=qs[_0xec83('0x38')](_[_0xec83('0x42')](_0x3197cd['query'],_0xce3a43[_0xec83('0x38')]));_0x289f9f['where']['FaxQueueId']=_0xb57027['id'];if(_0x3197cd['query']['filter']){_0x289f9f[_0xec83('0x41')]=_[_0xec83('0x44')](_0x289f9f[_0xec83('0x41')],{'$or':_[_0xec83('0x36')](_0x289f9f['attributes'],function(_0x463fec){var _0x50dc33={};_0x50dc33[_0x463fec]={'$like':'%'+_0x3197cd[_0xec83('0x37')][_0xec83('0x43')]+'%'};return _0x50dc33;})});}_0x289f9f=_[_0xec83('0x44')]({},_0x289f9f,_0x3197cd[_0xec83('0x47')]);return db[_0xec83('0x57')][_0xec83('0x58')](_0x289f9f);}})['then'](function(_0x5d0b80){if(_0x5d0b80){return db[_0xec83('0x59')][_0xec83('0x5a')]({'where':{'id':_[_0xec83('0x36')](_0x5d0b80,_0xec83('0x5b')),'role':'agent'},'attributes':['id',_0xec83('0x46'),_0xec83('0x5c'),_0xec83('0x5d'),_0xec83('0x5e')]});}})[_0xec83('0x28')](function(_0x3460fa){if(_0x3460fa){return{'count':_0x3460fa['count'],'rows':_[_0xec83('0x36')](_0x3460fa[_0xec83('0x5f')],function(_0x2b244e){return{'membername':_0x2b244e['name'],'UserId':_0x2b244e['id'],'queue_name':_0x1d65eb['name'],'FaxQueueId':_0x1d65eb['id'],'interface':util[_0xec83('0x60')](_0xec83('0x61'),_0xec83('0x62'),_0x2b244e[_0xec83('0x46')]),'penalty':0x0,'paused':_0x2b244e[_0xec83('0x5c')],'createdAt':_0x2b244e[_0xec83('0x5e')],'updatedAt':_0x2b244e[_0xec83('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x592561,_0x289f9f))['catch'](handleError(_0x592561,null));};exports[_0xec83('0x63')]=function(_0x4d3382,_0x5ba32b,_0x2d2d20){var _0x2fc096={};var _0x369a3b={};var _0x5b1d8f;var _0x153ac0;return db[_0xec83('0x4a')]['findOne']({'where':{'id':_0x4d3382[_0xec83('0x4b')]['id']}})[_0xec83('0x28')](handleEntityNotFound(_0x5ba32b,null))[_0xec83('0x28')](function(_0x69fd68){if(_0x69fd68){_0x5b1d8f=_0x69fd68;_0x369a3b['model']=_[_0xec83('0x4c')](db[_0xec83('0x64')][_0xec83('0x4d')]);_0x369a3b[_0xec83('0x37')]=_[_0xec83('0x4c')](_0x4d3382[_0xec83('0x37')]);_0x369a3b[_0xec83('0x38')]=_['intersection'](_0x369a3b[_0xec83('0x35')],_0x369a3b[_0xec83('0x37')]);_0x2fc096[_0xec83('0x3a')]=_[_0xec83('0x39')](_0x369a3b['model'],qs[_0xec83('0x3b')](_0x4d3382[_0xec83('0x37')][_0xec83('0x3b')]));_0x2fc096[_0xec83('0x3a')]=_0x2fc096[_0xec83('0x3a')]['length']?_0x2fc096[_0xec83('0x3a')]:_0x369a3b['model'];_0x2fc096['order']=qs[_0xec83('0x40')](_0x4d3382['query'][_0xec83('0x40')]);_0x2fc096[_0xec83('0x41')]=qs[_0xec83('0x38')](_[_0xec83('0x42')](_0x4d3382[_0xec83('0x37')],_0x369a3b[_0xec83('0x38')]));if(_0x4d3382['query']['filter']){_0x2fc096[_0xec83('0x41')]=_[_0xec83('0x44')](_0x2fc096[_0xec83('0x41')],{'$or':_[_0xec83('0x36')](_0x2fc096[_0xec83('0x3a')],function(_0x8ceec){var _0x1f780a={};_0x1f780a[_0x8ceec]={'$like':'%'+_0x4d3382[_0xec83('0x37')][_0xec83('0x43')]+'%'};return _0x1f780a;})});}_0x2fc096=_['merge']({},_0x2fc096,_0x4d3382['options']);return _0x5b1d8f['getTeams'](_0x2fc096);}})[_0xec83('0x28')](function(_0x40bbd9){if(_0x40bbd9){_0x153ac0=_0x40bbd9[_0xec83('0x3c')];if(!_0x4d3382[_0xec83('0x37')][_0xec83('0x3d')]('nolimit')){_0x2fc096[_0xec83('0x20')]=qs[_0xec83('0x20')](_0x4d3382[_0xec83('0x37')][_0xec83('0x20')]);_0x2fc096['offset']=qs['offset'](_0x4d3382[_0xec83('0x37')][_0xec83('0x1e')]);}return _0x5b1d8f[_0xec83('0x63')](_0x2fc096);}})[_0xec83('0x28')](function(_0x56f4ad){if(_0x56f4ad){return _0x56f4ad?{'count':_0x153ac0,'rows':_0x56f4ad}:null;}})[_0xec83('0x28')](respondWithResult(_0x5ba32b,null))[_0xec83('0x4f')](handleError(_0x5ba32b,null));};exports[_0xec83('0x65')]=function(_0x12df19,_0x5906a2,_0x129542){var _0x411211=_0x12df19[_0xec83('0x54')][_0xec83('0x66')];return db['Team'][_0xec83('0x58')]({'where':{'id':_0x411211},'attributes':['id'],'include':[{'model':db[_0xec83('0x59')],'as':_0xec83('0x67'),'attributes':['id',_0xec83('0x46'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x4d68e0){if(_0x4d68e0){var _0xe2e244=_['flatMap'](_0x4d68e0,function(_0x5207ca){var _0x15b806=_0x5207ca[_0xec83('0x2a')]({'plain':!![]});return _0x15b806[_0xec83('0x67')];});return db['FaxQueue'][_0xec83('0x4e')]({'where':{'id':_0x12df19[_0xec83('0x4b')]['id']}})[_0xec83('0x28')](function(_0x1529e5){return db[_0xec83('0x68')][_0xec83('0x69')](function(_0x25cbc2){return _0x1529e5['addTeams'](_0x411211,{'transaction':_0x25cbc2})[_0xec83('0x28')](function(){return BPromise['each'](_0xe2e244,function(_0x17ad69){return db[_0xec83('0x57')][_0xec83('0x6a')]({'where':{'UserId':_0x17ad69['id'],'FaxQueueId':_0x12df19['params']['id']},'transaction':_0x25cbc2});});})[_0xec83('0x28')](function(){_0xe2e244[_0xec83('0x6b')](function(_0x1bfda0){socket[_0xec83('0x6c')](_0xec83('0x6d'),{'UserId':_0x1bfda0['id'],'FaxQueueId':_0x1529e5['id']});});});});});}})[_0xec83('0x28')](respondWithStatusCode(_0x5906a2,null))[_0xec83('0x4f')](handleError(_0x5906a2,null));};exports[_0xec83('0x6e')]=function(_0x396cbf,_0x162231,_0x1f9d8a){return db[_0xec83('0x64')][_0xec83('0x58')]({'where':{'id':_0x396cbf[_0xec83('0x37')][_0xec83('0x66')]},'attributes':['id'],'include':[{'model':db[_0xec83('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xec83('0x28')](handleEntityNotFound(_0x162231,null))[_0xec83('0x28')](function(_0x5d6fa3){var _0x7984c6=_[_0xec83('0x36')](_0x5d6fa3,'id');var _0x5c1449=[];var _0x196e2b=[];var _0x581722=squel[_0xec83('0x6f')]();_0x581722[_0xec83('0x70')](_0xec83('0x71'))['from']('team_has_fax_queues','tq')['join'](_0xec83('0x72'),'ut',_0xec83('0x73'))['where'](_0xec83('0x74'),_0x396cbf[_0xec83('0x4b')]['id']);for(var _0x148e79=0x0;_0x148e79<_0x5d6fa3[_0xec83('0x3c')];_0x148e79+=0x1){let _0x3bf286=_0x5d6fa3[_0x148e79];for(var _0x2516d2=0x0;_0x2516d2<_0x3bf286[_0xec83('0x67')][_0xec83('0x3c')];_0x2516d2+=0x1){let _0x26d986=_0x3bf286[_0xec83('0x67')][_0x2516d2];var _0x3229b1=_0x581722['clone']();_0x3229b1['where'](_0xec83('0x75'),_0x26d986['id']);_0x196e2b['push'](db['sequelize']['query'](_0x3229b1['toString'](),{'type':db[_0xec83('0x68')][_0xec83('0x76')]['SELECT']})[_0xec83('0x28')](function(_0x151c01){if(_0x151c01[_0xec83('0x3c')]===0x1){return _0x26d986['id'];}else{var _0x3f23c5=_[_0xec83('0x77')](_[_0xec83('0x36')](_0x151c01,_0xec83('0x78')),function(_0x193b04){return _[_0xec83('0x79')](_0x7984c6,_0x193b04);});if(_0x3f23c5){return _0x26d986['id'];}}}));}}return BPromise[_0xec83('0x7a')](_0x196e2b)[_0xec83('0x28')](function(_0x110001){_0x5c1449=_(_0x5c1449)['union'](_0x110001)[_0xec83('0x7b')]()[_0xec83('0x7c')]();return db[_0xec83('0x4a')][_0xec83('0x4e')]({'where':{'id':_0x396cbf[_0xec83('0x4b')]['id']}})['then'](function(_0x33ca22){return db[_0xec83('0x68')][_0xec83('0x69')](function(_0x4eb086){return _0x33ca22['removeTeams'](_0x396cbf['query'][_0xec83('0x66')],{'transaction':_0x4eb086})['then'](function(){if(!_[_0xec83('0x7d')](_0x5c1449)){return _0x33ca22[_0xec83('0x7e')](_0x5c1449,{'transaction':_0x4eb086});}})[_0xec83('0x28')](function(){_0x5c1449[_0xec83('0x6b')](function(_0x5bd9fb){socket[_0xec83('0x6c')]('userFaxQueue:remove',{'UserId':_0x5bd9fb,'FaxQueueId':_0x33ca22['id']});});});});});});})['then'](respondWithStatusCode(_0x162231,null))[_0xec83('0x4f')](handleError(_0x162231,null));};exports['addAgents']=function(_0x2f1cf4,_0x23bca9,_0x244586){return db[_0xec83('0x4a')][_0xec83('0x4e')]({'where':{'id':_0x2f1cf4['params']['id']}})['then'](handleEntityNotFound(_0x23bca9,null))[_0xec83('0x28')](function(_0x3b7e02){if(_0x3b7e02){return _0x3b7e02[_0xec83('0x7f')](_0x2f1cf4[_0xec83('0x54')]['ids'],_[_0xec83('0x80')](_0x2f1cf4[_0xec83('0x54')],['ids','id'])||{})['spread'](function(_0x3da2c1){for(var _0x47d4ca=0x0;_0x47d4ca<_0x2f1cf4['body'][_0xec83('0x66')][_0xec83('0x3c')];_0x47d4ca+=0x1){socket['emit'](_0xec83('0x6d'),{'UserId':Number(_0x2f1cf4['body'][_0xec83('0x66')][_0x47d4ca]),'FaxQueueId':Number(_0x2f1cf4[_0xec83('0x4b')]['id'])});}return _0x3da2c1;});}})[_0xec83('0x28')](respondWithResult(_0x23bca9,null))[_0xec83('0x4f')](handleError(_0x23bca9,null));};exports[_0xec83('0x7e')]=function(_0xed7436,_0x264414,_0xd73e85){return db[_0xec83('0x4a')][_0xec83('0x4e')]({'where':{'id':_0xed7436['params']['id']}})[_0xec83('0x28')](handleEntityNotFound(_0x264414,null))[_0xec83('0x28')](function(_0x5d7513){if(_0x5d7513){return _0x5d7513[_0xec83('0x7e')](_0xed7436[_0xec83('0x37')][_0xec83('0x66')])[_0xec83('0x28')](function(){if(_[_0xec83('0x81')](_0xed7436[_0xec83('0x37')][_0xec83('0x66')])){for(var _0x566fce=0x0;_0x566fce<_0xed7436[_0xec83('0x37')][_0xec83('0x66')][_0xec83('0x3c')];_0x566fce+=0x1){socket[_0xec83('0x6c')]('userFaxQueue:remove',{'UserId':Number(_0xed7436[_0xec83('0x37')][_0xec83('0x66')][_0x566fce]),'FaxQueueId':Number(_0xed7436[_0xec83('0x4b')]['id'])});}}else{socket[_0xec83('0x6c')](_0xec83('0x82'),{'UserId':Number(_0xed7436[_0xec83('0x37')][_0xec83('0x66')]),'FaxQueueId':Number(_0xed7436['params']['id'])});}});}})[_0xec83('0x28')](respondWithStatusCode(_0x264414,null))[_0xec83('0x4f')](handleError(_0x264414,null));};exports[_0xec83('0x83')]=function(_0x4fb7ca,_0x346f2d,_0x16c700){var _0x4669ca={};var _0x578c1c={};var _0x547aff;var _0x5e827a;return db[_0xec83('0x4a')]['findOne']({'where':{'id':_0x4fb7ca[_0xec83('0x4b')]['id']}})[_0xec83('0x28')](handleEntityNotFound(_0x346f2d,null))[_0xec83('0x28')](function(_0x22439c){if(_0x22439c){_0x547aff=_0x22439c;_0x578c1c[_0xec83('0x35')]=_['keys'](db[_0xec83('0x59')][_0xec83('0x4d')]);_0x578c1c[_0xec83('0x37')]=_['keys'](_0x4fb7ca[_0xec83('0x37')]);_0x578c1c[_0xec83('0x38')]=_[_0xec83('0x39')](_0x578c1c[_0xec83('0x35')],_0x578c1c[_0xec83('0x37')]);_0x4669ca[_0xec83('0x3a')]=_['intersection'](_0x578c1c['model'],qs['fields'](_0x4fb7ca[_0xec83('0x37')][_0xec83('0x3b')]));_0x4669ca[_0xec83('0x3a')]=_0x4669ca[_0xec83('0x3a')][_0xec83('0x3c')]?_0x4669ca[_0xec83('0x3a')]:_0x578c1c['model'];_0x4669ca[_0xec83('0x3f')]=qs[_0xec83('0x40')](_0x4fb7ca[_0xec83('0x37')][_0xec83('0x40')]);_0x4669ca[_0xec83('0x41')]=qs['filters'](_[_0xec83('0x42')](_0x4fb7ca[_0xec83('0x37')],_0x578c1c[_0xec83('0x38')]));if(_0x4fb7ca['query'][_0xec83('0x43')]){_0x4669ca['where']=_[_0xec83('0x44')](_0x4669ca[_0xec83('0x41')],{'$or':_['map'](_0x4669ca[_0xec83('0x3a')],function(_0x22617b){var _0x39f7ce={};_0x39f7ce[_0x22617b]={'$like':'%'+_0x4fb7ca[_0xec83('0x37')][_0xec83('0x43')]+'%'};return _0x39f7ce;})});}_0x4669ca=_[_0xec83('0x44')]({},_0x4669ca,_0x4fb7ca['options']);return _0x547aff[_0xec83('0x83')](_0x4669ca);}})[_0xec83('0x28')](function(_0xe9853d){if(_0xe9853d){_0x5e827a=_0xe9853d[_0xec83('0x3c')];if(!_0x4fb7ca[_0xec83('0x37')][_0xec83('0x3d')]('nolimit')){_0x4669ca[_0xec83('0x20')]=qs[_0xec83('0x20')](_0x4fb7ca['query'][_0xec83('0x20')]);_0x4669ca['offset']=qs[_0xec83('0x1e')](_0x4fb7ca['query'][_0xec83('0x1e')]);}return _0x547aff['getAgents'](_0x4669ca);}})[_0xec83('0x28')](function(_0x528a63){if(_0x528a63){return _0x528a63?{'count':_0x5e827a,'rows':_0x528a63}:null;}})[_0xec83('0x28')](respondWithResult(_0x346f2d,null))[_0xec83('0x4f')](handleError(_0x346f2d,null));}; \ No newline at end of file +var _0xd5a0=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','status','json','offset','undefined','limit','count','apply','reject','save','then','get','FaxQueues','UserProfileResource','destroy','end','sendStatus','error','stack','name','index','map','FaxQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserFaxQueue','hasOwnProperty','User','agent','updatedAt','createdAt','rows','format','SIP','faxPause','Team','order','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','zip-dir'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xd5a0,0x1a8));var _0x0d5a=function(_0x274338,_0xabf940){_0x274338=_0x274338-0x0;var _0x34ef9d=_0xd5a0[_0x274338];return _0x34ef9d;};'use strict';var emlformat=require(_0x0d5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d5a('0x1'));var jsonpatch=require(_0x0d5a('0x2'));var rp=require(_0x0d5a('0x3'));var moment=require('moment');var BPromise=require(_0x0d5a('0x4'));var Mustache=require(_0x0d5a('0x5'));var util=require(_0x0d5a('0x6'));var path=require(_0x0d5a('0x7'));var sox=require(_0x0d5a('0x8'));var csv=require('to-csv');var ejs=require(_0x0d5a('0x9'));var fs=require('fs');var fs_extra=require(_0x0d5a('0xa'));var _=require(_0x0d5a('0xb'));var squel=require(_0x0d5a('0xc'));var crypto=require(_0x0d5a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0d5a('0xe'));var toCsv=require(_0x0d5a('0xf'));var querystring=require(_0x0d5a('0x10'));var Papa=require(_0x0d5a('0x11'));var Redis=require(_0x0d5a('0x12'));var authService=require(_0x0d5a('0x13'));var qs=require(_0x0d5a('0x14'));var as=require(_0x0d5a('0x15'));var hardwareService=require(_0x0d5a('0x16'));var logger=require(_0x0d5a('0x17'))(_0x0d5a('0x18'));var utils=require(_0x0d5a('0x19'));var config=require(_0x0d5a('0x1a'));var licenseUtil=require(_0x0d5a('0x1b'));var db=require(_0x0d5a('0x1c'))['db'];config[_0x0d5a('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d5a('0x1e'))(new Redis(config[_0x0d5a('0x1d')]));require(_0x0d5a('0x1f'))['register'](socket);function respondWithStatusCode(_0x2a6c3b,_0x416eaa){_0x416eaa=_0x416eaa||0xcc;return function(_0xaa839d){if(_0xaa839d){return _0x2a6c3b['sendStatus'](_0x416eaa);}return _0x2a6c3b[_0x0d5a('0x20')](_0x416eaa)['end']();};}function respondWithResult(_0x436578,_0x51f700){_0x51f700=_0x51f700||0xc8;return function(_0x3ba814){if(_0x3ba814){return _0x436578[_0x0d5a('0x20')](_0x51f700)[_0x0d5a('0x21')](_0x3ba814);}};}function respondWithFilteredResult(_0x280e60,_0x102ffb){return function(_0x24f30f){if(_0x24f30f){var _0x4e7911=typeof _0x102ffb[_0x0d5a('0x22')]===_0x0d5a('0x23')&&typeof _0x102ffb[_0x0d5a('0x24')]===_0x0d5a('0x23');var _0x49c6c2=_0x24f30f[_0x0d5a('0x25')];var _0x393eab=_0x4e7911?0x0:_0x102ffb[_0x0d5a('0x22')];var _0x4992e8=_0x4e7911?_0x24f30f['count']:_0x102ffb[_0x0d5a('0x22')]+_0x102ffb['limit'];var _0x55aba4;if(_0x4992e8>=_0x49c6c2){_0x4992e8=_0x49c6c2;_0x55aba4=0xc8;}else{_0x55aba4=0xce;}_0x280e60[_0x0d5a('0x20')](_0x55aba4);return _0x280e60['set']('Content-Range',_0x393eab+'-'+_0x4992e8+'/'+_0x49c6c2)[_0x0d5a('0x21')](_0x24f30f);}return null;};}function patchUpdates(_0x5ce7b3){return function(_0x4133b6){try{jsonpatch[_0x0d5a('0x26')](_0x4133b6,_0x5ce7b3,!![]);}catch(_0x20138a){return BPromise[_0x0d5a('0x27')](_0x20138a);}return _0x4133b6[_0x0d5a('0x28')]();};}function saveUpdates(_0x439c92,_0x1f4390){return function(_0x15ccd2){if(_0x15ccd2){return _0x15ccd2['update'](_0x439c92)[_0x0d5a('0x29')](function(_0x54a537){return _0x54a537;});}return null;};}function removeEntity(_0x56e81f,_0x3b9324){return function(_0x20732f){if(_0x20732f){return _0x20732f['destroy']()['then'](function(){var _0x436286=_0x20732f[_0x0d5a('0x2a')]({'plain':!![]});var _0x12a340=_0x0d5a('0x2b');return db[_0x0d5a('0x2c')][_0x0d5a('0x2d')]({'where':{'type':_0x12a340,'resourceId':_0x436286['id']}})[_0x0d5a('0x29')](function(){return _0x20732f;});})[_0x0d5a('0x29')](function(){_0x56e81f[_0x0d5a('0x20')](0xcc)[_0x0d5a('0x2e')]();});}};}function handleEntityNotFound(_0x4cb990,_0xa4557c){return function(_0x47702b){if(!_0x47702b){_0x4cb990[_0x0d5a('0x2f')](0x194);}return _0x47702b;};}function handleError(_0x265009,_0x5397fc){_0x5397fc=_0x5397fc||0x1f4;return function(_0x971940){logger[_0x0d5a('0x30')](_0x971940[_0x0d5a('0x31')]);if(_0x971940[_0x0d5a('0x32')]){delete _0x971940[_0x0d5a('0x32')];}_0x265009[_0x0d5a('0x20')](_0x5397fc)['send'](_0x971940);};}exports[_0x0d5a('0x33')]=function(_0x2bfa14,_0x798df3){var _0x1fda89={},_0x3247ac={},_0x2943fb={'count':0x0,'rows':[]};var _0x1a69bf=_[_0x0d5a('0x34')](db[_0x0d5a('0x35')]['rawAttributes'],function(_0x1a66c7){return{'name':_0x1a66c7[_0x0d5a('0x36')],'type':_0x1a66c7[_0x0d5a('0x37')][_0x0d5a('0x38')]};});_0x3247ac[_0x0d5a('0x39')]=_[_0x0d5a('0x34')](_0x1a69bf,_0x0d5a('0x32'));_0x3247ac[_0x0d5a('0x3a')]=_[_0x0d5a('0x3b')](_0x2bfa14[_0x0d5a('0x3a')]);_0x3247ac[_0x0d5a('0x3c')]=_[_0x0d5a('0x3d')](_0x3247ac[_0x0d5a('0x39')],_0x3247ac[_0x0d5a('0x3a')]);_0x1fda89[_0x0d5a('0x3e')]=_[_0x0d5a('0x3d')](_0x3247ac[_0x0d5a('0x39')],qs['fields'](_0x2bfa14[_0x0d5a('0x3a')][_0x0d5a('0x3f')]));_0x1fda89[_0x0d5a('0x3e')]=_0x1fda89[_0x0d5a('0x3e')][_0x0d5a('0x40')]?_0x1fda89[_0x0d5a('0x3e')]:_0x3247ac[_0x0d5a('0x39')];if(!_0x2bfa14[_0x0d5a('0x3a')]['hasOwnProperty'](_0x0d5a('0x41'))){_0x1fda89[_0x0d5a('0x24')]=qs[_0x0d5a('0x24')](_0x2bfa14[_0x0d5a('0x3a')][_0x0d5a('0x24')]);_0x1fda89['offset']=qs[_0x0d5a('0x22')](_0x2bfa14[_0x0d5a('0x3a')][_0x0d5a('0x22')]);}_0x1fda89['order']=qs[_0x0d5a('0x42')](_0x2bfa14['query'][_0x0d5a('0x42')]);_0x1fda89[_0x0d5a('0x43')]=qs[_0x0d5a('0x3c')](_[_0x0d5a('0x44')](_0x2bfa14[_0x0d5a('0x3a')],_0x3247ac['filters']),_0x1a69bf);if(_0x2bfa14[_0x0d5a('0x3a')][_0x0d5a('0x45')]){_0x1fda89[_0x0d5a('0x43')]=_[_0x0d5a('0x46')](_0x1fda89[_0x0d5a('0x43')],{'$or':_[_0x0d5a('0x34')](_0x1a69bf,function(_0x1c5d0d){if(_0x1c5d0d[_0x0d5a('0x37')]!==_0x0d5a('0x47')){var _0x4a4652={};_0x4a4652[_0x1c5d0d['name']]={'$like':'%'+_0x2bfa14[_0x0d5a('0x3a')][_0x0d5a('0x45')]+'%'};return _0x4a4652;}})});}_0x1fda89=_[_0x0d5a('0x46')]({},_0x1fda89,_0x2bfa14['options']);var _0x38cf7d={'where':_0x1fda89[_0x0d5a('0x43')]};return db[_0x0d5a('0x35')][_0x0d5a('0x25')](_0x38cf7d)[_0x0d5a('0x29')](function(_0x34c729){_0x2943fb[_0x0d5a('0x25')]=_0x34c729;if(_0x2bfa14[_0x0d5a('0x3a')][_0x0d5a('0x48')]){_0x1fda89[_0x0d5a('0x49')]=[{'all':!![]}];}return db[_0x0d5a('0x35')][_0x0d5a('0x4a')](_0x1fda89);})[_0x0d5a('0x29')](function(_0x313ac8){_0x2943fb['rows']=_0x313ac8;return _0x2943fb;})[_0x0d5a('0x29')](respondWithFilteredResult(_0x798df3,_0x1fda89))[_0x0d5a('0x4b')](handleError(_0x798df3,null));};exports['show']=function(_0x4abc59,_0x2fe13e){var _0x35c48c={'raw':!![],'where':{'id':_0x4abc59[_0x0d5a('0x4c')]['id']}},_0x4c73fc={};_0x4c73fc['model']=_[_0x0d5a('0x3b')](db['FaxQueue'][_0x0d5a('0x4d')]);_0x4c73fc[_0x0d5a('0x3a')]=_[_0x0d5a('0x3b')](_0x4abc59[_0x0d5a('0x3a')]);_0x4c73fc[_0x0d5a('0x3c')]=_[_0x0d5a('0x3d')](_0x4c73fc['model'],_0x4c73fc['query']);_0x35c48c[_0x0d5a('0x3e')]=_[_0x0d5a('0x3d')](_0x4c73fc[_0x0d5a('0x39')],qs[_0x0d5a('0x3f')](_0x4abc59[_0x0d5a('0x3a')][_0x0d5a('0x3f')]));_0x35c48c[_0x0d5a('0x3e')]=_0x35c48c[_0x0d5a('0x3e')][_0x0d5a('0x40')]?_0x35c48c['attributes']:_0x4c73fc[_0x0d5a('0x39')];if(_0x4abc59[_0x0d5a('0x3a')][_0x0d5a('0x48')]){_0x35c48c['include']=[{'all':!![]}];}_0x35c48c=_[_0x0d5a('0x46')]({},_0x35c48c,_0x4abc59[_0x0d5a('0x4e')]);return db[_0x0d5a('0x35')][_0x0d5a('0x4f')](_0x35c48c)[_0x0d5a('0x29')](handleEntityNotFound(_0x2fe13e,null))[_0x0d5a('0x29')](respondWithResult(_0x2fe13e,null))['catch'](handleError(_0x2fe13e,null));};exports['create']=function(_0x4d93fb,_0x59a09c){return db[_0x0d5a('0x35')][_0x0d5a('0x50')](_0x4d93fb['body'],{})[_0x0d5a('0x29')](function(_0x546bb6){var _0xaa1892=_0x4d93fb[_0x0d5a('0x51')][_0x0d5a('0x2a')]({'plain':!![]});if(!_0xaa1892)throw new Error(_0x0d5a('0x52'));if(_0xaa1892[_0x0d5a('0x53')]===_0x0d5a('0x51')){var _0x1861dc=_0x546bb6[_0x0d5a('0x2a')]({'plain':!![]});var _0x211980=_0x0d5a('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x211980,'userProfileId':_0xaa1892[_0x0d5a('0x54')]},'raw':!![]})['then'](function(_0x2ba422){if(_0x2ba422&&_0x2ba422[_0x0d5a('0x55')]===0x0){return db[_0x0d5a('0x2c')][_0x0d5a('0x50')]({'name':_0x1861dc[_0x0d5a('0x32')],'resourceId':_0x1861dc['id'],'type':_0x2ba422[_0x0d5a('0x32')],'sectionId':_0x2ba422['id']},{})['then'](function(){return _0x546bb6;});}else{return _0x546bb6;}})[_0x0d5a('0x4b')](function(_0x39300c){logger[_0x0d5a('0x30')](_0x0d5a('0x56'),_0x39300c);throw _0x39300c;});}return _0x546bb6;})['then'](respondWithResult(_0x59a09c,0xc9))[_0x0d5a('0x4b')](handleError(_0x59a09c,null));};exports[_0x0d5a('0x57')]=function(_0x5ed12a,_0x4816c1){if(_0x5ed12a[_0x0d5a('0x58')]['id']){delete _0x5ed12a[_0x0d5a('0x58')]['id'];}return db[_0x0d5a('0x35')][_0x0d5a('0x4f')]({'where':{'id':_0x5ed12a[_0x0d5a('0x4c')]['id']}})[_0x0d5a('0x29')](handleEntityNotFound(_0x4816c1,null))[_0x0d5a('0x29')](saveUpdates(_0x5ed12a['body'],null))[_0x0d5a('0x29')](respondWithResult(_0x4816c1,null))[_0x0d5a('0x4b')](handleError(_0x4816c1,null));};exports[_0x0d5a('0x2d')]=function(_0x35c25b,_0x4996ec){return db[_0x0d5a('0x35')][_0x0d5a('0x4f')]({'where':{'id':_0x35c25b[_0x0d5a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4996ec,null))['then'](removeEntity(_0x4996ec,null))[_0x0d5a('0x4b')](handleError(_0x4996ec,null));};exports[_0x0d5a('0x59')]=function(_0x42d1fd,_0x4cbb1e){return db[_0x0d5a('0x35')][_0x0d5a('0x59')]()[_0x0d5a('0x29')](respondWithResult(_0x4cbb1e,null))['catch'](handleError(_0x4cbb1e,null));};exports[_0x0d5a('0x5a')]=function(_0x225b6a,_0x4cdc8f,_0x3465d0){var _0x3fe340={'raw':!![],'where':{}},_0x595228={},_0x3b8e49;return db[_0x0d5a('0x35')]['findOne']({'where':{'id':_0x225b6a[_0x0d5a('0x4c')]['id']}})[_0x0d5a('0x29')](handleEntityNotFound(_0x4cdc8f,null))[_0x0d5a('0x29')](function(_0x53b527){if(_0x53b527){_0x3b8e49=_0x53b527[_0x0d5a('0x2a')]({'plain':!![]});_0x595228[_0x0d5a('0x39')]=_[_0x0d5a('0x3b')](db[_0x0d5a('0x5b')][_0x0d5a('0x4d')]);_0x595228[_0x0d5a('0x3a')]=_[_0x0d5a('0x3b')](_0x225b6a[_0x0d5a('0x3a')]);_0x595228[_0x0d5a('0x3c')]=_[_0x0d5a('0x3d')](_0x595228[_0x0d5a('0x39')],_0x595228[_0x0d5a('0x3a')]);_0x3fe340[_0x0d5a('0x3e')]=_[_0x0d5a('0x3d')](_0x595228['model'],qs[_0x0d5a('0x3f')](_0x225b6a[_0x0d5a('0x3a')][_0x0d5a('0x3f')]));_0x3fe340['attributes']=_0x3fe340[_0x0d5a('0x3e')]['length']?_0x3fe340[_0x0d5a('0x3e')]:_0x595228[_0x0d5a('0x39')];if(!_0x225b6a['query'][_0x0d5a('0x5c')]('nolimit')){_0x3fe340[_0x0d5a('0x24')]=qs[_0x0d5a('0x24')](_0x225b6a['query']['limit']);_0x3fe340['offset']=qs[_0x0d5a('0x22')](_0x225b6a[_0x0d5a('0x3a')][_0x0d5a('0x22')]);}_0x3fe340['order']=qs[_0x0d5a('0x42')](_0x225b6a[_0x0d5a('0x3a')][_0x0d5a('0x42')]);_0x3fe340[_0x0d5a('0x43')]=qs[_0x0d5a('0x3c')](_['pick'](_0x225b6a[_0x0d5a('0x3a')],_0x595228[_0x0d5a('0x3c')]));_0x3fe340[_0x0d5a('0x43')]['FaxQueueId']=_0x53b527['id'];if(_0x225b6a[_0x0d5a('0x3a')][_0x0d5a('0x45')]){_0x3fe340[_0x0d5a('0x43')]=_[_0x0d5a('0x46')](_0x3fe340[_0x0d5a('0x43')],{'$or':_['map'](_0x3fe340[_0x0d5a('0x3e')],function(_0x547c75){var _0x2a8260={};_0x2a8260[_0x547c75]={'$like':'%'+_0x225b6a[_0x0d5a('0x3a')][_0x0d5a('0x45')]+'%'};return _0x2a8260;})});}_0x3fe340=_[_0x0d5a('0x46')]({},_0x3fe340,_0x225b6a[_0x0d5a('0x4e')]);return db[_0x0d5a('0x5b')]['findAll'](_0x3fe340);}})[_0x0d5a('0x29')](function(_0x1948d5){if(_0x1948d5){return db[_0x0d5a('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x1948d5,'UserId'),'role':_0x0d5a('0x5e')},'attributes':['id',_0x0d5a('0x32'),'faxPause',_0x0d5a('0x5f'),_0x0d5a('0x60')]});}})[_0x0d5a('0x29')](function(_0x1540f4){if(_0x1540f4){return{'count':_0x1540f4[_0x0d5a('0x25')],'rows':_[_0x0d5a('0x34')](_0x1540f4[_0x0d5a('0x61')],function(_0x133b8f){return{'membername':_0x133b8f[_0x0d5a('0x32')],'UserId':_0x133b8f['id'],'queue_name':_0x3b8e49[_0x0d5a('0x32')],'FaxQueueId':_0x3b8e49['id'],'interface':util[_0x0d5a('0x62')]('%s/%s',_0x0d5a('0x63'),_0x133b8f[_0x0d5a('0x32')]),'penalty':0x0,'paused':_0x133b8f[_0x0d5a('0x64')],'createdAt':_0x133b8f[_0x0d5a('0x60')],'updatedAt':_0x133b8f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d5a('0x29')](respondWithFilteredResult(_0x4cdc8f,_0x3fe340))[_0x0d5a('0x4b')](handleError(_0x4cdc8f,null));};exports['getTeams']=function(_0x144c06,_0xbc68f8,_0x39d137){var _0x586067={};var _0xfd4dde={};var _0x1b8349;var _0x2730cb;return db[_0x0d5a('0x35')]['findOne']({'where':{'id':_0x144c06['params']['id']}})['then'](handleEntityNotFound(_0xbc68f8,null))['then'](function(_0x2b495){if(_0x2b495){_0x1b8349=_0x2b495;_0xfd4dde[_0x0d5a('0x39')]=_['keys'](db[_0x0d5a('0x65')]['rawAttributes']);_0xfd4dde[_0x0d5a('0x3a')]=_[_0x0d5a('0x3b')](_0x144c06[_0x0d5a('0x3a')]);_0xfd4dde[_0x0d5a('0x3c')]=_['intersection'](_0xfd4dde[_0x0d5a('0x39')],_0xfd4dde[_0x0d5a('0x3a')]);_0x586067[_0x0d5a('0x3e')]=_['intersection'](_0xfd4dde[_0x0d5a('0x39')],qs[_0x0d5a('0x3f')](_0x144c06[_0x0d5a('0x3a')][_0x0d5a('0x3f')]));_0x586067[_0x0d5a('0x3e')]=_0x586067[_0x0d5a('0x3e')][_0x0d5a('0x40')]?_0x586067[_0x0d5a('0x3e')]:_0xfd4dde['model'];_0x586067[_0x0d5a('0x66')]=qs['sort'](_0x144c06[_0x0d5a('0x3a')][_0x0d5a('0x42')]);_0x586067[_0x0d5a('0x43')]=qs[_0x0d5a('0x3c')](_['pick'](_0x144c06[_0x0d5a('0x3a')],_0xfd4dde['filters']));if(_0x144c06[_0x0d5a('0x3a')]['filter']){_0x586067[_0x0d5a('0x43')]=_['merge'](_0x586067[_0x0d5a('0x43')],{'$or':_[_0x0d5a('0x34')](_0x586067[_0x0d5a('0x3e')],function(_0x56444d){var _0x3125d1={};_0x3125d1[_0x56444d]={'$like':'%'+_0x144c06[_0x0d5a('0x3a')][_0x0d5a('0x45')]+'%'};return _0x3125d1;})});}_0x586067=_[_0x0d5a('0x46')]({},_0x586067,_0x144c06[_0x0d5a('0x4e')]);return _0x1b8349['getTeams'](_0x586067);}})[_0x0d5a('0x29')](function(_0x38ef94){if(_0x38ef94){_0x2730cb=_0x38ef94[_0x0d5a('0x40')];if(!_0x144c06[_0x0d5a('0x3a')][_0x0d5a('0x5c')](_0x0d5a('0x41'))){_0x586067[_0x0d5a('0x24')]=qs['limit'](_0x144c06[_0x0d5a('0x3a')][_0x0d5a('0x24')]);_0x586067[_0x0d5a('0x22')]=qs['offset'](_0x144c06[_0x0d5a('0x3a')][_0x0d5a('0x22')]);}return _0x1b8349[_0x0d5a('0x67')](_0x586067);}})[_0x0d5a('0x29')](function(_0x3b83ed){if(_0x3b83ed){return _0x3b83ed?{'count':_0x2730cb,'rows':_0x3b83ed}:null;}})['then'](respondWithResult(_0xbc68f8,null))[_0x0d5a('0x4b')](handleError(_0xbc68f8,null));};exports[_0x0d5a('0x68')]=function(_0x2dadf2,_0x1ac972,_0x54d5d0){var _0x1e342b=_0x2dadf2['body'][_0x0d5a('0x69')];return db['Team']['findAll']({'where':{'id':_0x1e342b},'attributes':['id'],'include':[{'model':db[_0x0d5a('0x5d')],'as':_0x0d5a('0x6a'),'attributes':['id',_0x0d5a('0x32'),_0x0d5a('0x6b'),_0x0d5a('0x6c'),_0x0d5a('0x6d')],'raw':!![]}]})[_0x0d5a('0x29')](function(_0x3900f7){if(_0x3900f7){var _0x2c3990=_['flatMap'](_0x3900f7,function(_0x5ef227){var _0x32ca14=_0x5ef227['get']({'plain':!![]});return _0x32ca14[_0x0d5a('0x6a')];});return db[_0x0d5a('0x35')][_0x0d5a('0x4f')]({'where':{'id':_0x2dadf2[_0x0d5a('0x4c')]['id']}})['then'](function(_0x2f306b){return db[_0x0d5a('0x6e')][_0x0d5a('0x6f')](function(_0x5a420e){return _0x2f306b[_0x0d5a('0x68')](_0x1e342b,{'transaction':_0x5a420e})[_0x0d5a('0x29')](function(){return BPromise['each'](_0x2c3990,function(_0x93127b){return db[_0x0d5a('0x5b')][_0x0d5a('0x70')]({'where':{'UserId':_0x93127b['id'],'FaxQueueId':_0x2dadf2[_0x0d5a('0x4c')]['id']},'transaction':_0x5a420e});});})['then'](function(){_0x2c3990[_0x0d5a('0x71')](function(_0x4ab27f){socket[_0x0d5a('0x72')](_0x0d5a('0x73'),{'UserId':_0x4ab27f['id'],'FaxQueueId':_0x2f306b['id']});});});});});}})[_0x0d5a('0x29')](respondWithStatusCode(_0x1ac972,null))[_0x0d5a('0x4b')](handleError(_0x1ac972,null));};exports[_0x0d5a('0x74')]=function(_0x3c9b08,_0x2bf546,_0x337c50){return db['Team'][_0x0d5a('0x4a')]({'where':{'id':_0x3c9b08[_0x0d5a('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0d5a('0x5d')],'as':_0x0d5a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x0d5a('0x29')](handleEntityNotFound(_0x2bf546,null))[_0x0d5a('0x29')](function(_0x10641b){var _0x3b279a=_[_0x0d5a('0x34')](_0x10641b,'id');var _0x53b24e=[];var _0x4fe40c=[];var _0x3b240a=squel[_0x0d5a('0x75')]();_0x3b240a[_0x0d5a('0x76')]('tq.TeamId')[_0x0d5a('0x77')](_0x0d5a('0x78'),'tq')['join'](_0x0d5a('0x79'),'ut',_0x0d5a('0x7a'))[_0x0d5a('0x43')](_0x0d5a('0x7b'),_0x3c9b08[_0x0d5a('0x4c')]['id']);for(var _0x4ff344=0x0;_0x4ff344<_0x10641b[_0x0d5a('0x40')];_0x4ff344+=0x1){let _0x1e884e=_0x10641b[_0x4ff344];for(var _0x22f1fe=0x0;_0x22f1fe<_0x1e884e[_0x0d5a('0x6a')][_0x0d5a('0x40')];_0x22f1fe+=0x1){let _0x5e4a8d=_0x1e884e[_0x0d5a('0x6a')][_0x22f1fe];var _0x222637=_0x3b240a[_0x0d5a('0x7c')]();_0x222637[_0x0d5a('0x43')]('ut.UserId\x20=\x20?',_0x5e4a8d['id']);_0x4fe40c['push'](db['sequelize'][_0x0d5a('0x3a')](_0x222637[_0x0d5a('0x7d')](),{'type':db['sequelize'][_0x0d5a('0x7e')][_0x0d5a('0x7f')]})[_0x0d5a('0x29')](function(_0x3c3416){if(_0x3c3416[_0x0d5a('0x40')]===0x1){return _0x5e4a8d['id'];}else{var _0x518fdb=_['every'](_[_0x0d5a('0x34')](_0x3c3416,_0x0d5a('0x80')),function(_0x255fb9){return _['includes'](_0x3b279a,_0x255fb9);});if(_0x518fdb){return _0x5e4a8d['id'];}}}));}}return BPromise[_0x0d5a('0x81')](_0x4fe40c)[_0x0d5a('0x29')](function(_0x215a17){_0x53b24e=_(_0x53b24e)[_0x0d5a('0x82')](_0x215a17)[_0x0d5a('0x83')]()[_0x0d5a('0x84')]();return db[_0x0d5a('0x35')][_0x0d5a('0x4f')]({'where':{'id':_0x3c9b08['params']['id']}})[_0x0d5a('0x29')](function(_0x6479b4){return db[_0x0d5a('0x6e')]['transaction'](function(_0x5039f1){return _0x6479b4[_0x0d5a('0x74')](_0x3c9b08[_0x0d5a('0x3a')][_0x0d5a('0x69')],{'transaction':_0x5039f1})[_0x0d5a('0x29')](function(){if(!_[_0x0d5a('0x85')](_0x53b24e)){return _0x6479b4[_0x0d5a('0x86')](_0x53b24e,{'transaction':_0x5039f1});}})['then'](function(){_0x53b24e[_0x0d5a('0x71')](function(_0x527bd5){socket[_0x0d5a('0x72')](_0x0d5a('0x87'),{'UserId':_0x527bd5,'FaxQueueId':_0x6479b4['id']});});});});});});})[_0x0d5a('0x29')](respondWithStatusCode(_0x2bf546,null))[_0x0d5a('0x4b')](handleError(_0x2bf546,null));};exports[_0x0d5a('0x88')]=function(_0x33b928,_0x387df1,_0x18e8a4){return db['FaxQueue'][_0x0d5a('0x4f')]({'where':{'id':_0x33b928[_0x0d5a('0x4c')]['id']}})[_0x0d5a('0x29')](handleEntityNotFound(_0x387df1,null))[_0x0d5a('0x29')](function(_0x53346b){if(_0x53346b){return _0x53346b['addAgents'](_0x33b928[_0x0d5a('0x58')][_0x0d5a('0x69')],_[_0x0d5a('0x89')](_0x33b928[_0x0d5a('0x58')],[_0x0d5a('0x69'),'id'])||{})[_0x0d5a('0x8a')](function(_0xec4543){for(var _0xc457b=0x0;_0xc457b<_0x33b928[_0x0d5a('0x58')][_0x0d5a('0x69')][_0x0d5a('0x40')];_0xc457b+=0x1){socket[_0x0d5a('0x72')](_0x0d5a('0x73'),{'UserId':Number(_0x33b928['body']['ids'][_0xc457b]),'FaxQueueId':Number(_0x33b928[_0x0d5a('0x4c')]['id'])});}return _0xec4543;});}})[_0x0d5a('0x29')](respondWithResult(_0x387df1,null))[_0x0d5a('0x4b')](handleError(_0x387df1,null));};exports[_0x0d5a('0x86')]=function(_0x5e1887,_0xb58a4d,_0x105fd9){return db[_0x0d5a('0x35')][_0x0d5a('0x4f')]({'where':{'id':_0x5e1887[_0x0d5a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb58a4d,null))[_0x0d5a('0x29')](function(_0x5724ef){if(_0x5724ef){return _0x5724ef[_0x0d5a('0x86')](_0x5e1887[_0x0d5a('0x3a')][_0x0d5a('0x69')])[_0x0d5a('0x29')](function(){if(_[_0x0d5a('0x8b')](_0x5e1887[_0x0d5a('0x3a')][_0x0d5a('0x69')])){for(var _0xed22b8=0x0;_0xed22b8<_0x5e1887['query'][_0x0d5a('0x69')][_0x0d5a('0x40')];_0xed22b8+=0x1){socket[_0x0d5a('0x72')](_0x0d5a('0x87'),{'UserId':Number(_0x5e1887[_0x0d5a('0x3a')]['ids'][_0xed22b8]),'FaxQueueId':Number(_0x5e1887['params']['id'])});}}else{socket['emit'](_0x0d5a('0x87'),{'UserId':Number(_0x5e1887[_0x0d5a('0x3a')][_0x0d5a('0x69')]),'FaxQueueId':Number(_0x5e1887[_0x0d5a('0x4c')]['id'])});}});}})[_0x0d5a('0x29')](respondWithStatusCode(_0xb58a4d,null))[_0x0d5a('0x4b')](handleError(_0xb58a4d,null));};exports[_0x0d5a('0x8c')]=function(_0xc5925d,_0x432aad,_0x569cdc){var _0x1117f4={};var _0x2410ec={};var _0x5436ef;var _0x1d8bc6;return db[_0x0d5a('0x35')][_0x0d5a('0x8d')]({'where':{'id':_0xc5925d['params']['id']}})[_0x0d5a('0x29')](handleEntityNotFound(_0x432aad,null))[_0x0d5a('0x29')](function(_0x297ba1){if(_0x297ba1){_0x5436ef=_0x297ba1;_0x2410ec[_0x0d5a('0x39')]=_[_0x0d5a('0x3b')](db[_0x0d5a('0x5d')][_0x0d5a('0x4d')]);_0x2410ec[_0x0d5a('0x3a')]=_['keys'](_0xc5925d[_0x0d5a('0x3a')]);_0x2410ec['filters']=_[_0x0d5a('0x3d')](_0x2410ec[_0x0d5a('0x39')],_0x2410ec[_0x0d5a('0x3a')]);_0x1117f4[_0x0d5a('0x3e')]=_[_0x0d5a('0x3d')](_0x2410ec[_0x0d5a('0x39')],qs[_0x0d5a('0x3f')](_0xc5925d[_0x0d5a('0x3a')]['fields']));_0x1117f4['attributes']=_0x1117f4[_0x0d5a('0x3e')][_0x0d5a('0x40')]?_0x1117f4[_0x0d5a('0x3e')]:_0x2410ec['model'];_0x1117f4['order']=qs['sort'](_0xc5925d[_0x0d5a('0x3a')][_0x0d5a('0x42')]);_0x1117f4[_0x0d5a('0x43')]=qs['filters'](_[_0x0d5a('0x44')](_0xc5925d[_0x0d5a('0x3a')],_0x2410ec[_0x0d5a('0x3c')]));if(_0xc5925d['query'][_0x0d5a('0x45')]){_0x1117f4[_0x0d5a('0x43')]=_[_0x0d5a('0x46')](_0x1117f4['where'],{'$or':_[_0x0d5a('0x34')](_0x1117f4[_0x0d5a('0x3e')],function(_0x386bc4){var _0x5acd6c={};_0x5acd6c[_0x386bc4]={'$like':'%'+_0xc5925d[_0x0d5a('0x3a')]['filter']+'%'};return _0x5acd6c;})});}_0x1117f4=_['merge']({},_0x1117f4,_0xc5925d['options']);return _0x5436ef[_0x0d5a('0x8c')](_0x1117f4);}})[_0x0d5a('0x29')](function(_0x3d12ba){if(_0x3d12ba){_0x1d8bc6=_0x3d12ba[_0x0d5a('0x40')];if(!_0xc5925d[_0x0d5a('0x3a')][_0x0d5a('0x5c')]('nolimit')){_0x1117f4[_0x0d5a('0x24')]=qs['limit'](_0xc5925d[_0x0d5a('0x3a')][_0x0d5a('0x24')]);_0x1117f4[_0x0d5a('0x22')]=qs[_0x0d5a('0x22')](_0xc5925d[_0x0d5a('0x3a')][_0x0d5a('0x22')]);}return _0x5436ef[_0x0d5a('0x8c')](_0x1117f4);}})[_0x0d5a('0x29')](function(_0x12295d){if(_0x12295d){return _0x12295d?{'count':_0x1d8bc6,'rows':_0x12295d}:null;}})['then'](respondWithResult(_0x432aad,null))[_0x0d5a('0x4b')](handleError(_0x432aad,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f196595..5d28b38 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 _0x6312=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x547d75,_0x2ece5a){var _0xcfa423=function(_0x43e1c9){while(--_0x43e1c9){_0x547d75['push'](_0x547d75['shift']());}};_0xcfa423(++_0x2ece5a);}(_0x6312,0x1b3));var _0x2631=function(_0x1d745a,_0x33dd78){_0x1d745a=_0x1d745a-0x0;var _0x483f7d=_0x6312[_0x1d745a];return _0x483f7d;};'use strict';var EventEmitter=require(_0x2631('0x0'));var FaxQueue=require(_0x2631('0x1'))['db'][_0x2631('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2631('0x3')](0x0);var events={'afterCreate':_0x2631('0x4'),'afterUpdate':_0x2631('0x5'),'afterDestroy':'remove'};function emitEvent(_0x15418a){return function(_0x29a767,_0x527766,_0x39eeb5){FaxQueueEvents[_0x2631('0x6')](_0x15418a+':'+_0x29a767['id'],_0x29a767);FaxQueueEvents[_0x2631('0x6')](_0x15418a,_0x29a767);_0x39eeb5(null);};}for(var e in events){if(events[_0x2631('0x7')](e)){var event=events[e];FaxQueue[_0x2631('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x586b=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','save'];(function(_0x3c8793,_0x5e8b3d){var _0x1811a7=function(_0x4619ee){while(--_0x4619ee){_0x3c8793['push'](_0x3c8793['shift']());}};_0x1811a7(++_0x5e8b3d);}(_0x586b,0xa7));var _0xb586=function(_0x46167c,_0x50f20d){_0x46167c=_0x46167c-0x0;var _0x26491c=_0x586b[_0x46167c];return _0x26491c;};'use strict';var EventEmitter=require(_0xb586('0x0'));var FaxQueue=require(_0xb586('0x1'))['db'][_0xb586('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb586('0x3'),'afterUpdate':_0xb586('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8671a4){return function(_0x437b43,_0x1fcb44,_0x14d70a){FaxQueueEvents[_0xb586('0x5')](_0x8671a4+':'+_0x437b43['id'],_0x437b43);FaxQueueEvents[_0xb586('0x5')](_0x8671a4,_0x437b43);_0x14d70a(null);};}for(var e in events){if(events[_0xb586('0x6')](e)){var event=events[e];FaxQueue[_0xb586('0x7')](e,emitEvent(event));}}module[_0xb586('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 09ba0f6..7f6db6b 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 _0x7e19=['../../config/environment','exports','define','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x2f2c0d,_0xbd4f29){var _0x290012=function(_0x1cdf08){while(--_0x1cdf08){_0x2f2c0d['push'](_0x2f2c0d['shift']());}};_0x290012(++_0xbd4f29);}(_0x7e19,0x1a1));var _0x97e1=function(_0x5147ef,_0x5da775){_0x5147ef=_0x5147ef-0x0;var _0x2e991c=_0x7e19[_0x5147ef];return _0x2e991c;};'use strict';var _=require(_0x97e1('0x0'));var util=require(_0x97e1('0x1'));var logger=require(_0x97e1('0x2'))('api');var moment=require(_0x97e1('0x3'));var BPromise=require('bluebird');var rp=require(_0x97e1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97e1('0x5'));var config=require(_0x97e1('0x6'));var attributes=require('./faxQueue.attributes');module[_0x97e1('0x7')]=function(_0x3e33e7,_0x229099){return _0x3e33e7[_0x97e1('0x8')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc8b=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x45e604,_0x58a542){var _0x4948f8=function(_0x47a93e){while(--_0x47a93e){_0x45e604['push'](_0x45e604['shift']());}};_0x4948f8(++_0x58a542);}(_0xfc8b,0xd6));var _0xbfc8=function(_0x247eba,_0x139ad1){_0x247eba=_0x247eba-0x0;var _0x5a68d8=_0xfc8b[_0x247eba];return _0x5a68d8;};'use strict';var _=require(_0xbfc8('0x0'));var util=require(_0xbfc8('0x1'));var logger=require(_0xbfc8('0x2'))('api');var moment=require(_0xbfc8('0x3'));var BPromise=require(_0xbfc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfc8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbfc8('0x6'));module[_0xbfc8('0x7')]=function(_0x26603f,_0x34977a){return _0x26603f[_0xbfc8('0x8')](_0xbfc8('0x9'),attributes,{'tableName':_0xbfc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index e9a7ed8..9df634d 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 _0xb876=['ShowFaxQueue','find','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x37a28c,_0x2ad285){var _0x4e44aa=function(_0x234a58){while(--_0x234a58){_0x37a28c['push'](_0x37a28c['shift']());}};_0x4e44aa(++_0x2ad285);}(_0xb876,0x14a));var _0x6b87=function(_0x1c2f11,_0x376020){_0x1c2f11=_0x1c2f11-0x0;var _0x4a1bb9=_0xb876[_0x1c2f11];return _0x4a1bb9;};'use strict';var _=require(_0x6b87('0x0'));var util=require(_0x6b87('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b87('0x2'));var fs=require('fs');var Redis=require(_0x6b87('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b87('0x4'));var logger=require(_0x6b87('0x5'))(_0x6b87('0x6'));var config=require(_0x6b87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6b87('0x8')]['http']({'port':0x232a});config['redis']=_[_0x6b87('0x9')](config[_0x6b87('0xa')],{'host':_0x6b87('0xb'),'port':0x18eb});var socket=require(_0x6b87('0xc'))(new Redis(config[_0x6b87('0xa')]));require(_0x6b87('0xd'))[_0x6b87('0xe')](socket);function respondWithRpcPromise(_0x3834c7,_0x39b623,_0x32f3d5){return new BPromise(function(_0x4247a5,_0x524066){return client[_0x6b87('0xf')](_0x3834c7,_0x32f3d5)['then'](function(_0x325849){logger[_0x6b87('0x10')](_0x6b87('0x11'),_0x39b623,_0x6b87('0x12'));logger[_0x6b87('0x13')](_0x6b87('0x14'),_0x39b623,_0x6b87('0x12'),JSON[_0x6b87('0x15')](_0x325849));if(_0x325849[_0x6b87('0x16')]){if(_0x325849[_0x6b87('0x16')][_0x6b87('0x17')]===0x1f4){logger['error'](_0x6b87('0x11'),_0x39b623,_0x325849[_0x6b87('0x16')]['message']);return _0x524066(_0x325849[_0x6b87('0x16')][_0x6b87('0x18')]);}logger[_0x6b87('0x16')]('FaxQueue,\x20%s,\x20%s',_0x39b623,_0x325849['error'][_0x6b87('0x18')]);return _0x4247a5(_0x325849[_0x6b87('0x16')]['message']);}else{logger[_0x6b87('0x10')](_0x6b87('0x11'),_0x39b623,'request\x20sent');_0x4247a5(_0x325849[_0x6b87('0x19')][_0x6b87('0x18')]);}})[_0x6b87('0x1a')](function(_0x546bd1){logger[_0x6b87('0x16')](_0x6b87('0x11'),_0x39b623,_0x546bd1);_0x524066(_0x546bd1);});});}exports[_0x6b87('0x1b')]=function(_0xee5f3a){var _0x243ed2=this;return new Promise(function(_0x48272e,_0x5605a0){return db[_0x6b87('0x1c')][_0x6b87('0x1d')]({'raw':_0xee5f3a[_0x6b87('0x1e')]?_0xee5f3a[_0x6b87('0x1e')][_0x6b87('0x1f')]===undefined?!![]:![]:!![],'where':_0xee5f3a['options']?_0xee5f3a['options'][_0x6b87('0x20')]||null:null,'attributes':_0xee5f3a['options']?_0xee5f3a[_0x6b87('0x1e')][_0x6b87('0x21')]||null:null,'limit':_0xee5f3a[_0x6b87('0x1e')]?_0xee5f3a[_0x6b87('0x1e')][_0x6b87('0x22')]||null:null,'include':_0xee5f3a[_0x6b87('0x1e')]?_0xee5f3a[_0x6b87('0x1e')][_0x6b87('0x23')]?_[_0x6b87('0x24')](_0xee5f3a['options']['include'],function(_0x3aa24a){return{'model':db[_0x3aa24a[_0x6b87('0x25')]],'as':_0x3aa24a['as'],'attributes':_0x3aa24a[_0x6b87('0x21')],'include':_0x3aa24a[_0x6b87('0x23')]?_[_0x6b87('0x24')](_0x3aa24a[_0x6b87('0x23')],function(_0x3a193e){return{'model':db[_0x3a193e[_0x6b87('0x25')]],'as':_0x3a193e['as'],'attributes':_0x3a193e[_0x6b87('0x21')],'include':_0x3a193e[_0x6b87('0x23')]?_[_0x6b87('0x24')](_0x3a193e['include'],function(_0x47d772){return{'model':db[_0x47d772[_0x6b87('0x25')]],'as':_0x47d772['as'],'attributes':_0x47d772[_0x6b87('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6b87('0x26')](function(_0x37c93e){logger[_0x6b87('0x10')]('GetFaxQueue',_0xee5f3a);logger[_0x6b87('0x13')](_0x6b87('0x1b'),_0xee5f3a,JSON[_0x6b87('0x15')](_0x37c93e));_0x48272e(_0x37c93e);})[_0x6b87('0x1a')](function(_0x5b77b5){logger['error'](_0x6b87('0x1b'),_0x5b77b5['message'],_0xee5f3a);_0x5605a0(_0x243ed2[_0x6b87('0x16')](0x1f4,_0x5b77b5[_0x6b87('0x18')]));});});};exports[_0x6b87('0x27')]=function(_0x236873){var _0x2fe17f=this;return new Promise(function(_0x10b9b5,_0x44a363){return db[_0x6b87('0x1c')][_0x6b87('0x28')]({'raw':_0x236873[_0x6b87('0x1e')]?_0x236873[_0x6b87('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x236873[_0x6b87('0x1e')]?_0x236873[_0x6b87('0x1e')][_0x6b87('0x20')]||null:null,'attributes':_0x236873[_0x6b87('0x1e')]?_0x236873[_0x6b87('0x1e')][_0x6b87('0x21')]||null:null,'include':_0x236873[_0x6b87('0x1e')]?_0x236873['options']['include']?_[_0x6b87('0x24')](_0x236873[_0x6b87('0x1e')]['include'],function(_0x16b546){return{'model':db[_0x16b546[_0x6b87('0x25')]],'as':_0x16b546['as'],'attributes':_0x16b546[_0x6b87('0x21')],'include':_0x16b546[_0x6b87('0x23')]?_[_0x6b87('0x24')](_0x16b546[_0x6b87('0x23')],function(_0x5169c0){return{'model':db[_0x5169c0[_0x6b87('0x25')]],'as':_0x5169c0['as'],'attributes':_0x5169c0[_0x6b87('0x21')],'include':_0x5169c0[_0x6b87('0x23')]?_[_0x6b87('0x24')](_0x5169c0[_0x6b87('0x23')],function(_0x32b9e1){return{'model':db[_0x32b9e1[_0x6b87('0x25')]],'as':_0x32b9e1['as'],'attributes':_0x32b9e1[_0x6b87('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6b87('0x26')](function(_0x39000e){logger[_0x6b87('0x10')]('ShowFaxQueue',_0x236873);logger[_0x6b87('0x13')](_0x6b87('0x27'),_0x236873,JSON[_0x6b87('0x15')](_0x39000e));_0x10b9b5(_0x39000e);})[_0x6b87('0x1a')](function(_0x3b4acb){logger['error'](_0x6b87('0x27'),_0x3b4acb[_0x6b87('0x18')],_0x236873);_0x44a363(_0x2fe17f[_0x6b87('0x16')](0x1f4,_0x3b4acb[_0x6b87('0x18')]));});});}; \ No newline at end of file +var _0x0779=['error','message','catch','GetFaxQueue','FaxQueue','options','raw','where','include','map','model','attributes','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0xa22aeb,_0x5864d0){var _0x361646=function(_0x2451a6){while(--_0x2451a6){_0xa22aeb['push'](_0xa22aeb['shift']());}};_0x361646(++_0x5864d0);}(_0x0779,0xf7));var _0x9077=function(_0x1825db,_0x429e83){_0x1825db=_0x1825db-0x0;var _0x4d24ac=_0x0779[_0x1825db];return _0x4d24ac;};'use strict';var _=require(_0x9077('0x0'));var util=require(_0x9077('0x1'));var moment=require(_0x9077('0x2'));var BPromise=require(_0x9077('0x3'));var rs=require(_0x9077('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9077('0x5'))['db'];var utils=require(_0x9077('0x6'));var logger=require(_0x9077('0x7'))(_0x9077('0x8'));var config=require(_0x9077('0x9'));var jayson=require(_0x9077('0xa'));var client=jayson[_0x9077('0xb')]['http']({'port':0x232a});config[_0x9077('0xc')]=_[_0x9077('0xd')](config[_0x9077('0xc')],{'host':_0x9077('0xe'),'port':0x18eb});var socket=require(_0x9077('0xf'))(new Redis(config[_0x9077('0xc')]));require(_0x9077('0x10'))[_0x9077('0x11')](socket);function respondWithRpcPromise(_0x4fdd2d,_0x2a2a7c,_0x3f697c){return new BPromise(function(_0x20fb8e,_0x24873e){return client[_0x9077('0x12')](_0x4fdd2d,_0x3f697c)[_0x9077('0x13')](function(_0x44e6bc){logger[_0x9077('0x14')](_0x9077('0x15'),_0x2a2a7c,_0x9077('0x16'));logger['debug'](_0x9077('0x17'),_0x2a2a7c,_0x9077('0x16'),JSON[_0x9077('0x18')](_0x44e6bc));if(_0x44e6bc['error']){if(_0x44e6bc['error'][_0x9077('0x19')]===0x1f4){logger[_0x9077('0x1a')](_0x9077('0x15'),_0x2a2a7c,_0x44e6bc[_0x9077('0x1a')][_0x9077('0x1b')]);return _0x24873e(_0x44e6bc['error'][_0x9077('0x1b')]);}logger[_0x9077('0x1a')](_0x9077('0x15'),_0x2a2a7c,_0x44e6bc[_0x9077('0x1a')][_0x9077('0x1b')]);return _0x20fb8e(_0x44e6bc[_0x9077('0x1a')][_0x9077('0x1b')]);}else{logger[_0x9077('0x14')]('FaxQueue,\x20%s,\x20%s',_0x2a2a7c,_0x9077('0x16'));_0x20fb8e(_0x44e6bc['result'][_0x9077('0x1b')]);}})[_0x9077('0x1c')](function(_0x7bf32e){logger[_0x9077('0x1a')](_0x9077('0x15'),_0x2a2a7c,_0x7bf32e);_0x24873e(_0x7bf32e);});});}exports[_0x9077('0x1d')]=function(_0xa23100){var _0x4b3dbd=this;return new Promise(function(_0x5dbb0e,_0xf96be7){return db[_0x9077('0x1e')]['findAll']({'raw':_0xa23100[_0x9077('0x1f')]?_0xa23100[_0x9077('0x1f')][_0x9077('0x20')]===undefined?!![]:![]:!![],'where':_0xa23100[_0x9077('0x1f')]?_0xa23100[_0x9077('0x1f')][_0x9077('0x21')]||null:null,'attributes':_0xa23100[_0x9077('0x1f')]?_0xa23100['options']['attributes']||null:null,'limit':_0xa23100[_0x9077('0x1f')]?_0xa23100['options']['limit']||null:null,'include':_0xa23100[_0x9077('0x1f')]?_0xa23100['options'][_0x9077('0x22')]?_[_0x9077('0x23')](_0xa23100[_0x9077('0x1f')][_0x9077('0x22')],function(_0x5d280b){return{'model':db[_0x5d280b[_0x9077('0x24')]],'as':_0x5d280b['as'],'attributes':_0x5d280b['attributes'],'include':_0x5d280b['include']?_[_0x9077('0x23')](_0x5d280b[_0x9077('0x22')],function(_0x4327f8){return{'model':db[_0x4327f8[_0x9077('0x24')]],'as':_0x4327f8['as'],'attributes':_0x4327f8[_0x9077('0x25')],'include':_0x4327f8[_0x9077('0x22')]?_[_0x9077('0x23')](_0x4327f8[_0x9077('0x22')],function(_0x4f0f1e){return{'model':db[_0x4f0f1e[_0x9077('0x24')]],'as':_0x4f0f1e['as'],'attributes':_0x4f0f1e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9077('0x13')](function(_0x3df178){logger['info']('GetFaxQueue',_0xa23100);logger['debug'](_0x9077('0x1d'),_0xa23100,JSON[_0x9077('0x18')](_0x3df178));_0x5dbb0e(_0x3df178);})[_0x9077('0x1c')](function(_0x219406){logger[_0x9077('0x1a')]('GetFaxQueue',_0x219406['message'],_0xa23100);_0xf96be7(_0x4b3dbd['error'](0x1f4,_0x219406[_0x9077('0x1b')]));});});};exports[_0x9077('0x26')]=function(_0x13d9e0){var _0x53a7d2=this;return new Promise(function(_0x583e99,_0x380ede){return db['FaxQueue']['find']({'raw':_0x13d9e0[_0x9077('0x1f')]?_0x13d9e0[_0x9077('0x1f')][_0x9077('0x20')]===undefined?!![]:![]:!![],'where':_0x13d9e0[_0x9077('0x1f')]?_0x13d9e0[_0x9077('0x1f')][_0x9077('0x21')]||null:null,'attributes':_0x13d9e0[_0x9077('0x1f')]?_0x13d9e0['options'][_0x9077('0x25')]||null:null,'include':_0x13d9e0[_0x9077('0x1f')]?_0x13d9e0['options'][_0x9077('0x22')]?_['map'](_0x13d9e0[_0x9077('0x1f')][_0x9077('0x22')],function(_0x1aa086){return{'model':db[_0x1aa086[_0x9077('0x24')]],'as':_0x1aa086['as'],'attributes':_0x1aa086['attributes'],'include':_0x1aa086['include']?_[_0x9077('0x23')](_0x1aa086[_0x9077('0x22')],function(_0x4cdc94){return{'model':db[_0x4cdc94['model']],'as':_0x4cdc94['as'],'attributes':_0x4cdc94[_0x9077('0x25')],'include':_0x4cdc94[_0x9077('0x22')]?_[_0x9077('0x23')](_0x4cdc94[_0x9077('0x22')],function(_0x4a6905){return{'model':db[_0x4a6905[_0x9077('0x24')]],'as':_0x4a6905['as'],'attributes':_0x4a6905[_0x9077('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9077('0x13')](function(_0x1bd019){logger[_0x9077('0x14')]('ShowFaxQueue',_0x13d9e0);logger['debug'](_0x9077('0x26'),_0x13d9e0,JSON[_0x9077('0x18')](_0x1bd019));_0x583e99(_0x1bd019);})[_0x9077('0x1c')](function(_0xab6ddf){logger['error'](_0x9077('0x26'),_0xab6ddf[_0x9077('0x1b')],_0x13d9e0);_0x380ede(_0x53a7d2[_0x9077('0x1a')](0x1f4,_0xab6ddf['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b250e9a..39b247f 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 _0xc978=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0xe8d735,_0x471f26){var _0x22b45d=function(_0x1c2191){while(--_0x1c2191){_0xe8d735['push'](_0xe8d735['shift']());}};_0x22b45d(++_0x471f26);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var FaxQueueEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){FaxQueueEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);FaxQueueEvents['on'](_0x1b5864,_0x332cd1);}}; \ No newline at end of file +var _0xd63e=['save','remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x562fd2,_0x4d45bc){var _0x12498e=function(_0x127779){while(--_0x127779){_0x562fd2['push'](_0x562fd2['shift']());}};_0x12498e(++_0x4d45bc);}(_0xd63e,0x1b8));var _0xed63=function(_0xf8f86d,_0xc5cc5b){_0xf8f86d=_0xf8f86d-0x0;var _0x8a97ce=_0xd63e[_0xf8f86d];return _0x8a97ce;};'use strict';var FaxQueueEvents=require(_0xed63('0x0'));var events=[_0xed63('0x1'),_0xed63('0x2'),_0xed63('0x3')];function createListener(_0x490338,_0x29c79c){return function(_0x177479){_0x29c79c[_0xed63('0x4')](_0x490338,_0x177479);};}function removeListener(_0x52bef7,_0x22671c){return function(){FaxQueueEvents[_0xed63('0x5')](_0x52bef7,_0x22671c);};}exports[_0xed63('0x6')]=function(_0x820e26){for(var _0x4c457f=0x0,_0x2e2ac8=events[_0xed63('0x7')];_0x4c457f<_0x2e2ac8;_0x4c457f++){var _0xb73589=events[_0x4c457f];var _0x33cae0=createListener(_0xed63('0x8')+_0xb73589,_0x820e26);FaxQueueEvents['on'](_0xb73589,_0x33cae0);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 609fe60..c20b7e3 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 _0x36c3=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','update','destroy','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2bd630,_0x494f0a){var _0x34d159=function(_0x540cfd){while(--_0x540cfd){_0x2bd630['push'](_0x2bd630['shift']());}};_0x34d159(++_0x494f0a);}(_0x36c3,0x1a6));var _0x336c=function(_0x18f80b,_0x46368a){_0x18f80b=_0x18f80b-0x0;var _0x54a62d=_0x36c3[_0x18f80b];return _0x54a62d;};'use strict';var multer=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var path=require('path');var timeout=require(_0x336c('0x2'));var express=require(_0x336c('0x3'));var router=express[_0x336c('0x4')]();var fs_extra=require(_0x336c('0x5'));var auth=require(_0x336c('0x6'));var interaction=require(_0x336c('0x7'));var config=require(_0x336c('0x8'));var controller=require('./faxQueue.controller');router[_0x336c('0x9')]('/',auth[_0x336c('0xa')](),controller[_0x336c('0xb')]);router[_0x336c('0x9')](_0x336c('0xc'),auth['isAuthenticated'](),controller[_0x336c('0xd')]);router[_0x336c('0x9')](_0x336c('0xe'),auth[_0x336c('0xa')](),controller[_0x336c('0xf')]);router[_0x336c('0x9')](_0x336c('0x10'),auth[_0x336c('0xa')](),controller[_0x336c('0x11')]);router[_0x336c('0x9')](_0x336c('0x12'),auth[_0x336c('0xa')](),controller[_0x336c('0x13')]);router[_0x336c('0x9')](_0x336c('0x14'),auth[_0x336c('0xa')](),controller[_0x336c('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x336c('0x16')]);router['post'](_0x336c('0x12'),auth[_0x336c('0xa')](),controller[_0x336c('0x17')]);router[_0x336c('0x18')]('/:id/users',auth[_0x336c('0xa')](),controller[_0x336c('0x19')]);router['put'](_0x336c('0xe'),auth['isAuthenticated'](),controller[_0x336c('0x1a')]);router['delete'](_0x336c('0xe'),auth['isAuthenticated'](),controller[_0x336c('0x1b')]);router[_0x336c('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x336c('0x1d')]);router[_0x336c('0x1c')](_0x336c('0x14'),auth[_0x336c('0xa')](),controller[_0x336c('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x0295=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','getMembers','getTeams','getAgents','/:id/teams','addTeams','post','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x0295,0x1f0));var _0x5029=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x0295[_0x400322];return _0xfdd597;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/members',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/teams',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x11')]);router[_0x5029('0x12')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router[_0x5029('0x15')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router['delete'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0x17')]);router[_0x5029('0x15')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 7e1a79e..90fc583 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 _0xe86f=['moment','exports','STRING','DATE'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0xe86f,0x78));var _0xfe86=function(_0x3178a5,_0x4e78af){_0x3178a5=_0x3178a5-0x0;var _0x5a5ab1=_0xe86f[_0x3178a5];return _0x5a5ab1;};'use strict';var moment=require(_0xfe86('0x0'));var Sequelize=require('sequelize');module[_0xfe86('0x1')]={'uniqueid':{'type':Sequelize[_0xfe86('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfe86('0x2')]},'joinAt':{'type':Sequelize[_0xfe86('0x3')]},'leaveAt':{'type':Sequelize[_0xfe86('0x3')]},'acceptAt':{'type':Sequelize[_0xfe86('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfe86('0x2')]}}; \ No newline at end of file +var _0x1680=['STRING','DATE','moment','sequelize','exports'];(function(_0x5783ab,_0x599b35){var _0x55db88=function(_0x468492){while(--_0x468492){_0x5783ab['push'](_0x5783ab['shift']());}};_0x55db88(++_0x599b35);}(_0x1680,0x84));var _0x0168=function(_0x31c3be,_0x5e540f){_0x31c3be=_0x31c3be-0x0;var _0x48314d=_0x1680[_0x31c3be];return _0x48314d;};'use strict';var moment=require(_0x0168('0x0'));var Sequelize=require(_0x0168('0x1'));module[_0x0168('0x2')]={'uniqueid':{'type':Sequelize[_0x0168('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0168('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0168('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0168('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ca34566..2be5584 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 _0xbec5=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xbec5,0xe5));var _0x5bec=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xbec5[_0x1147ab];return _0x55cb5a;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x1c888f,_0x589d14){_0x589d14=_0x589d14||0xcc;return function(_0x2d2ba2){if(_0x2d2ba2){return _0x1c888f[_0x5bec('0x19')](_0x589d14);}return _0x1c888f[_0x5bec('0x1a')](_0x589d14)[_0x5bec('0x1b')]();};}function respondWithResult(_0x3198e0,_0xcd6d90){_0xcd6d90=_0xcd6d90||0xc8;return function(_0x24dcd6){if(_0x24dcd6){return _0x3198e0[_0x5bec('0x1a')](_0xcd6d90)[_0x5bec('0x1c')](_0x24dcd6);}};}function respondWithFilteredResult(_0x3ebc41,_0x31b9e4){return function(_0x325daf){if(_0x325daf){var _0x11fb8e=typeof _0x31b9e4['offset']==='undefined'&&typeof _0x31b9e4[_0x5bec('0x1d')]===_0x5bec('0x1e');var _0x31ad9c=_0x325daf[_0x5bec('0x1f')];var _0x5cd7ae=_0x11fb8e?0x0:_0x31b9e4['offset'];var _0x3cd354=_0x11fb8e?_0x325daf[_0x5bec('0x1f')]:_0x31b9e4['offset']+_0x31b9e4[_0x5bec('0x1d')];var _0xa7e223;if(_0x3cd354>=_0x31ad9c){_0x3cd354=_0x31ad9c;_0xa7e223=0xc8;}else{_0xa7e223=0xce;}_0x3ebc41[_0x5bec('0x1a')](_0xa7e223);return _0x3ebc41[_0x5bec('0x20')]('Content-Range',_0x5cd7ae+'-'+_0x3cd354+'/'+_0x31ad9c)[_0x5bec('0x1c')](_0x325daf);}return null;};}function patchUpdates(_0x5be91c){return function(_0x191c0f){try{jsonpatch[_0x5bec('0x21')](_0x191c0f,_0x5be91c,!![]);}catch(_0x3e1896){return BPromise[_0x5bec('0x22')](_0x3e1896);}return _0x191c0f[_0x5bec('0x23')]();};}function saveUpdates(_0x5e154e,_0x232584){return function(_0x4cfcb8){if(_0x4cfcb8){return _0x4cfcb8[_0x5bec('0x24')](_0x5e154e)[_0x5bec('0x25')](function(_0x5b2636){return _0x5b2636;});}return null;};}function removeEntity(_0xa414f8,_0xbef70b){return function(_0x4e0ca2){if(_0x4e0ca2){return _0x4e0ca2[_0x5bec('0x26')]()[_0x5bec('0x25')](function(){_0xa414f8[_0x5bec('0x1a')](0xcc)[_0x5bec('0x1b')]();});}};}function handleEntityNotFound(_0x226d55,_0x131143){return function(_0x2dc014){if(!_0x2dc014){_0x226d55['sendStatus'](0x194);}return _0x2dc014;};}function handleError(_0x5b63ab,_0x5e44b3){_0x5e44b3=_0x5e44b3||0x1f4;return function(_0x2961bd){logger[_0x5bec('0x27')](_0x2961bd[_0x5bec('0x28')]);if(_0x2961bd['name']){delete _0x2961bd[_0x5bec('0x29')];}_0x5b63ab[_0x5bec('0x1a')](_0x5e44b3)['send'](_0x2961bd);};}exports[_0x5bec('0x2a')]=function(_0x63ac8,_0x51dc1e){var _0x5336b3={},_0x3575e7={},_0x2a82d5={'count':0x0,'rows':[]};var _0x3039f0=_[_0x5bec('0x2b')](db[_0x5bec('0x2c')][_0x5bec('0x2d')],function(_0x5d6621){return{'name':_0x5d6621[_0x5bec('0x2e')],'type':_0x5d6621['type'][_0x5bec('0x2f')]};});_0x3575e7[_0x5bec('0x30')]=_[_0x5bec('0x2b')](_0x3039f0,_0x5bec('0x29'));_0x3575e7['query']=_[_0x5bec('0x31')](_0x63ac8[_0x5bec('0x32')]);_0x3575e7[_0x5bec('0x33')]=_['intersection'](_0x3575e7[_0x5bec('0x30')],_0x3575e7['query']);_0x5336b3[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x3575e7[_0x5bec('0x30')],qs['fields'](_0x63ac8[_0x5bec('0x32')][_0x5bec('0x36')]));_0x5336b3['attributes']=_0x5336b3[_0x5bec('0x34')][_0x5bec('0x37')]?_0x5336b3[_0x5bec('0x34')]:_0x3575e7[_0x5bec('0x30')];if(!_0x63ac8[_0x5bec('0x32')]['hasOwnProperty'](_0x5bec('0x38'))){_0x5336b3['limit']=qs[_0x5bec('0x1d')](_0x63ac8[_0x5bec('0x32')][_0x5bec('0x1d')]);_0x5336b3[_0x5bec('0x39')]=qs[_0x5bec('0x39')](_0x63ac8[_0x5bec('0x32')]['offset']);}_0x5336b3[_0x5bec('0x3a')]=qs[_0x5bec('0x3b')](_0x63ac8[_0x5bec('0x32')]['sort']);_0x5336b3[_0x5bec('0x3c')]=qs[_0x5bec('0x33')](_['pick'](_0x63ac8[_0x5bec('0x32')],_0x3575e7['filters']),_0x3039f0);if(_0x63ac8[_0x5bec('0x32')][_0x5bec('0x3d')]){_0x5336b3[_0x5bec('0x3c')]=_['merge'](_0x5336b3[_0x5bec('0x3c')],{'$or':_[_0x5bec('0x2b')](_0x3039f0,function(_0x43d4e9){if(_0x43d4e9[_0x5bec('0x3e')]!==_0x5bec('0x3f')){var _0x1be7a7={};_0x1be7a7[_0x43d4e9[_0x5bec('0x29')]]={'$like':'%'+_0x63ac8['query'][_0x5bec('0x3d')]+'%'};return _0x1be7a7;}})});}_0x5336b3=_[_0x5bec('0x40')]({},_0x5336b3,_0x63ac8[_0x5bec('0x41')]);var _0x414d59={'where':_0x5336b3['where']};return db[_0x5bec('0x2c')][_0x5bec('0x1f')](_0x414d59)[_0x5bec('0x25')](function(_0x57e07c){_0x2a82d5['count']=_0x57e07c;if(_0x63ac8[_0x5bec('0x32')][_0x5bec('0x42')]){_0x5336b3[_0x5bec('0x43')]=[{'all':!![]}];}return db[_0x5bec('0x2c')][_0x5bec('0x44')](_0x5336b3);})['then'](function(_0x4fee8a){_0x2a82d5[_0x5bec('0x45')]=_0x4fee8a;return _0x2a82d5;})['then'](respondWithFilteredResult(_0x51dc1e,_0x5336b3))[_0x5bec('0x46')](handleError(_0x51dc1e,null));};exports[_0x5bec('0x47')]=function(_0x3d4ea5,_0x5ac578){var _0x1e59a3={'raw':!![],'where':{'id':_0x3d4ea5['params']['id']}},_0x26a4a5={};_0x26a4a5[_0x5bec('0x30')]=_[_0x5bec('0x31')](db[_0x5bec('0x2c')][_0x5bec('0x2d')]);_0x26a4a5[_0x5bec('0x32')]=_[_0x5bec('0x31')](_0x3d4ea5[_0x5bec('0x32')]);_0x26a4a5['filters']=_['intersection'](_0x26a4a5[_0x5bec('0x30')],_0x26a4a5['query']);_0x1e59a3['attributes']=_[_0x5bec('0x35')](_0x26a4a5['model'],qs['fields'](_0x3d4ea5['query'][_0x5bec('0x36')]));_0x1e59a3[_0x5bec('0x34')]=_0x1e59a3[_0x5bec('0x34')][_0x5bec('0x37')]?_0x1e59a3['attributes']:_0x26a4a5[_0x5bec('0x30')];if(_0x3d4ea5[_0x5bec('0x32')][_0x5bec('0x42')]){_0x1e59a3[_0x5bec('0x43')]=[{'all':!![]}];}_0x1e59a3=_['merge']({},_0x1e59a3,_0x3d4ea5[_0x5bec('0x41')]);return db[_0x5bec('0x2c')][_0x5bec('0x48')](_0x1e59a3)['then'](handleEntityNotFound(_0x5ac578,null))[_0x5bec('0x25')](respondWithResult(_0x5ac578,null))['catch'](handleError(_0x5ac578,null));};exports[_0x5bec('0x49')]=function(_0x30aad7,_0x133d5c){return db[_0x5bec('0x2c')]['create'](_0x30aad7[_0x5bec('0x4a')],{})[_0x5bec('0x25')](respondWithResult(_0x133d5c,0xc9))[_0x5bec('0x46')](handleError(_0x133d5c,null));};exports[_0x5bec('0x24')]=function(_0x35b250,_0x123758){if(_0x35b250[_0x5bec('0x4a')]['id']){delete _0x35b250['body']['id'];}return db[_0x5bec('0x2c')][_0x5bec('0x48')]({'where':{'id':_0x35b250['params']['id']}})[_0x5bec('0x25')](handleEntityNotFound(_0x123758,null))[_0x5bec('0x25')](saveUpdates(_0x35b250[_0x5bec('0x4a')],null))[_0x5bec('0x25')](respondWithResult(_0x123758,null))[_0x5bec('0x46')](handleError(_0x123758,null));};exports[_0x5bec('0x26')]=function(_0x3545a5,_0x4f08d9){return db[_0x5bec('0x2c')]['find']({'where':{'id':_0x3545a5[_0x5bec('0x4b')]['id']}})[_0x5bec('0x25')](handleEntityNotFound(_0x4f08d9,null))[_0x5bec('0x25')](removeEntity(_0x4f08d9,null))[_0x5bec('0x46')](handleError(_0x4f08d9,null));};exports[_0x5bec('0x4c')]=function(_0x1c6401,_0x1c3225){return db[_0x5bec('0x2c')][_0x5bec('0x4c')]()[_0x5bec('0x25')](respondWithResult(_0x1c3225,null))['catch'](handleError(_0x1c3225,null));}; \ No newline at end of file +var _0xe739=['../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','params','includeAll','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x22d772,_0x2e509e){var _0x2a60d9=function(_0xa6024b){while(--_0xa6024b){_0x22d772['push'](_0x22d772['shift']());}};_0x2a60d9(++_0x2e509e);}(_0xe739,0x105));var _0x9e73=function(_0x185f26,_0x17ed05){_0x185f26=_0x185f26-0x0;var _0x4764e7=_0xe739[_0x185f26];return _0x4764e7;};'use strict';var emlformat=require(_0x9e73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e73('0x1'));var jsonpatch=require(_0x9e73('0x2'));var rp=require(_0x9e73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e73('0x4'));var path=require(_0x9e73('0x5'));var sox=require(_0x9e73('0x6'));var csv=require(_0x9e73('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e73('0x8'));var _=require(_0x9e73('0x9'));var squel=require(_0x9e73('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e73('0xb'));var deskjs=require(_0x9e73('0xc'));var toCsv=require(_0x9e73('0x7'));var querystring=require(_0x9e73('0xd'));var Papa=require(_0x9e73('0xe'));var Redis=require(_0x9e73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e73('0x11'))('api');var utils=require(_0x9e73('0x12'));var config=require(_0x9e73('0x13'));var licenseUtil=require(_0x9e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102bb9,_0x4696e2){_0x4696e2=_0x4696e2||0xcc;return function(_0x45c2d0){if(_0x45c2d0){return _0x102bb9[_0x9e73('0x15')](_0x4696e2);}return _0x102bb9['status'](_0x4696e2)[_0x9e73('0x16')]();};}function respondWithResult(_0x607981,_0x3a7bd5){_0x3a7bd5=_0x3a7bd5||0xc8;return function(_0x5be2fa){if(_0x5be2fa){return _0x607981[_0x9e73('0x17')](_0x3a7bd5)[_0x9e73('0x18')](_0x5be2fa);}};}function respondWithFilteredResult(_0x597492,_0x367857){return function(_0x327305){if(_0x327305){var _0x21bd3a=typeof _0x367857['offset']===_0x9e73('0x19')&&typeof _0x367857['limit']===_0x9e73('0x19');var _0x58bbaa=_0x327305[_0x9e73('0x1a')];var _0x48b1db=_0x21bd3a?0x0:_0x367857['offset'];var _0x419c5b=_0x21bd3a?_0x327305[_0x9e73('0x1a')]:_0x367857[_0x9e73('0x1b')]+_0x367857[_0x9e73('0x1c')];var _0x3e56d8;if(_0x419c5b>=_0x58bbaa){_0x419c5b=_0x58bbaa;_0x3e56d8=0xc8;}else{_0x3e56d8=0xce;}_0x597492[_0x9e73('0x17')](_0x3e56d8);return _0x597492[_0x9e73('0x1d')](_0x9e73('0x1e'),_0x48b1db+'-'+_0x419c5b+'/'+_0x58bbaa)[_0x9e73('0x18')](_0x327305);}return null;};}function patchUpdates(_0x3f56bf){return function(_0x4a5cd1){try{jsonpatch[_0x9e73('0x1f')](_0x4a5cd1,_0x3f56bf,!![]);}catch(_0x5c6bae){return BPromise[_0x9e73('0x20')](_0x5c6bae);}return _0x4a5cd1['save']();};}function saveUpdates(_0x31d354,_0x589a5d){return function(_0x2c2b32){if(_0x2c2b32){return _0x2c2b32[_0x9e73('0x21')](_0x31d354)['then'](function(_0x55704a){return _0x55704a;});}return null;};}function removeEntity(_0x127afd,_0x5c6322){return function(_0x256ea1){if(_0x256ea1){return _0x256ea1[_0x9e73('0x22')]()[_0x9e73('0x23')](function(){_0x127afd['status'](0xcc)[_0x9e73('0x16')]();});}};}function handleEntityNotFound(_0x3a845c,_0x566cd8){return function(_0x539560){if(!_0x539560){_0x3a845c[_0x9e73('0x15')](0x194);}return _0x539560;};}function handleError(_0x5031eb,_0x5356ce){_0x5356ce=_0x5356ce||0x1f4;return function(_0x23b2cd){logger[_0x9e73('0x24')](_0x23b2cd[_0x9e73('0x25')]);if(_0x23b2cd['name']){delete _0x23b2cd[_0x9e73('0x26')];}_0x5031eb[_0x9e73('0x17')](_0x5356ce)['send'](_0x23b2cd);};}exports[_0x9e73('0x27')]=function(_0x24532d,_0x3fd13d){var _0x397bd6={},_0x2363f6={},_0x511e35={'count':0x0,'rows':[]};var _0x312e08=_['map'](db[_0x9e73('0x28')][_0x9e73('0x29')],function(_0xb3ef4f){return{'name':_0xb3ef4f[_0x9e73('0x2a')],'type':_0xb3ef4f[_0x9e73('0x2b')]['key']};});_0x2363f6[_0x9e73('0x2c')]=_[_0x9e73('0x2d')](_0x312e08,'name');_0x2363f6['query']=_[_0x9e73('0x2e')](_0x24532d[_0x9e73('0x2f')]);_0x2363f6[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x2363f6[_0x9e73('0x2c')],_0x2363f6[_0x9e73('0x2f')]);_0x397bd6['attributes']=_[_0x9e73('0x31')](_0x2363f6[_0x9e73('0x2c')],qs[_0x9e73('0x32')](_0x24532d[_0x9e73('0x2f')][_0x9e73('0x32')]));_0x397bd6[_0x9e73('0x33')]=_0x397bd6[_0x9e73('0x33')][_0x9e73('0x34')]?_0x397bd6[_0x9e73('0x33')]:_0x2363f6[_0x9e73('0x2c')];if(!_0x24532d['query'][_0x9e73('0x35')](_0x9e73('0x36'))){_0x397bd6[_0x9e73('0x1c')]=qs[_0x9e73('0x1c')](_0x24532d['query'][_0x9e73('0x1c')]);_0x397bd6[_0x9e73('0x1b')]=qs['offset'](_0x24532d['query'][_0x9e73('0x1b')]);}_0x397bd6[_0x9e73('0x37')]=qs[_0x9e73('0x38')](_0x24532d[_0x9e73('0x2f')][_0x9e73('0x38')]);_0x397bd6[_0x9e73('0x39')]=qs['filters'](_['pick'](_0x24532d['query'],_0x2363f6[_0x9e73('0x30')]),_0x312e08);if(_0x24532d[_0x9e73('0x2f')][_0x9e73('0x3a')]){_0x397bd6['where']=_['merge'](_0x397bd6['where'],{'$or':_[_0x9e73('0x2d')](_0x312e08,function(_0xb5bb10){if(_0xb5bb10[_0x9e73('0x2b')]!==_0x9e73('0x3b')){var _0x541171={};_0x541171[_0xb5bb10[_0x9e73('0x26')]]={'$like':'%'+_0x24532d[_0x9e73('0x2f')][_0x9e73('0x3a')]+'%'};return _0x541171;}})});}_0x397bd6=_[_0x9e73('0x3c')]({},_0x397bd6,_0x24532d[_0x9e73('0x3d')]);var _0x40bbda={'where':_0x397bd6[_0x9e73('0x39')]};return db[_0x9e73('0x28')][_0x9e73('0x1a')](_0x40bbda)[_0x9e73('0x23')](function(_0x5d8e77){_0x511e35['count']=_0x5d8e77;if(_0x24532d['query']['includeAll']){_0x397bd6[_0x9e73('0x3e')]=[{'all':!![]}];}return db[_0x9e73('0x28')]['findAll'](_0x397bd6);})[_0x9e73('0x23')](function(_0x2038fb){_0x511e35['rows']=_0x2038fb;return _0x511e35;})['then'](respondWithFilteredResult(_0x3fd13d,_0x397bd6))['catch'](handleError(_0x3fd13d,null));};exports['show']=function(_0x51036a,_0x1e3a56){var _0x2a0166={'raw':!![],'where':{'id':_0x51036a[_0x9e73('0x3f')]['id']}},_0xee1f5={};_0xee1f5['model']=_['keys'](db[_0x9e73('0x28')][_0x9e73('0x29')]);_0xee1f5[_0x9e73('0x2f')]=_[_0x9e73('0x2e')](_0x51036a[_0x9e73('0x2f')]);_0xee1f5[_0x9e73('0x30')]=_['intersection'](_0xee1f5[_0x9e73('0x2c')],_0xee1f5[_0x9e73('0x2f')]);_0x2a0166['attributes']=_[_0x9e73('0x31')](_0xee1f5[_0x9e73('0x2c')],qs['fields'](_0x51036a[_0x9e73('0x2f')][_0x9e73('0x32')]));_0x2a0166['attributes']=_0x2a0166[_0x9e73('0x33')][_0x9e73('0x34')]?_0x2a0166[_0x9e73('0x33')]:_0xee1f5[_0x9e73('0x2c')];if(_0x51036a[_0x9e73('0x2f')][_0x9e73('0x40')]){_0x2a0166[_0x9e73('0x3e')]=[{'all':!![]}];}_0x2a0166=_[_0x9e73('0x3c')]({},_0x2a0166,_0x51036a[_0x9e73('0x3d')]);return db[_0x9e73('0x28')][_0x9e73('0x41')](_0x2a0166)[_0x9e73('0x23')](handleEntityNotFound(_0x1e3a56,null))[_0x9e73('0x23')](respondWithResult(_0x1e3a56,null))[_0x9e73('0x42')](handleError(_0x1e3a56,null));};exports[_0x9e73('0x43')]=function(_0x2d6ed4,_0x4e7891){return db[_0x9e73('0x28')]['create'](_0x2d6ed4['body'],{})[_0x9e73('0x23')](respondWithResult(_0x4e7891,0xc9))[_0x9e73('0x42')](handleError(_0x4e7891,null));};exports['update']=function(_0x4baaf7,_0x308e86){if(_0x4baaf7[_0x9e73('0x44')]['id']){delete _0x4baaf7[_0x9e73('0x44')]['id'];}return db[_0x9e73('0x28')][_0x9e73('0x41')]({'where':{'id':_0x4baaf7[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0x308e86,null))[_0x9e73('0x23')](saveUpdates(_0x4baaf7[_0x9e73('0x44')],null))[_0x9e73('0x23')](respondWithResult(_0x308e86,null))[_0x9e73('0x42')](handleError(_0x308e86,null));};exports[_0x9e73('0x22')]=function(_0x230249,_0xe70028){return db['FaxQueueReport'][_0x9e73('0x41')]({'where':{'id':_0x230249[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0xe70028,null))[_0x9e73('0x23')](removeEntity(_0xe70028,null))[_0x9e73('0x42')](handleError(_0xe70028,null));};exports[_0x9e73('0x45')]=function(_0x2c2003,_0x1e6655){return db['FaxQueueReport']['describe']()['then'](respondWithResult(_0x1e6655,null))[_0x9e73('0x42')](handleError(_0x1e6655,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 08eb082..3455344 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x1bf561,_0x119764){var _0x3b3ca4=function(_0x33b756){while(--_0x33b756){_0x1bf561['push'](_0x1bf561['shift']());}};_0x3b3ca4(++_0x119764);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x2300bf,_0x21f070){var _0x225100=function(_0xcbf989){while(--_0xcbf989){_0x2300bf['push'](_0x2300bf['shift']());}};_0x225100(++_0x21f070);}(_0x326f,0xd1));var _0xf326=function(_0x1bcc4f,_0x55fec4){_0x1bcc4f=_0x1bcc4f-0x0;var _0x5644c3=_0x326f[_0x1bcc4f];return _0x5644c3;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index a1233a6..141680b 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 _0x4196=['limit','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','CreateFaxQueueReport','create','body','options','raw','debug','stringify','catch','FaxQueueReport','update','where','attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x4196,0x1a2));var _0x6419=function(_0x46dac8,_0x29229f){_0x46dac8=_0x46dac8-0x0;var _0x10f557=_0x4196[_0x46dac8];return _0x10f557;};'use strict';var _=require(_0x6419('0x0'));var util=require('util');var moment=require(_0x6419('0x1'));var BPromise=require(_0x6419('0x2'));var rs=require(_0x6419('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6419('0x4'))['db'];var utils=require(_0x6419('0x5'));var logger=require('../../config/logger')(_0x6419('0x6'));var config=require(_0x6419('0x7'));var jayson=require(_0x6419('0x8'));var client=jayson[_0x6419('0x9')][_0x6419('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bf785,_0x2204d4,_0x26d835){return new BPromise(function(_0x14996b,_0x28036d){return client['request'](_0x3bf785,_0x26d835)[_0x6419('0xb')](function(_0x1d43f5){logger['info'](_0x6419('0xc'),_0x2204d4,_0x6419('0xd'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2204d4,_0x6419('0xd'),JSON['stringify'](_0x1d43f5));if(_0x1d43f5[_0x6419('0xe')]){if(_0x1d43f5['error'][_0x6419('0xf')]===0x1f4){logger[_0x6419('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x2204d4,_0x1d43f5[_0x6419('0xe')][_0x6419('0x10')]);return _0x28036d(_0x1d43f5['error'][_0x6419('0x10')]);}logger[_0x6419('0xe')](_0x6419('0xc'),_0x2204d4,_0x1d43f5[_0x6419('0xe')][_0x6419('0x10')]);return _0x14996b(_0x1d43f5[_0x6419('0xe')][_0x6419('0x10')]);}else{logger[_0x6419('0x11')](_0x6419('0xc'),_0x2204d4,_0x6419('0xd'));_0x14996b(_0x1d43f5['result'][_0x6419('0x10')]);}})['catch'](function(_0x5dd7fd){logger[_0x6419('0xe')](_0x6419('0xc'),_0x2204d4,_0x5dd7fd);_0x28036d(_0x5dd7fd);});});}exports[_0x6419('0x12')]=function(_0x4a6981){var _0x6e0e7c=this;return new Promise(function(_0x241c1a,_0x58718a){return db['FaxQueueReport'][_0x6419('0x13')](_0x4a6981[_0x6419('0x14')],{'raw':_0x4a6981[_0x6419('0x15')]?_0x4a6981[_0x6419('0x15')][_0x6419('0x16')]===undefined?!![]:![]:!![]})[_0x6419('0xb')](function(_0x51d5ed){logger[_0x6419('0x11')]('CreateFaxQueueReport',_0x4a6981);logger[_0x6419('0x17')](_0x6419('0x12'),_0x4a6981,JSON[_0x6419('0x18')](_0x51d5ed));_0x241c1a(_0x51d5ed);})[_0x6419('0x19')](function(_0x365424){logger['error']('CreateFaxQueueReport',_0x365424[_0x6419('0x10')],_0x4a6981);_0x58718a(_0x6e0e7c[_0x6419('0xe')](0x1f4,_0x365424['message']));});});};exports['UpdateFaxQueueReport']=function(_0x132824){var _0x5f4b89=this;return new Promise(function(_0x459210,_0x3dbfbc){return db[_0x6419('0x1a')][_0x6419('0x1b')](_0x132824[_0x6419('0x14')],{'raw':_0x132824[_0x6419('0x15')]?_0x132824[_0x6419('0x15')][_0x6419('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132824[_0x6419('0x15')]?_0x132824[_0x6419('0x15')][_0x6419('0x1c')]||null:null,'attributes':_0x132824[_0x6419('0x15')]?_0x132824['options'][_0x6419('0x1d')]||null:null,'limit':_0x132824[_0x6419('0x15')]?_0x132824[_0x6419('0x15')][_0x6419('0x1e')]||null:null})[_0x6419('0xb')](function(_0x5accbc){logger[_0x6419('0x11')]('UpdateFaxQueueReport',_0x132824);logger[_0x6419('0x17')](_0x6419('0x1f'),_0x132824,JSON[_0x6419('0x18')](_0x5accbc));_0x459210(_0x5accbc);})[_0x6419('0x19')](function(_0x1382bc){logger['error'](_0x6419('0x1f'),_0x1382bc[_0x6419('0x10')],_0x132824);_0x3dbfbc(_0x5f4b89[_0x6419('0xe')](0x1f4,_0x1382bc[_0x6419('0x10')]));});});}; \ No newline at end of file +var _0x85db=['FaxQueueReport,\x20%s,\x20%s','message','info','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','catch','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x487022,_0x9585bc){var _0x57fe5a=function(_0x172781){while(--_0x172781){_0x487022['push'](_0x487022['shift']());}};_0x57fe5a(++_0x9585bc);}(_0x85db,0xaf));var _0xb85d=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x85db[_0x52c4e9];return _0x252a03;};'use strict';var _=require(_0xb85d('0x0'));var util=require('util');var moment=require(_0xb85d('0x1'));var BPromise=require(_0xb85d('0x2'));var rs=require(_0xb85d('0x3'));var fs=require('fs');var Redis=require(_0xb85d('0x4'));var db=require(_0xb85d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb85d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb85d('0x7'));var client=jayson[_0xb85d('0x8')][_0xb85d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e6f71,_0x40cdf0,_0x476b7d){return new BPromise(function(_0x2bc3fb,_0x134ac0){return client[_0xb85d('0xa')](_0x1e6f71,_0x476b7d)[_0xb85d('0xb')](function(_0x42a84c){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x40cdf0,_0xb85d('0xc'));logger[_0xb85d('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x40cdf0,'request\x20sent',JSON[_0xb85d('0xe')](_0x42a84c));if(_0x42a84c[_0xb85d('0xf')]){if(_0x42a84c[_0xb85d('0xf')][_0xb85d('0x10')]===0x1f4){logger[_0xb85d('0xf')](_0xb85d('0x11'),_0x40cdf0,_0x42a84c['error']['message']);return _0x134ac0(_0x42a84c[_0xb85d('0xf')][_0xb85d('0x12')]);}logger[_0xb85d('0xf')](_0xb85d('0x11'),_0x40cdf0,_0x42a84c[_0xb85d('0xf')][_0xb85d('0x12')]);return _0x2bc3fb(_0x42a84c[_0xb85d('0xf')][_0xb85d('0x12')]);}else{logger[_0xb85d('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x40cdf0,_0xb85d('0xc'));_0x2bc3fb(_0x42a84c['result'][_0xb85d('0x12')]);}})['catch'](function(_0x86e12c){logger['error'](_0xb85d('0x11'),_0x40cdf0,_0x86e12c);_0x134ac0(_0x86e12c);});});}exports[_0xb85d('0x14')]=function(_0x1b2594){var _0x556fc6=this;return new Promise(function(_0x3aafed,_0x1bbb9b){return db[_0xb85d('0x15')][_0xb85d('0x16')](_0x1b2594[_0xb85d('0x17')],{'raw':_0x1b2594[_0xb85d('0x18')]?_0x1b2594[_0xb85d('0x18')][_0xb85d('0x19')]===undefined?!![]:![]:!![]})[_0xb85d('0xb')](function(_0x1a27a5){logger[_0xb85d('0x13')](_0xb85d('0x14'),_0x1b2594);logger[_0xb85d('0xd')](_0xb85d('0x14'),_0x1b2594,JSON[_0xb85d('0xe')](_0x1a27a5));_0x3aafed(_0x1a27a5);})[_0xb85d('0x1a')](function(_0x595c39){logger['error'](_0xb85d('0x14'),_0x595c39[_0xb85d('0x12')],_0x1b2594);_0x1bbb9b(_0x556fc6[_0xb85d('0xf')](0x1f4,_0x595c39['message']));});});};exports[_0xb85d('0x1b')]=function(_0x446272){var _0x31f66f=this;return new Promise(function(_0x203006,_0x2faf4d){return db[_0xb85d('0x15')][_0xb85d('0x1c')](_0x446272[_0xb85d('0x17')],{'raw':_0x446272[_0xb85d('0x18')]?_0x446272[_0xb85d('0x18')][_0xb85d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x446272[_0xb85d('0x18')]?_0x446272['options'][_0xb85d('0x1d')]||null:null,'attributes':_0x446272[_0xb85d('0x18')]?_0x446272[_0xb85d('0x18')][_0xb85d('0x1e')]||null:null,'limit':_0x446272[_0xb85d('0x18')]?_0x446272[_0xb85d('0x18')][_0xb85d('0x1f')]||null:null})['then'](function(_0x2e22ed){logger[_0xb85d('0x13')](_0xb85d('0x1b'),_0x446272);logger['debug'](_0xb85d('0x1b'),_0x446272,JSON['stringify'](_0x2e22ed));_0x203006(_0x2e22ed);})[_0xb85d('0x1a')](function(_0x3abbdd){logger[_0xb85d('0xf')]('UpdateFaxQueueReport',_0x3abbdd[_0xb85d('0x12')],_0x446272);_0x2faf4d(_0x31f66f[_0xb85d('0xf')](0x1f4,_0x3abbdd[_0xb85d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7a12f8c..b98105f 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 _0x0fd3=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x26dbd2,_0x4fc7d3){var _0xdd2915=function(_0x39b861){while(--_0x39b861){_0x26dbd2['push'](_0x26dbd2['shift']());}};_0xdd2915(++_0x4fc7d3);}(_0x0fd3,0x74));var _0x30fd=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x0fd3[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0x30fd('0x0'));var util=require(_0x30fd('0x1'));var path=require(_0x30fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x30fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30fd('0x4'));var interaction=require(_0x30fd('0x5'));var config=require(_0x30fd('0x6'));var controller=require('./faxQueueReport.controller');router[_0x30fd('0x7')]('/',auth[_0x30fd('0x8')](),controller[_0x30fd('0x9')]);router[_0x30fd('0x7')](_0x30fd('0xa'),auth[_0x30fd('0x8')](),controller[_0x30fd('0xb')]);router[_0x30fd('0x7')](_0x30fd('0xc'),auth[_0x30fd('0x8')](),controller[_0x30fd('0xd')]);router[_0x30fd('0xe')]('/',auth[_0x30fd('0x8')](),controller['create']);router[_0x30fd('0xf')](_0x30fd('0xc'),auth['isAuthenticated'](),controller[_0x30fd('0x10')]);router['delete'](_0x30fd('0xc'),auth[_0x30fd('0x8')](),controller[_0x30fd('0x11')]);module[_0x30fd('0x12')]=router; \ No newline at end of file +var _0x56d3=['fs-extra','../../config/environment','get','isAuthenticated','/describe','show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router'];(function(_0x1c29d8,_0x1ab9a6){var _0x30ed13=function(_0x7d650a){while(--_0x7d650a){_0x1c29d8['push'](_0x1c29d8['shift']());}};_0x30ed13(++_0x1ab9a6);}(_0x56d3,0xc2));var _0x356d=function(_0x3e165e,_0x83305d){_0x3e165e=_0x3e165e-0x0;var _0x466814=_0x56d3[_0x3e165e];return _0x466814;};'use strict';var multer=require('multer');var util=require(_0x356d('0x0'));var path=require(_0x356d('0x1'));var timeout=require(_0x356d('0x2'));var express=require('express');var router=express[_0x356d('0x3')]();var fs_extra=require(_0x356d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x356d('0x5'));var controller=require('./faxQueueReport.controller');router[_0x356d('0x6')]('/',auth[_0x356d('0x7')](),controller['index']);router[_0x356d('0x6')](_0x356d('0x8'),auth[_0x356d('0x7')](),controller['describe']);router[_0x356d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x356d('0x9')]);router[_0x356d('0xa')]('/',auth['isAuthenticated'](),controller[_0x356d('0xb')]);router[_0x356d('0xc')]('/:id',auth[_0x356d('0x7')](),controller[_0x356d('0xd')]);router[_0x356d('0xe')](_0x356d('0xf'),auth[_0x356d('0x7')](),controller[_0x356d('0x10')]);module[_0x356d('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index fbf1188..fd264d7 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x33e530,_0x2297c3){var _0xffdb03=function(_0x57871f){while(--_0x57871f){_0x33e530['push'](_0x33e530['shift']());}};_0xffdb03(++_0x2297c3);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x00bb[_0xbb091];return _0x467a04;};'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 +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x129328,_0x36093d){var _0x17e9cb=function(_0x4032b1){while(--_0x4032b1){_0x129328['push'](_0x129328['shift']());}};_0x17e9cb(++_0x36093d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x32d58a,_0x58dcbd){_0x32d58a=_0x32d58a-0x0;var _0x3284cb=_0xf4eb[_0x32d58a];return _0x3284cb;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a0c91a1..e1ac45a 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 _0xac09=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','FaxTransferReport','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x336a3b,_0x1d422c){var _0x1f505a=function(_0x449e0a){while(--_0x449e0a){_0x336a3b['push'](_0x336a3b['shift']());}};_0x1f505a(++_0x1d422c);}(_0xac09,0x110));var _0x9ac0=function(_0x1e5f85,_0x494523){_0x1e5f85=_0x1e5f85-0x0;var _0x307672=_0xac09[_0x1e5f85];return _0x307672;};'use strict';var emlformat=require(_0x9ac0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9ac0('0x1'));var moment=require(_0x9ac0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9ac0('0x3'));var util=require('util');var path=require(_0x9ac0('0x4'));var sox=require('sox');var csv=require(_0x9ac0('0x5'));var ejs=require(_0x9ac0('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ac0('0x7'));var squel=require(_0x9ac0('0x8'));var crypto=require(_0x9ac0('0x9'));var jsforce=require(_0x9ac0('0xa'));var deskjs=require(_0x9ac0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9ac0('0xc'));var Papa=require(_0x9ac0('0xd'));var Redis=require(_0x9ac0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9ac0('0xf'));var as=require(_0x9ac0('0x10'));var hardwareService=require(_0x9ac0('0x11'));var logger=require('../../config/logger')(_0x9ac0('0x12'));var utils=require(_0x9ac0('0x13'));var config=require(_0x9ac0('0x14'));var licenseUtil=require(_0x9ac0('0x15'));var db=require(_0x9ac0('0x16'))['db'];function respondWithStatusCode(_0x3226d4,_0x49cae5){_0x49cae5=_0x49cae5||0xcc;return function(_0x2f8bd0){if(_0x2f8bd0){return _0x3226d4['sendStatus'](_0x49cae5);}return _0x3226d4[_0x9ac0('0x17')](_0x49cae5)[_0x9ac0('0x18')]();};}function respondWithResult(_0x236b18,_0x874071){_0x874071=_0x874071||0xc8;return function(_0x5c6545){if(_0x5c6545){return _0x236b18[_0x9ac0('0x17')](_0x874071)['json'](_0x5c6545);}};}function respondWithFilteredResult(_0x5df887,_0x17e6e8){return function(_0x271d2f){if(_0x271d2f){var _0x1ed374=typeof _0x17e6e8[_0x9ac0('0x19')]===_0x9ac0('0x1a')&&typeof _0x17e6e8['limit']===_0x9ac0('0x1a');var _0x67e24d=_0x271d2f['count'];var _0xc55f67=_0x1ed374?0x0:_0x17e6e8[_0x9ac0('0x19')];var _0xa82c40=_0x1ed374?_0x271d2f[_0x9ac0('0x1b')]:_0x17e6e8['offset']+_0x17e6e8[_0x9ac0('0x1c')];var _0x5aeba0;if(_0xa82c40>=_0x67e24d){_0xa82c40=_0x67e24d;_0x5aeba0=0xc8;}else{_0x5aeba0=0xce;}_0x5df887[_0x9ac0('0x17')](_0x5aeba0);return _0x5df887[_0x9ac0('0x1d')](_0x9ac0('0x1e'),_0xc55f67+'-'+_0xa82c40+'/'+_0x67e24d)['json'](_0x271d2f);}return null;};}function patchUpdates(_0x155a4d){return function(_0x51bd19){try{jsonpatch['apply'](_0x51bd19,_0x155a4d,!![]);}catch(_0x3b851c){return BPromise[_0x9ac0('0x1f')](_0x3b851c);}return _0x51bd19[_0x9ac0('0x20')]();};}function saveUpdates(_0x464bcc,_0xe24791){return function(_0x3eb3c6){if(_0x3eb3c6){return _0x3eb3c6[_0x9ac0('0x21')](_0x464bcc)[_0x9ac0('0x22')](function(_0x2df272){return _0x2df272;});}return null;};}function removeEntity(_0x38ace0,_0x2f1ba5){return function(_0x52769b){if(_0x52769b){return _0x52769b[_0x9ac0('0x23')]()[_0x9ac0('0x22')](function(){_0x38ace0[_0x9ac0('0x17')](0xcc)[_0x9ac0('0x18')]();});}};}function handleEntityNotFound(_0x58a686,_0x3f5dfa){return function(_0x4a4092){if(!_0x4a4092){_0x58a686[_0x9ac0('0x24')](0x194);}return _0x4a4092;};}function handleError(_0x4860a8,_0x39e3d5){_0x39e3d5=_0x39e3d5||0x1f4;return function(_0xf8eb5b){logger[_0x9ac0('0x25')](_0xf8eb5b['stack']);if(_0xf8eb5b[_0x9ac0('0x26')]){delete _0xf8eb5b['name'];}_0x4860a8[_0x9ac0('0x17')](_0x39e3d5)[_0x9ac0('0x27')](_0xf8eb5b);};}exports[_0x9ac0('0x28')]=function(_0x3dd246,_0x5eec3d){var _0x20bb64={},_0x50d6a4={},_0x4954c4={'count':0x0,'rows':[]};var _0xfd7406=_['map'](db[_0x9ac0('0x29')]['rawAttributes'],function(_0x7af593){return{'name':_0x7af593['fieldName'],'type':_0x7af593[_0x9ac0('0x2a')][_0x9ac0('0x2b')]};});_0x50d6a4[_0x9ac0('0x2c')]=_[_0x9ac0('0x2d')](_0xfd7406,'name');_0x50d6a4['query']=_['keys'](_0x3dd246[_0x9ac0('0x2e')]);_0x50d6a4[_0x9ac0('0x2f')]=_[_0x9ac0('0x30')](_0x50d6a4['model'],_0x50d6a4[_0x9ac0('0x2e')]);_0x20bb64[_0x9ac0('0x31')]=_[_0x9ac0('0x30')](_0x50d6a4[_0x9ac0('0x2c')],qs[_0x9ac0('0x32')](_0x3dd246[_0x9ac0('0x2e')][_0x9ac0('0x32')]));_0x20bb64[_0x9ac0('0x31')]=_0x20bb64['attributes'][_0x9ac0('0x33')]?_0x20bb64[_0x9ac0('0x31')]:_0x50d6a4[_0x9ac0('0x2c')];if(!_0x3dd246['query'][_0x9ac0('0x34')](_0x9ac0('0x35'))){_0x20bb64[_0x9ac0('0x1c')]=qs[_0x9ac0('0x1c')](_0x3dd246['query'][_0x9ac0('0x1c')]);_0x20bb64[_0x9ac0('0x19')]=qs[_0x9ac0('0x19')](_0x3dd246[_0x9ac0('0x2e')]['offset']);}_0x20bb64['order']=qs[_0x9ac0('0x36')](_0x3dd246[_0x9ac0('0x2e')][_0x9ac0('0x36')]);_0x20bb64[_0x9ac0('0x37')]=qs[_0x9ac0('0x2f')](_['pick'](_0x3dd246[_0x9ac0('0x2e')],_0x50d6a4['filters']),_0xfd7406);if(_0x3dd246[_0x9ac0('0x2e')][_0x9ac0('0x38')]){_0x20bb64[_0x9ac0('0x37')]=_['merge'](_0x20bb64[_0x9ac0('0x37')],{'$or':_['map'](_0xfd7406,function(_0x5cdc4a){if(_0x5cdc4a[_0x9ac0('0x2a')]!==_0x9ac0('0x39')){var _0x1cfc57={};_0x1cfc57[_0x5cdc4a[_0x9ac0('0x26')]]={'$like':'%'+_0x3dd246[_0x9ac0('0x2e')]['filter']+'%'};return _0x1cfc57;}})});}_0x20bb64=_[_0x9ac0('0x3a')]({},_0x20bb64,_0x3dd246[_0x9ac0('0x3b')]);var _0x489441={'where':_0x20bb64[_0x9ac0('0x37')]};return db[_0x9ac0('0x29')][_0x9ac0('0x1b')](_0x489441)[_0x9ac0('0x22')](function(_0x44aa06){_0x4954c4[_0x9ac0('0x1b')]=_0x44aa06;if(_0x3dd246['query'][_0x9ac0('0x3c')]){_0x20bb64[_0x9ac0('0x3d')]=[{'all':!![]}];}return db[_0x9ac0('0x29')]['findAll'](_0x20bb64);})[_0x9ac0('0x22')](function(_0x499c09){_0x4954c4[_0x9ac0('0x3e')]=_0x499c09;return _0x4954c4;})[_0x9ac0('0x22')](respondWithFilteredResult(_0x5eec3d,_0x20bb64))[_0x9ac0('0x3f')](handleError(_0x5eec3d,null));};exports['show']=function(_0x166428,_0x595479){var _0x589a5f={'raw':!![],'where':{'id':_0x166428[_0x9ac0('0x40')]['id']}},_0x3e06ee={};_0x3e06ee[_0x9ac0('0x2c')]=_[_0x9ac0('0x41')](db['FaxTransferReport'][_0x9ac0('0x42')]);_0x3e06ee['query']=_['keys'](_0x166428[_0x9ac0('0x2e')]);_0x3e06ee[_0x9ac0('0x2f')]=_[_0x9ac0('0x30')](_0x3e06ee[_0x9ac0('0x2c')],_0x3e06ee[_0x9ac0('0x2e')]);_0x589a5f[_0x9ac0('0x31')]=_['intersection'](_0x3e06ee['model'],qs[_0x9ac0('0x32')](_0x166428[_0x9ac0('0x2e')][_0x9ac0('0x32')]));_0x589a5f['attributes']=_0x589a5f['attributes'][_0x9ac0('0x33')]?_0x589a5f[_0x9ac0('0x31')]:_0x3e06ee[_0x9ac0('0x2c')];if(_0x166428[_0x9ac0('0x2e')][_0x9ac0('0x3c')]){_0x589a5f[_0x9ac0('0x3d')]=[{'all':!![]}];}_0x589a5f=_[_0x9ac0('0x3a')]({},_0x589a5f,_0x166428[_0x9ac0('0x3b')]);return db[_0x9ac0('0x29')][_0x9ac0('0x43')](_0x589a5f)['then'](handleEntityNotFound(_0x595479,null))[_0x9ac0('0x22')](respondWithResult(_0x595479,null))[_0x9ac0('0x3f')](handleError(_0x595479,null));};exports[_0x9ac0('0x44')]=function(_0x404e27,_0x457bf7){return db[_0x9ac0('0x29')][_0x9ac0('0x44')](_0x404e27[_0x9ac0('0x45')],{})[_0x9ac0('0x22')](respondWithResult(_0x457bf7,0xc9))[_0x9ac0('0x3f')](handleError(_0x457bf7,null));};exports[_0x9ac0('0x21')]=function(_0x420126,_0x207f27){if(_0x420126[_0x9ac0('0x45')]['id']){delete _0x420126[_0x9ac0('0x45')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x420126[_0x9ac0('0x40')]['id']}})[_0x9ac0('0x22')](handleEntityNotFound(_0x207f27,null))[_0x9ac0('0x22')](saveUpdates(_0x420126[_0x9ac0('0x45')],null))['then'](respondWithResult(_0x207f27,null))['catch'](handleError(_0x207f27,null));};exports[_0x9ac0('0x23')]=function(_0x54e27b,_0x26d533){return db['FaxTransferReport'][_0x9ac0('0x43')]({'where':{'id':_0x54e27b[_0x9ac0('0x40')]['id']}})['then'](handleEntityNotFound(_0x26d533,null))[_0x9ac0('0x22')](removeEntity(_0x26d533,null))[_0x9ac0('0x3f')](handleError(_0x26d533,null));};exports[_0x9ac0('0x46')]=function(_0x4f7be8,_0x2103d2){return db[_0x9ac0('0x29')][_0x9ac0('0x46')]()['then'](respondWithResult(_0x2103d2,null))[_0x9ac0('0x3f')](handleError(_0x2103d2,null));}; \ No newline at end of file +var _0x9186=['options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','name','index','map','FaxTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x508ea7,_0x52a58a){var _0x36abac=function(_0x2a3e54){while(--_0x2a3e54){_0x508ea7['push'](_0x508ea7['shift']());}};_0x36abac(++_0x52a58a);}(_0x9186,0xee));var _0x6918=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x9186[_0x1992f1];return _0x413dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6918('0x0'));var jsonpatch=require(_0x6918('0x1'));var rp=require(_0x6918('0x2'));var moment=require('moment');var BPromise=require(_0x6918('0x3'));var Mustache=require(_0x6918('0x4'));var util=require(_0x6918('0x5'));var path=require(_0x6918('0x6'));var sox=require(_0x6918('0x7'));var csv=require('to-csv');var ejs=require(_0x6918('0x8'));var fs=require('fs');var fs_extra=require(_0x6918('0x9'));var _=require(_0x6918('0xa'));var squel=require(_0x6918('0xb'));var crypto=require(_0x6918('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6918('0xd'));var toCsv=require(_0x6918('0xe'));var querystring=require(_0x6918('0xf'));var Papa=require(_0x6918('0x10'));var Redis=require(_0x6918('0x11'));var authService=require(_0x6918('0x12'));var qs=require(_0x6918('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6918('0x14'));var logger=require(_0x6918('0x15'))(_0x6918('0x16'));var utils=require(_0x6918('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6918('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b3f8d,_0x3197ef){_0x3197ef=_0x3197ef||0xcc;return function(_0x2c5d54){if(_0x2c5d54){return _0x3b3f8d[_0x6918('0x19')](_0x3197ef);}return _0x3b3f8d[_0x6918('0x1a')](_0x3197ef)[_0x6918('0x1b')]();};}function respondWithResult(_0xb4d07e,_0x5f4c9d){_0x5f4c9d=_0x5f4c9d||0xc8;return function(_0x260212){if(_0x260212){return _0xb4d07e[_0x6918('0x1a')](_0x5f4c9d)[_0x6918('0x1c')](_0x260212);}};}function respondWithFilteredResult(_0x506e56,_0x5e724a){return function(_0x1ba862){if(_0x1ba862){var _0x48e73e=typeof _0x5e724a[_0x6918('0x1d')]===_0x6918('0x1e')&&typeof _0x5e724a[_0x6918('0x1f')]===_0x6918('0x1e');var _0x1151e0=_0x1ba862[_0x6918('0x20')];var _0x17fecd=_0x48e73e?0x0:_0x5e724a[_0x6918('0x1d')];var _0x1de660=_0x48e73e?_0x1ba862[_0x6918('0x20')]:_0x5e724a[_0x6918('0x1d')]+_0x5e724a[_0x6918('0x1f')];var _0x7d0c9c;if(_0x1de660>=_0x1151e0){_0x1de660=_0x1151e0;_0x7d0c9c=0xc8;}else{_0x7d0c9c=0xce;}_0x506e56[_0x6918('0x1a')](_0x7d0c9c);return _0x506e56['set'](_0x6918('0x21'),_0x17fecd+'-'+_0x1de660+'/'+_0x1151e0)[_0x6918('0x1c')](_0x1ba862);}return null;};}function patchUpdates(_0x5c1cc1){return function(_0x168951){try{jsonpatch[_0x6918('0x22')](_0x168951,_0x5c1cc1,!![]);}catch(_0x1bf424){return BPromise['reject'](_0x1bf424);}return _0x168951[_0x6918('0x23')]();};}function saveUpdates(_0x4a4fa9,_0x128525){return function(_0x22f18c){if(_0x22f18c){return _0x22f18c['update'](_0x4a4fa9)[_0x6918('0x24')](function(_0x23bd35){return _0x23bd35;});}return null;};}function removeEntity(_0x3e786a,_0x352bcc){return function(_0x5d5c4b){if(_0x5d5c4b){return _0x5d5c4b[_0x6918('0x25')]()['then'](function(){_0x3e786a[_0x6918('0x1a')](0xcc)[_0x6918('0x1b')]();});}};}function handleEntityNotFound(_0x3d2c3a,_0x32ed66){return function(_0x2d455d){if(!_0x2d455d){_0x3d2c3a[_0x6918('0x19')](0x194);}return _0x2d455d;};}function handleError(_0x913daa,_0x4c123a){_0x4c123a=_0x4c123a||0x1f4;return function(_0x5c4d72){logger[_0x6918('0x26')](_0x5c4d72['stack']);if(_0x5c4d72['name']){delete _0x5c4d72[_0x6918('0x27')];}_0x913daa[_0x6918('0x1a')](_0x4c123a)['send'](_0x5c4d72);};}exports[_0x6918('0x28')]=function(_0x138857,_0x12a8d2){var _0x709c36={},_0x24fafc={},_0x2a510b={'count':0x0,'rows':[]};var _0x354b77=_[_0x6918('0x29')](db[_0x6918('0x2a')][_0x6918('0x2b')],function(_0x3c1906){return{'name':_0x3c1906['fieldName'],'type':_0x3c1906[_0x6918('0x2c')][_0x6918('0x2d')]};});_0x24fafc[_0x6918('0x2e')]=_[_0x6918('0x29')](_0x354b77,'name');_0x24fafc[_0x6918('0x2f')]=_[_0x6918('0x30')](_0x138857[_0x6918('0x2f')]);_0x24fafc[_0x6918('0x31')]=_[_0x6918('0x32')](_0x24fafc['model'],_0x24fafc[_0x6918('0x2f')]);_0x709c36[_0x6918('0x33')]=_[_0x6918('0x32')](_0x24fafc[_0x6918('0x2e')],qs[_0x6918('0x34')](_0x138857[_0x6918('0x2f')][_0x6918('0x34')]));_0x709c36[_0x6918('0x33')]=_0x709c36[_0x6918('0x33')][_0x6918('0x35')]?_0x709c36[_0x6918('0x33')]:_0x24fafc[_0x6918('0x2e')];if(!_0x138857['query']['hasOwnProperty'](_0x6918('0x36'))){_0x709c36[_0x6918('0x1f')]=qs[_0x6918('0x1f')](_0x138857[_0x6918('0x2f')][_0x6918('0x1f')]);_0x709c36['offset']=qs[_0x6918('0x1d')](_0x138857['query'][_0x6918('0x1d')]);}_0x709c36[_0x6918('0x37')]=qs[_0x6918('0x38')](_0x138857['query']['sort']);_0x709c36['where']=qs[_0x6918('0x31')](_[_0x6918('0x39')](_0x138857[_0x6918('0x2f')],_0x24fafc[_0x6918('0x31')]),_0x354b77);if(_0x138857[_0x6918('0x2f')][_0x6918('0x3a')]){_0x709c36[_0x6918('0x3b')]=_[_0x6918('0x3c')](_0x709c36[_0x6918('0x3b')],{'$or':_['map'](_0x354b77,function(_0x2ba516){if(_0x2ba516[_0x6918('0x2c')]!==_0x6918('0x3d')){var _0x2e5c68={};_0x2e5c68[_0x2ba516[_0x6918('0x27')]]={'$like':'%'+_0x138857[_0x6918('0x2f')][_0x6918('0x3a')]+'%'};return _0x2e5c68;}})});}_0x709c36=_['merge']({},_0x709c36,_0x138857[_0x6918('0x3e')]);var _0x515d46={'where':_0x709c36[_0x6918('0x3b')]};return db['FaxTransferReport'][_0x6918('0x20')](_0x515d46)[_0x6918('0x24')](function(_0x4506e9){_0x2a510b[_0x6918('0x20')]=_0x4506e9;if(_0x138857[_0x6918('0x2f')][_0x6918('0x3f')]){_0x709c36[_0x6918('0x40')]=[{'all':!![]}];}return db[_0x6918('0x2a')][_0x6918('0x41')](_0x709c36);})[_0x6918('0x24')](function(_0x48e763){_0x2a510b[_0x6918('0x42')]=_0x48e763;return _0x2a510b;})['then'](respondWithFilteredResult(_0x12a8d2,_0x709c36))[_0x6918('0x43')](handleError(_0x12a8d2,null));};exports[_0x6918('0x44')]=function(_0x49e007,_0x32e3f5){var _0x1707ce={'raw':!![],'where':{'id':_0x49e007['params']['id']}},_0x4362d9={};_0x4362d9['model']=_[_0x6918('0x30')](db[_0x6918('0x2a')][_0x6918('0x2b')]);_0x4362d9[_0x6918('0x2f')]=_[_0x6918('0x30')](_0x49e007[_0x6918('0x2f')]);_0x4362d9['filters']=_[_0x6918('0x32')](_0x4362d9[_0x6918('0x2e')],_0x4362d9[_0x6918('0x2f')]);_0x1707ce[_0x6918('0x33')]=_[_0x6918('0x32')](_0x4362d9['model'],qs[_0x6918('0x34')](_0x49e007[_0x6918('0x2f')][_0x6918('0x34')]));_0x1707ce[_0x6918('0x33')]=_0x1707ce[_0x6918('0x33')][_0x6918('0x35')]?_0x1707ce['attributes']:_0x4362d9[_0x6918('0x2e')];if(_0x49e007[_0x6918('0x2f')][_0x6918('0x3f')]){_0x1707ce[_0x6918('0x40')]=[{'all':!![]}];}_0x1707ce=_['merge']({},_0x1707ce,_0x49e007[_0x6918('0x3e')]);return db['FaxTransferReport'][_0x6918('0x45')](_0x1707ce)[_0x6918('0x24')](handleEntityNotFound(_0x32e3f5,null))['then'](respondWithResult(_0x32e3f5,null))[_0x6918('0x43')](handleError(_0x32e3f5,null));};exports[_0x6918('0x46')]=function(_0x492286,_0x59be8b){return db[_0x6918('0x2a')][_0x6918('0x46')](_0x492286[_0x6918('0x47')],{})[_0x6918('0x24')](respondWithResult(_0x59be8b,0xc9))[_0x6918('0x43')](handleError(_0x59be8b,null));};exports[_0x6918('0x48')]=function(_0x423c9c,_0x41b7bf){if(_0x423c9c[_0x6918('0x47')]['id']){delete _0x423c9c[_0x6918('0x47')]['id'];}return db['FaxTransferReport'][_0x6918('0x45')]({'where':{'id':_0x423c9c[_0x6918('0x49')]['id']}})[_0x6918('0x24')](handleEntityNotFound(_0x41b7bf,null))['then'](saveUpdates(_0x423c9c['body'],null))[_0x6918('0x24')](respondWithResult(_0x41b7bf,null))[_0x6918('0x43')](handleError(_0x41b7bf,null));};exports[_0x6918('0x25')]=function(_0x61ca8d,_0x56c7ed){return db[_0x6918('0x2a')][_0x6918('0x45')]({'where':{'id':_0x61ca8d[_0x6918('0x49')]['id']}})[_0x6918('0x24')](handleEntityNotFound(_0x56c7ed,null))[_0x6918('0x24')](removeEntity(_0x56c7ed,null))[_0x6918('0x43')](handleError(_0x56c7ed,null));};exports[_0x6918('0x4a')]=function(_0x3a4bcd,_0xdb8003){return db[_0x6918('0x2a')][_0x6918('0x4a')]()[_0x6918('0x24')](respondWithResult(_0xdb8003,null))[_0x6918('0x43')](handleError(_0xdb8003,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index e897c80..6cc3a69 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 _0x5e6c=['../../config/logger','moment','rimraf','../../config/environment','exports','define','report_fax_transfer','uniqueid','util'];(function(_0x5df7ca,_0x5d9c49){var _0x317976=function(_0x4341d4){while(--_0x4341d4){_0x5df7ca['push'](_0x5df7ca['shift']());}};_0x317976(++_0x5d9c49);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x1ccd25,_0x14dca1){_0x1ccd25=_0x1ccd25-0x0;var _0x4f5769=_0x5e6c[_0x1ccd25];return _0x4f5769;};'use strict';var _=require('lodash');var util=require(_0xc5e6('0x0'));var logger=require(_0xc5e6('0x1'))('api');var moment=require(_0xc5e6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc5e6('0x3'));var config=require(_0xc5e6('0x4'));var attributes=require('./faxTransferReport.attributes');module[_0xc5e6('0x5')]=function(_0x593a14,_0x38150e){return _0x593a14[_0xc5e6('0x6')]('FaxTransferReport',attributes,{'tableName':_0xc5e6('0x7'),'paranoid':![],'indexes':[{'name':_0xc5e6('0x8'),'fields':[_0xc5e6('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x012d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x3353a6,_0x1c6e93){var _0x2fe073=function(_0x58838c){while(--_0x58838c){_0x3353a6['push'](_0x3353a6['shift']());}};_0x2fe073(++_0x1c6e93);}(_0x012d,0x18d));var _0xd012=function(_0x269653,_0x4f8a59){_0x269653=_0x269653-0x0;var _0x59ed2e=_0x012d[_0x269653];return _0x59ed2e;};'use strict';var _=require(_0xd012('0x0'));var util=require(_0xd012('0x1'));var logger=require(_0xd012('0x2'))(_0xd012('0x3'));var moment=require(_0xd012('0x4'));var BPromise=require(_0xd012('0x5'));var rp=require(_0xd012('0x6'));var fs=require('fs');var path=require(_0xd012('0x7'));var rimraf=require(_0xd012('0x8'));var config=require(_0xd012('0x9'));var attributes=require(_0xd012('0xa'));module[_0xd012('0xb')]=function(_0x220794,_0xd6d47d){return _0x220794[_0xd012('0xc')](_0xd012('0xd'),attributes,{'tableName':_0xd012('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd012('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index e31dfbe..90e592e 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 _0x7e41=['../../config/utils','../../config/logger','../../config/environment','http','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x7e41,0x188));var _0x17e4=function(_0x486f25,_0x165e05){_0x486f25=_0x486f25-0x0;var _0x482482=_0x7e41[_0x486f25];return _0x482482;};'use strict';var _=require(_0x17e4('0x0'));var util=require(_0x17e4('0x1'));var moment=require(_0x17e4('0x2'));var BPromise=require(_0x17e4('0x3'));var rs=require(_0x17e4('0x4'));var fs=require('fs');var Redis=require(_0x17e4('0x5'));var db=require(_0x17e4('0x6'))['db'];var utils=require(_0x17e4('0x7'));var logger=require(_0x17e4('0x8'))('rpc');var config=require(_0x17e4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x17e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50119c,_0x48cda0,_0x48dfb2){return new BPromise(function(_0x338bb7,_0xc0758f){return client['request'](_0x50119c,_0x48dfb2)['then'](function(_0x5042b6){logger[_0x17e4('0xb')](_0x17e4('0xc'),_0x48cda0,'request\x20sent');logger['debug'](_0x17e4('0xd'),_0x48cda0,_0x17e4('0xe'),JSON[_0x17e4('0xf')](_0x5042b6));if(_0x5042b6['error']){if(_0x5042b6[_0x17e4('0x10')][_0x17e4('0x11')]===0x1f4){logger[_0x17e4('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x48cda0,_0x5042b6[_0x17e4('0x10')][_0x17e4('0x12')]);return _0xc0758f(_0x5042b6['error'][_0x17e4('0x12')]);}logger[_0x17e4('0x10')](_0x17e4('0xc'),_0x48cda0,_0x5042b6['error'][_0x17e4('0x12')]);return _0x338bb7(_0x5042b6['error']['message']);}else{logger['info'](_0x17e4('0xc'),_0x48cda0,_0x17e4('0xe'));_0x338bb7(_0x5042b6[_0x17e4('0x13')]['message']);}})[_0x17e4('0x14')](function(_0x50b9b1){logger['error'](_0x17e4('0xc'),_0x48cda0,_0x50b9b1);_0xc0758f(_0x50b9b1);});});} \ No newline at end of file +var _0x48c6=['error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x48c6,0xcc));var _0x648c=function(_0x403505,_0x1d79f0){_0x403505=_0x403505-0x0;var _0x1810d0=_0x48c6[_0x403505];return _0x1810d0;};'use strict';var _=require(_0x648c('0x0'));var util=require('util');var moment=require(_0x648c('0x1'));var BPromise=require('bluebird');var rs=require(_0x648c('0x2'));var fs=require('fs');var Redis=require(_0x648c('0x3'));var db=require(_0x648c('0x4'))['db'];var utils=require(_0x648c('0x5'));var logger=require(_0x648c('0x6'))(_0x648c('0x7'));var config=require('../../config/environment');var jayson=require(_0x648c('0x8'));var client=jayson[_0x648c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e6f71,_0x286fb9,_0x2c6e01){return new BPromise(function(_0x18057f,_0x14655d){return client[_0x648c('0xa')](_0x8e6f71,_0x2c6e01)['then'](function(_0x4028f2){logger[_0x648c('0xb')](_0x648c('0xc'),_0x286fb9,_0x648c('0xd'));logger[_0x648c('0xe')](_0x648c('0xf'),_0x286fb9,_0x648c('0xd'),JSON['stringify'](_0x4028f2));if(_0x4028f2['error']){if(_0x4028f2[_0x648c('0x10')][_0x648c('0x11')]===0x1f4){logger[_0x648c('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x286fb9,_0x4028f2[_0x648c('0x10')][_0x648c('0x12')]);return _0x14655d(_0x4028f2[_0x648c('0x10')]['message']);}logger['error'](_0x648c('0xc'),_0x286fb9,_0x4028f2['error'][_0x648c('0x12')]);return _0x18057f(_0x4028f2[_0x648c('0x10')][_0x648c('0x12')]);}else{logger[_0x648c('0xb')](_0x648c('0xc'),_0x286fb9,_0x648c('0xd'));_0x18057f(_0x4028f2['result'][_0x648c('0x12')]);}})[_0x648c('0x13')](function(_0x2f8270){logger[_0x648c('0x10')](_0x648c('0xc'),_0x286fb9,_0x2f8270);_0x14655d(_0x2f8270);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 8659bfa..4031e51 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 _0xc23e=['put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x40d130,_0x9ff658){var _0xb939ae=function(_0x349f8e){while(--_0x349f8e){_0x40d130['push'](_0x40d130['shift']());}};_0xb939ae(++_0x9ff658);}(_0xc23e,0x17e));var _0xec23=function(_0x14b006,_0x48306e){_0x14b006=_0x14b006-0x0;var _0x2379ff=_0xc23e[_0x14b006];return _0x2379ff;};'use strict';var multer=require('multer');var util=require(_0xec23('0x0'));var path=require(_0xec23('0x1'));var timeout=require(_0xec23('0x2'));var express=require(_0xec23('0x3'));var router=express['Router']();var fs_extra=require(_0xec23('0x4'));var auth=require(_0xec23('0x5'));var interaction=require(_0xec23('0x6'));var config=require(_0xec23('0x7'));var controller=require(_0xec23('0x8'));router[_0xec23('0x9')]('/',auth[_0xec23('0xa')](),controller['index']);router[_0xec23('0x9')](_0xec23('0xb'),auth[_0xec23('0xa')](),controller[_0xec23('0xc')]);router['get'](_0xec23('0xd'),auth[_0xec23('0xa')](),controller[_0xec23('0xe')]);router[_0xec23('0xf')]('/',auth[_0xec23('0xa')](),controller[_0xec23('0x10')]);router[_0xec23('0x11')](_0xec23('0xd'),auth[_0xec23('0xa')](),controller['update']);router[_0xec23('0x12')](_0xec23('0xd'),auth['isAuthenticated'](),controller[_0xec23('0x13')]);module[_0xec23('0x14')]=router; \ No newline at end of file +var _0x12bd=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','multer','util'];(function(_0x2f24fe,_0x1c46ed){var _0x4cb989=function(_0x165e79){while(--_0x165e79){_0x2f24fe['push'](_0x2f24fe['shift']());}};_0x4cb989(++_0x1c46ed);}(_0x12bd,0xee));var _0xd12b=function(_0x6e7fc0,_0x18b91e){_0x6e7fc0=_0x6e7fc0-0x0;var _0xf69948=_0x12bd[_0x6e7fc0];return _0xf69948;};'use strict';var multer=require(_0xd12b('0x0'));var util=require(_0xd12b('0x1'));var path=require(_0xd12b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd12b('0x3'));var router=express[_0xd12b('0x4')]();var fs_extra=require(_0xd12b('0x5'));var auth=require(_0xd12b('0x6'));var interaction=require(_0xd12b('0x7'));var config=require(_0xd12b('0x8'));var controller=require(_0xd12b('0x9'));router['get']('/',auth[_0xd12b('0xa')](),controller[_0xd12b('0xb')]);router[_0xd12b('0xc')](_0xd12b('0xd'),auth[_0xd12b('0xa')](),controller[_0xd12b('0xe')]);router[_0xd12b('0xc')](_0xd12b('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xd12b('0x10')]('/',auth[_0xd12b('0xa')](),controller[_0xd12b('0x11')]);router[_0xd12b('0x12')](_0xd12b('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xd12b('0x13')](_0xd12b('0xf'),auth[_0xd12b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2756b11..c770368 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 _0x1f67=['/:id','isAuthenticated','show','/:id/fields','post','/:id/configurations','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','index'];(function(_0x299ec4,_0x2a9f02){var _0x120dda=function(_0xb9437b){while(--_0xb9437b){_0x299ec4['push'](_0x299ec4['shift']());}};_0x120dda(++_0x2a9f02);}(_0x1f67,0x148));var _0x71f6=function(_0xbb4208,_0x28e4c4){_0xbb4208=_0xbb4208-0x0;var _0x2933e7=_0x1f67[_0xbb4208];return _0x2933e7;};'use strict';var multer=require(_0x71f6('0x0'));var util=require(_0x71f6('0x1'));var path=require(_0x71f6('0x2'));var timeout=require(_0x71f6('0x3'));var express=require(_0x71f6('0x4'));var router=express[_0x71f6('0x5')]();var fs_extra=require(_0x71f6('0x6'));var auth=require(_0x71f6('0x7'));var interaction=require(_0x71f6('0x8'));var config=require('../../config/environment');var controller=require(_0x71f6('0x9'));router[_0x71f6('0xa')]('/',auth['isAuthenticated'](),controller[_0x71f6('0xb')]);router[_0x71f6('0xa')](_0x71f6('0xc'),auth[_0x71f6('0xd')](),controller[_0x71f6('0xe')]);router[_0x71f6('0xa')]('/:id/configurations',auth[_0x71f6('0xd')](),controller['getConfigurations']);router[_0x71f6('0xa')](_0x71f6('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x71f6('0x10')]('/',auth[_0x71f6('0xd')](),controller['create']);router[_0x71f6('0x10')](_0x71f6('0x11'),auth[_0x71f6('0xd')](),controller['addConfiguration']);router['put'](_0x71f6('0xc'),auth[_0x71f6('0xd')](),controller['update']);router[_0x71f6('0x12')](_0x71f6('0xc'),auth[_0x71f6('0xd')](),controller['destroy']);module[_0x71f6('0x13')]=router; \ No newline at end of file +var _0xef6b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','/:id','destroy','exports','multer','util'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0xef6b,0xad));var _0xbef6=function(_0x47a823,_0x5e6fbd){_0x47a823=_0x47a823-0x0;var _0x4945b9=_0xef6b[_0x47a823];return _0x4945b9;};'use strict';var multer=require(_0xbef6('0x0'));var util=require(_0xbef6('0x1'));var path=require(_0xbef6('0x2'));var timeout=require(_0xbef6('0x3'));var express=require(_0xbef6('0x4'));var router=express[_0xbef6('0x5')]();var fs_extra=require(_0xbef6('0x6'));var auth=require(_0xbef6('0x7'));var interaction=require(_0xbef6('0x8'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xbef6('0x9')]('/',auth[_0xbef6('0xa')](),controller[_0xbef6('0xb')]);router['get']('/:id',auth[_0xbef6('0xa')](),controller[_0xbef6('0xc')]);router[_0xbef6('0x9')](_0xbef6('0xd'),auth['isAuthenticated'](),controller[_0xbef6('0xe')]);router[_0xbef6('0x9')](_0xbef6('0xf'),auth[_0xbef6('0xa')](),controller[_0xbef6('0x10')]);router['post']('/',auth[_0xbef6('0xa')](),controller[_0xbef6('0x11')]);router[_0xbef6('0x12')](_0xbef6('0xd'),auth[_0xbef6('0xa')](),controller[_0xbef6('0x13')]);router[_0xbef6('0x14')]('/:id',auth[_0xbef6('0xa')](),controller['update']);router[_0xbef6('0x15')](_0xbef6('0x16'),auth[_0xbef6('0xa')](),controller[_0xbef6('0x17')]);module[_0xbef6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ecd267c..0616769 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 _0x854d=['basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2db3ef,_0xaa972b){var _0x3bbf6a=function(_0x2a0e6b){while(--_0x2a0e6b){_0x2db3ef['push'](_0x2db3ef['shift']());}};_0x3bbf6a(++_0xaa972b);}(_0x854d,0x105));var _0xd854=function(_0x3f0011,_0x2aef2b){_0x3f0011=_0x3f0011-0x0;var _0x1d36f0=_0x854d[_0x3f0011];return _0x1d36f0;};'use strict';var Sequelize=require(_0xd854('0x0'));module[_0xd854('0x1')]={'name':{'type':Sequelize[_0xd854('0x2')]},'description':{'type':Sequelize[_0xd854('0x2')]},'username':{'type':Sequelize[_0xd854('0x2')]},'remoteUri':{'type':Sequelize[_0xd854('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xd854('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xd854('0x2')]},'consumerSecret':{'type':Sequelize[_0xd854('0x2')]},'token':{'type':Sequelize[_0xd854('0x2')]},'tokenSecret':{'type':Sequelize[_0xd854('0x2')]},'serverUrl':{'type':Sequelize[_0xd854('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd854('0x4'),_0xd854('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4475=['exports','STRING','basic','ENUM','integrationTab','newTab','sequelize'];(function(_0x36752f,_0x539ec0){var _0x4ca77e=function(_0x558261){while(--_0x558261){_0x36752f['push'](_0x36752f['shift']());}};_0x4ca77e(++_0x539ec0);}(_0x4475,0x99));var _0x5447=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4475[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5447('0x0'));module[_0x5447('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5447('0x2')]},'remoteUri':{'type':Sequelize[_0x5447('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x5447('0x3')),'defaultValue':_0x5447('0x3')},'password':{'type':Sequelize[_0x5447('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x5447('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5447('0x4')](_0x5447('0x5'),_0x5447('0x6')),'defaultValue':_0x5447('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d1ab2c0..f44b23a 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 _0x7439=['end','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','password','consumerSecret','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','error','stringify','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../components/integrations/configuration','sendStatus','status'];(function(_0x1a043b,_0x4d540a){var _0x105ff5=function(_0x49532e){while(--_0x49532e){_0x1a043b['push'](_0x1a043b['shift']());}};_0x105ff5(++_0x4d540a);}(_0x7439,0xc1));var _0x9743=function(_0x27d18d,_0x26106c){_0x27d18d=_0x27d18d-0x0;var _0x106308=_0x7439[_0x27d18d];return _0x106308;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9743('0x0'));var rp=require(_0x9743('0x1'));var moment=require(_0x9743('0x2'));var BPromise=require(_0x9743('0x3'));var Mustache=require(_0x9743('0x4'));var util=require(_0x9743('0x5'));var path=require(_0x9743('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9743('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9743('0x8'));var squel=require(_0x9743('0x9'));var crypto=require('crypto');var jsforce=require(_0x9743('0xa'));var deskjs=require(_0x9743('0xb'));var toCsv=require(_0x9743('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9743('0xd'));var authService=require(_0x9743('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9743('0xf'));var hardwareService=require(_0x9743('0x10'));var logger=require('../../config/logger')(_0x9743('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x9743('0x12'));function respondWithStatusCode(_0xe93d08,_0x43dd12){_0x43dd12=_0x43dd12||0xcc;return function(_0x2b78ec){if(_0x2b78ec){return _0xe93d08[_0x9743('0x13')](_0x43dd12);}return _0xe93d08[_0x9743('0x14')](_0x43dd12)[_0x9743('0x15')]();};}function respondWithResult(_0x56fb20,_0x381f7c){_0x381f7c=_0x381f7c||0xc8;return function(_0x423603){if(_0x423603){return _0x56fb20[_0x9743('0x14')](_0x381f7c)['json'](_0x423603);}};}function respondWithFilteredResult(_0x173e02,_0x7c267c){return function(_0x31f12f){if(_0x31f12f){var _0x5108c6=typeof _0x7c267c[_0x9743('0x16')]===_0x9743('0x17')&&typeof _0x7c267c[_0x9743('0x18')]===_0x9743('0x17');var _0x140443=_0x31f12f['count'];var _0x48f63f=_0x5108c6?0x0:_0x7c267c['offset'];var _0x5aae58=_0x5108c6?_0x31f12f[_0x9743('0x19')]:_0x7c267c[_0x9743('0x16')]+_0x7c267c[_0x9743('0x18')];var _0x4fdaec;if(_0x5aae58>=_0x140443){_0x5aae58=_0x140443;_0x4fdaec=0xc8;}else{_0x4fdaec=0xce;}_0x173e02[_0x9743('0x14')](_0x4fdaec);return _0x173e02[_0x9743('0x1a')]('Content-Range',_0x48f63f+'-'+_0x5aae58+'/'+_0x140443)[_0x9743('0x1b')](_0x31f12f);}return null;};}function patchUpdates(_0x5d15a2){return function(_0x3a9623){try{jsonpatch['apply'](_0x3a9623,_0x5d15a2,!![]);}catch(_0x2b5522){return BPromise[_0x9743('0x1c')](_0x2b5522);}return _0x3a9623[_0x9743('0x1d')]();};}function saveUpdates(_0x4466b0,_0x26ed14){return function(_0xbfc6fe){if(_0xbfc6fe){return _0xbfc6fe[_0x9743('0x1e')](_0x4466b0)['then'](function(_0x58e358){return _0x58e358;});}return null;};}function removeEntity(_0x1de9ab,_0x7e6309){return function(_0x5ddfc6){if(_0x5ddfc6){return _0x5ddfc6[_0x9743('0x1f')]()[_0x9743('0x20')](function(){_0x1de9ab[_0x9743('0x14')](0xcc)[_0x9743('0x15')]();});}};}function handleEntityNotFound(_0x18e384,_0x8d7fde){return function(_0x7d1c77){if(!_0x7d1c77){_0x18e384[_0x9743('0x13')](0x194);}return _0x7d1c77;};}function handleError(_0x38ea11,_0x483ac9){_0x483ac9=_0x483ac9||0x1f4;return function(_0x3715fd){logger['error'](_0x3715fd['stack']);if(_0x3715fd[_0x9743('0x21')]){delete _0x3715fd['name'];}_0x38ea11[_0x9743('0x14')](_0x483ac9)[_0x9743('0x22')](_0x3715fd);};}exports[_0x9743('0x23')]=function(_0x42b96b,_0xdc518a){var _0xab580a={},_0x53e594={},_0x40fad7={'count':0x0,'rows':[]};var _0x1d4da2=_[_0x9743('0x24')](db[_0x9743('0x25')][_0x9743('0x26')],function(_0x2ec332){return{'name':_0x2ec332[_0x9743('0x27')],'type':_0x2ec332[_0x9743('0x28')][_0x9743('0x29')]};});_0x53e594[_0x9743('0x2a')]=_[_0x9743('0x24')](_0x1d4da2,'name');_0x53e594[_0x9743('0x2b')]=_[_0x9743('0x2c')](_0x42b96b['query']);_0x53e594[_0x9743('0x2d')]=_[_0x9743('0x2e')](_0x53e594['model'],_0x53e594[_0x9743('0x2b')]);_0xab580a[_0x9743('0x2f')]=_[_0x9743('0x2e')](_0x53e594[_0x9743('0x2a')],qs['fields'](_0x42b96b[_0x9743('0x2b')][_0x9743('0x30')]));_0xab580a[_0x9743('0x2f')]=_0xab580a[_0x9743('0x2f')][_0x9743('0x31')]?_0xab580a[_0x9743('0x2f')]:_0x53e594[_0x9743('0x2a')];if(!_0x42b96b['query'][_0x9743('0x32')](_0x9743('0x33'))){_0xab580a['limit']=qs[_0x9743('0x18')](_0x42b96b['query'][_0x9743('0x18')]);_0xab580a[_0x9743('0x16')]=qs['offset'](_0x42b96b['query'][_0x9743('0x16')]);}_0xab580a[_0x9743('0x34')]=qs[_0x9743('0x35')](_0x42b96b[_0x9743('0x2b')][_0x9743('0x35')]);_0xab580a[_0x9743('0x36')]=qs[_0x9743('0x2d')](_['pick'](_0x42b96b[_0x9743('0x2b')],_0x53e594[_0x9743('0x2d')]),_0x1d4da2);if(_0x42b96b[_0x9743('0x2b')][_0x9743('0x37')]){_0xab580a['where']=_[_0x9743('0x38')](_0xab580a['where'],{'$or':_[_0x9743('0x24')](_0x1d4da2,function(_0x452a94){if(_0x452a94['type']!==_0x9743('0x39')){var _0xa95261={};_0xa95261[_0x452a94['name']]={'$like':'%'+_0x42b96b[_0x9743('0x2b')][_0x9743('0x37')]+'%'};return _0xa95261;}})});}_0xab580a=_[_0x9743('0x38')]({},_0xab580a,_0x42b96b[_0x9743('0x3a')]);var _0x4dad5b={'where':_0xab580a['where']};return db[_0x9743('0x25')][_0x9743('0x19')](_0x4dad5b)[_0x9743('0x20')](function(_0x84db79){_0x40fad7[_0x9743('0x19')]=_0x84db79;if(_0x42b96b[_0x9743('0x2b')][_0x9743('0x3b')]){_0xab580a['include']=[{'all':!![]}];}return db['DeskAccount'][_0x9743('0x3c')](_0xab580a);})[_0x9743('0x20')](function(_0x2495cc){_0x40fad7[_0x9743('0x3d')]=_0x2495cc;return _0x40fad7;})['then'](respondWithFilteredResult(_0xdc518a,_0xab580a))[_0x9743('0x3e')](handleError(_0xdc518a,null));};exports[_0x9743('0x3f')]=function(_0x4e7a67,_0x3bd763){var _0x4ef01c={'raw':![],'where':{'id':_0x4e7a67[_0x9743('0x40')]['id']}},_0x551b25={};_0x551b25[_0x9743('0x2a')]=_[_0x9743('0x2c')](db[_0x9743('0x25')][_0x9743('0x26')]);_0x551b25[_0x9743('0x2b')]=_[_0x9743('0x2c')](_0x4e7a67[_0x9743('0x2b')]);_0x551b25[_0x9743('0x2d')]=_[_0x9743('0x2e')](_0x551b25[_0x9743('0x2a')],_0x551b25['query']);_0x4ef01c[_0x9743('0x2f')]=_['intersection'](_0x551b25[_0x9743('0x2a')],qs[_0x9743('0x30')](_0x4e7a67['query'][_0x9743('0x30')]));_0x4ef01c['attributes']=_0x4ef01c[_0x9743('0x2f')][_0x9743('0x31')]?_0x4ef01c['attributes']:_0x551b25[_0x9743('0x2a')];if(_0x4e7a67['query']['includeAll']){_0x4ef01c[_0x9743('0x41')]=[{'all':!![]}];}_0x4ef01c=_[_0x9743('0x38')]({},_0x4ef01c,_0x4e7a67[_0x9743('0x3a')]);return db[_0x9743('0x25')][_0x9743('0x42')](_0x4ef01c)['then'](handleEntityNotFound(_0x3bd763,null))[_0x9743('0x20')](respondWithResult(_0x3bd763,null))[_0x9743('0x3e')](handleError(_0x3bd763,null));};exports['create']=function(_0x3f5c8c,_0x2caea1){return db['DeskAccount'][_0x9743('0x43')](_0x3f5c8c[_0x9743('0x44')],{})[_0x9743('0x20')](respondWithResult(_0x2caea1,0xc9))['catch'](handleError(_0x2caea1,null));};exports[_0x9743('0x1e')]=function(_0x4b9449,_0x9d3153){if(_0x4b9449[_0x9743('0x44')]['id']){delete _0x4b9449[_0x9743('0x44')]['id'];}return db[_0x9743('0x25')][_0x9743('0x42')]({'where':{'id':_0x4b9449['params']['id']}})[_0x9743('0x20')](handleEntityNotFound(_0x9d3153,null))['then'](saveUpdates(_0x4b9449[_0x9743('0x44')],null))[_0x9743('0x20')](respondWithResult(_0x9d3153,null))[_0x9743('0x3e')](handleError(_0x9d3153,null));};exports[_0x9743('0x1f')]=function(_0x1dbc3f,_0x29fe62){return db[_0x9743('0x25')][_0x9743('0x42')]({'where':{'id':_0x1dbc3f['params']['id']}})[_0x9743('0x20')](handleEntityNotFound(_0x29fe62,null))[_0x9743('0x20')](removeEntity(_0x29fe62,null))[_0x9743('0x3e')](handleError(_0x29fe62,null));};exports[_0x9743('0x45')]=function(_0x28f85b,_0x53ad8f,_0xaf6c27){var _0x358497={};var _0x1ee99d={};var _0x42ece6;var _0x4d49db;return db[_0x9743('0x25')][_0x9743('0x46')]({'where':{'id':_0x28f85b['params']['id']}})['then'](handleEntityNotFound(_0x53ad8f,null))['then'](function(_0x13bdb4){if(_0x13bdb4){_0x42ece6=_0x13bdb4;_0x1ee99d[_0x9743('0x2a')]=_[_0x9743('0x2c')](db['DeskConfiguration'][_0x9743('0x26')]);_0x1ee99d[_0x9743('0x2b')]=_['keys'](_0x28f85b[_0x9743('0x2b')]);_0x1ee99d[_0x9743('0x2d')]=_[_0x9743('0x2e')](_0x1ee99d[_0x9743('0x2a')],_0x1ee99d[_0x9743('0x2b')]);_0x358497[_0x9743('0x2f')]=_['intersection'](_0x1ee99d[_0x9743('0x2a')],qs['fields'](_0x28f85b[_0x9743('0x2b')][_0x9743('0x30')]));_0x358497[_0x9743('0x2f')]=_0x358497[_0x9743('0x2f')][_0x9743('0x31')]?_0x358497[_0x9743('0x2f')]:_0x1ee99d['model'];_0x358497[_0x9743('0x34')]=qs[_0x9743('0x35')](_0x28f85b[_0x9743('0x2b')]['sort']);_0x358497['where']=qs[_0x9743('0x2d')](_['pick'](_0x28f85b['query'],_0x1ee99d['filters']));if(_0x28f85b['query']['filter']){_0x358497[_0x9743('0x36')]=_[_0x9743('0x38')](_0x358497['where'],{'$or':_[_0x9743('0x24')](_0x358497[_0x9743('0x2f')],function(_0x1c5c76){var _0x332f35={};_0x332f35[_0x1c5c76]={'$like':'%'+_0x28f85b[_0x9743('0x2b')][_0x9743('0x37')]+'%'};return _0x332f35;})});}_0x358497=_[_0x9743('0x38')]({},_0x358497,_0x28f85b[_0x9743('0x3a')]);return _0x42ece6[_0x9743('0x45')](_0x358497);}})[_0x9743('0x20')](function(_0x190a29){if(_0x190a29){_0x4d49db=_0x190a29[_0x9743('0x31')];if(!_0x28f85b[_0x9743('0x2b')][_0x9743('0x32')](_0x9743('0x33'))){_0x358497[_0x9743('0x18')]=qs['limit'](_0x28f85b[_0x9743('0x2b')][_0x9743('0x18')]);_0x358497[_0x9743('0x16')]=qs['offset'](_0x28f85b[_0x9743('0x2b')][_0x9743('0x16')]);}return _0x42ece6[_0x9743('0x45')](_0x358497);}})[_0x9743('0x20')](function(_0x4ba58b){if(_0x4ba58b){return _0x4ba58b?{'count':_0x4d49db,'rows':_0x4ba58b}:null;}})[_0x9743('0x20')](respondWithResult(_0x53ad8f,null))['catch'](handleError(_0x53ad8f,null));};exports[_0x9743('0x47')]=function(_0x584399,_0x4dcd5d,_0x12b5ed){if(_0x584399[_0x9743('0x44')]['id']){delete _0x584399['body']['id'];}return db[_0x9743('0x25')][_0x9743('0x46')]({'where':{'id':_0x584399[_0x9743('0x40')]['id']}})[_0x9743('0x20')](handleEntityNotFound(_0x4dcd5d,null))['then'](function(_0x466d15){if(_0x466d15){_0x584399[_0x9743('0x44')][_0x9743('0x48')]=_0x466d15['id'];_0x584399[_0x9743('0x44')][_0x9743('0x49')]=integrations[_0x9743('0x4a')](_0x584399['body'][_0x9743('0x4b')],_0x584399[_0x9743('0x44')]['type']);_0x584399[_0x9743('0x44')][_0x9743('0x4c')]=integrations['getDescriptions'](_0x584399[_0x9743('0x44')]['channel'],_0x584399[_0x9743('0x44')]['type']);return db[_0x9743('0x4d')][_0x9743('0x43')](_0x584399[_0x9743('0x44')],{'include':[{'model':db[_0x9743('0x4e')],'as':_0x9743('0x49')},{'model':db['DeskField'],'as':_0x9743('0x4c')}]});}return null;})['then'](respondWithResult(_0x4dcd5d,null))['catch'](handleError(_0x4dcd5d,null));};exports[_0x9743('0x4f')]=function(_0x189ea1,_0x275d09,_0xfd4511){var _0xd598c8=[{'name':_0x9743('0x50'),'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 _0x356fae='';return db[_0x9743('0x25')]['findOne']({'where':{'id':_0x189ea1[_0x9743('0x40')]['id']},'attributes':['id',_0x9743('0x51'),_0x9743('0x52'),'username',_0x9743('0x53'),'consumerKey',_0x9743('0x54'),_0x9743('0x55'),'tokenSecret']})[_0x9743('0x20')](handleEntityNotFound(_0x275d09,null))[_0x9743('0x20')](function(_0x58ad28){if(_0x58ad28){_0x356fae=_0x58ad28[_0x9743('0x51')];var _0x558f63=_0x356fae[_0x9743('0x56')](-0x1);if(_0x558f63==='/'){_0x356fae=_0x356fae[_0x9743('0x57')](0x0,_0x356fae[_0x9743('0x58')](_0x558f63));}var _0x5c8734={'method':_0x9743('0x59'),'uri':util[_0x9743('0x5a')](_0x9743('0x5b'),_0x356fae),'headers':{'Content-Type':_0x9743('0x5c'),'Accept':_0x9743('0x5c')},'json':!![]};if(_0x58ad28['authType']==='basic'){_0x5c8734[_0x9743('0x5d')][_0x9743('0x5e')]=util[_0x9743('0x5a')]('Basic\x20%s',new Buffer(util[_0x9743('0x5a')](_0x9743('0x5f'),_0x58ad28['username'],_0x58ad28[_0x9743('0x53')]))[_0x9743('0x60')](_0x9743('0x61')));}return rp(_0x5c8734)[_0x9743('0x20')](function(_0x59dc81){return _0xd598c8[_0x9743('0x62')](_[_0x9743('0x24')](_0x59dc81['_embedded'][_0x9743('0x63')],function(_0x425347){return{'id':_0x425347['name'],'name':_0x425347[_0x9743('0x21')],'type':_0x425347[_0x9743('0x28')],'active':_0x425347[_0x9743('0x64')],'label':_0x425347[_0x9743('0x65')],'custom':!![]};}));});}})[_0x9743('0x20')](function(_0x4ab89c){return{'count':_0x4ab89c[_0x9743('0x31')],'rows':_0x4ab89c};})[_0x9743('0x20')](respondWithResult(_0x275d09,null))[_0x9743('0x3e')](function(_0x37b87e){var _0x533b37=_0x189ea1[_0x9743('0x2b')][_0x9743('0x66')]?0x1f4:_0x37b87e[_0x9743('0x67')]||0x1f4;logger[_0x9743('0x68')]('getFields,\x20%s,\x20%s,\x20%s',_0x9743('0x4f'),_0x533b37,JSON[_0x9743('0x69')](_0x37b87e));delete _0x37b87e['name'];if(_0x533b37===0x191){_0x533b37=0x190;}_0x275d09['status'](_0x533b37)[_0x9743('0x22')](_0x189ea1[_0x9743('0x2b')]['test']?{'message':_0x9743('0x6a'),'statusCode':_0x37b87e[_0x9743('0x67')]}:_0x37b87e);});}; \ No newline at end of file +var _0xc010=['label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','save','then','stack','name','send','index','map','DeskAccount','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','find','catch','create','update','body','params','destroy','findOne','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','DeskConfiguration','Subjects','DeskField','getFields','priority','remoteUri','username','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','authType','basic','headers','format','%s:%s','password','toString','_embedded','entries'];(function(_0x5dd820,_0x544b6a){var _0x2d043e=function(_0x587234){while(--_0x587234){_0x5dd820['push'](_0x5dd820['shift']());}};_0x2d043e(++_0x544b6a);}(_0xc010,0x1cf));var _0x0c01=function(_0x3924a6,_0x49d479){_0x3924a6=_0x3924a6-0x0;var _0x15e83d=_0xc010[_0x3924a6];return _0x15e83d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c01('0x0'));var zipdir=require(_0x0c01('0x1'));var jsonpatch=require(_0x0c01('0x2'));var rp=require('request-promise');var moment=require(_0x0c01('0x3'));var BPromise=require(_0x0c01('0x4'));var Mustache=require(_0x0c01('0x5'));var util=require(_0x0c01('0x6'));var path=require(_0x0c01('0x7'));var sox=require(_0x0c01('0x8'));var csv=require(_0x0c01('0x9'));var ejs=require(_0x0c01('0xa'));var fs=require('fs');var fs_extra=require(_0x0c01('0xb'));var _=require(_0x0c01('0xc'));var squel=require(_0x0c01('0xd'));var crypto=require('crypto');var jsforce=require(_0x0c01('0xe'));var deskjs=require(_0x0c01('0xf'));var toCsv=require(_0x0c01('0x9'));var querystring=require(_0x0c01('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c01('0x11'));var qs=require(_0x0c01('0x12'));var as=require(_0x0c01('0x13'));var hardwareService=require(_0x0c01('0x14'));var logger=require(_0x0c01('0x15'))(_0x0c01('0x16'));var utils=require(_0x0c01('0x17'));var config=require(_0x0c01('0x18'));var licenseUtil=require(_0x0c01('0x19'));var db=require(_0x0c01('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x418ce9,_0x50f67c){_0x50f67c=_0x50f67c||0xcc;return function(_0x376b05){if(_0x376b05){return _0x418ce9[_0x0c01('0x1b')](_0x50f67c);}return _0x418ce9[_0x0c01('0x1c')](_0x50f67c)[_0x0c01('0x1d')]();};}function respondWithResult(_0x1ef1d2,_0x2414c8){_0x2414c8=_0x2414c8||0xc8;return function(_0x37d635){if(_0x37d635){return _0x1ef1d2[_0x0c01('0x1c')](_0x2414c8)['json'](_0x37d635);}};}function respondWithFilteredResult(_0x5347cc,_0x228b4d){return function(_0x30ce98){if(_0x30ce98){var _0xc37dba=typeof _0x228b4d[_0x0c01('0x1e')]===_0x0c01('0x1f')&&typeof _0x228b4d[_0x0c01('0x20')]===_0x0c01('0x1f');var _0x2a277e=_0x30ce98['count'];var _0xc6cedd=_0xc37dba?0x0:_0x228b4d['offset'];var _0x2e7665=_0xc37dba?_0x30ce98[_0x0c01('0x21')]:_0x228b4d['offset']+_0x228b4d['limit'];var _0x320ec5;if(_0x2e7665>=_0x2a277e){_0x2e7665=_0x2a277e;_0x320ec5=0xc8;}else{_0x320ec5=0xce;}_0x5347cc[_0x0c01('0x1c')](_0x320ec5);return _0x5347cc[_0x0c01('0x22')]('Content-Range',_0xc6cedd+'-'+_0x2e7665+'/'+_0x2a277e)['json'](_0x30ce98);}return null;};}function patchUpdates(_0x3a1271){return function(_0x45264c){try{jsonpatch['apply'](_0x45264c,_0x3a1271,!![]);}catch(_0x115944){return BPromise['reject'](_0x115944);}return _0x45264c[_0x0c01('0x23')]();};}function saveUpdates(_0x198b65,_0x4471d6){return function(_0x4ec7e0){if(_0x4ec7e0){return _0x4ec7e0['update'](_0x198b65)[_0x0c01('0x24')](function(_0x1bb371){return _0x1bb371;});}return null;};}function removeEntity(_0x1d9cd9,_0x4e5c67){return function(_0x5aae18){if(_0x5aae18){return _0x5aae18['destroy']()[_0x0c01('0x24')](function(){_0x1d9cd9[_0x0c01('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13f999,_0x41cd10){return function(_0x713529){if(!_0x713529){_0x13f999['sendStatus'](0x194);}return _0x713529;};}function handleError(_0x1f9973,_0x1fa33c){_0x1fa33c=_0x1fa33c||0x1f4;return function(_0x1c4e53){logger['error'](_0x1c4e53[_0x0c01('0x25')]);if(_0x1c4e53[_0x0c01('0x26')]){delete _0x1c4e53[_0x0c01('0x26')];}_0x1f9973[_0x0c01('0x1c')](_0x1fa33c)[_0x0c01('0x27')](_0x1c4e53);};}exports[_0x0c01('0x28')]=function(_0x5d7df8,_0x472121){var _0x5b8f2e={},_0x564fa8={},_0x1e2066={'count':0x0,'rows':[]};var _0x434e71=_[_0x0c01('0x29')](db[_0x0c01('0x2a')]['rawAttributes'],function(_0x3f3536){return{'name':_0x3f3536[_0x0c01('0x2b')],'type':_0x3f3536[_0x0c01('0x2c')][_0x0c01('0x2d')]};});_0x564fa8[_0x0c01('0x2e')]=_[_0x0c01('0x29')](_0x434e71,_0x0c01('0x26'));_0x564fa8['query']=_[_0x0c01('0x2f')](_0x5d7df8['query']);_0x564fa8[_0x0c01('0x30')]=_['intersection'](_0x564fa8[_0x0c01('0x2e')],_0x564fa8[_0x0c01('0x31')]);_0x5b8f2e[_0x0c01('0x32')]=_[_0x0c01('0x33')](_0x564fa8['model'],qs['fields'](_0x5d7df8[_0x0c01('0x31')][_0x0c01('0x34')]));_0x5b8f2e[_0x0c01('0x32')]=_0x5b8f2e[_0x0c01('0x32')][_0x0c01('0x35')]?_0x5b8f2e[_0x0c01('0x32')]:_0x564fa8[_0x0c01('0x2e')];if(!_0x5d7df8[_0x0c01('0x31')][_0x0c01('0x36')](_0x0c01('0x37'))){_0x5b8f2e['limit']=qs[_0x0c01('0x20')](_0x5d7df8['query'][_0x0c01('0x20')]);_0x5b8f2e['offset']=qs[_0x0c01('0x1e')](_0x5d7df8['query'][_0x0c01('0x1e')]);}_0x5b8f2e[_0x0c01('0x38')]=qs[_0x0c01('0x39')](_0x5d7df8[_0x0c01('0x31')]['sort']);_0x5b8f2e[_0x0c01('0x3a')]=qs['filters'](_[_0x0c01('0x3b')](_0x5d7df8[_0x0c01('0x31')],_0x564fa8['filters']),_0x434e71);if(_0x5d7df8[_0x0c01('0x31')][_0x0c01('0x3c')]){_0x5b8f2e[_0x0c01('0x3a')]=_[_0x0c01('0x3d')](_0x5b8f2e[_0x0c01('0x3a')],{'$or':_[_0x0c01('0x29')](_0x434e71,function(_0x1f8bdf){if(_0x1f8bdf[_0x0c01('0x2c')]!==_0x0c01('0x3e')){var _0x53a4a6={};_0x53a4a6[_0x1f8bdf[_0x0c01('0x26')]]={'$like':'%'+_0x5d7df8[_0x0c01('0x31')][_0x0c01('0x3c')]+'%'};return _0x53a4a6;}})});}_0x5b8f2e=_[_0x0c01('0x3d')]({},_0x5b8f2e,_0x5d7df8[_0x0c01('0x3f')]);var _0x6bcda7={'where':_0x5b8f2e[_0x0c01('0x3a')]};return db[_0x0c01('0x2a')]['count'](_0x6bcda7)[_0x0c01('0x24')](function(_0x5e201d){_0x1e2066[_0x0c01('0x21')]=_0x5e201d;if(_0x5d7df8[_0x0c01('0x31')][_0x0c01('0x40')]){_0x5b8f2e[_0x0c01('0x41')]=[{'all':!![]}];}return db[_0x0c01('0x2a')][_0x0c01('0x42')](_0x5b8f2e);})[_0x0c01('0x24')](function(_0x2aca44){_0x1e2066['rows']=_0x2aca44;return _0x1e2066;})[_0x0c01('0x24')](respondWithFilteredResult(_0x472121,_0x5b8f2e))['catch'](handleError(_0x472121,null));};exports[_0x0c01('0x43')]=function(_0x21f742,_0x1fb98f){var _0x3d1310={'raw':![],'where':{'id':_0x21f742['params']['id']}},_0x5a713a={};_0x5a713a['model']=_[_0x0c01('0x2f')](db[_0x0c01('0x2a')][_0x0c01('0x44')]);_0x5a713a[_0x0c01('0x31')]=_[_0x0c01('0x2f')](_0x21f742['query']);_0x5a713a[_0x0c01('0x30')]=_[_0x0c01('0x33')](_0x5a713a[_0x0c01('0x2e')],_0x5a713a[_0x0c01('0x31')]);_0x3d1310[_0x0c01('0x32')]=_[_0x0c01('0x33')](_0x5a713a['model'],qs[_0x0c01('0x34')](_0x21f742[_0x0c01('0x31')][_0x0c01('0x34')]));_0x3d1310[_0x0c01('0x32')]=_0x3d1310[_0x0c01('0x32')][_0x0c01('0x35')]?_0x3d1310['attributes']:_0x5a713a['model'];if(_0x21f742[_0x0c01('0x31')][_0x0c01('0x40')]){_0x3d1310[_0x0c01('0x41')]=[{'all':!![]}];}_0x3d1310=_[_0x0c01('0x3d')]({},_0x3d1310,_0x21f742[_0x0c01('0x3f')]);return db[_0x0c01('0x2a')][_0x0c01('0x45')](_0x3d1310)[_0x0c01('0x24')](handleEntityNotFound(_0x1fb98f,null))['then'](respondWithResult(_0x1fb98f,null))[_0x0c01('0x46')](handleError(_0x1fb98f,null));};exports[_0x0c01('0x47')]=function(_0x1d6c48,_0x50b8a0){return db[_0x0c01('0x2a')][_0x0c01('0x47')](_0x1d6c48['body'],{})['then'](respondWithResult(_0x50b8a0,0xc9))[_0x0c01('0x46')](handleError(_0x50b8a0,null));};exports[_0x0c01('0x48')]=function(_0x14cdfd,_0x318650){if(_0x14cdfd[_0x0c01('0x49')]['id']){delete _0x14cdfd[_0x0c01('0x49')]['id'];}return db[_0x0c01('0x2a')][_0x0c01('0x45')]({'where':{'id':_0x14cdfd[_0x0c01('0x4a')]['id']}})['then'](handleEntityNotFound(_0x318650,null))[_0x0c01('0x24')](saveUpdates(_0x14cdfd['body'],null))['then'](respondWithResult(_0x318650,null))[_0x0c01('0x46')](handleError(_0x318650,null));};exports[_0x0c01('0x4b')]=function(_0xc61806,_0x5893e4){return db['DeskAccount'][_0x0c01('0x45')]({'where':{'id':_0xc61806['params']['id']}})[_0x0c01('0x24')](handleEntityNotFound(_0x5893e4,null))[_0x0c01('0x24')](removeEntity(_0x5893e4,null))[_0x0c01('0x46')](handleError(_0x5893e4,null));};exports['getConfigurations']=function(_0x8e107e,_0x32da22,_0x22907c){var _0x386149={};var _0x26b831={};var _0x5be504;var _0x1be609;return db[_0x0c01('0x2a')][_0x0c01('0x4c')]({'where':{'id':_0x8e107e[_0x0c01('0x4a')]['id']}})[_0x0c01('0x24')](handleEntityNotFound(_0x32da22,null))[_0x0c01('0x24')](function(_0x1e4072){if(_0x1e4072){_0x5be504=_0x1e4072;_0x26b831[_0x0c01('0x2e')]=_[_0x0c01('0x2f')](db['DeskConfiguration'][_0x0c01('0x44')]);_0x26b831['query']=_[_0x0c01('0x2f')](_0x8e107e[_0x0c01('0x31')]);_0x26b831['filters']=_[_0x0c01('0x33')](_0x26b831['model'],_0x26b831[_0x0c01('0x31')]);_0x386149[_0x0c01('0x32')]=_[_0x0c01('0x33')](_0x26b831[_0x0c01('0x2e')],qs[_0x0c01('0x34')](_0x8e107e[_0x0c01('0x31')]['fields']));_0x386149[_0x0c01('0x32')]=_0x386149[_0x0c01('0x32')][_0x0c01('0x35')]?_0x386149[_0x0c01('0x32')]:_0x26b831[_0x0c01('0x2e')];_0x386149['order']=qs['sort'](_0x8e107e[_0x0c01('0x31')][_0x0c01('0x39')]);_0x386149[_0x0c01('0x3a')]=qs['filters'](_[_0x0c01('0x3b')](_0x8e107e[_0x0c01('0x31')],_0x26b831[_0x0c01('0x30')]));if(_0x8e107e[_0x0c01('0x31')][_0x0c01('0x3c')]){_0x386149['where']=_[_0x0c01('0x3d')](_0x386149[_0x0c01('0x3a')],{'$or':_[_0x0c01('0x29')](_0x386149['attributes'],function(_0x3683e1){var _0x3006af={};_0x3006af[_0x3683e1]={'$like':'%'+_0x8e107e[_0x0c01('0x31')][_0x0c01('0x3c')]+'%'};return _0x3006af;})});}_0x386149=_[_0x0c01('0x3d')]({},_0x386149,_0x8e107e['options']);return _0x5be504[_0x0c01('0x4d')](_0x386149);}})['then'](function(_0x565305){if(_0x565305){_0x1be609=_0x565305['length'];if(!_0x8e107e[_0x0c01('0x31')][_0x0c01('0x36')](_0x0c01('0x37'))){_0x386149[_0x0c01('0x20')]=qs[_0x0c01('0x20')](_0x8e107e[_0x0c01('0x31')]['limit']);_0x386149[_0x0c01('0x1e')]=qs['offset'](_0x8e107e[_0x0c01('0x31')][_0x0c01('0x1e')]);}return _0x5be504[_0x0c01('0x4d')](_0x386149);}})[_0x0c01('0x24')](function(_0x11cc0f){if(_0x11cc0f){return _0x11cc0f?{'count':_0x1be609,'rows':_0x11cc0f}:null;}})['then'](respondWithResult(_0x32da22,null))[_0x0c01('0x46')](handleError(_0x32da22,null));};exports[_0x0c01('0x4e')]=function(_0x26fc4f,_0x4a91bb,_0x5367b4){if(_0x26fc4f[_0x0c01('0x49')]['id']){delete _0x26fc4f['body']['id'];}return db['DeskAccount'][_0x0c01('0x4c')]({'where':{'id':_0x26fc4f[_0x0c01('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a91bb,null))[_0x0c01('0x24')](function(_0x19a9ba){if(_0x19a9ba){_0x26fc4f['body']['AccountId']=_0x19a9ba['id'];_0x26fc4f[_0x0c01('0x49')]['Subjects']=integrations[_0x0c01('0x4f')](_0x26fc4f[_0x0c01('0x49')][_0x0c01('0x50')],_0x26fc4f[_0x0c01('0x49')][_0x0c01('0x2c')]);_0x26fc4f[_0x0c01('0x49')][_0x0c01('0x51')]=integrations['getDescriptions'](_0x26fc4f[_0x0c01('0x49')][_0x0c01('0x50')],_0x26fc4f['body'][_0x0c01('0x2c')]);return db[_0x0c01('0x52')][_0x0c01('0x47')](_0x26fc4f[_0x0c01('0x49')],{'include':[{'model':db['DeskField'],'as':_0x0c01('0x53')},{'model':db[_0x0c01('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4a91bb,null))[_0x0c01('0x46')](handleError(_0x4a91bb,null));};exports[_0x0c01('0x55')]=function(_0xe3e44c,_0x34d1c6,_0xd23eff){var _0x1c8d06=[{'name':_0x0c01('0x56'),'label':_0x0c01('0x56'),'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 _0x3a4a22='';return db[_0x0c01('0x2a')][_0x0c01('0x4c')]({'where':{'id':_0xe3e44c[_0x0c01('0x4a')]['id']},'attributes':['id',_0x0c01('0x57'),'authType',_0x0c01('0x58'),'password',_0x0c01('0x59'),_0x0c01('0x5a'),_0x0c01('0x5b'),'tokenSecret']})['then'](handleEntityNotFound(_0x34d1c6,null))['then'](function(_0x446d42){if(_0x446d42){_0x3a4a22=_0x446d42[_0x0c01('0x57')];var _0x643961=_0x3a4a22[_0x0c01('0x5c')](-0x1);if(_0x643961==='/'){_0x3a4a22=_0x3a4a22[_0x0c01('0x5d')](0x0,_0x3a4a22[_0x0c01('0x5e')](_0x643961));}var _0x418f2a={'method':_0x0c01('0x5f'),'uri':util['format'](_0x0c01('0x60'),_0x3a4a22),'headers':{'Content-Type':_0x0c01('0x61'),'Accept':_0x0c01('0x61')},'json':!![]};if(_0x446d42[_0x0c01('0x62')]===_0x0c01('0x63')){_0x418f2a[_0x0c01('0x64')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0x0c01('0x65')](_0x0c01('0x66'),_0x446d42[_0x0c01('0x58')],_0x446d42[_0x0c01('0x67')]))[_0x0c01('0x68')]('base64'));}return rp(_0x418f2a)[_0x0c01('0x24')](function(_0x2f0367){return _0x1c8d06['concat'](_[_0x0c01('0x29')](_0x2f0367[_0x0c01('0x69')][_0x0c01('0x6a')],function(_0x5cd737){return{'id':_0x5cd737[_0x0c01('0x26')],'name':_0x5cd737[_0x0c01('0x26')],'type':_0x5cd737['type'],'active':_0x5cd737['active'],'label':_0x5cd737[_0x0c01('0x6b')],'custom':!![]};}));});}})['then'](function(_0x1f5831){return{'count':_0x1f5831['length'],'rows':_0x1f5831};})[_0x0c01('0x24')](respondWithResult(_0x34d1c6,null))[_0x0c01('0x46')](function(_0x18514e){var _0x150065=_0xe3e44c[_0x0c01('0x31')][_0x0c01('0x6c')]?0x1f4:_0x18514e[_0x0c01('0x6d')]||0x1f4;logger[_0x0c01('0x6e')](_0x0c01('0x6f'),_0x0c01('0x55'),_0x150065,JSON[_0x0c01('0x70')](_0x18514e));delete _0x18514e['name'];if(_0x150065===0x191){_0x150065=0x190;}_0x34d1c6[_0x0c01('0x1c')](_0x150065)['send'](_0xe3e44c[_0x0c01('0x31')][_0x0c01('0x6c')]?{'message':_0x0c01('0x71'),'statusCode':_0x18514e[_0x0c01('0x6d')]}:_0x18514e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 4af7559..2f7f0a3 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 _0x2f3f=['util','api','moment','bluebird','path','rimraf','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash'];(function(_0x5e35c3,_0x5e86af){var _0xda36bb=function(_0x3b2a8c){while(--_0x3b2a8c){_0x5e35c3['push'](_0x5e35c3['shift']());}};_0xda36bb(++_0x5e86af);}(_0x2f3f,0xe6));var _0xf2f3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2f3f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xf2f3('0x0'));var util=require(_0xf2f3('0x1'));var logger=require('../../config/logger')(_0xf2f3('0x2'));var moment=require(_0xf2f3('0x3'));var BPromise=require(_0xf2f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2f3('0x5'));var rimraf=require(_0xf2f3('0x6'));var config=require('../../config/environment');var attributes=require(_0xf2f3('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf2f3('0x8')]=function(_0x53bcce,_0x204deb){return _0x53bcce[_0xf2f3('0x9')]('DeskAccount',attributes,{'tableName':_0xf2f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2438=['rimraf','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','request-promise','path'];(function(_0x38373e,_0x45316b){var _0x2248be=function(_0x2e6e1b){while(--_0x2e6e1b){_0x38373e['push'](_0x38373e['shift']());}};_0x2248be(++_0x45316b);}(_0x2438,0x17a));var _0x8243=function(_0x1b4b01,_0x43eb55){_0x1b4b01=_0x1b4b01-0x0;var _0x521446=_0x2438[_0x1b4b01];return _0x521446;};'use strict';var _=require(_0x8243('0x0'));var util=require(_0x8243('0x1'));var logger=require('../../config/logger')(_0x8243('0x2'));var moment=require(_0x8243('0x3'));var BPromise=require('bluebird');var rp=require(_0x8243('0x4'));var fs=require('fs');var path=require(_0x8243('0x5'));var rimraf=require(_0x8243('0x6'));var config=require('../../config/environment');var attributes=require(_0x8243('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8243('0x8')]=function(_0x190603,_0x466e5b){return _0x190603[_0x8243('0x9')](_0x8243('0xa'),attributes,{'tableName':_0x8243('0xb'),'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 bb94f06..870936f 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 _0x43d5=['GetDeskAccount','find','where','ShowDeskAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','options','limit','map','include','model','attributes'];(function(_0x3728bd,_0x405db5){var _0xdf5cb5=function(_0x2ce7a5){while(--_0x2ce7a5){_0x3728bd['push'](_0x3728bd['shift']());}};_0xdf5cb5(++_0x405db5);}(_0x43d5,0x84));var _0x543d=function(_0x2be903,_0xf33169){_0x2be903=_0x2be903-0x0;var _0x262f72=_0x43d5[_0x2be903];return _0x262f72;};'use strict';var _=require('lodash');var util=require(_0x543d('0x0'));var moment=require(_0x543d('0x1'));var BPromise=require('bluebird');var rs=require(_0x543d('0x2'));var fs=require('fs');var Redis=require(_0x543d('0x3'));var db=require(_0x543d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x543d('0x5'))(_0x543d('0x6'));var config=require('../../config/environment');var jayson=require(_0x543d('0x7'));var client=jayson[_0x543d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181aa2,_0x10d9ed,_0x35232a){return new BPromise(function(_0x261d78,_0x4f8e7a){return client[_0x543d('0x9')](_0x181aa2,_0x35232a)[_0x543d('0xa')](function(_0x206f4d){logger[_0x543d('0xb')](_0x543d('0xc'),_0x10d9ed,'request\x20sent');logger[_0x543d('0xd')](_0x543d('0xe'),_0x10d9ed,'request\x20sent',JSON[_0x543d('0xf')](_0x206f4d));if(_0x206f4d[_0x543d('0x10')]){if(_0x206f4d[_0x543d('0x10')][_0x543d('0x11')]===0x1f4){logger[_0x543d('0x10')](_0x543d('0xc'),_0x10d9ed,_0x206f4d[_0x543d('0x10')]['message']);return _0x4f8e7a(_0x206f4d[_0x543d('0x10')]['message']);}logger[_0x543d('0x10')]('DeskAccount,\x20%s,\x20%s',_0x10d9ed,_0x206f4d['error'][_0x543d('0x12')]);return _0x261d78(_0x206f4d[_0x543d('0x10')][_0x543d('0x12')]);}else{logger['info'](_0x543d('0xc'),_0x10d9ed,'request\x20sent');_0x261d78(_0x206f4d[_0x543d('0x13')][_0x543d('0x12')]);}})[_0x543d('0x14')](function(_0x3c7eeb){logger[_0x543d('0x10')](_0x543d('0xc'),_0x10d9ed,_0x3c7eeb);_0x4f8e7a(_0x3c7eeb);});});}exports['GetDeskAccount']=function(_0x1d13d8){var _0x12f8a5=this;return new Promise(function(_0x12dd5c,_0x186daf){return db[_0x543d('0x15')]['findAll']({'raw':_0x1d13d8[_0x543d('0x16')]?_0x1d13d8[_0x543d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d13d8[_0x543d('0x16')]?_0x1d13d8[_0x543d('0x16')]['where']||null:null,'attributes':_0x1d13d8[_0x543d('0x16')]?_0x1d13d8[_0x543d('0x16')]['attributes']||null:null,'limit':_0x1d13d8[_0x543d('0x16')]?_0x1d13d8[_0x543d('0x16')][_0x543d('0x17')]||null:null,'include':_0x1d13d8[_0x543d('0x16')]?_0x1d13d8[_0x543d('0x16')]['include']?_[_0x543d('0x18')](_0x1d13d8[_0x543d('0x16')][_0x543d('0x19')],function(_0x23abb9){return{'model':db[_0x23abb9[_0x543d('0x1a')]],'as':_0x23abb9['as'],'attributes':_0x23abb9['attributes'],'include':_0x23abb9[_0x543d('0x19')]?_['map'](_0x23abb9['include'],function(_0x584a12){return{'model':db[_0x584a12[_0x543d('0x1a')]],'as':_0x584a12['as'],'attributes':_0x584a12['attributes'],'include':_0x584a12[_0x543d('0x19')]?_[_0x543d('0x18')](_0x584a12[_0x543d('0x19')],function(_0x189585){return{'model':db[_0x189585['model']],'as':_0x189585['as'],'attributes':_0x189585[_0x543d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x543d('0xa')](function(_0x531f57){logger[_0x543d('0xb')](_0x543d('0x1c'),_0x1d13d8);logger[_0x543d('0xd')](_0x543d('0x1c'),_0x1d13d8,JSON[_0x543d('0xf')](_0x531f57));_0x12dd5c(_0x531f57);})[_0x543d('0x14')](function(_0x3a0072){logger[_0x543d('0x10')]('GetDeskAccount',_0x3a0072[_0x543d('0x12')],_0x1d13d8);_0x186daf(_0x12f8a5[_0x543d('0x10')](0x1f4,_0x3a0072[_0x543d('0x12')]));});});};exports['ShowDeskAccount']=function(_0x2a43ff){var _0x15f076=this;return new Promise(function(_0x5f11a9,_0x2e9059){return db[_0x543d('0x15')][_0x543d('0x1d')]({'raw':_0x2a43ff[_0x543d('0x16')]?_0x2a43ff['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a43ff[_0x543d('0x16')]?_0x2a43ff['options'][_0x543d('0x1e')]||null:null,'attributes':_0x2a43ff['options']?_0x2a43ff[_0x543d('0x16')]['attributes']||null:null,'include':_0x2a43ff[_0x543d('0x16')]?_0x2a43ff[_0x543d('0x16')][_0x543d('0x19')]?_['map'](_0x2a43ff[_0x543d('0x16')][_0x543d('0x19')],function(_0x3304af){return{'model':db[_0x3304af[_0x543d('0x1a')]],'as':_0x3304af['as'],'attributes':_0x3304af[_0x543d('0x1b')],'include':_0x3304af['include']?_['map'](_0x3304af[_0x543d('0x19')],function(_0x3fc67a){return{'model':db[_0x3fc67a[_0x543d('0x1a')]],'as':_0x3fc67a['as'],'attributes':_0x3fc67a[_0x543d('0x1b')],'include':_0x3fc67a[_0x543d('0x19')]?_[_0x543d('0x18')](_0x3fc67a[_0x543d('0x19')],function(_0x5ee170){return{'model':db[_0x5ee170[_0x543d('0x1a')]],'as':_0x5ee170['as'],'attributes':_0x5ee170['attributes']};}):[]};}):[]};}):[]:[]})[_0x543d('0xa')](function(_0x3bc390){logger['info']('ShowDeskAccount',_0x2a43ff);logger[_0x543d('0xd')](_0x543d('0x1f'),_0x2a43ff,JSON[_0x543d('0xf')](_0x3bc390));_0x5f11a9(_0x3bc390);})[_0x543d('0x14')](function(_0x3aa9f2){logger[_0x543d('0x10')](_0x543d('0x1f'),_0x3aa9f2[_0x543d('0x12')],_0x2a43ff);_0x2e9059(_0x15f076['error'](0x1f4,_0x3aa9f2[_0x543d('0x12')]));});});}; \ No newline at end of file +var _0x4976=['options','raw','where','attributes','include','map','model','ShowDeskAccount','then','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetDeskAccount','DeskAccount','findAll'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x4976,0xb1));var _0x6497=function(_0x5af58d,_0x2322eb){_0x5af58d=_0x5af58d-0x0;var _0x34251b=_0x4976[_0x5af58d];return _0x34251b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6497('0x0'));var BPromise=require(_0x6497('0x1'));var rs=require(_0x6497('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6497('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6497('0x4'));var config=require('../../config/environment');var jayson=require(_0x6497('0x5'));var client=jayson[_0x6497('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x292a6c,_0x4f8300,_0x205560){return new BPromise(function(_0x4cb569,_0x1f8c2f){return client['request'](_0x292a6c,_0x205560)['then'](function(_0x1d0c75){logger['info'](_0x6497('0x7'),_0x4f8300,_0x6497('0x8'));logger[_0x6497('0x9')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4f8300,_0x6497('0x8'),JSON[_0x6497('0xa')](_0x1d0c75));if(_0x1d0c75[_0x6497('0xb')]){if(_0x1d0c75[_0x6497('0xb')]['code']===0x1f4){logger[_0x6497('0xb')](_0x6497('0x7'),_0x4f8300,_0x1d0c75[_0x6497('0xb')][_0x6497('0xc')]);return _0x1f8c2f(_0x1d0c75[_0x6497('0xb')][_0x6497('0xc')]);}logger[_0x6497('0xb')]('DeskAccount,\x20%s,\x20%s',_0x4f8300,_0x1d0c75[_0x6497('0xb')][_0x6497('0xc')]);return _0x4cb569(_0x1d0c75[_0x6497('0xb')][_0x6497('0xc')]);}else{logger[_0x6497('0xd')](_0x6497('0x7'),_0x4f8300,_0x6497('0x8'));_0x4cb569(_0x1d0c75[_0x6497('0xe')]['message']);}})[_0x6497('0xf')](function(_0x3493e4){logger[_0x6497('0xb')](_0x6497('0x7'),_0x4f8300,_0x3493e4);_0x1f8c2f(_0x3493e4);});});}exports[_0x6497('0x10')]=function(_0x173491){var _0x4bf918=this;return new Promise(function(_0x5a5a06,_0x2c2164){return db[_0x6497('0x11')][_0x6497('0x12')]({'raw':_0x173491['options']?_0x173491[_0x6497('0x13')][_0x6497('0x14')]===undefined?!![]:![]:!![],'where':_0x173491['options']?_0x173491[_0x6497('0x13')][_0x6497('0x15')]||null:null,'attributes':_0x173491[_0x6497('0x13')]?_0x173491[_0x6497('0x13')][_0x6497('0x16')]||null:null,'limit':_0x173491['options']?_0x173491['options']['limit']||null:null,'include':_0x173491['options']?_0x173491['options'][_0x6497('0x17')]?_[_0x6497('0x18')](_0x173491[_0x6497('0x13')][_0x6497('0x17')],function(_0x5ed0db){return{'model':db[_0x5ed0db['model']],'as':_0x5ed0db['as'],'attributes':_0x5ed0db[_0x6497('0x16')],'include':_0x5ed0db[_0x6497('0x17')]?_[_0x6497('0x18')](_0x5ed0db[_0x6497('0x17')],function(_0x55a3e8){return{'model':db[_0x55a3e8[_0x6497('0x19')]],'as':_0x55a3e8['as'],'attributes':_0x55a3e8['attributes'],'include':_0x55a3e8['include']?_[_0x6497('0x18')](_0x55a3e8['include'],function(_0x3bcd32){return{'model':db[_0x3bcd32[_0x6497('0x19')]],'as':_0x3bcd32['as'],'attributes':_0x3bcd32[_0x6497('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xebcf0c){logger[_0x6497('0xd')]('GetDeskAccount',_0x173491);logger[_0x6497('0x9')](_0x6497('0x10'),_0x173491,JSON[_0x6497('0xa')](_0xebcf0c));_0x5a5a06(_0xebcf0c);})['catch'](function(_0x40efd3){logger[_0x6497('0xb')](_0x6497('0x10'),_0x40efd3['message'],_0x173491);_0x2c2164(_0x4bf918[_0x6497('0xb')](0x1f4,_0x40efd3[_0x6497('0xc')]));});});};exports[_0x6497('0x1a')]=function(_0x33b607){var _0x3d6ea6=this;return new Promise(function(_0x1910a7,_0x1ff0e2){return db[_0x6497('0x11')]['find']({'raw':_0x33b607[_0x6497('0x13')]?_0x33b607['options']['raw']===undefined?!![]:![]:!![],'where':_0x33b607[_0x6497('0x13')]?_0x33b607[_0x6497('0x13')][_0x6497('0x15')]||null:null,'attributes':_0x33b607[_0x6497('0x13')]?_0x33b607['options']['attributes']||null:null,'include':_0x33b607[_0x6497('0x13')]?_0x33b607['options'][_0x6497('0x17')]?_[_0x6497('0x18')](_0x33b607[_0x6497('0x13')][_0x6497('0x17')],function(_0x34ac34){return{'model':db[_0x34ac34[_0x6497('0x19')]],'as':_0x34ac34['as'],'attributes':_0x34ac34[_0x6497('0x16')],'include':_0x34ac34['include']?_[_0x6497('0x18')](_0x34ac34[_0x6497('0x17')],function(_0x17064a){return{'model':db[_0x17064a[_0x6497('0x19')]],'as':_0x17064a['as'],'attributes':_0x17064a[_0x6497('0x16')],'include':_0x17064a[_0x6497('0x17')]?_[_0x6497('0x18')](_0x17064a[_0x6497('0x17')],function(_0x1519fe){return{'model':db[_0x1519fe['model']],'as':_0x1519fe['as'],'attributes':_0x1519fe[_0x6497('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6497('0x1b')](function(_0x58d061){logger['info'](_0x6497('0x1a'),_0x33b607);logger['debug'](_0x6497('0x1a'),_0x33b607,JSON[_0x6497('0xa')](_0x58d061));_0x1910a7(_0x58d061);})[_0x6497('0xf')](function(_0x5aca4d){logger[_0x6497('0xb')]('ShowDeskAccount',_0x5aca4d[_0x6497('0xc')],_0x33b607);_0x1ff0e2(_0x3d6ea6[_0x6497('0xb')](0x1f4,_0x5aca4d[_0x6497('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index f98f822..ce59717 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x277e25,_0x49837f){var _0x10d42f=function(_0x1998a9){while(--_0x1998a9){_0x277e25['push'](_0x277e25['shift']());}};_0x10d42f(++_0x49837f);}(_0x008c,0x188));var _0xc008=function(_0x553a80,_0x29f90d){_0x553a80=_0x553a80-0x0;var _0x4e7151=_0x008c[_0x553a80];return _0x4e7151;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x29104e,_0xbbffe0){var _0x17f7f0=function(_0x516b25){while(--_0x516b25){_0x29104e['push'](_0x29104e['shift']());}};_0x17f7f0(++_0xbbffe0);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1b2d61f..13956a9 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 _0xad93=['exports','STRING'];(function(_0x3a122b,_0x253c23){var _0xee10ab=function(_0x564d36){while(--_0x564d36){_0x3a122b['push'](_0x3a122b['shift']());}};_0xee10ab(++_0x253c23);}(_0xad93,0x154));var _0x3ad9=function(_0xc41bd7,_0x2b1e41){_0xc41bd7=_0xc41bd7-0x0;var _0x4a415b=_0xad93[_0xc41bd7];return _0x4a415b;};'use strict';var Sequelize=require('sequelize');module[_0x3ad9('0x0')]={'name':{'type':Sequelize[_0x3ad9('0x1')]},'description':{'type':Sequelize[_0x3ad9('0x1')]}}; \ No newline at end of file +var _0xdfc2=['exports','sequelize'];(function(_0x2546ef,_0x455352){var _0x258835=function(_0x3f7bd2){while(--_0x3f7bd2){_0x2546ef['push'](_0x2546ef['shift']());}};_0x258835(++_0x455352);}(_0xdfc2,0xdb));var _0x2dfc=function(_0x1afa10,_0x51f7c2){_0x1afa10=_0x1afa10-0x0;var _0x542765=_0xdfc2[_0x1afa10];return _0x542765;};'use strict';var Sequelize=require(_0x2dfc('0x0'));module[_0x2dfc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7da895d..278eb62 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 _0xf767=['findAll','show','params','keys','catch','create','body','find','getFields','findOne','DeskField','getSubjects','order','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','DeskConfiguration'];(function(_0x3768f3,_0x4a40f1){var _0x526a13=function(_0x350126){while(--_0x350126){_0x3768f3['push'](_0x3768f3['shift']());}};_0x526a13(++_0x4a40f1);}(_0xf767,0x151));var _0x7f76=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xf767[_0x61b3ab];return _0x57097f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require('request-promise');var moment=require(_0x7f76('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f76('0x4'));var sox=require('sox');var csv=require(_0x7f76('0x5'));var ejs=require(_0x7f76('0x6'));var fs=require('fs');var fs_extra=require(_0x7f76('0x7'));var _=require(_0x7f76('0x8'));var squel=require(_0x7f76('0x9'));var crypto=require('crypto');var jsforce=require(_0x7f76('0xa'));var deskjs=require(_0x7f76('0xb'));var toCsv=require(_0x7f76('0x5'));var querystring=require(_0x7f76('0xc'));var Papa=require(_0x7f76('0xd'));var Redis=require(_0x7f76('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0xf'));var hardwareService=require(_0x7f76('0x10'));var logger=require(_0x7f76('0x11'))(_0x7f76('0x12'));var utils=require(_0x7f76('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7f76('0x14'));var db=require(_0x7f76('0x15'))['db'];function respondWithStatusCode(_0x1b2ef5,_0x41a2ae){_0x41a2ae=_0x41a2ae||0xcc;return function(_0x2d7eb6){if(_0x2d7eb6){return _0x1b2ef5[_0x7f76('0x16')](_0x41a2ae);}return _0x1b2ef5[_0x7f76('0x17')](_0x41a2ae)[_0x7f76('0x18')]();};}function respondWithResult(_0x381d2d,_0x1e4aff){_0x1e4aff=_0x1e4aff||0xc8;return function(_0x1180f8){if(_0x1180f8){return _0x381d2d[_0x7f76('0x17')](_0x1e4aff)[_0x7f76('0x19')](_0x1180f8);}};}function respondWithFilteredResult(_0x404d4b,_0x435f59){return function(_0x136859){if(_0x136859){var _0x119214=typeof _0x435f59[_0x7f76('0x1a')]==='undefined'&&typeof _0x435f59['limit']===_0x7f76('0x1b');var _0x1f9fbf=_0x136859[_0x7f76('0x1c')];var _0x1449ba=_0x119214?0x0:_0x435f59[_0x7f76('0x1a')];var _0x49369a=_0x119214?_0x136859[_0x7f76('0x1c')]:_0x435f59[_0x7f76('0x1a')]+_0x435f59['limit'];var _0x233b24;if(_0x49369a>=_0x1f9fbf){_0x49369a=_0x1f9fbf;_0x233b24=0xc8;}else{_0x233b24=0xce;}_0x404d4b['status'](_0x233b24);return _0x404d4b['set'](_0x7f76('0x1d'),_0x1449ba+'-'+_0x49369a+'/'+_0x1f9fbf)['json'](_0x136859);}return null;};}function patchUpdates(_0x3ab0c9){return function(_0x3fb855){try{jsonpatch[_0x7f76('0x1e')](_0x3fb855,_0x3ab0c9,!![]);}catch(_0x51d794){return BPromise['reject'](_0x51d794);}return _0x3fb855[_0x7f76('0x1f')]();};}function saveUpdates(_0x24146,_0x523a0c){return function(_0x535473){if(_0x535473){return _0x535473[_0x7f76('0x20')](_0x24146)[_0x7f76('0x21')](function(_0xa1ef18){return _0xa1ef18;});}return null;};}function removeEntity(_0x5a19dc,_0x40fc63){return function(_0x347bbe){if(_0x347bbe){return _0x347bbe[_0x7f76('0x22')]()['then'](function(){_0x5a19dc['status'](0xcc)[_0x7f76('0x18')]();});}};}function handleEntityNotFound(_0xa832d6,_0x2940ed){return function(_0x1087d1){if(!_0x1087d1){_0xa832d6[_0x7f76('0x16')](0x194);}return _0x1087d1;};}function handleError(_0x12dc6a,_0x3fe802){_0x3fe802=_0x3fe802||0x1f4;return function(_0x41cfac){logger[_0x7f76('0x23')](_0x41cfac[_0x7f76('0x24')]);if(_0x41cfac[_0x7f76('0x25')]){delete _0x41cfac[_0x7f76('0x25')];}_0x12dc6a[_0x7f76('0x17')](_0x3fe802)[_0x7f76('0x26')](_0x41cfac);};}exports['index']=function(_0x9a452b,_0x35b19c){var _0x2f3361={},_0x7ea57={},_0x440f33={'count':0x0,'rows':[]};var _0x32313b=_[_0x7f76('0x27')](db['DeskConfiguration'][_0x7f76('0x28')],function(_0x503773){return{'name':_0x503773[_0x7f76('0x29')],'type':_0x503773[_0x7f76('0x2a')]['key']};});_0x7ea57['model']=_[_0x7f76('0x27')](_0x32313b,_0x7f76('0x25'));_0x7ea57[_0x7f76('0x2b')]=_['keys'](_0x9a452b[_0x7f76('0x2b')]);_0x7ea57['filters']=_[_0x7f76('0x2c')](_0x7ea57[_0x7f76('0x2d')],_0x7ea57[_0x7f76('0x2b')]);_0x2f3361[_0x7f76('0x2e')]=_[_0x7f76('0x2c')](_0x7ea57['model'],qs[_0x7f76('0x2f')](_0x9a452b[_0x7f76('0x2b')]['fields']));_0x2f3361[_0x7f76('0x2e')]=_0x2f3361[_0x7f76('0x2e')][_0x7f76('0x30')]?_0x2f3361['attributes']:_0x7ea57[_0x7f76('0x2d')];if(!_0x9a452b[_0x7f76('0x2b')][_0x7f76('0x31')](_0x7f76('0x32'))){_0x2f3361['limit']=qs[_0x7f76('0x33')](_0x9a452b['query'][_0x7f76('0x33')]);_0x2f3361[_0x7f76('0x1a')]=qs[_0x7f76('0x1a')](_0x9a452b[_0x7f76('0x2b')][_0x7f76('0x1a')]);}_0x2f3361['order']=qs[_0x7f76('0x34')](_0x9a452b[_0x7f76('0x2b')]['sort']);_0x2f3361[_0x7f76('0x35')]=qs[_0x7f76('0x36')](_[_0x7f76('0x37')](_0x9a452b[_0x7f76('0x2b')],_0x7ea57['filters']),_0x32313b);if(_0x9a452b[_0x7f76('0x2b')][_0x7f76('0x38')]){_0x2f3361[_0x7f76('0x35')]=_['merge'](_0x2f3361[_0x7f76('0x35')],{'$or':_[_0x7f76('0x27')](_0x32313b,function(_0x4ca1b1){if(_0x4ca1b1[_0x7f76('0x2a')]!==_0x7f76('0x39')){var _0x2cc9a1={};_0x2cc9a1[_0x4ca1b1[_0x7f76('0x25')]]={'$like':'%'+_0x9a452b[_0x7f76('0x2b')][_0x7f76('0x38')]+'%'};return _0x2cc9a1;}})});}_0x2f3361=_[_0x7f76('0x3a')]({},_0x2f3361,_0x9a452b[_0x7f76('0x3b')]);var _0x52c22f={'where':_0x2f3361[_0x7f76('0x35')]};return db['DeskConfiguration'][_0x7f76('0x1c')](_0x52c22f)[_0x7f76('0x21')](function(_0x1378e6){_0x440f33[_0x7f76('0x1c')]=_0x1378e6;if(_0x9a452b[_0x7f76('0x2b')][_0x7f76('0x3c')]){_0x2f3361[_0x7f76('0x3d')]=[{'all':!![]}];}return db[_0x7f76('0x3e')][_0x7f76('0x3f')](_0x2f3361);})[_0x7f76('0x21')](function(_0x46b5b5){_0x440f33['rows']=_0x46b5b5;return _0x440f33;})[_0x7f76('0x21')](respondWithFilteredResult(_0x35b19c,_0x2f3361))['catch'](handleError(_0x35b19c,null));};exports[_0x7f76('0x40')]=function(_0x24c33e,_0x41baab){var _0x5f01dc={'raw':![],'where':{'id':_0x24c33e[_0x7f76('0x41')]['id']}},_0x1808fb={};_0x1808fb['model']=_['keys'](db['DeskConfiguration'][_0x7f76('0x28')]);_0x1808fb['query']=_[_0x7f76('0x42')](_0x24c33e['query']);_0x1808fb[_0x7f76('0x36')]=_[_0x7f76('0x2c')](_0x1808fb[_0x7f76('0x2d')],_0x1808fb['query']);_0x5f01dc['attributes']=_['intersection'](_0x1808fb[_0x7f76('0x2d')],qs[_0x7f76('0x2f')](_0x24c33e[_0x7f76('0x2b')][_0x7f76('0x2f')]));_0x5f01dc[_0x7f76('0x2e')]=_0x5f01dc[_0x7f76('0x2e')][_0x7f76('0x30')]?_0x5f01dc[_0x7f76('0x2e')]:_0x1808fb[_0x7f76('0x2d')];if(_0x24c33e[_0x7f76('0x2b')][_0x7f76('0x3c')]){_0x5f01dc[_0x7f76('0x3d')]=[{'all':!![]}];}_0x5f01dc=_[_0x7f76('0x3a')]({},_0x5f01dc,_0x24c33e['options']);return db[_0x7f76('0x3e')]['find'](_0x5f01dc)['then'](handleEntityNotFound(_0x41baab,null))['then'](respondWithResult(_0x41baab,null))[_0x7f76('0x43')](handleError(_0x41baab,null));};exports[_0x7f76('0x44')]=function(_0x885772,_0x4d41a5){return db[_0x7f76('0x3e')][_0x7f76('0x44')](_0x885772[_0x7f76('0x45')],{})[_0x7f76('0x21')](respondWithResult(_0x4d41a5,0xc9))['catch'](handleError(_0x4d41a5,null));};exports[_0x7f76('0x20')]=function(_0xd575d2,_0x34ff2f){if(_0xd575d2[_0x7f76('0x45')]['id']){delete _0xd575d2['body']['id'];}return db['DeskConfiguration'][_0x7f76('0x46')]({'where':{'id':_0xd575d2[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x34ff2f,null))[_0x7f76('0x21')](saveUpdates(_0xd575d2['body'],null))[_0x7f76('0x21')](respondWithResult(_0x34ff2f,null))[_0x7f76('0x43')](handleError(_0x34ff2f,null));};exports['destroy']=function(_0x496d55,_0x1b9b42){return db[_0x7f76('0x3e')][_0x7f76('0x46')]({'where':{'id':_0x496d55[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x1b9b42,null))['then'](removeEntity(_0x1b9b42,null))['catch'](handleError(_0x1b9b42,null));};exports[_0x7f76('0x47')]=function(_0x28060f,_0x366c3a,_0x10f2fc){var _0xad4d60={};var _0x45ff63={};var _0x82189c;var _0x251408;return db[_0x7f76('0x3e')][_0x7f76('0x48')]({'where':{'id':_0x28060f[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x366c3a,null))[_0x7f76('0x21')](function(_0xcbd7f6){if(_0xcbd7f6){_0x82189c=_0xcbd7f6;_0x45ff63[_0x7f76('0x2d')]=_[_0x7f76('0x42')](db[_0x7f76('0x49')][_0x7f76('0x28')]);_0x45ff63[_0x7f76('0x2b')]=_[_0x7f76('0x42')](_0x28060f[_0x7f76('0x2b')]);_0x45ff63['filters']=_[_0x7f76('0x2c')](_0x45ff63[_0x7f76('0x2d')],_0x45ff63[_0x7f76('0x2b')]);_0xad4d60[_0x7f76('0x2e')]=_[_0x7f76('0x2c')](_0x45ff63[_0x7f76('0x2d')],qs['fields'](_0x28060f[_0x7f76('0x2b')][_0x7f76('0x2f')]));_0xad4d60[_0x7f76('0x2e')]=_0xad4d60[_0x7f76('0x2e')][_0x7f76('0x30')]?_0xad4d60['attributes']:_0x45ff63['model'];_0xad4d60['order']=qs[_0x7f76('0x34')](_0x28060f[_0x7f76('0x2b')][_0x7f76('0x34')]);_0xad4d60[_0x7f76('0x35')]=qs['filters'](_[_0x7f76('0x37')](_0x28060f[_0x7f76('0x2b')],_0x45ff63[_0x7f76('0x36')]));if(_0x28060f[_0x7f76('0x2b')][_0x7f76('0x38')]){_0xad4d60[_0x7f76('0x35')]=_['merge'](_0xad4d60[_0x7f76('0x35')],{'$or':_['map'](_0xad4d60['attributes'],function(_0x468cb3){var _0xe9255a={};_0xe9255a[_0x468cb3]={'$like':'%'+_0x28060f[_0x7f76('0x2b')][_0x7f76('0x38')]+'%'};return _0xe9255a;})});}_0xad4d60=_['merge']({},_0xad4d60,_0x28060f[_0x7f76('0x3b')]);return _0x82189c[_0x7f76('0x47')](_0xad4d60);}})[_0x7f76('0x21')](function(_0x43ce14){if(_0x43ce14){_0x251408=_0x43ce14[_0x7f76('0x30')];if(!_0x28060f[_0x7f76('0x2b')][_0x7f76('0x31')](_0x7f76('0x32'))){_0xad4d60[_0x7f76('0x33')]=qs[_0x7f76('0x33')](_0x28060f[_0x7f76('0x2b')][_0x7f76('0x33')]);_0xad4d60[_0x7f76('0x1a')]=qs[_0x7f76('0x1a')](_0x28060f[_0x7f76('0x2b')][_0x7f76('0x1a')]);}return _0x82189c[_0x7f76('0x47')](_0xad4d60);}})[_0x7f76('0x21')](function(_0x16c94f){if(_0x16c94f){return _0x16c94f?{'count':_0x251408,'rows':_0x16c94f}:null;}})[_0x7f76('0x21')](respondWithResult(_0x366c3a,null))['catch'](handleError(_0x366c3a,null));};exports[_0x7f76('0x4a')]=function(_0x574455,_0x46d301,_0x153d6a){var _0x1d3a8a={};var _0x49c111={};var _0x28ebaa;var _0xc99e56;return db[_0x7f76('0x3e')][_0x7f76('0x48')]({'where':{'id':_0x574455[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x46d301,null))[_0x7f76('0x21')](function(_0x51c851){if(_0x51c851){_0x28ebaa=_0x51c851;_0x49c111[_0x7f76('0x2d')]=_[_0x7f76('0x42')](db[_0x7f76('0x49')][_0x7f76('0x28')]);_0x49c111[_0x7f76('0x2b')]=_['keys'](_0x574455[_0x7f76('0x2b')]);_0x49c111[_0x7f76('0x36')]=_[_0x7f76('0x2c')](_0x49c111[_0x7f76('0x2d')],_0x49c111[_0x7f76('0x2b')]);_0x1d3a8a[_0x7f76('0x2e')]=_[_0x7f76('0x2c')](_0x49c111[_0x7f76('0x2d')],qs['fields'](_0x574455[_0x7f76('0x2b')][_0x7f76('0x2f')]));_0x1d3a8a['attributes']=_0x1d3a8a['attributes']['length']?_0x1d3a8a['attributes']:_0x49c111[_0x7f76('0x2d')];_0x1d3a8a[_0x7f76('0x4b')]=qs[_0x7f76('0x34')](_0x574455[_0x7f76('0x2b')][_0x7f76('0x34')]);_0x1d3a8a[_0x7f76('0x35')]=qs[_0x7f76('0x36')](_['pick'](_0x574455[_0x7f76('0x2b')],_0x49c111[_0x7f76('0x36')]));if(_0x574455[_0x7f76('0x2b')][_0x7f76('0x38')]){_0x1d3a8a['where']=_[_0x7f76('0x3a')](_0x1d3a8a[_0x7f76('0x35')],{'$or':_[_0x7f76('0x27')](_0x1d3a8a[_0x7f76('0x2e')],function(_0x4a387f){var _0x1035be={};_0x1035be[_0x4a387f]={'$like':'%'+_0x574455[_0x7f76('0x2b')]['filter']+'%'};return _0x1035be;})});}_0x1d3a8a=_[_0x7f76('0x3a')]({},_0x1d3a8a,_0x574455[_0x7f76('0x3b')]);return _0x28ebaa[_0x7f76('0x4a')](_0x1d3a8a);}})['then'](function(_0x420cd1){if(_0x420cd1){_0xc99e56=_0x420cd1['length'];if(!_0x574455[_0x7f76('0x2b')][_0x7f76('0x31')]('nolimit')){_0x1d3a8a[_0x7f76('0x33')]=qs[_0x7f76('0x33')](_0x574455[_0x7f76('0x2b')]['limit']);_0x1d3a8a[_0x7f76('0x1a')]=qs[_0x7f76('0x1a')](_0x574455[_0x7f76('0x2b')][_0x7f76('0x1a')]);}return _0x28ebaa[_0x7f76('0x4a')](_0x1d3a8a);}})[_0x7f76('0x21')](function(_0x3f2f28){if(_0x3f2f28){return _0x3f2f28?{'count':_0xc99e56,'rows':_0x3f2f28}:null;}})[_0x7f76('0x21')](respondWithResult(_0x46d301,null))[_0x7f76('0x43')](handleError(_0x46d301,null));};exports[_0x7f76('0x4c')]=function(_0x4a08f4,_0x43da41,_0xdf9e84){var _0x95633a={};var _0x3b1ec9={};var _0x1a53e4;var _0x5b97de;return db[_0x7f76('0x3e')][_0x7f76('0x48')]({'where':{'id':_0x4a08f4[_0x7f76('0x41')]['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x43da41,null))['then'](function(_0x227c17){if(_0x227c17){_0x1a53e4=_0x227c17;_0x3b1ec9[_0x7f76('0x2d')]=_[_0x7f76('0x42')](db[_0x7f76('0x49')][_0x7f76('0x28')]);_0x3b1ec9[_0x7f76('0x2b')]=_[_0x7f76('0x42')](_0x4a08f4['query']);_0x3b1ec9['filters']=_[_0x7f76('0x2c')](_0x3b1ec9[_0x7f76('0x2d')],_0x3b1ec9[_0x7f76('0x2b')]);_0x95633a['attributes']=_[_0x7f76('0x2c')](_0x3b1ec9['model'],qs[_0x7f76('0x2f')](_0x4a08f4[_0x7f76('0x2b')]['fields']));_0x95633a[_0x7f76('0x2e')]=_0x95633a[_0x7f76('0x2e')][_0x7f76('0x30')]?_0x95633a[_0x7f76('0x2e')]:_0x3b1ec9[_0x7f76('0x2d')];_0x95633a['order']=qs[_0x7f76('0x34')](_0x4a08f4['query'][_0x7f76('0x34')]);_0x95633a[_0x7f76('0x35')]=qs[_0x7f76('0x36')](_[_0x7f76('0x37')](_0x4a08f4[_0x7f76('0x2b')],_0x3b1ec9['filters']));if(_0x4a08f4[_0x7f76('0x2b')][_0x7f76('0x38')]){_0x95633a[_0x7f76('0x35')]=_['merge'](_0x95633a[_0x7f76('0x35')],{'$or':_[_0x7f76('0x27')](_0x95633a[_0x7f76('0x2e')],function(_0x2bb881){var _0x1901cc={};_0x1901cc[_0x2bb881]={'$like':'%'+_0x4a08f4['query'][_0x7f76('0x38')]+'%'};return _0x1901cc;})});}_0x95633a=_[_0x7f76('0x3a')]({},_0x95633a,_0x4a08f4[_0x7f76('0x3b')]);return _0x1a53e4[_0x7f76('0x4c')](_0x95633a);}})['then'](function(_0x1a9190){if(_0x1a9190){_0x5b97de=_0x1a9190['length'];if(!_0x4a08f4[_0x7f76('0x2b')][_0x7f76('0x31')](_0x7f76('0x32'))){_0x95633a[_0x7f76('0x33')]=qs[_0x7f76('0x33')](_0x4a08f4['query'][_0x7f76('0x33')]);_0x95633a[_0x7f76('0x1a')]=qs['offset'](_0x4a08f4[_0x7f76('0x2b')]['offset']);}return _0x1a53e4[_0x7f76('0x4c')](_0x95633a);}})['then'](function(_0x5573c7){if(_0x5573c7){return _0x5573c7?{'count':_0x5b97de,'rows':_0x5573c7}:null;}})[_0x7f76('0x21')](respondWithResult(_0x43da41,null))['catch'](handleError(_0x43da41,null));};exports[_0x7f76('0x4d')]=function(_0x36c47f,_0x53fada,_0x2d36cb){var _0x1ddacc={};var _0x440a2b={};var _0x39b56c;var _0x22819c;return db[_0x7f76('0x3e')][_0x7f76('0x48')]({'where':{'id':_0x36c47f['params']['id']}})[_0x7f76('0x21')](handleEntityNotFound(_0x53fada,null))['then'](function(_0x556c31){if(_0x556c31){_0x39b56c=_0x556c31;_0x440a2b['model']=_[_0x7f76('0x42')](db[_0x7f76('0x4e')][_0x7f76('0x28')]);_0x440a2b['query']=_[_0x7f76('0x42')](_0x36c47f[_0x7f76('0x2b')]);_0x440a2b[_0x7f76('0x36')]=_['intersection'](_0x440a2b[_0x7f76('0x2d')],_0x440a2b[_0x7f76('0x2b')]);_0x1ddacc[_0x7f76('0x2e')]=_[_0x7f76('0x2c')](_0x440a2b['model'],qs[_0x7f76('0x2f')](_0x36c47f[_0x7f76('0x2b')]['fields']));_0x1ddacc[_0x7f76('0x2e')]=_0x1ddacc[_0x7f76('0x2e')][_0x7f76('0x30')]?_0x1ddacc['attributes']:_0x440a2b[_0x7f76('0x2d')];_0x1ddacc[_0x7f76('0x4b')]=qs['sort'](_0x36c47f['query'][_0x7f76('0x34')]);_0x1ddacc[_0x7f76('0x35')]=qs[_0x7f76('0x36')](_[_0x7f76('0x37')](_0x36c47f['query'],_0x440a2b[_0x7f76('0x36')]));if(_0x36c47f[_0x7f76('0x2b')][_0x7f76('0x38')]){_0x1ddacc[_0x7f76('0x35')]=_[_0x7f76('0x3a')](_0x1ddacc['where'],{'$or':_[_0x7f76('0x27')](_0x1ddacc['attributes'],function(_0x10b211){var _0x4c4645={};_0x4c4645[_0x10b211]={'$like':'%'+_0x36c47f[_0x7f76('0x2b')][_0x7f76('0x38')]+'%'};return _0x4c4645;})});}_0x1ddacc=_[_0x7f76('0x3a')]({},_0x1ddacc,_0x36c47f[_0x7f76('0x3b')]);return _0x39b56c[_0x7f76('0x4d')](_0x1ddacc);}})['then'](function(_0x428c7b){if(_0x428c7b){_0x22819c=_0x428c7b[_0x7f76('0x30')];if(!_0x36c47f[_0x7f76('0x2b')][_0x7f76('0x31')]('nolimit')){_0x1ddacc['limit']=qs['limit'](_0x36c47f[_0x7f76('0x2b')][_0x7f76('0x33')]);_0x1ddacc[_0x7f76('0x1a')]=qs[_0x7f76('0x1a')](_0x36c47f[_0x7f76('0x2b')]['offset']);}return _0x39b56c[_0x7f76('0x4d')](_0x1ddacc);}})[_0x7f76('0x21')](function(_0x4821bf){if(_0x4821bf){return _0x4821bf?{'count':_0x22819c,'rows':_0x4821bf}:null;}})[_0x7f76('0x21')](respondWithResult(_0x53fada,null))['catch'](handleError(_0x53fada,null));};exports[_0x7f76('0x4f')]=function(_0x6b6652,_0x41c066,_0x4a2c06){if(_0x6b6652[_0x7f76('0x45')]['id']){delete _0x6b6652[_0x7f76('0x45')]['id'];}return db[_0x7f76('0x3e')][_0x7f76('0x48')]({'where':{'id':_0x6b6652[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x41c066,null))[_0x7f76('0x21')](function(_0x11fa41){if(_0x11fa41){return _0x11fa41[_0x7f76('0x4f')](_0x6b6652[_0x7f76('0x45')]['ids']||[]);}return null;})[_0x7f76('0x21')](respondWithResult(_0x41c066,null))['catch'](handleError(_0x41c066,null));}; \ No newline at end of file +var _0x021a=['json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','DeskConfiguration','findAll','rows','params','rawAttributes','body','catch','update','find','getFields','findOne','DeskField','pick','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x59f7b8,_0xb2ac21){var _0x7b28c5=function(_0x427d2d){while(--_0x427d2d){_0x59f7b8['push'](_0x59f7b8['shift']());}};_0x7b28c5(++_0xb2ac21);}(_0x021a,0x122));var _0xa021=function(_0x158988,_0x30addd){_0x158988=_0x158988-0x0;var _0x2bd5cd=_0x021a[_0x158988];return _0x2bd5cd;};'use strict';var emlformat=require(_0xa021('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa021('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa021('0x2'));var moment=require(_0xa021('0x3'));var BPromise=require(_0xa021('0x4'));var Mustache=require(_0xa021('0x5'));var util=require(_0xa021('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa021('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa021('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xa021('0x9'));var querystring=require(_0xa021('0xa'));var Papa=require(_0xa021('0xb'));var Redis=require(_0xa021('0xc'));var authService=require(_0xa021('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa021('0xe'));var hardwareService=require(_0xa021('0xf'));var logger=require(_0xa021('0x10'))('api');var utils=require(_0xa021('0x11'));var config=require(_0xa021('0x12'));var licenseUtil=require(_0xa021('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e9f7,_0xedb273){_0xedb273=_0xedb273||0xcc;return function(_0x2d389d){if(_0x2d389d){return _0x29e9f7[_0xa021('0x14')](_0xedb273);}return _0x29e9f7[_0xa021('0x15')](_0xedb273)['end']();};}function respondWithResult(_0x3f4f59,_0x341cfb){_0x341cfb=_0x341cfb||0xc8;return function(_0x1eacce){if(_0x1eacce){return _0x3f4f59[_0xa021('0x15')](_0x341cfb)[_0xa021('0x16')](_0x1eacce);}};}function respondWithFilteredResult(_0x36486e,_0x302938){return function(_0x4c96e5){if(_0x4c96e5){var _0x3c8f54=typeof _0x302938[_0xa021('0x17')]===_0xa021('0x18')&&typeof _0x302938[_0xa021('0x19')]==='undefined';var _0x226bc8=_0x4c96e5[_0xa021('0x1a')];var _0x456551=_0x3c8f54?0x0:_0x302938[_0xa021('0x17')];var _0x31688a=_0x3c8f54?_0x4c96e5[_0xa021('0x1a')]:_0x302938[_0xa021('0x17')]+_0x302938[_0xa021('0x19')];var _0x1917d8;if(_0x31688a>=_0x226bc8){_0x31688a=_0x226bc8;_0x1917d8=0xc8;}else{_0x1917d8=0xce;}_0x36486e[_0xa021('0x15')](_0x1917d8);return _0x36486e[_0xa021('0x1b')](_0xa021('0x1c'),_0x456551+'-'+_0x31688a+'/'+_0x226bc8)[_0xa021('0x16')](_0x4c96e5);}return null;};}function patchUpdates(_0x373844){return function(_0xeaad29){try{jsonpatch[_0xa021('0x1d')](_0xeaad29,_0x373844,!![]);}catch(_0x7f6380){return BPromise['reject'](_0x7f6380);}return _0xeaad29[_0xa021('0x1e')]();};}function saveUpdates(_0x1abadd,_0x528eae){return function(_0x49ca5f){if(_0x49ca5f){return _0x49ca5f['update'](_0x1abadd)[_0xa021('0x1f')](function(_0x11b350){return _0x11b350;});}return null;};}function removeEntity(_0x46f67c,_0x1591ed){return function(_0x51cd41){if(_0x51cd41){return _0x51cd41[_0xa021('0x20')]()[_0xa021('0x1f')](function(){_0x46f67c[_0xa021('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4489e4,_0x322cec){return function(_0x276dc2){if(!_0x276dc2){_0x4489e4[_0xa021('0x14')](0x194);}return _0x276dc2;};}function handleError(_0xe2746f,_0x56627b){_0x56627b=_0x56627b||0x1f4;return function(_0x47ce7e){logger['error'](_0x47ce7e[_0xa021('0x21')]);if(_0x47ce7e[_0xa021('0x22')]){delete _0x47ce7e['name'];}_0xe2746f[_0xa021('0x15')](_0x56627b)[_0xa021('0x23')](_0x47ce7e);};}exports[_0xa021('0x24')]=function(_0x2d29db,_0x5ad594){var _0x4b4cef={},_0x685fd7={},_0x376627={'count':0x0,'rows':[]};var _0x4ad150=_[_0xa021('0x25')](db['DeskConfiguration']['rawAttributes'],function(_0x1885bc){return{'name':_0x1885bc[_0xa021('0x26')],'type':_0x1885bc[_0xa021('0x27')][_0xa021('0x28')]};});_0x685fd7[_0xa021('0x29')]=_['map'](_0x4ad150,_0xa021('0x22'));_0x685fd7[_0xa021('0x2a')]=_[_0xa021('0x2b')](_0x2d29db[_0xa021('0x2a')]);_0x685fd7[_0xa021('0x2c')]=_[_0xa021('0x2d')](_0x685fd7[_0xa021('0x29')],_0x685fd7[_0xa021('0x2a')]);_0x4b4cef[_0xa021('0x2e')]=_[_0xa021('0x2d')](_0x685fd7[_0xa021('0x29')],qs['fields'](_0x2d29db[_0xa021('0x2a')][_0xa021('0x2f')]));_0x4b4cef[_0xa021('0x2e')]=_0x4b4cef['attributes'][_0xa021('0x30')]?_0x4b4cef['attributes']:_0x685fd7[_0xa021('0x29')];if(!_0x2d29db['query'][_0xa021('0x31')]('nolimit')){_0x4b4cef['limit']=qs[_0xa021('0x19')](_0x2d29db['query'][_0xa021('0x19')]);_0x4b4cef['offset']=qs[_0xa021('0x17')](_0x2d29db[_0xa021('0x2a')][_0xa021('0x17')]);}_0x4b4cef[_0xa021('0x32')]=qs[_0xa021('0x33')](_0x2d29db[_0xa021('0x2a')][_0xa021('0x33')]);_0x4b4cef[_0xa021('0x34')]=qs['filters'](_['pick'](_0x2d29db['query'],_0x685fd7[_0xa021('0x2c')]),_0x4ad150);if(_0x2d29db[_0xa021('0x2a')]['filter']){_0x4b4cef[_0xa021('0x34')]=_[_0xa021('0x35')](_0x4b4cef['where'],{'$or':_[_0xa021('0x25')](_0x4ad150,function(_0x1116bd){if(_0x1116bd[_0xa021('0x27')]!==_0xa021('0x36')){var _0x2f1bab={};_0x2f1bab[_0x1116bd[_0xa021('0x22')]]={'$like':'%'+_0x2d29db['query'][_0xa021('0x37')]+'%'};return _0x2f1bab;}})});}_0x4b4cef=_[_0xa021('0x35')]({},_0x4b4cef,_0x2d29db[_0xa021('0x38')]);var _0x28f053={'where':_0x4b4cef['where']};return db['DeskConfiguration'][_0xa021('0x1a')](_0x28f053)[_0xa021('0x1f')](function(_0x428897){_0x376627[_0xa021('0x1a')]=_0x428897;if(_0x2d29db[_0xa021('0x2a')][_0xa021('0x39')]){_0x4b4cef[_0xa021('0x3a')]=[{'all':!![]}];}return db[_0xa021('0x3b')][_0xa021('0x3c')](_0x4b4cef);})[_0xa021('0x1f')](function(_0x5dabef){_0x376627[_0xa021('0x3d')]=_0x5dabef;return _0x376627;})['then'](respondWithFilteredResult(_0x5ad594,_0x4b4cef))['catch'](handleError(_0x5ad594,null));};exports['show']=function(_0x10a7f2,_0x3922c4){var _0x1ff830={'raw':![],'where':{'id':_0x10a7f2[_0xa021('0x3e')]['id']}},_0x357cc2={};_0x357cc2['model']=_[_0xa021('0x2b')](db[_0xa021('0x3b')][_0xa021('0x3f')]);_0x357cc2[_0xa021('0x2a')]=_['keys'](_0x10a7f2['query']);_0x357cc2[_0xa021('0x2c')]=_[_0xa021('0x2d')](_0x357cc2[_0xa021('0x29')],_0x357cc2[_0xa021('0x2a')]);_0x1ff830[_0xa021('0x2e')]=_[_0xa021('0x2d')](_0x357cc2[_0xa021('0x29')],qs[_0xa021('0x2f')](_0x10a7f2['query']['fields']));_0x1ff830[_0xa021('0x2e')]=_0x1ff830[_0xa021('0x2e')]['length']?_0x1ff830[_0xa021('0x2e')]:_0x357cc2[_0xa021('0x29')];if(_0x10a7f2[_0xa021('0x2a')][_0xa021('0x39')]){_0x1ff830['include']=[{'all':!![]}];}_0x1ff830=_[_0xa021('0x35')]({},_0x1ff830,_0x10a7f2['options']);return db[_0xa021('0x3b')]['find'](_0x1ff830)[_0xa021('0x1f')](handleEntityNotFound(_0x3922c4,null))[_0xa021('0x1f')](respondWithResult(_0x3922c4,null))['catch'](handleError(_0x3922c4,null));};exports['create']=function(_0x5ee9d6,_0x8e8487){return db[_0xa021('0x3b')]['create'](_0x5ee9d6[_0xa021('0x40')],{})[_0xa021('0x1f')](respondWithResult(_0x8e8487,0xc9))[_0xa021('0x41')](handleError(_0x8e8487,null));};exports[_0xa021('0x42')]=function(_0x489db6,_0x2c2eb4){if(_0x489db6['body']['id']){delete _0x489db6['body']['id'];}return db[_0xa021('0x3b')]['find']({'where':{'id':_0x489db6[_0xa021('0x3e')]['id']}})[_0xa021('0x1f')](handleEntityNotFound(_0x2c2eb4,null))[_0xa021('0x1f')](saveUpdates(_0x489db6[_0xa021('0x40')],null))[_0xa021('0x1f')](respondWithResult(_0x2c2eb4,null))[_0xa021('0x41')](handleError(_0x2c2eb4,null));};exports['destroy']=function(_0x414abb,_0x580845){return db[_0xa021('0x3b')][_0xa021('0x43')]({'where':{'id':_0x414abb[_0xa021('0x3e')]['id']}})[_0xa021('0x1f')](handleEntityNotFound(_0x580845,null))[_0xa021('0x1f')](removeEntity(_0x580845,null))['catch'](handleError(_0x580845,null));};exports[_0xa021('0x44')]=function(_0x490108,_0x178996,_0x4b2bc6){var _0x208859={};var _0x53eb61={};var _0x4b5b58;var _0x1bd67a;return db[_0xa021('0x3b')][_0xa021('0x45')]({'where':{'id':_0x490108[_0xa021('0x3e')]['id']}})[_0xa021('0x1f')](handleEntityNotFound(_0x178996,null))[_0xa021('0x1f')](function(_0x50a443){if(_0x50a443){_0x4b5b58=_0x50a443;_0x53eb61[_0xa021('0x29')]=_[_0xa021('0x2b')](db[_0xa021('0x46')][_0xa021('0x3f')]);_0x53eb61[_0xa021('0x2a')]=_[_0xa021('0x2b')](_0x490108[_0xa021('0x2a')]);_0x53eb61[_0xa021('0x2c')]=_[_0xa021('0x2d')](_0x53eb61[_0xa021('0x29')],_0x53eb61[_0xa021('0x2a')]);_0x208859['attributes']=_[_0xa021('0x2d')](_0x53eb61['model'],qs['fields'](_0x490108['query'][_0xa021('0x2f')]));_0x208859[_0xa021('0x2e')]=_0x208859[_0xa021('0x2e')][_0xa021('0x30')]?_0x208859['attributes']:_0x53eb61[_0xa021('0x29')];_0x208859['order']=qs[_0xa021('0x33')](_0x490108[_0xa021('0x2a')][_0xa021('0x33')]);_0x208859[_0xa021('0x34')]=qs[_0xa021('0x2c')](_[_0xa021('0x47')](_0x490108[_0xa021('0x2a')],_0x53eb61['filters']));if(_0x490108[_0xa021('0x2a')][_0xa021('0x37')]){_0x208859[_0xa021('0x34')]=_[_0xa021('0x35')](_0x208859[_0xa021('0x34')],{'$or':_[_0xa021('0x25')](_0x208859[_0xa021('0x2e')],function(_0x5a0243){var _0x3b3b17={};_0x3b3b17[_0x5a0243]={'$like':'%'+_0x490108[_0xa021('0x2a')][_0xa021('0x37')]+'%'};return _0x3b3b17;})});}_0x208859=_['merge']({},_0x208859,_0x490108[_0xa021('0x38')]);return _0x4b5b58[_0xa021('0x44')](_0x208859);}})[_0xa021('0x1f')](function(_0x278dd8){if(_0x278dd8){_0x1bd67a=_0x278dd8[_0xa021('0x30')];if(!_0x490108[_0xa021('0x2a')]['hasOwnProperty'](_0xa021('0x48'))){_0x208859[_0xa021('0x19')]=qs[_0xa021('0x19')](_0x490108[_0xa021('0x2a')][_0xa021('0x19')]);_0x208859['offset']=qs[_0xa021('0x17')](_0x490108[_0xa021('0x2a')][_0xa021('0x17')]);}return _0x4b5b58['getFields'](_0x208859);}})[_0xa021('0x1f')](function(_0x2ddac2){if(_0x2ddac2){return _0x2ddac2?{'count':_0x1bd67a,'rows':_0x2ddac2}:null;}})['then'](respondWithResult(_0x178996,null))[_0xa021('0x41')](handleError(_0x178996,null));};exports['getSubjects']=function(_0x10ec33,_0x329f41,_0x4fb633){var _0x1571cb={};var _0x489b4e={};var _0x1a47dd;var _0x2bac86;return db[_0xa021('0x3b')][_0xa021('0x45')]({'where':{'id':_0x10ec33[_0xa021('0x3e')]['id']}})[_0xa021('0x1f')](handleEntityNotFound(_0x329f41,null))[_0xa021('0x1f')](function(_0x4c9685){if(_0x4c9685){_0x1a47dd=_0x4c9685;_0x489b4e[_0xa021('0x29')]=_[_0xa021('0x2b')](db['DeskField']['rawAttributes']);_0x489b4e['query']=_['keys'](_0x10ec33[_0xa021('0x2a')]);_0x489b4e[_0xa021('0x2c')]=_[_0xa021('0x2d')](_0x489b4e['model'],_0x489b4e[_0xa021('0x2a')]);_0x1571cb['attributes']=_[_0xa021('0x2d')](_0x489b4e[_0xa021('0x29')],qs['fields'](_0x10ec33[_0xa021('0x2a')][_0xa021('0x2f')]));_0x1571cb[_0xa021('0x2e')]=_0x1571cb[_0xa021('0x2e')][_0xa021('0x30')]?_0x1571cb[_0xa021('0x2e')]:_0x489b4e['model'];_0x1571cb['order']=qs[_0xa021('0x33')](_0x10ec33['query'][_0xa021('0x33')]);_0x1571cb[_0xa021('0x34')]=qs['filters'](_[_0xa021('0x47')](_0x10ec33[_0xa021('0x2a')],_0x489b4e['filters']));if(_0x10ec33[_0xa021('0x2a')][_0xa021('0x37')]){_0x1571cb[_0xa021('0x34')]=_[_0xa021('0x35')](_0x1571cb[_0xa021('0x34')],{'$or':_[_0xa021('0x25')](_0x1571cb['attributes'],function(_0x5e5a97){var _0x6f6728={};_0x6f6728[_0x5e5a97]={'$like':'%'+_0x10ec33[_0xa021('0x2a')][_0xa021('0x37')]+'%'};return _0x6f6728;})});}_0x1571cb=_[_0xa021('0x35')]({},_0x1571cb,_0x10ec33['options']);return _0x1a47dd[_0xa021('0x49')](_0x1571cb);}})[_0xa021('0x1f')](function(_0x465fbf){if(_0x465fbf){_0x2bac86=_0x465fbf['length'];if(!_0x10ec33['query']['hasOwnProperty'](_0xa021('0x48'))){_0x1571cb[_0xa021('0x19')]=qs[_0xa021('0x19')](_0x10ec33['query']['limit']);_0x1571cb[_0xa021('0x17')]=qs[_0xa021('0x17')](_0x10ec33[_0xa021('0x2a')][_0xa021('0x17')]);}return _0x1a47dd[_0xa021('0x49')](_0x1571cb);}})[_0xa021('0x1f')](function(_0xbd669b){if(_0xbd669b){return _0xbd669b?{'count':_0x2bac86,'rows':_0xbd669b}:null;}})[_0xa021('0x1f')](respondWithResult(_0x329f41,null))[_0xa021('0x41')](handleError(_0x329f41,null));};exports[_0xa021('0x4a')]=function(_0x294100,_0x2031c9,_0x4353c7){var _0x32feb7={};var _0x47a91b={};var _0x4c5a19;var _0x38100b;return db['DeskConfiguration'][_0xa021('0x45')]({'where':{'id':_0x294100['params']['id']}})['then'](handleEntityNotFound(_0x2031c9,null))[_0xa021('0x1f')](function(_0x4954da){if(_0x4954da){_0x4c5a19=_0x4954da;_0x47a91b[_0xa021('0x29')]=_[_0xa021('0x2b')](db[_0xa021('0x46')][_0xa021('0x3f')]);_0x47a91b[_0xa021('0x2a')]=_[_0xa021('0x2b')](_0x294100[_0xa021('0x2a')]);_0x47a91b['filters']=_[_0xa021('0x2d')](_0x47a91b[_0xa021('0x29')],_0x47a91b['query']);_0x32feb7[_0xa021('0x2e')]=_[_0xa021('0x2d')](_0x47a91b[_0xa021('0x29')],qs[_0xa021('0x2f')](_0x294100[_0xa021('0x2a')][_0xa021('0x2f')]));_0x32feb7[_0xa021('0x2e')]=_0x32feb7[_0xa021('0x2e')]['length']?_0x32feb7[_0xa021('0x2e')]:_0x47a91b[_0xa021('0x29')];_0x32feb7[_0xa021('0x32')]=qs[_0xa021('0x33')](_0x294100['query'][_0xa021('0x33')]);_0x32feb7['where']=qs[_0xa021('0x2c')](_[_0xa021('0x47')](_0x294100[_0xa021('0x2a')],_0x47a91b[_0xa021('0x2c')]));if(_0x294100['query'][_0xa021('0x37')]){_0x32feb7[_0xa021('0x34')]=_[_0xa021('0x35')](_0x32feb7[_0xa021('0x34')],{'$or':_[_0xa021('0x25')](_0x32feb7['attributes'],function(_0x42c25d){var _0x3c3ef2={};_0x3c3ef2[_0x42c25d]={'$like':'%'+_0x294100[_0xa021('0x2a')][_0xa021('0x37')]+'%'};return _0x3c3ef2;})});}_0x32feb7=_[_0xa021('0x35')]({},_0x32feb7,_0x294100[_0xa021('0x38')]);return _0x4c5a19[_0xa021('0x4a')](_0x32feb7);}})[_0xa021('0x1f')](function(_0x5d4eb8){if(_0x5d4eb8){_0x38100b=_0x5d4eb8['length'];if(!_0x294100[_0xa021('0x2a')][_0xa021('0x31')](_0xa021('0x48'))){_0x32feb7[_0xa021('0x19')]=qs[_0xa021('0x19')](_0x294100[_0xa021('0x2a')][_0xa021('0x19')]);_0x32feb7[_0xa021('0x17')]=qs['offset'](_0x294100['query']['offset']);}return _0x4c5a19[_0xa021('0x4a')](_0x32feb7);}})[_0xa021('0x1f')](function(_0x542e5a){if(_0x542e5a){return _0x542e5a?{'count':_0x38100b,'rows':_0x542e5a}:null;}})['then'](respondWithResult(_0x2031c9,null))[_0xa021('0x41')](handleError(_0x2031c9,null));};exports[_0xa021('0x4b')]=function(_0x2cc6d3,_0x3c41e1,_0x531d86){var _0x3bea76={};var _0x70a5a8={};var _0xfa3c16;var _0x17e468;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2cc6d3[_0xa021('0x3e')]['id']}})[_0xa021('0x1f')](handleEntityNotFound(_0x3c41e1,null))['then'](function(_0x15d2b2){if(_0x15d2b2){_0xfa3c16=_0x15d2b2;_0x70a5a8[_0xa021('0x29')]=_[_0xa021('0x2b')](db[_0xa021('0x4c')][_0xa021('0x3f')]);_0x70a5a8[_0xa021('0x2a')]=_[_0xa021('0x2b')](_0x2cc6d3[_0xa021('0x2a')]);_0x70a5a8['filters']=_[_0xa021('0x2d')](_0x70a5a8[_0xa021('0x29')],_0x70a5a8['query']);_0x3bea76[_0xa021('0x2e')]=_['intersection'](_0x70a5a8['model'],qs[_0xa021('0x2f')](_0x2cc6d3['query'][_0xa021('0x2f')]));_0x3bea76[_0xa021('0x2e')]=_0x3bea76['attributes'][_0xa021('0x30')]?_0x3bea76['attributes']:_0x70a5a8[_0xa021('0x29')];_0x3bea76[_0xa021('0x32')]=qs[_0xa021('0x33')](_0x2cc6d3[_0xa021('0x2a')]['sort']);_0x3bea76[_0xa021('0x34')]=qs[_0xa021('0x2c')](_[_0xa021('0x47')](_0x2cc6d3[_0xa021('0x2a')],_0x70a5a8[_0xa021('0x2c')]));if(_0x2cc6d3[_0xa021('0x2a')][_0xa021('0x37')]){_0x3bea76[_0xa021('0x34')]=_[_0xa021('0x35')](_0x3bea76[_0xa021('0x34')],{'$or':_['map'](_0x3bea76[_0xa021('0x2e')],function(_0x7b9bc3){var _0xe42012={};_0xe42012[_0x7b9bc3]={'$like':'%'+_0x2cc6d3[_0xa021('0x2a')][_0xa021('0x37')]+'%'};return _0xe42012;})});}_0x3bea76=_[_0xa021('0x35')]({},_0x3bea76,_0x2cc6d3['options']);return _0xfa3c16[_0xa021('0x4b')](_0x3bea76);}})[_0xa021('0x1f')](function(_0x47e989){if(_0x47e989){_0x17e468=_0x47e989['length'];if(!_0x2cc6d3[_0xa021('0x2a')][_0xa021('0x31')](_0xa021('0x48'))){_0x3bea76[_0xa021('0x19')]=qs['limit'](_0x2cc6d3['query'][_0xa021('0x19')]);_0x3bea76[_0xa021('0x17')]=qs[_0xa021('0x17')](_0x2cc6d3[_0xa021('0x2a')][_0xa021('0x17')]);}return _0xfa3c16[_0xa021('0x4b')](_0x3bea76);}})[_0xa021('0x1f')](function(_0x312350){if(_0x312350){return _0x312350?{'count':_0x17e468,'rows':_0x312350}:null;}})[_0xa021('0x1f')](respondWithResult(_0x3c41e1,null))['catch'](handleError(_0x3c41e1,null));};exports['setTags']=function(_0x592331,_0x56d725,_0x150765){if(_0x592331[_0xa021('0x40')]['id']){delete _0x592331[_0xa021('0x40')]['id'];}return db[_0xa021('0x3b')][_0xa021('0x45')]({'where':{'id':_0x592331[_0xa021('0x3e')]['id']}})[_0xa021('0x1f')](handleEntityNotFound(_0x56d725,null))[_0xa021('0x1f')](function(_0x5a58e2){if(_0x5a58e2){return _0x5a58e2[_0xa021('0x4d')](_0x592331[_0xa021('0x40')]['ids']||[]);}return null;})[_0xa021('0x1f')](respondWithResult(_0x56d725,null))[_0xa021('0x41')](handleError(_0x56d725,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 8450248..d5c05cd 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 _0xb9d1=['util','api','moment','bluebird','request-promise','path','../../config/environment','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x16f71e,_0x12bd4c){var _0x348229=function(_0x124b26){while(--_0x124b26){_0x16f71e['push'](_0x16f71e['shift']());}};_0x348229(++_0x12bd4c);}(_0xb9d1,0x117));var _0x1b9d=function(_0xdca38f,_0x12be85){_0xdca38f=_0xdca38f-0x0;var _0x2a48a1=_0xb9d1[_0xdca38f];return _0x2a48a1;};'use strict';var _=require(_0x1b9d('0x0'));var util=require(_0x1b9d('0x1'));var logger=require('../../config/logger')(_0x1b9d('0x2'));var moment=require(_0x1b9d('0x3'));var BPromise=require(_0x1b9d('0x4'));var rp=require(_0x1b9d('0x5'));var fs=require('fs');var path=require(_0x1b9d('0x6'));var rimraf=require('rimraf');var config=require(_0x1b9d('0x7'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x18c799,_0x5c8269){return _0x18c799['define'](_0x1b9d('0x8'),attributes,{'tableName':_0x1b9d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa97c=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0xa97c,0xb6));var _0xca97=function(_0x49a4a2,_0x18612f){_0x49a4a2=_0x49a4a2-0x0;var _0x4caa3c=_0xa97c[_0x49a4a2];return _0x4caa3c;};'use strict';var _=require(_0xca97('0x0'));var util=require(_0xca97('0x1'));var logger=require('../../config/logger')(_0xca97('0x2'));var moment=require(_0xca97('0x3'));var BPromise=require(_0xca97('0x4'));var rp=require(_0xca97('0x5'));var fs=require('fs');var path=require(_0xca97('0x6'));var rimraf=require(_0xca97('0x7'));var config=require('../../config/environment');var attributes=require(_0xca97('0x8'));module[_0xca97('0x9')]=function(_0x4b556c,_0xa61022){return _0x4b556c[_0xca97('0xa')](_0xca97('0xb'),attributes,{'tableName':_0xca97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 4cee098..6019c33 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 _0xd481=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x45fbc5,_0x49c52f){var _0x31d5f9=function(_0xd073ec){while(--_0xd073ec){_0x45fbc5['push'](_0x45fbc5['shift']());}};_0x31d5f9(++_0x49c52f);}(_0xd481,0x1e4));var _0x1d48=function(_0x4fee26,_0x1119dc){_0x4fee26=_0x4fee26-0x0;var _0x4f72d5=_0xd481[_0x4fee26];return _0x4f72d5;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var moment=require(_0x1d48('0x1'));var BPromise=require(_0x1d48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d48('0x3'));var db=require(_0x1d48('0x4'))['db'];var utils=require(_0x1d48('0x5'));var logger=require('../../config/logger')(_0x1d48('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d48('0x7'));var client=jayson[_0x1d48('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472584,_0x3099cc,_0x3b8bd4){return new BPromise(function(_0x27c383,_0x1fc969){return client[_0x1d48('0x9')](_0x472584,_0x3b8bd4)[_0x1d48('0xa')](function(_0x303dce){logger[_0x1d48('0xb')](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));logger[_0x1d48('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3099cc,_0x1d48('0xd'),JSON[_0x1d48('0xf')](_0x303dce));if(_0x303dce[_0x1d48('0x10')]){if(_0x303dce[_0x1d48('0x10')][_0x1d48('0x11')]===0x1f4){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x1fc969(_0x303dce[_0x1d48('0x10')]['message']);}logger[_0x1d48('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x27c383(_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);}else{logger['info'](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));_0x27c383(_0x303dce[_0x1d48('0x13')]['message']);}})[_0x1d48('0x14')](function(_0x433c92){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x433c92);_0x1fc969(_0x433c92);});});} \ No newline at end of file +var _0x96d8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0xd2edc9,_0x3c7a08){var _0x3f58a3=function(_0x12352c){while(--_0x12352c){_0xd2edc9['push'](_0xd2edc9['shift']());}};_0x3f58a3(++_0x3c7a08);}(_0x96d8,0x1e2));var _0x896d=function(_0x34905e,_0x13b1de){_0x34905e=_0x34905e-0x0;var _0x374d4f=_0x96d8[_0x34905e];return _0x374d4f;};'use strict';var _=require(_0x896d('0x0'));var util=require(_0x896d('0x1'));var moment=require(_0x896d('0x2'));var BPromise=require(_0x896d('0x3'));var rs=require(_0x896d('0x4'));var fs=require('fs');var Redis=require(_0x896d('0x5'));var db=require(_0x896d('0x6'))['db'];var utils=require(_0x896d('0x7'));var logger=require(_0x896d('0x8'))(_0x896d('0x9'));var config=require(_0x896d('0xa'));var jayson=require(_0x896d('0xb'));var client=jayson[_0x896d('0xc')][_0x896d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b6c03,_0x1303a1,_0x11f45a){return new BPromise(function(_0x1edc92,_0x280171){return client[_0x896d('0xe')](_0x4b6c03,_0x11f45a)[_0x896d('0xf')](function(_0x8d7161){logger[_0x896d('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x1303a1,_0x896d('0x11'));logger[_0x896d('0x12')](_0x896d('0x13'),_0x1303a1,_0x896d('0x11'),JSON[_0x896d('0x14')](_0x8d7161));if(_0x8d7161['error']){if(_0x8d7161[_0x896d('0x15')][_0x896d('0x16')]===0x1f4){logger[_0x896d('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x1303a1,_0x8d7161['error']['message']);return _0x280171(_0x8d7161[_0x896d('0x15')]['message']);}logger[_0x896d('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x1303a1,_0x8d7161['error'][_0x896d('0x17')]);return _0x1edc92(_0x8d7161[_0x896d('0x15')]['message']);}else{logger[_0x896d('0x10')](_0x896d('0x18'),_0x1303a1,_0x896d('0x11'));_0x1edc92(_0x8d7161[_0x896d('0x19')][_0x896d('0x17')]);}})[_0x896d('0x1a')](function(_0x2adb40){logger[_0x896d('0x15')](_0x896d('0x18'),_0x1303a1,_0x2adb40);_0x280171(_0x2adb40);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 74605d5..5d6fb4b 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 _0x0570=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDeskField.controller','get'];(function(_0x59aa1a,_0x2583c1){var _0x1d1f17=function(_0x241f10){while(--_0x241f10){_0x59aa1a['push'](_0x59aa1a['shift']());}};_0x1d1f17(++_0x2583c1);}(_0x0570,0x172));var _0x0057=function(_0x1018f6,_0x4facc6){_0x1018f6=_0x1018f6-0x0;var _0x4bd261=_0x0570[_0x1018f6];return _0x4bd261;};'use strict';var multer=require('multer');var util=require(_0x0057('0x0'));var path=require(_0x0057('0x1'));var timeout=require(_0x0057('0x2'));var express=require('express');var router=express[_0x0057('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0057('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0057('0x5'));var controller=require(_0x0057('0x6'));router[_0x0057('0x7')]('/',auth[_0x0057('0x8')](),controller[_0x0057('0x9')]);router['get'](_0x0057('0xa'),auth['isAuthenticated'](),controller[_0x0057('0xb')]);router[_0x0057('0xc')]('/',auth[_0x0057('0x8')](),controller[_0x0057('0xd')]);router[_0x0057('0xe')]('/:id',auth[_0x0057('0x8')](),controller[_0x0057('0xf')]);router[_0x0057('0x10')]('/:id',auth[_0x0057('0x8')](),controller[_0x0057('0x11')]);module['exports']=router; \ No newline at end of file +var _0x598a=['isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x598a,0x99));var _0xa598=function(_0x17ca94,_0x5cf543){_0x17ca94=_0x17ca94-0x0;var _0x504dbd=_0x598a[_0x17ca94];return _0x504dbd;};'use strict';var multer=require(_0xa598('0x0'));var util=require('util');var path=require(_0xa598('0x1'));var timeout=require(_0xa598('0x2'));var express=require(_0xa598('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa598('0x4'));var config=require('../../config/environment');var controller=require(_0xa598('0x5'));router[_0xa598('0x6')]('/',auth[_0xa598('0x7')](),controller[_0xa598('0x8')]);router[_0xa598('0x6')](_0xa598('0x9'),auth[_0xa598('0x7')](),controller[_0xa598('0xa')]);router[_0xa598('0xb')]('/',auth[_0xa598('0x7')](),controller['create']);router[_0xa598('0xc')](_0xa598('0x9'),auth[_0xa598('0x7')](),controller[_0xa598('0xd')]);router['delete'](_0xa598('0x9'),auth['isAuthenticated'](),controller[_0xa598('0xe')]);module[_0xa598('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 899188a..6f2bdd9 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 _0x6c70=['variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x511438,_0x46159c){var _0x29ec00=function(_0x111e0e){while(--_0x111e0e){_0x511438['push'](_0x511438['shift']());}};_0x29ec00(++_0x46159c);}(_0x6c70,0x1ab));var _0x06c7=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6c70[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x06c7('0x0'));module[_0x06c7('0x1')]={'type':{'type':Sequelize[_0x06c7('0x2')]('string',_0x06c7('0x3'),_0x06c7('0x4'),_0x06c7('0x5'),_0x06c7('0x6')),'defaultValue':_0x06c7('0x7')},'content':{'type':Sequelize[_0x06c7('0x8')]},'key':{'type':Sequelize[_0x06c7('0x8')]},'keyType':{'type':Sequelize[_0x06c7('0x2')]('string',_0x06c7('0x3'),_0x06c7('0x4'))},'keyContent':{'type':Sequelize[_0x06c7('0x8')]},'idField':{'type':Sequelize[_0x06c7('0x8')]},'nameField':{'type':Sequelize[_0x06c7('0x8')]},'customField':{'type':Sequelize[_0x06c7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x06c7('0x8')]}}; \ No newline at end of file +var _0x448f=['BOOLEAN','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x16bfae,_0x36ed25){var _0x3870f5=function(_0x5ae24a){while(--_0x5ae24a){_0x16bfae['push'](_0x16bfae['shift']());}};_0x3870f5(++_0x36ed25);}(_0x448f,0x78));var _0xf448=function(_0xf501b8,_0x580b04){_0xf501b8=_0xf501b8-0x0;var _0x57a9d3=_0x448f[_0xf501b8];return _0x57a9d3;};'use strict';var Sequelize=require('sequelize');module[_0xf448('0x0')]={'type':{'type':Sequelize[_0xf448('0x1')](_0xf448('0x2'),_0xf448('0x3'),'customVariable',_0xf448('0x4'),'picklist'),'defaultValue':_0xf448('0x2')},'content':{'type':Sequelize[_0xf448('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf448('0x1')](_0xf448('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xf448('0x5')]},'idField':{'type':Sequelize[_0xf448('0x5')]},'nameField':{'type':Sequelize[_0xf448('0x5')]},'customField':{'type':Sequelize[_0xf448('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf448('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 45b62db..efeb87e 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 _0x2c0c=['apply','reject','update','then','destroy','end','stack','name','send','map','DeskField','fieldName','type','key','model','keys','query','intersection','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','catch','params','rawAttributes','fields','length','find','create','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','status','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c0c,0x1cb));var _0xc2c0=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x2c0c[_0xd1c39b];return _0x58f5bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc2c0('0x0'));var zipdir=require(_0xc2c0('0x1'));var jsonpatch=require(_0xc2c0('0x2'));var rp=require(_0xc2c0('0x3'));var moment=require(_0xc2c0('0x4'));var BPromise=require(_0xc2c0('0x5'));var Mustache=require(_0xc2c0('0x6'));var util=require(_0xc2c0('0x7'));var path=require(_0xc2c0('0x8'));var sox=require(_0xc2c0('0x9'));var csv=require(_0xc2c0('0xa'));var ejs=require(_0xc2c0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc2c0('0xc'));var crypto=require('crypto');var jsforce=require(_0xc2c0('0xd'));var deskjs=require(_0xc2c0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc2c0('0xf'));var Redis=require(_0xc2c0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc2c0('0x11'));var as=require(_0xc2c0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2c0('0x13'))(_0xc2c0('0x14'));var utils=require('../../config/utils');var config=require(_0xc2c0('0x15'));var licenseUtil=require(_0xc2c0('0x16'));var db=require(_0xc2c0('0x17'))['db'];function respondWithStatusCode(_0x23229c,_0x399765){_0x399765=_0x399765||0xcc;return function(_0x415cce){if(_0x415cce){return _0x23229c[_0xc2c0('0x18')](_0x399765);}return _0x23229c['status'](_0x399765)['end']();};}function respondWithResult(_0x444761,_0x1fecc0){_0x1fecc0=_0x1fecc0||0xc8;return function(_0x4d012b){if(_0x4d012b){return _0x444761['status'](_0x1fecc0)[_0xc2c0('0x19')](_0x4d012b);}};}function respondWithFilteredResult(_0x2f431,_0x3f9841){return function(_0x2d43fa){if(_0x2d43fa){var _0x462ddd=typeof _0x3f9841['offset']===_0xc2c0('0x1a')&&typeof _0x3f9841[_0xc2c0('0x1b')]===_0xc2c0('0x1a');var _0x1c593c=_0x2d43fa['count'];var _0x21d213=_0x462ddd?0x0:_0x3f9841[_0xc2c0('0x1c')];var _0x3d026c=_0x462ddd?_0x2d43fa['count']:_0x3f9841[_0xc2c0('0x1c')]+_0x3f9841[_0xc2c0('0x1b')];var _0x25a08b;if(_0x3d026c>=_0x1c593c){_0x3d026c=_0x1c593c;_0x25a08b=0xc8;}else{_0x25a08b=0xce;}_0x2f431[_0xc2c0('0x1d')](_0x25a08b);return _0x2f431[_0xc2c0('0x1e')]('Content-Range',_0x21d213+'-'+_0x3d026c+'/'+_0x1c593c)[_0xc2c0('0x19')](_0x2d43fa);}return null;};}function patchUpdates(_0x3a2a5d){return function(_0x13a74b){try{jsonpatch[_0xc2c0('0x1f')](_0x13a74b,_0x3a2a5d,!![]);}catch(_0x367c09){return BPromise[_0xc2c0('0x20')](_0x367c09);}return _0x13a74b['save']();};}function saveUpdates(_0x427cea,_0x52ad27){return function(_0x28aa16){if(_0x28aa16){return _0x28aa16[_0xc2c0('0x21')](_0x427cea)[_0xc2c0('0x22')](function(_0x282cbf){return _0x282cbf;});}return null;};}function removeEntity(_0x640c83,_0x18c2f8){return function(_0x2031c2){if(_0x2031c2){return _0x2031c2[_0xc2c0('0x23')]()[_0xc2c0('0x22')](function(){_0x640c83[_0xc2c0('0x1d')](0xcc)[_0xc2c0('0x24')]();});}};}function handleEntityNotFound(_0x1b4646,_0x1b5325){return function(_0x36526f){if(!_0x36526f){_0x1b4646[_0xc2c0('0x18')](0x194);}return _0x36526f;};}function handleError(_0x3ca563,_0x429a59){_0x429a59=_0x429a59||0x1f4;return function(_0x4800be){logger['error'](_0x4800be[_0xc2c0('0x25')]);if(_0x4800be[_0xc2c0('0x26')]){delete _0x4800be[_0xc2c0('0x26')];}_0x3ca563[_0xc2c0('0x1d')](_0x429a59)[_0xc2c0('0x27')](_0x4800be);};}exports['index']=function(_0x3bc8d7,_0x10b8f7){var _0x58cf55={},_0x4e8201={},_0x25d5b9={'count':0x0,'rows':[]};var _0x367727=_[_0xc2c0('0x28')](db[_0xc2c0('0x29')]['rawAttributes'],function(_0x1a7e8c){return{'name':_0x1a7e8c[_0xc2c0('0x2a')],'type':_0x1a7e8c[_0xc2c0('0x2b')][_0xc2c0('0x2c')]};});_0x4e8201[_0xc2c0('0x2d')]=_[_0xc2c0('0x28')](_0x367727,_0xc2c0('0x26'));_0x4e8201['query']=_[_0xc2c0('0x2e')](_0x3bc8d7[_0xc2c0('0x2f')]);_0x4e8201['filters']=_[_0xc2c0('0x30')](_0x4e8201[_0xc2c0('0x2d')],_0x4e8201['query']);_0x58cf55['attributes']=_[_0xc2c0('0x30')](_0x4e8201['model'],qs['fields'](_0x3bc8d7[_0xc2c0('0x2f')]['fields']));_0x58cf55[_0xc2c0('0x31')]=_0x58cf55[_0xc2c0('0x31')]['length']?_0x58cf55['attributes']:_0x4e8201[_0xc2c0('0x2d')];if(!_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x32')]('nolimit')){_0x58cf55[_0xc2c0('0x1b')]=qs[_0xc2c0('0x1b')](_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x1b')]);_0x58cf55[_0xc2c0('0x1c')]=qs['offset'](_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x1c')]);}_0x58cf55['order']=qs[_0xc2c0('0x33')](_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x33')]);_0x58cf55[_0xc2c0('0x34')]=qs[_0xc2c0('0x35')](_[_0xc2c0('0x36')](_0x3bc8d7[_0xc2c0('0x2f')],_0x4e8201[_0xc2c0('0x35')]),_0x367727);if(_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x37')]){_0x58cf55[_0xc2c0('0x34')]=_['merge'](_0x58cf55[_0xc2c0('0x34')],{'$or':_[_0xc2c0('0x28')](_0x367727,function(_0xff3d9a){if(_0xff3d9a[_0xc2c0('0x2b')]!==_0xc2c0('0x38')){var _0x25322a={};_0x25322a[_0xff3d9a[_0xc2c0('0x26')]]={'$like':'%'+_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x37')]+'%'};return _0x25322a;}})});}_0x58cf55=_[_0xc2c0('0x39')]({},_0x58cf55,_0x3bc8d7[_0xc2c0('0x3a')]);var _0x3cf005={'where':_0x58cf55[_0xc2c0('0x34')]};return db['DeskField'][_0xc2c0('0x3b')](_0x3cf005)[_0xc2c0('0x22')](function(_0x50d391){_0x25d5b9[_0xc2c0('0x3b')]=_0x50d391;if(_0x3bc8d7[_0xc2c0('0x2f')][_0xc2c0('0x3c')]){_0x58cf55[_0xc2c0('0x3d')]=[{'all':!![]}];}return db[_0xc2c0('0x29')]['findAll'](_0x58cf55);})[_0xc2c0('0x22')](function(_0x59a349){_0x25d5b9[_0xc2c0('0x3e')]=_0x59a349;return _0x25d5b9;})['then'](respondWithFilteredResult(_0x10b8f7,_0x58cf55))[_0xc2c0('0x3f')](handleError(_0x10b8f7,null));};exports['show']=function(_0x263c60,_0x190a72){var _0x2a7a9d={'raw':!![],'where':{'id':_0x263c60[_0xc2c0('0x40')]['id']}},_0x3d6d9b={};_0x3d6d9b[_0xc2c0('0x2d')]=_['keys'](db[_0xc2c0('0x29')][_0xc2c0('0x41')]);_0x3d6d9b[_0xc2c0('0x2f')]=_['keys'](_0x263c60[_0xc2c0('0x2f')]);_0x3d6d9b[_0xc2c0('0x35')]=_[_0xc2c0('0x30')](_0x3d6d9b[_0xc2c0('0x2d')],_0x3d6d9b[_0xc2c0('0x2f')]);_0x2a7a9d[_0xc2c0('0x31')]=_[_0xc2c0('0x30')](_0x3d6d9b[_0xc2c0('0x2d')],qs[_0xc2c0('0x42')](_0x263c60['query'][_0xc2c0('0x42')]));_0x2a7a9d[_0xc2c0('0x31')]=_0x2a7a9d[_0xc2c0('0x31')][_0xc2c0('0x43')]?_0x2a7a9d[_0xc2c0('0x31')]:_0x3d6d9b[_0xc2c0('0x2d')];if(_0x263c60[_0xc2c0('0x2f')]['includeAll']){_0x2a7a9d['include']=[{'all':!![]}];}_0x2a7a9d=_[_0xc2c0('0x39')]({},_0x2a7a9d,_0x263c60[_0xc2c0('0x3a')]);return db[_0xc2c0('0x29')][_0xc2c0('0x44')](_0x2a7a9d)[_0xc2c0('0x22')](handleEntityNotFound(_0x190a72,null))['then'](respondWithResult(_0x190a72,null))['catch'](handleError(_0x190a72,null));};exports[_0xc2c0('0x45')]=function(_0x3f4e60,_0x48b4ef){return db[_0xc2c0('0x29')][_0xc2c0('0x45')](_0x3f4e60['body'],{})[_0xc2c0('0x22')](respondWithResult(_0x48b4ef,0xc9))[_0xc2c0('0x3f')](handleError(_0x48b4ef,null));};exports[_0xc2c0('0x21')]=function(_0x1de169,_0x52a065){if(_0x1de169['body']['id']){delete _0x1de169['body']['id'];}return db[_0xc2c0('0x29')][_0xc2c0('0x44')]({'where':{'id':_0x1de169[_0xc2c0('0x40')]['id']}})[_0xc2c0('0x22')](handleEntityNotFound(_0x52a065,null))[_0xc2c0('0x22')](saveUpdates(_0x1de169['body'],null))[_0xc2c0('0x22')](respondWithResult(_0x52a065,null))['catch'](handleError(_0x52a065,null));};exports[_0xc2c0('0x23')]=function(_0x1dd23b,_0x3a3c62){return db[_0xc2c0('0x29')][_0xc2c0('0x44')]({'where':{'id':_0x1dd23b[_0xc2c0('0x40')]['id']}})[_0xc2c0('0x22')](handleEntityNotFound(_0x3a3c62,null))[_0xc2c0('0x22')](removeEntity(_0x3a3c62,null))[_0xc2c0('0x3f')](handleError(_0x3a3c62,null));}; \ No newline at end of file +var _0xf966=['merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','DeskField','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','offset','order','sort','filter','where'];(function(_0x36394c,_0x261dff){var _0x785531=function(_0x191da5){while(--_0x191da5){_0x36394c['push'](_0x36394c['shift']());}};_0x785531(++_0x261dff);}(_0xf966,0x184));var _0x6f96=function(_0x35d801,_0x17ebbc){_0x35d801=_0x35d801-0x0;var _0x538553=_0xf966[_0x35d801];return _0x538553;};'use strict';var emlformat=require(_0x6f96('0x0'));var rimraf=require(_0x6f96('0x1'));var zipdir=require(_0x6f96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f96('0x3'));var moment=require(_0x6f96('0x4'));var BPromise=require(_0x6f96('0x5'));var Mustache=require('mustache');var util=require(_0x6f96('0x6'));var path=require(_0x6f96('0x7'));var sox=require(_0x6f96('0x8'));var csv=require('to-csv');var ejs=require(_0x6f96('0x9'));var fs=require('fs');var fs_extra=require(_0x6f96('0xa'));var _=require(_0x6f96('0xb'));var squel=require(_0x6f96('0xc'));var crypto=require(_0x6f96('0xd'));var jsforce=require(_0x6f96('0xe'));var deskjs=require(_0x6f96('0xf'));var toCsv=require(_0x6f96('0x10'));var querystring=require(_0x6f96('0x11'));var Papa=require(_0x6f96('0x12'));var Redis=require(_0x6f96('0x13'));var authService=require(_0x6f96('0x14'));var qs=require(_0x6f96('0x15'));var as=require(_0x6f96('0x16'));var hardwareService=require(_0x6f96('0x17'));var logger=require('../../config/logger')(_0x6f96('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6f96('0x19'));var db=require(_0x6f96('0x1a'))['db'];function respondWithStatusCode(_0x58cc34,_0x30f125){_0x30f125=_0x30f125||0xcc;return function(_0x126b6a){if(_0x126b6a){return _0x58cc34[_0x6f96('0x1b')](_0x30f125);}return _0x58cc34[_0x6f96('0x1c')](_0x30f125)[_0x6f96('0x1d')]();};}function respondWithResult(_0x3f8950,_0x169c55){_0x169c55=_0x169c55||0xc8;return function(_0x1e2467){if(_0x1e2467){return _0x3f8950['status'](_0x169c55)[_0x6f96('0x1e')](_0x1e2467);}};}function respondWithFilteredResult(_0xb1ff4,_0x5a5602){return function(_0x203054){if(_0x203054){var _0x2cd321=typeof _0x5a5602['offset']==='undefined'&&typeof _0x5a5602[_0x6f96('0x1f')]===_0x6f96('0x20');var _0x130de4=_0x203054['count'];var _0x421e59=_0x2cd321?0x0:_0x5a5602['offset'];var _0x19cd18=_0x2cd321?_0x203054[_0x6f96('0x21')]:_0x5a5602['offset']+_0x5a5602['limit'];var _0x75c2db;if(_0x19cd18>=_0x130de4){_0x19cd18=_0x130de4;_0x75c2db=0xc8;}else{_0x75c2db=0xce;}_0xb1ff4[_0x6f96('0x1c')](_0x75c2db);return _0xb1ff4['set'](_0x6f96('0x22'),_0x421e59+'-'+_0x19cd18+'/'+_0x130de4)['json'](_0x203054);}return null;};}function patchUpdates(_0x3e3f51){return function(_0x16d62a){try{jsonpatch[_0x6f96('0x23')](_0x16d62a,_0x3e3f51,!![]);}catch(_0x2515ca){return BPromise[_0x6f96('0x24')](_0x2515ca);}return _0x16d62a['save']();};}function saveUpdates(_0x1d8dc7,_0x5ec160){return function(_0x46d79b){if(_0x46d79b){return _0x46d79b[_0x6f96('0x25')](_0x1d8dc7)['then'](function(_0xa12c3b){return _0xa12c3b;});}return null;};}function removeEntity(_0x5482c8,_0x280a55){return function(_0x45c1c2){if(_0x45c1c2){return _0x45c1c2[_0x6f96('0x26')]()[_0x6f96('0x27')](function(){_0x5482c8[_0x6f96('0x1c')](0xcc)[_0x6f96('0x1d')]();});}};}function handleEntityNotFound(_0x475ee9,_0xc91322){return function(_0x3a5f09){if(!_0x3a5f09){_0x475ee9['sendStatus'](0x194);}return _0x3a5f09;};}function handleError(_0x3329a2,_0xe3cf23){_0xe3cf23=_0xe3cf23||0x1f4;return function(_0x38922d){logger[_0x6f96('0x28')](_0x38922d[_0x6f96('0x29')]);if(_0x38922d[_0x6f96('0x2a')]){delete _0x38922d['name'];}_0x3329a2['status'](_0xe3cf23)['send'](_0x38922d);};}exports[_0x6f96('0x2b')]=function(_0x105796,_0x37b404){var _0x4821a8={},_0x19941b={},_0x29c45e={'count':0x0,'rows':[]};var _0x36f0ae=_[_0x6f96('0x2c')](db[_0x6f96('0x2d')]['rawAttributes'],function(_0x38dbba){return{'name':_0x38dbba[_0x6f96('0x2e')],'type':_0x38dbba['type'][_0x6f96('0x2f')]};});_0x19941b[_0x6f96('0x30')]=_[_0x6f96('0x2c')](_0x36f0ae,_0x6f96('0x2a'));_0x19941b[_0x6f96('0x31')]=_[_0x6f96('0x32')](_0x105796[_0x6f96('0x31')]);_0x19941b[_0x6f96('0x33')]=_['intersection'](_0x19941b[_0x6f96('0x30')],_0x19941b[_0x6f96('0x31')]);_0x4821a8[_0x6f96('0x34')]=_[_0x6f96('0x35')](_0x19941b[_0x6f96('0x30')],qs[_0x6f96('0x36')](_0x105796['query'][_0x6f96('0x36')]));_0x4821a8[_0x6f96('0x34')]=_0x4821a8[_0x6f96('0x34')][_0x6f96('0x37')]?_0x4821a8[_0x6f96('0x34')]:_0x19941b[_0x6f96('0x30')];if(!_0x105796['query'][_0x6f96('0x38')]('nolimit')){_0x4821a8[_0x6f96('0x1f')]=qs[_0x6f96('0x1f')](_0x105796['query'][_0x6f96('0x1f')]);_0x4821a8['offset']=qs[_0x6f96('0x39')](_0x105796[_0x6f96('0x31')][_0x6f96('0x39')]);}_0x4821a8[_0x6f96('0x3a')]=qs[_0x6f96('0x3b')](_0x105796[_0x6f96('0x31')]['sort']);_0x4821a8['where']=qs[_0x6f96('0x33')](_['pick'](_0x105796[_0x6f96('0x31')],_0x19941b['filters']),_0x36f0ae);if(_0x105796[_0x6f96('0x31')][_0x6f96('0x3c')]){_0x4821a8[_0x6f96('0x3d')]=_[_0x6f96('0x3e')](_0x4821a8[_0x6f96('0x3d')],{'$or':_[_0x6f96('0x2c')](_0x36f0ae,function(_0x57dd3f){if(_0x57dd3f[_0x6f96('0x3f')]!==_0x6f96('0x40')){var _0x9be8f5={};_0x9be8f5[_0x57dd3f[_0x6f96('0x2a')]]={'$like':'%'+_0x105796['query'][_0x6f96('0x3c')]+'%'};return _0x9be8f5;}})});}_0x4821a8=_[_0x6f96('0x3e')]({},_0x4821a8,_0x105796[_0x6f96('0x41')]);var _0x2fa5a1={'where':_0x4821a8[_0x6f96('0x3d')]};return db[_0x6f96('0x2d')][_0x6f96('0x21')](_0x2fa5a1)[_0x6f96('0x27')](function(_0x3cb013){_0x29c45e[_0x6f96('0x21')]=_0x3cb013;if(_0x105796[_0x6f96('0x31')][_0x6f96('0x42')]){_0x4821a8[_0x6f96('0x43')]=[{'all':!![]}];}return db[_0x6f96('0x2d')][_0x6f96('0x44')](_0x4821a8);})['then'](function(_0x140475){_0x29c45e['rows']=_0x140475;return _0x29c45e;})['then'](respondWithFilteredResult(_0x37b404,_0x4821a8))[_0x6f96('0x45')](handleError(_0x37b404,null));};exports[_0x6f96('0x46')]=function(_0xa2157d,_0x1d6023){var _0xa42324={'raw':!![],'where':{'id':_0xa2157d[_0x6f96('0x47')]['id']}},_0x4e8488={};_0x4e8488[_0x6f96('0x30')]=_[_0x6f96('0x32')](db[_0x6f96('0x2d')]['rawAttributes']);_0x4e8488[_0x6f96('0x31')]=_[_0x6f96('0x32')](_0xa2157d[_0x6f96('0x31')]);_0x4e8488[_0x6f96('0x33')]=_['intersection'](_0x4e8488[_0x6f96('0x30')],_0x4e8488[_0x6f96('0x31')]);_0xa42324[_0x6f96('0x34')]=_[_0x6f96('0x35')](_0x4e8488[_0x6f96('0x30')],qs[_0x6f96('0x36')](_0xa2157d[_0x6f96('0x31')][_0x6f96('0x36')]));_0xa42324['attributes']=_0xa42324['attributes'][_0x6f96('0x37')]?_0xa42324[_0x6f96('0x34')]:_0x4e8488[_0x6f96('0x30')];if(_0xa2157d[_0x6f96('0x31')][_0x6f96('0x42')]){_0xa42324['include']=[{'all':!![]}];}_0xa42324=_[_0x6f96('0x3e')]({},_0xa42324,_0xa2157d[_0x6f96('0x41')]);return db[_0x6f96('0x2d')][_0x6f96('0x48')](_0xa42324)[_0x6f96('0x27')](handleEntityNotFound(_0x1d6023,null))[_0x6f96('0x27')](respondWithResult(_0x1d6023,null))[_0x6f96('0x45')](handleError(_0x1d6023,null));};exports[_0x6f96('0x49')]=function(_0x12d2f1,_0x3d6cce){return db[_0x6f96('0x2d')][_0x6f96('0x49')](_0x12d2f1[_0x6f96('0x4a')],{})[_0x6f96('0x27')](respondWithResult(_0x3d6cce,0xc9))[_0x6f96('0x45')](handleError(_0x3d6cce,null));};exports[_0x6f96('0x25')]=function(_0x9e28e0,_0x11ecd7){if(_0x9e28e0['body']['id']){delete _0x9e28e0[_0x6f96('0x4a')]['id'];}return db[_0x6f96('0x2d')]['find']({'where':{'id':_0x9e28e0[_0x6f96('0x47')]['id']}})[_0x6f96('0x27')](handleEntityNotFound(_0x11ecd7,null))[_0x6f96('0x27')](saveUpdates(_0x9e28e0['body'],null))[_0x6f96('0x27')](respondWithResult(_0x11ecd7,null))[_0x6f96('0x45')](handleError(_0x11ecd7,null));};exports['destroy']=function(_0x37558e,_0x4b3263){return db['DeskField'][_0x6f96('0x48')]({'where':{'id':_0x37558e[_0x6f96('0x47')]['id']}})[_0x6f96('0x27')](handleEntityNotFound(_0x4b3263,null))[_0x6f96('0x27')](removeEntity(_0x4b3263,null))[_0x6f96('0x45')](handleError(_0x4b3263,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 3bf5061..1e3ddd5 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 _0xe7d7=['util','api','moment','bluebird','request-promise','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','lodash'];(function(_0x15586b,_0x171534){var _0x4d07b1=function(_0x1d3a50){while(--_0x1d3a50){_0x15586b['push'](_0x15586b['shift']());}};_0x4d07b1(++_0x171534);}(_0xe7d7,0x1ac));var _0x7e7d=function(_0xb1162e,_0x537af1){_0xb1162e=_0xb1162e-0x0;var _0x3432d1=_0xe7d7[_0xb1162e];return _0x3432d1;};'use strict';var _=require(_0x7e7d('0x0'));var util=require(_0x7e7d('0x1'));var logger=require('../../config/logger')(_0x7e7d('0x2'));var moment=require(_0x7e7d('0x3'));var BPromise=require(_0x7e7d('0x4'));var rp=require(_0x7e7d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7e7d('0x6'));module[_0x7e7d('0x7')]=function(_0x9602b0,_0x511db2){return _0x9602b0[_0x7e7d('0x8')]('DeskField',attributes,{'tableName':_0x7e7d('0x9'),'paranoid':![],'indexes':[{'name':_0x7e7d('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9ac=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','int_desk_fields','desk_unique_index','idField','FieldId','../../config/logger','api','moment'];(function(_0x424b7a,_0x21885e){var _0x20e968=function(_0x23f5fb){while(--_0x23f5fb){_0x424b7a['push'](_0x424b7a['shift']());}};_0x20e968(++_0x21885e);}(_0xb9ac,0x97));var _0xcb9a=function(_0x53d519,_0x181680){_0x53d519=_0x53d519-0x0;var _0x5085a3=_0xb9ac[_0x53d519];return _0x5085a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcb9a('0x0'))(_0xcb9a('0x1'));var moment=require(_0xcb9a('0x2'));var BPromise=require(_0xcb9a('0x3'));var rp=require(_0xcb9a('0x4'));var fs=require('fs');var path=require(_0xcb9a('0x5'));var rimraf=require(_0xcb9a('0x6'));var config=require(_0xcb9a('0x7'));var attributes=require(_0xcb9a('0x8'));module[_0xcb9a('0x9')]=function(_0xe7a6b6,_0x3730eb){return _0xe7a6b6['define']('DeskField',attributes,{'tableName':_0xcb9a('0xa'),'paranoid':![],'indexes':[{'name':_0xcb9a('0xb'),'fields':[_0xcb9a('0xc'),_0xcb9a('0xd')],'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 b5a2ca5..2866ead 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 _0x6fc8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring'];(function(_0x1c9d76,_0x4369ab){var _0x432bd7=function(_0x5703ae){while(--_0x5703ae){_0x1c9d76['push'](_0x1c9d76['shift']());}};_0x432bd7(++_0x4369ab);}(_0x6fc8,0xcf));var _0x86fc=function(_0x2c8f4d,_0x1bfe02){_0x2c8f4d=_0x2c8f4d-0x0;var _0x4400d1=_0x6fc8[_0x2c8f4d];return _0x4400d1;};'use strict';var _=require(_0x86fc('0x0'));var util=require(_0x86fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x86fc('0x2'));var fs=require('fs');var Redis=require(_0x86fc('0x3'));var db=require(_0x86fc('0x4'))['db'];var utils=require(_0x86fc('0x5'));var logger=require(_0x86fc('0x6'))(_0x86fc('0x7'));var config=require(_0x86fc('0x8'));var jayson=require(_0x86fc('0x9'));var client=jayson['client'][_0x86fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc6ca69,_0x4f10d1,_0x526dba){return new BPromise(function(_0x1eaf63,_0x57f79e){return client[_0x86fc('0xb')](_0xc6ca69,_0x526dba)[_0x86fc('0xc')](function(_0x4a6d00){logger['info'](_0x86fc('0xd'),_0x4f10d1,_0x86fc('0xe'));logger[_0x86fc('0xf')](_0x86fc('0x10'),_0x4f10d1,_0x86fc('0xe'),JSON['stringify'](_0x4a6d00));if(_0x4a6d00[_0x86fc('0x11')]){if(_0x4a6d00[_0x86fc('0x11')][_0x86fc('0x12')]===0x1f4){logger['error'](_0x86fc('0xd'),_0x4f10d1,_0x4a6d00[_0x86fc('0x11')][_0x86fc('0x13')]);return _0x57f79e(_0x4a6d00[_0x86fc('0x11')][_0x86fc('0x13')]);}logger[_0x86fc('0x11')](_0x86fc('0xd'),_0x4f10d1,_0x4a6d00[_0x86fc('0x11')]['message']);return _0x1eaf63(_0x4a6d00[_0x86fc('0x11')]['message']);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x4f10d1,_0x86fc('0xe'));_0x1eaf63(_0x4a6d00['result']['message']);}})[_0x86fc('0x14')](function(_0x4ebc59){logger[_0x86fc('0x11')](_0x86fc('0xd'),_0x4f10d1,_0x4ebc59);_0x57f79e(_0x4ebc59);});});} \ No newline at end of file +var _0x93ce=['rpc','../../config/environment','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x85c1f9,_0x50f544){var _0x66261d=function(_0x292f6e){while(--_0x292f6e){_0x85c1f9['push'](_0x85c1f9['shift']());}};_0x66261d(++_0x50f544);}(_0x93ce,0x1c7));var _0xe93c=function(_0x4cc1d9,_0x2a0a9b){_0x4cc1d9=_0x4cc1d9-0x0;var _0x198f55=_0x93ce[_0x4cc1d9];return _0x198f55;};'use strict';var _=require('lodash');var util=require(_0xe93c('0x0'));var moment=require(_0xe93c('0x1'));var BPromise=require(_0xe93c('0x2'));var rs=require(_0xe93c('0x3'));var fs=require('fs');var Redis=require(_0xe93c('0x4'));var db=require(_0xe93c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe93c('0x6'))(_0xe93c('0x7'));var config=require(_0xe93c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe93c('0x9')][_0xe93c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11468d,_0x34988c,_0x3c7c1f){return new BPromise(function(_0x233bd0,_0x394388){return client[_0xe93c('0xb')](_0x11468d,_0x3c7c1f)[_0xe93c('0xc')](function(_0x25bb3c){logger['info'](_0xe93c('0xd'),_0x34988c,_0xe93c('0xe'));logger[_0xe93c('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x34988c,_0xe93c('0xe'),JSON[_0xe93c('0x10')](_0x25bb3c));if(_0x25bb3c[_0xe93c('0x11')]){if(_0x25bb3c[_0xe93c('0x11')]['code']===0x1f4){logger[_0xe93c('0x11')]('DeskField,\x20%s,\x20%s',_0x34988c,_0x25bb3c[_0xe93c('0x11')][_0xe93c('0x12')]);return _0x394388(_0x25bb3c[_0xe93c('0x11')][_0xe93c('0x12')]);}logger[_0xe93c('0x11')]('DeskField,\x20%s,\x20%s',_0x34988c,_0x25bb3c[_0xe93c('0x11')][_0xe93c('0x12')]);return _0x233bd0(_0x25bb3c[_0xe93c('0x11')][_0xe93c('0x12')]);}else{logger[_0xe93c('0x13')](_0xe93c('0xd'),_0x34988c,_0xe93c('0xe'));_0x233bd0(_0x25bb3c[_0xe93c('0x14')][_0xe93c('0x12')]);}})['catch'](function(_0x1324d0){logger[_0xe93c('0x11')](_0xe93c('0xd'),_0x34988c,_0x1324d0);_0x394388(_0x1324d0);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e1d9528..151fcc3 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 _0xbb67=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x54cd98,_0x3029e6){var _0x4abd09=function(_0x10e689){while(--_0x10e689){_0x54cd98['push'](_0x54cd98['shift']());}};_0x4abd09(++_0x3029e6);}(_0xbb67,0xd2));var _0x7bb6=function(_0x40da96,_0xbdc711){_0x40da96=_0x40da96-0x0;var _0x2f9267=_0xbb67[_0x40da96];return _0x2f9267;};'use strict';var multer=require(_0x7bb6('0x0'));var util=require(_0x7bb6('0x1'));var path=require(_0x7bb6('0x2'));var timeout=require(_0x7bb6('0x3'));var express=require('express');var router=express[_0x7bb6('0x4')]();var fs_extra=require(_0x7bb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7bb6('0x6'));var config=require(_0x7bb6('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x7bb6('0x8')]('/',auth[_0x7bb6('0x9')](),controller['index']);router[_0x7bb6('0x8')](_0x7bb6('0xa'),auth[_0x7bb6('0x9')](),controller[_0x7bb6('0xb')]);router[_0x7bb6('0x8')](_0x7bb6('0xc'),auth[_0x7bb6('0x9')](),controller[_0x7bb6('0xd')]);router['get'](_0x7bb6('0xe'),auth[_0x7bb6('0x9')](),controller[_0x7bb6('0xf')]);router[_0x7bb6('0x10')]('/',auth[_0x7bb6('0x9')](),controller[_0x7bb6('0x11')]);router[_0x7bb6('0x10')]('/:id/configurations',auth[_0x7bb6('0x9')](),controller[_0x7bb6('0x12')]);router[_0x7bb6('0x13')]('/:id',auth[_0x7bb6('0x9')](),controller[_0x7bb6('0x14')]);router['delete'](_0x7bb6('0xa'),auth['isAuthenticated'](),controller[_0x7bb6('0x15')]);module[_0x7bb6('0x16')]=router; \ No newline at end of file +var _0xb093=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xb093,0x19b));var _0x3b09=function(_0x5ec6e3,_0x14c572){_0x5ec6e3=_0x5ec6e3-0x0;var _0x2ccac2=_0xb093[_0x5ec6e3];return _0x2ccac2;};'use strict';var multer=require(_0x3b09('0x0'));var util=require('util');var path=require(_0x3b09('0x1'));var timeout=require(_0x3b09('0x2'));var express=require(_0x3b09('0x3'));var router=express[_0x3b09('0x4')]();var fs_extra=require(_0x3b09('0x5'));var auth=require(_0x3b09('0x6'));var interaction=require(_0x3b09('0x7'));var config=require(_0x3b09('0x8'));var controller=require(_0x3b09('0x9'));router[_0x3b09('0xa')]('/',auth[_0x3b09('0xb')](),controller['index']);router[_0x3b09('0xa')](_0x3b09('0xc'),auth[_0x3b09('0xb')](),controller[_0x3b09('0xd')]);router[_0x3b09('0xa')](_0x3b09('0xe'),auth[_0x3b09('0xb')](),controller[_0x3b09('0xf')]);router[_0x3b09('0xa')](_0x3b09('0x10'),auth[_0x3b09('0xb')](),controller[_0x3b09('0x11')]);router['post']('/',auth[_0x3b09('0xb')](),controller['create']);router[_0x3b09('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3b09('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3b09('0x14')]);router[_0x3b09('0x15')](_0x3b09('0xc'),auth[_0x3b09('0xb')](),controller[_0x3b09('0x16')]);module[_0x3b09('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 10c7f89..e6b2eee 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 _0xdded=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4899a5,_0x533137){var _0x14c282=function(_0x22733f){while(--_0x22733f){_0x4899a5['push'](_0x4899a5['shift']());}};_0x14c282(++_0x533137);}(_0xdded,0x17a));var _0xddde=function(_0x260352,_0x9af1cf){_0x260352=_0x260352-0x0;var _0x4c4228=_0xdded[_0x260352];return _0x4c4228;};'use strict';var Sequelize=require(_0xddde('0x0'));module[_0xddde('0x1')]={'name':{'type':Sequelize[_0xddde('0x2')]},'username':{'type':Sequelize[_0xddde('0x2')]},'password':{'type':Sequelize[_0xddde('0x2')]},'remoteUri':{'type':Sequelize[_0xddde('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xddde('0x2')]},'clientSecret':{'type':Sequelize[_0xddde('0x2')]},'serverUrl':{'type':Sequelize[_0xddde('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xddde('0x2')]},'modernAuthentication':{'type':Sequelize[_0xddde('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3edc=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3341af,_0x1e9ace){var _0x5b7003=function(_0x4e2b10){while(--_0x4e2b10){_0x3341af['push'](_0x3341af['shift']());}};_0x5b7003(++_0x1e9ace);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x486eea,_0x2f72ef){_0x486eea=_0x486eea-0x0;var _0x58b148=_0x3edc[_0x486eea];return _0x58b148;};'use strict';var Sequelize=require(_0xc3ed('0x0'));module[_0xc3ed('0x1')]={'name':{'type':Sequelize[_0xc3ed('0x2')]},'username':{'type':Sequelize[_0xc3ed('0x2')]},'password':{'type':Sequelize[_0xc3ed('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xc3ed('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc3ed('0x2')]},'serverUrl':{'type':Sequelize[_0xc3ed('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc3ed('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc3ed('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 663e1ea..1ad78bb 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 _0xbfca=['customerid','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','remove','includes','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','forEach','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','LogicalName','DisplayName','EntityDefinitions(','Bearer\x20','TrueOption','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','count','limit','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','findOne','Dynamics365Configuration','length','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Dynamics365Field','Subjects','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','Incident','PhoneCall'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbfca,0x112));var _0xabfc=function(_0x456538,_0xd83da){_0x456538=_0x456538-0x0;var _0x24ac31=_0xbfca[_0x456538];return _0x24ac31;};'use strict';var rp=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var _=require(_0xabfc('0x2'));var qs=require(_0xabfc('0x3'));var logger=require(_0xabfc('0x4'))('api');var db=require(_0xabfc('0x5'))['db'];var integrations=require(_0xabfc('0x6'));function respondWithResult(_0x3a18d8,_0x4bceb0){_0x4bceb0=_0x4bceb0||0xc8;return function(_0x634a7b){if(_0x634a7b){return _0x3a18d8['status'](_0x4bceb0)[_0xabfc('0x7')](_0x634a7b);}};}function respondWithFilteredResult(_0x28777d,_0x16abc7){return function(_0x1df101){if(_0x1df101){var _0x531e51=typeof _0x16abc7[_0xabfc('0x8')]===_0xabfc('0x9')&&typeof _0x16abc7['limit']===_0xabfc('0x9');var _0x372ab5=_0x1df101[_0xabfc('0xa')];var _0x597594=_0x531e51?0x0:_0x16abc7[_0xabfc('0x8')];var _0x3bfbda=_0x531e51?_0x1df101['count']:_0x16abc7[_0xabfc('0x8')]+_0x16abc7[_0xabfc('0xb')];var _0x16a109;if(_0x3bfbda>=_0x372ab5){_0x3bfbda=_0x372ab5;_0x16a109=0xc8;}else{_0x16a109=0xce;}_0x28777d[_0xabfc('0xc')](_0x16a109);return _0x28777d[_0xabfc('0xd')](_0xabfc('0xe'),_0x597594+'-'+_0x3bfbda+'/'+_0x372ab5)[_0xabfc('0x7')](_0x1df101);}return null;};}function saveUpdates(_0x3d6ada){return function(_0x5c2b1c){if(_0x5c2b1c){return _0x5c2b1c[_0xabfc('0xf')](_0x3d6ada)[_0xabfc('0x10')](function(_0x850102){return _0x850102;});}return null;};}function removeEntity(_0x337b5c){return function(_0x348145){if(_0x348145){return _0x348145[_0xabfc('0x11')]()[_0xabfc('0x10')](function(){_0x337b5c[_0xabfc('0xc')](0xcc)[_0xabfc('0x12')]();});}};}function handleEntityNotFound(_0xba7217){return function(_0x6b2aa){if(!_0x6b2aa){_0xba7217[_0xabfc('0x13')](0x194);}return _0x6b2aa;};}function handleError(_0x126a23,_0x326c87){_0x326c87=_0x326c87||0x1f4;return function(_0x1047aa){logger[_0xabfc('0x14')](_0x1047aa[_0xabfc('0x15')]);if(_0x1047aa[_0xabfc('0x16')]){delete _0x1047aa['name'];}_0x126a23[_0xabfc('0xc')](_0x326c87)[_0xabfc('0x17')](_0x1047aa);};}exports[_0xabfc('0x18')]=function(_0x36c6aa,_0x1b2388){var _0x94ab52={},_0x2fde25={},_0x2112f0={'count':0x0,'rows':[]};var _0x37a236=_[_0xabfc('0x19')](db[_0xabfc('0x1a')]['rawAttributes'],function(_0x52bbd8){return{'name':_0x52bbd8[_0xabfc('0x1b')],'type':_0x52bbd8[_0xabfc('0x1c')]['key']};});_0x2fde25[_0xabfc('0x1d')]=_[_0xabfc('0x19')](_0x37a236,_0xabfc('0x16'));_0x2fde25[_0xabfc('0x1e')]=_[_0xabfc('0x1f')](_0x36c6aa[_0xabfc('0x1e')]);_0x2fde25[_0xabfc('0x20')]=_[_0xabfc('0x21')](_0x2fde25['model'],_0x2fde25['query']);_0x94ab52[_0xabfc('0x22')]=_[_0xabfc('0x21')](_0x2fde25[_0xabfc('0x1d')],qs[_0xabfc('0x23')](_0x36c6aa['query'][_0xabfc('0x23')]));_0x94ab52[_0xabfc('0x22')]=_0x94ab52[_0xabfc('0x22')]['length']?_0x94ab52[_0xabfc('0x22')]:_0x2fde25[_0xabfc('0x1d')];if(!_0x36c6aa[_0xabfc('0x1e')][_0xabfc('0x24')](_0xabfc('0x25'))){_0x94ab52[_0xabfc('0xb')]=qs[_0xabfc('0xb')](_0x36c6aa[_0xabfc('0x1e')]['limit']);_0x94ab52['offset']=qs[_0xabfc('0x8')](_0x36c6aa[_0xabfc('0x1e')][_0xabfc('0x8')]);}_0x94ab52[_0xabfc('0x26')]=qs[_0xabfc('0x27')](_0x36c6aa[_0xabfc('0x1e')][_0xabfc('0x27')]);_0x94ab52[_0xabfc('0x28')]=qs['filters'](_[_0xabfc('0x29')](_0x36c6aa[_0xabfc('0x1e')],_0x2fde25[_0xabfc('0x20')]),_0x37a236);if(_0x36c6aa[_0xabfc('0x1e')][_0xabfc('0x2a')]){_0x94ab52[_0xabfc('0x28')]=_[_0xabfc('0x2b')](_0x94ab52['where'],{'$or':_['map'](_0x37a236,function(_0xa7315f){if(_0xa7315f[_0xabfc('0x1c')]!==_0xabfc('0x2c')){var _0x4fe995={};_0x4fe995[_0xa7315f[_0xabfc('0x16')]]={'$like':'%'+_0x36c6aa[_0xabfc('0x1e')][_0xabfc('0x2a')]+'%'};return _0x4fe995;}})});}_0x94ab52=_[_0xabfc('0x2b')]({},_0x94ab52,_0x36c6aa[_0xabfc('0x2d')]);var _0x68f80e={'where':_0x94ab52[_0xabfc('0x28')]};return db[_0xabfc('0x1a')][_0xabfc('0xa')](_0x68f80e)[_0xabfc('0x10')](function(_0x663d08){_0x2112f0[_0xabfc('0xa')]=_0x663d08;if(_0x36c6aa['query'][_0xabfc('0x2e')]){_0x94ab52[_0xabfc('0x2f')]=[{'all':!![]}];}return db[_0xabfc('0x1a')][_0xabfc('0x30')](_0x94ab52);})[_0xabfc('0x10')](function(_0x3c78db){_0x2112f0[_0xabfc('0x31')]=_0x3c78db;return _0x2112f0;})['then'](respondWithFilteredResult(_0x1b2388,_0x94ab52))[_0xabfc('0x32')](handleError(_0x1b2388,null));};exports[_0xabfc('0x33')]=function(_0x21ae4a,_0x390897){var _0x13809f={'raw':![],'where':{'id':_0x21ae4a[_0xabfc('0x34')]['id']}},_0x5f8ff7={};_0x5f8ff7['model']=_[_0xabfc('0x1f')](db[_0xabfc('0x1a')][_0xabfc('0x35')]);_0x5f8ff7['query']=_[_0xabfc('0x1f')](_0x21ae4a['query']);_0x5f8ff7[_0xabfc('0x20')]=_[_0xabfc('0x21')](_0x5f8ff7['model'],_0x5f8ff7[_0xabfc('0x1e')]);_0x13809f['attributes']=_[_0xabfc('0x21')](_0x5f8ff7[_0xabfc('0x1d')],qs['fields'](_0x21ae4a[_0xabfc('0x1e')]['fields']));_0x13809f[_0xabfc('0x22')]=_0x13809f[_0xabfc('0x22')]['length']?_0x13809f[_0xabfc('0x22')]:_0x5f8ff7[_0xabfc('0x1d')];if(_0x21ae4a['query'][_0xabfc('0x2e')]){_0x13809f[_0xabfc('0x2f')]=[{'all':!![]}];}_0x13809f=_['merge']({},_0x13809f,_0x21ae4a[_0xabfc('0x2d')]);return db[_0xabfc('0x1a')][_0xabfc('0x36')](_0x13809f)[_0xabfc('0x10')](handleEntityNotFound(_0x390897,null))['then'](respondWithResult(_0x390897,null))[_0xabfc('0x32')](handleError(_0x390897,null));};exports['create']=function(_0x14bd7d,_0x5ef227){return db[_0xabfc('0x1a')]['create'](_0x14bd7d[_0xabfc('0x37')],{})[_0xabfc('0x10')](respondWithResult(_0x5ef227,0xc9))['catch'](handleError(_0x5ef227,null));};exports['update']=function(_0xbf93c7,_0x2df56b){if(_0xbf93c7['body']['id']){delete _0xbf93c7['body']['id'];}return db[_0xabfc('0x1a')][_0xabfc('0x36')]({'where':{'id':_0xbf93c7[_0xabfc('0x34')]['id']}})[_0xabfc('0x10')](handleEntityNotFound(_0x2df56b,null))[_0xabfc('0x10')](saveUpdates(_0xbf93c7['body'],null))['then'](respondWithResult(_0x2df56b,null))['catch'](handleError(_0x2df56b,null));};exports[_0xabfc('0x11')]=function(_0x2d98ce,_0x2c21de){return db[_0xabfc('0x1a')][_0xabfc('0x36')]({'where':{'id':_0x2d98ce[_0xabfc('0x34')]['id']}})[_0xabfc('0x10')](handleEntityNotFound(_0x2c21de,null))['then'](removeEntity(_0x2c21de,null))[_0xabfc('0x32')](handleError(_0x2c21de,null));};exports['getConfigurations']=function(_0x4b8d00,_0x3edf1e){var _0x1d2d0d={};var _0x281271={};var _0x325cae;var _0x1e9665;return db['Dynamics365Account'][_0xabfc('0x38')]({'where':{'id':_0x4b8d00[_0xabfc('0x34')]['id']}})[_0xabfc('0x10')](handleEntityNotFound(_0x3edf1e,null))[_0xabfc('0x10')](function(_0x1e36e0){if(_0x1e36e0){_0x325cae=_0x1e36e0;_0x281271[_0xabfc('0x1d')]=_[_0xabfc('0x1f')](db[_0xabfc('0x39')][_0xabfc('0x35')]);_0x281271['query']=_[_0xabfc('0x1f')](_0x4b8d00['query']);_0x281271[_0xabfc('0x20')]=_[_0xabfc('0x21')](_0x281271['model'],_0x281271[_0xabfc('0x1e')]);_0x1d2d0d[_0xabfc('0x22')]=_[_0xabfc('0x21')](_0x281271[_0xabfc('0x1d')],qs[_0xabfc('0x23')](_0x4b8d00['query'][_0xabfc('0x23')]));_0x1d2d0d[_0xabfc('0x22')]=_0x1d2d0d[_0xabfc('0x22')][_0xabfc('0x3a')]?_0x1d2d0d[_0xabfc('0x22')]:_0x281271['model'];_0x1d2d0d[_0xabfc('0x26')]=qs['sort'](_0x4b8d00[_0xabfc('0x1e')][_0xabfc('0x27')]);_0x1d2d0d[_0xabfc('0x28')]=qs[_0xabfc('0x20')](_[_0xabfc('0x29')](_0x4b8d00[_0xabfc('0x1e')],_0x281271[_0xabfc('0x20')]));if(_0x4b8d00[_0xabfc('0x1e')]['filter']){_0x1d2d0d[_0xabfc('0x28')]=_['merge'](_0x1d2d0d[_0xabfc('0x28')],{'$or':_[_0xabfc('0x19')](_0x1d2d0d[_0xabfc('0x22')],function(_0x47dd2e){var _0x38e1b4={};_0x38e1b4[_0x47dd2e]={'$like':'%'+_0x4b8d00[_0xabfc('0x1e')][_0xabfc('0x2a')]+'%'};return _0x38e1b4;})});}_0x1d2d0d=_[_0xabfc('0x2b')]({},_0x1d2d0d,_0x4b8d00[_0xabfc('0x2d')]);return _0x325cae['getConfigurations'](_0x1d2d0d);}})[_0xabfc('0x10')](function(_0x1fff4d){if(_0x1fff4d){_0x1e9665=_0x1fff4d['length'];if(!_0x4b8d00[_0xabfc('0x1e')]['hasOwnProperty'](_0xabfc('0x25'))){_0x1d2d0d[_0xabfc('0xb')]=qs[_0xabfc('0xb')](_0x4b8d00[_0xabfc('0x1e')][_0xabfc('0xb')]);_0x1d2d0d['offset']=qs[_0xabfc('0x8')](_0x4b8d00[_0xabfc('0x1e')]['offset']);}return _0x325cae[_0xabfc('0x3b')](_0x1d2d0d);}})[_0xabfc('0x10')](function(_0x134782){if(_0x134782){return _0x134782?{'count':_0x1e9665,'rows':_0x134782}:null;}})[_0xabfc('0x10')](respondWithResult(_0x3edf1e,null))['catch'](handleError(_0x3edf1e,null));};exports[_0xabfc('0x3c')]=function(_0x1af541,_0x21f0c5){if(_0x1af541[_0xabfc('0x37')]['id']){delete _0x1af541['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x1af541[_0xabfc('0x34')]['id']}})[_0xabfc('0x10')](handleEntityNotFound(_0x21f0c5,null))[_0xabfc('0x10')](function(_0x3a76d7){if(_0x3a76d7){_0x1af541[_0xabfc('0x37')][_0xabfc('0x3d')]=_0x3a76d7['id'];_0x1af541[_0xabfc('0x37')]['Subjects']=integrations[_0xabfc('0x3e')](_0x1af541[_0xabfc('0x37')][_0xabfc('0x3f')],_0x1af541[_0xabfc('0x37')][_0xabfc('0x1c')]);_0x1af541[_0xabfc('0x37')]['Descriptions']=integrations['getDescriptions'](_0x1af541[_0xabfc('0x37')][_0xabfc('0x3f')],_0x1af541[_0xabfc('0x37')]['type']);return db['Dynamics365Configuration']['create'](_0x1af541[_0xabfc('0x37')],{'include':[{'model':db[_0xabfc('0x40')],'as':_0xabfc('0x41')},{'model':db[_0xabfc('0x40')],'as':_0xabfc('0x42')}]});}return null;})['then'](respondWithResult(_0x21f0c5,null))[_0xabfc('0x32')](handleError(_0x21f0c5,null));};function sanitizeRemoteUri(_0x60a02a){var _0x3e16cb=_0x60a02a[_0xabfc('0x43')](-0x1);if(_0x3e16cb==='/')return _0x60a02a[_0xabfc('0x44')](0x0,_0x60a02a[_0xabfc('0x45')](_0x3e16cb));return _0x60a02a;}function getWebApiUrl(_0x55bb3d){return util[_0xabfc('0x46')](_0xabfc('0x47'),_0x55bb3d);}exports['getFields']=function(_0x6e3cd6,_0x6ca2a6){var _0x11a7c0=_0x6e3cd6[_0xabfc('0x1e')]['ticketType'];var _0x1ba49a=_0x11a7c0==='incident'?_0xabfc('0x48'):_0xabfc('0x49');var _0x3c5a92='';var _0x1ed74c='';var _0x3972d2='';var _0x15ef6e='';var _0x569085='';var _0x33d412='';var _0x2a7129='';var _0x8bd2f4='';var _0x5dc006=['title','description',_0xabfc('0x4a'),_0xabfc('0x4b'),_0xabfc('0x4c'),_0xabfc('0x4d'),'phonenumber','regardingobjectid',_0xabfc('0x4e'),_0xabfc('0x4f')];var _0x190220=[_0xabfc('0x50'),_0xabfc('0x51'),_0xabfc('0x52'),_0xabfc('0x53'),_0xabfc('0x54'),'contactidyominame',_0xabfc('0x55'),_0xabfc('0x56'),'createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname',_0xabfc('0x57'),'createdon','createdonbehalfbyname',_0xabfc('0x58'),_0xabfc('0x59'),_0xabfc('0x5a'),'customeridyominame',_0xabfc('0x5b'),_0xabfc('0x5c'),_0xabfc('0x5d'),_0xabfc('0x5e'),_0xabfc('0x5f'),_0xabfc('0x60'),_0xabfc('0x61'),_0xabfc('0x62'),'importsequencenumber',_0xabfc('0x63'),_0xabfc('0x64'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0xabfc('0x65'),_0xabfc('0x66'),_0xabfc('0x67'),'modifiedon',_0xabfc('0x68'),'modifiedonbehalfbyyominame',_0xabfc('0x69'),_0xabfc('0x6a'),_0xabfc('0x6b'),_0xabfc('0x6c'),_0xabfc('0x6d'),_0xabfc('0x6e'),_0xabfc('0x6f'),_0xabfc('0x70'),'parentcaseidname',_0xabfc('0x71'),_0xabfc('0x72'),_0xabfc('0x73'),_0xabfc('0x74'),'productserialnumber','resolveby','resolvebykpiidname','responseby',_0xabfc('0x75'),_0xabfc('0x76'),_0xabfc('0x77'),_0xabfc('0x78'),_0xabfc('0x79'),_0xabfc('0x7a'),_0xabfc('0x7b'),_0xabfc('0x7c'),'subjectidname','ticketnumber',_0xabfc('0x7d'),_0xabfc('0x7e'),_0xabfc('0x7f'),_0xabfc('0x80'),'versionnumber'];var _0x449696=_0x5dc006[_0xabfc('0x81')](_0x190220);return db[_0xabfc('0x1a')][_0xabfc('0x38')]({'where':{'id':_0x6e3cd6[_0xabfc('0x34')]['id']},'attributes':['id','username','password','remoteUri',_0xabfc('0x82'),_0xabfc('0x83'),_0xabfc('0x84'),_0xabfc('0x85')],'include':[{'model':db[_0xabfc('0x86')],'as':_0xabfc('0x86'),'attributes':['id','data5',_0xabfc('0x87')]}]})[_0xabfc('0x10')](handleEntityNotFound(_0x6ca2a6,null))['then'](function(_0x1985ec){if(_0x1985ec){if(_0x1985ec[_0xabfc('0x85')]){_0x1985ec[_0xabfc('0x88')]=_0x1985ec[_0xabfc('0x86')][_0xabfc('0x89')];_0x8bd2f4=sanitizeRemoteUri(_0x1985ec[_0xabfc('0x86')]['data7']);_0x2a7129=getWebApiUrl(_0x8bd2f4);return _0x1985ec;}_0x8bd2f4=sanitizeRemoteUri(_0x1985ec['remoteUri']);_0x2a7129=getWebApiUrl(_0x8bd2f4);var _0x5e50c5={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x1985ec[_0xabfc('0x82')]+'/oauth2/token','form':{'client_id':_0x1985ec[_0xabfc('0x83')],'resource':_0x8bd2f4,'username':_0x1985ec['username'],'password':_0x1985ec[_0xabfc('0x8a')],'grant_type':_0xabfc('0x8a'),'client_secret':_0x1985ec[_0xabfc('0x84')]},'json':!![]};return rp(_0x5e50c5);}})['then'](function(_0x1242b3){_0x33d412=_0x1242b3[_0xabfc('0x88')];var _0x5b2b41={'method':_0xabfc('0x8b'),'uri':encodeURI(_0x2a7129+_0xabfc('0x8c')+_0x1ba49a+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x33d412,'If-None-Match':null,'OData-Version':_0xabfc('0x8d')},'json':!![]};return rp(_0x5b2b41);})[_0xabfc('0x10')](function(_0x43c48f){var _0x388291=_0x43c48f[_0xabfc('0x8e')][0x0];var _0x413b01=_0x388291['MetadataId'];var _0x4170a7={'method':_0xabfc('0x8b'),'uri':_0x2a7129+'EntityDefinitions('+_0x413b01+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x33d412,'If-None-Match':null,'OData-Version':_0xabfc('0x8d')},'json':!![]};return rp(_0x4170a7);})[_0xabfc('0x10')](function(_0x562f58){_0x3c5a92=_0x562f58;_0x1ed74c=_0x3c5a92['Attributes'];_0x1ed74c=_[_0xabfc('0x8f')](_0x1ed74c,function(_0x43865a){return!_0x449696[_0xabfc('0x90')](_0x43865a['LogicalName']);});var _0x428b2e=[];var _0x2286ae=[];_0x1ed74c['forEach'](function(_0x34b420){if(_0x34b420[_0xabfc('0x91')]){var _0x4c2e7e=_0x34b420[_0xabfc('0x91')][_0xabfc('0x44')](_0x34b420[_0xabfc('0x91')][_0xabfc('0x45')]('.')+0x1);if(_0x4c2e7e===_0xabfc('0x92')){_0x428b2e[_0xabfc('0x93')](getSelectList(_0x2a7129,_0x11a7c0,_0x2286ae,_0x3c5a92[_0xabfc('0x94')],_0x34b420[_0xabfc('0x94')],_0x33d412));}}});return Promise[_0xabfc('0x95')](_0x428b2e);})[_0xabfc('0x10')](function(_0xa82fca){_0x3972d2=_0xa82fca[0x0];var _0x1ba927=[];var _0x58b1eb=[];_0x1ed74c[_0xabfc('0x96')](function(_0x4359b6){if(!_['isNil'](_0x4359b6['@odata.type'])){var _0x57c30e=_0x4359b6['@odata.type']['substring'](_0x4359b6[_0xabfc('0x91')][_0xabfc('0x45')]('.')+0x1);if(_0x57c30e===_0xabfc('0x97')){_0x1ba927[_0xabfc('0x93')](getBooleanList(_0x2a7129,_0x11a7c0,_0x58b1eb,_0x3c5a92[_0xabfc('0x94')],_0x4359b6['MetadataId'],_0x33d412));}}});return Promise[_0xabfc('0x95')](_0x1ba927);})[_0xabfc('0x10')](function(_0x1c5a24){_0x15ef6e=_0x1c5a24[0x0];var _0x23fcea=[];var _0x58c471=[];_0x1ed74c[_0xabfc('0x96')](function(_0x48cecb){if(_0x48cecb['@odata.type']){var _0x56143a=_0x48cecb['@odata.type'][_0xabfc('0x44')](_0x48cecb[_0xabfc('0x91')][_0xabfc('0x45')]('.')+0x1);if(_0x56143a==='StringAttributeMetadata'||_0x56143a===_0xabfc('0x98')||_0x56143a==='BigIntAttributeMetadata'||_0x56143a===_0xabfc('0x99')||_0x56143a===_0xabfc('0x9a')||_0x56143a==='DateTimeAttributeMetadata'||_0x56143a==='StatusAttributeMetadata'||_0x56143a==='EntityNameAttributeMetadata'||_0x56143a===_0xabfc('0x9b')||_0x56143a==='DecimalAttributeMetadata'){_0x23fcea[_0xabfc('0x93')](getInputList(_0x2a7129,_0x11a7c0,_0x56143a,_0x58c471,_0x3c5a92['MetadataId'],_0x48cecb[_0xabfc('0x94')],_0x33d412));}}});return Promise[_0xabfc('0x95')](_0x23fcea);})[_0xabfc('0x10')](function(_0x411d09){_0x569085=_0x411d09[0x0];var _0x1b5098=_0x3972d2[_0xabfc('0x81')](_0x15ef6e)[_0xabfc('0x81')](_0x569085);var _0x239532={'count':_0x1b5098[_0xabfc('0x3a')],'rows':_0x1b5098};return _0x239532;})[_0xabfc('0x10')](respondWithResult(_0x6ca2a6,null))[_0xabfc('0x32')](function(_0x57f805){var _0x34ff31=_0x6e3cd6[_0xabfc('0x1e')][_0xabfc('0x9c')]?0x1f4:_0x57f805[_0xabfc('0x9d')]||0x1f4;logger[_0xabfc('0x14')](_0x57f805[_0xabfc('0x15')]);delete _0x57f805[_0xabfc('0x16')];if(_0x34ff31===0x191){_0x34ff31=0x190;}_0x6ca2a6[_0xabfc('0xc')](_0x34ff31)[_0xabfc('0x17')](_0x6e3cd6[_0xabfc('0x1e')][_0xabfc('0x9c')]?{'message':_0xabfc('0x9e'),'statusCode':_0x57f805[_0xabfc('0x9d')]}:_0x57f805);});};function getSelectList(_0x5e2c2f,_0x56aecd,_0x2cfa1e,_0x3abc26,_0x10eb7f,_0xa58316){var _0x586e49={'method':_0xabfc('0x8b'),'uri':_0x5e2c2f+'EntityDefinitions('+_0x3abc26+_0xabfc('0x9f')+_0x10eb7f+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xabfc('0xa0'),'headers':{'Authorization':'Bearer\x20'+_0xa58316,'If-None-Match':null,'OData-Version':_0xabfc('0x8d')},'json':!![]};return rp(_0x586e49)['then'](function(_0x3d7741){var _0x135172=[];var _0x1ecca0=_0x3d7741[_0xabfc('0xa1')][_0xabfc('0xa2')];_0x1ecca0['forEach'](function(_0x8b2def){_0x135172['push']({'name':_0x8b2def['Label'][_0xabfc('0xa3')][_0xabfc('0xa4')],'value':String(_0x8b2def[_0xabfc('0xa5')])});});var _0x3565ce={'id':_0x56aecd+'_'+_0x3d7741[_0xabfc('0xa6')],'name':_0x3d7741[_0xabfc('0xa7')][_0xabfc('0xa3')]['Label'],'custom':![],'options':_0x135172};_0x2cfa1e[_0xabfc('0x93')](_0x3565ce);return _0x2cfa1e;});}function getBooleanList(_0x29a533,_0x323190,_0x45fd25,_0x32cb75,_0x139240,_0x5495b7){var _0x46b7d8={'method':_0xabfc('0x8b'),'uri':_0x29a533+_0xabfc('0xa8')+_0x32cb75+')/Attributes('+_0x139240+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xabfc('0xa9')+_0x5495b7,'If-None-Match':null,'OData-Version':_0xabfc('0x8d')},'json':!![]};return rp(_0x46b7d8)['then'](function(_0x6d8f9d){var _0x533081=[];_0x533081[_0xabfc('0x93')]({'name':_0x6d8f9d['OptionSet'][_0xabfc('0xaa')][_0xabfc('0xa4')][_0xabfc('0xa3')]['Label'],'value':'true'},{'name':_0x6d8f9d[_0xabfc('0xa1')][_0xabfc('0xab')][_0xabfc('0xa4')][_0xabfc('0xa3')][_0xabfc('0xa4')],'value':_0xabfc('0xac')});var _0x102c04={'id':_0x323190+'_'+_0x6d8f9d[_0xabfc('0xa6')],'name':_0x6d8f9d[_0xabfc('0xa7')][_0xabfc('0xa3')]['Label'],'custom':![],'options':_0x533081};_0x45fd25['push'](_0x102c04);return _0x45fd25;});}function getInputList(_0x440ad8,_0x42196e,_0xed124a,_0x12a5ea,_0x41cf56,_0x4bd21d,_0x268ae2){var _0x5abca5={'method':'GET','uri':_0x440ad8+_0xabfc('0xa8')+_0x41cf56+_0xabfc('0x9f')+_0x4bd21d+')/Microsoft.Dynamics.CRM.'+_0xed124a+_0xabfc('0xad'),'headers':{'Authorization':_0xabfc('0xa9')+_0x268ae2,'If-None-Match':null,'OData-Version':_0xabfc('0x8d')},'json':!![]};return rp(_0x5abca5)['then'](function(_0x112d7c){var _0x1d34d6={'id':_0x42196e+'_'+_0x112d7c['LogicalName'],'name':_0x112d7c[_0xabfc('0xa7')][_0xabfc('0xa3')]?_0x112d7c[_0xabfc('0xa7')][_0xabfc('0xa3')][_0xabfc('0xa4')]:_0x112d7c[_0xabfc('0xa6')],'custom':![],'options':[]};_0x12a5ea[_0xabfc('0x93')](_0x1d34d6);return _0x12a5ea;});} \ No newline at end of file +var _0x8dab=['createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','forEach','@odata.type','PicklistAttributeMetadata','push','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','update','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','Dynamics365Account','then','include','findAll','show','params','includeAll','find','catch','create','body','getConfigurations','Dynamics365Configuration','options','hasOwnProperty','nolimit','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','getFields','ticketType','Incident','PhoneCall','description','customerid','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname'];(function(_0x4d696d,_0x3a67c9){var _0x7f5a9=function(_0x37f817){while(--_0x37f817){_0x4d696d['push'](_0x4d696d['shift']());}};_0x7f5a9(++_0x3a67c9);}(_0x8dab,0x1ec));var _0xb8da=function(_0x288371,_0x35f999){_0x288371=_0x288371-0x0;var _0x5a1ad1=_0x8dab[_0x288371];return _0x5a1ad1;};'use strict';var rp=require(_0xb8da('0x0'));var util=require(_0xb8da('0x1'));var _=require(_0xb8da('0x2'));var qs=require(_0xb8da('0x3'));var logger=require(_0xb8da('0x4'))(_0xb8da('0x5'));var db=require(_0xb8da('0x6'))['db'];var integrations=require(_0xb8da('0x7'));function respondWithResult(_0xf267da,_0x10fad9){_0x10fad9=_0x10fad9||0xc8;return function(_0x22852a){if(_0x22852a){return _0xf267da[_0xb8da('0x8')](_0x10fad9)[_0xb8da('0x9')](_0x22852a);}};}function respondWithFilteredResult(_0x3c9e7b,_0x4c2021){return function(_0x5c8643){if(_0x5c8643){var _0x5f06e3=typeof _0x4c2021[_0xb8da('0xa')]==='undefined'&&typeof _0x4c2021['limit']===_0xb8da('0xb');var _0x2e349b=_0x5c8643['count'];var _0x4ce09a=_0x5f06e3?0x0:_0x4c2021[_0xb8da('0xa')];var _0x49754e=_0x5f06e3?_0x5c8643[_0xb8da('0xc')]:_0x4c2021[_0xb8da('0xa')]+_0x4c2021[_0xb8da('0xd')];var _0x3ffd5f;if(_0x49754e>=_0x2e349b){_0x49754e=_0x2e349b;_0x3ffd5f=0xc8;}else{_0x3ffd5f=0xce;}_0x3c9e7b['status'](_0x3ffd5f);return _0x3c9e7b['set']('Content-Range',_0x4ce09a+'-'+_0x49754e+'/'+_0x2e349b)[_0xb8da('0x9')](_0x5c8643);}return null;};}function saveUpdates(_0x4152ea){return function(_0x26ec23){if(_0x26ec23){return _0x26ec23[_0xb8da('0xe')](_0x4152ea)['then'](function(_0x9175b){return _0x9175b;});}return null;};}function removeEntity(_0x532e18){return function(_0x501d8c){if(_0x501d8c){return _0x501d8c[_0xb8da('0xf')]()['then'](function(){_0x532e18[_0xb8da('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c634a){return function(_0x1b7159){if(!_0x1b7159){_0x1c634a[_0xb8da('0x10')](0x194);}return _0x1b7159;};}function handleError(_0x27ae46,_0x5e0c15){_0x5e0c15=_0x5e0c15||0x1f4;return function(_0x3c6145){logger[_0xb8da('0x11')](_0x3c6145[_0xb8da('0x12')]);if(_0x3c6145[_0xb8da('0x13')]){delete _0x3c6145['name'];}_0x27ae46[_0xb8da('0x8')](_0x5e0c15)[_0xb8da('0x14')](_0x3c6145);};}exports[_0xb8da('0x15')]=function(_0x2a86eb,_0x46bfdf){var _0xeda882={},_0x1e5feb={},_0xdc3925={'count':0x0,'rows':[]};var _0x29a73a=_[_0xb8da('0x16')](db['Dynamics365Account'][_0xb8da('0x17')],function(_0x1e5ae2){return{'name':_0x1e5ae2[_0xb8da('0x18')],'type':_0x1e5ae2[_0xb8da('0x19')][_0xb8da('0x1a')]};});_0x1e5feb[_0xb8da('0x1b')]=_[_0xb8da('0x16')](_0x29a73a,'name');_0x1e5feb['query']=_[_0xb8da('0x1c')](_0x2a86eb['query']);_0x1e5feb[_0xb8da('0x1d')]=_[_0xb8da('0x1e')](_0x1e5feb[_0xb8da('0x1b')],_0x1e5feb[_0xb8da('0x1f')]);_0xeda882[_0xb8da('0x20')]=_[_0xb8da('0x1e')](_0x1e5feb[_0xb8da('0x1b')],qs[_0xb8da('0x21')](_0x2a86eb['query'][_0xb8da('0x21')]));_0xeda882[_0xb8da('0x20')]=_0xeda882[_0xb8da('0x20')][_0xb8da('0x22')]?_0xeda882['attributes']:_0x1e5feb[_0xb8da('0x1b')];if(!_0x2a86eb[_0xb8da('0x1f')]['hasOwnProperty']('nolimit')){_0xeda882[_0xb8da('0xd')]=qs[_0xb8da('0xd')](_0x2a86eb[_0xb8da('0x1f')][_0xb8da('0xd')]);_0xeda882['offset']=qs[_0xb8da('0xa')](_0x2a86eb[_0xb8da('0x1f')][_0xb8da('0xa')]);}_0xeda882[_0xb8da('0x23')]=qs[_0xb8da('0x24')](_0x2a86eb[_0xb8da('0x1f')][_0xb8da('0x24')]);_0xeda882[_0xb8da('0x25')]=qs['filters'](_['pick'](_0x2a86eb[_0xb8da('0x1f')],_0x1e5feb[_0xb8da('0x1d')]),_0x29a73a);if(_0x2a86eb[_0xb8da('0x1f')][_0xb8da('0x26')]){_0xeda882[_0xb8da('0x25')]=_[_0xb8da('0x27')](_0xeda882['where'],{'$or':_[_0xb8da('0x16')](_0x29a73a,function(_0x5eb128){if(_0x5eb128[_0xb8da('0x19')]!==_0xb8da('0x28')){var _0x464a15={};_0x464a15[_0x5eb128[_0xb8da('0x13')]]={'$like':'%'+_0x2a86eb[_0xb8da('0x1f')]['filter']+'%'};return _0x464a15;}})});}_0xeda882=_['merge']({},_0xeda882,_0x2a86eb['options']);var _0x4ee6ec={'where':_0xeda882['where']};return db[_0xb8da('0x29')][_0xb8da('0xc')](_0x4ee6ec)[_0xb8da('0x2a')](function(_0x89d1a2){_0xdc3925[_0xb8da('0xc')]=_0x89d1a2;if(_0x2a86eb[_0xb8da('0x1f')]['includeAll']){_0xeda882[_0xb8da('0x2b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xb8da('0x2c')](_0xeda882);})[_0xb8da('0x2a')](function(_0x274f00){_0xdc3925['rows']=_0x274f00;return _0xdc3925;})[_0xb8da('0x2a')](respondWithFilteredResult(_0x46bfdf,_0xeda882))['catch'](handleError(_0x46bfdf,null));};exports[_0xb8da('0x2d')]=function(_0x262c2c,_0xbd641){var _0x7609d1={'raw':![],'where':{'id':_0x262c2c[_0xb8da('0x2e')]['id']}},_0x2989cb={};_0x2989cb['model']=_['keys'](db[_0xb8da('0x29')][_0xb8da('0x17')]);_0x2989cb['query']=_['keys'](_0x262c2c['query']);_0x2989cb['filters']=_[_0xb8da('0x1e')](_0x2989cb[_0xb8da('0x1b')],_0x2989cb[_0xb8da('0x1f')]);_0x7609d1[_0xb8da('0x20')]=_['intersection'](_0x2989cb[_0xb8da('0x1b')],qs['fields'](_0x262c2c[_0xb8da('0x1f')][_0xb8da('0x21')]));_0x7609d1[_0xb8da('0x20')]=_0x7609d1[_0xb8da('0x20')][_0xb8da('0x22')]?_0x7609d1[_0xb8da('0x20')]:_0x2989cb[_0xb8da('0x1b')];if(_0x262c2c[_0xb8da('0x1f')][_0xb8da('0x2f')]){_0x7609d1[_0xb8da('0x2b')]=[{'all':!![]}];}_0x7609d1=_[_0xb8da('0x27')]({},_0x7609d1,_0x262c2c['options']);return db['Dynamics365Account'][_0xb8da('0x30')](_0x7609d1)[_0xb8da('0x2a')](handleEntityNotFound(_0xbd641,null))[_0xb8da('0x2a')](respondWithResult(_0xbd641,null))[_0xb8da('0x31')](handleError(_0xbd641,null));};exports[_0xb8da('0x32')]=function(_0x160654,_0x40ccf7){return db[_0xb8da('0x29')][_0xb8da('0x32')](_0x160654[_0xb8da('0x33')],{})['then'](respondWithResult(_0x40ccf7,0xc9))[_0xb8da('0x31')](handleError(_0x40ccf7,null));};exports[_0xb8da('0xe')]=function(_0xdb8dc5,_0x12a4cd){if(_0xdb8dc5['body']['id']){delete _0xdb8dc5['body']['id'];}return db[_0xb8da('0x29')][_0xb8da('0x30')]({'where':{'id':_0xdb8dc5[_0xb8da('0x2e')]['id']}})[_0xb8da('0x2a')](handleEntityNotFound(_0x12a4cd,null))[_0xb8da('0x2a')](saveUpdates(_0xdb8dc5[_0xb8da('0x33')],null))[_0xb8da('0x2a')](respondWithResult(_0x12a4cd,null))[_0xb8da('0x31')](handleError(_0x12a4cd,null));};exports[_0xb8da('0xf')]=function(_0x22d156,_0x34d11f){return db[_0xb8da('0x29')][_0xb8da('0x30')]({'where':{'id':_0x22d156[_0xb8da('0x2e')]['id']}})['then'](handleEntityNotFound(_0x34d11f,null))['then'](removeEntity(_0x34d11f,null))[_0xb8da('0x31')](handleError(_0x34d11f,null));};exports[_0xb8da('0x34')]=function(_0x4dfffc,_0x6a62ff){var _0x56dd7f={};var _0x22640c={};var _0x5202bc;var _0x1f8eac;return db[_0xb8da('0x29')]['findOne']({'where':{'id':_0x4dfffc[_0xb8da('0x2e')]['id']}})['then'](handleEntityNotFound(_0x6a62ff,null))['then'](function(_0x4e31da){if(_0x4e31da){_0x5202bc=_0x4e31da;_0x22640c[_0xb8da('0x1b')]=_[_0xb8da('0x1c')](db[_0xb8da('0x35')]['rawAttributes']);_0x22640c['query']=_[_0xb8da('0x1c')](_0x4dfffc[_0xb8da('0x1f')]);_0x22640c[_0xb8da('0x1d')]=_[_0xb8da('0x1e')](_0x22640c[_0xb8da('0x1b')],_0x22640c[_0xb8da('0x1f')]);_0x56dd7f[_0xb8da('0x20')]=_['intersection'](_0x22640c[_0xb8da('0x1b')],qs[_0xb8da('0x21')](_0x4dfffc['query'][_0xb8da('0x21')]));_0x56dd7f[_0xb8da('0x20')]=_0x56dd7f[_0xb8da('0x20')][_0xb8da('0x22')]?_0x56dd7f[_0xb8da('0x20')]:_0x22640c['model'];_0x56dd7f[_0xb8da('0x23')]=qs[_0xb8da('0x24')](_0x4dfffc[_0xb8da('0x1f')][_0xb8da('0x24')]);_0x56dd7f['where']=qs[_0xb8da('0x1d')](_['pick'](_0x4dfffc[_0xb8da('0x1f')],_0x22640c['filters']));if(_0x4dfffc[_0xb8da('0x1f')][_0xb8da('0x26')]){_0x56dd7f[_0xb8da('0x25')]=_[_0xb8da('0x27')](_0x56dd7f['where'],{'$or':_[_0xb8da('0x16')](_0x56dd7f[_0xb8da('0x20')],function(_0x352714){var _0x40f156={};_0x40f156[_0x352714]={'$like':'%'+_0x4dfffc['query'][_0xb8da('0x26')]+'%'};return _0x40f156;})});}_0x56dd7f=_[_0xb8da('0x27')]({},_0x56dd7f,_0x4dfffc[_0xb8da('0x36')]);return _0x5202bc['getConfigurations'](_0x56dd7f);}})[_0xb8da('0x2a')](function(_0x22d955){if(_0x22d955){_0x1f8eac=_0x22d955[_0xb8da('0x22')];if(!_0x4dfffc[_0xb8da('0x1f')][_0xb8da('0x37')](_0xb8da('0x38'))){_0x56dd7f[_0xb8da('0xd')]=qs['limit'](_0x4dfffc[_0xb8da('0x1f')]['limit']);_0x56dd7f[_0xb8da('0xa')]=qs[_0xb8da('0xa')](_0x4dfffc['query'][_0xb8da('0xa')]);}return _0x5202bc[_0xb8da('0x34')](_0x56dd7f);}})[_0xb8da('0x2a')](function(_0x50b485){if(_0x50b485){return _0x50b485?{'count':_0x1f8eac,'rows':_0x50b485}:null;}})[_0xb8da('0x2a')](respondWithResult(_0x6a62ff,null))[_0xb8da('0x31')](handleError(_0x6a62ff,null));};exports[_0xb8da('0x39')]=function(_0x5e8d35,_0xf546a9){if(_0x5e8d35[_0xb8da('0x33')]['id']){delete _0x5e8d35['body']['id'];}return db[_0xb8da('0x29')][_0xb8da('0x3a')]({'where':{'id':_0x5e8d35[_0xb8da('0x2e')]['id']}})['then'](handleEntityNotFound(_0xf546a9,null))[_0xb8da('0x2a')](function(_0x2018e6){if(_0x2018e6){_0x5e8d35[_0xb8da('0x33')]['AccountId']=_0x2018e6['id'];_0x5e8d35[_0xb8da('0x33')][_0xb8da('0x3b')]=integrations[_0xb8da('0x3c')](_0x5e8d35[_0xb8da('0x33')][_0xb8da('0x3d')],_0x5e8d35[_0xb8da('0x33')][_0xb8da('0x19')]);_0x5e8d35['body'][_0xb8da('0x3e')]=integrations[_0xb8da('0x3f')](_0x5e8d35[_0xb8da('0x33')]['channel'],_0x5e8d35['body']['type']);return db[_0xb8da('0x35')][_0xb8da('0x32')](_0x5e8d35[_0xb8da('0x33')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xb8da('0x40')],'as':_0xb8da('0x3e')}]});}return null;})[_0xb8da('0x2a')](respondWithResult(_0xf546a9,null))['catch'](handleError(_0xf546a9,null));};function sanitizeRemoteUri(_0x107f22){var _0x1954a0=_0x107f22[_0xb8da('0x41')](-0x1);if(_0x1954a0==='/')return _0x107f22[_0xb8da('0x42')](0x0,_0x107f22[_0xb8da('0x43')](_0x1954a0));return _0x107f22;}function getWebApiUrl(_0xb60549){return util[_0xb8da('0x44')]('%s/api/data/v9.0/',_0xb60549);}exports[_0xb8da('0x45')]=function(_0x2b3731,_0xc52dfb){var _0x21aed3=_0x2b3731['query'][_0xb8da('0x46')];var _0x340de4=_0x21aed3==='incident'?_0xb8da('0x47'):_0xb8da('0x48');var _0x3bff65='';var _0x517af9='';var _0x339350='';var _0x315e9b='';var _0x5db801='';var _0x2db71d='';var _0x52bb3b='';var _0x26aeac='';var _0x2eea73=['title',_0xb8da('0x49'),_0xb8da('0x4a'),'ownerid','caseorigincode',_0xb8da('0x4b'),'phonenumber',_0xb8da('0x4c'),'directioncode',_0xb8da('0x4d')];var _0x52eeed=[_0xb8da('0x4e'),_0xb8da('0x4f'),_0xb8da('0x50'),_0xb8da('0x51'),'contactidname',_0xb8da('0x52'),_0xb8da('0x53'),'contractidname','createdbyexternalpartyname',_0xb8da('0x54'),_0xb8da('0x55'),_0xb8da('0x56'),'createdon',_0xb8da('0x57'),_0xb8da('0x58'),_0xb8da('0x59'),_0xb8da('0x5a'),_0xb8da('0x5b'),_0xb8da('0x5c'),_0xb8da('0x5d'),'entityimage_timestamp','entityimage_url',_0xb8da('0x5e'),_0xb8da('0x5f'),_0xb8da('0x60'),_0xb8da('0x61'),_0xb8da('0x62'),_0xb8da('0x63'),_0xb8da('0x64'),_0xb8da('0x65'),_0xb8da('0x66'),_0xb8da('0x67'),_0xb8da('0x68'),_0xb8da('0x69'),_0xb8da('0x6a'),_0xb8da('0x6b'),_0xb8da('0x6c'),'modifiedonbehalfbyyominame',_0xb8da('0x6d'),'msdyn_iotalertname',_0xb8da('0x6e'),_0xb8da('0x6f'),_0xb8da('0x70'),'owneridname',_0xb8da('0x71'),'owneridyominame',_0xb8da('0x72'),_0xb8da('0x73'),_0xb8da('0x74'),_0xb8da('0x75'),_0xb8da('0x76'),_0xb8da('0x77'),_0xb8da('0x78'),_0xb8da('0x79'),_0xb8da('0x7a'),_0xb8da('0x7b'),_0xb8da('0x7c'),'sentimentvalue',_0xb8da('0x7d'),_0xb8da('0x7e'),_0xb8da('0x7f'),_0xb8da('0x80'),_0xb8da('0x81'),_0xb8da('0x82'),'ticketnumber',_0xb8da('0x83'),'transactioncurrencyidname',_0xb8da('0x84'),'utcconversiontimezonecode',_0xb8da('0x85')];var _0x2205c7=_0x2eea73['concat'](_0x52eeed);return db[_0xb8da('0x29')]['findOne']({'where':{'id':_0x2b3731['params']['id']},'attributes':['id',_0xb8da('0x86'),_0xb8da('0x87'),_0xb8da('0x88'),_0xb8da('0x89'),_0xb8da('0x8a'),_0xb8da('0x8b'),_0xb8da('0x8c')],'include':[{'model':db[_0xb8da('0x8d')],'as':_0xb8da('0x8d'),'attributes':['id','data5',_0xb8da('0x8e')]}]})[_0xb8da('0x2a')](handleEntityNotFound(_0xc52dfb,null))[_0xb8da('0x2a')](function(_0x5586b7){if(_0x5586b7){if(_0x5586b7[_0xb8da('0x8c')]){_0x5586b7[_0xb8da('0x8f')]=_0x5586b7['CloudProvider'][_0xb8da('0x90')];_0x26aeac=sanitizeRemoteUri(_0x5586b7[_0xb8da('0x8d')]['data7']);_0x52bb3b=getWebApiUrl(_0x26aeac);return _0x5586b7;}_0x26aeac=sanitizeRemoteUri(_0x5586b7[_0xb8da('0x88')]);_0x52bb3b=getWebApiUrl(_0x26aeac);var _0x12f1ff={'method':_0xb8da('0x91'),'uri':_0xb8da('0x92')+_0x5586b7['tenantId']+_0xb8da('0x93'),'form':{'client_id':_0x5586b7['clientId'],'resource':_0x26aeac,'username':_0x5586b7[_0xb8da('0x86')],'password':_0x5586b7[_0xb8da('0x87')],'grant_type':_0xb8da('0x87'),'client_secret':_0x5586b7[_0xb8da('0x8b')]},'json':!![]};return rp(_0x12f1ff);}})['then'](function(_0x4c8565){_0x2db71d=_0x4c8565[_0xb8da('0x8f')];var _0xed63d3={'method':_0xb8da('0x94'),'uri':encodeURI(_0x52bb3b+_0xb8da('0x95')+_0x340de4+'\x27'),'headers':{'Authorization':_0xb8da('0x96')+_0x2db71d,'If-None-Match':null,'OData-Version':_0xb8da('0x97')},'json':!![]};return rp(_0xed63d3);})['then'](function(_0x539506){var _0x1a2eed=_0x539506[_0xb8da('0x98')][0x0];var _0x4ebcaa=_0x1a2eed[_0xb8da('0x99')];var _0x41d6b2={'method':_0xb8da('0x94'),'uri':_0x52bb3b+_0xb8da('0x9a')+_0x4ebcaa+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xb8da('0x96')+_0x2db71d,'If-None-Match':null,'OData-Version':_0xb8da('0x97')},'json':!![]};return rp(_0x41d6b2);})[_0xb8da('0x2a')](function(_0x5347cb){_0x3bff65=_0x5347cb;_0x517af9=_0x3bff65[_0xb8da('0x9b')];_0x517af9=_['remove'](_0x517af9,function(_0x3e5a1b){return!_0x2205c7[_0xb8da('0x9c')](_0x3e5a1b['LogicalName']);});var _0x528a1c=[];var _0x2c0085=[];_0x517af9[_0xb8da('0x9d')](function(_0x50abb3){if(_0x50abb3[_0xb8da('0x9e')]){var _0x295e6b=_0x50abb3['@odata.type']['substring'](_0x50abb3[_0xb8da('0x9e')][_0xb8da('0x43')]('.')+0x1);if(_0x295e6b===_0xb8da('0x9f')){_0x528a1c[_0xb8da('0xa0')](getSelectList(_0x52bb3b,_0x21aed3,_0x2c0085,_0x3bff65[_0xb8da('0x99')],_0x50abb3[_0xb8da('0x99')],_0x2db71d));}}});return Promise['all'](_0x528a1c);})[_0xb8da('0x2a')](function(_0x1cf3ad){_0x339350=_0x1cf3ad[0x0];var _0x30afa1=[];var _0x109cf7=[];_0x517af9['forEach'](function(_0xce3d02){if(!_['isNil'](_0xce3d02[_0xb8da('0x9e')])){var _0x2c29f0=_0xce3d02[_0xb8da('0x9e')]['substring'](_0xce3d02[_0xb8da('0x9e')][_0xb8da('0x43')]('.')+0x1);if(_0x2c29f0===_0xb8da('0xa1')){_0x30afa1[_0xb8da('0xa0')](getBooleanList(_0x52bb3b,_0x21aed3,_0x109cf7,_0x3bff65[_0xb8da('0x99')],_0xce3d02[_0xb8da('0x99')],_0x2db71d));}}});return Promise[_0xb8da('0xa2')](_0x30afa1);})[_0xb8da('0x2a')](function(_0x1ccb41){_0x315e9b=_0x1ccb41[0x0];var _0x5cafa2=[];var _0x39016e=[];_0x517af9[_0xb8da('0x9d')](function(_0x23d85f){if(_0x23d85f[_0xb8da('0x9e')]){var _0x4ced1f=_0x23d85f['@odata.type'][_0xb8da('0x42')](_0x23d85f[_0xb8da('0x9e')][_0xb8da('0x43')]('.')+0x1);if(_0x4ced1f===_0xb8da('0xa3')||_0x4ced1f===_0xb8da('0xa4')||_0x4ced1f==='BigIntAttributeMetadata'||_0x4ced1f===_0xb8da('0xa5')||_0x4ced1f===_0xb8da('0xa6')||_0x4ced1f===_0xb8da('0xa7')||_0x4ced1f===_0xb8da('0xa8')||_0x4ced1f===_0xb8da('0xa9')||_0x4ced1f===_0xb8da('0xaa')||_0x4ced1f===_0xb8da('0xab')){_0x5cafa2[_0xb8da('0xa0')](getInputList(_0x52bb3b,_0x21aed3,_0x4ced1f,_0x39016e,_0x3bff65['MetadataId'],_0x23d85f[_0xb8da('0x99')],_0x2db71d));}}});return Promise[_0xb8da('0xa2')](_0x5cafa2);})[_0xb8da('0x2a')](function(_0x33f86a){_0x5db801=_0x33f86a[0x0];var _0x513196=_0x339350[_0xb8da('0xac')](_0x315e9b)[_0xb8da('0xac')](_0x5db801);var _0x352d91={'count':_0x513196[_0xb8da('0x22')],'rows':_0x513196};return _0x352d91;})[_0xb8da('0x2a')](respondWithResult(_0xc52dfb,null))[_0xb8da('0x31')](function(_0x3cf813){var _0x2dc7bd=_0x2b3731[_0xb8da('0x1f')][_0xb8da('0xad')]?0x1f4:_0x3cf813[_0xb8da('0xae')]||0x1f4;logger[_0xb8da('0x11')](_0x3cf813[_0xb8da('0x12')]);delete _0x3cf813[_0xb8da('0x13')];if(_0x2dc7bd===0x191){_0x2dc7bd=0x190;}_0xc52dfb['status'](_0x2dc7bd)[_0xb8da('0x14')](_0x2b3731[_0xb8da('0x1f')][_0xb8da('0xad')]?{'message':_0xb8da('0xaf'),'statusCode':_0x3cf813[_0xb8da('0xae')]}:_0x3cf813);});};function getSelectList(_0x4cd02b,_0x4ed799,_0x47b002,_0x2870e2,_0x356948,_0x1dd4a6){var _0x15fda4={'method':'GET','uri':_0x4cd02b+_0xb8da('0x9a')+_0x2870e2+_0xb8da('0xb0')+_0x356948+_0xb8da('0xb1')+_0xb8da('0xb2'),'headers':{'Authorization':_0xb8da('0x96')+_0x1dd4a6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x15fda4)[_0xb8da('0x2a')](function(_0x3614cc){var _0x5b853c=[];var _0x25bead=_0x3614cc[_0xb8da('0xb3')][_0xb8da('0xb4')];_0x25bead['forEach'](function(_0x12bbbf){_0x5b853c['push']({'name':_0x12bbbf[_0xb8da('0xb5')][_0xb8da('0xb6')][_0xb8da('0xb5')],'value':String(_0x12bbbf[_0xb8da('0xb7')])});});var _0x3060cf={'id':_0x4ed799+'_'+_0x3614cc[_0xb8da('0xb8')],'name':_0x3614cc[_0xb8da('0xb9')][_0xb8da('0xb6')][_0xb8da('0xb5')],'custom':![],'options':_0x5b853c};_0x47b002[_0xb8da('0xa0')](_0x3060cf);return _0x47b002;});}function getBooleanList(_0x152348,_0x3ca257,_0x52bfee,_0x474d37,_0x2e577a,_0x283951){var _0x23b219={'method':_0xb8da('0x94'),'uri':_0x152348+_0xb8da('0x9a')+_0x474d37+_0xb8da('0xb0')+_0x2e577a+_0xb8da('0xba'),'headers':{'Authorization':_0xb8da('0x96')+_0x283951,'If-None-Match':null,'OData-Version':_0xb8da('0x97')},'json':!![]};return rp(_0x23b219)[_0xb8da('0x2a')](function(_0x64eec2){var _0xc6db8c=[];_0xc6db8c[_0xb8da('0xa0')]({'name':_0x64eec2['OptionSet'][_0xb8da('0xbb')]['Label'][_0xb8da('0xb6')][_0xb8da('0xb5')],'value':'true'},{'name':_0x64eec2[_0xb8da('0xb3')][_0xb8da('0xbc')][_0xb8da('0xb5')][_0xb8da('0xb6')]['Label'],'value':_0xb8da('0xbd')});var _0x45aabd={'id':_0x3ca257+'_'+_0x64eec2['LogicalName'],'name':_0x64eec2['DisplayName'][_0xb8da('0xb6')][_0xb8da('0xb5')],'custom':![],'options':_0xc6db8c};_0x52bfee[_0xb8da('0xa0')](_0x45aabd);return _0x52bfee;});}function getInputList(_0x3ae2f0,_0x45086d,_0x4c3b22,_0x32bee9,_0x160d0f,_0x551954,_0x22cef1){var _0x9fe299={'method':'GET','uri':_0x3ae2f0+_0xb8da('0x9a')+_0x160d0f+_0xb8da('0xb0')+_0x551954+_0xb8da('0xbe')+_0x4c3b22+_0xb8da('0xbf'),'headers':{'Authorization':_0xb8da('0x96')+_0x22cef1,'If-None-Match':null,'OData-Version':_0xb8da('0x97')},'json':!![]};return rp(_0x9fe299)[_0xb8da('0x2a')](function(_0x5c571c){var _0x4c3ac5={'id':_0x45086d+'_'+_0x5c571c[_0xb8da('0xb8')],'name':_0x5c571c[_0xb8da('0xb9')][_0xb8da('0xb6')]?_0x5c571c['DisplayName'][_0xb8da('0xb6')][_0xb8da('0xb5')]:_0x5c571c[_0xb8da('0xb8')],'custom':![],'options':[]};_0x32bee9['push'](_0x4c3ac5);return _0x32bee9;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 9ec4997..cbb7228 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x3a6a37,_0x30743f){var _0xd802a8=function(_0x343e9e){while(--_0x343e9e){_0x3a6a37['push'](_0x3a6a37['shift']());}};_0xd802a8(++_0x30743f);}(_0xe706,0xa3));var _0x6e70=function(_0x235e66,_0x4bef96){_0x235e66=_0x235e66-0x0;var _0x36019b=_0xe706[_0x235e66];return _0x36019b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'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 de4f412..c1f2438 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 _0x248d=['findAll','options','raw','where','attributes','limit','include','map','model','then','ShowDynamics365Account','Dynamics365Account','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account'];(function(_0x41a167,_0xd77177){var _0x4c8f73=function(_0x5495ea){while(--_0x5495ea){_0x41a167['push'](_0x41a167['shift']());}};_0x4c8f73(++_0xd77177);}(_0x248d,0x102));var _0xd248=function(_0x3b79aa,_0x380f92){_0x3b79aa=_0x3b79aa-0x0;var _0x3f5d04=_0x248d[_0x3b79aa];return _0x3f5d04;};'use strict';var _=require('lodash');var util=require(_0xd248('0x0'));var moment=require(_0xd248('0x1'));var BPromise=require(_0xd248('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd248('0x3'));var db=require(_0xd248('0x4'))['db'];var utils=require(_0xd248('0x5'));var logger=require('../../config/logger')(_0xd248('0x6'));var config=require(_0xd248('0x7'));var jayson=require(_0xd248('0x8'));var client=jayson[_0xd248('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c27bb,_0x49c012,_0x1b4cf2){return new BPromise(function(_0x4a1317,_0x49d8b6){return client['request'](_0x4c27bb,_0x1b4cf2)['then'](function(_0xf2827a){logger[_0xd248('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x49c012,_0xd248('0xb'));logger[_0xd248('0xc')](_0xd248('0xd'),_0x49c012,_0xd248('0xb'),JSON[_0xd248('0xe')](_0xf2827a));if(_0xf2827a[_0xd248('0xf')]){if(_0xf2827a[_0xd248('0xf')][_0xd248('0x10')]===0x1f4){logger['error'](_0xd248('0x11'),_0x49c012,_0xf2827a[_0xd248('0xf')][_0xd248('0x12')]);return _0x49d8b6(_0xf2827a['error'][_0xd248('0x12')]);}logger['error'](_0xd248('0x11'),_0x49c012,_0xf2827a[_0xd248('0xf')][_0xd248('0x12')]);return _0x4a1317(_0xf2827a[_0xd248('0xf')]['message']);}else{logger[_0xd248('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x49c012,_0xd248('0xb'));_0x4a1317(_0xf2827a[_0xd248('0x13')][_0xd248('0x12')]);}})[_0xd248('0x14')](function(_0x3342ed){logger[_0xd248('0xf')](_0xd248('0x11'),_0x49c012,_0x3342ed);_0x49d8b6(_0x3342ed);});});}exports[_0xd248('0x15')]=function(_0xa0a6a7){var _0x4d58be=this;return new Promise(function(_0x5d324c,_0x44a859){return db['Dynamics365Account'][_0xd248('0x16')]({'raw':_0xa0a6a7[_0xd248('0x17')]?_0xa0a6a7[_0xd248('0x17')][_0xd248('0x18')]===undefined?!![]:![]:!![],'where':_0xa0a6a7[_0xd248('0x17')]?_0xa0a6a7['options'][_0xd248('0x19')]||null:null,'attributes':_0xa0a6a7[_0xd248('0x17')]?_0xa0a6a7[_0xd248('0x17')][_0xd248('0x1a')]||null:null,'limit':_0xa0a6a7[_0xd248('0x17')]?_0xa0a6a7['options'][_0xd248('0x1b')]||null:null,'include':_0xa0a6a7[_0xd248('0x17')]?_0xa0a6a7[_0xd248('0x17')][_0xd248('0x1c')]?_[_0xd248('0x1d')](_0xa0a6a7[_0xd248('0x17')][_0xd248('0x1c')],function(_0x366705){return{'model':db[_0x366705[_0xd248('0x1e')]],'as':_0x366705['as'],'attributes':_0x366705['attributes'],'include':_0x366705[_0xd248('0x1c')]?_['map'](_0x366705['include'],function(_0x2545f2){return{'model':db[_0x2545f2[_0xd248('0x1e')]],'as':_0x2545f2['as'],'attributes':_0x2545f2[_0xd248('0x1a')],'include':_0x2545f2[_0xd248('0x1c')]?_[_0xd248('0x1d')](_0x2545f2[_0xd248('0x1c')],function(_0x3dda2a){return{'model':db[_0x3dda2a['model']],'as':_0x3dda2a['as'],'attributes':_0x3dda2a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd248('0x1f')](function(_0x2badd4){logger[_0xd248('0xa')](_0xd248('0x15'),_0xa0a6a7);logger[_0xd248('0xc')](_0xd248('0x15'),_0xa0a6a7,JSON[_0xd248('0xe')](_0x2badd4));_0x5d324c(_0x2badd4);})[_0xd248('0x14')](function(_0x31f87a){logger['error']('GetDynamics365Account',_0x31f87a[_0xd248('0x12')],_0xa0a6a7);_0x44a859(_0x4d58be['error'](0x1f4,_0x31f87a['message']));});});};exports[_0xd248('0x20')]=function(_0x522a5f){var _0x194f6b=this;return new Promise(function(_0x42f275,_0x32b072){return db[_0xd248('0x21')][_0xd248('0x22')]({'raw':_0x522a5f[_0xd248('0x17')]?_0x522a5f[_0xd248('0x17')][_0xd248('0x18')]===undefined?!![]:![]:!![],'where':_0x522a5f[_0xd248('0x17')]?_0x522a5f[_0xd248('0x17')]['where']||null:null,'attributes':_0x522a5f[_0xd248('0x17')]?_0x522a5f[_0xd248('0x17')][_0xd248('0x1a')]||null:null,'include':_0x522a5f[_0xd248('0x17')]?_0x522a5f[_0xd248('0x17')][_0xd248('0x1c')]?_[_0xd248('0x1d')](_0x522a5f[_0xd248('0x17')][_0xd248('0x1c')],function(_0x498d6c){return{'model':db[_0x498d6c[_0xd248('0x1e')]],'as':_0x498d6c['as'],'attributes':_0x498d6c[_0xd248('0x1a')],'include':_0x498d6c[_0xd248('0x1c')]?_['map'](_0x498d6c[_0xd248('0x1c')],function(_0x54ab44){return{'model':db[_0x54ab44[_0xd248('0x1e')]],'as':_0x54ab44['as'],'attributes':_0x54ab44[_0xd248('0x1a')],'include':_0x54ab44[_0xd248('0x1c')]?_[_0xd248('0x1d')](_0x54ab44[_0xd248('0x1c')],function(_0x184eb5){return{'model':db[_0x184eb5['model']],'as':_0x184eb5['as'],'attributes':_0x184eb5[_0xd248('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd248('0x1f')](function(_0x14734d){logger[_0xd248('0xa')](_0xd248('0x20'),_0x522a5f);logger['debug'](_0xd248('0x20'),_0x522a5f,JSON[_0xd248('0xe')](_0x14734d));_0x42f275(_0x14734d);})['catch'](function(_0x5d0098){logger['error'](_0xd248('0x20'),_0x5d0098[_0xd248('0x12')],_0x522a5f);_0x32b072(_0x194f6b[_0xd248('0xf')](0x1f4,_0x5d0098[_0xd248('0x12')]));});});}; \ No newline at end of file +var _0xccd5=['request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','findAll','options','where','attributes','limit','include','map','model','ShowDynamics365Account','Dynamics365Account','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x315cde,_0x3e18b9){var _0x2511c8=function(_0x2be458){while(--_0x2be458){_0x315cde['push'](_0x315cde['shift']());}};_0x2511c8(++_0x3e18b9);}(_0xccd5,0xc5));var _0x5ccd=function(_0x49ab20,_0x204482){_0x49ab20=_0x49ab20-0x0;var _0x3c10b4=_0xccd5[_0x49ab20];return _0x3c10b4;};'use strict';var _=require('lodash');var util=require(_0x5ccd('0x0'));var moment=require('moment');var BPromise=require(_0x5ccd('0x1'));var rs=require(_0x5ccd('0x2'));var fs=require('fs');var Redis=require(_0x5ccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ccd('0x4'));var logger=require('../../config/logger')(_0x5ccd('0x5'));var config=require(_0x5ccd('0x6'));var jayson=require(_0x5ccd('0x7'));var client=jayson[_0x5ccd('0x8')][_0x5ccd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143804,_0x27ec41,_0x172490){return new BPromise(function(_0x430683,_0x445b84){return client[_0x5ccd('0xa')](_0x143804,_0x172490)[_0x5ccd('0xb')](function(_0x4bbbba){logger[_0x5ccd('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x27ec41,_0x5ccd('0xd'));logger[_0x5ccd('0xe')](_0x5ccd('0xf'),_0x27ec41,_0x5ccd('0xd'),JSON[_0x5ccd('0x10')](_0x4bbbba));if(_0x4bbbba[_0x5ccd('0x11')]){if(_0x4bbbba[_0x5ccd('0x11')]['code']===0x1f4){logger[_0x5ccd('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x27ec41,_0x4bbbba[_0x5ccd('0x11')]['message']);return _0x445b84(_0x4bbbba['error'][_0x5ccd('0x12')]);}logger[_0x5ccd('0x11')](_0x5ccd('0x13'),_0x27ec41,_0x4bbbba[_0x5ccd('0x11')][_0x5ccd('0x12')]);return _0x430683(_0x4bbbba[_0x5ccd('0x11')]['message']);}else{logger[_0x5ccd('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x27ec41,_0x5ccd('0xd'));_0x430683(_0x4bbbba[_0x5ccd('0x14')][_0x5ccd('0x12')]);}})[_0x5ccd('0x15')](function(_0x4c0049){logger[_0x5ccd('0x11')](_0x5ccd('0x13'),_0x27ec41,_0x4c0049);_0x445b84(_0x4c0049);});});}exports[_0x5ccd('0x16')]=function(_0x13d1dd){var _0x57b5d3=this;return new Promise(function(_0x2a6913,_0x2255f8){return db['Dynamics365Account'][_0x5ccd('0x17')]({'raw':_0x13d1dd[_0x5ccd('0x18')]?_0x13d1dd['options']['raw']===undefined?!![]:![]:!![],'where':_0x13d1dd[_0x5ccd('0x18')]?_0x13d1dd['options'][_0x5ccd('0x19')]||null:null,'attributes':_0x13d1dd[_0x5ccd('0x18')]?_0x13d1dd[_0x5ccd('0x18')][_0x5ccd('0x1a')]||null:null,'limit':_0x13d1dd[_0x5ccd('0x18')]?_0x13d1dd['options'][_0x5ccd('0x1b')]||null:null,'include':_0x13d1dd[_0x5ccd('0x18')]?_0x13d1dd[_0x5ccd('0x18')][_0x5ccd('0x1c')]?_[_0x5ccd('0x1d')](_0x13d1dd[_0x5ccd('0x18')]['include'],function(_0x4ce5f5){return{'model':db[_0x4ce5f5[_0x5ccd('0x1e')]],'as':_0x4ce5f5['as'],'attributes':_0x4ce5f5['attributes'],'include':_0x4ce5f5[_0x5ccd('0x1c')]?_[_0x5ccd('0x1d')](_0x4ce5f5[_0x5ccd('0x1c')],function(_0x73b0c2){return{'model':db[_0x73b0c2['model']],'as':_0x73b0c2['as'],'attributes':_0x73b0c2['attributes'],'include':_0x73b0c2[_0x5ccd('0x1c')]?_[_0x5ccd('0x1d')](_0x73b0c2[_0x5ccd('0x1c')],function(_0x2333d4){return{'model':db[_0x2333d4[_0x5ccd('0x1e')]],'as':_0x2333d4['as'],'attributes':_0x2333d4[_0x5ccd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5ccd('0xb')](function(_0x28e62e){logger['info'](_0x5ccd('0x16'),_0x13d1dd);logger[_0x5ccd('0xe')](_0x5ccd('0x16'),_0x13d1dd,JSON['stringify'](_0x28e62e));_0x2a6913(_0x28e62e);})[_0x5ccd('0x15')](function(_0xb88277){logger[_0x5ccd('0x11')]('GetDynamics365Account',_0xb88277[_0x5ccd('0x12')],_0x13d1dd);_0x2255f8(_0x57b5d3[_0x5ccd('0x11')](0x1f4,_0xb88277[_0x5ccd('0x12')]));});});};exports[_0x5ccd('0x1f')]=function(_0x27ddc2){var _0x3c2c9b=this;return new Promise(function(_0xa77eb,_0x2ae10c){return db[_0x5ccd('0x20')][_0x5ccd('0x21')]({'raw':_0x27ddc2[_0x5ccd('0x18')]?_0x27ddc2['options'][_0x5ccd('0x22')]===undefined?!![]:![]:!![],'where':_0x27ddc2['options']?_0x27ddc2[_0x5ccd('0x18')][_0x5ccd('0x19')]||null:null,'attributes':_0x27ddc2[_0x5ccd('0x18')]?_0x27ddc2[_0x5ccd('0x18')]['attributes']||null:null,'include':_0x27ddc2[_0x5ccd('0x18')]?_0x27ddc2[_0x5ccd('0x18')]['include']?_[_0x5ccd('0x1d')](_0x27ddc2[_0x5ccd('0x18')][_0x5ccd('0x1c')],function(_0x3899f9){return{'model':db[_0x3899f9['model']],'as':_0x3899f9['as'],'attributes':_0x3899f9[_0x5ccd('0x1a')],'include':_0x3899f9[_0x5ccd('0x1c')]?_['map'](_0x3899f9[_0x5ccd('0x1c')],function(_0xe2b658){return{'model':db[_0xe2b658[_0x5ccd('0x1e')]],'as':_0xe2b658['as'],'attributes':_0xe2b658[_0x5ccd('0x1a')],'include':_0xe2b658[_0x5ccd('0x1c')]?_['map'](_0xe2b658[_0x5ccd('0x1c')],function(_0x14f1a9){return{'model':db[_0x14f1a9[_0x5ccd('0x1e')]],'as':_0x14f1a9['as'],'attributes':_0x14f1a9[_0x5ccd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x530da6){logger[_0x5ccd('0xc')]('ShowDynamics365Account',_0x27ddc2);logger[_0x5ccd('0xe')](_0x5ccd('0x1f'),_0x27ddc2,JSON[_0x5ccd('0x10')](_0x530da6));_0xa77eb(_0x530da6);})[_0x5ccd('0x15')](function(_0x78518e){logger['error']('ShowDynamics365Account',_0x78518e[_0x5ccd('0x12')],_0x27ddc2);_0x2ae10c(_0x3c2c9b[_0x5ccd('0x11')](0x1f4,_0x78518e[_0x5ccd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3cfe2ff..5b2f0bf 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 _0x53aa=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer'];(function(_0x53d0ab,_0x32774c){var _0x3eae64=function(_0x4004c1){while(--_0x4004c1){_0x53d0ab['push'](_0x53d0ab['shift']());}};_0x3eae64(++_0x32774c);}(_0x53aa,0x167));var _0xa53a=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x53aa[_0x1477ef];return _0x164acd;};'use strict';var multer=require(_0xa53a('0x0'));var util=require(_0xa53a('0x1'));var path=require(_0xa53a('0x2'));var timeout=require(_0xa53a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa53a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa53a('0x5'));var config=require(_0xa53a('0x6'));var controller=require(_0xa53a('0x7'));router[_0xa53a('0x8')]('/',auth[_0xa53a('0x9')](),controller['index']);router[_0xa53a('0x8')](_0xa53a('0xa'),auth['isAuthenticated'](),controller[_0xa53a('0xb')]);router[_0xa53a('0x8')](_0xa53a('0xc'),auth['isAuthenticated'](),controller[_0xa53a('0xd')]);router['get'](_0xa53a('0xe'),auth[_0xa53a('0x9')](),controller[_0xa53a('0xf')]);router[_0xa53a('0x8')](_0xa53a('0x10'),auth[_0xa53a('0x9')](),controller[_0xa53a('0x11')]);router[_0xa53a('0x12')]('/',auth[_0xa53a('0x9')](),controller['create']);router[_0xa53a('0x13')]('/:id',auth[_0xa53a('0x9')](),controller[_0xa53a('0x14')]);router[_0xa53a('0x15')](_0xa53a('0xa'),auth[_0xa53a('0x9')](),controller[_0xa53a('0x16')]);module[_0xa53a('0x17')]=router; \ No newline at end of file +var _0x68b1=['getDescriptions','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects'];(function(_0x4b1b3a,_0x239438){var _0x203002=function(_0x2de54f){while(--_0x2de54f){_0x4b1b3a['push'](_0x4b1b3a['shift']());}};_0x203002(++_0x239438);}(_0x68b1,0x13a));var _0x168b=function(_0x459ee0,_0x3bc3c9){_0x459ee0=_0x459ee0-0x0;var _0x16e7d7=_0x68b1[_0x459ee0];return _0x16e7d7;};'use strict';var multer=require(_0x168b('0x0'));var util=require(_0x168b('0x1'));var path=require(_0x168b('0x2'));var timeout=require(_0x168b('0x3'));var express=require(_0x168b('0x4'));var router=express[_0x168b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x168b('0x6'));var config=require(_0x168b('0x7'));var controller=require(_0x168b('0x8'));router[_0x168b('0x9')]('/',auth[_0x168b('0xa')](),controller[_0x168b('0xb')]);router['get'](_0x168b('0xc'),auth[_0x168b('0xa')](),controller[_0x168b('0xd')]);router[_0x168b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x168b('0xe')]);router[_0x168b('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x168b('0xf')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x168b('0x10')]);router[_0x168b('0x11')]('/',auth[_0x168b('0xa')](),controller['create']);router['put']('/:id',auth[_0x168b('0xa')](),controller[_0x168b('0x12')]);router[_0x168b('0x13')](_0x168b('0xc'),auth['isAuthenticated'](),controller[_0x168b('0x14')]);module[_0x168b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 742349b..8d210a6 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 _0x19eb=['phonecall','contact','sequelize','exports','STRING','ENUM'];(function(_0x223aa8,_0x2cc617){var _0x33545d=function(_0x144e61){while(--_0x144e61){_0x223aa8['push'](_0x223aa8['shift']());}};_0x33545d(++_0x2cc617);}(_0x19eb,0xe0));var _0xb19e=function(_0x45f0ab,_0x166cd2){_0x45f0ab=_0x45f0ab-0x0;var _0x53e0ee=_0x19eb[_0x45f0ab];return _0x53e0ee;};'use strict';var Sequelize=require(_0xb19e('0x0'));module[_0xb19e('0x1')]={'name':{'type':Sequelize[_0xb19e('0x2')]},'description':{'type':Sequelize[_0xb19e('0x2')]},'ticketType':{'type':Sequelize[_0xb19e('0x3')]('incident',_0xb19e('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xb19e('0x3')](_0xb19e('0x5'),'nothing'),'defaultValue':_0xb19e('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x8add=['contact','nothing','exports','STRING','ENUM','incident','phonecall'];(function(_0x2fb62a,_0x4e64de){var _0x148c6b=function(_0x3df7c6){while(--_0x3df7c6){_0x2fb62a['push'](_0x2fb62a['shift']());}};_0x148c6b(++_0x4e64de);}(_0x8add,0x1ad));var _0xd8ad=function(_0xa85db4,_0x20f2ed){_0xa85db4=_0xa85db4-0x0;var _0x22b22e=_0x8add[_0xa85db4];return _0x22b22e;};'use strict';var Sequelize=require('sequelize');module[_0xd8ad('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8ad('0x1')]},'ticketType':{'type':Sequelize[_0xd8ad('0x2')](_0xd8ad('0x3'),_0xd8ad('0x4')),'defaultValue':_0xd8ad('0x3')},'moduleCreate':{'type':Sequelize[_0xd8ad('0x2')](_0xd8ad('0x5'),_0xd8ad('0x6')),'defaultValue':_0xd8ad('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index f232505..9646fc9 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 _0x9d01=['set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit'];(function(_0x144553,_0x5a3c62){var _0x20ca47=function(_0x5854ed){while(--_0x5854ed){_0x144553['push'](_0x144553['shift']());}};_0x20ca47(++_0x5a3c62);}(_0x9d01,0x17a));var _0x19d0=function(_0x470d22,_0x1b6a4f){_0x470d22=_0x470d22-0x0;var _0x3cc44d=_0x9d01[_0x470d22];return _0x3cc44d;};'use strict';var emlformat=require(_0x19d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19d0('0x1'));var jsonpatch=require(_0x19d0('0x2'));var rp=require(_0x19d0('0x3'));var moment=require(_0x19d0('0x4'));var BPromise=require(_0x19d0('0x5'));var Mustache=require(_0x19d0('0x6'));var util=require('util');var path=require(_0x19d0('0x7'));var sox=require(_0x19d0('0x8'));var csv=require(_0x19d0('0x9'));var ejs=require(_0x19d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19d0('0xb'));var squel=require('squel');var crypto=require(_0x19d0('0xc'));var jsforce=require(_0x19d0('0xd'));var deskjs=require(_0x19d0('0xe'));var toCsv=require(_0x19d0('0x9'));var querystring=require(_0x19d0('0xf'));var Papa=require(_0x19d0('0x10'));var Redis=require(_0x19d0('0x11'));var authService=require(_0x19d0('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x19d0('0x13'))(_0x19d0('0x14'));var utils=require(_0x19d0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x19d0('0x16'));var db=require(_0x19d0('0x17'))['db'];function respondWithStatusCode(_0x2f8e93,_0x1b4526){_0x1b4526=_0x1b4526||0xcc;return function(_0x4676b2){if(_0x4676b2){return _0x2f8e93[_0x19d0('0x18')](_0x1b4526);}return _0x2f8e93['status'](_0x1b4526)[_0x19d0('0x19')]();};}function respondWithResult(_0x3957fd,_0x5ba160){_0x5ba160=_0x5ba160||0xc8;return function(_0x2da7a0){if(_0x2da7a0){return _0x3957fd[_0x19d0('0x1a')](_0x5ba160)[_0x19d0('0x1b')](_0x2da7a0);}};}function respondWithFilteredResult(_0x59590d,_0x1384ff){return function(_0x1c1715){if(_0x1c1715){var _0x56fb92=typeof _0x1384ff['offset']===_0x19d0('0x1c')&&typeof _0x1384ff['limit']===_0x19d0('0x1c');var _0x1baa4c=_0x1c1715['count'];var _0x418def=_0x56fb92?0x0:_0x1384ff[_0x19d0('0x1d')];var _0x4f3dd2=_0x56fb92?_0x1c1715[_0x19d0('0x1e')]:_0x1384ff[_0x19d0('0x1d')]+_0x1384ff[_0x19d0('0x1f')];var _0x36d059;if(_0x4f3dd2>=_0x1baa4c){_0x4f3dd2=_0x1baa4c;_0x36d059=0xc8;}else{_0x36d059=0xce;}_0x59590d[_0x19d0('0x1a')](_0x36d059);return _0x59590d[_0x19d0('0x20')](_0x19d0('0x21'),_0x418def+'-'+_0x4f3dd2+'/'+_0x1baa4c)[_0x19d0('0x1b')](_0x1c1715);}return null;};}function patchUpdates(_0x46cfc6){return function(_0x436ac2){try{jsonpatch[_0x19d0('0x22')](_0x436ac2,_0x46cfc6,!![]);}catch(_0x1edc34){return BPromise[_0x19d0('0x23')](_0x1edc34);}return _0x436ac2[_0x19d0('0x24')]();};}function saveUpdates(_0x534d32,_0x3163f6){return function(_0x3548ef){if(_0x3548ef){return _0x3548ef[_0x19d0('0x25')](_0x534d32)[_0x19d0('0x26')](function(_0x467a66){return _0x467a66;});}return null;};}function removeEntity(_0x3e46d9,_0x1b7522){return function(_0x244b22){if(_0x244b22){return _0x244b22[_0x19d0('0x27')]()[_0x19d0('0x26')](function(){_0x3e46d9[_0x19d0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44863e,_0x487ca3){return function(_0x40fc78){if(!_0x40fc78){_0x44863e[_0x19d0('0x18')](0x194);}return _0x40fc78;};}function handleError(_0x36e2e8,_0x37d12b){_0x37d12b=_0x37d12b||0x1f4;return function(_0xaf5fb6){logger['error'](_0xaf5fb6[_0x19d0('0x28')]);if(_0xaf5fb6['name']){delete _0xaf5fb6[_0x19d0('0x29')];}_0x36e2e8[_0x19d0('0x1a')](_0x37d12b)[_0x19d0('0x2a')](_0xaf5fb6);};}exports[_0x19d0('0x2b')]=function(_0x28c3e3,_0x528744){var _0x3de63d={},_0x76ad8b={},_0x3e7454={'count':0x0,'rows':[]};var _0x276307=_[_0x19d0('0x2c')](db[_0x19d0('0x2d')][_0x19d0('0x2e')],function(_0x26ac44){return{'name':_0x26ac44[_0x19d0('0x2f')],'type':_0x26ac44[_0x19d0('0x30')][_0x19d0('0x31')]};});_0x76ad8b[_0x19d0('0x32')]=_[_0x19d0('0x2c')](_0x276307,'name');_0x76ad8b[_0x19d0('0x33')]=_[_0x19d0('0x34')](_0x28c3e3[_0x19d0('0x33')]);_0x76ad8b[_0x19d0('0x35')]=_[_0x19d0('0x36')](_0x76ad8b['model'],_0x76ad8b[_0x19d0('0x33')]);_0x3de63d[_0x19d0('0x37')]=_[_0x19d0('0x36')](_0x76ad8b[_0x19d0('0x32')],qs['fields'](_0x28c3e3[_0x19d0('0x33')][_0x19d0('0x38')]));_0x3de63d['attributes']=_0x3de63d[_0x19d0('0x37')][_0x19d0('0x39')]?_0x3de63d['attributes']:_0x76ad8b[_0x19d0('0x32')];if(!_0x28c3e3[_0x19d0('0x33')][_0x19d0('0x3a')](_0x19d0('0x3b'))){_0x3de63d[_0x19d0('0x1f')]=qs[_0x19d0('0x1f')](_0x28c3e3[_0x19d0('0x33')][_0x19d0('0x1f')]);_0x3de63d[_0x19d0('0x1d')]=qs[_0x19d0('0x1d')](_0x28c3e3[_0x19d0('0x33')]['offset']);}_0x3de63d[_0x19d0('0x3c')]=qs['sort'](_0x28c3e3['query'][_0x19d0('0x3d')]);_0x3de63d[_0x19d0('0x3e')]=qs[_0x19d0('0x35')](_[_0x19d0('0x3f')](_0x28c3e3[_0x19d0('0x33')],_0x76ad8b[_0x19d0('0x35')]),_0x276307);if(_0x28c3e3[_0x19d0('0x33')][_0x19d0('0x40')]){_0x3de63d['where']=_['merge'](_0x3de63d['where'],{'$or':_[_0x19d0('0x2c')](_0x276307,function(_0x1796e7){if(_0x1796e7['type']!=='VIRTUAL'){var _0x364bc0={};_0x364bc0[_0x1796e7[_0x19d0('0x29')]]={'$like':'%'+_0x28c3e3[_0x19d0('0x33')]['filter']+'%'};return _0x364bc0;}})});}_0x3de63d=_[_0x19d0('0x41')]({},_0x3de63d,_0x28c3e3['options']);var _0x5d56f2={'where':_0x3de63d[_0x19d0('0x3e')]};return db[_0x19d0('0x2d')]['count'](_0x5d56f2)[_0x19d0('0x26')](function(_0x4f6ba3){_0x3e7454[_0x19d0('0x1e')]=_0x4f6ba3;if(_0x28c3e3[_0x19d0('0x33')][_0x19d0('0x42')]){_0x3de63d[_0x19d0('0x43')]=[{'all':!![]}];}return db[_0x19d0('0x2d')][_0x19d0('0x44')](_0x3de63d);})[_0x19d0('0x26')](function(_0x265ede){_0x3e7454[_0x19d0('0x45')]=_0x265ede;return _0x3e7454;})[_0x19d0('0x26')](respondWithFilteredResult(_0x528744,_0x3de63d))[_0x19d0('0x46')](handleError(_0x528744,null));};exports[_0x19d0('0x47')]=function(_0x414147,_0x4d7fff){var _0x2cccb0={'raw':![],'where':{'id':_0x414147[_0x19d0('0x48')]['id']}},_0x588824={};_0x588824[_0x19d0('0x32')]=_[_0x19d0('0x34')](db[_0x19d0('0x2d')][_0x19d0('0x2e')]);_0x588824['query']=_[_0x19d0('0x34')](_0x414147[_0x19d0('0x33')]);_0x588824[_0x19d0('0x35')]=_[_0x19d0('0x36')](_0x588824['model'],_0x588824[_0x19d0('0x33')]);_0x2cccb0[_0x19d0('0x37')]=_['intersection'](_0x588824[_0x19d0('0x32')],qs[_0x19d0('0x38')](_0x414147[_0x19d0('0x33')][_0x19d0('0x38')]));_0x2cccb0[_0x19d0('0x37')]=_0x2cccb0[_0x19d0('0x37')]['length']?_0x2cccb0['attributes']:_0x588824['model'];if(_0x414147[_0x19d0('0x33')][_0x19d0('0x42')]){_0x2cccb0[_0x19d0('0x43')]=[{'all':!![]}];}_0x2cccb0=_[_0x19d0('0x41')]({},_0x2cccb0,_0x414147[_0x19d0('0x49')]);return db[_0x19d0('0x2d')][_0x19d0('0x4a')](_0x2cccb0)[_0x19d0('0x26')](handleEntityNotFound(_0x4d7fff,null))[_0x19d0('0x26')](respondWithResult(_0x4d7fff,null))[_0x19d0('0x46')](handleError(_0x4d7fff,null));};exports['create']=function(_0x2b8765,_0x45776b){return db[_0x19d0('0x2d')][_0x19d0('0x4b')](_0x2b8765['body'],{})[_0x19d0('0x26')](respondWithResult(_0x45776b,0xc9))[_0x19d0('0x46')](handleError(_0x45776b,null));};exports[_0x19d0('0x25')]=function(_0x5e2535,_0x173ad5){if(_0x5e2535[_0x19d0('0x4c')]['id']){delete _0x5e2535[_0x19d0('0x4c')]['id'];}return db[_0x19d0('0x2d')][_0x19d0('0x4a')]({'where':{'id':_0x5e2535[_0x19d0('0x48')]['id']}})['then'](handleEntityNotFound(_0x173ad5,null))[_0x19d0('0x26')](saveUpdates(_0x5e2535[_0x19d0('0x4c')],null))[_0x19d0('0x26')](respondWithResult(_0x173ad5,null))['catch'](handleError(_0x173ad5,null));};exports[_0x19d0('0x27')]=function(_0x3759f6,_0x5de5e8){return db[_0x19d0('0x2d')][_0x19d0('0x4a')]({'where':{'id':_0x3759f6['params']['id']}})['then'](handleEntityNotFound(_0x5de5e8,null))[_0x19d0('0x26')](removeEntity(_0x5de5e8,null))[_0x19d0('0x46')](handleError(_0x5de5e8,null));};exports['getFields']=function(_0x1fc244,_0x4852e8,_0x478e63){var _0x4e232b={};var _0x365d2b={};var _0x2251da;var _0x57473b;return db['Dynamics365Configuration'][_0x19d0('0x4d')]({'where':{'id':_0x1fc244[_0x19d0('0x48')]['id']}})[_0x19d0('0x26')](handleEntityNotFound(_0x4852e8,null))[_0x19d0('0x26')](function(_0x1bed4c){if(_0x1bed4c){_0x2251da=_0x1bed4c;_0x365d2b[_0x19d0('0x32')]=_[_0x19d0('0x34')](db[_0x19d0('0x4e')][_0x19d0('0x2e')]);_0x365d2b[_0x19d0('0x33')]=_[_0x19d0('0x34')](_0x1fc244['query']);_0x365d2b[_0x19d0('0x35')]=_[_0x19d0('0x36')](_0x365d2b[_0x19d0('0x32')],_0x365d2b[_0x19d0('0x33')]);_0x4e232b['attributes']=_[_0x19d0('0x36')](_0x365d2b['model'],qs['fields'](_0x1fc244[_0x19d0('0x33')][_0x19d0('0x38')]));_0x4e232b[_0x19d0('0x37')]=_0x4e232b[_0x19d0('0x37')]['length']?_0x4e232b[_0x19d0('0x37')]:_0x365d2b['model'];_0x4e232b[_0x19d0('0x3c')]=qs[_0x19d0('0x3d')](_0x1fc244[_0x19d0('0x33')][_0x19d0('0x3d')]);_0x4e232b[_0x19d0('0x3e')]=qs[_0x19d0('0x35')](_[_0x19d0('0x3f')](_0x1fc244['query'],_0x365d2b[_0x19d0('0x35')]));if(_0x1fc244[_0x19d0('0x33')][_0x19d0('0x40')]){_0x4e232b[_0x19d0('0x3e')]=_[_0x19d0('0x41')](_0x4e232b['where'],{'$or':_[_0x19d0('0x2c')](_0x4e232b[_0x19d0('0x37')],function(_0x1bf19a){var _0xb6117f={};_0xb6117f[_0x1bf19a]={'$like':'%'+_0x1fc244['query'][_0x19d0('0x40')]+'%'};return _0xb6117f;})});}_0x4e232b=_[_0x19d0('0x41')]({},_0x4e232b,_0x1fc244[_0x19d0('0x49')]);return _0x2251da[_0x19d0('0x4f')](_0x4e232b);}})[_0x19d0('0x26')](function(_0xbe300d){if(_0xbe300d){_0x57473b=_0xbe300d[_0x19d0('0x39')];if(!_0x1fc244[_0x19d0('0x33')]['hasOwnProperty'](_0x19d0('0x3b'))){_0x4e232b['limit']=qs['limit'](_0x1fc244[_0x19d0('0x33')][_0x19d0('0x1f')]);_0x4e232b[_0x19d0('0x1d')]=qs[_0x19d0('0x1d')](_0x1fc244[_0x19d0('0x33')][_0x19d0('0x1d')]);}return _0x2251da[_0x19d0('0x4f')](_0x4e232b);}})['then'](function(_0x3b1abb){if(_0x3b1abb){return _0x3b1abb?{'count':_0x57473b,'rows':_0x3b1abb}:null;}})[_0x19d0('0x26')](respondWithResult(_0x4852e8,null))[_0x19d0('0x46')](handleError(_0x4852e8,null));};exports[_0x19d0('0x50')]=function(_0x255e28,_0x113ca1,_0x258f83){var _0xbed277={};var _0x715494={};var _0x2d5f14;var _0x2f15da;return db['Dynamics365Configuration'][_0x19d0('0x4d')]({'where':{'id':_0x255e28[_0x19d0('0x48')]['id']}})[_0x19d0('0x26')](handleEntityNotFound(_0x113ca1,null))[_0x19d0('0x26')](function(_0x8803c3){if(_0x8803c3){_0x2d5f14=_0x8803c3;_0x715494[_0x19d0('0x32')]=_[_0x19d0('0x34')](db[_0x19d0('0x4e')][_0x19d0('0x2e')]);_0x715494[_0x19d0('0x33')]=_[_0x19d0('0x34')](_0x255e28[_0x19d0('0x33')]);_0x715494['filters']=_[_0x19d0('0x36')](_0x715494['model'],_0x715494['query']);_0xbed277['attributes']=_['intersection'](_0x715494[_0x19d0('0x32')],qs[_0x19d0('0x38')](_0x255e28[_0x19d0('0x33')]['fields']));_0xbed277[_0x19d0('0x37')]=_0xbed277[_0x19d0('0x37')][_0x19d0('0x39')]?_0xbed277[_0x19d0('0x37')]:_0x715494[_0x19d0('0x32')];_0xbed277[_0x19d0('0x3c')]=qs[_0x19d0('0x3d')](_0x255e28[_0x19d0('0x33')][_0x19d0('0x3d')]);_0xbed277[_0x19d0('0x3e')]=qs[_0x19d0('0x35')](_[_0x19d0('0x3f')](_0x255e28['query'],_0x715494[_0x19d0('0x35')]));if(_0x255e28[_0x19d0('0x33')][_0x19d0('0x40')]){_0xbed277[_0x19d0('0x3e')]=_[_0x19d0('0x41')](_0xbed277[_0x19d0('0x3e')],{'$or':_[_0x19d0('0x2c')](_0xbed277[_0x19d0('0x37')],function(_0x1955cf){var _0x5a986e={};_0x5a986e[_0x1955cf]={'$like':'%'+_0x255e28['query'][_0x19d0('0x40')]+'%'};return _0x5a986e;})});}_0xbed277=_[_0x19d0('0x41')]({},_0xbed277,_0x255e28[_0x19d0('0x49')]);return _0x2d5f14['getSubjects'](_0xbed277);}})['then'](function(_0x286dcb){if(_0x286dcb){_0x2f15da=_0x286dcb['length'];if(!_0x255e28[_0x19d0('0x33')][_0x19d0('0x3a')](_0x19d0('0x3b'))){_0xbed277[_0x19d0('0x1f')]=qs[_0x19d0('0x1f')](_0x255e28['query']['limit']);_0xbed277[_0x19d0('0x1d')]=qs['offset'](_0x255e28[_0x19d0('0x33')][_0x19d0('0x1d')]);}return _0x2d5f14[_0x19d0('0x50')](_0xbed277);}})[_0x19d0('0x26')](function(_0x5b8c2f){if(_0x5b8c2f){return _0x5b8c2f?{'count':_0x2f15da,'rows':_0x5b8c2f}:null;}})[_0x19d0('0x26')](respondWithResult(_0x113ca1,null))['catch'](handleError(_0x113ca1,null));};exports['getDescriptions']=function(_0xf09063,_0x50605a,_0x28d25f){var _0x5316bb={};var _0x317925={};var _0x536849;var _0x5de9d2;return db[_0x19d0('0x2d')]['findOne']({'where':{'id':_0xf09063[_0x19d0('0x48')]['id']}})['then'](handleEntityNotFound(_0x50605a,null))[_0x19d0('0x26')](function(_0x13af8f){if(_0x13af8f){_0x536849=_0x13af8f;_0x317925[_0x19d0('0x32')]=_[_0x19d0('0x34')](db[_0x19d0('0x4e')][_0x19d0('0x2e')]);_0x317925[_0x19d0('0x33')]=_[_0x19d0('0x34')](_0xf09063[_0x19d0('0x33')]);_0x317925[_0x19d0('0x35')]=_[_0x19d0('0x36')](_0x317925[_0x19d0('0x32')],_0x317925[_0x19d0('0x33')]);_0x5316bb[_0x19d0('0x37')]=_[_0x19d0('0x36')](_0x317925[_0x19d0('0x32')],qs[_0x19d0('0x38')](_0xf09063[_0x19d0('0x33')]['fields']));_0x5316bb['attributes']=_0x5316bb['attributes'][_0x19d0('0x39')]?_0x5316bb['attributes']:_0x317925['model'];_0x5316bb[_0x19d0('0x3c')]=qs[_0x19d0('0x3d')](_0xf09063['query'][_0x19d0('0x3d')]);_0x5316bb['where']=qs[_0x19d0('0x35')](_[_0x19d0('0x3f')](_0xf09063[_0x19d0('0x33')],_0x317925[_0x19d0('0x35')]));if(_0xf09063['query']['filter']){_0x5316bb['where']=_[_0x19d0('0x41')](_0x5316bb[_0x19d0('0x3e')],{'$or':_[_0x19d0('0x2c')](_0x5316bb[_0x19d0('0x37')],function(_0x4a9951){var _0x104ea1={};_0x104ea1[_0x4a9951]={'$like':'%'+_0xf09063[_0x19d0('0x33')][_0x19d0('0x40')]+'%'};return _0x104ea1;})});}_0x5316bb=_['merge']({},_0x5316bb,_0xf09063[_0x19d0('0x49')]);return _0x536849[_0x19d0('0x51')](_0x5316bb);}})[_0x19d0('0x26')](function(_0x54c046){if(_0x54c046){_0x5de9d2=_0x54c046['length'];if(!_0xf09063[_0x19d0('0x33')]['hasOwnProperty'](_0x19d0('0x3b'))){_0x5316bb[_0x19d0('0x1f')]=qs['limit'](_0xf09063[_0x19d0('0x33')][_0x19d0('0x1f')]);_0x5316bb['offset']=qs[_0x19d0('0x1d')](_0xf09063['query']['offset']);}return _0x536849[_0x19d0('0x51')](_0x5316bb);}})[_0x19d0('0x26')](function(_0x1dff34){if(_0x1dff34){return _0x1dff34?{'count':_0x5de9d2,'rows':_0x1dff34}:null;}})[_0x19d0('0x26')](respondWithResult(_0x50605a,null))[_0x19d0('0x46')](handleError(_0x50605a,null));}; \ No newline at end of file +var _0xef8d=['model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','fields','include','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','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','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key'];(function(_0x101176,_0x1ad975){var _0x4ec27c=function(_0x13b7bb){while(--_0x13b7bb){_0x101176['push'](_0x101176['shift']());}};_0x4ec27c(++_0x1ad975);}(_0xef8d,0x14f));var _0xdef8=function(_0x56c313,_0x4acb15){_0x56c313=_0x56c313-0x0;var _0x12987d=_0xef8d[_0x56c313];return _0x12987d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdef8('0x0'));var zipdir=require(_0xdef8('0x1'));var jsonpatch=require(_0xdef8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdef8('0x3'));var Mustache=require(_0xdef8('0x4'));var util=require(_0xdef8('0x5'));var path=require(_0xdef8('0x6'));var sox=require('sox');var csv=require(_0xdef8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdef8('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdef8('0x9'));var deskjs=require(_0xdef8('0xa'));var toCsv=require(_0xdef8('0x7'));var querystring=require(_0xdef8('0xb'));var Papa=require(_0xdef8('0xc'));var Redis=require(_0xdef8('0xd'));var authService=require(_0xdef8('0xe'));var qs=require(_0xdef8('0xf'));var as=require(_0xdef8('0x10'));var hardwareService=require(_0xdef8('0x11'));var logger=require('../../config/logger')(_0xdef8('0x12'));var utils=require(_0xdef8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdef8('0x14'));var db=require(_0xdef8('0x15'))['db'];function respondWithStatusCode(_0x19e96a,_0x215f6c){_0x215f6c=_0x215f6c||0xcc;return function(_0x565f12){if(_0x565f12){return _0x19e96a[_0xdef8('0x16')](_0x215f6c);}return _0x19e96a[_0xdef8('0x17')](_0x215f6c)['end']();};}function respondWithResult(_0x55876e,_0x5658ff){_0x5658ff=_0x5658ff||0xc8;return function(_0x25cacf){if(_0x25cacf){return _0x55876e[_0xdef8('0x17')](_0x5658ff)[_0xdef8('0x18')](_0x25cacf);}};}function respondWithFilteredResult(_0xea5dba,_0x5d967d){return function(_0x1274ae){if(_0x1274ae){var _0x20e3f2=typeof _0x5d967d['offset']===_0xdef8('0x19')&&typeof _0x5d967d[_0xdef8('0x1a')]===_0xdef8('0x19');var _0x152bc3=_0x1274ae[_0xdef8('0x1b')];var _0x30aa26=_0x20e3f2?0x0:_0x5d967d[_0xdef8('0x1c')];var _0x54b290=_0x20e3f2?_0x1274ae['count']:_0x5d967d[_0xdef8('0x1c')]+_0x5d967d[_0xdef8('0x1a')];var _0x20a17d;if(_0x54b290>=_0x152bc3){_0x54b290=_0x152bc3;_0x20a17d=0xc8;}else{_0x20a17d=0xce;}_0xea5dba[_0xdef8('0x17')](_0x20a17d);return _0xea5dba['set'](_0xdef8('0x1d'),_0x30aa26+'-'+_0x54b290+'/'+_0x152bc3)[_0xdef8('0x18')](_0x1274ae);}return null;};}function patchUpdates(_0xd0fbb0){return function(_0x1cb281){try{jsonpatch[_0xdef8('0x1e')](_0x1cb281,_0xd0fbb0,!![]);}catch(_0x18b53b){return BPromise[_0xdef8('0x1f')](_0x18b53b);}return _0x1cb281['save']();};}function saveUpdates(_0x4ad8f9,_0xed0bd8){return function(_0x578bd0){if(_0x578bd0){return _0x578bd0[_0xdef8('0x20')](_0x4ad8f9)[_0xdef8('0x21')](function(_0x527c7a){return _0x527c7a;});}return null;};}function removeEntity(_0x1c63b5,_0x64a65b){return function(_0x4563ef){if(_0x4563ef){return _0x4563ef[_0xdef8('0x22')]()['then'](function(){_0x1c63b5[_0xdef8('0x17')](0xcc)[_0xdef8('0x23')]();});}};}function handleEntityNotFound(_0x2ca96d,_0x18a8fe){return function(_0x4fad72){if(!_0x4fad72){_0x2ca96d[_0xdef8('0x16')](0x194);}return _0x4fad72;};}function handleError(_0x240eb3,_0xcf19bd){_0xcf19bd=_0xcf19bd||0x1f4;return function(_0x21b3eb){logger['error'](_0x21b3eb['stack']);if(_0x21b3eb['name']){delete _0x21b3eb[_0xdef8('0x24')];}_0x240eb3['status'](_0xcf19bd)[_0xdef8('0x25')](_0x21b3eb);};}exports[_0xdef8('0x26')]=function(_0x534880,_0x4ae2dd){var _0x41920f={},_0x221875={},_0x127093={'count':0x0,'rows':[]};var _0x15943a=_[_0xdef8('0x27')](db[_0xdef8('0x28')][_0xdef8('0x29')],function(_0x2dfeb5){return{'name':_0x2dfeb5[_0xdef8('0x2a')],'type':_0x2dfeb5[_0xdef8('0x2b')][_0xdef8('0x2c')]};});_0x221875[_0xdef8('0x2d')]=_['map'](_0x15943a,_0xdef8('0x24'));_0x221875['query']=_[_0xdef8('0x2e')](_0x534880[_0xdef8('0x2f')]);_0x221875[_0xdef8('0x30')]=_[_0xdef8('0x31')](_0x221875['model'],_0x221875[_0xdef8('0x2f')]);_0x41920f['attributes']=_[_0xdef8('0x31')](_0x221875[_0xdef8('0x2d')],qs['fields'](_0x534880[_0xdef8('0x2f')]['fields']));_0x41920f[_0xdef8('0x32')]=_0x41920f['attributes'][_0xdef8('0x33')]?_0x41920f[_0xdef8('0x32')]:_0x221875[_0xdef8('0x2d')];if(!_0x534880[_0xdef8('0x2f')][_0xdef8('0x34')](_0xdef8('0x35'))){_0x41920f[_0xdef8('0x1a')]=qs[_0xdef8('0x1a')](_0x534880[_0xdef8('0x2f')]['limit']);_0x41920f[_0xdef8('0x1c')]=qs[_0xdef8('0x1c')](_0x534880[_0xdef8('0x2f')]['offset']);}_0x41920f[_0xdef8('0x36')]=qs['sort'](_0x534880[_0xdef8('0x2f')][_0xdef8('0x37')]);_0x41920f['where']=qs[_0xdef8('0x30')](_[_0xdef8('0x38')](_0x534880[_0xdef8('0x2f')],_0x221875[_0xdef8('0x30')]),_0x15943a);if(_0x534880[_0xdef8('0x2f')][_0xdef8('0x39')]){_0x41920f[_0xdef8('0x3a')]=_[_0xdef8('0x3b')](_0x41920f[_0xdef8('0x3a')],{'$or':_['map'](_0x15943a,function(_0x5bd850){if(_0x5bd850[_0xdef8('0x2b')]!=='VIRTUAL'){var _0x562e62={};_0x562e62[_0x5bd850[_0xdef8('0x24')]]={'$like':'%'+_0x534880[_0xdef8('0x2f')][_0xdef8('0x39')]+'%'};return _0x562e62;}})});}_0x41920f=_['merge']({},_0x41920f,_0x534880[_0xdef8('0x3c')]);var _0x5e6fe7={'where':_0x41920f[_0xdef8('0x3a')]};return db[_0xdef8('0x28')]['count'](_0x5e6fe7)[_0xdef8('0x21')](function(_0x25f8c8){_0x127093['count']=_0x25f8c8;if(_0x534880[_0xdef8('0x2f')][_0xdef8('0x3d')]){_0x41920f['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xdef8('0x3e')](_0x41920f);})[_0xdef8('0x21')](function(_0x556cb4){_0x127093['rows']=_0x556cb4;return _0x127093;})[_0xdef8('0x21')](respondWithFilteredResult(_0x4ae2dd,_0x41920f))[_0xdef8('0x3f')](handleError(_0x4ae2dd,null));};exports[_0xdef8('0x40')]=function(_0x561a20,_0x109a75){var _0x36d7cd={'raw':![],'where':{'id':_0x561a20[_0xdef8('0x41')]['id']}},_0x4a78eb={};_0x4a78eb[_0xdef8('0x2d')]=_[_0xdef8('0x2e')](db['Dynamics365Configuration'][_0xdef8('0x29')]);_0x4a78eb[_0xdef8('0x2f')]=_[_0xdef8('0x2e')](_0x561a20['query']);_0x4a78eb[_0xdef8('0x30')]=_[_0xdef8('0x31')](_0x4a78eb[_0xdef8('0x2d')],_0x4a78eb['query']);_0x36d7cd[_0xdef8('0x32')]=_['intersection'](_0x4a78eb[_0xdef8('0x2d')],qs['fields'](_0x561a20[_0xdef8('0x2f')][_0xdef8('0x42')]));_0x36d7cd['attributes']=_0x36d7cd[_0xdef8('0x32')][_0xdef8('0x33')]?_0x36d7cd[_0xdef8('0x32')]:_0x4a78eb[_0xdef8('0x2d')];if(_0x561a20[_0xdef8('0x2f')]['includeAll']){_0x36d7cd[_0xdef8('0x43')]=[{'all':!![]}];}_0x36d7cd=_[_0xdef8('0x3b')]({},_0x36d7cd,_0x561a20[_0xdef8('0x3c')]);return db['Dynamics365Configuration']['find'](_0x36d7cd)['then'](handleEntityNotFound(_0x109a75,null))[_0xdef8('0x21')](respondWithResult(_0x109a75,null))[_0xdef8('0x3f')](handleError(_0x109a75,null));};exports[_0xdef8('0x44')]=function(_0x4e9641,_0x3b29d4){return db[_0xdef8('0x28')][_0xdef8('0x44')](_0x4e9641[_0xdef8('0x45')],{})[_0xdef8('0x21')](respondWithResult(_0x3b29d4,0xc9))[_0xdef8('0x3f')](handleError(_0x3b29d4,null));};exports[_0xdef8('0x20')]=function(_0x546134,_0x63c49f){if(_0x546134[_0xdef8('0x45')]['id']){delete _0x546134['body']['id'];}return db[_0xdef8('0x28')]['find']({'where':{'id':_0x546134['params']['id']}})[_0xdef8('0x21')](handleEntityNotFound(_0x63c49f,null))['then'](saveUpdates(_0x546134[_0xdef8('0x45')],null))[_0xdef8('0x21')](respondWithResult(_0x63c49f,null))[_0xdef8('0x3f')](handleError(_0x63c49f,null));};exports['destroy']=function(_0x83785,_0x1873ec){return db['Dynamics365Configuration'][_0xdef8('0x46')]({'where':{'id':_0x83785[_0xdef8('0x41')]['id']}})[_0xdef8('0x21')](handleEntityNotFound(_0x1873ec,null))['then'](removeEntity(_0x1873ec,null))[_0xdef8('0x3f')](handleError(_0x1873ec,null));};exports[_0xdef8('0x47')]=function(_0x2fc865,_0x17d0c7,_0x3b3d85){var _0x2fe4be={};var _0x24fbb7={};var _0x352809;var _0xc4aab7;return db['Dynamics365Configuration'][_0xdef8('0x48')]({'where':{'id':_0x2fc865['params']['id']}})[_0xdef8('0x21')](handleEntityNotFound(_0x17d0c7,null))[_0xdef8('0x21')](function(_0x1d20c4){if(_0x1d20c4){_0x352809=_0x1d20c4;_0x24fbb7['model']=_['keys'](db[_0xdef8('0x49')][_0xdef8('0x29')]);_0x24fbb7[_0xdef8('0x2f')]=_[_0xdef8('0x2e')](_0x2fc865[_0xdef8('0x2f')]);_0x24fbb7[_0xdef8('0x30')]=_['intersection'](_0x24fbb7['model'],_0x24fbb7[_0xdef8('0x2f')]);_0x2fe4be[_0xdef8('0x32')]=_[_0xdef8('0x31')](_0x24fbb7[_0xdef8('0x2d')],qs['fields'](_0x2fc865['query'][_0xdef8('0x42')]));_0x2fe4be[_0xdef8('0x32')]=_0x2fe4be[_0xdef8('0x32')][_0xdef8('0x33')]?_0x2fe4be[_0xdef8('0x32')]:_0x24fbb7[_0xdef8('0x2d')];_0x2fe4be[_0xdef8('0x36')]=qs['sort'](_0x2fc865[_0xdef8('0x2f')][_0xdef8('0x37')]);_0x2fe4be['where']=qs['filters'](_['pick'](_0x2fc865[_0xdef8('0x2f')],_0x24fbb7[_0xdef8('0x30')]));if(_0x2fc865['query'][_0xdef8('0x39')]){_0x2fe4be[_0xdef8('0x3a')]=_[_0xdef8('0x3b')](_0x2fe4be[_0xdef8('0x3a')],{'$or':_[_0xdef8('0x27')](_0x2fe4be[_0xdef8('0x32')],function(_0x49819d){var _0x5c93be={};_0x5c93be[_0x49819d]={'$like':'%'+_0x2fc865[_0xdef8('0x2f')][_0xdef8('0x39')]+'%'};return _0x5c93be;})});}_0x2fe4be=_['merge']({},_0x2fe4be,_0x2fc865[_0xdef8('0x3c')]);return _0x352809[_0xdef8('0x47')](_0x2fe4be);}})[_0xdef8('0x21')](function(_0x46521e){if(_0x46521e){_0xc4aab7=_0x46521e[_0xdef8('0x33')];if(!_0x2fc865['query'][_0xdef8('0x34')](_0xdef8('0x35'))){_0x2fe4be[_0xdef8('0x1a')]=qs[_0xdef8('0x1a')](_0x2fc865['query'][_0xdef8('0x1a')]);_0x2fe4be[_0xdef8('0x1c')]=qs[_0xdef8('0x1c')](_0x2fc865[_0xdef8('0x2f')][_0xdef8('0x1c')]);}return _0x352809['getFields'](_0x2fe4be);}})[_0xdef8('0x21')](function(_0xdd77ac){if(_0xdd77ac){return _0xdd77ac?{'count':_0xc4aab7,'rows':_0xdd77ac}:null;}})[_0xdef8('0x21')](respondWithResult(_0x17d0c7,null))[_0xdef8('0x3f')](handleError(_0x17d0c7,null));};exports[_0xdef8('0x4a')]=function(_0x9c8272,_0x55449b,_0x1a96e8){var _0x21e1d9={};var _0x257b9d={};var _0x4da437;var _0x86517;return db[_0xdef8('0x28')][_0xdef8('0x48')]({'where':{'id':_0x9c8272[_0xdef8('0x41')]['id']}})['then'](handleEntityNotFound(_0x55449b,null))[_0xdef8('0x21')](function(_0x22bb76){if(_0x22bb76){_0x4da437=_0x22bb76;_0x257b9d['model']=_[_0xdef8('0x2e')](db['Dynamics365Field'][_0xdef8('0x29')]);_0x257b9d['query']=_[_0xdef8('0x2e')](_0x9c8272[_0xdef8('0x2f')]);_0x257b9d['filters']=_['intersection'](_0x257b9d['model'],_0x257b9d[_0xdef8('0x2f')]);_0x21e1d9['attributes']=_[_0xdef8('0x31')](_0x257b9d[_0xdef8('0x2d')],qs[_0xdef8('0x42')](_0x9c8272[_0xdef8('0x2f')][_0xdef8('0x42')]));_0x21e1d9['attributes']=_0x21e1d9[_0xdef8('0x32')][_0xdef8('0x33')]?_0x21e1d9[_0xdef8('0x32')]:_0x257b9d[_0xdef8('0x2d')];_0x21e1d9[_0xdef8('0x36')]=qs[_0xdef8('0x37')](_0x9c8272[_0xdef8('0x2f')]['sort']);_0x21e1d9[_0xdef8('0x3a')]=qs[_0xdef8('0x30')](_['pick'](_0x9c8272['query'],_0x257b9d[_0xdef8('0x30')]));if(_0x9c8272[_0xdef8('0x2f')][_0xdef8('0x39')]){_0x21e1d9[_0xdef8('0x3a')]=_[_0xdef8('0x3b')](_0x21e1d9[_0xdef8('0x3a')],{'$or':_[_0xdef8('0x27')](_0x21e1d9[_0xdef8('0x32')],function(_0x554aee){var _0x3d78b2={};_0x3d78b2[_0x554aee]={'$like':'%'+_0x9c8272[_0xdef8('0x2f')]['filter']+'%'};return _0x3d78b2;})});}_0x21e1d9=_[_0xdef8('0x3b')]({},_0x21e1d9,_0x9c8272['options']);return _0x4da437['getSubjects'](_0x21e1d9);}})[_0xdef8('0x21')](function(_0x59b581){if(_0x59b581){_0x86517=_0x59b581[_0xdef8('0x33')];if(!_0x9c8272[_0xdef8('0x2f')][_0xdef8('0x34')](_0xdef8('0x35'))){_0x21e1d9[_0xdef8('0x1a')]=qs[_0xdef8('0x1a')](_0x9c8272[_0xdef8('0x2f')][_0xdef8('0x1a')]);_0x21e1d9['offset']=qs['offset'](_0x9c8272[_0xdef8('0x2f')][_0xdef8('0x1c')]);}return _0x4da437['getSubjects'](_0x21e1d9);}})[_0xdef8('0x21')](function(_0x28c94d){if(_0x28c94d){return _0x28c94d?{'count':_0x86517,'rows':_0x28c94d}:null;}})[_0xdef8('0x21')](respondWithResult(_0x55449b,null))[_0xdef8('0x3f')](handleError(_0x55449b,null));};exports[_0xdef8('0x4b')]=function(_0x380b0a,_0x42f5bc,_0x6bcc7c){var _0xddbaf4={};var _0x4c261a={};var _0x1b2c83;var _0x346866;return db['Dynamics365Configuration'][_0xdef8('0x48')]({'where':{'id':_0x380b0a['params']['id']}})['then'](handleEntityNotFound(_0x42f5bc,null))[_0xdef8('0x21')](function(_0x35ac22){if(_0x35ac22){_0x1b2c83=_0x35ac22;_0x4c261a[_0xdef8('0x2d')]=_['keys'](db[_0xdef8('0x49')][_0xdef8('0x29')]);_0x4c261a[_0xdef8('0x2f')]=_[_0xdef8('0x2e')](_0x380b0a[_0xdef8('0x2f')]);_0x4c261a[_0xdef8('0x30')]=_[_0xdef8('0x31')](_0x4c261a['model'],_0x4c261a[_0xdef8('0x2f')]);_0xddbaf4[_0xdef8('0x32')]=_['intersection'](_0x4c261a['model'],qs[_0xdef8('0x42')](_0x380b0a['query'][_0xdef8('0x42')]));_0xddbaf4[_0xdef8('0x32')]=_0xddbaf4[_0xdef8('0x32')]['length']?_0xddbaf4['attributes']:_0x4c261a[_0xdef8('0x2d')];_0xddbaf4['order']=qs[_0xdef8('0x37')](_0x380b0a[_0xdef8('0x2f')]['sort']);_0xddbaf4[_0xdef8('0x3a')]=qs[_0xdef8('0x30')](_[_0xdef8('0x38')](_0x380b0a[_0xdef8('0x2f')],_0x4c261a['filters']));if(_0x380b0a['query'][_0xdef8('0x39')]){_0xddbaf4[_0xdef8('0x3a')]=_[_0xdef8('0x3b')](_0xddbaf4['where'],{'$or':_[_0xdef8('0x27')](_0xddbaf4[_0xdef8('0x32')],function(_0x2a3061){var _0x1dac57={};_0x1dac57[_0x2a3061]={'$like':'%'+_0x380b0a[_0xdef8('0x2f')][_0xdef8('0x39')]+'%'};return _0x1dac57;})});}_0xddbaf4=_[_0xdef8('0x3b')]({},_0xddbaf4,_0x380b0a['options']);return _0x1b2c83['getDescriptions'](_0xddbaf4);}})[_0xdef8('0x21')](function(_0x1f9652){if(_0x1f9652){_0x346866=_0x1f9652['length'];if(!_0x380b0a['query']['hasOwnProperty'](_0xdef8('0x35'))){_0xddbaf4[_0xdef8('0x1a')]=qs[_0xdef8('0x1a')](_0x380b0a[_0xdef8('0x2f')]['limit']);_0xddbaf4[_0xdef8('0x1c')]=qs[_0xdef8('0x1c')](_0x380b0a[_0xdef8('0x2f')][_0xdef8('0x1c')]);}return _0x1b2c83['getDescriptions'](_0xddbaf4);}})[_0xdef8('0x21')](function(_0x56154f){if(_0x56154f){return _0x56154f?{'count':_0x346866,'rows':_0x56154f}:null;}})[_0xdef8('0x21')](respondWithResult(_0x42f5bc,null))[_0xdef8('0x3f')](handleError(_0x42f5bc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f63e304..aa969db 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 _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x4e36b4,_0x2ce0b9){var _0x19c4f7=function(_0x1eb067){while(--_0x1eb067){_0x4e36b4['push'](_0x4e36b4['shift']());}};_0x19c4f7(++_0x2ce0b9);}(_0x5b02,0xe9));var _0x25b0=function(_0x5ad051,_0x51a722){_0x5ad051=_0x5ad051-0x0;var _0x4030cb=_0x5b02[_0x5ad051];return _0x4030cb;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0x4b84[_0x7a3247];return _0x1bfde5;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 29dc4ef..ed9ee10 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 _0x4215=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4215,0x10c));var _0x5421=function(_0x41b96c,_0xaad34d){_0x41b96c=_0x41b96c-0x0;var _0x32bdf6=_0x4215[_0x41b96c];return _0x32bdf6;};'use strict';var _=require('lodash');var util=require(_0x5421('0x0'));var moment=require(_0x5421('0x1'));var BPromise=require(_0x5421('0x2'));var rs=require(_0x5421('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5421('0x4'))['db'];var utils=require(_0x5421('0x5'));var logger=require('../../config/logger')(_0x5421('0x6'));var config=require(_0x5421('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5421('0x8')][_0x5421('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10e0e1,_0x209fb5,_0x692789){return new BPromise(function(_0x3c11b0,_0x58601a){return client['request'](_0x10e0e1,_0x692789)[_0x5421('0xa')](function(_0x4df962){logger[_0x5421('0xb')](_0x5421('0xc'),_0x209fb5,_0x5421('0xd'));logger[_0x5421('0xe')](_0x5421('0xf'),_0x209fb5,_0x5421('0xd'),JSON['stringify'](_0x4df962));if(_0x4df962['error']){if(_0x4df962['error'][_0x5421('0x10')]===0x1f4){logger[_0x5421('0x11')](_0x5421('0xc'),_0x209fb5,_0x4df962[_0x5421('0x11')][_0x5421('0x12')]);return _0x58601a(_0x4df962[_0x5421('0x11')][_0x5421('0x12')]);}logger['error'](_0x5421('0xc'),_0x209fb5,_0x4df962[_0x5421('0x11')][_0x5421('0x12')]);return _0x3c11b0(_0x4df962[_0x5421('0x11')][_0x5421('0x12')]);}else{logger[_0x5421('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x209fb5,'request\x20sent');_0x3c11b0(_0x4df962['result']['message']);}})[_0x5421('0x13')](function(_0x1f51fd){logger[_0x5421('0x11')](_0x5421('0xc'),_0x209fb5,_0x1f51fd);_0x58601a(_0x1f51fd);});});} \ No newline at end of file +var _0x0456=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x50ebda,_0x153ca8){var _0x208946=function(_0x4db297){while(--_0x4db297){_0x50ebda['push'](_0x50ebda['shift']());}};_0x208946(++_0x153ca8);}(_0x0456,0x1cb));var _0x6045=function(_0x577314,_0x2f5638){_0x577314=_0x577314-0x0;var _0x3bac85=_0x0456[_0x577314];return _0x3bac85;};'use strict';var _=require(_0x6045('0x0'));var util=require(_0x6045('0x1'));var moment=require(_0x6045('0x2'));var BPromise=require(_0x6045('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6045('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6045('0x5'))(_0x6045('0x6'));var config=require(_0x6045('0x7'));var jayson=require(_0x6045('0x8'));var client=jayson['client'][_0x6045('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30fc16,_0x117be6,_0x63e2fe){return new BPromise(function(_0x60991,_0x3774cc){return client[_0x6045('0xa')](_0x30fc16,_0x63e2fe)['then'](function(_0x224392){logger[_0x6045('0xb')](_0x6045('0xc'),_0x117be6,_0x6045('0xd'));logger['debug'](_0x6045('0xe'),_0x117be6,_0x6045('0xd'),JSON[_0x6045('0xf')](_0x224392));if(_0x224392[_0x6045('0x10')]){if(_0x224392[_0x6045('0x10')][_0x6045('0x11')]===0x1f4){logger[_0x6045('0x10')](_0x6045('0xc'),_0x117be6,_0x224392[_0x6045('0x10')][_0x6045('0x12')]);return _0x3774cc(_0x224392[_0x6045('0x10')][_0x6045('0x12')]);}logger[_0x6045('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x117be6,_0x224392[_0x6045('0x10')][_0x6045('0x12')]);return _0x60991(_0x224392['error']['message']);}else{logger[_0x6045('0xb')](_0x6045('0xc'),_0x117be6,_0x6045('0xd'));_0x60991(_0x224392['result'][_0x6045('0x12')]);}})[_0x6045('0x13')](function(_0x4cdd1a){logger[_0x6045('0x10')](_0x6045('0xc'),_0x117be6,_0x4cdd1a);_0x3774cc(_0x4cdd1a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2f3554e..44964cc 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 _0x1b40=['fs-extra','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','path','Router'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x1b40,0x1dd));var _0x01b4=function(_0x3ec412,_0x4e05a2){_0x3ec412=_0x3ec412-0x0;var _0x48a1d1=_0x1b40[_0x3ec412];return _0x48a1d1;};'use strict';var multer=require(_0x01b4('0x0'));var util=require('util');var path=require(_0x01b4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b4('0x2')]();var fs_extra=require(_0x01b4('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x01b4('0x4'));router[_0x01b4('0x5')]('/',auth[_0x01b4('0x6')](),controller['index']);router[_0x01b4('0x5')](_0x01b4('0x7'),auth['isAuthenticated'](),controller[_0x01b4('0x8')]);router[_0x01b4('0x9')]('/',auth[_0x01b4('0x6')](),controller[_0x01b4('0xa')]);router[_0x01b4('0xb')]('/:id',auth[_0x01b4('0x6')](),controller[_0x01b4('0xc')]);router['delete'](_0x01b4('0x7'),auth[_0x01b4('0x6')](),controller[_0x01b4('0xd')]);module[_0x01b4('0xe')]=router; \ No newline at end of file +var _0xcf31=['fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x39ffbf,_0x176d05){var _0x558012=function(_0x522e1){while(--_0x522e1){_0x39ffbf['push'](_0x39ffbf['shift']());}};_0x558012(++_0x176d05);}(_0xcf31,0xc0));var _0x1cf3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf31[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1cf3('0x0'));var util=require(_0x1cf3('0x1'));var path=require(_0x1cf3('0x2'));var timeout=require(_0x1cf3('0x3'));var express=require(_0x1cf3('0x4'));var router=express[_0x1cf3('0x5')]();var fs_extra=require(_0x1cf3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1cf3('0x7'));var config=require(_0x1cf3('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x1cf3('0x9')]('/',auth['isAuthenticated'](),controller[_0x1cf3('0xa')]);router[_0x1cf3('0x9')](_0x1cf3('0xb'),auth[_0x1cf3('0xc')](),controller['show']);router[_0x1cf3('0xd')]('/',auth[_0x1cf3('0xc')](),controller[_0x1cf3('0xe')]);router[_0x1cf3('0xf')](_0x1cf3('0xb'),auth[_0x1cf3('0xc')](),controller[_0x1cf3('0x10')]);router['delete'](_0x1cf3('0xb'),auth[_0x1cf3('0xc')](),controller['destroy']);module[_0x1cf3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0e4a50e..97b1057 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 _0xc6ed=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x46c077,_0xfdb3b8){var _0x3687e1=function(_0x594967){while(--_0x594967){_0x46c077['push'](_0x46c077['shift']());}};_0x3687e1(++_0xfdb3b8);}(_0xc6ed,0x1ae));var _0xdc6e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc6ed[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require('sequelize');module[_0xdc6e('0x0')]={'type':{'type':Sequelize[_0xdc6e('0x1')](_0xdc6e('0x2'),_0xdc6e('0x3'),_0xdc6e('0x4'),_0xdc6e('0x5'),_0xdc6e('0x6')),'defaultValue':_0xdc6e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdc6e('0x7')]},'keyType':{'type':Sequelize[_0xdc6e('0x1')](_0xdc6e('0x2'),_0xdc6e('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdc6e('0x7')]},'nameField':{'type':Sequelize[_0xdc6e('0x7')]},'customField':{'type':Sequelize[_0xdc6e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdc6e('0x7')]}}; \ No newline at end of file +var _0x8576=['customVariable','sequelize','ENUM','string','variable','picklist','STRING'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0x8576,0xda));var _0x6857=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x8576[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0x6857('0x0'));module['exports']={'type':{'type':Sequelize[_0x6857('0x1')](_0x6857('0x2'),_0x6857('0x3'),'customVariable','keyValue',_0x6857('0x4')),'defaultValue':_0x6857('0x2')},'content':{'type':Sequelize[_0x6857('0x5')]},'key':{'type':Sequelize[_0x6857('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x6857('0x2'),_0x6857('0x3'),_0x6857('0x6'))},'keyContent':{'type':Sequelize[_0x6857('0x5')]},'idField':{'type':Sequelize[_0x6857('0x5')]},'nameField':{'type':Sequelize[_0x6857('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6857('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d634658..2988a65 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 _0x7d4e=['reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','Dynamics365Field','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d4e,0xfa));var _0xe7d4=function(_0xa80474,_0x3e99aa){_0xa80474=_0xa80474-0x0;var _0xc3b62=_0x7d4e[_0xa80474];return _0xc3b62;};'use strict';var emlformat=require(_0xe7d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7d4('0x1'));var jsonpatch=require(_0xe7d4('0x2'));var rp=require(_0xe7d4('0x3'));var moment=require(_0xe7d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe7d4('0x5'));var util=require('util');var path=require(_0xe7d4('0x6'));var sox=require(_0xe7d4('0x7'));var csv=require(_0xe7d4('0x8'));var ejs=require(_0xe7d4('0x9'));var fs=require('fs');var fs_extra=require(_0xe7d4('0xa'));var _=require(_0xe7d4('0xb'));var squel=require(_0xe7d4('0xc'));var crypto=require('crypto');var jsforce=require(_0xe7d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe7d4('0x8'));var querystring=require('querystring');var Papa=require(_0xe7d4('0xe'));var Redis=require(_0xe7d4('0xf'));var authService=require(_0xe7d4('0x10'));var qs=require(_0xe7d4('0x11'));var as=require(_0xe7d4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7d4('0x13'))(_0xe7d4('0x14'));var utils=require('../../config/utils');var config=require(_0xe7d4('0x15'));var licenseUtil=require(_0xe7d4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdb87f3,_0xdf4190){_0xdf4190=_0xdf4190||0xcc;return function(_0x2dca6e){if(_0x2dca6e){return _0xdb87f3['sendStatus'](_0xdf4190);}return _0xdb87f3[_0xe7d4('0x17')](_0xdf4190)['end']();};}function respondWithResult(_0x1f6bf3,_0x45f059){_0x45f059=_0x45f059||0xc8;return function(_0x237f59){if(_0x237f59){return _0x1f6bf3[_0xe7d4('0x17')](_0x45f059)[_0xe7d4('0x18')](_0x237f59);}};}function respondWithFilteredResult(_0x2a1308,_0x57a79a){return function(_0x3f6d0e){if(_0x3f6d0e){var _0x1f9efd=typeof _0x57a79a[_0xe7d4('0x19')]===_0xe7d4('0x1a')&&typeof _0x57a79a[_0xe7d4('0x1b')]===_0xe7d4('0x1a');var _0xb45f4d=_0x3f6d0e[_0xe7d4('0x1c')];var _0x2d3194=_0x1f9efd?0x0:_0x57a79a['offset'];var _0x3bc7cd=_0x1f9efd?_0x3f6d0e[_0xe7d4('0x1c')]:_0x57a79a['offset']+_0x57a79a[_0xe7d4('0x1b')];var _0x6a4d65;if(_0x3bc7cd>=_0xb45f4d){_0x3bc7cd=_0xb45f4d;_0x6a4d65=0xc8;}else{_0x6a4d65=0xce;}_0x2a1308['status'](_0x6a4d65);return _0x2a1308['set']('Content-Range',_0x2d3194+'-'+_0x3bc7cd+'/'+_0xb45f4d)[_0xe7d4('0x18')](_0x3f6d0e);}return null;};}function patchUpdates(_0x28f83f){return function(_0x356b0e){try{jsonpatch[_0xe7d4('0x1d')](_0x356b0e,_0x28f83f,!![]);}catch(_0x15a54f){return BPromise[_0xe7d4('0x1e')](_0x15a54f);}return _0x356b0e[_0xe7d4('0x1f')]();};}function saveUpdates(_0x41d552,_0x5902a7){return function(_0x59eae0){if(_0x59eae0){return _0x59eae0[_0xe7d4('0x20')](_0x41d552)[_0xe7d4('0x21')](function(_0x17384f){return _0x17384f;});}return null;};}function removeEntity(_0x988ff9,_0x2c1b68){return function(_0xc59c39){if(_0xc59c39){return _0xc59c39[_0xe7d4('0x22')]()[_0xe7d4('0x21')](function(){_0x988ff9[_0xe7d4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c780,_0x12b15e){return function(_0x2033c9){if(!_0x2033c9){_0x25c780['sendStatus'](0x194);}return _0x2033c9;};}function handleError(_0x1cf7d6,_0x42b9d5){_0x42b9d5=_0x42b9d5||0x1f4;return function(_0x5441a6){logger[_0xe7d4('0x23')](_0x5441a6['stack']);if(_0x5441a6['name']){delete _0x5441a6[_0xe7d4('0x24')];}_0x1cf7d6[_0xe7d4('0x17')](_0x42b9d5)[_0xe7d4('0x25')](_0x5441a6);};}exports[_0xe7d4('0x26')]=function(_0x5c436e,_0x11c68a){var _0x5d96ac={},_0x1fdc25={},_0x40020c={'count':0x0,'rows':[]};var _0x27d1bf=_['map'](db['Dynamics365Field'][_0xe7d4('0x27')],function(_0x524096){return{'name':_0x524096[_0xe7d4('0x28')],'type':_0x524096[_0xe7d4('0x29')]['key']};});_0x1fdc25[_0xe7d4('0x2a')]=_['map'](_0x27d1bf,'name');_0x1fdc25[_0xe7d4('0x2b')]=_[_0xe7d4('0x2c')](_0x5c436e[_0xe7d4('0x2b')]);_0x1fdc25[_0xe7d4('0x2d')]=_[_0xe7d4('0x2e')](_0x1fdc25['model'],_0x1fdc25[_0xe7d4('0x2b')]);_0x5d96ac[_0xe7d4('0x2f')]=_[_0xe7d4('0x2e')](_0x1fdc25['model'],qs[_0xe7d4('0x30')](_0x5c436e[_0xe7d4('0x2b')]['fields']));_0x5d96ac[_0xe7d4('0x2f')]=_0x5d96ac[_0xe7d4('0x2f')][_0xe7d4('0x31')]?_0x5d96ac[_0xe7d4('0x2f')]:_0x1fdc25[_0xe7d4('0x2a')];if(!_0x5c436e[_0xe7d4('0x2b')]['hasOwnProperty'](_0xe7d4('0x32'))){_0x5d96ac[_0xe7d4('0x1b')]=qs[_0xe7d4('0x1b')](_0x5c436e['query'][_0xe7d4('0x1b')]);_0x5d96ac[_0xe7d4('0x19')]=qs[_0xe7d4('0x19')](_0x5c436e[_0xe7d4('0x2b')]['offset']);}_0x5d96ac[_0xe7d4('0x33')]=qs[_0xe7d4('0x34')](_0x5c436e['query']['sort']);_0x5d96ac[_0xe7d4('0x35')]=qs[_0xe7d4('0x2d')](_[_0xe7d4('0x36')](_0x5c436e[_0xe7d4('0x2b')],_0x1fdc25['filters']),_0x27d1bf);if(_0x5c436e['query']['filter']){_0x5d96ac['where']=_[_0xe7d4('0x37')](_0x5d96ac['where'],{'$or':_[_0xe7d4('0x38')](_0x27d1bf,function(_0x28b9c8){if(_0x28b9c8[_0xe7d4('0x29')]!==_0xe7d4('0x39')){var _0x2279c0={};_0x2279c0[_0x28b9c8[_0xe7d4('0x24')]]={'$like':'%'+_0x5c436e['query'][_0xe7d4('0x3a')]+'%'};return _0x2279c0;}})});}_0x5d96ac=_['merge']({},_0x5d96ac,_0x5c436e['options']);var _0x144851={'where':_0x5d96ac[_0xe7d4('0x35')]};return db[_0xe7d4('0x3b')]['count'](_0x144851)[_0xe7d4('0x21')](function(_0x3b0d4a){_0x40020c[_0xe7d4('0x1c')]=_0x3b0d4a;if(_0x5c436e[_0xe7d4('0x2b')][_0xe7d4('0x3c')]){_0x5d96ac['include']=[{'all':!![]}];}return db[_0xe7d4('0x3b')][_0xe7d4('0x3d')](_0x5d96ac);})['then'](function(_0x4aee81){_0x40020c[_0xe7d4('0x3e')]=_0x4aee81;return _0x40020c;})['then'](respondWithFilteredResult(_0x11c68a,_0x5d96ac))['catch'](handleError(_0x11c68a,null));};exports[_0xe7d4('0x3f')]=function(_0x1511b6,_0x11a6e6){var _0x28e6ff={'raw':!![],'where':{'id':_0x1511b6[_0xe7d4('0x40')]['id']}},_0xee88fd={};_0xee88fd['model']=_[_0xe7d4('0x2c')](db[_0xe7d4('0x3b')]['rawAttributes']);_0xee88fd[_0xe7d4('0x2b')]=_[_0xe7d4('0x2c')](_0x1511b6['query']);_0xee88fd[_0xe7d4('0x2d')]=_['intersection'](_0xee88fd[_0xe7d4('0x2a')],_0xee88fd[_0xe7d4('0x2b')]);_0x28e6ff[_0xe7d4('0x2f')]=_[_0xe7d4('0x2e')](_0xee88fd[_0xe7d4('0x2a')],qs['fields'](_0x1511b6[_0xe7d4('0x2b')][_0xe7d4('0x30')]));_0x28e6ff['attributes']=_0x28e6ff[_0xe7d4('0x2f')]['length']?_0x28e6ff[_0xe7d4('0x2f')]:_0xee88fd[_0xe7d4('0x2a')];if(_0x1511b6['query'][_0xe7d4('0x3c')]){_0x28e6ff[_0xe7d4('0x41')]=[{'all':!![]}];}_0x28e6ff=_[_0xe7d4('0x37')]({},_0x28e6ff,_0x1511b6['options']);return db[_0xe7d4('0x3b')][_0xe7d4('0x42')](_0x28e6ff)[_0xe7d4('0x21')](handleEntityNotFound(_0x11a6e6,null))['then'](respondWithResult(_0x11a6e6,null))[_0xe7d4('0x43')](handleError(_0x11a6e6,null));};exports[_0xe7d4('0x44')]=function(_0x36d2ed,_0x14967b){return db['Dynamics365Field']['create'](_0x36d2ed[_0xe7d4('0x45')],{})[_0xe7d4('0x21')](respondWithResult(_0x14967b,0xc9))[_0xe7d4('0x43')](handleError(_0x14967b,null));};exports[_0xe7d4('0x20')]=function(_0x38be99,_0x569ecd){if(_0x38be99[_0xe7d4('0x45')]['id']){delete _0x38be99[_0xe7d4('0x45')]['id'];}return db['Dynamics365Field'][_0xe7d4('0x42')]({'where':{'id':_0x38be99[_0xe7d4('0x40')]['id']}})[_0xe7d4('0x21')](handleEntityNotFound(_0x569ecd,null))[_0xe7d4('0x21')](saveUpdates(_0x38be99[_0xe7d4('0x45')],null))[_0xe7d4('0x21')](respondWithResult(_0x569ecd,null))['catch'](handleError(_0x569ecd,null));};exports['destroy']=function(_0x24e5f3,_0x2f2fff){return db['Dynamics365Field']['find']({'where':{'id':_0x24e5f3['params']['id']}})[_0xe7d4('0x21')](handleEntityNotFound(_0x2f2fff,null))[_0xe7d4('0x21')](removeEntity(_0x2f2fff,null))['catch'](handleError(_0x2f2fff,null));}; \ No newline at end of file +var _0x0d32=['filters','intersection','model','attributes','fields','order','sort','where','pick','filter','VIRTUAL','options','Dynamics365Field','includeAll','include','then','rows','show','params','length','merge','find','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query'];(function(_0x5eea7b,_0x2f03d0){var _0xb6a416=function(_0x36f1e0){while(--_0x36f1e0){_0x5eea7b['push'](_0x5eea7b['shift']());}};_0xb6a416(++_0x2f03d0);}(_0x0d32,0x180));var _0x20d3=function(_0x57d3fa,_0xf77a5a){_0x57d3fa=_0x57d3fa-0x0;var _0x586304=_0x0d32[_0x57d3fa];return _0x586304;};'use strict';var emlformat=require(_0x20d3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20d3('0x1'));var rp=require(_0x20d3('0x2'));var moment=require(_0x20d3('0x3'));var BPromise=require(_0x20d3('0x4'));var Mustache=require(_0x20d3('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x20d3('0x6'));var ejs=require(_0x20d3('0x7'));var fs=require('fs');var fs_extra=require(_0x20d3('0x8'));var _=require('lodash');var squel=require(_0x20d3('0x9'));var crypto=require(_0x20d3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x20d3('0xb'));var toCsv=require(_0x20d3('0x6'));var querystring=require(_0x20d3('0xc'));var Papa=require(_0x20d3('0xd'));var Redis=require(_0x20d3('0xe'));var authService=require(_0x20d3('0xf'));var qs=require(_0x20d3('0x10'));var as=require(_0x20d3('0x11'));var hardwareService=require(_0x20d3('0x12'));var logger=require(_0x20d3('0x13'))(_0x20d3('0x14'));var utils=require(_0x20d3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x20d3('0x16'));var db=require(_0x20d3('0x17'))['db'];function respondWithStatusCode(_0x366b8a,_0x2a85a5){_0x2a85a5=_0x2a85a5||0xcc;return function(_0x185c16){if(_0x185c16){return _0x366b8a[_0x20d3('0x18')](_0x2a85a5);}return _0x366b8a[_0x20d3('0x19')](_0x2a85a5)['end']();};}function respondWithResult(_0x26b0bf,_0x4a726c){_0x4a726c=_0x4a726c||0xc8;return function(_0x2c65ed){if(_0x2c65ed){return _0x26b0bf['status'](_0x4a726c)[_0x20d3('0x1a')](_0x2c65ed);}};}function respondWithFilteredResult(_0x3bca9c,_0x17f872){return function(_0x578dd){if(_0x578dd){var _0x1fddd1=typeof _0x17f872[_0x20d3('0x1b')]===_0x20d3('0x1c')&&typeof _0x17f872[_0x20d3('0x1d')]==='undefined';var _0x27ab8a=_0x578dd[_0x20d3('0x1e')];var _0x45f68c=_0x1fddd1?0x0:_0x17f872[_0x20d3('0x1b')];var _0x3d881b=_0x1fddd1?_0x578dd[_0x20d3('0x1e')]:_0x17f872['offset']+_0x17f872['limit'];var _0x3ea579;if(_0x3d881b>=_0x27ab8a){_0x3d881b=_0x27ab8a;_0x3ea579=0xc8;}else{_0x3ea579=0xce;}_0x3bca9c[_0x20d3('0x19')](_0x3ea579);return _0x3bca9c[_0x20d3('0x1f')]('Content-Range',_0x45f68c+'-'+_0x3d881b+'/'+_0x27ab8a)[_0x20d3('0x1a')](_0x578dd);}return null;};}function patchUpdates(_0x51fb80){return function(_0x475384){try{jsonpatch[_0x20d3('0x20')](_0x475384,_0x51fb80,!![]);}catch(_0x56dd7f){return BPromise['reject'](_0x56dd7f);}return _0x475384[_0x20d3('0x21')]();};}function saveUpdates(_0x371eff,_0x2e6c2a){return function(_0x43b1f2){if(_0x43b1f2){return _0x43b1f2[_0x20d3('0x22')](_0x371eff)['then'](function(_0x3b592a){return _0x3b592a;});}return null;};}function removeEntity(_0x14addf,_0x168d23){return function(_0x46bc14){if(_0x46bc14){return _0x46bc14[_0x20d3('0x23')]()['then'](function(){_0x14addf[_0x20d3('0x19')](0xcc)[_0x20d3('0x24')]();});}};}function handleEntityNotFound(_0x2a6fb0,_0x4525a7){return function(_0x3a1499){if(!_0x3a1499){_0x2a6fb0[_0x20d3('0x18')](0x194);}return _0x3a1499;};}function handleError(_0xe9022a,_0x57b6f5){_0x57b6f5=_0x57b6f5||0x1f4;return function(_0x1ff786){logger[_0x20d3('0x25')](_0x1ff786[_0x20d3('0x26')]);if(_0x1ff786['name']){delete _0x1ff786[_0x20d3('0x27')];}_0xe9022a[_0x20d3('0x19')](_0x57b6f5)[_0x20d3('0x28')](_0x1ff786);};}exports[_0x20d3('0x29')]=function(_0x1056c4,_0x2da7a9){var _0x1736d8={},_0x2c7a26={},_0x524e2f={'count':0x0,'rows':[]};var _0x5b568b=_[_0x20d3('0x2a')](db['Dynamics365Field'][_0x20d3('0x2b')],function(_0x219502){return{'name':_0x219502[_0x20d3('0x2c')],'type':_0x219502[_0x20d3('0x2d')]['key']};});_0x2c7a26['model']=_[_0x20d3('0x2a')](_0x5b568b,_0x20d3('0x27'));_0x2c7a26['query']=_[_0x20d3('0x2e')](_0x1056c4[_0x20d3('0x2f')]);_0x2c7a26[_0x20d3('0x30')]=_[_0x20d3('0x31')](_0x2c7a26[_0x20d3('0x32')],_0x2c7a26[_0x20d3('0x2f')]);_0x1736d8[_0x20d3('0x33')]=_[_0x20d3('0x31')](_0x2c7a26['model'],qs[_0x20d3('0x34')](_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x34')]));_0x1736d8[_0x20d3('0x33')]=_0x1736d8[_0x20d3('0x33')]['length']?_0x1736d8[_0x20d3('0x33')]:_0x2c7a26[_0x20d3('0x32')];if(!_0x1056c4[_0x20d3('0x2f')]['hasOwnProperty']('nolimit')){_0x1736d8[_0x20d3('0x1d')]=qs[_0x20d3('0x1d')](_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x1d')]);_0x1736d8[_0x20d3('0x1b')]=qs[_0x20d3('0x1b')](_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x1b')]);}_0x1736d8[_0x20d3('0x35')]=qs[_0x20d3('0x36')](_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x36')]);_0x1736d8[_0x20d3('0x37')]=qs[_0x20d3('0x30')](_[_0x20d3('0x38')](_0x1056c4[_0x20d3('0x2f')],_0x2c7a26[_0x20d3('0x30')]),_0x5b568b);if(_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x39')]){_0x1736d8[_0x20d3('0x37')]=_['merge'](_0x1736d8[_0x20d3('0x37')],{'$or':_[_0x20d3('0x2a')](_0x5b568b,function(_0x14d3f5){if(_0x14d3f5['type']!==_0x20d3('0x3a')){var _0x51742a={};_0x51742a[_0x14d3f5[_0x20d3('0x27')]]={'$like':'%'+_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x39')]+'%'};return _0x51742a;}})});}_0x1736d8=_['merge']({},_0x1736d8,_0x1056c4[_0x20d3('0x3b')]);var _0x4ad5b6={'where':_0x1736d8['where']};return db[_0x20d3('0x3c')][_0x20d3('0x1e')](_0x4ad5b6)['then'](function(_0x2af0e3){_0x524e2f[_0x20d3('0x1e')]=_0x2af0e3;if(_0x1056c4[_0x20d3('0x2f')][_0x20d3('0x3d')]){_0x1736d8[_0x20d3('0x3e')]=[{'all':!![]}];}return db[_0x20d3('0x3c')]['findAll'](_0x1736d8);})[_0x20d3('0x3f')](function(_0x1da547){_0x524e2f[_0x20d3('0x40')]=_0x1da547;return _0x524e2f;})['then'](respondWithFilteredResult(_0x2da7a9,_0x1736d8))['catch'](handleError(_0x2da7a9,null));};exports[_0x20d3('0x41')]=function(_0x19101b,_0x158caf){var _0x39f4e2={'raw':!![],'where':{'id':_0x19101b[_0x20d3('0x42')]['id']}},_0x3cdf74={};_0x3cdf74[_0x20d3('0x32')]=_[_0x20d3('0x2e')](db[_0x20d3('0x3c')][_0x20d3('0x2b')]);_0x3cdf74[_0x20d3('0x2f')]=_[_0x20d3('0x2e')](_0x19101b['query']);_0x3cdf74[_0x20d3('0x30')]=_[_0x20d3('0x31')](_0x3cdf74['model'],_0x3cdf74[_0x20d3('0x2f')]);_0x39f4e2[_0x20d3('0x33')]=_[_0x20d3('0x31')](_0x3cdf74[_0x20d3('0x32')],qs[_0x20d3('0x34')](_0x19101b[_0x20d3('0x2f')][_0x20d3('0x34')]));_0x39f4e2['attributes']=_0x39f4e2[_0x20d3('0x33')][_0x20d3('0x43')]?_0x39f4e2[_0x20d3('0x33')]:_0x3cdf74['model'];if(_0x19101b[_0x20d3('0x2f')][_0x20d3('0x3d')]){_0x39f4e2['include']=[{'all':!![]}];}_0x39f4e2=_[_0x20d3('0x44')]({},_0x39f4e2,_0x19101b[_0x20d3('0x3b')]);return db['Dynamics365Field'][_0x20d3('0x45')](_0x39f4e2)['then'](handleEntityNotFound(_0x158caf,null))[_0x20d3('0x3f')](respondWithResult(_0x158caf,null))['catch'](handleError(_0x158caf,null));};exports['create']=function(_0x14a90c,_0x20551a){return db[_0x20d3('0x3c')]['create'](_0x14a90c[_0x20d3('0x46')],{})[_0x20d3('0x3f')](respondWithResult(_0x20551a,0xc9))[_0x20d3('0x47')](handleError(_0x20551a,null));};exports[_0x20d3('0x22')]=function(_0x3629c6,_0x2f3de8){if(_0x3629c6[_0x20d3('0x46')]['id']){delete _0x3629c6[_0x20d3('0x46')]['id'];}return db['Dynamics365Field'][_0x20d3('0x45')]({'where':{'id':_0x3629c6['params']['id']}})[_0x20d3('0x3f')](handleEntityNotFound(_0x2f3de8,null))['then'](saveUpdates(_0x3629c6[_0x20d3('0x46')],null))[_0x20d3('0x3f')](respondWithResult(_0x2f3de8,null))[_0x20d3('0x47')](handleError(_0x2f3de8,null));};exports['destroy']=function(_0x262073,_0x26b51d){return db['Dynamics365Field'][_0x20d3('0x45')]({'where':{'id':_0x262073['params']['id']}})[_0x20d3('0x3f')](handleEntityNotFound(_0x26b51d,null))[_0x20d3('0x3f')](removeEntity(_0x26b51d,null))[_0x20d3('0x47')](handleError(_0x26b51d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index b5872d7..70f91fb 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 _0x7e2c=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0x7e2c,0x14f));var _0xc7e2=function(_0x3a6b02,_0x589d4d){_0x3a6b02=_0x3a6b02-0x0;var _0x5acb58=_0x7e2c[_0x3a6b02];return _0x5acb58;};'use strict';var _=require(_0xc7e2('0x0'));var util=require(_0xc7e2('0x1'));var logger=require(_0xc7e2('0x2'))(_0xc7e2('0x3'));var moment=require(_0xc7e2('0x4'));var BPromise=require(_0xc7e2('0x5'));var rp=require(_0xc7e2('0x6'));var fs=require('fs');var path=require(_0xc7e2('0x7'));var rimraf=require(_0xc7e2('0x8'));var config=require(_0xc7e2('0x9'));var attributes=require(_0xc7e2('0xa'));module['exports']=function(_0x26cec3,_0x15d9bf){return _0x26cec3[_0xc7e2('0xb')](_0xc7e2('0xc'),attributes,{'tableName':_0xc7e2('0xd'),'paranoid':![],'indexes':[{'name':_0xc7e2('0xe'),'fields':[_0xc7e2('0xf'),_0xc7e2('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc09e=['./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0xc0e53a,_0x552038){var _0xfdb832=function(_0x523e71){while(--_0x523e71){_0xc0e53a['push'](_0xc0e53a['shift']());}};_0xfdb832(++_0x552038);}(_0xc09e,0xde));var _0xec09=function(_0x55849d,_0xf64d6a){_0x55849d=_0x55849d-0x0;var _0x5b2504=_0xc09e[_0x55849d];return _0x5b2504;};'use strict';var _=require('lodash');var util=require(_0xec09('0x0'));var logger=require(_0xec09('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xec09('0x2'));var fs=require('fs');var path=require(_0xec09('0x3'));var rimraf=require(_0xec09('0x4'));var config=require(_0xec09('0x5'));var attributes=require(_0xec09('0x6'));module['exports']=function(_0x22bd6b,_0x45a4a0){return _0x22bd6b[_0xec09('0x7')]('Dynamics365Field',attributes,{'tableName':_0xec09('0x8'),'paranoid':![],'indexes':[{'name':_0xec09('0x9'),'fields':[_0xec09('0xa'),_0xec09('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index c980eab..aedb526 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 _0x1c94=['message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x23cbb1,_0x170772){var _0x2e42d9=function(_0x7039a0){while(--_0x7039a0){_0x23cbb1['push'](_0x23cbb1['shift']());}};_0x2e42d9(++_0x170772);}(_0x1c94,0x1b7));var _0x41c9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1c94[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x41c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x41c9('0x1'));var fs=require('fs');var Redis=require(_0x41c9('0x2'));var db=require(_0x41c9('0x3'))['db'];var utils=require(_0x41c9('0x4'));var logger=require(_0x41c9('0x5'))(_0x41c9('0x6'));var config=require(_0x41c9('0x7'));var jayson=require(_0x41c9('0x8'));var client=jayson[_0x41c9('0x9')][_0x41c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34e08c,_0x4626c7,_0x3505b1){return new BPromise(function(_0x3cebc9,_0x2af80a){return client[_0x41c9('0xb')](_0x34e08c,_0x3505b1)[_0x41c9('0xc')](function(_0x502de9){logger[_0x41c9('0xd')](_0x41c9('0xe'),_0x4626c7,_0x41c9('0xf'));logger[_0x41c9('0x10')](_0x41c9('0x11'),_0x4626c7,_0x41c9('0xf'),JSON[_0x41c9('0x12')](_0x502de9));if(_0x502de9[_0x41c9('0x13')]){if(_0x502de9[_0x41c9('0x13')][_0x41c9('0x14')]===0x1f4){logger[_0x41c9('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x4626c7,_0x502de9[_0x41c9('0x13')][_0x41c9('0x15')]);return _0x2af80a(_0x502de9[_0x41c9('0x13')]['message']);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x4626c7,_0x502de9[_0x41c9('0x13')][_0x41c9('0x15')]);return _0x3cebc9(_0x502de9[_0x41c9('0x13')]['message']);}else{logger[_0x41c9('0xd')](_0x41c9('0xe'),_0x4626c7,_0x41c9('0xf'));_0x3cebc9(_0x502de9[_0x41c9('0x16')][_0x41c9('0x15')]);}})['catch'](function(_0x59eccb){logger[_0x41c9('0x13')](_0x41c9('0xe'),_0x4626c7,_0x59eccb);_0x2af80a(_0x59eccb);});});} \ No newline at end of file +var _0x4204=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3e5dc5,_0xfb181d){var _0x4c6101=function(_0x5b3125){while(--_0x5b3125){_0x3e5dc5['push'](_0x3e5dc5['shift']());}};_0x4c6101(++_0xfb181d);}(_0x4204,0x1c6));var _0x4420=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x4204[_0x31b9cf];return _0x357b8a;};'use strict';var _=require(_0x4420('0x0'));var util=require(_0x4420('0x1'));var moment=require('moment');var BPromise=require(_0x4420('0x2'));var rs=require(_0x4420('0x3'));var fs=require('fs');var Redis=require(_0x4420('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4420('0x5'))('rpc');var config=require(_0x4420('0x6'));var jayson=require(_0x4420('0x7'));var client=jayson[_0x4420('0x8')][_0x4420('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e0697,_0x3ac604,_0x111cd4){return new BPromise(function(_0x5f5d80,_0x1f92aa){return client[_0x4420('0xa')](_0x2e0697,_0x111cd4)[_0x4420('0xb')](function(_0x3f5b5c){logger[_0x4420('0xc')](_0x4420('0xd'),_0x3ac604,_0x4420('0xe'));logger['debug'](_0x4420('0xf'),_0x3ac604,_0x4420('0xe'),JSON[_0x4420('0x10')](_0x3f5b5c));if(_0x3f5b5c[_0x4420('0x11')]){if(_0x3f5b5c['error'][_0x4420('0x12')]===0x1f4){logger[_0x4420('0x11')](_0x4420('0xd'),_0x3ac604,_0x3f5b5c[_0x4420('0x11')][_0x4420('0x13')]);return _0x1f92aa(_0x3f5b5c[_0x4420('0x11')][_0x4420('0x13')]);}logger[_0x4420('0x11')](_0x4420('0xd'),_0x3ac604,_0x3f5b5c[_0x4420('0x11')][_0x4420('0x13')]);return _0x5f5d80(_0x3f5b5c[_0x4420('0x11')][_0x4420('0x13')]);}else{logger[_0x4420('0xc')](_0x4420('0xd'),_0x3ac604,'request\x20sent');_0x5f5d80(_0x3f5b5c[_0x4420('0x14')][_0x4420('0x13')]);}})[_0x4420('0x15')](function(_0x554404){logger[_0x4420('0x11')](_0x4420('0xd'),_0x3ac604,_0x554404);_0x1f92aa(_0x554404);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f7c83f0..b8f4c25 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 _0x6fa3=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','post','put','update','delete','destroy','exports','Router'];(function(_0x4adb82,_0x19aea7){var _0x520dd8=function(_0x55e65b){while(--_0x55e65b){_0x4adb82['push'](_0x4adb82['shift']());}};_0x520dd8(++_0x19aea7);}(_0x6fa3,0xdf));var _0x36fa=function(_0x2929cd,_0x1d3a2a){_0x2929cd=_0x2929cd-0x0;var _0x16c157=_0x6fa3[_0x2929cd];return _0x16c157;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x36fa('0x0')]();var fs_extra=require('fs-extra');var auth=require(_0x36fa('0x1'));var interaction=require(_0x36fa('0x2'));var config=require(_0x36fa('0x3'));var controller=require('./intFreshdeskAccount.controller');router[_0x36fa('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36fa('0x4')](_0x36fa('0x5'),auth[_0x36fa('0x6')](),controller[_0x36fa('0x7')]);router[_0x36fa('0x4')](_0x36fa('0x8'),auth['isAuthenticated'](),controller[_0x36fa('0x9')]);router['get']('/:id/fields',auth[_0x36fa('0x6')](),controller['getFields']);router['post']('/',auth[_0x36fa('0x6')](),controller['create']);router[_0x36fa('0xa')]('/:id/configurations',auth[_0x36fa('0x6')](),controller['addConfiguration']);router[_0x36fa('0xb')](_0x36fa('0x5'),auth[_0x36fa('0x6')](),controller[_0x36fa('0xc')]);router[_0x36fa('0xd')](_0x36fa('0x5'),auth[_0x36fa('0x6')](),controller[_0x36fa('0xe')]);module[_0x36fa('0xf')]=router; \ No newline at end of file +var _0x28fd=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update'];(function(_0x11cf69,_0x4c6589){var _0x12fa1c=function(_0x17d5be){while(--_0x17d5be){_0x11cf69['push'](_0x11cf69['shift']());}};_0x12fa1c(++_0x4c6589);}(_0x28fd,0x100));var _0xd28f=function(_0x58f245,_0x3e4f31){_0x58f245=_0x58f245-0x0;var _0x1f0cfb=_0x28fd[_0x58f245];return _0x1f0cfb;};'use strict';var multer=require(_0xd28f('0x0'));var util=require('util');var path=require(_0xd28f('0x1'));var timeout=require('connect-timeout');var express=require(_0xd28f('0x2'));var router=express[_0xd28f('0x3')]();var fs_extra=require(_0xd28f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd28f('0x5'));var config=require('../../config/environment');var controller=require(_0xd28f('0x6'));router[_0xd28f('0x7')]('/',auth['isAuthenticated'](),controller[_0xd28f('0x8')]);router[_0xd28f('0x7')](_0xd28f('0x9'),auth[_0xd28f('0xa')](),controller[_0xd28f('0xb')]);router[_0xd28f('0x7')](_0xd28f('0xc'),auth[_0xd28f('0xa')](),controller[_0xd28f('0xd')]);router[_0xd28f('0x7')](_0xd28f('0xe'),auth[_0xd28f('0xa')](),controller[_0xd28f('0xf')]);router[_0xd28f('0x10')]('/',auth['isAuthenticated'](),controller[_0xd28f('0x11')]);router[_0xd28f('0x10')](_0xd28f('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xd28f('0x12')](_0xd28f('0x9'),auth[_0xd28f('0xa')](),controller[_0xd28f('0x13')]);router[_0xd28f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd28f('0x15')]);module[_0xd28f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a69d12a..345a74b 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 _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0xda9200,_0x15d148){var _0x5f2217=function(_0x391314){while(--_0x391314){_0xda9200['push'](_0xda9200['shift']());}};_0x5f2217(++_0x15d148);}(_0x4991,0xf7));var _0x1499=function(_0x2ce93d,_0x3e2231){_0x2ce93d=_0x2ce93d-0x0;var _0x4551e8=_0x4991[_0x2ce93d];return _0x4551e8;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7b84=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x7b84,0x17c));var _0x47b8=function(_0x357fa4,_0x286f7a){_0x357fa4=_0x357fa4-0x0;var _0x213320=_0x7b84[_0x357fa4];return _0x213320;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')]},'description':{'type':Sequelize[_0x47b8('0x2')]},'username':{'type':Sequelize[_0x47b8('0x2')],'unique':_0x47b8('0x3')},'apiKey':{'type':Sequelize[_0x47b8('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x47b8('0x4')},'serverUrl':{'type':Sequelize[_0x47b8('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 40717e4..26f9fa9 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 _0x6953=['getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','toString','base64','requester','subject','agent','group','source','company','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','update','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshdeskField','Descriptions'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6953,0x91));var _0x3695=function(_0x2905e4,_0x41dea0){_0x2905e4=_0x2905e4-0x0;var _0x86ee71=_0x6953[_0x2905e4];return _0x86ee71;};'use strict';var emlformat=require(_0x3695('0x0'));var rimraf=require(_0x3695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3695('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3695('0x3'));var util=require(_0x3695('0x4'));var path=require(_0x3695('0x5'));var sox=require('sox');var csv=require(_0x3695('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3695('0x7'));var _=require(_0x3695('0x8'));var squel=require(_0x3695('0x9'));var crypto=require(_0x3695('0xa'));var jsforce=require(_0x3695('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3695('0x6'));var querystring=require('querystring');var Papa=require(_0x3695('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3695('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3695('0xe'));var logger=require(_0x3695('0xf'))(_0x3695('0x10'));var utils=require(_0x3695('0x11'));var config=require(_0x3695('0x12'));var licenseUtil=require(_0x3695('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3695('0x14'));function respondWithStatusCode(_0x345587,_0x212011){_0x212011=_0x212011||0xcc;return function(_0x44e42c){if(_0x44e42c){return _0x345587[_0x3695('0x15')](_0x212011);}return _0x345587[_0x3695('0x16')](_0x212011)[_0x3695('0x17')]();};}function respondWithResult(_0x4df429,_0x26dfc9){_0x26dfc9=_0x26dfc9||0xc8;return function(_0xc5dc5){if(_0xc5dc5){return _0x4df429[_0x3695('0x16')](_0x26dfc9)['json'](_0xc5dc5);}};}function respondWithFilteredResult(_0x3aa59d,_0x231c7d){return function(_0x2cdd3){if(_0x2cdd3){var _0x3cb320=typeof _0x231c7d[_0x3695('0x18')]===_0x3695('0x19')&&typeof _0x231c7d[_0x3695('0x1a')]==='undefined';var _0x717ee4=_0x2cdd3['count'];var _0x1082db=_0x3cb320?0x0:_0x231c7d[_0x3695('0x18')];var _0x1553ea=_0x3cb320?_0x2cdd3[_0x3695('0x1b')]:_0x231c7d[_0x3695('0x18')]+_0x231c7d['limit'];var _0x1bb921;if(_0x1553ea>=_0x717ee4){_0x1553ea=_0x717ee4;_0x1bb921=0xc8;}else{_0x1bb921=0xce;}_0x3aa59d[_0x3695('0x16')](_0x1bb921);return _0x3aa59d[_0x3695('0x1c')](_0x3695('0x1d'),_0x1082db+'-'+_0x1553ea+'/'+_0x717ee4)[_0x3695('0x1e')](_0x2cdd3);}return null;};}function patchUpdates(_0x1ebba8){return function(_0x34b0fc){try{jsonpatch[_0x3695('0x1f')](_0x34b0fc,_0x1ebba8,!![]);}catch(_0x1f267a){return BPromise[_0x3695('0x20')](_0x1f267a);}return _0x34b0fc[_0x3695('0x21')]();};}function saveUpdates(_0xf2c747,_0x459f33){return function(_0x30d713){if(_0x30d713){return _0x30d713['update'](_0xf2c747)[_0x3695('0x22')](function(_0xdb0934){return _0xdb0934;});}return null;};}function removeEntity(_0x4899c0,_0x4940e9){return function(_0x3ac6aa){if(_0x3ac6aa){return _0x3ac6aa[_0x3695('0x23')]()[_0x3695('0x22')](function(){_0x4899c0[_0x3695('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x180f77,_0x48c2fd){return function(_0xeddb06){if(!_0xeddb06){_0x180f77['sendStatus'](0x194);}return _0xeddb06;};}function handleError(_0xe085de,_0x5adea3){_0x5adea3=_0x5adea3||0x1f4;return function(_0x366d71){logger[_0x3695('0x24')](_0x366d71[_0x3695('0x25')]);if(_0x366d71[_0x3695('0x26')]){delete _0x366d71[_0x3695('0x26')];}_0xe085de[_0x3695('0x16')](_0x5adea3)['send'](_0x366d71);};}exports[_0x3695('0x27')]=function(_0x354ae0,_0x5f193c){var _0x392107={},_0x4d0742={},_0x39c39f={'count':0x0,'rows':[]};var _0x399bc6=_[_0x3695('0x28')](db[_0x3695('0x29')][_0x3695('0x2a')],function(_0x21f379){return{'name':_0x21f379[_0x3695('0x2b')],'type':_0x21f379[_0x3695('0x2c')]['key']};});_0x4d0742[_0x3695('0x2d')]=_[_0x3695('0x28')](_0x399bc6,_0x3695('0x26'));_0x4d0742['query']=_['keys'](_0x354ae0[_0x3695('0x2e')]);_0x4d0742['filters']=_[_0x3695('0x2f')](_0x4d0742[_0x3695('0x2d')],_0x4d0742['query']);_0x392107[_0x3695('0x30')]=_['intersection'](_0x4d0742[_0x3695('0x2d')],qs[_0x3695('0x31')](_0x354ae0[_0x3695('0x2e')][_0x3695('0x31')]));_0x392107[_0x3695('0x30')]=_0x392107[_0x3695('0x30')]['length']?_0x392107[_0x3695('0x30')]:_0x4d0742[_0x3695('0x2d')];if(!_0x354ae0['query'][_0x3695('0x32')](_0x3695('0x33'))){_0x392107['limit']=qs['limit'](_0x354ae0['query']['limit']);_0x392107[_0x3695('0x18')]=qs[_0x3695('0x18')](_0x354ae0['query'][_0x3695('0x18')]);}_0x392107[_0x3695('0x34')]=qs[_0x3695('0x35')](_0x354ae0[_0x3695('0x2e')]['sort']);_0x392107['where']=qs[_0x3695('0x36')](_[_0x3695('0x37')](_0x354ae0['query'],_0x4d0742[_0x3695('0x36')]),_0x399bc6);if(_0x354ae0[_0x3695('0x2e')][_0x3695('0x38')]){_0x392107[_0x3695('0x39')]=_[_0x3695('0x3a')](_0x392107[_0x3695('0x39')],{'$or':_[_0x3695('0x28')](_0x399bc6,function(_0x21a0b8){if(_0x21a0b8[_0x3695('0x2c')]!==_0x3695('0x3b')){var _0x460b49={};_0x460b49[_0x21a0b8[_0x3695('0x26')]]={'$like':'%'+_0x354ae0[_0x3695('0x2e')][_0x3695('0x38')]+'%'};return _0x460b49;}})});}_0x392107=_[_0x3695('0x3a')]({},_0x392107,_0x354ae0[_0x3695('0x3c')]);var _0x599a0c={'where':_0x392107[_0x3695('0x39')]};return db[_0x3695('0x29')][_0x3695('0x1b')](_0x599a0c)[_0x3695('0x22')](function(_0x3eba18){_0x39c39f[_0x3695('0x1b')]=_0x3eba18;if(_0x354ae0[_0x3695('0x2e')]['includeAll']){_0x392107[_0x3695('0x3d')]=[{'all':!![]}];}return db[_0x3695('0x29')][_0x3695('0x3e')](_0x392107);})['then'](function(_0x226db8){_0x39c39f[_0x3695('0x3f')]=_0x226db8;return _0x39c39f;})[_0x3695('0x22')](respondWithFilteredResult(_0x5f193c,_0x392107))[_0x3695('0x40')](handleError(_0x5f193c,null));};exports[_0x3695('0x41')]=function(_0x322923,_0x4261d1){var _0x5b825a={'raw':![],'where':{'id':_0x322923['params']['id']}},_0x1b56cc={};_0x1b56cc['model']=_[_0x3695('0x42')](db['FreshdeskAccount'][_0x3695('0x2a')]);_0x1b56cc[_0x3695('0x2e')]=_[_0x3695('0x42')](_0x322923[_0x3695('0x2e')]);_0x1b56cc['filters']=_[_0x3695('0x2f')](_0x1b56cc[_0x3695('0x2d')],_0x1b56cc[_0x3695('0x2e')]);_0x5b825a['attributes']=_[_0x3695('0x2f')](_0x1b56cc[_0x3695('0x2d')],qs[_0x3695('0x31')](_0x322923[_0x3695('0x2e')][_0x3695('0x31')]));_0x5b825a[_0x3695('0x30')]=_0x5b825a[_0x3695('0x30')][_0x3695('0x43')]?_0x5b825a[_0x3695('0x30')]:_0x1b56cc['model'];if(_0x322923['query'][_0x3695('0x44')]){_0x5b825a[_0x3695('0x3d')]=[{'all':!![]}];}_0x5b825a=_[_0x3695('0x3a')]({},_0x5b825a,_0x322923['options']);return db[_0x3695('0x29')][_0x3695('0x45')](_0x5b825a)[_0x3695('0x22')](handleEntityNotFound(_0x4261d1,null))['then'](respondWithResult(_0x4261d1,null))[_0x3695('0x40')](handleError(_0x4261d1,null));};exports[_0x3695('0x46')]=function(_0x3d6a61,_0x1abe89){return db[_0x3695('0x29')]['create'](_0x3d6a61[_0x3695('0x47')],{})[_0x3695('0x22')](respondWithResult(_0x1abe89,0xc9))[_0x3695('0x40')](handleError(_0x1abe89,null));};exports[_0x3695('0x48')]=function(_0x557619,_0xccc7b2){if(_0x557619['body']['id']){delete _0x557619['body']['id'];}return db[_0x3695('0x29')][_0x3695('0x45')]({'where':{'id':_0x557619[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0xccc7b2,null))[_0x3695('0x22')](saveUpdates(_0x557619['body'],null))['then'](respondWithResult(_0xccc7b2,null))['catch'](handleError(_0xccc7b2,null));};exports[_0x3695('0x23')]=function(_0x5eeaca,_0x4f5f1b){return db['FreshdeskAccount']['find']({'where':{'id':_0x5eeaca[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0x4f5f1b,null))['then'](removeEntity(_0x4f5f1b,null))[_0x3695('0x40')](handleError(_0x4f5f1b,null));};exports[_0x3695('0x4a')]=function(_0x567447,_0x4a0a78,_0x419ed6){var _0x2cf76d={};var _0x1a61d6={};var _0x56f7df;var _0x114423;return db[_0x3695('0x29')][_0x3695('0x4b')]({'where':{'id':_0x567447[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0x4a0a78,null))[_0x3695('0x22')](function(_0x3b5552){if(_0x3b5552){_0x56f7df=_0x3b5552;_0x1a61d6[_0x3695('0x2d')]=_[_0x3695('0x42')](db[_0x3695('0x4c')][_0x3695('0x2a')]);_0x1a61d6[_0x3695('0x2e')]=_[_0x3695('0x42')](_0x567447[_0x3695('0x2e')]);_0x1a61d6[_0x3695('0x36')]=_[_0x3695('0x2f')](_0x1a61d6[_0x3695('0x2d')],_0x1a61d6[_0x3695('0x2e')]);_0x2cf76d[_0x3695('0x30')]=_[_0x3695('0x2f')](_0x1a61d6[_0x3695('0x2d')],qs[_0x3695('0x31')](_0x567447[_0x3695('0x2e')]['fields']));_0x2cf76d['attributes']=_0x2cf76d[_0x3695('0x30')][_0x3695('0x43')]?_0x2cf76d['attributes']:_0x1a61d6[_0x3695('0x2d')];_0x2cf76d[_0x3695('0x34')]=qs[_0x3695('0x35')](_0x567447[_0x3695('0x2e')][_0x3695('0x35')]);_0x2cf76d[_0x3695('0x39')]=qs[_0x3695('0x36')](_[_0x3695('0x37')](_0x567447[_0x3695('0x2e')],_0x1a61d6[_0x3695('0x36')]));if(_0x567447['query'][_0x3695('0x38')]){_0x2cf76d[_0x3695('0x39')]=_[_0x3695('0x3a')](_0x2cf76d[_0x3695('0x39')],{'$or':_[_0x3695('0x28')](_0x2cf76d['attributes'],function(_0xb0b073){var _0x1384c2={};_0x1384c2[_0xb0b073]={'$like':'%'+_0x567447[_0x3695('0x2e')]['filter']+'%'};return _0x1384c2;})});}_0x2cf76d=_[_0x3695('0x3a')]({},_0x2cf76d,_0x567447[_0x3695('0x3c')]);return _0x56f7df['getConfigurations'](_0x2cf76d);}})['then'](function(_0x241027){if(_0x241027){_0x114423=_0x241027['length'];if(!_0x567447['query'][_0x3695('0x32')](_0x3695('0x33'))){_0x2cf76d[_0x3695('0x1a')]=qs[_0x3695('0x1a')](_0x567447[_0x3695('0x2e')]['limit']);_0x2cf76d[_0x3695('0x18')]=qs[_0x3695('0x18')](_0x567447[_0x3695('0x2e')]['offset']);}return _0x56f7df[_0x3695('0x4a')](_0x2cf76d);}})[_0x3695('0x22')](function(_0x18c77f){if(_0x18c77f){return _0x18c77f?{'count':_0x114423,'rows':_0x18c77f}:null;}})[_0x3695('0x22')](respondWithResult(_0x4a0a78,null))[_0x3695('0x40')](handleError(_0x4a0a78,null));};exports[_0x3695('0x4d')]=function(_0x558e82,_0x1c6516,_0x3a67bc){if(_0x558e82[_0x3695('0x47')]['id']){delete _0x558e82[_0x3695('0x47')]['id'];}return db[_0x3695('0x29')]['findOne']({'where':{'id':_0x558e82[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0x1c6516,null))[_0x3695('0x22')](function(_0x188bdc){if(_0x188bdc){_0x558e82[_0x3695('0x47')][_0x3695('0x4e')]=_0x188bdc['id'];_0x558e82['body'][_0x3695('0x4f')]=integrations[_0x3695('0x50')](_0x558e82['body']['channel'],_0x558e82[_0x3695('0x47')][_0x3695('0x2c')]);_0x558e82[_0x3695('0x47')]['Descriptions']=integrations[_0x3695('0x51')](_0x558e82[_0x3695('0x47')][_0x3695('0x52')],_0x558e82[_0x3695('0x47')][_0x3695('0x2c')]);return db['FreshdeskConfiguration'][_0x3695('0x46')](_0x558e82['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x3695('0x53')],'as':_0x3695('0x54')}]});}return null;})[_0x3695('0x22')](respondWithResult(_0x1c6516,null))[_0x3695('0x40')](handleError(_0x1c6516,null));};exports[_0x3695('0x55')]=function(_0x36777e,_0x3d7215,_0x3b0794){var _0x156031='';return db[_0x3695('0x29')][_0x3695('0x4b')]({'where':{'id':_0x36777e[_0x3695('0x49')]['id']},'attributes':['id',_0x3695('0x56'),_0x3695('0x57')]})[_0x3695('0x22')](handleEntityNotFound(_0x3d7215,null))[_0x3695('0x22')](function(_0x500234){if(_0x500234){_0x156031=_0x500234[_0x3695('0x56')];var _0x3610b2=_0x156031[_0x3695('0x58')](-0x1);if(_0x3610b2==='/'){_0x156031=_0x156031[_0x3695('0x59')](0x0,_0x156031[_0x3695('0x5a')](_0x3610b2));}return rp({'method':_0x3695('0x5b'),'uri':util['format'](_0x3695('0x5c'),_0x156031,_0x3695('0x5d')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x3695('0x5e')]('%s:X',_0x500234[_0x3695('0x57')]))[_0x3695('0x5f')](_0x3695('0x60')))},'json':!![]});}})[_0x3695('0x22')](function(_0x75339d){if(_0x75339d){var _0x57c6f3=[_0x3695('0x61'),_0x3695('0x62'),_0x3695('0x63'),'description','status','priority',_0x3695('0x64'),_0x3695('0x65'),'ticket_type',_0x3695('0x64'),_0x3695('0x66')];_[_0x3695('0x67')](_0x75339d,function(_0x27852b){return _0x57c6f3[_0x3695('0x68')](_0x27852b[_0x3695('0x26')])||!_0x27852b[_0x3695('0x69')]&&_0x27852b[_0x3695('0x2c')]!=='custom_text'&&_0x27852b[_0x3695('0x2c')]!==_0x3695('0x6a');});return{'count':_0x75339d[_0x3695('0x43')],'rows':_[_0x3695('0x28')](_0x75339d,function(_0xf4c7cf){return{'id':_0xf4c7cf[_0x3695('0x26')],'name':_0xf4c7cf[_0x3695('0x6b')],'custom':!_0xf4c7cf[_0x3695('0x69')],'options':_0xf4c7cf['choices']?_[_0x3695('0x28')](_0xf4c7cf[_0x3695('0x6c')],function(_0x1d5430){return{'name':_[_0x3695('0x6d')](_0x1d5430),'value':_0x1d5430};}):[]};})};}})[_0x3695('0x22')](respondWithResult(_0x3d7215,null))[_0x3695('0x40')](function(_0x3fa4b0){var _0x2ab830=_0x36777e[_0x3695('0x2e')][_0x3695('0x6e')]?0x1f4:_0x3fa4b0[_0x3695('0x6f')]||0x1f4;logger[_0x3695('0x24')](_0x3695('0x70'),'getFields',_0x2ab830,JSON['stringify'](_0x3fa4b0));delete _0x3fa4b0[_0x3695('0x26')];if(_0x2ab830===0x191){_0x2ab830=0x190;}_0x3d7215[_0x3695('0x16')](_0x2ab830)[_0x3695('0x71')](_0x36777e['query'][_0x3695('0x6e')]?{'message':_0x3695('0x72'),'statusCode':_0x3fa4b0[_0x3695('0x6f')]}:_0x3fa4b0);});}; \ No newline at end of file +var _0x8e44=['bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','map','FreshdeskAccount','rawAttributes','type','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','fields','length','find','create','body','findOne','FreshdeskConfiguration','getConfigurations','params','AccountId','channel','Descriptions','getDescriptions','FreshdeskField','Subjects','apiKey','remoteUri','slice','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','ticket_type','company','default','label','choices','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment'];(function(_0x8c59dd,_0x1083a5){var _0x4b0563=function(_0x10d3b7){while(--_0x10d3b7){_0x8c59dd['push'](_0x8c59dd['shift']());}};_0x4b0563(++_0x1083a5);}(_0x8e44,0x1ac));var _0x48e4=function(_0x2b7f97,_0x3fe5c6){_0x2b7f97=_0x2b7f97-0x0;var _0x3c2339=_0x8e44[_0x2b7f97];return _0x3c2339;};'use strict';var emlformat=require(_0x48e4('0x0'));var rimraf=require(_0x48e4('0x1'));var zipdir=require(_0x48e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x48e4('0x3'));var BPromise=require(_0x48e4('0x4'));var Mustache=require(_0x48e4('0x5'));var util=require(_0x48e4('0x6'));var path=require('path');var sox=require(_0x48e4('0x7'));var csv=require(_0x48e4('0x8'));var ejs=require(_0x48e4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x48e4('0xa'));var crypto=require(_0x48e4('0xb'));var jsforce=require(_0x48e4('0xc'));var deskjs=require(_0x48e4('0xd'));var toCsv=require(_0x48e4('0x8'));var querystring=require(_0x48e4('0xe'));var Papa=require(_0x48e4('0xf'));var Redis=require(_0x48e4('0x10'));var authService=require(_0x48e4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x48e4('0x12'));var hardwareService=require(_0x48e4('0x13'));var logger=require(_0x48e4('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x48e4('0x15'));var licenseUtil=require(_0x48e4('0x16'));var db=require(_0x48e4('0x17'))['db'];var integrations=require(_0x48e4('0x18'));function respondWithStatusCode(_0x55a9ab,_0x28c15a){_0x28c15a=_0x28c15a||0xcc;return function(_0x5edebe){if(_0x5edebe){return _0x55a9ab[_0x48e4('0x19')](_0x28c15a);}return _0x55a9ab[_0x48e4('0x1a')](_0x28c15a)[_0x48e4('0x1b')]();};}function respondWithResult(_0xb1f558,_0x12f7af){_0x12f7af=_0x12f7af||0xc8;return function(_0x39bd10){if(_0x39bd10){return _0xb1f558[_0x48e4('0x1a')](_0x12f7af)['json'](_0x39bd10);}};}function respondWithFilteredResult(_0x1c82d2,_0x15519c){return function(_0x5c8fe5){if(_0x5c8fe5){var _0x171f89=typeof _0x15519c[_0x48e4('0x1c')]==='undefined'&&typeof _0x15519c[_0x48e4('0x1d')]===_0x48e4('0x1e');var _0x12fc37=_0x5c8fe5['count'];var _0x231dcd=_0x171f89?0x0:_0x15519c[_0x48e4('0x1c')];var _0x4e3943=_0x171f89?_0x5c8fe5['count']:_0x15519c[_0x48e4('0x1c')]+_0x15519c['limit'];var _0x494927;if(_0x4e3943>=_0x12fc37){_0x4e3943=_0x12fc37;_0x494927=0xc8;}else{_0x494927=0xce;}_0x1c82d2[_0x48e4('0x1a')](_0x494927);return _0x1c82d2[_0x48e4('0x1f')](_0x48e4('0x20'),_0x231dcd+'-'+_0x4e3943+'/'+_0x12fc37)[_0x48e4('0x21')](_0x5c8fe5);}return null;};}function patchUpdates(_0xda50d1){return function(_0x5d86dc){try{jsonpatch['apply'](_0x5d86dc,_0xda50d1,!![]);}catch(_0x431c67){return BPromise[_0x48e4('0x22')](_0x431c67);}return _0x5d86dc[_0x48e4('0x23')]();};}function saveUpdates(_0x131817,_0x846128){return function(_0x377249){if(_0x377249){return _0x377249[_0x48e4('0x24')](_0x131817)[_0x48e4('0x25')](function(_0x73f81c){return _0x73f81c;});}return null;};}function removeEntity(_0x3c0082,_0x1a80ed){return function(_0x5cc3e6){if(_0x5cc3e6){return _0x5cc3e6[_0x48e4('0x26')]()[_0x48e4('0x25')](function(){_0x3c0082['status'](0xcc)[_0x48e4('0x1b')]();});}};}function handleEntityNotFound(_0x23b2ba,_0x4abfbc){return function(_0x9a1c6d){if(!_0x9a1c6d){_0x23b2ba[_0x48e4('0x19')](0x194);}return _0x9a1c6d;};}function handleError(_0x3a446c,_0xc113e3){_0xc113e3=_0xc113e3||0x1f4;return function(_0x1e7d7e){logger[_0x48e4('0x27')](_0x1e7d7e[_0x48e4('0x28')]);if(_0x1e7d7e['name']){delete _0x1e7d7e[_0x48e4('0x29')];}_0x3a446c[_0x48e4('0x1a')](_0xc113e3)['send'](_0x1e7d7e);};}exports['index']=function(_0x318d09,_0x4b8f3c){var _0x346765={},_0x214def={},_0x5a7685={'count':0x0,'rows':[]};var _0x3012b3=_[_0x48e4('0x2a')](db[_0x48e4('0x2b')][_0x48e4('0x2c')],function(_0x15a413){return{'name':_0x15a413['fieldName'],'type':_0x15a413[_0x48e4('0x2d')]['key']};});_0x214def['model']=_['map'](_0x3012b3,_0x48e4('0x29'));_0x214def[_0x48e4('0x2e')]=_[_0x48e4('0x2f')](_0x318d09[_0x48e4('0x2e')]);_0x214def[_0x48e4('0x30')]=_[_0x48e4('0x31')](_0x214def[_0x48e4('0x32')],_0x214def[_0x48e4('0x2e')]);_0x346765[_0x48e4('0x33')]=_[_0x48e4('0x31')](_0x214def[_0x48e4('0x32')],qs['fields'](_0x318d09['query']['fields']));_0x346765[_0x48e4('0x33')]=_0x346765[_0x48e4('0x33')]['length']?_0x346765[_0x48e4('0x33')]:_0x214def[_0x48e4('0x32')];if(!_0x318d09['query'][_0x48e4('0x34')](_0x48e4('0x35'))){_0x346765[_0x48e4('0x1d')]=qs[_0x48e4('0x1d')](_0x318d09['query'][_0x48e4('0x1d')]);_0x346765[_0x48e4('0x1c')]=qs['offset'](_0x318d09['query'][_0x48e4('0x1c')]);}_0x346765[_0x48e4('0x36')]=qs[_0x48e4('0x37')](_0x318d09['query'][_0x48e4('0x37')]);_0x346765[_0x48e4('0x38')]=qs['filters'](_[_0x48e4('0x39')](_0x318d09[_0x48e4('0x2e')],_0x214def[_0x48e4('0x30')]),_0x3012b3);if(_0x318d09[_0x48e4('0x2e')][_0x48e4('0x3a')]){_0x346765['where']=_[_0x48e4('0x3b')](_0x346765[_0x48e4('0x38')],{'$or':_[_0x48e4('0x2a')](_0x3012b3,function(_0x5eb2a6){if(_0x5eb2a6[_0x48e4('0x2d')]!=='VIRTUAL'){var _0x465a2f={};_0x465a2f[_0x5eb2a6[_0x48e4('0x29')]]={'$like':'%'+_0x318d09[_0x48e4('0x2e')][_0x48e4('0x3a')]+'%'};return _0x465a2f;}})});}_0x346765=_[_0x48e4('0x3b')]({},_0x346765,_0x318d09[_0x48e4('0x3c')]);var _0x3046a7={'where':_0x346765[_0x48e4('0x38')]};return db[_0x48e4('0x2b')][_0x48e4('0x3d')](_0x3046a7)[_0x48e4('0x25')](function(_0x526e96){_0x5a7685[_0x48e4('0x3d')]=_0x526e96;if(_0x318d09[_0x48e4('0x2e')][_0x48e4('0x3e')]){_0x346765[_0x48e4('0x3f')]=[{'all':!![]}];}return db[_0x48e4('0x2b')][_0x48e4('0x40')](_0x346765);})[_0x48e4('0x25')](function(_0x5ada7a){_0x5a7685[_0x48e4('0x41')]=_0x5ada7a;return _0x5a7685;})[_0x48e4('0x25')](respondWithFilteredResult(_0x4b8f3c,_0x346765))[_0x48e4('0x42')](handleError(_0x4b8f3c,null));};exports['show']=function(_0x1252b2,_0x331980){var _0x3cc197={'raw':![],'where':{'id':_0x1252b2['params']['id']}},_0x588b5c={};_0x588b5c[_0x48e4('0x32')]=_[_0x48e4('0x2f')](db['FreshdeskAccount'][_0x48e4('0x2c')]);_0x588b5c['query']=_['keys'](_0x1252b2['query']);_0x588b5c['filters']=_[_0x48e4('0x31')](_0x588b5c[_0x48e4('0x32')],_0x588b5c[_0x48e4('0x2e')]);_0x3cc197[_0x48e4('0x33')]=_[_0x48e4('0x31')](_0x588b5c[_0x48e4('0x32')],qs['fields'](_0x1252b2[_0x48e4('0x2e')][_0x48e4('0x43')]));_0x3cc197['attributes']=_0x3cc197['attributes'][_0x48e4('0x44')]?_0x3cc197[_0x48e4('0x33')]:_0x588b5c[_0x48e4('0x32')];if(_0x1252b2[_0x48e4('0x2e')]['includeAll']){_0x3cc197[_0x48e4('0x3f')]=[{'all':!![]}];}_0x3cc197=_[_0x48e4('0x3b')]({},_0x3cc197,_0x1252b2[_0x48e4('0x3c')]);return db[_0x48e4('0x2b')][_0x48e4('0x45')](_0x3cc197)[_0x48e4('0x25')](handleEntityNotFound(_0x331980,null))['then'](respondWithResult(_0x331980,null))[_0x48e4('0x42')](handleError(_0x331980,null));};exports[_0x48e4('0x46')]=function(_0x31ee7b,_0x9de3c4){return db[_0x48e4('0x2b')][_0x48e4('0x46')](_0x31ee7b[_0x48e4('0x47')],{})[_0x48e4('0x25')](respondWithResult(_0x9de3c4,0xc9))[_0x48e4('0x42')](handleError(_0x9de3c4,null));};exports[_0x48e4('0x24')]=function(_0x2436fb,_0x56186a){if(_0x2436fb[_0x48e4('0x47')]['id']){delete _0x2436fb['body']['id'];}return db['FreshdeskAccount'][_0x48e4('0x45')]({'where':{'id':_0x2436fb['params']['id']}})[_0x48e4('0x25')](handleEntityNotFound(_0x56186a,null))[_0x48e4('0x25')](saveUpdates(_0x2436fb[_0x48e4('0x47')],null))[_0x48e4('0x25')](respondWithResult(_0x56186a,null))[_0x48e4('0x42')](handleError(_0x56186a,null));};exports[_0x48e4('0x26')]=function(_0x10eb0c,_0x57c9e5){return db['FreshdeskAccount'][_0x48e4('0x45')]({'where':{'id':_0x10eb0c['params']['id']}})[_0x48e4('0x25')](handleEntityNotFound(_0x57c9e5,null))[_0x48e4('0x25')](removeEntity(_0x57c9e5,null))[_0x48e4('0x42')](handleError(_0x57c9e5,null));};exports['getConfigurations']=function(_0x14ed52,_0x15d1aa,_0x3dbef7){var _0x55d05d={};var _0x3d9db2={};var _0x9ae821;var _0x91b42d;return db[_0x48e4('0x2b')][_0x48e4('0x48')]({'where':{'id':_0x14ed52['params']['id']}})[_0x48e4('0x25')](handleEntityNotFound(_0x15d1aa,null))[_0x48e4('0x25')](function(_0x544137){if(_0x544137){_0x9ae821=_0x544137;_0x3d9db2[_0x48e4('0x32')]=_[_0x48e4('0x2f')](db[_0x48e4('0x49')][_0x48e4('0x2c')]);_0x3d9db2['query']=_['keys'](_0x14ed52['query']);_0x3d9db2['filters']=_[_0x48e4('0x31')](_0x3d9db2[_0x48e4('0x32')],_0x3d9db2[_0x48e4('0x2e')]);_0x55d05d[_0x48e4('0x33')]=_[_0x48e4('0x31')](_0x3d9db2[_0x48e4('0x32')],qs[_0x48e4('0x43')](_0x14ed52[_0x48e4('0x2e')][_0x48e4('0x43')]));_0x55d05d[_0x48e4('0x33')]=_0x55d05d[_0x48e4('0x33')][_0x48e4('0x44')]?_0x55d05d[_0x48e4('0x33')]:_0x3d9db2['model'];_0x55d05d[_0x48e4('0x36')]=qs[_0x48e4('0x37')](_0x14ed52[_0x48e4('0x2e')][_0x48e4('0x37')]);_0x55d05d[_0x48e4('0x38')]=qs[_0x48e4('0x30')](_[_0x48e4('0x39')](_0x14ed52[_0x48e4('0x2e')],_0x3d9db2[_0x48e4('0x30')]));if(_0x14ed52[_0x48e4('0x2e')][_0x48e4('0x3a')]){_0x55d05d[_0x48e4('0x38')]=_['merge'](_0x55d05d['where'],{'$or':_[_0x48e4('0x2a')](_0x55d05d[_0x48e4('0x33')],function(_0x2b0be2){var _0x1a30eb={};_0x1a30eb[_0x2b0be2]={'$like':'%'+_0x14ed52[_0x48e4('0x2e')]['filter']+'%'};return _0x1a30eb;})});}_0x55d05d=_[_0x48e4('0x3b')]({},_0x55d05d,_0x14ed52['options']);return _0x9ae821[_0x48e4('0x4a')](_0x55d05d);}})[_0x48e4('0x25')](function(_0xb6c870){if(_0xb6c870){_0x91b42d=_0xb6c870['length'];if(!_0x14ed52[_0x48e4('0x2e')][_0x48e4('0x34')](_0x48e4('0x35'))){_0x55d05d[_0x48e4('0x1d')]=qs[_0x48e4('0x1d')](_0x14ed52[_0x48e4('0x2e')][_0x48e4('0x1d')]);_0x55d05d['offset']=qs[_0x48e4('0x1c')](_0x14ed52[_0x48e4('0x2e')][_0x48e4('0x1c')]);}return _0x9ae821['getConfigurations'](_0x55d05d);}})[_0x48e4('0x25')](function(_0x1721b5){if(_0x1721b5){return _0x1721b5?{'count':_0x91b42d,'rows':_0x1721b5}:null;}})['then'](respondWithResult(_0x15d1aa,null))['catch'](handleError(_0x15d1aa,null));};exports['addConfiguration']=function(_0x108096,_0x2a895a,_0x571e3b){if(_0x108096[_0x48e4('0x47')]['id']){delete _0x108096[_0x48e4('0x47')]['id'];}return db[_0x48e4('0x2b')][_0x48e4('0x48')]({'where':{'id':_0x108096[_0x48e4('0x4b')]['id']}})[_0x48e4('0x25')](handleEntityNotFound(_0x2a895a,null))[_0x48e4('0x25')](function(_0x273d6a){if(_0x273d6a){_0x108096[_0x48e4('0x47')][_0x48e4('0x4c')]=_0x273d6a['id'];_0x108096['body']['Subjects']=integrations['getSubjects'](_0x108096[_0x48e4('0x47')][_0x48e4('0x4d')],_0x108096['body'][_0x48e4('0x2d')]);_0x108096['body'][_0x48e4('0x4e')]=integrations[_0x48e4('0x4f')](_0x108096[_0x48e4('0x47')][_0x48e4('0x4d')],_0x108096[_0x48e4('0x47')][_0x48e4('0x2d')]);return db[_0x48e4('0x49')][_0x48e4('0x46')](_0x108096[_0x48e4('0x47')],{'include':[{'model':db[_0x48e4('0x50')],'as':_0x48e4('0x51')},{'model':db[_0x48e4('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2a895a,null))[_0x48e4('0x42')](handleError(_0x2a895a,null));};exports['getFields']=function(_0x142a68,_0x1228e8,_0x5be949){var _0x274d07='';return db[_0x48e4('0x2b')][_0x48e4('0x48')]({'where':{'id':_0x142a68[_0x48e4('0x4b')]['id']},'attributes':['id','remoteUri',_0x48e4('0x52')]})['then'](handleEntityNotFound(_0x1228e8,null))[_0x48e4('0x25')](function(_0x3bbb93){if(_0x3bbb93){_0x274d07=_0x3bbb93[_0x48e4('0x53')];var _0x295122=_0x274d07[_0x48e4('0x54')](-0x1);if(_0x295122==='/'){_0x274d07=_0x274d07['substring'](0x0,_0x274d07[_0x48e4('0x55')](_0x295122));}return rp({'method':'GET','uri':util[_0x48e4('0x56')](_0x48e4('0x57'),_0x274d07,_0x48e4('0x58')),'headers':{'Authorization':util[_0x48e4('0x56')](_0x48e4('0x59'),new Buffer(util['format'](_0x48e4('0x5a'),_0x3bbb93[_0x48e4('0x52')]))[_0x48e4('0x5b')](_0x48e4('0x5c')))},'json':!![]});}})[_0x48e4('0x25')](function(_0x25d715){if(_0x25d715){var _0x35f964=[_0x48e4('0x5d'),_0x48e4('0x5e'),_0x48e4('0x5f'),'description','status',_0x48e4('0x60'),'group','source',_0x48e4('0x61'),'group',_0x48e4('0x62')];_['remove'](_0x25d715,function(_0x339f59){return _0x35f964['includes'](_0x339f59[_0x48e4('0x29')])||!_0x339f59[_0x48e4('0x63')]&&_0x339f59[_0x48e4('0x2d')]!=='custom_text'&&_0x339f59['type']!=='custom_dropdown';});return{'count':_0x25d715[_0x48e4('0x44')],'rows':_['map'](_0x25d715,function(_0xc2856){return{'id':_0xc2856[_0x48e4('0x29')],'name':_0xc2856[_0x48e4('0x64')],'custom':!_0xc2856['default'],'options':_0xc2856[_0x48e4('0x65')]?_[_0x48e4('0x2a')](_0xc2856[_0x48e4('0x65')],function(_0x184dd6){return{'name':_['capitalize'](_0x184dd6),'value':_0x184dd6};}):[]};})};}})[_0x48e4('0x25')](respondWithResult(_0x1228e8,null))[_0x48e4('0x42')](function(_0x5974f1){var _0x5cfabf=_0x142a68[_0x48e4('0x2e')]['test']?0x1f4:_0x5974f1['statusCode']||0x1f4;logger[_0x48e4('0x27')](_0x48e4('0x66'),_0x48e4('0x67'),_0x5cfabf,JSON[_0x48e4('0x68')](_0x5974f1));delete _0x5974f1[_0x48e4('0x29')];if(_0x5cfabf===0x191){_0x5cfabf=0x190;}_0x1228e8['status'](_0x5cfabf)['send'](_0x142a68[_0x48e4('0x2e')][_0x48e4('0x69')]?{'message':_0x48e4('0x6a'),'statusCode':_0x5974f1[_0x48e4('0x6b')]}:_0x5974f1);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 16dd1f6..24a47d4 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 _0x7807=['int_freshdesk_accounts','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x423dd4,_0x287532){var _0xb29406=function(_0x577c6f){while(--_0x577c6f){_0x423dd4['push'](_0x423dd4['shift']());}};_0xb29406(++_0x287532);}(_0x7807,0x1c9));var _0x7780=function(_0x32cffe,_0x280566){_0x32cffe=_0x32cffe-0x0;var _0x9d2c14=_0x7807[_0x32cffe];return _0x9d2c14;};'use strict';var _=require('lodash');var util=require(_0x7780('0x0'));var logger=require(_0x7780('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7780('0x2'));var rp=require(_0x7780('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7780('0x4'));var config=require(_0x7780('0x5'));var attributes=require(_0x7780('0x6'));var integrations=require(_0x7780('0x7'));module[_0x7780('0x8')]=function(_0x300058,_0x29d3ab){return _0x300058[_0x7780('0x9')](_0x7780('0xa'),attributes,{'tableName':_0x7780('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cda=['../../components/integrations/configuration','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x501d8a,_0x30a36a){var _0x474716=function(_0x339d28){while(--_0x339d28){_0x501d8a['push'](_0x501d8a['shift']());}};_0x474716(++_0x30a36a);}(_0x1cda,0x9f));var _0xa1cd=function(_0x466f97,_0xd7887b){_0x466f97=_0x466f97-0x0;var _0xec6b5c=_0x1cda[_0x466f97];return _0xec6b5c;};'use strict';var _=require(_0xa1cd('0x0'));var util=require(_0xa1cd('0x1'));var logger=require(_0xa1cd('0x2'))(_0xa1cd('0x3'));var moment=require(_0xa1cd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1cd('0x5'));var rimraf=require(_0xa1cd('0x6'));var config=require(_0xa1cd('0x7'));var attributes=require(_0xa1cd('0x8'));var integrations=require(_0xa1cd('0x9'));module['exports']=function(_0x322920,_0x3aea0f){return _0x322920[_0xa1cd('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xa1cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 8ef9aca..91f198e 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 _0xb4fc=['options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetFreshdeskAccount','FreshdeskAccount','findAll'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb4fc,0xdd));var _0xcb4f=function(_0x43c8ed,_0x3f7a15){_0x43c8ed=_0x43c8ed-0x0;var _0x444198=_0xb4fc[_0x43c8ed];return _0x444198;};'use strict';var _=require('lodash');var util=require(_0xcb4f('0x0'));var moment=require(_0xcb4f('0x1'));var BPromise=require(_0xcb4f('0x2'));var rs=require(_0xcb4f('0x3'));var fs=require('fs');var Redis=require(_0xcb4f('0x4'));var db=require(_0xcb4f('0x5'))['db'];var utils=require(_0xcb4f('0x6'));var logger=require(_0xcb4f('0x7'))(_0xcb4f('0x8'));var config=require(_0xcb4f('0x9'));var jayson=require(_0xcb4f('0xa'));var client=jayson[_0xcb4f('0xb')][_0xcb4f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c7179,_0x548ed0,_0x34fb3a){return new BPromise(function(_0x31cf98,_0x33dbec){return client['request'](_0x1c7179,_0x34fb3a)[_0xcb4f('0xd')](function(_0x38d06d){logger[_0xcb4f('0xe')](_0xcb4f('0xf'),_0x548ed0,_0xcb4f('0x10'));logger['debug'](_0xcb4f('0x11'),_0x548ed0,'request\x20sent',JSON[_0xcb4f('0x12')](_0x38d06d));if(_0x38d06d[_0xcb4f('0x13')]){if(_0x38d06d[_0xcb4f('0x13')]['code']===0x1f4){logger[_0xcb4f('0x13')](_0xcb4f('0xf'),_0x548ed0,_0x38d06d[_0xcb4f('0x13')][_0xcb4f('0x14')]);return _0x33dbec(_0x38d06d['error'][_0xcb4f('0x14')]);}logger[_0xcb4f('0x13')](_0xcb4f('0xf'),_0x548ed0,_0x38d06d[_0xcb4f('0x13')][_0xcb4f('0x14')]);return _0x31cf98(_0x38d06d['error'][_0xcb4f('0x14')]);}else{logger[_0xcb4f('0xe')](_0xcb4f('0xf'),_0x548ed0,_0xcb4f('0x10'));_0x31cf98(_0x38d06d['result'][_0xcb4f('0x14')]);}})['catch'](function(_0x559fae){logger[_0xcb4f('0x13')](_0xcb4f('0xf'),_0x548ed0,_0x559fae);_0x33dbec(_0x559fae);});});}exports[_0xcb4f('0x15')]=function(_0x415273){var _0x559cdb=this;return new Promise(function(_0x399471,_0x4347e0){return db[_0xcb4f('0x16')][_0xcb4f('0x17')]({'raw':_0x415273['options']?_0x415273[_0xcb4f('0x18')][_0xcb4f('0x19')]===undefined?!![]:![]:!![],'where':_0x415273[_0xcb4f('0x18')]?_0x415273['options'][_0xcb4f('0x1a')]||null:null,'attributes':_0x415273[_0xcb4f('0x18')]?_0x415273[_0xcb4f('0x18')][_0xcb4f('0x1b')]||null:null,'limit':_0x415273[_0xcb4f('0x18')]?_0x415273[_0xcb4f('0x18')][_0xcb4f('0x1c')]||null:null,'include':_0x415273[_0xcb4f('0x18')]?_0x415273[_0xcb4f('0x18')][_0xcb4f('0x1d')]?_[_0xcb4f('0x1e')](_0x415273[_0xcb4f('0x18')]['include'],function(_0x50c794){return{'model':db[_0x50c794[_0xcb4f('0x1f')]],'as':_0x50c794['as'],'attributes':_0x50c794[_0xcb4f('0x1b')],'include':_0x50c794['include']?_[_0xcb4f('0x1e')](_0x50c794['include'],function(_0x4ca17b){return{'model':db[_0x4ca17b['model']],'as':_0x4ca17b['as'],'attributes':_0x4ca17b[_0xcb4f('0x1b')],'include':_0x4ca17b['include']?_[_0xcb4f('0x1e')](_0x4ca17b[_0xcb4f('0x1d')],function(_0xfd0b4){return{'model':db[_0xfd0b4[_0xcb4f('0x1f')]],'as':_0xfd0b4['as'],'attributes':_0xfd0b4[_0xcb4f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aea80){logger[_0xcb4f('0xe')](_0xcb4f('0x15'),_0x415273);logger['debug']('GetFreshdeskAccount',_0x415273,JSON['stringify'](_0x2aea80));_0x399471(_0x2aea80);})['catch'](function(_0x34e712){logger[_0xcb4f('0x13')](_0xcb4f('0x15'),_0x34e712[_0xcb4f('0x14')],_0x415273);_0x4347e0(_0x559cdb['error'](0x1f4,_0x34e712[_0xcb4f('0x14')]));});});};exports[_0xcb4f('0x20')]=function(_0x3b03c4){var _0x3a832c=this;return new Promise(function(_0x202975,_0x579bf8){return db[_0xcb4f('0x16')][_0xcb4f('0x21')]({'raw':_0x3b03c4[_0xcb4f('0x18')]?_0x3b03c4[_0xcb4f('0x18')][_0xcb4f('0x19')]===undefined?!![]:![]:!![],'where':_0x3b03c4[_0xcb4f('0x18')]?_0x3b03c4[_0xcb4f('0x18')][_0xcb4f('0x1a')]||null:null,'attributes':_0x3b03c4[_0xcb4f('0x18')]?_0x3b03c4[_0xcb4f('0x18')][_0xcb4f('0x1b')]||null:null,'include':_0x3b03c4[_0xcb4f('0x18')]?_0x3b03c4[_0xcb4f('0x18')][_0xcb4f('0x1d')]?_[_0xcb4f('0x1e')](_0x3b03c4[_0xcb4f('0x18')][_0xcb4f('0x1d')],function(_0x5f017f){return{'model':db[_0x5f017f['model']],'as':_0x5f017f['as'],'attributes':_0x5f017f['attributes'],'include':_0x5f017f[_0xcb4f('0x1d')]?_[_0xcb4f('0x1e')](_0x5f017f[_0xcb4f('0x1d')],function(_0x3e1cd7){return{'model':db[_0x3e1cd7[_0xcb4f('0x1f')]],'as':_0x3e1cd7['as'],'attributes':_0x3e1cd7[_0xcb4f('0x1b')],'include':_0x3e1cd7[_0xcb4f('0x1d')]?_[_0xcb4f('0x1e')](_0x3e1cd7[_0xcb4f('0x1d')],function(_0x36f2c2){return{'model':db[_0x36f2c2[_0xcb4f('0x1f')]],'as':_0x36f2c2['as'],'attributes':_0x36f2c2[_0xcb4f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcb4f('0xd')](function(_0x379408){logger['info'](_0xcb4f('0x20'),_0x3b03c4);logger['debug'](_0xcb4f('0x20'),_0x3b03c4,JSON[_0xcb4f('0x12')](_0x379408));_0x202975(_0x379408);})[_0xcb4f('0x22')](function(_0xb30ed){logger[_0xcb4f('0x13')]('ShowFreshdeskAccount',_0xb30ed[_0xcb4f('0x14')],_0x3b03c4);_0x579bf8(_0x3a832c[_0xcb4f('0x13')](0x1f4,_0xb30ed[_0xcb4f('0x14')]));});});}; \ No newline at end of file +var _0x2d0c=['include','model','attributes','map','debug','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetFreshdeskAccount','findAll','options','raw','where','limit'];(function(_0x33512f,_0x4f5493){var _0x16a875=function(_0x146836){while(--_0x146836){_0x33512f['push'](_0x33512f['shift']());}};_0x16a875(++_0x4f5493);}(_0x2d0c,0x9d));var _0xc2d0=function(_0x5224b9,_0x195fcb){_0x5224b9=_0x5224b9-0x0;var _0x363bcc=_0x2d0c[_0x5224b9];return _0x363bcc;};'use strict';var _=require(_0xc2d0('0x0'));var util=require(_0xc2d0('0x1'));var moment=require(_0xc2d0('0x2'));var BPromise=require(_0xc2d0('0x3'));var rs=require(_0xc2d0('0x4'));var fs=require('fs');var Redis=require(_0xc2d0('0x5'));var db=require(_0xc2d0('0x6'))['db'];var utils=require(_0xc2d0('0x7'));var logger=require(_0xc2d0('0x8'))(_0xc2d0('0x9'));var config=require(_0xc2d0('0xa'));var jayson=require(_0xc2d0('0xb'));var client=jayson['client'][_0xc2d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1109b6,_0xa6c53f,_0x23cc23){return new BPromise(function(_0x1015ce,_0x1cba29){return client[_0xc2d0('0xd')](_0x1109b6,_0x23cc23)[_0xc2d0('0xe')](function(_0x4427c){logger[_0xc2d0('0xf')](_0xc2d0('0x10'),_0xa6c53f,_0xc2d0('0x11'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xa6c53f,_0xc2d0('0x11'),JSON['stringify'](_0x4427c));if(_0x4427c[_0xc2d0('0x12')]){if(_0x4427c[_0xc2d0('0x12')][_0xc2d0('0x13')]===0x1f4){logger[_0xc2d0('0x12')](_0xc2d0('0x10'),_0xa6c53f,_0x4427c[_0xc2d0('0x12')]['message']);return _0x1cba29(_0x4427c[_0xc2d0('0x12')]['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0xa6c53f,_0x4427c['error']['message']);return _0x1015ce(_0x4427c['error']['message']);}else{logger[_0xc2d0('0xf')](_0xc2d0('0x10'),_0xa6c53f,_0xc2d0('0x11'));_0x1015ce(_0x4427c['result'][_0xc2d0('0x14')]);}})[_0xc2d0('0x15')](function(_0x4c176d){logger[_0xc2d0('0x12')](_0xc2d0('0x10'),_0xa6c53f,_0x4c176d);_0x1cba29(_0x4c176d);});});}exports[_0xc2d0('0x16')]=function(_0x5351c9){var _0xad4ae8=this;return new Promise(function(_0xda3c44,_0x3bbce9){return db['FreshdeskAccount'][_0xc2d0('0x17')]({'raw':_0x5351c9[_0xc2d0('0x18')]?_0x5351c9['options'][_0xc2d0('0x19')]===undefined?!![]:![]:!![],'where':_0x5351c9[_0xc2d0('0x18')]?_0x5351c9[_0xc2d0('0x18')][_0xc2d0('0x1a')]||null:null,'attributes':_0x5351c9['options']?_0x5351c9[_0xc2d0('0x18')]['attributes']||null:null,'limit':_0x5351c9[_0xc2d0('0x18')]?_0x5351c9['options'][_0xc2d0('0x1b')]||null:null,'include':_0x5351c9[_0xc2d0('0x18')]?_0x5351c9[_0xc2d0('0x18')][_0xc2d0('0x1c')]?_['map'](_0x5351c9[_0xc2d0('0x18')][_0xc2d0('0x1c')],function(_0x427c5a){return{'model':db[_0x427c5a[_0xc2d0('0x1d')]],'as':_0x427c5a['as'],'attributes':_0x427c5a[_0xc2d0('0x1e')],'include':_0x427c5a[_0xc2d0('0x1c')]?_['map'](_0x427c5a[_0xc2d0('0x1c')],function(_0x2f2f71){return{'model':db[_0x2f2f71[_0xc2d0('0x1d')]],'as':_0x2f2f71['as'],'attributes':_0x2f2f71[_0xc2d0('0x1e')],'include':_0x2f2f71[_0xc2d0('0x1c')]?_[_0xc2d0('0x1f')](_0x2f2f71[_0xc2d0('0x1c')],function(_0x88009e){return{'model':db[_0x88009e['model']],'as':_0x88009e['as'],'attributes':_0x88009e[_0xc2d0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc2d0('0xe')](function(_0x37074a){logger[_0xc2d0('0xf')]('GetFreshdeskAccount',_0x5351c9);logger[_0xc2d0('0x20')](_0xc2d0('0x16'),_0x5351c9,JSON[_0xc2d0('0x21')](_0x37074a));_0xda3c44(_0x37074a);})[_0xc2d0('0x15')](function(_0x5da477){logger['error'](_0xc2d0('0x16'),_0x5da477['message'],_0x5351c9);_0x3bbce9(_0xad4ae8[_0xc2d0('0x12')](0x1f4,_0x5da477[_0xc2d0('0x14')]));});});};exports[_0xc2d0('0x22')]=function(_0x41ea53){var _0x296a69=this;return new Promise(function(_0x1805af,_0x116a5b){return db[_0xc2d0('0x23')][_0xc2d0('0x24')]({'raw':_0x41ea53['options']?_0x41ea53[_0xc2d0('0x18')][_0xc2d0('0x19')]===undefined?!![]:![]:!![],'where':_0x41ea53['options']?_0x41ea53['options']['where']||null:null,'attributes':_0x41ea53[_0xc2d0('0x18')]?_0x41ea53[_0xc2d0('0x18')][_0xc2d0('0x1e')]||null:null,'include':_0x41ea53[_0xc2d0('0x18')]?_0x41ea53[_0xc2d0('0x18')][_0xc2d0('0x1c')]?_[_0xc2d0('0x1f')](_0x41ea53[_0xc2d0('0x18')]['include'],function(_0x4f3d66){return{'model':db[_0x4f3d66[_0xc2d0('0x1d')]],'as':_0x4f3d66['as'],'attributes':_0x4f3d66[_0xc2d0('0x1e')],'include':_0x4f3d66[_0xc2d0('0x1c')]?_[_0xc2d0('0x1f')](_0x4f3d66[_0xc2d0('0x1c')],function(_0x1e19b6){return{'model':db[_0x1e19b6['model']],'as':_0x1e19b6['as'],'attributes':_0x1e19b6[_0xc2d0('0x1e')],'include':_0x1e19b6['include']?_['map'](_0x1e19b6[_0xc2d0('0x1c')],function(_0x16e43e){return{'model':db[_0x16e43e[_0xc2d0('0x1d')]],'as':_0x16e43e['as'],'attributes':_0x16e43e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc2d0('0xe')](function(_0xce6aaa){logger['info']('ShowFreshdeskAccount',_0x41ea53);logger[_0xc2d0('0x20')](_0xc2d0('0x22'),_0x41ea53,JSON['stringify'](_0xce6aaa));_0x1805af(_0xce6aaa);})[_0xc2d0('0x15')](function(_0x5a6749){logger[_0xc2d0('0x12')](_0xc2d0('0x22'),_0x5a6749[_0xc2d0('0x14')],_0x41ea53);_0x116a5b(_0x296a69[_0xc2d0('0x12')](0x1f4,_0x5a6749[_0xc2d0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 3a8e0c5..a1ed028 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 _0x97cf=['getDescriptions','post','create','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index','/:id','show','get','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0xd1eb9f,_0x2e4ab1){var _0x16432b=function(_0x50b2fd){while(--_0x50b2fd){_0xd1eb9f['push'](_0xd1eb9f['shift']());}};_0x16432b(++_0x2e4ab1);}(_0x97cf,0x1b9));var _0xf97c=function(_0x12dafa,_0x51ce5){_0x12dafa=_0x12dafa-0x0;var _0x1f3784=_0x97cf[_0x12dafa];return _0x1f3784;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf97c('0x0'));var timeout=require(_0xf97c('0x1'));var express=require(_0xf97c('0x2'));var router=express['Router']();var fs_extra=require(_0xf97c('0x3'));var auth=require(_0xf97c('0x4'));var interaction=require(_0xf97c('0x5'));var config=require(_0xf97c('0x6'));var controller=require(_0xf97c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf97c('0x8')]);router['get'](_0xf97c('0x9'),auth['isAuthenticated'](),controller[_0xf97c('0xa')]);router[_0xf97c('0xb')](_0xf97c('0xc'),auth[_0xf97c('0xd')](),controller[_0xf97c('0xe')]);router['get'](_0xf97c('0xf'),auth[_0xf97c('0xd')](),controller[_0xf97c('0x10')]);router[_0xf97c('0xb')](_0xf97c('0x11'),auth[_0xf97c('0xd')](),controller[_0xf97c('0x12')]);router[_0xf97c('0xb')]('/:id/tags',auth[_0xf97c('0xd')](),controller['getTags']);router[_0xf97c('0x13')]('/',auth[_0xf97c('0xd')](),controller[_0xf97c('0x14')]);router[_0xf97c('0x13')](_0xf97c('0x15'),auth[_0xf97c('0xd')](),controller[_0xf97c('0x16')]);router[_0xf97c('0x17')](_0xf97c('0x9'),auth[_0xf97c('0xd')](),controller[_0xf97c('0x18')]);router['delete'](_0xf97c('0x9'),auth[_0xf97c('0xd')](),controller[_0xf97c('0x19')]);module[_0xf97c('0x1a')]=router; \ No newline at end of file +var _0xa6d1=['index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x2a40f9,_0x58575c){var _0x23d1a7=function(_0x160946){while(--_0x160946){_0x2a40f9['push'](_0x2a40f9['shift']());}};_0x23d1a7(++_0x58575c);}(_0xa6d1,0x64));var _0x1a6d=function(_0x52a397,_0x50af17){_0x52a397=_0x52a397-0x0;var _0x14f164=_0xa6d1[_0x52a397];return _0x14f164;};'use strict';var multer=require(_0x1a6d('0x0'));var util=require(_0x1a6d('0x1'));var path=require(_0x1a6d('0x2'));var timeout=require(_0x1a6d('0x3'));var express=require(_0x1a6d('0x4'));var router=express[_0x1a6d('0x5')]();var fs_extra=require(_0x1a6d('0x6'));var auth=require(_0x1a6d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1a6d('0x8'));var controller=require(_0x1a6d('0x9'));router[_0x1a6d('0xa')]('/',auth[_0x1a6d('0xb')](),controller[_0x1a6d('0xc')]);router[_0x1a6d('0xa')](_0x1a6d('0xd'),auth[_0x1a6d('0xb')](),controller['show']);router[_0x1a6d('0xa')](_0x1a6d('0xe'),auth[_0x1a6d('0xb')](),controller[_0x1a6d('0xf')]);router[_0x1a6d('0xa')](_0x1a6d('0x10'),auth['isAuthenticated'](),controller[_0x1a6d('0x11')]);router['get'](_0x1a6d('0x12'),auth[_0x1a6d('0xb')](),controller[_0x1a6d('0x13')]);router['get'](_0x1a6d('0x14'),auth[_0x1a6d('0xb')](),controller[_0x1a6d('0x15')]);router[_0x1a6d('0x16')]('/',auth[_0x1a6d('0xb')](),controller[_0x1a6d('0x17')]);router[_0x1a6d('0x16')](_0x1a6d('0x14'),auth[_0x1a6d('0xb')](),controller[_0x1a6d('0x18')]);router['put']('/:id',auth[_0x1a6d('0xb')](),controller[_0x1a6d('0x19')]);router['delete'](_0x1a6d('0xd'),auth[_0x1a6d('0xb')](),controller[_0x1a6d('0x1a')]);module[_0x1a6d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8fa1309..8feeea7 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 _0x455e=['exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x455e,0xaa));var _0xe455=function(_0x536735,_0x4bb008){_0x536735=_0x536735-0x0;var _0xaed5c5=_0x455e[_0x536735];return _0xaed5c5;};'use strict';var Sequelize=require('sequelize');module[_0xe455('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe455('0x1')]}}; \ No newline at end of file +var _0x0470=['exports','STRING'];(function(_0x37924f,_0x200466){var _0x84086b=function(_0x52202d){while(--_0x52202d){_0x37924f['push'](_0x37924f['shift']());}};_0x84086b(++_0x200466);}(_0x0470,0x98));var _0x0047=function(_0x34f869,_0x7dfcc9){_0x34f869=_0x34f869-0x0;var _0x203f30=_0x0470[_0x34f869];return _0x203f30;};'use strict';var Sequelize=require('sequelize');module[_0x0047('0x0')]={'name':{'type':Sequelize[_0x0047('0x1')]},'description':{'type':Sequelize[_0x0047('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index cb99f2a..8819751 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 _0x4786=['index','FreshdeskConfiguration','rawAttributes','type','key','model','map','name','keys','filters','intersection','query','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','getFields','findOne','FreshdeskField','length','getSubjects','nolimit','getDescriptions','Tag','setTags','ids','rimraf','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','set','json','apply','reject','then','destroy','status','end','error','stack','send'];(function(_0x3e2465,_0x211e58){var _0x12df6c=function(_0x307aff){while(--_0x307aff){_0x3e2465['push'](_0x3e2465['shift']());}};_0x12df6c(++_0x211e58);}(_0x4786,0x1cb));var _0x6478=function(_0x48f071,_0x3bdbda){_0x48f071=_0x48f071-0x0;var _0x379e98=_0x4786[_0x48f071];return _0x379e98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6478('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6478('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6478('0x2'));var util=require(_0x6478('0x3'));var path=require(_0x6478('0x4'));var sox=require(_0x6478('0x5'));var csv=require('to-csv');var ejs=require(_0x6478('0x6'));var fs=require('fs');var fs_extra=require(_0x6478('0x7'));var _=require(_0x6478('0x8'));var squel=require(_0x6478('0x9'));var crypto=require(_0x6478('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6478('0xb'));var toCsv=require(_0x6478('0xc'));var querystring=require('querystring');var Papa=require(_0x6478('0xd'));var Redis=require(_0x6478('0xe'));var authService=require(_0x6478('0xf'));var qs=require(_0x6478('0x10'));var as=require(_0x6478('0x11'));var hardwareService=require(_0x6478('0x12'));var logger=require(_0x6478('0x13'))(_0x6478('0x14'));var utils=require(_0x6478('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6478('0x16'));var db=require(_0x6478('0x17'))['db'];function respondWithStatusCode(_0x4eaf57,_0x3e8384){_0x3e8384=_0x3e8384||0xcc;return function(_0x23b571){if(_0x23b571){return _0x4eaf57[_0x6478('0x18')](_0x3e8384);}return _0x4eaf57['status'](_0x3e8384)['end']();};}function respondWithResult(_0x4a3acf,_0x48c591){_0x48c591=_0x48c591||0xc8;return function(_0x4242da){if(_0x4242da){return _0x4a3acf['status'](_0x48c591)['json'](_0x4242da);}};}function respondWithFilteredResult(_0x4d48e0,_0x38ad41){return function(_0x189909){if(_0x189909){var _0x4f11ce=typeof _0x38ad41[_0x6478('0x19')]==='undefined'&&typeof _0x38ad41['limit']===_0x6478('0x1a');var _0x41b98a=_0x189909[_0x6478('0x1b')];var _0x4fadf5=_0x4f11ce?0x0:_0x38ad41[_0x6478('0x19')];var _0x4d5fa9=_0x4f11ce?_0x189909[_0x6478('0x1b')]:_0x38ad41[_0x6478('0x19')]+_0x38ad41['limit'];var _0x566787;if(_0x4d5fa9>=_0x41b98a){_0x4d5fa9=_0x41b98a;_0x566787=0xc8;}else{_0x566787=0xce;}_0x4d48e0['status'](_0x566787);return _0x4d48e0[_0x6478('0x1c')]('Content-Range',_0x4fadf5+'-'+_0x4d5fa9+'/'+_0x41b98a)[_0x6478('0x1d')](_0x189909);}return null;};}function patchUpdates(_0x12406c){return function(_0x14ca40){try{jsonpatch[_0x6478('0x1e')](_0x14ca40,_0x12406c,!![]);}catch(_0x2ffa49){return BPromise[_0x6478('0x1f')](_0x2ffa49);}return _0x14ca40['save']();};}function saveUpdates(_0x2eecc9,_0x3265cc){return function(_0x2c0df8){if(_0x2c0df8){return _0x2c0df8['update'](_0x2eecc9)[_0x6478('0x20')](function(_0x73dbe){return _0x73dbe;});}return null;};}function removeEntity(_0x3c1dcf,_0x4d3e8f){return function(_0x9b1c2){if(_0x9b1c2){return _0x9b1c2[_0x6478('0x21')]()[_0x6478('0x20')](function(){_0x3c1dcf[_0x6478('0x22')](0xcc)[_0x6478('0x23')]();});}};}function handleEntityNotFound(_0x37d258,_0xf6a064){return function(_0x5fe7){if(!_0x5fe7){_0x37d258[_0x6478('0x18')](0x194);}return _0x5fe7;};}function handleError(_0x4a7478,_0x19b463){_0x19b463=_0x19b463||0x1f4;return function(_0x7d7b5d){logger[_0x6478('0x24')](_0x7d7b5d[_0x6478('0x25')]);if(_0x7d7b5d['name']){delete _0x7d7b5d['name'];}_0x4a7478['status'](_0x19b463)[_0x6478('0x26')](_0x7d7b5d);};}exports[_0x6478('0x27')]=function(_0x489a9d,_0x2ce0dd){var _0x2f7209={},_0x55b5cf={},_0x10bffe={'count':0x0,'rows':[]};var _0x5d41e5=_['map'](db[_0x6478('0x28')][_0x6478('0x29')],function(_0x1fb837){return{'name':_0x1fb837['fieldName'],'type':_0x1fb837[_0x6478('0x2a')][_0x6478('0x2b')]};});_0x55b5cf[_0x6478('0x2c')]=_[_0x6478('0x2d')](_0x5d41e5,_0x6478('0x2e'));_0x55b5cf['query']=_[_0x6478('0x2f')](_0x489a9d['query']);_0x55b5cf[_0x6478('0x30')]=_[_0x6478('0x31')](_0x55b5cf[_0x6478('0x2c')],_0x55b5cf[_0x6478('0x32')]);_0x2f7209['attributes']=_[_0x6478('0x31')](_0x55b5cf['model'],qs[_0x6478('0x33')](_0x489a9d[_0x6478('0x32')][_0x6478('0x33')]));_0x2f7209['attributes']=_0x2f7209[_0x6478('0x34')]['length']?_0x2f7209['attributes']:_0x55b5cf[_0x6478('0x2c')];if(!_0x489a9d[_0x6478('0x32')][_0x6478('0x35')]('nolimit')){_0x2f7209['limit']=qs[_0x6478('0x36')](_0x489a9d[_0x6478('0x32')][_0x6478('0x36')]);_0x2f7209[_0x6478('0x19')]=qs[_0x6478('0x19')](_0x489a9d['query']['offset']);}_0x2f7209[_0x6478('0x37')]=qs[_0x6478('0x38')](_0x489a9d[_0x6478('0x32')][_0x6478('0x38')]);_0x2f7209['where']=qs['filters'](_[_0x6478('0x39')](_0x489a9d[_0x6478('0x32')],_0x55b5cf[_0x6478('0x30')]),_0x5d41e5);if(_0x489a9d['query'][_0x6478('0x3a')]){_0x2f7209[_0x6478('0x3b')]=_[_0x6478('0x3c')](_0x2f7209['where'],{'$or':_[_0x6478('0x2d')](_0x5d41e5,function(_0x5c5dbb){if(_0x5c5dbb[_0x6478('0x2a')]!=='VIRTUAL'){var _0x1d14a4={};_0x1d14a4[_0x5c5dbb[_0x6478('0x2e')]]={'$like':'%'+_0x489a9d[_0x6478('0x32')][_0x6478('0x3a')]+'%'};return _0x1d14a4;}})});}_0x2f7209=_[_0x6478('0x3c')]({},_0x2f7209,_0x489a9d[_0x6478('0x3d')]);var _0x36bc73={'where':_0x2f7209[_0x6478('0x3b')]};return db[_0x6478('0x28')]['count'](_0x36bc73)[_0x6478('0x20')](function(_0x9ae07c){_0x10bffe[_0x6478('0x1b')]=_0x9ae07c;if(_0x489a9d['query'][_0x6478('0x3e')]){_0x2f7209[_0x6478('0x3f')]=[{'all':!![]}];}return db[_0x6478('0x28')][_0x6478('0x40')](_0x2f7209);})['then'](function(_0x228e3c){_0x10bffe[_0x6478('0x41')]=_0x228e3c;return _0x10bffe;})[_0x6478('0x20')](respondWithFilteredResult(_0x2ce0dd,_0x2f7209))[_0x6478('0x42')](handleError(_0x2ce0dd,null));};exports[_0x6478('0x43')]=function(_0x2b5254,_0x1001d8){var _0x943777={'raw':![],'where':{'id':_0x2b5254[_0x6478('0x44')]['id']}},_0x1782c2={};_0x1782c2[_0x6478('0x2c')]=_[_0x6478('0x2f')](db[_0x6478('0x28')]['rawAttributes']);_0x1782c2[_0x6478('0x32')]=_[_0x6478('0x2f')](_0x2b5254[_0x6478('0x32')]);_0x1782c2[_0x6478('0x30')]=_['intersection'](_0x1782c2[_0x6478('0x2c')],_0x1782c2['query']);_0x943777['attributes']=_[_0x6478('0x31')](_0x1782c2[_0x6478('0x2c')],qs[_0x6478('0x33')](_0x2b5254['query'][_0x6478('0x33')]));_0x943777[_0x6478('0x34')]=_0x943777[_0x6478('0x34')]['length']?_0x943777[_0x6478('0x34')]:_0x1782c2['model'];if(_0x2b5254['query'][_0x6478('0x3e')]){_0x943777['include']=[{'all':!![]}];}_0x943777=_[_0x6478('0x3c')]({},_0x943777,_0x2b5254[_0x6478('0x3d')]);return db['FreshdeskConfiguration']['find'](_0x943777)[_0x6478('0x20')](handleEntityNotFound(_0x1001d8,null))[_0x6478('0x20')](respondWithResult(_0x1001d8,null))[_0x6478('0x42')](handleError(_0x1001d8,null));};exports[_0x6478('0x45')]=function(_0x51301f,_0xee70a4){return db['FreshdeskConfiguration'][_0x6478('0x45')](_0x51301f[_0x6478('0x46')],{})['then'](respondWithResult(_0xee70a4,0xc9))[_0x6478('0x42')](handleError(_0xee70a4,null));};exports[_0x6478('0x47')]=function(_0x3370cd,_0xc0f348){if(_0x3370cd[_0x6478('0x46')]['id']){delete _0x3370cd[_0x6478('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x6478('0x48')]({'where':{'id':_0x3370cd[_0x6478('0x44')]['id']}})['then'](handleEntityNotFound(_0xc0f348,null))[_0x6478('0x20')](saveUpdates(_0x3370cd[_0x6478('0x46')],null))[_0x6478('0x20')](respondWithResult(_0xc0f348,null))[_0x6478('0x42')](handleError(_0xc0f348,null));};exports[_0x6478('0x21')]=function(_0x3c0312,_0x2dfe51){return db[_0x6478('0x28')][_0x6478('0x48')]({'where':{'id':_0x3c0312[_0x6478('0x44')]['id']}})[_0x6478('0x20')](handleEntityNotFound(_0x2dfe51,null))[_0x6478('0x20')](removeEntity(_0x2dfe51,null))['catch'](handleError(_0x2dfe51,null));};exports[_0x6478('0x49')]=function(_0x3fde87,_0x45b0c0,_0xe9cadb){var _0xd4a62e={};var _0x4a08b3={};var _0x205eca;var _0x43b679;return db[_0x6478('0x28')][_0x6478('0x4a')]({'where':{'id':_0x3fde87[_0x6478('0x44')]['id']}})[_0x6478('0x20')](handleEntityNotFound(_0x45b0c0,null))[_0x6478('0x20')](function(_0x35976f){if(_0x35976f){_0x205eca=_0x35976f;_0x4a08b3[_0x6478('0x2c')]=_[_0x6478('0x2f')](db[_0x6478('0x4b')][_0x6478('0x29')]);_0x4a08b3[_0x6478('0x32')]=_[_0x6478('0x2f')](_0x3fde87[_0x6478('0x32')]);_0x4a08b3['filters']=_[_0x6478('0x31')](_0x4a08b3['model'],_0x4a08b3['query']);_0xd4a62e['attributes']=_[_0x6478('0x31')](_0x4a08b3[_0x6478('0x2c')],qs[_0x6478('0x33')](_0x3fde87['query'][_0x6478('0x33')]));_0xd4a62e[_0x6478('0x34')]=_0xd4a62e[_0x6478('0x34')][_0x6478('0x4c')]?_0xd4a62e[_0x6478('0x34')]:_0x4a08b3[_0x6478('0x2c')];_0xd4a62e[_0x6478('0x37')]=qs['sort'](_0x3fde87[_0x6478('0x32')]['sort']);_0xd4a62e['where']=qs[_0x6478('0x30')](_[_0x6478('0x39')](_0x3fde87[_0x6478('0x32')],_0x4a08b3[_0x6478('0x30')]));if(_0x3fde87[_0x6478('0x32')]['filter']){_0xd4a62e['where']=_[_0x6478('0x3c')](_0xd4a62e[_0x6478('0x3b')],{'$or':_['map'](_0xd4a62e[_0x6478('0x34')],function(_0x1bc43a){var _0x2fbfb5={};_0x2fbfb5[_0x1bc43a]={'$like':'%'+_0x3fde87['query'][_0x6478('0x3a')]+'%'};return _0x2fbfb5;})});}_0xd4a62e=_[_0x6478('0x3c')]({},_0xd4a62e,_0x3fde87[_0x6478('0x3d')]);return _0x205eca[_0x6478('0x49')](_0xd4a62e);}})[_0x6478('0x20')](function(_0x13276e){if(_0x13276e){_0x43b679=_0x13276e['length'];if(!_0x3fde87['query'][_0x6478('0x35')]('nolimit')){_0xd4a62e[_0x6478('0x36')]=qs[_0x6478('0x36')](_0x3fde87[_0x6478('0x32')][_0x6478('0x36')]);_0xd4a62e['offset']=qs[_0x6478('0x19')](_0x3fde87[_0x6478('0x32')]['offset']);}return _0x205eca['getFields'](_0xd4a62e);}})['then'](function(_0xbe4d26){if(_0xbe4d26){return _0xbe4d26?{'count':_0x43b679,'rows':_0xbe4d26}:null;}})[_0x6478('0x20')](respondWithResult(_0x45b0c0,null))[_0x6478('0x42')](handleError(_0x45b0c0,null));};exports['getSubjects']=function(_0x11fe9b,_0x5ec971,_0x53020b){var _0x78ea36={};var _0x581e96={};var _0x2276f0;var _0x1f51d5;return db[_0x6478('0x28')][_0x6478('0x4a')]({'where':{'id':_0x11fe9b['params']['id']}})['then'](handleEntityNotFound(_0x5ec971,null))[_0x6478('0x20')](function(_0x18f1ac){if(_0x18f1ac){_0x2276f0=_0x18f1ac;_0x581e96[_0x6478('0x2c')]=_['keys'](db[_0x6478('0x4b')][_0x6478('0x29')]);_0x581e96['query']=_['keys'](_0x11fe9b[_0x6478('0x32')]);_0x581e96[_0x6478('0x30')]=_[_0x6478('0x31')](_0x581e96[_0x6478('0x2c')],_0x581e96[_0x6478('0x32')]);_0x78ea36[_0x6478('0x34')]=_[_0x6478('0x31')](_0x581e96['model'],qs[_0x6478('0x33')](_0x11fe9b[_0x6478('0x32')][_0x6478('0x33')]));_0x78ea36['attributes']=_0x78ea36[_0x6478('0x34')]['length']?_0x78ea36[_0x6478('0x34')]:_0x581e96[_0x6478('0x2c')];_0x78ea36[_0x6478('0x37')]=qs[_0x6478('0x38')](_0x11fe9b['query']['sort']);_0x78ea36['where']=qs['filters'](_[_0x6478('0x39')](_0x11fe9b['query'],_0x581e96[_0x6478('0x30')]));if(_0x11fe9b[_0x6478('0x32')][_0x6478('0x3a')]){_0x78ea36['where']=_[_0x6478('0x3c')](_0x78ea36[_0x6478('0x3b')],{'$or':_[_0x6478('0x2d')](_0x78ea36['attributes'],function(_0x30b19c){var _0x46135c={};_0x46135c[_0x30b19c]={'$like':'%'+_0x11fe9b['query']['filter']+'%'};return _0x46135c;})});}_0x78ea36=_[_0x6478('0x3c')]({},_0x78ea36,_0x11fe9b[_0x6478('0x3d')]);return _0x2276f0[_0x6478('0x4d')](_0x78ea36);}})[_0x6478('0x20')](function(_0x191cff){if(_0x191cff){_0x1f51d5=_0x191cff['length'];if(!_0x11fe9b['query'][_0x6478('0x35')](_0x6478('0x4e'))){_0x78ea36[_0x6478('0x36')]=qs[_0x6478('0x36')](_0x11fe9b[_0x6478('0x32')][_0x6478('0x36')]);_0x78ea36[_0x6478('0x19')]=qs[_0x6478('0x19')](_0x11fe9b[_0x6478('0x32')]['offset']);}return _0x2276f0['getSubjects'](_0x78ea36);}})[_0x6478('0x20')](function(_0x3820df){if(_0x3820df){return _0x3820df?{'count':_0x1f51d5,'rows':_0x3820df}:null;}})[_0x6478('0x20')](respondWithResult(_0x5ec971,null))[_0x6478('0x42')](handleError(_0x5ec971,null));};exports[_0x6478('0x4f')]=function(_0x202d53,_0x531be9,_0x6f6197){var _0x23949a={};var _0x1e8c58={};var _0x52001a;var _0x2ce9ff;return db[_0x6478('0x28')]['findOne']({'where':{'id':_0x202d53[_0x6478('0x44')]['id']}})['then'](handleEntityNotFound(_0x531be9,null))['then'](function(_0x20e09c){if(_0x20e09c){_0x52001a=_0x20e09c;_0x1e8c58[_0x6478('0x2c')]=_[_0x6478('0x2f')](db[_0x6478('0x4b')][_0x6478('0x29')]);_0x1e8c58[_0x6478('0x32')]=_[_0x6478('0x2f')](_0x202d53['query']);_0x1e8c58[_0x6478('0x30')]=_[_0x6478('0x31')](_0x1e8c58['model'],_0x1e8c58['query']);_0x23949a[_0x6478('0x34')]=_[_0x6478('0x31')](_0x1e8c58[_0x6478('0x2c')],qs[_0x6478('0x33')](_0x202d53[_0x6478('0x32')][_0x6478('0x33')]));_0x23949a['attributes']=_0x23949a[_0x6478('0x34')]['length']?_0x23949a[_0x6478('0x34')]:_0x1e8c58[_0x6478('0x2c')];_0x23949a[_0x6478('0x37')]=qs[_0x6478('0x38')](_0x202d53[_0x6478('0x32')][_0x6478('0x38')]);_0x23949a['where']=qs[_0x6478('0x30')](_[_0x6478('0x39')](_0x202d53[_0x6478('0x32')],_0x1e8c58['filters']));if(_0x202d53[_0x6478('0x32')]['filter']){_0x23949a[_0x6478('0x3b')]=_[_0x6478('0x3c')](_0x23949a[_0x6478('0x3b')],{'$or':_[_0x6478('0x2d')](_0x23949a[_0x6478('0x34')],function(_0x30255d){var _0x22f09b={};_0x22f09b[_0x30255d]={'$like':'%'+_0x202d53[_0x6478('0x32')][_0x6478('0x3a')]+'%'};return _0x22f09b;})});}_0x23949a=_[_0x6478('0x3c')]({},_0x23949a,_0x202d53['options']);return _0x52001a[_0x6478('0x4f')](_0x23949a);}})[_0x6478('0x20')](function(_0x14f592){if(_0x14f592){_0x2ce9ff=_0x14f592[_0x6478('0x4c')];if(!_0x202d53[_0x6478('0x32')][_0x6478('0x35')](_0x6478('0x4e'))){_0x23949a['limit']=qs['limit'](_0x202d53['query']['limit']);_0x23949a[_0x6478('0x19')]=qs['offset'](_0x202d53[_0x6478('0x32')][_0x6478('0x19')]);}return _0x52001a[_0x6478('0x4f')](_0x23949a);}})['then'](function(_0x44b9ae){if(_0x44b9ae){return _0x44b9ae?{'count':_0x2ce9ff,'rows':_0x44b9ae}:null;}})['then'](respondWithResult(_0x531be9,null))['catch'](handleError(_0x531be9,null));};exports['getTags']=function(_0x59b3bb,_0x109078,_0x1ceebb){var _0x3af78f={};var _0x537a45={};var _0x3f914e;var _0x349605;return db['FreshdeskConfiguration'][_0x6478('0x4a')]({'where':{'id':_0x59b3bb[_0x6478('0x44')]['id']}})['then'](handleEntityNotFound(_0x109078,null))[_0x6478('0x20')](function(_0x3123bf){if(_0x3123bf){_0x3f914e=_0x3123bf;_0x537a45[_0x6478('0x2c')]=_['keys'](db[_0x6478('0x50')][_0x6478('0x29')]);_0x537a45[_0x6478('0x32')]=_[_0x6478('0x2f')](_0x59b3bb[_0x6478('0x32')]);_0x537a45[_0x6478('0x30')]=_[_0x6478('0x31')](_0x537a45[_0x6478('0x2c')],_0x537a45[_0x6478('0x32')]);_0x3af78f[_0x6478('0x34')]=_[_0x6478('0x31')](_0x537a45[_0x6478('0x2c')],qs[_0x6478('0x33')](_0x59b3bb[_0x6478('0x32')][_0x6478('0x33')]));_0x3af78f[_0x6478('0x34')]=_0x3af78f['attributes'][_0x6478('0x4c')]?_0x3af78f['attributes']:_0x537a45[_0x6478('0x2c')];_0x3af78f[_0x6478('0x37')]=qs[_0x6478('0x38')](_0x59b3bb[_0x6478('0x32')][_0x6478('0x38')]);_0x3af78f[_0x6478('0x3b')]=qs[_0x6478('0x30')](_[_0x6478('0x39')](_0x59b3bb[_0x6478('0x32')],_0x537a45[_0x6478('0x30')]));if(_0x59b3bb[_0x6478('0x32')][_0x6478('0x3a')]){_0x3af78f['where']=_[_0x6478('0x3c')](_0x3af78f[_0x6478('0x3b')],{'$or':_['map'](_0x3af78f[_0x6478('0x34')],function(_0x400a66){var _0x369093={};_0x369093[_0x400a66]={'$like':'%'+_0x59b3bb['query']['filter']+'%'};return _0x369093;})});}_0x3af78f=_[_0x6478('0x3c')]({},_0x3af78f,_0x59b3bb[_0x6478('0x3d')]);return _0x3f914e['getTags'](_0x3af78f);}})[_0x6478('0x20')](function(_0x5261a3){if(_0x5261a3){_0x349605=_0x5261a3[_0x6478('0x4c')];if(!_0x59b3bb[_0x6478('0x32')][_0x6478('0x35')]('nolimit')){_0x3af78f[_0x6478('0x36')]=qs[_0x6478('0x36')](_0x59b3bb['query'][_0x6478('0x36')]);_0x3af78f[_0x6478('0x19')]=qs['offset'](_0x59b3bb[_0x6478('0x32')]['offset']);}return _0x3f914e['getTags'](_0x3af78f);}})[_0x6478('0x20')](function(_0x3dbe20){if(_0x3dbe20){return _0x3dbe20?{'count':_0x349605,'rows':_0x3dbe20}:null;}})['then'](respondWithResult(_0x109078,null))[_0x6478('0x42')](handleError(_0x109078,null));};exports['setTags']=function(_0x44cd99,_0x349654,_0x5ab88b){if(_0x44cd99[_0x6478('0x46')]['id']){delete _0x44cd99[_0x6478('0x46')]['id'];}return db[_0x6478('0x28')][_0x6478('0x4a')]({'where':{'id':_0x44cd99[_0x6478('0x44')]['id']}})[_0x6478('0x20')](handleEntityNotFound(_0x349654,null))[_0x6478('0x20')](function(_0x4c8d9b){if(_0x4c8d9b){return _0x4c8d9b[_0x6478('0x51')](_0x44cd99[_0x6478('0x46')][_0x6478('0x52')]||[]);}return null;})['then'](respondWithResult(_0x349654,null))[_0x6478('0x42')](handleError(_0x349654,null));}; \ No newline at end of file +var _0xbfe3=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','stack','index','map','FreshdeskConfiguration','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','params','destroy','getFields','FreshdeskField','order','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0xc95f8f,_0x48b73e){var _0x4070b4=function(_0x9e9e0f){while(--_0x9e9e0f){_0xc95f8f['push'](_0xc95f8f['shift']());}};_0x4070b4(++_0x48b73e);}(_0xbfe3,0x9c));var _0x3bfe=function(_0x4695b9,_0x3f8646){_0x4695b9=_0x4695b9-0x0;var _0x4d3957=_0xbfe3[_0x4695b9];return _0x4d3957;};'use strict';var emlformat=require(_0x3bfe('0x0'));var rimraf=require(_0x3bfe('0x1'));var zipdir=require(_0x3bfe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bfe('0x3'));var moment=require('moment');var BPromise=require(_0x3bfe('0x4'));var Mustache=require(_0x3bfe('0x5'));var util=require(_0x3bfe('0x6'));var path=require('path');var sox=require(_0x3bfe('0x7'));var csv=require(_0x3bfe('0x8'));var ejs=require(_0x3bfe('0x9'));var fs=require('fs');var fs_extra=require(_0x3bfe('0xa'));var _=require(_0x3bfe('0xb'));var squel=require(_0x3bfe('0xc'));var crypto=require('crypto');var jsforce=require(_0x3bfe('0xd'));var deskjs=require(_0x3bfe('0xe'));var toCsv=require(_0x3bfe('0x8'));var querystring=require(_0x3bfe('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3bfe('0x10'));var as=require(_0x3bfe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bfe('0x12'))('api');var utils=require(_0x3bfe('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5be5ef,_0x42c9b2){_0x42c9b2=_0x42c9b2||0xcc;return function(_0x4239ce){if(_0x4239ce){return _0x5be5ef['sendStatus'](_0x42c9b2);}return _0x5be5ef[_0x3bfe('0x14')](_0x42c9b2)[_0x3bfe('0x15')]();};}function respondWithResult(_0x5568fc,_0x3ff229){_0x3ff229=_0x3ff229||0xc8;return function(_0x4f0eb8){if(_0x4f0eb8){return _0x5568fc[_0x3bfe('0x14')](_0x3ff229)[_0x3bfe('0x16')](_0x4f0eb8);}};}function respondWithFilteredResult(_0x5a008a,_0x167469){return function(_0x16026c){if(_0x16026c){var _0x47f5dc=typeof _0x167469['offset']===_0x3bfe('0x17')&&typeof _0x167469['limit']==='undefined';var _0x43e4d8=_0x16026c[_0x3bfe('0x18')];var _0x5f1f7d=_0x47f5dc?0x0:_0x167469[_0x3bfe('0x19')];var _0x2121dd=_0x47f5dc?_0x16026c[_0x3bfe('0x18')]:_0x167469[_0x3bfe('0x19')]+_0x167469[_0x3bfe('0x1a')];var _0x20764e;if(_0x2121dd>=_0x43e4d8){_0x2121dd=_0x43e4d8;_0x20764e=0xc8;}else{_0x20764e=0xce;}_0x5a008a[_0x3bfe('0x14')](_0x20764e);return _0x5a008a[_0x3bfe('0x1b')](_0x3bfe('0x1c'),_0x5f1f7d+'-'+_0x2121dd+'/'+_0x43e4d8)[_0x3bfe('0x16')](_0x16026c);}return null;};}function patchUpdates(_0x12d009){return function(_0x12fd5c){try{jsonpatch[_0x3bfe('0x1d')](_0x12fd5c,_0x12d009,!![]);}catch(_0x1b04bf){return BPromise[_0x3bfe('0x1e')](_0x1b04bf);}return _0x12fd5c[_0x3bfe('0x1f')]();};}function saveUpdates(_0x2e2526,_0x3d6804){return function(_0x49bce5){if(_0x49bce5){return _0x49bce5['update'](_0x2e2526)[_0x3bfe('0x20')](function(_0x22e6c2){return _0x22e6c2;});}return null;};}function removeEntity(_0x300bae,_0x8dc477){return function(_0x3e7324){if(_0x3e7324){return _0x3e7324['destroy']()[_0x3bfe('0x20')](function(){_0x300bae[_0x3bfe('0x14')](0xcc)[_0x3bfe('0x15')]();});}};}function handleEntityNotFound(_0x13666f,_0x1bd800){return function(_0x173dac){if(!_0x173dac){_0x13666f[_0x3bfe('0x21')](0x194);}return _0x173dac;};}function handleError(_0x8eeb50,_0x559a58){_0x559a58=_0x559a58||0x1f4;return function(_0x5ece57){logger['error'](_0x5ece57[_0x3bfe('0x22')]);if(_0x5ece57['name']){delete _0x5ece57['name'];}_0x8eeb50[_0x3bfe('0x14')](_0x559a58)['send'](_0x5ece57);};}exports[_0x3bfe('0x23')]=function(_0x334229,_0x2e59f2){var _0xa68e72={},_0x48bb5a={},_0x4ae268={'count':0x0,'rows':[]};var _0x536d1c=_[_0x3bfe('0x24')](db[_0x3bfe('0x25')]['rawAttributes'],function(_0x2fa5c1){return{'name':_0x2fa5c1[_0x3bfe('0x26')],'type':_0x2fa5c1[_0x3bfe('0x27')][_0x3bfe('0x28')]};});_0x48bb5a[_0x3bfe('0x29')]=_[_0x3bfe('0x24')](_0x536d1c,_0x3bfe('0x2a'));_0x48bb5a['query']=_[_0x3bfe('0x2b')](_0x334229[_0x3bfe('0x2c')]);_0x48bb5a[_0x3bfe('0x2d')]=_[_0x3bfe('0x2e')](_0x48bb5a[_0x3bfe('0x29')],_0x48bb5a['query']);_0xa68e72[_0x3bfe('0x2f')]=_['intersection'](_0x48bb5a['model'],qs[_0x3bfe('0x30')](_0x334229[_0x3bfe('0x2c')][_0x3bfe('0x30')]));_0xa68e72[_0x3bfe('0x2f')]=_0xa68e72['attributes'][_0x3bfe('0x31')]?_0xa68e72[_0x3bfe('0x2f')]:_0x48bb5a[_0x3bfe('0x29')];if(!_0x334229[_0x3bfe('0x2c')]['hasOwnProperty'](_0x3bfe('0x32'))){_0xa68e72['limit']=qs[_0x3bfe('0x1a')](_0x334229[_0x3bfe('0x2c')][_0x3bfe('0x1a')]);_0xa68e72[_0x3bfe('0x19')]=qs[_0x3bfe('0x19')](_0x334229[_0x3bfe('0x2c')][_0x3bfe('0x19')]);}_0xa68e72['order']=qs[_0x3bfe('0x33')](_0x334229[_0x3bfe('0x2c')][_0x3bfe('0x33')]);_0xa68e72[_0x3bfe('0x34')]=qs[_0x3bfe('0x2d')](_[_0x3bfe('0x35')](_0x334229[_0x3bfe('0x2c')],_0x48bb5a[_0x3bfe('0x2d')]),_0x536d1c);if(_0x334229[_0x3bfe('0x2c')][_0x3bfe('0x36')]){_0xa68e72['where']=_[_0x3bfe('0x37')](_0xa68e72[_0x3bfe('0x34')],{'$or':_[_0x3bfe('0x24')](_0x536d1c,function(_0xcb66cd){if(_0xcb66cd['type']!==_0x3bfe('0x38')){var _0x139c88={};_0x139c88[_0xcb66cd['name']]={'$like':'%'+_0x334229['query']['filter']+'%'};return _0x139c88;}})});}_0xa68e72=_[_0x3bfe('0x37')]({},_0xa68e72,_0x334229[_0x3bfe('0x39')]);var _0x2b791c={'where':_0xa68e72[_0x3bfe('0x34')]};return db[_0x3bfe('0x25')]['count'](_0x2b791c)[_0x3bfe('0x20')](function(_0x2d3341){_0x4ae268['count']=_0x2d3341;if(_0x334229['query'][_0x3bfe('0x3a')]){_0xa68e72[_0x3bfe('0x3b')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x3bfe('0x3c')](_0xa68e72);})[_0x3bfe('0x20')](function(_0x51fde3){_0x4ae268[_0x3bfe('0x3d')]=_0x51fde3;return _0x4ae268;})[_0x3bfe('0x20')](respondWithFilteredResult(_0x2e59f2,_0xa68e72))['catch'](handleError(_0x2e59f2,null));};exports[_0x3bfe('0x3e')]=function(_0x39285c,_0x21a17c){var _0xeebadb={'raw':![],'where':{'id':_0x39285c['params']['id']}},_0x29499d={};_0x29499d['model']=_[_0x3bfe('0x2b')](db[_0x3bfe('0x25')][_0x3bfe('0x3f')]);_0x29499d[_0x3bfe('0x2c')]=_[_0x3bfe('0x2b')](_0x39285c[_0x3bfe('0x2c')]);_0x29499d[_0x3bfe('0x2d')]=_[_0x3bfe('0x2e')](_0x29499d[_0x3bfe('0x29')],_0x29499d[_0x3bfe('0x2c')]);_0xeebadb[_0x3bfe('0x2f')]=_['intersection'](_0x29499d[_0x3bfe('0x29')],qs[_0x3bfe('0x30')](_0x39285c[_0x3bfe('0x2c')]['fields']));_0xeebadb[_0x3bfe('0x2f')]=_0xeebadb['attributes'][_0x3bfe('0x31')]?_0xeebadb[_0x3bfe('0x2f')]:_0x29499d[_0x3bfe('0x29')];if(_0x39285c[_0x3bfe('0x2c')]['includeAll']){_0xeebadb[_0x3bfe('0x3b')]=[{'all':!![]}];}_0xeebadb=_[_0x3bfe('0x37')]({},_0xeebadb,_0x39285c['options']);return db[_0x3bfe('0x25')][_0x3bfe('0x40')](_0xeebadb)[_0x3bfe('0x20')](handleEntityNotFound(_0x21a17c,null))[_0x3bfe('0x20')](respondWithResult(_0x21a17c,null))['catch'](handleError(_0x21a17c,null));};exports[_0x3bfe('0x41')]=function(_0x1513d2,_0x59ba5b){return db[_0x3bfe('0x25')][_0x3bfe('0x41')](_0x1513d2[_0x3bfe('0x42')],{})[_0x3bfe('0x20')](respondWithResult(_0x59ba5b,0xc9))[_0x3bfe('0x43')](handleError(_0x59ba5b,null));};exports['update']=function(_0x3eb0db,_0x1cf873){if(_0x3eb0db[_0x3bfe('0x42')]['id']){delete _0x3eb0db[_0x3bfe('0x42')]['id'];}return db[_0x3bfe('0x25')]['find']({'where':{'id':_0x3eb0db[_0x3bfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x1cf873,null))[_0x3bfe('0x20')](saveUpdates(_0x3eb0db[_0x3bfe('0x42')],null))[_0x3bfe('0x20')](respondWithResult(_0x1cf873,null))[_0x3bfe('0x43')](handleError(_0x1cf873,null));};exports[_0x3bfe('0x45')]=function(_0x3176cd,_0x1facde){return db[_0x3bfe('0x25')][_0x3bfe('0x40')]({'where':{'id':_0x3176cd['params']['id']}})[_0x3bfe('0x20')](handleEntityNotFound(_0x1facde,null))['then'](removeEntity(_0x1facde,null))[_0x3bfe('0x43')](handleError(_0x1facde,null));};exports[_0x3bfe('0x46')]=function(_0xa5358d,_0xc0d915,_0x13c73b){var _0xdf55a1={};var _0x488652={};var _0x108cb0;var _0x397e7a;return db[_0x3bfe('0x25')]['findOne']({'where':{'id':_0xa5358d[_0x3bfe('0x44')]['id']}})[_0x3bfe('0x20')](handleEntityNotFound(_0xc0d915,null))[_0x3bfe('0x20')](function(_0x18b154){if(_0x18b154){_0x108cb0=_0x18b154;_0x488652[_0x3bfe('0x29')]=_[_0x3bfe('0x2b')](db[_0x3bfe('0x47')][_0x3bfe('0x3f')]);_0x488652[_0x3bfe('0x2c')]=_[_0x3bfe('0x2b')](_0xa5358d['query']);_0x488652[_0x3bfe('0x2d')]=_[_0x3bfe('0x2e')](_0x488652[_0x3bfe('0x29')],_0x488652['query']);_0xdf55a1['attributes']=_[_0x3bfe('0x2e')](_0x488652[_0x3bfe('0x29')],qs[_0x3bfe('0x30')](_0xa5358d['query'][_0x3bfe('0x30')]));_0xdf55a1[_0x3bfe('0x2f')]=_0xdf55a1['attributes'][_0x3bfe('0x31')]?_0xdf55a1[_0x3bfe('0x2f')]:_0x488652[_0x3bfe('0x29')];_0xdf55a1[_0x3bfe('0x48')]=qs[_0x3bfe('0x33')](_0xa5358d[_0x3bfe('0x2c')][_0x3bfe('0x33')]);_0xdf55a1[_0x3bfe('0x34')]=qs[_0x3bfe('0x2d')](_[_0x3bfe('0x35')](_0xa5358d[_0x3bfe('0x2c')],_0x488652[_0x3bfe('0x2d')]));if(_0xa5358d['query'][_0x3bfe('0x36')]){_0xdf55a1['where']=_['merge'](_0xdf55a1[_0x3bfe('0x34')],{'$or':_[_0x3bfe('0x24')](_0xdf55a1[_0x3bfe('0x2f')],function(_0x587b37){var _0x2634c5={};_0x2634c5[_0x587b37]={'$like':'%'+_0xa5358d[_0x3bfe('0x2c')][_0x3bfe('0x36')]+'%'};return _0x2634c5;})});}_0xdf55a1=_['merge']({},_0xdf55a1,_0xa5358d[_0x3bfe('0x39')]);return _0x108cb0[_0x3bfe('0x46')](_0xdf55a1);}})[_0x3bfe('0x20')](function(_0x3346b8){if(_0x3346b8){_0x397e7a=_0x3346b8['length'];if(!_0xa5358d[_0x3bfe('0x2c')][_0x3bfe('0x49')]('nolimit')){_0xdf55a1['limit']=qs[_0x3bfe('0x1a')](_0xa5358d['query'][_0x3bfe('0x1a')]);_0xdf55a1['offset']=qs[_0x3bfe('0x19')](_0xa5358d['query'][_0x3bfe('0x19')]);}return _0x108cb0[_0x3bfe('0x46')](_0xdf55a1);}})['then'](function(_0xf09b2e){if(_0xf09b2e){return _0xf09b2e?{'count':_0x397e7a,'rows':_0xf09b2e}:null;}})['then'](respondWithResult(_0xc0d915,null))['catch'](handleError(_0xc0d915,null));};exports[_0x3bfe('0x4a')]=function(_0x47cdfa,_0x58f419,_0x11d116){var _0x86ffa={};var _0x51a617={};var _0x633ce7;var _0x5318c3;return db[_0x3bfe('0x25')][_0x3bfe('0x4b')]({'where':{'id':_0x47cdfa[_0x3bfe('0x44')]['id']}})[_0x3bfe('0x20')](handleEntityNotFound(_0x58f419,null))[_0x3bfe('0x20')](function(_0x20e386){if(_0x20e386){_0x633ce7=_0x20e386;_0x51a617[_0x3bfe('0x29')]=_['keys'](db[_0x3bfe('0x47')][_0x3bfe('0x3f')]);_0x51a617[_0x3bfe('0x2c')]=_[_0x3bfe('0x2b')](_0x47cdfa[_0x3bfe('0x2c')]);_0x51a617[_0x3bfe('0x2d')]=_[_0x3bfe('0x2e')](_0x51a617[_0x3bfe('0x29')],_0x51a617['query']);_0x86ffa[_0x3bfe('0x2f')]=_[_0x3bfe('0x2e')](_0x51a617[_0x3bfe('0x29')],qs[_0x3bfe('0x30')](_0x47cdfa['query'][_0x3bfe('0x30')]));_0x86ffa[_0x3bfe('0x2f')]=_0x86ffa[_0x3bfe('0x2f')][_0x3bfe('0x31')]?_0x86ffa[_0x3bfe('0x2f')]:_0x51a617[_0x3bfe('0x29')];_0x86ffa[_0x3bfe('0x48')]=qs[_0x3bfe('0x33')](_0x47cdfa[_0x3bfe('0x2c')][_0x3bfe('0x33')]);_0x86ffa[_0x3bfe('0x34')]=qs['filters'](_[_0x3bfe('0x35')](_0x47cdfa[_0x3bfe('0x2c')],_0x51a617[_0x3bfe('0x2d')]));if(_0x47cdfa[_0x3bfe('0x2c')][_0x3bfe('0x36')]){_0x86ffa['where']=_[_0x3bfe('0x37')](_0x86ffa[_0x3bfe('0x34')],{'$or':_[_0x3bfe('0x24')](_0x86ffa['attributes'],function(_0x55bd77){var _0xac6ce6={};_0xac6ce6[_0x55bd77]={'$like':'%'+_0x47cdfa[_0x3bfe('0x2c')][_0x3bfe('0x36')]+'%'};return _0xac6ce6;})});}_0x86ffa=_[_0x3bfe('0x37')]({},_0x86ffa,_0x47cdfa[_0x3bfe('0x39')]);return _0x633ce7['getSubjects'](_0x86ffa);}})[_0x3bfe('0x20')](function(_0x413bab){if(_0x413bab){_0x5318c3=_0x413bab[_0x3bfe('0x31')];if(!_0x47cdfa[_0x3bfe('0x2c')][_0x3bfe('0x49')]('nolimit')){_0x86ffa[_0x3bfe('0x1a')]=qs['limit'](_0x47cdfa['query'][_0x3bfe('0x1a')]);_0x86ffa['offset']=qs[_0x3bfe('0x19')](_0x47cdfa[_0x3bfe('0x2c')][_0x3bfe('0x19')]);}return _0x633ce7['getSubjects'](_0x86ffa);}})['then'](function(_0x3a3d27){if(_0x3a3d27){return _0x3a3d27?{'count':_0x5318c3,'rows':_0x3a3d27}:null;}})[_0x3bfe('0x20')](respondWithResult(_0x58f419,null))[_0x3bfe('0x43')](handleError(_0x58f419,null));};exports[_0x3bfe('0x4c')]=function(_0x37221b,_0x32dff3,_0x5ec49a){var _0x1f23fd={};var _0xa56ced={};var _0x4e490a;var _0x82bd7;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x37221b['params']['id']}})[_0x3bfe('0x20')](handleEntityNotFound(_0x32dff3,null))[_0x3bfe('0x20')](function(_0x57c6c0){if(_0x57c6c0){_0x4e490a=_0x57c6c0;_0xa56ced[_0x3bfe('0x29')]=_[_0x3bfe('0x2b')](db['FreshdeskField'][_0x3bfe('0x3f')]);_0xa56ced[_0x3bfe('0x2c')]=_['keys'](_0x37221b[_0x3bfe('0x2c')]);_0xa56ced['filters']=_[_0x3bfe('0x2e')](_0xa56ced[_0x3bfe('0x29')],_0xa56ced[_0x3bfe('0x2c')]);_0x1f23fd['attributes']=_[_0x3bfe('0x2e')](_0xa56ced[_0x3bfe('0x29')],qs[_0x3bfe('0x30')](_0x37221b[_0x3bfe('0x2c')][_0x3bfe('0x30')]));_0x1f23fd[_0x3bfe('0x2f')]=_0x1f23fd[_0x3bfe('0x2f')][_0x3bfe('0x31')]?_0x1f23fd[_0x3bfe('0x2f')]:_0xa56ced['model'];_0x1f23fd[_0x3bfe('0x48')]=qs['sort'](_0x37221b['query']['sort']);_0x1f23fd[_0x3bfe('0x34')]=qs[_0x3bfe('0x2d')](_[_0x3bfe('0x35')](_0x37221b['query'],_0xa56ced[_0x3bfe('0x2d')]));if(_0x37221b[_0x3bfe('0x2c')][_0x3bfe('0x36')]){_0x1f23fd['where']=_[_0x3bfe('0x37')](_0x1f23fd[_0x3bfe('0x34')],{'$or':_['map'](_0x1f23fd[_0x3bfe('0x2f')],function(_0x47f9de){var _0x38b68b={};_0x38b68b[_0x47f9de]={'$like':'%'+_0x37221b[_0x3bfe('0x2c')][_0x3bfe('0x36')]+'%'};return _0x38b68b;})});}_0x1f23fd=_['merge']({},_0x1f23fd,_0x37221b[_0x3bfe('0x39')]);return _0x4e490a[_0x3bfe('0x4c')](_0x1f23fd);}})['then'](function(_0x4e949e){if(_0x4e949e){_0x82bd7=_0x4e949e[_0x3bfe('0x31')];if(!_0x37221b[_0x3bfe('0x2c')][_0x3bfe('0x49')](_0x3bfe('0x32'))){_0x1f23fd['limit']=qs[_0x3bfe('0x1a')](_0x37221b['query'][_0x3bfe('0x1a')]);_0x1f23fd[_0x3bfe('0x19')]=qs[_0x3bfe('0x19')](_0x37221b[_0x3bfe('0x2c')]['offset']);}return _0x4e490a[_0x3bfe('0x4c')](_0x1f23fd);}})[_0x3bfe('0x20')](function(_0xa72eda){if(_0xa72eda){return _0xa72eda?{'count':_0x82bd7,'rows':_0xa72eda}:null;}})[_0x3bfe('0x20')](respondWithResult(_0x32dff3,null))[_0x3bfe('0x43')](handleError(_0x32dff3,null));};exports[_0x3bfe('0x4d')]=function(_0x3738ae,_0x5dcdf8,_0x46de8b){var _0x40cda6={};var _0x18edf4={};var _0x2aebc4;var _0x31341b;return db[_0x3bfe('0x25')][_0x3bfe('0x4b')]({'where':{'id':_0x3738ae[_0x3bfe('0x44')]['id']}})[_0x3bfe('0x20')](handleEntityNotFound(_0x5dcdf8,null))['then'](function(_0x2e90f1){if(_0x2e90f1){_0x2aebc4=_0x2e90f1;_0x18edf4[_0x3bfe('0x29')]=_[_0x3bfe('0x2b')](db[_0x3bfe('0x4e')][_0x3bfe('0x3f')]);_0x18edf4[_0x3bfe('0x2c')]=_[_0x3bfe('0x2b')](_0x3738ae[_0x3bfe('0x2c')]);_0x18edf4['filters']=_[_0x3bfe('0x2e')](_0x18edf4[_0x3bfe('0x29')],_0x18edf4[_0x3bfe('0x2c')]);_0x40cda6[_0x3bfe('0x2f')]=_['intersection'](_0x18edf4[_0x3bfe('0x29')],qs[_0x3bfe('0x30')](_0x3738ae[_0x3bfe('0x2c')][_0x3bfe('0x30')]));_0x40cda6['attributes']=_0x40cda6[_0x3bfe('0x2f')][_0x3bfe('0x31')]?_0x40cda6[_0x3bfe('0x2f')]:_0x18edf4[_0x3bfe('0x29')];_0x40cda6[_0x3bfe('0x48')]=qs[_0x3bfe('0x33')](_0x3738ae['query'][_0x3bfe('0x33')]);_0x40cda6[_0x3bfe('0x34')]=qs[_0x3bfe('0x2d')](_['pick'](_0x3738ae[_0x3bfe('0x2c')],_0x18edf4[_0x3bfe('0x2d')]));if(_0x3738ae['query']['filter']){_0x40cda6[_0x3bfe('0x34')]=_[_0x3bfe('0x37')](_0x40cda6[_0x3bfe('0x34')],{'$or':_[_0x3bfe('0x24')](_0x40cda6[_0x3bfe('0x2f')],function(_0x4aff32){var _0x18c343={};_0x18c343[_0x4aff32]={'$like':'%'+_0x3738ae[_0x3bfe('0x2c')][_0x3bfe('0x36')]+'%'};return _0x18c343;})});}_0x40cda6=_['merge']({},_0x40cda6,_0x3738ae[_0x3bfe('0x39')]);return _0x2aebc4[_0x3bfe('0x4d')](_0x40cda6);}})[_0x3bfe('0x20')](function(_0x2368a4){if(_0x2368a4){_0x31341b=_0x2368a4[_0x3bfe('0x31')];if(!_0x3738ae[_0x3bfe('0x2c')][_0x3bfe('0x49')](_0x3bfe('0x32'))){_0x40cda6[_0x3bfe('0x1a')]=qs['limit'](_0x3738ae[_0x3bfe('0x2c')][_0x3bfe('0x1a')]);_0x40cda6[_0x3bfe('0x19')]=qs['offset'](_0x3738ae[_0x3bfe('0x2c')][_0x3bfe('0x19')]);}return _0x2aebc4[_0x3bfe('0x4d')](_0x40cda6);}})[_0x3bfe('0x20')](function(_0x11b182){if(_0x11b182){return _0x11b182?{'count':_0x31341b,'rows':_0x11b182}:null;}})[_0x3bfe('0x20')](respondWithResult(_0x5dcdf8,null))[_0x3bfe('0x43')](handleError(_0x5dcdf8,null));};exports[_0x3bfe('0x4f')]=function(_0x13e2b8,_0x175cfd,_0x288946){if(_0x13e2b8[_0x3bfe('0x42')]['id']){delete _0x13e2b8[_0x3bfe('0x42')]['id'];}return db['FreshdeskConfiguration'][_0x3bfe('0x4b')]({'where':{'id':_0x13e2b8[_0x3bfe('0x44')]['id']}})[_0x3bfe('0x20')](handleEntityNotFound(_0x175cfd,null))[_0x3bfe('0x20')](function(_0x1de1f1){if(_0x1de1f1){return _0x1de1f1['setTags'](_0x13e2b8[_0x3bfe('0x42')][_0x3bfe('0x50')]||[]);}return null;})[_0x3bfe('0x20')](respondWithResult(_0x175cfd,null))['catch'](handleError(_0x175cfd,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 902673d..dcd74ee 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 _0x91c4=['moment','bluebird','request-promise','path','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x1faf3c,_0x43d524){var _0x41e99b=function(_0x2eb898){while(--_0x2eb898){_0x1faf3c['push'](_0x1faf3c['shift']());}};_0x41e99b(++_0x43d524);}(_0x91c4,0x170));var _0x491c=function(_0x4e83d2,_0xd3fbb4){_0x4e83d2=_0x4e83d2-0x0;var _0x366b3b=_0x91c4[_0x4e83d2];return _0x366b3b;};'use strict';var _=require(_0x491c('0x0'));var util=require(_0x491c('0x1'));var logger=require(_0x491c('0x2'))(_0x491c('0x3'));var moment=require(_0x491c('0x4'));var BPromise=require(_0x491c('0x5'));var rp=require(_0x491c('0x6'));var fs=require('fs');var path=require(_0x491c('0x7'));var rimraf=require('rimraf');var config=require(_0x491c('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x34b36d,_0x20aa2f){return _0x34b36d[_0x491c('0x9')](_0x491c('0xa'),attributes,{'tableName':_0x491c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e69=['lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','define','FreshdeskConfiguration'];(function(_0x2cf437,_0x5b0508){var _0x2f1fd2=function(_0x30f000){while(--_0x30f000){_0x2cf437['push'](_0x2cf437['shift']());}};_0x2f1fd2(++_0x5b0508);}(_0x6e69,0x186));var _0x96e6=function(_0x14d831,_0x38b288){_0x14d831=_0x14d831-0x0;var _0x377b85=_0x6e69[_0x14d831];return _0x377b85;};'use strict';var _=require(_0x96e6('0x0'));var util=require(_0x96e6('0x1'));var logger=require(_0x96e6('0x2'))(_0x96e6('0x3'));var moment=require(_0x96e6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x96e6('0x5'));var rimraf=require('rimraf');var config=require(_0x96e6('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x96e6('0x7')]=function(_0x130325,_0x462775){return _0x130325[_0x96e6('0x8')](_0x96e6('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index a39e427..3be039a 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 _0xcff0=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x2b0ce0,_0x394b3b){var _0x1b042d=function(_0x27e924){while(--_0x27e924){_0x2b0ce0['push'](_0x2b0ce0['shift']());}};_0x1b042d(++_0x394b3b);}(_0xcff0,0x13b));var _0x0cff=function(_0x2f5b67,_0x4fc1eb){_0x2f5b67=_0x2f5b67-0x0;var _0x54eb06=_0xcff0[_0x2f5b67];return _0x54eb06;};'use strict';var _=require('lodash');var util=require(_0x0cff('0x0'));var moment=require('moment');var BPromise=require(_0x0cff('0x1'));var rs=require(_0x0cff('0x2'));var fs=require('fs');var Redis=require(_0x0cff('0x3'));var db=require(_0x0cff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cff('0x5'))(_0x0cff('0x6'));var config=require(_0x0cff('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0cff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x347640,_0x2d87d0,_0x4eb73a){return new BPromise(function(_0xcd1ed,_0x507a2e){return client['request'](_0x347640,_0x4eb73a)[_0x0cff('0x9')](function(_0x20df84){logger[_0x0cff('0xa')](_0x0cff('0xb'),_0x2d87d0,_0x0cff('0xc'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2d87d0,_0x0cff('0xc'),JSON[_0x0cff('0xd')](_0x20df84));if(_0x20df84[_0x0cff('0xe')]){if(_0x20df84[_0x0cff('0xe')]['code']===0x1f4){logger[_0x0cff('0xe')](_0x0cff('0xb'),_0x2d87d0,_0x20df84[_0x0cff('0xe')][_0x0cff('0xf')]);return _0x507a2e(_0x20df84[_0x0cff('0xe')]['message']);}logger['error'](_0x0cff('0xb'),_0x2d87d0,_0x20df84[_0x0cff('0xe')][_0x0cff('0xf')]);return _0xcd1ed(_0x20df84[_0x0cff('0xe')]['message']);}else{logger['info'](_0x0cff('0xb'),_0x2d87d0,_0x0cff('0xc'));_0xcd1ed(_0x20df84[_0x0cff('0x10')][_0x0cff('0xf')]);}})[_0x0cff('0x11')](function(_0x2d0797){logger['error'](_0x0cff('0xb'),_0x2d87d0,_0x2d0797);_0x507a2e(_0x2d0797);});});} \ No newline at end of file +var _0xfd6f=['../../config/logger','rpc','jayson/promise','request','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','FreshdeskConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x57c9a9,_0x48c040){var _0x19a608=function(_0x671481){while(--_0x671481){_0x57c9a9['push'](_0x57c9a9['shift']());}};_0x19a608(++_0x48c040);}(_0xfd6f,0x19d));var _0xffd6=function(_0x362f0f,_0x193432){_0x362f0f=_0x362f0f-0x0;var _0x4bec98=_0xfd6f[_0x362f0f];return _0x4bec98;};'use strict';var _=require(_0xffd6('0x0'));var util=require('util');var moment=require(_0xffd6('0x1'));var BPromise=require(_0xffd6('0x2'));var rs=require(_0xffd6('0x3'));var fs=require('fs');var Redis=require(_0xffd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xffd6('0x5'))(_0xffd6('0x6'));var config=require('../../config/environment');var jayson=require(_0xffd6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27f37c,_0x5be271,_0xe1342){return new BPromise(function(_0x264df7,_0x4f970c){return client[_0xffd6('0x8')](_0x27f37c,_0xe1342)[_0xffd6('0x9')](function(_0x3962b7){logger[_0xffd6('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5be271,'request\x20sent');logger[_0xffd6('0xb')](_0xffd6('0xc'),_0x5be271,_0xffd6('0xd'),JSON[_0xffd6('0xe')](_0x3962b7));if(_0x3962b7['error']){if(_0x3962b7['error'][_0xffd6('0xf')]===0x1f4){logger[_0xffd6('0x10')](_0xffd6('0x11'),_0x5be271,_0x3962b7[_0xffd6('0x10')][_0xffd6('0x12')]);return _0x4f970c(_0x3962b7[_0xffd6('0x10')][_0xffd6('0x12')]);}logger[_0xffd6('0x10')](_0xffd6('0x11'),_0x5be271,_0x3962b7[_0xffd6('0x10')]['message']);return _0x264df7(_0x3962b7['error']['message']);}else{logger[_0xffd6('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5be271,_0xffd6('0xd'));_0x264df7(_0x3962b7['result'][_0xffd6('0x12')]);}})['catch'](function(_0x3aeae6){logger[_0xffd6('0x10')](_0xffd6('0x11'),_0x5be271,_0x3aeae6);_0x4f970c(_0x3aeae6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 1f2c75e..e3675b9 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 _0x01b0=['create','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id'];(function(_0x459bbc,_0x28177e){var _0x565d7b=function(_0x5ae4bc){while(--_0x5ae4bc){_0x459bbc['push'](_0x459bbc['shift']());}};_0x565d7b(++_0x28177e);}(_0x01b0,0xbe));var _0x001b=function(_0xe5530b,_0x4477ea){_0xe5530b=_0xe5530b-0x0;var _0x549c66=_0x01b0[_0xe5530b];return _0x549c66;};'use strict';var multer=require(_0x001b('0x0'));var util=require(_0x001b('0x1'));var path=require(_0x001b('0x2'));var timeout=require(_0x001b('0x3'));var express=require(_0x001b('0x4'));var router=express[_0x001b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x001b('0x6'));var interaction=require(_0x001b('0x7'));var config=require(_0x001b('0x8'));var controller=require(_0x001b('0x9'));router['get']('/',auth[_0x001b('0xa')](),controller[_0x001b('0xb')]);router[_0x001b('0xc')](_0x001b('0xd'),auth[_0x001b('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x001b('0xe')]);router[_0x001b('0xf')](_0x001b('0xd'),auth[_0x001b('0xa')](),controller['update']);router['delete']('/:id',auth[_0x001b('0xa')](),controller[_0x001b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9d44=['post','create','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x149a69,_0x4969b7){var _0x1e3de1=function(_0x99b61d){while(--_0x99b61d){_0x149a69['push'](_0x149a69['shift']());}};_0x1e3de1(++_0x4969b7);}(_0x9d44,0x1a7));var _0x49d4=function(_0x3ab0f1,_0x31acba){_0x3ab0f1=_0x3ab0f1-0x0;var _0x2c2fb8=_0x9d44[_0x3ab0f1];return _0x2c2fb8;};'use strict';var multer=require(_0x49d4('0x0'));var util=require(_0x49d4('0x1'));var path=require(_0x49d4('0x2'));var timeout=require(_0x49d4('0x3'));var express=require(_0x49d4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x49d4('0x5'));var interaction=require(_0x49d4('0x6'));var config=require(_0x49d4('0x7'));var controller=require(_0x49d4('0x8'));router[_0x49d4('0x9')]('/',auth[_0x49d4('0xa')](),controller[_0x49d4('0xb')]);router[_0x49d4('0x9')](_0x49d4('0xc'),auth[_0x49d4('0xa')](),controller[_0x49d4('0xd')]);router[_0x49d4('0xe')]('/',auth[_0x49d4('0xa')](),controller[_0x49d4('0xf')]);router[_0x49d4('0x10')]('/:id',auth[_0x49d4('0xa')](),controller['update']);router[_0x49d4('0x11')]('/:id',auth[_0x49d4('0xa')](),controller['destroy']);module[_0x49d4('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 1a62bf9..8264b67 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 _0x561e=['STRING','ENUM','string','BOOLEAN','sequelize','variable','customVariable','keyValue'];(function(_0x33ac3f,_0x637043){var _0x3f5274=function(_0x1ac65a){while(--_0x1ac65a){_0x33ac3f['push'](_0x33ac3f['shift']());}};_0x3f5274(++_0x637043);}(_0x561e,0xdc));var _0xe561=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x561e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe561('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xe561('0x1'),_0xe561('0x2'),_0xe561('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe561('0x4')]},'key':{'type':Sequelize[_0xe561('0x4')]},'keyType':{'type':Sequelize[_0xe561('0x5')](_0xe561('0x6'),_0xe561('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe561('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe561('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe561('0x4')]}}; \ No newline at end of file +var _0x01dd=['sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x5a5011,_0x3778b9){var _0x2e6ee1=function(_0x5db251){while(--_0x5db251){_0x5a5011['push'](_0x5a5011['shift']());}};_0x2e6ee1(++_0x3778b9);}(_0x01dd,0x1b8));var _0xd01d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x01dd[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require(_0xd01d('0x0'));module[_0xd01d('0x1')]={'type':{'type':Sequelize[_0xd01d('0x2')]('string',_0xd01d('0x3'),_0xd01d('0x4'),_0xd01d('0x5'),'picklist'),'defaultValue':_0xd01d('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd01d('0x6'),_0xd01d('0x3'),_0xd01d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd01d('0x7')]},'nameField':{'type':Sequelize[_0xd01d('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd01d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 08d7397..f29d6b2 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 _0xee5b=['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','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x22ee53,_0x551665){var _0x2aae96=function(_0x40f34b){while(--_0x40f34b){_0x22ee53['push'](_0x22ee53['shift']());}};_0x2aae96(++_0x551665);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3e9aba,_0x372346){_0x3e9aba=_0x3e9aba-0x0;var _0x305edd=_0xee5b[_0x3e9aba];return _0x305edd;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){_0xb665df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x519473,_0x50d774){return function(_0x1af3de){if(!_0x1af3de){_0x519473[_0xbee5('0x25')](0x194);}return _0x1af3de;};}function handleError(_0x3b84c8,_0x28c74d){_0x28c74d=_0x28c74d||0x1f4;return function(_0x169042){logger[_0xbee5('0x26')](_0x169042[_0xbee5('0x27')]);if(_0x169042['name']){delete _0x169042[_0xbee5('0x28')];}_0x3b84c8[_0xbee5('0x17')](_0x28c74d)[_0xbee5('0x29')](_0x169042);};}exports[_0xbee5('0x2a')]=function(_0x1a8bcc,_0x5f0419){var _0x21b993={},_0x15ffb1={},_0xb7a077={'count':0x0,'rows':[]};var _0x136a00=_[_0xbee5('0x2b')](db[_0xbee5('0x2c')][_0xbee5('0x2d')],function(_0x36e8bb){return{'name':_0x36e8bb[_0xbee5('0x2e')],'type':_0x36e8bb['type'][_0xbee5('0x2f')]};});_0x15ffb1['model']=_[_0xbee5('0x2b')](_0x136a00,'name');_0x15ffb1[_0xbee5('0x30')]=_['keys'](_0x1a8bcc[_0xbee5('0x30')]);_0x15ffb1['filters']=_[_0xbee5('0x31')](_0x15ffb1[_0xbee5('0x32')],_0x15ffb1[_0xbee5('0x30')]);_0x21b993[_0xbee5('0x33')]=_['intersection'](_0x15ffb1[_0xbee5('0x32')],qs[_0xbee5('0x34')](_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x34')]));_0x21b993['attributes']=_0x21b993[_0xbee5('0x33')][_0xbee5('0x35')]?_0x21b993[_0xbee5('0x33')]:_0x15ffb1[_0xbee5('0x32')];if(!_0x1a8bcc['query'][_0xbee5('0x36')](_0xbee5('0x37'))){_0x21b993[_0xbee5('0x1a')]=qs[_0xbee5('0x1a')](_0x1a8bcc['query'][_0xbee5('0x1a')]);_0x21b993['offset']=qs[_0xbee5('0x19')](_0x1a8bcc['query']['offset']);}_0x21b993['order']=qs[_0xbee5('0x38')](_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x38')]);_0x21b993[_0xbee5('0x39')]=qs[_0xbee5('0x3a')](_[_0xbee5('0x3b')](_0x1a8bcc[_0xbee5('0x30')],_0x15ffb1[_0xbee5('0x3a')]),_0x136a00);if(_0x1a8bcc['query'][_0xbee5('0x3c')]){_0x21b993['where']=_[_0xbee5('0x3d')](_0x21b993[_0xbee5('0x39')],{'$or':_[_0xbee5('0x2b')](_0x136a00,function(_0x49d700){if(_0x49d700['type']!==_0xbee5('0x3e')){var _0x4eb1f8={};_0x4eb1f8[_0x49d700['name']]={'$like':'%'+_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x3c')]+'%'};return _0x4eb1f8;}})});}_0x21b993=_[_0xbee5('0x3d')]({},_0x21b993,_0x1a8bcc[_0xbee5('0x3f')]);var _0x5a2b14={'where':_0x21b993[_0xbee5('0x39')]};return db[_0xbee5('0x2c')][_0xbee5('0x1c')](_0x5a2b14)[_0xbee5('0x23')](function(_0xdcd148){_0xb7a077[_0xbee5('0x1c')]=_0xdcd148;if(_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x40')]){_0x21b993[_0xbee5('0x41')]=[{'all':!![]}];}return db[_0xbee5('0x2c')]['findAll'](_0x21b993);})[_0xbee5('0x23')](function(_0x371015){_0xb7a077['rows']=_0x371015;return _0xb7a077;})[_0xbee5('0x23')](respondWithFilteredResult(_0x5f0419,_0x21b993))[_0xbee5('0x42')](handleError(_0x5f0419,null));};exports[_0xbee5('0x43')]=function(_0x56e3d0,_0x4dad75){var _0x4cfe54={'raw':!![],'where':{'id':_0x56e3d0[_0xbee5('0x44')]['id']}},_0x4b4641={};_0x4b4641[_0xbee5('0x32')]=_[_0xbee5('0x45')](db[_0xbee5('0x2c')][_0xbee5('0x2d')]);_0x4b4641[_0xbee5('0x30')]=_[_0xbee5('0x45')](_0x56e3d0[_0xbee5('0x30')]);_0x4b4641[_0xbee5('0x3a')]=_['intersection'](_0x4b4641['model'],_0x4b4641[_0xbee5('0x30')]);_0x4cfe54['attributes']=_[_0xbee5('0x31')](_0x4b4641[_0xbee5('0x32')],qs['fields'](_0x56e3d0[_0xbee5('0x30')][_0xbee5('0x34')]));_0x4cfe54['attributes']=_0x4cfe54['attributes'][_0xbee5('0x35')]?_0x4cfe54[_0xbee5('0x33')]:_0x4b4641['model'];if(_0x56e3d0[_0xbee5('0x30')][_0xbee5('0x40')]){_0x4cfe54['include']=[{'all':!![]}];}_0x4cfe54=_[_0xbee5('0x3d')]({},_0x4cfe54,_0x56e3d0[_0xbee5('0x3f')]);return db[_0xbee5('0x2c')][_0xbee5('0x46')](_0x4cfe54)[_0xbee5('0x23')](handleEntityNotFound(_0x4dad75,null))[_0xbee5('0x23')](respondWithResult(_0x4dad75,null))[_0xbee5('0x42')](handleError(_0x4dad75,null));};exports['create']=function(_0xd9173,_0x34f01d){return db[_0xbee5('0x2c')][_0xbee5('0x47')](_0xd9173['body'],{})[_0xbee5('0x23')](respondWithResult(_0x34f01d,0xc9))[_0xbee5('0x42')](handleError(_0x34f01d,null));};exports[_0xbee5('0x22')]=function(_0x4aa21a,_0x44d4b1){if(_0x4aa21a[_0xbee5('0x48')]['id']){delete _0x4aa21a['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x4aa21a[_0xbee5('0x44')]['id']}})['then'](handleEntityNotFound(_0x44d4b1,null))[_0xbee5('0x23')](saveUpdates(_0x4aa21a[_0xbee5('0x48')],null))[_0xbee5('0x23')](respondWithResult(_0x44d4b1,null))[_0xbee5('0x42')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x24')]=function(_0x296fc8,_0x55e654){return db[_0xbee5('0x2c')][_0xbee5('0x46')]({'where':{'id':_0x296fc8[_0xbee5('0x44')]['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x55e654,null))['then'](removeEntity(_0x55e654,null))[_0xbee5('0x42')](handleError(_0x55e654,null));}; \ No newline at end of file +var _0x7fce=['merge','VIRTUAL','includeAll','include','FreshdeskField','findAll','show','params','options','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','filter'];(function(_0x587e55,_0x2720a7){var _0xc5442c=function(_0x3a32d0){while(--_0x3a32d0){_0x587e55['push'](_0x587e55['shift']());}};_0xc5442c(++_0x2720a7);}(_0x7fce,0xdc));var _0xe7fc=function(_0x301700,_0x25ae97){_0x301700=_0x301700-0x0;var _0x11f7ed=_0x7fce[_0x301700];return _0x11f7ed;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243600,_0x59da2e){_0x59da2e=_0x59da2e||0xcc;return function(_0x38512a){if(_0x38512a){return _0x243600['sendStatus'](_0x59da2e);}return _0x243600['status'](_0x59da2e)[_0xe7fc('0x15')]();};}function respondWithResult(_0x14fcbf,_0x235692){_0x235692=_0x235692||0xc8;return function(_0x307f58){if(_0x307f58){return _0x14fcbf[_0xe7fc('0x16')](_0x235692)['json'](_0x307f58);}};}function respondWithFilteredResult(_0x272cd5,_0x5ce83f){return function(_0x4da73b){if(_0x4da73b){var _0x1302e5=typeof _0x5ce83f[_0xe7fc('0x17')]===_0xe7fc('0x18')&&typeof _0x5ce83f[_0xe7fc('0x19')]==='undefined';var _0x552429=_0x4da73b['count'];var _0x4aa4f0=_0x1302e5?0x0:_0x5ce83f['offset'];var _0x490a99=_0x1302e5?_0x4da73b[_0xe7fc('0x1a')]:_0x5ce83f['offset']+_0x5ce83f[_0xe7fc('0x19')];var _0xb43fde;if(_0x490a99>=_0x552429){_0x490a99=_0x552429;_0xb43fde=0xc8;}else{_0xb43fde=0xce;}_0x272cd5[_0xe7fc('0x16')](_0xb43fde);return _0x272cd5[_0xe7fc('0x1b')](_0xe7fc('0x1c'),_0x4aa4f0+'-'+_0x490a99+'/'+_0x552429)[_0xe7fc('0x1d')](_0x4da73b);}return null;};}function patchUpdates(_0x329051){return function(_0x763103){try{jsonpatch['apply'](_0x763103,_0x329051,!![]);}catch(_0x39c75a){return BPromise[_0xe7fc('0x1e')](_0x39c75a);}return _0x763103['save']();};}function saveUpdates(_0x587dee,_0x35bb53){return function(_0x3c31e7){if(_0x3c31e7){return _0x3c31e7[_0xe7fc('0x1f')](_0x587dee)[_0xe7fc('0x20')](function(_0x26977a){return _0x26977a;});}return null;};}function removeEntity(_0x11c5a3,_0x3f850f){return function(_0x1731b6){if(_0x1731b6){return _0x1731b6[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){_0x11c5a3[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x15')]();});}};}function handleEntityNotFound(_0x12ebdd,_0x5255b7){return function(_0x2d9e77){if(!_0x2d9e77){_0x12ebdd[_0xe7fc('0x22')](0x194);}return _0x2d9e77;};}function handleError(_0x416464,_0x3be1fd){_0x3be1fd=_0x3be1fd||0x1f4;return function(_0x2249ed){logger[_0xe7fc('0x23')](_0x2249ed['stack']);if(_0x2249ed[_0xe7fc('0x24')]){delete _0x2249ed[_0xe7fc('0x24')];}_0x416464[_0xe7fc('0x16')](_0x3be1fd)[_0xe7fc('0x25')](_0x2249ed);};}exports[_0xe7fc('0x26')]=function(_0x4416b5,_0x383ca6){var _0x4da084={},_0x36a68b={},_0x2a08a4={'count':0x0,'rows':[]};var _0x512518=_[_0xe7fc('0x27')](db['FreshdeskField'][_0xe7fc('0x28')],function(_0x27255a){return{'name':_0x27255a['fieldName'],'type':_0x27255a[_0xe7fc('0x29')]['key']};});_0x36a68b[_0xe7fc('0x2a')]=_[_0xe7fc('0x27')](_0x512518,_0xe7fc('0x24'));_0x36a68b['query']=_[_0xe7fc('0x2b')](_0x4416b5['query']);_0x36a68b[_0xe7fc('0x2c')]=_[_0xe7fc('0x2d')](_0x36a68b['model'],_0x36a68b['query']);_0x4da084['attributes']=_['intersection'](_0x36a68b[_0xe7fc('0x2a')],qs[_0xe7fc('0x2e')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x2e')]));_0x4da084[_0xe7fc('0x30')]=_0x4da084[_0xe7fc('0x30')][_0xe7fc('0x31')]?_0x4da084[_0xe7fc('0x30')]:_0x36a68b[_0xe7fc('0x2a')];if(!_0x4416b5[_0xe7fc('0x2f')]['hasOwnProperty'](_0xe7fc('0x32'))){_0x4da084[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x19')]);_0x4da084['offset']=qs[_0xe7fc('0x17')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x17')]);}_0x4da084[_0xe7fc('0x33')]=qs[_0xe7fc('0x34')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x34')]);_0x4da084[_0xe7fc('0x35')]=qs[_0xe7fc('0x2c')](_[_0xe7fc('0x36')](_0x4416b5[_0xe7fc('0x2f')],_0x36a68b[_0xe7fc('0x2c')]),_0x512518);if(_0x4416b5['query'][_0xe7fc('0x37')]){_0x4da084[_0xe7fc('0x35')]=_[_0xe7fc('0x38')](_0x4da084[_0xe7fc('0x35')],{'$or':_[_0xe7fc('0x27')](_0x512518,function(_0x4ed2e4){if(_0x4ed2e4[_0xe7fc('0x29')]!==_0xe7fc('0x39')){var _0x112bb9={};_0x112bb9[_0x4ed2e4[_0xe7fc('0x24')]]={'$like':'%'+_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x37')]+'%'};return _0x112bb9;}})});}_0x4da084=_['merge']({},_0x4da084,_0x4416b5['options']);var _0x582053={'where':_0x4da084['where']};return db['FreshdeskField'][_0xe7fc('0x1a')](_0x582053)[_0xe7fc('0x20')](function(_0x4cc33f){_0x2a08a4[_0xe7fc('0x1a')]=_0x4cc33f;if(_0x4416b5['query'][_0xe7fc('0x3a')]){_0x4da084[_0xe7fc('0x3b')]=[{'all':!![]}];}return db[_0xe7fc('0x3c')][_0xe7fc('0x3d')](_0x4da084);})[_0xe7fc('0x20')](function(_0x3e35c7){_0x2a08a4['rows']=_0x3e35c7;return _0x2a08a4;})[_0xe7fc('0x20')](respondWithFilteredResult(_0x383ca6,_0x4da084))['catch'](handleError(_0x383ca6,null));};exports[_0xe7fc('0x3e')]=function(_0x381bb4,_0x533f26){var _0x636368={'raw':!![],'where':{'id':_0x381bb4[_0xe7fc('0x3f')]['id']}},_0x3ce7ad={};_0x3ce7ad[_0xe7fc('0x2a')]=_[_0xe7fc('0x2b')](db[_0xe7fc('0x3c')][_0xe7fc('0x28')]);_0x3ce7ad[_0xe7fc('0x2f')]=_[_0xe7fc('0x2b')](_0x381bb4[_0xe7fc('0x2f')]);_0x3ce7ad[_0xe7fc('0x2c')]=_[_0xe7fc('0x2d')](_0x3ce7ad[_0xe7fc('0x2a')],_0x3ce7ad[_0xe7fc('0x2f')]);_0x636368[_0xe7fc('0x30')]=_[_0xe7fc('0x2d')](_0x3ce7ad[_0xe7fc('0x2a')],qs['fields'](_0x381bb4[_0xe7fc('0x2f')][_0xe7fc('0x2e')]));_0x636368[_0xe7fc('0x30')]=_0x636368['attributes'][_0xe7fc('0x31')]?_0x636368[_0xe7fc('0x30')]:_0x3ce7ad[_0xe7fc('0x2a')];if(_0x381bb4[_0xe7fc('0x2f')][_0xe7fc('0x3a')]){_0x636368['include']=[{'all':!![]}];}_0x636368=_['merge']({},_0x636368,_0x381bb4[_0xe7fc('0x40')]);return db[_0xe7fc('0x3c')][_0xe7fc('0x41')](_0x636368)[_0xe7fc('0x20')](handleEntityNotFound(_0x533f26,null))[_0xe7fc('0x20')](respondWithResult(_0x533f26,null))['catch'](handleError(_0x533f26,null));};exports[_0xe7fc('0x42')]=function(_0x2dd594,_0x2807ff){return db[_0xe7fc('0x3c')][_0xe7fc('0x42')](_0x2dd594[_0xe7fc('0x43')],{})[_0xe7fc('0x20')](respondWithResult(_0x2807ff,0xc9))[_0xe7fc('0x44')](handleError(_0x2807ff,null));};exports[_0xe7fc('0x1f')]=function(_0x45edbf,_0x533f31){if(_0x45edbf[_0xe7fc('0x43')]['id']){delete _0x45edbf['body']['id'];}return db[_0xe7fc('0x3c')][_0xe7fc('0x41')]({'where':{'id':_0x45edbf[_0xe7fc('0x3f')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x533f31,null))[_0xe7fc('0x20')](saveUpdates(_0x45edbf[_0xe7fc('0x43')],null))[_0xe7fc('0x20')](respondWithResult(_0x533f31,null))[_0xe7fc('0x44')](handleError(_0x533f31,null));};exports[_0xe7fc('0x21')]=function(_0x535afb,_0x63a8bf){return db[_0xe7fc('0x3c')][_0xe7fc('0x41')]({'where':{'id':_0x535afb[_0xe7fc('0x3f')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x63a8bf,null))[_0xe7fc('0x20')](removeEntity(_0x63a8bf,null))['catch'](handleError(_0x63a8bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 198c371..9ad8b27 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 _0x3c57=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x45b62b,_0x493f8a){var _0x480556=function(_0x583236){while(--_0x583236){_0x45b62b['push'](_0x45b62b['shift']());}};_0x480556(++_0x493f8a);}(_0x3c57,0x8c));var _0x73c5=function(_0x1c144d,_0x29cf71){_0x1c144d=_0x1c144d-0x0;var _0x31e5dd=_0x3c57[_0x1c144d];return _0x31e5dd;};'use strict';var _=require(_0x73c5('0x0'));var util=require(_0x73c5('0x1'));var logger=require(_0x73c5('0x2'))(_0x73c5('0x3'));var moment=require(_0x73c5('0x4'));var BPromise=require(_0x73c5('0x5'));var rp=require(_0x73c5('0x6'));var fs=require('fs');var path=require(_0x73c5('0x7'));var rimraf=require(_0x73c5('0x8'));var config=require(_0x73c5('0x9'));var attributes=require(_0x73c5('0xa'));module[_0x73c5('0xb')]=function(_0x47bec6,_0x5750e5){return _0x47bec6['define'](_0x73c5('0xc'),attributes,{'tableName':_0x73c5('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x73c5('0xe'),_0x73c5('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x615b=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1925df,_0xbd3e63){var _0x2f4e05=function(_0x4ffc0b){while(--_0x4ffc0b){_0x1925df['push'](_0x1925df['shift']());}};_0x2f4e05(++_0xbd3e63);}(_0x615b,0x159));var _0xb615=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x615b[_0x22cb5f];return _0x274d36;};'use strict';var _=require(_0xb615('0x0'));var util=require(_0xb615('0x1'));var logger=require(_0xb615('0x2'))(_0xb615('0x3'));var moment=require('moment');var BPromise=require(_0xb615('0x4'));var rp=require(_0xb615('0x5'));var fs=require('fs');var path=require(_0xb615('0x6'));var rimraf=require(_0xb615('0x7'));var config=require(_0xb615('0x8'));var attributes=require(_0xb615('0x9'));module[_0xb615('0xa')]=function(_0x253d9c,_0x1eee46){return _0x253d9c[_0xb615('0xb')](_0xb615('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xb615('0xd'),'fields':[_0xb615('0xe'),_0xb615('0xf')],'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 0a622e4..8554da2 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 _0x686d=['request\x20sent','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x10644d,_0x41cb2a){var _0x2adc31=function(_0x19f8c9){while(--_0x19f8c9){_0x10644d['push'](_0x10644d['shift']());}};_0x2adc31(++_0x41cb2a);}(_0x686d,0x115));var _0xd686=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x686d[_0x35d59c];return _0x18cd27;};'use strict';var _=require(_0xd686('0x0'));var util=require(_0xd686('0x1'));var moment=require(_0xd686('0x2'));var BPromise=require(_0xd686('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd686('0x4'));var db=require(_0xd686('0x5'))['db'];var utils=require(_0xd686('0x6'));var logger=require(_0xd686('0x7'))(_0xd686('0x8'));var config=require(_0xd686('0x9'));var jayson=require(_0xd686('0xa'));var client=jayson[_0xd686('0xb')][_0xd686('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x547d74,_0x17f068,_0x302d30){return new BPromise(function(_0x5e5d40,_0x65a06e){return client[_0xd686('0xd')](_0x547d74,_0x302d30)[_0xd686('0xe')](function(_0x1705f0){logger[_0xd686('0xf')](_0xd686('0x10'),_0x17f068,_0xd686('0x11'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x17f068,_0xd686('0x11'),JSON['stringify'](_0x1705f0));if(_0x1705f0[_0xd686('0x12')]){if(_0x1705f0[_0xd686('0x12')]['code']===0x1f4){logger['error'](_0xd686('0x10'),_0x17f068,_0x1705f0[_0xd686('0x12')][_0xd686('0x13')]);return _0x65a06e(_0x1705f0[_0xd686('0x12')][_0xd686('0x13')]);}logger[_0xd686('0x12')](_0xd686('0x10'),_0x17f068,_0x1705f0['error']['message']);return _0x5e5d40(_0x1705f0['error']['message']);}else{logger[_0xd686('0xf')](_0xd686('0x10'),_0x17f068,'request\x20sent');_0x5e5d40(_0x1705f0['result'][_0xd686('0x13')]);}})[_0xd686('0x14')](function(_0x521384){logger[_0xd686('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x17f068,_0x521384);_0x65a06e(_0x521384);});});} \ No newline at end of file +var _0x5a67=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','request\x20sent'];(function(_0x34f7c2,_0x264892){var _0x206ea2=function(_0x1c9f7a){while(--_0x1c9f7a){_0x34f7c2['push'](_0x34f7c2['shift']());}};_0x206ea2(++_0x264892);}(_0x5a67,0x6d));var _0x75a6=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x5a67[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x75a6('0x0'));var util=require(_0x75a6('0x1'));var moment=require(_0x75a6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75a6('0x3'));var db=require(_0x75a6('0x4'))['db'];var utils=require(_0x75a6('0x5'));var logger=require(_0x75a6('0x6'))(_0x75a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x75a6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5027ca,_0x5ac80d,_0x360e2f){return new BPromise(function(_0x3d7cd4,_0x4ee9f9){return client[_0x75a6('0x9')](_0x5027ca,_0x360e2f)['then'](function(_0x597602){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x5ac80d,_0x75a6('0xa'));logger['debug'](_0x75a6('0xb'),_0x5ac80d,_0x75a6('0xa'),JSON[_0x75a6('0xc')](_0x597602));if(_0x597602['error']){if(_0x597602[_0x75a6('0xd')][_0x75a6('0xe')]===0x1f4){logger['error'](_0x75a6('0xf'),_0x5ac80d,_0x597602[_0x75a6('0xd')][_0x75a6('0x10')]);return _0x4ee9f9(_0x597602['error'][_0x75a6('0x10')]);}logger['error'](_0x75a6('0xf'),_0x5ac80d,_0x597602[_0x75a6('0xd')][_0x75a6('0x10')]);return _0x3d7cd4(_0x597602[_0x75a6('0xd')][_0x75a6('0x10')]);}else{logger[_0x75a6('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x5ac80d,_0x75a6('0xa'));_0x3d7cd4(_0x597602[_0x75a6('0x12')][_0x75a6('0x10')]);}})[_0x75a6('0x13')](function(_0x40caff){logger[_0x75a6('0xd')](_0x75a6('0xf'),_0x5ac80d,_0x40caff);_0x4ee9f9(_0x40caff);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 99f4686..bf2af73 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 _0x80ed=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','destroy','exports','multer','path'];(function(_0xb0002a,_0x53f06e){var _0x55b76f=function(_0x279acc){while(--_0x279acc){_0xb0002a['push'](_0xb0002a['shift']());}};_0x55b76f(++_0x53f06e);}(_0x80ed,0x11c));var _0xd80e=function(_0x45e19c,_0x2c99e9){_0x45e19c=_0x45e19c-0x0;var _0x257cf2=_0x80ed[_0x45e19c];return _0x257cf2;};'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('./intFreshsalesAccount.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getFields']);router[_0xd80e('0x10')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x10')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x12')]);router[_0xd80e('0x13')](_0xd80e('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd80e('0x9')](),controller[_0xd80e('0x14')]);module[_0xd80e('0x15')]=router; \ No newline at end of file +var _0x5c00=['isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x17225e,_0x4f1b3a){var _0x39ce78=function(_0x1dda63){while(--_0x1dda63){_0x17225e['push'](_0x17225e['shift']());}};_0x39ce78(++_0x4f1b3a);}(_0x5c00,0x17e));var _0x05c0=function(_0x3cee22,_0x54ad32){_0x3cee22=_0x3cee22-0x0;var _0x286fa5=_0x5c00[_0x3cee22];return _0x286fa5;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/configurations',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x05c0('0xf')]);router['post'](_0x05c0('0x10'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x11')]);router['put'](_0x05c0('0x12'),auth['isAuthenticated'](),controller[_0x05c0('0x13')]);router[_0x05c0('0x14')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x15')]);module[_0x05c0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 726b5ed..44cda8b 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 _0x3d04=['STRING','username','sequelize','exports'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x43d0('0x0'));module[_0x43d0('0x1')]={'name':{'type':Sequelize[_0x43d0('0x2')]},'description':{'type':Sequelize[_0x43d0('0x2')]},'username':{'type':Sequelize[_0x43d0('0x2')],'unique':_0x43d0('0x3')},'apiKey':{'type':Sequelize[_0x43d0('0x2')]},'remoteUri':{'type':Sequelize[_0x43d0('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x43d0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa30a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x71deb8,_0x2163f3){var _0x1f7b10=function(_0x1f6d93){while(--_0x1f6d93){_0x71deb8['push'](_0x71deb8['shift']());}};_0x1f7b10(++_0x2163f3);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x3')},'apiKey':{'type':Sequelize[_0xaa30('0x2')]},'remoteUri':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x4')},'serverUrl':{'type':Sequelize[_0xaa30('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 78920c8..1681f21 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 _0x1f1d=['sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','length','options','find','body','getConfigurations','findOne','FreshsalesConfiguration','order','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','FreshsalesField','remoteUri','username','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','offset','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x1f1d,0x1d0));var _0xd1f1=function(_0x4dd575,_0x2e34f0){_0x4dd575=_0x4dd575-0x0;var _0x2257d9=_0x1f1d[_0x4dd575];return _0x2257d9;};'use strict';var emlformat=require(_0xd1f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1f1('0x1'));var jsonpatch=require(_0xd1f1('0x2'));var rp=require('request-promise');var moment=require(_0xd1f1('0x3'));var BPromise=require(_0xd1f1('0x4'));var Mustache=require(_0xd1f1('0x5'));var util=require('util');var path=require(_0xd1f1('0x6'));var sox=require(_0xd1f1('0x7'));var csv=require(_0xd1f1('0x8'));var ejs=require(_0xd1f1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1f1('0xa'));var squel=require(_0xd1f1('0xb'));var crypto=require('crypto');var jsforce=require(_0xd1f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd1f1('0x8'));var querystring=require(_0xd1f1('0xd'));var Papa=require(_0xd1f1('0xe'));var Redis=require(_0xd1f1('0xf'));var authService=require(_0xd1f1('0x10'));var qs=require(_0xd1f1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd1f1('0x12'));var logger=require(_0xd1f1('0x13'))(_0xd1f1('0x14'));var utils=require('../../config/utils');var config=require(_0xd1f1('0x15'));var licenseUtil=require(_0xd1f1('0x16'));var db=require(_0xd1f1('0x17'))['db'];var integrations=require(_0xd1f1('0x18'));function respondWithStatusCode(_0x20f8af,_0x34995d){_0x34995d=_0x34995d||0xcc;return function(_0x3e1fe5){if(_0x3e1fe5){return _0x20f8af['sendStatus'](_0x34995d);}return _0x20f8af[_0xd1f1('0x19')](_0x34995d)['end']();};}function respondWithResult(_0x5d0ec9,_0x297012){_0x297012=_0x297012||0xc8;return function(_0xb7250f){if(_0xb7250f){return _0x5d0ec9[_0xd1f1('0x19')](_0x297012)[_0xd1f1('0x1a')](_0xb7250f);}};}function respondWithFilteredResult(_0x2f1fa4,_0x3e65ee){return function(_0x4f6010){if(_0x4f6010){var _0x33ce3c=typeof _0x3e65ee['offset']===_0xd1f1('0x1b')&&typeof _0x3e65ee[_0xd1f1('0x1c')]==='undefined';var _0x420214=_0x4f6010['count'];var _0x44ae0d=_0x33ce3c?0x0:_0x3e65ee[_0xd1f1('0x1d')];var _0x41d9f5=_0x33ce3c?_0x4f6010[_0xd1f1('0x1e')]:_0x3e65ee[_0xd1f1('0x1d')]+_0x3e65ee[_0xd1f1('0x1c')];var _0x4a0b0;if(_0x41d9f5>=_0x420214){_0x41d9f5=_0x420214;_0x4a0b0=0xc8;}else{_0x4a0b0=0xce;}_0x2f1fa4[_0xd1f1('0x19')](_0x4a0b0);return _0x2f1fa4[_0xd1f1('0x1f')](_0xd1f1('0x20'),_0x44ae0d+'-'+_0x41d9f5+'/'+_0x420214)[_0xd1f1('0x1a')](_0x4f6010);}return null;};}function patchUpdates(_0x178a74){return function(_0x371871){try{jsonpatch['apply'](_0x371871,_0x178a74,!![]);}catch(_0x1fb925){return BPromise['reject'](_0x1fb925);}return _0x371871[_0xd1f1('0x21')]();};}function saveUpdates(_0x145bd0,_0x331916){return function(_0x300d09){if(_0x300d09){return _0x300d09[_0xd1f1('0x22')](_0x145bd0)[_0xd1f1('0x23')](function(_0x122538){return _0x122538;});}return null;};}function removeEntity(_0x24a4dd,_0x1f99e5){return function(_0x1fd7f9){if(_0x1fd7f9){return _0x1fd7f9[_0xd1f1('0x24')]()[_0xd1f1('0x23')](function(){_0x24a4dd[_0xd1f1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7c761d,_0x2500be){return function(_0x3fab86){if(!_0x3fab86){_0x7c761d[_0xd1f1('0x25')](0x194);}return _0x3fab86;};}function handleError(_0x18b1c9,_0x54f71d){_0x54f71d=_0x54f71d||0x1f4;return function(_0xae87a5){logger[_0xd1f1('0x26')](_0xae87a5['stack']);if(_0xae87a5[_0xd1f1('0x27')]){delete _0xae87a5['name'];}_0x18b1c9['status'](_0x54f71d)[_0xd1f1('0x28')](_0xae87a5);};}exports[_0xd1f1('0x29')]=function(_0x45b10d,_0x1b0474){var _0x541a11={},_0x4e216e={},_0x5305f7={'count':0x0,'rows':[]};var _0x1b8787=_['map'](db[_0xd1f1('0x2a')][_0xd1f1('0x2b')],function(_0x2fe620){return{'name':_0x2fe620[_0xd1f1('0x2c')],'type':_0x2fe620[_0xd1f1('0x2d')][_0xd1f1('0x2e')]};});_0x4e216e[_0xd1f1('0x2f')]=_[_0xd1f1('0x30')](_0x1b8787,_0xd1f1('0x27'));_0x4e216e[_0xd1f1('0x31')]=_[_0xd1f1('0x32')](_0x45b10d[_0xd1f1('0x31')]);_0x4e216e[_0xd1f1('0x33')]=_[_0xd1f1('0x34')](_0x4e216e[_0xd1f1('0x2f')],_0x4e216e[_0xd1f1('0x31')]);_0x541a11[_0xd1f1('0x35')]=_[_0xd1f1('0x34')](_0x4e216e[_0xd1f1('0x2f')],qs['fields'](_0x45b10d['query']['fields']));_0x541a11[_0xd1f1('0x35')]=_0x541a11[_0xd1f1('0x35')]['length']?_0x541a11[_0xd1f1('0x35')]:_0x4e216e[_0xd1f1('0x2f')];if(!_0x45b10d[_0xd1f1('0x31')][_0xd1f1('0x36')](_0xd1f1('0x37'))){_0x541a11[_0xd1f1('0x1c')]=qs[_0xd1f1('0x1c')](_0x45b10d[_0xd1f1('0x31')]['limit']);_0x541a11[_0xd1f1('0x1d')]=qs[_0xd1f1('0x1d')](_0x45b10d[_0xd1f1('0x31')][_0xd1f1('0x1d')]);}_0x541a11['order']=qs[_0xd1f1('0x38')](_0x45b10d[_0xd1f1('0x31')][_0xd1f1('0x38')]);_0x541a11['where']=qs[_0xd1f1('0x33')](_[_0xd1f1('0x39')](_0x45b10d[_0xd1f1('0x31')],_0x4e216e[_0xd1f1('0x33')]),_0x1b8787);if(_0x45b10d[_0xd1f1('0x31')][_0xd1f1('0x3a')]){_0x541a11[_0xd1f1('0x3b')]=_[_0xd1f1('0x3c')](_0x541a11['where'],{'$or':_['map'](_0x1b8787,function(_0x1c1cc3){if(_0x1c1cc3[_0xd1f1('0x2d')]!==_0xd1f1('0x3d')){var _0x3add84={};_0x3add84[_0x1c1cc3[_0xd1f1('0x27')]]={'$like':'%'+_0x45b10d[_0xd1f1('0x31')][_0xd1f1('0x3a')]+'%'};return _0x3add84;}})});}_0x541a11=_['merge']({},_0x541a11,_0x45b10d['options']);var _0x51e01b={'where':_0x541a11[_0xd1f1('0x3b')]};return db['FreshsalesAccount']['count'](_0x51e01b)[_0xd1f1('0x23')](function(_0x4e0dd3){_0x5305f7[_0xd1f1('0x1e')]=_0x4e0dd3;if(_0x45b10d[_0xd1f1('0x31')][_0xd1f1('0x3e')]){_0x541a11[_0xd1f1('0x3f')]=[{'all':!![]}];}return db[_0xd1f1('0x2a')][_0xd1f1('0x40')](_0x541a11);})[_0xd1f1('0x23')](function(_0x135a2a){_0x5305f7[_0xd1f1('0x41')]=_0x135a2a;return _0x5305f7;})[_0xd1f1('0x23')](respondWithFilteredResult(_0x1b0474,_0x541a11))[_0xd1f1('0x42')](handleError(_0x1b0474,null));};exports[_0xd1f1('0x43')]=function(_0x471a80,_0x3b90af){var _0x174728={'raw':![],'where':{'id':_0x471a80[_0xd1f1('0x44')]['id']}},_0x37c6bd={};_0x37c6bd[_0xd1f1('0x2f')]=_['keys'](db[_0xd1f1('0x2a')]['rawAttributes']);_0x37c6bd['query']=_['keys'](_0x471a80[_0xd1f1('0x31')]);_0x37c6bd['filters']=_[_0xd1f1('0x34')](_0x37c6bd[_0xd1f1('0x2f')],_0x37c6bd[_0xd1f1('0x31')]);_0x174728[_0xd1f1('0x35')]=_['intersection'](_0x37c6bd[_0xd1f1('0x2f')],qs[_0xd1f1('0x45')](_0x471a80[_0xd1f1('0x31')][_0xd1f1('0x45')]));_0x174728[_0xd1f1('0x35')]=_0x174728[_0xd1f1('0x35')][_0xd1f1('0x46')]?_0x174728[_0xd1f1('0x35')]:_0x37c6bd[_0xd1f1('0x2f')];if(_0x471a80[_0xd1f1('0x31')][_0xd1f1('0x3e')]){_0x174728[_0xd1f1('0x3f')]=[{'all':!![]}];}_0x174728=_[_0xd1f1('0x3c')]({},_0x174728,_0x471a80[_0xd1f1('0x47')]);return db[_0xd1f1('0x2a')][_0xd1f1('0x48')](_0x174728)[_0xd1f1('0x23')](handleEntityNotFound(_0x3b90af,null))[_0xd1f1('0x23')](respondWithResult(_0x3b90af,null))[_0xd1f1('0x42')](handleError(_0x3b90af,null));};exports['create']=function(_0xc526a3,_0x5f3224){return db[_0xd1f1('0x2a')]['create'](_0xc526a3[_0xd1f1('0x49')],{})['then'](respondWithResult(_0x5f3224,0xc9))['catch'](handleError(_0x5f3224,null));};exports['update']=function(_0x1f9244,_0x2367e0){if(_0x1f9244[_0xd1f1('0x49')]['id']){delete _0x1f9244[_0xd1f1('0x49')]['id'];}return db[_0xd1f1('0x2a')][_0xd1f1('0x48')]({'where':{'id':_0x1f9244['params']['id']}})[_0xd1f1('0x23')](handleEntityNotFound(_0x2367e0,null))['then'](saveUpdates(_0x1f9244[_0xd1f1('0x49')],null))[_0xd1f1('0x23')](respondWithResult(_0x2367e0,null))[_0xd1f1('0x42')](handleError(_0x2367e0,null));};exports[_0xd1f1('0x24')]=function(_0x2211c4,_0x5f3a1c){return db[_0xd1f1('0x2a')]['find']({'where':{'id':_0x2211c4['params']['id']}})[_0xd1f1('0x23')](handleEntityNotFound(_0x5f3a1c,null))[_0xd1f1('0x23')](removeEntity(_0x5f3a1c,null))[_0xd1f1('0x42')](handleError(_0x5f3a1c,null));};exports[_0xd1f1('0x4a')]=function(_0x289b08,_0x583f,_0x3ea94f){var _0x21fed1={};var _0x10bb2f={};var _0x1f2b36;var _0x539e4d;return db['FreshsalesAccount'][_0xd1f1('0x4b')]({'where':{'id':_0x289b08['params']['id']}})['then'](handleEntityNotFound(_0x583f,null))[_0xd1f1('0x23')](function(_0x1f8018){if(_0x1f8018){_0x1f2b36=_0x1f8018;_0x10bb2f['model']=_[_0xd1f1('0x32')](db[_0xd1f1('0x4c')][_0xd1f1('0x2b')]);_0x10bb2f['query']=_[_0xd1f1('0x32')](_0x289b08[_0xd1f1('0x31')]);_0x10bb2f[_0xd1f1('0x33')]=_[_0xd1f1('0x34')](_0x10bb2f[_0xd1f1('0x2f')],_0x10bb2f['query']);_0x21fed1[_0xd1f1('0x35')]=_[_0xd1f1('0x34')](_0x10bb2f[_0xd1f1('0x2f')],qs[_0xd1f1('0x45')](_0x289b08[_0xd1f1('0x31')][_0xd1f1('0x45')]));_0x21fed1[_0xd1f1('0x35')]=_0x21fed1['attributes'][_0xd1f1('0x46')]?_0x21fed1['attributes']:_0x10bb2f[_0xd1f1('0x2f')];_0x21fed1[_0xd1f1('0x4d')]=qs['sort'](_0x289b08[_0xd1f1('0x31')][_0xd1f1('0x38')]);_0x21fed1[_0xd1f1('0x3b')]=qs[_0xd1f1('0x33')](_[_0xd1f1('0x39')](_0x289b08[_0xd1f1('0x31')],_0x10bb2f[_0xd1f1('0x33')]));if(_0x289b08[_0xd1f1('0x31')][_0xd1f1('0x3a')]){_0x21fed1[_0xd1f1('0x3b')]=_[_0xd1f1('0x3c')](_0x21fed1['where'],{'$or':_[_0xd1f1('0x30')](_0x21fed1['attributes'],function(_0x12df08){var _0x488ed7={};_0x488ed7[_0x12df08]={'$like':'%'+_0x289b08['query']['filter']+'%'};return _0x488ed7;})});}_0x21fed1=_['merge']({},_0x21fed1,_0x289b08['options']);return _0x1f2b36[_0xd1f1('0x4a')](_0x21fed1);}})[_0xd1f1('0x23')](function(_0x3769e1){if(_0x3769e1){_0x539e4d=_0x3769e1[_0xd1f1('0x46')];if(!_0x289b08[_0xd1f1('0x31')]['hasOwnProperty'](_0xd1f1('0x37'))){_0x21fed1['limit']=qs[_0xd1f1('0x1c')](_0x289b08[_0xd1f1('0x31')][_0xd1f1('0x1c')]);_0x21fed1['offset']=qs[_0xd1f1('0x1d')](_0x289b08[_0xd1f1('0x31')][_0xd1f1('0x1d')]);}return _0x1f2b36[_0xd1f1('0x4a')](_0x21fed1);}})['then'](function(_0x1c1a4c){if(_0x1c1a4c){return _0x1c1a4c?{'count':_0x539e4d,'rows':_0x1c1a4c}:null;}})[_0xd1f1('0x23')](respondWithResult(_0x583f,null))[_0xd1f1('0x42')](handleError(_0x583f,null));};exports[_0xd1f1('0x4e')]=function(_0x115b09,_0x42c446,_0x53c0f8){if(_0x115b09[_0xd1f1('0x49')]['id']){delete _0x115b09[_0xd1f1('0x49')]['id'];}return db[_0xd1f1('0x2a')][_0xd1f1('0x4b')]({'where':{'id':_0x115b09[_0xd1f1('0x44')]['id']}})[_0xd1f1('0x23')](handleEntityNotFound(_0x42c446,null))[_0xd1f1('0x23')](function(_0x43222d){if(_0x43222d){_0x115b09[_0xd1f1('0x49')]['AccountId']=_0x43222d['id'];_0x115b09['body'][_0xd1f1('0x4f')]=integrations[_0xd1f1('0x50')](_0x115b09[_0xd1f1('0x49')]['channel'],_0x115b09['body'][_0xd1f1('0x2d')]);_0x115b09[_0xd1f1('0x49')][_0xd1f1('0x51')]=integrations[_0xd1f1('0x52')](_0x115b09[_0xd1f1('0x49')][_0xd1f1('0x53')],_0x115b09[_0xd1f1('0x49')][_0xd1f1('0x2d')]);return db[_0xd1f1('0x4c')][_0xd1f1('0x54')](_0x115b09['body'],{'include':[{'model':db[_0xd1f1('0x55')],'as':'Subjects'},{'model':db[_0xd1f1('0x55')],'as':_0xd1f1('0x51')}]});}return null;})['then'](respondWithResult(_0x42c446,null))[_0xd1f1('0x42')](handleError(_0x42c446,null));};exports['getFields']=function(_0x3b69fd,_0x295f9d,_0x5c7264){var _0x2ec5f7='';var _0x878bd5='';return db[_0xd1f1('0x2a')][_0xd1f1('0x4b')]({'where':{'id':_0x3b69fd[_0xd1f1('0x44')]['id']},'attributes':['id','username',_0xd1f1('0x56'),'apiKey']})[_0xd1f1('0x23')](handleEntityNotFound(_0x295f9d,null))[_0xd1f1('0x23')](function(_0x1b9304){if(_0x1b9304){_0x878bd5=_0x1b9304[_0xd1f1('0x57')];_0x2ec5f7=_0x1b9304[_0xd1f1('0x56')];var _0x23399b=_0x1b9304[_0xd1f1('0x56')]['slice'](-0x1);if(_0x23399b==='/'){_0x2ec5f7=_0x2ec5f7[_0xd1f1('0x58')](0x0,_0x2ec5f7[_0xd1f1('0x59')](_0x23399b));}return rp({'method':_0xd1f1('0x5a'),'uri':util[_0xd1f1('0x5b')](_0xd1f1('0x5c'),_0x2ec5f7,_0xd1f1('0x5d')),'headers':{'Authorization':_0xd1f1('0x5e')+_0x1b9304[_0xd1f1('0x5f')]},'json':!![]});}})[_0xd1f1('0x23')](function(_0x8a739b){if(_0x8a739b){var _0x485498=_0x8a739b[_0xd1f1('0x60')];var _0x2a61dc=![];var _0x2fecaa=null;for(_0x2fecaa=0x0;_0x2fecaa<_0x485498[_0xd1f1('0x46')];_0x2fecaa++){if(_0x485498[_0x2fecaa][_0xd1f1('0x61')]===_0x878bd5){_0x2a61dc=!![];}}if(_0x2a61dc){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd1f1('0x62')});}}})['then'](respondWithResult(_0x295f9d,null))[_0xd1f1('0x42')](function(_0x2ef78a){var _0x33b8e5=_0x3b69fd['query'][_0xd1f1('0x63')]?0x1f4:_0x2ef78a[_0xd1f1('0x64')]||0x1f4;logger[_0xd1f1('0x26')](_0xd1f1('0x65'),_0xd1f1('0x66'),_0x33b8e5,JSON['stringify'](_0x2ef78a));delete _0x2ef78a[_0xd1f1('0x27')];if(_0x33b8e5===0x191){_0x33b8e5=0x190;}_0x295f9d[_0xd1f1('0x19')](_0x33b8e5)['send'](_0x3b69fd[_0xd1f1('0x31')]['test']?{'message':_0xd1f1('0x67'),'statusCode':_0x2ef78a[_0xd1f1('0x64')]}:_0x2ef78a);});}; \ No newline at end of file +var _0x9e73=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','Content-Range','save','then','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','rows','catch','show','params','keys','model','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1536d8,_0x25d82a){var _0x130885=function(_0x156a5e){while(--_0x156a5e){_0x1536d8['push'](_0x1536d8['shift']());}};_0x130885(++_0x25d82a);}(_0x9e73,0x1ec));var _0x39e7=function(_0xae4133,_0x53e5ee){_0xae4133=_0xae4133-0x0;var _0x16a17d=_0x9e73[_0xae4133];return _0x16a17d;};'use strict';var emlformat=require(_0x39e7('0x0'));var rimraf=require(_0x39e7('0x1'));var zipdir=require(_0x39e7('0x2'));var jsonpatch=require(_0x39e7('0x3'));var rp=require(_0x39e7('0x4'));var moment=require(_0x39e7('0x5'));var BPromise=require(_0x39e7('0x6'));var Mustache=require(_0x39e7('0x7'));var util=require(_0x39e7('0x8'));var path=require(_0x39e7('0x9'));var sox=require(_0x39e7('0xa'));var csv=require(_0x39e7('0xb'));var ejs=require(_0x39e7('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39e7('0xd'));var squel=require(_0x39e7('0xe'));var crypto=require(_0x39e7('0xf'));var jsforce=require(_0x39e7('0x10'));var deskjs=require(_0x39e7('0x11'));var toCsv=require('to-csv');var querystring=require(_0x39e7('0x12'));var Papa=require(_0x39e7('0x13'));var Redis=require(_0x39e7('0x14'));var authService=require(_0x39e7('0x15'));var qs=require(_0x39e7('0x16'));var as=require(_0x39e7('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x39e7('0x18'));var utils=require(_0x39e7('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x39e7('0x1a'));var db=require(_0x39e7('0x1b'))['db'];var integrations=require(_0x39e7('0x1c'));function respondWithStatusCode(_0x430c24,_0x41f85a){_0x41f85a=_0x41f85a||0xcc;return function(_0x5a3ed1){if(_0x5a3ed1){return _0x430c24[_0x39e7('0x1d')](_0x41f85a);}return _0x430c24[_0x39e7('0x1e')](_0x41f85a)[_0x39e7('0x1f')]();};}function respondWithResult(_0x7ad454,_0x42a798){_0x42a798=_0x42a798||0xc8;return function(_0x44c58a){if(_0x44c58a){return _0x7ad454[_0x39e7('0x1e')](_0x42a798)[_0x39e7('0x20')](_0x44c58a);}};}function respondWithFilteredResult(_0x1f8e08,_0x2d7ecf){return function(_0x53627f){if(_0x53627f){var _0x5eca7c=typeof _0x2d7ecf[_0x39e7('0x21')]==='undefined'&&typeof _0x2d7ecf['limit']==='undefined';var _0x291f79=_0x53627f['count'];var _0x294dde=_0x5eca7c?0x0:_0x2d7ecf[_0x39e7('0x21')];var _0x47cad0=_0x5eca7c?_0x53627f['count']:_0x2d7ecf[_0x39e7('0x21')]+_0x2d7ecf[_0x39e7('0x22')];var _0x1343e7;if(_0x47cad0>=_0x291f79){_0x47cad0=_0x291f79;_0x1343e7=0xc8;}else{_0x1343e7=0xce;}_0x1f8e08[_0x39e7('0x1e')](_0x1343e7);return _0x1f8e08['set'](_0x39e7('0x23'),_0x294dde+'-'+_0x47cad0+'/'+_0x291f79)[_0x39e7('0x20')](_0x53627f);}return null;};}function patchUpdates(_0x462349){return function(_0x75fec){try{jsonpatch['apply'](_0x75fec,_0x462349,!![]);}catch(_0x4dc126){return BPromise['reject'](_0x4dc126);}return _0x75fec[_0x39e7('0x24')]();};}function saveUpdates(_0x3afdb9,_0x34ef1a){return function(_0x5ec3bf){if(_0x5ec3bf){return _0x5ec3bf['update'](_0x3afdb9)[_0x39e7('0x25')](function(_0x28b292){return _0x28b292;});}return null;};}function removeEntity(_0x153ae6,_0x236224){return function(_0x5a0bac){if(_0x5a0bac){return _0x5a0bac['destroy']()['then'](function(){_0x153ae6[_0x39e7('0x1e')](0xcc)[_0x39e7('0x1f')]();});}};}function handleEntityNotFound(_0x97b211,_0x5bde95){return function(_0x41e2ae){if(!_0x41e2ae){_0x97b211[_0x39e7('0x1d')](0x194);}return _0x41e2ae;};}function handleError(_0x4dc6b4,_0x2d9ee4){_0x2d9ee4=_0x2d9ee4||0x1f4;return function(_0xdfa940){logger['error'](_0xdfa940[_0x39e7('0x26')]);if(_0xdfa940[_0x39e7('0x27')]){delete _0xdfa940[_0x39e7('0x27')];}_0x4dc6b4[_0x39e7('0x1e')](_0x2d9ee4)[_0x39e7('0x28')](_0xdfa940);};}exports[_0x39e7('0x29')]=function(_0x3a7e24,_0x1b76f4){var _0x4929a8={},_0x3fdd5f={},_0x2f9424={'count':0x0,'rows':[]};var _0x5f1834=_['map'](db[_0x39e7('0x2a')][_0x39e7('0x2b')],function(_0x431538){return{'name':_0x431538[_0x39e7('0x2c')],'type':_0x431538[_0x39e7('0x2d')][_0x39e7('0x2e')]};});_0x3fdd5f['model']=_[_0x39e7('0x2f')](_0x5f1834,_0x39e7('0x27'));_0x3fdd5f['query']=_['keys'](_0x3a7e24[_0x39e7('0x30')]);_0x3fdd5f['filters']=_[_0x39e7('0x31')](_0x3fdd5f['model'],_0x3fdd5f[_0x39e7('0x30')]);_0x4929a8[_0x39e7('0x32')]=_['intersection'](_0x3fdd5f['model'],qs[_0x39e7('0x33')](_0x3a7e24['query'][_0x39e7('0x33')]));_0x4929a8[_0x39e7('0x32')]=_0x4929a8[_0x39e7('0x32')][_0x39e7('0x34')]?_0x4929a8[_0x39e7('0x32')]:_0x3fdd5f['model'];if(!_0x3a7e24[_0x39e7('0x30')][_0x39e7('0x35')](_0x39e7('0x36'))){_0x4929a8['limit']=qs[_0x39e7('0x22')](_0x3a7e24['query'][_0x39e7('0x22')]);_0x4929a8[_0x39e7('0x21')]=qs[_0x39e7('0x21')](_0x3a7e24['query'][_0x39e7('0x21')]);}_0x4929a8[_0x39e7('0x37')]=qs[_0x39e7('0x38')](_0x3a7e24[_0x39e7('0x30')][_0x39e7('0x38')]);_0x4929a8['where']=qs[_0x39e7('0x39')](_[_0x39e7('0x3a')](_0x3a7e24[_0x39e7('0x30')],_0x3fdd5f[_0x39e7('0x39')]),_0x5f1834);if(_0x3a7e24[_0x39e7('0x30')][_0x39e7('0x3b')]){_0x4929a8[_0x39e7('0x3c')]=_[_0x39e7('0x3d')](_0x4929a8[_0x39e7('0x3c')],{'$or':_[_0x39e7('0x2f')](_0x5f1834,function(_0x226876){if(_0x226876['type']!=='VIRTUAL'){var _0x31c629={};_0x31c629[_0x226876[_0x39e7('0x27')]]={'$like':'%'+_0x3a7e24[_0x39e7('0x30')][_0x39e7('0x3b')]+'%'};return _0x31c629;}})});}_0x4929a8=_['merge']({},_0x4929a8,_0x3a7e24[_0x39e7('0x3e')]);var _0x102407={'where':_0x4929a8[_0x39e7('0x3c')]};return db[_0x39e7('0x2a')][_0x39e7('0x3f')](_0x102407)[_0x39e7('0x25')](function(_0x31253d){_0x2f9424[_0x39e7('0x3f')]=_0x31253d;if(_0x3a7e24['query'][_0x39e7('0x40')]){_0x4929a8['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x4929a8);})['then'](function(_0x5e4b35){_0x2f9424[_0x39e7('0x41')]=_0x5e4b35;return _0x2f9424;})[_0x39e7('0x25')](respondWithFilteredResult(_0x1b76f4,_0x4929a8))[_0x39e7('0x42')](handleError(_0x1b76f4,null));};exports[_0x39e7('0x43')]=function(_0x494b35,_0x2759a6){var _0x335563={'raw':![],'where':{'id':_0x494b35[_0x39e7('0x44')]['id']}},_0x664254={};_0x664254['model']=_[_0x39e7('0x45')](db[_0x39e7('0x2a')]['rawAttributes']);_0x664254['query']=_[_0x39e7('0x45')](_0x494b35['query']);_0x664254[_0x39e7('0x39')]=_[_0x39e7('0x31')](_0x664254[_0x39e7('0x46')],_0x664254[_0x39e7('0x30')]);_0x335563[_0x39e7('0x32')]=_[_0x39e7('0x31')](_0x664254[_0x39e7('0x46')],qs[_0x39e7('0x33')](_0x494b35[_0x39e7('0x30')][_0x39e7('0x33')]));_0x335563[_0x39e7('0x32')]=_0x335563[_0x39e7('0x32')][_0x39e7('0x34')]?_0x335563[_0x39e7('0x32')]:_0x664254[_0x39e7('0x46')];if(_0x494b35[_0x39e7('0x30')][_0x39e7('0x40')]){_0x335563['include']=[{'all':!![]}];}_0x335563=_['merge']({},_0x335563,_0x494b35[_0x39e7('0x3e')]);return db[_0x39e7('0x2a')][_0x39e7('0x47')](_0x335563)[_0x39e7('0x25')](handleEntityNotFound(_0x2759a6,null))[_0x39e7('0x25')](respondWithResult(_0x2759a6,null))[_0x39e7('0x42')](handleError(_0x2759a6,null));};exports['create']=function(_0x4fd4e3,_0x208d50){return db[_0x39e7('0x2a')][_0x39e7('0x48')](_0x4fd4e3[_0x39e7('0x49')],{})[_0x39e7('0x25')](respondWithResult(_0x208d50,0xc9))[_0x39e7('0x42')](handleError(_0x208d50,null));};exports['update']=function(_0x2c675d,_0x2b3a86){if(_0x2c675d[_0x39e7('0x49')]['id']){delete _0x2c675d['body']['id'];}return db['FreshsalesAccount'][_0x39e7('0x47')]({'where':{'id':_0x2c675d[_0x39e7('0x44')]['id']}})[_0x39e7('0x25')](handleEntityNotFound(_0x2b3a86,null))['then'](saveUpdates(_0x2c675d[_0x39e7('0x49')],null))[_0x39e7('0x25')](respondWithResult(_0x2b3a86,null))['catch'](handleError(_0x2b3a86,null));};exports[_0x39e7('0x4a')]=function(_0x4d7efa,_0x39ca13){return db[_0x39e7('0x2a')][_0x39e7('0x47')]({'where':{'id':_0x4d7efa[_0x39e7('0x44')]['id']}})['then'](handleEntityNotFound(_0x39ca13,null))[_0x39e7('0x25')](removeEntity(_0x39ca13,null))[_0x39e7('0x42')](handleError(_0x39ca13,null));};exports[_0x39e7('0x4b')]=function(_0x37e0ff,_0x26f797,_0x5d9e67){var _0x483a8e={};var _0x2e7e68={};var _0x25e907;var _0x103bd3;return db[_0x39e7('0x2a')][_0x39e7('0x4c')]({'where':{'id':_0x37e0ff[_0x39e7('0x44')]['id']}})[_0x39e7('0x25')](handleEntityNotFound(_0x26f797,null))[_0x39e7('0x25')](function(_0x222a0f){if(_0x222a0f){_0x25e907=_0x222a0f;_0x2e7e68[_0x39e7('0x46')]=_['keys'](db[_0x39e7('0x4d')][_0x39e7('0x2b')]);_0x2e7e68['query']=_['keys'](_0x37e0ff[_0x39e7('0x30')]);_0x2e7e68[_0x39e7('0x39')]=_[_0x39e7('0x31')](_0x2e7e68[_0x39e7('0x46')],_0x2e7e68[_0x39e7('0x30')]);_0x483a8e['attributes']=_[_0x39e7('0x31')](_0x2e7e68[_0x39e7('0x46')],qs[_0x39e7('0x33')](_0x37e0ff[_0x39e7('0x30')][_0x39e7('0x33')]));_0x483a8e[_0x39e7('0x32')]=_0x483a8e[_0x39e7('0x32')][_0x39e7('0x34')]?_0x483a8e[_0x39e7('0x32')]:_0x2e7e68['model'];_0x483a8e['order']=qs[_0x39e7('0x38')](_0x37e0ff[_0x39e7('0x30')]['sort']);_0x483a8e[_0x39e7('0x3c')]=qs[_0x39e7('0x39')](_[_0x39e7('0x3a')](_0x37e0ff['query'],_0x2e7e68[_0x39e7('0x39')]));if(_0x37e0ff[_0x39e7('0x30')][_0x39e7('0x3b')]){_0x483a8e[_0x39e7('0x3c')]=_['merge'](_0x483a8e[_0x39e7('0x3c')],{'$or':_[_0x39e7('0x2f')](_0x483a8e['attributes'],function(_0x1e9e78){var _0x3dae54={};_0x3dae54[_0x1e9e78]={'$like':'%'+_0x37e0ff['query'][_0x39e7('0x3b')]+'%'};return _0x3dae54;})});}_0x483a8e=_[_0x39e7('0x3d')]({},_0x483a8e,_0x37e0ff[_0x39e7('0x3e')]);return _0x25e907[_0x39e7('0x4b')](_0x483a8e);}})[_0x39e7('0x25')](function(_0x1a8a7a){if(_0x1a8a7a){_0x103bd3=_0x1a8a7a[_0x39e7('0x34')];if(!_0x37e0ff['query'][_0x39e7('0x35')](_0x39e7('0x36'))){_0x483a8e[_0x39e7('0x22')]=qs[_0x39e7('0x22')](_0x37e0ff[_0x39e7('0x30')][_0x39e7('0x22')]);_0x483a8e[_0x39e7('0x21')]=qs[_0x39e7('0x21')](_0x37e0ff[_0x39e7('0x30')][_0x39e7('0x21')]);}return _0x25e907[_0x39e7('0x4b')](_0x483a8e);}})[_0x39e7('0x25')](function(_0x176b5b){if(_0x176b5b){return _0x176b5b?{'count':_0x103bd3,'rows':_0x176b5b}:null;}})[_0x39e7('0x25')](respondWithResult(_0x26f797,null))[_0x39e7('0x42')](handleError(_0x26f797,null));};exports['addConfiguration']=function(_0x12a296,_0x546042,_0x58118c){if(_0x12a296['body']['id']){delete _0x12a296[_0x39e7('0x49')]['id'];}return db[_0x39e7('0x2a')][_0x39e7('0x4c')]({'where':{'id':_0x12a296[_0x39e7('0x44')]['id']}})[_0x39e7('0x25')](handleEntityNotFound(_0x546042,null))[_0x39e7('0x25')](function(_0x589bf6){if(_0x589bf6){_0x12a296[_0x39e7('0x49')]['AccountId']=_0x589bf6['id'];_0x12a296[_0x39e7('0x49')][_0x39e7('0x4e')]=integrations[_0x39e7('0x4f')](_0x12a296['body'][_0x39e7('0x50')],_0x12a296[_0x39e7('0x49')][_0x39e7('0x2d')]);_0x12a296[_0x39e7('0x49')]['Descriptions']=integrations[_0x39e7('0x51')](_0x12a296[_0x39e7('0x49')][_0x39e7('0x50')],_0x12a296[_0x39e7('0x49')]['type']);return db[_0x39e7('0x4d')]['create'](_0x12a296[_0x39e7('0x49')],{'include':[{'model':db[_0x39e7('0x52')],'as':_0x39e7('0x4e')},{'model':db[_0x39e7('0x52')],'as':'Descriptions'}]});}return null;})[_0x39e7('0x25')](respondWithResult(_0x546042,null))[_0x39e7('0x42')](handleError(_0x546042,null));};exports[_0x39e7('0x53')]=function(_0xa571ec,_0x27ef02,_0x21f49b){var _0x5cff19='';var _0x1b39db='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0xa571ec[_0x39e7('0x44')]['id']},'attributes':['id','username',_0x39e7('0x54'),_0x39e7('0x55')]})['then'](handleEntityNotFound(_0x27ef02,null))['then'](function(_0x2b1289){if(_0x2b1289){_0x1b39db=_0x2b1289[_0x39e7('0x56')];_0x5cff19=_0x2b1289[_0x39e7('0x54')];var _0x541644=_0x2b1289['remoteUri'][_0x39e7('0x57')](-0x1);if(_0x541644==='/'){_0x5cff19=_0x5cff19[_0x39e7('0x58')](0x0,_0x5cff19[_0x39e7('0x59')](_0x541644));}return rp({'method':_0x39e7('0x5a'),'uri':util[_0x39e7('0x5b')](_0x39e7('0x5c'),_0x5cff19,_0x39e7('0x5d')),'headers':{'Authorization':_0x39e7('0x5e')+_0x2b1289[_0x39e7('0x55')]},'json':!![]});}})['then'](function(_0x2b2da3){if(_0x2b2da3){var _0x4a0e88=_0x2b2da3[_0x39e7('0x5f')];var _0x41f931=![];var _0x301b04=null;for(_0x301b04=0x0;_0x301b04<_0x4a0e88[_0x39e7('0x34')];_0x301b04++){if(_0x4a0e88[_0x301b04][_0x39e7('0x60')]===_0x1b39db){_0x41f931=!![];}}if(_0x41f931){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x39e7('0x25')](respondWithResult(_0x27ef02,null))[_0x39e7('0x42')](function(_0x453c9b){var _0x48c0bf=_0xa571ec[_0x39e7('0x30')][_0x39e7('0x61')]?0x1f4:_0x453c9b[_0x39e7('0x62')]||0x1f4;logger['error'](_0x39e7('0x63'),_0x39e7('0x53'),_0x48c0bf,JSON[_0x39e7('0x64')](_0x453c9b));delete _0x453c9b[_0x39e7('0x27')];if(_0x48c0bf===0x191){_0x48c0bf=0x190;}_0x27ef02[_0x39e7('0x1e')](_0x48c0bf)['send'](_0xa571ec[_0x39e7('0x30')][_0x39e7('0x61')]?{'message':_0x39e7('0x65'),'statusCode':_0x453c9b[_0x39e7('0x62')]}:_0x453c9b);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index eacba52..3af998d 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 _0x0adf=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x1361d6,_0x5ca9d4){var _0x30af37=function(_0x2d4402){while(--_0x2d4402){_0x1361d6['push'](_0x1361d6['shift']());}};_0x30af37(++_0x5ca9d4);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1a162a,_0x52ef55){_0x1a162a=_0x1a162a-0x0;var _0x2a84ce=_0x0adf[_0x1a162a];return _0x2a84ce;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf0ad('0xa')]=function(_0x53221f,_0x2eca0e){return _0x53221f[_0xf0ad('0xb')](_0xf0ad('0xc'),attributes,{'tableName':_0xf0ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0x7a54,0x106));var _0x47a5=function(_0x3d2cd6,_0x476ebd){_0x3d2cd6=_0x3d2cd6-0x0;var _0x251932=_0x7a54[_0x3d2cd6];return _0x251932;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 4de7913..e0bf960 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 _0xc1c6=['then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshsalesAccount','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x541531,_0x4f0733){var _0x87b88b=function(_0x1fd031){while(--_0x1fd031){_0x541531['push'](_0x541531['shift']());}};_0x87b88b(++_0x4f0733);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x175536,_0x399b5b){_0x175536=_0x175536-0x0;var _0xb609b0=_0xc1c6[_0x175536];return _0xb609b0;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['GetFreshsalesAccount']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['FreshsalesAccount'][_0x6c1c('0x13')]({'raw':_0x137770['options']?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null,'include':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')],function(_0x12c638){return{'model':db[_0x12c638[_0x6c1c('0x1b')]],'as':_0x12c638['as'],'attributes':_0x12c638[_0x6c1c('0x17')],'include':_0x12c638[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x12c638[_0x6c1c('0x19')],function(_0x7ff10d){return{'model':db[_0x7ff10d[_0x6c1c('0x1b')]],'as':_0x7ff10d['as'],'attributes':_0x7ff10d[_0x6c1c('0x17')],'include':_0x7ff10d[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x7ff10d[_0x6c1c('0x19')],function(_0x5f4568){return{'model':db[_0x5f4568[_0x6c1c('0x1b')]],'as':_0x5f4568['as'],'attributes':_0x5f4568['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1c('0x9')](function(_0x4c23f8){logger[_0x6c1c('0x11')]('GetFreshsalesAccount',_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x1c'),_0x137770,JSON['stringify'](_0x4c23f8));_0x338dc2(_0x4c23f8);})[_0x6c1c('0x12')](function(_0x24da4c){logger['error'](_0x6c1c('0x1c'),_0x24da4c[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x24da4c[_0x6c1c('0x10')]));});});};exports['ShowFreshsalesAccount']=function(_0x52c036){var _0x3cba17=this;return new Promise(function(_0x45128c,_0x21acef){return db[_0x6c1c('0x1d')][_0x6c1c('0x1e')]({'raw':_0x52c036[_0x6c1c('0x14')]?_0x52c036['options'][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'where':_0x52c036[_0x6c1c('0x14')]?_0x52c036['options'][_0x6c1c('0x16')]||null:null,'attributes':_0x52c036[_0x6c1c('0x14')]?_0x52c036[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'include':_0x52c036['options']?_0x52c036[_0x6c1c('0x14')][_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x52c036['options'][_0x6c1c('0x19')],function(_0x4e5767){return{'model':db[_0x4e5767[_0x6c1c('0x1b')]],'as':_0x4e5767['as'],'attributes':_0x4e5767['attributes'],'include':_0x4e5767[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x4e5767[_0x6c1c('0x19')],function(_0x54b8d3){return{'model':db[_0x54b8d3['model']],'as':_0x54b8d3['as'],'attributes':_0x54b8d3[_0x6c1c('0x17')],'include':_0x54b8d3[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x54b8d3['include'],function(_0x1a9132){return{'model':db[_0x1a9132['model']],'as':_0x1a9132['as'],'attributes':_0x1a9132['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1c('0x9')](function(_0xbafcb3){logger[_0x6c1c('0x11')](_0x6c1c('0x1f'),_0x52c036);logger['debug'](_0x6c1c('0x1f'),_0x52c036,JSON[_0x6c1c('0xe')](_0xbafcb3));_0x45128c(_0xbafcb3);})[_0x6c1c('0x12')](function(_0x18da02){logger[_0x6c1c('0xf')](_0x6c1c('0x1f'),_0x18da02[_0x6c1c('0x10')],_0x52c036);_0x21acef(_0x3cba17[_0x6c1c('0xf')](0x1f4,_0x18da02[_0x6c1c('0x10')]));});});}; \ No newline at end of file +var _0x90b1=['ShowFreshsalesAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','find'];(function(_0x1c01c5,_0x4fcdd7){var _0x173030=function(_0x595ae3){while(--_0x595ae3){_0x1c01c5['push'](_0x1c01c5['shift']());}};_0x173030(++_0x4fcdd7);}(_0x90b1,0x1bb));var _0x190b=function(_0x96baa6,_0x113c83){_0x96baa6=_0x96baa6-0x0;var _0x14c52b=_0x90b1[_0x96baa6];return _0x14c52b;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')]({'raw':_0x21e458[_0x190b('0x17')]?_0x21e458[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![],'where':_0x21e458[_0x190b('0x17')]?_0x21e458['options'][_0x190b('0x19')]||null:null,'attributes':_0x21e458[_0x190b('0x17')]?_0x21e458['options'][_0x190b('0x1a')]||null:null,'limit':_0x21e458['options']?_0x21e458['options'][_0x190b('0x1b')]||null:null,'include':_0x21e458[_0x190b('0x17')]?_0x21e458[_0x190b('0x17')]['include']?_[_0x190b('0x1c')](_0x21e458[_0x190b('0x17')][_0x190b('0x1d')],function(_0x292ce3){return{'model':db[_0x292ce3[_0x190b('0x1e')]],'as':_0x292ce3['as'],'attributes':_0x292ce3[_0x190b('0x1a')],'include':_0x292ce3[_0x190b('0x1d')]?_['map'](_0x292ce3['include'],function(_0x262a63){return{'model':db[_0x262a63[_0x190b('0x1e')]],'as':_0x262a63['as'],'attributes':_0x262a63['attributes'],'include':_0x262a63['include']?_[_0x190b('0x1c')](_0x262a63['include'],function(_0x328e5e){return{'model':db[_0x328e5e[_0x190b('0x1e')]],'as':_0x328e5e['as'],'attributes':_0x328e5e['attributes']};}):[]};}):[]};}):[]:[]})[_0x190b('0x1f')](function(_0x1deea6){logger['info'](_0x190b('0x14'),_0x21e458);logger[_0x190b('0xc')](_0x190b('0x14'),_0x21e458,JSON['stringify'](_0x1deea6));_0x16c009(_0x1deea6);})['catch'](function(_0x3730cc){logger['error'](_0x190b('0x14'),_0x3730cc[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a['error'](0x1f4,_0x3730cc[_0x190b('0x11')]));});});};exports['ShowFreshsalesAccount']=function(_0x40d060){var _0x4ff5a6=this;return new Promise(function(_0x19600d,_0x5650e1){return db[_0x190b('0x15')][_0x190b('0x20')]({'raw':_0x40d060['options']?_0x40d060[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![],'where':_0x40d060[_0x190b('0x17')]?_0x40d060[_0x190b('0x17')][_0x190b('0x19')]||null:null,'attributes':_0x40d060[_0x190b('0x17')]?_0x40d060[_0x190b('0x17')][_0x190b('0x1a')]||null:null,'include':_0x40d060['options']?_0x40d060['options'][_0x190b('0x1d')]?_[_0x190b('0x1c')](_0x40d060['options'][_0x190b('0x1d')],function(_0x2dcd39){return{'model':db[_0x2dcd39[_0x190b('0x1e')]],'as':_0x2dcd39['as'],'attributes':_0x2dcd39[_0x190b('0x1a')],'include':_0x2dcd39[_0x190b('0x1d')]?_[_0x190b('0x1c')](_0x2dcd39[_0x190b('0x1d')],function(_0x5492b0){return{'model':db[_0x5492b0['model']],'as':_0x5492b0['as'],'attributes':_0x5492b0[_0x190b('0x1a')],'include':_0x5492b0[_0x190b('0x1d')]?_[_0x190b('0x1c')](_0x5492b0['include'],function(_0x33e9db){return{'model':db[_0x33e9db[_0x190b('0x1e')]],'as':_0x33e9db['as'],'attributes':_0x33e9db[_0x190b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a8260){logger['info']('ShowFreshsalesAccount',_0x40d060);logger[_0x190b('0xc')](_0x190b('0x21'),_0x40d060,JSON['stringify'](_0x2a8260));_0x19600d(_0x2a8260);})[_0x190b('0x13')](function(_0xfd0d62){logger[_0x190b('0xf')]('ShowFreshsalesAccount',_0xfd0d62[_0x190b('0x11')],_0x40d060);_0x5650e1(_0x4ff5a6[_0x190b('0xf')](0x1f4,_0xfd0d62['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 9005221..03e7c6f 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 _0xfbc3=['/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects'];(function(_0x28dcfe,_0x52e363){var _0x23ad2d=function(_0x423a73){while(--_0x423a73){_0x28dcfe['push'](_0x28dcfe['shift']());}};_0x23ad2d(++_0x52e363);}(_0xfbc3,0x195));var _0x3fbc=function(_0x55856,_0x2c391f){_0x55856=_0x55856-0x0;var _0x14340e=_0xfbc3[_0x55856];return _0x14340e;};'use strict';var multer=require('multer');var util=require(_0x3fbc('0x0'));var path=require(_0x3fbc('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fbc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3fbc('0x3'));var interaction=require(_0x3fbc('0x4'));var config=require(_0x3fbc('0x5'));var controller=require(_0x3fbc('0x6'));router[_0x3fbc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3fbc('0x7')](_0x3fbc('0x8'),auth[_0x3fbc('0x9')](),controller[_0x3fbc('0xa')]);router['get'](_0x3fbc('0xb'),auth[_0x3fbc('0x9')](),controller[_0x3fbc('0xc')]);router[_0x3fbc('0x7')](_0x3fbc('0xd'),auth[_0x3fbc('0x9')](),controller[_0x3fbc('0xe')]);router['get'](_0x3fbc('0xf'),auth['isAuthenticated'](),controller[_0x3fbc('0x10')]);router['post']('/',auth[_0x3fbc('0x9')](),controller[_0x3fbc('0x11')]);router[_0x3fbc('0x12')](_0x3fbc('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x3fbc('0x13')](_0x3fbc('0x8'),auth[_0x3fbc('0x9')](),controller[_0x3fbc('0x14')]);module[_0x3fbc('0x15')]=router; \ No newline at end of file +var _0x9f29=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1b0896,_0x232030){var _0x31aca6=function(_0x1860be){while(--_0x1860be){_0x1b0896['push'](_0x1b0896['shift']());}};_0x31aca6(++_0x232030);}(_0x9f29,0xc7));var _0x99f2=function(_0x25be8b,_0x2469fe){_0x25be8b=_0x25be8b-0x0;var _0x465169=_0x9f29[_0x25be8b];return _0x465169;};'use strict';var multer=require(_0x99f2('0x0'));var util=require(_0x99f2('0x1'));var path=require(_0x99f2('0x2'));var timeout=require(_0x99f2('0x3'));var express=require(_0x99f2('0x4'));var router=express[_0x99f2('0x5')]();var fs_extra=require(_0x99f2('0x6'));var auth=require(_0x99f2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x99f2('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x99f2('0x9')]('/',auth[_0x99f2('0xa')](),controller['index']);router['get'](_0x99f2('0xb'),auth[_0x99f2('0xa')](),controller[_0x99f2('0xc')]);router[_0x99f2('0x9')](_0x99f2('0xd'),auth[_0x99f2('0xa')](),controller[_0x99f2('0xe')]);router['get'](_0x99f2('0xf'),auth[_0x99f2('0xa')](),controller[_0x99f2('0x10')]);router[_0x99f2('0x9')]('/:id/fields',auth[_0x99f2('0xa')](),controller[_0x99f2('0x11')]);router[_0x99f2('0x12')]('/',auth[_0x99f2('0xa')](),controller[_0x99f2('0x13')]);router[_0x99f2('0x14')](_0x99f2('0xb'),auth['isAuthenticated'](),controller[_0x99f2('0x15')]);router[_0x99f2('0x16')](_0x99f2('0xb'),auth[_0x99f2('0xa')](),controller[_0x99f2('0x17')]);module[_0x99f2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index af318e0..ec71e18 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 _0x125c=['sequelize','STRING'];(function(_0x3f5dd3,_0x171037){var _0x3cb003=function(_0x3115e4){while(--_0x3115e4){_0x3f5dd3['push'](_0x3f5dd3['shift']());}};_0x3cb003(++_0x171037);}(_0x125c,0xa2));var _0xc125=function(_0x446c8c,_0xc9b2f3){_0x446c8c=_0x446c8c-0x0;var _0x5a3d92=_0x125c[_0x446c8c];return _0x5a3d92;};'use strict';var Sequelize=require(_0xc125('0x0'));module['exports']={'name':{'type':Sequelize[_0xc125('0x1')]},'description':{'type':Sequelize[_0xc125('0x1')]}}; \ No newline at end of file +var _0x6bd9=['STRING','sequelize','exports'];(function(_0xee1ec9,_0x2f0599){var _0x102a53=function(_0x4e5f7f){while(--_0x4e5f7f){_0xee1ec9['push'](_0xee1ec9['shift']());}};_0x102a53(++_0x2f0599);}(_0x6bd9,0xca));var _0x96bd=function(_0x5e2931,_0x11b4db){_0x5e2931=_0x5e2931-0x0;var _0x509421=_0x6bd9[_0x5e2931];return _0x509421;};'use strict';var Sequelize=require(_0x96bd('0x0'));module[_0x96bd('0x1')]={'name':{'type':Sequelize[_0x96bd('0x2')]},'description':{'type':Sequelize[_0x96bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 3da761e..c66da66 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 _0x9ec5=['update','body','destroy','getSubjects','findOne','FreshsalesField','getDescriptions','order','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','stack','name','send','index','map','FreshsalesConfiguration','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create'];(function(_0x465010,_0x269113){var _0x31f794=function(_0x52335a){while(--_0x52335a){_0x465010['push'](_0x465010['shift']());}};_0x31f794(++_0x269113);}(_0x9ec5,0x1a8));var _0x59ec=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x9ec5[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0x59ec('0x0'));var rimraf=require(_0x59ec('0x1'));var zipdir=require(_0x59ec('0x2'));var jsonpatch=require(_0x59ec('0x3'));var rp=require(_0x59ec('0x4'));var moment=require('moment');var BPromise=require(_0x59ec('0x5'));var Mustache=require(_0x59ec('0x6'));var util=require(_0x59ec('0x7'));var path=require(_0x59ec('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x59ec('0x9'));var fs=require('fs');var fs_extra=require(_0x59ec('0xa'));var _=require(_0x59ec('0xb'));var squel=require(_0x59ec('0xc'));var crypto=require(_0x59ec('0xd'));var jsforce=require(_0x59ec('0xe'));var deskjs=require(_0x59ec('0xf'));var toCsv=require(_0x59ec('0x10'));var querystring=require(_0x59ec('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59ec('0x12'));var qs=require(_0x59ec('0x13'));var as=require(_0x59ec('0x14'));var hardwareService=require(_0x59ec('0x15'));var logger=require(_0x59ec('0x16'))(_0x59ec('0x17'));var utils=require('../../config/utils');var config=require(_0x59ec('0x18'));var licenseUtil=require(_0x59ec('0x19'));var db=require(_0x59ec('0x1a'))['db'];function respondWithStatusCode(_0x55e68b,_0x1e0e79){_0x1e0e79=_0x1e0e79||0xcc;return function(_0x37a75b){if(_0x37a75b){return _0x55e68b[_0x59ec('0x1b')](_0x1e0e79);}return _0x55e68b[_0x59ec('0x1c')](_0x1e0e79)[_0x59ec('0x1d')]();};}function respondWithResult(_0x338edf,_0x595746){_0x595746=_0x595746||0xc8;return function(_0x1f102e){if(_0x1f102e){return _0x338edf[_0x59ec('0x1c')](_0x595746)[_0x59ec('0x1e')](_0x1f102e);}};}function respondWithFilteredResult(_0x11e413,_0x1b72b4){return function(_0x59aabe){if(_0x59aabe){var _0x5c0fea=typeof _0x1b72b4[_0x59ec('0x1f')]===_0x59ec('0x20')&&typeof _0x1b72b4[_0x59ec('0x21')]===_0x59ec('0x20');var _0x59d336=_0x59aabe[_0x59ec('0x22')];var _0x1d5634=_0x5c0fea?0x0:_0x1b72b4['offset'];var _0x4df94f=_0x5c0fea?_0x59aabe[_0x59ec('0x22')]:_0x1b72b4[_0x59ec('0x1f')]+_0x1b72b4[_0x59ec('0x21')];var _0x40e171;if(_0x4df94f>=_0x59d336){_0x4df94f=_0x59d336;_0x40e171=0xc8;}else{_0x40e171=0xce;}_0x11e413['status'](_0x40e171);return _0x11e413[_0x59ec('0x23')](_0x59ec('0x24'),_0x1d5634+'-'+_0x4df94f+'/'+_0x59d336)[_0x59ec('0x1e')](_0x59aabe);}return null;};}function patchUpdates(_0x3401a1){return function(_0x3d43ea){try{jsonpatch['apply'](_0x3d43ea,_0x3401a1,!![]);}catch(_0x2fd6b8){return BPromise[_0x59ec('0x25')](_0x2fd6b8);}return _0x3d43ea['save']();};}function saveUpdates(_0x52cd41,_0x2763a){return function(_0x5f1051){if(_0x5f1051){return _0x5f1051['update'](_0x52cd41)[_0x59ec('0x26')](function(_0x3e9a8a){return _0x3e9a8a;});}return null;};}function removeEntity(_0x5d92ff,_0x1e61d0){return function(_0xc362f7){if(_0xc362f7){return _0xc362f7['destroy']()['then'](function(){_0x5d92ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x245200,_0x2e8f1e){return function(_0x53e332){if(!_0x53e332){_0x245200[_0x59ec('0x1b')](0x194);}return _0x53e332;};}function handleError(_0x27cb0f,_0x43aa17){_0x43aa17=_0x43aa17||0x1f4;return function(_0x499cdf){logger['error'](_0x499cdf[_0x59ec('0x27')]);if(_0x499cdf[_0x59ec('0x28')]){delete _0x499cdf[_0x59ec('0x28')];}_0x27cb0f[_0x59ec('0x1c')](_0x43aa17)[_0x59ec('0x29')](_0x499cdf);};}exports[_0x59ec('0x2a')]=function(_0x5b7368,_0x313850){var _0x156cdc={},_0x34e3df={},_0x15e4e0={'count':0x0,'rows':[]};var _0x5c414c=_[_0x59ec('0x2b')](db[_0x59ec('0x2c')]['rawAttributes'],function(_0x14f6f7){return{'name':_0x14f6f7[_0x59ec('0x2d')],'type':_0x14f6f7['type'][_0x59ec('0x2e')]};});_0x34e3df[_0x59ec('0x2f')]=_['map'](_0x5c414c,_0x59ec('0x28'));_0x34e3df[_0x59ec('0x30')]=_['keys'](_0x5b7368[_0x59ec('0x30')]);_0x34e3df[_0x59ec('0x31')]=_['intersection'](_0x34e3df['model'],_0x34e3df[_0x59ec('0x30')]);_0x156cdc[_0x59ec('0x32')]=_[_0x59ec('0x33')](_0x34e3df[_0x59ec('0x2f')],qs[_0x59ec('0x34')](_0x5b7368[_0x59ec('0x30')][_0x59ec('0x34')]));_0x156cdc[_0x59ec('0x32')]=_0x156cdc[_0x59ec('0x32')][_0x59ec('0x35')]?_0x156cdc[_0x59ec('0x32')]:_0x34e3df[_0x59ec('0x2f')];if(!_0x5b7368[_0x59ec('0x30')][_0x59ec('0x36')](_0x59ec('0x37'))){_0x156cdc[_0x59ec('0x21')]=qs[_0x59ec('0x21')](_0x5b7368['query']['limit']);_0x156cdc[_0x59ec('0x1f')]=qs['offset'](_0x5b7368[_0x59ec('0x30')][_0x59ec('0x1f')]);}_0x156cdc['order']=qs[_0x59ec('0x38')](_0x5b7368['query']['sort']);_0x156cdc[_0x59ec('0x39')]=qs[_0x59ec('0x31')](_[_0x59ec('0x3a')](_0x5b7368[_0x59ec('0x30')],_0x34e3df[_0x59ec('0x31')]),_0x5c414c);if(_0x5b7368[_0x59ec('0x30')]['filter']){_0x156cdc[_0x59ec('0x39')]=_[_0x59ec('0x3b')](_0x156cdc['where'],{'$or':_['map'](_0x5c414c,function(_0x5381c2){if(_0x5381c2['type']!==_0x59ec('0x3c')){var _0x134152={};_0x134152[_0x5381c2[_0x59ec('0x28')]]={'$like':'%'+_0x5b7368[_0x59ec('0x30')][_0x59ec('0x3d')]+'%'};return _0x134152;}})});}_0x156cdc=_['merge']({},_0x156cdc,_0x5b7368[_0x59ec('0x3e')]);var _0x7b533f={'where':_0x156cdc[_0x59ec('0x39')]};return db[_0x59ec('0x2c')]['count'](_0x7b533f)['then'](function(_0x471dd6){_0x15e4e0[_0x59ec('0x22')]=_0x471dd6;if(_0x5b7368[_0x59ec('0x30')]['includeAll']){_0x156cdc[_0x59ec('0x3f')]=[{'all':!![]}];}return db[_0x59ec('0x2c')][_0x59ec('0x40')](_0x156cdc);})['then'](function(_0x36a8a7){_0x15e4e0[_0x59ec('0x41')]=_0x36a8a7;return _0x15e4e0;})[_0x59ec('0x26')](respondWithFilteredResult(_0x313850,_0x156cdc))[_0x59ec('0x42')](handleError(_0x313850,null));};exports[_0x59ec('0x43')]=function(_0x17f2bd,_0xde7c92){var _0x422f8e={'raw':![],'where':{'id':_0x17f2bd[_0x59ec('0x44')]['id']}},_0x12057e={};_0x12057e[_0x59ec('0x2f')]=_[_0x59ec('0x45')](db['FreshsalesConfiguration'][_0x59ec('0x46')]);_0x12057e['query']=_[_0x59ec('0x45')](_0x17f2bd[_0x59ec('0x30')]);_0x12057e[_0x59ec('0x31')]=_[_0x59ec('0x33')](_0x12057e[_0x59ec('0x2f')],_0x12057e[_0x59ec('0x30')]);_0x422f8e[_0x59ec('0x32')]=_[_0x59ec('0x33')](_0x12057e[_0x59ec('0x2f')],qs[_0x59ec('0x34')](_0x17f2bd['query'][_0x59ec('0x34')]));_0x422f8e['attributes']=_0x422f8e[_0x59ec('0x32')][_0x59ec('0x35')]?_0x422f8e[_0x59ec('0x32')]:_0x12057e[_0x59ec('0x2f')];if(_0x17f2bd[_0x59ec('0x30')][_0x59ec('0x47')]){_0x422f8e['include']=[{'all':!![]}];}_0x422f8e=_[_0x59ec('0x3b')]({},_0x422f8e,_0x17f2bd[_0x59ec('0x3e')]);return db['FreshsalesConfiguration'][_0x59ec('0x48')](_0x422f8e)[_0x59ec('0x26')](handleEntityNotFound(_0xde7c92,null))[_0x59ec('0x26')](respondWithResult(_0xde7c92,null))[_0x59ec('0x42')](handleError(_0xde7c92,null));};exports[_0x59ec('0x49')]=function(_0x3e724c,_0x29c0ba){return db[_0x59ec('0x2c')]['create'](_0x3e724c['body'],{})[_0x59ec('0x26')](respondWithResult(_0x29c0ba,0xc9))['catch'](handleError(_0x29c0ba,null));};exports[_0x59ec('0x4a')]=function(_0xe010e1,_0x1a2073){if(_0xe010e1['body']['id']){delete _0xe010e1['body']['id'];}return db[_0x59ec('0x2c')][_0x59ec('0x48')]({'where':{'id':_0xe010e1[_0x59ec('0x44')]['id']}})[_0x59ec('0x26')](handleEntityNotFound(_0x1a2073,null))[_0x59ec('0x26')](saveUpdates(_0xe010e1[_0x59ec('0x4b')],null))[_0x59ec('0x26')](respondWithResult(_0x1a2073,null))[_0x59ec('0x42')](handleError(_0x1a2073,null));};exports[_0x59ec('0x4c')]=function(_0x57027b,_0x4ae867){return db[_0x59ec('0x2c')]['find']({'where':{'id':_0x57027b[_0x59ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ae867,null))[_0x59ec('0x26')](removeEntity(_0x4ae867,null))[_0x59ec('0x42')](handleError(_0x4ae867,null));};exports[_0x59ec('0x4d')]=function(_0x4519e1,_0x26861c,_0x219089){var _0xd97557={};var _0x3f9493={};var _0x244739;var _0x2f4a4a;return db[_0x59ec('0x2c')][_0x59ec('0x4e')]({'where':{'id':_0x4519e1[_0x59ec('0x44')]['id']}})[_0x59ec('0x26')](handleEntityNotFound(_0x26861c,null))[_0x59ec('0x26')](function(_0x84a2a){if(_0x84a2a){_0x244739=_0x84a2a;_0x3f9493[_0x59ec('0x2f')]=_[_0x59ec('0x45')](db[_0x59ec('0x4f')][_0x59ec('0x46')]);_0x3f9493['query']=_[_0x59ec('0x45')](_0x4519e1['query']);_0x3f9493[_0x59ec('0x31')]=_[_0x59ec('0x33')](_0x3f9493[_0x59ec('0x2f')],_0x3f9493[_0x59ec('0x30')]);_0xd97557[_0x59ec('0x32')]=_['intersection'](_0x3f9493[_0x59ec('0x2f')],qs[_0x59ec('0x34')](_0x4519e1[_0x59ec('0x30')][_0x59ec('0x34')]));_0xd97557['attributes']=_0xd97557[_0x59ec('0x32')][_0x59ec('0x35')]?_0xd97557['attributes']:_0x3f9493[_0x59ec('0x2f')];_0xd97557['order']=qs[_0x59ec('0x38')](_0x4519e1['query'][_0x59ec('0x38')]);_0xd97557['where']=qs[_0x59ec('0x31')](_[_0x59ec('0x3a')](_0x4519e1[_0x59ec('0x30')],_0x3f9493['filters']));if(_0x4519e1['query']['filter']){_0xd97557[_0x59ec('0x39')]=_[_0x59ec('0x3b')](_0xd97557[_0x59ec('0x39')],{'$or':_[_0x59ec('0x2b')](_0xd97557[_0x59ec('0x32')],function(_0x1de175){var _0x38464f={};_0x38464f[_0x1de175]={'$like':'%'+_0x4519e1[_0x59ec('0x30')][_0x59ec('0x3d')]+'%'};return _0x38464f;})});}_0xd97557=_[_0x59ec('0x3b')]({},_0xd97557,_0x4519e1[_0x59ec('0x3e')]);return _0x244739[_0x59ec('0x4d')](_0xd97557);}})[_0x59ec('0x26')](function(_0xac78f6){if(_0xac78f6){_0x2f4a4a=_0xac78f6[_0x59ec('0x35')];if(!_0x4519e1[_0x59ec('0x30')]['hasOwnProperty'](_0x59ec('0x37'))){_0xd97557[_0x59ec('0x21')]=qs[_0x59ec('0x21')](_0x4519e1['query']['limit']);_0xd97557[_0x59ec('0x1f')]=qs[_0x59ec('0x1f')](_0x4519e1['query'][_0x59ec('0x1f')]);}return _0x244739[_0x59ec('0x4d')](_0xd97557);}})['then'](function(_0x981e60){if(_0x981e60){return _0x981e60?{'count':_0x2f4a4a,'rows':_0x981e60}:null;}})[_0x59ec('0x26')](respondWithResult(_0x26861c,null))[_0x59ec('0x42')](handleError(_0x26861c,null));};exports[_0x59ec('0x50')]=function(_0x3ac864,_0x2f0440,_0x4bcb0d){var _0x44f73f={};var _0x398d26={};var _0x1c5091;var _0x3ba4a5;return db[_0x59ec('0x2c')][_0x59ec('0x4e')]({'where':{'id':_0x3ac864[_0x59ec('0x44')]['id']}})[_0x59ec('0x26')](handleEntityNotFound(_0x2f0440,null))[_0x59ec('0x26')](function(_0x223a8a){if(_0x223a8a){_0x1c5091=_0x223a8a;_0x398d26['model']=_[_0x59ec('0x45')](db['FreshsalesField'][_0x59ec('0x46')]);_0x398d26[_0x59ec('0x30')]=_['keys'](_0x3ac864['query']);_0x398d26['filters']=_[_0x59ec('0x33')](_0x398d26[_0x59ec('0x2f')],_0x398d26[_0x59ec('0x30')]);_0x44f73f['attributes']=_[_0x59ec('0x33')](_0x398d26[_0x59ec('0x2f')],qs[_0x59ec('0x34')](_0x3ac864['query'][_0x59ec('0x34')]));_0x44f73f[_0x59ec('0x32')]=_0x44f73f['attributes'][_0x59ec('0x35')]?_0x44f73f[_0x59ec('0x32')]:_0x398d26['model'];_0x44f73f['order']=qs['sort'](_0x3ac864[_0x59ec('0x30')][_0x59ec('0x38')]);_0x44f73f['where']=qs['filters'](_[_0x59ec('0x3a')](_0x3ac864[_0x59ec('0x30')],_0x398d26[_0x59ec('0x31')]));if(_0x3ac864[_0x59ec('0x30')][_0x59ec('0x3d')]){_0x44f73f[_0x59ec('0x39')]=_[_0x59ec('0x3b')](_0x44f73f[_0x59ec('0x39')],{'$or':_['map'](_0x44f73f[_0x59ec('0x32')],function(_0x3f1f3e){var _0xd30873={};_0xd30873[_0x3f1f3e]={'$like':'%'+_0x3ac864['query']['filter']+'%'};return _0xd30873;})});}_0x44f73f=_['merge']({},_0x44f73f,_0x3ac864[_0x59ec('0x3e')]);return _0x1c5091['getDescriptions'](_0x44f73f);}})[_0x59ec('0x26')](function(_0x2d1826){if(_0x2d1826){_0x3ba4a5=_0x2d1826[_0x59ec('0x35')];if(!_0x3ac864[_0x59ec('0x30')][_0x59ec('0x36')](_0x59ec('0x37'))){_0x44f73f[_0x59ec('0x21')]=qs[_0x59ec('0x21')](_0x3ac864[_0x59ec('0x30')][_0x59ec('0x21')]);_0x44f73f[_0x59ec('0x1f')]=qs[_0x59ec('0x1f')](_0x3ac864[_0x59ec('0x30')][_0x59ec('0x1f')]);}return _0x1c5091['getDescriptions'](_0x44f73f);}})[_0x59ec('0x26')](function(_0x24675e){if(_0x24675e){return _0x24675e?{'count':_0x3ba4a5,'rows':_0x24675e}:null;}})['then'](respondWithResult(_0x2f0440,null))[_0x59ec('0x42')](handleError(_0x2f0440,null));};exports['getFields']=function(_0x11a780,_0x32eb01,_0x3b3876){var _0x4c1db5={};var _0xcb9b39={};var _0x431df1;var _0x4b1116;return db[_0x59ec('0x2c')][_0x59ec('0x4e')]({'where':{'id':_0x11a780[_0x59ec('0x44')]['id']}})[_0x59ec('0x26')](handleEntityNotFound(_0x32eb01,null))[_0x59ec('0x26')](function(_0x6e6f3a){if(_0x6e6f3a){_0x431df1=_0x6e6f3a;_0xcb9b39[_0x59ec('0x2f')]=_[_0x59ec('0x45')](db[_0x59ec('0x4f')][_0x59ec('0x46')]);_0xcb9b39[_0x59ec('0x30')]=_['keys'](_0x11a780[_0x59ec('0x30')]);_0xcb9b39[_0x59ec('0x31')]=_[_0x59ec('0x33')](_0xcb9b39[_0x59ec('0x2f')],_0xcb9b39[_0x59ec('0x30')]);_0x4c1db5['attributes']=_[_0x59ec('0x33')](_0xcb9b39['model'],qs[_0x59ec('0x34')](_0x11a780[_0x59ec('0x30')]['fields']));_0x4c1db5[_0x59ec('0x32')]=_0x4c1db5[_0x59ec('0x32')]['length']?_0x4c1db5[_0x59ec('0x32')]:_0xcb9b39[_0x59ec('0x2f')];_0x4c1db5[_0x59ec('0x51')]=qs[_0x59ec('0x38')](_0x11a780[_0x59ec('0x30')][_0x59ec('0x38')]);_0x4c1db5[_0x59ec('0x39')]=qs[_0x59ec('0x31')](_['pick'](_0x11a780[_0x59ec('0x30')],_0xcb9b39[_0x59ec('0x31')]));if(_0x11a780[_0x59ec('0x30')][_0x59ec('0x3d')]){_0x4c1db5['where']=_[_0x59ec('0x3b')](_0x4c1db5[_0x59ec('0x39')],{'$or':_[_0x59ec('0x2b')](_0x4c1db5['attributes'],function(_0x2be936){var _0xab03bd={};_0xab03bd[_0x2be936]={'$like':'%'+_0x11a780[_0x59ec('0x30')][_0x59ec('0x3d')]+'%'};return _0xab03bd;})});}_0x4c1db5=_[_0x59ec('0x3b')]({},_0x4c1db5,_0x11a780['options']);return _0x431df1[_0x59ec('0x52')](_0x4c1db5);}})['then'](function(_0x1a9781){if(_0x1a9781){_0x4b1116=_0x1a9781[_0x59ec('0x35')];if(!_0x11a780[_0x59ec('0x30')][_0x59ec('0x36')](_0x59ec('0x37'))){_0x4c1db5[_0x59ec('0x21')]=qs[_0x59ec('0x21')](_0x11a780['query']['limit']);_0x4c1db5[_0x59ec('0x1f')]=qs[_0x59ec('0x1f')](_0x11a780[_0x59ec('0x30')]['offset']);}return _0x431df1[_0x59ec('0x52')](_0x4c1db5);}})[_0x59ec('0x26')](function(_0x875ce5){if(_0x875ce5){return _0x875ce5?{'count':_0x4b1116,'rows':_0x875ce5}:null;}})[_0x59ec('0x26')](respondWithResult(_0x32eb01,null))[_0x59ec('0x42')](handleError(_0x32eb01,null));}; \ No newline at end of file +var _0xb1d1=['then','error','stack','name','index','map','FreshsalesConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','getSubjects','findOne','FreshsalesField','order','options','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','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','json','offset','undefined','limit','count','Content-Range','apply','save','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb1d1,0x7c));var _0x1b1d=function(_0x2e3ed0,_0x3afa73){_0x2e3ed0=_0x2e3ed0-0x0;var _0x3cf00d=_0xb1d1[_0x2e3ed0];return _0x3cf00d;};'use strict';var emlformat=require(_0x1b1d('0x0'));var rimraf=require(_0x1b1d('0x1'));var zipdir=require(_0x1b1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b1d('0x3'));var moment=require(_0x1b1d('0x4'));var BPromise=require(_0x1b1d('0x5'));var Mustache=require(_0x1b1d('0x6'));var util=require('util');var path=require(_0x1b1d('0x7'));var sox=require(_0x1b1d('0x8'));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(_0x1b1d('0x9'));var crypto=require(_0x1b1d('0xa'));var jsforce=require(_0x1b1d('0xb'));var deskjs=require(_0x1b1d('0xc'));var toCsv=require(_0x1b1d('0xd'));var querystring=require(_0x1b1d('0xe'));var Papa=require(_0x1b1d('0xf'));var Redis=require(_0x1b1d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b1d('0x11'));var as=require(_0x1b1d('0x12'));var hardwareService=require(_0x1b1d('0x13'));var logger=require(_0x1b1d('0x14'))(_0x1b1d('0x15'));var utils=require(_0x1b1d('0x16'));var config=require(_0x1b1d('0x17'));var licenseUtil=require(_0x1b1d('0x18'));var db=require(_0x1b1d('0x19'))['db'];function respondWithStatusCode(_0x32490d,_0x126ced){_0x126ced=_0x126ced||0xcc;return function(_0x319ed4){if(_0x319ed4){return _0x32490d[_0x1b1d('0x1a')](_0x126ced);}return _0x32490d[_0x1b1d('0x1b')](_0x126ced)[_0x1b1d('0x1c')]();};}function respondWithResult(_0x16a253,_0x38caf4){_0x38caf4=_0x38caf4||0xc8;return function(_0x5e702b){if(_0x5e702b){return _0x16a253['status'](_0x38caf4)[_0x1b1d('0x1d')](_0x5e702b);}};}function respondWithFilteredResult(_0x10db38,_0x478434){return function(_0x563d5c){if(_0x563d5c){var _0x15dab=typeof _0x478434[_0x1b1d('0x1e')]===_0x1b1d('0x1f')&&typeof _0x478434[_0x1b1d('0x20')]===_0x1b1d('0x1f');var _0x369770=_0x563d5c['count'];var _0xc88311=_0x15dab?0x0:_0x478434[_0x1b1d('0x1e')];var _0x493691=_0x15dab?_0x563d5c[_0x1b1d('0x21')]:_0x478434[_0x1b1d('0x1e')]+_0x478434['limit'];var _0x4de107;if(_0x493691>=_0x369770){_0x493691=_0x369770;_0x4de107=0xc8;}else{_0x4de107=0xce;}_0x10db38[_0x1b1d('0x1b')](_0x4de107);return _0x10db38['set'](_0x1b1d('0x22'),_0xc88311+'-'+_0x493691+'/'+_0x369770)[_0x1b1d('0x1d')](_0x563d5c);}return null;};}function patchUpdates(_0x4f0997){return function(_0x40dd00){try{jsonpatch[_0x1b1d('0x23')](_0x40dd00,_0x4f0997,!![]);}catch(_0x244146){return BPromise['reject'](_0x244146);}return _0x40dd00[_0x1b1d('0x24')]();};}function saveUpdates(_0x53ae0b,_0x438547){return function(_0x589ff2){if(_0x589ff2){return _0x589ff2[_0x1b1d('0x25')](_0x53ae0b)['then'](function(_0xcb7f24){return _0xcb7f24;});}return null;};}function removeEntity(_0xc0cee5,_0x1557eb){return function(_0x470500){if(_0x470500){return _0x470500['destroy']()[_0x1b1d('0x26')](function(){_0xc0cee5[_0x1b1d('0x1b')](0xcc)[_0x1b1d('0x1c')]();});}};}function handleEntityNotFound(_0x3934da,_0x3f3145){return function(_0x164f19){if(!_0x164f19){_0x3934da['sendStatus'](0x194);}return _0x164f19;};}function handleError(_0x162e16,_0x141f97){_0x141f97=_0x141f97||0x1f4;return function(_0x2b2820){logger[_0x1b1d('0x27')](_0x2b2820[_0x1b1d('0x28')]);if(_0x2b2820['name']){delete _0x2b2820[_0x1b1d('0x29')];}_0x162e16[_0x1b1d('0x1b')](_0x141f97)['send'](_0x2b2820);};}exports[_0x1b1d('0x2a')]=function(_0x344d1f,_0x401552){var _0x232deb={},_0x58089c={},_0x2afff2={'count':0x0,'rows':[]};var _0xa1ac74=_[_0x1b1d('0x2b')](db[_0x1b1d('0x2c')]['rawAttributes'],function(_0x5e5a1d){return{'name':_0x5e5a1d['fieldName'],'type':_0x5e5a1d[_0x1b1d('0x2d')][_0x1b1d('0x2e')]};});_0x58089c[_0x1b1d('0x2f')]=_[_0x1b1d('0x2b')](_0xa1ac74,'name');_0x58089c[_0x1b1d('0x30')]=_[_0x1b1d('0x31')](_0x344d1f[_0x1b1d('0x30')]);_0x58089c[_0x1b1d('0x32')]=_[_0x1b1d('0x33')](_0x58089c[_0x1b1d('0x2f')],_0x58089c['query']);_0x232deb[_0x1b1d('0x34')]=_[_0x1b1d('0x33')](_0x58089c['model'],qs['fields'](_0x344d1f[_0x1b1d('0x30')][_0x1b1d('0x35')]));_0x232deb['attributes']=_0x232deb['attributes'][_0x1b1d('0x36')]?_0x232deb[_0x1b1d('0x34')]:_0x58089c[_0x1b1d('0x2f')];if(!_0x344d1f[_0x1b1d('0x30')][_0x1b1d('0x37')](_0x1b1d('0x38'))){_0x232deb[_0x1b1d('0x20')]=qs[_0x1b1d('0x20')](_0x344d1f['query'][_0x1b1d('0x20')]);_0x232deb['offset']=qs[_0x1b1d('0x1e')](_0x344d1f[_0x1b1d('0x30')][_0x1b1d('0x1e')]);}_0x232deb['order']=qs[_0x1b1d('0x39')](_0x344d1f[_0x1b1d('0x30')]['sort']);_0x232deb['where']=qs['filters'](_[_0x1b1d('0x3a')](_0x344d1f[_0x1b1d('0x30')],_0x58089c[_0x1b1d('0x32')]),_0xa1ac74);if(_0x344d1f[_0x1b1d('0x30')][_0x1b1d('0x3b')]){_0x232deb[_0x1b1d('0x3c')]=_['merge'](_0x232deb[_0x1b1d('0x3c')],{'$or':_[_0x1b1d('0x2b')](_0xa1ac74,function(_0x2d3f0c){if(_0x2d3f0c['type']!==_0x1b1d('0x3d')){var _0xeb4f2={};_0xeb4f2[_0x2d3f0c[_0x1b1d('0x29')]]={'$like':'%'+_0x344d1f[_0x1b1d('0x30')][_0x1b1d('0x3b')]+'%'};return _0xeb4f2;}})});}_0x232deb=_[_0x1b1d('0x3e')]({},_0x232deb,_0x344d1f['options']);var _0x5c4bce={'where':_0x232deb[_0x1b1d('0x3c')]};return db[_0x1b1d('0x2c')]['count'](_0x5c4bce)[_0x1b1d('0x26')](function(_0x4efa3d){_0x2afff2[_0x1b1d('0x21')]=_0x4efa3d;if(_0x344d1f[_0x1b1d('0x30')][_0x1b1d('0x3f')]){_0x232deb[_0x1b1d('0x40')]=[{'all':!![]}];}return db[_0x1b1d('0x2c')][_0x1b1d('0x41')](_0x232deb);})[_0x1b1d('0x26')](function(_0x303c5a){_0x2afff2[_0x1b1d('0x42')]=_0x303c5a;return _0x2afff2;})['then'](respondWithFilteredResult(_0x401552,_0x232deb))['catch'](handleError(_0x401552,null));};exports[_0x1b1d('0x43')]=function(_0x5c06b8,_0x4e443b){var _0x323fc3={'raw':![],'where':{'id':_0x5c06b8[_0x1b1d('0x44')]['id']}},_0x5bfa02={};_0x5bfa02[_0x1b1d('0x2f')]=_['keys'](db[_0x1b1d('0x2c')][_0x1b1d('0x45')]);_0x5bfa02[_0x1b1d('0x30')]=_[_0x1b1d('0x31')](_0x5c06b8[_0x1b1d('0x30')]);_0x5bfa02[_0x1b1d('0x32')]=_[_0x1b1d('0x33')](_0x5bfa02[_0x1b1d('0x2f')],_0x5bfa02[_0x1b1d('0x30')]);_0x323fc3[_0x1b1d('0x34')]=_['intersection'](_0x5bfa02[_0x1b1d('0x2f')],qs['fields'](_0x5c06b8[_0x1b1d('0x30')][_0x1b1d('0x35')]));_0x323fc3['attributes']=_0x323fc3['attributes'][_0x1b1d('0x36')]?_0x323fc3[_0x1b1d('0x34')]:_0x5bfa02['model'];if(_0x5c06b8[_0x1b1d('0x30')][_0x1b1d('0x3f')]){_0x323fc3[_0x1b1d('0x40')]=[{'all':!![]}];}_0x323fc3=_['merge']({},_0x323fc3,_0x5c06b8['options']);return db[_0x1b1d('0x2c')][_0x1b1d('0x46')](_0x323fc3)[_0x1b1d('0x26')](handleEntityNotFound(_0x4e443b,null))[_0x1b1d('0x26')](respondWithResult(_0x4e443b,null))[_0x1b1d('0x47')](handleError(_0x4e443b,null));};exports[_0x1b1d('0x48')]=function(_0x2ba5ef,_0x1af163){return db[_0x1b1d('0x2c')][_0x1b1d('0x48')](_0x2ba5ef[_0x1b1d('0x49')],{})[_0x1b1d('0x26')](respondWithResult(_0x1af163,0xc9))[_0x1b1d('0x47')](handleError(_0x1af163,null));};exports[_0x1b1d('0x25')]=function(_0x49b0df,_0x1f5296){if(_0x49b0df[_0x1b1d('0x49')]['id']){delete _0x49b0df['body']['id'];}return db[_0x1b1d('0x2c')][_0x1b1d('0x46')]({'where':{'id':_0x49b0df[_0x1b1d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5296,null))[_0x1b1d('0x26')](saveUpdates(_0x49b0df[_0x1b1d('0x49')],null))[_0x1b1d('0x26')](respondWithResult(_0x1f5296,null))[_0x1b1d('0x47')](handleError(_0x1f5296,null));};exports['destroy']=function(_0xe255bb,_0x1cfba0){return db[_0x1b1d('0x2c')][_0x1b1d('0x46')]({'where':{'id':_0xe255bb[_0x1b1d('0x44')]['id']}})[_0x1b1d('0x26')](handleEntityNotFound(_0x1cfba0,null))[_0x1b1d('0x26')](removeEntity(_0x1cfba0,null))['catch'](handleError(_0x1cfba0,null));};exports[_0x1b1d('0x4a')]=function(_0xf9b171,_0x4688bb,_0x2c3315){var _0x3d43aa={};var _0x5a2274={};var _0x358110;var _0x3c98b5;return db[_0x1b1d('0x2c')][_0x1b1d('0x4b')]({'where':{'id':_0xf9b171['params']['id']}})[_0x1b1d('0x26')](handleEntityNotFound(_0x4688bb,null))['then'](function(_0x11207d){if(_0x11207d){_0x358110=_0x11207d;_0x5a2274[_0x1b1d('0x2f')]=_[_0x1b1d('0x31')](db[_0x1b1d('0x4c')][_0x1b1d('0x45')]);_0x5a2274['query']=_[_0x1b1d('0x31')](_0xf9b171[_0x1b1d('0x30')]);_0x5a2274[_0x1b1d('0x32')]=_['intersection'](_0x5a2274[_0x1b1d('0x2f')],_0x5a2274[_0x1b1d('0x30')]);_0x3d43aa[_0x1b1d('0x34')]=_[_0x1b1d('0x33')](_0x5a2274[_0x1b1d('0x2f')],qs['fields'](_0xf9b171[_0x1b1d('0x30')]['fields']));_0x3d43aa[_0x1b1d('0x34')]=_0x3d43aa['attributes']['length']?_0x3d43aa[_0x1b1d('0x34')]:_0x5a2274[_0x1b1d('0x2f')];_0x3d43aa[_0x1b1d('0x4d')]=qs[_0x1b1d('0x39')](_0xf9b171[_0x1b1d('0x30')][_0x1b1d('0x39')]);_0x3d43aa['where']=qs[_0x1b1d('0x32')](_['pick'](_0xf9b171['query'],_0x5a2274[_0x1b1d('0x32')]));if(_0xf9b171[_0x1b1d('0x30')][_0x1b1d('0x3b')]){_0x3d43aa[_0x1b1d('0x3c')]=_[_0x1b1d('0x3e')](_0x3d43aa[_0x1b1d('0x3c')],{'$or':_['map'](_0x3d43aa[_0x1b1d('0x34')],function(_0x5f00f4){var _0x22256e={};_0x22256e[_0x5f00f4]={'$like':'%'+_0xf9b171['query'][_0x1b1d('0x3b')]+'%'};return _0x22256e;})});}_0x3d43aa=_[_0x1b1d('0x3e')]({},_0x3d43aa,_0xf9b171[_0x1b1d('0x4e')]);return _0x358110['getSubjects'](_0x3d43aa);}})[_0x1b1d('0x26')](function(_0x4c3344){if(_0x4c3344){_0x3c98b5=_0x4c3344[_0x1b1d('0x36')];if(!_0xf9b171[_0x1b1d('0x30')][_0x1b1d('0x37')](_0x1b1d('0x38'))){_0x3d43aa[_0x1b1d('0x20')]=qs[_0x1b1d('0x20')](_0xf9b171[_0x1b1d('0x30')][_0x1b1d('0x20')]);_0x3d43aa['offset']=qs[_0x1b1d('0x1e')](_0xf9b171['query'][_0x1b1d('0x1e')]);}return _0x358110[_0x1b1d('0x4a')](_0x3d43aa);}})['then'](function(_0x184d30){if(_0x184d30){return _0x184d30?{'count':_0x3c98b5,'rows':_0x184d30}:null;}})[_0x1b1d('0x26')](respondWithResult(_0x4688bb,null))[_0x1b1d('0x47')](handleError(_0x4688bb,null));};exports[_0x1b1d('0x4f')]=function(_0x160095,_0x4f6c86,_0x503868){var _0x50c327={};var _0x4dc064={};var _0x806e0f;var _0x311d4d;return db['FreshsalesConfiguration'][_0x1b1d('0x4b')]({'where':{'id':_0x160095[_0x1b1d('0x44')]['id']}})[_0x1b1d('0x26')](handleEntityNotFound(_0x4f6c86,null))[_0x1b1d('0x26')](function(_0x322858){if(_0x322858){_0x806e0f=_0x322858;_0x4dc064[_0x1b1d('0x2f')]=_['keys'](db[_0x1b1d('0x4c')][_0x1b1d('0x45')]);_0x4dc064[_0x1b1d('0x30')]=_['keys'](_0x160095['query']);_0x4dc064[_0x1b1d('0x32')]=_['intersection'](_0x4dc064['model'],_0x4dc064[_0x1b1d('0x30')]);_0x50c327[_0x1b1d('0x34')]=_['intersection'](_0x4dc064[_0x1b1d('0x2f')],qs['fields'](_0x160095[_0x1b1d('0x30')][_0x1b1d('0x35')]));_0x50c327['attributes']=_0x50c327[_0x1b1d('0x34')]['length']?_0x50c327[_0x1b1d('0x34')]:_0x4dc064['model'];_0x50c327[_0x1b1d('0x4d')]=qs[_0x1b1d('0x39')](_0x160095[_0x1b1d('0x30')][_0x1b1d('0x39')]);_0x50c327[_0x1b1d('0x3c')]=qs[_0x1b1d('0x32')](_[_0x1b1d('0x3a')](_0x160095[_0x1b1d('0x30')],_0x4dc064['filters']));if(_0x160095['query'][_0x1b1d('0x3b')]){_0x50c327['where']=_[_0x1b1d('0x3e')](_0x50c327[_0x1b1d('0x3c')],{'$or':_[_0x1b1d('0x2b')](_0x50c327['attributes'],function(_0x2bf726){var _0x42d744={};_0x42d744[_0x2bf726]={'$like':'%'+_0x160095['query']['filter']+'%'};return _0x42d744;})});}_0x50c327=_[_0x1b1d('0x3e')]({},_0x50c327,_0x160095['options']);return _0x806e0f[_0x1b1d('0x4f')](_0x50c327);}})[_0x1b1d('0x26')](function(_0x119f22){if(_0x119f22){_0x311d4d=_0x119f22['length'];if(!_0x160095[_0x1b1d('0x30')][_0x1b1d('0x37')](_0x1b1d('0x38'))){_0x50c327[_0x1b1d('0x20')]=qs[_0x1b1d('0x20')](_0x160095[_0x1b1d('0x30')][_0x1b1d('0x20')]);_0x50c327[_0x1b1d('0x1e')]=qs['offset'](_0x160095[_0x1b1d('0x30')]['offset']);}return _0x806e0f[_0x1b1d('0x4f')](_0x50c327);}})[_0x1b1d('0x26')](function(_0x7d516a){if(_0x7d516a){return _0x7d516a?{'count':_0x311d4d,'rows':_0x7d516a}:null;}})['then'](respondWithResult(_0x4f6c86,null))[_0x1b1d('0x47')](handleError(_0x4f6c86,null));};exports[_0x1b1d('0x50')]=function(_0x43261d,_0x474903,_0x43119d){var _0x3ba52e={};var _0x216e1d={};var _0x5b81f6;var _0x39a146;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x43261d[_0x1b1d('0x44')]['id']}})[_0x1b1d('0x26')](handleEntityNotFound(_0x474903,null))[_0x1b1d('0x26')](function(_0x1362a5){if(_0x1362a5){_0x5b81f6=_0x1362a5;_0x216e1d['model']=_[_0x1b1d('0x31')](db[_0x1b1d('0x4c')][_0x1b1d('0x45')]);_0x216e1d[_0x1b1d('0x30')]=_[_0x1b1d('0x31')](_0x43261d[_0x1b1d('0x30')]);_0x216e1d['filters']=_[_0x1b1d('0x33')](_0x216e1d['model'],_0x216e1d[_0x1b1d('0x30')]);_0x3ba52e[_0x1b1d('0x34')]=_[_0x1b1d('0x33')](_0x216e1d['model'],qs['fields'](_0x43261d[_0x1b1d('0x30')][_0x1b1d('0x35')]));_0x3ba52e[_0x1b1d('0x34')]=_0x3ba52e[_0x1b1d('0x34')]['length']?_0x3ba52e[_0x1b1d('0x34')]:_0x216e1d[_0x1b1d('0x2f')];_0x3ba52e[_0x1b1d('0x4d')]=qs['sort'](_0x43261d[_0x1b1d('0x30')]['sort']);_0x3ba52e[_0x1b1d('0x3c')]=qs[_0x1b1d('0x32')](_[_0x1b1d('0x3a')](_0x43261d['query'],_0x216e1d[_0x1b1d('0x32')]));if(_0x43261d[_0x1b1d('0x30')]['filter']){_0x3ba52e[_0x1b1d('0x3c')]=_[_0x1b1d('0x3e')](_0x3ba52e['where'],{'$or':_['map'](_0x3ba52e[_0x1b1d('0x34')],function(_0x44c897){var _0x267590={};_0x267590[_0x44c897]={'$like':'%'+_0x43261d['query'][_0x1b1d('0x3b')]+'%'};return _0x267590;})});}_0x3ba52e=_[_0x1b1d('0x3e')]({},_0x3ba52e,_0x43261d[_0x1b1d('0x4e')]);return _0x5b81f6[_0x1b1d('0x50')](_0x3ba52e);}})[_0x1b1d('0x26')](function(_0x1b2994){if(_0x1b2994){_0x39a146=_0x1b2994[_0x1b1d('0x36')];if(!_0x43261d[_0x1b1d('0x30')]['hasOwnProperty'](_0x1b1d('0x38'))){_0x3ba52e[_0x1b1d('0x20')]=qs[_0x1b1d('0x20')](_0x43261d[_0x1b1d('0x30')][_0x1b1d('0x20')]);_0x3ba52e[_0x1b1d('0x1e')]=qs[_0x1b1d('0x1e')](_0x43261d[_0x1b1d('0x30')]['offset']);}return _0x5b81f6[_0x1b1d('0x50')](_0x3ba52e);}})[_0x1b1d('0x26')](function(_0x370e50){if(_0x370e50){return _0x370e50?{'count':_0x39a146,'rows':_0x370e50}:null;}})['then'](respondWithResult(_0x474903,null))[_0x1b1d('0x47')](handleError(_0x474903,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index eec0929..48fbd1e 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 _0x3b74=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x5b9398,_0x4e5e78){var _0x54ccab=function(_0x4bb7df){while(--_0x4bb7df){_0x5b9398['push'](_0x5b9398['shift']());}};_0x54ccab(++_0x4e5e78);}(_0x3b74,0x138));var _0x43b7=function(_0x5d0430,_0x15cc32){_0x5d0430=_0x5d0430-0x0;var _0x4d964c=_0x3b74[_0x5d0430];return _0x4d964c;};'use strict';var _=require('lodash');var util=require(_0x43b7('0x0'));var logger=require(_0x43b7('0x1'))('api');var moment=require(_0x43b7('0x2'));var BPromise=require(_0x43b7('0x3'));var rp=require(_0x43b7('0x4'));var fs=require('fs');var path=require(_0x43b7('0x5'));var rimraf=require(_0x43b7('0x6'));var config=require(_0x43b7('0x7'));var attributes=require(_0x43b7('0x8'));module[_0x43b7('0x9')]=function(_0x76b612,_0x586c5c){return _0x76b612[_0x43b7('0xa')](_0x43b7('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa777=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x408fe6,_0x4c3df4){var _0x3a0249=function(_0x5db140){while(--_0x5db140){_0x408fe6['push'](_0x408fe6['shift']());}};_0x3a0249(++_0x4c3df4);}(_0xa777,0xa0));var _0x7a77=function(_0x359e62,_0x410353){_0x359e62=_0x359e62-0x0;var _0x1d7358=_0xa777[_0x359e62];return _0x1d7358;};'use strict';var _=require(_0x7a77('0x0'));var util=require('util');var logger=require(_0x7a77('0x1'))('api');var moment=require(_0x7a77('0x2'));var BPromise=require(_0x7a77('0x3'));var rp=require(_0x7a77('0x4'));var fs=require('fs');var path=require(_0x7a77('0x5'));var rimraf=require(_0x7a77('0x6'));var config=require(_0x7a77('0x7'));var attributes=require(_0x7a77('0x8'));module[_0x7a77('0x9')]=function(_0x5841a3,_0x4cf62a){return _0x5841a3[_0x7a77('0xa')](_0x7a77('0xb'),attributes,{'tableName':_0x7a77('0xc'),'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 e0727b7..8829175 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 _0xf38f=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x4f66ef,_0x3d47ef){var _0x34c6ec=function(_0x449aaf){while(--_0x449aaf){_0x4f66ef['push'](_0x4f66ef['shift']());}};_0x34c6ec(++_0x3d47ef);}(_0xf38f,0x160));var _0xff38=function(_0x30b94a,_0xfb8634){_0x30b94a=_0x30b94a-0x0;var _0x291adc=_0xf38f[_0x30b94a];return _0x291adc;};'use strict';var _=require(_0xff38('0x0'));var util=require(_0xff38('0x1'));var moment=require(_0xff38('0x2'));var BPromise=require(_0xff38('0x3'));var rs=require(_0xff38('0x4'));var fs=require('fs');var Redis=require(_0xff38('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xff38('0x6'));var logger=require(_0xff38('0x7'))('rpc');var config=require(_0xff38('0x8'));var jayson=require(_0xff38('0x9'));var client=jayson[_0xff38('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x288c25,_0x25fcab,_0x4d0ba5){return new BPromise(function(_0x1a74aa,_0x5a83da){return client['request'](_0x288c25,_0x4d0ba5)[_0xff38('0xb')](function(_0x53f06a){logger[_0xff38('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25fcab,'request\x20sent');logger[_0xff38('0xd')](_0xff38('0xe'),_0x25fcab,_0xff38('0xf'),JSON[_0xff38('0x10')](_0x53f06a));if(_0x53f06a[_0xff38('0x11')]){if(_0x53f06a[_0xff38('0x11')][_0xff38('0x12')]===0x1f4){logger[_0xff38('0x11')](_0xff38('0x13'),_0x25fcab,_0x53f06a[_0xff38('0x11')][_0xff38('0x14')]);return _0x5a83da(_0x53f06a[_0xff38('0x11')]['message']);}logger[_0xff38('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25fcab,_0x53f06a['error']['message']);return _0x1a74aa(_0x53f06a[_0xff38('0x11')][_0xff38('0x14')]);}else{logger[_0xff38('0xc')](_0xff38('0x13'),_0x25fcab,_0xff38('0xf'));_0x1a74aa(_0x53f06a['result']['message']);}})[_0xff38('0x15')](function(_0x2b5c01){logger[_0xff38('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25fcab,_0x2b5c01);_0x5a83da(_0x2b5c01);});});} \ No newline at end of file +var _0x91cd=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x37cfd3,_0xb94488){var _0x159f9a=function(_0x2540b3){while(--_0x2540b3){_0x37cfd3['push'](_0x37cfd3['shift']());}};_0x159f9a(++_0xb94488);}(_0x91cd,0x8e));var _0xd91c=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x91cd[_0x297eea];return _0x1c42d2;};'use strict';var _=require(_0xd91c('0x0'));var util=require(_0xd91c('0x1'));var moment=require('moment');var BPromise=require(_0xd91c('0x2'));var rs=require(_0xd91c('0x3'));var fs=require('fs');var Redis=require(_0xd91c('0x4'));var db=require(_0xd91c('0x5'))['db'];var utils=require(_0xd91c('0x6'));var logger=require(_0xd91c('0x7'))('rpc');var config=require(_0xd91c('0x8'));var jayson=require(_0xd91c('0x9'));var client=jayson[_0xd91c('0xa')][_0xd91c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1afabe,_0x652f33,_0x348a0f){return new BPromise(function(_0x13c8d0,_0xff4d47){return client[_0xd91c('0xc')](_0x1afabe,_0x348a0f)['then'](function(_0x40d413){logger[_0xd91c('0xd')](_0xd91c('0xe'),_0x652f33,_0xd91c('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x652f33,_0xd91c('0xf'),JSON[_0xd91c('0x10')](_0x40d413));if(_0x40d413[_0xd91c('0x11')]){if(_0x40d413['error'][_0xd91c('0x12')]===0x1f4){logger[_0xd91c('0x11')](_0xd91c('0xe'),_0x652f33,_0x40d413['error'][_0xd91c('0x13')]);return _0xff4d47(_0x40d413[_0xd91c('0x11')][_0xd91c('0x13')]);}logger[_0xd91c('0x11')](_0xd91c('0xe'),_0x652f33,_0x40d413['error'][_0xd91c('0x13')]);return _0x13c8d0(_0x40d413[_0xd91c('0x11')][_0xd91c('0x13')]);}else{logger['info'](_0xd91c('0xe'),_0x652f33,'request\x20sent');_0x13c8d0(_0x40d413['result'][_0xd91c('0x13')]);}})[_0xd91c('0x14')](function(_0x26d104){logger['error'](_0xd91c('0xe'),_0x652f33,_0x26d104);_0xff4d47(_0x26d104);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 4085998..51be8c6 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 _0x4c4e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','update','delete','exports','multer','path'];(function(_0x51dd49,_0xe26ef2){var _0x4e35e6=function(_0x5bad00){while(--_0x5bad00){_0x51dd49['push'](_0x51dd49['shift']());}};_0x4e35e6(++_0xe26ef2);}(_0x4c4e,0x152));var _0xe4c4=function(_0x43621f,_0x538af8){_0x43621f=_0x43621f-0x0;var _0x2605ce=_0x4c4e[_0x43621f];return _0x2605ce;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xd')]('/',auth[_0xe4c4('0x8')](),controller['create']);router['put'](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xe')]);router[_0xe4c4('0xf')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller['destroy']);module[_0xe4c4('0x10')]=router; \ No newline at end of file +var _0x6ae0=['./intFreshsalesField.controller','get','index','/:id','isAuthenticated','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x156fb4,_0x511a6e){var _0x597921=function(_0x3a8dcb){while(--_0x3a8dcb){_0x156fb4['push'](_0x156fb4['shift']());}};_0x597921(++_0x511a6e);}(_0x6ae0,0x192));var _0x06ae=function(_0x4ee702,_0x2e01c8){_0x4ee702=_0x4ee702-0x0;var _0x1df171=_0x6ae0[_0x4ee702];return _0x1df171;};'use strict';var multer=require(_0x06ae('0x0'));var util=require(_0x06ae('0x1'));var path=require(_0x06ae('0x2'));var timeout=require(_0x06ae('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x06ae('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x06ae('0x5'));var config=require('../../config/environment');var controller=require(_0x06ae('0x6'));router[_0x06ae('0x7')]('/',auth['isAuthenticated'](),controller[_0x06ae('0x8')]);router['get'](_0x06ae('0x9'),auth[_0x06ae('0xa')](),controller['show']);router[_0x06ae('0xb')]('/',auth[_0x06ae('0xa')](),controller[_0x06ae('0xc')]);router[_0x06ae('0xd')](_0x06ae('0x9'),auth[_0x06ae('0xa')](),controller[_0x06ae('0xe')]);router['delete'](_0x06ae('0x9'),auth[_0x06ae('0xa')](),controller[_0x06ae('0xf')]);module[_0x06ae('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index b83b213..7a226ea 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 _0xff43=['exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable'];(function(_0x3f9d3f,_0x1de93e){var _0x191d89=function(_0x52b18d){while(--_0x52b18d){_0x3f9d3f['push'](_0x3f9d3f['shift']());}};_0x191d89(++_0x1de93e);}(_0xff43,0xd8));var _0x3ff4=function(_0x5b84e2,_0x526b7f){_0x5b84e2=_0x5b84e2-0x0;var _0x16e869=_0xff43[_0x5b84e2];return _0x16e869;};'use strict';var Sequelize=require('sequelize');module[_0x3ff4('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3ff4('0x1'),'variable',_0x3ff4('0x2'),_0x3ff4('0x3'),_0x3ff4('0x4')),'defaultValue':_0x3ff4('0x1')},'content':{'type':Sequelize[_0x3ff4('0x5')]},'key':{'type':Sequelize[_0x3ff4('0x5')]},'keyType':{'type':Sequelize[_0x3ff4('0x6')](_0x3ff4('0x1'),_0x3ff4('0x7'),_0x3ff4('0x2'))},'keyContent':{'type':Sequelize[_0x3ff4('0x5')]},'idField':{'type':Sequelize[_0x3ff4('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40c2=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0xe2466d,_0x41f5f0){var _0xa38f84=function(_0x4408fc){while(--_0x4408fc){_0xe2466d['push'](_0xe2466d['shift']());}};_0xa38f84(++_0x41f5f0);}(_0x40c2,0x123));var _0x240c=function(_0x55e693,_0x22b0cd){_0x55e693=_0x55e693-0x0;var _0x253c44=_0x40c2[_0x55e693];return _0x253c44;};'use strict';var Sequelize=require(_0x240c('0x0'));module[_0x240c('0x1')]={'type':{'type':Sequelize[_0x240c('0x2')](_0x240c('0x3'),'variable',_0x240c('0x4'),_0x240c('0x5'),'picklist'),'defaultValue':_0x240c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x240c('0x6')]},'keyType':{'type':Sequelize[_0x240c('0x2')](_0x240c('0x3'),_0x240c('0x7'),_0x240c('0x4'))},'keyContent':{'type':Sequelize[_0x240c('0x6')]},'idField':{'type':Sequelize[_0x240c('0x6')]},'nameField':{'type':Sequelize[_0x240c('0x6')]},'customField':{'type':Sequelize[_0x240c('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 eaee816..ca72cfe 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 _0x139f=['rows','catch','show','params','FreshsalesField','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll'];(function(_0x5342ea,_0xf7411a){var _0x1ba6ee=function(_0x50e220){while(--_0x50e220){_0x5342ea['push'](_0x5342ea['shift']());}};_0x1ba6ee(++_0xf7411a);}(_0x139f,0xa6));var _0xf139=function(_0x598517,_0x393dea){_0x598517=_0x598517-0x0;var _0x251990=_0x139f[_0x598517];return _0x251990;};'use strict';var emlformat=require(_0xf139('0x0'));var rimraf=require(_0xf139('0x1'));var zipdir=require(_0xf139('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf139('0x3'));var moment=require(_0xf139('0x4'));var BPromise=require(_0xf139('0x5'));var Mustache=require(_0xf139('0x6'));var util=require(_0xf139('0x7'));var path=require(_0xf139('0x8'));var sox=require('sox');var csv=require(_0xf139('0x9'));var ejs=require(_0xf139('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf139('0xb'));var crypto=require(_0xf139('0xc'));var jsforce=require(_0xf139('0xd'));var deskjs=require(_0xf139('0xe'));var toCsv=require(_0xf139('0x9'));var querystring=require(_0xf139('0xf'));var Papa=require(_0xf139('0x10'));var Redis=require(_0xf139('0x11'));var authService=require(_0xf139('0x12'));var qs=require(_0xf139('0x13'));var as=require(_0xf139('0x14'));var hardwareService=require(_0xf139('0x15'));var logger=require(_0xf139('0x16'))(_0xf139('0x17'));var utils=require(_0xf139('0x18'));var config=require(_0xf139('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x69d3a,_0x450d63){_0x450d63=_0x450d63||0xcc;return function(_0x4e2d1a){if(_0x4e2d1a){return _0x69d3a[_0xf139('0x1a')](_0x450d63);}return _0x69d3a[_0xf139('0x1b')](_0x450d63)[_0xf139('0x1c')]();};}function respondWithResult(_0x32f052,_0x3e6f74){_0x3e6f74=_0x3e6f74||0xc8;return function(_0x45b065){if(_0x45b065){return _0x32f052[_0xf139('0x1b')](_0x3e6f74)[_0xf139('0x1d')](_0x45b065);}};}function respondWithFilteredResult(_0x114f82,_0x284af4){return function(_0x355dc7){if(_0x355dc7){var _0x482136=typeof _0x284af4[_0xf139('0x1e')]===_0xf139('0x1f')&&typeof _0x284af4[_0xf139('0x20')]===_0xf139('0x1f');var _0x1b28b6=_0x355dc7[_0xf139('0x21')];var _0x270ed0=_0x482136?0x0:_0x284af4[_0xf139('0x1e')];var _0x2298d8=_0x482136?_0x355dc7[_0xf139('0x21')]:_0x284af4['offset']+_0x284af4[_0xf139('0x20')];var _0x289e51;if(_0x2298d8>=_0x1b28b6){_0x2298d8=_0x1b28b6;_0x289e51=0xc8;}else{_0x289e51=0xce;}_0x114f82['status'](_0x289e51);return _0x114f82[_0xf139('0x22')]('Content-Range',_0x270ed0+'-'+_0x2298d8+'/'+_0x1b28b6)[_0xf139('0x1d')](_0x355dc7);}return null;};}function patchUpdates(_0x816369){return function(_0x25214c){try{jsonpatch[_0xf139('0x23')](_0x25214c,_0x816369,!![]);}catch(_0x6374cc){return BPromise[_0xf139('0x24')](_0x6374cc);}return _0x25214c[_0xf139('0x25')]();};}function saveUpdates(_0x1a50bd,_0x2e349b){return function(_0x28f6f9){if(_0x28f6f9){return _0x28f6f9[_0xf139('0x26')](_0x1a50bd)['then'](function(_0x31c4a2){return _0x31c4a2;});}return null;};}function removeEntity(_0x22e90d,_0x22c680){return function(_0x58c277){if(_0x58c277){return _0x58c277['destroy']()[_0xf139('0x27')](function(){_0x22e90d[_0xf139('0x1b')](0xcc)[_0xf139('0x1c')]();});}};}function handleEntityNotFound(_0x3c3b07,_0x21d8ed){return function(_0x355f97){if(!_0x355f97){_0x3c3b07['sendStatus'](0x194);}return _0x355f97;};}function handleError(_0x1a9217,_0x54350d){_0x54350d=_0x54350d||0x1f4;return function(_0x1a4eeb){logger[_0xf139('0x28')](_0x1a4eeb[_0xf139('0x29')]);if(_0x1a4eeb[_0xf139('0x2a')]){delete _0x1a4eeb[_0xf139('0x2a')];}_0x1a9217[_0xf139('0x1b')](_0x54350d)['send'](_0x1a4eeb);};}exports[_0xf139('0x2b')]=function(_0x4b2d78,_0x4317c5){var _0x17732f={},_0x2f20ee={},_0x45c1a2={'count':0x0,'rows':[]};var _0x19fad0=_[_0xf139('0x2c')](db['FreshsalesField'][_0xf139('0x2d')],function(_0x42fabb){return{'name':_0x42fabb[_0xf139('0x2e')],'type':_0x42fabb[_0xf139('0x2f')]['key']};});_0x2f20ee['model']=_[_0xf139('0x2c')](_0x19fad0,_0xf139('0x2a'));_0x2f20ee['query']=_[_0xf139('0x30')](_0x4b2d78[_0xf139('0x31')]);_0x2f20ee['filters']=_['intersection'](_0x2f20ee[_0xf139('0x32')],_0x2f20ee[_0xf139('0x31')]);_0x17732f[_0xf139('0x33')]=_[_0xf139('0x34')](_0x2f20ee['model'],qs[_0xf139('0x35')](_0x4b2d78[_0xf139('0x31')][_0xf139('0x35')]));_0x17732f[_0xf139('0x33')]=_0x17732f[_0xf139('0x33')][_0xf139('0x36')]?_0x17732f[_0xf139('0x33')]:_0x2f20ee[_0xf139('0x32')];if(!_0x4b2d78[_0xf139('0x31')][_0xf139('0x37')](_0xf139('0x38'))){_0x17732f[_0xf139('0x20')]=qs['limit'](_0x4b2d78['query'][_0xf139('0x20')]);_0x17732f[_0xf139('0x1e')]=qs[_0xf139('0x1e')](_0x4b2d78[_0xf139('0x31')][_0xf139('0x1e')]);}_0x17732f[_0xf139('0x39')]=qs[_0xf139('0x3a')](_0x4b2d78[_0xf139('0x31')]['sort']);_0x17732f['where']=qs[_0xf139('0x3b')](_[_0xf139('0x3c')](_0x4b2d78[_0xf139('0x31')],_0x2f20ee[_0xf139('0x3b')]),_0x19fad0);if(_0x4b2d78[_0xf139('0x31')][_0xf139('0x3d')]){_0x17732f[_0xf139('0x3e')]=_['merge'](_0x17732f[_0xf139('0x3e')],{'$or':_['map'](_0x19fad0,function(_0x414138){if(_0x414138[_0xf139('0x2f')]!==_0xf139('0x3f')){var _0x4158f9={};_0x4158f9[_0x414138[_0xf139('0x2a')]]={'$like':'%'+_0x4b2d78[_0xf139('0x31')][_0xf139('0x3d')]+'%'};return _0x4158f9;}})});}_0x17732f=_[_0xf139('0x40')]({},_0x17732f,_0x4b2d78['options']);var _0x4d5230={'where':_0x17732f[_0xf139('0x3e')]};return db['FreshsalesField'][_0xf139('0x21')](_0x4d5230)[_0xf139('0x27')](function(_0x4421b8){_0x45c1a2['count']=_0x4421b8;if(_0x4b2d78[_0xf139('0x31')][_0xf139('0x41')]){_0x17732f[_0xf139('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0xf139('0x43')](_0x17732f);})[_0xf139('0x27')](function(_0x3fdc8b){_0x45c1a2[_0xf139('0x44')]=_0x3fdc8b;return _0x45c1a2;})[_0xf139('0x27')](respondWithFilteredResult(_0x4317c5,_0x17732f))[_0xf139('0x45')](handleError(_0x4317c5,null));};exports[_0xf139('0x46')]=function(_0xbb53cf,_0x3a5677){var _0x20ba2d={'raw':!![],'where':{'id':_0xbb53cf[_0xf139('0x47')]['id']}},_0x26fde7={};_0x26fde7['model']=_[_0xf139('0x30')](db[_0xf139('0x48')][_0xf139('0x2d')]);_0x26fde7['query']=_['keys'](_0xbb53cf[_0xf139('0x31')]);_0x26fde7[_0xf139('0x3b')]=_['intersection'](_0x26fde7[_0xf139('0x32')],_0x26fde7['query']);_0x20ba2d[_0xf139('0x33')]=_[_0xf139('0x34')](_0x26fde7[_0xf139('0x32')],qs[_0xf139('0x35')](_0xbb53cf[_0xf139('0x31')][_0xf139('0x35')]));_0x20ba2d['attributes']=_0x20ba2d[_0xf139('0x33')][_0xf139('0x36')]?_0x20ba2d['attributes']:_0x26fde7[_0xf139('0x32')];if(_0xbb53cf[_0xf139('0x31')][_0xf139('0x41')]){_0x20ba2d[_0xf139('0x42')]=[{'all':!![]}];}_0x20ba2d=_[_0xf139('0x40')]({},_0x20ba2d,_0xbb53cf[_0xf139('0x49')]);return db[_0xf139('0x48')][_0xf139('0x4a')](_0x20ba2d)['then'](handleEntityNotFound(_0x3a5677,null))[_0xf139('0x27')](respondWithResult(_0x3a5677,null))[_0xf139('0x45')](handleError(_0x3a5677,null));};exports[_0xf139('0x4b')]=function(_0x25bd2c,_0x532a61){return db[_0xf139('0x48')][_0xf139('0x4b')](_0x25bd2c[_0xf139('0x4c')],{})[_0xf139('0x27')](respondWithResult(_0x532a61,0xc9))[_0xf139('0x45')](handleError(_0x532a61,null));};exports[_0xf139('0x26')]=function(_0x41ab05,_0x5d2c71){if(_0x41ab05[_0xf139('0x4c')]['id']){delete _0x41ab05[_0xf139('0x4c')]['id'];}return db[_0xf139('0x48')][_0xf139('0x4a')]({'where':{'id':_0x41ab05[_0xf139('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d2c71,null))[_0xf139('0x27')](saveUpdates(_0x41ab05[_0xf139('0x4c')],null))[_0xf139('0x27')](respondWithResult(_0x5d2c71,null))['catch'](handleError(_0x5d2c71,null));};exports[_0xf139('0x4d')]=function(_0x8fd6d3,_0x8d8b81){return db[_0xf139('0x48')][_0xf139('0x4a')]({'where':{'id':_0x8fd6d3['params']['id']}})[_0xf139('0x27')](handleEntityNotFound(_0x8d8b81,null))[_0xf139('0x27')](removeEntity(_0x8d8b81,null))[_0xf139('0x45')](handleError(_0x8d8b81,null));}; \ No newline at end of file +var _0x3c84=['params','keys','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','map','FreshsalesField','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','sort','pick','merge','where','VIRTUAL','filter','options','then','includeAll','rows','catch','show'];(function(_0x2886d1,_0x2d4364){var _0x3c20e4=function(_0x537bdf){while(--_0x537bdf){_0x2886d1['push'](_0x2886d1['shift']());}};_0x3c20e4(++_0x2d4364);}(_0x3c84,0x12b));var _0x43c8=function(_0x9d81a1,_0x16ae1c){_0x9d81a1=_0x9d81a1-0x0;var _0x39bd1d=_0x3c84[_0x9d81a1];return _0x39bd1d;};'use strict';var emlformat=require(_0x43c8('0x0'));var rimraf=require(_0x43c8('0x1'));var zipdir=require(_0x43c8('0x2'));var jsonpatch=require(_0x43c8('0x3'));var rp=require(_0x43c8('0x4'));var moment=require(_0x43c8('0x5'));var BPromise=require(_0x43c8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x43c8('0x7'));var sox=require(_0x43c8('0x8'));var csv=require(_0x43c8('0x9'));var ejs=require(_0x43c8('0xa'));var fs=require('fs');var fs_extra=require(_0x43c8('0xb'));var _=require(_0x43c8('0xc'));var squel=require('squel');var crypto=require(_0x43c8('0xd'));var jsforce=require(_0x43c8('0xe'));var deskjs=require(_0x43c8('0xf'));var toCsv=require(_0x43c8('0x9'));var querystring=require(_0x43c8('0x10'));var Papa=require(_0x43c8('0x11'));var Redis=require('ioredis');var authService=require(_0x43c8('0x12'));var qs=require(_0x43c8('0x13'));var as=require(_0x43c8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43c8('0x15'))(_0x43c8('0x16'));var utils=require(_0x43c8('0x17'));var config=require(_0x43c8('0x18'));var licenseUtil=require(_0x43c8('0x19'));var db=require(_0x43c8('0x1a'))['db'];function respondWithStatusCode(_0x18e2ce,_0x3893c9){_0x3893c9=_0x3893c9||0xcc;return function(_0x55cbbe){if(_0x55cbbe){return _0x18e2ce['sendStatus'](_0x3893c9);}return _0x18e2ce[_0x43c8('0x1b')](_0x3893c9)['end']();};}function respondWithResult(_0x2875d2,_0x2778e1){_0x2778e1=_0x2778e1||0xc8;return function(_0x882de2){if(_0x882de2){return _0x2875d2['status'](_0x2778e1)[_0x43c8('0x1c')](_0x882de2);}};}function respondWithFilteredResult(_0x45248f,_0x3bf13b){return function(_0xb80754){if(_0xb80754){var _0x5f376b=typeof _0x3bf13b[_0x43c8('0x1d')]==='undefined'&&typeof _0x3bf13b[_0x43c8('0x1e')]==='undefined';var _0x2d7ec3=_0xb80754[_0x43c8('0x1f')];var _0x5257a5=_0x5f376b?0x0:_0x3bf13b[_0x43c8('0x1d')];var _0xadb48e=_0x5f376b?_0xb80754[_0x43c8('0x1f')]:_0x3bf13b[_0x43c8('0x1d')]+_0x3bf13b['limit'];var _0x567940;if(_0xadb48e>=_0x2d7ec3){_0xadb48e=_0x2d7ec3;_0x567940=0xc8;}else{_0x567940=0xce;}_0x45248f[_0x43c8('0x1b')](_0x567940);return _0x45248f[_0x43c8('0x20')](_0x43c8('0x21'),_0x5257a5+'-'+_0xadb48e+'/'+_0x2d7ec3)[_0x43c8('0x1c')](_0xb80754);}return null;};}function patchUpdates(_0x2573c8){return function(_0x43e9d3){try{jsonpatch[_0x43c8('0x22')](_0x43e9d3,_0x2573c8,!![]);}catch(_0x5ea579){return BPromise[_0x43c8('0x23')](_0x5ea579);}return _0x43e9d3['save']();};}function saveUpdates(_0x42446d,_0xff9cc7){return function(_0x32dd9a){if(_0x32dd9a){return _0x32dd9a[_0x43c8('0x24')](_0x42446d)['then'](function(_0x4f8f77){return _0x4f8f77;});}return null;};}function removeEntity(_0x27d37d,_0x2e38cb){return function(_0xc63c8e){if(_0xc63c8e){return _0xc63c8e[_0x43c8('0x25')]()['then'](function(){_0x27d37d['status'](0xcc)[_0x43c8('0x26')]();});}};}function handleEntityNotFound(_0x461a59,_0x1f802){return function(_0x320958){if(!_0x320958){_0x461a59[_0x43c8('0x27')](0x194);}return _0x320958;};}function handleError(_0x3beb41,_0x445f46){_0x445f46=_0x445f46||0x1f4;return function(_0x1ba719){logger['error'](_0x1ba719[_0x43c8('0x28')]);if(_0x1ba719[_0x43c8('0x29')]){delete _0x1ba719[_0x43c8('0x29')];}_0x3beb41[_0x43c8('0x1b')](_0x445f46)['send'](_0x1ba719);};}exports['index']=function(_0x358f51,_0x26dd88){var _0x23580f={},_0x5bedce={},_0x4810a2={'count':0x0,'rows':[]};var _0x25f5e1=_[_0x43c8('0x2a')](db[_0x43c8('0x2b')][_0x43c8('0x2c')],function(_0x12a15a){return{'name':_0x12a15a['fieldName'],'type':_0x12a15a[_0x43c8('0x2d')][_0x43c8('0x2e')]};});_0x5bedce[_0x43c8('0x2f')]=_[_0x43c8('0x2a')](_0x25f5e1,'name');_0x5bedce[_0x43c8('0x30')]=_['keys'](_0x358f51[_0x43c8('0x30')]);_0x5bedce[_0x43c8('0x31')]=_['intersection'](_0x5bedce[_0x43c8('0x2f')],_0x5bedce['query']);_0x23580f[_0x43c8('0x32')]=_['intersection'](_0x5bedce[_0x43c8('0x2f')],qs[_0x43c8('0x33')](_0x358f51[_0x43c8('0x30')][_0x43c8('0x33')]));_0x23580f[_0x43c8('0x32')]=_0x23580f[_0x43c8('0x32')][_0x43c8('0x34')]?_0x23580f[_0x43c8('0x32')]:_0x5bedce[_0x43c8('0x2f')];if(!_0x358f51['query'][_0x43c8('0x35')]('nolimit')){_0x23580f['limit']=qs[_0x43c8('0x1e')](_0x358f51[_0x43c8('0x30')][_0x43c8('0x1e')]);_0x23580f[_0x43c8('0x1d')]=qs[_0x43c8('0x1d')](_0x358f51[_0x43c8('0x30')]['offset']);}_0x23580f['order']=qs['sort'](_0x358f51[_0x43c8('0x30')][_0x43c8('0x36')]);_0x23580f['where']=qs[_0x43c8('0x31')](_[_0x43c8('0x37')](_0x358f51['query'],_0x5bedce['filters']),_0x25f5e1);if(_0x358f51[_0x43c8('0x30')]['filter']){_0x23580f['where']=_[_0x43c8('0x38')](_0x23580f[_0x43c8('0x39')],{'$or':_[_0x43c8('0x2a')](_0x25f5e1,function(_0x1c03e7){if(_0x1c03e7[_0x43c8('0x2d')]!==_0x43c8('0x3a')){var _0x30f354={};_0x30f354[_0x1c03e7[_0x43c8('0x29')]]={'$like':'%'+_0x358f51[_0x43c8('0x30')][_0x43c8('0x3b')]+'%'};return _0x30f354;}})});}_0x23580f=_[_0x43c8('0x38')]({},_0x23580f,_0x358f51[_0x43c8('0x3c')]);var _0x19df3b={'where':_0x23580f[_0x43c8('0x39')]};return db[_0x43c8('0x2b')][_0x43c8('0x1f')](_0x19df3b)[_0x43c8('0x3d')](function(_0x53bcb5){_0x4810a2[_0x43c8('0x1f')]=_0x53bcb5;if(_0x358f51[_0x43c8('0x30')][_0x43c8('0x3e')]){_0x23580f['include']=[{'all':!![]}];}return db[_0x43c8('0x2b')]['findAll'](_0x23580f);})[_0x43c8('0x3d')](function(_0x385d8b){_0x4810a2[_0x43c8('0x3f')]=_0x385d8b;return _0x4810a2;})[_0x43c8('0x3d')](respondWithFilteredResult(_0x26dd88,_0x23580f))[_0x43c8('0x40')](handleError(_0x26dd88,null));};exports[_0x43c8('0x41')]=function(_0x442b00,_0x126539){var _0x3954a3={'raw':!![],'where':{'id':_0x442b00[_0x43c8('0x42')]['id']}},_0x5692ed={};_0x5692ed[_0x43c8('0x2f')]=_[_0x43c8('0x43')](db['FreshsalesField'][_0x43c8('0x2c')]);_0x5692ed[_0x43c8('0x30')]=_['keys'](_0x442b00['query']);_0x5692ed[_0x43c8('0x31')]=_[_0x43c8('0x44')](_0x5692ed[_0x43c8('0x2f')],_0x5692ed[_0x43c8('0x30')]);_0x3954a3[_0x43c8('0x32')]=_['intersection'](_0x5692ed[_0x43c8('0x2f')],qs[_0x43c8('0x33')](_0x442b00[_0x43c8('0x30')][_0x43c8('0x33')]));_0x3954a3[_0x43c8('0x32')]=_0x3954a3[_0x43c8('0x32')]['length']?_0x3954a3[_0x43c8('0x32')]:_0x5692ed['model'];if(_0x442b00[_0x43c8('0x30')][_0x43c8('0x3e')]){_0x3954a3[_0x43c8('0x45')]=[{'all':!![]}];}_0x3954a3=_[_0x43c8('0x38')]({},_0x3954a3,_0x442b00['options']);return db[_0x43c8('0x2b')][_0x43c8('0x46')](_0x3954a3)[_0x43c8('0x3d')](handleEntityNotFound(_0x126539,null))['then'](respondWithResult(_0x126539,null))[_0x43c8('0x40')](handleError(_0x126539,null));};exports[_0x43c8('0x47')]=function(_0x1c8771,_0x1951b2){return db[_0x43c8('0x2b')][_0x43c8('0x47')](_0x1c8771[_0x43c8('0x48')],{})[_0x43c8('0x3d')](respondWithResult(_0x1951b2,0xc9))[_0x43c8('0x40')](handleError(_0x1951b2,null));};exports[_0x43c8('0x24')]=function(_0x22dcf7,_0x20e15f){if(_0x22dcf7[_0x43c8('0x48')]['id']){delete _0x22dcf7[_0x43c8('0x48')]['id'];}return db[_0x43c8('0x2b')][_0x43c8('0x46')]({'where':{'id':_0x22dcf7[_0x43c8('0x42')]['id']}})['then'](handleEntityNotFound(_0x20e15f,null))[_0x43c8('0x3d')](saveUpdates(_0x22dcf7[_0x43c8('0x48')],null))[_0x43c8('0x3d')](respondWithResult(_0x20e15f,null))[_0x43c8('0x40')](handleError(_0x20e15f,null));};exports[_0x43c8('0x25')]=function(_0x5d3030,_0x5d4d0e){return db['FreshsalesField'][_0x43c8('0x46')]({'where':{'id':_0x5d3030[_0x43c8('0x42')]['id']}})[_0x43c8('0x3d')](handleEntityNotFound(_0x5d4d0e,null))[_0x43c8('0x3d')](removeEntity(_0x5d4d0e,null))[_0x43c8('0x40')](handleError(_0x5d4d0e,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 791bd59..c0fcafa 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 _0x9666=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId'];(function(_0x49fd5f,_0x2f0cd5){var _0x103c94=function(_0x159837){while(--_0x159837){_0x49fd5f['push'](_0x49fd5f['shift']());}};_0x103c94(++_0x2f0cd5);}(_0x9666,0x17a));var _0x6966=function(_0x1b770a,_0x2c9fb1){_0x1b770a=_0x1b770a-0x0;var _0x2a097e=_0x9666[_0x1b770a];return _0x2a097e;};'use strict';var _=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var logger=require(_0x6966('0x2'))(_0x6966('0x3'));var moment=require('moment');var BPromise=require(_0x6966('0x4'));var rp=require(_0x6966('0x5'));var fs=require('fs');var path=require(_0x6966('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6966('0x7'));module[_0x6966('0x8')]=function(_0x7194a6,_0x17198b){return _0x7194a6[_0x6966('0x9')](_0x6966('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x6966('0xb'),'fields':[_0x6966('0xc'),_0x6966('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b6e=['request-promise','path','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','api','bluebird'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x2b914c,_0x286f31){_0x2b914c=_0x2b914c-0x0;var _0x1d6247=_0x5b6e[_0x2b914c];return _0x1d6247;};'use strict';var _=require(_0xe5b6('0x0'));var util=require(_0xe5b6('0x1'));var logger=require('../../config/logger')(_0xe5b6('0x2'));var moment=require('moment');var BPromise=require(_0xe5b6('0x3'));var rp=require(_0xe5b6('0x4'));var fs=require('fs');var path=require(_0xe5b6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5b6('0x6'));module[_0xe5b6('0x7')]=function(_0x2dea90,_0x2dea7d){return _0x2dea90['define'](_0xe5b6('0x8'),attributes,{'tableName':_0xe5b6('0x9'),'paranoid':![],'indexes':[{'name':_0xe5b6('0xa'),'fields':['idField',_0xe5b6('0xb')],'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 443d5b1..704f36d 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 _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5cee2c,_0xe2b651){var _0x1de7fe=function(_0x28c593){while(--_0x28c593){_0x5cee2c['push'](_0x5cee2c['shift']());}};_0x1de7fe(++_0xe2b651);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4970c1,_0x180088){_0x4970c1=_0x4970c1-0x0;var _0x6cb87f=_0xb4c7[_0x4970c1];return _0x6cb87f;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file +var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xd117,0x182));var _0x7d11=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0xd117[_0x16d411];return _0x20336d;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 91b5c70..a93ebde 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(_0x39a64d,_0x431978){var _0x2392fa=function(_0x42ffb2){while(--_0x42ffb2){_0x39a64d['push'](_0x39a64d['shift']());}};_0x2392fa(++_0x431978);}(_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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3c41c8,_0xd46b3c){var _0x965ce=function(_0x401618){while(--_0x401618){_0x3c41c8['push'](_0x3c41c8['shift']());}};_0x965ce(++_0xd46b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 894ea99..1916811 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 _0xa32b=['STRING','username','ENUM','integrationTab','sequelize'];(function(_0xb0dac4,_0x30c300){var _0x44a7ea=function(_0xd09847){while(--_0xd09847){_0xb0dac4['push'](_0xb0dac4['shift']());}};_0x44a7ea(++_0x30c300);}(_0xa32b,0x68));var _0xba32=function(_0x4f4757,_0x44241a){_0x4f4757=_0x4f4757-0x0;var _0x549c37=_0xa32b[_0x4f4757];return _0x549c37;};'use strict';var Sequelize=require(_0xba32('0x0'));module['exports']={'name':{'type':Sequelize[_0xba32('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xba32('0x2')},'remoteUri':{'type':Sequelize[_0xba32('0x1')]},'password':{'type':Sequelize[_0xba32('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xba32('0x1')]},'securityToken':{'type':Sequelize[_0xba32('0x1')]},'serverUrl':{'type':Sequelize[_0xba32('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xba32('0x3')](_0xba32('0x4'),'newTab'),'defaultValue':_0xba32('0x4')}}; \ No newline at end of file +var _0xbdc1=['integrationTab','newTab','sequelize','STRING','username'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xbdc1,0x147));var _0x1bdc=function(_0x1c3187,_0x558ff8){_0x1c3187=_0x1c3187-0x0;var _0x205a3a=_0xbdc1[_0x1c3187];return _0x205a3a;};'use strict';var Sequelize=require(_0x1bdc('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bdc('0x1')]},'description':{'type':Sequelize[_0x1bdc('0x1')]},'username':{'type':Sequelize[_0x1bdc('0x1')],'unique':_0x1bdc('0x2')},'remoteUri':{'type':Sequelize[_0x1bdc('0x1')]},'password':{'type':Sequelize[_0x1bdc('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x1bdc('0x1')]},'serverUrl':{'type':Sequelize[_0x1bdc('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1bdc('0x3'),_0x1bdc('0x4')),'defaultValue':_0x1bdc('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index d5ce6f9..8eccf44 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 _0x43c9=['where','VIRTUAL','options','includeAll','rows','catch','params','length','include','find','create','update','body','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','username','password','securityToken','slice','substring','clientSecret','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','textarea','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filters','filter','merge'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0x43c9,0xae));var _0x943c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x43c9[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x943c('0x0'));var rimraf=require(_0x943c('0x1'));var zipdir=require(_0x943c('0x2'));var jsonpatch=require(_0x943c('0x3'));var rp=require(_0x943c('0x4'));var moment=require('moment');var BPromise=require(_0x943c('0x5'));var Mustache=require(_0x943c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x943c('0x7'));var csv=require(_0x943c('0x8'));var ejs=require(_0x943c('0x9'));var fs=require('fs');var fs_extra=require(_0x943c('0xa'));var _=require('lodash');var squel=require(_0x943c('0xb'));var crypto=require(_0x943c('0xc'));var jsforce=require(_0x943c('0xd'));var deskjs=require(_0x943c('0xe'));var toCsv=require(_0x943c('0x8'));var querystring=require('querystring');var Papa=require(_0x943c('0xf'));var Redis=require(_0x943c('0x10'));var authService=require(_0x943c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x943c('0x12'));var hardwareService=require(_0x943c('0x13'));var logger=require(_0x943c('0x14'))(_0x943c('0x15'));var utils=require(_0x943c('0x16'));var config=require(_0x943c('0x17'));var licenseUtil=require(_0x943c('0x18'));var db=require(_0x943c('0x19'))['db'];var integrations=require(_0x943c('0x1a'));function respondWithStatusCode(_0x210986,_0x3a1f40){_0x3a1f40=_0x3a1f40||0xcc;return function(_0x311e91){if(_0x311e91){return _0x210986['sendStatus'](_0x3a1f40);}return _0x210986[_0x943c('0x1b')](_0x3a1f40)[_0x943c('0x1c')]();};}function respondWithResult(_0x36bd63,_0x51d8cd){_0x51d8cd=_0x51d8cd||0xc8;return function(_0x4c4a45){if(_0x4c4a45){return _0x36bd63[_0x943c('0x1b')](_0x51d8cd)[_0x943c('0x1d')](_0x4c4a45);}};}function respondWithFilteredResult(_0x31175b,_0x2e3add){return function(_0x2f1b16){if(_0x2f1b16){var _0x54ecbe=typeof _0x2e3add[_0x943c('0x1e')]===_0x943c('0x1f')&&typeof _0x2e3add[_0x943c('0x20')]==='undefined';var _0x363b63=_0x2f1b16[_0x943c('0x21')];var _0x490a3a=_0x54ecbe?0x0:_0x2e3add['offset'];var _0x3e818c=_0x54ecbe?_0x2f1b16[_0x943c('0x21')]:_0x2e3add[_0x943c('0x1e')]+_0x2e3add[_0x943c('0x20')];var _0x61148f;if(_0x3e818c>=_0x363b63){_0x3e818c=_0x363b63;_0x61148f=0xc8;}else{_0x61148f=0xce;}_0x31175b[_0x943c('0x1b')](_0x61148f);return _0x31175b['set'](_0x943c('0x22'),_0x490a3a+'-'+_0x3e818c+'/'+_0x363b63)['json'](_0x2f1b16);}return null;};}function patchUpdates(_0x7be263){return function(_0x16290d){try{jsonpatch[_0x943c('0x23')](_0x16290d,_0x7be263,!![]);}catch(_0x19b6ac){return BPromise['reject'](_0x19b6ac);}return _0x16290d[_0x943c('0x24')]();};}function saveUpdates(_0x45c08d,_0x3df56b){return function(_0x44c280){if(_0x44c280){return _0x44c280['update'](_0x45c08d)[_0x943c('0x25')](function(_0x38ac0a){return _0x38ac0a;});}return null;};}function removeEntity(_0x127437,_0x174e77){return function(_0x50ce73){if(_0x50ce73){return _0x50ce73[_0x943c('0x26')]()[_0x943c('0x25')](function(){_0x127437[_0x943c('0x1b')](0xcc)[_0x943c('0x1c')]();});}};}function handleEntityNotFound(_0x4ed3bb,_0x32fc7c){return function(_0x467fee){if(!_0x467fee){_0x4ed3bb['sendStatus'](0x194);}return _0x467fee;};}function handleError(_0x282457,_0x2d6fef){_0x2d6fef=_0x2d6fef||0x1f4;return function(_0x1b3859){logger[_0x943c('0x27')](_0x1b3859[_0x943c('0x28')]);if(_0x1b3859[_0x943c('0x29')]){delete _0x1b3859[_0x943c('0x29')];}_0x282457[_0x943c('0x1b')](_0x2d6fef)[_0x943c('0x2a')](_0x1b3859);};}exports[_0x943c('0x2b')]=function(_0x162dbf,_0x182771){var _0x168279={},_0xdbc362={},_0x3f50a3={'count':0x0,'rows':[]};var _0x4814a7=_[_0x943c('0x2c')](db[_0x943c('0x2d')][_0x943c('0x2e')],function(_0x42a995){return{'name':_0x42a995[_0x943c('0x2f')],'type':_0x42a995[_0x943c('0x30')]['key']};});_0xdbc362[_0x943c('0x31')]=_[_0x943c('0x2c')](_0x4814a7,_0x943c('0x29'));_0xdbc362['query']=_[_0x943c('0x32')](_0x162dbf[_0x943c('0x33')]);_0xdbc362['filters']=_[_0x943c('0x34')](_0xdbc362['model'],_0xdbc362[_0x943c('0x33')]);_0x168279[_0x943c('0x35')]=_[_0x943c('0x34')](_0xdbc362['model'],qs[_0x943c('0x36')](_0x162dbf[_0x943c('0x33')][_0x943c('0x36')]));_0x168279[_0x943c('0x35')]=_0x168279[_0x943c('0x35')]['length']?_0x168279[_0x943c('0x35')]:_0xdbc362[_0x943c('0x31')];if(!_0x162dbf[_0x943c('0x33')][_0x943c('0x37')](_0x943c('0x38'))){_0x168279[_0x943c('0x20')]=qs[_0x943c('0x20')](_0x162dbf[_0x943c('0x33')]['limit']);_0x168279[_0x943c('0x1e')]=qs['offset'](_0x162dbf[_0x943c('0x33')][_0x943c('0x1e')]);}_0x168279['order']=qs[_0x943c('0x39')](_0x162dbf[_0x943c('0x33')][_0x943c('0x39')]);_0x168279['where']=qs['filters'](_[_0x943c('0x3a')](_0x162dbf[_0x943c('0x33')],_0xdbc362[_0x943c('0x3b')]),_0x4814a7);if(_0x162dbf['query'][_0x943c('0x3c')]){_0x168279['where']=_[_0x943c('0x3d')](_0x168279[_0x943c('0x3e')],{'$or':_[_0x943c('0x2c')](_0x4814a7,function(_0x14afec){if(_0x14afec[_0x943c('0x30')]!==_0x943c('0x3f')){var _0x323361={};_0x323361[_0x14afec[_0x943c('0x29')]]={'$like':'%'+_0x162dbf['query'][_0x943c('0x3c')]+'%'};return _0x323361;}})});}_0x168279=_[_0x943c('0x3d')]({},_0x168279,_0x162dbf[_0x943c('0x40')]);var _0x27f9b9={'where':_0x168279[_0x943c('0x3e')]};return db[_0x943c('0x2d')][_0x943c('0x21')](_0x27f9b9)[_0x943c('0x25')](function(_0x4b3cc4){_0x3f50a3[_0x943c('0x21')]=_0x4b3cc4;if(_0x162dbf[_0x943c('0x33')][_0x943c('0x41')]){_0x168279['include']=[{'all':!![]}];}return db[_0x943c('0x2d')]['findAll'](_0x168279);})['then'](function(_0x4b7430){_0x3f50a3[_0x943c('0x42')]=_0x4b7430;return _0x3f50a3;})[_0x943c('0x25')](respondWithFilteredResult(_0x182771,_0x168279))[_0x943c('0x43')](handleError(_0x182771,null));};exports['show']=function(_0x2fd1c3,_0x4c02b3){var _0x55ed1e={'raw':![],'where':{'id':_0x2fd1c3[_0x943c('0x44')]['id']}},_0x2b4a16={};_0x2b4a16['model']=_[_0x943c('0x32')](db[_0x943c('0x2d')]['rawAttributes']);_0x2b4a16[_0x943c('0x33')]=_[_0x943c('0x32')](_0x2fd1c3[_0x943c('0x33')]);_0x2b4a16['filters']=_[_0x943c('0x34')](_0x2b4a16['model'],_0x2b4a16[_0x943c('0x33')]);_0x55ed1e[_0x943c('0x35')]=_[_0x943c('0x34')](_0x2b4a16[_0x943c('0x31')],qs[_0x943c('0x36')](_0x2fd1c3[_0x943c('0x33')][_0x943c('0x36')]));_0x55ed1e[_0x943c('0x35')]=_0x55ed1e[_0x943c('0x35')][_0x943c('0x45')]?_0x55ed1e[_0x943c('0x35')]:_0x2b4a16[_0x943c('0x31')];if(_0x2fd1c3[_0x943c('0x33')][_0x943c('0x41')]){_0x55ed1e[_0x943c('0x46')]=[{'all':!![]}];}_0x55ed1e=_[_0x943c('0x3d')]({},_0x55ed1e,_0x2fd1c3[_0x943c('0x40')]);return db[_0x943c('0x2d')][_0x943c('0x47')](_0x55ed1e)['then'](handleEntityNotFound(_0x4c02b3,null))[_0x943c('0x25')](respondWithResult(_0x4c02b3,null))[_0x943c('0x43')](handleError(_0x4c02b3,null));};exports['create']=function(_0x1c5a05,_0x2c0380){return db['SalesforceAccount'][_0x943c('0x48')](_0x1c5a05['body'],{})['then'](respondWithResult(_0x2c0380,0xc9))[_0x943c('0x43')](handleError(_0x2c0380,null));};exports[_0x943c('0x49')]=function(_0x10b61d,_0x82a654){if(_0x10b61d[_0x943c('0x4a')]['id']){delete _0x10b61d['body']['id'];}return db[_0x943c('0x2d')][_0x943c('0x47')]({'where':{'id':_0x10b61d['params']['id']}})[_0x943c('0x25')](handleEntityNotFound(_0x82a654,null))[_0x943c('0x25')](saveUpdates(_0x10b61d[_0x943c('0x4a')],null))[_0x943c('0x25')](respondWithResult(_0x82a654,null))['catch'](handleError(_0x82a654,null));};exports[_0x943c('0x26')]=function(_0x1c7255,_0x554106){return db['SalesforceAccount'][_0x943c('0x47')]({'where':{'id':_0x1c7255[_0x943c('0x44')]['id']}})[_0x943c('0x25')](handleEntityNotFound(_0x554106,null))[_0x943c('0x25')](removeEntity(_0x554106,null))[_0x943c('0x43')](handleError(_0x554106,null));};exports[_0x943c('0x4b')]=function(_0x25b805,_0x2ce2c0,_0x1d456e){var _0x5d4e7e={};var _0x1530cb={};var _0x5f1e75;var _0x4d8353;return db[_0x943c('0x2d')][_0x943c('0x4c')]({'where':{'id':_0x25b805[_0x943c('0x44')]['id']}})[_0x943c('0x25')](handleEntityNotFound(_0x2ce2c0,null))['then'](function(_0x16e6d7){if(_0x16e6d7){_0x5f1e75=_0x16e6d7;_0x1530cb[_0x943c('0x31')]=_[_0x943c('0x32')](db[_0x943c('0x4d')]['rawAttributes']);_0x1530cb[_0x943c('0x33')]=_[_0x943c('0x32')](_0x25b805[_0x943c('0x33')]);_0x1530cb[_0x943c('0x3b')]=_['intersection'](_0x1530cb['model'],_0x1530cb['query']);_0x5d4e7e[_0x943c('0x35')]=_[_0x943c('0x34')](_0x1530cb['model'],qs[_0x943c('0x36')](_0x25b805[_0x943c('0x33')][_0x943c('0x36')]));_0x5d4e7e['attributes']=_0x5d4e7e[_0x943c('0x35')][_0x943c('0x45')]?_0x5d4e7e['attributes']:_0x1530cb[_0x943c('0x31')];_0x5d4e7e[_0x943c('0x4e')]=qs[_0x943c('0x39')](_0x25b805['query'][_0x943c('0x39')]);_0x5d4e7e[_0x943c('0x3e')]=qs[_0x943c('0x3b')](_[_0x943c('0x3a')](_0x25b805[_0x943c('0x33')],_0x1530cb[_0x943c('0x3b')]));if(_0x25b805[_0x943c('0x33')]['filter']){_0x5d4e7e[_0x943c('0x3e')]=_[_0x943c('0x3d')](_0x5d4e7e[_0x943c('0x3e')],{'$or':_[_0x943c('0x2c')](_0x5d4e7e[_0x943c('0x35')],function(_0x3ae958){var _0x45e626={};_0x45e626[_0x3ae958]={'$like':'%'+_0x25b805[_0x943c('0x33')][_0x943c('0x3c')]+'%'};return _0x45e626;})});}_0x5d4e7e=_['merge']({},_0x5d4e7e,_0x25b805[_0x943c('0x40')]);return _0x5f1e75['getConfigurations'](_0x5d4e7e);}})['then'](function(_0x29a148){if(_0x29a148){_0x4d8353=_0x29a148['length'];if(!_0x25b805[_0x943c('0x33')][_0x943c('0x37')](_0x943c('0x38'))){_0x5d4e7e[_0x943c('0x20')]=qs[_0x943c('0x20')](_0x25b805[_0x943c('0x33')][_0x943c('0x20')]);_0x5d4e7e['offset']=qs[_0x943c('0x1e')](_0x25b805[_0x943c('0x33')][_0x943c('0x1e')]);}return _0x5f1e75[_0x943c('0x4b')](_0x5d4e7e);}})[_0x943c('0x25')](function(_0x5089c5){if(_0x5089c5){return _0x5089c5?{'count':_0x4d8353,'rows':_0x5089c5}:null;}})[_0x943c('0x25')](respondWithResult(_0x2ce2c0,null))[_0x943c('0x43')](handleError(_0x2ce2c0,null));};exports[_0x943c('0x4f')]=function(_0x16d848,_0x2e10cd,_0x151337){if(_0x16d848[_0x943c('0x4a')]['id']){delete _0x16d848[_0x943c('0x4a')]['id'];}return db['SalesforceAccount'][_0x943c('0x4c')]({'where':{'id':_0x16d848['params']['id']}})[_0x943c('0x25')](handleEntityNotFound(_0x2e10cd,null))[_0x943c('0x25')](function(_0x2b19ee){if(_0x2b19ee){_0x16d848['body'][_0x943c('0x50')]=_0x2b19ee['id'];_0x16d848[_0x943c('0x4a')][_0x943c('0x51')]=integrations['getSubjects'](_0x16d848['body'][_0x943c('0x52')],_0x16d848[_0x943c('0x4a')][_0x943c('0x30')]);_0x16d848[_0x943c('0x4a')][_0x943c('0x53')]=integrations[_0x943c('0x54')](_0x16d848['body'][_0x943c('0x52')],_0x16d848['body']['type']);return db[_0x943c('0x4d')]['create'](_0x16d848[_0x943c('0x4a')],{'include':[{'model':db[_0x943c('0x55')],'as':_0x943c('0x51')},{'model':db[_0x943c('0x55')],'as':_0x943c('0x53')}]});}return null;})[_0x943c('0x25')](respondWithResult(_0x2e10cd,null))[_0x943c('0x43')](handleError(_0x2e10cd,null));};exports[_0x943c('0x56')]=function(_0x5f2562,_0xe65306,_0xa17e2c){var _0x5455dd;var _0x309ee7='';var _0x5d0cb8='Task';return db[_0x943c('0x2d')][_0x943c('0x4c')]({'where':{'id':_0x5f2562[_0x943c('0x44')]['id']},'attributes':['id',_0x943c('0x57'),_0x943c('0x58'),'clientSecret',_0x943c('0x59'),_0x943c('0x5a'),_0x943c('0x5b')]})['then'](handleEntityNotFound(_0xe65306,null))['then'](function(_0x3c2e26){if(_0x3c2e26){_0x309ee7=_0x3c2e26[_0x943c('0x57')];var _0x819d70=_0x309ee7[_0x943c('0x5c')](-0x1);if(_0x819d70==='/'){_0x309ee7=_0x309ee7[_0x943c('0x5d')](0x0,_0x309ee7['lastIndexOf'](_0x819d70));}_0x5455dd=new jsforce['Connection']({'oauth2':{'loginUrl':_0x309ee7,'clientId':_0x3c2e26['clientId'],'clientSecret':_0x3c2e26[_0x943c('0x5e')]}});return _0x5455dd['login'](_0x3c2e26[_0x943c('0x59')],_0x3c2e26[_0x943c('0x5a')][_0x943c('0x5f')](_0x3c2e26[_0x943c('0x5b')]));}})['then'](function(_0x710e3a){if(_0x710e3a){if(!_['isNil'](_0x5f2562[_0x943c('0x33')][_0x943c('0x60')])){_0x5d0cb8=_0x5f2562[_0x943c('0x33')][_0x943c('0x60')];}return _0x5455dd[_0x943c('0x61')](_0x5d0cb8)[_0x943c('0x62')]();}})['then'](function(_0x276907){var _0x332aaf=[_0x943c('0x63'),_0x943c('0x64'),_0x943c('0x65'),_0x943c('0x66'),'Subject',_0x943c('0x67')];var _0x96899b=[_0x943c('0x68'),'int',_0x943c('0x69'),_0x943c('0x6a'),'email',_0x943c('0x6b'),'phone'];if(_0x276907){_['remove'](_0x276907[_0x943c('0x36')],function(_0x10c031){return _0x332aaf[_0x943c('0x6c')](_0x10c031[_0x943c('0x29')])||!_0x96899b[_0x943c('0x6c')](_0x10c031[_0x943c('0x30')]);});return{'count':_0x276907[_0x943c('0x36')]['length'],'rows':_[_0x943c('0x2c')](_0x276907[_0x943c('0x36')],function(_0x228da8){return{'id':_0x228da8['name'],'name':_0x228da8[_0x943c('0x6d')],'custom':_0x228da8[_0x943c('0x6e')],'options':_0x228da8[_0x943c('0x6f')]['length']>0x0?_[_0x943c('0x2c')](_0x228da8['picklistValues'],function(_0x1d5c10){return{'name':_0x1d5c10[_0x943c('0x6d')],'value':_0x1d5c10['value']};}):_0x228da8[_0x943c('0x30')]==_0x943c('0x6a')?[{'name':_0x943c('0x70'),'value':_0x943c('0x71')},{'name':_0x943c('0x72'),'value':_0x943c('0x73')}]:[]};})};}})[_0x943c('0x25')](respondWithResult(_0xe65306,null))['catch'](function(_0x5021bc){var _0x4322f9=_0x5f2562[_0x943c('0x33')][_0x943c('0x74')]?0x1f4:_0x5021bc[_0x943c('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x943c('0x56'),_0x4322f9,JSON['stringify'](_0x5021bc));delete _0x5021bc[_0x943c('0x29')];if(_0x4322f9===0x191){_0x4322f9=0x190;}_0xe65306[_0x943c('0x1b')](_0x4322f9)['send'](_0x5f2562[_0x943c('0x33')][_0x943c('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x5021bc[_0x943c('0x75')]}:_0x5021bc);});}; \ No newline at end of file +var _0xfb15=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','SalesforceAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','map','type','options','include','rows','catch','show','find','create','body','params','findOne','SalesforceConfiguration','pick','hasOwnProperty','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','securityToken','slice','substring','lastIndexOf','Connection','login','password','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','textarea','phone','includes','label','picklistValues','value','True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','querystring','papaparse'];(function(_0x2c4702,_0x3857ed){var _0x54d0a3=function(_0x903ba8){while(--_0x903ba8){_0x2c4702['push'](_0x2c4702['shift']());}};_0x54d0a3(++_0x3857ed);}(_0xfb15,0x15e));var _0x5fb1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfb15[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x5fb1('0x0'));var rimraf=require(_0x5fb1('0x1'));var zipdir=require(_0x5fb1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5fb1('0x3'));var BPromise=require(_0x5fb1('0x4'));var Mustache=require('mustache');var util=require(_0x5fb1('0x5'));var path=require(_0x5fb1('0x6'));var sox=require('sox');var csv=require(_0x5fb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5fb1('0x8'));var _=require(_0x5fb1('0x9'));var squel=require(_0x5fb1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5fb1('0x7'));var querystring=require(_0x5fb1('0xb'));var Papa=require(_0x5fb1('0xc'));var Redis=require(_0x5fb1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5fb1('0xe'));var as=require(_0x5fb1('0xf'));var hardwareService=require(_0x5fb1('0x10'));var logger=require(_0x5fb1('0x11'))(_0x5fb1('0x12'));var utils=require(_0x5fb1('0x13'));var config=require(_0x5fb1('0x14'));var licenseUtil=require(_0x5fb1('0x15'));var db=require(_0x5fb1('0x16'))['db'];var integrations=require(_0x5fb1('0x17'));function respondWithStatusCode(_0x1ee7f0,_0x248329){_0x248329=_0x248329||0xcc;return function(_0x2d1676){if(_0x2d1676){return _0x1ee7f0[_0x5fb1('0x18')](_0x248329);}return _0x1ee7f0[_0x5fb1('0x19')](_0x248329)[_0x5fb1('0x1a')]();};}function respondWithResult(_0x314432,_0x5dba8e){_0x5dba8e=_0x5dba8e||0xc8;return function(_0x267dda){if(_0x267dda){return _0x314432[_0x5fb1('0x19')](_0x5dba8e)[_0x5fb1('0x1b')](_0x267dda);}};}function respondWithFilteredResult(_0x503c13,_0xaac99a){return function(_0x33f6e3){if(_0x33f6e3){var _0x4513e5=typeof _0xaac99a[_0x5fb1('0x1c')]===_0x5fb1('0x1d')&&typeof _0xaac99a['limit']===_0x5fb1('0x1d');var _0x4ea04a=_0x33f6e3['count'];var _0x3c9d3d=_0x4513e5?0x0:_0xaac99a[_0x5fb1('0x1c')];var _0x5d726f=_0x4513e5?_0x33f6e3[_0x5fb1('0x1e')]:_0xaac99a['offset']+_0xaac99a[_0x5fb1('0x1f')];var _0x2d59c9;if(_0x5d726f>=_0x4ea04a){_0x5d726f=_0x4ea04a;_0x2d59c9=0xc8;}else{_0x2d59c9=0xce;}_0x503c13['status'](_0x2d59c9);return _0x503c13['set']('Content-Range',_0x3c9d3d+'-'+_0x5d726f+'/'+_0x4ea04a)['json'](_0x33f6e3);}return null;};}function patchUpdates(_0x596233){return function(_0x321100){try{jsonpatch[_0x5fb1('0x20')](_0x321100,_0x596233,!![]);}catch(_0x2aa8c9){return BPromise[_0x5fb1('0x21')](_0x2aa8c9);}return _0x321100[_0x5fb1('0x22')]();};}function saveUpdates(_0x1d2651,_0x245053){return function(_0x22d4b3){if(_0x22d4b3){return _0x22d4b3[_0x5fb1('0x23')](_0x1d2651)[_0x5fb1('0x24')](function(_0xb07e97){return _0xb07e97;});}return null;};}function removeEntity(_0x486fa2,_0x5ebba3){return function(_0x59c06a){if(_0x59c06a){return _0x59c06a[_0x5fb1('0x25')]()[_0x5fb1('0x24')](function(){_0x486fa2[_0x5fb1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420019,_0x57e052){return function(_0x589f33){if(!_0x589f33){_0x420019['sendStatus'](0x194);}return _0x589f33;};}function handleError(_0x3f4ad5,_0x2fe767){_0x2fe767=_0x2fe767||0x1f4;return function(_0x5dace2){logger[_0x5fb1('0x26')](_0x5dace2[_0x5fb1('0x27')]);if(_0x5dace2[_0x5fb1('0x28')]){delete _0x5dace2['name'];}_0x3f4ad5[_0x5fb1('0x19')](_0x2fe767)[_0x5fb1('0x29')](_0x5dace2);};}exports['index']=function(_0x590f2f,_0x1f8200){var _0xe972dc={},_0x27fba8={},_0x43bdff={'count':0x0,'rows':[]};var _0x344bec=_['map'](db[_0x5fb1('0x2a')][_0x5fb1('0x2b')],function(_0x8c8665){return{'name':_0x8c8665[_0x5fb1('0x2c')],'type':_0x8c8665['type'][_0x5fb1('0x2d')]};});_0x27fba8['model']=_['map'](_0x344bec,_0x5fb1('0x28'));_0x27fba8[_0x5fb1('0x2e')]=_[_0x5fb1('0x2f')](_0x590f2f[_0x5fb1('0x2e')]);_0x27fba8[_0x5fb1('0x30')]=_[_0x5fb1('0x31')](_0x27fba8['model'],_0x27fba8['query']);_0xe972dc[_0x5fb1('0x32')]=_['intersection'](_0x27fba8['model'],qs[_0x5fb1('0x33')](_0x590f2f[_0x5fb1('0x2e')][_0x5fb1('0x33')]));_0xe972dc[_0x5fb1('0x32')]=_0xe972dc[_0x5fb1('0x32')][_0x5fb1('0x34')]?_0xe972dc[_0x5fb1('0x32')]:_0x27fba8[_0x5fb1('0x35')];if(!_0x590f2f[_0x5fb1('0x2e')]['hasOwnProperty'](_0x5fb1('0x36'))){_0xe972dc['limit']=qs[_0x5fb1('0x1f')](_0x590f2f[_0x5fb1('0x2e')][_0x5fb1('0x1f')]);_0xe972dc[_0x5fb1('0x1c')]=qs[_0x5fb1('0x1c')](_0x590f2f[_0x5fb1('0x2e')][_0x5fb1('0x1c')]);}_0xe972dc[_0x5fb1('0x37')]=qs[_0x5fb1('0x38')](_0x590f2f[_0x5fb1('0x2e')][_0x5fb1('0x38')]);_0xe972dc[_0x5fb1('0x39')]=qs[_0x5fb1('0x30')](_['pick'](_0x590f2f['query'],_0x27fba8[_0x5fb1('0x30')]),_0x344bec);if(_0x590f2f[_0x5fb1('0x2e')][_0x5fb1('0x3a')]){_0xe972dc[_0x5fb1('0x39')]=_[_0x5fb1('0x3b')](_0xe972dc['where'],{'$or':_[_0x5fb1('0x3c')](_0x344bec,function(_0x341b0b){if(_0x341b0b[_0x5fb1('0x3d')]!=='VIRTUAL'){var _0x407118={};_0x407118[_0x341b0b[_0x5fb1('0x28')]]={'$like':'%'+_0x590f2f[_0x5fb1('0x2e')][_0x5fb1('0x3a')]+'%'};return _0x407118;}})});}_0xe972dc=_[_0x5fb1('0x3b')]({},_0xe972dc,_0x590f2f[_0x5fb1('0x3e')]);var _0x4ca17f={'where':_0xe972dc[_0x5fb1('0x39')]};return db[_0x5fb1('0x2a')][_0x5fb1('0x1e')](_0x4ca17f)['then'](function(_0x38b9d0){_0x43bdff[_0x5fb1('0x1e')]=_0x38b9d0;if(_0x590f2f[_0x5fb1('0x2e')]['includeAll']){_0xe972dc[_0x5fb1('0x3f')]=[{'all':!![]}];}return db[_0x5fb1('0x2a')]['findAll'](_0xe972dc);})[_0x5fb1('0x24')](function(_0x242933){_0x43bdff[_0x5fb1('0x40')]=_0x242933;return _0x43bdff;})[_0x5fb1('0x24')](respondWithFilteredResult(_0x1f8200,_0xe972dc))[_0x5fb1('0x41')](handleError(_0x1f8200,null));};exports[_0x5fb1('0x42')]=function(_0x36435c,_0x21d607){var _0x24295c={'raw':![],'where':{'id':_0x36435c['params']['id']}},_0x57fea2={};_0x57fea2[_0x5fb1('0x35')]=_[_0x5fb1('0x2f')](db[_0x5fb1('0x2a')][_0x5fb1('0x2b')]);_0x57fea2[_0x5fb1('0x2e')]=_[_0x5fb1('0x2f')](_0x36435c['query']);_0x57fea2['filters']=_[_0x5fb1('0x31')](_0x57fea2[_0x5fb1('0x35')],_0x57fea2['query']);_0x24295c[_0x5fb1('0x32')]=_[_0x5fb1('0x31')](_0x57fea2[_0x5fb1('0x35')],qs[_0x5fb1('0x33')](_0x36435c['query'][_0x5fb1('0x33')]));_0x24295c[_0x5fb1('0x32')]=_0x24295c[_0x5fb1('0x32')]['length']?_0x24295c[_0x5fb1('0x32')]:_0x57fea2['model'];if(_0x36435c[_0x5fb1('0x2e')]['includeAll']){_0x24295c[_0x5fb1('0x3f')]=[{'all':!![]}];}_0x24295c=_['merge']({},_0x24295c,_0x36435c[_0x5fb1('0x3e')]);return db[_0x5fb1('0x2a')][_0x5fb1('0x43')](_0x24295c)[_0x5fb1('0x24')](handleEntityNotFound(_0x21d607,null))['then'](respondWithResult(_0x21d607,null))[_0x5fb1('0x41')](handleError(_0x21d607,null));};exports[_0x5fb1('0x44')]=function(_0xfd9cd6,_0x38451a){return db[_0x5fb1('0x2a')]['create'](_0xfd9cd6[_0x5fb1('0x45')],{})['then'](respondWithResult(_0x38451a,0xc9))['catch'](handleError(_0x38451a,null));};exports[_0x5fb1('0x23')]=function(_0x12ddf2,_0xad8809){if(_0x12ddf2[_0x5fb1('0x45')]['id']){delete _0x12ddf2[_0x5fb1('0x45')]['id'];}return db['SalesforceAccount'][_0x5fb1('0x43')]({'where':{'id':_0x12ddf2[_0x5fb1('0x46')]['id']}})['then'](handleEntityNotFound(_0xad8809,null))[_0x5fb1('0x24')](saveUpdates(_0x12ddf2[_0x5fb1('0x45')],null))['then'](respondWithResult(_0xad8809,null))[_0x5fb1('0x41')](handleError(_0xad8809,null));};exports[_0x5fb1('0x25')]=function(_0x339ceb,_0xbe7f80){return db[_0x5fb1('0x2a')][_0x5fb1('0x43')]({'where':{'id':_0x339ceb['params']['id']}})[_0x5fb1('0x24')](handleEntityNotFound(_0xbe7f80,null))['then'](removeEntity(_0xbe7f80,null))[_0x5fb1('0x41')](handleError(_0xbe7f80,null));};exports['getConfigurations']=function(_0x417136,_0xc3015f,_0x4dd4fe){var _0x527b9e={};var _0x4c8d42={};var _0x53f2a2;var _0x9186d4;return db[_0x5fb1('0x2a')][_0x5fb1('0x47')]({'where':{'id':_0x417136[_0x5fb1('0x46')]['id']}})['then'](handleEntityNotFound(_0xc3015f,null))['then'](function(_0x1a2804){if(_0x1a2804){_0x53f2a2=_0x1a2804;_0x4c8d42[_0x5fb1('0x35')]=_['keys'](db[_0x5fb1('0x48')][_0x5fb1('0x2b')]);_0x4c8d42[_0x5fb1('0x2e')]=_[_0x5fb1('0x2f')](_0x417136[_0x5fb1('0x2e')]);_0x4c8d42['filters']=_[_0x5fb1('0x31')](_0x4c8d42[_0x5fb1('0x35')],_0x4c8d42['query']);_0x527b9e[_0x5fb1('0x32')]=_[_0x5fb1('0x31')](_0x4c8d42[_0x5fb1('0x35')],qs[_0x5fb1('0x33')](_0x417136['query'][_0x5fb1('0x33')]));_0x527b9e[_0x5fb1('0x32')]=_0x527b9e[_0x5fb1('0x32')]['length']?_0x527b9e[_0x5fb1('0x32')]:_0x4c8d42[_0x5fb1('0x35')];_0x527b9e[_0x5fb1('0x37')]=qs['sort'](_0x417136[_0x5fb1('0x2e')][_0x5fb1('0x38')]);_0x527b9e[_0x5fb1('0x39')]=qs['filters'](_[_0x5fb1('0x49')](_0x417136[_0x5fb1('0x2e')],_0x4c8d42[_0x5fb1('0x30')]));if(_0x417136['query'][_0x5fb1('0x3a')]){_0x527b9e[_0x5fb1('0x39')]=_[_0x5fb1('0x3b')](_0x527b9e[_0x5fb1('0x39')],{'$or':_[_0x5fb1('0x3c')](_0x527b9e[_0x5fb1('0x32')],function(_0x2dca4d){var _0x3daf60={};_0x3daf60[_0x2dca4d]={'$like':'%'+_0x417136[_0x5fb1('0x2e')][_0x5fb1('0x3a')]+'%'};return _0x3daf60;})});}_0x527b9e=_['merge']({},_0x527b9e,_0x417136['options']);return _0x53f2a2['getConfigurations'](_0x527b9e);}})[_0x5fb1('0x24')](function(_0x115a33){if(_0x115a33){_0x9186d4=_0x115a33[_0x5fb1('0x34')];if(!_0x417136[_0x5fb1('0x2e')][_0x5fb1('0x4a')](_0x5fb1('0x36'))){_0x527b9e[_0x5fb1('0x1f')]=qs['limit'](_0x417136[_0x5fb1('0x2e')][_0x5fb1('0x1f')]);_0x527b9e[_0x5fb1('0x1c')]=qs[_0x5fb1('0x1c')](_0x417136['query'][_0x5fb1('0x1c')]);}return _0x53f2a2[_0x5fb1('0x4b')](_0x527b9e);}})[_0x5fb1('0x24')](function(_0xc3fc25){if(_0xc3fc25){return _0xc3fc25?{'count':_0x9186d4,'rows':_0xc3fc25}:null;}})[_0x5fb1('0x24')](respondWithResult(_0xc3015f,null))['catch'](handleError(_0xc3015f,null));};exports['addConfiguration']=function(_0x3f36b4,_0x1da98b,_0x943f47){if(_0x3f36b4[_0x5fb1('0x45')]['id']){delete _0x3f36b4[_0x5fb1('0x45')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x3f36b4[_0x5fb1('0x46')]['id']}})[_0x5fb1('0x24')](handleEntityNotFound(_0x1da98b,null))[_0x5fb1('0x24')](function(_0x1ec206){if(_0x1ec206){_0x3f36b4[_0x5fb1('0x45')][_0x5fb1('0x4c')]=_0x1ec206['id'];_0x3f36b4[_0x5fb1('0x45')][_0x5fb1('0x4d')]=integrations[_0x5fb1('0x4e')](_0x3f36b4['body'][_0x5fb1('0x4f')],_0x3f36b4[_0x5fb1('0x45')][_0x5fb1('0x3d')]);_0x3f36b4[_0x5fb1('0x45')][_0x5fb1('0x50')]=integrations[_0x5fb1('0x51')](_0x3f36b4[_0x5fb1('0x45')][_0x5fb1('0x4f')],_0x3f36b4['body']['type']);return db[_0x5fb1('0x48')][_0x5fb1('0x44')](_0x3f36b4['body'],{'include':[{'model':db[_0x5fb1('0x52')],'as':_0x5fb1('0x4d')},{'model':db[_0x5fb1('0x52')],'as':_0x5fb1('0x50')}]});}return null;})['then'](respondWithResult(_0x1da98b,null))['catch'](handleError(_0x1da98b,null));};exports[_0x5fb1('0x53')]=function(_0x151f3a,_0x12b65c,_0x52cfcc){var _0x54e42f;var _0xd2cae3='';var _0x2a1325=_0x5fb1('0x54');return db['SalesforceAccount'][_0x5fb1('0x47')]({'where':{'id':_0x151f3a[_0x5fb1('0x46')]['id']},'attributes':['id',_0x5fb1('0x55'),_0x5fb1('0x56'),'clientSecret',_0x5fb1('0x57'),'password',_0x5fb1('0x58')]})[_0x5fb1('0x24')](handleEntityNotFound(_0x12b65c,null))['then'](function(_0x5c7e05){if(_0x5c7e05){_0xd2cae3=_0x5c7e05[_0x5fb1('0x55')];var _0xe666ca=_0xd2cae3[_0x5fb1('0x59')](-0x1);if(_0xe666ca==='/'){_0xd2cae3=_0xd2cae3[_0x5fb1('0x5a')](0x0,_0xd2cae3[_0x5fb1('0x5b')](_0xe666ca));}_0x54e42f=new jsforce[(_0x5fb1('0x5c'))]({'oauth2':{'loginUrl':_0xd2cae3,'clientId':_0x5c7e05[_0x5fb1('0x56')],'clientSecret':_0x5c7e05['clientSecret']}});return _0x54e42f[_0x5fb1('0x5d')](_0x5c7e05[_0x5fb1('0x57')],_0x5c7e05[_0x5fb1('0x5e')][_0x5fb1('0x5f')](_0x5c7e05['securityToken']));}})[_0x5fb1('0x24')](function(_0x208b1a){if(_0x208b1a){if(!_[_0x5fb1('0x60')](_0x151f3a[_0x5fb1('0x2e')]['ticketType'])){_0x2a1325=_0x151f3a['query'][_0x5fb1('0x61')];}return _0x54e42f[_0x5fb1('0x62')](_0x2a1325)['describe']();}})[_0x5fb1('0x24')](function(_0xc2db8f){var _0x2aca53=[_0x5fb1('0x63'),_0x5fb1('0x64'),_0x5fb1('0x65'),_0x5fb1('0x66'),'Subject',_0x5fb1('0x67')];var _0x32cdf3=[_0x5fb1('0x68'),_0x5fb1('0x69'),_0x5fb1('0x6a'),_0x5fb1('0x6b'),'email',_0x5fb1('0x6c'),_0x5fb1('0x6d')];if(_0xc2db8f){_['remove'](_0xc2db8f[_0x5fb1('0x33')],function(_0x2f768b){return _0x2aca53[_0x5fb1('0x6e')](_0x2f768b['name'])||!_0x32cdf3[_0x5fb1('0x6e')](_0x2f768b[_0x5fb1('0x3d')]);});return{'count':_0xc2db8f[_0x5fb1('0x33')]['length'],'rows':_[_0x5fb1('0x3c')](_0xc2db8f[_0x5fb1('0x33')],function(_0x57b15e){return{'id':_0x57b15e[_0x5fb1('0x28')],'name':_0x57b15e[_0x5fb1('0x6f')],'custom':_0x57b15e['custom'],'options':_0x57b15e[_0x5fb1('0x70')][_0x5fb1('0x34')]>0x0?_[_0x5fb1('0x3c')](_0x57b15e[_0x5fb1('0x70')],function(_0xc5ee12){return{'name':_0xc5ee12[_0x5fb1('0x6f')],'value':_0xc5ee12[_0x5fb1('0x71')]};}):_0x57b15e[_0x5fb1('0x3d')]==_0x5fb1('0x6b')?[{'name':_0x5fb1('0x72'),'value':'true'},{'name':_0x5fb1('0x73'),'value':_0x5fb1('0x74')}]:[]};})};}})[_0x5fb1('0x24')](respondWithResult(_0x12b65c,null))[_0x5fb1('0x41')](function(_0x5c2fc7){var _0x58ec97=_0x151f3a[_0x5fb1('0x2e')]['test']?0x1f4:_0x5c2fc7[_0x5fb1('0x75')]||0x1f4;logger['error'](_0x5fb1('0x76'),_0x5fb1('0x53'),_0x58ec97,JSON[_0x5fb1('0x77')](_0x5c2fc7));delete _0x5c2fc7[_0x5fb1('0x28')];if(_0x58ec97===0x191){_0x58ec97=0x190;}_0x12b65c['status'](_0x58ec97)[_0x5fb1('0x29')](_0x151f3a[_0x5fb1('0x2e')]['test']?{'message':_0x5fb1('0x78'),'statusCode':_0x5c2fc7['statusCode']}:_0x5c2fc7);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index f5b7301..399a7c7 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 _0x89c4=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x3dc544,_0x169125){var _0x5f1997=function(_0x56ee1c){while(--_0x56ee1c){_0x3dc544['push'](_0x3dc544['shift']());}};_0x5f1997(++_0x169125);}(_0x89c4,0x82));var _0x489c=function(_0x38888b,_0xd4edf0){_0x38888b=_0x38888b-0x0;var _0x39224f=_0x89c4[_0x38888b];return _0x39224f;};'use strict';var _=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var logger=require('../../config/logger')(_0x489c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x489c('0x3'));var fs=require('fs');var path=require(_0x489c('0x4'));var rimraf=require(_0x489c('0x5'));var config=require(_0x489c('0x6'));var attributes=require(_0x489c('0x7'));var integrations=require(_0x489c('0x8'));module[_0x489c('0x9')]=function(_0x4c5ea1,_0xe5e402){return _0x4c5ea1[_0x489c('0xa')](_0x489c('0xb'),attributes,{'tableName':_0x489c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb4b=['rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','util','api','moment','bluebird','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x10e633,_0x30e941){_0x10e633=_0x10e633-0x0;var _0x5dc12f=_0xdb4b[_0x10e633];return _0x5dc12f;};'use strict';var _=require('lodash');var util=require(_0xbdb4('0x0'));var logger=require('../../config/logger')(_0xbdb4('0x1'));var moment=require(_0xbdb4('0x2'));var BPromise=require(_0xbdb4('0x3'));var rp=require(_0xbdb4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdb4('0x5'));var config=require(_0xbdb4('0x6'));var attributes=require(_0xbdb4('0x7'));var integrations=require(_0xbdb4('0x8'));module[_0xbdb4('0x9')]=function(_0x3c8252,_0x1dcaa1){return _0x3c8252['define']('SalesforceAccount',attributes,{'tableName':_0xbdb4('0xa'),'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 e022c25..e55b0eb 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 _0x9c06=['model','debug','catch','ShowSalesforceAccount','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSalesforceAccount','SalesforceAccount','raw','options','where','attributes','limit','include','map'];(function(_0x20f060,_0xe160c9){var _0x46077c=function(_0x3c615a){while(--_0x3c615a){_0x20f060['push'](_0x20f060['shift']());}};_0x46077c(++_0xe160c9);}(_0x9c06,0x68));var _0x69c0=function(_0x24b40a,_0x4593da){_0x24b40a=_0x24b40a-0x0;var _0x1dd474=_0x9c06[_0x24b40a];return _0x1dd474;};'use strict';var _=require(_0x69c0('0x0'));var util=require(_0x69c0('0x1'));var moment=require('moment');var BPromise=require(_0x69c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69c0('0x3'));var db=require(_0x69c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x69c0('0x5'))(_0x69c0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x69c0('0x7')][_0x69c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34d041,_0x1d931b,_0x1e06a0){return new BPromise(function(_0x567b17,_0x4cc903){return client[_0x69c0('0x9')](_0x34d041,_0x1e06a0)[_0x69c0('0xa')](function(_0x38933a){logger[_0x69c0('0xb')](_0x69c0('0xc'),_0x1d931b,_0x69c0('0xd'));logger['debug'](_0x69c0('0xe'),_0x1d931b,_0x69c0('0xd'),JSON['stringify'](_0x38933a));if(_0x38933a[_0x69c0('0xf')]){if(_0x38933a['error'][_0x69c0('0x10')]===0x1f4){logger['error'](_0x69c0('0xc'),_0x1d931b,_0x38933a[_0x69c0('0xf')][_0x69c0('0x11')]);return _0x4cc903(_0x38933a[_0x69c0('0xf')][_0x69c0('0x11')]);}logger[_0x69c0('0xf')](_0x69c0('0xc'),_0x1d931b,_0x38933a[_0x69c0('0xf')]['message']);return _0x567b17(_0x38933a[_0x69c0('0xf')]['message']);}else{logger[_0x69c0('0xb')](_0x69c0('0xc'),_0x1d931b,'request\x20sent');_0x567b17(_0x38933a[_0x69c0('0x12')][_0x69c0('0x11')]);}})['catch'](function(_0x18530f){logger[_0x69c0('0xf')](_0x69c0('0xc'),_0x1d931b,_0x18530f);_0x4cc903(_0x18530f);});});}exports[_0x69c0('0x13')]=function(_0x46d5dc){var _0x10f8e9=this;return new Promise(function(_0x4ed2fd,_0x905731){return db[_0x69c0('0x14')]['findAll']({'raw':_0x46d5dc['options']?_0x46d5dc['options'][_0x69c0('0x15')]===undefined?!![]:![]:!![],'where':_0x46d5dc[_0x69c0('0x16')]?_0x46d5dc['options'][_0x69c0('0x17')]||null:null,'attributes':_0x46d5dc[_0x69c0('0x16')]?_0x46d5dc['options'][_0x69c0('0x18')]||null:null,'limit':_0x46d5dc[_0x69c0('0x16')]?_0x46d5dc[_0x69c0('0x16')][_0x69c0('0x19')]||null:null,'include':_0x46d5dc['options']?_0x46d5dc[_0x69c0('0x16')][_0x69c0('0x1a')]?_[_0x69c0('0x1b')](_0x46d5dc[_0x69c0('0x16')][_0x69c0('0x1a')],function(_0x6798d9){return{'model':db[_0x6798d9['model']],'as':_0x6798d9['as'],'attributes':_0x6798d9[_0x69c0('0x18')],'include':_0x6798d9[_0x69c0('0x1a')]?_[_0x69c0('0x1b')](_0x6798d9[_0x69c0('0x1a')],function(_0x842377){return{'model':db[_0x842377[_0x69c0('0x1c')]],'as':_0x842377['as'],'attributes':_0x842377[_0x69c0('0x18')],'include':_0x842377[_0x69c0('0x1a')]?_[_0x69c0('0x1b')](_0x842377['include'],function(_0x11f739){return{'model':db[_0x11f739[_0x69c0('0x1c')]],'as':_0x11f739['as'],'attributes':_0x11f739[_0x69c0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x69c0('0xa')](function(_0x5392d5){logger[_0x69c0('0xb')](_0x69c0('0x13'),_0x46d5dc);logger[_0x69c0('0x1d')](_0x69c0('0x13'),_0x46d5dc,JSON['stringify'](_0x5392d5));_0x4ed2fd(_0x5392d5);})[_0x69c0('0x1e')](function(_0x2cfd53){logger[_0x69c0('0xf')]('GetSalesforceAccount',_0x2cfd53[_0x69c0('0x11')],_0x46d5dc);_0x905731(_0x10f8e9[_0x69c0('0xf')](0x1f4,_0x2cfd53[_0x69c0('0x11')]));});});};exports[_0x69c0('0x1f')]=function(_0x2469c7){var _0x37f110=this;return new Promise(function(_0x1e69cf,_0x2eb12d){return db['SalesforceAccount']['find']({'raw':_0x2469c7['options']?_0x2469c7[_0x69c0('0x16')][_0x69c0('0x15')]===undefined?!![]:![]:!![],'where':_0x2469c7['options']?_0x2469c7[_0x69c0('0x16')][_0x69c0('0x17')]||null:null,'attributes':_0x2469c7[_0x69c0('0x16')]?_0x2469c7[_0x69c0('0x16')][_0x69c0('0x18')]||null:null,'include':_0x2469c7[_0x69c0('0x16')]?_0x2469c7[_0x69c0('0x16')][_0x69c0('0x1a')]?_[_0x69c0('0x1b')](_0x2469c7['options'][_0x69c0('0x1a')],function(_0x1cf616){return{'model':db[_0x1cf616[_0x69c0('0x1c')]],'as':_0x1cf616['as'],'attributes':_0x1cf616[_0x69c0('0x18')],'include':_0x1cf616[_0x69c0('0x1a')]?_[_0x69c0('0x1b')](_0x1cf616[_0x69c0('0x1a')],function(_0x31c181){return{'model':db[_0x31c181[_0x69c0('0x1c')]],'as':_0x31c181['as'],'attributes':_0x31c181['attributes'],'include':_0x31c181['include']?_['map'](_0x31c181[_0x69c0('0x1a')],function(_0x43cb01){return{'model':db[_0x43cb01[_0x69c0('0x1c')]],'as':_0x43cb01['as'],'attributes':_0x43cb01[_0x69c0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ce34e){logger[_0x69c0('0xb')](_0x69c0('0x1f'),_0x2469c7);logger[_0x69c0('0x1d')](_0x69c0('0x1f'),_0x2469c7,JSON[_0x69c0('0x20')](_0x5ce34e));_0x1e69cf(_0x5ce34e);})[_0x69c0('0x1e')](function(_0x5e5c58){logger['error'](_0x69c0('0x1f'),_0x5e5c58[_0x69c0('0x11')],_0x2469c7);_0x2eb12d(_0x37f110[_0x69c0('0xf')](0x1f4,_0x5e5c58[_0x69c0('0x11')]));});});}; \ No newline at end of file +var _0x00bb=['options','raw','attributes','include','map','model','then','find','where','ShowSalesforceAccount','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','http','request','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SalesforceAccount,\x20%s,\x20%s','GetSalesforceAccount','findAll'];(function(_0x139d69,_0x530b2a){var _0x584c1a=function(_0x7bb73a){while(--_0x7bb73a){_0x139d69['push'](_0x139d69['shift']());}};_0x584c1a(++_0x530b2a);}(_0x00bb,0x1bc));var _0xb00b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x00bb[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xb00b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb00b('0x1'));var rs=require(_0xb00b('0x2'));var fs=require('fs');var Redis=require(_0xb00b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb00b('0x4'));var logger=require('../../config/logger')(_0xb00b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb00b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe8b50e,_0x104c1c,_0x526b4d){return new BPromise(function(_0x19a449,_0x2dafe6){return client[_0xb00b('0x7')](_0xe8b50e,_0x526b4d)['then'](function(_0x542013){logger[_0xb00b('0x8')]('SalesforceAccount,\x20%s,\x20%s',_0x104c1c,_0xb00b('0x9'));logger[_0xb00b('0xa')](_0xb00b('0xb'),_0x104c1c,'request\x20sent',JSON[_0xb00b('0xc')](_0x542013));if(_0x542013[_0xb00b('0xd')]){if(_0x542013['error'][_0xb00b('0xe')]===0x1f4){logger[_0xb00b('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x104c1c,_0x542013[_0xb00b('0xd')][_0xb00b('0xf')]);return _0x2dafe6(_0x542013[_0xb00b('0xd')]['message']);}logger[_0xb00b('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x104c1c,_0x542013['error']['message']);return _0x19a449(_0x542013['error'][_0xb00b('0xf')]);}else{logger[_0xb00b('0x8')]('SalesforceAccount,\x20%s,\x20%s',_0x104c1c,_0xb00b('0x9'));_0x19a449(_0x542013[_0xb00b('0x10')]['message']);}})[_0xb00b('0x11')](function(_0x1aabcd){logger[_0xb00b('0xd')](_0xb00b('0x12'),_0x104c1c,_0x1aabcd);_0x2dafe6(_0x1aabcd);});});}exports[_0xb00b('0x13')]=function(_0x211933){var _0x4c54c1=this;return new Promise(function(_0x56defe,_0x5d2d86){return db['SalesforceAccount'][_0xb00b('0x14')]({'raw':_0x211933['options']?_0x211933[_0xb00b('0x15')][_0xb00b('0x16')]===undefined?!![]:![]:!![],'where':_0x211933[_0xb00b('0x15')]?_0x211933[_0xb00b('0x15')]['where']||null:null,'attributes':_0x211933['options']?_0x211933[_0xb00b('0x15')][_0xb00b('0x17')]||null:null,'limit':_0x211933[_0xb00b('0x15')]?_0x211933['options']['limit']||null:null,'include':_0x211933['options']?_0x211933['options'][_0xb00b('0x18')]?_[_0xb00b('0x19')](_0x211933[_0xb00b('0x15')][_0xb00b('0x18')],function(_0xb14176){return{'model':db[_0xb14176[_0xb00b('0x1a')]],'as':_0xb14176['as'],'attributes':_0xb14176['attributes'],'include':_0xb14176['include']?_[_0xb00b('0x19')](_0xb14176[_0xb00b('0x18')],function(_0x4bd59a){return{'model':db[_0x4bd59a['model']],'as':_0x4bd59a['as'],'attributes':_0x4bd59a['attributes'],'include':_0x4bd59a[_0xb00b('0x18')]?_['map'](_0x4bd59a['include'],function(_0xf178a3){return{'model':db[_0xf178a3['model']],'as':_0xf178a3['as'],'attributes':_0xf178a3[_0xb00b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb00b('0x1b')](function(_0x267bcb){logger['info']('GetSalesforceAccount',_0x211933);logger['debug'](_0xb00b('0x13'),_0x211933,JSON[_0xb00b('0xc')](_0x267bcb));_0x56defe(_0x267bcb);})[_0xb00b('0x11')](function(_0x5b731a){logger[_0xb00b('0xd')](_0xb00b('0x13'),_0x5b731a[_0xb00b('0xf')],_0x211933);_0x5d2d86(_0x4c54c1[_0xb00b('0xd')](0x1f4,_0x5b731a[_0xb00b('0xf')]));});});};exports['ShowSalesforceAccount']=function(_0x839be1){var _0x2f3bac=this;return new Promise(function(_0x505cc8,_0x189a2c){return db['SalesforceAccount'][_0xb00b('0x1c')]({'raw':_0x839be1[_0xb00b('0x15')]?_0x839be1[_0xb00b('0x15')][_0xb00b('0x16')]===undefined?!![]:![]:!![],'where':_0x839be1[_0xb00b('0x15')]?_0x839be1[_0xb00b('0x15')][_0xb00b('0x1d')]||null:null,'attributes':_0x839be1['options']?_0x839be1[_0xb00b('0x15')][_0xb00b('0x17')]||null:null,'include':_0x839be1[_0xb00b('0x15')]?_0x839be1[_0xb00b('0x15')][_0xb00b('0x18')]?_[_0xb00b('0x19')](_0x839be1[_0xb00b('0x15')][_0xb00b('0x18')],function(_0x270387){return{'model':db[_0x270387['model']],'as':_0x270387['as'],'attributes':_0x270387['attributes'],'include':_0x270387[_0xb00b('0x18')]?_[_0xb00b('0x19')](_0x270387[_0xb00b('0x18')],function(_0x327c19){return{'model':db[_0x327c19[_0xb00b('0x1a')]],'as':_0x327c19['as'],'attributes':_0x327c19['attributes'],'include':_0x327c19[_0xb00b('0x18')]?_[_0xb00b('0x19')](_0x327c19[_0xb00b('0x18')],function(_0x5e9a54){return{'model':db[_0x5e9a54[_0xb00b('0x1a')]],'as':_0x5e9a54['as'],'attributes':_0x5e9a54[_0xb00b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb00b('0x1b')](function(_0x4f6a8b){logger[_0xb00b('0x8')](_0xb00b('0x1e'),_0x839be1);logger[_0xb00b('0xa')]('ShowSalesforceAccount',_0x839be1,JSON['stringify'](_0x4f6a8b));_0x505cc8(_0x4f6a8b);})[_0xb00b('0x11')](function(_0x2e62a0){logger[_0xb00b('0xd')](_0xb00b('0x1e'),_0x2e62a0[_0xb00b('0xf')],_0x839be1);_0x189a2c(_0x2f3bac[_0xb00b('0xd')](0x1f4,_0x2e62a0['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index cd2f3e7..a0e94cb 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x3b5fa8,_0x553f88){var _0x27a14b=function(_0x4130dc){while(--_0x4130dc){_0x3b5fa8['push'](_0x3b5fa8['shift']());}};_0x27a14b(++_0x553f88);}(_0xadb5,0xad));var _0x5adb=function(_0x5bca93,_0x342b1b){_0x5bca93=_0x5bca93-0x0;var _0x1528a8=_0xadb5[_0x5bca93];return _0x1528a8;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xdb28,0x106));var _0x8db2=function(_0x305d27,_0x36f302){_0x305d27=_0x305d27-0x0;var _0x39a24=_0xdb28[_0x305d27];return _0x39a24;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 18b4fde..87594c7 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 _0x53b2=['STRING','Task','ENUM','contact_lead','lead','account_contact_lead','account','contact','sequelize','exports'];(function(_0x1a2b9d,_0x514721){var _0x3d337a=function(_0x4da363){while(--_0x4da363){_0x1a2b9d['push'](_0x1a2b9d['shift']());}};_0x3d337a(++_0x514721);}(_0x53b2,0xa8));var _0x253b=function(_0x3455f4,_0x2cba3e){_0x3455f4=_0x3455f4-0x0;var _0xbef80a=_0x53b2[_0x3455f4];return _0xbef80a;};'use strict';var Sequelize=require(_0x253b('0x0'));module[_0x253b('0x1')]={'name':{'type':Sequelize[_0x253b('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x253b('0x3'),'Case'),'defaultValue':_0x253b('0x3')},'moduleSearch':{'type':Sequelize[_0x253b('0x4')](_0x253b('0x5'),'contact',_0x253b('0x6'),_0x253b('0x7'),_0x253b('0x8')),'defaultValue':_0x253b('0x5')},'moduleCreate':{'type':Sequelize[_0x253b('0x4')]('nothing',_0x253b('0x9'),'lead','account'),'defaultValue':_0x253b('0x6')},'leadId':{'type':Sequelize[_0x253b('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x253b('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x253b('0x2')]}}; \ No newline at end of file +var _0xebd3=['lead','account_contact_lead','account','nothing','sequelize','STRING','ENUM','Task','contact_lead','contact'];(function(_0x5133f1,_0x3eaf3f){var _0x112a3e=function(_0x5efd71){while(--_0x5efd71){_0x5133f1['push'](_0x5133f1['shift']());}};_0x112a3e(++_0x3eaf3f);}(_0xebd3,0x194));var _0x3ebd=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0xebd3[_0x29e2af];return _0x1ea06a;};'use strict';var Sequelize=require(_0x3ebd('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ebd('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3ebd('0x2')](_0x3ebd('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x3ebd('0x4'),_0x3ebd('0x5'),_0x3ebd('0x6'),_0x3ebd('0x7'),_0x3ebd('0x8')),'defaultValue':_0x3ebd('0x4')},'moduleCreate':{'type':Sequelize[_0x3ebd('0x2')](_0x3ebd('0x9'),_0x3ebd('0x5'),_0x3ebd('0x6'),'account'),'defaultValue':_0x3ebd('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x3ebd('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x3ebd('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x3ebd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1760e5b..49306f1 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 _0x0ef0=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','getFields','findOne','filter','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x44a579,_0x26614f){var _0x379023=function(_0x321d1b){while(--_0x321d1b){_0x44a579['push'](_0x44a579['shift']());}};_0x379023(++_0x26614f);}(_0x0ef0,0x12b));var _0x00ef=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x0ef0[_0x57b432];return _0x2edf2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00ef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00ef('0x1'));var rp=require('request-promise');var moment=require(_0x00ef('0x2'));var BPromise=require(_0x00ef('0x3'));var Mustache=require('mustache');var util=require(_0x00ef('0x4'));var path=require(_0x00ef('0x5'));var sox=require('sox');var csv=require(_0x00ef('0x6'));var ejs=require(_0x00ef('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00ef('0x8'));var squel=require(_0x00ef('0x9'));var crypto=require(_0x00ef('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x00ef('0xb'));var toCsv=require(_0x00ef('0x6'));var querystring=require('querystring');var Papa=require(_0x00ef('0xc'));var Redis=require('ioredis');var authService=require(_0x00ef('0xd'));var qs=require(_0x00ef('0xe'));var as=require(_0x00ef('0xf'));var hardwareService=require(_0x00ef('0x10'));var logger=require('../../config/logger')(_0x00ef('0x11'));var utils=require(_0x00ef('0x12'));var config=require(_0x00ef('0x13'));var licenseUtil=require(_0x00ef('0x14'));var db=require(_0x00ef('0x15'))['db'];function respondWithStatusCode(_0x2fc958,_0x21a3ed){_0x21a3ed=_0x21a3ed||0xcc;return function(_0x54c30c){if(_0x54c30c){return _0x2fc958[_0x00ef('0x16')](_0x21a3ed);}return _0x2fc958[_0x00ef('0x17')](_0x21a3ed)[_0x00ef('0x18')]();};}function respondWithResult(_0x2212a3,_0x52b728){_0x52b728=_0x52b728||0xc8;return function(_0x11e0ea){if(_0x11e0ea){return _0x2212a3[_0x00ef('0x17')](_0x52b728)['json'](_0x11e0ea);}};}function respondWithFilteredResult(_0x582516,_0x1e52b5){return function(_0x4fad23){if(_0x4fad23){var _0x2e8c0a=typeof _0x1e52b5[_0x00ef('0x19')]===_0x00ef('0x1a')&&typeof _0x1e52b5[_0x00ef('0x1b')]===_0x00ef('0x1a');var _0xb617d3=_0x4fad23[_0x00ef('0x1c')];var _0x4afb89=_0x2e8c0a?0x0:_0x1e52b5[_0x00ef('0x19')];var _0xbd435a=_0x2e8c0a?_0x4fad23[_0x00ef('0x1c')]:_0x1e52b5[_0x00ef('0x19')]+_0x1e52b5[_0x00ef('0x1b')];var _0x30e6f8;if(_0xbd435a>=_0xb617d3){_0xbd435a=_0xb617d3;_0x30e6f8=0xc8;}else{_0x30e6f8=0xce;}_0x582516[_0x00ef('0x17')](_0x30e6f8);return _0x582516['set'](_0x00ef('0x1d'),_0x4afb89+'-'+_0xbd435a+'/'+_0xb617d3)[_0x00ef('0x1e')](_0x4fad23);}return null;};}function patchUpdates(_0x238536){return function(_0x2cd41c){try{jsonpatch[_0x00ef('0x1f')](_0x2cd41c,_0x238536,!![]);}catch(_0xeadf1){return BPromise[_0x00ef('0x20')](_0xeadf1);}return _0x2cd41c[_0x00ef('0x21')]();};}function saveUpdates(_0x25f280,_0x18d75b){return function(_0x4f84b7){if(_0x4f84b7){return _0x4f84b7[_0x00ef('0x22')](_0x25f280)[_0x00ef('0x23')](function(_0x1defdb){return _0x1defdb;});}return null;};}function removeEntity(_0x273701,_0x2e900a){return function(_0x3de34){if(_0x3de34){return _0x3de34[_0x00ef('0x24')]()['then'](function(){_0x273701[_0x00ef('0x17')](0xcc)[_0x00ef('0x18')]();});}};}function handleEntityNotFound(_0x390d2d,_0x29cf07){return function(_0x4a2a01){if(!_0x4a2a01){_0x390d2d[_0x00ef('0x16')](0x194);}return _0x4a2a01;};}function handleError(_0x30ba37,_0x20e0c2){_0x20e0c2=_0x20e0c2||0x1f4;return function(_0x3a7f2e){logger[_0x00ef('0x25')](_0x3a7f2e[_0x00ef('0x26')]);if(_0x3a7f2e[_0x00ef('0x27')]){delete _0x3a7f2e['name'];}_0x30ba37['status'](_0x20e0c2)[_0x00ef('0x28')](_0x3a7f2e);};}exports[_0x00ef('0x29')]=function(_0x3e7085,_0x1a2ba3){var _0x1c79d3={},_0x49e14f={},_0x28bdd5={'count':0x0,'rows':[]};var _0x3c250f=_[_0x00ef('0x2a')](db[_0x00ef('0x2b')][_0x00ef('0x2c')],function(_0x9d7487){return{'name':_0x9d7487[_0x00ef('0x2d')],'type':_0x9d7487[_0x00ef('0x2e')][_0x00ef('0x2f')]};});_0x49e14f['model']=_[_0x00ef('0x2a')](_0x3c250f,_0x00ef('0x27'));_0x49e14f['query']=_[_0x00ef('0x30')](_0x3e7085[_0x00ef('0x31')]);_0x49e14f[_0x00ef('0x32')]=_[_0x00ef('0x33')](_0x49e14f['model'],_0x49e14f[_0x00ef('0x31')]);_0x1c79d3[_0x00ef('0x34')]=_[_0x00ef('0x33')](_0x49e14f[_0x00ef('0x35')],qs[_0x00ef('0x36')](_0x3e7085[_0x00ef('0x31')][_0x00ef('0x36')]));_0x1c79d3[_0x00ef('0x34')]=_0x1c79d3['attributes'][_0x00ef('0x37')]?_0x1c79d3[_0x00ef('0x34')]:_0x49e14f['model'];if(!_0x3e7085[_0x00ef('0x31')]['hasOwnProperty'](_0x00ef('0x38'))){_0x1c79d3[_0x00ef('0x1b')]=qs[_0x00ef('0x1b')](_0x3e7085['query'][_0x00ef('0x1b')]);_0x1c79d3[_0x00ef('0x19')]=qs['offset'](_0x3e7085[_0x00ef('0x31')]['offset']);}_0x1c79d3[_0x00ef('0x39')]=qs[_0x00ef('0x3a')](_0x3e7085[_0x00ef('0x31')][_0x00ef('0x3a')]);_0x1c79d3[_0x00ef('0x3b')]=qs[_0x00ef('0x32')](_[_0x00ef('0x3c')](_0x3e7085[_0x00ef('0x31')],_0x49e14f['filters']),_0x3c250f);if(_0x3e7085[_0x00ef('0x31')]['filter']){_0x1c79d3[_0x00ef('0x3b')]=_[_0x00ef('0x3d')](_0x1c79d3[_0x00ef('0x3b')],{'$or':_[_0x00ef('0x2a')](_0x3c250f,function(_0x5c2526){if(_0x5c2526[_0x00ef('0x2e')]!==_0x00ef('0x3e')){var _0x591089={};_0x591089[_0x5c2526[_0x00ef('0x27')]]={'$like':'%'+_0x3e7085[_0x00ef('0x31')]['filter']+'%'};return _0x591089;}})});}_0x1c79d3=_[_0x00ef('0x3d')]({},_0x1c79d3,_0x3e7085[_0x00ef('0x3f')]);var _0x2f6bcf={'where':_0x1c79d3[_0x00ef('0x3b')]};return db['SalesforceConfiguration'][_0x00ef('0x1c')](_0x2f6bcf)['then'](function(_0x1f5373){_0x28bdd5[_0x00ef('0x1c')]=_0x1f5373;if(_0x3e7085[_0x00ef('0x31')]['includeAll']){_0x1c79d3[_0x00ef('0x40')]=[{'all':!![]}];}return db[_0x00ef('0x2b')][_0x00ef('0x41')](_0x1c79d3);})[_0x00ef('0x23')](function(_0x15120f){_0x28bdd5[_0x00ef('0x42')]=_0x15120f;return _0x28bdd5;})[_0x00ef('0x23')](respondWithFilteredResult(_0x1a2ba3,_0x1c79d3))[_0x00ef('0x43')](handleError(_0x1a2ba3,null));};exports['show']=function(_0x327d05,_0x324bc2){var _0x293b65={'raw':![],'where':{'id':_0x327d05[_0x00ef('0x44')]['id']}},_0x1d49f9={};_0x1d49f9[_0x00ef('0x35')]=_['keys'](db['SalesforceConfiguration'][_0x00ef('0x2c')]);_0x1d49f9['query']=_[_0x00ef('0x30')](_0x327d05[_0x00ef('0x31')]);_0x1d49f9[_0x00ef('0x32')]=_[_0x00ef('0x33')](_0x1d49f9[_0x00ef('0x35')],_0x1d49f9[_0x00ef('0x31')]);_0x293b65[_0x00ef('0x34')]=_[_0x00ef('0x33')](_0x1d49f9[_0x00ef('0x35')],qs[_0x00ef('0x36')](_0x327d05['query']['fields']));_0x293b65[_0x00ef('0x34')]=_0x293b65['attributes'][_0x00ef('0x37')]?_0x293b65[_0x00ef('0x34')]:_0x1d49f9['model'];if(_0x327d05[_0x00ef('0x31')][_0x00ef('0x45')]){_0x293b65[_0x00ef('0x40')]=[{'all':!![]}];}_0x293b65=_['merge']({},_0x293b65,_0x327d05[_0x00ef('0x3f')]);return db[_0x00ef('0x2b')][_0x00ef('0x46')](_0x293b65)[_0x00ef('0x23')](handleEntityNotFound(_0x324bc2,null))[_0x00ef('0x23')](respondWithResult(_0x324bc2,null))[_0x00ef('0x43')](handleError(_0x324bc2,null));};exports[_0x00ef('0x47')]=function(_0x4bc8a6,_0x38f4ab){return db[_0x00ef('0x2b')][_0x00ef('0x47')](_0x4bc8a6[_0x00ef('0x48')],{})[_0x00ef('0x23')](respondWithResult(_0x38f4ab,0xc9))['catch'](handleError(_0x38f4ab,null));};exports[_0x00ef('0x22')]=function(_0xf18ed1,_0x197a38){if(_0xf18ed1['body']['id']){delete _0xf18ed1['body']['id'];}return db[_0x00ef('0x2b')][_0x00ef('0x46')]({'where':{'id':_0xf18ed1[_0x00ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x197a38,null))[_0x00ef('0x23')](saveUpdates(_0xf18ed1[_0x00ef('0x48')],null))[_0x00ef('0x23')](respondWithResult(_0x197a38,null))['catch'](handleError(_0x197a38,null));};exports['destroy']=function(_0x239d2e,_0x36f501){return db['SalesforceConfiguration']['find']({'where':{'id':_0x239d2e[_0x00ef('0x44')]['id']}})[_0x00ef('0x23')](handleEntityNotFound(_0x36f501,null))[_0x00ef('0x23')](removeEntity(_0x36f501,null))['catch'](handleError(_0x36f501,null));};exports[_0x00ef('0x49')]=function(_0x2ebfe3,_0x5ec095,_0x15d123){var _0x451504={};var _0x13b3aa={};var _0x2e59af;var _0x21053a;return db[_0x00ef('0x2b')][_0x00ef('0x4a')]({'where':{'id':_0x2ebfe3[_0x00ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ec095,null))['then'](function(_0xecdf4d){if(_0xecdf4d){_0x2e59af=_0xecdf4d;_0x13b3aa[_0x00ef('0x35')]=_['keys'](db['SalesforceField'][_0x00ef('0x2c')]);_0x13b3aa[_0x00ef('0x31')]=_['keys'](_0x2ebfe3[_0x00ef('0x31')]);_0x13b3aa[_0x00ef('0x32')]=_[_0x00ef('0x33')](_0x13b3aa[_0x00ef('0x35')],_0x13b3aa[_0x00ef('0x31')]);_0x451504[_0x00ef('0x34')]=_[_0x00ef('0x33')](_0x13b3aa['model'],qs['fields'](_0x2ebfe3[_0x00ef('0x31')][_0x00ef('0x36')]));_0x451504[_0x00ef('0x34')]=_0x451504['attributes'][_0x00ef('0x37')]?_0x451504[_0x00ef('0x34')]:_0x13b3aa['model'];_0x451504['order']=qs[_0x00ef('0x3a')](_0x2ebfe3[_0x00ef('0x31')][_0x00ef('0x3a')]);_0x451504['where']=qs[_0x00ef('0x32')](_[_0x00ef('0x3c')](_0x2ebfe3[_0x00ef('0x31')],_0x13b3aa['filters']));if(_0x2ebfe3['query'][_0x00ef('0x4b')]){_0x451504['where']=_['merge'](_0x451504[_0x00ef('0x3b')],{'$or':_[_0x00ef('0x2a')](_0x451504[_0x00ef('0x34')],function(_0x5a2420){var _0x2a030a={};_0x2a030a[_0x5a2420]={'$like':'%'+_0x2ebfe3[_0x00ef('0x31')]['filter']+'%'};return _0x2a030a;})});}_0x451504=_[_0x00ef('0x3d')]({},_0x451504,_0x2ebfe3[_0x00ef('0x3f')]);return _0x2e59af[_0x00ef('0x49')](_0x451504);}})[_0x00ef('0x23')](function(_0x118449){if(_0x118449){_0x21053a=_0x118449[_0x00ef('0x37')];if(!_0x2ebfe3[_0x00ef('0x31')][_0x00ef('0x4c')](_0x00ef('0x38'))){_0x451504[_0x00ef('0x1b')]=qs['limit'](_0x2ebfe3['query'][_0x00ef('0x1b')]);_0x451504['offset']=qs['offset'](_0x2ebfe3[_0x00ef('0x31')]['offset']);}return _0x2e59af['getFields'](_0x451504);}})[_0x00ef('0x23')](function(_0x2fc66c){if(_0x2fc66c){return _0x2fc66c?{'count':_0x21053a,'rows':_0x2fc66c}:null;}})[_0x00ef('0x23')](respondWithResult(_0x5ec095,null))[_0x00ef('0x43')](handleError(_0x5ec095,null));};exports[_0x00ef('0x4d')]=function(_0x298786,_0x343742,_0x1ec6ff){var _0x23d81b={};var _0xc1f21={};var _0x2a7eec;var _0x576eb4;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x298786['params']['id']}})[_0x00ef('0x23')](handleEntityNotFound(_0x343742,null))[_0x00ef('0x23')](function(_0x460551){if(_0x460551){_0x2a7eec=_0x460551;_0xc1f21[_0x00ef('0x35')]=_[_0x00ef('0x30')](db[_0x00ef('0x4e')][_0x00ef('0x2c')]);_0xc1f21['query']=_[_0x00ef('0x30')](_0x298786['query']);_0xc1f21[_0x00ef('0x32')]=_[_0x00ef('0x33')](_0xc1f21[_0x00ef('0x35')],_0xc1f21[_0x00ef('0x31')]);_0x23d81b[_0x00ef('0x34')]=_[_0x00ef('0x33')](_0xc1f21[_0x00ef('0x35')],qs[_0x00ef('0x36')](_0x298786['query']['fields']));_0x23d81b['attributes']=_0x23d81b[_0x00ef('0x34')][_0x00ef('0x37')]?_0x23d81b['attributes']:_0xc1f21[_0x00ef('0x35')];_0x23d81b[_0x00ef('0x39')]=qs['sort'](_0x298786['query'][_0x00ef('0x3a')]);_0x23d81b[_0x00ef('0x3b')]=qs[_0x00ef('0x32')](_[_0x00ef('0x3c')](_0x298786[_0x00ef('0x31')],_0xc1f21[_0x00ef('0x32')]));if(_0x298786[_0x00ef('0x31')]['filter']){_0x23d81b['where']=_[_0x00ef('0x3d')](_0x23d81b['where'],{'$or':_[_0x00ef('0x2a')](_0x23d81b['attributes'],function(_0x4f6ef8){var _0x2bc4a1={};_0x2bc4a1[_0x4f6ef8]={'$like':'%'+_0x298786[_0x00ef('0x31')][_0x00ef('0x4b')]+'%'};return _0x2bc4a1;})});}_0x23d81b=_['merge']({},_0x23d81b,_0x298786[_0x00ef('0x3f')]);return _0x2a7eec[_0x00ef('0x4d')](_0x23d81b);}})['then'](function(_0xe63bcf){if(_0xe63bcf){_0x576eb4=_0xe63bcf[_0x00ef('0x37')];if(!_0x298786['query'][_0x00ef('0x4c')]('nolimit')){_0x23d81b[_0x00ef('0x1b')]=qs[_0x00ef('0x1b')](_0x298786[_0x00ef('0x31')]['limit']);_0x23d81b['offset']=qs[_0x00ef('0x19')](_0x298786[_0x00ef('0x31')][_0x00ef('0x19')]);}return _0x2a7eec[_0x00ef('0x4d')](_0x23d81b);}})[_0x00ef('0x23')](function(_0x1c5806){if(_0x1c5806){return _0x1c5806?{'count':_0x576eb4,'rows':_0x1c5806}:null;}})[_0x00ef('0x23')](respondWithResult(_0x343742,null))['catch'](handleError(_0x343742,null));};exports[_0x00ef('0x4f')]=function(_0x49ecb3,_0x50f023,_0x2aebf9){var _0xfe0a44={};var _0x4960d3={};var _0x4ed1dc;var _0x6448d6;return db[_0x00ef('0x2b')][_0x00ef('0x4a')]({'where':{'id':_0x49ecb3['params']['id']}})[_0x00ef('0x23')](handleEntityNotFound(_0x50f023,null))[_0x00ef('0x23')](function(_0x48610e){if(_0x48610e){_0x4ed1dc=_0x48610e;_0x4960d3[_0x00ef('0x35')]=_[_0x00ef('0x30')](db[_0x00ef('0x4e')][_0x00ef('0x2c')]);_0x4960d3[_0x00ef('0x31')]=_['keys'](_0x49ecb3[_0x00ef('0x31')]);_0x4960d3[_0x00ef('0x32')]=_[_0x00ef('0x33')](_0x4960d3['model'],_0x4960d3[_0x00ef('0x31')]);_0xfe0a44[_0x00ef('0x34')]=_[_0x00ef('0x33')](_0x4960d3['model'],qs[_0x00ef('0x36')](_0x49ecb3[_0x00ef('0x31')][_0x00ef('0x36')]));_0xfe0a44[_0x00ef('0x34')]=_0xfe0a44['attributes']['length']?_0xfe0a44['attributes']:_0x4960d3[_0x00ef('0x35')];_0xfe0a44[_0x00ef('0x39')]=qs[_0x00ef('0x3a')](_0x49ecb3[_0x00ef('0x31')][_0x00ef('0x3a')]);_0xfe0a44['where']=qs['filters'](_['pick'](_0x49ecb3[_0x00ef('0x31')],_0x4960d3[_0x00ef('0x32')]));if(_0x49ecb3[_0x00ef('0x31')]['filter']){_0xfe0a44[_0x00ef('0x3b')]=_[_0x00ef('0x3d')](_0xfe0a44[_0x00ef('0x3b')],{'$or':_[_0x00ef('0x2a')](_0xfe0a44[_0x00ef('0x34')],function(_0x5864a9){var _0x572790={};_0x572790[_0x5864a9]={'$like':'%'+_0x49ecb3['query'][_0x00ef('0x4b')]+'%'};return _0x572790;})});}_0xfe0a44=_[_0x00ef('0x3d')]({},_0xfe0a44,_0x49ecb3['options']);return _0x4ed1dc[_0x00ef('0x4f')](_0xfe0a44);}})['then'](function(_0x565607){if(_0x565607){_0x6448d6=_0x565607['length'];if(!_0x49ecb3[_0x00ef('0x31')]['hasOwnProperty'](_0x00ef('0x38'))){_0xfe0a44[_0x00ef('0x1b')]=qs['limit'](_0x49ecb3[_0x00ef('0x31')][_0x00ef('0x1b')]);_0xfe0a44[_0x00ef('0x19')]=qs[_0x00ef('0x19')](_0x49ecb3[_0x00ef('0x31')][_0x00ef('0x19')]);}return _0x4ed1dc['getDescriptions'](_0xfe0a44);}})[_0x00ef('0x23')](function(_0x5dfec1){if(_0x5dfec1){return _0x5dfec1?{'count':_0x6448d6,'rows':_0x5dfec1}:null;}})[_0x00ef('0x23')](respondWithResult(_0x50f023,null))[_0x00ef('0x43')](handleError(_0x50f023,null));}; \ No newline at end of file +var _0xb66b=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','update','then','error','name','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','destroy','findOne','pick','getFields','nolimit','getSubjects','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x40de6f,_0x3d5f9c){var _0x44a887=function(_0x2d6564){while(--_0x2d6564){_0x40de6f['push'](_0x40de6f['shift']());}};_0x44a887(++_0x3d5f9c);}(_0xb66b,0x9a));var _0xbb66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb66b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb66('0x0'));var zipdir=require(_0xbb66('0x1'));var jsonpatch=require(_0xbb66('0x2'));var rp=require(_0xbb66('0x3'));var moment=require('moment');var BPromise=require(_0xbb66('0x4'));var Mustache=require(_0xbb66('0x5'));var util=require(_0xbb66('0x6'));var path=require(_0xbb66('0x7'));var sox=require(_0xbb66('0x8'));var csv=require('to-csv');var ejs=require(_0xbb66('0x9'));var fs=require('fs');var fs_extra=require(_0xbb66('0xa'));var _=require(_0xbb66('0xb'));var squel=require(_0xbb66('0xc'));var crypto=require(_0xbb66('0xd'));var jsforce=require(_0xbb66('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbb66('0xf'));var querystring=require(_0xbb66('0x10'));var Papa=require('papaparse');var Redis=require(_0xbb66('0x11'));var authService=require(_0xbb66('0x12'));var qs=require(_0xbb66('0x13'));var as=require(_0xbb66('0x14'));var hardwareService=require(_0xbb66('0x15'));var logger=require(_0xbb66('0x16'))(_0xbb66('0x17'));var utils=require(_0xbb66('0x18'));var config=require(_0xbb66('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43622c,_0x42d6cb){_0x42d6cb=_0x42d6cb||0xcc;return function(_0x3b4923){if(_0x3b4923){return _0x43622c[_0xbb66('0x1a')](_0x42d6cb);}return _0x43622c[_0xbb66('0x1b')](_0x42d6cb)[_0xbb66('0x1c')]();};}function respondWithResult(_0x517499,_0x42afce){_0x42afce=_0x42afce||0xc8;return function(_0x43a14e){if(_0x43a14e){return _0x517499[_0xbb66('0x1b')](_0x42afce)['json'](_0x43a14e);}};}function respondWithFilteredResult(_0x4e6f4e,_0x3b6f01){return function(_0x1d5ac2){if(_0x1d5ac2){var _0x2fe584=typeof _0x3b6f01['offset']===_0xbb66('0x1d')&&typeof _0x3b6f01[_0xbb66('0x1e')]===_0xbb66('0x1d');var _0x3aac08=_0x1d5ac2[_0xbb66('0x1f')];var _0x3636cb=_0x2fe584?0x0:_0x3b6f01['offset'];var _0x524540=_0x2fe584?_0x1d5ac2[_0xbb66('0x1f')]:_0x3b6f01[_0xbb66('0x20')]+_0x3b6f01[_0xbb66('0x1e')];var _0x3cb98b;if(_0x524540>=_0x3aac08){_0x524540=_0x3aac08;_0x3cb98b=0xc8;}else{_0x3cb98b=0xce;}_0x4e6f4e[_0xbb66('0x1b')](_0x3cb98b);return _0x4e6f4e[_0xbb66('0x21')]('Content-Range',_0x3636cb+'-'+_0x524540+'/'+_0x3aac08)[_0xbb66('0x22')](_0x1d5ac2);}return null;};}function patchUpdates(_0x1268ce){return function(_0x79c69c){try{jsonpatch[_0xbb66('0x23')](_0x79c69c,_0x1268ce,!![]);}catch(_0x44667b){return BPromise['reject'](_0x44667b);}return _0x79c69c['save']();};}function saveUpdates(_0x90159a,_0x38b8b0){return function(_0x85e0f9){if(_0x85e0f9){return _0x85e0f9[_0xbb66('0x24')](_0x90159a)[_0xbb66('0x25')](function(_0x5f11ad){return _0x5f11ad;});}return null;};}function removeEntity(_0x1bc17f,_0x370dcd){return function(_0xbdde8){if(_0xbdde8){return _0xbdde8['destroy']()[_0xbb66('0x25')](function(){_0x1bc17f[_0xbb66('0x1b')](0xcc)[_0xbb66('0x1c')]();});}};}function handleEntityNotFound(_0x226003,_0x120b77){return function(_0x5b8b60){if(!_0x5b8b60){_0x226003[_0xbb66('0x1a')](0x194);}return _0x5b8b60;};}function handleError(_0x4a8003,_0xab4dee){_0xab4dee=_0xab4dee||0x1f4;return function(_0x203b40){logger[_0xbb66('0x26')](_0x203b40['stack']);if(_0x203b40[_0xbb66('0x27')]){delete _0x203b40[_0xbb66('0x27')];}_0x4a8003[_0xbb66('0x1b')](_0xab4dee)['send'](_0x203b40);};}exports['index']=function(_0x2268af,_0x115949){var _0x507acf={},_0x143e1f={},_0x2e78d8={'count':0x0,'rows':[]};var _0x32c843=_['map'](db[_0xbb66('0x28')][_0xbb66('0x29')],function(_0x1ce773){return{'name':_0x1ce773[_0xbb66('0x2a')],'type':_0x1ce773[_0xbb66('0x2b')][_0xbb66('0x2c')]};});_0x143e1f[_0xbb66('0x2d')]=_[_0xbb66('0x2e')](_0x32c843,_0xbb66('0x27'));_0x143e1f[_0xbb66('0x2f')]=_[_0xbb66('0x30')](_0x2268af[_0xbb66('0x2f')]);_0x143e1f[_0xbb66('0x31')]=_[_0xbb66('0x32')](_0x143e1f[_0xbb66('0x2d')],_0x143e1f['query']);_0x507acf['attributes']=_['intersection'](_0x143e1f['model'],qs[_0xbb66('0x33')](_0x2268af['query'][_0xbb66('0x33')]));_0x507acf['attributes']=_0x507acf[_0xbb66('0x34')][_0xbb66('0x35')]?_0x507acf['attributes']:_0x143e1f[_0xbb66('0x2d')];if(!_0x2268af[_0xbb66('0x2f')][_0xbb66('0x36')]('nolimit')){_0x507acf[_0xbb66('0x1e')]=qs['limit'](_0x2268af[_0xbb66('0x2f')]['limit']);_0x507acf[_0xbb66('0x20')]=qs[_0xbb66('0x20')](_0x2268af[_0xbb66('0x2f')][_0xbb66('0x20')]);}_0x507acf[_0xbb66('0x37')]=qs[_0xbb66('0x38')](_0x2268af[_0xbb66('0x2f')]['sort']);_0x507acf[_0xbb66('0x39')]=qs[_0xbb66('0x31')](_['pick'](_0x2268af[_0xbb66('0x2f')],_0x143e1f[_0xbb66('0x31')]),_0x32c843);if(_0x2268af[_0xbb66('0x2f')][_0xbb66('0x3a')]){_0x507acf[_0xbb66('0x39')]=_['merge'](_0x507acf[_0xbb66('0x39')],{'$or':_['map'](_0x32c843,function(_0xcc610d){if(_0xcc610d[_0xbb66('0x2b')]!==_0xbb66('0x3b')){var _0x540d71={};_0x540d71[_0xcc610d[_0xbb66('0x27')]]={'$like':'%'+_0x2268af[_0xbb66('0x2f')]['filter']+'%'};return _0x540d71;}})});}_0x507acf=_['merge']({},_0x507acf,_0x2268af[_0xbb66('0x3c')]);var _0x3fad68={'where':_0x507acf[_0xbb66('0x39')]};return db[_0xbb66('0x28')][_0xbb66('0x1f')](_0x3fad68)['then'](function(_0x2a490c){_0x2e78d8[_0xbb66('0x1f')]=_0x2a490c;if(_0x2268af['query'][_0xbb66('0x3d')]){_0x507acf[_0xbb66('0x3e')]=[{'all':!![]}];}return db[_0xbb66('0x28')]['findAll'](_0x507acf);})[_0xbb66('0x25')](function(_0x2e9418){_0x2e78d8[_0xbb66('0x3f')]=_0x2e9418;return _0x2e78d8;})[_0xbb66('0x25')](respondWithFilteredResult(_0x115949,_0x507acf))[_0xbb66('0x40')](handleError(_0x115949,null));};exports[_0xbb66('0x41')]=function(_0x78f707,_0x14f45a){var _0x1e5c3d={'raw':![],'where':{'id':_0x78f707[_0xbb66('0x42')]['id']}},_0x2de4dd={};_0x2de4dd['model']=_[_0xbb66('0x30')](db[_0xbb66('0x28')][_0xbb66('0x29')]);_0x2de4dd[_0xbb66('0x2f')]=_[_0xbb66('0x30')](_0x78f707[_0xbb66('0x2f')]);_0x2de4dd[_0xbb66('0x31')]=_['intersection'](_0x2de4dd['model'],_0x2de4dd[_0xbb66('0x2f')]);_0x1e5c3d[_0xbb66('0x34')]=_['intersection'](_0x2de4dd[_0xbb66('0x2d')],qs[_0xbb66('0x33')](_0x78f707[_0xbb66('0x2f')]['fields']));_0x1e5c3d[_0xbb66('0x34')]=_0x1e5c3d[_0xbb66('0x34')][_0xbb66('0x35')]?_0x1e5c3d[_0xbb66('0x34')]:_0x2de4dd[_0xbb66('0x2d')];if(_0x78f707[_0xbb66('0x2f')][_0xbb66('0x3d')]){_0x1e5c3d['include']=[{'all':!![]}];}_0x1e5c3d=_[_0xbb66('0x43')]({},_0x1e5c3d,_0x78f707[_0xbb66('0x3c')]);return db[_0xbb66('0x28')][_0xbb66('0x44')](_0x1e5c3d)['then'](handleEntityNotFound(_0x14f45a,null))['then'](respondWithResult(_0x14f45a,null))[_0xbb66('0x40')](handleError(_0x14f45a,null));};exports[_0xbb66('0x45')]=function(_0x446c76,_0x308eeb){return db[_0xbb66('0x28')][_0xbb66('0x45')](_0x446c76[_0xbb66('0x46')],{})[_0xbb66('0x25')](respondWithResult(_0x308eeb,0xc9))[_0xbb66('0x40')](handleError(_0x308eeb,null));};exports[_0xbb66('0x24')]=function(_0x2c7235,_0x587d8b){if(_0x2c7235[_0xbb66('0x46')]['id']){delete _0x2c7235[_0xbb66('0x46')]['id'];}return db[_0xbb66('0x28')][_0xbb66('0x44')]({'where':{'id':_0x2c7235[_0xbb66('0x42')]['id']}})[_0xbb66('0x25')](handleEntityNotFound(_0x587d8b,null))['then'](saveUpdates(_0x2c7235[_0xbb66('0x46')],null))[_0xbb66('0x25')](respondWithResult(_0x587d8b,null))[_0xbb66('0x40')](handleError(_0x587d8b,null));};exports[_0xbb66('0x47')]=function(_0x55f27d,_0xd4011d){return db[_0xbb66('0x28')]['find']({'where':{'id':_0x55f27d['params']['id']}})[_0xbb66('0x25')](handleEntityNotFound(_0xd4011d,null))[_0xbb66('0x25')](removeEntity(_0xd4011d,null))[_0xbb66('0x40')](handleError(_0xd4011d,null));};exports['getFields']=function(_0x23ec08,_0x4e1227,_0xf9d470){var _0x790227={};var _0x1117a7={};var _0x5e253e;var _0xd92141;return db[_0xbb66('0x28')][_0xbb66('0x48')]({'where':{'id':_0x23ec08[_0xbb66('0x42')]['id']}})[_0xbb66('0x25')](handleEntityNotFound(_0x4e1227,null))[_0xbb66('0x25')](function(_0x3ea846){if(_0x3ea846){_0x5e253e=_0x3ea846;_0x1117a7[_0xbb66('0x2d')]=_[_0xbb66('0x30')](db['SalesforceField']['rawAttributes']);_0x1117a7['query']=_['keys'](_0x23ec08[_0xbb66('0x2f')]);_0x1117a7[_0xbb66('0x31')]=_[_0xbb66('0x32')](_0x1117a7[_0xbb66('0x2d')],_0x1117a7[_0xbb66('0x2f')]);_0x790227[_0xbb66('0x34')]=_[_0xbb66('0x32')](_0x1117a7['model'],qs['fields'](_0x23ec08[_0xbb66('0x2f')]['fields']));_0x790227['attributes']=_0x790227['attributes'][_0xbb66('0x35')]?_0x790227[_0xbb66('0x34')]:_0x1117a7[_0xbb66('0x2d')];_0x790227[_0xbb66('0x37')]=qs[_0xbb66('0x38')](_0x23ec08[_0xbb66('0x2f')][_0xbb66('0x38')]);_0x790227['where']=qs[_0xbb66('0x31')](_[_0xbb66('0x49')](_0x23ec08[_0xbb66('0x2f')],_0x1117a7[_0xbb66('0x31')]));if(_0x23ec08[_0xbb66('0x2f')]['filter']){_0x790227[_0xbb66('0x39')]=_[_0xbb66('0x43')](_0x790227[_0xbb66('0x39')],{'$or':_[_0xbb66('0x2e')](_0x790227[_0xbb66('0x34')],function(_0x1d15cc){var _0x19ee7f={};_0x19ee7f[_0x1d15cc]={'$like':'%'+_0x23ec08[_0xbb66('0x2f')][_0xbb66('0x3a')]+'%'};return _0x19ee7f;})});}_0x790227=_[_0xbb66('0x43')]({},_0x790227,_0x23ec08['options']);return _0x5e253e[_0xbb66('0x4a')](_0x790227);}})['then'](function(_0x4d0fc0){if(_0x4d0fc0){_0xd92141=_0x4d0fc0[_0xbb66('0x35')];if(!_0x23ec08[_0xbb66('0x2f')][_0xbb66('0x36')](_0xbb66('0x4b'))){_0x790227[_0xbb66('0x1e')]=qs[_0xbb66('0x1e')](_0x23ec08[_0xbb66('0x2f')][_0xbb66('0x1e')]);_0x790227[_0xbb66('0x20')]=qs['offset'](_0x23ec08[_0xbb66('0x2f')][_0xbb66('0x20')]);}return _0x5e253e['getFields'](_0x790227);}})[_0xbb66('0x25')](function(_0x2f7380){if(_0x2f7380){return _0x2f7380?{'count':_0xd92141,'rows':_0x2f7380}:null;}})[_0xbb66('0x25')](respondWithResult(_0x4e1227,null))[_0xbb66('0x40')](handleError(_0x4e1227,null));};exports[_0xbb66('0x4c')]=function(_0x5086b5,_0x1d2133,_0x5539d5){var _0x2e36c4={};var _0x5a7d18={};var _0x161428;var _0x4bb501;return db[_0xbb66('0x28')][_0xbb66('0x48')]({'where':{'id':_0x5086b5[_0xbb66('0x42')]['id']}})[_0xbb66('0x25')](handleEntityNotFound(_0x1d2133,null))[_0xbb66('0x25')](function(_0x3e29d4){if(_0x3e29d4){_0x161428=_0x3e29d4;_0x5a7d18[_0xbb66('0x2d')]=_[_0xbb66('0x30')](db[_0xbb66('0x4d')]['rawAttributes']);_0x5a7d18[_0xbb66('0x2f')]=_[_0xbb66('0x30')](_0x5086b5[_0xbb66('0x2f')]);_0x5a7d18[_0xbb66('0x31')]=_[_0xbb66('0x32')](_0x5a7d18[_0xbb66('0x2d')],_0x5a7d18['query']);_0x2e36c4['attributes']=_[_0xbb66('0x32')](_0x5a7d18[_0xbb66('0x2d')],qs[_0xbb66('0x33')](_0x5086b5[_0xbb66('0x2f')][_0xbb66('0x33')]));_0x2e36c4['attributes']=_0x2e36c4[_0xbb66('0x34')]['length']?_0x2e36c4[_0xbb66('0x34')]:_0x5a7d18[_0xbb66('0x2d')];_0x2e36c4[_0xbb66('0x37')]=qs[_0xbb66('0x38')](_0x5086b5[_0xbb66('0x2f')][_0xbb66('0x38')]);_0x2e36c4[_0xbb66('0x39')]=qs[_0xbb66('0x31')](_[_0xbb66('0x49')](_0x5086b5[_0xbb66('0x2f')],_0x5a7d18[_0xbb66('0x31')]));if(_0x5086b5[_0xbb66('0x2f')]['filter']){_0x2e36c4[_0xbb66('0x39')]=_[_0xbb66('0x43')](_0x2e36c4['where'],{'$or':_[_0xbb66('0x2e')](_0x2e36c4[_0xbb66('0x34')],function(_0x2ef13f){var _0x5ab0a8={};_0x5ab0a8[_0x2ef13f]={'$like':'%'+_0x5086b5[_0xbb66('0x2f')][_0xbb66('0x3a')]+'%'};return _0x5ab0a8;})});}_0x2e36c4=_[_0xbb66('0x43')]({},_0x2e36c4,_0x5086b5[_0xbb66('0x3c')]);return _0x161428['getSubjects'](_0x2e36c4);}})['then'](function(_0xed7095){if(_0xed7095){_0x4bb501=_0xed7095[_0xbb66('0x35')];if(!_0x5086b5[_0xbb66('0x2f')][_0xbb66('0x36')](_0xbb66('0x4b'))){_0x2e36c4[_0xbb66('0x1e')]=qs[_0xbb66('0x1e')](_0x5086b5[_0xbb66('0x2f')][_0xbb66('0x1e')]);_0x2e36c4['offset']=qs[_0xbb66('0x20')](_0x5086b5[_0xbb66('0x2f')]['offset']);}return _0x161428[_0xbb66('0x4c')](_0x2e36c4);}})[_0xbb66('0x25')](function(_0x270903){if(_0x270903){return _0x270903?{'count':_0x4bb501,'rows':_0x270903}:null;}})[_0xbb66('0x25')](respondWithResult(_0x1d2133,null))[_0xbb66('0x40')](handleError(_0x1d2133,null));};exports[_0xbb66('0x4e')]=function(_0x1db1f3,_0x184670,_0x239902){var _0xa1fb13={};var _0x42043e={};var _0x58bbd2;var _0x30a0b7;return db[_0xbb66('0x28')][_0xbb66('0x48')]({'where':{'id':_0x1db1f3[_0xbb66('0x42')]['id']}})['then'](handleEntityNotFound(_0x184670,null))[_0xbb66('0x25')](function(_0x4ee769){if(_0x4ee769){_0x58bbd2=_0x4ee769;_0x42043e[_0xbb66('0x2d')]=_[_0xbb66('0x30')](db[_0xbb66('0x4d')][_0xbb66('0x29')]);_0x42043e['query']=_[_0xbb66('0x30')](_0x1db1f3[_0xbb66('0x2f')]);_0x42043e['filters']=_[_0xbb66('0x32')](_0x42043e['model'],_0x42043e[_0xbb66('0x2f')]);_0xa1fb13[_0xbb66('0x34')]=_[_0xbb66('0x32')](_0x42043e['model'],qs[_0xbb66('0x33')](_0x1db1f3[_0xbb66('0x2f')][_0xbb66('0x33')]));_0xa1fb13['attributes']=_0xa1fb13[_0xbb66('0x34')][_0xbb66('0x35')]?_0xa1fb13['attributes']:_0x42043e[_0xbb66('0x2d')];_0xa1fb13[_0xbb66('0x37')]=qs[_0xbb66('0x38')](_0x1db1f3[_0xbb66('0x2f')][_0xbb66('0x38')]);_0xa1fb13[_0xbb66('0x39')]=qs[_0xbb66('0x31')](_['pick'](_0x1db1f3[_0xbb66('0x2f')],_0x42043e['filters']));if(_0x1db1f3[_0xbb66('0x2f')]['filter']){_0xa1fb13[_0xbb66('0x39')]=_[_0xbb66('0x43')](_0xa1fb13['where'],{'$or':_[_0xbb66('0x2e')](_0xa1fb13['attributes'],function(_0x26581f){var _0x1a58f0={};_0x1a58f0[_0x26581f]={'$like':'%'+_0x1db1f3[_0xbb66('0x2f')][_0xbb66('0x3a')]+'%'};return _0x1a58f0;})});}_0xa1fb13=_[_0xbb66('0x43')]({},_0xa1fb13,_0x1db1f3['options']);return _0x58bbd2[_0xbb66('0x4e')](_0xa1fb13);}})[_0xbb66('0x25')](function(_0x30f4d5){if(_0x30f4d5){_0x30a0b7=_0x30f4d5[_0xbb66('0x35')];if(!_0x1db1f3[_0xbb66('0x2f')][_0xbb66('0x36')](_0xbb66('0x4b'))){_0xa1fb13['limit']=qs[_0xbb66('0x1e')](_0x1db1f3[_0xbb66('0x2f')][_0xbb66('0x1e')]);_0xa1fb13[_0xbb66('0x20')]=qs['offset'](_0x1db1f3[_0xbb66('0x2f')][_0xbb66('0x20')]);}return _0x58bbd2[_0xbb66('0x4e')](_0xa1fb13);}})[_0xbb66('0x25')](function(_0x522d86){if(_0x522d86){return _0x522d86?{'count':_0x30a0b7,'rows':_0x522d86}:null;}})[_0xbb66('0x25')](respondWithResult(_0x184670,null))['catch'](handleError(_0x184670,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e44a93f..0182461 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 _0xcd97=['../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xff352b,_0x10edcf){var _0x1b60a6=function(_0x4d5f67){while(--_0x4d5f67){_0xff352b['push'](_0xff352b['shift']());}};_0x1b60a6(++_0x10edcf);}(_0xcd97,0x7d));var _0x7cd9=function(_0x3fbc6a,_0x1f1133){_0x3fbc6a=_0x3fbc6a-0x0;var _0x524a7c=_0xcd97[_0x3fbc6a];return _0x524a7c;};'use strict';var _=require('lodash');var util=require(_0x7cd9('0x0'));var logger=require(_0x7cd9('0x1'))(_0x7cd9('0x2'));var moment=require(_0x7cd9('0x3'));var BPromise=require(_0x7cd9('0x4'));var rp=require(_0x7cd9('0x5'));var fs=require('fs');var path=require(_0x7cd9('0x6'));var rimraf=require('rimraf');var config=require(_0x7cd9('0x7'));var attributes=require(_0x7cd9('0x8'));module[_0x7cd9('0x9')]=function(_0x479f96,_0x161eaf){return _0x479f96['define'](_0x7cd9('0xa'),attributes,{'tableName':_0x7cd9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27a1=['moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x27a1,0xf3));var _0x127a=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x27a1[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x127a('0x0'));var util=require(_0x127a('0x1'));var logger=require(_0x127a('0x2'))(_0x127a('0x3'));var moment=require(_0x127a('0x4'));var BPromise=require('bluebird');var rp=require(_0x127a('0x5'));var fs=require('fs');var path=require(_0x127a('0x6'));var rimraf=require(_0x127a('0x7'));var config=require(_0x127a('0x8'));var attributes=require(_0x127a('0x9'));module[_0x127a('0xa')]=function(_0x5621d1,_0x32ce46){return _0x5621d1[_0x127a('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0x127a('0xc'),'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 6653996..e8c56f6 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 _0xe725=['then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe725,0x66));var _0x5e72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe725[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5e72('0x0'));var util=require(_0x5e72('0x1'));var moment=require('moment');var BPromise=require(_0x5e72('0x2'));var rs=require(_0x5e72('0x3'));var fs=require('fs');var Redis=require(_0x5e72('0x4'));var db=require(_0x5e72('0x5'))['db'];var utils=require(_0x5e72('0x6'));var logger=require(_0x5e72('0x7'))(_0x5e72('0x8'));var config=require(_0x5e72('0x9'));var jayson=require(_0x5e72('0xa'));var client=jayson['client'][_0x5e72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e2915,_0x119c21,_0xecdae2){return new BPromise(function(_0x4e9a19,_0x558201){return client[_0x5e72('0xc')](_0x3e2915,_0xecdae2)[_0x5e72('0xd')](function(_0x3d49d2){logger[_0x5e72('0xe')](_0x5e72('0xf'),_0x119c21,'request\x20sent');logger[_0x5e72('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x119c21,_0x5e72('0x11'),JSON['stringify'](_0x3d49d2));if(_0x3d49d2[_0x5e72('0x12')]){if(_0x3d49d2['error'][_0x5e72('0x13')]===0x1f4){logger[_0x5e72('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x119c21,_0x3d49d2['error'][_0x5e72('0x14')]);return _0x558201(_0x3d49d2[_0x5e72('0x12')]['message']);}logger[_0x5e72('0x12')](_0x5e72('0xf'),_0x119c21,_0x3d49d2[_0x5e72('0x12')][_0x5e72('0x14')]);return _0x4e9a19(_0x3d49d2[_0x5e72('0x12')][_0x5e72('0x14')]);}else{logger[_0x5e72('0xe')](_0x5e72('0xf'),_0x119c21,_0x5e72('0x11'));_0x4e9a19(_0x3d49d2[_0x5e72('0x15')]['message']);}})[_0x5e72('0x16')](function(_0x187b6b){logger[_0x5e72('0x12')](_0x5e72('0xf'),_0x119c21,_0x187b6b);_0x558201(_0x187b6b);});});} \ No newline at end of file +var _0x199d=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x199d,0x153));var _0xd199=function(_0x14a513,_0x3239f){_0x14a513=_0x14a513-0x0;var _0x47236c=_0x199d[_0x14a513];return _0x47236c;};'use strict';var _=require(_0xd199('0x0'));var util=require(_0xd199('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd199('0x2'));var fs=require('fs');var Redis=require(_0xd199('0x3'));var db=require(_0xd199('0x4'))['db'];var utils=require(_0xd199('0x5'));var logger=require(_0xd199('0x6'))(_0xd199('0x7'));var config=require('../../config/environment');var jayson=require(_0xd199('0x8'));var client=jayson['client'][_0xd199('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x462756,_0x27bf3e,_0x34c54b){return new BPromise(function(_0x31ca65,_0x5af7ca){return client[_0xd199('0xa')](_0x462756,_0x34c54b)[_0xd199('0xb')](function(_0x107f2c){logger['info'](_0xd199('0xc'),_0x27bf3e,'request\x20sent');logger[_0xd199('0xd')](_0xd199('0xe'),_0x27bf3e,'request\x20sent',JSON[_0xd199('0xf')](_0x107f2c));if(_0x107f2c['error']){if(_0x107f2c[_0xd199('0x10')]['code']===0x1f4){logger[_0xd199('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x27bf3e,_0x107f2c[_0xd199('0x10')][_0xd199('0x11')]);return _0x5af7ca(_0x107f2c[_0xd199('0x10')]['message']);}logger[_0xd199('0x10')](_0xd199('0xc'),_0x27bf3e,_0x107f2c['error']['message']);return _0x31ca65(_0x107f2c['error'][_0xd199('0x11')]);}else{logger['info'](_0xd199('0xc'),_0x27bf3e,_0xd199('0x12'));_0x31ca65(_0x107f2c['result'][_0xd199('0x11')]);}})[_0xd199('0x13')](function(_0x1a941d){logger[_0xd199('0x10')](_0xd199('0xc'),_0x27bf3e,_0x1a941d);_0x5af7ca(_0x1a941d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3de0e06..2ac55c8 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 _0x5137=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x98061e,_0x2e54c4){var _0x1df426=function(_0x193558){while(--_0x193558){_0x98061e['push'](_0x98061e['shift']());}};_0x1df426(++_0x2e54c4);}(_0x5137,0x1e9));var _0x7513=function(_0x700458,_0x3e67a4){_0x700458=_0x700458-0x0;var _0x4e459a=_0x5137[_0x700458];return _0x4e459a;};'use strict';var multer=require(_0x7513('0x0'));var util=require('util');var path=require(_0x7513('0x1'));var timeout=require(_0x7513('0x2'));var express=require('express');var router=express[_0x7513('0x3')]();var fs_extra=require(_0x7513('0x4'));var auth=require(_0x7513('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7513('0x6'));var controller=require(_0x7513('0x7'));router[_0x7513('0x8')]('/',auth[_0x7513('0x9')](),controller['index']);router[_0x7513('0x8')](_0x7513('0xa'),auth[_0x7513('0x9')](),controller[_0x7513('0xb')]);router[_0x7513('0xc')]('/',auth[_0x7513('0x9')](),controller[_0x7513('0xd')]);router['put'](_0x7513('0xa'),auth[_0x7513('0x9')](),controller[_0x7513('0xe')]);router[_0x7513('0xf')](_0x7513('0xa'),auth[_0x7513('0x9')](),controller[_0x7513('0x10')]);module[_0x7513('0x11')]=router; \ No newline at end of file +var _0xf6d3=['../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','/:id','post','create','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5e0b95,_0x3f31ee){var _0x19be5d=function(_0x4ad52e){while(--_0x4ad52e){_0x5e0b95['push'](_0x5e0b95['shift']());}};_0x19be5d(++_0x3f31ee);}(_0xf6d3,0x1d9));var _0x3f6d=function(_0xab56e6,_0xa4aa9c){_0xab56e6=_0xab56e6-0x0;var _0x31c288=_0xf6d3[_0xab56e6];return _0x31c288;};'use strict';var multer=require(_0x3f6d('0x0'));var util=require(_0x3f6d('0x1'));var path=require(_0x3f6d('0x2'));var timeout=require(_0x3f6d('0x3'));var express=require(_0x3f6d('0x4'));var router=express[_0x3f6d('0x5')]();var fs_extra=require(_0x3f6d('0x6'));var auth=require(_0x3f6d('0x7'));var interaction=require(_0x3f6d('0x8'));var config=require('../../config/environment');var controller=require(_0x3f6d('0x9'));router[_0x3f6d('0xa')]('/',auth[_0x3f6d('0xb')](),controller['index']);router[_0x3f6d('0xa')](_0x3f6d('0xc'),auth[_0x3f6d('0xb')](),controller['show']);router[_0x3f6d('0xd')]('/',auth[_0x3f6d('0xb')](),controller[_0x3f6d('0xe')]);router['put'](_0x3f6d('0xc'),auth['isAuthenticated'](),controller[_0x3f6d('0xf')]);router['delete']('/:id',auth[_0x3f6d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 3933374..0ea63a6 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 _0xa198=['ENUM','string','variable','customVariable','picklist','STRING','exports'];(function(_0x336fcf,_0x276bff){var _0x1afb55=function(_0x3db31a){while(--_0x3db31a){_0x336fcf['push'](_0x336fcf['shift']());}};_0x1afb55(++_0x276bff);}(_0xa198,0x1c6));var _0x8a19=function(_0x539dd2,_0x8454a){_0x539dd2=_0x539dd2-0x0;var _0x5aa1d3=_0xa198[_0x539dd2];return _0x5aa1d3;};'use strict';var Sequelize=require('sequelize');module[_0x8a19('0x0')]={'type':{'type':Sequelize[_0x8a19('0x1')](_0x8a19('0x2'),_0x8a19('0x3'),_0x8a19('0x4'),'keyValue',_0x8a19('0x5')),'defaultValue':_0x8a19('0x2')},'content':{'type':Sequelize[_0x8a19('0x6')]},'key':{'type':Sequelize[_0x8a19('0x6')]},'keyType':{'type':Sequelize[_0x8a19('0x1')](_0x8a19('0x2'),_0x8a19('0x3'),_0x8a19('0x4'))},'keyContent':{'type':Sequelize[_0x8a19('0x6')]},'idField':{'type':Sequelize[_0x8a19('0x6')]},'variableName':{'type':Sequelize[_0x8a19('0x6')]}}; \ No newline at end of file +var _0xcdeb=['keyValue','string','STRING','ENUM','sequelize','exports','customVariable'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xcdeb,0x6d));var _0xbcde=function(_0x141a0d,_0x5964d6){_0x141a0d=_0x141a0d-0x0;var _0x208663=_0xcdeb[_0x141a0d];return _0x208663;};'use strict';var Sequelize=require(_0xbcde('0x0'));module[_0xbcde('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xbcde('0x2'),_0xbcde('0x3'),'picklist'),'defaultValue':_0xbcde('0x4')},'content':{'type':Sequelize[_0xbcde('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbcde('0x6')](_0xbcde('0x4'),'variable',_0xbcde('0x2'))},'keyContent':{'type':Sequelize[_0xbcde('0x5')]},'idField':{'type':Sequelize[_0xbcde('0x5')]},'variableName':{'type':Sequelize[_0xbcde('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3e5b18b..a2c3c5f 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 _0x0e79=['index','map','SalesforceField','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','name','send'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0x0e79,0xac));var _0x90e7=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x0e79[_0x118afa];return _0x167d76;};'use strict';var emlformat=require(_0x90e7('0x0'));var rimraf=require(_0x90e7('0x1'));var zipdir=require(_0x90e7('0x2'));var jsonpatch=require(_0x90e7('0x3'));var rp=require(_0x90e7('0x4'));var moment=require('moment');var BPromise=require(_0x90e7('0x5'));var Mustache=require(_0x90e7('0x6'));var util=require(_0x90e7('0x7'));var path=require(_0x90e7('0x8'));var sox=require(_0x90e7('0x9'));var csv=require(_0x90e7('0xa'));var ejs=require(_0x90e7('0xb'));var fs=require('fs');var fs_extra=require(_0x90e7('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90e7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x90e7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x90e7('0xf'));var qs=require(_0x90e7('0x10'));var as=require(_0x90e7('0x11'));var hardwareService=require(_0x90e7('0x12'));var logger=require(_0x90e7('0x13'))(_0x90e7('0x14'));var utils=require(_0x90e7('0x15'));var config=require(_0x90e7('0x16'));var licenseUtil=require(_0x90e7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7d28f6,_0x7bd908){_0x7bd908=_0x7bd908||0xcc;return function(_0x38627a){if(_0x38627a){return _0x7d28f6[_0x90e7('0x18')](_0x7bd908);}return _0x7d28f6[_0x90e7('0x19')](_0x7bd908)[_0x90e7('0x1a')]();};}function respondWithResult(_0x16cb5f,_0x493524){_0x493524=_0x493524||0xc8;return function(_0xbbc7c3){if(_0xbbc7c3){return _0x16cb5f['status'](_0x493524)['json'](_0xbbc7c3);}};}function respondWithFilteredResult(_0x5c0660,_0x22cd89){return function(_0x944279){if(_0x944279){var _0x277084=typeof _0x22cd89[_0x90e7('0x1b')]==='undefined'&&typeof _0x22cd89[_0x90e7('0x1c')]===_0x90e7('0x1d');var _0x11e206=_0x944279[_0x90e7('0x1e')];var _0x34181b=_0x277084?0x0:_0x22cd89[_0x90e7('0x1b')];var _0x491a9b=_0x277084?_0x944279[_0x90e7('0x1e')]:_0x22cd89[_0x90e7('0x1b')]+_0x22cd89[_0x90e7('0x1c')];var _0x361451;if(_0x491a9b>=_0x11e206){_0x491a9b=_0x11e206;_0x361451=0xc8;}else{_0x361451=0xce;}_0x5c0660[_0x90e7('0x19')](_0x361451);return _0x5c0660[_0x90e7('0x1f')](_0x90e7('0x20'),_0x34181b+'-'+_0x491a9b+'/'+_0x11e206)[_0x90e7('0x21')](_0x944279);}return null;};}function patchUpdates(_0x4e8239){return function(_0x49e5f0){try{jsonpatch[_0x90e7('0x22')](_0x49e5f0,_0x4e8239,!![]);}catch(_0x20888e){return BPromise['reject'](_0x20888e);}return _0x49e5f0['save']();};}function saveUpdates(_0x255bd0,_0x182c33){return function(_0x283fd6){if(_0x283fd6){return _0x283fd6[_0x90e7('0x23')](_0x255bd0)[_0x90e7('0x24')](function(_0x9e203d){return _0x9e203d;});}return null;};}function removeEntity(_0x406456,_0x3bb86a){return function(_0x5cfb10){if(_0x5cfb10){return _0x5cfb10[_0x90e7('0x25')]()[_0x90e7('0x24')](function(){_0x406456[_0x90e7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d2335,_0x49b1a9){return function(_0x12ca83){if(!_0x12ca83){_0x4d2335[_0x90e7('0x18')](0x194);}return _0x12ca83;};}function handleError(_0x508e28,_0x29130c){_0x29130c=_0x29130c||0x1f4;return function(_0x571738){logger[_0x90e7('0x26')](_0x571738['stack']);if(_0x571738[_0x90e7('0x27')]){delete _0x571738[_0x90e7('0x27')];}_0x508e28[_0x90e7('0x19')](_0x29130c)[_0x90e7('0x28')](_0x571738);};}exports[_0x90e7('0x29')]=function(_0x2174d2,_0x3a23ca){var _0x1e9eb7={},_0x446002={},_0x24e3d1={'count':0x0,'rows':[]};var _0x3dcb1e=_[_0x90e7('0x2a')](db[_0x90e7('0x2b')]['rawAttributes'],function(_0x2ede29){return{'name':_0x2ede29[_0x90e7('0x2c')],'type':_0x2ede29[_0x90e7('0x2d')][_0x90e7('0x2e')]};});_0x446002[_0x90e7('0x2f')]=_[_0x90e7('0x2a')](_0x3dcb1e,'name');_0x446002['query']=_[_0x90e7('0x30')](_0x2174d2['query']);_0x446002[_0x90e7('0x31')]=_[_0x90e7('0x32')](_0x446002[_0x90e7('0x2f')],_0x446002[_0x90e7('0x33')]);_0x1e9eb7[_0x90e7('0x34')]=_[_0x90e7('0x32')](_0x446002[_0x90e7('0x2f')],qs[_0x90e7('0x35')](_0x2174d2['query'][_0x90e7('0x35')]));_0x1e9eb7[_0x90e7('0x34')]=_0x1e9eb7[_0x90e7('0x34')]['length']?_0x1e9eb7['attributes']:_0x446002[_0x90e7('0x2f')];if(!_0x2174d2[_0x90e7('0x33')]['hasOwnProperty'](_0x90e7('0x36'))){_0x1e9eb7[_0x90e7('0x1c')]=qs['limit'](_0x2174d2[_0x90e7('0x33')][_0x90e7('0x1c')]);_0x1e9eb7[_0x90e7('0x1b')]=qs[_0x90e7('0x1b')](_0x2174d2[_0x90e7('0x33')][_0x90e7('0x1b')]);}_0x1e9eb7['order']=qs[_0x90e7('0x37')](_0x2174d2['query'][_0x90e7('0x37')]);_0x1e9eb7['where']=qs['filters'](_[_0x90e7('0x38')](_0x2174d2['query'],_0x446002['filters']),_0x3dcb1e);if(_0x2174d2[_0x90e7('0x33')]['filter']){_0x1e9eb7[_0x90e7('0x39')]=_[_0x90e7('0x3a')](_0x1e9eb7[_0x90e7('0x39')],{'$or':_['map'](_0x3dcb1e,function(_0x12d1e3){if(_0x12d1e3['type']!==_0x90e7('0x3b')){var _0x151a90={};_0x151a90[_0x12d1e3[_0x90e7('0x27')]]={'$like':'%'+_0x2174d2[_0x90e7('0x33')][_0x90e7('0x3c')]+'%'};return _0x151a90;}})});}_0x1e9eb7=_[_0x90e7('0x3a')]({},_0x1e9eb7,_0x2174d2['options']);var _0x32e11e={'where':_0x1e9eb7[_0x90e7('0x39')]};return db[_0x90e7('0x2b')][_0x90e7('0x1e')](_0x32e11e)['then'](function(_0x4e900b){_0x24e3d1[_0x90e7('0x1e')]=_0x4e900b;if(_0x2174d2[_0x90e7('0x33')][_0x90e7('0x3d')]){_0x1e9eb7[_0x90e7('0x3e')]=[{'all':!![]}];}return db['SalesforceField'][_0x90e7('0x3f')](_0x1e9eb7);})['then'](function(_0x377827){_0x24e3d1[_0x90e7('0x40')]=_0x377827;return _0x24e3d1;})['then'](respondWithFilteredResult(_0x3a23ca,_0x1e9eb7))[_0x90e7('0x41')](handleError(_0x3a23ca,null));};exports['show']=function(_0x587bc5,_0x3e90ea){var _0x396f35={'raw':!![],'where':{'id':_0x587bc5[_0x90e7('0x42')]['id']}},_0x1e5d18={};_0x1e5d18[_0x90e7('0x2f')]=_['keys'](db[_0x90e7('0x2b')][_0x90e7('0x43')]);_0x1e5d18[_0x90e7('0x33')]=_['keys'](_0x587bc5[_0x90e7('0x33')]);_0x1e5d18['filters']=_[_0x90e7('0x32')](_0x1e5d18[_0x90e7('0x2f')],_0x1e5d18[_0x90e7('0x33')]);_0x396f35[_0x90e7('0x34')]=_[_0x90e7('0x32')](_0x1e5d18['model'],qs['fields'](_0x587bc5[_0x90e7('0x33')]['fields']));_0x396f35['attributes']=_0x396f35[_0x90e7('0x34')]['length']?_0x396f35[_0x90e7('0x34')]:_0x1e5d18['model'];if(_0x587bc5[_0x90e7('0x33')][_0x90e7('0x3d')]){_0x396f35[_0x90e7('0x3e')]=[{'all':!![]}];}_0x396f35=_['merge']({},_0x396f35,_0x587bc5[_0x90e7('0x44')]);return db[_0x90e7('0x2b')][_0x90e7('0x45')](_0x396f35)[_0x90e7('0x24')](handleEntityNotFound(_0x3e90ea,null))[_0x90e7('0x24')](respondWithResult(_0x3e90ea,null))[_0x90e7('0x41')](handleError(_0x3e90ea,null));};exports['create']=function(_0x318ad5,_0x3a80cd){return db[_0x90e7('0x2b')]['create'](_0x318ad5[_0x90e7('0x46')],{})[_0x90e7('0x24')](respondWithResult(_0x3a80cd,0xc9))['catch'](handleError(_0x3a80cd,null));};exports[_0x90e7('0x23')]=function(_0x5bb045,_0x479bd9){if(_0x5bb045[_0x90e7('0x46')]['id']){delete _0x5bb045[_0x90e7('0x46')]['id'];}return db[_0x90e7('0x2b')][_0x90e7('0x45')]({'where':{'id':_0x5bb045[_0x90e7('0x42')]['id']}})[_0x90e7('0x24')](handleEntityNotFound(_0x479bd9,null))['then'](saveUpdates(_0x5bb045['body'],null))[_0x90e7('0x24')](respondWithResult(_0x479bd9,null))['catch'](handleError(_0x479bd9,null));};exports['destroy']=function(_0x306caf,_0x11a191){return db[_0x90e7('0x2b')]['find']({'where':{'id':_0x306caf[_0x90e7('0x42')]['id']}})[_0x90e7('0x24')](handleEntityNotFound(_0x11a191,null))[_0x90e7('0x24')](removeEntity(_0x11a191,null))[_0x90e7('0x41')](handleError(_0x11a191,null));}; \ No newline at end of file +var _0x9e69=['reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceField','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply'];(function(_0x1b118f,_0x287ef4){var _0x300afa=function(_0x5a6aaa){while(--_0x5a6aaa){_0x1b118f['push'](_0x1b118f['shift']());}};_0x300afa(++_0x287ef4);}(_0x9e69,0x15b));var _0x99e6=function(_0x392589,_0xc47639){_0x392589=_0x392589-0x0;var _0x1a4402=_0x9e69[_0x392589];return _0x1a4402;};'use strict';var emlformat=require(_0x99e6('0x0'));var rimraf=require(_0x99e6('0x1'));var zipdir=require(_0x99e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x99e6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x99e6('0x4'));var sox=require(_0x99e6('0x5'));var csv=require(_0x99e6('0x6'));var ejs=require(_0x99e6('0x7'));var fs=require('fs');var fs_extra=require(_0x99e6('0x8'));var _=require('lodash');var squel=require(_0x99e6('0x9'));var crypto=require(_0x99e6('0xa'));var jsforce=require(_0x99e6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x99e6('0x6'));var querystring=require(_0x99e6('0xc'));var Papa=require(_0x99e6('0xd'));var Redis=require(_0x99e6('0xe'));var authService=require(_0x99e6('0xf'));var qs=require(_0x99e6('0x10'));var as=require(_0x99e6('0x11'));var hardwareService=require(_0x99e6('0x12'));var logger=require(_0x99e6('0x13'))(_0x99e6('0x14'));var utils=require('../../config/utils');var config=require(_0x99e6('0x15'));var licenseUtil=require(_0x99e6('0x16'));var db=require(_0x99e6('0x17'))['db'];function respondWithStatusCode(_0x258ccf,_0x5a532b){_0x5a532b=_0x5a532b||0xcc;return function(_0x26f51b){if(_0x26f51b){return _0x258ccf[_0x99e6('0x18')](_0x5a532b);}return _0x258ccf[_0x99e6('0x19')](_0x5a532b)['end']();};}function respondWithResult(_0x4dd3c3,_0x188dfe){_0x188dfe=_0x188dfe||0xc8;return function(_0x18f208){if(_0x18f208){return _0x4dd3c3[_0x99e6('0x19')](_0x188dfe)[_0x99e6('0x1a')](_0x18f208);}};}function respondWithFilteredResult(_0xbb888,_0x4c146a){return function(_0xe815b8){if(_0xe815b8){var _0x211e2c=typeof _0x4c146a['offset']===_0x99e6('0x1b')&&typeof _0x4c146a[_0x99e6('0x1c')]==='undefined';var _0xdb7fa2=_0xe815b8['count'];var _0x57b091=_0x211e2c?0x0:_0x4c146a[_0x99e6('0x1d')];var _0x30702d=_0x211e2c?_0xe815b8['count']:_0x4c146a[_0x99e6('0x1d')]+_0x4c146a[_0x99e6('0x1c')];var _0x233627;if(_0x30702d>=_0xdb7fa2){_0x30702d=_0xdb7fa2;_0x233627=0xc8;}else{_0x233627=0xce;}_0xbb888[_0x99e6('0x19')](_0x233627);return _0xbb888[_0x99e6('0x1e')](_0x99e6('0x1f'),_0x57b091+'-'+_0x30702d+'/'+_0xdb7fa2)[_0x99e6('0x1a')](_0xe815b8);}return null;};}function patchUpdates(_0x2c65d1){return function(_0x3fb9c1){try{jsonpatch[_0x99e6('0x20')](_0x3fb9c1,_0x2c65d1,!![]);}catch(_0x57316e){return BPromise[_0x99e6('0x21')](_0x57316e);}return _0x3fb9c1[_0x99e6('0x22')]();};}function saveUpdates(_0x5a8672,_0x17fc24){return function(_0x39c6b2){if(_0x39c6b2){return _0x39c6b2[_0x99e6('0x23')](_0x5a8672)[_0x99e6('0x24')](function(_0x3ff0e2){return _0x3ff0e2;});}return null;};}function removeEntity(_0x2346d2,_0x3c116e){return function(_0x1422d3){if(_0x1422d3){return _0x1422d3[_0x99e6('0x25')]()[_0x99e6('0x24')](function(){_0x2346d2[_0x99e6('0x19')](0xcc)[_0x99e6('0x26')]();});}};}function handleEntityNotFound(_0x1f89d3,_0x29d2e3){return function(_0x3de702){if(!_0x3de702){_0x1f89d3[_0x99e6('0x18')](0x194);}return _0x3de702;};}function handleError(_0x4ddad3,_0x4c340e){_0x4c340e=_0x4c340e||0x1f4;return function(_0x16f887){logger[_0x99e6('0x27')](_0x16f887[_0x99e6('0x28')]);if(_0x16f887['name']){delete _0x16f887[_0x99e6('0x29')];}_0x4ddad3[_0x99e6('0x19')](_0x4c340e)[_0x99e6('0x2a')](_0x16f887);};}exports[_0x99e6('0x2b')]=function(_0x2de066,_0x85e027){var _0x3b713c={},_0x4bba0f={},_0x3e72f1={'count':0x0,'rows':[]};var _0x2cca69=_[_0x99e6('0x2c')](db[_0x99e6('0x2d')]['rawAttributes'],function(_0x262b90){return{'name':_0x262b90[_0x99e6('0x2e')],'type':_0x262b90['type'][_0x99e6('0x2f')]};});_0x4bba0f[_0x99e6('0x30')]=_[_0x99e6('0x2c')](_0x2cca69,_0x99e6('0x29'));_0x4bba0f['query']=_[_0x99e6('0x31')](_0x2de066[_0x99e6('0x32')]);_0x4bba0f[_0x99e6('0x33')]=_['intersection'](_0x4bba0f[_0x99e6('0x30')],_0x4bba0f[_0x99e6('0x32')]);_0x3b713c[_0x99e6('0x34')]=_[_0x99e6('0x35')](_0x4bba0f[_0x99e6('0x30')],qs[_0x99e6('0x36')](_0x2de066['query'][_0x99e6('0x36')]));_0x3b713c[_0x99e6('0x34')]=_0x3b713c[_0x99e6('0x34')][_0x99e6('0x37')]?_0x3b713c[_0x99e6('0x34')]:_0x4bba0f[_0x99e6('0x30')];if(!_0x2de066[_0x99e6('0x32')]['hasOwnProperty'](_0x99e6('0x38'))){_0x3b713c[_0x99e6('0x1c')]=qs[_0x99e6('0x1c')](_0x2de066[_0x99e6('0x32')][_0x99e6('0x1c')]);_0x3b713c[_0x99e6('0x1d')]=qs[_0x99e6('0x1d')](_0x2de066[_0x99e6('0x32')][_0x99e6('0x1d')]);}_0x3b713c['order']=qs['sort'](_0x2de066[_0x99e6('0x32')][_0x99e6('0x39')]);_0x3b713c[_0x99e6('0x3a')]=qs[_0x99e6('0x33')](_[_0x99e6('0x3b')](_0x2de066[_0x99e6('0x32')],_0x4bba0f[_0x99e6('0x33')]),_0x2cca69);if(_0x2de066[_0x99e6('0x32')][_0x99e6('0x3c')]){_0x3b713c[_0x99e6('0x3a')]=_['merge'](_0x3b713c[_0x99e6('0x3a')],{'$or':_[_0x99e6('0x2c')](_0x2cca69,function(_0x51f9dd){if(_0x51f9dd['type']!==_0x99e6('0x3d')){var _0x22b530={};_0x22b530[_0x51f9dd[_0x99e6('0x29')]]={'$like':'%'+_0x2de066['query'][_0x99e6('0x3c')]+'%'};return _0x22b530;}})});}_0x3b713c=_[_0x99e6('0x3e')]({},_0x3b713c,_0x2de066[_0x99e6('0x3f')]);var _0x1bf84b={'where':_0x3b713c[_0x99e6('0x3a')]};return db[_0x99e6('0x2d')][_0x99e6('0x40')](_0x1bf84b)[_0x99e6('0x24')](function(_0x4667d3){_0x3e72f1['count']=_0x4667d3;if(_0x2de066[_0x99e6('0x32')][_0x99e6('0x41')]){_0x3b713c[_0x99e6('0x42')]=[{'all':!![]}];}return db[_0x99e6('0x2d')][_0x99e6('0x43')](_0x3b713c);})[_0x99e6('0x24')](function(_0x3043a8){_0x3e72f1[_0x99e6('0x44')]=_0x3043a8;return _0x3e72f1;})[_0x99e6('0x24')](respondWithFilteredResult(_0x85e027,_0x3b713c))['catch'](handleError(_0x85e027,null));};exports[_0x99e6('0x45')]=function(_0xde80d7,_0x18badb){var _0x14159d={'raw':!![],'where':{'id':_0xde80d7[_0x99e6('0x46')]['id']}},_0x49361e={};_0x49361e[_0x99e6('0x30')]=_[_0x99e6('0x31')](db[_0x99e6('0x2d')][_0x99e6('0x47')]);_0x49361e[_0x99e6('0x32')]=_['keys'](_0xde80d7['query']);_0x49361e[_0x99e6('0x33')]=_['intersection'](_0x49361e[_0x99e6('0x30')],_0x49361e[_0x99e6('0x32')]);_0x14159d[_0x99e6('0x34')]=_['intersection'](_0x49361e[_0x99e6('0x30')],qs['fields'](_0xde80d7[_0x99e6('0x32')]['fields']));_0x14159d['attributes']=_0x14159d[_0x99e6('0x34')]['length']?_0x14159d['attributes']:_0x49361e[_0x99e6('0x30')];if(_0xde80d7[_0x99e6('0x32')][_0x99e6('0x41')]){_0x14159d[_0x99e6('0x42')]=[{'all':!![]}];}_0x14159d=_[_0x99e6('0x3e')]({},_0x14159d,_0xde80d7['options']);return db[_0x99e6('0x2d')][_0x99e6('0x48')](_0x14159d)['then'](handleEntityNotFound(_0x18badb,null))[_0x99e6('0x24')](respondWithResult(_0x18badb,null))[_0x99e6('0x49')](handleError(_0x18badb,null));};exports[_0x99e6('0x4a')]=function(_0x4ab027,_0x591edb){return db[_0x99e6('0x2d')]['create'](_0x4ab027[_0x99e6('0x4b')],{})[_0x99e6('0x24')](respondWithResult(_0x591edb,0xc9))[_0x99e6('0x49')](handleError(_0x591edb,null));};exports[_0x99e6('0x23')]=function(_0x4d361a,_0x5034c0){if(_0x4d361a[_0x99e6('0x4b')]['id']){delete _0x4d361a['body']['id'];}return db['SalesforceField'][_0x99e6('0x48')]({'where':{'id':_0x4d361a[_0x99e6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5034c0,null))[_0x99e6('0x24')](saveUpdates(_0x4d361a[_0x99e6('0x4b')],null))[_0x99e6('0x24')](respondWithResult(_0x5034c0,null))['catch'](handleError(_0x5034c0,null));};exports[_0x99e6('0x25')]=function(_0x1ea43e,_0x8db417){return db[_0x99e6('0x2d')]['find']({'where':{'id':_0x1ea43e[_0x99e6('0x46')]['id']}})['then'](handleEntityNotFound(_0x8db417,null))[_0x99e6('0x24')](removeEntity(_0x8db417,null))[_0x99e6('0x49')](handleError(_0x8db417,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index a9df61c..9191c9e 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 _0x4860=['exports','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x877ea5,_0x4f9928){var _0x772191=function(_0x936343){while(--_0x936343){_0x877ea5['push'](_0x877ea5['shift']());}};_0x772191(++_0x4f9928);}(_0x4860,0xc7));var _0x0486=function(_0x4d69a2,_0x2e746c){_0x4d69a2=_0x4d69a2-0x0;var _0x5d6d2e=_0x4860[_0x4d69a2];return _0x5d6d2e;};'use strict';var _=require(_0x0486('0x0'));var util=require(_0x0486('0x1'));var logger=require(_0x0486('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0486('0x3'));var rp=require(_0x0486('0x4'));var fs=require('fs');var path=require(_0x0486('0x5'));var rimraf=require(_0x0486('0x6'));var config=require(_0x0486('0x7'));var attributes=require(_0x0486('0x8'));module[_0x0486('0x9')]=function(_0x4a0e02,_0x1fd254){return _0x4a0e02['define'](_0x0486('0xa'),attributes,{'tableName':_0x0486('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x0486('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d52=['util','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x2c9967,_0x514917){var _0x261dcc=function(_0x36eaa6){while(--_0x36eaa6){_0x2c9967['push'](_0x2c9967['shift']());}};_0x261dcc(++_0x514917);}(_0x0d52,0x1b1));var _0x20d5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0d52[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x20d5('0x0'));var util=require(_0x20d5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20d5('0x2'));var rp=require(_0x20d5('0x3'));var fs=require('fs');var path=require(_0x20d5('0x4'));var rimraf=require('rimraf');var config=require(_0x20d5('0x5'));var attributes=require(_0x20d5('0x6'));module[_0x20d5('0x7')]=function(_0x226cd3,_0x5adce1){return _0x226cd3[_0x20d5('0x8')](_0x20d5('0x9'),attributes,{'tableName':_0x20d5('0xa'),'paranoid':![],'indexes':[{'name':_0x20d5('0xb'),'fields':[_0x20d5('0xc'),_0x20d5('0xd')],'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 2320fa8..450af46 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 _0xc63c=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','code','SalesforceField,\x20%s,\x20%s','message'];(function(_0x50a19d,_0x225f33){var _0x3daaaa=function(_0x4ff041){while(--_0x4ff041){_0x50a19d['push'](_0x50a19d['shift']());}};_0x3daaaa(++_0x225f33);}(_0xc63c,0x123));var _0xcc63=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xc63c[_0x1e8b1e];return _0x4a0fde;};'use strict';var _=require(_0xcc63('0x0'));var util=require(_0xcc63('0x1'));var moment=require(_0xcc63('0x2'));var BPromise=require(_0xcc63('0x3'));var rs=require(_0xcc63('0x4'));var fs=require('fs');var Redis=require(_0xcc63('0x5'));var db=require(_0xcc63('0x6'))['db'];var utils=require(_0xcc63('0x7'));var logger=require(_0xcc63('0x8'))(_0xcc63('0x9'));var config=require(_0xcc63('0xa'));var jayson=require(_0xcc63('0xb'));var client=jayson[_0xcc63('0xc')][_0xcc63('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5dca5a,_0xf3e699,_0x44e3ce){return new BPromise(function(_0x5de75b,_0x5905c7){return client[_0xcc63('0xe')](_0x5dca5a,_0x44e3ce)['then'](function(_0x100598){logger['info']('SalesforceField,\x20%s,\x20%s',_0xf3e699,_0xcc63('0xf'));logger[_0xcc63('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xf3e699,'request\x20sent',JSON['stringify'](_0x100598));if(_0x100598[_0xcc63('0x11')]){if(_0x100598[_0xcc63('0x11')][_0xcc63('0x12')]===0x1f4){logger['error'](_0xcc63('0x13'),_0xf3e699,_0x100598[_0xcc63('0x11')]['message']);return _0x5905c7(_0x100598[_0xcc63('0x11')]['message']);}logger[_0xcc63('0x11')](_0xcc63('0x13'),_0xf3e699,_0x100598['error'][_0xcc63('0x14')]);return _0x5de75b(_0x100598['error'][_0xcc63('0x14')]);}else{logger[_0xcc63('0x15')](_0xcc63('0x13'),_0xf3e699,_0xcc63('0xf'));_0x5de75b(_0x100598[_0xcc63('0x16')][_0xcc63('0x14')]);}})[_0xcc63('0x17')](function(_0x3da9aa){logger['error'](_0xcc63('0x13'),_0xf3e699,_0x3da9aa);_0x5905c7(_0x3da9aa);});});} \ No newline at end of file +var _0x02bf=['stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x02bf,0x6e));var _0xf02b=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0x02bf[_0x5da27f];return _0x54a3fb;};'use strict';var _=require('lodash');var util=require(_0xf02b('0x0'));var moment=require(_0xf02b('0x1'));var BPromise=require('bluebird');var rs=require(_0xf02b('0x2'));var fs=require('fs');var Redis=require(_0xf02b('0x3'));var db=require(_0xf02b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf02b('0x5'))(_0xf02b('0x6'));var config=require(_0xf02b('0x7'));var jayson=require(_0xf02b('0x8'));var client=jayson['client'][_0xf02b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229903,_0x2827bd,_0x2167b3){return new BPromise(function(_0x5be578,_0x249f20){return client[_0xf02b('0xa')](_0x229903,_0x2167b3)[_0xf02b('0xb')](function(_0x50e2bd){logger[_0xf02b('0xc')](_0xf02b('0xd'),_0x2827bd,'request\x20sent');logger[_0xf02b('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2827bd,_0xf02b('0xf'),JSON[_0xf02b('0x10')](_0x50e2bd));if(_0x50e2bd[_0xf02b('0x11')]){if(_0x50e2bd[_0xf02b('0x11')][_0xf02b('0x12')]===0x1f4){logger[_0xf02b('0x11')](_0xf02b('0xd'),_0x2827bd,_0x50e2bd[_0xf02b('0x11')][_0xf02b('0x13')]);return _0x249f20(_0x50e2bd['error'][_0xf02b('0x13')]);}logger['error'](_0xf02b('0xd'),_0x2827bd,_0x50e2bd['error']['message']);return _0x5be578(_0x50e2bd[_0xf02b('0x11')]['message']);}else{logger[_0xf02b('0xc')]('SalesforceField,\x20%s,\x20%s',_0x2827bd,'request\x20sent');_0x5be578(_0x50e2bd[_0xf02b('0x14')][_0xf02b('0x13')]);}})['catch'](function(_0x104805){logger[_0xf02b('0x11')](_0xf02b('0xd'),_0x2827bd,_0x104805);_0x249f20(_0x104805);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 279186a..50ed633 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 _0xbef6=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1827f9,_0x5d01c9){var _0x154701=function(_0x10e0d4){while(--_0x10e0d4){_0x1827f9['push'](_0x1827f9['shift']());}};_0x154701(++_0x5d01c9);}(_0xbef6,0x1b0));var _0x6bef=function(_0x4812db,_0x558605){_0x4812db=_0x4812db-0x0;var _0x444466=_0xbef6[_0x4812db];return _0x444466;};'use strict';var multer=require(_0x6bef('0x0'));var util=require(_0x6bef('0x1'));var path=require('path');var timeout=require(_0x6bef('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6bef('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6bef('0x4'));var config=require(_0x6bef('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x6bef('0x6')]('/',auth[_0x6bef('0x7')](),controller['index']);router[_0x6bef('0x6')](_0x6bef('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x6bef('0x6')](_0x6bef('0x9'),auth[_0x6bef('0x7')](),controller[_0x6bef('0xa')]);router[_0x6bef('0x6')](_0x6bef('0xb'),auth[_0x6bef('0x7')](),controller[_0x6bef('0xc')]);router[_0x6bef('0xd')]('/',auth[_0x6bef('0x7')](),controller[_0x6bef('0xe')]);router[_0x6bef('0xd')](_0x6bef('0x9'),auth['isAuthenticated'](),controller[_0x6bef('0xf')]);router[_0x6bef('0x10')](_0x6bef('0x8'),auth[_0x6bef('0x7')](),controller[_0x6bef('0x11')]);router[_0x6bef('0x12')](_0x6bef('0x8'),auth[_0x6bef('0x7')](),controller[_0x6bef('0x13')]);module[_0x6bef('0x14')]=router; \ No newline at end of file +var _0xd0e2=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','getFields','create','post','put','update'];(function(_0xbeb3fb,_0x289ba7){var _0x4b45d5=function(_0xbec96d){while(--_0xbec96d){_0xbeb3fb['push'](_0xbeb3fb['shift']());}};_0x4b45d5(++_0x289ba7);}(_0xd0e2,0x1ad));var _0x2d0e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd0e2[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x2d0e('0x0'));var util=require(_0x2d0e('0x1'));var path=require(_0x2d0e('0x2'));var timeout=require(_0x2d0e('0x3'));var express=require(_0x2d0e('0x4'));var router=express[_0x2d0e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2d0e('0x6'));var interaction=require(_0x2d0e('0x7'));var config=require(_0x2d0e('0x8'));var controller=require(_0x2d0e('0x9'));router['get']('/',auth[_0x2d0e('0xa')](),controller[_0x2d0e('0xb')]);router[_0x2d0e('0xc')]('/:id',auth[_0x2d0e('0xa')](),controller[_0x2d0e('0xd')]);router[_0x2d0e('0xc')](_0x2d0e('0xe'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0xf')]);router[_0x2d0e('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2d0e('0x10')]);router['post']('/',auth[_0x2d0e('0xa')](),controller[_0x2d0e('0x11')]);router[_0x2d0e('0x12')](_0x2d0e('0xe'),auth[_0x2d0e('0xa')](),controller['addConfiguration']);router[_0x2d0e('0x13')]('/:id',auth[_0x2d0e('0xa')](),controller[_0x2d0e('0x14')]);router[_0x2d0e('0x15')](_0x2d0e('0x16'),auth[_0x2d0e('0xa')](),controller[_0x2d0e('0x17')]);module[_0x2d0e('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index feaeebe..c21e772 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 _0x2a17=['STRING','username','remoteUri','sequelize','exports'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x2a17,0x1ac));var _0x72a1=function(_0x36a13b,_0x17000b){_0x36a13b=_0x36a13b-0x0;var _0x3d187e=_0x2a17[_0x36a13b];return _0x3d187e;};'use strict';var Sequelize=require(_0x72a1('0x0'));module[_0x72a1('0x1')]={'name':{'type':Sequelize[_0x72a1('0x2')]},'description':{'type':Sequelize[_0x72a1('0x2')]},'username':{'type':Sequelize[_0x72a1('0x2')],'unique':_0x72a1('0x3')},'password':{'type':Sequelize[_0x72a1('0x2')]},'email':{'type':Sequelize[_0x72a1('0x2')]},'remoteUri':{'type':Sequelize[_0x72a1('0x2')],'unique':_0x72a1('0x4')},'serverUrl':{'type':Sequelize[_0x72a1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x95fa=['exports','STRING','username'];(function(_0x4d0aec,_0x445bbb){var _0x4932be=function(_0x546587){while(--_0x546587){_0x4d0aec['push'](_0x4d0aec['shift']());}};_0x4932be(++_0x445bbb);}(_0x95fa,0x177));var _0xa95f=function(_0x56af92,_0x99670f){_0x56af92=_0x56af92-0x0;var _0x2a067c=_0x95fa[_0x56af92];return _0x2a067c;};'use strict';var Sequelize=require('sequelize');module[_0xa95f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa95f('0x1')]},'username':{'type':Sequelize[_0xa95f('0x1')],'unique':_0xa95f('0x2')},'password':{'type':Sequelize[_0xa95f('0x1')]},'email':{'type':Sequelize[_0xa95f('0x1')]},'remoteUri':{'type':Sequelize[_0xa95f('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa95f('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 6f51e2c..b31e2f6 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 _0xf9b6=['time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','slice','substring','%s/api/now/doc/table/schema/','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','concat','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','getConfigurations','findOne','ServicenowConfiguration','sort','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','close_code','notify','severity','parent','caused_by','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','closed_at','delivery_plan','active','business_service','priority','sys_domain_path','rfc'];(function(_0x1d5afd,_0x413aed){var _0x372175=function(_0x137ab4){while(--_0x137ab4){_0x1d5afd['push'](_0x1d5afd['shift']());}};_0x372175(++_0x413aed);}(_0xf9b6,0x10a));var _0x6f9b=function(_0x12553d,_0x160725){_0x12553d=_0x12553d-0x0;var _0x166267=_0xf9b6[_0x12553d];return _0x166267;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f9b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f9b('0x1'));var BPromise=require(_0x6f9b('0x2'));var Mustache=require(_0x6f9b('0x3'));var util=require(_0x6f9b('0x4'));var path=require(_0x6f9b('0x5'));var sox=require(_0x6f9b('0x6'));var csv=require(_0x6f9b('0x7'));var ejs=require(_0x6f9b('0x8'));var fs=require('fs');var fs_extra=require(_0x6f9b('0x9'));var _=require('lodash');var squel=require(_0x6f9b('0xa'));var crypto=require(_0x6f9b('0xb'));var jsforce=require(_0x6f9b('0xc'));var deskjs=require(_0x6f9b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6f9b('0xe'));var Papa=require(_0x6f9b('0xf'));var Redis=require(_0x6f9b('0x10'));var authService=require(_0x6f9b('0x11'));var qs=require(_0x6f9b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f9b('0x13'))(_0x6f9b('0x14'));var utils=require(_0x6f9b('0x15'));var config=require(_0x6f9b('0x16'));var licenseUtil=require(_0x6f9b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6f9b('0x18'));function respondWithStatusCode(_0x49b806,_0x24c50a){_0x24c50a=_0x24c50a||0xcc;return function(_0x3a955f){if(_0x3a955f){return _0x49b806[_0x6f9b('0x19')](_0x24c50a);}return _0x49b806[_0x6f9b('0x1a')](_0x24c50a)[_0x6f9b('0x1b')]();};}function respondWithResult(_0x6a4c5f,_0x27b473){_0x27b473=_0x27b473||0xc8;return function(_0xc493a){if(_0xc493a){return _0x6a4c5f[_0x6f9b('0x1a')](_0x27b473)['json'](_0xc493a);}};}function respondWithFilteredResult(_0x4ba0d4,_0xc28e57){return function(_0x1f0fee){if(_0x1f0fee){var _0x11042f=typeof _0xc28e57[_0x6f9b('0x1c')]==='undefined'&&typeof _0xc28e57[_0x6f9b('0x1d')]===_0x6f9b('0x1e');var _0x2f5d75=_0x1f0fee[_0x6f9b('0x1f')];var _0x8238aa=_0x11042f?0x0:_0xc28e57[_0x6f9b('0x1c')];var _0x30dd61=_0x11042f?_0x1f0fee[_0x6f9b('0x1f')]:_0xc28e57[_0x6f9b('0x1c')]+_0xc28e57['limit'];var _0x634e0b;if(_0x30dd61>=_0x2f5d75){_0x30dd61=_0x2f5d75;_0x634e0b=0xc8;}else{_0x634e0b=0xce;}_0x4ba0d4['status'](_0x634e0b);return _0x4ba0d4[_0x6f9b('0x20')](_0x6f9b('0x21'),_0x8238aa+'-'+_0x30dd61+'/'+_0x2f5d75)[_0x6f9b('0x22')](_0x1f0fee);}return null;};}function patchUpdates(_0x36a595){return function(_0x1b54f8){try{jsonpatch[_0x6f9b('0x23')](_0x1b54f8,_0x36a595,!![]);}catch(_0x11b0a8){return BPromise[_0x6f9b('0x24')](_0x11b0a8);}return _0x1b54f8[_0x6f9b('0x25')]();};}function saveUpdates(_0x237289,_0x5c57fb){return function(_0x29f8a2){if(_0x29f8a2){return _0x29f8a2[_0x6f9b('0x26')](_0x237289)[_0x6f9b('0x27')](function(_0x3154f6){return _0x3154f6;});}return null;};}function removeEntity(_0x24e4f8,_0x20ca3d){return function(_0x3df53e){if(_0x3df53e){return _0x3df53e[_0x6f9b('0x28')]()[_0x6f9b('0x27')](function(){_0x24e4f8[_0x6f9b('0x1a')](0xcc)[_0x6f9b('0x1b')]();});}};}function handleEntityNotFound(_0x100ce1,_0x20d178){return function(_0x104551){if(!_0x104551){_0x100ce1[_0x6f9b('0x19')](0x194);}return _0x104551;};}function handleError(_0x136ee7,_0x1a3535){_0x1a3535=_0x1a3535||0x1f4;return function(_0x4a6c25){logger[_0x6f9b('0x29')](_0x4a6c25[_0x6f9b('0x2a')]);if(_0x4a6c25[_0x6f9b('0x2b')]){delete _0x4a6c25[_0x6f9b('0x2b')];}_0x136ee7[_0x6f9b('0x1a')](_0x1a3535)[_0x6f9b('0x2c')](_0x4a6c25);};}exports[_0x6f9b('0x2d')]=function(_0xe86c72,_0x4760d2){var _0x388b07={},_0x56e797={},_0x1fab59={'count':0x0,'rows':[]};var _0x411c04=_[_0x6f9b('0x2e')](db[_0x6f9b('0x2f')]['rawAttributes'],function(_0x5ddc54){return{'name':_0x5ddc54[_0x6f9b('0x30')],'type':_0x5ddc54[_0x6f9b('0x31')][_0x6f9b('0x32')]};});_0x56e797[_0x6f9b('0x33')]=_[_0x6f9b('0x2e')](_0x411c04,_0x6f9b('0x2b'));_0x56e797[_0x6f9b('0x34')]=_[_0x6f9b('0x35')](_0xe86c72['query']);_0x56e797[_0x6f9b('0x36')]=_[_0x6f9b('0x37')](_0x56e797['model'],_0x56e797[_0x6f9b('0x34')]);_0x388b07[_0x6f9b('0x38')]=_['intersection'](_0x56e797[_0x6f9b('0x33')],qs['fields'](_0xe86c72[_0x6f9b('0x34')][_0x6f9b('0x39')]));_0x388b07[_0x6f9b('0x38')]=_0x388b07[_0x6f9b('0x38')][_0x6f9b('0x3a')]?_0x388b07[_0x6f9b('0x38')]:_0x56e797[_0x6f9b('0x33')];if(!_0xe86c72[_0x6f9b('0x34')][_0x6f9b('0x3b')](_0x6f9b('0x3c'))){_0x388b07['limit']=qs[_0x6f9b('0x1d')](_0xe86c72[_0x6f9b('0x34')]['limit']);_0x388b07[_0x6f9b('0x1c')]=qs[_0x6f9b('0x1c')](_0xe86c72[_0x6f9b('0x34')][_0x6f9b('0x1c')]);}_0x388b07[_0x6f9b('0x3d')]=qs['sort'](_0xe86c72[_0x6f9b('0x34')]['sort']);_0x388b07[_0x6f9b('0x3e')]=qs[_0x6f9b('0x36')](_[_0x6f9b('0x3f')](_0xe86c72[_0x6f9b('0x34')],_0x56e797['filters']),_0x411c04);if(_0xe86c72[_0x6f9b('0x34')][_0x6f9b('0x40')]){_0x388b07[_0x6f9b('0x3e')]=_[_0x6f9b('0x41')](_0x388b07[_0x6f9b('0x3e')],{'$or':_[_0x6f9b('0x2e')](_0x411c04,function(_0x58a255){if(_0x58a255[_0x6f9b('0x31')]!==_0x6f9b('0x42')){var _0xf33e59={};_0xf33e59[_0x58a255[_0x6f9b('0x2b')]]={'$like':'%'+_0xe86c72[_0x6f9b('0x34')]['filter']+'%'};return _0xf33e59;}})});}_0x388b07=_['merge']({},_0x388b07,_0xe86c72['options']);var _0x46b19f={'where':_0x388b07[_0x6f9b('0x3e')]};return db[_0x6f9b('0x2f')][_0x6f9b('0x1f')](_0x46b19f)[_0x6f9b('0x27')](function(_0x11711f){_0x1fab59['count']=_0x11711f;if(_0xe86c72['query']['includeAll']){_0x388b07['include']=[{'all':!![]}];}return db[_0x6f9b('0x2f')]['findAll'](_0x388b07);})['then'](function(_0x28b884){_0x1fab59[_0x6f9b('0x43')]=_0x28b884;return _0x1fab59;})['then'](respondWithFilteredResult(_0x4760d2,_0x388b07))[_0x6f9b('0x44')](handleError(_0x4760d2,null));};exports[_0x6f9b('0x45')]=function(_0x517f47,_0x2731b0){var _0x334a05={'raw':![],'where':{'id':_0x517f47[_0x6f9b('0x46')]['id']}},_0x249765={};_0x249765[_0x6f9b('0x33')]=_[_0x6f9b('0x35')](db[_0x6f9b('0x2f')][_0x6f9b('0x47')]);_0x249765[_0x6f9b('0x34')]=_[_0x6f9b('0x35')](_0x517f47[_0x6f9b('0x34')]);_0x249765[_0x6f9b('0x36')]=_[_0x6f9b('0x37')](_0x249765[_0x6f9b('0x33')],_0x249765['query']);_0x334a05['attributes']=_[_0x6f9b('0x37')](_0x249765[_0x6f9b('0x33')],qs[_0x6f9b('0x39')](_0x517f47[_0x6f9b('0x34')]['fields']));_0x334a05[_0x6f9b('0x38')]=_0x334a05[_0x6f9b('0x38')][_0x6f9b('0x3a')]?_0x334a05[_0x6f9b('0x38')]:_0x249765[_0x6f9b('0x33')];if(_0x517f47[_0x6f9b('0x34')][_0x6f9b('0x48')]){_0x334a05['include']=[{'all':!![]}];}_0x334a05=_[_0x6f9b('0x41')]({},_0x334a05,_0x517f47[_0x6f9b('0x49')]);return db[_0x6f9b('0x2f')][_0x6f9b('0x4a')](_0x334a05)[_0x6f9b('0x27')](handleEntityNotFound(_0x2731b0,null))[_0x6f9b('0x27')](respondWithResult(_0x2731b0,null))['catch'](handleError(_0x2731b0,null));};exports[_0x6f9b('0x4b')]=function(_0x13d465,_0x579189){return db['ServicenowAccount']['create'](_0x13d465[_0x6f9b('0x4c')],{})[_0x6f9b('0x27')](respondWithResult(_0x579189,0xc9))[_0x6f9b('0x44')](handleError(_0x579189,null));};exports[_0x6f9b('0x26')]=function(_0x41ba5e,_0x4ef4cc){if(_0x41ba5e['body']['id']){delete _0x41ba5e[_0x6f9b('0x4c')]['id'];}return db['ServicenowAccount'][_0x6f9b('0x4a')]({'where':{'id':_0x41ba5e['params']['id']}})[_0x6f9b('0x27')](handleEntityNotFound(_0x4ef4cc,null))[_0x6f9b('0x27')](saveUpdates(_0x41ba5e[_0x6f9b('0x4c')],null))[_0x6f9b('0x27')](respondWithResult(_0x4ef4cc,null))[_0x6f9b('0x44')](handleError(_0x4ef4cc,null));};exports[_0x6f9b('0x28')]=function(_0x192588,_0x459311){return db[_0x6f9b('0x2f')]['find']({'where':{'id':_0x192588[_0x6f9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x459311,null))[_0x6f9b('0x27')](removeEntity(_0x459311,null))[_0x6f9b('0x44')](handleError(_0x459311,null));};exports[_0x6f9b('0x4d')]=function(_0x1ea891,_0x3b8c74,_0x17e50c){var _0x31890e={};var _0x54c45b={};var _0x53404c;var _0x2975c5;return db[_0x6f9b('0x2f')][_0x6f9b('0x4e')]({'where':{'id':_0x1ea891[_0x6f9b('0x46')]['id']}})[_0x6f9b('0x27')](handleEntityNotFound(_0x3b8c74,null))[_0x6f9b('0x27')](function(_0x1e96c5){if(_0x1e96c5){_0x53404c=_0x1e96c5;_0x54c45b[_0x6f9b('0x33')]=_[_0x6f9b('0x35')](db[_0x6f9b('0x4f')]['rawAttributes']);_0x54c45b[_0x6f9b('0x34')]=_[_0x6f9b('0x35')](_0x1ea891[_0x6f9b('0x34')]);_0x54c45b[_0x6f9b('0x36')]=_[_0x6f9b('0x37')](_0x54c45b[_0x6f9b('0x33')],_0x54c45b['query']);_0x31890e[_0x6f9b('0x38')]=_[_0x6f9b('0x37')](_0x54c45b['model'],qs['fields'](_0x1ea891['query'][_0x6f9b('0x39')]));_0x31890e[_0x6f9b('0x38')]=_0x31890e[_0x6f9b('0x38')][_0x6f9b('0x3a')]?_0x31890e['attributes']:_0x54c45b[_0x6f9b('0x33')];_0x31890e['order']=qs[_0x6f9b('0x50')](_0x1ea891[_0x6f9b('0x34')][_0x6f9b('0x50')]);_0x31890e[_0x6f9b('0x3e')]=qs['filters'](_[_0x6f9b('0x3f')](_0x1ea891[_0x6f9b('0x34')],_0x54c45b[_0x6f9b('0x36')]));if(_0x1ea891['query'][_0x6f9b('0x40')]){_0x31890e['where']=_[_0x6f9b('0x41')](_0x31890e[_0x6f9b('0x3e')],{'$or':_['map'](_0x31890e['attributes'],function(_0x5b2842){var _0x243f89={};_0x243f89[_0x5b2842]={'$like':'%'+_0x1ea891['query'][_0x6f9b('0x40')]+'%'};return _0x243f89;})});}_0x31890e=_[_0x6f9b('0x41')]({},_0x31890e,_0x1ea891['options']);return _0x53404c[_0x6f9b('0x4d')](_0x31890e);}})[_0x6f9b('0x27')](function(_0x5925db){if(_0x5925db){_0x2975c5=_0x5925db[_0x6f9b('0x3a')];if(!_0x1ea891['query'][_0x6f9b('0x3b')](_0x6f9b('0x3c'))){_0x31890e['limit']=qs['limit'](_0x1ea891['query'][_0x6f9b('0x1d')]);_0x31890e[_0x6f9b('0x1c')]=qs[_0x6f9b('0x1c')](_0x1ea891[_0x6f9b('0x34')]['offset']);}return _0x53404c[_0x6f9b('0x4d')](_0x31890e);}})[_0x6f9b('0x27')](function(_0x52bb75){if(_0x52bb75){return _0x52bb75?{'count':_0x2975c5,'rows':_0x52bb75}:null;}})[_0x6f9b('0x27')](respondWithResult(_0x3b8c74,null))['catch'](handleError(_0x3b8c74,null));};exports[_0x6f9b('0x51')]=function(_0x2494c7,_0x2ae7af,_0x294003){if(_0x2494c7[_0x6f9b('0x4c')]['id']){delete _0x2494c7[_0x6f9b('0x4c')]['id'];}return db[_0x6f9b('0x2f')][_0x6f9b('0x4e')]({'where':{'id':_0x2494c7['params']['id']}})[_0x6f9b('0x27')](handleEntityNotFound(_0x2ae7af,null))['then'](function(_0x36e229){if(_0x36e229){_0x2494c7[_0x6f9b('0x4c')]['AccountId']=_0x36e229['id'];_0x2494c7['body'][_0x6f9b('0x52')]=integrations[_0x6f9b('0x53')](_0x2494c7[_0x6f9b('0x4c')]['channel'],_0x2494c7[_0x6f9b('0x4c')][_0x6f9b('0x31')]);_0x2494c7[_0x6f9b('0x4c')][_0x6f9b('0x54')]=integrations[_0x6f9b('0x55')](_0x2494c7[_0x6f9b('0x4c')]['channel'],_0x2494c7[_0x6f9b('0x4c')][_0x6f9b('0x31')]);return db[_0x6f9b('0x4f')][_0x6f9b('0x4b')](_0x2494c7[_0x6f9b('0x4c')],{'include':[{'model':db[_0x6f9b('0x56')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x6f9b('0x54')}]});}return null;})[_0x6f9b('0x27')](respondWithResult(_0x2ae7af,null))[_0x6f9b('0x44')](handleError(_0x2ae7af,null));};exports['getFields']=function(_0x223225,_0x52ff69,_0x3a1ba0){var _0x286212=[_0x6f9b('0x57'),_0x6f9b('0x58'),_0x6f9b('0x59'),'subcategory',_0x6f9b('0x5a'),_0x6f9b('0x5b'),'incident_state',_0x6f9b('0x5c'),'category'];var _0x172622=[_0x6f9b('0x5d'),_0x6f9b('0x57'),_0x6f9b('0x5e'),'watch_list',_0x6f9b('0x5f'),'sys_updated_on',_0x6f9b('0x60'),_0x6f9b('0x58'),_0x6f9b('0x61'),_0x6f9b('0x62'),_0x6f9b('0x63'),_0x6f9b('0x64'),_0x6f9b('0x65'),'user_input',_0x6f9b('0x66'),'sys_domain',_0x6f9b('0x67'),_0x6f9b('0x68'),_0x6f9b('0x59'),'order','calendar_stc',_0x6f9b('0x69'),'cmdb_ci',_0x6f9b('0x6a'),'impact',_0x6f9b('0x6b'),'work_notes_list',_0x6f9b('0x6c'),_0x6f9b('0x6d'),_0x6f9b('0x6e'),_0x6f9b('0x6f'),_0x6f9b('0x70'),_0x6f9b('0x71'),_0x6f9b('0x72'),_0x6f9b('0x73'),_0x6f9b('0x74'),'work_end',_0x6f9b('0x75'),_0x6f9b('0x76'),_0x6f9b('0x77'),_0x6f9b('0x78'),_0x6f9b('0x79'),_0x6f9b('0x7a'),_0x6f9b('0x7b'),_0x6f9b('0x5a'),_0x6f9b('0x7c'),_0x6f9b('0x7d'),_0x6f9b('0x7e'),'assignment_group','business_stc',_0x6f9b('0x7f'),'description',_0x6f9b('0x80'),'notify',_0x6f9b('0x81'),_0x6f9b('0x82'),_0x6f9b('0x83'),_0x6f9b('0x84'),_0x6f9b('0x85'),_0x6f9b('0x86'),_0x6f9b('0x87'),_0x6f9b('0x88'),_0x6f9b('0x89'),_0x6f9b('0x8a'),'problem_id',_0x6f9b('0x8b'),_0x6f9b('0x8c'),_0x6f9b('0x8d'),_0x6f9b('0x8e'),_0x6f9b('0x5c'),_0x6f9b('0x8f'),_0x6f9b('0x90'),_0x6f9b('0x91'),_0x6f9b('0x92'),'due_date',_0x6f9b('0x93'),_0x6f9b('0x94'),_0x6f9b('0x95'),_0x6f9b('0x96'),_0x6f9b('0x97'),_0x6f9b('0x98'),_0x6f9b('0x99'),_0x6f9b('0x9a')];var _0xb80f74='';var _0x43bb27='';var _0x1e3da4=[];var _0x513260='';var _0x2e27b9='';var _0x158255=[];var _0x44640b='';var _0x4638c9='';var _0x234de9={};var _0x3ce108='';return db[_0x6f9b('0x2f')][_0x6f9b('0x4e')]({'where':{'id':_0x223225['params']['id']},'attributes':['id',_0x6f9b('0x9b'),_0x6f9b('0x9c'),_0x6f9b('0x9d'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x52ff69,null))[_0x6f9b('0x27')](function(_0x566218){if(_0x566218){_0x3ce108=_0x566218[_0x6f9b('0x9e')];var _0xa691d0=_0x3ce108[_0x6f9b('0x9f')](-0x1);if(_0xa691d0==='/'){_0x3ce108=_0x3ce108[_0x6f9b('0xa0')](0x0,_0x3ce108['lastIndexOf'](_0xa691d0));}_0x4638c9=util['format'](_0x6f9b('0xa1'),_0x3ce108);_0x44640b=util[_0x6f9b('0xa2')]('%s/api/now/table/',_0x3ce108);_0x234de9={'user':_0x566218[_0x6f9b('0x9b')],'pass':_0x566218[_0x6f9b('0x9c')]};var _0x4f3bbb={'method':_0x6f9b('0xa3'),'uri':_0x4638c9+_0x6f9b('0xa4'),'auth':_0x234de9,'json':!![]};return rp(_0x4f3bbb);}})[_0x6f9b('0x27')](function(_0x547eae){if(_0x547eae[_0x6f9b('0xa5')]['length']>0x0){_0xb80f74=_0x547eae[_0x6f9b('0xa5')];}console[_0x6f9b('0xa6')](_0x6f9b('0xa7'),_0xb80f74);_0x158255=[];_0x43bb27=Object['assign']([],_0xb80f74);_[_0x6f9b('0xa8')](_0x43bb27,function(_0x3547bf){return!_0x286212[_0x6f9b('0xa9')](_0x3547bf[_0x6f9b('0x2b')]);});_0x43bb27[_0x6f9b('0xaa')](function(_0x5e533d){var _0xc8871d=createFieldObject(_0x44640b,_0x234de9,_0x5e533d[_0x6f9b('0xab')],_0x5e533d[_0x6f9b('0x2b')],_0x5e533d[_0x6f9b('0xac')],![]);_0x158255[_0x6f9b('0xad')](_0xc8871d);});return Promise[_0x6f9b('0xae')](_0x158255);})[_0x6f9b('0x27')](function(_0x298e07){_0x1e3da4=_0x298e07;_0x513260=Object[_0x6f9b('0xaf')]([],_0xb80f74);console[_0x6f9b('0xa6')](_0x6f9b('0xb0'),_0xb80f74);_['remove'](_0x513260,function(_0x5f0a93){return _0x172622[_0x6f9b('0xa9')](_0x5f0a93[_0x6f9b('0x2b')]);});console[_0x6f9b('0xa6')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x513260);_0x158255=[];_0x513260[_0x6f9b('0xaa')](function(_0x1809c6){var _0x464af6=createFieldObject(_0x44640b,_0x234de9,_0x1809c6[_0x6f9b('0xab')],_0x1809c6[_0x6f9b('0x2b')],_0x1809c6['label'],!![]);_0x158255['push'](_0x464af6);});return Promise['all'](_0x158255);})[_0x6f9b('0x27')](function(_0x4d20b5){_0x2e27b9=_0x4d20b5;var _0x502ee2=_0x1e3da4[_0x6f9b('0xb1')](_0x2e27b9);return{'count':_0x502ee2[_0x6f9b('0x3a')],'rows':_0x502ee2};})[_0x6f9b('0x27')](respondWithResult(_0x52ff69,null))['catch'](function(_0x115761){console['log']('ServiceNow\x20error:\x20'+_0x115761);var _0x24c2dd=_0x223225[_0x6f9b('0x34')][_0x6f9b('0xb2')]?0x1f4:_0x115761[_0x6f9b('0xb3')]||0x1f4;logger[_0x6f9b('0x29')](_0x115761[_0x6f9b('0x2a')]);delete _0x115761[_0x6f9b('0x2b')];if(_0x24c2dd===0x191){_0x24c2dd=0x190;}_0x52ff69[_0x6f9b('0x1a')](_0x24c2dd)['send'](_0x223225[_0x6f9b('0x34')][_0x6f9b('0xb2')]?{'message':_0x6f9b('0xb4'),'statusCode':_0x115761[_0x6f9b('0xb3')]}:_0x115761);});};function createFieldObject(_0x53f7a8,_0x2c40ab,_0x586ff8,_0x5158cd,_0x1ce86f,_0x2d0f9c){return new Promise(function(_0xc3c489,_0x56b252){var _0x10c811={'id':_0x5158cd,'name':_0x1ce86f,'custom':_0x2d0f9c};if(_0x586ff8===_0x6f9b('0xb5')){_0x10c811['options']=[{'name':_0x6f9b('0xb6'),'value':_0x6f9b('0xb7')},{'name':_0x6f9b('0xb8'),'value':_0x6f9b('0xb9')}];_0xc3c489(_0x10c811);}else{var _0x139d03={'method':_0x6f9b('0xa3'),'uri':_0x53f7a8+_0x6f9b('0xba')+_0x5158cd,'auth':_0x2c40ab,'json':!![]};return rp(_0x139d03)[_0x6f9b('0x27')](function(_0x28a076){var _0x44600e=[];if(_0x28a076[_0x6f9b('0xa5')][_0x6f9b('0x3a')]>0x0){_0x28a076[_0x6f9b('0xa5')][_0x6f9b('0xaa')](function(_0x39c975){if(_0x39c975[_0x6f9b('0xbb')]===_0x6f9b('0xb9')){var _0x35a9d4={'name':_0x39c975[_0x6f9b('0xac')],'value':_0x39c975[_0x6f9b('0xbc')]};_0x44600e['push'](_0x35a9d4);}});}_0x10c811[_0x6f9b('0x49')]=_0x44600e;if(_0x10c811[_0x6f9b('0x49')]['length']>0x0){_0xc3c489(_0x10c811);}else{if(_0x2d0f9c==![]){_0xc3c489();}else{_0xc3c489(_0x10c811);}}});}});} \ No newline at end of file +var _0x9936=['business_duration','group_list','reopened_time','caller_id','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','contact_type','reopened_by','urgency','problem_id','company','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','assign','remove','includes','forEach','internalType','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','Wrong\x20credentials','boolean','True','False','false','result','inactive','value','rimraf','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','reject','save','destroy','then','error','stack','name','send','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ServicenowAccount','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','hold_reason','subcategory','notify','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','knowledge','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9936,0x104));var _0x6993=function(_0x298be3,_0x2ebf8f){_0x298be3=_0x298be3-0x0;var _0x286f11=_0x9936[_0x298be3];return _0x286f11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6993('0x0'));var zipdir=require(_0x6993('0x1'));var jsonpatch=require(_0x6993('0x2'));var rp=require(_0x6993('0x3'));var moment=require(_0x6993('0x4'));var BPromise=require(_0x6993('0x5'));var Mustache=require(_0x6993('0x6'));var util=require(_0x6993('0x7'));var path=require(_0x6993('0x8'));var sox=require(_0x6993('0x9'));var csv=require('to-csv');var ejs=require(_0x6993('0xa'));var fs=require('fs');var fs_extra=require(_0x6993('0xb'));var _=require(_0x6993('0xc'));var squel=require(_0x6993('0xd'));var crypto=require(_0x6993('0xe'));var jsforce=require(_0x6993('0xf'));var deskjs=require(_0x6993('0x10'));var toCsv=require(_0x6993('0x11'));var querystring=require(_0x6993('0x12'));var Papa=require('papaparse');var Redis=require(_0x6993('0x13'));var authService=require(_0x6993('0x14'));var qs=require(_0x6993('0x15'));var as=require(_0x6993('0x16'));var hardwareService=require(_0x6993('0x17'));var logger=require(_0x6993('0x18'))(_0x6993('0x19'));var utils=require(_0x6993('0x1a'));var config=require(_0x6993('0x1b'));var licenseUtil=require(_0x6993('0x1c'));var db=require(_0x6993('0x1d'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e59b8,_0x5369b7){_0x5369b7=_0x5369b7||0xcc;return function(_0x4ec03d){if(_0x4ec03d){return _0x4e59b8[_0x6993('0x1e')](_0x5369b7);}return _0x4e59b8[_0x6993('0x1f')](_0x5369b7)[_0x6993('0x20')]();};}function respondWithResult(_0x1fbc25,_0x5d86a1){_0x5d86a1=_0x5d86a1||0xc8;return function(_0x5c842a){if(_0x5c842a){return _0x1fbc25[_0x6993('0x1f')](_0x5d86a1)[_0x6993('0x21')](_0x5c842a);}};}function respondWithFilteredResult(_0x5000b1,_0x217dbb){return function(_0x50584a){if(_0x50584a){var _0x519445=typeof _0x217dbb['offset']===_0x6993('0x22')&&typeof _0x217dbb['limit']===_0x6993('0x22');var _0x53e78a=_0x50584a['count'];var _0x163f5d=_0x519445?0x0:_0x217dbb[_0x6993('0x23')];var _0x302e7c=_0x519445?_0x50584a['count']:_0x217dbb[_0x6993('0x23')]+_0x217dbb[_0x6993('0x24')];var _0x335049;if(_0x302e7c>=_0x53e78a){_0x302e7c=_0x53e78a;_0x335049=0xc8;}else{_0x335049=0xce;}_0x5000b1['status'](_0x335049);return _0x5000b1[_0x6993('0x25')](_0x6993('0x26'),_0x163f5d+'-'+_0x302e7c+'/'+_0x53e78a)['json'](_0x50584a);}return null;};}function patchUpdates(_0x212212){return function(_0xd6d603){try{jsonpatch['apply'](_0xd6d603,_0x212212,!![]);}catch(_0x1dd199){return BPromise[_0x6993('0x27')](_0x1dd199);}return _0xd6d603[_0x6993('0x28')]();};}function saveUpdates(_0x516b45,_0x7d1a8d){return function(_0x3befe7){if(_0x3befe7){return _0x3befe7['update'](_0x516b45)['then'](function(_0x20f5f3){return _0x20f5f3;});}return null;};}function removeEntity(_0x4dd743,_0xa3656c){return function(_0x1d1254){if(_0x1d1254){return _0x1d1254[_0x6993('0x29')]()[_0x6993('0x2a')](function(){_0x4dd743[_0x6993('0x1f')](0xcc)[_0x6993('0x20')]();});}};}function handleEntityNotFound(_0xf93363,_0x154032){return function(_0x188a9f){if(!_0x188a9f){_0xf93363[_0x6993('0x1e')](0x194);}return _0x188a9f;};}function handleError(_0x406a0b,_0x44fde0){_0x44fde0=_0x44fde0||0x1f4;return function(_0x54d0dd){logger[_0x6993('0x2b')](_0x54d0dd[_0x6993('0x2c')]);if(_0x54d0dd[_0x6993('0x2d')]){delete _0x54d0dd[_0x6993('0x2d')];}_0x406a0b[_0x6993('0x1f')](_0x44fde0)[_0x6993('0x2e')](_0x54d0dd);};}exports['index']=function(_0x31a88e,_0x26abc7){var _0x488028={},_0x1f90ad={},_0x34f09e={'count':0x0,'rows':[]};var _0x4cf3f7=_[_0x6993('0x2f')](db['ServicenowAccount']['rawAttributes'],function(_0x266843){return{'name':_0x266843[_0x6993('0x30')],'type':_0x266843[_0x6993('0x31')][_0x6993('0x32')]};});_0x1f90ad[_0x6993('0x33')]=_[_0x6993('0x2f')](_0x4cf3f7,_0x6993('0x2d'));_0x1f90ad[_0x6993('0x34')]=_['keys'](_0x31a88e[_0x6993('0x34')]);_0x1f90ad[_0x6993('0x35')]=_['intersection'](_0x1f90ad['model'],_0x1f90ad[_0x6993('0x34')]);_0x488028[_0x6993('0x36')]=_[_0x6993('0x37')](_0x1f90ad[_0x6993('0x33')],qs[_0x6993('0x38')](_0x31a88e[_0x6993('0x34')][_0x6993('0x38')]));_0x488028[_0x6993('0x36')]=_0x488028[_0x6993('0x36')][_0x6993('0x39')]?_0x488028[_0x6993('0x36')]:_0x1f90ad[_0x6993('0x33')];if(!_0x31a88e['query']['hasOwnProperty'](_0x6993('0x3a'))){_0x488028[_0x6993('0x24')]=qs['limit'](_0x31a88e[_0x6993('0x34')][_0x6993('0x24')]);_0x488028[_0x6993('0x23')]=qs[_0x6993('0x23')](_0x31a88e[_0x6993('0x34')][_0x6993('0x23')]);}_0x488028[_0x6993('0x3b')]=qs[_0x6993('0x3c')](_0x31a88e[_0x6993('0x34')]['sort']);_0x488028[_0x6993('0x3d')]=qs[_0x6993('0x35')](_[_0x6993('0x3e')](_0x31a88e[_0x6993('0x34')],_0x1f90ad[_0x6993('0x35')]),_0x4cf3f7);if(_0x31a88e[_0x6993('0x34')]['filter']){_0x488028[_0x6993('0x3d')]=_[_0x6993('0x3f')](_0x488028[_0x6993('0x3d')],{'$or':_[_0x6993('0x2f')](_0x4cf3f7,function(_0x5e8b51){if(_0x5e8b51[_0x6993('0x31')]!==_0x6993('0x40')){var _0x32a5cf={};_0x32a5cf[_0x5e8b51['name']]={'$like':'%'+_0x31a88e[_0x6993('0x34')][_0x6993('0x41')]+'%'};return _0x32a5cf;}})});}_0x488028=_[_0x6993('0x3f')]({},_0x488028,_0x31a88e[_0x6993('0x42')]);var _0x5434bf={'where':_0x488028[_0x6993('0x3d')]};return db[_0x6993('0x43')][_0x6993('0x44')](_0x5434bf)['then'](function(_0x2008b4){_0x34f09e['count']=_0x2008b4;if(_0x31a88e[_0x6993('0x34')][_0x6993('0x45')]){_0x488028[_0x6993('0x46')]=[{'all':!![]}];}return db[_0x6993('0x43')][_0x6993('0x47')](_0x488028);})[_0x6993('0x2a')](function(_0x59af0e){_0x34f09e[_0x6993('0x48')]=_0x59af0e;return _0x34f09e;})[_0x6993('0x2a')](respondWithFilteredResult(_0x26abc7,_0x488028))[_0x6993('0x49')](handleError(_0x26abc7,null));};exports[_0x6993('0x4a')]=function(_0x28b051,_0x52dcf1){var _0x7e115b={'raw':![],'where':{'id':_0x28b051[_0x6993('0x4b')]['id']}},_0x2614c5={};_0x2614c5['model']=_[_0x6993('0x4c')](db[_0x6993('0x43')][_0x6993('0x4d')]);_0x2614c5[_0x6993('0x34')]=_[_0x6993('0x4c')](_0x28b051['query']);_0x2614c5['filters']=_['intersection'](_0x2614c5[_0x6993('0x33')],_0x2614c5[_0x6993('0x34')]);_0x7e115b[_0x6993('0x36')]=_['intersection'](_0x2614c5['model'],qs['fields'](_0x28b051['query'][_0x6993('0x38')]));_0x7e115b['attributes']=_0x7e115b[_0x6993('0x36')][_0x6993('0x39')]?_0x7e115b[_0x6993('0x36')]:_0x2614c5[_0x6993('0x33')];if(_0x28b051[_0x6993('0x34')][_0x6993('0x45')]){_0x7e115b['include']=[{'all':!![]}];}_0x7e115b=_[_0x6993('0x3f')]({},_0x7e115b,_0x28b051[_0x6993('0x42')]);return db['ServicenowAccount'][_0x6993('0x4e')](_0x7e115b)[_0x6993('0x2a')](handleEntityNotFound(_0x52dcf1,null))[_0x6993('0x2a')](respondWithResult(_0x52dcf1,null))[_0x6993('0x49')](handleError(_0x52dcf1,null));};exports['create']=function(_0x1aaa5d,_0xfc3abb){return db['ServicenowAccount'][_0x6993('0x4f')](_0x1aaa5d[_0x6993('0x50')],{})[_0x6993('0x2a')](respondWithResult(_0xfc3abb,0xc9))['catch'](handleError(_0xfc3abb,null));};exports[_0x6993('0x51')]=function(_0x2a5502,_0x43e39c){if(_0x2a5502[_0x6993('0x50')]['id']){delete _0x2a5502['body']['id'];}return db[_0x6993('0x43')][_0x6993('0x4e')]({'where':{'id':_0x2a5502[_0x6993('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43e39c,null))['then'](saveUpdates(_0x2a5502[_0x6993('0x50')],null))[_0x6993('0x2a')](respondWithResult(_0x43e39c,null))[_0x6993('0x49')](handleError(_0x43e39c,null));};exports[_0x6993('0x29')]=function(_0x3d5bf2,_0x30e7a9){return db['ServicenowAccount'][_0x6993('0x4e')]({'where':{'id':_0x3d5bf2[_0x6993('0x4b')]['id']}})[_0x6993('0x2a')](handleEntityNotFound(_0x30e7a9,null))[_0x6993('0x2a')](removeEntity(_0x30e7a9,null))[_0x6993('0x49')](handleError(_0x30e7a9,null));};exports['getConfigurations']=function(_0x22a191,_0x547e3f,_0xb9cf25){var _0x80ea64={};var _0x533813={};var _0x78a3b9;var _0x48b8ae;return db[_0x6993('0x43')][_0x6993('0x52')]({'where':{'id':_0x22a191[_0x6993('0x4b')]['id']}})[_0x6993('0x2a')](handleEntityNotFound(_0x547e3f,null))[_0x6993('0x2a')](function(_0x5e2e1d){if(_0x5e2e1d){_0x78a3b9=_0x5e2e1d;_0x533813[_0x6993('0x33')]=_['keys'](db[_0x6993('0x53')][_0x6993('0x4d')]);_0x533813['query']=_[_0x6993('0x4c')](_0x22a191[_0x6993('0x34')]);_0x533813[_0x6993('0x35')]=_[_0x6993('0x37')](_0x533813[_0x6993('0x33')],_0x533813['query']);_0x80ea64[_0x6993('0x36')]=_[_0x6993('0x37')](_0x533813[_0x6993('0x33')],qs[_0x6993('0x38')](_0x22a191[_0x6993('0x34')][_0x6993('0x38')]));_0x80ea64[_0x6993('0x36')]=_0x80ea64['attributes'][_0x6993('0x39')]?_0x80ea64[_0x6993('0x36')]:_0x533813[_0x6993('0x33')];_0x80ea64['order']=qs[_0x6993('0x3c')](_0x22a191[_0x6993('0x34')][_0x6993('0x3c')]);_0x80ea64[_0x6993('0x3d')]=qs[_0x6993('0x35')](_[_0x6993('0x3e')](_0x22a191[_0x6993('0x34')],_0x533813[_0x6993('0x35')]));if(_0x22a191['query'][_0x6993('0x41')]){_0x80ea64[_0x6993('0x3d')]=_['merge'](_0x80ea64[_0x6993('0x3d')],{'$or':_[_0x6993('0x2f')](_0x80ea64['attributes'],function(_0x4a5135){var _0xf41430={};_0xf41430[_0x4a5135]={'$like':'%'+_0x22a191[_0x6993('0x34')][_0x6993('0x41')]+'%'};return _0xf41430;})});}_0x80ea64=_[_0x6993('0x3f')]({},_0x80ea64,_0x22a191[_0x6993('0x42')]);return _0x78a3b9['getConfigurations'](_0x80ea64);}})[_0x6993('0x2a')](function(_0x27d2d3){if(_0x27d2d3){_0x48b8ae=_0x27d2d3[_0x6993('0x39')];if(!_0x22a191['query']['hasOwnProperty'](_0x6993('0x3a'))){_0x80ea64[_0x6993('0x24')]=qs[_0x6993('0x24')](_0x22a191[_0x6993('0x34')][_0x6993('0x24')]);_0x80ea64['offset']=qs[_0x6993('0x23')](_0x22a191[_0x6993('0x34')][_0x6993('0x23')]);}return _0x78a3b9['getConfigurations'](_0x80ea64);}})[_0x6993('0x2a')](function(_0x67d793){if(_0x67d793){return _0x67d793?{'count':_0x48b8ae,'rows':_0x67d793}:null;}})[_0x6993('0x2a')](respondWithResult(_0x547e3f,null))[_0x6993('0x49')](handleError(_0x547e3f,null));};exports[_0x6993('0x54')]=function(_0x54ab90,_0x224140,_0x4fdb61){if(_0x54ab90[_0x6993('0x50')]['id']){delete _0x54ab90[_0x6993('0x50')]['id'];}return db[_0x6993('0x43')][_0x6993('0x52')]({'where':{'id':_0x54ab90[_0x6993('0x4b')]['id']}})[_0x6993('0x2a')](handleEntityNotFound(_0x224140,null))[_0x6993('0x2a')](function(_0x1dfc89){if(_0x1dfc89){_0x54ab90[_0x6993('0x50')][_0x6993('0x55')]=_0x1dfc89['id'];_0x54ab90[_0x6993('0x50')][_0x6993('0x56')]=integrations[_0x6993('0x57')](_0x54ab90[_0x6993('0x50')]['channel'],_0x54ab90[_0x6993('0x50')][_0x6993('0x31')]);_0x54ab90[_0x6993('0x50')][_0x6993('0x58')]=integrations[_0x6993('0x59')](_0x54ab90[_0x6993('0x50')][_0x6993('0x5a')],_0x54ab90[_0x6993('0x50')][_0x6993('0x31')]);return db[_0x6993('0x53')]['create'](_0x54ab90['body'],{'include':[{'model':db[_0x6993('0x5b')],'as':_0x6993('0x56')},{'model':db['ServicenowField'],'as':_0x6993('0x58')}]});}return null;})[_0x6993('0x2a')](respondWithResult(_0x224140,null))[_0x6993('0x49')](handleError(_0x224140,null));};exports[_0x6993('0x5c')]=function(_0x38e45c,_0x1afceb,_0x3c2419){var _0x4a22c1=['made_sla',_0x6993('0x5d'),'knowledge',_0x6993('0x5e'),'close_code',_0x6993('0x5f'),'incident_state',_0x6993('0x60'),_0x6993('0x61')];var _0x3f2f9e=['parent','made_sla',_0x6993('0x62'),_0x6993('0x63'),_0x6993('0x64'),_0x6993('0x65'),_0x6993('0x66'),_0x6993('0x5d'),_0x6993('0x67'),_0x6993('0x68'),_0x6993('0x69'),_0x6993('0x6a'),_0x6993('0x6b'),'user_input',_0x6993('0x6c'),'sys_domain',_0x6993('0x6d'),_0x6993('0x6e'),_0x6993('0x6f'),_0x6993('0x3b'),'calendar_stc',_0x6993('0x70'),_0x6993('0x71'),_0x6993('0x72'),_0x6993('0x73'),_0x6993('0x74'),_0x6993('0x75'),_0x6993('0x76'),_0x6993('0x77'),_0x6993('0x78'),'rfc',_0x6993('0x79'),_0x6993('0x7a'),_0x6993('0x7b'),_0x6993('0x7c'),_0x6993('0x7d'),'work_end',_0x6993('0x7e'),'resolved_at',_0x6993('0x7f'),'approval_set',_0x6993('0x5e'),_0x6993('0x80'),_0x6993('0x81'),_0x6993('0x82'),_0x6993('0x83'),_0x6993('0x84'),_0x6993('0x85'),_0x6993('0x86'),'business_stc',_0x6993('0x87'),_0x6993('0x88'),_0x6993('0x89'),_0x6993('0x5f'),_0x6993('0x8a'),_0x6993('0x8b'),_0x6993('0x8c'),_0x6993('0x8d'),'parent_incident','sys_id',_0x6993('0x8e'),_0x6993('0x8f'),'incident_state',_0x6993('0x90'),_0x6993('0x91'),_0x6993('0x92'),'reassignment_count','activity_due',_0x6993('0x93'),_0x6993('0x60'),_0x6993('0x94'),_0x6993('0x95'),_0x6993('0x96'),_0x6993('0x97'),_0x6993('0x98'),_0x6993('0x99'),'reopen_count','sys_tags',_0x6993('0x9a'),_0x6993('0x9b'),_0x6993('0x9c'),_0x6993('0x9d'),_0x6993('0x61')];var _0x50bc67='';var _0x2c1287='';var _0x17ed66=[];var _0x2c9bc8='';var _0x42df48='';var _0x16ea2e=[];var _0x14eded='';var _0x1b11f0='';var _0x227b14={};var _0x43da8b='';return db[_0x6993('0x43')][_0x6993('0x52')]({'where':{'id':_0x38e45c[_0x6993('0x4b')]['id']},'attributes':['id',_0x6993('0x9e'),_0x6993('0x9f'),_0x6993('0xa0'),_0x6993('0xa1'),_0x6993('0xa2')]})[_0x6993('0x2a')](handleEntityNotFound(_0x1afceb,null))[_0x6993('0x2a')](function(_0x3b5b84){if(_0x3b5b84){_0x43da8b=_0x3b5b84['remoteUri'];var _0x3dcef0=_0x43da8b[_0x6993('0xa3')](-0x1);if(_0x3dcef0==='/'){_0x43da8b=_0x43da8b[_0x6993('0xa4')](0x0,_0x43da8b[_0x6993('0xa5')](_0x3dcef0));}_0x1b11f0=util[_0x6993('0xa6')]('%s/api/now/doc/table/schema/',_0x43da8b);_0x14eded=util[_0x6993('0xa6')](_0x6993('0xa7'),_0x43da8b);_0x227b14={'user':_0x3b5b84[_0x6993('0x9e')],'pass':_0x3b5b84[_0x6993('0x9f')]};var _0x3ab964={'method':_0x6993('0xa8'),'uri':_0x1b11f0+_0x6993('0xa9'),'auth':_0x227b14,'json':!![]};return rp(_0x3ab964);}})['then'](function(_0x1aaee6){if(_0x1aaee6['result']['length']>0x0){_0x50bc67=_0x1aaee6['result'];}console['log']('incident\x20table\x20objects',_0x50bc67);_0x16ea2e=[];_0x2c1287=Object[_0x6993('0xaa')]([],_0x50bc67);_[_0x6993('0xab')](_0x2c1287,function(_0x3c557a){return!_0x4a22c1[_0x6993('0xac')](_0x3c557a['name']);});_0x2c1287[_0x6993('0xad')](function(_0xae5e4d){var _0x30313a=createFieldObject(_0x14eded,_0x227b14,_0xae5e4d[_0x6993('0xae')],_0xae5e4d[_0x6993('0x2d')],_0xae5e4d[_0x6993('0xaf')],![]);_0x16ea2e[_0x6993('0xb0')](_0x30313a);});return Promise[_0x6993('0xb1')](_0x16ea2e);})['then'](function(_0x5eb187){_0x17ed66=_0x5eb187;_0x2c9bc8=Object[_0x6993('0xaa')]([],_0x50bc67);console[_0x6993('0xb2')](_0x6993('0xb3'),_0x50bc67);_[_0x6993('0xab')](_0x2c9bc8,function(_0x196b36){return _0x3f2f9e[_0x6993('0xac')](_0x196b36[_0x6993('0x2d')]);});console['log'](_0x6993('0xb4'),_0x2c9bc8);_0x16ea2e=[];_0x2c9bc8[_0x6993('0xad')](function(_0x10274a){var _0x385291=createFieldObject(_0x14eded,_0x227b14,_0x10274a[_0x6993('0xae')],_0x10274a[_0x6993('0x2d')],_0x10274a[_0x6993('0xaf')],!![]);_0x16ea2e[_0x6993('0xb0')](_0x385291);});return Promise[_0x6993('0xb1')](_0x16ea2e);})['then'](function(_0x35ca96){_0x42df48=_0x35ca96;var _0x469006=_0x17ed66[_0x6993('0xb5')](_0x42df48);return{'count':_0x469006[_0x6993('0x39')],'rows':_0x469006};})['then'](respondWithResult(_0x1afceb,null))['catch'](function(_0x11cf12){console[_0x6993('0xb2')]('ServiceNow\x20error:\x20'+_0x11cf12);var _0x1e7186=_0x38e45c[_0x6993('0x34')][_0x6993('0xb6')]?0x1f4:_0x11cf12[_0x6993('0xb7')]||0x1f4;logger['error'](_0x11cf12['stack']);delete _0x11cf12[_0x6993('0x2d')];if(_0x1e7186===0x191){_0x1e7186=0x190;}_0x1afceb['status'](_0x1e7186)[_0x6993('0x2e')](_0x38e45c[_0x6993('0x34')][_0x6993('0xb6')]?{'message':_0x6993('0xb8'),'statusCode':_0x11cf12[_0x6993('0xb7')]}:_0x11cf12);});};function createFieldObject(_0x24badd,_0x5249f3,_0x49fad9,_0x394105,_0x48bf4c,_0x266588){return new Promise(function(_0x3c3de1,_0x244759){var _0x23af9e={'id':_0x394105,'name':_0x48bf4c,'custom':_0x266588};if(_0x49fad9===_0x6993('0xb9')){_0x23af9e[_0x6993('0x42')]=[{'name':_0x6993('0xba'),'value':'true'},{'name':_0x6993('0xbb'),'value':_0x6993('0xbc')}];_0x3c3de1(_0x23af9e);}else{var _0x2b3259={'method':_0x6993('0xa8'),'uri':_0x24badd+'sys_choice?sysparm_query=name=incident^element='+_0x394105,'auth':_0x5249f3,'json':!![]};return rp(_0x2b3259)[_0x6993('0x2a')](function(_0x35bbb0){var _0x48dcac=[];if(_0x35bbb0[_0x6993('0xbd')][_0x6993('0x39')]>0x0){_0x35bbb0[_0x6993('0xbd')][_0x6993('0xad')](function(_0x17f3d7){if(_0x17f3d7[_0x6993('0xbe')]===_0x6993('0xbc')){var _0x229070={'name':_0x17f3d7['label'],'value':_0x17f3d7[_0x6993('0xbf')]};_0x48dcac[_0x6993('0xb0')](_0x229070);}});}_0x23af9e[_0x6993('0x42')]=_0x48dcac;if(_0x23af9e[_0x6993('0x42')]['length']>0x0){_0x3c3de1(_0x23af9e);}else{if(_0x266588==![]){_0x3c3de1();}else{_0x3c3de1(_0x23af9e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index dbcf071..020c6ff 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 _0xc4aa=['bluebird','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment'];(function(_0xf6fdc1,_0x5175ee){var _0x5da083=function(_0xb6df0e){while(--_0xb6df0e){_0xf6fdc1['push'](_0xf6fdc1['shift']());}};_0x5da083(++_0x5175ee);}(_0x46ed,0x168));var _0xd46e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46ed[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));var integrations=require(_0xd46e('0x8'));module[_0xd46e('0x9')]=function(_0x25cf78,_0x45e680){return _0x25cf78[_0xd46e('0xa')](_0xd46e('0xb'),attributes,{'tableName':_0xd46e('0xc'),'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 c4e7f96..3533bec 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 _0x8be6=['GetServicenowAccount','ServicenowAccount','options','raw','limit','include','model','attributes','map','stringify','catch','ShowServicenowAccount','find','where','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x8be6,0x158));var _0x68be=function(_0xe6c94c,_0x16828b){_0xe6c94c=_0xe6c94c-0x0;var _0x5430db=_0x8be6[_0xe6c94c];return _0x5430db;};'use strict';var _=require(_0x68be('0x0'));var util=require('util');var moment=require(_0x68be('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68be('0x2'));var db=require(_0x68be('0x3'))['db'];var utils=require(_0x68be('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x68be('0x5'));var jayson=require(_0x68be('0x6'));var client=jayson['client'][_0x68be('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ca2eb,_0x18a52e,_0x18f9fa){return new BPromise(function(_0x17fe9c,_0x1fcc92){return client[_0x68be('0x8')](_0x3ca2eb,_0x18f9fa)[_0x68be('0x9')](function(_0x1823f1){logger['info'](_0x68be('0xa'),_0x18a52e,_0x68be('0xb'));logger[_0x68be('0xc')](_0x68be('0xd'),_0x18a52e,_0x68be('0xb'),JSON['stringify'](_0x1823f1));if(_0x1823f1[_0x68be('0xe')]){if(_0x1823f1[_0x68be('0xe')][_0x68be('0xf')]===0x1f4){logger[_0x68be('0xe')](_0x68be('0xa'),_0x18a52e,_0x1823f1['error'][_0x68be('0x10')]);return _0x1fcc92(_0x1823f1[_0x68be('0xe')]['message']);}logger[_0x68be('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x18a52e,_0x1823f1[_0x68be('0xe')]['message']);return _0x17fe9c(_0x1823f1[_0x68be('0xe')][_0x68be('0x10')]);}else{logger[_0x68be('0x11')](_0x68be('0xa'),_0x18a52e,_0x68be('0xb'));_0x17fe9c(_0x1823f1[_0x68be('0x12')][_0x68be('0x10')]);}})['catch'](function(_0x2da27d){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x18a52e,_0x2da27d);_0x1fcc92(_0x2da27d);});});}exports[_0x68be('0x13')]=function(_0x37952f){var _0x416f04=this;return new Promise(function(_0x4d5b38,_0x17d55a){return db[_0x68be('0x14')]['findAll']({'raw':_0x37952f['options']?_0x37952f[_0x68be('0x15')][_0x68be('0x16')]===undefined?!![]:![]:!![],'where':_0x37952f[_0x68be('0x15')]?_0x37952f[_0x68be('0x15')]['where']||null:null,'attributes':_0x37952f['options']?_0x37952f[_0x68be('0x15')]['attributes']||null:null,'limit':_0x37952f[_0x68be('0x15')]?_0x37952f['options'][_0x68be('0x17')]||null:null,'include':_0x37952f['options']?_0x37952f[_0x68be('0x15')][_0x68be('0x18')]?_['map'](_0x37952f[_0x68be('0x15')][_0x68be('0x18')],function(_0x276ca9){return{'model':db[_0x276ca9[_0x68be('0x19')]],'as':_0x276ca9['as'],'attributes':_0x276ca9[_0x68be('0x1a')],'include':_0x276ca9[_0x68be('0x18')]?_[_0x68be('0x1b')](_0x276ca9[_0x68be('0x18')],function(_0x30fbd1){return{'model':db[_0x30fbd1[_0x68be('0x19')]],'as':_0x30fbd1['as'],'attributes':_0x30fbd1[_0x68be('0x1a')],'include':_0x30fbd1[_0x68be('0x18')]?_[_0x68be('0x1b')](_0x30fbd1['include'],function(_0x5d3e25){return{'model':db[_0x5d3e25['model']],'as':_0x5d3e25['as'],'attributes':_0x5d3e25[_0x68be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68be('0x9')](function(_0x279dca){logger[_0x68be('0x11')](_0x68be('0x13'),_0x37952f);logger[_0x68be('0xc')](_0x68be('0x13'),_0x37952f,JSON[_0x68be('0x1c')](_0x279dca));_0x4d5b38(_0x279dca);})[_0x68be('0x1d')](function(_0x14ddd9){logger[_0x68be('0xe')](_0x68be('0x13'),_0x14ddd9[_0x68be('0x10')],_0x37952f);_0x17d55a(_0x416f04['error'](0x1f4,_0x14ddd9[_0x68be('0x10')]));});});};exports[_0x68be('0x1e')]=function(_0x3abfe1){var _0x5b41af=this;return new Promise(function(_0x109c3e,_0x26855e){return db[_0x68be('0x14')][_0x68be('0x1f')]({'raw':_0x3abfe1[_0x68be('0x15')]?_0x3abfe1[_0x68be('0x15')][_0x68be('0x16')]===undefined?!![]:![]:!![],'where':_0x3abfe1['options']?_0x3abfe1[_0x68be('0x15')][_0x68be('0x20')]||null:null,'attributes':_0x3abfe1[_0x68be('0x15')]?_0x3abfe1[_0x68be('0x15')]['attributes']||null:null,'include':_0x3abfe1[_0x68be('0x15')]?_0x3abfe1[_0x68be('0x15')][_0x68be('0x18')]?_[_0x68be('0x1b')](_0x3abfe1[_0x68be('0x15')]['include'],function(_0x4de379){return{'model':db[_0x4de379[_0x68be('0x19')]],'as':_0x4de379['as'],'attributes':_0x4de379[_0x68be('0x1a')],'include':_0x4de379[_0x68be('0x18')]?_[_0x68be('0x1b')](_0x4de379[_0x68be('0x18')],function(_0x34fad7){return{'model':db[_0x34fad7[_0x68be('0x19')]],'as':_0x34fad7['as'],'attributes':_0x34fad7[_0x68be('0x1a')],'include':_0x34fad7[_0x68be('0x18')]?_[_0x68be('0x1b')](_0x34fad7[_0x68be('0x18')],function(_0x5510c9){return{'model':db[_0x5510c9[_0x68be('0x19')]],'as':_0x5510c9['as'],'attributes':_0x5510c9[_0x68be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68be('0x9')](function(_0x300931){logger[_0x68be('0x11')](_0x68be('0x1e'),_0x3abfe1);logger['debug'](_0x68be('0x1e'),_0x3abfe1,JSON[_0x68be('0x1c')](_0x300931));_0x109c3e(_0x300931);})[_0x68be('0x1d')](function(_0x362e43){logger[_0x68be('0xe')](_0x68be('0x1e'),_0x362e43[_0x68be('0x10')],_0x3abfe1);_0x26855e(_0x5b41af[_0x68be('0xe')](0x1f4,_0x362e43[_0x68be('0x10')]));});});}; \ No newline at end of file +var _0x7777=['../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','then','ShowServicenowAccount','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x14ea32,_0x262909){var _0x137bbb=function(_0x4a36ab){while(--_0x4a36ab){_0x14ea32['push'](_0x14ea32['shift']());}};_0x137bbb(++_0x262909);}(_0x7777,0x1c0));var _0x7777=function(_0x5491e5,_0x37a869){_0x5491e5=_0x5491e5-0x0;var _0x214eb5=_0x7777[_0x5491e5];return _0x214eb5;};'use strict';var _=require('lodash');var util=require(_0x7777('0x0'));var moment=require(_0x7777('0x1'));var BPromise=require(_0x7777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7777('0x3'));var db=require(_0x7777('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7777('0x5'))(_0x7777('0x6'));var config=require(_0x7777('0x7'));var jayson=require(_0x7777('0x8'));var client=jayson[_0x7777('0x9')][_0x7777('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363d68,_0x4196b7,_0xb78911){return new BPromise(function(_0x178d94,_0x5a0b29){return client[_0x7777('0xb')](_0x363d68,_0xb78911)['then'](function(_0x437dc2){logger[_0x7777('0xc')](_0x7777('0xd'),_0x4196b7,'request\x20sent');logger[_0x7777('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4196b7,'request\x20sent',JSON[_0x7777('0xf')](_0x437dc2));if(_0x437dc2[_0x7777('0x10')]){if(_0x437dc2[_0x7777('0x10')]['code']===0x1f4){logger[_0x7777('0x10')](_0x7777('0xd'),_0x4196b7,_0x437dc2[_0x7777('0x10')][_0x7777('0x11')]);return _0x5a0b29(_0x437dc2[_0x7777('0x10')][_0x7777('0x11')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4196b7,_0x437dc2[_0x7777('0x10')][_0x7777('0x11')]);return _0x178d94(_0x437dc2[_0x7777('0x10')]['message']);}else{logger['info'](_0x7777('0xd'),_0x4196b7,_0x7777('0x12'));_0x178d94(_0x437dc2[_0x7777('0x13')][_0x7777('0x11')]);}})['catch'](function(_0x37cdf3){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4196b7,_0x37cdf3);_0x5a0b29(_0x37cdf3);});});}exports[_0x7777('0x14')]=function(_0x58c0e3){var _0x54ce1e=this;return new Promise(function(_0x455daf,_0x49ea9b){return db[_0x7777('0x15')][_0x7777('0x16')]({'raw':_0x58c0e3[_0x7777('0x17')]?_0x58c0e3[_0x7777('0x17')][_0x7777('0x18')]===undefined?!![]:![]:!![],'where':_0x58c0e3[_0x7777('0x17')]?_0x58c0e3['options'][_0x7777('0x19')]||null:null,'attributes':_0x58c0e3['options']?_0x58c0e3[_0x7777('0x17')][_0x7777('0x1a')]||null:null,'limit':_0x58c0e3[_0x7777('0x17')]?_0x58c0e3[_0x7777('0x17')][_0x7777('0x1b')]||null:null,'include':_0x58c0e3[_0x7777('0x17')]?_0x58c0e3[_0x7777('0x17')][_0x7777('0x1c')]?_['map'](_0x58c0e3['options']['include'],function(_0x1d254f){return{'model':db[_0x1d254f['model']],'as':_0x1d254f['as'],'attributes':_0x1d254f[_0x7777('0x1a')],'include':_0x1d254f[_0x7777('0x1c')]?_[_0x7777('0x1d')](_0x1d254f[_0x7777('0x1c')],function(_0x50f5db){return{'model':db[_0x50f5db['model']],'as':_0x50f5db['as'],'attributes':_0x50f5db[_0x7777('0x1a')],'include':_0x50f5db[_0x7777('0x1c')]?_[_0x7777('0x1d')](_0x50f5db[_0x7777('0x1c')],function(_0x558ac8){return{'model':db[_0x558ac8[_0x7777('0x1e')]],'as':_0x558ac8['as'],'attributes':_0x558ac8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f0267){logger[_0x7777('0xc')]('GetServicenowAccount',_0x58c0e3);logger['debug'](_0x7777('0x14'),_0x58c0e3,JSON['stringify'](_0x5f0267));_0x455daf(_0x5f0267);})['catch'](function(_0x5af691){logger[_0x7777('0x10')](_0x7777('0x14'),_0x5af691[_0x7777('0x11')],_0x58c0e3);_0x49ea9b(_0x54ce1e[_0x7777('0x10')](0x1f4,_0x5af691[_0x7777('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x1e52db){var _0x40e4a8=this;return new Promise(function(_0x36fe66,_0x32cd3b){return db['ServicenowAccount'][_0x7777('0x1f')]({'raw':_0x1e52db['options']?_0x1e52db['options'][_0x7777('0x18')]===undefined?!![]:![]:!![],'where':_0x1e52db[_0x7777('0x17')]?_0x1e52db['options']['where']||null:null,'attributes':_0x1e52db[_0x7777('0x17')]?_0x1e52db[_0x7777('0x17')][_0x7777('0x1a')]||null:null,'include':_0x1e52db['options']?_0x1e52db[_0x7777('0x17')][_0x7777('0x1c')]?_[_0x7777('0x1d')](_0x1e52db['options']['include'],function(_0x1bb1ac){return{'model':db[_0x1bb1ac['model']],'as':_0x1bb1ac['as'],'attributes':_0x1bb1ac['attributes'],'include':_0x1bb1ac[_0x7777('0x1c')]?_[_0x7777('0x1d')](_0x1bb1ac['include'],function(_0x3b0ad7){return{'model':db[_0x3b0ad7[_0x7777('0x1e')]],'as':_0x3b0ad7['as'],'attributes':_0x3b0ad7[_0x7777('0x1a')],'include':_0x3b0ad7[_0x7777('0x1c')]?_[_0x7777('0x1d')](_0x3b0ad7['include'],function(_0x100f31){return{'model':db[_0x100f31['model']],'as':_0x100f31['as'],'attributes':_0x100f31[_0x7777('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7777('0x20')](function(_0x8cd7ee){logger[_0x7777('0xc')]('ShowServicenowAccount',_0x1e52db);logger[_0x7777('0xe')](_0x7777('0x21'),_0x1e52db,JSON['stringify'](_0x8cd7ee));_0x36fe66(_0x8cd7ee);})[_0x7777('0x22')](function(_0x1e39c3){logger[_0x7777('0x10')](_0x7777('0x21'),_0x1e39c3[_0x7777('0x11')],_0x1e52db);_0x32cd3b(_0x40e4a8['error'](0x1f4,_0x1e39c3[_0x7777('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index bf265b1..0aa5a27 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 _0x2d4c=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','destroy','exports'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x2d4c,0x12b));var _0xc2d4=function(_0x435acf,_0x26c41e){_0x435acf=_0x435acf-0x0;var _0x118664=_0x2d4c[_0x435acf];return _0x118664;};'use strict';var multer=require(_0xc2d4('0x0'));var util=require('util');var path=require(_0xc2d4('0x1'));var timeout=require(_0xc2d4('0x2'));var express=require(_0xc2d4('0x3'));var router=express['Router']();var fs_extra=require(_0xc2d4('0x4'));var auth=require(_0xc2d4('0x5'));var interaction=require(_0xc2d4('0x6'));var config=require(_0xc2d4('0x7'));var controller=require(_0xc2d4('0x8'));router[_0xc2d4('0x9')]('/',auth[_0xc2d4('0xa')](),controller['index']);router[_0xc2d4('0x9')]('/:id',auth[_0xc2d4('0xa')](),controller[_0xc2d4('0xb')]);router[_0xc2d4('0x9')](_0xc2d4('0xc'),auth[_0xc2d4('0xa')](),controller[_0xc2d4('0xd')]);router[_0xc2d4('0x9')](_0xc2d4('0xe'),auth[_0xc2d4('0xa')](),controller[_0xc2d4('0xf')]);router['get'](_0xc2d4('0x10'),auth[_0xc2d4('0xa')](),controller[_0xc2d4('0x11')]);router['post']('/',auth[_0xc2d4('0xa')](),controller[_0xc2d4('0x12')]);router[_0xc2d4('0x13')](_0xc2d4('0x14'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc2d4('0x14'),auth[_0xc2d4('0xa')](),controller[_0xc2d4('0x15')]);module[_0xc2d4('0x16')]=router; \ No newline at end of file +var _0xc11b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','destroy','exports','multer','express','Router','fs-extra'];(function(_0x27a004,_0x23c984){var _0x594e74=function(_0xfaafa){while(--_0xfaafa){_0x27a004['push'](_0x27a004['shift']());}};_0x594e74(++_0x23c984);}(_0xc11b,0xee));var _0xbc11=function(_0x5be1f0,_0x2a04ce){_0x5be1f0=_0x5be1f0-0x0;var _0x2ccbeb=_0xc11b[_0x5be1f0];return _0x2ccbeb;};'use strict';var multer=require(_0xbc11('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc11('0x1'));var router=express[_0xbc11('0x2')]();var fs_extra=require(_0xbc11('0x3'));var auth=require(_0xbc11('0x4'));var interaction=require(_0xbc11('0x5'));var config=require(_0xbc11('0x6'));var controller=require(_0xbc11('0x7'));router[_0xbc11('0x8')]('/',auth['isAuthenticated'](),controller[_0xbc11('0x9')]);router['get'](_0xbc11('0xa'),auth[_0xbc11('0xb')](),controller['show']);router[_0xbc11('0x8')](_0xbc11('0xc'),auth[_0xbc11('0xb')](),controller[_0xbc11('0xd')]);router['get'](_0xbc11('0xe'),auth[_0xbc11('0xb')](),controller['getSubjects']);router['get'](_0xbc11('0xf'),auth[_0xbc11('0xb')](),controller['getDescriptions']);router[_0xbc11('0x10')]('/',auth['isAuthenticated'](),controller[_0xbc11('0x11')]);router[_0xbc11('0x12')](_0xbc11('0xa'),auth[_0xbc11('0xb')](),controller[_0xbc11('0x13')]);router['delete'](_0xbc11('0xa'),auth[_0xbc11('0xb')](),controller[_0xbc11('0x14')]);module[_0xbc11('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 42702e8..39b1268 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 _0x2a2a=['exports','STRING','sequelize'];(function(_0x59ef73,_0x4df972){var _0x125dc5=function(_0x3eb5d8){while(--_0x3eb5d8){_0x59ef73['push'](_0x59ef73['shift']());}};_0x125dc5(++_0x4df972);}(_0x2a2a,0xb6));var _0xa2a2=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0x2a2a[_0x2bfd4f];return _0x341849;};'use strict';var Sequelize=require(_0xa2a2('0x0'));module[_0xa2a2('0x1')]={'name':{'type':Sequelize[_0xa2a2('0x2')]},'description':{'type':Sequelize[_0xa2a2('0x2')]}}; \ No newline at end of file +var _0x661f=['STRING','exports'];(function(_0x563a89,_0x4e7654){var _0x17826d=function(_0x4479a6){while(--_0x4479a6){_0x563a89['push'](_0x563a89['shift']());}};_0x17826d(++_0x4e7654);}(_0x661f,0xe7));var _0xf661=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x661f[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0xf661('0x0')]={'name':{'type':Sequelize[_0xf661('0x1')]},'description':{'type':Sequelize[_0xf661('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 0b73759..b1f36eb 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 _0x59dd=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','update','destroy','end','sendStatus','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','then','rows','params','merge','find','catch','create','body','getFields','findOne','getSubjects','ServicenowField','getDescriptions','eml-format'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x59dd,0xe6));var _0xd59d=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x59dd[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require(_0xd59d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd59d('0x1'));var rp=require(_0xd59d('0x2'));var moment=require(_0xd59d('0x3'));var BPromise=require(_0xd59d('0x4'));var Mustache=require('mustache');var util=require(_0xd59d('0x5'));var path=require(_0xd59d('0x6'));var sox=require(_0xd59d('0x7'));var csv=require('to-csv');var ejs=require(_0xd59d('0x8'));var fs=require('fs');var fs_extra=require(_0xd59d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd59d('0xa'));var jsforce=require(_0xd59d('0xb'));var deskjs=require(_0xd59d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd59d('0xd'));var authService=require(_0xd59d('0xe'));var qs=require(_0xd59d('0xf'));var as=require(_0xd59d('0x10'));var hardwareService=require(_0xd59d('0x11'));var logger=require(_0xd59d('0x12'))(_0xd59d('0x13'));var utils=require('../../config/utils');var config=require(_0xd59d('0x14'));var licenseUtil=require(_0xd59d('0x15'));var db=require(_0xd59d('0x16'))['db'];function respondWithStatusCode(_0x5d58da,_0x17b5b6){_0x17b5b6=_0x17b5b6||0xcc;return function(_0x35b11b){if(_0x35b11b){return _0x5d58da['sendStatus'](_0x17b5b6);}return _0x5d58da[_0xd59d('0x17')](_0x17b5b6)['end']();};}function respondWithResult(_0x40c87d,_0x2b6e8f){_0x2b6e8f=_0x2b6e8f||0xc8;return function(_0x51aebe){if(_0x51aebe){return _0x40c87d[_0xd59d('0x17')](_0x2b6e8f)[_0xd59d('0x18')](_0x51aebe);}};}function respondWithFilteredResult(_0x43147f,_0x225c39){return function(_0x48cfd2){if(_0x48cfd2){var _0x52a9a2=typeof _0x225c39['offset']===_0xd59d('0x19')&&typeof _0x225c39[_0xd59d('0x1a')]===_0xd59d('0x19');var _0x500176=_0x48cfd2[_0xd59d('0x1b')];var _0x171eb5=_0x52a9a2?0x0:_0x225c39[_0xd59d('0x1c')];var _0x4ced40=_0x52a9a2?_0x48cfd2['count']:_0x225c39['offset']+_0x225c39[_0xd59d('0x1a')];var _0x218ceb;if(_0x4ced40>=_0x500176){_0x4ced40=_0x500176;_0x218ceb=0xc8;}else{_0x218ceb=0xce;}_0x43147f[_0xd59d('0x17')](_0x218ceb);return _0x43147f[_0xd59d('0x1d')]('Content-Range',_0x171eb5+'-'+_0x4ced40+'/'+_0x500176)['json'](_0x48cfd2);}return null;};}function patchUpdates(_0x5cbb58){return function(_0x3af9c7){try{jsonpatch[_0xd59d('0x1e')](_0x3af9c7,_0x5cbb58,!![]);}catch(_0xd17362){return BPromise['reject'](_0xd17362);}return _0x3af9c7['save']();};}function saveUpdates(_0x34eb5e,_0x526f10){return function(_0x25191f){if(_0x25191f){return _0x25191f[_0xd59d('0x1f')](_0x34eb5e)['then'](function(_0x533b18){return _0x533b18;});}return null;};}function removeEntity(_0x333f9c,_0x55f474){return function(_0x28a205){if(_0x28a205){return _0x28a205[_0xd59d('0x20')]()['then'](function(){_0x333f9c[_0xd59d('0x17')](0xcc)[_0xd59d('0x21')]();});}};}function handleEntityNotFound(_0x191310,_0x2df4a7){return function(_0x4295f7){if(!_0x4295f7){_0x191310[_0xd59d('0x22')](0x194);}return _0x4295f7;};}function handleError(_0x136035,_0x30bacb){_0x30bacb=_0x30bacb||0x1f4;return function(_0x30589f){logger[_0xd59d('0x23')](_0x30589f[_0xd59d('0x24')]);if(_0x30589f[_0xd59d('0x25')]){delete _0x30589f[_0xd59d('0x25')];}_0x136035[_0xd59d('0x17')](_0x30bacb)[_0xd59d('0x26')](_0x30589f);};}exports['index']=function(_0x1b5d9e,_0x3f414b){var _0x5826f9={},_0x269479={},_0x108405={'count':0x0,'rows':[]};var _0x20260d=_[_0xd59d('0x27')](db[_0xd59d('0x28')][_0xd59d('0x29')],function(_0x55deb0){return{'name':_0x55deb0['fieldName'],'type':_0x55deb0['type'][_0xd59d('0x2a')]};});_0x269479[_0xd59d('0x2b')]=_[_0xd59d('0x27')](_0x20260d,_0xd59d('0x25'));_0x269479['query']=_[_0xd59d('0x2c')](_0x1b5d9e[_0xd59d('0x2d')]);_0x269479[_0xd59d('0x2e')]=_['intersection'](_0x269479[_0xd59d('0x2b')],_0x269479[_0xd59d('0x2d')]);_0x5826f9['attributes']=_[_0xd59d('0x2f')](_0x269479[_0xd59d('0x2b')],qs[_0xd59d('0x30')](_0x1b5d9e['query'][_0xd59d('0x30')]));_0x5826f9[_0xd59d('0x31')]=_0x5826f9[_0xd59d('0x31')][_0xd59d('0x32')]?_0x5826f9['attributes']:_0x269479['model'];if(!_0x1b5d9e[_0xd59d('0x2d')][_0xd59d('0x33')](_0xd59d('0x34'))){_0x5826f9[_0xd59d('0x1a')]=qs[_0xd59d('0x1a')](_0x1b5d9e[_0xd59d('0x2d')][_0xd59d('0x1a')]);_0x5826f9['offset']=qs[_0xd59d('0x1c')](_0x1b5d9e[_0xd59d('0x2d')]['offset']);}_0x5826f9[_0xd59d('0x35')]=qs['sort'](_0x1b5d9e[_0xd59d('0x2d')][_0xd59d('0x36')]);_0x5826f9[_0xd59d('0x37')]=qs[_0xd59d('0x2e')](_[_0xd59d('0x38')](_0x1b5d9e[_0xd59d('0x2d')],_0x269479[_0xd59d('0x2e')]),_0x20260d);if(_0x1b5d9e['query'][_0xd59d('0x39')]){_0x5826f9['where']=_['merge'](_0x5826f9[_0xd59d('0x37')],{'$or':_[_0xd59d('0x27')](_0x20260d,function(_0x326a91){if(_0x326a91[_0xd59d('0x3a')]!==_0xd59d('0x3b')){var _0x2ed0ed={};_0x2ed0ed[_0x326a91[_0xd59d('0x25')]]={'$like':'%'+_0x1b5d9e[_0xd59d('0x2d')]['filter']+'%'};return _0x2ed0ed;}})});}_0x5826f9=_['merge']({},_0x5826f9,_0x1b5d9e[_0xd59d('0x3c')]);var _0x3d17ae={'where':_0x5826f9[_0xd59d('0x37')]};return db['ServicenowConfiguration'][_0xd59d('0x1b')](_0x3d17ae)['then'](function(_0x19d225){_0x108405['count']=_0x19d225;if(_0x1b5d9e[_0xd59d('0x2d')][_0xd59d('0x3d')]){_0x5826f9[_0xd59d('0x3e')]=[{'all':!![]}];}return db[_0xd59d('0x28')][_0xd59d('0x3f')](_0x5826f9);})[_0xd59d('0x40')](function(_0x379221){_0x108405[_0xd59d('0x41')]=_0x379221;return _0x108405;})[_0xd59d('0x40')](respondWithFilteredResult(_0x3f414b,_0x5826f9))['catch'](handleError(_0x3f414b,null));};exports['show']=function(_0x122ad3,_0x5494dc){var _0x5d400d={'raw':![],'where':{'id':_0x122ad3[_0xd59d('0x42')]['id']}},_0x2698e8={};_0x2698e8['model']=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x2698e8['query']=_['keys'](_0x122ad3[_0xd59d('0x2d')]);_0x2698e8[_0xd59d('0x2e')]=_[_0xd59d('0x2f')](_0x2698e8[_0xd59d('0x2b')],_0x2698e8['query']);_0x5d400d[_0xd59d('0x31')]=_[_0xd59d('0x2f')](_0x2698e8['model'],qs[_0xd59d('0x30')](_0x122ad3[_0xd59d('0x2d')][_0xd59d('0x30')]));_0x5d400d[_0xd59d('0x31')]=_0x5d400d[_0xd59d('0x31')]['length']?_0x5d400d[_0xd59d('0x31')]:_0x2698e8[_0xd59d('0x2b')];if(_0x122ad3['query'][_0xd59d('0x3d')]){_0x5d400d['include']=[{'all':!![]}];}_0x5d400d=_[_0xd59d('0x43')]({},_0x5d400d,_0x122ad3[_0xd59d('0x3c')]);return db[_0xd59d('0x28')][_0xd59d('0x44')](_0x5d400d)[_0xd59d('0x40')](handleEntityNotFound(_0x5494dc,null))[_0xd59d('0x40')](respondWithResult(_0x5494dc,null))[_0xd59d('0x45')](handleError(_0x5494dc,null));};exports[_0xd59d('0x46')]=function(_0x5d1f76,_0x3872f5){return db[_0xd59d('0x28')][_0xd59d('0x46')](_0x5d1f76[_0xd59d('0x47')],{})['then'](respondWithResult(_0x3872f5,0xc9))['catch'](handleError(_0x3872f5,null));};exports[_0xd59d('0x1f')]=function(_0x122a35,_0x4c220d){if(_0x122a35[_0xd59d('0x47')]['id']){delete _0x122a35[_0xd59d('0x47')]['id'];}return db['ServicenowConfiguration'][_0xd59d('0x44')]({'where':{'id':_0x122a35['params']['id']}})[_0xd59d('0x40')](handleEntityNotFound(_0x4c220d,null))['then'](saveUpdates(_0x122a35[_0xd59d('0x47')],null))['then'](respondWithResult(_0x4c220d,null))['catch'](handleError(_0x4c220d,null));};exports[_0xd59d('0x20')]=function(_0x22bea7,_0x4f9ffc){return db[_0xd59d('0x28')][_0xd59d('0x44')]({'where':{'id':_0x22bea7[_0xd59d('0x42')]['id']}})[_0xd59d('0x40')](handleEntityNotFound(_0x4f9ffc,null))[_0xd59d('0x40')](removeEntity(_0x4f9ffc,null))[_0xd59d('0x45')](handleError(_0x4f9ffc,null));};exports[_0xd59d('0x48')]=function(_0xfe0240,_0x240d84,_0x39e393){var _0x5a3b67={};var _0x585133={};var _0x5c35b1;var _0x383709;return db[_0xd59d('0x28')][_0xd59d('0x49')]({'where':{'id':_0xfe0240[_0xd59d('0x42')]['id']}})[_0xd59d('0x40')](handleEntityNotFound(_0x240d84,null))[_0xd59d('0x40')](function(_0x3e1ccb){if(_0x3e1ccb){_0x5c35b1=_0x3e1ccb;_0x585133['model']=_[_0xd59d('0x2c')](db['ServicenowField'][_0xd59d('0x29')]);_0x585133[_0xd59d('0x2d')]=_[_0xd59d('0x2c')](_0xfe0240['query']);_0x585133[_0xd59d('0x2e')]=_[_0xd59d('0x2f')](_0x585133['model'],_0x585133[_0xd59d('0x2d')]);_0x5a3b67['attributes']=_[_0xd59d('0x2f')](_0x585133[_0xd59d('0x2b')],qs[_0xd59d('0x30')](_0xfe0240[_0xd59d('0x2d')][_0xd59d('0x30')]));_0x5a3b67[_0xd59d('0x31')]=_0x5a3b67[_0xd59d('0x31')][_0xd59d('0x32')]?_0x5a3b67[_0xd59d('0x31')]:_0x585133[_0xd59d('0x2b')];_0x5a3b67[_0xd59d('0x35')]=qs['sort'](_0xfe0240['query']['sort']);_0x5a3b67['where']=qs[_0xd59d('0x2e')](_['pick'](_0xfe0240[_0xd59d('0x2d')],_0x585133[_0xd59d('0x2e')]));if(_0xfe0240[_0xd59d('0x2d')][_0xd59d('0x39')]){_0x5a3b67[_0xd59d('0x37')]=_[_0xd59d('0x43')](_0x5a3b67[_0xd59d('0x37')],{'$or':_['map'](_0x5a3b67['attributes'],function(_0x7d2d30){var _0x59f2fe={};_0x59f2fe[_0x7d2d30]={'$like':'%'+_0xfe0240[_0xd59d('0x2d')]['filter']+'%'};return _0x59f2fe;})});}_0x5a3b67=_['merge']({},_0x5a3b67,_0xfe0240[_0xd59d('0x3c')]);return _0x5c35b1[_0xd59d('0x48')](_0x5a3b67);}})[_0xd59d('0x40')](function(_0x150e2b){if(_0x150e2b){_0x383709=_0x150e2b[_0xd59d('0x32')];if(!_0xfe0240[_0xd59d('0x2d')][_0xd59d('0x33')](_0xd59d('0x34'))){_0x5a3b67[_0xd59d('0x1a')]=qs[_0xd59d('0x1a')](_0xfe0240['query'][_0xd59d('0x1a')]);_0x5a3b67['offset']=qs[_0xd59d('0x1c')](_0xfe0240['query'][_0xd59d('0x1c')]);}return _0x5c35b1[_0xd59d('0x48')](_0x5a3b67);}})[_0xd59d('0x40')](function(_0x1fc4c9){if(_0x1fc4c9){return _0x1fc4c9?{'count':_0x383709,'rows':_0x1fc4c9}:null;}})[_0xd59d('0x40')](respondWithResult(_0x240d84,null))[_0xd59d('0x45')](handleError(_0x240d84,null));};exports[_0xd59d('0x4a')]=function(_0x3a0c15,_0x5643d7,_0x311fff){var _0xcd35eb={};var _0x118d67={};var _0x20563e;var _0xc024ec;return db[_0xd59d('0x28')]['findOne']({'where':{'id':_0x3a0c15[_0xd59d('0x42')]['id']}})[_0xd59d('0x40')](handleEntityNotFound(_0x5643d7,null))['then'](function(_0x5a2c9b){if(_0x5a2c9b){_0x20563e=_0x5a2c9b;_0x118d67[_0xd59d('0x2b')]=_[_0xd59d('0x2c')](db[_0xd59d('0x4b')][_0xd59d('0x29')]);_0x118d67[_0xd59d('0x2d')]=_['keys'](_0x3a0c15[_0xd59d('0x2d')]);_0x118d67['filters']=_['intersection'](_0x118d67[_0xd59d('0x2b')],_0x118d67[_0xd59d('0x2d')]);_0xcd35eb['attributes']=_[_0xd59d('0x2f')](_0x118d67[_0xd59d('0x2b')],qs[_0xd59d('0x30')](_0x3a0c15['query'][_0xd59d('0x30')]));_0xcd35eb['attributes']=_0xcd35eb[_0xd59d('0x31')]['length']?_0xcd35eb['attributes']:_0x118d67[_0xd59d('0x2b')];_0xcd35eb['order']=qs[_0xd59d('0x36')](_0x3a0c15[_0xd59d('0x2d')]['sort']);_0xcd35eb[_0xd59d('0x37')]=qs[_0xd59d('0x2e')](_[_0xd59d('0x38')](_0x3a0c15[_0xd59d('0x2d')],_0x118d67['filters']));if(_0x3a0c15[_0xd59d('0x2d')][_0xd59d('0x39')]){_0xcd35eb['where']=_[_0xd59d('0x43')](_0xcd35eb[_0xd59d('0x37')],{'$or':_['map'](_0xcd35eb[_0xd59d('0x31')],function(_0x33d025){var _0xba4d95={};_0xba4d95[_0x33d025]={'$like':'%'+_0x3a0c15['query'][_0xd59d('0x39')]+'%'};return _0xba4d95;})});}_0xcd35eb=_[_0xd59d('0x43')]({},_0xcd35eb,_0x3a0c15[_0xd59d('0x3c')]);return _0x20563e[_0xd59d('0x4a')](_0xcd35eb);}})[_0xd59d('0x40')](function(_0x5b3ea6){if(_0x5b3ea6){_0xc024ec=_0x5b3ea6['length'];if(!_0x3a0c15[_0xd59d('0x2d')]['hasOwnProperty']('nolimit')){_0xcd35eb[_0xd59d('0x1a')]=qs['limit'](_0x3a0c15['query'][_0xd59d('0x1a')]);_0xcd35eb[_0xd59d('0x1c')]=qs[_0xd59d('0x1c')](_0x3a0c15[_0xd59d('0x2d')][_0xd59d('0x1c')]);}return _0x20563e[_0xd59d('0x4a')](_0xcd35eb);}})[_0xd59d('0x40')](function(_0x516a0d){if(_0x516a0d){return _0x516a0d?{'count':_0xc024ec,'rows':_0x516a0d}:null;}})[_0xd59d('0x40')](respondWithResult(_0x5643d7,null))[_0xd59d('0x45')](handleError(_0x5643d7,null));};exports[_0xd59d('0x4c')]=function(_0xf0d5ae,_0x584c25,_0x31be1d){var _0x3ac98a={};var _0x202de3={};var _0x7189ca;var _0x2a8d17;return db[_0xd59d('0x28')][_0xd59d('0x49')]({'where':{'id':_0xf0d5ae[_0xd59d('0x42')]['id']}})[_0xd59d('0x40')](handleEntityNotFound(_0x584c25,null))[_0xd59d('0x40')](function(_0x2c07a5){if(_0x2c07a5){_0x7189ca=_0x2c07a5;_0x202de3[_0xd59d('0x2b')]=_[_0xd59d('0x2c')](db[_0xd59d('0x4b')][_0xd59d('0x29')]);_0x202de3[_0xd59d('0x2d')]=_['keys'](_0xf0d5ae['query']);_0x202de3[_0xd59d('0x2e')]=_[_0xd59d('0x2f')](_0x202de3['model'],_0x202de3[_0xd59d('0x2d')]);_0x3ac98a[_0xd59d('0x31')]=_[_0xd59d('0x2f')](_0x202de3[_0xd59d('0x2b')],qs[_0xd59d('0x30')](_0xf0d5ae['query'][_0xd59d('0x30')]));_0x3ac98a[_0xd59d('0x31')]=_0x3ac98a['attributes'][_0xd59d('0x32')]?_0x3ac98a['attributes']:_0x202de3[_0xd59d('0x2b')];_0x3ac98a[_0xd59d('0x35')]=qs[_0xd59d('0x36')](_0xf0d5ae['query']['sort']);_0x3ac98a[_0xd59d('0x37')]=qs[_0xd59d('0x2e')](_[_0xd59d('0x38')](_0xf0d5ae[_0xd59d('0x2d')],_0x202de3[_0xd59d('0x2e')]));if(_0xf0d5ae[_0xd59d('0x2d')][_0xd59d('0x39')]){_0x3ac98a['where']=_[_0xd59d('0x43')](_0x3ac98a['where'],{'$or':_[_0xd59d('0x27')](_0x3ac98a[_0xd59d('0x31')],function(_0x1946e1){var _0x506346={};_0x506346[_0x1946e1]={'$like':'%'+_0xf0d5ae[_0xd59d('0x2d')][_0xd59d('0x39')]+'%'};return _0x506346;})});}_0x3ac98a=_[_0xd59d('0x43')]({},_0x3ac98a,_0xf0d5ae[_0xd59d('0x3c')]);return _0x7189ca[_0xd59d('0x4c')](_0x3ac98a);}})[_0xd59d('0x40')](function(_0x2da4be){if(_0x2da4be){_0x2a8d17=_0x2da4be[_0xd59d('0x32')];if(!_0xf0d5ae['query'][_0xd59d('0x33')](_0xd59d('0x34'))){_0x3ac98a[_0xd59d('0x1a')]=qs[_0xd59d('0x1a')](_0xf0d5ae[_0xd59d('0x2d')][_0xd59d('0x1a')]);_0x3ac98a[_0xd59d('0x1c')]=qs['offset'](_0xf0d5ae[_0xd59d('0x2d')]['offset']);}return _0x7189ca[_0xd59d('0x4c')](_0x3ac98a);}})[_0xd59d('0x40')](function(_0x175d21){if(_0x175d21){return _0x175d21?{'count':_0x2a8d17,'rows':_0x175d21}:null;}})[_0xd59d('0x40')](respondWithResult(_0x584c25,null))[_0xd59d('0x45')](handleError(_0x584c25,null));}; \ No newline at end of file +var _0x46b9=['length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','includeAll','find','create','body','destroy','params','getFields','findOne','hasOwnProperty','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','fast-json-patch','moment','ejs','lodash','crypto','jsforce','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','sendStatus','end','json','offset','undefined','limit','count','set','apply','update','then','error','status','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields'];(function(_0x4ec42,_0x36177b){var _0x385e11=function(_0x44e535){while(--_0x44e535){_0x4ec42['push'](_0x4ec42['shift']());}};_0x385e11(++_0x36177b);}(_0x46b9,0x190));var _0x946b=function(_0x4c5a25,_0xd4ddb6){_0x4c5a25=_0x4c5a25-0x0;var _0x1bb7e4=_0x46b9[_0x4c5a25];return _0x1bb7e4;};'use strict';var emlformat=require(_0x946b('0x0'));var rimraf=require(_0x946b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x946b('0x2'));var rp=require('request-promise');var moment=require(_0x946b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x946b('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x946b('0x5'));var squel=require('squel');var crypto=require(_0x946b('0x6'));var jsforce=require(_0x946b('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x946b('0x8'));var querystring=require(_0x946b('0x9'));var Papa=require(_0x946b('0xa'));var Redis=require(_0x946b('0xb'));var authService=require(_0x946b('0xc'));var qs=require(_0x946b('0xd'));var as=require(_0x946b('0xe'));var hardwareService=require(_0x946b('0xf'));var logger=require(_0x946b('0x10'))(_0x946b('0x11'));var utils=require(_0x946b('0x12'));var config=require(_0x946b('0x13'));var licenseUtil=require(_0x946b('0x14'));var db=require(_0x946b('0x15'))['db'];function respondWithStatusCode(_0xe1016a,_0x7c75de){_0x7c75de=_0x7c75de||0xcc;return function(_0x5f1411){if(_0x5f1411){return _0xe1016a[_0x946b('0x16')](_0x7c75de);}return _0xe1016a['status'](_0x7c75de)[_0x946b('0x17')]();};}function respondWithResult(_0x4a5ede,_0x2de148){_0x2de148=_0x2de148||0xc8;return function(_0x56ee86){if(_0x56ee86){return _0x4a5ede['status'](_0x2de148)[_0x946b('0x18')](_0x56ee86);}};}function respondWithFilteredResult(_0x49f47a,_0x1b264e){return function(_0x1d69a1){if(_0x1d69a1){var _0x475ee0=typeof _0x1b264e[_0x946b('0x19')]===_0x946b('0x1a')&&typeof _0x1b264e[_0x946b('0x1b')]===_0x946b('0x1a');var _0x3da18d=_0x1d69a1[_0x946b('0x1c')];var _0x1577c4=_0x475ee0?0x0:_0x1b264e[_0x946b('0x19')];var _0xbe6c8f=_0x475ee0?_0x1d69a1[_0x946b('0x1c')]:_0x1b264e['offset']+_0x1b264e[_0x946b('0x1b')];var _0x1ced23;if(_0xbe6c8f>=_0x3da18d){_0xbe6c8f=_0x3da18d;_0x1ced23=0xc8;}else{_0x1ced23=0xce;}_0x49f47a['status'](_0x1ced23);return _0x49f47a[_0x946b('0x1d')]('Content-Range',_0x1577c4+'-'+_0xbe6c8f+'/'+_0x3da18d)[_0x946b('0x18')](_0x1d69a1);}return null;};}function patchUpdates(_0xb43358){return function(_0x564436){try{jsonpatch[_0x946b('0x1e')](_0x564436,_0xb43358,!![]);}catch(_0x496a89){return BPromise['reject'](_0x496a89);}return _0x564436['save']();};}function saveUpdates(_0x470fe6,_0x5746af){return function(_0x4f79b9){if(_0x4f79b9){return _0x4f79b9[_0x946b('0x1f')](_0x470fe6)[_0x946b('0x20')](function(_0x506e8d){return _0x506e8d;});}return null;};}function removeEntity(_0x207873,_0x2e98c9){return function(_0x4a3bf8){if(_0x4a3bf8){return _0x4a3bf8['destroy']()['then'](function(){_0x207873['status'](0xcc)[_0x946b('0x17')]();});}};}function handleEntityNotFound(_0x2e4f19,_0x5208c9){return function(_0x296b62){if(!_0x296b62){_0x2e4f19['sendStatus'](0x194);}return _0x296b62;};}function handleError(_0x2da478,_0x136e9c){_0x136e9c=_0x136e9c||0x1f4;return function(_0x565862){logger[_0x946b('0x21')](_0x565862['stack']);if(_0x565862['name']){delete _0x565862['name'];}_0x2da478[_0x946b('0x22')](_0x136e9c)['send'](_0x565862);};}exports[_0x946b('0x23')]=function(_0x570458,_0x33bd06){var _0x526542={},_0x3eb1e0={},_0x3e119c={'count':0x0,'rows':[]};var _0x3a9d80=_['map'](db[_0x946b('0x24')][_0x946b('0x25')],function(_0x37a478){return{'name':_0x37a478[_0x946b('0x26')],'type':_0x37a478[_0x946b('0x27')][_0x946b('0x28')]};});_0x3eb1e0[_0x946b('0x29')]=_[_0x946b('0x2a')](_0x3a9d80,_0x946b('0x2b'));_0x3eb1e0['query']=_[_0x946b('0x2c')](_0x570458[_0x946b('0x2d')]);_0x3eb1e0[_0x946b('0x2e')]=_[_0x946b('0x2f')](_0x3eb1e0[_0x946b('0x29')],_0x3eb1e0[_0x946b('0x2d')]);_0x526542[_0x946b('0x30')]=_['intersection'](_0x3eb1e0[_0x946b('0x29')],qs[_0x946b('0x31')](_0x570458[_0x946b('0x2d')]['fields']));_0x526542[_0x946b('0x30')]=_0x526542['attributes'][_0x946b('0x32')]?_0x526542[_0x946b('0x30')]:_0x3eb1e0['model'];if(!_0x570458[_0x946b('0x2d')]['hasOwnProperty'](_0x946b('0x33'))){_0x526542[_0x946b('0x1b')]=qs[_0x946b('0x1b')](_0x570458['query'][_0x946b('0x1b')]);_0x526542[_0x946b('0x19')]=qs['offset'](_0x570458[_0x946b('0x2d')][_0x946b('0x19')]);}_0x526542[_0x946b('0x34')]=qs[_0x946b('0x35')](_0x570458[_0x946b('0x2d')][_0x946b('0x35')]);_0x526542[_0x946b('0x36')]=qs['filters'](_[_0x946b('0x37')](_0x570458['query'],_0x3eb1e0[_0x946b('0x2e')]),_0x3a9d80);if(_0x570458['query'][_0x946b('0x38')]){_0x526542[_0x946b('0x36')]=_[_0x946b('0x39')](_0x526542[_0x946b('0x36')],{'$or':_[_0x946b('0x2a')](_0x3a9d80,function(_0x2e184d){if(_0x2e184d[_0x946b('0x27')]!==_0x946b('0x3a')){var _0x26320d={};_0x26320d[_0x2e184d[_0x946b('0x2b')]]={'$like':'%'+_0x570458[_0x946b('0x2d')][_0x946b('0x38')]+'%'};return _0x26320d;}})});}_0x526542=_[_0x946b('0x39')]({},_0x526542,_0x570458[_0x946b('0x3b')]);var _0x161b41={'where':_0x526542[_0x946b('0x36')]};return db[_0x946b('0x24')]['count'](_0x161b41)[_0x946b('0x20')](function(_0x39b1a1){_0x3e119c[_0x946b('0x1c')]=_0x39b1a1;if(_0x570458['query']['includeAll']){_0x526542[_0x946b('0x3c')]=[{'all':!![]}];}return db[_0x946b('0x24')][_0x946b('0x3d')](_0x526542);})[_0x946b('0x20')](function(_0x51876a){_0x3e119c['rows']=_0x51876a;return _0x3e119c;})[_0x946b('0x20')](respondWithFilteredResult(_0x33bd06,_0x526542))[_0x946b('0x3e')](handleError(_0x33bd06,null));};exports['show']=function(_0x42ae93,_0x49cffb){var _0x269be2={'raw':![],'where':{'id':_0x42ae93['params']['id']}},_0x3eeb9d={};_0x3eeb9d[_0x946b('0x29')]=_[_0x946b('0x2c')](db[_0x946b('0x24')][_0x946b('0x25')]);_0x3eeb9d['query']=_[_0x946b('0x2c')](_0x42ae93[_0x946b('0x2d')]);_0x3eeb9d[_0x946b('0x2e')]=_[_0x946b('0x2f')](_0x3eeb9d[_0x946b('0x29')],_0x3eeb9d['query']);_0x269be2['attributes']=_[_0x946b('0x2f')](_0x3eeb9d[_0x946b('0x29')],qs[_0x946b('0x31')](_0x42ae93[_0x946b('0x2d')][_0x946b('0x31')]));_0x269be2[_0x946b('0x30')]=_0x269be2[_0x946b('0x30')][_0x946b('0x32')]?_0x269be2[_0x946b('0x30')]:_0x3eeb9d[_0x946b('0x29')];if(_0x42ae93['query'][_0x946b('0x3f')]){_0x269be2[_0x946b('0x3c')]=[{'all':!![]}];}_0x269be2=_[_0x946b('0x39')]({},_0x269be2,_0x42ae93[_0x946b('0x3b')]);return db['ServicenowConfiguration'][_0x946b('0x40')](_0x269be2)[_0x946b('0x20')](handleEntityNotFound(_0x49cffb,null))[_0x946b('0x20')](respondWithResult(_0x49cffb,null))[_0x946b('0x3e')](handleError(_0x49cffb,null));};exports['create']=function(_0x352062,_0x38d686){return db[_0x946b('0x24')][_0x946b('0x41')](_0x352062['body'],{})[_0x946b('0x20')](respondWithResult(_0x38d686,0xc9))['catch'](handleError(_0x38d686,null));};exports[_0x946b('0x1f')]=function(_0x3af025,_0x28a3c1){if(_0x3af025[_0x946b('0x42')]['id']){delete _0x3af025[_0x946b('0x42')]['id'];}return db[_0x946b('0x24')][_0x946b('0x40')]({'where':{'id':_0x3af025['params']['id']}})['then'](handleEntityNotFound(_0x28a3c1,null))['then'](saveUpdates(_0x3af025[_0x946b('0x42')],null))[_0x946b('0x20')](respondWithResult(_0x28a3c1,null))[_0x946b('0x3e')](handleError(_0x28a3c1,null));};exports[_0x946b('0x43')]=function(_0x45ce0d,_0x341224){return db['ServicenowConfiguration']['find']({'where':{'id':_0x45ce0d[_0x946b('0x44')]['id']}})[_0x946b('0x20')](handleEntityNotFound(_0x341224,null))['then'](removeEntity(_0x341224,null))[_0x946b('0x3e')](handleError(_0x341224,null));};exports[_0x946b('0x45')]=function(_0x3baab7,_0x17d8af,_0x1c482b){var _0x2bd5f5={};var _0x549793={};var _0x14fc1c;var _0x3f19c5;return db[_0x946b('0x24')][_0x946b('0x46')]({'where':{'id':_0x3baab7[_0x946b('0x44')]['id']}})['then'](handleEntityNotFound(_0x17d8af,null))[_0x946b('0x20')](function(_0x54ac14){if(_0x54ac14){_0x14fc1c=_0x54ac14;_0x549793[_0x946b('0x29')]=_[_0x946b('0x2c')](db['ServicenowField'][_0x946b('0x25')]);_0x549793[_0x946b('0x2d')]=_[_0x946b('0x2c')](_0x3baab7['query']);_0x549793[_0x946b('0x2e')]=_[_0x946b('0x2f')](_0x549793[_0x946b('0x29')],_0x549793[_0x946b('0x2d')]);_0x2bd5f5[_0x946b('0x30')]=_[_0x946b('0x2f')](_0x549793[_0x946b('0x29')],qs['fields'](_0x3baab7[_0x946b('0x2d')][_0x946b('0x31')]));_0x2bd5f5[_0x946b('0x30')]=_0x2bd5f5[_0x946b('0x30')][_0x946b('0x32')]?_0x2bd5f5[_0x946b('0x30')]:_0x549793[_0x946b('0x29')];_0x2bd5f5[_0x946b('0x34')]=qs['sort'](_0x3baab7['query'][_0x946b('0x35')]);_0x2bd5f5[_0x946b('0x36')]=qs[_0x946b('0x2e')](_[_0x946b('0x37')](_0x3baab7[_0x946b('0x2d')],_0x549793[_0x946b('0x2e')]));if(_0x3baab7[_0x946b('0x2d')]['filter']){_0x2bd5f5[_0x946b('0x36')]=_[_0x946b('0x39')](_0x2bd5f5[_0x946b('0x36')],{'$or':_[_0x946b('0x2a')](_0x2bd5f5[_0x946b('0x30')],function(_0x188d70){var _0xe5ba5={};_0xe5ba5[_0x188d70]={'$like':'%'+_0x3baab7[_0x946b('0x2d')][_0x946b('0x38')]+'%'};return _0xe5ba5;})});}_0x2bd5f5=_['merge']({},_0x2bd5f5,_0x3baab7[_0x946b('0x3b')]);return _0x14fc1c[_0x946b('0x45')](_0x2bd5f5);}})[_0x946b('0x20')](function(_0x4d19af){if(_0x4d19af){_0x3f19c5=_0x4d19af[_0x946b('0x32')];if(!_0x3baab7[_0x946b('0x2d')][_0x946b('0x47')](_0x946b('0x33'))){_0x2bd5f5['limit']=qs['limit'](_0x3baab7[_0x946b('0x2d')][_0x946b('0x1b')]);_0x2bd5f5[_0x946b('0x19')]=qs[_0x946b('0x19')](_0x3baab7['query'][_0x946b('0x19')]);}return _0x14fc1c[_0x946b('0x45')](_0x2bd5f5);}})[_0x946b('0x20')](function(_0x17094e){if(_0x17094e){return _0x17094e?{'count':_0x3f19c5,'rows':_0x17094e}:null;}})[_0x946b('0x20')](respondWithResult(_0x17d8af,null))[_0x946b('0x3e')](handleError(_0x17d8af,null));};exports[_0x946b('0x48')]=function(_0x1b47c5,_0x3b6625,_0x3b1a11){var _0x2fbba1={};var _0x1829d7={};var _0x207ba7;var _0x4ba53c;return db[_0x946b('0x24')][_0x946b('0x46')]({'where':{'id':_0x1b47c5[_0x946b('0x44')]['id']}})[_0x946b('0x20')](handleEntityNotFound(_0x3b6625,null))[_0x946b('0x20')](function(_0x342c6c){if(_0x342c6c){_0x207ba7=_0x342c6c;_0x1829d7[_0x946b('0x29')]=_[_0x946b('0x2c')](db[_0x946b('0x49')]['rawAttributes']);_0x1829d7[_0x946b('0x2d')]=_[_0x946b('0x2c')](_0x1b47c5[_0x946b('0x2d')]);_0x1829d7[_0x946b('0x2e')]=_[_0x946b('0x2f')](_0x1829d7[_0x946b('0x29')],_0x1829d7[_0x946b('0x2d')]);_0x2fbba1[_0x946b('0x30')]=_[_0x946b('0x2f')](_0x1829d7['model'],qs[_0x946b('0x31')](_0x1b47c5['query'][_0x946b('0x31')]));_0x2fbba1[_0x946b('0x30')]=_0x2fbba1[_0x946b('0x30')]['length']?_0x2fbba1[_0x946b('0x30')]:_0x1829d7[_0x946b('0x29')];_0x2fbba1[_0x946b('0x34')]=qs[_0x946b('0x35')](_0x1b47c5[_0x946b('0x2d')]['sort']);_0x2fbba1[_0x946b('0x36')]=qs[_0x946b('0x2e')](_[_0x946b('0x37')](_0x1b47c5[_0x946b('0x2d')],_0x1829d7[_0x946b('0x2e')]));if(_0x1b47c5[_0x946b('0x2d')][_0x946b('0x38')]){_0x2fbba1['where']=_[_0x946b('0x39')](_0x2fbba1[_0x946b('0x36')],{'$or':_[_0x946b('0x2a')](_0x2fbba1[_0x946b('0x30')],function(_0x25dabc){var _0x467eea={};_0x467eea[_0x25dabc]={'$like':'%'+_0x1b47c5[_0x946b('0x2d')][_0x946b('0x38')]+'%'};return _0x467eea;})});}_0x2fbba1=_[_0x946b('0x39')]({},_0x2fbba1,_0x1b47c5[_0x946b('0x3b')]);return _0x207ba7[_0x946b('0x48')](_0x2fbba1);}})[_0x946b('0x20')](function(_0x2a0abe){if(_0x2a0abe){_0x4ba53c=_0x2a0abe['length'];if(!_0x1b47c5[_0x946b('0x2d')][_0x946b('0x47')](_0x946b('0x33'))){_0x2fbba1[_0x946b('0x1b')]=qs[_0x946b('0x1b')](_0x1b47c5[_0x946b('0x2d')][_0x946b('0x1b')]);_0x2fbba1[_0x946b('0x19')]=qs['offset'](_0x1b47c5[_0x946b('0x2d')][_0x946b('0x19')]);}return _0x207ba7[_0x946b('0x48')](_0x2fbba1);}})[_0x946b('0x20')](function(_0x37274c){if(_0x37274c){return _0x37274c?{'count':_0x4ba53c,'rows':_0x37274c}:null;}})[_0x946b('0x20')](respondWithResult(_0x3b6625,null))[_0x946b('0x3e')](handleError(_0x3b6625,null));};exports[_0x946b('0x4a')]=function(_0x4468db,_0x4c6be9,_0x23b154){var _0x841280={};var _0x1c2268={};var _0x11e92e;var _0x4a34b2;return db[_0x946b('0x24')][_0x946b('0x46')]({'where':{'id':_0x4468db[_0x946b('0x44')]['id']}})[_0x946b('0x20')](handleEntityNotFound(_0x4c6be9,null))[_0x946b('0x20')](function(_0x459ff6){if(_0x459ff6){_0x11e92e=_0x459ff6;_0x1c2268[_0x946b('0x29')]=_[_0x946b('0x2c')](db[_0x946b('0x49')][_0x946b('0x25')]);_0x1c2268[_0x946b('0x2d')]=_[_0x946b('0x2c')](_0x4468db[_0x946b('0x2d')]);_0x1c2268['filters']=_[_0x946b('0x2f')](_0x1c2268[_0x946b('0x29')],_0x1c2268[_0x946b('0x2d')]);_0x841280[_0x946b('0x30')]=_['intersection'](_0x1c2268['model'],qs[_0x946b('0x31')](_0x4468db[_0x946b('0x2d')][_0x946b('0x31')]));_0x841280[_0x946b('0x30')]=_0x841280[_0x946b('0x30')]['length']?_0x841280[_0x946b('0x30')]:_0x1c2268['model'];_0x841280[_0x946b('0x34')]=qs[_0x946b('0x35')](_0x4468db[_0x946b('0x2d')]['sort']);_0x841280[_0x946b('0x36')]=qs[_0x946b('0x2e')](_[_0x946b('0x37')](_0x4468db[_0x946b('0x2d')],_0x1c2268['filters']));if(_0x4468db[_0x946b('0x2d')][_0x946b('0x38')]){_0x841280[_0x946b('0x36')]=_[_0x946b('0x39')](_0x841280[_0x946b('0x36')],{'$or':_[_0x946b('0x2a')](_0x841280[_0x946b('0x30')],function(_0x5282ac){var _0xa84b73={};_0xa84b73[_0x5282ac]={'$like':'%'+_0x4468db['query'][_0x946b('0x38')]+'%'};return _0xa84b73;})});}_0x841280=_[_0x946b('0x39')]({},_0x841280,_0x4468db[_0x946b('0x3b')]);return _0x11e92e[_0x946b('0x4a')](_0x841280);}})[_0x946b('0x20')](function(_0x25279e){if(_0x25279e){_0x4a34b2=_0x25279e['length'];if(!_0x4468db[_0x946b('0x2d')][_0x946b('0x47')]('nolimit')){_0x841280[_0x946b('0x1b')]=qs['limit'](_0x4468db['query'][_0x946b('0x1b')]);_0x841280[_0x946b('0x19')]=qs[_0x946b('0x19')](_0x4468db[_0x946b('0x2d')][_0x946b('0x19')]);}return _0x11e92e['getDescriptions'](_0x841280);}})[_0x946b('0x20')](function(_0x2add01){if(_0x2add01){return _0x2add01?{'count':_0x4a34b2,'rows':_0x2add01}:null;}})[_0x946b('0x20')](respondWithResult(_0x4c6be9,null))[_0x946b('0x3e')](handleError(_0x4c6be9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 549eaec..a9b9ded 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 _0x1280=['./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x21e23b,_0x2b8df0){var _0x378218=function(_0x22dca4){while(--_0x22dca4){_0x21e23b['push'](_0x21e23b['shift']());}};_0x378218(++_0x2b8df0);}(_0x1280,0xac));var _0x0128=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x1280[_0x2405bc];return _0x5272d4;};'use strict';var _=require(_0x0128('0x0'));var util=require('util');var logger=require(_0x0128('0x1'))(_0x0128('0x2'));var moment=require(_0x0128('0x3'));var BPromise=require(_0x0128('0x4'));var rp=require(_0x0128('0x5'));var fs=require('fs');var path=require(_0x0128('0x6'));var rimraf=require('rimraf');var config=require(_0x0128('0x7'));var attributes=require(_0x0128('0x8'));module[_0x0128('0x9')]=function(_0x2631a2,_0x4aa391){return _0x2631a2['define'](_0x0128('0xa'),attributes,{'tableName':_0x0128('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38d0=['int_servicenow_configurations','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0x38d0,0x123));var _0x038d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x38d0[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0x038d('0x0'));var logger=require(_0x038d('0x1'))(_0x038d('0x2'));var moment=require('moment');var BPromise=require(_0x038d('0x3'));var rp=require(_0x038d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x038d('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x038d('0x6')]=function(_0x2dd6b0,_0x5914cb){return _0x2dd6b0[_0x038d('0x7')](_0x038d('0x8'),attributes,{'tableName':_0x038d('0x9'),'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 45bf583..40adb8c 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 _0x1560=['error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify'];(function(_0x5872e0,_0x3b61a0){var _0x3e22c1=function(_0x256098){while(--_0x256098){_0x5872e0['push'](_0x5872e0['shift']());}};_0x3e22c1(++_0x3b61a0);}(_0x1560,0x155));var _0x0156=function(_0xc01caf,_0x255fb6){_0xc01caf=_0xc01caf-0x0;var _0x490dfe=_0x1560[_0xc01caf];return _0x490dfe;};'use strict';var _=require(_0x0156('0x0'));var util=require('util');var moment=require(_0x0156('0x1'));var BPromise=require(_0x0156('0x2'));var rs=require(_0x0156('0x3'));var fs=require('fs');var Redis=require(_0x0156('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0156('0x5'));var logger=require(_0x0156('0x6'))(_0x0156('0x7'));var config=require(_0x0156('0x8'));var jayson=require(_0x0156('0x9'));var client=jayson[_0x0156('0xa')][_0x0156('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c006f,_0x206a0d,_0x2be84a){return new BPromise(function(_0xf807e2,_0x20af42){return client['request'](_0x2c006f,_0x2be84a)[_0x0156('0xc')](function(_0x20bf2c){logger[_0x0156('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x206a0d,_0x0156('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x206a0d,_0x0156('0xe'),JSON[_0x0156('0xf')](_0x20bf2c));if(_0x20bf2c[_0x0156('0x10')]){if(_0x20bf2c[_0x0156('0x10')][_0x0156('0x11')]===0x1f4){logger[_0x0156('0x10')](_0x0156('0x12'),_0x206a0d,_0x20bf2c[_0x0156('0x10')][_0x0156('0x13')]);return _0x20af42(_0x20bf2c['error']['message']);}logger[_0x0156('0x10')](_0x0156('0x12'),_0x206a0d,_0x20bf2c['error'][_0x0156('0x13')]);return _0xf807e2(_0x20bf2c[_0x0156('0x10')][_0x0156('0x13')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x206a0d,_0x0156('0xe'));_0xf807e2(_0x20bf2c[_0x0156('0x14')][_0x0156('0x13')]);}})['catch'](function(_0x435684){logger['error'](_0x0156('0x12'),_0x206a0d,_0x435684);_0x20af42(_0x435684);});});} \ No newline at end of file +var _0x9b2d=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x9b2d,0x178));var _0xd9b2=function(_0x1d2b08,_0x3a430f){_0x1d2b08=_0x1d2b08-0x0;var _0x41d019=_0x9b2d[_0x1d2b08];return _0x41d019;};'use strict';var _=require(_0xd9b2('0x0'));var util=require(_0xd9b2('0x1'));var moment=require(_0xd9b2('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9b2('0x3'));var fs=require('fs');var Redis=require(_0xd9b2('0x4'));var db=require(_0xd9b2('0x5'))['db'];var utils=require(_0xd9b2('0x6'));var logger=require(_0xd9b2('0x7'))('rpc');var config=require(_0xd9b2('0x8'));var jayson=require(_0xd9b2('0x9'));var client=jayson[_0xd9b2('0xa')][_0xd9b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fc8e2,_0x5b44dc,_0x6513d){return new BPromise(function(_0x5237b9,_0xcea07a){return client[_0xd9b2('0xc')](_0x3fc8e2,_0x6513d)[_0xd9b2('0xd')](function(_0x30dfd6){logger[_0xd9b2('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b44dc,_0xd9b2('0xf'));logger[_0xd9b2('0x10')](_0xd9b2('0x11'),_0x5b44dc,_0xd9b2('0xf'),JSON['stringify'](_0x30dfd6));if(_0x30dfd6['error']){if(_0x30dfd6['error'][_0xd9b2('0x12')]===0x1f4){logger[_0xd9b2('0x13')](_0xd9b2('0x14'),_0x5b44dc,_0x30dfd6[_0xd9b2('0x13')][_0xd9b2('0x15')]);return _0xcea07a(_0x30dfd6[_0xd9b2('0x13')][_0xd9b2('0x15')]);}logger[_0xd9b2('0x13')](_0xd9b2('0x14'),_0x5b44dc,_0x30dfd6[_0xd9b2('0x13')][_0xd9b2('0x15')]);return _0x5237b9(_0x30dfd6[_0xd9b2('0x13')][_0xd9b2('0x15')]);}else{logger[_0xd9b2('0xe')](_0xd9b2('0x14'),_0x5b44dc,_0xd9b2('0xf'));_0x5237b9(_0x30dfd6[_0xd9b2('0x16')][_0xd9b2('0x15')]);}})[_0xd9b2('0x17')](function(_0x3f94a4){logger[_0xd9b2('0x13')](_0xd9b2('0x14'),_0x5b44dc,_0x3f94a4);_0xcea07a(_0x3f94a4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f68f110..787fa12 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 _0x78f5=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','multer'];(function(_0x378dfd,_0x423c99){var _0x537e01=function(_0x1eeb04){while(--_0x1eeb04){_0x378dfd['push'](_0x378dfd['shift']());}};_0x537e01(++_0x423c99);}(_0x78f5,0x10d));var _0x578f=function(_0x1132c7,_0x4a733d){_0x1132c7=_0x1132c7-0x0;var _0x56b032=_0x78f5[_0x1132c7];return _0x56b032;};'use strict';var multer=require(_0x578f('0x0'));var util=require(_0x578f('0x1'));var path=require(_0x578f('0x2'));var timeout=require(_0x578f('0x3'));var express=require(_0x578f('0x4'));var router=express[_0x578f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x578f('0x6'));var interaction=require(_0x578f('0x7'));var config=require(_0x578f('0x8'));var controller=require(_0x578f('0x9'));router[_0x578f('0xa')]('/',auth[_0x578f('0xb')](),controller[_0x578f('0xc')]);router['get'](_0x578f('0xd'),auth[_0x578f('0xb')](),controller['show']);router[_0x578f('0xe')]('/',auth[_0x578f('0xb')](),controller['create']);router[_0x578f('0xf')](_0x578f('0xd'),auth[_0x578f('0xb')](),controller[_0x578f('0x10')]);router[_0x578f('0x11')](_0x578f('0xd'),auth[_0x578f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8c93=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1335db,_0x340d64){var _0x1fe9a3=function(_0x486080){while(--_0x486080){_0x1335db['push'](_0x1335db['shift']());}};_0x1fe9a3(++_0x340d64);}(_0x8c93,0x175));var _0x38c9=function(_0x5c9b99,_0xd76c95){_0x5c9b99=_0x5c9b99-0x0;var _0x5b6cbb=_0x8c93[_0x5c9b99];return _0x5b6cbb;};'use strict';var multer=require(_0x38c9('0x0'));var util=require(_0x38c9('0x1'));var path=require(_0x38c9('0x2'));var timeout=require(_0x38c9('0x3'));var express=require(_0x38c9('0x4'));var router=express[_0x38c9('0x5')]();var fs_extra=require(_0x38c9('0x6'));var auth=require(_0x38c9('0x7'));var interaction=require(_0x38c9('0x8'));var config=require(_0x38c9('0x9'));var controller=require(_0x38c9('0xa'));router[_0x38c9('0xb')]('/',auth[_0x38c9('0xc')](),controller[_0x38c9('0xd')]);router[_0x38c9('0xb')](_0x38c9('0xe'),auth[_0x38c9('0xc')](),controller[_0x38c9('0xf')]);router['post']('/',auth[_0x38c9('0xc')](),controller[_0x38c9('0x10')]);router[_0x38c9('0x11')](_0x38c9('0xe'),auth[_0x38c9('0xc')](),controller[_0x38c9('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x38c9('0x13')]);module[_0x38c9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 95654e9..5665127 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 _0xa174=['customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa174,0x158));var _0x4a17=function(_0x40fa24,_0x1c6c5d){_0x40fa24=_0x40fa24-0x0;var _0x5de2cb=_0xa174[_0x40fa24];return _0x5de2cb;};'use strict';var Sequelize=require('sequelize');module[_0x4a17('0x0')]={'type':{'type':Sequelize[_0x4a17('0x1')](_0x4a17('0x2'),_0x4a17('0x3'),'customVariable',_0x4a17('0x4'),_0x4a17('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4a17('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4a17('0x1')](_0x4a17('0x2'),'variable',_0x4a17('0x7'))},'keyContent':{'type':Sequelize[_0x4a17('0x6')]},'idField':{'type':Sequelize[_0x4a17('0x6')]},'nameField':{'type':Sequelize[_0x4a17('0x6')]},'customField':{'type':Sequelize[_0x4a17('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4a17('0x6')]}}; \ No newline at end of file +var _0x98a1=['keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x98a1,0x1f0));var _0x198a=function(_0x3f4e24,_0x445392){_0x3f4e24=_0x3f4e24-0x0;var _0x29d5dc=_0x98a1[_0x3f4e24];return _0x29d5dc;};'use strict';var Sequelize=require(_0x198a('0x0'));module[_0x198a('0x1')]={'type':{'type':Sequelize[_0x198a('0x2')]('string','variable',_0x198a('0x3'),_0x198a('0x4'),_0x198a('0x5')),'defaultValue':_0x198a('0x6')},'content':{'type':Sequelize[_0x198a('0x7')]},'key':{'type':Sequelize[_0x198a('0x7')]},'keyType':{'type':Sequelize[_0x198a('0x2')](_0x198a('0x6'),_0x198a('0x8'),_0x198a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x198a('0x7')]},'nameField':{'type':Sequelize[_0x198a('0x7')]},'customField':{'type':Sequelize[_0x198a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x198a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5e8f4ec..59e7196 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 _0x0d45=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','destroy','then','name','send','map','ServicenowField','rawAttributes','fieldName','type'];(function(_0x3a37ec,_0x3bf717){var _0x287c02=function(_0xf53dd8){while(--_0xf53dd8){_0x3a37ec['push'](_0x3a37ec['shift']());}};_0x287c02(++_0x3bf717);}(_0x0d45,0xe4));var _0x50d4=function(_0x3956d1,_0x5bef65){_0x3956d1=_0x3956d1-0x0;var _0x570550=_0x0d45[_0x3956d1];return _0x570550;};'use strict';var emlformat=require(_0x50d4('0x0'));var rimraf=require(_0x50d4('0x1'));var zipdir=require(_0x50d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50d4('0x3'));var moment=require(_0x50d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50d4('0x5'));var util=require('util');var path=require(_0x50d4('0x6'));var sox=require(_0x50d4('0x7'));var csv=require(_0x50d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50d4('0x9'));var squel=require(_0x50d4('0xa'));var crypto=require('crypto');var jsforce=require(_0x50d4('0xb'));var deskjs=require(_0x50d4('0xc'));var toCsv=require(_0x50d4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x50d4('0xd'));var authService=require(_0x50d4('0xe'));var qs=require(_0x50d4('0xf'));var as=require(_0x50d4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x50d4('0x11'));var utils=require('../../config/utils');var config=require(_0x50d4('0x12'));var licenseUtil=require(_0x50d4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34fa57,_0x4e5b36){_0x4e5b36=_0x4e5b36||0xcc;return function(_0x23b1c5){if(_0x23b1c5){return _0x34fa57[_0x50d4('0x14')](_0x4e5b36);}return _0x34fa57[_0x50d4('0x15')](_0x4e5b36)[_0x50d4('0x16')]();};}function respondWithResult(_0x3fe4e6,_0x5e4dd2){_0x5e4dd2=_0x5e4dd2||0xc8;return function(_0x54b6bc){if(_0x54b6bc){return _0x3fe4e6[_0x50d4('0x15')](_0x5e4dd2)[_0x50d4('0x17')](_0x54b6bc);}};}function respondWithFilteredResult(_0xeb5bfc,_0x365170){return function(_0x326cf7){if(_0x326cf7){var _0x142f64=typeof _0x365170[_0x50d4('0x18')]===_0x50d4('0x19')&&typeof _0x365170[_0x50d4('0x1a')]==='undefined';var _0x105738=_0x326cf7['count'];var _0x58a2e4=_0x142f64?0x0:_0x365170['offset'];var _0x3621ea=_0x142f64?_0x326cf7[_0x50d4('0x1b')]:_0x365170[_0x50d4('0x18')]+_0x365170[_0x50d4('0x1a')];var _0x33fc95;if(_0x3621ea>=_0x105738){_0x3621ea=_0x105738;_0x33fc95=0xc8;}else{_0x33fc95=0xce;}_0xeb5bfc[_0x50d4('0x15')](_0x33fc95);return _0xeb5bfc[_0x50d4('0x1c')]('Content-Range',_0x58a2e4+'-'+_0x3621ea+'/'+_0x105738)[_0x50d4('0x17')](_0x326cf7);}return null;};}function patchUpdates(_0x16daea){return function(_0x26cf4d){try{jsonpatch[_0x50d4('0x1d')](_0x26cf4d,_0x16daea,!![]);}catch(_0xd7c77c){return BPromise['reject'](_0xd7c77c);}return _0x26cf4d[_0x50d4('0x1e')]();};}function saveUpdates(_0x2c6f7f,_0x5ade67){return function(_0x2a74e1){if(_0x2a74e1){return _0x2a74e1['update'](_0x2c6f7f)['then'](function(_0x3660ab){return _0x3660ab;});}return null;};}function removeEntity(_0x2833ff,_0x169055){return function(_0x580c9e){if(_0x580c9e){return _0x580c9e[_0x50d4('0x1f')]()[_0x50d4('0x20')](function(){_0x2833ff[_0x50d4('0x15')](0xcc)[_0x50d4('0x16')]();});}};}function handleEntityNotFound(_0xdea806,_0x3a1712){return function(_0x3190fa){if(!_0x3190fa){_0xdea806[_0x50d4('0x14')](0x194);}return _0x3190fa;};}function handleError(_0x38ba40,_0x1e650f){_0x1e650f=_0x1e650f||0x1f4;return function(_0x2475e4){logger['error'](_0x2475e4['stack']);if(_0x2475e4['name']){delete _0x2475e4[_0x50d4('0x21')];}_0x38ba40[_0x50d4('0x15')](_0x1e650f)[_0x50d4('0x22')](_0x2475e4);};}exports['index']=function(_0x2f708f,_0x362e5b){var _0x4fd9b0={},_0x5b5f50={},_0x1aec4f={'count':0x0,'rows':[]};var _0x15d5ca=_[_0x50d4('0x23')](db[_0x50d4('0x24')][_0x50d4('0x25')],function(_0x29b2a5){return{'name':_0x29b2a5[_0x50d4('0x26')],'type':_0x29b2a5[_0x50d4('0x27')][_0x50d4('0x28')]};});_0x5b5f50[_0x50d4('0x29')]=_[_0x50d4('0x23')](_0x15d5ca,_0x50d4('0x21'));_0x5b5f50['query']=_[_0x50d4('0x2a')](_0x2f708f[_0x50d4('0x2b')]);_0x5b5f50[_0x50d4('0x2c')]=_[_0x50d4('0x2d')](_0x5b5f50[_0x50d4('0x29')],_0x5b5f50['query']);_0x4fd9b0[_0x50d4('0x2e')]=_[_0x50d4('0x2d')](_0x5b5f50[_0x50d4('0x29')],qs[_0x50d4('0x2f')](_0x2f708f[_0x50d4('0x2b')][_0x50d4('0x2f')]));_0x4fd9b0['attributes']=_0x4fd9b0[_0x50d4('0x2e')][_0x50d4('0x30')]?_0x4fd9b0['attributes']:_0x5b5f50[_0x50d4('0x29')];if(!_0x2f708f[_0x50d4('0x2b')][_0x50d4('0x31')](_0x50d4('0x32'))){_0x4fd9b0[_0x50d4('0x1a')]=qs[_0x50d4('0x1a')](_0x2f708f[_0x50d4('0x2b')]['limit']);_0x4fd9b0['offset']=qs[_0x50d4('0x18')](_0x2f708f['query'][_0x50d4('0x18')]);}_0x4fd9b0['order']=qs[_0x50d4('0x33')](_0x2f708f['query'][_0x50d4('0x33')]);_0x4fd9b0['where']=qs[_0x50d4('0x2c')](_['pick'](_0x2f708f[_0x50d4('0x2b')],_0x5b5f50[_0x50d4('0x2c')]),_0x15d5ca);if(_0x2f708f['query']['filter']){_0x4fd9b0[_0x50d4('0x34')]=_[_0x50d4('0x35')](_0x4fd9b0[_0x50d4('0x34')],{'$or':_[_0x50d4('0x23')](_0x15d5ca,function(_0x4b9373){if(_0x4b9373[_0x50d4('0x27')]!==_0x50d4('0x36')){var _0xa91257={};_0xa91257[_0x4b9373[_0x50d4('0x21')]]={'$like':'%'+_0x2f708f[_0x50d4('0x2b')][_0x50d4('0x37')]+'%'};return _0xa91257;}})});}_0x4fd9b0=_[_0x50d4('0x35')]({},_0x4fd9b0,_0x2f708f[_0x50d4('0x38')]);var _0x4ba361={'where':_0x4fd9b0[_0x50d4('0x34')]};return db[_0x50d4('0x24')][_0x50d4('0x1b')](_0x4ba361)['then'](function(_0x634659){_0x1aec4f['count']=_0x634659;if(_0x2f708f[_0x50d4('0x2b')][_0x50d4('0x39')]){_0x4fd9b0[_0x50d4('0x3a')]=[{'all':!![]}];}return db[_0x50d4('0x24')][_0x50d4('0x3b')](_0x4fd9b0);})[_0x50d4('0x20')](function(_0xfc5ea2){_0x1aec4f[_0x50d4('0x3c')]=_0xfc5ea2;return _0x1aec4f;})['then'](respondWithFilteredResult(_0x362e5b,_0x4fd9b0))[_0x50d4('0x3d')](handleError(_0x362e5b,null));};exports['show']=function(_0x44e50b,_0x249c10){var _0x17fe46={'raw':!![],'where':{'id':_0x44e50b[_0x50d4('0x3e')]['id']}},_0x106aa0={};_0x106aa0[_0x50d4('0x29')]=_['keys'](db[_0x50d4('0x24')][_0x50d4('0x25')]);_0x106aa0[_0x50d4('0x2b')]=_[_0x50d4('0x2a')](_0x44e50b['query']);_0x106aa0[_0x50d4('0x2c')]=_[_0x50d4('0x2d')](_0x106aa0[_0x50d4('0x29')],_0x106aa0[_0x50d4('0x2b')]);_0x17fe46[_0x50d4('0x2e')]=_['intersection'](_0x106aa0[_0x50d4('0x29')],qs['fields'](_0x44e50b[_0x50d4('0x2b')][_0x50d4('0x2f')]));_0x17fe46['attributes']=_0x17fe46[_0x50d4('0x2e')][_0x50d4('0x30')]?_0x17fe46['attributes']:_0x106aa0['model'];if(_0x44e50b[_0x50d4('0x2b')][_0x50d4('0x39')]){_0x17fe46['include']=[{'all':!![]}];}_0x17fe46=_['merge']({},_0x17fe46,_0x44e50b[_0x50d4('0x38')]);return db[_0x50d4('0x24')]['find'](_0x17fe46)[_0x50d4('0x20')](handleEntityNotFound(_0x249c10,null))[_0x50d4('0x20')](respondWithResult(_0x249c10,null))['catch'](handleError(_0x249c10,null));};exports['create']=function(_0x46fc78,_0x4fa04d){return db[_0x50d4('0x24')][_0x50d4('0x3f')](_0x46fc78[_0x50d4('0x40')],{})[_0x50d4('0x20')](respondWithResult(_0x4fa04d,0xc9))[_0x50d4('0x3d')](handleError(_0x4fa04d,null));};exports[_0x50d4('0x41')]=function(_0x2d481a,_0x16ccea){if(_0x2d481a[_0x50d4('0x40')]['id']){delete _0x2d481a['body']['id'];}return db[_0x50d4('0x24')][_0x50d4('0x42')]({'where':{'id':_0x2d481a[_0x50d4('0x3e')]['id']}})[_0x50d4('0x20')](handleEntityNotFound(_0x16ccea,null))['then'](saveUpdates(_0x2d481a[_0x50d4('0x40')],null))[_0x50d4('0x20')](respondWithResult(_0x16ccea,null))[_0x50d4('0x3d')](handleError(_0x16ccea,null));};exports['destroy']=function(_0x4c2d84,_0x3a148a){return db[_0x50d4('0x24')][_0x50d4('0x42')]({'where':{'id':_0x4c2d84[_0x50d4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3a148a,null))[_0x50d4('0x20')](removeEntity(_0x3a148a,null))['catch'](handleError(_0x3a148a,null));}; \ No newline at end of file +var _0x14b6=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','send','map','ServicenowField','fieldName','type','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','intersection','fields','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0x14b6,0x197));var _0x614b=function(_0x1c0b24,_0x51c44f){_0x1c0b24=_0x1c0b24-0x0;var _0xb918c4=_0x14b6[_0x1c0b24];return _0xb918c4;};'use strict';var emlformat=require(_0x614b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x614b('0x1'));var jsonpatch=require(_0x614b('0x2'));var rp=require(_0x614b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x614b('0x4'));var util=require(_0x614b('0x5'));var path=require(_0x614b('0x6'));var sox=require(_0x614b('0x7'));var csv=require(_0x614b('0x8'));var ejs=require(_0x614b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x614b('0xa'));var squel=require(_0x614b('0xb'));var crypto=require('crypto');var jsforce=require(_0x614b('0xc'));var deskjs=require(_0x614b('0xd'));var toCsv=require(_0x614b('0x8'));var querystring=require(_0x614b('0xe'));var Papa=require('papaparse');var Redis=require(_0x614b('0xf'));var authService=require(_0x614b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x614b('0x11'));var hardwareService=require(_0x614b('0x12'));var logger=require(_0x614b('0x13'))(_0x614b('0x14'));var utils=require(_0x614b('0x15'));var config=require(_0x614b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58706d,_0x5d7de9){_0x5d7de9=_0x5d7de9||0xcc;return function(_0x2ff313){if(_0x2ff313){return _0x58706d[_0x614b('0x17')](_0x5d7de9);}return _0x58706d[_0x614b('0x18')](_0x5d7de9)['end']();};}function respondWithResult(_0x6b6cba,_0x384223){_0x384223=_0x384223||0xc8;return function(_0x1641ee){if(_0x1641ee){return _0x6b6cba[_0x614b('0x18')](_0x384223)[_0x614b('0x19')](_0x1641ee);}};}function respondWithFilteredResult(_0x369f1b,_0x3c4953){return function(_0x512677){if(_0x512677){var _0x36aa4b=typeof _0x3c4953[_0x614b('0x1a')]===_0x614b('0x1b')&&typeof _0x3c4953[_0x614b('0x1c')]==='undefined';var _0x1ba563=_0x512677[_0x614b('0x1d')];var _0x212e0d=_0x36aa4b?0x0:_0x3c4953[_0x614b('0x1a')];var _0x226e97=_0x36aa4b?_0x512677[_0x614b('0x1d')]:_0x3c4953[_0x614b('0x1a')]+_0x3c4953[_0x614b('0x1c')];var _0x2ec3e1;if(_0x226e97>=_0x1ba563){_0x226e97=_0x1ba563;_0x2ec3e1=0xc8;}else{_0x2ec3e1=0xce;}_0x369f1b[_0x614b('0x18')](_0x2ec3e1);return _0x369f1b['set'](_0x614b('0x1e'),_0x212e0d+'-'+_0x226e97+'/'+_0x1ba563)['json'](_0x512677);}return null;};}function patchUpdates(_0x2e84ac){return function(_0x45aaeb){try{jsonpatch[_0x614b('0x1f')](_0x45aaeb,_0x2e84ac,!![]);}catch(_0x47b76f){return BPromise[_0x614b('0x20')](_0x47b76f);}return _0x45aaeb[_0x614b('0x21')]();};}function saveUpdates(_0x1ba621,_0xce284){return function(_0x1a871f){if(_0x1a871f){return _0x1a871f[_0x614b('0x22')](_0x1ba621)[_0x614b('0x23')](function(_0x421912){return _0x421912;});}return null;};}function removeEntity(_0x8408c7,_0x2d11f5){return function(_0x4fddf8){if(_0x4fddf8){return _0x4fddf8['destroy']()[_0x614b('0x23')](function(){_0x8408c7[_0x614b('0x18')](0xcc)[_0x614b('0x24')]();});}};}function handleEntityNotFound(_0x45f1e7,_0x73d5e8){return function(_0x5b68d1){if(!_0x5b68d1){_0x45f1e7[_0x614b('0x17')](0x194);}return _0x5b68d1;};}function handleError(_0xb98048,_0x4701c4){_0x4701c4=_0x4701c4||0x1f4;return function(_0x3dd56c){logger['error'](_0x3dd56c[_0x614b('0x25')]);if(_0x3dd56c[_0x614b('0x26')]){delete _0x3dd56c[_0x614b('0x26')];}_0xb98048[_0x614b('0x18')](_0x4701c4)[_0x614b('0x27')](_0x3dd56c);};}exports['index']=function(_0x5036ed,_0x31f715){var _0x6a1781={},_0x230f47={},_0x2864b3={'count':0x0,'rows':[]};var _0x4108cb=_[_0x614b('0x28')](db[_0x614b('0x29')]['rawAttributes'],function(_0x43ffaa){return{'name':_0x43ffaa[_0x614b('0x2a')],'type':_0x43ffaa[_0x614b('0x2b')][_0x614b('0x2c')]};});_0x230f47[_0x614b('0x2d')]=_[_0x614b('0x28')](_0x4108cb,_0x614b('0x26'));_0x230f47[_0x614b('0x2e')]=_[_0x614b('0x2f')](_0x5036ed[_0x614b('0x2e')]);_0x230f47['filters']=_['intersection'](_0x230f47['model'],_0x230f47[_0x614b('0x2e')]);_0x6a1781[_0x614b('0x30')]=_['intersection'](_0x230f47[_0x614b('0x2d')],qs['fields'](_0x5036ed[_0x614b('0x2e')]['fields']));_0x6a1781[_0x614b('0x30')]=_0x6a1781[_0x614b('0x30')][_0x614b('0x31')]?_0x6a1781['attributes']:_0x230f47[_0x614b('0x2d')];if(!_0x5036ed['query'][_0x614b('0x32')](_0x614b('0x33'))){_0x6a1781['limit']=qs[_0x614b('0x1c')](_0x5036ed[_0x614b('0x2e')]['limit']);_0x6a1781[_0x614b('0x1a')]=qs['offset'](_0x5036ed['query'][_0x614b('0x1a')]);}_0x6a1781['order']=qs[_0x614b('0x34')](_0x5036ed[_0x614b('0x2e')]['sort']);_0x6a1781[_0x614b('0x35')]=qs[_0x614b('0x36')](_[_0x614b('0x37')](_0x5036ed[_0x614b('0x2e')],_0x230f47[_0x614b('0x36')]),_0x4108cb);if(_0x5036ed[_0x614b('0x2e')][_0x614b('0x38')]){_0x6a1781[_0x614b('0x35')]=_[_0x614b('0x39')](_0x6a1781[_0x614b('0x35')],{'$or':_[_0x614b('0x28')](_0x4108cb,function(_0x260f3a){if(_0x260f3a[_0x614b('0x2b')]!=='VIRTUAL'){var _0x32167b={};_0x32167b[_0x260f3a['name']]={'$like':'%'+_0x5036ed['query'][_0x614b('0x38')]+'%'};return _0x32167b;}})});}_0x6a1781=_[_0x614b('0x39')]({},_0x6a1781,_0x5036ed[_0x614b('0x3a')]);var _0x46a151={'where':_0x6a1781[_0x614b('0x35')]};return db[_0x614b('0x29')][_0x614b('0x1d')](_0x46a151)[_0x614b('0x23')](function(_0x2015ac){_0x2864b3[_0x614b('0x1d')]=_0x2015ac;if(_0x5036ed[_0x614b('0x2e')][_0x614b('0x3b')]){_0x6a1781[_0x614b('0x3c')]=[{'all':!![]}];}return db[_0x614b('0x29')][_0x614b('0x3d')](_0x6a1781);})[_0x614b('0x23')](function(_0x26747a){_0x2864b3['rows']=_0x26747a;return _0x2864b3;})[_0x614b('0x23')](respondWithFilteredResult(_0x31f715,_0x6a1781))[_0x614b('0x3e')](handleError(_0x31f715,null));};exports['show']=function(_0xd253ec,_0x54791e){var _0x20a5e6={'raw':!![],'where':{'id':_0xd253ec[_0x614b('0x3f')]['id']}},_0x39adf8={};_0x39adf8['model']=_[_0x614b('0x2f')](db['ServicenowField'][_0x614b('0x40')]);_0x39adf8[_0x614b('0x2e')]=_['keys'](_0xd253ec[_0x614b('0x2e')]);_0x39adf8[_0x614b('0x36')]=_[_0x614b('0x41')](_0x39adf8[_0x614b('0x2d')],_0x39adf8[_0x614b('0x2e')]);_0x20a5e6[_0x614b('0x30')]=_[_0x614b('0x41')](_0x39adf8[_0x614b('0x2d')],qs[_0x614b('0x42')](_0xd253ec['query'][_0x614b('0x42')]));_0x20a5e6[_0x614b('0x30')]=_0x20a5e6['attributes'][_0x614b('0x31')]?_0x20a5e6[_0x614b('0x30')]:_0x39adf8[_0x614b('0x2d')];if(_0xd253ec['query'][_0x614b('0x3b')]){_0x20a5e6[_0x614b('0x3c')]=[{'all':!![]}];}_0x20a5e6=_[_0x614b('0x39')]({},_0x20a5e6,_0xd253ec[_0x614b('0x3a')]);return db[_0x614b('0x29')][_0x614b('0x43')](_0x20a5e6)['then'](handleEntityNotFound(_0x54791e,null))[_0x614b('0x23')](respondWithResult(_0x54791e,null))['catch'](handleError(_0x54791e,null));};exports[_0x614b('0x44')]=function(_0x221bfa,_0x5e79a2){return db[_0x614b('0x29')][_0x614b('0x44')](_0x221bfa[_0x614b('0x45')],{})[_0x614b('0x23')](respondWithResult(_0x5e79a2,0xc9))[_0x614b('0x3e')](handleError(_0x5e79a2,null));};exports[_0x614b('0x22')]=function(_0x56b19a,_0x4ab7ad){if(_0x56b19a['body']['id']){delete _0x56b19a[_0x614b('0x45')]['id'];}return db['ServicenowField'][_0x614b('0x43')]({'where':{'id':_0x56b19a[_0x614b('0x3f')]['id']}})[_0x614b('0x23')](handleEntityNotFound(_0x4ab7ad,null))[_0x614b('0x23')](saveUpdates(_0x56b19a[_0x614b('0x45')],null))[_0x614b('0x23')](respondWithResult(_0x4ab7ad,null))[_0x614b('0x3e')](handleError(_0x4ab7ad,null));};exports[_0x614b('0x46')]=function(_0x16f9d5,_0x308492){return db['ServicenowField'][_0x614b('0x43')]({'where':{'id':_0x16f9d5[_0x614b('0x3f')]['id']}})[_0x614b('0x23')](handleEntityNotFound(_0x308492,null))[_0x614b('0x23')](removeEntity(_0x308492,null))[_0x614b('0x3e')](handleError(_0x308492,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 684903e..a7a230e 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 _0xaa7f=['lodash','api','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','servicenow_unique_index','idField','FieldId'];(function(_0xa09242,_0x13dfdc){var _0x411cd0=function(_0x88dbe4){while(--_0x88dbe4){_0xa09242['push'](_0xa09242['shift']());}};_0x411cd0(++_0x13dfdc);}(_0xaa7f,0x9a));var _0xfaa7=function(_0x3f7600,_0x383310){_0x3f7600=_0x3f7600-0x0;var _0x14596c=_0xaa7f[_0x3f7600];return _0x14596c;};'use strict';var _=require(_0xfaa7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfaa7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfaa7('0x2'));var fs=require('fs');var path=require(_0xfaa7('0x3'));var rimraf=require(_0xfaa7('0x4'));var config=require('../../config/environment');var attributes=require(_0xfaa7('0x5'));module[_0xfaa7('0x6')]=function(_0x1a05b3,_0x1043e7){return _0x1a05b3[_0xfaa7('0x7')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xfaa7('0x8'),'fields':[_0xfaa7('0x9'),_0xfaa7('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9fd6=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','api','moment'];(function(_0x3710ca,_0x57c92e){var _0x18ef2d=function(_0x5d4065){while(--_0x5d4065){_0x3710ca['push'](_0x3710ca['shift']());}};_0x18ef2d(++_0x57c92e);}(_0x9fd6,0x72));var _0x69fd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fd6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x69fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x69fd('0x1'));var moment=require(_0x69fd('0x2'));var BPromise=require('bluebird');var rp=require(_0x69fd('0x3'));var fs=require('fs');var path=require(_0x69fd('0x4'));var rimraf=require(_0x69fd('0x5'));var config=require(_0x69fd('0x6'));var attributes=require(_0x69fd('0x7'));module[_0x69fd('0x8')]=function(_0x3b344b,_0x1846c7){return _0x3b344b['define'](_0x69fd('0x9'),attributes,{'tableName':_0x69fd('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x69fd('0xb'),_0x69fd('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 4920628..d229594 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1a2581,_0x44dab6){var _0x21ef3e=function(_0x26839e){while(--_0x26839e){_0x1a2581['push'](_0x1a2581['shift']());}};_0x21ef3e(++_0x44dab6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x59e6da,_0xc2eef6){var _0x3f209f=function(_0x55c984){while(--_0x55c984){_0x59e6da['push'](_0x59e6da['shift']());}};_0x3f209f(++_0xc2eef6);}(_0xe706,0xa3));var _0x6e70=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xe706[_0x576266];return _0x18234f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index b62507e..9cd20b7 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(_0x41edf8,_0x11e439){var _0x487cad=function(_0x426914){while(--_0x426914){_0x41edf8['push'](_0x41edf8['shift']());}};_0x487cad(++_0x11e439);}(_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 _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(_0xe15a1,_0x3010eb){var _0x46260f=function(_0x3ea6f9){while(--_0x3ea6f9){_0xe15a1['push'](_0xe15a1['shift']());}};_0x46260f(++_0x3010eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 bf1afb9..4e9ee17 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(_0x545ec7,_0xa2858){var _0x14b65f=function(_0x2e0102){while(--_0x2e0102){_0x545ec7['push'](_0x545ec7['shift']());}};_0x14b65f(++_0xa2858);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x1afcfa,_0xc57158){var _0x43e5cf=function(_0x35fcf9){while(--_0x35fcf9){_0x1afcfa['push'](_0x1afcfa['shift']());}};_0x43e5cf(++_0xc57158);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 a670e16..0f72bf8 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 _0xcf43=['SugarcrmAccount','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','getConfigurations','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','date_start','parent_id','parent_type','parent_name','direction','findOne','username','remoteUri','slice','lastIndexOf','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','value','test','statusCode','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x12c551,_0x2676d5){var _0x1800bd=function(_0x45d004){while(--_0x45d004){_0x12c551['push'](_0x12c551['shift']());}};_0x1800bd(++_0x2676d5);}(_0xcf43,0xcb));var _0x3cf4=function(_0x531ab0,_0x288b83){_0x531ab0=_0x531ab0-0x0;var _0x2de4dc=_0xcf43[_0x531ab0];return _0x2de4dc;};'use strict';var emlformat=require(_0x3cf4('0x0'));var rimraf=require(_0x3cf4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3cf4('0x2'));var rp=require(_0x3cf4('0x3'));var moment=require(_0x3cf4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3cf4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3cf4('0x6'));var csv=require(_0x3cf4('0x7'));var ejs=require(_0x3cf4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cf4('0x9'));var squel=require(_0x3cf4('0xa'));var crypto=require(_0x3cf4('0xb'));var jsforce=require(_0x3cf4('0xc'));var deskjs=require(_0x3cf4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3cf4('0xe'));var Papa=require(_0x3cf4('0xf'));var Redis=require(_0x3cf4('0x10'));var authService=require(_0x3cf4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cf4('0x12'));var logger=require(_0x3cf4('0x13'))('api');var utils=require(_0x3cf4('0x14'));var config=require(_0x3cf4('0x15'));var licenseUtil=require(_0x3cf4('0x16'));var db=require(_0x3cf4('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x131afb,_0x2bd31b){_0x2bd31b=_0x2bd31b||0xcc;return function(_0x51f890){if(_0x51f890){return _0x131afb[_0x3cf4('0x18')](_0x2bd31b);}return _0x131afb[_0x3cf4('0x19')](_0x2bd31b)[_0x3cf4('0x1a')]();};}function respondWithResult(_0x2b6768,_0x4feb45){_0x4feb45=_0x4feb45||0xc8;return function(_0x3fbacb){if(_0x3fbacb){return _0x2b6768[_0x3cf4('0x19')](_0x4feb45)[_0x3cf4('0x1b')](_0x3fbacb);}};}function respondWithFilteredResult(_0x490a25,_0x4a59a2){return function(_0x357cd3){if(_0x357cd3){var _0x533913=typeof _0x4a59a2[_0x3cf4('0x1c')]===_0x3cf4('0x1d')&&typeof _0x4a59a2[_0x3cf4('0x1e')]==='undefined';var _0x2d7817=_0x357cd3['count'];var _0x2f7e6f=_0x533913?0x0:_0x4a59a2[_0x3cf4('0x1c')];var _0x5e4eb1=_0x533913?_0x357cd3[_0x3cf4('0x1f')]:_0x4a59a2['offset']+_0x4a59a2[_0x3cf4('0x1e')];var _0x577281;if(_0x5e4eb1>=_0x2d7817){_0x5e4eb1=_0x2d7817;_0x577281=0xc8;}else{_0x577281=0xce;}_0x490a25[_0x3cf4('0x19')](_0x577281);return _0x490a25[_0x3cf4('0x20')](_0x3cf4('0x21'),_0x2f7e6f+'-'+_0x5e4eb1+'/'+_0x2d7817)[_0x3cf4('0x1b')](_0x357cd3);}return null;};}function patchUpdates(_0xb9c198){return function(_0x28cda2){try{jsonpatch[_0x3cf4('0x22')](_0x28cda2,_0xb9c198,!![]);}catch(_0x5d367c){return BPromise[_0x3cf4('0x23')](_0x5d367c);}return _0x28cda2[_0x3cf4('0x24')]();};}function saveUpdates(_0xea48aa,_0x53f8f9){return function(_0x2ab93f){if(_0x2ab93f){return _0x2ab93f[_0x3cf4('0x25')](_0xea48aa)[_0x3cf4('0x26')](function(_0x5a411e){return _0x5a411e;});}return null;};}function removeEntity(_0x1bdffc,_0x3ed736){return function(_0x2618c1){if(_0x2618c1){return _0x2618c1[_0x3cf4('0x27')]()[_0x3cf4('0x26')](function(){_0x1bdffc[_0x3cf4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244a05,_0x2c0d85){return function(_0x40bc4e){if(!_0x40bc4e){_0x244a05[_0x3cf4('0x18')](0x194);}return _0x40bc4e;};}function handleError(_0xf2885f,_0x2d78b1){_0x2d78b1=_0x2d78b1||0x1f4;return function(_0x548c08){logger[_0x3cf4('0x28')](_0x548c08[_0x3cf4('0x29')]);if(_0x548c08[_0x3cf4('0x2a')]){delete _0x548c08[_0x3cf4('0x2a')];}_0xf2885f[_0x3cf4('0x19')](_0x2d78b1)[_0x3cf4('0x2b')](_0x548c08);};}exports[_0x3cf4('0x2c')]=function(_0x26adbc,_0x59f30c){var _0x49a8cb={},_0x19f871={},_0x4c5f0b={'count':0x0,'rows':[]};var _0x15840c=_['map'](db[_0x3cf4('0x2d')]['rawAttributes'],function(_0x1950c8){return{'name':_0x1950c8[_0x3cf4('0x2e')],'type':_0x1950c8[_0x3cf4('0x2f')][_0x3cf4('0x30')]};});_0x19f871[_0x3cf4('0x31')]=_[_0x3cf4('0x32')](_0x15840c,_0x3cf4('0x2a'));_0x19f871['query']=_['keys'](_0x26adbc[_0x3cf4('0x33')]);_0x19f871[_0x3cf4('0x34')]=_[_0x3cf4('0x35')](_0x19f871[_0x3cf4('0x31')],_0x19f871['query']);_0x49a8cb[_0x3cf4('0x36')]=_['intersection'](_0x19f871['model'],qs[_0x3cf4('0x37')](_0x26adbc[_0x3cf4('0x33')][_0x3cf4('0x37')]));_0x49a8cb[_0x3cf4('0x36')]=_0x49a8cb[_0x3cf4('0x36')][_0x3cf4('0x38')]?_0x49a8cb[_0x3cf4('0x36')]:_0x19f871[_0x3cf4('0x31')];if(!_0x26adbc[_0x3cf4('0x33')][_0x3cf4('0x39')](_0x3cf4('0x3a'))){_0x49a8cb[_0x3cf4('0x1e')]=qs[_0x3cf4('0x1e')](_0x26adbc[_0x3cf4('0x33')][_0x3cf4('0x1e')]);_0x49a8cb[_0x3cf4('0x1c')]=qs[_0x3cf4('0x1c')](_0x26adbc['query'][_0x3cf4('0x1c')]);}_0x49a8cb[_0x3cf4('0x3b')]=qs['sort'](_0x26adbc[_0x3cf4('0x33')][_0x3cf4('0x3c')]);_0x49a8cb[_0x3cf4('0x3d')]=qs['filters'](_[_0x3cf4('0x3e')](_0x26adbc[_0x3cf4('0x33')],_0x19f871['filters']),_0x15840c);if(_0x26adbc[_0x3cf4('0x33')]['filter']){_0x49a8cb[_0x3cf4('0x3d')]=_[_0x3cf4('0x3f')](_0x49a8cb[_0x3cf4('0x3d')],{'$or':_[_0x3cf4('0x32')](_0x15840c,function(_0x308738){if(_0x308738[_0x3cf4('0x2f')]!==_0x3cf4('0x40')){var _0x30078e={};_0x30078e[_0x308738['name']]={'$like':'%'+_0x26adbc[_0x3cf4('0x33')][_0x3cf4('0x41')]+'%'};return _0x30078e;}})});}_0x49a8cb=_[_0x3cf4('0x3f')]({},_0x49a8cb,_0x26adbc[_0x3cf4('0x42')]);var _0x55392f={'where':_0x49a8cb[_0x3cf4('0x3d')]};return db[_0x3cf4('0x2d')]['count'](_0x55392f)[_0x3cf4('0x26')](function(_0x1615c1){_0x4c5f0b['count']=_0x1615c1;if(_0x26adbc[_0x3cf4('0x33')][_0x3cf4('0x43')]){_0x49a8cb['include']=[{'all':!![]}];}return db[_0x3cf4('0x2d')]['findAll'](_0x49a8cb);})['then'](function(_0x4b4d6b){_0x4c5f0b[_0x3cf4('0x44')]=_0x4b4d6b;return _0x4c5f0b;})['then'](respondWithFilteredResult(_0x59f30c,_0x49a8cb))[_0x3cf4('0x45')](handleError(_0x59f30c,null));};exports[_0x3cf4('0x46')]=function(_0x228dd8,_0x414f89){var _0x499457={'raw':![],'where':{'id':_0x228dd8[_0x3cf4('0x47')]['id']}},_0x3f7a4a={};_0x3f7a4a[_0x3cf4('0x31')]=_[_0x3cf4('0x48')](db[_0x3cf4('0x2d')][_0x3cf4('0x49')]);_0x3f7a4a[_0x3cf4('0x33')]=_[_0x3cf4('0x48')](_0x228dd8[_0x3cf4('0x33')]);_0x3f7a4a[_0x3cf4('0x34')]=_['intersection'](_0x3f7a4a[_0x3cf4('0x31')],_0x3f7a4a[_0x3cf4('0x33')]);_0x499457[_0x3cf4('0x36')]=_['intersection'](_0x3f7a4a[_0x3cf4('0x31')],qs[_0x3cf4('0x37')](_0x228dd8[_0x3cf4('0x33')][_0x3cf4('0x37')]));_0x499457[_0x3cf4('0x36')]=_0x499457['attributes'][_0x3cf4('0x38')]?_0x499457['attributes']:_0x3f7a4a['model'];if(_0x228dd8[_0x3cf4('0x33')]['includeAll']){_0x499457[_0x3cf4('0x4a')]=[{'all':!![]}];}_0x499457=_[_0x3cf4('0x3f')]({},_0x499457,_0x228dd8['options']);return db['SugarcrmAccount'][_0x3cf4('0x4b')](_0x499457)[_0x3cf4('0x26')](handleEntityNotFound(_0x414f89,null))['then'](respondWithResult(_0x414f89,null))[_0x3cf4('0x45')](handleError(_0x414f89,null));};exports[_0x3cf4('0x4c')]=function(_0x53d246,_0x5541d2){return db[_0x3cf4('0x2d')][_0x3cf4('0x4c')](_0x53d246[_0x3cf4('0x4d')],{})[_0x3cf4('0x26')](respondWithResult(_0x5541d2,0xc9))[_0x3cf4('0x45')](handleError(_0x5541d2,null));};exports['update']=function(_0x1d9cb1,_0x3abfca){if(_0x1d9cb1['body']['id']){delete _0x1d9cb1['body']['id'];}return db[_0x3cf4('0x2d')][_0x3cf4('0x4b')]({'where':{'id':_0x1d9cb1['params']['id']}})[_0x3cf4('0x26')](handleEntityNotFound(_0x3abfca,null))['then'](saveUpdates(_0x1d9cb1[_0x3cf4('0x4d')],null))[_0x3cf4('0x26')](respondWithResult(_0x3abfca,null))[_0x3cf4('0x45')](handleError(_0x3abfca,null));};exports[_0x3cf4('0x27')]=function(_0x366b5b,_0x5c8e4d){return db[_0x3cf4('0x2d')][_0x3cf4('0x4b')]({'where':{'id':_0x366b5b[_0x3cf4('0x47')]['id']}})[_0x3cf4('0x26')](handleEntityNotFound(_0x5c8e4d,null))[_0x3cf4('0x26')](removeEntity(_0x5c8e4d,null))[_0x3cf4('0x45')](handleError(_0x5c8e4d,null));};exports[_0x3cf4('0x4e')]=function(_0x58320d,_0x4b2804,_0x5823ac){var _0x2a6f8f={};var _0x1ab754={};var _0x10ec9f;var _0x395510;return db[_0x3cf4('0x2d')]['findOne']({'where':{'id':_0x58320d[_0x3cf4('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b2804,null))[_0x3cf4('0x26')](function(_0x5f59a7){if(_0x5f59a7){_0x10ec9f=_0x5f59a7;_0x1ab754['model']=_[_0x3cf4('0x48')](db[_0x3cf4('0x4f')][_0x3cf4('0x49')]);_0x1ab754[_0x3cf4('0x33')]=_[_0x3cf4('0x48')](_0x58320d['query']);_0x1ab754[_0x3cf4('0x34')]=_[_0x3cf4('0x35')](_0x1ab754[_0x3cf4('0x31')],_0x1ab754['query']);_0x2a6f8f[_0x3cf4('0x36')]=_[_0x3cf4('0x35')](_0x1ab754[_0x3cf4('0x31')],qs[_0x3cf4('0x37')](_0x58320d[_0x3cf4('0x33')][_0x3cf4('0x37')]));_0x2a6f8f['attributes']=_0x2a6f8f[_0x3cf4('0x36')][_0x3cf4('0x38')]?_0x2a6f8f[_0x3cf4('0x36')]:_0x1ab754['model'];_0x2a6f8f[_0x3cf4('0x3b')]=qs[_0x3cf4('0x3c')](_0x58320d['query'][_0x3cf4('0x3c')]);_0x2a6f8f[_0x3cf4('0x3d')]=qs[_0x3cf4('0x34')](_[_0x3cf4('0x3e')](_0x58320d[_0x3cf4('0x33')],_0x1ab754[_0x3cf4('0x34')]));if(_0x58320d[_0x3cf4('0x33')][_0x3cf4('0x41')]){_0x2a6f8f[_0x3cf4('0x3d')]=_[_0x3cf4('0x3f')](_0x2a6f8f[_0x3cf4('0x3d')],{'$or':_['map'](_0x2a6f8f['attributes'],function(_0xc311d8){var _0x54cfd6={};_0x54cfd6[_0xc311d8]={'$like':'%'+_0x58320d[_0x3cf4('0x33')][_0x3cf4('0x41')]+'%'};return _0x54cfd6;})});}_0x2a6f8f=_['merge']({},_0x2a6f8f,_0x58320d['options']);return _0x10ec9f[_0x3cf4('0x4e')](_0x2a6f8f);}})[_0x3cf4('0x26')](function(_0x3f1588){if(_0x3f1588){_0x395510=_0x3f1588[_0x3cf4('0x38')];if(!_0x58320d[_0x3cf4('0x33')][_0x3cf4('0x39')](_0x3cf4('0x3a'))){_0x2a6f8f[_0x3cf4('0x1e')]=qs[_0x3cf4('0x1e')](_0x58320d[_0x3cf4('0x33')]['limit']);_0x2a6f8f[_0x3cf4('0x1c')]=qs[_0x3cf4('0x1c')](_0x58320d['query'][_0x3cf4('0x1c')]);}return _0x10ec9f['getConfigurations'](_0x2a6f8f);}})[_0x3cf4('0x26')](function(_0x22f6ff){if(_0x22f6ff){return _0x22f6ff?{'count':_0x395510,'rows':_0x22f6ff}:null;}})['then'](respondWithResult(_0x4b2804,null))[_0x3cf4('0x45')](handleError(_0x4b2804,null));};exports[_0x3cf4('0x50')]=function(_0x500679,_0xbf7f26,_0x283612){if(_0x500679[_0x3cf4('0x4d')]['id']){delete _0x500679['body']['id'];}return db[_0x3cf4('0x2d')]['findOne']({'where':{'id':_0x500679[_0x3cf4('0x47')]['id']}})['then'](handleEntityNotFound(_0xbf7f26,null))[_0x3cf4('0x26')](function(_0x3538d3){if(_0x3538d3){_0x500679['body'][_0x3cf4('0x51')]=_0x3538d3['id'];_0x500679[_0x3cf4('0x4d')][_0x3cf4('0x52')]=integrations[_0x3cf4('0x53')](_0x500679[_0x3cf4('0x4d')]['channel'],_0x500679[_0x3cf4('0x4d')][_0x3cf4('0x2f')]);_0x500679['body'][_0x3cf4('0x54')]=integrations[_0x3cf4('0x55')](_0x500679[_0x3cf4('0x4d')][_0x3cf4('0x56')],_0x500679['body'][_0x3cf4('0x2f')]);return db[_0x3cf4('0x4f')][_0x3cf4('0x4c')](_0x500679[_0x3cf4('0x4d')],{'include':[{'model':db[_0x3cf4('0x57')],'as':_0x3cf4('0x52')},{'model':db[_0x3cf4('0x57')],'as':'Descriptions'}]});}return null;})[_0x3cf4('0x26')](respondWithResult(_0xbf7f26,null))[_0x3cf4('0x45')](handleError(_0xbf7f26,null));};exports[_0x3cf4('0x58')]=function(_0x30e759,_0x654eb0,_0x5486b4){var _0x533e28='';var _0x3408cb=['id','name',_0x3cf4('0x59'),_0x3cf4('0x5a'),'description',_0x3cf4('0x5b'),'duration_hours','duration_minutes',_0x3cf4('0x5c'),_0x3cf4('0x5d'),_0x3cf4('0x5e'),_0x3cf4('0x5f')];return db[_0x3cf4('0x2d')][_0x3cf4('0x60')]({'where':{'id':_0x30e759[_0x3cf4('0x47')]['id']},'attributes':['id',_0x3cf4('0x61'),'password',_0x3cf4('0x62')]})['then'](handleEntityNotFound(_0x654eb0,null))[_0x3cf4('0x26')](function(_0x203882){if(_0x203882){_0x533e28=_0x203882['remoteUri'];var _0x1eec53=_0x533e28[_0x3cf4('0x63')](-0x1);if(_0x1eec53==='/'){_0x533e28=_0x533e28['substring'](0x0,_0x533e28[_0x3cf4('0x64')](_0x1eec53));}return rp({'method':'POST','uri':util['format'](_0x3cf4('0x65'),_0x533e28,_0x3cf4('0x66')),'json':!![],'form':{'method':_0x3cf4('0x67'),'input_type':_0x3cf4('0x68'),'response_type':_0x3cf4('0x68'),'rest_data':JSON[_0x3cf4('0x69')]({'user_auth':{'user_name':_0x203882[_0x3cf4('0x61')],'password':_0x203882[_0x3cf4('0x6a')],'encryption':_0x3cf4('0x6b')},'application':_0x3cf4('0x6c')})}});}})[_0x3cf4('0x26')](function(_0x579d9e){if(_0x579d9e&&_0x579d9e[_0x3cf4('0x2a')]!==_0x3cf4('0x6d')&&_0x579d9e[_0x3cf4('0x2a')]!==_0x3cf4('0x6e')){return rp({'method':_0x3cf4('0x6f'),'uri':util[_0x3cf4('0x70')](_0x3cf4('0x65'),_0x533e28,_0x3cf4('0x66')),'json':!![],'form':{'method':_0x3cf4('0x71'),'input_type':_0x3cf4('0x68'),'response_type':_0x3cf4('0x68'),'rest_data':JSON[_0x3cf4('0x69')]({'session':_0x579d9e['id'],'module_name':_0x3cf4('0x72')})}})[_0x3cf4('0x26')](function(_0x54cda9){if(_0x54cda9){var _0x55a0e8=_[_0x3cf4('0x73')](_0x54cda9[_0x3cf4('0x74')]);_[_0x3cf4('0x75')](_0x55a0e8,function(_0x231105){return _0x3408cb[_0x3cf4('0x76')](_0x231105[_0x3cf4('0x2a')]);});return{'count':_0x55a0e8[_0x3cf4('0x38')],'rows':_[_0x3cf4('0x32')](_0x55a0e8,function(_0x523cb1){return{'id':_0x523cb1[_0x3cf4('0x2a')],'name':_0x523cb1['label'],'custom':_[_0x3cf4('0x77')](_0x523cb1['name'],'_c')?!![]:![],'options':_0x523cb1[_0x3cf4('0x42')]?_[_0x3cf4('0x32')](_[_0x3cf4('0x73')](_0x523cb1[_0x3cf4('0x42')]),function(_0xa80fee){return{'name':_0xa80fee[_0x3cf4('0x78')],'value':_0xa80fee[_0x3cf4('0x2a')]};}):[]};})};}})['then'](respondWithResult(_0x654eb0,null))['catch'](function(_0x7baf4c){var _0x39b73c=_0x30e759[_0x3cf4('0x33')][_0x3cf4('0x79')]?0x1f4:_0x7baf4c['statusCode']||0x1f4;logger[_0x3cf4('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x39b73c,JSON[_0x3cf4('0x69')](_0x7baf4c));delete _0x7baf4c[_0x3cf4('0x2a')];if(_0x39b73c===0x191){_0x39b73c=0x190;}_0x654eb0[_0x3cf4('0x19')](_0x39b73c)[_0x3cf4('0x2b')](_0x30e759[_0x3cf4('0x33')][_0x3cf4('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x7baf4c[_0x3cf4('0x7a')]}:_0x7baf4c);});}else{var _0x32f8a7=0x1f4;_0x654eb0[_0x3cf4('0x19')](_0x32f8a7)[_0x3cf4('0x2b')]({'message':_0x3cf4('0x7b'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x9efa=['stack','send','rawAttributes','fieldName','key','model','map','name','query','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','merge','SugarcrmAccount','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','getConfigurations','SugarcrmConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','findOne','username','password','remoteUri','slice','substring','lastIndexOf','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','options','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../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','then','destroy','error'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9efa,0x1d4));var _0xa9ef=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9efa[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xa9ef('0x0'));var rimraf=require(_0xa9ef('0x1'));var zipdir=require(_0xa9ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa9ef('0x4'));var util=require(_0xa9ef('0x5'));var path=require(_0xa9ef('0x6'));var sox=require(_0xa9ef('0x7'));var csv=require('to-csv');var ejs=require(_0xa9ef('0x8'));var fs=require('fs');var fs_extra=require(_0xa9ef('0x9'));var _=require(_0xa9ef('0xa'));var squel=require(_0xa9ef('0xb'));var crypto=require(_0xa9ef('0xc'));var jsforce=require(_0xa9ef('0xd'));var deskjs=require(_0xa9ef('0xe'));var toCsv=require(_0xa9ef('0xf'));var querystring=require(_0xa9ef('0x10'));var Papa=require(_0xa9ef('0x11'));var Redis=require(_0xa9ef('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa9ef('0x13'));var as=require(_0xa9ef('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ef('0x15'))(_0xa9ef('0x16'));var utils=require(_0xa9ef('0x17'));var config=require(_0xa9ef('0x18'));var licenseUtil=require(_0xa9ef('0x19'));var db=require(_0xa9ef('0x1a'))['db'];var integrations=require(_0xa9ef('0x1b'));function respondWithStatusCode(_0x58a7af,_0x14570a){_0x14570a=_0x14570a||0xcc;return function(_0x5e447d){if(_0x5e447d){return _0x58a7af[_0xa9ef('0x1c')](_0x14570a);}return _0x58a7af['status'](_0x14570a)[_0xa9ef('0x1d')]();};}function respondWithResult(_0xbf6d27,_0x42a44a){_0x42a44a=_0x42a44a||0xc8;return function(_0x453e46){if(_0x453e46){return _0xbf6d27[_0xa9ef('0x1e')](_0x42a44a)[_0xa9ef('0x1f')](_0x453e46);}};}function respondWithFilteredResult(_0x5a874b,_0x388054){return function(_0x32349b){if(_0x32349b){var _0x306ffb=typeof _0x388054[_0xa9ef('0x20')]===_0xa9ef('0x21')&&typeof _0x388054[_0xa9ef('0x22')]===_0xa9ef('0x21');var _0xb55eb=_0x32349b[_0xa9ef('0x23')];var _0x5a525f=_0x306ffb?0x0:_0x388054['offset'];var _0x11b7f3=_0x306ffb?_0x32349b[_0xa9ef('0x23')]:_0x388054['offset']+_0x388054[_0xa9ef('0x22')];var _0x45a850;if(_0x11b7f3>=_0xb55eb){_0x11b7f3=_0xb55eb;_0x45a850=0xc8;}else{_0x45a850=0xce;}_0x5a874b[_0xa9ef('0x1e')](_0x45a850);return _0x5a874b['set'](_0xa9ef('0x24'),_0x5a525f+'-'+_0x11b7f3+'/'+_0xb55eb)[_0xa9ef('0x1f')](_0x32349b);}return null;};}function patchUpdates(_0x6b4328){return function(_0x469b57){try{jsonpatch[_0xa9ef('0x25')](_0x469b57,_0x6b4328,!![]);}catch(_0x37fba0){return BPromise[_0xa9ef('0x26')](_0x37fba0);}return _0x469b57[_0xa9ef('0x27')]();};}function saveUpdates(_0x1f5343,_0x27f010){return function(_0x2f0faf){if(_0x2f0faf){return _0x2f0faf[_0xa9ef('0x28')](_0x1f5343)[_0xa9ef('0x29')](function(_0x45f7d7){return _0x45f7d7;});}return null;};}function removeEntity(_0x33e33b,_0x2c4d4c){return function(_0x55c3fc){if(_0x55c3fc){return _0x55c3fc[_0xa9ef('0x2a')]()[_0xa9ef('0x29')](function(){_0x33e33b[_0xa9ef('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x174cca,_0x5609a1){return function(_0x1c07cf){if(!_0x1c07cf){_0x174cca[_0xa9ef('0x1c')](0x194);}return _0x1c07cf;};}function handleError(_0x2da83a,_0x40c68d){_0x40c68d=_0x40c68d||0x1f4;return function(_0x4c15e7){logger[_0xa9ef('0x2b')](_0x4c15e7[_0xa9ef('0x2c')]);if(_0x4c15e7['name']){delete _0x4c15e7['name'];}_0x2da83a[_0xa9ef('0x1e')](_0x40c68d)[_0xa9ef('0x2d')](_0x4c15e7);};}exports['index']=function(_0x517824,_0x46fcee){var _0x5bf222={},_0x478a2b={},_0x1dcd8e={'count':0x0,'rows':[]};var _0x167268=_['map'](db['SugarcrmAccount'][_0xa9ef('0x2e')],function(_0x55cb78){return{'name':_0x55cb78[_0xa9ef('0x2f')],'type':_0x55cb78['type'][_0xa9ef('0x30')]};});_0x478a2b[_0xa9ef('0x31')]=_[_0xa9ef('0x32')](_0x167268,_0xa9ef('0x33'));_0x478a2b[_0xa9ef('0x34')]=_['keys'](_0x517824['query']);_0x478a2b['filters']=_['intersection'](_0x478a2b['model'],_0x478a2b['query']);_0x5bf222[_0xa9ef('0x35')]=_[_0xa9ef('0x36')](_0x478a2b['model'],qs[_0xa9ef('0x37')](_0x517824[_0xa9ef('0x34')][_0xa9ef('0x37')]));_0x5bf222[_0xa9ef('0x35')]=_0x5bf222[_0xa9ef('0x35')]['length']?_0x5bf222[_0xa9ef('0x35')]:_0x478a2b[_0xa9ef('0x31')];if(!_0x517824[_0xa9ef('0x34')][_0xa9ef('0x38')]('nolimit')){_0x5bf222['limit']=qs['limit'](_0x517824[_0xa9ef('0x34')][_0xa9ef('0x22')]);_0x5bf222['offset']=qs['offset'](_0x517824[_0xa9ef('0x34')][_0xa9ef('0x20')]);}_0x5bf222['order']=qs['sort'](_0x517824[_0xa9ef('0x34')][_0xa9ef('0x39')]);_0x5bf222[_0xa9ef('0x3a')]=qs[_0xa9ef('0x3b')](_[_0xa9ef('0x3c')](_0x517824['query'],_0x478a2b[_0xa9ef('0x3b')]),_0x167268);if(_0x517824[_0xa9ef('0x34')][_0xa9ef('0x3d')]){_0x5bf222[_0xa9ef('0x3a')]=_['merge'](_0x5bf222[_0xa9ef('0x3a')],{'$or':_['map'](_0x167268,function(_0x207a17){if(_0x207a17[_0xa9ef('0x3e')]!==_0xa9ef('0x3f')){var _0x4f45e2={};_0x4f45e2[_0x207a17[_0xa9ef('0x33')]]={'$like':'%'+_0x517824[_0xa9ef('0x34')][_0xa9ef('0x3d')]+'%'};return _0x4f45e2;}})});}_0x5bf222=_[_0xa9ef('0x40')]({},_0x5bf222,_0x517824['options']);var _0x32d332={'where':_0x5bf222['where']};return db[_0xa9ef('0x41')][_0xa9ef('0x23')](_0x32d332)[_0xa9ef('0x29')](function(_0x3bd5d9){_0x1dcd8e[_0xa9ef('0x23')]=_0x3bd5d9;if(_0x517824[_0xa9ef('0x34')][_0xa9ef('0x42')]){_0x5bf222[_0xa9ef('0x43')]=[{'all':!![]}];}return db[_0xa9ef('0x41')][_0xa9ef('0x44')](_0x5bf222);})[_0xa9ef('0x29')](function(_0x6b1a8f){_0x1dcd8e[_0xa9ef('0x45')]=_0x6b1a8f;return _0x1dcd8e;})[_0xa9ef('0x29')](respondWithFilteredResult(_0x46fcee,_0x5bf222))['catch'](handleError(_0x46fcee,null));};exports[_0xa9ef('0x46')]=function(_0x5f0ffd,_0x34e022){var _0x32d858={'raw':![],'where':{'id':_0x5f0ffd[_0xa9ef('0x47')]['id']}},_0x219234={};_0x219234['model']=_[_0xa9ef('0x48')](db[_0xa9ef('0x41')][_0xa9ef('0x2e')]);_0x219234[_0xa9ef('0x34')]=_[_0xa9ef('0x48')](_0x5f0ffd['query']);_0x219234['filters']=_[_0xa9ef('0x36')](_0x219234[_0xa9ef('0x31')],_0x219234[_0xa9ef('0x34')]);_0x32d858[_0xa9ef('0x35')]=_[_0xa9ef('0x36')](_0x219234['model'],qs['fields'](_0x5f0ffd[_0xa9ef('0x34')][_0xa9ef('0x37')]));_0x32d858[_0xa9ef('0x35')]=_0x32d858['attributes'][_0xa9ef('0x49')]?_0x32d858[_0xa9ef('0x35')]:_0x219234[_0xa9ef('0x31')];if(_0x5f0ffd[_0xa9ef('0x34')][_0xa9ef('0x42')]){_0x32d858[_0xa9ef('0x43')]=[{'all':!![]}];}_0x32d858=_[_0xa9ef('0x40')]({},_0x32d858,_0x5f0ffd['options']);return db[_0xa9ef('0x41')][_0xa9ef('0x4a')](_0x32d858)[_0xa9ef('0x29')](handleEntityNotFound(_0x34e022,null))[_0xa9ef('0x29')](respondWithResult(_0x34e022,null))[_0xa9ef('0x4b')](handleError(_0x34e022,null));};exports[_0xa9ef('0x4c')]=function(_0x15818c,_0x569e13){return db[_0xa9ef('0x41')][_0xa9ef('0x4c')](_0x15818c['body'],{})['then'](respondWithResult(_0x569e13,0xc9))['catch'](handleError(_0x569e13,null));};exports[_0xa9ef('0x28')]=function(_0x1d4f58,_0x4996bf){if(_0x1d4f58['body']['id']){delete _0x1d4f58[_0xa9ef('0x4d')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x1d4f58['params']['id']}})[_0xa9ef('0x29')](handleEntityNotFound(_0x4996bf,null))[_0xa9ef('0x29')](saveUpdates(_0x1d4f58[_0xa9ef('0x4d')],null))[_0xa9ef('0x29')](respondWithResult(_0x4996bf,null))[_0xa9ef('0x4b')](handleError(_0x4996bf,null));};exports[_0xa9ef('0x2a')]=function(_0x2c6b31,_0x923d80){return db[_0xa9ef('0x41')][_0xa9ef('0x4a')]({'where':{'id':_0x2c6b31[_0xa9ef('0x47')]['id']}})[_0xa9ef('0x29')](handleEntityNotFound(_0x923d80,null))['then'](removeEntity(_0x923d80,null))[_0xa9ef('0x4b')](handleError(_0x923d80,null));};exports[_0xa9ef('0x4e')]=function(_0x5b1c4a,_0x2bf91b,_0x2baf7a){var _0xec301b={};var _0x1b17b0={};var _0x4afd63;var _0x85cfdd;return db[_0xa9ef('0x41')]['findOne']({'where':{'id':_0x5b1c4a[_0xa9ef('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bf91b,null))[_0xa9ef('0x29')](function(_0x3e7654){if(_0x3e7654){_0x4afd63=_0x3e7654;_0x1b17b0[_0xa9ef('0x31')]=_[_0xa9ef('0x48')](db[_0xa9ef('0x4f')]['rawAttributes']);_0x1b17b0['query']=_[_0xa9ef('0x48')](_0x5b1c4a[_0xa9ef('0x34')]);_0x1b17b0['filters']=_['intersection'](_0x1b17b0[_0xa9ef('0x31')],_0x1b17b0['query']);_0xec301b[_0xa9ef('0x35')]=_[_0xa9ef('0x36')](_0x1b17b0[_0xa9ef('0x31')],qs[_0xa9ef('0x37')](_0x5b1c4a[_0xa9ef('0x34')]['fields']));_0xec301b[_0xa9ef('0x35')]=_0xec301b[_0xa9ef('0x35')]['length']?_0xec301b[_0xa9ef('0x35')]:_0x1b17b0[_0xa9ef('0x31')];_0xec301b[_0xa9ef('0x50')]=qs[_0xa9ef('0x39')](_0x5b1c4a[_0xa9ef('0x34')][_0xa9ef('0x39')]);_0xec301b[_0xa9ef('0x3a')]=qs[_0xa9ef('0x3b')](_[_0xa9ef('0x3c')](_0x5b1c4a[_0xa9ef('0x34')],_0x1b17b0[_0xa9ef('0x3b')]));if(_0x5b1c4a[_0xa9ef('0x34')]['filter']){_0xec301b[_0xa9ef('0x3a')]=_[_0xa9ef('0x40')](_0xec301b['where'],{'$or':_[_0xa9ef('0x32')](_0xec301b[_0xa9ef('0x35')],function(_0x4b3a8e){var _0x5c9284={};_0x5c9284[_0x4b3a8e]={'$like':'%'+_0x5b1c4a[_0xa9ef('0x34')][_0xa9ef('0x3d')]+'%'};return _0x5c9284;})});}_0xec301b=_[_0xa9ef('0x40')]({},_0xec301b,_0x5b1c4a['options']);return _0x4afd63['getConfigurations'](_0xec301b);}})[_0xa9ef('0x29')](function(_0x4e8d87){if(_0x4e8d87){_0x85cfdd=_0x4e8d87[_0xa9ef('0x49')];if(!_0x5b1c4a['query'][_0xa9ef('0x38')](_0xa9ef('0x51'))){_0xec301b['limit']=qs[_0xa9ef('0x22')](_0x5b1c4a[_0xa9ef('0x34')][_0xa9ef('0x22')]);_0xec301b['offset']=qs[_0xa9ef('0x20')](_0x5b1c4a[_0xa9ef('0x34')][_0xa9ef('0x20')]);}return _0x4afd63[_0xa9ef('0x4e')](_0xec301b);}})[_0xa9ef('0x29')](function(_0x327d0e){if(_0x327d0e){return _0x327d0e?{'count':_0x85cfdd,'rows':_0x327d0e}:null;}})[_0xa9ef('0x29')](respondWithResult(_0x2bf91b,null))[_0xa9ef('0x4b')](handleError(_0x2bf91b,null));};exports[_0xa9ef('0x52')]=function(_0x9a0357,_0x383675,_0x4d632a){if(_0x9a0357[_0xa9ef('0x4d')]['id']){delete _0x9a0357[_0xa9ef('0x4d')]['id'];}return db[_0xa9ef('0x41')]['findOne']({'where':{'id':_0x9a0357['params']['id']}})[_0xa9ef('0x29')](handleEntityNotFound(_0x383675,null))['then'](function(_0x515c25){if(_0x515c25){_0x9a0357[_0xa9ef('0x4d')][_0xa9ef('0x53')]=_0x515c25['id'];_0x9a0357['body'][_0xa9ef('0x54')]=integrations['getSubjects'](_0x9a0357[_0xa9ef('0x4d')][_0xa9ef('0x55')],_0x9a0357[_0xa9ef('0x4d')]['type']);_0x9a0357['body'][_0xa9ef('0x56')]=integrations[_0xa9ef('0x57')](_0x9a0357[_0xa9ef('0x4d')]['channel'],_0x9a0357[_0xa9ef('0x4d')][_0xa9ef('0x3e')]);return db['SugarcrmConfiguration']['create'](_0x9a0357['body'],{'include':[{'model':db[_0xa9ef('0x58')],'as':_0xa9ef('0x54')},{'model':db['SugarcrmField'],'as':_0xa9ef('0x56')}]});}return null;})[_0xa9ef('0x29')](respondWithResult(_0x383675,null))[_0xa9ef('0x4b')](handleError(_0x383675,null));};exports[_0xa9ef('0x59')]=function(_0x1dec8e,_0x457e4e,_0x299680){var _0x516fd6='';var _0x43e8e6=['id',_0xa9ef('0x33'),_0xa9ef('0x5a'),_0xa9ef('0x5b'),_0xa9ef('0x5c'),_0xa9ef('0x5d'),'duration_hours',_0xa9ef('0x5e'),_0xa9ef('0x5f'),'parent_type',_0xa9ef('0x60'),'direction'];return db[_0xa9ef('0x41')][_0xa9ef('0x61')]({'where':{'id':_0x1dec8e[_0xa9ef('0x47')]['id']},'attributes':['id',_0xa9ef('0x62'),_0xa9ef('0x63'),_0xa9ef('0x64')]})[_0xa9ef('0x29')](handleEntityNotFound(_0x457e4e,null))[_0xa9ef('0x29')](function(_0x2534ad){if(_0x2534ad){_0x516fd6=_0x2534ad[_0xa9ef('0x64')];var _0x55b5f8=_0x516fd6[_0xa9ef('0x65')](-0x1);if(_0x55b5f8==='/'){_0x516fd6=_0x516fd6[_0xa9ef('0x66')](0x0,_0x516fd6[_0xa9ef('0x67')](_0x55b5f8));}return rp({'method':'POST','uri':util['format']('%s%s',_0x516fd6,_0xa9ef('0x68')),'json':!![],'form':{'method':_0xa9ef('0x69'),'input_type':_0xa9ef('0x6a'),'response_type':_0xa9ef('0x6a'),'rest_data':JSON[_0xa9ef('0x6b')]({'user_auth':{'user_name':_0x2534ad[_0xa9ef('0x62')],'password':_0x2534ad['password'],'encryption':_0xa9ef('0x6c')},'application':_0xa9ef('0x6d')})}});}})['then'](function(_0x1f465e){if(_0x1f465e&&_0x1f465e[_0xa9ef('0x33')]!==_0xa9ef('0x6e')&&_0x1f465e[_0xa9ef('0x33')]!==_0xa9ef('0x6f')){return rp({'method':'POST','uri':util[_0xa9ef('0x70')](_0xa9ef('0x71'),_0x516fd6,_0xa9ef('0x68')),'json':!![],'form':{'method':_0xa9ef('0x72'),'input_type':_0xa9ef('0x6a'),'response_type':_0xa9ef('0x6a'),'rest_data':JSON[_0xa9ef('0x6b')]({'session':_0x1f465e['id'],'module_name':_0xa9ef('0x73')})}})['then'](function(_0x420cd7){if(_0x420cd7){var _0x56dcb3=_[_0xa9ef('0x74')](_0x420cd7[_0xa9ef('0x75')]);_[_0xa9ef('0x76')](_0x56dcb3,function(_0x1ebbae){return _0x43e8e6[_0xa9ef('0x77')](_0x1ebbae[_0xa9ef('0x33')]);});return{'count':_0x56dcb3[_0xa9ef('0x49')],'rows':_['map'](_0x56dcb3,function(_0x18e944){return{'id':_0x18e944[_0xa9ef('0x33')],'name':_0x18e944[_0xa9ef('0x78')],'custom':_[_0xa9ef('0x79')](_0x18e944[_0xa9ef('0x33')],'_c')?!![]:![],'options':_0x18e944['options']?_[_0xa9ef('0x32')](_[_0xa9ef('0x74')](_0x18e944[_0xa9ef('0x7a')]),function(_0x988104){return{'name':_0x988104[_0xa9ef('0x7b')],'value':_0x988104[_0xa9ef('0x33')]};}):[]};})};}})['then'](respondWithResult(_0x457e4e,null))[_0xa9ef('0x4b')](function(_0x550d78){var _0x7a9a3a=_0x1dec8e['query'][_0xa9ef('0x7c')]?0x1f4:_0x550d78[_0xa9ef('0x7d')]||0x1f4;logger[_0xa9ef('0x2b')](_0xa9ef('0x7e'),'getFields',_0x7a9a3a,JSON[_0xa9ef('0x6b')](_0x550d78));delete _0x550d78[_0xa9ef('0x33')];if(_0x7a9a3a===0x191){_0x7a9a3a=0x190;}_0x457e4e['status'](_0x7a9a3a)[_0xa9ef('0x2d')](_0x1dec8e[_0xa9ef('0x34')][_0xa9ef('0x7c')]?{'message':_0xa9ef('0x7f'),'statusCode':_0x550d78[_0xa9ef('0x7d')]}:_0x550d78);});}else{var _0x348b7b=0x1f4;_0x457e4e['status'](_0x348b7b)[_0xa9ef('0x2d')]({'message':_0xa9ef('0x7f'),'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 2066dbc..f03453d 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 _0x41f6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash'];(function(_0x3583e8,_0x462970){var _0x12c1ee=function(_0x5b52f1){while(--_0x5b52f1){_0x3583e8['push'](_0x3583e8['shift']());}};_0x12c1ee(++_0x462970);}(_0x41f6,0x8e));var _0x641f=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0x41f6[_0x274638];return _0x5755df;};'use strict';var _=require(_0x641f('0x0'));var util=require('util');var logger=require(_0x641f('0x1'))(_0x641f('0x2'));var moment=require(_0x641f('0x3'));var BPromise=require(_0x641f('0x4'));var rp=require(_0x641f('0x5'));var fs=require('fs');var path=require(_0x641f('0x6'));var rimraf=require(_0x641f('0x7'));var config=require(_0x641f('0x8'));var attributes=require(_0x641f('0x9'));var integrations=require(_0x641f('0xa'));module[_0x641f('0xb')]=function(_0x4e604d,_0x118c00){return _0x4e604d['define']('SugarcrmAccount',attributes,{'tableName':_0x641f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaca0=['exports','define','SugarcrmAccount','util','../../config/logger','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x1f1b99,_0x37688c){var _0x4f1992=function(_0xdb81d2){while(--_0xdb81d2){_0x1f1b99['push'](_0x1f1b99['shift']());}};_0x4f1992(++_0x37688c);}(_0xaca0,0xd2));var _0x0aca=function(_0x9478d,_0xc51216){_0x9478d=_0x9478d-0x0;var _0x354bed=_0xaca0[_0x9478d];return _0x354bed;};'use strict';var _=require('lodash');var util=require(_0x0aca('0x0'));var logger=require(_0x0aca('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0aca('0x2'));var rimraf=require('rimraf');var config=require(_0x0aca('0x3'));var attributes=require(_0x0aca('0x4'));var integrations=require(_0x0aca('0x5'));module[_0x0aca('0x6')]=function(_0x460470,_0x4b8388){return _0x460470[_0x0aca('0x7')](_0x0aca('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 76d40a9..d79b093 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 _0x5466=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','include','map','attributes','model','debug','ShowSugarcrmAccount'];(function(_0x10c648,_0x5b6990){var _0x223cca=function(_0x118000){while(--_0x118000){_0x10c648['push'](_0x10c648['shift']());}};_0x223cca(++_0x5b6990);}(_0x5466,0x110));var _0x6546=function(_0x406c5c,_0x169f24){_0x406c5c=_0x406c5c-0x0;var _0x3d7057=_0x5466[_0x406c5c];return _0x3d7057;};'use strict';var _=require(_0x6546('0x0'));var util=require('util');var moment=require(_0x6546('0x1'));var BPromise=require(_0x6546('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6546('0x3'));var db=require(_0x6546('0x4'))['db'];var utils=require(_0x6546('0x5'));var logger=require(_0x6546('0x6'))(_0x6546('0x7'));var config=require(_0x6546('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6546('0x9')][_0x6546('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f8650,_0x1e31ef,_0x4f845e){return new BPromise(function(_0x316f91,_0x49876f){return client[_0x6546('0xb')](_0x9f8650,_0x4f845e)[_0x6546('0xc')](function(_0x4a9453){logger['info'](_0x6546('0xd'),_0x1e31ef,_0x6546('0xe'));logger['debug'](_0x6546('0xf'),_0x1e31ef,_0x6546('0xe'),JSON[_0x6546('0x10')](_0x4a9453));if(_0x4a9453[_0x6546('0x11')]){if(_0x4a9453['error'][_0x6546('0x12')]===0x1f4){logger[_0x6546('0x11')](_0x6546('0xd'),_0x1e31ef,_0x4a9453['error'][_0x6546('0x13')]);return _0x49876f(_0x4a9453['error']['message']);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1e31ef,_0x4a9453[_0x6546('0x11')]['message']);return _0x316f91(_0x4a9453['error'][_0x6546('0x13')]);}else{logger[_0x6546('0x14')](_0x6546('0xd'),_0x1e31ef,_0x6546('0xe'));_0x316f91(_0x4a9453[_0x6546('0x15')][_0x6546('0x13')]);}})[_0x6546('0x16')](function(_0x52a392){logger[_0x6546('0x11')](_0x6546('0xd'),_0x1e31ef,_0x52a392);_0x49876f(_0x52a392);});});}exports[_0x6546('0x17')]=function(_0x49a796){var _0x480f65=this;return new Promise(function(_0x987e34,_0x441452){return db[_0x6546('0x18')][_0x6546('0x19')]({'raw':_0x49a796[_0x6546('0x1a')]?_0x49a796[_0x6546('0x1a')][_0x6546('0x1b')]===undefined?!![]:![]:!![],'where':_0x49a796['options']?_0x49a796[_0x6546('0x1a')]['where']||null:null,'attributes':_0x49a796[_0x6546('0x1a')]?_0x49a796[_0x6546('0x1a')]['attributes']||null:null,'limit':_0x49a796[_0x6546('0x1a')]?_0x49a796[_0x6546('0x1a')]['limit']||null:null,'include':_0x49a796[_0x6546('0x1a')]?_0x49a796[_0x6546('0x1a')][_0x6546('0x1c')]?_[_0x6546('0x1d')](_0x49a796[_0x6546('0x1a')]['include'],function(_0x38460b){return{'model':db[_0x38460b['model']],'as':_0x38460b['as'],'attributes':_0x38460b[_0x6546('0x1e')],'include':_0x38460b[_0x6546('0x1c')]?_['map'](_0x38460b[_0x6546('0x1c')],function(_0x4208bf){return{'model':db[_0x4208bf[_0x6546('0x1f')]],'as':_0x4208bf['as'],'attributes':_0x4208bf['attributes'],'include':_0x4208bf['include']?_[_0x6546('0x1d')](_0x4208bf[_0x6546('0x1c')],function(_0x15d81e){return{'model':db[_0x15d81e['model']],'as':_0x15d81e['as'],'attributes':_0x15d81e[_0x6546('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1521a1){logger['info'](_0x6546('0x17'),_0x49a796);logger[_0x6546('0x20')](_0x6546('0x17'),_0x49a796,JSON['stringify'](_0x1521a1));_0x987e34(_0x1521a1);})[_0x6546('0x16')](function(_0x30ca83){logger[_0x6546('0x11')](_0x6546('0x17'),_0x30ca83[_0x6546('0x13')],_0x49a796);_0x441452(_0x480f65[_0x6546('0x11')](0x1f4,_0x30ca83[_0x6546('0x13')]));});});};exports[_0x6546('0x21')]=function(_0x31dbba){var _0x237656=this;return new Promise(function(_0x38380b,_0x4c3700){return db[_0x6546('0x18')]['find']({'raw':_0x31dbba['options']?_0x31dbba[_0x6546('0x1a')][_0x6546('0x1b')]===undefined?!![]:![]:!![],'where':_0x31dbba['options']?_0x31dbba[_0x6546('0x1a')]['where']||null:null,'attributes':_0x31dbba[_0x6546('0x1a')]?_0x31dbba[_0x6546('0x1a')][_0x6546('0x1e')]||null:null,'include':_0x31dbba[_0x6546('0x1a')]?_0x31dbba[_0x6546('0x1a')][_0x6546('0x1c')]?_[_0x6546('0x1d')](_0x31dbba[_0x6546('0x1a')][_0x6546('0x1c')],function(_0x9afb2b){return{'model':db[_0x9afb2b[_0x6546('0x1f')]],'as':_0x9afb2b['as'],'attributes':_0x9afb2b[_0x6546('0x1e')],'include':_0x9afb2b[_0x6546('0x1c')]?_[_0x6546('0x1d')](_0x9afb2b[_0x6546('0x1c')],function(_0x465776){return{'model':db[_0x465776[_0x6546('0x1f')]],'as':_0x465776['as'],'attributes':_0x465776[_0x6546('0x1e')],'include':_0x465776[_0x6546('0x1c')]?_[_0x6546('0x1d')](_0x465776[_0x6546('0x1c')],function(_0x3faa8e){return{'model':db[_0x3faa8e[_0x6546('0x1f')]],'as':_0x3faa8e['as'],'attributes':_0x3faa8e[_0x6546('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6546('0xc')](function(_0x37f6e8){logger[_0x6546('0x14')]('ShowSugarcrmAccount',_0x31dbba);logger[_0x6546('0x20')](_0x6546('0x21'),_0x31dbba,JSON['stringify'](_0x37f6e8));_0x38380b(_0x37f6e8);})[_0x6546('0x16')](function(_0x5bf05d){logger['error'](_0x6546('0x21'),_0x5bf05d[_0x6546('0x13')],_0x31dbba);_0x4c3700(_0x237656['error'](0x1f4,_0x5bf05d[_0x6546('0x13')]));});});}; \ No newline at end of file +var _0x5564=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowSugarcrmAccount','stringify','moment','bluebird'];(function(_0x46e16d,_0x17f6b1){var _0x5c55ee=function(_0xd68581){while(--_0xd68581){_0x46e16d['push'](_0x46e16d['shift']());}};_0x5c55ee(++_0x17f6b1);}(_0x5564,0x6a));var _0x4556=function(_0x5493f8,_0x4f5fb8){_0x5493f8=_0x5493f8-0x0;var _0x4b15ee=_0x5564[_0x5493f8];return _0x4b15ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4556('0x0'));var BPromise=require(_0x4556('0x1'));var rs=require(_0x4556('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4556('0x3'))['db'];var utils=require(_0x4556('0x4'));var logger=require(_0x4556('0x5'))(_0x4556('0x6'));var config=require(_0x4556('0x7'));var jayson=require(_0x4556('0x8'));var client=jayson[_0x4556('0x9')][_0x4556('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30a5dc,_0x42a4d0,_0x552569){return new BPromise(function(_0x2f6e62,_0x5a816b){return client[_0x4556('0xb')](_0x30a5dc,_0x552569)[_0x4556('0xc')](function(_0xa06a18){logger['info'](_0x4556('0xd'),_0x42a4d0,_0x4556('0xe'));logger[_0x4556('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x42a4d0,'request\x20sent',JSON['stringify'](_0xa06a18));if(_0xa06a18['error']){if(_0xa06a18[_0x4556('0x10')][_0x4556('0x11')]===0x1f4){logger[_0x4556('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x42a4d0,_0xa06a18[_0x4556('0x10')][_0x4556('0x12')]);return _0x5a816b(_0xa06a18[_0x4556('0x10')][_0x4556('0x12')]);}logger[_0x4556('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x42a4d0,_0xa06a18[_0x4556('0x10')][_0x4556('0x12')]);return _0x2f6e62(_0xa06a18[_0x4556('0x10')][_0x4556('0x12')]);}else{logger[_0x4556('0x13')](_0x4556('0xd'),_0x42a4d0,_0x4556('0xe'));_0x2f6e62(_0xa06a18[_0x4556('0x14')][_0x4556('0x12')]);}})[_0x4556('0x15')](function(_0x3cac6e){logger[_0x4556('0x10')](_0x4556('0xd'),_0x42a4d0,_0x3cac6e);_0x5a816b(_0x3cac6e);});});}exports[_0x4556('0x16')]=function(_0xd75735){var _0x477945=this;return new Promise(function(_0x3397c4,_0x17ba2e){return db[_0x4556('0x17')][_0x4556('0x18')]({'raw':_0xd75735[_0x4556('0x19')]?_0xd75735[_0x4556('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd75735['options']?_0xd75735['options'][_0x4556('0x1a')]||null:null,'attributes':_0xd75735['options']?_0xd75735[_0x4556('0x19')][_0x4556('0x1b')]||null:null,'limit':_0xd75735['options']?_0xd75735['options'][_0x4556('0x1c')]||null:null,'include':_0xd75735[_0x4556('0x19')]?_0xd75735['options'][_0x4556('0x1d')]?_[_0x4556('0x1e')](_0xd75735[_0x4556('0x19')][_0x4556('0x1d')],function(_0x3f859c){return{'model':db[_0x3f859c[_0x4556('0x1f')]],'as':_0x3f859c['as'],'attributes':_0x3f859c[_0x4556('0x1b')],'include':_0x3f859c[_0x4556('0x1d')]?_[_0x4556('0x1e')](_0x3f859c[_0x4556('0x1d')],function(_0x247002){return{'model':db[_0x247002[_0x4556('0x1f')]],'as':_0x247002['as'],'attributes':_0x247002[_0x4556('0x1b')],'include':_0x247002[_0x4556('0x1d')]?_[_0x4556('0x1e')](_0x247002[_0x4556('0x1d')],function(_0x53be41){return{'model':db[_0x53be41['model']],'as':_0x53be41['as'],'attributes':_0x53be41[_0x4556('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4556('0xc')](function(_0x410c48){logger[_0x4556('0x13')]('GetSugarcrmAccount',_0xd75735);logger[_0x4556('0xf')](_0x4556('0x16'),_0xd75735,JSON['stringify'](_0x410c48));_0x3397c4(_0x410c48);})[_0x4556('0x15')](function(_0x1b1334){logger['error'](_0x4556('0x16'),_0x1b1334[_0x4556('0x12')],_0xd75735);_0x17ba2e(_0x477945[_0x4556('0x10')](0x1f4,_0x1b1334[_0x4556('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x3ab452){var _0x19b30f=this;return new Promise(function(_0x2d3847,_0x1d0948){return db['SugarcrmAccount'][_0x4556('0x20')]({'raw':_0x3ab452['options']?_0x3ab452['options'][_0x4556('0x21')]===undefined?!![]:![]:!![],'where':_0x3ab452['options']?_0x3ab452[_0x4556('0x19')][_0x4556('0x1a')]||null:null,'attributes':_0x3ab452[_0x4556('0x19')]?_0x3ab452[_0x4556('0x19')]['attributes']||null:null,'include':_0x3ab452[_0x4556('0x19')]?_0x3ab452['options'][_0x4556('0x1d')]?_[_0x4556('0x1e')](_0x3ab452['options']['include'],function(_0x29327f){return{'model':db[_0x29327f[_0x4556('0x1f')]],'as':_0x29327f['as'],'attributes':_0x29327f[_0x4556('0x1b')],'include':_0x29327f[_0x4556('0x1d')]?_[_0x4556('0x1e')](_0x29327f[_0x4556('0x1d')],function(_0x387a32){return{'model':db[_0x387a32[_0x4556('0x1f')]],'as':_0x387a32['as'],'attributes':_0x387a32[_0x4556('0x1b')],'include':_0x387a32[_0x4556('0x1d')]?_['map'](_0x387a32[_0x4556('0x1d')],function(_0xd984c9){return{'model':db[_0xd984c9[_0x4556('0x1f')]],'as':_0xd984c9['as'],'attributes':_0xd984c9[_0x4556('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4556('0xc')](function(_0x5d1159){logger['info'](_0x4556('0x22'),_0x3ab452);logger[_0x4556('0xf')](_0x4556('0x22'),_0x3ab452,JSON[_0x4556('0x23')](_0x5d1159));_0x2d3847(_0x5d1159);})[_0x4556('0x15')](function(_0x31812d){logger[_0x4556('0x10')](_0x4556('0x22'),_0x31812d[_0x4556('0x12')],_0x3ab452);_0x1d0948(_0x19b30f['error'](0x1f4,_0x31812d[_0x4556('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 7b03eb6..a3559c4 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 _0xaeca=['fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3a4feb,_0x14d3d6){var _0x8669ad=function(_0x498828){while(--_0x498828){_0x3a4feb['push'](_0x3a4feb['shift']());}};_0x8669ad(++_0x14d3d6);}(_0xaeca,0xc3));var _0xaaec=function(_0x2ea4c4,_0x1fe353){_0x2ea4c4=_0x2ea4c4-0x0;var _0x34fcb0=_0xaeca[_0x2ea4c4];return _0x34fcb0;};'use strict';var multer=require(_0xaaec('0x0'));var util=require(_0xaaec('0x1'));var path=require('path');var timeout=require(_0xaaec('0x2'));var express=require(_0xaaec('0x3'));var router=express[_0xaaec('0x4')]();var fs_extra=require(_0xaaec('0x5'));var auth=require(_0xaaec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaaec('0x7'));var controller=require(_0xaaec('0x8'));router[_0xaaec('0x9')]('/',auth[_0xaaec('0xa')](),controller[_0xaaec('0xb')]);router[_0xaaec('0x9')](_0xaaec('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xaaec('0xd'),auth[_0xaaec('0xa')](),controller[_0xaaec('0xe')]);router[_0xaaec('0x9')](_0xaaec('0xf'),auth[_0xaaec('0xa')](),controller[_0xaaec('0x10')]);router[_0xaaec('0x9')](_0xaaec('0x11'),auth[_0xaaec('0xa')](),controller['getDescriptions']);router[_0xaaec('0x12')]('/',auth[_0xaaec('0xa')](),controller[_0xaaec('0x13')]);router[_0xaaec('0x14')](_0xaaec('0xc'),auth[_0xaaec('0xa')](),controller[_0xaaec('0x15')]);router[_0xaaec('0x16')]('/:id',auth[_0xaaec('0xa')](),controller[_0xaaec('0x17')]);module[_0xaaec('0x18')]=router; \ No newline at end of file +var _0x2329=['get','index','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x76a5e6,_0x30e729){var _0x4f0f4b=function(_0x1cc967){while(--_0x1cc967){_0x76a5e6['push'](_0x76a5e6['shift']());}};_0x4f0f4b(++_0x30e729);}(_0x2329,0x198));var _0x9232=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2329[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x9232('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9232('0x1'));var router=express[_0x9232('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9232('0x3'));var interaction=require(_0x9232('0x4'));var config=require(_0x9232('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x9232('0x6')]('/',auth['isAuthenticated'](),controller[_0x9232('0x7')]);router[_0x9232('0x6')](_0x9232('0x8'),auth['isAuthenticated'](),controller[_0x9232('0x9')]);router[_0x9232('0x6')](_0x9232('0xa'),auth['isAuthenticated'](),controller[_0x9232('0xb')]);router['get'](_0x9232('0xc'),auth[_0x9232('0xd')](),controller[_0x9232('0xe')]);router[_0x9232('0x6')](_0x9232('0xf'),auth[_0x9232('0xd')](),controller[_0x9232('0x10')]);router[_0x9232('0x11')]('/',auth[_0x9232('0xd')](),controller[_0x9232('0x12')]);router[_0x9232('0x13')](_0x9232('0x8'),auth[_0x9232('0xd')](),controller[_0x9232('0x14')]);router[_0x9232('0x15')](_0x9232('0x8'),auth[_0x9232('0xd')](),controller[_0x9232('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 42bbeac..f411b4e 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 _0x0541=['sequelize','exports','STRING'];(function(_0x11d2aa,_0x40536e){var _0x380611=function(_0x4b216e){while(--_0x4b216e){_0x11d2aa['push'](_0x11d2aa['shift']());}};_0x380611(++_0x40536e);}(_0x0541,0xea));var _0x1054=function(_0xbb6fb5,_0x4db9fb){_0xbb6fb5=_0xbb6fb5-0x0;var _0x2f9501=_0x0541[_0xbb6fb5];return _0x2f9501;};'use strict';var Sequelize=require(_0x1054('0x0'));module[_0x1054('0x1')]={'name':{'type':Sequelize[_0x1054('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2614=['STRING','exports'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x2614,0x137));var _0x4261=function(_0x10cee5,_0x20923a){_0x10cee5=_0x10cee5-0x0;var _0x17d14f=_0x2614[_0x10cee5];return _0x17d14f;};'use strict';var Sequelize=require('sequelize');module[_0x4261('0x0')]={'name':{'type':Sequelize[_0x4261('0x1')]},'description':{'type':Sequelize[_0x4261('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 3319cd0..a673cad 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 _0x3bf4=['attributes','length','nolimit','sort','where','pick','filter','merge','options','show','params','keys','includeAll','find','catch','create','body','getFields','findOne','SugarcrmField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','filters','intersection','fields'];(function(_0x15c26e,_0x599240){var _0x36a62e=function(_0x2d414d){while(--_0x2d414d){_0x15c26e['push'](_0x15c26e['shift']());}};_0x36a62e(++_0x599240);}(_0x3bf4,0xb6));var _0x43bf=function(_0x210994,_0x54f1f2){_0x210994=_0x210994-0x0;var _0x1ac4c9=_0x3bf4[_0x210994];return _0x1ac4c9;};'use strict';var emlformat=require(_0x43bf('0x0'));var rimraf=require(_0x43bf('0x1'));var zipdir=require(_0x43bf('0x2'));var jsonpatch=require(_0x43bf('0x3'));var rp=require(_0x43bf('0x4'));var moment=require(_0x43bf('0x5'));var BPromise=require(_0x43bf('0x6'));var Mustache=require(_0x43bf('0x7'));var util=require('util');var path=require('path');var sox=require(_0x43bf('0x8'));var csv=require('to-csv');var ejs=require(_0x43bf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43bf('0xa'));var squel=require(_0x43bf('0xb'));var crypto=require(_0x43bf('0xc'));var jsforce=require(_0x43bf('0xd'));var deskjs=require(_0x43bf('0xe'));var toCsv=require(_0x43bf('0xf'));var querystring=require('querystring');var Papa=require(_0x43bf('0x10'));var Redis=require(_0x43bf('0x11'));var authService=require(_0x43bf('0x12'));var qs=require(_0x43bf('0x13'));var as=require(_0x43bf('0x14'));var hardwareService=require(_0x43bf('0x15'));var logger=require(_0x43bf('0x16'))('api');var utils=require(_0x43bf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x43bf('0x18'));var db=require(_0x43bf('0x19'))['db'];function respondWithStatusCode(_0x3f72a9,_0x3d691f){_0x3d691f=_0x3d691f||0xcc;return function(_0xeab39c){if(_0xeab39c){return _0x3f72a9[_0x43bf('0x1a')](_0x3d691f);}return _0x3f72a9['status'](_0x3d691f)[_0x43bf('0x1b')]();};}function respondWithResult(_0x32049c,_0x52049c){_0x52049c=_0x52049c||0xc8;return function(_0x3180f8){if(_0x3180f8){return _0x32049c[_0x43bf('0x1c')](_0x52049c)[_0x43bf('0x1d')](_0x3180f8);}};}function respondWithFilteredResult(_0x5f1c16,_0x4d2b68){return function(_0x18bb3f){if(_0x18bb3f){var _0x133fbc=typeof _0x4d2b68[_0x43bf('0x1e')]===_0x43bf('0x1f')&&typeof _0x4d2b68[_0x43bf('0x20')]===_0x43bf('0x1f');var _0x1fb8f1=_0x18bb3f[_0x43bf('0x21')];var _0x3bb89c=_0x133fbc?0x0:_0x4d2b68['offset'];var _0x4b37d2=_0x133fbc?_0x18bb3f['count']:_0x4d2b68[_0x43bf('0x1e')]+_0x4d2b68[_0x43bf('0x20')];var _0x5a3bec;if(_0x4b37d2>=_0x1fb8f1){_0x4b37d2=_0x1fb8f1;_0x5a3bec=0xc8;}else{_0x5a3bec=0xce;}_0x5f1c16['status'](_0x5a3bec);return _0x5f1c16[_0x43bf('0x22')](_0x43bf('0x23'),_0x3bb89c+'-'+_0x4b37d2+'/'+_0x1fb8f1)[_0x43bf('0x1d')](_0x18bb3f);}return null;};}function patchUpdates(_0x157ba1){return function(_0x5137be){try{jsonpatch[_0x43bf('0x24')](_0x5137be,_0x157ba1,!![]);}catch(_0x460a03){return BPromise[_0x43bf('0x25')](_0x460a03);}return _0x5137be['save']();};}function saveUpdates(_0x48d6cd,_0x308774){return function(_0x5218c4){if(_0x5218c4){return _0x5218c4[_0x43bf('0x26')](_0x48d6cd)[_0x43bf('0x27')](function(_0x17f2b){return _0x17f2b;});}return null;};}function removeEntity(_0x4a4f9a,_0xdfae2d){return function(_0x4bb511){if(_0x4bb511){return _0x4bb511[_0x43bf('0x28')]()['then'](function(){_0x4a4f9a[_0x43bf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe24f9b,_0x31a880){return function(_0x5e6622){if(!_0x5e6622){_0xe24f9b['sendStatus'](0x194);}return _0x5e6622;};}function handleError(_0x579d30,_0x2f2acd){_0x2f2acd=_0x2f2acd||0x1f4;return function(_0x230d67){logger[_0x43bf('0x29')](_0x230d67[_0x43bf('0x2a')]);if(_0x230d67[_0x43bf('0x2b')]){delete _0x230d67[_0x43bf('0x2b')];}_0x579d30[_0x43bf('0x1c')](_0x2f2acd)[_0x43bf('0x2c')](_0x230d67);};}exports['index']=function(_0x1735a5,_0x3e80ac){var _0x4f7fb2={},_0x5d3401={},_0xba14d7={'count':0x0,'rows':[]};var _0x445643=_[_0x43bf('0x2d')](db[_0x43bf('0x2e')][_0x43bf('0x2f')],function(_0x562a1c){return{'name':_0x562a1c['fieldName'],'type':_0x562a1c[_0x43bf('0x30')][_0x43bf('0x31')]};});_0x5d3401[_0x43bf('0x32')]=_[_0x43bf('0x2d')](_0x445643,_0x43bf('0x2b'));_0x5d3401[_0x43bf('0x33')]=_['keys'](_0x1735a5[_0x43bf('0x33')]);_0x5d3401[_0x43bf('0x34')]=_[_0x43bf('0x35')](_0x5d3401[_0x43bf('0x32')],_0x5d3401[_0x43bf('0x33')]);_0x4f7fb2['attributes']=_[_0x43bf('0x35')](_0x5d3401['model'],qs['fields'](_0x1735a5[_0x43bf('0x33')][_0x43bf('0x36')]));_0x4f7fb2[_0x43bf('0x37')]=_0x4f7fb2['attributes'][_0x43bf('0x38')]?_0x4f7fb2[_0x43bf('0x37')]:_0x5d3401[_0x43bf('0x32')];if(!_0x1735a5['query']['hasOwnProperty'](_0x43bf('0x39'))){_0x4f7fb2['limit']=qs[_0x43bf('0x20')](_0x1735a5[_0x43bf('0x33')][_0x43bf('0x20')]);_0x4f7fb2[_0x43bf('0x1e')]=qs['offset'](_0x1735a5[_0x43bf('0x33')][_0x43bf('0x1e')]);}_0x4f7fb2['order']=qs['sort'](_0x1735a5[_0x43bf('0x33')][_0x43bf('0x3a')]);_0x4f7fb2[_0x43bf('0x3b')]=qs[_0x43bf('0x34')](_[_0x43bf('0x3c')](_0x1735a5[_0x43bf('0x33')],_0x5d3401['filters']),_0x445643);if(_0x1735a5[_0x43bf('0x33')][_0x43bf('0x3d')]){_0x4f7fb2[_0x43bf('0x3b')]=_[_0x43bf('0x3e')](_0x4f7fb2['where'],{'$or':_[_0x43bf('0x2d')](_0x445643,function(_0x3e4dab){if(_0x3e4dab['type']!=='VIRTUAL'){var _0x277264={};_0x277264[_0x3e4dab['name']]={'$like':'%'+_0x1735a5[_0x43bf('0x33')][_0x43bf('0x3d')]+'%'};return _0x277264;}})});}_0x4f7fb2=_[_0x43bf('0x3e')]({},_0x4f7fb2,_0x1735a5[_0x43bf('0x3f')]);var _0x3c9378={'where':_0x4f7fb2[_0x43bf('0x3b')]};return db[_0x43bf('0x2e')][_0x43bf('0x21')](_0x3c9378)[_0x43bf('0x27')](function(_0x3e1c95){_0xba14d7[_0x43bf('0x21')]=_0x3e1c95;if(_0x1735a5['query']['includeAll']){_0x4f7fb2['include']=[{'all':!![]}];}return db[_0x43bf('0x2e')]['findAll'](_0x4f7fb2);})[_0x43bf('0x27')](function(_0x26dddf){_0xba14d7['rows']=_0x26dddf;return _0xba14d7;})[_0x43bf('0x27')](respondWithFilteredResult(_0x3e80ac,_0x4f7fb2))['catch'](handleError(_0x3e80ac,null));};exports[_0x43bf('0x40')]=function(_0x3013cd,_0x380d48){var _0xc648f4={'raw':![],'where':{'id':_0x3013cd[_0x43bf('0x41')]['id']}},_0x38c492={};_0x38c492[_0x43bf('0x32')]=_['keys'](db[_0x43bf('0x2e')][_0x43bf('0x2f')]);_0x38c492['query']=_[_0x43bf('0x42')](_0x3013cd['query']);_0x38c492[_0x43bf('0x34')]=_[_0x43bf('0x35')](_0x38c492[_0x43bf('0x32')],_0x38c492[_0x43bf('0x33')]);_0xc648f4['attributes']=_[_0x43bf('0x35')](_0x38c492[_0x43bf('0x32')],qs[_0x43bf('0x36')](_0x3013cd[_0x43bf('0x33')][_0x43bf('0x36')]));_0xc648f4[_0x43bf('0x37')]=_0xc648f4[_0x43bf('0x37')]['length']?_0xc648f4[_0x43bf('0x37')]:_0x38c492[_0x43bf('0x32')];if(_0x3013cd['query'][_0x43bf('0x43')]){_0xc648f4['include']=[{'all':!![]}];}_0xc648f4=_[_0x43bf('0x3e')]({},_0xc648f4,_0x3013cd[_0x43bf('0x3f')]);return db[_0x43bf('0x2e')][_0x43bf('0x44')](_0xc648f4)[_0x43bf('0x27')](handleEntityNotFound(_0x380d48,null))['then'](respondWithResult(_0x380d48,null))[_0x43bf('0x45')](handleError(_0x380d48,null));};exports[_0x43bf('0x46')]=function(_0xaa83e2,_0x3474d3){return db['SugarcrmConfiguration'][_0x43bf('0x46')](_0xaa83e2[_0x43bf('0x47')],{})[_0x43bf('0x27')](respondWithResult(_0x3474d3,0xc9))[_0x43bf('0x45')](handleError(_0x3474d3,null));};exports[_0x43bf('0x26')]=function(_0x24e269,_0x506370){if(_0x24e269[_0x43bf('0x47')]['id']){delete _0x24e269[_0x43bf('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x43bf('0x44')]({'where':{'id':_0x24e269['params']['id']}})['then'](handleEntityNotFound(_0x506370,null))[_0x43bf('0x27')](saveUpdates(_0x24e269[_0x43bf('0x47')],null))[_0x43bf('0x27')](respondWithResult(_0x506370,null))[_0x43bf('0x45')](handleError(_0x506370,null));};exports['destroy']=function(_0x3b9508,_0x5c73d5){return db[_0x43bf('0x2e')][_0x43bf('0x44')]({'where':{'id':_0x3b9508[_0x43bf('0x41')]['id']}})[_0x43bf('0x27')](handleEntityNotFound(_0x5c73d5,null))[_0x43bf('0x27')](removeEntity(_0x5c73d5,null))[_0x43bf('0x45')](handleError(_0x5c73d5,null));};exports[_0x43bf('0x48')]=function(_0x28d2ad,_0x3aa2d9,_0x1b2dcc){var _0x5a8f03={};var _0x3c5a5b={};var _0x2c8a80;var _0x2e44c7;return db[_0x43bf('0x2e')][_0x43bf('0x49')]({'where':{'id':_0x28d2ad[_0x43bf('0x41')]['id']}})[_0x43bf('0x27')](handleEntityNotFound(_0x3aa2d9,null))[_0x43bf('0x27')](function(_0x12b33b){if(_0x12b33b){_0x2c8a80=_0x12b33b;_0x3c5a5b[_0x43bf('0x32')]=_[_0x43bf('0x42')](db[_0x43bf('0x4a')][_0x43bf('0x2f')]);_0x3c5a5b['query']=_[_0x43bf('0x42')](_0x28d2ad[_0x43bf('0x33')]);_0x3c5a5b[_0x43bf('0x34')]=_[_0x43bf('0x35')](_0x3c5a5b[_0x43bf('0x32')],_0x3c5a5b['query']);_0x5a8f03[_0x43bf('0x37')]=_['intersection'](_0x3c5a5b['model'],qs[_0x43bf('0x36')](_0x28d2ad[_0x43bf('0x33')]['fields']));_0x5a8f03[_0x43bf('0x37')]=_0x5a8f03['attributes']['length']?_0x5a8f03['attributes']:_0x3c5a5b[_0x43bf('0x32')];_0x5a8f03[_0x43bf('0x4b')]=qs[_0x43bf('0x3a')](_0x28d2ad[_0x43bf('0x33')][_0x43bf('0x3a')]);_0x5a8f03[_0x43bf('0x3b')]=qs[_0x43bf('0x34')](_[_0x43bf('0x3c')](_0x28d2ad[_0x43bf('0x33')],_0x3c5a5b[_0x43bf('0x34')]));if(_0x28d2ad[_0x43bf('0x33')][_0x43bf('0x3d')]){_0x5a8f03[_0x43bf('0x3b')]=_[_0x43bf('0x3e')](_0x5a8f03[_0x43bf('0x3b')],{'$or':_['map'](_0x5a8f03[_0x43bf('0x37')],function(_0x110b03){var _0x50d513={};_0x50d513[_0x110b03]={'$like':'%'+_0x28d2ad[_0x43bf('0x33')][_0x43bf('0x3d')]+'%'};return _0x50d513;})});}_0x5a8f03=_[_0x43bf('0x3e')]({},_0x5a8f03,_0x28d2ad['options']);return _0x2c8a80[_0x43bf('0x48')](_0x5a8f03);}})[_0x43bf('0x27')](function(_0x106dab){if(_0x106dab){_0x2e44c7=_0x106dab[_0x43bf('0x38')];if(!_0x28d2ad[_0x43bf('0x33')][_0x43bf('0x4c')](_0x43bf('0x39'))){_0x5a8f03['limit']=qs['limit'](_0x28d2ad[_0x43bf('0x33')]['limit']);_0x5a8f03[_0x43bf('0x1e')]=qs[_0x43bf('0x1e')](_0x28d2ad['query'][_0x43bf('0x1e')]);}return _0x2c8a80[_0x43bf('0x48')](_0x5a8f03);}})[_0x43bf('0x27')](function(_0x5b18a2){if(_0x5b18a2){return _0x5b18a2?{'count':_0x2e44c7,'rows':_0x5b18a2}:null;}})[_0x43bf('0x27')](respondWithResult(_0x3aa2d9,null))['catch'](handleError(_0x3aa2d9,null));};exports['getSubjects']=function(_0x1e2613,_0x5be531,_0x47e6c0){var _0xad0873={};var _0x2429c0={};var _0x475e0a;var _0x477526;return db['SugarcrmConfiguration'][_0x43bf('0x49')]({'where':{'id':_0x1e2613[_0x43bf('0x41')]['id']}})[_0x43bf('0x27')](handleEntityNotFound(_0x5be531,null))['then'](function(_0x27a2f3){if(_0x27a2f3){_0x475e0a=_0x27a2f3;_0x2429c0[_0x43bf('0x32')]=_[_0x43bf('0x42')](db[_0x43bf('0x4a')][_0x43bf('0x2f')]);_0x2429c0[_0x43bf('0x33')]=_['keys'](_0x1e2613[_0x43bf('0x33')]);_0x2429c0[_0x43bf('0x34')]=_[_0x43bf('0x35')](_0x2429c0[_0x43bf('0x32')],_0x2429c0[_0x43bf('0x33')]);_0xad0873[_0x43bf('0x37')]=_[_0x43bf('0x35')](_0x2429c0[_0x43bf('0x32')],qs[_0x43bf('0x36')](_0x1e2613[_0x43bf('0x33')][_0x43bf('0x36')]));_0xad0873[_0x43bf('0x37')]=_0xad0873[_0x43bf('0x37')][_0x43bf('0x38')]?_0xad0873['attributes']:_0x2429c0[_0x43bf('0x32')];_0xad0873[_0x43bf('0x4b')]=qs[_0x43bf('0x3a')](_0x1e2613['query'][_0x43bf('0x3a')]);_0xad0873['where']=qs[_0x43bf('0x34')](_[_0x43bf('0x3c')](_0x1e2613[_0x43bf('0x33')],_0x2429c0['filters']));if(_0x1e2613['query']['filter']){_0xad0873[_0x43bf('0x3b')]=_[_0x43bf('0x3e')](_0xad0873['where'],{'$or':_[_0x43bf('0x2d')](_0xad0873[_0x43bf('0x37')],function(_0x1203a1){var _0x30b339={};_0x30b339[_0x1203a1]={'$like':'%'+_0x1e2613['query']['filter']+'%'};return _0x30b339;})});}_0xad0873=_['merge']({},_0xad0873,_0x1e2613[_0x43bf('0x3f')]);return _0x475e0a[_0x43bf('0x4d')](_0xad0873);}})[_0x43bf('0x27')](function(_0x30157c){if(_0x30157c){_0x477526=_0x30157c[_0x43bf('0x38')];if(!_0x1e2613[_0x43bf('0x33')][_0x43bf('0x4c')](_0x43bf('0x39'))){_0xad0873['limit']=qs[_0x43bf('0x20')](_0x1e2613[_0x43bf('0x33')][_0x43bf('0x20')]);_0xad0873[_0x43bf('0x1e')]=qs[_0x43bf('0x1e')](_0x1e2613[_0x43bf('0x33')][_0x43bf('0x1e')]);}return _0x475e0a[_0x43bf('0x4d')](_0xad0873);}})[_0x43bf('0x27')](function(_0x13d134){if(_0x13d134){return _0x13d134?{'count':_0x477526,'rows':_0x13d134}:null;}})['then'](respondWithResult(_0x5be531,null))['catch'](handleError(_0x5be531,null));};exports['getDescriptions']=function(_0x46e651,_0x51e9d9,_0x35b126){var _0xff8958={};var _0x2dda97={};var _0x4b2427;var _0x589cd3;return db[_0x43bf('0x2e')][_0x43bf('0x49')]({'where':{'id':_0x46e651['params']['id']}})[_0x43bf('0x27')](handleEntityNotFound(_0x51e9d9,null))[_0x43bf('0x27')](function(_0x342271){if(_0x342271){_0x4b2427=_0x342271;_0x2dda97['model']=_['keys'](db[_0x43bf('0x4a')]['rawAttributes']);_0x2dda97[_0x43bf('0x33')]=_['keys'](_0x46e651['query']);_0x2dda97['filters']=_[_0x43bf('0x35')](_0x2dda97['model'],_0x2dda97['query']);_0xff8958[_0x43bf('0x37')]=_['intersection'](_0x2dda97['model'],qs[_0x43bf('0x36')](_0x46e651[_0x43bf('0x33')]['fields']));_0xff8958[_0x43bf('0x37')]=_0xff8958[_0x43bf('0x37')][_0x43bf('0x38')]?_0xff8958[_0x43bf('0x37')]:_0x2dda97[_0x43bf('0x32')];_0xff8958[_0x43bf('0x4b')]=qs[_0x43bf('0x3a')](_0x46e651[_0x43bf('0x33')]['sort']);_0xff8958[_0x43bf('0x3b')]=qs[_0x43bf('0x34')](_[_0x43bf('0x3c')](_0x46e651[_0x43bf('0x33')],_0x2dda97['filters']));if(_0x46e651[_0x43bf('0x33')][_0x43bf('0x3d')]){_0xff8958[_0x43bf('0x3b')]=_[_0x43bf('0x3e')](_0xff8958[_0x43bf('0x3b')],{'$or':_[_0x43bf('0x2d')](_0xff8958[_0x43bf('0x37')],function(_0x4176e3){var _0x593a48={};_0x593a48[_0x4176e3]={'$like':'%'+_0x46e651[_0x43bf('0x33')][_0x43bf('0x3d')]+'%'};return _0x593a48;})});}_0xff8958=_[_0x43bf('0x3e')]({},_0xff8958,_0x46e651[_0x43bf('0x3f')]);return _0x4b2427[_0x43bf('0x4e')](_0xff8958);}})[_0x43bf('0x27')](function(_0x550b38){if(_0x550b38){_0x589cd3=_0x550b38['length'];if(!_0x46e651[_0x43bf('0x33')][_0x43bf('0x4c')](_0x43bf('0x39'))){_0xff8958[_0x43bf('0x20')]=qs[_0x43bf('0x20')](_0x46e651['query']['limit']);_0xff8958['offset']=qs[_0x43bf('0x1e')](_0x46e651[_0x43bf('0x33')][_0x43bf('0x1e')]);}return _0x4b2427[_0x43bf('0x4e')](_0xff8958);}})['then'](function(_0x4af185){if(_0x4af185){return _0x4af185?{'count':_0x589cd3,'rows':_0x4af185}:null;}})[_0x43bf('0x27')](respondWithResult(_0x51e9d9,null))[_0x43bf('0x45')](handleError(_0x51e9d9,null));}; \ No newline at end of file +var _0x2870=['rows','show','params','keys','intersection','options','catch','create','body','find','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','nolimit','eml-format','rimraf','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','key','model','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','SugarcrmConfiguration','includeAll','include','findAll'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x2870,0x104));var _0x0287=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x2870[_0x2181fc];return _0x315da1;};'use strict';var emlformat=require(_0x0287('0x0'));var rimraf=require(_0x0287('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0287('0x2'));var BPromise=require(_0x0287('0x3'));var Mustache=require(_0x0287('0x4'));var util=require('util');var path=require(_0x0287('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0287('0x6'));var fs=require('fs');var fs_extra=require(_0x0287('0x7'));var _=require(_0x0287('0x8'));var squel=require(_0x0287('0x9'));var crypto=require(_0x0287('0xa'));var jsforce=require(_0x0287('0xb'));var deskjs=require(_0x0287('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0287('0xd'));var Papa=require(_0x0287('0xe'));var Redis=require(_0x0287('0xf'));var authService=require(_0x0287('0x10'));var qs=require(_0x0287('0x11'));var as=require(_0x0287('0x12'));var hardwareService=require(_0x0287('0x13'));var logger=require(_0x0287('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0287('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0287('0x16'))['db'];function respondWithStatusCode(_0x1ee19b,_0x59472f){_0x59472f=_0x59472f||0xcc;return function(_0x5edd8f){if(_0x5edd8f){return _0x1ee19b[_0x0287('0x17')](_0x59472f);}return _0x1ee19b[_0x0287('0x18')](_0x59472f)[_0x0287('0x19')]();};}function respondWithResult(_0x3c9d96,_0x2e29fc){_0x2e29fc=_0x2e29fc||0xc8;return function(_0x125ff2){if(_0x125ff2){return _0x3c9d96[_0x0287('0x18')](_0x2e29fc)['json'](_0x125ff2);}};}function respondWithFilteredResult(_0x56a5ae,_0x1ab780){return function(_0x2d4f4e){if(_0x2d4f4e){var _0x56fbfe=typeof _0x1ab780[_0x0287('0x1a')]===_0x0287('0x1b')&&typeof _0x1ab780[_0x0287('0x1c')]===_0x0287('0x1b');var _0x5bd8ea=_0x2d4f4e['count'];var _0x29e229=_0x56fbfe?0x0:_0x1ab780[_0x0287('0x1a')];var _0x7a4d13=_0x56fbfe?_0x2d4f4e[_0x0287('0x1d')]:_0x1ab780[_0x0287('0x1a')]+_0x1ab780[_0x0287('0x1c')];var _0x239d00;if(_0x7a4d13>=_0x5bd8ea){_0x7a4d13=_0x5bd8ea;_0x239d00=0xc8;}else{_0x239d00=0xce;}_0x56a5ae[_0x0287('0x18')](_0x239d00);return _0x56a5ae[_0x0287('0x1e')](_0x0287('0x1f'),_0x29e229+'-'+_0x7a4d13+'/'+_0x5bd8ea)[_0x0287('0x20')](_0x2d4f4e);}return null;};}function patchUpdates(_0x2e7778){return function(_0x2eb388){try{jsonpatch[_0x0287('0x21')](_0x2eb388,_0x2e7778,!![]);}catch(_0x5f4f46){return BPromise[_0x0287('0x22')](_0x5f4f46);}return _0x2eb388[_0x0287('0x23')]();};}function saveUpdates(_0x589c4f,_0x1ca1ad){return function(_0x3ddfee){if(_0x3ddfee){return _0x3ddfee[_0x0287('0x24')](_0x589c4f)[_0x0287('0x25')](function(_0x591dd4){return _0x591dd4;});}return null;};}function removeEntity(_0x23a698,_0x19bf7a){return function(_0x4357c5){if(_0x4357c5){return _0x4357c5['destroy']()[_0x0287('0x25')](function(){_0x23a698[_0x0287('0x18')](0xcc)[_0x0287('0x19')]();});}};}function handleEntityNotFound(_0xc71d83,_0x1d6dac){return function(_0x3344ed){if(!_0x3344ed){_0xc71d83[_0x0287('0x17')](0x194);}return _0x3344ed;};}function handleError(_0x43e2fc,_0x140995){_0x140995=_0x140995||0x1f4;return function(_0x5aa3e4){logger[_0x0287('0x26')](_0x5aa3e4['stack']);if(_0x5aa3e4['name']){delete _0x5aa3e4[_0x0287('0x27')];}_0x43e2fc['status'](_0x140995)[_0x0287('0x28')](_0x5aa3e4);};}exports['index']=function(_0x3ef434,_0x49cc7d){var _0x1abbb9={},_0x3e4916={},_0x35c501={'count':0x0,'rows':[]};var _0x36d0d9=_[_0x0287('0x29')](db['SugarcrmConfiguration'][_0x0287('0x2a')],function(_0x13cca5){return{'name':_0x13cca5[_0x0287('0x2b')],'type':_0x13cca5['type'][_0x0287('0x2c')]};});_0x3e4916[_0x0287('0x2d')]=_['map'](_0x36d0d9,_0x0287('0x27'));_0x3e4916[_0x0287('0x2e')]=_['keys'](_0x3ef434[_0x0287('0x2e')]);_0x3e4916['filters']=_['intersection'](_0x3e4916[_0x0287('0x2d')],_0x3e4916['query']);_0x1abbb9['attributes']=_['intersection'](_0x3e4916[_0x0287('0x2d')],qs[_0x0287('0x2f')](_0x3ef434['query']['fields']));_0x1abbb9[_0x0287('0x30')]=_0x1abbb9[_0x0287('0x30')][_0x0287('0x31')]?_0x1abbb9[_0x0287('0x30')]:_0x3e4916[_0x0287('0x2d')];if(!_0x3ef434['query'][_0x0287('0x32')]('nolimit')){_0x1abbb9[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x3ef434[_0x0287('0x2e')][_0x0287('0x1c')]);_0x1abbb9[_0x0287('0x1a')]=qs[_0x0287('0x1a')](_0x3ef434[_0x0287('0x2e')]['offset']);}_0x1abbb9[_0x0287('0x33')]=qs['sort'](_0x3ef434[_0x0287('0x2e')][_0x0287('0x34')]);_0x1abbb9[_0x0287('0x35')]=qs['filters'](_[_0x0287('0x36')](_0x3ef434[_0x0287('0x2e')],_0x3e4916[_0x0287('0x37')]),_0x36d0d9);if(_0x3ef434[_0x0287('0x2e')][_0x0287('0x38')]){_0x1abbb9[_0x0287('0x35')]=_[_0x0287('0x39')](_0x1abbb9[_0x0287('0x35')],{'$or':_[_0x0287('0x29')](_0x36d0d9,function(_0x3a072c){if(_0x3a072c[_0x0287('0x3a')]!==_0x0287('0x3b')){var _0x3c3c4d={};_0x3c3c4d[_0x3a072c['name']]={'$like':'%'+_0x3ef434['query'][_0x0287('0x38')]+'%'};return _0x3c3c4d;}})});}_0x1abbb9=_[_0x0287('0x39')]({},_0x1abbb9,_0x3ef434['options']);var _0x50fe46={'where':_0x1abbb9[_0x0287('0x35')]};return db[_0x0287('0x3c')][_0x0287('0x1d')](_0x50fe46)[_0x0287('0x25')](function(_0x30ed0f){_0x35c501['count']=_0x30ed0f;if(_0x3ef434[_0x0287('0x2e')][_0x0287('0x3d')]){_0x1abbb9[_0x0287('0x3e')]=[{'all':!![]}];}return db[_0x0287('0x3c')][_0x0287('0x3f')](_0x1abbb9);})[_0x0287('0x25')](function(_0x2265fe){_0x35c501[_0x0287('0x40')]=_0x2265fe;return _0x35c501;})[_0x0287('0x25')](respondWithFilteredResult(_0x49cc7d,_0x1abbb9))['catch'](handleError(_0x49cc7d,null));};exports[_0x0287('0x41')]=function(_0xafb99b,_0x3f8045){var _0x59e13f={'raw':![],'where':{'id':_0xafb99b[_0x0287('0x42')]['id']}},_0x4b2d39={};_0x4b2d39[_0x0287('0x2d')]=_[_0x0287('0x43')](db[_0x0287('0x3c')][_0x0287('0x2a')]);_0x4b2d39[_0x0287('0x2e')]=_[_0x0287('0x43')](_0xafb99b[_0x0287('0x2e')]);_0x4b2d39['filters']=_[_0x0287('0x44')](_0x4b2d39[_0x0287('0x2d')],_0x4b2d39[_0x0287('0x2e')]);_0x59e13f[_0x0287('0x30')]=_['intersection'](_0x4b2d39['model'],qs[_0x0287('0x2f')](_0xafb99b[_0x0287('0x2e')][_0x0287('0x2f')]));_0x59e13f[_0x0287('0x30')]=_0x59e13f[_0x0287('0x30')][_0x0287('0x31')]?_0x59e13f[_0x0287('0x30')]:_0x4b2d39[_0x0287('0x2d')];if(_0xafb99b[_0x0287('0x2e')][_0x0287('0x3d')]){_0x59e13f['include']=[{'all':!![]}];}_0x59e13f=_[_0x0287('0x39')]({},_0x59e13f,_0xafb99b[_0x0287('0x45')]);return db['SugarcrmConfiguration']['find'](_0x59e13f)[_0x0287('0x25')](handleEntityNotFound(_0x3f8045,null))[_0x0287('0x25')](respondWithResult(_0x3f8045,null))[_0x0287('0x46')](handleError(_0x3f8045,null));};exports[_0x0287('0x47')]=function(_0x477322,_0x13fe34){return db['SugarcrmConfiguration']['create'](_0x477322[_0x0287('0x48')],{})[_0x0287('0x25')](respondWithResult(_0x13fe34,0xc9))[_0x0287('0x46')](handleError(_0x13fe34,null));};exports[_0x0287('0x24')]=function(_0x12a9cf,_0x455ae4){if(_0x12a9cf[_0x0287('0x48')]['id']){delete _0x12a9cf['body']['id'];}return db[_0x0287('0x3c')][_0x0287('0x49')]({'where':{'id':_0x12a9cf['params']['id']}})[_0x0287('0x25')](handleEntityNotFound(_0x455ae4,null))[_0x0287('0x25')](saveUpdates(_0x12a9cf[_0x0287('0x48')],null))[_0x0287('0x25')](respondWithResult(_0x455ae4,null))['catch'](handleError(_0x455ae4,null));};exports[_0x0287('0x4a')]=function(_0x34f5bc,_0x2c5ba7){return db[_0x0287('0x3c')]['find']({'where':{'id':_0x34f5bc[_0x0287('0x42')]['id']}})[_0x0287('0x25')](handleEntityNotFound(_0x2c5ba7,null))[_0x0287('0x25')](removeEntity(_0x2c5ba7,null))[_0x0287('0x46')](handleError(_0x2c5ba7,null));};exports[_0x0287('0x4b')]=function(_0x5343b7,_0x5439d8,_0x5589d1){var _0x39eb03={};var _0x478d7={};var _0x20058a;var _0x2c3bc6;return db['SugarcrmConfiguration'][_0x0287('0x4c')]({'where':{'id':_0x5343b7[_0x0287('0x42')]['id']}})['then'](handleEntityNotFound(_0x5439d8,null))[_0x0287('0x25')](function(_0x502bc7){if(_0x502bc7){_0x20058a=_0x502bc7;_0x478d7[_0x0287('0x2d')]=_[_0x0287('0x43')](db[_0x0287('0x4d')]['rawAttributes']);_0x478d7[_0x0287('0x2e')]=_[_0x0287('0x43')](_0x5343b7[_0x0287('0x2e')]);_0x478d7[_0x0287('0x37')]=_[_0x0287('0x44')](_0x478d7[_0x0287('0x2d')],_0x478d7[_0x0287('0x2e')]);_0x39eb03[_0x0287('0x30')]=_[_0x0287('0x44')](_0x478d7[_0x0287('0x2d')],qs[_0x0287('0x2f')](_0x5343b7[_0x0287('0x2e')]['fields']));_0x39eb03[_0x0287('0x30')]=_0x39eb03[_0x0287('0x30')][_0x0287('0x31')]?_0x39eb03['attributes']:_0x478d7[_0x0287('0x2d')];_0x39eb03['order']=qs[_0x0287('0x34')](_0x5343b7['query'][_0x0287('0x34')]);_0x39eb03[_0x0287('0x35')]=qs[_0x0287('0x37')](_[_0x0287('0x36')](_0x5343b7[_0x0287('0x2e')],_0x478d7[_0x0287('0x37')]));if(_0x5343b7['query'][_0x0287('0x38')]){_0x39eb03[_0x0287('0x35')]=_['merge'](_0x39eb03[_0x0287('0x35')],{'$or':_[_0x0287('0x29')](_0x39eb03[_0x0287('0x30')],function(_0x13e9e1){var _0x349228={};_0x349228[_0x13e9e1]={'$like':'%'+_0x5343b7['query'][_0x0287('0x38')]+'%'};return _0x349228;})});}_0x39eb03=_[_0x0287('0x39')]({},_0x39eb03,_0x5343b7[_0x0287('0x45')]);return _0x20058a[_0x0287('0x4b')](_0x39eb03);}})[_0x0287('0x25')](function(_0x562605){if(_0x562605){_0x2c3bc6=_0x562605['length'];if(!_0x5343b7[_0x0287('0x2e')]['hasOwnProperty']('nolimit')){_0x39eb03[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x5343b7[_0x0287('0x2e')]['limit']);_0x39eb03[_0x0287('0x1a')]=qs[_0x0287('0x1a')](_0x5343b7[_0x0287('0x2e')][_0x0287('0x1a')]);}return _0x20058a[_0x0287('0x4b')](_0x39eb03);}})[_0x0287('0x25')](function(_0x5264fb){if(_0x5264fb){return _0x5264fb?{'count':_0x2c3bc6,'rows':_0x5264fb}:null;}})[_0x0287('0x25')](respondWithResult(_0x5439d8,null))['catch'](handleError(_0x5439d8,null));};exports[_0x0287('0x4e')]=function(_0x5da5aa,_0x854b3,_0x3ea015){var _0x206ec2={};var _0x479259={};var _0x28e703;var _0x15939f;return db['SugarcrmConfiguration'][_0x0287('0x4c')]({'where':{'id':_0x5da5aa[_0x0287('0x42')]['id']}})[_0x0287('0x25')](handleEntityNotFound(_0x854b3,null))[_0x0287('0x25')](function(_0xe970ac){if(_0xe970ac){_0x28e703=_0xe970ac;_0x479259[_0x0287('0x2d')]=_[_0x0287('0x43')](db['SugarcrmField'][_0x0287('0x2a')]);_0x479259[_0x0287('0x2e')]=_[_0x0287('0x43')](_0x5da5aa['query']);_0x479259[_0x0287('0x37')]=_[_0x0287('0x44')](_0x479259[_0x0287('0x2d')],_0x479259[_0x0287('0x2e')]);_0x206ec2[_0x0287('0x30')]=_[_0x0287('0x44')](_0x479259[_0x0287('0x2d')],qs[_0x0287('0x2f')](_0x5da5aa[_0x0287('0x2e')][_0x0287('0x2f')]));_0x206ec2[_0x0287('0x30')]=_0x206ec2[_0x0287('0x30')][_0x0287('0x31')]?_0x206ec2[_0x0287('0x30')]:_0x479259[_0x0287('0x2d')];_0x206ec2[_0x0287('0x33')]=qs['sort'](_0x5da5aa[_0x0287('0x2e')][_0x0287('0x34')]);_0x206ec2[_0x0287('0x35')]=qs['filters'](_['pick'](_0x5da5aa[_0x0287('0x2e')],_0x479259[_0x0287('0x37')]));if(_0x5da5aa[_0x0287('0x2e')][_0x0287('0x38')]){_0x206ec2[_0x0287('0x35')]=_[_0x0287('0x39')](_0x206ec2[_0x0287('0x35')],{'$or':_[_0x0287('0x29')](_0x206ec2[_0x0287('0x30')],function(_0x2978bc){var _0x9bc31={};_0x9bc31[_0x2978bc]={'$like':'%'+_0x5da5aa[_0x0287('0x2e')][_0x0287('0x38')]+'%'};return _0x9bc31;})});}_0x206ec2=_[_0x0287('0x39')]({},_0x206ec2,_0x5da5aa[_0x0287('0x45')]);return _0x28e703['getSubjects'](_0x206ec2);}})['then'](function(_0x37bf07){if(_0x37bf07){_0x15939f=_0x37bf07['length'];if(!_0x5da5aa['query']['hasOwnProperty']('nolimit')){_0x206ec2['limit']=qs[_0x0287('0x1c')](_0x5da5aa[_0x0287('0x2e')][_0x0287('0x1c')]);_0x206ec2['offset']=qs[_0x0287('0x1a')](_0x5da5aa['query'][_0x0287('0x1a')]);}return _0x28e703[_0x0287('0x4e')](_0x206ec2);}})['then'](function(_0x35d254){if(_0x35d254){return _0x35d254?{'count':_0x15939f,'rows':_0x35d254}:null;}})[_0x0287('0x25')](respondWithResult(_0x854b3,null))['catch'](handleError(_0x854b3,null));};exports[_0x0287('0x4f')]=function(_0x631e9e,_0x4938d1,_0x1f6b65){var _0x184a55={};var _0x4a91d3={};var _0x1ed56b;var _0x2289d5;return db[_0x0287('0x3c')]['findOne']({'where':{'id':_0x631e9e[_0x0287('0x42')]['id']}})[_0x0287('0x25')](handleEntityNotFound(_0x4938d1,null))['then'](function(_0x287527){if(_0x287527){_0x1ed56b=_0x287527;_0x4a91d3[_0x0287('0x2d')]=_[_0x0287('0x43')](db[_0x0287('0x4d')][_0x0287('0x2a')]);_0x4a91d3['query']=_[_0x0287('0x43')](_0x631e9e[_0x0287('0x2e')]);_0x4a91d3[_0x0287('0x37')]=_[_0x0287('0x44')](_0x4a91d3[_0x0287('0x2d')],_0x4a91d3[_0x0287('0x2e')]);_0x184a55['attributes']=_[_0x0287('0x44')](_0x4a91d3['model'],qs[_0x0287('0x2f')](_0x631e9e[_0x0287('0x2e')][_0x0287('0x2f')]));_0x184a55[_0x0287('0x30')]=_0x184a55[_0x0287('0x30')][_0x0287('0x31')]?_0x184a55[_0x0287('0x30')]:_0x4a91d3['model'];_0x184a55[_0x0287('0x33')]=qs[_0x0287('0x34')](_0x631e9e['query'][_0x0287('0x34')]);_0x184a55[_0x0287('0x35')]=qs[_0x0287('0x37')](_[_0x0287('0x36')](_0x631e9e[_0x0287('0x2e')],_0x4a91d3[_0x0287('0x37')]));if(_0x631e9e[_0x0287('0x2e')]['filter']){_0x184a55[_0x0287('0x35')]=_[_0x0287('0x39')](_0x184a55[_0x0287('0x35')],{'$or':_['map'](_0x184a55[_0x0287('0x30')],function(_0x6df818){var _0x5cc4ed={};_0x5cc4ed[_0x6df818]={'$like':'%'+_0x631e9e[_0x0287('0x2e')][_0x0287('0x38')]+'%'};return _0x5cc4ed;})});}_0x184a55=_[_0x0287('0x39')]({},_0x184a55,_0x631e9e[_0x0287('0x45')]);return _0x1ed56b[_0x0287('0x4f')](_0x184a55);}})[_0x0287('0x25')](function(_0x51b3d8){if(_0x51b3d8){_0x2289d5=_0x51b3d8[_0x0287('0x31')];if(!_0x631e9e[_0x0287('0x2e')]['hasOwnProperty'](_0x0287('0x50'))){_0x184a55[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x631e9e[_0x0287('0x2e')][_0x0287('0x1c')]);_0x184a55[_0x0287('0x1a')]=qs['offset'](_0x631e9e[_0x0287('0x2e')][_0x0287('0x1a')]);}return _0x1ed56b[_0x0287('0x4f')](_0x184a55);}})[_0x0287('0x25')](function(_0x22603d){if(_0x22603d){return _0x22603d?{'count':_0x2289d5,'rows':_0x22603d}:null;}})['then'](respondWithResult(_0x4938d1,null))[_0x0287('0x46')](handleError(_0x4938d1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index aef3137..27e5c62 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 _0xf0ee=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','lodash','util'];(function(_0x1dc847,_0x3054c9){var _0x1bcc1a=function(_0x2e7c4e){while(--_0x2e7c4e){_0x1dc847['push'](_0x1dc847['shift']());}};_0x1bcc1a(++_0x3054c9);}(_0xf0ee,0x7c));var _0xef0e=function(_0x21a945,_0xbedd50){_0x21a945=_0x21a945-0x0;var _0x107826=_0xf0ee[_0x21a945];return _0x107826;};'use strict';var _=require(_0xef0e('0x0'));var util=require(_0xef0e('0x1'));var logger=require(_0xef0e('0x2'))(_0xef0e('0x3'));var moment=require(_0xef0e('0x4'));var BPromise=require(_0xef0e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef0e('0x6'));var rimraf=require(_0xef0e('0x7'));var config=require(_0xef0e('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x12228a,_0x527f6d){return _0x12228a['define']('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b59=['bluebird','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','api','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6b59,0x1d2));var _0x96b5=function(_0x52fe17,_0x2af32a){_0x52fe17=_0x52fe17-0x0;var _0x5af586=_0x6b59[_0x52fe17];return _0x5af586;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x96b5('0x0'));var moment=require(_0x96b5('0x1'));var BPromise=require(_0x96b5('0x2'));var rp=require(_0x96b5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96b5('0x4'));var config=require('../../config/environment');var attributes=require(_0x96b5('0x5'));module[_0x96b5('0x6')]=function(_0x5033af,_0x2c7fd8){return _0x5033af[_0x96b5('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0x96b5('0x8'),'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 db85c83..20307a8 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 _0x60b7=['../../config/logger','../../config/environment','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x60b7,0x1f0));var _0x760b=function(_0x406115,_0x19f7a1){_0x406115=_0x406115-0x0;var _0xbbabdb=_0x60b7[_0x406115];return _0xbbabdb;};'use strict';var _=require(_0x760b('0x0'));var util=require(_0x760b('0x1'));var moment=require(_0x760b('0x2'));var BPromise=require(_0x760b('0x3'));var rs=require(_0x760b('0x4'));var fs=require('fs');var Redis=require(_0x760b('0x5'));var db=require(_0x760b('0x6'))['db'];var utils=require(_0x760b('0x7'));var logger=require(_0x760b('0x8'))('rpc');var config=require(_0x760b('0x9'));var jayson=require(_0x760b('0xa'));var client=jayson[_0x760b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2921f7,_0x25c5b1,_0x18b6c8){return new BPromise(function(_0x8fcb15,_0x2390dd){return client[_0x760b('0xc')](_0x2921f7,_0x18b6c8)[_0x760b('0xd')](function(_0x4a2a33){logger['info'](_0x760b('0xe'),_0x25c5b1,_0x760b('0xf'));logger[_0x760b('0x10')](_0x760b('0x11'),_0x25c5b1,_0x760b('0xf'),JSON[_0x760b('0x12')](_0x4a2a33));if(_0x4a2a33[_0x760b('0x13')]){if(_0x4a2a33[_0x760b('0x13')]['code']===0x1f4){logger['error'](_0x760b('0xe'),_0x25c5b1,_0x4a2a33[_0x760b('0x13')][_0x760b('0x14')]);return _0x2390dd(_0x4a2a33['error'][_0x760b('0x14')]);}logger[_0x760b('0x13')](_0x760b('0xe'),_0x25c5b1,_0x4a2a33[_0x760b('0x13')][_0x760b('0x14')]);return _0x8fcb15(_0x4a2a33[_0x760b('0x13')]['message']);}else{logger[_0x760b('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x25c5b1,_0x760b('0xf'));_0x8fcb15(_0x4a2a33[_0x760b('0x16')][_0x760b('0x14')]);}})[_0x760b('0x17')](function(_0x1c93a3){logger[_0x760b('0x13')](_0x760b('0xe'),_0x25c5b1,_0x1c93a3);_0x2390dd(_0x1c93a3);});});} \ No newline at end of file +var _0xb38c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x5ead80,_0x1fb190){var _0x12246b=function(_0x278173){while(--_0x278173){_0x5ead80['push'](_0x5ead80['shift']());}};_0x12246b(++_0x1fb190);}(_0xb38c,0x164));var _0xcb38=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0xb38c[_0x57b432];return _0x2edf2a;};'use strict';var _=require(_0xcb38('0x0'));var util=require(_0xcb38('0x1'));var moment=require(_0xcb38('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb38('0x3'));var fs=require('fs');var Redis=require(_0xcb38('0x4'));var db=require(_0xcb38('0x5'))['db'];var utils=require(_0xcb38('0x6'));var logger=require('../../config/logger')(_0xcb38('0x7'));var config=require(_0xcb38('0x8'));var jayson=require(_0xcb38('0x9'));var client=jayson['client'][_0xcb38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eb0b2,_0x32044c,_0x256a27){return new BPromise(function(_0x1ed46f,_0x916cd9){return client[_0xcb38('0xb')](_0x2eb0b2,_0x256a27)[_0xcb38('0xc')](function(_0x2bec32){logger[_0xcb38('0xd')](_0xcb38('0xe'),_0x32044c,'request\x20sent');logger[_0xcb38('0xf')](_0xcb38('0x10'),_0x32044c,_0xcb38('0x11'),JSON[_0xcb38('0x12')](_0x2bec32));if(_0x2bec32[_0xcb38('0x13')]){if(_0x2bec32[_0xcb38('0x13')][_0xcb38('0x14')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x32044c,_0x2bec32[_0xcb38('0x13')][_0xcb38('0x15')]);return _0x916cd9(_0x2bec32[_0xcb38('0x13')][_0xcb38('0x15')]);}logger[_0xcb38('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x32044c,_0x2bec32['error'][_0xcb38('0x15')]);return _0x1ed46f(_0x2bec32[_0xcb38('0x13')]['message']);}else{logger['info'](_0xcb38('0xe'),_0x32044c,'request\x20sent');_0x1ed46f(_0x2bec32[_0xcb38('0x16')][_0xcb38('0x15')]);}})[_0xcb38('0x17')](function(_0x33ff76){logger[_0xcb38('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x32044c,_0x33ff76);_0x916cd9(_0x33ff76);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 687941f..d1c1ff6 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 _0x96b8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util'];(function(_0x331ee0,_0x2fcfe6){var _0x5cc05e=function(_0x8ec6e){while(--_0x8ec6e){_0x331ee0['push'](_0x331ee0['shift']());}};_0x5cc05e(++_0x2fcfe6);}(_0x96b8,0xb3));var _0x896b=function(_0x205d25,_0x6a807c){_0x205d25=_0x205d25-0x0;var _0x3ae7a3=_0x96b8[_0x205d25];return _0x3ae7a3;};'use strict';var multer=require('multer');var util=require(_0x896b('0x0'));var path=require(_0x896b('0x1'));var timeout=require(_0x896b('0x2'));var express=require(_0x896b('0x3'));var router=express[_0x896b('0x4')]();var fs_extra=require(_0x896b('0x5'));var auth=require(_0x896b('0x6'));var interaction=require(_0x896b('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x896b('0x8')](_0x896b('0x9'),auth['isAuthenticated'](),controller[_0x896b('0xa')]);router[_0x896b('0xb')]('/',auth[_0x896b('0xc')](),controller[_0x896b('0xd')]);router[_0x896b('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x896b('0xf')]('/:id',auth[_0x896b('0xc')](),controller[_0x896b('0x10')]);module[_0x896b('0x11')]=router; \ No newline at end of file +var _0xaf1f=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','index','get','/:id'];(function(_0x3e1829,_0xc8ccda){var _0x129345=function(_0x2357c0){while(--_0x2357c0){_0x3e1829['push'](_0x3e1829['shift']());}};_0x129345(++_0xc8ccda);}(_0xaf1f,0x144));var _0xfaf1=function(_0x3269ca,_0x35a53){_0x3269ca=_0x3269ca-0x0;var _0x4d30c0=_0xaf1f[_0x3269ca];return _0x4d30c0;};'use strict';var multer=require(_0xfaf1('0x0'));var util=require(_0xfaf1('0x1'));var path=require(_0xfaf1('0x2'));var timeout=require(_0xfaf1('0x3'));var express=require(_0xfaf1('0x4'));var router=express[_0xfaf1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfaf1('0x6'));var interaction=require(_0xfaf1('0x7'));var config=require('../../config/environment');var controller=require(_0xfaf1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfaf1('0x9')]);router[_0xfaf1('0xa')](_0xfaf1('0xb'),auth[_0xfaf1('0xc')](),controller[_0xfaf1('0xd')]);router[_0xfaf1('0xe')]('/',auth[_0xfaf1('0xc')](),controller[_0xfaf1('0xf')]);router[_0xfaf1('0x10')]('/:id',auth[_0xfaf1('0xc')](),controller[_0xfaf1('0x11')]);router[_0xfaf1('0x12')](_0xfaf1('0xb'),auth[_0xfaf1('0xc')](),controller[_0xfaf1('0x13')]);module[_0xfaf1('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index a14fd6a..d5a1a2e 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 _0xbf9a=['variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf9a,0x85));var _0xabf9=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xbf9a[_0x17a32f];return _0x15a293;};'use strict';var Sequelize=require(_0xabf9('0x0'));module[_0xabf9('0x1')]={'type':{'type':Sequelize[_0xabf9('0x2')]('string',_0xabf9('0x3'),'customVariable','keyValue',_0xabf9('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xabf9('0x5')]},'key':{'type':Sequelize[_0xabf9('0x5')]},'keyType':{'type':Sequelize[_0xabf9('0x2')]('string',_0xabf9('0x3'),_0xabf9('0x6'))},'keyContent':{'type':Sequelize[_0xabf9('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xabf9('0x5')]},'customField':{'type':Sequelize[_0xabf9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xabf9('0x5')]}}; \ No newline at end of file +var _0x55b6=['picklist','STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x4bbaa3,_0x254764){var _0x520885=function(_0x4fd998){while(--_0x4fd998){_0x4bbaa3['push'](_0x4bbaa3['shift']());}};_0x520885(++_0x254764);}(_0x55b6,0x19a));var _0x655b=function(_0x3bfe6a,_0x182035){_0x3bfe6a=_0x3bfe6a-0x0;var _0x10a7ee=_0x55b6[_0x3bfe6a];return _0x10a7ee;};'use strict';var Sequelize=require('sequelize');module[_0x655b('0x0')]={'type':{'type':Sequelize[_0x655b('0x1')](_0x655b('0x2'),_0x655b('0x3'),_0x655b('0x4'),_0x655b('0x5'),_0x655b('0x6')),'defaultValue':_0x655b('0x2')},'content':{'type':Sequelize[_0x655b('0x7')]},'key':{'type':Sequelize[_0x655b('0x7')]},'keyType':{'type':Sequelize[_0x655b('0x1')](_0x655b('0x2'),_0x655b('0x3'),_0x655b('0x4'))},'keyContent':{'type':Sequelize[_0x655b('0x7')]},'idField':{'type':Sequelize[_0x655b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x655b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 57a10a4..627864e 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 _0x6209=['save','then','stack','name','index','map','SugarcrmField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6209,0x184));var _0x9620=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6209[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0x9620('0x0'));var rimraf=require(_0x9620('0x1'));var zipdir=require(_0x9620('0x2'));var jsonpatch=require(_0x9620('0x3'));var rp=require(_0x9620('0x4'));var moment=require(_0x9620('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9620('0x6'));var path=require(_0x9620('0x7'));var sox=require('sox');var csv=require(_0x9620('0x8'));var ejs=require(_0x9620('0x9'));var fs=require('fs');var fs_extra=require(_0x9620('0xa'));var _=require(_0x9620('0xb'));var squel=require(_0x9620('0xc'));var crypto=require(_0x9620('0xd'));var jsforce=require(_0x9620('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9620('0x8'));var querystring=require('querystring');var Papa=require(_0x9620('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9620('0x10'));var as=require(_0x9620('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9620('0x12'))('api');var utils=require(_0x9620('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9620('0x14'))['db'];function respondWithStatusCode(_0x2b054a,_0xe976b){_0xe976b=_0xe976b||0xcc;return function(_0x4f4035){if(_0x4f4035){return _0x2b054a[_0x9620('0x15')](_0xe976b);}return _0x2b054a[_0x9620('0x16')](_0xe976b)[_0x9620('0x17')]();};}function respondWithResult(_0x1d09b1,_0x41b457){_0x41b457=_0x41b457||0xc8;return function(_0x3e323a){if(_0x3e323a){return _0x1d09b1['status'](_0x41b457)[_0x9620('0x18')](_0x3e323a);}};}function respondWithFilteredResult(_0x228c05,_0x4e7316){return function(_0x5f386c){if(_0x5f386c){var _0x456171=typeof _0x4e7316[_0x9620('0x19')]===_0x9620('0x1a')&&typeof _0x4e7316[_0x9620('0x1b')]==='undefined';var _0x1b25c1=_0x5f386c[_0x9620('0x1c')];var _0x379678=_0x456171?0x0:_0x4e7316[_0x9620('0x19')];var _0x16d19f=_0x456171?_0x5f386c[_0x9620('0x1c')]:_0x4e7316[_0x9620('0x19')]+_0x4e7316[_0x9620('0x1b')];var _0x17f6b0;if(_0x16d19f>=_0x1b25c1){_0x16d19f=_0x1b25c1;_0x17f6b0=0xc8;}else{_0x17f6b0=0xce;}_0x228c05['status'](_0x17f6b0);return _0x228c05['set'](_0x9620('0x1d'),_0x379678+'-'+_0x16d19f+'/'+_0x1b25c1)[_0x9620('0x18')](_0x5f386c);}return null;};}function patchUpdates(_0x375af7){return function(_0x387647){try{jsonpatch[_0x9620('0x1e')](_0x387647,_0x375af7,!![]);}catch(_0x51a07e){return BPromise[_0x9620('0x1f')](_0x51a07e);}return _0x387647[_0x9620('0x20')]();};}function saveUpdates(_0x3d3e30,_0x5c6b6b){return function(_0xb930f2){if(_0xb930f2){return _0xb930f2['update'](_0x3d3e30)[_0x9620('0x21')](function(_0x2b3739){return _0x2b3739;});}return null;};}function removeEntity(_0x5abf7f,_0x29ffb8){return function(_0x2f7788){if(_0x2f7788){return _0x2f7788['destroy']()[_0x9620('0x21')](function(){_0x5abf7f[_0x9620('0x16')](0xcc)[_0x9620('0x17')]();});}};}function handleEntityNotFound(_0x34513b,_0x525f37){return function(_0x15b2c9){if(!_0x15b2c9){_0x34513b[_0x9620('0x15')](0x194);}return _0x15b2c9;};}function handleError(_0x1b7d8d,_0x37dcbd){_0x37dcbd=_0x37dcbd||0x1f4;return function(_0x8993dd){logger['error'](_0x8993dd[_0x9620('0x22')]);if(_0x8993dd['name']){delete _0x8993dd[_0x9620('0x23')];}_0x1b7d8d[_0x9620('0x16')](_0x37dcbd)['send'](_0x8993dd);};}exports[_0x9620('0x24')]=function(_0x2ddbad,_0xc4e7e7){var _0xea44b9={},_0x1d4677={},_0x5e702d={'count':0x0,'rows':[]};var _0x8df27=_[_0x9620('0x25')](db[_0x9620('0x26')][_0x9620('0x27')],function(_0x43f97d){return{'name':_0x43f97d['fieldName'],'type':_0x43f97d[_0x9620('0x28')][_0x9620('0x29')]};});_0x1d4677[_0x9620('0x2a')]=_['map'](_0x8df27,'name');_0x1d4677[_0x9620('0x2b')]=_[_0x9620('0x2c')](_0x2ddbad['query']);_0x1d4677[_0x9620('0x2d')]=_[_0x9620('0x2e')](_0x1d4677[_0x9620('0x2a')],_0x1d4677[_0x9620('0x2b')]);_0xea44b9[_0x9620('0x2f')]=_[_0x9620('0x2e')](_0x1d4677[_0x9620('0x2a')],qs['fields'](_0x2ddbad[_0x9620('0x2b')][_0x9620('0x30')]));_0xea44b9[_0x9620('0x2f')]=_0xea44b9['attributes'][_0x9620('0x31')]?_0xea44b9[_0x9620('0x2f')]:_0x1d4677['model'];if(!_0x2ddbad[_0x9620('0x2b')][_0x9620('0x32')](_0x9620('0x33'))){_0xea44b9[_0x9620('0x1b')]=qs[_0x9620('0x1b')](_0x2ddbad['query']['limit']);_0xea44b9[_0x9620('0x19')]=qs[_0x9620('0x19')](_0x2ddbad['query'][_0x9620('0x19')]);}_0xea44b9[_0x9620('0x34')]=qs[_0x9620('0x35')](_0x2ddbad['query'][_0x9620('0x35')]);_0xea44b9[_0x9620('0x36')]=qs[_0x9620('0x2d')](_[_0x9620('0x37')](_0x2ddbad[_0x9620('0x2b')],_0x1d4677[_0x9620('0x2d')]),_0x8df27);if(_0x2ddbad['query'][_0x9620('0x38')]){_0xea44b9[_0x9620('0x36')]=_[_0x9620('0x39')](_0xea44b9[_0x9620('0x36')],{'$or':_[_0x9620('0x25')](_0x8df27,function(_0x5f2eac){if(_0x5f2eac[_0x9620('0x28')]!==_0x9620('0x3a')){var _0x19ed64={};_0x19ed64[_0x5f2eac[_0x9620('0x23')]]={'$like':'%'+_0x2ddbad['query'][_0x9620('0x38')]+'%'};return _0x19ed64;}})});}_0xea44b9=_[_0x9620('0x39')]({},_0xea44b9,_0x2ddbad[_0x9620('0x3b')]);var _0x4d6181={'where':_0xea44b9['where']};return db[_0x9620('0x26')][_0x9620('0x1c')](_0x4d6181)['then'](function(_0x2fe9a0){_0x5e702d[_0x9620('0x1c')]=_0x2fe9a0;if(_0x2ddbad[_0x9620('0x2b')][_0x9620('0x3c')]){_0xea44b9['include']=[{'all':!![]}];}return db[_0x9620('0x26')][_0x9620('0x3d')](_0xea44b9);})[_0x9620('0x21')](function(_0x29e3a2){_0x5e702d[_0x9620('0x3e')]=_0x29e3a2;return _0x5e702d;})[_0x9620('0x21')](respondWithFilteredResult(_0xc4e7e7,_0xea44b9))[_0x9620('0x3f')](handleError(_0xc4e7e7,null));};exports['show']=function(_0x37813e,_0x4cfb00){var _0x1c52ee={'raw':!![],'where':{'id':_0x37813e[_0x9620('0x40')]['id']}},_0x215714={};_0x215714['model']=_[_0x9620('0x2c')](db[_0x9620('0x26')][_0x9620('0x27')]);_0x215714[_0x9620('0x2b')]=_['keys'](_0x37813e['query']);_0x215714['filters']=_[_0x9620('0x2e')](_0x215714['model'],_0x215714[_0x9620('0x2b')]);_0x1c52ee[_0x9620('0x2f')]=_['intersection'](_0x215714[_0x9620('0x2a')],qs['fields'](_0x37813e[_0x9620('0x2b')][_0x9620('0x30')]));_0x1c52ee[_0x9620('0x2f')]=_0x1c52ee[_0x9620('0x2f')]['length']?_0x1c52ee[_0x9620('0x2f')]:_0x215714[_0x9620('0x2a')];if(_0x37813e[_0x9620('0x2b')][_0x9620('0x3c')]){_0x1c52ee[_0x9620('0x41')]=[{'all':!![]}];}_0x1c52ee=_[_0x9620('0x39')]({},_0x1c52ee,_0x37813e[_0x9620('0x3b')]);return db[_0x9620('0x26')][_0x9620('0x42')](_0x1c52ee)[_0x9620('0x21')](handleEntityNotFound(_0x4cfb00,null))[_0x9620('0x21')](respondWithResult(_0x4cfb00,null))[_0x9620('0x3f')](handleError(_0x4cfb00,null));};exports[_0x9620('0x43')]=function(_0x50e21e,_0x46999e){return db[_0x9620('0x26')][_0x9620('0x43')](_0x50e21e[_0x9620('0x44')],{})[_0x9620('0x21')](respondWithResult(_0x46999e,0xc9))[_0x9620('0x3f')](handleError(_0x46999e,null));};exports[_0x9620('0x45')]=function(_0x296a50,_0x412691){if(_0x296a50[_0x9620('0x44')]['id']){delete _0x296a50[_0x9620('0x44')]['id'];}return db['SugarcrmField'][_0x9620('0x42')]({'where':{'id':_0x296a50[_0x9620('0x40')]['id']}})[_0x9620('0x21')](handleEntityNotFound(_0x412691,null))['then'](saveUpdates(_0x296a50[_0x9620('0x44')],null))['then'](respondWithResult(_0x412691,null))[_0x9620('0x3f')](handleError(_0x412691,null));};exports['destroy']=function(_0x266d45,_0x194ea2){return db[_0x9620('0x26')]['find']({'where':{'id':_0x266d45[_0x9620('0x40')]['id']}})[_0x9620('0x21')](handleEntityNotFound(_0x194ea2,null))['then'](removeEntity(_0x194ea2,null))['catch'](handleError(_0x194ea2,null));}; \ No newline at end of file +var _0xb388=['stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy'];(function(_0x43469e,_0x4e69d6){var _0xcefd2a=function(_0x8ded6f){while(--_0x8ded6f){_0x43469e['push'](_0x43469e['shift']());}};_0xcefd2a(++_0x4e69d6);}(_0xb388,0x1df));var _0x8b38=function(_0xe72aa5,_0x510129){_0xe72aa5=_0xe72aa5-0x0;var _0x5f228f=_0xb388[_0xe72aa5];return _0x5f228f;};'use strict';var emlformat=require(_0x8b38('0x0'));var rimraf=require(_0x8b38('0x1'));var zipdir=require(_0x8b38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b38('0x3'));var BPromise=require(_0x8b38('0x4'));var Mustache=require(_0x8b38('0x5'));var util=require(_0x8b38('0x6'));var path=require(_0x8b38('0x7'));var sox=require(_0x8b38('0x8'));var csv=require(_0x8b38('0x9'));var ejs=require(_0x8b38('0xa'));var fs=require('fs');var fs_extra=require(_0x8b38('0xb'));var _=require(_0x8b38('0xc'));var squel=require(_0x8b38('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b38('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8b38('0xf'));var Papa=require(_0x8b38('0x10'));var Redis=require(_0x8b38('0x11'));var authService=require(_0x8b38('0x12'));var qs=require(_0x8b38('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b38('0x14'));var logger=require(_0x8b38('0x15'))(_0x8b38('0x16'));var utils=require(_0x8b38('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8b38('0x18'));var db=require(_0x8b38('0x19'))['db'];function respondWithStatusCode(_0x3f7bec,_0x138a8f){_0x138a8f=_0x138a8f||0xcc;return function(_0x4592da){if(_0x4592da){return _0x3f7bec[_0x8b38('0x1a')](_0x138a8f);}return _0x3f7bec['status'](_0x138a8f)[_0x8b38('0x1b')]();};}function respondWithResult(_0x14a49a,_0x5ac999){_0x5ac999=_0x5ac999||0xc8;return function(_0x405091){if(_0x405091){return _0x14a49a[_0x8b38('0x1c')](_0x5ac999)[_0x8b38('0x1d')](_0x405091);}};}function respondWithFilteredResult(_0x42f237,_0x4fea30){return function(_0x11a182){if(_0x11a182){var _0xe122c4=typeof _0x4fea30[_0x8b38('0x1e')]===_0x8b38('0x1f')&&typeof _0x4fea30[_0x8b38('0x20')]===_0x8b38('0x1f');var _0x248fdb=_0x11a182[_0x8b38('0x21')];var _0x3a2d2c=_0xe122c4?0x0:_0x4fea30[_0x8b38('0x1e')];var _0x3e867c=_0xe122c4?_0x11a182[_0x8b38('0x21')]:_0x4fea30[_0x8b38('0x1e')]+_0x4fea30['limit'];var _0x4b248e;if(_0x3e867c>=_0x248fdb){_0x3e867c=_0x248fdb;_0x4b248e=0xc8;}else{_0x4b248e=0xce;}_0x42f237[_0x8b38('0x1c')](_0x4b248e);return _0x42f237['set']('Content-Range',_0x3a2d2c+'-'+_0x3e867c+'/'+_0x248fdb)[_0x8b38('0x1d')](_0x11a182);}return null;};}function patchUpdates(_0x112ab2){return function(_0x2ea24c){try{jsonpatch[_0x8b38('0x22')](_0x2ea24c,_0x112ab2,!![]);}catch(_0x5444c3){return BPromise[_0x8b38('0x23')](_0x5444c3);}return _0x2ea24c[_0x8b38('0x24')]();};}function saveUpdates(_0x4adf3f,_0x172722){return function(_0x3c7615){if(_0x3c7615){return _0x3c7615['update'](_0x4adf3f)[_0x8b38('0x25')](function(_0x50c4dc){return _0x50c4dc;});}return null;};}function removeEntity(_0x5968d8,_0x243b40){return function(_0x35422b){if(_0x35422b){return _0x35422b[_0x8b38('0x26')]()[_0x8b38('0x25')](function(){_0x5968d8[_0x8b38('0x1c')](0xcc)[_0x8b38('0x1b')]();});}};}function handleEntityNotFound(_0x9f0b57,_0x4ac595){return function(_0x1348c7){if(!_0x1348c7){_0x9f0b57['sendStatus'](0x194);}return _0x1348c7;};}function handleError(_0x29d14e,_0x2b92e6){_0x2b92e6=_0x2b92e6||0x1f4;return function(_0x456297){logger['error'](_0x456297[_0x8b38('0x27')]);if(_0x456297[_0x8b38('0x28')]){delete _0x456297[_0x8b38('0x28')];}_0x29d14e[_0x8b38('0x1c')](_0x2b92e6)[_0x8b38('0x29')](_0x456297);};}exports[_0x8b38('0x2a')]=function(_0x949f0f,_0x39277c){var _0x291296={},_0x14c7dc={},_0x4a8fa7={'count':0x0,'rows':[]};var _0x3d51cb=_[_0x8b38('0x2b')](db[_0x8b38('0x2c')][_0x8b38('0x2d')],function(_0xc41ce8){return{'name':_0xc41ce8[_0x8b38('0x2e')],'type':_0xc41ce8[_0x8b38('0x2f')]['key']};});_0x14c7dc[_0x8b38('0x30')]=_[_0x8b38('0x2b')](_0x3d51cb,'name');_0x14c7dc[_0x8b38('0x31')]=_[_0x8b38('0x32')](_0x949f0f[_0x8b38('0x31')]);_0x14c7dc[_0x8b38('0x33')]=_[_0x8b38('0x34')](_0x14c7dc['model'],_0x14c7dc[_0x8b38('0x31')]);_0x291296[_0x8b38('0x35')]=_[_0x8b38('0x34')](_0x14c7dc[_0x8b38('0x30')],qs[_0x8b38('0x36')](_0x949f0f[_0x8b38('0x31')]['fields']));_0x291296['attributes']=_0x291296[_0x8b38('0x35')][_0x8b38('0x37')]?_0x291296[_0x8b38('0x35')]:_0x14c7dc[_0x8b38('0x30')];if(!_0x949f0f[_0x8b38('0x31')][_0x8b38('0x38')]('nolimit')){_0x291296['limit']=qs[_0x8b38('0x20')](_0x949f0f[_0x8b38('0x31')]['limit']);_0x291296[_0x8b38('0x1e')]=qs['offset'](_0x949f0f[_0x8b38('0x31')][_0x8b38('0x1e')]);}_0x291296[_0x8b38('0x39')]=qs['sort'](_0x949f0f['query'][_0x8b38('0x3a')]);_0x291296[_0x8b38('0x3b')]=qs[_0x8b38('0x33')](_['pick'](_0x949f0f[_0x8b38('0x31')],_0x14c7dc[_0x8b38('0x33')]),_0x3d51cb);if(_0x949f0f[_0x8b38('0x31')][_0x8b38('0x3c')]){_0x291296['where']=_[_0x8b38('0x3d')](_0x291296['where'],{'$or':_[_0x8b38('0x2b')](_0x3d51cb,function(_0x318a4c){if(_0x318a4c[_0x8b38('0x2f')]!==_0x8b38('0x3e')){var _0x4513b5={};_0x4513b5[_0x318a4c[_0x8b38('0x28')]]={'$like':'%'+_0x949f0f[_0x8b38('0x31')]['filter']+'%'};return _0x4513b5;}})});}_0x291296=_[_0x8b38('0x3d')]({},_0x291296,_0x949f0f[_0x8b38('0x3f')]);var _0x1d1286={'where':_0x291296['where']};return db[_0x8b38('0x2c')]['count'](_0x1d1286)[_0x8b38('0x25')](function(_0x49ea85){_0x4a8fa7[_0x8b38('0x21')]=_0x49ea85;if(_0x949f0f[_0x8b38('0x31')][_0x8b38('0x40')]){_0x291296[_0x8b38('0x41')]=[{'all':!![]}];}return db[_0x8b38('0x2c')][_0x8b38('0x42')](_0x291296);})[_0x8b38('0x25')](function(_0x22bb23){_0x4a8fa7[_0x8b38('0x43')]=_0x22bb23;return _0x4a8fa7;})[_0x8b38('0x25')](respondWithFilteredResult(_0x39277c,_0x291296))[_0x8b38('0x44')](handleError(_0x39277c,null));};exports['show']=function(_0x12c3c0,_0x78e613){var _0x5a8445={'raw':!![],'where':{'id':_0x12c3c0[_0x8b38('0x45')]['id']}},_0x10cf1f={};_0x10cf1f[_0x8b38('0x30')]=_[_0x8b38('0x32')](db[_0x8b38('0x2c')][_0x8b38('0x2d')]);_0x10cf1f[_0x8b38('0x31')]=_[_0x8b38('0x32')](_0x12c3c0[_0x8b38('0x31')]);_0x10cf1f[_0x8b38('0x33')]=_[_0x8b38('0x34')](_0x10cf1f[_0x8b38('0x30')],_0x10cf1f[_0x8b38('0x31')]);_0x5a8445[_0x8b38('0x35')]=_['intersection'](_0x10cf1f[_0x8b38('0x30')],qs['fields'](_0x12c3c0['query']['fields']));_0x5a8445[_0x8b38('0x35')]=_0x5a8445[_0x8b38('0x35')][_0x8b38('0x37')]?_0x5a8445['attributes']:_0x10cf1f[_0x8b38('0x30')];if(_0x12c3c0[_0x8b38('0x31')][_0x8b38('0x40')]){_0x5a8445['include']=[{'all':!![]}];}_0x5a8445=_[_0x8b38('0x3d')]({},_0x5a8445,_0x12c3c0[_0x8b38('0x3f')]);return db[_0x8b38('0x2c')][_0x8b38('0x46')](_0x5a8445)[_0x8b38('0x25')](handleEntityNotFound(_0x78e613,null))[_0x8b38('0x25')](respondWithResult(_0x78e613,null))[_0x8b38('0x44')](handleError(_0x78e613,null));};exports['create']=function(_0x1b8897,_0x9bd033){return db[_0x8b38('0x2c')][_0x8b38('0x47')](_0x1b8897[_0x8b38('0x48')],{})[_0x8b38('0x25')](respondWithResult(_0x9bd033,0xc9))[_0x8b38('0x44')](handleError(_0x9bd033,null));};exports[_0x8b38('0x49')]=function(_0x1e2341,_0x25c985){if(_0x1e2341['body']['id']){delete _0x1e2341[_0x8b38('0x48')]['id'];}return db[_0x8b38('0x2c')][_0x8b38('0x46')]({'where':{'id':_0x1e2341[_0x8b38('0x45')]['id']}})['then'](handleEntityNotFound(_0x25c985,null))[_0x8b38('0x25')](saveUpdates(_0x1e2341[_0x8b38('0x48')],null))[_0x8b38('0x25')](respondWithResult(_0x25c985,null))['catch'](handleError(_0x25c985,null));};exports['destroy']=function(_0x171bf1,_0x1e66d8){return db[_0x8b38('0x2c')][_0x8b38('0x46')]({'where':{'id':_0x171bf1[_0x8b38('0x45')]['id']}})[_0x8b38('0x25')](handleEntityNotFound(_0x1e66d8,null))[_0x8b38('0x25')](removeEntity(_0x1e66d8,null))[_0x8b38('0x44')](handleError(_0x1e66d8,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 781d49b..d7a0479 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 _0x39f2=['util','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0x15ecef,_0x2caa8d){var _0xa7e71e=function(_0x38d9e1){while(--_0x38d9e1){_0x15ecef['push'](_0x15ecef['shift']());}};_0xa7e71e(++_0x2caa8d);}(_0x39f2,0x8b));var _0x239f=function(_0x52316d,_0x36dcec){_0x52316d=_0x52316d-0x0;var _0x1f5ab6=_0x39f2[_0x52316d];return _0x1f5ab6;};'use strict';var _=require(_0x239f('0x0'));var util=require(_0x239f('0x1'));var logger=require('../../config/logger')(_0x239f('0x2'));var moment=require('moment');var BPromise=require(_0x239f('0x3'));var rp=require(_0x239f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x239f('0x5'));var config=require(_0x239f('0x6'));var attributes=require(_0x239f('0x7'));module['exports']=function(_0x113767,_0x1a9813){return _0x113767[_0x239f('0x8')](_0x239f('0x9'),attributes,{'tableName':_0x239f('0xa'),'paranoid':![],'indexes':[{'name':_0x239f('0xb'),'fields':[_0x239f('0xc'),_0x239f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15e0=['api','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x15e0,0x1a2));var _0x015e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x15e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x015e('0x0'));var util=require('util');var logger=require(_0x015e('0x1'))(_0x015e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x015e('0x3'));var rimraf=require(_0x015e('0x4'));var config=require(_0x015e('0x5'));var attributes=require(_0x015e('0x6'));module[_0x015e('0x7')]=function(_0x29e570,_0x408ecc){return _0x29e570[_0x015e('0x8')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x015e('0x9'),'fields':[_0x015e('0xa'),_0x015e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 6316d93..47370f1 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 _0x9a29=['jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x5adeba,_0x49cda1){var _0x2e01f0=function(_0x3188db){while(--_0x3188db){_0x5adeba['push'](_0x5adeba['shift']());}};_0x2e01f0(++_0x49cda1);}(_0x9a29,0xc0));var _0x99a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a29[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x99a2('0x0'));var moment=require('moment');var BPromise=require(_0x99a2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99a2('0x2'));var db=require(_0x99a2('0x3'))['db'];var utils=require(_0x99a2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x99a2('0x5'));var jayson=require(_0x99a2('0x6'));var client=jayson[_0x99a2('0x7')][_0x99a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x281a37,_0x5b79e2,_0x24dccf){return new BPromise(function(_0x54a6b1,_0x502621){return client[_0x99a2('0x9')](_0x281a37,_0x24dccf)[_0x99a2('0xa')](function(_0x33eb62){logger[_0x99a2('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x5b79e2,_0x99a2('0xc'));logger[_0x99a2('0xd')](_0x99a2('0xe'),_0x5b79e2,_0x99a2('0xc'),JSON[_0x99a2('0xf')](_0x33eb62));if(_0x33eb62['error']){if(_0x33eb62[_0x99a2('0x10')][_0x99a2('0x11')]===0x1f4){logger[_0x99a2('0x10')](_0x99a2('0x12'),_0x5b79e2,_0x33eb62['error'][_0x99a2('0x13')]);return _0x502621(_0x33eb62[_0x99a2('0x10')][_0x99a2('0x13')]);}logger[_0x99a2('0x10')](_0x99a2('0x12'),_0x5b79e2,_0x33eb62[_0x99a2('0x10')][_0x99a2('0x13')]);return _0x54a6b1(_0x33eb62[_0x99a2('0x10')][_0x99a2('0x13')]);}else{logger[_0x99a2('0xb')](_0x99a2('0x12'),_0x5b79e2,_0x99a2('0xc'));_0x54a6b1(_0x33eb62[_0x99a2('0x14')][_0x99a2('0x13')]);}})[_0x99a2('0x15')](function(_0x8ce34c){logger[_0x99a2('0x10')](_0x99a2('0x12'),_0x5b79e2,_0x8ce34c);_0x502621(_0x8ce34c);});});} \ No newline at end of file +var _0x0503=['../../config/utils','jayson/promise','client','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x3d436a,_0x72e3af){var _0x38e741=function(_0x408464){while(--_0x408464){_0x3d436a['push'](_0x3d436a['shift']());}};_0x38e741(++_0x72e3af);}(_0x0503,0x1be));var _0x3050=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x0503[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x3050('0x0'));var util=require(_0x3050('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3050('0x2'));var db=require(_0x3050('0x3'))['db'];var utils=require(_0x3050('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3050('0x5'));var client=jayson[_0x3050('0x6')][_0x3050('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3cc4a0,_0x1c51bf,_0x5886cd){return new BPromise(function(_0x56f5a2,_0x5e05ed){return client['request'](_0x3cc4a0,_0x5886cd)['then'](function(_0x304bea){logger[_0x3050('0x8')](_0x3050('0x9'),_0x1c51bf,_0x3050('0xa'));logger[_0x3050('0xb')](_0x3050('0xc'),_0x1c51bf,_0x3050('0xa'),JSON[_0x3050('0xd')](_0x304bea));if(_0x304bea[_0x3050('0xe')]){if(_0x304bea['error'][_0x3050('0xf')]===0x1f4){logger['error'](_0x3050('0x9'),_0x1c51bf,_0x304bea[_0x3050('0xe')]['message']);return _0x5e05ed(_0x304bea[_0x3050('0xe')][_0x3050('0x10')]);}logger['error'](_0x3050('0x9'),_0x1c51bf,_0x304bea['error'][_0x3050('0x10')]);return _0x56f5a2(_0x304bea[_0x3050('0xe')]['message']);}else{logger[_0x3050('0x8')](_0x3050('0x9'),_0x1c51bf,_0x3050('0xa'));_0x56f5a2(_0x304bea['result'][_0x3050('0x10')]);}})[_0x3050('0x11')](function(_0x10a60e){logger['error'](_0x3050('0x9'),_0x1c51bf,_0x10a60e);_0x5e05ed(_0x10a60e);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e9a1fdf..dfb9d39 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 _0x177a=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','destroy'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x177a,0xdd));var _0xa177=function(_0x598188,_0x974837){_0x598188=_0x598188-0x0;var _0xa58f57=_0x177a[_0x598188];return _0xa58f57;};'use strict';var multer=require(_0xa177('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa177('0x1'));var express=require(_0xa177('0x2'));var router=express[_0xa177('0x3')]();var fs_extra=require(_0xa177('0x4'));var auth=require(_0xa177('0x5'));var interaction=require(_0xa177('0x6'));var config=require('../../config/environment');var controller=require(_0xa177('0x7'));router[_0xa177('0x8')]('/',auth[_0xa177('0x9')](),controller[_0xa177('0xa')]);router[_0xa177('0x8')](_0xa177('0xb'),auth[_0xa177('0x9')](),controller[_0xa177('0xc')]);router['get'](_0xa177('0xd'),auth['isAuthenticated'](),controller[_0xa177('0xe')]);router[_0xa177('0x8')](_0xa177('0xf'),auth[_0xa177('0x9')](),controller[_0xa177('0x10')]);router[_0xa177('0x11')]('/',auth[_0xa177('0x9')](),controller['create']);router[_0xa177('0x11')](_0xa177('0xd'),auth[_0xa177('0x9')](),controller[_0xa177('0x12')]);router[_0xa177('0x13')](_0xa177('0xb'),auth[_0xa177('0x9')](),controller['update']);router['delete'](_0xa177('0xb'),auth[_0xa177('0x9')](),controller[_0xa177('0x14')]);module[_0xa177('0x15')]=router; \ No newline at end of file +var _0x643f=['getFields','post','create','/:id/configurations','/:id','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','get','getConfigurations','/:id/fields'];(function(_0x54be4c,_0x46690a){var _0x37ee45=function(_0xd41ae7){while(--_0xd41ae7){_0x54be4c['push'](_0x54be4c['shift']());}};_0x37ee45(++_0x46690a);}(_0x643f,0x1e6));var _0xf643=function(_0x21edb7,_0x287951){_0x21edb7=_0x21edb7-0x0;var _0x16db99=_0x643f[_0x21edb7];return _0x16db99;};'use strict';var multer=require('multer');var util=require(_0xf643('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf643('0x1'));var router=express[_0xf643('0x2')]();var fs_extra=require(_0xf643('0x3'));var auth=require(_0xf643('0x4'));var interaction=require(_0xf643('0x5'));var config=require(_0xf643('0x6'));var controller=require(_0xf643('0x7'));router['get']('/',auth[_0xf643('0x8')](),controller[_0xf643('0x9')]);router['get']('/:id',auth[_0xf643('0x8')](),controller[_0xf643('0xa')]);router[_0xf643('0xb')]('/:id/configurations',auth[_0xf643('0x8')](),controller[_0xf643('0xc')]);router[_0xf643('0xb')](_0xf643('0xd'),auth[_0xf643('0x8')](),controller[_0xf643('0xe')]);router[_0xf643('0xf')]('/',auth[_0xf643('0x8')](),controller[_0xf643('0x10')]);router[_0xf643('0xf')](_0xf643('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xf643('0x8')](),controller['update']);router['delete'](_0xf643('0x12'),auth[_0xf643('0x8')](),controller['destroy']);module[_0xf643('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 3476166..9f4b4e8 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 _0x5faf=['sequelize','exports','STRING','HelpDesk'];(function(_0x267d83,_0x13ff55){var _0x20c5a1=function(_0xb150a9){while(--_0xb150a9){_0x267d83['push'](_0x267d83['shift']());}};_0x20c5a1(++_0x13ff55);}(_0x5faf,0xcc));var _0xf5fa=function(_0x18076e,_0x3121f7){_0x18076e=_0x18076e-0x0;var _0x6b6a3d=_0x5faf[_0x18076e];return _0x6b6a3d;};'use strict';var Sequelize=require(_0xf5fa('0x0'));module[_0xf5fa('0x1')]={'name':{'type':Sequelize[_0xf5fa('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf5fa('0x2')]},'username':{'type':Sequelize[_0xf5fa('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf5fa('0x2')],'allowNull':![],'defaultValue':_0xf5fa('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf5fa('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1f82=['exports','STRING','HelpDesk','sequelize'];(function(_0x1e0139,_0x4970a3){var _0xbfc2ba=function(_0x20ee9e){while(--_0x20ee9e){_0x1e0139['push'](_0x1e0139['shift']());}};_0xbfc2ba(++_0x4970a3);}(_0x1f82,0x113));var _0x21f8=function(_0x3a77ce,_0x486ee8){_0x3a77ce=_0x3a77ce-0x0;var _0xe885c7=_0x1f82[_0x3a77ce];return _0xe885c7;};'use strict';var Sequelize=require(_0x21f8('0x0'));module[_0x21f8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x21f8('0x2')]},'username':{'type':Sequelize[_0x21f8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x21f8('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'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 2b4e1e3..a4d3e08 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 _0x2a2d=['picklist','picklistValues','value','log','test','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','rawAttributes','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','success','sessionName','autogenerated','reference','owner','remove','includes','editable','label','startsWith','cf_'];(function(_0x4270fe,_0x5646b5){var _0x3324b0=function(_0x40fa12){while(--_0x40fa12){_0x4270fe['push'](_0x4270fe['shift']());}};_0x3324b0(++_0x5646b5);}(_0x2a2d,0x7b));var _0xd2a2=function(_0x229a03,_0x36fefc){_0x229a03=_0x229a03-0x0;var _0x2d6e11=_0x2a2d[_0x229a03];return _0x2d6e11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2a2('0x0'));var zipdir=require(_0xd2a2('0x1'));var jsonpatch=require(_0xd2a2('0x2'));var rp=require(_0xd2a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd2a2('0x4'));var util=require(_0xd2a2('0x5'));var path=require('path');var sox=require(_0xd2a2('0x6'));var csv=require(_0xd2a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2a2('0x8'));var _=require(_0xd2a2('0x9'));var squel=require('squel');var crypto=require(_0xd2a2('0xa'));var jsforce=require(_0xd2a2('0xb'));var deskjs=require(_0xd2a2('0xc'));var toCsv=require(_0xd2a2('0x7'));var querystring=require(_0xd2a2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2a2('0xe'));var logger=require(_0xd2a2('0xf'))(_0xd2a2('0x10'));var utils=require(_0xd2a2('0x11'));var config=require(_0xd2a2('0x12'));var licenseUtil=require(_0xd2a2('0x13'));var db=require(_0xd2a2('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x385e84,_0x7739b5){_0x7739b5=_0x7739b5||0xcc;return function(_0x5200cb){if(_0x5200cb){return _0x385e84['sendStatus'](_0x7739b5);}return _0x385e84[_0xd2a2('0x15')](_0x7739b5)[_0xd2a2('0x16')]();};}function respondWithResult(_0x5e042d,_0x2e9091){_0x2e9091=_0x2e9091||0xc8;return function(_0x1b5277){if(_0x1b5277){return _0x5e042d['status'](_0x2e9091)[_0xd2a2('0x17')](_0x1b5277);}};}function respondWithFilteredResult(_0x48437b,_0x2f7275){return function(_0x4ed030){if(_0x4ed030){var _0x36b4e7=typeof _0x2f7275[_0xd2a2('0x18')]===_0xd2a2('0x19')&&typeof _0x2f7275[_0xd2a2('0x1a')]==='undefined';var _0x17bddd=_0x4ed030['count'];var _0x3d09fe=_0x36b4e7?0x0:_0x2f7275['offset'];var _0x3eef83=_0x36b4e7?_0x4ed030['count']:_0x2f7275[_0xd2a2('0x18')]+_0x2f7275[_0xd2a2('0x1a')];var _0x2ee3ce;if(_0x3eef83>=_0x17bddd){_0x3eef83=_0x17bddd;_0x2ee3ce=0xc8;}else{_0x2ee3ce=0xce;}_0x48437b[_0xd2a2('0x15')](_0x2ee3ce);return _0x48437b[_0xd2a2('0x1b')](_0xd2a2('0x1c'),_0x3d09fe+'-'+_0x3eef83+'/'+_0x17bddd)[_0xd2a2('0x17')](_0x4ed030);}return null;};}function patchUpdates(_0x2f218c){return function(_0x892cd9){try{jsonpatch['apply'](_0x892cd9,_0x2f218c,!![]);}catch(_0x559fa2){return BPromise[_0xd2a2('0x1d')](_0x559fa2);}return _0x892cd9[_0xd2a2('0x1e')]();};}function saveUpdates(_0x1bf078,_0x5a16b7){return function(_0xd2c934){if(_0xd2c934){return _0xd2c934[_0xd2a2('0x1f')](_0x1bf078)[_0xd2a2('0x20')](function(_0x4745cb){return _0x4745cb;});}return null;};}function removeEntity(_0x970900,_0xfcb6f6){return function(_0x4e6581){if(_0x4e6581){return _0x4e6581[_0xd2a2('0x21')]()[_0xd2a2('0x20')](function(){_0x970900['status'](0xcc)[_0xd2a2('0x16')]();});}};}function handleEntityNotFound(_0x164dad,_0x23106d){return function(_0x43a970){if(!_0x43a970){_0x164dad[_0xd2a2('0x22')](0x194);}return _0x43a970;};}function handleError(_0x120139,_0x1b7943){_0x1b7943=_0x1b7943||0x1f4;return function(_0x779e35){logger[_0xd2a2('0x23')](_0x779e35[_0xd2a2('0x24')]);if(_0x779e35['name']){delete _0x779e35[_0xd2a2('0x25')];}_0x120139[_0xd2a2('0x15')](_0x1b7943)[_0xd2a2('0x26')](_0x779e35);};}exports[_0xd2a2('0x27')]=function(_0x7458f,_0x1cffb4){var _0x3ef812={},_0x5ef31b={},_0x2fb708={'count':0x0,'rows':[]};var _0xd502bd=_[_0xd2a2('0x28')](db[_0xd2a2('0x29')]['rawAttributes'],function(_0x2cd702){return{'name':_0x2cd702[_0xd2a2('0x2a')],'type':_0x2cd702[_0xd2a2('0x2b')]['key']};});_0x5ef31b[_0xd2a2('0x2c')]=_[_0xd2a2('0x28')](_0xd502bd,_0xd2a2('0x25'));_0x5ef31b[_0xd2a2('0x2d')]=_[_0xd2a2('0x2e')](_0x7458f[_0xd2a2('0x2d')]);_0x5ef31b[_0xd2a2('0x2f')]=_['intersection'](_0x5ef31b[_0xd2a2('0x2c')],_0x5ef31b[_0xd2a2('0x2d')]);_0x3ef812['attributes']=_[_0xd2a2('0x30')](_0x5ef31b[_0xd2a2('0x2c')],qs[_0xd2a2('0x31')](_0x7458f[_0xd2a2('0x2d')][_0xd2a2('0x31')]));_0x3ef812[_0xd2a2('0x32')]=_0x3ef812[_0xd2a2('0x32')][_0xd2a2('0x33')]?_0x3ef812['attributes']:_0x5ef31b[_0xd2a2('0x2c')];if(!_0x7458f['query'][_0xd2a2('0x34')](_0xd2a2('0x35'))){_0x3ef812[_0xd2a2('0x1a')]=qs['limit'](_0x7458f[_0xd2a2('0x2d')]['limit']);_0x3ef812['offset']=qs[_0xd2a2('0x18')](_0x7458f[_0xd2a2('0x2d')]['offset']);}_0x3ef812[_0xd2a2('0x36')]=qs[_0xd2a2('0x37')](_0x7458f[_0xd2a2('0x2d')][_0xd2a2('0x37')]);_0x3ef812[_0xd2a2('0x38')]=qs[_0xd2a2('0x2f')](_[_0xd2a2('0x39')](_0x7458f[_0xd2a2('0x2d')],_0x5ef31b['filters']),_0xd502bd);if(_0x7458f[_0xd2a2('0x2d')][_0xd2a2('0x3a')]){_0x3ef812[_0xd2a2('0x38')]=_[_0xd2a2('0x3b')](_0x3ef812[_0xd2a2('0x38')],{'$or':_[_0xd2a2('0x28')](_0xd502bd,function(_0x45945f){if(_0x45945f[_0xd2a2('0x2b')]!==_0xd2a2('0x3c')){var _0x419ac4={};_0x419ac4[_0x45945f['name']]={'$like':'%'+_0x7458f[_0xd2a2('0x2d')]['filter']+'%'};return _0x419ac4;}})});}_0x3ef812=_[_0xd2a2('0x3b')]({},_0x3ef812,_0x7458f[_0xd2a2('0x3d')]);var _0x1bfd39={'where':_0x3ef812[_0xd2a2('0x38')]};return db[_0xd2a2('0x29')][_0xd2a2('0x3e')](_0x1bfd39)['then'](function(_0x11450e){_0x2fb708[_0xd2a2('0x3e')]=_0x11450e;if(_0x7458f[_0xd2a2('0x2d')][_0xd2a2('0x3f')]){_0x3ef812[_0xd2a2('0x40')]=[{'all':!![]}];}return db[_0xd2a2('0x29')]['findAll'](_0x3ef812);})[_0xd2a2('0x20')](function(_0x25fa45){_0x2fb708[_0xd2a2('0x41')]=_0x25fa45;return _0x2fb708;})['then'](respondWithFilteredResult(_0x1cffb4,_0x3ef812))[_0xd2a2('0x42')](handleError(_0x1cffb4,null));};exports[_0xd2a2('0x43')]=function(_0x8a5cfe,_0x27f006){var _0x47be0b={'raw':![],'where':{'id':_0x8a5cfe[_0xd2a2('0x44')]['id']}},_0x43d0f2={};_0x43d0f2[_0xd2a2('0x2c')]=_[_0xd2a2('0x2e')](db['VtigerAccount']['rawAttributes']);_0x43d0f2[_0xd2a2('0x2d')]=_['keys'](_0x8a5cfe[_0xd2a2('0x2d')]);_0x43d0f2['filters']=_[_0xd2a2('0x30')](_0x43d0f2[_0xd2a2('0x2c')],_0x43d0f2['query']);_0x47be0b[_0xd2a2('0x32')]=_['intersection'](_0x43d0f2[_0xd2a2('0x2c')],qs[_0xd2a2('0x31')](_0x8a5cfe['query'][_0xd2a2('0x31')]));_0x47be0b[_0xd2a2('0x32')]=_0x47be0b['attributes'][_0xd2a2('0x33')]?_0x47be0b['attributes']:_0x43d0f2[_0xd2a2('0x2c')];if(_0x8a5cfe[_0xd2a2('0x2d')][_0xd2a2('0x3f')]){_0x47be0b[_0xd2a2('0x40')]=[{'all':!![]}];}_0x47be0b=_[_0xd2a2('0x3b')]({},_0x47be0b,_0x8a5cfe[_0xd2a2('0x3d')]);return db[_0xd2a2('0x29')][_0xd2a2('0x45')](_0x47be0b)['then'](handleEntityNotFound(_0x27f006,null))[_0xd2a2('0x20')](respondWithResult(_0x27f006,null))[_0xd2a2('0x42')](handleError(_0x27f006,null));};exports[_0xd2a2('0x46')]=function(_0x12ea3c,_0x1bc703){return db[_0xd2a2('0x29')][_0xd2a2('0x46')](_0x12ea3c[_0xd2a2('0x47')],{})[_0xd2a2('0x20')](respondWithResult(_0x1bc703,0xc9))['catch'](handleError(_0x1bc703,null));};exports[_0xd2a2('0x1f')]=function(_0x3c20d1,_0x5195f6){if(_0x3c20d1['body']['id']){delete _0x3c20d1[_0xd2a2('0x47')]['id'];}return db['VtigerAccount'][_0xd2a2('0x45')]({'where':{'id':_0x3c20d1[_0xd2a2('0x44')]['id']}})[_0xd2a2('0x20')](handleEntityNotFound(_0x5195f6,null))['then'](saveUpdates(_0x3c20d1[_0xd2a2('0x47')],null))[_0xd2a2('0x20')](respondWithResult(_0x5195f6,null))[_0xd2a2('0x42')](handleError(_0x5195f6,null));};exports['destroy']=function(_0x37a66b,_0x282772){return db[_0xd2a2('0x29')][_0xd2a2('0x45')]({'where':{'id':_0x37a66b[_0xd2a2('0x44')]['id']}})[_0xd2a2('0x20')](handleEntityNotFound(_0x282772,null))[_0xd2a2('0x20')](removeEntity(_0x282772,null))[_0xd2a2('0x42')](handleError(_0x282772,null));};exports[_0xd2a2('0x48')]=function(_0x5711a1,_0x388d2b,_0x13f5fb){var _0x3e18e9={};var _0x4ac870={};var _0x170874;var _0x25995a;return db[_0xd2a2('0x29')][_0xd2a2('0x49')]({'where':{'id':_0x5711a1[_0xd2a2('0x44')]['id']}})[_0xd2a2('0x20')](handleEntityNotFound(_0x388d2b,null))[_0xd2a2('0x20')](function(_0x4a4725){if(_0x4a4725){_0x170874=_0x4a4725;_0x4ac870[_0xd2a2('0x2c')]=_[_0xd2a2('0x2e')](db[_0xd2a2('0x4a')][_0xd2a2('0x4b')]);_0x4ac870['query']=_[_0xd2a2('0x2e')](_0x5711a1[_0xd2a2('0x2d')]);_0x4ac870[_0xd2a2('0x2f')]=_[_0xd2a2('0x30')](_0x4ac870['model'],_0x4ac870[_0xd2a2('0x2d')]);_0x3e18e9[_0xd2a2('0x32')]=_['intersection'](_0x4ac870[_0xd2a2('0x2c')],qs[_0xd2a2('0x31')](_0x5711a1[_0xd2a2('0x2d')][_0xd2a2('0x31')]));_0x3e18e9[_0xd2a2('0x32')]=_0x3e18e9[_0xd2a2('0x32')]['length']?_0x3e18e9[_0xd2a2('0x32')]:_0x4ac870[_0xd2a2('0x2c')];_0x3e18e9[_0xd2a2('0x36')]=qs[_0xd2a2('0x37')](_0x5711a1[_0xd2a2('0x2d')][_0xd2a2('0x37')]);_0x3e18e9[_0xd2a2('0x38')]=qs[_0xd2a2('0x2f')](_[_0xd2a2('0x39')](_0x5711a1[_0xd2a2('0x2d')],_0x4ac870[_0xd2a2('0x2f')]));if(_0x5711a1[_0xd2a2('0x2d')][_0xd2a2('0x3a')]){_0x3e18e9[_0xd2a2('0x38')]=_[_0xd2a2('0x3b')](_0x3e18e9[_0xd2a2('0x38')],{'$or':_[_0xd2a2('0x28')](_0x3e18e9[_0xd2a2('0x32')],function(_0x5a358f){var _0x333d59={};_0x333d59[_0x5a358f]={'$like':'%'+_0x5711a1[_0xd2a2('0x2d')]['filter']+'%'};return _0x333d59;})});}_0x3e18e9=_['merge']({},_0x3e18e9,_0x5711a1['options']);return _0x170874[_0xd2a2('0x48')](_0x3e18e9);}})[_0xd2a2('0x20')](function(_0x1345db){if(_0x1345db){_0x25995a=_0x1345db[_0xd2a2('0x33')];if(!_0x5711a1['query'][_0xd2a2('0x34')]('nolimit')){_0x3e18e9[_0xd2a2('0x1a')]=qs['limit'](_0x5711a1[_0xd2a2('0x2d')]['limit']);_0x3e18e9[_0xd2a2('0x18')]=qs[_0xd2a2('0x18')](_0x5711a1[_0xd2a2('0x2d')][_0xd2a2('0x18')]);}return _0x170874[_0xd2a2('0x48')](_0x3e18e9);}})[_0xd2a2('0x20')](function(_0x817453){if(_0x817453){return _0x817453?{'count':_0x25995a,'rows':_0x817453}:null;}})[_0xd2a2('0x20')](respondWithResult(_0x388d2b,null))[_0xd2a2('0x42')](handleError(_0x388d2b,null));};exports['addConfiguration']=function(_0x4cc4c9,_0x2caf74,_0x10661c){if(_0x4cc4c9[_0xd2a2('0x47')]['id']){delete _0x4cc4c9['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x4cc4c9[_0xd2a2('0x44')]['id']}})[_0xd2a2('0x20')](handleEntityNotFound(_0x2caf74,null))[_0xd2a2('0x20')](function(_0x14f9a8){if(_0x14f9a8){_0x4cc4c9[_0xd2a2('0x47')][_0xd2a2('0x4c')]=_0x14f9a8['id'];_0x4cc4c9[_0xd2a2('0x47')][_0xd2a2('0x4d')]=integrations[_0xd2a2('0x4e')](_0x4cc4c9['body'][_0xd2a2('0x4f')],_0x4cc4c9['body'][_0xd2a2('0x2b')]);_0x4cc4c9['body']['Descriptions']=integrations[_0xd2a2('0x50')](_0x4cc4c9[_0xd2a2('0x47')]['channel'],_0x4cc4c9['body'][_0xd2a2('0x2b')]);return db[_0xd2a2('0x4a')][_0xd2a2('0x46')](_0x4cc4c9['body'],{'include':[{'model':db['VtigerField'],'as':_0xd2a2('0x4d')},{'model':db['VtigerField'],'as':_0xd2a2('0x51')}]});}return null;})['then'](respondWithResult(_0x2caf74,null))[_0xd2a2('0x42')](handleError(_0x2caf74,null));};var md5=require('md5');exports[_0xd2a2('0x52')]=function(_0x55cd88,_0xbcab7c,_0x4d5cd0){var _0xc67a0a=null;var _0x5ccb16=null;var _0x402799=null;var _0x14780c=null;var _0x5596bd='';return db[_0xd2a2('0x29')][_0xd2a2('0x49')]({'where':{'id':_0x55cd88[_0xd2a2('0x44')]['id']},'attributes':['id',_0xd2a2('0x25'),_0xd2a2('0x53'),_0xd2a2('0x54'),_0xd2a2('0x55'),_0xd2a2('0x56'),'serverUrl',_0xd2a2('0x57')]})[_0xd2a2('0x20')](handleEntityNotFound(_0xbcab7c,null))[_0xd2a2('0x20')](function(_0x4d9343){if(_0x4d9343){_0xc67a0a=_0x4d9343[_0xd2a2('0x53')];_0x5ccb16=_0x4d9343[_0xd2a2('0x57')];_0x402799=_0x4d9343[_0xd2a2('0x55')];_0x5596bd=_0x4d9343[_0xd2a2('0x56')];var _0x5c45d9=_0x5596bd[_0xd2a2('0x58')](-0x1);if(_0x5c45d9==='/'){_0x5596bd=_0x5596bd[_0xd2a2('0x59')](0x0,_0x5596bd[_0xd2a2('0x5a')](_0x5c45d9));}_0x14780c=util[_0xd2a2('0x5b')](_0xd2a2('0x5c'),_0x5596bd);var _0x5afe3c={'method':_0xd2a2('0x5d'),'uri':_0x14780c,'qs':{'operation':_0xd2a2('0x5e'),'username':_0x4d9343[_0xd2a2('0x53')]},'json':!![]};return rp(_0x5afe3c);}})[_0xd2a2('0x20')](function(_0x5806af){if(_0x5806af['success']){var _0x628f83={'method':_0xd2a2('0x5f'),'uri':_0x14780c,'form':{'operation':_0xd2a2('0x60'),'username':_0xc67a0a,'accessKey':md5(_0x5806af[_0xd2a2('0x61')]['token']+_0x5ccb16)},'json':!![]};return rp(_0x628f83);}})['then'](function(_0x259252){if(_0x259252[_0xd2a2('0x62')]){var _0xdadcd4={'method':'GET','uri':_0x14780c,'qs':{'operation':'describe','username':_0xc67a0a,'sessionName':_0x259252[_0xd2a2('0x61')][_0xd2a2('0x63')],'elementType':_0x402799},'json':!![]};return rp(_0xdadcd4);}})[_0xd2a2('0x20')](function(_0x370006){if(_0x370006[_0xd2a2('0x62')]){var _0x436f33=[_0xd2a2('0x64'),_0xd2a2('0x65'),_0xd2a2('0x66')];_[_0xd2a2('0x67')](_0x370006['result'][_0xd2a2('0x31')],function(_0x5929c9){return _0x436f33[_0xd2a2('0x68')](_0x5929c9[_0xd2a2('0x2b')]['name']);});_[_0xd2a2('0x67')](_0x370006[_0xd2a2('0x61')][_0xd2a2('0x31')],function(_0x5c9d4b){return _0x5c9d4b[_0xd2a2('0x69')]==='false';});return{'count':_0x370006[_0xd2a2('0x61')][_0xd2a2('0x31')]['length'],'rows':_[_0xd2a2('0x28')](_0x370006[_0xd2a2('0x61')][_0xd2a2('0x31')],function(_0x10f0f2){return{'id':_0x10f0f2['name'],'name':_0x10f0f2[_0xd2a2('0x6a')],'custom':_[_0xd2a2('0x6b')](_0x10f0f2['name'],_0xd2a2('0x6c'))?!![]:![],'options':_0x10f0f2[_0xd2a2('0x2b')]['name']===_0xd2a2('0x6d')&&_0x10f0f2[_0xd2a2('0x2b')][_0xd2a2('0x6e')][_0xd2a2('0x33')]>0x0?_[_0xd2a2('0x28')](_0x10f0f2[_0xd2a2('0x2b')]['picklistValues'],function(_0x15da0f){return{'name':_0x15da0f[_0xd2a2('0x6a')],'value':_0x15da0f[_0xd2a2('0x6f')]};}):[]};})};}})['then'](respondWithResult(_0xbcab7c,null))[_0xd2a2('0x42')](function(_0x27e2f1){console[_0xd2a2('0x70')]('vTiger\x20error:\x20'+_0x27e2f1);var _0x594475=_0x55cd88[_0xd2a2('0x2d')][_0xd2a2('0x71')]?0x1f4:_0x27e2f1['statusCode']||0x1f4;logger[_0xd2a2('0x23')](_0xd2a2('0x72'),'getFields',_0x594475,JSON[_0xd2a2('0x73')](_0x27e2f1));delete _0x27e2f1[_0xd2a2('0x25')];if(_0x594475===0x191){_0x594475=0x190;}_0xbcab7c[_0xd2a2('0x15')](_0x594475)['send'](_0x55cd88[_0xd2a2('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x27e2f1['statusCode']}:_0x27e2f1);});}; \ No newline at end of file +var _0xa911=['owner','remove','includes','editable','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','params','includeAll','include','find','create','body','findOne','VtigerConfiguration','options','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','login','token','describe','result','autogenerated','reference'];(function(_0x4f78de,_0x360df5){var _0x30adda=function(_0x3270a7){while(--_0x3270a7){_0x4f78de['push'](_0x4f78de['shift']());}};_0x30adda(++_0x360df5);}(_0xa911,0x10b));var _0x1a91=function(_0x27c559,_0x13d5e6){_0x27c559=_0x27c559-0x0;var _0x1eb295=_0xa911[_0x27c559];return _0x1eb295;};'use strict';var emlformat=require(_0x1a91('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1a91('0x1'));var rp=require('request-promise');var moment=require(_0x1a91('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1a91('0x3'));var util=require(_0x1a91('0x4'));var path=require(_0x1a91('0x5'));var sox=require(_0x1a91('0x6'));var csv=require('to-csv');var ejs=require(_0x1a91('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a91('0x8'));var squel=require(_0x1a91('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1a91('0xa'));var toCsv=require(_0x1a91('0xb'));var querystring=require(_0x1a91('0xc'));var Papa=require('papaparse');var Redis=require(_0x1a91('0xd'));var authService=require(_0x1a91('0xe'));var qs=require(_0x1a91('0xf'));var as=require(_0x1a91('0x10'));var hardwareService=require(_0x1a91('0x11'));var logger=require('../../config/logger')(_0x1a91('0x12'));var utils=require(_0x1a91('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1a91('0x14'));var db=require(_0x1a91('0x15'))['db'];var integrations=require(_0x1a91('0x16'));function respondWithStatusCode(_0x3e8a8d,_0x5c6424){_0x5c6424=_0x5c6424||0xcc;return function(_0x112d3c){if(_0x112d3c){return _0x3e8a8d[_0x1a91('0x17')](_0x5c6424);}return _0x3e8a8d['status'](_0x5c6424)[_0x1a91('0x18')]();};}function respondWithResult(_0x269063,_0x343414){_0x343414=_0x343414||0xc8;return function(_0x48d05e){if(_0x48d05e){return _0x269063[_0x1a91('0x19')](_0x343414)[_0x1a91('0x1a')](_0x48d05e);}};}function respondWithFilteredResult(_0xdf1f52,_0x2ec3d7){return function(_0x30c98a){if(_0x30c98a){var _0x541713=typeof _0x2ec3d7[_0x1a91('0x1b')]===_0x1a91('0x1c')&&typeof _0x2ec3d7[_0x1a91('0x1d')]===_0x1a91('0x1c');var _0x48ea57=_0x30c98a[_0x1a91('0x1e')];var _0x1e082c=_0x541713?0x0:_0x2ec3d7[_0x1a91('0x1b')];var _0x53665a=_0x541713?_0x30c98a['count']:_0x2ec3d7['offset']+_0x2ec3d7['limit'];var _0x12b9b4;if(_0x53665a>=_0x48ea57){_0x53665a=_0x48ea57;_0x12b9b4=0xc8;}else{_0x12b9b4=0xce;}_0xdf1f52[_0x1a91('0x19')](_0x12b9b4);return _0xdf1f52[_0x1a91('0x1f')](_0x1a91('0x20'),_0x1e082c+'-'+_0x53665a+'/'+_0x48ea57)[_0x1a91('0x1a')](_0x30c98a);}return null;};}function patchUpdates(_0x250c07){return function(_0xd89b57){try{jsonpatch[_0x1a91('0x21')](_0xd89b57,_0x250c07,!![]);}catch(_0x43853d){return BPromise[_0x1a91('0x22')](_0x43853d);}return _0xd89b57[_0x1a91('0x23')]();};}function saveUpdates(_0x4f4bcf,_0x8770d6){return function(_0x1aae79){if(_0x1aae79){return _0x1aae79[_0x1a91('0x24')](_0x4f4bcf)[_0x1a91('0x25')](function(_0x51a570){return _0x51a570;});}return null;};}function removeEntity(_0x5ccf1b,_0x1068b3){return function(_0x4a806f){if(_0x4a806f){return _0x4a806f[_0x1a91('0x26')]()[_0x1a91('0x25')](function(){_0x5ccf1b['status'](0xcc)[_0x1a91('0x18')]();});}};}function handleEntityNotFound(_0x347e95,_0x3e7c21){return function(_0x4b4cae){if(!_0x4b4cae){_0x347e95[_0x1a91('0x17')](0x194);}return _0x4b4cae;};}function handleError(_0x7a65dd,_0x214c1e){_0x214c1e=_0x214c1e||0x1f4;return function(_0x5aaecc){logger[_0x1a91('0x27')](_0x5aaecc[_0x1a91('0x28')]);if(_0x5aaecc[_0x1a91('0x29')]){delete _0x5aaecc[_0x1a91('0x29')];}_0x7a65dd['status'](_0x214c1e)[_0x1a91('0x2a')](_0x5aaecc);};}exports[_0x1a91('0x2b')]=function(_0x20094c,_0x35ddf7){var _0xf45121={},_0x66a7ff={},_0x396af1={'count':0x0,'rows':[]};var _0x399848=_[_0x1a91('0x2c')](db[_0x1a91('0x2d')][_0x1a91('0x2e')],function(_0x53969b){return{'name':_0x53969b[_0x1a91('0x2f')],'type':_0x53969b[_0x1a91('0x30')][_0x1a91('0x31')]};});_0x66a7ff[_0x1a91('0x32')]=_[_0x1a91('0x2c')](_0x399848,_0x1a91('0x29'));_0x66a7ff[_0x1a91('0x33')]=_[_0x1a91('0x34')](_0x20094c[_0x1a91('0x33')]);_0x66a7ff[_0x1a91('0x35')]=_[_0x1a91('0x36')](_0x66a7ff[_0x1a91('0x32')],_0x66a7ff[_0x1a91('0x33')]);_0xf45121[_0x1a91('0x37')]=_[_0x1a91('0x36')](_0x66a7ff[_0x1a91('0x32')],qs[_0x1a91('0x38')](_0x20094c['query'][_0x1a91('0x38')]));_0xf45121[_0x1a91('0x37')]=_0xf45121[_0x1a91('0x37')][_0x1a91('0x39')]?_0xf45121[_0x1a91('0x37')]:_0x66a7ff['model'];if(!_0x20094c[_0x1a91('0x33')][_0x1a91('0x3a')]('nolimit')){_0xf45121[_0x1a91('0x1d')]=qs['limit'](_0x20094c[_0x1a91('0x33')][_0x1a91('0x1d')]);_0xf45121[_0x1a91('0x1b')]=qs[_0x1a91('0x1b')](_0x20094c[_0x1a91('0x33')][_0x1a91('0x1b')]);}_0xf45121[_0x1a91('0x3b')]=qs[_0x1a91('0x3c')](_0x20094c[_0x1a91('0x33')][_0x1a91('0x3c')]);_0xf45121[_0x1a91('0x3d')]=qs[_0x1a91('0x35')](_[_0x1a91('0x3e')](_0x20094c[_0x1a91('0x33')],_0x66a7ff['filters']),_0x399848);if(_0x20094c['query'][_0x1a91('0x3f')]){_0xf45121[_0x1a91('0x3d')]=_[_0x1a91('0x40')](_0xf45121[_0x1a91('0x3d')],{'$or':_['map'](_0x399848,function(_0x45ea81){if(_0x45ea81[_0x1a91('0x30')]!==_0x1a91('0x41')){var _0x280dff={};_0x280dff[_0x45ea81['name']]={'$like':'%'+_0x20094c[_0x1a91('0x33')]['filter']+'%'};return _0x280dff;}})});}_0xf45121=_['merge']({},_0xf45121,_0x20094c['options']);var _0x37b2ac={'where':_0xf45121[_0x1a91('0x3d')]};return db[_0x1a91('0x2d')]['count'](_0x37b2ac)[_0x1a91('0x25')](function(_0x723ecf){_0x396af1[_0x1a91('0x1e')]=_0x723ecf;if(_0x20094c[_0x1a91('0x33')]['includeAll']){_0xf45121['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x1a91('0x42')](_0xf45121);})[_0x1a91('0x25')](function(_0x425620){_0x396af1[_0x1a91('0x43')]=_0x425620;return _0x396af1;})[_0x1a91('0x25')](respondWithFilteredResult(_0x35ddf7,_0xf45121))[_0x1a91('0x44')](handleError(_0x35ddf7,null));};exports['show']=function(_0x550010,_0x3cfa77){var _0x17b52c={'raw':![],'where':{'id':_0x550010[_0x1a91('0x45')]['id']}},_0x1e82c4={};_0x1e82c4[_0x1a91('0x32')]=_['keys'](db[_0x1a91('0x2d')][_0x1a91('0x2e')]);_0x1e82c4[_0x1a91('0x33')]=_['keys'](_0x550010[_0x1a91('0x33')]);_0x1e82c4[_0x1a91('0x35')]=_[_0x1a91('0x36')](_0x1e82c4[_0x1a91('0x32')],_0x1e82c4[_0x1a91('0x33')]);_0x17b52c['attributes']=_['intersection'](_0x1e82c4[_0x1a91('0x32')],qs[_0x1a91('0x38')](_0x550010[_0x1a91('0x33')][_0x1a91('0x38')]));_0x17b52c[_0x1a91('0x37')]=_0x17b52c[_0x1a91('0x37')][_0x1a91('0x39')]?_0x17b52c[_0x1a91('0x37')]:_0x1e82c4[_0x1a91('0x32')];if(_0x550010[_0x1a91('0x33')][_0x1a91('0x46')]){_0x17b52c[_0x1a91('0x47')]=[{'all':!![]}];}_0x17b52c=_[_0x1a91('0x40')]({},_0x17b52c,_0x550010['options']);return db[_0x1a91('0x2d')][_0x1a91('0x48')](_0x17b52c)['then'](handleEntityNotFound(_0x3cfa77,null))[_0x1a91('0x25')](respondWithResult(_0x3cfa77,null))[_0x1a91('0x44')](handleError(_0x3cfa77,null));};exports[_0x1a91('0x49')]=function(_0x1d4a6f,_0x557310){return db['VtigerAccount']['create'](_0x1d4a6f[_0x1a91('0x4a')],{})[_0x1a91('0x25')](respondWithResult(_0x557310,0xc9))[_0x1a91('0x44')](handleError(_0x557310,null));};exports[_0x1a91('0x24')]=function(_0x5c4893,_0x29fb8c){if(_0x5c4893[_0x1a91('0x4a')]['id']){delete _0x5c4893[_0x1a91('0x4a')]['id'];}return db['VtigerAccount'][_0x1a91('0x48')]({'where':{'id':_0x5c4893['params']['id']}})['then'](handleEntityNotFound(_0x29fb8c,null))[_0x1a91('0x25')](saveUpdates(_0x5c4893[_0x1a91('0x4a')],null))['then'](respondWithResult(_0x29fb8c,null))[_0x1a91('0x44')](handleError(_0x29fb8c,null));};exports['destroy']=function(_0x2405b4,_0x4ea90d){return db['VtigerAccount']['find']({'where':{'id':_0x2405b4[_0x1a91('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ea90d,null))[_0x1a91('0x25')](removeEntity(_0x4ea90d,null))[_0x1a91('0x44')](handleError(_0x4ea90d,null));};exports['getConfigurations']=function(_0x40088f,_0x4d3d9c,_0x27ffb7){var _0x3aa3db={};var _0x3b62d1={};var _0x2b986d;var _0x58942a;return db[_0x1a91('0x2d')][_0x1a91('0x4b')]({'where':{'id':_0x40088f['params']['id']}})['then'](handleEntityNotFound(_0x4d3d9c,null))[_0x1a91('0x25')](function(_0x34c900){if(_0x34c900){_0x2b986d=_0x34c900;_0x3b62d1['model']=_['keys'](db[_0x1a91('0x4c')]['rawAttributes']);_0x3b62d1[_0x1a91('0x33')]=_[_0x1a91('0x34')](_0x40088f[_0x1a91('0x33')]);_0x3b62d1[_0x1a91('0x35')]=_[_0x1a91('0x36')](_0x3b62d1[_0x1a91('0x32')],_0x3b62d1['query']);_0x3aa3db['attributes']=_[_0x1a91('0x36')](_0x3b62d1[_0x1a91('0x32')],qs['fields'](_0x40088f['query']['fields']));_0x3aa3db[_0x1a91('0x37')]=_0x3aa3db['attributes'][_0x1a91('0x39')]?_0x3aa3db['attributes']:_0x3b62d1[_0x1a91('0x32')];_0x3aa3db[_0x1a91('0x3b')]=qs['sort'](_0x40088f['query'][_0x1a91('0x3c')]);_0x3aa3db[_0x1a91('0x3d')]=qs[_0x1a91('0x35')](_[_0x1a91('0x3e')](_0x40088f[_0x1a91('0x33')],_0x3b62d1[_0x1a91('0x35')]));if(_0x40088f[_0x1a91('0x33')]['filter']){_0x3aa3db['where']=_['merge'](_0x3aa3db[_0x1a91('0x3d')],{'$or':_['map'](_0x3aa3db['attributes'],function(_0x2f0bd2){var _0x5ce873={};_0x5ce873[_0x2f0bd2]={'$like':'%'+_0x40088f[_0x1a91('0x33')]['filter']+'%'};return _0x5ce873;})});}_0x3aa3db=_[_0x1a91('0x40')]({},_0x3aa3db,_0x40088f[_0x1a91('0x4d')]);return _0x2b986d[_0x1a91('0x4e')](_0x3aa3db);}})['then'](function(_0x53c3af){if(_0x53c3af){_0x58942a=_0x53c3af[_0x1a91('0x39')];if(!_0x40088f[_0x1a91('0x33')][_0x1a91('0x3a')](_0x1a91('0x4f'))){_0x3aa3db['limit']=qs['limit'](_0x40088f[_0x1a91('0x33')][_0x1a91('0x1d')]);_0x3aa3db[_0x1a91('0x1b')]=qs[_0x1a91('0x1b')](_0x40088f[_0x1a91('0x33')]['offset']);}return _0x2b986d[_0x1a91('0x4e')](_0x3aa3db);}})[_0x1a91('0x25')](function(_0x550099){if(_0x550099){return _0x550099?{'count':_0x58942a,'rows':_0x550099}:null;}})['then'](respondWithResult(_0x4d3d9c,null))[_0x1a91('0x44')](handleError(_0x4d3d9c,null));};exports[_0x1a91('0x50')]=function(_0x25f0e6,_0x41155d,_0x57029d){if(_0x25f0e6[_0x1a91('0x4a')]['id']){delete _0x25f0e6[_0x1a91('0x4a')]['id'];}return db[_0x1a91('0x2d')][_0x1a91('0x4b')]({'where':{'id':_0x25f0e6['params']['id']}})[_0x1a91('0x25')](handleEntityNotFound(_0x41155d,null))[_0x1a91('0x25')](function(_0x4b306a){if(_0x4b306a){_0x25f0e6[_0x1a91('0x4a')][_0x1a91('0x51')]=_0x4b306a['id'];_0x25f0e6[_0x1a91('0x4a')][_0x1a91('0x52')]=integrations[_0x1a91('0x53')](_0x25f0e6['body'][_0x1a91('0x54')],_0x25f0e6[_0x1a91('0x4a')][_0x1a91('0x30')]);_0x25f0e6[_0x1a91('0x4a')][_0x1a91('0x55')]=integrations[_0x1a91('0x56')](_0x25f0e6['body']['channel'],_0x25f0e6[_0x1a91('0x4a')]['type']);return db[_0x1a91('0x4c')][_0x1a91('0x49')](_0x25f0e6['body'],{'include':[{'model':db[_0x1a91('0x57')],'as':'Subjects'},{'model':db[_0x1a91('0x57')],'as':_0x1a91('0x55')}]});}return null;})[_0x1a91('0x25')](respondWithResult(_0x41155d,null))[_0x1a91('0x44')](handleError(_0x41155d,null));};var md5=require(_0x1a91('0x58'));exports[_0x1a91('0x59')]=function(_0x1f08d8,_0x411618,_0x1694a1){var _0x55e8dd=null;var _0x1a0feb=null;var _0x191be3=null;var _0xec9d88=null;var _0x1cc933='';return db[_0x1a91('0x2d')][_0x1a91('0x4b')]({'where':{'id':_0x1f08d8[_0x1a91('0x45')]['id']},'attributes':['id',_0x1a91('0x29'),_0x1a91('0x5a'),_0x1a91('0x5b'),_0x1a91('0x5c'),_0x1a91('0x5d'),'serverUrl',_0x1a91('0x5e')]})['then'](handleEntityNotFound(_0x411618,null))['then'](function(_0x2c70cb){if(_0x2c70cb){_0x55e8dd=_0x2c70cb['username'];_0x1a0feb=_0x2c70cb['accessKey'];_0x191be3=_0x2c70cb['moduleName'];_0x1cc933=_0x2c70cb[_0x1a91('0x5d')];var _0x2c443b=_0x1cc933[_0x1a91('0x5f')](-0x1);if(_0x2c443b==='/'){_0x1cc933=_0x1cc933[_0x1a91('0x60')](0x0,_0x1cc933[_0x1a91('0x61')](_0x2c443b));}_0xec9d88=util['format'](_0x1a91('0x62'),_0x1cc933);var _0x129ecd={'method':_0x1a91('0x63'),'uri':_0xec9d88,'qs':{'operation':_0x1a91('0x64'),'username':_0x2c70cb[_0x1a91('0x5a')]},'json':!![]};return rp(_0x129ecd);}})[_0x1a91('0x25')](function(_0x1c3880){if(_0x1c3880[_0x1a91('0x65')]){var _0x525ed4={'method':'POST','uri':_0xec9d88,'form':{'operation':_0x1a91('0x66'),'username':_0x55e8dd,'accessKey':md5(_0x1c3880['result'][_0x1a91('0x67')]+_0x1a0feb)},'json':!![]};return rp(_0x525ed4);}})['then'](function(_0x22177b){if(_0x22177b['success']){var _0x11a030={'method':_0x1a91('0x63'),'uri':_0xec9d88,'qs':{'operation':_0x1a91('0x68'),'username':_0x55e8dd,'sessionName':_0x22177b[_0x1a91('0x69')]['sessionName'],'elementType':_0x191be3},'json':!![]};return rp(_0x11a030);}})[_0x1a91('0x25')](function(_0xdf9570){if(_0xdf9570['success']){var _0x2945e1=[_0x1a91('0x6a'),_0x1a91('0x6b'),_0x1a91('0x6c')];_[_0x1a91('0x6d')](_0xdf9570['result'][_0x1a91('0x38')],function(_0x2cf3fc){return _0x2945e1[_0x1a91('0x6e')](_0x2cf3fc[_0x1a91('0x30')][_0x1a91('0x29')]);});_[_0x1a91('0x6d')](_0xdf9570[_0x1a91('0x69')][_0x1a91('0x38')],function(_0x507abd){return _0x507abd[_0x1a91('0x6f')]==='false';});return{'count':_0xdf9570[_0x1a91('0x69')][_0x1a91('0x38')]['length'],'rows':_[_0x1a91('0x2c')](_0xdf9570[_0x1a91('0x69')][_0x1a91('0x38')],function(_0x4c9830){return{'id':_0x4c9830[_0x1a91('0x29')],'name':_0x4c9830['label'],'custom':_[_0x1a91('0x70')](_0x4c9830['name'],_0x1a91('0x71'))?!![]:![],'options':_0x4c9830[_0x1a91('0x30')][_0x1a91('0x29')]===_0x1a91('0x72')&&_0x4c9830[_0x1a91('0x30')][_0x1a91('0x73')][_0x1a91('0x39')]>0x0?_[_0x1a91('0x2c')](_0x4c9830[_0x1a91('0x30')][_0x1a91('0x73')],function(_0x19564e){return{'name':_0x19564e[_0x1a91('0x74')],'value':_0x19564e[_0x1a91('0x75')]};}):[]};})};}})[_0x1a91('0x25')](respondWithResult(_0x411618,null))[_0x1a91('0x44')](function(_0x605299){console[_0x1a91('0x76')](_0x1a91('0x77')+_0x605299);var _0x360fdf=_0x1f08d8[_0x1a91('0x33')][_0x1a91('0x78')]?0x1f4:_0x605299[_0x1a91('0x79')]||0x1f4;logger[_0x1a91('0x27')](_0x1a91('0x7a'),_0x1a91('0x59'),_0x360fdf,JSON[_0x1a91('0x7b')](_0x605299));delete _0x605299[_0x1a91('0x29')];if(_0x360fdf===0x191){_0x360fdf=0x190;}_0x411618[_0x1a91('0x19')](_0x360fdf)['send'](_0x1f08d8[_0x1a91('0x33')]['test']?{'message':_0x1a91('0x7c'),'statusCode':_0x605299[_0x1a91('0x79')]}:_0x605299);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 8e41f42..aa2d6b6 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 _0xf731=['VtigerAccount','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1fe06f,_0x160669){var _0x500880=function(_0x4ba843){while(--_0x4ba843){_0x1fe06f['push'](_0x1fe06f['shift']());}};_0x500880(++_0x160669);}(_0xf731,0x121));var _0x1f73=function(_0x2b00e0,_0x1385e9){_0x2b00e0=_0x2b00e0-0x0;var _0x1749a3=_0xf731[_0x2b00e0];return _0x1749a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f73('0x0'))(_0x1f73('0x1'));var moment=require(_0x1f73('0x2'));var BPromise=require(_0x1f73('0x3'));var rp=require(_0x1f73('0x4'));var fs=require('fs');var path=require(_0x1f73('0x5'));var rimraf=require(_0x1f73('0x6'));var config=require(_0x1f73('0x7'));var attributes=require(_0x1f73('0x8'));var integrations=require(_0x1f73('0x9'));module[_0x1f73('0xa')]=function(_0x1ea297,_0x297522){return _0x1ea297['define'](_0x1f73('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08cc=['api','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','util','../../config/logger'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x08cc,0xb9));var _0xc08c=function(_0x3be739,_0xe02402){_0x3be739=_0x3be739-0x0;var _0x49f6a8=_0x08cc[_0x3be739];return _0x49f6a8;};'use strict';var _=require('lodash');var util=require(_0xc08c('0x0'));var logger=require(_0xc08c('0x1'))(_0xc08c('0x2'));var moment=require('moment');var BPromise=require(_0xc08c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc08c('0x4'));var rimraf=require('rimraf');var config=require(_0xc08c('0x5'));var attributes=require(_0xc08c('0x6'));var integrations=require(_0xc08c('0x7'));module[_0xc08c('0x8')]=function(_0x36dd31,_0x4fba18){return _0x36dd31['define'](_0xc08c('0x9'),attributes,{'tableName':_0xc08c('0xa'),'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 9f72a32..37217fc 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 _0xe1e3=['result','GetVtigerAccount','options','raw','where','attributes','limit','include','model','map','debug','catch','find','ShowVtigerAccount','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','info'];(function(_0x11f116,_0x38b927){var _0x398927=function(_0x338916){while(--_0x338916){_0x11f116['push'](_0x11f116['shift']());}};_0x398927(++_0x38b927);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5c8554,_0x157950){_0x5c8554=_0x5c8554-0x0;var _0x5740d1=_0xe1e3[_0x5c8554];return _0x5740d1;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['VtigerAccount']['findAll']({'raw':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x17')]||null:null,'attributes':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x18')]||null:null,'limit':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x19')]||null:null,'include':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')]['include']?_['map'](_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x488f9f){return{'model':db[_0x488f9f[_0x3e1e('0x1b')]],'as':_0x488f9f['as'],'attributes':_0x488f9f[_0x3e1e('0x18')],'include':_0x488f9f[_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x488f9f[_0x3e1e('0x1a')],function(_0x159212){return{'model':db[_0x159212[_0x3e1e('0x1b')]],'as':_0x159212['as'],'attributes':_0x159212[_0x3e1e('0x18')],'include':_0x159212['include']?_['map'](_0x159212[_0x3e1e('0x1a')],function(_0x541ef1){return{'model':db[_0x541ef1['model']],'as':_0x541ef1['as'],'attributes':_0x541ef1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a33bb){logger[_0x3e1e('0x12')]('GetVtigerAccount',_0x1d786c);logger[_0x3e1e('0x1d')]('GetVtigerAccount',_0x1d786c,JSON[_0x3e1e('0xe')](_0x1a33bb));_0x791ed8(_0x1a33bb);})[_0x3e1e('0x1e')](function(_0x53a6ff){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x53a6ff[_0x3e1e('0x11')],_0x1d786c);_0x1c181b(_0x39eaa7['error'](0x1f4,_0x53a6ff[_0x3e1e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x591c36){var _0x494c75=this;return new Promise(function(_0x39da8d,_0x5b8f95){return db['VtigerAccount'][_0x3e1e('0x1f')]({'raw':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x591c36[_0x3e1e('0x15')]?_0x591c36['options']['where']||null:null,'attributes':_0x591c36['options']?_0x591c36['options'][_0x3e1e('0x18')]||null:null,'include':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x431bd5){return{'model':db[_0x431bd5['model']],'as':_0x431bd5['as'],'attributes':_0x431bd5[_0x3e1e('0x18')],'include':_0x431bd5[_0x3e1e('0x1a')]?_['map'](_0x431bd5[_0x3e1e('0x1a')],function(_0x3f4ef3){return{'model':db[_0x3f4ef3[_0x3e1e('0x1b')]],'as':_0x3f4ef3['as'],'attributes':_0x3f4ef3[_0x3e1e('0x18')],'include':_0x3f4ef3['include']?_['map'](_0x3f4ef3[_0x3e1e('0x1a')],function(_0x332f1e){return{'model':db[_0x332f1e['model']],'as':_0x332f1e['as'],'attributes':_0x332f1e[_0x3e1e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3e1e('0xb')](function(_0x4e9acd){logger[_0x3e1e('0x12')](_0x3e1e('0x20'),_0x591c36);logger[_0x3e1e('0x1d')](_0x3e1e('0x20'),_0x591c36,JSON[_0x3e1e('0xe')](_0x4e9acd));_0x39da8d(_0x4e9acd);})['catch'](function(_0x1da527){logger[_0x3e1e('0xf')](_0x3e1e('0x20'),_0x1da527[_0x3e1e('0x11')],_0x591c36);_0x5b8f95(_0x494c75['error'](0x1f4,_0x1da527[_0x3e1e('0x11')]));});});}; \ No newline at end of file +var _0xea28=['code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x39db49,_0x5a1bfd){var _0x345c13=function(_0x42c8fe){while(--_0x42c8fe){_0x39db49['push'](_0x39db49['shift']());}};_0x345c13(++_0x5a1bfd);}(_0xea28,0x13a));var _0x8ea2=function(_0x1ed98a,_0x4e9eb8){_0x1ed98a=_0x1ed98a-0x0;var _0x50ae46=_0xea28[_0x1ed98a];return _0x50ae46;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}exports[_0x8ea2('0x17')]=function(_0x1b64cf){var _0x174ef2=this;return new Promise(function(_0x467045,_0x2a0329){return db[_0x8ea2('0x18')][_0x8ea2('0x19')]({'raw':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf[_0x8ea2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1b64cf['options']?_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1b')]||null:null,'attributes':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf['options'][_0x8ea2('0x1c')]||null:null,'limit':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf['options'][_0x8ea2('0x1d')]||null:null,'include':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1e')]?_[_0x8ea2('0x1f')](_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1e')],function(_0x1e4cc9){return{'model':db[_0x1e4cc9[_0x8ea2('0x20')]],'as':_0x1e4cc9['as'],'attributes':_0x1e4cc9['attributes'],'include':_0x1e4cc9[_0x8ea2('0x1e')]?_['map'](_0x1e4cc9[_0x8ea2('0x1e')],function(_0x42bec8){return{'model':db[_0x42bec8[_0x8ea2('0x20')]],'as':_0x42bec8['as'],'attributes':_0x42bec8['attributes'],'include':_0x42bec8['include']?_[_0x8ea2('0x1f')](_0x42bec8['include'],function(_0x200a49){return{'model':db[_0x200a49['model']],'as':_0x200a49['as'],'attributes':_0x200a49[_0x8ea2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8ea2('0xd')](function(_0x21c526){logger[_0x8ea2('0xe')]('GetVtigerAccount',_0x1b64cf);logger['debug'](_0x8ea2('0x17'),_0x1b64cf,JSON['stringify'](_0x21c526));_0x467045(_0x21c526);})[_0x8ea2('0x16')](function(_0x287078){logger[_0x8ea2('0x12')](_0x8ea2('0x17'),_0x287078[_0x8ea2('0x14')],_0x1b64cf);_0x2a0329(_0x174ef2[_0x8ea2('0x12')](0x1f4,_0x287078[_0x8ea2('0x14')]));});});};exports[_0x8ea2('0x21')]=function(_0x19e868){var _0x9c5fac=this;return new Promise(function(_0x56d914,_0x5b7ff9){return db[_0x8ea2('0x18')][_0x8ea2('0x22')]({'raw':_0x19e868['options']?_0x19e868['options'][_0x8ea2('0x23')]===undefined?!![]:![]:!![],'where':_0x19e868['options']?_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1b')]||null:null,'attributes':_0x19e868['options']?_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1c')]||null:null,'include':_0x19e868[_0x8ea2('0x1a')]?_0x19e868['options']['include']?_['map'](_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1e')],function(_0x3fc785){return{'model':db[_0x3fc785['model']],'as':_0x3fc785['as'],'attributes':_0x3fc785[_0x8ea2('0x1c')],'include':_0x3fc785[_0x8ea2('0x1e')]?_[_0x8ea2('0x1f')](_0x3fc785[_0x8ea2('0x1e')],function(_0x253031){return{'model':db[_0x253031[_0x8ea2('0x20')]],'as':_0x253031['as'],'attributes':_0x253031[_0x8ea2('0x1c')],'include':_0x253031[_0x8ea2('0x1e')]?_['map'](_0x253031[_0x8ea2('0x1e')],function(_0x29e3f5){return{'model':db[_0x29e3f5[_0x8ea2('0x20')]],'as':_0x29e3f5['as'],'attributes':_0x29e3f5[_0x8ea2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a1f14){logger['info'](_0x8ea2('0x21'),_0x19e868);logger[_0x8ea2('0x24')](_0x8ea2('0x21'),_0x19e868,JSON[_0x8ea2('0x11')](_0x2a1f14));_0x56d914(_0x2a1f14);})['catch'](function(_0x2bed24){logger['error']('ShowVtigerAccount',_0x2bed24[_0x8ea2('0x14')],_0x19e868);_0x5b7ff9(_0x9c5fac['error'](0x1f4,_0x2bed24[_0x8ea2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d4dc3c9..56eb56f 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 _0x177d=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x2710dc,_0x1b3746){var _0xec8e7c=function(_0x41a118){while(--_0x41a118){_0x2710dc['push'](_0x2710dc['shift']());}};_0xec8e7c(++_0x1b3746);}(_0x177d,0x1b5));var _0xd177=function(_0x41cb18,_0x589740){_0x41cb18=_0x41cb18-0x0;var _0x4216b1=_0x177d[_0x41cb18];return _0x4216b1;};'use strict';var multer=require(_0xd177('0x0'));var util=require(_0xd177('0x1'));var path=require('path');var timeout=require(_0xd177('0x2'));var express=require(_0xd177('0x3'));var router=express[_0xd177('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd177('0x5'));var interaction=require(_0xd177('0x6'));var config=require(_0xd177('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0xd177('0x8')]('/',auth[_0xd177('0x9')](),controller[_0xd177('0xa')]);router[_0xd177('0x8')](_0xd177('0xb'),auth[_0xd177('0x9')](),controller[_0xd177('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd177('0xd')]);router['get'](_0xd177('0xe'),auth['isAuthenticated'](),controller[_0xd177('0xf')]);router[_0xd177('0x8')]('/:id/descriptions',auth[_0xd177('0x9')](),controller[_0xd177('0x10')]);router[_0xd177('0x11')]('/',auth[_0xd177('0x9')](),controller[_0xd177('0x12')]);router[_0xd177('0x13')](_0xd177('0xb'),auth[_0xd177('0x9')](),controller[_0xd177('0x14')]);router[_0xd177('0x15')](_0xd177('0xb'),auth[_0xd177('0x9')](),controller[_0xd177('0x16')]);module[_0xd177('0x17')]=router; \ No newline at end of file +var _0x74ae=['isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','update','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','show','/:id/fields'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x74ae,0xff));var _0xe74a=function(_0x49a9ac,_0x4554f0){_0x49a9ac=_0x49a9ac-0x0;var _0x46f986=_0x74ae[_0x49a9ac];return _0x46f986;};'use strict';var multer=require(_0xe74a('0x0'));var util=require(_0xe74a('0x1'));var path=require(_0xe74a('0x2'));var timeout=require(_0xe74a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe74a('0x4'));var config=require(_0xe74a('0x5'));var controller=require(_0xe74a('0x6'));router[_0xe74a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe74a('0x7')](_0xe74a('0x8'),auth['isAuthenticated'](),controller[_0xe74a('0x9')]);router[_0xe74a('0x7')](_0xe74a('0xa'),auth[_0xe74a('0xb')](),controller[_0xe74a('0xc')]);router[_0xe74a('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe74a('0xd')]);router['get'](_0xe74a('0xe'),auth[_0xe74a('0xb')](),controller[_0xe74a('0xf')]);router['post']('/',auth[_0xe74a('0xb')](),controller['create']);router['put']('/:id',auth[_0xe74a('0xb')](),controller[_0xe74a('0x10')]);router['delete']('/:id',auth[_0xe74a('0xb')](),controller[_0xe74a('0x11')]);module[_0xe74a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 513fee1..a361095 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 _0xd3ef=['sequelize','exports','STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd3ef,0x14d));var _0xfd3e=function(_0x1394fa,_0x7245d9){_0x1394fa=_0x1394fa-0x0;var _0x100629=_0xd3ef[_0x1394fa];return _0x100629;};'use strict';var Sequelize=require(_0xfd3e('0x0'));module[_0xfd3e('0x1')]={'name':{'type':Sequelize[_0xfd3e('0x2')]},'description':{'type':Sequelize[_0xfd3e('0x2')]}}; \ No newline at end of file +var _0x2957=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2957,0x8e));var _0x7295=function(_0x5216cb,_0x2f8b06){_0x5216cb=_0x5216cb-0x0;var _0x485e13=_0x2957[_0x5216cb];return _0x485e13;};'use strict';var Sequelize=require(_0x7295('0x0'));module[_0x7295('0x1')]={'name':{'type':Sequelize[_0x7295('0x2')]},'description':{'type':Sequelize[_0x7295('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index d44474a..89da844 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 _0x1ea0=['index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','VtigerField','getFields','nolimit','pick','getSubjects','getDescriptions','findOne','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send'];(function(_0x45e18e,_0x47cc4d){var _0x175e61=function(_0x23d6c4){while(--_0x23d6c4){_0x45e18e['push'](_0x45e18e['shift']());}};_0x175e61(++_0x47cc4d);}(_0x1ea0,0x11b));var _0x01ea=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1ea0[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x01ea('0x0'));var jsonpatch=require(_0x01ea('0x1'));var rp=require(_0x01ea('0x2'));var moment=require('moment');var BPromise=require(_0x01ea('0x3'));var Mustache=require('mustache');var util=require(_0x01ea('0x4'));var path=require(_0x01ea('0x5'));var sox=require(_0x01ea('0x6'));var csv=require('to-csv');var ejs=require(_0x01ea('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01ea('0x8'));var squel=require(_0x01ea('0x9'));var crypto=require(_0x01ea('0xa'));var jsforce=require(_0x01ea('0xb'));var deskjs=require(_0x01ea('0xc'));var toCsv=require('to-csv');var querystring=require(_0x01ea('0xd'));var Papa=require('papaparse');var Redis=require(_0x01ea('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x01ea('0xf'));var as=require(_0x01ea('0x10'));var hardwareService=require(_0x01ea('0x11'));var logger=require(_0x01ea('0x12'))('api');var utils=require(_0x01ea('0x13'));var config=require(_0x01ea('0x14'));var licenseUtil=require(_0x01ea('0x15'));var db=require(_0x01ea('0x16'))['db'];function respondWithStatusCode(_0x11daa4,_0x3dd968){_0x3dd968=_0x3dd968||0xcc;return function(_0x5b7355){if(_0x5b7355){return _0x11daa4[_0x01ea('0x17')](_0x3dd968);}return _0x11daa4['status'](_0x3dd968)[_0x01ea('0x18')]();};}function respondWithResult(_0x130465,_0x56dac1){_0x56dac1=_0x56dac1||0xc8;return function(_0x4b14ba){if(_0x4b14ba){return _0x130465[_0x01ea('0x19')](_0x56dac1)[_0x01ea('0x1a')](_0x4b14ba);}};}function respondWithFilteredResult(_0x214c37,_0x276091){return function(_0x1b8b1d){if(_0x1b8b1d){var _0x54f585=typeof _0x276091[_0x01ea('0x1b')]===_0x01ea('0x1c')&&typeof _0x276091['limit']===_0x01ea('0x1c');var _0x984aba=_0x1b8b1d[_0x01ea('0x1d')];var _0x357983=_0x54f585?0x0:_0x276091[_0x01ea('0x1b')];var _0x294eb0=_0x54f585?_0x1b8b1d['count']:_0x276091[_0x01ea('0x1b')]+_0x276091[_0x01ea('0x1e')];var _0x45ecba;if(_0x294eb0>=_0x984aba){_0x294eb0=_0x984aba;_0x45ecba=0xc8;}else{_0x45ecba=0xce;}_0x214c37[_0x01ea('0x19')](_0x45ecba);return _0x214c37[_0x01ea('0x1f')](_0x01ea('0x20'),_0x357983+'-'+_0x294eb0+'/'+_0x984aba)[_0x01ea('0x1a')](_0x1b8b1d);}return null;};}function patchUpdates(_0x375883){return function(_0x1da094){try{jsonpatch['apply'](_0x1da094,_0x375883,!![]);}catch(_0x5e9d41){return BPromise[_0x01ea('0x21')](_0x5e9d41);}return _0x1da094[_0x01ea('0x22')]();};}function saveUpdates(_0x3b2431,_0x149fe2){return function(_0x3353d1){if(_0x3353d1){return _0x3353d1['update'](_0x3b2431)[_0x01ea('0x23')](function(_0x51b6cb){return _0x51b6cb;});}return null;};}function removeEntity(_0x6c1472,_0x58fc68){return function(_0xb967e0){if(_0xb967e0){return _0xb967e0[_0x01ea('0x24')]()[_0x01ea('0x23')](function(){_0x6c1472['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x102373,_0x1b6a6a){return function(_0x2e63e3){if(!_0x2e63e3){_0x102373[_0x01ea('0x17')](0x194);}return _0x2e63e3;};}function handleError(_0x159569,_0x2e56e3){_0x2e56e3=_0x2e56e3||0x1f4;return function(_0x52ab28){logger[_0x01ea('0x25')](_0x52ab28[_0x01ea('0x26')]);if(_0x52ab28[_0x01ea('0x27')]){delete _0x52ab28[_0x01ea('0x27')];}_0x159569[_0x01ea('0x19')](_0x2e56e3)[_0x01ea('0x28')](_0x52ab28);};}exports[_0x01ea('0x29')]=function(_0x5b0450,_0x2e08bb){var _0x1db956={},_0x3527ab={},_0x1dece4={'count':0x0,'rows':[]};var _0x47296c=_[_0x01ea('0x2a')](db[_0x01ea('0x2b')][_0x01ea('0x2c')],function(_0x597786){return{'name':_0x597786[_0x01ea('0x2d')],'type':_0x597786[_0x01ea('0x2e')][_0x01ea('0x2f')]};});_0x3527ab[_0x01ea('0x30')]=_[_0x01ea('0x2a')](_0x47296c,_0x01ea('0x27'));_0x3527ab[_0x01ea('0x31')]=_[_0x01ea('0x32')](_0x5b0450[_0x01ea('0x31')]);_0x3527ab[_0x01ea('0x33')]=_['intersection'](_0x3527ab[_0x01ea('0x30')],_0x3527ab['query']);_0x1db956['attributes']=_[_0x01ea('0x34')](_0x3527ab[_0x01ea('0x30')],qs['fields'](_0x5b0450[_0x01ea('0x31')][_0x01ea('0x35')]));_0x1db956[_0x01ea('0x36')]=_0x1db956['attributes'][_0x01ea('0x37')]?_0x1db956['attributes']:_0x3527ab[_0x01ea('0x30')];if(!_0x5b0450[_0x01ea('0x31')][_0x01ea('0x38')]('nolimit')){_0x1db956[_0x01ea('0x1e')]=qs[_0x01ea('0x1e')](_0x5b0450['query'][_0x01ea('0x1e')]);_0x1db956[_0x01ea('0x1b')]=qs[_0x01ea('0x1b')](_0x5b0450[_0x01ea('0x31')][_0x01ea('0x1b')]);}_0x1db956[_0x01ea('0x39')]=qs['sort'](_0x5b0450['query'][_0x01ea('0x3a')]);_0x1db956[_0x01ea('0x3b')]=qs[_0x01ea('0x33')](_['pick'](_0x5b0450[_0x01ea('0x31')],_0x3527ab[_0x01ea('0x33')]),_0x47296c);if(_0x5b0450['query']['filter']){_0x1db956[_0x01ea('0x3b')]=_[_0x01ea('0x3c')](_0x1db956['where'],{'$or':_['map'](_0x47296c,function(_0x1a481e){if(_0x1a481e['type']!=='VIRTUAL'){var _0x1aabb2={};_0x1aabb2[_0x1a481e[_0x01ea('0x27')]]={'$like':'%'+_0x5b0450[_0x01ea('0x31')][_0x01ea('0x3d')]+'%'};return _0x1aabb2;}})});}_0x1db956=_[_0x01ea('0x3c')]({},_0x1db956,_0x5b0450[_0x01ea('0x3e')]);var _0x1ee7d2={'where':_0x1db956[_0x01ea('0x3b')]};return db[_0x01ea('0x2b')][_0x01ea('0x1d')](_0x1ee7d2)['then'](function(_0x5b65b0){_0x1dece4[_0x01ea('0x1d')]=_0x5b65b0;if(_0x5b0450[_0x01ea('0x31')][_0x01ea('0x3f')]){_0x1db956[_0x01ea('0x40')]=[{'all':!![]}];}return db[_0x01ea('0x2b')][_0x01ea('0x41')](_0x1db956);})[_0x01ea('0x23')](function(_0x57e341){_0x1dece4[_0x01ea('0x42')]=_0x57e341;return _0x1dece4;})[_0x01ea('0x23')](respondWithFilteredResult(_0x2e08bb,_0x1db956))['catch'](handleError(_0x2e08bb,null));};exports[_0x01ea('0x43')]=function(_0xa6a033,_0x29bc52){var _0x16d981={'raw':![],'where':{'id':_0xa6a033[_0x01ea('0x44')]['id']}},_0x3392da={};_0x3392da[_0x01ea('0x30')]=_[_0x01ea('0x32')](db['VtigerConfiguration'][_0x01ea('0x2c')]);_0x3392da['query']=_[_0x01ea('0x32')](_0xa6a033[_0x01ea('0x31')]);_0x3392da['filters']=_[_0x01ea('0x34')](_0x3392da[_0x01ea('0x30')],_0x3392da['query']);_0x16d981[_0x01ea('0x36')]=_[_0x01ea('0x34')](_0x3392da['model'],qs['fields'](_0xa6a033[_0x01ea('0x31')][_0x01ea('0x35')]));_0x16d981[_0x01ea('0x36')]=_0x16d981[_0x01ea('0x36')][_0x01ea('0x37')]?_0x16d981[_0x01ea('0x36')]:_0x3392da[_0x01ea('0x30')];if(_0xa6a033[_0x01ea('0x31')][_0x01ea('0x3f')]){_0x16d981[_0x01ea('0x40')]=[{'all':!![]}];}_0x16d981=_['merge']({},_0x16d981,_0xa6a033[_0x01ea('0x3e')]);return db[_0x01ea('0x2b')]['find'](_0x16d981)[_0x01ea('0x23')](handleEntityNotFound(_0x29bc52,null))['then'](respondWithResult(_0x29bc52,null))[_0x01ea('0x45')](handleError(_0x29bc52,null));};exports[_0x01ea('0x46')]=function(_0x369dbc,_0x2d12f7){return db[_0x01ea('0x2b')][_0x01ea('0x46')](_0x369dbc[_0x01ea('0x47')],{})[_0x01ea('0x23')](respondWithResult(_0x2d12f7,0xc9))['catch'](handleError(_0x2d12f7,null));};exports[_0x01ea('0x48')]=function(_0x2bc672,_0x505a05){if(_0x2bc672[_0x01ea('0x47')]['id']){delete _0x2bc672['body']['id'];}return db[_0x01ea('0x2b')][_0x01ea('0x49')]({'where':{'id':_0x2bc672['params']['id']}})['then'](handleEntityNotFound(_0x505a05,null))[_0x01ea('0x23')](saveUpdates(_0x2bc672['body'],null))[_0x01ea('0x23')](respondWithResult(_0x505a05,null))['catch'](handleError(_0x505a05,null));};exports[_0x01ea('0x24')]=function(_0x4bce4d,_0x86b455){return db[_0x01ea('0x2b')][_0x01ea('0x49')]({'where':{'id':_0x4bce4d['params']['id']}})['then'](handleEntityNotFound(_0x86b455,null))[_0x01ea('0x23')](removeEntity(_0x86b455,null))[_0x01ea('0x45')](handleError(_0x86b455,null));};exports['getFields']=function(_0x4b87c2,_0x554e21,_0x4433d1){var _0x34e618={};var _0x42d9db={};var _0x40470c;var _0x2640eb;return db[_0x01ea('0x2b')]['findOne']({'where':{'id':_0x4b87c2['params']['id']}})[_0x01ea('0x23')](handleEntityNotFound(_0x554e21,null))[_0x01ea('0x23')](function(_0x58cb01){if(_0x58cb01){_0x40470c=_0x58cb01;_0x42d9db[_0x01ea('0x30')]=_[_0x01ea('0x32')](db[_0x01ea('0x4a')][_0x01ea('0x2c')]);_0x42d9db[_0x01ea('0x31')]=_[_0x01ea('0x32')](_0x4b87c2[_0x01ea('0x31')]);_0x42d9db[_0x01ea('0x33')]=_[_0x01ea('0x34')](_0x42d9db[_0x01ea('0x30')],_0x42d9db['query']);_0x34e618[_0x01ea('0x36')]=_[_0x01ea('0x34')](_0x42d9db[_0x01ea('0x30')],qs['fields'](_0x4b87c2[_0x01ea('0x31')][_0x01ea('0x35')]));_0x34e618[_0x01ea('0x36')]=_0x34e618[_0x01ea('0x36')][_0x01ea('0x37')]?_0x34e618[_0x01ea('0x36')]:_0x42d9db[_0x01ea('0x30')];_0x34e618[_0x01ea('0x39')]=qs[_0x01ea('0x3a')](_0x4b87c2[_0x01ea('0x31')][_0x01ea('0x3a')]);_0x34e618[_0x01ea('0x3b')]=qs[_0x01ea('0x33')](_['pick'](_0x4b87c2['query'],_0x42d9db[_0x01ea('0x33')]));if(_0x4b87c2[_0x01ea('0x31')]['filter']){_0x34e618['where']=_[_0x01ea('0x3c')](_0x34e618[_0x01ea('0x3b')],{'$or':_[_0x01ea('0x2a')](_0x34e618[_0x01ea('0x36')],function(_0xcd4a96){var _0xb7fd3f={};_0xb7fd3f[_0xcd4a96]={'$like':'%'+_0x4b87c2[_0x01ea('0x31')][_0x01ea('0x3d')]+'%'};return _0xb7fd3f;})});}_0x34e618=_[_0x01ea('0x3c')]({},_0x34e618,_0x4b87c2[_0x01ea('0x3e')]);return _0x40470c[_0x01ea('0x4b')](_0x34e618);}})[_0x01ea('0x23')](function(_0x13f422){if(_0x13f422){_0x2640eb=_0x13f422['length'];if(!_0x4b87c2[_0x01ea('0x31')][_0x01ea('0x38')](_0x01ea('0x4c'))){_0x34e618['limit']=qs[_0x01ea('0x1e')](_0x4b87c2['query'][_0x01ea('0x1e')]);_0x34e618[_0x01ea('0x1b')]=qs[_0x01ea('0x1b')](_0x4b87c2[_0x01ea('0x31')][_0x01ea('0x1b')]);}return _0x40470c['getFields'](_0x34e618);}})[_0x01ea('0x23')](function(_0x596161){if(_0x596161){return _0x596161?{'count':_0x2640eb,'rows':_0x596161}:null;}})[_0x01ea('0x23')](respondWithResult(_0x554e21,null))[_0x01ea('0x45')](handleError(_0x554e21,null));};exports['getSubjects']=function(_0x3763c4,_0x6b7732,_0x37f5c1){var _0x232280={};var _0x2dd040={};var _0x270601;var _0x2c5edc;return db[_0x01ea('0x2b')]['findOne']({'where':{'id':_0x3763c4[_0x01ea('0x44')]['id']}})['then'](handleEntityNotFound(_0x6b7732,null))[_0x01ea('0x23')](function(_0x734ebe){if(_0x734ebe){_0x270601=_0x734ebe;_0x2dd040['model']=_[_0x01ea('0x32')](db['VtigerField'][_0x01ea('0x2c')]);_0x2dd040['query']=_[_0x01ea('0x32')](_0x3763c4[_0x01ea('0x31')]);_0x2dd040[_0x01ea('0x33')]=_[_0x01ea('0x34')](_0x2dd040[_0x01ea('0x30')],_0x2dd040[_0x01ea('0x31')]);_0x232280['attributes']=_[_0x01ea('0x34')](_0x2dd040[_0x01ea('0x30')],qs[_0x01ea('0x35')](_0x3763c4[_0x01ea('0x31')]['fields']));_0x232280[_0x01ea('0x36')]=_0x232280[_0x01ea('0x36')][_0x01ea('0x37')]?_0x232280['attributes']:_0x2dd040[_0x01ea('0x30')];_0x232280[_0x01ea('0x39')]=qs[_0x01ea('0x3a')](_0x3763c4[_0x01ea('0x31')]['sort']);_0x232280[_0x01ea('0x3b')]=qs[_0x01ea('0x33')](_[_0x01ea('0x4d')](_0x3763c4[_0x01ea('0x31')],_0x2dd040[_0x01ea('0x33')]));if(_0x3763c4['query'][_0x01ea('0x3d')]){_0x232280['where']=_[_0x01ea('0x3c')](_0x232280['where'],{'$or':_[_0x01ea('0x2a')](_0x232280[_0x01ea('0x36')],function(_0x5d3f01){var _0x47c92d={};_0x47c92d[_0x5d3f01]={'$like':'%'+_0x3763c4['query'][_0x01ea('0x3d')]+'%'};return _0x47c92d;})});}_0x232280=_['merge']({},_0x232280,_0x3763c4[_0x01ea('0x3e')]);return _0x270601['getSubjects'](_0x232280);}})[_0x01ea('0x23')](function(_0x491a94){if(_0x491a94){_0x2c5edc=_0x491a94[_0x01ea('0x37')];if(!_0x3763c4[_0x01ea('0x31')][_0x01ea('0x38')](_0x01ea('0x4c'))){_0x232280[_0x01ea('0x1e')]=qs['limit'](_0x3763c4[_0x01ea('0x31')][_0x01ea('0x1e')]);_0x232280[_0x01ea('0x1b')]=qs[_0x01ea('0x1b')](_0x3763c4[_0x01ea('0x31')]['offset']);}return _0x270601[_0x01ea('0x4e')](_0x232280);}})[_0x01ea('0x23')](function(_0x4d26e1){if(_0x4d26e1){return _0x4d26e1?{'count':_0x2c5edc,'rows':_0x4d26e1}:null;}})[_0x01ea('0x23')](respondWithResult(_0x6b7732,null))[_0x01ea('0x45')](handleError(_0x6b7732,null));};exports[_0x01ea('0x4f')]=function(_0x4f3d30,_0x5eefb5,_0x5ede5a){var _0x39487c={};var _0x143496={};var _0x52b58e;var _0x590e1d;return db['VtigerConfiguration'][_0x01ea('0x50')]({'where':{'id':_0x4f3d30[_0x01ea('0x44')]['id']}})[_0x01ea('0x23')](handleEntityNotFound(_0x5eefb5,null))[_0x01ea('0x23')](function(_0x16b4f4){if(_0x16b4f4){_0x52b58e=_0x16b4f4;_0x143496[_0x01ea('0x30')]=_[_0x01ea('0x32')](db[_0x01ea('0x4a')]['rawAttributes']);_0x143496[_0x01ea('0x31')]=_[_0x01ea('0x32')](_0x4f3d30[_0x01ea('0x31')]);_0x143496[_0x01ea('0x33')]=_[_0x01ea('0x34')](_0x143496[_0x01ea('0x30')],_0x143496[_0x01ea('0x31')]);_0x39487c[_0x01ea('0x36')]=_[_0x01ea('0x34')](_0x143496['model'],qs['fields'](_0x4f3d30[_0x01ea('0x31')][_0x01ea('0x35')]));_0x39487c[_0x01ea('0x36')]=_0x39487c[_0x01ea('0x36')][_0x01ea('0x37')]?_0x39487c[_0x01ea('0x36')]:_0x143496[_0x01ea('0x30')];_0x39487c[_0x01ea('0x39')]=qs['sort'](_0x4f3d30[_0x01ea('0x31')]['sort']);_0x39487c[_0x01ea('0x3b')]=qs[_0x01ea('0x33')](_['pick'](_0x4f3d30[_0x01ea('0x31')],_0x143496['filters']));if(_0x4f3d30[_0x01ea('0x31')][_0x01ea('0x3d')]){_0x39487c[_0x01ea('0x3b')]=_[_0x01ea('0x3c')](_0x39487c[_0x01ea('0x3b')],{'$or':_['map'](_0x39487c[_0x01ea('0x36')],function(_0x5ae376){var _0x53a6fa={};_0x53a6fa[_0x5ae376]={'$like':'%'+_0x4f3d30[_0x01ea('0x31')][_0x01ea('0x3d')]+'%'};return _0x53a6fa;})});}_0x39487c=_[_0x01ea('0x3c')]({},_0x39487c,_0x4f3d30['options']);return _0x52b58e[_0x01ea('0x4f')](_0x39487c);}})[_0x01ea('0x23')](function(_0x566e89){if(_0x566e89){_0x590e1d=_0x566e89[_0x01ea('0x37')];if(!_0x4f3d30[_0x01ea('0x31')][_0x01ea('0x38')](_0x01ea('0x4c'))){_0x39487c[_0x01ea('0x1e')]=qs['limit'](_0x4f3d30['query'][_0x01ea('0x1e')]);_0x39487c[_0x01ea('0x1b')]=qs['offset'](_0x4f3d30['query'][_0x01ea('0x1b')]);}return _0x52b58e[_0x01ea('0x4f')](_0x39487c);}})[_0x01ea('0x23')](function(_0x5b95da){if(_0x5b95da){return _0x5b95da?{'count':_0x590e1d,'rows':_0x5b95da}:null;}})[_0x01ea('0x23')](respondWithResult(_0x5eefb5,null))['catch'](handleError(_0x5eefb5,null));}; \ No newline at end of file +var _0xfda1=['save','update','then','destroy','sendStatus','error','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','getFields','findOne','getSubjects','VtigerField','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x407b56,_0x2eed9c){var _0x1a13d9=function(_0x588d1c){while(--_0x588d1c){_0x407b56['push'](_0x407b56['shift']());}};_0x1a13d9(++_0x2eed9c);}(_0xfda1,0x1b5));var _0x1fda=function(_0x593099,_0x2faaa2){_0x593099=_0x593099-0x0;var _0x29cd56=_0xfda1[_0x593099];return _0x29cd56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fda('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fda('0x1'));var rp=require(_0x1fda('0x2'));var moment=require(_0x1fda('0x3'));var BPromise=require(_0x1fda('0x4'));var Mustache=require('mustache');var util=require(_0x1fda('0x5'));var path=require(_0x1fda('0x6'));var sox=require(_0x1fda('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fda('0x8'));var _=require(_0x1fda('0x9'));var squel=require('squel');var crypto=require(_0x1fda('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1fda('0xb'));var toCsv=require(_0x1fda('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fda('0xd'));var authService=require(_0x1fda('0xe'));var qs=require(_0x1fda('0xf'));var as=require(_0x1fda('0x10'));var hardwareService=require(_0x1fda('0x11'));var logger=require(_0x1fda('0x12'))('api');var utils=require(_0x1fda('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1fda('0x14'))['db'];function respondWithStatusCode(_0x1ddb50,_0x498f32){_0x498f32=_0x498f32||0xcc;return function(_0x499365){if(_0x499365){return _0x1ddb50['sendStatus'](_0x498f32);}return _0x1ddb50[_0x1fda('0x15')](_0x498f32)[_0x1fda('0x16')]();};}function respondWithResult(_0x12d4d9,_0x25cd45){_0x25cd45=_0x25cd45||0xc8;return function(_0x4cc8a5){if(_0x4cc8a5){return _0x12d4d9[_0x1fda('0x15')](_0x25cd45)[_0x1fda('0x17')](_0x4cc8a5);}};}function respondWithFilteredResult(_0x9e0a94,_0x2a3341){return function(_0xa522d){if(_0xa522d){var _0x62f358=typeof _0x2a3341[_0x1fda('0x18')]===_0x1fda('0x19')&&typeof _0x2a3341['limit']===_0x1fda('0x19');var _0x104015=_0xa522d[_0x1fda('0x1a')];var _0x5eab48=_0x62f358?0x0:_0x2a3341[_0x1fda('0x18')];var _0x527963=_0x62f358?_0xa522d[_0x1fda('0x1a')]:_0x2a3341[_0x1fda('0x18')]+_0x2a3341[_0x1fda('0x1b')];var _0x3f9c06;if(_0x527963>=_0x104015){_0x527963=_0x104015;_0x3f9c06=0xc8;}else{_0x3f9c06=0xce;}_0x9e0a94['status'](_0x3f9c06);return _0x9e0a94[_0x1fda('0x1c')](_0x1fda('0x1d'),_0x5eab48+'-'+_0x527963+'/'+_0x104015)[_0x1fda('0x17')](_0xa522d);}return null;};}function patchUpdates(_0x430862){return function(_0x2abdf7){try{jsonpatch[_0x1fda('0x1e')](_0x2abdf7,_0x430862,!![]);}catch(_0x4285d5){return BPromise['reject'](_0x4285d5);}return _0x2abdf7[_0x1fda('0x1f')]();};}function saveUpdates(_0x372a09,_0x33819e){return function(_0x1997cf){if(_0x1997cf){return _0x1997cf[_0x1fda('0x20')](_0x372a09)[_0x1fda('0x21')](function(_0x62d6e7){return _0x62d6e7;});}return null;};}function removeEntity(_0x26f46d,_0x3669d2){return function(_0x4d0d7b){if(_0x4d0d7b){return _0x4d0d7b[_0x1fda('0x22')]()[_0x1fda('0x21')](function(){_0x26f46d[_0x1fda('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104398,_0x26a1f1){return function(_0x3d9b7e){if(!_0x3d9b7e){_0x104398[_0x1fda('0x23')](0x194);}return _0x3d9b7e;};}function handleError(_0x2f998c,_0x19e3a9){_0x19e3a9=_0x19e3a9||0x1f4;return function(_0x569167){logger[_0x1fda('0x24')](_0x569167[_0x1fda('0x25')]);if(_0x569167[_0x1fda('0x26')]){delete _0x569167[_0x1fda('0x26')];}_0x2f998c[_0x1fda('0x15')](_0x19e3a9)[_0x1fda('0x27')](_0x569167);};}exports['index']=function(_0x1e374d,_0xed596f){var _0x1decbd={},_0x3b9ec3={},_0x318b43={'count':0x0,'rows':[]};var _0x714461=_['map'](db[_0x1fda('0x28')][_0x1fda('0x29')],function(_0x56115a){return{'name':_0x56115a[_0x1fda('0x2a')],'type':_0x56115a[_0x1fda('0x2b')][_0x1fda('0x2c')]};});_0x3b9ec3[_0x1fda('0x2d')]=_[_0x1fda('0x2e')](_0x714461,'name');_0x3b9ec3[_0x1fda('0x2f')]=_[_0x1fda('0x30')](_0x1e374d['query']);_0x3b9ec3[_0x1fda('0x31')]=_[_0x1fda('0x32')](_0x3b9ec3[_0x1fda('0x2d')],_0x3b9ec3['query']);_0x1decbd[_0x1fda('0x33')]=_[_0x1fda('0x32')](_0x3b9ec3[_0x1fda('0x2d')],qs[_0x1fda('0x34')](_0x1e374d['query'][_0x1fda('0x34')]));_0x1decbd[_0x1fda('0x33')]=_0x1decbd['attributes'][_0x1fda('0x35')]?_0x1decbd[_0x1fda('0x33')]:_0x3b9ec3['model'];if(!_0x1e374d[_0x1fda('0x2f')][_0x1fda('0x36')](_0x1fda('0x37'))){_0x1decbd['limit']=qs[_0x1fda('0x1b')](_0x1e374d[_0x1fda('0x2f')]['limit']);_0x1decbd[_0x1fda('0x18')]=qs[_0x1fda('0x18')](_0x1e374d[_0x1fda('0x2f')][_0x1fda('0x18')]);}_0x1decbd[_0x1fda('0x38')]=qs['sort'](_0x1e374d[_0x1fda('0x2f')][_0x1fda('0x39')]);_0x1decbd[_0x1fda('0x3a')]=qs['filters'](_[_0x1fda('0x3b')](_0x1e374d[_0x1fda('0x2f')],_0x3b9ec3[_0x1fda('0x31')]),_0x714461);if(_0x1e374d[_0x1fda('0x2f')][_0x1fda('0x3c')]){_0x1decbd[_0x1fda('0x3a')]=_[_0x1fda('0x3d')](_0x1decbd[_0x1fda('0x3a')],{'$or':_[_0x1fda('0x2e')](_0x714461,function(_0xe71c7b){if(_0xe71c7b[_0x1fda('0x2b')]!=='VIRTUAL'){var _0x328d6b={};_0x328d6b[_0xe71c7b[_0x1fda('0x26')]]={'$like':'%'+_0x1e374d[_0x1fda('0x2f')][_0x1fda('0x3c')]+'%'};return _0x328d6b;}})});}_0x1decbd=_[_0x1fda('0x3d')]({},_0x1decbd,_0x1e374d['options']);var _0x220fe4={'where':_0x1decbd[_0x1fda('0x3a')]};return db[_0x1fda('0x28')][_0x1fda('0x1a')](_0x220fe4)[_0x1fda('0x21')](function(_0x13bbc3){_0x318b43[_0x1fda('0x1a')]=_0x13bbc3;if(_0x1e374d[_0x1fda('0x2f')][_0x1fda('0x3e')]){_0x1decbd['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x1fda('0x3f')](_0x1decbd);})[_0x1fda('0x21')](function(_0xa75c4f){_0x318b43[_0x1fda('0x40')]=_0xa75c4f;return _0x318b43;})[_0x1fda('0x21')](respondWithFilteredResult(_0xed596f,_0x1decbd))['catch'](handleError(_0xed596f,null));};exports[_0x1fda('0x41')]=function(_0x138cd0,_0x3d2c59){var _0x40641e={'raw':![],'where':{'id':_0x138cd0[_0x1fda('0x42')]['id']}},_0x330daf={};_0x330daf['model']=_[_0x1fda('0x30')](db[_0x1fda('0x28')][_0x1fda('0x29')]);_0x330daf['query']=_[_0x1fda('0x30')](_0x138cd0[_0x1fda('0x2f')]);_0x330daf[_0x1fda('0x31')]=_['intersection'](_0x330daf[_0x1fda('0x2d')],_0x330daf[_0x1fda('0x2f')]);_0x40641e[_0x1fda('0x33')]=_[_0x1fda('0x32')](_0x330daf[_0x1fda('0x2d')],qs[_0x1fda('0x34')](_0x138cd0[_0x1fda('0x2f')][_0x1fda('0x34')]));_0x40641e['attributes']=_0x40641e[_0x1fda('0x33')][_0x1fda('0x35')]?_0x40641e[_0x1fda('0x33')]:_0x330daf['model'];if(_0x138cd0['query'][_0x1fda('0x3e')]){_0x40641e[_0x1fda('0x43')]=[{'all':!![]}];}_0x40641e=_[_0x1fda('0x3d')]({},_0x40641e,_0x138cd0[_0x1fda('0x44')]);return db[_0x1fda('0x28')][_0x1fda('0x45')](_0x40641e)[_0x1fda('0x21')](handleEntityNotFound(_0x3d2c59,null))[_0x1fda('0x21')](respondWithResult(_0x3d2c59,null))[_0x1fda('0x46')](handleError(_0x3d2c59,null));};exports['create']=function(_0x55ce6b,_0x3fac6f){return db[_0x1fda('0x28')][_0x1fda('0x47')](_0x55ce6b[_0x1fda('0x48')],{})[_0x1fda('0x21')](respondWithResult(_0x3fac6f,0xc9))[_0x1fda('0x46')](handleError(_0x3fac6f,null));};exports[_0x1fda('0x20')]=function(_0x140975,_0x241ae5){if(_0x140975[_0x1fda('0x48')]['id']){delete _0x140975[_0x1fda('0x48')]['id'];}return db[_0x1fda('0x28')][_0x1fda('0x45')]({'where':{'id':_0x140975['params']['id']}})[_0x1fda('0x21')](handleEntityNotFound(_0x241ae5,null))[_0x1fda('0x21')](saveUpdates(_0x140975[_0x1fda('0x48')],null))[_0x1fda('0x21')](respondWithResult(_0x241ae5,null))[_0x1fda('0x46')](handleError(_0x241ae5,null));};exports[_0x1fda('0x22')]=function(_0x4a62c3,_0x547459){return db['VtigerConfiguration'][_0x1fda('0x45')]({'where':{'id':_0x4a62c3['params']['id']}})[_0x1fda('0x21')](handleEntityNotFound(_0x547459,null))[_0x1fda('0x21')](removeEntity(_0x547459,null))[_0x1fda('0x46')](handleError(_0x547459,null));};exports[_0x1fda('0x49')]=function(_0x444b50,_0x2dfc3e,_0x4561b8){var _0x5ddc2c={};var _0x393e57={};var _0x545294;var _0x2a5ca0;return db[_0x1fda('0x28')][_0x1fda('0x4a')]({'where':{'id':_0x444b50[_0x1fda('0x42')]['id']}})[_0x1fda('0x21')](handleEntityNotFound(_0x2dfc3e,null))['then'](function(_0x350429){if(_0x350429){_0x545294=_0x350429;_0x393e57[_0x1fda('0x2d')]=_['keys'](db['VtigerField'][_0x1fda('0x29')]);_0x393e57[_0x1fda('0x2f')]=_['keys'](_0x444b50['query']);_0x393e57[_0x1fda('0x31')]=_[_0x1fda('0x32')](_0x393e57[_0x1fda('0x2d')],_0x393e57[_0x1fda('0x2f')]);_0x5ddc2c[_0x1fda('0x33')]=_['intersection'](_0x393e57[_0x1fda('0x2d')],qs[_0x1fda('0x34')](_0x444b50[_0x1fda('0x2f')][_0x1fda('0x34')]));_0x5ddc2c[_0x1fda('0x33')]=_0x5ddc2c[_0x1fda('0x33')][_0x1fda('0x35')]?_0x5ddc2c[_0x1fda('0x33')]:_0x393e57[_0x1fda('0x2d')];_0x5ddc2c[_0x1fda('0x38')]=qs[_0x1fda('0x39')](_0x444b50[_0x1fda('0x2f')][_0x1fda('0x39')]);_0x5ddc2c['where']=qs[_0x1fda('0x31')](_[_0x1fda('0x3b')](_0x444b50[_0x1fda('0x2f')],_0x393e57[_0x1fda('0x31')]));if(_0x444b50[_0x1fda('0x2f')][_0x1fda('0x3c')]){_0x5ddc2c['where']=_['merge'](_0x5ddc2c['where'],{'$or':_[_0x1fda('0x2e')](_0x5ddc2c['attributes'],function(_0x571a18){var _0x2378b7={};_0x2378b7[_0x571a18]={'$like':'%'+_0x444b50[_0x1fda('0x2f')][_0x1fda('0x3c')]+'%'};return _0x2378b7;})});}_0x5ddc2c=_[_0x1fda('0x3d')]({},_0x5ddc2c,_0x444b50['options']);return _0x545294[_0x1fda('0x49')](_0x5ddc2c);}})[_0x1fda('0x21')](function(_0x493b4b){if(_0x493b4b){_0x2a5ca0=_0x493b4b[_0x1fda('0x35')];if(!_0x444b50[_0x1fda('0x2f')]['hasOwnProperty'](_0x1fda('0x37'))){_0x5ddc2c['limit']=qs[_0x1fda('0x1b')](_0x444b50[_0x1fda('0x2f')][_0x1fda('0x1b')]);_0x5ddc2c[_0x1fda('0x18')]=qs[_0x1fda('0x18')](_0x444b50[_0x1fda('0x2f')][_0x1fda('0x18')]);}return _0x545294[_0x1fda('0x49')](_0x5ddc2c);}})[_0x1fda('0x21')](function(_0x31f4f6){if(_0x31f4f6){return _0x31f4f6?{'count':_0x2a5ca0,'rows':_0x31f4f6}:null;}})['then'](respondWithResult(_0x2dfc3e,null))[_0x1fda('0x46')](handleError(_0x2dfc3e,null));};exports[_0x1fda('0x4b')]=function(_0x58a172,_0x671ae1,_0x4ec664){var _0x45b68e={};var _0x16ddce={};var _0x1beeb3;var _0x22f805;return db[_0x1fda('0x28')][_0x1fda('0x4a')]({'where':{'id':_0x58a172[_0x1fda('0x42')]['id']}})[_0x1fda('0x21')](handleEntityNotFound(_0x671ae1,null))['then'](function(_0x34b8bc){if(_0x34b8bc){_0x1beeb3=_0x34b8bc;_0x16ddce[_0x1fda('0x2d')]=_['keys'](db[_0x1fda('0x4c')][_0x1fda('0x29')]);_0x16ddce[_0x1fda('0x2f')]=_[_0x1fda('0x30')](_0x58a172[_0x1fda('0x2f')]);_0x16ddce[_0x1fda('0x31')]=_[_0x1fda('0x32')](_0x16ddce['model'],_0x16ddce[_0x1fda('0x2f')]);_0x45b68e[_0x1fda('0x33')]=_[_0x1fda('0x32')](_0x16ddce[_0x1fda('0x2d')],qs[_0x1fda('0x34')](_0x58a172[_0x1fda('0x2f')][_0x1fda('0x34')]));_0x45b68e[_0x1fda('0x33')]=_0x45b68e[_0x1fda('0x33')][_0x1fda('0x35')]?_0x45b68e[_0x1fda('0x33')]:_0x16ddce['model'];_0x45b68e[_0x1fda('0x38')]=qs['sort'](_0x58a172[_0x1fda('0x2f')]['sort']);_0x45b68e[_0x1fda('0x3a')]=qs['filters'](_['pick'](_0x58a172[_0x1fda('0x2f')],_0x16ddce[_0x1fda('0x31')]));if(_0x58a172[_0x1fda('0x2f')][_0x1fda('0x3c')]){_0x45b68e[_0x1fda('0x3a')]=_[_0x1fda('0x3d')](_0x45b68e[_0x1fda('0x3a')],{'$or':_[_0x1fda('0x2e')](_0x45b68e[_0x1fda('0x33')],function(_0x4ebb0b){var _0x2591fb={};_0x2591fb[_0x4ebb0b]={'$like':'%'+_0x58a172[_0x1fda('0x2f')][_0x1fda('0x3c')]+'%'};return _0x2591fb;})});}_0x45b68e=_[_0x1fda('0x3d')]({},_0x45b68e,_0x58a172['options']);return _0x1beeb3[_0x1fda('0x4b')](_0x45b68e);}})[_0x1fda('0x21')](function(_0x21bd0c){if(_0x21bd0c){_0x22f805=_0x21bd0c[_0x1fda('0x35')];if(!_0x58a172['query'][_0x1fda('0x36')](_0x1fda('0x37'))){_0x45b68e[_0x1fda('0x1b')]=qs['limit'](_0x58a172[_0x1fda('0x2f')][_0x1fda('0x1b')]);_0x45b68e[_0x1fda('0x18')]=qs[_0x1fda('0x18')](_0x58a172[_0x1fda('0x2f')][_0x1fda('0x18')]);}return _0x1beeb3[_0x1fda('0x4b')](_0x45b68e);}})[_0x1fda('0x21')](function(_0xbe944f){if(_0xbe944f){return _0xbe944f?{'count':_0x22f805,'rows':_0xbe944f}:null;}})[_0x1fda('0x21')](respondWithResult(_0x671ae1,null))[_0x1fda('0x46')](handleError(_0x671ae1,null));};exports['getDescriptions']=function(_0x2c64dd,_0x27e3c3,_0x13b53e){var _0x52de72={};var _0x212f07={};var _0xfc9bee;var _0x4c69fb;return db[_0x1fda('0x28')][_0x1fda('0x4a')]({'where':{'id':_0x2c64dd['params']['id']}})[_0x1fda('0x21')](handleEntityNotFound(_0x27e3c3,null))[_0x1fda('0x21')](function(_0x3b2eb0){if(_0x3b2eb0){_0xfc9bee=_0x3b2eb0;_0x212f07[_0x1fda('0x2d')]=_[_0x1fda('0x30')](db['VtigerField'][_0x1fda('0x29')]);_0x212f07[_0x1fda('0x2f')]=_[_0x1fda('0x30')](_0x2c64dd[_0x1fda('0x2f')]);_0x212f07[_0x1fda('0x31')]=_['intersection'](_0x212f07[_0x1fda('0x2d')],_0x212f07[_0x1fda('0x2f')]);_0x52de72[_0x1fda('0x33')]=_[_0x1fda('0x32')](_0x212f07[_0x1fda('0x2d')],qs['fields'](_0x2c64dd[_0x1fda('0x2f')][_0x1fda('0x34')]));_0x52de72[_0x1fda('0x33')]=_0x52de72[_0x1fda('0x33')][_0x1fda('0x35')]?_0x52de72[_0x1fda('0x33')]:_0x212f07[_0x1fda('0x2d')];_0x52de72['order']=qs['sort'](_0x2c64dd[_0x1fda('0x2f')][_0x1fda('0x39')]);_0x52de72['where']=qs[_0x1fda('0x31')](_[_0x1fda('0x3b')](_0x2c64dd[_0x1fda('0x2f')],_0x212f07['filters']));if(_0x2c64dd[_0x1fda('0x2f')][_0x1fda('0x3c')]){_0x52de72[_0x1fda('0x3a')]=_[_0x1fda('0x3d')](_0x52de72[_0x1fda('0x3a')],{'$or':_[_0x1fda('0x2e')](_0x52de72[_0x1fda('0x33')],function(_0x369ed1){var _0x11acd9={};_0x11acd9[_0x369ed1]={'$like':'%'+_0x2c64dd['query']['filter']+'%'};return _0x11acd9;})});}_0x52de72=_[_0x1fda('0x3d')]({},_0x52de72,_0x2c64dd[_0x1fda('0x44')]);return _0xfc9bee[_0x1fda('0x4d')](_0x52de72);}})[_0x1fda('0x21')](function(_0x25bdb6){if(_0x25bdb6){_0x4c69fb=_0x25bdb6[_0x1fda('0x35')];if(!_0x2c64dd['query'][_0x1fda('0x36')](_0x1fda('0x37'))){_0x52de72[_0x1fda('0x1b')]=qs['limit'](_0x2c64dd[_0x1fda('0x2f')][_0x1fda('0x1b')]);_0x52de72['offset']=qs['offset'](_0x2c64dd[_0x1fda('0x2f')][_0x1fda('0x18')]);}return _0xfc9bee['getDescriptions'](_0x52de72);}})[_0x1fda('0x21')](function(_0x1e65ac){if(_0x1e65ac){return _0x1e65ac?{'count':_0x4c69fb,'rows':_0x1e65ac}:null;}})[_0x1fda('0x21')](respondWithResult(_0x27e3c3,null))[_0x1fda('0x46')](handleError(_0x27e3c3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b051c58..f536d60 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 _0x38e4=['path','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0xa5ae82,_0x76a637){var _0x324f35=function(_0x360e05){while(--_0x360e05){_0xa5ae82['push'](_0xa5ae82['shift']());}};_0x324f35(++_0x76a637);}(_0x38e4,0x1eb));var _0x438e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x38e4[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x438e('0x0'));var logger=require(_0x438e('0x1'))(_0x438e('0x2'));var moment=require(_0x438e('0x3'));var BPromise=require(_0x438e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x438e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x438e('0x6')]=function(_0x2710f9,_0x53bc92){return _0x2710f9[_0x438e('0x7')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85b4=['define','util','../../config/logger','api','bluebird','path','./intVtigerConfiguration.attributes','exports'];(function(_0x323586,_0x569de6){var _0x26b7c2=function(_0x2613be){while(--_0x2613be){_0x323586['push'](_0x323586['shift']());}};_0x26b7c2(++_0x569de6);}(_0x85b4,0x129));var _0x485b=function(_0x45fbc7,_0x2cf50d){_0x45fbc7=_0x45fbc7-0x0;var _0x392cfd=_0x85b4[_0x45fbc7];return _0x392cfd;};'use strict';var _=require('lodash');var util=require(_0x485b('0x0'));var logger=require(_0x485b('0x1'))(_0x485b('0x2'));var moment=require('moment');var BPromise=require(_0x485b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x485b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x485b('0x5'));module[_0x485b('0x6')]=function(_0x1dbac6,_0x4d00f0){return _0x1dbac6[_0x485b('0x7')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','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 6fbeb95..6f825d3 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 _0x264e=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x41888d,_0x50b4b4){var _0x2bb054=function(_0x19dbbb){while(--_0x19dbbb){_0x41888d['push'](_0x41888d['shift']());}};_0x2bb054(++_0x50b4b4);}(_0x264e,0xaf));var _0xe264=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x264e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe264('0x0'));var util=require(_0xe264('0x1'));var moment=require(_0xe264('0x2'));var BPromise=require(_0xe264('0x3'));var rs=require(_0xe264('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe264('0x5'));var logger=require(_0xe264('0x6'))(_0xe264('0x7'));var config=require(_0xe264('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe264('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5dcc2e,_0x423b5d,_0x4d904d){return new BPromise(function(_0x27c864,_0x2a4f9e){return client[_0xe264('0xa')](_0x5dcc2e,_0x4d904d)[_0xe264('0xb')](function(_0x40b90f){logger[_0xe264('0xc')](_0xe264('0xd'),_0x423b5d,'request\x20sent');logger['debug'](_0xe264('0xe'),_0x423b5d,'request\x20sent',JSON[_0xe264('0xf')](_0x40b90f));if(_0x40b90f[_0xe264('0x10')]){if(_0x40b90f[_0xe264('0x10')][_0xe264('0x11')]===0x1f4){logger[_0xe264('0x10')](_0xe264('0xd'),_0x423b5d,_0x40b90f[_0xe264('0x10')]['message']);return _0x2a4f9e(_0x40b90f[_0xe264('0x10')][_0xe264('0x12')]);}logger[_0xe264('0x10')](_0xe264('0xd'),_0x423b5d,_0x40b90f[_0xe264('0x10')][_0xe264('0x12')]);return _0x27c864(_0x40b90f[_0xe264('0x10')][_0xe264('0x12')]);}else{logger[_0xe264('0xc')](_0xe264('0xd'),_0x423b5d,'request\x20sent');_0x27c864(_0x40b90f[_0xe264('0x13')][_0xe264('0x12')]);}})[_0xe264('0x14')](function(_0x3a1bdb){logger[_0xe264('0x10')](_0xe264('0xd'),_0x423b5d,_0x3a1bdb);_0x2a4f9e(_0x3a1bdb);});});} \ No newline at end of file +var _0x34d4=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x51f415,_0x5b55e6){var _0x585a0d=function(_0x1872bd){while(--_0x1872bd){_0x51f415['push'](_0x51f415['shift']());}};_0x585a0d(++_0x5b55e6);}(_0x34d4,0xa8));var _0x434d=function(_0x218e4f,_0x58c3a0){_0x218e4f=_0x218e4f-0x0;var _0x5baac3=_0x34d4[_0x218e4f];return _0x5baac3;};'use strict';var _=require(_0x434d('0x0'));var util=require(_0x434d('0x1'));var moment=require('moment');var BPromise=require(_0x434d('0x2'));var rs=require(_0x434d('0x3'));var fs=require('fs');var Redis=require(_0x434d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x434d('0x5'));var logger=require(_0x434d('0x6'))(_0x434d('0x7'));var config=require(_0x434d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x434d('0x9')][_0x434d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3577e8,_0x4cee78,_0x3ed287){return new BPromise(function(_0x44cd1d,_0x2c99ad){return client[_0x434d('0xb')](_0x3577e8,_0x3ed287)[_0x434d('0xc')](function(_0x18ac14){logger[_0x434d('0xd')](_0x434d('0xe'),_0x4cee78,_0x434d('0xf'));logger[_0x434d('0x10')](_0x434d('0x11'),_0x4cee78,_0x434d('0xf'),JSON[_0x434d('0x12')](_0x18ac14));if(_0x18ac14['error']){if(_0x18ac14[_0x434d('0x13')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4cee78,_0x18ac14[_0x434d('0x13')][_0x434d('0x14')]);return _0x2c99ad(_0x18ac14[_0x434d('0x13')]['message']);}logger[_0x434d('0x13')](_0x434d('0xe'),_0x4cee78,_0x18ac14[_0x434d('0x13')][_0x434d('0x14')]);return _0x44cd1d(_0x18ac14[_0x434d('0x13')][_0x434d('0x14')]);}else{logger[_0x434d('0xd')](_0x434d('0xe'),_0x4cee78,_0x434d('0xf'));_0x44cd1d(_0x18ac14[_0x434d('0x15')]['message']);}})[_0x434d('0x16')](function(_0x5cc7b1){logger[_0x434d('0x13')](_0x434d('0xe'),_0x4cee78,_0x5cc7b1);_0x2c99ad(_0x5cc7b1);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b554338..4272bd2 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 _0x1c4c=['put','update','delete','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x556a32,_0x3e9dad){var _0x4daf3e=function(_0x1e8f9a){while(--_0x1e8f9a){_0x556a32['push'](_0x556a32['shift']());}};_0x4daf3e(++_0x3e9dad);}(_0x1c4c,0x133));var _0xc1c4=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0x1c4c[_0x1bb6aa];return _0x2ef28e;};'use strict';var multer=require('multer');var util=require(_0xc1c4('0x0'));var path=require(_0xc1c4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc1c4('0x2')]();var fs_extra=require(_0xc1c4('0x3'));var auth=require(_0xc1c4('0x4'));var interaction=require(_0xc1c4('0x5'));var config=require('../../config/environment');var controller=require(_0xc1c4('0x6'));router[_0xc1c4('0x7')]('/',auth[_0xc1c4('0x8')](),controller[_0xc1c4('0x9')]);router['get'](_0xc1c4('0xa'),auth[_0xc1c4('0x8')](),controller[_0xc1c4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc1c4('0xc')]);router[_0xc1c4('0xd')](_0xc1c4('0xa'),auth[_0xc1c4('0x8')](),controller[_0xc1c4('0xe')]);router[_0xc1c4('0xf')]('/:id',auth[_0xc1c4('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfdb4=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','update','exports'];(function(_0x4202ac,_0x49d407){var _0x4fb5a9=function(_0x2bfdc1){while(--_0x2bfdc1){_0x4202ac['push'](_0x4202ac['shift']());}};_0x4fb5a9(++_0x49d407);}(_0xfdb4,0x190));var _0x4fdb=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xfdb4[_0x13ce0c];return _0x4388fb;};'use strict';var multer=require('multer');var util=require(_0x4fdb('0x0'));var path=require(_0x4fdb('0x1'));var timeout=require(_0x4fdb('0x2'));var express=require(_0x4fdb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4fdb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4fdb('0x5'));var controller=require(_0x4fdb('0x6'));router[_0x4fdb('0x7')]('/',auth[_0x4fdb('0x8')](),controller['index']);router[_0x4fdb('0x7')](_0x4fdb('0x9'),auth[_0x4fdb('0x8')](),controller[_0x4fdb('0xa')]);router[_0x4fdb('0xb')]('/',auth[_0x4fdb('0x8')](),controller[_0x4fdb('0xc')]);router[_0x4fdb('0xd')](_0x4fdb('0x9'),auth[_0x4fdb('0x8')](),controller[_0x4fdb('0xe')]);router['delete'](_0x4fdb('0x9'),auth[_0x4fdb('0x8')](),controller['destroy']);module[_0x4fdb('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 18a79de..90d1a60 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 _0x8973=['STRING','variable','exports','string','customVariable','keyValue','picklist'];(function(_0x3188a6,_0x463625){var _0x29b6eb=function(_0x53022d){while(--_0x53022d){_0x3188a6['push'](_0x3188a6['shift']());}};_0x29b6eb(++_0x463625);}(_0x8973,0x8e));var _0x3897=function(_0x16e14d,_0x147c82){_0x16e14d=_0x16e14d-0x0;var _0x2874a6=_0x8973[_0x16e14d];return _0x2874a6;};'use strict';var Sequelize=require('sequelize');module[_0x3897('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3897('0x1'),'variable',_0x3897('0x2'),_0x3897('0x3'),_0x3897('0x4')),'defaultValue':_0x3897('0x1')},'content':{'type':Sequelize[_0x3897('0x5')]},'key':{'type':Sequelize[_0x3897('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x3897('0x1'),_0x3897('0x6'),_0x3897('0x2'))},'keyContent':{'type':Sequelize[_0x3897('0x5')]},'idField':{'type':Sequelize[_0x3897('0x5')]},'nameField':{'type':Sequelize[_0x3897('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0374=['variable','keyValue','picklist','string','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0xde9059,_0x750aab){var _0x23197d=function(_0x457724){while(--_0x457724){_0xde9059['push'](_0xde9059['shift']());}};_0x23197d(++_0x750aab);}(_0x0374,0xee));var _0x4037=function(_0xcde30,_0x41b695){_0xcde30=_0xcde30-0x0;var _0x502807=_0x0374[_0xcde30];return _0x502807;};'use strict';var Sequelize=require(_0x4037('0x0'));module[_0x4037('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x4037('0x2'),'customVariable',_0x4037('0x3'),_0x4037('0x4')),'defaultValue':_0x4037('0x5')},'content':{'type':Sequelize[_0x4037('0x6')]},'key':{'type':Sequelize[_0x4037('0x6')]},'keyType':{'type':Sequelize[_0x4037('0x7')](_0x4037('0x5'),_0x4037('0x2'),_0x4037('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4037('0x6')]},'nameField':{'type':Sequelize[_0x4037('0x6')]},'customField':{'type':Sequelize[_0x4037('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4037('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 13e1ff8..6aaf405 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 _0x137f=['catch','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','update','then','end','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','merge','find','create','body'];(function(_0x9df1df,_0x5bcbf0){var _0x146ada=function(_0x5146c3){while(--_0x5146c3){_0x9df1df['push'](_0x9df1df['shift']());}};_0x146ada(++_0x5bcbf0);}(_0x137f,0x165));var _0xf137=function(_0x31963d,_0x3ef53d){_0x31963d=_0x31963d-0x0;var _0x36d030=_0x137f[_0x31963d];return _0x36d030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf137('0x0'));var zipdir=require(_0xf137('0x1'));var jsonpatch=require(_0xf137('0x2'));var rp=require('request-promise');var moment=require(_0xf137('0x3'));var BPromise=require(_0xf137('0x4'));var Mustache=require('mustache');var util=require(_0xf137('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf137('0x6'));var ejs=require(_0xf137('0x7'));var fs=require('fs');var fs_extra=require(_0xf137('0x8'));var _=require(_0xf137('0x9'));var squel=require(_0xf137('0xa'));var crypto=require(_0xf137('0xb'));var jsforce=require(_0xf137('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf137('0xd'));var Redis=require(_0xf137('0xe'));var authService=require(_0xf137('0xf'));var qs=require(_0xf137('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf137('0x11'));var logger=require(_0xf137('0x12'))(_0xf137('0x13'));var utils=require(_0xf137('0x14'));var config=require(_0xf137('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf137('0x16'))['db'];function respondWithStatusCode(_0xf06428,_0x55cc06){_0x55cc06=_0x55cc06||0xcc;return function(_0x421d15){if(_0x421d15){return _0xf06428['sendStatus'](_0x55cc06);}return _0xf06428['status'](_0x55cc06)['end']();};}function respondWithResult(_0x4f274f,_0x50615e){_0x50615e=_0x50615e||0xc8;return function(_0x4e622d){if(_0x4e622d){return _0x4f274f[_0xf137('0x17')](_0x50615e)[_0xf137('0x18')](_0x4e622d);}};}function respondWithFilteredResult(_0x322466,_0x2b5c34){return function(_0x3ed628){if(_0x3ed628){var _0x168d8a=typeof _0x2b5c34[_0xf137('0x19')]===_0xf137('0x1a')&&typeof _0x2b5c34[_0xf137('0x1b')]==='undefined';var _0x1867bb=_0x3ed628[_0xf137('0x1c')];var _0x425e0a=_0x168d8a?0x0:_0x2b5c34[_0xf137('0x19')];var _0x1eb47e=_0x168d8a?_0x3ed628['count']:_0x2b5c34[_0xf137('0x19')]+_0x2b5c34[_0xf137('0x1b')];var _0x55c4fa;if(_0x1eb47e>=_0x1867bb){_0x1eb47e=_0x1867bb;_0x55c4fa=0xc8;}else{_0x55c4fa=0xce;}_0x322466[_0xf137('0x17')](_0x55c4fa);return _0x322466[_0xf137('0x1d')]('Content-Range',_0x425e0a+'-'+_0x1eb47e+'/'+_0x1867bb)[_0xf137('0x18')](_0x3ed628);}return null;};}function patchUpdates(_0x390c20){return function(_0x533367){try{jsonpatch['apply'](_0x533367,_0x390c20,!![]);}catch(_0x16f29b){return BPromise['reject'](_0x16f29b);}return _0x533367['save']();};}function saveUpdates(_0x5e8c90,_0x7f07b8){return function(_0x327fbc){if(_0x327fbc){return _0x327fbc[_0xf137('0x1e')](_0x5e8c90)[_0xf137('0x1f')](function(_0x11db5c){return _0x11db5c;});}return null;};}function removeEntity(_0x45e5fd,_0x87938a){return function(_0x45a8b3){if(_0x45a8b3){return _0x45a8b3['destroy']()['then'](function(){_0x45e5fd[_0xf137('0x17')](0xcc)[_0xf137('0x20')]();});}};}function handleEntityNotFound(_0xb3fbd0,_0x42087d){return function(_0x24b073){if(!_0x24b073){_0xb3fbd0[_0xf137('0x21')](0x194);}return _0x24b073;};}function handleError(_0x422604,_0x58f600){_0x58f600=_0x58f600||0x1f4;return function(_0x2fdbb7){logger[_0xf137('0x22')](_0x2fdbb7[_0xf137('0x23')]);if(_0x2fdbb7['name']){delete _0x2fdbb7[_0xf137('0x24')];}_0x422604[_0xf137('0x17')](_0x58f600)[_0xf137('0x25')](_0x2fdbb7);};}exports[_0xf137('0x26')]=function(_0x1dc77e,_0x326c25){var _0x5a162a={},_0xce4d5b={},_0x39f9cb={'count':0x0,'rows':[]};var _0x2ea912=_[_0xf137('0x27')](db[_0xf137('0x28')][_0xf137('0x29')],function(_0xab9b60){return{'name':_0xab9b60[_0xf137('0x2a')],'type':_0xab9b60[_0xf137('0x2b')]['key']};});_0xce4d5b[_0xf137('0x2c')]=_[_0xf137('0x27')](_0x2ea912,_0xf137('0x24'));_0xce4d5b['query']=_[_0xf137('0x2d')](_0x1dc77e['query']);_0xce4d5b[_0xf137('0x2e')]=_[_0xf137('0x2f')](_0xce4d5b[_0xf137('0x2c')],_0xce4d5b[_0xf137('0x30')]);_0x5a162a[_0xf137('0x31')]=_['intersection'](_0xce4d5b[_0xf137('0x2c')],qs[_0xf137('0x32')](_0x1dc77e[_0xf137('0x30')][_0xf137('0x32')]));_0x5a162a[_0xf137('0x31')]=_0x5a162a['attributes'][_0xf137('0x33')]?_0x5a162a[_0xf137('0x31')]:_0xce4d5b[_0xf137('0x2c')];if(!_0x1dc77e['query'][_0xf137('0x34')]('nolimit')){_0x5a162a[_0xf137('0x1b')]=qs[_0xf137('0x1b')](_0x1dc77e['query']['limit']);_0x5a162a[_0xf137('0x19')]=qs['offset'](_0x1dc77e[_0xf137('0x30')][_0xf137('0x19')]);}_0x5a162a[_0xf137('0x35')]=qs['sort'](_0x1dc77e[_0xf137('0x30')][_0xf137('0x36')]);_0x5a162a[_0xf137('0x37')]=qs[_0xf137('0x2e')](_[_0xf137('0x38')](_0x1dc77e[_0xf137('0x30')],_0xce4d5b[_0xf137('0x2e')]),_0x2ea912);if(_0x1dc77e['query'][_0xf137('0x39')]){_0x5a162a[_0xf137('0x37')]=_['merge'](_0x5a162a[_0xf137('0x37')],{'$or':_[_0xf137('0x27')](_0x2ea912,function(_0x4d7027){if(_0x4d7027[_0xf137('0x2b')]!==_0xf137('0x3a')){var _0x1907e3={};_0x1907e3[_0x4d7027[_0xf137('0x24')]]={'$like':'%'+_0x1dc77e['query'][_0xf137('0x39')]+'%'};return _0x1907e3;}})});}_0x5a162a=_['merge']({},_0x5a162a,_0x1dc77e[_0xf137('0x3b')]);var _0x77718d={'where':_0x5a162a[_0xf137('0x37')]};return db['VtigerField'][_0xf137('0x1c')](_0x77718d)[_0xf137('0x1f')](function(_0x1b3e5b){_0x39f9cb[_0xf137('0x1c')]=_0x1b3e5b;if(_0x1dc77e['query'][_0xf137('0x3c')]){_0x5a162a[_0xf137('0x3d')]=[{'all':!![]}];}return db[_0xf137('0x28')][_0xf137('0x3e')](_0x5a162a);})[_0xf137('0x1f')](function(_0x1dda00){_0x39f9cb[_0xf137('0x3f')]=_0x1dda00;return _0x39f9cb;})['then'](respondWithFilteredResult(_0x326c25,_0x5a162a))['catch'](handleError(_0x326c25,null));};exports[_0xf137('0x40')]=function(_0x108122,_0x137d96){var _0x33ac05={'raw':!![],'where':{'id':_0x108122['params']['id']}},_0x5d3102={};_0x5d3102[_0xf137('0x2c')]=_[_0xf137('0x2d')](db[_0xf137('0x28')][_0xf137('0x29')]);_0x5d3102[_0xf137('0x30')]=_[_0xf137('0x2d')](_0x108122[_0xf137('0x30')]);_0x5d3102[_0xf137('0x2e')]=_[_0xf137('0x2f')](_0x5d3102[_0xf137('0x2c')],_0x5d3102[_0xf137('0x30')]);_0x33ac05[_0xf137('0x31')]=_[_0xf137('0x2f')](_0x5d3102[_0xf137('0x2c')],qs['fields'](_0x108122[_0xf137('0x30')][_0xf137('0x32')]));_0x33ac05['attributes']=_0x33ac05[_0xf137('0x31')][_0xf137('0x33')]?_0x33ac05['attributes']:_0x5d3102[_0xf137('0x2c')];if(_0x108122[_0xf137('0x30')][_0xf137('0x3c')]){_0x33ac05[_0xf137('0x3d')]=[{'all':!![]}];}_0x33ac05=_[_0xf137('0x41')]({},_0x33ac05,_0x108122[_0xf137('0x3b')]);return db[_0xf137('0x28')][_0xf137('0x42')](_0x33ac05)[_0xf137('0x1f')](handleEntityNotFound(_0x137d96,null))['then'](respondWithResult(_0x137d96,null))['catch'](handleError(_0x137d96,null));};exports[_0xf137('0x43')]=function(_0x3fc595,_0x2b7f67){return db[_0xf137('0x28')][_0xf137('0x43')](_0x3fc595[_0xf137('0x44')],{})[_0xf137('0x1f')](respondWithResult(_0x2b7f67,0xc9))[_0xf137('0x45')](handleError(_0x2b7f67,null));};exports[_0xf137('0x1e')]=function(_0x309c68,_0x12fad7){if(_0x309c68[_0xf137('0x44')]['id']){delete _0x309c68[_0xf137('0x44')]['id'];}return db['VtigerField'][_0xf137('0x42')]({'where':{'id':_0x309c68['params']['id']}})['then'](handleEntityNotFound(_0x12fad7,null))[_0xf137('0x1f')](saveUpdates(_0x309c68[_0xf137('0x44')],null))[_0xf137('0x1f')](respondWithResult(_0x12fad7,null))[_0xf137('0x45')](handleError(_0x12fad7,null));};exports['destroy']=function(_0x290b52,_0x4599c7){return db['VtigerField'][_0xf137('0x42')]({'where':{'id':_0x290b52[_0xf137('0x46')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x4599c7,null))[_0xf137('0x1f')](removeEntity(_0x4599c7,null))[_0xf137('0x45')](handleError(_0x4599c7,null));}; \ No newline at end of file +var _0x27c3=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x5f3609,_0x231817){var _0x4f7b25=function(_0x3071f6){while(--_0x3071f6){_0x5f3609['push'](_0x5f3609['shift']());}};_0x4f7b25(++_0x231817);}(_0x27c3,0xdb));var _0x327c=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x27c3[_0xee3051];return _0x139e81;};'use strict';var emlformat=require(_0x327c('0x0'));var rimraf=require(_0x327c('0x1'));var zipdir=require(_0x327c('0x2'));var jsonpatch=require(_0x327c('0x3'));var rp=require(_0x327c('0x4'));var moment=require(_0x327c('0x5'));var BPromise=require(_0x327c('0x6'));var Mustache=require('mustache');var util=require(_0x327c('0x7'));var path=require('path');var sox=require(_0x327c('0x8'));var csv=require(_0x327c('0x9'));var ejs=require(_0x327c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x327c('0xb'));var squel=require(_0x327c('0xc'));var crypto=require(_0x327c('0xd'));var jsforce=require(_0x327c('0xe'));var deskjs=require(_0x327c('0xf'));var toCsv=require(_0x327c('0x9'));var querystring=require(_0x327c('0x10'));var Papa=require(_0x327c('0x11'));var Redis=require('ioredis');var authService=require(_0x327c('0x12'));var qs=require(_0x327c('0x13'));var as=require(_0x327c('0x14'));var hardwareService=require(_0x327c('0x15'));var logger=require(_0x327c('0x16'))(_0x327c('0x17'));var utils=require(_0x327c('0x18'));var config=require(_0x327c('0x19'));var licenseUtil=require(_0x327c('0x1a'));var db=require(_0x327c('0x1b'))['db'];function respondWithStatusCode(_0x46ee2b,_0x388863){_0x388863=_0x388863||0xcc;return function(_0x400255){if(_0x400255){return _0x46ee2b[_0x327c('0x1c')](_0x388863);}return _0x46ee2b[_0x327c('0x1d')](_0x388863)['end']();};}function respondWithResult(_0x2bd301,_0x1e12be){_0x1e12be=_0x1e12be||0xc8;return function(_0x392d61){if(_0x392d61){return _0x2bd301['status'](_0x1e12be)[_0x327c('0x1e')](_0x392d61);}};}function respondWithFilteredResult(_0xe68f2f,_0x278dbc){return function(_0x388eb6){if(_0x388eb6){var _0x3bbe4f=typeof _0x278dbc['offset']===_0x327c('0x1f')&&typeof _0x278dbc[_0x327c('0x20')]===_0x327c('0x1f');var _0x48eb48=_0x388eb6['count'];var _0x224072=_0x3bbe4f?0x0:_0x278dbc[_0x327c('0x21')];var _0x420c9e=_0x3bbe4f?_0x388eb6[_0x327c('0x22')]:_0x278dbc['offset']+_0x278dbc[_0x327c('0x20')];var _0x561c03;if(_0x420c9e>=_0x48eb48){_0x420c9e=_0x48eb48;_0x561c03=0xc8;}else{_0x561c03=0xce;}_0xe68f2f[_0x327c('0x1d')](_0x561c03);return _0xe68f2f[_0x327c('0x23')]('Content-Range',_0x224072+'-'+_0x420c9e+'/'+_0x48eb48)[_0x327c('0x1e')](_0x388eb6);}return null;};}function patchUpdates(_0x4512d8){return function(_0x2c3f1f){try{jsonpatch[_0x327c('0x24')](_0x2c3f1f,_0x4512d8,!![]);}catch(_0x1c8f5e){return BPromise[_0x327c('0x25')](_0x1c8f5e);}return _0x2c3f1f[_0x327c('0x26')]();};}function saveUpdates(_0x1ffa4e,_0xcfb969){return function(_0x526b7d){if(_0x526b7d){return _0x526b7d[_0x327c('0x27')](_0x1ffa4e)[_0x327c('0x28')](function(_0x1bce93){return _0x1bce93;});}return null;};}function removeEntity(_0xc4b150,_0x11e8a5){return function(_0x2accfc){if(_0x2accfc){return _0x2accfc[_0x327c('0x29')]()[_0x327c('0x28')](function(){_0xc4b150[_0x327c('0x1d')](0xcc)[_0x327c('0x2a')]();});}};}function handleEntityNotFound(_0x90b283,_0x11f10a){return function(_0x21a338){if(!_0x21a338){_0x90b283['sendStatus'](0x194);}return _0x21a338;};}function handleError(_0x11fd31,_0x2d588d){_0x2d588d=_0x2d588d||0x1f4;return function(_0x1fe5d7){logger[_0x327c('0x2b')](_0x1fe5d7[_0x327c('0x2c')]);if(_0x1fe5d7[_0x327c('0x2d')]){delete _0x1fe5d7[_0x327c('0x2d')];}_0x11fd31[_0x327c('0x1d')](_0x2d588d)['send'](_0x1fe5d7);};}exports[_0x327c('0x2e')]=function(_0xc949db,_0xd3ae01){var _0x538f94={},_0x19e2af={},_0x166f77={'count':0x0,'rows':[]};var _0xf628cc=_[_0x327c('0x2f')](db[_0x327c('0x30')][_0x327c('0x31')],function(_0x3411af){return{'name':_0x3411af[_0x327c('0x32')],'type':_0x3411af[_0x327c('0x33')]['key']};});_0x19e2af[_0x327c('0x34')]=_[_0x327c('0x2f')](_0xf628cc,_0x327c('0x2d'));_0x19e2af[_0x327c('0x35')]=_['keys'](_0xc949db[_0x327c('0x35')]);_0x19e2af[_0x327c('0x36')]=_['intersection'](_0x19e2af[_0x327c('0x34')],_0x19e2af['query']);_0x538f94[_0x327c('0x37')]=_[_0x327c('0x38')](_0x19e2af[_0x327c('0x34')],qs[_0x327c('0x39')](_0xc949db[_0x327c('0x35')][_0x327c('0x39')]));_0x538f94[_0x327c('0x37')]=_0x538f94[_0x327c('0x37')][_0x327c('0x3a')]?_0x538f94[_0x327c('0x37')]:_0x19e2af['model'];if(!_0xc949db['query'][_0x327c('0x3b')](_0x327c('0x3c'))){_0x538f94[_0x327c('0x20')]=qs[_0x327c('0x20')](_0xc949db[_0x327c('0x35')][_0x327c('0x20')]);_0x538f94['offset']=qs[_0x327c('0x21')](_0xc949db[_0x327c('0x35')][_0x327c('0x21')]);}_0x538f94[_0x327c('0x3d')]=qs[_0x327c('0x3e')](_0xc949db[_0x327c('0x35')]['sort']);_0x538f94[_0x327c('0x3f')]=qs[_0x327c('0x36')](_[_0x327c('0x40')](_0xc949db[_0x327c('0x35')],_0x19e2af[_0x327c('0x36')]),_0xf628cc);if(_0xc949db[_0x327c('0x35')][_0x327c('0x41')]){_0x538f94[_0x327c('0x3f')]=_[_0x327c('0x42')](_0x538f94[_0x327c('0x3f')],{'$or':_[_0x327c('0x2f')](_0xf628cc,function(_0x2b5ad4){if(_0x2b5ad4[_0x327c('0x33')]!=='VIRTUAL'){var _0x443361={};_0x443361[_0x2b5ad4[_0x327c('0x2d')]]={'$like':'%'+_0xc949db[_0x327c('0x35')][_0x327c('0x41')]+'%'};return _0x443361;}})});}_0x538f94=_[_0x327c('0x42')]({},_0x538f94,_0xc949db[_0x327c('0x43')]);var _0x54fb96={'where':_0x538f94[_0x327c('0x3f')]};return db[_0x327c('0x30')][_0x327c('0x22')](_0x54fb96)[_0x327c('0x28')](function(_0x4a45df){_0x166f77['count']=_0x4a45df;if(_0xc949db['query'][_0x327c('0x44')]){_0x538f94[_0x327c('0x45')]=[{'all':!![]}];}return db[_0x327c('0x30')]['findAll'](_0x538f94);})[_0x327c('0x28')](function(_0x2afa1c){_0x166f77[_0x327c('0x46')]=_0x2afa1c;return _0x166f77;})[_0x327c('0x28')](respondWithFilteredResult(_0xd3ae01,_0x538f94))[_0x327c('0x47')](handleError(_0xd3ae01,null));};exports[_0x327c('0x48')]=function(_0x4afce2,_0x2b1378){var _0x3c0aac={'raw':!![],'where':{'id':_0x4afce2[_0x327c('0x49')]['id']}},_0x16b537={};_0x16b537[_0x327c('0x34')]=_[_0x327c('0x4a')](db[_0x327c('0x30')][_0x327c('0x31')]);_0x16b537[_0x327c('0x35')]=_[_0x327c('0x4a')](_0x4afce2[_0x327c('0x35')]);_0x16b537['filters']=_[_0x327c('0x38')](_0x16b537[_0x327c('0x34')],_0x16b537[_0x327c('0x35')]);_0x3c0aac['attributes']=_[_0x327c('0x38')](_0x16b537[_0x327c('0x34')],qs[_0x327c('0x39')](_0x4afce2[_0x327c('0x35')][_0x327c('0x39')]));_0x3c0aac[_0x327c('0x37')]=_0x3c0aac[_0x327c('0x37')][_0x327c('0x3a')]?_0x3c0aac[_0x327c('0x37')]:_0x16b537['model'];if(_0x4afce2[_0x327c('0x35')]['includeAll']){_0x3c0aac[_0x327c('0x45')]=[{'all':!![]}];}_0x3c0aac=_[_0x327c('0x42')]({},_0x3c0aac,_0x4afce2[_0x327c('0x43')]);return db[_0x327c('0x30')][_0x327c('0x4b')](_0x3c0aac)[_0x327c('0x28')](handleEntityNotFound(_0x2b1378,null))[_0x327c('0x28')](respondWithResult(_0x2b1378,null))[_0x327c('0x47')](handleError(_0x2b1378,null));};exports[_0x327c('0x4c')]=function(_0x1e6915,_0x219aa0){return db[_0x327c('0x30')]['create'](_0x1e6915[_0x327c('0x4d')],{})[_0x327c('0x28')](respondWithResult(_0x219aa0,0xc9))[_0x327c('0x47')](handleError(_0x219aa0,null));};exports[_0x327c('0x27')]=function(_0xcf0ea7,_0x52c8a0){if(_0xcf0ea7[_0x327c('0x4d')]['id']){delete _0xcf0ea7[_0x327c('0x4d')]['id'];}return db[_0x327c('0x30')][_0x327c('0x4b')]({'where':{'id':_0xcf0ea7[_0x327c('0x49')]['id']}})[_0x327c('0x28')](handleEntityNotFound(_0x52c8a0,null))[_0x327c('0x28')](saveUpdates(_0xcf0ea7[_0x327c('0x4d')],null))[_0x327c('0x28')](respondWithResult(_0x52c8a0,null))[_0x327c('0x47')](handleError(_0x52c8a0,null));};exports['destroy']=function(_0x18c595,_0x4ab095){return db[_0x327c('0x30')]['find']({'where':{'id':_0x18c595['params']['id']}})[_0x327c('0x28')](handleEntityNotFound(_0x4ab095,null))[_0x327c('0x28')](removeEntity(_0x4ab095,null))[_0x327c('0x47')](handleError(_0x4ab095,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c4a3d7b..7d4ba1c 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 _0x0422=['FieldId','lodash','util','api','moment','request-promise','path','../../config/environment','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x318b2c,_0x14e316){var _0xdb848b=function(_0x19a00a){while(--_0x19a00a){_0x318b2c['push'](_0x318b2c['shift']());}};_0xdb848b(++_0x14e316);}(_0x0422,0x90));var _0x2042=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x0422[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x2042('0x0'));var util=require(_0x2042('0x1'));var logger=require('../../config/logger')(_0x2042('0x2'));var moment=require(_0x2042('0x3'));var BPromise=require('bluebird');var rp=require(_0x2042('0x4'));var fs=require('fs');var path=require(_0x2042('0x5'));var rimraf=require('rimraf');var config=require(_0x2042('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x2042('0x7')]=function(_0x2d981e,_0x23be96){return _0x2d981e['define'](_0x2042('0x8'),attributes,{'tableName':_0x2042('0x9'),'paranoid':![],'indexes':[{'name':_0x2042('0xa'),'fields':[_0x2042('0xb'),_0x2042('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x985e=['./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x4ed974,_0x1159f0){var _0x2928d3=function(_0x51e795){while(--_0x51e795){_0x4ed974['push'](_0x4ed974['shift']());}};_0x2928d3(++_0x1159f0);}(_0x985e,0x7e));var _0xe985=function(_0x2b29c8,_0x309f2b){_0x2b29c8=_0x2b29c8-0x0;var _0x1cb283=_0x985e[_0x2b29c8];return _0x1cb283;};'use strict';var _=require('lodash');var util=require(_0xe985('0x0'));var logger=require(_0xe985('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe985('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe985('0x3'));var rimraf=require(_0xe985('0x4'));var config=require(_0xe985('0x5'));var attributes=require(_0xe985('0x6'));module['exports']=function(_0x4e2fcd,_0x14b75e){return _0x4e2fcd[_0xe985('0x7')](_0xe985('0x8'),attributes,{'tableName':_0xe985('0x9'),'paranoid':![],'indexes':[{'name':_0xe985('0xa'),'fields':['idField',_0xe985('0xb')],'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 561beaf..75fb5d9 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 _0x26c7=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26c7,0x91));var _0x726c=function(_0x197767,_0x400276){_0x197767=_0x197767-0x0;var _0x5422c6=_0x26c7[_0x197767];return _0x5422c6;};'use strict';var _=require(_0x726c('0x0'));var util=require(_0x726c('0x1'));var moment=require(_0x726c('0x2'));var BPromise=require(_0x726c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x726c('0x4'));var db=require(_0x726c('0x5'))['db'];var utils=require(_0x726c('0x6'));var logger=require(_0x726c('0x7'))(_0x726c('0x8'));var config=require('../../config/environment');var jayson=require(_0x726c('0x9'));var client=jayson[_0x726c('0xa')][_0x726c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff057,_0x6c2fa,_0x1898da){return new BPromise(function(_0x24ed5c,_0x4b9717){return client[_0x726c('0xc')](_0x3ff057,_0x1898da)[_0x726c('0xd')](function(_0x5b1224){logger[_0x726c('0xe')](_0x726c('0xf'),_0x6c2fa,_0x726c('0x10'));logger[_0x726c('0x11')](_0x726c('0x12'),_0x6c2fa,_0x726c('0x10'),JSON[_0x726c('0x13')](_0x5b1224));if(_0x5b1224[_0x726c('0x14')]){if(_0x5b1224[_0x726c('0x14')][_0x726c('0x15')]===0x1f4){logger[_0x726c('0x14')](_0x726c('0xf'),_0x6c2fa,_0x5b1224[_0x726c('0x14')][_0x726c('0x16')]);return _0x4b9717(_0x5b1224['error'][_0x726c('0x16')]);}logger[_0x726c('0x14')](_0x726c('0xf'),_0x6c2fa,_0x5b1224['error'][_0x726c('0x16')]);return _0x24ed5c(_0x5b1224[_0x726c('0x14')][_0x726c('0x16')]);}else{logger['info'](_0x726c('0xf'),_0x6c2fa,_0x726c('0x10'));_0x24ed5c(_0x5b1224[_0x726c('0x17')][_0x726c('0x16')]);}})['catch'](function(_0x81ace7){logger[_0x726c('0x14')](_0x726c('0xf'),_0x6c2fa,_0x81ace7);_0x4b9717(_0x81ace7);});});} \ No newline at end of file +var _0xb91c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','request','then','info','debug','stringify','error','code','message','VtigerField,\x20%s,\x20%s','request\x20sent','catch','lodash'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0xb91c,0xdb));var _0xcb91=function(_0x129e98,_0x211c1b){_0x129e98=_0x129e98-0x0;var _0x51f336=_0xb91c[_0x129e98];return _0x51f336;};'use strict';var _=require(_0xcb91('0x0'));var util=require(_0xcb91('0x1'));var moment=require(_0xcb91('0x2'));var BPromise=require(_0xcb91('0x3'));var rs=require(_0xcb91('0x4'));var fs=require('fs');var Redis=require(_0xcb91('0x5'));var db=require(_0xcb91('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcb91('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb91('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bf7a9,_0x5547b1,_0x16c34d){return new BPromise(function(_0x367976,_0x1e48d6){return client[_0xcb91('0x9')](_0x4bf7a9,_0x16c34d)[_0xcb91('0xa')](function(_0x4c352e){logger[_0xcb91('0xb')]('VtigerField,\x20%s,\x20%s',_0x5547b1,'request\x20sent');logger[_0xcb91('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x5547b1,'request\x20sent',JSON[_0xcb91('0xd')](_0x4c352e));if(_0x4c352e[_0xcb91('0xe')]){if(_0x4c352e[_0xcb91('0xe')][_0xcb91('0xf')]===0x1f4){logger[_0xcb91('0xe')]('VtigerField,\x20%s,\x20%s',_0x5547b1,_0x4c352e['error'][_0xcb91('0x10')]);return _0x1e48d6(_0x4c352e[_0xcb91('0xe')][_0xcb91('0x10')]);}logger[_0xcb91('0xe')](_0xcb91('0x11'),_0x5547b1,_0x4c352e[_0xcb91('0xe')]['message']);return _0x367976(_0x4c352e[_0xcb91('0xe')][_0xcb91('0x10')]);}else{logger[_0xcb91('0xb')](_0xcb91('0x11'),_0x5547b1,_0xcb91('0x12'));_0x367976(_0x4c352e['result']['message']);}})[_0xcb91('0x13')](function(_0x5a3c37){logger[_0xcb91('0xe')](_0xcb91('0x11'),_0x5547b1,_0x5a3c37);_0x1e48d6(_0x5a3c37);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 18c5832..38a6ade 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 _0xd65f=['fs-extra','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x449b81,_0x4b2a6f){var _0xb9b60c=function(_0x2e9e0a){while(--_0x2e9e0a){_0x449b81['push'](_0x449b81['shift']());}};_0xb9b60c(++_0x4b2a6f);}(_0xd65f,0x171));var _0xfd65=function(_0x414584,_0x1a1da6){_0x414584=_0x414584-0x0;var _0x50b255=_0xd65f[_0x414584];return _0x50b255;};'use strict';var multer=require(_0xfd65('0x0'));var util=require(_0xfd65('0x1'));var path=require('path');var timeout=require(_0xfd65('0x2'));var express=require(_0xfd65('0x3'));var router=express[_0xfd65('0x4')]();var fs_extra=require(_0xfd65('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd65('0x6'));var config=require('../../config/environment');var controller=require(_0xfd65('0x7'));router['get']('/',auth[_0xfd65('0x8')](),controller['index']);router[_0xfd65('0x9')](_0xfd65('0xa'),auth[_0xfd65('0x8')](),controller[_0xfd65('0xb')]);router['get'](_0xfd65('0xc'),auth['isAuthenticated'](),controller[_0xfd65('0xd')]);router['get'](_0xfd65('0xe'),auth[_0xfd65('0x8')](),controller[_0xfd65('0xf')]);router[_0xfd65('0x10')]('/',auth['isAuthenticated'](),controller[_0xfd65('0x11')]);router[_0xfd65('0x10')](_0xfd65('0xc'),auth[_0xfd65('0x8')](),controller['addConfiguration']);router[_0xfd65('0x12')](_0xfd65('0xa'),auth[_0xfd65('0x8')](),controller[_0xfd65('0x13')]);router[_0xfd65('0x14')](_0xfd65('0xa'),auth[_0xfd65('0x8')](),controller['destroy']);module[_0xfd65('0x15')]=router; \ No newline at end of file +var _0x066b=['getConfigurations','/:id/fields','getFields','post','create','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated'];(function(_0x141177,_0x2944fc){var _0x3014ad=function(_0x17f0af){while(--_0x17f0af){_0x141177['push'](_0x141177['shift']());}};_0x3014ad(++_0x2944fc);}(_0x066b,0x161));var _0xb066=function(_0x3d6cd2,_0x51c00d){_0x3d6cd2=_0x3d6cd2-0x0;var _0xcf9b94=_0x066b[_0x3d6cd2];return _0xcf9b94;};'use strict';var multer=require(_0xb066('0x0'));var util=require(_0xb066('0x1'));var path=require(_0xb066('0x2'));var timeout=require(_0xb066('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb066('0x4'));var auth=require(_0xb066('0x5'));var interaction=require(_0xb066('0x6'));var config=require(_0xb066('0x7'));var controller=require(_0xb066('0x8'));router[_0xb066('0x9')]('/',auth['isAuthenticated'](),controller[_0xb066('0xa')]);router[_0xb066('0x9')](_0xb066('0xb'),auth['isAuthenticated'](),controller[_0xb066('0xc')]);router[_0xb066('0x9')](_0xb066('0xd'),auth[_0xb066('0xe')](),controller[_0xb066('0xf')]);router[_0xb066('0x9')](_0xb066('0x10'),auth[_0xb066('0xe')](),controller[_0xb066('0x11')]);router[_0xb066('0x12')]('/',auth['isAuthenticated'](),controller[_0xb066('0x13')]);router[_0xb066('0x12')](_0xb066('0xd'),auth[_0xb066('0xe')](),controller['addConfiguration']);router['put'](_0xb066('0xb'),auth[_0xb066('0xe')](),controller['update']);router[_0xb066('0x14')](_0xb066('0xb'),auth[_0xb066('0xe')](),controller[_0xb066('0x15')]);module[_0xb066('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 71f8696..6b73bb1 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 _0xf417=['STRING','username','password','ENUM','integrationTab','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf417,0x8f));var _0x7f41=function(_0x41216a,_0x53e83d){_0x41216a=_0x41216a-0x0;var _0x122cf1=_0xf417[_0x41216a];return _0x122cf1;};'use strict';var Sequelize=require('sequelize');module[_0x7f41('0x0')]={'name':{'type':Sequelize[_0x7f41('0x1')]},'description':{'type':Sequelize[_0x7f41('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x7f41('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7f41('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':_0x7f41('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7f41('0x4')](_0x7f41('0x5'),'newTab'),'defaultValue':_0x7f41('0x5')}}; \ No newline at end of file +var _0x1623=['password','integrationTab','newTab','sequelize','STRING','username','ENUM','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x535b9b,_0x2b47eb){_0x535b9b=_0x535b9b-0x0;var _0x117a94=_0x1623[_0x535b9b];return _0x117a94;};'use strict';var Sequelize=require(_0x3162('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3162('0x1')]},'username':{'type':Sequelize[_0x3162('0x1')],'unique':_0x3162('0x2')},'password':{'type':Sequelize[_0x3162('0x1')]},'token':{'type':Sequelize[_0x3162('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x3162('0x3')]('password',_0x3162('0x4')),'defaultValue':_0x3162('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x6'),_0x3162('0x7')),'defaultValue':_0x3162('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c83bd9d..1d8c70d 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 _0xb9be=['count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','AccountId','getSubjects','type','Descriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined'];(function(_0x542320,_0x51b33b){var _0x4e453a=function(_0xaa415e){while(--_0xaa415e){_0x542320['push'](_0x542320['shift']());}};_0x4e453a(++_0x51b33b);}(_0xb9be,0xc5));var _0xeb9b=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xb9be[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];var integrations=require(_0xeb9b('0x19'));function respondWithStatusCode(_0x2a01df,_0x51598f){_0x51598f=_0x51598f||0xcc;return function(_0x5e94e3){if(_0x5e94e3){return _0x2a01df['sendStatus'](_0x51598f);}return _0x2a01df[_0xeb9b('0x1a')](_0x51598f)[_0xeb9b('0x1b')]();};}function respondWithResult(_0x2674e6,_0x4ec46d){_0x4ec46d=_0x4ec46d||0xc8;return function(_0x5926e1){if(_0x5926e1){return _0x2674e6['status'](_0x4ec46d)[_0xeb9b('0x1c')](_0x5926e1);}};}function respondWithFilteredResult(_0x1a5f27,_0x406afd){return function(_0x3fa308){if(_0x3fa308){var _0x2c9aa6=typeof _0x406afd[_0xeb9b('0x1d')]===_0xeb9b('0x1e')&&typeof _0x406afd['limit']===_0xeb9b('0x1e');var _0x36e871=_0x3fa308[_0xeb9b('0x1f')];var _0x3a11e3=_0x2c9aa6?0x0:_0x406afd[_0xeb9b('0x1d')];var _0x1a140c=_0x2c9aa6?_0x3fa308[_0xeb9b('0x1f')]:_0x406afd[_0xeb9b('0x1d')]+_0x406afd[_0xeb9b('0x20')];var _0x26e312;if(_0x1a140c>=_0x36e871){_0x1a140c=_0x36e871;_0x26e312=0xc8;}else{_0x26e312=0xce;}_0x1a5f27['status'](_0x26e312);return _0x1a5f27[_0xeb9b('0x21')]('Content-Range',_0x3a11e3+'-'+_0x1a140c+'/'+_0x36e871)['json'](_0x3fa308);}return null;};}function patchUpdates(_0x580498){return function(_0x703f0b){try{jsonpatch['apply'](_0x703f0b,_0x580498,!![]);}catch(_0xbed5ce){return BPromise[_0xeb9b('0x22')](_0xbed5ce);}return _0x703f0b[_0xeb9b('0x23')]();};}function saveUpdates(_0x37d7e0,_0x3c8be7){return function(_0x43dab8){if(_0x43dab8){return _0x43dab8[_0xeb9b('0x24')](_0x37d7e0)[_0xeb9b('0x25')](function(_0x142d1c){return _0x142d1c;});}return null;};}function removeEntity(_0x46df93,_0x61c86d){return function(_0x296f95){if(_0x296f95){return _0x296f95[_0xeb9b('0x26')]()[_0xeb9b('0x25')](function(){_0x46df93[_0xeb9b('0x1a')](0xcc)[_0xeb9b('0x1b')]();});}};}function handleEntityNotFound(_0x4c997e,_0xd57390){return function(_0x4ed960){if(!_0x4ed960){_0x4c997e[_0xeb9b('0x27')](0x194);}return _0x4ed960;};}function handleError(_0x5d6846,_0x347ec1){_0x347ec1=_0x347ec1||0x1f4;return function(_0x4361b9){logger[_0xeb9b('0x28')](_0x4361b9[_0xeb9b('0x29')]);if(_0x4361b9['name']){delete _0x4361b9[_0xeb9b('0x2a')];}_0x5d6846[_0xeb9b('0x1a')](_0x347ec1)['send'](_0x4361b9);};}exports[_0xeb9b('0x2b')]=function(_0x33bb1d,_0x5ce745){var _0x2a4b51={},_0x2ea20f={},_0x4188d5={'count':0x0,'rows':[]};var _0x48c5f4=_[_0xeb9b('0x2c')](db['ZendeskAccount'][_0xeb9b('0x2d')],function(_0x4c1331){return{'name':_0x4c1331[_0xeb9b('0x2e')],'type':_0x4c1331['type'][_0xeb9b('0x2f')]};});_0x2ea20f['model']=_[_0xeb9b('0x2c')](_0x48c5f4,'name');_0x2ea20f[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x33bb1d[_0xeb9b('0x30')]);_0x2ea20f[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],_0x2ea20f[_0xeb9b('0x30')]);_0x2a4b51[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],qs['fields'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x2a4b51[_0xeb9b('0x35')]=_0x2a4b51[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x2a4b51[_0xeb9b('0x35')]:_0x2ea20f[_0xeb9b('0x34')];if(!_0x33bb1d['query'][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x2a4b51[_0xeb9b('0x20')]=qs['limit'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x20')]);_0x2a4b51[_0xeb9b('0x1d')]=qs[_0xeb9b('0x1d')](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}_0x2a4b51['order']=qs[_0xeb9b('0x3a')](_0x33bb1d[_0xeb9b('0x30')]['sort']);_0x2a4b51[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x33bb1d[_0xeb9b('0x30')],_0x2ea20f[_0xeb9b('0x32')]),_0x48c5f4);if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x3d')]){_0x2a4b51['where']=_[_0xeb9b('0x3e')](_0x2a4b51[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x48c5f4,function(_0x53d2f7){if(_0x53d2f7['type']!=='VIRTUAL'){var _0x26dc71={};_0x26dc71[_0x53d2f7[_0xeb9b('0x2a')]]={'$like':'%'+_0x33bb1d[_0xeb9b('0x30')]['filter']+'%'};return _0x26dc71;}})});}_0x2a4b51=_[_0xeb9b('0x3e')]({},_0x2a4b51,_0x33bb1d[_0xeb9b('0x3f')]);var _0x240d8d={'where':_0x2a4b51[_0xeb9b('0x3b')]};return db[_0xeb9b('0x40')][_0xeb9b('0x1f')](_0x240d8d)[_0xeb9b('0x25')](function(_0x492122){_0x4188d5[_0xeb9b('0x1f')]=_0x492122;if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0x2a4b51['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xeb9b('0x42')](_0x2a4b51);})[_0xeb9b('0x25')](function(_0x495998){_0x4188d5[_0xeb9b('0x43')]=_0x495998;return _0x4188d5;})['then'](respondWithFilteredResult(_0x5ce745,_0x2a4b51))[_0xeb9b('0x44')](handleError(_0x5ce745,null));};exports[_0xeb9b('0x45')]=function(_0x28b075,_0x300565){var _0xbee63e={'raw':![],'where':{'id':_0x28b075[_0xeb9b('0x46')]['id']}},_0x10f483={};_0x10f483[_0xeb9b('0x34')]=_[_0xeb9b('0x31')](db[_0xeb9b('0x40')][_0xeb9b('0x2d')]);_0x10f483[_0xeb9b('0x30')]=_['keys'](_0x28b075['query']);_0x10f483[_0xeb9b('0x32')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],_0x10f483[_0xeb9b('0x30')]);_0xbee63e[_0xeb9b('0x35')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],qs[_0xeb9b('0x36')](_0x28b075['query'][_0xeb9b('0x36')]));_0xbee63e[_0xeb9b('0x35')]=_0xbee63e[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0xbee63e[_0xeb9b('0x35')]:_0x10f483[_0xeb9b('0x34')];if(_0x28b075[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0xbee63e['include']=[{'all':!![]}];}_0xbee63e=_['merge']({},_0xbee63e,_0x28b075[_0xeb9b('0x3f')]);return db['ZendeskAccount']['find'](_0xbee63e)[_0xeb9b('0x25')](handleEntityNotFound(_0x300565,null))[_0xeb9b('0x25')](respondWithResult(_0x300565,null))[_0xeb9b('0x44')](handleError(_0x300565,null));};exports[_0xeb9b('0x47')]=function(_0x45bc74,_0x2fd6ee){return db['ZendeskAccount']['create'](_0x45bc74['body'],{})[_0xeb9b('0x25')](respondWithResult(_0x2fd6ee,0xc9))['catch'](handleError(_0x2fd6ee,null));};exports[_0xeb9b('0x24')]=function(_0x2ee59c,_0x2ae9bf){if(_0x2ee59c[_0xeb9b('0x48')]['id']){delete _0x2ee59c[_0xeb9b('0x48')]['id'];}return db[_0xeb9b('0x40')][_0xeb9b('0x49')]({'where':{'id':_0x2ee59c[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x2ae9bf,null))[_0xeb9b('0x25')](saveUpdates(_0x2ee59c['body'],null))['then'](respondWithResult(_0x2ae9bf,null))[_0xeb9b('0x44')](handleError(_0x2ae9bf,null));};exports[_0xeb9b('0x26')]=function(_0x542ef4,_0x19bfe9){return db['ZendeskAccount'][_0xeb9b('0x49')]({'where':{'id':_0x542ef4[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bfe9,null))['then'](removeEntity(_0x19bfe9,null))['catch'](handleError(_0x19bfe9,null));};exports[_0xeb9b('0x4a')]=function(_0x32d8cd,_0x263453,_0x4fe9d0){var _0x4ded40={};var _0x471161={};var _0x1833c2;var _0x3e6e73;return db[_0xeb9b('0x40')][_0xeb9b('0x4b')]({'where':{'id':_0x32d8cd[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x263453,null))[_0xeb9b('0x25')](function(_0x1fab7a){if(_0x1fab7a){_0x1833c2=_0x1fab7a;_0x471161['model']=_[_0xeb9b('0x31')](db['ZendeskConfiguration'][_0xeb9b('0x2d')]);_0x471161[_0xeb9b('0x30')]=_['keys'](_0x32d8cd[_0xeb9b('0x30')]);_0x471161['filters']=_[_0xeb9b('0x33')](_0x471161[_0xeb9b('0x34')],_0x471161[_0xeb9b('0x30')]);_0x4ded40[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x471161['model'],qs[_0xeb9b('0x36')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x4ded40['attributes']=_0x4ded40[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x4ded40[_0xeb9b('0x35')]:_0x471161[_0xeb9b('0x34')];_0x4ded40[_0xeb9b('0x4c')]=qs[_0xeb9b('0x3a')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3a')]);_0x4ded40[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x32d8cd['query'],_0x471161['filters']));if(_0x32d8cd['query'][_0xeb9b('0x3d')]){_0x4ded40['where']=_[_0xeb9b('0x3e')](_0x4ded40[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x4ded40['attributes'],function(_0x27deea){var _0xb29d24={};_0xb29d24[_0x27deea]={'$like':'%'+_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3d')]+'%'};return _0xb29d24;})});}_0x4ded40=_[_0xeb9b('0x3e')]({},_0x4ded40,_0x32d8cd[_0xeb9b('0x3f')]);return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x58a3e2){if(_0x58a3e2){_0x3e6e73=_0x58a3e2['length'];if(!_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x4ded40['limit']=qs[_0xeb9b('0x20')](_0x32d8cd['query'][_0xeb9b('0x20')]);_0x4ded40['offset']=qs[_0xeb9b('0x1d')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x4be938){if(_0x4be938){return _0x4be938?{'count':_0x3e6e73,'rows':_0x4be938}:null;}})[_0xeb9b('0x25')](respondWithResult(_0x263453,null))[_0xeb9b('0x44')](handleError(_0x263453,null));};exports['addConfiguration']=function(_0x5a690a,_0x436470,_0x39c248){if(_0x5a690a['body']['id']){delete _0x5a690a[_0xeb9b('0x48')]['id'];}return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x5a690a['params']['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x436470,null))[_0xeb9b('0x25')](function(_0x417221){if(_0x417221){_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4d')]=_0x417221['id'];_0x5a690a[_0xeb9b('0x48')]['Subjects']=integrations[_0xeb9b('0x4e')](_0x5a690a[_0xeb9b('0x48')]['channel'],_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4f')]);_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x50')]=integrations['getDescriptions'](_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x51')],_0x5a690a['body'][_0xeb9b('0x4f')]);return db[_0xeb9b('0x52')][_0xeb9b('0x47')](_0x5a690a[_0xeb9b('0x48')],{'include':[{'model':db[_0xeb9b('0x53')],'as':_0xeb9b('0x54')},{'model':db[_0xeb9b('0x53')],'as':'Descriptions'}]});}return null;})[_0xeb9b('0x25')](respondWithResult(_0x436470,null))[_0xeb9b('0x44')](handleError(_0x436470,null));};exports['getFields']=function(_0x289654,_0x6a85fd,_0x2fb07e){var _0x25398e='';return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x289654[_0xeb9b('0x46')]['id']},'attributes':['id',_0xeb9b('0x55'),_0xeb9b('0x56'),_0xeb9b('0x57'),_0xeb9b('0x58'),_0xeb9b('0x59')]})[_0xeb9b('0x25')](handleEntityNotFound(_0x6a85fd,null))[_0xeb9b('0x25')](function(_0x128d43){if(_0x128d43){_0x25398e=_0x128d43[_0xeb9b('0x59')];var _0xbbde9c=_0x25398e[_0xeb9b('0x5a')](-0x1);if(_0xbbde9c==='/'){_0x25398e=_0x25398e[_0xeb9b('0x5b')](0x0,_0x25398e[_0xeb9b('0x5c')](_0xbbde9c));}var _0xd619ca={'method':'GET','uri':util[_0xeb9b('0x5d')](_0xeb9b('0x5e'),_0x25398e,_0xeb9b('0x5f')),'json':!![]};switch(_0x128d43['authType']){case'password':_0xd619ca[_0xeb9b('0x60')]={'Authorization':util['format'](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')](_0xeb9b('0x62'),_0x128d43[_0xeb9b('0x55')],_0x128d43[_0xeb9b('0x56')]))[_0xeb9b('0x63')](_0xeb9b('0x64')))};break;case _0xeb9b('0x57'):_0xd619ca[_0xeb9b('0x60')]={'Authorization':util[_0xeb9b('0x5d')](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')]('%s/token:%s',_0x128d43['username'],_0x128d43[_0xeb9b('0x57')]))['toString']('base64'))};break;default:throw new db[(_0xeb9b('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0xd619ca);}})['then'](function(_0x346ba9){if(_0x346ba9){var _0x3147bc=[_0xeb9b('0x66'),_0xeb9b('0x67'),'group',_0xeb9b('0x68')];_[_0xeb9b('0x69')](_0x346ba9[_0xeb9b('0x5f')],function(_0x4e5cfb){return _0x3147bc['includes'](_0x4e5cfb[_0xeb9b('0x4f')]);});return{'count':_0x346ba9['ticket_fields'][_0xeb9b('0x37')],'rows':_['map'](_0x346ba9['ticket_fields'],function(_0xa7e9c3){return{'id':_0xa7e9c3['id'],'name':_0xa7e9c3['position']>0x7?_0xa7e9c3[_0xeb9b('0x6a')]:_0xa7e9c3['type'],'custom':_0xa7e9c3['position']>0x7?!![]:![],'options':_0xa7e9c3[_0xeb9b('0x6b')]?_0xa7e9c3[_0xeb9b('0x6b')]:_0xa7e9c3[_0xeb9b('0x6c')]?_0xa7e9c3[_0xeb9b('0x6c')]:[]};})};}})['then'](respondWithResult(_0x6a85fd,null))[_0xeb9b('0x44')](function(_0x31de58){var _0x3f395a=_0x289654[_0xeb9b('0x30')][_0xeb9b('0x6d')]?0x1f4:_0x31de58[_0xeb9b('0x6e')]||0x1f4;logger['error'](_0xeb9b('0x6f'),'getFields',_0x3f395a,JSON[_0xeb9b('0x70')](_0x31de58));delete _0x31de58[_0xeb9b('0x2a')];if(_0x3f395a===0x191){_0x3f395a=0x190;}_0x6a85fd['status'](_0x3f395a)[_0xeb9b('0x71')](_0x289654['query'][_0xeb9b('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x31de58[_0xeb9b('0x6e')]}:_0x31de58);});}; \ No newline at end of file +var _0x1d2d=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','username','token','substring','lastIndexOf','GET','format','%s/%s','authType','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','ticket_fields','includes'];(function(_0x5c795a,_0x3c4995){var _0x8951a=function(_0x253161){while(--_0x253161){_0x5c795a['push'](_0x5c795a['shift']());}};_0x8951a(++_0x3c4995);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x144e0b,_0x1285ca){_0x144e0b=_0x144e0b-0x0;var _0x1f3a5b=_0x1d2d[_0x144e0b];return _0x1f3a5b;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['ZendeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['ZendeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['ZendeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['ZendeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'password',_0xd1d2('0x54'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x89ec63){if(_0x89ec63){_0x2175ab=_0x89ec63['remoteUri'];var _0x37591f=_0x2175ab['slice'](-0x1);if(_0x37591f==='/'){_0x2175ab=_0x2175ab[_0xd1d2('0x55')](0x0,_0x2175ab[_0xd1d2('0x56')](_0x37591f));}var _0x16cc6c={'method':_0xd1d2('0x57'),'uri':util[_0xd1d2('0x58')](_0xd1d2('0x59'),_0x2175ab,'ticket_fields'),'json':!![]};switch(_0x89ec63[_0xd1d2('0x5a')]){case _0xd1d2('0x5b'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util[_0xd1d2('0x58')](_0xd1d2('0x5e'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x5b')]))[_0xd1d2('0x5f')]('base64'))};break;case _0xd1d2('0x54'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util['format'](_0xd1d2('0x60'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x54')]))['toString'](_0xd1d2('0x61')))};break;default:throw new db[(_0xd1d2('0x62'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x16cc6c);}})[_0xd1d2('0x28')](function(_0x268d6d){if(_0x268d6d){var _0x3fbd87=[_0xd1d2('0x63'),_0xd1d2('0x64'),_0xd1d2('0x65'),_0xd1d2('0x66')];_['remove'](_0x268d6d[_0xd1d2('0x67')],function(_0x9a98d4){return _0x3fbd87[_0xd1d2('0x68')](_0x9a98d4[_0xd1d2('0x30')]);});return{'count':_0x268d6d[_0xd1d2('0x67')][_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x268d6d[_0xd1d2('0x67')],function(_0x44409e){return{'id':_0x44409e['id'],'name':_0x44409e[_0xd1d2('0x69')]>0x7?_0x44409e[_0xd1d2('0x6a')]:_0x44409e[_0xd1d2('0x30')],'custom':_0x44409e[_0xd1d2('0x69')]>0x7?!![]:![],'options':_0x44409e[_0xd1d2('0x6b')]?_0x44409e['system_field_options']:_0x44409e[_0xd1d2('0x6c')]?_0x44409e[_0xd1d2('0x6c')]:[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x20a3f0){var _0x32c294=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?0x1f4:_0x20a3f0[_0xd1d2('0x6e')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6f'),_0xd1d2('0x70'),_0x32c294,JSON[_0xd1d2('0x71')](_0x20a3f0));delete _0x20a3f0['name'];if(_0x32c294===0x191){_0x32c294=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x32c294)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?{'message':_0xd1d2('0x72'),'statusCode':_0x20a3f0[_0xd1d2('0x6e')]}:_0x20a3f0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index ee763c9..9aab3cb 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 _0x4ab1=['../../config/logger','moment','request-promise','../../config/environment','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x4ab1,0xe4));var _0x14ab=function(_0x1362e0,_0x2ac729){_0x1362e0=_0x1362e0-0x0;var _0x3a73d2=_0x4ab1[_0x1362e0];return _0x3a73d2;};'use strict';var _=require(_0x14ab('0x0'));var util=require(_0x14ab('0x1'));var logger=require(_0x14ab('0x2'))('api');var moment=require(_0x14ab('0x3'));var BPromise=require('bluebird');var rp=require(_0x14ab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x14ab('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x14ab('0x6'));module['exports']=function(_0x6d18d1,_0x456738){return _0x6d18d1[_0x14ab('0x7')](_0x14ab('0x8'),attributes,{'tableName':_0x14ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdc3=['bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','lodash','util','../../config/logger','api'];(function(_0x1c6315,_0x114ff7){var _0x19074f=function(_0x10b203){while(--_0x10b203){_0x1c6315['push'](_0x1c6315['shift']());}};_0x19074f(++_0x114ff7);}(_0xfdc3,0x1be));var _0x3fdc=function(_0x43bcbf,_0x4d6833){_0x43bcbf=_0x43bcbf-0x0;var _0x5af252=_0xfdc3[_0x43bcbf];return _0x5af252;};'use strict';var _=require(_0x3fdc('0x0'));var util=require(_0x3fdc('0x1'));var logger=require(_0x3fdc('0x2'))(_0x3fdc('0x3'));var moment=require('moment');var BPromise=require(_0x3fdc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fdc('0x5'));var rimraf=require(_0x3fdc('0x6'));var config=require(_0x3fdc('0x7'));var attributes=require(_0x3fdc('0x8'));var integrations=require(_0x3fdc('0x9'));module['exports']=function(_0x55ef63,_0x121f6c){return _0x55ef63['define']('ZendeskAccount',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 62c2c9e..e29cc05 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 _0x23f4=['where','attributes','limit','include','map','model','debug','GetZendeskAccount','stringify','ShowZendeskAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ZendeskAccount','options','raw'];(function(_0x5916f6,_0x4c1e70){var _0x296b63=function(_0x100bdf){while(--_0x100bdf){_0x5916f6['push'](_0x5916f6['shift']());}};_0x296b63(++_0x4c1e70);}(_0x23f4,0x97));var _0x423f=function(_0x5d0ada,_0x4442d2){_0x5d0ada=_0x5d0ada-0x0;var _0x57ac2f=_0x23f4[_0x5d0ada];return _0x57ac2f;};'use strict';var _=require(_0x423f('0x0'));var util=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require('bluebird');var rs=require(_0x423f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x423f('0x4'))['db'];var utils=require(_0x423f('0x5'));var logger=require(_0x423f('0x6'))(_0x423f('0x7'));var config=require(_0x423f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x423f('0x9')][_0x423f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c516d,_0x508714,_0xdc0afa){return new BPromise(function(_0x2f1bcd,_0x279082){return client[_0x423f('0xb')](_0x3c516d,_0xdc0afa)[_0x423f('0xc')](function(_0x4750af){logger[_0x423f('0xd')](_0x423f('0xe'),_0x508714,_0x423f('0xf'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x508714,_0x423f('0xf'),JSON['stringify'](_0x4750af));if(_0x4750af[_0x423f('0x10')]){if(_0x4750af[_0x423f('0x10')][_0x423f('0x11')]===0x1f4){logger['error'](_0x423f('0xe'),_0x508714,_0x4750af[_0x423f('0x10')][_0x423f('0x12')]);return _0x279082(_0x4750af[_0x423f('0x10')][_0x423f('0x12')]);}logger[_0x423f('0x10')](_0x423f('0xe'),_0x508714,_0x4750af[_0x423f('0x10')][_0x423f('0x12')]);return _0x2f1bcd(_0x4750af[_0x423f('0x10')][_0x423f('0x12')]);}else{logger[_0x423f('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x508714,_0x423f('0xf'));_0x2f1bcd(_0x4750af[_0x423f('0x13')][_0x423f('0x12')]);}})[_0x423f('0x14')](function(_0x3e313d){logger[_0x423f('0x10')](_0x423f('0xe'),_0x508714,_0x3e313d);_0x279082(_0x3e313d);});});}exports['GetZendeskAccount']=function(_0x1e4d60){var _0x224af8=this;return new Promise(function(_0x3161fc,_0x37c888){return db[_0x423f('0x15')]['findAll']({'raw':_0x1e4d60[_0x423f('0x16')]?_0x1e4d60['options'][_0x423f('0x17')]===undefined?!![]:![]:!![],'where':_0x1e4d60[_0x423f('0x16')]?_0x1e4d60[_0x423f('0x16')][_0x423f('0x18')]||null:null,'attributes':_0x1e4d60[_0x423f('0x16')]?_0x1e4d60[_0x423f('0x16')][_0x423f('0x19')]||null:null,'limit':_0x1e4d60[_0x423f('0x16')]?_0x1e4d60[_0x423f('0x16')][_0x423f('0x1a')]||null:null,'include':_0x1e4d60[_0x423f('0x16')]?_0x1e4d60[_0x423f('0x16')][_0x423f('0x1b')]?_[_0x423f('0x1c')](_0x1e4d60[_0x423f('0x16')][_0x423f('0x1b')],function(_0x41bfe9){return{'model':db[_0x41bfe9[_0x423f('0x1d')]],'as':_0x41bfe9['as'],'attributes':_0x41bfe9[_0x423f('0x19')],'include':_0x41bfe9[_0x423f('0x1b')]?_['map'](_0x41bfe9['include'],function(_0x45aba4){return{'model':db[_0x45aba4[_0x423f('0x1d')]],'as':_0x45aba4['as'],'attributes':_0x45aba4[_0x423f('0x19')],'include':_0x45aba4[_0x423f('0x1b')]?_[_0x423f('0x1c')](_0x45aba4['include'],function(_0x2c514c){return{'model':db[_0x2c514c[_0x423f('0x1d')]],'as':_0x2c514c['as'],'attributes':_0x2c514c[_0x423f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e2277){logger[_0x423f('0xd')]('GetZendeskAccount',_0x1e4d60);logger[_0x423f('0x1e')](_0x423f('0x1f'),_0x1e4d60,JSON[_0x423f('0x20')](_0x4e2277));_0x3161fc(_0x4e2277);})[_0x423f('0x14')](function(_0x5f5443){logger[_0x423f('0x10')](_0x423f('0x1f'),_0x5f5443[_0x423f('0x12')],_0x1e4d60);_0x37c888(_0x224af8[_0x423f('0x10')](0x1f4,_0x5f5443[_0x423f('0x12')]));});});};exports[_0x423f('0x21')]=function(_0x5b6cce){var _0x2c0e28=this;return new Promise(function(_0x3d413a,_0x3edc4f){return db[_0x423f('0x15')][_0x423f('0x22')]({'raw':_0x5b6cce['options']?_0x5b6cce[_0x423f('0x16')][_0x423f('0x17')]===undefined?!![]:![]:!![],'where':_0x5b6cce[_0x423f('0x16')]?_0x5b6cce['options'][_0x423f('0x18')]||null:null,'attributes':_0x5b6cce[_0x423f('0x16')]?_0x5b6cce['options'][_0x423f('0x19')]||null:null,'include':_0x5b6cce[_0x423f('0x16')]?_0x5b6cce['options'][_0x423f('0x1b')]?_[_0x423f('0x1c')](_0x5b6cce[_0x423f('0x16')][_0x423f('0x1b')],function(_0x329c89){return{'model':db[_0x329c89[_0x423f('0x1d')]],'as':_0x329c89['as'],'attributes':_0x329c89['attributes'],'include':_0x329c89['include']?_[_0x423f('0x1c')](_0x329c89[_0x423f('0x1b')],function(_0x33b921){return{'model':db[_0x33b921[_0x423f('0x1d')]],'as':_0x33b921['as'],'attributes':_0x33b921[_0x423f('0x19')],'include':_0x33b921[_0x423f('0x1b')]?_[_0x423f('0x1c')](_0x33b921[_0x423f('0x1b')],function(_0x1e7e7c){return{'model':db[_0x1e7e7c[_0x423f('0x1d')]],'as':_0x1e7e7c['as'],'attributes':_0x1e7e7c[_0x423f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x423f('0xc')](function(_0x3dd070){logger[_0x423f('0xd')]('ShowZendeskAccount',_0x5b6cce);logger['debug'](_0x423f('0x21'),_0x5b6cce,JSON[_0x423f('0x20')](_0x3dd070));_0x3d413a(_0x3dd070);})['catch'](function(_0x5daa13){logger['error']('ShowZendeskAccount',_0x5daa13[_0x423f('0x12')],_0x5b6cce);_0x3edc4f(_0x2c0e28[_0x423f('0x10')](0x1f4,_0x5daa13[_0x423f('0x12')]));});});}; \ No newline at end of file +var _0x22f3=['include','map','model','stringify','ShowZendeskAccount','find','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit'];(function(_0x34d1d4,_0x1dbb66){var _0x56bbac=function(_0xddca63){while(--_0xddca63){_0x34d1d4['push'](_0x34d1d4['shift']());}};_0x56bbac(++_0x1dbb66);}(_0x22f3,0x73));var _0x322f=function(_0x5a97b8,_0x5a7945){_0x5a97b8=_0x5a97b8-0x0;var _0x54b165=_0x22f3[_0x5a97b8];return _0x54b165;};'use strict';var _=require(_0x322f('0x0'));var util=require(_0x322f('0x1'));var moment=require(_0x322f('0x2'));var BPromise=require('bluebird');var rs=require(_0x322f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x322f('0x4'))['db'];var utils=require(_0x322f('0x5'));var logger=require(_0x322f('0x6'))('rpc');var config=require(_0x322f('0x7'));var jayson=require(_0x322f('0x8'));var client=jayson[_0x322f('0x9')][_0x322f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x514221,_0x41ca9c,_0x3b64c6){return new BPromise(function(_0x4d4b9f,_0x4d1251){return client[_0x322f('0xb')](_0x514221,_0x3b64c6)[_0x322f('0xc')](function(_0x47c2ed){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x41ca9c,'request\x20sent');logger[_0x322f('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x41ca9c,_0x322f('0xe'),JSON['stringify'](_0x47c2ed));if(_0x47c2ed[_0x322f('0xf')]){if(_0x47c2ed[_0x322f('0xf')][_0x322f('0x10')]===0x1f4){logger[_0x322f('0xf')](_0x322f('0x11'),_0x41ca9c,_0x47c2ed[_0x322f('0xf')][_0x322f('0x12')]);return _0x4d1251(_0x47c2ed['error'][_0x322f('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x41ca9c,_0x47c2ed[_0x322f('0xf')][_0x322f('0x12')]);return _0x4d4b9f(_0x47c2ed[_0x322f('0xf')]['message']);}else{logger[_0x322f('0x13')](_0x322f('0x11'),_0x41ca9c,_0x322f('0xe'));_0x4d4b9f(_0x47c2ed[_0x322f('0x14')]['message']);}})[_0x322f('0x15')](function(_0x45c943){logger[_0x322f('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x41ca9c,_0x45c943);_0x4d1251(_0x45c943);});});}exports[_0x322f('0x16')]=function(_0x309a32){var _0x2f7ccf=this;return new Promise(function(_0x3c9254,_0x1d61e5){return db[_0x322f('0x17')][_0x322f('0x18')]({'raw':_0x309a32[_0x322f('0x19')]?_0x309a32[_0x322f('0x19')][_0x322f('0x1a')]===undefined?!![]:![]:!![],'where':_0x309a32[_0x322f('0x19')]?_0x309a32[_0x322f('0x19')]['where']||null:null,'attributes':_0x309a32['options']?_0x309a32[_0x322f('0x19')][_0x322f('0x1b')]||null:null,'limit':_0x309a32[_0x322f('0x19')]?_0x309a32[_0x322f('0x19')][_0x322f('0x1c')]||null:null,'include':_0x309a32[_0x322f('0x19')]?_0x309a32['options'][_0x322f('0x1d')]?_[_0x322f('0x1e')](_0x309a32[_0x322f('0x19')][_0x322f('0x1d')],function(_0x28dabf){return{'model':db[_0x28dabf[_0x322f('0x1f')]],'as':_0x28dabf['as'],'attributes':_0x28dabf[_0x322f('0x1b')],'include':_0x28dabf[_0x322f('0x1d')]?_[_0x322f('0x1e')](_0x28dabf['include'],function(_0x42f6f6){return{'model':db[_0x42f6f6[_0x322f('0x1f')]],'as':_0x42f6f6['as'],'attributes':_0x42f6f6[_0x322f('0x1b')],'include':_0x42f6f6[_0x322f('0x1d')]?_[_0x322f('0x1e')](_0x42f6f6[_0x322f('0x1d')],function(_0x19ea35){return{'model':db[_0x19ea35[_0x322f('0x1f')]],'as':_0x19ea35['as'],'attributes':_0x19ea35['attributes']};}):[]};}):[]};}):[]:[]})[_0x322f('0xc')](function(_0x3756c4){logger['info'](_0x322f('0x16'),_0x309a32);logger[_0x322f('0xd')]('GetZendeskAccount',_0x309a32,JSON[_0x322f('0x20')](_0x3756c4));_0x3c9254(_0x3756c4);})[_0x322f('0x15')](function(_0x166325){logger['error'](_0x322f('0x16'),_0x166325[_0x322f('0x12')],_0x309a32);_0x1d61e5(_0x2f7ccf[_0x322f('0xf')](0x1f4,_0x166325[_0x322f('0x12')]));});});};exports[_0x322f('0x21')]=function(_0x445fc4){var _0x404589=this;return new Promise(function(_0x2fa4b3,_0x3074b4){return db[_0x322f('0x17')][_0x322f('0x22')]({'raw':_0x445fc4[_0x322f('0x19')]?_0x445fc4[_0x322f('0x19')][_0x322f('0x1a')]===undefined?!![]:![]:!![],'where':_0x445fc4['options']?_0x445fc4[_0x322f('0x19')][_0x322f('0x23')]||null:null,'attributes':_0x445fc4[_0x322f('0x19')]?_0x445fc4[_0x322f('0x19')][_0x322f('0x1b')]||null:null,'include':_0x445fc4[_0x322f('0x19')]?_0x445fc4[_0x322f('0x19')]['include']?_[_0x322f('0x1e')](_0x445fc4[_0x322f('0x19')][_0x322f('0x1d')],function(_0x5cb7e0){return{'model':db[_0x5cb7e0[_0x322f('0x1f')]],'as':_0x5cb7e0['as'],'attributes':_0x5cb7e0[_0x322f('0x1b')],'include':_0x5cb7e0[_0x322f('0x1d')]?_['map'](_0x5cb7e0[_0x322f('0x1d')],function(_0x2071e4){return{'model':db[_0x2071e4[_0x322f('0x1f')]],'as':_0x2071e4['as'],'attributes':_0x2071e4[_0x322f('0x1b')],'include':_0x2071e4['include']?_[_0x322f('0x1e')](_0x2071e4['include'],function(_0x459c2f){return{'model':db[_0x459c2f[_0x322f('0x1f')]],'as':_0x459c2f['as'],'attributes':_0x459c2f[_0x322f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x322f('0xc')](function(_0x4d49aa){logger['info']('ShowZendeskAccount',_0x445fc4);logger['debug'](_0x322f('0x21'),_0x445fc4,JSON[_0x322f('0x20')](_0x4d49aa));_0x2fa4b3(_0x4d49aa);})[_0x322f('0x15')](function(_0x11cb4a){logger[_0x322f('0xf')](_0x322f('0x21'),_0x11cb4a[_0x322f('0x12')],_0x445fc4);_0x3074b4(_0x404589['error'](0x1f4,_0x11cb4a[_0x322f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 97b579c..93b32f7 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(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'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 _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x878f,0x173));var _0xf878=function(_0x1ef319,_0x529c63){_0x1ef319=_0x1ef319-0x0;var _0x2a6ad4=_0x878f[_0x1ef319];return _0x2a6ad4;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index ba489bd..f356bc9 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 _0xda5a=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda5a,0x198));var _0xada5=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xda5a[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require('sequelize');module[_0xada5('0x0')]={'name':{'type':Sequelize[_0xada5('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c44=['exports','STRING'];(function(_0x1f38c6,_0x428650){var _0x259367=function(_0x22bad0){while(--_0x22bad0){_0x1f38c6['push'](_0x1f38c6['shift']());}};_0x259367(++_0x428650);}(_0x6c44,0xb8));var _0x46c4=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x6c44[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require('sequelize');module[_0x46c4('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x46c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d0d8cec..689d3b7 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 _0xe8b9=['limit','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','index','map','ZendeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','includeAll','include','options','find','create','body','params','getFields','findOne','hasOwnProperty','getSubjects','getDescriptions','ZendeskField','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','count'];(function(_0x10e653,_0x59f1cc){var _0x328dfd=function(_0x2bc428){while(--_0x2bc428){_0x10e653['push'](_0x10e653['shift']());}};_0x328dfd(++_0x59f1cc);}(_0xe8b9,0x1d5));var _0x9e8b=function(_0x52cb03,_0x3fa29c){_0x52cb03=_0x52cb03-0x0;var _0x30eda2=_0xe8b9[_0x52cb03];return _0x30eda2;};'use strict';var emlformat=require(_0x9e8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e8b('0x1'));var jsonpatch=require(_0x9e8b('0x2'));var rp=require('request-promise');var moment=require(_0x9e8b('0x3'));var BPromise=require(_0x9e8b('0x4'));var Mustache=require(_0x9e8b('0x5'));var util=require(_0x9e8b('0x6'));var path=require(_0x9e8b('0x7'));var sox=require(_0x9e8b('0x8'));var csv=require(_0x9e8b('0x9'));var ejs=require(_0x9e8b('0xa'));var fs=require('fs');var fs_extra=require(_0x9e8b('0xb'));var _=require(_0x9e8b('0xc'));var squel=require('squel');var crypto=require(_0x9e8b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9e8b('0xe'));var toCsv=require(_0x9e8b('0x9'));var querystring=require('querystring');var Papa=require(_0x9e8b('0xf'));var Redis=require(_0x9e8b('0x10'));var authService=require(_0x9e8b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9e8b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e8b('0x13'))(_0x9e8b('0x14'));var utils=require(_0x9e8b('0x15'));var config=require(_0x9e8b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e8b('0x17'))['db'];function respondWithStatusCode(_0x5b8c07,_0x28495f){_0x28495f=_0x28495f||0xcc;return function(_0x469750){if(_0x469750){return _0x5b8c07[_0x9e8b('0x18')](_0x28495f);}return _0x5b8c07['status'](_0x28495f)['end']();};}function respondWithResult(_0x37337f,_0x3ad3b3){_0x3ad3b3=_0x3ad3b3||0xc8;return function(_0x50430f){if(_0x50430f){return _0x37337f[_0x9e8b('0x19')](_0x3ad3b3)[_0x9e8b('0x1a')](_0x50430f);}};}function respondWithFilteredResult(_0x3d4fd9,_0x4eacff){return function(_0x277668){if(_0x277668){var _0x46310e=typeof _0x4eacff[_0x9e8b('0x1b')]==='undefined'&&typeof _0x4eacff['limit']==='undefined';var _0x1d8a9c=_0x277668[_0x9e8b('0x1c')];var _0xcc762d=_0x46310e?0x0:_0x4eacff['offset'];var _0x5b42ef=_0x46310e?_0x277668[_0x9e8b('0x1c')]:_0x4eacff['offset']+_0x4eacff[_0x9e8b('0x1d')];var _0x1b9ec6;if(_0x5b42ef>=_0x1d8a9c){_0x5b42ef=_0x1d8a9c;_0x1b9ec6=0xc8;}else{_0x1b9ec6=0xce;}_0x3d4fd9[_0x9e8b('0x19')](_0x1b9ec6);return _0x3d4fd9[_0x9e8b('0x1e')](_0x9e8b('0x1f'),_0xcc762d+'-'+_0x5b42ef+'/'+_0x1d8a9c)[_0x9e8b('0x1a')](_0x277668);}return null;};}function patchUpdates(_0xad1ae1){return function(_0x5d79ae){try{jsonpatch[_0x9e8b('0x20')](_0x5d79ae,_0xad1ae1,!![]);}catch(_0x57fb14){return BPromise['reject'](_0x57fb14);}return _0x5d79ae[_0x9e8b('0x21')]();};}function saveUpdates(_0x91bc82,_0x3c419c){return function(_0x1303b0){if(_0x1303b0){return _0x1303b0[_0x9e8b('0x22')](_0x91bc82)['then'](function(_0x427a4e){return _0x427a4e;});}return null;};}function removeEntity(_0x491e7e,_0x5d3299){return function(_0x2e0284){if(_0x2e0284){return _0x2e0284[_0x9e8b('0x23')]()[_0x9e8b('0x24')](function(){_0x491e7e['status'](0xcc)[_0x9e8b('0x25')]();});}};}function handleEntityNotFound(_0x27e1c2,_0x569941){return function(_0x437523){if(!_0x437523){_0x27e1c2[_0x9e8b('0x18')](0x194);}return _0x437523;};}function handleError(_0x5c56ee,_0x2e5fac){_0x2e5fac=_0x2e5fac||0x1f4;return function(_0x4c1cd7){logger[_0x9e8b('0x26')](_0x4c1cd7['stack']);if(_0x4c1cd7[_0x9e8b('0x27')]){delete _0x4c1cd7[_0x9e8b('0x27')];}_0x5c56ee['status'](_0x2e5fac)[_0x9e8b('0x28')](_0x4c1cd7);};}exports[_0x9e8b('0x29')]=function(_0x3958f5,_0x12c9be){var _0x375290={},_0x4fe82a={},_0x458b9b={'count':0x0,'rows':[]};var _0x3b4c7c=_[_0x9e8b('0x2a')](db[_0x9e8b('0x2b')][_0x9e8b('0x2c')],function(_0x5281e9){return{'name':_0x5281e9['fieldName'],'type':_0x5281e9[_0x9e8b('0x2d')]['key']};});_0x4fe82a[_0x9e8b('0x2e')]=_[_0x9e8b('0x2a')](_0x3b4c7c,_0x9e8b('0x27'));_0x4fe82a[_0x9e8b('0x2f')]=_[_0x9e8b('0x30')](_0x3958f5[_0x9e8b('0x2f')]);_0x4fe82a[_0x9e8b('0x31')]=_[_0x9e8b('0x32')](_0x4fe82a['model'],_0x4fe82a['query']);_0x375290[_0x9e8b('0x33')]=_['intersection'](_0x4fe82a['model'],qs['fields'](_0x3958f5['query'][_0x9e8b('0x34')]));_0x375290[_0x9e8b('0x33')]=_0x375290[_0x9e8b('0x33')][_0x9e8b('0x35')]?_0x375290[_0x9e8b('0x33')]:_0x4fe82a['model'];if(!_0x3958f5[_0x9e8b('0x2f')]['hasOwnProperty'](_0x9e8b('0x36'))){_0x375290[_0x9e8b('0x1d')]=qs[_0x9e8b('0x1d')](_0x3958f5[_0x9e8b('0x2f')][_0x9e8b('0x1d')]);_0x375290[_0x9e8b('0x1b')]=qs[_0x9e8b('0x1b')](_0x3958f5[_0x9e8b('0x2f')][_0x9e8b('0x1b')]);}_0x375290[_0x9e8b('0x37')]=qs[_0x9e8b('0x38')](_0x3958f5['query'][_0x9e8b('0x38')]);_0x375290[_0x9e8b('0x39')]=qs[_0x9e8b('0x31')](_[_0x9e8b('0x3a')](_0x3958f5[_0x9e8b('0x2f')],_0x4fe82a[_0x9e8b('0x31')]),_0x3b4c7c);if(_0x3958f5[_0x9e8b('0x2f')]['filter']){_0x375290[_0x9e8b('0x39')]=_[_0x9e8b('0x3b')](_0x375290[_0x9e8b('0x39')],{'$or':_[_0x9e8b('0x2a')](_0x3b4c7c,function(_0x5d70d1){if(_0x5d70d1[_0x9e8b('0x2d')]!==_0x9e8b('0x3c')){var _0x111675={};_0x111675[_0x5d70d1[_0x9e8b('0x27')]]={'$like':'%'+_0x3958f5[_0x9e8b('0x2f')][_0x9e8b('0x3d')]+'%'};return _0x111675;}})});}_0x375290=_[_0x9e8b('0x3b')]({},_0x375290,_0x3958f5['options']);var _0x164ce7={'where':_0x375290[_0x9e8b('0x39')]};return db[_0x9e8b('0x2b')]['count'](_0x164ce7)[_0x9e8b('0x24')](function(_0x5ef30a){_0x458b9b[_0x9e8b('0x1c')]=_0x5ef30a;if(_0x3958f5['query']['includeAll']){_0x375290['include']=[{'all':!![]}];}return db[_0x9e8b('0x2b')][_0x9e8b('0x3e')](_0x375290);})[_0x9e8b('0x24')](function(_0x27f8ee){_0x458b9b[_0x9e8b('0x3f')]=_0x27f8ee;return _0x458b9b;})[_0x9e8b('0x24')](respondWithFilteredResult(_0x12c9be,_0x375290))[_0x9e8b('0x40')](handleError(_0x12c9be,null));};exports[_0x9e8b('0x41')]=function(_0x2c8e66,_0xcf23aa){var _0x53794c={'raw':![],'where':{'id':_0x2c8e66['params']['id']}},_0x1f21c7={};_0x1f21c7[_0x9e8b('0x2e')]=_['keys'](db[_0x9e8b('0x2b')][_0x9e8b('0x2c')]);_0x1f21c7['query']=_[_0x9e8b('0x30')](_0x2c8e66[_0x9e8b('0x2f')]);_0x1f21c7[_0x9e8b('0x31')]=_[_0x9e8b('0x32')](_0x1f21c7[_0x9e8b('0x2e')],_0x1f21c7[_0x9e8b('0x2f')]);_0x53794c[_0x9e8b('0x33')]=_[_0x9e8b('0x32')](_0x1f21c7[_0x9e8b('0x2e')],qs[_0x9e8b('0x34')](_0x2c8e66[_0x9e8b('0x2f')][_0x9e8b('0x34')]));_0x53794c[_0x9e8b('0x33')]=_0x53794c[_0x9e8b('0x33')]['length']?_0x53794c[_0x9e8b('0x33')]:_0x1f21c7[_0x9e8b('0x2e')];if(_0x2c8e66['query'][_0x9e8b('0x42')]){_0x53794c[_0x9e8b('0x43')]=[{'all':!![]}];}_0x53794c=_['merge']({},_0x53794c,_0x2c8e66[_0x9e8b('0x44')]);return db[_0x9e8b('0x2b')][_0x9e8b('0x45')](_0x53794c)[_0x9e8b('0x24')](handleEntityNotFound(_0xcf23aa,null))[_0x9e8b('0x24')](respondWithResult(_0xcf23aa,null))['catch'](handleError(_0xcf23aa,null));};exports['create']=function(_0x58dea6,_0x56d392){return db[_0x9e8b('0x2b')][_0x9e8b('0x46')](_0x58dea6[_0x9e8b('0x47')],{})[_0x9e8b('0x24')](respondWithResult(_0x56d392,0xc9))[_0x9e8b('0x40')](handleError(_0x56d392,null));};exports[_0x9e8b('0x22')]=function(_0x550b24,_0x42f9cc){if(_0x550b24['body']['id']){delete _0x550b24[_0x9e8b('0x47')]['id'];}return db['ZendeskConfiguration'][_0x9e8b('0x45')]({'where':{'id':_0x550b24[_0x9e8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x42f9cc,null))['then'](saveUpdates(_0x550b24[_0x9e8b('0x47')],null))[_0x9e8b('0x24')](respondWithResult(_0x42f9cc,null))[_0x9e8b('0x40')](handleError(_0x42f9cc,null));};exports[_0x9e8b('0x23')]=function(_0x15d45d,_0x4333c2){return db['ZendeskConfiguration']['find']({'where':{'id':_0x15d45d['params']['id']}})[_0x9e8b('0x24')](handleEntityNotFound(_0x4333c2,null))[_0x9e8b('0x24')](removeEntity(_0x4333c2,null))['catch'](handleError(_0x4333c2,null));};exports[_0x9e8b('0x49')]=function(_0x128c82,_0x2200b4,_0x49e4f7){var _0xe7ff04={};var _0x1f6209={};var _0x91c83e;var _0x5f29c8;return db['ZendeskConfiguration'][_0x9e8b('0x4a')]({'where':{'id':_0x128c82[_0x9e8b('0x48')]['id']}})[_0x9e8b('0x24')](handleEntityNotFound(_0x2200b4,null))[_0x9e8b('0x24')](function(_0x4f7113){if(_0x4f7113){_0x91c83e=_0x4f7113;_0x1f6209['model']=_[_0x9e8b('0x30')](db['ZendeskField'][_0x9e8b('0x2c')]);_0x1f6209[_0x9e8b('0x2f')]=_[_0x9e8b('0x30')](_0x128c82[_0x9e8b('0x2f')]);_0x1f6209['filters']=_[_0x9e8b('0x32')](_0x1f6209[_0x9e8b('0x2e')],_0x1f6209[_0x9e8b('0x2f')]);_0xe7ff04['attributes']=_[_0x9e8b('0x32')](_0x1f6209[_0x9e8b('0x2e')],qs['fields'](_0x128c82[_0x9e8b('0x2f')][_0x9e8b('0x34')]));_0xe7ff04[_0x9e8b('0x33')]=_0xe7ff04['attributes']['length']?_0xe7ff04[_0x9e8b('0x33')]:_0x1f6209[_0x9e8b('0x2e')];_0xe7ff04[_0x9e8b('0x37')]=qs[_0x9e8b('0x38')](_0x128c82[_0x9e8b('0x2f')][_0x9e8b('0x38')]);_0xe7ff04[_0x9e8b('0x39')]=qs[_0x9e8b('0x31')](_['pick'](_0x128c82['query'],_0x1f6209[_0x9e8b('0x31')]));if(_0x128c82[_0x9e8b('0x2f')][_0x9e8b('0x3d')]){_0xe7ff04[_0x9e8b('0x39')]=_['merge'](_0xe7ff04[_0x9e8b('0x39')],{'$or':_[_0x9e8b('0x2a')](_0xe7ff04['attributes'],function(_0x40bcef){var _0x1329e0={};_0x1329e0[_0x40bcef]={'$like':'%'+_0x128c82['query'][_0x9e8b('0x3d')]+'%'};return _0x1329e0;})});}_0xe7ff04=_[_0x9e8b('0x3b')]({},_0xe7ff04,_0x128c82[_0x9e8b('0x44')]);return _0x91c83e[_0x9e8b('0x49')](_0xe7ff04);}})[_0x9e8b('0x24')](function(_0x23030d){if(_0x23030d){_0x5f29c8=_0x23030d[_0x9e8b('0x35')];if(!_0x128c82[_0x9e8b('0x2f')][_0x9e8b('0x4b')]('nolimit')){_0xe7ff04[_0x9e8b('0x1d')]=qs[_0x9e8b('0x1d')](_0x128c82[_0x9e8b('0x2f')][_0x9e8b('0x1d')]);_0xe7ff04[_0x9e8b('0x1b')]=qs[_0x9e8b('0x1b')](_0x128c82[_0x9e8b('0x2f')][_0x9e8b('0x1b')]);}return _0x91c83e[_0x9e8b('0x49')](_0xe7ff04);}})['then'](function(_0x5b019c){if(_0x5b019c){return _0x5b019c?{'count':_0x5f29c8,'rows':_0x5b019c}:null;}})[_0x9e8b('0x24')](respondWithResult(_0x2200b4,null))[_0x9e8b('0x40')](handleError(_0x2200b4,null));};exports[_0x9e8b('0x4c')]=function(_0xa58923,_0x4baa96,_0x2d6e6a){var _0x25b6ad={};var _0x517611={};var _0x130ab9;var _0x350959;return db[_0x9e8b('0x2b')]['findOne']({'where':{'id':_0xa58923[_0x9e8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x4baa96,null))[_0x9e8b('0x24')](function(_0x2c59b9){if(_0x2c59b9){_0x130ab9=_0x2c59b9;_0x517611[_0x9e8b('0x2e')]=_[_0x9e8b('0x30')](db['ZendeskField'][_0x9e8b('0x2c')]);_0x517611[_0x9e8b('0x2f')]=_[_0x9e8b('0x30')](_0xa58923[_0x9e8b('0x2f')]);_0x517611[_0x9e8b('0x31')]=_[_0x9e8b('0x32')](_0x517611[_0x9e8b('0x2e')],_0x517611[_0x9e8b('0x2f')]);_0x25b6ad[_0x9e8b('0x33')]=_[_0x9e8b('0x32')](_0x517611['model'],qs[_0x9e8b('0x34')](_0xa58923['query']['fields']));_0x25b6ad[_0x9e8b('0x33')]=_0x25b6ad[_0x9e8b('0x33')]['length']?_0x25b6ad[_0x9e8b('0x33')]:_0x517611['model'];_0x25b6ad[_0x9e8b('0x37')]=qs[_0x9e8b('0x38')](_0xa58923[_0x9e8b('0x2f')][_0x9e8b('0x38')]);_0x25b6ad[_0x9e8b('0x39')]=qs[_0x9e8b('0x31')](_[_0x9e8b('0x3a')](_0xa58923[_0x9e8b('0x2f')],_0x517611['filters']));if(_0xa58923[_0x9e8b('0x2f')]['filter']){_0x25b6ad['where']=_[_0x9e8b('0x3b')](_0x25b6ad['where'],{'$or':_[_0x9e8b('0x2a')](_0x25b6ad['attributes'],function(_0x4a9689){var _0x282d2f={};_0x282d2f[_0x4a9689]={'$like':'%'+_0xa58923[_0x9e8b('0x2f')][_0x9e8b('0x3d')]+'%'};return _0x282d2f;})});}_0x25b6ad=_[_0x9e8b('0x3b')]({},_0x25b6ad,_0xa58923[_0x9e8b('0x44')]);return _0x130ab9[_0x9e8b('0x4c')](_0x25b6ad);}})[_0x9e8b('0x24')](function(_0x50232c){if(_0x50232c){_0x350959=_0x50232c[_0x9e8b('0x35')];if(!_0xa58923[_0x9e8b('0x2f')][_0x9e8b('0x4b')](_0x9e8b('0x36'))){_0x25b6ad[_0x9e8b('0x1d')]=qs[_0x9e8b('0x1d')](_0xa58923[_0x9e8b('0x2f')][_0x9e8b('0x1d')]);_0x25b6ad[_0x9e8b('0x1b')]=qs['offset'](_0xa58923[_0x9e8b('0x2f')][_0x9e8b('0x1b')]);}return _0x130ab9[_0x9e8b('0x4c')](_0x25b6ad);}})[_0x9e8b('0x24')](function(_0x363035){if(_0x363035){return _0x363035?{'count':_0x350959,'rows':_0x363035}:null;}})[_0x9e8b('0x24')](respondWithResult(_0x4baa96,null))['catch'](handleError(_0x4baa96,null));};exports[_0x9e8b('0x4d')]=function(_0x16b1e5,_0x1788e8,_0x424cdf){var _0x4ee53e={};var _0x13ecdd={};var _0x13e5ce;var _0x3ed89b;return db[_0x9e8b('0x2b')]['findOne']({'where':{'id':_0x16b1e5[_0x9e8b('0x48')]['id']}})[_0x9e8b('0x24')](handleEntityNotFound(_0x1788e8,null))[_0x9e8b('0x24')](function(_0x22c43a){if(_0x22c43a){_0x13e5ce=_0x22c43a;_0x13ecdd[_0x9e8b('0x2e')]=_[_0x9e8b('0x30')](db[_0x9e8b('0x4e')][_0x9e8b('0x2c')]);_0x13ecdd['query']=_[_0x9e8b('0x30')](_0x16b1e5['query']);_0x13ecdd['filters']=_['intersection'](_0x13ecdd[_0x9e8b('0x2e')],_0x13ecdd[_0x9e8b('0x2f')]);_0x4ee53e[_0x9e8b('0x33')]=_[_0x9e8b('0x32')](_0x13ecdd[_0x9e8b('0x2e')],qs[_0x9e8b('0x34')](_0x16b1e5['query'][_0x9e8b('0x34')]));_0x4ee53e[_0x9e8b('0x33')]=_0x4ee53e['attributes'][_0x9e8b('0x35')]?_0x4ee53e[_0x9e8b('0x33')]:_0x13ecdd[_0x9e8b('0x2e')];_0x4ee53e[_0x9e8b('0x37')]=qs[_0x9e8b('0x38')](_0x16b1e5[_0x9e8b('0x2f')][_0x9e8b('0x38')]);_0x4ee53e[_0x9e8b('0x39')]=qs[_0x9e8b('0x31')](_['pick'](_0x16b1e5[_0x9e8b('0x2f')],_0x13ecdd[_0x9e8b('0x31')]));if(_0x16b1e5['query']['filter']){_0x4ee53e[_0x9e8b('0x39')]=_[_0x9e8b('0x3b')](_0x4ee53e[_0x9e8b('0x39')],{'$or':_[_0x9e8b('0x2a')](_0x4ee53e['attributes'],function(_0x1726db){var _0xa4004={};_0xa4004[_0x1726db]={'$like':'%'+_0x16b1e5['query'][_0x9e8b('0x3d')]+'%'};return _0xa4004;})});}_0x4ee53e=_[_0x9e8b('0x3b')]({},_0x4ee53e,_0x16b1e5['options']);return _0x13e5ce[_0x9e8b('0x4d')](_0x4ee53e);}})[_0x9e8b('0x24')](function(_0x1d1f2c){if(_0x1d1f2c){_0x3ed89b=_0x1d1f2c[_0x9e8b('0x35')];if(!_0x16b1e5[_0x9e8b('0x2f')][_0x9e8b('0x4b')](_0x9e8b('0x36'))){_0x4ee53e[_0x9e8b('0x1d')]=qs['limit'](_0x16b1e5[_0x9e8b('0x2f')]['limit']);_0x4ee53e[_0x9e8b('0x1b')]=qs[_0x9e8b('0x1b')](_0x16b1e5[_0x9e8b('0x2f')][_0x9e8b('0x1b')]);}return _0x13e5ce['getDescriptions'](_0x4ee53e);}})[_0x9e8b('0x24')](function(_0x357d04){if(_0x357d04){return _0x357d04?{'count':_0x3ed89b,'rows':_0x357d04}:null;}})[_0x9e8b('0x24')](respondWithResult(_0x1788e8,null))[_0x9e8b('0x40')](handleError(_0x1788e8,null));};exports['getTags']=function(_0x5cd2f8,_0x489be1,_0x1b2a5e){var _0x313a42={};var _0x14abbc={};var _0x511817;var _0x53696f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5cd2f8[_0x9e8b('0x48')]['id']}})[_0x9e8b('0x24')](handleEntityNotFound(_0x489be1,null))[_0x9e8b('0x24')](function(_0x41ea22){if(_0x41ea22){_0x511817=_0x41ea22;_0x14abbc[_0x9e8b('0x2e')]=_['keys'](db[_0x9e8b('0x4f')][_0x9e8b('0x2c')]);_0x14abbc[_0x9e8b('0x2f')]=_[_0x9e8b('0x30')](_0x5cd2f8[_0x9e8b('0x2f')]);_0x14abbc[_0x9e8b('0x31')]=_['intersection'](_0x14abbc['model'],_0x14abbc[_0x9e8b('0x2f')]);_0x313a42[_0x9e8b('0x33')]=_[_0x9e8b('0x32')](_0x14abbc[_0x9e8b('0x2e')],qs['fields'](_0x5cd2f8['query'][_0x9e8b('0x34')]));_0x313a42[_0x9e8b('0x33')]=_0x313a42['attributes'][_0x9e8b('0x35')]?_0x313a42['attributes']:_0x14abbc['model'];_0x313a42[_0x9e8b('0x37')]=qs[_0x9e8b('0x38')](_0x5cd2f8[_0x9e8b('0x2f')]['sort']);_0x313a42['where']=qs[_0x9e8b('0x31')](_['pick'](_0x5cd2f8[_0x9e8b('0x2f')],_0x14abbc[_0x9e8b('0x31')]));if(_0x5cd2f8[_0x9e8b('0x2f')][_0x9e8b('0x3d')]){_0x313a42[_0x9e8b('0x39')]=_['merge'](_0x313a42['where'],{'$or':_[_0x9e8b('0x2a')](_0x313a42[_0x9e8b('0x33')],function(_0x3b0646){var _0x4c40d8={};_0x4c40d8[_0x3b0646]={'$like':'%'+_0x5cd2f8['query'][_0x9e8b('0x3d')]+'%'};return _0x4c40d8;})});}_0x313a42=_[_0x9e8b('0x3b')]({},_0x313a42,_0x5cd2f8['options']);return _0x511817[_0x9e8b('0x50')](_0x313a42);}})[_0x9e8b('0x24')](function(_0x27c229){if(_0x27c229){_0x53696f=_0x27c229[_0x9e8b('0x35')];if(!_0x5cd2f8[_0x9e8b('0x2f')][_0x9e8b('0x4b')]('nolimit')){_0x313a42[_0x9e8b('0x1d')]=qs[_0x9e8b('0x1d')](_0x5cd2f8[_0x9e8b('0x2f')][_0x9e8b('0x1d')]);_0x313a42[_0x9e8b('0x1b')]=qs['offset'](_0x5cd2f8[_0x9e8b('0x2f')][_0x9e8b('0x1b')]);}return _0x511817[_0x9e8b('0x50')](_0x313a42);}})['then'](function(_0x1bda86){if(_0x1bda86){return _0x1bda86?{'count':_0x53696f,'rows':_0x1bda86}:null;}})[_0x9e8b('0x24')](respondWithResult(_0x489be1,null))[_0x9e8b('0x40')](handleError(_0x489be1,null));};exports[_0x9e8b('0x51')]=function(_0x162afb,_0x57234b,_0xd3d230){if(_0x162afb[_0x9e8b('0x47')]['id']){delete _0x162afb['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x162afb[_0x9e8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x57234b,null))[_0x9e8b('0x24')](function(_0x6ba5d6){if(_0x6ba5d6){return _0x6ba5d6[_0x9e8b('0x51')](_0x162afb[_0x9e8b('0x47')][_0x9e8b('0x52')]||[]);}return null;})[_0x9e8b('0x24')](respondWithResult(_0x57234b,null))[_0x9e8b('0x40')](handleError(_0x57234b,null));}; \ No newline at end of file +var _0x3d25=['name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x3d25,0x133));var _0x53d2=function(_0x574162,_0x2425ea){_0x574162=_0x574162-0x0;var _0x39c245=_0x3d25[_0x574162];return _0x39c245;};'use strict';var emlformat=require(_0x53d2('0x0'));var rimraf=require(_0x53d2('0x1'));var zipdir=require(_0x53d2('0x2'));var jsonpatch=require(_0x53d2('0x3'));var rp=require(_0x53d2('0x4'));var moment=require(_0x53d2('0x5'));var BPromise=require(_0x53d2('0x6'));var Mustache=require(_0x53d2('0x7'));var util=require('util');var path=require(_0x53d2('0x8'));var sox=require(_0x53d2('0x9'));var csv=require(_0x53d2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53d2('0xb'));var _=require(_0x53d2('0xc'));var squel=require(_0x53d2('0xd'));var crypto=require('crypto');var jsforce=require(_0x53d2('0xe'));var deskjs=require(_0x53d2('0xf'));var toCsv=require(_0x53d2('0xa'));var querystring=require(_0x53d2('0x10'));var Papa=require(_0x53d2('0x11'));var Redis=require(_0x53d2('0x12'));var authService=require(_0x53d2('0x13'));var qs=require(_0x53d2('0x14'));var as=require(_0x53d2('0x15'));var hardwareService=require(_0x53d2('0x16'));var logger=require(_0x53d2('0x17'))(_0x53d2('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x53d2('0x19'));var db=require(_0x53d2('0x1a'))['db'];function respondWithStatusCode(_0x3564c1,_0x160d38){_0x160d38=_0x160d38||0xcc;return function(_0x26aabf){if(_0x26aabf){return _0x3564c1[_0x53d2('0x1b')](_0x160d38);}return _0x3564c1[_0x53d2('0x1c')](_0x160d38)[_0x53d2('0x1d')]();};}function respondWithResult(_0x276fc5,_0x3a28db){_0x3a28db=_0x3a28db||0xc8;return function(_0x5058a1){if(_0x5058a1){return _0x276fc5[_0x53d2('0x1c')](_0x3a28db)['json'](_0x5058a1);}};}function respondWithFilteredResult(_0x553fcf,_0x38d592){return function(_0x103271){if(_0x103271){var _0x22b778=typeof _0x38d592[_0x53d2('0x1e')]===_0x53d2('0x1f')&&typeof _0x38d592[_0x53d2('0x20')]==='undefined';var _0x13d583=_0x103271[_0x53d2('0x21')];var _0x4d3ef5=_0x22b778?0x0:_0x38d592['offset'];var _0x3d3c2b=_0x22b778?_0x103271[_0x53d2('0x21')]:_0x38d592[_0x53d2('0x1e')]+_0x38d592[_0x53d2('0x20')];var _0x37da0f;if(_0x3d3c2b>=_0x13d583){_0x3d3c2b=_0x13d583;_0x37da0f=0xc8;}else{_0x37da0f=0xce;}_0x553fcf[_0x53d2('0x1c')](_0x37da0f);return _0x553fcf[_0x53d2('0x22')]('Content-Range',_0x4d3ef5+'-'+_0x3d3c2b+'/'+_0x13d583)['json'](_0x103271);}return null;};}function patchUpdates(_0x3f892a){return function(_0x505cfa){try{jsonpatch[_0x53d2('0x23')](_0x505cfa,_0x3f892a,!![]);}catch(_0x4a3c7d){return BPromise['reject'](_0x4a3c7d);}return _0x505cfa['save']();};}function saveUpdates(_0x51bbb4,_0x4e43b9){return function(_0x7fc0b7){if(_0x7fc0b7){return _0x7fc0b7[_0x53d2('0x24')](_0x51bbb4)[_0x53d2('0x25')](function(_0x546a58){return _0x546a58;});}return null;};}function removeEntity(_0x516904,_0x45ac40){return function(_0x4dbfec){if(_0x4dbfec){return _0x4dbfec[_0x53d2('0x26')]()['then'](function(){_0x516904[_0x53d2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10d1b0,_0x2ba662){return function(_0x3a77f6){if(!_0x3a77f6){_0x10d1b0[_0x53d2('0x1b')](0x194);}return _0x3a77f6;};}function handleError(_0xa0ccdd,_0x257d00){_0x257d00=_0x257d00||0x1f4;return function(_0xcf0696){logger[_0x53d2('0x27')](_0xcf0696[_0x53d2('0x28')]);if(_0xcf0696[_0x53d2('0x29')]){delete _0xcf0696['name'];}_0xa0ccdd[_0x53d2('0x1c')](_0x257d00)[_0x53d2('0x2a')](_0xcf0696);};}exports[_0x53d2('0x2b')]=function(_0x1307cf,_0x5ecd6c){var _0x2dec7b={},_0x3dc27e={},_0x43d90b={'count':0x0,'rows':[]};var _0x1f9538=_[_0x53d2('0x2c')](db[_0x53d2('0x2d')][_0x53d2('0x2e')],function(_0x1b8076){return{'name':_0x1b8076[_0x53d2('0x2f')],'type':_0x1b8076[_0x53d2('0x30')][_0x53d2('0x31')]};});_0x3dc27e[_0x53d2('0x32')]=_[_0x53d2('0x2c')](_0x1f9538,_0x53d2('0x29'));_0x3dc27e['query']=_[_0x53d2('0x33')](_0x1307cf[_0x53d2('0x34')]);_0x3dc27e[_0x53d2('0x35')]=_[_0x53d2('0x36')](_0x3dc27e[_0x53d2('0x32')],_0x3dc27e[_0x53d2('0x34')]);_0x2dec7b[_0x53d2('0x37')]=_[_0x53d2('0x36')](_0x3dc27e[_0x53d2('0x32')],qs[_0x53d2('0x38')](_0x1307cf[_0x53d2('0x34')]['fields']));_0x2dec7b[_0x53d2('0x37')]=_0x2dec7b[_0x53d2('0x37')][_0x53d2('0x39')]?_0x2dec7b[_0x53d2('0x37')]:_0x3dc27e[_0x53d2('0x32')];if(!_0x1307cf[_0x53d2('0x34')]['hasOwnProperty'](_0x53d2('0x3a'))){_0x2dec7b[_0x53d2('0x20')]=qs[_0x53d2('0x20')](_0x1307cf[_0x53d2('0x34')]['limit']);_0x2dec7b[_0x53d2('0x1e')]=qs[_0x53d2('0x1e')](_0x1307cf['query'][_0x53d2('0x1e')]);}_0x2dec7b[_0x53d2('0x3b')]=qs[_0x53d2('0x3c')](_0x1307cf[_0x53d2('0x34')][_0x53d2('0x3c')]);_0x2dec7b[_0x53d2('0x3d')]=qs['filters'](_[_0x53d2('0x3e')](_0x1307cf[_0x53d2('0x34')],_0x3dc27e[_0x53d2('0x35')]),_0x1f9538);if(_0x1307cf[_0x53d2('0x34')][_0x53d2('0x3f')]){_0x2dec7b[_0x53d2('0x3d')]=_['merge'](_0x2dec7b[_0x53d2('0x3d')],{'$or':_[_0x53d2('0x2c')](_0x1f9538,function(_0x14373a){if(_0x14373a[_0x53d2('0x30')]!==_0x53d2('0x40')){var _0x57adf5={};_0x57adf5[_0x14373a[_0x53d2('0x29')]]={'$like':'%'+_0x1307cf[_0x53d2('0x34')][_0x53d2('0x3f')]+'%'};return _0x57adf5;}})});}_0x2dec7b=_['merge']({},_0x2dec7b,_0x1307cf[_0x53d2('0x41')]);var _0xf6c242={'where':_0x2dec7b[_0x53d2('0x3d')]};return db['ZendeskConfiguration'][_0x53d2('0x21')](_0xf6c242)[_0x53d2('0x25')](function(_0x58d397){_0x43d90b['count']=_0x58d397;if(_0x1307cf[_0x53d2('0x34')][_0x53d2('0x42')]){_0x2dec7b[_0x53d2('0x43')]=[{'all':!![]}];}return db[_0x53d2('0x2d')][_0x53d2('0x44')](_0x2dec7b);})['then'](function(_0x440ea5){_0x43d90b[_0x53d2('0x45')]=_0x440ea5;return _0x43d90b;})[_0x53d2('0x25')](respondWithFilteredResult(_0x5ecd6c,_0x2dec7b))[_0x53d2('0x46')](handleError(_0x5ecd6c,null));};exports[_0x53d2('0x47')]=function(_0x1d5400,_0xec0b35){var _0x68c2ea={'raw':![],'where':{'id':_0x1d5400[_0x53d2('0x48')]['id']}},_0xc34dfd={};_0xc34dfd[_0x53d2('0x32')]=_[_0x53d2('0x33')](db[_0x53d2('0x2d')][_0x53d2('0x2e')]);_0xc34dfd[_0x53d2('0x34')]=_['keys'](_0x1d5400[_0x53d2('0x34')]);_0xc34dfd['filters']=_[_0x53d2('0x36')](_0xc34dfd[_0x53d2('0x32')],_0xc34dfd['query']);_0x68c2ea[_0x53d2('0x37')]=_[_0x53d2('0x36')](_0xc34dfd['model'],qs['fields'](_0x1d5400[_0x53d2('0x34')][_0x53d2('0x38')]));_0x68c2ea[_0x53d2('0x37')]=_0x68c2ea[_0x53d2('0x37')][_0x53d2('0x39')]?_0x68c2ea[_0x53d2('0x37')]:_0xc34dfd[_0x53d2('0x32')];if(_0x1d5400[_0x53d2('0x34')][_0x53d2('0x42')]){_0x68c2ea[_0x53d2('0x43')]=[{'all':!![]}];}_0x68c2ea=_[_0x53d2('0x49')]({},_0x68c2ea,_0x1d5400[_0x53d2('0x41')]);return db[_0x53d2('0x2d')][_0x53d2('0x4a')](_0x68c2ea)[_0x53d2('0x25')](handleEntityNotFound(_0xec0b35,null))[_0x53d2('0x25')](respondWithResult(_0xec0b35,null))[_0x53d2('0x46')](handleError(_0xec0b35,null));};exports[_0x53d2('0x4b')]=function(_0x32edbd,_0x514f69){return db[_0x53d2('0x2d')][_0x53d2('0x4b')](_0x32edbd[_0x53d2('0x4c')],{})['then'](respondWithResult(_0x514f69,0xc9))[_0x53d2('0x46')](handleError(_0x514f69,null));};exports[_0x53d2('0x24')]=function(_0x43805d,_0x42a830){if(_0x43805d[_0x53d2('0x4c')]['id']){delete _0x43805d[_0x53d2('0x4c')]['id'];}return db[_0x53d2('0x2d')][_0x53d2('0x4a')]({'where':{'id':_0x43805d[_0x53d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x42a830,null))['then'](saveUpdates(_0x43805d[_0x53d2('0x4c')],null))[_0x53d2('0x25')](respondWithResult(_0x42a830,null))[_0x53d2('0x46')](handleError(_0x42a830,null));};exports[_0x53d2('0x26')]=function(_0x5b6ab6,_0x1ed4ed){return db[_0x53d2('0x2d')][_0x53d2('0x4a')]({'where':{'id':_0x5b6ab6[_0x53d2('0x48')]['id']}})[_0x53d2('0x25')](handleEntityNotFound(_0x1ed4ed,null))['then'](removeEntity(_0x1ed4ed,null))[_0x53d2('0x46')](handleError(_0x1ed4ed,null));};exports[_0x53d2('0x4d')]=function(_0x15b723,_0x3d61e9,_0x336440){var _0x1515bd={};var _0x489e24={};var _0x2422dc;var _0x3e7565;return db[_0x53d2('0x2d')][_0x53d2('0x4e')]({'where':{'id':_0x15b723[_0x53d2('0x48')]['id']}})[_0x53d2('0x25')](handleEntityNotFound(_0x3d61e9,null))[_0x53d2('0x25')](function(_0x357b86){if(_0x357b86){_0x2422dc=_0x357b86;_0x489e24['model']=_[_0x53d2('0x33')](db[_0x53d2('0x4f')][_0x53d2('0x2e')]);_0x489e24['query']=_[_0x53d2('0x33')](_0x15b723['query']);_0x489e24[_0x53d2('0x35')]=_[_0x53d2('0x36')](_0x489e24['model'],_0x489e24['query']);_0x1515bd['attributes']=_[_0x53d2('0x36')](_0x489e24['model'],qs[_0x53d2('0x38')](_0x15b723['query'][_0x53d2('0x38')]));_0x1515bd[_0x53d2('0x37')]=_0x1515bd['attributes'][_0x53d2('0x39')]?_0x1515bd[_0x53d2('0x37')]:_0x489e24['model'];_0x1515bd[_0x53d2('0x3b')]=qs[_0x53d2('0x3c')](_0x15b723['query'][_0x53d2('0x3c')]);_0x1515bd[_0x53d2('0x3d')]=qs[_0x53d2('0x35')](_[_0x53d2('0x3e')](_0x15b723[_0x53d2('0x34')],_0x489e24[_0x53d2('0x35')]));if(_0x15b723['query']['filter']){_0x1515bd[_0x53d2('0x3d')]=_[_0x53d2('0x49')](_0x1515bd[_0x53d2('0x3d')],{'$or':_[_0x53d2('0x2c')](_0x1515bd['attributes'],function(_0x4ef666){var _0x32d93c={};_0x32d93c[_0x4ef666]={'$like':'%'+_0x15b723['query'][_0x53d2('0x3f')]+'%'};return _0x32d93c;})});}_0x1515bd=_[_0x53d2('0x49')]({},_0x1515bd,_0x15b723['options']);return _0x2422dc[_0x53d2('0x4d')](_0x1515bd);}})[_0x53d2('0x25')](function(_0x2abae1){if(_0x2abae1){_0x3e7565=_0x2abae1[_0x53d2('0x39')];if(!_0x15b723[_0x53d2('0x34')][_0x53d2('0x50')](_0x53d2('0x3a'))){_0x1515bd['limit']=qs[_0x53d2('0x20')](_0x15b723[_0x53d2('0x34')][_0x53d2('0x20')]);_0x1515bd[_0x53d2('0x1e')]=qs[_0x53d2('0x1e')](_0x15b723[_0x53d2('0x34')]['offset']);}return _0x2422dc[_0x53d2('0x4d')](_0x1515bd);}})[_0x53d2('0x25')](function(_0x185db8){if(_0x185db8){return _0x185db8?{'count':_0x3e7565,'rows':_0x185db8}:null;}})[_0x53d2('0x25')](respondWithResult(_0x3d61e9,null))[_0x53d2('0x46')](handleError(_0x3d61e9,null));};exports[_0x53d2('0x51')]=function(_0x440de6,_0x1affda,_0x4cfb3e){var _0x4b6be5={};var _0x27a4d5={};var _0x356b57;var _0x520cc1;return db['ZendeskConfiguration'][_0x53d2('0x4e')]({'where':{'id':_0x440de6[_0x53d2('0x48')]['id']}})[_0x53d2('0x25')](handleEntityNotFound(_0x1affda,null))['then'](function(_0x5ea60b){if(_0x5ea60b){_0x356b57=_0x5ea60b;_0x27a4d5['model']=_[_0x53d2('0x33')](db['ZendeskField'][_0x53d2('0x2e')]);_0x27a4d5[_0x53d2('0x34')]=_['keys'](_0x440de6['query']);_0x27a4d5[_0x53d2('0x35')]=_['intersection'](_0x27a4d5[_0x53d2('0x32')],_0x27a4d5['query']);_0x4b6be5[_0x53d2('0x37')]=_[_0x53d2('0x36')](_0x27a4d5[_0x53d2('0x32')],qs[_0x53d2('0x38')](_0x440de6[_0x53d2('0x34')][_0x53d2('0x38')]));_0x4b6be5[_0x53d2('0x37')]=_0x4b6be5[_0x53d2('0x37')]['length']?_0x4b6be5['attributes']:_0x27a4d5['model'];_0x4b6be5['order']=qs['sort'](_0x440de6['query']['sort']);_0x4b6be5[_0x53d2('0x3d')]=qs['filters'](_[_0x53d2('0x3e')](_0x440de6[_0x53d2('0x34')],_0x27a4d5['filters']));if(_0x440de6['query'][_0x53d2('0x3f')]){_0x4b6be5[_0x53d2('0x3d')]=_['merge'](_0x4b6be5[_0x53d2('0x3d')],{'$or':_[_0x53d2('0x2c')](_0x4b6be5['attributes'],function(_0x4c0d02){var _0x5f01b1={};_0x5f01b1[_0x4c0d02]={'$like':'%'+_0x440de6[_0x53d2('0x34')]['filter']+'%'};return _0x5f01b1;})});}_0x4b6be5=_[_0x53d2('0x49')]({},_0x4b6be5,_0x440de6['options']);return _0x356b57[_0x53d2('0x51')](_0x4b6be5);}})[_0x53d2('0x25')](function(_0x4d556c){if(_0x4d556c){_0x520cc1=_0x4d556c['length'];if(!_0x440de6[_0x53d2('0x34')][_0x53d2('0x50')](_0x53d2('0x3a'))){_0x4b6be5[_0x53d2('0x20')]=qs['limit'](_0x440de6[_0x53d2('0x34')][_0x53d2('0x20')]);_0x4b6be5[_0x53d2('0x1e')]=qs[_0x53d2('0x1e')](_0x440de6['query']['offset']);}return _0x356b57[_0x53d2('0x51')](_0x4b6be5);}})['then'](function(_0xcc613a){if(_0xcc613a){return _0xcc613a?{'count':_0x520cc1,'rows':_0xcc613a}:null;}})[_0x53d2('0x25')](respondWithResult(_0x1affda,null))['catch'](handleError(_0x1affda,null));};exports[_0x53d2('0x52')]=function(_0x3af87c,_0x4a7576,_0x112c3f){var _0x242241={};var _0x320021={};var _0x3d296b;var _0x59fe00;return db['ZendeskConfiguration'][_0x53d2('0x4e')]({'where':{'id':_0x3af87c['params']['id']}})[_0x53d2('0x25')](handleEntityNotFound(_0x4a7576,null))['then'](function(_0x560da2){if(_0x560da2){_0x3d296b=_0x560da2;_0x320021[_0x53d2('0x32')]=_['keys'](db[_0x53d2('0x4f')][_0x53d2('0x2e')]);_0x320021['query']=_['keys'](_0x3af87c['query']);_0x320021[_0x53d2('0x35')]=_[_0x53d2('0x36')](_0x320021[_0x53d2('0x32')],_0x320021[_0x53d2('0x34')]);_0x242241[_0x53d2('0x37')]=_[_0x53d2('0x36')](_0x320021[_0x53d2('0x32')],qs[_0x53d2('0x38')](_0x3af87c[_0x53d2('0x34')]['fields']));_0x242241[_0x53d2('0x37')]=_0x242241['attributes']['length']?_0x242241['attributes']:_0x320021['model'];_0x242241[_0x53d2('0x3b')]=qs[_0x53d2('0x3c')](_0x3af87c[_0x53d2('0x34')][_0x53d2('0x3c')]);_0x242241[_0x53d2('0x3d')]=qs[_0x53d2('0x35')](_[_0x53d2('0x3e')](_0x3af87c[_0x53d2('0x34')],_0x320021[_0x53d2('0x35')]));if(_0x3af87c[_0x53d2('0x34')][_0x53d2('0x3f')]){_0x242241[_0x53d2('0x3d')]=_[_0x53d2('0x49')](_0x242241[_0x53d2('0x3d')],{'$or':_[_0x53d2('0x2c')](_0x242241[_0x53d2('0x37')],function(_0x2da2a5){var _0x2fd0dd={};_0x2fd0dd[_0x2da2a5]={'$like':'%'+_0x3af87c[_0x53d2('0x34')][_0x53d2('0x3f')]+'%'};return _0x2fd0dd;})});}_0x242241=_[_0x53d2('0x49')]({},_0x242241,_0x3af87c[_0x53d2('0x41')]);return _0x3d296b[_0x53d2('0x52')](_0x242241);}})[_0x53d2('0x25')](function(_0x350d71){if(_0x350d71){_0x59fe00=_0x350d71[_0x53d2('0x39')];if(!_0x3af87c[_0x53d2('0x34')]['hasOwnProperty']('nolimit')){_0x242241[_0x53d2('0x20')]=qs[_0x53d2('0x20')](_0x3af87c[_0x53d2('0x34')][_0x53d2('0x20')]);_0x242241['offset']=qs[_0x53d2('0x1e')](_0x3af87c[_0x53d2('0x34')][_0x53d2('0x1e')]);}return _0x3d296b['getDescriptions'](_0x242241);}})[_0x53d2('0x25')](function(_0x5e842d){if(_0x5e842d){return _0x5e842d?{'count':_0x59fe00,'rows':_0x5e842d}:null;}})[_0x53d2('0x25')](respondWithResult(_0x4a7576,null))['catch'](handleError(_0x4a7576,null));};exports[_0x53d2('0x53')]=function(_0x1f5dda,_0xe88ce1,_0x11e300){var _0x295fda={};var _0x32be11={};var _0x4d04b0;var _0xcfab1b;return db[_0x53d2('0x2d')][_0x53d2('0x4e')]({'where':{'id':_0x1f5dda[_0x53d2('0x48')]['id']}})[_0x53d2('0x25')](handleEntityNotFound(_0xe88ce1,null))['then'](function(_0xb9c2d1){if(_0xb9c2d1){_0x4d04b0=_0xb9c2d1;_0x32be11[_0x53d2('0x32')]=_['keys'](db[_0x53d2('0x54')][_0x53d2('0x2e')]);_0x32be11[_0x53d2('0x34')]=_[_0x53d2('0x33')](_0x1f5dda['query']);_0x32be11['filters']=_[_0x53d2('0x36')](_0x32be11['model'],_0x32be11[_0x53d2('0x34')]);_0x295fda[_0x53d2('0x37')]=_['intersection'](_0x32be11[_0x53d2('0x32')],qs['fields'](_0x1f5dda[_0x53d2('0x34')][_0x53d2('0x38')]));_0x295fda[_0x53d2('0x37')]=_0x295fda[_0x53d2('0x37')][_0x53d2('0x39')]?_0x295fda['attributes']:_0x32be11['model'];_0x295fda[_0x53d2('0x3b')]=qs[_0x53d2('0x3c')](_0x1f5dda['query'][_0x53d2('0x3c')]);_0x295fda[_0x53d2('0x3d')]=qs[_0x53d2('0x35')](_['pick'](_0x1f5dda['query'],_0x32be11[_0x53d2('0x35')]));if(_0x1f5dda[_0x53d2('0x34')][_0x53d2('0x3f')]){_0x295fda[_0x53d2('0x3d')]=_[_0x53d2('0x49')](_0x295fda['where'],{'$or':_[_0x53d2('0x2c')](_0x295fda[_0x53d2('0x37')],function(_0x1beb08){var _0x28dcb1={};_0x28dcb1[_0x1beb08]={'$like':'%'+_0x1f5dda['query']['filter']+'%'};return _0x28dcb1;})});}_0x295fda=_[_0x53d2('0x49')]({},_0x295fda,_0x1f5dda['options']);return _0x4d04b0[_0x53d2('0x53')](_0x295fda);}})[_0x53d2('0x25')](function(_0x388f51){if(_0x388f51){_0xcfab1b=_0x388f51['length'];if(!_0x1f5dda['query']['hasOwnProperty'](_0x53d2('0x3a'))){_0x295fda[_0x53d2('0x20')]=qs[_0x53d2('0x20')](_0x1f5dda[_0x53d2('0x34')][_0x53d2('0x20')]);_0x295fda[_0x53d2('0x1e')]=qs[_0x53d2('0x1e')](_0x1f5dda['query'][_0x53d2('0x1e')]);}return _0x4d04b0[_0x53d2('0x53')](_0x295fda);}})['then'](function(_0x2a84dd){if(_0x2a84dd){return _0x2a84dd?{'count':_0xcfab1b,'rows':_0x2a84dd}:null;}})[_0x53d2('0x25')](respondWithResult(_0xe88ce1,null))['catch'](handleError(_0xe88ce1,null));};exports[_0x53d2('0x55')]=function(_0x39e3ad,_0x465228,_0x2e2d99){if(_0x39e3ad[_0x53d2('0x4c')]['id']){delete _0x39e3ad[_0x53d2('0x4c')]['id'];}return db[_0x53d2('0x2d')]['findOne']({'where':{'id':_0x39e3ad['params']['id']}})[_0x53d2('0x25')](handleEntityNotFound(_0x465228,null))[_0x53d2('0x25')](function(_0x12844c){if(_0x12844c){return _0x12844c[_0x53d2('0x55')](_0x39e3ad['body'][_0x53d2('0x56')]||[]);}return null;})[_0x53d2('0x25')](respondWithResult(_0x465228,null))[_0x53d2('0x46')](handleError(_0x465228,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c05f7f1..b22fe46 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 _0x5eb8=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','../../config/logger','api','moment','bluebird'];(function(_0x39c3d1,_0x3738a4){var _0x28742b=function(_0x1ac06c){while(--_0x1ac06c){_0x39c3d1['push'](_0x39c3d1['shift']());}};_0x28742b(++_0x3738a4);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0x5eb8[_0x2242a1];return _0x2c298b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2e=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x2942bd,_0x147680){_0x2942bd=_0x2942bd-0x0;var _0x332e86=_0x4e2e[_0x2942bd];return _0x332e86;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 304a273..ba12fc0 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 _0x2505=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x357953,_0xb5fee6){var _0x9b5d50=function(_0x8bd3f3){while(--_0x8bd3f3){_0x357953['push'](_0x357953['shift']());}};_0x9b5d50(++_0xb5fee6);}(_0x2505,0x1a4));var _0x5250=function(_0x2afcff,_0x5740df){_0x2afcff=_0x2afcff-0x0;var _0x23bdd3=_0x2505[_0x2afcff];return _0x23bdd3;};'use strict';var _=require(_0x5250('0x0'));var util=require(_0x5250('0x1'));var moment=require(_0x5250('0x2'));var BPromise=require(_0x5250('0x3'));var rs=require(_0x5250('0x4'));var fs=require('fs');var Redis=require(_0x5250('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5250('0x6'))(_0x5250('0x7'));var config=require('../../config/environment');var jayson=require(_0x5250('0x8'));var client=jayson[_0x5250('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33ca73,_0x3966be,_0x35249d){return new BPromise(function(_0x472828,_0x2e046b){return client[_0x5250('0xa')](_0x33ca73,_0x35249d)[_0x5250('0xb')](function(_0x334546){logger[_0x5250('0xc')](_0x5250('0xd'),_0x3966be,'request\x20sent');logger[_0x5250('0xe')](_0x5250('0xf'),_0x3966be,_0x5250('0x10'),JSON[_0x5250('0x11')](_0x334546));if(_0x334546[_0x5250('0x12')]){if(_0x334546['error'][_0x5250('0x13')]===0x1f4){logger['error'](_0x5250('0xd'),_0x3966be,_0x334546['error'][_0x5250('0x14')]);return _0x2e046b(_0x334546[_0x5250('0x12')][_0x5250('0x14')]);}logger['error'](_0x5250('0xd'),_0x3966be,_0x334546['error'][_0x5250('0x14')]);return _0x472828(_0x334546[_0x5250('0x12')][_0x5250('0x14')]);}else{logger['info'](_0x5250('0xd'),_0x3966be,_0x5250('0x10'));_0x472828(_0x334546[_0x5250('0x15')]['message']);}})[_0x5250('0x16')](function(_0x152092){logger[_0x5250('0x12')](_0x5250('0xd'),_0x3966be,_0x152092);_0x2e046b(_0x152092);});});} \ No newline at end of file +var _0xee98=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x5299bc,_0x5dce67){var _0x3376b8=function(_0xacf41){while(--_0xacf41){_0x5299bc['push'](_0x5299bc['shift']());}};_0x3376b8(++_0x5dce67);}(_0xee98,0x15d));var _0x8ee9=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xee98[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x8ee9('0x0'));var util=require(_0x8ee9('0x1'));var moment=require(_0x8ee9('0x2'));var BPromise=require(_0x8ee9('0x3'));var rs=require(_0x8ee9('0x4'));var fs=require('fs');var Redis=require(_0x8ee9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ee9('0x6'));var logger=require('../../config/logger')(_0x8ee9('0x7'));var config=require(_0x8ee9('0x8'));var jayson=require(_0x8ee9('0x9'));var client=jayson['client'][_0x8ee9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11ba8c,_0x30eaf4,_0x1d0782){return new BPromise(function(_0x258401,_0x50210c){return client[_0x8ee9('0xb')](_0x11ba8c,_0x1d0782)[_0x8ee9('0xc')](function(_0x41284c){logger[_0x8ee9('0xd')](_0x8ee9('0xe'),_0x30eaf4,_0x8ee9('0xf'));logger['debug'](_0x8ee9('0x10'),_0x30eaf4,_0x8ee9('0xf'),JSON[_0x8ee9('0x11')](_0x41284c));if(_0x41284c[_0x8ee9('0x12')]){if(_0x41284c[_0x8ee9('0x12')][_0x8ee9('0x13')]===0x1f4){logger[_0x8ee9('0x12')](_0x8ee9('0xe'),_0x30eaf4,_0x41284c[_0x8ee9('0x12')][_0x8ee9('0x14')]);return _0x50210c(_0x41284c[_0x8ee9('0x12')][_0x8ee9('0x14')]);}logger[_0x8ee9('0x12')](_0x8ee9('0xe'),_0x30eaf4,_0x41284c['error'][_0x8ee9('0x14')]);return _0x258401(_0x41284c['error'][_0x8ee9('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x30eaf4,_0x8ee9('0xf'));_0x258401(_0x41284c[_0x8ee9('0x15')][_0x8ee9('0x14')]);}})['catch'](function(_0x1ca74f){logger[_0x8ee9('0x12')](_0x8ee9('0xe'),_0x30eaf4,_0x1ca74f);_0x50210c(_0x1ca74f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index cbe4c16..30e1c7f 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 _0x01fc=['/:id','post','create','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x20f62d,_0x337870){var _0xeecc43=function(_0x2f36d9){while(--_0x2f36d9){_0x20f62d['push'](_0x20f62d['shift']());}};_0xeecc43(++_0x337870);}(_0x01fc,0x149));var _0xc01f=function(_0x433f34,_0x56c3d0){_0x433f34=_0x433f34-0x0;var _0x4f5342=_0x01fc[_0x433f34];return _0x4f5342;};'use strict';var multer=require(_0xc01f('0x0'));var util=require(_0xc01f('0x1'));var path=require(_0xc01f('0x2'));var timeout=require('connect-timeout');var express=require(_0xc01f('0x3'));var router=express[_0xc01f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc01f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc01f('0x6'));var controller=require(_0xc01f('0x7'));router[_0xc01f('0x8')]('/',auth[_0xc01f('0x9')](),controller[_0xc01f('0xa')]);router[_0xc01f('0x8')](_0xc01f('0xb'),auth[_0xc01f('0x9')](),controller['show']);router[_0xc01f('0xc')]('/',auth[_0xc01f('0x9')](),controller[_0xc01f('0xd')]);router[_0xc01f('0xe')](_0xc01f('0xb'),auth['isAuthenticated'](),controller[_0xc01f('0xf')]);router['delete'](_0xc01f('0xb'),auth[_0xc01f('0x9')](),controller['destroy']);module[_0xc01f('0x10')]=router; \ No newline at end of file +var _0x7986=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x5e4b1b,_0x32bdd2){var _0x1f814d=function(_0x438523){while(--_0x438523){_0x5e4b1b['push'](_0x5e4b1b['shift']());}};_0x1f814d(++_0x32bdd2);}(_0x7986,0x10f));var _0x6798=function(_0x2a2c01,_0x1ab17a){_0x2a2c01=_0x2a2c01-0x0;var _0x2d89d4=_0x7986[_0x2a2c01];return _0x2d89d4;};'use strict';var multer=require('multer');var util=require(_0x6798('0x0'));var path=require(_0x6798('0x1'));var timeout=require(_0x6798('0x2'));var express=require(_0x6798('0x3'));var router=express[_0x6798('0x4')]();var fs_extra=require(_0x6798('0x5'));var auth=require(_0x6798('0x6'));var interaction=require(_0x6798('0x7'));var config=require(_0x6798('0x8'));var controller=require('./intZendeskField.controller');router[_0x6798('0x9')]('/',auth[_0x6798('0xa')](),controller[_0x6798('0xb')]);router[_0x6798('0x9')](_0x6798('0xc'),auth[_0x6798('0xa')](),controller[_0x6798('0xd')]);router['post']('/',auth[_0x6798('0xa')](),controller[_0x6798('0xe')]);router[_0x6798('0xf')](_0x6798('0xc'),auth[_0x6798('0xa')](),controller[_0x6798('0x10')]);router[_0x6798('0x11')](_0x6798('0xc'),auth[_0x6798('0xa')](),controller['destroy']);module[_0x6798('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b5902fb..f6860e9 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 _0x2061=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x23a87d,_0x3c4f8d){var _0x52d7bb=function(_0x4861ee){while(--_0x4861ee){_0x23a87d['push'](_0x23a87d['shift']());}};_0x52d7bb(++_0x3c4f8d);}(_0x2061,0xcf));var _0x1206=function(_0x158f9c,_0x24bca7){_0x158f9c=_0x158f9c-0x0;var _0x962398=_0x2061[_0x158f9c];return _0x962398;};'use strict';var Sequelize=require(_0x1206('0x0'));module[_0x1206('0x1')]={'type':{'type':Sequelize[_0x1206('0x2')](_0x1206('0x3'),'variable',_0x1206('0x4'),_0x1206('0x5'),_0x1206('0x6')),'defaultValue':_0x1206('0x3')},'content':{'type':Sequelize[_0x1206('0x7')]},'key':{'type':Sequelize[_0x1206('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1206('0x8'),_0x1206('0x4'))},'keyContent':{'type':Sequelize[_0x1206('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1206('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1206('0x7')]}}; \ No newline at end of file +var _0x6618=['sequelize','string','STRING','customVariable','BOOLEAN'];(function(_0xf4d30a,_0x46f9cf){var _0x25bd20=function(_0x4086fe){while(--_0x4086fe){_0xf4d30a['push'](_0xf4d30a['shift']());}};_0x25bd20(++_0x46f9cf);}(_0x6618,0x145));var _0x8661=function(_0x271393,_0x7e8cb3){_0x271393=_0x271393-0x0;var _0x335b4d=_0x6618[_0x271393];return _0x335b4d;};'use strict';var Sequelize=require(_0x8661('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8661('0x1'),'variable','customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8661('0x2')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x8661('0x1'),'variable',_0x8661('0x3'))},'keyContent':{'type':Sequelize[_0x8661('0x2')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8661('0x2')]},'customField':{'type':Sequelize[_0x8661('0x4')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 030c6af..5786450 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 _0xd5e4=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ZendeskField','includeAll','include','rows','catch','params','find','create','body'];(function(_0x597ddc,_0x145d65){var _0xe00365=function(_0x1511dd){while(--_0x1511dd){_0x597ddc['push'](_0x597ddc['shift']());}};_0xe00365(++_0x145d65);}(_0xd5e4,0x8e));var _0x4d5e=function(_0x27bf0a,_0x468e81){_0x27bf0a=_0x27bf0a-0x0;var _0x433738=_0xd5e4[_0x27bf0a];return _0x433738;};'use strict';var emlformat=require(_0x4d5e('0x0'));var rimraf=require(_0x4d5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d5e('0x2'));var rp=require(_0x4d5e('0x3'));var moment=require(_0x4d5e('0x4'));var BPromise=require(_0x4d5e('0x5'));var Mustache=require(_0x4d5e('0x6'));var util=require('util');var path=require(_0x4d5e('0x7'));var sox=require(_0x4d5e('0x8'));var csv=require(_0x4d5e('0x9'));var ejs=require(_0x4d5e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d5e('0xb'));var squel=require(_0x4d5e('0xc'));var crypto=require(_0x4d5e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4d5e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4d5e('0xf'));var Papa=require('papaparse');var Redis=require(_0x4d5e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d5e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d5e('0x12'))(_0x4d5e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4d5e('0x14'));var db=require(_0x4d5e('0x15'))['db'];function respondWithStatusCode(_0x39e7c6,_0x2ada2e){_0x2ada2e=_0x2ada2e||0xcc;return function(_0x5d7cd2){if(_0x5d7cd2){return _0x39e7c6[_0x4d5e('0x16')](_0x2ada2e);}return _0x39e7c6[_0x4d5e('0x17')](_0x2ada2e)['end']();};}function respondWithResult(_0x5ba334,_0x3cd9e0){_0x3cd9e0=_0x3cd9e0||0xc8;return function(_0x25c880){if(_0x25c880){return _0x5ba334[_0x4d5e('0x17')](_0x3cd9e0)[_0x4d5e('0x18')](_0x25c880);}};}function respondWithFilteredResult(_0x16a9f6,_0x1d0c7d){return function(_0x32a257){if(_0x32a257){var _0x31880a=typeof _0x1d0c7d['offset']===_0x4d5e('0x19')&&typeof _0x1d0c7d['limit']===_0x4d5e('0x19');var _0x55da28=_0x32a257[_0x4d5e('0x1a')];var _0x421c9b=_0x31880a?0x0:_0x1d0c7d[_0x4d5e('0x1b')];var _0x48153b=_0x31880a?_0x32a257[_0x4d5e('0x1a')]:_0x1d0c7d[_0x4d5e('0x1b')]+_0x1d0c7d[_0x4d5e('0x1c')];var _0x131787;if(_0x48153b>=_0x55da28){_0x48153b=_0x55da28;_0x131787=0xc8;}else{_0x131787=0xce;}_0x16a9f6[_0x4d5e('0x17')](_0x131787);return _0x16a9f6[_0x4d5e('0x1d')](_0x4d5e('0x1e'),_0x421c9b+'-'+_0x48153b+'/'+_0x55da28)['json'](_0x32a257);}return null;};}function patchUpdates(_0x2eecae){return function(_0x13a1b4){try{jsonpatch[_0x4d5e('0x1f')](_0x13a1b4,_0x2eecae,!![]);}catch(_0xc63de){return BPromise['reject'](_0xc63de);}return _0x13a1b4[_0x4d5e('0x20')]();};}function saveUpdates(_0xd7cd71,_0x1a793d){return function(_0xb635d){if(_0xb635d){return _0xb635d[_0x4d5e('0x21')](_0xd7cd71)['then'](function(_0x3b2d05){return _0x3b2d05;});}return null;};}function removeEntity(_0x346763,_0xd51d6d){return function(_0x556f4a){if(_0x556f4a){return _0x556f4a[_0x4d5e('0x22')]()[_0x4d5e('0x23')](function(){_0x346763[_0x4d5e('0x17')](0xcc)[_0x4d5e('0x24')]();});}};}function handleEntityNotFound(_0x19fe94,_0x274e13){return function(_0xf08d83){if(!_0xf08d83){_0x19fe94[_0x4d5e('0x16')](0x194);}return _0xf08d83;};}function handleError(_0x2b0e74,_0x47350f){_0x47350f=_0x47350f||0x1f4;return function(_0x477b33){logger['error'](_0x477b33[_0x4d5e('0x25')]);if(_0x477b33[_0x4d5e('0x26')]){delete _0x477b33[_0x4d5e('0x26')];}_0x2b0e74['status'](_0x47350f)[_0x4d5e('0x27')](_0x477b33);};}exports[_0x4d5e('0x28')]=function(_0x5591a9,_0x56de5c){var _0x1222ad={},_0x501e4e={},_0x3cd2fb={'count':0x0,'rows':[]};var _0x2cc62a=_['map'](db['ZendeskField'][_0x4d5e('0x29')],function(_0x54735e){return{'name':_0x54735e[_0x4d5e('0x2a')],'type':_0x54735e[_0x4d5e('0x2b')][_0x4d5e('0x2c')]};});_0x501e4e[_0x4d5e('0x2d')]=_[_0x4d5e('0x2e')](_0x2cc62a,_0x4d5e('0x26'));_0x501e4e[_0x4d5e('0x2f')]=_[_0x4d5e('0x30')](_0x5591a9[_0x4d5e('0x2f')]);_0x501e4e[_0x4d5e('0x31')]=_[_0x4d5e('0x32')](_0x501e4e[_0x4d5e('0x2d')],_0x501e4e[_0x4d5e('0x2f')]);_0x1222ad['attributes']=_[_0x4d5e('0x32')](_0x501e4e[_0x4d5e('0x2d')],qs[_0x4d5e('0x33')](_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x33')]));_0x1222ad[_0x4d5e('0x34')]=_0x1222ad[_0x4d5e('0x34')][_0x4d5e('0x35')]?_0x1222ad[_0x4d5e('0x34')]:_0x501e4e[_0x4d5e('0x2d')];if(!_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x36')](_0x4d5e('0x37'))){_0x1222ad[_0x4d5e('0x1c')]=qs[_0x4d5e('0x1c')](_0x5591a9[_0x4d5e('0x2f')]['limit']);_0x1222ad[_0x4d5e('0x1b')]=qs['offset'](_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x1b')]);}_0x1222ad[_0x4d5e('0x38')]=qs[_0x4d5e('0x39')](_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x39')]);_0x1222ad[_0x4d5e('0x3a')]=qs[_0x4d5e('0x31')](_['pick'](_0x5591a9[_0x4d5e('0x2f')],_0x501e4e[_0x4d5e('0x31')]),_0x2cc62a);if(_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x3b')]){_0x1222ad[_0x4d5e('0x3a')]=_['merge'](_0x1222ad[_0x4d5e('0x3a')],{'$or':_[_0x4d5e('0x2e')](_0x2cc62a,function(_0x526604){if(_0x526604[_0x4d5e('0x2b')]!=='VIRTUAL'){var _0x563622={};_0x563622[_0x526604[_0x4d5e('0x26')]]={'$like':'%'+_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x3b')]+'%'};return _0x563622;}})});}_0x1222ad=_[_0x4d5e('0x3c')]({},_0x1222ad,_0x5591a9[_0x4d5e('0x3d')]);var _0x1b90ad={'where':_0x1222ad[_0x4d5e('0x3a')]};return db[_0x4d5e('0x3e')][_0x4d5e('0x1a')](_0x1b90ad)[_0x4d5e('0x23')](function(_0x5711cd){_0x3cd2fb[_0x4d5e('0x1a')]=_0x5711cd;if(_0x5591a9[_0x4d5e('0x2f')][_0x4d5e('0x3f')]){_0x1222ad[_0x4d5e('0x40')]=[{'all':!![]}];}return db[_0x4d5e('0x3e')]['findAll'](_0x1222ad);})[_0x4d5e('0x23')](function(_0x376c27){_0x3cd2fb[_0x4d5e('0x41')]=_0x376c27;return _0x3cd2fb;})[_0x4d5e('0x23')](respondWithFilteredResult(_0x56de5c,_0x1222ad))[_0x4d5e('0x42')](handleError(_0x56de5c,null));};exports['show']=function(_0x2db731,_0x12c117){var _0x3539ab={'raw':!![],'where':{'id':_0x2db731[_0x4d5e('0x43')]['id']}},_0x19a564={};_0x19a564[_0x4d5e('0x2d')]=_[_0x4d5e('0x30')](db['ZendeskField']['rawAttributes']);_0x19a564[_0x4d5e('0x2f')]=_[_0x4d5e('0x30')](_0x2db731['query']);_0x19a564[_0x4d5e('0x31')]=_[_0x4d5e('0x32')](_0x19a564[_0x4d5e('0x2d')],_0x19a564[_0x4d5e('0x2f')]);_0x3539ab[_0x4d5e('0x34')]=_[_0x4d5e('0x32')](_0x19a564[_0x4d5e('0x2d')],qs[_0x4d5e('0x33')](_0x2db731[_0x4d5e('0x2f')]['fields']));_0x3539ab[_0x4d5e('0x34')]=_0x3539ab[_0x4d5e('0x34')][_0x4d5e('0x35')]?_0x3539ab[_0x4d5e('0x34')]:_0x19a564[_0x4d5e('0x2d')];if(_0x2db731[_0x4d5e('0x2f')][_0x4d5e('0x3f')]){_0x3539ab[_0x4d5e('0x40')]=[{'all':!![]}];}_0x3539ab=_[_0x4d5e('0x3c')]({},_0x3539ab,_0x2db731[_0x4d5e('0x3d')]);return db[_0x4d5e('0x3e')][_0x4d5e('0x44')](_0x3539ab)['then'](handleEntityNotFound(_0x12c117,null))[_0x4d5e('0x23')](respondWithResult(_0x12c117,null))['catch'](handleError(_0x12c117,null));};exports[_0x4d5e('0x45')]=function(_0x8d0cee,_0x322b2d){return db[_0x4d5e('0x3e')][_0x4d5e('0x45')](_0x8d0cee[_0x4d5e('0x46')],{})[_0x4d5e('0x23')](respondWithResult(_0x322b2d,0xc9))[_0x4d5e('0x42')](handleError(_0x322b2d,null));};exports[_0x4d5e('0x21')]=function(_0x199501,_0x224f9d){if(_0x199501[_0x4d5e('0x46')]['id']){delete _0x199501[_0x4d5e('0x46')]['id'];}return db[_0x4d5e('0x3e')][_0x4d5e('0x44')]({'where':{'id':_0x199501[_0x4d5e('0x43')]['id']}})['then'](handleEntityNotFound(_0x224f9d,null))['then'](saveUpdates(_0x199501['body'],null))[_0x4d5e('0x23')](respondWithResult(_0x224f9d,null))[_0x4d5e('0x42')](handleError(_0x224f9d,null));};exports[_0x4d5e('0x22')]=function(_0x142329,_0x5374f0){return db[_0x4d5e('0x3e')]['find']({'where':{'id':_0x142329['params']['id']}})['then'](handleEntityNotFound(_0x5374f0,null))['then'](removeEntity(_0x5374f0,null))[_0x4d5e('0x42')](handleError(_0x5374f0,null));}; \ No newline at end of file +var _0x9756=['update','then','error','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x16818e,_0x4c3656){var _0x6fadf9=function(_0x182c97){while(--_0x182c97){_0x16818e['push'](_0x16818e['shift']());}};_0x6fadf9(++_0x4c3656);}(_0x9756,0x108));var _0x6975=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x9756[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require(_0x6975('0x0'));var rimraf=require(_0x6975('0x1'));var zipdir=require(_0x6975('0x2'));var jsonpatch=require(_0x6975('0x3'));var rp=require('request-promise');var moment=require(_0x6975('0x4'));var BPromise=require(_0x6975('0x5'));var Mustache=require(_0x6975('0x6'));var util=require(_0x6975('0x7'));var path=require(_0x6975('0x8'));var sox=require('sox');var csv=require(_0x6975('0x9'));var ejs=require(_0x6975('0xa'));var fs=require('fs');var fs_extra=require(_0x6975('0xb'));var _=require('lodash');var squel=require(_0x6975('0xc'));var crypto=require('crypto');var jsforce=require(_0x6975('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6975('0xe'));var Papa=require(_0x6975('0xf'));var Redis=require(_0x6975('0x10'));var authService=require(_0x6975('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6975('0x12'));var hardwareService=require(_0x6975('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6975('0x14'));var config=require(_0x6975('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6975('0x16'))['db'];function respondWithStatusCode(_0x3df1f9,_0x1bcb66){_0x1bcb66=_0x1bcb66||0xcc;return function(_0x312a11){if(_0x312a11){return _0x3df1f9[_0x6975('0x17')](_0x1bcb66);}return _0x3df1f9[_0x6975('0x18')](_0x1bcb66)[_0x6975('0x19')]();};}function respondWithResult(_0x4fa915,_0x5bd140){_0x5bd140=_0x5bd140||0xc8;return function(_0x1c65f6){if(_0x1c65f6){return _0x4fa915['status'](_0x5bd140)[_0x6975('0x1a')](_0x1c65f6);}};}function respondWithFilteredResult(_0x277aab,_0x5bf34f){return function(_0x352ff2){if(_0x352ff2){var _0xf54830=typeof _0x5bf34f[_0x6975('0x1b')]===_0x6975('0x1c')&&typeof _0x5bf34f[_0x6975('0x1d')]===_0x6975('0x1c');var _0x353fa4=_0x352ff2['count'];var _0x470121=_0xf54830?0x0:_0x5bf34f[_0x6975('0x1b')];var _0x4c1754=_0xf54830?_0x352ff2[_0x6975('0x1e')]:_0x5bf34f[_0x6975('0x1b')]+_0x5bf34f[_0x6975('0x1d')];var _0x5bac6b;if(_0x4c1754>=_0x353fa4){_0x4c1754=_0x353fa4;_0x5bac6b=0xc8;}else{_0x5bac6b=0xce;}_0x277aab[_0x6975('0x18')](_0x5bac6b);return _0x277aab[_0x6975('0x1f')](_0x6975('0x20'),_0x470121+'-'+_0x4c1754+'/'+_0x353fa4)['json'](_0x352ff2);}return null;};}function patchUpdates(_0x12b712){return function(_0x2331a1){try{jsonpatch[_0x6975('0x21')](_0x2331a1,_0x12b712,!![]);}catch(_0x4346cc){return BPromise[_0x6975('0x22')](_0x4346cc);}return _0x2331a1[_0x6975('0x23')]();};}function saveUpdates(_0x5476e9,_0x544b01){return function(_0x5f50bf){if(_0x5f50bf){return _0x5f50bf[_0x6975('0x24')](_0x5476e9)[_0x6975('0x25')](function(_0x1dc1df){return _0x1dc1df;});}return null;};}function removeEntity(_0x2ca0cc,_0x13e398){return function(_0x1ff59d){if(_0x1ff59d){return _0x1ff59d['destroy']()[_0x6975('0x25')](function(){_0x2ca0cc[_0x6975('0x18')](0xcc)[_0x6975('0x19')]();});}};}function handleEntityNotFound(_0x2bbbcc,_0x2d1f80){return function(_0x22267a){if(!_0x22267a){_0x2bbbcc['sendStatus'](0x194);}return _0x22267a;};}function handleError(_0x36162e,_0x2996be){_0x2996be=_0x2996be||0x1f4;return function(_0x43423e){logger[_0x6975('0x26')](_0x43423e['stack']);if(_0x43423e[_0x6975('0x27')]){delete _0x43423e[_0x6975('0x27')];}_0x36162e['status'](_0x2996be)[_0x6975('0x28')](_0x43423e);};}exports[_0x6975('0x29')]=function(_0x5248ff,_0x1f13e1){var _0x1ac67b={},_0x29400b={},_0x5063b8={'count':0x0,'rows':[]};var _0x4a9ed9=_['map'](db[_0x6975('0x2a')][_0x6975('0x2b')],function(_0x4ab44d){return{'name':_0x4ab44d[_0x6975('0x2c')],'type':_0x4ab44d[_0x6975('0x2d')][_0x6975('0x2e')]};});_0x29400b[_0x6975('0x2f')]=_['map'](_0x4a9ed9,_0x6975('0x27'));_0x29400b[_0x6975('0x30')]=_[_0x6975('0x31')](_0x5248ff[_0x6975('0x30')]);_0x29400b[_0x6975('0x32')]=_[_0x6975('0x33')](_0x29400b[_0x6975('0x2f')],_0x29400b['query']);_0x1ac67b[_0x6975('0x34')]=_['intersection'](_0x29400b[_0x6975('0x2f')],qs[_0x6975('0x35')](_0x5248ff['query'][_0x6975('0x35')]));_0x1ac67b[_0x6975('0x34')]=_0x1ac67b[_0x6975('0x34')][_0x6975('0x36')]?_0x1ac67b[_0x6975('0x34')]:_0x29400b['model'];if(!_0x5248ff[_0x6975('0x30')]['hasOwnProperty'](_0x6975('0x37'))){_0x1ac67b[_0x6975('0x1d')]=qs['limit'](_0x5248ff[_0x6975('0x30')][_0x6975('0x1d')]);_0x1ac67b[_0x6975('0x1b')]=qs[_0x6975('0x1b')](_0x5248ff['query'][_0x6975('0x1b')]);}_0x1ac67b[_0x6975('0x38')]=qs[_0x6975('0x39')](_0x5248ff[_0x6975('0x30')][_0x6975('0x39')]);_0x1ac67b[_0x6975('0x3a')]=qs[_0x6975('0x32')](_[_0x6975('0x3b')](_0x5248ff['query'],_0x29400b['filters']),_0x4a9ed9);if(_0x5248ff[_0x6975('0x30')][_0x6975('0x3c')]){_0x1ac67b[_0x6975('0x3a')]=_[_0x6975('0x3d')](_0x1ac67b['where'],{'$or':_[_0x6975('0x3e')](_0x4a9ed9,function(_0x2b4b8a){if(_0x2b4b8a[_0x6975('0x2d')]!==_0x6975('0x3f')){var _0x5f023d={};_0x5f023d[_0x2b4b8a[_0x6975('0x27')]]={'$like':'%'+_0x5248ff[_0x6975('0x30')][_0x6975('0x3c')]+'%'};return _0x5f023d;}})});}_0x1ac67b=_[_0x6975('0x3d')]({},_0x1ac67b,_0x5248ff[_0x6975('0x40')]);var _0x5be933={'where':_0x1ac67b[_0x6975('0x3a')]};return db[_0x6975('0x2a')]['count'](_0x5be933)[_0x6975('0x25')](function(_0xeed998){_0x5063b8['count']=_0xeed998;if(_0x5248ff[_0x6975('0x30')][_0x6975('0x41')]){_0x1ac67b['include']=[{'all':!![]}];}return db['ZendeskField'][_0x6975('0x42')](_0x1ac67b);})[_0x6975('0x25')](function(_0x10752c){_0x5063b8[_0x6975('0x43')]=_0x10752c;return _0x5063b8;})[_0x6975('0x25')](respondWithFilteredResult(_0x1f13e1,_0x1ac67b))['catch'](handleError(_0x1f13e1,null));};exports['show']=function(_0x3cf45a,_0x4895cd){var _0xc905={'raw':!![],'where':{'id':_0x3cf45a[_0x6975('0x44')]['id']}},_0x526cdc={};_0x526cdc['model']=_[_0x6975('0x31')](db['ZendeskField'][_0x6975('0x2b')]);_0x526cdc[_0x6975('0x30')]=_[_0x6975('0x31')](_0x3cf45a[_0x6975('0x30')]);_0x526cdc[_0x6975('0x32')]=_[_0x6975('0x33')](_0x526cdc[_0x6975('0x2f')],_0x526cdc[_0x6975('0x30')]);_0xc905[_0x6975('0x34')]=_['intersection'](_0x526cdc['model'],qs[_0x6975('0x35')](_0x3cf45a['query'][_0x6975('0x35')]));_0xc905[_0x6975('0x34')]=_0xc905[_0x6975('0x34')][_0x6975('0x36')]?_0xc905[_0x6975('0x34')]:_0x526cdc['model'];if(_0x3cf45a['query']['includeAll']){_0xc905[_0x6975('0x45')]=[{'all':!![]}];}_0xc905=_[_0x6975('0x3d')]({},_0xc905,_0x3cf45a[_0x6975('0x40')]);return db[_0x6975('0x2a')][_0x6975('0x46')](_0xc905)[_0x6975('0x25')](handleEntityNotFound(_0x4895cd,null))[_0x6975('0x25')](respondWithResult(_0x4895cd,null))[_0x6975('0x47')](handleError(_0x4895cd,null));};exports[_0x6975('0x48')]=function(_0xe9ea50,_0x107147){return db[_0x6975('0x2a')][_0x6975('0x48')](_0xe9ea50[_0x6975('0x49')],{})['then'](respondWithResult(_0x107147,0xc9))[_0x6975('0x47')](handleError(_0x107147,null));};exports[_0x6975('0x24')]=function(_0x51d444,_0x2a7810){if(_0x51d444[_0x6975('0x49')]['id']){delete _0x51d444['body']['id'];}return db[_0x6975('0x2a')][_0x6975('0x46')]({'where':{'id':_0x51d444[_0x6975('0x44')]['id']}})[_0x6975('0x25')](handleEntityNotFound(_0x2a7810,null))[_0x6975('0x25')](saveUpdates(_0x51d444[_0x6975('0x49')],null))['then'](respondWithResult(_0x2a7810,null))[_0x6975('0x47')](handleError(_0x2a7810,null));};exports[_0x6975('0x4a')]=function(_0x351683,_0x30e3c5){return db[_0x6975('0x2a')]['find']({'where':{'id':_0x351683[_0x6975('0x44')]['id']}})[_0x6975('0x25')](handleEntityNotFound(_0x30e3c5,null))[_0x6975('0x25')](removeEntity(_0x30e3c5,null))['catch'](handleError(_0x30e3c5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 43c3532..7449cd2 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 _0x35bc=['ZendeskField','int_zendesk_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x324867,_0x1f124e){var _0x36cc67=function(_0x3cc240){while(--_0x3cc240){_0x324867['push'](_0x324867['shift']());}};_0x36cc67(++_0x1f124e);}(_0x35bc,0x14e));var _0xc35b=function(_0x58235f,_0x5e3186){_0x58235f=_0x58235f-0x0;var _0x461ccc=_0x35bc[_0x58235f];return _0x461ccc;};'use strict';var _=require('lodash');var util=require(_0xc35b('0x0'));var logger=require(_0xc35b('0x1'))(_0xc35b('0x2'));var moment=require(_0xc35b('0x3'));var BPromise=require(_0xc35b('0x4'));var rp=require(_0xc35b('0x5'));var fs=require('fs');var path=require(_0xc35b('0x6'));var rimraf=require(_0xc35b('0x7'));var config=require(_0xc35b('0x8'));var attributes=require(_0xc35b('0x9'));module[_0xc35b('0xa')]=function(_0x5cf757,_0x4b44c0){return _0x5cf757['define'](_0xc35b('0xb'),attributes,{'tableName':_0xc35b('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc35b('0xd'),_0xc35b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c89=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','util'];(function(_0x210cfd,_0x123ea4){var _0x350544=function(_0x3dccc2){while(--_0x3dccc2){_0x210cfd['push'](_0x210cfd['shift']());}};_0x350544(++_0x123ea4);}(_0x8c89,0x1bf));var _0x98c8=function(_0x4275e9,_0x593c5d){_0x4275e9=_0x4275e9-0x0;var _0x3286ea=_0x8c89[_0x4275e9];return _0x3286ea;};'use strict';var _=require('lodash');var util=require(_0x98c8('0x0'));var logger=require(_0x98c8('0x1'))(_0x98c8('0x2'));var moment=require(_0x98c8('0x3'));var BPromise=require(_0x98c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x98c8('0x5'));var config=require(_0x98c8('0x6'));var attributes=require(_0x98c8('0x7'));module[_0x98c8('0x8')]=function(_0x576325,_0x5ba357){return _0x576325[_0x98c8('0x9')](_0x98c8('0xa'),attributes,{'tableName':_0x98c8('0xb'),'paranoid':![],'indexes':[{'name':_0x98c8('0xc'),'fields':['idField',_0x98c8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 32ba749..bbe6a0c 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 _0x14e0=['moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','util'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x14e0,0x65));var _0x014e=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x14e0[_0x318840];return _0x223da4;};'use strict';var _=require('lodash');var util=require(_0x014e('0x0'));var moment=require(_0x014e('0x1'));var BPromise=require(_0x014e('0x2'));var rs=require(_0x014e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x014e('0x4'));var logger=require(_0x014e('0x5'))('rpc');var config=require(_0x014e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x014e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x178eb6,_0x4009a3,_0x3fdf02){return new BPromise(function(_0x301895,_0x232462){return client['request'](_0x178eb6,_0x3fdf02)[_0x014e('0x8')](function(_0x310425){logger[_0x014e('0x9')](_0x014e('0xa'),_0x4009a3,'request\x20sent');logger[_0x014e('0xb')](_0x014e('0xc'),_0x4009a3,_0x014e('0xd'),JSON['stringify'](_0x310425));if(_0x310425[_0x014e('0xe')]){if(_0x310425[_0x014e('0xe')]['code']===0x1f4){logger[_0x014e('0xe')]('ZendeskField,\x20%s,\x20%s',_0x4009a3,_0x310425[_0x014e('0xe')][_0x014e('0xf')]);return _0x232462(_0x310425[_0x014e('0xe')]['message']);}logger[_0x014e('0xe')](_0x014e('0xa'),_0x4009a3,_0x310425['error']['message']);return _0x301895(_0x310425[_0x014e('0xe')][_0x014e('0xf')]);}else{logger[_0x014e('0x9')](_0x014e('0xa'),_0x4009a3,_0x014e('0xd'));_0x301895(_0x310425[_0x014e('0x10')][_0x014e('0xf')]);}})['catch'](function(_0x2d06cb){logger['error']('ZendeskField,\x20%s,\x20%s',_0x4009a3,_0x2d06cb);_0x232462(_0x2d06cb);});});} \ No newline at end of file +var _0x1ac6=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','util','moment','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x3ef322,_0x2fd5d0){var _0x43f6be=function(_0xae1551){while(--_0xae1551){_0x3ef322['push'](_0x3ef322['shift']());}};_0x43f6be(++_0x2fd5d0);}(_0x1ac6,0x138));var _0x61ac=function(_0x1acf4b,_0x5a750c){_0x1acf4b=_0x1acf4b-0x0;var _0x4eca09=_0x1ac6[_0x1acf4b];return _0x4eca09;};'use strict';var _=require('lodash');var util=require(_0x61ac('0x0'));var moment=require(_0x61ac('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61ac('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x61ac('0x3'));var config=require(_0x61ac('0x4'));var jayson=require(_0x61ac('0x5'));var client=jayson[_0x61ac('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbd4f79,_0x50702f,_0x473091){return new BPromise(function(_0xa41ba4,_0x204976){return client[_0x61ac('0x7')](_0xbd4f79,_0x473091)[_0x61ac('0x8')](function(_0x400c8a){logger['info'](_0x61ac('0x9'),_0x50702f,_0x61ac('0xa'));logger[_0x61ac('0xb')](_0x61ac('0xc'),_0x50702f,_0x61ac('0xa'),JSON[_0x61ac('0xd')](_0x400c8a));if(_0x400c8a['error']){if(_0x400c8a['error'][_0x61ac('0xe')]===0x1f4){logger[_0x61ac('0xf')](_0x61ac('0x9'),_0x50702f,_0x400c8a[_0x61ac('0xf')][_0x61ac('0x10')]);return _0x204976(_0x400c8a[_0x61ac('0xf')][_0x61ac('0x10')]);}logger[_0x61ac('0xf')](_0x61ac('0x9'),_0x50702f,_0x400c8a[_0x61ac('0xf')][_0x61ac('0x10')]);return _0xa41ba4(_0x400c8a['error'][_0x61ac('0x10')]);}else{logger[_0x61ac('0x11')]('ZendeskField,\x20%s,\x20%s',_0x50702f,_0x61ac('0xa'));_0xa41ba4(_0x400c8a[_0x61ac('0x12')][_0x61ac('0x10')]);}})['catch'](function(_0x3eb749){logger[_0x61ac('0xf')](_0x61ac('0x9'),_0x50702f,_0x3eb749);_0x204976(_0x3eb749);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index a76d8e4..3289be8 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 _0x8829=['getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x26e102,_0x2b6613){var _0x2c108e=function(_0x58455a){while(--_0x58455a){_0x26e102['push'](_0x26e102['shift']());}};_0x2c108e(++_0x2b6613);}(_0x8829,0xcf));var _0x9882=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8829[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9882('0x0'));var path=require(_0x9882('0x1'));var timeout=require(_0x9882('0x2'));var express=require('express');var router=express[_0x9882('0x3')]();var fs_extra=require(_0x9882('0x4'));var auth=require(_0x9882('0x5'));var interaction=require(_0x9882('0x6'));var config=require(_0x9882('0x7'));var controller=require('./intZohoAccount.controller');router[_0x9882('0x8')]('/',auth['isAuthenticated'](),controller[_0x9882('0x9')]);router['get'](_0x9882('0xa'),auth[_0x9882('0xb')](),controller[_0x9882('0xc')]);router[_0x9882('0x8')]('/:id/configurations',auth[_0x9882('0xb')](),controller[_0x9882('0xd')]);router[_0x9882('0x8')](_0x9882('0xe'),auth[_0x9882('0xb')](),controller[_0x9882('0xf')]);router[_0x9882('0x10')]('/',auth[_0x9882('0xb')](),controller['create']);router[_0x9882('0x10')](_0x9882('0x11'),auth[_0x9882('0xb')](),controller[_0x9882('0x12')]);router['put'](_0x9882('0xa'),auth[_0x9882('0xb')](),controller['update']);router['delete'](_0x9882('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x9882('0x13')]=router; \ No newline at end of file +var _0xcd3b=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcd3b,0x145));var _0xbcd3=function(_0x4c5cf0,_0x591586){_0x4c5cf0=_0x4c5cf0-0x0;var _0x7735f9=_0xcd3b[_0x4c5cf0];return _0x7735f9;};'use strict';var multer=require(_0xbcd3('0x0'));var util=require(_0xbcd3('0x1'));var path=require(_0xbcd3('0x2'));var timeout=require(_0xbcd3('0x3'));var express=require(_0xbcd3('0x4'));var router=express[_0xbcd3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbcd3('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xbcd3('0x7')]('/',auth[_0xbcd3('0x8')](),controller[_0xbcd3('0x9')]);router[_0xbcd3('0x7')](_0xbcd3('0xa'),auth[_0xbcd3('0x8')](),controller[_0xbcd3('0xb')]);router['get'](_0xbcd3('0xc'),auth[_0xbcd3('0x8')](),controller[_0xbcd3('0xd')]);router[_0xbcd3('0x7')](_0xbcd3('0xe'),auth['isAuthenticated'](),controller[_0xbcd3('0xf')]);router[_0xbcd3('0x10')]('/',auth[_0xbcd3('0x8')](),controller[_0xbcd3('0x11')]);router[_0xbcd3('0x10')](_0xbcd3('0xc'),auth[_0xbcd3('0x8')](),controller[_0xbcd3('0x12')]);router[_0xbcd3('0x13')](_0xbcd3('0xa'),auth[_0xbcd3('0x8')](),controller[_0xbcd3('0x14')]);router[_0xbcd3('0x15')](_0xbcd3('0xa'),auth[_0xbcd3('0x8')](),controller['destroy']);module[_0xbcd3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c250bad..4c0f823 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 _0x5ff3=['STRING','exports'];(function(_0x3f559e,_0x3d1706){var _0x55570a=function(_0x513d17){while(--_0x513d17){_0x3f559e['push'](_0x3f559e['shift']());}};_0x55570a(++_0x3d1706);}(_0x5ff3,0x17d));var _0x35ff=function(_0x427bbc,_0x1f7c98){_0x427bbc=_0x427bbc-0x0;var _0x48280d=_0x5ff3[_0x427bbc];return _0x48280d;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ff('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x35ff('0x1')]},'clientId':{'type':Sequelize[_0x35ff('0x1')]},'clientSecret':{'type':Sequelize[_0x35ff('0x1')]},'serverUrl':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file +var _0xec56=['STRING','sequelize'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xec56,0x1bd));var _0x6ec5=function(_0x4ebf15,_0x4e2477){_0x4ebf15=_0x4ebf15-0x0;var _0x3156ad=_0xec56[_0x4ebf15];return _0x3156ad;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ec5('0x1')]},'host':{'type':Sequelize[_0x6ec5('0x1')]},'zone':{'type':Sequelize[_0x6ec5('0x1')]},'clientId':{'type':Sequelize[_0x6ec5('0x1')]},'clientSecret':{'type':Sequelize[_0x6ec5('0x1')]},'serverUrl':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x6ec5('0x1')]},'refreshToken':{'type':Sequelize[_0x6ec5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 9003f2b..e281235 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 _0x0e62=['Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','ZohoAccount','rawAttributes','type','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','serverUrl','code','host','zoho.eu','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Owner','Subject'];(function(_0x124bf2,_0x1e0919){var _0x197fc2=function(_0x4b41fd){while(--_0x4b41fd){_0x124bf2['push'](_0x124bf2['shift']());}};_0x197fc2(++_0x1e0919);}(_0x0e62,0x94));var _0x20e6=function(_0x2fd8b8,_0x91d0ae){_0x2fd8b8=_0x2fd8b8-0x0;var _0x2344de=_0x0e62[_0x2fd8b8];return _0x2344de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x20e6('0x0'));var jsonpatch=require(_0x20e6('0x1'));var rp=require(_0x20e6('0x2'));var moment=require(_0x20e6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x20e6('0x4'));var util=require('util');var path=require(_0x20e6('0x5'));var sox=require(_0x20e6('0x6'));var csv=require(_0x20e6('0x7'));var ejs=require(_0x20e6('0x8'));var fs=require('fs');var fs_extra=require(_0x20e6('0x9'));var _=require(_0x20e6('0xa'));var squel=require(_0x20e6('0xb'));var crypto=require(_0x20e6('0xc'));var jsforce=require(_0x20e6('0xd'));var deskjs=require(_0x20e6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x20e6('0xf'));var Papa=require(_0x20e6('0x10'));var Redis=require('ioredis');var authService=require(_0x20e6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x20e6('0x12'));var hardwareService=require(_0x20e6('0x13'));var logger=require('../../config/logger')(_0x20e6('0x14'));var utils=require(_0x20e6('0x15'));var config=require(_0x20e6('0x16'));var licenseUtil=require(_0x20e6('0x17'));var db=require(_0x20e6('0x18'))['db'];var integrations=require(_0x20e6('0x19'));function respondWithStatusCode(_0x5eeff4,_0x1cdee4){_0x1cdee4=_0x1cdee4||0xcc;return function(_0x3adf57){if(_0x3adf57){return _0x5eeff4[_0x20e6('0x1a')](_0x1cdee4);}return _0x5eeff4[_0x20e6('0x1b')](_0x1cdee4)[_0x20e6('0x1c')]();};}function respondWithResult(_0x1aeefd,_0x515d7f){_0x515d7f=_0x515d7f||0xc8;return function(_0x1cf97a){if(_0x1cf97a){return _0x1aeefd['status'](_0x515d7f)[_0x20e6('0x1d')](_0x1cf97a);}};}function respondWithFilteredResult(_0x21a88c,_0x251d4b){return function(_0x350841){if(_0x350841){var _0x2edadf=typeof _0x251d4b[_0x20e6('0x1e')]===_0x20e6('0x1f')&&typeof _0x251d4b[_0x20e6('0x20')]===_0x20e6('0x1f');var _0x10479b=_0x350841['count'];var _0x2a821f=_0x2edadf?0x0:_0x251d4b[_0x20e6('0x1e')];var _0x4f928d=_0x2edadf?_0x350841[_0x20e6('0x21')]:_0x251d4b[_0x20e6('0x1e')]+_0x251d4b[_0x20e6('0x20')];var _0x555c4f;if(_0x4f928d>=_0x10479b){_0x4f928d=_0x10479b;_0x555c4f=0xc8;}else{_0x555c4f=0xce;}_0x21a88c[_0x20e6('0x1b')](_0x555c4f);return _0x21a88c[_0x20e6('0x22')](_0x20e6('0x23'),_0x2a821f+'-'+_0x4f928d+'/'+_0x10479b)['json'](_0x350841);}return null;};}function patchUpdates(_0x1d808a){return function(_0x46391f){try{jsonpatch[_0x20e6('0x24')](_0x46391f,_0x1d808a,!![]);}catch(_0x898d){return BPromise[_0x20e6('0x25')](_0x898d);}return _0x46391f[_0x20e6('0x26')]();};}function saveUpdates(_0xfcaa1c,_0x313a46){return function(_0x58ce39){if(_0x58ce39){return _0x58ce39[_0x20e6('0x27')](_0xfcaa1c)['then'](function(_0x28466c){return _0x28466c;});}return null;};}function removeEntity(_0x39a143,_0x54241e){return function(_0x2409dc){if(_0x2409dc){return _0x2409dc[_0x20e6('0x28')]()[_0x20e6('0x29')](function(){_0x39a143[_0x20e6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a5024,_0x5ec514){return function(_0x19efae){if(!_0x19efae){_0x1a5024[_0x20e6('0x1a')](0x194);}return _0x19efae;};}function handleError(_0x53f7a5,_0x3fcb5d){_0x3fcb5d=_0x3fcb5d||0x1f4;return function(_0x4c7a05){logger[_0x20e6('0x2a')](_0x4c7a05['stack']);if(_0x4c7a05[_0x20e6('0x2b')]){delete _0x4c7a05[_0x20e6('0x2b')];}_0x53f7a5[_0x20e6('0x1b')](_0x3fcb5d)[_0x20e6('0x2c')](_0x4c7a05);};}exports['index']=function(_0x330c89,_0x42b44e){var _0x4c475b={},_0x4b18cb={},_0x1ff243={'count':0x0,'rows':[]};var _0x386a27=_[_0x20e6('0x2d')](db[_0x20e6('0x2e')][_0x20e6('0x2f')],function(_0x26bb6c){return{'name':_0x26bb6c['fieldName'],'type':_0x26bb6c[_0x20e6('0x30')]['key']};});_0x4b18cb['model']=_[_0x20e6('0x2d')](_0x386a27,_0x20e6('0x2b'));_0x4b18cb[_0x20e6('0x31')]=_['keys'](_0x330c89[_0x20e6('0x31')]);_0x4b18cb[_0x20e6('0x32')]=_['intersection'](_0x4b18cb[_0x20e6('0x33')],_0x4b18cb[_0x20e6('0x31')]);_0x4c475b['attributes']=_[_0x20e6('0x34')](_0x4b18cb['model'],qs['fields'](_0x330c89[_0x20e6('0x31')][_0x20e6('0x35')]));_0x4c475b['attributes']=_0x4c475b[_0x20e6('0x36')][_0x20e6('0x37')]?_0x4c475b[_0x20e6('0x36')]:_0x4b18cb['model'];if(!_0x330c89[_0x20e6('0x31')][_0x20e6('0x38')]('nolimit')){_0x4c475b['limit']=qs[_0x20e6('0x20')](_0x330c89[_0x20e6('0x31')][_0x20e6('0x20')]);_0x4c475b[_0x20e6('0x1e')]=qs['offset'](_0x330c89[_0x20e6('0x31')]['offset']);}_0x4c475b[_0x20e6('0x39')]=qs[_0x20e6('0x3a')](_0x330c89[_0x20e6('0x31')][_0x20e6('0x3a')]);_0x4c475b[_0x20e6('0x3b')]=qs[_0x20e6('0x32')](_[_0x20e6('0x3c')](_0x330c89[_0x20e6('0x31')],_0x4b18cb[_0x20e6('0x32')]),_0x386a27);if(_0x330c89[_0x20e6('0x31')][_0x20e6('0x3d')]){_0x4c475b[_0x20e6('0x3b')]=_[_0x20e6('0x3e')](_0x4c475b[_0x20e6('0x3b')],{'$or':_['map'](_0x386a27,function(_0x26fd35){if(_0x26fd35['type']!=='VIRTUAL'){var _0x119a58={};_0x119a58[_0x26fd35[_0x20e6('0x2b')]]={'$like':'%'+_0x330c89[_0x20e6('0x31')][_0x20e6('0x3d')]+'%'};return _0x119a58;}})});}_0x4c475b=_[_0x20e6('0x3e')]({},_0x4c475b,_0x330c89[_0x20e6('0x3f')]);var _0x1da308={'where':_0x4c475b['where']};return db[_0x20e6('0x2e')][_0x20e6('0x21')](_0x1da308)[_0x20e6('0x29')](function(_0x4a4eca){_0x1ff243[_0x20e6('0x21')]=_0x4a4eca;if(_0x330c89[_0x20e6('0x31')][_0x20e6('0x40')]){_0x4c475b['include']=[{'all':!![]}];}return db[_0x20e6('0x2e')][_0x20e6('0x41')](_0x4c475b);})[_0x20e6('0x29')](function(_0x94cfd4){_0x1ff243['rows']=_0x94cfd4;return _0x1ff243;})[_0x20e6('0x29')](respondWithFilteredResult(_0x42b44e,_0x4c475b))[_0x20e6('0x42')](handleError(_0x42b44e,null));};exports[_0x20e6('0x43')]=function(_0x1f6220,_0x5a2f6c){var _0x126a0f={'raw':![],'where':{'id':_0x1f6220[_0x20e6('0x44')]['id']}},_0x438875={};_0x438875[_0x20e6('0x33')]=_[_0x20e6('0x45')](db['ZohoAccount']['rawAttributes']);_0x438875[_0x20e6('0x31')]=_['keys'](_0x1f6220[_0x20e6('0x31')]);_0x438875[_0x20e6('0x32')]=_[_0x20e6('0x34')](_0x438875['model'],_0x438875[_0x20e6('0x31')]);_0x126a0f[_0x20e6('0x36')]=_[_0x20e6('0x34')](_0x438875[_0x20e6('0x33')],qs['fields'](_0x1f6220['query'][_0x20e6('0x35')]));_0x126a0f[_0x20e6('0x36')]=_0x126a0f[_0x20e6('0x36')][_0x20e6('0x37')]?_0x126a0f[_0x20e6('0x36')]:_0x438875['model'];if(_0x1f6220[_0x20e6('0x31')][_0x20e6('0x40')]){_0x126a0f[_0x20e6('0x46')]=[{'all':!![]}];}_0x126a0f=_[_0x20e6('0x3e')]({},_0x126a0f,_0x1f6220[_0x20e6('0x3f')]);return db[_0x20e6('0x2e')][_0x20e6('0x47')](_0x126a0f)[_0x20e6('0x29')](handleEntityNotFound(_0x5a2f6c,null))[_0x20e6('0x29')](respondWithResult(_0x5a2f6c,null))[_0x20e6('0x42')](handleError(_0x5a2f6c,null));};exports[_0x20e6('0x48')]=function(_0x224990,_0x1f15da){return db[_0x20e6('0x2e')]['create'](_0x224990[_0x20e6('0x49')],{})['then'](respondWithResult(_0x1f15da,0xc9))['catch'](handleError(_0x1f15da,null));};exports[_0x20e6('0x27')]=function(_0x54e397,_0x515419){if(_0x54e397[_0x20e6('0x49')]['id']){delete _0x54e397[_0x20e6('0x49')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x54e397[_0x20e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x515419,null))[_0x20e6('0x29')](saveUpdates(_0x54e397[_0x20e6('0x49')],null))[_0x20e6('0x29')](respondWithResult(_0x515419,null))[_0x20e6('0x42')](handleError(_0x515419,null));};exports[_0x20e6('0x28')]=function(_0x4486ab,_0x493659){return db['ZohoAccount'][_0x20e6('0x47')]({'where':{'id':_0x4486ab[_0x20e6('0x44')]['id']}})[_0x20e6('0x29')](handleEntityNotFound(_0x493659,null))[_0x20e6('0x29')](removeEntity(_0x493659,null))['catch'](handleError(_0x493659,null));};exports[_0x20e6('0x4a')]=function(_0x5aca45,_0x10f96c,_0x55dd5d){var _0x548554={};var _0x26711e={};var _0x20b282;var _0x2cef72;return db[_0x20e6('0x2e')][_0x20e6('0x4b')]({'where':{'id':_0x5aca45[_0x20e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x10f96c,null))[_0x20e6('0x29')](function(_0x3b73e3){if(_0x3b73e3){_0x20b282=_0x3b73e3;_0x26711e[_0x20e6('0x33')]=_[_0x20e6('0x45')](db['ZohoConfiguration'][_0x20e6('0x2f')]);_0x26711e[_0x20e6('0x31')]=_[_0x20e6('0x45')](_0x5aca45[_0x20e6('0x31')]);_0x26711e[_0x20e6('0x32')]=_[_0x20e6('0x34')](_0x26711e[_0x20e6('0x33')],_0x26711e['query']);_0x548554[_0x20e6('0x36')]=_[_0x20e6('0x34')](_0x26711e[_0x20e6('0x33')],qs[_0x20e6('0x35')](_0x5aca45[_0x20e6('0x31')][_0x20e6('0x35')]));_0x548554[_0x20e6('0x36')]=_0x548554[_0x20e6('0x36')][_0x20e6('0x37')]?_0x548554['attributes']:_0x26711e['model'];_0x548554[_0x20e6('0x39')]=qs[_0x20e6('0x3a')](_0x5aca45[_0x20e6('0x31')][_0x20e6('0x3a')]);_0x548554['where']=qs[_0x20e6('0x32')](_[_0x20e6('0x3c')](_0x5aca45[_0x20e6('0x31')],_0x26711e[_0x20e6('0x32')]));if(_0x5aca45[_0x20e6('0x31')][_0x20e6('0x3d')]){_0x548554[_0x20e6('0x3b')]=_[_0x20e6('0x3e')](_0x548554[_0x20e6('0x3b')],{'$or':_[_0x20e6('0x2d')](_0x548554[_0x20e6('0x36')],function(_0x2666a0){var _0x4278ac={};_0x4278ac[_0x2666a0]={'$like':'%'+_0x5aca45[_0x20e6('0x31')][_0x20e6('0x3d')]+'%'};return _0x4278ac;})});}_0x548554=_['merge']({},_0x548554,_0x5aca45['options']);return _0x20b282['getConfigurations'](_0x548554);}})[_0x20e6('0x29')](function(_0x2a6ff5){if(_0x2a6ff5){_0x2cef72=_0x2a6ff5[_0x20e6('0x37')];if(!_0x5aca45[_0x20e6('0x31')][_0x20e6('0x38')](_0x20e6('0x4c'))){_0x548554[_0x20e6('0x20')]=qs[_0x20e6('0x20')](_0x5aca45[_0x20e6('0x31')]['limit']);_0x548554['offset']=qs[_0x20e6('0x1e')](_0x5aca45['query'][_0x20e6('0x1e')]);}return _0x20b282[_0x20e6('0x4a')](_0x548554);}})['then'](function(_0x36890f){if(_0x36890f){return _0x36890f?{'count':_0x2cef72,'rows':_0x36890f}:null;}})['then'](respondWithResult(_0x10f96c,null))[_0x20e6('0x42')](handleError(_0x10f96c,null));};exports[_0x20e6('0x4d')]=function(_0x5053c4,_0x4a3f7d,_0x22103e){if(_0x5053c4['body']['id']){delete _0x5053c4['body']['id'];}return db[_0x20e6('0x2e')][_0x20e6('0x4b')]({'where':{'id':_0x5053c4[_0x20e6('0x44')]['id']}})[_0x20e6('0x29')](handleEntityNotFound(_0x4a3f7d,null))[_0x20e6('0x29')](function(_0x3ef078){if(_0x3ef078){_0x5053c4[_0x20e6('0x49')][_0x20e6('0x4e')]=_0x3ef078['id'];_0x5053c4[_0x20e6('0x49')][_0x20e6('0x4f')]=integrations['getSubjects'](_0x5053c4[_0x20e6('0x49')]['channel'],_0x5053c4[_0x20e6('0x49')]['type']);_0x5053c4[_0x20e6('0x49')][_0x20e6('0x50')]=integrations[_0x20e6('0x51')](_0x5053c4[_0x20e6('0x49')][_0x20e6('0x52')],_0x5053c4['body'][_0x20e6('0x30')]);return db[_0x20e6('0x53')]['create'](_0x5053c4[_0x20e6('0x49')],{'include':[{'model':db[_0x20e6('0x54')],'as':_0x20e6('0x4f')},{'model':db[_0x20e6('0x54')],'as':_0x20e6('0x50')}]});}return null;})[_0x20e6('0x29')](respondWithResult(_0x4a3f7d,null))['catch'](handleError(_0x4a3f7d,null));};function getAccessToken(_0x165454){return new Promise(function(_0x1e0d92,_0xc1c2dd){var _0xa741c5;switch(_0x165454[_0x20e6('0x55')]){case'US':_0xa741c5=_0x20e6('0x56');break;case'AU':_0xa741c5=_0x20e6('0x57');break;case'EU':_0xa741c5='https://accounts.zoho.eu';break;case'IN':_0xa741c5=_0x20e6('0x58');break;case'CN':_0xa741c5=_0x20e6('0x59');break;default:_0xa741c5=_0x20e6('0x5a');break;}var _0xbc2542={'method':'POST','uri':_0xa741c5+_0x20e6('0x5b'),'qs':{'refresh_token':_0x165454[_0x20e6('0x5c')],'client_id':_0x165454['clientId'],'client_secret':_0x165454[_0x20e6('0x5d')],'grant_type':_0x20e6('0x5e')},'json':!![]};return rp(_0xbc2542)[_0x20e6('0x29')](function(_0x37de7a){if(_0x37de7a['access_token']){_0x1e0d92(_0x37de7a['access_token']);}else{_0xc1c2dd(_0x20e6('0x5f'));}})['catch'](function(_0x14454b){_0xc1c2dd(_0x14454b);});});}exports['getFields']=function(_0x52e1fa,_0x32f78c,_0x191d03){var _0x1f1703,_0x4ea45c,_0x50decd,_0x3fc4a7,_0x521682;return db['ZohoAccount'][_0x20e6('0x4b')]({'where':{'id':_0x52e1fa[_0x20e6('0x44')]['id']},'attributes':['id','host',_0x20e6('0x55'),'clientId',_0x20e6('0x5d'),_0x20e6('0x60'),_0x20e6('0x61'),'refreshToken']})[_0x20e6('0x29')](handleEntityNotFound(_0x32f78c,null))[_0x20e6('0x29')](function(_0x16e09b){_0x521682=_0x16e09b;_0x1f1703=_0x521682[_0x20e6('0x62')];_0x4ea45c=_0x1f1703===_0x20e6('0x63')?'eu':_0x20e6('0x64');_0x50decd=_0x521682[_0x20e6('0x60')];var _0x92622a=_0x50decd['slice'](-0x1);if(_0x92622a==='/'||_0x92622a==='\x5c'||_0x92622a===':'){_0x50decd=_0x50decd[_0x20e6('0x65')](0x0,_0x50decd['lastIndexOf'](_0x92622a));}if(!_0x521682['refreshToken']){throw new Error(_0x20e6('0x66'));}return getAccessToken(_0x521682);})[_0x20e6('0x29')](function(_0x3c7d44){if(_0x3c7d44){return rp({'method':_0x20e6('0x67'),'uri':util[_0x20e6('0x68')](_0x20e6('0x69'),_0x4ea45c),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3c7d44},'json':!![]});}})[_0x20e6('0x29')](function(_0xad8152){if(_0xad8152){if(_0xad8152[_0x20e6('0x6a')]&&_0xad8152['response'][_0x20e6('0x2a')]){throw new Error(_0xad8152[_0x20e6('0x6a')]['error'][_0x20e6('0x6b')]);}var _0x335ba5=[];var _0x1dd02c=[];var _0x499ef6=[_0x20e6('0x6c'),_0x20e6('0x6d'),_0x20e6('0x6e'),'WhoId',_0x20e6('0x6f'),_0x20e6('0x70'),_0x20e6('0x71'),_0x20e6('0x72')];_0x1dd02c=_[_0x20e6('0x73')](_0xad8152['fields'],function(_0x4104e4){return _0x499ef6[_0x20e6('0x74')](_0x4104e4[_0x20e6('0x75')]);});for(var _0x4b18a1=0x0;_0x4b18a1<_0x1dd02c[_0x20e6('0x37')];_0x4b18a1++){if(_0x1dd02c[_0x4b18a1]['system_mandatory']===![]){_0x335ba5[_0x20e6('0x76')]({'id':_0x1dd02c[_0x4b18a1]['id'],'name':_0x1dd02c[_0x4b18a1][_0x20e6('0x77')],'custom':_0x1dd02c[_0x4b18a1][_0x20e6('0x78')],'options':_0x1dd02c[_0x4b18a1][_0x20e6('0x79')]===_0x20e6('0x7a')&&_0x1dd02c[_0x4b18a1][_0x20e6('0x7b')][_0x20e6('0x37')]>-0x1?_[_0x20e6('0x2d')](_0x1dd02c[_0x4b18a1][_0x20e6('0x7b')],function(_0x4b6431){return{'name':_0x4b6431,'value':_0x4b6431};}):[]});}}return{'count':_0x335ba5[_0x20e6('0x37')],'rows':_0x335ba5};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x32f78c,null))[_0x20e6('0x42')](function(_0x2edf5d){var _0x52255a=_0x52e1fa[_0x20e6('0x31')][_0x20e6('0x7c')]?0x1f4:_0x2edf5d[_0x20e6('0x7d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x20e6('0x7e'),_0x52255a,JSON[_0x20e6('0x7f')](_0x2edf5d));delete _0x2edf5d['name'];if(_0x52255a===0x191){_0x52255a=0x190;}_0x32f78c[_0x20e6('0x1b')](_0x52255a)[_0x20e6('0x2c')](_0x52e1fa['query'][_0x20e6('0x7c')]?{'message':_0x20e6('0x80'),'statusCode':_0x2edf5d['statusCode']}:_0x2edf5d);});}; \ No newline at end of file +var _0xf36b=['create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','clientId','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','refreshToken','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','status','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','includeAll','find','catch'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0xf36b,0x13a));var _0xbf36=function(_0x55a9e6,_0x2ee045){_0x55a9e6=_0x55a9e6-0x0;var _0x16e8bd=_0xf36b[_0x55a9e6];return _0x16e8bd;};'use strict';var emlformat=require(_0xbf36('0x0'));var rimraf=require(_0xbf36('0x1'));var zipdir=require(_0xbf36('0x2'));var jsonpatch=require(_0xbf36('0x3'));var rp=require(_0xbf36('0x4'));var moment=require(_0xbf36('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbf36('0x6'));var util=require('util');var path=require(_0xbf36('0x7'));var sox=require(_0xbf36('0x8'));var csv=require(_0xbf36('0x9'));var ejs=require(_0xbf36('0xa'));var fs=require('fs');var fs_extra=require(_0xbf36('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbf36('0xc'));var toCsv=require(_0xbf36('0x9'));var querystring=require(_0xbf36('0xd'));var Papa=require(_0xbf36('0xe'));var Redis=require(_0xbf36('0xf'));var authService=require(_0xbf36('0x10'));var qs=require(_0xbf36('0x11'));var as=require(_0xbf36('0x12'));var hardwareService=require(_0xbf36('0x13'));var logger=require(_0xbf36('0x14'))(_0xbf36('0x15'));var utils=require(_0xbf36('0x16'));var config=require(_0xbf36('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xbf36('0x18'));function respondWithStatusCode(_0x3ece61,_0x1793f6){_0x1793f6=_0x1793f6||0xcc;return function(_0x2e36dd){if(_0x2e36dd){return _0x3ece61[_0xbf36('0x19')](_0x1793f6);}return _0x3ece61['status'](_0x1793f6)[_0xbf36('0x1a')]();};}function respondWithResult(_0x4db0ea,_0x292893){_0x292893=_0x292893||0xc8;return function(_0x237024){if(_0x237024){return _0x4db0ea['status'](_0x292893)['json'](_0x237024);}};}function respondWithFilteredResult(_0x360355,_0x3b78ad){return function(_0x21311b){if(_0x21311b){var _0x421b24=typeof _0x3b78ad[_0xbf36('0x1b')]===_0xbf36('0x1c')&&typeof _0x3b78ad[_0xbf36('0x1d')]===_0xbf36('0x1c');var _0x27b2ac=_0x21311b[_0xbf36('0x1e')];var _0x2a6a66=_0x421b24?0x0:_0x3b78ad[_0xbf36('0x1b')];var _0x23f57b=_0x421b24?_0x21311b['count']:_0x3b78ad[_0xbf36('0x1b')]+_0x3b78ad['limit'];var _0x30def5;if(_0x23f57b>=_0x27b2ac){_0x23f57b=_0x27b2ac;_0x30def5=0xc8;}else{_0x30def5=0xce;}_0x360355['status'](_0x30def5);return _0x360355[_0xbf36('0x1f')](_0xbf36('0x20'),_0x2a6a66+'-'+_0x23f57b+'/'+_0x27b2ac)[_0xbf36('0x21')](_0x21311b);}return null;};}function patchUpdates(_0x4ee0c4){return function(_0x115adf){try{jsonpatch['apply'](_0x115adf,_0x4ee0c4,!![]);}catch(_0x4afca4){return BPromise[_0xbf36('0x22')](_0x4afca4);}return _0x115adf[_0xbf36('0x23')]();};}function saveUpdates(_0x1beaf9,_0xe27a2a){return function(_0x42f717){if(_0x42f717){return _0x42f717[_0xbf36('0x24')](_0x1beaf9)[_0xbf36('0x25')](function(_0x38d242){return _0x38d242;});}return null;};}function removeEntity(_0x5e6ce3,_0x3b1d99){return function(_0x1ac777){if(_0x1ac777){return _0x1ac777[_0xbf36('0x26')]()[_0xbf36('0x25')](function(){_0x5e6ce3[_0xbf36('0x27')](0xcc)[_0xbf36('0x1a')]();});}};}function handleEntityNotFound(_0x4e2f75,_0x2218f1){return function(_0x11efee){if(!_0x11efee){_0x4e2f75[_0xbf36('0x19')](0x194);}return _0x11efee;};}function handleError(_0x1fd767,_0x281149){_0x281149=_0x281149||0x1f4;return function(_0xd1aae0){logger[_0xbf36('0x28')](_0xd1aae0['stack']);if(_0xd1aae0[_0xbf36('0x29')]){delete _0xd1aae0[_0xbf36('0x29')];}_0x1fd767['status'](_0x281149)[_0xbf36('0x2a')](_0xd1aae0);};}exports[_0xbf36('0x2b')]=function(_0x338ff3,_0x3316c9){var _0x3459be={},_0xb990f={},_0x5f206c={'count':0x0,'rows':[]};var _0xbe95ae=_[_0xbf36('0x2c')](db[_0xbf36('0x2d')][_0xbf36('0x2e')],function(_0x83d770){return{'name':_0x83d770[_0xbf36('0x2f')],'type':_0x83d770[_0xbf36('0x30')]['key']};});_0xb990f[_0xbf36('0x31')]=_[_0xbf36('0x2c')](_0xbe95ae,_0xbf36('0x29'));_0xb990f[_0xbf36('0x32')]=_[_0xbf36('0x33')](_0x338ff3[_0xbf36('0x32')]);_0xb990f[_0xbf36('0x34')]=_[_0xbf36('0x35')](_0xb990f[_0xbf36('0x31')],_0xb990f[_0xbf36('0x32')]);_0x3459be[_0xbf36('0x36')]=_[_0xbf36('0x35')](_0xb990f[_0xbf36('0x31')],qs['fields'](_0x338ff3[_0xbf36('0x32')][_0xbf36('0x37')]));_0x3459be[_0xbf36('0x36')]=_0x3459be[_0xbf36('0x36')][_0xbf36('0x38')]?_0x3459be['attributes']:_0xb990f[_0xbf36('0x31')];if(!_0x338ff3[_0xbf36('0x32')][_0xbf36('0x39')](_0xbf36('0x3a'))){_0x3459be[_0xbf36('0x1d')]=qs[_0xbf36('0x1d')](_0x338ff3[_0xbf36('0x32')][_0xbf36('0x1d')]);_0x3459be[_0xbf36('0x1b')]=qs[_0xbf36('0x1b')](_0x338ff3[_0xbf36('0x32')]['offset']);}_0x3459be[_0xbf36('0x3b')]=qs[_0xbf36('0x3c')](_0x338ff3[_0xbf36('0x32')][_0xbf36('0x3c')]);_0x3459be[_0xbf36('0x3d')]=qs['filters'](_[_0xbf36('0x3e')](_0x338ff3[_0xbf36('0x32')],_0xb990f['filters']),_0xbe95ae);if(_0x338ff3[_0xbf36('0x32')][_0xbf36('0x3f')]){_0x3459be[_0xbf36('0x3d')]=_[_0xbf36('0x40')](_0x3459be[_0xbf36('0x3d')],{'$or':_[_0xbf36('0x2c')](_0xbe95ae,function(_0x26c476){if(_0x26c476[_0xbf36('0x30')]!=='VIRTUAL'){var _0x3a5871={};_0x3a5871[_0x26c476[_0xbf36('0x29')]]={'$like':'%'+_0x338ff3[_0xbf36('0x32')]['filter']+'%'};return _0x3a5871;}})});}_0x3459be=_[_0xbf36('0x40')]({},_0x3459be,_0x338ff3[_0xbf36('0x41')]);var _0x21d8be={'where':_0x3459be[_0xbf36('0x3d')]};return db[_0xbf36('0x2d')][_0xbf36('0x1e')](_0x21d8be)[_0xbf36('0x25')](function(_0x384324){_0x5f206c[_0xbf36('0x1e')]=_0x384324;if(_0x338ff3['query']['includeAll']){_0x3459be[_0xbf36('0x42')]=[{'all':!![]}];}return db[_0xbf36('0x2d')][_0xbf36('0x43')](_0x3459be);})['then'](function(_0x308c50){_0x5f206c[_0xbf36('0x44')]=_0x308c50;return _0x5f206c;})[_0xbf36('0x25')](respondWithFilteredResult(_0x3316c9,_0x3459be))['catch'](handleError(_0x3316c9,null));};exports[_0xbf36('0x45')]=function(_0x49a1e6,_0x4ea709){var _0x8833f2={'raw':![],'where':{'id':_0x49a1e6['params']['id']}},_0x27ac70={};_0x27ac70[_0xbf36('0x31')]=_[_0xbf36('0x33')](db['ZohoAccount'][_0xbf36('0x2e')]);_0x27ac70[_0xbf36('0x32')]=_[_0xbf36('0x33')](_0x49a1e6[_0xbf36('0x32')]);_0x27ac70['filters']=_['intersection'](_0x27ac70[_0xbf36('0x31')],_0x27ac70[_0xbf36('0x32')]);_0x8833f2['attributes']=_[_0xbf36('0x35')](_0x27ac70[_0xbf36('0x31')],qs['fields'](_0x49a1e6[_0xbf36('0x32')][_0xbf36('0x37')]));_0x8833f2[_0xbf36('0x36')]=_0x8833f2['attributes'][_0xbf36('0x38')]?_0x8833f2[_0xbf36('0x36')]:_0x27ac70[_0xbf36('0x31')];if(_0x49a1e6[_0xbf36('0x32')][_0xbf36('0x46')]){_0x8833f2[_0xbf36('0x42')]=[{'all':!![]}];}_0x8833f2=_[_0xbf36('0x40')]({},_0x8833f2,_0x49a1e6['options']);return db[_0xbf36('0x2d')][_0xbf36('0x47')](_0x8833f2)[_0xbf36('0x25')](handleEntityNotFound(_0x4ea709,null))[_0xbf36('0x25')](respondWithResult(_0x4ea709,null))[_0xbf36('0x48')](handleError(_0x4ea709,null));};exports[_0xbf36('0x49')]=function(_0x4bc7fb,_0x251423){return db[_0xbf36('0x2d')][_0xbf36('0x49')](_0x4bc7fb['body'],{})[_0xbf36('0x25')](respondWithResult(_0x251423,0xc9))[_0xbf36('0x48')](handleError(_0x251423,null));};exports[_0xbf36('0x24')]=function(_0x53816a,_0x3bf660){if(_0x53816a[_0xbf36('0x4a')]['id']){delete _0x53816a[_0xbf36('0x4a')]['id'];}return db[_0xbf36('0x2d')]['find']({'where':{'id':_0x53816a[_0xbf36('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bf660,null))[_0xbf36('0x25')](saveUpdates(_0x53816a['body'],null))['then'](respondWithResult(_0x3bf660,null))[_0xbf36('0x48')](handleError(_0x3bf660,null));};exports[_0xbf36('0x26')]=function(_0x5e61f8,_0x5a4e72){return db['ZohoAccount'][_0xbf36('0x47')]({'where':{'id':_0x5e61f8['params']['id']}})[_0xbf36('0x25')](handleEntityNotFound(_0x5a4e72,null))[_0xbf36('0x25')](removeEntity(_0x5a4e72,null))[_0xbf36('0x48')](handleError(_0x5a4e72,null));};exports[_0xbf36('0x4c')]=function(_0x1c3657,_0x5392a3,_0x203fe3){var _0x93c731={};var _0x599b0a={};var _0xccc2e3;var _0x1bbd08;return db[_0xbf36('0x2d')][_0xbf36('0x4d')]({'where':{'id':_0x1c3657['params']['id']}})['then'](handleEntityNotFound(_0x5392a3,null))[_0xbf36('0x25')](function(_0x469137){if(_0x469137){_0xccc2e3=_0x469137;_0x599b0a['model']=_[_0xbf36('0x33')](db['ZohoConfiguration'][_0xbf36('0x2e')]);_0x599b0a[_0xbf36('0x32')]=_[_0xbf36('0x33')](_0x1c3657[_0xbf36('0x32')]);_0x599b0a[_0xbf36('0x34')]=_[_0xbf36('0x35')](_0x599b0a[_0xbf36('0x31')],_0x599b0a['query']);_0x93c731[_0xbf36('0x36')]=_[_0xbf36('0x35')](_0x599b0a['model'],qs['fields'](_0x1c3657[_0xbf36('0x32')][_0xbf36('0x37')]));_0x93c731[_0xbf36('0x36')]=_0x93c731['attributes'][_0xbf36('0x38')]?_0x93c731[_0xbf36('0x36')]:_0x599b0a['model'];_0x93c731[_0xbf36('0x3b')]=qs[_0xbf36('0x3c')](_0x1c3657['query'][_0xbf36('0x3c')]);_0x93c731[_0xbf36('0x3d')]=qs[_0xbf36('0x34')](_[_0xbf36('0x3e')](_0x1c3657[_0xbf36('0x32')],_0x599b0a[_0xbf36('0x34')]));if(_0x1c3657[_0xbf36('0x32')]['filter']){_0x93c731[_0xbf36('0x3d')]=_[_0xbf36('0x40')](_0x93c731[_0xbf36('0x3d')],{'$or':_['map'](_0x93c731[_0xbf36('0x36')],function(_0x2c5c5f){var _0x19fd95={};_0x19fd95[_0x2c5c5f]={'$like':'%'+_0x1c3657['query'][_0xbf36('0x3f')]+'%'};return _0x19fd95;})});}_0x93c731=_[_0xbf36('0x40')]({},_0x93c731,_0x1c3657['options']);return _0xccc2e3[_0xbf36('0x4c')](_0x93c731);}})[_0xbf36('0x25')](function(_0x30f426){if(_0x30f426){_0x1bbd08=_0x30f426['length'];if(!_0x1c3657[_0xbf36('0x32')][_0xbf36('0x39')]('nolimit')){_0x93c731['limit']=qs[_0xbf36('0x1d')](_0x1c3657[_0xbf36('0x32')][_0xbf36('0x1d')]);_0x93c731[_0xbf36('0x1b')]=qs[_0xbf36('0x1b')](_0x1c3657[_0xbf36('0x32')][_0xbf36('0x1b')]);}return _0xccc2e3[_0xbf36('0x4c')](_0x93c731);}})['then'](function(_0x36b46c){if(_0x36b46c){return _0x36b46c?{'count':_0x1bbd08,'rows':_0x36b46c}:null;}})[_0xbf36('0x25')](respondWithResult(_0x5392a3,null))[_0xbf36('0x48')](handleError(_0x5392a3,null));};exports[_0xbf36('0x4e')]=function(_0x3caee6,_0x4ecaa2,_0x3212b1){if(_0x3caee6[_0xbf36('0x4a')]['id']){delete _0x3caee6[_0xbf36('0x4a')]['id'];}return db[_0xbf36('0x2d')][_0xbf36('0x4d')]({'where':{'id':_0x3caee6[_0xbf36('0x4b')]['id']}})[_0xbf36('0x25')](handleEntityNotFound(_0x4ecaa2,null))[_0xbf36('0x25')](function(_0x47c45e){if(_0x47c45e){_0x3caee6[_0xbf36('0x4a')][_0xbf36('0x4f')]=_0x47c45e['id'];_0x3caee6['body'][_0xbf36('0x50')]=integrations[_0xbf36('0x51')](_0x3caee6[_0xbf36('0x4a')]['channel'],_0x3caee6[_0xbf36('0x4a')][_0xbf36('0x30')]);_0x3caee6[_0xbf36('0x4a')][_0xbf36('0x52')]=integrations[_0xbf36('0x53')](_0x3caee6[_0xbf36('0x4a')]['channel'],_0x3caee6[_0xbf36('0x4a')][_0xbf36('0x30')]);return db[_0xbf36('0x54')][_0xbf36('0x49')](_0x3caee6['body'],{'include':[{'model':db[_0xbf36('0x55')],'as':_0xbf36('0x50')},{'model':db[_0xbf36('0x55')],'as':_0xbf36('0x52')}]});}return null;})[_0xbf36('0x25')](respondWithResult(_0x4ecaa2,null))[_0xbf36('0x48')](handleError(_0x4ecaa2,null));};function getAccessToken(_0x13e377){return new Promise(function(_0x674e7,_0x2a6447){var _0x1c22e0;switch(_0x13e377['zone']){case'US':_0x1c22e0='https://accounts.zoho.com';break;case'AU':_0x1c22e0=_0xbf36('0x56');break;case'EU':_0x1c22e0=_0xbf36('0x57');break;case'IN':_0x1c22e0=_0xbf36('0x58');break;case'CN':_0x1c22e0='https://accounts.zoho.com.cn';break;default:_0x1c22e0=_0xbf36('0x57');break;}var _0x2d9ce0={'method':_0xbf36('0x59'),'uri':_0x1c22e0+'/oauth/v2/token','qs':{'refresh_token':_0x13e377['refreshToken'],'client_id':_0x13e377[_0xbf36('0x5a')],'client_secret':_0x13e377[_0xbf36('0x5b')],'grant_type':_0xbf36('0x5c')},'json':!![]};return rp(_0x2d9ce0)['then'](function(_0x139919){if(_0x139919['access_token']){_0x674e7(_0x139919['access_token']);}else{_0x2a6447(_0xbf36('0x5d'));}})['catch'](function(_0x26c9b2){_0x2a6447(_0x26c9b2);});});}exports[_0xbf36('0x5e')]=function(_0x124511,_0x1a9e88,_0x2b4125){var _0x57fee8,_0x9b33a0,_0x458738,_0x331a18,_0x2e7fe0;return db['ZohoAccount'][_0xbf36('0x4d')]({'where':{'id':_0x124511['params']['id']},'attributes':['id',_0xbf36('0x5f'),_0xbf36('0x60'),_0xbf36('0x5a'),_0xbf36('0x5b'),_0xbf36('0x61'),_0xbf36('0x62'),_0xbf36('0x63')]})['then'](handleEntityNotFound(_0x1a9e88,null))[_0xbf36('0x25')](function(_0x53bfa9){_0x2e7fe0=_0x53bfa9;_0x57fee8=_0x2e7fe0[_0xbf36('0x5f')];_0x9b33a0=_0x57fee8===_0xbf36('0x64')?'eu':_0xbf36('0x65');_0x458738=_0x2e7fe0[_0xbf36('0x61')];var _0x4a05fb=_0x458738['slice'](-0x1);if(_0x4a05fb==='/'||_0x4a05fb==='\x5c'||_0x4a05fb===':'){_0x458738=_0x458738[_0xbf36('0x66')](0x0,_0x458738[_0xbf36('0x67')](_0x4a05fb));}if(!_0x2e7fe0[_0xbf36('0x63')]){throw new Error(_0xbf36('0x68'));}return getAccessToken(_0x2e7fe0);})['then'](function(_0xb13edb){if(_0xb13edb){return rp({'method':_0xbf36('0x69'),'uri':util[_0xbf36('0x6a')](_0xbf36('0x6b'),_0x9b33a0),'qs':{'module':_0xbf36('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xb13edb},'json':!![]});}})['then'](function(_0x2480e2){if(_0x2480e2){if(_0x2480e2['response']&&_0x2480e2[_0xbf36('0x6d')][_0xbf36('0x28')]){throw new Error(_0x2480e2[_0xbf36('0x6d')]['error']['message']);}var _0x1c2fef=[];var _0x212591=[];var _0x2e8f02=[_0xbf36('0x6e'),_0xbf36('0x6f'),_0xbf36('0x70'),_0xbf36('0x71'),_0xbf36('0x72'),_0xbf36('0x73'),'Call_Start_Time',_0xbf36('0x74')];_0x212591=_[_0xbf36('0x75')](_0x2480e2[_0xbf36('0x37')],function(_0x40726e){return _0x2e8f02[_0xbf36('0x76')](_0x40726e['api_name']);});for(var _0x66cfb=0x0;_0x66cfb<_0x212591[_0xbf36('0x38')];_0x66cfb++){if(_0x212591[_0x66cfb][_0xbf36('0x77')]===![]){_0x1c2fef[_0xbf36('0x78')]({'id':_0x212591[_0x66cfb]['id'],'name':_0x212591[_0x66cfb][_0xbf36('0x79')],'custom':_0x212591[_0x66cfb][_0xbf36('0x7a')],'options':_0x212591[_0x66cfb]['data_type']===_0xbf36('0x7b')&&_0x212591[_0x66cfb][_0xbf36('0x7c')]['length']>-0x1?_['map'](_0x212591[_0x66cfb][_0xbf36('0x7c')],function(_0x293272){return{'name':_0x293272,'value':_0x293272};}):[]});}}return{'count':_0x1c2fef[_0xbf36('0x38')],'rows':_0x1c2fef};}else{return{'count':0x0,'rows':[]};}})[_0xbf36('0x25')](respondWithResult(_0x1a9e88,null))[_0xbf36('0x48')](function(_0x3a604c){var _0x3636b8=_0x124511[_0xbf36('0x32')][_0xbf36('0x7d')]?0x1f4:_0x3a604c[_0xbf36('0x7e')]||0x1f4;logger['error'](_0xbf36('0x7f'),'getFields',_0x3636b8,JSON[_0xbf36('0x80')](_0x3a604c));delete _0x3a604c[_0xbf36('0x29')];if(_0x3636b8===0x191){_0x3636b8=0x190;}_0x1a9e88[_0xbf36('0x27')](_0x3636b8)[_0xbf36('0x2a')](_0x124511[_0xbf36('0x32')][_0xbf36('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x3a604c[_0xbf36('0x7e')]}:_0x3a604c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 2b6761f..b79124e 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 _0x94c6=['slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','then','parse','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','https://accounts.zoho.com.au','authorization_code','application/x-www-form-urlencoded','refreshToken','info','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','changed','serverUrl','clientSecret','code','host'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x94c6,0xca));var _0x694c=function(_0x59626b,_0x1f07ac){_0x59626b=_0x59626b-0x0;var _0x5ebcbe=_0x94c6[_0x59626b];return _0x5ebcbe;};'use strict';var _=require(_0x694c('0x0'));var util=require(_0x694c('0x1'));var logger=require(_0x694c('0x2'))(_0x694c('0x3'));var moment=require('moment');var BPromise=require(_0x694c('0x4'));var rp=require(_0x694c('0x5'));var fs=require('fs');var path=require(_0x694c('0x6'));var rimraf=require(_0x694c('0x7'));var config=require(_0x694c('0x8'));var attributes=require(_0x694c('0x9'));var integrations=require(_0x694c('0xa'));module[_0x694c('0xb')]=function(_0x2caa7d,_0x3ec8f7){return _0x2caa7d[_0x694c('0xc')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5cab05,_0x4add61,_0x660a4){if(_0x5cab05['changed']('zone')||_0x5cab05[_0x694c('0xd')](_0x694c('0xe'))||_0x5cab05[_0x694c('0xd')]('clientId')||_0x5cab05[_0x694c('0xd')](_0x694c('0xf'))||_0x5cab05[_0x694c('0xd')](_0x694c('0x10'))||_0x5cab05[_0x694c('0xd')](_0x694c('0x11'))){var _0x4c0515,_0x9ba37d;_0x4c0515=_0x5cab05[_0x694c('0xe')];var _0x3d1356=_0x4c0515[_0x694c('0x12')](-0x1);if(_0x3d1356==='/'||_0x3d1356==='\x5c'||_0x3d1356===':'){_0x4c0515=_0x4c0515[_0x694c('0x13')](0x0,_0x4c0515[_0x694c('0x14')](_0x3d1356));}switch(_0x5cab05[_0x694c('0x15')]){case'US':_0x9ba37d=_0x694c('0x16');break;case'AU':_0x9ba37d='https://accounts.zoho.com.au';break;case'IN':_0x9ba37d=_0x694c('0x17');break;case'CN':_0x9ba37d=_0x694c('0x18');break;default:_0x9ba37d=_0x694c('0x19');break;}var _0x58dd60={'method':_0x694c('0x1a'),'uri':_0x9ba37d+_0x694c('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x5cab05[_0x694c('0x1c')],'client_secret':_0x5cab05[_0x694c('0xf')],'redirect_uri':_0x5cab05[_0x694c('0xe')],'code':_0x5cab05['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x58dd60)[_0x694c('0x1d')](function(_0x3a935b){var _0x3faf53=JSON[_0x694c('0x1e')](_0x3a935b);if(_0x3faf53[_0x694c('0x1f')]){_0x5cab05['refreshToken']=_0x3faf53[_0x694c('0x1f')];logger['info'](util[_0x694c('0x20')](_0x694c('0x21'),_0x5cab05['name'],_0x5cab05['id']));}else{logger[_0x694c('0x22')](util[_0x694c('0x20')](_0x694c('0x23'),_0x5cab05[_0x694c('0x24')],_0x5cab05['id']),util[_0x694c('0x25')](_0x3faf53,{'showHidden':![],'depth':null}));}return _0x660a4(null,_0x4add61);})[_0x694c('0x26')](function(_0x123534){logger[_0x694c('0x22')](util[_0x694c('0x20')](_0x694c('0x23'),_0x5cab05['name'],_0x5cab05['id']),util[_0x694c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x660a4(_0x123534);});}else{return _0x660a4(null,_0x4add61);}},'beforeUpdate':function(_0x12d063,_0x2686ac,_0x39b182){if(_0x12d063[_0x694c('0xd')](_0x694c('0x15'))||_0x12d063[_0x694c('0xd')](_0x694c('0xe'))||_0x12d063[_0x694c('0xd')](_0x694c('0x1c'))||_0x12d063[_0x694c('0xd')](_0x694c('0xf'))||_0x12d063[_0x694c('0xd')](_0x694c('0x10'))||_0x12d063['changed'](_0x694c('0x11'))){var _0x3568bb,_0x2f8c0b;_0x3568bb=_0x12d063[_0x694c('0xe')];var _0x337e35=_0x3568bb[_0x694c('0x12')](-0x1);if(_0x337e35==='/'||_0x337e35==='\x5c'||_0x337e35===':'){_0x3568bb=_0x3568bb[_0x694c('0x13')](0x0,_0x3568bb[_0x694c('0x14')](_0x337e35));}switch(_0x12d063[_0x694c('0x15')]){case'US':_0x2f8c0b=_0x694c('0x16');break;case'AU':_0x2f8c0b=_0x694c('0x27');break;case'IN':_0x2f8c0b=_0x694c('0x17');break;case'CN':_0x2f8c0b=_0x694c('0x18');break;default:_0x2f8c0b=_0x694c('0x19');break;}var _0x24ccc0={'method':'POST','uri':_0x2f8c0b+'/oauth/v2/token','form':{'grant_type':_0x694c('0x28'),'client_id':_0x12d063[_0x694c('0x1c')],'client_secret':_0x12d063['clientSecret'],'redirect_uri':_0x12d063[_0x694c('0xe')],'code':_0x12d063[_0x694c('0x10')]},'headers':{'Content-Type':_0x694c('0x29')}};return rp(_0x24ccc0)['then'](function(_0x54dcfe){var _0x56c403=JSON[_0x694c('0x1e')](_0x54dcfe);if(_0x56c403['refresh_token']){_0x12d063[_0x694c('0x2a')]=_0x56c403[_0x694c('0x1f')];logger[_0x694c('0x2b')](util[_0x694c('0x20')](_0x694c('0x21'),_0x12d063[_0x694c('0x24')],_0x12d063['id']));}else{logger[_0x694c('0x22')](util['format'](_0x694c('0x23'),_0x12d063[_0x694c('0x24')],_0x12d063['id']),util[_0x694c('0x25')](_0x56c403,{'showHidden':![],'depth':null}));}return _0x39b182(null,_0x2686ac);})[_0x694c('0x26')](function(_0x1d6f8a){logger[_0x694c('0x22')](util[_0x694c('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x12d063[_0x694c('0x24')],_0x12d063['id']),util[_0x694c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x39b182(_0x1d6f8a);});}else{return _0x39b182(null,_0x2686ac);}}}});}; \ No newline at end of file +var _0x1d5a=['refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','substring','lastIndexOf','then','parse','refreshToken','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded'];(function(_0x4adb03,_0x12ec1c){var _0x13b13f=function(_0xe322b1){while(--_0xe322b1){_0x4adb03['push'](_0x4adb03['shift']());}};_0x13b13f(++_0x12ec1c);}(_0x1d5a,0xbb));var _0xa1d5=function(_0x54720e,_0x149ad2){_0x54720e=_0x54720e-0x0;var _0x191db6=_0x1d5a[_0x54720e];return _0x191db6;};'use strict';var _=require(_0xa1d5('0x0'));var util=require('util');var logger=require(_0xa1d5('0x1'))('api');var moment=require(_0xa1d5('0x2'));var BPromise=require(_0xa1d5('0x3'));var rp=require(_0xa1d5('0x4'));var fs=require('fs');var path=require(_0xa1d5('0x5'));var rimraf=require(_0xa1d5('0x6'));var config=require('../../config/environment');var attributes=require(_0xa1d5('0x7'));var integrations=require(_0xa1d5('0x8'));module[_0xa1d5('0x9')]=function(_0x5a707a,_0x2e0337){return _0x5a707a[_0xa1d5('0xa')](_0xa1d5('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1444d1,_0x110bd4,_0x53fc21){if(_0x1444d1[_0xa1d5('0xc')](_0xa1d5('0xd'))||_0x1444d1[_0xa1d5('0xc')](_0xa1d5('0xe'))||_0x1444d1[_0xa1d5('0xc')](_0xa1d5('0xf'))||_0x1444d1['changed'](_0xa1d5('0x10'))||_0x1444d1['changed']('code')||_0x1444d1[_0xa1d5('0xc')]('host')){var _0x4de814,_0x28dd16;_0x4de814=_0x1444d1[_0xa1d5('0xe')];var _0x28df2a=_0x4de814[_0xa1d5('0x11')](-0x1);if(_0x28df2a==='/'||_0x28df2a==='\x5c'||_0x28df2a===':'){_0x4de814=_0x4de814['substring'](0x0,_0x4de814['lastIndexOf'](_0x28df2a));}switch(_0x1444d1[_0xa1d5('0xd')]){case'US':_0x28dd16=_0xa1d5('0x12');break;case'AU':_0x28dd16=_0xa1d5('0x13');break;case'IN':_0x28dd16=_0xa1d5('0x14');break;case'CN':_0x28dd16=_0xa1d5('0x15');break;default:_0x28dd16=_0xa1d5('0x16');break;}var _0x168458={'method':_0xa1d5('0x17'),'uri':_0x28dd16+_0xa1d5('0x18'),'form':{'grant_type':_0xa1d5('0x19'),'client_id':_0x1444d1['clientId'],'client_secret':_0x1444d1[_0xa1d5('0x10')],'redirect_uri':_0x1444d1['serverUrl'],'code':_0x1444d1[_0xa1d5('0x1a')]},'headers':{'Content-Type':_0xa1d5('0x1b')}};return rp(_0x168458)['then'](function(_0x5d81af){var _0x15a353=JSON['parse'](_0x5d81af);if(_0x15a353[_0xa1d5('0x1c')]){_0x1444d1['refreshToken']=_0x15a353[_0xa1d5('0x1c')];logger[_0xa1d5('0x1d')](util[_0xa1d5('0x1e')](_0xa1d5('0x1f'),_0x1444d1['name'],_0x1444d1['id']));}else{logger[_0xa1d5('0x20')](util[_0xa1d5('0x1e')](_0xa1d5('0x21'),_0x1444d1[_0xa1d5('0x22')],_0x1444d1['id']),util[_0xa1d5('0x23')](_0x15a353,{'showHidden':![],'depth':null}));}return _0x53fc21(null,_0x110bd4);})[_0xa1d5('0x24')](function(_0x28c8b6){logger[_0xa1d5('0x20')](util[_0xa1d5('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1444d1[_0xa1d5('0x22')],_0x1444d1['id']),util[_0xa1d5('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x53fc21(_0x28c8b6);});}else{return _0x53fc21(null,_0x110bd4);}},'beforeUpdate':function(_0x1b5c73,_0x23c92b,_0x207f67){if(_0x1b5c73[_0xa1d5('0xc')]('zone')||_0x1b5c73[_0xa1d5('0xc')]('serverUrl')||_0x1b5c73[_0xa1d5('0xc')](_0xa1d5('0xf'))||_0x1b5c73[_0xa1d5('0xc')](_0xa1d5('0x10'))||_0x1b5c73[_0xa1d5('0xc')](_0xa1d5('0x1a'))||_0x1b5c73[_0xa1d5('0xc')](_0xa1d5('0x25'))){var _0x2396ac,_0x1a4cb9;_0x2396ac=_0x1b5c73[_0xa1d5('0xe')];var _0x4ad30d=_0x2396ac[_0xa1d5('0x11')](-0x1);if(_0x4ad30d==='/'||_0x4ad30d==='\x5c'||_0x4ad30d===':'){_0x2396ac=_0x2396ac[_0xa1d5('0x26')](0x0,_0x2396ac[_0xa1d5('0x27')](_0x4ad30d));}switch(_0x1b5c73['zone']){case'US':_0x1a4cb9='https://accounts.zoho.com';break;case'AU':_0x1a4cb9=_0xa1d5('0x13');break;case'IN':_0x1a4cb9=_0xa1d5('0x14');break;case'CN':_0x1a4cb9=_0xa1d5('0x15');break;default:_0x1a4cb9=_0xa1d5('0x16');break;}var _0x38cf25={'method':_0xa1d5('0x17'),'uri':_0x1a4cb9+_0xa1d5('0x18'),'form':{'grant_type':_0xa1d5('0x19'),'client_id':_0x1b5c73[_0xa1d5('0xf')],'client_secret':_0x1b5c73[_0xa1d5('0x10')],'redirect_uri':_0x1b5c73[_0xa1d5('0xe')],'code':_0x1b5c73[_0xa1d5('0x1a')]},'headers':{'Content-Type':_0xa1d5('0x1b')}};return rp(_0x38cf25)[_0xa1d5('0x28')](function(_0x1a93ad){var _0x1fbf48=JSON[_0xa1d5('0x29')](_0x1a93ad);if(_0x1fbf48[_0xa1d5('0x1c')]){_0x1b5c73[_0xa1d5('0x2a')]=_0x1fbf48[_0xa1d5('0x1c')];logger['info'](util[_0xa1d5('0x1e')](_0xa1d5('0x1f'),_0x1b5c73[_0xa1d5('0x22')],_0x1b5c73['id']));}else{logger[_0xa1d5('0x20')](util[_0xa1d5('0x1e')](_0xa1d5('0x21'),_0x1b5c73['name'],_0x1b5c73['id']),util[_0xa1d5('0x23')](_0x1fbf48,{'showHidden':![],'depth':null}));}return _0x207f67(null,_0x23c92b);})['catch'](function(_0x2b545d){logger['error'](util[_0xa1d5('0x1e')](_0xa1d5('0x21'),_0x1b5c73[_0xa1d5('0x22')],_0x1b5c73['id']),util[_0xa1d5('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x207f67(_0x2b545d);});}else{return _0x207f67(null,_0x23c92b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 22aa303..28b4a17 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 _0xaac4=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','find','ShowZohoAccount'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xaac4,0x6c));var _0x4aac=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xaac4[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var moment=require('moment');var BPromise=require(_0x4aac('0x2'));var rs=require(_0x4aac('0x3'));var fs=require('fs');var Redis=require(_0x4aac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aac('0x5'));var logger=require(_0x4aac('0x6'))(_0x4aac('0x7'));var config=require(_0x4aac('0x8'));var jayson=require(_0x4aac('0x9'));var client=jayson['client'][_0x4aac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x688327,_0x625c38,_0x4a901c){return new BPromise(function(_0x645ec6,_0x59735a){return client[_0x4aac('0xb')](_0x688327,_0x4a901c)[_0x4aac('0xc')](function(_0x239771){logger[_0x4aac('0xd')](_0x4aac('0xe'),_0x625c38,'request\x20sent');logger[_0x4aac('0xf')](_0x4aac('0x10'),_0x625c38,_0x4aac('0x11'),JSON[_0x4aac('0x12')](_0x239771));if(_0x239771['error']){if(_0x239771[_0x4aac('0x13')][_0x4aac('0x14')]===0x1f4){logger[_0x4aac('0x13')](_0x4aac('0xe'),_0x625c38,_0x239771[_0x4aac('0x13')][_0x4aac('0x15')]);return _0x59735a(_0x239771[_0x4aac('0x13')]['message']);}logger[_0x4aac('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x625c38,_0x239771[_0x4aac('0x13')]['message']);return _0x645ec6(_0x239771[_0x4aac('0x13')]['message']);}else{logger[_0x4aac('0xd')](_0x4aac('0xe'),_0x625c38,_0x4aac('0x11'));_0x645ec6(_0x239771['result'][_0x4aac('0x15')]);}})[_0x4aac('0x16')](function(_0x4ff7c6){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x625c38,_0x4ff7c6);_0x59735a(_0x4ff7c6);});});}exports['GetZohoAccount']=function(_0x1539fb){var _0x20353f=this;return new Promise(function(_0x44d2a1,_0x53ee28){return db[_0x4aac('0x17')][_0x4aac('0x18')]({'raw':_0x1539fb[_0x4aac('0x19')]?_0x1539fb[_0x4aac('0x19')][_0x4aac('0x1a')]===undefined?!![]:![]:!![],'where':_0x1539fb[_0x4aac('0x19')]?_0x1539fb[_0x4aac('0x19')][_0x4aac('0x1b')]||null:null,'attributes':_0x1539fb[_0x4aac('0x19')]?_0x1539fb[_0x4aac('0x19')][_0x4aac('0x1c')]||null:null,'limit':_0x1539fb['options']?_0x1539fb[_0x4aac('0x19')][_0x4aac('0x1d')]||null:null,'include':_0x1539fb['options']?_0x1539fb[_0x4aac('0x19')]['include']?_[_0x4aac('0x1e')](_0x1539fb[_0x4aac('0x19')][_0x4aac('0x1f')],function(_0x3d4836){return{'model':db[_0x3d4836[_0x4aac('0x20')]],'as':_0x3d4836['as'],'attributes':_0x3d4836[_0x4aac('0x1c')],'include':_0x3d4836[_0x4aac('0x1f')]?_['map'](_0x3d4836[_0x4aac('0x1f')],function(_0x279c10){return{'model':db[_0x279c10[_0x4aac('0x20')]],'as':_0x279c10['as'],'attributes':_0x279c10['attributes'],'include':_0x279c10[_0x4aac('0x1f')]?_[_0x4aac('0x1e')](_0x279c10[_0x4aac('0x1f')],function(_0x18bafe){return{'model':db[_0x18bafe[_0x4aac('0x20')]],'as':_0x18bafe['as'],'attributes':_0x18bafe['attributes']};}):[]};}):[]};}):[]:[]})[_0x4aac('0xc')](function(_0x576694){logger['info'](_0x4aac('0x21'),_0x1539fb);logger[_0x4aac('0xf')](_0x4aac('0x21'),_0x1539fb,JSON[_0x4aac('0x12')](_0x576694));_0x44d2a1(_0x576694);})[_0x4aac('0x16')](function(_0x5133b8){logger[_0x4aac('0x13')](_0x4aac('0x21'),_0x5133b8['message'],_0x1539fb);_0x53ee28(_0x20353f[_0x4aac('0x13')](0x1f4,_0x5133b8[_0x4aac('0x15')]));});});};exports['ShowZohoAccount']=function(_0x26c648){var _0x4fbca0=this;return new Promise(function(_0x48d81b,_0xbe4939){return db[_0x4aac('0x17')][_0x4aac('0x22')]({'raw':_0x26c648['options']?_0x26c648[_0x4aac('0x19')][_0x4aac('0x1a')]===undefined?!![]:![]:!![],'where':_0x26c648[_0x4aac('0x19')]?_0x26c648[_0x4aac('0x19')][_0x4aac('0x1b')]||null:null,'attributes':_0x26c648['options']?_0x26c648[_0x4aac('0x19')][_0x4aac('0x1c')]||null:null,'include':_0x26c648[_0x4aac('0x19')]?_0x26c648[_0x4aac('0x19')]['include']?_[_0x4aac('0x1e')](_0x26c648[_0x4aac('0x19')]['include'],function(_0x250e1f){return{'model':db[_0x250e1f[_0x4aac('0x20')]],'as':_0x250e1f['as'],'attributes':_0x250e1f['attributes'],'include':_0x250e1f[_0x4aac('0x1f')]?_[_0x4aac('0x1e')](_0x250e1f[_0x4aac('0x1f')],function(_0x522e1a){return{'model':db[_0x522e1a['model']],'as':_0x522e1a['as'],'attributes':_0x522e1a[_0x4aac('0x1c')],'include':_0x522e1a[_0x4aac('0x1f')]?_['map'](_0x522e1a[_0x4aac('0x1f')],function(_0x40cf49){return{'model':db[_0x40cf49['model']],'as':_0x40cf49['as'],'attributes':_0x40cf49[_0x4aac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4aac('0xc')](function(_0x168e6a){logger[_0x4aac('0xd')](_0x4aac('0x23'),_0x26c648);logger[_0x4aac('0xf')](_0x4aac('0x23'),_0x26c648,JSON[_0x4aac('0x12')](_0x168e6a));_0x48d81b(_0x168e6a);})[_0x4aac('0x16')](function(_0x51d12f){logger[_0x4aac('0x13')](_0x4aac('0x23'),_0x51d12f[_0x4aac('0x15')],_0x26c648);_0xbe4939(_0x4fbca0['error'](0x1f4,_0x51d12f[_0x4aac('0x15')]));});});}; \ No newline at end of file +var _0xd142=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','options','where','attributes','limit','include','map','model','GetZohoAccount','stringify','ShowZohoAccount','ZohoAccount','find','raw','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x54b20b,_0x5be09a){var _0x33a180=function(_0x47d47b){while(--_0x47d47b){_0x54b20b['push'](_0x54b20b['shift']());}};_0x33a180(++_0x5be09a);}(_0xd142,0x11a));var _0x2d14=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0xd142[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0x2d14('0x0'));var util=require(_0x2d14('0x1'));var moment=require(_0x2d14('0x2'));var BPromise=require(_0x2d14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d14('0x4'))['db'];var utils=require(_0x2d14('0x5'));var logger=require(_0x2d14('0x6'))(_0x2d14('0x7'));var config=require(_0x2d14('0x8'));var jayson=require(_0x2d14('0x9'));var client=jayson[_0x2d14('0xa')][_0x2d14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eb081,_0x2104d6,_0xba6306){return new BPromise(function(_0x1b2d92,_0x4e5f73){return client[_0x2d14('0xc')](_0x5eb081,_0xba6306)[_0x2d14('0xd')](function(_0x581f76){logger[_0x2d14('0xe')](_0x2d14('0xf'),_0x2104d6,_0x2d14('0x10'));logger['debug'](_0x2d14('0x11'),_0x2104d6,_0x2d14('0x10'),JSON['stringify'](_0x581f76));if(_0x581f76['error']){if(_0x581f76[_0x2d14('0x12')][_0x2d14('0x13')]===0x1f4){logger[_0x2d14('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x2104d6,_0x581f76[_0x2d14('0x12')][_0x2d14('0x14')]);return _0x4e5f73(_0x581f76[_0x2d14('0x12')][_0x2d14('0x14')]);}logger['error'](_0x2d14('0xf'),_0x2104d6,_0x581f76[_0x2d14('0x12')]['message']);return _0x1b2d92(_0x581f76[_0x2d14('0x12')][_0x2d14('0x14')]);}else{logger[_0x2d14('0xe')](_0x2d14('0xf'),_0x2104d6,_0x2d14('0x10'));_0x1b2d92(_0x581f76['result'][_0x2d14('0x14')]);}})[_0x2d14('0x15')](function(_0x3e12d3){logger[_0x2d14('0x12')](_0x2d14('0xf'),_0x2104d6,_0x3e12d3);_0x4e5f73(_0x3e12d3);});});}exports['GetZohoAccount']=function(_0x427c26){var _0x45f5c9=this;return new Promise(function(_0x449b73,_0x2d0d72){return db['ZohoAccount']['findAll']({'raw':_0x427c26[_0x2d14('0x16')]?_0x427c26['options']['raw']===undefined?!![]:![]:!![],'where':_0x427c26[_0x2d14('0x16')]?_0x427c26[_0x2d14('0x16')][_0x2d14('0x17')]||null:null,'attributes':_0x427c26['options']?_0x427c26[_0x2d14('0x16')][_0x2d14('0x18')]||null:null,'limit':_0x427c26['options']?_0x427c26[_0x2d14('0x16')][_0x2d14('0x19')]||null:null,'include':_0x427c26['options']?_0x427c26[_0x2d14('0x16')][_0x2d14('0x1a')]?_[_0x2d14('0x1b')](_0x427c26[_0x2d14('0x16')][_0x2d14('0x1a')],function(_0x5ecbc0){return{'model':db[_0x5ecbc0[_0x2d14('0x1c')]],'as':_0x5ecbc0['as'],'attributes':_0x5ecbc0['attributes'],'include':_0x5ecbc0[_0x2d14('0x1a')]?_['map'](_0x5ecbc0['include'],function(_0x2af2cf){return{'model':db[_0x2af2cf[_0x2d14('0x1c')]],'as':_0x2af2cf['as'],'attributes':_0x2af2cf[_0x2d14('0x18')],'include':_0x2af2cf[_0x2d14('0x1a')]?_['map'](_0x2af2cf[_0x2d14('0x1a')],function(_0x376b71){return{'model':db[_0x376b71['model']],'as':_0x376b71['as'],'attributes':_0x376b71[_0x2d14('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2d14('0xd')](function(_0x572720){logger[_0x2d14('0xe')](_0x2d14('0x1d'),_0x427c26);logger['debug'](_0x2d14('0x1d'),_0x427c26,JSON[_0x2d14('0x1e')](_0x572720));_0x449b73(_0x572720);})[_0x2d14('0x15')](function(_0x250c6c){logger[_0x2d14('0x12')](_0x2d14('0x1d'),_0x250c6c[_0x2d14('0x14')],_0x427c26);_0x2d0d72(_0x45f5c9[_0x2d14('0x12')](0x1f4,_0x250c6c['message']));});});};exports[_0x2d14('0x1f')]=function(_0x1415dd){var _0x1a086a=this;return new Promise(function(_0x1da82a,_0x55ccb5){return db[_0x2d14('0x20')][_0x2d14('0x21')]({'raw':_0x1415dd[_0x2d14('0x16')]?_0x1415dd['options'][_0x2d14('0x22')]===undefined?!![]:![]:!![],'where':_0x1415dd[_0x2d14('0x16')]?_0x1415dd[_0x2d14('0x16')][_0x2d14('0x17')]||null:null,'attributes':_0x1415dd[_0x2d14('0x16')]?_0x1415dd[_0x2d14('0x16')][_0x2d14('0x18')]||null:null,'include':_0x1415dd[_0x2d14('0x16')]?_0x1415dd['options'][_0x2d14('0x1a')]?_[_0x2d14('0x1b')](_0x1415dd[_0x2d14('0x16')][_0x2d14('0x1a')],function(_0x85dd6e){return{'model':db[_0x85dd6e['model']],'as':_0x85dd6e['as'],'attributes':_0x85dd6e[_0x2d14('0x18')],'include':_0x85dd6e[_0x2d14('0x1a')]?_[_0x2d14('0x1b')](_0x85dd6e[_0x2d14('0x1a')],function(_0x21347c){return{'model':db[_0x21347c['model']],'as':_0x21347c['as'],'attributes':_0x21347c[_0x2d14('0x18')],'include':_0x21347c[_0x2d14('0x1a')]?_[_0x2d14('0x1b')](_0x21347c[_0x2d14('0x1a')],function(_0x46b8be){return{'model':db[_0x46b8be[_0x2d14('0x1c')]],'as':_0x46b8be['as'],'attributes':_0x46b8be['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d14('0xd')](function(_0x4f5712){logger[_0x2d14('0xe')](_0x2d14('0x1f'),_0x1415dd);logger[_0x2d14('0x23')](_0x2d14('0x1f'),_0x1415dd,JSON[_0x2d14('0x1e')](_0x4f5712));_0x1da82a(_0x4f5712);})[_0x2d14('0x15')](function(_0xa747a7){logger['error'](_0x2d14('0x1f'),_0xa747a7[_0x2d14('0x14')],_0x1415dd);_0x55ccb5(_0x1a086a[_0x2d14('0x12')](0x1f4,_0xa747a7[_0x2d14('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7273b99..4422fea 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 _0x954e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','path','connect-timeout'];(function(_0x5eaa8a,_0x396d27){var _0x558bc8=function(_0x38e99d){while(--_0x38e99d){_0x5eaa8a['push'](_0x5eaa8a['shift']());}};_0x558bc8(++_0x396d27);}(_0x954e,0x174));var _0xe954=function(_0x2cab12,_0x58f8a3){_0x2cab12=_0x2cab12-0x0;var _0x220f47=_0x954e[_0x2cab12];return _0x220f47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe954('0x0'));var timeout=require(_0xe954('0x1'));var express=require('express');var router=express[_0xe954('0x2')]();var fs_extra=require(_0xe954('0x3'));var auth=require(_0xe954('0x4'));var interaction=require(_0xe954('0x5'));var config=require(_0xe954('0x6'));var controller=require(_0xe954('0x7'));router[_0xe954('0x8')]('/',auth[_0xe954('0x9')](),controller['index']);router[_0xe954('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe954('0xa')]);router[_0xe954('0x8')](_0xe954('0xb'),auth[_0xe954('0x9')](),controller[_0xe954('0xc')]);router[_0xe954('0x8')](_0xe954('0xd'),auth[_0xe954('0x9')](),controller['getSubjects']);router[_0xe954('0x8')](_0xe954('0xe'),auth[_0xe954('0x9')](),controller[_0xe954('0xf')]);router[_0xe954('0x10')]('/',auth[_0xe954('0x9')](),controller[_0xe954('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe954('0x12')]);router[_0xe954('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe954('0x14')]);module[_0xe954('0x15')]=router; \ No newline at end of file +var _0x6d74=['update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id'];(function(_0x2aeffd,_0x5e0ce5){var _0x5ae8bb=function(_0x1b7648){while(--_0x1b7648){_0x2aeffd['push'](_0x2aeffd['shift']());}};_0x5ae8bb(++_0x5e0ce5);}(_0x6d74,0xe0));var _0x46d7=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x6d74[_0x139a3c];return _0x2b375b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x46d7('0x0'));var timeout=require(_0x46d7('0x1'));var express=require('express');var router=express[_0x46d7('0x2')]();var fs_extra=require(_0x46d7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46d7('0x4'));var controller=require(_0x46d7('0x5'));router[_0x46d7('0x6')]('/',auth[_0x46d7('0x7')](),controller[_0x46d7('0x8')]);router[_0x46d7('0x6')]('/:id',auth[_0x46d7('0x7')](),controller['show']);router[_0x46d7('0x6')]('/:id/fields',auth[_0x46d7('0x7')](),controller[_0x46d7('0x9')]);router[_0x46d7('0x6')](_0x46d7('0xa'),auth[_0x46d7('0x7')](),controller[_0x46d7('0xb')]);router[_0x46d7('0x6')](_0x46d7('0xc'),auth[_0x46d7('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x46d7('0x7')](),controller[_0x46d7('0xd')]);router[_0x46d7('0xe')](_0x46d7('0xf'),auth[_0x46d7('0x7')](),controller[_0x46d7('0x10')]);router[_0x46d7('0x11')](_0x46d7('0xf'),auth['isAuthenticated'](),controller[_0x46d7('0x12')]);module[_0x46d7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 2e7fb1f..8567f48 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 _0x97a7=['contact','STRING','sequelize','exports','ENUM','lead','nothing','contact_lead'];(function(_0x2d28bd,_0x59bf94){var _0x343fac=function(_0xc76563){while(--_0xc76563){_0x2d28bd['push'](_0x2d28bd['shift']());}};_0x343fac(++_0x59bf94);}(_0x97a7,0x16a));var _0x797a=function(_0x158086,_0x4a110d){_0x158086=_0x158086-0x0;var _0x40f675=_0x97a7[_0x158086];return _0x40f675;};'use strict';var Sequelize=require(_0x797a('0x0'));module[_0x797a('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x797a('0x2')](_0x797a('0x3'),'contact',_0x797a('0x4')),'defaultValue':_0x797a('0x3')},'moduleSearch':{'type':Sequelize[_0x797a('0x2')](_0x797a('0x5'),_0x797a('0x6'),_0x797a('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x797a('0x7')]}}; \ No newline at end of file +var _0x7bfa=['sequelize','ENUM','lead','nothing','contact_lead','contact','STRING'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x7bfa,0x173));var _0xa7bf=function(_0x45afc1,_0x52a029){_0x45afc1=_0x45afc1-0x0;var _0x182539=_0x7bfa[_0x45afc1];return _0x182539;};'use strict';var Sequelize=require(_0xa7bf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xa7bf('0x1')](_0xa7bf('0x2'),'contact',_0xa7bf('0x3')),'defaultValue':_0xa7bf('0x2')},'moduleSearch':{'type':Sequelize[_0xa7bf('0x1')](_0xa7bf('0x4'),_0xa7bf('0x5'),_0xa7bf('0x2')),'defaultValue':_0xa7bf('0x4')},'description':{'type':Sequelize[_0xa7bf('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3acb515..3f692a1 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 _0xb2fb=['filters','filter','merge','VIRTUAL','options','rows','catch','show','rawAttributes','attributes','includeAll','find','create','body','update','params','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','ZohoConfiguration','fieldName','type','key','model','map','query','keys','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x531f28,_0xa34600){var _0x3bf87d=function(_0x10c3f0){while(--_0x10c3f0){_0x531f28['push'](_0x531f28['shift']());}};_0x3bf87d(++_0xa34600);}(_0xb2fb,0x152));var _0xbb2f=function(_0x36a20a,_0x2b5c85){_0x36a20a=_0x36a20a-0x0;var _0x27841e=_0xb2fb[_0x36a20a];return _0x27841e;};'use strict';var emlformat=require(_0xbb2f('0x0'));var rimraf=require(_0xbb2f('0x1'));var zipdir=require(_0xbb2f('0x2'));var jsonpatch=require(_0xbb2f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbb2f('0x4'));var Mustache=require('mustache');var util=require(_0xbb2f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbb2f('0x6'));var ejs=require(_0xbb2f('0x7'));var fs=require('fs');var fs_extra=require(_0xbb2f('0x8'));var _=require(_0xbb2f('0x9'));var squel=require('squel');var crypto=require(_0xbb2f('0xa'));var jsforce=require(_0xbb2f('0xb'));var deskjs=require(_0xbb2f('0xc'));var toCsv=require(_0xbb2f('0x6'));var querystring=require(_0xbb2f('0xd'));var Papa=require(_0xbb2f('0xe'));var Redis=require(_0xbb2f('0xf'));var authService=require(_0xbb2f('0x10'));var qs=require(_0xbb2f('0x11'));var as=require(_0xbb2f('0x12'));var hardwareService=require(_0xbb2f('0x13'));var logger=require(_0xbb2f('0x14'))('api');var utils=require(_0xbb2f('0x15'));var config=require(_0xbb2f('0x16'));var licenseUtil=require(_0xbb2f('0x17'));var db=require(_0xbb2f('0x18'))['db'];function respondWithStatusCode(_0x51e0aa,_0x992f21){_0x992f21=_0x992f21||0xcc;return function(_0xddca8b){if(_0xddca8b){return _0x51e0aa[_0xbb2f('0x19')](_0x992f21);}return _0x51e0aa[_0xbb2f('0x1a')](_0x992f21)[_0xbb2f('0x1b')]();};}function respondWithResult(_0xebcdb9,_0x3ac15b){_0x3ac15b=_0x3ac15b||0xc8;return function(_0x1a90e5){if(_0x1a90e5){return _0xebcdb9[_0xbb2f('0x1a')](_0x3ac15b)[_0xbb2f('0x1c')](_0x1a90e5);}};}function respondWithFilteredResult(_0x53c0fa,_0x40f3c6){return function(_0xdc96c4){if(_0xdc96c4){var _0x13bbb1=typeof _0x40f3c6[_0xbb2f('0x1d')]===_0xbb2f('0x1e')&&typeof _0x40f3c6[_0xbb2f('0x1f')]==='undefined';var _0x35c1d8=_0xdc96c4['count'];var _0x181228=_0x13bbb1?0x0:_0x40f3c6['offset'];var _0x29084a=_0x13bbb1?_0xdc96c4[_0xbb2f('0x20')]:_0x40f3c6['offset']+_0x40f3c6[_0xbb2f('0x1f')];var _0x4aa366;if(_0x29084a>=_0x35c1d8){_0x29084a=_0x35c1d8;_0x4aa366=0xc8;}else{_0x4aa366=0xce;}_0x53c0fa['status'](_0x4aa366);return _0x53c0fa[_0xbb2f('0x21')](_0xbb2f('0x22'),_0x181228+'-'+_0x29084a+'/'+_0x35c1d8)[_0xbb2f('0x1c')](_0xdc96c4);}return null;};}function patchUpdates(_0x426933){return function(_0xf0933e){try{jsonpatch['apply'](_0xf0933e,_0x426933,!![]);}catch(_0x41d7ab){return BPromise['reject'](_0x41d7ab);}return _0xf0933e[_0xbb2f('0x23')]();};}function saveUpdates(_0x3697ff,_0x53041b){return function(_0x2ee84a){if(_0x2ee84a){return _0x2ee84a['update'](_0x3697ff)[_0xbb2f('0x24')](function(_0x4bff42){return _0x4bff42;});}return null;};}function removeEntity(_0x136eae,_0x12cef7){return function(_0x6e0f4){if(_0x6e0f4){return _0x6e0f4[_0xbb2f('0x25')]()[_0xbb2f('0x24')](function(){_0x136eae[_0xbb2f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x534001,_0x3992df){return function(_0x7064e1){if(!_0x7064e1){_0x534001[_0xbb2f('0x19')](0x194);}return _0x7064e1;};}function handleError(_0x5d9091,_0x2a807d){_0x2a807d=_0x2a807d||0x1f4;return function(_0x37f606){logger[_0xbb2f('0x26')](_0x37f606[_0xbb2f('0x27')]);if(_0x37f606[_0xbb2f('0x28')]){delete _0x37f606[_0xbb2f('0x28')];}_0x5d9091[_0xbb2f('0x1a')](_0x2a807d)['send'](_0x37f606);};}exports['index']=function(_0x4c8278,_0x58deed){var _0xeac220={},_0xc44c45={},_0x1edad9={'count':0x0,'rows':[]};var _0x8337eb=_['map'](db[_0xbb2f('0x29')]['rawAttributes'],function(_0x53fbc7){return{'name':_0x53fbc7[_0xbb2f('0x2a')],'type':_0x53fbc7[_0xbb2f('0x2b')][_0xbb2f('0x2c')]};});_0xc44c45[_0xbb2f('0x2d')]=_[_0xbb2f('0x2e')](_0x8337eb,_0xbb2f('0x28'));_0xc44c45[_0xbb2f('0x2f')]=_[_0xbb2f('0x30')](_0x4c8278[_0xbb2f('0x2f')]);_0xc44c45['filters']=_[_0xbb2f('0x31')](_0xc44c45[_0xbb2f('0x2d')],_0xc44c45['query']);_0xeac220['attributes']=_['intersection'](_0xc44c45[_0xbb2f('0x2d')],qs['fields'](_0x4c8278[_0xbb2f('0x2f')][_0xbb2f('0x32')]));_0xeac220['attributes']=_0xeac220['attributes'][_0xbb2f('0x33')]?_0xeac220['attributes']:_0xc44c45[_0xbb2f('0x2d')];if(!_0x4c8278['query'][_0xbb2f('0x34')](_0xbb2f('0x35'))){_0xeac220[_0xbb2f('0x1f')]=qs[_0xbb2f('0x1f')](_0x4c8278[_0xbb2f('0x2f')][_0xbb2f('0x1f')]);_0xeac220['offset']=qs[_0xbb2f('0x1d')](_0x4c8278[_0xbb2f('0x2f')][_0xbb2f('0x1d')]);}_0xeac220[_0xbb2f('0x36')]=qs[_0xbb2f('0x37')](_0x4c8278[_0xbb2f('0x2f')][_0xbb2f('0x37')]);_0xeac220[_0xbb2f('0x38')]=qs[_0xbb2f('0x39')](_['pick'](_0x4c8278[_0xbb2f('0x2f')],_0xc44c45[_0xbb2f('0x39')]),_0x8337eb);if(_0x4c8278[_0xbb2f('0x2f')][_0xbb2f('0x3a')]){_0xeac220[_0xbb2f('0x38')]=_[_0xbb2f('0x3b')](_0xeac220['where'],{'$or':_[_0xbb2f('0x2e')](_0x8337eb,function(_0x41e21b){if(_0x41e21b[_0xbb2f('0x2b')]!==_0xbb2f('0x3c')){var _0x57804d={};_0x57804d[_0x41e21b[_0xbb2f('0x28')]]={'$like':'%'+_0x4c8278[_0xbb2f('0x2f')][_0xbb2f('0x3a')]+'%'};return _0x57804d;}})});}_0xeac220=_['merge']({},_0xeac220,_0x4c8278[_0xbb2f('0x3d')]);var _0x2b69aa={'where':_0xeac220[_0xbb2f('0x38')]};return db[_0xbb2f('0x29')][_0xbb2f('0x20')](_0x2b69aa)[_0xbb2f('0x24')](function(_0x4f44a9){_0x1edad9['count']=_0x4f44a9;if(_0x4c8278['query']['includeAll']){_0xeac220['include']=[{'all':!![]}];}return db[_0xbb2f('0x29')]['findAll'](_0xeac220);})[_0xbb2f('0x24')](function(_0x4b08fa){_0x1edad9[_0xbb2f('0x3e')]=_0x4b08fa;return _0x1edad9;})[_0xbb2f('0x24')](respondWithFilteredResult(_0x58deed,_0xeac220))[_0xbb2f('0x3f')](handleError(_0x58deed,null));};exports[_0xbb2f('0x40')]=function(_0x11cf38,_0x327399){var _0x58d95f={'raw':![],'where':{'id':_0x11cf38['params']['id']}},_0x46dbd1={};_0x46dbd1[_0xbb2f('0x2d')]=_[_0xbb2f('0x30')](db[_0xbb2f('0x29')][_0xbb2f('0x41')]);_0x46dbd1[_0xbb2f('0x2f')]=_[_0xbb2f('0x30')](_0x11cf38['query']);_0x46dbd1['filters']=_['intersection'](_0x46dbd1[_0xbb2f('0x2d')],_0x46dbd1[_0xbb2f('0x2f')]);_0x58d95f['attributes']=_['intersection'](_0x46dbd1[_0xbb2f('0x2d')],qs[_0xbb2f('0x32')](_0x11cf38['query'][_0xbb2f('0x32')]));_0x58d95f[_0xbb2f('0x42')]=_0x58d95f['attributes'][_0xbb2f('0x33')]?_0x58d95f[_0xbb2f('0x42')]:_0x46dbd1[_0xbb2f('0x2d')];if(_0x11cf38[_0xbb2f('0x2f')][_0xbb2f('0x43')]){_0x58d95f['include']=[{'all':!![]}];}_0x58d95f=_[_0xbb2f('0x3b')]({},_0x58d95f,_0x11cf38[_0xbb2f('0x3d')]);return db[_0xbb2f('0x29')][_0xbb2f('0x44')](_0x58d95f)[_0xbb2f('0x24')](handleEntityNotFound(_0x327399,null))['then'](respondWithResult(_0x327399,null))[_0xbb2f('0x3f')](handleError(_0x327399,null));};exports[_0xbb2f('0x45')]=function(_0x24a99e,_0x183be9){return db[_0xbb2f('0x29')]['create'](_0x24a99e[_0xbb2f('0x46')],{})['then'](respondWithResult(_0x183be9,0xc9))[_0xbb2f('0x3f')](handleError(_0x183be9,null));};exports[_0xbb2f('0x47')]=function(_0x5d676d,_0x1392ab){if(_0x5d676d[_0xbb2f('0x46')]['id']){delete _0x5d676d[_0xbb2f('0x46')]['id'];}return db[_0xbb2f('0x29')][_0xbb2f('0x44')]({'where':{'id':_0x5d676d[_0xbb2f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1392ab,null))[_0xbb2f('0x24')](saveUpdates(_0x5d676d[_0xbb2f('0x46')],null))[_0xbb2f('0x24')](respondWithResult(_0x1392ab,null))[_0xbb2f('0x3f')](handleError(_0x1392ab,null));};exports[_0xbb2f('0x25')]=function(_0x43afc8,_0x1bc68c){return db[_0xbb2f('0x29')][_0xbb2f('0x44')]({'where':{'id':_0x43afc8[_0xbb2f('0x48')]['id']}})[_0xbb2f('0x24')](handleEntityNotFound(_0x1bc68c,null))[_0xbb2f('0x24')](removeEntity(_0x1bc68c,null))[_0xbb2f('0x3f')](handleError(_0x1bc68c,null));};exports[_0xbb2f('0x49')]=function(_0x70ad0b,_0x30e6d9,_0xc7be24){var _0x4da7ad={};var _0x2f632b={};var _0x59a5a1;var _0x36b581;return db[_0xbb2f('0x29')][_0xbb2f('0x4a')]({'where':{'id':_0x70ad0b[_0xbb2f('0x48')]['id']}})[_0xbb2f('0x24')](handleEntityNotFound(_0x30e6d9,null))[_0xbb2f('0x24')](function(_0x546671){if(_0x546671){_0x59a5a1=_0x546671;_0x2f632b['model']=_[_0xbb2f('0x30')](db[_0xbb2f('0x4b')][_0xbb2f('0x41')]);_0x2f632b['query']=_[_0xbb2f('0x30')](_0x70ad0b[_0xbb2f('0x2f')]);_0x2f632b[_0xbb2f('0x39')]=_['intersection'](_0x2f632b[_0xbb2f('0x2d')],_0x2f632b[_0xbb2f('0x2f')]);_0x4da7ad[_0xbb2f('0x42')]=_[_0xbb2f('0x31')](_0x2f632b[_0xbb2f('0x2d')],qs[_0xbb2f('0x32')](_0x70ad0b[_0xbb2f('0x2f')][_0xbb2f('0x32')]));_0x4da7ad[_0xbb2f('0x42')]=_0x4da7ad['attributes'][_0xbb2f('0x33')]?_0x4da7ad[_0xbb2f('0x42')]:_0x2f632b[_0xbb2f('0x2d')];_0x4da7ad[_0xbb2f('0x36')]=qs['sort'](_0x70ad0b[_0xbb2f('0x2f')][_0xbb2f('0x37')]);_0x4da7ad[_0xbb2f('0x38')]=qs[_0xbb2f('0x39')](_[_0xbb2f('0x4c')](_0x70ad0b['query'],_0x2f632b[_0xbb2f('0x39')]));if(_0x70ad0b['query'][_0xbb2f('0x3a')]){_0x4da7ad[_0xbb2f('0x38')]=_[_0xbb2f('0x3b')](_0x4da7ad[_0xbb2f('0x38')],{'$or':_[_0xbb2f('0x2e')](_0x4da7ad[_0xbb2f('0x42')],function(_0x33c400){var _0x49068f={};_0x49068f[_0x33c400]={'$like':'%'+_0x70ad0b['query'][_0xbb2f('0x3a')]+'%'};return _0x49068f;})});}_0x4da7ad=_[_0xbb2f('0x3b')]({},_0x4da7ad,_0x70ad0b[_0xbb2f('0x3d')]);return _0x59a5a1[_0xbb2f('0x49')](_0x4da7ad);}})['then'](function(_0x273718){if(_0x273718){_0x36b581=_0x273718[_0xbb2f('0x33')];if(!_0x70ad0b[_0xbb2f('0x2f')][_0xbb2f('0x34')](_0xbb2f('0x35'))){_0x4da7ad[_0xbb2f('0x1f')]=qs[_0xbb2f('0x1f')](_0x70ad0b[_0xbb2f('0x2f')][_0xbb2f('0x1f')]);_0x4da7ad[_0xbb2f('0x1d')]=qs[_0xbb2f('0x1d')](_0x70ad0b[_0xbb2f('0x2f')][_0xbb2f('0x1d')]);}return _0x59a5a1[_0xbb2f('0x49')](_0x4da7ad);}})[_0xbb2f('0x24')](function(_0x560cfc){if(_0x560cfc){return _0x560cfc?{'count':_0x36b581,'rows':_0x560cfc}:null;}})['then'](respondWithResult(_0x30e6d9,null))[_0xbb2f('0x3f')](handleError(_0x30e6d9,null));};exports['getSubjects']=function(_0x166b34,_0x1316a1,_0x3be2ee){var _0x20fea3={};var _0x123889={};var _0x19bfbd;var _0x3912ce;return db['ZohoConfiguration'][_0xbb2f('0x4a')]({'where':{'id':_0x166b34[_0xbb2f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1316a1,null))[_0xbb2f('0x24')](function(_0x132af0){if(_0x132af0){_0x19bfbd=_0x132af0;_0x123889[_0xbb2f('0x2d')]=_[_0xbb2f('0x30')](db['ZohoField'][_0xbb2f('0x41')]);_0x123889[_0xbb2f('0x2f')]=_[_0xbb2f('0x30')](_0x166b34[_0xbb2f('0x2f')]);_0x123889[_0xbb2f('0x39')]=_['intersection'](_0x123889[_0xbb2f('0x2d')],_0x123889['query']);_0x20fea3[_0xbb2f('0x42')]=_[_0xbb2f('0x31')](_0x123889[_0xbb2f('0x2d')],qs[_0xbb2f('0x32')](_0x166b34[_0xbb2f('0x2f')][_0xbb2f('0x32')]));_0x20fea3[_0xbb2f('0x42')]=_0x20fea3[_0xbb2f('0x42')][_0xbb2f('0x33')]?_0x20fea3[_0xbb2f('0x42')]:_0x123889[_0xbb2f('0x2d')];_0x20fea3[_0xbb2f('0x36')]=qs[_0xbb2f('0x37')](_0x166b34[_0xbb2f('0x2f')][_0xbb2f('0x37')]);_0x20fea3[_0xbb2f('0x38')]=qs[_0xbb2f('0x39')](_['pick'](_0x166b34[_0xbb2f('0x2f')],_0x123889[_0xbb2f('0x39')]));if(_0x166b34[_0xbb2f('0x2f')][_0xbb2f('0x3a')]){_0x20fea3['where']=_[_0xbb2f('0x3b')](_0x20fea3[_0xbb2f('0x38')],{'$or':_[_0xbb2f('0x2e')](_0x20fea3[_0xbb2f('0x42')],function(_0x4f4231){var _0x53e022={};_0x53e022[_0x4f4231]={'$like':'%'+_0x166b34[_0xbb2f('0x2f')][_0xbb2f('0x3a')]+'%'};return _0x53e022;})});}_0x20fea3=_['merge']({},_0x20fea3,_0x166b34[_0xbb2f('0x3d')]);return _0x19bfbd['getSubjects'](_0x20fea3);}})[_0xbb2f('0x24')](function(_0x178f2a){if(_0x178f2a){_0x3912ce=_0x178f2a[_0xbb2f('0x33')];if(!_0x166b34['query']['hasOwnProperty']('nolimit')){_0x20fea3[_0xbb2f('0x1f')]=qs['limit'](_0x166b34['query'][_0xbb2f('0x1f')]);_0x20fea3[_0xbb2f('0x1d')]=qs[_0xbb2f('0x1d')](_0x166b34['query'][_0xbb2f('0x1d')]);}return _0x19bfbd[_0xbb2f('0x4d')](_0x20fea3);}})[_0xbb2f('0x24')](function(_0x43c18c){if(_0x43c18c){return _0x43c18c?{'count':_0x3912ce,'rows':_0x43c18c}:null;}})['then'](respondWithResult(_0x1316a1,null))[_0xbb2f('0x3f')](handleError(_0x1316a1,null));};exports[_0xbb2f('0x4e')]=function(_0x5d7182,_0x2de08d,_0xfe2bbc){var _0x41588d={};var _0xf26af8={};var _0x37f82a;var _0x5a9e19;return db[_0xbb2f('0x29')]['findOne']({'where':{'id':_0x5d7182[_0xbb2f('0x48')]['id']}})[_0xbb2f('0x24')](handleEntityNotFound(_0x2de08d,null))[_0xbb2f('0x24')](function(_0x4dff42){if(_0x4dff42){_0x37f82a=_0x4dff42;_0xf26af8[_0xbb2f('0x2d')]=_[_0xbb2f('0x30')](db[_0xbb2f('0x4b')][_0xbb2f('0x41')]);_0xf26af8[_0xbb2f('0x2f')]=_[_0xbb2f('0x30')](_0x5d7182[_0xbb2f('0x2f')]);_0xf26af8['filters']=_[_0xbb2f('0x31')](_0xf26af8[_0xbb2f('0x2d')],_0xf26af8[_0xbb2f('0x2f')]);_0x41588d[_0xbb2f('0x42')]=_[_0xbb2f('0x31')](_0xf26af8[_0xbb2f('0x2d')],qs[_0xbb2f('0x32')](_0x5d7182[_0xbb2f('0x2f')][_0xbb2f('0x32')]));_0x41588d['attributes']=_0x41588d[_0xbb2f('0x42')]['length']?_0x41588d[_0xbb2f('0x42')]:_0xf26af8[_0xbb2f('0x2d')];_0x41588d[_0xbb2f('0x36')]=qs[_0xbb2f('0x37')](_0x5d7182[_0xbb2f('0x2f')]['sort']);_0x41588d[_0xbb2f('0x38')]=qs['filters'](_[_0xbb2f('0x4c')](_0x5d7182['query'],_0xf26af8['filters']));if(_0x5d7182['query'][_0xbb2f('0x3a')]){_0x41588d[_0xbb2f('0x38')]=_[_0xbb2f('0x3b')](_0x41588d[_0xbb2f('0x38')],{'$or':_[_0xbb2f('0x2e')](_0x41588d['attributes'],function(_0x3cb7c1){var _0x3b1acb={};_0x3b1acb[_0x3cb7c1]={'$like':'%'+_0x5d7182[_0xbb2f('0x2f')][_0xbb2f('0x3a')]+'%'};return _0x3b1acb;})});}_0x41588d=_['merge']({},_0x41588d,_0x5d7182[_0xbb2f('0x3d')]);return _0x37f82a[_0xbb2f('0x4e')](_0x41588d);}})[_0xbb2f('0x24')](function(_0x5c6d0d){if(_0x5c6d0d){_0x5a9e19=_0x5c6d0d[_0xbb2f('0x33')];if(!_0x5d7182[_0xbb2f('0x2f')][_0xbb2f('0x34')]('nolimit')){_0x41588d[_0xbb2f('0x1f')]=qs[_0xbb2f('0x1f')](_0x5d7182[_0xbb2f('0x2f')]['limit']);_0x41588d['offset']=qs['offset'](_0x5d7182['query'][_0xbb2f('0x1d')]);}return _0x37f82a[_0xbb2f('0x4e')](_0x41588d);}})[_0xbb2f('0x24')](function(_0x2b5642){if(_0x2b5642){return _0x2b5642?{'count':_0x5a9e19,'rows':_0x2b5642}:null;}})['then'](respondWithResult(_0x2de08d,null))['catch'](handleError(_0x2de08d,null));}; \ No newline at end of file +var _0xa92f=['status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','map','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','rows','show','keys','merge','create','body','catch','find','params','getFields','findOne','order','getSubjects','ZohoField','getDescriptions','rimraf','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end'];(function(_0x236c67,_0x28b77e){var _0x19e4fb=function(_0x7cffa2){while(--_0x7cffa2){_0x236c67['push'](_0x236c67['shift']());}};_0x19e4fb(++_0x28b77e);}(_0xa92f,0x162));var _0xfa92=function(_0x48bdff,_0x4823d0){_0x48bdff=_0x48bdff-0x0;var _0x176ea4=_0xa92f[_0x48bdff];return _0x176ea4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa92('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa92('0x1'));var BPromise=require(_0xfa92('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa92('0x3'));var sox=require(_0xfa92('0x4'));var csv=require('to-csv');var ejs=require(_0xfa92('0x5'));var fs=require('fs');var fs_extra=require(_0xfa92('0x6'));var _=require(_0xfa92('0x7'));var squel=require(_0xfa92('0x8'));var crypto=require('crypto');var jsforce=require(_0xfa92('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xfa92('0xa'));var querystring=require(_0xfa92('0xb'));var Papa=require(_0xfa92('0xc'));var Redis=require('ioredis');var authService=require(_0xfa92('0xd'));var qs=require(_0xfa92('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa92('0xf'));var logger=require(_0xfa92('0x10'))(_0xfa92('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfa92('0x12'));var db=require(_0xfa92('0x13'))['db'];function respondWithStatusCode(_0x52696f,_0x28b47f){_0x28b47f=_0x28b47f||0xcc;return function(_0x56522a){if(_0x56522a){return _0x52696f['sendStatus'](_0x28b47f);}return _0x52696f['status'](_0x28b47f)[_0xfa92('0x14')]();};}function respondWithResult(_0x6616,_0x302d67){_0x302d67=_0x302d67||0xc8;return function(_0x2e2ce5){if(_0x2e2ce5){return _0x6616[_0xfa92('0x15')](_0x302d67)['json'](_0x2e2ce5);}};}function respondWithFilteredResult(_0x2aab82,_0x39c31f){return function(_0x23cf50){if(_0x23cf50){var _0x386cbf=typeof _0x39c31f['offset']===_0xfa92('0x16')&&typeof _0x39c31f[_0xfa92('0x17')]===_0xfa92('0x16');var _0x2b7827=_0x23cf50[_0xfa92('0x18')];var _0x4f99ce=_0x386cbf?0x0:_0x39c31f[_0xfa92('0x19')];var _0x27089f=_0x386cbf?_0x23cf50[_0xfa92('0x18')]:_0x39c31f[_0xfa92('0x19')]+_0x39c31f['limit'];var _0x1a1a01;if(_0x27089f>=_0x2b7827){_0x27089f=_0x2b7827;_0x1a1a01=0xc8;}else{_0x1a1a01=0xce;}_0x2aab82['status'](_0x1a1a01);return _0x2aab82[_0xfa92('0x1a')](_0xfa92('0x1b'),_0x4f99ce+'-'+_0x27089f+'/'+_0x2b7827)[_0xfa92('0x1c')](_0x23cf50);}return null;};}function patchUpdates(_0x4326ec){return function(_0x590a26){try{jsonpatch[_0xfa92('0x1d')](_0x590a26,_0x4326ec,!![]);}catch(_0x204c47){return BPromise['reject'](_0x204c47);}return _0x590a26[_0xfa92('0x1e')]();};}function saveUpdates(_0x4db8cd,_0x264e1b){return function(_0x278446){if(_0x278446){return _0x278446[_0xfa92('0x1f')](_0x4db8cd)[_0xfa92('0x20')](function(_0x234ef6){return _0x234ef6;});}return null;};}function removeEntity(_0x16599a,_0x40c14c){return function(_0x5994a0){if(_0x5994a0){return _0x5994a0[_0xfa92('0x21')]()[_0xfa92('0x20')](function(){_0x16599a[_0xfa92('0x15')](0xcc)[_0xfa92('0x14')]();});}};}function handleEntityNotFound(_0x1fd4cd,_0x464c43){return function(_0x4889e3){if(!_0x4889e3){_0x1fd4cd[_0xfa92('0x22')](0x194);}return _0x4889e3;};}function handleError(_0x55e5b4,_0x4b9e15){_0x4b9e15=_0x4b9e15||0x1f4;return function(_0x2e4420){logger[_0xfa92('0x23')](_0x2e4420['stack']);if(_0x2e4420[_0xfa92('0x24')]){delete _0x2e4420[_0xfa92('0x24')];}_0x55e5b4[_0xfa92('0x15')](_0x4b9e15)['send'](_0x2e4420);};}exports['index']=function(_0x495210,_0x28035f){var _0x39d262={},_0x3af7c5={},_0xc1a5ed={'count':0x0,'rows':[]};var _0x4b603c=_[_0xfa92('0x25')](db['ZohoConfiguration'][_0xfa92('0x26')],function(_0x12b62d){return{'name':_0x12b62d['fieldName'],'type':_0x12b62d[_0xfa92('0x27')][_0xfa92('0x28')]};});_0x3af7c5['model']=_['map'](_0x4b603c,_0xfa92('0x24'));_0x3af7c5[_0xfa92('0x29')]=_['keys'](_0x495210[_0xfa92('0x29')]);_0x3af7c5[_0xfa92('0x2a')]=_[_0xfa92('0x2b')](_0x3af7c5['model'],_0x3af7c5[_0xfa92('0x29')]);_0x39d262[_0xfa92('0x2c')]=_[_0xfa92('0x2b')](_0x3af7c5[_0xfa92('0x2d')],qs[_0xfa92('0x2e')](_0x495210[_0xfa92('0x29')][_0xfa92('0x2e')]));_0x39d262['attributes']=_0x39d262[_0xfa92('0x2c')][_0xfa92('0x2f')]?_0x39d262[_0xfa92('0x2c')]:_0x3af7c5[_0xfa92('0x2d')];if(!_0x495210[_0xfa92('0x29')][_0xfa92('0x30')](_0xfa92('0x31'))){_0x39d262[_0xfa92('0x17')]=qs[_0xfa92('0x17')](_0x495210[_0xfa92('0x29')]['limit']);_0x39d262[_0xfa92('0x19')]=qs[_0xfa92('0x19')](_0x495210[_0xfa92('0x29')][_0xfa92('0x19')]);}_0x39d262['order']=qs['sort'](_0x495210[_0xfa92('0x29')][_0xfa92('0x32')]);_0x39d262[_0xfa92('0x33')]=qs[_0xfa92('0x2a')](_[_0xfa92('0x34')](_0x495210[_0xfa92('0x29')],_0x3af7c5[_0xfa92('0x2a')]),_0x4b603c);if(_0x495210[_0xfa92('0x29')][_0xfa92('0x35')]){_0x39d262[_0xfa92('0x33')]=_['merge'](_0x39d262[_0xfa92('0x33')],{'$or':_['map'](_0x4b603c,function(_0x58775e){if(_0x58775e[_0xfa92('0x27')]!==_0xfa92('0x36')){var _0x49adfe={};_0x49adfe[_0x58775e[_0xfa92('0x24')]]={'$like':'%'+_0x495210['query'][_0xfa92('0x35')]+'%'};return _0x49adfe;}})});}_0x39d262=_['merge']({},_0x39d262,_0x495210[_0xfa92('0x37')]);var _0x26991c={'where':_0x39d262[_0xfa92('0x33')]};return db[_0xfa92('0x38')][_0xfa92('0x18')](_0x26991c)[_0xfa92('0x20')](function(_0x577163){_0xc1a5ed['count']=_0x577163;if(_0x495210[_0xfa92('0x29')][_0xfa92('0x39')]){_0x39d262[_0xfa92('0x3a')]=[{'all':!![]}];}return db[_0xfa92('0x38')][_0xfa92('0x3b')](_0x39d262);})[_0xfa92('0x20')](function(_0x4da0f4){_0xc1a5ed[_0xfa92('0x3c')]=_0x4da0f4;return _0xc1a5ed;})[_0xfa92('0x20')](respondWithFilteredResult(_0x28035f,_0x39d262))['catch'](handleError(_0x28035f,null));};exports[_0xfa92('0x3d')]=function(_0x14eca3,_0x4bc6a9){var _0x2b4f6a={'raw':![],'where':{'id':_0x14eca3['params']['id']}},_0x58d757={};_0x58d757['model']=_[_0xfa92('0x3e')](db['ZohoConfiguration'][_0xfa92('0x26')]);_0x58d757[_0xfa92('0x29')]=_[_0xfa92('0x3e')](_0x14eca3[_0xfa92('0x29')]);_0x58d757['filters']=_[_0xfa92('0x2b')](_0x58d757[_0xfa92('0x2d')],_0x58d757['query']);_0x2b4f6a[_0xfa92('0x2c')]=_[_0xfa92('0x2b')](_0x58d757[_0xfa92('0x2d')],qs['fields'](_0x14eca3[_0xfa92('0x29')][_0xfa92('0x2e')]));_0x2b4f6a['attributes']=_0x2b4f6a[_0xfa92('0x2c')][_0xfa92('0x2f')]?_0x2b4f6a[_0xfa92('0x2c')]:_0x58d757[_0xfa92('0x2d')];if(_0x14eca3[_0xfa92('0x29')][_0xfa92('0x39')]){_0x2b4f6a[_0xfa92('0x3a')]=[{'all':!![]}];}_0x2b4f6a=_[_0xfa92('0x3f')]({},_0x2b4f6a,_0x14eca3['options']);return db[_0xfa92('0x38')]['find'](_0x2b4f6a)[_0xfa92('0x20')](handleEntityNotFound(_0x4bc6a9,null))['then'](respondWithResult(_0x4bc6a9,null))['catch'](handleError(_0x4bc6a9,null));};exports['create']=function(_0x5f03b3,_0x4520e5){return db[_0xfa92('0x38')][_0xfa92('0x40')](_0x5f03b3[_0xfa92('0x41')],{})[_0xfa92('0x20')](respondWithResult(_0x4520e5,0xc9))[_0xfa92('0x42')](handleError(_0x4520e5,null));};exports[_0xfa92('0x1f')]=function(_0x3f4f86,_0x1e8f67){if(_0x3f4f86[_0xfa92('0x41')]['id']){delete _0x3f4f86[_0xfa92('0x41')]['id'];}return db[_0xfa92('0x38')][_0xfa92('0x43')]({'where':{'id':_0x3f4f86[_0xfa92('0x44')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x1e8f67,null))[_0xfa92('0x20')](saveUpdates(_0x3f4f86['body'],null))[_0xfa92('0x20')](respondWithResult(_0x1e8f67,null))['catch'](handleError(_0x1e8f67,null));};exports[_0xfa92('0x21')]=function(_0x21406f,_0x3f0121){return db[_0xfa92('0x38')]['find']({'where':{'id':_0x21406f[_0xfa92('0x44')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x3f0121,null))['then'](removeEntity(_0x3f0121,null))[_0xfa92('0x42')](handleError(_0x3f0121,null));};exports[_0xfa92('0x45')]=function(_0x5b558a,_0x54323d,_0xce2957){var _0x3b183a={};var _0x2633bd={};var _0x3ea26c;var _0x35fa5d;return db[_0xfa92('0x38')][_0xfa92('0x46')]({'where':{'id':_0x5b558a[_0xfa92('0x44')]['id']}})['then'](handleEntityNotFound(_0x54323d,null))[_0xfa92('0x20')](function(_0x1a3a2f){if(_0x1a3a2f){_0x3ea26c=_0x1a3a2f;_0x2633bd[_0xfa92('0x2d')]=_[_0xfa92('0x3e')](db['ZohoField'][_0xfa92('0x26')]);_0x2633bd[_0xfa92('0x29')]=_[_0xfa92('0x3e')](_0x5b558a['query']);_0x2633bd[_0xfa92('0x2a')]=_[_0xfa92('0x2b')](_0x2633bd[_0xfa92('0x2d')],_0x2633bd['query']);_0x3b183a[_0xfa92('0x2c')]=_['intersection'](_0x2633bd['model'],qs['fields'](_0x5b558a['query']['fields']));_0x3b183a['attributes']=_0x3b183a[_0xfa92('0x2c')][_0xfa92('0x2f')]?_0x3b183a[_0xfa92('0x2c')]:_0x2633bd[_0xfa92('0x2d')];_0x3b183a[_0xfa92('0x47')]=qs[_0xfa92('0x32')](_0x5b558a[_0xfa92('0x29')][_0xfa92('0x32')]);_0x3b183a[_0xfa92('0x33')]=qs[_0xfa92('0x2a')](_[_0xfa92('0x34')](_0x5b558a[_0xfa92('0x29')],_0x2633bd[_0xfa92('0x2a')]));if(_0x5b558a[_0xfa92('0x29')][_0xfa92('0x35')]){_0x3b183a[_0xfa92('0x33')]=_[_0xfa92('0x3f')](_0x3b183a[_0xfa92('0x33')],{'$or':_['map'](_0x3b183a['attributes'],function(_0x2d54c3){var _0xf79489={};_0xf79489[_0x2d54c3]={'$like':'%'+_0x5b558a[_0xfa92('0x29')][_0xfa92('0x35')]+'%'};return _0xf79489;})});}_0x3b183a=_[_0xfa92('0x3f')]({},_0x3b183a,_0x5b558a[_0xfa92('0x37')]);return _0x3ea26c[_0xfa92('0x45')](_0x3b183a);}})[_0xfa92('0x20')](function(_0x2c2811){if(_0x2c2811){_0x35fa5d=_0x2c2811[_0xfa92('0x2f')];if(!_0x5b558a[_0xfa92('0x29')][_0xfa92('0x30')](_0xfa92('0x31'))){_0x3b183a[_0xfa92('0x17')]=qs[_0xfa92('0x17')](_0x5b558a['query'][_0xfa92('0x17')]);_0x3b183a[_0xfa92('0x19')]=qs[_0xfa92('0x19')](_0x5b558a[_0xfa92('0x29')]['offset']);}return _0x3ea26c[_0xfa92('0x45')](_0x3b183a);}})[_0xfa92('0x20')](function(_0x1f71b7){if(_0x1f71b7){return _0x1f71b7?{'count':_0x35fa5d,'rows':_0x1f71b7}:null;}})[_0xfa92('0x20')](respondWithResult(_0x54323d,null))['catch'](handleError(_0x54323d,null));};exports[_0xfa92('0x48')]=function(_0x5353ba,_0x3abd70,_0x2a7b14){var _0x4fba71={};var _0x59cb66={};var _0x3445de;var _0x4421f5;return db['ZohoConfiguration'][_0xfa92('0x46')]({'where':{'id':_0x5353ba[_0xfa92('0x44')]['id']}})['then'](handleEntityNotFound(_0x3abd70,null))[_0xfa92('0x20')](function(_0x52ec6b){if(_0x52ec6b){_0x3445de=_0x52ec6b;_0x59cb66[_0xfa92('0x2d')]=_[_0xfa92('0x3e')](db[_0xfa92('0x49')]['rawAttributes']);_0x59cb66['query']=_['keys'](_0x5353ba[_0xfa92('0x29')]);_0x59cb66[_0xfa92('0x2a')]=_[_0xfa92('0x2b')](_0x59cb66[_0xfa92('0x2d')],_0x59cb66['query']);_0x4fba71[_0xfa92('0x2c')]=_[_0xfa92('0x2b')](_0x59cb66[_0xfa92('0x2d')],qs[_0xfa92('0x2e')](_0x5353ba[_0xfa92('0x29')][_0xfa92('0x2e')]));_0x4fba71[_0xfa92('0x2c')]=_0x4fba71['attributes'][_0xfa92('0x2f')]?_0x4fba71['attributes']:_0x59cb66[_0xfa92('0x2d')];_0x4fba71['order']=qs[_0xfa92('0x32')](_0x5353ba[_0xfa92('0x29')]['sort']);_0x4fba71[_0xfa92('0x33')]=qs[_0xfa92('0x2a')](_[_0xfa92('0x34')](_0x5353ba['query'],_0x59cb66[_0xfa92('0x2a')]));if(_0x5353ba[_0xfa92('0x29')]['filter']){_0x4fba71[_0xfa92('0x33')]=_[_0xfa92('0x3f')](_0x4fba71[_0xfa92('0x33')],{'$or':_[_0xfa92('0x25')](_0x4fba71['attributes'],function(_0x4a4d88){var _0x5e038f={};_0x5e038f[_0x4a4d88]={'$like':'%'+_0x5353ba[_0xfa92('0x29')]['filter']+'%'};return _0x5e038f;})});}_0x4fba71=_['merge']({},_0x4fba71,_0x5353ba[_0xfa92('0x37')]);return _0x3445de['getSubjects'](_0x4fba71);}})['then'](function(_0x2013c9){if(_0x2013c9){_0x4421f5=_0x2013c9['length'];if(!_0x5353ba[_0xfa92('0x29')][_0xfa92('0x30')](_0xfa92('0x31'))){_0x4fba71[_0xfa92('0x17')]=qs['limit'](_0x5353ba[_0xfa92('0x29')][_0xfa92('0x17')]);_0x4fba71['offset']=qs[_0xfa92('0x19')](_0x5353ba[_0xfa92('0x29')][_0xfa92('0x19')]);}return _0x3445de[_0xfa92('0x48')](_0x4fba71);}})['then'](function(_0x4c432f){if(_0x4c432f){return _0x4c432f?{'count':_0x4421f5,'rows':_0x4c432f}:null;}})[_0xfa92('0x20')](respondWithResult(_0x3abd70,null))[_0xfa92('0x42')](handleError(_0x3abd70,null));};exports[_0xfa92('0x4a')]=function(_0x23568a,_0x127826,_0xfc0b6f){var _0x3c6beb={};var _0x6336a7={};var _0x306fe9;var _0x233b16;return db[_0xfa92('0x38')][_0xfa92('0x46')]({'where':{'id':_0x23568a[_0xfa92('0x44')]['id']}})['then'](handleEntityNotFound(_0x127826,null))[_0xfa92('0x20')](function(_0x27a3ba){if(_0x27a3ba){_0x306fe9=_0x27a3ba;_0x6336a7[_0xfa92('0x2d')]=_[_0xfa92('0x3e')](db['ZohoField']['rawAttributes']);_0x6336a7[_0xfa92('0x29')]=_['keys'](_0x23568a[_0xfa92('0x29')]);_0x6336a7[_0xfa92('0x2a')]=_[_0xfa92('0x2b')](_0x6336a7['model'],_0x6336a7[_0xfa92('0x29')]);_0x3c6beb[_0xfa92('0x2c')]=_[_0xfa92('0x2b')](_0x6336a7[_0xfa92('0x2d')],qs['fields'](_0x23568a[_0xfa92('0x29')][_0xfa92('0x2e')]));_0x3c6beb[_0xfa92('0x2c')]=_0x3c6beb[_0xfa92('0x2c')][_0xfa92('0x2f')]?_0x3c6beb['attributes']:_0x6336a7[_0xfa92('0x2d')];_0x3c6beb[_0xfa92('0x47')]=qs['sort'](_0x23568a[_0xfa92('0x29')][_0xfa92('0x32')]);_0x3c6beb[_0xfa92('0x33')]=qs[_0xfa92('0x2a')](_[_0xfa92('0x34')](_0x23568a[_0xfa92('0x29')],_0x6336a7['filters']));if(_0x23568a[_0xfa92('0x29')][_0xfa92('0x35')]){_0x3c6beb['where']=_[_0xfa92('0x3f')](_0x3c6beb['where'],{'$or':_[_0xfa92('0x25')](_0x3c6beb[_0xfa92('0x2c')],function(_0x5245a7){var _0x28240a={};_0x28240a[_0x5245a7]={'$like':'%'+_0x23568a[_0xfa92('0x29')]['filter']+'%'};return _0x28240a;})});}_0x3c6beb=_[_0xfa92('0x3f')]({},_0x3c6beb,_0x23568a[_0xfa92('0x37')]);return _0x306fe9[_0xfa92('0x4a')](_0x3c6beb);}})[_0xfa92('0x20')](function(_0x5b100c){if(_0x5b100c){_0x233b16=_0x5b100c['length'];if(!_0x23568a['query']['hasOwnProperty'](_0xfa92('0x31'))){_0x3c6beb[_0xfa92('0x17')]=qs[_0xfa92('0x17')](_0x23568a[_0xfa92('0x29')]['limit']);_0x3c6beb['offset']=qs[_0xfa92('0x19')](_0x23568a[_0xfa92('0x29')]['offset']);}return _0x306fe9[_0xfa92('0x4a')](_0x3c6beb);}})[_0xfa92('0x20')](function(_0x3e2cce){if(_0x3e2cce){return _0x3e2cce?{'count':_0x233b16,'rows':_0x3e2cce}:null;}})['then'](respondWithResult(_0x127826,null))[_0xfa92('0x42')](handleError(_0x127826,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5c0501e..b8efb69 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 _0xfb72=['lodash','../../config/logger','moment','request-promise','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x2282a8,_0x3cea15){var _0xa9acf2=function(_0x4bba51){while(--_0x4bba51){_0x2282a8['push'](_0x2282a8['shift']());}};_0xa9acf2(++_0x3cea15);}(_0xfb72,0xaa));var _0x2fb7=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0xfb72[_0xccf869];return _0x21a9db;};'use strict';var _=require(_0x2fb7('0x0'));var util=require('util');var logger=require(_0x2fb7('0x1'))('api');var moment=require(_0x2fb7('0x2'));var BPromise=require('bluebird');var rp=require(_0x2fb7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2fb7('0x4'));var attributes=require(_0x2fb7('0x5'));module[_0x2fb7('0x6')]=function(_0x58fb50,_0x137569){return _0x58fb50[_0x2fb7('0x7')](_0x2fb7('0x8'),attributes,{'tableName':_0x2fb7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2764=['path','rimraf','../../config/environment','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x2764,0x12e));var _0x4276=function(_0x41dd96,_0x52a659){_0x41dd96=_0x41dd96-0x0;var _0x5b9bdf=_0x2764[_0x41dd96];return _0x5b9bdf;};'use strict';var _=require(_0x4276('0x0'));var util=require(_0x4276('0x1'));var logger=require(_0x4276('0x2'))(_0x4276('0x3'));var moment=require('moment');var BPromise=require(_0x4276('0x4'));var rp=require(_0x4276('0x5'));var fs=require('fs');var path=require(_0x4276('0x6'));var rimraf=require(_0x4276('0x7'));var config=require(_0x4276('0x8'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x60027c,_0xca2036){return _0x60027c['define'](_0x4276('0x9'),attributes,{'tableName':_0x4276('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index a2e6ee3..b838829 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 _0xa8f7=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0xddfb04,_0x3c4f4d){var _0x367903=function(_0x1f5b29){while(--_0x1f5b29){_0xddfb04['push'](_0xddfb04['shift']());}};_0x367903(++_0x3c4f4d);}(_0xa8f7,0x101));var _0x7a8f=function(_0x479f1c,_0x15546c){_0x479f1c=_0x479f1c-0x0;var _0x11b99a=_0xa8f7[_0x479f1c];return _0x11b99a;};'use strict';var _=require(_0x7a8f('0x0'));var util=require(_0x7a8f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a8f('0x2'));var fs=require('fs');var Redis=require(_0x7a8f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a8f('0x4'));var logger=require(_0x7a8f('0x5'))(_0x7a8f('0x6'));var config=require('../../config/environment');var jayson=require(_0x7a8f('0x7'));var client=jayson['client'][_0x7a8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e408c,_0x447490,_0x425e69){return new BPromise(function(_0x2cc68e,_0x5b9dd4){return client[_0x7a8f('0x9')](_0x3e408c,_0x425e69)[_0x7a8f('0xa')](function(_0x5ab4b9){logger[_0x7a8f('0xb')](_0x7a8f('0xc'),_0x447490,_0x7a8f('0xd'));logger[_0x7a8f('0xe')](_0x7a8f('0xf'),_0x447490,_0x7a8f('0xd'),JSON['stringify'](_0x5ab4b9));if(_0x5ab4b9['error']){if(_0x5ab4b9[_0x7a8f('0x10')][_0x7a8f('0x11')]===0x1f4){logger['error'](_0x7a8f('0xc'),_0x447490,_0x5ab4b9['error']['message']);return _0x5b9dd4(_0x5ab4b9[_0x7a8f('0x10')][_0x7a8f('0x12')]);}logger[_0x7a8f('0x10')](_0x7a8f('0xc'),_0x447490,_0x5ab4b9['error'][_0x7a8f('0x12')]);return _0x2cc68e(_0x5ab4b9[_0x7a8f('0x10')][_0x7a8f('0x12')]);}else{logger[_0x7a8f('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x447490,_0x7a8f('0xd'));_0x2cc68e(_0x5ab4b9['result'][_0x7a8f('0x12')]);}})['catch'](function(_0x17afe6){logger[_0x7a8f('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x447490,_0x17afe6);_0x5b9dd4(_0x17afe6);});});} \ No newline at end of file +var _0x9dcf=['rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x7e5aaa,_0x234c8b){var _0x2b709e=function(_0x33d7f4){while(--_0x33d7f4){_0x7e5aaa['push'](_0x7e5aaa['shift']());}};_0x2b709e(++_0x234c8b);}(_0x9dcf,0x179));var _0xf9dc=function(_0x532387,_0x54aad1){_0x532387=_0x532387-0x0;var _0x5576de=_0x9dcf[_0x532387];return _0x5576de;};'use strict';var _=require(_0xf9dc('0x0'));var util=require(_0xf9dc('0x1'));var moment=require(_0xf9dc('0x2'));var BPromise=require(_0xf9dc('0x3'));var rs=require(_0xf9dc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf9dc('0x5'));var logger=require(_0xf9dc('0x6'))(_0xf9dc('0x7'));var config=require(_0xf9dc('0x8'));var jayson=require(_0xf9dc('0x9'));var client=jayson[_0xf9dc('0xa')][_0xf9dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18ddaf,_0x1e230d,_0x5dd1ca){return new BPromise(function(_0x3b134b,_0x2ca313){return client[_0xf9dc('0xc')](_0x18ddaf,_0x5dd1ca)['then'](function(_0x3ca674){logger[_0xf9dc('0xd')](_0xf9dc('0xe'),_0x1e230d,_0xf9dc('0xf'));logger[_0xf9dc('0x10')](_0xf9dc('0x11'),_0x1e230d,'request\x20sent',JSON[_0xf9dc('0x12')](_0x3ca674));if(_0x3ca674[_0xf9dc('0x13')]){if(_0x3ca674[_0xf9dc('0x13')][_0xf9dc('0x14')]===0x1f4){logger['error'](_0xf9dc('0xe'),_0x1e230d,_0x3ca674['error'][_0xf9dc('0x15')]);return _0x2ca313(_0x3ca674[_0xf9dc('0x13')][_0xf9dc('0x15')]);}logger[_0xf9dc('0x13')](_0xf9dc('0xe'),_0x1e230d,_0x3ca674[_0xf9dc('0x13')]['message']);return _0x3b134b(_0x3ca674[_0xf9dc('0x13')][_0xf9dc('0x15')]);}else{logger[_0xf9dc('0xd')](_0xf9dc('0xe'),_0x1e230d,'request\x20sent');_0x3b134b(_0x3ca674[_0xf9dc('0x16')][_0xf9dc('0x15')]);}})[_0xf9dc('0x17')](function(_0x159a0d){logger[_0xf9dc('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x1e230d,_0x159a0d);_0x2ca313(_0x159a0d);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 45823bc..f1a6c07 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 _0xdfd0=['create','put','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x5a3365,_0x18534d){var _0x5f1f28=function(_0x32493d){while(--_0x32493d){_0x5a3365['push'](_0x5a3365['shift']());}};_0x5f1f28(++_0x18534d);}(_0xdfd0,0x1d0));var _0x0dfd=function(_0x58888d,_0x19d168){_0x58888d=_0x58888d-0x0;var _0x3df9ae=_0xdfd0[_0x58888d];return _0x3df9ae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0dfd('0x0'));var timeout=require(_0x0dfd('0x1'));var express=require('express');var router=express[_0x0dfd('0x2')]();var fs_extra=require(_0x0dfd('0x3'));var auth=require(_0x0dfd('0x4'));var interaction=require(_0x0dfd('0x5'));var config=require('../../config/environment');var controller=require(_0x0dfd('0x6'));router[_0x0dfd('0x7')]('/',auth[_0x0dfd('0x8')](),controller['index']);router['get'](_0x0dfd('0x9'),auth[_0x0dfd('0x8')](),controller[_0x0dfd('0xa')]);router[_0x0dfd('0xb')]('/',auth[_0x0dfd('0x8')](),controller[_0x0dfd('0xc')]);router[_0x0dfd('0xd')](_0x0dfd('0x9'),auth[_0x0dfd('0x8')](),controller[_0x0dfd('0xe')]);router['delete'](_0x0dfd('0x9'),auth[_0x0dfd('0x8')](),controller[_0x0dfd('0xf')]);module[_0x0dfd('0x10')]=router; \ No newline at end of file +var _0x42d8=['put','update','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2652e9,_0x1b1faa){var _0x30652e=function(_0x4d8edf){while(--_0x4d8edf){_0x2652e9['push'](_0x2652e9['shift']());}};_0x30652e(++_0x1b1faa);}(_0x42d8,0x189));var _0x842d=function(_0x2ac236,_0x31d1e4){_0x2ac236=_0x2ac236-0x0;var _0x9a1af=_0x42d8[_0x2ac236];return _0x9a1af;};'use strict';var multer=require('multer');var util=require(_0x842d('0x0'));var path=require('path');var timeout=require(_0x842d('0x1'));var express=require('express');var router=express[_0x842d('0x2')]();var fs_extra=require(_0x842d('0x3'));var auth=require(_0x842d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x842d('0x5')]('/',auth['isAuthenticated'](),controller[_0x842d('0x6')]);router[_0x842d('0x5')](_0x842d('0x7'),auth[_0x842d('0x8')](),controller[_0x842d('0x9')]);router[_0x842d('0xa')]('/',auth[_0x842d('0x8')](),controller[_0x842d('0xb')]);router[_0x842d('0xc')](_0x842d('0x7'),auth[_0x842d('0x8')](),controller[_0x842d('0xd')]);router['delete'](_0x842d('0x7'),auth[_0x842d('0x8')](),controller[_0x842d('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index be6e363..9fc17f5 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 _0xdef0=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x21c537,_0x3efa65){var _0x48be1f=function(_0x2eb5ed){while(--_0x2eb5ed){_0x21c537['push'](_0x21c537['shift']());}};_0x48be1f(++_0x3efa65);}(_0xdef0,0x72));var _0x0def=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdef0[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x0def('0x0')]={'type':{'type':Sequelize[_0x0def('0x1')](_0x0def('0x2'),_0x0def('0x3'),_0x0def('0x4'),_0x0def('0x5'),_0x0def('0x6')),'defaultValue':_0x0def('0x2')},'content':{'type':Sequelize[_0x0def('0x7')]},'key':{'type':Sequelize[_0x0def('0x7')]},'keyType':{'type':Sequelize[_0x0def('0x1')]('string',_0x0def('0x3'),_0x0def('0x4'))},'keyContent':{'type':Sequelize[_0x0def('0x7')]},'idField':{'type':Sequelize[_0x0def('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0def('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0def('0x7')]}}; \ No newline at end of file +var _0x8040=['variable','STRING','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string'];(function(_0x207970,_0x5cc2a2){var _0x14413d=function(_0x21792d){while(--_0x21792d){_0x207970['push'](_0x207970['shift']());}};_0x14413d(++_0x5cc2a2);}(_0x8040,0x1e3));var _0x0804=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x8040[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x0804('0x0'));module[_0x0804('0x1')]={'type':{'type':Sequelize[_0x0804('0x2')]('string','variable',_0x0804('0x3'),_0x0804('0x4'),_0x0804('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0804('0x2')](_0x0804('0x6'),_0x0804('0x7'),_0x0804('0x3'))},'keyContent':{'type':Sequelize[_0x0804('0x8')]},'idField':{'type':Sequelize[_0x0804('0x8')]},'nameField':{'type':Sequelize[_0x0804('0x8')]},'customField':{'type':Sequelize[_0x0804('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0804('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index abb78da..4f23a4c 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 _0x6731=['then','destroy','sendStatus','error','stack','name','send','index','map','ZohoField','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0x6731,0x6f));var _0x1673=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x6731[_0x51b0dc];return _0x13fa89;};'use strict';var emlformat=require(_0x1673('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1673('0x1'));var jsonpatch=require(_0x1673('0x2'));var rp=require(_0x1673('0x3'));var moment=require('moment');var BPromise=require(_0x1673('0x4'));var Mustache=require(_0x1673('0x5'));var util=require(_0x1673('0x6'));var path=require(_0x1673('0x7'));var sox=require('sox');var csv=require(_0x1673('0x8'));var ejs=require(_0x1673('0x9'));var fs=require('fs');var fs_extra=require(_0x1673('0xa'));var _=require(_0x1673('0xb'));var squel=require(_0x1673('0xc'));var crypto=require('crypto');var jsforce=require(_0x1673('0xd'));var deskjs=require(_0x1673('0xe'));var toCsv=require(_0x1673('0x8'));var querystring=require(_0x1673('0xf'));var Papa=require(_0x1673('0x10'));var Redis=require(_0x1673('0x11'));var authService=require(_0x1673('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1673('0x13'));var hardwareService=require(_0x1673('0x14'));var logger=require(_0x1673('0x15'))(_0x1673('0x16'));var utils=require('../../config/utils');var config=require(_0x1673('0x17'));var licenseUtil=require(_0x1673('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24cbac,_0x2ac45b){_0x2ac45b=_0x2ac45b||0xcc;return function(_0x2c24bf){if(_0x2c24bf){return _0x24cbac['sendStatus'](_0x2ac45b);}return _0x24cbac[_0x1673('0x19')](_0x2ac45b)[_0x1673('0x1a')]();};}function respondWithResult(_0x29aadc,_0x5b81e2){_0x5b81e2=_0x5b81e2||0xc8;return function(_0x17f2e7){if(_0x17f2e7){return _0x29aadc[_0x1673('0x19')](_0x5b81e2)[_0x1673('0x1b')](_0x17f2e7);}};}function respondWithFilteredResult(_0x110b82,_0x2e1a9d){return function(_0x1e2edf){if(_0x1e2edf){var _0x522adb=typeof _0x2e1a9d['offset']===_0x1673('0x1c')&&typeof _0x2e1a9d['limit']===_0x1673('0x1c');var _0x251e74=_0x1e2edf[_0x1673('0x1d')];var _0x51d564=_0x522adb?0x0:_0x2e1a9d[_0x1673('0x1e')];var _0x3ed673=_0x522adb?_0x1e2edf['count']:_0x2e1a9d['offset']+_0x2e1a9d[_0x1673('0x1f')];var _0x4d914f;if(_0x3ed673>=_0x251e74){_0x3ed673=_0x251e74;_0x4d914f=0xc8;}else{_0x4d914f=0xce;}_0x110b82[_0x1673('0x19')](_0x4d914f);return _0x110b82['set'](_0x1673('0x20'),_0x51d564+'-'+_0x3ed673+'/'+_0x251e74)[_0x1673('0x1b')](_0x1e2edf);}return null;};}function patchUpdates(_0x2e07c2){return function(_0x474e2a){try{jsonpatch[_0x1673('0x21')](_0x474e2a,_0x2e07c2,!![]);}catch(_0x422cd3){return BPromise[_0x1673('0x22')](_0x422cd3);}return _0x474e2a[_0x1673('0x23')]();};}function saveUpdates(_0x44234b,_0x258d07){return function(_0x499939){if(_0x499939){return _0x499939[_0x1673('0x24')](_0x44234b)[_0x1673('0x25')](function(_0x56335b){return _0x56335b;});}return null;};}function removeEntity(_0x4bb287,_0x3c321e){return function(_0x31b050){if(_0x31b050){return _0x31b050[_0x1673('0x26')]()[_0x1673('0x25')](function(){_0x4bb287['status'](0xcc)[_0x1673('0x1a')]();});}};}function handleEntityNotFound(_0x114b3a,_0x3949e5){return function(_0x348d22){if(!_0x348d22){_0x114b3a[_0x1673('0x27')](0x194);}return _0x348d22;};}function handleError(_0x378088,_0x16d06b){_0x16d06b=_0x16d06b||0x1f4;return function(_0x204264){logger[_0x1673('0x28')](_0x204264[_0x1673('0x29')]);if(_0x204264['name']){delete _0x204264[_0x1673('0x2a')];}_0x378088[_0x1673('0x19')](_0x16d06b)[_0x1673('0x2b')](_0x204264);};}exports[_0x1673('0x2c')]=function(_0xf460f3,_0x1fc323){var _0x4bed3f={},_0x5ab4b0={},_0x2a037b={'count':0x0,'rows':[]};var _0x24262e=_[_0x1673('0x2d')](db[_0x1673('0x2e')]['rawAttributes'],function(_0xf4e636){return{'name':_0xf4e636[_0x1673('0x2f')],'type':_0xf4e636['type']['key']};});_0x5ab4b0['model']=_[_0x1673('0x2d')](_0x24262e,'name');_0x5ab4b0[_0x1673('0x30')]=_[_0x1673('0x31')](_0xf460f3[_0x1673('0x30')]);_0x5ab4b0['filters']=_[_0x1673('0x32')](_0x5ab4b0[_0x1673('0x33')],_0x5ab4b0['query']);_0x4bed3f[_0x1673('0x34')]=_[_0x1673('0x32')](_0x5ab4b0[_0x1673('0x33')],qs[_0x1673('0x35')](_0xf460f3[_0x1673('0x30')][_0x1673('0x35')]));_0x4bed3f[_0x1673('0x34')]=_0x4bed3f['attributes'][_0x1673('0x36')]?_0x4bed3f[_0x1673('0x34')]:_0x5ab4b0[_0x1673('0x33')];if(!_0xf460f3[_0x1673('0x30')][_0x1673('0x37')](_0x1673('0x38'))){_0x4bed3f[_0x1673('0x1f')]=qs[_0x1673('0x1f')](_0xf460f3[_0x1673('0x30')][_0x1673('0x1f')]);_0x4bed3f[_0x1673('0x1e')]=qs[_0x1673('0x1e')](_0xf460f3[_0x1673('0x30')][_0x1673('0x1e')]);}_0x4bed3f['order']=qs[_0x1673('0x39')](_0xf460f3[_0x1673('0x30')][_0x1673('0x39')]);_0x4bed3f[_0x1673('0x3a')]=qs['filters'](_['pick'](_0xf460f3['query'],_0x5ab4b0[_0x1673('0x3b')]),_0x24262e);if(_0xf460f3[_0x1673('0x30')][_0x1673('0x3c')]){_0x4bed3f[_0x1673('0x3a')]=_[_0x1673('0x3d')](_0x4bed3f[_0x1673('0x3a')],{'$or':_['map'](_0x24262e,function(_0x1e612e){if(_0x1e612e[_0x1673('0x3e')]!=='VIRTUAL'){var _0x2cb5c5={};_0x2cb5c5[_0x1e612e['name']]={'$like':'%'+_0xf460f3[_0x1673('0x30')][_0x1673('0x3c')]+'%'};return _0x2cb5c5;}})});}_0x4bed3f=_[_0x1673('0x3d')]({},_0x4bed3f,_0xf460f3[_0x1673('0x3f')]);var _0x2227fa={'where':_0x4bed3f[_0x1673('0x3a')]};return db[_0x1673('0x2e')]['count'](_0x2227fa)['then'](function(_0x4aaa05){_0x2a037b[_0x1673('0x1d')]=_0x4aaa05;if(_0xf460f3[_0x1673('0x30')][_0x1673('0x40')]){_0x4bed3f['include']=[{'all':!![]}];}return db[_0x1673('0x2e')][_0x1673('0x41')](_0x4bed3f);})[_0x1673('0x25')](function(_0x4fccf6){_0x2a037b['rows']=_0x4fccf6;return _0x2a037b;})[_0x1673('0x25')](respondWithFilteredResult(_0x1fc323,_0x4bed3f))[_0x1673('0x42')](handleError(_0x1fc323,null));};exports[_0x1673('0x43')]=function(_0x18a620,_0xc58d09){var _0x274fb9={'raw':!![],'where':{'id':_0x18a620[_0x1673('0x44')]['id']}},_0x3d0457={};_0x3d0457[_0x1673('0x33')]=_['keys'](db[_0x1673('0x2e')][_0x1673('0x45')]);_0x3d0457['query']=_['keys'](_0x18a620[_0x1673('0x30')]);_0x3d0457[_0x1673('0x3b')]=_[_0x1673('0x32')](_0x3d0457[_0x1673('0x33')],_0x3d0457['query']);_0x274fb9[_0x1673('0x34')]=_['intersection'](_0x3d0457[_0x1673('0x33')],qs['fields'](_0x18a620[_0x1673('0x30')][_0x1673('0x35')]));_0x274fb9[_0x1673('0x34')]=_0x274fb9[_0x1673('0x34')][_0x1673('0x36')]?_0x274fb9[_0x1673('0x34')]:_0x3d0457[_0x1673('0x33')];if(_0x18a620[_0x1673('0x30')][_0x1673('0x40')]){_0x274fb9[_0x1673('0x46')]=[{'all':!![]}];}_0x274fb9=_['merge']({},_0x274fb9,_0x18a620[_0x1673('0x3f')]);return db[_0x1673('0x2e')][_0x1673('0x47')](_0x274fb9)[_0x1673('0x25')](handleEntityNotFound(_0xc58d09,null))[_0x1673('0x25')](respondWithResult(_0xc58d09,null))['catch'](handleError(_0xc58d09,null));};exports['create']=function(_0x48e3a7,_0x569e27){return db[_0x1673('0x2e')][_0x1673('0x48')](_0x48e3a7[_0x1673('0x49')],{})['then'](respondWithResult(_0x569e27,0xc9))[_0x1673('0x42')](handleError(_0x569e27,null));};exports['update']=function(_0x4afe8f,_0x245737){if(_0x4afe8f[_0x1673('0x49')]['id']){delete _0x4afe8f[_0x1673('0x49')]['id'];}return db[_0x1673('0x2e')][_0x1673('0x47')]({'where':{'id':_0x4afe8f[_0x1673('0x44')]['id']}})[_0x1673('0x25')](handleEntityNotFound(_0x245737,null))[_0x1673('0x25')](saveUpdates(_0x4afe8f[_0x1673('0x49')],null))[_0x1673('0x25')](respondWithResult(_0x245737,null))['catch'](handleError(_0x245737,null));};exports[_0x1673('0x26')]=function(_0x342584,_0xe46a75){return db[_0x1673('0x2e')]['find']({'where':{'id':_0x342584[_0x1673('0x44')]['id']}})[_0x1673('0x25')](handleEntityNotFound(_0xe46a75,null))[_0x1673('0x25')](removeEntity(_0xe46a75,null))[_0x1673('0x42')](handleError(_0xe46a75,null));}; \ No newline at end of file +var _0x93ef=['destroy','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','rows','params','includeAll','catch','create','find','body'];(function(_0x3d1bba,_0x1d1bc3){var _0x433c1b=function(_0x2610c6){while(--_0x2610c6){_0x3d1bba['push'](_0x3d1bba['shift']());}};_0x433c1b(++_0x1d1bc3);}(_0x93ef,0x15f));var _0xf93e=function(_0x37b87b,_0x4831be){_0x37b87b=_0x37b87b-0x0;var _0x2c72d4=_0x93ef[_0x37b87b];return _0x2c72d4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf93e('0x0'));var moment=require(_0xf93e('0x1'));var BPromise=require(_0xf93e('0x2'));var Mustache=require(_0xf93e('0x3'));var util=require('util');var path=require(_0xf93e('0x4'));var sox=require(_0xf93e('0x5'));var csv=require(_0xf93e('0x6'));var ejs=require(_0xf93e('0x7'));var fs=require('fs');var fs_extra=require(_0xf93e('0x8'));var _=require(_0xf93e('0x9'));var squel=require('squel');var crypto=require(_0xf93e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf93e('0x6'));var querystring=require(_0xf93e('0xb'));var Papa=require(_0xf93e('0xc'));var Redis=require(_0xf93e('0xd'));var authService=require(_0xf93e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf93e('0xf'));var hardwareService=require(_0xf93e('0x10'));var logger=require('../../config/logger')(_0xf93e('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf93e('0x12'));var db=require(_0xf93e('0x13'))['db'];function respondWithStatusCode(_0x25fc76,_0x417495){_0x417495=_0x417495||0xcc;return function(_0x14644f){if(_0x14644f){return _0x25fc76['sendStatus'](_0x417495);}return _0x25fc76[_0xf93e('0x14')](_0x417495)[_0xf93e('0x15')]();};}function respondWithResult(_0x57345d,_0x355822){_0x355822=_0x355822||0xc8;return function(_0x278cab){if(_0x278cab){return _0x57345d['status'](_0x355822)[_0xf93e('0x16')](_0x278cab);}};}function respondWithFilteredResult(_0x4e09ec,_0xbf4390){return function(_0x2a9d66){if(_0x2a9d66){var _0x5b2a6e=typeof _0xbf4390[_0xf93e('0x17')]===_0xf93e('0x18')&&typeof _0xbf4390['limit']==='undefined';var _0x18ec87=_0x2a9d66[_0xf93e('0x19')];var _0x1f1805=_0x5b2a6e?0x0:_0xbf4390['offset'];var _0xcd128d=_0x5b2a6e?_0x2a9d66[_0xf93e('0x19')]:_0xbf4390['offset']+_0xbf4390[_0xf93e('0x1a')];var _0x2fee81;if(_0xcd128d>=_0x18ec87){_0xcd128d=_0x18ec87;_0x2fee81=0xc8;}else{_0x2fee81=0xce;}_0x4e09ec[_0xf93e('0x14')](_0x2fee81);return _0x4e09ec[_0xf93e('0x1b')]('Content-Range',_0x1f1805+'-'+_0xcd128d+'/'+_0x18ec87)['json'](_0x2a9d66);}return null;};}function patchUpdates(_0x45eeed){return function(_0x4ba927){try{jsonpatch[_0xf93e('0x1c')](_0x4ba927,_0x45eeed,!![]);}catch(_0x17045f){return BPromise['reject'](_0x17045f);}return _0x4ba927[_0xf93e('0x1d')]();};}function saveUpdates(_0x39b6ea,_0x3d471){return function(_0x2d3623){if(_0x2d3623){return _0x2d3623[_0xf93e('0x1e')](_0x39b6ea)[_0xf93e('0x1f')](function(_0x2aa2cd){return _0x2aa2cd;});}return null;};}function removeEntity(_0x2ef05e,_0x102e7b){return function(_0x279730){if(_0x279730){return _0x279730['destroy']()[_0xf93e('0x1f')](function(){_0x2ef05e[_0xf93e('0x14')](0xcc)[_0xf93e('0x15')]();});}};}function handleEntityNotFound(_0x3a0fd6,_0x23c03e){return function(_0x44e5ba){if(!_0x44e5ba){_0x3a0fd6[_0xf93e('0x20')](0x194);}return _0x44e5ba;};}function handleError(_0x3b7f3b,_0x11bf09){_0x11bf09=_0x11bf09||0x1f4;return function(_0x523bc5){logger[_0xf93e('0x21')](_0x523bc5[_0xf93e('0x22')]);if(_0x523bc5[_0xf93e('0x23')]){delete _0x523bc5[_0xf93e('0x23')];}_0x3b7f3b[_0xf93e('0x14')](_0x11bf09)[_0xf93e('0x24')](_0x523bc5);};}exports[_0xf93e('0x25')]=function(_0x5277c2,_0x23eba6){var _0x201f3b={},_0xeef58d={},_0x3819a7={'count':0x0,'rows':[]};var _0x2361a9=_[_0xf93e('0x26')](db[_0xf93e('0x27')][_0xf93e('0x28')],function(_0x56451e){return{'name':_0x56451e[_0xf93e('0x29')],'type':_0x56451e[_0xf93e('0x2a')][_0xf93e('0x2b')]};});_0xeef58d[_0xf93e('0x2c')]=_[_0xf93e('0x26')](_0x2361a9,_0xf93e('0x23'));_0xeef58d['query']=_[_0xf93e('0x2d')](_0x5277c2['query']);_0xeef58d[_0xf93e('0x2e')]=_[_0xf93e('0x2f')](_0xeef58d[_0xf93e('0x2c')],_0xeef58d['query']);_0x201f3b['attributes']=_['intersection'](_0xeef58d[_0xf93e('0x2c')],qs[_0xf93e('0x30')](_0x5277c2[_0xf93e('0x31')][_0xf93e('0x30')]));_0x201f3b[_0xf93e('0x32')]=_0x201f3b[_0xf93e('0x32')][_0xf93e('0x33')]?_0x201f3b[_0xf93e('0x32')]:_0xeef58d[_0xf93e('0x2c')];if(!_0x5277c2[_0xf93e('0x31')][_0xf93e('0x34')](_0xf93e('0x35'))){_0x201f3b[_0xf93e('0x1a')]=qs['limit'](_0x5277c2[_0xf93e('0x31')][_0xf93e('0x1a')]);_0x201f3b[_0xf93e('0x17')]=qs[_0xf93e('0x17')](_0x5277c2[_0xf93e('0x31')]['offset']);}_0x201f3b[_0xf93e('0x36')]=qs['sort'](_0x5277c2['query']['sort']);_0x201f3b[_0xf93e('0x37')]=qs[_0xf93e('0x2e')](_[_0xf93e('0x38')](_0x5277c2[_0xf93e('0x31')],_0xeef58d[_0xf93e('0x2e')]),_0x2361a9);if(_0x5277c2[_0xf93e('0x31')][_0xf93e('0x39')]){_0x201f3b[_0xf93e('0x37')]=_[_0xf93e('0x3a')](_0x201f3b[_0xf93e('0x37')],{'$or':_[_0xf93e('0x26')](_0x2361a9,function(_0x19e356){if(_0x19e356[_0xf93e('0x2a')]!==_0xf93e('0x3b')){var _0x2f4a77={};_0x2f4a77[_0x19e356[_0xf93e('0x23')]]={'$like':'%'+_0x5277c2['query']['filter']+'%'};return _0x2f4a77;}})});}_0x201f3b=_['merge']({},_0x201f3b,_0x5277c2[_0xf93e('0x3c')]);var _0x26ed6c={'where':_0x201f3b[_0xf93e('0x37')]};return db[_0xf93e('0x27')][_0xf93e('0x19')](_0x26ed6c)[_0xf93e('0x1f')](function(_0x350e0f){_0x3819a7[_0xf93e('0x19')]=_0x350e0f;if(_0x5277c2[_0xf93e('0x31')]['includeAll']){_0x201f3b[_0xf93e('0x3d')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x201f3b);})[_0xf93e('0x1f')](function(_0x2d1267){_0x3819a7[_0xf93e('0x3e')]=_0x2d1267;return _0x3819a7;})[_0xf93e('0x1f')](respondWithFilteredResult(_0x23eba6,_0x201f3b))['catch'](handleError(_0x23eba6,null));};exports['show']=function(_0xe3ace,_0x4dad62){var _0x56b9d7={'raw':!![],'where':{'id':_0xe3ace[_0xf93e('0x3f')]['id']}},_0x135626={};_0x135626[_0xf93e('0x2c')]=_[_0xf93e('0x2d')](db['ZohoField'][_0xf93e('0x28')]);_0x135626[_0xf93e('0x31')]=_[_0xf93e('0x2d')](_0xe3ace[_0xf93e('0x31')]);_0x135626['filters']=_[_0xf93e('0x2f')](_0x135626[_0xf93e('0x2c')],_0x135626[_0xf93e('0x31')]);_0x56b9d7['attributes']=_[_0xf93e('0x2f')](_0x135626[_0xf93e('0x2c')],qs[_0xf93e('0x30')](_0xe3ace['query']['fields']));_0x56b9d7[_0xf93e('0x32')]=_0x56b9d7[_0xf93e('0x32')][_0xf93e('0x33')]?_0x56b9d7[_0xf93e('0x32')]:_0x135626['model'];if(_0xe3ace[_0xf93e('0x31')][_0xf93e('0x40')]){_0x56b9d7['include']=[{'all':!![]}];}_0x56b9d7=_[_0xf93e('0x3a')]({},_0x56b9d7,_0xe3ace[_0xf93e('0x3c')]);return db[_0xf93e('0x27')]['find'](_0x56b9d7)['then'](handleEntityNotFound(_0x4dad62,null))['then'](respondWithResult(_0x4dad62,null))[_0xf93e('0x41')](handleError(_0x4dad62,null));};exports[_0xf93e('0x42')]=function(_0x35b851,_0x2e3ba9){return db['ZohoField']['create'](_0x35b851['body'],{})[_0xf93e('0x1f')](respondWithResult(_0x2e3ba9,0xc9))[_0xf93e('0x41')](handleError(_0x2e3ba9,null));};exports[_0xf93e('0x1e')]=function(_0x17eb25,_0x588e74){if(_0x17eb25['body']['id']){delete _0x17eb25['body']['id'];}return db[_0xf93e('0x27')][_0xf93e('0x43')]({'where':{'id':_0x17eb25[_0xf93e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x588e74,null))['then'](saveUpdates(_0x17eb25[_0xf93e('0x44')],null))[_0xf93e('0x1f')](respondWithResult(_0x588e74,null))[_0xf93e('0x41')](handleError(_0x588e74,null));};exports[_0xf93e('0x45')]=function(_0x182b7f,_0x3cefb0){return db[_0xf93e('0x27')][_0xf93e('0x43')]({'where':{'id':_0x182b7f[_0xf93e('0x3f')]['id']}})[_0xf93e('0x1f')](handleEntityNotFound(_0x3cefb0,null))['then'](removeEntity(_0x3cefb0,null))['catch'](handleError(_0x3cefb0,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 35f23f9..2d940d9 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 _0x6343=['../../config/logger','api','rimraf','../../config/environment','exports','define','ZohoField','idField','FieldId'];(function(_0x4493c9,_0x3bb7d0){var _0x554351=function(_0x968d01){while(--_0x968d01){_0x4493c9['push'](_0x4493c9['shift']());}};_0x554351(++_0x3bb7d0);}(_0x6343,0x168));var _0x3634=function(_0x3751aa,_0x2bc2f7){_0x3751aa=_0x3751aa-0x0;var _0xe19478=_0x6343[_0x3751aa];return _0xe19478;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3634('0x0'))(_0x3634('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var attributes=require('./intZohoField.attributes');module[_0x3634('0x4')]=function(_0x388c18,_0x4bb496){return _0x388c18[_0x3634('0x5')](_0x3634('0x6'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x3634('0x7'),_0x3634('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger'];(function(_0x474b00,_0x1d548){var _0x21aa32=function(_0x5a18b2){while(--_0x5a18b2){_0x474b00['push'](_0x474b00['shift']());}};_0x21aa32(++_0x1d548);}(_0x57ca,0x108));var _0xa57c=function(_0x8af287,_0xeec755){_0x8af287=_0x8af287-0x0;var _0x476fe2=_0x57ca[_0x8af287];return _0x476fe2;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['idField',_0xa57c('0xd')],'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 c7fc633..6882b83 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 _0x82e7=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch'];(function(_0x5dde20,_0x292fd6){var _0x3cea8b=function(_0x4b3cd9){while(--_0x4b3cd9){_0x5dde20['push'](_0x5dde20['shift']());}};_0x3cea8b(++_0x292fd6);}(_0x82e7,0x1ce));var _0x782e=function(_0x342421,_0x407535){_0x342421=_0x342421-0x0;var _0xe727de=_0x82e7[_0x342421];return _0xe727de;};'use strict';var _=require(_0x782e('0x0'));var util=require(_0x782e('0x1'));var moment=require(_0x782e('0x2'));var BPromise=require(_0x782e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x782e('0x4'));var db=require(_0x782e('0x5'))['db'];var utils=require(_0x782e('0x6'));var logger=require('../../config/logger')(_0x782e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x782e('0x8')][_0x782e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4797d6,_0x26ca1e,_0x3b5490){return new BPromise(function(_0x4526d6,_0xdea8a2){return client['request'](_0x4797d6,_0x3b5490)['then'](function(_0x5e337f){logger[_0x782e('0xa')]('ZohoField,\x20%s,\x20%s',_0x26ca1e,_0x782e('0xb'));logger[_0x782e('0xc')](_0x782e('0xd'),_0x26ca1e,'request\x20sent',JSON[_0x782e('0xe')](_0x5e337f));if(_0x5e337f['error']){if(_0x5e337f[_0x782e('0xf')][_0x782e('0x10')]===0x1f4){logger[_0x782e('0xf')](_0x782e('0x11'),_0x26ca1e,_0x5e337f[_0x782e('0xf')][_0x782e('0x12')]);return _0xdea8a2(_0x5e337f[_0x782e('0xf')][_0x782e('0x12')]);}logger['error'](_0x782e('0x11'),_0x26ca1e,_0x5e337f[_0x782e('0xf')][_0x782e('0x12')]);return _0x4526d6(_0x5e337f[_0x782e('0xf')][_0x782e('0x12')]);}else{logger[_0x782e('0xa')](_0x782e('0x11'),_0x26ca1e,_0x782e('0xb'));_0x4526d6(_0x5e337f[_0x782e('0x13')][_0x782e('0x12')]);}})[_0x782e('0x14')](function(_0xc8f622){logger[_0x782e('0xf')](_0x782e('0x11'),_0x26ca1e,_0xc8f622);_0xdea8a2(_0xc8f622);});});} \ No newline at end of file +var _0x07c0=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x21e04c,_0x1c0b72){var _0x435ad9=function(_0x1d4d05){while(--_0x1d4d05){_0x21e04c['push'](_0x21e04c['shift']());}};_0x435ad9(++_0x1c0b72);}(_0x07c0,0x159));var _0x007c=function(_0x3f0b15,_0xb88473){_0x3f0b15=_0x3f0b15-0x0;var _0x38f95f=_0x07c0[_0x3f0b15];return _0x38f95f;};'use strict';var _=require(_0x007c('0x0'));var util=require(_0x007c('0x1'));var moment=require(_0x007c('0x2'));var BPromise=require('bluebird');var rs=require(_0x007c('0x3'));var fs=require('fs');var Redis=require(_0x007c('0x4'));var db=require(_0x007c('0x5'))['db'];var utils=require(_0x007c('0x6'));var logger=require(_0x007c('0x7'))(_0x007c('0x8'));var config=require('../../config/environment');var jayson=require(_0x007c('0x9'));var client=jayson['client'][_0x007c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31f79f,_0x559c26,_0x4b98d2){return new BPromise(function(_0x4e03f8,_0x4a08d2){return client[_0x007c('0xb')](_0x31f79f,_0x4b98d2)[_0x007c('0xc')](function(_0x198907){logger['info'](_0x007c('0xd'),_0x559c26,_0x007c('0xe'));logger[_0x007c('0xf')](_0x007c('0x10'),_0x559c26,_0x007c('0xe'),JSON[_0x007c('0x11')](_0x198907));if(_0x198907[_0x007c('0x12')]){if(_0x198907[_0x007c('0x12')][_0x007c('0x13')]===0x1f4){logger[_0x007c('0x12')](_0x007c('0xd'),_0x559c26,_0x198907[_0x007c('0x12')][_0x007c('0x14')]);return _0x4a08d2(_0x198907[_0x007c('0x12')][_0x007c('0x14')]);}logger[_0x007c('0x12')](_0x007c('0xd'),_0x559c26,_0x198907[_0x007c('0x12')][_0x007c('0x14')]);return _0x4e03f8(_0x198907[_0x007c('0x12')]['message']);}else{logger[_0x007c('0x15')]('ZohoField,\x20%s,\x20%s',_0x559c26,_0x007c('0xe'));_0x4e03f8(_0x198907[_0x007c('0x16')][_0x007c('0x14')]);}})[_0x007c('0x17')](function(_0x22822e){logger[_0x007c('0x12')]('ZohoField,\x20%s,\x20%s',_0x559c26,_0x22822e);_0x4a08d2(_0x22822e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 86b6fba..3e5ff5a 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x32fab5,_0x1c3ea6){var _0x1983ea=function(_0x2c2289){while(--_0x2c2289){_0x32fab5['push'](_0x32fab5['shift']());}};_0x1983ea(++_0x1c3ea6);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x170561,_0x368fcf){var _0x56e9c9=function(_0x1e0d68){while(--_0x1e0d68){_0x170561['push'](_0x170561['shift']());}};_0x56e9c9(++_0x368fcf);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5d5230b..9666381 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 _0x3452=['INTEGER','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x1b81d0,_0x1671c1){var _0x32d0b7=function(_0x308e8e){while(--_0x308e8e){_0x1b81d0['push'](_0x1b81d0['shift']());}};_0x32d0b7(++_0x1671c1);}(_0x3452,0x183));var _0x2345=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x3452[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x2345('0x0'));module[_0x2345('0x1')]={'name':{'type':Sequelize[_0x2345('0x2')],'allowNull':![],'unique':_0x2345('0x3')},'version':{'type':Sequelize[_0x2345('0x2')],'allowNull':![],'unique':_0x2345('0x3')},'main':{'type':Sequelize[_0x2345('0x2')],'defaultValue':_0x2345('0x4')},'filename':{'type':Sequelize[_0x2345('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2345('0x2')]},'size':{'type':Sequelize[_0x2345('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x2345('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x2345('0x6')},'description':{'type':Sequelize[_0x2345('0x2')]},'title':{'type':Sequelize[_0x2345('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x2345('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x49d7=['STRING','app.js','INTEGER','BOOLEAN','sequelize'];(function(_0x454aae,_0x4604b6){var _0x58db87=function(_0x2394f8){while(--_0x2394f8){_0x454aae['push'](_0x454aae['shift']());}};_0x58db87(++_0x4604b6);}(_0x49d7,0xfe));var _0x749d=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0x49d7[_0x15797a];return _0x3e2618;};'use strict';var Sequelize=require(_0x749d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x749d('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x749d('0x1')],'defaultValue':_0x749d('0x2')},'filename':{'type':Sequelize[_0x749d('0x1')]},'path':{'type':Sequelize[_0x749d('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x749d('0x3')]},'active':{'type':Sequelize[_0x749d('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x749d('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x749d('0x1')]},'title':{'type':Sequelize[_0x749d('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 5914fdf..346099c 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 _0x4137=['map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index'];(function(_0x262e48,_0x3901de){var _0x1c9b18=function(_0x1f175b){while(--_0x1f175b){_0x262e48['push'](_0x262e48['shift']());}};_0x1c9b18(++_0x3901de);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['Integration'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['Integration']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','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(_0x35c3f2,_0x38abbf){var _0x217cf7=function(_0x33a5df){while(--_0x33a5df){_0x35c3f2['push'](_0x35c3f2['shift']());}};_0x217cf7(++_0x38abbf);}(_0x7a54,0x106));var _0x47a5=function(_0x4784cc,_0x515f72){_0x4784cc=_0x4784cc-0x0;var _0x2f2833=_0x7a54[_0x4784cc];return _0x2f2833;};'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 diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 4862061..968ac3e 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 _0x4c84=['moment','request-promise','rimraf','../../config/environment','./integration.attributes','util'];(function(_0x160b4a,_0xe1b966){var _0x113a76=function(_0x230fe6){while(--_0x230fe6){_0x160b4a['push'](_0x160b4a['shift']());}};_0x113a76(++_0xe1b966);}(_0x4c84,0x179));var _0x44c8=function(_0x5dea55,_0x34d65e){_0x5dea55=_0x5dea55-0x0;var _0x50f672=_0x4c84[_0x5dea55];return _0x50f672;};'use strict';var _=require('lodash');var util=require(_0x44c8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x44c8('0x1'));var BPromise=require('bluebird');var rp=require(_0x44c8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44c8('0x3'));var config=require(_0x44c8('0x4'));var attributes=require(_0x44c8('0x5'));module['exports']=function(_0x5dba66,_0x4462d6){return _0x5dba66['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfab=['Integration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x21eccf,_0x1f036d){var _0x4557a9=function(_0x1fbfd4){while(--_0x1fbfd4){_0x21eccf['push'](_0x21eccf['shift']());}};_0x4557a9(++_0x1f036d);}(_0xdfab,0x140));var _0xbdfa=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xdfab[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0xbdfa('0x0'));var util=require(_0xbdfa('0x1'));var logger=require(_0xbdfa('0x2'))(_0xbdfa('0x3'));var moment=require(_0xbdfa('0x4'));var BPromise=require(_0xbdfa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdfa('0x6'));var rimraf=require(_0xbdfa('0x7'));var config=require(_0xbdfa('0x8'));var attributes=require('./integration.attributes');module[_0xbdfa('0x9')]=function(_0x375fe5,_0x231372){return _0x375fe5['define'](_0xbdfa('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 8eec2f4..2cf2c60 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _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(_0x477fb9,_0x1842ec){var _0xbe047=function(_0x124d20){while(--_0x124d20){_0x477fb9['push'](_0x477fb9['shift']());}};_0xbe047(++_0x1842ec);}(_0x0295,0x1f0));var _0x5029=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x0295[_0x5c1cdc];return _0x2e8317;};'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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index e1ef829..72d8375 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 _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(_0x1d8fed,_0x2a67ae){var _0x2b509a=function(_0x29b72c){while(--_0x29b72c){_0x1d8fed['push'](_0x1d8fed['shift']());}};_0x2b509a(++_0x2a67ae);}(_0x4975,0x86));var _0x5497=function(_0x27db23,_0xac1ffa){_0x27db23=_0x27db23-0x0;var _0x303b52=_0x4975[_0x27db23];return _0x303b52;};'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 +var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x541993,_0x3d49a2){var _0x1ed766=function(_0x34cde2){while(--_0x34cde2){_0x541993['push'](_0x541993['shift']());}};_0x1ed766(++_0x3d49a2);}(_0xef0f,0x168));var _0xfef0=function(_0xf9c51a,_0x2543a4){_0xf9c51a=_0xf9c51a-0x0;var _0x33e910=_0xef0f[_0xf9c51a];return _0x33e910;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 035d59a..f59c9c0 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 _0x5f09=['ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x2f6564,_0xbca1e9){var _0x11ba8b=function(_0x4b93ac){while(--_0x4b93ac){_0x2f6564['push'](_0x2f6564['shift']());}};_0x11ba8b(++_0xbca1e9);}(_0x5f09,0xc5));var _0x95f0=function(_0x3b7575,_0x201e00){_0x3b7575=_0x3b7575-0x0;var _0x3803c1=_0x5f09[_0x3b7575];return _0x3803c1;};'use strict';var Sequelize=require(_0x95f0('0x0'));module[_0x95f0('0x1')]={'integration':{'type':Sequelize[_0x95f0('0x2')]},'eventChannel':{'type':Sequelize[_0x95f0('0x2')]},'exitStatus':{'type':Sequelize[_0x95f0('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x95f0('0x3')]},'contacts':{'type':Sequelize[_0x95f0('0x2')]},'uniqueid':{'type':Sequelize[_0x95f0('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x95f0('0x2')]},'queue':{'type':Sequelize[_0x95f0('0x2')]},'interface':{'type':Sequelize[_0x95f0('0x2')]},'membername':{'type':Sequelize[_0x95f0('0x2')]},'agentcalledAt':{'type':Sequelize[_0x95f0('0x4')]},'agentconnectAt':{'type':Sequelize[_0x95f0('0x4')]},'holdtime':{'type':Sequelize[_0x95f0('0x3')]},'agentcomplete':{'type':Sequelize[_0x95f0('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x95f0('0x3')]},'agentacw':{'type':Sequelize[_0x95f0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x95f0('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x95f0('0x4')]},'agentdump':{'type':Sequelize[_0x95f0('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x95f0('0x4')]},'lastevent':{'type':Sequelize[_0x95f0('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x95f0('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x95f0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x95f0('0x2')]},'accountcode':{'type':Sequelize[_0x95f0('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x95f0('0x2')]},'priority':{'type':Sequelize[_0x95f0('0x2')]},'destchannel':{'type':Sequelize[_0x95f0('0x2')]},'destchannelstate':{'type':Sequelize[_0x95f0('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x95f0('0x2')]},'destcalleridname':{'type':Sequelize[_0x95f0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x95f0('0x2')]},'destaccountcode':{'type':Sequelize[_0x95f0('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x95f0('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x95f0('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x95f0('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x95f0('0x2')]},'cc':{'type':Sequelize[_0x95f0('0x2')]},'attachment':{'type':Sequelize[_0x95f0('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x95f0('0x6')]},'status':{'type':Sequelize[_0x95f0('0x7')](_0x95f0('0x8'),_0x95f0('0x9'),_0x95f0('0xa'),_0x95f0('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x95f0('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x95f0('0x3')]}}; \ No newline at end of file +var _0x6e81=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','sequelize'];(function(_0x2a2e88,_0x3c81bc){var _0x30aedf=function(_0x5db036){while(--_0x5db036){_0x2a2e88['push'](_0x2a2e88['shift']());}};_0x30aedf(++_0x3c81bc);}(_0x6e81,0xbc));var _0x16e8=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x6e81[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x16e8('0x0'));module[_0x16e8('0x1')]={'integration':{'type':Sequelize[_0x16e8('0x2')]},'eventChannel':{'type':Sequelize[_0x16e8('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x16e8('0x2')]},'integrationId':{'type':Sequelize[_0x16e8('0x3')]},'contacts':{'type':Sequelize[_0x16e8('0x2')]},'uniqueid':{'type':Sequelize[_0x16e8('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x16e8('0x2')]},'queue':{'type':Sequelize[_0x16e8('0x2')]},'interface':{'type':Sequelize[_0x16e8('0x2')]},'membername':{'type':Sequelize[_0x16e8('0x2')]},'agentcalledAt':{'type':Sequelize[_0x16e8('0x4')]},'agentconnectAt':{'type':Sequelize[_0x16e8('0x4')]},'holdtime':{'type':Sequelize[_0x16e8('0x3')]},'agentcomplete':{'type':Sequelize[_0x16e8('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x16e8('0x4')]},'talktime':{'type':Sequelize[_0x16e8('0x3')]},'agentacw':{'type':Sequelize[_0x16e8('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x16e8('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x16e8('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x16e8('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x16e8('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x16e8('0x3')]},'channelstatedesc':{'type':Sequelize[_0x16e8('0x2')]},'connectedlinenum':{'type':Sequelize[_0x16e8('0x2')]},'connectedlinename':{'type':Sequelize[_0x16e8('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x16e8('0x2')]},'context':{'type':Sequelize[_0x16e8('0x2')]},'exten':{'type':Sequelize[_0x16e8('0x2')]},'priority':{'type':Sequelize[_0x16e8('0x2')]},'destchannel':{'type':Sequelize[_0x16e8('0x2')]},'destchannelstate':{'type':Sequelize[_0x16e8('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x16e8('0x2')]},'destcalleridname':{'type':Sequelize[_0x16e8('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x16e8('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x16e8('0x2')]},'destlanguage':{'type':Sequelize[_0x16e8('0x2')]},'destaccountcode':{'type':Sequelize[_0x16e8('0x2')]},'destcontext':{'type':Sequelize[_0x16e8('0x2')]},'destexten':{'type':Sequelize[_0x16e8('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x16e8('0x2')]},'messageId':{'type':Sequelize[_0x16e8('0x2')]},'inReplyTo':{'type':Sequelize[_0x16e8('0x2')]},'subject':{'type':Sequelize[_0x16e8('0x2')]},'from':{'type':Sequelize[_0x16e8('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x16e8('0x2')]},'attachment':{'type':Sequelize[_0x16e8('0x6')]},'html':{'type':Sequelize[_0x16e8('0x6')]},'text':{'type':Sequelize[_0x16e8('0x6')]},'status':{'type':Sequelize['ENUM'](_0x16e8('0x7'),_0x16e8('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x16e8('0x2')]},'appdata':{'type':Sequelize[_0x16e8('0x2')]},'projectId':{'type':Sequelize[_0x16e8('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 2a9e494..b04da87 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 _0x357a=['filter','type','VIRTUAL','merge','options','include','rows','show','keys','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick'];(function(_0x3eb1c1,_0x1bb418){var _0x53645a=function(_0x5824b8){while(--_0x5824b8){_0x3eb1c1['push'](_0x3eb1c1['shift']());}};_0x53645a(++_0x1bb418);}(_0x357a,0x1de));var _0xa357=function(_0x2efa6a,_0x178e47){_0x2efa6a=_0x2efa6a-0x0;var _0x312d5e=_0x357a[_0x2efa6a];return _0x312d5e;};'use strict';var emlformat=require(_0xa357('0x0'));var rimraf=require(_0xa357('0x1'));var zipdir=require(_0xa357('0x2'));var jsonpatch=require(_0xa357('0x3'));var rp=require(_0xa357('0x4'));var moment=require(_0xa357('0x5'));var BPromise=require(_0xa357('0x6'));var Mustache=require(_0xa357('0x7'));var util=require(_0xa357('0x8'));var path=require('path');var sox=require(_0xa357('0x9'));var csv=require(_0xa357('0xa'));var ejs=require(_0xa357('0xb'));var fs=require('fs');var fs_extra=require(_0xa357('0xc'));var _=require(_0xa357('0xd'));var squel=require(_0xa357('0xe'));var crypto=require(_0xa357('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa357('0x10'));var toCsv=require(_0xa357('0xa'));var querystring=require(_0xa357('0x11'));var Papa=require('papaparse');var Redis=require(_0xa357('0x12'));var authService=require(_0xa357('0x13'));var qs=require(_0xa357('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa357('0x15'));var utils=require(_0xa357('0x16'));var config=require(_0xa357('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa357('0x18'))['db'];function respondWithStatusCode(_0x33480e,_0xdc9b29){_0xdc9b29=_0xdc9b29||0xcc;return function(_0x293e2d){if(_0x293e2d){return _0x33480e[_0xa357('0x19')](_0xdc9b29);}return _0x33480e[_0xa357('0x1a')](_0xdc9b29)[_0xa357('0x1b')]();};}function respondWithResult(_0xd64664,_0x324623){_0x324623=_0x324623||0xc8;return function(_0x5bc346){if(_0x5bc346){return _0xd64664[_0xa357('0x1a')](_0x324623)[_0xa357('0x1c')](_0x5bc346);}};}function respondWithFilteredResult(_0x50a1e2,_0x5d695b){return function(_0x5835d0){if(_0x5835d0){var _0x835c34=typeof _0x5d695b['offset']===_0xa357('0x1d')&&typeof _0x5d695b[_0xa357('0x1e')]===_0xa357('0x1d');var _0x14a99a=_0x5835d0[_0xa357('0x1f')];var _0x16ce92=_0x835c34?0x0:_0x5d695b[_0xa357('0x20')];var _0x5e92da=_0x835c34?_0x5835d0[_0xa357('0x1f')]:_0x5d695b['offset']+_0x5d695b['limit'];var _0x3fc14f;if(_0x5e92da>=_0x14a99a){_0x5e92da=_0x14a99a;_0x3fc14f=0xc8;}else{_0x3fc14f=0xce;}_0x50a1e2[_0xa357('0x1a')](_0x3fc14f);return _0x50a1e2[_0xa357('0x21')]('Content-Range',_0x16ce92+'-'+_0x5e92da+'/'+_0x14a99a)[_0xa357('0x1c')](_0x5835d0);}return null;};}function patchUpdates(_0x22cf60){return function(_0x486d75){try{jsonpatch[_0xa357('0x22')](_0x486d75,_0x22cf60,!![]);}catch(_0x5892db){return BPromise[_0xa357('0x23')](_0x5892db);}return _0x486d75[_0xa357('0x24')]();};}function saveUpdates(_0x3817f8,_0x4e2f93){return function(_0x1ea27c){if(_0x1ea27c){return _0x1ea27c[_0xa357('0x25')](_0x3817f8)[_0xa357('0x26')](function(_0x4424b3){return _0x4424b3;});}return null;};}function removeEntity(_0x44447b,_0x8334bf){return function(_0x41625b){if(_0x41625b){return _0x41625b[_0xa357('0x27')]()[_0xa357('0x26')](function(){_0x44447b[_0xa357('0x1a')](0xcc)[_0xa357('0x1b')]();});}};}function handleEntityNotFound(_0x334d5d,_0x272ed6){return function(_0xd92fb6){if(!_0xd92fb6){_0x334d5d['sendStatus'](0x194);}return _0xd92fb6;};}function handleError(_0x31ec1f,_0xa3cedf){_0xa3cedf=_0xa3cedf||0x1f4;return function(_0x5317f3){logger['error'](_0x5317f3[_0xa357('0x28')]);if(_0x5317f3[_0xa357('0x29')]){delete _0x5317f3['name'];}_0x31ec1f[_0xa357('0x1a')](_0xa3cedf)[_0xa357('0x2a')](_0x5317f3);};}exports[_0xa357('0x2b')]=function(_0x25db92,_0x84b824){var _0x59f066={},_0x5c2f40={},_0x211643={'count':0x0,'rows':[]};var _0x4a8857=_[_0xa357('0x2c')](db[_0xa357('0x2d')][_0xa357('0x2e')],function(_0x2b291b){return{'name':_0x2b291b[_0xa357('0x2f')],'type':_0x2b291b['type'][_0xa357('0x30')]};});_0x5c2f40[_0xa357('0x31')]=_[_0xa357('0x2c')](_0x4a8857,_0xa357('0x29'));_0x5c2f40[_0xa357('0x32')]=_['keys'](_0x25db92[_0xa357('0x32')]);_0x5c2f40[_0xa357('0x33')]=_['intersection'](_0x5c2f40[_0xa357('0x31')],_0x5c2f40[_0xa357('0x32')]);_0x59f066['attributes']=_[_0xa357('0x34')](_0x5c2f40['model'],qs[_0xa357('0x35')](_0x25db92[_0xa357('0x32')][_0xa357('0x35')]));_0x59f066['attributes']=_0x59f066[_0xa357('0x36')][_0xa357('0x37')]?_0x59f066[_0xa357('0x36')]:_0x5c2f40['model'];if(!_0x25db92['query']['hasOwnProperty'](_0xa357('0x38'))){_0x59f066[_0xa357('0x1e')]=qs[_0xa357('0x1e')](_0x25db92[_0xa357('0x32')][_0xa357('0x1e')]);_0x59f066[_0xa357('0x20')]=qs[_0xa357('0x20')](_0x25db92[_0xa357('0x32')][_0xa357('0x20')]);}_0x59f066[_0xa357('0x39')]=qs['sort'](_0x25db92[_0xa357('0x32')][_0xa357('0x3a')]);_0x59f066[_0xa357('0x3b')]=qs[_0xa357('0x33')](_[_0xa357('0x3c')](_0x25db92[_0xa357('0x32')],_0x5c2f40[_0xa357('0x33')]),_0x4a8857);if(_0x25db92[_0xa357('0x32')][_0xa357('0x3d')]){_0x59f066['where']=_['merge'](_0x59f066[_0xa357('0x3b')],{'$or':_['map'](_0x4a8857,function(_0x230672){if(_0x230672[_0xa357('0x3e')]!==_0xa357('0x3f')){var _0x3cb1ea={};_0x3cb1ea[_0x230672['name']]={'$like':'%'+_0x25db92[_0xa357('0x32')][_0xa357('0x3d')]+'%'};return _0x3cb1ea;}})});}_0x59f066=_[_0xa357('0x40')]({},_0x59f066,_0x25db92[_0xa357('0x41')]);var _0x1bfb27={'where':_0x59f066[_0xa357('0x3b')]};return db[_0xa357('0x2d')][_0xa357('0x1f')](_0x1bfb27)['then'](function(_0x374032){_0x211643[_0xa357('0x1f')]=_0x374032;if(_0x25db92[_0xa357('0x32')]['includeAll']){_0x59f066[_0xa357('0x42')]=[{'all':!![]}];}return db[_0xa357('0x2d')]['findAll'](_0x59f066);})['then'](function(_0x366b06){_0x211643[_0xa357('0x43')]=_0x366b06;return _0x211643;})['then'](respondWithFilteredResult(_0x84b824,_0x59f066))['catch'](handleError(_0x84b824,null));};exports[_0xa357('0x44')]=function(_0x3f620c,_0x20de8e){var _0x523186={'raw':![],'where':{'id':_0x3f620c['params']['id']}},_0x25dc2d={};_0x25dc2d['model']=_[_0xa357('0x45')](db[_0xa357('0x2d')][_0xa357('0x2e')]);_0x25dc2d['query']=_[_0xa357('0x45')](_0x3f620c[_0xa357('0x32')]);_0x25dc2d[_0xa357('0x33')]=_[_0xa357('0x34')](_0x25dc2d[_0xa357('0x31')],_0x25dc2d['query']);_0x523186[_0xa357('0x36')]=_[_0xa357('0x34')](_0x25dc2d[_0xa357('0x31')],qs['fields'](_0x3f620c['query'][_0xa357('0x35')]));_0x523186[_0xa357('0x36')]=_0x523186[_0xa357('0x36')][_0xa357('0x37')]?_0x523186[_0xa357('0x36')]:_0x25dc2d[_0xa357('0x31')];if(_0x3f620c['query'][_0xa357('0x46')]){_0x523186[_0xa357('0x42')]=[{'all':!![]}];}_0x523186=_[_0xa357('0x40')]({},_0x523186,_0x3f620c['options']);return db[_0xa357('0x2d')][_0xa357('0x47')](_0x523186)[_0xa357('0x26')](handleEntityNotFound(_0x20de8e,null))[_0xa357('0x26')](respondWithResult(_0x20de8e,null))[_0xa357('0x48')](handleError(_0x20de8e,null));};exports[_0xa357('0x49')]=function(_0x9cae8e,_0x442927){return db[_0xa357('0x2d')][_0xa357('0x49')](_0x9cae8e[_0xa357('0x4a')],{})[_0xa357('0x26')](respondWithResult(_0x442927,0xc9))[_0xa357('0x48')](handleError(_0x442927,null));};exports[_0xa357('0x25')]=function(_0x55ba78,_0x112b54){if(_0x55ba78[_0xa357('0x4a')]['id']){delete _0x55ba78[_0xa357('0x4a')]['id'];}return db[_0xa357('0x2d')][_0xa357('0x47')]({'where':{'id':_0x55ba78[_0xa357('0x4b')]['id']}})[_0xa357('0x26')](handleEntityNotFound(_0x112b54,null))[_0xa357('0x26')](saveUpdates(_0x55ba78[_0xa357('0x4a')],null))['then'](respondWithResult(_0x112b54,null))[_0xa357('0x48')](handleError(_0x112b54,null));};exports[_0xa357('0x27')]=function(_0x4729a6,_0x1ae769){return db['IntegrationReport'][_0xa357('0x47')]({'where':{'id':_0x4729a6[_0xa357('0x4b')]['id']}})[_0xa357('0x26')](handleEntityNotFound(_0x1ae769,null))[_0xa357('0x26')](removeEntity(_0x1ae769,null))['catch'](handleError(_0x1ae769,null));};exports[_0xa357('0x4c')]=function(_0x2f044e,_0x322f42){return db['IntegrationReport'][_0xa357('0x4c')]()['then'](respondWithResult(_0x322f42,null))['catch'](handleError(_0x322f42,null));}; \ No newline at end of file +var _0x7da4=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','destroy','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','then','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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'];(function(_0x3aac12,_0x5ce4a3){var _0x283857=function(_0x581ab6){while(--_0x581ab6){_0x3aac12['push'](_0x3aac12['shift']());}};_0x283857(++_0x5ce4a3);}(_0x7da4,0x166));var _0x47da=function(_0x31ee7c,_0x1a2c5d){_0x31ee7c=_0x31ee7c-0x0;var _0x35e48e=_0x7da4[_0x31ee7c];return _0x35e48e;};'use strict';var emlformat=require(_0x47da('0x0'));var rimraf=require(_0x47da('0x1'));var zipdir=require(_0x47da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47da('0x3'));var moment=require(_0x47da('0x4'));var BPromise=require(_0x47da('0x5'));var Mustache=require('mustache');var util=require(_0x47da('0x6'));var path=require(_0x47da('0x7'));var sox=require(_0x47da('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47da('0x9'));var _=require(_0x47da('0xa'));var squel=require(_0x47da('0xb'));var crypto=require(_0x47da('0xc'));var jsforce=require(_0x47da('0xd'));var deskjs=require(_0x47da('0xe'));var toCsv=require('to-csv');var querystring=require(_0x47da('0xf'));var Papa=require(_0x47da('0x10'));var Redis=require(_0x47da('0x11'));var authService=require(_0x47da('0x12'));var qs=require(_0x47da('0x13'));var as=require(_0x47da('0x14'));var hardwareService=require(_0x47da('0x15'));var logger=require(_0x47da('0x16'))('api');var utils=require(_0x47da('0x17'));var config=require(_0x47da('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x47da('0x19'))['db'];function respondWithStatusCode(_0xfaef79,_0x3b0c45){_0x3b0c45=_0x3b0c45||0xcc;return function(_0x557304){if(_0x557304){return _0xfaef79[_0x47da('0x1a')](_0x3b0c45);}return _0xfaef79['status'](_0x3b0c45)['end']();};}function respondWithResult(_0x543000,_0x314b9f){_0x314b9f=_0x314b9f||0xc8;return function(_0x395ae8){if(_0x395ae8){return _0x543000['status'](_0x314b9f)[_0x47da('0x1b')](_0x395ae8);}};}function respondWithFilteredResult(_0x5f78cd,_0x31ca25){return function(_0x378fdb){if(_0x378fdb){var _0x25f6be=typeof _0x31ca25[_0x47da('0x1c')]===_0x47da('0x1d')&&typeof _0x31ca25[_0x47da('0x1e')]===_0x47da('0x1d');var _0x38b54b=_0x378fdb[_0x47da('0x1f')];var _0x527cda=_0x25f6be?0x0:_0x31ca25[_0x47da('0x1c')];var _0x2f3f35=_0x25f6be?_0x378fdb['count']:_0x31ca25['offset']+_0x31ca25['limit'];var _0x59e65e;if(_0x2f3f35>=_0x38b54b){_0x2f3f35=_0x38b54b;_0x59e65e=0xc8;}else{_0x59e65e=0xce;}_0x5f78cd[_0x47da('0x20')](_0x59e65e);return _0x5f78cd[_0x47da('0x21')](_0x47da('0x22'),_0x527cda+'-'+_0x2f3f35+'/'+_0x38b54b)[_0x47da('0x1b')](_0x378fdb);}return null;};}function patchUpdates(_0x221e4e){return function(_0x1434d4){try{jsonpatch[_0x47da('0x23')](_0x1434d4,_0x221e4e,!![]);}catch(_0x5e936b){return BPromise['reject'](_0x5e936b);}return _0x1434d4['save']();};}function saveUpdates(_0xeeb0e9,_0x42a7ac){return function(_0x29b7d2){if(_0x29b7d2){return _0x29b7d2[_0x47da('0x24')](_0xeeb0e9)['then'](function(_0x5758ca){return _0x5758ca;});}return null;};}function removeEntity(_0x259ff3,_0x1edf52){return function(_0x23eabf){if(_0x23eabf){return _0x23eabf[_0x47da('0x25')]()['then'](function(){_0x259ff3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ae541,_0x3d9ad8){return function(_0xf614ea){if(!_0xf614ea){_0x3ae541[_0x47da('0x1a')](0x194);}return _0xf614ea;};}function handleError(_0x30ef80,_0x51e2e8){_0x51e2e8=_0x51e2e8||0x1f4;return function(_0x3a2ede){logger['error'](_0x3a2ede[_0x47da('0x26')]);if(_0x3a2ede[_0x47da('0x27')]){delete _0x3a2ede[_0x47da('0x27')];}_0x30ef80[_0x47da('0x20')](_0x51e2e8)[_0x47da('0x28')](_0x3a2ede);};}exports['index']=function(_0x24cccb,_0x18256d){var _0x3c9445={},_0x40bffd={},_0x5dc0a2={'count':0x0,'rows':[]};var _0x4b581b=_[_0x47da('0x29')](db[_0x47da('0x2a')][_0x47da('0x2b')],function(_0x504b27){return{'name':_0x504b27[_0x47da('0x2c')],'type':_0x504b27[_0x47da('0x2d')][_0x47da('0x2e')]};});_0x40bffd['model']=_[_0x47da('0x29')](_0x4b581b,_0x47da('0x27'));_0x40bffd[_0x47da('0x2f')]=_[_0x47da('0x30')](_0x24cccb[_0x47da('0x2f')]);_0x40bffd[_0x47da('0x31')]=_[_0x47da('0x32')](_0x40bffd[_0x47da('0x33')],_0x40bffd['query']);_0x3c9445[_0x47da('0x34')]=_[_0x47da('0x32')](_0x40bffd[_0x47da('0x33')],qs['fields'](_0x24cccb[_0x47da('0x2f')]['fields']));_0x3c9445['attributes']=_0x3c9445[_0x47da('0x34')][_0x47da('0x35')]?_0x3c9445[_0x47da('0x34')]:_0x40bffd[_0x47da('0x33')];if(!_0x24cccb[_0x47da('0x2f')][_0x47da('0x36')](_0x47da('0x37'))){_0x3c9445[_0x47da('0x1e')]=qs[_0x47da('0x1e')](_0x24cccb['query']['limit']);_0x3c9445[_0x47da('0x1c')]=qs[_0x47da('0x1c')](_0x24cccb['query']['offset']);}_0x3c9445[_0x47da('0x38')]=qs[_0x47da('0x39')](_0x24cccb[_0x47da('0x2f')][_0x47da('0x39')]);_0x3c9445[_0x47da('0x3a')]=qs[_0x47da('0x31')](_[_0x47da('0x3b')](_0x24cccb[_0x47da('0x2f')],_0x40bffd['filters']),_0x4b581b);if(_0x24cccb[_0x47da('0x2f')][_0x47da('0x3c')]){_0x3c9445['where']=_[_0x47da('0x3d')](_0x3c9445[_0x47da('0x3a')],{'$or':_[_0x47da('0x29')](_0x4b581b,function(_0x36e035){if(_0x36e035[_0x47da('0x2d')]!==_0x47da('0x3e')){var _0x17fd1b={};_0x17fd1b[_0x36e035[_0x47da('0x27')]]={'$like':'%'+_0x24cccb[_0x47da('0x2f')][_0x47da('0x3c')]+'%'};return _0x17fd1b;}})});}_0x3c9445=_['merge']({},_0x3c9445,_0x24cccb['options']);var _0x54b0ba={'where':_0x3c9445[_0x47da('0x3a')]};return db[_0x47da('0x2a')][_0x47da('0x1f')](_0x54b0ba)['then'](function(_0x2cb9){_0x5dc0a2['count']=_0x2cb9;if(_0x24cccb[_0x47da('0x2f')][_0x47da('0x3f')]){_0x3c9445[_0x47da('0x40')]=[{'all':!![]}];}return db['IntegrationReport'][_0x47da('0x41')](_0x3c9445);})['then'](function(_0x193980){_0x5dc0a2[_0x47da('0x42')]=_0x193980;return _0x5dc0a2;})['then'](respondWithFilteredResult(_0x18256d,_0x3c9445))[_0x47da('0x43')](handleError(_0x18256d,null));};exports[_0x47da('0x44')]=function(_0x49153a,_0x13aa89){var _0x1bbf50={'raw':![],'where':{'id':_0x49153a[_0x47da('0x45')]['id']}},_0xbc25e0={};_0xbc25e0['model']=_[_0x47da('0x30')](db[_0x47da('0x2a')][_0x47da('0x2b')]);_0xbc25e0[_0x47da('0x2f')]=_['keys'](_0x49153a[_0x47da('0x2f')]);_0xbc25e0['filters']=_[_0x47da('0x32')](_0xbc25e0['model'],_0xbc25e0[_0x47da('0x2f')]);_0x1bbf50['attributes']=_[_0x47da('0x32')](_0xbc25e0[_0x47da('0x33')],qs[_0x47da('0x46')](_0x49153a['query'][_0x47da('0x46')]));_0x1bbf50[_0x47da('0x34')]=_0x1bbf50[_0x47da('0x34')]['length']?_0x1bbf50[_0x47da('0x34')]:_0xbc25e0['model'];if(_0x49153a[_0x47da('0x2f')]['includeAll']){_0x1bbf50[_0x47da('0x40')]=[{'all':!![]}];}_0x1bbf50=_['merge']({},_0x1bbf50,_0x49153a['options']);return db[_0x47da('0x2a')]['find'](_0x1bbf50)[_0x47da('0x47')](handleEntityNotFound(_0x13aa89,null))['then'](respondWithResult(_0x13aa89,null))[_0x47da('0x43')](handleError(_0x13aa89,null));};exports[_0x47da('0x48')]=function(_0x591698,_0x46c23b){return db[_0x47da('0x2a')]['create'](_0x591698[_0x47da('0x49')],{})['then'](respondWithResult(_0x46c23b,0xc9))[_0x47da('0x43')](handleError(_0x46c23b,null));};exports['update']=function(_0x31ff14,_0xb8ef9c){if(_0x31ff14['body']['id']){delete _0x31ff14[_0x47da('0x49')]['id'];}return db[_0x47da('0x2a')][_0x47da('0x4a')]({'where':{'id':_0x31ff14['params']['id']}})[_0x47da('0x47')](handleEntityNotFound(_0xb8ef9c,null))[_0x47da('0x47')](saveUpdates(_0x31ff14[_0x47da('0x49')],null))[_0x47da('0x47')](respondWithResult(_0xb8ef9c,null))[_0x47da('0x43')](handleError(_0xb8ef9c,null));};exports[_0x47da('0x25')]=function(_0x176577,_0x3e80ab){return db[_0x47da('0x2a')]['find']({'where':{'id':_0x176577['params']['id']}})[_0x47da('0x47')](handleEntityNotFound(_0x3e80ab,null))['then'](removeEntity(_0x3e80ab,null))[_0x47da('0x43')](handleError(_0x3e80ab,null));};exports[_0x47da('0x4b')]=function(_0x196d6d,_0x4b9c9f){return db[_0x47da('0x2a')][_0x47da('0x4b')]()[_0x47da('0x47')](respondWithResult(_0x4b9c9f,null))[_0x47da('0x43')](handleError(_0x4b9c9f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 67e6b09..c491b74 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 _0x5705=['bluebird','path','rimraf','../../config/environment','define','IntegrationReport','report_integration','../../config/logger','api','moment'];(function(_0x34aa67,_0x20fc55){var _0x38a34c=function(_0x3f4135){while(--_0x3f4135){_0x34aa67['push'](_0x34aa67['shift']());}};_0x38a34c(++_0x20fc55);}(_0x5705,0x16f));var _0x5570=function(_0x3cc4c8,_0x114636){_0x3cc4c8=_0x3cc4c8-0x0;var _0xdc0123=_0x5705[_0x3cc4c8];return _0xdc0123;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5570('0x0'))(_0x5570('0x1'));var moment=require(_0x5570('0x2'));var BPromise=require(_0x5570('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5570('0x4'));var rimraf=require(_0x5570('0x5'));var config=require(_0x5570('0x6'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x5bb898,_0xbc3096){return _0x5bb898[_0x5570('0x7')](_0x5570('0x8'),attributes,{'tableName':_0x5570('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43fe=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','lodash','api','moment','bluebird'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x43fe,0x1c4));var _0xe43f=function(_0x476c31,_0x5a70e8){_0x476c31=_0x476c31-0x0;var _0x13d359=_0x43fe[_0x476c31];return _0x13d359;};'use strict';var _=require(_0xe43f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe43f('0x1'));var moment=require(_0xe43f('0x2'));var BPromise=require(_0xe43f('0x3'));var rp=require(_0xe43f('0x4'));var fs=require('fs');var path=require(_0xe43f('0x5'));var rimraf=require(_0xe43f('0x6'));var config=require(_0xe43f('0x7'));var attributes=require(_0xe43f('0x8'));module[_0xe43f('0x9')]=function(_0x478f61,_0x57c699){return _0x478f61['define'](_0xe43f('0xa'),attributes,{'tableName':_0xe43f('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 724fca5..eb67b1c 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x35618d,_0x3dccea){_0x35618d=_0x35618d-0x0;var _0x2371e4=_0xc2c7[_0x35618d];return _0x2371e4;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0xf494,0x1c6));var _0x4f49=function(_0x25c387,_0xd19c98){_0x25c387=_0x25c387-0x0;var _0x36364a=_0xf494[_0x25c387];return _0x36364a;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8a51f30..071aba6 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 _0xff22=['./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xff22,0x1a0));var _0x2ff2=function(_0x1406eb,_0xdd34e2){_0x1406eb=_0x1406eb-0x0;var _0x15dfd5=_0xff22[_0x1406eb];return _0x15dfd5;};'use strict';var multer=require(_0x2ff2('0x0'));var util=require(_0x2ff2('0x1'));var path=require('path');var timeout=require(_0x2ff2('0x2'));var express=require(_0x2ff2('0x3'));var router=express[_0x2ff2('0x4')]();var fs_extra=require(_0x2ff2('0x5'));var auth=require(_0x2ff2('0x6'));var interaction=require(_0x2ff2('0x7'));var config=require(_0x2ff2('0x8'));var controller=require(_0x2ff2('0x9'));router[_0x2ff2('0xa')]('/',auth['isAuthenticated'](),controller[_0x2ff2('0xb')]);router[_0x2ff2('0xa')](_0x2ff2('0xc'),auth[_0x2ff2('0xd')](),controller[_0x2ff2('0xe')]);router[_0x2ff2('0xa')](_0x2ff2('0xf'),auth['isAuthenticated'](),controller[_0x2ff2('0x10')]);router[_0x2ff2('0x11')]('/',auth[_0x2ff2('0xd')](),controller[_0x2ff2('0x12')]);router[_0x2ff2('0x11')]('/:id/sub_intervals',auth['isAuthenticated'](),controller['addInterval']);router[_0x2ff2('0x11')](_0x2ff2('0x13'),auth[_0x2ff2('0xd')](),controller[_0x2ff2('0x14')]);router[_0x2ff2('0x15')](_0x2ff2('0xc'),auth[_0x2ff2('0xd')](),controller['update']);router[_0x2ff2('0x16')](_0x2ff2('0xc'),auth[_0x2ff2('0xd')](),controller[_0x2ff2('0x17')]);module[_0x2ff2('0x18')]=router; \ No newline at end of file +var _0xa990=['post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals'];(function(_0x1cb04a,_0x5ec117){var _0x172a43=function(_0x41ba46){while(--_0x41ba46){_0x1cb04a['push'](_0x1cb04a['shift']());}};_0x172a43(++_0x5ec117);}(_0xa990,0xc9));var _0x0a99=function(_0x160430,_0xa76382){_0x160430=_0x160430-0x0;var _0x333039=_0xa990[_0x160430];return _0x333039;};'use strict';var multer=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var path=require(_0x0a99('0x2'));var timeout=require(_0x0a99('0x3'));var express=require(_0x0a99('0x4'));var router=express[_0x0a99('0x5')]();var fs_extra=require(_0x0a99('0x6'));var auth=require(_0x0a99('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a99('0x8'));router[_0x0a99('0x9')]('/',auth[_0x0a99('0xa')](),controller[_0x0a99('0xb')]);router[_0x0a99('0x9')](_0x0a99('0xc'),auth[_0x0a99('0xa')](),controller[_0x0a99('0xd')]);router[_0x0a99('0x9')](_0x0a99('0xe'),auth[_0x0a99('0xa')](),controller['getIntervals']);router[_0x0a99('0xf')]('/',auth[_0x0a99('0xa')](),controller['create']);router['post'](_0x0a99('0xe'),auth[_0x0a99('0xa')](),controller[_0x0a99('0x10')]);router[_0x0a99('0xf')](_0x0a99('0x11'),auth['isAuthenticated'](),controller[_0x0a99('0x12')]);router[_0x0a99('0x13')]('/:id',auth[_0x0a99('0xa')](),controller[_0x0a99('0x14')]);router[_0x0a99('0x15')](_0x0a99('0xc'),auth[_0x0a99('0xa')](),controller[_0x0a99('0x16')]);module[_0x0a99('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 393058e..0050953 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 _0xbc08=['exports','STRING','sequelize'];(function(_0x5eb161,_0x18dc89){var _0x217564=function(_0xf6ddf6){while(--_0xf6ddf6){_0x5eb161['push'](_0x5eb161['shift']());}};_0x217564(++_0x18dc89);}(_0xbc08,0xf5));var _0x8bc0=function(_0x437351,_0x709928){_0x437351=_0x437351-0x0;var _0x40f093=_0xbc08[_0x437351];return _0x40f093;};'use strict';var Sequelize=require(_0x8bc0('0x0'));module[_0x8bc0('0x1')]={'name':{'type':Sequelize[_0x8bc0('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8bc0('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x590b=['STRING'];(function(_0x55a81c,_0x397258){var _0x3b6dbb=function(_0x49bec6){while(--_0x49bec6){_0x55a81c['push'](_0x55a81c['shift']());}};_0x3b6dbb(++_0x397258);}(_0x590b,0xe1));var _0xb590=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x590b[_0x3ae2b2];return _0x1dbf00;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb590('0x0')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb590('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 254f2d4..3ae6b6f 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 _0x4df1=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','limit','count','set','json','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','send','index','map','Interval','rawAttributes','type','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','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','addInterval','IntervalId','findOne','order','getIntervals','hasOwnProperty','addIntervals','transaction','findAll'];(function(_0x51d5a1,_0x5dc2f){var _0xbb2e40=function(_0x490983){while(--_0x490983){_0x51d5a1['push'](_0x51d5a1['shift']());}};_0xbb2e40(++_0x5dc2f);}(_0x4df1,0x105));var _0x14df=function(_0x11ae8b,_0x2a0982){_0x11ae8b=_0x11ae8b-0x0;var _0x3209b6=_0x4df1[_0x11ae8b];return _0x3209b6;};'use strict';var emlformat=require(_0x14df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14df('0x1'));var jsonpatch=require(_0x14df('0x2'));var rp=require(_0x14df('0x3'));var moment=require(_0x14df('0x4'));var BPromise=require(_0x14df('0x5'));var Mustache=require(_0x14df('0x6'));var util=require(_0x14df('0x7'));var path=require('path');var sox=require(_0x14df('0x8'));var csv=require(_0x14df('0x9'));var ejs=require(_0x14df('0xa'));var fs=require('fs');var fs_extra=require(_0x14df('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x14df('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x14df('0xd'));var toCsv=require(_0x14df('0x9'));var querystring=require(_0x14df('0xe'));var Papa=require('papaparse');var Redis=require(_0x14df('0xf'));var authService=require(_0x14df('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14df('0x11'));var logger=require(_0x14df('0x12'))(_0x14df('0x13'));var utils=require('../../config/utils');var config=require(_0x14df('0x14'));var licenseUtil=require(_0x14df('0x15'));var db=require(_0x14df('0x16'))['db'];var extensions=require(_0x14df('0x17'));function respondWithStatusCode(_0x383c9e,_0x184451){_0x184451=_0x184451||0xcc;return function(_0xb62a01){if(_0xb62a01){return _0x383c9e[_0x14df('0x18')](_0x184451);}return _0x383c9e[_0x14df('0x19')](_0x184451)[_0x14df('0x1a')]();};}function respondWithResult(_0x2dfc7b,_0x124f3f){_0x124f3f=_0x124f3f||0xc8;return function(_0x2d56d7){if(_0x2d56d7){return _0x2dfc7b[_0x14df('0x19')](_0x124f3f)['json'](_0x2d56d7);}};}function respondWithFilteredResult(_0x26dded,_0x39be2a){return function(_0x532aae){if(_0x532aae){var _0x5de464=typeof _0x39be2a[_0x14df('0x1b')]==='undefined'&&typeof _0x39be2a[_0x14df('0x1c')]==='undefined';var _0x2f6ca0=_0x532aae['count'];var _0x3bd88b=_0x5de464?0x0:_0x39be2a[_0x14df('0x1b')];var _0x3944e=_0x5de464?_0x532aae[_0x14df('0x1d')]:_0x39be2a[_0x14df('0x1b')]+_0x39be2a[_0x14df('0x1c')];var _0x5d0463;if(_0x3944e>=_0x2f6ca0){_0x3944e=_0x2f6ca0;_0x5d0463=0xc8;}else{_0x5d0463=0xce;}_0x26dded['status'](_0x5d0463);return _0x26dded[_0x14df('0x1e')]('Content-Range',_0x3bd88b+'-'+_0x3944e+'/'+_0x2f6ca0)[_0x14df('0x1f')](_0x532aae);}return null;};}function patchUpdates(_0x3df265){return function(_0x4d551c){try{jsonpatch['apply'](_0x4d551c,_0x3df265,!![]);}catch(_0x1cbcdf){return BPromise[_0x14df('0x20')](_0x1cbcdf);}return _0x4d551c[_0x14df('0x21')]();};}function saveUpdates(_0x2f45f0,_0x424c11){return function(_0x5ee7c0){if(_0x5ee7c0){return _0x5ee7c0[_0x14df('0x22')](_0x2f45f0)[_0x14df('0x23')](function(_0x3562e8){return _0x3562e8;});}return null;};}function removeEntity(_0x5d006f,_0x4a705e){return function(_0x4a78d5){if(_0x4a78d5){return _0x4a78d5[_0x14df('0x24')]()[_0x14df('0x23')](function(){var _0x11e0d9=_0x4a78d5[_0x14df('0x25')]({'plain':!![]});var _0x469eb1=_0x14df('0x26');return db[_0x14df('0x27')][_0x14df('0x24')]({'where':{'type':_0x469eb1,'resourceId':_0x11e0d9['id']}})[_0x14df('0x23')](function(){return _0x4a78d5;});})[_0x14df('0x23')](function(){_0x5d006f[_0x14df('0x19')](0xcc)[_0x14df('0x1a')]();});}};}function handleEntityNotFound(_0x1e8a9e,_0x556135){return function(_0x4e539e){if(!_0x4e539e){_0x1e8a9e[_0x14df('0x18')](0x194);}return _0x4e539e;};}function handleError(_0x4c643e,_0x5aa302){_0x5aa302=_0x5aa302||0x1f4;return function(_0x32fc21){logger['error'](_0x32fc21[_0x14df('0x28')]);if(_0x32fc21['name']){delete _0x32fc21['name'];}_0x4c643e[_0x14df('0x19')](_0x5aa302)[_0x14df('0x29')](_0x32fc21);};}exports[_0x14df('0x2a')]=function(_0x9e66fc,_0x34f474){var _0x4b39dc={},_0x392f1d={},_0x393ded={'count':0x0,'rows':[]};var _0x5edd73=_[_0x14df('0x2b')](db[_0x14df('0x2c')][_0x14df('0x2d')],function(_0x59a705){return{'name':_0x59a705['fieldName'],'type':_0x59a705[_0x14df('0x2e')]['key']};});_0x392f1d[_0x14df('0x2f')]=_[_0x14df('0x2b')](_0x5edd73,_0x14df('0x30'));_0x392f1d[_0x14df('0x31')]=_[_0x14df('0x32')](_0x9e66fc[_0x14df('0x31')]);_0x392f1d[_0x14df('0x33')]=_['intersection'](_0x392f1d['model'],_0x392f1d[_0x14df('0x31')]);_0x4b39dc[_0x14df('0x34')]=_[_0x14df('0x35')](_0x392f1d[_0x14df('0x2f')],qs['fields'](_0x9e66fc[_0x14df('0x31')][_0x14df('0x36')]));_0x4b39dc[_0x14df('0x34')]=_0x4b39dc[_0x14df('0x34')][_0x14df('0x37')]?_0x4b39dc['attributes']:_0x392f1d[_0x14df('0x2f')];if(!_0x9e66fc[_0x14df('0x31')]['hasOwnProperty'](_0x14df('0x38'))){_0x4b39dc[_0x14df('0x1c')]=qs[_0x14df('0x1c')](_0x9e66fc[_0x14df('0x31')][_0x14df('0x1c')]);_0x4b39dc[_0x14df('0x1b')]=qs['offset'](_0x9e66fc[_0x14df('0x31')]['offset']);}_0x4b39dc['order']=qs[_0x14df('0x39')](_0x9e66fc[_0x14df('0x31')][_0x14df('0x39')]);_0x4b39dc['where']=qs[_0x14df('0x33')](_[_0x14df('0x3a')](_0x9e66fc[_0x14df('0x31')],_0x392f1d[_0x14df('0x33')]),_0x5edd73);if(_0x9e66fc[_0x14df('0x31')][_0x14df('0x3b')]){_0x4b39dc[_0x14df('0x3c')]=_[_0x14df('0x3d')](_0x4b39dc[_0x14df('0x3c')],{'$or':_['map'](_0x5edd73,function(_0x2e3ec9){if(_0x2e3ec9['type']!==_0x14df('0x3e')){var _0x44c2d5={};_0x44c2d5[_0x2e3ec9['name']]={'$like':'%'+_0x9e66fc[_0x14df('0x31')]['filter']+'%'};return _0x44c2d5;}})});}_0x4b39dc=_[_0x14df('0x3d')]({},_0x4b39dc,_0x9e66fc['options']);var _0x3f4ba5={'where':_0x4b39dc[_0x14df('0x3c')]};return db[_0x14df('0x2c')][_0x14df('0x1d')](_0x3f4ba5)[_0x14df('0x23')](function(_0x1391f8){_0x393ded[_0x14df('0x1d')]=_0x1391f8;if(_0x9e66fc[_0x14df('0x31')][_0x14df('0x3f')]){_0x4b39dc[_0x14df('0x40')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x4b39dc);})[_0x14df('0x23')](function(_0x2c012c){_0x393ded[_0x14df('0x41')]=_0x2c012c;return _0x393ded;})[_0x14df('0x23')](respondWithFilteredResult(_0x34f474,_0x4b39dc))[_0x14df('0x42')](handleError(_0x34f474,null));};exports['show']=function(_0x2a2375,_0xaa3e7d){var _0x59021b={'raw':!![],'where':{'id':_0x2a2375[_0x14df('0x43')]['id']}},_0x393b4e={};_0x393b4e[_0x14df('0x2f')]=_[_0x14df('0x32')](db['Interval'][_0x14df('0x2d')]);_0x393b4e[_0x14df('0x31')]=_[_0x14df('0x32')](_0x2a2375[_0x14df('0x31')]);_0x393b4e['filters']=_[_0x14df('0x35')](_0x393b4e[_0x14df('0x2f')],_0x393b4e[_0x14df('0x31')]);_0x59021b[_0x14df('0x34')]=_[_0x14df('0x35')](_0x393b4e[_0x14df('0x2f')],qs[_0x14df('0x36')](_0x2a2375['query'][_0x14df('0x36')]));_0x59021b[_0x14df('0x34')]=_0x59021b[_0x14df('0x34')]['length']?_0x59021b['attributes']:_0x393b4e[_0x14df('0x2f')];if(_0x2a2375['query'][_0x14df('0x3f')]){_0x59021b[_0x14df('0x40')]=[{'all':!![]}];}_0x59021b=_[_0x14df('0x3d')]({},_0x59021b,_0x2a2375['options']);return db[_0x14df('0x2c')][_0x14df('0x44')](_0x59021b)[_0x14df('0x23')](handleEntityNotFound(_0xaa3e7d,null))[_0x14df('0x23')](respondWithResult(_0xaa3e7d,null))['catch'](handleError(_0xaa3e7d,null));};exports[_0x14df('0x45')]=function(_0x40718c,_0x1ad93b){return db[_0x14df('0x2c')][_0x14df('0x45')](_0x40718c[_0x14df('0x46')],{})['then'](function(_0x299e1b){var _0x151c1a=_0x40718c[_0x14df('0x47')][_0x14df('0x25')]({'plain':!![]});if(!_0x151c1a)throw new Error(_0x14df('0x48'));if(_0x151c1a[_0x14df('0x49')]==='user'){var _0x1e2732=_0x299e1b['get']({'plain':!![]});var _0xc09740=_0x14df('0x26');return db[_0x14df('0x4a')]['find']({'where':{'name':_0xc09740,'userProfileId':_0x151c1a[_0x14df('0x4b')]},'raw':!![]})[_0x14df('0x23')](function(_0x3b39de){if(_0x3b39de&&_0x3b39de[_0x14df('0x4c')]===0x0){return db[_0x14df('0x27')][_0x14df('0x45')]({'name':_0x1e2732[_0x14df('0x30')],'resourceId':_0x1e2732['id'],'type':_0x3b39de[_0x14df('0x30')],'sectionId':_0x3b39de['id']},{})[_0x14df('0x23')](function(){return _0x299e1b;});}else{return _0x299e1b;}})[_0x14df('0x42')](function(_0x1416e3){logger['error'](_0x14df('0x4d'),_0x1416e3);throw _0x1416e3;});}return _0x299e1b;})[_0x14df('0x23')](respondWithResult(_0x1ad93b,0xc9))['catch'](handleError(_0x1ad93b,null));};exports[_0x14df('0x22')]=function(_0x95ae41,_0x15ae61){if(_0x95ae41[_0x14df('0x46')]['id']){delete _0x95ae41[_0x14df('0x46')]['id'];}return db[_0x14df('0x2c')][_0x14df('0x44')]({'where':{'id':_0x95ae41[_0x14df('0x43')]['id']}})['then'](handleEntityNotFound(_0x15ae61,null))[_0x14df('0x23')](saveUpdates(_0x95ae41[_0x14df('0x46')],null))[_0x14df('0x23')](respondWithResult(_0x15ae61,null))[_0x14df('0x42')](handleError(_0x15ae61,null));};exports['destroy']=function(_0x8d283a,_0x53376d){return db[_0x14df('0x2c')][_0x14df('0x44')]({'where':{'id':_0x8d283a[_0x14df('0x43')]['id']}})['then'](handleEntityNotFound(_0x53376d,null))['then'](removeEntity(_0x53376d,null))['catch'](handleError(_0x53376d,null));};exports[_0x14df('0x4e')]=function(_0x44b6ba,_0x1b7f21,_0x562a69){if(_0x44b6ba[_0x14df('0x46')]['id']){delete _0x44b6ba['body']['id'];}return db['Interval']['find']({'where':{'id':_0x44b6ba['params']['id']}})[_0x14df('0x23')](handleEntityNotFound(_0x1b7f21,null))[_0x14df('0x23')](function(_0x41721f){if(_0x41721f){_0x44b6ba[_0x14df('0x46')][_0x14df('0x4f')]=_0x41721f['id'];return db[_0x14df('0x2c')]['create'](_0x44b6ba[_0x14df('0x46')]);}})[_0x14df('0x23')](respondWithResult(_0x1b7f21,null))[_0x14df('0x42')](handleError(_0x1b7f21,null));};exports['getIntervals']=function(_0x4e22ba,_0xce4e11,_0x4ef136){var _0x5de388={};var _0x2b0358={};var _0x2e5fe0;var _0x25e812;return db[_0x14df('0x2c')][_0x14df('0x50')]({'where':{'id':_0x4e22ba[_0x14df('0x43')]['id']}})[_0x14df('0x23')](handleEntityNotFound(_0xce4e11,null))[_0x14df('0x23')](function(_0x4703fe){if(_0x4703fe){_0x2e5fe0=_0x4703fe;_0x2b0358[_0x14df('0x2f')]=_[_0x14df('0x32')](db[_0x14df('0x2c')]['rawAttributes']);_0x2b0358[_0x14df('0x31')]=_['keys'](_0x4e22ba[_0x14df('0x31')]);_0x2b0358[_0x14df('0x33')]=_[_0x14df('0x35')](_0x2b0358[_0x14df('0x2f')],_0x2b0358['query']);_0x5de388[_0x14df('0x34')]=_[_0x14df('0x35')](_0x2b0358[_0x14df('0x2f')],qs[_0x14df('0x36')](_0x4e22ba[_0x14df('0x31')][_0x14df('0x36')]));_0x5de388[_0x14df('0x34')]=_0x5de388[_0x14df('0x34')][_0x14df('0x37')]?_0x5de388['attributes']:_0x2b0358[_0x14df('0x2f')];_0x5de388[_0x14df('0x51')]=qs[_0x14df('0x39')](_0x4e22ba[_0x14df('0x31')][_0x14df('0x39')]);_0x5de388[_0x14df('0x3c')]=qs[_0x14df('0x33')](_[_0x14df('0x3a')](_0x4e22ba[_0x14df('0x31')],_0x2b0358[_0x14df('0x33')]));if(_0x4e22ba['query'][_0x14df('0x3b')]){_0x5de388[_0x14df('0x3c')]=_[_0x14df('0x3d')](_0x5de388[_0x14df('0x3c')],{'$or':_['map'](_0x5de388[_0x14df('0x34')],function(_0x354ab7){var _0x2a9d53={};_0x2a9d53[_0x354ab7]={'$like':'%'+_0x4e22ba['query'][_0x14df('0x3b')]+'%'};return _0x2a9d53;})});}_0x5de388=_[_0x14df('0x3d')]({},_0x5de388,_0x4e22ba['options']);return _0x2e5fe0[_0x14df('0x52')](_0x5de388);}})[_0x14df('0x23')](function(_0x125b52){if(_0x125b52){_0x25e812=_0x125b52[_0x14df('0x37')];if(!_0x4e22ba['query'][_0x14df('0x53')]('nolimit')){_0x5de388[_0x14df('0x1c')]=qs['limit'](_0x4e22ba[_0x14df('0x31')][_0x14df('0x1c')]);_0x5de388[_0x14df('0x1b')]=qs[_0x14df('0x1b')](_0x4e22ba[_0x14df('0x31')][_0x14df('0x1b')]);}return _0x2e5fe0[_0x14df('0x52')](_0x5de388);}})['then'](function(_0x2912ab){if(_0x2912ab){return _0x2912ab?{'count':_0x25e812,'rows':_0x2912ab}:null;}})[_0x14df('0x23')](respondWithResult(_0xce4e11,null))[_0x14df('0x42')](handleError(_0xce4e11,null));};exports[_0x14df('0x54')]=function(_0x223e38,_0x1b1791,_0x3870f9){return db[_0x14df('0x2c')][_0x14df('0x50')]({'where':{'id':_0x223e38[_0x14df('0x43')]['id']}})[_0x14df('0x23')](handleEntityNotFound(_0x1b1791,null))['then'](function(_0x57452f){if(_0x57452f){return db['sequelize'][_0x14df('0x55')](function(_0x51012d){return db[_0x14df('0x2c')][_0x14df('0x24')]({'where':{'IntervalId':_0x223e38[_0x14df('0x43')]['id']},'transaction':_0x51012d})['then'](function(_0x2914bd){var _0x171bcc=_[_0x14df('0x2b')](_0x223e38[_0x14df('0x46')],function(_0x5f53c7){delete _0x5f53c7['id'];_0x5f53c7[_0x14df('0x4f')]=_0x223e38[_0x14df('0x43')]['id'];return _0x5f53c7;});return db['Interval']['bulkCreate'](_0x171bcc,{'transaction':_0x51012d});});})[_0x14df('0x23')](function(){return db[_0x14df('0x2c')][_0x14df('0x56')]({'where':{'IntervalId':_0x223e38[_0x14df('0x43')]['id']}});});}})['then'](respondWithResult(_0x1b1791,null))[_0x14df('0x42')](handleError(_0x1b1791,null));}; \ No newline at end of file +var _0xc40e=['findOne','addIntervals','sequelize','transaction','bulkCreate','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Interval','includeAll','findAll','rows','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','params','IntervalId','getIntervals'];(function(_0x4b6246,_0x17f198){var _0x498803=function(_0x528062){while(--_0x528062){_0x4b6246['push'](_0x4b6246['shift']());}};_0x498803(++_0x17f198);}(_0xc40e,0x199));var _0xec40=function(_0x556b9b,_0x2aeef6){_0x556b9b=_0x556b9b-0x0;var _0x518321=_0xc40e[_0x556b9b];return _0x518321;};'use strict';var emlformat=require(_0xec40('0x0'));var rimraf=require(_0xec40('0x1'));var zipdir=require(_0xec40('0x2'));var jsonpatch=require(_0xec40('0x3'));var rp=require(_0xec40('0x4'));var moment=require(_0xec40('0x5'));var BPromise=require(_0xec40('0x6'));var Mustache=require(_0xec40('0x7'));var util=require(_0xec40('0x8'));var path=require(_0xec40('0x9'));var sox=require(_0xec40('0xa'));var csv=require(_0xec40('0xb'));var ejs=require(_0xec40('0xc'));var fs=require('fs');var fs_extra=require(_0xec40('0xd'));var _=require(_0xec40('0xe'));var squel=require(_0xec40('0xf'));var crypto=require('crypto');var jsforce=require(_0xec40('0x10'));var deskjs=require(_0xec40('0x11'));var toCsv=require(_0xec40('0xb'));var querystring=require('querystring');var Papa=require(_0xec40('0x12'));var Redis=require(_0xec40('0x13'));var authService=require(_0xec40('0x14'));var qs=require(_0xec40('0x15'));var as=require(_0xec40('0x16'));var hardwareService=require(_0xec40('0x17'));var logger=require(_0xec40('0x18'))(_0xec40('0x19'));var utils=require(_0xec40('0x1a'));var config=require(_0xec40('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xec40('0x1c'))['db'];var extensions=require(_0xec40('0x1d'));function respondWithStatusCode(_0x43060f,_0x5ccd7f){_0x5ccd7f=_0x5ccd7f||0xcc;return function(_0x431982){if(_0x431982){return _0x43060f[_0xec40('0x1e')](_0x5ccd7f);}return _0x43060f[_0xec40('0x1f')](_0x5ccd7f)[_0xec40('0x20')]();};}function respondWithResult(_0x486dcf,_0x53ca9f){_0x53ca9f=_0x53ca9f||0xc8;return function(_0x1de9e2){if(_0x1de9e2){return _0x486dcf[_0xec40('0x1f')](_0x53ca9f)[_0xec40('0x21')](_0x1de9e2);}};}function respondWithFilteredResult(_0x1e8927,_0x1d6825){return function(_0x5d7f65){if(_0x5d7f65){var _0x1fa4d0=typeof _0x1d6825['offset']===_0xec40('0x22')&&typeof _0x1d6825[_0xec40('0x23')]==='undefined';var _0x44f853=_0x5d7f65['count'];var _0x4ebabe=_0x1fa4d0?0x0:_0x1d6825[_0xec40('0x24')];var _0x315961=_0x1fa4d0?_0x5d7f65[_0xec40('0x25')]:_0x1d6825['offset']+_0x1d6825[_0xec40('0x23')];var _0x5c0da5;if(_0x315961>=_0x44f853){_0x315961=_0x44f853;_0x5c0da5=0xc8;}else{_0x5c0da5=0xce;}_0x1e8927[_0xec40('0x1f')](_0x5c0da5);return _0x1e8927[_0xec40('0x26')](_0xec40('0x27'),_0x4ebabe+'-'+_0x315961+'/'+_0x44f853)[_0xec40('0x21')](_0x5d7f65);}return null;};}function patchUpdates(_0x3db1af){return function(_0x1af51d){try{jsonpatch[_0xec40('0x28')](_0x1af51d,_0x3db1af,!![]);}catch(_0x114a1d){return BPromise[_0xec40('0x29')](_0x114a1d);}return _0x1af51d[_0xec40('0x2a')]();};}function saveUpdates(_0x22b5ed,_0x40788a){return function(_0x3dd7d3){if(_0x3dd7d3){return _0x3dd7d3[_0xec40('0x2b')](_0x22b5ed)[_0xec40('0x2c')](function(_0x4f1a56){return _0x4f1a56;});}return null;};}function removeEntity(_0x410556,_0x1556eb){return function(_0x488a8d){if(_0x488a8d){return _0x488a8d[_0xec40('0x2d')]()['then'](function(){var _0x349c72=_0x488a8d['get']({'plain':!![]});var _0x554400=_0xec40('0x2e');return db[_0xec40('0x2f')][_0xec40('0x2d')]({'where':{'type':_0x554400,'resourceId':_0x349c72['id']}})[_0xec40('0x2c')](function(){return _0x488a8d;});})[_0xec40('0x2c')](function(){_0x410556['status'](0xcc)[_0xec40('0x20')]();});}};}function handleEntityNotFound(_0x8925fc,_0x14fe03){return function(_0x572532){if(!_0x572532){_0x8925fc['sendStatus'](0x194);}return _0x572532;};}function handleError(_0x27644e,_0x4fb84e){_0x4fb84e=_0x4fb84e||0x1f4;return function(_0x2badd3){logger[_0xec40('0x30')](_0x2badd3[_0xec40('0x31')]);if(_0x2badd3[_0xec40('0x32')]){delete _0x2badd3[_0xec40('0x32')];}_0x27644e['status'](_0x4fb84e)[_0xec40('0x33')](_0x2badd3);};}exports[_0xec40('0x34')]=function(_0x329990,_0x1892aa){var _0x4729e0={},_0x2b550e={},_0x3f9294={'count':0x0,'rows':[]};var _0x313e2c=_[_0xec40('0x35')](db['Interval'][_0xec40('0x36')],function(_0x2416ef){return{'name':_0x2416ef['fieldName'],'type':_0x2416ef[_0xec40('0x37')][_0xec40('0x38')]};});_0x2b550e[_0xec40('0x39')]=_[_0xec40('0x35')](_0x313e2c,_0xec40('0x32'));_0x2b550e['query']=_[_0xec40('0x3a')](_0x329990['query']);_0x2b550e[_0xec40('0x3b')]=_['intersection'](_0x2b550e[_0xec40('0x39')],_0x2b550e['query']);_0x4729e0[_0xec40('0x3c')]=_[_0xec40('0x3d')](_0x2b550e[_0xec40('0x39')],qs[_0xec40('0x3e')](_0x329990[_0xec40('0x3f')]['fields']));_0x4729e0[_0xec40('0x3c')]=_0x4729e0[_0xec40('0x3c')]['length']?_0x4729e0['attributes']:_0x2b550e[_0xec40('0x39')];if(!_0x329990['query'][_0xec40('0x40')](_0xec40('0x41'))){_0x4729e0['limit']=qs['limit'](_0x329990['query'][_0xec40('0x23')]);_0x4729e0[_0xec40('0x24')]=qs[_0xec40('0x24')](_0x329990['query'][_0xec40('0x24')]);}_0x4729e0[_0xec40('0x42')]=qs[_0xec40('0x43')](_0x329990['query'][_0xec40('0x43')]);_0x4729e0[_0xec40('0x44')]=qs[_0xec40('0x3b')](_[_0xec40('0x45')](_0x329990[_0xec40('0x3f')],_0x2b550e[_0xec40('0x3b')]),_0x313e2c);if(_0x329990[_0xec40('0x3f')][_0xec40('0x46')]){_0x4729e0[_0xec40('0x44')]=_[_0xec40('0x47')](_0x4729e0['where'],{'$or':_[_0xec40('0x35')](_0x313e2c,function(_0x1f9050){if(_0x1f9050[_0xec40('0x37')]!==_0xec40('0x48')){var _0x5b33df={};_0x5b33df[_0x1f9050[_0xec40('0x32')]]={'$like':'%'+_0x329990[_0xec40('0x3f')][_0xec40('0x46')]+'%'};return _0x5b33df;}})});}_0x4729e0=_[_0xec40('0x47')]({},_0x4729e0,_0x329990[_0xec40('0x49')]);var _0x5f5956={'where':_0x4729e0[_0xec40('0x44')]};return db[_0xec40('0x4a')][_0xec40('0x25')](_0x5f5956)[_0xec40('0x2c')](function(_0x12dec9){_0x3f9294[_0xec40('0x25')]=_0x12dec9;if(_0x329990[_0xec40('0x3f')][_0xec40('0x4b')]){_0x4729e0['include']=[{'all':!![]}];}return db[_0xec40('0x4a')][_0xec40('0x4c')](_0x4729e0);})['then'](function(_0x353d1f){_0x3f9294[_0xec40('0x4d')]=_0x353d1f;return _0x3f9294;})[_0xec40('0x2c')](respondWithFilteredResult(_0x1892aa,_0x4729e0))['catch'](handleError(_0x1892aa,null));};exports[_0xec40('0x4e')]=function(_0x540e30,_0x36224a){var _0x48f72d={'raw':!![],'where':{'id':_0x540e30['params']['id']}},_0x311b46={};_0x311b46['model']=_[_0xec40('0x3a')](db[_0xec40('0x4a')][_0xec40('0x36')]);_0x311b46['query']=_[_0xec40('0x3a')](_0x540e30[_0xec40('0x3f')]);_0x311b46[_0xec40('0x3b')]=_[_0xec40('0x3d')](_0x311b46[_0xec40('0x39')],_0x311b46['query']);_0x48f72d[_0xec40('0x3c')]=_[_0xec40('0x3d')](_0x311b46['model'],qs[_0xec40('0x3e')](_0x540e30['query'][_0xec40('0x3e')]));_0x48f72d['attributes']=_0x48f72d['attributes'][_0xec40('0x4f')]?_0x48f72d[_0xec40('0x3c')]:_0x311b46[_0xec40('0x39')];if(_0x540e30[_0xec40('0x3f')]['includeAll']){_0x48f72d['include']=[{'all':!![]}];}_0x48f72d=_[_0xec40('0x47')]({},_0x48f72d,_0x540e30[_0xec40('0x49')]);return db['Interval'][_0xec40('0x50')](_0x48f72d)['then'](handleEntityNotFound(_0x36224a,null))[_0xec40('0x2c')](respondWithResult(_0x36224a,null))['catch'](handleError(_0x36224a,null));};exports['create']=function(_0x127125,_0x3aa547){return db['Interval'][_0xec40('0x51')](_0x127125[_0xec40('0x52')],{})[_0xec40('0x2c')](function(_0x4d5e02){var _0x516d2e=_0x127125[_0xec40('0x53')][_0xec40('0x54')]({'plain':!![]});if(!_0x516d2e)throw new Error(_0xec40('0x55'));if(_0x516d2e[_0xec40('0x56')]===_0xec40('0x53')){var _0x405f5e=_0x4d5e02['get']({'plain':!![]});var _0x169404='Intervals';return db[_0xec40('0x57')][_0xec40('0x50')]({'where':{'name':_0x169404,'userProfileId':_0x516d2e[_0xec40('0x58')]},'raw':!![]})[_0xec40('0x2c')](function(_0xa9fab5){if(_0xa9fab5&&_0xa9fab5[_0xec40('0x59')]===0x0){return db[_0xec40('0x2f')][_0xec40('0x51')]({'name':_0x405f5e[_0xec40('0x32')],'resourceId':_0x405f5e['id'],'type':_0xa9fab5[_0xec40('0x32')],'sectionId':_0xa9fab5['id']},{})[_0xec40('0x2c')](function(){return _0x4d5e02;});}else{return _0x4d5e02;}})[_0xec40('0x5a')](function(_0x86c534){logger[_0xec40('0x30')](_0xec40('0x5b'),_0x86c534);throw _0x86c534;});}return _0x4d5e02;})[_0xec40('0x2c')](respondWithResult(_0x3aa547,0xc9))[_0xec40('0x5a')](handleError(_0x3aa547,null));};exports[_0xec40('0x2b')]=function(_0x13b9a1,_0x3d4f0a){if(_0x13b9a1['body']['id']){delete _0x13b9a1[_0xec40('0x52')]['id'];}return db[_0xec40('0x4a')][_0xec40('0x50')]({'where':{'id':_0x13b9a1['params']['id']}})[_0xec40('0x2c')](handleEntityNotFound(_0x3d4f0a,null))[_0xec40('0x2c')](saveUpdates(_0x13b9a1[_0xec40('0x52')],null))[_0xec40('0x2c')](respondWithResult(_0x3d4f0a,null))[_0xec40('0x5a')](handleError(_0x3d4f0a,null));};exports[_0xec40('0x2d')]=function(_0x52e391,_0x7475fa){return db['Interval']['find']({'where':{'id':_0x52e391['params']['id']}})[_0xec40('0x2c')](handleEntityNotFound(_0x7475fa,null))['then'](removeEntity(_0x7475fa,null))['catch'](handleError(_0x7475fa,null));};exports[_0xec40('0x5c')]=function(_0x2cb729,_0x1d5ac5,_0x1b6790){if(_0x2cb729[_0xec40('0x52')]['id']){delete _0x2cb729[_0xec40('0x52')]['id'];}return db[_0xec40('0x4a')][_0xec40('0x50')]({'where':{'id':_0x2cb729[_0xec40('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1d5ac5,null))[_0xec40('0x2c')](function(_0x1e0979){if(_0x1e0979){_0x2cb729[_0xec40('0x52')][_0xec40('0x5e')]=_0x1e0979['id'];return db[_0xec40('0x4a')][_0xec40('0x51')](_0x2cb729[_0xec40('0x52')]);}})['then'](respondWithResult(_0x1d5ac5,null))['catch'](handleError(_0x1d5ac5,null));};exports[_0xec40('0x5f')]=function(_0xf1b056,_0x2c22b9,_0x40fb5c){var _0x5c9452={};var _0x24bb4b={};var _0x2ad714;var _0x176457;return db['Interval'][_0xec40('0x60')]({'where':{'id':_0xf1b056['params']['id']}})[_0xec40('0x2c')](handleEntityNotFound(_0x2c22b9,null))['then'](function(_0x3abc8d){if(_0x3abc8d){_0x2ad714=_0x3abc8d;_0x24bb4b[_0xec40('0x39')]=_['keys'](db[_0xec40('0x4a')][_0xec40('0x36')]);_0x24bb4b[_0xec40('0x3f')]=_['keys'](_0xf1b056[_0xec40('0x3f')]);_0x24bb4b[_0xec40('0x3b')]=_['intersection'](_0x24bb4b[_0xec40('0x39')],_0x24bb4b[_0xec40('0x3f')]);_0x5c9452[_0xec40('0x3c')]=_[_0xec40('0x3d')](_0x24bb4b[_0xec40('0x39')],qs[_0xec40('0x3e')](_0xf1b056[_0xec40('0x3f')][_0xec40('0x3e')]));_0x5c9452[_0xec40('0x3c')]=_0x5c9452['attributes'][_0xec40('0x4f')]?_0x5c9452[_0xec40('0x3c')]:_0x24bb4b['model'];_0x5c9452[_0xec40('0x42')]=qs['sort'](_0xf1b056[_0xec40('0x3f')][_0xec40('0x43')]);_0x5c9452['where']=qs['filters'](_[_0xec40('0x45')](_0xf1b056[_0xec40('0x3f')],_0x24bb4b[_0xec40('0x3b')]));if(_0xf1b056['query'][_0xec40('0x46')]){_0x5c9452[_0xec40('0x44')]=_[_0xec40('0x47')](_0x5c9452[_0xec40('0x44')],{'$or':_['map'](_0x5c9452[_0xec40('0x3c')],function(_0xc9334c){var _0x4bd079={};_0x4bd079[_0xc9334c]={'$like':'%'+_0xf1b056[_0xec40('0x3f')][_0xec40('0x46')]+'%'};return _0x4bd079;})});}_0x5c9452=_['merge']({},_0x5c9452,_0xf1b056[_0xec40('0x49')]);return _0x2ad714[_0xec40('0x5f')](_0x5c9452);}})[_0xec40('0x2c')](function(_0x388949){if(_0x388949){_0x176457=_0x388949[_0xec40('0x4f')];if(!_0xf1b056['query'][_0xec40('0x40')](_0xec40('0x41'))){_0x5c9452[_0xec40('0x23')]=qs[_0xec40('0x23')](_0xf1b056[_0xec40('0x3f')]['limit']);_0x5c9452[_0xec40('0x24')]=qs['offset'](_0xf1b056[_0xec40('0x3f')][_0xec40('0x24')]);}return _0x2ad714['getIntervals'](_0x5c9452);}})[_0xec40('0x2c')](function(_0x5a349a){if(_0x5a349a){return _0x5a349a?{'count':_0x176457,'rows':_0x5a349a}:null;}})['then'](respondWithResult(_0x2c22b9,null))[_0xec40('0x5a')](handleError(_0x2c22b9,null));};exports[_0xec40('0x61')]=function(_0x513f90,_0x1db72a,_0x535737){return db['Interval'][_0xec40('0x60')]({'where':{'id':_0x513f90[_0xec40('0x5d')]['id']}})[_0xec40('0x2c')](handleEntityNotFound(_0x1db72a,null))[_0xec40('0x2c')](function(_0x521fb1){if(_0x521fb1){return db[_0xec40('0x62')][_0xec40('0x63')](function(_0xff7ea1){return db[_0xec40('0x4a')]['destroy']({'where':{'IntervalId':_0x513f90[_0xec40('0x5d')]['id']},'transaction':_0xff7ea1})[_0xec40('0x2c')](function(_0x1908d4){var _0x3b5111=_[_0xec40('0x35')](_0x513f90[_0xec40('0x52')],function(_0x5e6ce6){delete _0x5e6ce6['id'];_0x5e6ce6[_0xec40('0x5e')]=_0x513f90['params']['id'];return _0x5e6ce6;});return db[_0xec40('0x4a')][_0xec40('0x64')](_0x3b5111,{'transaction':_0xff7ea1});});})[_0xec40('0x2c')](function(){return db[_0xec40('0x4a')][_0xec40('0x4c')]({'where':{'IntervalId':_0x513f90[_0xec40('0x5d')]['id']}});});}})[_0xec40('0x2c')](respondWithResult(_0x1db72a,null))[_0xec40('0x5a')](handleError(_0x1db72a,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ebdd510..bc4da4a 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 _0x8450=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','rewrite','lodash'];(function(_0x1f23b1,_0x57c83f){var _0x3c9197=function(_0x2f6e4a){while(--_0x2f6e4a){_0x1f23b1['push'](_0x1f23b1['shift']());}};_0x3c9197(++_0x57c83f);}(_0x8450,0x137));var _0x0845=function(_0x14f5e5,_0x3588af){_0x14f5e5=_0x14f5e5-0x0;var _0x4e9f93=_0x8450[_0x14f5e5];return _0x4e9f93;};'use strict';var _=require(_0x0845('0x0'));var util=require(_0x0845('0x1'));var logger=require(_0x0845('0x2'))(_0x0845('0x3'));var moment=require(_0x0845('0x4'));var BPromise=require(_0x0845('0x5'));var rp=require(_0x0845('0x6'));var fs=require('fs');var path=require(_0x0845('0x7'));var rimraf=require(_0x0845('0x8'));var config=require(_0x0845('0x9'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x0845('0xa')]=function(_0x522c11,_0x33ef06){return _0x522c11['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x9732d6,_0x57eec7){extensions[_0x0845('0xb')](_0x522c11,_0x9732d6);},'afterBulkCreate':function(_0x48c6b0,_0x4a23c2,_0x4fd6fd){_0x4fd6fd();extensions['rewrite'](_0x522c11,_0x48c6b0[0x0]);},'afterUpdate':function(_0x5980bd,_0x3d0b33){extensions[_0x0845('0xb')](_0x522c11,_0x5980bd);},'afterDestroy':function(_0x12f635,_0xf2a910){extensions[_0x0845('0xb')](_0x522c11,_0x12f635);}}});}; \ No newline at end of file +var _0xec86=['rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','Interval','tools_intervals'];(function(_0x37cd56,_0x49d747){var _0x497e08=function(_0x2deb2d){while(--_0x2deb2d){_0x37cd56['push'](_0x37cd56['shift']());}};_0x497e08(++_0x49d747);}(_0xec86,0xa9));var _0x6ec8=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xec86[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x6ec8('0x0'));var util=require('util');var logger=require(_0x6ec8('0x1'))(_0x6ec8('0x2'));var moment=require(_0x6ec8('0x3'));var BPromise=require(_0x6ec8('0x4'));var rp=require(_0x6ec8('0x5'));var fs=require('fs');var path=require(_0x6ec8('0x6'));var rimraf=require(_0x6ec8('0x7'));var config=require(_0x6ec8('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x6ec8('0x9'));module[_0x6ec8('0xa')]=function(_0x472fca,_0x563852){return _0x472fca['define'](_0x6ec8('0xb'),attributes,{'tableName':_0x6ec8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x32bda3,_0x32423e){extensions['rewrite'](_0x472fca,_0x32bda3);},'afterBulkCreate':function(_0x5e92ef,_0x1a5077,_0x5366d1){_0x5366d1();extensions[_0x6ec8('0xd')](_0x472fca,_0x5e92ef[0x0]);},'afterUpdate':function(_0x5d5505,_0x554bd8){extensions[_0x6ec8('0xd')](_0x472fca,_0x5d5505);},'afterDestroy':function(_0x1c60a0,_0x359628){extensions[_0x6ec8('0xd')](_0x472fca,_0x1c60a0);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8911e76..c9783f7 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(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_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 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 e4d80c2..1eb66af 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x40fb0d,_0x1b27b6){var _0x23f23f=function(_0x457375){while(--_0x457375){_0x40fb0d['push'](_0x40fb0d['shift']());}};_0x23f23f(++_0x1b27b6);}(_0x2ef3,0xba));var _0x32ef=function(_0x594cdb,_0x43b733){_0x594cdb=_0x594cdb-0x0;var _0x250d72=_0x2ef3[_0x594cdb];return _0x250d72;};'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 e6319e4..6860a4e 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 _0x0bfb=['stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','json','error','api.jira','write','openIssue','send','body','connection','remoteAddress','socket','bluebird','../../config/logger','api','3eAmWpBVP0','summary','Report','description'];(function(_0x58efb6,_0x30d3cd){var _0x8951e1=function(_0x3aae00){while(--_0x3aae00){_0x58efb6['push'](_0x58efb6['shift']());}};_0x8951e1(++_0x30d3cd);}(_0x0bfb,0x17c));var _0xb0bf=function(_0xa6d522,_0x23c878){_0xa6d522=_0xa6d522-0x0;var _0x275af4=_0x0bfb[_0xa6d522];return _0x275af4;};'use strict';var BPromise=require(_0xb0bf('0x0'));var https=require('https');var logger=require(_0xb0bf('0x1'))(_0xb0bf('0x2'));var USERNAME='support';var PASSWORD=_0xb0bf('0x3');function openIssue(_0x2c05a6,_0x7c9263){var _0xba8a63={'fields':{'project':{'key':_0x2c05a6['key']||'MOTGUI'},'summary':(_0x2c05a6[_0xb0bf('0x4')]||_0xb0bf('0x5'))+'\x20from\x20'+_0x2c05a6['ip'],'description':_0x2c05a6[_0xb0bf('0x6')]||JSON[_0xb0bf('0x7')](_0x2c05a6),'issuetype':{'name':_0x2c05a6[_0xb0bf('0x8')]||_0xb0bf('0x9')}}};_0xba8a63[_0xb0bf('0xa')][_0xb0bf('0xb')]=_0x2c05a6[_0xb0bf('0xc')];_0xba8a63['fields'][_0xb0bf('0xd')]=_0x2c05a6[_0xb0bf('0xe')];_0xba8a63[_0xb0bf('0xa')][_0xb0bf('0xf')]=_0x2c05a6[_0xb0bf('0x10')];_0xba8a63[_0xb0bf('0xa')][_0xb0bf('0x11')]=_0x2c05a6[_0xb0bf('0x12')];_0xba8a63['fields'][_0xb0bf('0x13')]=_0x2c05a6['reason'];_0xba8a63[_0xb0bf('0xa')][_0xb0bf('0x14')]=_0x2c05a6['ip'];var _0x4e3a88={'host':_0xb0bf('0x15'),'port':0x1bb,'path':_0xb0bf('0x16'),'method':_0xb0bf('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xb0bf('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xb0bf('0x19'))}};var _0x101365=JSON[_0xb0bf('0x7')](_0xba8a63);var _0x4cb5e1=https[_0xb0bf('0x1a')](_0x4e3a88,function(_0x481b0b){_0x481b0b[_0xb0bf('0x1b')](_0xb0bf('0x1c'));var _0x5abfce='';_0x481b0b['on'](_0xb0bf('0x1d'),function(_0x50164d){_0x5abfce+=_0x50164d;});_0x481b0b['on'](_0xb0bf('0x1e'),function(){if(_0x7c9263){return _0x7c9263[_0xb0bf('0x1f')](_0x481b0b[_0xb0bf('0x20')])[_0xb0bf('0x21')](JSON['parse'](_0x5abfce));}});});_0x4cb5e1['on'](_0xb0bf('0x22'),function(_0x55b96b){if(_0x7c9263){return _0x7c9263['status'](0x1f4)[_0xb0bf('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb0bf('0x23')}]});}});_0x4cb5e1[_0xb0bf('0x24')](_0x101365);_0x4cb5e1[_0xb0bf('0x1e')]();}exports[_0xb0bf('0x25')]=openIssue;exports[_0xb0bf('0x26')]=function(_0x25906f,_0x3e3c22){_0x25906f[_0xb0bf('0x27')]['ip']=_0x25906f['headers']['x-forwarded-for']||_0x25906f[_0xb0bf('0x28')][_0xb0bf('0x29')]||_0x25906f[_0xb0bf('0x2a')][_0xb0bf('0x29')]||_0x25906f[_0xb0bf('0x28')][_0xb0bf('0x2a')][_0xb0bf('0x29')];return openIssue(_0x25906f['body'],_0x3e3c22);}; \ No newline at end of file +var _0x6696=['https','api','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','toString','base64','stringify','request','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6696,0x133));var _0x6669=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6696[_0x580576];return _0x3f55a0;};'use strict';var BPromise=require(_0x6669('0x0'));var https=require(_0x6669('0x1'));var logger=require('../../config/logger')(_0x6669('0x2'));var USERNAME='support';var PASSWORD=_0x6669('0x3');function openIssue(_0x432458,_0x18cd31){var _0x59f646={'fields':{'project':{'key':_0x432458['key']||_0x6669('0x4')},'summary':(_0x432458[_0x6669('0x5')]||_0x6669('0x6'))+_0x6669('0x7')+_0x432458['ip'],'description':_0x432458['description']||JSON['stringify'](_0x432458),'issuetype':{'name':_0x432458[_0x6669('0x8')]||_0x6669('0x9')}}};_0x59f646[_0x6669('0xa')][_0x6669('0xb')]=_0x432458[_0x6669('0xc')];_0x59f646[_0x6669('0xa')][_0x6669('0xd')]=_0x432458[_0x6669('0xe')];_0x59f646[_0x6669('0xa')][_0x6669('0xf')]=_0x432458['newToken'];_0x59f646[_0x6669('0xa')][_0x6669('0x10')]=_0x432458[_0x6669('0x11')];_0x59f646[_0x6669('0xa')]['customfield_11504']=_0x432458[_0x6669('0x12')];_0x59f646[_0x6669('0xa')][_0x6669('0x13')]=_0x432458['ip'];var _0x21f1cb={'host':_0x6669('0x14'),'port':0x1bb,'path':_0x6669('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x6669('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6669('0x17')](_0x6669('0x18'))}};var _0x1629ec=JSON[_0x6669('0x19')](_0x59f646);var _0x21cd31=https[_0x6669('0x1a')](_0x21f1cb,function(_0x8acc1b){_0x8acc1b['setEncoding'](_0x6669('0x1b'));var _0x37f27f='';_0x8acc1b['on'](_0x6669('0x1c'),function(_0x4f3512){_0x37f27f+=_0x4f3512;});_0x8acc1b['on'](_0x6669('0x1d'),function(){if(_0x18cd31){return _0x18cd31[_0x6669('0x1e')](_0x8acc1b[_0x6669('0x1f')])[_0x6669('0x20')](JSON[_0x6669('0x21')](_0x37f27f));}});});_0x21cd31['on'](_0x6669('0x22'),function(_0x27d18f){if(_0x18cd31){return _0x18cd31[_0x6669('0x1e')](0x1f4)[_0x6669('0x20')]({'errors':[{'message':_0x6669('0x23'),'type':_0x6669('0x24')}]});}});_0x21cd31['write'](_0x1629ec);_0x21cd31[_0x6669('0x1d')]();}exports[_0x6669('0x25')]=openIssue;exports[_0x6669('0x26')]=function(_0x4c0c82,_0x38360c){_0x4c0c82[_0x6669('0x27')]['ip']=_0x4c0c82['headers'][_0x6669('0x28')]||_0x4c0c82[_0x6669('0x29')][_0x6669('0x2a')]||_0x4c0c82[_0x6669('0x2b')][_0x6669('0x2a')]||_0x4c0c82[_0x6669('0x29')]['socket'][_0x6669('0x2a')];return openIssue(_0x4c0c82[_0x6669('0x27')],_0x38360c);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index c502f29..8e63f78 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x297880,_0x56310f){var _0x416760=function(_0x25425e){while(--_0x25425e){_0x297880['push'](_0x297880['shift']());}};_0x416760(++_0x56310f);}(_0xe706,0xa3));var _0x6e70=function(_0x3e7b5a,_0x4c06fe){_0x3e7b5a=_0x3e7b5a-0x0;var _0x4880aa=_0xe706[_0x3e7b5a];return _0x4880aa;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c76,0x184));var _0x66c7=function(_0x24cf49,_0x186694){_0x24cf49=_0x24cf49-0x0;var _0x11911e=_0x6c76[_0x24cf49];return _0x11911e;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index bdae4c9..8349706 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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0xb83075,_0x173ed0){_0xb83075=_0xb83075-0x0;var _0x1a8906=_0x7a54[_0xb83075];return _0x1a8906;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x3ed7e8,_0x39bf9d){_0x3ed7e8=_0x3ed7e8-0x0;var _0x21e715=_0x7a54[_0x3ed7e8];return _0x21e715;};'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 f58b725..f1ba864 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 _0x2d2c=['name','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0x2d2c[_0xcdac34];return _0x269d23;};'use strict';var emlformat=require(_0xc2d2('0x0'));var rimraf=require(_0xc2d2('0x1'));var zipdir=require(_0xc2d2('0x2'));var jsonpatch=require(_0xc2d2('0x3'));var rp=require(_0xc2d2('0x4'));var moment=require(_0xc2d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc2d2('0x6'));var util=require('util');var path=require(_0xc2d2('0x7'));var sox=require(_0xc2d2('0x8'));var csv=require(_0xc2d2('0x9'));var ejs=require(_0xc2d2('0xa'));var fs=require('fs');var fs_extra=require(_0xc2d2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc2d2('0xc'));var jsforce=require(_0xc2d2('0xd'));var deskjs=require(_0xc2d2('0xe'));var toCsv=require(_0xc2d2('0x9'));var querystring=require(_0xc2d2('0xf'));var Papa=require(_0xc2d2('0x10'));var Redis=require(_0xc2d2('0x11'));var authService=require(_0xc2d2('0x12'));var qs=require(_0xc2d2('0x13'));var as=require(_0xc2d2('0x14'));var hardwareService=require(_0xc2d2('0x15'));var logger=require(_0xc2d2('0x16'))('api');var utils=require(_0xc2d2('0x17'));var config=require(_0xc2d2('0x18'));var licenseUtil=require(_0xc2d2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273269,_0x738877){_0x738877=_0x738877||0xcc;return function(_0x4c2b12){if(_0x4c2b12){return _0x273269[_0xc2d2('0x1a')](_0x738877);}return _0x273269[_0xc2d2('0x1b')](_0x738877)['end']();};}function respondWithResult(_0xa6f836,_0x4de52a){_0x4de52a=_0x4de52a||0xc8;return function(_0x5a1d24){if(_0x5a1d24){return _0xa6f836[_0xc2d2('0x1b')](_0x4de52a)[_0xc2d2('0x1c')](_0x5a1d24);}};}function respondWithFilteredResult(_0xf6bc66,_0x4006f3){return function(_0x2c42a6){if(_0x2c42a6){var _0x37552b=typeof _0x4006f3[_0xc2d2('0x1d')]===_0xc2d2('0x1e')&&typeof _0x4006f3[_0xc2d2('0x1f')]===_0xc2d2('0x1e');var _0x403d51=_0x2c42a6['count'];var _0x2d4ec4=_0x37552b?0x0:_0x4006f3[_0xc2d2('0x1d')];var _0x34f750=_0x37552b?_0x2c42a6[_0xc2d2('0x20')]:_0x4006f3['offset']+_0x4006f3[_0xc2d2('0x1f')];var _0x18cef7;if(_0x34f750>=_0x403d51){_0x34f750=_0x403d51;_0x18cef7=0xc8;}else{_0x18cef7=0xce;}_0xf6bc66['status'](_0x18cef7);return _0xf6bc66[_0xc2d2('0x21')](_0xc2d2('0x22'),_0x2d4ec4+'-'+_0x34f750+'/'+_0x403d51)[_0xc2d2('0x1c')](_0x2c42a6);}return null;};}function patchUpdates(_0xb14bc3){return function(_0x603323){try{jsonpatch['apply'](_0x603323,_0xb14bc3,!![]);}catch(_0x100d5b){return BPromise[_0xc2d2('0x23')](_0x100d5b);}return _0x603323['save']();};}function saveUpdates(_0x2cac91,_0x4e3cb5){return function(_0x5ecf78){if(_0x5ecf78){return _0x5ecf78['update'](_0x2cac91)[_0xc2d2('0x24')](function(_0x1bdcb5){return _0x1bdcb5;});}return null;};}function removeEntity(_0x7ffb28,_0x4b3449){return function(_0x2dbc46){if(_0x2dbc46){return _0x2dbc46[_0xc2d2('0x25')]()[_0xc2d2('0x24')](function(){_0x7ffb28[_0xc2d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b201,_0x25e6af){return function(_0xf2ba15){if(!_0xf2ba15){_0x25b201[_0xc2d2('0x1a')](0x194);}return _0xf2ba15;};}function handleError(_0x1a11d2,_0x1c14e5){_0x1c14e5=_0x1c14e5||0x1f4;return function(_0x49e955){logger[_0xc2d2('0x26')](_0x49e955[_0xc2d2('0x27')]);if(_0x49e955[_0xc2d2('0x28')]){delete _0x49e955[_0xc2d2('0x28')];}_0x1a11d2['status'](_0x1c14e5)['send'](_0x49e955);};}exports[_0xc2d2('0x29')]=function(_0x7b75f4,_0x1f3b66){var _0x21ca37={},_0x402337={},_0x460379={'count':0x0,'rows':[]};var _0x4d4af2=_[_0xc2d2('0x2a')](db[_0xc2d2('0x2b')]['rawAttributes'],function(_0x29cae5){return{'name':_0x29cae5[_0xc2d2('0x2c')],'type':_0x29cae5[_0xc2d2('0x2d')][_0xc2d2('0x2e')]};});_0x402337[_0xc2d2('0x2f')]=_['map'](_0x4d4af2,'name');_0x402337[_0xc2d2('0x30')]=_['keys'](_0x7b75f4[_0xc2d2('0x30')]);_0x402337[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],_0x402337[_0xc2d2('0x30')]);_0x21ca37['attributes']=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],qs[_0xc2d2('0x33')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x21ca37[_0xc2d2('0x34')]=_0x21ca37['attributes'][_0xc2d2('0x35')]?_0x21ca37[_0xc2d2('0x34')]:_0x402337['model'];if(!_0x7b75f4[_0xc2d2('0x30')]['hasOwnProperty'](_0xc2d2('0x36'))){_0x21ca37[_0xc2d2('0x1f')]=qs[_0xc2d2('0x1f')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x1f')]);_0x21ca37[_0xc2d2('0x1d')]=qs[_0xc2d2('0x1d')](_0x7b75f4[_0xc2d2('0x30')]['offset']);}_0x21ca37[_0xc2d2('0x37')]=qs[_0xc2d2('0x38')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x38')]);_0x21ca37['where']=qs[_0xc2d2('0x31')](_[_0xc2d2('0x39')](_0x7b75f4[_0xc2d2('0x30')],_0x402337[_0xc2d2('0x31')]),_0x4d4af2);if(_0x7b75f4['query'][_0xc2d2('0x3a')]){_0x21ca37['where']=_[_0xc2d2('0x3b')](_0x21ca37[_0xc2d2('0x3c')],{'$or':_['map'](_0x4d4af2,function(_0xdbdce0){if(_0xdbdce0[_0xc2d2('0x2d')]!==_0xc2d2('0x3d')){var _0x29d04b={};_0x29d04b[_0xdbdce0[_0xc2d2('0x28')]]={'$like':'%'+_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x3a')]+'%'};return _0x29d04b;}})});}_0x21ca37=_[_0xc2d2('0x3b')]({},_0x21ca37,_0x7b75f4[_0xc2d2('0x3e')]);var _0x49d900={'where':_0x21ca37['where']};return db[_0xc2d2('0x2b')][_0xc2d2('0x20')](_0x49d900)['then'](function(_0xfd3ad4){_0x460379[_0xc2d2('0x20')]=_0xfd3ad4;if(_0x7b75f4[_0xc2d2('0x30')]['includeAll']){_0x21ca37['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc2d2('0x3f')](_0x21ca37);})[_0xc2d2('0x24')](function(_0x4031d0){_0x460379[_0xc2d2('0x40')]=_0x4031d0;return _0x460379;})['then'](respondWithFilteredResult(_0x1f3b66,_0x21ca37))[_0xc2d2('0x41')](handleError(_0x1f3b66,null));};exports['show']=function(_0x582edb,_0x24544e){var _0x2a987a={'raw':!![],'where':{'id':_0x582edb['params']['id']}},_0x386a39={};_0x386a39[_0xc2d2('0x2f')]=_[_0xc2d2('0x42')](db[_0xc2d2('0x2b')]['rawAttributes']);_0x386a39[_0xc2d2('0x30')]=_['keys'](_0x582edb[_0xc2d2('0x30')]);_0x386a39[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x386a39[_0xc2d2('0x2f')],_0x386a39[_0xc2d2('0x30')]);_0x2a987a[_0xc2d2('0x34')]=_['intersection'](_0x386a39[_0xc2d2('0x2f')],qs['fields'](_0x582edb[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x2a987a[_0xc2d2('0x34')]=_0x2a987a[_0xc2d2('0x34')][_0xc2d2('0x35')]?_0x2a987a['attributes']:_0x386a39[_0xc2d2('0x2f')];if(_0x582edb[_0xc2d2('0x30')]['includeAll']){_0x2a987a['include']=[{'all':!![]}];}_0x2a987a=_['merge']({},_0x2a987a,_0x582edb['options']);return db[_0xc2d2('0x2b')][_0xc2d2('0x43')](_0x2a987a)[_0xc2d2('0x24')](handleEntityNotFound(_0x24544e,null))[_0xc2d2('0x24')](respondWithResult(_0x24544e,null))[_0xc2d2('0x41')](handleError(_0x24544e,null));};exports[_0xc2d2('0x44')]=function(_0x1146cb,_0x3b795a){return db[_0xc2d2('0x2b')][_0xc2d2('0x44')](_0x1146cb[_0xc2d2('0x45')],{})[_0xc2d2('0x24')](respondWithResult(_0x3b795a,0xc9))['catch'](handleError(_0x3b795a,null));};exports[_0xc2d2('0x46')]=function(_0x4181dc,_0x572764){if(_0x4181dc[_0xc2d2('0x45')]['id']){delete _0x4181dc['body']['id'];}return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x4181dc[_0xc2d2('0x47')]['id']}})[_0xc2d2('0x24')](handleEntityNotFound(_0x572764,null))['then'](saveUpdates(_0x4181dc[_0xc2d2('0x45')],null))[_0xc2d2('0x24')](respondWithResult(_0x572764,null))[_0xc2d2('0x41')](handleError(_0x572764,null));};exports[_0xc2d2('0x25')]=function(_0x3b61ef,_0x4765f9){return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x3b61ef[_0xc2d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4765f9,null))['then'](removeEntity(_0x4765f9,null))[_0xc2d2('0x41')](handleError(_0x4765f9,null));};exports[_0xc2d2('0x48')]=function(_0x472299,_0x1827c3){return db[_0xc2d2('0x2b')]['describe']()[_0xc2d2('0x24')](respondWithResult(_0x1827c3,null))[_0xc2d2('0x41')](handleError(_0x1827c3,null));}; \ No newline at end of file +var _0x0fda=['limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','index','map','JscriptyAnswerReport','fieldName','type','key','name','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x19e2c8,_0x49a229){var _0x39364c=function(_0x13e671){while(--_0x13e671){_0x19e2c8['push'](_0x19e2c8['shift']());}};_0x39364c(++_0x49a229);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x415873,_0xe6f334){_0x415873=_0x415873-0x0;var _0x55b4d5=_0x0fda[_0x415873];return _0x55b4d5;};'use strict';var emlformat=require(_0xa0fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0fd('0x1'));var jsonpatch=require(_0xa0fd('0x2'));var rp=require(_0xa0fd('0x3'));var moment=require(_0xa0fd('0x4'));var BPromise=require(_0xa0fd('0x5'));var Mustache=require(_0xa0fd('0x6'));var util=require(_0xa0fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa0fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0fd('0x9'));var squel=require(_0xa0fd('0xa'));var crypto=require(_0xa0fd('0xb'));var jsforce=require(_0xa0fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa0fd('0x8'));var querystring=require(_0xa0fd('0xd'));var Papa=require(_0xa0fd('0xe'));var Redis=require(_0xa0fd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa0fd('0x10'));var as=require(_0xa0fd('0x11'));var hardwareService=require(_0xa0fd('0x12'));var logger=require('../../config/logger')(_0xa0fd('0x13'));var utils=require(_0xa0fd('0x14'));var config=require(_0xa0fd('0x15'));var licenseUtil=require(_0xa0fd('0x16'));var db=require(_0xa0fd('0x17'))['db'];function respondWithStatusCode(_0x4d5c32,_0x490112){_0x490112=_0x490112||0xcc;return function(_0x32dcee){if(_0x32dcee){return _0x4d5c32[_0xa0fd('0x18')](_0x490112);}return _0x4d5c32['status'](_0x490112)[_0xa0fd('0x19')]();};}function respondWithResult(_0x8a67a5,_0x11e4eb){_0x11e4eb=_0x11e4eb||0xc8;return function(_0x1e4a48){if(_0x1e4a48){return _0x8a67a5[_0xa0fd('0x1a')](_0x11e4eb)[_0xa0fd('0x1b')](_0x1e4a48);}};}function respondWithFilteredResult(_0x2811c0,_0x4fe62c){return function(_0x1c6ffc){if(_0x1c6ffc){var _0x326ba8=typeof _0x4fe62c['offset']==='undefined'&&typeof _0x4fe62c[_0xa0fd('0x1c')]===_0xa0fd('0x1d');var _0x5d2d7b=_0x1c6ffc[_0xa0fd('0x1e')];var _0x22a876=_0x326ba8?0x0:_0x4fe62c[_0xa0fd('0x1f')];var _0x5073a8=_0x326ba8?_0x1c6ffc['count']:_0x4fe62c[_0xa0fd('0x1f')]+_0x4fe62c['limit'];var _0x40e288;if(_0x5073a8>=_0x5d2d7b){_0x5073a8=_0x5d2d7b;_0x40e288=0xc8;}else{_0x40e288=0xce;}_0x2811c0[_0xa0fd('0x1a')](_0x40e288);return _0x2811c0[_0xa0fd('0x20')](_0xa0fd('0x21'),_0x22a876+'-'+_0x5073a8+'/'+_0x5d2d7b)[_0xa0fd('0x1b')](_0x1c6ffc);}return null;};}function patchUpdates(_0x2273f4){return function(_0x113059){try{jsonpatch['apply'](_0x113059,_0x2273f4,!![]);}catch(_0x166934){return BPromise[_0xa0fd('0x22')](_0x166934);}return _0x113059[_0xa0fd('0x23')]();};}function saveUpdates(_0x18eaa8,_0x26e3a4){return function(_0x3af329){if(_0x3af329){return _0x3af329[_0xa0fd('0x24')](_0x18eaa8)[_0xa0fd('0x25')](function(_0xda6f53){return _0xda6f53;});}return null;};}function removeEntity(_0x13fc62,_0x28dbda){return function(_0x310279){if(_0x310279){return _0x310279[_0xa0fd('0x26')]()['then'](function(){_0x13fc62[_0xa0fd('0x1a')](0xcc)[_0xa0fd('0x19')]();});}};}function handleEntityNotFound(_0x541118,_0x197ae5){return function(_0x3cd5b0){if(!_0x3cd5b0){_0x541118['sendStatus'](0x194);}return _0x3cd5b0;};}function handleError(_0x5bb0ee,_0x2e9b0d){_0x2e9b0d=_0x2e9b0d||0x1f4;return function(_0x267899){logger['error'](_0x267899['stack']);if(_0x267899['name']){delete _0x267899['name'];}_0x5bb0ee[_0xa0fd('0x1a')](_0x2e9b0d)['send'](_0x267899);};}exports[_0xa0fd('0x27')]=function(_0x1db300,_0x2f5b0d){var _0x4a307b={},_0x36aaed={},_0x19c352={'count':0x0,'rows':[]};var _0x4feb93=_[_0xa0fd('0x28')](db[_0xa0fd('0x29')]['rawAttributes'],function(_0x366921){return{'name':_0x366921[_0xa0fd('0x2a')],'type':_0x366921[_0xa0fd('0x2b')][_0xa0fd('0x2c')]};});_0x36aaed['model']=_[_0xa0fd('0x28')](_0x4feb93,_0xa0fd('0x2d'));_0x36aaed['query']=_['keys'](_0x1db300['query']);_0x36aaed[_0xa0fd('0x2e')]=_['intersection'](_0x36aaed['model'],_0x36aaed[_0xa0fd('0x2f')]);_0x4a307b['attributes']=_[_0xa0fd('0x30')](_0x36aaed[_0xa0fd('0x31')],qs[_0xa0fd('0x32')](_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x32')]));_0x4a307b[_0xa0fd('0x33')]=_0x4a307b[_0xa0fd('0x33')][_0xa0fd('0x34')]?_0x4a307b['attributes']:_0x36aaed[_0xa0fd('0x31')];if(!_0x1db300['query'][_0xa0fd('0x35')]('nolimit')){_0x4a307b['limit']=qs[_0xa0fd('0x1c')](_0x1db300['query'][_0xa0fd('0x1c')]);_0x4a307b[_0xa0fd('0x1f')]=qs[_0xa0fd('0x1f')](_0x1db300[_0xa0fd('0x2f')]['offset']);}_0x4a307b[_0xa0fd('0x36')]=qs[_0xa0fd('0x37')](_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x37')]);_0x4a307b[_0xa0fd('0x38')]=qs[_0xa0fd('0x2e')](_[_0xa0fd('0x39')](_0x1db300['query'],_0x36aaed['filters']),_0x4feb93);if(_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3a')]){_0x4a307b[_0xa0fd('0x38')]=_[_0xa0fd('0x3b')](_0x4a307b['where'],{'$or':_[_0xa0fd('0x28')](_0x4feb93,function(_0x3938da){if(_0x3938da[_0xa0fd('0x2b')]!==_0xa0fd('0x3c')){var _0x214094={};_0x214094[_0x3938da['name']]={'$like':'%'+_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3a')]+'%'};return _0x214094;}})});}_0x4a307b=_['merge']({},_0x4a307b,_0x1db300['options']);var _0x27082a={'where':_0x4a307b[_0xa0fd('0x38')]};return db[_0xa0fd('0x29')][_0xa0fd('0x1e')](_0x27082a)[_0xa0fd('0x25')](function(_0xbeca16){_0x19c352[_0xa0fd('0x1e')]=_0xbeca16;if(_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3d')]){_0x4a307b[_0xa0fd('0x3e')]=[{'all':!![]}];}return db[_0xa0fd('0x29')][_0xa0fd('0x3f')](_0x4a307b);})[_0xa0fd('0x25')](function(_0x466767){_0x19c352[_0xa0fd('0x40')]=_0x466767;return _0x19c352;})['then'](respondWithFilteredResult(_0x2f5b0d,_0x4a307b))['catch'](handleError(_0x2f5b0d,null));};exports['show']=function(_0x241e3e,_0x288a8a){var _0x399eb1={'raw':!![],'where':{'id':_0x241e3e[_0xa0fd('0x41')]['id']}},_0x54fb8c={};_0x54fb8c[_0xa0fd('0x31')]=_[_0xa0fd('0x42')](db['JscriptyAnswerReport'][_0xa0fd('0x43')]);_0x54fb8c[_0xa0fd('0x2f')]=_[_0xa0fd('0x42')](_0x241e3e[_0xa0fd('0x2f')]);_0x54fb8c[_0xa0fd('0x2e')]=_[_0xa0fd('0x30')](_0x54fb8c['model'],_0x54fb8c[_0xa0fd('0x2f')]);_0x399eb1[_0xa0fd('0x33')]=_[_0xa0fd('0x30')](_0x54fb8c[_0xa0fd('0x31')],qs[_0xa0fd('0x32')](_0x241e3e[_0xa0fd('0x2f')]['fields']));_0x399eb1[_0xa0fd('0x33')]=_0x399eb1[_0xa0fd('0x33')][_0xa0fd('0x34')]?_0x399eb1[_0xa0fd('0x33')]:_0x54fb8c[_0xa0fd('0x31')];if(_0x241e3e['query']['includeAll']){_0x399eb1[_0xa0fd('0x3e')]=[{'all':!![]}];}_0x399eb1=_[_0xa0fd('0x3b')]({},_0x399eb1,_0x241e3e[_0xa0fd('0x44')]);return db[_0xa0fd('0x29')][_0xa0fd('0x45')](_0x399eb1)['then'](handleEntityNotFound(_0x288a8a,null))[_0xa0fd('0x25')](respondWithResult(_0x288a8a,null))[_0xa0fd('0x46')](handleError(_0x288a8a,null));};exports[_0xa0fd('0x47')]=function(_0x210a75,_0x93d528){return db[_0xa0fd('0x29')]['create'](_0x210a75['body'],{})['then'](respondWithResult(_0x93d528,0xc9))[_0xa0fd('0x46')](handleError(_0x93d528,null));};exports['update']=function(_0x4e4ce4,_0xcf725e){if(_0x4e4ce4['body']['id']){delete _0x4e4ce4[_0xa0fd('0x48')]['id'];}return db[_0xa0fd('0x29')]['find']({'where':{'id':_0x4e4ce4['params']['id']}})[_0xa0fd('0x25')](handleEntityNotFound(_0xcf725e,null))[_0xa0fd('0x25')](saveUpdates(_0x4e4ce4[_0xa0fd('0x48')],null))[_0xa0fd('0x25')](respondWithResult(_0xcf725e,null))[_0xa0fd('0x46')](handleError(_0xcf725e,null));};exports[_0xa0fd('0x26')]=function(_0x5268ba,_0x5712f2){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5268ba[_0xa0fd('0x41')]['id']}})[_0xa0fd('0x25')](handleEntityNotFound(_0x5712f2,null))[_0xa0fd('0x25')](removeEntity(_0x5712f2,null))[_0xa0fd('0x46')](handleError(_0x5712f2,null));};exports[_0xa0fd('0x49')]=function(_0x53c1a2,_0x53f51c){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x53f51c,null))[_0xa0fd('0x46')](handleError(_0x53f51c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 434b6b8..b903da4 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 _0xd2b1=['bluebird','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment'];(function(_0x29d185,_0x274898){var _0x1ebe16=function(_0x575aab){while(--_0x575aab){_0x29d185['push'](_0x29d185['shift']());}};_0x1ebe16(++_0x274898);}(_0xd2b1,0x8c));var _0x1d2b=function(_0x5beb42,_0x149be4){_0x5beb42=_0x5beb42-0x0;var _0xdc450d=_0xd2b1[_0x5beb42];return _0xdc450d;};'use strict';var _=require(_0x1d2b('0x0'));var util=require(_0x1d2b('0x1'));var logger=require('../../config/logger')(_0x1d2b('0x2'));var moment=require(_0x1d2b('0x3'));var BPromise=require(_0x1d2b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d2b('0x5'));var rimraf=require(_0x1d2b('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d2b('0x7'));module[_0x1d2b('0x8')]=function(_0x34ab1c,_0x38f1a9){return _0x34ab1c[_0x1d2b('0x9')](_0x1d2b('0xa'),attributes,{'tableName':_0x1d2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa161=['bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x558c15,_0x43052e){var _0x4413fe=function(_0x557c3a){while(--_0x557c3a){_0x558c15['push'](_0x558c15['shift']());}};_0x4413fe(++_0x43052e);}(_0xa161,0x1bf));var _0x1a16=function(_0x31accd,_0x299514){_0x31accd=_0x31accd-0x0;var _0x1fe617=_0xa161[_0x31accd];return _0x1fe617;};'use strict';var _=require(_0x1a16('0x0'));var util=require(_0x1a16('0x1'));var logger=require(_0x1a16('0x2'))(_0x1a16('0x3'));var moment=require('moment');var BPromise=require(_0x1a16('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a16('0x5'));var rimraf=require(_0x1a16('0x6'));var config=require(_0x1a16('0x7'));var attributes=require(_0x1a16('0x8'));module[_0x1a16('0x9')]=function(_0x235249,_0x25f1f1){return _0x235249[_0x1a16('0xa')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','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 9afdfe6..fb2bc84 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 _0xcdfd=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0xef14f1,_0x168c8c){var _0x512e41=function(_0x24fd9c){while(--_0x24fd9c){_0xef14f1['push'](_0xef14f1['shift']());}};_0x512e41(++_0x168c8c);}(_0xcdfd,0x87));var _0xdcdf=function(_0xd63ab7,_0xb5bb72){_0xd63ab7=_0xd63ab7-0x0;var _0x1bad90=_0xcdfd[_0xd63ab7];return _0x1bad90;};'use strict';var _=require('lodash');var util=require(_0xdcdf('0x0'));var moment=require(_0xdcdf('0x1'));var BPromise=require(_0xdcdf('0x2'));var rs=require(_0xdcdf('0x3'));var fs=require('fs');var Redis=require(_0xdcdf('0x4'));var db=require(_0xdcdf('0x5'))['db'];var utils=require(_0xdcdf('0x6'));var logger=require(_0xdcdf('0x7'))('rpc');var config=require(_0xdcdf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdcdf('0x9')][_0xdcdf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cf1f0,_0x301bb8,_0x397230){return new BPromise(function(_0x578e94,_0x593000){return client['request'](_0x5cf1f0,_0x397230)['then'](function(_0x5542c9){logger[_0xdcdf('0xb')](_0xdcdf('0xc'),_0x301bb8,_0xdcdf('0xd'));logger[_0xdcdf('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x301bb8,_0xdcdf('0xd'),JSON['stringify'](_0x5542c9));if(_0x5542c9[_0xdcdf('0xf')]){if(_0x5542c9[_0xdcdf('0xf')][_0xdcdf('0x10')]===0x1f4){logger['error'](_0xdcdf('0xc'),_0x301bb8,_0x5542c9['error']['message']);return _0x593000(_0x5542c9[_0xdcdf('0xf')][_0xdcdf('0x11')]);}logger['error'](_0xdcdf('0xc'),_0x301bb8,_0x5542c9[_0xdcdf('0xf')]['message']);return _0x578e94(_0x5542c9['error'][_0xdcdf('0x11')]);}else{logger[_0xdcdf('0xb')](_0xdcdf('0xc'),_0x301bb8,_0xdcdf('0xd'));_0x578e94(_0x5542c9[_0xdcdf('0x12')]['message']);}})[_0xdcdf('0x13')](function(_0x316ba9){logger[_0xdcdf('0xf')](_0xdcdf('0xc'),_0x301bb8,_0x316ba9);_0x593000(_0x316ba9);});});} \ No newline at end of file +var _0x0c4a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0c4a,0x1b7));var _0xa0c4=function(_0x54c1b1,_0xd6cfd6){_0x54c1b1=_0x54c1b1-0x0;var _0x18eecc=_0x0c4a[_0x54c1b1];return _0x18eecc;};'use strict';var _=require('lodash');var util=require(_0xa0c4('0x0'));var moment=require(_0xa0c4('0x1'));var BPromise=require(_0xa0c4('0x2'));var rs=require(_0xa0c4('0x3'));var fs=require('fs');var Redis=require(_0xa0c4('0x4'));var db=require(_0xa0c4('0x5'))['db'];var utils=require(_0xa0c4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa0c4('0x7'));var jayson=require(_0xa0c4('0x8'));var client=jayson['client'][_0xa0c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c192e,_0x54399f,_0x13a5d3){return new BPromise(function(_0x337bf0,_0x312818){return client[_0xa0c4('0xa')](_0x2c192e,_0x13a5d3)[_0xa0c4('0xb')](function(_0x2ec951){logger[_0xa0c4('0xc')](_0xa0c4('0xd'),_0x54399f,_0xa0c4('0xe'));logger[_0xa0c4('0xf')](_0xa0c4('0x10'),_0x54399f,_0xa0c4('0xe'),JSON[_0xa0c4('0x11')](_0x2ec951));if(_0x2ec951['error']){if(_0x2ec951[_0xa0c4('0x12')]['code']===0x1f4){logger['error'](_0xa0c4('0xd'),_0x54399f,_0x2ec951[_0xa0c4('0x12')]['message']);return _0x312818(_0x2ec951[_0xa0c4('0x12')][_0xa0c4('0x13')]);}logger[_0xa0c4('0x12')](_0xa0c4('0xd'),_0x54399f,_0x2ec951[_0xa0c4('0x12')][_0xa0c4('0x13')]);return _0x337bf0(_0x2ec951['error'][_0xa0c4('0x13')]);}else{logger[_0xa0c4('0xc')](_0xa0c4('0xd'),_0x54399f,_0xa0c4('0xe'));_0x337bf0(_0x2ec951[_0xa0c4('0x14')][_0xa0c4('0x13')]);}})[_0xa0c4('0x15')](function(_0xc9a429){logger[_0xa0c4('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x54399f,_0xc9a429);_0x312818(_0xc9a429);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index be5a73a..e20930d 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 _0x3597=['show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','exports','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3bd73a,_0x45d4aa){var _0x37666c=function(_0x48c089){while(--_0x48c089){_0x3bd73a['push'](_0x3bd73a['shift']());}};_0x37666c(++_0x45d4aa);}(_0x3597,0xc8));var _0x7359=function(_0x5a4f28,_0x754956){_0x5a4f28=_0x5a4f28-0x0;var _0x958e84=_0x3597[_0x5a4f28];return _0x958e84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7359('0x0'));var timeout=require(_0x7359('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7359('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7359('0x3'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x7359('0x4')]('/',auth[_0x7359('0x5')](),controller[_0x7359('0x6')]);router[_0x7359('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x7359('0x7')]);router[_0x7359('0x4')](_0x7359('0x8'),auth['isAuthenticated'](),controller['getSessions']);router[_0x7359('0x4')](_0x7359('0x9'),auth[_0x7359('0x5')](),controller[_0x7359('0xa')]);router['get'](_0x7359('0xb'),auth[_0x7359('0x5')](),timeout(_0x7359('0xc')),controller[_0x7359('0xd')]);router[_0x7359('0xe')]('/',auth['isAuthenticated'](),controller[_0x7359('0xf')]);router[_0x7359('0xe')](_0x7359('0x10'),auth[_0x7359('0x5')](),controller[_0x7359('0x11')]);router[_0x7359('0x12')](_0x7359('0x13'),auth['isAuthenticated'](),controller[_0x7359('0x14')]);router[_0x7359('0x15')]('/:id',auth[_0x7359('0x5')](),controller['destroy']);module[_0x7359('0x16')]=router; \ No newline at end of file +var _0xd7c5=['fs-extra','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getAnswers','30s','post','create','/:id/clone','clone','put','delete','destroy','exports','util','path','express','Router'];(function(_0x38f574,_0x15301c){var _0x35378b=function(_0x40bb84){while(--_0x40bb84){_0x38f574['push'](_0x38f574['shift']());}};_0x35378b(++_0x15301c);}(_0xd7c5,0x9d));var _0x5d7c=function(_0x29e9a9,_0x5920ad){_0x29e9a9=_0x29e9a9-0x0;var _0x3ca006=_0xd7c5[_0x29e9a9];return _0x3ca006;};'use strict';var multer=require('multer');var util=require(_0x5d7c('0x0'));var path=require(_0x5d7c('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d7c('0x2'));var router=express[_0x5d7c('0x3')]();var fs_extra=require(_0x5d7c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5d7c('0x5'));var config=require('../../config/environment');var controller=require(_0x5d7c('0x6'));router[_0x5d7c('0x7')]('/',auth[_0x5d7c('0x8')](),controller[_0x5d7c('0x9')]);router['get'](_0x5d7c('0xa'),auth['isAuthenticated'](),controller[_0x5d7c('0xb')]);router[_0x5d7c('0x7')](_0x5d7c('0xc'),auth[_0x5d7c('0x8')](),controller['getSessions']);router[_0x5d7c('0x7')]('/:id/answers',auth[_0x5d7c('0x8')](),controller[_0x5d7c('0xd')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0x5d7c('0xe')),controller['getSummary']);router[_0x5d7c('0xf')]('/',auth[_0x5d7c('0x8')](),controller[_0x5d7c('0x10')]);router[_0x5d7c('0xf')](_0x5d7c('0x11'),auth[_0x5d7c('0x8')](),controller[_0x5d7c('0x12')]);router[_0x5d7c('0x13')](_0x5d7c('0xa'),auth[_0x5d7c('0x8')](),controller['update']);router[_0x5d7c('0x14')](_0x5d7c('0xa'),auth['isAuthenticated'](),controller[_0x5d7c('0x15')]);module[_0x5d7c('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 11381ab..57cfbd6 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 _0xdeea=['name','getDataValue','description','BOOLEAN','lodash','util','exports','STRING','TEXT','isObjectLike','formData','stringify','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdeea,0x15d));var _0xadee=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xdeea[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require('sequelize');var _=require(_0xadee('0x0'));var util=require(_0xadee('0x1'));module[_0xadee('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xadee('0x3')]},'formData':{'type':Sequelize[_0xadee('0x4')]('long'),'set':function(_0x3cbd91){if(_[_0xadee('0x5')](_0x3cbd91)){this['setDataValue'](_0xadee('0x6'),JSON[_0xadee('0x7')](_0x3cbd91));}else if(_['isString'](_0x3cbd91)){this[_0xadee('0x8')](_0xadee('0x6'),_0x3cbd91);}else{this[_0xadee('0x8')](_0xadee('0x6'),util[_0xadee('0x9')](_0xadee('0xa'),this['getDataValue'](_0xadee('0xb'))||'',this[_0xadee('0xc')](_0xadee('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xadee('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xadee('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x1842=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0x1842,0x6c));var _0x2184=function(_0x189e51,_0x187328){_0x189e51=_0x189e51-0x0;var _0x182f31=_0x1842[_0x189e51];return _0x182f31;};'use strict';var Sequelize=require(_0x2184('0x0'));var _=require(_0x2184('0x1'));var util=require(_0x2184('0x2'));module[_0x2184('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x2184('0x4')},'description':{'type':Sequelize[_0x2184('0x5')]},'formData':{'type':Sequelize[_0x2184('0x6')](_0x2184('0x7')),'set':function(_0x23ae0f){if(_[_0x2184('0x8')](_0x23ae0f)){this[_0x2184('0x9')](_0x2184('0xa'),JSON[_0x2184('0xb')](_0x23ae0f));}else if(_[_0x2184('0xc')](_0x23ae0f)){this['setDataValue'](_0x2184('0xa'),_0x23ae0f);}else{this[_0x2184('0x9')](_0x2184('0xa'),util[_0x2184('0xd')](_0x2184('0xe'),this['getDataValue']('name')||'',this[_0x2184('0xf')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2184('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2184('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 99b33ae..4abcb7a 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 _0x3eae=['../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','index','JscriptyProject','rawAttributes','type','key','map','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','show','params','length','catch','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','create','include','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','findAll','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3eae,0x66));var _0xe3ea=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x3eae[_0x528497];return _0x392d59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe3ea('0x0'));var jsonpatch=require(_0xe3ea('0x1'));var rp=require('request-promise');var moment=require(_0xe3ea('0x2'));var BPromise=require(_0xe3ea('0x3'));var Mustache=require(_0xe3ea('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe3ea('0x5'));var csv=require(_0xe3ea('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe3ea('0x7'));var _=require(_0xe3ea('0x8'));var squel=require('squel');var crypto=require(_0xe3ea('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe3ea('0xa'));var toCsv=require(_0xe3ea('0x6'));var querystring=require(_0xe3ea('0xb'));var Papa=require('papaparse');var Redis=require(_0xe3ea('0xc'));var authService=require(_0xe3ea('0xd'));var qs=require(_0xe3ea('0xe'));var as=require(_0xe3ea('0xf'));var hardwareService=require(_0xe3ea('0x10'));var logger=require(_0xe3ea('0x11'))(_0xe3ea('0x12'));var utils=require(_0xe3ea('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe3ea('0x14'))['db'];function respondWithStatusCode(_0x6a9294,_0x36c2dd){_0x36c2dd=_0x36c2dd||0xcc;return function(_0x247139){if(_0x247139){return _0x6a9294[_0xe3ea('0x15')](_0x36c2dd);}return _0x6a9294[_0xe3ea('0x16')](_0x36c2dd)[_0xe3ea('0x17')]();};}function respondWithResult(_0x2b36ec,_0x31357a){_0x31357a=_0x31357a||0xc8;return function(_0x11f560){if(_0x11f560){return _0x2b36ec[_0xe3ea('0x16')](_0x31357a)[_0xe3ea('0x18')](_0x11f560);}};}function respondWithFilteredResult(_0x445775,_0x492c29){return function(_0x3c3700){if(_0x3c3700){var _0x2a086a=typeof _0x492c29[_0xe3ea('0x19')]===_0xe3ea('0x1a')&&typeof _0x492c29[_0xe3ea('0x1b')]===_0xe3ea('0x1a');var _0x466d2d=_0x3c3700[_0xe3ea('0x1c')];var _0x33f6f8=_0x2a086a?0x0:_0x492c29[_0xe3ea('0x19')];var _0x3575be=_0x2a086a?_0x3c3700[_0xe3ea('0x1c')]:_0x492c29[_0xe3ea('0x19')]+_0x492c29[_0xe3ea('0x1b')];var _0x2a397b;if(_0x3575be>=_0x466d2d){_0x3575be=_0x466d2d;_0x2a397b=0xc8;}else{_0x2a397b=0xce;}_0x445775[_0xe3ea('0x16')](_0x2a397b);return _0x445775[_0xe3ea('0x1d')](_0xe3ea('0x1e'),_0x33f6f8+'-'+_0x3575be+'/'+_0x466d2d)[_0xe3ea('0x18')](_0x3c3700);}return null;};}function patchUpdates(_0x29e32e){return function(_0xd61c1c){try{jsonpatch[_0xe3ea('0x1f')](_0xd61c1c,_0x29e32e,!![]);}catch(_0xca5a4f){return BPromise[_0xe3ea('0x20')](_0xca5a4f);}return _0xd61c1c[_0xe3ea('0x21')]();};}function saveUpdates(_0x4a537d,_0x5ed42a){return function(_0x4f0e9e){if(_0x4f0e9e){return _0x4f0e9e[_0xe3ea('0x22')](_0x4a537d)['then'](function(_0x5050eb){return _0x5050eb;});}return null;};}function removeEntity(_0x350d8e,_0x19dd53){return function(_0x4cda82){if(_0x4cda82){return _0x4cda82[_0xe3ea('0x23')]()[_0xe3ea('0x24')](function(){var _0x594ba1=_0x4cda82[_0xe3ea('0x25')]({'plain':!![]});var _0x4bb839=_0xe3ea('0x26');return db[_0xe3ea('0x27')][_0xe3ea('0x23')]({'where':{'type':_0x4bb839,'resourceId':_0x594ba1['id']}})['then'](function(){return _0x4cda82;});})[_0xe3ea('0x24')](function(){_0x350d8e[_0xe3ea('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x522a3f,_0x5518d3){return function(_0x5bd356){if(!_0x5bd356){_0x522a3f['sendStatus'](0x194);}return _0x5bd356;};}function handleError(_0x5f1eff,_0x3accb1){_0x3accb1=_0x3accb1||0x1f4;return function(_0x3e7c9f){logger[_0xe3ea('0x28')](_0x3e7c9f[_0xe3ea('0x29')]);if(_0x3e7c9f['name']){delete _0x3e7c9f['name'];}_0x5f1eff[_0xe3ea('0x16')](_0x3accb1)['send'](_0x3e7c9f);};}exports[_0xe3ea('0x2a')]=function(_0x2b1c07,_0x73a56e){var _0x51bdd4={},_0x5c8a68={},_0x7b9638={'count':0x0,'rows':[]};var _0x10f778=_['map'](db[_0xe3ea('0x2b')][_0xe3ea('0x2c')],function(_0x3ee500){return{'name':_0x3ee500['fieldName'],'type':_0x3ee500[_0xe3ea('0x2d')][_0xe3ea('0x2e')]};});_0x5c8a68['model']=_[_0xe3ea('0x2f')](_0x10f778,_0xe3ea('0x30'));_0x5c8a68[_0xe3ea('0x31')]=_[_0xe3ea('0x32')](_0x2b1c07[_0xe3ea('0x31')]);_0x5c8a68[_0xe3ea('0x33')]=_[_0xe3ea('0x34')](_0x5c8a68[_0xe3ea('0x35')],_0x5c8a68[_0xe3ea('0x31')]);_0x51bdd4['attributes']=_['intersection'](_0x5c8a68[_0xe3ea('0x35')],qs[_0xe3ea('0x36')](_0x2b1c07[_0xe3ea('0x31')][_0xe3ea('0x36')]));_0x51bdd4[_0xe3ea('0x37')]=_0x51bdd4[_0xe3ea('0x37')]['length']?_0x51bdd4['attributes']:_0x5c8a68[_0xe3ea('0x35')];if(!_0x2b1c07[_0xe3ea('0x31')][_0xe3ea('0x38')](_0xe3ea('0x39'))){_0x51bdd4[_0xe3ea('0x1b')]=qs[_0xe3ea('0x1b')](_0x2b1c07[_0xe3ea('0x31')][_0xe3ea('0x1b')]);_0x51bdd4[_0xe3ea('0x19')]=qs[_0xe3ea('0x19')](_0x2b1c07['query'][_0xe3ea('0x19')]);}_0x51bdd4[_0xe3ea('0x3a')]=qs[_0xe3ea('0x3b')](_0x2b1c07['query']['sort']);_0x51bdd4['where']=qs[_0xe3ea('0x33')](_[_0xe3ea('0x3c')](_0x2b1c07['query'],_0x5c8a68[_0xe3ea('0x33')]),_0x10f778);if(_0x2b1c07[_0xe3ea('0x31')][_0xe3ea('0x3d')]){_0x51bdd4['where']=_[_0xe3ea('0x3e')](_0x51bdd4[_0xe3ea('0x3f')],{'$or':_[_0xe3ea('0x2f')](_0x10f778,function(_0x3a3b6c){if(_0x3a3b6c['type']!==_0xe3ea('0x40')){var _0x320c24={};_0x320c24[_0x3a3b6c[_0xe3ea('0x30')]]={'$like':'%'+_0x2b1c07['query'][_0xe3ea('0x3d')]+'%'};return _0x320c24;}})});}_0x51bdd4=_[_0xe3ea('0x3e')]({},_0x51bdd4,_0x2b1c07[_0xe3ea('0x41')]);var _0x252d3f={'where':_0x51bdd4[_0xe3ea('0x3f')]};return db[_0xe3ea('0x2b')]['count'](_0x252d3f)[_0xe3ea('0x24')](function(_0x50bc87){_0x7b9638[_0xe3ea('0x1c')]=_0x50bc87;if(_0x2b1c07[_0xe3ea('0x31')][_0xe3ea('0x42')]){_0x51bdd4['include']=[{'all':!![]}];}return db[_0xe3ea('0x2b')]['findAll'](_0x51bdd4);})[_0xe3ea('0x24')](function(_0x142057){_0x7b9638[_0xe3ea('0x43')]=_0x142057;return _0x7b9638;})['then'](respondWithFilteredResult(_0x73a56e,_0x51bdd4))['catch'](handleError(_0x73a56e,null));};exports[_0xe3ea('0x44')]=function(_0x5ccd6d,_0x185cc7){var _0x50a9ca={'raw':![],'where':{'id':_0x5ccd6d[_0xe3ea('0x45')]['id']}},_0xea2469={};_0xea2469[_0xe3ea('0x35')]=_[_0xe3ea('0x32')](db[_0xe3ea('0x2b')][_0xe3ea('0x2c')]);_0xea2469['query']=_[_0xe3ea('0x32')](_0x5ccd6d[_0xe3ea('0x31')]);_0xea2469[_0xe3ea('0x33')]=_[_0xe3ea('0x34')](_0xea2469[_0xe3ea('0x35')],_0xea2469['query']);_0x50a9ca[_0xe3ea('0x37')]=_[_0xe3ea('0x34')](_0xea2469[_0xe3ea('0x35')],qs[_0xe3ea('0x36')](_0x5ccd6d[_0xe3ea('0x31')]['fields']));_0x50a9ca[_0xe3ea('0x37')]=_0x50a9ca['attributes'][_0xe3ea('0x46')]?_0x50a9ca['attributes']:_0xea2469[_0xe3ea('0x35')];if(_0x5ccd6d[_0xe3ea('0x31')]['includeAll']){_0x50a9ca['include']=[{'all':!![]}];}_0x50a9ca=_[_0xe3ea('0x3e')]({},_0x50a9ca,_0x5ccd6d['options']);return db['JscriptyProject']['find'](_0x50a9ca)[_0xe3ea('0x24')](handleEntityNotFound(_0x185cc7,null))[_0xe3ea('0x24')](respondWithResult(_0x185cc7,null))[_0xe3ea('0x47')](handleError(_0x185cc7,null));};exports['create']=function(_0x7b894,_0x134f3f){return db[_0xe3ea('0x2b')]['create'](_0x7b894[_0xe3ea('0x48')],{})['then'](function(_0x358a60){var _0x39bfb9=_0x7b894[_0xe3ea('0x49')][_0xe3ea('0x25')]({'plain':!![]});if(!_0x39bfb9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39bfb9[_0xe3ea('0x4a')]===_0xe3ea('0x49')){var _0x38cbbe=_0x358a60[_0xe3ea('0x25')]({'plain':!![]});var _0x59fafd=_0xe3ea('0x26');return db[_0xe3ea('0x4b')][_0xe3ea('0x4c')]({'where':{'name':_0x59fafd,'userProfileId':_0x39bfb9[_0xe3ea('0x4d')]},'raw':!![]})[_0xe3ea('0x24')](function(_0x59b4af){if(_0x59b4af&&_0x59b4af[_0xe3ea('0x4e')]===0x0){return db[_0xe3ea('0x27')][_0xe3ea('0x4f')]({'name':_0x38cbbe['name'],'resourceId':_0x38cbbe['id'],'type':_0x59b4af['name'],'sectionId':_0x59b4af['id']},{})[_0xe3ea('0x24')](function(){return _0x358a60;});}else{return _0x358a60;}})['catch'](function(_0x237c74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x237c74);throw _0x237c74;});}return _0x358a60;})[_0xe3ea('0x24')](respondWithResult(_0x134f3f,0xc9))[_0xe3ea('0x47')](handleError(_0x134f3f,null));};exports['clone']=function(_0x1372c2,_0x1bb758){var _0x36b256={'where':{'id':_0x1372c2[_0xe3ea('0x45')]['id']}},_0x2b706c={};_0x2b706c[_0xe3ea('0x35')]=_[_0xe3ea('0x32')](db[_0xe3ea('0x2b')][_0xe3ea('0x2c')]);_0x36b256[_0xe3ea('0x37')]=_[_0xe3ea('0x34')](_0x2b706c[_0xe3ea('0x35')],qs[_0xe3ea('0x36')](_0x1372c2[_0xe3ea('0x31')][_0xe3ea('0x36')]));_0x36b256[_0xe3ea('0x37')]=_0x36b256[_0xe3ea('0x37')][_0xe3ea('0x46')]?_0x36b256['attributes']:_0x2b706c[_0xe3ea('0x35')];if(_0x1372c2['query'][_0xe3ea('0x42')]){_0x36b256[_0xe3ea('0x50')]=[{'all':!![]}];}_0x36b256=_[_0xe3ea('0x3e')]({},_0x36b256,_0x1372c2[_0xe3ea('0x41')]);return db[_0xe3ea('0x2b')]['find'](_0x36b256)[_0xe3ea('0x24')](handleEntityNotFound(_0x1bb758,null))[_0xe3ea('0x24')](function(_0x271718){if(_0x271718){var _0xf366af=_0x271718['get']({'plain':!![]});_0xf366af=qs[_0xe3ea('0x51')](_0xf366af,['id','createdAt',_0xe3ea('0x52')]);_0x1372c2['body']=_['omit'](_0x1372c2[_0xe3ea('0x48')],['id',_0xe3ea('0x53'),_0xe3ea('0x52')]);return db['JscriptyProject'][_0xe3ea('0x4f')](_[_0xe3ea('0x3e')](_0xf366af,_0x1372c2[_0xe3ea('0x48')]),{'include':_0x1372c2[_0xe3ea('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xe3ea('0x24')](function(_0xb736ba){var _0x4cc0bf=_0x1372c2['user'][_0xe3ea('0x25')]({'plain':!![]});if(!_0x4cc0bf)throw new Error(_0xe3ea('0x54'));if(_0x4cc0bf[_0xe3ea('0x4a')]===_0xe3ea('0x49')){var _0xcc3a95=_0xb736ba[_0xe3ea('0x25')]({'plain':!![]});var _0x1a2936=_0xe3ea('0x26');return db[_0xe3ea('0x4b')][_0xe3ea('0x4c')]({'where':{'name':_0x1a2936,'userProfileId':_0x4cc0bf[_0xe3ea('0x4d')]},'raw':!![]})[_0xe3ea('0x24')](function(_0x3e262f){if(_0x3e262f&&_0x3e262f['autoAssociation']===0x0){return db[_0xe3ea('0x27')][_0xe3ea('0x4f')]({'name':_0xcc3a95[_0xe3ea('0x30')],'resourceId':_0xcc3a95['id'],'type':_0x3e262f['name'],'sectionId':_0x3e262f['id']},{})['then'](function(){return _0xb736ba;});}else{return _0xb736ba;}})['catch'](function(_0x3e0f3a){logger['error'](_0xe3ea('0x55'),_0x3e0f3a);throw _0x3e0f3a;});}return _0xb736ba;});}})[_0xe3ea('0x24')](respondWithResult(_0x1bb758,0xc9))['catch'](handleError(_0x1bb758,null));};exports[_0xe3ea('0x22')]=function(_0x4f52f8,_0x1a2b90){if(_0x4f52f8['body']['id']){delete _0x4f52f8[_0xe3ea('0x48')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x4f52f8[_0xe3ea('0x45')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x1a2b90,null))[_0xe3ea('0x24')](saveUpdates(_0x4f52f8[_0xe3ea('0x48')],null))[_0xe3ea('0x24')](respondWithResult(_0x1a2b90,null))[_0xe3ea('0x47')](handleError(_0x1a2b90,null));};exports[_0xe3ea('0x23')]=function(_0x23d8a1,_0x2765db){return db[_0xe3ea('0x2b')][_0xe3ea('0x4c')]({'where':{'id':_0x23d8a1[_0xe3ea('0x45')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x2765db,null))[_0xe3ea('0x24')](removeEntity(_0x2765db,null))[_0xe3ea('0x47')](handleError(_0x2765db,null));};exports[_0xe3ea('0x56')]=function(_0x8e36b7,_0x2612e8,_0x26ee66){var _0x4d6179={'raw':!![],'where':{}};var _0x3efc1f={};var _0xde7504={'count':0x0,'rows':[]};return db[_0xe3ea('0x2b')]['findOne']({'where':{'id':_0x8e36b7[_0xe3ea('0x45')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x2612e8,null))[_0xe3ea('0x24')](function(_0x333d39){if(_0x333d39){_0x3efc1f[_0xe3ea('0x35')]=_[_0xe3ea('0x32')](db[_0xe3ea('0x57')]['rawAttributes']);_0x3efc1f[_0xe3ea('0x31')]=_[_0xe3ea('0x32')](_0x8e36b7['query']);_0x3efc1f[_0xe3ea('0x33')]=_['intersection'](_0x3efc1f[_0xe3ea('0x35')],_0x3efc1f[_0xe3ea('0x31')]);_0x4d6179[_0xe3ea('0x37')]=_[_0xe3ea('0x34')](_0x3efc1f[_0xe3ea('0x35')],qs[_0xe3ea('0x36')](_0x8e36b7['query']['fields']));_0x4d6179['attributes']=_0x4d6179[_0xe3ea('0x37')]['length']?_0x4d6179['attributes']:_0x3efc1f[_0xe3ea('0x35')];if(!_0x8e36b7['query']['hasOwnProperty'](_0xe3ea('0x39'))){_0x4d6179['limit']=qs[_0xe3ea('0x1b')](_0x8e36b7['query']['limit']);_0x4d6179[_0xe3ea('0x19')]=qs[_0xe3ea('0x19')](_0x8e36b7[_0xe3ea('0x31')][_0xe3ea('0x19')]);}_0x4d6179['order']=qs[_0xe3ea('0x3b')](_0x8e36b7[_0xe3ea('0x31')]['sort']);_0x4d6179[_0xe3ea('0x3f')]=qs[_0xe3ea('0x33')](_[_0xe3ea('0x3c')](_0x8e36b7['query'],_0x3efc1f[_0xe3ea('0x33')]));_0x4d6179[_0xe3ea('0x3f')][_0xe3ea('0x58')]=_0x333d39['id'];if(_0x8e36b7['query'][_0xe3ea('0x3d')]){_0x4d6179[_0xe3ea('0x3f')]=_[_0xe3ea('0x3e')](_0x4d6179[_0xe3ea('0x3f')],{'$or':_['map'](_0x4d6179[_0xe3ea('0x37')],function(_0x3c5c72){var _0x3af108={};_0x3af108[_0x3c5c72]={'$like':'%'+_0x8e36b7[_0xe3ea('0x31')]['filter']+'%'};return _0x3af108;})});}_0x4d6179=_['merge']({},_0x4d6179,_0x8e36b7[_0xe3ea('0x41')]);return db[_0xe3ea('0x57')][_0xe3ea('0x1c')]({'where':_0x4d6179[_0xe3ea('0x3f')]})[_0xe3ea('0x24')](function(_0x1d02b2){_0xde7504[_0xe3ea('0x1c')]=_0x1d02b2;if(_0x8e36b7[_0xe3ea('0x31')][_0xe3ea('0x42')]){_0x4d6179[_0xe3ea('0x50')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x4d6179);})[_0xe3ea('0x24')](function(_0x4b84c2){_0xde7504[_0xe3ea('0x43')]=_0x4b84c2;return _0xde7504;});}})[_0xe3ea('0x24')](respondWithFilteredResult(_0x2612e8,_0x4d6179))[_0xe3ea('0x47')](handleError(_0x2612e8,null));};exports[_0xe3ea('0x59')]=function(_0x10ad9f,_0x44a258,_0x8a925b){var _0xf02e07={'raw':!![],'where':{}};var _0x43e0fa={};var _0x3b7ae1={'count':0x0,'rows':[]};return db[_0xe3ea('0x2b')][_0xe3ea('0x5a')]({'where':{'id':_0x10ad9f[_0xe3ea('0x45')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x44a258,null))['then'](function(_0x10e01a){if(_0x10e01a){_0x43e0fa[_0xe3ea('0x35')]=_['keys'](db[_0xe3ea('0x5b')]['rawAttributes']);_0x43e0fa[_0xe3ea('0x31')]=_['keys'](_0x10ad9f['query']);_0x43e0fa[_0xe3ea('0x33')]=_[_0xe3ea('0x34')](_0x43e0fa['model'],_0x43e0fa['query']);_0xf02e07[_0xe3ea('0x37')]=_[_0xe3ea('0x34')](_0x43e0fa[_0xe3ea('0x35')],qs['fields'](_0x10ad9f[_0xe3ea('0x31')][_0xe3ea('0x36')]));_0xf02e07['attributes']=_0xf02e07['attributes'][_0xe3ea('0x46')]?_0xf02e07[_0xe3ea('0x37')]:_0x43e0fa[_0xe3ea('0x35')];if(!_0x10ad9f[_0xe3ea('0x31')][_0xe3ea('0x38')](_0xe3ea('0x39'))){_0xf02e07[_0xe3ea('0x1b')]=qs[_0xe3ea('0x1b')](_0x10ad9f['query'][_0xe3ea('0x1b')]);_0xf02e07[_0xe3ea('0x19')]=qs[_0xe3ea('0x19')](_0x10ad9f['query']['offset']);}_0xf02e07[_0xe3ea('0x3a')]=qs['sort'](_0x10ad9f['query'][_0xe3ea('0x3b')]);_0xf02e07[_0xe3ea('0x3f')]=qs[_0xe3ea('0x33')](_[_0xe3ea('0x3c')](_0x10ad9f['query'],_0x43e0fa[_0xe3ea('0x33')]));_0xf02e07[_0xe3ea('0x3f')][_0xe3ea('0x58')]=_0x10e01a['id'];if(_0x10ad9f['query']['filter']){_0xf02e07['where']=_[_0xe3ea('0x3e')](_0xf02e07[_0xe3ea('0x3f')],{'$or':_[_0xe3ea('0x2f')](_0xf02e07[_0xe3ea('0x37')],function(_0x2d7bf9){var _0x5befaa={};_0x5befaa[_0x2d7bf9]={'$like':'%'+_0x10ad9f[_0xe3ea('0x31')][_0xe3ea('0x3d')]+'%'};return _0x5befaa;})});}_0xf02e07=_[_0xe3ea('0x3e')]({},_0xf02e07,_0x10ad9f[_0xe3ea('0x41')]);return db[_0xe3ea('0x5b')][_0xe3ea('0x1c')]({'where':_0xf02e07['where']})[_0xe3ea('0x24')](function(_0x49b1b4){_0x3b7ae1[_0xe3ea('0x1c')]=_0x49b1b4;if(_0x10ad9f[_0xe3ea('0x31')][_0xe3ea('0x42')]){_0xf02e07[_0xe3ea('0x50')]=[{'all':!![]}];}return db[_0xe3ea('0x5b')][_0xe3ea('0x5c')](_0xf02e07);})['then'](function(_0x55744e){_0x3b7ae1[_0xe3ea('0x43')]=_0x55744e;return _0x3b7ae1;});}})['then'](respondWithFilteredResult(_0x44a258,_0xf02e07))[_0xe3ea('0x47')](handleError(_0x44a258,null));};function char(_0x351866){return _0xe3ea('0x5d')===typeof _0x351866?String[_0xe3ea('0x5e')][_0xe3ea('0x1f')](null,arguments):_0x351866;}function needsEncapsulation(_0x5bb631){return!!_0x5bb631&&(_0x5bb631[_0xe3ea('0x5f')]()[_0xe3ea('0x60')](char(0xd))>=0x0||_0x5bb631[_0xe3ea('0x5f')]()[_0xe3ea('0x60')](char(0xa))>=0x0||_0x5bb631[_0xe3ea('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x5bb631[_0xe3ea('0x5f')]()[_0xe3ea('0x60')](char(0x22))>=0x0);}function encapsulate(_0x40cdc9){var _0x3217fe=char(0x22),_0x7b307c='\x5c'+char(0x22),_0x11ae36=_0x40cdc9[_0xe3ea('0x5f')]()[_0xe3ea('0x61')](new RegExp(_0x3217fe,'g'),_0x7b307c);return _0x3217fe+_0x11ae36+_0x3217fe;}exports[_0xe3ea('0x62')]=function(_0x6f0f60,_0x3ffb22,_0x3576c5){var _0x13712d,_0x9b7871;var _0x2d8ef3={'where':{'ProjectId':_0x6f0f60[_0xe3ea('0x45')]['id']}};if(_0x6f0f60[_0xe3ea('0x31')][_0xe3ea('0x63')]){_0x2d8ef3['where'][_0xe3ea('0x64')]=JSON['parse'](_0x6f0f60[_0xe3ea('0x31')]['startTime']);}return db[_0xe3ea('0x57')][_0xe3ea('0x5c')](_0x2d8ef3)[_0xe3ea('0x24')](handleEntityNotFound(_0x3ffb22,null))[_0xe3ea('0x24')](function(_0x150b87){if(_0x150b87){_0x13712d=_0x150b87;return db[_0xe3ea('0x65')][_0xe3ea('0x5c')]({'where':{'SessionId':{'$in':_[_0xe3ea('0x2f')](_0x13712d,'id')},'ProjectId':_0x6f0f60[_0xe3ea('0x45')]['id']},'order':_0xe3ea('0x66')});}})['then'](handleEntityNotFound(_0x3ffb22,null))[_0xe3ea('0x24')](function(_0x32d28e){if(_0x32d28e){_0x9b7871=_0x32d28e;var _0x50ed60={};for(var _0x1bc19b=0x0,_0x3b4cd5=_0x9b7871[_0xe3ea('0x46')];_0x1bc19b<_0x3b4cd5;_0x1bc19b++){if(!_0x50ed60[_0xe3ea('0x38')](_0x9b7871[_0x1bc19b]['questionId'])){_0x50ed60[_0x9b7871[_0x1bc19b][_0xe3ea('0x67')]]=needsEncapsulation(_0x9b7871[_0x1bc19b]['question'])?encapsulate(_0x9b7871[_0x1bc19b][_0xe3ea('0x68')]):_0x9b7871[_0x1bc19b][_0xe3ea('0x68')];}}var _0x4902f6=[],_0x436be5={};for(var _0x22758a=0x0,_0x43e549=_0x13712d[_0xe3ea('0x46')];_0x22758a<_0x43e549;_0x22758a++){_0x436be5={'ProjectId':_0x6f0f60['params']['id'],'SessionId':_0x13712d[_0x22758a]['id'],'StartTime':moment(_0x13712d[_0x22758a][_0xe3ea('0x64')])[_0xe3ea('0x69')](_0xe3ea('0x6a'))};for(var _0x1e41e6=0x0,_0x1a5bcd=_0x9b7871['length'];_0x1e41e6<_0x1a5bcd;_0x1e41e6++){if(_0x9b7871[_0x1e41e6][_0xe3ea('0x6b')]==_0x13712d[_0x22758a]['id']&&_0x50ed60[_0xe3ea('0x38')](_0x9b7871[_0x1e41e6][_0xe3ea('0x67')])){_0x436be5[_0x50ed60[_0x9b7871[_0x1e41e6][_0xe3ea('0x67')]]]=_0x9b7871[_0x1e41e6][_0xe3ea('0x6c')];}}for(var _0xc50af9 in _0x50ed60){if(!_0x436be5[_0xe3ea('0x38')](_0x50ed60[_0xc50af9])){_0x436be5[_0x50ed60[_0xc50af9]]=null;}}_0x4902f6[_0xe3ea('0x6d')](_0x436be5);}return _0x4902f6;}})[_0xe3ea('0x24')](function(_0x4912a5){if(!_[_0xe3ea('0x6e')](_0x4912a5)){var _0x365f01=toCsv(_0x4912a5);var _0x71b437=Date[_0xe3ea('0x6f')]();fs[_0xe3ea('0x70')](util[_0xe3ea('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x6f0f60['params']['id'],_0x71b437),_0x365f01);_0x3ffb22[_0xe3ea('0x71')](_0xe3ea('0x72'),_0xe3ea('0x73')+util[_0xe3ea('0x69')](_0xe3ea('0x74'),_0x6f0f60[_0xe3ea('0x45')]['id'],_0x71b437));_0x3ffb22[_0xe3ea('0x71')](_0xe3ea('0x75'),_0xe3ea('0x76'));return _0x3ffb22[_0xe3ea('0x77')](util[_0xe3ea('0x69')](_0xe3ea('0x78'),_0x6f0f60[_0xe3ea('0x45')]['id'],_0x71b437));}else{return _0x3ffb22['sendStatus'](0xcc);}})[_0xe3ea('0x47')](handleError(_0x3ffb22,null));}; \ No newline at end of file +var _0x96cc=['download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','rows','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','UserProfileResource','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv'];(function(_0x21e057,_0x256af7){var _0x593e5c=function(_0x3c6aa7){while(--_0x3c6aa7){_0x21e057['push'](_0x21e057['shift']());}};_0x593e5c(++_0x256af7);}(_0x96cc,0x16c));var _0xc96c=function(_0x262ff6,_0x158799){_0x262ff6=_0x262ff6-0x0;var _0x4c9b82=_0x96cc[_0x262ff6];return _0x4c9b82;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];function respondWithStatusCode(_0x246a95,_0x5f27f3){_0x5f27f3=_0x5f27f3||0xcc;return function(_0x3fe3d5){if(_0x3fe3d5){return _0x246a95[_0xc96c('0x19')](_0x5f27f3);}return _0x246a95[_0xc96c('0x1a')](_0x5f27f3)[_0xc96c('0x1b')]();};}function respondWithResult(_0x48de8d,_0x35da94){_0x35da94=_0x35da94||0xc8;return function(_0xbed0c9){if(_0xbed0c9){return _0x48de8d[_0xc96c('0x1a')](_0x35da94)[_0xc96c('0x1c')](_0xbed0c9);}};}function respondWithFilteredResult(_0x377dbc,_0x46455a){return function(_0x1765d9){if(_0x1765d9){var _0x23e357=typeof _0x46455a[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x46455a[_0xc96c('0x1f')]==='undefined';var _0x509376=_0x1765d9[_0xc96c('0x20')];var _0x99c402=_0x23e357?0x0:_0x46455a[_0xc96c('0x1d')];var _0x2ae19a=_0x23e357?_0x1765d9['count']:_0x46455a[_0xc96c('0x1d')]+_0x46455a[_0xc96c('0x1f')];var _0x2a361c;if(_0x2ae19a>=_0x509376){_0x2ae19a=_0x509376;_0x2a361c=0xc8;}else{_0x2a361c=0xce;}_0x377dbc[_0xc96c('0x1a')](_0x2a361c);return _0x377dbc[_0xc96c('0x21')](_0xc96c('0x22'),_0x99c402+'-'+_0x2ae19a+'/'+_0x509376)[_0xc96c('0x1c')](_0x1765d9);}return null;};}function patchUpdates(_0x41daba){return function(_0x28d762){try{jsonpatch[_0xc96c('0x23')](_0x28d762,_0x41daba,!![]);}catch(_0x2bb397){return BPromise[_0xc96c('0x24')](_0x2bb397);}return _0x28d762[_0xc96c('0x25')]();};}function saveUpdates(_0x45edee,_0x325c54){return function(_0x3b5c6c){if(_0x3b5c6c){return _0x3b5c6c[_0xc96c('0x26')](_0x45edee)['then'](function(_0xd63951){return _0xd63951;});}return null;};}function removeEntity(_0x4be783,_0x4456bf){return function(_0x10ae21){if(_0x10ae21){return _0x10ae21[_0xc96c('0x27')]()[_0xc96c('0x28')](function(){var _0x40f23d=_0x10ae21[_0xc96c('0x29')]({'plain':!![]});var _0x1a77df=_0xc96c('0x2a');return db['UserProfileResource'][_0xc96c('0x27')]({'where':{'type':_0x1a77df,'resourceId':_0x40f23d['id']}})[_0xc96c('0x28')](function(){return _0x10ae21;});})[_0xc96c('0x28')](function(){_0x4be783[_0xc96c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c00b6,_0x39c191){return function(_0x12c293){if(!_0x12c293){_0x5c00b6[_0xc96c('0x19')](0x194);}return _0x12c293;};}function handleError(_0x1ef845,_0x3c0eb1){_0x3c0eb1=_0x3c0eb1||0x1f4;return function(_0x5e1727){logger[_0xc96c('0x2b')](_0x5e1727[_0xc96c('0x2c')]);if(_0x5e1727[_0xc96c('0x2d')]){delete _0x5e1727[_0xc96c('0x2d')];}_0x1ef845[_0xc96c('0x1a')](_0x3c0eb1)[_0xc96c('0x2e')](_0x5e1727);};}exports[_0xc96c('0x2f')]=function(_0x328ee4,_0x556108){var _0x3aa436={},_0x53c994={},_0x3f4b0e={'count':0x0,'rows':[]};var _0x442c7f=_[_0xc96c('0x30')](db['JscriptyProject'][_0xc96c('0x31')],function(_0x3240ba){return{'name':_0x3240ba[_0xc96c('0x32')],'type':_0x3240ba[_0xc96c('0x33')]['key']};});_0x53c994['model']=_[_0xc96c('0x30')](_0x442c7f,_0xc96c('0x2d'));_0x53c994[_0xc96c('0x34')]=_['keys'](_0x328ee4[_0xc96c('0x34')]);_0x53c994[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x53c994[_0xc96c('0x37')],_0x53c994['query']);_0x3aa436[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x53c994['model'],qs[_0xc96c('0x39')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x39')]));_0x3aa436[_0xc96c('0x38')]=_0x3aa436[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x3aa436['attributes']:_0x53c994[_0xc96c('0x37')];if(!_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x3aa436[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x328ee4['query']['limit']);_0x3aa436[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x328ee4['query']['offset']);}_0x3aa436[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x3aa436[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x328ee4[_0xc96c('0x34')],_0x53c994[_0xc96c('0x35')]),_0x442c7f);if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x41')]){_0x3aa436['where']=_[_0xc96c('0x42')](_0x3aa436[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x30')](_0x442c7f,function(_0x16b1f1){if(_0x16b1f1['type']!==_0xc96c('0x43')){var _0x3a0848={};_0x3a0848[_0x16b1f1[_0xc96c('0x2d')]]={'$like':'%'+_0x328ee4['query']['filter']+'%'};return _0x3a0848;}})});}_0x3aa436=_[_0xc96c('0x42')]({},_0x3aa436,_0x328ee4[_0xc96c('0x44')]);var _0x2e3bc3={'where':_0x3aa436['where']};return db[_0xc96c('0x45')][_0xc96c('0x20')](_0x2e3bc3)[_0xc96c('0x28')](function(_0x2a8ea7){_0x3f4b0e[_0xc96c('0x20')]=_0x2a8ea7;if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x46')]){_0x3aa436[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x45')]['findAll'](_0x3aa436);})['then'](function(_0x30b3ac){_0x3f4b0e[_0xc96c('0x48')]=_0x30b3ac;return _0x3f4b0e;})[_0xc96c('0x28')](respondWithFilteredResult(_0x556108,_0x3aa436))[_0xc96c('0x49')](handleError(_0x556108,null));};exports['show']=function(_0x5ee6ac,_0x14b712){var _0x1c18c1={'raw':![],'where':{'id':_0x5ee6ac[_0xc96c('0x4a')]['id']}},_0x44eb20={};_0x44eb20[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db[_0xc96c('0x45')]['rawAttributes']);_0x44eb20[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x5ee6ac[_0xc96c('0x34')]);_0x44eb20[_0xc96c('0x35')]=_['intersection'](_0x44eb20['model'],_0x44eb20[_0xc96c('0x34')]);_0x1c18c1[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x44eb20[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x5ee6ac[_0xc96c('0x34')][_0xc96c('0x39')]));_0x1c18c1[_0xc96c('0x38')]=_0x1c18c1[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x1c18c1[_0xc96c('0x38')]:_0x44eb20[_0xc96c('0x37')];if(_0x5ee6ac[_0xc96c('0x34')]['includeAll']){_0x1c18c1[_0xc96c('0x47')]=[{'all':!![]}];}_0x1c18c1=_[_0xc96c('0x42')]({},_0x1c18c1,_0x5ee6ac[_0xc96c('0x44')]);return db[_0xc96c('0x45')]['find'](_0x1c18c1)[_0xc96c('0x28')](handleEntityNotFound(_0x14b712,null))['then'](respondWithResult(_0x14b712,null))[_0xc96c('0x49')](handleError(_0x14b712,null));};exports[_0xc96c('0x4c')]=function(_0x565812,_0x2581ae){return db[_0xc96c('0x45')][_0xc96c('0x4c')](_0x565812[_0xc96c('0x4d')],{})[_0xc96c('0x28')](function(_0x1bd694){var _0x57e699=_0x565812['user']['get']({'plain':!![]});if(!_0x57e699)throw new Error(_0xc96c('0x4e'));if(_0x57e699['role']===_0xc96c('0x4f')){var _0x22b2e3=_0x1bd694[_0xc96c('0x29')]({'plain':!![]});var _0x17c764=_0xc96c('0x2a');return db[_0xc96c('0x50')][_0xc96c('0x51')]({'where':{'name':_0x17c764,'userProfileId':_0x57e699[_0xc96c('0x52')]},'raw':!![]})[_0xc96c('0x28')](function(_0xd78e10){if(_0xd78e10&&_0xd78e10['autoAssociation']===0x0){return db[_0xc96c('0x53')][_0xc96c('0x4c')]({'name':_0x22b2e3[_0xc96c('0x2d')],'resourceId':_0x22b2e3['id'],'type':_0xd78e10[_0xc96c('0x2d')],'sectionId':_0xd78e10['id']},{})[_0xc96c('0x28')](function(){return _0x1bd694;});}else{return _0x1bd694;}})[_0xc96c('0x49')](function(_0xad88c3){logger[_0xc96c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad88c3);throw _0xad88c3;});}return _0x1bd694;})['then'](respondWithResult(_0x2581ae,0xc9))['catch'](handleError(_0x2581ae,null));};exports['clone']=function(_0x356ef3,_0x46c6fb){var _0x2157b9={'where':{'id':_0x356ef3[_0xc96c('0x4a')]['id']}},_0x363676={};_0x363676[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db['JscriptyProject'][_0xc96c('0x31')]);_0x2157b9[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x363676[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x356ef3[_0xc96c('0x34')][_0xc96c('0x39')]));_0x2157b9['attributes']=_0x2157b9[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x2157b9[_0xc96c('0x38')]:_0x363676[_0xc96c('0x37')];if(_0x356ef3[_0xc96c('0x34')][_0xc96c('0x46')]){_0x2157b9[_0xc96c('0x47')]=[{'all':!![]}];}_0x2157b9=_[_0xc96c('0x42')]({},_0x2157b9,_0x356ef3[_0xc96c('0x44')]);return db[_0xc96c('0x45')][_0xc96c('0x51')](_0x2157b9)[_0xc96c('0x28')](handleEntityNotFound(_0x46c6fb,null))[_0xc96c('0x28')](function(_0x177a4b){if(_0x177a4b){var _0x5a6e3e=_0x177a4b[_0xc96c('0x29')]({'plain':!![]});_0x5a6e3e=qs[_0xc96c('0x54')](_0x5a6e3e,['id',_0xc96c('0x55'),_0xc96c('0x56')]);_0x356ef3[_0xc96c('0x4d')]=_['omit'](_0x356ef3[_0xc96c('0x4d')],['id',_0xc96c('0x55'),_0xc96c('0x56')]);return db[_0xc96c('0x45')]['create'](_[_0xc96c('0x42')](_0x5a6e3e,_0x356ef3[_0xc96c('0x4d')]),{'include':_0x356ef3['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x46de63){var _0x190d99=_0x356ef3[_0xc96c('0x4f')][_0xc96c('0x29')]({'plain':!![]});if(!_0x190d99)throw new Error(_0xc96c('0x4e'));if(_0x190d99['role']==='user'){var _0x283966=_0x46de63[_0xc96c('0x29')]({'plain':!![]});var _0x402b9a=_0xc96c('0x2a');return db[_0xc96c('0x50')]['find']({'where':{'name':_0x402b9a,'userProfileId':_0x190d99[_0xc96c('0x52')]},'raw':!![]})[_0xc96c('0x28')](function(_0x3a31bd){if(_0x3a31bd&&_0x3a31bd[_0xc96c('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x283966[_0xc96c('0x2d')],'resourceId':_0x283966['id'],'type':_0x3a31bd[_0xc96c('0x2d')],'sectionId':_0x3a31bd['id']},{})['then'](function(){return _0x46de63;});}else{return _0x46de63;}})[_0xc96c('0x49')](function(_0x5f090e){logger[_0xc96c('0x2b')](_0xc96c('0x58'),_0x5f090e);throw _0x5f090e;});}return _0x46de63;});}})[_0xc96c('0x28')](respondWithResult(_0x46c6fb,0xc9))[_0xc96c('0x49')](handleError(_0x46c6fb,null));};exports[_0xc96c('0x26')]=function(_0x296e7d,_0x51a5f0){if(_0x296e7d[_0xc96c('0x4d')]['id']){delete _0x296e7d[_0xc96c('0x4d')]['id'];}return db[_0xc96c('0x45')]['find']({'where':{'id':_0x296e7d[_0xc96c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51a5f0,null))[_0xc96c('0x28')](saveUpdates(_0x296e7d[_0xc96c('0x4d')],null))['then'](respondWithResult(_0x51a5f0,null))[_0xc96c('0x49')](handleError(_0x51a5f0,null));};exports['destroy']=function(_0x424b0a,_0x1c5a9c){return db[_0xc96c('0x45')][_0xc96c('0x51')]({'where':{'id':_0x424b0a[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x1c5a9c,null))[_0xc96c('0x28')](removeEntity(_0x1c5a9c,null))[_0xc96c('0x49')](handleError(_0x1c5a9c,null));};exports[_0xc96c('0x59')]=function(_0x541f73,_0x373361,_0x2a1468){var _0x1b8b5e={'raw':!![],'where':{}};var _0x43f94e={};var _0x5282cb={'count':0x0,'rows':[]};return db[_0xc96c('0x45')][_0xc96c('0x5a')]({'where':{'id':_0x541f73['params']['id']}})['then'](handleEntityNotFound(_0x373361,null))[_0xc96c('0x28')](function(_0x4c025b){if(_0x4c025b){_0x43f94e[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db[_0xc96c('0x5b')][_0xc96c('0x31')]);_0x43f94e[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x541f73[_0xc96c('0x34')]);_0x43f94e[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x43f94e['model'],_0x43f94e[_0xc96c('0x34')]);_0x1b8b5e[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x43f94e['model'],qs['fields'](_0x541f73[_0xc96c('0x34')][_0xc96c('0x39')]));_0x1b8b5e[_0xc96c('0x38')]=_0x1b8b5e[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x1b8b5e[_0xc96c('0x38')]:_0x43f94e[_0xc96c('0x37')];if(!_0x541f73['query'][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x1b8b5e['limit']=qs[_0xc96c('0x1f')](_0x541f73['query'][_0xc96c('0x1f')]);_0x1b8b5e[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x541f73[_0xc96c('0x34')][_0xc96c('0x1d')]);}_0x1b8b5e[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x541f73[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x1b8b5e['where']=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x541f73['query'],_0x43f94e[_0xc96c('0x35')]));_0x1b8b5e['where'][_0xc96c('0x5c')]=_0x4c025b['id'];if(_0x541f73[_0xc96c('0x34')][_0xc96c('0x41')]){_0x1b8b5e['where']=_[_0xc96c('0x42')](_0x1b8b5e[_0xc96c('0x3f')],{'$or':_['map'](_0x1b8b5e[_0xc96c('0x38')],function(_0x46bf83){var _0x414608={};_0x414608[_0x46bf83]={'$like':'%'+_0x541f73['query'][_0xc96c('0x41')]+'%'};return _0x414608;})});}_0x1b8b5e=_[_0xc96c('0x42')]({},_0x1b8b5e,_0x541f73[_0xc96c('0x44')]);return db[_0xc96c('0x5b')][_0xc96c('0x20')]({'where':_0x1b8b5e[_0xc96c('0x3f')]})[_0xc96c('0x28')](function(_0x36faf7){_0x5282cb[_0xc96c('0x20')]=_0x36faf7;if(_0x541f73[_0xc96c('0x34')][_0xc96c('0x46')]){_0x1b8b5e[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x5b')][_0xc96c('0x5d')](_0x1b8b5e);})[_0xc96c('0x28')](function(_0x54c9ad){_0x5282cb[_0xc96c('0x48')]=_0x54c9ad;return _0x5282cb;});}})[_0xc96c('0x28')](respondWithFilteredResult(_0x373361,_0x1b8b5e))[_0xc96c('0x49')](handleError(_0x373361,null));};exports[_0xc96c('0x5e')]=function(_0x447a32,_0x5c89da,_0x3006ca){var _0x3da260={'raw':!![],'where':{}};var _0x3fd4dd={};var _0x239846={'count':0x0,'rows':[]};return db[_0xc96c('0x45')]['findOne']({'where':{'id':_0x447a32['params']['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x5c89da,null))[_0xc96c('0x28')](function(_0x5ad56e){if(_0x5ad56e){_0x3fd4dd[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db['JscriptyAnswerReport'][_0xc96c('0x31')]);_0x3fd4dd[_0xc96c('0x34')]=_['keys'](_0x447a32[_0xc96c('0x34')]);_0x3fd4dd[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x3fd4dd[_0xc96c('0x37')],_0x3fd4dd['query']);_0x3da260[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x3fd4dd['model'],qs['fields'](_0x447a32[_0xc96c('0x34')]['fields']));_0x3da260[_0xc96c('0x38')]=_0x3da260[_0xc96c('0x38')]['length']?_0x3da260['attributes']:_0x3fd4dd[_0xc96c('0x37')];if(!_0x447a32[_0xc96c('0x34')]['hasOwnProperty'](_0xc96c('0x3c'))){_0x3da260[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x447a32[_0xc96c('0x34')][_0xc96c('0x1f')]);_0x3da260[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x447a32[_0xc96c('0x34')][_0xc96c('0x1d')]);}_0x3da260[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x447a32[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x3da260[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x447a32['query'],_0x3fd4dd[_0xc96c('0x35')]));_0x3da260[_0xc96c('0x3f')][_0xc96c('0x5c')]=_0x5ad56e['id'];if(_0x447a32[_0xc96c('0x34')]['filter']){_0x3da260[_0xc96c('0x3f')]=_[_0xc96c('0x42')](_0x3da260[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x30')](_0x3da260[_0xc96c('0x38')],function(_0x22c205){var _0x5768ec={};_0x5768ec[_0x22c205]={'$like':'%'+_0x447a32[_0xc96c('0x34')]['filter']+'%'};return _0x5768ec;})});}_0x3da260=_['merge']({},_0x3da260,_0x447a32['options']);return db['JscriptyAnswerReport']['count']({'where':_0x3da260[_0xc96c('0x3f')]})[_0xc96c('0x28')](function(_0x58a76d){_0x239846['count']=_0x58a76d;if(_0x447a32[_0xc96c('0x34')][_0xc96c('0x46')]){_0x3da260[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x5f')][_0xc96c('0x5d')](_0x3da260);})[_0xc96c('0x28')](function(_0x1128fd){_0x239846[_0xc96c('0x48')]=_0x1128fd;return _0x239846;});}})[_0xc96c('0x28')](respondWithFilteredResult(_0x5c89da,_0x3da260))[_0xc96c('0x49')](handleError(_0x5c89da,null));};function char(_0x2828a3){return _0xc96c('0x60')===typeof _0x2828a3?String[_0xc96c('0x61')][_0xc96c('0x23')](null,arguments):_0x2828a3;}function needsEncapsulation(_0x3bb791){return!!_0x3bb791&&(_0x3bb791[_0xc96c('0x62')]()['indexOf'](char(0xd))>=0x0||_0x3bb791[_0xc96c('0x62')]()[_0xc96c('0x63')](char(0xa))>=0x0||_0x3bb791['toString']()[_0xc96c('0x63')](char(0x2c))>=0x0||_0x3bb791[_0xc96c('0x62')]()[_0xc96c('0x63')](char(0x22))>=0x0);}function encapsulate(_0x4372fc){var _0x472817=char(0x22),_0x117d57='\x5c'+char(0x22),_0x8fff0=_0x4372fc[_0xc96c('0x62')]()[_0xc96c('0x64')](new RegExp(_0x472817,'g'),_0x117d57);return _0x472817+_0x8fff0+_0x472817;}exports[_0xc96c('0x65')]=function(_0x6cecd7,_0x1c66d6,_0x6b9120){var _0x8b26da,_0x1918ad;var _0xc65e47={'where':{'ProjectId':_0x6cecd7[_0xc96c('0x4a')]['id']}};if(_0x6cecd7['query'][_0xc96c('0x66')]){_0xc65e47[_0xc96c('0x3f')]['starttime']=JSON[_0xc96c('0x67')](_0x6cecd7[_0xc96c('0x34')][_0xc96c('0x66')]);}return db[_0xc96c('0x5b')][_0xc96c('0x5d')](_0xc65e47)['then'](handleEntityNotFound(_0x1c66d6,null))[_0xc96c('0x28')](function(_0x44d47e){if(_0x44d47e){_0x8b26da=_0x44d47e;return db[_0xc96c('0x68')][_0xc96c('0x5d')]({'where':{'SessionId':{'$in':_[_0xc96c('0x30')](_0x8b26da,'id')},'ProjectId':_0x6cecd7[_0xc96c('0x4a')]['id']},'order':_0xc96c('0x69')});}})['then'](handleEntityNotFound(_0x1c66d6,null))[_0xc96c('0x28')](function(_0x53be56){if(_0x53be56){_0x1918ad=_0x53be56;var _0x29ac30={};for(var _0x27eb67=0x0,_0x151724=_0x1918ad['length'];_0x27eb67<_0x151724;_0x27eb67++){if(!_0x29ac30['hasOwnProperty'](_0x1918ad[_0x27eb67]['questionId'])){_0x29ac30[_0x1918ad[_0x27eb67][_0xc96c('0x6a')]]=needsEncapsulation(_0x1918ad[_0x27eb67][_0xc96c('0x6b')])?encapsulate(_0x1918ad[_0x27eb67][_0xc96c('0x6b')]):_0x1918ad[_0x27eb67]['question'];}}var _0x402662=[],_0x8d50d1={};for(var _0x237a06=0x0,_0x2edf8b=_0x8b26da[_0xc96c('0x3a')];_0x237a06<_0x2edf8b;_0x237a06++){_0x8d50d1={'ProjectId':_0x6cecd7[_0xc96c('0x4a')]['id'],'SessionId':_0x8b26da[_0x237a06]['id'],'StartTime':moment(_0x8b26da[_0x237a06][_0xc96c('0x6c')])[_0xc96c('0x6d')](_0xc96c('0x6e'))};for(var _0x103d9e=0x0,_0x19a935=_0x1918ad[_0xc96c('0x3a')];_0x103d9e<_0x19a935;_0x103d9e++){if(_0x1918ad[_0x103d9e]['SessionId']==_0x8b26da[_0x237a06]['id']&&_0x29ac30[_0xc96c('0x3b')](_0x1918ad[_0x103d9e][_0xc96c('0x6a')])){_0x8d50d1[_0x29ac30[_0x1918ad[_0x103d9e][_0xc96c('0x6a')]]]=_0x1918ad[_0x103d9e][_0xc96c('0x6f')];}}for(var _0x1c1ac0 in _0x29ac30){if(!_0x8d50d1[_0xc96c('0x3b')](_0x29ac30[_0x1c1ac0])){_0x8d50d1[_0x29ac30[_0x1c1ac0]]=null;}}_0x402662['push'](_0x8d50d1);}return _0x402662;}})['then'](function(_0x43718f){if(!_[_0xc96c('0x70')](_0x43718f)){var _0x521406=toCsv(_0x43718f);var _0x8d42bb=Date[_0xc96c('0x71')]();fs['writeFileSync'](util[_0xc96c('0x6d')](_0xc96c('0x72'),_0x6cecd7[_0xc96c('0x4a')]['id'],_0x8d42bb),_0x521406);_0x1c66d6[_0xc96c('0x73')]('Content-disposition',_0xc96c('0x74')+util[_0xc96c('0x6d')](_0xc96c('0x75'),_0x6cecd7['params']['id'],_0x8d42bb));_0x1c66d6[_0xc96c('0x73')](_0xc96c('0x76'),_0xc96c('0x77'));return _0x1c66d6[_0xc96c('0x78')](util[_0xc96c('0x6d')](_0xc96c('0x72'),_0x6cecd7['params']['id'],_0x8d42bb));}else{return _0x1c66d6[_0xc96c('0x19')](0xcc);}})[_0xc96c('0x49')](handleError(_0x1c66d6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f92fb71..6d539b3 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 _0x54da=['path','rimraf','../../config/environment','./jscriptyProject.attributes','define','lodash','../../config/logger','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x54da,0x9d));var _0xa54d=function(_0x3f7d24,_0x3ce1d5){_0x3f7d24=_0x3f7d24-0x0;var _0x143f6e=_0x54da[_0x3f7d24];return _0x143f6e;};'use strict';var _=require(_0xa54d('0x0'));var util=require('util');var logger=require(_0xa54d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa54d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54d('0x3'));var rimraf=require(_0xa54d('0x4'));var config=require(_0xa54d('0x5'));var attributes=require(_0xa54d('0x6'));module['exports']=function(_0x57f10a,_0x63ca18){return _0x57f10a[_0xa54d('0x7')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13fe=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects'];(function(_0x1e06c0,_0x3c8d32){var _0x20a073=function(_0x5e370f){while(--_0x5e370f){_0x1e06c0['push'](_0x1e06c0['shift']());}};_0x20a073(++_0x3c8d32);}(_0x13fe,0x138));var _0xe13f=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x13fe[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xe13f('0x0'));var util=require(_0xe13f('0x1'));var logger=require(_0xe13f('0x2'))(_0xe13f('0x3'));var moment=require(_0xe13f('0x4'));var BPromise=require(_0xe13f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe13f('0x6'));var rimraf=require(_0xe13f('0x7'));var config=require(_0xe13f('0x8'));var attributes=require(_0xe13f('0x9'));module[_0xe13f('0xa')]=function(_0x1ddbff,_0x2832ce){return _0x1ddbff['define']('JscriptyProject',attributes,{'tableName':_0xe13f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 237300e..2fc287b 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x88301a,_0x44c708){var _0x7321b=function(_0x39626e){while(--_0x39626e){_0x88301a['push'](_0x88301a['shift']());}};_0x7321b(++_0x44c708);}(_0xb43b,0x1b2));var _0xbb43=function(_0x464c2d,_0xda721c){_0x464c2d=_0x464c2d-0x0;var _0x3d6dae=_0xb43b[_0x464c2d];return _0x3d6dae;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 3c45424..a4c02dd 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 _0x4d57=['Router','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','multer','path','connect-timeout','express'];(function(_0x2743b4,_0x354c21){var _0x58d227=function(_0x494b4f){while(--_0x494b4f){_0x2743b4['push'](_0x2743b4['shift']());}};_0x58d227(++_0x354c21);}(_0x4d57,0x1e2));var _0x74d5=function(_0x14876b,_0x51685c){_0x14876b=_0x14876b-0x0;var _0x525dc5=_0x4d57[_0x14876b];return _0x525dc5;};'use strict';var multer=require(_0x74d5('0x0'));var util=require('util');var path=require(_0x74d5('0x1'));var timeout=require(_0x74d5('0x2'));var express=require(_0x74d5('0x3'));var router=express[_0x74d5('0x4')]();var fs_extra=require(_0x74d5('0x5'));var auth=require(_0x74d5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x74d5('0x7'));router[_0x74d5('0x8')]('/',auth[_0x74d5('0x9')](),controller[_0x74d5('0xa')]);router[_0x74d5('0x8')](_0x74d5('0xb'),auth[_0x74d5('0x9')](),controller['describe']);router['get'](_0x74d5('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x74d5('0xd')]('/',auth[_0x74d5('0x9')](),controller[_0x74d5('0xe')]);router[_0x74d5('0xf')](_0x74d5('0xc'),auth[_0x74d5('0x9')](),controller[_0x74d5('0x10')]);router['delete'](_0x74d5('0xc'),auth[_0x74d5('0x9')](),controller[_0x74d5('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa5ee=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa5ee,0x19f));var _0xea5e=function(_0x1d17b3,_0x4bd652){_0x1d17b3=_0x1d17b3-0x0;var _0x5160a5=_0xa5ee[_0x1d17b3];return _0x5160a5;};'use strict';var multer=require(_0xea5e('0x0'));var util=require(_0xea5e('0x1'));var path=require('path');var timeout=require(_0xea5e('0x2'));var express=require(_0xea5e('0x3'));var router=express[_0xea5e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea5e('0x5'));var interaction=require(_0xea5e('0x6'));var config=require(_0xea5e('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xea5e('0x8')]('/',auth[_0xea5e('0x9')](),controller['index']);router[_0xea5e('0x8')](_0xea5e('0xa'),auth['isAuthenticated'](),controller[_0xea5e('0xb')]);router[_0xea5e('0x8')](_0xea5e('0xc'),auth[_0xea5e('0x9')](),controller['show']);router[_0xea5e('0xd')]('/',auth[_0xea5e('0x9')](),controller[_0xea5e('0xe')]);router['put'](_0xea5e('0xc'),auth[_0xea5e('0x9')](),controller['update']);router[_0xea5e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xea5e('0x10')]);module[_0xea5e('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c051c3d..4bd5968 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x12b639,_0x23513b){_0x12b639=_0x12b639-0x0;var _0x3973ac=_0x7a54[_0x12b639];return _0x3973ac;};'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(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7a54,0x106));var _0x47a5=function(_0x277c20,_0x2edb83){_0x277c20=_0x277c20-0x0;var _0x22abd7=_0x7a54[_0x277c20];return _0x22abd7;};'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 95c8a13..7d6d37b 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 _0xb6b5=['Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','intersection','create','body','update','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set'];(function(_0x312945,_0x27b513){var _0xf91eb5=function(_0x1c5c18){while(--_0x1c5c18){_0x312945['push'](_0x312945['shift']());}};_0xf91eb5(++_0x27b513);}(_0xb6b5,0x7c));var _0x5b6b=function(_0x3b310d,_0x219918){_0x3b310d=_0x3b310d-0x0;var _0x199171=_0xb6b5[_0x3b310d];return _0x199171;};'use strict';var emlformat=require(_0x5b6b('0x0'));var rimraf=require(_0x5b6b('0x1'));var zipdir=require(_0x5b6b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b6b('0x3'));var moment=require('moment');var BPromise=require(_0x5b6b('0x4'));var Mustache=require(_0x5b6b('0x5'));var util=require(_0x5b6b('0x6'));var path=require(_0x5b6b('0x7'));var sox=require(_0x5b6b('0x8'));var csv=require(_0x5b6b('0x9'));var ejs=require(_0x5b6b('0xa'));var fs=require('fs');var fs_extra=require(_0x5b6b('0xb'));var _=require(_0x5b6b('0xc'));var squel=require(_0x5b6b('0xd'));var crypto=require(_0x5b6b('0xe'));var jsforce=require(_0x5b6b('0xf'));var deskjs=require(_0x5b6b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5b6b('0x11'));var Papa=require(_0x5b6b('0x12'));var Redis=require('ioredis');var authService=require(_0x5b6b('0x13'));var qs=require(_0x5b6b('0x14'));var as=require(_0x5b6b('0x15'));var hardwareService=require(_0x5b6b('0x16'));var logger=require(_0x5b6b('0x17'))(_0x5b6b('0x18'));var utils=require(_0x5b6b('0x19'));var config=require(_0x5b6b('0x1a'));var licenseUtil=require(_0x5b6b('0x1b'));var db=require(_0x5b6b('0x1c'))['db'];function respondWithStatusCode(_0x40aa75,_0x42d03b){_0x42d03b=_0x42d03b||0xcc;return function(_0x3a8909){if(_0x3a8909){return _0x40aa75[_0x5b6b('0x1d')](_0x42d03b);}return _0x40aa75['status'](_0x42d03b)[_0x5b6b('0x1e')]();};}function respondWithResult(_0x5739fa,_0x105df5){_0x105df5=_0x105df5||0xc8;return function(_0x55d917){if(_0x55d917){return _0x5739fa['status'](_0x105df5)[_0x5b6b('0x1f')](_0x55d917);}};}function respondWithFilteredResult(_0x124f01,_0x55ea87){return function(_0x34f7e3){if(_0x34f7e3){var _0x3b215c=typeof _0x55ea87[_0x5b6b('0x20')]===_0x5b6b('0x21')&&typeof _0x55ea87[_0x5b6b('0x22')]===_0x5b6b('0x21');var _0x4abb11=_0x34f7e3[_0x5b6b('0x23')];var _0x3e02cd=_0x3b215c?0x0:_0x55ea87[_0x5b6b('0x20')];var _0x5d1779=_0x3b215c?_0x34f7e3[_0x5b6b('0x23')]:_0x55ea87[_0x5b6b('0x20')]+_0x55ea87[_0x5b6b('0x22')];var _0x58e303;if(_0x5d1779>=_0x4abb11){_0x5d1779=_0x4abb11;_0x58e303=0xc8;}else{_0x58e303=0xce;}_0x124f01[_0x5b6b('0x24')](_0x58e303);return _0x124f01[_0x5b6b('0x25')](_0x5b6b('0x26'),_0x3e02cd+'-'+_0x5d1779+'/'+_0x4abb11)[_0x5b6b('0x1f')](_0x34f7e3);}return null;};}function patchUpdates(_0x5b51e4){return function(_0x112ad4){try{jsonpatch[_0x5b6b('0x27')](_0x112ad4,_0x5b51e4,!![]);}catch(_0x5c3098){return BPromise[_0x5b6b('0x28')](_0x5c3098);}return _0x112ad4[_0x5b6b('0x29')]();};}function saveUpdates(_0x3286c4,_0x495fbc){return function(_0x505785){if(_0x505785){return _0x505785['update'](_0x3286c4)[_0x5b6b('0x2a')](function(_0x1523a8){return _0x1523a8;});}return null;};}function removeEntity(_0xf0a7da,_0x2c968a){return function(_0x242aa6){if(_0x242aa6){return _0x242aa6[_0x5b6b('0x2b')]()[_0x5b6b('0x2a')](function(){_0xf0a7da['status'](0xcc)[_0x5b6b('0x1e')]();});}};}function handleEntityNotFound(_0x50e85e,_0x3c1e93){return function(_0x4192e5){if(!_0x4192e5){_0x50e85e['sendStatus'](0x194);}return _0x4192e5;};}function handleError(_0x1343ed,_0x2b3020){_0x2b3020=_0x2b3020||0x1f4;return function(_0x49bd0e){logger[_0x5b6b('0x2c')](_0x49bd0e[_0x5b6b('0x2d')]);if(_0x49bd0e['name']){delete _0x49bd0e['name'];}_0x1343ed['status'](_0x2b3020)[_0x5b6b('0x2e')](_0x49bd0e);};}exports[_0x5b6b('0x2f')]=function(_0x8a9754,_0x41352e){var _0x16ccfa={},_0x360f94={},_0x4566de={'count':0x0,'rows':[]};var _0x51c45e=_[_0x5b6b('0x30')](db[_0x5b6b('0x31')][_0x5b6b('0x32')],function(_0x65c01e){return{'name':_0x65c01e[_0x5b6b('0x33')],'type':_0x65c01e[_0x5b6b('0x34')][_0x5b6b('0x35')]};});_0x360f94[_0x5b6b('0x36')]=_[_0x5b6b('0x30')](_0x51c45e,_0x5b6b('0x37'));_0x360f94[_0x5b6b('0x38')]=_[_0x5b6b('0x39')](_0x8a9754[_0x5b6b('0x38')]);_0x360f94['filters']=_['intersection'](_0x360f94[_0x5b6b('0x36')],_0x360f94[_0x5b6b('0x38')]);_0x16ccfa[_0x5b6b('0x3a')]=_['intersection'](_0x360f94[_0x5b6b('0x36')],qs[_0x5b6b('0x3b')](_0x8a9754[_0x5b6b('0x38')]['fields']));_0x16ccfa[_0x5b6b('0x3a')]=_0x16ccfa[_0x5b6b('0x3a')][_0x5b6b('0x3c')]?_0x16ccfa['attributes']:_0x360f94[_0x5b6b('0x36')];if(!_0x8a9754[_0x5b6b('0x38')]['hasOwnProperty'](_0x5b6b('0x3d'))){_0x16ccfa[_0x5b6b('0x22')]=qs[_0x5b6b('0x22')](_0x8a9754['query'][_0x5b6b('0x22')]);_0x16ccfa[_0x5b6b('0x20')]=qs[_0x5b6b('0x20')](_0x8a9754[_0x5b6b('0x38')][_0x5b6b('0x20')]);}_0x16ccfa['order']=qs[_0x5b6b('0x3e')](_0x8a9754[_0x5b6b('0x38')][_0x5b6b('0x3e')]);_0x16ccfa[_0x5b6b('0x3f')]=qs[_0x5b6b('0x40')](_[_0x5b6b('0x41')](_0x8a9754[_0x5b6b('0x38')],_0x360f94['filters']),_0x51c45e);if(_0x8a9754[_0x5b6b('0x38')][_0x5b6b('0x42')]){_0x16ccfa[_0x5b6b('0x3f')]=_[_0x5b6b('0x43')](_0x16ccfa[_0x5b6b('0x3f')],{'$or':_[_0x5b6b('0x30')](_0x51c45e,function(_0xc72725){if(_0xc72725[_0x5b6b('0x34')]!=='VIRTUAL'){var _0x4c8e81={};_0x4c8e81[_0xc72725[_0x5b6b('0x37')]]={'$like':'%'+_0x8a9754[_0x5b6b('0x38')]['filter']+'%'};return _0x4c8e81;}})});}_0x16ccfa=_[_0x5b6b('0x43')]({},_0x16ccfa,_0x8a9754[_0x5b6b('0x44')]);var _0x471f8b={'where':_0x16ccfa[_0x5b6b('0x3f')]};return db[_0x5b6b('0x31')][_0x5b6b('0x23')](_0x471f8b)[_0x5b6b('0x2a')](function(_0x8faef3){_0x4566de[_0x5b6b('0x23')]=_0x8faef3;if(_0x8a9754[_0x5b6b('0x38')][_0x5b6b('0x45')]){_0x16ccfa[_0x5b6b('0x46')]=[{'all':!![]}];}return db[_0x5b6b('0x31')][_0x5b6b('0x47')](_0x16ccfa);})[_0x5b6b('0x2a')](function(_0x5621b9){_0x4566de['rows']=_0x5621b9;return _0x4566de;})[_0x5b6b('0x2a')](respondWithFilteredResult(_0x41352e,_0x16ccfa))[_0x5b6b('0x48')](handleError(_0x41352e,null));};exports[_0x5b6b('0x49')]=function(_0x362766,_0x35dd24){var _0xebadc8={'raw':!![],'where':{'id':_0x362766[_0x5b6b('0x4a')]['id']}},_0x339208={};_0x339208[_0x5b6b('0x36')]=_[_0x5b6b('0x39')](db[_0x5b6b('0x31')][_0x5b6b('0x32')]);_0x339208['query']=_[_0x5b6b('0x39')](_0x362766[_0x5b6b('0x38')]);_0x339208['filters']=_[_0x5b6b('0x4b')](_0x339208['model'],_0x339208['query']);_0xebadc8[_0x5b6b('0x3a')]=_[_0x5b6b('0x4b')](_0x339208[_0x5b6b('0x36')],qs['fields'](_0x362766[_0x5b6b('0x38')][_0x5b6b('0x3b')]));_0xebadc8[_0x5b6b('0x3a')]=_0xebadc8[_0x5b6b('0x3a')][_0x5b6b('0x3c')]?_0xebadc8['attributes']:_0x339208[_0x5b6b('0x36')];if(_0x362766[_0x5b6b('0x38')][_0x5b6b('0x45')]){_0xebadc8['include']=[{'all':!![]}];}_0xebadc8=_['merge']({},_0xebadc8,_0x362766[_0x5b6b('0x44')]);return db[_0x5b6b('0x31')]['find'](_0xebadc8)[_0x5b6b('0x2a')](handleEntityNotFound(_0x35dd24,null))[_0x5b6b('0x2a')](respondWithResult(_0x35dd24,null))['catch'](handleError(_0x35dd24,null));};exports[_0x5b6b('0x4c')]=function(_0x3ee111,_0x5e5866){return db[_0x5b6b('0x31')][_0x5b6b('0x4c')](_0x3ee111[_0x5b6b('0x4d')],{})[_0x5b6b('0x2a')](respondWithResult(_0x5e5866,0xc9))[_0x5b6b('0x48')](handleError(_0x5e5866,null));};exports[_0x5b6b('0x4e')]=function(_0x560b60,_0x258d20){if(_0x560b60[_0x5b6b('0x4d')]['id']){delete _0x560b60['body']['id'];}return db[_0x5b6b('0x31')][_0x5b6b('0x4f')]({'where':{'id':_0x560b60['params']['id']}})[_0x5b6b('0x2a')](handleEntityNotFound(_0x258d20,null))[_0x5b6b('0x2a')](saveUpdates(_0x560b60[_0x5b6b('0x4d')],null))[_0x5b6b('0x2a')](respondWithResult(_0x258d20,null))['catch'](handleError(_0x258d20,null));};exports[_0x5b6b('0x2b')]=function(_0x43e73b,_0x5beaeb){return db[_0x5b6b('0x31')][_0x5b6b('0x4f')]({'where':{'id':_0x43e73b[_0x5b6b('0x4a')]['id']}})[_0x5b6b('0x2a')](handleEntityNotFound(_0x5beaeb,null))[_0x5b6b('0x2a')](removeEntity(_0x5beaeb,null))[_0x5b6b('0x48')](handleError(_0x5beaeb,null));};exports[_0x5b6b('0x50')]=function(_0x84a5db,_0x27cef8){return db[_0x5b6b('0x31')]['describe']()[_0x5b6b('0x2a')](respondWithResult(_0x27cef8,null))['catch'](handleError(_0x27cef8,null));}; \ No newline at end of file +var _0x4cf2=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','includeAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x1cfdc2,_0x16ca1b){var _0x1e1df2=function(_0x4380b3){while(--_0x4380b3){_0x1cfdc2['push'](_0x1cfdc2['shift']());}};_0x1e1df2(++_0x16ca1b);}(_0x4cf2,0x16d));var _0x24cf=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x4cf2[_0x4629ed];return _0x52ca04;};'use strict';var emlformat=require(_0x24cf('0x0'));var rimraf=require(_0x24cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24cf('0x2'));var rp=require('request-promise');var moment=require(_0x24cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24cf('0x4'));var util=require(_0x24cf('0x5'));var path=require(_0x24cf('0x6'));var sox=require(_0x24cf('0x7'));var csv=require(_0x24cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24cf('0x9'));var _=require(_0x24cf('0xa'));var squel=require(_0x24cf('0xb'));var crypto=require(_0x24cf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x24cf('0xd'));var toCsv=require(_0x24cf('0x8'));var querystring=require(_0x24cf('0xe'));var Papa=require(_0x24cf('0xf'));var Redis=require(_0x24cf('0x10'));var authService=require(_0x24cf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x24cf('0x12'));var hardwareService=require(_0x24cf('0x13'));var logger=require(_0x24cf('0x14'))(_0x24cf('0x15'));var utils=require('../../config/utils');var config=require(_0x24cf('0x16'));var licenseUtil=require(_0x24cf('0x17'));var db=require(_0x24cf('0x18'))['db'];function respondWithStatusCode(_0x51fb25,_0x3cc63d){_0x3cc63d=_0x3cc63d||0xcc;return function(_0x405b0c){if(_0x405b0c){return _0x51fb25[_0x24cf('0x19')](_0x3cc63d);}return _0x51fb25['status'](_0x3cc63d)[_0x24cf('0x1a')]();};}function respondWithResult(_0x391311,_0x3d1e67){_0x3d1e67=_0x3d1e67||0xc8;return function(_0x3107ab){if(_0x3107ab){return _0x391311[_0x24cf('0x1b')](_0x3d1e67)['json'](_0x3107ab);}};}function respondWithFilteredResult(_0x202231,_0x4a81ce){return function(_0x1fab21){if(_0x1fab21){var _0x5e64be=typeof _0x4a81ce[_0x24cf('0x1c')]===_0x24cf('0x1d')&&typeof _0x4a81ce['limit']==='undefined';var _0x310bc4=_0x1fab21[_0x24cf('0x1e')];var _0x21a367=_0x5e64be?0x0:_0x4a81ce[_0x24cf('0x1c')];var _0x4ecca6=_0x5e64be?_0x1fab21[_0x24cf('0x1e')]:_0x4a81ce[_0x24cf('0x1c')]+_0x4a81ce['limit'];var _0x18a696;if(_0x4ecca6>=_0x310bc4){_0x4ecca6=_0x310bc4;_0x18a696=0xc8;}else{_0x18a696=0xce;}_0x202231['status'](_0x18a696);return _0x202231[_0x24cf('0x1f')](_0x24cf('0x20'),_0x21a367+'-'+_0x4ecca6+'/'+_0x310bc4)[_0x24cf('0x21')](_0x1fab21);}return null;};}function patchUpdates(_0x5eb2e6){return function(_0x1616f9){try{jsonpatch[_0x24cf('0x22')](_0x1616f9,_0x5eb2e6,!![]);}catch(_0x3c3d0e){return BPromise[_0x24cf('0x23')](_0x3c3d0e);}return _0x1616f9[_0x24cf('0x24')]();};}function saveUpdates(_0x1b7a8c,_0x44834e){return function(_0x8ef45d){if(_0x8ef45d){return _0x8ef45d['update'](_0x1b7a8c)[_0x24cf('0x25')](function(_0x1aeea1){return _0x1aeea1;});}return null;};}function removeEntity(_0x4bb534,_0x41e2a9){return function(_0x4bbeb1){if(_0x4bbeb1){return _0x4bbeb1[_0x24cf('0x26')]()['then'](function(){_0x4bb534[_0x24cf('0x1b')](0xcc)[_0x24cf('0x1a')]();});}};}function handleEntityNotFound(_0x156476,_0x216533){return function(_0x2c718b){if(!_0x2c718b){_0x156476[_0x24cf('0x19')](0x194);}return _0x2c718b;};}function handleError(_0x208ed8,_0x4f660a){_0x4f660a=_0x4f660a||0x1f4;return function(_0x5a8960){logger[_0x24cf('0x27')](_0x5a8960[_0x24cf('0x28')]);if(_0x5a8960[_0x24cf('0x29')]){delete _0x5a8960[_0x24cf('0x29')];}_0x208ed8[_0x24cf('0x1b')](_0x4f660a)[_0x24cf('0x2a')](_0x5a8960);};}exports[_0x24cf('0x2b')]=function(_0xe55345,_0x109cbb){var _0x109f77={},_0x47cf0f={},_0x45aec9={'count':0x0,'rows':[]};var _0x17976f=_['map'](db[_0x24cf('0x2c')][_0x24cf('0x2d')],function(_0xe7479c){return{'name':_0xe7479c['fieldName'],'type':_0xe7479c[_0x24cf('0x2e')][_0x24cf('0x2f')]};});_0x47cf0f[_0x24cf('0x30')]=_['map'](_0x17976f,_0x24cf('0x29'));_0x47cf0f[_0x24cf('0x31')]=_['keys'](_0xe55345[_0x24cf('0x31')]);_0x47cf0f[_0x24cf('0x32')]=_[_0x24cf('0x33')](_0x47cf0f[_0x24cf('0x30')],_0x47cf0f[_0x24cf('0x31')]);_0x109f77[_0x24cf('0x34')]=_[_0x24cf('0x33')](_0x47cf0f[_0x24cf('0x30')],qs[_0x24cf('0x35')](_0xe55345[_0x24cf('0x31')][_0x24cf('0x35')]));_0x109f77['attributes']=_0x109f77[_0x24cf('0x34')][_0x24cf('0x36')]?_0x109f77[_0x24cf('0x34')]:_0x47cf0f[_0x24cf('0x30')];if(!_0xe55345[_0x24cf('0x31')][_0x24cf('0x37')](_0x24cf('0x38'))){_0x109f77[_0x24cf('0x39')]=qs['limit'](_0xe55345['query'][_0x24cf('0x39')]);_0x109f77['offset']=qs[_0x24cf('0x1c')](_0xe55345[_0x24cf('0x31')][_0x24cf('0x1c')]);}_0x109f77[_0x24cf('0x3a')]=qs[_0x24cf('0x3b')](_0xe55345[_0x24cf('0x31')][_0x24cf('0x3b')]);_0x109f77['where']=qs[_0x24cf('0x32')](_['pick'](_0xe55345[_0x24cf('0x31')],_0x47cf0f[_0x24cf('0x32')]),_0x17976f);if(_0xe55345[_0x24cf('0x31')][_0x24cf('0x3c')]){_0x109f77[_0x24cf('0x3d')]=_[_0x24cf('0x3e')](_0x109f77[_0x24cf('0x3d')],{'$or':_['map'](_0x17976f,function(_0x18850e){if(_0x18850e[_0x24cf('0x2e')]!=='VIRTUAL'){var _0x597998={};_0x597998[_0x18850e[_0x24cf('0x29')]]={'$like':'%'+_0xe55345[_0x24cf('0x31')][_0x24cf('0x3c')]+'%'};return _0x597998;}})});}_0x109f77=_['merge']({},_0x109f77,_0xe55345[_0x24cf('0x3f')]);var _0x1c8ac2={'where':_0x109f77[_0x24cf('0x3d')]};return db[_0x24cf('0x2c')][_0x24cf('0x1e')](_0x1c8ac2)[_0x24cf('0x25')](function(_0x4f6270){_0x45aec9['count']=_0x4f6270;if(_0xe55345[_0x24cf('0x31')][_0x24cf('0x40')]){_0x109f77['include']=[{'all':!![]}];}return db[_0x24cf('0x2c')]['findAll'](_0x109f77);})[_0x24cf('0x25')](function(_0x21dec3){_0x45aec9[_0x24cf('0x41')]=_0x21dec3;return _0x45aec9;})[_0x24cf('0x25')](respondWithFilteredResult(_0x109cbb,_0x109f77))[_0x24cf('0x42')](handleError(_0x109cbb,null));};exports[_0x24cf('0x43')]=function(_0x10d12f,_0x3c4d2b){var _0x266580={'raw':!![],'where':{'id':_0x10d12f[_0x24cf('0x44')]['id']}},_0xc96d21={};_0xc96d21[_0x24cf('0x30')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0xc96d21[_0x24cf('0x31')]=_[_0x24cf('0x45')](_0x10d12f[_0x24cf('0x31')]);_0xc96d21[_0x24cf('0x32')]=_[_0x24cf('0x33')](_0xc96d21[_0x24cf('0x30')],_0xc96d21[_0x24cf('0x31')]);_0x266580[_0x24cf('0x34')]=_['intersection'](_0xc96d21[_0x24cf('0x30')],qs[_0x24cf('0x35')](_0x10d12f[_0x24cf('0x31')][_0x24cf('0x35')]));_0x266580[_0x24cf('0x34')]=_0x266580[_0x24cf('0x34')]['length']?_0x266580['attributes']:_0xc96d21['model'];if(_0x10d12f[_0x24cf('0x31')][_0x24cf('0x40')]){_0x266580[_0x24cf('0x46')]=[{'all':!![]}];}_0x266580=_[_0x24cf('0x3e')]({},_0x266580,_0x10d12f[_0x24cf('0x3f')]);return db[_0x24cf('0x2c')][_0x24cf('0x47')](_0x266580)[_0x24cf('0x25')](handleEntityNotFound(_0x3c4d2b,null))[_0x24cf('0x25')](respondWithResult(_0x3c4d2b,null))['catch'](handleError(_0x3c4d2b,null));};exports[_0x24cf('0x48')]=function(_0xa1cde9,_0x2f36e4){return db['JscriptyQuestionReport'][_0x24cf('0x48')](_0xa1cde9[_0x24cf('0x49')],{})[_0x24cf('0x25')](respondWithResult(_0x2f36e4,0xc9))[_0x24cf('0x42')](handleError(_0x2f36e4,null));};exports['update']=function(_0x838fd9,_0x5559ac){if(_0x838fd9[_0x24cf('0x49')]['id']){delete _0x838fd9[_0x24cf('0x49')]['id'];}return db[_0x24cf('0x2c')][_0x24cf('0x47')]({'where':{'id':_0x838fd9[_0x24cf('0x44')]['id']}})[_0x24cf('0x25')](handleEntityNotFound(_0x5559ac,null))[_0x24cf('0x25')](saveUpdates(_0x838fd9[_0x24cf('0x49')],null))[_0x24cf('0x25')](respondWithResult(_0x5559ac,null))[_0x24cf('0x42')](handleError(_0x5559ac,null));};exports['destroy']=function(_0x524b3a,_0x4a9976){return db[_0x24cf('0x2c')][_0x24cf('0x47')]({'where':{'id':_0x524b3a['params']['id']}})[_0x24cf('0x25')](handleEntityNotFound(_0x4a9976,null))['then'](removeEntity(_0x4a9976,null))[_0x24cf('0x42')](handleError(_0x4a9976,null));};exports['describe']=function(_0x3aa639,_0x23ddd8){return db[_0x24cf('0x2c')][_0x24cf('0x4a')]()[_0x24cf('0x25')](respondWithResult(_0x23ddd8,null))['catch'](handleError(_0x23ddd8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 41d6d76..83ae38e 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 _0x8c84=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8c84,0x67));var _0x48c8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8c84[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x48c8('0x0'));var logger=require(_0x48c8('0x1'))(_0x48c8('0x2'));var moment=require(_0x48c8('0x3'));var BPromise=require(_0x48c8('0x4'));var rp=require(_0x48c8('0x5'));var fs=require('fs');var path=require(_0x48c8('0x6'));var rimraf=require(_0x48c8('0x7'));var config=require(_0x48c8('0x8'));var attributes=require(_0x48c8('0x9'));module[_0x48c8('0xa')]=function(_0x26b36b,_0x4588dc){return _0x26b36b['define'](_0x48c8('0xb'),attributes,{'tableName':_0x48c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff47=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0xff47,0x170));var _0x7ff4=function(_0x378380,_0x31dba0){_0x378380=_0x378380-0x0;var _0x2a4744=_0xff47[_0x378380];return _0x2a4744;};'use strict';var _=require(_0x7ff4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7ff4('0x1'));var BPromise=require(_0x7ff4('0x2'));var rp=require(_0x7ff4('0x3'));var fs=require('fs');var path=require(_0x7ff4('0x4'));var rimraf=require(_0x7ff4('0x5'));var config=require('../../config/environment');var attributes=require(_0x7ff4('0x6'));module[_0x7ff4('0x7')]=function(_0xeb8c17,_0x5330c9){return _0xeb8c17[_0x7ff4('0x8')](_0x7ff4('0x9'),attributes,{'tableName':_0x7ff4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index a51205b..1036fef 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 _0x4385=['http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4385,0xd1));var _0x5438=function(_0x1b7e46,_0x5f2886){_0x1b7e46=_0x1b7e46-0x0;var _0x2b40b2=_0x4385[_0x1b7e46];return _0x2b40b2;};'use strict';var _=require(_0x5438('0x0'));var util=require(_0x5438('0x1'));var moment=require(_0x5438('0x2'));var BPromise=require(_0x5438('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5438('0x4'));var db=require(_0x5438('0x5'))['db'];var utils=require(_0x5438('0x6'));var logger=require(_0x5438('0x7'))(_0x5438('0x8'));var config=require(_0x5438('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5438('0xa')][_0x5438('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13cbcd,_0x1ca3fd,_0x47541a){return new BPromise(function(_0x51979b,_0x4a647b){return client[_0x5438('0xc')](_0x13cbcd,_0x47541a)[_0x5438('0xd')](function(_0x37117d){logger[_0x5438('0xe')](_0x5438('0xf'),_0x1ca3fd,_0x5438('0x10'));logger[_0x5438('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1ca3fd,_0x5438('0x10'),JSON['stringify'](_0x37117d));if(_0x37117d[_0x5438('0x12')]){if(_0x37117d[_0x5438('0x12')]['code']===0x1f4){logger[_0x5438('0x12')](_0x5438('0xf'),_0x1ca3fd,_0x37117d['error']['message']);return _0x4a647b(_0x37117d['error'][_0x5438('0x13')]);}logger[_0x5438('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ca3fd,_0x37117d['error'][_0x5438('0x13')]);return _0x51979b(_0x37117d[_0x5438('0x12')][_0x5438('0x13')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ca3fd,_0x5438('0x10'));_0x51979b(_0x37117d[_0x5438('0x14')][_0x5438('0x13')]);}})[_0x5438('0x15')](function(_0x50405c){logger['error'](_0x5438('0xf'),_0x1ca3fd,_0x50405c);_0x4a647b(_0x50405c);});});} \ No newline at end of file +var _0xced2=['debug','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5b7704,_0x247bf3){var _0x390be9=function(_0x560e46){while(--_0x560e46){_0x5b7704['push'](_0x5b7704['shift']());}};_0x390be9(++_0x247bf3);}(_0xced2,0x104));var _0x2ced=function(_0x2b7577,_0x422c99){_0x2b7577=_0x2b7577-0x0;var _0x1a7c9b=_0xced2[_0x2b7577];return _0x1a7c9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ced('0x0'));var BPromise=require(_0x2ced('0x1'));var rs=require(_0x2ced('0x2'));var fs=require('fs');var Redis=require(_0x2ced('0x3'));var db=require(_0x2ced('0x4'))['db'];var utils=require(_0x2ced('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ced('0x6'));var jayson=require(_0x2ced('0x7'));var client=jayson[_0x2ced('0x8')][_0x2ced('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ffeba,_0x2a9dda,_0x1da8f0){return new BPromise(function(_0x12966d,_0x3ea864){return client[_0x2ced('0xa')](_0x3ffeba,_0x1da8f0)[_0x2ced('0xb')](function(_0x1a5b93){logger[_0x2ced('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2a9dda,'request\x20sent');logger[_0x2ced('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2a9dda,_0x2ced('0xe'),JSON[_0x2ced('0xf')](_0x1a5b93));if(_0x1a5b93[_0x2ced('0x10')]){if(_0x1a5b93[_0x2ced('0x10')][_0x2ced('0x11')]===0x1f4){logger[_0x2ced('0x10')](_0x2ced('0x12'),_0x2a9dda,_0x1a5b93[_0x2ced('0x10')][_0x2ced('0x13')]);return _0x3ea864(_0x1a5b93[_0x2ced('0x10')][_0x2ced('0x13')]);}logger[_0x2ced('0x10')](_0x2ced('0x12'),_0x2a9dda,_0x1a5b93[_0x2ced('0x10')][_0x2ced('0x13')]);return _0x12966d(_0x1a5b93[_0x2ced('0x10')][_0x2ced('0x13')]);}else{logger[_0x2ced('0xc')](_0x2ced('0x12'),_0x2a9dda,_0x2ced('0xe'));_0x12966d(_0x1a5b93['result'][_0x2ced('0x13')]);}})[_0x2ced('0x14')](function(_0x3cad1a){logger[_0x2ced('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2a9dda,_0x3cad1a);_0x3ea864(_0x3cad1a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index cabe386..feaa251 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 _0x3f8f=['exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getQuestions','post','create','put','delete'];(function(_0xbcc492,_0x1a6881){var _0x5e5d51=function(_0x4a806c){while(--_0x4a806c){_0xbcc492['push'](_0xbcc492['shift']());}};_0x5e5d51(++_0x1a6881);}(_0x3f8f,0x1e1));var _0xf3f8=function(_0x272547,_0x31aaec){_0x272547=_0x272547-0x0;var _0x1d2341=_0x3f8f[_0x272547];return _0x1d2341;};'use strict';var multer=require(_0xf3f8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf3f8('0x1'));var express=require(_0xf3f8('0x2'));var router=express['Router']();var fs_extra=require(_0xf3f8('0x3'));var auth=require(_0xf3f8('0x4'));var interaction=require(_0xf3f8('0x5'));var config=require('../../config/environment');var controller=require(_0xf3f8('0x6'));router[_0xf3f8('0x7')]('/',auth[_0xf3f8('0x8')](),controller[_0xf3f8('0x9')]);router[_0xf3f8('0x7')](_0xf3f8('0xa'),auth[_0xf3f8('0x8')](),controller[_0xf3f8('0xb')]);router[_0xf3f8('0x7')](_0xf3f8('0xc'),auth[_0xf3f8('0x8')](),controller[_0xf3f8('0xd')]);router[_0xf3f8('0x7')]('/:id/questions',auth[_0xf3f8('0x8')](),controller[_0xf3f8('0xe')]);router[_0xf3f8('0xf')]('/',auth[_0xf3f8('0x8')](),controller[_0xf3f8('0x10')]);router[_0xf3f8('0x11')](_0xf3f8('0xc'),auth[_0xf3f8('0x8')](),controller['update']);router[_0xf3f8('0x12')]('/:id',auth[_0xf3f8('0x8')](),controller['destroy']);module[_0xf3f8('0x13')]=router; \ No newline at end of file +var _0xfbd3=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','post','create','put','delete','destroy','multer','util','path','Router','fs-extra'];(function(_0x337f80,_0x288bec){var _0x1689e3=function(_0x28a310){while(--_0x28a310){_0x337f80['push'](_0x337f80['shift']());}};_0x1689e3(++_0x288bec);}(_0xfbd3,0x14b));var _0x3fbd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfbd3[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x3fbd('0x0'));var util=require(_0x3fbd('0x1'));var path=require(_0x3fbd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3fbd('0x3')]();var fs_extra=require(_0x3fbd('0x4'));var auth=require(_0x3fbd('0x5'));var interaction=require(_0x3fbd('0x6'));var config=require(_0x3fbd('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x3fbd('0x8')]('/',auth[_0x3fbd('0x9')](),controller[_0x3fbd('0xa')]);router['get'](_0x3fbd('0xb'),auth[_0x3fbd('0x9')](),controller[_0x3fbd('0xc')]);router['get'](_0x3fbd('0xd'),auth[_0x3fbd('0x9')](),controller[_0x3fbd('0xe')]);router['get'](_0x3fbd('0xf'),auth[_0x3fbd('0x9')](),controller['getQuestions']);router[_0x3fbd('0x10')]('/',auth['isAuthenticated'](),controller[_0x3fbd('0x11')]);router[_0x3fbd('0x12')](_0x3fbd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3fbd('0x13')]('/:id',auth[_0x3fbd('0x9')](),controller[_0x3fbd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index fd1d228..f7ef8fd 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 _0xfc37=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue','starttime','endtime'];(function(_0x3d4035,_0x4fc089){var _0x1523ef=function(_0x26d379){while(--_0x26d379){_0x3d4035['push'](_0x3d4035['shift']());}};_0x1523ef(++_0x4fc089);}(_0xfc37,0x9c));var _0x7fc3=function(_0x34058e,_0x3d63cc){_0x34058e=_0x34058e-0x0;var _0x4556aa=_0xfc37[_0x34058e];return _0x4556aa;};'use strict';var moment=require('moment');var Sequelize=require(_0x7fc3('0x0'));module[_0x7fc3('0x1')]={'starttime':{'type':Sequelize[_0x7fc3('0x2')],'set':function(_0x126baa){this[_0x7fc3('0x3')](_0x7fc3('0x4'),_0x126baa);this[_0x7fc3('0x3')](_0x7fc3('0x5'),moment()['format'](_0x7fc3('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7fc3('0x7')]},'queue':{'type':Sequelize[_0x7fc3('0x7')]},'uniqueid':{'type':Sequelize[_0x7fc3('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7fc3('0x7')]},'completed':{'type':Sequelize[_0x7fc3('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x2db9=['BOOLEAN','moment','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0x14efed,_0x1058fc){var _0xfdc268=function(_0x28f221){while(--_0x28f221){_0x14efed['push'](_0x14efed['shift']());}};_0xfdc268(++_0x1058fc);}(_0x2db9,0x171));var _0x92db=function(_0x3e72c1,_0x5245b3){_0x3e72c1=_0x3e72c1-0x0;var _0x5b3124=_0x2db9[_0x3e72c1];return _0x5b3124;};'use strict';var moment=require(_0x92db('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x23a570){this[_0x92db('0x1')](_0x92db('0x2'),_0x23a570);this[_0x92db('0x1')]('endtime',moment()[_0x92db('0x3')](_0x92db('0x4')));}},'endtime':{'type':Sequelize[_0x92db('0x5')]},'membername':{'type':Sequelize[_0x92db('0x6')]},'projectname':{'type':Sequelize[_0x92db('0x6')]},'queue':{'type':Sequelize[_0x92db('0x6')]},'uniqueid':{'type':Sequelize[_0x92db('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x92db('0x6')]},'completed':{'type':Sequelize[_0x92db('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index f963b44..e6d0976 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 _0xde20=['sort','where','pick','filter','merge','type','JscriptySessionReport','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','JscriptyQuestionReport','hasOwnProperty','SessionId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','map','keys','query','filters','attributes','intersection','model','fields','length','nolimit','limit'];(function(_0x1658bd,_0x10d461){var _0x480b0b=function(_0x3c6e79){while(--_0x3c6e79){_0x1658bd['push'](_0x1658bd['shift']());}};_0x480b0b(++_0x10d461);}(_0xde20,0x139));var _0x0de2=function(_0x4fb2f1,_0x334a51){_0x4fb2f1=_0x4fb2f1-0x0;var _0x292a95=_0xde20[_0x4fb2f1];return _0x292a95;};'use strict';var emlformat=require(_0x0de2('0x0'));var rimraf=require(_0x0de2('0x1'));var zipdir=require(_0x0de2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0de2('0x3'));var BPromise=require(_0x0de2('0x4'));var Mustache=require(_0x0de2('0x5'));var util=require(_0x0de2('0x6'));var path=require(_0x0de2('0x7'));var sox=require('sox');var csv=require(_0x0de2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0de2('0x9'));var _=require('lodash');var squel=require(_0x0de2('0xa'));var crypto=require(_0x0de2('0xb'));var jsforce=require(_0x0de2('0xc'));var deskjs=require(_0x0de2('0xd'));var toCsv=require(_0x0de2('0x8'));var querystring=require(_0x0de2('0xe'));var Papa=require(_0x0de2('0xf'));var Redis=require(_0x0de2('0x10'));var authService=require(_0x0de2('0x11'));var qs=require(_0x0de2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0de2('0x13'));var logger=require('../../config/logger')(_0x0de2('0x14'));var utils=require(_0x0de2('0x15'));var config=require(_0x0de2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41f684,_0x472791){_0x472791=_0x472791||0xcc;return function(_0x41907a){if(_0x41907a){return _0x41f684[_0x0de2('0x17')](_0x472791);}return _0x41f684[_0x0de2('0x18')](_0x472791)[_0x0de2('0x19')]();};}function respondWithResult(_0x333eb9,_0x49f49c){_0x49f49c=_0x49f49c||0xc8;return function(_0x3f1f4a){if(_0x3f1f4a){return _0x333eb9[_0x0de2('0x18')](_0x49f49c)[_0x0de2('0x1a')](_0x3f1f4a);}};}function respondWithFilteredResult(_0x2a4ff,_0x39c5fa){return function(_0x58b20f){if(_0x58b20f){var _0x18b0c9=typeof _0x39c5fa[_0x0de2('0x1b')]==='undefined'&&typeof _0x39c5fa['limit']===_0x0de2('0x1c');var _0x13115e=_0x58b20f['count'];var _0x3ac331=_0x18b0c9?0x0:_0x39c5fa[_0x0de2('0x1b')];var _0x3febec=_0x18b0c9?_0x58b20f[_0x0de2('0x1d')]:_0x39c5fa['offset']+_0x39c5fa['limit'];var _0x191e54;if(_0x3febec>=_0x13115e){_0x3febec=_0x13115e;_0x191e54=0xc8;}else{_0x191e54=0xce;}_0x2a4ff['status'](_0x191e54);return _0x2a4ff['set']('Content-Range',_0x3ac331+'-'+_0x3febec+'/'+_0x13115e)[_0x0de2('0x1a')](_0x58b20f);}return null;};}function patchUpdates(_0x1bd1ce){return function(_0x20bfb2){try{jsonpatch[_0x0de2('0x1e')](_0x20bfb2,_0x1bd1ce,!![]);}catch(_0x276d81){return BPromise[_0x0de2('0x1f')](_0x276d81);}return _0x20bfb2['save']();};}function saveUpdates(_0x7fc09e,_0x1884b0){return function(_0x1c3436){if(_0x1c3436){return _0x1c3436[_0x0de2('0x20')](_0x7fc09e)[_0x0de2('0x21')](function(_0x483841){return _0x483841;});}return null;};}function removeEntity(_0x1c1d50,_0x5b952d){return function(_0x5e4e0c){if(_0x5e4e0c){return _0x5e4e0c[_0x0de2('0x22')]()[_0x0de2('0x21')](function(){_0x1c1d50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x326c38,_0x47f467){return function(_0x57cc93){if(!_0x57cc93){_0x326c38[_0x0de2('0x17')](0x194);}return _0x57cc93;};}function handleError(_0x5a7d71,_0x42ce83){_0x42ce83=_0x42ce83||0x1f4;return function(_0x3b87f9){logger[_0x0de2('0x23')](_0x3b87f9[_0x0de2('0x24')]);if(_0x3b87f9[_0x0de2('0x25')]){delete _0x3b87f9[_0x0de2('0x25')];}_0x5a7d71[_0x0de2('0x18')](_0x42ce83)['send'](_0x3b87f9);};}exports[_0x0de2('0x26')]=function(_0x2b7c3c,_0x750e3f){var _0x4b6bb0={},_0x1d0e8e={},_0x6e480d={'count':0x0,'rows':[]};var _0x4dd829=_['map'](db['JscriptySessionReport'][_0x0de2('0x27')],function(_0x152462){return{'name':_0x152462[_0x0de2('0x28')],'type':_0x152462['type']['key']};});_0x1d0e8e['model']=_[_0x0de2('0x29')](_0x4dd829,_0x0de2('0x25'));_0x1d0e8e['query']=_[_0x0de2('0x2a')](_0x2b7c3c[_0x0de2('0x2b')]);_0x1d0e8e[_0x0de2('0x2c')]=_['intersection'](_0x1d0e8e['model'],_0x1d0e8e[_0x0de2('0x2b')]);_0x4b6bb0[_0x0de2('0x2d')]=_[_0x0de2('0x2e')](_0x1d0e8e[_0x0de2('0x2f')],qs['fields'](_0x2b7c3c['query'][_0x0de2('0x30')]));_0x4b6bb0[_0x0de2('0x2d')]=_0x4b6bb0[_0x0de2('0x2d')][_0x0de2('0x31')]?_0x4b6bb0[_0x0de2('0x2d')]:_0x1d0e8e[_0x0de2('0x2f')];if(!_0x2b7c3c['query']['hasOwnProperty'](_0x0de2('0x32'))){_0x4b6bb0[_0x0de2('0x33')]=qs[_0x0de2('0x33')](_0x2b7c3c[_0x0de2('0x2b')]['limit']);_0x4b6bb0[_0x0de2('0x1b')]=qs[_0x0de2('0x1b')](_0x2b7c3c[_0x0de2('0x2b')][_0x0de2('0x1b')]);}_0x4b6bb0['order']=qs[_0x0de2('0x34')](_0x2b7c3c[_0x0de2('0x2b')]['sort']);_0x4b6bb0[_0x0de2('0x35')]=qs[_0x0de2('0x2c')](_[_0x0de2('0x36')](_0x2b7c3c[_0x0de2('0x2b')],_0x1d0e8e['filters']),_0x4dd829);if(_0x2b7c3c[_0x0de2('0x2b')][_0x0de2('0x37')]){_0x4b6bb0[_0x0de2('0x35')]=_[_0x0de2('0x38')](_0x4b6bb0[_0x0de2('0x35')],{'$or':_[_0x0de2('0x29')](_0x4dd829,function(_0x5bca5c){if(_0x5bca5c[_0x0de2('0x39')]!=='VIRTUAL'){var _0x4ab76b={};_0x4ab76b[_0x5bca5c[_0x0de2('0x25')]]={'$like':'%'+_0x2b7c3c[_0x0de2('0x2b')][_0x0de2('0x37')]+'%'};return _0x4ab76b;}})});}_0x4b6bb0=_[_0x0de2('0x38')]({},_0x4b6bb0,_0x2b7c3c['options']);var _0x5c1368={'where':_0x4b6bb0[_0x0de2('0x35')]};return db[_0x0de2('0x3a')][_0x0de2('0x1d')](_0x5c1368)[_0x0de2('0x21')](function(_0x5d3c83){_0x6e480d[_0x0de2('0x1d')]=_0x5d3c83;if(_0x2b7c3c[_0x0de2('0x2b')]['includeAll']){_0x4b6bb0[_0x0de2('0x3b')]=[{'all':!![]}];}return db[_0x0de2('0x3a')][_0x0de2('0x3c')](_0x4b6bb0);})[_0x0de2('0x21')](function(_0x4052ad){_0x6e480d[_0x0de2('0x3d')]=_0x4052ad;return _0x6e480d;})[_0x0de2('0x21')](respondWithFilteredResult(_0x750e3f,_0x4b6bb0))[_0x0de2('0x3e')](handleError(_0x750e3f,null));};exports['show']=function(_0x62db83,_0x335ea6){var _0x388f41={'raw':!![],'where':{'id':_0x62db83[_0x0de2('0x3f')]['id']}},_0x3ca661={};_0x3ca661[_0x0de2('0x2f')]=_[_0x0de2('0x2a')](db['JscriptySessionReport'][_0x0de2('0x27')]);_0x3ca661[_0x0de2('0x2b')]=_[_0x0de2('0x2a')](_0x62db83[_0x0de2('0x2b')]);_0x3ca661[_0x0de2('0x2c')]=_[_0x0de2('0x2e')](_0x3ca661[_0x0de2('0x2f')],_0x3ca661[_0x0de2('0x2b')]);_0x388f41[_0x0de2('0x2d')]=_[_0x0de2('0x2e')](_0x3ca661[_0x0de2('0x2f')],qs[_0x0de2('0x30')](_0x62db83[_0x0de2('0x2b')][_0x0de2('0x30')]));_0x388f41[_0x0de2('0x2d')]=_0x388f41[_0x0de2('0x2d')][_0x0de2('0x31')]?_0x388f41['attributes']:_0x3ca661[_0x0de2('0x2f')];if(_0x62db83[_0x0de2('0x2b')][_0x0de2('0x40')]){_0x388f41[_0x0de2('0x3b')]=[{'all':!![]}];}_0x388f41=_[_0x0de2('0x38')]({},_0x388f41,_0x62db83[_0x0de2('0x41')]);return db[_0x0de2('0x3a')][_0x0de2('0x42')](_0x388f41)[_0x0de2('0x21')](handleEntityNotFound(_0x335ea6,null))[_0x0de2('0x21')](respondWithResult(_0x335ea6,null))[_0x0de2('0x3e')](handleError(_0x335ea6,null));};exports[_0x0de2('0x43')]=function(_0x59ea14,_0x5850b8){return db['JscriptySessionReport'][_0x0de2('0x43')](_0x59ea14[_0x0de2('0x44')],{})[_0x0de2('0x21')](respondWithResult(_0x5850b8,0xc9))[_0x0de2('0x3e')](handleError(_0x5850b8,null));};exports[_0x0de2('0x20')]=function(_0x13d0d6,_0x11747c){if(_0x13d0d6['body']['id']){delete _0x13d0d6[_0x0de2('0x44')]['id'];}return db[_0x0de2('0x3a')][_0x0de2('0x42')]({'where':{'id':_0x13d0d6['params']['id']}})[_0x0de2('0x21')](handleEntityNotFound(_0x11747c,null))[_0x0de2('0x21')](saveUpdates(_0x13d0d6[_0x0de2('0x44')],null))[_0x0de2('0x21')](respondWithResult(_0x11747c,null))[_0x0de2('0x3e')](handleError(_0x11747c,null));};exports[_0x0de2('0x22')]=function(_0x47ceb2,_0xa456a7){return db[_0x0de2('0x3a')][_0x0de2('0x42')]({'where':{'id':_0x47ceb2[_0x0de2('0x3f')]['id']}})['then'](handleEntityNotFound(_0xa456a7,null))[_0x0de2('0x21')](removeEntity(_0xa456a7,null))[_0x0de2('0x3e')](handleError(_0xa456a7,null));};exports[_0x0de2('0x45')]=function(_0x140972,_0x513edb){return db[_0x0de2('0x3a')][_0x0de2('0x45')]()[_0x0de2('0x21')](respondWithResult(_0x513edb,null))[_0x0de2('0x3e')](handleError(_0x513edb,null));};exports['getQuestions']=function(_0x16b4da,_0x391bd1,_0x14500d){var _0x5f5568={'raw':!![],'where':{}};var _0x38229c={};var _0x42aba2={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x16b4da[_0x0de2('0x3f')]['id']}})[_0x0de2('0x21')](handleEntityNotFound(_0x391bd1,null))[_0x0de2('0x21')](function(_0x577ae1){if(_0x577ae1){_0x38229c[_0x0de2('0x2f')]=_['keys'](db[_0x0de2('0x46')][_0x0de2('0x27')]);_0x38229c['query']=_[_0x0de2('0x2a')](_0x16b4da[_0x0de2('0x2b')]);_0x38229c[_0x0de2('0x2c')]=_['intersection'](_0x38229c[_0x0de2('0x2f')],_0x38229c[_0x0de2('0x2b')]);_0x5f5568['attributes']=_[_0x0de2('0x2e')](_0x38229c[_0x0de2('0x2f')],qs[_0x0de2('0x30')](_0x16b4da['query'][_0x0de2('0x30')]));_0x5f5568['attributes']=_0x5f5568['attributes'][_0x0de2('0x31')]?_0x5f5568[_0x0de2('0x2d')]:_0x38229c[_0x0de2('0x2f')];if(!_0x16b4da['query'][_0x0de2('0x47')](_0x0de2('0x32'))){_0x5f5568[_0x0de2('0x33')]=qs[_0x0de2('0x33')](_0x16b4da[_0x0de2('0x2b')][_0x0de2('0x33')]);_0x5f5568[_0x0de2('0x1b')]=qs['offset'](_0x16b4da[_0x0de2('0x2b')][_0x0de2('0x1b')]);}_0x5f5568['order']=qs[_0x0de2('0x34')](_0x16b4da[_0x0de2('0x2b')]['sort']);_0x5f5568['where']=qs[_0x0de2('0x2c')](_[_0x0de2('0x36')](_0x16b4da[_0x0de2('0x2b')],_0x38229c[_0x0de2('0x2c')]));_0x5f5568[_0x0de2('0x35')][_0x0de2('0x48')]=_0x577ae1['id'];if(_0x16b4da['query'][_0x0de2('0x37')]){_0x5f5568[_0x0de2('0x35')]=_['merge'](_0x5f5568['where'],{'$or':_[_0x0de2('0x29')](_0x5f5568[_0x0de2('0x2d')],function(_0x43f0a9){var _0x3af23a={};_0x3af23a[_0x43f0a9]={'$like':'%'+_0x16b4da['query']['filter']+'%'};return _0x3af23a;})});}_0x5f5568=_[_0x0de2('0x38')]({},_0x5f5568,_0x16b4da[_0x0de2('0x41')]);return db[_0x0de2('0x46')][_0x0de2('0x1d')]({'where':_0x5f5568['where']})[_0x0de2('0x21')](function(_0x576c4a){_0x42aba2[_0x0de2('0x1d')]=_0x576c4a;if(_0x16b4da[_0x0de2('0x2b')][_0x0de2('0x40')]){_0x5f5568[_0x0de2('0x3b')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x5f5568);})[_0x0de2('0x21')](function(_0x237423){_0x42aba2['rows']=_0x237423;return _0x42aba2;});}})[_0x0de2('0x21')](respondWithFilteredResult(_0x391bd1,_0x5f5568))['catch'](handleError(_0x391bd1,null));}; \ No newline at end of file +var _0xfa53=['catch','params','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','status','end','sendStatus','stack','name','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x6812bb,_0x54589b){var _0x4afb8b=function(_0x45ea8f){while(--_0x45ea8f){_0x6812bb['push'](_0x6812bb['shift']());}};_0x4afb8b(++_0x54589b);}(_0xfa53,0x1dd));var _0x3fa5=function(_0x4957eb,_0x3681b9){_0x4957eb=_0x4957eb-0x0;var _0x3b4c2d=_0xfa53[_0x4957eb];return _0x3b4c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3fa5('0x0'));var jsonpatch=require(_0x3fa5('0x1'));var rp=require(_0x3fa5('0x2'));var moment=require(_0x3fa5('0x3'));var BPromise=require(_0x3fa5('0x4'));var Mustache=require('mustache');var util=require(_0x3fa5('0x5'));var path=require(_0x3fa5('0x6'));var sox=require(_0x3fa5('0x7'));var csv=require(_0x3fa5('0x8'));var ejs=require(_0x3fa5('0x9'));var fs=require('fs');var fs_extra=require(_0x3fa5('0xa'));var _=require(_0x3fa5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3fa5('0xc'));var deskjs=require(_0x3fa5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3fa5('0xe'));var Redis=require(_0x3fa5('0xf'));var authService=require(_0x3fa5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3fa5('0x11'));var hardwareService=require(_0x3fa5('0x12'));var logger=require(_0x3fa5('0x13'))(_0x3fa5('0x14'));var utils=require(_0x3fa5('0x15'));var config=require(_0x3fa5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53268d,_0x399aaa){_0x399aaa=_0x399aaa||0xcc;return function(_0x431baa){if(_0x431baa){return _0x53268d['sendStatus'](_0x399aaa);}return _0x53268d['status'](_0x399aaa)['end']();};}function respondWithResult(_0x5021d0,_0xe751d9){_0xe751d9=_0xe751d9||0xc8;return function(_0x433f79){if(_0x433f79){return _0x5021d0['status'](_0xe751d9)[_0x3fa5('0x17')](_0x433f79);}};}function respondWithFilteredResult(_0x1ef02,_0x55c484){return function(_0x4c5fd8){if(_0x4c5fd8){var _0x598afb=typeof _0x55c484[_0x3fa5('0x18')]==='undefined'&&typeof _0x55c484['limit']===_0x3fa5('0x19');var _0xc9db3a=_0x4c5fd8[_0x3fa5('0x1a')];var _0x56a8a9=_0x598afb?0x0:_0x55c484[_0x3fa5('0x18')];var _0x4b00b7=_0x598afb?_0x4c5fd8[_0x3fa5('0x1a')]:_0x55c484[_0x3fa5('0x18')]+_0x55c484['limit'];var _0x7b043b;if(_0x4b00b7>=_0xc9db3a){_0x4b00b7=_0xc9db3a;_0x7b043b=0xc8;}else{_0x7b043b=0xce;}_0x1ef02['status'](_0x7b043b);return _0x1ef02[_0x3fa5('0x1b')](_0x3fa5('0x1c'),_0x56a8a9+'-'+_0x4b00b7+'/'+_0xc9db3a)[_0x3fa5('0x17')](_0x4c5fd8);}return null;};}function patchUpdates(_0x3b1ecc){return function(_0x3a4cee){try{jsonpatch['apply'](_0x3a4cee,_0x3b1ecc,!![]);}catch(_0x54505b){return BPromise[_0x3fa5('0x1d')](_0x54505b);}return _0x3a4cee[_0x3fa5('0x1e')]();};}function saveUpdates(_0x34cf0d,_0x1c160c){return function(_0x28c00c){if(_0x28c00c){return _0x28c00c[_0x3fa5('0x1f')](_0x34cf0d)[_0x3fa5('0x20')](function(_0x4bef7a){return _0x4bef7a;});}return null;};}function removeEntity(_0x1b5667,_0x299028){return function(_0x2e6895){if(_0x2e6895){return _0x2e6895[_0x3fa5('0x21')]()['then'](function(){_0x1b5667[_0x3fa5('0x22')](0xcc)[_0x3fa5('0x23')]();});}};}function handleEntityNotFound(_0x1bb804,_0x4a810e){return function(_0x4d2322){if(!_0x4d2322){_0x1bb804[_0x3fa5('0x24')](0x194);}return _0x4d2322;};}function handleError(_0x2d65f4,_0x2267bf){_0x2267bf=_0x2267bf||0x1f4;return function(_0x36cb04){logger['error'](_0x36cb04[_0x3fa5('0x25')]);if(_0x36cb04[_0x3fa5('0x26')]){delete _0x36cb04[_0x3fa5('0x26')];}_0x2d65f4[_0x3fa5('0x22')](_0x2267bf)['send'](_0x36cb04);};}exports[_0x3fa5('0x27')]=function(_0x2c2c23,_0xec597b){var _0x898723={},_0x8dd2ba={},_0x3b4aa2={'count':0x0,'rows':[]};var _0x1e251e=_['map'](db[_0x3fa5('0x28')][_0x3fa5('0x29')],function(_0x4f3b63){return{'name':_0x4f3b63[_0x3fa5('0x2a')],'type':_0x4f3b63[_0x3fa5('0x2b')][_0x3fa5('0x2c')]};});_0x8dd2ba[_0x3fa5('0x2d')]=_[_0x3fa5('0x2e')](_0x1e251e,_0x3fa5('0x26'));_0x8dd2ba[_0x3fa5('0x2f')]=_[_0x3fa5('0x30')](_0x2c2c23[_0x3fa5('0x2f')]);_0x8dd2ba[_0x3fa5('0x31')]=_[_0x3fa5('0x32')](_0x8dd2ba[_0x3fa5('0x2d')],_0x8dd2ba['query']);_0x898723[_0x3fa5('0x33')]=_[_0x3fa5('0x32')](_0x8dd2ba[_0x3fa5('0x2d')],qs['fields'](_0x2c2c23['query'][_0x3fa5('0x34')]));_0x898723[_0x3fa5('0x33')]=_0x898723[_0x3fa5('0x33')][_0x3fa5('0x35')]?_0x898723[_0x3fa5('0x33')]:_0x8dd2ba[_0x3fa5('0x2d')];if(!_0x2c2c23[_0x3fa5('0x2f')][_0x3fa5('0x36')](_0x3fa5('0x37'))){_0x898723[_0x3fa5('0x38')]=qs[_0x3fa5('0x38')](_0x2c2c23[_0x3fa5('0x2f')][_0x3fa5('0x38')]);_0x898723['offset']=qs['offset'](_0x2c2c23[_0x3fa5('0x2f')][_0x3fa5('0x18')]);}_0x898723[_0x3fa5('0x39')]=qs[_0x3fa5('0x3a')](_0x2c2c23[_0x3fa5('0x2f')][_0x3fa5('0x3a')]);_0x898723[_0x3fa5('0x3b')]=qs[_0x3fa5('0x31')](_[_0x3fa5('0x3c')](_0x2c2c23['query'],_0x8dd2ba[_0x3fa5('0x31')]),_0x1e251e);if(_0x2c2c23['query'][_0x3fa5('0x3d')]){_0x898723[_0x3fa5('0x3b')]=_[_0x3fa5('0x3e')](_0x898723[_0x3fa5('0x3b')],{'$or':_[_0x3fa5('0x2e')](_0x1e251e,function(_0x498a16){if(_0x498a16[_0x3fa5('0x2b')]!==_0x3fa5('0x3f')){var _0x2601dd={};_0x2601dd[_0x498a16[_0x3fa5('0x26')]]={'$like':'%'+_0x2c2c23[_0x3fa5('0x2f')][_0x3fa5('0x3d')]+'%'};return _0x2601dd;}})});}_0x898723=_[_0x3fa5('0x3e')]({},_0x898723,_0x2c2c23[_0x3fa5('0x40')]);var _0xec97ba={'where':_0x898723[_0x3fa5('0x3b')]};return db[_0x3fa5('0x28')][_0x3fa5('0x1a')](_0xec97ba)['then'](function(_0x24d0a0){_0x3b4aa2[_0x3fa5('0x1a')]=_0x24d0a0;if(_0x2c2c23[_0x3fa5('0x2f')][_0x3fa5('0x41')]){_0x898723[_0x3fa5('0x42')]=[{'all':!![]}];}return db[_0x3fa5('0x28')][_0x3fa5('0x43')](_0x898723);})['then'](function(_0x1a52d7){_0x3b4aa2[_0x3fa5('0x44')]=_0x1a52d7;return _0x3b4aa2;})[_0x3fa5('0x20')](respondWithFilteredResult(_0xec597b,_0x898723))[_0x3fa5('0x45')](handleError(_0xec597b,null));};exports['show']=function(_0x386868,_0x1288a9){var _0x163211={'raw':!![],'where':{'id':_0x386868[_0x3fa5('0x46')]['id']}},_0x1490a3={};_0x1490a3[_0x3fa5('0x2d')]=_[_0x3fa5('0x30')](db[_0x3fa5('0x28')]['rawAttributes']);_0x1490a3['query']=_[_0x3fa5('0x30')](_0x386868['query']);_0x1490a3['filters']=_[_0x3fa5('0x32')](_0x1490a3[_0x3fa5('0x2d')],_0x1490a3[_0x3fa5('0x2f')]);_0x163211[_0x3fa5('0x33')]=_[_0x3fa5('0x32')](_0x1490a3[_0x3fa5('0x2d')],qs[_0x3fa5('0x34')](_0x386868[_0x3fa5('0x2f')][_0x3fa5('0x34')]));_0x163211[_0x3fa5('0x33')]=_0x163211[_0x3fa5('0x33')][_0x3fa5('0x35')]?_0x163211[_0x3fa5('0x33')]:_0x1490a3[_0x3fa5('0x2d')];if(_0x386868['query']['includeAll']){_0x163211[_0x3fa5('0x42')]=[{'all':!![]}];}_0x163211=_[_0x3fa5('0x3e')]({},_0x163211,_0x386868['options']);return db[_0x3fa5('0x28')]['find'](_0x163211)[_0x3fa5('0x20')](handleEntityNotFound(_0x1288a9,null))[_0x3fa5('0x20')](respondWithResult(_0x1288a9,null))[_0x3fa5('0x45')](handleError(_0x1288a9,null));};exports[_0x3fa5('0x47')]=function(_0x1baa6f,_0x554ef1){return db['JscriptySessionReport']['create'](_0x1baa6f[_0x3fa5('0x48')],{})[_0x3fa5('0x20')](respondWithResult(_0x554ef1,0xc9))[_0x3fa5('0x45')](handleError(_0x554ef1,null));};exports[_0x3fa5('0x1f')]=function(_0x25b911,_0x290cfb){if(_0x25b911[_0x3fa5('0x48')]['id']){delete _0x25b911[_0x3fa5('0x48')]['id'];}return db['JscriptySessionReport'][_0x3fa5('0x49')]({'where':{'id':_0x25b911[_0x3fa5('0x46')]['id']}})['then'](handleEntityNotFound(_0x290cfb,null))[_0x3fa5('0x20')](saveUpdates(_0x25b911[_0x3fa5('0x48')],null))[_0x3fa5('0x20')](respondWithResult(_0x290cfb,null))[_0x3fa5('0x45')](handleError(_0x290cfb,null));};exports['destroy']=function(_0x459184,_0x423629){return db[_0x3fa5('0x28')][_0x3fa5('0x49')]({'where':{'id':_0x459184[_0x3fa5('0x46')]['id']}})[_0x3fa5('0x20')](handleEntityNotFound(_0x423629,null))['then'](removeEntity(_0x423629,null))[_0x3fa5('0x45')](handleError(_0x423629,null));};exports['describe']=function(_0x1ba3bb,_0x69a0b1){return db['JscriptySessionReport'][_0x3fa5('0x4a')]()[_0x3fa5('0x20')](respondWithResult(_0x69a0b1,null))[_0x3fa5('0x45')](handleError(_0x69a0b1,null));};exports[_0x3fa5('0x4b')]=function(_0x4e97ff,_0x137c0a,_0x3276e0){var _0x37ab40={'raw':!![],'where':{}};var _0x3bea80={};var _0x583567={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3fa5('0x4c')]({'where':{'id':_0x4e97ff[_0x3fa5('0x46')]['id']}})[_0x3fa5('0x20')](handleEntityNotFound(_0x137c0a,null))[_0x3fa5('0x20')](function(_0x100023){if(_0x100023){_0x3bea80[_0x3fa5('0x2d')]=_[_0x3fa5('0x30')](db[_0x3fa5('0x4d')][_0x3fa5('0x29')]);_0x3bea80[_0x3fa5('0x2f')]=_[_0x3fa5('0x30')](_0x4e97ff[_0x3fa5('0x2f')]);_0x3bea80[_0x3fa5('0x31')]=_['intersection'](_0x3bea80[_0x3fa5('0x2d')],_0x3bea80[_0x3fa5('0x2f')]);_0x37ab40[_0x3fa5('0x33')]=_[_0x3fa5('0x32')](_0x3bea80['model'],qs[_0x3fa5('0x34')](_0x4e97ff[_0x3fa5('0x2f')][_0x3fa5('0x34')]));_0x37ab40[_0x3fa5('0x33')]=_0x37ab40['attributes']['length']?_0x37ab40[_0x3fa5('0x33')]:_0x3bea80[_0x3fa5('0x2d')];if(!_0x4e97ff[_0x3fa5('0x2f')][_0x3fa5('0x36')](_0x3fa5('0x37'))){_0x37ab40[_0x3fa5('0x38')]=qs[_0x3fa5('0x38')](_0x4e97ff[_0x3fa5('0x2f')][_0x3fa5('0x38')]);_0x37ab40['offset']=qs[_0x3fa5('0x18')](_0x4e97ff[_0x3fa5('0x2f')]['offset']);}_0x37ab40[_0x3fa5('0x39')]=qs[_0x3fa5('0x3a')](_0x4e97ff[_0x3fa5('0x2f')][_0x3fa5('0x3a')]);_0x37ab40['where']=qs[_0x3fa5('0x31')](_[_0x3fa5('0x3c')](_0x4e97ff[_0x3fa5('0x2f')],_0x3bea80[_0x3fa5('0x31')]));_0x37ab40['where']['SessionId']=_0x100023['id'];if(_0x4e97ff[_0x3fa5('0x2f')]['filter']){_0x37ab40['where']=_[_0x3fa5('0x3e')](_0x37ab40[_0x3fa5('0x3b')],{'$or':_[_0x3fa5('0x2e')](_0x37ab40[_0x3fa5('0x33')],function(_0x102516){var _0x3be6ce={};_0x3be6ce[_0x102516]={'$like':'%'+_0x4e97ff[_0x3fa5('0x2f')]['filter']+'%'};return _0x3be6ce;})});}_0x37ab40=_[_0x3fa5('0x3e')]({},_0x37ab40,_0x4e97ff[_0x3fa5('0x40')]);return db[_0x3fa5('0x4d')][_0x3fa5('0x1a')]({'where':_0x37ab40[_0x3fa5('0x3b')]})[_0x3fa5('0x20')](function(_0x23de5a){_0x583567[_0x3fa5('0x1a')]=_0x23de5a;if(_0x4e97ff[_0x3fa5('0x2f')]['includeAll']){_0x37ab40['include']=[{'all':!![]}];}return db[_0x3fa5('0x4d')][_0x3fa5('0x43')](_0x37ab40);})[_0x3fa5('0x20')](function(_0x50e602){_0x583567[_0x3fa5('0x44')]=_0x50e602;return _0x583567;});}})[_0x3fa5('0x20')](respondWithFilteredResult(_0x137c0a,_0x37ab40))['catch'](handleError(_0x137c0a,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c0edfab..e7b7885 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 _0xe2fe=['../../config/environment','exports','define','JscriptySessionReport','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa630=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x5a9228,_0x4b7835){_0x5a9228=_0x5a9228-0x0;var _0x5f1a6f=_0xa630[_0x5a9228];return _0x5f1a6f;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));module[_0x0a63('0x7')]=function(_0x37b4c9,_0x4b7474){return _0x37b4c9[_0x0a63('0x8')](_0x0a63('0x9'),attributes,{'tableName':_0x0a63('0xa'),'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 4006867..744f73b 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 _0x0424=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0424,0x159));var _0x4042=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x0424[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});} \ No newline at end of file +var _0x7a54=['info','JscriptySessionReport,\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(_0x2ae0df,_0x2e2252){_0x2ae0df=_0x2ae0df-0x0;var _0x54322e=_0x7a54[_0x2ae0df];return _0x54322e;};'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')]('JscriptySessionReport,\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/license/index.js b/server/api/license/index.js index c881e68..7a59e68 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 _0x92fd=['./license.controller','get','index','put','isAuthenticated','/download_log_file','downloadLogFile','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x92fd,0x69));var _0xd92f=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0x92fd[_0x54d52];return _0x968345;};'use strict';var multer=require(_0xd92f('0x0'));var util=require(_0xd92f('0x1'));var path=require('path');var timeout=require(_0xd92f('0x2'));var express=require('express');var router=express[_0xd92f('0x3')]();var fs_extra=require(_0xd92f('0x4'));var auth=require(_0xd92f('0x5'));var interaction=require(_0xd92f('0x6'));var config=require('../../config/environment');var controller=require(_0xd92f('0x7'));router[_0xd92f('0x8')]('/',controller[_0xd92f('0x9')]);router[_0xd92f('0xa')]('/:id',auth[_0xd92f('0xb')](),controller['update']);router[_0xd92f('0x8')](_0xd92f('0xc'),auth['isAuthenticated'](),controller[_0xd92f('0xd')]);module['exports']=router; \ No newline at end of file +var _0x9216=['isAuthenticated','get','/download_log_file','multer','path','connect-timeout','express','Router','index','/:id'];(function(_0x22c882,_0x192c99){var _0x463be6=function(_0x210276){while(--_0x210276){_0x22c882['push'](_0x22c882['shift']());}};_0x463be6(++_0x192c99);}(_0x9216,0x175));var _0x6921=function(_0x36b9b6,_0x541c7e){_0x36b9b6=_0x36b9b6-0x0;var _0xa094a6=_0x9216[_0x36b9b6];return _0xa094a6;};'use strict';var multer=require(_0x6921('0x0'));var util=require('util');var path=require(_0x6921('0x1'));var timeout=require(_0x6921('0x2'));var express=require(_0x6921('0x3'));var router=express[_0x6921('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('./license.controller');router['get']('/',controller[_0x6921('0x5')]);router['put'](_0x6921('0x6'),auth[_0x6921('0x7')](),controller['update']);router[_0x6921('0x8')](_0x6921('0x9'),auth['isAuthenticated'](),controller['downloadLogFile']);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 4ed237f..85029d1 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 _0x071f=['TEXT','STRING','INTEGER','sequelize'];(function(_0x3bf20c,_0x4b76cf){var _0x566fae=function(_0x2a05f6){while(--_0x2a05f6){_0x3bf20c['push'](_0x3bf20c['shift']());}};_0x566fae(++_0x4b76cf);}(_0x071f,0xe3));var _0xf071=function(_0x53d6df,_0x5de8e4){_0x53d6df=_0x53d6df-0x0;var _0x88faa1=_0x071f[_0x53d6df];return _0x88faa1;};'use strict';var Sequelize=require(_0xf071('0x0'));module['exports']={'license':{'type':Sequelize[_0xf071('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xf071('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xf071('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xce1c=['INTEGER','exports','TEXT','STRING'];(function(_0x492502,_0x3136ee){var _0x273833=function(_0x5dd1b0){while(--_0x5dd1b0){_0x492502['push'](_0x492502['shift']());}};_0x273833(++_0x3136ee);}(_0xce1c,0x19d));var _0xcce1=function(_0x3e7f5a,_0x120038){_0x3e7f5a=_0x3e7f5a-0x0;var _0x20d3d5=_0xce1c[_0x3e7f5a];return _0x20d3d5;};'use strict';var Sequelize=require('sequelize');module[_0xcce1('0x0')]={'license':{'type':Sequelize[_0xcce1('0x1')]},'data1':{'type':Sequelize[_0xcce1('0x2')]},'data2':{'type':Sequelize[_0xcce1('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xcce1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 08729c6..1c5948d 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 _0x4dd0=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','../../config/license/util','model','keys','query','intersection','attributes','fields','length','merge','options','catch','body','License','params','get','checkLicense','demo','license-info.log','join','/var','log','xcally','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x4dd0,0x82));var _0x04dd=function(_0x6b9f63,_0x282b96){_0x6b9f63=_0x6b9f63-0x0;var _0x776f14=_0x4dd0[_0x6b9f63];return _0x776f14;};'use strict';var emlformat=require(_0x04dd('0x0'));var rimraf=require(_0x04dd('0x1'));var zipdir=require(_0x04dd('0x2'));var jsonpatch=require(_0x04dd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04dd('0x4'));var util=require(_0x04dd('0x5'));var path=require(_0x04dd('0x6'));var sox=require(_0x04dd('0x7'));var csv=require(_0x04dd('0x8'));var ejs=require(_0x04dd('0x9'));var fs=require('fs');var fs_extra=require(_0x04dd('0xa'));var _=require(_0x04dd('0xb'));var squel=require(_0x04dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x04dd('0xd'));var deskjs=require(_0x04dd('0xe'));var toCsv=require(_0x04dd('0x8'));var querystring=require(_0x04dd('0xf'));var Papa=require(_0x04dd('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04dd('0x11'));var as=require(_0x04dd('0x12'));var hardwareService=require(_0x04dd('0x13'));var logger=require('../../config/logger')(_0x04dd('0x14'));var utils=require(_0x04dd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x04dd('0x16'))['db'];function respondWithStatusCode(_0x53e122,_0x4eefa3){_0x4eefa3=_0x4eefa3||0xcc;return function(_0x16976c){if(_0x16976c){return _0x53e122[_0x04dd('0x17')](_0x4eefa3);}return _0x53e122[_0x04dd('0x18')](_0x4eefa3)[_0x04dd('0x19')]();};}function respondWithResult(_0x5b86bf,_0x587ee5){_0x587ee5=_0x587ee5||0xc8;return function(_0x18ebd1){if(_0x18ebd1){return _0x5b86bf[_0x04dd('0x18')](_0x587ee5)['json'](_0x18ebd1);}};}function respondWithFilteredResult(_0x24df39,_0x26ceab){return function(_0x34d119){if(_0x34d119){var _0x3d15bb=typeof _0x26ceab[_0x04dd('0x1a')]==='undefined'&&typeof _0x26ceab[_0x04dd('0x1b')]===_0x04dd('0x1c');var _0x40d2d4=_0x34d119[_0x04dd('0x1d')];var _0x12ffaf=_0x3d15bb?0x0:_0x26ceab['offset'];var _0x42d232=_0x3d15bb?_0x34d119[_0x04dd('0x1d')]:_0x26ceab[_0x04dd('0x1a')]+_0x26ceab[_0x04dd('0x1b')];var _0x22ae69;if(_0x42d232>=_0x40d2d4){_0x42d232=_0x40d2d4;_0x22ae69=0xc8;}else{_0x22ae69=0xce;}_0x24df39[_0x04dd('0x18')](_0x22ae69);return _0x24df39['set'](_0x04dd('0x1e'),_0x12ffaf+'-'+_0x42d232+'/'+_0x40d2d4)[_0x04dd('0x1f')](_0x34d119);}return null;};}function patchUpdates(_0x22f8ec){return function(_0x3511c1){try{jsonpatch[_0x04dd('0x20')](_0x3511c1,_0x22f8ec,!![]);}catch(_0x25a0d7){return BPromise['reject'](_0x25a0d7);}return _0x3511c1[_0x04dd('0x21')]();};}function saveUpdates(_0x22d5f1,_0x48023b){return function(_0x2d0383){if(_0x2d0383){return _0x2d0383[_0x04dd('0x22')](_0x22d5f1)[_0x04dd('0x23')](function(_0x512303){return _0x512303;});}return null;};}function removeEntity(_0x538633,_0x78cc02){return function(_0x1dffe5){if(_0x1dffe5){return _0x1dffe5[_0x04dd('0x24')]()[_0x04dd('0x23')](function(){_0x538633[_0x04dd('0x18')](0xcc)[_0x04dd('0x19')]();});}};}function handleEntityNotFound(_0x17de95,_0x5bc94e){return function(_0x51c830){if(!_0x51c830){_0x17de95[_0x04dd('0x17')](0x194);}return _0x51c830;};}function handleError(_0x5bcf74,_0xf3fcee){_0xf3fcee=_0xf3fcee||0x1f4;return function(_0x2f99f0){logger[_0x04dd('0x25')](_0x2f99f0[_0x04dd('0x26')]);if(_0x2f99f0[_0x04dd('0x27')]){delete _0x2f99f0[_0x04dd('0x27')];}_0x5bcf74['status'](_0xf3fcee)[_0x04dd('0x28')](_0x2f99f0);};}var utilLicense=require(_0x04dd('0x29'));exports['index']=function(_0x27e52b,_0x286329){var _0x328359={'raw':!![],'where':{'id':0x1}},_0x91ac0e={};_0x91ac0e[_0x04dd('0x2a')]=_[_0x04dd('0x2b')](db['License']['rawAttributes']);_0x91ac0e[_0x04dd('0x2c')]=_[_0x04dd('0x2b')](_0x27e52b[_0x04dd('0x2c')]);_0x91ac0e['filters']=_[_0x04dd('0x2d')](_0x91ac0e['model'],_0x91ac0e['query']);_0x328359[_0x04dd('0x2e')]=_[_0x04dd('0x2d')](_0x91ac0e[_0x04dd('0x2a')],qs[_0x04dd('0x2f')](_0x27e52b[_0x04dd('0x2c')][_0x04dd('0x2f')]));_0x328359[_0x04dd('0x2e')]=_0x328359[_0x04dd('0x2e')][_0x04dd('0x30')]?_0x328359[_0x04dd('0x2e')]:_0x91ac0e[_0x04dd('0x2a')];_0x328359=_[_0x04dd('0x31')]({},_0x328359,_0x27e52b[_0x04dd('0x32')]);return utilLicense['getLicense'](_0x328359)[_0x04dd('0x23')](respondWithResult(_0x286329,null))[_0x04dd('0x33')](handleError(_0x286329,null));};exports[_0x04dd('0x22')]=function(_0x58e961,_0x1f0787){if(_0x58e961['body']['id']){delete _0x58e961[_0x04dd('0x34')]['id'];}return db[_0x04dd('0x35')]['find']({'where':{'id':_0x58e961[_0x04dd('0x36')]['id']}})[_0x04dd('0x23')](handleEntityNotFound(_0x1f0787,null))[_0x04dd('0x23')](function(_0xd0036f){var _0x1cbf4f=_0xd0036f[_0x04dd('0x37')]({'plain':!![]});return utilLicense[_0x04dd('0x38')](_0x1cbf4f,_0x58e961[_0x04dd('0x34')]['key']);})[_0x04dd('0x23')](function(_0x4b5371){if(!_0x4b5371[_0x04dd('0x39')]){return saveUpdates(_0x58e961['body'],null);}return _0x4b5371;})[_0x04dd('0x23')](respondWithResult(_0x1f0787,null))[_0x04dd('0x33')](handleError(_0x1f0787,null));};exports['downloadLogFile']=function(_0x194ba7,_0x109516){var _0x19561d=_0x04dd('0x3a');var _0x142520=path[_0x04dd('0x3b')](_0x04dd('0x3c'),_0x04dd('0x3d'),_0x04dd('0x3e'),_0x19561d);_0x109516['setHeader']('Content-disposition',_0x04dd('0x3f')+_0x19561d);_0x109516[_0x04dd('0x40')](_0x04dd('0x41'),_0x04dd('0x42'));_0x109516[_0x04dd('0x43')](_0x142520);}; \ No newline at end of file +var _0x291f=['merge','options','getLicense','catch','body','find','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','set','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x291f,0x167));var _0xf291=function(_0x2ea319,_0x55ad5c){_0x2ea319=_0x2ea319-0x0;var _0x1df3aa=_0x291f[_0x2ea319];return _0x1df3aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf291('0x0'));var zipdir=require(_0xf291('0x1'));var jsonpatch=require(_0xf291('0x2'));var rp=require(_0xf291('0x3'));var moment=require(_0xf291('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf291('0x5'));var util=require(_0xf291('0x6'));var path=require(_0xf291('0x7'));var sox=require('sox');var csv=require(_0xf291('0x8'));var ejs=require(_0xf291('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf291('0xa'));var squel=require(_0xf291('0xb'));var crypto=require(_0xf291('0xc'));var jsforce=require(_0xf291('0xd'));var deskjs=require(_0xf291('0xe'));var toCsv=require(_0xf291('0x8'));var querystring=require(_0xf291('0xf'));var Papa=require(_0xf291('0x10'));var Redis=require(_0xf291('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf291('0x12'));var hardwareService=require(_0xf291('0x13'));var logger=require(_0xf291('0x14'))(_0xf291('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf291('0x16'));var db=require(_0xf291('0x17'))['db'];function respondWithStatusCode(_0x2078e3,_0x2ea9f6){_0x2ea9f6=_0x2ea9f6||0xcc;return function(_0x16e1ce){if(_0x16e1ce){return _0x2078e3[_0xf291('0x18')](_0x2ea9f6);}return _0x2078e3[_0xf291('0x19')](_0x2ea9f6)[_0xf291('0x1a')]();};}function respondWithResult(_0x4a8b8c,_0x42039a){_0x42039a=_0x42039a||0xc8;return function(_0x39b5d5){if(_0x39b5d5){return _0x4a8b8c[_0xf291('0x19')](_0x42039a)[_0xf291('0x1b')](_0x39b5d5);}};}function respondWithFilteredResult(_0x366f69,_0x45bd85){return function(_0x23741e){if(_0x23741e){var _0xdb0928=typeof _0x45bd85[_0xf291('0x1c')]===_0xf291('0x1d')&&typeof _0x45bd85[_0xf291('0x1e')]==='undefined';var _0x5506dd=_0x23741e[_0xf291('0x1f')];var _0x1c808e=_0xdb0928?0x0:_0x45bd85[_0xf291('0x1c')];var _0x2a54f5=_0xdb0928?_0x23741e[_0xf291('0x1f')]:_0x45bd85[_0xf291('0x1c')]+_0x45bd85['limit'];var _0x15cb60;if(_0x2a54f5>=_0x5506dd){_0x2a54f5=_0x5506dd;_0x15cb60=0xc8;}else{_0x15cb60=0xce;}_0x366f69[_0xf291('0x19')](_0x15cb60);return _0x366f69['set']('Content-Range',_0x1c808e+'-'+_0x2a54f5+'/'+_0x5506dd)[_0xf291('0x1b')](_0x23741e);}return null;};}function patchUpdates(_0x14255e){return function(_0x26905a){try{jsonpatch['apply'](_0x26905a,_0x14255e,!![]);}catch(_0x2e830d){return BPromise[_0xf291('0x20')](_0x2e830d);}return _0x26905a[_0xf291('0x21')]();};}function saveUpdates(_0x650e6,_0x2959c2){return function(_0x1858a7){if(_0x1858a7){return _0x1858a7[_0xf291('0x22')](_0x650e6)[_0xf291('0x23')](function(_0x21f550){return _0x21f550;});}return null;};}function removeEntity(_0x33084b,_0x4bb258){return function(_0x38bd7c){if(_0x38bd7c){return _0x38bd7c['destroy']()[_0xf291('0x23')](function(){_0x33084b[_0xf291('0x19')](0xcc)[_0xf291('0x1a')]();});}};}function handleEntityNotFound(_0x527d9f,_0x10a11a){return function(_0x49f0c1){if(!_0x49f0c1){_0x527d9f[_0xf291('0x18')](0x194);}return _0x49f0c1;};}function handleError(_0x4b7b1c,_0x527318){_0x527318=_0x527318||0x1f4;return function(_0x209b39){logger['error'](_0x209b39['stack']);if(_0x209b39[_0xf291('0x24')]){delete _0x209b39['name'];}_0x4b7b1c[_0xf291('0x19')](_0x527318)[_0xf291('0x25')](_0x209b39);};}var utilLicense=require('../../config/license/util');exports[_0xf291('0x26')]=function(_0x4f5e3a,_0x3e3908){var _0x2b834c={'raw':!![],'where':{'id':0x1}},_0x5034b0={};_0x5034b0[_0xf291('0x27')]=_[_0xf291('0x28')](db[_0xf291('0x29')][_0xf291('0x2a')]);_0x5034b0[_0xf291('0x2b')]=_[_0xf291('0x28')](_0x4f5e3a[_0xf291('0x2b')]);_0x5034b0[_0xf291('0x2c')]=_[_0xf291('0x2d')](_0x5034b0[_0xf291('0x27')],_0x5034b0[_0xf291('0x2b')]);_0x2b834c[_0xf291('0x2e')]=_[_0xf291('0x2d')](_0x5034b0[_0xf291('0x27')],qs[_0xf291('0x2f')](_0x4f5e3a[_0xf291('0x2b')][_0xf291('0x2f')]));_0x2b834c[_0xf291('0x2e')]=_0x2b834c[_0xf291('0x2e')][_0xf291('0x30')]?_0x2b834c[_0xf291('0x2e')]:_0x5034b0[_0xf291('0x27')];_0x2b834c=_[_0xf291('0x31')]({},_0x2b834c,_0x4f5e3a[_0xf291('0x32')]);return utilLicense[_0xf291('0x33')](_0x2b834c)[_0xf291('0x23')](respondWithResult(_0x3e3908,null))[_0xf291('0x34')](handleError(_0x3e3908,null));};exports[_0xf291('0x22')]=function(_0x3bb65e,_0x5033e7){if(_0x3bb65e[_0xf291('0x35')]['id']){delete _0x3bb65e[_0xf291('0x35')]['id'];}return db[_0xf291('0x29')][_0xf291('0x36')]({'where':{'id':_0x3bb65e['params']['id']}})[_0xf291('0x23')](handleEntityNotFound(_0x5033e7,null))[_0xf291('0x23')](function(_0x4238c9){var _0x434219=_0x4238c9[_0xf291('0x37')]({'plain':!![]});return utilLicense[_0xf291('0x38')](_0x434219,_0x3bb65e[_0xf291('0x35')][_0xf291('0x39')]);})['then'](function(_0x9e4c63){if(!_0x9e4c63['demo']){return saveUpdates(_0x3bb65e['body'],null);}return _0x9e4c63;})[_0xf291('0x23')](respondWithResult(_0x5033e7,null))['catch'](handleError(_0x5033e7,null));};exports[_0xf291('0x3a')]=function(_0x1b0063,_0x3c99e8){var _0x4d89d7=_0xf291('0x3b');var _0x53b199=path[_0xf291('0x3c')](_0xf291('0x3d'),_0xf291('0x3e'),_0xf291('0x3f'),_0x4d89d7);_0x3c99e8['setHeader'](_0xf291('0x40'),_0xf291('0x41')+_0x4d89d7);_0x3c99e8[_0xf291('0x42')]('Content-Type','text/plain');_0x3c99e8[_0xf291('0x43')](_0x53b199);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a708462..d4e1c1c 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 _0x5078=['rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x5078,0x148));var _0x8507=function(_0x22ee31,_0x352943){_0x22ee31=_0x22ee31-0x0;var _0x134eb2=_0x5078[_0x22ee31];return _0x134eb2;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var logger=require(_0x8507('0x2'))(_0x8507('0x3'));var moment=require(_0x8507('0x4'));var BPromise=require(_0x8507('0x5'));var rp=require(_0x8507('0x6'));var fs=require('fs');var path=require(_0x8507('0x7'));var rimraf=require(_0x8507('0x8'));var config=require(_0x8507('0x9'));var attributes=require(_0x8507('0xa'));module[_0x8507('0xb')]=function(_0x37519c,_0x5a359c){return _0x37519c[_0x8507('0xc')](_0x8507('0xd'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0a8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','License','license','lodash','../../config/logger','api'];(function(_0x25bae8,_0x57840b){var _0x1742c6=function(_0x2b3d1b){while(--_0x2b3d1b){_0x25bae8['push'](_0x25bae8['shift']());}};_0x1742c6(++_0x57840b);}(_0xe0a8,0xc3));var _0x8e0a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe0a8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x8e0a('0x0'));var util=require('util');var logger=require(_0x8e0a('0x1'))(_0x8e0a('0x2'));var moment=require('moment');var BPromise=require(_0x8e0a('0x3'));var rp=require(_0x8e0a('0x4'));var fs=require('fs');var path=require(_0x8e0a('0x5'));var rimraf=require(_0x8e0a('0x6'));var config=require(_0x8e0a('0x7'));var attributes=require('./license.attributes');module[_0x8e0a('0x8')]=function(_0x407515,_0x2e2157){return _0x407515['define'](_0x8e0a('0x9'),attributes,{'tableName':_0x8e0a('0xa'),'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 c4eea3b..8b10ce5 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 _0x36f1=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x20790d,_0x49b540){var _0x2cabd9=function(_0x37d2ff){while(--_0x37d2ff){_0x20790d['push'](_0x20790d['shift']());}};_0x2cabd9(++_0x49b540);}(_0x36f1,0xd2));var _0x136f=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x36f1[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x136f('0x0'));var util=require(_0x136f('0x1'));var moment=require('moment');var BPromise=require(_0x136f('0x2'));var rs=require(_0x136f('0x3'));var fs=require('fs');var Redis=require(_0x136f('0x4'));var db=require(_0x136f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x136f('0x6'))(_0x136f('0x7'));var config=require(_0x136f('0x8'));var jayson=require(_0x136f('0x9'));var client=jayson[_0x136f('0xa')][_0x136f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114e91,_0xdd7bb,_0x542239){return new BPromise(function(_0x525a25,_0x377f93){return client['request'](_0x114e91,_0x542239)['then'](function(_0x5bf534){logger[_0x136f('0xc')](_0x136f('0xd'),_0xdd7bb,_0x136f('0xe'));logger[_0x136f('0xf')]('License,\x20%s,\x20%s,\x20%s',_0xdd7bb,_0x136f('0xe'),JSON['stringify'](_0x5bf534));if(_0x5bf534['error']){if(_0x5bf534[_0x136f('0x10')][_0x136f('0x11')]===0x1f4){logger[_0x136f('0x10')]('License,\x20%s,\x20%s',_0xdd7bb,_0x5bf534['error']['message']);return _0x377f93(_0x5bf534[_0x136f('0x10')]['message']);}logger['error'](_0x136f('0xd'),_0xdd7bb,_0x5bf534[_0x136f('0x10')][_0x136f('0x12')]);return _0x525a25(_0x5bf534[_0x136f('0x10')][_0x136f('0x12')]);}else{logger[_0x136f('0xc')]('License,\x20%s,\x20%s',_0xdd7bb,_0x136f('0xe'));_0x525a25(_0x5bf534[_0x136f('0x13')][_0x136f('0x12')]);}})[_0x136f('0x14')](function(_0x4a4a60){logger[_0x136f('0x10')](_0x136f('0xd'),_0xdd7bb,_0x4a4a60);_0x377f93(_0x4a4a60);});});} \ No newline at end of file +var _0x9e94=['result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9e94,0xfe));var _0x49e9=function(_0x323a24,_0x2ebf0e){_0x323a24=_0x323a24-0x0;var _0x2b1da6=_0x9e94[_0x323a24];return _0x2b1da6;};'use strict';var _=require(_0x49e9('0x0'));var util=require('util');var moment=require(_0x49e9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49e9('0x2'));var db=require(_0x49e9('0x3'))['db'];var utils=require(_0x49e9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x49e9('0x5'));var jayson=require(_0x49e9('0x6'));var client=jayson[_0x49e9('0x7')][_0x49e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b9d36,_0xe8d66b,_0x166ed9){return new BPromise(function(_0x106e3a,_0x54ef1c){return client[_0x49e9('0x9')](_0x5b9d36,_0x166ed9)[_0x49e9('0xa')](function(_0x5d0cc0){logger[_0x49e9('0xb')](_0x49e9('0xc'),_0xe8d66b,_0x49e9('0xd'));logger[_0x49e9('0xe')](_0x49e9('0xf'),_0xe8d66b,'request\x20sent',JSON['stringify'](_0x5d0cc0));if(_0x5d0cc0['error']){if(_0x5d0cc0[_0x49e9('0x10')][_0x49e9('0x11')]===0x1f4){logger[_0x49e9('0x10')]('License,\x20%s,\x20%s',_0xe8d66b,_0x5d0cc0[_0x49e9('0x10')][_0x49e9('0x12')]);return _0x54ef1c(_0x5d0cc0[_0x49e9('0x10')][_0x49e9('0x12')]);}logger[_0x49e9('0x10')](_0x49e9('0xc'),_0xe8d66b,_0x5d0cc0[_0x49e9('0x10')][_0x49e9('0x12')]);return _0x106e3a(_0x5d0cc0[_0x49e9('0x10')]['message']);}else{logger['info'](_0x49e9('0xc'),_0xe8d66b,_0x49e9('0xd'));_0x106e3a(_0x5d0cc0[_0x49e9('0x13')][_0x49e9('0x12')]);}})[_0x49e9('0x14')](function(_0x15f00b){logger[_0x49e9('0x10')]('License,\x20%s,\x20%s',_0xe8d66b,_0x15f00b);_0x54ef1c(_0x15f00b);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 12c3363..30496ac 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 _0xb0ae=['./mailAccount.controller','get','index','isAuthenticated','describe','/:id','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','/:id/dispositions','addDisposition','post','create','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb0ae,0x1c6));var _0xeb0a=function(_0x43a35d,_0x568d3e){_0x43a35d=_0x43a35d-0x0;var _0xe162a1=_0xb0ae[_0x43a35d];return _0xe162a1;};'use strict';var multer=require('multer');var util=require(_0xeb0a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb0a('0x1'));var router=express[_0xeb0a('0x2')]();var fs_extra=require(_0xeb0a('0x3'));var auth=require(_0xeb0a('0x4'));var interaction=require(_0xeb0a('0x5'));var config=require('../../config/environment');var controller=require(_0xeb0a('0x6'));router[_0xeb0a('0x7')]('/',auth['isAuthenticated'](),controller[_0xeb0a('0x8')]);router[_0xeb0a('0x7')]('/describe',auth[_0xeb0a('0x9')](),controller[_0xeb0a('0xa')]);router[_0xeb0a('0x7')](_0xeb0a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xeb0a('0x7')]('/:id/dispositions',auth[_0xeb0a('0x9')](),controller['getDispositions']);router[_0xeb0a('0x7')]('/:id/canned_answers',auth[_0xeb0a('0x9')](),controller[_0xeb0a('0xc')]);router[_0xeb0a('0x7')](_0xeb0a('0xd'),auth['isAuthenticated'](),controller[_0xeb0a('0xe')]);router[_0xeb0a('0x7')]('/:id/out_servers',auth[_0xeb0a('0x9')](),controller[_0xeb0a('0xf')]);router[_0xeb0a('0x7')](_0xeb0a('0x10'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x11')]);router[_0xeb0a('0x7')](_0xeb0a('0x12'),auth[_0xeb0a('0x9')](),controller['getApplications']);router[_0xeb0a('0x7')](_0xeb0a('0x13'),auth['isAuthenticated'](),controller[_0xeb0a('0x14')]);router['get'](_0xeb0a('0x15'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x16')]);router[_0xeb0a('0x7')]('/:id/users',auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x17')]);router['post'](_0xeb0a('0x18'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x19')]);router[_0xeb0a('0x1a')]('/:id/canned_answers',auth[_0xeb0a('0x9')](),controller['addAnswer']);router[_0xeb0a('0x1a')]('/',auth['isAuthenticated'](),controller[_0xeb0a('0x1b')]);router['post'](_0xeb0a('0xd'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x1c')]);router['post'](_0xeb0a('0x1d'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x1e')]);router['post'](_0xeb0a('0x10'),auth['isAuthenticated'](),controller[_0xeb0a('0x1f')]);router['post'](_0xeb0a('0x12'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x20')]);router[_0xeb0a('0x1a')](_0xeb0a('0x21'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x22')]);router[_0xeb0a('0x1a')](_0xeb0a('0x23'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x24')]);router[_0xeb0a('0x25')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xeb0a('0x26')](_0xeb0a('0x18'),auth['isAuthenticated'](),controller[_0xeb0a('0x27')]);router[_0xeb0a('0x26')](_0xeb0a('0x28'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x29')]);router[_0xeb0a('0x26')](_0xeb0a('0xd'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x2a')]);router[_0xeb0a('0x26')](_0xeb0a('0x1d'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x2b')]);router['delete'](_0xeb0a('0xb'),auth[_0xeb0a('0x9')](),controller[_0xeb0a('0x2c')]);router[_0xeb0a('0x26')](_0xeb0a('0x23'),auth[_0xeb0a('0x9')](),controller['removeAgents']);module[_0xeb0a('0x2d')]=router; \ No newline at end of file +var _0xcce8=['create','/:id/in_servers','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','update','delete','removeAnswers','removeImap','removeAgents','exports','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer'];(function(_0x1cfa18,_0x3b12d5){var _0x7003fc=function(_0x500449){while(--_0x500449){_0x1cfa18['push'](_0x1cfa18['shift']());}};_0x7003fc(++_0x3b12d5);}(_0xcce8,0x64));var _0x8cce=function(_0x39be4a,_0xd017f5){_0x39be4a=_0x39be4a-0x0;var _0x5cc42c=_0xcce8[_0x39be4a];return _0x5cc42c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8cce('0x0'));var router=express['Router']();var fs_extra=require(_0x8cce('0x1'));var auth=require(_0x8cce('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x8cce('0x3'));var controller=require(_0x8cce('0x4'));router['get']('/',auth[_0x8cce('0x5')](),controller[_0x8cce('0x6')]);router['get'](_0x8cce('0x7'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x8')]);router[_0x8cce('0x9')](_0x8cce('0xa'),auth[_0x8cce('0x5')](),controller[_0x8cce('0xb')]);router[_0x8cce('0x9')](_0x8cce('0xc'),auth['isAuthenticated'](),controller[_0x8cce('0xd')]);router[_0x8cce('0x9')]('/:id/canned_answers',auth[_0x8cce('0x5')](),controller[_0x8cce('0xe')]);router[_0x8cce('0x9')]('/:id/in_servers',auth[_0x8cce('0x5')](),controller['getImap']);router['get']('/:id/out_servers',auth[_0x8cce('0x5')](),controller['getSmtp']);router['get'](_0x8cce('0xf'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x10')]);router[_0x8cce('0x9')](_0x8cce('0x11'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x12')]);router['get'](_0x8cce('0x13'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x14')]);router[_0x8cce('0x9')](_0x8cce('0x15'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x16')]);router[_0x8cce('0x9')](_0x8cce('0x17'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x18')]);router[_0x8cce('0x19')](_0x8cce('0xc'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x1a')]);router[_0x8cce('0x19')](_0x8cce('0x1b'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x1c')]);router[_0x8cce('0x19')]('/',auth[_0x8cce('0x5')](),controller[_0x8cce('0x1d')]);router[_0x8cce('0x19')](_0x8cce('0x1e'),auth[_0x8cce('0x5')](),controller['addImap']);router[_0x8cce('0x19')](_0x8cce('0x1f'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x20')]);router[_0x8cce('0x19')](_0x8cce('0xf'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x21')]);router['post'](_0x8cce('0x11'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x22')]);router['post'](_0x8cce('0x23'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x24')]);router['post'](_0x8cce('0x17'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x8cce('0x5')](),controller[_0x8cce('0x25')]);router[_0x8cce('0x26')](_0x8cce('0xc'),auth[_0x8cce('0x5')](),controller['removeDispositions']);router[_0x8cce('0x26')](_0x8cce('0x1b'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x27')]);router[_0x8cce('0x26')](_0x8cce('0x1e'),auth[_0x8cce('0x5')](),controller[_0x8cce('0x28')]);router[_0x8cce('0x26')]('/:id/out_servers',auth[_0x8cce('0x5')](),controller['removeSmtp']);router[_0x8cce('0x26')](_0x8cce('0xa'),auth[_0x8cce('0x5')](),controller['destroy']);router['delete'](_0x8cce('0x17'),auth['isAuthenticated'](),controller[_0x8cce('0x29')]);module[_0x8cce('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 29d092a..832bb01 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 _0x44d7=['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','provider','custom','getDataValue','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x1cdec9,_0x564674){var _0x52639f=function(_0x672345){while(--_0x672345){_0x1cdec9['push'](_0x1cdec9['shift']());}};_0x52639f(++_0x564674);}(_0x44d7,0x1dd));var _0x744d=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x44d7[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module[_0x744d('0x0')]={'description':{'type':Sequelize[_0x744d('0x1')]},'name':{'type':Sequelize[_0x744d('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x744d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x744d('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x744d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x744d('0x3')]},'markAsUnread':{'type':Sequelize[_0x744d('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x744d('0x4')},'fontSize':{'type':Sequelize[_0x744d('0x5')](0x2)[_0x744d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x744d('0x3')],'defaultValue':function(){return _0x744d('0x7');}},'notificationSound':{'type':Sequelize[_0x744d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x744d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x744d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x744d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x744d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x744d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x744d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x744d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x744d('0x2')],'defaultValue':![],'comment':_0x744d('0x9'),'set':function(_0x3f371f){if(!_0x3f371f)this[_0x744d('0xa')](_0x744d('0xb'),null);this['setDataValue'](_0x744d('0xc'),_0x3f371f);}},'provider':{'type':Sequelize[_0x744d('0xd')](_0x744d('0xe'),_0x744d('0xf'),_0x744d('0x10'),_0x744d('0x11')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x744d('0x12')))return _0x744d('0x13');return this[_0x744d('0x14')](_0x744d('0x12'));},'set':function(_0xe1b24d){if(_0xe1b24d===_0x744d('0x13'))_0xe1b24d=null;return this[_0x744d('0xa')](_0x744d('0x12'),_0xe1b24d);}}}; \ No newline at end of file +var _0x1e3b=['provider','exports','BOOLEAN','STRING','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','gmail','hotmail','yahoo','outlook365','getDataValue','custom'];(function(_0x32eb7c,_0x3612aa){var _0x191a51=function(_0xc1fcb0){while(--_0xc1fcb0){_0x32eb7c['push'](_0x32eb7c['shift']());}};_0x191a51(++_0x3612aa);}(_0x1e3b,0xac));var _0xb1e3=function(_0x565711,_0x5231a2){_0x565711=_0x565711-0x0;var _0x2f084e=_0x1e3b[_0x565711];return _0x2f084e;};'use strict';var Sequelize=require('sequelize');module[_0xb1e3('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xb1e3('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb1e3('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb1e3('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb1e3('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb1e3('0x2')],'allowNull':![],'defaultValue':_0xb1e3('0x3')},'fontSize':{'type':Sequelize[_0xb1e3('0x4')](0x2)[_0xb1e3('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb1e3('0x6');}},'notificationSound':{'type':Sequelize[_0xb1e3('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb1e3('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb1e3('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb1e3('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb1e3('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb1e3('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1e3('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xb1e3('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb1e3('0x8'),'set':function(_0xc2d7d5){if(!_0xc2d7d5)this[_0xb1e3('0x9')](_0xb1e3('0xa'),null);this[_0xb1e3('0x9')](_0xb1e3('0xb'),_0xc2d7d5);}},'provider':{'type':Sequelize['ENUM'](_0xb1e3('0xc'),_0xb1e3('0xd'),_0xb1e3('0xe'),_0xb1e3('0xf')),'defaultValue':null,'get':function(){if(!this[_0xb1e3('0x10')]('provider'))return _0xb1e3('0x11');return this[_0xb1e3('0x10')](_0xb1e3('0x12'));},'set':function(_0x5319a5){if(_0x5319a5===_0xb1e3('0x11'))_0x5319a5=null;return this[_0xb1e3('0x9')]('provider',_0x5319a5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b9ce81c..94f4407 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 _0xcd51=['service','host','port','authentication','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','getImap','addImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','DESC','from','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','MailAccounts','destroy','name','send','index','MailServerIn','Smtp','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','options','MailAccount','include','findAll','rows','show','Pause','length','includeAll','find','catch','body','Imap','modernAuthentication','CloudProviderId','params','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','provider','email','ListId','isNil','active','user','username','password','pass'];(function(_0x36b58f,_0x1f3545){var _0x5760f0=function(_0x278053){while(--_0x278053){_0x36b58f['push'](_0x36b58f['shift']());}};_0x5760f0(++_0x1f3545);}(_0xcd51,0x106));var _0x1cd5=function(_0x2dbfad,_0xcdd668){_0x2dbfad=_0x2dbfad-0x0;var _0xfbed62=_0xcd51[_0x2dbfad];return _0xfbed62;};'use strict';var moment=require(_0x1cd5('0x0'));var BPromise=require(_0x1cd5('0x1'));var util=require(_0x1cd5('0x2'));var path=require(_0x1cd5('0x3'));var _=require(_0x1cd5('0x4'));var juice=require(_0x1cd5('0x5'));var Redis=require(_0x1cd5('0x6'));var qs=require(_0x1cd5('0x7'));var logger=require(_0x1cd5('0x8'))(_0x1cd5('0x9'));var config=require(_0x1cd5('0xa'));var db=require(_0x1cd5('0xb'))['db'];config[_0x1cd5('0xc')]=_[_0x1cd5('0xd')](config[_0x1cd5('0xc')],{'host':_0x1cd5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cd5('0xc')]));require(_0x1cd5('0xf'))[_0x1cd5('0x10')](socket);var jayson=require(_0x1cd5('0x11'));var client=jayson[_0x1cd5('0x12')][_0x1cd5('0x13')]({'port':0x232b});function respondWithRpcPromise(_0x215bd8,_0x1e6375,_0x33827b,_0x2c3fe4){return new BPromise(function(_0xf19395,_0x5d76e1){var _0x1bc691=_0x2c3fe4||client;return _0x1bc691[_0x1cd5('0x14')](_0x215bd8,_0x33827b)[_0x1cd5('0x15')](function(_0x5d4642){logger[_0x1cd5('0x16')](_0x1cd5('0x17'),_0x1e6375,_0x1cd5('0x18'));logger[_0x1cd5('0x19')](_0x1cd5('0x1a'),_0x1e6375,'request\x20sent',JSON[_0x1cd5('0x1b')](_0x5d4642));if(_0x5d4642[_0x1cd5('0x1c')]){if(_0x5d4642[_0x1cd5('0x1c')][_0x1cd5('0x1d')]===0x1f4){logger['error'](_0x1cd5('0x17'),_0x1e6375,_0x5d4642[_0x1cd5('0x1c')][_0x1cd5('0x1e')]);return _0x5d76e1(_0x5d4642['error'][_0x1cd5('0x1e')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x1e6375,_0x5d4642['error']['message']);return _0xf19395(_0x5d4642[_0x1cd5('0x1c')][_0x1cd5('0x1e')]);}else{logger[_0x1cd5('0x16')]('MailAccount,\x20%s,\x20%s',_0x1e6375,_0x1cd5('0x18'));_0xf19395(_0x5d4642[_0x1cd5('0x1f')][_0x1cd5('0x1e')]);}})['catch'](function(_0x5a7a23){logger[_0x1cd5('0x1c')]('MailAccount,\x20%s,\x20%s',_0x1e6375,_0x5a7a23);_0x5d76e1(_0x5a7a23);});});}function respondWithStatusCode(_0x3be01b,_0x314046){_0x314046=_0x314046||0xcc;return function(_0x11d316){if(_0x11d316){return _0x3be01b[_0x1cd5('0x20')](_0x314046);}return _0x3be01b[_0x1cd5('0x21')](_0x314046)[_0x1cd5('0x22')]();};}function respondWithResult(_0x173eca,_0x5c50db){_0x5c50db=_0x5c50db||0xc8;return function(_0x3573dc){if(_0x3573dc){return _0x173eca[_0x1cd5('0x21')](_0x5c50db)[_0x1cd5('0x23')](_0x3573dc);}};}function respondWithFilteredResult(_0x38b504,_0x4e1fb3){return function(_0x4bd5de){if(_0x4bd5de){var _0x576bab=typeof _0x4e1fb3[_0x1cd5('0x24')]===_0x1cd5('0x25')&&typeof _0x4e1fb3['limit']===_0x1cd5('0x25');var _0x583389=_0x4bd5de[_0x1cd5('0x26')];var _0xc0bf5e=_0x576bab?0x0:_0x4e1fb3['offset'];var _0x50f1d4=_0x576bab?_0x4bd5de[_0x1cd5('0x26')]:_0x4e1fb3[_0x1cd5('0x24')]+_0x4e1fb3['limit'];var _0x599cbc;if(_0x50f1d4>=_0x583389){_0x50f1d4=_0x583389;_0x599cbc=0xc8;}else{_0x599cbc=0xce;}_0x38b504[_0x1cd5('0x21')](_0x599cbc);return _0x38b504[_0x1cd5('0x27')](_0x1cd5('0x28'),_0xc0bf5e+'-'+_0x50f1d4+'/'+_0x583389)[_0x1cd5('0x23')](_0x4bd5de);}return null;};}function saveUpdates(_0x142d39){return function(_0x19e9c8){if(_0x19e9c8){return _0x19e9c8[_0x1cd5('0x29')](_0x142d39)[_0x1cd5('0x15')](function(_0x22b170){return _0x22b170;});}return null;};}function removeEntity(_0x3e9128){return function(_0x42ce94){if(_0x42ce94){return _0x42ce94['destroy']()['then'](function(){var _0x50b52c=_0x42ce94['get']({'plain':!![]});var _0x161920=_0x1cd5('0x2a');return db['UserProfileResource'][_0x1cd5('0x2b')]({'where':{'type':_0x161920,'resourceId':_0x50b52c['id']}})['then'](function(){return _0x42ce94;});})['then'](function(){_0x3e9128[_0x1cd5('0x21')](0xcc)[_0x1cd5('0x22')]();});}};}function handleEntityNotFound(_0x5daf57){return function(_0x85fa9e){if(!_0x85fa9e){_0x5daf57['sendStatus'](0x194);}return _0x85fa9e;};}function handleError(_0x5884d3,_0x5d36bb){_0x5d36bb=_0x5d36bb||0x1f4;return function(_0x253d35){logger['error'](_0x253d35['stack']);if(_0x253d35[_0x1cd5('0x2c')]){delete _0x253d35[_0x1cd5('0x2c')];}_0x5884d3['status'](_0x5d36bb)[_0x1cd5('0x2d')](_0x253d35);};}exports[_0x1cd5('0x2e')]=function(_0x3836c9,_0x17e1f7){var _0x1263b4={'include':[{'model':db[_0x1cd5('0x2f')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x1cd5('0x30')},{'model':db['Pause'],'as':_0x1cd5('0x31')}]},_0x10a38c={},_0x573ec7={'count':0x0,'rows':[]};var _0x47f182=_[_0x1cd5('0x32')](db['MailAccount'][_0x1cd5('0x33')],function(_0x1f4c43){return{'name':_0x1f4c43['fieldName'],'type':_0x1f4c43['type'][_0x1cd5('0x34')]};});_0x10a38c[_0x1cd5('0x35')]=_[_0x1cd5('0x32')](_0x47f182,_0x1cd5('0x2c'));_0x10a38c[_0x1cd5('0x36')]=_[_0x1cd5('0x37')](_0x3836c9[_0x1cd5('0x36')]);_0x10a38c[_0x1cd5('0x38')]=_[_0x1cd5('0x39')](_0x10a38c[_0x1cd5('0x35')],_0x10a38c['query']);_0x1263b4[_0x1cd5('0x3a')]=_['intersection'](_0x10a38c[_0x1cd5('0x35')],qs[_0x1cd5('0x3b')](_0x3836c9[_0x1cd5('0x36')][_0x1cd5('0x3b')]));_0x1263b4[_0x1cd5('0x3a')]=_0x1263b4[_0x1cd5('0x3a')]['length']?_0x1263b4['attributes']:_0x10a38c[_0x1cd5('0x35')];if(!_0x3836c9['query'][_0x1cd5('0x3c')](_0x1cd5('0x3d'))){_0x1263b4['limit']=qs[_0x1cd5('0x3e')](_0x3836c9[_0x1cd5('0x36')][_0x1cd5('0x3e')]);_0x1263b4[_0x1cd5('0x24')]=qs[_0x1cd5('0x24')](_0x3836c9['query'][_0x1cd5('0x24')]);}_0x1263b4['order']=qs[_0x1cd5('0x3f')](_0x3836c9[_0x1cd5('0x36')]['sort']);_0x1263b4['where']=qs[_0x1cd5('0x38')](_[_0x1cd5('0x40')](_0x3836c9[_0x1cd5('0x36')],_0x10a38c[_0x1cd5('0x38')]),_0x47f182);if(_0x3836c9[_0x1cd5('0x36')][_0x1cd5('0x41')]){_0x1263b4[_0x1cd5('0x42')]=_[_0x1cd5('0x43')](_0x1263b4[_0x1cd5('0x42')],{'$or':_[_0x1cd5('0x32')](_0x47f182,function(_0x410729){if(_0x410729[_0x1cd5('0x44')]!=='VIRTUAL'){var _0x3bfbf9={};_0x3bfbf9[_0x410729[_0x1cd5('0x2c')]]={'$like':'%'+_0x3836c9[_0x1cd5('0x36')][_0x1cd5('0x41')]+'%'};return _0x3bfbf9;}})});}_0x1263b4=_[_0x1cd5('0x43')]({},_0x1263b4,_0x3836c9[_0x1cd5('0x45')]);var _0x4bb228={'where':_0x1263b4[_0x1cd5('0x42')]};return db[_0x1cd5('0x46')][_0x1cd5('0x26')](_0x4bb228)[_0x1cd5('0x15')](function(_0x371623){_0x573ec7[_0x1cd5('0x26')]=_0x371623;if(_0x3836c9['query']['includeAll']){_0x1263b4[_0x1cd5('0x47')]=[{'all':!![]}];}return db['MailAccount'][_0x1cd5('0x48')](_0x1263b4);})['then'](function(_0x3ded6e){_0x573ec7[_0x1cd5('0x49')]=_0x3ded6e;return _0x573ec7;})[_0x1cd5('0x15')](respondWithFilteredResult(_0x17e1f7,_0x1263b4))['catch'](handleError(_0x17e1f7,null));};exports[_0x1cd5('0x4a')]=function(_0x2db28d,_0x535bca){var _0x5f1a72={'raw':![],'where':{'id':_0x2db28d['params']['id']},'include':[{'model':db[_0x1cd5('0x2f')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x1cd5('0x30')},{'model':db[_0x1cd5('0x4b')],'as':_0x1cd5('0x31')}]},_0x1cf035={};_0x1cf035[_0x1cd5('0x35')]=_['keys'](db[_0x1cd5('0x46')][_0x1cd5('0x33')]);_0x1cf035[_0x1cd5('0x36')]=_['keys'](_0x2db28d[_0x1cd5('0x36')]);_0x1cf035['filters']=_[_0x1cd5('0x39')](_0x1cf035['model'],_0x1cf035[_0x1cd5('0x36')]);_0x5f1a72[_0x1cd5('0x3a')]=_[_0x1cd5('0x39')](_0x1cf035[_0x1cd5('0x35')],qs['fields'](_0x2db28d['query'][_0x1cd5('0x3b')]));_0x5f1a72['attributes']=_0x5f1a72[_0x1cd5('0x3a')][_0x1cd5('0x4c')]?_0x5f1a72[_0x1cd5('0x3a')]:_0x1cf035[_0x1cd5('0x35')];if(_0x2db28d[_0x1cd5('0x36')][_0x1cd5('0x4d')]){_0x5f1a72[_0x1cd5('0x47')]=[{'all':!![]}];}_0x5f1a72=_['merge']({},_0x5f1a72,_0x2db28d[_0x1cd5('0x45')]);return db[_0x1cd5('0x46')][_0x1cd5('0x4e')](_0x5f1a72)[_0x1cd5('0x15')](handleEntityNotFound(_0x535bca,null))[_0x1cd5('0x15')](respondWithResult(_0x535bca,null))[_0x1cd5('0x4f')](handleError(_0x535bca,null));};exports['update']=function(_0x433e2e,_0x5c6273){if(_0x433e2e[_0x1cd5('0x50')]['id']){delete _0x433e2e[_0x1cd5('0x50')]['id'];}if(_0x433e2e['body'][_0x1cd5('0x51')]){if(!_0x433e2e[_0x1cd5('0x50')]['Imap'][_0x1cd5('0x52')]){_0x433e2e[_0x1cd5('0x50')][_0x1cd5('0x51')][_0x1cd5('0x53')]=null;}}if(_0x433e2e['body']['Smtp']){if(!_0x433e2e['body'][_0x1cd5('0x30')][_0x1cd5('0x52')]){_0x433e2e[_0x1cd5('0x50')][_0x1cd5('0x30')][_0x1cd5('0x53')]=null;}}return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x433e2e[_0x1cd5('0x54')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1cd5('0x51')},{'model':db[_0x1cd5('0x55')],'as':'Smtp'},{'model':db[_0x1cd5('0x4b')],'as':_0x1cd5('0x31')}]})['then'](handleEntityNotFound(_0x5c6273,null))[_0x1cd5('0x15')](saveUpdates(_0x433e2e[_0x1cd5('0x50')],null))[_0x1cd5('0x15')](function(_0x47a51b){if(_0x47a51b&&_0x433e2e[_0x1cd5('0x50')][_0x1cd5('0x51')]){return db['MailServerIn'][_0x1cd5('0x29')](_0x433e2e['body'][_0x1cd5('0x51')],{'where':{'MailAccountId':_0x47a51b['id']}})[_0x1cd5('0x15')](function(){return _0x47a51b;});}return _0x47a51b;})[_0x1cd5('0x15')](function(_0x803527){if(_0x803527&&_0x433e2e['body'][_0x1cd5('0x30')]){return db[_0x1cd5('0x55')][_0x1cd5('0x29')](_0x433e2e['body'][_0x1cd5('0x30')],{'where':{'MailAccountId':_0x803527['id']}})[_0x1cd5('0x15')](function(){return _0x803527;});}return _0x803527;})[_0x1cd5('0x15')](respondWithResult(_0x5c6273,null))[_0x1cd5('0x4f')](handleError(_0x5c6273,null));};exports['describe']=function(_0xa7d896,_0x31c1b4){return db[_0x1cd5('0x46')][_0x1cd5('0x56')]()[_0x1cd5('0x15')](respondWithResult(_0x31c1b4,null))['catch'](handleError(_0x31c1b4,null));};exports[_0x1cd5('0x57')]=function(_0xe4f674,_0x53b7d3){if(_0xe4f674[_0x1cd5('0x50')]['id']){delete _0xe4f674[_0x1cd5('0x50')]['id'];}return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0xe4f674[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x53b7d3,null))[_0x1cd5('0x15')](function(_0x4feb99){if(_0x4feb99){_0xe4f674[_0x1cd5('0x50')][_0x1cd5('0x58')]=_0x4feb99['id'];return db[_0x1cd5('0x59')][_0x1cd5('0x5a')](_0xe4f674[_0x1cd5('0x50')]);}})['then'](respondWithResult(_0x53b7d3,null))[_0x1cd5('0x4f')](handleError(_0x53b7d3,null));};exports[_0x1cd5('0x5b')]=function(_0x5cfc73,_0x54e4ed){var _0x2bf64e={'raw':![],'where':{}};var _0x1b60bc={};var _0x2835b0={'count':0x0,'rows':[]};return db[_0x1cd5('0x46')][_0x1cd5('0x5c')]({'where':{'id':_0x5cfc73['params']['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x54e4ed,null))[_0x1cd5('0x15')](function(_0x1f35db){if(_0x1f35db){_0x1b60bc[_0x1cd5('0x35')]=_[_0x1cd5('0x37')](db[_0x1cd5('0x59')]['rawAttributes']);_0x1b60bc['query']=_[_0x1cd5('0x37')](_0x5cfc73['query']);_0x1b60bc['filters']=_[_0x1cd5('0x39')](_0x1b60bc[_0x1cd5('0x35')],_0x1b60bc[_0x1cd5('0x36')]);_0x2bf64e['attributes']=_['intersection'](_0x1b60bc[_0x1cd5('0x35')],qs[_0x1cd5('0x3b')](_0x5cfc73['query'][_0x1cd5('0x3b')]));_0x2bf64e[_0x1cd5('0x3a')]=_0x2bf64e[_0x1cd5('0x3a')][_0x1cd5('0x4c')]?_0x2bf64e[_0x1cd5('0x3a')]:_0x1b60bc[_0x1cd5('0x35')];if(!_0x5cfc73[_0x1cd5('0x36')][_0x1cd5('0x3c')](_0x1cd5('0x3d'))){_0x2bf64e['limit']=qs[_0x1cd5('0x3e')](_0x5cfc73['query'][_0x1cd5('0x3e')]);_0x2bf64e[_0x1cd5('0x24')]=qs[_0x1cd5('0x24')](_0x5cfc73['query']['offset']);}_0x2bf64e[_0x1cd5('0x5d')]=qs[_0x1cd5('0x3f')](_0x5cfc73[_0x1cd5('0x36')]['sort']);_0x2bf64e[_0x1cd5('0x42')]=qs['filters'](_[_0x1cd5('0x40')](_0x5cfc73[_0x1cd5('0x36')],_0x1b60bc[_0x1cd5('0x38')]));_0x2bf64e['where'][_0x1cd5('0x58')]=_0x1f35db['id'];if(_0x5cfc73['query'][_0x1cd5('0x41')]){_0x2bf64e['where']=_['merge'](_0x2bf64e['where'],{'$or':_[_0x1cd5('0x32')](_0x2bf64e[_0x1cd5('0x3a')],function(_0x3ee94d){var _0x288699={};_0x288699[_0x3ee94d]={'$like':'%'+_0x5cfc73[_0x1cd5('0x36')][_0x1cd5('0x41')]+'%'};return _0x288699;})});}_0x2bf64e=_[_0x1cd5('0x43')]({},_0x2bf64e,_0x5cfc73[_0x1cd5('0x45')]);return db['Disposition']['count']({'where':_0x2bf64e[_0x1cd5('0x42')]})[_0x1cd5('0x15')](function(_0x5efb80){_0x2835b0[_0x1cd5('0x26')]=_0x5efb80;if(_0x5cfc73[_0x1cd5('0x36')][_0x1cd5('0x4d')]){_0x2bf64e[_0x1cd5('0x47')]=[{'all':!![]}];}return db['Disposition'][_0x1cd5('0x48')](_0x2bf64e);})[_0x1cd5('0x15')](function(_0x3a5c03){_0x2835b0['rows']=_0x3a5c03;return _0x2835b0;});}})[_0x1cd5('0x15')](respondWithFilteredResult(_0x54e4ed,_0x2bf64e))[_0x1cd5('0x4f')](handleError(_0x54e4ed,null));};exports[_0x1cd5('0x5e')]=function(_0x104468,_0x28c8f4){return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x104468[_0x1cd5('0x54')]['id']}})['then'](handleEntityNotFound(_0x28c8f4,null))[_0x1cd5('0x15')](function(_0x556dd2){if(_0x556dd2){return _0x556dd2[_0x1cd5('0x5e')](_0x104468[_0x1cd5('0x36')]['ids']);}})[_0x1cd5('0x15')](respondWithStatusCode(_0x28c8f4,null))[_0x1cd5('0x4f')](handleError(_0x28c8f4,null));};exports[_0x1cd5('0x5f')]=function(_0x236ede,_0x50a5c2){if(_0x236ede[_0x1cd5('0x50')]['id']){delete _0x236ede[_0x1cd5('0x50')]['id'];}return db[_0x1cd5('0x46')]['find']({'where':{'id':_0x236ede['params']['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x50a5c2,null))[_0x1cd5('0x15')](function(_0x46764e){if(_0x46764e){_0x236ede[_0x1cd5('0x50')][_0x1cd5('0x58')]=_0x46764e['id'];return db[_0x1cd5('0x60')]['create'](_0x236ede[_0x1cd5('0x50')]);}})['then'](respondWithResult(_0x50a5c2,null))[_0x1cd5('0x4f')](handleError(_0x50a5c2,null));};exports['getAnswers']=function(_0x2f286e,_0x3f771a){var _0x2833a5={'raw':![],'where':{}};var _0x2b704b={};var _0x5b5dc2={'count':0x0,'rows':[]};return db[_0x1cd5('0x46')]['findOne']({'where':{'id':_0x2f286e[_0x1cd5('0x54')]['id']}})['then'](handleEntityNotFound(_0x3f771a,null))['then'](function(_0x3e1532){if(_0x3e1532){_0x2b704b[_0x1cd5('0x35')]=_[_0x1cd5('0x37')](db[_0x1cd5('0x60')][_0x1cd5('0x33')]);_0x2b704b['query']=_[_0x1cd5('0x37')](_0x2f286e[_0x1cd5('0x36')]);_0x2b704b[_0x1cd5('0x38')]=_[_0x1cd5('0x39')](_0x2b704b[_0x1cd5('0x35')],_0x2b704b['query']);_0x2833a5[_0x1cd5('0x3a')]=_[_0x1cd5('0x39')](_0x2b704b['model'],qs[_0x1cd5('0x3b')](_0x2f286e[_0x1cd5('0x36')]['fields']));_0x2833a5[_0x1cd5('0x3a')]=_0x2833a5[_0x1cd5('0x3a')][_0x1cd5('0x4c')]?_0x2833a5['attributes']:_0x2b704b['model'];if(!_0x2f286e[_0x1cd5('0x36')]['hasOwnProperty'](_0x1cd5('0x3d'))){_0x2833a5[_0x1cd5('0x3e')]=qs[_0x1cd5('0x3e')](_0x2f286e[_0x1cd5('0x36')][_0x1cd5('0x3e')]);_0x2833a5[_0x1cd5('0x24')]=qs[_0x1cd5('0x24')](_0x2f286e['query'][_0x1cd5('0x24')]);}_0x2833a5['order']=qs[_0x1cd5('0x3f')](_0x2f286e['query'][_0x1cd5('0x3f')]);_0x2833a5['where']=qs[_0x1cd5('0x38')](_[_0x1cd5('0x40')](_0x2f286e['query'],_0x2b704b['filters']));_0x2833a5['where']['MailAccountId']=_0x3e1532['id'];if(_0x2f286e[_0x1cd5('0x36')][_0x1cd5('0x41')]){_0x2833a5[_0x1cd5('0x42')]=_[_0x1cd5('0x43')](_0x2833a5[_0x1cd5('0x42')],{'$or':_[_0x1cd5('0x32')](_0x2833a5['attributes'],function(_0x1569b7){var _0x218b00={};_0x218b00[_0x1569b7]={'$like':'%'+_0x2f286e['query']['filter']+'%'};return _0x218b00;})});}_0x2833a5=_['merge']({},_0x2833a5,_0x2f286e['options']);return db[_0x1cd5('0x60')][_0x1cd5('0x26')]({'where':_0x2833a5[_0x1cd5('0x42')]})[_0x1cd5('0x15')](function(_0x55974d){_0x5b5dc2[_0x1cd5('0x26')]=_0x55974d;if(_0x2f286e['query'][_0x1cd5('0x4d')]){_0x2833a5['include']=[{'all':!![]}];}return db[_0x1cd5('0x60')][_0x1cd5('0x48')](_0x2833a5);})[_0x1cd5('0x15')](function(_0x151086){_0x5b5dc2[_0x1cd5('0x49')]=_0x151086;return _0x5b5dc2;});}})[_0x1cd5('0x15')](respondWithFilteredResult(_0x3f771a,_0x2833a5))[_0x1cd5('0x4f')](handleError(_0x3f771a,null));};exports[_0x1cd5('0x61')]=function(_0x2b4cc8,_0x138ac4){return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x2b4cc8[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x138ac4,null))[_0x1cd5('0x15')](function(_0x58637a){if(_0x58637a){return _0x58637a[_0x1cd5('0x61')](_0x2b4cc8[_0x1cd5('0x36')][_0x1cd5('0x62')]);}})['then'](respondWithStatusCode(_0x138ac4,null))[_0x1cd5('0x4f')](handleError(_0x138ac4,null));};exports[_0x1cd5('0x5a')]=function(_0x529044,_0x191263){var _0xd8f4a7={'name':_0x529044[_0x1cd5('0x50')][_0x1cd5('0x2c')],'key':_0x529044[_0x1cd5('0x50')][_0x1cd5('0x34')],'provider':_0x529044['body']['provider']==='custom'?null:_0x529044[_0x1cd5('0x50')][_0x1cd5('0x63')],'email':_0x529044['body'][_0x1cd5('0x64')],'ListId':_0x529044[_0x1cd5('0x50')][_0x1cd5('0x65')],'active':!_[_0x1cd5('0x66')](_0x529044['body'][_0x1cd5('0x67')])?_0x529044['body']['active']:!![],'description':_0x529044['body']['description']||null,'Imap':{},'Smtp':{}};if(_0xd8f4a7[_0x1cd5('0x63')]){_0xd8f4a7['Imap'][_0x1cd5('0x68')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x68')]=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x69')];_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6a')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6b')]=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x6a')];if(_0x529044['body'][_0x1cd5('0x52')]){_0xd8f4a7['Imap'][_0x1cd5('0x52')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x52')]=!![];_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x53')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x53')]=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x53')];_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6a')]=_0xd8f4a7['Smtp']['pass']=null;}else{_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x53')]=_0xd8f4a7['Smtp']['CloudProviderId']=null;}_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6c')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6c')]=null;_0xd8f4a7['Imap'][_0x1cd5('0x6d')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6d')]=null;_0xd8f4a7[_0x1cd5('0x51')]['port']=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6e')]=null;}else{if(_0x529044[_0x1cd5('0x50')]['authentication']){_0xd8f4a7['Imap'][_0x1cd5('0x68')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x68')]=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x69')];_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6a')]=_0xd8f4a7['Smtp'][_0x1cd5('0x6b')]=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x6a')];}else{_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6f')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6f')]=![];_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x68')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x68')]=null;_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6a')]=_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6b')]=null;}_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6d')]=_0x529044['body'][_0x1cd5('0x51')][_0x1cd5('0x6d')];_0xd8f4a7[_0x1cd5('0x51')][_0x1cd5('0x6e')]=_0x529044['body'][_0x1cd5('0x51')][_0x1cd5('0x6e')];_0xd8f4a7[_0x1cd5('0x30')][_0x1cd5('0x6d')]=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x30')][_0x1cd5('0x6d')];_0xd8f4a7[_0x1cd5('0x30')]['port']=_0x529044[_0x1cd5('0x50')][_0x1cd5('0x30')][_0x1cd5('0x6e')];}return db['MailAccount'][_0x1cd5('0x5a')](_0xd8f4a7,{'include':[{'model':db[_0x1cd5('0x55')],'as':_0x1cd5('0x30')},{'model':db[_0x1cd5('0x2f')],'as':_0x1cd5('0x51')}]})[_0x1cd5('0x15')](function(_0x1d32dc){var _0x5164bf=_0x529044[_0x1cd5('0x68')][_0x1cd5('0x70')]({'plain':!![]});if(!_0x5164bf)throw new Error(_0x1cd5('0x71'));if(_0x5164bf[_0x1cd5('0x72')]===_0x1cd5('0x68')){var _0x491791=_0x1d32dc[_0x1cd5('0x70')]({'plain':!![]});return db[_0x1cd5('0x73')][_0x1cd5('0x4e')]({'where':{'name':_0x1cd5('0x2a'),'userProfileId':_0x5164bf[_0x1cd5('0x74')]},'raw':!![]})[_0x1cd5('0x15')](function(_0x4fa1a4){if(_0x4fa1a4&&_0x4fa1a4['autoAssociation']===0x0){return db[_0x1cd5('0x75')][_0x1cd5('0x5a')]({'name':_0x491791[_0x1cd5('0x2c')],'resourceId':_0x491791['id'],'type':_0x4fa1a4['name'],'sectionId':_0x4fa1a4['id']},{})[_0x1cd5('0x15')](function(){return _0x1d32dc;});}else{return _0x1d32dc;}})[_0x1cd5('0x4f')](function(_0x502d86){logger[_0x1cd5('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x502d86);throw _0x502d86;});}return _0x1d32dc;})[_0x1cd5('0x15')](respondWithResult(_0x191263,0xc9))[_0x1cd5('0x4f')](handleError(_0x191263,null));};exports[_0x1cd5('0x76')]=function(_0x54d6c8,_0x14c5c5){return db[_0x1cd5('0x46')][_0x1cd5('0x5c')]({'where':{'id':_0x54d6c8[_0x1cd5('0x54')]['id']}})['then'](handleEntityNotFound(_0x14c5c5,null))[_0x1cd5('0x15')](function(_0xa1cf97){if(_0xa1cf97){return _0xa1cf97[_0x1cd5('0x76')]();}return null;})['then'](respondWithResult(_0x14c5c5,null))[_0x1cd5('0x4f')](handleError(_0x14c5c5,null));};exports[_0x1cd5('0x77')]=function(_0x5ede4f,_0x2046ae){if(_0x5ede4f[_0x1cd5('0x50')]['id']){delete _0x5ede4f[_0x1cd5('0x50')]['id'];}return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x5ede4f[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x2046ae,null))[_0x1cd5('0x15')](function(_0x4b472e){if(_0x4b472e){_0x5ede4f[_0x1cd5('0x50')][_0x1cd5('0x58')]=_0x4b472e['id'];return db['MailServerIn'][_0x1cd5('0x5a')](_0x5ede4f[_0x1cd5('0x50')]);}})[_0x1cd5('0x15')](respondWithResult(_0x2046ae,null))[_0x1cd5('0x4f')](handleError(_0x2046ae,null));};exports['removeImap']=function(_0x5251df,_0x270eaf){return db['MailAccount'][_0x1cd5('0x5c')]({'where':{'id':_0x5251df[_0x1cd5('0x54')]['id']}})['then'](handleEntityNotFound(_0x270eaf,null))[_0x1cd5('0x15')](function(_0x23d191){if(_0x23d191){return _0x23d191[_0x1cd5('0x78')](null);}return null;})[_0x1cd5('0x15')](respondWithStatusCode(_0x270eaf,null))[_0x1cd5('0x4f')](handleError(_0x270eaf,null));};exports[_0x1cd5('0x79')]=function(_0x1fcaee,_0xeef6c6){return db[_0x1cd5('0x46')][_0x1cd5('0x5c')]({'where':{'id':_0x1fcaee['params']['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0xeef6c6,null))[_0x1cd5('0x15')](function(_0x237736){if(_0x237736){return _0x237736[_0x1cd5('0x79')]();}return null;})[_0x1cd5('0x15')](respondWithResult(_0xeef6c6,null))['catch'](handleError(_0xeef6c6,null));};exports['addSmtp']=function(_0x58bdff,_0x58253d){if(_0x58bdff['body']['id']){delete _0x58bdff[_0x1cd5('0x50')]['id'];}return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x58bdff[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x58253d,null))[_0x1cd5('0x15')](function(_0x35eb8e){if(_0x35eb8e){_0x58bdff[_0x1cd5('0x50')][_0x1cd5('0x58')]=_0x35eb8e['id'];return db[_0x1cd5('0x55')]['create'](_0x58bdff[_0x1cd5('0x50')]);}})[_0x1cd5('0x15')](respondWithResult(_0x58253d,null))['catch'](handleError(_0x58253d,null));};exports[_0x1cd5('0x7a')]=function(_0x5f274b,_0x4ae21c){return db[_0x1cd5('0x46')][_0x1cd5('0x5c')]({'where':{'id':_0x5f274b[_0x1cd5('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ae21c,null))[_0x1cd5('0x15')](function(_0x1b0117){if(_0x1b0117){return _0x1b0117[_0x1cd5('0x7b')](null);}return null;})[_0x1cd5('0x15')](respondWithStatusCode(_0x4ae21c,null))[_0x1cd5('0x4f')](handleError(_0x4ae21c,null));};exports[_0x1cd5('0x7c')]=function(_0x547469,_0x52ec68){return db[_0x1cd5('0x7d')][_0x1cd5('0x4e')]({'where':{'id':_0x547469['params']['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x52ec68,null))['then'](function(_0x44ccc){if(_0x44ccc){return _0x44ccc[_0x1cd5('0x7c')](_0x547469[_0x1cd5('0x50')][_0x1cd5('0x62')],_[_0x1cd5('0x7e')](_0x547469['body'],[_0x1cd5('0x62'),'id'])||{});}})[_0x1cd5('0x15')](respondWithResult(_0x52ec68,null))[_0x1cd5('0x4f')](handleError(_0x52ec68,null));};exports[_0x1cd5('0x7f')]=function(_0x24bb0d,_0x4dbba3){var _0x17c24d={'raw':![],'where':{}};var _0x322838={};var _0x6f3c3c={'count':0x0,'rows':[]};return db[_0x1cd5('0x46')][_0x1cd5('0x5c')]({'where':{'id':_0x24bb0d[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x4dbba3,null))[_0x1cd5('0x15')](function(_0x1b7f37){if(_0x1b7f37){_0x322838[_0x1cd5('0x35')]=_[_0x1cd5('0x37')](db['MailInteraction'][_0x1cd5('0x33')]);_0x322838['query']=_[_0x1cd5('0x37')](_0x24bb0d[_0x1cd5('0x36')]);_0x322838[_0x1cd5('0x38')]=_[_0x1cd5('0x39')](_0x322838['model'],_0x322838['query']);_0x17c24d[_0x1cd5('0x3a')]=_[_0x1cd5('0x39')](_0x322838[_0x1cd5('0x35')],qs[_0x1cd5('0x3b')](_0x24bb0d['query'][_0x1cd5('0x3b')]));_0x17c24d[_0x1cd5('0x3a')]=_0x17c24d[_0x1cd5('0x3a')][_0x1cd5('0x4c')]?_0x17c24d[_0x1cd5('0x3a')]:_0x322838[_0x1cd5('0x35')];if(!_0x24bb0d['query'][_0x1cd5('0x3c')](_0x1cd5('0x3d'))){_0x17c24d[_0x1cd5('0x3e')]=qs['limit'](_0x24bb0d[_0x1cd5('0x36')]['limit']);_0x17c24d['offset']=qs[_0x1cd5('0x24')](_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x24')]);}_0x17c24d['order']=qs['sort'](_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x3f')]);_0x17c24d[_0x1cd5('0x42')]=qs[_0x1cd5('0x38')](_[_0x1cd5('0x40')](_0x24bb0d[_0x1cd5('0x36')],_0x322838['filters']));_0x17c24d['where'][_0x1cd5('0x58')]=_0x1b7f37['id'];if(_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x41')]){_0x17c24d[_0x1cd5('0x42')]=_[_0x1cd5('0x43')](_0x17c24d[_0x1cd5('0x42')],{'$or':_[_0x1cd5('0x32')](_0x17c24d['attributes'],function(_0x5127d7){var _0x58c37b={};_0x58c37b[_0x5127d7]={'$like':'%'+_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x41')]+'%'};return _0x58c37b;})});}_0x17c24d=_[_0x1cd5('0x43')]({},_0x17c24d,_0x24bb0d[_0x1cd5('0x45')]);return db[_0x1cd5('0x7d')]['count']({'where':_0x17c24d[_0x1cd5('0x42')]})[_0x1cd5('0x15')](function(_0x595015){_0x6f3c3c[_0x1cd5('0x26')]=_0x595015;if(_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x4d')]){_0x17c24d['include']=[{'model':db[_0x1cd5('0x80')],'as':'Contact','required':![]},{'model':db[_0x1cd5('0x81')],'as':'Owner','attributes':['name',_0x1cd5('0x82'),_0x1cd5('0x83')],'required':![]},{'model':db[_0x1cd5('0x84')],'as':_0x1cd5('0x85'),'attributes':['id',_0x1cd5('0x2c'),_0x1cd5('0x86')],'where':_0x24bb0d['query'][_0x1cd5('0x87')]?{'id':_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x87')]}:undefined,'required':_0x24bb0d[_0x1cd5('0x36')][_0x1cd5('0x87')]?!![]:![]}];}return db[_0x1cd5('0x7d')][_0x1cd5('0x48')](_0x17c24d);})[_0x1cd5('0x15')](function(_0x4c8d65){_0x6f3c3c[_0x1cd5('0x49')]=_0x4c8d65;return _0x6f3c3c;});}})[_0x1cd5('0x15')](respondWithFilteredResult(_0x4dbba3,_0x17c24d))[_0x1cd5('0x4f')](handleError(_0x4dbba3,null));};exports['addApplications']=function addApplications(_0x18c7de,_0x11d6fe){var _0x245cb6=_0x18c7de['params']['id'];var _0x56b78d=_0x18c7de['body'];var _0x58bac8=0xc8;var _0x404a2a=null;return db[_0x1cd5('0x88')][_0x1cd5('0x89')]({'isolationLevel':db[_0x1cd5('0x88')]['Transaction']['ISOLATION_LEVELS'][_0x1cd5('0x8a')]},function(_0x5130a3){return db[_0x1cd5('0x46')]['findOne']({'where':{'id':_0x245cb6},'transaction':_0x5130a3})[_0x1cd5('0x15')](function(_0x417b3f){if(_0x417b3f){return db['MailApplication'][_0x1cd5('0x2b')]({'where':{'MailAccountId':_0x245cb6},'transaction':_0x5130a3})[_0x1cd5('0x15')](function(){var _0x5d74ea=_[_0x1cd5('0x32')](_0x56b78d,function(_0x4177bc){_0x4177bc[_0x1cd5('0x58')]=_0x245cb6;return _0x4177bc;});return db[_0x1cd5('0x8b')][_0x1cd5('0x8c')](_0x5d74ea,{'transaction':_0x5130a3});});}else{_0x58bac8=0x194;_0x404a2a=[];}});})[_0x1cd5('0x15')](function(){if(_0x58bac8!==0x194){return db[_0x1cd5('0x8b')][_0x1cd5('0x8d')]({'where':{'MailAccountId':_0x245cb6},'order':'priority'})[_0x1cd5('0x15')](function(_0x29c27e){_0x404a2a=_0x29c27e;});}})[_0x1cd5('0x4f')](function(_0x315eaf){_0x58bac8=0x1f4;logger['error'](_0x315eaf[_0x1cd5('0x8e')]);if(_0x315eaf['name']){delete _0x315eaf[_0x1cd5('0x2c')];}_0x404a2a=_0x315eaf;})[_0x1cd5('0x8f')](function(){if(_0x404a2a===null){_0x11d6fe[_0x1cd5('0x20')](_0x58bac8);}else{if(_0x58bac8===0x1f4){_0x11d6fe[_0x1cd5('0x21')](_0x58bac8)[_0x1cd5('0x2d')](_0x404a2a);}else{_0x11d6fe[_0x1cd5('0x21')](_0x58bac8)[_0x1cd5('0x23')](_0x404a2a);}}});};exports[_0x1cd5('0x90')]=function(_0x3a5971,_0x541b34){var _0x4a9f88={};var _0x444d23={};var _0x3ccfff;var _0x208cce;return db['MailAccount'][_0x1cd5('0x5c')]({'where':{'id':_0x3a5971[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x541b34,null))[_0x1cd5('0x15')](function(_0x1c14ff){if(_0x1c14ff){_0x3ccfff=_0x1c14ff;_0x444d23[_0x1cd5('0x35')]=_[_0x1cd5('0x37')](db[_0x1cd5('0x8b')][_0x1cd5('0x33')]);_0x444d23[_0x1cd5('0x36')]=_[_0x1cd5('0x37')](_0x3a5971['query']);_0x444d23[_0x1cd5('0x38')]=_['intersection'](_0x444d23['model'],_0x444d23[_0x1cd5('0x36')]);_0x4a9f88[_0x1cd5('0x3a')]=_[_0x1cd5('0x39')](_0x444d23['model'],qs[_0x1cd5('0x3b')](_0x3a5971[_0x1cd5('0x36')][_0x1cd5('0x3b')]));_0x4a9f88[_0x1cd5('0x3a')]=_0x4a9f88['attributes']['length']?_0x4a9f88[_0x1cd5('0x3a')]:_0x444d23['model'];_0x4a9f88['order']=qs['sort'](_0x3a5971['query'][_0x1cd5('0x3f')]);_0x4a9f88['where']=qs['filters'](_[_0x1cd5('0x40')](_0x3a5971['query'],_0x444d23[_0x1cd5('0x38')]));if(_0x3a5971[_0x1cd5('0x36')][_0x1cd5('0x41')]){_0x4a9f88[_0x1cd5('0x42')]=_[_0x1cd5('0x43')](_0x4a9f88['where'],{'$or':_[_0x1cd5('0x32')](_0x4a9f88['attributes'],function(_0x3a48bb){var _0x8d911c={};_0x8d911c[_0x3a48bb]={'$like':'%'+_0x3a5971[_0x1cd5('0x36')][_0x1cd5('0x41')]+'%'};return _0x8d911c;})});}_0x4a9f88=_[_0x1cd5('0x43')]({},_0x4a9f88,_0x3a5971[_0x1cd5('0x45')]);return _0x3ccfff[_0x1cd5('0x90')](_0x4a9f88);}})[_0x1cd5('0x15')](function(_0x496e84){if(_0x496e84){_0x208cce=_0x496e84['length'];if(!_0x3a5971[_0x1cd5('0x36')][_0x1cd5('0x3c')](_0x1cd5('0x3d'))){_0x4a9f88['limit']=qs['limit'](_0x3a5971[_0x1cd5('0x36')][_0x1cd5('0x3e')]);_0x4a9f88[_0x1cd5('0x24')]=qs[_0x1cd5('0x24')](_0x3a5971[_0x1cd5('0x36')]['offset']);}return _0x3ccfff[_0x1cd5('0x90')](_0x4a9f88);}})[_0x1cd5('0x15')](function(_0x406430){if(_0x406430){return _0x406430?{'count':_0x208cce,'rows':_0x406430}:null;}})[_0x1cd5('0x15')](respondWithResult(_0x541b34,null))['catch'](handleError(_0x541b34,null));};exports[_0x1cd5('0x91')]=function(_0x3feb79,_0x10070d){var _0xf851f1={'raw':!![],'where':{}};var _0x403a5d={};var _0x5bc4a0={'count':0x0,'rows':[]};return db['MailAccount'][_0x1cd5('0x5c')]({'where':{'id':_0x3feb79['params']['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x10070d,null))[_0x1cd5('0x15')](function(_0x2b9db0){if(_0x2b9db0){_0x403a5d[_0x1cd5('0x35')]=_['keys'](db[_0x1cd5('0x92')][_0x1cd5('0x33')]);_0x403a5d[_0x1cd5('0x36')]=_['keys'](_0x3feb79[_0x1cd5('0x36')]);_0x403a5d[_0x1cd5('0x38')]=_[_0x1cd5('0x39')](_0x403a5d[_0x1cd5('0x35')],_0x403a5d[_0x1cd5('0x36')]);_0xf851f1[_0x1cd5('0x3a')]=_[_0x1cd5('0x39')](_0x403a5d[_0x1cd5('0x35')],qs[_0x1cd5('0x3b')](_0x3feb79['query'][_0x1cd5('0x3b')]));_0xf851f1['attributes']=_0xf851f1[_0x1cd5('0x3a')][_0x1cd5('0x4c')]?_0xf851f1[_0x1cd5('0x3a')]:_0x403a5d['model'];if(!_0x3feb79['query'][_0x1cd5('0x3c')](_0x1cd5('0x3d'))){_0xf851f1[_0x1cd5('0x3e')]=qs[_0x1cd5('0x3e')](_0x3feb79['query'][_0x1cd5('0x3e')]);_0xf851f1[_0x1cd5('0x24')]=qs[_0x1cd5('0x24')](_0x3feb79[_0x1cd5('0x36')][_0x1cd5('0x24')]);}_0xf851f1[_0x1cd5('0x5d')]=qs['sort'](_0x3feb79['query']['sort']);_0xf851f1[_0x1cd5('0x42')]=qs[_0x1cd5('0x38')](_[_0x1cd5('0x40')](_0x3feb79[_0x1cd5('0x36')],_0x403a5d[_0x1cd5('0x38')]));_0xf851f1['where'][_0x1cd5('0x58')]=_0x2b9db0['id'];if(_0x3feb79['query'][_0x1cd5('0x41')]){_0xf851f1[_0x1cd5('0x42')]=_[_0x1cd5('0x43')](_0xf851f1['where'],{'$or':_['map'](_0xf851f1[_0x1cd5('0x3a')],function(_0x41243b){var _0x23485c={};_0x23485c[_0x41243b]={'$like':'%'+_0x3feb79[_0x1cd5('0x36')]['filter']+'%'};return _0x23485c;})});}if(_0x3feb79[_0x1cd5('0x36')][_0x1cd5('0x93')]){var _0x3cca56=_0x3feb79[_0x1cd5('0x36')][_0x1cd5('0x93')][_0x1cd5('0x94')](',');var _0x159c2a={};_0x159c2a[_0x3cca56[0x0]]={'$gte':moment(_0x3cca56[0x1])[_0x1cd5('0x95')](_0x1cd5('0x96'))};_0xf851f1[_0x1cd5('0x42')]=_['merge'](_0xf851f1['where'],_0x159c2a);}_0xf851f1=_[_0x1cd5('0x43')]({},_0xf851f1,_0x3feb79[_0x1cd5('0x45')]);return db[_0x1cd5('0x92')]['count']({'where':_0xf851f1[_0x1cd5('0x42')]})['then'](function(_0x5205f4){_0x5bc4a0['count']=_0x5205f4;if(_0x3feb79[_0x1cd5('0x36')][_0x1cd5('0x4d')]){_0xf851f1[_0x1cd5('0x47')]=[{'all':!![]}];}return db[_0x1cd5('0x92')][_0x1cd5('0x48')](_0xf851f1);})[_0x1cd5('0x15')](function(_0x49cc6e){if(_0x3feb79[_0x1cd5('0x36')][_0x1cd5('0x97')]===_0x1cd5('0x98')){for(var _0x36b0a7=0x0;_0x36b0a7<_0x49cc6e[_0x1cd5('0x4c')];_0x36b0a7++){_0x49cc6e[_0x36b0a7]['body']=juice(_0x49cc6e[_0x36b0a7][_0x1cd5('0x50')]);}}_0x5bc4a0['rows']=_0x49cc6e;return _0x5bc4a0;});}})[_0x1cd5('0x15')](respondWithFilteredResult(_0x10070d,_0xf851f1))[_0x1cd5('0x4f')](handleError(_0x10070d,null));};exports[_0x1cd5('0x2d')]=function(_0x5e6e4c,_0x2a352b){var _0xb63188,_0x59c65a={},_0x15fdbb;if(_0x5e6e4c[_0x1cd5('0x50')]['to']){_0x15fdbb=_0x5e6e4c[_0x1cd5('0x50')]['to'][_0x1cd5('0x94')](',')[0x0];}return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x5e6e4c[_0x1cd5('0x54')]['id']},'include':[{'model':db[_0x1cd5('0x99')],'as':'List','include':[{'model':db[_0x1cd5('0x80')],'as':'Contacts','where':{'email':_0x15fdbb},'limit':0x1,'order':[['updatedAt',_0x1cd5('0x9a')]]}]},{'model':db[_0x1cd5('0x55')],'as':'Smtp','raw':!![]}]})[_0x1cd5('0x15')](handleEntityNotFound(_0x2a352b,null))['then'](function(_0x3140b6){if(_0x3140b6){_0xb63188=_0x3140b6;if(_0x3140b6[_0x1cd5('0x30')]){if(_[_0x1cd5('0x66')](_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0x9b')])){_0x5e6e4c[_0x1cd5('0x50')]['from']=util['format']('%s\x20<%s>',_0x3140b6[_0x1cd5('0x2c')],_0x3140b6[_0x1cd5('0x64')]||_0x3140b6[_0x1cd5('0x30')][_0x1cd5('0x68')]);}if(_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0x9c')]&&_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0x9c')]['length']){for(var _0x3734e0=0x0;_0x3734e0<_0x5e6e4c['body'][_0x1cd5('0x9c')]['length'];_0x3734e0+=0x1){_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0x9c')][_0x3734e0]={'filename':_0x5e6e4c[_0x1cd5('0x50')]['attachments'][_0x3734e0][_0x1cd5('0x2c')],'path':path[_0x1cd5('0x9d')](config['root'],_0x1cd5('0x9e'),_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0x9c')][_0x3734e0][_0x1cd5('0x9f')])};}}var _0xbf683d={'tls':{'rejectUnauthorized':![]}};if(_[_0x1cd5('0x66')](_0x3140b6[_0x1cd5('0x30')]['service'])){if(_0x3140b6['Smtp']['authentication']){_0xbf683d[_0x1cd5('0xa0')]={'user':_0x3140b6[_0x1cd5('0x30')][_0x1cd5('0x68')],'pass':_0x3140b6[_0x1cd5('0x30')][_0x1cd5('0x6b')]};}_0xbf683d[_0x1cd5('0x6d')]=_0x3140b6['Smtp'][_0x1cd5('0x6d')];_0xbf683d['port']=_0x3140b6[_0x1cd5('0x30')][_0x1cd5('0x6e')];_0xbf683d[_0x1cd5('0xa1')]=_0x3140b6['Smtp'][_0x1cd5('0xa1')];}else{_0xbf683d[_0x1cd5('0x6c')]=_0x3140b6[_0x1cd5('0x30')][_0x1cd5('0x6c')];_0xbf683d['auth']={'user':_0x3140b6[_0x1cd5('0x30')][_0x1cd5('0x68')],'pass':_0x3140b6['Smtp'][_0x1cd5('0x6b')]};}return respondWithRpcPromise(_0x1cd5('0xa2'),_0x1cd5('0xa3'),{'account':_0xbf683d,'message':_0x5e6e4c[_0x1cd5('0x50')]});}else{throw new Error('List\x20not\x20found');}}})[_0x1cd5('0x15')](function(_0x152585){if(_0x152585){_0x59c65a=_0x152585;if(_0xb63188[_0x1cd5('0xa4')]){if(_0xb63188[_0x1cd5('0xa4')]['Contacts'][_0x1cd5('0x4c')]){return _0xb63188[_0x1cd5('0xa4')][_0x1cd5('0xa5')][0x0];}else{return db[_0x1cd5('0x80')][_0x1cd5('0x5a')](_[_0x1cd5('0xd')](_0x5e6e4c[_0x1cd5('0x50')],{'firstName':_0x5e6e4c[_0x1cd5('0x50')]['to'],'email':_0x5e6e4c[_0x1cd5('0x50')]['to'],'phone':_0x5e6e4c[_0x1cd5('0x50')]['to'],'ListId':_0xb63188[_0x1cd5('0x65')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x1cd5('0x15')](function(_0x15de41){if(_0x15de41){var _0x4974fc={'UserId':_0x5e6e4c[_0x1cd5('0x68')]['id'],'ContactId':_0x15de41['id'],'MailAccountId':_0xb63188['id'],'inReplyTo':_0x59c65a[_0x1cd5('0xa6')],'to':_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0x9b')],'cc':_0x5e6e4c[_0x1cd5('0x50')]['cc'],'subject':_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0xa7')],'attach':_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0xa8')],'firstMsgDirection':_0x1cd5('0xa9'),'lastMsgAt':moment()[_0x1cd5('0x95')](_0x1cd5('0x96')),'lastMsgDirection':'out','Messages':[_[_0x1cd5('0x43')](_0x5e6e4c[_0x1cd5('0x50')],{'messageId':_0x59c65a['messageId'],'sentAt':moment()[_0x1cd5('0x95')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xb63188['id'],'UserId':_0x5e6e4c['user']['id'],'ContactId':_0x15de41['id']})]};if(_0x5e6e4c['body'][_0x1cd5('0xaa')]){_0x4974fc=_[_0x1cd5('0x43')](_0x4974fc,_0x5e6e4c[_0x1cd5('0x50')][_0x1cd5('0xaa')]);}return db['MailInteraction']['create'](_0x4974fc,{'include':[{'model':db[_0x1cd5('0x92')],'as':_0x1cd5('0xab')}]});}})[_0x1cd5('0x15')](respondWithResult(_0x2a352b,null))['catch'](handleError(_0x2a352b,null));};exports[_0x1cd5('0xac')]=function(_0xfc72cb,_0x144299){return db[_0x1cd5('0x46')]['find']({'where':{'id':_0xfc72cb[_0x1cd5('0x54')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x1cd5('0x30'),'raw':!![],'include':[{'model':db[_0x1cd5('0xad')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x144299,null))[_0x1cd5('0x15')](function(_0x54c908){if(!_0x54c908[_0x1cd5('0x30')])return;var _0x3bc372={'id':_0x54c908['id'],'tls':{'rejectUnauthorized':![]}};if(_0x54c908['provider']!=='custom'){_0x3bc372['service']=_0x54c908[_0x1cd5('0x63')];}else{_0x3bc372[_0x1cd5('0x6d')]=_0x54c908[_0x1cd5('0x30')]['host'];_0x3bc372['port']=_0x54c908['Smtp'][_0x1cd5('0x6e')];_0x3bc372[_0x1cd5('0xa1')]=_0x54c908[_0x1cd5('0x30')]['secure'];}if(_0x54c908[_0x1cd5('0x30')][_0x1cd5('0x6f')]){if(_0x54c908[_0x1cd5('0x30')]['modernAuthentication']){_0x3bc372['auth']={'type':_0x1cd5('0xae'),'user':_0x54c908['Smtp'][_0x1cd5('0x68')],'accessToken':_0x54c908['Smtp']['CloudProvider']['data5']};}else{_0x3bc372[_0x1cd5('0xa0')]={'user':_0x54c908[_0x1cd5('0x30')][_0x1cd5('0x68')],'pass':_0x54c908['Smtp'][_0x1cd5('0x6b')]};}}return respondWithRpcPromise(_0x1cd5('0xaf'),_0x1cd5('0xac'),{'account':_0x3bc372});})[_0x1cd5('0x15')](respondWithResult(_0x144299,null))[_0x1cd5('0x4f')](handleError(_0x144299,null));};exports[_0x1cd5('0x2b')]=function(_0x3adfe5,_0x25cf38){return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x3adfe5[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x25cf38,null))[_0x1cd5('0x15')](function(_0x226f11){if(_0x226f11&&_0x226f11['service']){throw new db['Sequelize'][(_0x1cd5('0xb0'))](_0x1cd5('0xb1'));}return _0x226f11;})[_0x1cd5('0x15')](removeEntity(_0x25cf38,null))[_0x1cd5('0x4f')](handleError(_0x25cf38,null));};exports[_0x1cd5('0xb2')]=function(_0x24d514,_0x530177){return db[_0x1cd5('0x46')]['find']({'where':{'id':_0x24d514[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x530177,null))[_0x1cd5('0x15')](function(_0xb4afc8){if(_0xb4afc8){return _0xb4afc8[_0x1cd5('0xb2')](_0x24d514[_0x1cd5('0x50')][_0x1cd5('0x62')],_[_0x1cd5('0x7e')](_0x24d514[_0x1cd5('0x50')],[_0x1cd5('0x62'),'id'])||{})['spread'](function(_0xc56faa){for(var _0x435696=0x0;_0x435696<_0x24d514[_0x1cd5('0x50')][_0x1cd5('0x62')][_0x1cd5('0x4c')];_0x435696+=0x1){socket[_0x1cd5('0xb3')](_0x1cd5('0xb4'),{'UserId':Number(_0x24d514[_0x1cd5('0x50')][_0x1cd5('0x62')][_0x435696]),'MailAccountId':Number(_0x24d514[_0x1cd5('0x54')]['id'])});}return _0xc56faa;});}})[_0x1cd5('0x15')](respondWithResult(_0x530177,null))['catch'](handleError(_0x530177,null));};exports[_0x1cd5('0xb5')]=function(_0x21091d,_0xdf2aa6){return db[_0x1cd5('0x46')][_0x1cd5('0x4e')]({'where':{'id':_0x21091d[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0xdf2aa6,null))['then'](function(_0x5e8f24){if(_0x5e8f24){return _0x5e8f24[_0x1cd5('0xb5')](_0x21091d['query']['ids'])['then'](function(){if(_[_0x1cd5('0xb6')](_0x21091d[_0x1cd5('0x36')][_0x1cd5('0x62')])){for(var _0x262987=0x0;_0x262987<_0x21091d[_0x1cd5('0x36')][_0x1cd5('0x62')][_0x1cd5('0x4c')];_0x262987+=0x1){socket[_0x1cd5('0xb3')](_0x1cd5('0xb7'),{'UserId':Number(_0x21091d[_0x1cd5('0x36')]['ids'][_0x262987]),'MailAccountId':Number(_0x21091d[_0x1cd5('0x54')]['id'])});}}else{socket['emit'](_0x1cd5('0xb7'),{'UserId':Number(_0x21091d[_0x1cd5('0x36')][_0x1cd5('0x62')]),'MailAccountId':Number(_0x21091d[_0x1cd5('0x54')]['id'])});}});}})[_0x1cd5('0x15')](respondWithStatusCode(_0xdf2aa6,null))[_0x1cd5('0x4f')](handleError(_0xdf2aa6,null));};exports[_0x1cd5('0xb8')]=function(_0x20beab,_0x394265){var _0xddfd61={};var _0xca14a4={};var _0x414263;var _0x412d4a;return db[_0x1cd5('0x46')][_0x1cd5('0x5c')]({'where':{'id':_0x20beab[_0x1cd5('0x54')]['id']}})[_0x1cd5('0x15')](handleEntityNotFound(_0x394265,null))[_0x1cd5('0x15')](function(_0x4b2604){if(_0x4b2604){_0x414263=_0x4b2604;_0xca14a4[_0x1cd5('0x35')]=_[_0x1cd5('0x37')](db[_0x1cd5('0x81')][_0x1cd5('0x33')]);_0xca14a4[_0x1cd5('0x36')]=_['keys'](_0x20beab[_0x1cd5('0x36')]);_0xca14a4[_0x1cd5('0x38')]=_[_0x1cd5('0x39')](_0xca14a4[_0x1cd5('0x35')],_0xca14a4[_0x1cd5('0x36')]);_0xddfd61[_0x1cd5('0x3a')]=_[_0x1cd5('0x39')](_0xca14a4[_0x1cd5('0x35')],qs[_0x1cd5('0x3b')](_0x20beab['query'][_0x1cd5('0x3b')]));_0xddfd61['attributes']=_0xddfd61[_0x1cd5('0x3a')][_0x1cd5('0x4c')]?_0xddfd61[_0x1cd5('0x3a')]:_0xca14a4[_0x1cd5('0x35')];_0xddfd61[_0x1cd5('0x5d')]=qs[_0x1cd5('0x3f')](_0x20beab['query']['sort']);_0xddfd61[_0x1cd5('0x42')]=qs['filters'](_[_0x1cd5('0x40')](_0x20beab[_0x1cd5('0x36')],_0xca14a4[_0x1cd5('0x38')]));if(_0x20beab[_0x1cd5('0x36')][_0x1cd5('0x41')]){_0xddfd61[_0x1cd5('0x42')]=_['merge'](_0xddfd61[_0x1cd5('0x42')],{'$or':_['map'](_0xddfd61[_0x1cd5('0x3a')],function(_0x22a2e0){var _0x44a989={};_0x44a989[_0x22a2e0]={'$like':'%'+_0x20beab[_0x1cd5('0x36')][_0x1cd5('0x41')]+'%'};return _0x44a989;})});}_0xddfd61=_[_0x1cd5('0x43')]({},_0xddfd61,_0x20beab[_0x1cd5('0x45')]);return _0x414263[_0x1cd5('0xb8')](_0xddfd61);}})[_0x1cd5('0x15')](function(_0x5d4e64){if(_0x5d4e64){_0x412d4a=_0x5d4e64['length'];if(!_0x20beab['query'][_0x1cd5('0x3c')](_0x1cd5('0x3d'))){_0xddfd61[_0x1cd5('0x3e')]=qs['limit'](_0x20beab[_0x1cd5('0x36')][_0x1cd5('0x3e')]);_0xddfd61[_0x1cd5('0x24')]=qs[_0x1cd5('0x24')](_0x20beab[_0x1cd5('0x36')][_0x1cd5('0x24')]);}return _0x414263['getAgents'](_0xddfd61);}})[_0x1cd5('0x15')](function(_0x4b058c){if(_0x4b058c){return _0x4b058c?{'count':_0x412d4a,'rows':_0x4b058c}:null;}})[_0x1cd5('0x15')](respondWithResult(_0x394265,null))['catch'](handleError(_0x394265,null));}; \ No newline at end of file +var _0xdae5=['removeAnswers','ids','provider','custom','ListId','isNil','active','description','user','password','service','host','port','authentication','username','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','MailApplication','bulkCreate','findAndCountAll','stack','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','data5','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','juice','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','show','params','include','find','body','CloudProviderId','modernAuthentication','describe','addDisposition','MailAccountId','Disposition','getDispositions','pick','findAll','addAnswer','create','getAnswers','findOne','length','nolimit','CannedAnswer'];(function(_0x1c0ab8,_0x42faca){var _0xe54576=function(_0x356eb1){while(--_0x356eb1){_0x1c0ab8['push'](_0x1c0ab8['shift']());}};_0xe54576(++_0x42faca);}(_0xdae5,0x1d1));var _0x5dae=function(_0x522ebe,_0x569b6b){_0x522ebe=_0x522ebe-0x0;var _0x1135b2=_0xdae5[_0x522ebe];return _0x1135b2;};'use strict';var moment=require(_0x5dae('0x0'));var BPromise=require(_0x5dae('0x1'));var util=require(_0x5dae('0x2'));var path=require('path');var _=require('lodash');var juice=require(_0x5dae('0x3'));var Redis=require(_0x5dae('0x4'));var qs=require(_0x5dae('0x5'));var logger=require('../../config/logger')(_0x5dae('0x6'));var config=require(_0x5dae('0x7'));var db=require(_0x5dae('0x8'))['db'];config[_0x5dae('0x9')]=_[_0x5dae('0xa')](config[_0x5dae('0x9')],{'host':_0x5dae('0xb'),'port':0x18eb});var socket=require(_0x5dae('0xc'))(new Redis(config[_0x5dae('0x9')]));require(_0x5dae('0xd'))[_0x5dae('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5dae('0xf')][_0x5dae('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x34ca6a,_0x5f4bb2,_0x4bc66d,_0x2b6a0c){return new BPromise(function(_0x56bda3,_0x1ad9df){var _0x30b8c2=_0x2b6a0c||client;return _0x30b8c2[_0x5dae('0x11')](_0x34ca6a,_0x4bc66d)[_0x5dae('0x12')](function(_0x1bc158){logger[_0x5dae('0x13')](_0x5dae('0x14'),_0x5f4bb2,_0x5dae('0x15'));logger[_0x5dae('0x16')](_0x5dae('0x17'),_0x5f4bb2,'request\x20sent',JSON[_0x5dae('0x18')](_0x1bc158));if(_0x1bc158[_0x5dae('0x19')]){if(_0x1bc158[_0x5dae('0x19')][_0x5dae('0x1a')]===0x1f4){logger[_0x5dae('0x19')](_0x5dae('0x14'),_0x5f4bb2,_0x1bc158[_0x5dae('0x19')][_0x5dae('0x1b')]);return _0x1ad9df(_0x1bc158[_0x5dae('0x19')][_0x5dae('0x1b')]);}logger[_0x5dae('0x19')]('MailAccount,\x20%s,\x20%s',_0x5f4bb2,_0x1bc158[_0x5dae('0x19')][_0x5dae('0x1b')]);return _0x56bda3(_0x1bc158[_0x5dae('0x19')][_0x5dae('0x1b')]);}else{logger[_0x5dae('0x13')]('MailAccount,\x20%s,\x20%s',_0x5f4bb2,'request\x20sent');_0x56bda3(_0x1bc158[_0x5dae('0x1c')]['message']);}})[_0x5dae('0x1d')](function(_0xd6393a){logger[_0x5dae('0x19')](_0x5dae('0x14'),_0x5f4bb2,_0xd6393a);_0x1ad9df(_0xd6393a);});});}function respondWithStatusCode(_0x219cc6,_0x563445){_0x563445=_0x563445||0xcc;return function(_0x14d555){if(_0x14d555){return _0x219cc6['sendStatus'](_0x563445);}return _0x219cc6[_0x5dae('0x1e')](_0x563445)[_0x5dae('0x1f')]();};}function respondWithResult(_0xcfb3a1,_0x2dacd0){_0x2dacd0=_0x2dacd0||0xc8;return function(_0x3befc5){if(_0x3befc5){return _0xcfb3a1['status'](_0x2dacd0)[_0x5dae('0x20')](_0x3befc5);}};}function respondWithFilteredResult(_0x46eb2e,_0x9b6ab7){return function(_0x2081eb){if(_0x2081eb){var _0x5147e0=typeof _0x9b6ab7[_0x5dae('0x21')]==='undefined'&&typeof _0x9b6ab7[_0x5dae('0x22')]===_0x5dae('0x23');var _0x2ab3a7=_0x2081eb[_0x5dae('0x24')];var _0x154482=_0x5147e0?0x0:_0x9b6ab7[_0x5dae('0x21')];var _0x4cce77=_0x5147e0?_0x2081eb[_0x5dae('0x24')]:_0x9b6ab7[_0x5dae('0x21')]+_0x9b6ab7[_0x5dae('0x22')];var _0x28f7be;if(_0x4cce77>=_0x2ab3a7){_0x4cce77=_0x2ab3a7;_0x28f7be=0xc8;}else{_0x28f7be=0xce;}_0x46eb2e[_0x5dae('0x1e')](_0x28f7be);return _0x46eb2e[_0x5dae('0x25')](_0x5dae('0x26'),_0x154482+'-'+_0x4cce77+'/'+_0x2ab3a7)[_0x5dae('0x20')](_0x2081eb);}return null;};}function saveUpdates(_0x9f88c4){return function(_0x149d95){if(_0x149d95){return _0x149d95[_0x5dae('0x27')](_0x9f88c4)[_0x5dae('0x12')](function(_0x5e2f33){return _0x5e2f33;});}return null;};}function removeEntity(_0x2e6041){return function(_0x14a174){if(_0x14a174){return _0x14a174[_0x5dae('0x28')]()['then'](function(){var _0x4d7e40=_0x14a174[_0x5dae('0x29')]({'plain':!![]});var _0x165cbe=_0x5dae('0x2a');return db[_0x5dae('0x2b')][_0x5dae('0x28')]({'where':{'type':_0x165cbe,'resourceId':_0x4d7e40['id']}})[_0x5dae('0x12')](function(){return _0x14a174;});})['then'](function(){_0x2e6041[_0x5dae('0x1e')](0xcc)[_0x5dae('0x1f')]();});}};}function handleEntityNotFound(_0x2ae21e){return function(_0x2739cf){if(!_0x2739cf){_0x2ae21e[_0x5dae('0x2c')](0x194);}return _0x2739cf;};}function handleError(_0x2d83d7,_0x347d98){_0x347d98=_0x347d98||0x1f4;return function(_0x3f6e9d){logger['error'](_0x3f6e9d['stack']);if(_0x3f6e9d[_0x5dae('0x2d')]){delete _0x3f6e9d[_0x5dae('0x2d')];}_0x2d83d7['status'](_0x347d98)['send'](_0x3f6e9d);};}exports[_0x5dae('0x2e')]=function(_0x33cb4a,_0xec6b28){var _0x1891b9={'include':[{'model':db[_0x5dae('0x2f')],'as':_0x5dae('0x30')},{'model':db[_0x5dae('0x31')],'as':_0x5dae('0x32')},{'model':db[_0x5dae('0x33')],'as':_0x5dae('0x34')}]},_0x16abb3={},_0x3d1c09={'count':0x0,'rows':[]};var _0x46483a=_[_0x5dae('0x35')](db[_0x5dae('0x36')][_0x5dae('0x37')],function(_0x1edec6){return{'name':_0x1edec6['fieldName'],'type':_0x1edec6[_0x5dae('0x38')][_0x5dae('0x39')]};});_0x16abb3[_0x5dae('0x3a')]=_['map'](_0x46483a,_0x5dae('0x2d'));_0x16abb3[_0x5dae('0x3b')]=_[_0x5dae('0x3c')](_0x33cb4a[_0x5dae('0x3b')]);_0x16abb3[_0x5dae('0x3d')]=_[_0x5dae('0x3e')](_0x16abb3['model'],_0x16abb3[_0x5dae('0x3b')]);_0x1891b9[_0x5dae('0x3f')]=_['intersection'](_0x16abb3[_0x5dae('0x3a')],qs[_0x5dae('0x40')](_0x33cb4a[_0x5dae('0x3b')][_0x5dae('0x40')]));_0x1891b9[_0x5dae('0x3f')]=_0x1891b9[_0x5dae('0x3f')]['length']?_0x1891b9[_0x5dae('0x3f')]:_0x16abb3[_0x5dae('0x3a')];if(!_0x33cb4a[_0x5dae('0x3b')][_0x5dae('0x41')]('nolimit')){_0x1891b9['limit']=qs[_0x5dae('0x22')](_0x33cb4a['query']['limit']);_0x1891b9['offset']=qs[_0x5dae('0x21')](_0x33cb4a[_0x5dae('0x3b')]['offset']);}_0x1891b9[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0x33cb4a[_0x5dae('0x3b')]['sort']);_0x1891b9[_0x5dae('0x44')]=qs[_0x5dae('0x3d')](_['pick'](_0x33cb4a[_0x5dae('0x3b')],_0x16abb3[_0x5dae('0x3d')]),_0x46483a);if(_0x33cb4a[_0x5dae('0x3b')]['filter']){_0x1891b9[_0x5dae('0x44')]=_[_0x5dae('0x45')](_0x1891b9[_0x5dae('0x44')],{'$or':_[_0x5dae('0x35')](_0x46483a,function(_0x1a0926){if(_0x1a0926[_0x5dae('0x38')]!==_0x5dae('0x46')){var _0x1da35f={};_0x1da35f[_0x1a0926['name']]={'$like':'%'+_0x33cb4a[_0x5dae('0x3b')][_0x5dae('0x47')]+'%'};return _0x1da35f;}})});}_0x1891b9=_['merge']({},_0x1891b9,_0x33cb4a[_0x5dae('0x48')]);var _0x34bb1c={'where':_0x1891b9[_0x5dae('0x44')]};return db[_0x5dae('0x36')]['count'](_0x34bb1c)['then'](function(_0x376e98){_0x3d1c09['count']=_0x376e98;if(_0x33cb4a['query'][_0x5dae('0x49')]){_0x1891b9['include']=[{'all':!![]}];}return db[_0x5dae('0x36')]['findAll'](_0x1891b9);})[_0x5dae('0x12')](function(_0x27a4ea){_0x3d1c09[_0x5dae('0x4a')]=_0x27a4ea;return _0x3d1c09;})['then'](respondWithFilteredResult(_0xec6b28,_0x1891b9))[_0x5dae('0x1d')](handleError(_0xec6b28,null));};exports[_0x5dae('0x4b')]=function(_0x1c245b,_0x3272bc){var _0x3107fa={'raw':![],'where':{'id':_0x1c245b[_0x5dae('0x4c')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x5dae('0x31')],'as':'Smtp'},{'model':db[_0x5dae('0x33')],'as':_0x5dae('0x34')}]},_0x4bb546={};_0x4bb546[_0x5dae('0x3a')]=_[_0x5dae('0x3c')](db[_0x5dae('0x36')][_0x5dae('0x37')]);_0x4bb546[_0x5dae('0x3b')]=_['keys'](_0x1c245b['query']);_0x4bb546[_0x5dae('0x3d')]=_['intersection'](_0x4bb546['model'],_0x4bb546[_0x5dae('0x3b')]);_0x3107fa[_0x5dae('0x3f')]=_[_0x5dae('0x3e')](_0x4bb546[_0x5dae('0x3a')],qs[_0x5dae('0x40')](_0x1c245b[_0x5dae('0x3b')][_0x5dae('0x40')]));_0x3107fa['attributes']=_0x3107fa[_0x5dae('0x3f')]['length']?_0x3107fa[_0x5dae('0x3f')]:_0x4bb546['model'];if(_0x1c245b['query']['includeAll']){_0x3107fa[_0x5dae('0x4d')]=[{'all':!![]}];}_0x3107fa=_['merge']({},_0x3107fa,_0x1c245b[_0x5dae('0x48')]);return db[_0x5dae('0x36')][_0x5dae('0x4e')](_0x3107fa)[_0x5dae('0x12')](handleEntityNotFound(_0x3272bc,null))[_0x5dae('0x12')](respondWithResult(_0x3272bc,null))[_0x5dae('0x1d')](handleError(_0x3272bc,null));};exports[_0x5dae('0x27')]=function(_0x5491cd,_0x5494ea){if(_0x5491cd[_0x5dae('0x4f')]['id']){delete _0x5491cd[_0x5dae('0x4f')]['id'];}if(_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x30')]){if(!_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x30')]['modernAuthentication']){_0x5491cd[_0x5dae('0x4f')]['Imap'][_0x5dae('0x50')]=null;}}if(_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x32')]){if(!_0x5491cd['body'][_0x5dae('0x32')][_0x5dae('0x51')]){_0x5491cd[_0x5dae('0x4f')]['Smtp']['CloudProviderId']=null;}}return db[_0x5dae('0x36')]['find']({'where':{'id':_0x5491cd[_0x5dae('0x4c')]['id']},'include':[{'model':db[_0x5dae('0x2f')],'as':_0x5dae('0x30')},{'model':db[_0x5dae('0x31')],'as':'Smtp'},{'model':db[_0x5dae('0x33')],'as':_0x5dae('0x34')}]})[_0x5dae('0x12')](handleEntityNotFound(_0x5494ea,null))[_0x5dae('0x12')](saveUpdates(_0x5491cd[_0x5dae('0x4f')],null))[_0x5dae('0x12')](function(_0x3fb902){if(_0x3fb902&&_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x30')]){return db['MailServerIn'][_0x5dae('0x27')](_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x30')],{'where':{'MailAccountId':_0x3fb902['id']}})[_0x5dae('0x12')](function(){return _0x3fb902;});}return _0x3fb902;})['then'](function(_0x5b6df0){if(_0x5b6df0&&_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x32')]){return db[_0x5dae('0x31')][_0x5dae('0x27')](_0x5491cd[_0x5dae('0x4f')][_0x5dae('0x32')],{'where':{'MailAccountId':_0x5b6df0['id']}})[_0x5dae('0x12')](function(){return _0x5b6df0;});}return _0x5b6df0;})[_0x5dae('0x12')](respondWithResult(_0x5494ea,null))[_0x5dae('0x1d')](handleError(_0x5494ea,null));};exports['describe']=function(_0x471054,_0x3bc90d){return db[_0x5dae('0x36')][_0x5dae('0x52')]()[_0x5dae('0x12')](respondWithResult(_0x3bc90d,null))[_0x5dae('0x1d')](handleError(_0x3bc90d,null));};exports[_0x5dae('0x53')]=function(_0x1b4fab,_0x36fae2){if(_0x1b4fab[_0x5dae('0x4f')]['id']){delete _0x1b4fab[_0x5dae('0x4f')]['id'];}return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x1b4fab[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x36fae2,null))[_0x5dae('0x12')](function(_0x410630){if(_0x410630){_0x1b4fab['body'][_0x5dae('0x54')]=_0x410630['id'];return db[_0x5dae('0x55')]['create'](_0x1b4fab[_0x5dae('0x4f')]);}})[_0x5dae('0x12')](respondWithResult(_0x36fae2,null))[_0x5dae('0x1d')](handleError(_0x36fae2,null));};exports[_0x5dae('0x56')]=function(_0x2588aa,_0x527ac7){var _0x500876={'raw':![],'where':{}};var _0x158f6d={};var _0x423456={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2588aa[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x527ac7,null))[_0x5dae('0x12')](function(_0x33f017){if(_0x33f017){_0x158f6d[_0x5dae('0x3a')]=_[_0x5dae('0x3c')](db['Disposition'][_0x5dae('0x37')]);_0x158f6d[_0x5dae('0x3b')]=_[_0x5dae('0x3c')](_0x2588aa['query']);_0x158f6d[_0x5dae('0x3d')]=_['intersection'](_0x158f6d[_0x5dae('0x3a')],_0x158f6d[_0x5dae('0x3b')]);_0x500876[_0x5dae('0x3f')]=_[_0x5dae('0x3e')](_0x158f6d['model'],qs[_0x5dae('0x40')](_0x2588aa['query'][_0x5dae('0x40')]));_0x500876[_0x5dae('0x3f')]=_0x500876[_0x5dae('0x3f')]['length']?_0x500876[_0x5dae('0x3f')]:_0x158f6d[_0x5dae('0x3a')];if(!_0x2588aa[_0x5dae('0x3b')]['hasOwnProperty']('nolimit')){_0x500876['limit']=qs['limit'](_0x2588aa[_0x5dae('0x3b')][_0x5dae('0x22')]);_0x500876[_0x5dae('0x21')]=qs[_0x5dae('0x21')](_0x2588aa[_0x5dae('0x3b')]['offset']);}_0x500876[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0x2588aa[_0x5dae('0x3b')][_0x5dae('0x43')]);_0x500876['where']=qs[_0x5dae('0x3d')](_[_0x5dae('0x57')](_0x2588aa[_0x5dae('0x3b')],_0x158f6d[_0x5dae('0x3d')]));_0x500876[_0x5dae('0x44')][_0x5dae('0x54')]=_0x33f017['id'];if(_0x2588aa[_0x5dae('0x3b')][_0x5dae('0x47')]){_0x500876['where']=_[_0x5dae('0x45')](_0x500876[_0x5dae('0x44')],{'$or':_['map'](_0x500876[_0x5dae('0x3f')],function(_0x529f31){var _0x2b6c7b={};_0x2b6c7b[_0x529f31]={'$like':'%'+_0x2588aa[_0x5dae('0x3b')][_0x5dae('0x47')]+'%'};return _0x2b6c7b;})});}_0x500876=_[_0x5dae('0x45')]({},_0x500876,_0x2588aa[_0x5dae('0x48')]);return db[_0x5dae('0x55')][_0x5dae('0x24')]({'where':_0x500876[_0x5dae('0x44')]})[_0x5dae('0x12')](function(_0x507aba){_0x423456['count']=_0x507aba;if(_0x2588aa['query']['includeAll']){_0x500876['include']=[{'all':!![]}];}return db['Disposition'][_0x5dae('0x58')](_0x500876);})[_0x5dae('0x12')](function(_0x1d09d7){_0x423456[_0x5dae('0x4a')]=_0x1d09d7;return _0x423456;});}})[_0x5dae('0x12')](respondWithFilteredResult(_0x527ac7,_0x500876))[_0x5dae('0x1d')](handleError(_0x527ac7,null));};exports['removeDispositions']=function(_0x5ee7c,_0x123ae3){return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x5ee7c[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x123ae3,null))[_0x5dae('0x12')](function(_0x57cde8){if(_0x57cde8){return _0x57cde8['removeDispositions'](_0x5ee7c[_0x5dae('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x123ae3,null))[_0x5dae('0x1d')](handleError(_0x123ae3,null));};exports[_0x5dae('0x59')]=function(_0x5e210a,_0x5e501e){if(_0x5e210a[_0x5dae('0x4f')]['id']){delete _0x5e210a['body']['id'];}return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x5e210a['params']['id']}})['then'](handleEntityNotFound(_0x5e501e,null))[_0x5dae('0x12')](function(_0x3733c9){if(_0x3733c9){_0x5e210a['body'][_0x5dae('0x54')]=_0x3733c9['id'];return db['CannedAnswer'][_0x5dae('0x5a')](_0x5e210a[_0x5dae('0x4f')]);}})[_0x5dae('0x12')](respondWithResult(_0x5e501e,null))[_0x5dae('0x1d')](handleError(_0x5e501e,null));};exports[_0x5dae('0x5b')]=function(_0x39ef39,_0x74362e){var _0x301ca6={'raw':![],'where':{}};var _0x22b1f9={};var _0x179e86={'count':0x0,'rows':[]};return db['MailAccount'][_0x5dae('0x5c')]({'where':{'id':_0x39ef39[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x74362e,null))['then'](function(_0x14d030){if(_0x14d030){_0x22b1f9['model']=_[_0x5dae('0x3c')](db['CannedAnswer']['rawAttributes']);_0x22b1f9['query']=_[_0x5dae('0x3c')](_0x39ef39[_0x5dae('0x3b')]);_0x22b1f9[_0x5dae('0x3d')]=_[_0x5dae('0x3e')](_0x22b1f9['model'],_0x22b1f9[_0x5dae('0x3b')]);_0x301ca6['attributes']=_[_0x5dae('0x3e')](_0x22b1f9[_0x5dae('0x3a')],qs[_0x5dae('0x40')](_0x39ef39[_0x5dae('0x3b')][_0x5dae('0x40')]));_0x301ca6['attributes']=_0x301ca6[_0x5dae('0x3f')][_0x5dae('0x5d')]?_0x301ca6[_0x5dae('0x3f')]:_0x22b1f9[_0x5dae('0x3a')];if(!_0x39ef39[_0x5dae('0x3b')][_0x5dae('0x41')](_0x5dae('0x5e'))){_0x301ca6[_0x5dae('0x22')]=qs[_0x5dae('0x22')](_0x39ef39['query'][_0x5dae('0x22')]);_0x301ca6['offset']=qs['offset'](_0x39ef39[_0x5dae('0x3b')][_0x5dae('0x21')]);}_0x301ca6[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0x39ef39[_0x5dae('0x3b')][_0x5dae('0x43')]);_0x301ca6[_0x5dae('0x44')]=qs[_0x5dae('0x3d')](_[_0x5dae('0x57')](_0x39ef39[_0x5dae('0x3b')],_0x22b1f9[_0x5dae('0x3d')]));_0x301ca6[_0x5dae('0x44')][_0x5dae('0x54')]=_0x14d030['id'];if(_0x39ef39[_0x5dae('0x3b')][_0x5dae('0x47')]){_0x301ca6[_0x5dae('0x44')]=_[_0x5dae('0x45')](_0x301ca6['where'],{'$or':_[_0x5dae('0x35')](_0x301ca6[_0x5dae('0x3f')],function(_0x2ab7af){var _0x39437a={};_0x39437a[_0x2ab7af]={'$like':'%'+_0x39ef39[_0x5dae('0x3b')][_0x5dae('0x47')]+'%'};return _0x39437a;})});}_0x301ca6=_['merge']({},_0x301ca6,_0x39ef39[_0x5dae('0x48')]);return db[_0x5dae('0x5f')][_0x5dae('0x24')]({'where':_0x301ca6['where']})[_0x5dae('0x12')](function(_0x5a49ee){_0x179e86[_0x5dae('0x24')]=_0x5a49ee;if(_0x39ef39['query'][_0x5dae('0x49')]){_0x301ca6[_0x5dae('0x4d')]=[{'all':!![]}];}return db[_0x5dae('0x5f')]['findAll'](_0x301ca6);})[_0x5dae('0x12')](function(_0x16bcce){_0x179e86[_0x5dae('0x4a')]=_0x16bcce;return _0x179e86;});}})[_0x5dae('0x12')](respondWithFilteredResult(_0x74362e,_0x301ca6))[_0x5dae('0x1d')](handleError(_0x74362e,null));};exports[_0x5dae('0x60')]=function(_0x70184a,_0x6faab9){return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x70184a['params']['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x6faab9,null))[_0x5dae('0x12')](function(_0x1fc891){if(_0x1fc891){return _0x1fc891[_0x5dae('0x60')](_0x70184a[_0x5dae('0x3b')][_0x5dae('0x61')]);}})[_0x5dae('0x12')](respondWithStatusCode(_0x6faab9,null))[_0x5dae('0x1d')](handleError(_0x6faab9,null));};exports[_0x5dae('0x5a')]=function(_0x313dd6,_0x4ea879){var _0x219774={'name':_0x313dd6['body'][_0x5dae('0x2d')],'key':_0x313dd6[_0x5dae('0x4f')]['key'],'provider':_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x62')]===_0x5dae('0x63')?null:_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x62')],'email':_0x313dd6['body']['email'],'ListId':_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x64')],'active':!_[_0x5dae('0x65')](_0x313dd6['body'][_0x5dae('0x66')])?_0x313dd6['body'][_0x5dae('0x66')]:!![],'description':_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x67')]||null,'Imap':{},'Smtp':{}};if(_0x219774[_0x5dae('0x62')]){_0x219774['Imap'][_0x5dae('0x68')]=_0x219774['Smtp']['user']=_0x313dd6['body']['username'];_0x219774[_0x5dae('0x30')][_0x5dae('0x69')]=_0x219774[_0x5dae('0x32')]['pass']=_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x69')];if(_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x51')]){_0x219774[_0x5dae('0x30')][_0x5dae('0x51')]=_0x219774[_0x5dae('0x32')][_0x5dae('0x51')]=!![];_0x219774[_0x5dae('0x30')]['CloudProviderId']=_0x219774[_0x5dae('0x32')][_0x5dae('0x50')]=_0x313dd6[_0x5dae('0x4f')]['CloudProviderId'];_0x219774[_0x5dae('0x30')][_0x5dae('0x69')]=_0x219774[_0x5dae('0x32')]['pass']=null;}else{_0x219774[_0x5dae('0x30')][_0x5dae('0x50')]=_0x219774[_0x5dae('0x32')][_0x5dae('0x50')]=null;}_0x219774[_0x5dae('0x30')][_0x5dae('0x6a')]=_0x219774['Smtp']['service']=null;_0x219774[_0x5dae('0x30')][_0x5dae('0x6b')]=_0x219774[_0x5dae('0x32')][_0x5dae('0x6b')]=null;_0x219774[_0x5dae('0x30')][_0x5dae('0x6c')]=_0x219774[_0x5dae('0x32')][_0x5dae('0x6c')]=null;}else{if(_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x6d')]){_0x219774[_0x5dae('0x30')][_0x5dae('0x68')]=_0x219774['Smtp'][_0x5dae('0x68')]=_0x313dd6['body'][_0x5dae('0x6e')];_0x219774[_0x5dae('0x30')][_0x5dae('0x69')]=_0x219774['Smtp'][_0x5dae('0x6f')]=_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x69')];}else{_0x219774[_0x5dae('0x30')][_0x5dae('0x6d')]=_0x219774[_0x5dae('0x32')][_0x5dae('0x6d')]=![];_0x219774['Imap'][_0x5dae('0x68')]=_0x219774[_0x5dae('0x32')][_0x5dae('0x68')]=null;_0x219774[_0x5dae('0x30')][_0x5dae('0x69')]=_0x219774[_0x5dae('0x32')]['pass']=null;}_0x219774[_0x5dae('0x30')][_0x5dae('0x6b')]=_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x30')][_0x5dae('0x6b')];_0x219774[_0x5dae('0x30')][_0x5dae('0x6c')]=_0x313dd6['body'][_0x5dae('0x30')][_0x5dae('0x6c')];_0x219774['Smtp'][_0x5dae('0x6b')]=_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x32')]['host'];_0x219774['Smtp'][_0x5dae('0x6c')]=_0x313dd6[_0x5dae('0x4f')][_0x5dae('0x32')][_0x5dae('0x6c')];}return db['MailAccount'][_0x5dae('0x5a')](_0x219774,{'include':[{'model':db[_0x5dae('0x31')],'as':_0x5dae('0x32')},{'model':db[_0x5dae('0x2f')],'as':_0x5dae('0x30')}]})['then'](function(_0x2cba36){var _0x577dbd=_0x313dd6['user'][_0x5dae('0x29')]({'plain':!![]});if(!_0x577dbd)throw new Error(_0x5dae('0x70'));if(_0x577dbd[_0x5dae('0x71')]===_0x5dae('0x68')){var _0x1949e5=_0x2cba36[_0x5dae('0x29')]({'plain':!![]});return db[_0x5dae('0x72')][_0x5dae('0x4e')]({'where':{'name':_0x5dae('0x2a'),'userProfileId':_0x577dbd['userProfileId']},'raw':!![]})[_0x5dae('0x12')](function(_0x519083){if(_0x519083&&_0x519083['autoAssociation']===0x0){return db[_0x5dae('0x2b')]['create']({'name':_0x1949e5['name'],'resourceId':_0x1949e5['id'],'type':_0x519083[_0x5dae('0x2d')],'sectionId':_0x519083['id']},{})['then'](function(){return _0x2cba36;});}else{return _0x2cba36;}})[_0x5dae('0x1d')](function(_0x110042){logger[_0x5dae('0x19')](_0x5dae('0x73'),_0x110042);throw _0x110042;});}return _0x2cba36;})[_0x5dae('0x12')](respondWithResult(_0x4ea879,0xc9))['catch'](handleError(_0x4ea879,null));};exports['getImap']=function(_0x219c24,_0x56275f){return db['MailAccount']['findOne']({'where':{'id':_0x219c24[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x56275f,null))[_0x5dae('0x12')](function(_0x6d616d){if(_0x6d616d){return _0x6d616d[_0x5dae('0x74')]();}return null;})[_0x5dae('0x12')](respondWithResult(_0x56275f,null))['catch'](handleError(_0x56275f,null));};exports[_0x5dae('0x75')]=function(_0x4b545d,_0x483c7f){if(_0x4b545d[_0x5dae('0x4f')]['id']){delete _0x4b545d[_0x5dae('0x4f')]['id'];}return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x4b545d['params']['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x483c7f,null))[_0x5dae('0x12')](function(_0x4d299c){if(_0x4d299c){_0x4b545d['body'][_0x5dae('0x54')]=_0x4d299c['id'];return db[_0x5dae('0x2f')][_0x5dae('0x5a')](_0x4b545d[_0x5dae('0x4f')]);}})[_0x5dae('0x12')](respondWithResult(_0x483c7f,null))[_0x5dae('0x1d')](handleError(_0x483c7f,null));};exports['removeImap']=function(_0x2e8393,_0x44b86e){return db['MailAccount'][_0x5dae('0x5c')]({'where':{'id':_0x2e8393[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x44b86e,null))[_0x5dae('0x12')](function(_0x150f99){if(_0x150f99){return _0x150f99[_0x5dae('0x76')](null);}return null;})['then'](respondWithStatusCode(_0x44b86e,null))[_0x5dae('0x1d')](handleError(_0x44b86e,null));};exports[_0x5dae('0x77')]=function(_0x1e37c3,_0x284a31){return db[_0x5dae('0x36')][_0x5dae('0x5c')]({'where':{'id':_0x1e37c3[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x284a31,null))[_0x5dae('0x12')](function(_0x2fe164){if(_0x2fe164){return _0x2fe164[_0x5dae('0x77')]();}return null;})[_0x5dae('0x12')](respondWithResult(_0x284a31,null))[_0x5dae('0x1d')](handleError(_0x284a31,null));};exports[_0x5dae('0x78')]=function(_0x178b87,_0x5ad738){if(_0x178b87['body']['id']){delete _0x178b87[_0x5dae('0x4f')]['id'];}return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x178b87['params']['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x5ad738,null))[_0x5dae('0x12')](function(_0x7f8dd6){if(_0x7f8dd6){_0x178b87[_0x5dae('0x4f')][_0x5dae('0x54')]=_0x7f8dd6['id'];return db[_0x5dae('0x31')][_0x5dae('0x5a')](_0x178b87[_0x5dae('0x4f')]);}})['then'](respondWithResult(_0x5ad738,null))[_0x5dae('0x1d')](handleError(_0x5ad738,null));};exports[_0x5dae('0x79')]=function(_0x50f6c6,_0x2c362d){return db[_0x5dae('0x36')][_0x5dae('0x5c')]({'where':{'id':_0x50f6c6[_0x5dae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c362d,null))[_0x5dae('0x12')](function(_0x32831b){if(_0x32831b){return _0x32831b['setSmtp'](null);}return null;})[_0x5dae('0x12')](respondWithStatusCode(_0x2c362d,null))[_0x5dae('0x1d')](handleError(_0x2c362d,null));};exports['addInteraction']=function(_0x47f575,_0x3ddf13){return db[_0x5dae('0x7a')]['find']({'where':{'id':_0x47f575[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x3ddf13,null))['then'](function(_0x416b7b){if(_0x416b7b){return _0x416b7b[_0x5dae('0x7b')](_0x47f575[_0x5dae('0x4f')][_0x5dae('0x61')],_[_0x5dae('0x7c')](_0x47f575[_0x5dae('0x4f')],[_0x5dae('0x61'),'id'])||{});}})[_0x5dae('0x12')](respondWithResult(_0x3ddf13,null))['catch'](handleError(_0x3ddf13,null));};exports[_0x5dae('0x7d')]=function(_0xb71c4d,_0x3036a9){var _0x363ebb={'raw':![],'where':{}};var _0x68807d={};var _0x4440d3={'count':0x0,'rows':[]};return db[_0x5dae('0x36')][_0x5dae('0x5c')]({'where':{'id':_0xb71c4d[_0x5dae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3036a9,null))[_0x5dae('0x12')](function(_0x4ddf92){if(_0x4ddf92){_0x68807d[_0x5dae('0x3a')]=_['keys'](db['MailInteraction'][_0x5dae('0x37')]);_0x68807d[_0x5dae('0x3b')]=_[_0x5dae('0x3c')](_0xb71c4d[_0x5dae('0x3b')]);_0x68807d[_0x5dae('0x3d')]=_[_0x5dae('0x3e')](_0x68807d[_0x5dae('0x3a')],_0x68807d[_0x5dae('0x3b')]);_0x363ebb['attributes']=_['intersection'](_0x68807d[_0x5dae('0x3a')],qs[_0x5dae('0x40')](_0xb71c4d[_0x5dae('0x3b')]['fields']));_0x363ebb[_0x5dae('0x3f')]=_0x363ebb[_0x5dae('0x3f')][_0x5dae('0x5d')]?_0x363ebb[_0x5dae('0x3f')]:_0x68807d[_0x5dae('0x3a')];if(!_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x41')]('nolimit')){_0x363ebb[_0x5dae('0x22')]=qs[_0x5dae('0x22')](_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x22')]);_0x363ebb[_0x5dae('0x21')]=qs[_0x5dae('0x21')](_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x21')]);}_0x363ebb[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x43')]);_0x363ebb[_0x5dae('0x44')]=qs[_0x5dae('0x3d')](_['pick'](_0xb71c4d[_0x5dae('0x3b')],_0x68807d['filters']));_0x363ebb['where'][_0x5dae('0x54')]=_0x4ddf92['id'];if(_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x47')]){_0x363ebb[_0x5dae('0x44')]=_['merge'](_0x363ebb[_0x5dae('0x44')],{'$or':_[_0x5dae('0x35')](_0x363ebb[_0x5dae('0x3f')],function(_0x5adda1){var _0x574953={};_0x574953[_0x5adda1]={'$like':'%'+_0xb71c4d['query'][_0x5dae('0x47')]+'%'};return _0x574953;})});}_0x363ebb=_[_0x5dae('0x45')]({},_0x363ebb,_0xb71c4d[_0x5dae('0x48')]);return db[_0x5dae('0x7a')]['count']({'where':_0x363ebb[_0x5dae('0x44')]})[_0x5dae('0x12')](function(_0x3988d9){_0x4440d3[_0x5dae('0x24')]=_0x3988d9;if(_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x49')]){_0x363ebb[_0x5dae('0x4d')]=[{'model':db[_0x5dae('0x7e')],'as':_0x5dae('0x7f'),'required':![]},{'model':db[_0x5dae('0x80')],'as':_0x5dae('0x81'),'attributes':[_0x5dae('0x2d'),_0x5dae('0x82'),'internal'],'required':![]},{'model':db[_0x5dae('0x83')],'as':_0x5dae('0x84'),'attributes':['id','name',_0x5dae('0x85')],'where':_0xb71c4d[_0x5dae('0x3b')]['tag']?{'id':_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x86')]}:undefined,'required':_0xb71c4d[_0x5dae('0x3b')][_0x5dae('0x86')]?!![]:![]}];}return db[_0x5dae('0x7a')][_0x5dae('0x58')](_0x363ebb);})[_0x5dae('0x12')](function(_0x5317b9){_0x4440d3['rows']=_0x5317b9;return _0x4440d3;});}})[_0x5dae('0x12')](respondWithFilteredResult(_0x3036a9,_0x363ebb))['catch'](handleError(_0x3036a9,null));};exports[_0x5dae('0x87')]=function addApplications(_0x2fb2c0,_0x1796fc){var _0x16f981=_0x2fb2c0[_0x5dae('0x4c')]['id'];var _0x139e99=_0x2fb2c0['body'];var _0x44d527=0xc8;var _0x2655c8=null;return db[_0x5dae('0x88')][_0x5dae('0x89')]({'isolationLevel':db[_0x5dae('0x88')][_0x5dae('0x8a')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x201c94){return db[_0x5dae('0x36')]['findOne']({'where':{'id':_0x16f981},'transaction':_0x201c94})[_0x5dae('0x12')](function(_0x2fb952){if(_0x2fb952){return db[_0x5dae('0x8b')][_0x5dae('0x28')]({'where':{'MailAccountId':_0x16f981},'transaction':_0x201c94})['then'](function(){var _0x5f4299=_[_0x5dae('0x35')](_0x139e99,function(_0x3aa8d7){_0x3aa8d7[_0x5dae('0x54')]=_0x16f981;return _0x3aa8d7;});return db[_0x5dae('0x8b')][_0x5dae('0x8c')](_0x5f4299,{'transaction':_0x201c94});});}else{_0x44d527=0x194;_0x2655c8=[];}});})[_0x5dae('0x12')](function(){if(_0x44d527!==0x194){return db[_0x5dae('0x8b')][_0x5dae('0x8d')]({'where':{'MailAccountId':_0x16f981},'order':'priority'})['then'](function(_0x310f20){_0x2655c8=_0x310f20;});}})[_0x5dae('0x1d')](function(_0x4263f2){_0x44d527=0x1f4;logger[_0x5dae('0x19')](_0x4263f2[_0x5dae('0x8e')]);if(_0x4263f2['name']){delete _0x4263f2['name'];}_0x2655c8=_0x4263f2;})['finally'](function(){if(_0x2655c8===null){_0x1796fc[_0x5dae('0x2c')](_0x44d527);}else{if(_0x44d527===0x1f4){_0x1796fc[_0x5dae('0x1e')](_0x44d527)['send'](_0x2655c8);}else{_0x1796fc['status'](_0x44d527)[_0x5dae('0x20')](_0x2655c8);}}});};exports[_0x5dae('0x8f')]=function(_0x3547ce,_0x3dd683){var _0x5f05af={};var _0x5ca7fa={};var _0x3dab1b;var _0xfa16af;return db[_0x5dae('0x36')][_0x5dae('0x5c')]({'where':{'id':_0x3547ce[_0x5dae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3dd683,null))[_0x5dae('0x12')](function(_0x5cfd67){if(_0x5cfd67){_0x3dab1b=_0x5cfd67;_0x5ca7fa[_0x5dae('0x3a')]=_['keys'](db['MailApplication'][_0x5dae('0x37')]);_0x5ca7fa['query']=_[_0x5dae('0x3c')](_0x3547ce[_0x5dae('0x3b')]);_0x5ca7fa[_0x5dae('0x3d')]=_[_0x5dae('0x3e')](_0x5ca7fa[_0x5dae('0x3a')],_0x5ca7fa[_0x5dae('0x3b')]);_0x5f05af[_0x5dae('0x3f')]=_[_0x5dae('0x3e')](_0x5ca7fa[_0x5dae('0x3a')],qs[_0x5dae('0x40')](_0x3547ce['query'][_0x5dae('0x40')]));_0x5f05af['attributes']=_0x5f05af['attributes'][_0x5dae('0x5d')]?_0x5f05af[_0x5dae('0x3f')]:_0x5ca7fa['model'];_0x5f05af[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0x3547ce[_0x5dae('0x3b')][_0x5dae('0x43')]);_0x5f05af['where']=qs[_0x5dae('0x3d')](_[_0x5dae('0x57')](_0x3547ce[_0x5dae('0x3b')],_0x5ca7fa[_0x5dae('0x3d')]));if(_0x3547ce[_0x5dae('0x3b')][_0x5dae('0x47')]){_0x5f05af[_0x5dae('0x44')]=_[_0x5dae('0x45')](_0x5f05af[_0x5dae('0x44')],{'$or':_[_0x5dae('0x35')](_0x5f05af['attributes'],function(_0x56fbc6){var _0x1b6f1f={};_0x1b6f1f[_0x56fbc6]={'$like':'%'+_0x3547ce['query'][_0x5dae('0x47')]+'%'};return _0x1b6f1f;})});}_0x5f05af=_[_0x5dae('0x45')]({},_0x5f05af,_0x3547ce[_0x5dae('0x48')]);return _0x3dab1b['getApplications'](_0x5f05af);}})['then'](function(_0x4e7000){if(_0x4e7000){_0xfa16af=_0x4e7000[_0x5dae('0x5d')];if(!_0x3547ce[_0x5dae('0x3b')][_0x5dae('0x41')]('nolimit')){_0x5f05af[_0x5dae('0x22')]=qs[_0x5dae('0x22')](_0x3547ce['query']['limit']);_0x5f05af[_0x5dae('0x21')]=qs[_0x5dae('0x21')](_0x3547ce[_0x5dae('0x3b')][_0x5dae('0x21')]);}return _0x3dab1b[_0x5dae('0x8f')](_0x5f05af);}})['then'](function(_0x28bc8f){if(_0x28bc8f){return _0x28bc8f?{'count':_0xfa16af,'rows':_0x28bc8f}:null;}})[_0x5dae('0x12')](respondWithResult(_0x3dd683,null))[_0x5dae('0x1d')](handleError(_0x3dd683,null));};exports[_0x5dae('0x90')]=function(_0xab95e5,_0x5be0aa){var _0x204fa6={'raw':!![],'where':{}};var _0x19b413={};var _0x39a6d6={'count':0x0,'rows':[]};return db[_0x5dae('0x36')][_0x5dae('0x5c')]({'where':{'id':_0xab95e5[_0x5dae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5be0aa,null))['then'](function(_0x4bcaaa){if(_0x4bcaaa){_0x19b413['model']=_['keys'](db[_0x5dae('0x91')][_0x5dae('0x37')]);_0x19b413[_0x5dae('0x3b')]=_[_0x5dae('0x3c')](_0xab95e5['query']);_0x19b413[_0x5dae('0x3d')]=_['intersection'](_0x19b413[_0x5dae('0x3a')],_0x19b413['query']);_0x204fa6[_0x5dae('0x3f')]=_[_0x5dae('0x3e')](_0x19b413['model'],qs['fields'](_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x40')]));_0x204fa6[_0x5dae('0x3f')]=_0x204fa6[_0x5dae('0x3f')][_0x5dae('0x5d')]?_0x204fa6[_0x5dae('0x3f')]:_0x19b413[_0x5dae('0x3a')];if(!_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x41')](_0x5dae('0x5e'))){_0x204fa6[_0x5dae('0x22')]=qs[_0x5dae('0x22')](_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x22')]);_0x204fa6[_0x5dae('0x21')]=qs[_0x5dae('0x21')](_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x21')]);}_0x204fa6[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x43')]);_0x204fa6[_0x5dae('0x44')]=qs[_0x5dae('0x3d')](_[_0x5dae('0x57')](_0xab95e5['query'],_0x19b413['filters']));_0x204fa6[_0x5dae('0x44')][_0x5dae('0x54')]=_0x4bcaaa['id'];if(_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x47')]){_0x204fa6[_0x5dae('0x44')]=_[_0x5dae('0x45')](_0x204fa6[_0x5dae('0x44')],{'$or':_[_0x5dae('0x35')](_0x204fa6[_0x5dae('0x3f')],function(_0x322689){var _0x4fbfb8={};_0x4fbfb8[_0x322689]={'$like':'%'+_0xab95e5['query'][_0x5dae('0x47')]+'%'};return _0x4fbfb8;})});}if(_0xab95e5['query'][_0x5dae('0x92')]){var _0x308391=_0xab95e5[_0x5dae('0x3b')]['$gte'][_0x5dae('0x93')](',');var _0x3972ad={};_0x3972ad[_0x308391[0x0]]={'$gte':moment(_0x308391[0x1])[_0x5dae('0x94')](_0x5dae('0x95'))};_0x204fa6['where']=_[_0x5dae('0x45')](_0x204fa6[_0x5dae('0x44')],_0x3972ad);}_0x204fa6=_[_0x5dae('0x45')]({},_0x204fa6,_0xab95e5[_0x5dae('0x48')]);return db['MailMessage']['count']({'where':_0x204fa6[_0x5dae('0x44')]})[_0x5dae('0x12')](function(_0xeb3e11){_0x39a6d6[_0x5dae('0x24')]=_0xeb3e11;if(_0xab95e5[_0x5dae('0x3b')]['includeAll']){_0x204fa6[_0x5dae('0x4d')]=[{'all':!![]}];}return db[_0x5dae('0x91')][_0x5dae('0x58')](_0x204fa6);})['then'](function(_0x570861){if(_0xab95e5[_0x5dae('0x3b')][_0x5dae('0x96')]===_0x5dae('0x97')){for(var _0x590585=0x0;_0x590585<_0x570861[_0x5dae('0x5d')];_0x590585++){_0x570861[_0x590585][_0x5dae('0x4f')]=juice(_0x570861[_0x590585]['body']);}}_0x39a6d6[_0x5dae('0x4a')]=_0x570861;return _0x39a6d6;});}})[_0x5dae('0x12')](respondWithFilteredResult(_0x5be0aa,_0x204fa6))['catch'](handleError(_0x5be0aa,null));};exports['send']=function(_0x37b31d,_0x4ee8df){var _0x419364,_0x387a45={},_0x4d3489;if(_0x37b31d[_0x5dae('0x4f')]['to']){_0x4d3489=_0x37b31d[_0x5dae('0x4f')]['to']['split'](',')[0x0];}return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x37b31d[_0x5dae('0x4c')]['id']},'include':[{'model':db[_0x5dae('0x98')],'as':_0x5dae('0x99'),'include':[{'model':db[_0x5dae('0x7e')],'as':_0x5dae('0x9a'),'where':{'email':_0x4d3489},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5dae('0x31')],'as':_0x5dae('0x32'),'raw':!![]}]})[_0x5dae('0x12')](handleEntityNotFound(_0x4ee8df,null))['then'](function(_0x46f5b1){if(_0x46f5b1){_0x419364=_0x46f5b1;if(_0x46f5b1[_0x5dae('0x32')]){if(_[_0x5dae('0x65')](_0x37b31d[_0x5dae('0x4f')]['from'])){_0x37b31d[_0x5dae('0x4f')][_0x5dae('0x9b')]=util['format'](_0x5dae('0x9c'),_0x46f5b1[_0x5dae('0x2d')],_0x46f5b1[_0x5dae('0x9d')]||_0x46f5b1[_0x5dae('0x32')][_0x5dae('0x68')]);}if(_0x37b31d[_0x5dae('0x4f')][_0x5dae('0x9e')]&&_0x37b31d[_0x5dae('0x4f')][_0x5dae('0x9e')][_0x5dae('0x5d')]){for(var _0x5e22cf=0x0;_0x5e22cf<_0x37b31d[_0x5dae('0x4f')]['attachments'][_0x5dae('0x5d')];_0x5e22cf+=0x1){_0x37b31d[_0x5dae('0x4f')][_0x5dae('0x9e')][_0x5e22cf]={'filename':_0x37b31d[_0x5dae('0x4f')]['attachments'][_0x5e22cf][_0x5dae('0x2d')],'path':path['join'](config[_0x5dae('0x9f')],_0x5dae('0xa0'),_0x37b31d[_0x5dae('0x4f')]['attachments'][_0x5e22cf][_0x5dae('0xa1')])};}}var _0x53fca0={'tls':{'rejectUnauthorized':![]}};if(_[_0x5dae('0x65')](_0x46f5b1['Smtp'][_0x5dae('0x6a')])){if(_0x46f5b1[_0x5dae('0x32')]['authentication']){_0x53fca0[_0x5dae('0xa2')]={'user':_0x46f5b1[_0x5dae('0x32')][_0x5dae('0x68')],'pass':_0x46f5b1[_0x5dae('0x32')][_0x5dae('0x6f')]};}_0x53fca0[_0x5dae('0x6b')]=_0x46f5b1[_0x5dae('0x32')][_0x5dae('0x6b')];_0x53fca0['port']=_0x46f5b1['Smtp']['port'];_0x53fca0[_0x5dae('0xa3')]=_0x46f5b1[_0x5dae('0x32')][_0x5dae('0xa3')];}else{_0x53fca0[_0x5dae('0x6a')]=_0x46f5b1[_0x5dae('0x32')][_0x5dae('0x6a')];_0x53fca0['auth']={'user':_0x46f5b1[_0x5dae('0x32')]['user'],'pass':_0x46f5b1[_0x5dae('0x32')][_0x5dae('0x6f')]};}return respondWithRpcPromise(_0x5dae('0xa4'),'sendMail',{'account':_0x53fca0,'message':_0x37b31d[_0x5dae('0x4f')]});}else{throw new Error(_0x5dae('0xa5'));}}})[_0x5dae('0x12')](function(_0x2d35ef){if(_0x2d35ef){_0x387a45=_0x2d35ef;if(_0x419364[_0x5dae('0x99')]){if(_0x419364[_0x5dae('0x99')][_0x5dae('0x9a')][_0x5dae('0x5d')]){return _0x419364[_0x5dae('0x99')]['Contacts'][0x0];}else{return db[_0x5dae('0x7e')][_0x5dae('0x5a')](_['defaults'](_0x37b31d[_0x5dae('0x4f')],{'firstName':_0x37b31d[_0x5dae('0x4f')]['to'],'email':_0x37b31d['body']['to'],'phone':_0x37b31d[_0x5dae('0x4f')]['to'],'ListId':_0x419364['ListId']}));}}else{throw new Error(_0x5dae('0xa5'));}}})['then'](function(_0x54f57c){if(_0x54f57c){var _0x1b3952={'UserId':_0x37b31d[_0x5dae('0x68')]['id'],'ContactId':_0x54f57c['id'],'MailAccountId':_0x419364['id'],'inReplyTo':_0x387a45[_0x5dae('0xa6')],'to':_0x37b31d[_0x5dae('0x4f')][_0x5dae('0x9b')],'cc':_0x37b31d[_0x5dae('0x4f')]['cc'],'subject':_0x37b31d[_0x5dae('0x4f')][_0x5dae('0xa7')],'attach':_0x37b31d[_0x5dae('0x4f')][_0x5dae('0xa8')],'firstMsgDirection':_0x5dae('0xa9'),'lastMsgAt':moment()['format'](_0x5dae('0x95')),'lastMsgDirection':_0x5dae('0xa9'),'Messages':[_[_0x5dae('0x45')](_0x37b31d[_0x5dae('0x4f')],{'messageId':_0x387a45[_0x5dae('0xa6')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x419364['id'],'UserId':_0x37b31d['user']['id'],'ContactId':_0x54f57c['id']})]};if(_0x37b31d[_0x5dae('0x4f')][_0x5dae('0xaa')]){_0x1b3952=_[_0x5dae('0x45')](_0x1b3952,_0x37b31d[_0x5dae('0x4f')][_0x5dae('0xaa')]);}return db[_0x5dae('0x7a')]['create'](_0x1b3952,{'include':[{'model':db[_0x5dae('0x91')],'as':_0x5dae('0xab')}]});}})[_0x5dae('0x12')](respondWithResult(_0x4ee8df,null))[_0x5dae('0x1d')](handleError(_0x4ee8df,null));};exports[_0x5dae('0xac')]=function(_0x41ae7c,_0x84161e){return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x41ae7c[_0x5dae('0x4c')]['id']},'include':[{'model':db[_0x5dae('0x31')],'as':_0x5dae('0x32'),'raw':!![],'include':[{'model':db[_0x5dae('0xad')],'as':_0x5dae('0xad'),'raw':!![]}]}]})[_0x5dae('0x12')](handleEntityNotFound(_0x84161e,null))[_0x5dae('0x12')](function(_0x3b358f){if(!_0x3b358f[_0x5dae('0x32')])return;var _0x3dd284={'id':_0x3b358f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3b358f[_0x5dae('0x62')]!==_0x5dae('0x63')){_0x3dd284[_0x5dae('0x6a')]=_0x3b358f['provider'];}else{_0x3dd284['host']=_0x3b358f[_0x5dae('0x32')]['host'];_0x3dd284[_0x5dae('0x6c')]=_0x3b358f[_0x5dae('0x32')][_0x5dae('0x6c')];_0x3dd284[_0x5dae('0xa3')]=_0x3b358f[_0x5dae('0x32')]['secure'];}if(_0x3b358f[_0x5dae('0x32')][_0x5dae('0x6d')]){if(_0x3b358f[_0x5dae('0x32')][_0x5dae('0x51')]){_0x3dd284[_0x5dae('0xa2')]={'type':'OAuth2','user':_0x3b358f[_0x5dae('0x32')][_0x5dae('0x68')],'accessToken':_0x3b358f[_0x5dae('0x32')][_0x5dae('0xad')][_0x5dae('0xae')]};}else{_0x3dd284[_0x5dae('0xa2')]={'user':_0x3b358f[_0x5dae('0x32')][_0x5dae('0x68')],'pass':_0x3b358f[_0x5dae('0x32')][_0x5dae('0x6f')]};}}return respondWithRpcPromise(_0x5dae('0xaf'),_0x5dae('0xac'),{'account':_0x3dd284});})[_0x5dae('0x12')](respondWithResult(_0x84161e,null))[_0x5dae('0x1d')](handleError(_0x84161e,null));};exports[_0x5dae('0x28')]=function(_0x199702,_0x17a769){return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0x199702[_0x5dae('0x4c')]['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x17a769,null))['then'](function(_0x344115){if(_0x344115&&_0x344115['service']){throw new db[(_0x5dae('0xb0'))][(_0x5dae('0xb1'))](_0x5dae('0xb2'));}return _0x344115;})['then'](removeEntity(_0x17a769,null))[_0x5dae('0x1d')](handleError(_0x17a769,null));};exports[_0x5dae('0xb3')]=function(_0xbb0457,_0x35931c){return db[_0x5dae('0x36')][_0x5dae('0x4e')]({'where':{'id':_0xbb0457[_0x5dae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x35931c,null))[_0x5dae('0x12')](function(_0x572e0b){if(_0x572e0b){return _0x572e0b[_0x5dae('0xb3')](_0xbb0457[_0x5dae('0x4f')][_0x5dae('0x61')],_[_0x5dae('0x7c')](_0xbb0457[_0x5dae('0x4f')],[_0x5dae('0x61'),'id'])||{})[_0x5dae('0xb4')](function(_0x42cc8b){for(var _0x2be970=0x0;_0x2be970<_0xbb0457[_0x5dae('0x4f')][_0x5dae('0x61')][_0x5dae('0x5d')];_0x2be970+=0x1){socket[_0x5dae('0xb5')](_0x5dae('0xb6'),{'UserId':Number(_0xbb0457['body'][_0x5dae('0x61')][_0x2be970]),'MailAccountId':Number(_0xbb0457[_0x5dae('0x4c')]['id'])});}return _0x42cc8b;});}})[_0x5dae('0x12')](respondWithResult(_0x35931c,null))['catch'](handleError(_0x35931c,null));};exports['removeAgents']=function(_0x1645fc,_0x12fbf4){return db[_0x5dae('0x36')]['find']({'where':{'id':_0x1645fc['params']['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x12fbf4,null))[_0x5dae('0x12')](function(_0x2e922f){if(_0x2e922f){return _0x2e922f[_0x5dae('0xb7')](_0x1645fc[_0x5dae('0x3b')][_0x5dae('0x61')])['then'](function(){if(_[_0x5dae('0xb8')](_0x1645fc['query'][_0x5dae('0x61')])){for(var _0x38c608=0x0;_0x38c608<_0x1645fc[_0x5dae('0x3b')]['ids']['length'];_0x38c608+=0x1){socket[_0x5dae('0xb5')](_0x5dae('0xb9'),{'UserId':Number(_0x1645fc[_0x5dae('0x3b')][_0x5dae('0x61')][_0x38c608]),'MailAccountId':Number(_0x1645fc[_0x5dae('0x4c')]['id'])});}}else{socket['emit'](_0x5dae('0xb9'),{'UserId':Number(_0x1645fc[_0x5dae('0x3b')][_0x5dae('0x61')]),'MailAccountId':Number(_0x1645fc['params']['id'])});}});}})['then'](respondWithStatusCode(_0x12fbf4,null))[_0x5dae('0x1d')](handleError(_0x12fbf4,null));};exports[_0x5dae('0xba')]=function(_0x10a4f9,_0x5bf1af){var _0x1a74fc={};var _0x13b267={};var _0x18affa;var _0x21d20f;return db['MailAccount']['findOne']({'where':{'id':_0x10a4f9['params']['id']}})[_0x5dae('0x12')](handleEntityNotFound(_0x5bf1af,null))[_0x5dae('0x12')](function(_0x33d888){if(_0x33d888){_0x18affa=_0x33d888;_0x13b267[_0x5dae('0x3a')]=_[_0x5dae('0x3c')](db[_0x5dae('0x80')]['rawAttributes']);_0x13b267['query']=_[_0x5dae('0x3c')](_0x10a4f9[_0x5dae('0x3b')]);_0x13b267[_0x5dae('0x3d')]=_[_0x5dae('0x3e')](_0x13b267[_0x5dae('0x3a')],_0x13b267['query']);_0x1a74fc[_0x5dae('0x3f')]=_['intersection'](_0x13b267[_0x5dae('0x3a')],qs[_0x5dae('0x40')](_0x10a4f9['query'][_0x5dae('0x40')]));_0x1a74fc[_0x5dae('0x3f')]=_0x1a74fc['attributes']['length']?_0x1a74fc[_0x5dae('0x3f')]:_0x13b267[_0x5dae('0x3a')];_0x1a74fc[_0x5dae('0x42')]=qs[_0x5dae('0x43')](_0x10a4f9[_0x5dae('0x3b')]['sort']);_0x1a74fc[_0x5dae('0x44')]=qs[_0x5dae('0x3d')](_[_0x5dae('0x57')](_0x10a4f9[_0x5dae('0x3b')],_0x13b267[_0x5dae('0x3d')]));if(_0x10a4f9['query'][_0x5dae('0x47')]){_0x1a74fc[_0x5dae('0x44')]=_['merge'](_0x1a74fc['where'],{'$or':_[_0x5dae('0x35')](_0x1a74fc[_0x5dae('0x3f')],function(_0x1ff518){var _0x1bf3c1={};_0x1bf3c1[_0x1ff518]={'$like':'%'+_0x10a4f9[_0x5dae('0x3b')][_0x5dae('0x47')]+'%'};return _0x1bf3c1;})});}_0x1a74fc=_[_0x5dae('0x45')]({},_0x1a74fc,_0x10a4f9[_0x5dae('0x48')]);return _0x18affa['getAgents'](_0x1a74fc);}})[_0x5dae('0x12')](function(_0xf84cb8){if(_0xf84cb8){_0x21d20f=_0xf84cb8[_0x5dae('0x5d')];if(!_0x10a4f9['query'][_0x5dae('0x41')](_0x5dae('0x5e'))){_0x1a74fc['limit']=qs[_0x5dae('0x22')](_0x10a4f9[_0x5dae('0x3b')][_0x5dae('0x22')]);_0x1a74fc[_0x5dae('0x21')]=qs['offset'](_0x10a4f9['query']['offset']);}return _0x18affa['getAgents'](_0x1a74fc);}})['then'](function(_0x2d4aaf){if(_0x2d4aaf){return _0x2d4aaf?{'count':_0x21d20f,'rows':_0x2d4aaf}:null;}})[_0x5dae('0x12')](respondWithResult(_0x5bf1af,null))[_0x5dae('0x1d')](handleError(_0x5bf1af,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 82f78a1..5ca392f 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 _0xdfd2=['setMaxListeners','update','remove','emit','hook','exports','events','MailAccount'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0xdfd2,0xf6));var _0x2dfd=function(_0x11dd70,_0x2c3a08){_0x11dd70=_0x11dd70-0x0;var _0x5b348d=_0xdfd2[_0x11dd70];return _0x5b348d;};'use strict';var EventEmitter=require(_0x2dfd('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x2dfd('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2dfd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2dfd('0x3'),'afterDestroy':_0x2dfd('0x4')};function emitEvent(_0x57e414){return function(_0x4b7cca,_0x37c673,_0x4298a5){MailAccountEvents[_0x2dfd('0x5')](_0x57e414+':'+_0x4b7cca['id'],_0x4b7cca);MailAccountEvents['emit'](_0x57e414,_0x4b7cca);_0x4298a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x2dfd('0x6')](e,emitEvent(event));}}module[_0x2dfd('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x8e08=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x322a93,_0x2685ac){var _0x296acf=function(_0x5d6f41){while(--_0x5d6f41){_0x322a93['push'](_0x322a93['shift']());}};_0x296acf(++_0x2685ac);}(_0x8e08,0xf9));var _0x88e0=function(_0x4d9b83,_0x2b8232){_0x4d9b83=_0x4d9b83-0x0;var _0x5630e9=_0x8e08[_0x4d9b83];return _0x5630e9;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x88e0('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x88e0('0x1')](0x0);var events={'afterCreate':_0x88e0('0x2'),'afterUpdate':_0x88e0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x402087){return function(_0x1a2af9,_0x492263,_0x49d228){MailAccountEvents['emit'](_0x402087+':'+_0x1a2af9['id'],_0x1a2af9);MailAccountEvents[_0x88e0('0x4')](_0x402087,_0x1a2af9);_0x49d228(null);};}for(var e in events){if(events[_0x88e0('0x5')](e)){var event=events[e];MailAccount[_0x88e0('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6ded984..473588f 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 _0xfcdd=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','MailAccount','lodash'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0xfcdd,0x98));var _0xdfcd=function(_0x2416c7,_0x44fd15){_0x2416c7=_0x2416c7-0x0;var _0x94bb2=_0xfcdd[_0x2416c7];return _0x94bb2;};'use strict';var _=require(_0xdfcd('0x0'));var util=require('util');var logger=require(_0xdfcd('0x1'))(_0xdfcd('0x2'));var moment=require(_0xdfcd('0x3'));var BPromise=require('bluebird');var rp=require(_0xdfcd('0x4'));var fs=require('fs');var path=require(_0xdfcd('0x5'));var rimraf=require('rimraf');var config=require(_0xdfcd('0x6'));var attributes=require('./mailAccount.attributes');module[_0xdfcd('0x7')]=function(_0x3f76ca,_0x304d1a){return _0x3f76ca['define'](_0xdfcd('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3548=['api','bluebird','request-promise','path','../../config/environment','exports','MailAccount','mail_accounts','lodash','util','../../config/logger'];(function(_0x461546,_0x152a89){var _0xf9e527=function(_0x3ff0e5){while(--_0x3ff0e5){_0x461546['push'](_0x461546['shift']());}};_0xf9e527(++_0x152a89);}(_0x3548,0x189));var _0x8354=function(_0x1d68d4,_0x2a8e17){_0x1d68d4=_0x1d68d4-0x0;var _0x31fa8c=_0x3548[_0x1d68d4];return _0x31fa8c;};'use strict';var _=require(_0x8354('0x0'));var util=require(_0x8354('0x1'));var logger=require(_0x8354('0x2'))(_0x8354('0x3'));var moment=require('moment');var BPromise=require(_0x8354('0x4'));var rp=require(_0x8354('0x5'));var fs=require('fs');var path=require(_0x8354('0x6'));var rimraf=require('rimraf');var config=require(_0x8354('0x7'));var attributes=require('./mailAccount.attributes');module[_0x8354('0x8')]=function(_0x43d935,_0x281d37){return _0x43d935['define'](_0x8354('0x9'),attributes,{'tableName':_0x8354('0xa'),'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 aeaf67e..897e219 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 _0xc014=['inReplyTo','MailInteraction','Contact\x20not\x20found','interaction','created','contact','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','name','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','findAll','options','raw','where','attributes','include','map','model','GetMailAccount','debug','catch','ShowMailAccount','MailAccount','find','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','List','priority','asc','push','autoclose','*,*,*,*','length','defaults','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages'];(function(_0x5b92c7,_0x41472f){var _0xe9517f=function(_0x5469b5){while(--_0x5469b5){_0x5b92c7['push'](_0x5b92c7['shift']());}};_0xe9517f(++_0x41472f);}(_0xc014,0x1be));var _0x4c01=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xc014[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0x4c01('0x0'));var util=require('util');var moment=require(_0x4c01('0x1'));var BPromise=require(_0x4c01('0x2'));var rs=require(_0x4c01('0x3'));var fs=require('fs');var Redis=require(_0x4c01('0x4'));var db=require(_0x4c01('0x5'))['db'];var utils=require(_0x4c01('0x6'));var logger=require(_0x4c01('0x7'))(_0x4c01('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c01('0x9'));var client=jayson[_0x4c01('0xa')][_0x4c01('0xb')]({'port':0x232c});config[_0x4c01('0xc')]=_['defaults'](config[_0x4c01('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c01('0xc')]));require(_0x4c01('0xd'))[_0x4c01('0xe')](socket);function respondWithRpcPromise(_0x5ec297,_0x100a84,_0x3fa60f){return new BPromise(function(_0x46d55a,_0x135e84){return client[_0x4c01('0xf')](_0x5ec297,_0x3fa60f)[_0x4c01('0x10')](function(_0x43f6a4){logger[_0x4c01('0x11')](_0x4c01('0x12'),_0x100a84,_0x4c01('0x13'));logger['debug'](_0x4c01('0x14'),_0x100a84,_0x4c01('0x13'),JSON[_0x4c01('0x15')](_0x43f6a4));if(_0x43f6a4[_0x4c01('0x16')]){if(_0x43f6a4[_0x4c01('0x16')]['code']===0x1f4){logger[_0x4c01('0x16')](_0x4c01('0x12'),_0x100a84,_0x43f6a4[_0x4c01('0x16')]['message']);return _0x135e84(_0x43f6a4[_0x4c01('0x16')][_0x4c01('0x17')]);}logger['error'](_0x4c01('0x12'),_0x100a84,_0x43f6a4[_0x4c01('0x16')]['message']);return _0x46d55a(_0x43f6a4['error']['message']);}else{logger[_0x4c01('0x11')](_0x4c01('0x12'),_0x100a84,_0x4c01('0x13'));_0x46d55a(_0x43f6a4[_0x4c01('0x18')][_0x4c01('0x17')]);}})['catch'](function(_0x317ca9){logger[_0x4c01('0x16')](_0x4c01('0x12'),_0x100a84,_0x317ca9);_0x135e84(_0x317ca9);});});}exports['GetMailAccount']=function(_0x42ca64){var _0x1593ed=this;return new Promise(function(_0x36a7a7,_0x1d8634){return db['MailAccount'][_0x4c01('0x19')]({'raw':_0x42ca64[_0x4c01('0x1a')]?_0x42ca64[_0x4c01('0x1a')][_0x4c01('0x1b')]===undefined?!![]:![]:!![],'where':_0x42ca64[_0x4c01('0x1a')]?_0x42ca64[_0x4c01('0x1a')][_0x4c01('0x1c')]||null:null,'attributes':_0x42ca64['options']?_0x42ca64[_0x4c01('0x1a')][_0x4c01('0x1d')]||null:null,'limit':_0x42ca64[_0x4c01('0x1a')]?_0x42ca64['options']['limit']||null:null,'include':_0x42ca64[_0x4c01('0x1a')]?_0x42ca64[_0x4c01('0x1a')][_0x4c01('0x1e')]?_[_0x4c01('0x1f')](_0x42ca64[_0x4c01('0x1a')][_0x4c01('0x1e')],function(_0x4dd4a2){return{'model':db[_0x4dd4a2[_0x4c01('0x20')]],'as':_0x4dd4a2['as'],'attributes':_0x4dd4a2[_0x4c01('0x1d')],'include':_0x4dd4a2[_0x4c01('0x1e')]?_['map'](_0x4dd4a2[_0x4c01('0x1e')],function(_0x29a34d){return{'model':db[_0x29a34d[_0x4c01('0x20')]],'as':_0x29a34d['as'],'attributes':_0x29a34d['attributes'],'include':_0x29a34d['include']?_[_0x4c01('0x1f')](_0x29a34d['include'],function(_0x1aa39d){return{'model':db[_0x1aa39d[_0x4c01('0x20')]],'as':_0x1aa39d['as'],'attributes':_0x1aa39d[_0x4c01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4c01('0x10')](function(_0xa3ca6e){logger[_0x4c01('0x11')](_0x4c01('0x21'),_0x42ca64);logger[_0x4c01('0x22')](_0x4c01('0x21'),_0x42ca64,JSON['stringify'](_0xa3ca6e));_0x36a7a7(_0xa3ca6e);})[_0x4c01('0x23')](function(_0x334c35){logger[_0x4c01('0x16')](_0x4c01('0x21'),_0x334c35[_0x4c01('0x17')],_0x42ca64);_0x1d8634(_0x1593ed[_0x4c01('0x16')](0x1f4,_0x334c35[_0x4c01('0x17')]));});});};exports[_0x4c01('0x24')]=function(_0x2dac55){var _0x5500e1=this;return new Promise(function(_0x50fd97,_0x199ec9){return db[_0x4c01('0x25')][_0x4c01('0x26')]({'raw':_0x2dac55[_0x4c01('0x1a')]?_0x2dac55[_0x4c01('0x1a')][_0x4c01('0x1b')]===undefined?!![]:![]:!![],'where':_0x2dac55['options']?_0x2dac55['options']['where']||null:null,'attributes':_0x2dac55[_0x4c01('0x1a')]?_0x2dac55[_0x4c01('0x1a')][_0x4c01('0x1d')]||null:null,'include':_0x2dac55[_0x4c01('0x1a')]?_0x2dac55[_0x4c01('0x1a')][_0x4c01('0x1e')]?_[_0x4c01('0x1f')](_0x2dac55['options'][_0x4c01('0x1e')],function(_0x2c3018){return{'model':db[_0x2c3018[_0x4c01('0x20')]],'as':_0x2c3018['as'],'attributes':_0x2c3018[_0x4c01('0x1d')],'include':_0x2c3018[_0x4c01('0x1e')]?_[_0x4c01('0x1f')](_0x2c3018[_0x4c01('0x1e')],function(_0x15b340){return{'model':db[_0x15b340[_0x4c01('0x20')]],'as':_0x15b340['as'],'attributes':_0x15b340[_0x4c01('0x1d')],'include':_0x15b340[_0x4c01('0x1e')]?_['map'](_0x15b340[_0x4c01('0x1e')],function(_0x4f981b){return{'model':db[_0x4f981b[_0x4c01('0x20')]],'as':_0x4f981b['as'],'attributes':_0x4f981b[_0x4c01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4c01('0x10')](function(_0x1e1406){logger['info'](_0x4c01('0x24'),_0x2dac55);logger[_0x4c01('0x22')]('ShowMailAccount',_0x2dac55,JSON[_0x4c01('0x15')](_0x1e1406));_0x50fd97(_0x1e1406);})[_0x4c01('0x23')](function(_0x5d3004){logger[_0x4c01('0x16')](_0x4c01('0x24'),_0x5d3004[_0x4c01('0x17')],_0x2dac55);_0x199ec9(_0x5500e1[_0x4c01('0x16')](0x1f4,_0x5d3004[_0x4c01('0x17')]));});});};exports['NotifyMailAccount']=function(_0x29921a){var _0x36e685=this;return new Promise(function(_0x4c348b,_0x229c19){var _0x5afbc6={'body':_0x29921a[_0x4c01('0x27')],'channel':_0x4c01('0x28')};var _0x530e5a=_[_0x4c01('0x29')](_[_0x4c01('0x2a')](db[_0x4c01('0x2b')][_0x4c01('0x2c')]),[_0x4c01('0x2d'),_0x4c01('0x2e'),'CompanyId',_0x4c01('0x2f')]);var _0x179e0b=![];if(_0x29921a[_0x4c01('0x27')]['id']){delete _0x29921a[_0x4c01('0x27')]['id'];}if(_[_0x4c01('0x30')](_0x29921a['body'][_0x4c01('0x31')])){return _0x229c19(_0x36e685[_0x4c01('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x29921a['body']['body'])||_0x29921a[_0x4c01('0x27')][_0x4c01('0x27')]===''){return _0x229c19(_0x36e685[_0x4c01('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4c01('0x30')](_0x29921a[_0x4c01('0x27')]['mapKey'])){return _0x229c19(_0x36e685[_0x4c01('0x16')](0x1f4,_0x4c01('0x32')+_0x530e5a));}if(!_[_0x4c01('0x33')](_0x530e5a,_0x29921a[_0x4c01('0x27')][_0x4c01('0x34')])){return _0x229c19(_0x36e685['error'](0x1f4,_0x4c01('0x35')+_0x530e5a));}var _0x285c38={};_0x285c38[_0x29921a[_0x4c01('0x27')]['mapKey']]=_0x29921a['body'][_0x4c01('0x31')];return db[_0x4c01('0x25')][_0x4c01('0x26')]({'where':{'id':_0x29921a[_0x4c01('0x36')]['id']},'include':[{'model':db[_0x4c01('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4c01('0x38'),'where':_0x285c38,'limit':0x1,'order':[[_0x4c01('0x2e'),_0x4c01('0x39')]]}]},{'model':db[_0x4c01('0x3a')],'as':_0x4c01('0x3b')},{'model':db[_0x4c01('0x3c')],'as':_0x4c01('0x3d')}]})[_0x4c01('0x10')](function(_0x562311){if(_0x562311&&_0x562311['List']){var _0x29022b=_0x562311[_0x4c01('0x3e')]({'plain':!![]});_0x5afbc6[_0x4c01('0x36')]=_[_0x4c01('0x3f')](_0x29022b,[_0x4c01('0x3b'),'List']);_0x5afbc6[_0x4c01('0x40')]=_0x29022b[_0x4c01('0x3b')];_0x5afbc6[_0x4c01('0x41')]=_0x29022b[_0x4c01('0x42')];_0x5afbc6[_0x4c01('0x40')]=_['orderBy'](_0x5afbc6['applications'],[_0x4c01('0x43')],[_0x4c01('0x44')]);if(_0x5afbc6[_0x4c01('0x36')]&&_0x5afbc6[_0x4c01('0x36')]['autoclose']){_0x5afbc6[_0x4c01('0x40')][_0x4c01('0x45')]({'id':0x0,'priority':_0x5afbc6[_0x4c01('0x40')]['length']+0x1,'app':'close','appdata':_0x4c01('0x46'),'interval':_0x4c01('0x47')});}if(_0x5afbc6[_0x4c01('0x36')][_0x4c01('0x3b')]){delete _0x5afbc6[_0x4c01('0x36')][_0x4c01('0x3b')];}if(_0x5afbc6['account']['List']){delete _0x5afbc6['account']['List'];}if(_0x29022b['List']['Contacts'][_0x4c01('0x48')]){return _0x29022b[_0x4c01('0x42')][_0x4c01('0x38')][0x0];}var _0x569734=_[_0x4c01('0x49')](_0x29921a[_0x4c01('0x27')],{'firstName':_0x29921a[_0x4c01('0x27')][_0x4c01('0x31')],'ListId':_0x29022b[_0x4c01('0x2f')]});_0x569734[_0x29921a[_0x4c01('0x27')][_0x4c01('0x34')]]=_0x29921a[_0x4c01('0x27')]['from'];return db[_0x4c01('0x2b')][_0x4c01('0x4a')](_0x569734);}else{throw new Error(_0x4c01('0x4b'));}})['then'](function(_0x2b1b63){_0x5afbc6['contact']=_0x2b1b63;if(_0x2b1b63){if(!_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x4c')]){_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x4c')]=rs[_0x4c01('0x4d')]()+'\x20'+_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x31')];}var _0x1305fe={'ContactId':_0x2b1b63['id'],'MailAccountId':_0x29921a[_0x4c01('0x36')]['id'],'inReplyTo':_0x29921a[_0x4c01('0x27')]['message']['messageId'],'to':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x31')],'cc':_0x29921a[_0x4c01('0x27')]['message']['cc'],'subject':_0x29921a['body'][_0x4c01('0x17')][_0x4c01('0x4e')],'attach':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x4f')],'lastMsgAt':moment()[_0x4c01('0x50')](_0x4c01('0x51')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x4c01('0x26')]({'where':{'closed':![],'MailAccountId':_0x29921a[_0x4c01('0x36')]['id']},'include':[{'model':db[_0x4c01('0x52')],'as':_0x4c01('0x53'),'attributes':[_0x4c01('0x4c')],'where':{'messageId':_0x29921a[_0x4c01('0x27')]['message'][_0x4c01('0x54')]}}]})[_0x4c01('0x10')](function(_0x1129a5){if(_0x1129a5){return[_0x1129a5,![]];}return db[_0x4c01('0x55')]['create'](_0x1305fe)[_0x4c01('0x10')](function(_0x4e533e){return[_0x4e533e,!![]];});});}else{throw new Error(_0x4c01('0x56'));}})['spread'](function(_0x351037,_0x59acd7){if(_0x351037){_0x179e0b=_0x59acd7;if(!_0x59acd7){return _0x351037['update']({'inReplyTo':_0x29921a[_0x4c01('0x27')]['message'][_0x4c01('0x4c')],'to':_0x29921a['body']['message'][_0x4c01('0x31')],'cc':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')]['cc'],'subject':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x4e')],'attach':_0x351037[_0x4c01('0x4f')]?_0x351037['attach']:_0x29921a[_0x4c01('0x27')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x4c01('0x50')](_0x4c01('0x51')),'lastMsgAt':moment()[_0x4c01('0x50')](_0x4c01('0x51')),'lastMsgDirection':'in'});}else{return _0x351037;}}})[_0x4c01('0x10')](function(_0x2e7cc9){_0x5afbc6[_0x4c01('0x57')]=_0x2e7cc9[_0x4c01('0x3e')]({'plain':!![]});_0x5afbc6[_0x4c01('0x57')][_0x4c01('0x58')]=_0x179e0b;return db[_0x4c01('0x52')][_0x4c01('0x4a')]({'body':_0x29921a['body'][_0x4c01('0x27')],'MailAccountId':_0x29921a['account']['id'],'MailInteractionId':_0x2e7cc9['id'],'direction':'in','ContactId':_0x5afbc6[_0x4c01('0x59')]['id'],'messageId':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')]['messageId'],'from':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x31')],'to':_0x29921a[_0x4c01('0x27')]['message']['to'],'cc':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')]['cc'],'subject':_0x29921a['body']['message'][_0x4c01('0x4e')],'attach':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x4f')],'Attachments':_0x29921a['body']['message'][_0x4c01('0x5a')],'originTo':_0x29921a['body'][_0x4c01('0x17')][_0x4c01('0x5b')],'originCc':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')]['originCc'],'bcc':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x5c')],'ChatWebsiteId':_0x29921a['body'][_0x4c01('0x17')][_0x4c01('0x5d')]||null,'originChannel':_0x29921a[_0x4c01('0x27')][_0x4c01('0x17')][_0x4c01('0x5e')]||_0x4c01('0x5f'),'ChatOfflineMessageId':_0x29921a[_0x4c01('0x27')]['message'][_0x4c01('0x60')]||null},{'include':[{'model':db[_0x4c01('0x61')],'as':_0x4c01('0x62')}]});})[_0x4c01('0x10')](function(_0x49c89c){_0x5afbc6[_0x4c01('0x17')]=_0x49c89c;if(_0x5afbc6[_0x4c01('0x57')]['UserId']){return db['User'][_0x4c01('0x26')]({'attributes':['id',_0x4c01('0x63')],'where':{'id':_0x5afbc6[_0x4c01('0x57')][_0x4c01('0x64')]}})['then'](function(_0x19fe8c){if(_0x19fe8c){_0x5afbc6[_0x4c01('0x40')][_0x4c01('0x65')]({'id':0x0,'priority':0x0,'app':_0x4c01('0x66'),'appdata':_0x19fe8c[_0x4c01('0x63')]+','+(_0x5afbc6['account'][_0x4c01('0x67')]||0xa),'interval':_0x4c01('0x47')});}return respondWithRpcPromise('Start',_0x4c01('0x68'),_0x5afbc6);});}return respondWithRpcPromise(_0x4c01('0x69'),_0x4c01('0x68'),_0x5afbc6);})['then'](function(_0x4f8f9e){_0x4c348b(_0x4f8f9e);})[_0x4c01('0x23')](function(_0x40e427){_0x229c19(_0x36e685[_0x4c01('0x16')](0x1f4,_0x40e427[_0x4c01('0x17')]));});});}; \ No newline at end of file +var _0x385f=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailAccount','NotifyMailAccount','mail','difference','keys','updatedAt','ListId','body','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','CmContact','Contacts','MailApplication','Applications','MailServerOut','Smtp','List','get','omit','applications','list','orderBy','asc','push','close','autoclose','*,*,*,*','defaults','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','spread','interaction','created','attachments','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util'];(function(_0x47b7cc,_0xd5b4d6){var _0x38f9b8=function(_0x32d99a){while(--_0x32d99a){_0x47b7cc['push'](_0x47b7cc['shift']());}};_0x38f9b8(++_0xd5b4d6);}(_0x385f,0xcc));var _0xf385=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x385f[_0x1aed80];return _0x43961e;};'use strict';var _=require(_0xf385('0x0'));var util=require(_0xf385('0x1'));var moment=require(_0xf385('0x2'));var BPromise=require('bluebird');var rs=require(_0xf385('0x3'));var fs=require('fs');var Redis=require(_0xf385('0x4'));var db=require(_0xf385('0x5'))['db'];var utils=require(_0xf385('0x6'));var logger=require('../../config/logger')(_0xf385('0x7'));var config=require(_0xf385('0x8'));var jayson=require(_0xf385('0x9'));var client=jayson[_0xf385('0xa')][_0xf385('0xb')]({'port':0x232c});config[_0xf385('0xc')]=_['defaults'](config['redis'],{'host':_0xf385('0xd'),'port':0x18eb});var socket=require(_0xf385('0xe'))(new Redis(config[_0xf385('0xc')]));require(_0xf385('0xf'))[_0xf385('0x10')](socket);function respondWithRpcPromise(_0x196918,_0x3d426f,_0x5964dc){return new BPromise(function(_0x2696f6,_0x472097){return client[_0xf385('0x11')](_0x196918,_0x5964dc)[_0xf385('0x12')](function(_0x334afc){logger[_0xf385('0x13')]('MailAccount,\x20%s,\x20%s',_0x3d426f,_0xf385('0x14'));logger[_0xf385('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3d426f,_0xf385('0x14'),JSON['stringify'](_0x334afc));if(_0x334afc[_0xf385('0x16')]){if(_0x334afc[_0xf385('0x16')]['code']===0x1f4){logger['error'](_0xf385('0x17'),_0x3d426f,_0x334afc[_0xf385('0x16')][_0xf385('0x18')]);return _0x472097(_0x334afc[_0xf385('0x16')][_0xf385('0x18')]);}logger[_0xf385('0x16')](_0xf385('0x17'),_0x3d426f,_0x334afc[_0xf385('0x16')]['message']);return _0x2696f6(_0x334afc[_0xf385('0x16')][_0xf385('0x18')]);}else{logger[_0xf385('0x13')]('MailAccount,\x20%s,\x20%s',_0x3d426f,_0xf385('0x14'));_0x2696f6(_0x334afc[_0xf385('0x19')]['message']);}})[_0xf385('0x1a')](function(_0x261b67){logger[_0xf385('0x16')](_0xf385('0x17'),_0x3d426f,_0x261b67);_0x472097(_0x261b67);});});}exports[_0xf385('0x1b')]=function(_0xd4c24){var _0x248d32=this;return new Promise(function(_0x144a76,_0x4b6b46){return db[_0xf385('0x1c')][_0xf385('0x1d')]({'raw':_0xd4c24[_0xf385('0x1e')]?_0xd4c24['options'][_0xf385('0x1f')]===undefined?!![]:![]:!![],'where':_0xd4c24[_0xf385('0x1e')]?_0xd4c24[_0xf385('0x1e')][_0xf385('0x20')]||null:null,'attributes':_0xd4c24[_0xf385('0x1e')]?_0xd4c24['options'][_0xf385('0x21')]||null:null,'limit':_0xd4c24['options']?_0xd4c24[_0xf385('0x1e')][_0xf385('0x22')]||null:null,'include':_0xd4c24['options']?_0xd4c24[_0xf385('0x1e')]['include']?_[_0xf385('0x23')](_0xd4c24[_0xf385('0x1e')][_0xf385('0x24')],function(_0x348eb0){return{'model':db[_0x348eb0[_0xf385('0x25')]],'as':_0x348eb0['as'],'attributes':_0x348eb0[_0xf385('0x21')],'include':_0x348eb0[_0xf385('0x24')]?_['map'](_0x348eb0[_0xf385('0x24')],function(_0x3a9f8b){return{'model':db[_0x3a9f8b[_0xf385('0x25')]],'as':_0x3a9f8b['as'],'attributes':_0x3a9f8b['attributes'],'include':_0x3a9f8b[_0xf385('0x24')]?_[_0xf385('0x23')](_0x3a9f8b[_0xf385('0x24')],function(_0x29bac6){return{'model':db[_0x29bac6[_0xf385('0x25')]],'as':_0x29bac6['as'],'attributes':_0x29bac6[_0xf385('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf385('0x12')](function(_0xfde485){logger['info'](_0xf385('0x1b'),_0xd4c24);logger[_0xf385('0x15')](_0xf385('0x1b'),_0xd4c24,JSON[_0xf385('0x26')](_0xfde485));_0x144a76(_0xfde485);})[_0xf385('0x1a')](function(_0x1fd328){logger[_0xf385('0x16')](_0xf385('0x1b'),_0x1fd328['message'],_0xd4c24);_0x4b6b46(_0x248d32[_0xf385('0x16')](0x1f4,_0x1fd328[_0xf385('0x18')]));});});};exports[_0xf385('0x27')]=function(_0x6fca3a){var _0x5e7b93=this;return new Promise(function(_0xad4d03,_0x59ff05){return db['MailAccount']['find']({'raw':_0x6fca3a[_0xf385('0x1e')]?_0x6fca3a['options'][_0xf385('0x1f')]===undefined?!![]:![]:!![],'where':_0x6fca3a['options']?_0x6fca3a[_0xf385('0x1e')][_0xf385('0x20')]||null:null,'attributes':_0x6fca3a[_0xf385('0x1e')]?_0x6fca3a['options'][_0xf385('0x21')]||null:null,'include':_0x6fca3a['options']?_0x6fca3a[_0xf385('0x1e')][_0xf385('0x24')]?_['map'](_0x6fca3a[_0xf385('0x1e')][_0xf385('0x24')],function(_0x5a2de3){return{'model':db[_0x5a2de3['model']],'as':_0x5a2de3['as'],'attributes':_0x5a2de3[_0xf385('0x21')],'include':_0x5a2de3[_0xf385('0x24')]?_[_0xf385('0x23')](_0x5a2de3[_0xf385('0x24')],function(_0x32b027){return{'model':db[_0x32b027['model']],'as':_0x32b027['as'],'attributes':_0x32b027[_0xf385('0x21')],'include':_0x32b027['include']?_[_0xf385('0x23')](_0x32b027[_0xf385('0x24')],function(_0xe5e999){return{'model':db[_0xe5e999[_0xf385('0x25')]],'as':_0xe5e999['as'],'attributes':_0xe5e999['attributes']};}):[]};}):[]};}):[]:[]})[_0xf385('0x12')](function(_0x5a5cf9){logger['info'](_0xf385('0x27'),_0x6fca3a);logger[_0xf385('0x15')](_0xf385('0x27'),_0x6fca3a,JSON[_0xf385('0x26')](_0x5a5cf9));_0xad4d03(_0x5a5cf9);})['catch'](function(_0xa1b0db){logger[_0xf385('0x16')](_0xf385('0x27'),_0xa1b0db[_0xf385('0x18')],_0x6fca3a);_0x59ff05(_0x5e7b93[_0xf385('0x16')](0x1f4,_0xa1b0db[_0xf385('0x18')]));});});};exports[_0xf385('0x28')]=function(_0x58946f){var _0x2471b0=this;return new Promise(function(_0x2f12f7,_0x5acd92){var _0x4367a2={'body':_0x58946f['body'],'channel':_0xf385('0x29')};var _0x39a811=_[_0xf385('0x2a')](_[_0xf385('0x2b')](db['CmContact']['rawAttributes']),['createdAt',_0xf385('0x2c'),'CompanyId',_0xf385('0x2d')]);var _0xa3e245=![];if(_0x58946f[_0xf385('0x2e')]['id']){delete _0x58946f[_0xf385('0x2e')]['id'];}if(_[_0xf385('0x2f')](_0x58946f['body']['from'])){return _0x5acd92(_0x2471b0['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xf385('0x2f')](_0x58946f[_0xf385('0x2e')][_0xf385('0x2e')])||_0x58946f[_0xf385('0x2e')][_0xf385('0x2e')]===''){return _0x5acd92(_0x2471b0[_0xf385('0x16')](0x1f4,_0xf385('0x30')));}if(_[_0xf385('0x2f')](_0x58946f[_0xf385('0x2e')][_0xf385('0x31')])){return _0x5acd92(_0x2471b0[_0xf385('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39a811));}if(!_[_0xf385('0x32')](_0x39a811,_0x58946f[_0xf385('0x2e')][_0xf385('0x31')])){return _0x5acd92(_0x2471b0[_0xf385('0x16')](0x1f4,_0xf385('0x33')+_0x39a811));}var _0x52b79f={};_0x52b79f[_0x58946f[_0xf385('0x2e')][_0xf385('0x31')]]=_0x58946f['body'][_0xf385('0x34')];return db[_0xf385('0x1c')][_0xf385('0x35')]({'where':{'id':_0x58946f[_0xf385('0x36')]['id']},'include':[{'model':db[_0xf385('0x37')],'as':'List','include':[{'model':db[_0xf385('0x38')],'as':_0xf385('0x39'),'where':_0x52b79f,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xf385('0x3a')],'as':_0xf385('0x3b')},{'model':db[_0xf385('0x3c')],'as':_0xf385('0x3d')}]})['then'](function(_0x390ba5){if(_0x390ba5&&_0x390ba5[_0xf385('0x3e')]){var _0x5d361b=_0x390ba5[_0xf385('0x3f')]({'plain':!![]});_0x4367a2['account']=_[_0xf385('0x40')](_0x5d361b,[_0xf385('0x3b'),_0xf385('0x3e')]);_0x4367a2[_0xf385('0x41')]=_0x5d361b[_0xf385('0x3b')];_0x4367a2[_0xf385('0x42')]=_0x5d361b['List'];_0x4367a2['applications']=_[_0xf385('0x43')](_0x4367a2[_0xf385('0x41')],['priority'],[_0xf385('0x44')]);if(_0x4367a2[_0xf385('0x36')]&&_0x4367a2['account']['autoclose']){_0x4367a2[_0xf385('0x41')][_0xf385('0x45')]({'id':0x0,'priority':_0x4367a2[_0xf385('0x41')]['length']+0x1,'app':_0xf385('0x46'),'appdata':_0xf385('0x47'),'interval':_0xf385('0x48')});}if(_0x4367a2[_0xf385('0x36')][_0xf385('0x3b')]){delete _0x4367a2[_0xf385('0x36')][_0xf385('0x3b')];}if(_0x4367a2[_0xf385('0x36')][_0xf385('0x3e')]){delete _0x4367a2[_0xf385('0x36')]['List'];}if(_0x5d361b[_0xf385('0x3e')][_0xf385('0x39')]['length']){return _0x5d361b[_0xf385('0x3e')]['Contacts'][0x0];}var _0x57d263=_[_0xf385('0x49')](_0x58946f[_0xf385('0x2e')],{'firstName':_0x58946f[_0xf385('0x2e')][_0xf385('0x34')],'ListId':_0x5d361b[_0xf385('0x2d')]});_0x57d263[_0x58946f[_0xf385('0x2e')]['mapKey']]=_0x58946f[_0xf385('0x2e')][_0xf385('0x34')];return db['CmContact'][_0xf385('0x4a')](_0x57d263);}else{throw new Error(_0xf385('0x4b'));}})['then'](function(_0x488c54){_0x4367a2[_0xf385('0x4c')]=_0x488c54;if(_0x488c54){if(!_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x4d')]){_0x58946f[_0xf385('0x2e')][_0xf385('0x18')]['messageId']=rs['generate']()+'\x20'+_0x58946f['body'][_0xf385('0x18')]['from'];}var _0x2f3443={'ContactId':_0x488c54['id'],'MailAccountId':_0x58946f[_0xf385('0x36')]['id'],'inReplyTo':_0x58946f[_0xf385('0x2e')]['message']['messageId'],'to':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x34')],'cc':_0x58946f[_0xf385('0x2e')]['message']['cc'],'subject':_0x58946f[_0xf385('0x2e')]['message'][_0xf385('0x4e')],'attach':_0x58946f[_0xf385('0x2e')]['message'][_0xf385('0x4f')],'lastMsgAt':moment()[_0xf385('0x50')](_0xf385('0x51')),'lastMsgDirection':'in'};return db[_0xf385('0x52')][_0xf385('0x35')]({'where':{'closed':![],'MailAccountId':_0x58946f[_0xf385('0x36')]['id']},'include':[{'model':db[_0xf385('0x53')],'as':_0xf385('0x54'),'attributes':['messageId'],'where':{'messageId':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')]['inReplyTo']}}]})[_0xf385('0x12')](function(_0x256856){if(_0x256856){return[_0x256856,![]];}return db[_0xf385('0x52')][_0xf385('0x4a')](_0x2f3443)['then'](function(_0x4cbc89){return[_0x4cbc89,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf385('0x55')](function(_0x513c39,_0x31ba2e){if(_0x513c39){_0xa3e245=_0x31ba2e;if(!_0x31ba2e){return _0x513c39['update']({'inReplyTo':_0x58946f['body'][_0xf385('0x18')][_0xf385('0x4d')],'to':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x34')],'cc':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')]['cc'],'subject':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x4e')],'attach':_0x513c39['attach']?_0x513c39[_0xf385('0x4f')]:_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x4f')],'substatus':null,'substatusAt':moment()['format'](_0xf385('0x51')),'lastMsgAt':moment()[_0xf385('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x513c39;}}})[_0xf385('0x12')](function(_0x28034f){_0x4367a2[_0xf385('0x56')]=_0x28034f[_0xf385('0x3f')]({'plain':!![]});_0x4367a2[_0xf385('0x56')][_0xf385('0x57')]=_0xa3e245;return db[_0xf385('0x53')][_0xf385('0x4a')]({'body':_0x58946f[_0xf385('0x2e')][_0xf385('0x2e')],'MailAccountId':_0x58946f['account']['id'],'MailInteractionId':_0x28034f['id'],'direction':'in','ContactId':_0x4367a2[_0xf385('0x4c')]['id'],'messageId':_0x58946f[_0xf385('0x2e')]['message'][_0xf385('0x4d')],'from':_0x58946f[_0xf385('0x2e')]['message'][_0xf385('0x34')],'to':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')]['to'],'cc':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')]['cc'],'subject':_0x58946f[_0xf385('0x2e')]['message']['subject'],'attach':_0x58946f['body']['message'][_0xf385('0x4f')],'Attachments':_0x58946f[_0xf385('0x2e')]['message'][_0xf385('0x58')],'originTo':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')]['originTo'],'originCc':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x59')],'bcc':_0x58946f[_0xf385('0x2e')]['message'][_0xf385('0x5a')],'ChatWebsiteId':_0x58946f['body'][_0xf385('0x18')]['ChatWebsiteId']||null,'originChannel':_0x58946f['body'][_0xf385('0x18')][_0xf385('0x5b')]||_0xf385('0x5c'),'ChatOfflineMessageId':_0x58946f[_0xf385('0x2e')][_0xf385('0x18')][_0xf385('0x5d')]||null},{'include':[{'model':db[_0xf385('0x5e')],'as':_0xf385('0x5f')}]});})[_0xf385('0x12')](function(_0x4bf49a){_0x4367a2['message']=_0x4bf49a;if(_0x4367a2['interaction'][_0xf385('0x60')]){return db[_0xf385('0x61')][_0xf385('0x35')]({'attributes':['id',_0xf385('0x62')],'where':{'id':_0x4367a2[_0xf385('0x56')][_0xf385('0x60')]}})[_0xf385('0x12')](function(_0x3193f3){if(_0x3193f3){_0x4367a2[_0xf385('0x41')][_0xf385('0x63')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3193f3[_0xf385('0x62')]+','+(_0x4367a2['account'][_0xf385('0x64')]||0xa),'interval':_0xf385('0x48')});}return respondWithRpcPromise('Start','startRouting',_0x4367a2);});}return respondWithRpcPromise(_0xf385('0x65'),_0xf385('0x66'),_0x4367a2);})[_0xf385('0x12')](function(_0x588760){_0x2f12f7(_0x588760);})[_0xf385('0x1a')](function(_0x49ab80){_0x5acd92(_0x2471b0[_0xf385('0x16')](0x1f4,_0x49ab80[_0xf385('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c8cf416..47ff4c5 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 _0x2028=['emit','removeListener','length','mailAccount:','remove','update'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0x2028,0x64));var _0x8202=function(_0x4c9536,_0x425aa7){_0x4c9536=_0x4c9536-0x0;var _0xa87db8=_0x2028[_0x4c9536];return _0xa87db8;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x8202('0x0'),_0x8202('0x1')];function createListener(_0x2afc2e,_0x5ae6a6){return function(_0x1bdcd7){_0x5ae6a6[_0x8202('0x2')](_0x2afc2e,_0x1bdcd7);};}function removeListener(_0x23ae3f,_0x598776){return function(){MailAccountEvents[_0x8202('0x3')](_0x23ae3f,_0x598776);};}exports['register']=function(_0xab1a88){for(var _0x86e6d8=0x0,_0x4382f2=events[_0x8202('0x4')];_0x86e6d8<_0x4382f2;_0x86e6d8++){var _0x5a2b9d=events[_0x86e6d8];var _0xe5773d=createListener(_0x8202('0x5')+_0x5a2b9d,_0xab1a88);MailAccountEvents['on'](_0x5a2b9d,_0xe5773d);}}; \ No newline at end of file +var _0x6245=['update','emit','removeListener','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x12dcc3,_0x1e9203){var _0x13ec97=function(_0x6b47c4){while(--_0x6b47c4){_0x12dcc3['push'](_0x12dcc3['shift']());}};_0x13ec97(++_0x1e9203);}(_0x6245,0xe5));var _0x5624=function(_0x1ed406,_0x3b3184){_0x1ed406=_0x1ed406-0x0;var _0x359b38=_0x6245[_0x1ed406];return _0x359b38;};'use strict';var MailAccountEvents=require(_0x5624('0x0'));var events=[_0x5624('0x1'),_0x5624('0x2'),_0x5624('0x3')];function createListener(_0x5f07bd,_0x39f0ec){return function(_0x3b2b39){_0x39f0ec[_0x5624('0x4')](_0x5f07bd,_0x3b2b39);};}function removeListener(_0x50e974,_0x16da51){return function(){MailAccountEvents[_0x5624('0x5')](_0x50e974,_0x16da51);};}exports['register']=function(_0x269a95){for(var _0x381b4a=0x0,_0x6075af=events[_0x5624('0x6')];_0x381b4a<_0x6075af;_0x381b4a++){var _0x46fad9=events[_0x381b4a];var _0x5f7bf5=createListener(_0x5624('0x7')+_0x46fad9,_0x269a95);MailAccountEvents['on'](_0x46fad9,_0x5f7bf5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5fac3c2..81b1326 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 _0x1373=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','put','/:id','update','destroy','exports'];(function(_0x389d7c,_0x59bc6c){var _0x3abb43=function(_0x35db5c){while(--_0x35db5c){_0x389d7c['push'](_0x389d7c['shift']());}};_0x3abb43(++_0x59bc6c);}(_0x1373,0xe0));var _0x3137=function(_0x1908f0,_0x5b2826){_0x1908f0=_0x1908f0-0x0;var _0x2dc3df=_0x1373[_0x1908f0];return _0x2dc3df;};'use strict';var multer=require('multer');var util=require(_0x3137('0x0'));var path=require('path');var timeout=require(_0x3137('0x1'));var express=require(_0x3137('0x2'));var router=express['Router']();var fs_extra=require(_0x3137('0x3'));var auth=require(_0x3137('0x4'));var interaction=require(_0x3137('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x3137('0x6')]('/:id',auth[_0x3137('0x7')](),controller[_0x3137('0x8')]);router[_0x3137('0x9')](_0x3137('0xa'),auth[_0x3137('0x7')](),controller[_0x3137('0xb')]);router['delete']('/:id',auth[_0x3137('0x7')](),controller[_0x3137('0xc')]);module[_0x3137('0xd')]=router; \ No newline at end of file +var _0xa0cc=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','update','delete','destroy'];(function(_0x294b7a,_0x51b167){var _0x30d2a3=function(_0x13a696){while(--_0x13a696){_0x294b7a['push'](_0x294b7a['shift']());}};_0x30d2a3(++_0x51b167);}(_0xa0cc,0xf1));var _0xca0c=function(_0x220e91,_0x2c4b45){_0x220e91=_0x220e91-0x0;var _0x4765df=_0xa0cc[_0x220e91];return _0x4765df;};'use strict';var multer=require(_0xca0c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xca0c('0x1'));var express=require(_0xca0c('0x2'));var router=express[_0xca0c('0x3')]();var fs_extra=require(_0xca0c('0x4'));var auth=require(_0xca0c('0x5'));var interaction=require(_0xca0c('0x6'));var config=require(_0xca0c('0x7'));var controller=require(_0xca0c('0x8'));router['get'](_0xca0c('0x9'),auth[_0xca0c('0xa')](),controller['show']);router['put'](_0xca0c('0x9'),auth[_0xca0c('0xa')](),controller[_0xca0c('0xb')]);router[_0xca0c('0xc')](_0xca0c('0x9'),auth[_0xca0c('0xa')](),controller[_0xca0c('0xd')]);module[_0xca0c('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 63d5308..d2127bc 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 _0xeaab=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xeaab,0x14d));var _0xbeaa=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xeaab[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xbeaa('0x0'));module[_0xbeaa('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbeaa('0x2')],'allowNull':![],'defaultValue':_0xbeaa('0x3')},'appdata':{'type':Sequelize[_0xbeaa('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbeaa('0x2')],'defaultValue':_0xbeaa('0x5')}}; \ No newline at end of file +var _0x5d08=['TEXT','*,*,*,*','STRING','noop'];(function(_0xca03a4,_0x2120e6){var _0x2b9532=function(_0x57d0e3){while(--_0x57d0e3){_0xca03a4['push'](_0xca03a4['shift']());}};_0x2b9532(++_0x2120e6);}(_0x5d08,0x76));var _0x85d0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5d08[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x85d0('0x0')],'allowNull':![],'defaultValue':_0x85d0('0x1')},'appdata':{'type':Sequelize[_0x85d0('0x2')]()},'description':{'type':Sequelize[_0x85d0('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x85d0('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 53d3bb2..9be130e 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x2f3b53,_0x367146){var _0x2269d8=function(_0x187b10){while(--_0x187b10){_0x2f3b53['push'](_0x2f3b53['shift']());}};_0x2269d8(++_0x367146);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','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'];(function(_0x59a542,_0x412c68){var _0x656aa3=function(_0x5aa8c4){while(--_0x5aa8c4){_0x59a542['push'](_0x59a542['shift']());}};_0x656aa3(++_0x412c68);}(_0x54ef,0x112));var _0xf54e=function(_0x4a491d,_0x2c9718){_0x4a491d=_0x4a491d-0x0;var _0x4a764c=_0x54ef[_0x4a491d];return _0x4a764c;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index ca2dd0a..49666c2 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 _0xa696=['./mailApplication.attributes','exports','define','MailApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3b1925,_0x30da91){var _0x1f3c19=function(_0x1f8389){while(--_0x1f8389){_0x3b1925['push'](_0x3b1925['shift']());}};_0x1f3c19(++_0x30da91);}(_0xa696,0x155));var _0x6a69=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xa696[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x6a69('0x0'));var util=require(_0x6a69('0x1'));var logger=require(_0x6a69('0x2'))(_0x6a69('0x3'));var moment=require(_0x6a69('0x4'));var BPromise=require(_0x6a69('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a69('0x6'));var rimraf=require(_0x6a69('0x7'));var config=require(_0x6a69('0x8'));var attributes=require(_0x6a69('0x9'));module[_0x6a69('0xa')]=function(_0x121409,_0x2c05e4){return _0x121409[_0x6a69('0xb')](_0x6a69('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a69('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x30ac=['bluebird','request-promise','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x3e1818,_0x33c70f){var _0x1593e1=function(_0x422ec4){while(--_0x422ec4){_0x3e1818['push'](_0x3e1818['shift']());}};_0x1593e1(++_0x33c70f);}(_0x30ac,0x15b));var _0xc30a=function(_0x49e6ca,_0x3fb558){_0x49e6ca=_0x49e6ca-0x0;var _0x362189=_0x30ac[_0x49e6ca];return _0x362189;};'use strict';var _=require(_0xc30a('0x0'));var util=require('util');var logger=require(_0xc30a('0x1'))(_0xc30a('0x2'));var moment=require(_0xc30a('0x3'));var BPromise=require(_0xc30a('0x4'));var rp=require(_0xc30a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc30a('0x6'));var attributes=require(_0xc30a('0x7'));module['exports']=function(_0x1bad7c,_0x5c8b37){return _0x1bad7c[_0xc30a('0x8')](_0xc30a('0x9'),attributes,{'tableName':_0xc30a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc30a('0xb'),'collate':_0xc30a('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 250fa7c..0cc24d2 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 _0x2eda=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailApplication','update','options','raw','where','attributes','limit','UpdateMailApplication','catch','lodash'];(function(_0x45385c,_0x840419){var _0x523eb1=function(_0x557e5c){while(--_0x557e5c){_0x45385c['push'](_0x45385c['shift']());}};_0x523eb1(++_0x840419);}(_0x2eda,0x9f));var _0xa2ed=function(_0xa8458,_0x3c0bdd){_0xa8458=_0xa8458-0x0;var _0x58a35a=_0x2eda[_0xa8458];return _0x58a35a;};'use strict';var _=require(_0xa2ed('0x0'));var util=require(_0xa2ed('0x1'));var moment=require(_0xa2ed('0x2'));var BPromise=require(_0xa2ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ed('0x4'));var db=require(_0xa2ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2ed('0x6'))(_0xa2ed('0x7'));var config=require(_0xa2ed('0x8'));var jayson=require(_0xa2ed('0x9'));var client=jayson[_0xa2ed('0xa')][_0xa2ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a12f3,_0x581a51,_0x1c48bb){return new BPromise(function(_0xbdfc0b,_0x4959d7){return client['request'](_0x4a12f3,_0x1c48bb)[_0xa2ed('0xc')](function(_0x18154c){logger[_0xa2ed('0xd')](_0xa2ed('0xe'),_0x581a51,_0xa2ed('0xf'));logger[_0xa2ed('0x10')](_0xa2ed('0x11'),_0x581a51,_0xa2ed('0xf'),JSON[_0xa2ed('0x12')](_0x18154c));if(_0x18154c['error']){if(_0x18154c[_0xa2ed('0x13')][_0xa2ed('0x14')]===0x1f4){logger['error'](_0xa2ed('0xe'),_0x581a51,_0x18154c['error'][_0xa2ed('0x15')]);return _0x4959d7(_0x18154c[_0xa2ed('0x13')][_0xa2ed('0x15')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x581a51,_0x18154c[_0xa2ed('0x13')]['message']);return _0xbdfc0b(_0x18154c[_0xa2ed('0x13')]['message']);}else{logger[_0xa2ed('0xd')]('MailApplication,\x20%s,\x20%s',_0x581a51,_0xa2ed('0xf'));_0xbdfc0b(_0x18154c[_0xa2ed('0x16')]['message']);}})['catch'](function(_0x3c8a83){logger['error']('MailApplication,\x20%s,\x20%s',_0x581a51,_0x3c8a83);_0x4959d7(_0x3c8a83);});});}exports['UpdateMailApplication']=function(_0x3f807f){var _0x46c8c9=this;return new Promise(function(_0x50fd64,_0x4e25d4){return db[_0xa2ed('0x17')][_0xa2ed('0x18')](_0x3f807f['body'],{'raw':_0x3f807f['options']?_0x3f807f[_0xa2ed('0x19')][_0xa2ed('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f807f[_0xa2ed('0x19')]?_0x3f807f[_0xa2ed('0x19')][_0xa2ed('0x1b')]||null:null,'attributes':_0x3f807f[_0xa2ed('0x19')]?_0x3f807f['options'][_0xa2ed('0x1c')]||null:null,'limit':_0x3f807f['options']?_0x3f807f[_0xa2ed('0x19')][_0xa2ed('0x1d')]||null:null})['then'](function(_0x286ec7){logger['info'](_0xa2ed('0x1e'),_0x3f807f);logger[_0xa2ed('0x10')](_0xa2ed('0x1e'),_0x3f807f,JSON[_0xa2ed('0x12')](_0x286ec7));_0x50fd64(_0x286ec7);})[_0xa2ed('0x1f')](function(_0x59734b){logger['error']('UpdateMailApplication',_0x59734b[_0xa2ed('0x15')],_0x3f807f);_0x4e25d4(_0x46c8c9[_0xa2ed('0x13')](0x1f4,_0x59734b[_0xa2ed('0x15')]));});});}; \ No newline at end of file +var _0x495e=['jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','update','body','options','raw','where','attributes','limit','debug','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x7514c6,_0x3635c0){var _0x3514ab=function(_0x118c2b){while(--_0x118c2b){_0x7514c6['push'](_0x7514c6['shift']());}};_0x3514ab(++_0x3635c0);}(_0x495e,0xd1));var _0xe495=function(_0x402eff,_0x2525f2){_0x402eff=_0x402eff-0x0;var _0x2eb371=_0x495e[_0x402eff];return _0x2eb371;};'use strict';var _=require(_0xe495('0x0'));var util=require(_0xe495('0x1'));var moment=require(_0xe495('0x2'));var BPromise=require(_0xe495('0x3'));var rs=require(_0xe495('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe495('0x5'))['db'];var utils=require(_0xe495('0x6'));var logger=require(_0xe495('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe495('0x8'));var client=jayson[_0xe495('0x9')][_0xe495('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220376,_0x3ff297,_0x372f06){return new BPromise(function(_0x5a1f4c,_0x474ce7){return client[_0xe495('0xb')](_0x220376,_0x372f06)[_0xe495('0xc')](function(_0x15e306){logger[_0xe495('0xd')](_0xe495('0xe'),_0x3ff297,_0xe495('0xf'));logger['debug'](_0xe495('0x10'),_0x3ff297,_0xe495('0xf'),JSON[_0xe495('0x11')](_0x15e306));if(_0x15e306[_0xe495('0x12')]){if(_0x15e306[_0xe495('0x12')][_0xe495('0x13')]===0x1f4){logger['error'](_0xe495('0xe'),_0x3ff297,_0x15e306['error']['message']);return _0x474ce7(_0x15e306[_0xe495('0x12')][_0xe495('0x14')]);}logger[_0xe495('0x12')](_0xe495('0xe'),_0x3ff297,_0x15e306[_0xe495('0x12')][_0xe495('0x14')]);return _0x5a1f4c(_0x15e306[_0xe495('0x12')][_0xe495('0x14')]);}else{logger['info'](_0xe495('0xe'),_0x3ff297,'request\x20sent');_0x5a1f4c(_0x15e306['result']['message']);}})[_0xe495('0x15')](function(_0x561425){logger['error'](_0xe495('0xe'),_0x3ff297,_0x561425);_0x474ce7(_0x561425);});});}exports['UpdateMailApplication']=function(_0x464096){var _0xa71d04=this;return new Promise(function(_0x45a374,_0x54c865){return db['MailApplication'][_0xe495('0x16')](_0x464096[_0xe495('0x17')],{'raw':_0x464096[_0xe495('0x18')]?_0x464096[_0xe495('0x18')][_0xe495('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464096[_0xe495('0x18')]?_0x464096[_0xe495('0x18')][_0xe495('0x1a')]||null:null,'attributes':_0x464096[_0xe495('0x18')]?_0x464096[_0xe495('0x18')][_0xe495('0x1b')]||null:null,'limit':_0x464096[_0xe495('0x18')]?_0x464096[_0xe495('0x18')][_0xe495('0x1c')]||null:null})[_0xe495('0xc')](function(_0x189c15){logger[_0xe495('0xd')]('UpdateMailApplication',_0x464096);logger[_0xe495('0x1d')](_0xe495('0x1e'),_0x464096,JSON[_0xe495('0x11')](_0x189c15));_0x45a374(_0x189c15);})[_0xe495('0x15')](function(_0x10c346){logger[_0xe495('0x12')](_0xe495('0x1e'),_0x10c346[_0xe495('0x14')],_0x464096);_0x54c865(_0xa71d04['error'](0x1f4,_0x10c346[_0xe495('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index dcfa9dc..0f109b9 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 _0xa00c=['index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','addTags','mail','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xa00c,0x127));var _0xca00=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa00c[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xca00('0x0'));var interaction=require(_0xca00('0x1'));var controller=require(_0xca00('0x2'));router[_0xca00('0x3')]('/',auth[_0xca00('0x4')](),controller[_0xca00('0x5')]);router[_0xca00('0x3')](_0xca00('0x6'),auth[_0xca00('0x4')](),controller[_0xca00('0x7')]);router[_0xca00('0x3')](_0xca00('0x8'),auth[_0xca00('0x4')](),controller[_0xca00('0x9')]);router[_0xca00('0x3')](_0xca00('0xa'),auth[_0xca00('0x4')](),controller[_0xca00('0xb')]);router[_0xca00('0x3')](_0xca00('0xc'),auth[_0xca00('0x4')](),controller[_0xca00('0xd')]);router[_0xca00('0xe')]('/',auth['isAuthenticated'](),controller[_0xca00('0xf')]);router[_0xca00('0xe')](_0xca00('0xa'),auth['isAuthenticated'](),controller['addMessage']);router[_0xca00('0xe')]('/:id/tags',auth[_0xca00('0x4')](),interaction[_0xca00('0x10')]('mail','mailinteraction:addtags'),controller[_0xca00('0x11')]);router['put'](_0xca00('0x8'),auth[_0xca00('0x4')](),interaction[_0xca00('0x10')](_0xca00('0x12'),_0xca00('0x13')),controller['update']);router[_0xca00('0x14')](_0xca00('0x8'),auth[_0xca00('0x4')](),interaction[_0xca00('0x10')](_0xca00('0x12'),_0xca00('0x15')),controller[_0xca00('0x16')]);router[_0xca00('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0xca00('0x17')]);module[_0xca00('0x18')]=router; \ No newline at end of file +var _0x0b34=['create','post','/:id/messages','addMessage','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express','../../components/auth/service','isAuthenticated','get','/describe','show','getMessages','download'];(function(_0x2ccb79,_0x49c215){var _0x27c181=function(_0x5a0077){while(--_0x5a0077){_0x2ccb79['push'](_0x2ccb79['shift']());}};_0x27c181(++_0x49c215);}(_0x0b34,0xde));var _0x40b3=function(_0x4056c2,_0x5f36ae){_0x4056c2=_0x4056c2-0x0;var _0x29992a=_0x0b34[_0x4056c2];return _0x29992a;};'use strict';var express=require(_0x40b3('0x0'));var router=express['Router']();var auth=require(_0x40b3('0x1'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x40b3('0x2')](),controller['index']);router[_0x40b3('0x3')](_0x40b3('0x4'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x40b3('0x2')](),controller[_0x40b3('0x5')]);router[_0x40b3('0x3')]('/:id/messages',auth[_0x40b3('0x2')](),controller[_0x40b3('0x6')]);router[_0x40b3('0x3')]('/:id/download',auth[_0x40b3('0x2')](),controller[_0x40b3('0x7')]);router['post']('/',auth[_0x40b3('0x2')](),controller[_0x40b3('0x8')]);router[_0x40b3('0x9')](_0x40b3('0xa'),auth['isAuthenticated'](),controller[_0x40b3('0xb')]);router[_0x40b3('0x9')](_0x40b3('0xc'),auth[_0x40b3('0x2')](),interaction[_0x40b3('0xd')](_0x40b3('0xe'),'mailinteraction:addtags'),controller[_0x40b3('0xf')]);router[_0x40b3('0x10')]('/:id',auth[_0x40b3('0x2')](),interaction[_0x40b3('0xd')]('mail',_0x40b3('0x11')),controller[_0x40b3('0x12')]);router[_0x40b3('0x13')]('/:id',auth[_0x40b3('0x2')](),interaction[_0x40b3('0xd')]('mail',_0x40b3('0x14')),controller['destroy']);router['delete'](_0x40b3('0xc'),auth[_0x40b3('0x2')](),controller[_0x40b3('0x15')]);module[_0x40b3('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index ec519a3..8d3f32a 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 _0x753e=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0xa085a4,_0x16e6c6){var _0x2c11cb=function(_0xf3bbd8){while(--_0xf3bbd8){_0xa085a4['push'](_0xa085a4['shift']());}};_0x2c11cb(++_0x16e6c6);}(_0x753e,0xe2));var _0xe753=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x753e[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0xe753('0x0'));var iconv=require(_0xe753('0x1'));module[_0xe753('0x2')]={'closed':{'type':Sequelize[_0xe753('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe753('0x4')]},'disposition':{'type':Sequelize[_0xe753('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe753('0x5')]},'note':{'type':Sequelize[_0xe753('0x5')]},'inReplyTo':{'type':Sequelize[_0xe753('0x5')](0x1fe)},'to':{'type':Sequelize[_0xe753('0x5')]},'cc':{'type':Sequelize[_0xe753('0x6')](_0xe753('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe753('0x4')]},'substatus':{'type':Sequelize[_0xe753('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xe753('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe753('0x8')]('in',_0xe753('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe753('0x8')]('in',_0xe753('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe753('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf243=['out','sequelize','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf243,0x181));var _0x3f24=function(_0x55deec,_0x130e1f){_0x55deec=_0x55deec-0x0;var _0x2a071a=_0xf243[_0x55deec];return _0x2a071a;};'use strict';var Sequelize=require(_0x3f24('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x3f24('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3f24('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3f24('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3f24('0x3')]},'note':{'type':Sequelize[_0x3f24('0x3')]},'inReplyTo':{'type':Sequelize[_0x3f24('0x3')](0x1fe)},'to':{'type':Sequelize[_0x3f24('0x3')]},'cc':{'type':Sequelize[_0x3f24('0x4')](_0x3f24('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x3f24('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3f24('0x2')]},'substatus':{'type':Sequelize[_0x3f24('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x3f24('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3f24('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3f24('0x6')]('in',_0x3f24('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3f24('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 31a10fc..bf6343d 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 _0x1f2d=['count','offset','limit','set','Content-Range','update','then','destroy','end','stack','name','Users','map','TagIds','Tags','split','forEach','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','waiting','talking','unmanaged','total','UserId','closed','answered','index','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','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','compact','i.MailAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','i.MailAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','push','all','rows','catch','show','params','includeAll','create','body','describe','addMessage','ids','omit','getMessages','nolimit','merge','format','options','findAll','inlineCss','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','Attachment','Attachments','bcc','subject','Messages','mkdirSync','each','decode','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','eml-format','rimraf','zip-dir','moment','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','json','undefined'];(function(_0x51388f,_0x1a1f5c){var _0xeb0b18=function(_0x3c58b6){while(--_0x3c58b6){_0x51388f['push'](_0x51388f['shift']());}};_0xeb0b18(++_0x1a1f5c);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0xd580e2,_0x109182){_0xd580e2=_0xd580e2-0x0;var _0x4d955f=_0x1f2d[_0xd580e2];return _0x4d955f;};'use strict';var emlformat=require(_0xd1f2('0x0'));var rimraf=require(_0xd1f2('0x1'));var zipdir=require(_0xd1f2('0x2'));var moment=require(_0xd1f2('0x3'));var BPromise=require('bluebird');var util=require(_0xd1f2('0x4'));var path=require(_0xd1f2('0x5'));var fs=require('fs');var _=require(_0xd1f2('0x6'));var squel=require(_0xd1f2('0x7'));var juice=require(_0xd1f2('0x8'));var Redis=require(_0xd1f2('0x9'));var qs=require(_0xd1f2('0xa'));var as=require(_0xd1f2('0xb'));var logger=require(_0xd1f2('0xc'))(_0xd1f2('0xd'));var config=require(_0xd1f2('0xe'));var db=require(_0xd1f2('0xf'))['db'];var htmlEntities=require(_0xd1f2('0x10'));config[_0xd1f2('0x11')]=_[_0xd1f2('0x12')](config[_0xd1f2('0x11')],{'host':_0xd1f2('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd1f2('0x11')]));require(_0xd1f2('0x14'))[_0xd1f2('0x15')](socket);function respondWithStatusCode(_0x2073c7,_0x48f3d7){_0x48f3d7=_0x48f3d7||0xcc;return function(_0x3f8dbc){if(_0x3f8dbc){return _0x2073c7[_0xd1f2('0x16')](_0x48f3d7);}return _0x2073c7[_0xd1f2('0x17')](_0x48f3d7)['end']();};}function respondWithResult(_0x431d75,_0x347eba){_0x347eba=_0x347eba||0xc8;return function(_0x2ef331){if(_0x2ef331){return _0x431d75[_0xd1f2('0x17')](_0x347eba)[_0xd1f2('0x18')](_0x2ef331);}};}function respondWithFilteredResult(_0x4115d4,_0x2def2b){return function(_0x596a54){if(_0x596a54){var _0x4d71d1=typeof _0x2def2b['offset']==='undefined'&&typeof _0x2def2b['limit']===_0xd1f2('0x19');var _0x1e0226=_0x596a54[_0xd1f2('0x1a')];var _0x1bd6ac=_0x4d71d1?0x0:_0x2def2b[_0xd1f2('0x1b')];var _0x3315b1=_0x4d71d1?_0x596a54[_0xd1f2('0x1a')]:_0x2def2b['offset']+_0x2def2b[_0xd1f2('0x1c')];var _0x44e9e4;if(_0x3315b1>=_0x1e0226){_0x3315b1=_0x1e0226;_0x44e9e4=0xc8;}else{_0x44e9e4=0xce;}_0x4115d4[_0xd1f2('0x17')](_0x44e9e4);return _0x4115d4[_0xd1f2('0x1d')](_0xd1f2('0x1e'),_0x1bd6ac+'-'+_0x3315b1+'/'+_0x1e0226)[_0xd1f2('0x18')](_0x596a54);}return null;};}function saveUpdates(_0x426854){return function(_0x5256a4){if(_0x5256a4){return _0x5256a4[_0xd1f2('0x1f')](_0x426854)[_0xd1f2('0x20')](function(_0x214a99){return _0x214a99;});}return null;};}function removeEntity(_0x29a817){return function(_0x1bafd8){if(_0x1bafd8){return _0x1bafd8[_0xd1f2('0x21')]()[_0xd1f2('0x20')](function(){_0x29a817[_0xd1f2('0x17')](0xcc)[_0xd1f2('0x22')]();});}};}function handleEntityNotFound(_0x3aaefd){return function(_0x8c7385){if(!_0x8c7385){_0x3aaefd['sendStatus'](0x194);}return _0x8c7385;};}function handleError(_0x3ccd12,_0x779022){_0x779022=_0x779022||0x1f4;return function(_0x510023){logger['error'](_0x510023[_0xd1f2('0x23')]);if(_0x510023[_0xd1f2('0x24')]){delete _0x510023['name'];}_0x3ccd12['status'](_0x779022)['send'](_0x510023);};}function getInteractionUsers(_0x559243,_0x512806){return new BPromise(function(_0x471406,_0x3f181b){try{if(_0x512806[_0x559243['id']]){_0x559243[_0xd1f2('0x25')]=_[_0xd1f2('0x26')](_0x512806[_0x559243['id']],function(_0x1f648a){return{'id':_0x1f648a['id'],'fullname':_0x1f648a['fullname']};});}}catch(_0xf935fc){_0x3f181b(_0xf935fc);}_0x471406(_0x559243);});}function getInteractionTags(_0x3a99b2,_0x215a8b){return new BPromise(function(_0x464b1f,_0x10f224){try{if(_0x3a99b2[_0xd1f2('0x27')]){_0x3a99b2[_0xd1f2('0x28')]=[];_0x3a99b2[_0xd1f2('0x27')][_0xd1f2('0x29')](',')[_0xd1f2('0x2a')](function(_0x3e5e6c){_0x3a99b2['Tags']['push'](_0x215a8b[_0x3e5e6c]);});}delete _0x3a99b2[_0xd1f2('0x27')];}catch(_0x409640){_0x10f224(_0x409640);}_0x464b1f(_0x3a99b2);});}function getLastMessageText(_0x4a6f05){return new BPromise(function(_0x71dd2b,_0x4ce6cd){return db[_0xd1f2('0x2b')][_0xd1f2('0x2c')]({'where':{'$and':[{'MailInteractionId':_0x4a6f05['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd1f2('0x2d')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xd1f2('0x2e'),'raw':!![]})['then'](function(_0x5f0400){if(_0x5f0400&&_0x5f0400[_0xd1f2('0x2f')]){_0x4a6f05[_0xd1f2('0x30')]=_[_0xd1f2('0x31')](_0x5f0400[_0xd1f2('0x2f')]);}_0x71dd2b(_0x4a6f05);})['catch'](function(_0x129873){_0x4ce6cd(_0x129873);});});}function updateMailInteraction(_0x5f1dca,_0x29f703,_0x412033,_0x52318a){return new BPromise(function(_0xa04d7a,_0x497c41){return getInteractionUsers(_0x5f1dca,_0x412033)[_0xd1f2('0x20')](function(_0x2ddc8a){return getInteractionTags(_0x2ddc8a,_0x29f703);})[_0xd1f2('0x20')](function(_0x31f1a1){return getStateInteraction(_0x31f1a1);})[_0xd1f2('0x20')](function(_0x1b42f7){if(_0x52318a){_0xa04d7a(getLastMessageText(_0x1b42f7));}else{_0xa04d7a(_0x1b42f7);}})['catch'](function(_0x4be71b){_0x497c41(_0x4be71b);});});}function getStateInteraction(_0x1a760a){return new BPromise(function(_0xe65fde){_0x1a760a[_0xd1f2('0x32')]=0x0;_0x1a760a[_0xd1f2('0x33')]=0x0;_0x1a760a['answered']=0x0;_0x1a760a[_0xd1f2('0x34')]=0x0;_0x1a760a[_0xd1f2('0x35')]=0x0;if(!_0x1a760a['closed']&&!_0x1a760a[_0xd1f2('0x36')]){_0x1a760a['waiting']+=0x1;}if(!_0x1a760a[_0xd1f2('0x37')]&&_0x1a760a[_0xd1f2('0x36')]){_0x1a760a[_0xd1f2('0x33')]+=0x1;if(_0x1a760a[_0xd1f2('0x32')]){_0x1a760a['waiting']-=0x1;}}if(_0x1a760a[_0xd1f2('0x37')]&&_0x1a760a[_0xd1f2('0x36')]){_0x1a760a[_0xd1f2('0x38')]+=0x1;if(_0x1a760a[_0xd1f2('0x33')]){_0x1a760a[_0xd1f2('0x33')]-=0x1;}}if(_0x1a760a[_0xd1f2('0x37')]&&!_0x1a760a[_0xd1f2('0x36')]){_0x1a760a['unmanaged']+=0x1;if(_0x1a760a[_0xd1f2('0x32')]){_0x1a760a['waiting']-=0x1;}}_0x1a760a[_0xd1f2('0x35')]+=0x1;_0xe65fde(_0x1a760a);});}exports[_0xd1f2('0x39')]=function(_0x1edc3d,_0x4a12e5){var _0x258d3f={},_0x5e4030={},_0x3e2a47={'count':0x0,'rows':[]};var _0x3aa62d=_[_0xd1f2('0x26')](db[_0xd1f2('0x3a')][_0xd1f2('0x3b')],function(_0x557f98){return{'name':_0x557f98[_0xd1f2('0x3c')],'type':_0x557f98[_0xd1f2('0x3d')]['key']};});_0x5e4030[_0xd1f2('0x3e')]=_['map'](_0x3aa62d,_0xd1f2('0x24'));_0x5e4030[_0xd1f2('0x3f')]=_[_0xd1f2('0x40')](_0x1edc3d['query']);_0x5e4030[_0xd1f2('0x41')]=_['intersection'](_0x5e4030[_0xd1f2('0x3e')],_0x5e4030[_0xd1f2('0x3f')]);_0x258d3f[_0xd1f2('0x42')]=_[_0xd1f2('0x43')](_0x5e4030[_0xd1f2('0x3e')],qs[_0xd1f2('0x44')](_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x44')]));_0x258d3f['attributes']=_0x258d3f[_0xd1f2('0x42')][_0xd1f2('0x45')]?_0x258d3f[_0xd1f2('0x42')]:_0x5e4030[_0xd1f2('0x3e')];if(!_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x46')]('nolimit')){_0x258d3f[_0xd1f2('0x1c')]=qs[_0xd1f2('0x1c')](_0x1edc3d[_0xd1f2('0x3f')]['limit']);_0x258d3f[_0xd1f2('0x1b')]=qs[_0xd1f2('0x1b')](_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x1b')]);}_0x258d3f[_0xd1f2('0x47')]=qs[_0xd1f2('0x48')](_0x1edc3d['query'][_0xd1f2('0x48')]);_0x258d3f[_0xd1f2('0x49')]=qs[_0xd1f2('0x41')](_[_0xd1f2('0x4a')](_0x1edc3d['query'],_0x5e4030[_0xd1f2('0x41')]),_0x3aa62d);var _0x35b98d=[];var _0x5aae49=squel[_0xd1f2('0x4b')]()['field']('id')[_0xd1f2('0x4c')]('name')[_0xd1f2('0x4c')](_0xd1f2('0x4d'))[_0xd1f2('0x4e')](_0xd1f2('0x4f'));var _0x2a8925=squel[_0xd1f2('0x4b')]()['field'](_0xd1f2('0x50'))[_0xd1f2('0x4c')](_0xd1f2('0x51'))[_0xd1f2('0x4c')](_0xd1f2('0x52'))['from'](_0xd1f2('0x53'),'ui')[_0xd1f2('0x54')](_0xd1f2('0x55'),'u',_0xd1f2('0x56'));var _0x3c5046=squel['select']()[_0xd1f2('0x4e')](_0xd1f2('0x57'),'i')[_0xd1f2('0x54')](_0xd1f2('0x58'),'c',_0xd1f2('0x59'))[_0xd1f2('0x54')](_0xd1f2('0x55'),'o',_0xd1f2('0x5a'))[_0xd1f2('0x54')](_0xd1f2('0x5b'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0xd1f2('0x5c'),'me',_0xd1f2('0x5d'))[_0xd1f2('0x54')](_0xd1f2('0x5e'),'it',_0xd1f2('0x5f'))['left_join'](_0xd1f2('0x4f'),'t',_0xd1f2('0x60'));var _0x4c1b0f=squel[_0xd1f2('0x61')]();var _0x3625af=[];var _0x14a73d=squel[_0xd1f2('0x61')]();var _0x5315a7;if(_0x1edc3d['query'][_0xd1f2('0x62')]){_0x5315a7=as[_0xd1f2('0x63')](_0x1edc3d['query']['search']);var _0x466ddf=_0x5315a7[_0xd1f2('0x64')];for(var _0x5567fd=0x0;_0x5567fd<_0x5315a7[_0xd1f2('0x65')][_0xd1f2('0x45')];_0x5567fd++){var _0x2c9d76=_0x5315a7[_0xd1f2('0x65')][_0x5567fd];var _0xde1643='i';var _0x34fb34=_[_0xd1f2('0x66')](_0x3aa62d,[_0xd1f2('0x24'),_0x2c9d76[_0xd1f2('0x4c')]]);if(!_0x34fb34){switch(_0x2c9d76[_0xd1f2('0x4c')]){case _0xd1f2('0x67'):if(_0x2c9d76['value']==0x1){_0x3c5046[_0xd1f2('0x68')]('`'+_0x2c9d76['field']+_0xd1f2('0x69'));}else{_0x3c5046['having']('`'+_0x2c9d76[_0xd1f2('0x4c')]+_0xd1f2('0x6a'));}break;case _0xd1f2('0x6b'):if(_0x2c9d76[_0xd1f2('0x6c')]===_0xd1f2('0x6d')){if(_0x2c9d76[_0xd1f2('0x6e')][_0xd1f2('0x29')]('\x20')[_0xd1f2('0x45')]>0x1){_0x4c1b0f[_0x466ddf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd1f2('0x6f')](_0x2c9d76[_0xd1f2('0x6e')]),null);}else{var _0x683053='%'+_0x2c9d76[_0xd1f2('0x6e')]+'%';_0x4c1b0f[_0x466ddf](_0xd1f2('0x70'),_0x683053,_0x683053,_0x683053);}}else{_0x34fb34=_[_0xd1f2('0x66')](_0x3aa62d,[_0xd1f2('0x24'),_0xd1f2('0x71')]);_0x2c9d76['field']='ContactId';_0x2c0080=as[_0xd1f2('0x72')](_0xde1643,_0x34fb34[_0xd1f2('0x3d')],_0x2c9d76);_0x4c1b0f[_0x466ddf](_0x2c0080['text'],_0x2c0080[_0xd1f2('0x6e')][_0xd1f2('0x73')],_0x2c0080['value'][_0xd1f2('0x22')]);}break;case'Tag':var _0x453c5e=_0x2c9d76[_0xd1f2('0x6e')][_0xd1f2('0x29')](',')[_0xd1f2('0x26')](function(_0x546c29){return Number(_0x546c29);});_0x453c5e['forEach'](function(_0x1857bd){_0x14a73d['or'](_0xd1f2('0x74'),'%,'+_0x1857bd+',%');});_0x3625af=_[_0xd1f2('0x75')](_0x3625af,_0x453c5e);break;case _0xd1f2('0x76'):if(_0x2c9d76[_0xd1f2('0x6c')]==='$substring'){_0x4c1b0f[_0x466ddf](_0xd1f2('0x77'),'%'+_0x2c9d76['value']+'%',null);}else{_0x34fb34=_[_0xd1f2('0x66')](_0x3aa62d,[_0xd1f2('0x24'),_0xd1f2('0x36')]);_0x2c9d76[_0xd1f2('0x4c')]=_0xd1f2('0x36');_0x2c0080=as[_0xd1f2('0x72')](_0xde1643,_0x34fb34[_0xd1f2('0x3d')],_0x2c9d76);_0x4c1b0f[_0x466ddf](_0x2c0080['text'],_0x2c0080[_0xd1f2('0x6e')][_0xd1f2('0x73')],_0x2c0080['value'][_0xd1f2('0x22')]);}break;case _0xd1f2('0x2f'):_0x2c0080=as[_0xd1f2('0x72')]('me',null,_0x2c9d76);_0x4c1b0f[_0x466ddf](_0x2c0080[_0xd1f2('0x78')],_0x2c0080[_0xd1f2('0x6e')][_0xd1f2('0x73')],_0x2c0080[_0xd1f2('0x6e')][_0xd1f2('0x22')]);break;}}else{var _0x2c0080=as[_0xd1f2('0x72')](_0xde1643,_0x34fb34[_0xd1f2('0x3d')],_0x2c9d76);_0x4c1b0f[_0x466ddf](_0x2c0080[_0xd1f2('0x78')],_0x2c0080[_0xd1f2('0x6e')]['start'],_0x2c0080['value']['end']);}}}else{var _0x3c628f=_(_0x1edc3d[_0xd1f2('0x3f')])[_0xd1f2('0x40')]()[_0xd1f2('0x26')](function(_0x32fda7){return _[_0xd1f2('0x79')](_0x3aa62d,[_0xd1f2('0x24'),_0x32fda7])?_0x32fda7:undefined;})[_0xd1f2('0x7a')]()[_0xd1f2('0x6e')]();if(!_['isEmpty'](_0x3c628f)){_0x3c628f['forEach'](function(_0x5a19a9){if(_0x5a19a9==='MailAccountId'){_0x3c5046[_0xd1f2('0x49')](_0xd1f2('0x7b'),[]['concat'](_0x1edc3d[_0xd1f2('0x3f')][_0x5a19a9]));}else if(_0x5a19a9===_0xd1f2('0x7c')){var _0x45e91d=JSON['parse'](_0x1edc3d[_0xd1f2('0x3f')][_0x5a19a9])[_0xd1f2('0x7d')];var _0x8e6d03=JSON[_0xd1f2('0x7e')](_0x1edc3d['query'][_0x5a19a9])[_0xd1f2('0x7f')];_0x3c5046['where'](_0xd1f2('0x80'),_0x45e91d,_0x8e6d03);}else{if(_0x1edc3d[_0xd1f2('0x3f')][_0x5a19a9]===_0xd1f2('0x81')){_0x3c5046[_0xd1f2('0x49')]('i.'+_0x5a19a9+'\x20IS\x20NULL');}else{_0x3c5046[_0xd1f2('0x49')]('i.'+_0x5a19a9+_0xd1f2('0x82'),_0x1edc3d[_0xd1f2('0x3f')][_0x5a19a9]);}}});}if(_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x83')]){if(_0x1edc3d['query'][_0xd1f2('0x83')]==0x1){_0x3c5046[_0xd1f2('0x68')](_0xd1f2('0x84'));}else{_0x3c5046[_0xd1f2('0x68')]('`unreadMessages`\x20>\x200');}}if(_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x85')]){_0x3625af=_[_0xd1f2('0x86')](_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x85')])?_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x85')]:new Array(_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x85')]);_0x3625af[_0xd1f2('0x2a')](function(_0xd6514c){_0x14a73d['or'](_0xd1f2('0x74'),'%,'+_0xd6514c+',%');});}if(_0x1edc3d['query'][_0xd1f2('0x87')]){var _0x91d407=_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x87')][_0xd1f2('0x88')]('\x5c','\x5c\x5c')[_0xd1f2('0x88')](/'/g,'\x27\x27');if(qs[_0xd1f2('0x89')](_0x91d407)){_0x4c1b0f['or'](_0xd1f2('0x8a'),_0x91d407+'%');}else if(qs[_0xd1f2('0x8b')](_0x91d407)){_0x4c1b0f['or'](_0xd1f2('0x8c'),_0x91d407+'%');}else{_0x4c1b0f['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd1f2('0x6f')](_0x91d407))['or'](_0xd1f2('0x8d'),qs[_0xd1f2('0x6f')](_0x91d407));}}}_0x3c5046['where'](_0x4c1b0f);_0x3c5046['group'](_0xd1f2('0x8e'));var _0x48c566={'type':db[_0xd1f2('0x8f')][_0xd1f2('0x90')]['SELECT'],'raw':!![]};var _0x58c56f=_0x3c5046['clone']();_0x58c56f[_0xd1f2('0x4c')]('i.id');_0x58c56f[_0xd1f2('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x258d3f[_0xd1f2('0x47')]){_0x258d3f[_0xd1f2('0x47')]['forEach'](function(_0x31ced5){var _0x429d40=_0x31ced5[0x0]===_0xd1f2('0x91')?_0x31ced5[0x0]:'i.'+_0x31ced5[0x0];_0x3c5046[_0xd1f2('0x47')](_0x429d40,_0x31ced5[0x1]===_0xd1f2('0x92')?![]:!![]);});}if(!_[_0xd1f2('0x93')](_0x3625af)){_0x3c5046[_0xd1f2('0x68')](_0x14a73d);_0x58c56f[_0xd1f2('0x49')](_0xd1f2('0x94'),_0x3625af);}BPromise[_0xd1f2('0x95')]()[_0xd1f2('0x20')](function(){if(!_0x5315a7){if(_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x96')])return;_0x58c56f[_0xd1f2('0x49')](_0xd1f2('0x97'));_0x3c5046[_0xd1f2('0x49')](_0xd1f2('0x97'));return;}if(_0x1edc3d[_0xd1f2('0x98')][_0xd1f2('0x99')]!=='agent')return;return _0x1edc3d[_0xd1f2('0x98')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xd1f2('0x20')](function(_0x3f454b){if(_['isEmpty'](_0x3f454b)){_0x58c56f[_0xd1f2('0x49')](_0xd1f2('0x9a'));_0x3c5046[_0xd1f2('0x49')](_0xd1f2('0x9a'));}else{_0x58c56f[_0xd1f2('0x49')](_0xd1f2('0x7b'),_[_0xd1f2('0x26')](_0x3f454b,'id'));_0x3c5046[_0xd1f2('0x49')](_0xd1f2('0x7b'),_['map'](_0x3f454b,'id'));}});})[_0xd1f2('0x20')](function(){if(_0x1edc3d[_0xd1f2('0x98')][_0xd1f2('0x99')]===_0xd1f2('0x9b')&&!_0x5315a7&&!_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x96')])return[];return db[_0xd1f2('0x9c')][_0xd1f2('0x3f')](_0x58c56f[_0xd1f2('0x9d')](),_0x48c566);})[_0xd1f2('0x20')](function(_0x40bfed){_0x3e2a47[_0xd1f2('0x1a')]=_0x40bfed[_0xd1f2('0x45')];if(_0x3e2a47['count']===0x0)return[];return db[_0xd1f2('0x9c')][_0xd1f2('0x3f')](_0x5aae49[_0xd1f2('0x9d')](),_0x48c566)[_0xd1f2('0x20')](function(_0x5c9b68){_0x35b98d=_[_0xd1f2('0x9e')](_0x5c9b68,'id');_0x48c566=_['merge'](_0x48c566,{'model':db[_0xd1f2('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1edc3d[_0xd1f2('0x3f')][_0xd1f2('0x44')]){_0x258d3f[_0xd1f2('0x42')][_0xd1f2('0x2a')](function(_0x36c4d4){_0x3c5046[_0xd1f2('0x4c')]('i.'+_0x36c4d4);});}else{_0x3c5046['field'](_0xd1f2('0x9f'),_0xd1f2('0x67'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa0'),_0xd1f2('0xa1'));_0x3c5046[_0xd1f2('0x4c')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x3c5046[_0xd1f2('0x4c')]('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');_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0x8e'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa2'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa3'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa4'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa5'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa6'));_0x3c5046['field']('i.lastMsgAt');_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa7'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa8'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xa9'));_0x3c5046[_0xd1f2('0x4c')]('i.secondDisposition');_0x3c5046['field'](_0xd1f2('0xaa'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xab'));_0x3c5046[_0xd1f2('0x4c')]('i.to');_0x3c5046['field'](_0xd1f2('0xac'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xad'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xae'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xaf'),_0xd1f2('0xb0'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xb1'),'Contact.lastName');_0x3c5046['field']('c.email',_0xd1f2('0xb2'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xb3'),_0xd1f2('0xb4'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xb5'),'Contact.mobile');_0x3c5046['field']('c.fax',_0xd1f2('0xb6'));_0x3c5046[_0xd1f2('0x4c')]('o.fullname',_0xd1f2('0xb7'));_0x3c5046[_0xd1f2('0x4c')]('o.internal',_0xd1f2('0xb8'));_0x3c5046[_0xd1f2('0x4c')](_0xd1f2('0xb9'),_0xd1f2('0x27'));}if(_0x258d3f[_0xd1f2('0x1c')])_0x3c5046[_0xd1f2('0x1c')](_0x258d3f[_0xd1f2('0x1c')]);if(_0x258d3f[_0xd1f2('0x1b')])_0x3c5046[_0xd1f2('0x1b')](_0x258d3f[_0xd1f2('0x1b')]);return db[_0xd1f2('0x9c')][_0xd1f2('0x3f')](_0x3c5046[_0xd1f2('0x9d')](),_0x48c566);})[_0xd1f2('0x20')](function(_0x331484){if(_0x331484['length']>0x0)_0x2a8925[_0xd1f2('0x49')](_0xd1f2('0xba'),_['map'](_0x331484,'id'));return db[_0xd1f2('0x9c')][_0xd1f2('0x3f')](_0x2a8925[_0xd1f2('0x9d')](),_0x48c566)[_0xd1f2('0x20')](function(_0x313ed7){var _0xaea787=_[_0xd1f2('0xbb')](_0x313ed7,'MailInteractionId');var _0x372c2a=[];return db[_0xd1f2('0xbc')][_0xd1f2('0x2c')]({'attributes':[_0xd1f2('0xbd')],'raw':!![]})[_0xd1f2('0x20')](function(_0x4de5a8){var _0x2412a0=_0x4de5a8['enableEmailPreview'];_0x331484['forEach'](function(_0x280701){_0x372c2a[_0xd1f2('0xbe')](updateMailInteraction(_0x280701,_0x35b98d,_0xaea787,_0x2412a0));});return BPromise[_0xd1f2('0xbf')](_0x372c2a);});});});})[_0xd1f2('0x20')](function(_0x24412d){_0x3e2a47[_0xd1f2('0xc0')]=_0x24412d;return _0x3e2a47;})[_0xd1f2('0x20')](respondWithFilteredResult(_0x4a12e5,_0x258d3f))[_0xd1f2('0xc1')](handleError(_0x4a12e5,null));};exports[_0xd1f2('0xc2')]=function(_0x1332eb,_0x1b95f9){var _0x7df6ca={'raw':![],'where':{'id':_0x1332eb[_0xd1f2('0xc3')]['id']}},_0x575e8d={};_0x575e8d[_0xd1f2('0x3e')]=_[_0xd1f2('0x40')](db[_0xd1f2('0x3a')][_0xd1f2('0x3b')]);_0x575e8d[_0xd1f2('0x3f')]=_[_0xd1f2('0x40')](_0x1332eb[_0xd1f2('0x3f')]);_0x575e8d['filters']=_['intersection'](_0x575e8d['model'],_0x575e8d[_0xd1f2('0x3f')]);_0x7df6ca[_0xd1f2('0x42')]=_[_0xd1f2('0x43')](_0x575e8d[_0xd1f2('0x3e')],qs[_0xd1f2('0x44')](_0x1332eb['query'][_0xd1f2('0x44')]));_0x7df6ca['attributes']=_0x7df6ca['attributes'][_0xd1f2('0x45')]?_0x7df6ca[_0xd1f2('0x42')]:_0x575e8d[_0xd1f2('0x3e')];if(_0x1332eb[_0xd1f2('0x3f')][_0xd1f2('0xc4')]){_0x7df6ca['include']=[{'all':!![]}];}_0x7df6ca=_['merge']({},_0x7df6ca,_0x1332eb['options']);return db[_0xd1f2('0x3a')]['find'](_0x7df6ca)[_0xd1f2('0x20')](handleEntityNotFound(_0x1b95f9,null))['then'](respondWithResult(_0x1b95f9,null))[_0xd1f2('0xc1')](handleError(_0x1b95f9,null));};exports[_0xd1f2('0xc5')]=function(_0x50298f,_0x4b81d){return db[_0xd1f2('0x3a')][_0xd1f2('0xc5')](_0x50298f['body'],{})[_0xd1f2('0x20')](respondWithResult(_0x4b81d,0xc9))[_0xd1f2('0xc1')](handleError(_0x4b81d,null));};exports[_0xd1f2('0x1f')]=function(_0x2325f4,_0x32aca5){if(_0x2325f4[_0xd1f2('0xc6')]['id']){delete _0x2325f4[_0xd1f2('0xc6')]['id'];}return db['MailInteraction'][_0xd1f2('0x66')]({'where':{'id':_0x2325f4['params']['id']}})[_0xd1f2('0x20')](handleEntityNotFound(_0x32aca5,null))[_0xd1f2('0x20')](saveUpdates(_0x2325f4['body'],null))[_0xd1f2('0x20')](respondWithResult(_0x32aca5,null))['catch'](handleError(_0x32aca5,null));};exports[_0xd1f2('0x21')]=function(_0x4a3575,_0x3e5b9a){return db[_0xd1f2('0x3a')][_0xd1f2('0x66')]({'where':{'id':_0x4a3575[_0xd1f2('0xc3')]['id']}})[_0xd1f2('0x20')](handleEntityNotFound(_0x3e5b9a,null))[_0xd1f2('0x20')](removeEntity(_0x3e5b9a,null))[_0xd1f2('0xc1')](handleError(_0x3e5b9a,null));};exports['describe']=function(_0xe9f916,_0x2d6e31){return db[_0xd1f2('0x3a')][_0xd1f2('0xc7')]()['then'](respondWithResult(_0x2d6e31,null))['catch'](handleError(_0x2d6e31,null));};exports[_0xd1f2('0xc8')]=function(_0x1b04cb,_0xbae51d){return db[_0xd1f2('0x2b')][_0xd1f2('0x66')]({'where':{'id':_0x1b04cb['params']['id']}})[_0xd1f2('0x20')](handleEntityNotFound(_0xbae51d,null))[_0xd1f2('0x20')](function(_0x992102){if(_0x992102){return _0x992102[_0xd1f2('0xc8')](_0x1b04cb[_0xd1f2('0xc6')][_0xd1f2('0xc9')],_[_0xd1f2('0xca')](_0x1b04cb[_0xd1f2('0xc6')],[_0xd1f2('0xc9'),'id'])||{});}})['then'](respondWithResult(_0xbae51d,null))[_0xd1f2('0xc1')](handleError(_0xbae51d,null));};exports[_0xd1f2('0xcb')]=function(_0x3228c5,_0x592e4f){var _0x41434e={'raw':![],'where':{}};var _0x50b846={};var _0x13fd72={'count':0x0,'rows':[]};return db[_0xd1f2('0x3a')][_0xd1f2('0x2c')]({'where':{'id':_0x3228c5[_0xd1f2('0xc3')]['id']}})[_0xd1f2('0x20')](handleEntityNotFound(_0x592e4f,null))[_0xd1f2('0x20')](function(_0x468bd8){if(_0x468bd8){_0x50b846[_0xd1f2('0x3e')]=_[_0xd1f2('0x40')](db[_0xd1f2('0x2b')][_0xd1f2('0x3b')]);_0x50b846[_0xd1f2('0x3f')]=_[_0xd1f2('0x40')](_0x3228c5[_0xd1f2('0x3f')]);_0x50b846[_0xd1f2('0x41')]=_['intersection'](_0x50b846[_0xd1f2('0x3e')],_0x50b846[_0xd1f2('0x3f')]);_0x41434e[_0xd1f2('0x42')]=_[_0xd1f2('0x43')](_0x50b846[_0xd1f2('0x3e')],qs[_0xd1f2('0x44')](_0x3228c5[_0xd1f2('0x3f')][_0xd1f2('0x44')]));_0x41434e[_0xd1f2('0x42')]=_0x41434e[_0xd1f2('0x42')][_0xd1f2('0x45')]?_0x41434e[_0xd1f2('0x42')]:_0x50b846[_0xd1f2('0x3e')];if(!_0x3228c5['query'][_0xd1f2('0x46')](_0xd1f2('0xcc'))){_0x41434e[_0xd1f2('0x1c')]=qs[_0xd1f2('0x1c')](_0x3228c5[_0xd1f2('0x3f')][_0xd1f2('0x1c')]);_0x41434e[_0xd1f2('0x1b')]=qs[_0xd1f2('0x1b')](_0x3228c5['query']['offset']);}_0x41434e[_0xd1f2('0x47')]=qs[_0xd1f2('0x48')](_0x3228c5[_0xd1f2('0x3f')][_0xd1f2('0x48')]);_0x41434e[_0xd1f2('0x49')]=qs[_0xd1f2('0x41')](_[_0xd1f2('0x4a')](_0x3228c5[_0xd1f2('0x3f')],_0x50b846[_0xd1f2('0x41')]));_0x41434e[_0xd1f2('0x49')]['MailInteractionId']=_0x468bd8['id'];if(_0x3228c5[_0xd1f2('0x3f')]['filter']){_0x41434e[_0xd1f2('0x49')]=_[_0xd1f2('0xcd')](_0x41434e['where'],{'$or':_[_0xd1f2('0x26')](_0x41434e[_0xd1f2('0x42')],function(_0x1524a4){var _0x387721={};_0x387721[_0x1524a4]={'$like':'%'+_0x3228c5[_0xd1f2('0x3f')][_0xd1f2('0x87')]+'%'};return _0x387721;})});}if(_0x3228c5[_0xd1f2('0x3f')][_0xd1f2('0x7d')]){var _0x539e12=_0x3228c5[_0xd1f2('0x3f')]['$gte']['split'](',');var _0x4862df={};_0x4862df[_0x539e12[0x0]]={'$gte':moment(_0x539e12[0x1])[_0xd1f2('0xce')]('YYYY-MM-DD\x20HH:mm:ss')};_0x41434e[_0xd1f2('0x49')]=_[_0xd1f2('0xcd')](_0x41434e[_0xd1f2('0x49')],_0x4862df);}_0x41434e=_['merge']({},_0x41434e,_0x3228c5[_0xd1f2('0xcf')]);return db[_0xd1f2('0x2b')][_0xd1f2('0x1a')]({'where':_0x41434e[_0xd1f2('0x49')]})[_0xd1f2('0x20')](function(_0x44b81c){_0x13fd72[_0xd1f2('0x1a')]=_0x44b81c;if(_0x3228c5[_0xd1f2('0x3f')][_0xd1f2('0xc4')]){_0x41434e['include']=[{'all':!![]}];}return db[_0xd1f2('0x2b')][_0xd1f2('0xd0')](_0x41434e);})[_0xd1f2('0x20')](function(_0x4a8a2a){if(_0x3228c5['query'][_0xd1f2('0xd1')]==='true'){for(var _0x58a094=0x0;_0x58a094<_0x4a8a2a['length'];_0x58a094++){_0x4a8a2a[_0x58a094]['body']=juice(_0x4a8a2a[_0x58a094][_0xd1f2('0xc6')]);}}_0x13fd72['rows']=_0x4a8a2a;return _0x13fd72;});}})[_0xd1f2('0x20')](respondWithFilteredResult(_0x592e4f,_0x41434e))[_0xd1f2('0xc1')](handleError(_0x592e4f,null));};exports[_0xd1f2('0xd2')]=function(_0x313c42,_0x52361e){return db['MailInteraction'][_0xd1f2('0x66')]({'where':{'id':_0x313c42[_0xd1f2('0xc3')]['id']}})[_0xd1f2('0x20')](handleEntityNotFound(_0x52361e,null))[_0xd1f2('0x20')](function(_0x31d64c){if(_0x31d64c){return _0x31d64c[_0xd1f2('0xd3')](_0x313c42[_0xd1f2('0xc6')]['ids'],_[_0xd1f2('0xca')](_0x313c42[_0xd1f2('0xc6')],[_0xd1f2('0xc9'),'id'])||{})[_0xd1f2('0xd4')](function(){return db[_0xd1f2('0xd5')]['findAll']({'attributes':['id',_0xd1f2('0x24'),_0xd1f2('0x4d')],'where':{'id':_0x313c42[_0xd1f2('0xc6')][_0xd1f2('0xc9')]}});})[_0xd1f2('0x20')](function(_0x1ef6f2){socket[_0xd1f2('0xd6')](_0xd1f2('0xd7'),{'id':Number(_0x313c42[_0xd1f2('0xc3')]['id']),'tags':_0x1ef6f2||[]});return{'id':Number(_0x313c42[_0xd1f2('0xc3')]['id']),'tags':_0x1ef6f2||[]};});}})[_0xd1f2('0x20')](respondWithResult(_0x52361e,null))[_0xd1f2('0xc1')](handleError(_0x52361e,null));};exports[_0xd1f2('0xd8')]=function(_0x431d34,_0xbd53b7){return db['MailInteraction'][_0xd1f2('0x66')]({'where':{'id':_0x431d34[_0xd1f2('0xc3')]['id']}})['then'](handleEntityNotFound(_0xbd53b7,null))['then'](function(_0x1c1ad9){if(_0x1c1ad9){return _0x1c1ad9[_0xd1f2('0xd8')](_0x431d34[_0xd1f2('0x3f')][_0xd1f2('0xc9')]);}})[_0xd1f2('0x20')](respondWithStatusCode(_0xbd53b7,null))[_0xd1f2('0xc1')](handleError(_0xbd53b7,null));};exports[_0xd1f2('0xd9')]=function(_0x1f0543,_0x37dd8b){var _0xbd6d2c=moment()[_0xd1f2('0xda')]()['toString']();var _0x19343b=path[_0xd1f2('0xdb')](config[_0xd1f2('0xdc')],_0xd1f2('0xdd'),_0xd1f2('0xde'),_0xd1f2('0xdf'));var _0x41c8f5=path[_0xd1f2('0xdb')](config['root'],_0xd1f2('0xdd'),_0xd1f2('0xde'),'attachments');var _0x5a0d90=path['join'](_0x19343b,_0xbd6d2c);var _0x2c423a=util[_0xd1f2('0xce')]('transcript-%d-%s.zip',_0x1f0543[_0xd1f2('0xc3')]['id'],_0xbd6d2c);var _0x474e47=path['join'](_0x19343b,_0x2c423a);var _0x55ba4d=[];if(_0x1f0543['query']['attachments']){_0x55ba4d[_0xd1f2('0xbe')]({'model':db[_0xd1f2('0xe0')],'as':_0xd1f2('0xe1'),'raw':!![]});}var _0x580ca9=[{'model':db[_0xd1f2('0x2b')],'as':'Messages','attributes':['id','body',_0xd1f2('0x4e'),'to','cc',_0xd1f2('0xe2'),_0xd1f2('0xe3'),_0xd1f2('0x7c')],'where':{'secret':![]},'order':qs[_0xd1f2('0x48')]('id'),'include':_0x55ba4d}];return db[_0xd1f2('0x3a')][_0xd1f2('0x66')]({'where':{'id':_0x1f0543[_0xd1f2('0xc3')]['id']},'include':_0x580ca9})[_0xd1f2('0x20')](handleEntityNotFound(_0x37dd8b,null))[_0xd1f2('0x20')](function(_0x1ff8fc){if(_0x1ff8fc&&_0x1ff8fc[_0xd1f2('0xe4')]){var _0x4e4383=_0x1ff8fc['get']({'plain':!![]});fs[_0xd1f2('0xe5')](_0x5a0d90);return BPromise[_0xd1f2('0xe6')](_0x4e4383[_0xd1f2('0xe4')],function(_0x118f14,_0x5f4337){var _0x50958e={'from':_0x118f14[_0xd1f2('0x4e')],'to':_0x118f14['to'],'subject':_0x118f14[_0xd1f2('0xe3')],'html':htmlEntities[_0xd1f2('0xe7')](_0x118f14[_0xd1f2('0xc6')]),'headers':{'Date':moment(_0x118f14[_0xd1f2('0x7c')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x118f14['cc']){_0x50958e['headers']['Cc']=_0x118f14['cc'];}if(_0x118f14[_0xd1f2('0xe2')]){_0x50958e[_0xd1f2('0xe8')][_0xd1f2('0xe9')]=_0x118f14['bcc'];}return new BPromise(function(_0x3da64f,_0x3ecb68){if(_0x118f14[_0xd1f2('0xe1')]){for(var _0x2beaa6=0x0;_0x2beaa6<_0x118f14[_0xd1f2('0xe1')]['length'];_0x2beaa6++){var _0x5d6205=_0x118f14[_0xd1f2('0xe1')][_0x2beaa6];var _0xae9e91=path[_0xd1f2('0xdb')](_0x41c8f5,_0x5d6205[_0xd1f2('0xea')]);if(fs[_0xd1f2('0xeb')](_0xae9e91)){_0x50958e['attachments'][_0xd1f2('0xbe')]({'name':_0x5d6205['name'],'contentType':_0x5d6205[_0xd1f2('0x3d')],'data':fs['readFileSync'](_0xae9e91)});}}}emlformat[_0xd1f2('0xec')](_0x50958e,function(_0x5dddfd,_0x5104a4){if(_0x5dddfd)return _0x3ecb68(_0x5dddfd);fs[_0xd1f2('0xed')](path[_0xd1f2('0xdb')](_0x5a0d90,util['format'](_0xd1f2('0xee'),_0x5f4337)),_0x5104a4);return _0x3da64f(_0x5104a4);});});})[_0xd1f2('0x20')](function(){return new BPromise(function(_0x441b6d,_0x44354d){zipdir(_0x5a0d90,{'saveTo':_0x474e47},function(_0x34ef42,_0x2b1216){if(_0x34ef42)return _0x44354d(_0x34ef42);return _0x441b6d(_0x2b1216);});})[_0xd1f2('0x20')](function(){return new BPromise(function(_0x231316,_0x11b568){rimraf(_0x5a0d90,function(_0x4f318a){if(_0x4f318a)_0x11b568(_0x4f318a);return _0x231316();});});})['then'](function(){return _0x37dd8b[_0xd1f2('0xd9')](_0x474e47,_0x2c423a,function(_0x40edbd){if(!_0x40edbd)fs['unlinkSync'](_0x474e47);});});});}else{return _0x37dd8b['sendStatus'](0xc8);}})[_0xd1f2('0xc1')](handleError(_0x37dd8b,null));}; \ No newline at end of file +var _0x5f6f=['inlineCss','addTags','setTags','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','get','mkdirSync','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','plainBody','lastMsgText','catch','waiting','talking','answered','total','closed','UserId','map','MailInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','rawAttributes','includeAll','create','body','params','describe','addMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x1f3c2c,_0x1ee1da){_0x1f3c2c=_0x1f3c2c-0x0;var _0x2a5c44=_0x5f6f[_0x1f3c2c];return _0x2a5c44;};'use strict';var emlformat=require(_0xf5f6('0x0'));var rimraf=require(_0xf5f6('0x1'));var zipdir=require(_0xf5f6('0x2'));var moment=require(_0xf5f6('0x3'));var BPromise=require(_0xf5f6('0x4'));var util=require('util');var path=require(_0xf5f6('0x5'));var fs=require('fs');var _=require(_0xf5f6('0x6'));var squel=require(_0xf5f6('0x7'));var juice=require('juice');var Redis=require(_0xf5f6('0x8'));var qs=require(_0xf5f6('0x9'));var as=require(_0xf5f6('0xa'));var logger=require(_0xf5f6('0xb'))('api');var config=require('../../config/environment');var db=require(_0xf5f6('0xc'))['db'];var htmlEntities=require(_0xf5f6('0xd'));config[_0xf5f6('0xe')]=_[_0xf5f6('0xf')](config[_0xf5f6('0xe')],{'host':_0xf5f6('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf5f6('0x11'))[_0xf5f6('0x12')](socket);function respondWithStatusCode(_0x491c14,_0x208fa1){_0x208fa1=_0x208fa1||0xcc;return function(_0x44a319){if(_0x44a319){return _0x491c14[_0xf5f6('0x13')](_0x208fa1);}return _0x491c14[_0xf5f6('0x14')](_0x208fa1)[_0xf5f6('0x15')]();};}function respondWithResult(_0x5e83d5,_0x3b407d){_0x3b407d=_0x3b407d||0xc8;return function(_0x4cde56){if(_0x4cde56){return _0x5e83d5[_0xf5f6('0x14')](_0x3b407d)[_0xf5f6('0x16')](_0x4cde56);}};}function respondWithFilteredResult(_0x1441ae,_0x3e056c){return function(_0x52648d){if(_0x52648d){var _0x96661c=typeof _0x3e056c[_0xf5f6('0x17')]===_0xf5f6('0x18')&&typeof _0x3e056c[_0xf5f6('0x19')]==='undefined';var _0x1e3037=_0x52648d[_0xf5f6('0x1a')];var _0x21ccf7=_0x96661c?0x0:_0x3e056c[_0xf5f6('0x17')];var _0x4be660=_0x96661c?_0x52648d['count']:_0x3e056c[_0xf5f6('0x17')]+_0x3e056c['limit'];var _0xa154c6;if(_0x4be660>=_0x1e3037){_0x4be660=_0x1e3037;_0xa154c6=0xc8;}else{_0xa154c6=0xce;}_0x1441ae['status'](_0xa154c6);return _0x1441ae[_0xf5f6('0x1b')](_0xf5f6('0x1c'),_0x21ccf7+'-'+_0x4be660+'/'+_0x1e3037)[_0xf5f6('0x16')](_0x52648d);}return null;};}function saveUpdates(_0x301e2a){return function(_0x20aa6e){if(_0x20aa6e){return _0x20aa6e[_0xf5f6('0x1d')](_0x301e2a)['then'](function(_0x594162){return _0x594162;});}return null;};}function removeEntity(_0x3ada74){return function(_0x332761){if(_0x332761){return _0x332761[_0xf5f6('0x1e')]()[_0xf5f6('0x1f')](function(){_0x3ada74['status'](0xcc)[_0xf5f6('0x15')]();});}};}function handleEntityNotFound(_0x444856){return function(_0x22e569){if(!_0x22e569){_0x444856['sendStatus'](0x194);}return _0x22e569;};}function handleError(_0x253b42,_0x32f27e){_0x32f27e=_0x32f27e||0x1f4;return function(_0x1a6fc3){logger[_0xf5f6('0x20')](_0x1a6fc3[_0xf5f6('0x21')]);if(_0x1a6fc3['name']){delete _0x1a6fc3[_0xf5f6('0x22')];}_0x253b42[_0xf5f6('0x14')](_0x32f27e)[_0xf5f6('0x23')](_0x1a6fc3);};}function getInteractionUsers(_0x535d4b,_0x31d0fb){return new BPromise(function(_0x3497a0,_0x9500e5){try{if(_0x31d0fb[_0x535d4b['id']]){_0x535d4b['Users']=_['map'](_0x31d0fb[_0x535d4b['id']],function(_0x3e728d){return{'id':_0x3e728d['id'],'fullname':_0x3e728d[_0xf5f6('0x24')]};});}}catch(_0x23ed8c){_0x9500e5(_0x23ed8c);}_0x3497a0(_0x535d4b);});}function getInteractionTags(_0x265457,_0x55d9ec){return new BPromise(function(_0xb2fab7,_0x345242){try{if(_0x265457['TagIds']){_0x265457[_0xf5f6('0x25')]=[];_0x265457['TagIds'][_0xf5f6('0x26')](',')[_0xf5f6('0x27')](function(_0x4b56f7){_0x265457[_0xf5f6('0x25')][_0xf5f6('0x28')](_0x55d9ec[_0x4b56f7]);});}delete _0x265457[_0xf5f6('0x29')];}catch(_0x1e6cf2){_0x345242(_0x1e6cf2);}_0xb2fab7(_0x265457);});}function getLastMessageText(_0x5835ed){return new BPromise(function(_0x14939a,_0x58f320){return db[_0xf5f6('0x2a')][_0xf5f6('0x2b')]({'where':{'$and':[{'MailInteractionId':_0x5835ed['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf5f6('0x2c')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf5f6('0x2d')],'order':'-id','raw':!![]})[_0xf5f6('0x1f')](function(_0x5166d6){if(_0x5166d6&&_0x5166d6[_0xf5f6('0x2d')]){_0x5835ed[_0xf5f6('0x2e')]=_['trimStart'](_0x5166d6[_0xf5f6('0x2d')]);}_0x14939a(_0x5835ed);})[_0xf5f6('0x2f')](function(_0x13a87c){_0x58f320(_0x13a87c);});});}function updateMailInteraction(_0x3fd504,_0x32d47b,_0x2cb3a5,_0x36507a){return new BPromise(function(_0x481495,_0x407554){return getInteractionUsers(_0x3fd504,_0x2cb3a5)['then'](function(_0x2620ff){return getInteractionTags(_0x2620ff,_0x32d47b);})[_0xf5f6('0x1f')](function(_0x4a89e6){return getStateInteraction(_0x4a89e6);})['then'](function(_0x929445){if(_0x36507a){_0x481495(getLastMessageText(_0x929445));}else{_0x481495(_0x929445);}})[_0xf5f6('0x2f')](function(_0x1dc325){_0x407554(_0x1dc325);});});}function getStateInteraction(_0x22ccce){return new BPromise(function(_0x1837ed){_0x22ccce[_0xf5f6('0x30')]=0x0;_0x22ccce[_0xf5f6('0x31')]=0x0;_0x22ccce[_0xf5f6('0x32')]=0x0;_0x22ccce['unmanaged']=0x0;_0x22ccce[_0xf5f6('0x33')]=0x0;if(!_0x22ccce[_0xf5f6('0x34')]&&!_0x22ccce[_0xf5f6('0x35')]){_0x22ccce['waiting']+=0x1;}if(!_0x22ccce['closed']&&_0x22ccce[_0xf5f6('0x35')]){_0x22ccce['talking']+=0x1;if(_0x22ccce['waiting']){_0x22ccce[_0xf5f6('0x30')]-=0x1;}}if(_0x22ccce[_0xf5f6('0x34')]&&_0x22ccce[_0xf5f6('0x35')]){_0x22ccce['answered']+=0x1;if(_0x22ccce[_0xf5f6('0x31')]){_0x22ccce[_0xf5f6('0x31')]-=0x1;}}if(_0x22ccce['closed']&&!_0x22ccce[_0xf5f6('0x35')]){_0x22ccce['unmanaged']+=0x1;if(_0x22ccce['waiting']){_0x22ccce[_0xf5f6('0x30')]-=0x1;}}_0x22ccce['total']+=0x1;_0x1837ed(_0x22ccce);});}exports['index']=function(_0x3dec2d,_0x289a7d){var _0xd8711e={},_0x5760f6={},_0x53a134={'count':0x0,'rows':[]};var _0x2e7742=_[_0xf5f6('0x36')](db[_0xf5f6('0x37')]['rawAttributes'],function(_0x318840){return{'name':_0x318840[_0xf5f6('0x38')],'type':_0x318840[_0xf5f6('0x39')][_0xf5f6('0x3a')]};});_0x5760f6[_0xf5f6('0x3b')]=_[_0xf5f6('0x36')](_0x2e7742,_0xf5f6('0x22'));_0x5760f6[_0xf5f6('0x3c')]=_[_0xf5f6('0x3d')](_0x3dec2d['query']);_0x5760f6[_0xf5f6('0x3e')]=_[_0xf5f6('0x3f')](_0x5760f6[_0xf5f6('0x3b')],_0x5760f6[_0xf5f6('0x3c')]);_0xd8711e[_0xf5f6('0x40')]=_[_0xf5f6('0x3f')](_0x5760f6[_0xf5f6('0x3b')],qs[_0xf5f6('0x41')](_0x3dec2d[_0xf5f6('0x3c')][_0xf5f6('0x41')]));_0xd8711e[_0xf5f6('0x40')]=_0xd8711e['attributes'][_0xf5f6('0x42')]?_0xd8711e[_0xf5f6('0x40')]:_0x5760f6[_0xf5f6('0x3b')];if(!_0x3dec2d['query'][_0xf5f6('0x43')](_0xf5f6('0x44'))){_0xd8711e['limit']=qs[_0xf5f6('0x19')](_0x3dec2d['query']['limit']);_0xd8711e[_0xf5f6('0x17')]=qs[_0xf5f6('0x17')](_0x3dec2d[_0xf5f6('0x3c')]['offset']);}_0xd8711e[_0xf5f6('0x45')]=qs[_0xf5f6('0x46')](_0x3dec2d[_0xf5f6('0x3c')]['sort']);_0xd8711e[_0xf5f6('0x47')]=qs['filters'](_[_0xf5f6('0x48')](_0x3dec2d['query'],_0x5760f6[_0xf5f6('0x3e')]),_0x2e7742);var _0x36dc5a=[];var _0x25893b=squel[_0xf5f6('0x49')]()[_0xf5f6('0x4a')]('id')['field']('name')[_0xf5f6('0x4a')]('color')[_0xf5f6('0x4b')](_0xf5f6('0x4c'));var _0x2f5d54=squel['select']()[_0xf5f6('0x4a')](_0xf5f6('0x4d'))[_0xf5f6('0x4a')](_0xf5f6('0x4e'))[_0xf5f6('0x4a')](_0xf5f6('0x4f'))['from'](_0xf5f6('0x50'),'ui')[_0xf5f6('0x51')]('users','u',_0xf5f6('0x52'));var _0x8c09ff=squel[_0xf5f6('0x49')]()[_0xf5f6('0x4b')](_0xf5f6('0x53'),'i')[_0xf5f6('0x51')](_0xf5f6('0x54'),'c',_0xf5f6('0x55'))['left_join'](_0xf5f6('0x56'),'o','o.id\x20=\x20i.UserId')[_0xf5f6('0x51')](_0xf5f6('0x57'),'a',_0xf5f6('0x58'))['left_join'](_0xf5f6('0x59'),'me',_0xf5f6('0x5a'))[_0xf5f6('0x51')]('mail_interaction_has_tags','it',_0xf5f6('0x5b'))[_0xf5f6('0x51')](_0xf5f6('0x4c'),'t',_0xf5f6('0x5c'));var _0x24de8f=squel[_0xf5f6('0x5d')]();var _0x30940d=[];var _0x5436ef=squel[_0xf5f6('0x5d')]();var _0x12afc9;if(_0x3dec2d[_0xf5f6('0x3c')]['search']){_0x12afc9=as[_0xf5f6('0x5e')](_0x3dec2d['query'][_0xf5f6('0x5f')]);var _0x3aba44=_0x12afc9[_0xf5f6('0x60')];for(var _0x1295ab=0x0;_0x1295ab<_0x12afc9[_0xf5f6('0x61')][_0xf5f6('0x42')];_0x1295ab++){var _0x3ce17d=_0x12afc9[_0xf5f6('0x61')][_0x1295ab];var _0x986e43='i';var _0x26ab99=_[_0xf5f6('0x62')](_0x2e7742,[_0xf5f6('0x22'),_0x3ce17d[_0xf5f6('0x4a')]]);if(!_0x26ab99){switch(_0x3ce17d[_0xf5f6('0x4a')]){case _0xf5f6('0x63'):if(_0x3ce17d[_0xf5f6('0x64')]==0x1){_0x8c09ff[_0xf5f6('0x65')]('`'+_0x3ce17d[_0xf5f6('0x4a')]+'`\x20=\x200');}else{_0x8c09ff['having']('`'+_0x3ce17d[_0xf5f6('0x4a')]+_0xf5f6('0x66'));}break;case'Contact':if(_0x3ce17d['operator']===_0xf5f6('0x67')){if(_0x3ce17d[_0xf5f6('0x64')][_0xf5f6('0x26')]('\x20')[_0xf5f6('0x42')]>0x1){_0x24de8f[_0x3aba44](_0xf5f6('0x68'),qs[_0xf5f6('0x69')](_0x3ce17d[_0xf5f6('0x64')]),null);}else{var _0x45b552='%'+_0x3ce17d[_0xf5f6('0x64')]+'%';_0x24de8f[_0x3aba44](_0xf5f6('0x6a'),_0x45b552,_0x45b552,_0x45b552);}}else{_0x26ab99=_[_0xf5f6('0x62')](_0x2e7742,[_0xf5f6('0x22'),'ContactId']);_0x3ce17d[_0xf5f6('0x4a')]=_0xf5f6('0x6b');_0x3b8f0b=as[_0xf5f6('0x6c')](_0x986e43,_0x26ab99[_0xf5f6('0x39')],_0x3ce17d);_0x24de8f[_0x3aba44](_0x3b8f0b[_0xf5f6('0x6d')],_0x3b8f0b[_0xf5f6('0x64')][_0xf5f6('0x6e')],_0x3b8f0b[_0xf5f6('0x64')]['end']);}break;case _0xf5f6('0x6f'):var _0x595d5c=_0x3ce17d['value'][_0xf5f6('0x26')](',')['map'](function(_0x1c209d){return Number(_0x1c209d);});_0x595d5c['forEach'](function(_0x1919ee){_0x5436ef['or'](_0xf5f6('0x70'),'%,'+_0x1919ee+',%');});_0x30940d=_[_0xf5f6('0x71')](_0x30940d,_0x595d5c);break;case _0xf5f6('0x72'):if(_0x3ce17d[_0xf5f6('0x73')]==='$substring'){_0x24de8f[_0x3aba44](_0xf5f6('0x74'),'%'+_0x3ce17d[_0xf5f6('0x64')]+'%',null);}else{_0x26ab99=_[_0xf5f6('0x62')](_0x2e7742,[_0xf5f6('0x22'),_0xf5f6('0x35')]);_0x3ce17d[_0xf5f6('0x4a')]=_0xf5f6('0x35');_0x3b8f0b=as[_0xf5f6('0x6c')](_0x986e43,_0x26ab99['type'],_0x3ce17d);_0x24de8f[_0x3aba44](_0x3b8f0b[_0xf5f6('0x6d')],_0x3b8f0b[_0xf5f6('0x64')][_0xf5f6('0x6e')],_0x3b8f0b[_0xf5f6('0x64')][_0xf5f6('0x15')]);}break;case _0xf5f6('0x2d'):_0x3b8f0b=as[_0xf5f6('0x6c')]('me',null,_0x3ce17d);_0x24de8f[_0x3aba44](_0x3b8f0b[_0xf5f6('0x6d')],_0x3b8f0b[_0xf5f6('0x64')][_0xf5f6('0x6e')],_0x3b8f0b[_0xf5f6('0x64')]['end']);break;}}else{var _0x3b8f0b=as['buildExpression'](_0x986e43,_0x26ab99[_0xf5f6('0x39')],_0x3ce17d);_0x24de8f[_0x3aba44](_0x3b8f0b[_0xf5f6('0x6d')],_0x3b8f0b['value'][_0xf5f6('0x6e')],_0x3b8f0b['value'][_0xf5f6('0x15')]);}}}else{var _0x1affb5=_(_0x3dec2d['query'])[_0xf5f6('0x3d')]()[_0xf5f6('0x36')](function(_0x2f964a){return _[_0xf5f6('0x75')](_0x2e7742,['name',_0x2f964a])?_0x2f964a:undefined;})[_0xf5f6('0x76')]()['value']();if(!_['isEmpty'](_0x1affb5)){_0x1affb5[_0xf5f6('0x27')](function(_0x20f052){if(_0x20f052===_0xf5f6('0x77')){_0x8c09ff['where'](_0xf5f6('0x78'),[][_0xf5f6('0x79')](_0x3dec2d['query'][_0x20f052]));}else if(_0x20f052==='createdAt'){var _0x3fd8c2=JSON[_0xf5f6('0x7a')](_0x3dec2d[_0xf5f6('0x3c')][_0x20f052])[_0xf5f6('0x7b')];var _0x573547=JSON['parse'](_0x3dec2d[_0xf5f6('0x3c')][_0x20f052])[_0xf5f6('0x7c')];_0x8c09ff['where'](_0xf5f6('0x7d'),_0x3fd8c2,_0x573547);}else{if(_0x3dec2d[_0xf5f6('0x3c')][_0x20f052]===_0xf5f6('0x7e')){_0x8c09ff['where']('i.'+_0x20f052+'\x20IS\x20NULL');}else{_0x8c09ff[_0xf5f6('0x47')]('i.'+_0x20f052+_0xf5f6('0x7f'),_0x3dec2d[_0xf5f6('0x3c')][_0x20f052]);}}});}if(_0x3dec2d['query'][_0xf5f6('0x80')]){if(_0x3dec2d['query'][_0xf5f6('0x80')]==0x1){_0x8c09ff[_0xf5f6('0x65')](_0xf5f6('0x81'));}else{_0x8c09ff[_0xf5f6('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x3dec2d[_0xf5f6('0x3c')][_0xf5f6('0x82')]){_0x30940d=_['isArray'](_0x3dec2d['query'][_0xf5f6('0x82')])?_0x3dec2d[_0xf5f6('0x3c')]['tag']:new Array(_0x3dec2d['query'][_0xf5f6('0x82')]);_0x30940d[_0xf5f6('0x27')](function(_0x25c479){_0x5436ef['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25c479+',%');});}if(_0x3dec2d['query'][_0xf5f6('0x83')]){var _0x159225=_0x3dec2d[_0xf5f6('0x3c')]['filter']['replace']('\x5c','\x5c\x5c')[_0xf5f6('0x84')](/'/g,'\x27\x27');if(qs[_0xf5f6('0x85')](_0x159225)){_0x24de8f['or'](_0xf5f6('0x86'),_0x159225+'%');}else if(qs['isEmail'](_0x159225)){_0x24de8f['or'](_0xf5f6('0x87'),_0x159225+'%');}else{_0x24de8f['or'](_0xf5f6('0x88'),qs[_0xf5f6('0x69')](_0x159225))['or'](_0xf5f6('0x89'),qs[_0xf5f6('0x69')](_0x159225));}}}_0x8c09ff[_0xf5f6('0x47')](_0x24de8f);_0x8c09ff['group']('i.id');var _0x4b8223={'type':db[_0xf5f6('0x8a')][_0xf5f6('0x8b')][_0xf5f6('0x8c')],'raw':!![]};var _0x5cfef2=_0x8c09ff[_0xf5f6('0x8d')]();_0x5cfef2[_0xf5f6('0x4a')]('i.id');_0x5cfef2[_0xf5f6('0x4a')](_0xf5f6('0x8e'),'unreadMessages');if(_0xd8711e[_0xf5f6('0x45')]){_0xd8711e[_0xf5f6('0x45')][_0xf5f6('0x27')](function(_0x5f13be){var _0x22c82d=_0x5f13be[0x0]===_0xf5f6('0x8f')?_0x5f13be[0x0]:'i.'+_0x5f13be[0x0];_0x8c09ff[_0xf5f6('0x45')](_0x22c82d,_0x5f13be[0x1]===_0xf5f6('0x90')?![]:!![]);});}if(!_[_0xf5f6('0x91')](_0x30940d)){_0x8c09ff[_0xf5f6('0x65')](_0x5436ef);_0x5cfef2['where']('t.id\x20IN\x20?',_0x30940d);}BPromise['resolve']()['then'](function(){if(!_0x12afc9){if(_0x3dec2d[_0xf5f6('0x3c')][_0xf5f6('0x77')])return;_0x5cfef2[_0xf5f6('0x47')](_0xf5f6('0x92'));_0x8c09ff['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3dec2d['user'][_0xf5f6('0x93')]!==_0xf5f6('0x94'))return;return _0x3dec2d[_0xf5f6('0x95')][_0xf5f6('0x96')]({'attributes':['id'],'raw':!![]})[_0xf5f6('0x1f')](function(_0x18c700){if(_[_0xf5f6('0x91')](_0x18c700)){_0x5cfef2[_0xf5f6('0x47')](_0xf5f6('0x97'));_0x8c09ff[_0xf5f6('0x47')]('i.MailAccountId\x20IS\x20NULL');}else{_0x5cfef2['where'](_0xf5f6('0x78'),_[_0xf5f6('0x36')](_0x18c700,'id'));_0x8c09ff['where'](_0xf5f6('0x78'),_[_0xf5f6('0x36')](_0x18c700,'id'));}});})[_0xf5f6('0x1f')](function(){if(_0x3dec2d['user'][_0xf5f6('0x93')]==='agent'&&!_0x12afc9&&!_0x3dec2d[_0xf5f6('0x3c')]['MailAccountId'])return[];return db[_0xf5f6('0x98')]['query'](_0x5cfef2[_0xf5f6('0x99')](),_0x4b8223);})[_0xf5f6('0x1f')](function(_0xd17252){_0x53a134[_0xf5f6('0x1a')]=_0xd17252[_0xf5f6('0x42')];if(_0x53a134[_0xf5f6('0x1a')]===0x0)return[];return db['sequelize'][_0xf5f6('0x3c')](_0x25893b[_0xf5f6('0x99')](),_0x4b8223)[_0xf5f6('0x1f')](function(_0x253425){_0x36dc5a=_[_0xf5f6('0x9a')](_0x253425,'id');_0x4b8223=_[_0xf5f6('0x9b')](_0x4b8223,{'model':db[_0xf5f6('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3dec2d[_0xf5f6('0x3c')]['fields']){_0xd8711e['attributes'][_0xf5f6('0x27')](function(_0x3d429d){_0x8c09ff['field']('i.'+_0x3d429d);});}else{_0x8c09ff['field'](_0xf5f6('0x8e'),_0xf5f6('0x63'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0x9c'),_0xf5f6('0x9d'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0x9e'),'Account.mandatoryDisposition');_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0x9f'),'contactName');_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa0'));_0x8c09ff['field'](_0xf5f6('0xa1'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa2'));_0x8c09ff['field'](_0xf5f6('0xa3'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa4'));_0x8c09ff['field']('i.attach');_0x8c09ff[_0xf5f6('0x4a')]('i.lastMsgAt');_0x8c09ff[_0xf5f6('0x4a')]('i.lastMsgDirection');_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa5'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa6'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa7'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa8'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xa9'));_0x8c09ff[_0xf5f6('0x4a')]('i.to');_0x8c09ff['field'](_0xf5f6('0xaa'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xab'));_0x8c09ff[_0xf5f6('0x4a')]('i.UserId');_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xac'),_0xf5f6('0xad'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xae'),_0xf5f6('0xaf'));_0x8c09ff[_0xf5f6('0x4a')]('c.email','Contact.email');_0x8c09ff[_0xf5f6('0x4a')]('c.phone',_0xf5f6('0xb0'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xb1'),_0xf5f6('0xb2'));_0x8c09ff[_0xf5f6('0x4a')]('c.fax',_0xf5f6('0xb3'));_0x8c09ff['field'](_0xf5f6('0xb4'),_0xf5f6('0xb5'));_0x8c09ff[_0xf5f6('0x4a')](_0xf5f6('0xb6'),_0xf5f6('0xb7'));_0x8c09ff[_0xf5f6('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf5f6('0x29'));}if(_0xd8711e[_0xf5f6('0x19')])_0x8c09ff[_0xf5f6('0x19')](_0xd8711e[_0xf5f6('0x19')]);if(_0xd8711e[_0xf5f6('0x17')])_0x8c09ff[_0xf5f6('0x17')](_0xd8711e[_0xf5f6('0x17')]);return db[_0xf5f6('0x98')]['query'](_0x8c09ff[_0xf5f6('0x99')](),_0x4b8223);})['then'](function(_0x346024){if(_0x346024[_0xf5f6('0x42')]>0x0)_0x2f5d54['where'](_0xf5f6('0xb8'),_[_0xf5f6('0x36')](_0x346024,'id'));return db[_0xf5f6('0x98')][_0xf5f6('0x3c')](_0x2f5d54['toString'](),_0x4b8223)[_0xf5f6('0x1f')](function(_0x5b6036){var _0x5cd315=_['groupBy'](_0x5b6036,_0xf5f6('0xb9'));var _0x40d34d=[];return db[_0xf5f6('0xba')][_0xf5f6('0x2b')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xf5f6('0x1f')](function(_0x3b99c7){var _0x2b8c96=_0x3b99c7['enableEmailPreview'];_0x346024[_0xf5f6('0x27')](function(_0x311261){_0x40d34d['push'](updateMailInteraction(_0x311261,_0x36dc5a,_0x5cd315,_0x2b8c96));});return BPromise['all'](_0x40d34d);});});});})[_0xf5f6('0x1f')](function(_0x31dc28){_0x53a134['rows']=_0x31dc28;return _0x53a134;})['then'](respondWithFilteredResult(_0x289a7d,_0xd8711e))[_0xf5f6('0x2f')](handleError(_0x289a7d,null));};exports['show']=function(_0x5de19e,_0x5be7c3){var _0x3802c7={'raw':![],'where':{'id':_0x5de19e['params']['id']}},_0x1fad4f={};_0x1fad4f['model']=_['keys'](db[_0xf5f6('0x37')][_0xf5f6('0xbb')]);_0x1fad4f[_0xf5f6('0x3c')]=_[_0xf5f6('0x3d')](_0x5de19e[_0xf5f6('0x3c')]);_0x1fad4f[_0xf5f6('0x3e')]=_[_0xf5f6('0x3f')](_0x1fad4f['model'],_0x1fad4f[_0xf5f6('0x3c')]);_0x3802c7['attributes']=_['intersection'](_0x1fad4f[_0xf5f6('0x3b')],qs[_0xf5f6('0x41')](_0x5de19e[_0xf5f6('0x3c')][_0xf5f6('0x41')]));_0x3802c7[_0xf5f6('0x40')]=_0x3802c7[_0xf5f6('0x40')][_0xf5f6('0x42')]?_0x3802c7['attributes']:_0x1fad4f[_0xf5f6('0x3b')];if(_0x5de19e[_0xf5f6('0x3c')][_0xf5f6('0xbc')]){_0x3802c7['include']=[{'all':!![]}];}_0x3802c7=_['merge']({},_0x3802c7,_0x5de19e['options']);return db[_0xf5f6('0x37')][_0xf5f6('0x62')](_0x3802c7)[_0xf5f6('0x1f')](handleEntityNotFound(_0x5be7c3,null))['then'](respondWithResult(_0x5be7c3,null))[_0xf5f6('0x2f')](handleError(_0x5be7c3,null));};exports[_0xf5f6('0xbd')]=function(_0x179e5c,_0x3b3508){return db[_0xf5f6('0x37')]['create'](_0x179e5c['body'],{})[_0xf5f6('0x1f')](respondWithResult(_0x3b3508,0xc9))[_0xf5f6('0x2f')](handleError(_0x3b3508,null));};exports['update']=function(_0x71e51e,_0x41a974){if(_0x71e51e[_0xf5f6('0xbe')]['id']){delete _0x71e51e['body']['id'];}return db['MailInteraction']['find']({'where':{'id':_0x71e51e[_0xf5f6('0xbf')]['id']}})[_0xf5f6('0x1f')](handleEntityNotFound(_0x41a974,null))['then'](saveUpdates(_0x71e51e[_0xf5f6('0xbe')],null))['then'](respondWithResult(_0x41a974,null))[_0xf5f6('0x2f')](handleError(_0x41a974,null));};exports['destroy']=function(_0x4b4cd9,_0x631703){return db[_0xf5f6('0x37')][_0xf5f6('0x62')]({'where':{'id':_0x4b4cd9[_0xf5f6('0xbf')]['id']}})['then'](handleEntityNotFound(_0x631703,null))[_0xf5f6('0x1f')](removeEntity(_0x631703,null))[_0xf5f6('0x2f')](handleError(_0x631703,null));};exports[_0xf5f6('0xc0')]=function(_0x3d0b48,_0x3c368a){return db['MailInteraction'][_0xf5f6('0xc0')]()[_0xf5f6('0x1f')](respondWithResult(_0x3c368a,null))[_0xf5f6('0x2f')](handleError(_0x3c368a,null));};exports[_0xf5f6('0xc1')]=function(_0x1bd33d,_0x10faa1){return db[_0xf5f6('0x2a')][_0xf5f6('0x62')]({'where':{'id':_0x1bd33d[_0xf5f6('0xbf')]['id']}})[_0xf5f6('0x1f')](handleEntityNotFound(_0x10faa1,null))['then'](function(_0x4a7210){if(_0x4a7210){return _0x4a7210[_0xf5f6('0xc1')](_0x1bd33d[_0xf5f6('0xbe')][_0xf5f6('0xc2')],_[_0xf5f6('0xc3')](_0x1bd33d['body'],[_0xf5f6('0xc2'),'id'])||{});}})[_0xf5f6('0x1f')](respondWithResult(_0x10faa1,null))[_0xf5f6('0x2f')](handleError(_0x10faa1,null));};exports[_0xf5f6('0xc4')]=function(_0x5ba804,_0x256399){var _0x20a4dd={'raw':![],'where':{}};var _0x1c0173={};var _0x12021d={'count':0x0,'rows':[]};return db[_0xf5f6('0x37')][_0xf5f6('0x2b')]({'where':{'id':_0x5ba804[_0xf5f6('0xbf')]['id']}})[_0xf5f6('0x1f')](handleEntityNotFound(_0x256399,null))[_0xf5f6('0x1f')](function(_0x1d74bf){if(_0x1d74bf){_0x1c0173[_0xf5f6('0x3b')]=_[_0xf5f6('0x3d')](db[_0xf5f6('0x2a')][_0xf5f6('0xbb')]);_0x1c0173[_0xf5f6('0x3c')]=_['keys'](_0x5ba804[_0xf5f6('0x3c')]);_0x1c0173[_0xf5f6('0x3e')]=_[_0xf5f6('0x3f')](_0x1c0173[_0xf5f6('0x3b')],_0x1c0173[_0xf5f6('0x3c')]);_0x20a4dd['attributes']=_[_0xf5f6('0x3f')](_0x1c0173[_0xf5f6('0x3b')],qs['fields'](_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x41')]));_0x20a4dd[_0xf5f6('0x40')]=_0x20a4dd[_0xf5f6('0x40')][_0xf5f6('0x42')]?_0x20a4dd['attributes']:_0x1c0173['model'];if(!_0x5ba804['query'][_0xf5f6('0x43')]('nolimit')){_0x20a4dd['limit']=qs[_0xf5f6('0x19')](_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x19')]);_0x20a4dd[_0xf5f6('0x17')]=qs[_0xf5f6('0x17')](_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x17')]);}_0x20a4dd[_0xf5f6('0x45')]=qs[_0xf5f6('0x46')](_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x46')]);_0x20a4dd[_0xf5f6('0x47')]=qs[_0xf5f6('0x3e')](_[_0xf5f6('0x48')](_0x5ba804[_0xf5f6('0x3c')],_0x1c0173[_0xf5f6('0x3e')]));_0x20a4dd[_0xf5f6('0x47')][_0xf5f6('0xb9')]=_0x1d74bf['id'];if(_0x5ba804[_0xf5f6('0x3c')]['filter']){_0x20a4dd['where']=_[_0xf5f6('0x9b')](_0x20a4dd[_0xf5f6('0x47')],{'$or':_[_0xf5f6('0x36')](_0x20a4dd[_0xf5f6('0x40')],function(_0x1af8cb){var _0x330cb8={};_0x330cb8[_0x1af8cb]={'$like':'%'+_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x83')]+'%'};return _0x330cb8;})});}if(_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x7b')]){var _0x16856b=_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0x7b')][_0xf5f6('0x26')](',');var _0x26df04={};_0x26df04[_0x16856b[0x0]]={'$gte':moment(_0x16856b[0x1])[_0xf5f6('0xc5')](_0xf5f6('0xc6'))};_0x20a4dd['where']=_['merge'](_0x20a4dd['where'],_0x26df04);}_0x20a4dd=_[_0xf5f6('0x9b')]({},_0x20a4dd,_0x5ba804['options']);return db['MailMessage'][_0xf5f6('0x1a')]({'where':_0x20a4dd[_0xf5f6('0x47')]})[_0xf5f6('0x1f')](function(_0x15204e){_0x12021d[_0xf5f6('0x1a')]=_0x15204e;if(_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0xbc')]){_0x20a4dd[_0xf5f6('0xc7')]=[{'all':!![]}];}return db[_0xf5f6('0x2a')][_0xf5f6('0xc8')](_0x20a4dd);})['then'](function(_0x4e9891){if(_0x5ba804[_0xf5f6('0x3c')][_0xf5f6('0xc9')]==='true'){for(var _0x3e03ce=0x0;_0x3e03ce<_0x4e9891[_0xf5f6('0x42')];_0x3e03ce++){_0x4e9891[_0x3e03ce][_0xf5f6('0xbe')]=juice(_0x4e9891[_0x3e03ce][_0xf5f6('0xbe')]);}}_0x12021d['rows']=_0x4e9891;return _0x12021d;});}})[_0xf5f6('0x1f')](respondWithFilteredResult(_0x256399,_0x20a4dd))[_0xf5f6('0x2f')](handleError(_0x256399,null));};exports[_0xf5f6('0xca')]=function(_0x80f60f,_0x25f583){return db[_0xf5f6('0x37')][_0xf5f6('0x62')]({'where':{'id':_0x80f60f[_0xf5f6('0xbf')]['id']}})['then'](handleEntityNotFound(_0x25f583,null))['then'](function(_0x49ed98){if(_0x49ed98){return _0x49ed98[_0xf5f6('0xcb')](_0x80f60f[_0xf5f6('0xbe')][_0xf5f6('0xc2')],_[_0xf5f6('0xc3')](_0x80f60f[_0xf5f6('0xbe')],[_0xf5f6('0xc2'),'id'])||{})['spread'](function(){return db[_0xf5f6('0x6f')][_0xf5f6('0xc8')]({'attributes':['id',_0xf5f6('0x22'),'color'],'where':{'id':_0x80f60f[_0xf5f6('0xbe')]['ids']}});})['then'](function(_0x3abd12){socket[_0xf5f6('0xcc')](_0xf5f6('0xcd'),{'id':Number(_0x80f60f[_0xf5f6('0xbf')]['id']),'tags':_0x3abd12||[]});return{'id':Number(_0x80f60f[_0xf5f6('0xbf')]['id']),'tags':_0x3abd12||[]};});}})[_0xf5f6('0x1f')](respondWithResult(_0x25f583,null))[_0xf5f6('0x2f')](handleError(_0x25f583,null));};exports[_0xf5f6('0xce')]=function(_0x4122f8,_0x23ce97){return db['MailInteraction']['find']({'where':{'id':_0x4122f8[_0xf5f6('0xbf')]['id']}})[_0xf5f6('0x1f')](handleEntityNotFound(_0x23ce97,null))[_0xf5f6('0x1f')](function(_0x42363a){if(_0x42363a){return _0x42363a[_0xf5f6('0xce')](_0x4122f8['query'][_0xf5f6('0xc2')]);}})[_0xf5f6('0x1f')](respondWithStatusCode(_0x23ce97,null))[_0xf5f6('0x2f')](handleError(_0x23ce97,null));};exports[_0xf5f6('0xcf')]=function(_0x26f7f1,_0x3d6b77){var _0x40679a=moment()[_0xf5f6('0xd0')]()[_0xf5f6('0x99')]();var _0x447a41=path[_0xf5f6('0xd1')](config[_0xf5f6('0xd2')],_0xf5f6('0xd3'),_0xf5f6('0xd4'),_0xf5f6('0xd5'));var _0x23c11e=path[_0xf5f6('0xd1')](config[_0xf5f6('0xd2')],_0xf5f6('0xd3'),_0xf5f6('0xd4'),_0xf5f6('0xd6'));var _0x321709=path['join'](_0x447a41,_0x40679a);var _0x30b8ae=util[_0xf5f6('0xc5')](_0xf5f6('0xd7'),_0x26f7f1[_0xf5f6('0xbf')]['id'],_0x40679a);var _0x5f3103=path['join'](_0x447a41,_0x30b8ae);var _0x37d0b8=[];if(_0x26f7f1['query'][_0xf5f6('0xd6')]){_0x37d0b8['push']({'model':db['Attachment'],'as':_0xf5f6('0xd8'),'raw':!![]});}var _0x2e339e=[{'model':db[_0xf5f6('0x2a')],'as':_0xf5f6('0xd9'),'attributes':['id',_0xf5f6('0xbe'),'from','to','cc',_0xf5f6('0xda'),_0xf5f6('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xf5f6('0x46')]('id'),'include':_0x37d0b8}];return db[_0xf5f6('0x37')][_0xf5f6('0x62')]({'where':{'id':_0x26f7f1[_0xf5f6('0xbf')]['id']},'include':_0x2e339e})['then'](handleEntityNotFound(_0x3d6b77,null))[_0xf5f6('0x1f')](function(_0x149ada){if(_0x149ada&&_0x149ada[_0xf5f6('0xd9')]){var _0x5aa128=_0x149ada[_0xf5f6('0xdc')]({'plain':!![]});fs[_0xf5f6('0xdd')](_0x321709);return BPromise['each'](_0x5aa128[_0xf5f6('0xd9')],function(_0x160b73,_0x1efd12){var _0x62f0fa={'from':_0x160b73[_0xf5f6('0x4b')],'to':_0x160b73['to'],'subject':_0x160b73['subject'],'html':htmlEntities['decode'](_0x160b73[_0xf5f6('0xbe')]),'headers':{'Date':moment(_0x160b73[_0xf5f6('0xde')])[_0xf5f6('0xc5')](_0xf5f6('0xdf'))},'attachments':[]};if(_0x160b73['cc']){_0x62f0fa[_0xf5f6('0xe0')]['Cc']=_0x160b73['cc'];}if(_0x160b73[_0xf5f6('0xda')]){_0x62f0fa[_0xf5f6('0xe0')][_0xf5f6('0xe1')]=_0x160b73['bcc'];}return new BPromise(function(_0x293ce3,_0x58dcd2){if(_0x160b73[_0xf5f6('0xd8')]){for(var _0x3160e2=0x0;_0x3160e2<_0x160b73[_0xf5f6('0xd8')][_0xf5f6('0x42')];_0x3160e2++){var _0x37d6de=_0x160b73[_0xf5f6('0xd8')][_0x3160e2];var _0x4c107b=path[_0xf5f6('0xd1')](_0x23c11e,_0x37d6de[_0xf5f6('0xe2')]);if(fs[_0xf5f6('0xe3')](_0x4c107b)){_0x62f0fa[_0xf5f6('0xd6')][_0xf5f6('0x28')]({'name':_0x37d6de[_0xf5f6('0x22')],'contentType':_0x37d6de[_0xf5f6('0x39')],'data':fs[_0xf5f6('0xe4')](_0x4c107b)});}}}emlformat['build'](_0x62f0fa,function(_0x4b566e,_0x51baa6){if(_0x4b566e)return _0x58dcd2(_0x4b566e);fs[_0xf5f6('0xe5')](path[_0xf5f6('0xd1')](_0x321709,util[_0xf5f6('0xc5')](_0xf5f6('0xe6'),_0x1efd12)),_0x51baa6);return _0x293ce3(_0x51baa6);});});})[_0xf5f6('0x1f')](function(){return new BPromise(function(_0x1e4fbc,_0x3a727c){zipdir(_0x321709,{'saveTo':_0x5f3103},function(_0x37ce86,_0x9923a6){if(_0x37ce86)return _0x3a727c(_0x37ce86);return _0x1e4fbc(_0x9923a6);});})[_0xf5f6('0x1f')](function(){return new BPromise(function(_0x12a164,_0x263363){rimraf(_0x321709,function(_0x341277){if(_0x341277)_0x263363(_0x341277);return _0x12a164();});});})[_0xf5f6('0x1f')](function(){return _0x3d6b77[_0xf5f6('0xcf')](_0x5f3103,_0x30b8ae,function(_0x1a3973){if(!_0x1a3973)fs[_0xf5f6('0xe7')](_0x5f3103);});});});}else{return _0x3d6b77[_0xf5f6('0x13')](0xc8);}})['catch'](handleError(_0x3d6b77,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3c76473..2937b04 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 _0xa996=['getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','update','remove'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xa996,0x11a));var _0x6a99=function(_0x36c974,_0x3361e8){_0x36c974=_0x36c974-0x0;var _0x559511=_0xa996[_0x36c974];return _0x559511;};'use strict';var EventEmitter=require(_0x6a99('0x0'));var MailInteraction=require(_0x6a99('0x1'))['db'][_0x6a99('0x2')];var MailMessage=require(_0x6a99('0x1'))['db'][_0x6a99('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6a99('0x4'),'afterDestroy':_0x6a99('0x5')};function emitEvent(_0x298317){return function(_0x4357c0,_0x3a7fb4,_0x5b9e1e){_0x4357c0[_0x6a99('0x6')]({'attributes':['id'],'raw':!![]})[_0x6a99('0x7')](function(_0x45f115){_0x4357c0[_0x6a99('0x8')](_0x6a99('0x9'),_0x45f115[_0x6a99('0xa')](function(_0x41967f){return{'id':_0x41967f['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x4357c0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xd75619){_0x4357c0[_0x6a99('0x8')](_0x6a99('0xb'),_0xd75619['length']);MailInteractionEvents['emit'](_0x298317+':'+_0x4357c0['id'],_0x4357c0);MailInteractionEvents[_0x6a99('0xc')](_0x298317,_0x4357c0);_0x5b9e1e(null);})[_0x6a99('0xd')](_0x5b9e1e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6a99('0xe')](e,emitEvent(event));}}module[_0x6a99('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xc3ed=['Users','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','setMaxListeners','save','getUsers','then','setDataValue'];(function(_0x12cbb1,_0x50754a){var _0x30df94=function(_0x14d33c){while(--_0x14d33c){_0x12cbb1['push'](_0x12cbb1['shift']());}};_0x30df94(++_0x50754a);}(_0xc3ed,0x19d));var _0xdc3e=function(_0x3cc501,_0x78a695){_0x3cc501=_0x3cc501-0x0;var _0x212e9c=_0xc3ed[_0x3cc501];return _0x212e9c;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xdc3e('0x0'))['db'][_0xdc3e('0x1')];var MailMessage=require(_0xdc3e('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xdc3e('0x2')](0x0);var events={'afterCreate':_0xdc3e('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b1b78){return function(_0x1062e6,_0x1171ac,_0x238d5c){_0x1062e6[_0xdc3e('0x4')]({'attributes':['id'],'raw':!![]})[_0xdc3e('0x5')](function(_0x3f2d91){_0x1062e6[_0xdc3e('0x6')](_0xdc3e('0x7'),_0x3f2d91['map'](function(_0x3716b2){return{'id':_0x3716b2['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1062e6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c9ec){_0x1062e6[_0xdc3e('0x6')]('unreadMessages',_0x19c9ec[_0xdc3e('0x8')]);MailInteractionEvents[_0xdc3e('0x9')](_0x5b1b78+':'+_0x1062e6['id'],_0x1062e6);MailInteractionEvents[_0xdc3e('0x9')](_0x5b1b78,_0x1062e6);_0x238d5c(null);})[_0xdc3e('0xa')](_0x238d5c(null));};}for(var e in events){if(events[_0xdc3e('0xb')](e)){var event=events[e];MailInteraction[_0xdc3e('0xc')](e,emitEvent(event));}}module[_0xdc3e('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 53964e0..e6cfcd4 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 _0xe84d=['YYYY-MM-DD\x20HH:mm:ss','changed','models','closed','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format'];(function(_0xd9a6b9,_0x3004fb){var _0x1fdb90=function(_0x59c488){while(--_0x59c488){_0xd9a6b9['push'](_0xd9a6b9['shift']());}};_0x1fdb90(++_0x3004fb);}(_0xe84d,0x1e6));var _0xde84=function(_0x542a5f,_0x493ec8){_0x542a5f=_0x542a5f-0x0;var _0x530d99=_0xe84d[_0x542a5f];return _0x530d99;};'use strict';var _=require(_0xde84('0x0'));var util=require(_0xde84('0x1'));var logger=require(_0xde84('0x2'))(_0xde84('0x3'));var moment=require(_0xde84('0x4'));var BPromise=require(_0xde84('0x5'));var rp=require(_0xde84('0x6'));var fs=require('fs');var path=require(_0xde84('0x7'));var rimraf=require('rimraf');var config=require(_0xde84('0x8'));var attributes=require(_0xde84('0x9'));module[_0xde84('0xa')]=function(_0x334f84,_0xca24a1){return _0x334f84['define'](_0xde84('0xb'),attributes,{'tableName':_0xde84('0xc'),'paranoid':![],'indexes':[{'name':_0xde84('0xd'),'fields':[_0xde84('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2653d9,_0x2107b1,_0x19a130){if(_0x2653d9[_0xde84('0xf')]){_0x2653d9[_0xde84('0x10')]=moment()[_0xde84('0x11')](_0xde84('0x12'));}if(_0x2653d9['closed']){_0x2653d9['closedAt']=moment()[_0xde84('0x11')](_0xde84('0x12'));}_0x19a130(null,_0x2107b1);},'beforeUpdate':function(_0x541a48,_0xc2c4c1,_0x50fd27){if(_0x541a48['changed'](_0xde84('0xf'))){_0x541a48[_0xde84('0x10')]=_0x541a48[_0xde84('0xf')]?moment()['format'](_0xde84('0x12')):null;}if(_0x541a48[_0xde84('0x13')]('closed')){_0x541a48['closedAt']=moment()[_0xde84('0x11')](_0xde84('0x12'));_0x541a48[_0xde84('0xf')]=null;_0x541a48[_0xde84('0x10')]=null;}_0x50fd27(null,_0x541a48);},'afterUpdate':function(_0xa917f0,_0x28635d,_0x4319e1){var _0x106e25=_0x334f84[_0xde84('0x14')];var _0x4978f7=_0xa917f0['get']({'plain':!![]});if(_0x4978f7[_0xde84('0x15')]){return _0x106e25[_0xde84('0x16')][_0xde84('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4978f7['id']}})[_0xde84('0x18')](function(){_0x4319e1();})[_0xde84('0x19')](function(_0x8fad1a){_0x4319e1(_0x8fad1a);});}else{_0x4319e1();}}},'charset':_0xde84('0x1a'),'collate':_0xde84('0x1b')});}; \ No newline at end of file +var _0xd484=['./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x8e7102,_0x5c235e){var _0x38f2e0=function(_0x5385e3){while(--_0x5385e3){_0x8e7102['push'](_0x8e7102['shift']());}};_0x38f2e0(++_0x5c235e);}(_0xd484,0x107));var _0x4d48=function(_0x376921,_0x52157d){_0x376921=_0x376921-0x0;var _0x537eb9=_0xd484[_0x376921];return _0x537eb9;};'use strict';var _=require(_0x4d48('0x0'));var util=require(_0x4d48('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4d48('0x2'));var BPromise=require(_0x4d48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d48('0x4'));var rimraf=require(_0x4d48('0x5'));var config=require(_0x4d48('0x6'));var attributes=require(_0x4d48('0x7'));module[_0x4d48('0x8')]=function(_0x10630c,_0x346d0f){return _0x10630c['define'](_0x4d48('0x9'),attributes,{'tableName':_0x4d48('0xa'),'paranoid':![],'indexes':[{'name':_0x4d48('0xb'),'fields':[_0x4d48('0xc'),'to'],'type':_0x4d48('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c3870,_0x1eb7d9,_0x3c2b37){if(_0x5c3870[_0x4d48('0xe')]){_0x5c3870['substatusAt']=moment()[_0x4d48('0xf')](_0x4d48('0x10'));}if(_0x5c3870[_0x4d48('0x11')]){_0x5c3870[_0x4d48('0x12')]=moment()[_0x4d48('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c2b37(null,_0x1eb7d9);},'beforeUpdate':function(_0x5433e9,_0x3b04bb,_0x5d826b){if(_0x5433e9[_0x4d48('0x13')]('substatus')){_0x5433e9['substatusAt']=_0x5433e9[_0x4d48('0xe')]?moment()[_0x4d48('0xf')](_0x4d48('0x10')):null;}if(_0x5433e9['changed'](_0x4d48('0x11'))){_0x5433e9[_0x4d48('0x12')]=moment()[_0x4d48('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x5433e9[_0x4d48('0xe')]=null;_0x5433e9[_0x4d48('0x14')]=null;}_0x5d826b(null,_0x5433e9);},'afterUpdate':function(_0xdb5da5,_0x1818c1,_0x4bee17){var _0x4935a1=_0x10630c['models'];var _0x57fcaf=_0xdb5da5[_0x4d48('0x15')]({'plain':!![]});if(_0x57fcaf['closed']){return _0x4935a1[_0x4d48('0x16')][_0x4d48('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x57fcaf['id']}})['then'](function(){_0x4bee17();})[_0x4d48('0x18')](function(_0x14e262){_0x4bee17(_0x14e262);});}else{_0x4bee17();}}},'charset':_0x4d48('0x19'),'collate':_0x4d48('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b533e2c..a8e0e03 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 _0x9cb3=['stringify','catch','addTags','ids','body','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','result','MailInteraction','update','options','where','attributes','limit','UpdateMailInteraction'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x9cb3,0x13f));var _0x39cb=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0x9cb3[_0x3d9b04];return _0x557936;};'use strict';var _=require('lodash');var util=require(_0x39cb('0x0'));var moment=require(_0x39cb('0x1'));var BPromise=require(_0x39cb('0x2'));var rs=require(_0x39cb('0x3'));var fs=require('fs');var Redis=require(_0x39cb('0x4'));var db=require(_0x39cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39cb('0x6'));var config=require(_0x39cb('0x7'));var jayson=require(_0x39cb('0x8'));var client=jayson[_0x39cb('0x9')][_0x39cb('0xa')]({'port':0x232a});config[_0x39cb('0xb')]=_[_0x39cb('0xc')](config[_0x39cb('0xb')],{'host':_0x39cb('0xd'),'port':0x18eb});var socket=require(_0x39cb('0xe'))(new Redis(config[_0x39cb('0xb')]));require(_0x39cb('0xf'))[_0x39cb('0x10')](socket);function respondWithRpcPromise(_0x11180f,_0x8439b9,_0x5bc17b){return new BPromise(function(_0x29127f,_0x5133c9){return client['request'](_0x11180f,_0x5bc17b)[_0x39cb('0x11')](function(_0x14855b){logger[_0x39cb('0x12')](_0x39cb('0x13'),_0x8439b9,'request\x20sent');logger[_0x39cb('0x14')](_0x39cb('0x15'),_0x8439b9,'request\x20sent',JSON['stringify'](_0x14855b));if(_0x14855b[_0x39cb('0x16')]){if(_0x14855b[_0x39cb('0x16')]['code']===0x1f4){logger[_0x39cb('0x16')]('MailInteraction,\x20%s,\x20%s',_0x8439b9,_0x14855b['error']['message']);return _0x5133c9(_0x14855b['error'][_0x39cb('0x17')]);}logger[_0x39cb('0x16')](_0x39cb('0x13'),_0x8439b9,_0x14855b[_0x39cb('0x16')]['message']);return _0x29127f(_0x14855b[_0x39cb('0x16')][_0x39cb('0x17')]);}else{logger['info'](_0x39cb('0x13'),_0x8439b9,'request\x20sent');_0x29127f(_0x14855b[_0x39cb('0x18')][_0x39cb('0x17')]);}})['catch'](function(_0x580a05){logger['error'](_0x39cb('0x13'),_0x8439b9,_0x580a05);_0x5133c9(_0x580a05);});});}exports['UpdateMailInteraction']=function(_0x43418a){var _0x23594f=this;return new Promise(function(_0x4829d9,_0x4ae169){return db[_0x39cb('0x19')][_0x39cb('0x1a')](_0x43418a['body'],{'raw':_0x43418a[_0x39cb('0x1b')]?_0x43418a[_0x39cb('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43418a[_0x39cb('0x1b')]?_0x43418a[_0x39cb('0x1b')][_0x39cb('0x1c')]||null:null,'attributes':_0x43418a[_0x39cb('0x1b')]?_0x43418a[_0x39cb('0x1b')][_0x39cb('0x1d')]||null:null,'limit':_0x43418a['options']?_0x43418a[_0x39cb('0x1b')][_0x39cb('0x1e')]||null:null})[_0x39cb('0x11')](function(_0x5a0e20){logger['info'](_0x39cb('0x1f'),_0x43418a);logger[_0x39cb('0x14')]('UpdateMailInteraction',_0x43418a,JSON[_0x39cb('0x20')](_0x5a0e20));_0x4829d9(_0x5a0e20);})[_0x39cb('0x21')](function(_0x465ee6){logger['error']('UpdateMailInteraction',_0x465ee6[_0x39cb('0x17')],_0x43418a);_0x4ae169(_0x23594f['error'](0x1f4,_0x465ee6[_0x39cb('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x2a69bf){return new Promise(function(_0x1ec7cf,_0x43c763){return db[_0x39cb('0x19')]['find']({'where':_0x2a69bf[_0x39cb('0x1b')]?_0x2a69bf['options']['where']||null:null})[_0x39cb('0x11')](function(_0x584916){if(_0x584916){return _0x584916[_0x39cb('0x22')](_0x2a69bf['body'][_0x39cb('0x23')],_['omit'](_0x2a69bf[_0x39cb('0x24')],[_0x39cb('0x23'),'id'])||{});}})[_0x39cb('0x25')](function(_0x1eb5ca){logger[_0x39cb('0x12')](_0x39cb('0x26'),_0x2a69bf);logger[_0x39cb('0x14')](_0x39cb('0x26'),_0x2a69bf,JSON[_0x39cb('0x20')](_0x1eb5ca));_0x1ec7cf(_0x1eb5ca);})[_0x39cb('0x21')](function(_0x329c4d){logger[_0x39cb('0x16')]('AddTags',_0x329c4d[_0x39cb('0x17')],_0x2a69bf);_0x43c763(_this['error'](0x1f4,_0x329c4d['message']));});});}; \ No newline at end of file +var _0x6be2=['UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','then','catch','AddTagsToMailInteraction','find','ids','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x5e5732,_0x284712){var _0x23d20b=function(_0x589397){while(--_0x589397){_0x5e5732['push'](_0x5e5732['shift']());}};_0x23d20b(++_0x284712);}(_0x6be2,0x1cc));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x26be('0x0'));var moment=require(_0x26be('0x1'));var BPromise=require(_0x26be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26be('0x3'))['db'];var utils=require(_0x26be('0x4'));var logger=require(_0x26be('0x5'))('rpc');var config=require(_0x26be('0x6'));var jayson=require(_0x26be('0x7'));var client=jayson[_0x26be('0x8')]['http']({'port':0x232a});config[_0x26be('0x9')]=_[_0x26be('0xa')](config['redis'],{'host':_0x26be('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26be('0x9')]));require('./mailInteraction.socket')[_0x26be('0xc')](socket);function respondWithRpcPromise(_0x22de3c,_0x369352,_0x1c1f13){return new BPromise(function(_0x570435,_0x49cd23){return client['request'](_0x22de3c,_0x1c1f13)['then'](function(_0x21720d){logger['info'](_0x26be('0xd'),_0x369352,_0x26be('0xe'));logger[_0x26be('0xf')](_0x26be('0x10'),_0x369352,_0x26be('0xe'),JSON[_0x26be('0x11')](_0x21720d));if(_0x21720d[_0x26be('0x12')]){if(_0x21720d[_0x26be('0x12')]['code']===0x1f4){logger[_0x26be('0x12')](_0x26be('0xd'),_0x369352,_0x21720d[_0x26be('0x12')][_0x26be('0x13')]);return _0x49cd23(_0x21720d[_0x26be('0x12')][_0x26be('0x13')]);}logger['error'](_0x26be('0xd'),_0x369352,_0x21720d[_0x26be('0x12')]['message']);return _0x570435(_0x21720d[_0x26be('0x12')][_0x26be('0x13')]);}else{logger[_0x26be('0x14')](_0x26be('0xd'),_0x369352,_0x26be('0xe'));_0x570435(_0x21720d['result'][_0x26be('0x13')]);}})['catch'](function(_0xc1f651){logger[_0x26be('0x12')](_0x26be('0xd'),_0x369352,_0xc1f651);_0x49cd23(_0xc1f651);});});}exports[_0x26be('0x15')]=function(_0x3bbebf){var _0x2f083a=this;return new Promise(function(_0x217ac9,_0x4ca648){return db[_0x26be('0x16')][_0x26be('0x17')](_0x3bbebf[_0x26be('0x18')],{'raw':_0x3bbebf[_0x26be('0x19')]?_0x3bbebf[_0x26be('0x19')][_0x26be('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbebf['options']?_0x3bbebf['options'][_0x26be('0x1b')]||null:null,'attributes':_0x3bbebf[_0x26be('0x19')]?_0x3bbebf[_0x26be('0x19')][_0x26be('0x1c')]||null:null,'limit':_0x3bbebf[_0x26be('0x19')]?_0x3bbebf['options'][_0x26be('0x1d')]||null:null})[_0x26be('0x1e')](function(_0x32f3c2){logger['info']('UpdateMailInteraction',_0x3bbebf);logger[_0x26be('0xf')](_0x26be('0x15'),_0x3bbebf,JSON[_0x26be('0x11')](_0x32f3c2));_0x217ac9(_0x32f3c2);})[_0x26be('0x1f')](function(_0x2281f5){logger[_0x26be('0x12')]('UpdateMailInteraction',_0x2281f5[_0x26be('0x13')],_0x3bbebf);_0x4ca648(_0x2f083a[_0x26be('0x12')](0x1f4,_0x2281f5[_0x26be('0x13')]));});});};exports[_0x26be('0x20')]=function(_0x353fb5){return new Promise(function(_0x2f5361,_0x15b529){return db[_0x26be('0x16')][_0x26be('0x21')]({'where':_0x353fb5[_0x26be('0x19')]?_0x353fb5[_0x26be('0x19')][_0x26be('0x1b')]||null:null})[_0x26be('0x1e')](function(_0x50aefa){if(_0x50aefa){return _0x50aefa['addTags'](_0x353fb5[_0x26be('0x18')][_0x26be('0x22')],_['omit'](_0x353fb5[_0x26be('0x18')],[_0x26be('0x22'),'id'])||{});}})[_0x26be('0x23')](function(_0x3196c8){logger[_0x26be('0x14')]('AddTags',_0x353fb5);logger[_0x26be('0xf')](_0x26be('0x24'),_0x353fb5,JSON['stringify'](_0x3196c8));_0x2f5361(_0x3196c8);})[_0x26be('0x1f')](function(_0x5d0bf7){logger[_0x26be('0x12')](_0x26be('0x24'),_0x5d0bf7['message'],_0x353fb5);_0x15b529(_this['error'](0x1f4,_0x5d0bf7[_0x26be('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index cef7cb0..15e4de4 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 _0x7162=['register','length','mailInteraction:','save','update','emit','removeListener'];(function(_0x30e615,_0x1a11e8){var _0x176e56=function(_0x4761ea){while(--_0x4761ea){_0x30e615['push'](_0x30e615['shift']());}};_0x176e56(++_0x1a11e8);}(_0x7162,0x7a));var _0x2716=function(_0x12ce7b,_0x2daaee){_0x12ce7b=_0x12ce7b-0x0;var _0x4ee1b1=_0x7162[_0x12ce7b];return _0x4ee1b1;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2716('0x0'),'remove',_0x2716('0x1')];function createListener(_0x587ec2,_0x3295d9){return function(_0x5ad134){_0x3295d9[_0x2716('0x2')](_0x587ec2,_0x5ad134);};}function removeListener(_0x469bb9,_0x2788a6){return function(){MailInteractionEvents[_0x2716('0x3')](_0x469bb9,_0x2788a6);};}exports[_0x2716('0x4')]=function(_0x552113){for(var _0x3ba5cd=0x0,_0x1d82b4=events[_0x2716('0x5')];_0x3ba5cd<_0x1d82b4;_0x3ba5cd++){var _0x2da1e3=events[_0x3ba5cd];var _0x2cdf84=createListener(_0x2716('0x6')+_0x2da1e3,_0x552113);MailInteractionEvents['on'](_0x2da1e3,_0x2cdf84);}}; \ No newline at end of file +var _0x94f2=['save','update','emit','removeListener','register','mailInteraction:'];(function(_0x2cb8d0,_0x58d778){var _0x93650e=function(_0x37849b){while(--_0x37849b){_0x2cb8d0['push'](_0x2cb8d0['shift']());}};_0x93650e(++_0x58d778);}(_0x94f2,0x66));var _0x294f=function(_0x50ffff,_0x3f3902){_0x50ffff=_0x50ffff-0x0;var _0x406733=_0x94f2[_0x50ffff];return _0x406733;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x294f('0x0'),'remove',_0x294f('0x1')];function createListener(_0x45bb7e,_0xe88214){return function(_0x177a3f){_0xe88214[_0x294f('0x2')](_0x45bb7e,_0x177a3f);};}function removeListener(_0x9b81b7,_0x450dc1){return function(){MailInteractionEvents[_0x294f('0x3')](_0x9b81b7,_0x450dc1);};}exports[_0x294f('0x4')]=function(_0xd739b7){for(var _0x5c8d42=0x0,_0x40ebc4=events['length'];_0x5c8d42<_0x40ebc4;_0x5c8d42++){var _0x3e1c4b=events[_0x5c8d42];var _0xc875fd=createListener(_0x294f('0x5')+_0x3e1c4b,_0xd739b7);MailInteractionEvents['on'](_0x3e1c4b,_0xc875fd);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index daddaee..d91c071 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 _0x7cda=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','/:id','show','/:id/download','download','post','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x535f8d,_0x3a76c7){var _0x5cabac=function(_0x47ef83){while(--_0x47ef83){_0x535f8d['push'](_0x535f8d['shift']());}};_0x5cabac(++_0x3a76c7);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa7cd('0x0'));var path=require(_0xa7cd('0x1'));var timeout=require(_0xa7cd('0x2'));var express=require('express');var router=express[_0xa7cd('0x3')]();var fs_extra=require(_0xa7cd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa7cd('0x5'));var config=require(_0xa7cd('0x6'));var controller=require(_0xa7cd('0x7'));router[_0xa7cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa7cd('0x9')]);router['get']('/describe',auth[_0xa7cd('0xa')](),controller['describe']);router[_0xa7cd('0x8')](_0xa7cd('0xb'),auth[_0xa7cd('0xa')](),controller[_0xa7cd('0xc')]);router[_0xa7cd('0x8')](_0xa7cd('0xd'),auth[_0xa7cd('0xa')](),controller[_0xa7cd('0xe')]);router[_0xa7cd('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xa7cd('0x10'),_0xa7cd('0x11')),controller['create']);router[_0xa7cd('0x12')](_0xa7cd('0xb'),auth['isAuthenticated'](),controller[_0xa7cd('0x13')]);router[_0xa7cd('0x12')](_0xa7cd('0x14'),auth['isAuthenticated'](),controller[_0xa7cd('0x15')]);router[_0xa7cd('0x12')](_0xa7cd('0x16'),auth[_0xa7cd('0xa')](),controller[_0xa7cd('0x17')]);router[_0xa7cd('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xa7cd('0x19')]);module[_0xa7cd('0x1a')]=router; \ No newline at end of file +var _0xfdb5=['/:id','isAuthenticated','show','/:id/download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../config/environment','get','index'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xfdb5[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0x5fdb('0x0'));var util=require(_0x5fdb('0x1'));var path=require(_0x5fdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x5fdb('0x3'));var router=express[_0x5fdb('0x4')]();var fs_extra=require(_0x5fdb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fdb('0x6'));var controller=require('./mailMessage.controller');router[_0x5fdb('0x7')]('/',auth['isAuthenticated'](),controller[_0x5fdb('0x8')]);router[_0x5fdb('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5fdb('0x7')](_0x5fdb('0x9'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0xb')]);router[_0x5fdb('0x7')](_0x5fdb('0xc'),auth[_0x5fdb('0xa')](),controller['download']);router[_0x5fdb('0xd')]('/',auth['isAuthenticated'](),interaction[_0x5fdb('0xe')](_0x5fdb('0xf'),_0x5fdb('0x10')),controller['create']);router[_0x5fdb('0x11')]('/:id',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x12')]);router['put'](_0x5fdb('0x13'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x14')]);router['put'](_0x5fdb('0x15'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x16')]);router[_0x5fdb('0x17')](_0x5fdb('0x9'),auth[_0x5fdb('0xa')](),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 0601787..621e5c0 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 _0x51a8=['long','medium','BOOLEAN','ENUM','out','STRING','TEXT','DATE','INTEGER','Chat','Email','sequelize'];(function(_0x596019,_0x14be98){var _0x47d4fc=function(_0x203dda){while(--_0x203dda){_0x596019['push'](_0x596019['shift']());}};_0x47d4fc(++_0x14be98);}(_0x51a8,0x137));var _0x851a=function(_0x1ea4ba,_0x3d1476){_0x1ea4ba=_0x1ea4ba-0x0;var _0x3bafa7=_0x51a8[_0x1ea4ba];return _0x3bafa7;};'use strict';var Sequelize=require(_0x851a('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT'](_0x851a('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x851a('0x2'))},'read':{'type':Sequelize[_0x851a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x851a('0x4')]('in','out'),'defaultValue':_0x851a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x851a('0x6')](0x1fe)},'from':{'type':Sequelize[_0x851a('0x6')]},'to':{'type':Sequelize[_0x851a('0x7')](_0x851a('0x1'))},'cc':{'type':Sequelize[_0x851a('0x7')](_0x851a('0x1'))},'bcc':{'type':Sequelize[_0x851a('0x7')]('long')},'subject':{'type':Sequelize[_0x851a('0x7')]},'sentAt':{'type':Sequelize[_0x851a('0x8')]},'attach':{'type':Sequelize[_0x851a('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x851a('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x851a('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x851a('0x1'))},'originCc':{'type':Sequelize[_0x851a('0x7')](_0x851a('0x1'))},'originChannel':{'type':Sequelize[_0x851a('0x4')]('Email',_0x851a('0xa')),'defaultValue':_0x851a('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x37f8=['exports','TEXT','long','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','Chat','sequelize','lodash'];(function(_0x24d073,_0x428840){var _0x25879f=function(_0x3ec18d){while(--_0x3ec18d){_0x24d073['push'](_0x24d073['shift']());}};_0x25879f(++_0x428840);}(_0x37f8,0x1ec));var _0x837f=function(_0x26edb7,_0x8c1db3){_0x26edb7=_0x26edb7-0x0;var _0x40b9cb=_0x37f8[_0x26edb7];return _0x40b9cb;};'use strict';var Sequelize=require(_0x837f('0x0'));var _=require(_0x837f('0x1'));module[_0x837f('0x2')]={'body':{'type':Sequelize[_0x837f('0x3')](_0x837f('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x837f('0x3')]('medium')},'read':{'type':Sequelize[_0x837f('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x837f('0x6')]('in',_0x837f('0x7')),'defaultValue':_0x837f('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x837f('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x837f('0x3')](_0x837f('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x837f('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x837f('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x837f('0xa')]},'originTo':{'type':Sequelize[_0x837f('0x3')](_0x837f('0x4'))},'originCc':{'type':Sequelize[_0x837f('0x3')](_0x837f('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x837f('0xb'),_0x837f('0xc')),'defaultValue':_0x837f('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index da7a74a..2d3f859 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 _0x890e=['debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','name','send','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','options','find','body','params','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','MailInteraction','read1stAt','interaction','get','[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','Sequelize','SELECT','User','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','contact','fullname','SIP/%s','rejectmessage','download','unix','server','files','tmp','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','readFileSync','build','writeFileSync','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s'];(function(_0xfe5403,_0x1628b1){var _0x2d1e48=function(_0x71342){while(--_0x71342){_0xfe5403['push'](_0xfe5403['shift']());}};_0x2d1e48(++_0x1628b1);}(_0x890e,0x135));var _0xe890=function(_0x3b5a89,_0x3d437d){_0x3b5a89=_0x3b5a89-0x0;var _0x65cc99=_0x890e[_0x3b5a89];return _0x65cc99;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe890('0x0'));var path=require(_0xe890('0x1'));var fs=require('fs');var _=require(_0xe890('0x2'));var Redis=require(_0xe890('0x3'));var htmlToText=require(_0xe890('0x4'));var qs=require(_0xe890('0x5'));var logger=require(_0xe890('0x6'))(_0xe890('0x7'));var interaction_log=require('../../config/logger')(_0xe890('0x8'));var config=require(_0xe890('0x9'));var db=require('../../mysqldb')['db'];config[_0xe890('0xa')]=_[_0xe890('0xb')](config[_0xe890('0xa')],{'host':_0xe890('0xc'),'port':0x18eb});var socket=require(_0xe890('0xd'))(new Redis(config[_0xe890('0xa')]));var htmlEntities=require(_0xe890('0xe'));require(_0xe890('0xf'))['register'](socket);var jayson=require(_0xe890('0x10'));var client=jayson[_0xe890('0x11')][_0xe890('0x12')]({'port':0x232c});var client9003=jayson[_0xe890('0x11')]['http']({'port':0x232b});var client9002=jayson[_0xe890('0x11')][_0xe890('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x323d39,_0x1b9942,_0x45854e,_0x380773){return new BPromise(function(_0x14562d,_0x30af6d){var _0x4e8652=_0x380773||client;return _0x4e8652[_0xe890('0x13')](_0x323d39,_0x45854e)[_0xe890('0x14')](function(_0x2f5a8e){logger[_0xe890('0x15')](_0xe890('0x16'),_0x1b9942,'request\x20sent');logger[_0xe890('0x17')](_0xe890('0x18'),_0x1b9942,_0xe890('0x19'),JSON['stringify'](_0x2f5a8e));if(_0x2f5a8e[_0xe890('0x1a')]){if(_0x2f5a8e[_0xe890('0x1a')][_0xe890('0x1b')]===0x1f4){logger[_0xe890('0x1a')](_0xe890('0x16'),_0x1b9942,_0x2f5a8e[_0xe890('0x1a')][_0xe890('0x1c')]);return _0x30af6d(_0x2f5a8e[_0xe890('0x1a')][_0xe890('0x1c')]);}logger[_0xe890('0x1a')]('MailMessage,\x20%s,\x20%s',_0x1b9942,_0x2f5a8e[_0xe890('0x1a')][_0xe890('0x1c')]);return _0x14562d(_0x2f5a8e[_0xe890('0x1a')][_0xe890('0x1c')]);}else{logger[_0xe890('0x15')](_0xe890('0x16'),_0x1b9942,'request\x20sent');_0x14562d(_0x2f5a8e[_0xe890('0x1d')][_0xe890('0x1c')]);}})[_0xe890('0x1e')](function(_0x34a806){logger[_0xe890('0x1a')](_0xe890('0x16'),_0x1b9942,_0x34a806);_0x30af6d(_0x34a806);});});}function respondWithResult(_0x1dee16,_0x20b4f0){_0x20b4f0=_0x20b4f0||0xc8;return function(_0xace408){if(_0xace408){return _0x1dee16[_0xe890('0x1f')](_0x20b4f0)[_0xe890('0x20')](_0xace408);}};}function respondWithFilteredResult(_0x5ddb09,_0x929dbe){return function(_0x5abf60){if(_0x5abf60){var _0x1ab399=typeof _0x929dbe[_0xe890('0x21')]===_0xe890('0x22')&&typeof _0x929dbe[_0xe890('0x23')]==='undefined';var _0x3cfe7b=_0x5abf60[_0xe890('0x24')];var _0xb301d9=_0x1ab399?0x0:_0x929dbe[_0xe890('0x21')];var _0x4a5ce5=_0x1ab399?_0x5abf60[_0xe890('0x24')]:_0x929dbe['offset']+_0x929dbe['limit'];var _0x28c35b;if(_0x4a5ce5>=_0x3cfe7b){_0x4a5ce5=_0x3cfe7b;_0x28c35b=0xc8;}else{_0x28c35b=0xce;}_0x5ddb09[_0xe890('0x1f')](_0x28c35b);return _0x5ddb09[_0xe890('0x25')](_0xe890('0x26'),_0xb301d9+'-'+_0x4a5ce5+'/'+_0x3cfe7b)[_0xe890('0x20')](_0x5abf60);}return null;};}function saveUpdates(_0x2e594e){return function(_0x417e23){if(_0x417e23){return _0x417e23[_0xe890('0x27')](_0x2e594e)[_0xe890('0x14')](function(_0x2cc282){return _0x2cc282;});}return null;};}function removeEntity(_0x4db4f4){return function(_0xd27c93){if(_0xd27c93){return _0xd27c93[_0xe890('0x28')]()['then'](function(){_0x4db4f4[_0xe890('0x1f')](0xcc)[_0xe890('0x29')]();});}};}function handleEntityNotFound(_0x325611){return function(_0x592263){if(!_0x592263){_0x325611[_0xe890('0x2a')](0x194);}return _0x592263;};}function handleError(_0x4a139e,_0x9412d8){_0x9412d8=_0x9412d8||0x1f4;return function(_0x7a6150){logger[_0xe890('0x1a')](_0x7a6150['stack']);if(_0x7a6150['name']){delete _0x7a6150[_0xe890('0x2b')];}_0x4a139e[_0xe890('0x1f')](_0x9412d8)[_0xe890('0x2c')](_0x7a6150);};}exports['index']=function(_0x5ec8f7,_0x117373){var _0x52d24a={},_0x52028f={},_0x4afee8={'count':0x0,'rows':[]};var _0x21830d=_['map'](db[_0xe890('0x2d')][_0xe890('0x2e')],function(_0xb7dbe3){return{'name':_0xb7dbe3['fieldName'],'type':_0xb7dbe3[_0xe890('0x2f')][_0xe890('0x30')]};});_0x52028f[_0xe890('0x31')]=_[_0xe890('0x32')](_0x21830d,_0xe890('0x2b'));_0x52028f[_0xe890('0x33')]=_[_0xe890('0x34')](_0x5ec8f7[_0xe890('0x33')]);_0x52028f[_0xe890('0x35')]=_['intersection'](_0x52028f[_0xe890('0x31')],_0x52028f['query']);_0x52d24a[_0xe890('0x36')]=_[_0xe890('0x37')](_0x52028f[_0xe890('0x31')],qs[_0xe890('0x38')](_0x5ec8f7[_0xe890('0x33')][_0xe890('0x38')]));_0x52d24a[_0xe890('0x36')]=_0x52d24a['attributes'][_0xe890('0x39')]?_0x52d24a[_0xe890('0x36')]:_0x52028f[_0xe890('0x31')];if(!_0x5ec8f7[_0xe890('0x33')]['hasOwnProperty'](_0xe890('0x3a'))){_0x52d24a[_0xe890('0x23')]=qs[_0xe890('0x23')](_0x5ec8f7[_0xe890('0x33')][_0xe890('0x23')]);_0x52d24a[_0xe890('0x21')]=qs[_0xe890('0x21')](_0x5ec8f7['query']['offset']);}_0x52d24a['order']=qs[_0xe890('0x3b')](_0x5ec8f7[_0xe890('0x33')][_0xe890('0x3b')]);_0x52d24a[_0xe890('0x3c')]=qs[_0xe890('0x35')](_[_0xe890('0x3d')](_0x5ec8f7['query'],_0x52028f['filters']),_0x21830d);if(_0x5ec8f7[_0xe890('0x33')]['filter']){_0x52d24a[_0xe890('0x3c')]=_['merge'](_0x52d24a[_0xe890('0x3c')],{'$or':_[_0xe890('0x32')](_0x21830d,function(_0x21ac11){if(_0x21ac11['type']!==_0xe890('0x3e')){var _0x563e4b={};_0x563e4b[_0x21ac11['name']]={'$like':'%'+_0x5ec8f7[_0xe890('0x33')][_0xe890('0x3f')]+'%'};return _0x563e4b;}})});}_0x52d24a=_[_0xe890('0x40')]({},_0x52d24a,_0x5ec8f7['options']);var _0x2c5471={'where':_0x52d24a[_0xe890('0x3c')]};return db['MailMessage'][_0xe890('0x24')](_0x2c5471)[_0xe890('0x14')](function(_0x2630e5){_0x4afee8[_0xe890('0x24')]=_0x2630e5;if(_0x5ec8f7[_0xe890('0x33')][_0xe890('0x41')]){_0x52d24a[_0xe890('0x42')]=[{'all':!![]}];}return db[_0xe890('0x2d')][_0xe890('0x43')](_0x52d24a);})['then'](function(_0x856125){_0x4afee8[_0xe890('0x44')]=_0x856125;return _0x4afee8;})[_0xe890('0x14')](respondWithFilteredResult(_0x117373,_0x52d24a))['catch'](handleError(_0x117373,null));};exports[_0xe890('0x45')]=function(_0x4a618d,_0xb3c4b6){var _0x38fdcd={'raw':!![],'where':{'id':_0x4a618d['params']['id']}},_0x20c5f5={};_0x20c5f5[_0xe890('0x31')]=_[_0xe890('0x34')](db[_0xe890('0x2d')]['rawAttributes']);_0x20c5f5[_0xe890('0x33')]=_[_0xe890('0x34')](_0x4a618d[_0xe890('0x33')]);_0x20c5f5[_0xe890('0x35')]=_['intersection'](_0x20c5f5['model'],_0x20c5f5[_0xe890('0x33')]);_0x38fdcd[_0xe890('0x36')]=_[_0xe890('0x37')](_0x20c5f5[_0xe890('0x31')],qs['fields'](_0x4a618d[_0xe890('0x33')][_0xe890('0x38')]));_0x38fdcd[_0xe890('0x36')]=_0x38fdcd[_0xe890('0x36')][_0xe890('0x39')]?_0x38fdcd[_0xe890('0x36')]:_0x20c5f5[_0xe890('0x31')];if(_0x4a618d[_0xe890('0x33')][_0xe890('0x41')]){_0x38fdcd['include']=[{'all':!![]}];}_0x38fdcd=_[_0xe890('0x40')]({},_0x38fdcd,_0x4a618d[_0xe890('0x46')]);return db[_0xe890('0x2d')][_0xe890('0x47')](_0x38fdcd)['then'](handleEntityNotFound(_0xb3c4b6,null))[_0xe890('0x14')](respondWithResult(_0xb3c4b6,null))[_0xe890('0x1e')](handleError(_0xb3c4b6,null));};exports[_0xe890('0x27')]=function(_0x4d3e04,_0x3d0d60){if(_0x4d3e04[_0xe890('0x48')]['id']){delete _0x4d3e04[_0xe890('0x48')]['id'];}return db[_0xe890('0x2d')]['find']({'where':{'id':_0x4d3e04[_0xe890('0x49')]['id']}})[_0xe890('0x14')](handleEntityNotFound(_0x3d0d60,null))[_0xe890('0x14')](saveUpdates(_0x4d3e04[_0xe890('0x48')],null))[_0xe890('0x14')](respondWithResult(_0x3d0d60,null))['catch'](handleError(_0x3d0d60,null));};exports[_0xe890('0x28')]=function(_0xadd0be,_0x494e51){return db[_0xe890('0x2d')][_0xe890('0x47')]({'where':{'id':_0xadd0be[_0xe890('0x49')]['id']}})[_0xe890('0x14')](handleEntityNotFound(_0x494e51,null))[_0xe890('0x14')](removeEntity(_0x494e51,null))[_0xe890('0x1e')](handleError(_0x494e51,null));};exports['describe']=function(_0x31ee1e,_0x289ac4){return db[_0xe890('0x2d')]['describe']()[_0xe890('0x14')](respondWithResult(_0x289ac4,null))['catch'](handleError(_0x289ac4,null));};exports['create']=function(_0x3d8888,_0x4a0422){return db[_0xe890('0x2d')][_0xe890('0x4a')](_0x3d8888[_0xe890('0x48')])[_0xe890('0x14')](function(_0x368957){if(_0x368957){if(_0x368957[_0xe890('0x4b')]===_0xe890('0x4c')&&!_0x368957[_0xe890('0x4d')]){var _0xaffa5a,_0x1db94d,_0x296514;if(_0x3d8888[_0xe890('0x48')]['to']){_0x1db94d=_0x3d8888[_0xe890('0x48')]['to'][_0xe890('0x4e')](',')[0x0];}return db[_0xe890('0x4f')][_0xe890('0x50')]({'where':{'id':_0x368957['MailAccountId']},'include':[{'model':db[_0xe890('0x51')],'as':_0xe890('0x52'),'include':[{'model':db[_0xe890('0x53')],'as':'Contacts','where':{'email':_0x1db94d},'limit':0x1,'order':[[_0xe890('0x54'),'DESC']]}]},{'model':db[_0xe890('0x55')],'as':_0xe890('0x56'),'raw':!![]}]})['then'](function(_0x4f4a66){_0xaffa5a=_0x4f4a66;if(_0xaffa5a&&_0xaffa5a[_0xe890('0x56')]){var _0x105123={'tls':{'rejectUnauthorized':![]}};if(_[_0xe890('0x57')](_0xaffa5a[_0xe890('0x56')][_0xe890('0x58')])){_0x105123[_0xe890('0x59')]=_0xaffa5a[_0xe890('0x56')][_0xe890('0x59')];_0x105123['port']=_0xaffa5a[_0xe890('0x56')][_0xe890('0x5a')];_0x105123[_0xe890('0x5b')]=_0xaffa5a[_0xe890('0x56')]['secure'];if(_0xaffa5a[_0xe890('0x56')][_0xe890('0x5c')]){_0x105123[_0xe890('0x5d')]={'user':_0xaffa5a[_0xe890('0x56')][_0xe890('0x5e')],'pass':_0xaffa5a['Smtp'][_0xe890('0x5f')]};}}else{_0x105123['service']=_0xaffa5a['Smtp'][_0xe890('0x58')];_0x105123[_0xe890('0x5d')]={'user':_0xaffa5a[_0xe890('0x56')][_0xe890('0x5e')],'pass':_0xaffa5a[_0xe890('0x56')][_0xe890('0x5f')]};_0x105123[_0xe890('0x5b')]=_0xaffa5a[_0xe890('0x56')][_0xe890('0x5b')];}if(_0x3d8888[_0xe890('0x48')]['attachments']&&_0x3d8888[_0xe890('0x48')][_0xe890('0x60')][_0xe890('0x39')]){for(var _0x526ac1=0x0;_0x526ac1<_0x3d8888[_0xe890('0x48')]['attachments'][_0xe890('0x39')];_0x526ac1+=0x1){_0x3d8888[_0xe890('0x48')][_0xe890('0x60')][_0x526ac1]={'filename':_0x3d8888[_0xe890('0x48')][_0xe890('0x60')][_0x526ac1][_0xe890('0x2b')],'path':path[_0xe890('0x61')](config[_0xe890('0x62')],_0xe890('0x63'),_0x3d8888[_0xe890('0x48')][_0xe890('0x60')][_0x526ac1][_0xe890('0x64')])};}}_0x296514={'account':_0x105123,'message':_0x3d8888[_0xe890('0x48')]};return;}})[_0xe890('0x14')](function(){if(_0xaffa5a['List']){if(_0xaffa5a[_0xe890('0x52')][_0xe890('0x65')][_0xe890('0x39')]){return _0xaffa5a[_0xe890('0x52')][_0xe890('0x65')][0x0];}else{return db['CmContact'][_0xe890('0x4a')](_[_0xe890('0xb')](_0x3d8888[_0xe890('0x48')],{'firstName':_0x3d8888[_0xe890('0x48')]['to'],'email':_0x3d8888[_0xe890('0x48')]['to'],'phone':_0x3d8888[_0xe890('0x48')]['to'],'ListId':_0xaffa5a[_0xe890('0x66')]}));}}else{throw new Error(_0xe890('0x67'));}})['then'](function(){if(_0x296514){return respondWithRpcPromise(_0xe890('0x68'),_0xe890('0x69'),_0x296514,client9003)[_0xe890('0x14')](function(_0x22791b){return _0x368957[_0xe890('0x27')]({'read':!![],'messageId':_0x22791b[_0xe890('0x6a')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xe890('0x1e')](function(_0x26f901){logger[_0xe890('0x1a')]('%s',JSON['stringify'](_0x26f901));return _0x368957;});}return _0x368957;});}return _0x368957;}})[_0xe890('0x14')](respondWithResult(_0x4a0422,0xc9))['catch'](handleError(_0x4a0422,null));};exports[_0xe890('0x6b')]=function(_0x4bec36,_0x2b5d94){var _0x22632f={'agent':{},'channel':_0xe890('0x6c')};if(_0x4bec36[_0xe890('0x48')]['id']){delete _0x4bec36[_0xe890('0x48')]['id'];}_0x4bec36[_0xe890('0x48')][_0xe890('0x6d')]=!![];_0x4bec36[_0xe890('0x48')][_0xe890('0x6e')]=moment()[_0xe890('0x6f')](_0xe890('0x70'));_0x4bec36[_0xe890('0x48')][_0xe890('0x71')]=_0x4bec36['body'][_0xe890('0x71')]||_0x4bec36[_0xe890('0x5e')]['id'];_0x22632f[_0xe890('0x72')]['id']=_0x4bec36[_0xe890('0x48')][_0xe890('0x71')];return db[_0xe890('0x2d')][_0xe890('0x47')]({'where':{'id':_0x4bec36[_0xe890('0x49')]['id'],'UserId':null}})[_0xe890('0x14')](handleEntityNotFound(_0x2b5d94,null))[_0xe890('0x14')](saveUpdates(_0x4bec36[_0xe890('0x48')],null))['then'](function(_0x35a6b8){if(_0x35a6b8){_0x22632f[_0xe890('0x1c')]=_0x35a6b8['get']({'plain':!![]});return db[_0xe890('0x73')][_0xe890('0x47')]({'where':{'id':_0x35a6b8['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2b5d94,null))['then'](function(_0x1e8356){if(_0x1e8356){return _0x1e8356[_0xe890('0x27')]({'UserId':_0x4bec36[_0xe890('0x48')][_0xe890('0x71')],'read1stAt':_[_0xe890('0x57')](_0x1e8356[_0xe890('0x74')])?moment()[_0xe890('0x6f')](_0xe890('0x70')):undefined});}return null;})[_0xe890('0x14')](function(_0x4b10c3){if(_0x4b10c3){_0x22632f[_0xe890('0x75')]=_0x4b10c3[_0xe890('0x76')]({'plain':!![]});interaction_log[_0xe890('0x15')](_0xe890('0x77'),_0x4bec36[_0xe890('0x5e')]['id'],_0x4bec36['user'][_0xe890('0x2b')],_0x4bec36['user'][_0xe890('0x78')],_0x22632f[_0xe890('0x75')]['id'],_0x4bec36[_0xe890('0x48')]?JSON['stringify'](_0x4bec36[_0xe890('0x48')]):_0xe890('0x79'));return respondWithRpcPromise(_0xe890('0x7a'),_0xe890('0x7b'),_0x22632f);}return null;})[_0xe890('0x14')](function(_0x2da984){var _0x2a48d6=_0xe890('0x7c')+_0x2da984[_0xe890('0x1c')][_0xe890('0x7d')];return db[_0xe890('0x7e')][_0xe890('0x33')](_0x2a48d6,{'type':db[_0xe890('0x7f')]['QueryTypes'][_0xe890('0x80')],'raw':!![]})[_0xe890('0x14')](function(_0x3a0e6f){return _0x3a0e6f;});})[_0xe890('0x14')](function(_0x1fdf9a){if(_0x1fdf9a){_0x22632f[_0xe890('0x1c')]['contact']=_0x1fdf9a[0x0];if(!_0x4bec36[_0xe890('0x48')]['UserId'])return;return db[_0xe890('0x81')][_0xe890('0x47')]({'where':{'id':_0x4bec36['body']['UserId'],'role':_0xe890('0x72')},'attributes':['id','name','fullname',_0xe890('0x82'),_0xe890('0x83')],'raw':!![]});}return null;})[_0xe890('0x14')](function(_0x5ad6c2){if(!_0x5ad6c2)return null;_0x22632f[_0xe890('0x1c')][_0xe890('0x72')]=_0x5ad6c2;return _0x22632f;})[_0xe890('0x14')](function(_0x2bbf8b){if(_0x2bbf8b){if(_0x4bec36[_0xe890('0x48')][_0xe890('0x84')]){_0x22632f[_0xe890('0x1c')][_0xe890('0x85')]=util[_0xe890('0x6f')]('SIP/%s',_0x4bec36[_0xe890('0x5e')][_0xe890('0x2b')]);_0x22632f['message'][_0xe890('0x86')]=_0x22632f[_0xe890('0x86')];_0x22632f[_0xe890('0x1c')][_0xe890('0x87')]=_0x22632f[_0xe890('0x86')];_0x22632f['message'][_0xe890('0x88')]=_0xe890('0x6b');_0x22632f[_0xe890('0x1c')][_0xe890('0x48')]=htmlToText[_0xe890('0x89')](_0x22632f[_0xe890('0x1c')]['body']);return respondWithRpcPromise(_0xe890('0x8a'),_0xe890('0x8a'),{'event':'acceptmessage','message':_0x22632f['message']},client9002)[_0xe890('0x14')](function(){return _0x22632f;});}return _0x22632f;}return null;})[_0xe890('0x14')](respondWithResult(_0x2b5d94,null))[_0xe890('0x1e')](handleError(_0x2b5d94,null));};exports[_0xe890('0x8b')]=function(_0x1a2790,_0x11b460){var _0x3f98a7={'agent':{},'channel':_0xe890('0x6c')};if(_0x1a2790[_0xe890('0x48')]['id']){delete _0x1a2790[_0xe890('0x48')]['id'];}_0x1a2790[_0xe890('0x48')][_0xe890('0x71')]=_0x1a2790['body'][_0xe890('0x71')]||_0x1a2790[_0xe890('0x5e')]['id'];_0x3f98a7[_0xe890('0x72')]['id']=_0x1a2790[_0xe890('0x48')][_0xe890('0x71')];return db['MailMessage'][_0xe890('0x47')]({'where':{'id':_0x1a2790[_0xe890('0x49')]['id'],'UserId':null}})[_0xe890('0x14')](handleEntityNotFound(_0x11b460,null))['then'](function(_0x10b063){if(_0x10b063){_0x3f98a7[_0xe890('0x1c')]=_0x10b063[_0xe890('0x76')]({'plain':!![]});return db[_0xe890('0x73')][_0xe890('0x47')]({'where':{'id':_0x10b063[_0xe890('0x8c')]}});}return null;})['then'](handleEntityNotFound(_0x11b460,null))[_0xe890('0x14')](function(_0x5233ae){if(_0x5233ae){_0x3f98a7['interaction']=_0x5233ae[_0xe890('0x76')]({'plain':!![]});interaction_log['info'](_0xe890('0x8d'),_0x1a2790[_0xe890('0x5e')]['id'],_0x1a2790['user'][_0xe890('0x2b')],_0x1a2790['user']['role'],_0x3f98a7[_0xe890('0x75')]['id'],_0x1a2790[_0xe890('0x48')]?JSON[_0xe890('0x8e')](_0x1a2790[_0xe890('0x48')]):'null');return respondWithRpcPromise(_0xe890('0x8f'),_0xe890('0x90'),_0x3f98a7);}return null;})[_0xe890('0x14')](function(_0x985de2){var _0x576910=_0xe890('0x7c')+_0x985de2['message'][_0xe890('0x7d')];return db[_0xe890('0x7e')]['query'](_0x576910,{'type':db[_0xe890('0x7f')]['QueryTypes'][_0xe890('0x80')],'raw':!![]})['then'](function(_0x9927d8){return _0x9927d8;});})[_0xe890('0x14')](function(_0x3c44bd){if(_0x3c44bd){_0x3f98a7[_0xe890('0x1c')][_0xe890('0x91')]=_0x3c44bd[0x0];if(!_0x1a2790[_0xe890('0x48')][_0xe890('0x71')])return;return db['User'][_0xe890('0x47')]({'where':{'id':_0x1a2790['body'][_0xe890('0x71')],'role':_0xe890('0x72')},'attributes':['id','name',_0xe890('0x92'),_0xe890('0x82'),_0xe890('0x83')],'raw':!![]});}return null;})['then'](function(_0x29a6de){if(!_0x29a6de)return null;_0x3f98a7[_0xe890('0x1c')]['agent']=_0x29a6de;return _0x3f98a7;})[_0xe890('0x14')](function(_0x1f391a){if(_0x1f391a){_0x1f391a[_0xe890('0x1c')]['interface']=util[_0xe890('0x6f')](_0xe890('0x93'),_0x1a2790[_0xe890('0x5e')][_0xe890('0x2b')]);_0x1f391a[_0xe890('0x1c')][_0xe890('0x86')]=_0x3f98a7['channel'];_0x1f391a['message'][_0xe890('0x87')]=_0x3f98a7[_0xe890('0x86')];_0x1f391a['message'][_0xe890('0x88')]=_0xe890('0x8b');_0x1f391a[_0xe890('0x1c')]['body']=htmlToText[_0xe890('0x89')](_0x3f98a7['message'][_0xe890('0x48')]);respondWithRpcPromise(_0xe890('0x8a'),_0xe890('0x8a'),{'event':_0xe890('0x94'),'message':_0x1f391a[_0xe890('0x1c')]},client9002);return _0x3f98a7;}return null;})[_0xe890('0x14')](respondWithResult(_0x11b460,null))['catch'](handleError(_0x11b460,null));};exports[_0xe890('0x95')]=function(_0x131b7e,_0x18db38){var _0x34b954=moment()[_0xe890('0x96')]()['toString']();var _0x124611=path[_0xe890('0x61')](config[_0xe890('0x62')],_0xe890('0x97'),_0xe890('0x98'),_0xe890('0x99'));var _0x302d8f=path[_0xe890('0x61')](config['root'],_0xe890('0x97'),'files','attachments');var _0x1ee9a1=util[_0xe890('0x6f')]('message-%s.eml',_0x34b954);return db[_0xe890('0x2d')][_0xe890('0x47')]({'where':{'id':_0x131b7e[_0xe890('0x49')]['id']},'attributes':['id','body','from','to','cc',_0xe890('0x9a'),_0xe890('0x9b'),_0xe890('0x9c')],'include':_0x131b7e[_0xe890('0x33')][_0xe890('0x60')]?[{'model':db[_0xe890('0x9d')],'as':_0xe890('0x9e')}]:undefined})[_0xe890('0x14')](handleEntityNotFound(_0x18db38,null))[_0xe890('0x14')](function(_0x2fd5fb){if(_0x2fd5fb){var _0x2dad28=_0x2fd5fb;var _0x381dbd={'from':_0x2dad28[_0xe890('0x9f')],'to':_0x2dad28['to'],'subject':_0x2dad28['subject'],'html':htmlEntities['decode'](_0x2dad28[_0xe890('0x48')]),'headers':{'Date':moment(_0x2dad28[_0xe890('0x9c')])['format'](_0xe890('0xa0'))},'attachments':[]};if(_0x2fd5fb['cc']){_0x381dbd[_0xe890('0xa1')]['Cc']=_0x2fd5fb['cc'];}if(_0x2fd5fb[_0xe890('0x9a')]){_0x381dbd[_0xe890('0xa1')]['Bcc']=_0x2fd5fb[_0xe890('0x9a')];}return new BPromise(function(_0x217aed,_0x3f6c65){if(_0x2fd5fb['Attachments']){for(var _0x29b8dd=0x0;_0x29b8dd<_0x2fd5fb['Attachments']['length'];_0x29b8dd++){var _0x22c376=_0x2fd5fb[_0xe890('0x9e')][_0x29b8dd];var _0x50b69d=path[_0xe890('0x61')](_0x302d8f,_0x22c376[_0xe890('0x64')]);if(fs['existsSync'](_0x50b69d)){_0x381dbd['attachments'][_0xe890('0xa2')]({'name':_0x22c376[_0xe890('0x2b')],'contentType':_0x22c376['type'],'data':fs[_0xe890('0xa3')](_0x50b69d)});}}}emlformat[_0xe890('0xa4')](_0x381dbd,function(_0x335936,_0x225657){if(_0x335936)return _0x3f6c65(_0x335936);fs[_0xe890('0xa5')](path[_0xe890('0x61')](_0x124611,_0x1ee9a1),_0x225657);return _0x217aed(_0x225657);});});}})[_0xe890('0x14')](function(_0x295044){if(_0x295044){return _0x18db38[_0xe890('0x95')](path[_0xe890('0x61')](_0x124611,_0x1ee9a1),_0x1ee9a1,function(_0x63ce16){if(!_0x63ce16)fs['unlinkSync'](path[_0xe890('0x61')](_0x124611,_0x1ee9a1));});}})[_0xe890('0x1e')](handleError(_0x18db38,null));}; \ No newline at end of file +var _0xcd69=['VIRTUAL','options','includeAll','include','MailMessage','find','body','params','describe','create','direction','secret','split','findOne','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','attachments','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','format','UserId','user','agent','get','MailInteraction','isNil','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interface','rejectmessage','download','unix','toString','join','server','files','tmp','bcc','createdAt','Attachments','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','push','build','writeFileSync','unlinkSync','eml-format','moment','util','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','limit','undefined','count','set','Content-Range','update','destroy','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filters','type'];(function(_0x5e4ac9,_0x382540){var _0x556134=function(_0x39e3d1){while(--_0x39e3d1){_0x5e4ac9['push'](_0x5e4ac9['shift']());}};_0x556134(++_0x382540);}(_0xcd69,0x198));var _0x9cd6=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xcd69[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require(_0x9cd6('0x0'));var moment=require(_0x9cd6('0x1'));var BPromise=require('bluebird');var util=require(_0x9cd6('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x9cd6('0x3'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x9cd6('0x4'))(_0x9cd6('0x5'));var interaction_log=require(_0x9cd6('0x4'))('mail-interactions');var config=require(_0x9cd6('0x6'));var db=require(_0x9cd6('0x7'))['db'];config['redis']=_[_0x9cd6('0x8')](config['redis'],{'host':_0x9cd6('0x9'),'port':0x18eb});var socket=require(_0x9cd6('0xa'))(new Redis(config[_0x9cd6('0xb')]));var htmlEntities=require('html-entities');require(_0x9cd6('0xc'))[_0x9cd6('0xd')](socket);var jayson=require(_0x9cd6('0xe'));var client=jayson['client'][_0x9cd6('0xf')]({'port':0x232c});var client9003=jayson[_0x9cd6('0x10')]['http']({'port':0x232b});var client9002=jayson[_0x9cd6('0x10')][_0x9cd6('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x3eee26,_0x383293,_0x4bcde7,_0xe1a3e){return new BPromise(function(_0x257508,_0x2c163d){var _0x66014c=_0xe1a3e||client;return _0x66014c[_0x9cd6('0x11')](_0x3eee26,_0x4bcde7)[_0x9cd6('0x12')](function(_0xfdf9d){logger[_0x9cd6('0x13')](_0x9cd6('0x14'),_0x383293,_0x9cd6('0x15'));logger[_0x9cd6('0x16')](_0x9cd6('0x17'),_0x383293,_0x9cd6('0x15'),JSON['stringify'](_0xfdf9d));if(_0xfdf9d[_0x9cd6('0x18')]){if(_0xfdf9d[_0x9cd6('0x18')][_0x9cd6('0x19')]===0x1f4){logger[_0x9cd6('0x18')](_0x9cd6('0x14'),_0x383293,_0xfdf9d[_0x9cd6('0x18')]['message']);return _0x2c163d(_0xfdf9d[_0x9cd6('0x18')][_0x9cd6('0x1a')]);}logger[_0x9cd6('0x18')]('MailMessage,\x20%s,\x20%s',_0x383293,_0xfdf9d[_0x9cd6('0x18')][_0x9cd6('0x1a')]);return _0x257508(_0xfdf9d[_0x9cd6('0x18')]['message']);}else{logger[_0x9cd6('0x13')](_0x9cd6('0x14'),_0x383293,_0x9cd6('0x15'));_0x257508(_0xfdf9d[_0x9cd6('0x1b')][_0x9cd6('0x1a')]);}})[_0x9cd6('0x1c')](function(_0x4b3a0b){logger[_0x9cd6('0x18')]('MailMessage,\x20%s,\x20%s',_0x383293,_0x4b3a0b);_0x2c163d(_0x4b3a0b);});});}function respondWithResult(_0x1190e1,_0x3c71dc){_0x3c71dc=_0x3c71dc||0xc8;return function(_0x42dbdf){if(_0x42dbdf){return _0x1190e1[_0x9cd6('0x1d')](_0x3c71dc)[_0x9cd6('0x1e')](_0x42dbdf);}};}function respondWithFilteredResult(_0x574ef0,_0x590695){return function(_0x3126b0){if(_0x3126b0){var _0x41553e=typeof _0x590695['offset']==='undefined'&&typeof _0x590695[_0x9cd6('0x1f')]===_0x9cd6('0x20');var _0x4f68b9=_0x3126b0[_0x9cd6('0x21')];var _0x21c043=_0x41553e?0x0:_0x590695['offset'];var _0x1135f9=_0x41553e?_0x3126b0[_0x9cd6('0x21')]:_0x590695['offset']+_0x590695['limit'];var _0x5e9663;if(_0x1135f9>=_0x4f68b9){_0x1135f9=_0x4f68b9;_0x5e9663=0xc8;}else{_0x5e9663=0xce;}_0x574ef0[_0x9cd6('0x1d')](_0x5e9663);return _0x574ef0[_0x9cd6('0x22')](_0x9cd6('0x23'),_0x21c043+'-'+_0x1135f9+'/'+_0x4f68b9)['json'](_0x3126b0);}return null;};}function saveUpdates(_0x118ab5){return function(_0x3e32cd){if(_0x3e32cd){return _0x3e32cd[_0x9cd6('0x24')](_0x118ab5)[_0x9cd6('0x12')](function(_0x4ba53e){return _0x4ba53e;});}return null;};}function removeEntity(_0x284bf2){return function(_0x583699){if(_0x583699){return _0x583699[_0x9cd6('0x25')]()['then'](function(){_0x284bf2[_0x9cd6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafcd55){return function(_0xe69329){if(!_0xe69329){_0xafcd55['sendStatus'](0x194);}return _0xe69329;};}function handleError(_0x5e9cd6,_0x216bef){_0x216bef=_0x216bef||0x1f4;return function(_0x2f9368){logger[_0x9cd6('0x18')](_0x2f9368[_0x9cd6('0x26')]);if(_0x2f9368[_0x9cd6('0x27')]){delete _0x2f9368[_0x9cd6('0x27')];}_0x5e9cd6['status'](_0x216bef)['send'](_0x2f9368);};}exports[_0x9cd6('0x28')]=function(_0x120f18,_0x443552){var _0xe63860={},_0x12cf1c={},_0x3388cf={'count':0x0,'rows':[]};var _0xca9600=_['map'](db['MailMessage'][_0x9cd6('0x29')],function(_0x3ebdd1){return{'name':_0x3ebdd1[_0x9cd6('0x2a')],'type':_0x3ebdd1['type'][_0x9cd6('0x2b')]};});_0x12cf1c[_0x9cd6('0x2c')]=_[_0x9cd6('0x2d')](_0xca9600,_0x9cd6('0x27'));_0x12cf1c[_0x9cd6('0x2e')]=_[_0x9cd6('0x2f')](_0x120f18[_0x9cd6('0x2e')]);_0x12cf1c['filters']=_[_0x9cd6('0x30')](_0x12cf1c[_0x9cd6('0x2c')],_0x12cf1c['query']);_0xe63860[_0x9cd6('0x31')]=_[_0x9cd6('0x30')](_0x12cf1c['model'],qs[_0x9cd6('0x32')](_0x120f18[_0x9cd6('0x2e')][_0x9cd6('0x32')]));_0xe63860[_0x9cd6('0x31')]=_0xe63860['attributes'][_0x9cd6('0x33')]?_0xe63860[_0x9cd6('0x31')]:_0x12cf1c['model'];if(!_0x120f18[_0x9cd6('0x2e')][_0x9cd6('0x34')](_0x9cd6('0x35'))){_0xe63860[_0x9cd6('0x1f')]=qs[_0x9cd6('0x1f')](_0x120f18[_0x9cd6('0x2e')][_0x9cd6('0x1f')]);_0xe63860[_0x9cd6('0x36')]=qs[_0x9cd6('0x36')](_0x120f18[_0x9cd6('0x2e')][_0x9cd6('0x36')]);}_0xe63860['order']=qs[_0x9cd6('0x37')](_0x120f18[_0x9cd6('0x2e')][_0x9cd6('0x37')]);_0xe63860[_0x9cd6('0x38')]=qs['filters'](_[_0x9cd6('0x39')](_0x120f18[_0x9cd6('0x2e')],_0x12cf1c[_0x9cd6('0x3a')]),_0xca9600);if(_0x120f18[_0x9cd6('0x2e')]['filter']){_0xe63860['where']=_['merge'](_0xe63860[_0x9cd6('0x38')],{'$or':_[_0x9cd6('0x2d')](_0xca9600,function(_0x309f77){if(_0x309f77[_0x9cd6('0x3b')]!==_0x9cd6('0x3c')){var _0x27a91c={};_0x27a91c[_0x309f77['name']]={'$like':'%'+_0x120f18[_0x9cd6('0x2e')]['filter']+'%'};return _0x27a91c;}})});}_0xe63860=_['merge']({},_0xe63860,_0x120f18[_0x9cd6('0x3d')]);var _0x19f7bb={'where':_0xe63860['where']};return db['MailMessage']['count'](_0x19f7bb)[_0x9cd6('0x12')](function(_0x4bd474){_0x3388cf['count']=_0x4bd474;if(_0x120f18[_0x9cd6('0x2e')][_0x9cd6('0x3e')]){_0xe63860[_0x9cd6('0x3f')]=[{'all':!![]}];}return db[_0x9cd6('0x40')]['findAll'](_0xe63860);})[_0x9cd6('0x12')](function(_0x2da95c){_0x3388cf['rows']=_0x2da95c;return _0x3388cf;})[_0x9cd6('0x12')](respondWithFilteredResult(_0x443552,_0xe63860))[_0x9cd6('0x1c')](handleError(_0x443552,null));};exports['show']=function(_0x4d0066,_0x399b88){var _0x14fc8c={'raw':!![],'where':{'id':_0x4d0066['params']['id']}},_0x5b651e={};_0x5b651e[_0x9cd6('0x2c')]=_[_0x9cd6('0x2f')](db[_0x9cd6('0x40')][_0x9cd6('0x29')]);_0x5b651e['query']=_['keys'](_0x4d0066[_0x9cd6('0x2e')]);_0x5b651e[_0x9cd6('0x3a')]=_[_0x9cd6('0x30')](_0x5b651e['model'],_0x5b651e[_0x9cd6('0x2e')]);_0x14fc8c[_0x9cd6('0x31')]=_[_0x9cd6('0x30')](_0x5b651e[_0x9cd6('0x2c')],qs['fields'](_0x4d0066[_0x9cd6('0x2e')][_0x9cd6('0x32')]));_0x14fc8c[_0x9cd6('0x31')]=_0x14fc8c[_0x9cd6('0x31')]['length']?_0x14fc8c[_0x9cd6('0x31')]:_0x5b651e['model'];if(_0x4d0066[_0x9cd6('0x2e')][_0x9cd6('0x3e')]){_0x14fc8c[_0x9cd6('0x3f')]=[{'all':!![]}];}_0x14fc8c=_['merge']({},_0x14fc8c,_0x4d0066['options']);return db[_0x9cd6('0x40')][_0x9cd6('0x41')](_0x14fc8c)[_0x9cd6('0x12')](handleEntityNotFound(_0x399b88,null))[_0x9cd6('0x12')](respondWithResult(_0x399b88,null))['catch'](handleError(_0x399b88,null));};exports[_0x9cd6('0x24')]=function(_0x14d295,_0x4d18a7){if(_0x14d295[_0x9cd6('0x42')]['id']){delete _0x14d295[_0x9cd6('0x42')]['id'];}return db[_0x9cd6('0x40')]['find']({'where':{'id':_0x14d295[_0x9cd6('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d18a7,null))[_0x9cd6('0x12')](saveUpdates(_0x14d295[_0x9cd6('0x42')],null))[_0x9cd6('0x12')](respondWithResult(_0x4d18a7,null))[_0x9cd6('0x1c')](handleError(_0x4d18a7,null));};exports[_0x9cd6('0x25')]=function(_0x5825ce,_0xe1f59){return db['MailMessage'][_0x9cd6('0x41')]({'where':{'id':_0x5825ce[_0x9cd6('0x43')]['id']}})[_0x9cd6('0x12')](handleEntityNotFound(_0xe1f59,null))[_0x9cd6('0x12')](removeEntity(_0xe1f59,null))['catch'](handleError(_0xe1f59,null));};exports[_0x9cd6('0x44')]=function(_0x23c4fa,_0xf5a2ac){return db[_0x9cd6('0x40')]['describe']()[_0x9cd6('0x12')](respondWithResult(_0xf5a2ac,null))['catch'](handleError(_0xf5a2ac,null));};exports[_0x9cd6('0x45')]=function(_0x2f0a17,_0x2bf95d){return db[_0x9cd6('0x40')][_0x9cd6('0x45')](_0x2f0a17[_0x9cd6('0x42')])[_0x9cd6('0x12')](function(_0xf3c7ac){if(_0xf3c7ac){if(_0xf3c7ac[_0x9cd6('0x46')]==='out'&&!_0xf3c7ac[_0x9cd6('0x47')]){var _0x222e58,_0x354dd9,_0x2d8d7d;if(_0x2f0a17['body']['to']){_0x354dd9=_0x2f0a17[_0x9cd6('0x42')]['to'][_0x9cd6('0x48')](',')[0x0];}return db['MailAccount'][_0x9cd6('0x49')]({'where':{'id':_0xf3c7ac['MailAccountId']},'include':[{'model':db[_0x9cd6('0x4a')],'as':_0x9cd6('0x4b'),'include':[{'model':db[_0x9cd6('0x4c')],'as':_0x9cd6('0x4d'),'where':{'email':_0x354dd9},'limit':0x1,'order':[['updatedAt',_0x9cd6('0x4e')]]}]},{'model':db[_0x9cd6('0x4f')],'as':_0x9cd6('0x50'),'raw':!![]}]})[_0x9cd6('0x12')](function(_0x244d08){_0x222e58=_0x244d08;if(_0x222e58&&_0x222e58[_0x9cd6('0x50')]){var _0x27e4b9={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x222e58[_0x9cd6('0x50')][_0x9cd6('0x51')])){_0x27e4b9[_0x9cd6('0x52')]=_0x222e58[_0x9cd6('0x50')][_0x9cd6('0x52')];_0x27e4b9[_0x9cd6('0x53')]=_0x222e58['Smtp'][_0x9cd6('0x53')];_0x27e4b9[_0x9cd6('0x54')]=_0x222e58[_0x9cd6('0x50')]['secure'];if(_0x222e58['Smtp'][_0x9cd6('0x55')]){_0x27e4b9[_0x9cd6('0x56')]={'user':_0x222e58['Smtp']['user'],'pass':_0x222e58[_0x9cd6('0x50')]['pass']};}}else{_0x27e4b9[_0x9cd6('0x51')]=_0x222e58[_0x9cd6('0x50')][_0x9cd6('0x51')];_0x27e4b9[_0x9cd6('0x56')]={'user':_0x222e58[_0x9cd6('0x50')]['user'],'pass':_0x222e58[_0x9cd6('0x50')][_0x9cd6('0x57')]};_0x27e4b9[_0x9cd6('0x54')]=_0x222e58[_0x9cd6('0x50')]['secure'];}if(_0x2f0a17[_0x9cd6('0x42')][_0x9cd6('0x58')]&&_0x2f0a17[_0x9cd6('0x42')][_0x9cd6('0x58')][_0x9cd6('0x33')]){for(var _0x4067fc=0x0;_0x4067fc<_0x2f0a17[_0x9cd6('0x42')][_0x9cd6('0x58')][_0x9cd6('0x33')];_0x4067fc+=0x1){_0x2f0a17['body'][_0x9cd6('0x58')][_0x4067fc]={'filename':_0x2f0a17[_0x9cd6('0x42')][_0x9cd6('0x58')][_0x4067fc]['name'],'path':path['join'](config[_0x9cd6('0x59')],_0x9cd6('0x5a'),_0x2f0a17[_0x9cd6('0x42')][_0x9cd6('0x58')][_0x4067fc]['basename'])};}}_0x2d8d7d={'account':_0x27e4b9,'message':_0x2f0a17[_0x9cd6('0x42')]};return;}})[_0x9cd6('0x12')](function(){if(_0x222e58[_0x9cd6('0x4b')]){if(_0x222e58[_0x9cd6('0x4b')][_0x9cd6('0x4d')][_0x9cd6('0x33')]){return _0x222e58[_0x9cd6('0x4b')][_0x9cd6('0x4d')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x2f0a17['body'],{'firstName':_0x2f0a17['body']['to'],'email':_0x2f0a17['body']['to'],'phone':_0x2f0a17['body']['to'],'ListId':_0x222e58[_0x9cd6('0x5b')]}));}}else{throw new Error(_0x9cd6('0x5c'));}})[_0x9cd6('0x12')](function(){if(_0x2d8d7d){return respondWithRpcPromise(_0x9cd6('0x5d'),_0x9cd6('0x5e'),_0x2d8d7d,client9003)[_0x9cd6('0x12')](function(_0x5f17af){return _0xf3c7ac[_0x9cd6('0x24')]({'read':!![],'messageId':_0x5f17af[_0x9cd6('0x5f')],'sentAt':moment()['format'](_0x9cd6('0x60'))});})[_0x9cd6('0x1c')](function(_0x1f73b8){logger[_0x9cd6('0x18')]('%s',JSON[_0x9cd6('0x61')](_0x1f73b8));return _0xf3c7ac;});}return _0xf3c7ac;});}return _0xf3c7ac;}})['then'](respondWithResult(_0x2bf95d,0xc9))[_0x9cd6('0x1c')](handleError(_0x2bf95d,null));};exports[_0x9cd6('0x62')]=function(_0x216811,_0x4de513){var _0x236ccb={'agent':{},'channel':_0x9cd6('0x63')};if(_0x216811[_0x9cd6('0x42')]['id']){delete _0x216811[_0x9cd6('0x42')]['id'];}_0x216811[_0x9cd6('0x42')][_0x9cd6('0x64')]=!![];_0x216811[_0x9cd6('0x42')][_0x9cd6('0x65')]=moment()[_0x9cd6('0x66')]('YYYY-MM-DD\x20HH:mm:ss');_0x216811[_0x9cd6('0x42')][_0x9cd6('0x67')]=_0x216811['body'][_0x9cd6('0x67')]||_0x216811[_0x9cd6('0x68')]['id'];_0x236ccb[_0x9cd6('0x69')]['id']=_0x216811['body'][_0x9cd6('0x67')];return db[_0x9cd6('0x40')][_0x9cd6('0x41')]({'where':{'id':_0x216811[_0x9cd6('0x43')]['id'],'UserId':null}})[_0x9cd6('0x12')](handleEntityNotFound(_0x4de513,null))[_0x9cd6('0x12')](saveUpdates(_0x216811[_0x9cd6('0x42')],null))[_0x9cd6('0x12')](function(_0x162514){if(_0x162514){_0x236ccb[_0x9cd6('0x1a')]=_0x162514[_0x9cd6('0x6a')]({'plain':!![]});return db[_0x9cd6('0x6b')][_0x9cd6('0x41')]({'where':{'id':_0x162514['MailInteractionId']}});}return null;})[_0x9cd6('0x12')](handleEntityNotFound(_0x4de513,null))['then'](function(_0x2104e6){if(_0x2104e6){return _0x2104e6['update']({'UserId':_0x216811[_0x9cd6('0x42')][_0x9cd6('0x67')],'read1stAt':_[_0x9cd6('0x6c')](_0x2104e6[_0x9cd6('0x6d')])?moment()[_0x9cd6('0x66')](_0x9cd6('0x60')):undefined});}return null;})['then'](function(_0xf7242f){if(_0xf7242f){_0x236ccb[_0x9cd6('0x6e')]=_0xf7242f['get']({'plain':!![]});interaction_log[_0x9cd6('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x216811[_0x9cd6('0x68')]['id'],_0x216811['user'][_0x9cd6('0x27')],_0x216811['user'][_0x9cd6('0x6f')],_0x236ccb['interaction']['id'],_0x216811['body']?JSON[_0x9cd6('0x61')](_0x216811['body']):_0x9cd6('0x70'));return respondWithRpcPromise('AcceptMessage',_0x9cd6('0x71'),_0x236ccb);}return null;})['then'](function(_0x10588c){var _0x53eeb4=_0x9cd6('0x72')+_0x10588c[_0x9cd6('0x1a')][_0x9cd6('0x73')];return db[_0x9cd6('0x74')]['query'](_0x53eeb4,{'type':db[_0x9cd6('0x75')][_0x9cd6('0x76')][_0x9cd6('0x77')],'raw':!![]})[_0x9cd6('0x12')](function(_0x5444ba){return _0x5444ba;});})[_0x9cd6('0x12')](function(_0x5b8177){if(_0x5b8177){_0x236ccb[_0x9cd6('0x1a')][_0x9cd6('0x78')]=_0x5b8177[0x0];if(!_0x216811['body'][_0x9cd6('0x67')])return;return db[_0x9cd6('0x79')]['find']({'where':{'id':_0x216811[_0x9cd6('0x42')]['UserId'],'role':_0x9cd6('0x69')},'attributes':['id','name',_0x9cd6('0x7a'),_0x9cd6('0x7b'),_0x9cd6('0x7c')],'raw':!![]});}return null;})['then'](function(_0x590d0c){if(!_0x590d0c)return null;_0x236ccb[_0x9cd6('0x1a')]['agent']=_0x590d0c;return _0x236ccb;})[_0x9cd6('0x12')](function(_0x155ada){if(_0x155ada){if(_0x216811['body']['manual']){_0x236ccb[_0x9cd6('0x1a')]['interface']=util['format'](_0x9cd6('0x7d'),_0x216811[_0x9cd6('0x68')]['name']);_0x236ccb['message'][_0x9cd6('0x7e')]=_0x236ccb[_0x9cd6('0x7e')];_0x236ccb[_0x9cd6('0x1a')][_0x9cd6('0x7f')]=_0x236ccb[_0x9cd6('0x7e')];_0x236ccb[_0x9cd6('0x1a')][_0x9cd6('0x80')]=_0x9cd6('0x62');_0x236ccb[_0x9cd6('0x1a')]['body']=htmlToText[_0x9cd6('0x81')](_0x236ccb[_0x9cd6('0x1a')]['body']);return respondWithRpcPromise(_0x9cd6('0x82'),_0x9cd6('0x82'),{'event':_0x9cd6('0x83'),'message':_0x236ccb[_0x9cd6('0x1a')]},client9002)['then'](function(){return _0x236ccb;});}return _0x236ccb;}return null;})[_0x9cd6('0x12')](respondWithResult(_0x4de513,null))[_0x9cd6('0x1c')](handleError(_0x4de513,null));};exports[_0x9cd6('0x84')]=function(_0x570b84,_0x14ba31){var _0x1de6d5={'agent':{},'channel':_0x9cd6('0x63')};if(_0x570b84[_0x9cd6('0x42')]['id']){delete _0x570b84['body']['id'];}_0x570b84[_0x9cd6('0x42')][_0x9cd6('0x67')]=_0x570b84[_0x9cd6('0x42')][_0x9cd6('0x67')]||_0x570b84[_0x9cd6('0x68')]['id'];_0x1de6d5[_0x9cd6('0x69')]['id']=_0x570b84[_0x9cd6('0x42')][_0x9cd6('0x67')];return db['MailMessage'][_0x9cd6('0x41')]({'where':{'id':_0x570b84[_0x9cd6('0x43')]['id'],'UserId':null}})[_0x9cd6('0x12')](handleEntityNotFound(_0x14ba31,null))[_0x9cd6('0x12')](function(_0x350753){if(_0x350753){_0x1de6d5[_0x9cd6('0x1a')]=_0x350753[_0x9cd6('0x6a')]({'plain':!![]});return db[_0x9cd6('0x6b')][_0x9cd6('0x41')]({'where':{'id':_0x350753['MailInteractionId']}});}return null;})[_0x9cd6('0x12')](handleEntityNotFound(_0x14ba31,null))['then'](function(_0x48c71a){if(_0x48c71a){_0x1de6d5[_0x9cd6('0x6e')]=_0x48c71a[_0x9cd6('0x6a')]({'plain':!![]});interaction_log[_0x9cd6('0x13')](_0x9cd6('0x85'),_0x570b84[_0x9cd6('0x68')]['id'],_0x570b84[_0x9cd6('0x68')][_0x9cd6('0x27')],_0x570b84['user'][_0x9cd6('0x6f')],_0x1de6d5[_0x9cd6('0x6e')]['id'],_0x570b84[_0x9cd6('0x42')]?JSON['stringify'](_0x570b84[_0x9cd6('0x42')]):_0x9cd6('0x70'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1de6d5);}return null;})[_0x9cd6('0x12')](function(_0x14d758){var _0x70f8cd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14d758['message'][_0x9cd6('0x73')];return db['sequelize'][_0x9cd6('0x2e')](_0x70f8cd,{'type':db[_0x9cd6('0x75')][_0x9cd6('0x76')][_0x9cd6('0x77')],'raw':!![]})['then'](function(_0x476d80){return _0x476d80;});})[_0x9cd6('0x12')](function(_0xa93e2c){if(_0xa93e2c){_0x1de6d5['message']['contact']=_0xa93e2c[0x0];if(!_0x570b84[_0x9cd6('0x42')]['UserId'])return;return db[_0x9cd6('0x79')][_0x9cd6('0x41')]({'where':{'id':_0x570b84['body'][_0x9cd6('0x67')],'role':_0x9cd6('0x69')},'attributes':['id',_0x9cd6('0x27'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x562e44){if(!_0x562e44)return null;_0x1de6d5[_0x9cd6('0x1a')][_0x9cd6('0x69')]=_0x562e44;return _0x1de6d5;})[_0x9cd6('0x12')](function(_0x5c78e4){if(_0x5c78e4){_0x5c78e4['message'][_0x9cd6('0x86')]=util['format']('SIP/%s',_0x570b84[_0x9cd6('0x68')][_0x9cd6('0x27')]);_0x5c78e4[_0x9cd6('0x1a')]['channel']=_0x1de6d5['channel'];_0x5c78e4[_0x9cd6('0x1a')][_0x9cd6('0x7f')]=_0x1de6d5[_0x9cd6('0x7e')];_0x5c78e4[_0x9cd6('0x1a')][_0x9cd6('0x80')]=_0x9cd6('0x84');_0x5c78e4[_0x9cd6('0x1a')]['body']=htmlToText[_0x9cd6('0x81')](_0x1de6d5[_0x9cd6('0x1a')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x9cd6('0x87'),'message':_0x5c78e4[_0x9cd6('0x1a')]},client9002);return _0x1de6d5;}return null;})['then'](respondWithResult(_0x14ba31,null))[_0x9cd6('0x1c')](handleError(_0x14ba31,null));};exports[_0x9cd6('0x88')]=function(_0x2245fc,_0x49b02c){var _0x3f9325=moment()[_0x9cd6('0x89')]()[_0x9cd6('0x8a')]();var _0x8f1efb=path[_0x9cd6('0x8b')](config[_0x9cd6('0x59')],_0x9cd6('0x8c'),_0x9cd6('0x8d'),_0x9cd6('0x8e'));var _0x4ccc00=path[_0x9cd6('0x8b')](config[_0x9cd6('0x59')],'server',_0x9cd6('0x8d'),_0x9cd6('0x58'));var _0xa8fc46=util[_0x9cd6('0x66')]('message-%s.eml',_0x3f9325);return db['MailMessage'][_0x9cd6('0x41')]({'where':{'id':_0x2245fc['params']['id']},'attributes':['id','body','from','to','cc',_0x9cd6('0x8f'),'subject',_0x9cd6('0x90')],'include':_0x2245fc[_0x9cd6('0x2e')][_0x9cd6('0x58')]?[{'model':db['Attachment'],'as':_0x9cd6('0x91')}]:undefined})[_0x9cd6('0x12')](handleEntityNotFound(_0x49b02c,null))[_0x9cd6('0x12')](function(_0x5dabf3){if(_0x5dabf3){var _0x244414=_0x5dabf3;var _0x2bdb0a={'from':_0x244414[_0x9cd6('0x92')],'to':_0x244414['to'],'subject':_0x244414[_0x9cd6('0x93')],'html':htmlEntities[_0x9cd6('0x94')](_0x244414['body']),'headers':{'Date':moment(_0x244414['createdAt'])[_0x9cd6('0x66')](_0x9cd6('0x95'))},'attachments':[]};if(_0x5dabf3['cc']){_0x2bdb0a[_0x9cd6('0x96')]['Cc']=_0x5dabf3['cc'];}if(_0x5dabf3['bcc']){_0x2bdb0a[_0x9cd6('0x96')]['Bcc']=_0x5dabf3[_0x9cd6('0x8f')];}return new BPromise(function(_0x1186e6,_0xd08d96){if(_0x5dabf3[_0x9cd6('0x91')]){for(var _0x402422=0x0;_0x402422<_0x5dabf3['Attachments']['length'];_0x402422++){var _0x545fad=_0x5dabf3[_0x9cd6('0x91')][_0x402422];var _0x36290b=path[_0x9cd6('0x8b')](_0x4ccc00,_0x545fad[_0x9cd6('0x97')]);if(fs['existsSync'](_0x36290b)){_0x2bdb0a[_0x9cd6('0x58')][_0x9cd6('0x98')]({'name':_0x545fad['name'],'contentType':_0x545fad[_0x9cd6('0x3b')],'data':fs['readFileSync'](_0x36290b)});}}}emlformat[_0x9cd6('0x99')](_0x2bdb0a,function(_0x40bd14,_0xf964a1){if(_0x40bd14)return _0xd08d96(_0x40bd14);fs[_0x9cd6('0x9a')](path['join'](_0x8f1efb,_0xa8fc46),_0xf964a1);return _0x1186e6(_0xf964a1);});});}})[_0x9cd6('0x12')](function(_0x2c77a1){if(_0x2c77a1){return _0x49b02c[_0x9cd6('0x88')](path[_0x9cd6('0x8b')](_0x8f1efb,_0xa8fc46),_0xa8fc46,function(_0x287801){if(!_0x287801)fs[_0x9cd6('0x9b')](path[_0x9cd6('0x8b')](_0x8f1efb,_0xa8fc46));});}})[_0x9cd6('0x1c')](handleError(_0x49b02c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 65fe48d..8d867ed 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 _0x0829=['update','emit','hasOwnProperty','hook','../../mysqldb','MailMessage','save'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0x0829,0x185));var _0x9082=function(_0x5b0765,_0x15a563){_0x5b0765=_0x5b0765-0x0;var _0x317ae5=_0x0829[_0x5b0765];return _0x317ae5;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x9082('0x0'))['db'][_0x9082('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9082('0x2'),'afterUpdate':_0x9082('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2a82d6){return function(_0x1b34f5,_0x2a9638,_0x4ea62b){MailMessageEvents[_0x9082('0x4')](_0x2a82d6+':'+_0x1b34f5['id'],_0x1b34f5);MailMessageEvents[_0x9082('0x4')](_0x2a82d6,_0x1b34f5);_0x4ea62b(null);};}for(var e in events){if(events[_0x9082('0x5')](e)){var event=events[e];MailMessage[_0x9082('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xf04e=['MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1e7600,_0x11348d){var _0x80b052=function(_0x276413){while(--_0x276413){_0x1e7600['push'](_0x1e7600['shift']());}};_0x80b052(++_0x11348d);}(_0xf04e,0xf8));var _0xef04=function(_0x57954d,_0x541f55){_0x57954d=_0x57954d-0x0;var _0x1bd40e=_0xf04e[_0x57954d];return _0x1bd40e;};'use strict';var EventEmitter=require(_0xef04('0x0'));var MailMessage=require(_0xef04('0x1'))['db'][_0xef04('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xef04('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef04('0x4'),'afterDestroy':_0xef04('0x5')};function emitEvent(_0x18dd2e){return function(_0x20fe3a,_0x356849,_0x15d65e){MailMessageEvents[_0xef04('0x6')](_0x18dd2e+':'+_0x20fe3a['id'],_0x20fe3a);MailMessageEvents[_0xef04('0x6')](_0x18dd2e,_0x20fe3a);_0x15d65e(null);};}for(var e in events){if(events[_0xef04('0x7')](e)){var event=events[e];MailMessage[_0xef04('0x8')](e,emitEvent(event));}}module[_0xef04('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index c96ea5a..c8e5cef 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 _0xf93d=['bluebird','request-promise','html-to-text','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','lodash','../../config/logger','api','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf93d,0x92));var _0xdf93=function(_0x45e1ef,_0x3a8703){_0x45e1ef=_0x45e1ef-0x0;var _0x5d956e=_0xf93d[_0x45e1ef];return _0x5d956e;};'use strict';var _=require(_0xdf93('0x0'));var util=require('util');var logger=require(_0xdf93('0x1'))(_0xdf93('0x2'));var moment=require(_0xdf93('0x3'));var BPromise=require(_0xdf93('0x4'));var rp=require(_0xdf93('0x5'));var htmlToText=require(_0xdf93('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf93('0x7'));var attributes=require(_0xdf93('0x8'));module['exports']=function(_0x146b24,_0x2e0494){return _0x146b24['define'](_0xdf93('0x9'),attributes,{'tableName':_0xdf93('0xa'),'paranoid':![],'indexes':[{'name':_0xdf93('0xb'),'fields':[_0xdf93('0xb')]},{'name':'fti_mail_messages','fields':['plainBody','subject'],'type':_0xdf93('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1533f0,_0x384dda,_0x335f63){if(_0x1533f0[_0xdf93('0xd')]){_0x1533f0[_0xdf93('0xe')]=htmlToText[_0xdf93('0xf')](_0x1533f0[_0xdf93('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x335f63(null,_0x384dda);},'afterCreate':function(_0x3c2933,_0x28b8c9,_0xffb69a){var _0x5dba10=_0x146b24[_0xdf93('0x10')];var _0x384119=_0x3c2933[_0xdf93('0x11')]({'plain':!![]});if(_0x384119[_0xdf93('0x12')]['toLowerCase']()==='in'||_0x384119[_0xdf93('0x12')][_0xdf93('0x13')]()===_0xdf93('0x14')&&!_0x384119[_0xdf93('0x15')]&&!_['isNil'](_0x384119[_0xdf93('0x16')])){_0x5dba10[_0xdf93('0x17')][_0xdf93('0x18')]({'where':{'id':_0x384119[_0xdf93('0x19')]}})[_0xdf93('0x1a')](function(_0x4131fe){if(_0x4131fe){_0x4131fe['update']({'lastMsgAt':_0x384119[_0xdf93('0x1b')],'lastMsgDirection':_0x384119[_0xdf93('0x12')][_0xdf93('0x13')]()});}})[_0xdf93('0x1c')](function(_0x579046){console[_0xdf93('0x1d')](_0x579046);});}_0xffb69a();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaf71=['util','bluebird','path','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','toLowerCase','direction','out','secret','MailInteraction','findOne','MailInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4c7218,_0x5d2058){var _0x1c005a=function(_0x449e8c){while(--_0x449e8c){_0x4c7218['push'](_0x4c7218['shift']());}};_0x1c005a(++_0x5d2058);}(_0xaf71,0x6f));var _0x1af7=function(_0x509f38,_0x15c693){_0x509f38=_0x509f38-0x0;var _0x204325=_0xaf71[_0x509f38];return _0x204325;};'use strict';var _=require(_0x1af7('0x0'));var util=require(_0x1af7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1af7('0x2'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x1af7('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1af7('0x4'));module[_0x1af7('0x5')]=function(_0x9e12ba,_0x4cb6bc){return _0x9e12ba['define'](_0x1af7('0x6'),attributes,{'tableName':_0x1af7('0x7'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1af7('0x8')]},{'name':_0x1af7('0x9'),'fields':[_0x1af7('0xa'),_0x1af7('0xb')],'type':_0x1af7('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x133ee4,_0x557a27,_0x320b59){if(_0x133ee4[_0x1af7('0xd')]){_0x133ee4[_0x1af7('0xa')]=htmlToText['fromString'](_0x133ee4['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x320b59(null,_0x557a27);},'afterCreate':function(_0x1850aa,_0x464403,_0x3b39c0){var _0x43bab0=_0x9e12ba[_0x1af7('0xe')];var _0x4c961b=_0x1850aa[_0x1af7('0xf')]({'plain':!![]});if(_0x4c961b['direction'][_0x1af7('0x10')]()==='in'||_0x4c961b[_0x1af7('0x11')][_0x1af7('0x10')]()===_0x1af7('0x12')&&!_0x4c961b[_0x1af7('0x13')]&&!_['isNil'](_0x4c961b['UserId'])){_0x43bab0[_0x1af7('0x14')][_0x1af7('0x15')]({'where':{'id':_0x4c961b[_0x1af7('0x16')]}})['then'](function(_0x49e993){if(_0x49e993){_0x49e993[_0x1af7('0x17')]({'lastMsgAt':_0x4c961b['createdAt'],'lastMsgDirection':_0x4c961b['direction'][_0x1af7('0x10')]()});}})[_0x1af7('0x18')](function(_0x4b2f0d){console[_0x1af7('0x19')](_0x4b2f0d);});}_0x3b39c0();}},'charset':_0x1af7('0x1a'),'collate':_0x1af7('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0c412c3..3943a51 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 _0xf7b4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','lodash','bluebird'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1e72ca,_0x1e7ea9){_0x1e72ca=_0x1e72ca-0x0;var _0x575434=_0xf7b4[_0x1e72ca];return _0x575434;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./mailMessage.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('MailMessage,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});}exports['CreateMailMessage']=function(_0x1daa79){var _0x5adacb=this;return new Promise(function(_0x41cf36,_0x12374b){return db[_0x4f7b('0x1c')][_0x4f7b('0x1d')](_0x1daa79[_0x4f7b('0x1e')],{'raw':_0x1daa79[_0x4f7b('0x1f')]?_0x1daa79[_0x4f7b('0x1f')][_0x4f7b('0x20')]===undefined?!![]:![]:!![]})[_0x4f7b('0x10')](function(_0x5508bd){logger[_0x4f7b('0x11')](_0x4f7b('0x21'),_0x1daa79);logger[_0x4f7b('0x12')]('CreateMailMessage',_0x1daa79,JSON[_0x4f7b('0x15')](_0x5508bd));_0x41cf36(_0x5508bd);})[_0x4f7b('0x1b')](function(_0x5d22f4){logger[_0x4f7b('0x16')]('CreateMailMessage',_0x5d22f4[_0x4f7b('0x19')],_0x1daa79);_0x12374b(_0x5adacb[_0x4f7b('0x16')](0x1f4,_0x5d22f4[_0x4f7b('0x19')]));});});}; \ No newline at end of file +var _0x4213=['request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4213,0x77));var _0x3421=function(_0x2ed8a3,_0x36f7d8){_0x2ed8a3=_0x2ed8a3-0x0;var _0x1f0c0f=_0x4213[_0x2ed8a3];return _0x1f0c0f;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require(_0x3421('0x4'));var fs=require('fs');var Redis=require(_0x3421('0x5'));var db=require(_0x3421('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3421('0x7'))('rpc');var config=require(_0x3421('0x8'));var jayson=require(_0x3421('0x9'));var client=jayson[_0x3421('0xa')][_0x3421('0xb')]({'port':0x232a});config['redis']=_[_0x3421('0xc')](config[_0x3421('0xd')],{'host':_0x3421('0xe'),'port':0x18eb});var socket=require(_0x3421('0xf'))(new Redis(config[_0x3421('0xd')]));require('./mailMessage.socket')[_0x3421('0x10')](socket);function respondWithRpcPromise(_0x58d511,_0x4ff986,_0x12eee0){return new BPromise(function(_0x4b9d24,_0x2d8676){return client[_0x3421('0x11')](_0x58d511,_0x12eee0)[_0x3421('0x12')](function(_0x38b521){logger[_0x3421('0x13')](_0x3421('0x14'),_0x4ff986,_0x3421('0x15'));logger['debug'](_0x3421('0x16'),_0x4ff986,_0x3421('0x15'),JSON[_0x3421('0x17')](_0x38b521));if(_0x38b521[_0x3421('0x18')]){if(_0x38b521[_0x3421('0x18')][_0x3421('0x19')]===0x1f4){logger[_0x3421('0x18')]('MailMessage,\x20%s,\x20%s',_0x4ff986,_0x38b521[_0x3421('0x18')]['message']);return _0x2d8676(_0x38b521[_0x3421('0x18')][_0x3421('0x1a')]);}logger['error'](_0x3421('0x14'),_0x4ff986,_0x38b521['error'][_0x3421('0x1a')]);return _0x4b9d24(_0x38b521[_0x3421('0x18')]['message']);}else{logger[_0x3421('0x13')](_0x3421('0x14'),_0x4ff986,_0x3421('0x15'));_0x4b9d24(_0x38b521[_0x3421('0x1b')][_0x3421('0x1a')]);}})[_0x3421('0x1c')](function(_0x3f1b1d){logger[_0x3421('0x18')](_0x3421('0x14'),_0x4ff986,_0x3f1b1d);_0x2d8676(_0x3f1b1d);});});}exports[_0x3421('0x1d')]=function(_0x538a8b){var _0x50d9a5=this;return new Promise(function(_0x420114,_0x4b59a5){return db['MailMessage']['create'](_0x538a8b[_0x3421('0x1e')],{'raw':_0x538a8b[_0x3421('0x1f')]?_0x538a8b[_0x3421('0x1f')][_0x3421('0x20')]===undefined?!![]:![]:!![]})[_0x3421('0x12')](function(_0x39bed4){logger[_0x3421('0x13')](_0x3421('0x1d'),_0x538a8b);logger[_0x3421('0x21')](_0x3421('0x1d'),_0x538a8b,JSON['stringify'](_0x39bed4));_0x420114(_0x39bed4);})['catch'](function(_0x494423){logger[_0x3421('0x18')](_0x3421('0x1d'),_0x494423[_0x3421('0x1a')],_0x538a8b);_0x4b59a5(_0x50d9a5['error'](0x1f4,_0x494423['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 10222f7..3a1b59b 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 _0xd00a=['./mailMessage.events','save','remove','emit','removeListener','register','length'];(function(_0x1e14af,_0x50029d){var _0x506333=function(_0x1981c6){while(--_0x1981c6){_0x1e14af['push'](_0x1e14af['shift']());}};_0x506333(++_0x50029d);}(_0xd00a,0x1e3));var _0xad00=function(_0x1f6d1d,_0x4fd9cd){_0x1f6d1d=_0x1f6d1d-0x0;var _0xef4d4b=_0xd00a[_0x1f6d1d];return _0xef4d4b;};'use strict';var MailMessageEvents=require(_0xad00('0x0'));var events=[_0xad00('0x1'),_0xad00('0x2'),'update'];function createListener(_0xfe399e,_0x5e744d){return function(_0x68093c){_0x5e744d[_0xad00('0x3')](_0xfe399e,_0x68093c);};}function removeListener(_0xe2ffa9,_0x3306a1){return function(){MailMessageEvents[_0xad00('0x4')](_0xe2ffa9,_0x3306a1);};}exports[_0xad00('0x5')]=function(_0x543bae){for(var _0x375073=0x0,_0x1592d0=events[_0xad00('0x6')];_0x375073<_0x1592d0;_0x375073++){var _0x506a81=events[_0x375073];var _0x440358=createListener('mailMessage:'+_0x506a81,_0x543bae);MailMessageEvents['on'](_0x506a81,_0x440358);}}; \ No newline at end of file +var _0x5304=['save','emit','register','length','mailMessage:','./mailMessage.events'];(function(_0x1b721b,_0x101431){var _0x372fbf=function(_0x4422c8){while(--_0x4422c8){_0x1b721b['push'](_0x1b721b['shift']());}};_0x372fbf(++_0x101431);}(_0x5304,0x167));var _0x4530=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x5304[_0x1b8e60];return _0x363363;};'use strict';var MailMessageEvents=require(_0x4530('0x0'));var events=[_0x4530('0x1'),'remove','update'];function createListener(_0x59b7d5,_0x719e6b){return function(_0xd7beaf){_0x719e6b[_0x4530('0x2')](_0x59b7d5,_0xd7beaf);};}function removeListener(_0x5e331b,_0x69ed2c){return function(){MailMessageEvents['removeListener'](_0x5e331b,_0x69ed2c);};}exports[_0x4530('0x3')]=function(_0x54675a){for(var _0x1fac36=0x0,_0x578432=events[_0x4530('0x4')];_0x1fac36<_0x578432;_0x1fac36++){var _0x3a00cd=events[_0x1fac36];var _0x309fab=createListener(_0x4530('0x5')+_0x3a00cd,_0x54675a);MailMessageEvents['on'](_0x3a00cd,_0x309fab);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 56ae1f1..d34c85c 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 _0xc675=['../../components/auth/service','./mailQueue.controller','isAuthenticated','index','describe','get','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','fs-extra'];(function(_0x5790ab,_0xa4f493){var _0xcbbef1=function(_0x33fbe1){while(--_0x33fbe1){_0x5790ab['push'](_0x5790ab['shift']());}};_0xcbbef1(++_0xa4f493);}(_0xc675,0xc3));var _0x5c67=function(_0x472729,_0x46b7f5){_0x472729=_0x472729-0x0;var _0x538ae2=_0xc675[_0x472729];return _0x538ae2;};'use strict';var multer=require(_0x5c67('0x0'));var util=require('util');var path=require(_0x5c67('0x1'));var timeout=require(_0x5c67('0x2'));var express=require(_0x5c67('0x3'));var router=express['Router']();var fs_extra=require(_0x5c67('0x4'));var auth=require(_0x5c67('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5c67('0x6'));router['get']('/',auth[_0x5c67('0x7')](),controller[_0x5c67('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5c67('0x9')]);router[_0x5c67('0xa')](_0x5c67('0xb'),auth['isAuthenticated'](),controller[_0x5c67('0xc')]);router[_0x5c67('0xa')](_0x5c67('0xd'),auth[_0x5c67('0x7')](),controller['getMembers']);router[_0x5c67('0xa')](_0x5c67('0xe'),auth['isAuthenticated'](),controller[_0x5c67('0xf')]);router[_0x5c67('0xa')](_0x5c67('0x10'),auth[_0x5c67('0x7')](),controller['getAgents']);router[_0x5c67('0x11')]('/',auth[_0x5c67('0x7')](),controller[_0x5c67('0x12')]);router['post'](_0x5c67('0xe'),auth[_0x5c67('0x7')](),controller[_0x5c67('0x13')]);router[_0x5c67('0x11')](_0x5c67('0x10'),auth[_0x5c67('0x7')](),controller['addAgents']);router[_0x5c67('0x14')](_0x5c67('0xb'),auth['isAuthenticated'](),controller[_0x5c67('0x15')]);router['delete'](_0x5c67('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x5c67('0x16')](_0x5c67('0xe'),auth['isAuthenticated'](),controller[_0x5c67('0x17')]);router[_0x5c67('0x16')]('/:id/users',auth[_0x5c67('0x7')](),controller[_0x5c67('0x18')]);module['exports']=router; \ No newline at end of file +var _0x099f=['get','isAuthenticated','describe','/:id','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x099f,0x152));var _0xf099=function(_0xa8eb37,_0x1a9171){_0xa8eb37=_0xa8eb37-0x0;var _0x5bafa3=_0x099f[_0xa8eb37];return _0x5bafa3;};'use strict';var multer=require(_0xf099('0x0'));var util=require(_0xf099('0x1'));var path=require('path');var timeout=require(_0xf099('0x2'));var express=require('express');var router=express[_0xf099('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf099('0x4'));var interaction=require(_0xf099('0x5'));var config=require('../../config/environment');var controller=require(_0xf099('0x6'));router[_0xf099('0x7')]('/',auth[_0xf099('0x8')](),controller['index']);router['get']('/describe',auth[_0xf099('0x8')](),controller[_0xf099('0x9')]);router[_0xf099('0x7')](_0xf099('0xa'),auth[_0xf099('0x8')](),controller['show']);router[_0xf099('0x7')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xf099('0x7')](_0xf099('0xb'),auth['isAuthenticated'](),controller[_0xf099('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xf099('0xd')]('/',auth[_0xf099('0x8')](),controller[_0xf099('0xe')]);router[_0xf099('0xd')](_0xf099('0xb'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xf099('0xf'),auth[_0xf099('0x8')](),controller[_0xf099('0x10')]);router[_0xf099('0x11')](_0xf099('0xa'),auth[_0xf099('0x8')](),controller[_0xf099('0x12')]);router['delete'](_0xf099('0xa'),auth[_0xf099('0x8')](),controller[_0xf099('0x13')]);router[_0xf099('0x14')](_0xf099('0xb'),auth['isAuthenticated'](),controller[_0xf099('0x15')]);router[_0xf099('0x14')](_0xf099('0xf'),auth[_0xf099('0x8')](),controller[_0xf099('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4c6df33..9c7359b 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 _0xb050=['STRING','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x2a9548,_0x2742f6){var _0xf55c55=function(_0x2862d8){while(--_0x2862d8){_0x2a9548['push'](_0x2a9548['shift']());}};_0xf55c55(++_0x2742f6);}(_0xb050,0x124));var _0x0b05=function(_0x155626,_0x1115c3){_0x155626=_0x155626-0x0;var _0x1e184a=_0xb050[_0x155626];return _0x1e184a;};'use strict';var Sequelize=require(_0x0b05('0x0'));module[_0x0b05('0x1')]={'name':{'type':Sequelize[_0x0b05('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0b05('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b05('0x4')](_0x0b05('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xe70f=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xe70f,0xd0));var _0xfe70=function(_0x2ea22b,_0x3ccc8d){_0x2ea22b=_0x2ea22b-0x0;var _0x18e263=_0xe70f[_0x2ea22b];return _0x18e263;};'use strict';var Sequelize=require(_0xfe70('0x0'));module[_0xfe70('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfe70('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfe70('0x3')]},'timeout':{'type':Sequelize[_0xfe70('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfe70('0x5')](_0xfe70('0x6'),_0xfe70('0x7'),_0xfe70('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 97ebd72..36a9b06 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 _0xa391=['model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','MailQueueId','findAll','User','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','hasOwnProperty','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','get','MailQueues','UserProfileResource','end','sendStatus','name','send','map','MailQueue','rawAttributes','fieldName','type','query','keys','intersection'];(function(_0x544072,_0xc41ee1){var _0x590bf6=function(_0x41107f){while(--_0x41107f){_0x544072['push'](_0x544072['shift']());}};_0x590bf6(++_0xc41ee1);}(_0xa391,0x1ee));var _0x1a39=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa391[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a39('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a39('0x1'));var rp=require(_0x1a39('0x2'));var moment=require(_0x1a39('0x3'));var BPromise=require(_0x1a39('0x4'));var Mustache=require(_0x1a39('0x5'));var util=require('util');var path=require(_0x1a39('0x6'));var sox=require(_0x1a39('0x7'));var csv=require(_0x1a39('0x8'));var ejs=require(_0x1a39('0x9'));var fs=require('fs');var fs_extra=require(_0x1a39('0xa'));var _=require(_0x1a39('0xb'));var squel=require(_0x1a39('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a39('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a39('0x8'));var querystring=require(_0x1a39('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a39('0xf'));var authService=require(_0x1a39('0x10'));var qs=require(_0x1a39('0x11'));var as=require(_0x1a39('0x12'));var hardwareService=require(_0x1a39('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1a39('0x14'));var config=require(_0x1a39('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a39('0x16'))['db'];config['redis']=_['defaults'](config[_0x1a39('0x17')],{'host':_0x1a39('0x18'),'port':0x18eb});var socket=require(_0x1a39('0x19'))(new Redis(config[_0x1a39('0x17')]));require(_0x1a39('0x1a'))['register'](socket);function respondWithStatusCode(_0x18203a,_0x3c27cb){_0x3c27cb=_0x3c27cb||0xcc;return function(_0x13bb0f){if(_0x13bb0f){return _0x18203a['sendStatus'](_0x3c27cb);}return _0x18203a[_0x1a39('0x1b')](_0x3c27cb)['end']();};}function respondWithResult(_0x37e32d,_0xdadb41){_0xdadb41=_0xdadb41||0xc8;return function(_0x29bf53){if(_0x29bf53){return _0x37e32d[_0x1a39('0x1b')](_0xdadb41)[_0x1a39('0x1c')](_0x29bf53);}};}function respondWithFilteredResult(_0xc465a6,_0x2d406b){return function(_0x584fdc){if(_0x584fdc){var _0x40edea=typeof _0x2d406b[_0x1a39('0x1d')]===_0x1a39('0x1e')&&typeof _0x2d406b['limit']===_0x1a39('0x1e');var _0x4464c0=_0x584fdc[_0x1a39('0x1f')];var _0x242701=_0x40edea?0x0:_0x2d406b['offset'];var _0x47d446=_0x40edea?_0x584fdc['count']:_0x2d406b['offset']+_0x2d406b[_0x1a39('0x20')];var _0x3146e6;if(_0x47d446>=_0x4464c0){_0x47d446=_0x4464c0;_0x3146e6=0xc8;}else{_0x3146e6=0xce;}_0xc465a6[_0x1a39('0x1b')](_0x3146e6);return _0xc465a6[_0x1a39('0x21')](_0x1a39('0x22'),_0x242701+'-'+_0x47d446+'/'+_0x4464c0)['json'](_0x584fdc);}return null;};}function patchUpdates(_0x1acd5d){return function(_0x29347f){try{jsonpatch[_0x1a39('0x23')](_0x29347f,_0x1acd5d,!![]);}catch(_0x151268){return BPromise[_0x1a39('0x24')](_0x151268);}return _0x29347f['save']();};}function saveUpdates(_0x4d5df4,_0x5c06e6){return function(_0xa7476b){if(_0xa7476b){return _0xa7476b['update'](_0x4d5df4)['then'](function(_0xd0591){return _0xd0591;});}return null;};}function removeEntity(_0x25f601,_0x53799a){return function(_0x3e3c37){if(_0x3e3c37){return _0x3e3c37[_0x1a39('0x25')]()[_0x1a39('0x26')](function(){var _0x73426d=_0x3e3c37[_0x1a39('0x27')]({'plain':!![]});var _0x43c687=_0x1a39('0x28');return db[_0x1a39('0x29')][_0x1a39('0x25')]({'where':{'type':_0x43c687,'resourceId':_0x73426d['id']}})[_0x1a39('0x26')](function(){return _0x3e3c37;});})[_0x1a39('0x26')](function(){_0x25f601['status'](0xcc)[_0x1a39('0x2a')]();});}};}function handleEntityNotFound(_0x45c0eb,_0x4f6bba){return function(_0x2eab2f){if(!_0x2eab2f){_0x45c0eb[_0x1a39('0x2b')](0x194);}return _0x2eab2f;};}function handleError(_0x18dfcc,_0x5b1b43){_0x5b1b43=_0x5b1b43||0x1f4;return function(_0x5147fa){logger['error'](_0x5147fa['stack']);if(_0x5147fa[_0x1a39('0x2c')]){delete _0x5147fa[_0x1a39('0x2c')];}_0x18dfcc[_0x1a39('0x1b')](_0x5b1b43)[_0x1a39('0x2d')](_0x5147fa);};}exports['index']=function(_0x3b899f,_0x5b09d2){var _0x3c7469={},_0x2e2ae0={},_0x2ff825={'count':0x0,'rows':[]};var _0x21fa16=_[_0x1a39('0x2e')](db[_0x1a39('0x2f')][_0x1a39('0x30')],function(_0x428c7e){return{'name':_0x428c7e[_0x1a39('0x31')],'type':_0x428c7e[_0x1a39('0x32')]['key']};});_0x2e2ae0['model']=_[_0x1a39('0x2e')](_0x21fa16,_0x1a39('0x2c'));_0x2e2ae0[_0x1a39('0x33')]=_[_0x1a39('0x34')](_0x3b899f[_0x1a39('0x33')]);_0x2e2ae0['filters']=_[_0x1a39('0x35')](_0x2e2ae0[_0x1a39('0x36')],_0x2e2ae0[_0x1a39('0x33')]);_0x3c7469[_0x1a39('0x37')]=_['intersection'](_0x2e2ae0[_0x1a39('0x36')],qs[_0x1a39('0x38')](_0x3b899f[_0x1a39('0x33')]['fields']));_0x3c7469[_0x1a39('0x37')]=_0x3c7469[_0x1a39('0x37')][_0x1a39('0x39')]?_0x3c7469[_0x1a39('0x37')]:_0x2e2ae0[_0x1a39('0x36')];if(!_0x3b899f[_0x1a39('0x33')]['hasOwnProperty'](_0x1a39('0x3a'))){_0x3c7469[_0x1a39('0x20')]=qs['limit'](_0x3b899f[_0x1a39('0x33')][_0x1a39('0x20')]);_0x3c7469['offset']=qs[_0x1a39('0x1d')](_0x3b899f[_0x1a39('0x33')][_0x1a39('0x1d')]);}_0x3c7469[_0x1a39('0x3b')]=qs['sort'](_0x3b899f['query'][_0x1a39('0x3c')]);_0x3c7469[_0x1a39('0x3d')]=qs[_0x1a39('0x3e')](_[_0x1a39('0x3f')](_0x3b899f['query'],_0x2e2ae0[_0x1a39('0x3e')]),_0x21fa16);if(_0x3b899f[_0x1a39('0x33')][_0x1a39('0x40')]){_0x3c7469[_0x1a39('0x3d')]=_['merge'](_0x3c7469['where'],{'$or':_[_0x1a39('0x2e')](_0x21fa16,function(_0x5928c5){if(_0x5928c5[_0x1a39('0x32')]!==_0x1a39('0x41')){var _0x350212={};_0x350212[_0x5928c5['name']]={'$like':'%'+_0x3b899f[_0x1a39('0x33')]['filter']+'%'};return _0x350212;}})});}_0x3c7469=_[_0x1a39('0x42')]({},_0x3c7469,_0x3b899f['options']);var _0x12b5fc={'where':_0x3c7469[_0x1a39('0x3d')]};return db['MailQueue'][_0x1a39('0x1f')](_0x12b5fc)[_0x1a39('0x26')](function(_0x24becf){_0x2ff825[_0x1a39('0x1f')]=_0x24becf;if(_0x3b899f['query'][_0x1a39('0x43')]){_0x3c7469[_0x1a39('0x44')]=[{'all':!![]}];}return db[_0x1a39('0x2f')]['findAll'](_0x3c7469);})['then'](function(_0x2423ff){_0x2ff825['rows']=_0x2423ff;return _0x2ff825;})[_0x1a39('0x26')](respondWithFilteredResult(_0x5b09d2,_0x3c7469))[_0x1a39('0x45')](handleError(_0x5b09d2,null));};exports[_0x1a39('0x46')]=function(_0x4c6acb,_0x3691b2){var _0x5b3a00={'raw':!![],'where':{'id':_0x4c6acb[_0x1a39('0x47')]['id']}},_0xc0dfdc={};_0xc0dfdc[_0x1a39('0x36')]=_['keys'](db[_0x1a39('0x2f')][_0x1a39('0x30')]);_0xc0dfdc[_0x1a39('0x33')]=_[_0x1a39('0x34')](_0x4c6acb[_0x1a39('0x33')]);_0xc0dfdc[_0x1a39('0x3e')]=_[_0x1a39('0x35')](_0xc0dfdc['model'],_0xc0dfdc[_0x1a39('0x33')]);_0x5b3a00[_0x1a39('0x37')]=_['intersection'](_0xc0dfdc[_0x1a39('0x36')],qs[_0x1a39('0x38')](_0x4c6acb['query']['fields']));_0x5b3a00[_0x1a39('0x37')]=_0x5b3a00[_0x1a39('0x37')][_0x1a39('0x39')]?_0x5b3a00['attributes']:_0xc0dfdc['model'];if(_0x4c6acb['query'][_0x1a39('0x43')]){_0x5b3a00[_0x1a39('0x44')]=[{'all':!![]}];}_0x5b3a00=_[_0x1a39('0x42')]({},_0x5b3a00,_0x4c6acb[_0x1a39('0x48')]);return db[_0x1a39('0x2f')][_0x1a39('0x49')](_0x5b3a00)[_0x1a39('0x26')](handleEntityNotFound(_0x3691b2,null))[_0x1a39('0x26')](respondWithResult(_0x3691b2,null))[_0x1a39('0x45')](handleError(_0x3691b2,null));};exports['create']=function(_0x229391,_0xfc04f8){return db[_0x1a39('0x2f')][_0x1a39('0x4a')](_0x229391[_0x1a39('0x4b')],{})[_0x1a39('0x26')](function(_0x1cec3f){var _0x47629d=_0x229391[_0x1a39('0x4c')][_0x1a39('0x27')]({'plain':!![]});if(!_0x47629d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47629d[_0x1a39('0x4d')]===_0x1a39('0x4c')){var _0x2d9682=_0x1cec3f[_0x1a39('0x27')]({'plain':!![]});var _0x363cc3='MailQueues';return db[_0x1a39('0x4e')][_0x1a39('0x49')]({'where':{'name':_0x363cc3,'userProfileId':_0x47629d['userProfileId']},'raw':!![]})[_0x1a39('0x26')](function(_0x1799db){if(_0x1799db&&_0x1799db['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a39('0x4a')]({'name':_0x2d9682['name'],'resourceId':_0x2d9682['id'],'type':_0x1799db['name'],'sectionId':_0x1799db['id']},{})[_0x1a39('0x26')](function(){return _0x1cec3f;});}else{return _0x1cec3f;}})[_0x1a39('0x45')](function(_0x3bcfe6){logger[_0x1a39('0x4f')](_0x1a39('0x50'),_0x3bcfe6);throw _0x3bcfe6;});}return _0x1cec3f;})[_0x1a39('0x26')](respondWithResult(_0xfc04f8,0xc9))[_0x1a39('0x45')](handleError(_0xfc04f8,null));};exports[_0x1a39('0x51')]=function(_0x3746b6,_0x25efdb){if(_0x3746b6[_0x1a39('0x4b')]['id']){delete _0x3746b6[_0x1a39('0x4b')]['id'];}return db[_0x1a39('0x2f')][_0x1a39('0x49')]({'where':{'id':_0x3746b6[_0x1a39('0x47')]['id']}})['then'](handleEntityNotFound(_0x25efdb,null))[_0x1a39('0x26')](saveUpdates(_0x3746b6[_0x1a39('0x4b')],null))[_0x1a39('0x26')](respondWithResult(_0x25efdb,null))['catch'](handleError(_0x25efdb,null));};exports['destroy']=function(_0x1ac537,_0x23ac5e){return db[_0x1a39('0x2f')]['find']({'where':{'id':_0x1ac537['params']['id']}})[_0x1a39('0x26')](handleEntityNotFound(_0x23ac5e,null))[_0x1a39('0x26')](removeEntity(_0x23ac5e,null))['catch'](handleError(_0x23ac5e,null));};exports[_0x1a39('0x52')]=function(_0x2eeffc,_0x775cfa){return db[_0x1a39('0x2f')][_0x1a39('0x52')]()[_0x1a39('0x26')](respondWithResult(_0x775cfa,null))[_0x1a39('0x45')](handleError(_0x775cfa,null));};exports[_0x1a39('0x53')]=function(_0x57cd4f,_0x1c4822,_0x5e411b){var _0x5b583e={'raw':!![],'where':{}},_0x568e23={},_0x539bed;return db[_0x1a39('0x2f')][_0x1a39('0x54')]({'where':{'id':_0x57cd4f[_0x1a39('0x47')]['id']}})[_0x1a39('0x26')](handleEntityNotFound(_0x1c4822,null))['then'](function(_0x426c2b){if(_0x426c2b){_0x539bed=_0x426c2b[_0x1a39('0x27')]({'plain':!![]});_0x568e23[_0x1a39('0x36')]=_[_0x1a39('0x34')](db[_0x1a39('0x55')][_0x1a39('0x30')]);_0x568e23[_0x1a39('0x33')]=_[_0x1a39('0x34')](_0x57cd4f[_0x1a39('0x33')]);_0x568e23['filters']=_[_0x1a39('0x35')](_0x568e23[_0x1a39('0x36')],_0x568e23['query']);_0x5b583e[_0x1a39('0x37')]=_[_0x1a39('0x35')](_0x568e23[_0x1a39('0x36')],qs[_0x1a39('0x38')](_0x57cd4f[_0x1a39('0x33')][_0x1a39('0x38')]));_0x5b583e[_0x1a39('0x37')]=_0x5b583e[_0x1a39('0x37')][_0x1a39('0x39')]?_0x5b583e[_0x1a39('0x37')]:_0x568e23[_0x1a39('0x36')];if(!_0x57cd4f[_0x1a39('0x33')]['hasOwnProperty'](_0x1a39('0x3a'))){_0x5b583e['limit']=qs['limit'](_0x57cd4f[_0x1a39('0x33')]['limit']);_0x5b583e[_0x1a39('0x1d')]=qs[_0x1a39('0x1d')](_0x57cd4f[_0x1a39('0x33')][_0x1a39('0x1d')]);}_0x5b583e[_0x1a39('0x3b')]=qs[_0x1a39('0x3c')](_0x57cd4f['query'][_0x1a39('0x3c')]);_0x5b583e[_0x1a39('0x3d')]=qs[_0x1a39('0x3e')](_[_0x1a39('0x3f')](_0x57cd4f['query'],_0x568e23['filters']));_0x5b583e[_0x1a39('0x3d')][_0x1a39('0x56')]=_0x426c2b['id'];if(_0x57cd4f['query']['filter']){_0x5b583e[_0x1a39('0x3d')]=_['merge'](_0x5b583e[_0x1a39('0x3d')],{'$or':_[_0x1a39('0x2e')](_0x5b583e['attributes'],function(_0x5203bd){var _0x3ba58f={};_0x3ba58f[_0x5203bd]={'$like':'%'+_0x57cd4f[_0x1a39('0x33')]['filter']+'%'};return _0x3ba58f;})});}_0x5b583e=_[_0x1a39('0x42')]({},_0x5b583e,_0x57cd4f[_0x1a39('0x48')]);return db['UserMailQueue'][_0x1a39('0x57')](_0x5b583e);}})[_0x1a39('0x26')](function(_0x2354a4){if(_0x2354a4){return db[_0x1a39('0x58')][_0x1a39('0x59')]({'where':{'id':_['map'](_0x2354a4,'UserId'),'role':_0x1a39('0x5a')},'attributes':['id',_0x1a39('0x2c'),'mailPause',_0x1a39('0x5b'),_0x1a39('0x5c')]});}})[_0x1a39('0x26')](function(_0x519aa3){if(_0x519aa3){return{'count':_0x519aa3[_0x1a39('0x1f')],'rows':_[_0x1a39('0x2e')](_0x519aa3['rows'],function(_0x378ff2){return{'membername':_0x378ff2[_0x1a39('0x2c')],'UserId':_0x378ff2['id'],'queue_name':_0x539bed[_0x1a39('0x2c')],'MailQueueId':_0x539bed['id'],'interface':util['format'](_0x1a39('0x5d'),_0x1a39('0x5e'),_0x378ff2[_0x1a39('0x2c')]),'penalty':0x0,'paused':_0x378ff2['mailPause'],'createdAt':_0x378ff2[_0x1a39('0x5c')],'updatedAt':_0x378ff2[_0x1a39('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a39('0x26')](respondWithFilteredResult(_0x1c4822,_0x5b583e))[_0x1a39('0x45')](handleError(_0x1c4822,null));};exports[_0x1a39('0x5f')]=function(_0x29ecac,_0x163873,_0x14fdf4){var _0x1fb5af={};var _0x4bbb6e={};var _0x9508ab;var _0x1b0335;return db['MailQueue'][_0x1a39('0x54')]({'where':{'id':_0x29ecac[_0x1a39('0x47')]['id']}})['then'](handleEntityNotFound(_0x163873,null))[_0x1a39('0x26')](function(_0x521d1f){if(_0x521d1f){_0x9508ab=_0x521d1f;_0x4bbb6e[_0x1a39('0x36')]=_['keys'](db[_0x1a39('0x60')]['rawAttributes']);_0x4bbb6e[_0x1a39('0x33')]=_[_0x1a39('0x34')](_0x29ecac['query']);_0x4bbb6e[_0x1a39('0x3e')]=_['intersection'](_0x4bbb6e[_0x1a39('0x36')],_0x4bbb6e[_0x1a39('0x33')]);_0x1fb5af[_0x1a39('0x37')]=_[_0x1a39('0x35')](_0x4bbb6e[_0x1a39('0x36')],qs[_0x1a39('0x38')](_0x29ecac['query'][_0x1a39('0x38')]));_0x1fb5af[_0x1a39('0x37')]=_0x1fb5af[_0x1a39('0x37')][_0x1a39('0x39')]?_0x1fb5af[_0x1a39('0x37')]:_0x4bbb6e['model'];_0x1fb5af[_0x1a39('0x3b')]=qs[_0x1a39('0x3c')](_0x29ecac['query'][_0x1a39('0x3c')]);_0x1fb5af[_0x1a39('0x3d')]=qs['filters'](_[_0x1a39('0x3f')](_0x29ecac[_0x1a39('0x33')],_0x4bbb6e['filters']));if(_0x29ecac[_0x1a39('0x33')]['filter']){_0x1fb5af[_0x1a39('0x3d')]=_[_0x1a39('0x42')](_0x1fb5af['where'],{'$or':_[_0x1a39('0x2e')](_0x1fb5af[_0x1a39('0x37')],function(_0x56f6ff){var _0x51d748={};_0x51d748[_0x56f6ff]={'$like':'%'+_0x29ecac[_0x1a39('0x33')]['filter']+'%'};return _0x51d748;})});}_0x1fb5af=_[_0x1a39('0x42')]({},_0x1fb5af,_0x29ecac[_0x1a39('0x48')]);return _0x9508ab['getTeams'](_0x1fb5af);}})[_0x1a39('0x26')](function(_0x50495e){if(_0x50495e){_0x1b0335=_0x50495e[_0x1a39('0x39')];if(!_0x29ecac['query']['hasOwnProperty'](_0x1a39('0x3a'))){_0x1fb5af[_0x1a39('0x20')]=qs['limit'](_0x29ecac['query']['limit']);_0x1fb5af[_0x1a39('0x1d')]=qs[_0x1a39('0x1d')](_0x29ecac[_0x1a39('0x33')][_0x1a39('0x1d')]);}return _0x9508ab[_0x1a39('0x5f')](_0x1fb5af);}})[_0x1a39('0x26')](function(_0x498b39){if(_0x498b39){return _0x498b39?{'count':_0x1b0335,'rows':_0x498b39}:null;}})[_0x1a39('0x26')](respondWithResult(_0x163873,null))[_0x1a39('0x45')](handleError(_0x163873,null));};exports[_0x1a39('0x61')]=function(_0x5b2e66,_0xd8a75c,_0x19c1bd){var _0x44d967=_0x5b2e66['body'][_0x1a39('0x62')];return db[_0x1a39('0x60')][_0x1a39('0x57')]({'where':{'id':_0x44d967},'attributes':['id'],'include':[{'model':db[_0x1a39('0x58')],'as':_0x1a39('0x63'),'attributes':['id','name',_0x1a39('0x64'),_0x1a39('0x65'),_0x1a39('0x66')],'raw':!![]}]})[_0x1a39('0x26')](function(_0x5bc616){if(_0x5bc616){var _0x30011c=_[_0x1a39('0x67')](_0x5bc616,function(_0x4521a8){var _0x39a5d5=_0x4521a8['get']({'plain':!![]});return _0x39a5d5['Agents'];});return db[_0x1a39('0x2f')][_0x1a39('0x49')]({'where':{'id':_0x5b2e66[_0x1a39('0x47')]['id']}})[_0x1a39('0x26')](function(_0x47eeed){return db[_0x1a39('0x68')][_0x1a39('0x69')](function(_0x2f0cd){return _0x47eeed[_0x1a39('0x61')](_0x44d967,{'transaction':_0x2f0cd})[_0x1a39('0x26')](function(){return BPromise[_0x1a39('0x6a')](_0x30011c,function(_0x4bfa59){return db[_0x1a39('0x55')][_0x1a39('0x6b')]({'where':{'UserId':_0x4bfa59['id'],'MailQueueId':_0x5b2e66[_0x1a39('0x47')]['id']},'transaction':_0x2f0cd});});})[_0x1a39('0x26')](function(){_0x30011c[_0x1a39('0x6c')](function(_0xec75b){socket[_0x1a39('0x6d')](_0x1a39('0x6e'),{'UserId':_0xec75b['id'],'MailQueueId':_0x47eeed['id']});});});});});}})[_0x1a39('0x26')](respondWithStatusCode(_0xd8a75c,null))[_0x1a39('0x45')](handleError(_0xd8a75c,null));};exports['removeTeams']=function(_0x25cb69,_0xfe9078,_0x395bb7){return db[_0x1a39('0x60')][_0x1a39('0x57')]({'where':{'id':_0x25cb69[_0x1a39('0x33')][_0x1a39('0x62')]},'attributes':['id'],'include':[{'model':db[_0x1a39('0x58')],'as':_0x1a39('0x63'),'attributes':['id'],'raw':!![]}]})[_0x1a39('0x26')](handleEntityNotFound(_0xfe9078,null))[_0x1a39('0x26')](function(_0xf9175c){var _0x3f9017=_[_0x1a39('0x2e')](_0xf9175c,'id');var _0x4aa682=[];var _0x3f4b60=[];var _0x454d19=squel[_0x1a39('0x6f')]();_0x454d19[_0x1a39('0x70')](_0x1a39('0x71'))['from']('team_has_mail_queues','tq')[_0x1a39('0x72')](_0x1a39('0x73'),'ut',_0x1a39('0x74'))[_0x1a39('0x3d')](_0x1a39('0x75'),_0x25cb69[_0x1a39('0x47')]['id']);for(var _0x3bcb80=0x0;_0x3bcb80<_0xf9175c[_0x1a39('0x39')];_0x3bcb80+=0x1){let _0x1349fb=_0xf9175c[_0x3bcb80];for(var _0x3eb094=0x0;_0x3eb094<_0x1349fb[_0x1a39('0x63')]['length'];_0x3eb094+=0x1){let _0x14ec77=_0x1349fb[_0x1a39('0x63')][_0x3eb094];var _0x2ce05f=_0x454d19[_0x1a39('0x76')]();_0x2ce05f[_0x1a39('0x3d')](_0x1a39('0x77'),_0x14ec77['id']);_0x3f4b60[_0x1a39('0x78')](db[_0x1a39('0x68')][_0x1a39('0x33')](_0x2ce05f['toString'](),{'type':db[_0x1a39('0x68')][_0x1a39('0x79')]['SELECT']})['then'](function(_0x4bdb87){if(_0x4bdb87[_0x1a39('0x39')]===0x1){return _0x14ec77['id'];}else{var _0x19984a=_[_0x1a39('0x7a')](_[_0x1a39('0x2e')](_0x4bdb87,_0x1a39('0x7b')),function(_0x28ab74){return _['includes'](_0x3f9017,_0x28ab74);});if(_0x19984a){return _0x14ec77['id'];}}}));}}return BPromise[_0x1a39('0x7c')](_0x3f4b60)[_0x1a39('0x26')](function(_0x43e370){_0x4aa682=_(_0x4aa682)[_0x1a39('0x7d')](_0x43e370)[_0x1a39('0x7e')]()[_0x1a39('0x7f')]();return db['MailQueue'][_0x1a39('0x49')]({'where':{'id':_0x25cb69[_0x1a39('0x47')]['id']}})['then'](function(_0x3de98c){return db[_0x1a39('0x68')][_0x1a39('0x69')](function(_0x2c3b33){return _0x3de98c[_0x1a39('0x80')](_0x25cb69[_0x1a39('0x33')][_0x1a39('0x62')],{'transaction':_0x2c3b33})[_0x1a39('0x26')](function(){if(!_[_0x1a39('0x81')](_0x4aa682)){return _0x3de98c[_0x1a39('0x82')](_0x4aa682,{'transaction':_0x2c3b33});}})['then'](function(){_0x4aa682['forEach'](function(_0x1d9e5b){socket['emit'](_0x1a39('0x83'),{'UserId':_0x1d9e5b,'MailQueueId':_0x3de98c['id']});});});});});});})[_0x1a39('0x26')](respondWithStatusCode(_0xfe9078,null))[_0x1a39('0x45')](handleError(_0xfe9078,null));};exports[_0x1a39('0x84')]=function(_0x158881,_0x308d9b,_0x412f0a){return db[_0x1a39('0x2f')][_0x1a39('0x49')]({'where':{'id':_0x158881[_0x1a39('0x47')]['id']}})[_0x1a39('0x26')](handleEntityNotFound(_0x308d9b,null))['then'](function(_0x493b2c){if(_0x493b2c){return _0x493b2c['addAgents'](_0x158881['body']['ids'],_['omit'](_0x158881[_0x1a39('0x4b')],['ids','id'])||{})[_0x1a39('0x85')](function(_0x5d9b4f){for(var _0x58e112=0x0;_0x58e112<_0x158881[_0x1a39('0x4b')][_0x1a39('0x62')][_0x1a39('0x39')];_0x58e112+=0x1){socket[_0x1a39('0x6d')]('userMailQueue:save',{'UserId':Number(_0x158881[_0x1a39('0x4b')]['ids'][_0x58e112]),'MailQueueId':Number(_0x158881['params']['id'])});}return _0x5d9b4f;});}})[_0x1a39('0x26')](respondWithResult(_0x308d9b,null))[_0x1a39('0x45')](handleError(_0x308d9b,null));};exports[_0x1a39('0x82')]=function(_0x16b960,_0x1c3f44,_0x3dc977){return db[_0x1a39('0x2f')][_0x1a39('0x49')]({'where':{'id':_0x16b960['params']['id']}})[_0x1a39('0x26')](handleEntityNotFound(_0x1c3f44,null))[_0x1a39('0x26')](function(_0x4e3e38){if(_0x4e3e38){return _0x4e3e38[_0x1a39('0x82')](_0x16b960[_0x1a39('0x33')][_0x1a39('0x62')])['then'](function(){if(_[_0x1a39('0x86')](_0x16b960[_0x1a39('0x33')][_0x1a39('0x62')])){for(var _0xd1670e=0x0;_0xd1670e<_0x16b960['query'][_0x1a39('0x62')]['length'];_0xd1670e+=0x1){socket[_0x1a39('0x6d')](_0x1a39('0x83'),{'UserId':Number(_0x16b960[_0x1a39('0x33')][_0x1a39('0x62')][_0xd1670e]),'MailQueueId':Number(_0x16b960['params']['id'])});}}else{socket[_0x1a39('0x6d')](_0x1a39('0x83'),{'UserId':Number(_0x16b960[_0x1a39('0x33')][_0x1a39('0x62')]),'MailQueueId':Number(_0x16b960[_0x1a39('0x47')]['id'])});}});}})[_0x1a39('0x26')](respondWithStatusCode(_0x1c3f44,null))['catch'](handleError(_0x1c3f44,null));};exports['getAgents']=function(_0x362e08,_0x573856,_0x507445){var _0xec5b59={};var _0x2a16b6={};var _0x484507;var _0x46f44a;return db['MailQueue'][_0x1a39('0x54')]({'where':{'id':_0x362e08[_0x1a39('0x47')]['id']}})[_0x1a39('0x26')](handleEntityNotFound(_0x573856,null))['then'](function(_0x5334e4){if(_0x5334e4){_0x484507=_0x5334e4;_0x2a16b6[_0x1a39('0x36')]=_[_0x1a39('0x34')](db['User'][_0x1a39('0x30')]);_0x2a16b6[_0x1a39('0x33')]=_[_0x1a39('0x34')](_0x362e08[_0x1a39('0x33')]);_0x2a16b6[_0x1a39('0x3e')]=_['intersection'](_0x2a16b6['model'],_0x2a16b6[_0x1a39('0x33')]);_0xec5b59[_0x1a39('0x37')]=_[_0x1a39('0x35')](_0x2a16b6['model'],qs[_0x1a39('0x38')](_0x362e08['query']['fields']));_0xec5b59[_0x1a39('0x37')]=_0xec5b59[_0x1a39('0x37')]['length']?_0xec5b59[_0x1a39('0x37')]:_0x2a16b6[_0x1a39('0x36')];_0xec5b59[_0x1a39('0x3b')]=qs[_0x1a39('0x3c')](_0x362e08[_0x1a39('0x33')][_0x1a39('0x3c')]);_0xec5b59[_0x1a39('0x3d')]=qs['filters'](_[_0x1a39('0x3f')](_0x362e08[_0x1a39('0x33')],_0x2a16b6[_0x1a39('0x3e')]));if(_0x362e08[_0x1a39('0x33')][_0x1a39('0x40')]){_0xec5b59[_0x1a39('0x3d')]=_[_0x1a39('0x42')](_0xec5b59[_0x1a39('0x3d')],{'$or':_[_0x1a39('0x2e')](_0xec5b59[_0x1a39('0x37')],function(_0x11e35d){var _0x7f181d={};_0x7f181d[_0x11e35d]={'$like':'%'+_0x362e08[_0x1a39('0x33')][_0x1a39('0x40')]+'%'};return _0x7f181d;})});}_0xec5b59=_['merge']({},_0xec5b59,_0x362e08['options']);return _0x484507[_0x1a39('0x87')](_0xec5b59);}})['then'](function(_0x132f1d){if(_0x132f1d){_0x46f44a=_0x132f1d[_0x1a39('0x39')];if(!_0x362e08[_0x1a39('0x33')][_0x1a39('0x88')](_0x1a39('0x3a'))){_0xec5b59[_0x1a39('0x20')]=qs[_0x1a39('0x20')](_0x362e08[_0x1a39('0x33')][_0x1a39('0x20')]);_0xec5b59[_0x1a39('0x1d')]=qs[_0x1a39('0x1d')](_0x362e08['query'][_0x1a39('0x1d')]);}return _0x484507[_0x1a39('0x87')](_0xec5b59);}})[_0x1a39('0x26')](function(_0x2482d4){if(_0x2482d4){return _0x2482d4?{'count':_0x46f44a,'rows':_0x2482d4}:null;}})['then'](respondWithResult(_0x573856,null))[_0x1a39('0x45')](handleError(_0x573856,null));}; \ No newline at end of file +var _0xc6eb=['value','transaction','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','ioredis','../../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','./mailQueue.socket','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','MailQueues','sendStatus','error','name','send','map','MailQueue','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filters','pick','filter','merge','type','VIRTUAL','options','where','include','rows','show','params','rawAttributes','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','sort','MailQueueId','findAll','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','ids','Team','Agents','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','forEach','userMailQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xc6eb,0x118));var _0xbc6e=function(_0x3e06dd,_0x55694f){_0x3e06dd=_0x3e06dd-0x0;var _0x4bbb8b=_0xc6eb[_0x3e06dd];return _0x4bbb8b;};'use strict';var emlformat=require(_0xbc6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc6e('0x1'));var jsonpatch=require(_0xbc6e('0x2'));var rp=require('request-promise');var moment=require(_0xbc6e('0x3'));var BPromise=require(_0xbc6e('0x4'));var Mustache=require(_0xbc6e('0x5'));var util=require(_0xbc6e('0x6'));var path=require(_0xbc6e('0x7'));var sox=require('sox');var csv=require(_0xbc6e('0x8'));var ejs=require(_0xbc6e('0x9'));var fs=require('fs');var fs_extra=require(_0xbc6e('0xa'));var _=require(_0xbc6e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbc6e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xbc6e('0xd'));var as=require(_0xbc6e('0xe'));var hardwareService=require(_0xbc6e('0xf'));var logger=require(_0xbc6e('0x10'))(_0xbc6e('0x11'));var utils=require(_0xbc6e('0x12'));var config=require(_0xbc6e('0x13'));var licenseUtil=require(_0xbc6e('0x14'));var db=require('../../mysqldb')['db'];config[_0xbc6e('0x15')]=_[_0xbc6e('0x16')](config['redis'],{'host':_0xbc6e('0x17'),'port':0x18eb});var socket=require(_0xbc6e('0x18'))(new Redis(config[_0xbc6e('0x15')]));require(_0xbc6e('0x19'))['register'](socket);function respondWithStatusCode(_0x5419f7,_0x2b4c57){_0x2b4c57=_0x2b4c57||0xcc;return function(_0x18b333){if(_0x18b333){return _0x5419f7['sendStatus'](_0x2b4c57);}return _0x5419f7['status'](_0x2b4c57)['end']();};}function respondWithResult(_0x8b3074,_0x10a5c2){_0x10a5c2=_0x10a5c2||0xc8;return function(_0x30fefd){if(_0x30fefd){return _0x8b3074[_0xbc6e('0x1a')](_0x10a5c2)[_0xbc6e('0x1b')](_0x30fefd);}};}function respondWithFilteredResult(_0x4049ac,_0x3605c4){return function(_0x1481c2){if(_0x1481c2){var _0x492698=typeof _0x3605c4['offset']===_0xbc6e('0x1c')&&typeof _0x3605c4[_0xbc6e('0x1d')]===_0xbc6e('0x1c');var _0xe9f21a=_0x1481c2[_0xbc6e('0x1e')];var _0x37fb73=_0x492698?0x0:_0x3605c4['offset'];var _0x526496=_0x492698?_0x1481c2['count']:_0x3605c4[_0xbc6e('0x1f')]+_0x3605c4['limit'];var _0x3fd5e8;if(_0x526496>=_0xe9f21a){_0x526496=_0xe9f21a;_0x3fd5e8=0xc8;}else{_0x3fd5e8=0xce;}_0x4049ac[_0xbc6e('0x1a')](_0x3fd5e8);return _0x4049ac[_0xbc6e('0x20')](_0xbc6e('0x21'),_0x37fb73+'-'+_0x526496+'/'+_0xe9f21a)[_0xbc6e('0x1b')](_0x1481c2);}return null;};}function patchUpdates(_0x3bddbe){return function(_0x2679f8){try{jsonpatch['apply'](_0x2679f8,_0x3bddbe,!![]);}catch(_0x2f59fe){return BPromise['reject'](_0x2f59fe);}return _0x2679f8[_0xbc6e('0x22')]();};}function saveUpdates(_0x77b573,_0x3b1e5f){return function(_0x3be577){if(_0x3be577){return _0x3be577[_0xbc6e('0x23')](_0x77b573)[_0xbc6e('0x24')](function(_0x289178){return _0x289178;});}return null;};}function removeEntity(_0x330be3,_0x531f49){return function(_0x13f351){if(_0x13f351){return _0x13f351[_0xbc6e('0x25')]()[_0xbc6e('0x24')](function(){var _0x1d1b11=_0x13f351[_0xbc6e('0x26')]({'plain':!![]});var _0x56b15e=_0xbc6e('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x56b15e,'resourceId':_0x1d1b11['id']}})['then'](function(){return _0x13f351;});})[_0xbc6e('0x24')](function(){_0x330be3[_0xbc6e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3664dd,_0x520ae3){return function(_0x5afade){if(!_0x5afade){_0x3664dd[_0xbc6e('0x28')](0x194);}return _0x5afade;};}function handleError(_0x517793,_0x227df2){_0x227df2=_0x227df2||0x1f4;return function(_0x61fe10){logger[_0xbc6e('0x29')](_0x61fe10['stack']);if(_0x61fe10[_0xbc6e('0x2a')]){delete _0x61fe10[_0xbc6e('0x2a')];}_0x517793[_0xbc6e('0x1a')](_0x227df2)[_0xbc6e('0x2b')](_0x61fe10);};}exports['index']=function(_0x4c6c64,_0x9073e8){var _0x5ad8c2={},_0x9ccfc3={},_0x8e9c1e={'count':0x0,'rows':[]};var _0x284a06=_[_0xbc6e('0x2c')](db[_0xbc6e('0x2d')]['rawAttributes'],function(_0x4f8cad){return{'name':_0x4f8cad[_0xbc6e('0x2e')],'type':_0x4f8cad['type']['key']};});_0x9ccfc3[_0xbc6e('0x2f')]=_['map'](_0x284a06,_0xbc6e('0x2a'));_0x9ccfc3[_0xbc6e('0x30')]=_[_0xbc6e('0x31')](_0x4c6c64[_0xbc6e('0x30')]);_0x9ccfc3['filters']=_['intersection'](_0x9ccfc3['model'],_0x9ccfc3[_0xbc6e('0x30')]);_0x5ad8c2['attributes']=_[_0xbc6e('0x32')](_0x9ccfc3[_0xbc6e('0x2f')],qs[_0xbc6e('0x33')](_0x4c6c64['query'][_0xbc6e('0x33')]));_0x5ad8c2[_0xbc6e('0x34')]=_0x5ad8c2[_0xbc6e('0x34')][_0xbc6e('0x35')]?_0x5ad8c2[_0xbc6e('0x34')]:_0x9ccfc3['model'];if(!_0x4c6c64['query'][_0xbc6e('0x36')](_0xbc6e('0x37'))){_0x5ad8c2[_0xbc6e('0x1d')]=qs[_0xbc6e('0x1d')](_0x4c6c64[_0xbc6e('0x30')]['limit']);_0x5ad8c2['offset']=qs['offset'](_0x4c6c64[_0xbc6e('0x30')][_0xbc6e('0x1f')]);}_0x5ad8c2[_0xbc6e('0x38')]=qs['sort'](_0x4c6c64[_0xbc6e('0x30')]['sort']);_0x5ad8c2['where']=qs[_0xbc6e('0x39')](_[_0xbc6e('0x3a')](_0x4c6c64[_0xbc6e('0x30')],_0x9ccfc3[_0xbc6e('0x39')]),_0x284a06);if(_0x4c6c64['query'][_0xbc6e('0x3b')]){_0x5ad8c2['where']=_[_0xbc6e('0x3c')](_0x5ad8c2['where'],{'$or':_[_0xbc6e('0x2c')](_0x284a06,function(_0x2a2c7f){if(_0x2a2c7f[_0xbc6e('0x3d')]!==_0xbc6e('0x3e')){var _0x599399={};_0x599399[_0x2a2c7f[_0xbc6e('0x2a')]]={'$like':'%'+_0x4c6c64[_0xbc6e('0x30')][_0xbc6e('0x3b')]+'%'};return _0x599399;}})});}_0x5ad8c2=_[_0xbc6e('0x3c')]({},_0x5ad8c2,_0x4c6c64[_0xbc6e('0x3f')]);var _0x231fcc={'where':_0x5ad8c2[_0xbc6e('0x40')]};return db['MailQueue']['count'](_0x231fcc)['then'](function(_0x1b0cef){_0x8e9c1e[_0xbc6e('0x1e')]=_0x1b0cef;if(_0x4c6c64[_0xbc6e('0x30')]['includeAll']){_0x5ad8c2[_0xbc6e('0x41')]=[{'all':!![]}];}return db[_0xbc6e('0x2d')]['findAll'](_0x5ad8c2);})[_0xbc6e('0x24')](function(_0x48cd67){_0x8e9c1e[_0xbc6e('0x42')]=_0x48cd67;return _0x8e9c1e;})[_0xbc6e('0x24')](respondWithFilteredResult(_0x9073e8,_0x5ad8c2))['catch'](handleError(_0x9073e8,null));};exports[_0xbc6e('0x43')]=function(_0x40f782,_0x56709c){var _0x2d00e1={'raw':!![],'where':{'id':_0x40f782[_0xbc6e('0x44')]['id']}},_0x2a508c={};_0x2a508c[_0xbc6e('0x2f')]=_['keys'](db['MailQueue'][_0xbc6e('0x45')]);_0x2a508c[_0xbc6e('0x30')]=_[_0xbc6e('0x31')](_0x40f782[_0xbc6e('0x30')]);_0x2a508c[_0xbc6e('0x39')]=_[_0xbc6e('0x32')](_0x2a508c[_0xbc6e('0x2f')],_0x2a508c[_0xbc6e('0x30')]);_0x2d00e1['attributes']=_['intersection'](_0x2a508c[_0xbc6e('0x2f')],qs[_0xbc6e('0x33')](_0x40f782[_0xbc6e('0x30')][_0xbc6e('0x33')]));_0x2d00e1[_0xbc6e('0x34')]=_0x2d00e1[_0xbc6e('0x34')][_0xbc6e('0x35')]?_0x2d00e1[_0xbc6e('0x34')]:_0x2a508c[_0xbc6e('0x2f')];if(_0x40f782['query']['includeAll']){_0x2d00e1['include']=[{'all':!![]}];}_0x2d00e1=_[_0xbc6e('0x3c')]({},_0x2d00e1,_0x40f782[_0xbc6e('0x3f')]);return db[_0xbc6e('0x2d')]['find'](_0x2d00e1)[_0xbc6e('0x24')](handleEntityNotFound(_0x56709c,null))[_0xbc6e('0x24')](respondWithResult(_0x56709c,null))[_0xbc6e('0x46')](handleError(_0x56709c,null));};exports['create']=function(_0x40999a,_0x14b782){return db[_0xbc6e('0x2d')]['create'](_0x40999a['body'],{})[_0xbc6e('0x24')](function(_0x196231){var _0x4fb97f=_0x40999a['user']['get']({'plain':!![]});if(!_0x4fb97f)throw new Error(_0xbc6e('0x47'));if(_0x4fb97f['role']===_0xbc6e('0x48')){var _0x4549b6=_0x196231[_0xbc6e('0x26')]({'plain':!![]});var _0x7c72da='MailQueues';return db[_0xbc6e('0x49')][_0xbc6e('0x4a')]({'where':{'name':_0x7c72da,'userProfileId':_0x4fb97f[_0xbc6e('0x4b')]},'raw':!![]})[_0xbc6e('0x24')](function(_0x4e03e0){if(_0x4e03e0&&_0x4e03e0[_0xbc6e('0x4c')]===0x0){return db[_0xbc6e('0x4d')][_0xbc6e('0x4e')]({'name':_0x4549b6[_0xbc6e('0x2a')],'resourceId':_0x4549b6['id'],'type':_0x4e03e0[_0xbc6e('0x2a')],'sectionId':_0x4e03e0['id']},{})[_0xbc6e('0x24')](function(){return _0x196231;});}else{return _0x196231;}})[_0xbc6e('0x46')](function(_0x4930e6){logger['error'](_0xbc6e('0x4f'),_0x4930e6);throw _0x4930e6;});}return _0x196231;})[_0xbc6e('0x24')](respondWithResult(_0x14b782,0xc9))['catch'](handleError(_0x14b782,null));};exports[_0xbc6e('0x23')]=function(_0x2195e0,_0x18b3c1){if(_0x2195e0[_0xbc6e('0x50')]['id']){delete _0x2195e0[_0xbc6e('0x50')]['id'];}return db[_0xbc6e('0x2d')][_0xbc6e('0x4a')]({'where':{'id':_0x2195e0[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](handleEntityNotFound(_0x18b3c1,null))['then'](saveUpdates(_0x2195e0[_0xbc6e('0x50')],null))[_0xbc6e('0x24')](respondWithResult(_0x18b3c1,null))[_0xbc6e('0x46')](handleError(_0x18b3c1,null));};exports[_0xbc6e('0x25')]=function(_0x21f65a,_0x5e6c97){return db[_0xbc6e('0x2d')][_0xbc6e('0x4a')]({'where':{'id':_0x21f65a['params']['id']}})['then'](handleEntityNotFound(_0x5e6c97,null))[_0xbc6e('0x24')](removeEntity(_0x5e6c97,null))[_0xbc6e('0x46')](handleError(_0x5e6c97,null));};exports['describe']=function(_0x134345,_0x57728a){return db[_0xbc6e('0x2d')][_0xbc6e('0x51')]()[_0xbc6e('0x24')](respondWithResult(_0x57728a,null))[_0xbc6e('0x46')](handleError(_0x57728a,null));};exports[_0xbc6e('0x52')]=function(_0xc943a2,_0x27f660,_0x4d5ce5){var _0x109705={'raw':!![],'where':{}},_0x503a8b={},_0x17fc6f;return db[_0xbc6e('0x2d')][_0xbc6e('0x53')]({'where':{'id':_0xc943a2[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](handleEntityNotFound(_0x27f660,null))['then'](function(_0x42487c){if(_0x42487c){_0x17fc6f=_0x42487c[_0xbc6e('0x26')]({'plain':!![]});_0x503a8b[_0xbc6e('0x2f')]=_[_0xbc6e('0x31')](db[_0xbc6e('0x54')][_0xbc6e('0x45')]);_0x503a8b['query']=_[_0xbc6e('0x31')](_0xc943a2[_0xbc6e('0x30')]);_0x503a8b[_0xbc6e('0x39')]=_[_0xbc6e('0x32')](_0x503a8b[_0xbc6e('0x2f')],_0x503a8b['query']);_0x109705[_0xbc6e('0x34')]=_[_0xbc6e('0x32')](_0x503a8b['model'],qs[_0xbc6e('0x33')](_0xc943a2[_0xbc6e('0x30')][_0xbc6e('0x33')]));_0x109705[_0xbc6e('0x34')]=_0x109705[_0xbc6e('0x34')][_0xbc6e('0x35')]?_0x109705[_0xbc6e('0x34')]:_0x503a8b[_0xbc6e('0x2f')];if(!_0xc943a2['query'][_0xbc6e('0x36')](_0xbc6e('0x37'))){_0x109705[_0xbc6e('0x1d')]=qs[_0xbc6e('0x1d')](_0xc943a2[_0xbc6e('0x30')][_0xbc6e('0x1d')]);_0x109705[_0xbc6e('0x1f')]=qs[_0xbc6e('0x1f')](_0xc943a2[_0xbc6e('0x30')][_0xbc6e('0x1f')]);}_0x109705['order']=qs[_0xbc6e('0x55')](_0xc943a2[_0xbc6e('0x30')][_0xbc6e('0x55')]);_0x109705['where']=qs[_0xbc6e('0x39')](_[_0xbc6e('0x3a')](_0xc943a2[_0xbc6e('0x30')],_0x503a8b['filters']));_0x109705[_0xbc6e('0x40')][_0xbc6e('0x56')]=_0x42487c['id'];if(_0xc943a2[_0xbc6e('0x30')][_0xbc6e('0x3b')]){_0x109705['where']=_[_0xbc6e('0x3c')](_0x109705[_0xbc6e('0x40')],{'$or':_[_0xbc6e('0x2c')](_0x109705[_0xbc6e('0x34')],function(_0x22adeb){var _0x318095={};_0x318095[_0x22adeb]={'$like':'%'+_0xc943a2[_0xbc6e('0x30')][_0xbc6e('0x3b')]+'%'};return _0x318095;})});}_0x109705=_[_0xbc6e('0x3c')]({},_0x109705,_0xc943a2[_0xbc6e('0x3f')]);return db[_0xbc6e('0x54')][_0xbc6e('0x57')](_0x109705);}})[_0xbc6e('0x24')](function(_0xce22a2){if(_0xce22a2){return db[_0xbc6e('0x58')][_0xbc6e('0x59')]({'where':{'id':_[_0xbc6e('0x2c')](_0xce22a2,_0xbc6e('0x5a')),'role':'agent'},'attributes':['id',_0xbc6e('0x2a'),_0xbc6e('0x5b'),_0xbc6e('0x5c'),_0xbc6e('0x5d')]});}})[_0xbc6e('0x24')](function(_0x5e41cd){if(_0x5e41cd){return{'count':_0x5e41cd[_0xbc6e('0x1e')],'rows':_[_0xbc6e('0x2c')](_0x5e41cd[_0xbc6e('0x42')],function(_0x5cfd75){return{'membername':_0x5cfd75[_0xbc6e('0x2a')],'UserId':_0x5cfd75['id'],'queue_name':_0x17fc6f['name'],'MailQueueId':_0x17fc6f['id'],'interface':util[_0xbc6e('0x5e')]('%s/%s',_0xbc6e('0x5f'),_0x5cfd75[_0xbc6e('0x2a')]),'penalty':0x0,'paused':_0x5cfd75[_0xbc6e('0x5b')],'createdAt':_0x5cfd75[_0xbc6e('0x5d')],'updatedAt':_0x5cfd75['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbc6e('0x24')](respondWithFilteredResult(_0x27f660,_0x109705))[_0xbc6e('0x46')](handleError(_0x27f660,null));};exports[_0xbc6e('0x60')]=function(_0x1bdf6e,_0x389088,_0x4e668e){var _0x139a88={};var _0x4f9cd7={};var _0x766441;var _0x258bb0;return db[_0xbc6e('0x2d')][_0xbc6e('0x53')]({'where':{'id':_0x1bdf6e[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](handleEntityNotFound(_0x389088,null))[_0xbc6e('0x24')](function(_0x5409db){if(_0x5409db){_0x766441=_0x5409db;_0x4f9cd7[_0xbc6e('0x2f')]=_[_0xbc6e('0x31')](db['Team'][_0xbc6e('0x45')]);_0x4f9cd7['query']=_[_0xbc6e('0x31')](_0x1bdf6e['query']);_0x4f9cd7[_0xbc6e('0x39')]=_[_0xbc6e('0x32')](_0x4f9cd7[_0xbc6e('0x2f')],_0x4f9cd7['query']);_0x139a88['attributes']=_[_0xbc6e('0x32')](_0x4f9cd7['model'],qs[_0xbc6e('0x33')](_0x1bdf6e[_0xbc6e('0x30')][_0xbc6e('0x33')]));_0x139a88[_0xbc6e('0x34')]=_0x139a88[_0xbc6e('0x34')][_0xbc6e('0x35')]?_0x139a88['attributes']:_0x4f9cd7[_0xbc6e('0x2f')];_0x139a88[_0xbc6e('0x38')]=qs[_0xbc6e('0x55')](_0x1bdf6e[_0xbc6e('0x30')][_0xbc6e('0x55')]);_0x139a88[_0xbc6e('0x40')]=qs[_0xbc6e('0x39')](_['pick'](_0x1bdf6e[_0xbc6e('0x30')],_0x4f9cd7['filters']));if(_0x1bdf6e[_0xbc6e('0x30')][_0xbc6e('0x3b')]){_0x139a88[_0xbc6e('0x40')]=_[_0xbc6e('0x3c')](_0x139a88[_0xbc6e('0x40')],{'$or':_[_0xbc6e('0x2c')](_0x139a88[_0xbc6e('0x34')],function(_0x60b4d1){var _0x123434={};_0x123434[_0x60b4d1]={'$like':'%'+_0x1bdf6e[_0xbc6e('0x30')]['filter']+'%'};return _0x123434;})});}_0x139a88=_[_0xbc6e('0x3c')]({},_0x139a88,_0x1bdf6e[_0xbc6e('0x3f')]);return _0x766441['getTeams'](_0x139a88);}})[_0xbc6e('0x24')](function(_0xb0550c){if(_0xb0550c){_0x258bb0=_0xb0550c[_0xbc6e('0x35')];if(!_0x1bdf6e['query']['hasOwnProperty'](_0xbc6e('0x37'))){_0x139a88[_0xbc6e('0x1d')]=qs[_0xbc6e('0x1d')](_0x1bdf6e['query'][_0xbc6e('0x1d')]);_0x139a88[_0xbc6e('0x1f')]=qs[_0xbc6e('0x1f')](_0x1bdf6e[_0xbc6e('0x30')]['offset']);}return _0x766441[_0xbc6e('0x60')](_0x139a88);}})['then'](function(_0x4ab667){if(_0x4ab667){return _0x4ab667?{'count':_0x258bb0,'rows':_0x4ab667}:null;}})[_0xbc6e('0x24')](respondWithResult(_0x389088,null))[_0xbc6e('0x46')](handleError(_0x389088,null));};exports['addTeams']=function(_0x52f14d,_0x28a8b2,_0x58dd62){var _0x344b19=_0x52f14d[_0xbc6e('0x50')][_0xbc6e('0x61')];return db[_0xbc6e('0x62')]['findAll']({'where':{'id':_0x344b19},'attributes':['id'],'include':[{'model':db[_0xbc6e('0x58')],'as':_0xbc6e('0x63'),'attributes':['id','name','online',_0xbc6e('0x64'),'interface'],'raw':!![]}]})[_0xbc6e('0x24')](function(_0x3672c9){if(_0x3672c9){var _0x437acf=_[_0xbc6e('0x65')](_0x3672c9,function(_0x42ff0f){var _0x42dfc1=_0x42ff0f[_0xbc6e('0x26')]({'plain':!![]});return _0x42dfc1[_0xbc6e('0x63')];});return db[_0xbc6e('0x2d')][_0xbc6e('0x4a')]({'where':{'id':_0x52f14d[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](function(_0x516a9a){return db[_0xbc6e('0x66')]['transaction'](function(_0x3abf59){return _0x516a9a[_0xbc6e('0x67')](_0x344b19,{'transaction':_0x3abf59})[_0xbc6e('0x24')](function(){return BPromise[_0xbc6e('0x68')](_0x437acf,function(_0x3fec23){return db['UserMailQueue'][_0xbc6e('0x69')]({'where':{'UserId':_0x3fec23['id'],'MailQueueId':_0x52f14d[_0xbc6e('0x44')]['id']},'transaction':_0x3abf59});});})[_0xbc6e('0x24')](function(){_0x437acf[_0xbc6e('0x6a')](function(_0x610d54){socket['emit'](_0xbc6e('0x6b'),{'UserId':_0x610d54['id'],'MailQueueId':_0x516a9a['id']});});});});});}})['then'](respondWithStatusCode(_0x28a8b2,null))[_0xbc6e('0x46')](handleError(_0x28a8b2,null));};exports['removeTeams']=function(_0xc2a4c5,_0x1f6494,_0x436acf){return db[_0xbc6e('0x62')][_0xbc6e('0x57')]({'where':{'id':_0xc2a4c5[_0xbc6e('0x30')][_0xbc6e('0x61')]},'attributes':['id'],'include':[{'model':db[_0xbc6e('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbc6e('0x24')](handleEntityNotFound(_0x1f6494,null))['then'](function(_0x3750a4){var _0x3b9e54=_[_0xbc6e('0x2c')](_0x3750a4,'id');var _0x25cb21=[];var _0x34f5f8=[];var _0x368243=squel[_0xbc6e('0x6c')]();_0x368243[_0xbc6e('0x6d')](_0xbc6e('0x6e'))[_0xbc6e('0x6f')]('team_has_mail_queues','tq')[_0xbc6e('0x70')](_0xbc6e('0x71'),'ut',_0xbc6e('0x72'))[_0xbc6e('0x40')](_0xbc6e('0x73'),_0xc2a4c5[_0xbc6e('0x44')]['id']);for(var _0x334a68=0x0;_0x334a68<_0x3750a4[_0xbc6e('0x35')];_0x334a68+=0x1){let _0x137856=_0x3750a4[_0x334a68];for(var _0x18cf40=0x0;_0x18cf40<_0x137856[_0xbc6e('0x63')][_0xbc6e('0x35')];_0x18cf40+=0x1){let _0x42f9cf=_0x137856[_0xbc6e('0x63')][_0x18cf40];var _0x5f5883=_0x368243[_0xbc6e('0x74')]();_0x5f5883[_0xbc6e('0x40')](_0xbc6e('0x75'),_0x42f9cf['id']);_0x34f5f8[_0xbc6e('0x76')](db['sequelize']['query'](_0x5f5883[_0xbc6e('0x77')](),{'type':db[_0xbc6e('0x66')][_0xbc6e('0x78')][_0xbc6e('0x79')]})['then'](function(_0x572404){if(_0x572404[_0xbc6e('0x35')]===0x1){return _0x42f9cf['id'];}else{var _0x5582c1=_['every'](_['map'](_0x572404,_0xbc6e('0x7a')),function(_0x45fa96){return _['includes'](_0x3b9e54,_0x45fa96);});if(_0x5582c1){return _0x42f9cf['id'];}}}));}}return BPromise[_0xbc6e('0x7b')](_0x34f5f8)[_0xbc6e('0x24')](function(_0x28d353){_0x25cb21=_(_0x25cb21)[_0xbc6e('0x7c')](_0x28d353)['compact']()[_0xbc6e('0x7d')]();return db[_0xbc6e('0x2d')][_0xbc6e('0x4a')]({'where':{'id':_0xc2a4c5[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](function(_0x2ba77c){return db['sequelize'][_0xbc6e('0x7e')](function(_0xa8d45e){return _0x2ba77c[_0xbc6e('0x7f')](_0xc2a4c5[_0xbc6e('0x30')][_0xbc6e('0x61')],{'transaction':_0xa8d45e})[_0xbc6e('0x24')](function(){if(!_[_0xbc6e('0x80')](_0x25cb21)){return _0x2ba77c[_0xbc6e('0x81')](_0x25cb21,{'transaction':_0xa8d45e});}})[_0xbc6e('0x24')](function(){_0x25cb21[_0xbc6e('0x6a')](function(_0x47285e){socket[_0xbc6e('0x82')](_0xbc6e('0x83'),{'UserId':_0x47285e,'MailQueueId':_0x2ba77c['id']});});});});});});})[_0xbc6e('0x24')](respondWithStatusCode(_0x1f6494,null))[_0xbc6e('0x46')](handleError(_0x1f6494,null));};exports[_0xbc6e('0x84')]=function(_0x1dd7df,_0x255829,_0x5da522){return db[_0xbc6e('0x2d')]['find']({'where':{'id':_0x1dd7df[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](handleEntityNotFound(_0x255829,null))[_0xbc6e('0x24')](function(_0x127978){if(_0x127978){return _0x127978['addAgents'](_0x1dd7df['body'][_0xbc6e('0x61')],_['omit'](_0x1dd7df[_0xbc6e('0x50')],[_0xbc6e('0x61'),'id'])||{})['spread'](function(_0x121ed7){for(var _0x2aeb09=0x0;_0x2aeb09<_0x1dd7df[_0xbc6e('0x50')][_0xbc6e('0x61')][_0xbc6e('0x35')];_0x2aeb09+=0x1){socket[_0xbc6e('0x82')](_0xbc6e('0x6b'),{'UserId':Number(_0x1dd7df[_0xbc6e('0x50')][_0xbc6e('0x61')][_0x2aeb09]),'MailQueueId':Number(_0x1dd7df[_0xbc6e('0x44')]['id'])});}return _0x121ed7;});}})[_0xbc6e('0x24')](respondWithResult(_0x255829,null))['catch'](handleError(_0x255829,null));};exports[_0xbc6e('0x81')]=function(_0x46d6ee,_0x2257c1,_0x182000){return db[_0xbc6e('0x2d')][_0xbc6e('0x4a')]({'where':{'id':_0x46d6ee[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](handleEntityNotFound(_0x2257c1,null))[_0xbc6e('0x24')](function(_0x4524d3){if(_0x4524d3){return _0x4524d3[_0xbc6e('0x81')](_0x46d6ee['query'][_0xbc6e('0x61')])['then'](function(){if(_[_0xbc6e('0x85')](_0x46d6ee[_0xbc6e('0x30')]['ids'])){for(var _0x2e6ca7=0x0;_0x2e6ca7<_0x46d6ee[_0xbc6e('0x30')][_0xbc6e('0x61')][_0xbc6e('0x35')];_0x2e6ca7+=0x1){socket[_0xbc6e('0x82')](_0xbc6e('0x83'),{'UserId':Number(_0x46d6ee['query'][_0xbc6e('0x61')][_0x2e6ca7]),'MailQueueId':Number(_0x46d6ee[_0xbc6e('0x44')]['id'])});}}else{socket['emit'](_0xbc6e('0x83'),{'UserId':Number(_0x46d6ee[_0xbc6e('0x30')][_0xbc6e('0x61')]),'MailQueueId':Number(_0x46d6ee['params']['id'])});}});}})[_0xbc6e('0x24')](respondWithStatusCode(_0x2257c1,null))[_0xbc6e('0x46')](handleError(_0x2257c1,null));};exports[_0xbc6e('0x86')]=function(_0x597b50,_0x6166ca,_0x240581){var _0x156ef4={};var _0x17f143={};var _0x3cf3b3;var _0x75d598;return db['MailQueue'][_0xbc6e('0x53')]({'where':{'id':_0x597b50[_0xbc6e('0x44')]['id']}})[_0xbc6e('0x24')](handleEntityNotFound(_0x6166ca,null))[_0xbc6e('0x24')](function(_0x2339d4){if(_0x2339d4){_0x3cf3b3=_0x2339d4;_0x17f143[_0xbc6e('0x2f')]=_[_0xbc6e('0x31')](db[_0xbc6e('0x58')][_0xbc6e('0x45')]);_0x17f143[_0xbc6e('0x30')]=_[_0xbc6e('0x31')](_0x597b50[_0xbc6e('0x30')]);_0x17f143[_0xbc6e('0x39')]=_[_0xbc6e('0x32')](_0x17f143[_0xbc6e('0x2f')],_0x17f143[_0xbc6e('0x30')]);_0x156ef4['attributes']=_[_0xbc6e('0x32')](_0x17f143[_0xbc6e('0x2f')],qs['fields'](_0x597b50['query'][_0xbc6e('0x33')]));_0x156ef4['attributes']=_0x156ef4[_0xbc6e('0x34')][_0xbc6e('0x35')]?_0x156ef4[_0xbc6e('0x34')]:_0x17f143['model'];_0x156ef4[_0xbc6e('0x38')]=qs[_0xbc6e('0x55')](_0x597b50['query']['sort']);_0x156ef4['where']=qs[_0xbc6e('0x39')](_[_0xbc6e('0x3a')](_0x597b50[_0xbc6e('0x30')],_0x17f143['filters']));if(_0x597b50['query'][_0xbc6e('0x3b')]){_0x156ef4['where']=_[_0xbc6e('0x3c')](_0x156ef4[_0xbc6e('0x40')],{'$or':_['map'](_0x156ef4['attributes'],function(_0x13773d){var _0x5769bc={};_0x5769bc[_0x13773d]={'$like':'%'+_0x597b50[_0xbc6e('0x30')][_0xbc6e('0x3b')]+'%'};return _0x5769bc;})});}_0x156ef4=_[_0xbc6e('0x3c')]({},_0x156ef4,_0x597b50[_0xbc6e('0x3f')]);return _0x3cf3b3[_0xbc6e('0x86')](_0x156ef4);}})[_0xbc6e('0x24')](function(_0x3999e5){if(_0x3999e5){_0x75d598=_0x3999e5[_0xbc6e('0x35')];if(!_0x597b50[_0xbc6e('0x30')][_0xbc6e('0x36')](_0xbc6e('0x37'))){_0x156ef4['limit']=qs['limit'](_0x597b50['query'][_0xbc6e('0x1d')]);_0x156ef4[_0xbc6e('0x1f')]=qs[_0xbc6e('0x1f')](_0x597b50['query'][_0xbc6e('0x1f')]);}return _0x3cf3b3[_0xbc6e('0x86')](_0x156ef4);}})['then'](function(_0x3d071a){if(_0x3d071a){return _0x3d071a?{'count':_0x75d598,'rows':_0x3d071a}:null;}})[_0xbc6e('0x24')](respondWithResult(_0x6166ca,null))[_0xbc6e('0x46')](handleError(_0x6166ca,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 4f73133..4021cf0 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 _0x91bc=['exports','MailQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2928c2,_0x5329c2){var _0x53c24f=function(_0x3b949c){while(--_0x3b949c){_0x2928c2['push'](_0x2928c2['shift']());}};_0x53c24f(++_0x5329c2);}(_0x91bc,0x1e9));var _0xc91b=function(_0x55b9e8,_0xe913f4){_0x55b9e8=_0x55b9e8-0x0;var _0x16b44c=_0x91bc[_0x55b9e8];return _0x16b44c;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xc91b('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc91b('0x1'),'afterUpdate':_0xc91b('0x2'),'afterDestroy':_0xc91b('0x3')};function emitEvent(_0x2335a7){return function(_0x3df524,_0x9d8448,_0x3ee17a){MailQueueEvents[_0xc91b('0x4')](_0x2335a7+':'+_0x3df524['id'],_0x3df524);MailQueueEvents[_0xc91b('0x4')](_0x2335a7,_0x3df524);_0x3ee17a(null);};}for(var e in events){if(events[_0xc91b('0x5')](e)){var event=events[e];MailQueue[_0xc91b('0x6')](e,emitEvent(event));}}module[_0xc91b('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x364f=['MailQueue','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x47d408,_0x581ad4){var _0x700cd2=function(_0x17c587){while(--_0x17c587){_0x47d408['push'](_0x47d408['shift']());}};_0x700cd2(++_0x581ad4);}(_0x364f,0xa9));var _0xf364=function(_0x3e750b,_0x2070d9){_0x3e750b=_0x3e750b-0x0;var _0x1e2ac3=_0x364f[_0x3e750b];return _0x1e2ac3;};'use strict';var EventEmitter=require(_0xf364('0x0'));var MailQueue=require(_0xf364('0x1'))['db'][_0xf364('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf364('0x3'),'afterDestroy':_0xf364('0x4')};function emitEvent(_0x15f976){return function(_0x1b857b,_0x187502,_0x1b4a23){MailQueueEvents[_0xf364('0x5')](_0x15f976+':'+_0x1b857b['id'],_0x1b857b);MailQueueEvents[_0xf364('0x5')](_0x15f976,_0x1b857b);_0x1b4a23(null);};}for(var e in events){if(events[_0xf364('0x6')](e)){var event=events[e];MailQueue[_0xf364('0x7')](e,emitEvent(event));}}module[_0xf364('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 48f11d1..007aca0 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 _0x3644=['exports','define','MailQueue','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x1f38c6,_0x428650){var _0x259367=function(_0x22bad0){while(--_0x22bad0){_0x1f38c6['push'](_0x1f38c6['shift']());}};_0x259367(++_0x428650);}(_0x3644,0xe4));var _0x4364=function(_0x24f365,_0x388252){_0x24f365=_0x24f365-0x0;var _0x52e0b5=_0x3644[_0x24f365];return _0x52e0b5;};'use strict';var _=require(_0x4364('0x0'));var util=require(_0x4364('0x1'));var logger=require(_0x4364('0x2'))('api');var moment=require(_0x4364('0x3'));var BPromise=require(_0x4364('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4364('0x5'));var attributes=require('./mailQueue.attributes');module[_0x4364('0x6')]=function(_0x451844,_0x2c15f8){return _0x451844[_0x4364('0x7')](_0x4364('0x8'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1097=['api','moment','bluebird','request-promise','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0x1ec889,_0x345a15){var _0x4a2b2c=function(_0x2ff789){while(--_0x2ff789){_0x1ec889['push'](_0x1ec889['shift']());}};_0x4a2b2c(++_0x345a15);}(_0x1097,0x1ec));var _0x7109=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1097[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x7109('0x0'));var util=require(_0x7109('0x1'));var logger=require(_0x7109('0x2'))(_0x7109('0x3'));var moment=require(_0x7109('0x4'));var BPromise=require(_0x7109('0x5'));var rp=require(_0x7109('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7109('0x7'));module['exports']=function(_0x2d4e40,_0x414076){return _0x2d4e40[_0x7109('0x8')](_0x7109('0x9'),attributes,{'tableName':_0x7109('0xa'),'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 7242584..722f585 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 _0xd8eb=['socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','include','model','then','ShowMailQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis'];(function(_0x40c86e,_0x4f9781){var _0x2066dd=function(_0x2bafe9){while(--_0x2bafe9){_0x40c86e['push'](_0x40c86e['shift']());}};_0x2066dd(++_0x4f9781);}(_0xd8eb,0x66));var _0xbd8e=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xd8eb[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var moment=require('moment');var BPromise=require(_0xbd8e('0x2'));var rs=require(_0xbd8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd8e('0x4'))['db'];var utils=require(_0xbd8e('0x5'));var logger=require(_0xbd8e('0x6'))(_0xbd8e('0x7'));var config=require(_0xbd8e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd8e('0x9')]({'port':0x232a});config['redis']=_[_0xbd8e('0xa')](config[_0xbd8e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd8e('0xc'))(new Redis(config['redis']));require(_0xbd8e('0xd'))[_0xbd8e('0xe')](socket);function respondWithRpcPromise(_0x59c66c,_0x5935d1,_0x19aa53){return new BPromise(function(_0x36d920,_0x55f103){return client[_0xbd8e('0xf')](_0x59c66c,_0x19aa53)['then'](function(_0x4dac47){logger[_0xbd8e('0x10')](_0xbd8e('0x11'),_0x5935d1,'request\x20sent');logger[_0xbd8e('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x5935d1,'request\x20sent',JSON[_0xbd8e('0x13')](_0x4dac47));if(_0x4dac47[_0xbd8e('0x14')]){if(_0x4dac47[_0xbd8e('0x14')][_0xbd8e('0x15')]===0x1f4){logger[_0xbd8e('0x14')](_0xbd8e('0x11'),_0x5935d1,_0x4dac47[_0xbd8e('0x14')][_0xbd8e('0x16')]);return _0x55f103(_0x4dac47[_0xbd8e('0x14')][_0xbd8e('0x16')]);}logger[_0xbd8e('0x14')](_0xbd8e('0x11'),_0x5935d1,_0x4dac47[_0xbd8e('0x14')][_0xbd8e('0x16')]);return _0x36d920(_0x4dac47['error'][_0xbd8e('0x16')]);}else{logger[_0xbd8e('0x10')](_0xbd8e('0x11'),_0x5935d1,_0xbd8e('0x17'));_0x36d920(_0x4dac47[_0xbd8e('0x18')][_0xbd8e('0x16')]);}})[_0xbd8e('0x19')](function(_0x4c03d7){logger[_0xbd8e('0x14')](_0xbd8e('0x11'),_0x5935d1,_0x4c03d7);_0x55f103(_0x4c03d7);});});}exports[_0xbd8e('0x1a')]=function(_0x6f8e77){var _0x53de51=this;return new Promise(function(_0x15a608,_0x5a260d){return db[_0xbd8e('0x1b')]['findAll']({'raw':_0x6f8e77['options']?_0x6f8e77[_0xbd8e('0x1c')][_0xbd8e('0x1d')]===undefined?!![]:![]:!![],'where':_0x6f8e77[_0xbd8e('0x1c')]?_0x6f8e77['options'][_0xbd8e('0x1e')]||null:null,'attributes':_0x6f8e77[_0xbd8e('0x1c')]?_0x6f8e77[_0xbd8e('0x1c')][_0xbd8e('0x1f')]||null:null,'limit':_0x6f8e77['options']?_0x6f8e77[_0xbd8e('0x1c')][_0xbd8e('0x20')]||null:null,'include':_0x6f8e77[_0xbd8e('0x1c')]?_0x6f8e77[_0xbd8e('0x1c')]['include']?_[_0xbd8e('0x21')](_0x6f8e77[_0xbd8e('0x1c')][_0xbd8e('0x22')],function(_0x31f710){return{'model':db[_0x31f710['model']],'as':_0x31f710['as'],'attributes':_0x31f710[_0xbd8e('0x1f')],'include':_0x31f710[_0xbd8e('0x22')]?_[_0xbd8e('0x21')](_0x31f710[_0xbd8e('0x22')],function(_0x1f874a){return{'model':db[_0x1f874a[_0xbd8e('0x23')]],'as':_0x1f874a['as'],'attributes':_0x1f874a[_0xbd8e('0x1f')],'include':_0x1f874a[_0xbd8e('0x22')]?_[_0xbd8e('0x21')](_0x1f874a[_0xbd8e('0x22')],function(_0x400080){return{'model':db[_0x400080['model']],'as':_0x400080['as'],'attributes':_0x400080[_0xbd8e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbd8e('0x24')](function(_0x347892){logger[_0xbd8e('0x10')]('GetMailQueue',_0x6f8e77);logger['debug'](_0xbd8e('0x1a'),_0x6f8e77,JSON[_0xbd8e('0x13')](_0x347892));_0x15a608(_0x347892);})[_0xbd8e('0x19')](function(_0x39d519){logger[_0xbd8e('0x14')]('GetMailQueue',_0x39d519['message'],_0x6f8e77);_0x5a260d(_0x53de51[_0xbd8e('0x14')](0x1f4,_0x39d519[_0xbd8e('0x16')]));});});};exports[_0xbd8e('0x25')]=function(_0x11c023){var _0x5ccce8=this;return new Promise(function(_0x96e818,_0x1cb7c1){return db[_0xbd8e('0x1b')]['find']({'raw':_0x11c023[_0xbd8e('0x1c')]?_0x11c023[_0xbd8e('0x1c')][_0xbd8e('0x1d')]===undefined?!![]:![]:!![],'where':_0x11c023['options']?_0x11c023[_0xbd8e('0x1c')][_0xbd8e('0x1e')]||null:null,'attributes':_0x11c023['options']?_0x11c023['options'][_0xbd8e('0x1f')]||null:null,'include':_0x11c023[_0xbd8e('0x1c')]?_0x11c023[_0xbd8e('0x1c')][_0xbd8e('0x22')]?_[_0xbd8e('0x21')](_0x11c023['options'][_0xbd8e('0x22')],function(_0x1f1518){return{'model':db[_0x1f1518[_0xbd8e('0x23')]],'as':_0x1f1518['as'],'attributes':_0x1f1518[_0xbd8e('0x1f')],'include':_0x1f1518[_0xbd8e('0x22')]?_[_0xbd8e('0x21')](_0x1f1518[_0xbd8e('0x22')],function(_0x50b9ad){return{'model':db[_0x50b9ad[_0xbd8e('0x23')]],'as':_0x50b9ad['as'],'attributes':_0x50b9ad['attributes'],'include':_0x50b9ad[_0xbd8e('0x22')]?_[_0xbd8e('0x21')](_0x50b9ad[_0xbd8e('0x22')],function(_0x3a8332){return{'model':db[_0x3a8332[_0xbd8e('0x23')]],'as':_0x3a8332['as'],'attributes':_0x3a8332[_0xbd8e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbd8e('0x24')](function(_0x565ba9){logger[_0xbd8e('0x10')](_0xbd8e('0x25'),_0x11c023);logger[_0xbd8e('0x12')](_0xbd8e('0x25'),_0x11c023,JSON['stringify'](_0x565ba9));_0x96e818(_0x565ba9);})[_0xbd8e('0x19')](function(_0x195339){logger[_0xbd8e('0x14')]('ShowMailQueue',_0x195339[_0xbd8e('0x16')],_0x11c023);_0x1cb7c1(_0x5ccce8['error'](0x1f4,_0x195339[_0xbd8e('0x16')]));});});}; \ No newline at end of file +var _0x12c9=['model','attributes','raw','ShowMailQueue','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','findAll','options','where','limit','include','map'];(function(_0x497510,_0x212200){var _0x4d93d6=function(_0x36717d){while(--_0x36717d){_0x497510['push'](_0x497510['shift']());}};_0x4d93d6(++_0x212200);}(_0x12c9,0x10e));var _0x912c=function(_0x53d965,_0x221a83){_0x53d965=_0x53d965-0x0;var _0x52e4e=_0x12c9[_0x53d965];return _0x52e4e;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var moment=require(_0x912c('0x1'));var BPromise=require(_0x912c('0x2'));var rs=require(_0x912c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x912c('0x4'));var logger=require(_0x912c('0x5'))('rpc');var config=require(_0x912c('0x6'));var jayson=require(_0x912c('0x7'));var client=jayson['client'][_0x912c('0x8')]({'port':0x232a});config[_0x912c('0x9')]=_[_0x912c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x912c('0xb'))(new Redis(config[_0x912c('0x9')]));require('./mailQueue.socket')[_0x912c('0xc')](socket);function respondWithRpcPromise(_0x5be932,_0x58edac,_0x5e2b93){return new BPromise(function(_0x32b0b0,_0x1380f5){return client[_0x912c('0xd')](_0x5be932,_0x5e2b93)[_0x912c('0xe')](function(_0x5a490d){logger[_0x912c('0xf')]('MailQueue,\x20%s,\x20%s',_0x58edac,'request\x20sent');logger[_0x912c('0x10')](_0x912c('0x11'),_0x58edac,_0x912c('0x12'),JSON[_0x912c('0x13')](_0x5a490d));if(_0x5a490d[_0x912c('0x14')]){if(_0x5a490d['error'][_0x912c('0x15')]===0x1f4){logger[_0x912c('0x14')](_0x912c('0x16'),_0x58edac,_0x5a490d[_0x912c('0x14')][_0x912c('0x17')]);return _0x1380f5(_0x5a490d[_0x912c('0x14')][_0x912c('0x17')]);}logger[_0x912c('0x14')](_0x912c('0x16'),_0x58edac,_0x5a490d[_0x912c('0x14')][_0x912c('0x17')]);return _0x32b0b0(_0x5a490d[_0x912c('0x14')][_0x912c('0x17')]);}else{logger['info'](_0x912c('0x16'),_0x58edac,_0x912c('0x12'));_0x32b0b0(_0x5a490d[_0x912c('0x18')]['message']);}})[_0x912c('0x19')](function(_0x3873cd){logger['error'](_0x912c('0x16'),_0x58edac,_0x3873cd);_0x1380f5(_0x3873cd);});});}exports[_0x912c('0x1a')]=function(_0x299fbe){var _0x27fa01=this;return new Promise(function(_0xabfe22,_0xec949e){return db[_0x912c('0x1b')][_0x912c('0x1c')]({'raw':_0x299fbe[_0x912c('0x1d')]?_0x299fbe['options']['raw']===undefined?!![]:![]:!![],'where':_0x299fbe[_0x912c('0x1d')]?_0x299fbe['options'][_0x912c('0x1e')]||null:null,'attributes':_0x299fbe[_0x912c('0x1d')]?_0x299fbe[_0x912c('0x1d')]['attributes']||null:null,'limit':_0x299fbe[_0x912c('0x1d')]?_0x299fbe[_0x912c('0x1d')][_0x912c('0x1f')]||null:null,'include':_0x299fbe[_0x912c('0x1d')]?_0x299fbe['options'][_0x912c('0x20')]?_[_0x912c('0x21')](_0x299fbe[_0x912c('0x1d')][_0x912c('0x20')],function(_0x1174e2){return{'model':db[_0x1174e2[_0x912c('0x22')]],'as':_0x1174e2['as'],'attributes':_0x1174e2[_0x912c('0x23')],'include':_0x1174e2[_0x912c('0x20')]?_[_0x912c('0x21')](_0x1174e2[_0x912c('0x20')],function(_0x14422b){return{'model':db[_0x14422b['model']],'as':_0x14422b['as'],'attributes':_0x14422b[_0x912c('0x23')],'include':_0x14422b[_0x912c('0x20')]?_[_0x912c('0x21')](_0x14422b[_0x912c('0x20')],function(_0x161088){return{'model':db[_0x161088[_0x912c('0x22')]],'as':_0x161088['as'],'attributes':_0x161088[_0x912c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x912c('0xe')](function(_0x47bc0e){logger[_0x912c('0xf')](_0x912c('0x1a'),_0x299fbe);logger[_0x912c('0x10')](_0x912c('0x1a'),_0x299fbe,JSON['stringify'](_0x47bc0e));_0xabfe22(_0x47bc0e);})[_0x912c('0x19')](function(_0x1e6faf){logger[_0x912c('0x14')]('GetMailQueue',_0x1e6faf[_0x912c('0x17')],_0x299fbe);_0xec949e(_0x27fa01[_0x912c('0x14')](0x1f4,_0x1e6faf[_0x912c('0x17')]));});});};exports['ShowMailQueue']=function(_0x3d7d11){var _0x2526bd=this;return new Promise(function(_0x27b6db,_0x4ef410){return db['MailQueue']['find']({'raw':_0x3d7d11[_0x912c('0x1d')]?_0x3d7d11[_0x912c('0x1d')][_0x912c('0x24')]===undefined?!![]:![]:!![],'where':_0x3d7d11['options']?_0x3d7d11[_0x912c('0x1d')][_0x912c('0x1e')]||null:null,'attributes':_0x3d7d11[_0x912c('0x1d')]?_0x3d7d11[_0x912c('0x1d')]['attributes']||null:null,'include':_0x3d7d11[_0x912c('0x1d')]?_0x3d7d11[_0x912c('0x1d')]['include']?_[_0x912c('0x21')](_0x3d7d11[_0x912c('0x1d')][_0x912c('0x20')],function(_0x1516e5){return{'model':db[_0x1516e5['model']],'as':_0x1516e5['as'],'attributes':_0x1516e5[_0x912c('0x23')],'include':_0x1516e5['include']?_[_0x912c('0x21')](_0x1516e5[_0x912c('0x20')],function(_0x172464){return{'model':db[_0x172464[_0x912c('0x22')]],'as':_0x172464['as'],'attributes':_0x172464[_0x912c('0x23')],'include':_0x172464[_0x912c('0x20')]?_[_0x912c('0x21')](_0x172464['include'],function(_0x47fbb0){return{'model':db[_0x47fbb0[_0x912c('0x22')]],'as':_0x47fbb0['as'],'attributes':_0x47fbb0[_0x912c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x912c('0xe')](function(_0x65be48){logger['info'](_0x912c('0x25'),_0x3d7d11);logger[_0x912c('0x10')]('ShowMailQueue',_0x3d7d11,JSON[_0x912c('0x13')](_0x65be48));_0x27b6db(_0x65be48);})['catch'](function(_0x3b402b){logger[_0x912c('0x14')](_0x912c('0x25'),_0x3b402b[_0x912c('0x17')],_0x3d7d11);_0x4ef410(_0x2526bd['error'](0x1f4,_0x3b402b[_0x912c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b1296e8..c756fbc 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 _0x2054=['register','length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2054,0x1b3));var _0x4205=function(_0x5e2a0f,_0x447ab4){_0x5e2a0f=_0x5e2a0f-0x0;var _0x3e8c10=_0x2054[_0x5e2a0f];return _0x3e8c10;};'use strict';var MailQueueEvents=require(_0x4205('0x0'));var events=[_0x4205('0x1'),_0x4205('0x2'),_0x4205('0x3')];function createListener(_0x35ae12,_0xa158f0){return function(_0x459362){_0xa158f0[_0x4205('0x4')](_0x35ae12,_0x459362);};}function removeListener(_0x11af37,_0x314d5a){return function(){MailQueueEvents[_0x4205('0x5')](_0x11af37,_0x314d5a);};}exports[_0x4205('0x6')]=function(_0x2971c6){for(var _0x343d09=0x0,_0x279a19=events[_0x4205('0x7')];_0x343d09<_0x279a19;_0x343d09++){var _0x1cb718=events[_0x343d09];var _0x47f17f=createListener(_0x4205('0x8')+_0x1cb718,_0x2971c6);MailQueueEvents['on'](_0x1cb718,_0x47f17f);}}; \ No newline at end of file +var _0xb218=['removeListener','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x448949,_0xc9843c){var _0x8c03df=function(_0x20a6b2){while(--_0x20a6b2){_0x448949['push'](_0x448949['shift']());}};_0x8c03df(++_0xc9843c);}(_0xb218,0x192));var _0x8b21=function(_0x56d209,_0x4f002c){_0x56d209=_0x56d209-0x0;var _0x12b137=_0xb218[_0x56d209];return _0x12b137;};'use strict';var MailQueueEvents=require(_0x8b21('0x0'));var events=['save',_0x8b21('0x1'),_0x8b21('0x2')];function createListener(_0x31d515,_0x51f4f2){return function(_0x46beeb){_0x51f4f2[_0x8b21('0x3')](_0x31d515,_0x46beeb);};}function removeListener(_0x28661e,_0x4de02f){return function(){MailQueueEvents[_0x8b21('0x4')](_0x28661e,_0x4de02f);};}exports['register']=function(_0x40bc36){for(var _0x54f840=0x0,_0x18698d=events[_0x8b21('0x5')];_0x54f840<_0x18698d;_0x54f840++){var _0xb0400c=events[_0x54f840];var _0x5b031d=createListener(_0x8b21('0x6')+_0xb0400c,_0x40bc36);MailQueueEvents['on'](_0xb0400c,_0x5b031d);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e3e9ee6..1923662 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 _0x5d5d=['describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x599b1e,_0x4aee06){var _0x492c0e=function(_0x333011){while(--_0x333011){_0x599b1e['push'](_0x599b1e['shift']());}};_0x492c0e(++_0x4aee06);}(_0x5d5d,0x162));var _0xd5d5=function(_0x2a870c,_0x342493){_0x2a870c=_0x2a870c-0x0;var _0x1a22e2=_0x5d5d[_0x2a870c];return _0x1a22e2;};'use strict';var multer=require(_0xd5d5('0x0'));var util=require(_0xd5d5('0x1'));var path=require(_0xd5d5('0x2'));var timeout=require(_0xd5d5('0x3'));var express=require('express');var router=express[_0xd5d5('0x4')]();var fs_extra=require(_0xd5d5('0x5'));var auth=require(_0xd5d5('0x6'));var interaction=require(_0xd5d5('0x7'));var config=require(_0xd5d5('0x8'));var controller=require(_0xd5d5('0x9'));router[_0xd5d5('0xa')]('/',auth[_0xd5d5('0xb')](),controller[_0xd5d5('0xc')]);router[_0xd5d5('0xa')](_0xd5d5('0xd'),auth[_0xd5d5('0xb')](),controller[_0xd5d5('0xe')]);router[_0xd5d5('0xa')](_0xd5d5('0xf'),auth[_0xd5d5('0xb')](),controller[_0xd5d5('0x10')]);router[_0xd5d5('0x11')]('/',auth[_0xd5d5('0xb')](),controller[_0xd5d5('0x12')]);router[_0xd5d5('0x13')]('/:id',auth[_0xd5d5('0xb')](),controller[_0xd5d5('0x14')]);router[_0xd5d5('0x15')](_0xd5d5('0xf'),auth[_0xd5d5('0xb')](),controller[_0xd5d5('0x16')]);module['exports']=router; \ No newline at end of file +var _0x79e8=['get','/describe','/:id','show','post','put','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x32567f,_0x1ccca3){var _0x42b7af=function(_0x2a940d){while(--_0x2a940d){_0x32567f['push'](_0x32567f['shift']());}};_0x42b7af(++_0x1ccca3);}(_0x79e8,0xb7));var _0x879e=function(_0x22ffb7,_0x2b3b0b){_0x22ffb7=_0x22ffb7-0x0;var _0x2a50d5=_0x79e8[_0x22ffb7];return _0x2a50d5;};'use strict';var multer=require('multer');var util=require(_0x879e('0x0'));var path=require(_0x879e('0x1'));var timeout=require('connect-timeout');var express=require(_0x879e('0x2'));var router=express['Router']();var fs_extra=require(_0x879e('0x3'));var auth=require(_0x879e('0x4'));var interaction=require(_0x879e('0x5'));var config=require(_0x879e('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x879e('0x7')](),controller[_0x879e('0x8')]);router[_0x879e('0x9')](_0x879e('0xa'),auth[_0x879e('0x7')](),controller['describe']);router[_0x879e('0x9')](_0x879e('0xb'),auth[_0x879e('0x7')](),controller[_0x879e('0xc')]);router[_0x879e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x879e('0xe')](_0x879e('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x879e('0xb'),auth[_0x879e('0x7')](),controller[_0x879e('0xf')]);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 e7d382b..3570db1 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 _0xded6=['DATE','moment','sequelize','exports','STRING'];(function(_0x5f2670,_0x2b511b){var _0x33753d=function(_0x13d76d){while(--_0x13d76d){_0x5f2670['push'](_0x5f2670['shift']());}};_0x33753d(++_0x2b511b);}(_0xded6,0x1aa));var _0x6ded=function(_0x95eb7c,_0x111ddf){_0x95eb7c=_0x95eb7c-0x0;var _0x1cf5f0=_0xded6[_0x95eb7c];return _0x1cf5f0;};'use strict';var moment=require(_0x6ded('0x0'));var Sequelize=require(_0x6ded('0x1'));module[_0x6ded('0x2')]={'uniqueid':{'type':Sequelize[_0x6ded('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6ded('0x4')]},'leaveAt':{'type':Sequelize[_0x6ded('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6ded('0x4')]},'reason':{'type':Sequelize[_0x6ded('0x3')]}}; \ No newline at end of file +var _0x1766=['moment','STRING','DATE'];(function(_0xca6d5f,_0x59e312){var _0x44f979=function(_0x451657){while(--_0x451657){_0xca6d5f['push'](_0xca6d5f['shift']());}};_0x44f979(++_0x59e312);}(_0x1766,0x17d));var _0x6176=function(_0x5b8b86,_0x3b4a9e){_0x5b8b86=_0x5b8b86-0x0;var _0x862452=_0x1766[_0x5b8b86];return _0x862452;};'use strict';var moment=require(_0x6176('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6176('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6176('0x1')]},'joinAt':{'type':Sequelize[_0x6176('0x2')]},'leaveAt':{'type':Sequelize[_0x6176('0x2')]},'acceptAt':{'type':Sequelize[_0x6176('0x2')]},'exitAt':{'type':Sequelize[_0x6176('0x2')]},'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 65bcc27..2748d91 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 _0xd4a2=['describe','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','MailQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0xd1175b,_0x5530f3){var _0xe950be=function(_0x831006){while(--_0x831006){_0xd1175b['push'](_0xd1175b['shift']());}};_0xe950be(++_0x5530f3);}(_0xd4a2,0x173));var _0x2d4a=function(_0x4c8c9c,_0x34b179){_0x4c8c9c=_0x4c8c9c-0x0;var _0x501821=_0xd4a2[_0x4c8c9c];return _0x501821;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];function respondWithStatusCode(_0x45b9fb,_0x5ac803){_0x5ac803=_0x5ac803||0xcc;return function(_0x2f785f){if(_0x2f785f){return _0x45b9fb[_0x2d4a('0x17')](_0x5ac803);}return _0x45b9fb[_0x2d4a('0x18')](_0x5ac803)[_0x2d4a('0x19')]();};}function respondWithResult(_0x544622,_0x4be8b4){_0x4be8b4=_0x4be8b4||0xc8;return function(_0x2a1d0f){if(_0x2a1d0f){return _0x544622['status'](_0x4be8b4)[_0x2d4a('0x1a')](_0x2a1d0f);}};}function respondWithFilteredResult(_0x175bda,_0x11896d){return function(_0x3a3156){if(_0x3a3156){var _0x4c5287=typeof _0x11896d[_0x2d4a('0x1b')]==='undefined'&&typeof _0x11896d[_0x2d4a('0x1c')]==='undefined';var _0x435687=_0x3a3156[_0x2d4a('0x1d')];var _0x2188b2=_0x4c5287?0x0:_0x11896d[_0x2d4a('0x1b')];var _0x498956=_0x4c5287?_0x3a3156['count']:_0x11896d['offset']+_0x11896d[_0x2d4a('0x1c')];var _0x1966d1;if(_0x498956>=_0x435687){_0x498956=_0x435687;_0x1966d1=0xc8;}else{_0x1966d1=0xce;}_0x175bda[_0x2d4a('0x18')](_0x1966d1);return _0x175bda[_0x2d4a('0x1e')](_0x2d4a('0x1f'),_0x2188b2+'-'+_0x498956+'/'+_0x435687)[_0x2d4a('0x1a')](_0x3a3156);}return null;};}function patchUpdates(_0x56445a){return function(_0x49f378){try{jsonpatch[_0x2d4a('0x20')](_0x49f378,_0x56445a,!![]);}catch(_0x1f3e17){return BPromise[_0x2d4a('0x21')](_0x1f3e17);}return _0x49f378[_0x2d4a('0x22')]();};}function saveUpdates(_0x1a2d20,_0x2e7736){return function(_0x22dd0b){if(_0x22dd0b){return _0x22dd0b[_0x2d4a('0x23')](_0x1a2d20)['then'](function(_0x26e7b8){return _0x26e7b8;});}return null;};}function removeEntity(_0x3240a2,_0x2c3799){return function(_0x42d813){if(_0x42d813){return _0x42d813[_0x2d4a('0x24')]()[_0x2d4a('0x25')](function(){_0x3240a2[_0x2d4a('0x18')](0xcc)[_0x2d4a('0x19')]();});}};}function handleEntityNotFound(_0x54c910,_0x544b9b){return function(_0x5cc7d8){if(!_0x5cc7d8){_0x54c910[_0x2d4a('0x17')](0x194);}return _0x5cc7d8;};}function handleError(_0x5029f3,_0x410f7d){_0x410f7d=_0x410f7d||0x1f4;return function(_0x3a2fd3){logger[_0x2d4a('0x26')](_0x3a2fd3[_0x2d4a('0x27')]);if(_0x3a2fd3[_0x2d4a('0x28')]){delete _0x3a2fd3[_0x2d4a('0x28')];}_0x5029f3[_0x2d4a('0x18')](_0x410f7d)[_0x2d4a('0x29')](_0x3a2fd3);};}exports['index']=function(_0x436f53,_0x5ce262){var _0x221602={},_0x9bac28={},_0xc497ce={'count':0x0,'rows':[]};var _0x20b87d=_[_0x2d4a('0x2a')](db[_0x2d4a('0x2b')][_0x2d4a('0x2c')],function(_0x2e8063){return{'name':_0x2e8063['fieldName'],'type':_0x2e8063[_0x2d4a('0x2d')][_0x2d4a('0x2e')]};});_0x9bac28[_0x2d4a('0x2f')]=_[_0x2d4a('0x2a')](_0x20b87d,_0x2d4a('0x28'));_0x9bac28['query']=_[_0x2d4a('0x30')](_0x436f53[_0x2d4a('0x31')]);_0x9bac28[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],_0x9bac28['query']);_0x221602[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],qs[_0x2d4a('0x35')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x35')]));_0x221602['attributes']=_0x221602[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x221602[_0x2d4a('0x34')]:_0x9bac28[_0x2d4a('0x2f')];if(!_0x436f53[_0x2d4a('0x31')]['hasOwnProperty'](_0x2d4a('0x37'))){_0x221602[_0x2d4a('0x1c')]=qs['limit'](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1c')]);_0x221602[_0x2d4a('0x1b')]=qs[_0x2d4a('0x1b')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1b')]);}_0x221602['order']=qs[_0x2d4a('0x38')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x38')]);_0x221602[_0x2d4a('0x39')]=qs[_0x2d4a('0x32')](_[_0x2d4a('0x3a')](_0x436f53['query'],_0x9bac28['filters']),_0x20b87d);if(_0x436f53[_0x2d4a('0x31')]['filter']){_0x221602[_0x2d4a('0x39')]=_[_0x2d4a('0x3b')](_0x221602['where'],{'$or':_[_0x2d4a('0x2a')](_0x20b87d,function(_0x275598){if(_0x275598[_0x2d4a('0x2d')]!==_0x2d4a('0x3c')){var _0x67bce3={};_0x67bce3[_0x275598[_0x2d4a('0x28')]]={'$like':'%'+_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x3d')]+'%'};return _0x67bce3;}})});}_0x221602=_[_0x2d4a('0x3b')]({},_0x221602,_0x436f53[_0x2d4a('0x3e')]);var _0x3bb0cc={'where':_0x221602['where']};return db[_0x2d4a('0x2b')][_0x2d4a('0x1d')](_0x3bb0cc)[_0x2d4a('0x25')](function(_0x2f1635){_0xc497ce[_0x2d4a('0x1d')]=_0x2f1635;if(_0x436f53['query']['includeAll']){_0x221602['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x2d4a('0x3f')](_0x221602);})[_0x2d4a('0x25')](function(_0xf39020){_0xc497ce[_0x2d4a('0x40')]=_0xf39020;return _0xc497ce;})['then'](respondWithFilteredResult(_0x5ce262,_0x221602))[_0x2d4a('0x41')](handleError(_0x5ce262,null));};exports[_0x2d4a('0x42')]=function(_0x5e9704,_0x189d2a){var _0x13b0f0={'raw':!![],'where':{'id':_0x5e9704[_0x2d4a('0x43')]['id']}},_0x8a9375={};_0x8a9375[_0x2d4a('0x2f')]=_[_0x2d4a('0x30')](db['MailQueueReport'][_0x2d4a('0x2c')]);_0x8a9375[_0x2d4a('0x31')]=_[_0x2d4a('0x30')](_0x5e9704[_0x2d4a('0x31')]);_0x8a9375[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x8a9375['model'],_0x8a9375[_0x2d4a('0x31')]);_0x13b0f0[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x8a9375['model'],qs[_0x2d4a('0x35')](_0x5e9704['query'][_0x2d4a('0x35')]));_0x13b0f0[_0x2d4a('0x34')]=_0x13b0f0[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x13b0f0[_0x2d4a('0x34')]:_0x8a9375['model'];if(_0x5e9704['query'][_0x2d4a('0x44')]){_0x13b0f0[_0x2d4a('0x45')]=[{'all':!![]}];}_0x13b0f0=_['merge']({},_0x13b0f0,_0x5e9704[_0x2d4a('0x3e')]);return db['MailQueueReport'][_0x2d4a('0x46')](_0x13b0f0)[_0x2d4a('0x25')](handleEntityNotFound(_0x189d2a,null))[_0x2d4a('0x25')](respondWithResult(_0x189d2a,null))['catch'](handleError(_0x189d2a,null));};exports[_0x2d4a('0x47')]=function(_0x541b93,_0x3806b8){return db[_0x2d4a('0x2b')][_0x2d4a('0x47')](_0x541b93[_0x2d4a('0x48')],{})[_0x2d4a('0x25')](respondWithResult(_0x3806b8,0xc9))[_0x2d4a('0x41')](handleError(_0x3806b8,null));};exports[_0x2d4a('0x23')]=function(_0x2b2f4b,_0x1ffb96){if(_0x2b2f4b[_0x2d4a('0x48')]['id']){delete _0x2b2f4b[_0x2d4a('0x48')]['id'];}return db['MailQueueReport'][_0x2d4a('0x46')]({'where':{'id':_0x2b2f4b[_0x2d4a('0x43')]['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x1ffb96,null))[_0x2d4a('0x25')](saveUpdates(_0x2b2f4b[_0x2d4a('0x48')],null))['then'](respondWithResult(_0x1ffb96,null))[_0x2d4a('0x41')](handleError(_0x1ffb96,null));};exports[_0x2d4a('0x24')]=function(_0x2123e8,_0x440625){return db[_0x2d4a('0x2b')]['find']({'where':{'id':_0x2123e8['params']['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x440625,null))[_0x2d4a('0x25')](removeEntity(_0x440625,null))['catch'](handleError(_0x440625,null));};exports[_0x2d4a('0x49')]=function(_0x33f413,_0x7f0807){return db[_0x2d4a('0x2b')]['describe']()[_0x2d4a('0x25')](respondWithResult(_0x7f0807,null))['catch'](handleError(_0x7f0807,null));}; \ No newline at end of file +var _0xd824=['../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xd824,0xc2));var _0x4d82=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd824[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x346394,_0x248eed){_0x248eed=_0x248eed||0xcc;return function(_0x319ba8){if(_0x319ba8){return _0x346394[_0x4d82('0x14')](_0x248eed);}return _0x346394['status'](_0x248eed)[_0x4d82('0x15')]();};}function respondWithResult(_0x2094bc,_0x41f5b2){_0x41f5b2=_0x41f5b2||0xc8;return function(_0x486152){if(_0x486152){return _0x2094bc[_0x4d82('0x16')](_0x41f5b2)['json'](_0x486152);}};}function respondWithFilteredResult(_0x3382c4,_0x5012db){return function(_0x469e09){if(_0x469e09){var _0x496f3b=typeof _0x5012db[_0x4d82('0x17')]===_0x4d82('0x18')&&typeof _0x5012db[_0x4d82('0x19')]===_0x4d82('0x18');var _0x2648a8=_0x469e09[_0x4d82('0x1a')];var _0x258c59=_0x496f3b?0x0:_0x5012db[_0x4d82('0x17')];var _0x2f2127=_0x496f3b?_0x469e09['count']:_0x5012db[_0x4d82('0x17')]+_0x5012db[_0x4d82('0x19')];var _0x1b1e39;if(_0x2f2127>=_0x2648a8){_0x2f2127=_0x2648a8;_0x1b1e39=0xc8;}else{_0x1b1e39=0xce;}_0x3382c4[_0x4d82('0x16')](_0x1b1e39);return _0x3382c4[_0x4d82('0x1b')](_0x4d82('0x1c'),_0x258c59+'-'+_0x2f2127+'/'+_0x2648a8)[_0x4d82('0x1d')](_0x469e09);}return null;};}function patchUpdates(_0x64669c){return function(_0x19832f){try{jsonpatch[_0x4d82('0x1e')](_0x19832f,_0x64669c,!![]);}catch(_0xf2f5a5){return BPromise['reject'](_0xf2f5a5);}return _0x19832f[_0x4d82('0x1f')]();};}function saveUpdates(_0x748ee7,_0x5e5bdf){return function(_0x1a419f){if(_0x1a419f){return _0x1a419f[_0x4d82('0x20')](_0x748ee7)[_0x4d82('0x21')](function(_0x14a2d4){return _0x14a2d4;});}return null;};}function removeEntity(_0xe17d70,_0x15f5d1){return function(_0x11c043){if(_0x11c043){return _0x11c043[_0x4d82('0x22')]()[_0x4d82('0x21')](function(){_0xe17d70[_0x4d82('0x16')](0xcc)[_0x4d82('0x15')]();});}};}function handleEntityNotFound(_0x395efc,_0x7404ba){return function(_0x284c66){if(!_0x284c66){_0x395efc[_0x4d82('0x14')](0x194);}return _0x284c66;};}function handleError(_0x4af6da,_0x5e0b03){_0x5e0b03=_0x5e0b03||0x1f4;return function(_0x3dcb0f){logger[_0x4d82('0x23')](_0x3dcb0f[_0x4d82('0x24')]);if(_0x3dcb0f[_0x4d82('0x25')]){delete _0x3dcb0f['name'];}_0x4af6da[_0x4d82('0x16')](_0x5e0b03)[_0x4d82('0x26')](_0x3dcb0f);};}exports[_0x4d82('0x27')]=function(_0x11d022,_0x5ce98b){var _0x4081f6={},_0x4a7444={},_0x4d9ac4={'count':0x0,'rows':[]};var _0x487581=_['map'](db[_0x4d82('0x28')][_0x4d82('0x29')],function(_0x88318c){return{'name':_0x88318c['fieldName'],'type':_0x88318c[_0x4d82('0x2a')][_0x4d82('0x2b')]};});_0x4a7444['model']=_['map'](_0x487581,_0x4d82('0x25'));_0x4a7444[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x11d022[_0x4d82('0x2c')]);_0x4a7444['filters']=_[_0x4d82('0x2e')](_0x4a7444['model'],_0x4a7444[_0x4d82('0x2c')]);_0x4081f6[_0x4d82('0x2f')]=_['intersection'](_0x4a7444['model'],qs[_0x4d82('0x30')](_0x11d022[_0x4d82('0x2c')][_0x4d82('0x30')]));_0x4081f6[_0x4d82('0x2f')]=_0x4081f6[_0x4d82('0x2f')][_0x4d82('0x31')]?_0x4081f6[_0x4d82('0x2f')]:_0x4a7444[_0x4d82('0x32')];if(!_0x11d022[_0x4d82('0x2c')][_0x4d82('0x33')]('nolimit')){_0x4081f6[_0x4d82('0x19')]=qs[_0x4d82('0x19')](_0x11d022[_0x4d82('0x2c')]['limit']);_0x4081f6[_0x4d82('0x17')]=qs[_0x4d82('0x17')](_0x11d022['query'][_0x4d82('0x17')]);}_0x4081f6[_0x4d82('0x34')]=qs[_0x4d82('0x35')](_0x11d022['query'][_0x4d82('0x35')]);_0x4081f6[_0x4d82('0x36')]=qs['filters'](_[_0x4d82('0x37')](_0x11d022['query'],_0x4a7444[_0x4d82('0x38')]),_0x487581);if(_0x11d022[_0x4d82('0x2c')]['filter']){_0x4081f6[_0x4d82('0x36')]=_['merge'](_0x4081f6[_0x4d82('0x36')],{'$or':_['map'](_0x487581,function(_0x51c705){if(_0x51c705[_0x4d82('0x2a')]!=='VIRTUAL'){var _0x2528d7={};_0x2528d7[_0x51c705['name']]={'$like':'%'+_0x11d022[_0x4d82('0x2c')][_0x4d82('0x39')]+'%'};return _0x2528d7;}})});}_0x4081f6=_['merge']({},_0x4081f6,_0x11d022[_0x4d82('0x3a')]);var _0x5d9444={'where':_0x4081f6[_0x4d82('0x36')]};return db[_0x4d82('0x28')]['count'](_0x5d9444)[_0x4d82('0x21')](function(_0x5521f1){_0x4d9ac4[_0x4d82('0x1a')]=_0x5521f1;if(_0x11d022[_0x4d82('0x2c')][_0x4d82('0x3b')]){_0x4081f6[_0x4d82('0x3c')]=[{'all':!![]}];}return db[_0x4d82('0x28')][_0x4d82('0x3d')](_0x4081f6);})['then'](function(_0x222b35){_0x4d9ac4[_0x4d82('0x3e')]=_0x222b35;return _0x4d9ac4;})[_0x4d82('0x21')](respondWithFilteredResult(_0x5ce98b,_0x4081f6))[_0x4d82('0x3f')](handleError(_0x5ce98b,null));};exports[_0x4d82('0x40')]=function(_0x363158,_0x37498b){var _0x4c474b={'raw':!![],'where':{'id':_0x363158[_0x4d82('0x41')]['id']}},_0x3c80d6={};_0x3c80d6[_0x4d82('0x32')]=_[_0x4d82('0x2d')](db[_0x4d82('0x28')]['rawAttributes']);_0x3c80d6[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x363158[_0x4d82('0x2c')]);_0x3c80d6[_0x4d82('0x38')]=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],_0x3c80d6[_0x4d82('0x2c')]);_0x4c474b['attributes']=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],qs['fields'](_0x363158[_0x4d82('0x2c')]['fields']));_0x4c474b[_0x4d82('0x2f')]=_0x4c474b[_0x4d82('0x2f')]['length']?_0x4c474b[_0x4d82('0x2f')]:_0x3c80d6[_0x4d82('0x32')];if(_0x363158['query'][_0x4d82('0x3b')]){_0x4c474b[_0x4d82('0x3c')]=[{'all':!![]}];}_0x4c474b=_[_0x4d82('0x42')]({},_0x4c474b,_0x363158['options']);return db[_0x4d82('0x28')][_0x4d82('0x43')](_0x4c474b)['then'](handleEntityNotFound(_0x37498b,null))['then'](respondWithResult(_0x37498b,null))[_0x4d82('0x3f')](handleError(_0x37498b,null));};exports[_0x4d82('0x44')]=function(_0x40c5ed,_0xb9d3bd){return db[_0x4d82('0x28')][_0x4d82('0x44')](_0x40c5ed[_0x4d82('0x45')],{})['then'](respondWithResult(_0xb9d3bd,0xc9))[_0x4d82('0x3f')](handleError(_0xb9d3bd,null));};exports[_0x4d82('0x20')]=function(_0x2e4083,_0x234ce3){if(_0x2e4083['body']['id']){delete _0x2e4083['body']['id'];}return db['MailQueueReport'][_0x4d82('0x43')]({'where':{'id':_0x2e4083[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x234ce3,null))[_0x4d82('0x21')](saveUpdates(_0x2e4083[_0x4d82('0x45')],null))[_0x4d82('0x21')](respondWithResult(_0x234ce3,null))['catch'](handleError(_0x234ce3,null));};exports[_0x4d82('0x22')]=function(_0x1c022d,_0x3c0ffc){return db[_0x4d82('0x28')][_0x4d82('0x43')]({'where':{'id':_0x1c022d[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x3c0ffc,null))[_0x4d82('0x21')](removeEntity(_0x3c0ffc,null))[_0x4d82('0x3f')](handleError(_0x3c0ffc,null));};exports['describe']=function(_0x418e6c,_0x25a4de){return db[_0x4d82('0x28')][_0x4d82('0x46')]()[_0x4d82('0x21')](respondWithResult(_0x25a4de,null))[_0x4d82('0x3f')](handleError(_0x25a4de,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 8d6eecd..e6a9f2c 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 _0xe883=['request-promise','path','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xe883,0x14a));var _0x3e88=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xe883[_0x580647];return _0x5f0792;};'use strict';var _=require(_0x3e88('0x0'));var util=require(_0x3e88('0x1'));var logger=require(_0x3e88('0x2'))(_0x3e88('0x3'));var moment=require(_0x3e88('0x4'));var BPromise=require(_0x3e88('0x5'));var rp=require(_0x3e88('0x6'));var fs=require('fs');var path=require(_0x3e88('0x7'));var rimraf=require('rimraf');var config=require(_0x3e88('0x8'));var attributes=require(_0x3e88('0x9'));module['exports']=function(_0x29a4d6,_0x535bcb){return _0x29a4d6[_0x3e88('0xa')](_0x3e88('0xb'),attributes,{'tableName':_0x3e88('0xc'),'paranoid':![],'indexes':[{'name':_0x3e88('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9167=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0x9167,0x16b));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7916('0x0'));var util=require(_0x7916('0x1'));var logger=require('../../config/logger')(_0x7916('0x2'));var moment=require(_0x7916('0x3'));var BPromise=require(_0x7916('0x4'));var rp=require(_0x7916('0x5'));var fs=require('fs');var path=require(_0x7916('0x6'));var rimraf=require(_0x7916('0x7'));var config=require(_0x7916('0x8'));var attributes=require(_0x7916('0x9'));module[_0x7916('0xa')]=function(_0x53c355,_0x39421a){return _0x53c355[_0x7916('0xb')](_0x7916('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7916('0xd'),'fields':[_0x7916('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index a508cc6..10a26ae 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x57f072,_0x911785){var _0x3db67e=function(_0x42798b){while(--_0x42798b){_0x57f072['push'](_0x57f072['shift']());}};_0x3db67e(++_0x911785);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x266bfd,_0x5305b8){var _0xc67a5a=function(_0x1323bd){while(--_0x1323bd){_0x266bfd['push'](_0x266bfd['shift']());}};_0xc67a5a(++_0x5305b8);}(_0x326f,0xd1));var _0xf326=function(_0x4db067,_0xab9699){_0x4db067=_0x4db067-0x0;var _0x592b23=_0x326f[_0x4db067];return _0x592b23;};'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 e448bd9..f38eadf 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x20a547,_0x222692){var _0x58fb1d=function(_0x3455ee){while(--_0x3455ee){_0x20a547['push'](_0x20a547['shift']());}};_0x58fb1d(++_0x222692);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x415e37,_0x35dff9){var _0x29153d=function(_0x1e3af2){while(--_0x1e3af2){_0x415e37['push'](_0x415e37['shift']());}};_0x29153d(++_0x35dff9);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 7c542b3..8ba016e 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 _0x65cb=['STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x25d408,_0x2b1491){var _0x5d3043=function(_0x508031){while(--_0x508031){_0x25d408['push'](_0x25d408['shift']());}};_0x5d3043(++_0x2b1491);}(_0x65cb,0xa4));var _0xb65c=function(_0x4ffc78,_0x4f9713){_0x4ffc78=_0x4ffc78-0x0;var _0xc9a899=_0x65cb[_0x4ffc78];return _0xc9a899;};'use strict';var Sequelize=require(_0xb65c('0x0'));module['exports']={'description':{'type':Sequelize[_0xb65c('0x1')]},'host':{'type':Sequelize[_0xb65c('0x1')]},'authentication':{'type':Sequelize[_0xb65c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb65c('0x1')]},'port':{'type':Sequelize[_0xb65c('0x3')]},'tls':{'type':Sequelize[_0xb65c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb65c('0x1')],'defaultValue':_0xb65c('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb65c('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xb65c('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb65c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5fd3=['STRING','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x25299a,_0x41af15){var _0x283c80=function(_0x19b317){while(--_0x19b317){_0x25299a['push'](_0x25299a['shift']());}};_0x283c80(++_0x41af15);}(_0x5fd3,0x16a));var _0x35fd=function(_0x4144a7,_0x2a7879){_0x4144a7=_0x4144a7-0x0;var _0x542e7b=_0x5fd3[_0x4144a7];return _0x542e7b;};'use strict';var Sequelize=require(_0x35fd('0x0'));module[_0x35fd('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x35fd('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x35fd('0x3')]},'password':{'type':Sequelize[_0x35fd('0x3')]},'port':{'type':Sequelize[_0x35fd('0x4')]},'tls':{'type':Sequelize[_0x35fd('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x35fd('0x3')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x35fd('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x35fd('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x35fd('0x3')]},'modernAuthentication':{'type':Sequelize[_0x35fd('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 7b28e07..0c7558c 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 _0xc5a9=['api','moment','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger'];(function(_0x254edf,_0x272d9b){var _0x338d8f=function(_0x46e508){while(--_0x46e508){_0x254edf['push'](_0x254edf['shift']());}};_0x338d8f(++_0x272d9b);}(_0xc5a9,0xb8));var _0x9c5a=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xc5a9[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x9c5a('0x0'));var util=require(_0x9c5a('0x1'));var logger=require(_0x9c5a('0x2'))(_0x9c5a('0x3'));var moment=require(_0x9c5a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c5a('0x5'));var config=require(_0x9c5a('0x6'));var attributes=require(_0x9c5a('0x7'));module[_0x9c5a('0x8')]=function(_0x42d461,_0x14c9ef){return _0x42d461[_0x9c5a('0x9')]('MailServerIn',attributes,{'tableName':_0x9c5a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc06e=['request-promise','rimraf','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc06e,0x1b3));var _0xec06=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xc06e[_0x368587];return _0x42d33c;};'use strict';var _=require(_0xec06('0x0'));var util=require(_0xec06('0x1'));var logger=require('../../config/logger')(_0xec06('0x2'));var moment=require(_0xec06('0x3'));var BPromise=require(_0xec06('0x4'));var rp=require(_0xec06('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec06('0x6'));var config=require('../../config/environment');var attributes=require(_0xec06('0x7'));module['exports']=function(_0x421558,_0x35fa2f){return _0x421558[_0xec06('0x8')](_0xec06('0x9'),attributes,{'tableName':_0xec06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 99cae15..8419ee6 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 _0x3dcb=['then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','options','raw','where','include','map','model','attributes','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x1f6691,_0x3a3d46){var _0xf786b6=function(_0x2afbdb){while(--_0x2afbdb){_0x1f6691['push'](_0x1f6691['shift']());}};_0xf786b6(++_0x3a3d46);}(_0x3dcb,0xe6));var _0xb3dc=function(_0x942722,_0x2cece9){_0x942722=_0x942722-0x0;var _0x4a0497=_0x3dcb[_0x942722];return _0x4a0497;};'use strict';var _=require(_0xb3dc('0x0'));var util=require(_0xb3dc('0x1'));var moment=require('moment');var BPromise=require(_0xb3dc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3dc('0x3'));var db=require(_0xb3dc('0x4'))['db'];var utils=require(_0xb3dc('0x5'));var logger=require('../../config/logger')(_0xb3dc('0x6'));var config=require('../../config/environment');var jayson=require(_0xb3dc('0x7'));var client=jayson[_0xb3dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e99f4,_0x1e6379,_0x400a85){return new BPromise(function(_0x42e234,_0x2c5388){return client[_0xb3dc('0x9')](_0x4e99f4,_0x400a85)[_0xb3dc('0xa')](function(_0x2f3547){logger[_0xb3dc('0xb')](_0xb3dc('0xc'),_0x1e6379,_0xb3dc('0xd'));logger[_0xb3dc('0xe')](_0xb3dc('0xf'),_0x1e6379,_0xb3dc('0xd'),JSON[_0xb3dc('0x10')](_0x2f3547));if(_0x2f3547[_0xb3dc('0x11')]){if(_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x12')]===0x1f4){logger[_0xb3dc('0x11')](_0xb3dc('0xc'),_0x1e6379,_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x13')]);return _0x2c5388(_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x13')]);}logger[_0xb3dc('0x11')](_0xb3dc('0xc'),_0x1e6379,_0x2f3547['error'][_0xb3dc('0x13')]);return _0x42e234(_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x13')]);}else{logger[_0xb3dc('0xb')](_0xb3dc('0xc'),_0x1e6379,_0xb3dc('0xd'));_0x42e234(_0x2f3547['result'][_0xb3dc('0x13')]);}})[_0xb3dc('0x14')](function(_0x4a0391){logger[_0xb3dc('0x11')](_0xb3dc('0xc'),_0x1e6379,_0x4a0391);_0x2c5388(_0x4a0391);});});}exports[_0xb3dc('0x15')]=function(_0x5e95b0){var _0x299aef=this;return new Promise(function(_0x185a0a,_0x420686){return db[_0xb3dc('0x16')]['findAll']({'raw':_0x5e95b0['options']?_0x5e95b0[_0xb3dc('0x17')][_0xb3dc('0x18')]===undefined?!![]:![]:!![],'where':_0x5e95b0[_0xb3dc('0x17')]?_0x5e95b0[_0xb3dc('0x17')][_0xb3dc('0x19')]||null:null,'attributes':_0x5e95b0['options']?_0x5e95b0[_0xb3dc('0x17')]['attributes']||null:null,'limit':_0x5e95b0[_0xb3dc('0x17')]?_0x5e95b0[_0xb3dc('0x17')]['limit']||null:null,'include':_0x5e95b0[_0xb3dc('0x17')]?_0x5e95b0['options'][_0xb3dc('0x1a')]?_[_0xb3dc('0x1b')](_0x5e95b0[_0xb3dc('0x17')][_0xb3dc('0x1a')],function(_0x88614){return{'model':db[_0x88614[_0xb3dc('0x1c')]],'as':_0x88614['as'],'attributes':_0x88614[_0xb3dc('0x1d')],'include':_0x88614[_0xb3dc('0x1a')]?_[_0xb3dc('0x1b')](_0x88614['include'],function(_0x4aaf3b){return{'model':db[_0x4aaf3b[_0xb3dc('0x1c')]],'as':_0x4aaf3b['as'],'attributes':_0x4aaf3b[_0xb3dc('0x1d')],'include':_0x4aaf3b[_0xb3dc('0x1a')]?_[_0xb3dc('0x1b')](_0x4aaf3b[_0xb3dc('0x1a')],function(_0x1d9a99){return{'model':db[_0x1d9a99[_0xb3dc('0x1c')]],'as':_0x1d9a99['as'],'attributes':_0x1d9a99[_0xb3dc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb3dc('0xa')](function(_0x57f8f4){logger[_0xb3dc('0xb')](_0xb3dc('0x15'),_0x5e95b0);logger[_0xb3dc('0xe')]('GetMailServerIn',_0x5e95b0,JSON[_0xb3dc('0x10')](_0x57f8f4));_0x185a0a(_0x57f8f4);})[_0xb3dc('0x14')](function(_0x54b016){logger[_0xb3dc('0x11')](_0xb3dc('0x15'),_0x54b016[_0xb3dc('0x13')],_0x5e95b0);_0x420686(_0x299aef[_0xb3dc('0x11')](0x1f4,_0x54b016[_0xb3dc('0x13')]));});});}; \ No newline at end of file +var _0xb59c=['catch','GetMailServerIn','options','raw','where','attributes','limit','map','model','include','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','result'];(function(_0x30f835,_0x39f004){var _0x1a9ec4=function(_0x2692c7){while(--_0x2692c7){_0x30f835['push'](_0x30f835['shift']());}};_0x1a9ec4(++_0x39f004);}(_0xb59c,0x10b));var _0xcb59=function(_0x46f58d,_0x5f365e){_0x46f58d=_0x46f58d-0x0;var _0x5c671f=_0xb59c[_0x46f58d];return _0x5c671f;};'use strict';var _=require(_0xcb59('0x0'));var util=require(_0xcb59('0x1'));var moment=require(_0xcb59('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb59('0x3'));var fs=require('fs');var Redis=require(_0xcb59('0x4'));var db=require(_0xcb59('0x5'))['db'];var utils=require(_0xcb59('0x6'));var logger=require('../../config/logger')(_0xcb59('0x7'));var config=require(_0xcb59('0x8'));var jayson=require(_0xcb59('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50712f,_0x3597ea,_0x2289e6){return new BPromise(function(_0x513186,_0x305cb1){return client[_0xcb59('0xa')](_0x50712f,_0x2289e6)[_0xcb59('0xb')](function(_0x42f94c){logger[_0xcb59('0xc')]('MailServerIn,\x20%s,\x20%s',_0x3597ea,_0xcb59('0xd'));logger[_0xcb59('0xe')](_0xcb59('0xf'),_0x3597ea,_0xcb59('0xd'),JSON['stringify'](_0x42f94c));if(_0x42f94c[_0xcb59('0x10')]){if(_0x42f94c['error'][_0xcb59('0x11')]===0x1f4){logger[_0xcb59('0x10')](_0xcb59('0x12'),_0x3597ea,_0x42f94c['error']['message']);return _0x305cb1(_0x42f94c[_0xcb59('0x10')][_0xcb59('0x13')]);}logger[_0xcb59('0x10')]('MailServerIn,\x20%s,\x20%s',_0x3597ea,_0x42f94c['error'][_0xcb59('0x13')]);return _0x513186(_0x42f94c['error']['message']);}else{logger['info'](_0xcb59('0x12'),_0x3597ea,'request\x20sent');_0x513186(_0x42f94c[_0xcb59('0x14')][_0xcb59('0x13')]);}})[_0xcb59('0x15')](function(_0x538ce5){logger[_0xcb59('0x10')]('MailServerIn,\x20%s,\x20%s',_0x3597ea,_0x538ce5);_0x305cb1(_0x538ce5);});});}exports[_0xcb59('0x16')]=function(_0x495506){var _0x3da28c=this;return new Promise(function(_0x35e2c5,_0x5e4259){return db['MailServerIn']['findAll']({'raw':_0x495506[_0xcb59('0x17')]?_0x495506[_0xcb59('0x17')][_0xcb59('0x18')]===undefined?!![]:![]:!![],'where':_0x495506[_0xcb59('0x17')]?_0x495506[_0xcb59('0x17')][_0xcb59('0x19')]||null:null,'attributes':_0x495506[_0xcb59('0x17')]?_0x495506['options'][_0xcb59('0x1a')]||null:null,'limit':_0x495506[_0xcb59('0x17')]?_0x495506[_0xcb59('0x17')][_0xcb59('0x1b')]||null:null,'include':_0x495506[_0xcb59('0x17')]?_0x495506[_0xcb59('0x17')]['include']?_[_0xcb59('0x1c')](_0x495506['options']['include'],function(_0x7856c6){return{'model':db[_0x7856c6[_0xcb59('0x1d')]],'as':_0x7856c6['as'],'attributes':_0x7856c6[_0xcb59('0x1a')],'include':_0x7856c6['include']?_[_0xcb59('0x1c')](_0x7856c6[_0xcb59('0x1e')],function(_0x3e10be){return{'model':db[_0x3e10be[_0xcb59('0x1d')]],'as':_0x3e10be['as'],'attributes':_0x3e10be[_0xcb59('0x1a')],'include':_0x3e10be['include']?_[_0xcb59('0x1c')](_0x3e10be[_0xcb59('0x1e')],function(_0x586c38){return{'model':db[_0x586c38[_0xcb59('0x1d')]],'as':_0x586c38['as'],'attributes':_0x586c38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fe9c2){logger[_0xcb59('0xc')](_0xcb59('0x16'),_0x495506);logger[_0xcb59('0xe')](_0xcb59('0x16'),_0x495506,JSON[_0xcb59('0x1f')](_0x1fe9c2));_0x35e2c5(_0x1fe9c2);})[_0xcb59('0x15')](function(_0x35a28d){logger['error'](_0xcb59('0x16'),_0x35a28d[_0xcb59('0x13')],_0x495506);_0x5e4259(_0x3da28c[_0xcb59('0x10')](0x1f4,_0x35a28d[_0xcb59('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index f389650..72d843f 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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a54,0x106));var _0x47a5=function(_0x152ea2,_0xb8630e){_0x152ea2=_0x152ea2-0x0;var _0x25d2d2=_0x7a54[_0x152ea2];return _0x25d2d2;};'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(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7a54,0x106));var _0x47a5=function(_0x19f916,_0x2aa62f){_0x19f916=_0x19f916-0x0;var _0x5268fc=_0x7a54[_0x19f916];return _0x5268fc;};'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 36ae67c..87d0920 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 _0xa478=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x1ee08c,_0x2dffef){var _0x481b67=function(_0xe6ea4c){while(--_0xe6ea4c){_0x1ee08c['push'](_0x1ee08c['shift']());}};_0x481b67(++_0x2dffef);}(_0xa478,0x136));var _0x8a47=function(_0x2c7780,_0x100f4a){_0x2c7780=_0x2c7780-0x0;var _0x580bc8=_0xa478[_0x2c7780];return _0x580bc8;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'description':{'type':Sequelize[_0x8a47('0x2')]},'host':{'type':Sequelize[_0x8a47('0x2')]},'user':{'type':Sequelize[_0x8a47('0x2')]},'pass':{'type':Sequelize[_0x8a47('0x2')]},'port':{'type':Sequelize[_0x8a47('0x3')]},'secure':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x8a47('0x2')]},'authentication':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x373d=['STRING','BOOLEAN','sequelize'];(function(_0x3ff9bc,_0x51778d){var _0x4017d6=function(_0x57bb0a){while(--_0x57bb0a){_0x3ff9bc['push'](_0x3ff9bc['shift']());}};_0x4017d6(++_0x51778d);}(_0x373d,0x1e2));var _0xd373=function(_0x315de3,_0x47fb12){_0x315de3=_0x315de3-0x0;var _0x1d1889=_0x373d[_0x315de3];return _0x1d1889;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'description':{'type':Sequelize[_0xd373('0x1')]},'host':{'type':Sequelize[_0xd373('0x1')]},'user':{'type':Sequelize[_0xd373('0x1')]},'pass':{'type':Sequelize[_0xd373('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xd373('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xd373('0x1')]},'authentication':{'type':Sequelize[_0xd373('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 75fa53b..af6d191 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 _0xb971=['params','keys','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','MailServerOut','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show'];(function(_0x4872b4,_0xb71de){var _0x1d0da4=function(_0x2daf8c){while(--_0x2daf8c){_0x4872b4['push'](_0x4872b4['shift']());}};_0x1d0da4(++_0xb71de);}(_0xb971,0x1bc));var _0x1b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb971[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1b97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b97('0x1'));var jsonpatch=require(_0x1b97('0x2'));var rp=require(_0x1b97('0x3'));var moment=require(_0x1b97('0x4'));var BPromise=require(_0x1b97('0x5'));var Mustache=require('mustache');var util=require(_0x1b97('0x6'));var path=require(_0x1b97('0x7'));var sox=require(_0x1b97('0x8'));var csv=require('to-csv');var ejs=require(_0x1b97('0x9'));var fs=require('fs');var fs_extra=require(_0x1b97('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b97('0xb'));var deskjs=require(_0x1b97('0xc'));var toCsv=require(_0x1b97('0xd'));var querystring=require(_0x1b97('0xe'));var Papa=require('papaparse');var Redis=require(_0x1b97('0xf'));var authService=require(_0x1b97('0x10'));var qs=require(_0x1b97('0x11'));var as=require(_0x1b97('0x12'));var hardwareService=require(_0x1b97('0x13'));var logger=require(_0x1b97('0x14'))('api');var utils=require(_0x1b97('0x15'));var config=require(_0x1b97('0x16'));var licenseUtil=require(_0x1b97('0x17'));var db=require(_0x1b97('0x18'))['db'];function respondWithStatusCode(_0x255730,_0xd7c5da){_0xd7c5da=_0xd7c5da||0xcc;return function(_0x502f93){if(_0x502f93){return _0x255730['sendStatus'](_0xd7c5da);}return _0x255730['status'](_0xd7c5da)['end']();};}function respondWithResult(_0x4c5ae4,_0x4a85c4){_0x4a85c4=_0x4a85c4||0xc8;return function(_0x43ad4d){if(_0x43ad4d){return _0x4c5ae4[_0x1b97('0x19')](_0x4a85c4)[_0x1b97('0x1a')](_0x43ad4d);}};}function respondWithFilteredResult(_0x4e5437,_0x307b8b){return function(_0x161a46){if(_0x161a46){var _0x3c79b0=typeof _0x307b8b[_0x1b97('0x1b')]==='undefined'&&typeof _0x307b8b[_0x1b97('0x1c')]===_0x1b97('0x1d');var _0x10828a=_0x161a46[_0x1b97('0x1e')];var _0x3dde32=_0x3c79b0?0x0:_0x307b8b[_0x1b97('0x1b')];var _0x52ecca=_0x3c79b0?_0x161a46[_0x1b97('0x1e')]:_0x307b8b[_0x1b97('0x1b')]+_0x307b8b[_0x1b97('0x1c')];var _0x210b2d;if(_0x52ecca>=_0x10828a){_0x52ecca=_0x10828a;_0x210b2d=0xc8;}else{_0x210b2d=0xce;}_0x4e5437['status'](_0x210b2d);return _0x4e5437['set'](_0x1b97('0x1f'),_0x3dde32+'-'+_0x52ecca+'/'+_0x10828a)['json'](_0x161a46);}return null;};}function patchUpdates(_0xc45e0b){return function(_0xf81070){try{jsonpatch[_0x1b97('0x20')](_0xf81070,_0xc45e0b,!![]);}catch(_0x5d242d){return BPromise['reject'](_0x5d242d);}return _0xf81070[_0x1b97('0x21')]();};}function saveUpdates(_0x298d8d,_0x512c21){return function(_0x1d3e71){if(_0x1d3e71){return _0x1d3e71[_0x1b97('0x22')](_0x298d8d)[_0x1b97('0x23')](function(_0x29ab2d){return _0x29ab2d;});}return null;};}function removeEntity(_0x18b1fb,_0x3cbb1a){return function(_0x275ccf){if(_0x275ccf){return _0x275ccf[_0x1b97('0x24')]()[_0x1b97('0x23')](function(){_0x18b1fb[_0x1b97('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x138b04,_0x1268fe){return function(_0x414373){if(!_0x414373){_0x138b04[_0x1b97('0x25')](0x194);}return _0x414373;};}function handleError(_0x6a95ac,_0x587b76){_0x587b76=_0x587b76||0x1f4;return function(_0x23cba6){logger[_0x1b97('0x26')](_0x23cba6['stack']);if(_0x23cba6[_0x1b97('0x27')]){delete _0x23cba6[_0x1b97('0x27')];}_0x6a95ac[_0x1b97('0x19')](_0x587b76)[_0x1b97('0x28')](_0x23cba6);};}exports[_0x1b97('0x29')]=function(_0x12d23e,_0x1fd4e5){var _0x1dbe8d={},_0x30443a={},_0x2e5ee0={'count':0x0,'rows':[]};var _0x32788f=_[_0x1b97('0x2a')](db[_0x1b97('0x2b')]['rawAttributes'],function(_0x46f897){return{'name':_0x46f897[_0x1b97('0x2c')],'type':_0x46f897[_0x1b97('0x2d')]['key']};});_0x30443a[_0x1b97('0x2e')]=_[_0x1b97('0x2a')](_0x32788f,_0x1b97('0x27'));_0x30443a[_0x1b97('0x2f')]=_['keys'](_0x12d23e[_0x1b97('0x2f')]);_0x30443a[_0x1b97('0x30')]=_[_0x1b97('0x31')](_0x30443a[_0x1b97('0x2e')],_0x30443a[_0x1b97('0x2f')]);_0x1dbe8d[_0x1b97('0x32')]=_['intersection'](_0x30443a[_0x1b97('0x2e')],qs['fields'](_0x12d23e[_0x1b97('0x2f')][_0x1b97('0x33')]));_0x1dbe8d[_0x1b97('0x32')]=_0x1dbe8d[_0x1b97('0x32')][_0x1b97('0x34')]?_0x1dbe8d[_0x1b97('0x32')]:_0x30443a['model'];if(!_0x12d23e[_0x1b97('0x2f')][_0x1b97('0x35')](_0x1b97('0x36'))){_0x1dbe8d[_0x1b97('0x1c')]=qs[_0x1b97('0x1c')](_0x12d23e[_0x1b97('0x2f')][_0x1b97('0x1c')]);_0x1dbe8d[_0x1b97('0x1b')]=qs[_0x1b97('0x1b')](_0x12d23e[_0x1b97('0x2f')][_0x1b97('0x1b')]);}_0x1dbe8d['order']=qs[_0x1b97('0x37')](_0x12d23e[_0x1b97('0x2f')][_0x1b97('0x37')]);_0x1dbe8d['where']=qs[_0x1b97('0x30')](_[_0x1b97('0x38')](_0x12d23e[_0x1b97('0x2f')],_0x30443a[_0x1b97('0x30')]),_0x32788f);if(_0x12d23e[_0x1b97('0x2f')]['filter']){_0x1dbe8d['where']=_[_0x1b97('0x39')](_0x1dbe8d[_0x1b97('0x3a')],{'$or':_[_0x1b97('0x2a')](_0x32788f,function(_0x1aa778){if(_0x1aa778[_0x1b97('0x2d')]!==_0x1b97('0x3b')){var _0x5a7de4={};_0x5a7de4[_0x1aa778[_0x1b97('0x27')]]={'$like':'%'+_0x12d23e['query'][_0x1b97('0x3c')]+'%'};return _0x5a7de4;}})});}_0x1dbe8d=_[_0x1b97('0x39')]({},_0x1dbe8d,_0x12d23e[_0x1b97('0x3d')]);var _0x5d82d5={'where':_0x1dbe8d[_0x1b97('0x3a')]};return db[_0x1b97('0x2b')][_0x1b97('0x1e')](_0x5d82d5)[_0x1b97('0x23')](function(_0x1eadd8){_0x2e5ee0[_0x1b97('0x1e')]=_0x1eadd8;if(_0x12d23e[_0x1b97('0x2f')][_0x1b97('0x3e')]){_0x1dbe8d[_0x1b97('0x3f')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x1dbe8d);})[_0x1b97('0x23')](function(_0x4f4a20){_0x2e5ee0[_0x1b97('0x40')]=_0x4f4a20;return _0x2e5ee0;})[_0x1b97('0x23')](respondWithFilteredResult(_0x1fd4e5,_0x1dbe8d))[_0x1b97('0x41')](handleError(_0x1fd4e5,null));};exports[_0x1b97('0x42')]=function(_0x4f08ff,_0x1f5cd8){var _0x5e049f={'raw':!![],'where':{'id':_0x4f08ff[_0x1b97('0x43')]['id']}},_0x4461dc={};_0x4461dc[_0x1b97('0x2e')]=_[_0x1b97('0x44')](db[_0x1b97('0x2b')][_0x1b97('0x45')]);_0x4461dc[_0x1b97('0x2f')]=_['keys'](_0x4f08ff[_0x1b97('0x2f')]);_0x4461dc[_0x1b97('0x30')]=_[_0x1b97('0x31')](_0x4461dc[_0x1b97('0x2e')],_0x4461dc[_0x1b97('0x2f')]);_0x5e049f[_0x1b97('0x32')]=_[_0x1b97('0x31')](_0x4461dc['model'],qs[_0x1b97('0x33')](_0x4f08ff[_0x1b97('0x2f')]['fields']));_0x5e049f[_0x1b97('0x32')]=_0x5e049f[_0x1b97('0x32')][_0x1b97('0x34')]?_0x5e049f['attributes']:_0x4461dc[_0x1b97('0x2e')];if(_0x4f08ff[_0x1b97('0x2f')][_0x1b97('0x3e')]){_0x5e049f[_0x1b97('0x3f')]=[{'all':!![]}];}_0x5e049f=_['merge']({},_0x5e049f,_0x4f08ff['options']);return db[_0x1b97('0x2b')][_0x1b97('0x46')](_0x5e049f)[_0x1b97('0x23')](handleEntityNotFound(_0x1f5cd8,null))[_0x1b97('0x23')](respondWithResult(_0x1f5cd8,null))[_0x1b97('0x41')](handleError(_0x1f5cd8,null));};exports[_0x1b97('0x47')]=function(_0x39e475,_0x55a417){return db['MailServerOut']['create'](_0x39e475['body'],{})['then'](respondWithResult(_0x55a417,0xc9))[_0x1b97('0x41')](handleError(_0x55a417,null));};exports['update']=function(_0x5624ed,_0x1127a9){if(_0x5624ed['body']['id']){delete _0x5624ed[_0x1b97('0x48')]['id'];}return db[_0x1b97('0x2b')][_0x1b97('0x46')]({'where':{'id':_0x5624ed['params']['id']}})[_0x1b97('0x23')](handleEntityNotFound(_0x1127a9,null))[_0x1b97('0x23')](saveUpdates(_0x5624ed[_0x1b97('0x48')],null))['then'](respondWithResult(_0x1127a9,null))[_0x1b97('0x41')](handleError(_0x1127a9,null));};exports['destroy']=function(_0x33011a,_0xcd725){return db['MailServerOut']['find']({'where':{'id':_0x33011a[_0x1b97('0x43')]['id']}})[_0x1b97('0x23')](handleEntityNotFound(_0xcd725,null))['then'](removeEntity(_0xcd725,null))[_0x1b97('0x41')](handleError(_0xcd725,null));}; \ No newline at end of file +var _0xea1e=['mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../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','Content-Range','apply','reject','save','update','destroy','then','sendStatus','name','send','index','map','MailServerOut','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','eml-format','fast-json-patch','request-promise','bluebird'];(function(_0x421316,_0x5274ab){var _0x5d92c1=function(_0x467fa1){while(--_0x467fa1){_0x421316['push'](_0x421316['shift']());}};_0x5d92c1(++_0x5274ab);}(_0xea1e,0x1a0));var _0xeea1=function(_0x3980ad,_0x369663){_0x3980ad=_0x3980ad-0x0;var _0x546473=_0xea1e[_0x3980ad];return _0x546473;};'use strict';var emlformat=require(_0xeea1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeea1('0x1'));var rp=require(_0xeea1('0x2'));var moment=require('moment');var BPromise=require(_0xeea1('0x3'));var Mustache=require(_0xeea1('0x4'));var util=require('util');var path=require(_0xeea1('0x5'));var sox=require(_0xeea1('0x6'));var csv=require(_0xeea1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeea1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeea1('0x9'));var jsforce=require(_0xeea1('0xa'));var deskjs=require(_0xeea1('0xb'));var toCsv=require(_0xeea1('0x7'));var querystring=require('querystring');var Papa=require(_0xeea1('0xc'));var Redis=require('ioredis');var authService=require(_0xeea1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xeea1('0xe'));var hardwareService=require(_0xeea1('0xf'));var logger=require(_0xeea1('0x10'))(_0xeea1('0x11'));var utils=require(_0xeea1('0x12'));var config=require(_0xeea1('0x13'));var licenseUtil=require(_0xeea1('0x14'));var db=require(_0xeea1('0x15'))['db'];function respondWithStatusCode(_0x3873e9,_0x533d42){_0x533d42=_0x533d42||0xcc;return function(_0x2fecce){if(_0x2fecce){return _0x3873e9['sendStatus'](_0x533d42);}return _0x3873e9['status'](_0x533d42)[_0xeea1('0x16')]();};}function respondWithResult(_0x4d0df5,_0x291151){_0x291151=_0x291151||0xc8;return function(_0x15855d){if(_0x15855d){return _0x4d0df5[_0xeea1('0x17')](_0x291151)[_0xeea1('0x18')](_0x15855d);}};}function respondWithFilteredResult(_0x351436,_0x3112a8){return function(_0x3d8ef8){if(_0x3d8ef8){var _0x502ff5=typeof _0x3112a8[_0xeea1('0x19')]===_0xeea1('0x1a')&&typeof _0x3112a8[_0xeea1('0x1b')]===_0xeea1('0x1a');var _0x5f93aa=_0x3d8ef8[_0xeea1('0x1c')];var _0xae4abc=_0x502ff5?0x0:_0x3112a8[_0xeea1('0x19')];var _0x48513a=_0x502ff5?_0x3d8ef8[_0xeea1('0x1c')]:_0x3112a8[_0xeea1('0x19')]+_0x3112a8['limit'];var _0xaeae3a;if(_0x48513a>=_0x5f93aa){_0x48513a=_0x5f93aa;_0xaeae3a=0xc8;}else{_0xaeae3a=0xce;}_0x351436[_0xeea1('0x17')](_0xaeae3a);return _0x351436['set'](_0xeea1('0x1d'),_0xae4abc+'-'+_0x48513a+'/'+_0x5f93aa)[_0xeea1('0x18')](_0x3d8ef8);}return null;};}function patchUpdates(_0x2cb673){return function(_0x4a3459){try{jsonpatch[_0xeea1('0x1e')](_0x4a3459,_0x2cb673,!![]);}catch(_0x139391){return BPromise[_0xeea1('0x1f')](_0x139391);}return _0x4a3459[_0xeea1('0x20')]();};}function saveUpdates(_0x5ac1c3,_0x5aea1b){return function(_0x4d68f6){if(_0x4d68f6){return _0x4d68f6[_0xeea1('0x21')](_0x5ac1c3)['then'](function(_0x5c2ee8){return _0x5c2ee8;});}return null;};}function removeEntity(_0x8f031f,_0x33c888){return function(_0x1632dd){if(_0x1632dd){return _0x1632dd[_0xeea1('0x22')]()[_0xeea1('0x23')](function(){_0x8f031f[_0xeea1('0x17')](0xcc)[_0xeea1('0x16')]();});}};}function handleEntityNotFound(_0x453eba,_0x55c80d){return function(_0xe4681e){if(!_0xe4681e){_0x453eba[_0xeea1('0x24')](0x194);}return _0xe4681e;};}function handleError(_0x2cd02b,_0x5a3c53){_0x5a3c53=_0x5a3c53||0x1f4;return function(_0xcff557){logger['error'](_0xcff557['stack']);if(_0xcff557[_0xeea1('0x25')]){delete _0xcff557['name'];}_0x2cd02b[_0xeea1('0x17')](_0x5a3c53)[_0xeea1('0x26')](_0xcff557);};}exports[_0xeea1('0x27')]=function(_0x1279a0,_0x3fac59){var _0x41989b={},_0x280e79={},_0x43dcee={'count':0x0,'rows':[]};var _0x411e7c=_[_0xeea1('0x28')](db[_0xeea1('0x29')]['rawAttributes'],function(_0x580a29){return{'name':_0x580a29[_0xeea1('0x2a')],'type':_0x580a29[_0xeea1('0x2b')][_0xeea1('0x2c')]};});_0x280e79[_0xeea1('0x2d')]=_[_0xeea1('0x28')](_0x411e7c,'name');_0x280e79[_0xeea1('0x2e')]=_[_0xeea1('0x2f')](_0x1279a0[_0xeea1('0x2e')]);_0x280e79[_0xeea1('0x30')]=_['intersection'](_0x280e79[_0xeea1('0x2d')],_0x280e79[_0xeea1('0x2e')]);_0x41989b[_0xeea1('0x31')]=_[_0xeea1('0x32')](_0x280e79['model'],qs['fields'](_0x1279a0[_0xeea1('0x2e')][_0xeea1('0x33')]));_0x41989b['attributes']=_0x41989b['attributes'][_0xeea1('0x34')]?_0x41989b[_0xeea1('0x31')]:_0x280e79['model'];if(!_0x1279a0[_0xeea1('0x2e')][_0xeea1('0x35')](_0xeea1('0x36'))){_0x41989b[_0xeea1('0x1b')]=qs['limit'](_0x1279a0[_0xeea1('0x2e')][_0xeea1('0x1b')]);_0x41989b[_0xeea1('0x19')]=qs[_0xeea1('0x19')](_0x1279a0[_0xeea1('0x2e')][_0xeea1('0x19')]);}_0x41989b['order']=qs[_0xeea1('0x37')](_0x1279a0[_0xeea1('0x2e')][_0xeea1('0x37')]);_0x41989b[_0xeea1('0x38')]=qs[_0xeea1('0x30')](_['pick'](_0x1279a0[_0xeea1('0x2e')],_0x280e79['filters']),_0x411e7c);if(_0x1279a0[_0xeea1('0x2e')][_0xeea1('0x39')]){_0x41989b[_0xeea1('0x38')]=_[_0xeea1('0x3a')](_0x41989b[_0xeea1('0x38')],{'$or':_[_0xeea1('0x28')](_0x411e7c,function(_0xd1c293){if(_0xd1c293[_0xeea1('0x2b')]!==_0xeea1('0x3b')){var _0x1c6dac={};_0x1c6dac[_0xd1c293[_0xeea1('0x25')]]={'$like':'%'+_0x1279a0[_0xeea1('0x2e')]['filter']+'%'};return _0x1c6dac;}})});}_0x41989b=_['merge']({},_0x41989b,_0x1279a0[_0xeea1('0x3c')]);var _0x15ab42={'where':_0x41989b['where']};return db[_0xeea1('0x29')][_0xeea1('0x1c')](_0x15ab42)[_0xeea1('0x23')](function(_0x45b531){_0x43dcee[_0xeea1('0x1c')]=_0x45b531;if(_0x1279a0['query'][_0xeea1('0x3d')]){_0x41989b[_0xeea1('0x3e')]=[{'all':!![]}];}return db[_0xeea1('0x29')]['findAll'](_0x41989b);})['then'](function(_0xf8319f){_0x43dcee['rows']=_0xf8319f;return _0x43dcee;})[_0xeea1('0x23')](respondWithFilteredResult(_0x3fac59,_0x41989b))[_0xeea1('0x3f')](handleError(_0x3fac59,null));};exports[_0xeea1('0x40')]=function(_0x4e0bbc,_0x1f9f8e){var _0x6e2a3={'raw':!![],'where':{'id':_0x4e0bbc[_0xeea1('0x41')]['id']}},_0x24983c={};_0x24983c[_0xeea1('0x2d')]=_['keys'](db[_0xeea1('0x29')][_0xeea1('0x42')]);_0x24983c[_0xeea1('0x2e')]=_[_0xeea1('0x2f')](_0x4e0bbc[_0xeea1('0x2e')]);_0x24983c[_0xeea1('0x30')]=_[_0xeea1('0x32')](_0x24983c['model'],_0x24983c['query']);_0x6e2a3['attributes']=_[_0xeea1('0x32')](_0x24983c[_0xeea1('0x2d')],qs[_0xeea1('0x33')](_0x4e0bbc[_0xeea1('0x2e')][_0xeea1('0x33')]));_0x6e2a3['attributes']=_0x6e2a3[_0xeea1('0x31')][_0xeea1('0x34')]?_0x6e2a3[_0xeea1('0x31')]:_0x24983c['model'];if(_0x4e0bbc['query'][_0xeea1('0x3d')]){_0x6e2a3[_0xeea1('0x3e')]=[{'all':!![]}];}_0x6e2a3=_[_0xeea1('0x3a')]({},_0x6e2a3,_0x4e0bbc['options']);return db['MailServerOut'][_0xeea1('0x43')](_0x6e2a3)[_0xeea1('0x23')](handleEntityNotFound(_0x1f9f8e,null))[_0xeea1('0x23')](respondWithResult(_0x1f9f8e,null))[_0xeea1('0x3f')](handleError(_0x1f9f8e,null));};exports[_0xeea1('0x44')]=function(_0x5b8ea2,_0x1ada01){return db[_0xeea1('0x29')]['create'](_0x5b8ea2[_0xeea1('0x45')],{})[_0xeea1('0x23')](respondWithResult(_0x1ada01,0xc9))['catch'](handleError(_0x1ada01,null));};exports['update']=function(_0x52289f,_0x424578){if(_0x52289f['body']['id']){delete _0x52289f[_0xeea1('0x45')]['id'];}return db[_0xeea1('0x29')][_0xeea1('0x43')]({'where':{'id':_0x52289f[_0xeea1('0x41')]['id']}})[_0xeea1('0x23')](handleEntityNotFound(_0x424578,null))['then'](saveUpdates(_0x52289f[_0xeea1('0x45')],null))[_0xeea1('0x23')](respondWithResult(_0x424578,null))[_0xeea1('0x3f')](handleError(_0x424578,null));};exports[_0xeea1('0x22')]=function(_0x47102e,_0x45ec88){return db[_0xeea1('0x29')][_0xeea1('0x43')]({'where':{'id':_0x47102e[_0xeea1('0x41')]['id']}})[_0xeea1('0x23')](handleEntityNotFound(_0x45ec88,null))['then'](removeEntity(_0x45ec88,null))[_0xeea1('0x3f')](handleError(_0x45ec88,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d27cc95..59966d7 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 _0x1111=['../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','moment','rimraf'];(function(_0x1a9696,_0xdf5fbf){var _0x578768=function(_0x32ab02){while(--_0x32ab02){_0x1a9696['push'](_0x1a9696['shift']());}};_0x578768(++_0xdf5fbf);}(_0x1111,0xb0));var _0x1111=function(_0x5dbde7,_0xf22b45){_0x5dbde7=_0x5dbde7-0x0;var _0x36002d=_0x1111[_0x5dbde7];return _0x36002d;};'use strict';var _=require(_0x1111('0x0'));var util=require('util');var logger=require(_0x1111('0x1'))('api');var moment=require(_0x1111('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1111('0x3'));var config=require(_0x1111('0x4'));var attributes=require('./mailServerOut.attributes');module[_0x1111('0x5')]=function(_0x25ee9c,_0x55e40b){return _0x25ee9c[_0x1111('0x6')](_0x1111('0x7'),attributes,{'tableName':_0x1111('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d0a=['../../config/logger','api','moment','bluebird','path','rimraf','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1d0a,0x8e));var _0xa1d0=function(_0x3d9fc9,_0x51467e){_0x3d9fc9=_0x3d9fc9-0x0;var _0x317e72=_0x1d0a[_0x3d9fc9];return _0x317e72;};'use strict';var _=require(_0xa1d0('0x0'));var util=require(_0xa1d0('0x1'));var logger=require(_0xa1d0('0x2'))(_0xa1d0('0x3'));var moment=require(_0xa1d0('0x4'));var BPromise=require(_0xa1d0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1d0('0x6'));var rimraf=require(_0xa1d0('0x7'));var config=require('../../config/environment');var attributes=require(_0xa1d0('0x8'));module['exports']=function(_0x443d9a,_0x1f8bfe){return _0x443d9a[_0xa1d0('0x9')](_0xa1d0('0xa'),attributes,{'tableName':_0xa1d0('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 f7b738c..728ded3 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0xadb5,0xad));var _0x5adb=function(_0x3766d9,_0x47b4dd){_0x3766d9=_0x3766d9-0x0;var _0x3403b6=_0xadb5[_0x3766d9];return _0x3403b6;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +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(_0x34ecc3,_0x2a7ea3){var _0xbb2355=function(_0x5df808){while(--_0x5df808){_0x34ecc3['push'](_0x34ecc3['shift']());}};_0xbb2355(++_0x2a7ea3);}(_0xdb28,0x106));var _0x8db2=function(_0x32f3c6,_0x32fb5e){_0x32f3c6=_0x32f3c6-0x0;var _0x35dd2c=_0xdb28[_0x32f3c6];return _0x35dd2c;};'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 17854a2..6c574f6 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 _0x2391=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x2391,0x104));var _0x1239=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x2391[_0x110c3d];return _0x226d67;};'use strict';var multer=require('multer');var util=require(_0x1239('0x0'));var path=require(_0x1239('0x1'));var timeout=require(_0x1239('0x2'));var express=require(_0x1239('0x3'));var router=express['Router']();var fs_extra=require(_0x1239('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1239('0x5'));var config=require(_0x1239('0x6'));var controller=require('./mailSubstatus.controller');router[_0x1239('0x7')]('/',auth[_0x1239('0x8')](),controller[_0x1239('0x9')]);router[_0x1239('0x7')](_0x1239('0xa'),auth['isAuthenticated'](),controller[_0x1239('0xb')]);router[_0x1239('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1239('0xc')]);router['post']('/',auth[_0x1239('0x8')](),controller[_0x1239('0xd')]);router[_0x1239('0xe')](_0x1239('0xf'),auth[_0x1239('0x8')](),controller[_0x1239('0x10')]);router[_0x1239('0x11')](_0x1239('0xf'),auth['isAuthenticated'](),controller[_0x1239('0x12')]);module[_0x1239('0x13')]=router; \ No newline at end of file +var _0xb4e4=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x529c6a,_0x1b6bbf){var _0x4ca96a=function(_0x1f0dc9){while(--_0x1f0dc9){_0x529c6a['push'](_0x529c6a['shift']());}};_0x4ca96a(++_0x1b6bbf);}(_0xb4e4,0x99));var _0x4b4e=function(_0x5ab679,_0x49c1e7){_0x5ab679=_0x5ab679-0x0;var _0x5b44fd=_0xb4e4[_0x5ab679];return _0x5b44fd;};'use strict';var multer=require('multer');var util=require(_0x4b4e('0x0'));var path=require('path');var timeout=require(_0x4b4e('0x1'));var express=require(_0x4b4e('0x2'));var router=express[_0x4b4e('0x3')]();var fs_extra=require(_0x4b4e('0x4'));var auth=require(_0x4b4e('0x5'));var interaction=require(_0x4b4e('0x6'));var config=require(_0x4b4e('0x7'));var controller=require(_0x4b4e('0x8'));router[_0x4b4e('0x9')]('/',auth[_0x4b4e('0xa')](),controller['index']);router['get'](_0x4b4e('0xb'),auth['isAuthenticated'](),controller[_0x4b4e('0xc')]);router[_0x4b4e('0x9')](_0x4b4e('0xd'),auth['isAuthenticated'](),controller[_0x4b4e('0xe')]);router['post']('/',auth[_0x4b4e('0xa')](),controller[_0x4b4e('0xf')]);router[_0x4b4e('0x10')](_0x4b4e('0xd'),auth[_0x4b4e('0xa')](),controller[_0x4b4e('0x11')]);router['delete'](_0x4b4e('0xd'),auth[_0x4b4e('0xa')](),controller[_0x4b4e('0x12')]);module[_0x4b4e('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 14413ab..60c2796 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 _0xe3da=['name','sequelize','exports','STRING'];(function(_0x18b310,_0xa8d0c0){var _0x3e7273=function(_0x597a6c){while(--_0x597a6c){_0x18b310['push'](_0x18b310['shift']());}};_0x3e7273(++_0xa8d0c0);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xae3d('0x0'));module[_0xae3d('0x1')]={'name':{'type':Sequelize[_0xae3d('0x2')],'unique':_0xae3d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xae3d('0x2')]}}; \ No newline at end of file +var _0x4fb4=['name','exports','STRING'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0x4fb4,0x190));var _0x44fb=function(_0x1c2b26,_0x1941c1){_0x1c2b26=_0x1c2b26-0x0;var _0x438087=_0x4fb4[_0x1c2b26];return _0x438087;};'use strict';var Sequelize=require('sequelize');module[_0x44fb('0x0')]={'name':{'type':Sequelize[_0x44fb('0x1')],'unique':_0x44fb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x44fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cb5c912..9c4f8b2 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 _0x98d3=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','sendStatus','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','length','include','catch','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x98d3,0x113));var _0x398d=function(_0x12a5a7,_0x3f04d4){_0x12a5a7=_0x12a5a7-0x0;var _0x5e868e=_0x98d3[_0x12a5a7];return _0x5e868e;};'use strict';var emlformat=require(_0x398d('0x0'));var rimraf=require(_0x398d('0x1'));var zipdir=require(_0x398d('0x2'));var jsonpatch=require(_0x398d('0x3'));var rp=require(_0x398d('0x4'));var moment=require('moment');var BPromise=require(_0x398d('0x5'));var Mustache=require(_0x398d('0x6'));var util=require(_0x398d('0x7'));var path=require(_0x398d('0x8'));var sox=require(_0x398d('0x9'));var csv=require(_0x398d('0xa'));var ejs=require(_0x398d('0xb'));var fs=require('fs');var fs_extra=require(_0x398d('0xc'));var _=require(_0x398d('0xd'));var squel=require('squel');var crypto=require(_0x398d('0xe'));var jsforce=require(_0x398d('0xf'));var deskjs=require(_0x398d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x398d('0x11'));var Redis=require('ioredis');var authService=require(_0x398d('0x12'));var qs=require(_0x398d('0x13'));var as=require(_0x398d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x398d('0x15'));var utils=require(_0x398d('0x16'));var config=require(_0x398d('0x17'));var licenseUtil=require(_0x398d('0x18'));var db=require(_0x398d('0x19'))['db'];function respondWithStatusCode(_0x3a12cc,_0x1b6c60){_0x1b6c60=_0x1b6c60||0xcc;return function(_0x411de9){if(_0x411de9){return _0x3a12cc['sendStatus'](_0x1b6c60);}return _0x3a12cc['status'](_0x1b6c60)[_0x398d('0x1a')]();};}function respondWithResult(_0x19131b,_0x2a9ea6){_0x2a9ea6=_0x2a9ea6||0xc8;return function(_0x3e1616){if(_0x3e1616){return _0x19131b[_0x398d('0x1b')](_0x2a9ea6)[_0x398d('0x1c')](_0x3e1616);}};}function respondWithFilteredResult(_0xb57205,_0xb4c6cf){return function(_0x11720d){if(_0x11720d){var _0x4d98b5=typeof _0xb4c6cf[_0x398d('0x1d')]===_0x398d('0x1e')&&typeof _0xb4c6cf[_0x398d('0x1f')]===_0x398d('0x1e');var _0x22ec0c=_0x11720d[_0x398d('0x20')];var _0x2442cb=_0x4d98b5?0x0:_0xb4c6cf[_0x398d('0x1d')];var _0x4af017=_0x4d98b5?_0x11720d[_0x398d('0x20')]:_0xb4c6cf[_0x398d('0x1d')]+_0xb4c6cf['limit'];var _0x43054e;if(_0x4af017>=_0x22ec0c){_0x4af017=_0x22ec0c;_0x43054e=0xc8;}else{_0x43054e=0xce;}_0xb57205[_0x398d('0x1b')](_0x43054e);return _0xb57205[_0x398d('0x21')]('Content-Range',_0x2442cb+'-'+_0x4af017+'/'+_0x22ec0c)[_0x398d('0x1c')](_0x11720d);}return null;};}function patchUpdates(_0x1b3ac9){return function(_0x3ea11e){try{jsonpatch[_0x398d('0x22')](_0x3ea11e,_0x1b3ac9,!![]);}catch(_0x3fbe45){return BPromise['reject'](_0x3fbe45);}return _0x3ea11e[_0x398d('0x23')]();};}function saveUpdates(_0x49505b,_0x71b6d2){return function(_0x199673){if(_0x199673){return _0x199673['update'](_0x49505b)[_0x398d('0x24')](function(_0x1f076e){return _0x1f076e;});}return null;};}function removeEntity(_0xb850d1,_0x18ffb3){return function(_0x348b8e){if(_0x348b8e){return _0x348b8e[_0x398d('0x25')]()['then'](function(){_0xb850d1[_0x398d('0x1b')](0xcc)[_0x398d('0x1a')]();});}};}function handleEntityNotFound(_0x3f05aa,_0x5094df){return function(_0x1c9d5d){if(!_0x1c9d5d){_0x3f05aa[_0x398d('0x26')](0x194);}return _0x1c9d5d;};}function handleError(_0x432639,_0xbf229c){_0xbf229c=_0xbf229c||0x1f4;return function(_0x2c2b53){logger[_0x398d('0x27')](_0x2c2b53['stack']);if(_0x2c2b53['name']){delete _0x2c2b53[_0x398d('0x28')];}_0x432639[_0x398d('0x1b')](_0xbf229c)[_0x398d('0x29')](_0x2c2b53);};}exports[_0x398d('0x2a')]=function(_0x123fe6,_0x328637){var _0x50a6d7={},_0x5e8cc5={},_0x2a038e={'count':0x0,'rows':[]};var _0x128fb6=_[_0x398d('0x2b')](db[_0x398d('0x2c')][_0x398d('0x2d')],function(_0x3a3d4e){return{'name':_0x3a3d4e[_0x398d('0x2e')],'type':_0x3a3d4e[_0x398d('0x2f')]['key']};});_0x5e8cc5['model']=_[_0x398d('0x2b')](_0x128fb6,'name');_0x5e8cc5[_0x398d('0x30')]=_[_0x398d('0x31')](_0x123fe6['query']);_0x5e8cc5[_0x398d('0x32')]=_[_0x398d('0x33')](_0x5e8cc5[_0x398d('0x34')],_0x5e8cc5[_0x398d('0x30')]);_0x50a6d7[_0x398d('0x35')]=_[_0x398d('0x33')](_0x5e8cc5[_0x398d('0x34')],qs[_0x398d('0x36')](_0x123fe6[_0x398d('0x30')][_0x398d('0x36')]));_0x50a6d7[_0x398d('0x35')]=_0x50a6d7[_0x398d('0x35')]['length']?_0x50a6d7[_0x398d('0x35')]:_0x5e8cc5[_0x398d('0x34')];if(!_0x123fe6['query'][_0x398d('0x37')]('nolimit')){_0x50a6d7[_0x398d('0x1f')]=qs[_0x398d('0x1f')](_0x123fe6['query'][_0x398d('0x1f')]);_0x50a6d7[_0x398d('0x1d')]=qs[_0x398d('0x1d')](_0x123fe6[_0x398d('0x30')][_0x398d('0x1d')]);}_0x50a6d7['order']=qs['sort'](_0x123fe6[_0x398d('0x30')]['sort']);_0x50a6d7[_0x398d('0x38')]=qs['filters'](_[_0x398d('0x39')](_0x123fe6['query'],_0x5e8cc5[_0x398d('0x32')]),_0x128fb6);if(_0x123fe6['query'][_0x398d('0x3a')]){_0x50a6d7[_0x398d('0x38')]=_[_0x398d('0x3b')](_0x50a6d7['where'],{'$or':_[_0x398d('0x2b')](_0x128fb6,function(_0x481d5b){if(_0x481d5b[_0x398d('0x2f')]!==_0x398d('0x3c')){var _0x12343c={};_0x12343c[_0x481d5b[_0x398d('0x28')]]={'$like':'%'+_0x123fe6['query']['filter']+'%'};return _0x12343c;}})});}_0x50a6d7=_[_0x398d('0x3b')]({},_0x50a6d7,_0x123fe6[_0x398d('0x3d')]);var _0x49d691={'where':_0x50a6d7['where']};return db[_0x398d('0x2c')][_0x398d('0x20')](_0x49d691)[_0x398d('0x24')](function(_0x4ae3ec){_0x2a038e['count']=_0x4ae3ec;if(_0x123fe6[_0x398d('0x30')][_0x398d('0x3e')]){_0x50a6d7['include']=[{'all':!![]}];}return db[_0x398d('0x2c')]['findAll'](_0x50a6d7);})['then'](function(_0x2e582e){_0x2a038e[_0x398d('0x3f')]=_0x2e582e;return _0x2a038e;})['then'](respondWithFilteredResult(_0x328637,_0x50a6d7))['catch'](handleError(_0x328637,null));};exports[_0x398d('0x40')]=function(_0x5d25d4,_0x1d796d){var _0x32d58d={'raw':!![],'where':{'id':_0x5d25d4['params']['id']}},_0x5b1292={};_0x5b1292[_0x398d('0x34')]=_['keys'](db[_0x398d('0x2c')]['rawAttributes']);_0x5b1292['query']=_['keys'](_0x5d25d4[_0x398d('0x30')]);_0x5b1292[_0x398d('0x32')]=_['intersection'](_0x5b1292[_0x398d('0x34')],_0x5b1292[_0x398d('0x30')]);_0x32d58d[_0x398d('0x35')]=_[_0x398d('0x33')](_0x5b1292['model'],qs[_0x398d('0x36')](_0x5d25d4[_0x398d('0x30')][_0x398d('0x36')]));_0x32d58d[_0x398d('0x35')]=_0x32d58d[_0x398d('0x35')][_0x398d('0x41')]?_0x32d58d[_0x398d('0x35')]:_0x5b1292[_0x398d('0x34')];if(_0x5d25d4[_0x398d('0x30')][_0x398d('0x3e')]){_0x32d58d[_0x398d('0x42')]=[{'all':!![]}];}_0x32d58d=_['merge']({},_0x32d58d,_0x5d25d4[_0x398d('0x3d')]);return db[_0x398d('0x2c')]['find'](_0x32d58d)[_0x398d('0x24')](handleEntityNotFound(_0x1d796d,null))[_0x398d('0x24')](respondWithResult(_0x1d796d,null))[_0x398d('0x43')](handleError(_0x1d796d,null));};exports[_0x398d('0x44')]=function(_0x4b5d39,_0x12daf5){return db[_0x398d('0x2c')][_0x398d('0x44')](_0x4b5d39[_0x398d('0x45')],{})[_0x398d('0x24')](respondWithResult(_0x12daf5,0xc9))[_0x398d('0x43')](handleError(_0x12daf5,null));};exports[_0x398d('0x46')]=function(_0x54d9a0,_0x4f3c43){if(_0x54d9a0[_0x398d('0x45')]['id']){delete _0x54d9a0[_0x398d('0x45')]['id'];}return db[_0x398d('0x2c')][_0x398d('0x47')]({'where':{'id':_0x54d9a0[_0x398d('0x48')]['id']}})[_0x398d('0x24')](handleEntityNotFound(_0x4f3c43,null))[_0x398d('0x24')](saveUpdates(_0x54d9a0[_0x398d('0x45')],null))[_0x398d('0x24')](respondWithResult(_0x4f3c43,null))[_0x398d('0x43')](handleError(_0x4f3c43,null));};exports[_0x398d('0x25')]=function(_0x322bf4,_0x33c2c3){return db[_0x398d('0x2c')][_0x398d('0x47')]({'where':{'id':_0x322bf4['params']['id']}})[_0x398d('0x24')](handleEntityNotFound(_0x33c2c3,null))[_0x398d('0x24')](removeEntity(_0x33c2c3,null))[_0x398d('0x43')](handleError(_0x33c2c3,null));};exports[_0x398d('0x49')]=function(_0x51d4a6,_0xf09ef4){return db[_0x398d('0x2c')][_0x398d('0x49')]()[_0x398d('0x24')](respondWithResult(_0xf09ef4,null))[_0x398d('0x43')](handleError(_0xf09ef4,null));}; \ No newline at end of file +var _0x5e61=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','type','key','query','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5e61,0xf5));var _0x15e6=function(_0x44f2d5,_0xffcb4){_0x44f2d5=_0x44f2d5-0x0;var _0x22d293=_0x5e61[_0x44f2d5];return _0x22d293;};'use strict';var emlformat=require(_0x15e6('0x0'));var rimraf=require(_0x15e6('0x1'));var zipdir=require(_0x15e6('0x2'));var jsonpatch=require(_0x15e6('0x3'));var rp=require(_0x15e6('0x4'));var moment=require(_0x15e6('0x5'));var BPromise=require(_0x15e6('0x6'));var Mustache=require(_0x15e6('0x7'));var util=require(_0x15e6('0x8'));var path=require(_0x15e6('0x9'));var sox=require(_0x15e6('0xa'));var csv=require(_0x15e6('0xb'));var ejs=require(_0x15e6('0xc'));var fs=require('fs');var fs_extra=require(_0x15e6('0xd'));var _=require(_0x15e6('0xe'));var squel=require(_0x15e6('0xf'));var crypto=require(_0x15e6('0x10'));var jsforce=require(_0x15e6('0x11'));var deskjs=require(_0x15e6('0x12'));var toCsv=require(_0x15e6('0xb'));var querystring=require(_0x15e6('0x13'));var Papa=require(_0x15e6('0x14'));var Redis=require(_0x15e6('0x15'));var authService=require(_0x15e6('0x16'));var qs=require(_0x15e6('0x17'));var as=require(_0x15e6('0x18'));var hardwareService=require(_0x15e6('0x19'));var logger=require(_0x15e6('0x1a'))(_0x15e6('0x1b'));var utils=require(_0x15e6('0x1c'));var config=require(_0x15e6('0x1d'));var licenseUtil=require(_0x15e6('0x1e'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e48d7,_0x4fa77f){_0x4fa77f=_0x4fa77f||0xcc;return function(_0x5e08a1){if(_0x5e08a1){return _0x3e48d7[_0x15e6('0x1f')](_0x4fa77f);}return _0x3e48d7[_0x15e6('0x20')](_0x4fa77f)[_0x15e6('0x21')]();};}function respondWithResult(_0xb16c17,_0x397daa){_0x397daa=_0x397daa||0xc8;return function(_0x5d4c2d){if(_0x5d4c2d){return _0xb16c17[_0x15e6('0x20')](_0x397daa)['json'](_0x5d4c2d);}};}function respondWithFilteredResult(_0x1893c1,_0x1bf30f){return function(_0x223471){if(_0x223471){var _0x50d796=typeof _0x1bf30f['offset']===_0x15e6('0x22')&&typeof _0x1bf30f['limit']===_0x15e6('0x22');var _0x537c24=_0x223471[_0x15e6('0x23')];var _0x216dfd=_0x50d796?0x0:_0x1bf30f[_0x15e6('0x24')];var _0x18c555=_0x50d796?_0x223471[_0x15e6('0x23')]:_0x1bf30f['offset']+_0x1bf30f['limit'];var _0x164333;if(_0x18c555>=_0x537c24){_0x18c555=_0x537c24;_0x164333=0xc8;}else{_0x164333=0xce;}_0x1893c1[_0x15e6('0x20')](_0x164333);return _0x1893c1[_0x15e6('0x25')](_0x15e6('0x26'),_0x216dfd+'-'+_0x18c555+'/'+_0x537c24)['json'](_0x223471);}return null;};}function patchUpdates(_0xf0627){return function(_0x3ceaef){try{jsonpatch[_0x15e6('0x27')](_0x3ceaef,_0xf0627,!![]);}catch(_0xd430b8){return BPromise[_0x15e6('0x28')](_0xd430b8);}return _0x3ceaef['save']();};}function saveUpdates(_0x30bf57,_0x4791f4){return function(_0x43dcae){if(_0x43dcae){return _0x43dcae[_0x15e6('0x29')](_0x30bf57)[_0x15e6('0x2a')](function(_0x31fcd2){return _0x31fcd2;});}return null;};}function removeEntity(_0x139aeb,_0x2356d0){return function(_0x1dbf1b){if(_0x1dbf1b){return _0x1dbf1b[_0x15e6('0x2b')]()['then'](function(){_0x139aeb[_0x15e6('0x20')](0xcc)[_0x15e6('0x21')]();});}};}function handleEntityNotFound(_0x542faf,_0x3da994){return function(_0x39f7dd){if(!_0x39f7dd){_0x542faf[_0x15e6('0x1f')](0x194);}return _0x39f7dd;};}function handleError(_0x1b6475,_0x20c1c1){_0x20c1c1=_0x20c1c1||0x1f4;return function(_0x267792){logger[_0x15e6('0x2c')](_0x267792[_0x15e6('0x2d')]);if(_0x267792[_0x15e6('0x2e')]){delete _0x267792['name'];}_0x1b6475[_0x15e6('0x20')](_0x20c1c1)[_0x15e6('0x2f')](_0x267792);};}exports[_0x15e6('0x30')]=function(_0x4aa0cd,_0x36876d){var _0x263b88={},_0x2f2c86={},_0x3ba7bd={'count':0x0,'rows':[]};var _0xc518a7=_[_0x15e6('0x31')](db[_0x15e6('0x32')]['rawAttributes'],function(_0x342a48){return{'name':_0x342a48['fieldName'],'type':_0x342a48[_0x15e6('0x33')][_0x15e6('0x34')]};});_0x2f2c86['model']=_[_0x15e6('0x31')](_0xc518a7,_0x15e6('0x2e'));_0x2f2c86[_0x15e6('0x35')]=_['keys'](_0x4aa0cd[_0x15e6('0x35')]);_0x2f2c86[_0x15e6('0x36')]=_[_0x15e6('0x37')](_0x2f2c86[_0x15e6('0x38')],_0x2f2c86['query']);_0x263b88[_0x15e6('0x39')]=_[_0x15e6('0x37')](_0x2f2c86[_0x15e6('0x38')],qs[_0x15e6('0x3a')](_0x4aa0cd['query'][_0x15e6('0x3a')]));_0x263b88[_0x15e6('0x39')]=_0x263b88[_0x15e6('0x39')]['length']?_0x263b88['attributes']:_0x2f2c86['model'];if(!_0x4aa0cd['query']['hasOwnProperty'](_0x15e6('0x3b'))){_0x263b88[_0x15e6('0x3c')]=qs[_0x15e6('0x3c')](_0x4aa0cd[_0x15e6('0x35')][_0x15e6('0x3c')]);_0x263b88['offset']=qs['offset'](_0x4aa0cd[_0x15e6('0x35')][_0x15e6('0x24')]);}_0x263b88[_0x15e6('0x3d')]=qs['sort'](_0x4aa0cd[_0x15e6('0x35')][_0x15e6('0x3e')]);_0x263b88['where']=qs[_0x15e6('0x36')](_[_0x15e6('0x3f')](_0x4aa0cd[_0x15e6('0x35')],_0x2f2c86['filters']),_0xc518a7);if(_0x4aa0cd['query'][_0x15e6('0x40')]){_0x263b88[_0x15e6('0x41')]=_[_0x15e6('0x42')](_0x263b88['where'],{'$or':_[_0x15e6('0x31')](_0xc518a7,function(_0x2e42dc){if(_0x2e42dc[_0x15e6('0x33')]!==_0x15e6('0x43')){var _0x4aa59a={};_0x4aa59a[_0x2e42dc['name']]={'$like':'%'+_0x4aa0cd[_0x15e6('0x35')][_0x15e6('0x40')]+'%'};return _0x4aa59a;}})});}_0x263b88=_[_0x15e6('0x42')]({},_0x263b88,_0x4aa0cd[_0x15e6('0x44')]);var _0x2cf634={'where':_0x263b88[_0x15e6('0x41')]};return db[_0x15e6('0x32')][_0x15e6('0x23')](_0x2cf634)['then'](function(_0x476191){_0x3ba7bd[_0x15e6('0x23')]=_0x476191;if(_0x4aa0cd[_0x15e6('0x35')][_0x15e6('0x45')]){_0x263b88[_0x15e6('0x46')]=[{'all':!![]}];}return db[_0x15e6('0x32')][_0x15e6('0x47')](_0x263b88);})[_0x15e6('0x2a')](function(_0x1caaac){_0x3ba7bd[_0x15e6('0x48')]=_0x1caaac;return _0x3ba7bd;})[_0x15e6('0x2a')](respondWithFilteredResult(_0x36876d,_0x263b88))[_0x15e6('0x49')](handleError(_0x36876d,null));};exports['show']=function(_0xfcfe1a,_0x2d397b){var _0x5a9d48={'raw':!![],'where':{'id':_0xfcfe1a[_0x15e6('0x4a')]['id']}},_0x5a52e6={};_0x5a52e6['model']=_['keys'](db[_0x15e6('0x32')][_0x15e6('0x4b')]);_0x5a52e6[_0x15e6('0x35')]=_['keys'](_0xfcfe1a['query']);_0x5a52e6[_0x15e6('0x36')]=_[_0x15e6('0x37')](_0x5a52e6['model'],_0x5a52e6['query']);_0x5a9d48['attributes']=_[_0x15e6('0x37')](_0x5a52e6[_0x15e6('0x38')],qs[_0x15e6('0x3a')](_0xfcfe1a[_0x15e6('0x35')][_0x15e6('0x3a')]));_0x5a9d48[_0x15e6('0x39')]=_0x5a9d48[_0x15e6('0x39')][_0x15e6('0x4c')]?_0x5a9d48[_0x15e6('0x39')]:_0x5a52e6[_0x15e6('0x38')];if(_0xfcfe1a[_0x15e6('0x35')][_0x15e6('0x45')]){_0x5a9d48[_0x15e6('0x46')]=[{'all':!![]}];}_0x5a9d48=_[_0x15e6('0x42')]({},_0x5a9d48,_0xfcfe1a['options']);return db[_0x15e6('0x32')][_0x15e6('0x4d')](_0x5a9d48)[_0x15e6('0x2a')](handleEntityNotFound(_0x2d397b,null))[_0x15e6('0x2a')](respondWithResult(_0x2d397b,null))[_0x15e6('0x49')](handleError(_0x2d397b,null));};exports[_0x15e6('0x4e')]=function(_0x558b81,_0x12204a){return db[_0x15e6('0x32')][_0x15e6('0x4e')](_0x558b81[_0x15e6('0x4f')],{})[_0x15e6('0x2a')](respondWithResult(_0x12204a,0xc9))[_0x15e6('0x49')](handleError(_0x12204a,null));};exports[_0x15e6('0x29')]=function(_0xaa609b,_0x3e806a){if(_0xaa609b[_0x15e6('0x4f')]['id']){delete _0xaa609b['body']['id'];}return db['MailSubstatus'][_0x15e6('0x4d')]({'where':{'id':_0xaa609b[_0x15e6('0x4a')]['id']}})[_0x15e6('0x2a')](handleEntityNotFound(_0x3e806a,null))[_0x15e6('0x2a')](saveUpdates(_0xaa609b[_0x15e6('0x4f')],null))[_0x15e6('0x2a')](respondWithResult(_0x3e806a,null))[_0x15e6('0x49')](handleError(_0x3e806a,null));};exports[_0x15e6('0x2b')]=function(_0x4f024c,_0x12060b){return db[_0x15e6('0x32')][_0x15e6('0x4d')]({'where':{'id':_0x4f024c[_0x15e6('0x4a')]['id']}})[_0x15e6('0x2a')](handleEntityNotFound(_0x12060b,null))[_0x15e6('0x2a')](removeEntity(_0x12060b,null))['catch'](handleError(_0x12060b,null));};exports['describe']=function(_0x520482,_0x2a0391){return db[_0x15e6('0x32')][_0x15e6('0x50')]()[_0x15e6('0x2a')](respondWithResult(_0x2a0391,null))['catch'](handleError(_0x2a0391,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index eb064bd..0acda59 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 _0x4931=['MailSubstatus','setMaxListeners','update','emit','hook','exports'];(function(_0x57207a,_0x5c06d2){var _0x3f27ed=function(_0x47e39f){while(--_0x47e39f){_0x57207a['push'](_0x57207a['shift']());}};_0x3f27ed(++_0x5c06d2);}(_0x4931,0x192));var _0x1493=function(_0x31fba5,_0x416811){_0x31fba5=_0x31fba5-0x0;var _0x2bdee2=_0x4931[_0x31fba5];return _0x2bdee2;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x1493('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x1493('0x1')](0x0);var events={'afterUpdate':_0x1493('0x2')};function emitEvent(_0xf9b75f){return function(_0x3874a1,_0x70ebce,_0x3f6c6f){MailSubstatusEvents[_0x1493('0x3')](_0xf9b75f+':'+_0x3874a1['id'],_0x3874a1);MailSubstatusEvents[_0x1493('0x3')](_0xf9b75f,_0x3874a1);_0x3f6c6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x1493('0x4')](e,emitEvent(event));}}module[_0x1493('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x443f=['update','emit','hook','events'];(function(_0x3ef457,_0x5f1d53){var _0x1b9d31=function(_0x3af89b){while(--_0x3af89b){_0x3ef457['push'](_0x3ef457['shift']());}};_0x1b9d31(++_0x5f1d53);}(_0x443f,0x117));var _0xf443=function(_0x1c643a,_0x37b521){_0x1c643a=_0x1c643a-0x0;var _0x3b9d8f=_0x443f[_0x1c643a];return _0x3b9d8f;};'use strict';var EventEmitter=require(_0xf443('0x0'));var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xf443('0x1')};function emitEvent(_0x185f76){return function(_0x18b704,_0x298657,_0x1d3ebd){MailSubstatusEvents[_0xf443('0x2')](_0x185f76+':'+_0x18b704['id'],_0x18b704);MailSubstatusEvents[_0xf443('0x2')](_0x185f76,_0x18b704);_0x1d3ebd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xf443('0x3')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ead839c..9effae4 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 _0x40ac=['models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0xf309a5,_0x1bd658){var _0x36ad0c=function(_0x512f53){while(--_0x512f53){_0xf309a5['push'](_0xf309a5['shift']());}};_0x36ad0c(++_0x1bd658);}(_0x40ac,0x8d));var _0xc40a=function(_0x1afa27,_0x5797fb){_0x1afa27=_0x1afa27-0x0;var _0xc82207=_0x40ac[_0x1afa27];return _0xc82207;};'use strict';var attributes=require(_0xc40a('0x0'));module[_0xc40a('0x1')]=function(_0x4f2ec1){var _0x1535fc=_0x4f2ec1[_0xc40a('0x2')];return _0x4f2ec1[_0xc40a('0x3')](_0xc40a('0x4'),attributes,{'tableName':_0xc40a('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xf1a6de,_0x25e554,_0x5a6e62){return _0x1535fc[_0xc40a('0x6')][_0xc40a('0x7')]({'value':_0xf1a6de[_0xc40a('0x8')]},{'where':{'field':_0xc40a('0x9'),'value':_0xf1a6de[_0xc40a('0xa')]['name']}})[_0xc40a('0xb')](function(){_0x5a6e62();})[_0xc40a('0xc')](function(_0x545379){_0x5a6e62(_0x545379);});}}});}; \ No newline at end of file +var _0xc0c5=['_previousDataValues','catch','./mailSubstatus.attributes','exports','models','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xc0c5,0x7a));var _0x5c0c=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xc0c5[_0x5d8018];return _0x151ac4;};'use strict';var attributes=require(_0x5c0c('0x0'));module[_0x5c0c('0x1')]=function(_0x462a76){var _0x6262f7=_0x462a76[_0x5c0c('0x2')];return _0x462a76['define']('MailSubstatus',attributes,{'tableName':_0x5c0c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x123eda,_0xe6cd71,_0x331267){return _0x6262f7[_0x5c0c('0x4')][_0x5c0c('0x5')]({'value':_0x123eda[_0x5c0c('0x6')]},{'where':{'field':_0x5c0c('0x7'),'value':_0x123eda[_0x5c0c('0x8')][_0x5c0c('0x6')]}})['then'](function(){_0x331267();})[_0x5c0c('0x9')](function(_0x39dbfc){_0x331267(_0x39dbfc);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6e447d7..5b71a5b 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 _0xbca8=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x270713,_0x3ea140){var _0x262d69=function(_0x56c05a){while(--_0x56c05a){_0x270713['push'](_0x270713['shift']());}};_0x262d69(++_0x3ea140);}(_0xbca8,0xf7));var _0x8bca=function(_0x1f6b4f,_0x312d42){_0x1f6b4f=_0x1f6b4f-0x0;var _0x291f4f=_0xbca8[_0x1f6b4f];return _0x291f4f;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var moment=require(_0x8bca('0x2'));var BPromise=require(_0x8bca('0x3'));var rs=require(_0x8bca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bca('0x5'))['db'];var utils=require(_0x8bca('0x6'));var logger=require('../../config/logger')(_0x8bca('0x7'));var config=require(_0x8bca('0x8'));var jayson=require(_0x8bca('0x9'));var client=jayson[_0x8bca('0xa')][_0x8bca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x181a84,_0x431e9a,_0x555f51){return new BPromise(function(_0x191005,_0x5e909e){return client[_0x8bca('0xc')](_0x181a84,_0x555f51)[_0x8bca('0xd')](function(_0x301c1d){logger[_0x8bca('0xe')](_0x8bca('0xf'),_0x431e9a,_0x8bca('0x10'));logger[_0x8bca('0x11')](_0x8bca('0x12'),_0x431e9a,_0x8bca('0x10'),JSON['stringify'](_0x301c1d));if(_0x301c1d[_0x8bca('0x13')]){if(_0x301c1d[_0x8bca('0x13')][_0x8bca('0x14')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x431e9a,_0x301c1d['error'][_0x8bca('0x15')]);return _0x5e909e(_0x301c1d['error'][_0x8bca('0x15')]);}logger[_0x8bca('0x13')](_0x8bca('0xf'),_0x431e9a,_0x301c1d[_0x8bca('0x13')][_0x8bca('0x15')]);return _0x191005(_0x301c1d[_0x8bca('0x13')]['message']);}else{logger['info'](_0x8bca('0xf'),_0x431e9a,_0x8bca('0x10'));_0x191005(_0x301c1d[_0x8bca('0x16')]['message']);}})[_0x8bca('0x17')](function(_0x3b1967){logger[_0x8bca('0x13')](_0x8bca('0xf'),_0x431e9a,_0x3b1967);_0x5e909e(_0x3b1967);});});} \ No newline at end of file +var _0xb10f=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x571265,_0x49f5f2){var _0x2e1c15=function(_0x8f41c3){while(--_0x8f41c3){_0x571265['push'](_0x571265['shift']());}};_0x2e1c15(++_0x49f5f2);}(_0xb10f,0xa3));var _0xfb10=function(_0xfcd7e8,_0x28d4e7){_0xfcd7e8=_0xfcd7e8-0x0;var _0x56694d=_0xb10f[_0xfcd7e8];return _0x56694d;};'use strict';var _=require('lodash');var util=require(_0xfb10('0x0'));var moment=require(_0xfb10('0x1'));var BPromise=require(_0xfb10('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb10('0x3'));var db=require(_0xfb10('0x4'))['db'];var utils=require(_0xfb10('0x5'));var logger=require(_0xfb10('0x6'))(_0xfb10('0x7'));var config=require(_0xfb10('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfb10('0x9')][_0xfb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e1ea4,_0x31fb39,_0x5834f0){return new BPromise(function(_0x171f6e,_0x43b761){return client['request'](_0x2e1ea4,_0x5834f0)[_0xfb10('0xb')](function(_0x5ba44a){logger[_0xfb10('0xc')](_0xfb10('0xd'),_0x31fb39,_0xfb10('0xe'));logger[_0xfb10('0xf')](_0xfb10('0x10'),_0x31fb39,'request\x20sent',JSON[_0xfb10('0x11')](_0x5ba44a));if(_0x5ba44a[_0xfb10('0x12')]){if(_0x5ba44a[_0xfb10('0x12')][_0xfb10('0x13')]===0x1f4){logger['error'](_0xfb10('0xd'),_0x31fb39,_0x5ba44a['error'][_0xfb10('0x14')]);return _0x43b761(_0x5ba44a[_0xfb10('0x12')][_0xfb10('0x14')]);}logger[_0xfb10('0x12')](_0xfb10('0xd'),_0x31fb39,_0x5ba44a[_0xfb10('0x12')]['message']);return _0x171f6e(_0x5ba44a[_0xfb10('0x12')][_0xfb10('0x14')]);}else{logger[_0xfb10('0xc')](_0xfb10('0xd'),_0x31fb39,_0xfb10('0xe'));_0x171f6e(_0x5ba44a[_0xfb10('0x15')]['message']);}})[_0xfb10('0x16')](function(_0x314456){logger[_0xfb10('0x12')](_0xfb10('0xd'),_0x31fb39,_0x314456);_0x43b761(_0x314456);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ac055f5..e255180 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 _0x1a22=['path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','exports','util'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x1a22,0x179));var _0x21a2=function(_0x20e13b,_0x3f7cd9){_0x20e13b=_0x20e13b-0x0;var _0x44d9d3=_0x1a22[_0x20e13b];return _0x44d9d3;};'use strict';var multer=require('multer');var util=require(_0x21a2('0x0'));var path=require(_0x21a2('0x1'));var timeout=require('connect-timeout');var express=require(_0x21a2('0x2'));var router=express['Router']();var fs_extra=require(_0x21a2('0x3'));var auth=require(_0x21a2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x21a2('0x5'));var controller=require('./mailTransferReport.controller');router[_0x21a2('0x6')]('/',auth[_0x21a2('0x7')](),controller[_0x21a2('0x8')]);router[_0x21a2('0x6')](_0x21a2('0x9'),auth[_0x21a2('0x7')](),controller[_0x21a2('0xa')]);router[_0x21a2('0x6')]('/:id',auth[_0x21a2('0x7')](),controller[_0x21a2('0xb')]);router[_0x21a2('0xc')]('/',auth[_0x21a2('0x7')](),controller[_0x21a2('0xd')]);router[_0x21a2('0xe')](_0x21a2('0xf'),auth[_0x21a2('0x7')](),controller['update']);router[_0x21a2('0x10')](_0x21a2('0xf'),auth[_0x21a2('0x7')](),controller['destroy']);module[_0x21a2('0x11')]=router; \ No newline at end of file +var _0x2503=['index','describe','show','post','create','put','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5bc390,_0x412cc8){var _0x231527=function(_0x4fae9a){while(--_0x4fae9a){_0x5bc390['push'](_0x5bc390['shift']());}};_0x231527(++_0x412cc8);}(_0x2503,0x1b1));var _0x3250=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2503[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x3250('0x0'));var path=require(_0x3250('0x1'));var timeout=require(_0x3250('0x2'));var express=require('express');var router=express[_0x3250('0x3')]();var fs_extra=require(_0x3250('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3250('0x5'));var config=require(_0x3250('0x6'));var controller=require('./mailTransferReport.controller');router[_0x3250('0x7')]('/',auth[_0x3250('0x8')](),controller[_0x3250('0x9')]);router[_0x3250('0x7')]('/describe',auth[_0x3250('0x8')](),controller[_0x3250('0xa')]);router['get']('/:id',auth[_0x3250('0x8')](),controller[_0x3250('0xb')]);router[_0x3250('0xc')]('/',auth[_0x3250('0x8')](),controller[_0x3250('0xd')]);router[_0x3250('0xe')]('/:id',auth[_0x3250('0x8')](),controller['update']);router[_0x3250('0xf')]('/:id',auth[_0x3250('0x8')](),controller[_0x3250('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 50bfaad..49a4c66 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1b5e1e,_0x5b657d){var _0x550594=function(_0x2da675){while(--_0x2da675){_0x1b5e1e['push'](_0x1b5e1e['shift']());}};_0x550594(++_0x5b657d);}(_0x34e8,0x12c));var _0x834e=function(_0x46bbaf,_0x47a142){_0x46bbaf=_0x46bbaf-0x0;var _0x56f4a4=_0x34e8[_0x46bbaf];return _0x56f4a4;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x130719,_0x2a7018){var _0x159865=function(_0x3a4d06){while(--_0x3a4d06){_0x130719['push'](_0x130719['shift']());}};_0x159865(++_0x2a7018);}(_0x54ef,0x112));var _0xf54e=function(_0x12182b,_0x5dbdcc){_0x12182b=_0x12182b-0x0;var _0x5ad918=_0x54ef[_0x12182b];return _0x5ad918;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a2b7cda..66415ad 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 _0x6ac0=['undefined','limit','count','set','json','apply','reject','save','then','end','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show','params','catch','create','body','update','destroy','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6ac0,0x109));var _0x06ac=function(_0x3709a7,_0x5238fa){_0x3709a7=_0x3709a7-0x0;var _0x31abc9=_0x6ac0[_0x3709a7];return _0x31abc9;};'use strict';var emlformat=require(_0x06ac('0x0'));var rimraf=require(_0x06ac('0x1'));var zipdir=require(_0x06ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06ac('0x3'));var moment=require('moment');var BPromise=require(_0x06ac('0x4'));var Mustache=require(_0x06ac('0x5'));var util=require(_0x06ac('0x6'));var path=require('path');var sox=require(_0x06ac('0x7'));var csv=require(_0x06ac('0x8'));var ejs=require(_0x06ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06ac('0xa'));var squel=require(_0x06ac('0xb'));var crypto=require(_0x06ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x06ac('0xd'));var toCsv=require(_0x06ac('0x8'));var querystring=require(_0x06ac('0xe'));var Papa=require('papaparse');var Redis=require(_0x06ac('0xf'));var authService=require(_0x06ac('0x10'));var qs=require(_0x06ac('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ac('0x12'));var logger=require(_0x06ac('0x13'))(_0x06ac('0x14'));var utils=require('../../config/utils');var config=require(_0x06ac('0x15'));var licenseUtil=require(_0x06ac('0x16'));var db=require(_0x06ac('0x17'))['db'];function respondWithStatusCode(_0x59ee19,_0x4a31cc){_0x4a31cc=_0x4a31cc||0xcc;return function(_0x2c2514){if(_0x2c2514){return _0x59ee19[_0x06ac('0x18')](_0x4a31cc);}return _0x59ee19[_0x06ac('0x19')](_0x4a31cc)['end']();};}function respondWithResult(_0x165315,_0x45dce8){_0x45dce8=_0x45dce8||0xc8;return function(_0x43ec58){if(_0x43ec58){return _0x165315[_0x06ac('0x19')](_0x45dce8)['json'](_0x43ec58);}};}function respondWithFilteredResult(_0x23fffd,_0x1b35f7){return function(_0xc49337){if(_0xc49337){var _0x1e3bb0=typeof _0x1b35f7[_0x06ac('0x1a')]===_0x06ac('0x1b')&&typeof _0x1b35f7[_0x06ac('0x1c')]===_0x06ac('0x1b');var _0x36fd2b=_0xc49337['count'];var _0x4de5e6=_0x1e3bb0?0x0:_0x1b35f7[_0x06ac('0x1a')];var _0x3b0acc=_0x1e3bb0?_0xc49337[_0x06ac('0x1d')]:_0x1b35f7[_0x06ac('0x1a')]+_0x1b35f7['limit'];var _0x291770;if(_0x3b0acc>=_0x36fd2b){_0x3b0acc=_0x36fd2b;_0x291770=0xc8;}else{_0x291770=0xce;}_0x23fffd['status'](_0x291770);return _0x23fffd[_0x06ac('0x1e')]('Content-Range',_0x4de5e6+'-'+_0x3b0acc+'/'+_0x36fd2b)[_0x06ac('0x1f')](_0xc49337);}return null;};}function patchUpdates(_0x17826a){return function(_0x5ba903){try{jsonpatch[_0x06ac('0x20')](_0x5ba903,_0x17826a,!![]);}catch(_0x2b816f){return BPromise[_0x06ac('0x21')](_0x2b816f);}return _0x5ba903[_0x06ac('0x22')]();};}function saveUpdates(_0x4deace,_0x4042f8){return function(_0x501019){if(_0x501019){return _0x501019['update'](_0x4deace)[_0x06ac('0x23')](function(_0x43afe9){return _0x43afe9;});}return null;};}function removeEntity(_0x567c6a,_0x17b1b4){return function(_0x36770e){if(_0x36770e){return _0x36770e['destroy']()[_0x06ac('0x23')](function(){_0x567c6a[_0x06ac('0x19')](0xcc)[_0x06ac('0x24')]();});}};}function handleEntityNotFound(_0x12a763,_0x5c1dd6){return function(_0x46caaa){if(!_0x46caaa){_0x12a763['sendStatus'](0x194);}return _0x46caaa;};}function handleError(_0x11de2d,_0x257a22){_0x257a22=_0x257a22||0x1f4;return function(_0x34cdb5){logger[_0x06ac('0x25')](_0x34cdb5['stack']);if(_0x34cdb5['name']){delete _0x34cdb5[_0x06ac('0x26')];}_0x11de2d[_0x06ac('0x19')](_0x257a22)['send'](_0x34cdb5);};}exports[_0x06ac('0x27')]=function(_0x2f477f,_0x4b87cb){var _0x5bc491={},_0x5707ce={},_0x432813={'count':0x0,'rows':[]};var _0x238e7a=_[_0x06ac('0x28')](db[_0x06ac('0x29')][_0x06ac('0x2a')],function(_0x20dc0b){return{'name':_0x20dc0b[_0x06ac('0x2b')],'type':_0x20dc0b[_0x06ac('0x2c')]['key']};});_0x5707ce[_0x06ac('0x2d')]=_['map'](_0x238e7a,_0x06ac('0x26'));_0x5707ce[_0x06ac('0x2e')]=_[_0x06ac('0x2f')](_0x2f477f['query']);_0x5707ce[_0x06ac('0x30')]=_[_0x06ac('0x31')](_0x5707ce[_0x06ac('0x2d')],_0x5707ce[_0x06ac('0x2e')]);_0x5bc491[_0x06ac('0x32')]=_[_0x06ac('0x31')](_0x5707ce[_0x06ac('0x2d')],qs[_0x06ac('0x33')](_0x2f477f[_0x06ac('0x2e')][_0x06ac('0x33')]));_0x5bc491[_0x06ac('0x32')]=_0x5bc491['attributes'][_0x06ac('0x34')]?_0x5bc491[_0x06ac('0x32')]:_0x5707ce['model'];if(!_0x2f477f[_0x06ac('0x2e')]['hasOwnProperty'](_0x06ac('0x35'))){_0x5bc491[_0x06ac('0x1c')]=qs[_0x06ac('0x1c')](_0x2f477f[_0x06ac('0x2e')][_0x06ac('0x1c')]);_0x5bc491['offset']=qs[_0x06ac('0x1a')](_0x2f477f[_0x06ac('0x2e')]['offset']);}_0x5bc491[_0x06ac('0x36')]=qs[_0x06ac('0x37')](_0x2f477f[_0x06ac('0x2e')]['sort']);_0x5bc491[_0x06ac('0x38')]=qs['filters'](_[_0x06ac('0x39')](_0x2f477f[_0x06ac('0x2e')],_0x5707ce[_0x06ac('0x30')]),_0x238e7a);if(_0x2f477f[_0x06ac('0x2e')]['filter']){_0x5bc491['where']=_[_0x06ac('0x3a')](_0x5bc491[_0x06ac('0x38')],{'$or':_[_0x06ac('0x28')](_0x238e7a,function(_0x21185d){if(_0x21185d[_0x06ac('0x2c')]!==_0x06ac('0x3b')){var _0x33e093={};_0x33e093[_0x21185d['name']]={'$like':'%'+_0x2f477f['query']['filter']+'%'};return _0x33e093;}})});}_0x5bc491=_['merge']({},_0x5bc491,_0x2f477f[_0x06ac('0x3c')]);var _0xd19441={'where':_0x5bc491[_0x06ac('0x38')]};return db[_0x06ac('0x29')][_0x06ac('0x1d')](_0xd19441)[_0x06ac('0x23')](function(_0x338b1f){_0x432813[_0x06ac('0x1d')]=_0x338b1f;if(_0x2f477f['query'][_0x06ac('0x3d')]){_0x5bc491[_0x06ac('0x3e')]=[{'all':!![]}];}return db[_0x06ac('0x29')]['findAll'](_0x5bc491);})[_0x06ac('0x23')](function(_0x42ef17){_0x432813[_0x06ac('0x3f')]=_0x42ef17;return _0x432813;})[_0x06ac('0x23')](respondWithFilteredResult(_0x4b87cb,_0x5bc491))['catch'](handleError(_0x4b87cb,null));};exports[_0x06ac('0x40')]=function(_0x218f55,_0x1a42a8){var _0xc3021c={'raw':!![],'where':{'id':_0x218f55[_0x06ac('0x41')]['id']}},_0x2ec3cf={};_0x2ec3cf[_0x06ac('0x2d')]=_[_0x06ac('0x2f')](db[_0x06ac('0x29')][_0x06ac('0x2a')]);_0x2ec3cf[_0x06ac('0x2e')]=_[_0x06ac('0x2f')](_0x218f55[_0x06ac('0x2e')]);_0x2ec3cf[_0x06ac('0x30')]=_['intersection'](_0x2ec3cf[_0x06ac('0x2d')],_0x2ec3cf[_0x06ac('0x2e')]);_0xc3021c[_0x06ac('0x32')]=_[_0x06ac('0x31')](_0x2ec3cf[_0x06ac('0x2d')],qs[_0x06ac('0x33')](_0x218f55[_0x06ac('0x2e')]['fields']));_0xc3021c['attributes']=_0xc3021c[_0x06ac('0x32')][_0x06ac('0x34')]?_0xc3021c[_0x06ac('0x32')]:_0x2ec3cf['model'];if(_0x218f55[_0x06ac('0x2e')]['includeAll']){_0xc3021c[_0x06ac('0x3e')]=[{'all':!![]}];}_0xc3021c=_[_0x06ac('0x3a')]({},_0xc3021c,_0x218f55[_0x06ac('0x3c')]);return db[_0x06ac('0x29')]['find'](_0xc3021c)['then'](handleEntityNotFound(_0x1a42a8,null))['then'](respondWithResult(_0x1a42a8,null))[_0x06ac('0x42')](handleError(_0x1a42a8,null));};exports['create']=function(_0x56b16f,_0x52e820){return db[_0x06ac('0x29')][_0x06ac('0x43')](_0x56b16f[_0x06ac('0x44')],{})[_0x06ac('0x23')](respondWithResult(_0x52e820,0xc9))[_0x06ac('0x42')](handleError(_0x52e820,null));};exports[_0x06ac('0x45')]=function(_0x12fab7,_0x5517d6){if(_0x12fab7[_0x06ac('0x44')]['id']){delete _0x12fab7[_0x06ac('0x44')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x12fab7[_0x06ac('0x41')]['id']}})['then'](handleEntityNotFound(_0x5517d6,null))[_0x06ac('0x23')](saveUpdates(_0x12fab7['body'],null))[_0x06ac('0x23')](respondWithResult(_0x5517d6,null))['catch'](handleError(_0x5517d6,null));};exports[_0x06ac('0x46')]=function(_0xe77d7b,_0x4cd8cf){return db['MailTransferReport'][_0x06ac('0x47')]({'where':{'id':_0xe77d7b[_0x06ac('0x41')]['id']}})[_0x06ac('0x23')](handleEntityNotFound(_0x4cd8cf,null))[_0x06ac('0x23')](removeEntity(_0x4cd8cf,null))[_0x06ac('0x42')](handleError(_0x4cd8cf,null));};exports[_0x06ac('0x48')]=function(_0xa2b7f,_0x283744){return db['MailTransferReport'][_0x06ac('0x48')]()[_0x06ac('0x23')](respondWithResult(_0x283744,null))['catch'](handleError(_0x283744,null));}; \ No newline at end of file +var _0x39fe=['destroy','error','name','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','pick','filter','merge','where','type','MailTransferReport','include','findAll','params','length','includeAll','options','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x39fe,0xff));var _0xe39f=function(_0x38fce0,_0x3ff92b){_0x38fce0=_0x38fce0-0x0;var _0x5c92bb=_0x39fe[_0x38fce0];return _0x5c92bb;};'use strict';var emlformat=require(_0xe39f('0x0'));var rimraf=require(_0xe39f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe39f('0x2'));var rp=require(_0xe39f('0x3'));var moment=require('moment');var BPromise=require(_0xe39f('0x4'));var Mustache=require(_0xe39f('0x5'));var util=require(_0xe39f('0x6'));var path=require('path');var sox=require(_0xe39f('0x7'));var csv=require(_0xe39f('0x8'));var ejs=require(_0xe39f('0x9'));var fs=require('fs');var fs_extra=require(_0xe39f('0xa'));var _=require(_0xe39f('0xb'));var squel=require(_0xe39f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe39f('0xd'));var toCsv=require(_0xe39f('0x8'));var querystring=require(_0xe39f('0xe'));var Papa=require(_0xe39f('0xf'));var Redis=require(_0xe39f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe39f('0x11'));var as=require(_0xe39f('0x12'));var hardwareService=require(_0xe39f('0x13'));var logger=require(_0xe39f('0x14'))('api');var utils=require(_0xe39f('0x15'));var config=require(_0xe39f('0x16'));var licenseUtil=require(_0xe39f('0x17'));var db=require(_0xe39f('0x18'))['db'];function respondWithStatusCode(_0x503bce,_0x2209ff){_0x2209ff=_0x2209ff||0xcc;return function(_0x49149d){if(_0x49149d){return _0x503bce[_0xe39f('0x19')](_0x2209ff);}return _0x503bce[_0xe39f('0x1a')](_0x2209ff)[_0xe39f('0x1b')]();};}function respondWithResult(_0x1a8673,_0x128424){_0x128424=_0x128424||0xc8;return function(_0x5ee1cf){if(_0x5ee1cf){return _0x1a8673[_0xe39f('0x1a')](_0x128424)['json'](_0x5ee1cf);}};}function respondWithFilteredResult(_0x55ffa9,_0x43670a){return function(_0x5bd63d){if(_0x5bd63d){var _0x561049=typeof _0x43670a[_0xe39f('0x1c')]===_0xe39f('0x1d')&&typeof _0x43670a[_0xe39f('0x1e')]==='undefined';var _0x48c066=_0x5bd63d['count'];var _0x36533b=_0x561049?0x0:_0x43670a['offset'];var _0x4656ba=_0x561049?_0x5bd63d[_0xe39f('0x1f')]:_0x43670a[_0xe39f('0x1c')]+_0x43670a['limit'];var _0x573277;if(_0x4656ba>=_0x48c066){_0x4656ba=_0x48c066;_0x573277=0xc8;}else{_0x573277=0xce;}_0x55ffa9['status'](_0x573277);return _0x55ffa9[_0xe39f('0x20')]('Content-Range',_0x36533b+'-'+_0x4656ba+'/'+_0x48c066)[_0xe39f('0x21')](_0x5bd63d);}return null;};}function patchUpdates(_0x151eb1){return function(_0x194186){try{jsonpatch[_0xe39f('0x22')](_0x194186,_0x151eb1,!![]);}catch(_0x1d12ab){return BPromise['reject'](_0x1d12ab);}return _0x194186[_0xe39f('0x23')]();};}function saveUpdates(_0x3c29eb,_0x535073){return function(_0x4cadd8){if(_0x4cadd8){return _0x4cadd8['update'](_0x3c29eb)[_0xe39f('0x24')](function(_0x18689d){return _0x18689d;});}return null;};}function removeEntity(_0x303b95,_0x4f4c86){return function(_0x567b5b){if(_0x567b5b){return _0x567b5b[_0xe39f('0x25')]()[_0xe39f('0x24')](function(){_0x303b95[_0xe39f('0x1a')](0xcc)[_0xe39f('0x1b')]();});}};}function handleEntityNotFound(_0x35c84d,_0x2707c2){return function(_0x3fb770){if(!_0x3fb770){_0x35c84d[_0xe39f('0x19')](0x194);}return _0x3fb770;};}function handleError(_0xf1e830,_0x32d3dd){_0x32d3dd=_0x32d3dd||0x1f4;return function(_0x2d1dc8){logger[_0xe39f('0x26')](_0x2d1dc8['stack']);if(_0x2d1dc8[_0xe39f('0x27')]){delete _0x2d1dc8[_0xe39f('0x27')];}_0xf1e830[_0xe39f('0x1a')](_0x32d3dd)['send'](_0x2d1dc8);};}exports[_0xe39f('0x28')]=function(_0x1cc6d2,_0x19387c){var _0x33eefa={},_0x33574e={},_0x35003c={'count':0x0,'rows':[]};var _0x5028dc=_[_0xe39f('0x29')](db['MailTransferReport'][_0xe39f('0x2a')],function(_0x1ebd4e){return{'name':_0x1ebd4e[_0xe39f('0x2b')],'type':_0x1ebd4e['type'][_0xe39f('0x2c')]};});_0x33574e[_0xe39f('0x2d')]=_[_0xe39f('0x29')](_0x5028dc,_0xe39f('0x27'));_0x33574e['query']=_[_0xe39f('0x2e')](_0x1cc6d2['query']);_0x33574e[_0xe39f('0x2f')]=_[_0xe39f('0x30')](_0x33574e['model'],_0x33574e[_0xe39f('0x31')]);_0x33eefa[_0xe39f('0x32')]=_[_0xe39f('0x30')](_0x33574e[_0xe39f('0x2d')],qs[_0xe39f('0x33')](_0x1cc6d2[_0xe39f('0x31')][_0xe39f('0x33')]));_0x33eefa[_0xe39f('0x32')]=_0x33eefa[_0xe39f('0x32')]['length']?_0x33eefa[_0xe39f('0x32')]:_0x33574e[_0xe39f('0x2d')];if(!_0x1cc6d2[_0xe39f('0x31')]['hasOwnProperty'](_0xe39f('0x34'))){_0x33eefa[_0xe39f('0x1e')]=qs[_0xe39f('0x1e')](_0x1cc6d2['query']['limit']);_0x33eefa['offset']=qs['offset'](_0x1cc6d2[_0xe39f('0x31')][_0xe39f('0x1c')]);}_0x33eefa[_0xe39f('0x35')]=qs[_0xe39f('0x36')](_0x1cc6d2[_0xe39f('0x31')]['sort']);_0x33eefa['where']=qs[_0xe39f('0x2f')](_[_0xe39f('0x37')](_0x1cc6d2[_0xe39f('0x31')],_0x33574e[_0xe39f('0x2f')]),_0x5028dc);if(_0x1cc6d2[_0xe39f('0x31')][_0xe39f('0x38')]){_0x33eefa['where']=_[_0xe39f('0x39')](_0x33eefa[_0xe39f('0x3a')],{'$or':_[_0xe39f('0x29')](_0x5028dc,function(_0x34b226){if(_0x34b226[_0xe39f('0x3b')]!=='VIRTUAL'){var _0x181caf={};_0x181caf[_0x34b226[_0xe39f('0x27')]]={'$like':'%'+_0x1cc6d2[_0xe39f('0x31')]['filter']+'%'};return _0x181caf;}})});}_0x33eefa=_[_0xe39f('0x39')]({},_0x33eefa,_0x1cc6d2['options']);var _0x2a754d={'where':_0x33eefa[_0xe39f('0x3a')]};return db[_0xe39f('0x3c')][_0xe39f('0x1f')](_0x2a754d)[_0xe39f('0x24')](function(_0x444a56){_0x35003c[_0xe39f('0x1f')]=_0x444a56;if(_0x1cc6d2[_0xe39f('0x31')]['includeAll']){_0x33eefa[_0xe39f('0x3d')]=[{'all':!![]}];}return db['MailTransferReport'][_0xe39f('0x3e')](_0x33eefa);})[_0xe39f('0x24')](function(_0x48061f){_0x35003c['rows']=_0x48061f;return _0x35003c;})[_0xe39f('0x24')](respondWithFilteredResult(_0x19387c,_0x33eefa))['catch'](handleError(_0x19387c,null));};exports['show']=function(_0x37c47a,_0x2f64f9){var _0x647382={'raw':!![],'where':{'id':_0x37c47a[_0xe39f('0x3f')]['id']}},_0x3c3a9c={};_0x3c3a9c[_0xe39f('0x2d')]=_[_0xe39f('0x2e')](db[_0xe39f('0x3c')][_0xe39f('0x2a')]);_0x3c3a9c[_0xe39f('0x31')]=_[_0xe39f('0x2e')](_0x37c47a['query']);_0x3c3a9c[_0xe39f('0x2f')]=_[_0xe39f('0x30')](_0x3c3a9c[_0xe39f('0x2d')],_0x3c3a9c[_0xe39f('0x31')]);_0x647382['attributes']=_[_0xe39f('0x30')](_0x3c3a9c[_0xe39f('0x2d')],qs[_0xe39f('0x33')](_0x37c47a[_0xe39f('0x31')][_0xe39f('0x33')]));_0x647382[_0xe39f('0x32')]=_0x647382[_0xe39f('0x32')][_0xe39f('0x40')]?_0x647382[_0xe39f('0x32')]:_0x3c3a9c[_0xe39f('0x2d')];if(_0x37c47a[_0xe39f('0x31')][_0xe39f('0x41')]){_0x647382[_0xe39f('0x3d')]=[{'all':!![]}];}_0x647382=_['merge']({},_0x647382,_0x37c47a[_0xe39f('0x42')]);return db[_0xe39f('0x3c')][_0xe39f('0x43')](_0x647382)[_0xe39f('0x24')](handleEntityNotFound(_0x2f64f9,null))[_0xe39f('0x24')](respondWithResult(_0x2f64f9,null))[_0xe39f('0x44')](handleError(_0x2f64f9,null));};exports[_0xe39f('0x45')]=function(_0x4ba219,_0x44ac5b){return db[_0xe39f('0x3c')][_0xe39f('0x45')](_0x4ba219[_0xe39f('0x46')],{})[_0xe39f('0x24')](respondWithResult(_0x44ac5b,0xc9))[_0xe39f('0x44')](handleError(_0x44ac5b,null));};exports[_0xe39f('0x47')]=function(_0x173cee,_0x482944){if(_0x173cee[_0xe39f('0x46')]['id']){delete _0x173cee[_0xe39f('0x46')]['id'];}return db[_0xe39f('0x3c')][_0xe39f('0x43')]({'where':{'id':_0x173cee[_0xe39f('0x3f')]['id']}})[_0xe39f('0x24')](handleEntityNotFound(_0x482944,null))[_0xe39f('0x24')](saveUpdates(_0x173cee[_0xe39f('0x46')],null))[_0xe39f('0x24')](respondWithResult(_0x482944,null))[_0xe39f('0x44')](handleError(_0x482944,null));};exports[_0xe39f('0x25')]=function(_0x2cd3a0,_0x57b1a8){return db[_0xe39f('0x3c')][_0xe39f('0x43')]({'where':{'id':_0x2cd3a0[_0xe39f('0x3f')]['id']}})[_0xe39f('0x24')](handleEntityNotFound(_0x57b1a8,null))[_0xe39f('0x24')](removeEntity(_0x57b1a8,null))[_0xe39f('0x44')](handleError(_0x57b1a8,null));};exports[_0xe39f('0x48')]=function(_0x2c3cb2,_0x5c6ae3){return db['MailTransferReport'][_0xe39f('0x48')]()[_0xe39f('0x24')](respondWithResult(_0x5c6ae3,null))[_0xe39f('0x44')](handleError(_0x5c6ae3,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e5c6b45..eef6071 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 _0x444a=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x55f9ef,_0x2b22c8){var _0xd3393e=function(_0x3ce98c){while(--_0x3ce98c){_0x55f9ef['push'](_0x55f9ef['shift']());}};_0xd3393e(++_0x2b22c8);}(_0x444a,0x170));var _0xa444=function(_0xc69530,_0x57c174){_0xc69530=_0xc69530-0x0;var _0x148a92=_0x444a[_0xc69530];return _0x148a92;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var logger=require(_0xa444('0x1'))(_0xa444('0x2'));var moment=require(_0xa444('0x3'));var BPromise=require(_0xa444('0x4'));var rp=require(_0xa444('0x5'));var fs=require('fs');var path=require(_0xa444('0x6'));var rimraf=require('rimraf');var config=require(_0xa444('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xa444('0x8')]=function(_0x5e66c2,_0x295b09){return _0x5e66c2[_0xa444('0x9')](_0xa444('0xa'),attributes,{'tableName':_0xa444('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa444('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe6f=['bluebird','request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe6f,0x105));var _0xfbe6=function(_0xe0bf7b,_0x50dbf2){_0xe0bf7b=_0xe0bf7b-0x0;var _0x3f5382=_0xbe6f[_0xe0bf7b];return _0x3f5382;};'use strict';var _=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var logger=require('../../config/logger')(_0xfbe6('0x2'));var moment=require('moment');var BPromise=require(_0xfbe6('0x3'));var rp=require(_0xfbe6('0x4'));var fs=require('fs');var path=require(_0xfbe6('0x5'));var rimraf=require('rimraf');var config=require(_0xfbe6('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0xfbe6('0x7')]=function(_0x22b077,_0x4abcf3){return _0x22b077[_0xfbe6('0x8')](_0xfbe6('0x9'),attributes,{'tableName':_0xfbe6('0xa'),'paranoid':![],'indexes':[{'name':_0xfbe6('0xb'),'fields':[_0xfbe6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f421e4a..59f1b4e 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 _0xcfa1=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1a8396,_0x280126){var _0x29ce3=function(_0x2a205a){while(--_0x2a205a){_0x1a8396['push'](_0x1a8396['shift']());}};_0x29ce3(++_0x280126);}(_0xcfa1,0x99));var _0x1cfa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfa1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cfa('0x0'));var util=require(_0x1cfa('0x1'));var moment=require(_0x1cfa('0x2'));var BPromise=require(_0x1cfa('0x3'));var rs=require(_0x1cfa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cfa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cfa('0x6'))(_0x1cfa('0x7'));var config=require(_0x1cfa('0x8'));var jayson=require(_0x1cfa('0x9'));var client=jayson[_0x1cfa('0xa')][_0x1cfa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419006,_0x11a735,_0x1ac175){return new BPromise(function(_0x2239cc,_0x384a69){return client[_0x1cfa('0xc')](_0x419006,_0x1ac175)[_0x1cfa('0xd')](function(_0x11b874){logger[_0x1cfa('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x11a735,'request\x20sent');logger[_0x1cfa('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x11a735,'request\x20sent',JSON[_0x1cfa('0x10')](_0x11b874));if(_0x11b874['error']){if(_0x11b874[_0x1cfa('0x11')]['code']===0x1f4){logger['error'](_0x1cfa('0x12'),_0x11a735,_0x11b874[_0x1cfa('0x11')]['message']);return _0x384a69(_0x11b874[_0x1cfa('0x11')][_0x1cfa('0x13')]);}logger['error'](_0x1cfa('0x12'),_0x11a735,_0x11b874[_0x1cfa('0x11')][_0x1cfa('0x13')]);return _0x2239cc(_0x11b874[_0x1cfa('0x11')][_0x1cfa('0x13')]);}else{logger[_0x1cfa('0xe')](_0x1cfa('0x12'),_0x11a735,'request\x20sent');_0x2239cc(_0x11b874[_0x1cfa('0x14')][_0x1cfa('0x13')]);}})[_0x1cfa('0x15')](function(_0x543255){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x11a735,_0x543255);_0x384a69(_0x543255);});});} \ No newline at end of file +var _0x1ec4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa0ef2b,_0x778b5e){var _0x9ef538=function(_0xe079e5){while(--_0xe079e5){_0xa0ef2b['push'](_0xa0ef2b['shift']());}};_0x9ef538(++_0x778b5e);}(_0x1ec4,0xb9));var _0x41ec=function(_0x408de0,_0x10f2bd){_0x408de0=_0x408de0-0x0;var _0x240762=_0x1ec4[_0x408de0];return _0x240762;};'use strict';var _=require('lodash');var util=require(_0x41ec('0x0'));var moment=require(_0x41ec('0x1'));var BPromise=require(_0x41ec('0x2'));var rs=require(_0x41ec('0x3'));var fs=require('fs');var Redis=require(_0x41ec('0x4'));var db=require(_0x41ec('0x5'))['db'];var utils=require(_0x41ec('0x6'));var logger=require(_0x41ec('0x7'))(_0x41ec('0x8'));var config=require(_0x41ec('0x9'));var jayson=require(_0x41ec('0xa'));var client=jayson[_0x41ec('0xb')][_0x41ec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe02dd6,_0x645423,_0x37dad3){return new BPromise(function(_0x35cddd,_0x2eb94c){return client[_0x41ec('0xd')](_0xe02dd6,_0x37dad3)[_0x41ec('0xe')](function(_0x5dddc1){logger[_0x41ec('0xf')](_0x41ec('0x10'),_0x645423,'request\x20sent');logger[_0x41ec('0x11')](_0x41ec('0x12'),_0x645423,'request\x20sent',JSON[_0x41ec('0x13')](_0x5dddc1));if(_0x5dddc1[_0x41ec('0x14')]){if(_0x5dddc1[_0x41ec('0x14')][_0x41ec('0x15')]===0x1f4){logger['error'](_0x41ec('0x10'),_0x645423,_0x5dddc1[_0x41ec('0x14')][_0x41ec('0x16')]);return _0x2eb94c(_0x5dddc1[_0x41ec('0x14')][_0x41ec('0x16')]);}logger[_0x41ec('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x645423,_0x5dddc1[_0x41ec('0x14')]['message']);return _0x35cddd(_0x5dddc1[_0x41ec('0x14')][_0x41ec('0x16')]);}else{logger[_0x41ec('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x645423,'request\x20sent');_0x35cddd(_0x5dddc1[_0x41ec('0x17')][_0x41ec('0x16')]);}})['catch'](function(_0x3567a5){logger[_0x41ec('0x14')](_0x41ec('0x10'),_0x645423,_0x3567a5);_0x2eb94c(_0x3567a5);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cc85d73..059deb2 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 _0x83cc=['get','/describe','describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index'];(function(_0x3e5b2b,_0x29b92d){var _0x28b2f7=function(_0x537d72){while(--_0x537d72){_0x3e5b2b['push'](_0x3e5b2b['shift']());}};_0x28b2f7(++_0x29b92d);}(_0x83cc,0x144));var _0xc83c=function(_0x362e87,_0x38d17c){_0x362e87=_0x362e87-0x0;var _0x334244=_0x83cc[_0x362e87];return _0x334244;};'use strict';var multer=require(_0xc83c('0x0'));var util=require(_0xc83c('0x1'));var path=require(_0xc83c('0x2'));var timeout=require(_0xc83c('0x3'));var express=require(_0xc83c('0x4'));var router=express[_0xc83c('0x5')]();var fs_extra=require(_0xc83c('0x6'));var auth=require(_0xc83c('0x7'));var interaction=require(_0xc83c('0x8'));var config=require('../../config/environment');var controller=require(_0xc83c('0x9'));router['get']('/',auth[_0xc83c('0xa')](),controller[_0xc83c('0xb')]);router[_0xc83c('0xc')](_0xc83c('0xd'),auth[_0xc83c('0xa')](),controller[_0xc83c('0xe')]);router['get'](_0xc83c('0xf'),auth['isAuthenticated'](),controller[_0xc83c('0x10')]);router[_0xc83c('0x11')]('/',auth[_0xc83c('0xa')](),controller['create']);router[_0xc83c('0x12')](_0xc83c('0xf'),auth[_0xc83c('0xa')](),controller['update']);router['delete'](_0xc83c('0xf'),auth[_0xc83c('0xa')](),controller[_0xc83c('0x13')]);module[_0xc83c('0x14')]=router; \ No newline at end of file +var _0x9e46=['isAuthenticated','index','/describe','/:id','show','post','put','update','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x136a01,_0x3e0f10){var _0x39ccee=function(_0x1fa530){while(--_0x1fa530){_0x136a01['push'](_0x136a01['shift']());}};_0x39ccee(++_0x3e0f10);}(_0x9e46,0x1a9));var _0x69e4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9e46[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x69e4('0x0'));var express=require(_0x69e4('0x1'));var router=express[_0x69e4('0x2')]();var fs_extra=require(_0x69e4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x69e4('0x4'));var config=require(_0x69e4('0x5'));var controller=require('./memberReport.controller');router[_0x69e4('0x6')]('/',auth[_0x69e4('0x7')](),controller[_0x69e4('0x8')]);router[_0x69e4('0x6')](_0x69e4('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x69e4('0xa'),auth[_0x69e4('0x7')](),controller[_0x69e4('0xb')]);router[_0x69e4('0xc')]('/',auth[_0x69e4('0x7')](),controller['create']);router[_0x69e4('0xd')](_0x69e4('0xa'),auth[_0x69e4('0x7')](),controller[_0x69e4('0xe')]);router[_0x69e4('0xf')](_0x69e4('0xa'),auth[_0x69e4('0x7')](),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 79f5a44..976f509 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 _0x4a02=['STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','exports'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0x4a02,0x194));var _0x24a0=function(_0x4c11ee,_0x5f2120){_0x4c11ee=_0x4c11ee-0x0;var _0x15dfae=_0x4a02[_0x4c11ee];return _0x15dfae;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x24a0('0x0')]={'channel':{'type':Sequelize[_0x24a0('0x1')]},'membername':{'type':Sequelize[_0x24a0('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x24a0('0x1')],'defaultValue':_0x24a0('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x24a0('0x3')]},'enterAt':{'type':Sequelize[_0x24a0('0x4')]},'exitAt':{'type':Sequelize[_0x24a0('0x4')],'set':function(_0x48af5a){var _0xbeffc1=moment(_0x48af5a);var _0x59bd32=moment(this[_0x24a0('0x5')]('enterAt'));var _0x5a3023=_0xbeffc1[_0x24a0('0x6')](_0x59bd32,_0x24a0('0x7'));this[_0x24a0('0x8')]('exitAt',_0x48af5a);this[_0x24a0('0x8')](_0x24a0('0x9'),_0x5a3023>=0x0?_0x5a3023:null);}},'data1':{'type':Sequelize[_0x24a0('0x1')],'comment':_0x24a0('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0x24a0('0xb')},'data3':{'type':Sequelize[_0x24a0('0x1')],'comment':_0x24a0('0xc')},'data4':{'type':Sequelize[_0x24a0('0x1')],'comment':_0x24a0('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x24a0('0xe')},'role':{'type':Sequelize[_0x24a0('0x1')]},'internal':{'type':Sequelize[_0x24a0('0x3')]},'uniqueid':{'type':Sequelize[_0x24a0('0x1')]}}; \ No newline at end of file +var _0x4365=['DATE','getDataValue','diff','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0x4365,0x17a));var _0x5436=function(_0x221bc5,_0x3e3bd7){_0x221bc5=_0x221bc5-0x0;var _0xdf4f74=_0x4365[_0x221bc5];return _0xdf4f74;};'use strict';var Sequelize=require(_0x5436('0x0'));var moment=require(_0x5436('0x1'));module[_0x5436('0x2')]={'channel':{'type':Sequelize[_0x5436('0x3')]},'membername':{'type':Sequelize[_0x5436('0x3')]},'interface':{'type':Sequelize[_0x5436('0x3')]},'type':{'type':Sequelize[_0x5436('0x3')],'defaultValue':_0x5436('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x5436('0x5')]},'enterAt':{'type':Sequelize[_0x5436('0x6')]},'exitAt':{'type':Sequelize[_0x5436('0x6')],'set':function(_0x5c72ec){var _0x20bfe6=moment(_0x5c72ec);var _0x52f8a6=moment(this[_0x5436('0x7')]('enterAt'));var _0x2991ff=_0x20bfe6[_0x5436('0x8')](_0x52f8a6,'seconds');this[_0x5436('0x9')](_0x5436('0xa'),_0x5c72ec);this[_0x5436('0x9')]('duration',_0x2991ff>=0x0?_0x2991ff:null);}},'data1':{'type':Sequelize[_0x5436('0x3')],'comment':_0x5436('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x5436('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x5436('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x5436('0xe')},'data5':{'type':Sequelize[_0x5436('0x3')],'comment':_0x5436('0xf')},'role':{'type':Sequelize[_0x5436('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 3bcc7af..093d197 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x40ea21,_0xe55b66){var _0x555e46=function(_0x5e73fc){while(--_0x5e73fc){_0x40ea21['push'](_0x40ea21['shift']());}};_0x555e46(++_0xe55b66);}(_0x008c,0x188));var _0xc008=function(_0x3db745,_0x49ad24){_0x3db745=_0x3db745-0x0;var _0x4bcb72=_0x008c[_0x3db745];return _0x4bcb72;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x2d6db1,_0x9a6781){var _0x6379dc=function(_0x4c56dd){while(--_0x4c56dd){_0x2d6db1['push'](_0x2d6db1['shift']());}};_0x6379dc(++_0x9a6781);}(_0x008c,0x188));var _0xc008=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x008c[_0x199b1f];return _0x267ac9;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 56776ec..86381ef 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 _0xf5c9=['interface','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf5c9,0x15a));var _0x9f5c=function(_0x234830,_0x5a880e){_0x234830=_0x234830-0x0;var _0x5bb48a=_0xf5c9[_0x234830];return _0x5bb48a;};'use strict';var _=require(_0x9f5c('0x0'));var util=require('util');var logger=require(_0x9f5c('0x1'))(_0x9f5c('0x2'));var moment=require(_0x9f5c('0x3'));var BPromise=require(_0x9f5c('0x4'));var rp=require(_0x9f5c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f5c('0x6'));var config=require(_0x9f5c('0x7'));var attributes=require(_0x9f5c('0x8'));module[_0x9f5c('0x9')]=function(_0x47e91a,_0x44a2f0){return _0x47e91a[_0x9f5c('0xa')](_0x9f5c('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x9f5c('0xc'),'fields':[_0x9f5c('0xd'),_0x9f5c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3715=['define','membername_interface','membername','interface','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x2d66a0,_0x411bf8){var _0x8276df=function(_0x20dad7){while(--_0x20dad7){_0x2d66a0['push'](_0x2d66a0['shift']());}};_0x8276df(++_0x411bf8);}(_0x3715,0x124));var _0x5371=function(_0x2b7427,_0x25d776){_0x2b7427=_0x2b7427-0x0;var _0x428316=_0x3715[_0x2b7427];return _0x428316;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5371('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5371('0x1'));var rp=require(_0x5371('0x2'));var fs=require('fs');var path=require(_0x5371('0x3'));var rimraf=require(_0x5371('0x4'));var config=require(_0x5371('0x5'));var attributes=require(_0x5371('0x6'));module[_0x5371('0x7')]=function(_0x5f01dd,_0x3de463){return _0x5f01dd[_0x5371('0x8')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x5371('0x9'),'fields':[_0x5371('0xa'),_0x5371('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 ea4b40e..7fddda2 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 _0xc9b0=['result','GetMemberReport','findAll','options','raw','where','attributes','include','map','model','catch','CreateMemberReport','create','body','then','UpdateMemberReport','MemberReport','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc9b0,0x143));var _0x0c9b=function(_0x2662da,_0x378cd1){_0x2662da=_0x2662da-0x0;var _0x1345e1=_0xc9b0[_0x2662da];return _0x1345e1;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var BPromise=require(_0x0c9b('0x3'));var rs=require(_0x0c9b('0x4'));var fs=require('fs');var Redis=require(_0x0c9b('0x5'));var db=require(_0x0c9b('0x6'))['db'];var utils=require(_0x0c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c9b('0x8'));var jayson=require(_0x0c9b('0x9'));var client=jayson[_0x0c9b('0xa')][_0x0c9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd53c,_0x16779e,_0x363958){return new BPromise(function(_0x44bcd5,_0x170820){return client['request'](_0x1bd53c,_0x363958)['then'](function(_0x4e4a0d){logger[_0x0c9b('0xc')](_0x0c9b('0xd'),_0x16779e,_0x0c9b('0xe'));logger[_0x0c9b('0xf')](_0x0c9b('0x10'),_0x16779e,_0x0c9b('0xe'),JSON['stringify'](_0x4e4a0d));if(_0x4e4a0d[_0x0c9b('0x11')]){if(_0x4e4a0d[_0x0c9b('0x11')]['code']===0x1f4){logger[_0x0c9b('0x11')]('MemberReport,\x20%s,\x20%s',_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x170820(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x44bcd5(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x16779e,'request\x20sent');_0x44bcd5(_0x4e4a0d[_0x0c9b('0x13')][_0x0c9b('0x12')]);}})['catch'](function(_0xa7bda1){logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0xa7bda1);_0x170820(_0xa7bda1);});});}exports[_0x0c9b('0x14')]=function(_0x2b2f65){var _0x4619b3=this;return new Promise(function(_0x39218d,_0x4bd2d8){return db['MemberReport'][_0x0c9b('0x15')]({'raw':_0x2b2f65['options']?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'where':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x18')]||null:null,'attributes':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x19')]||null:null,'limit':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')]['limit']||null:null,'include':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')]?_['map'](_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')],function(_0x2409c6){return{'model':db[_0x2409c6['model']],'as':_0x2409c6['as'],'attributes':_0x2409c6[_0x0c9b('0x19')],'include':_0x2409c6['include']?_[_0x0c9b('0x1b')](_0x2409c6[_0x0c9b('0x1a')],function(_0x2d1ce5){return{'model':db[_0x2d1ce5[_0x0c9b('0x1c')]],'as':_0x2d1ce5['as'],'attributes':_0x2d1ce5[_0x0c9b('0x19')],'include':_0x2d1ce5[_0x0c9b('0x1a')]?_[_0x0c9b('0x1b')](_0x2d1ce5[_0x0c9b('0x1a')],function(_0x476c59){return{'model':db[_0x476c59[_0x0c9b('0x1c')]],'as':_0x476c59['as'],'attributes':_0x476c59[_0x0c9b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x594710){logger[_0x0c9b('0xc')](_0x0c9b('0x14'),_0x2b2f65);logger[_0x0c9b('0xf')](_0x0c9b('0x14'),_0x2b2f65,JSON['stringify'](_0x594710));_0x39218d(_0x594710);})[_0x0c9b('0x1d')](function(_0x1391d1){logger['error'](_0x0c9b('0x14'),_0x1391d1[_0x0c9b('0x12')],_0x2b2f65);_0x4bd2d8(_0x4619b3[_0x0c9b('0x11')](0x1f4,_0x1391d1[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x1e')]=function(_0x30027c){var _0x523fad=this;return new Promise(function(_0x2eeea7,_0x125c55){return db['MemberReport'][_0x0c9b('0x1f')](_0x30027c[_0x0c9b('0x20')],{'raw':_0x30027c[_0x0c9b('0x16')]?_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![]})[_0x0c9b('0x21')](function(_0x21a348){logger[_0x0c9b('0xc')](_0x0c9b('0x1e'),_0x30027c);logger[_0x0c9b('0xf')](_0x0c9b('0x1e'),_0x30027c,JSON['stringify'](_0x21a348));_0x2eeea7(_0x21a348);})['catch'](function(_0x9629be){logger[_0x0c9b('0x11')](_0x0c9b('0x1e'),_0x9629be[_0x0c9b('0x12')],_0x30027c);_0x125c55(_0x523fad[_0x0c9b('0x11')](0x1f4,_0x9629be[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x22')]=function(_0x265fae){var _0x414fda=this;return new Promise(function(_0xe8e702,_0x535ab7){return db[_0x0c9b('0x23')]['update'](_0x265fae[_0x0c9b('0x20')],{'raw':_0x265fae[_0x0c9b('0x16')]?_0x265fae[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x265fae[_0x0c9b('0x16')]?_0x265fae['options'][_0x0c9b('0x18')]||null:null,'attributes':_0x265fae['options']?_0x265fae['options'][_0x0c9b('0x19')]||null:null,'limit':_0x265fae['options']?_0x265fae[_0x0c9b('0x16')][_0x0c9b('0x24')]||null:null})[_0x0c9b('0x21')](function(_0x3df8b5){logger[_0x0c9b('0xc')](_0x0c9b('0x22'),_0x265fae);logger[_0x0c9b('0xf')](_0x0c9b('0x22'),_0x265fae,JSON[_0x0c9b('0x25')](_0x3df8b5));_0xe8e702(_0x3df8b5);})[_0x0c9b('0x1d')](function(_0x2514f6){logger[_0x0c9b('0x11')]('UpdateMemberReport',_0x2514f6[_0x0c9b('0x12')],_0x265fae);_0x535ab7(_0x414fda[_0x0c9b('0x11')](0x1f4,_0x2514f6[_0x0c9b('0x12')]));});});}; \ No newline at end of file +var _0xa1f6=['create','body','raw','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','limit','include','map','model','attributes'];(function(_0x376202,_0x5623ce){var _0x33ea11=function(_0x194ec5){while(--_0x194ec5){_0x376202['push'](_0x376202['shift']());}};_0x33ea11(++_0x5623ce);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x29f80e,_0x9027ff){_0x29f80e=_0x29f80e-0x0;var _0x5c7eaa=_0xa1f6[_0x29f80e];return _0x5c7eaa;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));var BPromise=require(_0x6a1f('0x3'));var rs=require(_0x6a1f('0x4'));var fs=require('fs');var Redis=require(_0x6a1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6a1f('0x6'));var client=jayson[_0x6a1f('0x7')][_0x6a1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a772b,_0x328033,_0x3ecd63){return new BPromise(function(_0x36c00b,_0x56bf63){return client[_0x6a1f('0x9')](_0x3a772b,_0x3ecd63)[_0x6a1f('0xa')](function(_0x2300b1){logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x328033,'request\x20sent');logger[_0x6a1f('0xd')](_0x6a1f('0xe'),_0x328033,_0x6a1f('0xf'),JSON[_0x6a1f('0x10')](_0x2300b1));if(_0x2300b1['error']){if(_0x2300b1[_0x6a1f('0x11')]['code']===0x1f4){logger[_0x6a1f('0x11')](_0x6a1f('0xc'),_0x328033,_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);return _0x56bf63(_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);}logger[_0x6a1f('0x11')](_0x6a1f('0xc'),_0x328033,_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);return _0x36c00b(_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);}else{logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x328033,_0x6a1f('0xf'));_0x36c00b(_0x2300b1[_0x6a1f('0x13')][_0x6a1f('0x12')]);}})[_0x6a1f('0x14')](function(_0x2c44a0){logger['error'](_0x6a1f('0xc'),_0x328033,_0x2c44a0);_0x56bf63(_0x2c44a0);});});}exports[_0x6a1f('0x15')]=function(_0x1ccbed){var _0x9ff231=this;return new Promise(function(_0x21d268,_0x42b4c7){return db[_0x6a1f('0x16')][_0x6a1f('0x17')]({'raw':_0x1ccbed['options']?_0x1ccbed[_0x6a1f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1ccbed[_0x6a1f('0x18')]?_0x1ccbed[_0x6a1f('0x18')][_0x6a1f('0x19')]||null:null,'attributes':_0x1ccbed[_0x6a1f('0x18')]?_0x1ccbed[_0x6a1f('0x18')]['attributes']||null:null,'limit':_0x1ccbed[_0x6a1f('0x18')]?_0x1ccbed[_0x6a1f('0x18')][_0x6a1f('0x1a')]||null:null,'include':_0x1ccbed[_0x6a1f('0x18')]?_0x1ccbed[_0x6a1f('0x18')][_0x6a1f('0x1b')]?_[_0x6a1f('0x1c')](_0x1ccbed[_0x6a1f('0x18')]['include'],function(_0x1eb146){return{'model':db[_0x1eb146[_0x6a1f('0x1d')]],'as':_0x1eb146['as'],'attributes':_0x1eb146['attributes'],'include':_0x1eb146['include']?_['map'](_0x1eb146['include'],function(_0x3ea158){return{'model':db[_0x3ea158['model']],'as':_0x3ea158['as'],'attributes':_0x3ea158['attributes'],'include':_0x3ea158[_0x6a1f('0x1b')]?_[_0x6a1f('0x1c')](_0x3ea158[_0x6a1f('0x1b')],function(_0x1e8db8){return{'model':db[_0x1e8db8[_0x6a1f('0x1d')]],'as':_0x1e8db8['as'],'attributes':_0x1e8db8[_0x6a1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6a1f('0xa')](function(_0x8f4b10){logger['info'](_0x6a1f('0x15'),_0x1ccbed);logger[_0x6a1f('0xd')](_0x6a1f('0x15'),_0x1ccbed,JSON['stringify'](_0x8f4b10));_0x21d268(_0x8f4b10);})[_0x6a1f('0x14')](function(_0x155c58){logger[_0x6a1f('0x11')](_0x6a1f('0x15'),_0x155c58[_0x6a1f('0x12')],_0x1ccbed);_0x42b4c7(_0x9ff231[_0x6a1f('0x11')](0x1f4,_0x155c58[_0x6a1f('0x12')]));});});};exports['CreateMemberReport']=function(_0x5903cf){var _0x3aa41a=this;return new Promise(function(_0x40ef37,_0x43a3ba){return db[_0x6a1f('0x16')][_0x6a1f('0x1f')](_0x5903cf[_0x6a1f('0x20')],{'raw':_0x5903cf[_0x6a1f('0x18')]?_0x5903cf['options'][_0x6a1f('0x21')]===undefined?!![]:![]:!![]})[_0x6a1f('0xa')](function(_0x5362b3){logger[_0x6a1f('0xb')](_0x6a1f('0x22'),_0x5903cf);logger[_0x6a1f('0xd')]('CreateMemberReport',_0x5903cf,JSON['stringify'](_0x5362b3));_0x40ef37(_0x5362b3);})[_0x6a1f('0x14')](function(_0x38df36){logger[_0x6a1f('0x11')]('CreateMemberReport',_0x38df36['message'],_0x5903cf);_0x43a3ba(_0x3aa41a[_0x6a1f('0x11')](0x1f4,_0x38df36[_0x6a1f('0x12')]));});});};exports[_0x6a1f('0x23')]=function(_0x158f96){var _0x32e7f9=this;return new Promise(function(_0xce3845,_0x1ac8cf){return db['MemberReport'][_0x6a1f('0x24')](_0x158f96['body'],{'raw':_0x158f96[_0x6a1f('0x18')]?_0x158f96[_0x6a1f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x158f96[_0x6a1f('0x18')]?_0x158f96[_0x6a1f('0x18')]['where']||null:null,'attributes':_0x158f96[_0x6a1f('0x18')]?_0x158f96['options'][_0x6a1f('0x1e')]||null:null,'limit':_0x158f96['options']?_0x158f96[_0x6a1f('0x18')]['limit']||null:null})[_0x6a1f('0xa')](function(_0x716d65){logger['info'](_0x6a1f('0x23'),_0x158f96);logger[_0x6a1f('0xd')]('UpdateMemberReport',_0x158f96,JSON['stringify'](_0x716d65));_0xce3845(_0x716d65);})[_0x6a1f('0x14')](function(_0x4019e9){logger[_0x6a1f('0x11')](_0x6a1f('0x23'),_0x4019e9[_0x6a1f('0x12')],_0x158f96);_0x1ac8cf(_0x32e7f9[_0x6a1f('0x11')](0x1f4,_0x4019e9['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index a1cc8b9..99368cd 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 _0xa82a=['../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x431f4b,_0x25b4a4){var _0x18c3ea=function(_0x142934){while(--_0x142934){_0x431f4b['push'](_0x431f4b['shift']());}};_0x18c3ea(++_0x25b4a4);}(_0xa82a,0x1e7));var _0xaa82=function(_0x3c7188,_0x2314ee){_0x3c7188=_0x3c7188-0x0;var _0x5e4b59=_0xa82a[_0x3c7188];return _0x5e4b59;};'use strict';var multer=require(_0xaa82('0x0'));var util=require(_0xaa82('0x1'));var path=require(_0xaa82('0x2'));var timeout=require(_0xaa82('0x3'));var express=require(_0xaa82('0x4'));var router=express[_0xaa82('0x5')]();var fs_extra=require(_0xaa82('0x6'));var auth=require(_0xaa82('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaa82('0x8'));var controller=require(_0xaa82('0x9'));router[_0xaa82('0xa')]('/',controller[_0xaa82('0xb')]);module[_0xaa82('0xc')]=router; \ No newline at end of file +var _0xde0f=['Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','path','connect-timeout','express'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0xde0f,0xa2));var _0xfde0=function(_0x831c03,_0x5e6334){_0x831c03=_0x831c03-0x0;var _0x5afe46=_0xde0f[_0x831c03];return _0x5afe46;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfde0('0x0'));var timeout=require(_0xfde0('0x1'));var express=require(_0xfde0('0x2'));var router=express[_0xfde0('0x3')]();var fs_extra=require(_0xfde0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfde0('0x5'));var config=require(_0xfde0('0x6'));var controller=require(_0xfde0('0x7'));router[_0xfde0('0x8')]('/',controller[_0xfde0('0x9')]);module[_0xfde0('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 80b0629..5f6a9d9 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 _0xf674=['STRING','version','sequelize','exports'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xf674,0x92));var _0x4f67=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xf674[_0x40be86];return _0xda3c3b;};'use strict';var Sequelize=require(_0x4f67('0x0'));module[_0x4f67('0x1')]={'version':{'type':Sequelize[_0x4f67('0x2')],'unique':_0x4f67('0x3')}}; \ No newline at end of file +var _0xe038=['sequelize','exports','STRING','version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe038,0x148));var _0x8e03=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe038[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x8e03('0x0'));module[_0x8e03('0x1')]={'version':{'type':Sequelize[_0x8e03('0x2')],'unique':_0x8e03('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9db1898..2a5b666 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 _0xd9ef=['../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3eae67,_0x271e4f){var _0x1b9e99=function(_0x585992){while(--_0x585992){_0x3eae67['push'](_0x3eae67['shift']());}};_0x1b9e99(++_0x271e4f);}(_0xd9ef,0xfa));var _0xfd9e=function(_0x4b4b49,_0x129215){_0x4b4b49=_0x4b4b49-0x0;var _0x15d198=_0xd9ef[_0x4b4b49];return _0x15d198;};'use strict';var emlformat=require(_0xfd9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd9e('0x1'));var jsonpatch=require(_0xfd9e('0x2'));var rp=require(_0xfd9e('0x3'));var moment=require(_0xfd9e('0x4'));var BPromise=require(_0xfd9e('0x5'));var Mustache=require(_0xfd9e('0x6'));var util=require(_0xfd9e('0x7'));var path=require(_0xfd9e('0x8'));var sox=require(_0xfd9e('0x9'));var csv=require('to-csv');var ejs=require(_0xfd9e('0xa'));var fs=require('fs');var fs_extra=require(_0xfd9e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfd9e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfd9e('0xd'));var querystring=require(_0xfd9e('0xe'));var Papa=require(_0xfd9e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfd9e('0x10'));var as=require(_0xfd9e('0x11'));var hardwareService=require(_0xfd9e('0x12'));var logger=require(_0xfd9e('0x13'))(_0xfd9e('0x14'));var utils=require(_0xfd9e('0x15'));var config=require(_0xfd9e('0x16'));var licenseUtil=require(_0xfd9e('0x17'));var db=require(_0xfd9e('0x18'))['db'];function respondWithStatusCode(_0x5b8856,_0x4bbee0){_0x4bbee0=_0x4bbee0||0xcc;return function(_0x1eddf5){if(_0x1eddf5){return _0x5b8856['sendStatus'](_0x4bbee0);}return _0x5b8856[_0xfd9e('0x19')](_0x4bbee0)[_0xfd9e('0x1a')]();};}function respondWithResult(_0x581918,_0x5822ea){_0x5822ea=_0x5822ea||0xc8;return function(_0x2e8653){if(_0x2e8653){return _0x581918[_0xfd9e('0x19')](_0x5822ea)['json'](_0x2e8653);}};}function respondWithFilteredResult(_0x3fdcae,_0x52ec3b){return function(_0x435f40){if(_0x435f40){var _0x4240cb=typeof _0x52ec3b[_0xfd9e('0x1b')]==='undefined'&&typeof _0x52ec3b['limit']===_0xfd9e('0x1c');var _0x5a0d84=_0x435f40[_0xfd9e('0x1d')];var _0x4ff4e1=_0x4240cb?0x0:_0x52ec3b[_0xfd9e('0x1b')];var _0x56d836=_0x4240cb?_0x435f40['count']:_0x52ec3b[_0xfd9e('0x1b')]+_0x52ec3b[_0xfd9e('0x1e')];var _0x34ecf2;if(_0x56d836>=_0x5a0d84){_0x56d836=_0x5a0d84;_0x34ecf2=0xc8;}else{_0x34ecf2=0xce;}_0x3fdcae[_0xfd9e('0x19')](_0x34ecf2);return _0x3fdcae['set'](_0xfd9e('0x1f'),_0x4ff4e1+'-'+_0x56d836+'/'+_0x5a0d84)[_0xfd9e('0x20')](_0x435f40);}return null;};}function patchUpdates(_0x2c538c){return function(_0x4e29b2){try{jsonpatch[_0xfd9e('0x21')](_0x4e29b2,_0x2c538c,!![]);}catch(_0x35e921){return BPromise[_0xfd9e('0x22')](_0x35e921);}return _0x4e29b2[_0xfd9e('0x23')]();};}function saveUpdates(_0x5f1ced,_0x5c7c71){return function(_0x540d09){if(_0x540d09){return _0x540d09['update'](_0x5f1ced)[_0xfd9e('0x24')](function(_0x47e430){return _0x47e430;});}return null;};}function removeEntity(_0x5cadec,_0x53ef8c){return function(_0x10b4fa){if(_0x10b4fa){return _0x10b4fa[_0xfd9e('0x25')]()[_0xfd9e('0x24')](function(){_0x5cadec[_0xfd9e('0x19')](0xcc)[_0xfd9e('0x1a')]();});}};}function handleEntityNotFound(_0x136706,_0x1268e3){return function(_0x161944){if(!_0x161944){_0x136706['sendStatus'](0x194);}return _0x161944;};}function handleError(_0x4ee61b,_0x383449){_0x383449=_0x383449||0x1f4;return function(_0x315cb2){logger[_0xfd9e('0x26')](_0x315cb2[_0xfd9e('0x27')]);if(_0x315cb2[_0xfd9e('0x28')]){delete _0x315cb2['name'];}_0x4ee61b[_0xfd9e('0x19')](_0x383449)[_0xfd9e('0x29')](_0x315cb2);};}exports[_0xfd9e('0x2a')]=function(_0x570c53,_0x1ce43c){var _0x5d6a3f={},_0x456486={},_0x3e5fd6={'count':0x0,'rows':[]};var _0x7d8bcb=_[_0xfd9e('0x2b')](db[_0xfd9e('0x2c')][_0xfd9e('0x2d')],function(_0x1084d1){return{'name':_0x1084d1[_0xfd9e('0x2e')],'type':_0x1084d1[_0xfd9e('0x2f')]['key']};});_0x456486['model']=_[_0xfd9e('0x2b')](_0x7d8bcb,'name');_0x456486[_0xfd9e('0x30')]=_[_0xfd9e('0x31')](_0x570c53[_0xfd9e('0x30')]);_0x456486['filters']=_[_0xfd9e('0x32')](_0x456486['model'],_0x456486[_0xfd9e('0x30')]);_0x5d6a3f[_0xfd9e('0x33')]=_[_0xfd9e('0x32')](_0x456486['model'],qs[_0xfd9e('0x34')](_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x34')]));_0x5d6a3f[_0xfd9e('0x33')]=_0x5d6a3f[_0xfd9e('0x33')][_0xfd9e('0x35')]?_0x5d6a3f[_0xfd9e('0x33')]:_0x456486[_0xfd9e('0x36')];if(!_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x37')](_0xfd9e('0x38'))){_0x5d6a3f[_0xfd9e('0x1e')]=qs[_0xfd9e('0x1e')](_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x1e')]);_0x5d6a3f['offset']=qs[_0xfd9e('0x1b')](_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x1b')]);}_0x5d6a3f['order']=qs[_0xfd9e('0x39')](_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x39')]);_0x5d6a3f['where']=qs[_0xfd9e('0x3a')](_[_0xfd9e('0x3b')](_0x570c53['query'],_0x456486[_0xfd9e('0x3a')]),_0x7d8bcb);if(_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x3c')]){_0x5d6a3f['where']=_['merge'](_0x5d6a3f[_0xfd9e('0x3d')],{'$or':_[_0xfd9e('0x2b')](_0x7d8bcb,function(_0x3258e6){if(_0x3258e6[_0xfd9e('0x2f')]!==_0xfd9e('0x3e')){var _0xd099d6={};_0xd099d6[_0x3258e6[_0xfd9e('0x28')]]={'$like':'%'+_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x3c')]+'%'};return _0xd099d6;}})});}_0x5d6a3f=_['merge']({},_0x5d6a3f,_0x570c53[_0xfd9e('0x3f')]);var _0x179ed0={'where':_0x5d6a3f['where']};return db[_0xfd9e('0x2c')][_0xfd9e('0x1d')](_0x179ed0)['then'](function(_0x162d8f){_0x3e5fd6['count']=_0x162d8f;if(_0x570c53[_0xfd9e('0x30')][_0xfd9e('0x40')]){_0x5d6a3f[_0xfd9e('0x41')]=[{'all':!![]}];}return db[_0xfd9e('0x2c')][_0xfd9e('0x42')](_0x5d6a3f);})[_0xfd9e('0x24')](function(_0x20187c){_0x3e5fd6['rows']=_0x20187c;return _0x3e5fd6;})[_0xfd9e('0x24')](respondWithFilteredResult(_0x1ce43c,_0x5d6a3f))[_0xfd9e('0x43')](handleError(_0x1ce43c,null));}; \ No newline at end of file +var _0xe79a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','json','apply','save','then','destroy','end','error','stack','name','send','map','Migration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','includeAll','include','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe79a,0x134));var _0xae79=function(_0x4a519e,_0x5be3c4){_0x4a519e=_0x4a519e-0x0;var _0x1c7154=_0xe79a[_0x4a519e];return _0x1c7154;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae79('0x1'));var rp=require(_0xae79('0x2'));var moment=require(_0xae79('0x3'));var BPromise=require(_0xae79('0x4'));var Mustache=require(_0xae79('0x5'));var util=require(_0xae79('0x6'));var path=require('path');var sox=require(_0xae79('0x7'));var csv=require(_0xae79('0x8'));var ejs=require(_0xae79('0x9'));var fs=require('fs');var fs_extra=require(_0xae79('0xa'));var _=require(_0xae79('0xb'));var squel=require(_0xae79('0xc'));var crypto=require('crypto');var jsforce=require(_0xae79('0xd'));var deskjs=require(_0xae79('0xe'));var toCsv=require('to-csv');var querystring=require(_0xae79('0xf'));var Papa=require(_0xae79('0x10'));var Redis=require(_0xae79('0x11'));var authService=require(_0xae79('0x12'));var qs=require(_0xae79('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae79('0x14'));var logger=require('../../config/logger')(_0xae79('0x15'));var utils=require(_0xae79('0x16'));var config=require(_0xae79('0x17'));var licenseUtil=require(_0xae79('0x18'));var db=require(_0xae79('0x19'))['db'];function respondWithStatusCode(_0x241b22,_0x82741b){_0x82741b=_0x82741b||0xcc;return function(_0x1d5bef){if(_0x1d5bef){return _0x241b22[_0xae79('0x1a')](_0x82741b);}return _0x241b22['status'](_0x82741b)['end']();};}function respondWithResult(_0xd087ce,_0x276b64){_0x276b64=_0x276b64||0xc8;return function(_0x55245f){if(_0x55245f){return _0xd087ce['status'](_0x276b64)['json'](_0x55245f);}};}function respondWithFilteredResult(_0x2a33fa,_0x1be259){return function(_0x436190){if(_0x436190){var _0x3adb50=typeof _0x1be259[_0xae79('0x1b')]===_0xae79('0x1c')&&typeof _0x1be259[_0xae79('0x1d')]===_0xae79('0x1c');var _0x527d5b=_0x436190[_0xae79('0x1e')];var _0x141769=_0x3adb50?0x0:_0x1be259[_0xae79('0x1b')];var _0x567ef7=_0x3adb50?_0x436190[_0xae79('0x1e')]:_0x1be259[_0xae79('0x1b')]+_0x1be259[_0xae79('0x1d')];var _0x482062;if(_0x567ef7>=_0x527d5b){_0x567ef7=_0x527d5b;_0x482062=0xc8;}else{_0x482062=0xce;}_0x2a33fa[_0xae79('0x1f')](_0x482062);return _0x2a33fa['set']('Content-Range',_0x141769+'-'+_0x567ef7+'/'+_0x527d5b)[_0xae79('0x20')](_0x436190);}return null;};}function patchUpdates(_0x4c0273){return function(_0x4765bc){try{jsonpatch[_0xae79('0x21')](_0x4765bc,_0x4c0273,!![]);}catch(_0x4641bf){return BPromise['reject'](_0x4641bf);}return _0x4765bc[_0xae79('0x22')]();};}function saveUpdates(_0x3f36aa,_0x4279c3){return function(_0x5080a1){if(_0x5080a1){return _0x5080a1['update'](_0x3f36aa)[_0xae79('0x23')](function(_0x41eeff){return _0x41eeff;});}return null;};}function removeEntity(_0x35eb26,_0x24bfb8){return function(_0x2680cf){if(_0x2680cf){return _0x2680cf[_0xae79('0x24')]()[_0xae79('0x23')](function(){_0x35eb26[_0xae79('0x1f')](0xcc)[_0xae79('0x25')]();});}};}function handleEntityNotFound(_0x2b849d,_0x30bc6c){return function(_0x5342ba){if(!_0x5342ba){_0x2b849d['sendStatus'](0x194);}return _0x5342ba;};}function handleError(_0x272a3e,_0x565e5d){_0x565e5d=_0x565e5d||0x1f4;return function(_0x3c0dc8){logger[_0xae79('0x26')](_0x3c0dc8[_0xae79('0x27')]);if(_0x3c0dc8[_0xae79('0x28')]){delete _0x3c0dc8[_0xae79('0x28')];}_0x272a3e['status'](_0x565e5d)[_0xae79('0x29')](_0x3c0dc8);};}exports['index']=function(_0x1a05cf,_0x1c80a7){var _0x5c671e={},_0x4c8e5c={},_0x53244a={'count':0x0,'rows':[]};var _0x17c24d=_[_0xae79('0x2a')](db[_0xae79('0x2b')][_0xae79('0x2c')],function(_0x5cff1b){return{'name':_0x5cff1b[_0xae79('0x2d')],'type':_0x5cff1b['type'][_0xae79('0x2e')]};});_0x4c8e5c[_0xae79('0x2f')]=_[_0xae79('0x2a')](_0x17c24d,_0xae79('0x28'));_0x4c8e5c['query']=_[_0xae79('0x30')](_0x1a05cf[_0xae79('0x31')]);_0x4c8e5c[_0xae79('0x32')]=_[_0xae79('0x33')](_0x4c8e5c[_0xae79('0x2f')],_0x4c8e5c[_0xae79('0x31')]);_0x5c671e[_0xae79('0x34')]=_[_0xae79('0x33')](_0x4c8e5c['model'],qs['fields'](_0x1a05cf[_0xae79('0x31')][_0xae79('0x35')]));_0x5c671e[_0xae79('0x34')]=_0x5c671e['attributes']['length']?_0x5c671e[_0xae79('0x34')]:_0x4c8e5c[_0xae79('0x2f')];if(!_0x1a05cf[_0xae79('0x31')]['hasOwnProperty'](_0xae79('0x36'))){_0x5c671e[_0xae79('0x1d')]=qs[_0xae79('0x1d')](_0x1a05cf['query'][_0xae79('0x1d')]);_0x5c671e[_0xae79('0x1b')]=qs['offset'](_0x1a05cf['query'][_0xae79('0x1b')]);}_0x5c671e[_0xae79('0x37')]=qs[_0xae79('0x38')](_0x1a05cf[_0xae79('0x31')][_0xae79('0x38')]);_0x5c671e['where']=qs[_0xae79('0x32')](_[_0xae79('0x39')](_0x1a05cf[_0xae79('0x31')],_0x4c8e5c[_0xae79('0x32')]),_0x17c24d);if(_0x1a05cf[_0xae79('0x31')]['filter']){_0x5c671e['where']=_[_0xae79('0x3a')](_0x5c671e[_0xae79('0x3b')],{'$or':_[_0xae79('0x2a')](_0x17c24d,function(_0x61654d){if(_0x61654d[_0xae79('0x3c')]!==_0xae79('0x3d')){var _0x244c1e={};_0x244c1e[_0x61654d[_0xae79('0x28')]]={'$like':'%'+_0x1a05cf['query'][_0xae79('0x3e')]+'%'};return _0x244c1e;}})});}_0x5c671e=_[_0xae79('0x3a')]({},_0x5c671e,_0x1a05cf['options']);var _0x51773b={'where':_0x5c671e['where']};return db[_0xae79('0x2b')][_0xae79('0x1e')](_0x51773b)[_0xae79('0x23')](function(_0xc10617){_0x53244a[_0xae79('0x1e')]=_0xc10617;if(_0x1a05cf[_0xae79('0x31')][_0xae79('0x3f')]){_0x5c671e[_0xae79('0x40')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x5c671e);})[_0xae79('0x23')](function(_0x23c86d){_0x53244a['rows']=_0x23c86d;return _0x53244a;})['then'](respondWithFilteredResult(_0x1c80a7,_0x5c671e))[_0xae79('0x41')](handleError(_0x1c80a7,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 33077b9..204ca52 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 _0x70ad=['rimraf','./migration.attributes','exports','define','migrations','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3f1688,_0x1fcd7b){var _0x2f9808=function(_0x529d4f){while(--_0x529d4f){_0x3f1688['push'](_0x3f1688['shift']());}};_0x2f9808(++_0x1fcd7b);}(_0x70ad,0x1f4));var _0xd70a=function(_0x207267,_0x50618f){_0x207267=_0x207267-0x0;var _0x4c7d02=_0x70ad[_0x207267];return _0x4c7d02;};'use strict';var _=require('lodash');var util=require(_0xd70a('0x0'));var logger=require(_0xd70a('0x1'))(_0xd70a('0x2'));var moment=require('moment');var BPromise=require(_0xd70a('0x3'));var rp=require(_0xd70a('0x4'));var fs=require('fs');var path=require(_0xd70a('0x5'));var rimraf=require(_0xd70a('0x6'));var config=require('../../config/environment');var attributes=require(_0xd70a('0x7'));module[_0xd70a('0x8')]=function(_0x20865d,_0xe98a5e){return _0x20865d[_0xd70a('0x9')]('Migration',attributes,{'tableName':_0xd70a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f6=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./migration.attributes','exports','define','Migration','migrations'];(function(_0x421793,_0x436578){var _0x2b230b=function(_0x25a44b){while(--_0x25a44b){_0x421793['push'](_0x421793['shift']());}};_0x2b230b(++_0x436578);}(_0x54f6,0x1c7));var _0x654f=function(_0x59357c,_0x22ec86){_0x59357c=_0x59357c-0x0;var _0x2d54c9=_0x54f6[_0x59357c];return _0x2d54c9;};'use strict';var _=require(_0x654f('0x0'));var util=require(_0x654f('0x1'));var logger=require(_0x654f('0x2'))(_0x654f('0x3'));var moment=require(_0x654f('0x4'));var BPromise=require(_0x654f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x654f('0x6'));var rimraf=require(_0x654f('0x7'));var config=require('../../config/environment');var attributes=require(_0x654f('0x8'));module[_0x654f('0x9')]=function(_0x398961,_0x5e00ac){return _0x398961[_0x654f('0xa')](_0x654f('0xb'),attributes,{'tableName':_0x654f('0xc'),'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 bdf171e..f0da64c 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 _0xe829=['request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x3ac946,_0x52a63a){var _0x10826c=function(_0x3c33ea){while(--_0x3c33ea){_0x3ac946['push'](_0x3ac946['shift']());}};_0x10826c(++_0x52a63a);}(_0xe829,0x1d8));var _0x9e82=function(_0x28f922,_0x1302f8){_0x28f922=_0x28f922-0x0;var _0x4eceac=_0xe829[_0x28f922];return _0x4eceac;};'use strict';var _=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var moment=require(_0x9e82('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e82('0x3'));var db=require(_0x9e82('0x4'))['db'];var utils=require(_0x9e82('0x5'));var logger=require(_0x9e82('0x6'))(_0x9e82('0x7'));var config=require(_0x9e82('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e82('0x9')][_0x9e82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a63b3,_0x7cebd4,_0x2d91ba){return new BPromise(function(_0x5c4c57,_0x149f39){return client['request'](_0x1a63b3,_0x2d91ba)[_0x9e82('0xb')](function(_0x13070b){logger['info']('Migration,\x20%s,\x20%s',_0x7cebd4,_0x9e82('0xc'));logger[_0x9e82('0xd')](_0x9e82('0xe'),_0x7cebd4,_0x9e82('0xc'),JSON[_0x9e82('0xf')](_0x13070b));if(_0x13070b[_0x9e82('0x10')]){if(_0x13070b[_0x9e82('0x10')][_0x9e82('0x11')]===0x1f4){logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x149f39(_0x13070b['error']['message']);}logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x5c4c57(_0x13070b['error'][_0x9e82('0x13')]);}else{logger[_0x9e82('0x14')](_0x9e82('0x12'),_0x7cebd4,_0x9e82('0xc'));_0x5c4c57(_0x13070b['result'][_0x9e82('0x13')]);}})[_0x9e82('0x15')](function(_0x3f70a3){logger[_0x9e82('0x10')]('Migration,\x20%s,\x20%s',_0x7cebd4,_0x3f70a3);_0x149f39(_0x3f70a3);});});} \ No newline at end of file +var _0x0db9=['code','message','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x534a7c,_0x50cdbe){var _0x3210dd=function(_0x35ee1d){while(--_0x35ee1d){_0x534a7c['push'](_0x534a7c['shift']());}};_0x3210dd(++_0x50cdbe);}(_0x0db9,0xa3));var _0x90db=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0db9[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90db('0x1'));var fs=require('fs');var Redis=require(_0x90db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90db('0x3'));var logger=require('../../config/logger')(_0x90db('0x4'));var config=require(_0x90db('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90db('0x6')][_0x90db('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476491,_0xee21f8,_0x915ca){return new BPromise(function(_0x9b6d0d,_0x4b0c1d){return client[_0x90db('0x8')](_0x476491,_0x915ca)[_0x90db('0x9')](function(_0x39512e){logger[_0x90db('0xa')](_0x90db('0xb'),_0xee21f8,_0x90db('0xc'));logger[_0x90db('0xd')](_0x90db('0xe'),_0xee21f8,_0x90db('0xc'),JSON[_0x90db('0xf')](_0x39512e));if(_0x39512e[_0x90db('0x10')]){if(_0x39512e['error'][_0x90db('0x11')]===0x1f4){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x4b0c1d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x9b6d0d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}else{logger[_0x90db('0xa')]('Migration,\x20%s,\x20%s',_0xee21f8,_0x90db('0xc'));_0x9b6d0d(_0x39512e['result'][_0x90db('0x12')]);}})[_0x90db('0x13')](function(_0x3de860){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x3de860);_0x4b0c1d(_0x3de860);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b08100e..dbd5889 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 _0x5eca=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5eca,0x10e));var _0xa5ec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5eca[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa5ec('0x0'));var util=require(_0xa5ec('0x1'));var path=require(_0xa5ec('0x2'));var timeout=require(_0xa5ec('0x3'));var express=require(_0xa5ec('0x4'));var router=express['Router']();var fs_extra=require(_0xa5ec('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5ec('0x6'));var controller=require(_0xa5ec('0x7'));router[_0xa5ec('0x8')]('/',auth[_0xa5ec('0x9')](),controller[_0xa5ec('0xa')]);router[_0xa5ec('0x8')](_0xa5ec('0xb'),auth['isAuthenticated'](),controller[_0xa5ec('0xc')]);router[_0xa5ec('0xd')]('/',auth['isAuthenticated'](),controller[_0xa5ec('0xe')]);router['put'](_0xa5ec('0xb'),auth[_0xa5ec('0x9')](),controller[_0xa5ec('0xf')]);router['delete'](_0xa5ec('0xb'),auth[_0xa5ec('0x9')](),controller[_0xa5ec('0x10')]);module[_0xa5ec('0x11')]=router; \ No newline at end of file +var _0x75b6=['../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2ba6cb,_0x223fe4){var _0xeb99f4=function(_0x231182){while(--_0x231182){_0x2ba6cb['push'](_0x2ba6cb['shift']());}};_0xeb99f4(++_0x223fe4);}(_0x75b6,0x1a4));var _0x675b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75b6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x675b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x675b('0x1'));var express=require(_0x675b('0x2'));var router=express[_0x675b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x675b('0x4'));var interaction=require(_0x675b('0x5'));var config=require(_0x675b('0x6'));var controller=require('./network.controller');router[_0x675b('0x7')]('/',auth['isAuthenticated'](),controller[_0x675b('0x8')]);router[_0x675b('0x7')](_0x675b('0x9'),auth['isAuthenticated'](),controller[_0x675b('0xa')]);router['post']('/',auth[_0x675b('0xb')](),controller[_0x675b('0xc')]);router[_0x675b('0xd')](_0x675b('0x9'),auth[_0x675b('0xb')](),controller[_0x675b('0xe')]);router[_0x675b('0xf')](_0x675b('0x9'),auth[_0x675b('0xb')](),controller[_0x675b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 98d484a..492fcfa 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 _0x57b9=['stun','STRING','exports','localnet'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x57b9,0x1ba));var _0x957b=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x57b9[_0xb24a3e];return _0x4038d7;};'use strict';var Sequelize=require('sequelize');module[_0x957b('0x0')]={'type':{'type':Sequelize['ENUM'](_0x957b('0x1'),'externip',_0x957b('0x2'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x957b('0x3')]},'password':{'type':Sequelize[_0x957b('0x3')]}}; \ No newline at end of file +var _0x48a1=['localnet','externip','STRING','sequelize','exports','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x48a1,0x189));var _0x148a=function(_0x496b59,_0x54283d){_0x496b59=_0x496b59-0x0;var _0x23b37f=_0x48a1[_0x496b59];return _0x23b37f;};'use strict';var Sequelize=require(_0x148a('0x0'));module[_0x148a('0x1')]={'type':{'type':Sequelize[_0x148a('0x2')](_0x148a('0x3'),_0x148a('0x4'),'stun','turn')},'value':{'type':Sequelize[_0x148a('0x5')]},'username':{'type':Sequelize[_0x148a('0x5')]},'password':{'type':Sequelize[_0x148a('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 7f4008f..e009930 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 _0x1d08=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','params','keys','find','create','transaction','body','toUpperCase','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','STUN','server/files/templates/turn_multiple.ejs','rimraf','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','Network,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName'];(function(_0x260e6e,_0x21bfaf){var _0x102766=function(_0x36bf62){while(--_0x36bf62){_0x260e6e['push'](_0x260e6e['shift']());}};_0x102766(++_0x21bfaf);}(_0x1d08,0x103));var _0x81d0=function(_0x548f2a,_0x25622b){_0x548f2a=_0x548f2a-0x0;var _0x55af13=_0x1d08[_0x548f2a];return _0x55af13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81d0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x81d0('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x81d0('0x2'));var util=require(_0x81d0('0x3'));var path=require(_0x81d0('0x4'));var sox=require(_0x81d0('0x5'));var csv=require('to-csv');var ejs=require(_0x81d0('0x6'));var fs=require('fs');var fs_extra=require(_0x81d0('0x7'));var _=require(_0x81d0('0x8'));var squel=require(_0x81d0('0x9'));var crypto=require(_0x81d0('0xa'));var jsforce=require(_0x81d0('0xb'));var deskjs=require(_0x81d0('0xc'));var toCsv=require(_0x81d0('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x81d0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x81d0('0xf'));var as=require(_0x81d0('0x10'));var hardwareService=require(_0x81d0('0x11'));var logger=require(_0x81d0('0x12'))(_0x81d0('0x13'));var utils=require(_0x81d0('0x14'));var config=require(_0x81d0('0x15'));var licenseUtil=require(_0x81d0('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x81d0('0x17'));var client=jayson['client'][_0x81d0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x55c0e2,_0x43cbe1,_0x2cb782,_0x4530f0){return new BPromise(function(_0x37f6b0,_0x4582b6){var _0x29195f=_0x4530f0||client;return _0x29195f[_0x81d0('0x19')](_0x55c0e2,_0x2cb782)[_0x81d0('0x1a')](function(_0x5a0d06){logger[_0x81d0('0x1b')]('Network,\x20%s,\x20%s',_0x43cbe1,_0x81d0('0x1c'));logger[_0x81d0('0x1d')](_0x81d0('0x1e'),_0x43cbe1,_0x81d0('0x1c'),JSON['stringify'](_0x5a0d06));if(_0x5a0d06[_0x81d0('0x1f')]){if(_0x5a0d06[_0x81d0('0x1f')]['code']===0x1f4){logger[_0x81d0('0x1f')](_0x81d0('0x20'),_0x43cbe1,_0x5a0d06['error']['message']);return _0x4582b6(_0x5a0d06[_0x81d0('0x1f')][_0x81d0('0x21')]);}logger['error'](_0x81d0('0x20'),_0x43cbe1,_0x5a0d06[_0x81d0('0x1f')][_0x81d0('0x21')]);return _0x37f6b0(_0x5a0d06[_0x81d0('0x1f')][_0x81d0('0x21')]);}else{logger[_0x81d0('0x1b')](_0x81d0('0x20'),_0x43cbe1,'request\x20sent');_0x37f6b0(_0x5a0d06[_0x81d0('0x22')][_0x81d0('0x21')]);}})['catch'](function(_0x20c5bf){logger[_0x81d0('0x1f')](_0x81d0('0x20'),_0x43cbe1,_0x20c5bf);_0x4582b6(_0x20c5bf);});});}function respondWithStatusCode(_0x4c8d80,_0x3c919b){_0x3c919b=_0x3c919b||0xcc;return function(_0x43c90c){if(_0x43c90c){return _0x4c8d80['sendStatus'](_0x3c919b);}return _0x4c8d80[_0x81d0('0x23')](_0x3c919b)[_0x81d0('0x24')]();};}function respondWithResult(_0xaec465,_0x41ae38){_0x41ae38=_0x41ae38||0xc8;return function(_0x40c78a){if(_0x40c78a){return _0xaec465[_0x81d0('0x23')](_0x41ae38)[_0x81d0('0x25')](_0x40c78a);}};}function respondWithFilteredResult(_0x593e20,_0x3d9bd5){return function(_0x183f98){if(_0x183f98){var _0x2ca455=typeof _0x3d9bd5[_0x81d0('0x26')]===_0x81d0('0x27')&&typeof _0x3d9bd5[_0x81d0('0x28')]===_0x81d0('0x27');var _0x221108=_0x183f98[_0x81d0('0x29')];var _0x3129e7=_0x2ca455?0x0:_0x3d9bd5['offset'];var _0x57a3f2=_0x2ca455?_0x183f98[_0x81d0('0x29')]:_0x3d9bd5[_0x81d0('0x26')]+_0x3d9bd5['limit'];var _0x531844;if(_0x57a3f2>=_0x221108){_0x57a3f2=_0x221108;_0x531844=0xc8;}else{_0x531844=0xce;}_0x593e20[_0x81d0('0x23')](_0x531844);return _0x593e20[_0x81d0('0x2a')](_0x81d0('0x2b'),_0x3129e7+'-'+_0x57a3f2+'/'+_0x221108)['json'](_0x183f98);}return null;};}function patchUpdates(_0x367285){return function(_0x42251d){try{jsonpatch['apply'](_0x42251d,_0x367285,!![]);}catch(_0x5b5962){return BPromise[_0x81d0('0x2c')](_0x5b5962);}return _0x42251d[_0x81d0('0x2d')]();};}function saveUpdates(_0x5a10dc,_0x4f314a){return function(_0x3637c2){if(_0x3637c2){return _0x3637c2[_0x81d0('0x2e')](_0x5a10dc)['then'](function(_0x1c07a7){return _0x1c07a7;});}return null;};}function removeEntity(_0x18f35d,_0x1f8c5d){return function(_0xfc9f28){if(_0xfc9f28){return _0xfc9f28[_0x81d0('0x2f')]()[_0x81d0('0x1a')](function(){_0x18f35d[_0x81d0('0x23')](0xcc)[_0x81d0('0x24')]();});}};}function handleEntityNotFound(_0xbc13d3,_0x46701c){return function(_0x22ab8e){if(!_0x22ab8e){_0xbc13d3['sendStatus'](0x194);}return _0x22ab8e;};}function handleError(_0x56c63e,_0x53a39b){_0x53a39b=_0x53a39b||0x1f4;return function(_0xe762b1){logger['error'](_0xe762b1[_0x81d0('0x30')]);if(_0xe762b1[_0x81d0('0x31')]){delete _0xe762b1[_0x81d0('0x31')];}_0x56c63e['status'](_0x53a39b)[_0x81d0('0x32')](_0xe762b1);};}exports[_0x81d0('0x33')]=function(_0x286a1e,_0x3feead){var _0x21dd6f={},_0x30b206={},_0x3fcf49={'count':0x0,'rows':[]};var _0x349e22=_[_0x81d0('0x34')](db[_0x81d0('0x35')][_0x81d0('0x36')],function(_0x2c7e89){return{'name':_0x2c7e89[_0x81d0('0x37')],'type':_0x2c7e89['type'][_0x81d0('0x38')]};});_0x30b206[_0x81d0('0x39')]=_[_0x81d0('0x34')](_0x349e22,'name');_0x30b206[_0x81d0('0x3a')]=_['keys'](_0x286a1e[_0x81d0('0x3a')]);_0x30b206[_0x81d0('0x3b')]=_[_0x81d0('0x3c')](_0x30b206['model'],_0x30b206[_0x81d0('0x3a')]);_0x21dd6f[_0x81d0('0x3d')]=_[_0x81d0('0x3c')](_0x30b206[_0x81d0('0x39')],qs[_0x81d0('0x3e')](_0x286a1e[_0x81d0('0x3a')][_0x81d0('0x3e')]));_0x21dd6f['attributes']=_0x21dd6f[_0x81d0('0x3d')][_0x81d0('0x3f')]?_0x21dd6f[_0x81d0('0x3d')]:_0x30b206[_0x81d0('0x39')];if(!_0x286a1e['query'][_0x81d0('0x40')](_0x81d0('0x41'))){_0x21dd6f[_0x81d0('0x28')]=qs[_0x81d0('0x28')](_0x286a1e[_0x81d0('0x3a')][_0x81d0('0x28')]);_0x21dd6f['offset']=qs['offset'](_0x286a1e[_0x81d0('0x3a')][_0x81d0('0x26')]);}_0x21dd6f['order']=qs[_0x81d0('0x42')](_0x286a1e[_0x81d0('0x3a')][_0x81d0('0x42')]);_0x21dd6f[_0x81d0('0x43')]=qs[_0x81d0('0x3b')](_[_0x81d0('0x44')](_0x286a1e[_0x81d0('0x3a')],_0x30b206[_0x81d0('0x3b')]),_0x349e22);if(_0x286a1e[_0x81d0('0x3a')]['filter']){_0x21dd6f[_0x81d0('0x43')]=_['merge'](_0x21dd6f[_0x81d0('0x43')],{'$or':_[_0x81d0('0x34')](_0x349e22,function(_0x17dd61){if(_0x17dd61[_0x81d0('0x45')]!==_0x81d0('0x46')){var _0x2f81f4={};_0x2f81f4[_0x17dd61[_0x81d0('0x31')]]={'$like':'%'+_0x286a1e[_0x81d0('0x3a')][_0x81d0('0x47')]+'%'};return _0x2f81f4;}})});}_0x21dd6f=_[_0x81d0('0x48')]({},_0x21dd6f,_0x286a1e[_0x81d0('0x49')]);var _0x2ae64f={'where':_0x21dd6f['where']};return db['Network'][_0x81d0('0x29')](_0x2ae64f)[_0x81d0('0x1a')](function(_0x2bef9e){_0x3fcf49[_0x81d0('0x29')]=_0x2bef9e;if(_0x286a1e[_0x81d0('0x3a')][_0x81d0('0x4a')]){_0x21dd6f['include']=[{'all':!![]}];}return db[_0x81d0('0x35')][_0x81d0('0x4b')](_0x21dd6f);})['then'](function(_0x225225){_0x3fcf49[_0x81d0('0x4c')]=_0x225225;return _0x3fcf49;})[_0x81d0('0x1a')](respondWithFilteredResult(_0x3feead,_0x21dd6f))[_0x81d0('0x4d')](handleError(_0x3feead,null));};exports['show']=function(_0xc9e224,_0x39d2d6){var _0x2b9ae6={'raw':!![],'where':{'id':_0xc9e224[_0x81d0('0x4e')]['id']}},_0x5560cc={};_0x5560cc[_0x81d0('0x39')]=_[_0x81d0('0x4f')](db[_0x81d0('0x35')]['rawAttributes']);_0x5560cc[_0x81d0('0x3a')]=_[_0x81d0('0x4f')](_0xc9e224[_0x81d0('0x3a')]);_0x5560cc[_0x81d0('0x3b')]=_[_0x81d0('0x3c')](_0x5560cc['model'],_0x5560cc['query']);_0x2b9ae6[_0x81d0('0x3d')]=_['intersection'](_0x5560cc[_0x81d0('0x39')],qs[_0x81d0('0x3e')](_0xc9e224[_0x81d0('0x3a')][_0x81d0('0x3e')]));_0x2b9ae6['attributes']=_0x2b9ae6[_0x81d0('0x3d')][_0x81d0('0x3f')]?_0x2b9ae6[_0x81d0('0x3d')]:_0x5560cc[_0x81d0('0x39')];if(_0xc9e224[_0x81d0('0x3a')][_0x81d0('0x4a')]){_0x2b9ae6['include']=[{'all':!![]}];}_0x2b9ae6=_[_0x81d0('0x48')]({},_0x2b9ae6,_0xc9e224[_0x81d0('0x49')]);return db[_0x81d0('0x35')][_0x81d0('0x50')](_0x2b9ae6)[_0x81d0('0x1a')](handleEntityNotFound(_0x39d2d6,null))['then'](respondWithResult(_0x39d2d6,null))['catch'](handleError(_0x39d2d6,null));};exports[_0x81d0('0x51')]=function(_0x46d4c8,_0x34720f,_0x372e3b){var _0x13089c;return db['sequelize'][_0x81d0('0x52')](function(_0x1f5ad8){return db[_0x81d0('0x35')][_0x81d0('0x51')](_0x46d4c8[_0x81d0('0x53')],{'raw':!![]})['then'](function(_0x5cba20){_0x13089c=_0x5cba20;return db[_0x81d0('0x35')][_0x81d0('0x4b')]({'where':{'type':_0x46d4c8[_0x81d0('0x53')][_0x81d0('0x45')]},'raw':!![]});})[_0x81d0('0x1a')](function(_0x5040df){if(_0x13089c[_0x81d0('0x45')][_0x81d0('0x54')]()=='STUN'){var _0x1bda85=fs[_0x81d0('0x55')](path['join'](config[_0x81d0('0x56')],_0x81d0('0x57')),_0x81d0('0x58'));var _0x371648=ejs[_0x81d0('0x59')](_0x1bda85,{'networks':_0x5040df||[]});fs[_0x81d0('0x5a')](_0x81d0('0x5b'),_0x371648);return respondWithRpcPromise(_0x81d0('0x5c'),_0x81d0('0x51'),{'module':_0x81d0('0x5d')});}else if(_0x13089c[_0x81d0('0x45')]['toUpperCase']()==_0x81d0('0x5e')){var _0x1c21d3=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],'server/files/templates/turn_multiple.ejs'),_0x81d0('0x58'));var _0x475d46=ejs[_0x81d0('0x59')](_0x1c21d3,{'networks':_0x5040df||[]});fs[_0x81d0('0x5a')](_0x81d0('0x60'),_0x475d46);return respondWithRpcPromise('Reload',_0x81d0('0x51'),{'module':_0x81d0('0x5d')});}else{var _0x204873=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],_0x81d0('0x61')),_0x81d0('0x58'));var _0x4c65ea=ejs[_0x81d0('0x59')](_0x204873,{'networks':_0x5040df||[]});fs[_0x81d0('0x5a')](util[_0x81d0('0x62')](_0x81d0('0x63'),_0x46d4c8[_0x81d0('0x53')][_0x81d0('0x45')][_0x81d0('0x64')]()),_0x4c65ea);return respondWithRpcPromise(_0x81d0('0x5c'),_0x81d0('0x51'),{'module':_0x81d0('0x65')});}return null;})[_0x81d0('0x1a')](function(){return _0x13089c;});})[_0x81d0('0x1a')](respondWithResult(_0x34720f,0xc9))[_0x81d0('0x4d')](handleError(_0x34720f,null));};exports[_0x81d0('0x2e')]=function(_0x4967f1,_0x179ad8,_0x525038){var _0x17b83e;return db[_0x81d0('0x66')][_0x81d0('0x52')](function(_0x534053){return db[_0x81d0('0x35')][_0x81d0('0x50')]({'where':{'id':_0x4967f1[_0x81d0('0x4e')]['id']}})[_0x81d0('0x1a')](handleEntityNotFound(_0x179ad8,null))[_0x81d0('0x1a')](saveUpdates(_0x4967f1['body'],null))[_0x81d0('0x1a')](function(_0x287431){if(_0x287431){_0x17b83e=_0x287431;return db[_0x81d0('0x35')]['findAll']({'where':{'type':_0x17b83e[_0x81d0('0x45')]},'raw':!![]});}return null;})['then'](function(_0x151d8e){if(_0x17b83e[_0x81d0('0x45')]['toUpperCase']()==_0x81d0('0x67')){var _0x229a66=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],'server/files/templates/stun_multiple.ejs'),_0x81d0('0x58'));var _0x3b9270=ejs['render'](_0x229a66,{'networks':_0x151d8e||[]});fs[_0x81d0('0x5a')](_0x81d0('0x5b'),_0x3b9270);return respondWithRpcPromise(_0x81d0('0x5c'),'update',{'module':_0x81d0('0x5d')});}else if(_0x17b83e[_0x81d0('0x45')][_0x81d0('0x54')]()==_0x81d0('0x5e')){var _0x1f867b=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],'server/files/templates/turn_multiple.ejs'),_0x81d0('0x58'));var _0x13ccd7=ejs[_0x81d0('0x59')](_0x1f867b,{'networks':_0x151d8e||[]});fs[_0x81d0('0x5a')](_0x81d0('0x60'),_0x13ccd7);return respondWithRpcPromise('Reload',_0x81d0('0x2e'),{'module':_0x81d0('0x5d')});}else{var _0xd8b59e=fs['readFileSync'](path[_0x81d0('0x5f')](config['root'],'server/files/templates/network.ejs'),_0x81d0('0x58'));var _0x5048bd=ejs[_0x81d0('0x59')](_0xd8b59e,{'networks':_0x151d8e||[]});fs[_0x81d0('0x5a')](util[_0x81d0('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x4967f1[_0x81d0('0x53')]['type'][_0x81d0('0x64')]()),_0x5048bd);return respondWithRpcPromise(_0x81d0('0x5c'),'update',{'module':'chan_sip.so'});}return null;})[_0x81d0('0x1a')](function(_0xef3bbb){if(_0xef3bbb){return _0x17b83e;}return null;});})[_0x81d0('0x1a')](respondWithResult(_0x179ad8,null))[_0x81d0('0x4d')](handleError(_0x179ad8,null));};exports[_0x81d0('0x2f')]=function(_0x33e5f4,_0x21312d,_0xad3bf0){var _0x199506;return db[_0x81d0('0x35')][_0x81d0('0x50')]({'where':{'id':_0x33e5f4[_0x81d0('0x4e')]['id']}})['then'](function(_0x2eddfa){_0x199506=_0x2eddfa;return _0x2eddfa;})[_0x81d0('0x1a')](handleEntityNotFound(_0x21312d,null))[_0x81d0('0x1a')](removeEntity(_0x21312d,null))[_0x81d0('0x1a')](function(){if(_0x199506){return db[_0x81d0('0x35')][_0x81d0('0x4b')]({'where':{'type':_0x199506['type']},'raw':!![]});}})['then'](function(_0x2d3a71){if(_0x199506[_0x81d0('0x45')][_0x81d0('0x54')]()==_0x81d0('0x67')){var _0x44ef2d=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],_0x81d0('0x57')),'utf8');var _0x240bdd=ejs[_0x81d0('0x59')](_0x44ef2d,{'networks':_0x2d3a71||[]});fs[_0x81d0('0x5a')](_0x81d0('0x5b'),_0x240bdd);return respondWithRpcPromise(_0x81d0('0x5c'),_0x81d0('0x2f'),{'module':_0x81d0('0x5d')});}else if(_0x199506['type'][_0x81d0('0x54')]()==_0x81d0('0x5e')){var _0x5e7a20=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],_0x81d0('0x68')),_0x81d0('0x58'));var _0x4a29eb=ejs[_0x81d0('0x59')](_0x5e7a20,{'networks':_0x2d3a71||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x4a29eb);return respondWithRpcPromise(_0x81d0('0x5c'),_0x81d0('0x2f'),{'module':'res_stun_monitor.so'});}else{var _0x576b5a=fs[_0x81d0('0x55')](path[_0x81d0('0x5f')](config[_0x81d0('0x56')],_0x81d0('0x61')),_0x81d0('0x58'));var _0x5aac29=ejs[_0x81d0('0x59')](_0x576b5a,{'networks':_0x2d3a71||[]});fs[_0x81d0('0x5a')](util[_0x81d0('0x62')](_0x81d0('0x63'),_0x33e5f4['body'][_0x81d0('0x45')][_0x81d0('0x64')]()),_0x5aac29);return respondWithRpcPromise(_0x81d0('0x5c'),_0x81d0('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x81d0('0x4d')](handleError(_0x21312d,null));}; \ No newline at end of file +var _0x65b4=['offset','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','catch','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','params','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','find','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','status','send','index','map','Network','rawAttributes','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit'];(function(_0x3633ab,_0x50d387){var _0x38ceee=function(_0x120d22){while(--_0x120d22){_0x3633ab['push'](_0x3633ab['shift']());}};_0x38ceee(++_0x50d387);}(_0x65b4,0x96));var _0x465b=function(_0x1f84b7,_0x5411b5){_0x1f84b7=_0x1f84b7-0x0;var _0x25285b=_0x65b4[_0x1f84b7];return _0x25285b;};'use strict';var emlformat=require(_0x465b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x465b('0x1'));var rp=require('request-promise');var moment=require(_0x465b('0x2'));var BPromise=require(_0x465b('0x3'));var Mustache=require(_0x465b('0x4'));var util=require(_0x465b('0x5'));var path=require('path');var sox=require(_0x465b('0x6'));var csv=require(_0x465b('0x7'));var ejs=require(_0x465b('0x8'));var fs=require('fs');var fs_extra=require(_0x465b('0x9'));var _=require('lodash');var squel=require(_0x465b('0xa'));var crypto=require(_0x465b('0xb'));var jsforce=require(_0x465b('0xc'));var deskjs=require(_0x465b('0xd'));var toCsv=require(_0x465b('0x7'));var querystring=require(_0x465b('0xe'));var Papa=require(_0x465b('0xf'));var Redis=require(_0x465b('0x10'));var authService=require(_0x465b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x465b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x465b('0x13'));var utils=require(_0x465b('0x14'));var config=require(_0x465b('0x15'));var licenseUtil=require(_0x465b('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x465b('0x17'));var client=jayson[_0x465b('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e11df,_0x46c669,_0x2d29dc,_0x312de4){return new BPromise(function(_0x1e4678,_0x502491){var _0x1863f2=_0x312de4||client;return _0x1863f2[_0x465b('0x19')](_0x1e11df,_0x2d29dc)[_0x465b('0x1a')](function(_0x1b589c){logger[_0x465b('0x1b')](_0x465b('0x1c'),_0x46c669,_0x465b('0x1d'));logger[_0x465b('0x1e')](_0x465b('0x1f'),_0x46c669,_0x465b('0x1d'),JSON[_0x465b('0x20')](_0x1b589c));if(_0x1b589c[_0x465b('0x21')]){if(_0x1b589c[_0x465b('0x21')]['code']===0x1f4){logger[_0x465b('0x21')](_0x465b('0x1c'),_0x46c669,_0x1b589c[_0x465b('0x21')][_0x465b('0x22')]);return _0x502491(_0x1b589c[_0x465b('0x21')]['message']);}logger['error']('Network,\x20%s,\x20%s',_0x46c669,_0x1b589c[_0x465b('0x21')][_0x465b('0x22')]);return _0x1e4678(_0x1b589c[_0x465b('0x21')][_0x465b('0x22')]);}else{logger[_0x465b('0x1b')]('Network,\x20%s,\x20%s',_0x46c669,_0x465b('0x1d'));_0x1e4678(_0x1b589c[_0x465b('0x23')][_0x465b('0x22')]);}})['catch'](function(_0x47312f){logger[_0x465b('0x21')](_0x465b('0x1c'),_0x46c669,_0x47312f);_0x502491(_0x47312f);});});}function respondWithStatusCode(_0x4ac33b,_0x4ddee2){_0x4ddee2=_0x4ddee2||0xcc;return function(_0x36e80a){if(_0x36e80a){return _0x4ac33b[_0x465b('0x24')](_0x4ddee2);}return _0x4ac33b['status'](_0x4ddee2)[_0x465b('0x25')]();};}function respondWithResult(_0x2b4861,_0x5adde7){_0x5adde7=_0x5adde7||0xc8;return function(_0x33376d){if(_0x33376d){return _0x2b4861['status'](_0x5adde7)[_0x465b('0x26')](_0x33376d);}};}function respondWithFilteredResult(_0x2cdb10,_0x5095b2){return function(_0x2d67e9){if(_0x2d67e9){var _0x34bf0c=typeof _0x5095b2['offset']===_0x465b('0x27')&&typeof _0x5095b2[_0x465b('0x28')]===_0x465b('0x27');var _0x53cce4=_0x2d67e9[_0x465b('0x29')];var _0x47c00a=_0x34bf0c?0x0:_0x5095b2['offset'];var _0x1fb2db=_0x34bf0c?_0x2d67e9['count']:_0x5095b2['offset']+_0x5095b2['limit'];var _0x4d0b78;if(_0x1fb2db>=_0x53cce4){_0x1fb2db=_0x53cce4;_0x4d0b78=0xc8;}else{_0x4d0b78=0xce;}_0x2cdb10['status'](_0x4d0b78);return _0x2cdb10[_0x465b('0x2a')](_0x465b('0x2b'),_0x47c00a+'-'+_0x1fb2db+'/'+_0x53cce4)['json'](_0x2d67e9);}return null;};}function patchUpdates(_0x59616f){return function(_0x113a53){try{jsonpatch[_0x465b('0x2c')](_0x113a53,_0x59616f,!![]);}catch(_0x3f74d1){return BPromise[_0x465b('0x2d')](_0x3f74d1);}return _0x113a53[_0x465b('0x2e')]();};}function saveUpdates(_0x108e33,_0x3a73d0){return function(_0x2cb9f7){if(_0x2cb9f7){return _0x2cb9f7[_0x465b('0x2f')](_0x108e33)[_0x465b('0x1a')](function(_0x4f4378){return _0x4f4378;});}return null;};}function removeEntity(_0x48b715,_0x3f2ee2){return function(_0x38ec88){if(_0x38ec88){return _0x38ec88[_0x465b('0x30')]()['then'](function(){_0x48b715['status'](0xcc)[_0x465b('0x25')]();});}};}function handleEntityNotFound(_0x126d4e,_0x59f329){return function(_0x380850){if(!_0x380850){_0x126d4e[_0x465b('0x24')](0x194);}return _0x380850;};}function handleError(_0x89e689,_0x24796a){_0x24796a=_0x24796a||0x1f4;return function(_0x2b67af){logger[_0x465b('0x21')](_0x2b67af[_0x465b('0x31')]);if(_0x2b67af['name']){delete _0x2b67af[_0x465b('0x32')];}_0x89e689[_0x465b('0x33')](_0x24796a)[_0x465b('0x34')](_0x2b67af);};}exports[_0x465b('0x35')]=function(_0x30da93,_0x32da75){var _0x8c92a6={},_0x466111={},_0x277759={'count':0x0,'rows':[]};var _0x481054=_[_0x465b('0x36')](db[_0x465b('0x37')][_0x465b('0x38')],function(_0x2ecd8f){return{'name':_0x2ecd8f['fieldName'],'type':_0x2ecd8f[_0x465b('0x39')]['key']};});_0x466111[_0x465b('0x3a')]=_['map'](_0x481054,'name');_0x466111[_0x465b('0x3b')]=_[_0x465b('0x3c')](_0x30da93['query']);_0x466111['filters']=_[_0x465b('0x3d')](_0x466111[_0x465b('0x3a')],_0x466111[_0x465b('0x3b')]);_0x8c92a6[_0x465b('0x3e')]=_['intersection'](_0x466111['model'],qs['fields'](_0x30da93[_0x465b('0x3b')]['fields']));_0x8c92a6[_0x465b('0x3e')]=_0x8c92a6[_0x465b('0x3e')][_0x465b('0x3f')]?_0x8c92a6['attributes']:_0x466111[_0x465b('0x3a')];if(!_0x30da93['query'][_0x465b('0x40')](_0x465b('0x41'))){_0x8c92a6[_0x465b('0x28')]=qs[_0x465b('0x28')](_0x30da93[_0x465b('0x3b')]['limit']);_0x8c92a6[_0x465b('0x42')]=qs[_0x465b('0x42')](_0x30da93['query'][_0x465b('0x42')]);}_0x8c92a6[_0x465b('0x43')]=qs[_0x465b('0x44')](_0x30da93[_0x465b('0x3b')][_0x465b('0x44')]);_0x8c92a6[_0x465b('0x45')]=qs[_0x465b('0x46')](_[_0x465b('0x47')](_0x30da93[_0x465b('0x3b')],_0x466111[_0x465b('0x46')]),_0x481054);if(_0x30da93[_0x465b('0x3b')]['filter']){_0x8c92a6[_0x465b('0x45')]=_[_0x465b('0x48')](_0x8c92a6[_0x465b('0x45')],{'$or':_[_0x465b('0x36')](_0x481054,function(_0xd45aa){if(_0xd45aa['type']!==_0x465b('0x49')){var _0x246b88={};_0x246b88[_0xd45aa['name']]={'$like':'%'+_0x30da93['query']['filter']+'%'};return _0x246b88;}})});}_0x8c92a6=_['merge']({},_0x8c92a6,_0x30da93[_0x465b('0x4a')]);var _0x2d2c1e={'where':_0x8c92a6[_0x465b('0x45')]};return db['Network'][_0x465b('0x29')](_0x2d2c1e)[_0x465b('0x1a')](function(_0x1c9c3e){_0x277759[_0x465b('0x29')]=_0x1c9c3e;if(_0x30da93[_0x465b('0x3b')][_0x465b('0x4b')]){_0x8c92a6[_0x465b('0x4c')]=[{'all':!![]}];}return db[_0x465b('0x37')][_0x465b('0x4d')](_0x8c92a6);})[_0x465b('0x1a')](function(_0x363daf){_0x277759[_0x465b('0x4e')]=_0x363daf;return _0x277759;})['then'](respondWithFilteredResult(_0x32da75,_0x8c92a6))['catch'](handleError(_0x32da75,null));};exports[_0x465b('0x4f')]=function(_0x1a9e51,_0x192b21){var _0x333a0d={'raw':!![],'where':{'id':_0x1a9e51['params']['id']}},_0x4747fb={};_0x4747fb[_0x465b('0x3a')]=_[_0x465b('0x3c')](db[_0x465b('0x37')][_0x465b('0x38')]);_0x4747fb[_0x465b('0x3b')]=_[_0x465b('0x3c')](_0x1a9e51[_0x465b('0x3b')]);_0x4747fb[_0x465b('0x46')]=_[_0x465b('0x3d')](_0x4747fb[_0x465b('0x3a')],_0x4747fb[_0x465b('0x3b')]);_0x333a0d[_0x465b('0x3e')]=_['intersection'](_0x4747fb[_0x465b('0x3a')],qs[_0x465b('0x50')](_0x1a9e51['query'][_0x465b('0x50')]));_0x333a0d['attributes']=_0x333a0d['attributes'][_0x465b('0x3f')]?_0x333a0d[_0x465b('0x3e')]:_0x4747fb[_0x465b('0x3a')];if(_0x1a9e51[_0x465b('0x3b')][_0x465b('0x4b')]){_0x333a0d[_0x465b('0x4c')]=[{'all':!![]}];}_0x333a0d=_[_0x465b('0x48')]({},_0x333a0d,_0x1a9e51[_0x465b('0x4a')]);return db[_0x465b('0x37')]['find'](_0x333a0d)[_0x465b('0x1a')](handleEntityNotFound(_0x192b21,null))[_0x465b('0x1a')](respondWithResult(_0x192b21,null))[_0x465b('0x51')](handleError(_0x192b21,null));};exports[_0x465b('0x52')]=function(_0x2ee019,_0x1cf3ad,_0x44c2c0){var _0x5bf445;return db[_0x465b('0x53')][_0x465b('0x54')](function(_0x237377){return db['Network']['create'](_0x2ee019[_0x465b('0x55')],{'raw':!![]})[_0x465b('0x1a')](function(_0x6289b3){_0x5bf445=_0x6289b3;return db[_0x465b('0x37')]['findAll']({'where':{'type':_0x2ee019[_0x465b('0x55')][_0x465b('0x39')]},'raw':!![]});})[_0x465b('0x1a')](function(_0x26b422){if(_0x5bf445['type'][_0x465b('0x56')]()==_0x465b('0x57')){var _0x15dbd9=fs[_0x465b('0x58')](path[_0x465b('0x59')](config[_0x465b('0x5a')],'server/files/templates/stun_multiple.ejs'),_0x465b('0x5b'));var _0x379051=ejs[_0x465b('0x5c')](_0x15dbd9,{'networks':_0x26b422||[]});fs[_0x465b('0x5d')](_0x465b('0x5e'),_0x379051);return respondWithRpcPromise(_0x465b('0x5f'),_0x465b('0x52'),{'module':_0x465b('0x60')});}else if(_0x5bf445[_0x465b('0x39')]['toUpperCase']()==_0x465b('0x61')){var _0x51f53a=fs[_0x465b('0x58')](path[_0x465b('0x59')](config['root'],_0x465b('0x62')),'utf8');var _0x7708e1=ejs[_0x465b('0x5c')](_0x51f53a,{'networks':_0x26b422||[]});fs[_0x465b('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x7708e1);return respondWithRpcPromise(_0x465b('0x5f'),_0x465b('0x52'),{'module':'res_stun_monitor.so'});}else{var _0x1b4c96=fs[_0x465b('0x58')](path[_0x465b('0x59')](config[_0x465b('0x5a')],_0x465b('0x63')),_0x465b('0x5b'));var _0x5f458e=ejs[_0x465b('0x5c')](_0x1b4c96,{'networks':_0x26b422||[]});fs[_0x465b('0x5d')](util[_0x465b('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x2ee019[_0x465b('0x55')]['type']['toLowerCase']()),_0x5f458e);return respondWithRpcPromise(_0x465b('0x5f'),'create',{'module':'chan_sip.so'});}return null;})[_0x465b('0x1a')](function(){return _0x5bf445;});})['then'](respondWithResult(_0x1cf3ad,0xc9))[_0x465b('0x51')](handleError(_0x1cf3ad,null));};exports[_0x465b('0x2f')]=function(_0x3cbb15,_0x2b7250,_0x2012f7){var _0x1bbecd;return db['sequelize'][_0x465b('0x54')](function(_0x32ef92){return db[_0x465b('0x37')]['find']({'where':{'id':_0x3cbb15[_0x465b('0x65')]['id']}})['then'](handleEntityNotFound(_0x2b7250,null))[_0x465b('0x1a')](saveUpdates(_0x3cbb15[_0x465b('0x55')],null))[_0x465b('0x1a')](function(_0x23dfc8){if(_0x23dfc8){_0x1bbecd=_0x23dfc8;return db[_0x465b('0x37')][_0x465b('0x4d')]({'where':{'type':_0x1bbecd[_0x465b('0x39')]},'raw':!![]});}return null;})[_0x465b('0x1a')](function(_0x24ffca){if(_0x1bbecd[_0x465b('0x39')][_0x465b('0x56')]()==_0x465b('0x57')){var _0xabddb5=fs[_0x465b('0x58')](path[_0x465b('0x59')](config['root'],_0x465b('0x66')),_0x465b('0x5b'));var _0x45e1f8=ejs[_0x465b('0x5c')](_0xabddb5,{'networks':_0x24ffca||[]});fs[_0x465b('0x5d')](_0x465b('0x5e'),_0x45e1f8);return respondWithRpcPromise(_0x465b('0x5f'),_0x465b('0x2f'),{'module':_0x465b('0x60')});}else if(_0x1bbecd[_0x465b('0x39')][_0x465b('0x56')]()==_0x465b('0x61')){var _0x564ce5=fs[_0x465b('0x58')](path[_0x465b('0x59')](config[_0x465b('0x5a')],_0x465b('0x62')),'utf8');var _0x3b0d1d=ejs[_0x465b('0x5c')](_0x564ce5,{'networks':_0x24ffca||[]});fs[_0x465b('0x5d')](_0x465b('0x67'),_0x3b0d1d);return respondWithRpcPromise(_0x465b('0x5f'),'update',{'module':_0x465b('0x60')});}else{var _0x5999ed=fs['readFileSync'](path['join'](config[_0x465b('0x5a')],_0x465b('0x63')),'utf8');var _0x2b253f=ejs[_0x465b('0x5c')](_0x5999ed,{'networks':_0x24ffca||[]});fs['writeFileSync'](util[_0x465b('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x3cbb15[_0x465b('0x55')][_0x465b('0x39')]['toLowerCase']()),_0x2b253f);return respondWithRpcPromise('Reload',_0x465b('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x465b('0x1a')](function(_0x2722d4){if(_0x2722d4){return _0x1bbecd;}return null;});})[_0x465b('0x1a')](respondWithResult(_0x2b7250,null))[_0x465b('0x51')](handleError(_0x2b7250,null));};exports[_0x465b('0x30')]=function(_0x38515e,_0x143f83,_0x39c7b8){var _0x77eccd;return db[_0x465b('0x37')][_0x465b('0x68')]({'where':{'id':_0x38515e[_0x465b('0x65')]['id']}})[_0x465b('0x1a')](function(_0x2af9f3){_0x77eccd=_0x2af9f3;return _0x2af9f3;})[_0x465b('0x1a')](handleEntityNotFound(_0x143f83,null))[_0x465b('0x1a')](removeEntity(_0x143f83,null))[_0x465b('0x1a')](function(){if(_0x77eccd){return db[_0x465b('0x37')][_0x465b('0x4d')]({'where':{'type':_0x77eccd[_0x465b('0x39')]},'raw':!![]});}})['then'](function(_0x945e6b){if(_0x77eccd[_0x465b('0x39')]['toUpperCase']()==_0x465b('0x57')){var _0x377a39=fs[_0x465b('0x58')](path[_0x465b('0x59')](config[_0x465b('0x5a')],_0x465b('0x66')),'utf8');var _0x2609c9=ejs['render'](_0x377a39,{'networks':_0x945e6b||[]});fs[_0x465b('0x5d')](_0x465b('0x5e'),_0x2609c9);return respondWithRpcPromise(_0x465b('0x5f'),_0x465b('0x30'),{'module':'res_stun_monitor.so'});}else if(_0x77eccd[_0x465b('0x39')][_0x465b('0x56')]()==_0x465b('0x61')){var _0x215cc9=fs[_0x465b('0x58')](path[_0x465b('0x59')](config[_0x465b('0x5a')],_0x465b('0x62')),'utf8');var _0x9f233e=ejs['render'](_0x215cc9,{'networks':_0x945e6b||[]});fs[_0x465b('0x5d')](_0x465b('0x67'),_0x9f233e);return respondWithRpcPromise('Reload','destroy',{'module':'res_stun_monitor.so'});}else{var _0x3f1c05=fs['readFileSync'](path['join'](config[_0x465b('0x5a')],_0x465b('0x63')),_0x465b('0x5b'));var _0x20ccb0=ejs[_0x465b('0x5c')](_0x3f1c05,{'networks':_0x945e6b||[]});fs[_0x465b('0x5d')](util['format'](_0x465b('0x69'),_0x38515e[_0x465b('0x55')][_0x465b('0x39')][_0x465b('0x6a')]()),_0x20ccb0);return respondWithRpcPromise(_0x465b('0x5f'),'destroy',{'module':_0x465b('0x6b')});}return null;})[_0x465b('0x51')](handleError(_0x143f83,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 394616f..a04cb6f 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 _0x6b24=['api','moment','rimraf','./network.attributes','Network','network','util','../../config/logger'];(function(_0x1addee,_0x4e61b5){var _0x1d666f=function(_0x2d1eb1){while(--_0x2d1eb1){_0x1addee['push'](_0x1addee['shift']());}};_0x1d666f(++_0x4e61b5);}(_0x6b24,0x1ce));var _0x46b2=function(_0x43e2e4,_0x4ad3b4){_0x43e2e4=_0x43e2e4-0x0;var _0x1b71d0=_0x6b24[_0x43e2e4];return _0x1b71d0;};'use strict';var _=require('lodash');var util=require(_0x46b2('0x0'));var logger=require(_0x46b2('0x1'))(_0x46b2('0x2'));var moment=require(_0x46b2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x46b2('0x4'));var config=require('../../config/environment');var attributes=require(_0x46b2('0x5'));module['exports']=function(_0x2e5227,_0x5598df){return _0x2e5227['define'](_0x46b2('0x6'),attributes,{'tableName':_0x46b2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./network.attributes','define','Network'];(function(_0x561d73,_0x5e468e){var _0x4cfcb6=function(_0x178537){while(--_0x178537){_0x561d73['push'](_0x561d73['shift']());}};_0x4cfcb6(++_0x5e468e);}(_0x99e9,0xb4));var _0x999e=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0x99e9[_0x552fce];return _0x3e27a2;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 9b20ff3..77abe60 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(_0xde6ea3,_0x3d11f9){var _0x12242a=function(_0x8c383){while(--_0x8c383){_0xde6ea3['push'](_0xde6ea3['shift']());}};_0x12242a(++_0x3d11f9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x566297,_0x4d6c3c){_0x566297=_0x566297-0x0;var _0x85c153=_0x7a54[_0x566297];return _0x85c153;};'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 da1b818..23fc57f 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 _0x0950=['getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','addAnswer','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x0950,0x19f));var _0x0095=function(_0x49cf57,_0x428742){_0x49cf57=_0x49cf57-0x0;var _0x15eca3=_0x0950[_0x49cf57];return _0x15eca3;};'use strict';var multer=require('multer');var util=require(_0x0095('0x0'));var path=require(_0x0095('0x1'));var timeout=require(_0x0095('0x2'));var express=require(_0x0095('0x3'));var router=express[_0x0095('0x4')]();var fs_extra=require(_0x0095('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0095('0x6'));var config=require(_0x0095('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0095('0x8')]);router[_0x0095('0x9')](_0x0095('0xa'),auth[_0x0095('0xb')](),controller[_0x0095('0xc')]);router[_0x0095('0x9')](_0x0095('0xd'),auth[_0x0095('0xb')](),controller['show']);router[_0x0095('0x9')](_0x0095('0xe'),auth[_0x0095('0xb')](),controller[_0x0095('0xf')]);router[_0x0095('0x9')](_0x0095('0x10'),auth[_0x0095('0xb')](),controller[_0x0095('0x11')]);router[_0x0095('0x9')](_0x0095('0x12'),auth[_0x0095('0xb')](),controller['getApplications']);router[_0x0095('0x9')]('/:id/interactions',auth[_0x0095('0xb')](),controller[_0x0095('0x13')]);router[_0x0095('0x9')](_0x0095('0x14'),auth['isAuthenticated'](),controller[_0x0095('0x15')]);router[_0x0095('0x16')]('/',auth['isAuthenticated'](),controller[_0x0095('0x17')]);router[_0x0095('0x16')](_0x0095('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x0095('0x10'),auth['isAuthenticated'](),controller[_0x0095('0x18')]);router['post']('/:id/notify',controller[_0x0095('0x19')]);router[_0x0095('0x16')](_0x0095('0x12'),auth[_0x0095('0xb')](),controller[_0x0095('0x1a')]);router[_0x0095('0x16')]('/:id/users',auth[_0x0095('0xb')](),controller[_0x0095('0x1b')]);router[_0x0095('0x16')](_0x0095('0x1c'),auth[_0x0095('0xb')](),controller['send']);router[_0x0095('0x1d')](_0x0095('0xd'),auth[_0x0095('0xb')](),controller[_0x0095('0x1e')]);router[_0x0095('0x1f')]('/:id',auth[_0x0095('0xb')](),controller[_0x0095('0x20')]);router['delete'](_0x0095('0xe'),auth['isAuthenticated'](),controller[_0x0095('0x21')]);router[_0x0095('0x1f')]('/:id/canned_answers',auth[_0x0095('0xb')](),controller[_0x0095('0x22')]);router[_0x0095('0x1f')](_0x0095('0x14'),auth[_0x0095('0xb')](),controller[_0x0095('0x23')]);module['exports']=router; \ No newline at end of file +var _0x483a=['getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions'];(function(_0x1e37dd,_0x335d9a){var _0x1dd170=function(_0x502e36){while(--_0x502e36){_0x1e37dd['push'](_0x1e37dd['shift']());}};_0x1dd170(++_0x335d9a);}(_0x483a,0xd8));var _0xa483=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x483a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa483('0x0'));var util=require(_0xa483('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa483('0x2'));var router=express['Router']();var fs_extra=require(_0xa483('0x3'));var auth=require(_0xa483('0x4'));var interaction=require(_0xa483('0x5'));var config=require('../../config/environment');var controller=require(_0xa483('0x6'));router[_0xa483('0x7')]('/',auth[_0xa483('0x8')](),controller[_0xa483('0x9')]);router[_0xa483('0x7')](_0xa483('0xa'),auth[_0xa483('0x8')](),controller[_0xa483('0xb')]);router[_0xa483('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa483('0xc')]);router['get'](_0xa483('0xd'),auth[_0xa483('0x8')](),controller['getDispositions']);router[_0xa483('0x7')](_0xa483('0xe'),auth['isAuthenticated'](),controller[_0xa483('0xf')]);router['get']('/:id/applications',auth[_0xa483('0x8')](),controller[_0xa483('0x10')]);router['get'](_0xa483('0x11'),auth[_0xa483('0x8')](),controller[_0xa483('0x12')]);router['get'](_0xa483('0x13'),auth[_0xa483('0x8')](),controller[_0xa483('0x14')]);router[_0xa483('0x15')]('/',auth[_0xa483('0x8')](),controller['create']);router[_0xa483('0x15')]('/:id/dispositions',auth[_0xa483('0x8')](),controller[_0xa483('0x16')]);router[_0xa483('0x15')](_0xa483('0xe'),auth['isAuthenticated'](),controller[_0xa483('0x17')]);router[_0xa483('0x15')](_0xa483('0x18'),controller[_0xa483('0x19')]);router[_0xa483('0x15')](_0xa483('0x1a'),auth[_0xa483('0x8')](),controller[_0xa483('0x1b')]);router[_0xa483('0x15')](_0xa483('0x13'),auth[_0xa483('0x8')](),controller[_0xa483('0x1c')]);router[_0xa483('0x15')](_0xa483('0x1d'),auth['isAuthenticated'](),controller['send']);router[_0xa483('0x1e')](_0xa483('0x1f'),auth['isAuthenticated'](),controller[_0xa483('0x20')]);router['delete'](_0xa483('0x1f'),auth[_0xa483('0x8')](),controller[_0xa483('0x21')]);router[_0xa483('0x22')](_0xa483('0xd'),auth[_0xa483('0x8')](),controller[_0xa483('0x23')]);router[_0xa483('0x22')](_0xa483('0xe'),auth[_0xa483('0x8')](),controller[_0xa483('0x24')]);router[_0xa483('0x22')](_0xa483('0x13'),auth[_0xa483('0x8')](),controller[_0xa483('0x25')]);module[_0xa483('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 55e2ebf..63d3b4f 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 _0x3daf=['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','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x354172,_0x8c3880){var _0x31db5b=function(_0x12b791){while(--_0x12b791){_0x354172['push'](_0x354172['shift']());}};_0x31db5b(++_0x8c3880);}(_0x3daf,0x158));var _0xf3da=function(_0x1fbd7a,_0x2e2a4a){_0x1fbd7a=_0x1fbd7a-0x0;var _0x56e1a6=_0x3daf[_0x1fbd7a];return _0x56e1a6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf3da('0x0'));module[_0xf3da('0x1')]={'name':{'type':Sequelize[_0xf3da('0x2')],'unique':_0xf3da('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf3da('0x2')],'defaultValue':function(){return rs[_0xf3da('0x4')]();}},'replyUri':{'type':Sequelize[_0xf3da('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf3da('0x5')],'defaultValue':function(){return _0xf3da('0x6');}},'notificationSound':{'type':Sequelize[_0xf3da('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf3da('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf3da('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf3da('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf3da('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf3da('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf3da('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xf3da('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf3da('0x7')],'defaultValue':![],'comment':_0xf3da('0xa'),'set':function(_0x7e8506){if(!_0x7e8506)this[_0xf3da('0xb')](_0xf3da('0xc'),null);this[_0xf3da('0xb')](_0xf3da('0xd'),_0x7e8506);}}}; \ No newline at end of file +var _0x0e73=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x0e73,0x70));var _0x30e7=function(_0x32b50d,_0x4e0723){_0x32b50d=_0x32b50d-0x0;var _0x1b4bfd=_0x0e73[_0x32b50d];return _0x1b4bfd;};'use strict';var Sequelize=require(_0x30e7('0x0'));var rs=require(_0x30e7('0x1'));module[_0x30e7('0x2')]={'name':{'type':Sequelize[_0x30e7('0x3')],'unique':_0x30e7('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x30e7('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x30e7('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x30e7('0x5')],'defaultValue':function(){return _0x30e7('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x30e7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x30e7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x30e7('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x30e7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x30e7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x30e7('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x30e7('0x8')],'defaultValue':![],'comment':_0x30e7('0xa'),'set':function(_0x57a2db){if(!_0x57a2db)this[_0x30e7('0xb')](_0x30e7('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x57a2db);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index fdd5c03..bf92a63 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 _0x6df3=['nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','params','mandatoryDispositionPause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','OpenchannelAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','contact','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','send','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','DESC','out','Messages','dataValues','eml-format','zip-dir','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x128ef3,_0x38a577){var _0x5a5477=function(_0x3b9123){while(--_0x3b9123){_0x128ef3['push'](_0x128ef3['shift']());}};_0x5a5477(++_0x38a577);}(_0x6df3,0x1f0));var _0x36df=function(_0x28d171,_0x435cfa){_0x28d171=_0x28d171-0x0;var _0x2cf582=_0x6df3[_0x28d171];return _0x2cf582;};'use strict';var emlformat=require(_0x36df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36df('0x2'));var util=require(_0x36df('0x3'));var path=require(_0x36df('0x4'));var sox=require('sox');var csv=require(_0x36df('0x5'));var ejs=require(_0x36df('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36df('0x7'));var squel=require('squel');var crypto=require(_0x36df('0x8'));var jsforce=require(_0x36df('0x9'));var deskjs=require(_0x36df('0xa'));var toCsv=require(_0x36df('0x5'));var querystring=require(_0x36df('0xb'));var Papa=require(_0x36df('0xc'));var Redis=require(_0x36df('0xd'));var authService=require(_0x36df('0xe'));var qs=require(_0x36df('0xf'));var as=require(_0x36df('0x10'));var hardwareService=require(_0x36df('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x36df('0x12'));var config=require(_0x36df('0x13'));var licenseUtil=require(_0x36df('0x14'));var db=require(_0x36df('0x15'))['db'];config[_0x36df('0x16')]=_[_0x36df('0x17')](config[_0x36df('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36df('0x16')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x36df('0x18'));var client=jayson[_0x36df('0x19')][_0x36df('0x1a')]({'port':0x232c});var client9002=jayson[_0x36df('0x19')][_0x36df('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xea0019,_0x6975ae,_0x29ffd3,_0x510e68){return new BPromise(function(_0x479130,_0x5bed3f){var _0x341e19=_0x510e68||client;return _0x341e19[_0x36df('0x1b')](_0xea0019,_0x29ffd3)['then'](function(_0x1ce3fc){logger[_0x36df('0x1c')](_0x36df('0x1d'),_0x6975ae,'request\x20sent');logger[_0x36df('0x1e')](_0x36df('0x1f'),_0x6975ae,_0x36df('0x20'),JSON[_0x36df('0x21')](_0x1ce3fc));if(_0x1ce3fc[_0x36df('0x22')]){if(_0x1ce3fc[_0x36df('0x22')]['code']===0x1f4){logger['error'](_0x36df('0x1d'),_0x6975ae,_0x1ce3fc[_0x36df('0x22')][_0x36df('0x23')]);return _0x5bed3f(_0x1ce3fc['error'][_0x36df('0x23')]);}logger[_0x36df('0x22')](_0x36df('0x1d'),_0x6975ae,_0x1ce3fc['error'][_0x36df('0x23')]);return _0x479130(_0x1ce3fc[_0x36df('0x22')][_0x36df('0x23')]);}else{logger['info'](_0x36df('0x1d'),_0x6975ae,_0x36df('0x20'));_0x479130(_0x1ce3fc[_0x36df('0x24')][_0x36df('0x23')]);}})[_0x36df('0x25')](function(_0x479c40){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x6975ae,_0x479c40);_0x5bed3f(_0x479c40);});});}function respondWithStatusCode(_0x33e8fd,_0x6debe1){_0x6debe1=_0x6debe1||0xcc;return function(_0x507275){if(_0x507275){return _0x33e8fd[_0x36df('0x26')](_0x6debe1);}return _0x33e8fd[_0x36df('0x27')](_0x6debe1)[_0x36df('0x28')]();};}function respondWithResult(_0x119852,_0x27d4b1){_0x27d4b1=_0x27d4b1||0xc8;return function(_0x38dec0){if(_0x38dec0){return _0x119852[_0x36df('0x27')](_0x27d4b1)[_0x36df('0x29')](_0x38dec0);}};}function respondWithFilteredResult(_0x4a7c10,_0x524362){return function(_0x1e577e){if(_0x1e577e){var _0x12e5c0=typeof _0x524362[_0x36df('0x2a')]===_0x36df('0x2b')&&typeof _0x524362[_0x36df('0x2c')]===_0x36df('0x2b');var _0x334e7f=_0x1e577e[_0x36df('0x2d')];var _0x5294a8=_0x12e5c0?0x0:_0x524362[_0x36df('0x2a')];var _0x11670e=_0x12e5c0?_0x1e577e['count']:_0x524362[_0x36df('0x2a')]+_0x524362[_0x36df('0x2c')];var _0x5c1e92;if(_0x11670e>=_0x334e7f){_0x11670e=_0x334e7f;_0x5c1e92=0xc8;}else{_0x5c1e92=0xce;}_0x4a7c10[_0x36df('0x27')](_0x5c1e92);return _0x4a7c10['set'](_0x36df('0x2e'),_0x5294a8+'-'+_0x11670e+'/'+_0x334e7f)[_0x36df('0x29')](_0x1e577e);}return null;};}function patchUpdates(_0x4433e4){return function(_0x2ebc08){try{jsonpatch[_0x36df('0x2f')](_0x2ebc08,_0x4433e4,!![]);}catch(_0x416a61){return BPromise[_0x36df('0x30')](_0x416a61);}return _0x2ebc08['save']();};}function saveUpdates(_0x585348,_0x1e0cc7){return function(_0x2e3ad2){if(_0x2e3ad2){return _0x2e3ad2[_0x36df('0x31')](_0x585348)[_0x36df('0x32')](function(_0x16cc21){return _0x16cc21;});}return null;};}function removeEntity(_0x2bdacf,_0x56b03d){return function(_0x34e2cb){if(_0x34e2cb){return _0x34e2cb[_0x36df('0x33')]()[_0x36df('0x32')](function(){var _0x411e5d=_0x34e2cb[_0x36df('0x34')]({'plain':!![]});var _0x22e1ae=_0x36df('0x35');return db[_0x36df('0x36')][_0x36df('0x33')]({'where':{'type':_0x22e1ae,'resourceId':_0x411e5d['id']}})['then'](function(){return _0x34e2cb;});})[_0x36df('0x32')](function(){_0x2bdacf[_0x36df('0x27')](0xcc)[_0x36df('0x28')]();});}};}function handleEntityNotFound(_0x45ed6b,_0x3a09e3){return function(_0x992c70){if(!_0x992c70){_0x45ed6b['sendStatus'](0x194);}return _0x992c70;};}function handleError(_0x37e33f,_0xd9393d){_0xd9393d=_0xd9393d||0x1f4;return function(_0x2371b7){logger[_0x36df('0x22')](_0x2371b7[_0x36df('0x37')]);if(_0x2371b7['name']){delete _0x2371b7[_0x36df('0x38')];}_0x37e33f[_0x36df('0x27')](_0xd9393d)['send'](_0x2371b7);};}exports[_0x36df('0x39')]=function(_0x276b0b,_0x40c0ed){var _0x2242ec={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4a3794={},_0x313a86={'count':0x0,'rows':[]};var _0x27513a=_[_0x36df('0x3a')](db['OpenchannelAccount'][_0x36df('0x3b')],function(_0x49bf06){return{'name':_0x49bf06['fieldName'],'type':_0x49bf06['type'][_0x36df('0x3c')]};});_0x4a3794[_0x36df('0x3d')]=_[_0x36df('0x3a')](_0x27513a,'name');_0x4a3794[_0x36df('0x3e')]=_['keys'](_0x276b0b['query']);_0x4a3794['filters']=_[_0x36df('0x3f')](_0x4a3794[_0x36df('0x3d')],_0x4a3794[_0x36df('0x3e')]);_0x2242ec[_0x36df('0x40')]=_[_0x36df('0x3f')](_0x4a3794[_0x36df('0x3d')],qs['fields'](_0x276b0b[_0x36df('0x3e')][_0x36df('0x41')]));_0x2242ec[_0x36df('0x40')]=_0x2242ec[_0x36df('0x40')][_0x36df('0x42')]?_0x2242ec['attributes']:_0x4a3794[_0x36df('0x3d')];if(!_0x276b0b[_0x36df('0x3e')][_0x36df('0x43')](_0x36df('0x44'))){_0x2242ec[_0x36df('0x2c')]=qs['limit'](_0x276b0b[_0x36df('0x3e')]['limit']);_0x2242ec[_0x36df('0x2a')]=qs[_0x36df('0x2a')](_0x276b0b[_0x36df('0x3e')]['offset']);}_0x2242ec[_0x36df('0x45')]=qs['sort'](_0x276b0b['query'][_0x36df('0x46')]);_0x2242ec[_0x36df('0x47')]=qs[_0x36df('0x48')](_[_0x36df('0x49')](_0x276b0b[_0x36df('0x3e')],_0x4a3794['filters']),_0x27513a);if(_0x276b0b[_0x36df('0x3e')]['filter']){_0x2242ec[_0x36df('0x47')]=_[_0x36df('0x4a')](_0x2242ec[_0x36df('0x47')],{'$or':_[_0x36df('0x3a')](_0x27513a,function(_0x1e19bc){if(_0x1e19bc[_0x36df('0x4b')]!==_0x36df('0x4c')){var _0x2a12c4={};_0x2a12c4[_0x1e19bc[_0x36df('0x38')]]={'$like':'%'+_0x276b0b[_0x36df('0x3e')][_0x36df('0x4d')]+'%'};return _0x2a12c4;}})});}_0x2242ec=_[_0x36df('0x4a')]({},_0x2242ec,_0x276b0b[_0x36df('0x4e')]);var _0x1fa4ce={'where':_0x2242ec[_0x36df('0x47')]};return db[_0x36df('0x4f')][_0x36df('0x2d')](_0x1fa4ce)['then'](function(_0xa7862d){_0x313a86[_0x36df('0x2d')]=_0xa7862d;if(_0x276b0b[_0x36df('0x3e')][_0x36df('0x50')]){_0x2242ec[_0x36df('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x36df('0x52')](_0x2242ec);})[_0x36df('0x32')](function(_0x1abeb6){_0x313a86[_0x36df('0x53')]=_0x1abeb6;return _0x313a86;})[_0x36df('0x32')](respondWithFilteredResult(_0x40c0ed,_0x2242ec))['catch'](handleError(_0x40c0ed,null));};exports['show']=function(_0x2b0b8f,_0x3540a4){var _0x23d19c={'raw':![],'where':{'id':_0x2b0b8f[_0x36df('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x36df('0x55')}]},_0x5c484e={};_0x5c484e[_0x36df('0x3d')]=_['keys'](db[_0x36df('0x4f')][_0x36df('0x3b')]);_0x5c484e[_0x36df('0x3e')]=_[_0x36df('0x56')](_0x2b0b8f[_0x36df('0x3e')]);_0x5c484e[_0x36df('0x48')]=_[_0x36df('0x3f')](_0x5c484e[_0x36df('0x3d')],_0x5c484e[_0x36df('0x3e')]);_0x23d19c[_0x36df('0x40')]=_[_0x36df('0x3f')](_0x5c484e['model'],qs[_0x36df('0x41')](_0x2b0b8f['query'][_0x36df('0x41')]));_0x23d19c[_0x36df('0x40')]=_0x23d19c['attributes'][_0x36df('0x42')]?_0x23d19c['attributes']:_0x5c484e[_0x36df('0x3d')];if(_0x2b0b8f[_0x36df('0x3e')][_0x36df('0x50')]){_0x23d19c[_0x36df('0x51')]=[{'all':!![]}];}_0x23d19c=_['merge']({},_0x23d19c,_0x2b0b8f[_0x36df('0x4e')]);return db[_0x36df('0x4f')][_0x36df('0x57')](_0x23d19c)[_0x36df('0x32')](handleEntityNotFound(_0x3540a4,null))[_0x36df('0x32')](respondWithResult(_0x3540a4,null))[_0x36df('0x25')](handleError(_0x3540a4,null));};exports[_0x36df('0x58')]=function(_0x3e01e9,_0x23b556){return db[_0x36df('0x4f')][_0x36df('0x58')](_0x3e01e9[_0x36df('0x59')],{})[_0x36df('0x32')](function(_0x5d46f2){var _0x3357df=_0x3e01e9[_0x36df('0x5a')]['get']({'plain':!![]});if(!_0x3357df)throw new Error(_0x36df('0x5b'));if(_0x3357df[_0x36df('0x5c')]===_0x36df('0x5a')){var _0x38ffef=_0x5d46f2['get']({'plain':!![]});var _0x372c17=_0x36df('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x372c17,'userProfileId':_0x3357df[_0x36df('0x5d')]},'raw':!![]})[_0x36df('0x32')](function(_0x10ca44){if(_0x10ca44&&_0x10ca44['autoAssociation']===0x0){return db[_0x36df('0x36')]['create']({'name':_0x38ffef[_0x36df('0x38')],'resourceId':_0x38ffef['id'],'type':_0x10ca44[_0x36df('0x38')],'sectionId':_0x10ca44['id']},{})[_0x36df('0x32')](function(){return _0x5d46f2;});}else{return _0x5d46f2;}})[_0x36df('0x25')](function(_0x1c69dc){logger['error'](_0x36df('0x5e'),_0x1c69dc);throw _0x1c69dc;});}return _0x5d46f2;})[_0x36df('0x32')](respondWithResult(_0x23b556,0xc9))[_0x36df('0x25')](handleError(_0x23b556,null));};exports[_0x36df('0x31')]=function(_0x4a2f7a,_0x5c4703){if(_0x4a2f7a['body']['id']){delete _0x4a2f7a[_0x36df('0x59')]['id'];}return db[_0x36df('0x4f')][_0x36df('0x57')]({'where':{'id':_0x4a2f7a[_0x36df('0x54')]['id']},'include':[{'model':db[_0x36df('0x5f')],'as':_0x36df('0x55')}]})[_0x36df('0x32')](handleEntityNotFound(_0x5c4703,null))['then'](saveUpdates(_0x4a2f7a[_0x36df('0x59')],null))[_0x36df('0x32')](respondWithResult(_0x5c4703,null))[_0x36df('0x25')](handleError(_0x5c4703,null));};exports[_0x36df('0x33')]=function(_0x264e17,_0xf4ec4){return db[_0x36df('0x4f')][_0x36df('0x57')]({'where':{'id':_0x264e17['params']['id']}})[_0x36df('0x32')](handleEntityNotFound(_0xf4ec4,null))[_0x36df('0x32')](removeEntity(_0xf4ec4,null))[_0x36df('0x25')](handleError(_0xf4ec4,null));};exports[_0x36df('0x60')]=function(_0x5d05a0,_0x337452){return db[_0x36df('0x4f')]['describe']()[_0x36df('0x32')](respondWithResult(_0x337452,null))[_0x36df('0x25')](handleError(_0x337452,null));};exports[_0x36df('0x61')]=function(_0x1d4160,_0x24ab7d,_0x5bc928){if(_0x1d4160[_0x36df('0x59')]['id']){delete _0x1d4160[_0x36df('0x59')]['id'];}return db[_0x36df('0x4f')][_0x36df('0x57')]({'where':{'id':_0x1d4160[_0x36df('0x54')]['id']}})['then'](handleEntityNotFound(_0x24ab7d,null))[_0x36df('0x32')](function(_0x2709d6){if(_0x2709d6){_0x1d4160['body'][_0x36df('0x62')]=_0x2709d6['id'];return db['Disposition'][_0x36df('0x58')](_0x1d4160[_0x36df('0x59')]);}})[_0x36df('0x32')](respondWithResult(_0x24ab7d,null))[_0x36df('0x25')](handleError(_0x24ab7d,null));};exports['getDispositions']=function(_0x213712,_0x34f25f,_0xad6710){var _0x1343f3={'raw':![],'where':{}};var _0x48d024={};var _0x513ce1={'count':0x0,'rows':[]};return db[_0x36df('0x4f')][_0x36df('0x63')]({'where':{'id':_0x213712[_0x36df('0x54')]['id']}})['then'](handleEntityNotFound(_0x34f25f,null))[_0x36df('0x32')](function(_0x207e4b){if(_0x207e4b){_0x48d024['model']=_['keys'](db[_0x36df('0x64')][_0x36df('0x3b')]);_0x48d024[_0x36df('0x3e')]=_[_0x36df('0x56')](_0x213712[_0x36df('0x3e')]);_0x48d024['filters']=_['intersection'](_0x48d024[_0x36df('0x3d')],_0x48d024[_0x36df('0x3e')]);_0x1343f3[_0x36df('0x40')]=_[_0x36df('0x3f')](_0x48d024[_0x36df('0x3d')],qs[_0x36df('0x41')](_0x213712[_0x36df('0x3e')]['fields']));_0x1343f3[_0x36df('0x40')]=_0x1343f3[_0x36df('0x40')]['length']?_0x1343f3['attributes']:_0x48d024['model'];if(!_0x213712[_0x36df('0x3e')][_0x36df('0x43')](_0x36df('0x44'))){_0x1343f3[_0x36df('0x2c')]=qs[_0x36df('0x2c')](_0x213712['query'][_0x36df('0x2c')]);_0x1343f3['offset']=qs[_0x36df('0x2a')](_0x213712[_0x36df('0x3e')]['offset']);}_0x1343f3[_0x36df('0x45')]=qs['sort'](_0x213712['query'][_0x36df('0x46')]);_0x1343f3[_0x36df('0x47')]=qs[_0x36df('0x48')](_[_0x36df('0x49')](_0x213712[_0x36df('0x3e')],_0x48d024['filters']));_0x1343f3[_0x36df('0x47')][_0x36df('0x62')]=_0x207e4b['id'];if(_0x213712[_0x36df('0x3e')][_0x36df('0x4d')]){_0x1343f3[_0x36df('0x47')]=_[_0x36df('0x4a')](_0x1343f3[_0x36df('0x47')],{'$or':_[_0x36df('0x3a')](_0x1343f3[_0x36df('0x40')],function(_0x46e67b){var _0x2cc82d={};_0x2cc82d[_0x46e67b]={'$like':'%'+_0x213712[_0x36df('0x3e')][_0x36df('0x4d')]+'%'};return _0x2cc82d;})});}_0x1343f3=_[_0x36df('0x4a')]({},_0x1343f3,_0x213712[_0x36df('0x4e')]);return db[_0x36df('0x64')][_0x36df('0x2d')]({'where':_0x1343f3[_0x36df('0x47')]})[_0x36df('0x32')](function(_0x464d6a){_0x513ce1['count']=_0x464d6a;if(_0x213712['query'][_0x36df('0x50')]){_0x1343f3[_0x36df('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x36df('0x52')](_0x1343f3);})[_0x36df('0x32')](function(_0x32f151){_0x513ce1[_0x36df('0x53')]=_0x32f151;return _0x513ce1;});}})[_0x36df('0x32')](respondWithFilteredResult(_0x34f25f,_0x1343f3))[_0x36df('0x25')](handleError(_0x34f25f,null));};exports[_0x36df('0x65')]=function(_0x39b90e,_0x50a8ac,_0x2281f3){return db[_0x36df('0x4f')][_0x36df('0x57')]({'where':{'id':_0x39b90e[_0x36df('0x54')]['id']}})['then'](handleEntityNotFound(_0x50a8ac,null))[_0x36df('0x32')](function(_0x469e6a){if(_0x469e6a){return _0x469e6a[_0x36df('0x65')](_0x39b90e['query'][_0x36df('0x66')]);}})['then'](respondWithStatusCode(_0x50a8ac,null))[_0x36df('0x25')](handleError(_0x50a8ac,null));};exports[_0x36df('0x67')]=function(_0x49d719,_0x1e5bfe,_0x42481c){if(_0x49d719['body']['id']){delete _0x49d719[_0x36df('0x59')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x49d719['params']['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x1e5bfe,null))[_0x36df('0x32')](function(_0x45583e){if(_0x45583e){_0x49d719[_0x36df('0x59')][_0x36df('0x62')]=_0x45583e['id'];return db[_0x36df('0x68')][_0x36df('0x58')](_0x49d719[_0x36df('0x59')]);}})[_0x36df('0x32')](respondWithResult(_0x1e5bfe,null))[_0x36df('0x25')](handleError(_0x1e5bfe,null));};exports[_0x36df('0x69')]=function(_0x5b9662,_0x18eacb,_0x56ed3a){var _0x198a64={'raw':![],'where':{}};var _0x90bfe={};var _0xf3c5ee={'count':0x0,'rows':[]};return db[_0x36df('0x4f')][_0x36df('0x63')]({'where':{'id':_0x5b9662['params']['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x18eacb,null))[_0x36df('0x32')](function(_0x40dd5b){if(_0x40dd5b){_0x90bfe[_0x36df('0x3d')]=_[_0x36df('0x56')](db[_0x36df('0x68')][_0x36df('0x3b')]);_0x90bfe[_0x36df('0x3e')]=_[_0x36df('0x56')](_0x5b9662[_0x36df('0x3e')]);_0x90bfe[_0x36df('0x48')]=_['intersection'](_0x90bfe[_0x36df('0x3d')],_0x90bfe[_0x36df('0x3e')]);_0x198a64[_0x36df('0x40')]=_[_0x36df('0x3f')](_0x90bfe[_0x36df('0x3d')],qs['fields'](_0x5b9662[_0x36df('0x3e')][_0x36df('0x41')]));_0x198a64['attributes']=_0x198a64['attributes'][_0x36df('0x42')]?_0x198a64[_0x36df('0x40')]:_0x90bfe[_0x36df('0x3d')];if(!_0x5b9662[_0x36df('0x3e')][_0x36df('0x43')](_0x36df('0x44'))){_0x198a64[_0x36df('0x2c')]=qs[_0x36df('0x2c')](_0x5b9662[_0x36df('0x3e')]['limit']);_0x198a64[_0x36df('0x2a')]=qs['offset'](_0x5b9662['query'][_0x36df('0x2a')]);}_0x198a64['order']=qs[_0x36df('0x46')](_0x5b9662[_0x36df('0x3e')]['sort']);_0x198a64[_0x36df('0x47')]=qs['filters'](_[_0x36df('0x49')](_0x5b9662[_0x36df('0x3e')],_0x90bfe[_0x36df('0x48')]));_0x198a64['where'][_0x36df('0x62')]=_0x40dd5b['id'];if(_0x5b9662['query'][_0x36df('0x4d')]){_0x198a64[_0x36df('0x47')]=_[_0x36df('0x4a')](_0x198a64[_0x36df('0x47')],{'$or':_[_0x36df('0x3a')](_0x198a64[_0x36df('0x40')],function(_0x59e20a){var _0x4c250e={};_0x4c250e[_0x59e20a]={'$like':'%'+_0x5b9662[_0x36df('0x3e')][_0x36df('0x4d')]+'%'};return _0x4c250e;})});}_0x198a64=_[_0x36df('0x4a')]({},_0x198a64,_0x5b9662[_0x36df('0x4e')]);return db['CannedAnswer'][_0x36df('0x2d')]({'where':_0x198a64[_0x36df('0x47')]})[_0x36df('0x32')](function(_0x56ac57){_0xf3c5ee[_0x36df('0x2d')]=_0x56ac57;if(_0x5b9662[_0x36df('0x3e')]['includeAll']){_0x198a64[_0x36df('0x51')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x198a64);})[_0x36df('0x32')](function(_0x1e6bcf){_0xf3c5ee['rows']=_0x1e6bcf;return _0xf3c5ee;});}})[_0x36df('0x32')](respondWithFilteredResult(_0x18eacb,_0x198a64))[_0x36df('0x25')](handleError(_0x18eacb,null));};exports[_0x36df('0x6a')]=function(_0x55ba4b,_0x437c94,_0x11fcd6){return db[_0x36df('0x4f')][_0x36df('0x57')]({'where':{'id':_0x55ba4b[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x437c94,null))[_0x36df('0x32')](function(_0x1c8b5a){if(_0x1c8b5a){return _0x1c8b5a[_0x36df('0x6a')](_0x55ba4b['query']['ids']);}})[_0x36df('0x32')](respondWithStatusCode(_0x437c94,null))[_0x36df('0x25')](handleError(_0x437c94,null));};exports[_0x36df('0x6b')]=function(_0x4ddfb8,_0x156107,_0x1021be){var _0xfdf506={'body':_0x4ddfb8['body'],'channel':_0x36df('0x6c')};var _0x5ee633=[];var _0x1a433e=[];var _0x40b453={};var _0x1e400a=![];return db[_0x36df('0x6d')][_0x36df('0x60')]()['then'](function(_0x59e2f2){if(!_0x59e2f2){throw new db[(_0x36df('0x6e'))][(_0x36df('0x6f'))](_0x36df('0x70'));}_0x5ee633=_[_0x36df('0x71')](_['keys'](_0x59e2f2),[_0x36df('0x72'),'updatedAt']);_0x1a433e=_[_0x36df('0x71')](_[_0x36df('0x56')](_0x59e2f2),['createdAt',_0x36df('0x73'),_0x36df('0x74'),_0x36df('0x75')]);if(_0x4ddfb8[_0x36df('0x59')]['id']){delete _0x4ddfb8[_0x36df('0x59')]['id'];}if(_[_0x36df('0x76')](_0x4ddfb8['body'][_0x36df('0x77')])){throw new db[(_0x36df('0x6e'))][(_0x36df('0x6f'))](_0x36df('0x78'));}if(_[_0x36df('0x76')](_0x4ddfb8[_0x36df('0x59')][_0x36df('0x59')])||_0x4ddfb8[_0x36df('0x59')][_0x36df('0x59')]===''){throw new db['Sequelize'][(_0x36df('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x36df('0x76')](_0x4ddfb8[_0x36df('0x59')]['mapKey'])){throw new db[(_0x36df('0x6e'))][(_0x36df('0x6f'))](_0x36df('0x79')+_0x1a433e);}if(!_[_0x36df('0x7a')](_0x1a433e,_0x4ddfb8[_0x36df('0x59')][_0x36df('0x7b')])){throw new db[(_0x36df('0x6e'))][(_0x36df('0x6f'))](_0x36df('0x7c')+_0x1a433e);}_0x40b453[_0x4ddfb8[_0x36df('0x59')][_0x36df('0x7b')]]=_0x4ddfb8[_0x36df('0x59')][_0x36df('0x77')];})[_0x36df('0x32')](function(){return db['OpenchannelAccount'][_0x36df('0x57')]({'where':{'id':_0x4ddfb8[_0x36df('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x36df('0x7d'),'include':[{'model':db[_0x36df('0x6d')],'as':_0x36df('0x7e'),'where':_0x40b453,'limit':0x1,'order':[[_0x36df('0x73'),'DESC']]}]},{'model':db[_0x36df('0x7f')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x156107,null))['then'](function(_0x29b31d){if(_0x29b31d&&_0x29b31d[_0x36df('0x7d')]){_0xfdf506[_0x36df('0x80')]=_0x29b31d;_0xfdf506[_0x36df('0x81')]=_0x29b31d[_0x36df('0x82')];_0xfdf506[_0x36df('0x83')]=_0x29b31d[_0x36df('0x7d')];_0xfdf506['applications']=_[_0x36df('0x84')](_0xfdf506['applications'],[_0x36df('0x85')],['asc']);if(_0xfdf506[_0x36df('0x80')][_0x36df('0x82')]){delete _0xfdf506[_0x36df('0x80')][_0x36df('0x82')];}if(_0xfdf506[_0x36df('0x80')][_0x36df('0x7d')]&&_0xfdf506[_0x36df('0x80')][_0x36df('0x7d')][_0x36df('0x7e')][_0x36df('0x42')]){return _0xfdf506[_0x36df('0x80')][_0x36df('0x7d')][_0x36df('0x7e')][0x0];}var _0x22f783=_[_0x36df('0x17')](_0x4ddfb8[_0x36df('0x59')],{'firstName':_0x4ddfb8[_0x36df('0x59')]['from'],'ListId':_0x29b31d[_0x36df('0x75')]});_0x22f783[_0x4ddfb8[_0x36df('0x59')][_0x36df('0x7b')]]=_0x4ddfb8[_0x36df('0x59')][_0x36df('0x77')];return db[_0x36df('0x6d')][_0x36df('0x58')](_0x22f783,{'fields':_0x5ee633,'raw':!![]});}})[_0x36df('0x32')](handleEntityNotFound(_0x156107,null))['then'](function(_0x3c6de5){_0xfdf506['contact']=_0x3c6de5;if(_0x3c6de5){var _0x559771={'ContactId':_0x3c6de5['id'],'OpenchannelAccountId':_0x4ddfb8[_0x36df('0x54')]['id'],'from':(_0x3c6de5[_0x36df('0x86')]||'')+'\x20'+(_0x3c6de5[_0x36df('0x87')]||'')};var _0x355005={'OpenchannelAccountId':_0x4ddfb8[_0x36df('0x54')]['id'],'closed':![]};if(_0x4ddfb8[_0x36df('0x59')][_0x36df('0x88')]){_0x355005[_0x36df('0x88')]=_0x4ddfb8[_0x36df('0x59')][_0x36df('0x88')];return db[_0x36df('0x89')]['find']({'where':_0x355005})[_0x36df('0x32')](function(_0x4f8185){if(_0x4f8185){return[_0x4f8185,![]];}_0x559771[_0x36df('0x88')]=_0x4ddfb8[_0x36df('0x59')][_0x36df('0x88')];_0x559771['externalUrl']=_0x4ddfb8[_0x36df('0x59')][_0x36df('0x8a')];return db['OpenchannelInteraction'][_0x36df('0x58')](_0x559771)[_0x36df('0x32')](function(_0x3462eb){return[_0x3462eb,!![]];});});}else{_0x355005['threadId']=null;}_0x355005['ContactId']=_0x3c6de5['id'];return db[_0x36df('0x89')]['find']({'where':_0x355005})[_0x36df('0x32')](function(_0x46d709){if(_0x46d709){return[_0x46d709,![]];}return db[_0x36df('0x89')][_0x36df('0x58')](_0x559771)[_0x36df('0x32')](function(_0x806450){return[_0x806450,!![]];});});}})['spread'](function(_0x42a1d3,_0x4444fe){if(_0x42a1d3){_0x1e400a=_0x4444fe;if(!_0x4444fe){var _0x46ea5c={'from':(_0xfdf506[_0x36df('0x8b')][_0x36df('0x86')]||'')+'\x20'+(_0xfdf506['contact'][_0x36df('0x87')]||'')};if(_0x4ddfb8['body'][_0x36df('0x88')]&&_0x4ddfb8[_0x36df('0x59')][_0x36df('0x8c')]&&_0x4ddfb8[_0x36df('0x59')]['threadId']!=_0x4ddfb8['body'][_0x36df('0x8c')]){_0x46ea5c['threadId']=_0x4ddfb8[_0x36df('0x59')][_0x36df('0x8c')];}return _0x42a1d3['update'](_0x46ea5c);}else{return _0x42a1d3;}}})['then'](function(_0x145d75){_0xfdf506[_0x36df('0x8d')]=_0x145d75[_0x36df('0x34')]({'plain':!![]});_0xfdf506['interaction'][_0x36df('0x8e')]=_0x1e400a;if(_0xfdf506[_0x36df('0x8d')][_0x36df('0x8e')]){if(_0xfdf506['account'][_0x36df('0x8f')]){_0xfdf506[_0x36df('0x81')][_0x36df('0x90')]({'id':0x0,'priority':_0xfdf506[_0x36df('0x81')]['length']+0x1,'app':'close','appdata':_0x36df('0x91'),'interval':_0x36df('0x92')});}}return db[_0x36df('0x93')][_0x36df('0x58')]({'body':_0x4ddfb8[_0x36df('0x59')][_0x36df('0x59')],'OpenchannelAccountId':_0x4ddfb8[_0x36df('0x54')]['id'],'OpenchannelInteractionId':_0x145d75['id'],'direction':'in','ContactId':_0xfdf506[_0x36df('0x8b')]['id'],'AttachmentId':_0x4ddfb8[_0x36df('0x59')][_0x36df('0x94')]});})['then'](function(_0x1c18de){_0xfdf506[_0x36df('0x23')]=_0x1c18de;if(_0xfdf506['interaction']['UserId']){return db[_0x36df('0x95')][_0x36df('0x57')]({'attributes':['id',_0x36df('0x38')],'where':{'id':_0xfdf506[_0x36df('0x8d')][_0x36df('0x96')]}})[_0x36df('0x32')](function(_0x1243eb){if(_0x1243eb){_0xfdf506[_0x36df('0x81')][_0x36df('0x97')]({'id':0x0,'priority':0x0,'app':_0x36df('0x98'),'appdata':_0x1243eb[_0x36df('0x38')]+','+(_0xfdf506['account'][_0x36df('0x99')]||0xa),'interval':_0x36df('0x92')});_0xfdf506[_0x36df('0x9a')]=![];}return respondWithRpcPromise(_0x36df('0x9b'),_0x36df('0x9c'),_0xfdf506);});}return respondWithRpcPromise(_0x36df('0x9b'),_0x36df('0x9c'),_0xfdf506);})['then'](function(_0x179c98){respondWithRpcPromise(_0x36df('0x9d'),'EventManager',{'event':_0x36df('0x6b'),'message':_0x179c98},client9002);return _0x179c98;})[_0x36df('0x32')](respondWithResult(_0x156107,null))[_0x36df('0x25')](handleError(_0x156107,null));};exports['addApplications']=function(_0x423ee2,_0x2cb4d0){var _0x34e77c=_0x423ee2[_0x36df('0x54')]['id'];var _0x485406=_0x423ee2[_0x36df('0x59')];var _0x1357e1=0xc8;var _0x52ca24=null;return db[_0x36df('0x9e')][_0x36df('0x9f')]({'isolationLevel':db['sequelize']['Transaction'][_0x36df('0xa0')][_0x36df('0xa1')]},function(_0x507219){return db[_0x36df('0x4f')][_0x36df('0x63')]({'where':{'id':_0x34e77c},'transaction':_0x507219})['then'](function(_0x17c5a0){if(_0x17c5a0){return db[_0x36df('0x7f')][_0x36df('0x33')]({'where':{'OpenchannelAccountId':_0x34e77c},'transaction':_0x507219})[_0x36df('0x32')](function(){var _0x1d56ab=_[_0x36df('0x3a')](_0x485406,function(_0x57f8eb){_0x57f8eb[_0x36df('0x62')]=_0x34e77c;return _0x57f8eb;});return db[_0x36df('0x7f')]['bulkCreate'](_0x1d56ab,{'transaction':_0x507219});});}else{_0x1357e1=0x194;_0x52ca24=[];}});})[_0x36df('0x32')](function(){if(_0x1357e1!==0x194){return db[_0x36df('0x7f')][_0x36df('0xa2')]({'where':{'OpenchannelAccountId':_0x34e77c},'order':'priority'})[_0x36df('0x32')](function(_0x2aafa3){_0x52ca24=_0x2aafa3;});}})[_0x36df('0x25')](function(_0x5cc513){_0x1357e1=0x1f4;logger[_0x36df('0x22')](_0x5cc513[_0x36df('0x37')]);if(_0x5cc513[_0x36df('0x38')]){delete _0x5cc513[_0x36df('0x38')];}_0x52ca24=_0x5cc513;})['finally'](function(){if(_0x52ca24===null){_0x2cb4d0['sendStatus'](_0x1357e1);}else{if(_0x1357e1===0x1f4){_0x2cb4d0['status'](_0x1357e1)[_0x36df('0xa3')](_0x52ca24);}else{_0x2cb4d0[_0x36df('0x27')](_0x1357e1)[_0x36df('0x29')](_0x52ca24);}}});};exports[_0x36df('0xa4')]=function(_0x2c3581,_0x3541eb,_0x109e61){var _0x5454f3={};var _0x34efa6={};var _0x4ce928;var _0x4b9b94;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2c3581[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x3541eb,null))[_0x36df('0x32')](function(_0x2a65f4){if(_0x2a65f4){_0x4ce928=_0x2a65f4;_0x34efa6[_0x36df('0x3d')]=_['keys'](db[_0x36df('0x7f')][_0x36df('0x3b')]);_0x34efa6[_0x36df('0x3e')]=_[_0x36df('0x56')](_0x2c3581[_0x36df('0x3e')]);_0x34efa6[_0x36df('0x48')]=_[_0x36df('0x3f')](_0x34efa6['model'],_0x34efa6['query']);_0x5454f3['attributes']=_['intersection'](_0x34efa6['model'],qs[_0x36df('0x41')](_0x2c3581[_0x36df('0x3e')][_0x36df('0x41')]));_0x5454f3[_0x36df('0x40')]=_0x5454f3[_0x36df('0x40')]['length']?_0x5454f3[_0x36df('0x40')]:_0x34efa6[_0x36df('0x3d')];_0x5454f3[_0x36df('0x45')]=qs[_0x36df('0x46')](_0x2c3581[_0x36df('0x3e')][_0x36df('0x46')]);_0x5454f3[_0x36df('0x47')]=qs['filters'](_[_0x36df('0x49')](_0x2c3581[_0x36df('0x3e')],_0x34efa6[_0x36df('0x48')]));if(_0x2c3581[_0x36df('0x3e')][_0x36df('0x4d')]){_0x5454f3['where']=_['merge'](_0x5454f3[_0x36df('0x47')],{'$or':_['map'](_0x5454f3[_0x36df('0x40')],function(_0x293998){var _0x5086a8={};_0x5086a8[_0x293998]={'$like':'%'+_0x2c3581[_0x36df('0x3e')]['filter']+'%'};return _0x5086a8;})});}_0x5454f3=_[_0x36df('0x4a')]({},_0x5454f3,_0x2c3581[_0x36df('0x4e')]);return _0x4ce928[_0x36df('0xa4')](_0x5454f3);}})[_0x36df('0x32')](function(_0x4a0e1d){if(_0x4a0e1d){_0x4b9b94=_0x4a0e1d[_0x36df('0x42')];if(!_0x2c3581[_0x36df('0x3e')][_0x36df('0x43')]('nolimit')){_0x5454f3[_0x36df('0x2c')]=qs[_0x36df('0x2c')](_0x2c3581[_0x36df('0x3e')][_0x36df('0x2c')]);_0x5454f3[_0x36df('0x2a')]=qs[_0x36df('0x2a')](_0x2c3581[_0x36df('0x3e')][_0x36df('0x2a')]);}return _0x4ce928[_0x36df('0xa4')](_0x5454f3);}})['then'](function(_0x363d33){if(_0x363d33){return _0x363d33?{'count':_0x4b9b94,'rows':_0x363d33}:null;}})[_0x36df('0x32')](respondWithResult(_0x3541eb,null))[_0x36df('0x25')](handleError(_0x3541eb,null));};exports[_0x36df('0xa5')]=function(_0x8e9192,_0x3806c5,_0x260601){var _0x75f45e={'raw':![],'where':{}};var _0x1e4b77={};var _0x591372={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x36df('0x63')]({'where':{'id':_0x8e9192[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x3806c5,null))[_0x36df('0x32')](function(_0x23dfb8){if(_0x23dfb8){_0x1e4b77[_0x36df('0x3d')]=_[_0x36df('0x56')](db['OpenchannelInteraction'][_0x36df('0x3b')]);_0x1e4b77[_0x36df('0x3e')]=_[_0x36df('0x56')](_0x8e9192[_0x36df('0x3e')]);_0x1e4b77[_0x36df('0x48')]=_[_0x36df('0x3f')](_0x1e4b77[_0x36df('0x3d')],_0x1e4b77['query']);_0x75f45e[_0x36df('0x40')]=_[_0x36df('0x3f')](_0x1e4b77[_0x36df('0x3d')],qs[_0x36df('0x41')](_0x8e9192['query'][_0x36df('0x41')]));_0x75f45e[_0x36df('0x40')]=_0x75f45e[_0x36df('0x40')][_0x36df('0x42')]?_0x75f45e[_0x36df('0x40')]:_0x1e4b77['model'];if(!_0x8e9192[_0x36df('0x3e')][_0x36df('0x43')](_0x36df('0x44'))){_0x75f45e['limit']=qs[_0x36df('0x2c')](_0x8e9192[_0x36df('0x3e')][_0x36df('0x2c')]);_0x75f45e[_0x36df('0x2a')]=qs[_0x36df('0x2a')](_0x8e9192[_0x36df('0x3e')]['offset']);}_0x75f45e[_0x36df('0x45')]=qs[_0x36df('0x46')](_0x8e9192['query'][_0x36df('0x46')]);_0x75f45e[_0x36df('0x47')]=qs['filters'](_[_0x36df('0x49')](_0x8e9192[_0x36df('0x3e')],_0x1e4b77[_0x36df('0x48')]));_0x75f45e[_0x36df('0x47')][_0x36df('0x62')]=_0x23dfb8['id'];if(_0x8e9192['query'][_0x36df('0x4d')]){_0x75f45e['where']=_['merge'](_0x75f45e['where'],{'$or':_[_0x36df('0x3a')](_0x75f45e[_0x36df('0x40')],function(_0x17c913){var _0x5d05ed={};_0x5d05ed[_0x17c913]={'$like':'%'+_0x8e9192[_0x36df('0x3e')][_0x36df('0x4d')]+'%'};return _0x5d05ed;})});}_0x75f45e=_[_0x36df('0x4a')]({},_0x75f45e,_0x8e9192['options']);return db[_0x36df('0x89')][_0x36df('0x2d')]({'where':_0x75f45e['where']})[_0x36df('0x32')](function(_0x139742){_0x591372[_0x36df('0x2d')]=_0x139742;if(_0x8e9192[_0x36df('0x3e')][_0x36df('0x50')]){_0x75f45e['include']=[{'model':db[_0x36df('0x6d')],'as':_0x36df('0xa6'),'required':![]},{'model':db[_0x36df('0x95')],'as':'Owner','attributes':[_0x36df('0x38'),_0x36df('0xa7'),_0x36df('0xa8')],'required':![]},{'model':db[_0x36df('0xa9')],'as':_0x36df('0xaa'),'attributes':['id',_0x36df('0x38'),_0x36df('0xab')],'where':_0x8e9192[_0x36df('0x3e')][_0x36df('0xac')]?{'id':_0x8e9192[_0x36df('0x3e')][_0x36df('0xac')]}:undefined,'required':_0x8e9192[_0x36df('0x3e')][_0x36df('0xac')]?!![]:![]}];}return db[_0x36df('0x89')][_0x36df('0x52')](_0x75f45e);})[_0x36df('0x32')](function(_0x490939){_0x591372['rows']=_0x490939;return _0x591372;});}})[_0x36df('0x32')](respondWithFilteredResult(_0x3806c5,_0x75f45e))[_0x36df('0x25')](handleError(_0x3806c5,null));};exports['addAgents']=function(_0x84cb50,_0x486e9a,_0x11f16){return db[_0x36df('0x4f')]['find']({'where':{'id':_0x84cb50[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x486e9a,null))[_0x36df('0x32')](function(_0x11cdd0){if(_0x11cdd0){return _0x11cdd0[_0x36df('0xad')](_0x84cb50['body'][_0x36df('0x66')],_[_0x36df('0xae')](_0x84cb50[_0x36df('0x59')],[_0x36df('0x66'),'id'])||{})[_0x36df('0xaf')](function(_0x14e796){for(var _0x1148bf=0x0;_0x1148bf<_0x84cb50[_0x36df('0x59')][_0x36df('0x66')]['length'];_0x1148bf+=0x1){socket[_0x36df('0xb0')](_0x36df('0xb1'),{'UserId':Number(_0x84cb50[_0x36df('0x59')][_0x36df('0x66')][_0x1148bf]),'OpenchannelAccountId':Number(_0x84cb50[_0x36df('0x54')]['id'])});}return _0x14e796;});}})[_0x36df('0x32')](respondWithResult(_0x486e9a,null))['catch'](handleError(_0x486e9a,null));};exports[_0x36df('0xb2')]=function(_0x14d9fa,_0x33eb3c,_0x41a52d){return db['OpenchannelAccount'][_0x36df('0x57')]({'where':{'id':_0x14d9fa[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x33eb3c,null))[_0x36df('0x32')](function(_0xe5a0ef){if(_0xe5a0ef){return _0xe5a0ef['removeAgents'](_0x14d9fa[_0x36df('0x3e')][_0x36df('0x66')])[_0x36df('0x32')](function(){if(_[_0x36df('0xb3')](_0x14d9fa[_0x36df('0x3e')]['ids'])){for(var _0x405be5=0x0;_0x405be5<_0x14d9fa[_0x36df('0x3e')][_0x36df('0x66')][_0x36df('0x42')];_0x405be5+=0x1){socket[_0x36df('0xb0')](_0x36df('0xb4'),{'UserId':Number(_0x14d9fa[_0x36df('0x3e')][_0x36df('0x66')][_0x405be5]),'OpenchannelAccountId':Number(_0x14d9fa[_0x36df('0x54')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x14d9fa[_0x36df('0x3e')][_0x36df('0x66')]),'OpenchannelAccountId':Number(_0x14d9fa[_0x36df('0x54')]['id'])});}});}})[_0x36df('0x32')](respondWithStatusCode(_0x33eb3c,null))[_0x36df('0x25')](handleError(_0x33eb3c,null));};exports[_0x36df('0xb5')]=function(_0x3d37a6,_0x5cac69,_0x58bee3){var _0x59804e={};var _0x1aa772={};var _0x21e9b3;var _0x596fee;return db[_0x36df('0x4f')][_0x36df('0x63')]({'where':{'id':_0x3d37a6[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x5cac69,null))[_0x36df('0x32')](function(_0x44d834){if(_0x44d834){_0x21e9b3=_0x44d834;_0x1aa772[_0x36df('0x3d')]=_[_0x36df('0x56')](db['User']['rawAttributes']);_0x1aa772[_0x36df('0x3e')]=_[_0x36df('0x56')](_0x3d37a6[_0x36df('0x3e')]);_0x1aa772['filters']=_[_0x36df('0x3f')](_0x1aa772[_0x36df('0x3d')],_0x1aa772[_0x36df('0x3e')]);_0x59804e['attributes']=_['intersection'](_0x1aa772['model'],qs[_0x36df('0x41')](_0x3d37a6[_0x36df('0x3e')][_0x36df('0x41')]));_0x59804e[_0x36df('0x40')]=_0x59804e[_0x36df('0x40')][_0x36df('0x42')]?_0x59804e[_0x36df('0x40')]:_0x1aa772['model'];_0x59804e[_0x36df('0x45')]=qs[_0x36df('0x46')](_0x3d37a6[_0x36df('0x3e')][_0x36df('0x46')]);_0x59804e[_0x36df('0x47')]=qs[_0x36df('0x48')](_[_0x36df('0x49')](_0x3d37a6[_0x36df('0x3e')],_0x1aa772['filters']));if(_0x3d37a6[_0x36df('0x3e')]['filter']){_0x59804e[_0x36df('0x47')]=_[_0x36df('0x4a')](_0x59804e['where'],{'$or':_['map'](_0x59804e['attributes'],function(_0x2d6f77){var _0x5c34e8={};_0x5c34e8[_0x2d6f77]={'$like':'%'+_0x3d37a6[_0x36df('0x3e')][_0x36df('0x4d')]+'%'};return _0x5c34e8;})});}_0x59804e=_[_0x36df('0x4a')]({},_0x59804e,_0x3d37a6[_0x36df('0x4e')]);return _0x21e9b3[_0x36df('0xb5')](_0x59804e);}})[_0x36df('0x32')](function(_0x36f0a3){if(_0x36f0a3){_0x596fee=_0x36f0a3[_0x36df('0x42')];if(!_0x3d37a6['query'][_0x36df('0x43')](_0x36df('0x44'))){_0x59804e['limit']=qs[_0x36df('0x2c')](_0x3d37a6[_0x36df('0x3e')][_0x36df('0x2c')]);_0x59804e[_0x36df('0x2a')]=qs[_0x36df('0x2a')](_0x3d37a6['query'][_0x36df('0x2a')]);}return _0x21e9b3[_0x36df('0xb5')](_0x59804e);}})[_0x36df('0x32')](function(_0x17c1b1){if(_0x17c1b1){return _0x17c1b1?{'count':_0x596fee,'rows':_0x17c1b1}:null;}})[_0x36df('0x32')](respondWithResult(_0x5cac69,null))[_0x36df('0x25')](handleError(_0x5cac69,null));};exports[_0x36df('0xa3')]=function(_0x199c3a,_0x39b294,_0x13c279){var _0xb6cc4e,_0x15f0dd,_0x3f4905;if(_[_0x36df('0x76')](_0x199c3a[_0x36df('0x59')][_0x36df('0x59')])||_0x199c3a['body'][_0x36df('0x59')]===''){throw new db[(_0x36df('0x6e'))]['ValidationError'](_0x36df('0xb6'));}if(_[_0x36df('0x76')](_0x199c3a[_0x36df('0x59')]['to'])){}_0xb6cc4e=_0x199c3a[_0x36df('0x59')]['to'];return db[_0x36df('0x4f')][_0x36df('0x63')]({'where':{'id':_0x199c3a[_0x36df('0x54')]['id']}})[_0x36df('0x32')](handleEntityNotFound(_0x39b294,null))['then'](function(_0x276de3){if(_0x276de3){return db[_0x36df('0x4f')][_0x36df('0x57')]({'where':{'id':_0x276de3['id']},'include':[{'model':db[_0x36df('0xb7')],'as':_0x36df('0x7d'),'include':[{'model':db[_0x36df('0x6d')],'as':'Contacts','where':{[_0x276de3['mapKey']]:_0xb6cc4e},'limit':0x1,'order':[[_0x36df('0x73'),_0x36df('0xb8')]]}]}]})[_0x36df('0x32')](handleEntityNotFound(_0x39b294,null))[_0x36df('0x32')](function(_0x16444a){if(_0x16444a&&_0x16444a[_0x36df('0x7d')]){_0x15f0dd=_0x16444a[_0x36df('0x34')]({'plain':!![]});if(_0x15f0dd[_0x36df('0x7d')]&&_0x15f0dd[_0x36df('0x7d')]['Contacts']['length']){return _0x15f0dd[_0x36df('0x7d')][_0x36df('0x7e')][0x0];}return db[_0x36df('0x6d')][_0x36df('0x58')](_[_0x36df('0x17')](_0x199c3a['body'],{'firstName':_0xb6cc4e,[_0x16444a[_0x36df('0x7b')]]:_0xb6cc4e,'phone':_0xb6cc4e,'ListId':_0x15f0dd[_0x36df('0x75')]}));}})[_0x36df('0x32')](handleEntityNotFound(_0x39b294,null))['then'](function(_0x15bd5a){if(_0x15bd5a){_0x3f4905=_0x15bd5a;return db[_0x36df('0x89')][_0x36df('0x57')]({'where':{'ContactId':_0x3f4905['id'],'closed':![],'OpenchannelAccountId':_0x15f0dd['id']}})[_0x36df('0x32')](function(_0xa03974){if(_0xa03974){return[_0xa03974,![]];}return db['OpenchannelInteraction'][_0x36df('0x58')]({'UserId':_0x199c3a[_0x36df('0x5a')]['id'],'ContactId':_0x3f4905['id'],'OpenchannelAccountId':_0x15f0dd['id'],'lastMsgDirection':_0x36df('0xb9'),'Messages':[_[_0x36df('0x4a')](_0x199c3a[_0x36df('0x59')],{'read':![],'body':_0x199c3a[_0x36df('0x59')]['body'],'OpenchannelAccountId':_0x15f0dd['id'],'UserId':_0x199c3a[_0x36df('0x5a')]['id'],'ContactId':_0x3f4905['id']})]},{'include':[{'model':db[_0x36df('0x93')],'as':_0x36df('0xba')}]})[_0x36df('0x32')](function(_0x312b79){return[_0x312b79,!![]];});});}})['spread'](function(_0x3ff904,_0x453ad5){if(_0x453ad5){return _0x3ff904;}return db[_0x36df('0x93')][_0x36df('0x58')](_[_0x36df('0x4a')](_0x199c3a['body'],{'read':![],'body':_0x199c3a[_0x36df('0x59')][_0x36df('0x59')],'OpenchannelAccountId':_0x15f0dd['id'],'OpenchannelInteractionId':_0x3ff904['id'],'UserId':_0x199c3a[_0x36df('0x5a')]['id'],'ContactId':_0x3f4905['id']}))[_0x36df('0x32')](function(_0x1a4472){_0x3ff904[_0x36df('0xbb')]['Messages']=[];_0x3ff904[_0x36df('0xbb')]['Messages']['push'](_0x1a4472[_0x36df('0xbb')]);return _0x3ff904;});});}})[_0x36df('0x32')](respondWithResult(_0x39b294,null))[_0x36df('0x25')](handleError(_0x39b294,null));}; \ No newline at end of file +var _0x3d5d=['firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','params','rawAttributes','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','priority','asc','CmContact','contact'];(function(_0x57aa0c,_0x2a7241){var _0x47dcad=function(_0x493abf){while(--_0x493abf){_0x57aa0c['push'](_0x57aa0c['shift']());}};_0x47dcad(++_0x2a7241);}(_0x3d5d,0xef));var _0xd3d5=function(_0x2e7f96,_0x2ffe43){_0x2e7f96=_0x2e7f96-0x0;var _0x315277=_0x3d5d[_0x2e7f96];return _0x315277;};'use strict';var emlformat=require(_0xd3d5('0x0'));var rimraf=require(_0xd3d5('0x1'));var zipdir=require(_0xd3d5('0x2'));var jsonpatch=require(_0xd3d5('0x3'));var rp=require(_0xd3d5('0x4'));var moment=require(_0xd3d5('0x5'));var BPromise=require(_0xd3d5('0x6'));var Mustache=require(_0xd3d5('0x7'));var util=require('util');var path=require(_0xd3d5('0x8'));var sox=require(_0xd3d5('0x9'));var csv=require('to-csv');var ejs=require(_0xd3d5('0xa'));var fs=require('fs');var fs_extra=require(_0xd3d5('0xb'));var _=require(_0xd3d5('0xc'));var squel=require(_0xd3d5('0xd'));var crypto=require('crypto');var jsforce=require(_0xd3d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd3d5('0xf'));var querystring=require(_0xd3d5('0x10'));var Papa=require(_0xd3d5('0x11'));var Redis=require('ioredis');var authService=require(_0xd3d5('0x12'));var qs=require(_0xd3d5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3d5('0x14'))(_0xd3d5('0x15'));var utils=require(_0xd3d5('0x16'));var config=require(_0xd3d5('0x17'));var licenseUtil=require(_0xd3d5('0x18'));var db=require(_0xd3d5('0x19'))['db'];config['redis']=_[_0xd3d5('0x1a')](config['redis'],{'host':_0xd3d5('0x1b'),'port':0x18eb});var socket=require(_0xd3d5('0x1c'))(new Redis(config[_0xd3d5('0x1d')]));require(_0xd3d5('0x1e'))[_0xd3d5('0x1f')](socket);var jayson=require(_0xd3d5('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xd3d5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4d0940,_0x4f6f90,_0x5ae012,_0x223a4c){return new BPromise(function(_0x5d6238,_0x2aa455){var _0x5b2d6c=_0x223a4c||client;return _0x5b2d6c[_0xd3d5('0x22')](_0x4d0940,_0x5ae012)[_0xd3d5('0x23')](function(_0x25664f){logger[_0xd3d5('0x24')](_0xd3d5('0x25'),_0x4f6f90,'request\x20sent');logger[_0xd3d5('0x26')](_0xd3d5('0x27'),_0x4f6f90,_0xd3d5('0x28'),JSON['stringify'](_0x25664f));if(_0x25664f[_0xd3d5('0x29')]){if(_0x25664f['error']['code']===0x1f4){logger[_0xd3d5('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f6f90,_0x25664f[_0xd3d5('0x29')][_0xd3d5('0x2a')]);return _0x2aa455(_0x25664f[_0xd3d5('0x29')][_0xd3d5('0x2a')]);}logger['error'](_0xd3d5('0x25'),_0x4f6f90,_0x25664f['error'][_0xd3d5('0x2a')]);return _0x5d6238(_0x25664f[_0xd3d5('0x29')][_0xd3d5('0x2a')]);}else{logger[_0xd3d5('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f6f90,_0xd3d5('0x28'));_0x5d6238(_0x25664f[_0xd3d5('0x2b')]['message']);}})[_0xd3d5('0x2c')](function(_0x277a67){logger[_0xd3d5('0x29')](_0xd3d5('0x25'),_0x4f6f90,_0x277a67);_0x2aa455(_0x277a67);});});}function respondWithStatusCode(_0x54bf3d,_0x732251){_0x732251=_0x732251||0xcc;return function(_0x5f2f0c){if(_0x5f2f0c){return _0x54bf3d[_0xd3d5('0x2d')](_0x732251);}return _0x54bf3d[_0xd3d5('0x2e')](_0x732251)[_0xd3d5('0x2f')]();};}function respondWithResult(_0x46a622,_0x2f0a8b){_0x2f0a8b=_0x2f0a8b||0xc8;return function(_0x52d6d9){if(_0x52d6d9){return _0x46a622['status'](_0x2f0a8b)[_0xd3d5('0x30')](_0x52d6d9);}};}function respondWithFilteredResult(_0xf47cb3,_0x4582c9){return function(_0x404662){if(_0x404662){var _0x546c7e=typeof _0x4582c9[_0xd3d5('0x31')]===_0xd3d5('0x32')&&typeof _0x4582c9[_0xd3d5('0x33')]==='undefined';var _0x483df9=_0x404662[_0xd3d5('0x34')];var _0x1de4e0=_0x546c7e?0x0:_0x4582c9[_0xd3d5('0x31')];var _0xe6c23e=_0x546c7e?_0x404662[_0xd3d5('0x34')]:_0x4582c9['offset']+_0x4582c9['limit'];var _0x5b9bf3;if(_0xe6c23e>=_0x483df9){_0xe6c23e=_0x483df9;_0x5b9bf3=0xc8;}else{_0x5b9bf3=0xce;}_0xf47cb3[_0xd3d5('0x2e')](_0x5b9bf3);return _0xf47cb3[_0xd3d5('0x35')](_0xd3d5('0x36'),_0x1de4e0+'-'+_0xe6c23e+'/'+_0x483df9)[_0xd3d5('0x30')](_0x404662);}return null;};}function patchUpdates(_0x3869a1){return function(_0x1ef619){try{jsonpatch[_0xd3d5('0x37')](_0x1ef619,_0x3869a1,!![]);}catch(_0x391e74){return BPromise['reject'](_0x391e74);}return _0x1ef619['save']();};}function saveUpdates(_0x3b6975,_0x12df46){return function(_0x37be65){if(_0x37be65){return _0x37be65[_0xd3d5('0x38')](_0x3b6975)['then'](function(_0xcaf06e){return _0xcaf06e;});}return null;};}function removeEntity(_0x2795f6,_0x26809e){return function(_0x31cf89){if(_0x31cf89){return _0x31cf89[_0xd3d5('0x39')]()['then'](function(){var _0x43b462=_0x31cf89['get']({'plain':!![]});var _0x1fe17=_0xd3d5('0x3a');return db[_0xd3d5('0x3b')][_0xd3d5('0x39')]({'where':{'type':_0x1fe17,'resourceId':_0x43b462['id']}})[_0xd3d5('0x23')](function(){return _0x31cf89;});})[_0xd3d5('0x23')](function(){_0x2795f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28cdb3,_0x4a883d){return function(_0x3a094c){if(!_0x3a094c){_0x28cdb3['sendStatus'](0x194);}return _0x3a094c;};}function handleError(_0xa70db2,_0x23aacb){_0x23aacb=_0x23aacb||0x1f4;return function(_0x4ba167){logger[_0xd3d5('0x29')](_0x4ba167[_0xd3d5('0x3c')]);if(_0x4ba167[_0xd3d5('0x3d')]){delete _0x4ba167[_0xd3d5('0x3d')];}_0xa70db2[_0xd3d5('0x2e')](_0x23aacb)['send'](_0x4ba167);};}exports[_0xd3d5('0x3e')]=function(_0x6fc998,_0x18c7af){var _0x2a6a32={'include':[{'model':db[_0xd3d5('0x3f')],'as':_0xd3d5('0x40')}]},_0x2bcdf0={},_0x51f35a={'count':0x0,'rows':[]};var _0x58d6e0=_[_0xd3d5('0x41')](db[_0xd3d5('0x42')]['rawAttributes'],function(_0x3fac94){return{'name':_0x3fac94[_0xd3d5('0x43')],'type':_0x3fac94[_0xd3d5('0x44')][_0xd3d5('0x45')]};});_0x2bcdf0[_0xd3d5('0x46')]=_[_0xd3d5('0x41')](_0x58d6e0,_0xd3d5('0x3d'));_0x2bcdf0[_0xd3d5('0x47')]=_[_0xd3d5('0x48')](_0x6fc998[_0xd3d5('0x47')]);_0x2bcdf0[_0xd3d5('0x49')]=_[_0xd3d5('0x4a')](_0x2bcdf0['model'],_0x2bcdf0[_0xd3d5('0x47')]);_0x2a6a32[_0xd3d5('0x4b')]=_[_0xd3d5('0x4a')](_0x2bcdf0['model'],qs[_0xd3d5('0x4c')](_0x6fc998[_0xd3d5('0x47')]['fields']));_0x2a6a32[_0xd3d5('0x4b')]=_0x2a6a32[_0xd3d5('0x4b')][_0xd3d5('0x4d')]?_0x2a6a32[_0xd3d5('0x4b')]:_0x2bcdf0['model'];if(!_0x6fc998[_0xd3d5('0x47')][_0xd3d5('0x4e')](_0xd3d5('0x4f'))){_0x2a6a32['limit']=qs[_0xd3d5('0x33')](_0x6fc998['query']['limit']);_0x2a6a32['offset']=qs[_0xd3d5('0x31')](_0x6fc998[_0xd3d5('0x47')]['offset']);}_0x2a6a32[_0xd3d5('0x50')]=qs[_0xd3d5('0x51')](_0x6fc998[_0xd3d5('0x47')]['sort']);_0x2a6a32[_0xd3d5('0x52')]=qs[_0xd3d5('0x49')](_['pick'](_0x6fc998[_0xd3d5('0x47')],_0x2bcdf0[_0xd3d5('0x49')]),_0x58d6e0);if(_0x6fc998[_0xd3d5('0x47')][_0xd3d5('0x53')]){_0x2a6a32[_0xd3d5('0x52')]=_[_0xd3d5('0x54')](_0x2a6a32[_0xd3d5('0x52')],{'$or':_[_0xd3d5('0x41')](_0x58d6e0,function(_0x5b494d){if(_0x5b494d[_0xd3d5('0x44')]!=='VIRTUAL'){var _0x3f58d1={};_0x3f58d1[_0x5b494d[_0xd3d5('0x3d')]]={'$like':'%'+_0x6fc998[_0xd3d5('0x47')][_0xd3d5('0x53')]+'%'};return _0x3f58d1;}})});}_0x2a6a32=_[_0xd3d5('0x54')]({},_0x2a6a32,_0x6fc998[_0xd3d5('0x55')]);var _0x5b2e6c={'where':_0x2a6a32['where']};return db['OpenchannelAccount'][_0xd3d5('0x34')](_0x5b2e6c)['then'](function(_0x1c5127){_0x51f35a['count']=_0x1c5127;if(_0x6fc998[_0xd3d5('0x47')]['includeAll']){_0x2a6a32['include']=[{'all':!![]}];}return db[_0xd3d5('0x42')][_0xd3d5('0x56')](_0x2a6a32);})['then'](function(_0x4b9237){_0x51f35a[_0xd3d5('0x57')]=_0x4b9237;return _0x51f35a;})[_0xd3d5('0x23')](respondWithFilteredResult(_0x18c7af,_0x2a6a32))[_0xd3d5('0x2c')](handleError(_0x18c7af,null));};exports['show']=function(_0x1b5ea9,_0x6d2a51){var _0x48c54c={'raw':![],'where':{'id':_0x1b5ea9[_0xd3d5('0x58')]['id']},'include':[{'model':db[_0xd3d5('0x3f')],'as':_0xd3d5('0x40')}]},_0x390e25={};_0x390e25[_0xd3d5('0x46')]=_[_0xd3d5('0x48')](db[_0xd3d5('0x42')][_0xd3d5('0x59')]);_0x390e25[_0xd3d5('0x47')]=_[_0xd3d5('0x48')](_0x1b5ea9[_0xd3d5('0x47')]);_0x390e25['filters']=_[_0xd3d5('0x4a')](_0x390e25[_0xd3d5('0x46')],_0x390e25['query']);_0x48c54c['attributes']=_[_0xd3d5('0x4a')](_0x390e25[_0xd3d5('0x46')],qs[_0xd3d5('0x4c')](_0x1b5ea9[_0xd3d5('0x47')]['fields']));_0x48c54c[_0xd3d5('0x4b')]=_0x48c54c[_0xd3d5('0x4b')][_0xd3d5('0x4d')]?_0x48c54c[_0xd3d5('0x4b')]:_0x390e25[_0xd3d5('0x46')];if(_0x1b5ea9[_0xd3d5('0x47')][_0xd3d5('0x5a')]){_0x48c54c[_0xd3d5('0x5b')]=[{'all':!![]}];}_0x48c54c=_[_0xd3d5('0x54')]({},_0x48c54c,_0x1b5ea9[_0xd3d5('0x55')]);return db[_0xd3d5('0x42')]['find'](_0x48c54c)[_0xd3d5('0x23')](handleEntityNotFound(_0x6d2a51,null))[_0xd3d5('0x23')](respondWithResult(_0x6d2a51,null))[_0xd3d5('0x2c')](handleError(_0x6d2a51,null));};exports[_0xd3d5('0x5c')]=function(_0x4cfbba,_0x4bed78){return db[_0xd3d5('0x42')]['create'](_0x4cfbba[_0xd3d5('0x5d')],{})['then'](function(_0x31f3e3){var _0x41420e=_0x4cfbba[_0xd3d5('0x5e')][_0xd3d5('0x5f')]({'plain':!![]});if(!_0x41420e)throw new Error(_0xd3d5('0x60'));if(_0x41420e[_0xd3d5('0x61')]==='user'){var _0x155bdc=_0x31f3e3['get']({'plain':!![]});var _0xe99389=_0xd3d5('0x3a');return db['UserProfileSection'][_0xd3d5('0x62')]({'where':{'name':_0xe99389,'userProfileId':_0x41420e[_0xd3d5('0x63')]},'raw':!![]})[_0xd3d5('0x23')](function(_0x35529f){if(_0x35529f&&_0x35529f[_0xd3d5('0x64')]===0x0){return db[_0xd3d5('0x3b')][_0xd3d5('0x5c')]({'name':_0x155bdc[_0xd3d5('0x3d')],'resourceId':_0x155bdc['id'],'type':_0x35529f['name'],'sectionId':_0x35529f['id']},{})[_0xd3d5('0x23')](function(){return _0x31f3e3;});}else{return _0x31f3e3;}})[_0xd3d5('0x2c')](function(_0x59f3c8){logger[_0xd3d5('0x29')](_0xd3d5('0x65'),_0x59f3c8);throw _0x59f3c8;});}return _0x31f3e3;})[_0xd3d5('0x23')](respondWithResult(_0x4bed78,0xc9))['catch'](handleError(_0x4bed78,null));};exports['update']=function(_0x135a7a,_0x15b7b1){if(_0x135a7a['body']['id']){delete _0x135a7a['body']['id'];}return db['OpenchannelAccount'][_0xd3d5('0x62')]({'where':{'id':_0x135a7a[_0xd3d5('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xd3d5('0x40')}]})[_0xd3d5('0x23')](handleEntityNotFound(_0x15b7b1,null))[_0xd3d5('0x23')](saveUpdates(_0x135a7a[_0xd3d5('0x5d')],null))[_0xd3d5('0x23')](respondWithResult(_0x15b7b1,null))[_0xd3d5('0x2c')](handleError(_0x15b7b1,null));};exports['destroy']=function(_0x465217,_0x1aa381){return db[_0xd3d5('0x42')][_0xd3d5('0x62')]({'where':{'id':_0x465217[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x1aa381,null))['then'](removeEntity(_0x1aa381,null))['catch'](handleError(_0x1aa381,null));};exports[_0xd3d5('0x66')]=function(_0x11229f,_0x1ee43a){return db['OpenchannelAccount'][_0xd3d5('0x66')]()[_0xd3d5('0x23')](respondWithResult(_0x1ee43a,null))[_0xd3d5('0x2c')](handleError(_0x1ee43a,null));};exports[_0xd3d5('0x67')]=function(_0x4166b2,_0x2fbf96,_0x5bbd41){if(_0x4166b2[_0xd3d5('0x5d')]['id']){delete _0x4166b2[_0xd3d5('0x5d')]['id'];}return db[_0xd3d5('0x42')][_0xd3d5('0x62')]({'where':{'id':_0x4166b2['params']['id']}})['then'](handleEntityNotFound(_0x2fbf96,null))[_0xd3d5('0x23')](function(_0x2e74c9){if(_0x2e74c9){_0x4166b2['body'][_0xd3d5('0x68')]=_0x2e74c9['id'];return db[_0xd3d5('0x69')][_0xd3d5('0x5c')](_0x4166b2['body']);}})[_0xd3d5('0x23')](respondWithResult(_0x2fbf96,null))[_0xd3d5('0x2c')](handleError(_0x2fbf96,null));};exports[_0xd3d5('0x6a')]=function(_0x310b1c,_0x52ee03,_0x428afc){var _0x4ab33d={'raw':![],'where':{}};var _0x1bac7b={};var _0x3739ef={'count':0x0,'rows':[]};return db[_0xd3d5('0x42')][_0xd3d5('0x6b')]({'where':{'id':_0x310b1c[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x52ee03,null))[_0xd3d5('0x23')](function(_0x467356){if(_0x467356){_0x1bac7b['model']=_[_0xd3d5('0x48')](db['Disposition'][_0xd3d5('0x59')]);_0x1bac7b[_0xd3d5('0x47')]=_['keys'](_0x310b1c[_0xd3d5('0x47')]);_0x1bac7b[_0xd3d5('0x49')]=_[_0xd3d5('0x4a')](_0x1bac7b[_0xd3d5('0x46')],_0x1bac7b[_0xd3d5('0x47')]);_0x4ab33d[_0xd3d5('0x4b')]=_['intersection'](_0x1bac7b['model'],qs[_0xd3d5('0x4c')](_0x310b1c[_0xd3d5('0x47')][_0xd3d5('0x4c')]));_0x4ab33d[_0xd3d5('0x4b')]=_0x4ab33d[_0xd3d5('0x4b')][_0xd3d5('0x4d')]?_0x4ab33d[_0xd3d5('0x4b')]:_0x1bac7b[_0xd3d5('0x46')];if(!_0x310b1c[_0xd3d5('0x47')]['hasOwnProperty'](_0xd3d5('0x4f'))){_0x4ab33d[_0xd3d5('0x33')]=qs[_0xd3d5('0x33')](_0x310b1c[_0xd3d5('0x47')]['limit']);_0x4ab33d['offset']=qs[_0xd3d5('0x31')](_0x310b1c[_0xd3d5('0x47')]['offset']);}_0x4ab33d[_0xd3d5('0x50')]=qs['sort'](_0x310b1c['query']['sort']);_0x4ab33d[_0xd3d5('0x52')]=qs['filters'](_['pick'](_0x310b1c['query'],_0x1bac7b['filters']));_0x4ab33d['where']['OpenchannelAccountId']=_0x467356['id'];if(_0x310b1c[_0xd3d5('0x47')]['filter']){_0x4ab33d[_0xd3d5('0x52')]=_[_0xd3d5('0x54')](_0x4ab33d[_0xd3d5('0x52')],{'$or':_[_0xd3d5('0x41')](_0x4ab33d[_0xd3d5('0x4b')],function(_0x555a9f){var _0x4301bb={};_0x4301bb[_0x555a9f]={'$like':'%'+_0x310b1c['query'][_0xd3d5('0x53')]+'%'};return _0x4301bb;})});}_0x4ab33d=_[_0xd3d5('0x54')]({},_0x4ab33d,_0x310b1c[_0xd3d5('0x55')]);return db[_0xd3d5('0x69')][_0xd3d5('0x34')]({'where':_0x4ab33d[_0xd3d5('0x52')]})[_0xd3d5('0x23')](function(_0x307e28){_0x3739ef[_0xd3d5('0x34')]=_0x307e28;if(_0x310b1c[_0xd3d5('0x47')]['includeAll']){_0x4ab33d[_0xd3d5('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xd3d5('0x56')](_0x4ab33d);})[_0xd3d5('0x23')](function(_0xded219){_0x3739ef[_0xd3d5('0x57')]=_0xded219;return _0x3739ef;});}})[_0xd3d5('0x23')](respondWithFilteredResult(_0x52ee03,_0x4ab33d))[_0xd3d5('0x2c')](handleError(_0x52ee03,null));};exports['removeDispositions']=function(_0x17edb0,_0x3cedcf,_0xa4fc66){return db[_0xd3d5('0x42')][_0xd3d5('0x62')]({'where':{'id':_0x17edb0[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x3cedcf,null))[_0xd3d5('0x23')](function(_0x6a7545){if(_0x6a7545){return _0x6a7545[_0xd3d5('0x6c')](_0x17edb0[_0xd3d5('0x47')][_0xd3d5('0x6d')]);}})['then'](respondWithStatusCode(_0x3cedcf,null))[_0xd3d5('0x2c')](handleError(_0x3cedcf,null));};exports[_0xd3d5('0x6e')]=function(_0x5a2ee4,_0x29a4bf,_0x55f246){if(_0x5a2ee4[_0xd3d5('0x5d')]['id']){delete _0x5a2ee4[_0xd3d5('0x5d')]['id'];}return db['OpenchannelAccount'][_0xd3d5('0x62')]({'where':{'id':_0x5a2ee4['params']['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x29a4bf,null))[_0xd3d5('0x23')](function(_0x5705e6){if(_0x5705e6){_0x5a2ee4['body']['OpenchannelAccountId']=_0x5705e6['id'];return db['CannedAnswer'][_0xd3d5('0x5c')](_0x5a2ee4[_0xd3d5('0x5d')]);}})[_0xd3d5('0x23')](respondWithResult(_0x29a4bf,null))[_0xd3d5('0x2c')](handleError(_0x29a4bf,null));};exports[_0xd3d5('0x6f')]=function(_0x249913,_0x5f45e0,_0x3a8ddd){var _0x180773={'raw':![],'where':{}};var _0x28f757={};var _0x35a73f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd3d5('0x6b')]({'where':{'id':_0x249913['params']['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x5f45e0,null))[_0xd3d5('0x23')](function(_0x244581){if(_0x244581){_0x28f757[_0xd3d5('0x46')]=_[_0xd3d5('0x48')](db[_0xd3d5('0x70')]['rawAttributes']);_0x28f757['query']=_[_0xd3d5('0x48')](_0x249913[_0xd3d5('0x47')]);_0x28f757[_0xd3d5('0x49')]=_[_0xd3d5('0x4a')](_0x28f757[_0xd3d5('0x46')],_0x28f757[_0xd3d5('0x47')]);_0x180773['attributes']=_[_0xd3d5('0x4a')](_0x28f757[_0xd3d5('0x46')],qs[_0xd3d5('0x4c')](_0x249913[_0xd3d5('0x47')][_0xd3d5('0x4c')]));_0x180773['attributes']=_0x180773[_0xd3d5('0x4b')]['length']?_0x180773['attributes']:_0x28f757[_0xd3d5('0x46')];if(!_0x249913['query'][_0xd3d5('0x4e')](_0xd3d5('0x4f'))){_0x180773['limit']=qs['limit'](_0x249913['query'][_0xd3d5('0x33')]);_0x180773[_0xd3d5('0x31')]=qs[_0xd3d5('0x31')](_0x249913[_0xd3d5('0x47')]['offset']);}_0x180773[_0xd3d5('0x50')]=qs['sort'](_0x249913[_0xd3d5('0x47')][_0xd3d5('0x51')]);_0x180773[_0xd3d5('0x52')]=qs[_0xd3d5('0x49')](_[_0xd3d5('0x71')](_0x249913[_0xd3d5('0x47')],_0x28f757[_0xd3d5('0x49')]));_0x180773['where']['OpenchannelAccountId']=_0x244581['id'];if(_0x249913['query'][_0xd3d5('0x53')]){_0x180773['where']=_[_0xd3d5('0x54')](_0x180773[_0xd3d5('0x52')],{'$or':_['map'](_0x180773[_0xd3d5('0x4b')],function(_0xb04e55){var _0x347d77={};_0x347d77[_0xb04e55]={'$like':'%'+_0x249913[_0xd3d5('0x47')][_0xd3d5('0x53')]+'%'};return _0x347d77;})});}_0x180773=_[_0xd3d5('0x54')]({},_0x180773,_0x249913[_0xd3d5('0x55')]);return db[_0xd3d5('0x70')][_0xd3d5('0x34')]({'where':_0x180773[_0xd3d5('0x52')]})['then'](function(_0x5c1fed){_0x35a73f[_0xd3d5('0x34')]=_0x5c1fed;if(_0x249913[_0xd3d5('0x47')]['includeAll']){_0x180773['include']=[{'all':!![]}];}return db[_0xd3d5('0x70')][_0xd3d5('0x56')](_0x180773);})[_0xd3d5('0x23')](function(_0x4ec974){_0x35a73f['rows']=_0x4ec974;return _0x35a73f;});}})[_0xd3d5('0x23')](respondWithFilteredResult(_0x5f45e0,_0x180773))[_0xd3d5('0x2c')](handleError(_0x5f45e0,null));};exports[_0xd3d5('0x72')]=function(_0x40e10e,_0x23d788,_0x5f518a){return db[_0xd3d5('0x42')][_0xd3d5('0x62')]({'where':{'id':_0x40e10e[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x23d788,null))[_0xd3d5('0x23')](function(_0x1a23eb){if(_0x1a23eb){return _0x1a23eb[_0xd3d5('0x72')](_0x40e10e[_0xd3d5('0x47')][_0xd3d5('0x6d')]);}})[_0xd3d5('0x23')](respondWithStatusCode(_0x23d788,null))[_0xd3d5('0x2c')](handleError(_0x23d788,null));};exports[_0xd3d5('0x73')]=function(_0x3e6a5e,_0x571ca7,_0x31c1bb){var _0x44e97f={'body':_0x3e6a5e[_0xd3d5('0x5d')],'channel':_0xd3d5('0x74')};var _0x441adb=[];var _0x4a0fa6=[];var _0x772658={};var _0xfc6730=![];return db['CmContact'][_0xd3d5('0x66')]()[_0xd3d5('0x23')](function(_0x2845ee){if(!_0x2845ee){throw new db[(_0xd3d5('0x75'))][(_0xd3d5('0x76'))](_0xd3d5('0x77'));}_0x441adb=_['difference'](_[_0xd3d5('0x48')](_0x2845ee),['createdAt',_0xd3d5('0x78')]);_0x4a0fa6=_[_0xd3d5('0x79')](_['keys'](_0x2845ee),['createdAt',_0xd3d5('0x78'),_0xd3d5('0x7a'),_0xd3d5('0x7b')]);if(_0x3e6a5e[_0xd3d5('0x5d')]['id']){delete _0x3e6a5e[_0xd3d5('0x5d')]['id'];}if(_['isNil'](_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x7c')])){throw new db[(_0xd3d5('0x75'))]['ValidationError'](_0xd3d5('0x7d'));}if(_[_0xd3d5('0x7e')](_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x5d')])||_0x3e6a5e['body'][_0xd3d5('0x5d')]===''){throw new db[(_0xd3d5('0x75'))][(_0xd3d5('0x76'))](_0xd3d5('0x7f'));}if(_[_0xd3d5('0x7e')](_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x80')])){throw new db[(_0xd3d5('0x75'))]['ValidationError'](_0xd3d5('0x81')+_0x4a0fa6);}if(!_[_0xd3d5('0x82')](_0x4a0fa6,_0x3e6a5e['body'][_0xd3d5('0x80')])){throw new db[(_0xd3d5('0x75'))][(_0xd3d5('0x76'))](_0xd3d5('0x83')+_0x4a0fa6);}_0x772658[_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x80')]]=_0x3e6a5e[_0xd3d5('0x5d')]['from'];})[_0xd3d5('0x23')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x3e6a5e[_0xd3d5('0x58')]['id']},'include':[{'model':db[_0xd3d5('0x84')],'as':'List','include':[{'model':db['CmContact'],'as':_0xd3d5('0x85'),'where':_0x772658,'limit':0x1,'order':[['updatedAt',_0xd3d5('0x86')]]}]},{'model':db[_0xd3d5('0x87')],'as':_0xd3d5('0x88')}]});})[_0xd3d5('0x23')](handleEntityNotFound(_0x571ca7,null))[_0xd3d5('0x23')](function(_0x2aed29){if(_0x2aed29&&_0x2aed29[_0xd3d5('0x89')]){_0x44e97f[_0xd3d5('0x8a')]=_0x2aed29;_0x44e97f[_0xd3d5('0x8b')]=_0x2aed29['Applications'];_0x44e97f[_0xd3d5('0x8c')]=_0x2aed29[_0xd3d5('0x89')];_0x44e97f[_0xd3d5('0x8b')]=_['orderBy'](_0x44e97f[_0xd3d5('0x8b')],[_0xd3d5('0x8d')],[_0xd3d5('0x8e')]);if(_0x44e97f[_0xd3d5('0x8a')][_0xd3d5('0x88')]){delete _0x44e97f['account']['Applications'];}if(_0x44e97f['account'][_0xd3d5('0x89')]&&_0x44e97f[_0xd3d5('0x8a')][_0xd3d5('0x89')][_0xd3d5('0x85')]['length']){return _0x44e97f[_0xd3d5('0x8a')]['List'][_0xd3d5('0x85')][0x0];}var _0x3adc85=_['defaults'](_0x3e6a5e[_0xd3d5('0x5d')],{'firstName':_0x3e6a5e['body'][_0xd3d5('0x7c')],'ListId':_0x2aed29[_0xd3d5('0x7b')]});_0x3adc85[_0x3e6a5e[_0xd3d5('0x5d')]['mapKey']]=_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x7c')];return db[_0xd3d5('0x8f')]['create'](_0x3adc85,{'fields':_0x441adb,'raw':!![]});}})[_0xd3d5('0x23')](handleEntityNotFound(_0x571ca7,null))[_0xd3d5('0x23')](function(_0x1d7c3e){_0x44e97f[_0xd3d5('0x90')]=_0x1d7c3e;if(_0x1d7c3e){var _0x3352ea={'ContactId':_0x1d7c3e['id'],'OpenchannelAccountId':_0x3e6a5e[_0xd3d5('0x58')]['id'],'from':(_0x1d7c3e[_0xd3d5('0x91')]||'')+'\x20'+(_0x1d7c3e[_0xd3d5('0x92')]||'')};var _0x3b6efa={'OpenchannelAccountId':_0x3e6a5e[_0xd3d5('0x58')]['id'],'closed':![]};if(_0x3e6a5e[_0xd3d5('0x5d')]['threadId']){_0x3b6efa[_0xd3d5('0x93')]=_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x93')];return db[_0xd3d5('0x94')][_0xd3d5('0x62')]({'where':_0x3b6efa})['then'](function(_0x4a6cd4){if(_0x4a6cd4){return[_0x4a6cd4,![]];}_0x3352ea['threadId']=_0x3e6a5e['body'][_0xd3d5('0x93')];_0x3352ea[_0xd3d5('0x95')]=_0x3e6a5e['body']['externalUrl'];return db[_0xd3d5('0x94')][_0xd3d5('0x5c')](_0x3352ea)[_0xd3d5('0x23')](function(_0x1739a9){return[_0x1739a9,!![]];});});}else{_0x3b6efa['threadId']=null;}_0x3b6efa[_0xd3d5('0x96')]=_0x1d7c3e['id'];return db[_0xd3d5('0x94')][_0xd3d5('0x62')]({'where':_0x3b6efa})['then'](function(_0x3fe83d){if(_0x3fe83d){return[_0x3fe83d,![]];}return db[_0xd3d5('0x94')][_0xd3d5('0x5c')](_0x3352ea)[_0xd3d5('0x23')](function(_0x63862){return[_0x63862,!![]];});});}})[_0xd3d5('0x97')](function(_0x91d2c8,_0x1aaef8){if(_0x91d2c8){_0xfc6730=_0x1aaef8;if(!_0x1aaef8){var _0x1ce8d3={'from':(_0x44e97f[_0xd3d5('0x90')][_0xd3d5('0x91')]||'')+'\x20'+(_0x44e97f['contact'][_0xd3d5('0x92')]||'')};if(_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x93')]&&_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x98')]&&_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x93')]!=_0x3e6a5e['body'][_0xd3d5('0x98')]){_0x1ce8d3[_0xd3d5('0x93')]=_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x98')];}return _0x91d2c8[_0xd3d5('0x38')](_0x1ce8d3);}else{return _0x91d2c8;}}})[_0xd3d5('0x23')](function(_0x4b6f9c){_0x44e97f[_0xd3d5('0x99')]=_0x4b6f9c['get']({'plain':!![]});_0x44e97f['interaction'][_0xd3d5('0x9a')]=_0xfc6730;if(_0x44e97f[_0xd3d5('0x99')][_0xd3d5('0x9a')]){if(_0x44e97f[_0xd3d5('0x8a')][_0xd3d5('0x9b')]){_0x44e97f['applications'][_0xd3d5('0x9c')]({'id':0x0,'priority':_0x44e97f[_0xd3d5('0x8b')]['length']+0x1,'app':_0xd3d5('0x9d'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xd3d5('0x9e')]['create']({'body':_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x5d')],'OpenchannelAccountId':_0x3e6a5e[_0xd3d5('0x58')]['id'],'OpenchannelInteractionId':_0x4b6f9c['id'],'direction':'in','ContactId':_0x44e97f[_0xd3d5('0x90')]['id'],'AttachmentId':_0x3e6a5e[_0xd3d5('0x5d')][_0xd3d5('0x9f')]});})[_0xd3d5('0x23')](function(_0x44555c){_0x44e97f[_0xd3d5('0x2a')]=_0x44555c;if(_0x44e97f[_0xd3d5('0x99')][_0xd3d5('0xa0')]){return db[_0xd3d5('0xa1')]['find']({'attributes':['id','name'],'where':{'id':_0x44e97f[_0xd3d5('0x99')]['UserId']}})[_0xd3d5('0x23')](function(_0x1ebbfa){if(_0x1ebbfa){_0x44e97f[_0xd3d5('0x8b')][_0xd3d5('0xa2')]({'id':0x0,'priority':0x0,'app':_0xd3d5('0xa3'),'appdata':_0x1ebbfa[_0xd3d5('0x3d')]+','+(_0x44e97f[_0xd3d5('0x8a')][_0xd3d5('0xa4')]||0xa),'interval':'*,*,*,*'});_0x44e97f[_0xd3d5('0xa5')]=![];}return respondWithRpcPromise(_0xd3d5('0xa6'),_0xd3d5('0xa7'),_0x44e97f);});}return respondWithRpcPromise('Start',_0xd3d5('0xa7'),_0x44e97f);})[_0xd3d5('0x23')](function(_0x46b59c){respondWithRpcPromise(_0xd3d5('0xa8'),'EventManager',{'event':_0xd3d5('0x73'),'message':_0x46b59c},client9002);return _0x46b59c;})[_0xd3d5('0x23')](respondWithResult(_0x571ca7,null))[_0xd3d5('0x2c')](handleError(_0x571ca7,null));};exports['addApplications']=function(_0xffa8de,_0x57c9f8){var _0x1cfbf5=_0xffa8de[_0xd3d5('0x58')]['id'];var _0x412a98=_0xffa8de[_0xd3d5('0x5d')];var _0x30f3ce=0xc8;var _0x48aa05=null;return db[_0xd3d5('0xa9')]['transaction']({'isolationLevel':db[_0xd3d5('0xa9')]['Transaction'][_0xd3d5('0xaa')][_0xd3d5('0xab')]},function(_0x31b980){return db[_0xd3d5('0x42')]['findOne']({'where':{'id':_0x1cfbf5},'transaction':_0x31b980})[_0xd3d5('0x23')](function(_0x6ea2a7){if(_0x6ea2a7){return db['OpenchannelApplication'][_0xd3d5('0x39')]({'where':{'OpenchannelAccountId':_0x1cfbf5},'transaction':_0x31b980})['then'](function(){var _0x6b923f=_[_0xd3d5('0x41')](_0x412a98,function(_0x2873a2){_0x2873a2[_0xd3d5('0x68')]=_0x1cfbf5;return _0x2873a2;});return db[_0xd3d5('0x87')]['bulkCreate'](_0x6b923f,{'transaction':_0x31b980});});}else{_0x30f3ce=0x194;_0x48aa05=[];}});})['then'](function(){if(_0x30f3ce!==0x194){return db['OpenchannelApplication'][_0xd3d5('0xac')]({'where':{'OpenchannelAccountId':_0x1cfbf5},'order':'priority'})['then'](function(_0x4d4238){_0x48aa05=_0x4d4238;});}})[_0xd3d5('0x2c')](function(_0x263854){_0x30f3ce=0x1f4;logger['error'](_0x263854[_0xd3d5('0x3c')]);if(_0x263854[_0xd3d5('0x3d')]){delete _0x263854[_0xd3d5('0x3d')];}_0x48aa05=_0x263854;})[_0xd3d5('0xad')](function(){if(_0x48aa05===null){_0x57c9f8[_0xd3d5('0x2d')](_0x30f3ce);}else{if(_0x30f3ce===0x1f4){_0x57c9f8['status'](_0x30f3ce)['send'](_0x48aa05);}else{_0x57c9f8[_0xd3d5('0x2e')](_0x30f3ce)[_0xd3d5('0x30')](_0x48aa05);}}});};exports[_0xd3d5('0xae')]=function(_0x3900a6,_0x568419,_0x3443b0){var _0x15063e={};var _0x32c11d={};var _0x10d4e9;var _0x31ff0f;return db['OpenchannelAccount'][_0xd3d5('0x6b')]({'where':{'id':_0x3900a6[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x568419,null))[_0xd3d5('0x23')](function(_0x170674){if(_0x170674){_0x10d4e9=_0x170674;_0x32c11d[_0xd3d5('0x46')]=_[_0xd3d5('0x48')](db['OpenchannelApplication']['rawAttributes']);_0x32c11d['query']=_[_0xd3d5('0x48')](_0x3900a6[_0xd3d5('0x47')]);_0x32c11d['filters']=_[_0xd3d5('0x4a')](_0x32c11d[_0xd3d5('0x46')],_0x32c11d[_0xd3d5('0x47')]);_0x15063e[_0xd3d5('0x4b')]=_[_0xd3d5('0x4a')](_0x32c11d[_0xd3d5('0x46')],qs[_0xd3d5('0x4c')](_0x3900a6[_0xd3d5('0x47')]['fields']));_0x15063e[_0xd3d5('0x4b')]=_0x15063e[_0xd3d5('0x4b')][_0xd3d5('0x4d')]?_0x15063e[_0xd3d5('0x4b')]:_0x32c11d[_0xd3d5('0x46')];_0x15063e[_0xd3d5('0x50')]=qs['sort'](_0x3900a6[_0xd3d5('0x47')][_0xd3d5('0x51')]);_0x15063e['where']=qs['filters'](_[_0xd3d5('0x71')](_0x3900a6[_0xd3d5('0x47')],_0x32c11d[_0xd3d5('0x49')]));if(_0x3900a6[_0xd3d5('0x47')]['filter']){_0x15063e['where']=_[_0xd3d5('0x54')](_0x15063e['where'],{'$or':_[_0xd3d5('0x41')](_0x15063e[_0xd3d5('0x4b')],function(_0x460557){var _0x2fde65={};_0x2fde65[_0x460557]={'$like':'%'+_0x3900a6[_0xd3d5('0x47')]['filter']+'%'};return _0x2fde65;})});}_0x15063e=_['merge']({},_0x15063e,_0x3900a6['options']);return _0x10d4e9['getApplications'](_0x15063e);}})['then'](function(_0x297fcb){if(_0x297fcb){_0x31ff0f=_0x297fcb[_0xd3d5('0x4d')];if(!_0x3900a6['query']['hasOwnProperty'](_0xd3d5('0x4f'))){_0x15063e[_0xd3d5('0x33')]=qs[_0xd3d5('0x33')](_0x3900a6[_0xd3d5('0x47')][_0xd3d5('0x33')]);_0x15063e['offset']=qs[_0xd3d5('0x31')](_0x3900a6['query']['offset']);}return _0x10d4e9[_0xd3d5('0xae')](_0x15063e);}})[_0xd3d5('0x23')](function(_0x143226){if(_0x143226){return _0x143226?{'count':_0x31ff0f,'rows':_0x143226}:null;}})[_0xd3d5('0x23')](respondWithResult(_0x568419,null))[_0xd3d5('0x2c')](handleError(_0x568419,null));};exports[_0xd3d5('0xaf')]=function(_0x4560c8,_0x3fc67d,_0x37c633){var _0x599a93={'raw':![],'where':{}};var _0x24cdd1={};var _0x1c658a={'count':0x0,'rows':[]};return db[_0xd3d5('0x42')][_0xd3d5('0x6b')]({'where':{'id':_0x4560c8[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x3fc67d,null))[_0xd3d5('0x23')](function(_0x4a8e79){if(_0x4a8e79){_0x24cdd1[_0xd3d5('0x46')]=_[_0xd3d5('0x48')](db['OpenchannelInteraction'][_0xd3d5('0x59')]);_0x24cdd1[_0xd3d5('0x47')]=_[_0xd3d5('0x48')](_0x4560c8['query']);_0x24cdd1[_0xd3d5('0x49')]=_['intersection'](_0x24cdd1[_0xd3d5('0x46')],_0x24cdd1[_0xd3d5('0x47')]);_0x599a93[_0xd3d5('0x4b')]=_[_0xd3d5('0x4a')](_0x24cdd1[_0xd3d5('0x46')],qs[_0xd3d5('0x4c')](_0x4560c8[_0xd3d5('0x47')]['fields']));_0x599a93[_0xd3d5('0x4b')]=_0x599a93[_0xd3d5('0x4b')][_0xd3d5('0x4d')]?_0x599a93[_0xd3d5('0x4b')]:_0x24cdd1[_0xd3d5('0x46')];if(!_0x4560c8[_0xd3d5('0x47')]['hasOwnProperty'](_0xd3d5('0x4f'))){_0x599a93[_0xd3d5('0x33')]=qs[_0xd3d5('0x33')](_0x4560c8[_0xd3d5('0x47')][_0xd3d5('0x33')]);_0x599a93[_0xd3d5('0x31')]=qs[_0xd3d5('0x31')](_0x4560c8[_0xd3d5('0x47')]['offset']);}_0x599a93['order']=qs['sort'](_0x4560c8[_0xd3d5('0x47')][_0xd3d5('0x51')]);_0x599a93[_0xd3d5('0x52')]=qs[_0xd3d5('0x49')](_[_0xd3d5('0x71')](_0x4560c8['query'],_0x24cdd1[_0xd3d5('0x49')]));_0x599a93[_0xd3d5('0x52')][_0xd3d5('0x68')]=_0x4a8e79['id'];if(_0x4560c8['query'][_0xd3d5('0x53')]){_0x599a93['where']=_['merge'](_0x599a93[_0xd3d5('0x52')],{'$or':_[_0xd3d5('0x41')](_0x599a93[_0xd3d5('0x4b')],function(_0x31ff9c){var _0x448fb6={};_0x448fb6[_0x31ff9c]={'$like':'%'+_0x4560c8[_0xd3d5('0x47')][_0xd3d5('0x53')]+'%'};return _0x448fb6;})});}_0x599a93=_[_0xd3d5('0x54')]({},_0x599a93,_0x4560c8[_0xd3d5('0x55')]);return db[_0xd3d5('0x94')][_0xd3d5('0x34')]({'where':_0x599a93[_0xd3d5('0x52')]})[_0xd3d5('0x23')](function(_0x3e3fa7){_0x1c658a['count']=_0x3e3fa7;if(_0x4560c8[_0xd3d5('0x47')]['includeAll']){_0x599a93[_0xd3d5('0x5b')]=[{'model':db['CmContact'],'as':_0xd3d5('0xb0'),'required':![]},{'model':db[_0xd3d5('0xa1')],'as':_0xd3d5('0xb1'),'attributes':[_0xd3d5('0x3d'),_0xd3d5('0xb2'),_0xd3d5('0xb3')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xd3d5('0xb4')],'where':_0x4560c8[_0xd3d5('0x47')][_0xd3d5('0xb5')]?{'id':_0x4560c8[_0xd3d5('0x47')]['tag']}:undefined,'required':_0x4560c8[_0xd3d5('0x47')]['tag']?!![]:![]}];}return db[_0xd3d5('0x94')]['findAll'](_0x599a93);})[_0xd3d5('0x23')](function(_0x149384){_0x1c658a[_0xd3d5('0x57')]=_0x149384;return _0x1c658a;});}})[_0xd3d5('0x23')](respondWithFilteredResult(_0x3fc67d,_0x599a93))[_0xd3d5('0x2c')](handleError(_0x3fc67d,null));};exports['addAgents']=function(_0x361e2f,_0x245a4e,_0xff5f7c){return db[_0xd3d5('0x42')][_0xd3d5('0x62')]({'where':{'id':_0x361e2f[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x245a4e,null))[_0xd3d5('0x23')](function(_0x545511){if(_0x545511){return _0x545511[_0xd3d5('0xb6')](_0x361e2f['body'][_0xd3d5('0x6d')],_['omit'](_0x361e2f[_0xd3d5('0x5d')],[_0xd3d5('0x6d'),'id'])||{})[_0xd3d5('0x97')](function(_0x11925d){for(var _0x31c14f=0x0;_0x31c14f<_0x361e2f[_0xd3d5('0x5d')][_0xd3d5('0x6d')][_0xd3d5('0x4d')];_0x31c14f+=0x1){socket[_0xd3d5('0xb7')](_0xd3d5('0xb8'),{'UserId':Number(_0x361e2f[_0xd3d5('0x5d')]['ids'][_0x31c14f]),'OpenchannelAccountId':Number(_0x361e2f[_0xd3d5('0x58')]['id'])});}return _0x11925d;});}})[_0xd3d5('0x23')](respondWithResult(_0x245a4e,null))[_0xd3d5('0x2c')](handleError(_0x245a4e,null));};exports['removeAgents']=function(_0x2e65e6,_0x2205df,_0xc80ec6){return db[_0xd3d5('0x42')][_0xd3d5('0x62')]({'where':{'id':_0x2e65e6[_0xd3d5('0x58')]['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x2205df,null))[_0xd3d5('0x23')](function(_0x4d686a){if(_0x4d686a){return _0x4d686a[_0xd3d5('0xb9')](_0x2e65e6['query'][_0xd3d5('0x6d')])[_0xd3d5('0x23')](function(){if(_[_0xd3d5('0xba')](_0x2e65e6['query'][_0xd3d5('0x6d')])){for(var _0x512af9=0x0;_0x512af9<_0x2e65e6['query']['ids'][_0xd3d5('0x4d')];_0x512af9+=0x1){socket[_0xd3d5('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2e65e6[_0xd3d5('0x47')]['ids'][_0x512af9]),'OpenchannelAccountId':Number(_0x2e65e6[_0xd3d5('0x58')]['id'])});}}else{socket[_0xd3d5('0xb7')](_0xd3d5('0xbb'),{'UserId':Number(_0x2e65e6[_0xd3d5('0x47')][_0xd3d5('0x6d')]),'OpenchannelAccountId':Number(_0x2e65e6['params']['id'])});}});}})[_0xd3d5('0x23')](respondWithStatusCode(_0x2205df,null))[_0xd3d5('0x2c')](handleError(_0x2205df,null));};exports[_0xd3d5('0xbc')]=function(_0x2b6da2,_0x1f4661,_0x5e51e9){var _0x573ad4={};var _0xd7fe23={};var _0x486180;var _0xd41396;return db[_0xd3d5('0x42')][_0xd3d5('0x6b')]({'where':{'id':_0x2b6da2['params']['id']}})[_0xd3d5('0x23')](handleEntityNotFound(_0x1f4661,null))[_0xd3d5('0x23')](function(_0x13a94b){if(_0x13a94b){_0x486180=_0x13a94b;_0xd7fe23[_0xd3d5('0x46')]=_[_0xd3d5('0x48')](db[_0xd3d5('0xa1')][_0xd3d5('0x59')]);_0xd7fe23['query']=_['keys'](_0x2b6da2[_0xd3d5('0x47')]);_0xd7fe23[_0xd3d5('0x49')]=_[_0xd3d5('0x4a')](_0xd7fe23[_0xd3d5('0x46')],_0xd7fe23[_0xd3d5('0x47')]);_0x573ad4[_0xd3d5('0x4b')]=_['intersection'](_0xd7fe23[_0xd3d5('0x46')],qs['fields'](_0x2b6da2[_0xd3d5('0x47')][_0xd3d5('0x4c')]));_0x573ad4[_0xd3d5('0x4b')]=_0x573ad4[_0xd3d5('0x4b')][_0xd3d5('0x4d')]?_0x573ad4[_0xd3d5('0x4b')]:_0xd7fe23[_0xd3d5('0x46')];_0x573ad4[_0xd3d5('0x50')]=qs[_0xd3d5('0x51')](_0x2b6da2['query']['sort']);_0x573ad4[_0xd3d5('0x52')]=qs[_0xd3d5('0x49')](_[_0xd3d5('0x71')](_0x2b6da2[_0xd3d5('0x47')],_0xd7fe23[_0xd3d5('0x49')]));if(_0x2b6da2[_0xd3d5('0x47')]['filter']){_0x573ad4[_0xd3d5('0x52')]=_['merge'](_0x573ad4['where'],{'$or':_[_0xd3d5('0x41')](_0x573ad4[_0xd3d5('0x4b')],function(_0x3465df){var _0x5c2b54={};_0x5c2b54[_0x3465df]={'$like':'%'+_0x2b6da2[_0xd3d5('0x47')]['filter']+'%'};return _0x5c2b54;})});}_0x573ad4=_['merge']({},_0x573ad4,_0x2b6da2[_0xd3d5('0x55')]);return _0x486180[_0xd3d5('0xbc')](_0x573ad4);}})[_0xd3d5('0x23')](function(_0x2b759d){if(_0x2b759d){_0xd41396=_0x2b759d[_0xd3d5('0x4d')];if(!_0x2b6da2[_0xd3d5('0x47')][_0xd3d5('0x4e')](_0xd3d5('0x4f'))){_0x573ad4[_0xd3d5('0x33')]=qs[_0xd3d5('0x33')](_0x2b6da2[_0xd3d5('0x47')][_0xd3d5('0x33')]);_0x573ad4[_0xd3d5('0x31')]=qs[_0xd3d5('0x31')](_0x2b6da2[_0xd3d5('0x47')][_0xd3d5('0x31')]);}return _0x486180[_0xd3d5('0xbc')](_0x573ad4);}})[_0xd3d5('0x23')](function(_0x4b416f){if(_0x4b416f){return _0x4b416f?{'count':_0xd41396,'rows':_0x4b416f}:null;}})[_0xd3d5('0x23')](respondWithResult(_0x1f4661,null))[_0xd3d5('0x2c')](handleError(_0x1f4661,null));};exports[_0xd3d5('0xbd')]=function(_0x2f38fd,_0x3e9ebf,_0x1fa8c7){var _0x5c7a0d,_0x1d37a9,_0x54aca4;if(_['isNil'](_0x2f38fd[_0xd3d5('0x5d')]['body'])||_0x2f38fd['body'][_0xd3d5('0x5d')]===''){throw new db[(_0xd3d5('0x75'))]['ValidationError'](_0xd3d5('0x7f'));}if(_[_0xd3d5('0x7e')](_0x2f38fd[_0xd3d5('0x5d')]['to'])){}_0x5c7a0d=_0x2f38fd[_0xd3d5('0x5d')]['to'];return db[_0xd3d5('0x42')]['findOne']({'where':{'id':_0x2f38fd[_0xd3d5('0x58')]['id']}})['then'](handleEntityNotFound(_0x3e9ebf,null))[_0xd3d5('0x23')](function(_0x3acdb9){if(_0x3acdb9){return db['OpenchannelAccount'][_0xd3d5('0x62')]({'where':{'id':_0x3acdb9['id']},'include':[{'model':db[_0xd3d5('0x84')],'as':'List','include':[{'model':db[_0xd3d5('0x8f')],'as':_0xd3d5('0x85'),'where':{[_0x3acdb9[_0xd3d5('0x80')]]:_0x5c7a0d},'limit':0x1,'order':[['updatedAt',_0xd3d5('0x86')]]}]}]})['then'](handleEntityNotFound(_0x3e9ebf,null))[_0xd3d5('0x23')](function(_0x34656a){if(_0x34656a&&_0x34656a[_0xd3d5('0x89')]){_0x1d37a9=_0x34656a[_0xd3d5('0x5f')]({'plain':!![]});if(_0x1d37a9[_0xd3d5('0x89')]&&_0x1d37a9[_0xd3d5('0x89')][_0xd3d5('0x85')][_0xd3d5('0x4d')]){return _0x1d37a9[_0xd3d5('0x89')][_0xd3d5('0x85')][0x0];}return db[_0xd3d5('0x8f')][_0xd3d5('0x5c')](_[_0xd3d5('0x1a')](_0x2f38fd[_0xd3d5('0x5d')],{'firstName':_0x5c7a0d,[_0x34656a[_0xd3d5('0x80')]]:_0x5c7a0d,'phone':_0x5c7a0d,'ListId':_0x1d37a9['ListId']}));}})[_0xd3d5('0x23')](handleEntityNotFound(_0x3e9ebf,null))[_0xd3d5('0x23')](function(_0x24fdff){if(_0x24fdff){_0x54aca4=_0x24fdff;return db[_0xd3d5('0x94')]['find']({'where':{'ContactId':_0x54aca4['id'],'closed':![],'OpenchannelAccountId':_0x1d37a9['id']}})[_0xd3d5('0x23')](function(_0x201a3b){if(_0x201a3b){return[_0x201a3b,![]];}return db[_0xd3d5('0x94')][_0xd3d5('0x5c')]({'UserId':_0x2f38fd[_0xd3d5('0x5e')]['id'],'ContactId':_0x54aca4['id'],'OpenchannelAccountId':_0x1d37a9['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0x2f38fd[_0xd3d5('0x5d')],{'read':![],'body':_0x2f38fd['body']['body'],'OpenchannelAccountId':_0x1d37a9['id'],'UserId':_0x2f38fd[_0xd3d5('0x5e')]['id'],'ContactId':_0x54aca4['id']})]},{'include':[{'model':db[_0xd3d5('0x9e')],'as':_0xd3d5('0xbe')}]})[_0xd3d5('0x23')](function(_0x40bf5d){return[_0x40bf5d,!![]];});});}})['spread'](function(_0x3afc62,_0x249a20){if(_0x249a20){return _0x3afc62;}return db[_0xd3d5('0x9e')][_0xd3d5('0x5c')](_['merge'](_0x2f38fd[_0xd3d5('0x5d')],{'read':![],'body':_0x2f38fd[_0xd3d5('0x5d')][_0xd3d5('0x5d')],'OpenchannelAccountId':_0x1d37a9['id'],'OpenchannelInteractionId':_0x3afc62['id'],'UserId':_0x2f38fd[_0xd3d5('0x5e')]['id'],'ContactId':_0x54aca4['id']}))[_0xd3d5('0x23')](function(_0x39eb5f){_0x3afc62[_0xd3d5('0xbf')][_0xd3d5('0xbe')]=[];_0x3afc62[_0xd3d5('0xbf')][_0xd3d5('0xbe')]['push'](_0x39eb5f[_0xd3d5('0xbf')]);return _0x3afc62;});});}})[_0xd3d5('0x23')](respondWithResult(_0x3e9ebf,null))[_0xd3d5('0x2c')](handleError(_0x3e9ebf,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5e3dc82..91c753d 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 _0xda3f=['exports','../../mysqldb','OpenchannelAccount','remove','emit'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0xda3f,0xec));var _0xfda3=function(_0x1a34cd,_0x5551f6){_0x1a34cd=_0x1a34cd-0x0;var _0x2414cb=_0xda3f[_0x1a34cd];return _0x2414cb;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x38cc86,_0x5b8e41){var _0xa0cb08=function(_0x650093){while(--_0x650093){_0x38cc86['push'](_0x38cc86['shift']());}};_0xa0cb08(++_0x5b8e41);}(_0x13f6,0x124));var _0x613f=function(_0x4a3eb1,_0x4385b5){_0x4a3eb1=_0x4a3eb1-0x0;var _0x3bf959=_0x13f6[_0x4a3eb1];return _0x3bf959;};'use strict';var EventEmitter=require(_0x613f('0x0'));var OpenchannelAccount=require(_0x613f('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){OpenchannelAccountEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);OpenchannelAccountEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 96df29a..07357bb 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(_0x57e367,_0x180c1f){var _0x45c1d1=function(_0x91261f){while(--_0x91261f){_0x57e367['push'](_0x57e367['shift']());}};_0x45c1d1(++_0x180c1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0xf8f3c7,_0x12055e){var _0x2de864=function(_0x3db7b3){while(--_0x3db7b3){_0xf8f3c7['push'](_0xf8f3c7['shift']());}};_0x2de864(++_0x12055e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 51a9384..21d6e91 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 _0x693f=['info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./openchannelAccount.socket','register','request','then'];(function(_0x309d7d,_0x2ce095){var _0x302407=function(_0x172f30){while(--_0x172f30){_0x309d7d['push'](_0x309d7d['shift']());}};_0x302407(++_0x2ce095);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require(_0xf693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf693('0x4'));var db=require(_0xf693('0x5'))['db'];var utils=require(_0xf693('0x6'));var logger=require(_0xf693('0x7'))(_0xf693('0x8'));var config=require(_0xf693('0x9'));var jayson=require(_0xf693('0xa'));var client=jayson['client'][_0xf693('0xb')]({'port':0x232a});config[_0xf693('0xc')]=_['defaults'](config[_0xf693('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf693('0xd'))(new Redis(config['redis']));require(_0xf693('0xe'))[_0xf693('0xf')](socket);function respondWithRpcPromise(_0x48984a,_0x4b09d6,_0x5d9159){return new BPromise(function(_0x38b847,_0x527cd9){return client[_0xf693('0x10')](_0x48984a,_0x5d9159)[_0xf693('0x11')](function(_0x2202f1){logger[_0xf693('0x12')](_0xf693('0x13'),_0x4b09d6,'request\x20sent');logger['debug'](_0xf693('0x14'),_0x4b09d6,_0xf693('0x15'),JSON['stringify'](_0x2202f1));if(_0x2202f1[_0xf693('0x16')]){if(_0x2202f1[_0xf693('0x16')]['code']===0x1f4){logger['error'](_0xf693('0x13'),_0x4b09d6,_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);return _0x527cd9(_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);}logger['error'](_0xf693('0x13'),_0x4b09d6,_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);return _0x38b847(_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);}else{logger[_0xf693('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b09d6,'request\x20sent');_0x38b847(_0x2202f1['result'][_0xf693('0x17')]);}})[_0xf693('0x18')](function(_0x3f4d4d){logger[_0xf693('0x16')](_0xf693('0x13'),_0x4b09d6,_0x3f4d4d);_0x527cd9(_0x3f4d4d);});});} \ No newline at end of file +var _0x9d5b=['register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelAccount.socket'];(function(_0x14eba5,_0x1fcb02){var _0x121122=function(_0x19319d){while(--_0x19319d){_0x14eba5['push'](_0x14eba5['shift']());}};_0x121122(++_0x1fcb02);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x466532,_0x1de831){_0x466532=_0x466532-0x0;var _0x385719=_0x9d5b[_0x466532];return _0x385719;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var moment=require(_0xb9d5('0x1'));var BPromise=require(_0xb9d5('0x2'));var rs=require(_0xb9d5('0x3'));var fs=require('fs');var Redis=require(_0xb9d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9d5('0x5'));var logger=require('../../config/logger')(_0xb9d5('0x6'));var config=require(_0xb9d5('0x7'));var jayson=require(_0xb9d5('0x8'));var client=jayson[_0xb9d5('0x9')][_0xb9d5('0xa')]({'port':0x232a});config['redis']=_[_0xb9d5('0xb')](config[_0xb9d5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9d5('0xd'))(new Redis(config[_0xb9d5('0xc')]));require(_0xb9d5('0xe'))[_0xb9d5('0xf')](socket);function respondWithRpcPromise(_0x5d0fc6,_0x1aec1b,_0x1ae073){return new BPromise(function(_0x4c1ce3,_0x35d69f){return client[_0xb9d5('0x10')](_0x5d0fc6,_0x1ae073)[_0xb9d5('0x11')](function(_0x422b36){logger[_0xb9d5('0x12')](_0xb9d5('0x13'),_0x1aec1b,_0xb9d5('0x14'));logger[_0xb9d5('0x15')](_0xb9d5('0x16'),_0x1aec1b,_0xb9d5('0x14'),JSON[_0xb9d5('0x17')](_0x422b36));if(_0x422b36['error']){if(_0x422b36[_0xb9d5('0x18')][_0xb9d5('0x19')]===0x1f4){logger['error'](_0xb9d5('0x13'),_0x1aec1b,_0x422b36[_0xb9d5('0x18')][_0xb9d5('0x1a')]);return _0x35d69f(_0x422b36['error'][_0xb9d5('0x1a')]);}logger[_0xb9d5('0x18')](_0xb9d5('0x13'),_0x1aec1b,_0x422b36[_0xb9d5('0x18')][_0xb9d5('0x1a')]);return _0x4c1ce3(_0x422b36[_0xb9d5('0x18')][_0xb9d5('0x1a')]);}else{logger[_0xb9d5('0x12')](_0xb9d5('0x13'),_0x1aec1b,_0xb9d5('0x14'));_0x4c1ce3(_0x422b36[_0xb9d5('0x1b')][_0xb9d5('0x1a')]);}})[_0xb9d5('0x1c')](function(_0x171487){logger['error'](_0xb9d5('0x13'),_0x1aec1b,_0x171487);_0x35d69f(_0x171487);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 1d7b00d..050f452 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 _0x13c0=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x3567ce,_0x43b609){var _0x5db1e7=function(_0x2ac26a){while(--_0x2ac26a){_0x3567ce['push'](_0x3567ce['shift']());}};_0x5db1e7(++_0x43b609);}(_0x13c0,0x79));var _0x013c=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0x13c0[_0x3f59b1];return _0x11d2e8;};'use strict';var OpenchannelAccountEvents=require(_0x013c('0x0'));var events=[_0x013c('0x1'),_0x013c('0x2'),_0x013c('0x3')];function createListener(_0x5b4348,_0x4fb1ff){return function(_0x5b8e8e){_0x4fb1ff[_0x013c('0x4')](_0x5b4348,_0x5b8e8e);};}function removeListener(_0x70a468,_0x22fb4b){return function(){OpenchannelAccountEvents[_0x013c('0x5')](_0x70a468,_0x22fb4b);};}exports[_0x013c('0x6')]=function(_0x12d78e){for(var _0x1142f4=0x0,_0x3decb5=events['length'];_0x1142f4<_0x3decb5;_0x1142f4++){var _0x4cf99d=events[_0x1142f4];var _0x593053=createListener(_0x013c('0x7')+_0x4cf99d,_0x12d78e);OpenchannelAccountEvents['on'](_0x4cf99d,_0x593053);}}; \ No newline at end of file +var _0xb2b3=['openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener','register','length'];(function(_0x2ca0e6,_0x36bb13){var _0x10e4d8=function(_0x632098){while(--_0x632098){_0x2ca0e6['push'](_0x2ca0e6['shift']());}};_0x10e4d8(++_0x36bb13);}(_0xb2b3,0x71));var _0x3b2b=function(_0x4414af,_0x2501e2){_0x4414af=_0x4414af-0x0;var _0x413b2a=_0xb2b3[_0x4414af];return _0x413b2a;};'use strict';var OpenchannelAccountEvents=require(_0x3b2b('0x0'));var events=[_0x3b2b('0x1'),_0x3b2b('0x2'),_0x3b2b('0x3')];function createListener(_0xf005ed,_0x3de73b){return function(_0x2059f0){_0x3de73b['emit'](_0xf005ed,_0x2059f0);};}function removeListener(_0x3eff63,_0x222c10){return function(){OpenchannelAccountEvents[_0x3b2b('0x4')](_0x3eff63,_0x222c10);};}exports[_0x3b2b('0x5')]=function(_0x2581eb){for(var _0xc53a84=0x0,_0x83e7ef=events[_0x3b2b('0x6')];_0xc53a84<_0x83e7ef;_0xc53a84++){var _0x1a9054=events[_0xc53a84];var _0x3ec416=createListener(_0x3b2b('0x7')+_0x1a9054,_0x2581eb);OpenchannelAccountEvents['on'](_0x1a9054,_0x3ec416);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ff9aa64..57f5b4d 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 _0x69cf=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','/:id','show','post','create','update','destroy','multer','util'];(function(_0x1801bd,_0x2d3f3e){var _0x4d888b=function(_0xd9cba2){while(--_0xd9cba2){_0x1801bd['push'](_0x1801bd['shift']());}};_0x4d888b(++_0x2d3f3e);}(_0x69cf,0x130));var _0xf69c=function(_0x190d2c,_0x159734){_0x190d2c=_0x190d2c-0x0;var _0x83d998=_0x69cf[_0x190d2c];return _0x83d998;};'use strict';var multer=require(_0xf69c('0x0'));var util=require(_0xf69c('0x1'));var path=require(_0xf69c('0x2'));var timeout=require(_0xf69c('0x3'));var express=require(_0xf69c('0x4'));var router=express['Router']();var fs_extra=require(_0xf69c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf69c('0x6'));var config=require(_0xf69c('0x7'));var controller=require(_0xf69c('0x8'));router['get']('/',auth[_0xf69c('0x9')](),controller['index']);router[_0xf69c('0xa')](_0xf69c('0xb'),auth[_0xf69c('0x9')](),controller[_0xf69c('0xc')]);router[_0xf69c('0xd')]('/',auth[_0xf69c('0x9')](),controller[_0xf69c('0xe')]);router['put']('/:id',auth[_0xf69c('0x9')](),controller[_0xf69c('0xf')]);router['delete'](_0xf69c('0xb'),auth['isAuthenticated'](),controller[_0xf69c('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6ff2=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','index','/:id','show','post','isAuthenticated','put','update','destroy','exports','multer','util'];(function(_0x42ce1b,_0x3942fc){var _0x9741ed=function(_0x2c3d85){while(--_0x2c3d85){_0x42ce1b['push'](_0x42ce1b['shift']());}};_0x9741ed(++_0x3942fc);}(_0x6ff2,0x11b));var _0x26ff=function(_0x2f9797,_0x149780){_0x2f9797=_0x2f9797-0x0;var _0x1f79e3=_0x6ff2[_0x2f9797];return _0x1f79e3;};'use strict';var multer=require(_0x26ff('0x0'));var util=require(_0x26ff('0x1'));var path=require(_0x26ff('0x2'));var timeout=require(_0x26ff('0x3'));var express=require(_0x26ff('0x4'));var router=express[_0x26ff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ff('0x6'));var interaction=require(_0x26ff('0x7'));var config=require('../../config/environment');var controller=require(_0x26ff('0x8'));router[_0x26ff('0x9')]('/',auth['isAuthenticated'](),controller[_0x26ff('0xa')]);router[_0x26ff('0x9')](_0x26ff('0xb'),auth['isAuthenticated'](),controller[_0x26ff('0xc')]);router[_0x26ff('0xd')]('/',auth[_0x26ff('0xe')](),controller['create']);router[_0x26ff('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x26ff('0x10')]);router['delete'](_0x26ff('0xb'),auth[_0x26ff('0xe')](),controller[_0x26ff('0x11')]);module[_0x26ff('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 cb2f839..3381f4a 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 _0xe4a6=['TEXT','*,*,*,*','STRING','noop'];(function(_0x5ea7b1,_0x2791e6){var _0x57581a=function(_0x40d861){while(--_0x40d861){_0x5ea7b1['push'](_0x5ea7b1['shift']());}};_0x57581a(++_0x2791e6);}(_0xe4a6,0xe6));var _0x6e4a=function(_0x3f4bc1,_0x15ace5){_0x3f4bc1=_0x3f4bc1-0x0;var _0x46fcf6=_0xe4a6[_0x3f4bc1];return _0x46fcf6;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6e4a('0x0')],'allowNull':![],'defaultValue':_0x6e4a('0x1')},'appdata':{'type':Sequelize[_0x6e4a('0x2')]()},'description':{'type':Sequelize[_0x6e4a('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6e4a('0x3')}}; \ No newline at end of file +var _0x756d=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x18417a,_0x1376af){var _0x39e00c=function(_0x411dad){while(--_0x411dad){_0x18417a['push'](_0x18417a['shift']());}};_0x39e00c(++_0x1376af);}(_0x756d,0x1c2));var _0xd756=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x756d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd756('0x0'));module[_0xd756('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd756('0x2')],'allowNull':![],'defaultValue':_0xd756('0x3')},'appdata':{'type':Sequelize[_0xd756('0x4')]()},'description':{'type':Sequelize[_0xd756('0x2')]},'interval':{'type':Sequelize[_0xd756('0x2')],'defaultValue':_0xd756('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 37f7357..3198e45 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 _0xd7d1=['filter','where','merge','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','then','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0xd7d1,0xaa));var _0x1d7d=function(_0x213a44,_0x2d5d14){_0x213a44=_0x213a44-0x0;var _0x60d81f=_0xd7d1[_0x213a44];return _0x60d81f;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1d7d('0x6'));var util=require(_0x1d7d('0x7'));var path=require(_0x1d7d('0x8'));var sox=require(_0x1d7d('0x9'));var csv=require(_0x1d7d('0xa'));var ejs=require(_0x1d7d('0xb'));var fs=require('fs');var fs_extra=require(_0x1d7d('0xc'));var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require('crypto');var jsforce=require(_0x1d7d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d7d('0x10'));var Papa=require(_0x1d7d('0x11'));var Redis=require(_0x1d7d('0x12'));var authService=require(_0x1d7d('0x13'));var qs=require(_0x1d7d('0x14'));var as=require(_0x1d7d('0x15'));var hardwareService=require(_0x1d7d('0x16'));var logger=require(_0x1d7d('0x17'))(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var licenseUtil=require(_0x1d7d('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43727f,_0x101daa){_0x101daa=_0x101daa||0xcc;return function(_0x283ebc){if(_0x283ebc){return _0x43727f[_0x1d7d('0x1c')](_0x101daa);}return _0x43727f['status'](_0x101daa)[_0x1d7d('0x1d')]();};}function respondWithResult(_0x546d4e,_0x5c3cc5){_0x5c3cc5=_0x5c3cc5||0xc8;return function(_0x560500){if(_0x560500){return _0x546d4e['status'](_0x5c3cc5)[_0x1d7d('0x1e')](_0x560500);}};}function respondWithFilteredResult(_0x3c057d,_0x20dc87){return function(_0x3176cf){if(_0x3176cf){var _0x525182=typeof _0x20dc87[_0x1d7d('0x1f')]===_0x1d7d('0x20')&&typeof _0x20dc87['limit']===_0x1d7d('0x20');var _0x20a31a=_0x3176cf[_0x1d7d('0x21')];var _0x2860c2=_0x525182?0x0:_0x20dc87['offset'];var _0x3c8342=_0x525182?_0x3176cf[_0x1d7d('0x21')]:_0x20dc87[_0x1d7d('0x1f')]+_0x20dc87[_0x1d7d('0x22')];var _0xbb9bc1;if(_0x3c8342>=_0x20a31a){_0x3c8342=_0x20a31a;_0xbb9bc1=0xc8;}else{_0xbb9bc1=0xce;}_0x3c057d[_0x1d7d('0x23')](_0xbb9bc1);return _0x3c057d['set'](_0x1d7d('0x24'),_0x2860c2+'-'+_0x3c8342+'/'+_0x20a31a)[_0x1d7d('0x1e')](_0x3176cf);}return null;};}function patchUpdates(_0x536876){return function(_0x531a6c){try{jsonpatch[_0x1d7d('0x25')](_0x531a6c,_0x536876,!![]);}catch(_0x1d3ce9){return BPromise[_0x1d7d('0x26')](_0x1d3ce9);}return _0x531a6c['save']();};}function saveUpdates(_0x2b5a16,_0x4dc99d){return function(_0x18b005){if(_0x18b005){return _0x18b005[_0x1d7d('0x27')](_0x2b5a16)['then'](function(_0x120a30){return _0x120a30;});}return null;};}function removeEntity(_0x120f09,_0x49a42a){return function(_0x375c55){if(_0x375c55){return _0x375c55['destroy']()[_0x1d7d('0x28')](function(){_0x120f09[_0x1d7d('0x23')](0xcc)[_0x1d7d('0x1d')]();});}};}function handleEntityNotFound(_0x328b5d,_0x5590d3){return function(_0x5677ca){if(!_0x5677ca){_0x328b5d[_0x1d7d('0x1c')](0x194);}return _0x5677ca;};}function handleError(_0xba6423,_0x32ce5b){_0x32ce5b=_0x32ce5b||0x1f4;return function(_0x35169b){logger['error'](_0x35169b['stack']);if(_0x35169b['name']){delete _0x35169b[_0x1d7d('0x29')];}_0xba6423['status'](_0x32ce5b)[_0x1d7d('0x2a')](_0x35169b);};}exports[_0x1d7d('0x2b')]=function(_0x4e2659,_0x1ac94f){var _0x346f1e={},_0x19e4c2={},_0x358d68={'count':0x0,'rows':[]};var _0x385bd0=_[_0x1d7d('0x2c')](db[_0x1d7d('0x2d')]['rawAttributes'],function(_0x32f37d){return{'name':_0x32f37d[_0x1d7d('0x2e')],'type':_0x32f37d[_0x1d7d('0x2f')][_0x1d7d('0x30')]};});_0x19e4c2[_0x1d7d('0x31')]=_[_0x1d7d('0x2c')](_0x385bd0,_0x1d7d('0x29'));_0x19e4c2['query']=_[_0x1d7d('0x32')](_0x4e2659['query']);_0x19e4c2[_0x1d7d('0x33')]=_['intersection'](_0x19e4c2['model'],_0x19e4c2[_0x1d7d('0x34')]);_0x346f1e[_0x1d7d('0x35')]=_['intersection'](_0x19e4c2[_0x1d7d('0x31')],qs['fields'](_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x36')]));_0x346f1e[_0x1d7d('0x35')]=_0x346f1e[_0x1d7d('0x35')][_0x1d7d('0x37')]?_0x346f1e[_0x1d7d('0x35')]:_0x19e4c2[_0x1d7d('0x31')];if(!_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x38')](_0x1d7d('0x39'))){_0x346f1e[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x4e2659['query']['limit']);_0x346f1e[_0x1d7d('0x1f')]=qs[_0x1d7d('0x1f')](_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x1f')]);}_0x346f1e[_0x1d7d('0x3a')]=qs[_0x1d7d('0x3b')](_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x3b')]);_0x346f1e['where']=qs[_0x1d7d('0x33')](_[_0x1d7d('0x3c')](_0x4e2659[_0x1d7d('0x34')],_0x19e4c2[_0x1d7d('0x33')]),_0x385bd0);if(_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x3d')]){_0x346f1e[_0x1d7d('0x3e')]=_[_0x1d7d('0x3f')](_0x346f1e['where'],{'$or':_['map'](_0x385bd0,function(_0x225fb3){if(_0x225fb3[_0x1d7d('0x2f')]!=='VIRTUAL'){var _0x5edbfe={};_0x5edbfe[_0x225fb3[_0x1d7d('0x29')]]={'$like':'%'+_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x3d')]+'%'};return _0x5edbfe;}})});}_0x346f1e=_[_0x1d7d('0x3f')]({},_0x346f1e,_0x4e2659[_0x1d7d('0x40')]);var _0x2d5863={'where':_0x346f1e[_0x1d7d('0x3e')]};return db[_0x1d7d('0x2d')][_0x1d7d('0x21')](_0x2d5863)[_0x1d7d('0x28')](function(_0x22d857){_0x358d68[_0x1d7d('0x21')]=_0x22d857;if(_0x4e2659[_0x1d7d('0x34')][_0x1d7d('0x41')]){_0x346f1e[_0x1d7d('0x42')]=[{'all':!![]}];}return db[_0x1d7d('0x2d')][_0x1d7d('0x43')](_0x346f1e);})['then'](function(_0x77d2aa){_0x358d68[_0x1d7d('0x44')]=_0x77d2aa;return _0x358d68;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x1ac94f,_0x346f1e))['catch'](handleError(_0x1ac94f,null));};exports[_0x1d7d('0x45')]=function(_0x48e574,_0x15472c){var _0x41b72d={'raw':!![],'where':{'id':_0x48e574['params']['id']}},_0x4203cd={};_0x4203cd[_0x1d7d('0x31')]=_[_0x1d7d('0x32')](db[_0x1d7d('0x2d')]['rawAttributes']);_0x4203cd[_0x1d7d('0x34')]=_[_0x1d7d('0x32')](_0x48e574[_0x1d7d('0x34')]);_0x4203cd['filters']=_[_0x1d7d('0x46')](_0x4203cd[_0x1d7d('0x31')],_0x4203cd[_0x1d7d('0x34')]);_0x41b72d[_0x1d7d('0x35')]=_[_0x1d7d('0x46')](_0x4203cd[_0x1d7d('0x31')],qs[_0x1d7d('0x36')](_0x48e574[_0x1d7d('0x34')]['fields']));_0x41b72d[_0x1d7d('0x35')]=_0x41b72d[_0x1d7d('0x35')][_0x1d7d('0x37')]?_0x41b72d['attributes']:_0x4203cd[_0x1d7d('0x31')];if(_0x48e574[_0x1d7d('0x34')][_0x1d7d('0x41')]){_0x41b72d[_0x1d7d('0x42')]=[{'all':!![]}];}_0x41b72d=_[_0x1d7d('0x3f')]({},_0x41b72d,_0x48e574[_0x1d7d('0x40')]);return db[_0x1d7d('0x2d')][_0x1d7d('0x47')](_0x41b72d)[_0x1d7d('0x28')](handleEntityNotFound(_0x15472c,null))[_0x1d7d('0x28')](respondWithResult(_0x15472c,null))[_0x1d7d('0x48')](handleError(_0x15472c,null));};exports[_0x1d7d('0x49')]=function(_0xe53588,_0x97f5c1){return db[_0x1d7d('0x2d')][_0x1d7d('0x49')](_0xe53588[_0x1d7d('0x4a')],{})['then'](respondWithResult(_0x97f5c1,0xc9))[_0x1d7d('0x48')](handleError(_0x97f5c1,null));};exports['update']=function(_0xdc929a,_0x5ccc47){if(_0xdc929a[_0x1d7d('0x4a')]['id']){delete _0xdc929a[_0x1d7d('0x4a')]['id'];}return db[_0x1d7d('0x2d')]['find']({'where':{'id':_0xdc929a[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5ccc47,null))['then'](saveUpdates(_0xdc929a[_0x1d7d('0x4a')],null))['then'](respondWithResult(_0x5ccc47,null))['catch'](handleError(_0x5ccc47,null));};exports[_0x1d7d('0x4c')]=function(_0x357bda,_0x4e6663){return db[_0x1d7d('0x2d')][_0x1d7d('0x47')]({'where':{'id':_0x357bda[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x4e6663,null))[_0x1d7d('0x28')](removeEntity(_0x4e6663,null))[_0x1d7d('0x48')](handleError(_0x4e6663,null));}; \ No newline at end of file +var _0x06a2=['filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','destroy','eml-format','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','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0x06a2,0x196));var _0x206a=function(_0x25a136,_0x57320e){_0x25a136=_0x25a136-0x0;var _0x5b7159=_0x06a2[_0x25a136];return _0x5b7159;};'use strict';var emlformat=require(_0x206a('0x0'));var rimraf=require(_0x206a('0x1'));var zipdir=require(_0x206a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x206a('0x3'));var moment=require(_0x206a('0x4'));var BPromise=require(_0x206a('0x5'));var Mustache=require(_0x206a('0x6'));var util=require(_0x206a('0x7'));var path=require('path');var sox=require(_0x206a('0x8'));var csv=require(_0x206a('0x9'));var ejs=require(_0x206a('0xa'));var fs=require('fs');var fs_extra=require(_0x206a('0xb'));var _=require(_0x206a('0xc'));var squel=require(_0x206a('0xd'));var crypto=require(_0x206a('0xe'));var jsforce=require(_0x206a('0xf'));var deskjs=require(_0x206a('0x10'));var toCsv=require(_0x206a('0x9'));var querystring=require(_0x206a('0x11'));var Papa=require(_0x206a('0x12'));var Redis=require(_0x206a('0x13'));var authService=require(_0x206a('0x14'));var qs=require(_0x206a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x206a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x206a('0x17'));var config=require(_0x206a('0x18'));var licenseUtil=require(_0x206a('0x19'));var db=require(_0x206a('0x1a'))['db'];function respondWithStatusCode(_0x3a96f1,_0x5f2189){_0x5f2189=_0x5f2189||0xcc;return function(_0x347250){if(_0x347250){return _0x3a96f1[_0x206a('0x1b')](_0x5f2189);}return _0x3a96f1[_0x206a('0x1c')](_0x5f2189)[_0x206a('0x1d')]();};}function respondWithResult(_0x41d8c3,_0x186ad3){_0x186ad3=_0x186ad3||0xc8;return function(_0x2cbdc2){if(_0x2cbdc2){return _0x41d8c3[_0x206a('0x1c')](_0x186ad3)[_0x206a('0x1e')](_0x2cbdc2);}};}function respondWithFilteredResult(_0x4336e7,_0x2ad1ec){return function(_0x592643){if(_0x592643){var _0x790137=typeof _0x2ad1ec['offset']===_0x206a('0x1f')&&typeof _0x2ad1ec[_0x206a('0x20')]==='undefined';var _0x9d0159=_0x592643[_0x206a('0x21')];var _0x55d0a2=_0x790137?0x0:_0x2ad1ec['offset'];var _0x592f03=_0x790137?_0x592643[_0x206a('0x21')]:_0x2ad1ec[_0x206a('0x22')]+_0x2ad1ec[_0x206a('0x20')];var _0x1ba76f;if(_0x592f03>=_0x9d0159){_0x592f03=_0x9d0159;_0x1ba76f=0xc8;}else{_0x1ba76f=0xce;}_0x4336e7[_0x206a('0x1c')](_0x1ba76f);return _0x4336e7[_0x206a('0x23')](_0x206a('0x24'),_0x55d0a2+'-'+_0x592f03+'/'+_0x9d0159)[_0x206a('0x1e')](_0x592643);}return null;};}function patchUpdates(_0x55c598){return function(_0x442486){try{jsonpatch[_0x206a('0x25')](_0x442486,_0x55c598,!![]);}catch(_0x18fd9f){return BPromise[_0x206a('0x26')](_0x18fd9f);}return _0x442486[_0x206a('0x27')]();};}function saveUpdates(_0x29ef5c,_0x5982cb){return function(_0x3658eb){if(_0x3658eb){return _0x3658eb['update'](_0x29ef5c)[_0x206a('0x28')](function(_0x52368a){return _0x52368a;});}return null;};}function removeEntity(_0x3d4d7d,_0x481df4){return function(_0x51d5f4){if(_0x51d5f4){return _0x51d5f4['destroy']()[_0x206a('0x28')](function(){_0x3d4d7d[_0x206a('0x1c')](0xcc)[_0x206a('0x1d')]();});}};}function handleEntityNotFound(_0x4676fe,_0xddd415){return function(_0x211579){if(!_0x211579){_0x4676fe['sendStatus'](0x194);}return _0x211579;};}function handleError(_0x4db8d1,_0x45ed0b){_0x45ed0b=_0x45ed0b||0x1f4;return function(_0x23e5a1){logger['error'](_0x23e5a1['stack']);if(_0x23e5a1[_0x206a('0x29')]){delete _0x23e5a1[_0x206a('0x29')];}_0x4db8d1['status'](_0x45ed0b)[_0x206a('0x2a')](_0x23e5a1);};}exports[_0x206a('0x2b')]=function(_0x112e7c,_0x472dce){var _0x1c9fa3={},_0x10701e={},_0xd677fb={'count':0x0,'rows':[]};var _0x3017e1=_[_0x206a('0x2c')](db[_0x206a('0x2d')]['rawAttributes'],function(_0x16566e){return{'name':_0x16566e[_0x206a('0x2e')],'type':_0x16566e[_0x206a('0x2f')][_0x206a('0x30')]};});_0x10701e[_0x206a('0x31')]=_[_0x206a('0x2c')](_0x3017e1,'name');_0x10701e[_0x206a('0x32')]=_[_0x206a('0x33')](_0x112e7c[_0x206a('0x32')]);_0x10701e[_0x206a('0x34')]=_[_0x206a('0x35')](_0x10701e[_0x206a('0x31')],_0x10701e[_0x206a('0x32')]);_0x1c9fa3[_0x206a('0x36')]=_['intersection'](_0x10701e['model'],qs[_0x206a('0x37')](_0x112e7c[_0x206a('0x32')]['fields']));_0x1c9fa3[_0x206a('0x36')]=_0x1c9fa3[_0x206a('0x36')][_0x206a('0x38')]?_0x1c9fa3['attributes']:_0x10701e['model'];if(!_0x112e7c[_0x206a('0x32')][_0x206a('0x39')](_0x206a('0x3a'))){_0x1c9fa3[_0x206a('0x20')]=qs['limit'](_0x112e7c[_0x206a('0x32')][_0x206a('0x20')]);_0x1c9fa3['offset']=qs['offset'](_0x112e7c[_0x206a('0x32')][_0x206a('0x22')]);}_0x1c9fa3[_0x206a('0x3b')]=qs[_0x206a('0x3c')](_0x112e7c[_0x206a('0x32')][_0x206a('0x3c')]);_0x1c9fa3['where']=qs[_0x206a('0x34')](_[_0x206a('0x3d')](_0x112e7c[_0x206a('0x32')],_0x10701e['filters']),_0x3017e1);if(_0x112e7c[_0x206a('0x32')][_0x206a('0x3e')]){_0x1c9fa3[_0x206a('0x3f')]=_['merge'](_0x1c9fa3['where'],{'$or':_[_0x206a('0x2c')](_0x3017e1,function(_0x1201aa){if(_0x1201aa['type']!==_0x206a('0x40')){var _0x443c50={};_0x443c50[_0x1201aa[_0x206a('0x29')]]={'$like':'%'+_0x112e7c[_0x206a('0x32')][_0x206a('0x3e')]+'%'};return _0x443c50;}})});}_0x1c9fa3=_[_0x206a('0x41')]({},_0x1c9fa3,_0x112e7c[_0x206a('0x42')]);var _0x16b5ec={'where':_0x1c9fa3[_0x206a('0x3f')]};return db[_0x206a('0x2d')][_0x206a('0x21')](_0x16b5ec)[_0x206a('0x28')](function(_0x421f94){_0xd677fb[_0x206a('0x21')]=_0x421f94;if(_0x112e7c[_0x206a('0x32')][_0x206a('0x43')]){_0x1c9fa3[_0x206a('0x44')]=[{'all':!![]}];}return db[_0x206a('0x2d')][_0x206a('0x45')](_0x1c9fa3);})[_0x206a('0x28')](function(_0x299d66){_0xd677fb[_0x206a('0x46')]=_0x299d66;return _0xd677fb;})[_0x206a('0x28')](respondWithFilteredResult(_0x472dce,_0x1c9fa3))[_0x206a('0x47')](handleError(_0x472dce,null));};exports['show']=function(_0x3fe53c,_0xb732cc){var _0x80f7c7={'raw':!![],'where':{'id':_0x3fe53c['params']['id']}},_0x3e2191={};_0x3e2191['model']=_[_0x206a('0x33')](db[_0x206a('0x2d')][_0x206a('0x48')]);_0x3e2191['query']=_[_0x206a('0x33')](_0x3fe53c[_0x206a('0x32')]);_0x3e2191['filters']=_[_0x206a('0x35')](_0x3e2191[_0x206a('0x31')],_0x3e2191[_0x206a('0x32')]);_0x80f7c7[_0x206a('0x36')]=_['intersection'](_0x3e2191[_0x206a('0x31')],qs[_0x206a('0x37')](_0x3fe53c['query'][_0x206a('0x37')]));_0x80f7c7[_0x206a('0x36')]=_0x80f7c7[_0x206a('0x36')][_0x206a('0x38')]?_0x80f7c7[_0x206a('0x36')]:_0x3e2191[_0x206a('0x31')];if(_0x3fe53c[_0x206a('0x32')]['includeAll']){_0x80f7c7['include']=[{'all':!![]}];}_0x80f7c7=_[_0x206a('0x41')]({},_0x80f7c7,_0x3fe53c[_0x206a('0x42')]);return db[_0x206a('0x2d')][_0x206a('0x49')](_0x80f7c7)[_0x206a('0x28')](handleEntityNotFound(_0xb732cc,null))[_0x206a('0x28')](respondWithResult(_0xb732cc,null))[_0x206a('0x47')](handleError(_0xb732cc,null));};exports[_0x206a('0x4a')]=function(_0x145ef0,_0x5220a9){return db[_0x206a('0x2d')][_0x206a('0x4a')](_0x145ef0[_0x206a('0x4b')],{})[_0x206a('0x28')](respondWithResult(_0x5220a9,0xc9))[_0x206a('0x47')](handleError(_0x5220a9,null));};exports['update']=function(_0x5b703a,_0xac169a){if(_0x5b703a[_0x206a('0x4b')]['id']){delete _0x5b703a[_0x206a('0x4b')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x5b703a[_0x206a('0x4c')]['id']}})[_0x206a('0x28')](handleEntityNotFound(_0xac169a,null))['then'](saveUpdates(_0x5b703a[_0x206a('0x4b')],null))['then'](respondWithResult(_0xac169a,null))[_0x206a('0x47')](handleError(_0xac169a,null));};exports[_0x206a('0x4d')]=function(_0x144ae2,_0x1e8b5e){return db['OpenchannelApplication']['find']({'where':{'id':_0x144ae2['params']['id']}})[_0x206a('0x28')](handleEntityNotFound(_0x1e8b5e,null))[_0x206a('0x28')](removeEntity(_0x1e8b5e,null))[_0x206a('0x47')](handleError(_0x1e8b5e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 7a9711e..0d94292 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 _0x4c9d=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x4f3f41,_0x5b927b){var _0x249efc=function(_0x17e78a){while(--_0x17e78a){_0x4f3f41['push'](_0x4f3f41['shift']());}};_0x249efc(++_0x5b927b);}(_0x4c9d,0x71));var _0xd4c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4c9('0x0'));var util=require(_0xd4c9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd4c9('0x2'));var BPromise=require(_0xd4c9('0x3'));var rp=require(_0xd4c9('0x4'));var fs=require('fs');var path=require(_0xd4c9('0x5'));var rimraf=require(_0xd4c9('0x6'));var config=require(_0xd4c9('0x7'));var attributes=require(_0xd4c9('0x8'));module[_0xd4c9('0x9')]=function(_0x1185df,_0xb42b53){return _0x1185df[_0xd4c9('0xa')](_0xd4c9('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x945d=['openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x945d,0x188));var _0xd945=function(_0x686c55,_0x26ab5d){_0x686c55=_0x686c55-0x0;var _0xe37ab1=_0x945d[_0x686c55];return _0xe37ab1;};'use strict';var _=require(_0xd945('0x0'));var util=require(_0xd945('0x1'));var logger=require(_0xd945('0x2'))(_0xd945('0x3'));var moment=require(_0xd945('0x4'));var BPromise=require(_0xd945('0x5'));var rp=require(_0xd945('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd945('0x7'));var config=require(_0xd945('0x8'));var attributes=require(_0xd945('0x9'));module[_0xd945('0xa')]=function(_0x211327,_0x43d564){return _0x211327[_0xd945('0xb')](_0xd945('0xc'),attributes,{'tableName':_0xd945('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd945('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 3d5cf22..fba67f4 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 _0x2189=['ioredis','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x37a896,_0x5569de){var _0x510515=function(_0x22eb4b){while(--_0x22eb4b){_0x37a896['push'](_0x37a896['shift']());}};_0x510515(++_0x5569de);}(_0x2189,0xa9));var _0x9218=function(_0x123051,_0x60611a){_0x123051=_0x123051-0x0;var _0x37f0df=_0x2189[_0x123051];return _0x37f0df;};'use strict';var _=require(_0x9218('0x0'));var util=require(_0x9218('0x1'));var moment=require(_0x9218('0x2'));var BPromise=require(_0x9218('0x3'));var rs=require(_0x9218('0x4'));var fs=require('fs');var Redis=require(_0x9218('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9218('0x6'))(_0x9218('0x7'));var config=require('../../config/environment');var jayson=require(_0x9218('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2591d4,_0x1af929,_0x2d9b50){return new BPromise(function(_0x1b89fa,_0x2affb7){return client[_0x9218('0x9')](_0x2591d4,_0x2d9b50)[_0x9218('0xa')](function(_0x258968){logger[_0x9218('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x1af929,_0x9218('0xc'));logger[_0x9218('0xd')](_0x9218('0xe'),_0x1af929,_0x9218('0xc'),JSON[_0x9218('0xf')](_0x258968));if(_0x258968[_0x9218('0x10')]){if(_0x258968[_0x9218('0x10')][_0x9218('0x11')]===0x1f4){logger[_0x9218('0x10')](_0x9218('0x12'),_0x1af929,_0x258968[_0x9218('0x10')]['message']);return _0x2affb7(_0x258968['error'][_0x9218('0x13')]);}logger[_0x9218('0x10')](_0x9218('0x12'),_0x1af929,_0x258968[_0x9218('0x10')]['message']);return _0x1b89fa(_0x258968[_0x9218('0x10')][_0x9218('0x13')]);}else{logger['info'](_0x9218('0x12'),_0x1af929,'request\x20sent');_0x1b89fa(_0x258968['result']['message']);}})[_0x9218('0x14')](function(_0x52dc2b){logger['error'](_0x9218('0x12'),_0x1af929,_0x52dc2b);_0x2affb7(_0x52dc2b);});});}exports[_0x9218('0x15')]=function(_0x36640e){var _0x2ffc67=this;return new Promise(function(_0x592819,_0x27325a){return db[_0x9218('0x16')]['update'](_0x36640e[_0x9218('0x17')],{'raw':_0x36640e[_0x9218('0x18')]?_0x36640e[_0x9218('0x18')][_0x9218('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36640e['options']?_0x36640e[_0x9218('0x18')][_0x9218('0x1a')]||null:null,'attributes':_0x36640e['options']?_0x36640e['options'][_0x9218('0x1b')]||null:null,'limit':_0x36640e[_0x9218('0x18')]?_0x36640e[_0x9218('0x18')][_0x9218('0x1c')]||null:null})[_0x9218('0xa')](function(_0x35f7ce){logger[_0x9218('0xb')]('UpdateOpenchannelApplication',_0x36640e);logger[_0x9218('0xd')](_0x9218('0x15'),_0x36640e,JSON['stringify'](_0x35f7ce));_0x592819(_0x35f7ce);})[_0x9218('0x14')](function(_0xa4051e){logger[_0x9218('0x10')]('UpdateOpenchannelApplication',_0xa4051e['message'],_0x36640e);_0x27325a(_0x2ffc67[_0x9218('0x10')](0x1f4,_0xa4051e[_0x9218('0x13')]));});});}; \ No newline at end of file +var _0x4fd0=['result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','debug','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4fd0,0x110));var _0x04fd=function(_0x450aaf,_0x1c1a8c){_0x450aaf=_0x450aaf-0x0;var _0x199a88=_0x4fd0[_0x450aaf];return _0x199a88;};'use strict';var _=require(_0x04fd('0x0'));var util=require(_0x04fd('0x1'));var moment=require(_0x04fd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04fd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x04fd('0x4'))(_0x04fd('0x5'));var config=require(_0x04fd('0x6'));var jayson=require(_0x04fd('0x7'));var client=jayson[_0x04fd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50bf6f,_0x5c71ac,_0x49aa15){return new BPromise(function(_0x3506d4,_0x3b99db){return client[_0x04fd('0x9')](_0x50bf6f,_0x49aa15)[_0x04fd('0xa')](function(_0x5e65fe){logger[_0x04fd('0xb')](_0x04fd('0xc'),_0x5c71ac,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5c71ac,_0x04fd('0xd'),JSON[_0x04fd('0xe')](_0x5e65fe));if(_0x5e65fe[_0x04fd('0xf')]){if(_0x5e65fe[_0x04fd('0xf')][_0x04fd('0x10')]===0x1f4){logger[_0x04fd('0xf')](_0x04fd('0xc'),_0x5c71ac,_0x5e65fe[_0x04fd('0xf')][_0x04fd('0x11')]);return _0x3b99db(_0x5e65fe[_0x04fd('0xf')][_0x04fd('0x11')]);}logger[_0x04fd('0xf')](_0x04fd('0xc'),_0x5c71ac,_0x5e65fe[_0x04fd('0xf')][_0x04fd('0x11')]);return _0x3506d4(_0x5e65fe[_0x04fd('0xf')]['message']);}else{logger['info'](_0x04fd('0xc'),_0x5c71ac,_0x04fd('0xd'));_0x3506d4(_0x5e65fe[_0x04fd('0x12')][_0x04fd('0x11')]);}})['catch'](function(_0x330420){logger[_0x04fd('0xf')](_0x04fd('0xc'),_0x5c71ac,_0x330420);_0x3b99db(_0x330420);});});}exports[_0x04fd('0x13')]=function(_0x50038d){var _0x2079f6=this;return new Promise(function(_0x32006b,_0x5e5290){return db[_0x04fd('0x14')][_0x04fd('0x15')](_0x50038d[_0x04fd('0x16')],{'raw':_0x50038d['options']?_0x50038d[_0x04fd('0x17')][_0x04fd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50038d['options']?_0x50038d[_0x04fd('0x17')][_0x04fd('0x19')]||null:null,'attributes':_0x50038d['options']?_0x50038d[_0x04fd('0x17')]['attributes']||null:null,'limit':_0x50038d[_0x04fd('0x17')]?_0x50038d[_0x04fd('0x17')][_0x04fd('0x1a')]||null:null})[_0x04fd('0xa')](function(_0x765fb){logger[_0x04fd('0xb')](_0x04fd('0x13'),_0x50038d);logger[_0x04fd('0x1b')](_0x04fd('0x13'),_0x50038d,JSON[_0x04fd('0xe')](_0x765fb));_0x32006b(_0x765fb);})[_0x04fd('0x1c')](function(_0x15dd98){logger[_0x04fd('0xf')](_0x04fd('0x13'),_0x15dd98[_0x04fd('0x11')],_0x50038d);_0x5e5290(_0x2079f6['error'](0x1f4,_0x15dd98[_0x04fd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 5949e14..6a6a786 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 _0x9c70=['tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:destroy','destroy','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9c70,0x102));var _0x09c7=function(_0x4aaee3,_0x197d84){_0x4aaee3=_0x4aaee3-0x0;var _0x2c0791=_0x9c70[_0x4aaee3];return _0x2c0791;};'use strict';var multer=require(_0x09c7('0x0'));var util=require(_0x09c7('0x1'));var path=require(_0x09c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x09c7('0x3'));var router=express[_0x09c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x09c7('0x5'));var interaction=require(_0x09c7('0x6'));var config=require(_0x09c7('0x7'));var controller=require(_0x09c7('0x8'));router['get']('/',auth[_0x09c7('0x9')](),controller[_0x09c7('0xa')]);router[_0x09c7('0xb')](_0x09c7('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x09c7('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x09c7('0x9')](),controller[_0x09c7('0xd')]);router[_0x09c7('0xb')](_0x09c7('0xe'),auth[_0x09c7('0x9')](),controller[_0x09c7('0xf')]);router[_0x09c7('0x10')]('/',auth[_0x09c7('0x9')](),controller[_0x09c7('0x11')]);router[_0x09c7('0x10')](_0x09c7('0x12'),auth['isAuthenticated'](),controller[_0x09c7('0x13')]);router['post'](_0x09c7('0x14'),auth[_0x09c7('0x9')](),interaction[_0x09c7('0x15')](_0x09c7('0x16'),_0x09c7('0x17')),controller[_0x09c7('0x18')]);router[_0x09c7('0x19')](_0x09c7('0x1a'),auth[_0x09c7('0x9')](),interaction[_0x09c7('0x15')]('openchannel','openchannelinteraction:update'),controller['update']);router['delete']('/:id',auth[_0x09c7('0x9')](),interaction[_0x09c7('0x15')](_0x09c7('0x16'),_0x09c7('0x1b')),controller[_0x09c7('0x1c')]);router[_0x09c7('0x1d')](_0x09c7('0x14'),auth[_0x09c7('0x9')](),controller['removeTags']);module[_0x09c7('0x1e')]=router; \ No newline at end of file +var _0x8a12=['addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','/:id','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a12,0x1df));var _0x28a1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8a12[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x28a1('0x0'));var util=require(_0x28a1('0x1'));var path=require(_0x28a1('0x2'));var timeout=require(_0x28a1('0x3'));var express=require(_0x28a1('0x4'));var router=express[_0x28a1('0x5')]();var fs_extra=require(_0x28a1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x28a1('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x28a1('0x8')]('/',auth[_0x28a1('0x9')](),controller[_0x28a1('0xa')]);router[_0x28a1('0x8')]('/describe',auth[_0x28a1('0x9')](),controller[_0x28a1('0xb')]);router[_0x28a1('0x8')]('/:id',auth[_0x28a1('0x9')](),controller[_0x28a1('0xc')]);router[_0x28a1('0x8')](_0x28a1('0xd'),auth[_0x28a1('0x9')](),controller[_0x28a1('0xe')]);router['get']('/:id/download',auth[_0x28a1('0x9')](),controller['download']);router[_0x28a1('0xf')]('/',auth[_0x28a1('0x9')](),controller[_0x28a1('0x10')]);router[_0x28a1('0xf')](_0x28a1('0xd'),auth['isAuthenticated'](),controller[_0x28a1('0x11')]);router[_0x28a1('0xf')]('/:id/tags',auth[_0x28a1('0x9')](),interaction[_0x28a1('0x12')](_0x28a1('0x13'),_0x28a1('0x14')),controller[_0x28a1('0x15')]);router[_0x28a1('0x16')]('/:id',auth[_0x28a1('0x9')](),interaction['tracked'](_0x28a1('0x13'),_0x28a1('0x17')),controller[_0x28a1('0x18')]);router[_0x28a1('0x19')](_0x28a1('0x1a'),auth[_0x28a1('0x9')](),interaction['tracked'](_0x28a1('0x13'),_0x28a1('0x1b')),controller[_0x28a1('0x1c')]);router[_0x28a1('0x19')]('/:id/tags',auth[_0x28a1('0x9')](),controller[_0x28a1('0x1d')]);module[_0x28a1('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index bfba984..8b65751 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 _0xd04b=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x188695,_0x5c64ef){var _0x37a443=function(_0x7b7fd0){while(--_0x7b7fd0){_0x188695['push'](_0x188695['shift']());}};_0x37a443(++_0x5c64ef);}(_0xd04b,0x145));var _0xbd04=function(_0x51fb57,_0x5680dc){_0x51fb57=_0x51fb57-0x0;var _0x5f31ec=_0xd04b[_0x51fb57];return _0x5f31ec;};'use strict';var Sequelize=require(_0xbd04('0x0'));module[_0xbd04('0x1')]={'closed':{'type':Sequelize[_0xbd04('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbd04('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbd04('0x3')]},'note':{'type':Sequelize[_0xbd04('0x3')]},'read1stAt':{'type':Sequelize[_0xbd04('0x4')]},'threadId':{'type':Sequelize[_0xbd04('0x3')]},'externalUrl':{'type':Sequelize[_0xbd04('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbd04('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xbd04('0x5')]('in',_0xbd04('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbd04('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xbd04('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf822=['BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x5106e5,_0x1c590a){var _0x1209f4=function(_0x1eb10c){while(--_0x1eb10c){_0x5106e5['push'](_0x5106e5['shift']());}};_0x1209f4(++_0x1c590a);}(_0xf822,0x19e));var _0x2f82=function(_0x8b1ff3,_0x43fa68){_0x8b1ff3=_0x8b1ff3-0x0;var _0x987852=_0xf822[_0x8b1ff3];return _0x987852;};'use strict';var Sequelize=require(_0x2f82('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2f82('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2f82('0x2')]},'disposition':{'type':Sequelize[_0x2f82('0x3')]},'secondDisposition':{'type':Sequelize[_0x2f82('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2f82('0x3')]},'note':{'type':Sequelize[_0x2f82('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2f82('0x3')]},'externalUrl':{'type':Sequelize[_0x2f82('0x3')]},'lastMsgAt':{'type':Sequelize[_0x2f82('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2f82('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x2f82('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0888bd3..e848c8e 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 _0x1bac=['o.id\x20=\x20i.UserId','openchannel_accounts','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','sqlOperator','conditions','find','value','having','`\x20=\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','isEmpty','forEach','where','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','OpenchannelInteraction','unreadMessages','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','toString','OpenchannelInteractionId','all','rows','show','params','include','options','create','destroy','describe','addMessage','ids','omit','getMessages','rawAttributes','merge','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','OpenchannelMessage','findAll','addTags','spread','Tag','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','CmContact','Contact','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','N.A.','createdAt','closedAt','disposition','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','error','stack','map','fullname','TagIds','Tags','catch','waiting','answered','total','closed','UserId','talking','index','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1bac,0x1a1));var _0xc1ba=function(_0x89200b,_0x41435b){_0x89200b=_0x89200b-0x0;var _0x546a2d=_0x1bac[_0x89200b];return _0x546a2d;};'use strict';var emlformat=require(_0xc1ba('0x0'));var rimraf=require(_0xc1ba('0x1'));var zipdir=require(_0xc1ba('0x2'));var jsonpatch=require(_0xc1ba('0x3'));var rp=require(_0xc1ba('0x4'));var moment=require(_0xc1ba('0x5'));var BPromise=require(_0xc1ba('0x6'));var Mustache=require(_0xc1ba('0x7'));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(_0xc1ba('0x8'));var _=require(_0xc1ba('0x9'));var squel=require(_0xc1ba('0xa'));var crypto=require(_0xc1ba('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc1ba('0xc'));var querystring=require(_0xc1ba('0xd'));var Papa=require('papaparse');var Redis=require(_0xc1ba('0xe'));var authService=require(_0xc1ba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc1ba('0x10'));var pdf=require(_0xc1ba('0x11'));var hardwareService=require(_0xc1ba('0x12'));var logger=require('../../config/logger')(_0xc1ba('0x13'));var utils=require(_0xc1ba('0x14'));var config=require(_0xc1ba('0x15'));var licenseUtil=require(_0xc1ba('0x16'));var db=require(_0xc1ba('0x17'))['db'];config['redis']=_[_0xc1ba('0x18')](config['redis'],{'host':_0xc1ba('0x19'),'port':0x18eb});var socket=require(_0xc1ba('0x1a'))(new Redis(config[_0xc1ba('0x1b')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0xa1d35c,_0x26a5f1){_0x26a5f1=_0x26a5f1||0xcc;return function(_0x58fe5e){if(_0x58fe5e){return _0xa1d35c[_0xc1ba('0x1c')](_0x26a5f1);}return _0xa1d35c[_0xc1ba('0x1d')](_0x26a5f1)[_0xc1ba('0x1e')]();};}function respondWithResult(_0x24f748,_0x4749d2){_0x4749d2=_0x4749d2||0xc8;return function(_0x4f98eb){if(_0x4f98eb){return _0x24f748['status'](_0x4749d2)['json'](_0x4f98eb);}};}function respondWithFilteredResult(_0x3c9cf6,_0xa3db35){return function(_0x10c28c){if(_0x10c28c){var _0x251449=typeof _0xa3db35['offset']===_0xc1ba('0x1f')&&typeof _0xa3db35[_0xc1ba('0x20')]==='undefined';var _0x3c2108=_0x10c28c[_0xc1ba('0x21')];var _0x2e6e45=_0x251449?0x0:_0xa3db35['offset'];var _0x26403f=_0x251449?_0x10c28c[_0xc1ba('0x21')]:_0xa3db35[_0xc1ba('0x22')]+_0xa3db35['limit'];var _0x55cf3c;if(_0x26403f>=_0x3c2108){_0x26403f=_0x3c2108;_0x55cf3c=0xc8;}else{_0x55cf3c=0xce;}_0x3c9cf6[_0xc1ba('0x1d')](_0x55cf3c);return _0x3c9cf6['set'](_0xc1ba('0x23'),_0x2e6e45+'-'+_0x26403f+'/'+_0x3c2108)[_0xc1ba('0x24')](_0x10c28c);}return null;};}function patchUpdates(_0x11a608){return function(_0x134051){try{jsonpatch['apply'](_0x134051,_0x11a608,!![]);}catch(_0x2f34eb){return BPromise[_0xc1ba('0x25')](_0x2f34eb);}return _0x134051[_0xc1ba('0x26')]();};}function saveUpdates(_0x527b8a,_0x47cdcc){return function(_0x350276){if(_0x350276){return _0x350276[_0xc1ba('0x27')](_0x527b8a)[_0xc1ba('0x28')](function(_0x56e192){return _0x56e192;});}return null;};}function removeEntity(_0x5ec4c2,_0x6b3328){return function(_0xb59fdb){if(_0xb59fdb){return _0xb59fdb['destroy']()['then'](function(){_0x5ec4c2[_0xc1ba('0x1d')](0xcc)[_0xc1ba('0x1e')]();});}};}function handleEntityNotFound(_0x655b2a,_0x3f64ba){return function(_0x1865c5){if(!_0x1865c5){_0x655b2a[_0xc1ba('0x1c')](0x194);}return _0x1865c5;};}function handleError(_0x25d9f6,_0x4e4ccc){_0x4e4ccc=_0x4e4ccc||0x1f4;return function(_0x5cf870){logger[_0xc1ba('0x29')](_0x5cf870[_0xc1ba('0x2a')]);if(_0x5cf870['name']){delete _0x5cf870['name'];}_0x25d9f6[_0xc1ba('0x1d')](_0x4e4ccc)['send'](_0x5cf870);};}function getInteractionUsers(_0x130519,_0x32590f){return new BPromise(function(_0x49bda4,_0x77a30e){try{if(_0x32590f[_0x130519['id']]){_0x130519['Users']=_[_0xc1ba('0x2b')](_0x32590f[_0x130519['id']],function(_0x413692){return{'id':_0x413692['id'],'fullname':_0x413692[_0xc1ba('0x2c')]};});}}catch(_0x43c57c){_0x77a30e(_0x43c57c);}_0x49bda4(_0x130519);});}function getInteractionTags(_0x138af5,_0x30d3c4){return new BPromise(function(_0x4f3bdb,_0x3abbe2){try{if(_0x138af5['TagIds']){_0x138af5['Tags']=[];_0x138af5[_0xc1ba('0x2d')]['split'](',')['forEach'](function(_0x2eb889){_0x138af5[_0xc1ba('0x2e')]['push'](_0x30d3c4[_0x2eb889]);});}delete _0x138af5[_0xc1ba('0x2d')];}catch(_0x551083){_0x3abbe2(_0x551083);}_0x4f3bdb(_0x138af5);});}function updateOpenchannelInteraction(_0x19eb52,_0x1f8767,_0x1184cb){return new BPromise(function(_0x399c1c,_0x4583ec){return getInteractionUsers(_0x19eb52,_0x1184cb)['then'](function(_0xf68a97){return getInteractionTags(_0xf68a97,_0x1f8767);})['then'](function(_0x2b31cb){return getStateInteraction(_0x2b31cb);})[_0xc1ba('0x28')](function(_0x132bc5){_0x399c1c(_0x132bc5);})[_0xc1ba('0x2f')](function(_0x211a0f){_0x4583ec(_0x211a0f);});});}function getStateInteraction(_0x595bc5){return new BPromise(function(_0xbda676){_0x595bc5[_0xc1ba('0x30')]=0x0;_0x595bc5['talking']=0x0;_0x595bc5[_0xc1ba('0x31')]=0x0;_0x595bc5['unmanaged']=0x0;_0x595bc5[_0xc1ba('0x32')]=0x0;if(!_0x595bc5[_0xc1ba('0x33')]&&!_0x595bc5[_0xc1ba('0x34')]){_0x595bc5[_0xc1ba('0x30')]+=0x1;}if(!_0x595bc5['closed']&&_0x595bc5[_0xc1ba('0x34')]){_0x595bc5[_0xc1ba('0x35')]+=0x1;if(_0x595bc5[_0xc1ba('0x30')]){_0x595bc5['waiting']-=0x1;}}if(_0x595bc5[_0xc1ba('0x33')]&&_0x595bc5[_0xc1ba('0x34')]){_0x595bc5[_0xc1ba('0x31')]+=0x1;if(_0x595bc5[_0xc1ba('0x35')]){_0x595bc5[_0xc1ba('0x35')]-=0x1;}}if(_0x595bc5[_0xc1ba('0x33')]&&!_0x595bc5[_0xc1ba('0x34')]){_0x595bc5['unmanaged']+=0x1;if(_0x595bc5[_0xc1ba('0x30')]){_0x595bc5[_0xc1ba('0x30')]-=0x1;}}_0x595bc5[_0xc1ba('0x32')]+=0x1;_0xbda676(_0x595bc5);});}exports[_0xc1ba('0x36')]=function(_0x404185,_0x2e9de8){var _0x154f9e={},_0x127a92={},_0x43c6ec={'count':0x0,'rows':[]};var _0x1d1056=_[_0xc1ba('0x2b')](db['OpenchannelInteraction']['rawAttributes'],function(_0x47bf09){return{'name':_0x47bf09[_0xc1ba('0x37')],'type':_0x47bf09[_0xc1ba('0x38')][_0xc1ba('0x39')]};});_0x127a92[_0xc1ba('0x3a')]=_[_0xc1ba('0x2b')](_0x1d1056,_0xc1ba('0x3b'));_0x127a92[_0xc1ba('0x3c')]=_[_0xc1ba('0x3d')](_0x404185[_0xc1ba('0x3c')]);_0x127a92['filters']=_[_0xc1ba('0x3e')](_0x127a92[_0xc1ba('0x3a')],_0x127a92[_0xc1ba('0x3c')]);_0x154f9e['attributes']=_[_0xc1ba('0x3e')](_0x127a92[_0xc1ba('0x3a')],qs[_0xc1ba('0x3f')](_0x404185['query']['fields']));_0x154f9e[_0xc1ba('0x40')]=_0x154f9e[_0xc1ba('0x40')][_0xc1ba('0x41')]?_0x154f9e[_0xc1ba('0x40')]:_0x127a92[_0xc1ba('0x3a')];if(!_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x42')](_0xc1ba('0x43'))){_0x154f9e[_0xc1ba('0x20')]=qs[_0xc1ba('0x20')](_0x404185['query'][_0xc1ba('0x20')]);_0x154f9e[_0xc1ba('0x22')]=qs[_0xc1ba('0x22')](_0x404185['query']['offset']);}_0x154f9e['order']=qs['sort'](_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x44')]);_0x154f9e['where']=qs[_0xc1ba('0x45')](_[_0xc1ba('0x46')](_0x404185[_0xc1ba('0x3c')],_0x127a92['filters']),_0x1d1056);var _0x2ac8f2=[];var _0x22a87c=squel['select']()[_0xc1ba('0x47')]('id')[_0xc1ba('0x47')](_0xc1ba('0x3b'))[_0xc1ba('0x47')](_0xc1ba('0x48'))[_0xc1ba('0x49')](_0xc1ba('0x4a'));var _0x1fb0e5=squel[_0xc1ba('0x4b')]()[_0xc1ba('0x47')](_0xc1ba('0x4c'))['field'](_0xc1ba('0x4d'))[_0xc1ba('0x47')](_0xc1ba('0x4e'))['from'](_0xc1ba('0x4f'),'ui')[_0xc1ba('0x50')]('users','u',_0xc1ba('0x51'));var _0x1df004=squel[_0xc1ba('0x4b')]()[_0xc1ba('0x49')](_0xc1ba('0x52'),'i')['left_join']('cm_contacts','c',_0xc1ba('0x53'))['left_join'](_0xc1ba('0x54'),'o',_0xc1ba('0x55'))[_0xc1ba('0x50')](_0xc1ba('0x56'),'a',_0xc1ba('0x57'))['left_join'](_0xc1ba('0x58'),'me',_0xc1ba('0x59'))[_0xc1ba('0x50')](_0xc1ba('0x5a'),'it',_0xc1ba('0x5b'))[_0xc1ba('0x50')]('tools_tags','t',_0xc1ba('0x5c'));var _0x275c6c=squel[_0xc1ba('0x5d')]();var _0x41ba2a=[];var _0x432157=squel['expr']();var _0x5ea3fe;if(_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x5e')]){_0x5ea3fe=as[_0xc1ba('0x5f')](_0x404185[_0xc1ba('0x3c')]['search']);var _0x31ccb5=_0x5ea3fe[_0xc1ba('0x60')];for(var _0x4f560e=0x0;_0x4f560e<_0x5ea3fe[_0xc1ba('0x61')]['length'];_0x4f560e++){var _0x57a23a=_0x5ea3fe[_0xc1ba('0x61')][_0x4f560e];var _0x5759b5='i';var _0x2611f5=_[_0xc1ba('0x62')](_0x1d1056,[_0xc1ba('0x3b'),_0x57a23a[_0xc1ba('0x47')]]);if(!_0x2611f5){switch(_0x57a23a[_0xc1ba('0x47')]){case'unreadMessages':if(_0x57a23a[_0xc1ba('0x63')]==0x1){_0x1df004[_0xc1ba('0x64')]('`'+_0x57a23a['field']+_0xc1ba('0x65'));}else{_0x1df004[_0xc1ba('0x64')]('`'+_0x57a23a['field']+'`\x20>\x200');}break;case'Contact':if(_0x57a23a[_0xc1ba('0x66')]===_0xc1ba('0x67')){if(_0x57a23a[_0xc1ba('0x63')][_0xc1ba('0x68')]('\x20')[_0xc1ba('0x41')]>0x1){_0x275c6c[_0x31ccb5](_0xc1ba('0x69'),qs[_0xc1ba('0x6a')](_0x57a23a[_0xc1ba('0x63')]),null);}else{var _0x104687='%'+_0x57a23a['value']+'%';_0x275c6c[_0x31ccb5](_0xc1ba('0x6b'),_0x104687,_0x104687,_0x104687);}}else{_0x2611f5=_[_0xc1ba('0x62')](_0x1d1056,[_0xc1ba('0x3b'),_0xc1ba('0x6c')]);_0x57a23a[_0xc1ba('0x47')]=_0xc1ba('0x6c');_0x3273c7=as['buildExpression'](_0x5759b5,_0x2611f5[_0xc1ba('0x38')],_0x57a23a);_0x275c6c[_0x31ccb5](_0x3273c7[_0xc1ba('0x6d')],_0x3273c7['value'][_0xc1ba('0x6e')],_0x3273c7[_0xc1ba('0x63')][_0xc1ba('0x1e')]);}break;case'Tag':var _0x415982=_0x57a23a[_0xc1ba('0x63')][_0xc1ba('0x68')](',')[_0xc1ba('0x2b')](function(_0x2d48ad){return Number(_0x2d48ad);});_0x415982['forEach'](function(_0xcb6fa7){_0x432157['or'](_0xc1ba('0x6f'),'%,'+_0xcb6fa7+',%');});_0x41ba2a=_[_0xc1ba('0x70')](_0x41ba2a,_0x415982);break;case _0xc1ba('0x71'):if(_0x57a23a[_0xc1ba('0x66')]===_0xc1ba('0x67')){_0x275c6c[_0x31ccb5](_0xc1ba('0x72'),'%'+_0x57a23a[_0xc1ba('0x63')]+'%',null);}else{_0x2611f5=_[_0xc1ba('0x62')](_0x1d1056,[_0xc1ba('0x3b'),_0xc1ba('0x34')]);_0x57a23a[_0xc1ba('0x47')]='UserId';_0x3273c7=as[_0xc1ba('0x73')](_0x5759b5,_0x2611f5[_0xc1ba('0x38')],_0x57a23a);_0x275c6c[_0x31ccb5](_0x3273c7['text'],_0x3273c7[_0xc1ba('0x63')]['start'],_0x3273c7[_0xc1ba('0x63')][_0xc1ba('0x1e')]);}break;case _0xc1ba('0x74'):_0x3273c7=as[_0xc1ba('0x73')]('me',null,_0x57a23a);_0x275c6c[_0x31ccb5](_0x3273c7['text'],_0x3273c7[_0xc1ba('0x63')][_0xc1ba('0x6e')],_0x3273c7[_0xc1ba('0x63')][_0xc1ba('0x1e')]);break;}}else{var _0x3273c7=as[_0xc1ba('0x73')](_0x5759b5,_0x2611f5['type'],_0x57a23a);_0x275c6c[_0x31ccb5](_0x3273c7[_0xc1ba('0x6d')],_0x3273c7[_0xc1ba('0x63')][_0xc1ba('0x6e')],_0x3273c7['value'][_0xc1ba('0x1e')]);}}}else{var _0x29787c=_(_0x404185[_0xc1ba('0x3c')])[_0xc1ba('0x3d')]()[_0xc1ba('0x2b')](function(_0x23d547){return _[_0xc1ba('0x75')](_0x1d1056,[_0xc1ba('0x3b'),_0x23d547])?_0x23d547:undefined;})[_0xc1ba('0x76')]()['value']();if(!_[_0xc1ba('0x77')](_0x29787c)){_0x29787c[_0xc1ba('0x78')](function(_0x386d6c){if(_0x386d6c==='OpenchannelAccountId'){_0x1df004[_0xc1ba('0x79')](_0xc1ba('0x7a'),[][_0xc1ba('0x7b')](_0x404185[_0xc1ba('0x3c')][_0x386d6c]));}else if(_0x386d6c==='createdAt'){var _0x1b4ff2=JSON[_0xc1ba('0x7c')](_0x404185[_0xc1ba('0x3c')][_0x386d6c])[_0xc1ba('0x7d')];var _0x2d7302=JSON[_0xc1ba('0x7c')](_0x404185['query'][_0x386d6c])[_0xc1ba('0x7e')];_0x1df004[_0xc1ba('0x79')](_0xc1ba('0x7f'),_0x1b4ff2,_0x2d7302);}else{if(_0x404185[_0xc1ba('0x3c')][_0x386d6c]===_0xc1ba('0x80')){_0x1df004['where']('i.'+_0x386d6c+_0xc1ba('0x81'));}else{_0x1df004['where']('i.'+_0x386d6c+_0xc1ba('0x82'),_0x404185['query'][_0x386d6c]);}}});}if(_0x404185['query'][_0xc1ba('0x83')]){if(_0x404185['query'][_0xc1ba('0x83')]==0x1){_0x1df004[_0xc1ba('0x64')](_0xc1ba('0x84'));}else{_0x1df004[_0xc1ba('0x64')](_0xc1ba('0x85'));}}if(_0x404185['query'][_0xc1ba('0x86')]){_0x41ba2a=_['isArray'](_0x404185['query']['tag'])?_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x86')]:new Array(_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x86')]);_0x41ba2a[_0xc1ba('0x78')](function(_0x1a1cc4){_0x432157['or'](_0xc1ba('0x6f'),'%,'+_0x1a1cc4+',%');});}if(_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x87')]){var _0x513da4=_0x404185['query'][_0xc1ba('0x87')]['replace']('\x5c','\x5c\x5c')[_0xc1ba('0x88')](/'/g,'\x27\x27');if(qs[_0xc1ba('0x89')](_0x513da4)){_0x275c6c['or'](_0xc1ba('0x8a'),_0x513da4+'%');}else{_0x275c6c['or'](_0xc1ba('0x8b'),qs[_0xc1ba('0x6a')](_0x513da4))['or'](_0xc1ba('0x8c'),_0x513da4+'%')['or'](_0xc1ba('0x8d'),_0x513da4+'%');}}}_0x1df004['where'](_0x275c6c);_0x1df004[_0xc1ba('0x8e')](_0xc1ba('0x8f'));var _0x169287={'type':db[_0xc1ba('0x90')][_0xc1ba('0x91')][_0xc1ba('0x92')],'raw':!![]};var _0x41445f=_0x1df004['clone']();_0x41445f[_0xc1ba('0x47')](_0xc1ba('0x8f'));_0x41445f[_0xc1ba('0x47')](_0xc1ba('0x93'),'unreadMessages');if(_0x154f9e[_0xc1ba('0x94')]){_0x154f9e[_0xc1ba('0x94')][_0xc1ba('0x78')](function(_0x42ff72){var _0x6c2d20=_0x42ff72[0x0]==='contactName'?_0x42ff72[0x0]:'i.'+_0x42ff72[0x0];_0x1df004[_0xc1ba('0x94')](_0x6c2d20,_0x42ff72[0x1]===_0xc1ba('0x95')?![]:!![]);});}if(!_['isEmpty'](_0x41ba2a)){_0x1df004[_0xc1ba('0x64')](_0x432157);_0x41445f[_0xc1ba('0x79')](_0xc1ba('0x96'),_0x41ba2a);}BPromise['resolve']()[_0xc1ba('0x28')](function(){if(!_0x5ea3fe){if(_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x97')])return;_0x41445f[_0xc1ba('0x79')](_0xc1ba('0x98'));_0x1df004[_0xc1ba('0x79')](_0xc1ba('0x98'));return;}if(_0x404185[_0xc1ba('0x99')][_0xc1ba('0x9a')]!=='agent')return;return _0x404185[_0xc1ba('0x99')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xc1ba('0x28')](function(_0x9598be){if(_[_0xc1ba('0x77')](_0x9598be)){_0x41445f[_0xc1ba('0x79')](_0xc1ba('0x9b'));_0x1df004[_0xc1ba('0x79')](_0xc1ba('0x9b'));}else{_0x41445f[_0xc1ba('0x79')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xc1ba('0x2b')](_0x9598be,'id'));_0x1df004[_0xc1ba('0x79')](_0xc1ba('0x7a'),_['map'](_0x9598be,'id'));}});})[_0xc1ba('0x28')](function(){if(_0x404185[_0xc1ba('0x99')][_0xc1ba('0x9a')]===_0xc1ba('0x9c')&&!_0x5ea3fe&&!_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x97')])return[];return db[_0xc1ba('0x9d')]['query'](_0x41445f['toString'](),_0x169287);})['then'](function(_0x4d17b7){_0x43c6ec[_0xc1ba('0x21')]=_0x4d17b7[_0xc1ba('0x41')];if(_0x43c6ec['count']===0x0)return[];return db[_0xc1ba('0x9d')]['query'](_0x22a87c['toString'](),_0x169287)[_0xc1ba('0x28')](function(_0x2a0a31){_0x2ac8f2=_['keyBy'](_0x2a0a31,'id');_0x169287=_['merge'](_0x169287,{'model':db[_0xc1ba('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x404185[_0xc1ba('0x3c')][_0xc1ba('0x3f')]){_0x154f9e['attributes'][_0xc1ba('0x78')](function(_0x1e3511){_0x1df004[_0xc1ba('0x47')]('i.'+_0x1e3511);});}else{_0x1df004[_0xc1ba('0x47')](_0xc1ba('0x93'),_0xc1ba('0x9f'));_0x1df004[_0xc1ba('0x47')](_0xc1ba('0xa0'),_0xc1ba('0xa1'));_0x1df004['field'](_0xc1ba('0xa2'),'Account.mandatoryDisposition');_0x1df004[_0xc1ba('0x47')](_0xc1ba('0xa3'),_0xc1ba('0xa4'));_0x1df004['field'](_0xc1ba('0xa5'));_0x1df004['field'](_0xc1ba('0xa6'),_0xc1ba('0xa7'));_0x1df004[_0xc1ba('0x47')]('c.lastName',_0xc1ba('0xa8'));_0x1df004[_0xc1ba('0x47')](_0xc1ba('0xa9'),_0xc1ba('0xaa'));_0x1df004[_0xc1ba('0x47')](_0xc1ba('0xab'),_0xc1ba('0xac'));_0x1df004['field'](_0xc1ba('0xad'),'Contact.mobile');_0x1df004['field'](_0xc1ba('0xae'),_0xc1ba('0xaf'));_0x1df004['field'](_0xc1ba('0xb0'),_0xc1ba('0xb1'));_0x1df004[_0xc1ba('0x47')](_0xc1ba('0xb2'),_0xc1ba('0xb3'));_0x1df004[_0xc1ba('0x47')](_0xc1ba('0xb4'),_0xc1ba('0x2d'));}if(_0x154f9e[_0xc1ba('0x20')])_0x1df004[_0xc1ba('0x20')](_0x154f9e[_0xc1ba('0x20')]);if(_0x154f9e[_0xc1ba('0x22')])_0x1df004[_0xc1ba('0x22')](_0x154f9e[_0xc1ba('0x22')]);return db[_0xc1ba('0x9d')][_0xc1ba('0x3c')](_0x1df004['toString'](),_0x169287);})[_0xc1ba('0x28')](function(_0x461123){if(_0x461123[_0xc1ba('0x41')]>0x0)_0x1fb0e5[_0xc1ba('0x79')](_0xc1ba('0xb5'),_['map'](_0x461123,'id'));return db[_0xc1ba('0x9d')][_0xc1ba('0x3c')](_0x1fb0e5[_0xc1ba('0xb6')](),_0x169287)['then'](function(_0x14730e){var _0x9e92e9=_['groupBy'](_0x14730e,_0xc1ba('0xb7'));var _0x208583=[];_0x461123[_0xc1ba('0x78')](function(_0x3e43e5){_0x208583['push'](updateOpenchannelInteraction(_0x3e43e5,_0x2ac8f2,_0x9e92e9));});return BPromise[_0xc1ba('0xb8')](_0x208583);});});})[_0xc1ba('0x28')](function(_0x2f899f){_0x43c6ec[_0xc1ba('0xb9')]=_0x2f899f;return _0x43c6ec;})[_0xc1ba('0x28')](respondWithFilteredResult(_0x2e9de8,_0x154f9e))[_0xc1ba('0x2f')](handleError(_0x2e9de8,null));};exports[_0xc1ba('0xba')]=function(_0x2ffe57,_0x5455f1){var _0x216961={};if(_0x2ffe57[_0xc1ba('0x3c')]['type']&&_0x2ffe57[_0xc1ba('0x3c')][_0xc1ba('0x38')]===_0xc1ba('0x49')){_0x216961[_0xc1ba('0x49')]=_0x2ffe57[_0xc1ba('0xbb')]['id'];}else{_0x216961['id']=_0x2ffe57['params']['id'];}var _0x36f4db={'raw':![],'where':_0x216961},_0x34dc68={};_0x34dc68[_0xc1ba('0x3a')]=_[_0xc1ba('0x3d')](db[_0xc1ba('0x9e')]['rawAttributes']);_0x34dc68[_0xc1ba('0x3c')]=_[_0xc1ba('0x3d')](_0x2ffe57[_0xc1ba('0x3c')]);_0x34dc68[_0xc1ba('0x45')]=_['intersection'](_0x34dc68[_0xc1ba('0x3a')],_0x34dc68['query']);_0x36f4db['attributes']=_[_0xc1ba('0x3e')](_0x34dc68[_0xc1ba('0x3a')],qs[_0xc1ba('0x3f')](_0x2ffe57[_0xc1ba('0x3c')][_0xc1ba('0x3f')]));_0x36f4db['attributes']=_0x36f4db[_0xc1ba('0x40')]['length']?_0x36f4db[_0xc1ba('0x40')]:_0x34dc68[_0xc1ba('0x3a')];if(_0x2ffe57[_0xc1ba('0x3c')]['includeAll']){_0x36f4db[_0xc1ba('0xbc')]=[{'all':!![]}];}_0x36f4db=_['merge']({},_0x36f4db,_0x2ffe57[_0xc1ba('0xbd')]);return db[_0xc1ba('0x9e')][_0xc1ba('0x62')](_0x36f4db)[_0xc1ba('0x28')](handleEntityNotFound(_0x5455f1,null))[_0xc1ba('0x28')](respondWithResult(_0x5455f1,null))[_0xc1ba('0x2f')](handleError(_0x5455f1,null));};exports[_0xc1ba('0xbe')]=function(_0x46c45b,_0x26cd3f){return db[_0xc1ba('0x9e')][_0xc1ba('0xbe')](_0x46c45b[_0xc1ba('0x74')],{})[_0xc1ba('0x28')](respondWithResult(_0x26cd3f,0xc9))[_0xc1ba('0x2f')](handleError(_0x26cd3f,null));};exports[_0xc1ba('0x27')]=function(_0xdef8f0,_0x28470b){if(_0xdef8f0[_0xc1ba('0x74')]['id']){delete _0xdef8f0['body']['id'];}return db[_0xc1ba('0x9e')][_0xc1ba('0x62')]({'where':{'id':_0xdef8f0[_0xc1ba('0xbb')]['id']}})['then'](handleEntityNotFound(_0x28470b,null))[_0xc1ba('0x28')](saveUpdates(_0xdef8f0[_0xc1ba('0x74')],null))['then'](respondWithResult(_0x28470b,null))['catch'](handleError(_0x28470b,null));};exports[_0xc1ba('0xbf')]=function(_0x5ae3e3,_0x49983d){return db['OpenchannelInteraction'][_0xc1ba('0x62')]({'where':{'id':_0x5ae3e3['params']['id']}})[_0xc1ba('0x28')](handleEntityNotFound(_0x49983d,null))[_0xc1ba('0x28')](removeEntity(_0x49983d,null))[_0xc1ba('0x2f')](handleError(_0x49983d,null));};exports[_0xc1ba('0xc0')]=function(_0x3f7c0c,_0x538e13){return db[_0xc1ba('0x9e')][_0xc1ba('0xc0')]()['then'](respondWithResult(_0x538e13,null))[_0xc1ba('0x2f')](handleError(_0x538e13,null));};exports[_0xc1ba('0xc1')]=function(_0xbac6bf,_0x7378d3,_0x27abe6){return db['OpenchannelMessage'][_0xc1ba('0x62')]({'where':{'id':_0xbac6bf[_0xc1ba('0xbb')]['id']}})[_0xc1ba('0x28')](handleEntityNotFound(_0x7378d3,null))[_0xc1ba('0x28')](function(_0x231607){if(_0x231607){return _0x231607[_0xc1ba('0xc1')](_0xbac6bf[_0xc1ba('0x74')][_0xc1ba('0xc2')],_[_0xc1ba('0xc3')](_0xbac6bf['body'],['ids','id'])||{});}})[_0xc1ba('0x28')](respondWithResult(_0x7378d3,null))[_0xc1ba('0x2f')](handleError(_0x7378d3,null));};exports[_0xc1ba('0xc4')]=function(_0x329b7a,_0x3478c2,_0x3dc938){var _0x58825f={'raw':![],'where':{}};var _0x5da0b7={};var _0x370caa={'count':0x0,'rows':[]};return db[_0xc1ba('0x9e')]['findOne']({'where':{'id':_0x329b7a[_0xc1ba('0xbb')]['id']}})[_0xc1ba('0x28')](handleEntityNotFound(_0x3478c2,null))[_0xc1ba('0x28')](function(_0x596d9b){if(_0x596d9b){_0x5da0b7[_0xc1ba('0x3a')]=_['keys'](db['OpenchannelMessage'][_0xc1ba('0xc5')]);_0x5da0b7['query']=_[_0xc1ba('0x3d')](_0x329b7a['query']);_0x5da0b7[_0xc1ba('0x45')]=_[_0xc1ba('0x3e')](_0x5da0b7[_0xc1ba('0x3a')],_0x5da0b7[_0xc1ba('0x3c')]);_0x58825f[_0xc1ba('0x40')]=_['intersection'](_0x5da0b7[_0xc1ba('0x3a')],qs[_0xc1ba('0x3f')](_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x3f')]));_0x58825f[_0xc1ba('0x40')]=_0x58825f[_0xc1ba('0x40')][_0xc1ba('0x41')]?_0x58825f[_0xc1ba('0x40')]:_0x5da0b7[_0xc1ba('0x3a')];if(!_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x42')](_0xc1ba('0x43'))){_0x58825f['limit']=qs[_0xc1ba('0x20')](_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x20')]);_0x58825f[_0xc1ba('0x22')]=qs[_0xc1ba('0x22')](_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x22')]);}_0x58825f[_0xc1ba('0x94')]=qs[_0xc1ba('0x44')](_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x44')]);_0x58825f[_0xc1ba('0x79')]=qs[_0xc1ba('0x45')](_[_0xc1ba('0x46')](_0x329b7a[_0xc1ba('0x3c')],_0x5da0b7[_0xc1ba('0x45')]));_0x58825f[_0xc1ba('0x79')]['OpenchannelInteractionId']=_0x596d9b['id'];if(_0x329b7a['query'][_0xc1ba('0x87')]){_0x58825f[_0xc1ba('0x79')]=_[_0xc1ba('0xc6')](_0x58825f['where'],{'$or':_[_0xc1ba('0x2b')](_0x58825f[_0xc1ba('0x40')],function(_0x46470f){var _0x3f6ad1={};_0x3f6ad1[_0x46470f]={'$like':'%'+_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x87')]+'%'};return _0x3f6ad1;})});}if(_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x7d')]){var _0x1a7f5=_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0x7d')][_0xc1ba('0x68')](',');var _0x1543a4={};_0x1543a4[_0x1a7f5[0x0]]={'$gte':moment(_0x1a7f5[0x1])[_0xc1ba('0xc7')](_0xc1ba('0xc8'))};_0x58825f['where']=_[_0xc1ba('0xc6')](_0x58825f[_0xc1ba('0x79')],_0x1543a4);}_0x58825f=_[_0xc1ba('0xc6')]({},_0x58825f,_0x329b7a[_0xc1ba('0xbd')]);return db['OpenchannelMessage'][_0xc1ba('0x21')]({'where':_0x58825f[_0xc1ba('0x79')]})[_0xc1ba('0x28')](function(_0x1ec4a5){_0x370caa[_0xc1ba('0x21')]=_0x1ec4a5;if(_0x329b7a[_0xc1ba('0x3c')][_0xc1ba('0xc9')]){_0x58825f[_0xc1ba('0xbc')]=[{'all':!![]}];}return db[_0xc1ba('0xca')][_0xc1ba('0xcb')](_0x58825f);})[_0xc1ba('0x28')](function(_0x58f0c0){_0x370caa[_0xc1ba('0xb9')]=_0x58f0c0;return _0x370caa;});}})[_0xc1ba('0x28')](respondWithFilteredResult(_0x3478c2,_0x58825f))[_0xc1ba('0x2f')](handleError(_0x3478c2,null));};exports[_0xc1ba('0xcc')]=function(_0x41d655,_0xe384c0,_0x5b2599){return db[_0xc1ba('0x9e')][_0xc1ba('0x62')]({'where':{'id':_0x41d655[_0xc1ba('0xbb')]['id']}})['then'](handleEntityNotFound(_0xe384c0,null))[_0xc1ba('0x28')](function(_0x530d4a){if(_0x530d4a){return _0x530d4a['setTags'](_0x41d655[_0xc1ba('0x74')][_0xc1ba('0xc2')],_[_0xc1ba('0xc3')](_0x41d655['body'],['ids','id'])||{})[_0xc1ba('0xcd')](function(){return db[_0xc1ba('0xce')][_0xc1ba('0xcb')]({'attributes':['id',_0xc1ba('0x3b'),'color'],'where':{'id':_0x41d655['body']['ids']}});})[_0xc1ba('0x28')](function(_0xfda03e){socket['emit'](_0xc1ba('0xcf'),{'id':Number(_0x41d655['params']['id']),'tags':_0xfda03e||[]});return{'id':Number(_0x41d655['params']['id']),'tags':_0xfda03e||[]};});}})[_0xc1ba('0x28')](respondWithResult(_0xe384c0,null))[_0xc1ba('0x2f')](handleError(_0xe384c0,null));};exports[_0xc1ba('0xd0')]=function(_0x3562bb,_0x3fd1cc,_0x4f3997){return db[_0xc1ba('0x9e')]['find']({'where':{'id':_0x3562bb[_0xc1ba('0xbb')]['id']}})[_0xc1ba('0x28')](handleEntityNotFound(_0x3fd1cc,null))['then'](function(_0x1aef56){if(_0x1aef56){return _0x1aef56[_0xc1ba('0xd0')](_0x3562bb['query'][_0xc1ba('0xc2')]);}})[_0xc1ba('0x28')](respondWithStatusCode(_0x3fd1cc,null))[_0xc1ba('0x2f')](handleError(_0x3fd1cc,null));};exports[_0xc1ba('0xd1')]=function(_0x1654bf,_0x28560f){var _0x50ef3e=moment()[_0xc1ba('0xd2')]()['toString']();var _0x1bb3b0=path[_0xc1ba('0xd3')](config[_0xc1ba('0xd4')],_0xc1ba('0xd5'),_0xc1ba('0xd6'),_0xc1ba('0xd7'));var _0x5703d7=path['join'](config[_0xc1ba('0xd4')],_0xc1ba('0xd5'),_0xc1ba('0xd6'),_0xc1ba('0xd8'));var _0x45451f=path[_0xc1ba('0xd3')](_0x1bb3b0,_0x50ef3e);var _0x1d70f7=util['format'](_0xc1ba('0xd9'),_0x1654bf[_0xc1ba('0xbb')]['id'],_0x50ef3e);var _0x45a9e9=path['join'](_0x1bb3b0,_0x1d70f7);var _0x3674b2=[];_0x3674b2[_0xc1ba('0xda')]({'model':db[_0xc1ba('0x71')],'as':_0xc1ba('0x71'),'attributes':['id',_0xc1ba('0x2c')],'raw':!![]});_0x3674b2[_0xc1ba('0xda')]({'model':db[_0xc1ba('0xdb')],'as':_0xc1ba('0xdc'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x1654bf[_0xc1ba('0x3c')]['attachments']){_0x3674b2[_0xc1ba('0xda')]({'model':db[_0xc1ba('0xdd')],'as':_0xc1ba('0xdd'),'raw':!![]});}var _0x144399=[{'model':db[_0xc1ba('0xca')],'as':_0xc1ba('0xde'),'attributes':['id',_0xc1ba('0x74'),'createdAt',_0xc1ba('0xdf'),_0xc1ba('0xe0'),_0xc1ba('0x83')],'include':_0x3674b2}];_0x144399[_0xc1ba('0xda')]({'model':db[_0xc1ba('0xe1')],'as':_0xc1ba('0xe2'),'attributes':['id',_0xc1ba('0x3b')]});_0x144399[_0xc1ba('0xda')]({'model':db[_0xc1ba('0x71')],'as':_0xc1ba('0xe3'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xc1ba('0x62')]({'where':{'id':_0x1654bf[_0xc1ba('0xbb')]['id']},'include':_0x144399})['then'](handleEntityNotFound(_0x28560f,null))[_0xc1ba('0x28')](function(_0x4364b9){if(_0x4364b9){var _0x4ce8a9=_0x4364b9['get']({'plain':!![]});fs['mkdirSync'](_0x45451f);var _0x3feccb={'channel':'Openchannel','account':_0x4ce8a9[_0xc1ba('0xe2')][_0xc1ba('0x3b')],'agent':_0x4ce8a9['Owner']?_0x4ce8a9[_0xc1ba('0xe3')][_0xc1ba('0x2c')]:_0xc1ba('0xe4'),'createdAt':moment(_0x4ce8a9[_0xc1ba('0xe5')])[_0xc1ba('0xc7')](_0xc1ba('0xc8'))['toString'](),'closedAt':_0x4ce8a9[_0xc1ba('0x33')]?moment(_0x4ce8a9[_0xc1ba('0xe6')])[_0xc1ba('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc1ba('0xb6')]():'','disposition':_0x4ce8a9[_0xc1ba('0xe7')],'visibility':_0x4ce8a9['threadId']?_0xc1ba('0xe8'):_0xc1ba('0xe9'),'messages':_(_0x4ce8a9[_0xc1ba('0xde')])[_0xc1ba('0x87')]({'secret':![]})[_0xc1ba('0x2b')](function(_0x415e8a){if(_0x415e8a[_0xc1ba('0xdd')]){var _0x5e2352=path[_0xc1ba('0xd3')](_0x5703d7,_0x415e8a[_0xc1ba('0xdd')][_0xc1ba('0xea')]);if(fs[_0xc1ba('0xeb')](_0x5e2352)){fs[_0xc1ba('0xec')](_0x5e2352)[_0xc1ba('0xed')](fs[_0xc1ba('0xee')](path[_0xc1ba('0xd3')](_0x45451f,_0x415e8a['Attachment'][_0xc1ba('0xea')])));}}return{'date':moment(_0x415e8a['createdAt'])[_0xc1ba('0xc7')](_0xc1ba('0xc8'))[_0xc1ba('0xb6')](),'sender':_0x415e8a['direction']===_0xc1ba('0xef')?_0x415e8a['User']?_0x415e8a[_0xc1ba('0x71')][_0xc1ba('0x2c')]:'System':_0x415e8a[_0xc1ba('0xdc')]['firstName']+(_0x415e8a['Contact'][_0xc1ba('0xf0')]?'\x20'+_0x415e8a[_0xc1ba('0xdc')][_0xc1ba('0xf0')]:''),'body':_0x415e8a[_0xc1ba('0xdd')]?_0x415e8a[_0xc1ba('0xdd')]['basename']:_0x415e8a['body'],'direction':_0x415e8a[_0xc1ba('0xdf')]===_0xc1ba('0xef')?'A':'C','secret':_0x415e8a['secret'],'read':_0x415e8a[_0xc1ba('0x83')],'attachment':_0x415e8a[_0xc1ba('0xdd')]};})[_0xc1ba('0x63')]()};return ejs[_0xc1ba('0xf1')](path[_0xc1ba('0xd3')](config[_0xc1ba('0xd4')],_0xc1ba('0xd5'),_0xc1ba('0xf2'),_0xc1ba('0xf3')),{'interaction':_0x3feccb})[_0xc1ba('0x28')](function(_0x1d1cde){var _0x23d663=path[_0xc1ba('0xd3')](_0x45451f,_0xc1ba('0xf4')+_0x4ce8a9['id']+'-'+_0x50ef3e+_0xc1ba('0xf5'));var _0x5de945={'path':_0x23d663,'channel':_0xc1ba('0xf6'),'interactionId':_0x4ce8a9['id']};return pdf[_0xc1ba('0xf7')](_0x1d1cde,_0x5de945);})[_0xc1ba('0x28')](function(){return new BPromise(function(_0xefb812,_0x79cdd6){zipdir(_0x45451f,{'saveTo':_0x45a9e9},function(_0x2e585d,_0x4afdbb){if(_0x2e585d)return _0x79cdd6(_0x2e585d);return _0xefb812(_0x4afdbb);});})[_0xc1ba('0x28')](function(){return new BPromise(function(_0x3a9ff7,_0x1e9a52){rimraf(_0x45451f,function(_0x24f45c){if(_0x24f45c)_0x1e9a52(_0x24f45c);return _0x3a9ff7();});});})[_0xc1ba('0x28')](function(){return _0x28560f['download'](_0x45a9e9,_0x1d70f7,function(_0x1ae759){if(_0x1ae759){console[_0xc1ba('0xf8')](_0xc1ba('0xf9'),_0x1ae759);}else{fs[_0xc1ba('0xfa')](_0x45a9e9);}});});});}else{return _0x28560f['sendStatus'](0xc8);}})['catch'](handleError(_0x28560f,null));}; \ No newline at end of file +var _0x4477=['model','fields','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','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)','getFullTextValue','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','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','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','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','include','options','create','describe','OpenchannelMessage','ids','omit','getMessages','keys','nolimit','format','setTags','spread','findAll','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../mysqldb','defaults','redis','./openchannelInteraction.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','attributes'];(function(_0x54fd6,_0x29a48c){var _0x3903d6=function(_0x2506dc){while(--_0x2506dc){_0x54fd6['push'](_0x54fd6['shift']());}};_0x3903d6(++_0x29a48c);}(_0x4477,0x1a7));var _0x7447=function(_0x21abc4,_0x28aca9){_0x21abc4=_0x21abc4-0x0;var _0x3764b0=_0x4477[_0x21abc4];return _0x3764b0;};'use strict';var emlformat=require(_0x7447('0x0'));var rimraf=require(_0x7447('0x1'));var zipdir=require(_0x7447('0x2'));var jsonpatch=require(_0x7447('0x3'));var rp=require(_0x7447('0x4'));var moment=require(_0x7447('0x5'));var BPromise=require(_0x7447('0x6'));var Mustache=require('mustache');var util=require(_0x7447('0x7'));var path=require(_0x7447('0x8'));var sox=require('sox');var csv=require(_0x7447('0x9'));var ejs=require(_0x7447('0xa'));var fs=require('fs');var fs_extra=require(_0x7447('0xb'));var _=require('lodash');var squel=require(_0x7447('0xc'));var crypto=require(_0x7447('0xd'));var jsforce=require(_0x7447('0xe'));var deskjs=require(_0x7447('0xf'));var toCsv=require(_0x7447('0x9'));var querystring=require('querystring');var Papa=require(_0x7447('0x10'));var Redis=require('ioredis');var authService=require(_0x7447('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7447('0x12'));var pdf=require(_0x7447('0x13'));var hardwareService=require(_0x7447('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7447('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7447('0x16'))['db'];config['redis']=_[_0x7447('0x17')](config[_0x7447('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7447('0x18')]));require(_0x7447('0x19'))['register'](socket);function respondWithStatusCode(_0x34d4fd,_0x5c6ba3){_0x5c6ba3=_0x5c6ba3||0xcc;return function(_0x276a1d){if(_0x276a1d){return _0x34d4fd['sendStatus'](_0x5c6ba3);}return _0x34d4fd[_0x7447('0x1a')](_0x5c6ba3)[_0x7447('0x1b')]();};}function respondWithResult(_0x448bae,_0x1cd99e){_0x1cd99e=_0x1cd99e||0xc8;return function(_0x508080){if(_0x508080){return _0x448bae[_0x7447('0x1a')](_0x1cd99e)[_0x7447('0x1c')](_0x508080);}};}function respondWithFilteredResult(_0x2c697e,_0x3cd26){return function(_0x526ee0){if(_0x526ee0){var _0x41757c=typeof _0x3cd26[_0x7447('0x1d')]==='undefined'&&typeof _0x3cd26['limit']===_0x7447('0x1e');var _0x411869=_0x526ee0[_0x7447('0x1f')];var _0x3d632a=_0x41757c?0x0:_0x3cd26['offset'];var _0x12c0f8=_0x41757c?_0x526ee0[_0x7447('0x1f')]:_0x3cd26[_0x7447('0x1d')]+_0x3cd26[_0x7447('0x20')];var _0x4e906d;if(_0x12c0f8>=_0x411869){_0x12c0f8=_0x411869;_0x4e906d=0xc8;}else{_0x4e906d=0xce;}_0x2c697e[_0x7447('0x1a')](_0x4e906d);return _0x2c697e[_0x7447('0x21')](_0x7447('0x22'),_0x3d632a+'-'+_0x12c0f8+'/'+_0x411869)['json'](_0x526ee0);}return null;};}function patchUpdates(_0x565415){return function(_0x362d47){try{jsonpatch['apply'](_0x362d47,_0x565415,!![]);}catch(_0x49b0a5){return BPromise[_0x7447('0x23')](_0x49b0a5);}return _0x362d47[_0x7447('0x24')]();};}function saveUpdates(_0x39f5d6,_0x4b9c3e){return function(_0x3f52a2){if(_0x3f52a2){return _0x3f52a2[_0x7447('0x25')](_0x39f5d6)[_0x7447('0x26')](function(_0x4eec6b){return _0x4eec6b;});}return null;};}function removeEntity(_0xb526ce,_0x385d40){return function(_0x3cb73){if(_0x3cb73){return _0x3cb73[_0x7447('0x27')]()[_0x7447('0x26')](function(){_0xb526ce[_0x7447('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d2fc,_0x563eb8){return function(_0x23d745){if(!_0x23d745){_0x36d2fc[_0x7447('0x28')](0x194);}return _0x23d745;};}function handleError(_0x398b9e,_0x3c81b6){_0x3c81b6=_0x3c81b6||0x1f4;return function(_0x543847){logger[_0x7447('0x29')](_0x543847[_0x7447('0x2a')]);if(_0x543847[_0x7447('0x2b')]){delete _0x543847['name'];}_0x398b9e[_0x7447('0x1a')](_0x3c81b6)[_0x7447('0x2c')](_0x543847);};}function getInteractionUsers(_0x530752,_0x15aeab){return new BPromise(function(_0x39b227,_0x125a5d){try{if(_0x15aeab[_0x530752['id']]){_0x530752[_0x7447('0x2d')]=_['map'](_0x15aeab[_0x530752['id']],function(_0x4967b8){return{'id':_0x4967b8['id'],'fullname':_0x4967b8[_0x7447('0x2e')]};});}}catch(_0x7a18b5){_0x125a5d(_0x7a18b5);}_0x39b227(_0x530752);});}function getInteractionTags(_0x338a84,_0x40cfb2){return new BPromise(function(_0x2a2ccf,_0x340ade){try{if(_0x338a84['TagIds']){_0x338a84[_0x7447('0x2f')]=[];_0x338a84[_0x7447('0x30')][_0x7447('0x31')](',')[_0x7447('0x32')](function(_0x59d7a5){_0x338a84['Tags'][_0x7447('0x33')](_0x40cfb2[_0x59d7a5]);});}delete _0x338a84[_0x7447('0x30')];}catch(_0x139745){_0x340ade(_0x139745);}_0x2a2ccf(_0x338a84);});}function updateOpenchannelInteraction(_0x3c4d2d,_0x39ce86,_0x55b61d){return new BPromise(function(_0x15ce7a,_0x2a777e){return getInteractionUsers(_0x3c4d2d,_0x55b61d)[_0x7447('0x26')](function(_0x17d7a1){return getInteractionTags(_0x17d7a1,_0x39ce86);})[_0x7447('0x26')](function(_0x118098){return getStateInteraction(_0x118098);})[_0x7447('0x26')](function(_0x4d2324){_0x15ce7a(_0x4d2324);})[_0x7447('0x34')](function(_0x4cceb5){_0x2a777e(_0x4cceb5);});});}function getStateInteraction(_0x59edf9){return new BPromise(function(_0x4a3c76){_0x59edf9[_0x7447('0x35')]=0x0;_0x59edf9[_0x7447('0x36')]=0x0;_0x59edf9[_0x7447('0x37')]=0x0;_0x59edf9[_0x7447('0x38')]=0x0;_0x59edf9['total']=0x0;if(!_0x59edf9[_0x7447('0x39')]&&!_0x59edf9[_0x7447('0x3a')]){_0x59edf9[_0x7447('0x35')]+=0x1;}if(!_0x59edf9[_0x7447('0x39')]&&_0x59edf9['UserId']){_0x59edf9[_0x7447('0x36')]+=0x1;if(_0x59edf9[_0x7447('0x35')]){_0x59edf9[_0x7447('0x35')]-=0x1;}}if(_0x59edf9[_0x7447('0x39')]&&_0x59edf9['UserId']){_0x59edf9[_0x7447('0x37')]+=0x1;if(_0x59edf9[_0x7447('0x36')]){_0x59edf9[_0x7447('0x36')]-=0x1;}}if(_0x59edf9[_0x7447('0x39')]&&!_0x59edf9[_0x7447('0x3a')]){_0x59edf9[_0x7447('0x38')]+=0x1;if(_0x59edf9[_0x7447('0x35')]){_0x59edf9['waiting']-=0x1;}}_0x59edf9[_0x7447('0x3b')]+=0x1;_0x4a3c76(_0x59edf9);});}exports[_0x7447('0x3c')]=function(_0xe19449,_0x2cea58){var _0xf7e4d4={},_0x2aa392={},_0x2c50bd={'count':0x0,'rows':[]};var _0xd0372e=_[_0x7447('0x3d')](db[_0x7447('0x3e')][_0x7447('0x3f')],function(_0x3aadf6){return{'name':_0x3aadf6[_0x7447('0x40')],'type':_0x3aadf6[_0x7447('0x41')][_0x7447('0x42')]};});_0x2aa392['model']=_[_0x7447('0x3d')](_0xd0372e,_0x7447('0x2b'));_0x2aa392[_0x7447('0x43')]=_['keys'](_0xe19449[_0x7447('0x43')]);_0x2aa392[_0x7447('0x44')]=_[_0x7447('0x45')](_0x2aa392['model'],_0x2aa392['query']);_0xf7e4d4[_0x7447('0x46')]=_['intersection'](_0x2aa392[_0x7447('0x47')],qs[_0x7447('0x48')](_0xe19449[_0x7447('0x43')]['fields']));_0xf7e4d4['attributes']=_0xf7e4d4['attributes'][_0x7447('0x49')]?_0xf7e4d4[_0x7447('0x46')]:_0x2aa392[_0x7447('0x47')];if(!_0xe19449['query'][_0x7447('0x4a')]('nolimit')){_0xf7e4d4[_0x7447('0x20')]=qs[_0x7447('0x20')](_0xe19449[_0x7447('0x43')][_0x7447('0x20')]);_0xf7e4d4['offset']=qs[_0x7447('0x1d')](_0xe19449[_0x7447('0x43')]['offset']);}_0xf7e4d4[_0x7447('0x4b')]=qs[_0x7447('0x4c')](_0xe19449[_0x7447('0x43')][_0x7447('0x4c')]);_0xf7e4d4[_0x7447('0x4d')]=qs[_0x7447('0x44')](_[_0x7447('0x4e')](_0xe19449[_0x7447('0x43')],_0x2aa392[_0x7447('0x44')]),_0xd0372e);var _0x4f65f6=[];var _0x3544f2=squel[_0x7447('0x4f')]()['field']('id')[_0x7447('0x50')]('name')['field'](_0x7447('0x51'))[_0x7447('0x52')](_0x7447('0x53'));var _0x4cd281=squel[_0x7447('0x4f')]()[_0x7447('0x50')](_0x7447('0x54'))[_0x7447('0x50')]('u.fullname')[_0x7447('0x50')](_0x7447('0x55'))[_0x7447('0x52')]('user_has_openchannel_interactions','ui')['left_join'](_0x7447('0x56'),'u',_0x7447('0x57'));var _0x8422b0=squel[_0x7447('0x4f')]()[_0x7447('0x52')](_0x7447('0x58'),'i')[_0x7447('0x59')]('cm_contacts','c',_0x7447('0x5a'))[_0x7447('0x59')]('users','o','o.id\x20=\x20i.UserId')['left_join']('openchannel_accounts','a',_0x7447('0x5b'))['left_join'](_0x7447('0x5c'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x7447('0x59')](_0x7447('0x5d'),'it',_0x7447('0x5e'))[_0x7447('0x59')]('tools_tags','t',_0x7447('0x5f'));var _0x4c0216=squel['expr']();var _0x2eb2f7=[];var _0x5b0d5c=squel[_0x7447('0x60')]();var _0x7416b3;if(_0xe19449[_0x7447('0x43')][_0x7447('0x61')]){_0x7416b3=as[_0x7447('0x62')](_0xe19449[_0x7447('0x43')]['search']);var _0x55958c=_0x7416b3[_0x7447('0x63')];for(var _0x418489=0x0;_0x418489<_0x7416b3[_0x7447('0x64')]['length'];_0x418489++){var _0x18eb5e=_0x7416b3['conditions'][_0x418489];var _0x540c6a='i';var _0x2eabff=_[_0x7447('0x65')](_0xd0372e,[_0x7447('0x2b'),_0x18eb5e[_0x7447('0x50')]]);if(!_0x2eabff){switch(_0x18eb5e['field']){case _0x7447('0x66'):if(_0x18eb5e[_0x7447('0x67')]==0x1){_0x8422b0[_0x7447('0x68')]('`'+_0x18eb5e[_0x7447('0x50')]+_0x7447('0x69'));}else{_0x8422b0[_0x7447('0x68')]('`'+_0x18eb5e[_0x7447('0x50')]+'`\x20>\x200');}break;case _0x7447('0x6a'):if(_0x18eb5e[_0x7447('0x6b')]==='$substring'){if(_0x18eb5e[_0x7447('0x67')]['split']('\x20')[_0x7447('0x49')]>0x1){_0x4c0216[_0x55958c](_0x7447('0x6c'),qs[_0x7447('0x6d')](_0x18eb5e[_0x7447('0x67')]),null);}else{var _0x4e472f='%'+_0x18eb5e['value']+'%';_0x4c0216[_0x55958c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4e472f,_0x4e472f,_0x4e472f);}}else{_0x2eabff=_[_0x7447('0x65')](_0xd0372e,['name',_0x7447('0x6e')]);_0x18eb5e['field']=_0x7447('0x6e');_0x3017d0=as['buildExpression'](_0x540c6a,_0x2eabff[_0x7447('0x41')],_0x18eb5e);_0x4c0216[_0x55958c](_0x3017d0[_0x7447('0x6f')],_0x3017d0['value'][_0x7447('0x70')],_0x3017d0[_0x7447('0x67')]['end']);}break;case _0x7447('0x71'):var _0x356b68=_0x18eb5e[_0x7447('0x67')]['split'](',')[_0x7447('0x3d')](function(_0x2e19e9){return Number(_0x2e19e9);});_0x356b68[_0x7447('0x32')](function(_0x425e3){_0x5b0d5c['or'](_0x7447('0x72'),'%,'+_0x425e3+',%');});_0x2eb2f7=_[_0x7447('0x73')](_0x2eb2f7,_0x356b68);break;case _0x7447('0x74'):if(_0x18eb5e[_0x7447('0x6b')]==='$substring'){_0x4c0216[_0x55958c](_0x7447('0x75'),'%'+_0x18eb5e['value']+'%',null);}else{_0x2eabff=_[_0x7447('0x65')](_0xd0372e,[_0x7447('0x2b'),_0x7447('0x3a')]);_0x18eb5e['field']='UserId';_0x3017d0=as['buildExpression'](_0x540c6a,_0x2eabff['type'],_0x18eb5e);_0x4c0216[_0x55958c](_0x3017d0['text'],_0x3017d0[_0x7447('0x67')][_0x7447('0x70')],_0x3017d0[_0x7447('0x67')]['end']);}break;case _0x7447('0x76'):_0x3017d0=as[_0x7447('0x77')]('me',null,_0x18eb5e);_0x4c0216[_0x55958c](_0x3017d0[_0x7447('0x6f')],_0x3017d0[_0x7447('0x67')]['start'],_0x3017d0['value'][_0x7447('0x1b')]);break;}}else{var _0x3017d0=as['buildExpression'](_0x540c6a,_0x2eabff[_0x7447('0x41')],_0x18eb5e);_0x4c0216[_0x55958c](_0x3017d0['text'],_0x3017d0['value']['start'],_0x3017d0[_0x7447('0x67')][_0x7447('0x1b')]);}}}else{var _0x34a4ae=_(_0xe19449['query'])['keys']()[_0x7447('0x3d')](function(_0x3da219){return _[_0x7447('0x78')](_0xd0372e,[_0x7447('0x2b'),_0x3da219])?_0x3da219:undefined;})['compact']()[_0x7447('0x67')]();if(!_[_0x7447('0x79')](_0x34a4ae)){_0x34a4ae['forEach'](function(_0x29221c){if(_0x29221c===_0x7447('0x7a')){_0x8422b0[_0x7447('0x4d')](_0x7447('0x7b'),[]['concat'](_0xe19449[_0x7447('0x43')][_0x29221c]));}else if(_0x29221c==='createdAt'){var _0x400011=JSON[_0x7447('0x7c')](_0xe19449[_0x7447('0x43')][_0x29221c])[_0x7447('0x7d')];var _0x57f2bf=JSON['parse'](_0xe19449[_0x7447('0x43')][_0x29221c])[_0x7447('0x7e')];_0x8422b0['where'](_0x7447('0x7f'),_0x400011,_0x57f2bf);}else{if(_0xe19449['query'][_0x29221c]===_0x7447('0x80')){_0x8422b0[_0x7447('0x4d')]('i.'+_0x29221c+_0x7447('0x81'));}else{_0x8422b0[_0x7447('0x4d')]('i.'+_0x29221c+_0x7447('0x82'),_0xe19449['query'][_0x29221c]);}}});}if(_0xe19449['query'][_0x7447('0x83')]){if(_0xe19449[_0x7447('0x43')][_0x7447('0x83')]==0x1){_0x8422b0[_0x7447('0x68')](_0x7447('0x84'));}else{_0x8422b0[_0x7447('0x68')]('`unreadMessages`\x20>\x200');}}if(_0xe19449[_0x7447('0x43')][_0x7447('0x85')]){_0x2eb2f7=_[_0x7447('0x86')](_0xe19449[_0x7447('0x43')][_0x7447('0x85')])?_0xe19449['query'][_0x7447('0x85')]:new Array(_0xe19449['query']['tag']);_0x2eb2f7[_0x7447('0x32')](function(_0x5bc388){_0x5b0d5c['or'](_0x7447('0x72'),'%,'+_0x5bc388+',%');});}if(_0xe19449[_0x7447('0x43')][_0x7447('0x87')]){var _0x15b2c1=_0xe19449[_0x7447('0x43')]['filter'][_0x7447('0x88')]('\x5c','\x5c\x5c')[_0x7447('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x15b2c1)){_0x4c0216['or'](_0x7447('0x89'),_0x15b2c1+'%');}else{_0x4c0216['or'](_0x7447('0x8a'),qs[_0x7447('0x6d')](_0x15b2c1))['or'](_0x7447('0x8b'),_0x15b2c1+'%')['or'](_0x7447('0x8c'),_0x15b2c1+'%');}}}_0x8422b0['where'](_0x4c0216);_0x8422b0[_0x7447('0x8d')](_0x7447('0x8e'));var _0x3676d6={'type':db[_0x7447('0x8f')][_0x7447('0x90')][_0x7447('0x91')],'raw':!![]};var _0x16921f=_0x8422b0[_0x7447('0x92')]();_0x16921f[_0x7447('0x50')](_0x7447('0x8e'));_0x16921f[_0x7447('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7447('0x66'));if(_0xf7e4d4[_0x7447('0x4b')]){_0xf7e4d4[_0x7447('0x4b')][_0x7447('0x32')](function(_0xfffb38){var _0x4af5f3=_0xfffb38[0x0]===_0x7447('0x93')?_0xfffb38[0x0]:'i.'+_0xfffb38[0x0];_0x8422b0['order'](_0x4af5f3,_0xfffb38[0x1]===_0x7447('0x94')?![]:!![]);});}if(!_[_0x7447('0x79')](_0x2eb2f7)){_0x8422b0['having'](_0x5b0d5c);_0x16921f[_0x7447('0x4d')](_0x7447('0x95'),_0x2eb2f7);}BPromise[_0x7447('0x96')]()[_0x7447('0x26')](function(){if(!_0x7416b3){if(_0xe19449[_0x7447('0x43')][_0x7447('0x7a')])return;_0x16921f[_0x7447('0x4d')](_0x7447('0x97'));_0x8422b0[_0x7447('0x4d')](_0x7447('0x97'));return;}if(_0xe19449[_0x7447('0x98')][_0x7447('0x99')]!==_0x7447('0x9a'))return;return _0xe19449[_0x7447('0x98')][_0x7447('0x9b')]({'attributes':['id'],'raw':!![]})[_0x7447('0x26')](function(_0x4679f8){if(_[_0x7447('0x79')](_0x4679f8)){_0x16921f[_0x7447('0x4d')](_0x7447('0x9c'));_0x8422b0[_0x7447('0x4d')](_0x7447('0x9c'));}else{_0x16921f[_0x7447('0x4d')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x7447('0x3d')](_0x4679f8,'id'));_0x8422b0['where'](_0x7447('0x7b'),_[_0x7447('0x3d')](_0x4679f8,'id'));}});})[_0x7447('0x26')](function(){if(_0xe19449[_0x7447('0x98')][_0x7447('0x99')]===_0x7447('0x9a')&&!_0x7416b3&&!_0xe19449[_0x7447('0x43')][_0x7447('0x7a')])return[];return db[_0x7447('0x9d')][_0x7447('0x43')](_0x16921f[_0x7447('0x9e')](),_0x3676d6);})[_0x7447('0x26')](function(_0x452e71){_0x2c50bd[_0x7447('0x1f')]=_0x452e71[_0x7447('0x49')];if(_0x2c50bd[_0x7447('0x1f')]===0x0)return[];return db[_0x7447('0x9d')][_0x7447('0x43')](_0x3544f2['toString'](),_0x3676d6)[_0x7447('0x26')](function(_0x2aa2c6){_0x4f65f6=_[_0x7447('0x9f')](_0x2aa2c6,'id');_0x3676d6=_[_0x7447('0xa0')](_0x3676d6,{'model':db[_0x7447('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe19449['query'][_0x7447('0x48')]){_0xf7e4d4[_0x7447('0x46')][_0x7447('0x32')](function(_0x17ea5b){_0x8422b0[_0x7447('0x50')]('i.'+_0x17ea5b);});}else{_0x8422b0[_0x7447('0x50')](_0x7447('0xa1'),_0x7447('0x66'));_0x8422b0[_0x7447('0x50')](_0x7447('0xa2'),'Account.key');_0x8422b0[_0x7447('0x50')](_0x7447('0xa3'),_0x7447('0xa4'));_0x8422b0[_0x7447('0x50')](_0x7447('0xa5'),'contactName');_0x8422b0[_0x7447('0x50')](_0x7447('0xa6'));_0x8422b0[_0x7447('0x50')]('c.firstName',_0x7447('0xa7'));_0x8422b0['field']('c.lastName',_0x7447('0xa8'));_0x8422b0[_0x7447('0x50')](_0x7447('0xa9'),_0x7447('0xaa'));_0x8422b0['field'](_0x7447('0xab'),_0x7447('0xac'));_0x8422b0[_0x7447('0x50')]('c.mobile',_0x7447('0xad'));_0x8422b0[_0x7447('0x50')](_0x7447('0xae'),_0x7447('0xaf'));_0x8422b0['field'](_0x7447('0xb0'),_0x7447('0xb1'));_0x8422b0[_0x7447('0x50')](_0x7447('0xb2'),_0x7447('0xb3'));_0x8422b0[_0x7447('0x50')](_0x7447('0xb4'),_0x7447('0x30'));}if(_0xf7e4d4['limit'])_0x8422b0[_0x7447('0x20')](_0xf7e4d4[_0x7447('0x20')]);if(_0xf7e4d4[_0x7447('0x1d')])_0x8422b0[_0x7447('0x1d')](_0xf7e4d4[_0x7447('0x1d')]);return db[_0x7447('0x9d')][_0x7447('0x43')](_0x8422b0[_0x7447('0x9e')](),_0x3676d6);})[_0x7447('0x26')](function(_0x5eb968){if(_0x5eb968['length']>0x0)_0x4cd281['where'](_0x7447('0xb5'),_[_0x7447('0x3d')](_0x5eb968,'id'));return db['sequelize'][_0x7447('0x43')](_0x4cd281['toString'](),_0x3676d6)[_0x7447('0x26')](function(_0x141d27){var _0x5eaa3b=_[_0x7447('0xb6')](_0x141d27,_0x7447('0xb7'));var _0x5c6632=[];_0x5eb968[_0x7447('0x32')](function(_0x3eadbd){_0x5c6632[_0x7447('0x33')](updateOpenchannelInteraction(_0x3eadbd,_0x4f65f6,_0x5eaa3b));});return BPromise[_0x7447('0xb8')](_0x5c6632);});});})['then'](function(_0x55d0c8){_0x2c50bd[_0x7447('0xb9')]=_0x55d0c8;return _0x2c50bd;})[_0x7447('0x26')](respondWithFilteredResult(_0x2cea58,_0xf7e4d4))[_0x7447('0x34')](handleError(_0x2cea58,null));};exports[_0x7447('0xba')]=function(_0x3746e6,_0x1ca388){var _0x1b3a95={};if(_0x3746e6[_0x7447('0x43')]['type']&&_0x3746e6[_0x7447('0x43')][_0x7447('0x41')]===_0x7447('0x52')){_0x1b3a95['from']=_0x3746e6['params']['id'];}else{_0x1b3a95['id']=_0x3746e6[_0x7447('0xbb')]['id'];}var _0x50e5ae={'raw':![],'where':_0x1b3a95},_0x4ef9f6={};_0x4ef9f6['model']=_['keys'](db['OpenchannelInteraction'][_0x7447('0x3f')]);_0x4ef9f6[_0x7447('0x43')]=_['keys'](_0x3746e6[_0x7447('0x43')]);_0x4ef9f6[_0x7447('0x44')]=_['intersection'](_0x4ef9f6[_0x7447('0x47')],_0x4ef9f6[_0x7447('0x43')]);_0x50e5ae[_0x7447('0x46')]=_[_0x7447('0x45')](_0x4ef9f6[_0x7447('0x47')],qs[_0x7447('0x48')](_0x3746e6[_0x7447('0x43')][_0x7447('0x48')]));_0x50e5ae[_0x7447('0x46')]=_0x50e5ae[_0x7447('0x46')][_0x7447('0x49')]?_0x50e5ae[_0x7447('0x46')]:_0x4ef9f6['model'];if(_0x3746e6['query']['includeAll']){_0x50e5ae[_0x7447('0xbc')]=[{'all':!![]}];}_0x50e5ae=_[_0x7447('0xa0')]({},_0x50e5ae,_0x3746e6[_0x7447('0xbd')]);return db[_0x7447('0x3e')][_0x7447('0x65')](_0x50e5ae)[_0x7447('0x26')](handleEntityNotFound(_0x1ca388,null))[_0x7447('0x26')](respondWithResult(_0x1ca388,null))['catch'](handleError(_0x1ca388,null));};exports[_0x7447('0xbe')]=function(_0xba3033,_0x49798b){return db[_0x7447('0x3e')][_0x7447('0xbe')](_0xba3033[_0x7447('0x76')],{})[_0x7447('0x26')](respondWithResult(_0x49798b,0xc9))['catch'](handleError(_0x49798b,null));};exports[_0x7447('0x25')]=function(_0x24a1d0,_0x32ca3f){if(_0x24a1d0[_0x7447('0x76')]['id']){delete _0x24a1d0[_0x7447('0x76')]['id'];}return db[_0x7447('0x3e')]['find']({'where':{'id':_0x24a1d0[_0x7447('0xbb')]['id']}})['then'](handleEntityNotFound(_0x32ca3f,null))['then'](saveUpdates(_0x24a1d0[_0x7447('0x76')],null))[_0x7447('0x26')](respondWithResult(_0x32ca3f,null))[_0x7447('0x34')](handleError(_0x32ca3f,null));};exports[_0x7447('0x27')]=function(_0x27c54e,_0x56b7de){return db[_0x7447('0x3e')][_0x7447('0x65')]({'where':{'id':_0x27c54e['params']['id']}})[_0x7447('0x26')](handleEntityNotFound(_0x56b7de,null))['then'](removeEntity(_0x56b7de,null))[_0x7447('0x34')](handleError(_0x56b7de,null));};exports[_0x7447('0xbf')]=function(_0x16617e,_0x9ea466){return db[_0x7447('0x3e')]['describe']()['then'](respondWithResult(_0x9ea466,null))[_0x7447('0x34')](handleError(_0x9ea466,null));};exports['addMessage']=function(_0x59e3dd,_0x118fc5,_0x205b65){return db[_0x7447('0xc0')]['find']({'where':{'id':_0x59e3dd['params']['id']}})[_0x7447('0x26')](handleEntityNotFound(_0x118fc5,null))['then'](function(_0x4395f3){if(_0x4395f3){return _0x4395f3['addMessage'](_0x59e3dd[_0x7447('0x76')][_0x7447('0xc1')],_[_0x7447('0xc2')](_0x59e3dd[_0x7447('0x76')],[_0x7447('0xc1'),'id'])||{});}})[_0x7447('0x26')](respondWithResult(_0x118fc5,null))[_0x7447('0x34')](handleError(_0x118fc5,null));};exports[_0x7447('0xc3')]=function(_0x2c7d6d,_0xf81422,_0x38692b){var _0x1607e1={'raw':![],'where':{}};var _0x3b7ae8={};var _0x2556b7={'count':0x0,'rows':[]};return db[_0x7447('0x3e')]['findOne']({'where':{'id':_0x2c7d6d['params']['id']}})[_0x7447('0x26')](handleEntityNotFound(_0xf81422,null))['then'](function(_0x490c92){if(_0x490c92){_0x3b7ae8['model']=_[_0x7447('0xc4')](db['OpenchannelMessage'][_0x7447('0x3f')]);_0x3b7ae8['query']=_['keys'](_0x2c7d6d[_0x7447('0x43')]);_0x3b7ae8[_0x7447('0x44')]=_[_0x7447('0x45')](_0x3b7ae8[_0x7447('0x47')],_0x3b7ae8[_0x7447('0x43')]);_0x1607e1[_0x7447('0x46')]=_[_0x7447('0x45')](_0x3b7ae8[_0x7447('0x47')],qs[_0x7447('0x48')](_0x2c7d6d[_0x7447('0x43')][_0x7447('0x48')]));_0x1607e1[_0x7447('0x46')]=_0x1607e1[_0x7447('0x46')][_0x7447('0x49')]?_0x1607e1[_0x7447('0x46')]:_0x3b7ae8[_0x7447('0x47')];if(!_0x2c7d6d[_0x7447('0x43')][_0x7447('0x4a')](_0x7447('0xc5'))){_0x1607e1[_0x7447('0x20')]=qs[_0x7447('0x20')](_0x2c7d6d[_0x7447('0x43')][_0x7447('0x20')]);_0x1607e1[_0x7447('0x1d')]=qs['offset'](_0x2c7d6d[_0x7447('0x43')][_0x7447('0x1d')]);}_0x1607e1[_0x7447('0x4b')]=qs['sort'](_0x2c7d6d['query'][_0x7447('0x4c')]);_0x1607e1['where']=qs[_0x7447('0x44')](_[_0x7447('0x4e')](_0x2c7d6d['query'],_0x3b7ae8[_0x7447('0x44')]));_0x1607e1[_0x7447('0x4d')][_0x7447('0xb7')]=_0x490c92['id'];if(_0x2c7d6d[_0x7447('0x43')][_0x7447('0x87')]){_0x1607e1['where']=_[_0x7447('0xa0')](_0x1607e1[_0x7447('0x4d')],{'$or':_[_0x7447('0x3d')](_0x1607e1['attributes'],function(_0x5b345b){var _0x389217={};_0x389217[_0x5b345b]={'$like':'%'+_0x2c7d6d['query'][_0x7447('0x87')]+'%'};return _0x389217;})});}if(_0x2c7d6d['query']['$gte']){var _0xcefa0f=_0x2c7d6d['query'][_0x7447('0x7d')][_0x7447('0x31')](',');var _0x27c510={};_0x27c510[_0xcefa0f[0x0]]={'$gte':moment(_0xcefa0f[0x1])[_0x7447('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1607e1[_0x7447('0x4d')]=_[_0x7447('0xa0')](_0x1607e1[_0x7447('0x4d')],_0x27c510);}_0x1607e1=_[_0x7447('0xa0')]({},_0x1607e1,_0x2c7d6d[_0x7447('0xbd')]);return db[_0x7447('0xc0')]['count']({'where':_0x1607e1[_0x7447('0x4d')]})[_0x7447('0x26')](function(_0xcd1ed2){_0x2556b7[_0x7447('0x1f')]=_0xcd1ed2;if(_0x2c7d6d['query']['includeAll']){_0x1607e1[_0x7447('0xbc')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1607e1);})[_0x7447('0x26')](function(_0x44d9e4){_0x2556b7[_0x7447('0xb9')]=_0x44d9e4;return _0x2556b7;});}})[_0x7447('0x26')](respondWithFilteredResult(_0xf81422,_0x1607e1))[_0x7447('0x34')](handleError(_0xf81422,null));};exports['addTags']=function(_0x3a1020,_0x439003,_0x2ccd7e){return db[_0x7447('0x3e')]['find']({'where':{'id':_0x3a1020[_0x7447('0xbb')]['id']}})[_0x7447('0x26')](handleEntityNotFound(_0x439003,null))[_0x7447('0x26')](function(_0x1c65d6){if(_0x1c65d6){return _0x1c65d6[_0x7447('0xc7')](_0x3a1020[_0x7447('0x76')][_0x7447('0xc1')],_[_0x7447('0xc2')](_0x3a1020[_0x7447('0x76')],[_0x7447('0xc1'),'id'])||{})[_0x7447('0xc8')](function(){return db[_0x7447('0x71')][_0x7447('0xc9')]({'attributes':['id',_0x7447('0x2b'),'color'],'where':{'id':_0x3a1020[_0x7447('0x76')][_0x7447('0xc1')]}});})['then'](function(_0x4c680f){socket['emit'](_0x7447('0xca'),{'id':Number(_0x3a1020[_0x7447('0xbb')]['id']),'tags':_0x4c680f||[]});return{'id':Number(_0x3a1020['params']['id']),'tags':_0x4c680f||[]};});}})[_0x7447('0x26')](respondWithResult(_0x439003,null))['catch'](handleError(_0x439003,null));};exports[_0x7447('0xcb')]=function(_0x55a7ce,_0x344ef2,_0x397046){return db[_0x7447('0x3e')]['find']({'where':{'id':_0x55a7ce[_0x7447('0xbb')]['id']}})[_0x7447('0x26')](handleEntityNotFound(_0x344ef2,null))['then'](function(_0x29bf17){if(_0x29bf17){return _0x29bf17[_0x7447('0xcb')](_0x55a7ce[_0x7447('0x43')]['ids']);}})[_0x7447('0x26')](respondWithStatusCode(_0x344ef2,null))[_0x7447('0x34')](handleError(_0x344ef2,null));};exports[_0x7447('0xcc')]=function(_0x566c8e,_0xdc4b6a){var _0x2e9684=moment()[_0x7447('0xcd')]()[_0x7447('0x9e')]();var _0x13b1aa=path[_0x7447('0xce')](config[_0x7447('0xcf')],_0x7447('0xd0'),_0x7447('0xd1'),_0x7447('0xd2'));var _0x13f480=path[_0x7447('0xce')](config[_0x7447('0xcf')],_0x7447('0xd0'),_0x7447('0xd1'),_0x7447('0xd3'));var _0x4b96f9=path[_0x7447('0xce')](_0x13b1aa,_0x2e9684);var _0xd395dd=util[_0x7447('0xc6')](_0x7447('0xd4'),_0x566c8e[_0x7447('0xbb')]['id'],_0x2e9684);var _0x4f9d1c=path['join'](_0x13b1aa,_0xd395dd);var _0x32d654=[];_0x32d654[_0x7447('0x33')]({'model':db['User'],'as':_0x7447('0x74'),'attributes':['id',_0x7447('0x2e')],'raw':!![]});_0x32d654[_0x7447('0x33')]({'model':db[_0x7447('0xd5')],'as':'Contact','attributes':['id',_0x7447('0xd6'),_0x7447('0xd7')],'raw':!![]});if(_0x566c8e['query'][_0x7447('0xd3')]){_0x32d654[_0x7447('0x33')]({'model':db[_0x7447('0xd8')],'as':'Attachment','raw':!![]});}var _0x4a05f3=[{'model':db[_0x7447('0xc0')],'as':_0x7447('0xd9'),'attributes':['id',_0x7447('0x76'),_0x7447('0xda'),_0x7447('0xdb'),_0x7447('0xdc'),_0x7447('0x83')],'include':_0x32d654}];_0x4a05f3[_0x7447('0x33')]({'model':db[_0x7447('0xdd')],'as':_0x7447('0xde'),'attributes':['id',_0x7447('0x2b')]});_0x4a05f3[_0x7447('0x33')]({'model':db[_0x7447('0x74')],'as':'Owner','attributes':['id',_0x7447('0x2e')]});return db['OpenchannelInteraction'][_0x7447('0x65')]({'where':{'id':_0x566c8e[_0x7447('0xbb')]['id']},'include':_0x4a05f3})[_0x7447('0x26')](handleEntityNotFound(_0xdc4b6a,null))['then'](function(_0x45de47){if(_0x45de47){var _0x5a701e=_0x45de47[_0x7447('0xdf')]({'plain':!![]});fs[_0x7447('0xe0')](_0x4b96f9);var _0x4c3c86={'channel':_0x7447('0xe1'),'account':_0x5a701e['Account'][_0x7447('0x2b')],'agent':_0x5a701e[_0x7447('0xe2')]?_0x5a701e['Owner']['fullname']:_0x7447('0xe3'),'createdAt':moment(_0x5a701e[_0x7447('0xda')])[_0x7447('0xc6')](_0x7447('0xe4'))[_0x7447('0x9e')](),'closedAt':_0x5a701e[_0x7447('0x39')]?moment(_0x5a701e[_0x7447('0xe5')])[_0x7447('0xc6')](_0x7447('0xe4'))[_0x7447('0x9e')]():'','disposition':_0x5a701e[_0x7447('0xe6')],'visibility':_0x5a701e[_0x7447('0xe7')]?'Public':_0x7447('0xe8'),'messages':_(_0x5a701e[_0x7447('0xd9')])[_0x7447('0x87')]({'secret':![]})[_0x7447('0x3d')](function(_0x5c1fe0){if(_0x5c1fe0[_0x7447('0xd8')]){var _0xce54e1=path[_0x7447('0xce')](_0x13f480,_0x5c1fe0[_0x7447('0xd8')][_0x7447('0xe9')]);if(fs[_0x7447('0xea')](_0xce54e1)){fs[_0x7447('0xeb')](_0xce54e1)[_0x7447('0xec')](fs['createWriteStream'](path['join'](_0x4b96f9,_0x5c1fe0[_0x7447('0xd8')][_0x7447('0xe9')])));}}return{'date':moment(_0x5c1fe0[_0x7447('0xda')])[_0x7447('0xc6')](_0x7447('0xe4'))[_0x7447('0x9e')](),'sender':_0x5c1fe0['direction']===_0x7447('0xed')?_0x5c1fe0[_0x7447('0x74')]?_0x5c1fe0[_0x7447('0x74')][_0x7447('0x2e')]:'System':_0x5c1fe0[_0x7447('0x6a')][_0x7447('0xd6')]+(_0x5c1fe0[_0x7447('0x6a')][_0x7447('0xd7')]?'\x20'+_0x5c1fe0[_0x7447('0x6a')][_0x7447('0xd7')]:''),'body':_0x5c1fe0[_0x7447('0xd8')]?_0x5c1fe0[_0x7447('0xd8')]['basename']:_0x5c1fe0[_0x7447('0x76')],'direction':_0x5c1fe0['direction']===_0x7447('0xed')?'A':'C','secret':_0x5c1fe0[_0x7447('0xdc')],'read':_0x5c1fe0[_0x7447('0x83')],'attachment':_0x5c1fe0[_0x7447('0xd8')]};})[_0x7447('0x67')]()};return ejs[_0x7447('0xee')](path[_0x7447('0xce')](config[_0x7447('0xcf')],_0x7447('0xd0'),_0x7447('0xef'),_0x7447('0xf0')),{'interaction':_0x4c3c86})[_0x7447('0x26')](function(_0x1287d0){var _0x2c1d0a=path[_0x7447('0xce')](_0x4b96f9,_0x7447('0xf1')+_0x5a701e['id']+'-'+_0x2e9684+_0x7447('0xf2'));var _0x361d7c={'path':_0x2c1d0a,'channel':_0x7447('0xe1'),'interactionId':_0x5a701e['id']};return pdf[_0x7447('0xf3')](_0x1287d0,_0x361d7c);})[_0x7447('0x26')](function(){return new BPromise(function(_0x43066c,_0x18a7a7){zipdir(_0x4b96f9,{'saveTo':_0x4f9d1c},function(_0x206fc0,_0x526a11){if(_0x206fc0)return _0x18a7a7(_0x206fc0);return _0x43066c(_0x526a11);});})[_0x7447('0x26')](function(){return new BPromise(function(_0x2a4439,_0x4fb887){rimraf(_0x4b96f9,function(_0x442bd0){if(_0x442bd0)_0x4fb887(_0x442bd0);return _0x2a4439();});});})['then'](function(){return _0xdc4b6a['download'](_0x4f9d1c,_0xd395dd,function(_0x38e173){if(_0x38e173){console[_0x7447('0xf4')](_0x7447('0xf5'),_0x38e173);}else{fs[_0x7447('0xf6')](_0x4f9d1c);}});});});}else{return _0xdc4b6a[_0x7447('0x28')](0xc8);}})[_0x7447('0x34')](handleError(_0xdc4b6a,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index cf38940..906e94a 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 _0xd9d1=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd9d1,0x14e));var _0x1d9d=function(_0x4e616a,_0x320d16){_0x4e616a=_0x4e616a-0x0;var _0x211f3d=_0xd9d1[_0x4e616a];return _0x211f3d;};'use strict';var EventEmitter=require(_0x1d9d('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x1d9d('0x1')];var OpenchannelMessage=require(_0x1d9d('0x2'))['db'][_0x1d9d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1d9d('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1d9d('0x5')};function emitEvent(_0x1e8ccf){return function(_0x135f74,_0x103a6e,_0x480792){_0x135f74['getUsers']({'attributes':['id'],'raw':!![]})[_0x1d9d('0x6')](function(_0x1fbc73){_0x135f74[_0x1d9d('0x7')](_0x1d9d('0x8'),_0x1fbc73[_0x1d9d('0x9')](function(_0x464b1c){return{'id':_0x464b1c['id']};}));return OpenchannelMessage[_0x1d9d('0xa')]({'where':{'OpenchannelInteractionId':_0x135f74['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f6499){_0x135f74[_0x1d9d('0x7')]('unreadMessages',_0x3f6499[_0x1d9d('0xb')]);OpenchannelInteractionEvents[_0x1d9d('0xc')](_0x1e8ccf+':'+_0x135f74['id'],_0x135f74);OpenchannelInteractionEvents['emit'](_0x1e8ccf,_0x135f74);_0x480792(null);})[_0x1d9d('0xd')](_0x480792(null));};}for(var e in events){if(events[_0x1d9d('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x1d9d('0xf')](e,emitEvent(event));}}module[_0x1d9d('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x94ab=['setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x94ab,0x152));var _0xb94a=function(_0x4ba179,_0x37b5d6){_0x4ba179=_0x4ba179-0x0;var _0x283718=_0x94ab[_0x4ba179];return _0x283718;};'use strict';var EventEmitter=require(_0xb94a('0x0'));var OpenchannelInteraction=require(_0xb94a('0x1'))['db'][_0xb94a('0x2')];var OpenchannelMessage=require(_0xb94a('0x1'))['db'][_0xb94a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb94a('0x4')](0x0);var events={'afterCreate':_0xb94a('0x5'),'afterUpdate':_0xb94a('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3596dc){return function(_0xc1a1ce,_0x19bf07,_0x187c40){_0xc1a1ce[_0xb94a('0x7')]({'attributes':['id'],'raw':!![]})[_0xb94a('0x8')](function(_0x43bbf2){_0xc1a1ce['setDataValue'](_0xb94a('0x9'),_0x43bbf2[_0xb94a('0xa')](function(_0x26f7aa){return{'id':_0x26f7aa['id']};}));return OpenchannelMessage[_0xb94a('0xb')]({'where':{'OpenchannelInteractionId':_0xc1a1ce['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x50af3a){_0xc1a1ce[_0xb94a('0xc')](_0xb94a('0xd'),_0x50af3a[_0xb94a('0xe')]);OpenchannelInteractionEvents['emit'](_0x3596dc+':'+_0xc1a1ce['id'],_0xc1a1ce);OpenchannelInteractionEvents['emit'](_0x3596dc,_0xc1a1ce);_0x187c40(null);})[_0xb94a('0xf')](_0x187c40(null));};}for(var e in events){if(events[_0xb94a('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xb94a('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index d183e9e..b5840d3 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 _0xe8d9=['../../config/environment','exports','OpenchannelInteraction','utf8mb4','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe8d9,0x1ca));var _0x9e8d=function(_0xabe7c0,_0x47b481){_0xabe7c0=_0xabe7c0-0x0;var _0x137812=_0xe8d9[_0xabe7c0];return _0x137812;};'use strict';var _=require(_0x9e8d('0x0'));var util=require(_0x9e8d('0x1'));var logger=require('../../config/logger')(_0x9e8d('0x2'));var moment=require(_0x9e8d('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e8d('0x4'));var fs=require('fs');var path=require(_0x9e8d('0x5'));var rimraf=require(_0x9e8d('0x6'));var config=require(_0x9e8d('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x9e8d('0x8')]=function(_0xac3d41,_0x367550){return _0xac3d41['define'](_0x9e8d('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9e8d('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x2e3a97,_0x2dc84b,_0xa90eae){if(_0x2e3a97[_0x9e8d('0xb')]('closed')){_0x2e3a97[_0x9e8d('0xc')]=moment()[_0x9e8d('0xd')](_0x9e8d('0xe'));}_0xa90eae(null,_0x2e3a97);}}});}; \ No newline at end of file +var _0x0ccb=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes'];(function(_0x1e72fe,_0x51f390){var _0x47609f=function(_0x3c9e4b){while(--_0x3c9e4b){_0x1e72fe['push'](_0x1e72fe['shift']());}};_0x47609f(++_0x51f390);}(_0x0ccb,0x128));var _0xb0cc=function(_0x1fa9d4,_0xe717e8){_0x1fa9d4=_0x1fa9d4-0x0;var _0x175ff6=_0x0ccb[_0x1fa9d4];return _0x175ff6;};'use strict';var _=require(_0xb0cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb0cc('0x1'));var moment=require(_0xb0cc('0x2'));var BPromise=require(_0xb0cc('0x3'));var rp=require(_0xb0cc('0x4'));var fs=require('fs');var path=require(_0xb0cc('0x5'));var rimraf=require('rimraf');var config=require(_0xb0cc('0x6'));var attributes=require(_0xb0cc('0x7'));module[_0xb0cc('0x8')]=function(_0xde8d90,_0x2fbedd){return _0xde8d90[_0xb0cc('0x9')](_0xb0cc('0xa'),attributes,{'tableName':_0xb0cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb0cc('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x41abfa,_0x4554b6,_0x11fb95){if(_0x41abfa['changed'](_0xb0cc('0xd'))){_0x41abfa['closedAt']=moment()[_0xb0cc('0xe')](_0xb0cc('0xf'));}_0x11fb95(null,_0x41abfa);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a1a5c97..af536aa 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 _0x5a14=['addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelInteraction','body','options','raw','limit','UpdateOpenchannelInteraction','find','where'];(function(_0x31de22,_0x7cf6ea){var _0x1b2bea=function(_0x56776a){while(--_0x56776a){_0x31de22['push'](_0x31de22['shift']());}};_0x1b2bea(++_0x7cf6ea);}(_0x5a14,0x11d));var _0x45a1=function(_0x2d6008,_0xee3a0e){_0x2d6008=_0x2d6008-0x0;var _0x549e3f=_0x5a14[_0x2d6008];return _0x549e3f;};'use strict';var _=require(_0x45a1('0x0'));var util=require(_0x45a1('0x1'));var moment=require('moment');var BPromise=require(_0x45a1('0x2'));var rs=require(_0x45a1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45a1('0x4'))['db'];var utils=require(_0x45a1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x45a1('0x6'));var jayson=require(_0x45a1('0x7'));var client=jayson[_0x45a1('0x8')][_0x45a1('0x9')]({'port':0x232a});config[_0x45a1('0xa')]=_[_0x45a1('0xb')](config[_0x45a1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x45a1('0xc'))(new Redis(config[_0x45a1('0xa')]));require('./openchannelInteraction.socket')[_0x45a1('0xd')](socket);function respondWithRpcPromise(_0x38fc63,_0x1b11cb,_0x1a1a51){return new BPromise(function(_0x2adbfd,_0x532601){return client[_0x45a1('0xe')](_0x38fc63,_0x1a1a51)[_0x45a1('0xf')](function(_0x2ecf32){logger[_0x45a1('0x10')](_0x45a1('0x11'),_0x1b11cb,'request\x20sent');logger[_0x45a1('0x12')](_0x45a1('0x13'),_0x1b11cb,_0x45a1('0x14'),JSON[_0x45a1('0x15')](_0x2ecf32));if(_0x2ecf32[_0x45a1('0x16')]){if(_0x2ecf32[_0x45a1('0x16')][_0x45a1('0x17')]===0x1f4){logger['error'](_0x45a1('0x11'),_0x1b11cb,_0x2ecf32[_0x45a1('0x16')][_0x45a1('0x18')]);return _0x532601(_0x2ecf32[_0x45a1('0x16')][_0x45a1('0x18')]);}logger[_0x45a1('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1b11cb,_0x2ecf32[_0x45a1('0x16')]['message']);return _0x2adbfd(_0x2ecf32['error'][_0x45a1('0x18')]);}else{logger['info'](_0x45a1('0x11'),_0x1b11cb,_0x45a1('0x14'));_0x2adbfd(_0x2ecf32[_0x45a1('0x19')][_0x45a1('0x18')]);}})[_0x45a1('0x1a')](function(_0x5045da){logger[_0x45a1('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1b11cb,_0x5045da);_0x532601(_0x5045da);});});}exports['UpdateOpenchannelInteraction']=function(_0x4bd084){var _0x4db064=this;return new Promise(function(_0x45549f,_0x1006c4){return db[_0x45a1('0x1b')]['update'](_0x4bd084[_0x45a1('0x1c')],{'raw':_0x4bd084[_0x45a1('0x1d')]?_0x4bd084[_0x45a1('0x1d')][_0x45a1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bd084[_0x45a1('0x1d')]?_0x4bd084[_0x45a1('0x1d')]['where']||null:null,'attributes':_0x4bd084['options']?_0x4bd084['options']['attributes']||null:null,'limit':_0x4bd084[_0x45a1('0x1d')]?_0x4bd084[_0x45a1('0x1d')][_0x45a1('0x1f')]||null:null})[_0x45a1('0xf')](function(_0x10d4ab){logger[_0x45a1('0x10')](_0x45a1('0x20'),_0x4bd084);logger['debug']('UpdateOpenchannelInteraction',_0x4bd084,JSON[_0x45a1('0x15')](_0x10d4ab));_0x45549f(_0x10d4ab);})[_0x45a1('0x1a')](function(_0x2ebe60){logger[_0x45a1('0x16')](_0x45a1('0x20'),_0x2ebe60['message'],_0x4bd084);_0x1006c4(_0x4db064['error'](0x1f4,_0x2ebe60[_0x45a1('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x14fafd){return new Promise(function(_0xb15f8a,_0x26f181){return db[_0x45a1('0x1b')][_0x45a1('0x21')]({'where':_0x14fafd['options']?_0x14fafd[_0x45a1('0x1d')][_0x45a1('0x22')]||null:null})[_0x45a1('0xf')](function(_0x921abd){if(_0x921abd){return _0x921abd[_0x45a1('0x23')](_0x14fafd[_0x45a1('0x1c')][_0x45a1('0x24')],_[_0x45a1('0x25')](_0x14fafd[_0x45a1('0x1c')],[_0x45a1('0x24'),'id'])||{});}})[_0x45a1('0x26')](function(_0x48ce63){logger[_0x45a1('0x10')](_0x45a1('0x27'),_0x14fafd);logger[_0x45a1('0x12')](_0x45a1('0x27'),_0x14fafd,JSON[_0x45a1('0x15')](_0x48ce63));_0xb15f8a(_0x48ce63);})[_0x45a1('0x1a')](function(_0x2e160b){logger[_0x45a1('0x16')]('AddTags',_0x2e160b[_0x45a1('0x18')],_0x14fafd);_0x26f181(_this['error'](0x1f4,_0x2e160b['message']));});});}; \ No newline at end of file +var _0x25d3=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw','options','where','find','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring'];(function(_0x2f4460,_0x41e9bb){var _0x266acf=function(_0x424bbb){while(--_0x424bbb){_0x2f4460['push'](_0x2f4460['shift']());}};_0x266acf(++_0x41e9bb);}(_0x25d3,0x182));var _0x325d=function(_0x36a64a,_0x493516){_0x36a64a=_0x36a64a-0x0;var _0x39b517=_0x25d3[_0x36a64a];return _0x39b517;};'use strict';var _=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var moment=require('moment');var BPromise=require(_0x325d('0x2'));var rs=require(_0x325d('0x3'));var fs=require('fs');var Redis=require(_0x325d('0x4'));var db=require(_0x325d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x325d('0x6'))('rpc');var config=require(_0x325d('0x7'));var jayson=require(_0x325d('0x8'));var client=jayson[_0x325d('0x9')][_0x325d('0xa')]({'port':0x232a});config[_0x325d('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x325d('0xc'))(new Redis(config[_0x325d('0xb')]));require(_0x325d('0xd'))[_0x325d('0xe')](socket);function respondWithRpcPromise(_0x593d87,_0x1454db,_0x329647){return new BPromise(function(_0x4edef0,_0x1df5d1){return client[_0x325d('0xf')](_0x593d87,_0x329647)[_0x325d('0x10')](function(_0x44fd2f){logger[_0x325d('0x11')](_0x325d('0x12'),_0x1454db,_0x325d('0x13'));logger[_0x325d('0x14')](_0x325d('0x15'),_0x1454db,_0x325d('0x13'),JSON[_0x325d('0x16')](_0x44fd2f));if(_0x44fd2f[_0x325d('0x17')]){if(_0x44fd2f[_0x325d('0x17')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1454db,_0x44fd2f[_0x325d('0x17')]['message']);return _0x1df5d1(_0x44fd2f[_0x325d('0x17')]['message']);}logger[_0x325d('0x17')](_0x325d('0x12'),_0x1454db,_0x44fd2f[_0x325d('0x17')][_0x325d('0x18')]);return _0x4edef0(_0x44fd2f[_0x325d('0x17')][_0x325d('0x18')]);}else{logger[_0x325d('0x11')](_0x325d('0x12'),_0x1454db,'request\x20sent');_0x4edef0(_0x44fd2f['result']['message']);}})[_0x325d('0x19')](function(_0xc0ca1c){logger[_0x325d('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1454db,_0xc0ca1c);_0x1df5d1(_0xc0ca1c);});});}exports[_0x325d('0x1a')]=function(_0x1893a3){var _0x166f83=this;return new Promise(function(_0x3f53aa,_0x205b22){return db[_0x325d('0x1b')][_0x325d('0x1c')](_0x1893a3[_0x325d('0x1d')],{'raw':_0x1893a3['options']?_0x1893a3['options'][_0x325d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1893a3[_0x325d('0x1f')]?_0x1893a3[_0x325d('0x1f')][_0x325d('0x20')]||null:null,'attributes':_0x1893a3['options']?_0x1893a3[_0x325d('0x1f')]['attributes']||null:null,'limit':_0x1893a3[_0x325d('0x1f')]?_0x1893a3[_0x325d('0x1f')]['limit']||null:null})['then'](function(_0x348661){logger[_0x325d('0x11')](_0x325d('0x1a'),_0x1893a3);logger[_0x325d('0x14')](_0x325d('0x1a'),_0x1893a3,JSON['stringify'](_0x348661));_0x3f53aa(_0x348661);})[_0x325d('0x19')](function(_0x1f47b9){logger[_0x325d('0x17')]('UpdateOpenchannelInteraction',_0x1f47b9['message'],_0x1893a3);_0x205b22(_0x166f83[_0x325d('0x17')](0x1f4,_0x1f47b9[_0x325d('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x450621){return new Promise(function(_0x2dbfd1,_0x2ab776){return db['OpenchannelInteraction'][_0x325d('0x21')]({'where':_0x450621[_0x325d('0x1f')]?_0x450621[_0x325d('0x1f')][_0x325d('0x20')]||null:null})['then'](function(_0x332cf0){if(_0x332cf0){return _0x332cf0[_0x325d('0x22')](_0x450621[_0x325d('0x1d')]['ids'],_[_0x325d('0x23')](_0x450621[_0x325d('0x1d')],[_0x325d('0x24'),'id'])||{});}})[_0x325d('0x25')](function(_0x205046){logger[_0x325d('0x11')](_0x325d('0x26'),_0x450621);logger[_0x325d('0x14')](_0x325d('0x26'),_0x450621,JSON[_0x325d('0x16')](_0x205046));_0x2dbfd1(_0x205046);})[_0x325d('0x19')](function(_0x51b24c){logger[_0x325d('0x17')](_0x325d('0x26'),_0x51b24c[_0x325d('0x18')],_0x450621);_0x2ab776(_this[_0x325d('0x17')](0x1f4,_0x51b24c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5bc0407..490a426 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 _0x58ea=['register','length','openchannelInteraction:','save','remove','update','removeListener'];(function(_0x58422c,_0x55903e){var _0x4f4554=function(_0x261f4d){while(--_0x261f4d){_0x58422c['push'](_0x58422c['shift']());}};_0x4f4554(++_0x55903e);}(_0x58ea,0x161));var _0xa58e=function(_0x557b03,_0x481775){_0x557b03=_0x557b03-0x0;var _0x4fef7d=_0x58ea[_0x557b03];return _0x4fef7d;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xa58e('0x0'),_0xa58e('0x1'),_0xa58e('0x2')];function createListener(_0x5e4899,_0x18d682){return function(_0x51a311){_0x18d682['emit'](_0x5e4899,_0x51a311);};}function removeListener(_0x104670,_0x2a7444){return function(){OpenchannelInteractionEvents[_0xa58e('0x3')](_0x104670,_0x2a7444);};}exports[_0xa58e('0x4')]=function(_0x4898c3){for(var _0x26f600=0x0,_0x4e21ec=events[_0xa58e('0x5')];_0x26f600<_0x4e21ec;_0x26f600++){var _0x4b701a=events[_0x26f600];var _0x4a84ea=createListener(_0xa58e('0x6')+_0x4b701a,_0x4898c3);OpenchannelInteractionEvents['on'](_0x4b701a,_0x4a84ea);}}; \ No newline at end of file +var _0x1fc6=['remove','update','emit','register'];(function(_0x371f70,_0x9a039){var _0x4c2223=function(_0x3a5065){while(--_0x3a5065){_0x371f70['push'](_0x371f70['shift']());}};_0x4c2223(++_0x9a039);}(_0x1fc6,0x74));var _0x61fc=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x1fc6[_0x485b5a];return _0xd2b34d;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x61fc('0x0'),_0x61fc('0x1')];function createListener(_0x100e71,_0x2c3a22){return function(_0x911ab8){_0x2c3a22[_0x61fc('0x2')](_0x100e71,_0x911ab8);};}function removeListener(_0x1167bb,_0x5d0e0f){return function(){OpenchannelInteractionEvents['removeListener'](_0x1167bb,_0x5d0e0f);};}exports[_0x61fc('0x3')]=function(_0x14f5c1){for(var _0x20fcf7=0x0,_0x55db18=events['length'];_0x20fcf7<_0x55db18;_0x20fcf7++){var _0x324d24=events[_0x20fcf7];var _0x15016d=createListener('openchannelInteraction:'+_0x324d24,_0x14f5c1);OpenchannelInteractionEvents['on'](_0x324d24,_0x15016d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index eaa3b26..8337447 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x2f7626,_0x503523){_0x2f7626=_0x2f7626-0x0;var _0x1508f8=_0x70e0[_0x2f7626];return _0x1508f8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x41cbd2,_0x35a4a3){_0x41cbd2=_0x41cbd2-0x0;var _0x57dc39=_0x70e0[_0x41cbd2];return _0x57dc39;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b10b10b..4296516 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 _0xae60=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0xae60,0x1c7));var _0x0ae6=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xae60[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require(_0x0ae6('0x0'));module[_0x0ae6('0x1')]={'body':{'type':Sequelize[_0x0ae6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0ae6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0ae6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0ae6('0x4')]('in','out'),'defaultValue':_0x0ae6('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0ae6('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0ae6('0x2')]}}; \ No newline at end of file +var _0x23a3=['out','DATE','STRING','TEXT','medium','BOOLEAN','ENUM'];(function(_0x297024,_0x58df91){var _0x133d06=function(_0x2db8df){while(--_0x2db8df){_0x297024['push'](_0x297024['shift']());}};_0x133d06(++_0x58df91);}(_0x23a3,0x131));var _0x323a=function(_0x35130f,_0x1bd1a5){_0x35130f=_0x35130f-0x0;var _0x3cf014=_0x23a3[_0x35130f];return _0x3cf014;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x323a('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x323a('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x323a('0x2')]('in',_0x323a('0x3')),'defaultValue':_0x323a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x323a('0x4')]},'providerName':{'type':Sequelize[_0x323a('0x5')]},'providerResponse':{'type':Sequelize[_0x323a('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e082fe0..31a5bfe 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 _0xd8b5=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','offset','limit','count','Content-Range','json','apply','reject','save','update','destroy','stack','name','index','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','include','findAll','rows','show','filters','includeAll','find','create','body','params','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE: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','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','RejectMessage','Sequelize','contact','rejectmessage'];(function(_0x561935,_0x5a6071){var _0x4f01b2=function(_0x45a82f){while(--_0x45a82f){_0x561935['push'](_0x561935['shift']());}};_0x4f01b2(++_0x5a6071);}(_0xd8b5,0x17d));var _0x5d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b5[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5d8b('0x0'));var rimraf=require(_0x5d8b('0x1'));var zipdir=require(_0x5d8b('0x2'));var jsonpatch=require(_0x5d8b('0x3'));var rp=require(_0x5d8b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d8b('0x5'));var path=require(_0x5d8b('0x6'));var sox=require(_0x5d8b('0x7'));var csv=require('to-csv');var ejs=require(_0x5d8b('0x8'));var fs=require('fs');var fs_extra=require(_0x5d8b('0x9'));var _=require(_0x5d8b('0xa'));var squel=require(_0x5d8b('0xb'));var crypto=require(_0x5d8b('0xc'));var jsforce=require(_0x5d8b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5d8b('0xe'));var querystring=require(_0x5d8b('0xf'));var Papa=require(_0x5d8b('0x10'));var Redis=require(_0x5d8b('0x11'));var authService=require(_0x5d8b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5d8b('0x13'));var hardwareService=require(_0x5d8b('0x14'));var logger=require(_0x5d8b('0x15'))('api');var utils=require(_0x5d8b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5d8b('0x17')]=_[_0x5d8b('0x18')](config[_0x5d8b('0x17')],{'host':_0x5d8b('0x19'),'port':0x18eb});var socket=require(_0x5d8b('0x1a'))(new Redis(config[_0x5d8b('0x17')]));require(_0x5d8b('0x1b'))[_0x5d8b('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5d8b('0x1d')][_0x5d8b('0x1e')]({'port':0x232c});var client9002=jayson[_0x5d8b('0x1d')][_0x5d8b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x176f32,_0x4a4397,_0x5e2fe9,_0x34cbf4){return new BPromise(function(_0x22659a,_0x2d477e){var _0x584a65=_0x34cbf4||client;return _0x584a65[_0x5d8b('0x1f')](_0x176f32,_0x5e2fe9)[_0x5d8b('0x20')](function(_0x51baba){logger[_0x5d8b('0x21')](_0x5d8b('0x22'),_0x4a4397,_0x5d8b('0x23'));logger[_0x5d8b('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4a4397,_0x5d8b('0x23'),JSON[_0x5d8b('0x25')](_0x51baba));if(_0x51baba['error']){if(_0x51baba[_0x5d8b('0x26')]['code']===0x1f4){logger[_0x5d8b('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a4397,_0x51baba[_0x5d8b('0x26')]['message']);return _0x2d477e(_0x51baba[_0x5d8b('0x26')][_0x5d8b('0x27')]);}logger[_0x5d8b('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a4397,_0x51baba[_0x5d8b('0x26')]['message']);return _0x22659a(_0x51baba['error'][_0x5d8b('0x27')]);}else{logger['info'](_0x5d8b('0x22'),_0x4a4397,_0x5d8b('0x23'));_0x22659a(_0x51baba[_0x5d8b('0x28')][_0x5d8b('0x27')]);}})[_0x5d8b('0x29')](function(_0x2de1b4){logger[_0x5d8b('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a4397,_0x2de1b4);_0x2d477e(_0x2de1b4);});});}function respondWithStatusCode(_0x57cd36,_0x3911ec){_0x3911ec=_0x3911ec||0xcc;return function(_0x22b02e){if(_0x22b02e){return _0x57cd36['sendStatus'](_0x3911ec);}return _0x57cd36[_0x5d8b('0x2a')](_0x3911ec)[_0x5d8b('0x2b')]();};}function respondWithResult(_0x329555,_0x225a26){_0x225a26=_0x225a26||0xc8;return function(_0x454a51){if(_0x454a51){return _0x329555['status'](_0x225a26)['json'](_0x454a51);}};}function respondWithFilteredResult(_0x574785,_0x5e0c88){return function(_0x28482c){if(_0x28482c){var _0x4d5405=typeof _0x5e0c88[_0x5d8b('0x2c')]==='undefined'&&typeof _0x5e0c88[_0x5d8b('0x2d')]==='undefined';var _0x4aeec9=_0x28482c[_0x5d8b('0x2e')];var _0x506039=_0x4d5405?0x0:_0x5e0c88[_0x5d8b('0x2c')];var _0x264c91=_0x4d5405?_0x28482c[_0x5d8b('0x2e')]:_0x5e0c88['offset']+_0x5e0c88['limit'];var _0x25c0d7;if(_0x264c91>=_0x4aeec9){_0x264c91=_0x4aeec9;_0x25c0d7=0xc8;}else{_0x25c0d7=0xce;}_0x574785['status'](_0x25c0d7);return _0x574785['set'](_0x5d8b('0x2f'),_0x506039+'-'+_0x264c91+'/'+_0x4aeec9)[_0x5d8b('0x30')](_0x28482c);}return null;};}function patchUpdates(_0x30ebc1){return function(_0x15dfcc){try{jsonpatch[_0x5d8b('0x31')](_0x15dfcc,_0x30ebc1,!![]);}catch(_0x1cd60c){return BPromise[_0x5d8b('0x32')](_0x1cd60c);}return _0x15dfcc[_0x5d8b('0x33')]();};}function saveUpdates(_0x464cbc,_0x1ec4f2){return function(_0x54997c){if(_0x54997c){return _0x54997c[_0x5d8b('0x34')](_0x464cbc)[_0x5d8b('0x20')](function(_0x4ed8f2){return _0x4ed8f2;});}return null;};}function removeEntity(_0x55fc0b,_0x19d434){return function(_0x9ec53c){if(_0x9ec53c){return _0x9ec53c[_0x5d8b('0x35')]()['then'](function(){_0x55fc0b[_0x5d8b('0x2a')](0xcc)[_0x5d8b('0x2b')]();});}};}function handleEntityNotFound(_0x27c133,_0x4991cb){return function(_0x3568a1){if(!_0x3568a1){_0x27c133['sendStatus'](0x194);}return _0x3568a1;};}function handleError(_0x35d622,_0x4a369b){_0x4a369b=_0x4a369b||0x1f4;return function(_0x5c8582){logger[_0x5d8b('0x26')](_0x5c8582[_0x5d8b('0x36')]);if(_0x5c8582['name']){delete _0x5c8582[_0x5d8b('0x37')];}_0x35d622['status'](_0x4a369b)['send'](_0x5c8582);};}exports[_0x5d8b('0x38')]=function(_0x40b82b,_0x3cb102){var _0x474f3f={},_0x28e1e9={},_0x14dcf0={'count':0x0,'rows':[]};var _0x8a8eb6=_['map'](db[_0x5d8b('0x39')][_0x5d8b('0x3a')],function(_0x1bbdc7){return{'name':_0x1bbdc7[_0x5d8b('0x3b')],'type':_0x1bbdc7[_0x5d8b('0x3c')][_0x5d8b('0x3d')]};});_0x28e1e9['model']=_['map'](_0x8a8eb6,_0x5d8b('0x37'));_0x28e1e9[_0x5d8b('0x3e')]=_[_0x5d8b('0x3f')](_0x40b82b[_0x5d8b('0x3e')]);_0x28e1e9['filters']=_[_0x5d8b('0x40')](_0x28e1e9[_0x5d8b('0x41')],_0x28e1e9[_0x5d8b('0x3e')]);_0x474f3f[_0x5d8b('0x42')]=_[_0x5d8b('0x40')](_0x28e1e9['model'],qs['fields'](_0x40b82b[_0x5d8b('0x3e')][_0x5d8b('0x43')]));_0x474f3f['attributes']=_0x474f3f[_0x5d8b('0x42')][_0x5d8b('0x44')]?_0x474f3f['attributes']:_0x28e1e9['model'];if(!_0x40b82b['query'][_0x5d8b('0x45')](_0x5d8b('0x46'))){_0x474f3f[_0x5d8b('0x2d')]=qs[_0x5d8b('0x2d')](_0x40b82b[_0x5d8b('0x3e')][_0x5d8b('0x2d')]);_0x474f3f['offset']=qs[_0x5d8b('0x2c')](_0x40b82b[_0x5d8b('0x3e')][_0x5d8b('0x2c')]);}_0x474f3f['order']=qs[_0x5d8b('0x47')](_0x40b82b['query'][_0x5d8b('0x47')]);_0x474f3f[_0x5d8b('0x48')]=qs['filters'](_[_0x5d8b('0x49')](_0x40b82b[_0x5d8b('0x3e')],_0x28e1e9['filters']),_0x8a8eb6);if(_0x40b82b['query'][_0x5d8b('0x4a')]){_0x474f3f['where']=_[_0x5d8b('0x4b')](_0x474f3f[_0x5d8b('0x48')],{'$or':_[_0x5d8b('0x4c')](_0x8a8eb6,function(_0x1c711e){if(_0x1c711e[_0x5d8b('0x3c')]!=='VIRTUAL'){var _0x4f4a40={};_0x4f4a40[_0x1c711e[_0x5d8b('0x37')]]={'$like':'%'+_0x40b82b[_0x5d8b('0x3e')][_0x5d8b('0x4a')]+'%'};return _0x4f4a40;}})});}_0x474f3f=_['merge']({},_0x474f3f,_0x40b82b[_0x5d8b('0x4d')]);var _0x1a535f={'where':_0x474f3f[_0x5d8b('0x48')]};return db[_0x5d8b('0x39')]['count'](_0x1a535f)['then'](function(_0x3d64ce){_0x14dcf0[_0x5d8b('0x2e')]=_0x3d64ce;if(_0x40b82b[_0x5d8b('0x3e')]['includeAll']){_0x474f3f[_0x5d8b('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5d8b('0x4f')](_0x474f3f);})[_0x5d8b('0x20')](function(_0x1b013a){_0x14dcf0[_0x5d8b('0x50')]=_0x1b013a;return _0x14dcf0;})['then'](respondWithFilteredResult(_0x3cb102,_0x474f3f))['catch'](handleError(_0x3cb102,null));};exports[_0x5d8b('0x51')]=function(_0x51aa07,_0xd47c91){var _0x47e3f9={'raw':!![],'where':{'id':_0x51aa07['params']['id']}},_0x23e6cb={};_0x23e6cb[_0x5d8b('0x41')]=_['keys'](db[_0x5d8b('0x39')][_0x5d8b('0x3a')]);_0x23e6cb['query']=_[_0x5d8b('0x3f')](_0x51aa07[_0x5d8b('0x3e')]);_0x23e6cb[_0x5d8b('0x52')]=_[_0x5d8b('0x40')](_0x23e6cb[_0x5d8b('0x41')],_0x23e6cb[_0x5d8b('0x3e')]);_0x47e3f9[_0x5d8b('0x42')]=_[_0x5d8b('0x40')](_0x23e6cb[_0x5d8b('0x41')],qs[_0x5d8b('0x43')](_0x51aa07[_0x5d8b('0x3e')][_0x5d8b('0x43')]));_0x47e3f9[_0x5d8b('0x42')]=_0x47e3f9[_0x5d8b('0x42')][_0x5d8b('0x44')]?_0x47e3f9[_0x5d8b('0x42')]:_0x23e6cb[_0x5d8b('0x41')];if(_0x51aa07[_0x5d8b('0x3e')][_0x5d8b('0x53')]){_0x47e3f9[_0x5d8b('0x4e')]=[{'all':!![]}];}_0x47e3f9=_[_0x5d8b('0x4b')]({},_0x47e3f9,_0x51aa07[_0x5d8b('0x4d')]);return db['OpenchannelMessage'][_0x5d8b('0x54')](_0x47e3f9)[_0x5d8b('0x20')](handleEntityNotFound(_0xd47c91,null))[_0x5d8b('0x20')](respondWithResult(_0xd47c91,null))[_0x5d8b('0x29')](handleError(_0xd47c91,null));};exports[_0x5d8b('0x55')]=function(_0x5ca169,_0x270813){return db[_0x5d8b('0x39')][_0x5d8b('0x55')](_0x5ca169[_0x5d8b('0x56')],{})[_0x5d8b('0x20')](respondWithResult(_0x270813,0xc9))[_0x5d8b('0x29')](handleError(_0x270813,null));};exports[_0x5d8b('0x34')]=function(_0x1b8d0c,_0x427c21){if(_0x1b8d0c[_0x5d8b('0x56')]['id']){delete _0x1b8d0c[_0x5d8b('0x56')]['id'];}return db[_0x5d8b('0x39')]['find']({'where':{'id':_0x1b8d0c[_0x5d8b('0x57')]['id']}})[_0x5d8b('0x20')](handleEntityNotFound(_0x427c21,null))[_0x5d8b('0x20')](saveUpdates(_0x1b8d0c['body'],null))[_0x5d8b('0x20')](respondWithResult(_0x427c21,null))[_0x5d8b('0x29')](handleError(_0x427c21,null));};exports[_0x5d8b('0x35')]=function(_0x1415b6,_0x46a5b5){return db[_0x5d8b('0x39')][_0x5d8b('0x54')]({'where':{'id':_0x1415b6['params']['id']}})['then'](handleEntityNotFound(_0x46a5b5,null))['then'](removeEntity(_0x46a5b5,null))['catch'](handleError(_0x46a5b5,null));};exports[_0x5d8b('0x58')]=function(_0x3323bc,_0x397d63){return db[_0x5d8b('0x39')][_0x5d8b('0x58')]()['then'](respondWithResult(_0x397d63,null))['catch'](handleError(_0x397d63,null));};var interaction_log=require(_0x5d8b('0x15'))(_0x5d8b('0x59'));exports[_0x5d8b('0x5a')]=function(_0x4acae8,_0x7b99ef,_0x216d2d){var _0x496ad8={'agent':{},'channel':_0x5d8b('0x5b')};if(_0x4acae8[_0x5d8b('0x56')]['id']){delete _0x4acae8[_0x5d8b('0x56')]['id'];}_0x4acae8[_0x5d8b('0x56')]['read']=!![];_0x4acae8[_0x5d8b('0x56')][_0x5d8b('0x5c')]=moment()[_0x5d8b('0x5d')](_0x5d8b('0x5e'));_0x4acae8[_0x5d8b('0x56')][_0x5d8b('0x5f')]=_0x4acae8['body'][_0x5d8b('0x5f')]||_0x4acae8[_0x5d8b('0x60')]['id'];_0x496ad8[_0x5d8b('0x61')]['id']=_0x4acae8[_0x5d8b('0x56')][_0x5d8b('0x5f')];return db[_0x5d8b('0x39')][_0x5d8b('0x54')]({'where':{'id':_0x4acae8[_0x5d8b('0x57')]['id'],'UserId':null}})[_0x5d8b('0x20')](handleEntityNotFound(_0x7b99ef,null))[_0x5d8b('0x20')](saveUpdates(_0x4acae8[_0x5d8b('0x56')],null))[_0x5d8b('0x20')](function(_0x42f8c5){if(_0x42f8c5){_0x496ad8[_0x5d8b('0x27')]=_0x42f8c5[_0x5d8b('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5d8b('0x54')]({'where':{'id':_0x42f8c5[_0x5d8b('0x63')]}});}return null;})[_0x5d8b('0x20')](handleEntityNotFound(_0x7b99ef,null))[_0x5d8b('0x20')](function(_0x7b3313){if(_0x7b3313){return _0x7b3313[_0x5d8b('0x34')]({'UserId':_0x4acae8[_0x5d8b('0x56')]['UserId'],'read1stAt':_[_0x5d8b('0x64')](_0x7b3313['read1stAt'])?moment()['format'](_0x5d8b('0x5e')):undefined});}return null;})['then'](function(_0xfdb7ea){if(_0xfdb7ea){_0x496ad8[_0x5d8b('0x65')]=_0xfdb7ea[_0x5d8b('0x62')]({'plain':!![]});interaction_log[_0x5d8b('0x21')](_0x5d8b('0x66'),_0x4acae8[_0x5d8b('0x60')]['id'],_0x4acae8[_0x5d8b('0x60')]['name'],_0x4acae8[_0x5d8b('0x60')][_0x5d8b('0x67')],_0x496ad8[_0x5d8b('0x65')]['id'],_0x4acae8[_0x5d8b('0x56')]?JSON[_0x5d8b('0x25')](_0x4acae8['body']):_0x5d8b('0x68'));return respondWithRpcPromise(_0x5d8b('0x69'),'acceptMessage',_0x496ad8);}return null;})[_0x5d8b('0x20')](function(_0x29b844){var _0xe76582=_0x5d8b('0x6a')+_0x29b844[_0x5d8b('0x27')][_0x5d8b('0x6b')];return db[_0x5d8b('0x6c')][_0x5d8b('0x3e')](_0xe76582,{'type':db['Sequelize'][_0x5d8b('0x6d')][_0x5d8b('0x6e')],'raw':!![]})['then'](function(_0x4a909a){return _0x4a909a;});})['then'](function(_0x466a86){if(_0x466a86){_0x496ad8[_0x5d8b('0x27')]['contact']=_0x466a86[0x0];if(!_0x4acae8[_0x5d8b('0x56')]['UserId'])return;return db[_0x5d8b('0x6f')][_0x5d8b('0x54')]({'where':{'id':_0x4acae8[_0x5d8b('0x56')][_0x5d8b('0x5f')],'role':_0x5d8b('0x61')},'attributes':['id','name',_0x5d8b('0x70'),_0x5d8b('0x71'),_0x5d8b('0x72')],'raw':!![]});}return null;})[_0x5d8b('0x20')](function(_0x2cd682){if(!_0x2cd682)return null;_0x496ad8[_0x5d8b('0x27')][_0x5d8b('0x61')]=_0x2cd682;return _0x496ad8;})['then'](function(_0x2f44bc){if(_0x2f44bc){if(_0x4acae8['body']['manual']){_0x496ad8[_0x5d8b('0x27')][_0x5d8b('0x73')]=util[_0x5d8b('0x5d')](_0x5d8b('0x74'),_0x4acae8['user'][_0x5d8b('0x37')]);_0x496ad8[_0x5d8b('0x27')][_0x5d8b('0x75')]=_0x496ad8[_0x5d8b('0x75')];_0x496ad8[_0x5d8b('0x27')][_0x5d8b('0x76')]=_0x496ad8[_0x5d8b('0x75')];_0x496ad8[_0x5d8b('0x27')][_0x5d8b('0x77')]=_0x5d8b('0x5a');return respondWithRpcPromise(_0x5d8b('0x78'),_0x5d8b('0x78'),{'event':_0x5d8b('0x79'),'message':_0x496ad8[_0x5d8b('0x27')]},client9002)['then'](function(){return _0x496ad8;});}return _0x496ad8;}return null;})[_0x5d8b('0x20')](respondWithResult(_0x7b99ef,null))['catch'](handleError(_0x7b99ef,null));};var interaction_log=require(_0x5d8b('0x15'))('openchannel-interactions');exports[_0x5d8b('0x32')]=function(_0x972005,_0x33eca3,_0x2b6621){var _0x2ca4c1={'agent':{},'channel':'openchannel'};if(_0x972005[_0x5d8b('0x56')]['id']){delete _0x972005[_0x5d8b('0x56')]['id'];}_0x972005[_0x5d8b('0x56')]['UserId']=_0x972005['body'][_0x5d8b('0x5f')]||_0x972005['user']['id'];_0x2ca4c1[_0x5d8b('0x61')]['id']=_0x972005[_0x5d8b('0x56')][_0x5d8b('0x5f')];return db[_0x5d8b('0x39')][_0x5d8b('0x54')]({'where':{'id':_0x972005[_0x5d8b('0x57')]['id'],'UserId':null}})[_0x5d8b('0x20')](handleEntityNotFound(_0x33eca3,null))[_0x5d8b('0x20')](function(_0x346288){if(_0x346288){_0x2ca4c1[_0x5d8b('0x27')]=_0x346288[_0x5d8b('0x62')]({'plain':!![]});return db[_0x5d8b('0x7a')][_0x5d8b('0x54')]({'where':{'id':_0x346288['OpenchannelInteractionId']}});}return null;})[_0x5d8b('0x20')](handleEntityNotFound(_0x33eca3,null))[_0x5d8b('0x20')](function(_0x549c04){if(_0x549c04){_0x2ca4c1[_0x5d8b('0x65')]=_0x549c04[_0x5d8b('0x62')]({'plain':!![]});interaction_log[_0x5d8b('0x21')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x972005[_0x5d8b('0x60')]['id'],_0x972005[_0x5d8b('0x60')][_0x5d8b('0x37')],_0x972005['user'][_0x5d8b('0x67')],_0x2ca4c1['interaction']['id'],_0x972005['body']?JSON[_0x5d8b('0x25')](_0x972005[_0x5d8b('0x56')]):_0x5d8b('0x68'));return respondWithRpcPromise(_0x5d8b('0x7b'),'rejectMessage',_0x2ca4c1);}return null;})[_0x5d8b('0x20')](function(_0x20e1ab){var _0x88a4b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20e1ab['message']['ContactId'];return db[_0x5d8b('0x6c')][_0x5d8b('0x3e')](_0x88a4b3,{'type':db[_0x5d8b('0x7c')][_0x5d8b('0x6d')][_0x5d8b('0x6e')],'raw':!![]})['then'](function(_0x3b7861){return _0x3b7861;});})['then'](function(_0x1ed302){if(_0x1ed302){_0x2ca4c1[_0x5d8b('0x27')][_0x5d8b('0x7d')]=_0x1ed302[0x0];if(!_0x972005[_0x5d8b('0x56')][_0x5d8b('0x5f')])return;return db[_0x5d8b('0x6f')][_0x5d8b('0x54')]({'where':{'id':_0x972005['body'][_0x5d8b('0x5f')],'role':_0x5d8b('0x61')},'attributes':['id',_0x5d8b('0x37'),'fullname',_0x5d8b('0x71'),_0x5d8b('0x72')],'raw':!![]});}return null;})['then'](function(_0x40d516){if(!_0x40d516)return null;_0x2ca4c1[_0x5d8b('0x27')][_0x5d8b('0x61')]=_0x40d516;return _0x2ca4c1;})[_0x5d8b('0x20')](function(_0x491fc6){if(_0x491fc6){_0x491fc6[_0x5d8b('0x27')]['interface']=util[_0x5d8b('0x5d')](_0x5d8b('0x74'),_0x972005[_0x5d8b('0x60')][_0x5d8b('0x37')]);_0x491fc6[_0x5d8b('0x27')][_0x5d8b('0x75')]=_0x2ca4c1['channel'];_0x491fc6[_0x5d8b('0x27')][_0x5d8b('0x76')]=_0x2ca4c1['channel'];_0x491fc6[_0x5d8b('0x27')]['event']=_0x5d8b('0x32');respondWithRpcPromise(_0x5d8b('0x78'),_0x5d8b('0x78'),{'event':_0x5d8b('0x7e'),'message':_0x491fc6[_0x5d8b('0x27')]},client9002);return _0x2ca4c1;}return null;})[_0x5d8b('0x20')](respondWithResult(_0x33eca3,null))[_0x5d8b('0x29')](handleError(_0x33eca3,null));}; \ No newline at end of file +var _0x6ec2=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','catch','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','show','includeAll','include','find','create','body','update','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','email','motionChannel','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x51ea0f,_0xec9d76){var _0x523fde=function(_0x3be7b0){while(--_0x3be7b0){_0x51ea0f['push'](_0x51ea0f['shift']());}};_0x523fde(++_0xec9d76);}(_0x6ec2,0x78));var _0x26ec=function(_0x3c4998,_0x41ed83){_0x3c4998=_0x3c4998-0x0;var _0x52de89=_0x6ec2[_0x3c4998];return _0x52de89;};'use strict';var emlformat=require(_0x26ec('0x0'));var rimraf=require(_0x26ec('0x1'));var zipdir=require(_0x26ec('0x2'));var jsonpatch=require(_0x26ec('0x3'));var rp=require(_0x26ec('0x4'));var moment=require(_0x26ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x26ec('0x6'));var util=require(_0x26ec('0x7'));var path=require(_0x26ec('0x8'));var sox=require(_0x26ec('0x9'));var csv=require(_0x26ec('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26ec('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x26ec('0xc'));var jsforce=require(_0x26ec('0xd'));var deskjs=require(_0x26ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0x26ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x26ec('0x10'));var authService=require(_0x26ec('0x11'));var qs=require(_0x26ec('0x12'));var as=require(_0x26ec('0x13'));var hardwareService=require(_0x26ec('0x14'));var logger=require(_0x26ec('0x15'))(_0x26ec('0x16'));var utils=require(_0x26ec('0x17'));var config=require(_0x26ec('0x18'));var licenseUtil=require(_0x26ec('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x26ec('0x1a')](config[_0x26ec('0x1b')],{'host':_0x26ec('0x1c'),'port':0x18eb});var socket=require(_0x26ec('0x1d'))(new Redis(config[_0x26ec('0x1b')]));require(_0x26ec('0x1e'))[_0x26ec('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x26ec('0x20')][_0x26ec('0x21')]({'port':0x232c});var client9002=jayson[_0x26ec('0x20')][_0x26ec('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4f9950,_0x4d366c,_0x438985,_0x127385){return new BPromise(function(_0x4bdced,_0x20c407){var _0x49dc68=_0x127385||client;return _0x49dc68[_0x26ec('0x22')](_0x4f9950,_0x438985)[_0x26ec('0x23')](function(_0x50c9de){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x4d366c,_0x26ec('0x24'));logger[_0x26ec('0x25')](_0x26ec('0x26'),_0x4d366c,'request\x20sent',JSON['stringify'](_0x50c9de));if(_0x50c9de[_0x26ec('0x27')]){if(_0x50c9de[_0x26ec('0x27')][_0x26ec('0x28')]===0x1f4){logger[_0x26ec('0x27')](_0x26ec('0x29'),_0x4d366c,_0x50c9de[_0x26ec('0x27')]['message']);return _0x20c407(_0x50c9de[_0x26ec('0x27')][_0x26ec('0x2a')]);}logger[_0x26ec('0x27')](_0x26ec('0x29'),_0x4d366c,_0x50c9de[_0x26ec('0x27')]['message']);return _0x4bdced(_0x50c9de['error'][_0x26ec('0x2a')]);}else{logger[_0x26ec('0x2b')](_0x26ec('0x29'),_0x4d366c,'request\x20sent');_0x4bdced(_0x50c9de['result'][_0x26ec('0x2a')]);}})[_0x26ec('0x2c')](function(_0x16aba4){logger[_0x26ec('0x27')](_0x26ec('0x29'),_0x4d366c,_0x16aba4);_0x20c407(_0x16aba4);});});}function respondWithStatusCode(_0x89bd5f,_0x439f78){_0x439f78=_0x439f78||0xcc;return function(_0x4e9cf8){if(_0x4e9cf8){return _0x89bd5f['sendStatus'](_0x439f78);}return _0x89bd5f['status'](_0x439f78)[_0x26ec('0x2d')]();};}function respondWithResult(_0xddd5fc,_0x352bef){_0x352bef=_0x352bef||0xc8;return function(_0x3fd842){if(_0x3fd842){return _0xddd5fc[_0x26ec('0x2e')](_0x352bef)[_0x26ec('0x2f')](_0x3fd842);}};}function respondWithFilteredResult(_0x3268e9,_0x4a1371){return function(_0x30231e){if(_0x30231e){var _0x5d10ba=typeof _0x4a1371[_0x26ec('0x30')]===_0x26ec('0x31')&&typeof _0x4a1371['limit']===_0x26ec('0x31');var _0x2d30e6=_0x30231e[_0x26ec('0x32')];var _0x18999a=_0x5d10ba?0x0:_0x4a1371[_0x26ec('0x30')];var _0x24d390=_0x5d10ba?_0x30231e['count']:_0x4a1371[_0x26ec('0x30')]+_0x4a1371['limit'];var _0x3d8b89;if(_0x24d390>=_0x2d30e6){_0x24d390=_0x2d30e6;_0x3d8b89=0xc8;}else{_0x3d8b89=0xce;}_0x3268e9['status'](_0x3d8b89);return _0x3268e9[_0x26ec('0x33')](_0x26ec('0x34'),_0x18999a+'-'+_0x24d390+'/'+_0x2d30e6)['json'](_0x30231e);}return null;};}function patchUpdates(_0x4555ea){return function(_0x13c4c3){try{jsonpatch[_0x26ec('0x35')](_0x13c4c3,_0x4555ea,!![]);}catch(_0x5fe57f){return BPromise[_0x26ec('0x36')](_0x5fe57f);}return _0x13c4c3[_0x26ec('0x37')]();};}function saveUpdates(_0x4f1806,_0x5bf0b8){return function(_0x56e03c){if(_0x56e03c){return _0x56e03c['update'](_0x4f1806)['then'](function(_0x187e7d){return _0x187e7d;});}return null;};}function removeEntity(_0x2543a6,_0x2737c6){return function(_0x27652d){if(_0x27652d){return _0x27652d[_0x26ec('0x38')]()['then'](function(){_0x2543a6[_0x26ec('0x2e')](0xcc)[_0x26ec('0x2d')]();});}};}function handleEntityNotFound(_0x35a745,_0x1044e5){return function(_0x3581ea){if(!_0x3581ea){_0x35a745['sendStatus'](0x194);}return _0x3581ea;};}function handleError(_0xb43651,_0x1976e5){_0x1976e5=_0x1976e5||0x1f4;return function(_0x15391c){logger[_0x26ec('0x27')](_0x15391c[_0x26ec('0x39')]);if(_0x15391c[_0x26ec('0x3a')]){delete _0x15391c[_0x26ec('0x3a')];}_0xb43651[_0x26ec('0x2e')](_0x1976e5)[_0x26ec('0x3b')](_0x15391c);};}exports[_0x26ec('0x3c')]=function(_0x48d7cf,_0x4e026e){var _0x4a5cd2={},_0xbabf16={},_0x55bc95={'count':0x0,'rows':[]};var _0x32d570=_['map'](db[_0x26ec('0x3d')][_0x26ec('0x3e')],function(_0x11fc8c){return{'name':_0x11fc8c[_0x26ec('0x3f')],'type':_0x11fc8c[_0x26ec('0x40')][_0x26ec('0x41')]};});_0xbabf16['model']=_[_0x26ec('0x42')](_0x32d570,_0x26ec('0x3a'));_0xbabf16[_0x26ec('0x43')]=_[_0x26ec('0x44')](_0x48d7cf[_0x26ec('0x43')]);_0xbabf16[_0x26ec('0x45')]=_[_0x26ec('0x46')](_0xbabf16[_0x26ec('0x47')],_0xbabf16[_0x26ec('0x43')]);_0x4a5cd2[_0x26ec('0x48')]=_[_0x26ec('0x46')](_0xbabf16[_0x26ec('0x47')],qs[_0x26ec('0x49')](_0x48d7cf[_0x26ec('0x43')][_0x26ec('0x49')]));_0x4a5cd2['attributes']=_0x4a5cd2[_0x26ec('0x48')][_0x26ec('0x4a')]?_0x4a5cd2[_0x26ec('0x48')]:_0xbabf16[_0x26ec('0x47')];if(!_0x48d7cf[_0x26ec('0x43')][_0x26ec('0x4b')]('nolimit')){_0x4a5cd2['limit']=qs[_0x26ec('0x4c')](_0x48d7cf['query'][_0x26ec('0x4c')]);_0x4a5cd2[_0x26ec('0x30')]=qs[_0x26ec('0x30')](_0x48d7cf[_0x26ec('0x43')][_0x26ec('0x30')]);}_0x4a5cd2[_0x26ec('0x4d')]=qs[_0x26ec('0x4e')](_0x48d7cf[_0x26ec('0x43')]['sort']);_0x4a5cd2[_0x26ec('0x4f')]=qs[_0x26ec('0x45')](_[_0x26ec('0x50')](_0x48d7cf['query'],_0xbabf16[_0x26ec('0x45')]),_0x32d570);if(_0x48d7cf[_0x26ec('0x43')][_0x26ec('0x51')]){_0x4a5cd2[_0x26ec('0x4f')]=_[_0x26ec('0x52')](_0x4a5cd2[_0x26ec('0x4f')],{'$or':_[_0x26ec('0x42')](_0x32d570,function(_0xbfc5a2){if(_0xbfc5a2[_0x26ec('0x40')]!==_0x26ec('0x53')){var _0x211947={};_0x211947[_0xbfc5a2[_0x26ec('0x3a')]]={'$like':'%'+_0x48d7cf[_0x26ec('0x43')][_0x26ec('0x51')]+'%'};return _0x211947;}})});}_0x4a5cd2=_['merge']({},_0x4a5cd2,_0x48d7cf['options']);var _0x121e2f={'where':_0x4a5cd2['where']};return db['OpenchannelMessage'][_0x26ec('0x32')](_0x121e2f)[_0x26ec('0x23')](function(_0xcd057a){_0x55bc95['count']=_0xcd057a;if(_0x48d7cf['query']['includeAll']){_0x4a5cd2['include']=[{'all':!![]}];}return db[_0x26ec('0x3d')]['findAll'](_0x4a5cd2);})[_0x26ec('0x23')](function(_0x1220da){_0x55bc95['rows']=_0x1220da;return _0x55bc95;})['then'](respondWithFilteredResult(_0x4e026e,_0x4a5cd2))[_0x26ec('0x2c')](handleError(_0x4e026e,null));};exports[_0x26ec('0x54')]=function(_0x4f7931,_0x45673f){var _0x12f463={'raw':!![],'where':{'id':_0x4f7931['params']['id']}},_0x554710={};_0x554710[_0x26ec('0x47')]=_[_0x26ec('0x44')](db[_0x26ec('0x3d')]['rawAttributes']);_0x554710[_0x26ec('0x43')]=_['keys'](_0x4f7931[_0x26ec('0x43')]);_0x554710[_0x26ec('0x45')]=_[_0x26ec('0x46')](_0x554710[_0x26ec('0x47')],_0x554710[_0x26ec('0x43')]);_0x12f463[_0x26ec('0x48')]=_['intersection'](_0x554710[_0x26ec('0x47')],qs[_0x26ec('0x49')](_0x4f7931['query'][_0x26ec('0x49')]));_0x12f463[_0x26ec('0x48')]=_0x12f463['attributes'][_0x26ec('0x4a')]?_0x12f463['attributes']:_0x554710['model'];if(_0x4f7931[_0x26ec('0x43')][_0x26ec('0x55')]){_0x12f463[_0x26ec('0x56')]=[{'all':!![]}];}_0x12f463=_['merge']({},_0x12f463,_0x4f7931['options']);return db[_0x26ec('0x3d')][_0x26ec('0x57')](_0x12f463)[_0x26ec('0x23')](handleEntityNotFound(_0x45673f,null))['then'](respondWithResult(_0x45673f,null))[_0x26ec('0x2c')](handleError(_0x45673f,null));};exports[_0x26ec('0x58')]=function(_0x580f68,_0x55aaa1){return db[_0x26ec('0x3d')]['create'](_0x580f68[_0x26ec('0x59')],{})[_0x26ec('0x23')](respondWithResult(_0x55aaa1,0xc9))[_0x26ec('0x2c')](handleError(_0x55aaa1,null));};exports[_0x26ec('0x5a')]=function(_0x5f4fc2,_0x4bec5b){if(_0x5f4fc2[_0x26ec('0x59')]['id']){delete _0x5f4fc2[_0x26ec('0x59')]['id'];}return db[_0x26ec('0x3d')][_0x26ec('0x57')]({'where':{'id':_0x5f4fc2[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x4bec5b,null))[_0x26ec('0x23')](saveUpdates(_0x5f4fc2['body'],null))[_0x26ec('0x23')](respondWithResult(_0x4bec5b,null))[_0x26ec('0x2c')](handleError(_0x4bec5b,null));};exports[_0x26ec('0x38')]=function(_0x2e77a9,_0x2e0c77){return db[_0x26ec('0x3d')][_0x26ec('0x57')]({'where':{'id':_0x2e77a9['params']['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x2e0c77,null))[_0x26ec('0x23')](removeEntity(_0x2e0c77,null))[_0x26ec('0x2c')](handleError(_0x2e0c77,null));};exports[_0x26ec('0x5c')]=function(_0x53ffa5,_0x142a50){return db[_0x26ec('0x3d')]['describe']()[_0x26ec('0x23')](respondWithResult(_0x142a50,null))[_0x26ec('0x2c')](handleError(_0x142a50,null));};var interaction_log=require(_0x26ec('0x15'))(_0x26ec('0x5d'));exports[_0x26ec('0x5e')]=function(_0x457a56,_0xa0da95,_0x4a9218){var _0x2bd24a={'agent':{},'channel':_0x26ec('0x5f')};if(_0x457a56['body']['id']){delete _0x457a56[_0x26ec('0x59')]['id'];}_0x457a56[_0x26ec('0x59')][_0x26ec('0x60')]=!![];_0x457a56[_0x26ec('0x59')][_0x26ec('0x61')]=moment()[_0x26ec('0x62')](_0x26ec('0x63'));_0x457a56[_0x26ec('0x59')][_0x26ec('0x64')]=_0x457a56[_0x26ec('0x59')][_0x26ec('0x64')]||_0x457a56[_0x26ec('0x65')]['id'];_0x2bd24a[_0x26ec('0x66')]['id']=_0x457a56[_0x26ec('0x59')][_0x26ec('0x64')];return db['OpenchannelMessage']['find']({'where':{'id':_0x457a56['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa0da95,null))[_0x26ec('0x23')](saveUpdates(_0x457a56[_0x26ec('0x59')],null))[_0x26ec('0x23')](function(_0x5a0488){if(_0x5a0488){_0x2bd24a[_0x26ec('0x2a')]=_0x5a0488['get']({'plain':!![]});return db[_0x26ec('0x67')][_0x26ec('0x57')]({'where':{'id':_0x5a0488[_0x26ec('0x68')]}});}return null;})['then'](handleEntityNotFound(_0xa0da95,null))[_0x26ec('0x23')](function(_0x2579c2){if(_0x2579c2){return _0x2579c2[_0x26ec('0x5a')]({'UserId':_0x457a56[_0x26ec('0x59')][_0x26ec('0x64')],'read1stAt':_['isNil'](_0x2579c2[_0x26ec('0x69')])?moment()[_0x26ec('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x26ec('0x23')](function(_0x32addf){if(_0x32addf){_0x2bd24a[_0x26ec('0x6a')]=_0x32addf['get']({'plain':!![]});interaction_log[_0x26ec('0x2b')](_0x26ec('0x6b'),_0x457a56[_0x26ec('0x65')]['id'],_0x457a56[_0x26ec('0x65')][_0x26ec('0x3a')],_0x457a56[_0x26ec('0x65')][_0x26ec('0x6c')],_0x2bd24a[_0x26ec('0x6a')]['id'],_0x457a56[_0x26ec('0x59')]?JSON[_0x26ec('0x6d')](_0x457a56[_0x26ec('0x59')]):_0x26ec('0x6e'));return respondWithRpcPromise(_0x26ec('0x6f'),_0x26ec('0x70'),_0x2bd24a);}return null;})[_0x26ec('0x23')](function(_0x463cba){var _0x5d4514='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x463cba[_0x26ec('0x2a')][_0x26ec('0x71')];return db[_0x26ec('0x72')][_0x26ec('0x43')](_0x5d4514,{'type':db[_0x26ec('0x73')][_0x26ec('0x74')]['SELECT'],'raw':!![]})[_0x26ec('0x23')](function(_0x1330a4){return _0x1330a4;});})[_0x26ec('0x23')](function(_0x19a10c){if(_0x19a10c){_0x2bd24a[_0x26ec('0x2a')][_0x26ec('0x75')]=_0x19a10c[0x0];if(!_0x457a56[_0x26ec('0x59')][_0x26ec('0x64')])return;return db[_0x26ec('0x76')][_0x26ec('0x57')]({'where':{'id':_0x457a56[_0x26ec('0x59')]['UserId'],'role':_0x26ec('0x66')},'attributes':['id',_0x26ec('0x3a'),_0x26ec('0x77'),'email',_0x26ec('0x78')],'raw':!![]});}return null;})[_0x26ec('0x23')](function(_0x4fd37e){if(!_0x4fd37e)return null;_0x2bd24a[_0x26ec('0x2a')]['agent']=_0x4fd37e;return _0x2bd24a;})[_0x26ec('0x23')](function(_0x33301f){if(_0x33301f){if(_0x457a56[_0x26ec('0x59')][_0x26ec('0x79')]){_0x2bd24a[_0x26ec('0x2a')][_0x26ec('0x7a')]=util['format'](_0x26ec('0x7b'),_0x457a56[_0x26ec('0x65')]['name']);_0x2bd24a[_0x26ec('0x2a')][_0x26ec('0x7c')]=_0x2bd24a['channel'];_0x2bd24a[_0x26ec('0x2a')]['motionChannel']=_0x2bd24a[_0x26ec('0x7c')];_0x2bd24a[_0x26ec('0x2a')]['event']=_0x26ec('0x5e');return respondWithRpcPromise(_0x26ec('0x7d'),'EventManager',{'event':_0x26ec('0x7e'),'message':_0x2bd24a[_0x26ec('0x2a')]},client9002)[_0x26ec('0x23')](function(){return _0x2bd24a;});}return _0x2bd24a;}return null;})[_0x26ec('0x23')](respondWithResult(_0xa0da95,null))[_0x26ec('0x2c')](handleError(_0xa0da95,null));};var interaction_log=require(_0x26ec('0x15'))(_0x26ec('0x5d'));exports['reject']=function(_0x423015,_0x367f19,_0x5781bb){var _0x511bc7={'agent':{},'channel':'openchannel'};if(_0x423015[_0x26ec('0x59')]['id']){delete _0x423015[_0x26ec('0x59')]['id'];}_0x423015[_0x26ec('0x59')]['UserId']=_0x423015[_0x26ec('0x59')][_0x26ec('0x64')]||_0x423015[_0x26ec('0x65')]['id'];_0x511bc7[_0x26ec('0x66')]['id']=_0x423015[_0x26ec('0x59')][_0x26ec('0x64')];return db[_0x26ec('0x3d')]['find']({'where':{'id':_0x423015[_0x26ec('0x5b')]['id'],'UserId':null}})[_0x26ec('0x23')](handleEntityNotFound(_0x367f19,null))[_0x26ec('0x23')](function(_0xff099f){if(_0xff099f){_0x511bc7[_0x26ec('0x2a')]=_0xff099f[_0x26ec('0x7f')]({'plain':!![]});return db[_0x26ec('0x67')][_0x26ec('0x57')]({'where':{'id':_0xff099f[_0x26ec('0x68')]}});}return null;})[_0x26ec('0x23')](handleEntityNotFound(_0x367f19,null))[_0x26ec('0x23')](function(_0x1f1579){if(_0x1f1579){_0x511bc7[_0x26ec('0x6a')]=_0x1f1579[_0x26ec('0x7f')]({'plain':!![]});interaction_log[_0x26ec('0x2b')](_0x26ec('0x80'),_0x423015[_0x26ec('0x65')]['id'],_0x423015[_0x26ec('0x65')][_0x26ec('0x3a')],_0x423015[_0x26ec('0x65')][_0x26ec('0x6c')],_0x511bc7[_0x26ec('0x6a')]['id'],_0x423015[_0x26ec('0x59')]?JSON[_0x26ec('0x6d')](_0x423015[_0x26ec('0x59')]):_0x26ec('0x6e'));return respondWithRpcPromise('RejectMessage',_0x26ec('0x81'),_0x511bc7);}return null;})[_0x26ec('0x23')](function(_0x42ae13){var _0x2fd410=_0x26ec('0x82')+_0x42ae13[_0x26ec('0x2a')][_0x26ec('0x71')];return db[_0x26ec('0x72')][_0x26ec('0x43')](_0x2fd410,{'type':db['Sequelize'][_0x26ec('0x74')][_0x26ec('0x83')],'raw':!![]})[_0x26ec('0x23')](function(_0xa43ab5){return _0xa43ab5;});})[_0x26ec('0x23')](function(_0x9eaa77){if(_0x9eaa77){_0x511bc7[_0x26ec('0x2a')][_0x26ec('0x75')]=_0x9eaa77[0x0];if(!_0x423015['body'][_0x26ec('0x64')])return;return db[_0x26ec('0x76')]['find']({'where':{'id':_0x423015[_0x26ec('0x59')][_0x26ec('0x64')],'role':'agent'},'attributes':['id','name',_0x26ec('0x77'),_0x26ec('0x84'),_0x26ec('0x78')],'raw':!![]});}return null;})[_0x26ec('0x23')](function(_0x1ee360){if(!_0x1ee360)return null;_0x511bc7[_0x26ec('0x2a')][_0x26ec('0x66')]=_0x1ee360;return _0x511bc7;})[_0x26ec('0x23')](function(_0xbac8ed){if(_0xbac8ed){_0xbac8ed[_0x26ec('0x2a')][_0x26ec('0x7a')]=util[_0x26ec('0x62')]('SIP/%s',_0x423015[_0x26ec('0x65')]['name']);_0xbac8ed['message']['channel']=_0x511bc7['channel'];_0xbac8ed[_0x26ec('0x2a')][_0x26ec('0x85')]=_0x511bc7[_0x26ec('0x7c')];_0xbac8ed[_0x26ec('0x2a')][_0x26ec('0x86')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x26ec('0x87'),'message':_0xbac8ed[_0x26ec('0x2a')]},client9002);return _0x511bc7;}return null;})[_0x26ec('0x23')](respondWithResult(_0x367f19,null))[_0x26ec('0x2c')](handleError(_0x367f19,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index a777e01..3cf8a5f 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 _0x4be5=['update','remove','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x4be5,0xc1));var _0x54be=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x4be5[_0x1cbcf1];return _0x3a06f0;};'use strict';var EventEmitter=require(_0x54be('0x0'));var OpenchannelMessage=require(_0x54be('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x54be('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x54be('0x3'),'afterDestroy':_0x54be('0x4')};function emitEvent(_0x2b9bad){return function(_0xd7b34f,_0xfa0742,_0x82590b){OpenchannelMessageEvents['emit'](_0x2b9bad+':'+_0xd7b34f['id'],_0xd7b34f);OpenchannelMessageEvents['emit'](_0x2b9bad,_0xd7b34f);_0x82590b(null);};}for(var e in events){if(events[_0x54be('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x54be('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xb351=['OpenchannelMessage','setMaxListeners','remove','emit','events','../../mysqldb'];(function(_0x2c6ddd,_0x2e6137){var _0x1eecda=function(_0x4de009){while(--_0x4de009){_0x2c6ddd['push'](_0x2c6ddd['shift']());}};_0x1eecda(++_0x2e6137);}(_0xb351,0xa0));var _0x1b35=function(_0x1d2a9e,_0x33fd9d){_0x1d2a9e=_0x1d2a9e-0x0;var _0x5e8a64=_0xb351[_0x1d2a9e];return _0x5e8a64;};'use strict';var EventEmitter=require(_0x1b35('0x0'));var OpenchannelMessage=require(_0x1b35('0x1'))['db'][_0x1b35('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1b35('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1b35('0x4')};function emitEvent(_0x4d04d1){return function(_0x5d222d,_0x4f49bb,_0x35e866){OpenchannelMessageEvents['emit'](_0x4d04d1+':'+_0x5d222d['id'],_0x5d222d);OpenchannelMessageEvents[_0x1b35('0x5')](_0x4d04d1,_0x5d222d);_0x35e866(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 5be0402..c80cf36 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 _0x3423=['update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','get','info','OpenchannelMessage,\x20%s,\x20%s','format','replyUri','length','Interaction','omit','POST','GET','afterCreate','threadId','error','inspect','finally','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','toLowerCase','direction','out','isNil','UserId','findOne','OpenchannelInteractionId','then'];(function(_0x2bf8c6,_0x314fff){var _0x28bf19=function(_0xddccf6){while(--_0xddccf6){_0x2bf8c6['push'](_0x2bf8c6['shift']());}};_0x28bf19(++_0x314fff);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'paranoid':![],'indexes':[{'name':_0x3342('0xd'),'fields':[_0x3342('0xe')],'type':_0x3342('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9cc419,_0x4ae4f3,_0x582c37){var _0x2d0cb0=_0x467453['models'];var _0x5a1fba=_0x9cc419['get']({'plain':!![]});if(_0x5a1fba['direction'][_0x3342('0x10')]()==='in'||_0x5a1fba[_0x3342('0x11')]['toLowerCase']()===_0x3342('0x12')&&!_0x5a1fba['secret']&&!_[_0x3342('0x13')](_0x5a1fba[_0x3342('0x14')])){_0x2d0cb0['OpenchannelInteraction'][_0x3342('0x15')]({'where':{'id':_0x5a1fba[_0x3342('0x16')]}})[_0x3342('0x17')](function(_0xe4689e){if(_0xe4689e){_0xe4689e[_0x3342('0x18')]({'lastMsgAt':_0x5a1fba[_0x3342('0x19')],'lastMsgDirection':_0x5a1fba[_0x3342('0x11')]['toLowerCase']()});}})[_0x3342('0x1a')](function(_0x19bd71){console['error'](_0x19bd71);});}if(_0x5a1fba[_0x3342('0x11')]===_0x3342('0x12')&&!_0x5a1fba['secret']){var _0x554f9c;_0x2d0cb0[_0x3342('0x1b')][_0x3342('0x1c')]()[_0x3342('0x17')](function(_0x2075cb){return _0x2d0cb0[_0x3342('0x1d')][_0x3342('0x1e')]({'where':{'id':_0x5a1fba[_0x3342('0x1f')]},'include':[{'model':_0x2d0cb0[_0x3342('0x20')],'as':_0x3342('0x21'),'where':{'id':_0x5a1fba['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2d0cb0[_0x3342('0x1b')],'as':_0x3342('0x22'),'attributes':_[_0x3342('0x23')](_0x2075cb)}]}]});})['then'](function(_0x3cb86f){_0x554f9c=_0x3cb86f[_0x3342('0x24')]({'plain':!![]});if(_0x554f9c&&_0x554f9c['replyUri']){logger[_0x3342('0x25')](_0x3342('0x26'),'afterCreate',util[_0x3342('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5a1fba['id'],_0x554f9c[_0x3342('0x28')]));if(_0x554f9c[_0x3342('0x21')]&&_0x554f9c[_0x3342('0x21')][_0x3342('0x29')]){_0x5a1fba[_0x3342('0x2a')]=_[_0x3342('0x2b')](_0x554f9c[_0x3342('0x21')][0x0],_0x3342('0x22'));_0x5a1fba['Contact']=_0x554f9c[_0x3342('0x21')][0x0]['Contact'];}var _0x4ae4f3={'method':_0x3342('0x2c'),'uri':encodeURI(_0x554f9c['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4ae4f3['method']){case _0x3342('0x2d'):_0x4ae4f3['qs']=_0x5a1fba;break;case'POST':_0x4ae4f3[_0x3342('0xe')]=_0x5a1fba;break;}return rp(_0x4ae4f3)['then'](function(_0x524286){logger['info'](_0x3342('0x26'),_0x3342('0x2e'),util[_0x3342('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5a1fba['id'],_0x554f9c[_0x3342('0x28')]));if(_0x524286[_0x3342('0xe')][_0x3342('0x2f')]&&_0x524286[_0x3342('0xe')]['threadId']!=_0x5a1fba[_0x3342('0x2a')][_0x3342('0x2f')]){return _0x2d0cb0[_0x3342('0x20')][_0x3342('0x18')]({'threadId':_0x524286[_0x3342('0xe')][_0x3342('0x2f')]},{'logging':!![],'where':{'id':_0x5a1fba[_0x3342('0x2a')]['id']}});}else{return;}})['then'](function(){return _0x9cc419[_0x3342('0x18')]({'read':!![]});})['catch'](function(_0x9c9def){logger[_0x3342('0x30')]('OpenchannelMessage,\x20%s,\x20%s',_0x3342('0x2e'),util[_0x3342('0x31')](_0x9c9def,{'showHidden':![],'depth':null}));_0x582c37();});}else{_0x582c37();}})[_0x3342('0x32')](function(){_0x582c37();});}else{_0x582c37();}}},'charset':_0x3342('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xea28=['moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','get','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','Contact','POST','GET','afterCreate','threadId','finally','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x150195,_0x1f8c94){var _0x2b449a=function(_0x28a00a){while(--_0x28a00a){_0x150195['push'](_0x150195['shift']());}};_0x2b449a(++_0x1f8c94);}(_0xea28,0x13a));var _0x8ea2=function(_0x11e9d2,_0x5d676d){_0x11e9d2=_0x11e9d2-0x0;var _0x2fc31e=_0xea28[_0x11e9d2];return _0x2fc31e;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[{'name':_0x8ea2('0xe'),'fields':[_0x8ea2('0xf')],'type':_0x8ea2('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x320750,_0x3de4a1,_0x3000f9){var _0x3d0b35=_0x513a0d[_0x8ea2('0x11')];var _0x500b82=_0x320750['get']({'plain':!![]});if(_0x500b82[_0x8ea2('0x12')][_0x8ea2('0x13')]()==='in'||_0x500b82[_0x8ea2('0x12')]['toLowerCase']()===_0x8ea2('0x14')&&!_0x500b82[_0x8ea2('0x15')]&&!_[_0x8ea2('0x16')](_0x500b82[_0x8ea2('0x17')])){_0x3d0b35[_0x8ea2('0x18')]['findOne']({'where':{'id':_0x500b82[_0x8ea2('0x19')]}})['then'](function(_0x4b2192){if(_0x4b2192){_0x4b2192[_0x8ea2('0x1a')]({'lastMsgAt':_0x500b82[_0x8ea2('0x1b')],'lastMsgDirection':_0x500b82[_0x8ea2('0x12')][_0x8ea2('0x13')]()});}})[_0x8ea2('0x1c')](function(_0xbb9bd1){console[_0x8ea2('0x1d')](_0xbb9bd1);});}if(_0x500b82[_0x8ea2('0x12')]===_0x8ea2('0x14')&&!_0x500b82[_0x8ea2('0x15')]){var _0x2dfa7c;_0x3d0b35[_0x8ea2('0x1e')][_0x8ea2('0x1f')]()[_0x8ea2('0x20')](function(_0x1b64cf){return _0x3d0b35[_0x8ea2('0x21')][_0x8ea2('0x22')]({'where':{'id':_0x500b82[_0x8ea2('0x23')]},'include':[{'model':_0x3d0b35[_0x8ea2('0x18')],'as':_0x8ea2('0x24'),'where':{'id':_0x500b82[_0x8ea2('0x19')]},'limit':0x1,'include':[{'model':_0x3d0b35[_0x8ea2('0x1e')],'as':'Contact','attributes':_['keys'](_0x1b64cf)}]}]});})[_0x8ea2('0x20')](function(_0x248c18){_0x2dfa7c=_0x248c18[_0x8ea2('0x25')]({'plain':!![]});if(_0x2dfa7c&&_0x2dfa7c['replyUri']){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),'afterCreate',util[_0x8ea2('0x28')](_0x8ea2('0x29'),_0x500b82['id'],_0x2dfa7c[_0x8ea2('0x2a')]));if(_0x2dfa7c[_0x8ea2('0x24')]&&_0x2dfa7c[_0x8ea2('0x24')][_0x8ea2('0x2b')]){_0x500b82[_0x8ea2('0x2c')]=_[_0x8ea2('0x2d')](_0x2dfa7c[_0x8ea2('0x24')][0x0],'Contact');_0x500b82[_0x8ea2('0x2e')]=_0x2dfa7c['Interactions'][0x0][_0x8ea2('0x2e')];}var _0x3de4a1={'method':_0x8ea2('0x2f'),'uri':encodeURI(_0x2dfa7c['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3de4a1['method']){case _0x8ea2('0x30'):_0x3de4a1['qs']=_0x500b82;break;case'POST':_0x3de4a1[_0x8ea2('0xf')]=_0x500b82;break;}return rp(_0x3de4a1)['then'](function(_0x3be291){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x8ea2('0x31'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x500b82['id'],_0x2dfa7c[_0x8ea2('0x2a')]));if(_0x3be291['body'][_0x8ea2('0x32')]&&_0x3be291[_0x8ea2('0xf')][_0x8ea2('0x32')]!=_0x500b82[_0x8ea2('0x2c')][_0x8ea2('0x32')]){return _0x3d0b35[_0x8ea2('0x18')][_0x8ea2('0x1a')]({'threadId':_0x3be291[_0x8ea2('0xf')][_0x8ea2('0x32')]},{'logging':!![],'where':{'id':_0x500b82[_0x8ea2('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x320750['update']({'read':!![]});})[_0x8ea2('0x1c')](function(_0x188553){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x8ea2('0x31'),util['inspect'](_0x188553,{'showHidden':![],'depth':null}));_0x3000f9();});}else{_0x3000f9();}})[_0x8ea2('0x33')](function(){_0x3000f9();});}else{_0x3000f9();}}},'charset':_0x8ea2('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 453f47a..04c44ad 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0xdb28,0x106));var _0x8db2=function(_0x34c83c,_0x4c8264){_0x34c83c=_0x34c83c-0x0;var _0x3455bd=_0xdb28[_0x34c83c];return _0x3455bd;};'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});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x8ee2e7,_0x3908e3){var _0x2d8334=function(_0x4cac61){while(--_0x4cac61){_0x8ee2e7['push'](_0x8ee2e7['shift']());}};_0x2d8334(++_0x3908e3);}(_0x1261,0x144));var _0x1126=function(_0x1534d4,_0x33c784){_0x1534d4=_0x1534d4-0x0;var _0x274edd=_0x1261[_0x1534d4];return _0x274edd;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 39bad3c..3250f05 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 _0x862b=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','register'];(function(_0x16cb2a,_0x23ea34){var _0x4ecd6f=function(_0x133690){while(--_0x133690){_0x16cb2a['push'](_0x16cb2a['shift']());}};_0x4ecd6f(++_0x23ea34);}(_0x862b,0x14a));var _0xb862=function(_0x5efa5b,_0x479f73){_0x5efa5b=_0x5efa5b-0x0;var _0x6c72d1=_0x862b[_0x5efa5b];return _0x6c72d1;};'use strict';var OpenchannelMessageEvents=require(_0xb862('0x0'));var events=[_0xb862('0x1'),_0xb862('0x2'),_0xb862('0x3')];function createListener(_0x203d60,_0x31537a){return function(_0x2c82a7){_0x31537a[_0xb862('0x4')](_0x203d60,_0x2c82a7);};}function removeListener(_0xea753e,_0x5338e0){return function(){OpenchannelMessageEvents['removeListener'](_0xea753e,_0x5338e0);};}exports[_0xb862('0x5')]=function(_0x3ac20d){for(var _0x5b3cf5=0x0,_0x5df65a=events[_0xb862('0x6')];_0x5b3cf5<_0x5df65a;_0x5b3cf5++){var _0x39797a=events[_0x5b3cf5];var _0x366482=createListener(_0xb862('0x7')+_0x39797a,_0x3ac20d);OpenchannelMessageEvents['on'](_0x39797a,_0x366482);}}; \ No newline at end of file +var _0xfb65=['emit','removeListener','register','length','save','remove'];(function(_0x30ac04,_0x365f1b){var _0x56b497=function(_0x2e4724){while(--_0x2e4724){_0x30ac04['push'](_0x30ac04['shift']());}};_0x56b497(++_0x365f1b);}(_0xfb65,0x82));var _0x5fb6=function(_0xe52bdd,_0xbd2ee3){_0xe52bdd=_0xe52bdd-0x0;var _0x186ba7=_0xfb65[_0xe52bdd];return _0x186ba7;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x5fb6('0x0'),_0x5fb6('0x1'),'update'];function createListener(_0x860687,_0x54af6d){return function(_0x194bac){_0x54af6d[_0x5fb6('0x2')](_0x860687,_0x194bac);};}function removeListener(_0xca6345,_0xb5f7c4){return function(){OpenchannelMessageEvents[_0x5fb6('0x3')](_0xca6345,_0xb5f7c4);};}exports[_0x5fb6('0x4')]=function(_0x4dec8f){for(var _0x50782b=0x0,_0x238914=events[_0x5fb6('0x5')];_0x50782b<_0x238914;_0x50782b++){var _0x1f99b8=events[_0x50782b];var _0x840390=createListener('openchannelMessage:'+_0x1f99b8,_0x4dec8f);OpenchannelMessageEvents['on'](_0x1f99b8,_0x840390);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0325f67..f78f24a 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 _0x0c1f=['../../config/environment','./openchannelQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','getAgents','post','create','/:id/teams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1c3c7d,_0x334ea6){var _0x33f020=function(_0x235e0c){while(--_0x235e0c){_0x1c3c7d['push'](_0x1c3c7d['shift']());}};_0x33f020(++_0x334ea6);}(_0x0c1f,0xa0));var _0xf0c1=function(_0x83c716,_0x25152d){_0x83c716=_0x83c716-0x0;var _0xab9893=_0x0c1f[_0x83c716];return _0xab9893;};'use strict';var multer=require(_0xf0c1('0x0'));var util=require(_0xf0c1('0x1'));var path=require(_0xf0c1('0x2'));var timeout=require(_0xf0c1('0x3'));var express=require(_0xf0c1('0x4'));var router=express[_0xf0c1('0x5')]();var fs_extra=require(_0xf0c1('0x6'));var auth=require(_0xf0c1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf0c1('0x8'));var controller=require(_0xf0c1('0x9'));router['get']('/',auth[_0xf0c1('0xa')](),controller['index']);router[_0xf0c1('0xb')](_0xf0c1('0xc'),auth[_0xf0c1('0xa')](),controller[_0xf0c1('0xd')]);router[_0xf0c1('0xb')](_0xf0c1('0xe'),auth['isAuthenticated'](),controller[_0xf0c1('0xf')]);router['get']('/:id/members',auth[_0xf0c1('0xa')](),controller['getMembers']);router[_0xf0c1('0xb')]('/:id/teams',auth[_0xf0c1('0xa')](),controller['getTeams']);router[_0xf0c1('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xf0c1('0x10')]);router[_0xf0c1('0x11')]('/',auth[_0xf0c1('0xa')](),controller[_0xf0c1('0x12')]);router[_0xf0c1('0x11')](_0xf0c1('0x13'),auth[_0xf0c1('0xa')](),controller['addTeams']);router[_0xf0c1('0x11')](_0xf0c1('0x14'),auth['isAuthenticated'](),controller[_0xf0c1('0x15')]);router[_0xf0c1('0x16')](_0xf0c1('0xe'),auth[_0xf0c1('0xa')](),controller[_0xf0c1('0x17')]);router[_0xf0c1('0x18')](_0xf0c1('0xe'),auth[_0xf0c1('0xa')](),controller['destroy']);router[_0xf0c1('0x18')](_0xf0c1('0x13'),auth[_0xf0c1('0xa')](),controller[_0xf0c1('0x19')]);router[_0xf0c1('0x18')]('/:id/users',auth[_0xf0c1('0xa')](),controller[_0xf0c1('0x1a')]);module[_0xf0c1('0x1b')]=router; \ No newline at end of file +var _0x2064=['/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','delete','/:id','removeTeams','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2064,0x137));var _0x4206=function(_0x2fc581,_0x5e055f){_0x2fc581=_0x2fc581-0x0;var _0x505402=_0x2064[_0x2fc581];return _0x505402;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4206('0x0'));var timeout=require('connect-timeout');var express=require(_0x4206('0x1'));var router=express[_0x4206('0x2')]();var fs_extra=require(_0x4206('0x3'));var auth=require(_0x4206('0x4'));var interaction=require(_0x4206('0x5'));var config=require('../../config/environment');var controller=require(_0x4206('0x6'));router[_0x4206('0x7')]('/',auth[_0x4206('0x8')](),controller[_0x4206('0x9')]);router[_0x4206('0x7')](_0x4206('0xa'),auth[_0x4206('0x8')](),controller[_0x4206('0xb')]);router[_0x4206('0x7')]('/:id',auth[_0x4206('0x8')](),controller[_0x4206('0xc')]);router['get'](_0x4206('0xd'),auth['isAuthenticated'](),controller[_0x4206('0xe')]);router[_0x4206('0x7')](_0x4206('0xf'),auth[_0x4206('0x8')](),controller[_0x4206('0x10')]);router['get']('/:id/users',auth[_0x4206('0x8')](),controller[_0x4206('0x11')]);router[_0x4206('0x12')]('/',auth[_0x4206('0x8')](),controller[_0x4206('0x13')]);router[_0x4206('0x12')](_0x4206('0xf'),auth[_0x4206('0x8')](),controller['addTeams']);router['post'](_0x4206('0x14'),auth[_0x4206('0x8')](),controller[_0x4206('0x15')]);router[_0x4206('0x16')]('/:id',auth[_0x4206('0x8')](),controller[_0x4206('0x17')]);router[_0x4206('0x18')](_0x4206('0x19'),auth[_0x4206('0x8')](),controller['destroy']);router[_0x4206('0x18')]('/:id/teams',auth[_0x4206('0x8')](),controller[_0x4206('0x1a')]);router[_0x4206('0x18')](_0x4206('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 05c15c9..1c05c83 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 _0xeb6d=['sequelize','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x14e0bc,_0x2e4cfa){var _0x517cac=function(_0x134a56){while(--_0x134a56){_0x14e0bc['push'](_0x14e0bc['shift']());}};_0x517cac(++_0x2e4cfa);}(_0xeb6d,0xd2));var _0xdeb6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xeb6d[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0xdeb6('0x0'));module['exports']={'name':{'type':Sequelize[_0xdeb6('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdeb6('0x1')]},'timeout':{'type':Sequelize[_0xdeb6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdeb6('0x3')](_0xdeb6('0x4'),'beepall',_0xdeb6('0x5'))}}; \ No newline at end of file +var _0x186d=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x186d,0x1e0));var _0xd186=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0x186d[_0xe27035];return _0x3745bc;};'use strict';var Sequelize=require('sequelize');module[_0xd186('0x0')]={'name':{'type':Sequelize[_0xd186('0x1')],'unique':_0xd186('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd186('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd186('0x4')](_0xd186('0x5'),_0xd186('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 8b73bdc..282dada 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 _0x0fce=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','findAll','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','./openchannelQueue.socket','register','sendStatus','end','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','destroy','get','OpenchannelQueues','UserProfileResource','then','error','stack','name','send','index','map','OpenchannelQueue','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','rows','show','rawAttributes','include','find','create'];(function(_0x3df976,_0x4979e1){var _0x4c763a=function(_0x259470){while(--_0x259470){_0x3df976['push'](_0x3df976['shift']());}};_0x4c763a(++_0x4979e1);}(_0x0fce,0x1eb));var _0xe0fc=function(_0x2ac704,_0x87df){_0x2ac704=_0x2ac704-0x0;var _0x541114=_0x0fce[_0x2ac704];return _0x541114;};'use strict';var emlformat=require(_0xe0fc('0x0'));var rimraf=require(_0xe0fc('0x1'));var zipdir=require(_0xe0fc('0x2'));var jsonpatch=require(_0xe0fc('0x3'));var rp=require(_0xe0fc('0x4'));var moment=require(_0xe0fc('0x5'));var BPromise=require(_0xe0fc('0x6'));var Mustache=require(_0xe0fc('0x7'));var util=require(_0xe0fc('0x8'));var path=require('path');var sox=require(_0xe0fc('0x9'));var csv=require(_0xe0fc('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(_0xe0fc('0xb'));var jsforce=require(_0xe0fc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe0fc('0xa'));var querystring=require(_0xe0fc('0xd'));var Papa=require(_0xe0fc('0xe'));var Redis=require(_0xe0fc('0xf'));var authService=require(_0xe0fc('0x10'));var qs=require(_0xe0fc('0x11'));var as=require(_0xe0fc('0x12'));var hardwareService=require(_0xe0fc('0x13'));var logger=require(_0xe0fc('0x14'))('api');var utils=require(_0xe0fc('0x15'));var config=require(_0xe0fc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe0fc('0x17')]=_['defaults'](config[_0xe0fc('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe0fc('0x18'))[_0xe0fc('0x19')](socket);function respondWithStatusCode(_0x5604f6,_0x324c87){_0x324c87=_0x324c87||0xcc;return function(_0x213dbf){if(_0x213dbf){return _0x5604f6[_0xe0fc('0x1a')](_0x324c87);}return _0x5604f6['status'](_0x324c87)[_0xe0fc('0x1b')]();};}function respondWithResult(_0x1e72ce,_0x463f48){_0x463f48=_0x463f48||0xc8;return function(_0x5d9265){if(_0x5d9265){return _0x1e72ce['status'](_0x463f48)['json'](_0x5d9265);}};}function respondWithFilteredResult(_0x5468d2,_0x5f23b4){return function(_0xd6587d){if(_0xd6587d){var _0x2af5eb=typeof _0x5f23b4[_0xe0fc('0x1c')]===_0xe0fc('0x1d')&&typeof _0x5f23b4['limit']==='undefined';var _0x36bc7d=_0xd6587d[_0xe0fc('0x1e')];var _0x212cae=_0x2af5eb?0x0:_0x5f23b4[_0xe0fc('0x1c')];var _0x128faf=_0x2af5eb?_0xd6587d['count']:_0x5f23b4['offset']+_0x5f23b4[_0xe0fc('0x1f')];var _0x52e921;if(_0x128faf>=_0x36bc7d){_0x128faf=_0x36bc7d;_0x52e921=0xc8;}else{_0x52e921=0xce;}_0x5468d2[_0xe0fc('0x20')](_0x52e921);return _0x5468d2['set'](_0xe0fc('0x21'),_0x212cae+'-'+_0x128faf+'/'+_0x36bc7d)['json'](_0xd6587d);}return null;};}function patchUpdates(_0x394946){return function(_0x37fb4d){try{jsonpatch[_0xe0fc('0x22')](_0x37fb4d,_0x394946,!![]);}catch(_0xcbebcf){return BPromise[_0xe0fc('0x23')](_0xcbebcf);}return _0x37fb4d[_0xe0fc('0x24')]();};}function saveUpdates(_0x3e88fd,_0x351c19){return function(_0x58de5c){if(_0x58de5c){return _0x58de5c[_0xe0fc('0x25')](_0x3e88fd)['then'](function(_0x3773fa){return _0x3773fa;});}return null;};}function removeEntity(_0x2d7118,_0x2fc21b){return function(_0x3fa0bf){if(_0x3fa0bf){return _0x3fa0bf[_0xe0fc('0x26')]()['then'](function(){var _0x285c18=_0x3fa0bf[_0xe0fc('0x27')]({'plain':!![]});var _0x4136c0=_0xe0fc('0x28');return db[_0xe0fc('0x29')][_0xe0fc('0x26')]({'where':{'type':_0x4136c0,'resourceId':_0x285c18['id']}})[_0xe0fc('0x2a')](function(){return _0x3fa0bf;});})[_0xe0fc('0x2a')](function(){_0x2d7118[_0xe0fc('0x20')](0xcc)[_0xe0fc('0x1b')]();});}};}function handleEntityNotFound(_0x2a085c,_0x1a6e3a){return function(_0x5dedd9){if(!_0x5dedd9){_0x2a085c[_0xe0fc('0x1a')](0x194);}return _0x5dedd9;};}function handleError(_0x81400,_0x14a3ea){_0x14a3ea=_0x14a3ea||0x1f4;return function(_0x5962fc){logger[_0xe0fc('0x2b')](_0x5962fc[_0xe0fc('0x2c')]);if(_0x5962fc[_0xe0fc('0x2d')]){delete _0x5962fc[_0xe0fc('0x2d')];}_0x81400['status'](_0x14a3ea)[_0xe0fc('0x2e')](_0x5962fc);};}exports[_0xe0fc('0x2f')]=function(_0x2a61b3,_0x521b8b){var _0x41ef06={},_0x4c94a2={},_0x58311={'count':0x0,'rows':[]};var _0x2bd671=_[_0xe0fc('0x30')](db[_0xe0fc('0x31')]['rawAttributes'],function(_0x86b096){return{'name':_0x86b096[_0xe0fc('0x32')],'type':_0x86b096[_0xe0fc('0x33')][_0xe0fc('0x34')]};});_0x4c94a2[_0xe0fc('0x35')]=_[_0xe0fc('0x30')](_0x2bd671,_0xe0fc('0x2d'));_0x4c94a2['query']=_[_0xe0fc('0x36')](_0x2a61b3['query']);_0x4c94a2[_0xe0fc('0x37')]=_[_0xe0fc('0x38')](_0x4c94a2[_0xe0fc('0x35')],_0x4c94a2['query']);_0x41ef06[_0xe0fc('0x39')]=_['intersection'](_0x4c94a2[_0xe0fc('0x35')],qs[_0xe0fc('0x3a')](_0x2a61b3[_0xe0fc('0x3b')][_0xe0fc('0x3a')]));_0x41ef06[_0xe0fc('0x39')]=_0x41ef06[_0xe0fc('0x39')][_0xe0fc('0x3c')]?_0x41ef06[_0xe0fc('0x39')]:_0x4c94a2[_0xe0fc('0x35')];if(!_0x2a61b3[_0xe0fc('0x3b')][_0xe0fc('0x3d')](_0xe0fc('0x3e'))){_0x41ef06[_0xe0fc('0x1f')]=qs[_0xe0fc('0x1f')](_0x2a61b3[_0xe0fc('0x3b')]['limit']);_0x41ef06[_0xe0fc('0x1c')]=qs[_0xe0fc('0x1c')](_0x2a61b3[_0xe0fc('0x3b')][_0xe0fc('0x1c')]);}_0x41ef06[_0xe0fc('0x3f')]=qs[_0xe0fc('0x40')](_0x2a61b3['query'][_0xe0fc('0x40')]);_0x41ef06['where']=qs[_0xe0fc('0x37')](_['pick'](_0x2a61b3[_0xe0fc('0x3b')],_0x4c94a2[_0xe0fc('0x37')]),_0x2bd671);if(_0x2a61b3[_0xe0fc('0x3b')][_0xe0fc('0x41')]){_0x41ef06['where']=_['merge'](_0x41ef06[_0xe0fc('0x42')],{'$or':_[_0xe0fc('0x30')](_0x2bd671,function(_0x1b2c3c){if(_0x1b2c3c['type']!==_0xe0fc('0x43')){var _0x1574e8={};_0x1574e8[_0x1b2c3c['name']]={'$like':'%'+_0x2a61b3['query'][_0xe0fc('0x41')]+'%'};return _0x1574e8;}})});}_0x41ef06=_[_0xe0fc('0x44')]({},_0x41ef06,_0x2a61b3[_0xe0fc('0x45')]);var _0x33bb20={'where':_0x41ef06[_0xe0fc('0x42')]};return db['OpenchannelQueue'][_0xe0fc('0x1e')](_0x33bb20)[_0xe0fc('0x2a')](function(_0x3f48c1){_0x58311[_0xe0fc('0x1e')]=_0x3f48c1;if(_0x2a61b3[_0xe0fc('0x3b')][_0xe0fc('0x46')]){_0x41ef06['include']=[{'all':!![]}];}return db[_0xe0fc('0x31')]['findAll'](_0x41ef06);})[_0xe0fc('0x2a')](function(_0x2c2a97){_0x58311[_0xe0fc('0x47')]=_0x2c2a97;return _0x58311;})[_0xe0fc('0x2a')](respondWithFilteredResult(_0x521b8b,_0x41ef06))['catch'](handleError(_0x521b8b,null));};exports[_0xe0fc('0x48')]=function(_0x28eb4f,_0x4c16b6){var _0x472cb5={'raw':!![],'where':{'id':_0x28eb4f['params']['id']}},_0x4d33de={};_0x4d33de['model']=_[_0xe0fc('0x36')](db[_0xe0fc('0x31')][_0xe0fc('0x49')]);_0x4d33de['query']=_[_0xe0fc('0x36')](_0x28eb4f[_0xe0fc('0x3b')]);_0x4d33de[_0xe0fc('0x37')]=_[_0xe0fc('0x38')](_0x4d33de[_0xe0fc('0x35')],_0x4d33de[_0xe0fc('0x3b')]);_0x472cb5[_0xe0fc('0x39')]=_[_0xe0fc('0x38')](_0x4d33de[_0xe0fc('0x35')],qs[_0xe0fc('0x3a')](_0x28eb4f[_0xe0fc('0x3b')]['fields']));_0x472cb5['attributes']=_0x472cb5[_0xe0fc('0x39')][_0xe0fc('0x3c')]?_0x472cb5[_0xe0fc('0x39')]:_0x4d33de['model'];if(_0x28eb4f[_0xe0fc('0x3b')][_0xe0fc('0x46')]){_0x472cb5[_0xe0fc('0x4a')]=[{'all':!![]}];}_0x472cb5=_[_0xe0fc('0x44')]({},_0x472cb5,_0x28eb4f[_0xe0fc('0x45')]);return db['OpenchannelQueue'][_0xe0fc('0x4b')](_0x472cb5)[_0xe0fc('0x2a')](handleEntityNotFound(_0x4c16b6,null))['then'](respondWithResult(_0x4c16b6,null))['catch'](handleError(_0x4c16b6,null));};exports[_0xe0fc('0x4c')]=function(_0x357ab3,_0x452eb4){return db['OpenchannelQueue'][_0xe0fc('0x4c')](_0x357ab3[_0xe0fc('0x4d')],{})[_0xe0fc('0x2a')](function(_0xfe8371){var _0x404328=_0x357ab3[_0xe0fc('0x4e')][_0xe0fc('0x27')]({'plain':!![]});if(!_0x404328)throw new Error(_0xe0fc('0x4f'));if(_0x404328['role']===_0xe0fc('0x4e')){var _0x3aacd1=_0xfe8371[_0xe0fc('0x27')]({'plain':!![]});var _0x5259f9='OpenchannelQueues';return db[_0xe0fc('0x50')][_0xe0fc('0x4b')]({'where':{'name':_0x5259f9,'userProfileId':_0x404328[_0xe0fc('0x51')]},'raw':!![]})[_0xe0fc('0x2a')](function(_0x38ca3c){if(_0x38ca3c&&_0x38ca3c[_0xe0fc('0x52')]===0x0){return db[_0xe0fc('0x29')][_0xe0fc('0x4c')]({'name':_0x3aacd1[_0xe0fc('0x2d')],'resourceId':_0x3aacd1['id'],'type':_0x38ca3c[_0xe0fc('0x2d')],'sectionId':_0x38ca3c['id']},{})[_0xe0fc('0x2a')](function(){return _0xfe8371;});}else{return _0xfe8371;}})[_0xe0fc('0x53')](function(_0x34c192){logger['error'](_0xe0fc('0x54'),_0x34c192);throw _0x34c192;});}return _0xfe8371;})[_0xe0fc('0x2a')](respondWithResult(_0x452eb4,0xc9))[_0xe0fc('0x53')](handleError(_0x452eb4,null));};exports[_0xe0fc('0x25')]=function(_0xc0c79a,_0x591f7){if(_0xc0c79a[_0xe0fc('0x4d')]['id']){delete _0xc0c79a[_0xe0fc('0x4d')]['id'];}return db[_0xe0fc('0x31')]['find']({'where':{'id':_0xc0c79a[_0xe0fc('0x55')]['id']}})['then'](handleEntityNotFound(_0x591f7,null))[_0xe0fc('0x2a')](saveUpdates(_0xc0c79a[_0xe0fc('0x4d')],null))[_0xe0fc('0x2a')](respondWithResult(_0x591f7,null))[_0xe0fc('0x53')](handleError(_0x591f7,null));};exports[_0xe0fc('0x26')]=function(_0x267a58,_0x1c069f){return db[_0xe0fc('0x31')]['find']({'where':{'id':_0x267a58[_0xe0fc('0x55')]['id']}})['then'](handleEntityNotFound(_0x1c069f,null))[_0xe0fc('0x2a')](removeEntity(_0x1c069f,null))[_0xe0fc('0x53')](handleError(_0x1c069f,null));};exports[_0xe0fc('0x56')]=function(_0x5d9e07,_0x36aaf7){return db['OpenchannelQueue'][_0xe0fc('0x56')]()['then'](respondWithResult(_0x36aaf7,null))[_0xe0fc('0x53')](handleError(_0x36aaf7,null));};exports[_0xe0fc('0x57')]=function(_0x1388c3,_0x1871fb,_0x5be493){var _0x5ac6eb={'raw':!![],'where':{}},_0x5051b2={},_0xfec497;return db[_0xe0fc('0x31')][_0xe0fc('0x58')]({'where':{'id':_0x1388c3[_0xe0fc('0x55')]['id']}})['then'](handleEntityNotFound(_0x1871fb,null))[_0xe0fc('0x2a')](function(_0x1e2a2b){if(_0x1e2a2b){_0xfec497=_0x1e2a2b[_0xe0fc('0x27')]({'plain':!![]});_0x5051b2[_0xe0fc('0x35')]=_[_0xe0fc('0x36')](db[_0xe0fc('0x59')][_0xe0fc('0x49')]);_0x5051b2[_0xe0fc('0x3b')]=_['keys'](_0x1388c3[_0xe0fc('0x3b')]);_0x5051b2[_0xe0fc('0x37')]=_[_0xe0fc('0x38')](_0x5051b2[_0xe0fc('0x35')],_0x5051b2[_0xe0fc('0x3b')]);_0x5ac6eb['attributes']=_[_0xe0fc('0x38')](_0x5051b2[_0xe0fc('0x35')],qs[_0xe0fc('0x3a')](_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x3a')]));_0x5ac6eb['attributes']=_0x5ac6eb[_0xe0fc('0x39')][_0xe0fc('0x3c')]?_0x5ac6eb[_0xe0fc('0x39')]:_0x5051b2[_0xe0fc('0x35')];if(!_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x3d')](_0xe0fc('0x3e'))){_0x5ac6eb[_0xe0fc('0x1f')]=qs[_0xe0fc('0x1f')](_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x1f')]);_0x5ac6eb[_0xe0fc('0x1c')]=qs['offset'](_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x1c')]);}_0x5ac6eb[_0xe0fc('0x3f')]=qs[_0xe0fc('0x40')](_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x40')]);_0x5ac6eb[_0xe0fc('0x42')]=qs['filters'](_[_0xe0fc('0x5a')](_0x1388c3['query'],_0x5051b2[_0xe0fc('0x37')]));_0x5ac6eb[_0xe0fc('0x42')][_0xe0fc('0x5b')]=_0x1e2a2b['id'];if(_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x41')]){_0x5ac6eb['where']=_[_0xe0fc('0x44')](_0x5ac6eb[_0xe0fc('0x42')],{'$or':_['map'](_0x5ac6eb[_0xe0fc('0x39')],function(_0xc92d57){var _0x3ba3a7={};_0x3ba3a7[_0xc92d57]={'$like':'%'+_0x1388c3[_0xe0fc('0x3b')][_0xe0fc('0x41')]+'%'};return _0x3ba3a7;})});}_0x5ac6eb=_[_0xe0fc('0x44')]({},_0x5ac6eb,_0x1388c3[_0xe0fc('0x45')]);return db[_0xe0fc('0x59')]['findAll'](_0x5ac6eb);}})['then'](function(_0x12afd2){if(_0x12afd2){return db[_0xe0fc('0x5c')][_0xe0fc('0x5d')]({'where':{'id':_[_0xe0fc('0x30')](_0x12afd2,_0xe0fc('0x5e')),'role':'agent'},'attributes':['id',_0xe0fc('0x2d'),_0xe0fc('0x5f'),'updatedAt',_0xe0fc('0x60')]});}})[_0xe0fc('0x2a')](function(_0x46ddcf){if(_0x46ddcf){return{'count':_0x46ddcf[_0xe0fc('0x1e')],'rows':_['map'](_0x46ddcf['rows'],function(_0x2ded4a){return{'membername':_0x2ded4a[_0xe0fc('0x2d')],'UserId':_0x2ded4a['id'],'queue_name':_0xfec497[_0xe0fc('0x2d')],'OpenchannelQueueId':_0xfec497['id'],'interface':util['format'](_0xe0fc('0x61'),_0xe0fc('0x62'),_0x2ded4a[_0xe0fc('0x2d')]),'penalty':0x0,'paused':_0x2ded4a[_0xe0fc('0x5f')],'createdAt':_0x2ded4a[_0xe0fc('0x60')],'updatedAt':_0x2ded4a[_0xe0fc('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1871fb,_0x5ac6eb))[_0xe0fc('0x53')](handleError(_0x1871fb,null));};exports['getTeams']=function(_0x561849,_0x283e05,_0x25bc43){var _0x2e9880={};var _0x86a095={};var _0x29c6f2;var _0x5be507;return db['OpenchannelQueue'][_0xe0fc('0x58')]({'where':{'id':_0x561849[_0xe0fc('0x55')]['id']}})[_0xe0fc('0x2a')](handleEntityNotFound(_0x283e05,null))[_0xe0fc('0x2a')](function(_0x1cf4f6){if(_0x1cf4f6){_0x29c6f2=_0x1cf4f6;_0x86a095['model']=_[_0xe0fc('0x36')](db['Team'][_0xe0fc('0x49')]);_0x86a095[_0xe0fc('0x3b')]=_[_0xe0fc('0x36')](_0x561849[_0xe0fc('0x3b')]);_0x86a095['filters']=_[_0xe0fc('0x38')](_0x86a095[_0xe0fc('0x35')],_0x86a095['query']);_0x2e9880[_0xe0fc('0x39')]=_['intersection'](_0x86a095[_0xe0fc('0x35')],qs[_0xe0fc('0x3a')](_0x561849[_0xe0fc('0x3b')][_0xe0fc('0x3a')]));_0x2e9880[_0xe0fc('0x39')]=_0x2e9880[_0xe0fc('0x39')]['length']?_0x2e9880['attributes']:_0x86a095[_0xe0fc('0x35')];_0x2e9880[_0xe0fc('0x3f')]=qs[_0xe0fc('0x40')](_0x561849[_0xe0fc('0x3b')][_0xe0fc('0x40')]);_0x2e9880[_0xe0fc('0x42')]=qs[_0xe0fc('0x37')](_[_0xe0fc('0x5a')](_0x561849[_0xe0fc('0x3b')],_0x86a095[_0xe0fc('0x37')]));if(_0x561849[_0xe0fc('0x3b')][_0xe0fc('0x41')]){_0x2e9880[_0xe0fc('0x42')]=_[_0xe0fc('0x44')](_0x2e9880[_0xe0fc('0x42')],{'$or':_[_0xe0fc('0x30')](_0x2e9880[_0xe0fc('0x39')],function(_0x1fcd34){var _0x1bcc41={};_0x1bcc41[_0x1fcd34]={'$like':'%'+_0x561849[_0xe0fc('0x3b')][_0xe0fc('0x41')]+'%'};return _0x1bcc41;})});}_0x2e9880=_[_0xe0fc('0x44')]({},_0x2e9880,_0x561849['options']);return _0x29c6f2[_0xe0fc('0x64')](_0x2e9880);}})['then'](function(_0x2db544){if(_0x2db544){_0x5be507=_0x2db544['length'];if(!_0x561849[_0xe0fc('0x3b')]['hasOwnProperty'](_0xe0fc('0x3e'))){_0x2e9880['limit']=qs[_0xe0fc('0x1f')](_0x561849[_0xe0fc('0x3b')][_0xe0fc('0x1f')]);_0x2e9880['offset']=qs[_0xe0fc('0x1c')](_0x561849[_0xe0fc('0x3b')][_0xe0fc('0x1c')]);}return _0x29c6f2['getTeams'](_0x2e9880);}})[_0xe0fc('0x2a')](function(_0x121aa2){if(_0x121aa2){return _0x121aa2?{'count':_0x5be507,'rows':_0x121aa2}:null;}})[_0xe0fc('0x2a')](respondWithResult(_0x283e05,null))[_0xe0fc('0x53')](handleError(_0x283e05,null));};exports[_0xe0fc('0x65')]=function(_0x5877c1,_0x19884d,_0x740182){var _0x4ebe12=_0x5877c1[_0xe0fc('0x4d')][_0xe0fc('0x66')];return db[_0xe0fc('0x67')]['findAll']({'where':{'id':_0x4ebe12},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0fc('0x68'),'attributes':['id',_0xe0fc('0x2d'),_0xe0fc('0x69'),_0xe0fc('0x6a'),_0xe0fc('0x6b')],'raw':!![]}]})[_0xe0fc('0x2a')](function(_0x376142){if(_0x376142){var _0x312821=_[_0xe0fc('0x6c')](_0x376142,function(_0x5ca4c4){var _0x4c690f=_0x5ca4c4[_0xe0fc('0x27')]({'plain':!![]});return _0x4c690f[_0xe0fc('0x68')];});return db[_0xe0fc('0x31')]['find']({'where':{'id':_0x5877c1[_0xe0fc('0x55')]['id']}})['then'](function(_0x5f370f){return db[_0xe0fc('0x6d')][_0xe0fc('0x6e')](function(_0x14567d){return _0x5f370f[_0xe0fc('0x65')](_0x4ebe12,{'transaction':_0x14567d})[_0xe0fc('0x2a')](function(){return BPromise[_0xe0fc('0x6f')](_0x312821,function(_0x3bcbd5){return db[_0xe0fc('0x59')][_0xe0fc('0x70')]({'where':{'UserId':_0x3bcbd5['id'],'OpenchannelQueueId':_0x5877c1[_0xe0fc('0x55')]['id']},'transaction':_0x14567d});});})[_0xe0fc('0x2a')](function(){_0x312821['forEach'](function(_0x4e0886){socket[_0xe0fc('0x71')](_0xe0fc('0x72'),{'UserId':_0x4e0886['id'],'OpenchannelQueueId':_0x5f370f['id']});});});});});}})[_0xe0fc('0x2a')](respondWithStatusCode(_0x19884d,null))[_0xe0fc('0x53')](handleError(_0x19884d,null));};exports[_0xe0fc('0x73')]=function(_0xd44774,_0x4eb730,_0x564bd5){return db[_0xe0fc('0x67')][_0xe0fc('0x74')]({'where':{'id':_0xd44774[_0xe0fc('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe0fc('0x5c')],'as':_0xe0fc('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4eb730,null))[_0xe0fc('0x2a')](function(_0x4f994d){var _0x257cd1=_[_0xe0fc('0x30')](_0x4f994d,'id');var _0x4ca621=[];var _0x35f5de=[];var _0x12ef93=squel[_0xe0fc('0x75')]();_0x12ef93[_0xe0fc('0x76')](_0xe0fc('0x77'))[_0xe0fc('0x78')](_0xe0fc('0x79'),'tq')['join'](_0xe0fc('0x7a'),'ut',_0xe0fc('0x7b'))[_0xe0fc('0x42')](_0xe0fc('0x7c'),_0xd44774[_0xe0fc('0x55')]['id']);for(var _0x4cafc0=0x0;_0x4cafc0<_0x4f994d[_0xe0fc('0x3c')];_0x4cafc0+=0x1){let _0x225cc0=_0x4f994d[_0x4cafc0];for(var _0x130a18=0x0;_0x130a18<_0x225cc0[_0xe0fc('0x68')][_0xe0fc('0x3c')];_0x130a18+=0x1){let _0x315cf4=_0x225cc0['Agents'][_0x130a18];var _0x13da40=_0x12ef93[_0xe0fc('0x7d')]();_0x13da40[_0xe0fc('0x42')](_0xe0fc('0x7e'),_0x315cf4['id']);_0x35f5de[_0xe0fc('0x7f')](db[_0xe0fc('0x6d')]['query'](_0x13da40[_0xe0fc('0x80')](),{'type':db[_0xe0fc('0x6d')]['QueryTypes'][_0xe0fc('0x81')]})[_0xe0fc('0x2a')](function(_0x54817d){if(_0x54817d[_0xe0fc('0x3c')]===0x1){return _0x315cf4['id'];}else{var _0x2275b5=_[_0xe0fc('0x82')](_[_0xe0fc('0x30')](_0x54817d,_0xe0fc('0x83')),function(_0x1f19cb){return _['includes'](_0x257cd1,_0x1f19cb);});if(_0x2275b5){return _0x315cf4['id'];}}}));}}return BPromise[_0xe0fc('0x84')](_0x35f5de)['then'](function(_0x2ee68b){_0x4ca621=_(_0x4ca621)[_0xe0fc('0x85')](_0x2ee68b)['compact']()['value']();return db[_0xe0fc('0x31')][_0xe0fc('0x4b')]({'where':{'id':_0xd44774['params']['id']}})[_0xe0fc('0x2a')](function(_0x52de98){return db[_0xe0fc('0x6d')][_0xe0fc('0x6e')](function(_0x2b94b8){return _0x52de98[_0xe0fc('0x73')](_0xd44774[_0xe0fc('0x3b')]['ids'],{'transaction':_0x2b94b8})['then'](function(){if(!_['isEmpty'](_0x4ca621)){return _0x52de98['removeAgents'](_0x4ca621,{'transaction':_0x2b94b8});}})[_0xe0fc('0x2a')](function(){_0x4ca621[_0xe0fc('0x86')](function(_0x116b53){socket[_0xe0fc('0x71')](_0xe0fc('0x87'),{'UserId':_0x116b53,'OpenchannelQueueId':_0x52de98['id']});});});});});});})[_0xe0fc('0x2a')](respondWithStatusCode(_0x4eb730,null))['catch'](handleError(_0x4eb730,null));};exports[_0xe0fc('0x88')]=function(_0x565b0c,_0x26b1c8,_0x2ffee0){return db[_0xe0fc('0x31')][_0xe0fc('0x4b')]({'where':{'id':_0x565b0c['params']['id']}})[_0xe0fc('0x2a')](handleEntityNotFound(_0x26b1c8,null))[_0xe0fc('0x2a')](function(_0x51b5c9){if(_0x51b5c9){return _0x51b5c9[_0xe0fc('0x88')](_0x565b0c[_0xe0fc('0x4d')][_0xe0fc('0x66')],_[_0xe0fc('0x89')](_0x565b0c[_0xe0fc('0x4d')],[_0xe0fc('0x66'),'id'])||{})[_0xe0fc('0x8a')](function(_0x4e79eb){for(var _0x4294e5=0x0;_0x4294e5<_0x565b0c[_0xe0fc('0x4d')]['ids'][_0xe0fc('0x3c')];_0x4294e5+=0x1){socket[_0xe0fc('0x71')](_0xe0fc('0x72'),{'UserId':Number(_0x565b0c['body']['ids'][_0x4294e5]),'OpenchannelQueueId':Number(_0x565b0c[_0xe0fc('0x55')]['id'])});}return _0x4e79eb;});}})[_0xe0fc('0x2a')](respondWithResult(_0x26b1c8,null))['catch'](handleError(_0x26b1c8,null));};exports[_0xe0fc('0x8b')]=function(_0x18ee0a,_0x2fa5df,_0x5c7b86){return db['OpenchannelQueue']['find']({'where':{'id':_0x18ee0a['params']['id']}})[_0xe0fc('0x2a')](handleEntityNotFound(_0x2fa5df,null))[_0xe0fc('0x2a')](function(_0x57eb6e){if(_0x57eb6e){return _0x57eb6e[_0xe0fc('0x8b')](_0x18ee0a[_0xe0fc('0x3b')]['ids'])[_0xe0fc('0x2a')](function(){if(_[_0xe0fc('0x8c')](_0x18ee0a[_0xe0fc('0x3b')][_0xe0fc('0x66')])){for(var _0x1510b6=0x0;_0x1510b6<_0x18ee0a[_0xe0fc('0x3b')]['ids'][_0xe0fc('0x3c')];_0x1510b6+=0x1){socket['emit'](_0xe0fc('0x87'),{'UserId':Number(_0x18ee0a['query'][_0xe0fc('0x66')][_0x1510b6]),'OpenchannelQueueId':Number(_0x18ee0a[_0xe0fc('0x55')]['id'])});}}else{socket[_0xe0fc('0x71')](_0xe0fc('0x87'),{'UserId':Number(_0x18ee0a[_0xe0fc('0x3b')][_0xe0fc('0x66')]),'OpenchannelQueueId':Number(_0x18ee0a[_0xe0fc('0x55')]['id'])});}});}})[_0xe0fc('0x2a')](respondWithStatusCode(_0x2fa5df,null))[_0xe0fc('0x53')](handleError(_0x2fa5df,null));};exports[_0xe0fc('0x8d')]=function(_0x586bcb,_0x334a9a,_0x5012ea){var _0x56a186={};var _0x44bef1={};var _0x1ad40c;var _0x3859ef;return db['OpenchannelQueue'][_0xe0fc('0x58')]({'where':{'id':_0x586bcb[_0xe0fc('0x55')]['id']}})[_0xe0fc('0x2a')](handleEntityNotFound(_0x334a9a,null))[_0xe0fc('0x2a')](function(_0x187871){if(_0x187871){_0x1ad40c=_0x187871;_0x44bef1[_0xe0fc('0x35')]=_[_0xe0fc('0x36')](db[_0xe0fc('0x5c')]['rawAttributes']);_0x44bef1[_0xe0fc('0x3b')]=_['keys'](_0x586bcb[_0xe0fc('0x3b')]);_0x44bef1[_0xe0fc('0x37')]=_['intersection'](_0x44bef1[_0xe0fc('0x35')],_0x44bef1[_0xe0fc('0x3b')]);_0x56a186[_0xe0fc('0x39')]=_[_0xe0fc('0x38')](_0x44bef1[_0xe0fc('0x35')],qs[_0xe0fc('0x3a')](_0x586bcb[_0xe0fc('0x3b')][_0xe0fc('0x3a')]));_0x56a186[_0xe0fc('0x39')]=_0x56a186[_0xe0fc('0x39')][_0xe0fc('0x3c')]?_0x56a186['attributes']:_0x44bef1[_0xe0fc('0x35')];_0x56a186[_0xe0fc('0x3f')]=qs['sort'](_0x586bcb[_0xe0fc('0x3b')][_0xe0fc('0x40')]);_0x56a186['where']=qs['filters'](_[_0xe0fc('0x5a')](_0x586bcb['query'],_0x44bef1[_0xe0fc('0x37')]));if(_0x586bcb['query'][_0xe0fc('0x41')]){_0x56a186['where']=_[_0xe0fc('0x44')](_0x56a186[_0xe0fc('0x42')],{'$or':_['map'](_0x56a186['attributes'],function(_0x47e3a3){var _0x15a0a2={};_0x15a0a2[_0x47e3a3]={'$like':'%'+_0x586bcb[_0xe0fc('0x3b')][_0xe0fc('0x41')]+'%'};return _0x15a0a2;})});}_0x56a186=_[_0xe0fc('0x44')]({},_0x56a186,_0x586bcb['options']);return _0x1ad40c[_0xe0fc('0x8d')](_0x56a186);}})[_0xe0fc('0x2a')](function(_0x587ea3){if(_0x587ea3){_0x3859ef=_0x587ea3[_0xe0fc('0x3c')];if(!_0x586bcb[_0xe0fc('0x3b')][_0xe0fc('0x3d')](_0xe0fc('0x3e'))){_0x56a186['limit']=qs['limit'](_0x586bcb[_0xe0fc('0x3b')][_0xe0fc('0x1f')]);_0x56a186[_0xe0fc('0x1c')]=qs[_0xe0fc('0x1c')](_0x586bcb[_0xe0fc('0x3b')][_0xe0fc('0x1c')]);}return _0x1ad40c[_0xe0fc('0x8d')](_0x56a186);}})[_0xe0fc('0x2a')](function(_0x5494d2){if(_0x5494d2){return _0x5494d2?{'count':_0x3859ef,'rows':_0x5494d2}:null;}})[_0xe0fc('0x2a')](respondWithResult(_0x334a9a,null))[_0xe0fc('0x53')](handleError(_0x334a9a,null));}; \ No newline at end of file +var _0xe07f=['includeAll','findAll','rows','catch','show','params','keys','include','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','getMembers','UserOpenchannelQueue','rawAttributes','order','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','User','Agents','online','voicePause','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','sendStatus','error','stack','name','map','OpenchannelQueue','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x585d3c,_0x468871){var _0x23d7ac=function(_0x24ec94){while(--_0x24ec94){_0x585d3c['push'](_0x585d3c['shift']());}};_0x23d7ac(++_0x468871);}(_0xe07f,0x162));var _0xfe07=function(_0x5f4c6c,_0x1c2209){_0x5f4c6c=_0x5f4c6c-0x0;var _0x5a7bfe=_0xe07f[_0x5f4c6c];return _0x5a7bfe;};'use strict';var emlformat=require(_0xfe07('0x0'));var rimraf=require(_0xfe07('0x1'));var zipdir=require(_0xfe07('0x2'));var jsonpatch=require(_0xfe07('0x3'));var rp=require('request-promise');var moment=require(_0xfe07('0x4'));var BPromise=require(_0xfe07('0x5'));var Mustache=require(_0xfe07('0x6'));var util=require('util');var path=require(_0xfe07('0x7'));var sox=require(_0xfe07('0x8'));var csv=require(_0xfe07('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe07('0xa'));var _=require(_0xfe07('0xb'));var squel=require(_0xfe07('0xc'));var crypto=require(_0xfe07('0xd'));var jsforce=require(_0xfe07('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfe07('0x9'));var querystring=require('querystring');var Papa=require(_0xfe07('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfe07('0x10'));var as=require(_0xfe07('0x11'));var hardwareService=require(_0xfe07('0x12'));var logger=require('../../config/logger')(_0xfe07('0x13'));var utils=require(_0xfe07('0x14'));var config=require(_0xfe07('0x15'));var licenseUtil=require(_0xfe07('0x16'));var db=require(_0xfe07('0x17'))['db'];config[_0xfe07('0x18')]=_[_0xfe07('0x19')](config[_0xfe07('0x18')],{'host':_0xfe07('0x1a'),'port':0x18eb});var socket=require(_0xfe07('0x1b'))(new Redis(config[_0xfe07('0x18')]));require(_0xfe07('0x1c'))['register'](socket);function respondWithStatusCode(_0x4ca470,_0x2fb346){_0x2fb346=_0x2fb346||0xcc;return function(_0x13c273){if(_0x13c273){return _0x4ca470['sendStatus'](_0x2fb346);}return _0x4ca470[_0xfe07('0x1d')](_0x2fb346)['end']();};}function respondWithResult(_0x3ea193,_0x19e367){_0x19e367=_0x19e367||0xc8;return function(_0x502d09){if(_0x502d09){return _0x3ea193[_0xfe07('0x1d')](_0x19e367)[_0xfe07('0x1e')](_0x502d09);}};}function respondWithFilteredResult(_0x59692b,_0x140baf){return function(_0xc6bba6){if(_0xc6bba6){var _0x3c1575=typeof _0x140baf[_0xfe07('0x1f')]===_0xfe07('0x20')&&typeof _0x140baf[_0xfe07('0x21')]===_0xfe07('0x20');var _0x4feac5=_0xc6bba6[_0xfe07('0x22')];var _0x12ff31=_0x3c1575?0x0:_0x140baf[_0xfe07('0x1f')];var _0x44cc46=_0x3c1575?_0xc6bba6[_0xfe07('0x22')]:_0x140baf[_0xfe07('0x1f')]+_0x140baf[_0xfe07('0x21')];var _0x5598ee;if(_0x44cc46>=_0x4feac5){_0x44cc46=_0x4feac5;_0x5598ee=0xc8;}else{_0x5598ee=0xce;}_0x59692b['status'](_0x5598ee);return _0x59692b[_0xfe07('0x23')](_0xfe07('0x24'),_0x12ff31+'-'+_0x44cc46+'/'+_0x4feac5)[_0xfe07('0x1e')](_0xc6bba6);}return null;};}function patchUpdates(_0x3fe8a3){return function(_0x5977d8){try{jsonpatch[_0xfe07('0x25')](_0x5977d8,_0x3fe8a3,!![]);}catch(_0x126b36){return BPromise[_0xfe07('0x26')](_0x126b36);}return _0x5977d8[_0xfe07('0x27')]();};}function saveUpdates(_0x58e1ea,_0x7ee8dd){return function(_0x36b4b3){if(_0x36b4b3){return _0x36b4b3[_0xfe07('0x28')](_0x58e1ea)[_0xfe07('0x29')](function(_0xc89cb9){return _0xc89cb9;});}return null;};}function removeEntity(_0x3a5a94,_0xe14114){return function(_0x2bdf19){if(_0x2bdf19){return _0x2bdf19[_0xfe07('0x2a')]()[_0xfe07('0x29')](function(){var _0x51d975=_0x2bdf19[_0xfe07('0x2b')]({'plain':!![]});var _0x2ca4e9=_0xfe07('0x2c');return db[_0xfe07('0x2d')][_0xfe07('0x2a')]({'where':{'type':_0x2ca4e9,'resourceId':_0x51d975['id']}})[_0xfe07('0x29')](function(){return _0x2bdf19;});})['then'](function(){_0x3a5a94[_0xfe07('0x1d')](0xcc)[_0xfe07('0x2e')]();});}};}function handleEntityNotFound(_0xf45b10,_0xd5289e){return function(_0xeaf53e){if(!_0xeaf53e){_0xf45b10[_0xfe07('0x2f')](0x194);}return _0xeaf53e;};}function handleError(_0x4f0330,_0x16af80){_0x16af80=_0x16af80||0x1f4;return function(_0x46907a){logger[_0xfe07('0x30')](_0x46907a[_0xfe07('0x31')]);if(_0x46907a['name']){delete _0x46907a[_0xfe07('0x32')];}_0x4f0330[_0xfe07('0x1d')](_0x16af80)['send'](_0x46907a);};}exports['index']=function(_0x38e624,_0x24d856){var _0x5986a7={},_0x55351a={},_0x29a779={'count':0x0,'rows':[]};var _0x222354=_[_0xfe07('0x33')](db[_0xfe07('0x34')]['rawAttributes'],function(_0x3b17cc){return{'name':_0x3b17cc[_0xfe07('0x35')],'type':_0x3b17cc[_0xfe07('0x36')][_0xfe07('0x37')]};});_0x55351a[_0xfe07('0x38')]=_[_0xfe07('0x33')](_0x222354,_0xfe07('0x32'));_0x55351a[_0xfe07('0x39')]=_['keys'](_0x38e624[_0xfe07('0x39')]);_0x55351a[_0xfe07('0x3a')]=_[_0xfe07('0x3b')](_0x55351a[_0xfe07('0x38')],_0x55351a[_0xfe07('0x39')]);_0x5986a7[_0xfe07('0x3c')]=_[_0xfe07('0x3b')](_0x55351a[_0xfe07('0x38')],qs['fields'](_0x38e624['query'][_0xfe07('0x3d')]));_0x5986a7['attributes']=_0x5986a7[_0xfe07('0x3c')][_0xfe07('0x3e')]?_0x5986a7[_0xfe07('0x3c')]:_0x55351a['model'];if(!_0x38e624['query'][_0xfe07('0x3f')](_0xfe07('0x40'))){_0x5986a7[_0xfe07('0x21')]=qs[_0xfe07('0x21')](_0x38e624[_0xfe07('0x39')][_0xfe07('0x21')]);_0x5986a7['offset']=qs[_0xfe07('0x1f')](_0x38e624['query'][_0xfe07('0x1f')]);}_0x5986a7['order']=qs[_0xfe07('0x41')](_0x38e624[_0xfe07('0x39')]['sort']);_0x5986a7[_0xfe07('0x42')]=qs['filters'](_[_0xfe07('0x43')](_0x38e624[_0xfe07('0x39')],_0x55351a[_0xfe07('0x3a')]),_0x222354);if(_0x38e624['query'][_0xfe07('0x44')]){_0x5986a7[_0xfe07('0x42')]=_[_0xfe07('0x45')](_0x5986a7[_0xfe07('0x42')],{'$or':_[_0xfe07('0x33')](_0x222354,function(_0x51805a){if(_0x51805a[_0xfe07('0x36')]!==_0xfe07('0x46')){var _0x4d0007={};_0x4d0007[_0x51805a[_0xfe07('0x32')]]={'$like':'%'+_0x38e624['query'][_0xfe07('0x44')]+'%'};return _0x4d0007;}})});}_0x5986a7=_[_0xfe07('0x45')]({},_0x5986a7,_0x38e624[_0xfe07('0x47')]);var _0x18983b={'where':_0x5986a7['where']};return db['OpenchannelQueue'][_0xfe07('0x22')](_0x18983b)['then'](function(_0x88c31f){_0x29a779['count']=_0x88c31f;if(_0x38e624['query'][_0xfe07('0x48')]){_0x5986a7['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0xfe07('0x49')](_0x5986a7);})[_0xfe07('0x29')](function(_0x5ca0ef){_0x29a779[_0xfe07('0x4a')]=_0x5ca0ef;return _0x29a779;})['then'](respondWithFilteredResult(_0x24d856,_0x5986a7))[_0xfe07('0x4b')](handleError(_0x24d856,null));};exports[_0xfe07('0x4c')]=function(_0xc2fec4,_0x4a6689){var _0xe6f7e5={'raw':!![],'where':{'id':_0xc2fec4[_0xfe07('0x4d')]['id']}},_0x5dca36={};_0x5dca36[_0xfe07('0x38')]=_[_0xfe07('0x4e')](db[_0xfe07('0x34')]['rawAttributes']);_0x5dca36[_0xfe07('0x39')]=_['keys'](_0xc2fec4[_0xfe07('0x39')]);_0x5dca36[_0xfe07('0x3a')]=_[_0xfe07('0x3b')](_0x5dca36[_0xfe07('0x38')],_0x5dca36[_0xfe07('0x39')]);_0xe6f7e5[_0xfe07('0x3c')]=_['intersection'](_0x5dca36[_0xfe07('0x38')],qs['fields'](_0xc2fec4[_0xfe07('0x39')][_0xfe07('0x3d')]));_0xe6f7e5[_0xfe07('0x3c')]=_0xe6f7e5[_0xfe07('0x3c')][_0xfe07('0x3e')]?_0xe6f7e5['attributes']:_0x5dca36['model'];if(_0xc2fec4[_0xfe07('0x39')][_0xfe07('0x48')]){_0xe6f7e5[_0xfe07('0x4f')]=[{'all':!![]}];}_0xe6f7e5=_[_0xfe07('0x45')]({},_0xe6f7e5,_0xc2fec4[_0xfe07('0x47')]);return db['OpenchannelQueue'][_0xfe07('0x50')](_0xe6f7e5)[_0xfe07('0x29')](handleEntityNotFound(_0x4a6689,null))[_0xfe07('0x29')](respondWithResult(_0x4a6689,null))[_0xfe07('0x4b')](handleError(_0x4a6689,null));};exports[_0xfe07('0x51')]=function(_0x4f3796,_0x4154d1){return db[_0xfe07('0x34')]['create'](_0x4f3796[_0xfe07('0x52')],{})['then'](function(_0x340b3a){var _0x9db6c0=_0x4f3796[_0xfe07('0x53')]['get']({'plain':!![]});if(!_0x9db6c0)throw new Error(_0xfe07('0x54'));if(_0x9db6c0[_0xfe07('0x55')]===_0xfe07('0x53')){var _0x2098e8=_0x340b3a[_0xfe07('0x2b')]({'plain':!![]});var _0x59e9db=_0xfe07('0x2c');return db[_0xfe07('0x56')][_0xfe07('0x50')]({'where':{'name':_0x59e9db,'userProfileId':_0x9db6c0[_0xfe07('0x57')]},'raw':!![]})[_0xfe07('0x29')](function(_0x7f4a08){if(_0x7f4a08&&_0x7f4a08[_0xfe07('0x58')]===0x0){return db['UserProfileResource'][_0xfe07('0x51')]({'name':_0x2098e8[_0xfe07('0x32')],'resourceId':_0x2098e8['id'],'type':_0x7f4a08[_0xfe07('0x32')],'sectionId':_0x7f4a08['id']},{})[_0xfe07('0x29')](function(){return _0x340b3a;});}else{return _0x340b3a;}})[_0xfe07('0x4b')](function(_0x339f48){logger[_0xfe07('0x30')](_0xfe07('0x59'),_0x339f48);throw _0x339f48;});}return _0x340b3a;})[_0xfe07('0x29')](respondWithResult(_0x4154d1,0xc9))[_0xfe07('0x4b')](handleError(_0x4154d1,null));};exports[_0xfe07('0x28')]=function(_0x5f0c91,_0x3cb128){if(_0x5f0c91[_0xfe07('0x52')]['id']){delete _0x5f0c91[_0xfe07('0x52')]['id'];}return db['OpenchannelQueue'][_0xfe07('0x50')]({'where':{'id':_0x5f0c91['params']['id']}})[_0xfe07('0x29')](handleEntityNotFound(_0x3cb128,null))[_0xfe07('0x29')](saveUpdates(_0x5f0c91[_0xfe07('0x52')],null))[_0xfe07('0x29')](respondWithResult(_0x3cb128,null))[_0xfe07('0x4b')](handleError(_0x3cb128,null));};exports['destroy']=function(_0x6bb938,_0x5789be){return db[_0xfe07('0x34')][_0xfe07('0x50')]({'where':{'id':_0x6bb938['params']['id']}})[_0xfe07('0x29')](handleEntityNotFound(_0x5789be,null))[_0xfe07('0x29')](removeEntity(_0x5789be,null))[_0xfe07('0x4b')](handleError(_0x5789be,null));};exports['describe']=function(_0x1b1319,_0x81f372){return db[_0xfe07('0x34')]['describe']()[_0xfe07('0x29')](respondWithResult(_0x81f372,null))['catch'](handleError(_0x81f372,null));};exports[_0xfe07('0x5a')]=function(_0x237b6c,_0x5f8b95,_0x2e65e6){var _0x5b0234={'raw':!![],'where':{}},_0x1fa468={},_0x403506;return db[_0xfe07('0x34')]['findOne']({'where':{'id':_0x237b6c[_0xfe07('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5f8b95,null))[_0xfe07('0x29')](function(_0x55b39d){if(_0x55b39d){_0x403506=_0x55b39d['get']({'plain':!![]});_0x1fa468['model']=_['keys'](db[_0xfe07('0x5b')][_0xfe07('0x5c')]);_0x1fa468['query']=_[_0xfe07('0x4e')](_0x237b6c['query']);_0x1fa468['filters']=_[_0xfe07('0x3b')](_0x1fa468[_0xfe07('0x38')],_0x1fa468[_0xfe07('0x39')]);_0x5b0234[_0xfe07('0x3c')]=_[_0xfe07('0x3b')](_0x1fa468[_0xfe07('0x38')],qs[_0xfe07('0x3d')](_0x237b6c[_0xfe07('0x39')]['fields']));_0x5b0234[_0xfe07('0x3c')]=_0x5b0234[_0xfe07('0x3c')][_0xfe07('0x3e')]?_0x5b0234[_0xfe07('0x3c')]:_0x1fa468[_0xfe07('0x38')];if(!_0x237b6c[_0xfe07('0x39')][_0xfe07('0x3f')]('nolimit')){_0x5b0234[_0xfe07('0x21')]=qs[_0xfe07('0x21')](_0x237b6c['query']['limit']);_0x5b0234[_0xfe07('0x1f')]=qs['offset'](_0x237b6c['query'][_0xfe07('0x1f')]);}_0x5b0234[_0xfe07('0x5d')]=qs[_0xfe07('0x41')](_0x237b6c[_0xfe07('0x39')][_0xfe07('0x41')]);_0x5b0234[_0xfe07('0x42')]=qs[_0xfe07('0x3a')](_[_0xfe07('0x43')](_0x237b6c[_0xfe07('0x39')],_0x1fa468['filters']));_0x5b0234['where']['OpenchannelQueueId']=_0x55b39d['id'];if(_0x237b6c['query'][_0xfe07('0x44')]){_0x5b0234['where']=_[_0xfe07('0x45')](_0x5b0234[_0xfe07('0x42')],{'$or':_[_0xfe07('0x33')](_0x5b0234['attributes'],function(_0x1b17a6){var _0x20ab8f={};_0x20ab8f[_0x1b17a6]={'$like':'%'+_0x237b6c[_0xfe07('0x39')][_0xfe07('0x44')]+'%'};return _0x20ab8f;})});}_0x5b0234=_[_0xfe07('0x45')]({},_0x5b0234,_0x237b6c[_0xfe07('0x47')]);return db[_0xfe07('0x5b')][_0xfe07('0x49')](_0x5b0234);}})[_0xfe07('0x29')](function(_0x46f6e1){if(_0x46f6e1){return db['User'][_0xfe07('0x5e')]({'where':{'id':_['map'](_0x46f6e1,_0xfe07('0x5f')),'role':_0xfe07('0x60')},'attributes':['id',_0xfe07('0x32'),_0xfe07('0x61'),_0xfe07('0x62'),_0xfe07('0x63')]});}})[_0xfe07('0x29')](function(_0x5d4a47){if(_0x5d4a47){return{'count':_0x5d4a47[_0xfe07('0x22')],'rows':_['map'](_0x5d4a47[_0xfe07('0x4a')],function(_0x357c94){return{'membername':_0x357c94['name'],'UserId':_0x357c94['id'],'queue_name':_0x403506[_0xfe07('0x32')],'OpenchannelQueueId':_0x403506['id'],'interface':util[_0xfe07('0x64')](_0xfe07('0x65'),'SIP',_0x357c94['name']),'penalty':0x0,'paused':_0x357c94['openchannelPause'],'createdAt':_0x357c94[_0xfe07('0x63')],'updatedAt':_0x357c94['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xfe07('0x29')](respondWithFilteredResult(_0x5f8b95,_0x5b0234))[_0xfe07('0x4b')](handleError(_0x5f8b95,null));};exports['getTeams']=function(_0x3c2cbc,_0x1e5c83,_0x261003){var _0x16a265={};var _0x2ec4c6={};var _0x5b2440;var _0x27f067;return db[_0xfe07('0x34')]['findOne']({'where':{'id':_0x3c2cbc[_0xfe07('0x4d')]['id']}})[_0xfe07('0x29')](handleEntityNotFound(_0x1e5c83,null))[_0xfe07('0x29')](function(_0x518333){if(_0x518333){_0x5b2440=_0x518333;_0x2ec4c6[_0xfe07('0x38')]=_[_0xfe07('0x4e')](db['Team'][_0xfe07('0x5c')]);_0x2ec4c6[_0xfe07('0x39')]=_[_0xfe07('0x4e')](_0x3c2cbc['query']);_0x2ec4c6['filters']=_[_0xfe07('0x3b')](_0x2ec4c6[_0xfe07('0x38')],_0x2ec4c6[_0xfe07('0x39')]);_0x16a265[_0xfe07('0x3c')]=_[_0xfe07('0x3b')](_0x2ec4c6['model'],qs['fields'](_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x3d')]));_0x16a265['attributes']=_0x16a265[_0xfe07('0x3c')]['length']?_0x16a265[_0xfe07('0x3c')]:_0x2ec4c6['model'];_0x16a265[_0xfe07('0x5d')]=qs[_0xfe07('0x41')](_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x41')]);_0x16a265['where']=qs[_0xfe07('0x3a')](_[_0xfe07('0x43')](_0x3c2cbc[_0xfe07('0x39')],_0x2ec4c6['filters']));if(_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x44')]){_0x16a265['where']=_['merge'](_0x16a265[_0xfe07('0x42')],{'$or':_['map'](_0x16a265[_0xfe07('0x3c')],function(_0x3ce7c4){var _0x5b61a7={};_0x5b61a7[_0x3ce7c4]={'$like':'%'+_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x44')]+'%'};return _0x5b61a7;})});}_0x16a265=_[_0xfe07('0x45')]({},_0x16a265,_0x3c2cbc['options']);return _0x5b2440[_0xfe07('0x66')](_0x16a265);}})[_0xfe07('0x29')](function(_0x52533e){if(_0x52533e){_0x27f067=_0x52533e[_0xfe07('0x3e')];if(!_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x3f')](_0xfe07('0x40'))){_0x16a265[_0xfe07('0x21')]=qs[_0xfe07('0x21')](_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x21')]);_0x16a265[_0xfe07('0x1f')]=qs['offset'](_0x3c2cbc[_0xfe07('0x39')][_0xfe07('0x1f')]);}return _0x5b2440[_0xfe07('0x66')](_0x16a265);}})[_0xfe07('0x29')](function(_0xa57497){if(_0xa57497){return _0xa57497?{'count':_0x27f067,'rows':_0xa57497}:null;}})['then'](respondWithResult(_0x1e5c83,null))[_0xfe07('0x4b')](handleError(_0x1e5c83,null));};exports['addTeams']=function(_0x374f64,_0x1aae6e,_0xf70a78){var _0x28bffd=_0x374f64[_0xfe07('0x52')]['ids'];return db[_0xfe07('0x67')]['findAll']({'where':{'id':_0x28bffd},'attributes':['id'],'include':[{'model':db[_0xfe07('0x68')],'as':_0xfe07('0x69'),'attributes':['id',_0xfe07('0x32'),_0xfe07('0x6a'),_0xfe07('0x6b'),'interface'],'raw':!![]}]})['then'](function(_0x6305e8){if(_0x6305e8){var _0x2ba45d=_[_0xfe07('0x6c')](_0x6305e8,function(_0x350dbc){var _0x544c78=_0x350dbc[_0xfe07('0x2b')]({'plain':!![]});return _0x544c78['Agents'];});return db[_0xfe07('0x34')]['find']({'where':{'id':_0x374f64[_0xfe07('0x4d')]['id']}})[_0xfe07('0x29')](function(_0xa9bcd3){return db['sequelize'][_0xfe07('0x6d')](function(_0x215a72){return _0xa9bcd3[_0xfe07('0x6e')](_0x28bffd,{'transaction':_0x215a72})[_0xfe07('0x29')](function(){return BPromise[_0xfe07('0x6f')](_0x2ba45d,function(_0x272b5c){return db[_0xfe07('0x5b')][_0xfe07('0x70')]({'where':{'UserId':_0x272b5c['id'],'OpenchannelQueueId':_0x374f64[_0xfe07('0x4d')]['id']},'transaction':_0x215a72});});})['then'](function(){_0x2ba45d[_0xfe07('0x71')](function(_0x36c1f2){socket[_0xfe07('0x72')](_0xfe07('0x73'),{'UserId':_0x36c1f2['id'],'OpenchannelQueueId':_0xa9bcd3['id']});});});});});}})['then'](respondWithStatusCode(_0x1aae6e,null))[_0xfe07('0x4b')](handleError(_0x1aae6e,null));};exports[_0xfe07('0x74')]=function(_0x2849d7,_0x513dd8,_0x3cfa05){return db[_0xfe07('0x67')][_0xfe07('0x49')]({'where':{'id':_0x2849d7['query'][_0xfe07('0x75')]},'attributes':['id'],'include':[{'model':db[_0xfe07('0x68')],'as':_0xfe07('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfe07('0x29')](handleEntityNotFound(_0x513dd8,null))['then'](function(_0xf1b6be){var _0x20f620=_['map'](_0xf1b6be,'id');var _0x5534c7=[];var _0x510a40=[];var _0x504937=squel[_0xfe07('0x76')]();_0x504937[_0xfe07('0x77')](_0xfe07('0x78'))['from'](_0xfe07('0x79'),'tq')[_0xfe07('0x7a')](_0xfe07('0x7b'),'ut',_0xfe07('0x7c'))[_0xfe07('0x42')]('OpenchannelQueueId\x20=\x20?',_0x2849d7[_0xfe07('0x4d')]['id']);for(var _0x2f93d2=0x0;_0x2f93d2<_0xf1b6be[_0xfe07('0x3e')];_0x2f93d2+=0x1){let _0x245a61=_0xf1b6be[_0x2f93d2];for(var _0x3f8ff3=0x0;_0x3f8ff3<_0x245a61[_0xfe07('0x69')]['length'];_0x3f8ff3+=0x1){let _0x2890a1=_0x245a61[_0xfe07('0x69')][_0x3f8ff3];var _0x22221d=_0x504937[_0xfe07('0x7d')]();_0x22221d[_0xfe07('0x42')](_0xfe07('0x7e'),_0x2890a1['id']);_0x510a40[_0xfe07('0x7f')](db[_0xfe07('0x80')][_0xfe07('0x39')](_0x22221d[_0xfe07('0x81')](),{'type':db[_0xfe07('0x80')][_0xfe07('0x82')][_0xfe07('0x83')]})[_0xfe07('0x29')](function(_0x1be7ba){if(_0x1be7ba[_0xfe07('0x3e')]===0x1){return _0x2890a1['id'];}else{var _0x43ecd5=_[_0xfe07('0x84')](_[_0xfe07('0x33')](_0x1be7ba,_0xfe07('0x85')),function(_0x3bc108){return _[_0xfe07('0x86')](_0x20f620,_0x3bc108);});if(_0x43ecd5){return _0x2890a1['id'];}}}));}}return BPromise['all'](_0x510a40)['then'](function(_0x551838){_0x5534c7=_(_0x5534c7)['union'](_0x551838)[_0xfe07('0x87')]()['value']();return db[_0xfe07('0x34')]['find']({'where':{'id':_0x2849d7[_0xfe07('0x4d')]['id']}})[_0xfe07('0x29')](function(_0x4447ea){return db['sequelize'][_0xfe07('0x6d')](function(_0x1db41e){return _0x4447ea[_0xfe07('0x74')](_0x2849d7['query'][_0xfe07('0x75')],{'transaction':_0x1db41e})[_0xfe07('0x29')](function(){if(!_[_0xfe07('0x88')](_0x5534c7)){return _0x4447ea[_0xfe07('0x89')](_0x5534c7,{'transaction':_0x1db41e});}})[_0xfe07('0x29')](function(){_0x5534c7[_0xfe07('0x71')](function(_0x3aee64){socket['emit'](_0xfe07('0x8a'),{'UserId':_0x3aee64,'OpenchannelQueueId':_0x4447ea['id']});});});});});});})[_0xfe07('0x29')](respondWithStatusCode(_0x513dd8,null))[_0xfe07('0x4b')](handleError(_0x513dd8,null));};exports['addAgents']=function(_0x14d5f8,_0x3cbad5,_0x2e13ef){return db[_0xfe07('0x34')][_0xfe07('0x50')]({'where':{'id':_0x14d5f8[_0xfe07('0x4d')]['id']}})[_0xfe07('0x29')](handleEntityNotFound(_0x3cbad5,null))[_0xfe07('0x29')](function(_0x52c23e){if(_0x52c23e){return _0x52c23e['addAgents'](_0x14d5f8[_0xfe07('0x52')]['ids'],_[_0xfe07('0x8b')](_0x14d5f8['body'],[_0xfe07('0x75'),'id'])||{})[_0xfe07('0x8c')](function(_0x383de5){for(var _0x2112f1=0x0;_0x2112f1<_0x14d5f8['body'][_0xfe07('0x75')]['length'];_0x2112f1+=0x1){socket[_0xfe07('0x72')](_0xfe07('0x73'),{'UserId':Number(_0x14d5f8[_0xfe07('0x52')]['ids'][_0x2112f1]),'OpenchannelQueueId':Number(_0x14d5f8['params']['id'])});}return _0x383de5;});}})['then'](respondWithResult(_0x3cbad5,null))[_0xfe07('0x4b')](handleError(_0x3cbad5,null));};exports[_0xfe07('0x89')]=function(_0x39bcf9,_0x3800ed,_0x12f8f0){return db[_0xfe07('0x34')][_0xfe07('0x50')]({'where':{'id':_0x39bcf9[_0xfe07('0x4d')]['id']}})[_0xfe07('0x29')](handleEntityNotFound(_0x3800ed,null))['then'](function(_0x130620){if(_0x130620){return _0x130620[_0xfe07('0x89')](_0x39bcf9['query'][_0xfe07('0x75')])['then'](function(){if(_['isArray'](_0x39bcf9[_0xfe07('0x39')][_0xfe07('0x75')])){for(var _0x38b85e=0x0;_0x38b85e<_0x39bcf9['query'][_0xfe07('0x75')][_0xfe07('0x3e')];_0x38b85e+=0x1){socket['emit'](_0xfe07('0x8a'),{'UserId':Number(_0x39bcf9['query'][_0xfe07('0x75')][_0x38b85e]),'OpenchannelQueueId':Number(_0x39bcf9['params']['id'])});}}else{socket[_0xfe07('0x72')](_0xfe07('0x8a'),{'UserId':Number(_0x39bcf9[_0xfe07('0x39')][_0xfe07('0x75')]),'OpenchannelQueueId':Number(_0x39bcf9['params']['id'])});}});}})[_0xfe07('0x29')](respondWithStatusCode(_0x3800ed,null))[_0xfe07('0x4b')](handleError(_0x3800ed,null));};exports[_0xfe07('0x8d')]=function(_0x2d948c,_0x57865b,_0x2139bc){var _0x59e101={};var _0x26ea2d={};var _0x54a32f;var _0x371ae1;return db[_0xfe07('0x34')]['findOne']({'where':{'id':_0x2d948c[_0xfe07('0x4d')]['id']}})[_0xfe07('0x29')](handleEntityNotFound(_0x57865b,null))['then'](function(_0x1448a5){if(_0x1448a5){_0x54a32f=_0x1448a5;_0x26ea2d['model']=_[_0xfe07('0x4e')](db[_0xfe07('0x68')][_0xfe07('0x5c')]);_0x26ea2d['query']=_[_0xfe07('0x4e')](_0x2d948c[_0xfe07('0x39')]);_0x26ea2d[_0xfe07('0x3a')]=_[_0xfe07('0x3b')](_0x26ea2d['model'],_0x26ea2d[_0xfe07('0x39')]);_0x59e101[_0xfe07('0x3c')]=_[_0xfe07('0x3b')](_0x26ea2d[_0xfe07('0x38')],qs[_0xfe07('0x3d')](_0x2d948c[_0xfe07('0x39')][_0xfe07('0x3d')]));_0x59e101[_0xfe07('0x3c')]=_0x59e101[_0xfe07('0x3c')][_0xfe07('0x3e')]?_0x59e101['attributes']:_0x26ea2d[_0xfe07('0x38')];_0x59e101[_0xfe07('0x5d')]=qs[_0xfe07('0x41')](_0x2d948c[_0xfe07('0x39')][_0xfe07('0x41')]);_0x59e101['where']=qs[_0xfe07('0x3a')](_[_0xfe07('0x43')](_0x2d948c[_0xfe07('0x39')],_0x26ea2d['filters']));if(_0x2d948c['query'][_0xfe07('0x44')]){_0x59e101['where']=_[_0xfe07('0x45')](_0x59e101[_0xfe07('0x42')],{'$or':_[_0xfe07('0x33')](_0x59e101['attributes'],function(_0x559c09){var _0x5d47b3={};_0x5d47b3[_0x559c09]={'$like':'%'+_0x2d948c[_0xfe07('0x39')][_0xfe07('0x44')]+'%'};return _0x5d47b3;})});}_0x59e101=_[_0xfe07('0x45')]({},_0x59e101,_0x2d948c[_0xfe07('0x47')]);return _0x54a32f[_0xfe07('0x8d')](_0x59e101);}})['then'](function(_0x351e4c){if(_0x351e4c){_0x371ae1=_0x351e4c[_0xfe07('0x3e')];if(!_0x2d948c[_0xfe07('0x39')][_0xfe07('0x3f')]('nolimit')){_0x59e101[_0xfe07('0x21')]=qs[_0xfe07('0x21')](_0x2d948c[_0xfe07('0x39')]['limit']);_0x59e101[_0xfe07('0x1f')]=qs[_0xfe07('0x1f')](_0x2d948c[_0xfe07('0x39')][_0xfe07('0x1f')]);}return _0x54a32f[_0xfe07('0x8d')](_0x59e101);}})[_0xfe07('0x29')](function(_0x4f3f69){if(_0x4f3f69){return _0x4f3f69?{'count':_0x371ae1,'rows':_0x4f3f69}:null;}})[_0xfe07('0x29')](respondWithResult(_0x57865b,null))[_0xfe07('0x4b')](handleError(_0x57865b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d057a42..9ebf7d9 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 _0xf7d4=['OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0xf7d4,0xbb));var _0x4f7d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xf7d4[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0x4f7d('0x0'));var OpenchannelQueue=require(_0x4f7d('0x1'))['db'][_0x4f7d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4f7d('0x3')](0x0);var events={'afterCreate':_0x4f7d('0x4'),'afterUpdate':_0x4f7d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x88f219){return function(_0x1e0fa2,_0x2a3b8f,_0x213be3){OpenchannelQueueEvents[_0x4f7d('0x6')](_0x88f219+':'+_0x1e0fa2['id'],_0x1e0fa2);OpenchannelQueueEvents[_0x4f7d('0x6')](_0x88f219,_0x1e0fa2);_0x213be3(null);};}for(var e in events){if(events[_0x4f7d('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x4f7d('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe3f3=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2199cd,_0x197f61){var _0x4dccdb=function(_0x17e2e5){while(--_0x17e2e5){_0x2199cd['push'](_0x2199cd['shift']());}};_0x4dccdb(++_0x197f61);}(_0xe3f3,0xa5));var _0x3e3f=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xe3f3[_0x29d915];return _0x160f86;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x3e3f('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3e3f('0x1')](0x0);var events={'afterCreate':_0x3e3f('0x2'),'afterUpdate':_0x3e3f('0x3'),'afterDestroy':_0x3e3f('0x4')};function emitEvent(_0x3a2a47){return function(_0x52c43f,_0x34060a,_0x58d1fa){OpenchannelQueueEvents[_0x3e3f('0x5')](_0x3a2a47+':'+_0x52c43f['id'],_0x52c43f);OpenchannelQueueEvents[_0x3e3f('0x5')](_0x3a2a47,_0x52c43f);_0x58d1fa(null);};}for(var e in events){if(events[_0x3e3f('0x6')](e)){var event=events[e];OpenchannelQueue[_0x3e3f('0x7')](e,emitEvent(event));}}module[_0x3e3f('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 2dce8ab..121d81f 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 _0x918f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x918f,0xa6));var _0xf918=function(_0x41e7cc,_0x3e893e){_0x41e7cc=_0x41e7cc-0x0;var _0x4a79cf=_0x918f[_0x41e7cc];return _0x4a79cf;};'use strict';var _=require(_0xf918('0x0'));var util=require(_0xf918('0x1'));var logger=require('../../config/logger')(_0xf918('0x2'));var moment=require(_0xf918('0x3'));var BPromise=require(_0xf918('0x4'));var rp=require(_0xf918('0x5'));var fs=require('fs');var path=require(_0xf918('0x6'));var rimraf=require(_0xf918('0x7'));var config=require(_0xf918('0x8'));var attributes=require(_0xf918('0x9'));module['exports']=function(_0x443c2a,_0x5f4da9){return _0x443c2a[_0xf918('0xa')](_0xf918('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c00=['api','moment','bluebird','path','rimraf','../../config/environment','define','OpenchannelQueue','lodash','util','../../config/logger'];(function(_0x3dc503,_0x152dae){var _0x4bff32=function(_0x53d307){while(--_0x53d307){_0x3dc503['push'](_0x3dc503['shift']());}};_0x4bff32(++_0x152dae);}(_0x2c00,0xef));var _0x02c0=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0x2c00[_0x15bbf1];return _0x5c4b47;};'use strict';var _=require(_0x02c0('0x0'));var util=require(_0x02c0('0x1'));var logger=require(_0x02c0('0x2'))(_0x02c0('0x3'));var moment=require(_0x02c0('0x4'));var BPromise=require(_0x02c0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02c0('0x6'));var rimraf=require(_0x02c0('0x7'));var config=require(_0x02c0('0x8'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x3a8de0,_0xa5c0e8){return _0x3a8de0[_0x02c0('0x9')](_0x02c0('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 507e1f7..2a5f13b 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 _0xec13=['./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetOpenchannelQueue','options','raw','where','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter'];(function(_0xc9f9ae,_0x3cd81b){var _0x28ddab=function(_0x5b6526){while(--_0x5b6526){_0xc9f9ae['push'](_0xc9f9ae['shift']());}};_0x28ddab(++_0x3cd81b);}(_0xec13,0x19f));var _0x3ec1=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xec13[_0x5783f4];return _0x28e380;};'use strict';var _=require('lodash');var util=require(_0x3ec1('0x0'));var moment=require(_0x3ec1('0x1'));var BPromise=require(_0x3ec1('0x2'));var rs=require(_0x3ec1('0x3'));var fs=require('fs');var Redis=require(_0x3ec1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ec1('0x5'));var logger=require(_0x3ec1('0x6'))(_0x3ec1('0x7'));var config=require(_0x3ec1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ec1('0x9')][_0x3ec1('0xa')]({'port':0x232a});config[_0x3ec1('0xb')]=_[_0x3ec1('0xc')](config[_0x3ec1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ec1('0xd'))(new Redis(config[_0x3ec1('0xb')]));require(_0x3ec1('0xe'))[_0x3ec1('0xf')](socket);function respondWithRpcPromise(_0x257d40,_0x5cfc29,_0x5efb1c){return new BPromise(function(_0x53e7ac,_0x30499f){return client[_0x3ec1('0x10')](_0x257d40,_0x5efb1c)[_0x3ec1('0x11')](function(_0x53bdc4){logger[_0x3ec1('0x12')](_0x3ec1('0x13'),_0x5cfc29,_0x3ec1('0x14'));logger[_0x3ec1('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5cfc29,_0x3ec1('0x14'),JSON[_0x3ec1('0x16')](_0x53bdc4));if(_0x53bdc4[_0x3ec1('0x17')]){if(_0x53bdc4['error'][_0x3ec1('0x18')]===0x1f4){logger[_0x3ec1('0x17')](_0x3ec1('0x13'),_0x5cfc29,_0x53bdc4['error'][_0x3ec1('0x19')]);return _0x30499f(_0x53bdc4[_0x3ec1('0x17')][_0x3ec1('0x19')]);}logger['error'](_0x3ec1('0x13'),_0x5cfc29,_0x53bdc4[_0x3ec1('0x17')][_0x3ec1('0x19')]);return _0x53e7ac(_0x53bdc4[_0x3ec1('0x17')]['message']);}else{logger['info'](_0x3ec1('0x13'),_0x5cfc29,_0x3ec1('0x14'));_0x53e7ac(_0x53bdc4[_0x3ec1('0x1a')][_0x3ec1('0x19')]);}})['catch'](function(_0x5447e1){logger[_0x3ec1('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x5cfc29,_0x5447e1);_0x30499f(_0x5447e1);});});}exports[_0x3ec1('0x1b')]=function(_0x5093cc){var _0x568a8b=this;return new Promise(function(_0x1c31ed,_0x3bfd81){return db['OpenchannelQueue']['findAll']({'raw':_0x5093cc[_0x3ec1('0x1c')]?_0x5093cc['options'][_0x3ec1('0x1d')]===undefined?!![]:![]:!![],'where':_0x5093cc[_0x3ec1('0x1c')]?_0x5093cc['options'][_0x3ec1('0x1e')]||null:null,'attributes':_0x5093cc[_0x3ec1('0x1c')]?_0x5093cc[_0x3ec1('0x1c')][_0x3ec1('0x1f')]||null:null,'limit':_0x5093cc[_0x3ec1('0x1c')]?_0x5093cc[_0x3ec1('0x1c')][_0x3ec1('0x20')]||null:null,'include':_0x5093cc['options']?_0x5093cc['options'][_0x3ec1('0x21')]?_[_0x3ec1('0x22')](_0x5093cc[_0x3ec1('0x1c')]['include'],function(_0x437a1e){return{'model':db[_0x437a1e[_0x3ec1('0x23')]],'as':_0x437a1e['as'],'attributes':_0x437a1e[_0x3ec1('0x1f')],'include':_0x437a1e[_0x3ec1('0x21')]?_[_0x3ec1('0x22')](_0x437a1e['include'],function(_0x4c74fe){return{'model':db[_0x4c74fe[_0x3ec1('0x23')]],'as':_0x4c74fe['as'],'attributes':_0x4c74fe[_0x3ec1('0x1f')],'include':_0x4c74fe[_0x3ec1('0x21')]?_[_0x3ec1('0x22')](_0x4c74fe[_0x3ec1('0x21')],function(_0x52a7e2){return{'model':db[_0x52a7e2[_0x3ec1('0x23')]],'as':_0x52a7e2['as'],'attributes':_0x52a7e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ec1('0x11')](function(_0x55ff6f){logger[_0x3ec1('0x12')](_0x3ec1('0x1b'),_0x5093cc);logger['debug'](_0x3ec1('0x1b'),_0x5093cc,JSON['stringify'](_0x55ff6f));_0x1c31ed(_0x55ff6f);})[_0x3ec1('0x24')](function(_0x50d1f2){logger['error'](_0x3ec1('0x1b'),_0x50d1f2[_0x3ec1('0x19')],_0x5093cc);_0x3bfd81(_0x568a8b['error'](0x1f4,_0x50d1f2['message']));});});};exports[_0x3ec1('0x25')]=function(_0x4df00a){var _0x553df6=this;return new Promise(function(_0x55758d,_0x5906e0){return db['OpenchannelQueue'][_0x3ec1('0x26')]({'raw':_0x4df00a['options']?_0x4df00a[_0x3ec1('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4df00a[_0x3ec1('0x1c')]?_0x4df00a[_0x3ec1('0x1c')]['where']||null:null,'attributes':_0x4df00a['options']?_0x4df00a[_0x3ec1('0x1c')]['attributes']||null:null,'include':_0x4df00a[_0x3ec1('0x1c')]?_0x4df00a['options'][_0x3ec1('0x21')]?_[_0x3ec1('0x22')](_0x4df00a[_0x3ec1('0x1c')][_0x3ec1('0x21')],function(_0x2d2c4f){return{'model':db[_0x2d2c4f[_0x3ec1('0x23')]],'as':_0x2d2c4f['as'],'attributes':_0x2d2c4f[_0x3ec1('0x1f')],'include':_0x2d2c4f[_0x3ec1('0x21')]?_[_0x3ec1('0x22')](_0x2d2c4f[_0x3ec1('0x21')],function(_0xf1140e){return{'model':db[_0xf1140e[_0x3ec1('0x23')]],'as':_0xf1140e['as'],'attributes':_0xf1140e['attributes'],'include':_0xf1140e[_0x3ec1('0x21')]?_[_0x3ec1('0x22')](_0xf1140e['include'],function(_0x34d125){return{'model':db[_0x34d125[_0x3ec1('0x23')]],'as':_0x34d125['as'],'attributes':_0x34d125[_0x3ec1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3ec1('0x11')](function(_0x4e6b56){logger[_0x3ec1('0x12')]('ShowOpenchannelQueue',_0x4df00a);logger[_0x3ec1('0x15')](_0x3ec1('0x25'),_0x4df00a,JSON[_0x3ec1('0x16')](_0x4e6b56));_0x55758d(_0x4e6b56);})[_0x3ec1('0x24')](function(_0x547282){logger[_0x3ec1('0x17')]('ShowOpenchannelQueue',_0x547282[_0x3ec1('0x19')],_0x4df00a);_0x5906e0(_0x553df6['error'](0x1f4,_0x547282[_0x3ec1('0x19')]));});});}; \ No newline at end of file +var _0x3eaf=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','find','util'];(function(_0x32abf8,_0x3e0374){var _0x20bcdf=function(_0x4ae592){while(--_0x4ae592){_0x32abf8['push'](_0x32abf8['shift']());}};_0x20bcdf(++_0x3e0374);}(_0x3eaf,0x167));var _0xf3ea=function(_0x24987d,_0x44bb27){_0x24987d=_0x24987d-0x0;var _0x461267=_0x3eaf[_0x24987d];return _0x461267;};'use strict';var _=require('lodash');var util=require(_0xf3ea('0x0'));var moment=require(_0xf3ea('0x1'));var BPromise=require(_0xf3ea('0x2'));var rs=require(_0xf3ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3ea('0x4'))['db'];var utils=require(_0xf3ea('0x5'));var logger=require('../../config/logger')(_0xf3ea('0x6'));var config=require(_0xf3ea('0x7'));var jayson=require(_0xf3ea('0x8'));var client=jayson['client'][_0xf3ea('0x9')]({'port':0x232a});config[_0xf3ea('0xa')]=_[_0xf3ea('0xb')](config[_0xf3ea('0xa')],{'host':_0xf3ea('0xc'),'port':0x18eb});var socket=require(_0xf3ea('0xd'))(new Redis(config[_0xf3ea('0xa')]));require(_0xf3ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x57aa8b,_0x13cfd1,_0x1f6664){return new BPromise(function(_0x136008,_0x1af2b2){return client[_0xf3ea('0xf')](_0x57aa8b,_0x1f6664)[_0xf3ea('0x10')](function(_0x6b809b){logger['info'](_0xf3ea('0x11'),_0x13cfd1,_0xf3ea('0x12'));logger[_0xf3ea('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x13cfd1,_0xf3ea('0x12'),JSON[_0xf3ea('0x14')](_0x6b809b));if(_0x6b809b[_0xf3ea('0x15')]){if(_0x6b809b[_0xf3ea('0x15')][_0xf3ea('0x16')]===0x1f4){logger['error'](_0xf3ea('0x11'),_0x13cfd1,_0x6b809b[_0xf3ea('0x15')][_0xf3ea('0x17')]);return _0x1af2b2(_0x6b809b[_0xf3ea('0x15')][_0xf3ea('0x17')]);}logger[_0xf3ea('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x13cfd1,_0x6b809b[_0xf3ea('0x15')][_0xf3ea('0x17')]);return _0x136008(_0x6b809b[_0xf3ea('0x15')][_0xf3ea('0x17')]);}else{logger[_0xf3ea('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x13cfd1,_0xf3ea('0x12'));_0x136008(_0x6b809b[_0xf3ea('0x19')][_0xf3ea('0x17')]);}})['catch'](function(_0x37eaa0){logger[_0xf3ea('0x15')](_0xf3ea('0x11'),_0x13cfd1,_0x37eaa0);_0x1af2b2(_0x37eaa0);});});}exports[_0xf3ea('0x1a')]=function(_0x4066ea){var _0xa8ec0c=this;return new Promise(function(_0x3f48c2,_0x295680){return db[_0xf3ea('0x1b')][_0xf3ea('0x1c')]({'raw':_0x4066ea[_0xf3ea('0x1d')]?_0x4066ea['options'][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x4066ea[_0xf3ea('0x1d')]?_0x4066ea[_0xf3ea('0x1d')][_0xf3ea('0x1f')]||null:null,'attributes':_0x4066ea[_0xf3ea('0x1d')]?_0x4066ea[_0xf3ea('0x1d')][_0xf3ea('0x20')]||null:null,'limit':_0x4066ea[_0xf3ea('0x1d')]?_0x4066ea['options'][_0xf3ea('0x21')]||null:null,'include':_0x4066ea[_0xf3ea('0x1d')]?_0x4066ea[_0xf3ea('0x1d')][_0xf3ea('0x22')]?_[_0xf3ea('0x23')](_0x4066ea[_0xf3ea('0x1d')][_0xf3ea('0x22')],function(_0x213cb5){return{'model':db[_0x213cb5[_0xf3ea('0x24')]],'as':_0x213cb5['as'],'attributes':_0x213cb5[_0xf3ea('0x20')],'include':_0x213cb5[_0xf3ea('0x22')]?_[_0xf3ea('0x23')](_0x213cb5[_0xf3ea('0x22')],function(_0x325c59){return{'model':db[_0x325c59[_0xf3ea('0x24')]],'as':_0x325c59['as'],'attributes':_0x325c59[_0xf3ea('0x20')],'include':_0x325c59['include']?_[_0xf3ea('0x23')](_0x325c59[_0xf3ea('0x22')],function(_0x5b4344){return{'model':db[_0x5b4344[_0xf3ea('0x24')]],'as':_0x5b4344['as'],'attributes':_0x5b4344[_0xf3ea('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf3ea('0x10')](function(_0x4875bf){logger[_0xf3ea('0x18')]('GetOpenchannelQueue',_0x4066ea);logger['debug'](_0xf3ea('0x1a'),_0x4066ea,JSON[_0xf3ea('0x14')](_0x4875bf));_0x3f48c2(_0x4875bf);})[_0xf3ea('0x25')](function(_0x507e66){logger[_0xf3ea('0x15')](_0xf3ea('0x1a'),_0x507e66[_0xf3ea('0x17')],_0x4066ea);_0x295680(_0xa8ec0c[_0xf3ea('0x15')](0x1f4,_0x507e66[_0xf3ea('0x17')]));});});};exports[_0xf3ea('0x26')]=function(_0x140b6e){var _0x407534=this;return new Promise(function(_0x5a173f,_0x1a7861){return db[_0xf3ea('0x1b')][_0xf3ea('0x27')]({'raw':_0x140b6e[_0xf3ea('0x1d')]?_0x140b6e['options'][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x140b6e[_0xf3ea('0x1d')]?_0x140b6e[_0xf3ea('0x1d')]['where']||null:null,'attributes':_0x140b6e['options']?_0x140b6e[_0xf3ea('0x1d')][_0xf3ea('0x20')]||null:null,'include':_0x140b6e[_0xf3ea('0x1d')]?_0x140b6e[_0xf3ea('0x1d')]['include']?_[_0xf3ea('0x23')](_0x140b6e['options'][_0xf3ea('0x22')],function(_0x1bd978){return{'model':db[_0x1bd978[_0xf3ea('0x24')]],'as':_0x1bd978['as'],'attributes':_0x1bd978['attributes'],'include':_0x1bd978[_0xf3ea('0x22')]?_[_0xf3ea('0x23')](_0x1bd978[_0xf3ea('0x22')],function(_0xeae1b2){return{'model':db[_0xeae1b2[_0xf3ea('0x24')]],'as':_0xeae1b2['as'],'attributes':_0xeae1b2['attributes'],'include':_0xeae1b2['include']?_[_0xf3ea('0x23')](_0xeae1b2[_0xf3ea('0x22')],function(_0x5e9096){return{'model':db[_0x5e9096[_0xf3ea('0x24')]],'as':_0x5e9096['as'],'attributes':_0x5e9096[_0xf3ea('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf3ea('0x10')](function(_0x2d32b8){logger[_0xf3ea('0x18')]('ShowOpenchannelQueue',_0x140b6e);logger['debug']('ShowOpenchannelQueue',_0x140b6e,JSON[_0xf3ea('0x14')](_0x2d32b8));_0x5a173f(_0x2d32b8);})[_0xf3ea('0x25')](function(_0x403306){logger[_0xf3ea('0x15')](_0xf3ea('0x26'),_0x403306[_0xf3ea('0x17')],_0x140b6e);_0x1a7861(_0x407534[_0xf3ea('0x15')](0x1f4,_0x403306[_0xf3ea('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 14f7d4c..8e0cb8f 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 _0x6413=['length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6413,0x1de));var _0x3641=function(_0xd6448,_0x16033b){_0xd6448=_0xd6448-0x0;var _0x5c0d29=_0x6413[_0xd6448];return _0x5c0d29;};'use strict';var OpenchannelQueueEvents=require(_0x3641('0x0'));var events=[_0x3641('0x1'),_0x3641('0x2'),'update'];function createListener(_0xc41eca,_0x23d8c5){return function(_0x1c3bde){_0x23d8c5[_0x3641('0x3')](_0xc41eca,_0x1c3bde);};}function removeListener(_0x37234c,_0x35019b){return function(){OpenchannelQueueEvents[_0x3641('0x4')](_0x37234c,_0x35019b);};}exports['register']=function(_0x4911a8){for(var _0x26cae9=0x0,_0x4f7d3a=events[_0x3641('0x5')];_0x26cae9<_0x4f7d3a;_0x26cae9++){var _0x2bfbdf=events[_0x26cae9];var _0x17b610=createListener(_0x3641('0x6')+_0x2bfbdf,_0x4911a8);OpenchannelQueueEvents['on'](_0x2bfbdf,_0x17b610);}}; \ No newline at end of file +var _0x521b=['save','remove','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x521b,0x117));var _0xb521=function(_0x2a5a5a,_0x5a4047){_0x2a5a5a=_0x2a5a5a-0x0;var _0x2d6dc6=_0x521b[_0x2a5a5a];return _0x2d6dc6;};'use strict';var OpenchannelQueueEvents=require(_0xb521('0x0'));var events=[_0xb521('0x1'),_0xb521('0x2'),'update'];function createListener(_0x1a904e,_0x5b8d43){return function(_0x264e1d){_0x5b8d43[_0xb521('0x3')](_0x1a904e,_0x264e1d);};}function removeListener(_0x326ecf,_0x3879f7){return function(){OpenchannelQueueEvents[_0xb521('0x4')](_0x326ecf,_0x3879f7);};}exports['register']=function(_0x59b022){for(var _0x8971bc=0x0,_0x47489a=events[_0xb521('0x5')];_0x8971bc<_0x47489a;_0x8971bc++){var _0x13ed5d=events[_0x8971bc];var _0x1aa947=createListener(_0xb521('0x6')+_0x13ed5d,_0x59b022);OpenchannelQueueEvents['on'](_0x13ed5d,_0x1aa947);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index f9a66ed..f58e8c0 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 _0x0869=['/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get'];(function(_0x19d6e8,_0x39bb4a){var _0x4fc118=function(_0x18bac5){while(--_0x18bac5){_0x19d6e8['push'](_0x19d6e8['shift']());}};_0x4fc118(++_0x39bb4a);}(_0x0869,0x184));var _0x9086=function(_0x2ba14f,_0x4bd39f){_0x2ba14f=_0x2ba14f-0x0;var _0x2513f7=_0x0869[_0x2ba14f];return _0x2513f7;};'use strict';var multer=require(_0x9086('0x0'));var util=require(_0x9086('0x1'));var path=require('path');var timeout=require(_0x9086('0x2'));var express=require(_0x9086('0x3'));var router=express[_0x9086('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9086('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9086('0x6'));var controller=require(_0x9086('0x7'));router['get']('/',auth[_0x9086('0x8')](),controller[_0x9086('0x9')]);router[_0x9086('0xa')](_0x9086('0xb'),auth[_0x9086('0x8')](),controller[_0x9086('0xc')]);router[_0x9086('0xa')](_0x9086('0xd'),auth['isAuthenticated'](),controller[_0x9086('0xe')]);router[_0x9086('0xf')]('/',auth['isAuthenticated'](),controller[_0x9086('0x10')]);router[_0x9086('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9086('0x12')]);router[_0x9086('0x13')](_0x9086('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9086('0x14')]=router; \ No newline at end of file +var _0x03f1=['post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x57d44a,_0x47363f){var _0x5daa45=function(_0x14a611){while(--_0x14a611){_0x57d44a['push'](_0x57d44a['shift']());}};_0x5daa45(++_0x47363f);}(_0x03f1,0x1ea));var _0x103f=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x03f1[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require(_0x103f('0x0'));var util=require(_0x103f('0x1'));var path=require(_0x103f('0x2'));var timeout=require(_0x103f('0x3'));var express=require(_0x103f('0x4'));var router=express[_0x103f('0x5')]();var fs_extra=require(_0x103f('0x6'));var auth=require(_0x103f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x103f('0x8'));var controller=require(_0x103f('0x9'));router[_0x103f('0xa')]('/',auth[_0x103f('0xb')](),controller['index']);router[_0x103f('0xa')](_0x103f('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x103f('0xa')](_0x103f('0xd'),auth[_0x103f('0xb')](),controller['show']);router[_0x103f('0xe')]('/',auth[_0x103f('0xb')](),controller['create']);router['put'](_0x103f('0xd'),auth[_0x103f('0xb')](),controller['update']);router[_0x103f('0xf')](_0x103f('0xd'),auth[_0x103f('0xb')](),controller[_0x103f('0x10')]);module[_0x103f('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 14fb4f6..1116c1b 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 _0x09e5=['DATE','STRING'];(function(_0x51e9d7,_0x460065){var _0x556dd8=function(_0x407604){while(--_0x407604){_0x51e9d7['push'](_0x51e9d7['shift']());}};_0x556dd8(++_0x460065);}(_0x09e5,0xb7));var _0x509e=function(_0x436a1c,_0x545254){_0x436a1c=_0x436a1c-0x0;var _0x108479=_0x09e5[_0x436a1c];return _0x108479;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x509e('0x0')]},'joinAt':{'type':Sequelize[_0x509e('0x1')]},'leaveAt':{'type':Sequelize[_0x509e('0x1')]},'acceptAt':{'type':Sequelize[_0x509e('0x1')]},'exitAt':{'type':Sequelize[_0x509e('0x1')]},'reason':{'type':Sequelize[_0x509e('0x0')]}}; \ No newline at end of file +var _0xe296=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe296,0x195));var _0x6e29=function(_0x4a3278,_0x35ef3b){_0x4a3278=_0x4a3278-0x0;var _0x182006=_0xe296[_0x4a3278];return _0x182006;};'use strict';var moment=require(_0x6e29('0x0'));var Sequelize=require(_0x6e29('0x1'));module[_0x6e29('0x2')]={'uniqueid':{'type':Sequelize[_0x6e29('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6e29('0x3')]},'joinAt':{'type':Sequelize[_0x6e29('0x4')]},'leaveAt':{'type':Sequelize[_0x6e29('0x4')]},'acceptAt':{'type':Sequelize[_0x6e29('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index fe723ad..ee7d051 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 _0xac07=['index','OpenchannelQueueReport','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','include','merge','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0xac07,0x159));var _0x7ac0=function(_0x21dbff,_0x23330f){_0x21dbff=_0x21dbff-0x0;var _0x3f46e5=_0xac07[_0x21dbff];return _0x3f46e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ac0('0x0'));var zipdir=require(_0x7ac0('0x1'));var jsonpatch=require(_0x7ac0('0x2'));var rp=require('request-promise');var moment=require(_0x7ac0('0x3'));var BPromise=require(_0x7ac0('0x4'));var Mustache=require(_0x7ac0('0x5'));var util=require(_0x7ac0('0x6'));var path=require(_0x7ac0('0x7'));var sox=require(_0x7ac0('0x8'));var csv=require('to-csv');var ejs=require(_0x7ac0('0x9'));var fs=require('fs');var fs_extra=require(_0x7ac0('0xa'));var _=require(_0x7ac0('0xb'));var squel=require(_0x7ac0('0xc'));var crypto=require(_0x7ac0('0xd'));var jsforce=require(_0x7ac0('0xe'));var deskjs=require(_0x7ac0('0xf'));var toCsv=require(_0x7ac0('0x10'));var querystring=require('querystring');var Papa=require(_0x7ac0('0x11'));var Redis=require(_0x7ac0('0x12'));var authService=require(_0x7ac0('0x13'));var qs=require(_0x7ac0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ac0('0x15'));var logger=require(_0x7ac0('0x16'))(_0x7ac0('0x17'));var utils=require(_0x7ac0('0x18'));var config=require(_0x7ac0('0x19'));var licenseUtil=require(_0x7ac0('0x1a'));var db=require(_0x7ac0('0x1b'))['db'];function respondWithStatusCode(_0x189792,_0x37cc88){_0x37cc88=_0x37cc88||0xcc;return function(_0x1660b8){if(_0x1660b8){return _0x189792[_0x7ac0('0x1c')](_0x37cc88);}return _0x189792['status'](_0x37cc88)[_0x7ac0('0x1d')]();};}function respondWithResult(_0x59adc7,_0x1a4819){_0x1a4819=_0x1a4819||0xc8;return function(_0x758c06){if(_0x758c06){return _0x59adc7[_0x7ac0('0x1e')](_0x1a4819)[_0x7ac0('0x1f')](_0x758c06);}};}function respondWithFilteredResult(_0x1a6ca5,_0x59cce5){return function(_0xb4429c){if(_0xb4429c){var _0x46b2d0=typeof _0x59cce5[_0x7ac0('0x20')]===_0x7ac0('0x21')&&typeof _0x59cce5[_0x7ac0('0x22')]===_0x7ac0('0x21');var _0x3f555f=_0xb4429c[_0x7ac0('0x23')];var _0x52bcfd=_0x46b2d0?0x0:_0x59cce5[_0x7ac0('0x20')];var _0x447596=_0x46b2d0?_0xb4429c['count']:_0x59cce5[_0x7ac0('0x20')]+_0x59cce5['limit'];var _0x4f4602;if(_0x447596>=_0x3f555f){_0x447596=_0x3f555f;_0x4f4602=0xc8;}else{_0x4f4602=0xce;}_0x1a6ca5[_0x7ac0('0x1e')](_0x4f4602);return _0x1a6ca5[_0x7ac0('0x24')]('Content-Range',_0x52bcfd+'-'+_0x447596+'/'+_0x3f555f)[_0x7ac0('0x1f')](_0xb4429c);}return null;};}function patchUpdates(_0x4d8da2){return function(_0x362b68){try{jsonpatch[_0x7ac0('0x25')](_0x362b68,_0x4d8da2,!![]);}catch(_0x1d39b7){return BPromise[_0x7ac0('0x26')](_0x1d39b7);}return _0x362b68['save']();};}function saveUpdates(_0x54d19c,_0x1cdeda){return function(_0x29fb69){if(_0x29fb69){return _0x29fb69[_0x7ac0('0x27')](_0x54d19c)[_0x7ac0('0x28')](function(_0x9744f3){return _0x9744f3;});}return null;};}function removeEntity(_0x5b2263,_0x58a28e){return function(_0x3fb88b){if(_0x3fb88b){return _0x3fb88b[_0x7ac0('0x29')]()[_0x7ac0('0x28')](function(){_0x5b2263['status'](0xcc)[_0x7ac0('0x1d')]();});}};}function handleEntityNotFound(_0x30faea,_0x3699f2){return function(_0x14fed4){if(!_0x14fed4){_0x30faea[_0x7ac0('0x1c')](0x194);}return _0x14fed4;};}function handleError(_0x4ba202,_0x302385){_0x302385=_0x302385||0x1f4;return function(_0x127a98){logger[_0x7ac0('0x2a')](_0x127a98[_0x7ac0('0x2b')]);if(_0x127a98[_0x7ac0('0x2c')]){delete _0x127a98['name'];}_0x4ba202[_0x7ac0('0x1e')](_0x302385)['send'](_0x127a98);};}exports[_0x7ac0('0x2d')]=function(_0x366c31,_0x1545a6){var _0x2ab808={},_0x24918f={},_0x2f6947={'count':0x0,'rows':[]};var _0x43e62c=_['map'](db[_0x7ac0('0x2e')][_0x7ac0('0x2f')],function(_0x17c2ff){return{'name':_0x17c2ff[_0x7ac0('0x30')],'type':_0x17c2ff['type']['key']};});_0x24918f[_0x7ac0('0x31')]=_[_0x7ac0('0x32')](_0x43e62c,_0x7ac0('0x2c'));_0x24918f[_0x7ac0('0x33')]=_[_0x7ac0('0x34')](_0x366c31[_0x7ac0('0x33')]);_0x24918f[_0x7ac0('0x35')]=_['intersection'](_0x24918f[_0x7ac0('0x31')],_0x24918f[_0x7ac0('0x33')]);_0x2ab808[_0x7ac0('0x36')]=_[_0x7ac0('0x37')](_0x24918f[_0x7ac0('0x31')],qs['fields'](_0x366c31[_0x7ac0('0x33')]['fields']));_0x2ab808[_0x7ac0('0x36')]=_0x2ab808[_0x7ac0('0x36')][_0x7ac0('0x38')]?_0x2ab808['attributes']:_0x24918f['model'];if(!_0x366c31[_0x7ac0('0x33')][_0x7ac0('0x39')](_0x7ac0('0x3a'))){_0x2ab808[_0x7ac0('0x22')]=qs['limit'](_0x366c31[_0x7ac0('0x33')][_0x7ac0('0x22')]);_0x2ab808['offset']=qs[_0x7ac0('0x20')](_0x366c31[_0x7ac0('0x33')][_0x7ac0('0x20')]);}_0x2ab808[_0x7ac0('0x3b')]=qs['sort'](_0x366c31[_0x7ac0('0x33')][_0x7ac0('0x3c')]);_0x2ab808[_0x7ac0('0x3d')]=qs[_0x7ac0('0x35')](_[_0x7ac0('0x3e')](_0x366c31[_0x7ac0('0x33')],_0x24918f[_0x7ac0('0x35')]),_0x43e62c);if(_0x366c31[_0x7ac0('0x33')][_0x7ac0('0x3f')]){_0x2ab808[_0x7ac0('0x3d')]=_['merge'](_0x2ab808[_0x7ac0('0x3d')],{'$or':_[_0x7ac0('0x32')](_0x43e62c,function(_0x3bc26c){if(_0x3bc26c[_0x7ac0('0x40')]!==_0x7ac0('0x41')){var _0x449e32={};_0x449e32[_0x3bc26c[_0x7ac0('0x2c')]]={'$like':'%'+_0x366c31['query'][_0x7ac0('0x3f')]+'%'};return _0x449e32;}})});}_0x2ab808=_['merge']({},_0x2ab808,_0x366c31[_0x7ac0('0x42')]);var _0x34e032={'where':_0x2ab808['where']};return db[_0x7ac0('0x2e')][_0x7ac0('0x23')](_0x34e032)[_0x7ac0('0x28')](function(_0x31072c){_0x2f6947[_0x7ac0('0x23')]=_0x31072c;if(_0x366c31[_0x7ac0('0x33')][_0x7ac0('0x43')]){_0x2ab808['include']=[{'all':!![]}];}return db[_0x7ac0('0x2e')][_0x7ac0('0x44')](_0x2ab808);})[_0x7ac0('0x28')](function(_0x26ed47){_0x2f6947['rows']=_0x26ed47;return _0x2f6947;})[_0x7ac0('0x28')](respondWithFilteredResult(_0x1545a6,_0x2ab808))[_0x7ac0('0x45')](handleError(_0x1545a6,null));};exports[_0x7ac0('0x46')]=function(_0x5ab2e1,_0x26e32e){var _0x4dddc2={'raw':!![],'where':{'id':_0x5ab2e1[_0x7ac0('0x47')]['id']}},_0x2ff144={};_0x2ff144[_0x7ac0('0x31')]=_[_0x7ac0('0x34')](db['OpenchannelQueueReport'][_0x7ac0('0x2f')]);_0x2ff144['query']=_[_0x7ac0('0x34')](_0x5ab2e1['query']);_0x2ff144[_0x7ac0('0x35')]=_[_0x7ac0('0x37')](_0x2ff144['model'],_0x2ff144[_0x7ac0('0x33')]);_0x4dddc2[_0x7ac0('0x36')]=_['intersection'](_0x2ff144[_0x7ac0('0x31')],qs[_0x7ac0('0x48')](_0x5ab2e1[_0x7ac0('0x33')][_0x7ac0('0x48')]));_0x4dddc2[_0x7ac0('0x36')]=_0x4dddc2[_0x7ac0('0x36')][_0x7ac0('0x38')]?_0x4dddc2['attributes']:_0x2ff144['model'];if(_0x5ab2e1['query']['includeAll']){_0x4dddc2[_0x7ac0('0x49')]=[{'all':!![]}];}_0x4dddc2=_[_0x7ac0('0x4a')]({},_0x4dddc2,_0x5ab2e1[_0x7ac0('0x42')]);return db[_0x7ac0('0x2e')][_0x7ac0('0x4b')](_0x4dddc2)[_0x7ac0('0x28')](handleEntityNotFound(_0x26e32e,null))[_0x7ac0('0x28')](respondWithResult(_0x26e32e,null))['catch'](handleError(_0x26e32e,null));};exports[_0x7ac0('0x4c')]=function(_0x3e48d5,_0x52bd85){return db[_0x7ac0('0x2e')][_0x7ac0('0x4c')](_0x3e48d5[_0x7ac0('0x4d')],{})[_0x7ac0('0x28')](respondWithResult(_0x52bd85,0xc9))['catch'](handleError(_0x52bd85,null));};exports['update']=function(_0x2bb227,_0x2504f3){if(_0x2bb227[_0x7ac0('0x4d')]['id']){delete _0x2bb227[_0x7ac0('0x4d')]['id'];}return db[_0x7ac0('0x2e')]['find']({'where':{'id':_0x2bb227['params']['id']}})[_0x7ac0('0x28')](handleEntityNotFound(_0x2504f3,null))['then'](saveUpdates(_0x2bb227[_0x7ac0('0x4d')],null))[_0x7ac0('0x28')](respondWithResult(_0x2504f3,null))[_0x7ac0('0x45')](handleError(_0x2504f3,null));};exports[_0x7ac0('0x29')]=function(_0x34e49e,_0x71340b){return db[_0x7ac0('0x2e')]['find']({'where':{'id':_0x34e49e[_0x7ac0('0x47')]['id']}})[_0x7ac0('0x28')](handleEntityNotFound(_0x71340b,null))[_0x7ac0('0x28')](removeEntity(_0x71340b,null))['catch'](handleError(_0x71340b,null));};exports['describe']=function(_0xbbb2c2,_0x1194b2){return db['OpenchannelQueueReport']['describe']()[_0x7ac0('0x28')](respondWithResult(_0x1194b2,null))[_0x7ac0('0x45')](handleError(_0x1194b2,null));}; \ No newline at end of file +var _0xcff9=['save','update','destroy','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','rimraf','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject'];(function(_0x3ae4bc,_0x464d05){var _0x4d20c0=function(_0x209e49){while(--_0x209e49){_0x3ae4bc['push'](_0x3ae4bc['shift']());}};_0x4d20c0(++_0x464d05);}(_0xcff9,0x146));var _0x9cff=function(_0x47c7bf,_0x569d29){_0x47c7bf=_0x47c7bf-0x0;var _0x178d0e=_0xcff9[_0x47c7bf];return _0x178d0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9cff('0x1'));var moment=require(_0x9cff('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9cff('0x3'));var sox=require(_0x9cff('0x4'));var csv=require(_0x9cff('0x5'));var ejs=require(_0x9cff('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cff('0x7'));var squel=require('squel');var crypto=require(_0x9cff('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9cff('0x9'));var toCsv=require(_0x9cff('0x5'));var querystring=require(_0x9cff('0xa'));var Papa=require('papaparse');var Redis=require(_0x9cff('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9cff('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cff('0xd'));var logger=require(_0x9cff('0xe'))('api');var utils=require(_0x9cff('0xf'));var config=require(_0x9cff('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cff('0x11'))['db'];function respondWithStatusCode(_0x2d141d,_0x262e8f){_0x262e8f=_0x262e8f||0xcc;return function(_0x1cb27d){if(_0x1cb27d){return _0x2d141d[_0x9cff('0x12')](_0x262e8f);}return _0x2d141d[_0x9cff('0x13')](_0x262e8f)[_0x9cff('0x14')]();};}function respondWithResult(_0x155563,_0x3ded0d){_0x3ded0d=_0x3ded0d||0xc8;return function(_0x6867e1){if(_0x6867e1){return _0x155563[_0x9cff('0x13')](_0x3ded0d)['json'](_0x6867e1);}};}function respondWithFilteredResult(_0x2dff4f,_0x31fd44){return function(_0x472a8){if(_0x472a8){var _0x118b60=typeof _0x31fd44[_0x9cff('0x15')]===_0x9cff('0x16')&&typeof _0x31fd44['limit']===_0x9cff('0x16');var _0x5cf096=_0x472a8[_0x9cff('0x17')];var _0x30f026=_0x118b60?0x0:_0x31fd44['offset'];var _0x3783fc=_0x118b60?_0x472a8['count']:_0x31fd44[_0x9cff('0x15')]+_0x31fd44[_0x9cff('0x18')];var _0x4748f2;if(_0x3783fc>=_0x5cf096){_0x3783fc=_0x5cf096;_0x4748f2=0xc8;}else{_0x4748f2=0xce;}_0x2dff4f[_0x9cff('0x13')](_0x4748f2);return _0x2dff4f[_0x9cff('0x19')]('Content-Range',_0x30f026+'-'+_0x3783fc+'/'+_0x5cf096)[_0x9cff('0x1a')](_0x472a8);}return null;};}function patchUpdates(_0x56a2de){return function(_0x57c343){try{jsonpatch[_0x9cff('0x1b')](_0x57c343,_0x56a2de,!![]);}catch(_0x8464b7){return BPromise[_0x9cff('0x1c')](_0x8464b7);}return _0x57c343[_0x9cff('0x1d')]();};}function saveUpdates(_0x330674,_0x18565a){return function(_0x3312d9){if(_0x3312d9){return _0x3312d9[_0x9cff('0x1e')](_0x330674)['then'](function(_0xd6c5be){return _0xd6c5be;});}return null;};}function removeEntity(_0x43b305,_0x28fa23){return function(_0x4da0d5){if(_0x4da0d5){return _0x4da0d5[_0x9cff('0x1f')]()[_0x9cff('0x20')](function(){_0x43b305[_0x9cff('0x13')](0xcc)[_0x9cff('0x14')]();});}};}function handleEntityNotFound(_0x1480b8,_0x28b7cb){return function(_0x2ef42c){if(!_0x2ef42c){_0x1480b8[_0x9cff('0x12')](0x194);}return _0x2ef42c;};}function handleError(_0x556949,_0x2b96b8){_0x2b96b8=_0x2b96b8||0x1f4;return function(_0x396d81){logger[_0x9cff('0x21')](_0x396d81['stack']);if(_0x396d81[_0x9cff('0x22')]){delete _0x396d81[_0x9cff('0x22')];}_0x556949['status'](_0x2b96b8)[_0x9cff('0x23')](_0x396d81);};}exports[_0x9cff('0x24')]=function(_0x2aaa56,_0x571795){var _0x139b95={},_0x46fb5e={},_0x30f7d5={'count':0x0,'rows':[]};var _0x2c2bbd=_[_0x9cff('0x25')](db[_0x9cff('0x26')][_0x9cff('0x27')],function(_0x9c0f43){return{'name':_0x9c0f43[_0x9cff('0x28')],'type':_0x9c0f43[_0x9cff('0x29')][_0x9cff('0x2a')]};});_0x46fb5e['model']=_['map'](_0x2c2bbd,_0x9cff('0x22'));_0x46fb5e[_0x9cff('0x2b')]=_[_0x9cff('0x2c')](_0x2aaa56[_0x9cff('0x2b')]);_0x46fb5e[_0x9cff('0x2d')]=_[_0x9cff('0x2e')](_0x46fb5e[_0x9cff('0x2f')],_0x46fb5e[_0x9cff('0x2b')]);_0x139b95['attributes']=_[_0x9cff('0x2e')](_0x46fb5e[_0x9cff('0x2f')],qs[_0x9cff('0x30')](_0x2aaa56[_0x9cff('0x2b')]['fields']));_0x139b95['attributes']=_0x139b95[_0x9cff('0x31')][_0x9cff('0x32')]?_0x139b95[_0x9cff('0x31')]:_0x46fb5e[_0x9cff('0x2f')];if(!_0x2aaa56[_0x9cff('0x2b')][_0x9cff('0x33')](_0x9cff('0x34'))){_0x139b95[_0x9cff('0x18')]=qs[_0x9cff('0x18')](_0x2aaa56[_0x9cff('0x2b')][_0x9cff('0x18')]);_0x139b95[_0x9cff('0x15')]=qs[_0x9cff('0x15')](_0x2aaa56[_0x9cff('0x2b')][_0x9cff('0x15')]);}_0x139b95[_0x9cff('0x35')]=qs[_0x9cff('0x36')](_0x2aaa56[_0x9cff('0x2b')][_0x9cff('0x36')]);_0x139b95['where']=qs[_0x9cff('0x2d')](_[_0x9cff('0x37')](_0x2aaa56['query'],_0x46fb5e[_0x9cff('0x2d')]),_0x2c2bbd);if(_0x2aaa56['query'][_0x9cff('0x38')]){_0x139b95[_0x9cff('0x39')]=_[_0x9cff('0x3a')](_0x139b95[_0x9cff('0x39')],{'$or':_[_0x9cff('0x25')](_0x2c2bbd,function(_0x343df1){if(_0x343df1[_0x9cff('0x29')]!==_0x9cff('0x3b')){var _0x3a771d={};_0x3a771d[_0x343df1[_0x9cff('0x22')]]={'$like':'%'+_0x2aaa56['query'][_0x9cff('0x38')]+'%'};return _0x3a771d;}})});}_0x139b95=_[_0x9cff('0x3a')]({},_0x139b95,_0x2aaa56[_0x9cff('0x3c')]);var _0x2e746d={'where':_0x139b95[_0x9cff('0x39')]};return db['OpenchannelQueueReport'][_0x9cff('0x17')](_0x2e746d)['then'](function(_0x51e364){_0x30f7d5[_0x9cff('0x17')]=_0x51e364;if(_0x2aaa56[_0x9cff('0x2b')][_0x9cff('0x3d')]){_0x139b95[_0x9cff('0x3e')]=[{'all':!![]}];}return db[_0x9cff('0x26')][_0x9cff('0x3f')](_0x139b95);})['then'](function(_0x15c3c0){_0x30f7d5[_0x9cff('0x40')]=_0x15c3c0;return _0x30f7d5;})[_0x9cff('0x20')](respondWithFilteredResult(_0x571795,_0x139b95))['catch'](handleError(_0x571795,null));};exports[_0x9cff('0x41')]=function(_0x1be404,_0x45ba85){var _0x2661d5={'raw':!![],'where':{'id':_0x1be404[_0x9cff('0x42')]['id']}},_0x1ac729={};_0x1ac729[_0x9cff('0x2f')]=_[_0x9cff('0x2c')](db[_0x9cff('0x26')][_0x9cff('0x27')]);_0x1ac729['query']=_[_0x9cff('0x2c')](_0x1be404[_0x9cff('0x2b')]);_0x1ac729[_0x9cff('0x2d')]=_['intersection'](_0x1ac729[_0x9cff('0x2f')],_0x1ac729[_0x9cff('0x2b')]);_0x2661d5['attributes']=_[_0x9cff('0x2e')](_0x1ac729['model'],qs[_0x9cff('0x30')](_0x1be404[_0x9cff('0x2b')][_0x9cff('0x30')]));_0x2661d5[_0x9cff('0x31')]=_0x2661d5[_0x9cff('0x31')][_0x9cff('0x32')]?_0x2661d5[_0x9cff('0x31')]:_0x1ac729[_0x9cff('0x2f')];if(_0x1be404[_0x9cff('0x2b')][_0x9cff('0x3d')]){_0x2661d5['include']=[{'all':!![]}];}_0x2661d5=_[_0x9cff('0x3a')]({},_0x2661d5,_0x1be404[_0x9cff('0x3c')]);return db[_0x9cff('0x26')]['find'](_0x2661d5)[_0x9cff('0x20')](handleEntityNotFound(_0x45ba85,null))[_0x9cff('0x20')](respondWithResult(_0x45ba85,null))[_0x9cff('0x43')](handleError(_0x45ba85,null));};exports[_0x9cff('0x44')]=function(_0x5bce91,_0x23358e){return db[_0x9cff('0x26')]['create'](_0x5bce91[_0x9cff('0x45')],{})[_0x9cff('0x20')](respondWithResult(_0x23358e,0xc9))[_0x9cff('0x43')](handleError(_0x23358e,null));};exports[_0x9cff('0x1e')]=function(_0x1abecb,_0x45900c){if(_0x1abecb[_0x9cff('0x45')]['id']){delete _0x1abecb['body']['id'];}return db['OpenchannelQueueReport'][_0x9cff('0x46')]({'where':{'id':_0x1abecb[_0x9cff('0x42')]['id']}})[_0x9cff('0x20')](handleEntityNotFound(_0x45900c,null))[_0x9cff('0x20')](saveUpdates(_0x1abecb[_0x9cff('0x45')],null))[_0x9cff('0x20')](respondWithResult(_0x45900c,null))[_0x9cff('0x43')](handleError(_0x45900c,null));};exports[_0x9cff('0x1f')]=function(_0xdea954,_0x1fbd80){return db[_0x9cff('0x26')]['find']({'where':{'id':_0xdea954[_0x9cff('0x42')]['id']}})[_0x9cff('0x20')](handleEntityNotFound(_0x1fbd80,null))['then'](removeEntity(_0x1fbd80,null))['catch'](handleError(_0x1fbd80,null));};exports['describe']=function(_0xe30a73,_0xaf5c8c){return db['OpenchannelQueueReport']['describe']()[_0x9cff('0x20')](respondWithResult(_0xaf5c8c,null))[_0x9cff('0x43')](handleError(_0xaf5c8c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 82db984..8d87ac1 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x814b,0x1a2));var _0xb814=function(_0x251fa4,_0x3d5860){_0x251fa4=_0x251fa4-0x0;var _0x453047=_0x814b[_0x251fa4];return _0x453047;};'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 +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x40a66e,_0x2d348a){var _0x4d0369=function(_0x4c54a2){while(--_0x4c54a2){_0x40a66e['push'](_0x40a66e['shift']());}};_0x4d0369(++_0x2d348a);}(_0x7a54,0x106));var _0x47a5=function(_0x19184c,_0xbcb523){_0x19184c=_0x19184c-0x0;var _0x44d019=_0x7a54[_0x19184c];return _0x44d019;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 795d171..ed4b84e 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 _0x4f7b=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','raw','CreateOpenchannelQueueReport','debug','UpdateOpenchannelQueueReport','update','options'];(function(_0x46eecf,_0x5a8390){var _0x2fcda8=function(_0x58c7f3){while(--_0x58c7f3){_0x46eecf['push'](_0x46eecf['shift']());}};_0x2fcda8(++_0x5a8390);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x225980,_0x4ff7d6){_0x225980=_0x225980-0x0;var _0x5684c7=_0x4f7b[_0x225980];return _0x5684c7;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}exports['CreateOpenchannelQueueReport']=function(_0x53b135){var _0x3a78b7=this;return new Promise(function(_0x22e273,_0x4b93fc){return db[_0xb4f7('0x17')][_0xb4f7('0x18')](_0x53b135[_0xb4f7('0x19')],{'raw':_0x53b135['options']?_0x53b135['options'][_0xb4f7('0x1a')]===undefined?!![]:![]:!![]})[_0xb4f7('0xc')](function(_0x5cc40e){logger[_0xb4f7('0xd')](_0xb4f7('0x1b'),_0x53b135);logger[_0xb4f7('0x1c')](_0xb4f7('0x1b'),_0x53b135,JSON['stringify'](_0x5cc40e));_0x22e273(_0x5cc40e);})[_0xb4f7('0x16')](function(_0x56bac5){logger[_0xb4f7('0x12')](_0xb4f7('0x1b'),_0x56bac5[_0xb4f7('0x14')],_0x53b135);_0x4b93fc(_0x3a78b7[_0xb4f7('0x12')](0x1f4,_0x56bac5[_0xb4f7('0x14')]));});});};exports[_0xb4f7('0x1d')]=function(_0x493d81){var _0x1fe0cf=this;return new Promise(function(_0x291166,_0x19e549){return db[_0xb4f7('0x17')][_0xb4f7('0x1e')](_0x493d81[_0xb4f7('0x19')],{'raw':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493d81[_0xb4f7('0x1f')]?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x20')]||null:null,'attributes':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x21')]||null:null,'limit':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x22')]||null:null})[_0xb4f7('0xc')](function(_0x35582a){logger['info'](_0xb4f7('0x1d'),_0x493d81);logger[_0xb4f7('0x1c')](_0xb4f7('0x1d'),_0x493d81,JSON[_0xb4f7('0x11')](_0x35582a));_0x291166(_0x35582a);})['catch'](function(_0x4ea802){logger[_0xb4f7('0x12')]('UpdateOpenchannelQueueReport',_0x4ea802[_0xb4f7('0x14')],_0x493d81);_0x19e549(_0x1fe0cf[_0xb4f7('0x12')](0x1f4,_0x4ea802['message']));});});}; \ No newline at end of file +var _0xd7d1=['update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','debug','UpdateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x597f3b,_0x293b61){var _0x1f6f69=function(_0x29a115){while(--_0x29a115){_0x597f3b['push'](_0x597f3b['shift']());}};_0x1f6f69(++_0x293b61);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x3ff6b4,_0x32d3be){_0x3ff6b4=_0x3ff6b4-0x0;var _0x2063a9=_0xd7d1[_0x3ff6b4];return _0x2063a9;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['OpenchannelQueueReport'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![]})[_0x1d7d('0xe')](function(_0x54d401){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x1e')]('CreateOpenchannelQueueReport',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x54d401));_0x191024(_0x54d401);})[_0x1d7d('0x18')](function(_0x4a1cdc){logger['error'](_0x1d7d('0x19'),_0x4a1cdc[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x4a1cdc['message']));});});};exports[_0x1d7d('0x1f')]=function(_0x106376){var _0x2d4c0c=this;return new Promise(function(_0x21e59,_0x4fa346){return db[_0x1d7d('0x20')][_0x1d7d('0x21')](_0x106376['body'],{'raw':_0x106376['options']?_0x106376[_0x1d7d('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106376[_0x1d7d('0x1c')]?_0x106376[_0x1d7d('0x1c')][_0x1d7d('0x22')]||null:null,'attributes':_0x106376[_0x1d7d('0x1c')]?_0x106376[_0x1d7d('0x1c')]['attributes']||null:null,'limit':_0x106376[_0x1d7d('0x1c')]?_0x106376[_0x1d7d('0x1c')][_0x1d7d('0x23')]||null:null})['then'](function(_0x78adbe){logger[_0x1d7d('0xf')](_0x1d7d('0x1f'),_0x106376);logger['debug']('UpdateOpenchannelQueueReport',_0x106376,JSON['stringify'](_0x78adbe));_0x21e59(_0x78adbe);})[_0x1d7d('0x18')](function(_0x329f56){logger['error'](_0x1d7d('0x1f'),_0x329f56[_0x1d7d('0x16')],_0x106376);_0x4fa346(_0x2d4c0c[_0x1d7d('0x14')](0x1f4,_0x329f56[_0x1d7d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 76daa20..7b75272 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 _0x8b89=['update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x50e7f9,_0x363b65){var _0x2f2fad=function(_0x53dc47){while(--_0x53dc47){_0x50e7f9['push'](_0x50e7f9['shift']());}};_0x2f2fad(++_0x363b65);}(_0x8b89,0x17e));var _0x98b8=function(_0x1dc78e,_0x3eb207){_0x1dc78e=_0x1dc78e-0x0;var _0x26b975=_0x8b89[_0x1dc78e];return _0x26b975;};'use strict';var multer=require(_0x98b8('0x0'));var util=require('util');var path=require(_0x98b8('0x1'));var timeout=require(_0x98b8('0x2'));var express=require('express');var router=express[_0x98b8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x98b8('0x4'));var interaction=require(_0x98b8('0x5'));var config=require(_0x98b8('0x6'));var controller=require(_0x98b8('0x7'));router[_0x98b8('0x8')]('/',auth[_0x98b8('0x9')](),controller[_0x98b8('0xa')]);router[_0x98b8('0x8')]('/describe',auth[_0x98b8('0x9')](),controller[_0x98b8('0xb')]);router[_0x98b8('0x8')](_0x98b8('0xc'),auth['isAuthenticated'](),controller[_0x98b8('0xd')]);router[_0x98b8('0xe')]('/',auth['isAuthenticated'](),controller[_0x98b8('0xf')]);router[_0x98b8('0x10')](_0x98b8('0xc'),auth[_0x98b8('0x9')](),controller[_0x98b8('0x11')]);router[_0x98b8('0x12')](_0x98b8('0xc'),auth[_0x98b8('0x9')](),controller[_0x98b8('0x13')]);module[_0x98b8('0x14')]=router; \ No newline at end of file +var _0x4184=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x4184,0xbf));var _0x4418=function(_0x8960c7,_0x42dc05){_0x8960c7=_0x8960c7-0x0;var _0x465deb=_0x4184[_0x8960c7];return _0x465deb;};'use strict';var multer=require(_0x4418('0x0'));var util=require('util');var path=require(_0x4418('0x1'));var timeout=require(_0x4418('0x2'));var express=require(_0x4418('0x3'));var router=express[_0x4418('0x4')]();var fs_extra=require(_0x4418('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4418('0x6'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x4418('0x7')](),controller[_0x4418('0x8')]);router[_0x4418('0x9')]('/describe',auth[_0x4418('0x7')](),controller[_0x4418('0xa')]);router[_0x4418('0x9')](_0x4418('0xb'),auth[_0x4418('0x7')](),controller[_0x4418('0xc')]);router[_0x4418('0xd')]('/',auth[_0x4418('0x7')](),controller[_0x4418('0xe')]);router[_0x4418('0xf')](_0x4418('0xb'),auth[_0x4418('0x7')](),controller[_0x4418('0x10')]);router[_0x4418('0x11')](_0x4418('0xb'),auth[_0x4418('0x7')](),controller[_0x4418('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index fa0e743..962b5b1 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x197701,_0x205367){var _0x417673=function(_0x588bbe){while(--_0x588bbe){_0x197701['push'](_0x197701['shift']());}};_0x417673(++_0x205367);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x4b84[_0x2bf466];return _0x856885;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5f18bf,_0x4cfffc){var _0x3b3776=function(_0x5e8b51){while(--_0x5e8b51){_0x5f18bf['push'](_0x5f18bf['shift']());}};_0x3b3776(++_0x4cfffc);}(_0xf4eb,0xec));var _0xbf4e=function(_0x27b10b,_0x44a949){_0x27b10b=_0x27b10b-0x0;var _0x1aa26b=_0xf4eb[_0x27b10b];return _0x1aa26b;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 4474aaf..504dd9e 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 _0xa5c5=['ejs','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','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','end','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','then','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv'];(function(_0x44ec18,_0x189bca){var _0x1e33d3=function(_0x45c87e){while(--_0x45c87e){_0x44ec18['push'](_0x44ec18['shift']());}};_0x1e33d3(++_0x189bca);}(_0xa5c5,0x1cc));var _0x5a5c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa5c5[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a5c('0x0'));var zipdir=require(_0x5a5c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a5c('0x2'));var moment=require(_0x5a5c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5a5c('0x4'));var util=require(_0x5a5c('0x5'));var path=require('path');var sox=require(_0x5a5c('0x6'));var csv=require(_0x5a5c('0x7'));var ejs=require(_0x5a5c('0x8'));var fs=require('fs');var fs_extra=require(_0x5a5c('0x9'));var _=require('lodash');var squel=require(_0x5a5c('0xa'));var crypto=require(_0x5a5c('0xb'));var jsforce=require(_0x5a5c('0xc'));var deskjs=require(_0x5a5c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5a5c('0xe'));var Papa=require(_0x5a5c('0xf'));var Redis=require(_0x5a5c('0x10'));var authService=require(_0x5a5c('0x11'));var qs=require(_0x5a5c('0x12'));var as=require(_0x5a5c('0x13'));var hardwareService=require(_0x5a5c('0x14'));var logger=require('../../config/logger')(_0x5a5c('0x15'));var utils=require(_0x5a5c('0x16'));var config=require(_0x5a5c('0x17'));var licenseUtil=require(_0x5a5c('0x18'));var db=require(_0x5a5c('0x19'))['db'];function respondWithStatusCode(_0x5bbcc7,_0x259df7){_0x259df7=_0x259df7||0xcc;return function(_0x414098){if(_0x414098){return _0x5bbcc7[_0x5a5c('0x1a')](_0x259df7);}return _0x5bbcc7[_0x5a5c('0x1b')](_0x259df7)['end']();};}function respondWithResult(_0x129444,_0x368adf){_0x368adf=_0x368adf||0xc8;return function(_0x5d77f5){if(_0x5d77f5){return _0x129444[_0x5a5c('0x1b')](_0x368adf)[_0x5a5c('0x1c')](_0x5d77f5);}};}function respondWithFilteredResult(_0x3bd677,_0x39fe69){return function(_0xbdc9b5){if(_0xbdc9b5){var _0x2a8d14=typeof _0x39fe69['offset']===_0x5a5c('0x1d')&&typeof _0x39fe69[_0x5a5c('0x1e')]==='undefined';var _0x233e0c=_0xbdc9b5[_0x5a5c('0x1f')];var _0x56bdac=_0x2a8d14?0x0:_0x39fe69[_0x5a5c('0x20')];var _0x3d0d60=_0x2a8d14?_0xbdc9b5['count']:_0x39fe69[_0x5a5c('0x20')]+_0x39fe69[_0x5a5c('0x1e')];var _0xee928a;if(_0x3d0d60>=_0x233e0c){_0x3d0d60=_0x233e0c;_0xee928a=0xc8;}else{_0xee928a=0xce;}_0x3bd677[_0x5a5c('0x1b')](_0xee928a);return _0x3bd677[_0x5a5c('0x21')](_0x5a5c('0x22'),_0x56bdac+'-'+_0x3d0d60+'/'+_0x233e0c)[_0x5a5c('0x1c')](_0xbdc9b5);}return null;};}function patchUpdates(_0x4ca284){return function(_0x1909f9){try{jsonpatch[_0x5a5c('0x23')](_0x1909f9,_0x4ca284,!![]);}catch(_0x4fd783){return BPromise[_0x5a5c('0x24')](_0x4fd783);}return _0x1909f9['save']();};}function saveUpdates(_0x59e4fd,_0x1f0f7f){return function(_0x3004fb){if(_0x3004fb){return _0x3004fb['update'](_0x59e4fd)['then'](function(_0x455db3){return _0x455db3;});}return null;};}function removeEntity(_0x366126,_0x40d543){return function(_0x1eb8f3){if(_0x1eb8f3){return _0x1eb8f3[_0x5a5c('0x25')]()['then'](function(){_0x366126[_0x5a5c('0x1b')](0xcc)[_0x5a5c('0x26')]();});}};}function handleEntityNotFound(_0x73d2f8,_0x498179){return function(_0x4211a3){if(!_0x4211a3){_0x73d2f8[_0x5a5c('0x1a')](0x194);}return _0x4211a3;};}function handleError(_0x59cd39,_0x5643ae){_0x5643ae=_0x5643ae||0x1f4;return function(_0x50360d){logger[_0x5a5c('0x27')](_0x50360d[_0x5a5c('0x28')]);if(_0x50360d[_0x5a5c('0x29')]){delete _0x50360d['name'];}_0x59cd39[_0x5a5c('0x1b')](_0x5643ae)[_0x5a5c('0x2a')](_0x50360d);};}exports[_0x5a5c('0x2b')]=function(_0x378eee,_0x27f7fa){var _0x3527ba={},_0x4ec44c={},_0x567678={'count':0x0,'rows':[]};var _0x4a1a61=_[_0x5a5c('0x2c')](db[_0x5a5c('0x2d')]['rawAttributes'],function(_0x464e8c){return{'name':_0x464e8c[_0x5a5c('0x2e')],'type':_0x464e8c[_0x5a5c('0x2f')]['key']};});_0x4ec44c[_0x5a5c('0x30')]=_['map'](_0x4a1a61,_0x5a5c('0x29'));_0x4ec44c[_0x5a5c('0x31')]=_['keys'](_0x378eee[_0x5a5c('0x31')]);_0x4ec44c[_0x5a5c('0x32')]=_[_0x5a5c('0x33')](_0x4ec44c[_0x5a5c('0x30')],_0x4ec44c[_0x5a5c('0x31')]);_0x3527ba['attributes']=_[_0x5a5c('0x33')](_0x4ec44c[_0x5a5c('0x30')],qs[_0x5a5c('0x34')](_0x378eee['query'][_0x5a5c('0x34')]));_0x3527ba[_0x5a5c('0x35')]=_0x3527ba[_0x5a5c('0x35')][_0x5a5c('0x36')]?_0x3527ba['attributes']:_0x4ec44c[_0x5a5c('0x30')];if(!_0x378eee[_0x5a5c('0x31')][_0x5a5c('0x37')](_0x5a5c('0x38'))){_0x3527ba[_0x5a5c('0x1e')]=qs[_0x5a5c('0x1e')](_0x378eee[_0x5a5c('0x31')][_0x5a5c('0x1e')]);_0x3527ba['offset']=qs['offset'](_0x378eee[_0x5a5c('0x31')][_0x5a5c('0x20')]);}_0x3527ba[_0x5a5c('0x39')]=qs[_0x5a5c('0x3a')](_0x378eee[_0x5a5c('0x31')][_0x5a5c('0x3a')]);_0x3527ba[_0x5a5c('0x3b')]=qs['filters'](_[_0x5a5c('0x3c')](_0x378eee[_0x5a5c('0x31')],_0x4ec44c[_0x5a5c('0x32')]),_0x4a1a61);if(_0x378eee[_0x5a5c('0x31')]['filter']){_0x3527ba['where']=_['merge'](_0x3527ba['where'],{'$or':_[_0x5a5c('0x2c')](_0x4a1a61,function(_0x229ca2){if(_0x229ca2[_0x5a5c('0x2f')]!==_0x5a5c('0x3d')){var _0x51a113={};_0x51a113[_0x229ca2[_0x5a5c('0x29')]]={'$like':'%'+_0x378eee[_0x5a5c('0x31')][_0x5a5c('0x3e')]+'%'};return _0x51a113;}})});}_0x3527ba=_[_0x5a5c('0x3f')]({},_0x3527ba,_0x378eee[_0x5a5c('0x40')]);var _0x47b013={'where':_0x3527ba[_0x5a5c('0x3b')]};return db['OpenchannelTransferReport'][_0x5a5c('0x1f')](_0x47b013)[_0x5a5c('0x41')](function(_0x1fa0df){_0x567678[_0x5a5c('0x1f')]=_0x1fa0df;if(_0x378eee[_0x5a5c('0x31')][_0x5a5c('0x42')]){_0x3527ba[_0x5a5c('0x43')]=[{'all':!![]}];}return db[_0x5a5c('0x2d')][_0x5a5c('0x44')](_0x3527ba);})[_0x5a5c('0x41')](function(_0x16d5db){_0x567678[_0x5a5c('0x45')]=_0x16d5db;return _0x567678;})[_0x5a5c('0x41')](respondWithFilteredResult(_0x27f7fa,_0x3527ba))[_0x5a5c('0x46')](handleError(_0x27f7fa,null));};exports['show']=function(_0x30f867,_0x20f539){var _0x39937e={'raw':!![],'where':{'id':_0x30f867[_0x5a5c('0x47')]['id']}},_0x58098c={};_0x58098c['model']=_[_0x5a5c('0x48')](db[_0x5a5c('0x2d')]['rawAttributes']);_0x58098c[_0x5a5c('0x31')]=_['keys'](_0x30f867[_0x5a5c('0x31')]);_0x58098c[_0x5a5c('0x32')]=_[_0x5a5c('0x33')](_0x58098c['model'],_0x58098c['query']);_0x39937e[_0x5a5c('0x35')]=_[_0x5a5c('0x33')](_0x58098c['model'],qs['fields'](_0x30f867[_0x5a5c('0x31')][_0x5a5c('0x34')]));_0x39937e[_0x5a5c('0x35')]=_0x39937e[_0x5a5c('0x35')]['length']?_0x39937e[_0x5a5c('0x35')]:_0x58098c[_0x5a5c('0x30')];if(_0x30f867[_0x5a5c('0x31')][_0x5a5c('0x42')]){_0x39937e[_0x5a5c('0x43')]=[{'all':!![]}];}_0x39937e=_[_0x5a5c('0x3f')]({},_0x39937e,_0x30f867['options']);return db[_0x5a5c('0x2d')][_0x5a5c('0x49')](_0x39937e)[_0x5a5c('0x41')](handleEntityNotFound(_0x20f539,null))[_0x5a5c('0x41')](respondWithResult(_0x20f539,null))[_0x5a5c('0x46')](handleError(_0x20f539,null));};exports[_0x5a5c('0x4a')]=function(_0xdda4b2,_0x5059e4){return db[_0x5a5c('0x2d')][_0x5a5c('0x4a')](_0xdda4b2[_0x5a5c('0x4b')],{})[_0x5a5c('0x41')](respondWithResult(_0x5059e4,0xc9))[_0x5a5c('0x46')](handleError(_0x5059e4,null));};exports[_0x5a5c('0x4c')]=function(_0x2a5276,_0x5af94f){if(_0x2a5276[_0x5a5c('0x4b')]['id']){delete _0x2a5276[_0x5a5c('0x4b')]['id'];}return db[_0x5a5c('0x2d')][_0x5a5c('0x49')]({'where':{'id':_0x2a5276[_0x5a5c('0x47')]['id']}})['then'](handleEntityNotFound(_0x5af94f,null))[_0x5a5c('0x41')](saveUpdates(_0x2a5276['body'],null))['then'](respondWithResult(_0x5af94f,null))['catch'](handleError(_0x5af94f,null));};exports[_0x5a5c('0x25')]=function(_0x223697,_0x2169bb){return db['OpenchannelTransferReport'][_0x5a5c('0x49')]({'where':{'id':_0x223697[_0x5a5c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2169bb,null))[_0x5a5c('0x41')](removeEntity(_0x2169bb,null))[_0x5a5c('0x46')](handleError(_0x2169bb,null));};exports[_0x5a5c('0x4d')]=function(_0x2d9ff8,_0x31b5b2){return db[_0x5a5c('0x2d')][_0x5a5c('0x4d')]()[_0x5a5c('0x41')](respondWithResult(_0x31b5b2,null))[_0x5a5c('0x46')](handleError(_0x31b5b2,null));}; \ No newline at end of file +var _0x41ba=['send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x41ba,0x6a));var _0xa41b=function(_0x20e21a,_0x137c51){_0x20e21a=_0x20e21a-0x0;var _0x2b2cb7=_0x41ba[_0x20e21a];return _0x2b2cb7;};'use strict';var emlformat=require(_0xa41b('0x0'));var rimraf=require(_0xa41b('0x1'));var zipdir=require(_0xa41b('0x2'));var jsonpatch=require(_0xa41b('0x3'));var rp=require('request-promise');var moment=require(_0xa41b('0x4'));var BPromise=require(_0xa41b('0x5'));var Mustache=require('mustache');var util=require(_0xa41b('0x6'));var path=require('path');var sox=require(_0xa41b('0x7'));var csv=require(_0xa41b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa41b('0x9'));var _=require('lodash');var squel=require(_0xa41b('0xa'));var crypto=require(_0xa41b('0xb'));var jsforce=require(_0xa41b('0xc'));var deskjs=require(_0xa41b('0xd'));var toCsv=require(_0xa41b('0x8'));var querystring=require('querystring');var Papa=require(_0xa41b('0xe'));var Redis=require(_0xa41b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa41b('0x10'));var as=require(_0xa41b('0x11'));var hardwareService=require(_0xa41b('0x12'));var logger=require(_0xa41b('0x13'))(_0xa41b('0x14'));var utils=require(_0xa41b('0x15'));var config=require(_0xa41b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa41b('0x17'))['db'];function respondWithStatusCode(_0x1f7beb,_0x1ac478){_0x1ac478=_0x1ac478||0xcc;return function(_0x8c8a41){if(_0x8c8a41){return _0x1f7beb[_0xa41b('0x18')](_0x1ac478);}return _0x1f7beb[_0xa41b('0x19')](_0x1ac478)[_0xa41b('0x1a')]();};}function respondWithResult(_0x4d08cc,_0x59b83b){_0x59b83b=_0x59b83b||0xc8;return function(_0xbff070){if(_0xbff070){return _0x4d08cc[_0xa41b('0x19')](_0x59b83b)[_0xa41b('0x1b')](_0xbff070);}};}function respondWithFilteredResult(_0xfcb468,_0x1f35f7){return function(_0x437a9b){if(_0x437a9b){var _0x427eec=typeof _0x1f35f7[_0xa41b('0x1c')]===_0xa41b('0x1d')&&typeof _0x1f35f7[_0xa41b('0x1e')]==='undefined';var _0x239c76=_0x437a9b[_0xa41b('0x1f')];var _0x29b749=_0x427eec?0x0:_0x1f35f7[_0xa41b('0x1c')];var _0x4f870f=_0x427eec?_0x437a9b[_0xa41b('0x1f')]:_0x1f35f7[_0xa41b('0x1c')]+_0x1f35f7[_0xa41b('0x1e')];var _0x422ae6;if(_0x4f870f>=_0x239c76){_0x4f870f=_0x239c76;_0x422ae6=0xc8;}else{_0x422ae6=0xce;}_0xfcb468[_0xa41b('0x19')](_0x422ae6);return _0xfcb468[_0xa41b('0x20')](_0xa41b('0x21'),_0x29b749+'-'+_0x4f870f+'/'+_0x239c76)[_0xa41b('0x1b')](_0x437a9b);}return null;};}function patchUpdates(_0x370136){return function(_0x3b5f89){try{jsonpatch['apply'](_0x3b5f89,_0x370136,!![]);}catch(_0x2362dc){return BPromise['reject'](_0x2362dc);}return _0x3b5f89[_0xa41b('0x22')]();};}function saveUpdates(_0x3567b6,_0x139366){return function(_0x55f56d){if(_0x55f56d){return _0x55f56d[_0xa41b('0x23')](_0x3567b6)[_0xa41b('0x24')](function(_0x1f9f94){return _0x1f9f94;});}return null;};}function removeEntity(_0x483cc8,_0x221cbb){return function(_0x552b78){if(_0x552b78){return _0x552b78[_0xa41b('0x25')]()[_0xa41b('0x24')](function(){_0x483cc8[_0xa41b('0x19')](0xcc)[_0xa41b('0x1a')]();});}};}function handleEntityNotFound(_0x4a16bd,_0x4ada96){return function(_0x5615e9){if(!_0x5615e9){_0x4a16bd[_0xa41b('0x18')](0x194);}return _0x5615e9;};}function handleError(_0x591cd4,_0x120a0d){_0x120a0d=_0x120a0d||0x1f4;return function(_0x58bc69){logger[_0xa41b('0x26')](_0x58bc69['stack']);if(_0x58bc69[_0xa41b('0x27')]){delete _0x58bc69[_0xa41b('0x27')];}_0x591cd4[_0xa41b('0x19')](_0x120a0d)[_0xa41b('0x28')](_0x58bc69);};}exports[_0xa41b('0x29')]=function(_0x8443d6,_0x3b218c){var _0x251754={},_0x5ee3cc={},_0x109b4c={'count':0x0,'rows':[]};var _0x45d95c=_[_0xa41b('0x2a')](db[_0xa41b('0x2b')][_0xa41b('0x2c')],function(_0x4066cc){return{'name':_0x4066cc['fieldName'],'type':_0x4066cc['type'][_0xa41b('0x2d')]};});_0x5ee3cc[_0xa41b('0x2e')]=_[_0xa41b('0x2a')](_0x45d95c,_0xa41b('0x27'));_0x5ee3cc['query']=_['keys'](_0x8443d6[_0xa41b('0x2f')]);_0x5ee3cc[_0xa41b('0x30')]=_[_0xa41b('0x31')](_0x5ee3cc[_0xa41b('0x2e')],_0x5ee3cc[_0xa41b('0x2f')]);_0x251754['attributes']=_[_0xa41b('0x31')](_0x5ee3cc['model'],qs[_0xa41b('0x32')](_0x8443d6[_0xa41b('0x2f')][_0xa41b('0x32')]));_0x251754[_0xa41b('0x33')]=_0x251754[_0xa41b('0x33')][_0xa41b('0x34')]?_0x251754[_0xa41b('0x33')]:_0x5ee3cc[_0xa41b('0x2e')];if(!_0x8443d6['query'][_0xa41b('0x35')](_0xa41b('0x36'))){_0x251754[_0xa41b('0x1e')]=qs[_0xa41b('0x1e')](_0x8443d6[_0xa41b('0x2f')][_0xa41b('0x1e')]);_0x251754[_0xa41b('0x1c')]=qs['offset'](_0x8443d6['query'][_0xa41b('0x1c')]);}_0x251754['order']=qs[_0xa41b('0x37')](_0x8443d6[_0xa41b('0x2f')][_0xa41b('0x37')]);_0x251754[_0xa41b('0x38')]=qs['filters'](_[_0xa41b('0x39')](_0x8443d6[_0xa41b('0x2f')],_0x5ee3cc[_0xa41b('0x30')]),_0x45d95c);if(_0x8443d6['query'][_0xa41b('0x3a')]){_0x251754[_0xa41b('0x38')]=_[_0xa41b('0x3b')](_0x251754[_0xa41b('0x38')],{'$or':_[_0xa41b('0x2a')](_0x45d95c,function(_0x2ebae0){if(_0x2ebae0['type']!==_0xa41b('0x3c')){var _0x14a159={};_0x14a159[_0x2ebae0[_0xa41b('0x27')]]={'$like':'%'+_0x8443d6[_0xa41b('0x2f')][_0xa41b('0x3a')]+'%'};return _0x14a159;}})});}_0x251754=_[_0xa41b('0x3b')]({},_0x251754,_0x8443d6[_0xa41b('0x3d')]);var _0x18978f={'where':_0x251754['where']};return db[_0xa41b('0x2b')][_0xa41b('0x1f')](_0x18978f)[_0xa41b('0x24')](function(_0xca66b3){_0x109b4c[_0xa41b('0x1f')]=_0xca66b3;if(_0x8443d6[_0xa41b('0x2f')]['includeAll']){_0x251754['include']=[{'all':!![]}];}return db[_0xa41b('0x2b')][_0xa41b('0x3e')](_0x251754);})[_0xa41b('0x24')](function(_0x28732a){_0x109b4c['rows']=_0x28732a;return _0x109b4c;})[_0xa41b('0x24')](respondWithFilteredResult(_0x3b218c,_0x251754))[_0xa41b('0x3f')](handleError(_0x3b218c,null));};exports[_0xa41b('0x40')]=function(_0x4b8437,_0x463246){var _0x35c248={'raw':!![],'where':{'id':_0x4b8437[_0xa41b('0x41')]['id']}},_0x5a5ded={};_0x5a5ded[_0xa41b('0x2e')]=_[_0xa41b('0x42')](db[_0xa41b('0x2b')][_0xa41b('0x2c')]);_0x5a5ded[_0xa41b('0x2f')]=_[_0xa41b('0x42')](_0x4b8437['query']);_0x5a5ded[_0xa41b('0x30')]=_[_0xa41b('0x31')](_0x5a5ded['model'],_0x5a5ded['query']);_0x35c248[_0xa41b('0x33')]=_[_0xa41b('0x31')](_0x5a5ded[_0xa41b('0x2e')],qs[_0xa41b('0x32')](_0x4b8437[_0xa41b('0x2f')]['fields']));_0x35c248['attributes']=_0x35c248['attributes'][_0xa41b('0x34')]?_0x35c248[_0xa41b('0x33')]:_0x5a5ded[_0xa41b('0x2e')];if(_0x4b8437[_0xa41b('0x2f')][_0xa41b('0x43')]){_0x35c248[_0xa41b('0x44')]=[{'all':!![]}];}_0x35c248=_[_0xa41b('0x3b')]({},_0x35c248,_0x4b8437['options']);return db['OpenchannelTransferReport'][_0xa41b('0x45')](_0x35c248)[_0xa41b('0x24')](handleEntityNotFound(_0x463246,null))['then'](respondWithResult(_0x463246,null))[_0xa41b('0x3f')](handleError(_0x463246,null));};exports[_0xa41b('0x46')]=function(_0x270af9,_0x4c0eb4){return db[_0xa41b('0x2b')][_0xa41b('0x46')](_0x270af9[_0xa41b('0x47')],{})[_0xa41b('0x24')](respondWithResult(_0x4c0eb4,0xc9))[_0xa41b('0x3f')](handleError(_0x4c0eb4,null));};exports[_0xa41b('0x23')]=function(_0x4ec590,_0xbaadc4){if(_0x4ec590[_0xa41b('0x47')]['id']){delete _0x4ec590[_0xa41b('0x47')]['id'];}return db[_0xa41b('0x2b')][_0xa41b('0x45')]({'where':{'id':_0x4ec590[_0xa41b('0x41')]['id']}})[_0xa41b('0x24')](handleEntityNotFound(_0xbaadc4,null))[_0xa41b('0x24')](saveUpdates(_0x4ec590[_0xa41b('0x47')],null))['then'](respondWithResult(_0xbaadc4,null))[_0xa41b('0x3f')](handleError(_0xbaadc4,null));};exports['destroy']=function(_0x2a0085,_0x29c502){return db[_0xa41b('0x2b')][_0xa41b('0x45')]({'where':{'id':_0x2a0085['params']['id']}})[_0xa41b('0x24')](handleEntityNotFound(_0x29c502,null))[_0xa41b('0x24')](removeEntity(_0x29c502,null))[_0xa41b('0x3f')](handleError(_0x29c502,null));};exports[_0xa41b('0x48')]=function(_0x42e505,_0x1971c4){return db['OpenchannelTransferReport'][_0xa41b('0x48')]()[_0xa41b('0x24')](respondWithResult(_0x1971c4,null))[_0xa41b('0x3f')](handleError(_0x1971c4,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 33c4d4a..864f457 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 _0xb446=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb446,0xef));var _0x6b44=function(_0x14e75e,_0x43a34d){_0x14e75e=_0x14e75e-0x0;var _0x5fc83b=_0xb446[_0x14e75e];return _0x5fc83b;};'use strict';var _=require(_0x6b44('0x0'));var util=require(_0x6b44('0x1'));var logger=require(_0x6b44('0x2'))(_0x6b44('0x3'));var moment=require(_0x6b44('0x4'));var BPromise=require(_0x6b44('0x5'));var rp=require(_0x6b44('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b44('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x6b44('0x8')]=function(_0x56fe7e,_0x1527b1){return _0x56fe7e[_0x6b44('0x9')](_0x6b44('0xa'),attributes,{'tableName':_0x6b44('0xb'),'paranoid':![],'indexes':[{'name':_0x6b44('0xc'),'fields':[_0x6b44('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9b5e=['define','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','./openchannelTransferReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b5e,0xd3));var _0xe9b5=function(_0x578c80,_0x3afea8){_0x578c80=_0x578c80-0x0;var _0x13f94e=_0x9b5e[_0x578c80];return _0x13f94e;};'use strict';var _=require(_0xe9b5('0x0'));var util=require(_0xe9b5('0x1'));var logger=require(_0xe9b5('0x2'))(_0xe9b5('0x3'));var moment=require(_0xe9b5('0x4'));var BPromise=require('bluebird');var rp=require(_0xe9b5('0x5'));var fs=require('fs');var path=require(_0xe9b5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9b5('0x7'));module[_0xe9b5('0x8')]=function(_0x4b89bc,_0x28afa1){return _0x4b89bc[_0xe9b5('0x9')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xe9b5('0xa'),'fields':[_0xe9b5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index fa29829..ce4df66 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 _0x4ab0=['jayson/promise','client','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x268ad0,_0x50c35b){var _0x4619ea=function(_0x51b35f){while(--_0x51b35f){_0x268ad0['push'](_0x268ad0['shift']());}};_0x4619ea(++_0x50c35b);}(_0x4ab0,0xd5));var _0x04ab=function(_0x57074f,_0x8996bb){_0x57074f=_0x57074f-0x0;var _0x49750a=_0x4ab0[_0x57074f];return _0x49750a;};'use strict';var _=require('lodash');var util=require(_0x04ab('0x0'));var moment=require(_0x04ab('0x1'));var BPromise=require(_0x04ab('0x2'));var rs=require(_0x04ab('0x3'));var fs=require('fs');var Redis=require(_0x04ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x04ab('0x5'))(_0x04ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ab('0x7'));var client=jayson[_0x04ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f5901,_0x293f1d,_0x1ff7f6){return new BPromise(function(_0x4bc05e,_0x101d6b){return client[_0x04ab('0x9')](_0x3f5901,_0x1ff7f6)[_0x04ab('0xa')](function(_0x41ce1e){logger['info'](_0x04ab('0xb'),_0x293f1d,_0x04ab('0xc'));logger[_0x04ab('0xd')](_0x04ab('0xe'),_0x293f1d,'request\x20sent',JSON[_0x04ab('0xf')](_0x41ce1e));if(_0x41ce1e[_0x04ab('0x10')]){if(_0x41ce1e[_0x04ab('0x10')][_0x04ab('0x11')]===0x1f4){logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x41ce1e['error'][_0x04ab('0x12')]);return _0x101d6b(_0x41ce1e['error'][_0x04ab('0x12')]);}logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x41ce1e[_0x04ab('0x10')]['message']);return _0x4bc05e(_0x41ce1e['error']['message']);}else{logger[_0x04ab('0x13')](_0x04ab('0xb'),_0x293f1d,_0x04ab('0xc'));_0x4bc05e(_0x41ce1e[_0x04ab('0x14')][_0x04ab('0x12')]);}})[_0x04ab('0x15')](function(_0x42c937){logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x42c937);_0x101d6b(_0x42c937);});});} \ No newline at end of file +var _0x565f=['error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x5a3480,_0x421bd6){var _0x23bd07=function(_0x52b69c){while(--_0x52b69c){_0x5a3480['push'](_0x5a3480['shift']());}};_0x23bd07(++_0x421bd6);}(_0x565f,0x68));var _0xf565=function(_0x5bbbdf,_0x30f54c){_0x5bbbdf=_0x5bbbdf-0x0;var _0x4d65e0=_0x565f[_0x5bbbdf];return _0x4d65e0;};'use strict';var _=require('lodash');var util=require(_0xf565('0x0'));var moment=require(_0xf565('0x1'));var BPromise=require(_0xf565('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf565('0x3'));var db=require(_0xf565('0x4'))['db'];var utils=require(_0xf565('0x5'));var logger=require(_0xf565('0x6'))(_0xf565('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf565('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cc0ea,_0x2d3b27,_0x45db1b){return new BPromise(function(_0x43b686,_0x55685c){return client[_0xf565('0x9')](_0x4cc0ea,_0x45db1b)['then'](function(_0x35377e){logger['info'](_0xf565('0xa'),_0x2d3b27,_0xf565('0xb'));logger[_0xf565('0xc')](_0xf565('0xd'),_0x2d3b27,_0xf565('0xb'),JSON[_0xf565('0xe')](_0x35377e));if(_0x35377e['error']){if(_0x35377e['error'][_0xf565('0xf')]===0x1f4){logger[_0xf565('0x10')](_0xf565('0xa'),_0x2d3b27,_0x35377e[_0xf565('0x10')][_0xf565('0x11')]);return _0x55685c(_0x35377e[_0xf565('0x10')][_0xf565('0x11')]);}logger[_0xf565('0x10')](_0xf565('0xa'),_0x2d3b27,_0x35377e[_0xf565('0x10')]['message']);return _0x43b686(_0x35377e[_0xf565('0x10')][_0xf565('0x11')]);}else{logger['info'](_0xf565('0xa'),_0x2d3b27,_0xf565('0xb'));_0x43b686(_0x35377e[_0xf565('0x12')][_0xf565('0x11')]);}})[_0xf565('0x13')](function(_0x509ff4){logger[_0xf565('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2d3b27,_0x509ff4);_0x55685c(_0x509ff4);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index b0bcfec..c7375ad 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 _0xd2f9=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete'];(function(_0x40b77b,_0x1643ff){var _0x18931a=function(_0x49181f){while(--_0x49181f){_0x40b77b['push'](_0x40b77b['shift']());}};_0x18931a(++_0x1643ff);}(_0xd2f9,0x1ef));var _0x9d2f=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xd2f9[_0x4bacb6];return _0x58c029;};'use strict';var multer=require(_0x9d2f('0x0'));var util=require(_0x9d2f('0x1'));var path=require('path');var timeout=require(_0x9d2f('0x2'));var express=require(_0x9d2f('0x3'));var router=express['Router']();var fs_extra=require(_0x9d2f('0x4'));var auth=require(_0x9d2f('0x5'));var interaction=require(_0x9d2f('0x6'));var config=require(_0x9d2f('0x7'));var controller=require(_0x9d2f('0x8'));router['get']('/',auth[_0x9d2f('0x9')](),controller[_0x9d2f('0xa')]);router[_0x9d2f('0xb')](_0x9d2f('0xc'),auth[_0x9d2f('0x9')](),controller[_0x9d2f('0xd')]);router[_0x9d2f('0xe')]('/',auth[_0x9d2f('0x9')](),controller[_0x9d2f('0xf')]);router[_0x9d2f('0x10')]('/:id',auth[_0x9d2f('0x9')](),controller['update']);router[_0x9d2f('0x11')](_0x9d2f('0xc'),auth[_0x9d2f('0x9')](),controller['destroy']);module[_0x9d2f('0x12')]=router; \ No newline at end of file +var _0xbc01=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x2ee50e,_0x115adf){var _0x3abe9c=function(_0x4bb73f){while(--_0x4bb73f){_0x2ee50e['push'](_0x2ee50e['shift']());}};_0x3abe9c(++_0x115adf);}(_0xbc01,0xaf));var _0x1bc0=function(_0x4622dc,_0x2dfac7){_0x4622dc=_0x4622dc-0x0;var _0x565286=_0xbc01[_0x4622dc];return _0x565286;};'use strict';var multer=require(_0x1bc0('0x0'));var util=require(_0x1bc0('0x1'));var path=require(_0x1bc0('0x2'));var timeout=require('connect-timeout');var express=require(_0x1bc0('0x3'));var router=express[_0x1bc0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1bc0('0x5'));var interaction=require(_0x1bc0('0x6'));var config=require(_0x1bc0('0x7'));var controller=require(_0x1bc0('0x8'));router[_0x1bc0('0x9')]('/',auth[_0x1bc0('0xa')](),controller[_0x1bc0('0xb')]);router[_0x1bc0('0x9')](_0x1bc0('0xc'),auth[_0x1bc0('0xa')](),controller[_0x1bc0('0xd')]);router[_0x1bc0('0xe')]('/',auth[_0x1bc0('0xa')](),controller[_0x1bc0('0xf')]);router['put']('/:id',auth[_0x1bc0('0xa')](),controller[_0x1bc0('0x10')]);router[_0x1bc0('0x11')](_0x1bc0('0xc'),auth[_0x1bc0('0xa')](),controller[_0x1bc0('0x12')]);module[_0x1bc0('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 b724e7a..38f81a1 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 _0x17f4=['sequelize','exports','STRING','name'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x17f4,0x15c));var _0x417f=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x17f4[_0x56f7e2];return _0x36240b;};'use strict';var Sequelize=require(_0x417f('0x0'));module[_0x417f('0x1')]={'name':{'type':Sequelize[_0x417f('0x2')],'unique':_0x417f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x417f('0x2')]}}; \ No newline at end of file +var _0xd47e=['exports','STRING','name','sequelize'];(function(_0x2a1099,_0x255150){var _0x12c991=function(_0x48394d){while(--_0x48394d){_0x2a1099['push'](_0x2a1099['shift']());}};_0x12c991(++_0x255150);}(_0xd47e,0x173));var _0xed47=function(_0x88414c,_0x385199){_0x88414c=_0x88414c-0x0;var _0xc5b7b8=_0xd47e[_0x88414c];return _0xc5b7b8;};'use strict';var Sequelize=require(_0xed47('0x0'));module[_0xed47('0x1')]={'name':{'type':Sequelize[_0xed47('0x2')],'unique':_0xed47('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xed47('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 7fde656..2c3f743 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 _0x9c80=['where','pick','filter','type','VIRTUAL','merge','options','Pause','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','autoAssociation','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','UserProfileResource','error','name','send','index','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c80,0x6e));var _0x09c8=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x9c80[_0x45f951];return _0x24756c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09c8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09c8('0x1'));var rp=require(_0x09c8('0x2'));var moment=require(_0x09c8('0x3'));var BPromise=require(_0x09c8('0x4'));var Mustache=require(_0x09c8('0x5'));var util=require(_0x09c8('0x6'));var path=require(_0x09c8('0x7'));var sox=require(_0x09c8('0x8'));var csv=require(_0x09c8('0x9'));var ejs=require(_0x09c8('0xa'));var fs=require('fs');var fs_extra=require(_0x09c8('0xb'));var _=require(_0x09c8('0xc'));var squel=require(_0x09c8('0xd'));var crypto=require(_0x09c8('0xe'));var jsforce=require(_0x09c8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x09c8('0x9'));var querystring=require(_0x09c8('0x10'));var Papa=require(_0x09c8('0x11'));var Redis=require('ioredis');var authService=require(_0x09c8('0x12'));var qs=require(_0x09c8('0x13'));var as=require(_0x09c8('0x14'));var hardwareService=require(_0x09c8('0x15'));var logger=require(_0x09c8('0x16'))(_0x09c8('0x17'));var utils=require('../../config/utils');var config=require(_0x09c8('0x18'));var licenseUtil=require(_0x09c8('0x19'));var db=require(_0x09c8('0x1a'))['db'];function respondWithStatusCode(_0x43e8cc,_0x4050d8){_0x4050d8=_0x4050d8||0xcc;return function(_0x1465b9){if(_0x1465b9){return _0x43e8cc['sendStatus'](_0x4050d8);}return _0x43e8cc['status'](_0x4050d8)[_0x09c8('0x1b')]();};}function respondWithResult(_0x519db0,_0x567f0c){_0x567f0c=_0x567f0c||0xc8;return function(_0x175a1a){if(_0x175a1a){return _0x519db0[_0x09c8('0x1c')](_0x567f0c)['json'](_0x175a1a);}};}function respondWithFilteredResult(_0x173a83,_0x22fd37){return function(_0x206fcb){if(_0x206fcb){var _0x5f4259=typeof _0x22fd37['offset']===_0x09c8('0x1d')&&typeof _0x22fd37[_0x09c8('0x1e')]===_0x09c8('0x1d');var _0x7098b=_0x206fcb[_0x09c8('0x1f')];var _0x54941f=_0x5f4259?0x0:_0x22fd37[_0x09c8('0x20')];var _0x13bc78=_0x5f4259?_0x206fcb['count']:_0x22fd37['offset']+_0x22fd37['limit'];var _0x4cb852;if(_0x13bc78>=_0x7098b){_0x13bc78=_0x7098b;_0x4cb852=0xc8;}else{_0x4cb852=0xce;}_0x173a83['status'](_0x4cb852);return _0x173a83[_0x09c8('0x21')](_0x09c8('0x22'),_0x54941f+'-'+_0x13bc78+'/'+_0x7098b)[_0x09c8('0x23')](_0x206fcb);}return null;};}function patchUpdates(_0x4fdbac){return function(_0x4bc5ec){try{jsonpatch[_0x09c8('0x24')](_0x4bc5ec,_0x4fdbac,!![]);}catch(_0x2500ed){return BPromise[_0x09c8('0x25')](_0x2500ed);}return _0x4bc5ec['save']();};}function saveUpdates(_0x30efb0,_0xaabdad){return function(_0x3cb255){if(_0x3cb255){return _0x3cb255[_0x09c8('0x26')](_0x30efb0)[_0x09c8('0x27')](function(_0x5cb3a8){return _0x5cb3a8;});}return null;};}function removeEntity(_0x58a502,_0x45c420){return function(_0x45939d){if(_0x45939d){return _0x45939d[_0x09c8('0x28')]()[_0x09c8('0x27')](function(){var _0x35092a=_0x45939d['get']({'plain':!![]});var _0x48dae1='Pauses';return db[_0x09c8('0x29')][_0x09c8('0x28')]({'where':{'type':_0x48dae1,'resourceId':_0x35092a['id']}})['then'](function(){return _0x45939d;});})['then'](function(){_0x58a502[_0x09c8('0x1c')](0xcc)[_0x09c8('0x1b')]();});}};}function handleEntityNotFound(_0x1eb845,_0x2e5689){return function(_0x5d18f6){if(!_0x5d18f6){_0x1eb845['sendStatus'](0x194);}return _0x5d18f6;};}function handleError(_0xacda40,_0xc801c6){_0xc801c6=_0xc801c6||0x1f4;return function(_0x1d3b4f){logger[_0x09c8('0x2a')](_0x1d3b4f['stack']);if(_0x1d3b4f[_0x09c8('0x2b')]){delete _0x1d3b4f[_0x09c8('0x2b')];}_0xacda40[_0x09c8('0x1c')](_0xc801c6)[_0x09c8('0x2c')](_0x1d3b4f);};}exports[_0x09c8('0x2d')]=function(_0x13ee93,_0x1f967f){var _0x3c520d={},_0x47968a={},_0x3d72da={'count':0x0,'rows':[]};var _0x4c2864=_[_0x09c8('0x2e')](db['Pause']['rawAttributes'],function(_0x334aed){return{'name':_0x334aed['fieldName'],'type':_0x334aed['type']['key']};});_0x47968a['model']=_[_0x09c8('0x2e')](_0x4c2864,_0x09c8('0x2b'));_0x47968a[_0x09c8('0x2f')]=_['keys'](_0x13ee93['query']);_0x47968a[_0x09c8('0x30')]=_['intersection'](_0x47968a[_0x09c8('0x31')],_0x47968a[_0x09c8('0x2f')]);_0x3c520d[_0x09c8('0x32')]=_[_0x09c8('0x33')](_0x47968a[_0x09c8('0x31')],qs['fields'](_0x13ee93[_0x09c8('0x2f')][_0x09c8('0x34')]));_0x3c520d[_0x09c8('0x32')]=_0x3c520d[_0x09c8('0x32')][_0x09c8('0x35')]?_0x3c520d[_0x09c8('0x32')]:_0x47968a['model'];if(!_0x13ee93['query'][_0x09c8('0x36')](_0x09c8('0x37'))){_0x3c520d[_0x09c8('0x1e')]=qs[_0x09c8('0x1e')](_0x13ee93[_0x09c8('0x2f')][_0x09c8('0x1e')]);_0x3c520d['offset']=qs[_0x09c8('0x20')](_0x13ee93['query'][_0x09c8('0x20')]);}_0x3c520d[_0x09c8('0x38')]=qs[_0x09c8('0x39')](_0x13ee93[_0x09c8('0x2f')][_0x09c8('0x39')]);_0x3c520d[_0x09c8('0x3a')]=qs[_0x09c8('0x30')](_[_0x09c8('0x3b')](_0x13ee93[_0x09c8('0x2f')],_0x47968a[_0x09c8('0x30')]),_0x4c2864);if(_0x13ee93['query'][_0x09c8('0x3c')]){_0x3c520d[_0x09c8('0x3a')]=_['merge'](_0x3c520d[_0x09c8('0x3a')],{'$or':_['map'](_0x4c2864,function(_0x58fb35){if(_0x58fb35[_0x09c8('0x3d')]!==_0x09c8('0x3e')){var _0x3bdd9e={};_0x3bdd9e[_0x58fb35[_0x09c8('0x2b')]]={'$like':'%'+_0x13ee93[_0x09c8('0x2f')][_0x09c8('0x3c')]+'%'};return _0x3bdd9e;}})});}_0x3c520d=_[_0x09c8('0x3f')]({},_0x3c520d,_0x13ee93[_0x09c8('0x40')]);var _0x1486f8={'where':_0x3c520d[_0x09c8('0x3a')]};return db[_0x09c8('0x41')][_0x09c8('0x1f')](_0x1486f8)[_0x09c8('0x27')](function(_0x5cfa2c){_0x3d72da[_0x09c8('0x1f')]=_0x5cfa2c;if(_0x13ee93[_0x09c8('0x2f')]['includeAll']){_0x3c520d[_0x09c8('0x42')]=[{'all':!![]}];}return db[_0x09c8('0x41')][_0x09c8('0x43')](_0x3c520d);})[_0x09c8('0x27')](function(_0x1138a7){_0x3d72da[_0x09c8('0x44')]=_0x1138a7;return _0x3d72da;})['then'](respondWithFilteredResult(_0x1f967f,_0x3c520d))[_0x09c8('0x45')](handleError(_0x1f967f,null));};exports[_0x09c8('0x46')]=function(_0x6ad76b,_0x31d07c){var _0x5bcccb={'raw':!![],'where':{'id':_0x6ad76b[_0x09c8('0x47')]['id']}},_0x5de443={};_0x5de443[_0x09c8('0x31')]=_['keys'](db[_0x09c8('0x41')][_0x09c8('0x48')]);_0x5de443['query']=_['keys'](_0x6ad76b[_0x09c8('0x2f')]);_0x5de443[_0x09c8('0x30')]=_[_0x09c8('0x33')](_0x5de443[_0x09c8('0x31')],_0x5de443['query']);_0x5bcccb[_0x09c8('0x32')]=_['intersection'](_0x5de443[_0x09c8('0x31')],qs[_0x09c8('0x34')](_0x6ad76b[_0x09c8('0x2f')][_0x09c8('0x34')]));_0x5bcccb[_0x09c8('0x32')]=_0x5bcccb[_0x09c8('0x32')][_0x09c8('0x35')]?_0x5bcccb[_0x09c8('0x32')]:_0x5de443[_0x09c8('0x31')];if(_0x6ad76b['query'][_0x09c8('0x49')]){_0x5bcccb[_0x09c8('0x42')]=[{'all':!![]}];}_0x5bcccb=_[_0x09c8('0x3f')]({},_0x5bcccb,_0x6ad76b['options']);return db[_0x09c8('0x41')]['find'](_0x5bcccb)[_0x09c8('0x27')](handleEntityNotFound(_0x31d07c,null))[_0x09c8('0x27')](respondWithResult(_0x31d07c,null))[_0x09c8('0x45')](handleError(_0x31d07c,null));};exports[_0x09c8('0x4a')]=function(_0x50b1a2,_0x1f815f){return db['Pause'][_0x09c8('0x4a')](_0x50b1a2[_0x09c8('0x4b')],{})['then'](function(_0x4711b8){var _0x350806=_0x50b1a2[_0x09c8('0x4c')][_0x09c8('0x4d')]({'plain':!![]});if(!_0x350806)throw new Error(_0x09c8('0x4e'));if(_0x350806[_0x09c8('0x4f')]==='user'){var _0x259d62=_0x4711b8[_0x09c8('0x4d')]({'plain':!![]});var _0x58d965=_0x09c8('0x50');return db[_0x09c8('0x51')][_0x09c8('0x52')]({'where':{'name':_0x58d965,'userProfileId':_0x350806['userProfileId']},'raw':!![]})[_0x09c8('0x27')](function(_0x204bbe){if(_0x204bbe&&_0x204bbe[_0x09c8('0x53')]===0x0){return db[_0x09c8('0x29')][_0x09c8('0x4a')]({'name':_0x259d62[_0x09c8('0x2b')],'resourceId':_0x259d62['id'],'type':_0x204bbe[_0x09c8('0x2b')],'sectionId':_0x204bbe['id']},{})[_0x09c8('0x27')](function(){return _0x4711b8;});}else{return _0x4711b8;}})[_0x09c8('0x45')](function(_0x539b82){logger[_0x09c8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x539b82);throw _0x539b82;});}return _0x4711b8;})[_0x09c8('0x27')](respondWithResult(_0x1f815f,0xc9))['catch'](handleError(_0x1f815f,null));};exports[_0x09c8('0x26')]=function(_0x18ef2b,_0x412e76){if(_0x18ef2b[_0x09c8('0x4b')]['id']){delete _0x18ef2b['body']['id'];}return db['Pause'][_0x09c8('0x52')]({'where':{'id':_0x18ef2b['params']['id']}})[_0x09c8('0x27')](handleEntityNotFound(_0x412e76,null))[_0x09c8('0x27')](saveUpdates(_0x18ef2b[_0x09c8('0x4b')],null))['then'](respondWithResult(_0x412e76,null))[_0x09c8('0x45')](handleError(_0x412e76,null));};exports[_0x09c8('0x28')]=function(_0x43079c,_0x30bef0){return db[_0x09c8('0x41')]['find']({'where':{'id':_0x43079c['params']['id']}})[_0x09c8('0x27')](handleEntityNotFound(_0x30bef0,null))[_0x09c8('0x27')](removeEntity(_0x30bef0,null))[_0x09c8('0x45')](handleError(_0x30bef0,null));}; \ No newline at end of file +var _0xe76e=['ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','error','stack','send','map','Pause','rawAttributes','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','name','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x4c7d84,_0x229b0c){var _0x1cab30=function(_0x1b8d96){while(--_0x1b8d96){_0x4c7d84['push'](_0x4c7d84['shift']());}};_0x1cab30(++_0x229b0c);}(_0xe76e,0xa0));var _0xee76=function(_0x8073f5,_0xff152b){_0x8073f5=_0x8073f5-0x0;var _0x226a35=_0xe76e[_0x8073f5];return _0x226a35;};'use strict';var emlformat=require(_0xee76('0x0'));var rimraf=require(_0xee76('0x1'));var zipdir=require(_0xee76('0x2'));var jsonpatch=require(_0xee76('0x3'));var rp=require('request-promise');var moment=require(_0xee76('0x4'));var BPromise=require(_0xee76('0x5'));var Mustache=require(_0xee76('0x6'));var util=require(_0xee76('0x7'));var path=require(_0xee76('0x8'));var sox=require(_0xee76('0x9'));var csv=require('to-csv');var ejs=require(_0xee76('0xa'));var fs=require('fs');var fs_extra=require(_0xee76('0xb'));var _=require(_0xee76('0xc'));var squel=require(_0xee76('0xd'));var crypto=require('crypto');var jsforce=require(_0xee76('0xe'));var deskjs=require(_0xee76('0xf'));var toCsv=require(_0xee76('0x10'));var querystring=require(_0xee76('0x11'));var Papa=require('papaparse');var Redis=require(_0xee76('0x12'));var authService=require(_0xee76('0x13'));var qs=require(_0xee76('0x14'));var as=require(_0xee76('0x15'));var hardwareService=require(_0xee76('0x16'));var logger=require(_0xee76('0x17'))(_0xee76('0x18'));var utils=require('../../config/utils');var config=require(_0xee76('0x19'));var licenseUtil=require(_0xee76('0x1a'));var db=require(_0xee76('0x1b'))['db'];function respondWithStatusCode(_0x49deb1,_0x2e8590){_0x2e8590=_0x2e8590||0xcc;return function(_0x2c68ba){if(_0x2c68ba){return _0x49deb1[_0xee76('0x1c')](_0x2e8590);}return _0x49deb1[_0xee76('0x1d')](_0x2e8590)[_0xee76('0x1e')]();};}function respondWithResult(_0x57b48e,_0x3672e8){_0x3672e8=_0x3672e8||0xc8;return function(_0x1f5bc7){if(_0x1f5bc7){return _0x57b48e[_0xee76('0x1d')](_0x3672e8)[_0xee76('0x1f')](_0x1f5bc7);}};}function respondWithFilteredResult(_0x175259,_0x5c4792){return function(_0x5144cd){if(_0x5144cd){var _0x264b92=typeof _0x5c4792['offset']===_0xee76('0x20')&&typeof _0x5c4792['limit']==='undefined';var _0x20b075=_0x5144cd[_0xee76('0x21')];var _0x2a3fc3=_0x264b92?0x0:_0x5c4792[_0xee76('0x22')];var _0x34da4b=_0x264b92?_0x5144cd[_0xee76('0x21')]:_0x5c4792['offset']+_0x5c4792[_0xee76('0x23')];var _0x52309a;if(_0x34da4b>=_0x20b075){_0x34da4b=_0x20b075;_0x52309a=0xc8;}else{_0x52309a=0xce;}_0x175259[_0xee76('0x1d')](_0x52309a);return _0x175259[_0xee76('0x24')](_0xee76('0x25'),_0x2a3fc3+'-'+_0x34da4b+'/'+_0x20b075)[_0xee76('0x1f')](_0x5144cd);}return null;};}function patchUpdates(_0x38a783){return function(_0x3610e8){try{jsonpatch[_0xee76('0x26')](_0x3610e8,_0x38a783,!![]);}catch(_0x47d6f0){return BPromise[_0xee76('0x27')](_0x47d6f0);}return _0x3610e8[_0xee76('0x28')]();};}function saveUpdates(_0x288baa,_0x420e6f){return function(_0x383f1c){if(_0x383f1c){return _0x383f1c['update'](_0x288baa)[_0xee76('0x29')](function(_0x506db0){return _0x506db0;});}return null;};}function removeEntity(_0x3a2352,_0x57a965){return function(_0x21db2e){if(_0x21db2e){return _0x21db2e[_0xee76('0x2a')]()['then'](function(){var _0x351243=_0x21db2e[_0xee76('0x2b')]({'plain':!![]});var _0x3bd003=_0xee76('0x2c');return db[_0xee76('0x2d')][_0xee76('0x2a')]({'where':{'type':_0x3bd003,'resourceId':_0x351243['id']}})['then'](function(){return _0x21db2e;});})[_0xee76('0x29')](function(){_0x3a2352['status'](0xcc)[_0xee76('0x1e')]();});}};}function handleEntityNotFound(_0x1a2eeb,_0x1d9939){return function(_0x4b1384){if(!_0x4b1384){_0x1a2eeb[_0xee76('0x1c')](0x194);}return _0x4b1384;};}function handleError(_0x4dfe8a,_0x505a0d){_0x505a0d=_0x505a0d||0x1f4;return function(_0x1d9577){logger[_0xee76('0x2e')](_0x1d9577[_0xee76('0x2f')]);if(_0x1d9577['name']){delete _0x1d9577['name'];}_0x4dfe8a[_0xee76('0x1d')](_0x505a0d)[_0xee76('0x30')](_0x1d9577);};}exports['index']=function(_0x4b9902,_0x1682e0){var _0x4c23b6={},_0x21cde7={},_0x34572a={'count':0x0,'rows':[]};var _0x496084=_[_0xee76('0x31')](db[_0xee76('0x32')][_0xee76('0x33')],function(_0xd01d4c){return{'name':_0xd01d4c['fieldName'],'type':_0xd01d4c['type'][_0xee76('0x34')]};});_0x21cde7[_0xee76('0x35')]=_[_0xee76('0x31')](_0x496084,'name');_0x21cde7['query']=_[_0xee76('0x36')](_0x4b9902[_0xee76('0x37')]);_0x21cde7['filters']=_[_0xee76('0x38')](_0x21cde7[_0xee76('0x35')],_0x21cde7['query']);_0x4c23b6[_0xee76('0x39')]=_['intersection'](_0x21cde7[_0xee76('0x35')],qs[_0xee76('0x3a')](_0x4b9902['query'][_0xee76('0x3a')]));_0x4c23b6[_0xee76('0x39')]=_0x4c23b6[_0xee76('0x39')]['length']?_0x4c23b6[_0xee76('0x39')]:_0x21cde7['model'];if(!_0x4b9902[_0xee76('0x37')][_0xee76('0x3b')](_0xee76('0x3c'))){_0x4c23b6[_0xee76('0x23')]=qs[_0xee76('0x23')](_0x4b9902['query']['limit']);_0x4c23b6[_0xee76('0x22')]=qs[_0xee76('0x22')](_0x4b9902['query'][_0xee76('0x22')]);}_0x4c23b6['order']=qs[_0xee76('0x3d')](_0x4b9902[_0xee76('0x37')]['sort']);_0x4c23b6['where']=qs[_0xee76('0x3e')](_[_0xee76('0x3f')](_0x4b9902[_0xee76('0x37')],_0x21cde7[_0xee76('0x3e')]),_0x496084);if(_0x4b9902[_0xee76('0x37')]['filter']){_0x4c23b6[_0xee76('0x40')]=_[_0xee76('0x41')](_0x4c23b6['where'],{'$or':_[_0xee76('0x31')](_0x496084,function(_0x57269a){if(_0x57269a[_0xee76('0x42')]!==_0xee76('0x43')){var _0xcd6442={};_0xcd6442[_0x57269a[_0xee76('0x44')]]={'$like':'%'+_0x4b9902[_0xee76('0x37')][_0xee76('0x45')]+'%'};return _0xcd6442;}})});}_0x4c23b6=_[_0xee76('0x41')]({},_0x4c23b6,_0x4b9902[_0xee76('0x46')]);var _0x2f647f={'where':_0x4c23b6[_0xee76('0x40')]};return db[_0xee76('0x32')][_0xee76('0x21')](_0x2f647f)[_0xee76('0x29')](function(_0x1442d0){_0x34572a['count']=_0x1442d0;if(_0x4b9902[_0xee76('0x37')][_0xee76('0x47')]){_0x4c23b6['include']=[{'all':!![]}];}return db[_0xee76('0x32')][_0xee76('0x48')](_0x4c23b6);})[_0xee76('0x29')](function(_0x33f8a1){_0x34572a[_0xee76('0x49')]=_0x33f8a1;return _0x34572a;})['then'](respondWithFilteredResult(_0x1682e0,_0x4c23b6))[_0xee76('0x4a')](handleError(_0x1682e0,null));};exports[_0xee76('0x4b')]=function(_0x7810,_0x111f99){var _0x5b9015={'raw':!![],'where':{'id':_0x7810[_0xee76('0x4c')]['id']}},_0x53dfac={};_0x53dfac[_0xee76('0x35')]=_[_0xee76('0x36')](db[_0xee76('0x32')]['rawAttributes']);_0x53dfac[_0xee76('0x37')]=_[_0xee76('0x36')](_0x7810[_0xee76('0x37')]);_0x53dfac[_0xee76('0x3e')]=_[_0xee76('0x38')](_0x53dfac[_0xee76('0x35')],_0x53dfac[_0xee76('0x37')]);_0x5b9015[_0xee76('0x39')]=_[_0xee76('0x38')](_0x53dfac['model'],qs['fields'](_0x7810[_0xee76('0x37')][_0xee76('0x3a')]));_0x5b9015['attributes']=_0x5b9015[_0xee76('0x39')]['length']?_0x5b9015[_0xee76('0x39')]:_0x53dfac['model'];if(_0x7810[_0xee76('0x37')][_0xee76('0x47')]){_0x5b9015[_0xee76('0x4d')]=[{'all':!![]}];}_0x5b9015=_[_0xee76('0x41')]({},_0x5b9015,_0x7810[_0xee76('0x46')]);return db[_0xee76('0x32')][_0xee76('0x4e')](_0x5b9015)[_0xee76('0x29')](handleEntityNotFound(_0x111f99,null))['then'](respondWithResult(_0x111f99,null))[_0xee76('0x4a')](handleError(_0x111f99,null));};exports[_0xee76('0x4f')]=function(_0x5f8453,_0x18c00e){return db[_0xee76('0x32')][_0xee76('0x4f')](_0x5f8453[_0xee76('0x50')],{})[_0xee76('0x29')](function(_0x24c70b){var _0x6e55d3=_0x5f8453[_0xee76('0x51')]['get']({'plain':!![]});if(!_0x6e55d3)throw new Error(_0xee76('0x52'));if(_0x6e55d3['role']===_0xee76('0x51')){var _0x3ae06c=_0x24c70b['get']({'plain':!![]});var _0x20e2e4=_0xee76('0x2c');return db['UserProfileSection'][_0xee76('0x4e')]({'where':{'name':_0x20e2e4,'userProfileId':_0x6e55d3['userProfileId']},'raw':!![]})[_0xee76('0x29')](function(_0x29fd2f){if(_0x29fd2f&&_0x29fd2f['autoAssociation']===0x0){return db[_0xee76('0x2d')]['create']({'name':_0x3ae06c[_0xee76('0x44')],'resourceId':_0x3ae06c['id'],'type':_0x29fd2f['name'],'sectionId':_0x29fd2f['id']},{})['then'](function(){return _0x24c70b;});}else{return _0x24c70b;}})['catch'](function(_0x32bb90){logger[_0xee76('0x2e')](_0xee76('0x53'),_0x32bb90);throw _0x32bb90;});}return _0x24c70b;})['then'](respondWithResult(_0x18c00e,0xc9))['catch'](handleError(_0x18c00e,null));};exports[_0xee76('0x54')]=function(_0x5256ec,_0x4d60af){if(_0x5256ec[_0xee76('0x50')]['id']){delete _0x5256ec[_0xee76('0x50')]['id'];}return db[_0xee76('0x32')][_0xee76('0x4e')]({'where':{'id':_0x5256ec[_0xee76('0x4c')]['id']}})[_0xee76('0x29')](handleEntityNotFound(_0x4d60af,null))[_0xee76('0x29')](saveUpdates(_0x5256ec[_0xee76('0x50')],null))[_0xee76('0x29')](respondWithResult(_0x4d60af,null))['catch'](handleError(_0x4d60af,null));};exports[_0xee76('0x2a')]=function(_0x2ca8f6,_0x369ed6){return db[_0xee76('0x32')][_0xee76('0x4e')]({'where':{'id':_0x2ca8f6['params']['id']}})[_0xee76('0x29')](handleEntityNotFound(_0x369ed6,null))[_0xee76('0x29')](removeEntity(_0x369ed6,null))[_0xee76('0x4a')](handleError(_0x369ed6,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e80487c..8dc14ad 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(_0x25399c,_0xa20ba8){var _0x3a9c34=function(_0x8c49fc){while(--_0x8c49fc){_0x25399c['push'](_0x25399c['shift']());}};_0x3a9c34(++_0xa20ba8);}(_0xf494,0x1c6));var _0x4f49=function(_0xbc0cab,_0x587557){_0xbc0cab=_0xbc0cab-0x0;var _0x43a6b3=_0xf494[_0xbc0cab];return _0x43a6b3;};'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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0x7217,0x19e));var _0x7721=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x7217[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b483ce2..1d9ea4c 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4dcbbc,_0x4b3f76){var _0x5867f1=function(_0x286bf6){while(--_0x286bf6){_0x4dcbbc['push'](_0x4dcbbc['shift']());}};_0x5867f1(++_0x4b3f76);}(_0x7a54,0x106));var _0x47a5=function(_0x179a19,_0x47b229){_0x179a19=_0x179a19-0x0;var _0x50a582=_0x7a54[_0x179a19];return _0x50a582;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x10037c,_0x207625){var _0x3cc6c7=function(_0x55cdec){while(--_0x55cdec){_0x10037c['push'](_0x10037c['shift']());}};_0x3cc6c7(++_0x207625);}(_0x7a54,0x106));var _0x47a5=function(_0x27344c,_0x2b943a){_0x27344c=_0x27344c-0x0;var _0xa841c3=_0x7a54[_0x27344c];return _0xa841c3;};'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 b03d0fd..f1414c3 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 _0xa41a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','webhookGet','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0xa41a,0x6b));var _0xaa41=function(_0x56aca0,_0x3c335f){_0x56aca0=_0x56aca0-0x0;var _0x567f8d=_0xa41a[_0x56aca0];return _0x567f8d;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/webhook',controller[_0xaa41('0xc')]);router[_0xaa41('0xd')]('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xd')](_0xaa41('0xf'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);var upload=multer({'storage':multer[_0xaa41('0x11')]({'destination':function(_0x423a19,_0x1c291e,_0x5c9fc7){_0x5c9fc7(null,path[_0xaa41('0x12')](config[_0xaa41('0x13')],'server/files/plugins'));},'filename':function(_0x54827c,_0x1d0a54,_0x518b5b){_0x1d0a54[_0xaa41('0x14')]=_0x1d0a54[_0xaa41('0x14')][_0xaa41('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x518b5b(null,util[_0xaa41('0x16')](_0xaa41('0x17'),path['basename'](_0x1d0a54[_0xaa41('0x14')],path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])),Date[_0xaa41('0x19')](),path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])));}})});router[_0xaa41('0x1a')]('/',upload['single'](_0xaa41('0x1b')),controller[_0xaa41('0x1c')]);router[_0xaa41('0x1a')](_0xaa41('0x1d'),controller[_0xaa41('0x1e')]);router[_0xaa41('0x1f')](_0xaa41('0x20'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x21')]);router['delete']('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0x22')]);module[_0xaa41('0x23')]=router; \ No newline at end of file +var _0x8ce3=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','/webhook','webhookGet','get','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','extname','post','single','upload','put','/:id'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x8ce3,0xc3));var _0x38ce=function(_0x7babd9,_0x1d1f5e){_0x7babd9=_0x7babd9-0x0;var _0x394174=_0x8ce3[_0x7babd9];return _0x394174;};'use strict';var multer=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var path=require('path');var timeout=require(_0x38ce('0x2'));var express=require(_0x38ce('0x3'));var router=express[_0x38ce('0x4')]();var fs_extra=require(_0x38ce('0x5'));var auth=require(_0x38ce('0x6'));var interaction=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var controller=require(_0x38ce('0x9'));router['get']('/',auth[_0x38ce('0xa')](),controller[_0x38ce('0xb')]);router['get'](_0x38ce('0xc'),controller[_0x38ce('0xd')]);router[_0x38ce('0xe')]('/:id',auth[_0x38ce('0xa')](),controller['show']);router[_0x38ce('0xe')]('/:id/download',auth[_0x38ce('0xa')](),controller[_0x38ce('0xf')]);var upload=multer({'storage':multer[_0x38ce('0x10')]({'destination':function(_0x2c0cab,_0x564332,_0x3603fa){_0x3603fa(null,path[_0x38ce('0x11')](config[_0x38ce('0x12')],_0x38ce('0x13')));},'filename':function(_0xe33aec,_0x42e234,_0x3ef662){_0x42e234[_0x38ce('0x14')]=_0x42e234[_0x38ce('0x14')][_0x38ce('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ef662(null,util[_0x38ce('0x16')]('%s-%s%s',path['basename'](_0x42e234[_0x38ce('0x14')],path[_0x38ce('0x17')](_0x42e234[_0x38ce('0x14')])),Date['now'](),path[_0x38ce('0x17')](_0x42e234['originalname'])));}})});router[_0x38ce('0x18')]('/',upload[_0x38ce('0x19')]('file'),controller[_0x38ce('0x1a')]);router[_0x38ce('0x18')](_0x38ce('0xc'),controller['webhookPost']);router[_0x38ce('0x1b')](_0x38ce('0x1c'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x1d')]);router[_0x38ce('0x1e')](_0x38ce('0x1c'),auth[_0x38ce('0xa')](),controller['delete']);module[_0x38ce('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 74411c6..03f0eca 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 _0x7ddc=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x27f55c,_0x4dec4a){var _0x5595ed=function(_0x2e01bd){while(--_0x2e01bd){_0x27f55c['push'](_0x27f55c['shift']());}};_0x5595ed(++_0x4dec4a);}(_0x7ddc,0x10c));var _0xc7dd=function(_0x233c97,_0x1a8d5b){_0x233c97=_0x233c97-0x0;var _0xb53c7c=_0x7ddc[_0x233c97];return _0xb53c7c;};'use strict';var Sequelize=require(_0xc7dd('0x0'));module[_0xc7dd('0x1')]={'name':{'type':Sequelize[_0xc7dd('0x2')]},'type':{'type':Sequelize[_0xc7dd('0x3')](_0xc7dd('0x4'),_0xc7dd('0x5'))},'description':{'type':Sequelize[_0xc7dd('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xc7dd('0x2')],'comment':_0xc7dd('0x7')},'active':{'type':Sequelize[_0xc7dd('0x8')],'defaultValue':0x0,'comment':_0xc7dd('0x9')},'sidebar':{'type':Sequelize[_0xc7dd('0x3')](_0xc7dd('0xa'),_0xc7dd('0xb'),'always',_0xc7dd('0xc')),'defaultValue':'always','comment':_0xc7dd('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xc7dd('0x2')]},'agentUrl':{'type':Sequelize[_0xc7dd('0x2')]},'scriptName':{'type':Sequelize[_0xc7dd('0x2')]},'scriptPath':{'type':Sequelize[_0xc7dd('0x2')]}}; \ No newline at end of file +var _0x4933=['script','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html'];(function(_0x2ea6f5,_0x4adfc4){var _0x2a88b5=function(_0x556500){while(--_0x556500){_0x2ea6f5['push'](_0x2ea6f5['shift']());}};_0x2a88b5(++_0x4adfc4);}(_0x4933,0x64));var _0x3493=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x4933[_0x251d9c];return _0x16ae64;};'use strict';var Sequelize=require(_0x3493('0x0'));module[_0x3493('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3493('0x2')](_0x3493('0x3'),_0x3493('0x4'))},'description':{'type':Sequelize[_0x3493('0x5')]},'version':{'type':Sequelize[_0x3493('0x5')]},'path':{'type':Sequelize[_0x3493('0x6')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x3493('0x7')],'defaultValue':0x0,'comment':_0x3493('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x3493('0x9'),'agentOnly',_0x3493('0xa'),_0x3493('0xb')),'defaultValue':'always','comment':_0x3493('0xc')},'icon':{'type':Sequelize[_0x3493('0x6')]},'adminUrl':{'type':Sequelize[_0x3493('0x6')]},'agentUrl':{'type':Sequelize[_0x3493('0x6')]},'scriptName':{'type':Sequelize[_0x3493('0x6')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index ab7d97b..615a5a4 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 _0x8ef1=['../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','stack','name','index','Plugin','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','include','findAll','catch','show','params','includeAll','options','find','download','join','root','server/files/plugins','%s.zip','createWriteStream','zip','warning','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','dirname','basename','attachments/**/*','finalize','close','existsSync','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','readdirSync','some','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','UserProfileResource','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','headers','content-length','content-type','endsWith','statusCode','send','webhookPost','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x5798b6,_0x3ed86f){var _0x8b3bd9=function(_0x256177){while(--_0x256177){_0x5798b6['push'](_0x5798b6['shift']());}};_0x8b3bd9(++_0x3ed86f);}(_0x8ef1,0x13b));var _0x18ef=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x8ef1[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require(_0x18ef('0x0'));var rimraf=require(_0x18ef('0x1'));var zipdir=require(_0x18ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18ef('0x3'));var moment=require(_0x18ef('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x18ef('0x5'));var path=require(_0x18ef('0x6'));var sox=require(_0x18ef('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18ef('0x8'));var squel=require(_0x18ef('0x9'));var crypto=require('crypto');var jsforce=require(_0x18ef('0xa'));var deskjs=require(_0x18ef('0xb'));var toCsv=require('to-csv');var querystring=require(_0x18ef('0xc'));var Papa=require(_0x18ef('0xd'));var extract=require(_0x18ef('0xe'));var rimraf=require(_0x18ef('0x1'));var archiver=require(_0x18ef('0xf'));var Redis=require('ioredis');var authService=require(_0x18ef('0x10'));var qs=require(_0x18ef('0x11'));var as=require(_0x18ef('0x12'));var hardwareService=require(_0x18ef('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x18ef('0x14'));var config=require(_0x18ef('0x15'));var licenseUtil=require(_0x18ef('0x16'));var db=require(_0x18ef('0x17'))['db'];config['redis']=_[_0x18ef('0x18')](config['redis'],{'host':_0x18ef('0x19'),'port':0x18eb});var socket=require(_0x18ef('0x1a'))(new Redis(config['redis']));require(_0x18ef('0x1b'))[_0x18ef('0x1c')](socket);function respondWithStatusCode(_0x3f0196,_0x210d79){_0x210d79=_0x210d79||0xcc;return function(_0x45604a){if(_0x45604a){return _0x3f0196[_0x18ef('0x1d')](_0x210d79);}return _0x3f0196[_0x18ef('0x1e')](_0x210d79)[_0x18ef('0x1f')]();};}function respondWithResult(_0x44b922,_0x4bcf34){_0x4bcf34=_0x4bcf34||0xc8;return function(_0x103353){if(_0x103353){return _0x44b922[_0x18ef('0x1e')](_0x4bcf34)[_0x18ef('0x20')](_0x103353);}};}function respondWithFilteredResult(_0x30ff83,_0x18245e){return function(_0x35309b){if(_0x35309b){var _0x25a9cf=typeof _0x18245e[_0x18ef('0x21')]===_0x18ef('0x22')&&typeof _0x18245e['limit']===_0x18ef('0x22');var _0x5de88a=_0x35309b[_0x18ef('0x23')];var _0x14e973=_0x25a9cf?0x0:_0x18245e[_0x18ef('0x21')];var _0x8d71b9=_0x25a9cf?_0x35309b['count']:_0x18245e[_0x18ef('0x21')]+_0x18245e[_0x18ef('0x24')];var _0xe5b8fb;if(_0x8d71b9>=_0x5de88a){_0x8d71b9=_0x5de88a;_0xe5b8fb=0xc8;}else{_0xe5b8fb=0xce;}_0x30ff83[_0x18ef('0x1e')](_0xe5b8fb);return _0x30ff83[_0x18ef('0x25')](_0x18ef('0x26'),_0x14e973+'-'+_0x8d71b9+'/'+_0x5de88a)[_0x18ef('0x20')](_0x35309b);}return null;};}function patchUpdates(_0x340867){return function(_0x25f4e9){try{jsonpatch[_0x18ef('0x27')](_0x25f4e9,_0x340867,!![]);}catch(_0x4030af){return BPromise['reject'](_0x4030af);}return _0x25f4e9['save']();};}function saveUpdates(_0x2449f9,_0x52a522){return function(_0x262c9b){if(_0x262c9b){return _0x262c9b[_0x18ef('0x28')](_0x2449f9)[_0x18ef('0x29')](function(_0x4cd540){return _0x4cd540;});}return null;};}function removeEntity(_0x5c7891,_0x1f4d9b){return function(_0x23d9f3){if(_0x23d9f3){return _0x23d9f3[_0x18ef('0x2a')]()['then'](function(){var _0x25086e=_0x23d9f3[_0x18ef('0x2b')]({'plain':!![]});var _0x1c2320='Plugins';return db['UserProfileResource'][_0x18ef('0x2a')]({'where':{'type':_0x1c2320,'resourceId':_0x25086e['id']}})[_0x18ef('0x29')](function(){return _0x23d9f3;});})[_0x18ef('0x29')](function(){_0x5c7891[_0x18ef('0x1e')](0xcc)[_0x18ef('0x1f')]();});}};}function handleEntityNotFound(_0x566549,_0x350b7d){return function(_0xf0f52f){if(!_0xf0f52f){_0x566549[_0x18ef('0x1d')](0x194);}return _0xf0f52f;};}function handleError(_0x37e7f8,_0x358987){_0x358987=_0x358987||0x1f4;return function(_0x12de7f){logger['error'](_0x12de7f[_0x18ef('0x2c')]);if(_0x12de7f[_0x18ef('0x2d')]){delete _0x12de7f[_0x18ef('0x2d')];}_0x37e7f8[_0x18ef('0x1e')](_0x358987)['send'](_0x12de7f);};}exports[_0x18ef('0x2e')]=function(_0x35a2a4,_0x2f0eb7){var _0x14dd66={},_0x14c3fb={},_0x3689b5={'count':0x0,'rows':[]};var _0x2432d6=_['map'](db[_0x18ef('0x2f')][_0x18ef('0x30')],function(_0x1b6422){return{'name':_0x1b6422['fieldName'],'type':_0x1b6422[_0x18ef('0x31')][_0x18ef('0x32')]};});_0x14c3fb[_0x18ef('0x33')]=_['map'](_0x2432d6,_0x18ef('0x2d'));_0x14c3fb[_0x18ef('0x34')]=_[_0x18ef('0x35')](_0x35a2a4[_0x18ef('0x34')]);_0x14c3fb['filters']=_[_0x18ef('0x36')](_0x14c3fb['model'],_0x14c3fb['query']);_0x14dd66[_0x18ef('0x37')]=_[_0x18ef('0x36')](_0x14c3fb[_0x18ef('0x33')],qs['fields'](_0x35a2a4[_0x18ef('0x34')][_0x18ef('0x38')]));_0x14dd66[_0x18ef('0x37')]=_0x14dd66['attributes'][_0x18ef('0x39')]?_0x14dd66[_0x18ef('0x37')]:_0x14c3fb['model'];if(!_0x35a2a4[_0x18ef('0x34')]['hasOwnProperty'](_0x18ef('0x3a'))){_0x14dd66[_0x18ef('0x24')]=qs['limit'](_0x35a2a4['query'][_0x18ef('0x24')]);_0x14dd66[_0x18ef('0x21')]=qs['offset'](_0x35a2a4[_0x18ef('0x34')]['offset']);}_0x14dd66[_0x18ef('0x3b')]=qs['sort'](_0x35a2a4[_0x18ef('0x34')][_0x18ef('0x3c')]);_0x14dd66[_0x18ef('0x3d')]=qs[_0x18ef('0x3e')](_[_0x18ef('0x3f')](_0x35a2a4[_0x18ef('0x34')],_0x14c3fb['filters']),_0x2432d6);if(_0x35a2a4[_0x18ef('0x34')][_0x18ef('0x40')]){_0x14dd66[_0x18ef('0x3d')]=_['merge'](_0x14dd66[_0x18ef('0x3d')],{'$or':_[_0x18ef('0x41')](_0x2432d6,function(_0x4546d5){if(_0x4546d5[_0x18ef('0x31')]!==_0x18ef('0x42')){var _0x415729={};_0x415729[_0x4546d5['name']]={'$like':'%'+_0x35a2a4[_0x18ef('0x34')]['filter']+'%'};return _0x415729;}})});}_0x14dd66=_[_0x18ef('0x43')]({},_0x14dd66,_0x35a2a4['options']);var _0x45a304={'where':_0x14dd66['where']};return db[_0x18ef('0x2f')][_0x18ef('0x23')](_0x45a304)[_0x18ef('0x29')](function(_0x27fd2c){_0x3689b5['count']=_0x27fd2c;if(_0x35a2a4[_0x18ef('0x34')]['includeAll']){_0x14dd66[_0x18ef('0x44')]=[{'all':!![]}];}return db[_0x18ef('0x2f')][_0x18ef('0x45')](_0x14dd66);})[_0x18ef('0x29')](function(_0x265b6a){_0x3689b5['rows']=_0x265b6a;return _0x3689b5;})['then'](respondWithFilteredResult(_0x2f0eb7,_0x14dd66))[_0x18ef('0x46')](handleError(_0x2f0eb7,null));};exports[_0x18ef('0x47')]=function(_0x2d49e1,_0x25fe60){var _0x56e456={'raw':!![],'where':{'id':_0x2d49e1[_0x18ef('0x48')]['id']}},_0x59f40c={};_0x59f40c[_0x18ef('0x33')]=_[_0x18ef('0x35')](db[_0x18ef('0x2f')][_0x18ef('0x30')]);_0x59f40c[_0x18ef('0x34')]=_['keys'](_0x2d49e1[_0x18ef('0x34')]);_0x59f40c[_0x18ef('0x3e')]=_[_0x18ef('0x36')](_0x59f40c[_0x18ef('0x33')],_0x59f40c['query']);_0x56e456[_0x18ef('0x37')]=_[_0x18ef('0x36')](_0x59f40c[_0x18ef('0x33')],qs[_0x18ef('0x38')](_0x2d49e1['query'][_0x18ef('0x38')]));_0x56e456['attributes']=_0x56e456[_0x18ef('0x37')][_0x18ef('0x39')]?_0x56e456[_0x18ef('0x37')]:_0x59f40c[_0x18ef('0x33')];if(_0x2d49e1[_0x18ef('0x34')][_0x18ef('0x49')]){_0x56e456[_0x18ef('0x44')]=[{'all':!![]}];}_0x56e456=_[_0x18ef('0x43')]({},_0x56e456,_0x2d49e1[_0x18ef('0x4a')]);return db[_0x18ef('0x2f')][_0x18ef('0x4b')](_0x56e456)[_0x18ef('0x29')](handleEntityNotFound(_0x25fe60,null))[_0x18ef('0x29')](respondWithResult(_0x25fe60,null))[_0x18ef('0x46')](handleError(_0x25fe60,null));};exports[_0x18ef('0x4c')]=function(_0x2f059d,_0x4e51e2,_0x17a3c3){return db['Plugin'][_0x18ef('0x4b')]({'where':{'id':_0x2f059d[_0x18ef('0x48')]['id']},'attributes':[_0x18ef('0x2d'),_0x18ef('0x6')],'raw':!![]})[_0x18ef('0x29')](handleEntityNotFound(_0x4e51e2,null))[_0x18ef('0x29')](function(_0x72c109){if(_0x72c109){var _0x17dc6e=path[_0x18ef('0x4d')](config[_0x18ef('0x4e')],_0x18ef('0x4f'),util['format'](_0x18ef('0x50'),path['basename'](_0x72c109[_0x18ef('0x6')])));var _0x2a2b4c=fs[_0x18ef('0x51')](_0x17dc6e);var _0x46b3ce=archiver(_0x18ef('0x52'),{'zlib':{'level':0x9}});_0x46b3ce['on'](_0x18ef('0x53'),function(_0x3b577b){if(_0x3b577b['code']===_0x18ef('0x54')){logger[_0x18ef('0x55')](_0x3b577b);}else{throw new db['Sequelize'][(_0x18ef('0x56'))](_0x18ef('0x57'));}});_0x46b3ce['on'](_0x18ef('0x55'),function(_0x206a3b){throw new db[(_0x18ef('0x58'))]['Error'](_0x18ef('0x57'));});_0x46b3ce[_0x18ef('0x59')](_0x2a2b4c);_0x46b3ce['glob']('**/*',{'cwd':path[_0x18ef('0x4d')](config[_0x18ef('0x4e')],_0x18ef('0x4f'),path[_0x18ef('0x5a')](_0x72c109[_0x18ef('0x6')])),'ignore':[path[_0x18ef('0x4d')](path[_0x18ef('0x5b')](_0x72c109[_0x18ef('0x6')]),'node_modules/**/*'),path[_0x18ef('0x4d')](path[_0x18ef('0x5b')](_0x72c109['path']),_0x18ef('0x5c'))],'nodir':!![]})[_0x18ef('0x5d')]();_0x2a2b4c['on'](_0x18ef('0x5e'),function(){if(!fs[_0x18ef('0x5f')](_0x17dc6e)){throw new db[(_0x18ef('0x58'))][(_0x18ef('0x56'))]('Plugin\x20not\x20found');}return _0x4e51e2[_0x18ef('0x4c')](_0x17dc6e,util[_0x18ef('0x60')](_0x18ef('0x50'),path[_0x18ef('0x5b')](_0x72c109[_0x18ef('0x6')])),function(_0x4792ac){if(_0x4792ac){throw new db[(_0x18ef('0x58'))]['Error'](_0x18ef('0x61'));}fs[_0x18ef('0x62')](_0x17dc6e);logger['info'](_0x18ef('0x63'));logger[_0x18ef('0x64')](_0x18ef('0x65'));});});}return null;})[_0x18ef('0x46')](handleError(_0x4e51e2,null));};exports[_0x18ef('0x66')]=function(_0x2449ab,_0x96e7c9,_0x379f73){var _0xf9c49a=path[_0x18ef('0x5b')](_0x2449ab[_0x18ef('0x67')][_0x18ef('0x68')],path['extname'](_0x2449ab[_0x18ef('0x67')][_0x18ef('0x68')]));var _0x45fdef=path[_0x18ef('0x4d')](config[_0x18ef('0x4e')],_0x18ef('0x4f'),_0x2449ab[_0x18ef('0x67')]['filename']);var _0x2fdd3e=path['join'](config[_0x18ef('0x4e')],_0x18ef('0x4f'),_0xf9c49a);logger[_0x18ef('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x45fdef);logger[_0x18ef('0x64')](_0x18ef('0x69'),_0x2fdd3e);try{fs[_0x18ef('0x6a')](_0x45fdef,parseInt(_0x18ef('0x6b'),0x8));extract(_0x45fdef,{'dir':_0x2fdd3e},function(_0x1fd849){if(_0x1fd849){logger['error'](_0x1fd849);handleError(_0x1fd849,!![]);};var _0x568a18=fs['readdirSync'](_0x2fdd3e);if(_0x568a18['length']>0x1){removeReferences(_0x45fdef,_0x2fdd3e);logger[_0x18ef('0x55')](_0x18ef('0x6c'));return _0x379f73(new Error(_0x18ef('0x6c')));}var _0x28209d=fs[_0x18ef('0x6d')](path[_0x18ef('0x4d')](_0x2fdd3e,_0x568a18[0x0]));if(_0x28209d['isFile']()){removeReferences(_0x45fdef,_0x2fdd3e);logger['error']('Invalid\x20plugin\x20structure');return _0x379f73(new Error(_0x18ef('0x6c')));}if(_0x28209d['isDirectory']()){var _0x1cb65f=fs[_0x18ef('0x6e')](path[_0x18ef('0x4d')](_0x2fdd3e,_0x568a18[0x0]));if(_0x1cb65f[_0x18ef('0x39')]===0x0){removeReferences(_0x45fdef,_0x2fdd3e);logger['error'](_0x18ef('0x6c'));return _0x379f73(new Error(_0x18ef('0x6c')));}var _0x4c9ac0=_0x1cb65f[_0x18ef('0x6f')](function(_0x2e13bd){return _0x2e13bd==='manifest.json';});if(!_0x4c9ac0){return _0x379f73(new Error('Plugin\x20manifest\x20missing'));}var _0x456138=fs[_0x18ef('0x70')](path['join'](_0x2fdd3e,_0x568a18[0x0],_0x18ef('0x71')));var _0x527f33=JSON[_0x18ef('0x72')](_0x456138);if(_0x18ef('0x22')==typeof _0x527f33[_0x18ef('0x2d')]){return _0x379f73(new Error(_0x18ef('0x73')));}if('undefined'==typeof _0x527f33['type']){return _0x379f73(new Error(_0x18ef('0x74')));}if(_0x18ef('0x22')==typeof _0x527f33[_0x18ef('0x75')]){return _0x379f73(new Error(_0x18ef('0x76')));}if('undefined'==typeof _0x527f33[_0x18ef('0x77')]){return _0x379f73(new Error(_0x18ef('0x78')));}if(_0x527f33['type']==='html'){if(_0x18ef('0x22')==typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x79')]){return _0x379f73(new Error(_0x18ef('0x7a')));}if(_0x18ef('0x22')==typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x79')][_0x18ef('0x7b')]&&_0x18ef('0x22')==typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x79')][_0x18ef('0x7c')]){return _0x379f73(new Error(_0x18ef('0x7d')));}}else if(_0x527f33[_0x18ef('0x31')]==='script'){if('undefined'==typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x7e')]){return _0x379f73(new Error(_0x18ef('0x7f')));}if('undefined'==typeof _0x527f33['parameters'][_0x18ef('0x80')]){return _0x379f73(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x379f73(new Error(_0x18ef('0x81')));}var _0x550aa2=_0x527f33['name'];var _0x58d259=_0x527f33[_0x18ef('0x82')];var _0x8517e2=_0x527f33['type'];var _0x1d6384=_0x527f33[_0x18ef('0x83')]?_0x527f33[_0x18ef('0x83')]:_0x18ef('0x84');var _0x4da784=_0x527f33['icon']?_0x527f33[_0x18ef('0x85')]:'icon-apps';var _0x72920='';var _0x5458ee='';var _0x2a3333='';var _0x168330='';var _0x38006d=_0x527f33[_0x18ef('0x75')];if(_0x8517e2===_0x18ef('0x86')){if(_0x18ef('0x22')!=typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x79')]['admin']){var _0x2c98b8=_0x527f33[_0x18ef('0x77')][_0x18ef('0x79')][_0x18ef('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x18ef('0x87')](_0x2c98b8)){_0x72920=path[_0x18ef('0x4d')](_0x18ef('0x88'),_0xf9c49a,_0x568a18[0x0],_0x2c98b8);}else{_0x72920=_0x2c98b8;}}else{logger['info'](_0x18ef('0x89'));}if('undefined'!=typeof _0x527f33['parameters'][_0x18ef('0x79')][_0x18ef('0x7c')]){var _0x72b961=_0x527f33[_0x18ef('0x77')][_0x18ef('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x72b961)){_0x5458ee=path[_0x18ef('0x4d')]('plugins',_0xf9c49a,_0x568a18[0x0],_0x72b961);}else{_0x5458ee=_0x72b961;}}else{logger[_0x18ef('0x64')](_0x18ef('0x8a'));}}else if(_0x8517e2===_0x18ef('0x8b')){_0x2a3333=_0x527f33[_0x18ef('0x77')][_0x18ef('0x7e')];_0x168330=_0x527f33[_0x18ef('0x77')][_0x18ef('0x80')];if(_0x18ef('0x22')!=typeof _0x527f33[_0x18ef('0x77')]['views']){if('undefined'!=typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x79')]['admin']){var _0x2c98b8=_0x527f33['parameters'][_0x18ef('0x79')][_0x18ef('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x18ef('0x87')](_0x2c98b8)){_0x72920=path[_0x18ef('0x4d')](_0x18ef('0x88'),_0xf9c49a,_0x568a18[0x0],_0x2c98b8);}else{_0x72920=_0x2c98b8;}}if(_0x18ef('0x22')!=typeof _0x527f33[_0x18ef('0x77')][_0x18ef('0x79')]['agent']){var _0x72b961=_0x527f33[_0x18ef('0x77')][_0x18ef('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x72b961)){_0x5458ee=path[_0x18ef('0x4d')](_0x18ef('0x88'),_0xf9c49a,_0x568a18[0x0],_0x72b961);}else{_0x5458ee=_0x72b961;}}}}var _0x1f1b3f={'name':_0x550aa2,'description':_0x58d259,'path':path[_0x18ef('0x4d')](_0xf9c49a,_0x568a18[0x0]),'type':_0x8517e2,'sidebar':_0x1d6384,'icon':_0x4da784,'adminUrl':_0x72920,'agentUrl':_0x5458ee,'scriptName':_0x2a3333,'scriptPath':_0x168330,'version':_0x38006d};removeReferences(_0x45fdef,null);return db[_0x18ef('0x2f')][_0x18ef('0x8c')](_0x1f1b3f)['then'](function(_0x4f52d9){var _0x4503e7={'role':_0x2449ab[_0x18ef('0x8d')][_0x18ef('0x8e')],'userProfileId':_0x2449ab['body']['userProfileId']};if(!_0x4503e7)throw new Error(_0x18ef('0x8f'));if(_0x4503e7['role']===_0x18ef('0x90')){var _0x4f9375=_0x4f52d9[_0x18ef('0x2b')]({'plain':!![]});return db[_0x18ef('0x91')]['find']({'where':{'name':_0x18ef('0x92'),'userProfileId':_0x4503e7[_0x18ef('0x93')]},'raw':!![]})['then'](function(_0x4c6191){if(_0x4c6191&&_0x4c6191[_0x18ef('0x94')]===0x0){return db[_0x18ef('0x95')]['create']({'name':_0x4f9375[_0x18ef('0x2d')],'resourceId':_0x4f9375['id'],'type':_0x4c6191[_0x18ef('0x2d')],'sectionId':_0x4c6191['id']},{})['then'](function(){return _0x4f52d9;});}else{return _0x4f52d9;}})['catch'](function(_0x39a49c){logger[_0x18ef('0x55')](_0x18ef('0x96'),_0x39a49c);throw _0x39a49c;});}return _0x4f52d9;})[_0x18ef('0x29')](respondWithResult(_0x96e7c9,null))[_0x18ef('0x46')](handleError(_0x96e7c9,null));}});}catch(_0x11b99e){_0x96e7c9['status'](0x1f4)['send'](_0x11b99e);}};function removeReferences(_0x31575,_0x147f66){try{if(_0x31575){fs[_0x18ef('0x62')](_0x31575);logger['info'](_0x18ef('0x97'));}if(_0x147f66){rimraf(_0x147f66,function(){});logger[_0x18ef('0x64')]('Extracted\x20folder\x20removed');}}catch(_0x21df0a){logger[_0x18ef('0x55')](_0x21df0a);}}exports[_0x18ef('0x28')]=function(_0x2afdc3,_0x1ba842,_0x1a8e24){return db[_0x18ef('0x2f')]['find']({'where':{'id':_0x2afdc3[_0x18ef('0x48')]['id']}})[_0x18ef('0x29')](handleEntityNotFound(_0x1ba842,null))[_0x18ef('0x29')](saveUpdates(_0x2afdc3['body'],null))[_0x18ef('0x29')](respondWithResult(_0x1ba842,null))[_0x18ef('0x46')](handleError(_0x1ba842,null));};exports[_0x18ef('0x98')]=function(_0x2b8b49,_0x49888a,_0x5e7dce){return db[_0x18ef('0x2f')][_0x18ef('0x4b')]({'where':{'id':_0x2b8b49[_0x18ef('0x48')]['id']}})[_0x18ef('0x29')](function(_0x14c940){if(_0x14c940){return _0x14c940[_0x18ef('0x2a')]();}})[_0x18ef('0x29')](function(_0x7d43be){rimraf(path[_0x18ef('0x4d')](config[_0x18ef('0x4e')],'server/files/plugins',path[_0x18ef('0x5a')](_0x7d43be[_0x18ef('0x6')])),function(){});return _0x7d43be;})['then'](handleEntityNotFound(_0x49888a,null))[_0x18ef('0x29')](respondWithStatusCode(_0x49888a,null))[_0x18ef('0x46')](handleError(_0x49888a,null));};exports['webhookGet']=function(_0x226b07,_0x5c189a,_0x4b0abd){return BPromise[_0x18ef('0x99')]()[_0x18ef('0x29')](function(){if(!_0x226b07[_0x18ef('0x34')][_0x18ef('0x6')]){throw new Error(_0x18ef('0x9a'));}if(!_0x226b07[_0x18ef('0x34')][_0x18ef('0x9b')]){throw new Error(_0x18ef('0x9c'));}var _0x16310e=_0x226b07[_0x18ef('0x34')][_0x18ef('0x9d')]?_0x226b07[_0x18ef('0x34')][_0x18ef('0x9d')]+':'+_0x226b07[_0x18ef('0x34')][_0x18ef('0x9b')]:_0x18ef('0x9e')+_0x226b07[_0x18ef('0x34')]['port'];var _0x6b3565=_0x226b07[_0x18ef('0x34')][_0x18ef('0x20')]?_0x226b07['query'][_0x18ef('0x20')]:!![];var _0x46afd5=_0x226b07['query'][_0x18ef('0x9f')]?_0x226b07[_0x18ef('0x34')][_0x18ef('0x9f')]:null;var _0x5b6181={'method':_0x226b07[_0x18ef('0xa0')],'uri':util[_0x18ef('0x60')]('%s%s',_0x16310e,_0x226b07[_0x18ef('0x34')]['path']),'json':_0x6b3565,'resolveWithFullResponse':!![],'encoding':_0x46afd5,'qs':_0x226b07[_0x18ef('0x34')]};if(_0x226b07[_0x18ef('0xa1')]){_0x5b6181[_0x18ef('0xa1')]=_0x226b07['headers'];if(_0x5b6181[_0x18ef('0xa1')][_0x18ef('0xa2')]){delete _0x5b6181[_0x18ef('0xa1')][_0x18ef('0xa2')];}}if(_0x5b6181['headers'][_0x18ef('0xa3')]){delete _0x5b6181[_0x18ef('0xa1')][_0x18ef('0xa3')];}return rp(_0x5b6181);})[_0x18ef('0x29')](function(_0x5e0663){if(_0x5e0663){_0x5c189a[_0x18ef('0x25')](_0x5e0663['headers']);logger[_0x18ef('0x64')](_0x5e0663[_0x18ef('0x8d')]);if(_[_0x18ef('0xa4')](_0x226b07['query'][_0x18ef('0x6')],_0x18ef('0x4c'))&&_0x5e0663[_0x18ef('0xa5')]==0x1f4){return _0x5c189a[_0x18ef('0x1d')](_0x5e0663[_0x18ef('0xa5')]);}else{return _0x5c189a[_0x18ef('0x1e')](_0x5e0663[_0x18ef('0xa5')])[_0x18ef('0xa6')](_0x5e0663[_0x18ef('0x8d')]);}}else{return _0x5c189a[_0x18ef('0x1d')](0xc8);}})['catch'](handleError(_0x5c189a,null));};exports[_0x18ef('0xa7')]=function(_0x21fb79,_0x84058a,_0x5259a4){return BPromise[_0x18ef('0x99')]()[_0x18ef('0x29')](function(){if(!_0x21fb79[_0x18ef('0x34')][_0x18ef('0x6')]){throw new Error(_0x18ef('0x9a'));}if(!_0x21fb79[_0x18ef('0x34')][_0x18ef('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1b77cb=_0x21fb79[_0x18ef('0x34')]['hostname']?_0x21fb79[_0x18ef('0x34')][_0x18ef('0x9d')]+':'+_0x21fb79['query'][_0x18ef('0x9b')]:'http://localhost:'+_0x21fb79['query'][_0x18ef('0x9b')];var _0x145f90=_0x21fb79[_0x18ef('0x34')][_0x18ef('0x20')]?_0x21fb79[_0x18ef('0x34')][_0x18ef('0x20')]:!![];var _0x316270=_0x21fb79[_0x18ef('0x34')][_0x18ef('0x9f')]?_0x21fb79[_0x18ef('0x34')][_0x18ef('0x9f')]:null;var _0x4abdc5={'method':_0x21fb79[_0x18ef('0xa0')],'uri':util[_0x18ef('0x60')]('%s%s',_0x1b77cb,_0x21fb79['query']['path']),'json':_0x145f90,'resolveWithFullResponse':!![],'encoding':_0x316270,'body':_0x21fb79[_0x18ef('0x8d')]};if(_0x21fb79[_0x18ef('0xa1')]){_0x4abdc5[_0x18ef('0xa1')]=_0x21fb79[_0x18ef('0xa1')];if(_0x4abdc5[_0x18ef('0xa1')]['content-length']){delete _0x4abdc5[_0x18ef('0xa1')][_0x18ef('0xa2')];}}if(_0x4abdc5[_0x18ef('0xa1')]['content-type']){delete _0x4abdc5[_0x18ef('0xa1')][_0x18ef('0xa3')];}return rp(_0x4abdc5);})['then'](function(_0x52277c){if(_0x52277c){_0x84058a[_0x18ef('0x25')](_0x52277c[_0x18ef('0xa1')]);logger['info'](_0x52277c[_0x18ef('0x8d')]);return _0x84058a[_0x18ef('0x1e')](_0x52277c[_0x18ef('0xa5')])['send'](_0x52277c[_0x18ef('0x8d')]);}else{return _0x84058a['sendStatus'](0xc8);}})[_0x18ef('0x46')](handleError(_0x84058a,null));}; \ No newline at end of file +var _0x7895=['http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','destroy','then','get','sendStatus','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','download','join','root','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','basename','node_modules/**/*','attachments/**/*','finalize','existsSync','format','%s.zip','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','extname','filename','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname'];(function(_0x1854ee,_0x335b6e){var _0x2d9dc7=function(_0x592bf8){while(--_0x592bf8){_0x1854ee['push'](_0x1854ee['shift']());}};_0x2d9dc7(++_0x335b6e);}(_0x7895,0xb1));var _0x5789=function(_0x429ec7,_0xb8bccd){_0x429ec7=_0x429ec7-0x0;var _0x25d9f8=_0x7895[_0x429ec7];return _0x25d9f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5789('0x0'));var zipdir=require(_0x5789('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5789('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5789('0x3'));var util=require(_0x5789('0x4'));var path=require(_0x5789('0x5'));var sox=require(_0x5789('0x6'));var csv=require(_0x5789('0x7'));var ejs=require(_0x5789('0x8'));var fs=require('fs');var fs_extra=require(_0x5789('0x9'));var _=require(_0x5789('0xa'));var squel=require(_0x5789('0xb'));var crypto=require(_0x5789('0xc'));var jsforce=require(_0x5789('0xd'));var deskjs=require(_0x5789('0xe'));var toCsv=require(_0x5789('0x7'));var querystring=require(_0x5789('0xf'));var Papa=require(_0x5789('0x10'));var extract=require(_0x5789('0x11'));var rimraf=require(_0x5789('0x0'));var archiver=require('archiver');var Redis=require(_0x5789('0x12'));var authService=require(_0x5789('0x13'));var qs=require(_0x5789('0x14'));var as=require(_0x5789('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5789('0x16'))('api');var utils=require(_0x5789('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5789('0x18'));var db=require(_0x5789('0x19'))['db'];config[_0x5789('0x1a')]=_[_0x5789('0x1b')](config['redis'],{'host':_0x5789('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5789('0x1a')]));require(_0x5789('0x1d'))['register'](socket);function respondWithStatusCode(_0x373b2f,_0x4ccb84){_0x4ccb84=_0x4ccb84||0xcc;return function(_0x29fc65){if(_0x29fc65){return _0x373b2f['sendStatus'](_0x4ccb84);}return _0x373b2f[_0x5789('0x1e')](_0x4ccb84)[_0x5789('0x1f')]();};}function respondWithResult(_0x3b8fa3,_0x593fb2){_0x593fb2=_0x593fb2||0xc8;return function(_0x867aab){if(_0x867aab){return _0x3b8fa3[_0x5789('0x1e')](_0x593fb2)[_0x5789('0x20')](_0x867aab);}};}function respondWithFilteredResult(_0xb1567e,_0x5d933d){return function(_0x7469b0){if(_0x7469b0){var _0x3df658=typeof _0x5d933d['offset']==='undefined'&&typeof _0x5d933d[_0x5789('0x21')]===_0x5789('0x22');var _0x45590e=_0x7469b0['count'];var _0x1f31f8=_0x3df658?0x0:_0x5d933d[_0x5789('0x23')];var _0xbcb206=_0x3df658?_0x7469b0[_0x5789('0x24')]:_0x5d933d[_0x5789('0x23')]+_0x5d933d[_0x5789('0x21')];var _0x316cb7;if(_0xbcb206>=_0x45590e){_0xbcb206=_0x45590e;_0x316cb7=0xc8;}else{_0x316cb7=0xce;}_0xb1567e[_0x5789('0x1e')](_0x316cb7);return _0xb1567e[_0x5789('0x25')](_0x5789('0x26'),_0x1f31f8+'-'+_0xbcb206+'/'+_0x45590e)['json'](_0x7469b0);}return null;};}function patchUpdates(_0x148ec9){return function(_0xf5b9d3){try{jsonpatch[_0x5789('0x27')](_0xf5b9d3,_0x148ec9,!![]);}catch(_0x37d0fe){return BPromise[_0x5789('0x28')](_0x37d0fe);}return _0xf5b9d3[_0x5789('0x29')]();};}function saveUpdates(_0x358b22,_0x34d0b0){return function(_0x1c3220){if(_0x1c3220){return _0x1c3220['update'](_0x358b22)['then'](function(_0x98808d){return _0x98808d;});}return null;};}function removeEntity(_0x2b13e1,_0x2bb640){return function(_0x4361f3){if(_0x4361f3){return _0x4361f3[_0x5789('0x2a')]()[_0x5789('0x2b')](function(){var _0x204174=_0x4361f3[_0x5789('0x2c')]({'plain':!![]});var _0x27b56e='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x27b56e,'resourceId':_0x204174['id']}})[_0x5789('0x2b')](function(){return _0x4361f3;});})['then'](function(){_0x2b13e1[_0x5789('0x1e')](0xcc)[_0x5789('0x1f')]();});}};}function handleEntityNotFound(_0x4cacf5,_0x1ab28b){return function(_0x59a764){if(!_0x59a764){_0x4cacf5[_0x5789('0x2d')](0x194);}return _0x59a764;};}function handleError(_0x188bc5,_0x13fd7d){_0x13fd7d=_0x13fd7d||0x1f4;return function(_0x3f5f76){logger[_0x5789('0x2e')](_0x3f5f76[_0x5789('0x2f')]);if(_0x3f5f76[_0x5789('0x30')]){delete _0x3f5f76[_0x5789('0x30')];}_0x188bc5[_0x5789('0x1e')](_0x13fd7d)[_0x5789('0x31')](_0x3f5f76);};}exports['index']=function(_0x1db1dc,_0x44478a){var _0x1c0efd={},_0x53f50e={},_0x21b9fd={'count':0x0,'rows':[]};var _0x2e12eb=_[_0x5789('0x32')](db[_0x5789('0x33')][_0x5789('0x34')],function(_0x282cf8){return{'name':_0x282cf8[_0x5789('0x35')],'type':_0x282cf8[_0x5789('0x36')][_0x5789('0x37')]};});_0x53f50e[_0x5789('0x38')]=_[_0x5789('0x32')](_0x2e12eb,'name');_0x53f50e[_0x5789('0x39')]=_[_0x5789('0x3a')](_0x1db1dc[_0x5789('0x39')]);_0x53f50e[_0x5789('0x3b')]=_['intersection'](_0x53f50e[_0x5789('0x38')],_0x53f50e[_0x5789('0x39')]);_0x1c0efd[_0x5789('0x3c')]=_[_0x5789('0x3d')](_0x53f50e[_0x5789('0x38')],qs[_0x5789('0x3e')](_0x1db1dc['query']['fields']));_0x1c0efd[_0x5789('0x3c')]=_0x1c0efd['attributes']['length']?_0x1c0efd[_0x5789('0x3c')]:_0x53f50e['model'];if(!_0x1db1dc['query']['hasOwnProperty']('nolimit')){_0x1c0efd[_0x5789('0x21')]=qs[_0x5789('0x21')](_0x1db1dc[_0x5789('0x39')][_0x5789('0x21')]);_0x1c0efd[_0x5789('0x23')]=qs[_0x5789('0x23')](_0x1db1dc['query'][_0x5789('0x23')]);}_0x1c0efd[_0x5789('0x3f')]=qs[_0x5789('0x40')](_0x1db1dc['query'][_0x5789('0x40')]);_0x1c0efd['where']=qs[_0x5789('0x3b')](_['pick'](_0x1db1dc['query'],_0x53f50e[_0x5789('0x3b')]),_0x2e12eb);if(_0x1db1dc['query']['filter']){_0x1c0efd[_0x5789('0x41')]=_[_0x5789('0x42')](_0x1c0efd[_0x5789('0x41')],{'$or':_[_0x5789('0x32')](_0x2e12eb,function(_0x66fb76){if(_0x66fb76['type']!==_0x5789('0x43')){var _0xb8f5e4={};_0xb8f5e4[_0x66fb76['name']]={'$like':'%'+_0x1db1dc[_0x5789('0x39')]['filter']+'%'};return _0xb8f5e4;}})});}_0x1c0efd=_[_0x5789('0x42')]({},_0x1c0efd,_0x1db1dc[_0x5789('0x44')]);var _0x10cb89={'where':_0x1c0efd[_0x5789('0x41')]};return db[_0x5789('0x33')][_0x5789('0x24')](_0x10cb89)[_0x5789('0x2b')](function(_0x1f33aa){_0x21b9fd[_0x5789('0x24')]=_0x1f33aa;if(_0x1db1dc[_0x5789('0x39')][_0x5789('0x45')]){_0x1c0efd[_0x5789('0x46')]=[{'all':!![]}];}return db[_0x5789('0x33')][_0x5789('0x47')](_0x1c0efd);})['then'](function(_0x5914ef){_0x21b9fd[_0x5789('0x48')]=_0x5914ef;return _0x21b9fd;})[_0x5789('0x2b')](respondWithFilteredResult(_0x44478a,_0x1c0efd))[_0x5789('0x49')](handleError(_0x44478a,null));};exports[_0x5789('0x4a')]=function(_0x350bec,_0x4c6c61){var _0x257e93={'raw':!![],'where':{'id':_0x350bec[_0x5789('0x4b')]['id']}},_0x313e0a={};_0x313e0a[_0x5789('0x38')]=_[_0x5789('0x3a')](db[_0x5789('0x33')]['rawAttributes']);_0x313e0a[_0x5789('0x39')]=_[_0x5789('0x3a')](_0x350bec[_0x5789('0x39')]);_0x313e0a['filters']=_[_0x5789('0x3d')](_0x313e0a[_0x5789('0x38')],_0x313e0a[_0x5789('0x39')]);_0x257e93['attributes']=_[_0x5789('0x3d')](_0x313e0a[_0x5789('0x38')],qs[_0x5789('0x3e')](_0x350bec[_0x5789('0x39')][_0x5789('0x3e')]));_0x257e93[_0x5789('0x3c')]=_0x257e93[_0x5789('0x3c')][_0x5789('0x4c')]?_0x257e93[_0x5789('0x3c')]:_0x313e0a[_0x5789('0x38')];if(_0x350bec[_0x5789('0x39')][_0x5789('0x45')]){_0x257e93[_0x5789('0x46')]=[{'all':!![]}];}_0x257e93=_[_0x5789('0x42')]({},_0x257e93,_0x350bec[_0x5789('0x44')]);return db[_0x5789('0x33')][_0x5789('0x4d')](_0x257e93)[_0x5789('0x2b')](handleEntityNotFound(_0x4c6c61,null))[_0x5789('0x2b')](respondWithResult(_0x4c6c61,null))[_0x5789('0x49')](handleError(_0x4c6c61,null));};exports[_0x5789('0x4e')]=function(_0x4078ec,_0x3af167,_0x34f36e){return db[_0x5789('0x33')][_0x5789('0x4d')]({'where':{'id':_0x4078ec['params']['id']},'attributes':[_0x5789('0x30'),'path'],'raw':!![]})[_0x5789('0x2b')](handleEntityNotFound(_0x3af167,null))[_0x5789('0x2b')](function(_0x14c40f){if(_0x14c40f){var _0x431de6=path[_0x5789('0x4f')](config[_0x5789('0x50')],'server/files/plugins',util['format']('%s.zip',path['basename'](_0x14c40f[_0x5789('0x5')])));var _0x5a99f8=fs[_0x5789('0x51')](_0x431de6);var _0x4927b0=archiver(_0x5789('0x52'),{'zlib':{'level':0x9}});_0x4927b0['on'](_0x5789('0x53'),function(_0x193aff){if(_0x193aff[_0x5789('0x54')]===_0x5789('0x55')){logger[_0x5789('0x2e')](_0x193aff);}else{throw new db[(_0x5789('0x56'))][(_0x5789('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4927b0['on']('error',function(_0x27174a){throw new db[(_0x5789('0x56'))][(_0x5789('0x57'))](_0x5789('0x58'));});_0x4927b0[_0x5789('0x59')](_0x5a99f8);_0x4927b0[_0x5789('0x5a')](_0x5789('0x5b'),{'cwd':path['join'](config['root'],_0x5789('0x5c'),path['dirname'](_0x14c40f['path'])),'ignore':[path[_0x5789('0x4f')](path[_0x5789('0x5d')](_0x14c40f['path']),_0x5789('0x5e')),path['join'](path[_0x5789('0x5d')](_0x14c40f[_0x5789('0x5')]),_0x5789('0x5f'))],'nodir':!![]})[_0x5789('0x60')]();_0x5a99f8['on']('close',function(){if(!fs[_0x5789('0x61')](_0x431de6)){throw new db[(_0x5789('0x56'))][(_0x5789('0x57'))]('Plugin\x20not\x20found');}return _0x3af167[_0x5789('0x4e')](_0x431de6,util[_0x5789('0x62')](_0x5789('0x63'),path[_0x5789('0x5d')](_0x14c40f[_0x5789('0x5')])),function(_0x15c7cc){if(_0x15c7cc){throw new db['Sequelize'][(_0x5789('0x57'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x5789('0x64')](_0x431de6);logger['info'](_0x5789('0x65'));logger[_0x5789('0x66')](_0x5789('0x67'));});});}return null;})[_0x5789('0x49')](handleError(_0x3af167,null));};exports[_0x5789('0x68')]=function(_0x4b1179,_0x52d9ef,_0x30afac){var _0x395b61=path['basename'](_0x4b1179['file']['filename'],path[_0x5789('0x69')](_0x4b1179['file'][_0x5789('0x6a')]));var _0x3b49b0=path[_0x5789('0x4f')](config['root'],_0x5789('0x5c'),_0x4b1179[_0x5789('0x6b')][_0x5789('0x6a')]);var _0x33d3e8=path[_0x5789('0x4f')](config[_0x5789('0x50')],_0x5789('0x5c'),_0x395b61);logger[_0x5789('0x66')](_0x5789('0x6c'),_0x3b49b0);logger[_0x5789('0x66')](_0x5789('0x6d'),_0x33d3e8);try{fs['chmodSync'](_0x3b49b0,parseInt('0777',0x8));extract(_0x3b49b0,{'dir':_0x33d3e8},function(_0x2b6b28){if(_0x2b6b28){logger['error'](_0x2b6b28);handleError(_0x2b6b28,!![]);};var _0x1f0856=fs[_0x5789('0x6e')](_0x33d3e8);if(_0x1f0856['length']>0x1){removeReferences(_0x3b49b0,_0x33d3e8);logger[_0x5789('0x2e')]('Invalid\x20plugin\x20structure');return _0x30afac(new Error(_0x5789('0x6f')));}var _0x485b82=fs[_0x5789('0x70')](path[_0x5789('0x4f')](_0x33d3e8,_0x1f0856[0x0]));if(_0x485b82[_0x5789('0x71')]()){removeReferences(_0x3b49b0,_0x33d3e8);logger[_0x5789('0x2e')](_0x5789('0x6f'));return _0x30afac(new Error('Invalid\x20plugin\x20structure'));}if(_0x485b82[_0x5789('0x72')]()){var _0x590d1a=fs['readdirSync'](path[_0x5789('0x4f')](_0x33d3e8,_0x1f0856[0x0]));if(_0x590d1a[_0x5789('0x4c')]===0x0){removeReferences(_0x3b49b0,_0x33d3e8);logger[_0x5789('0x2e')](_0x5789('0x6f'));return _0x30afac(new Error(_0x5789('0x6f')));}var _0x49f337=_0x590d1a[_0x5789('0x73')](function(_0x3c4cf1){return _0x3c4cf1==='manifest.json';});if(!_0x49f337){return _0x30afac(new Error('Plugin\x20manifest\x20missing'));}var _0x3fa9b8=fs['readFileSync'](path[_0x5789('0x4f')](_0x33d3e8,_0x1f0856[0x0],_0x5789('0x74')));var _0x492b3c=JSON[_0x5789('0x75')](_0x3fa9b8);if(_0x5789('0x22')==typeof _0x492b3c['name']){return _0x30afac(new Error(_0x5789('0x76')));}if(_0x5789('0x22')==typeof _0x492b3c[_0x5789('0x36')]){return _0x30afac(new Error(_0x5789('0x77')));}if(_0x5789('0x22')==typeof _0x492b3c[_0x5789('0x78')]){return _0x30afac(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x5789('0x22')==typeof _0x492b3c[_0x5789('0x79')]){return _0x30afac(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x492b3c['type']===_0x5789('0x7a')){if('undefined'==typeof _0x492b3c[_0x5789('0x79')]['views']){return _0x30afac(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x492b3c[_0x5789('0x79')][_0x5789('0x7b')][_0x5789('0x7c')]&&'undefined'==typeof _0x492b3c[_0x5789('0x79')]['views'][_0x5789('0x7d')]){return _0x30afac(new Error(_0x5789('0x7e')));}}else if(_0x492b3c[_0x5789('0x36')]==='script'){if(_0x5789('0x22')==typeof _0x492b3c[_0x5789('0x79')][_0x5789('0x7f')]){return _0x30afac(new Error(_0x5789('0x80')));}if('undefined'==typeof _0x492b3c[_0x5789('0x79')][_0x5789('0x81')]){return _0x30afac(new Error(_0x5789('0x82')));}}else{return _0x30afac(new Error(_0x5789('0x83')));}var _0x16be67=_0x492b3c[_0x5789('0x30')];var _0x199b5c=_0x492b3c[_0x5789('0x84')];var _0x5c208f=_0x492b3c[_0x5789('0x36')];var _0x5414d4=_0x492b3c[_0x5789('0x85')]?_0x492b3c['sidebar']:'always';var _0x4b88b4=_0x492b3c['icon']?_0x492b3c[_0x5789('0x86')]:'icon-apps';var _0x1f19c7='';var _0x449476='';var _0xc5719a='';var _0x476c51='';var _0x206002=_0x492b3c[_0x5789('0x78')];if(_0x5c208f===_0x5789('0x7a')){if(_0x5789('0x22')!=typeof _0x492b3c[_0x5789('0x79')][_0x5789('0x7b')][_0x5789('0x7c')]){var _0x28491b=_0x492b3c[_0x5789('0x79')][_0x5789('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5789('0x87')](_0x28491b)){_0x1f19c7=path[_0x5789('0x4f')](_0x5789('0x88'),_0x395b61,_0x1f0856[0x0],_0x28491b);}else{_0x1f19c7=_0x28491b;}}else{logger[_0x5789('0x66')](_0x5789('0x89'));}if(_0x5789('0x22')!=typeof _0x492b3c['parameters'][_0x5789('0x7b')][_0x5789('0x7d')]){var _0x1e69ac=_0x492b3c[_0x5789('0x79')][_0x5789('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5789('0x87')](_0x1e69ac)){_0x449476=path[_0x5789('0x4f')]('plugins',_0x395b61,_0x1f0856[0x0],_0x1e69ac);}else{_0x449476=_0x1e69ac;}}else{logger[_0x5789('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5c208f==='script'){_0xc5719a=_0x492b3c[_0x5789('0x79')][_0x5789('0x7f')];_0x476c51=_0x492b3c[_0x5789('0x79')][_0x5789('0x81')];if(_0x5789('0x22')!=typeof _0x492b3c[_0x5789('0x79')][_0x5789('0x7b')]){if(_0x5789('0x22')!=typeof _0x492b3c[_0x5789('0x79')][_0x5789('0x7b')][_0x5789('0x7c')]){var _0x28491b=_0x492b3c[_0x5789('0x79')][_0x5789('0x7b')][_0x5789('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x28491b)){_0x1f19c7=path['join'](_0x5789('0x88'),_0x395b61,_0x1f0856[0x0],_0x28491b);}else{_0x1f19c7=_0x28491b;}}if('undefined'!=typeof _0x492b3c['parameters'][_0x5789('0x7b')][_0x5789('0x7d')]){var _0x1e69ac=_0x492b3c[_0x5789('0x79')][_0x5789('0x7b')][_0x5789('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x5789('0x87')](_0x1e69ac)){_0x449476=path[_0x5789('0x4f')](_0x5789('0x88'),_0x395b61,_0x1f0856[0x0],_0x1e69ac);}else{_0x449476=_0x1e69ac;}}}}var _0x4503d1={'name':_0x16be67,'description':_0x199b5c,'path':path[_0x5789('0x4f')](_0x395b61,_0x1f0856[0x0]),'type':_0x5c208f,'sidebar':_0x5414d4,'icon':_0x4b88b4,'adminUrl':_0x1f19c7,'agentUrl':_0x449476,'scriptName':_0xc5719a,'scriptPath':_0x476c51,'version':_0x206002};removeReferences(_0x3b49b0,null);return db[_0x5789('0x33')][_0x5789('0x8a')](_0x4503d1)[_0x5789('0x2b')](function(_0xfd0bc){var _0xd4508a={'role':_0x4b1179[_0x5789('0x8b')]['role'],'userProfileId':_0x4b1179[_0x5789('0x8b')]['userProfileId']};if(!_0xd4508a)throw new Error(_0x5789('0x8c'));if(_0xd4508a['role']===_0x5789('0x8d')){var _0x4b0e15=_0xfd0bc[_0x5789('0x2c')]({'plain':!![]});return db[_0x5789('0x8e')][_0x5789('0x4d')]({'where':{'name':'Plugins','userProfileId':_0xd4508a[_0x5789('0x8f')]},'raw':!![]})[_0x5789('0x2b')](function(_0x39f72d){if(_0x39f72d&&_0x39f72d[_0x5789('0x90')]===0x0){return db[_0x5789('0x91')][_0x5789('0x8a')]({'name':_0x4b0e15[_0x5789('0x30')],'resourceId':_0x4b0e15['id'],'type':_0x39f72d[_0x5789('0x30')],'sectionId':_0x39f72d['id']},{})[_0x5789('0x2b')](function(){return _0xfd0bc;});}else{return _0xfd0bc;}})[_0x5789('0x49')](function(_0x288884){logger[_0x5789('0x2e')](_0x5789('0x92'),_0x288884);throw _0x288884;});}return _0xfd0bc;})['then'](respondWithResult(_0x52d9ef,null))['catch'](handleError(_0x52d9ef,null));}});}catch(_0x5b2019){_0x52d9ef[_0x5789('0x1e')](0x1f4)[_0x5789('0x31')](_0x5b2019);}};function removeReferences(_0x4171d3,_0x279e87){try{if(_0x4171d3){fs[_0x5789('0x64')](_0x4171d3);logger[_0x5789('0x66')](_0x5789('0x93'));}if(_0x279e87){rimraf(_0x279e87,function(){});logger[_0x5789('0x66')](_0x5789('0x94'));}}catch(_0x46bd62){logger[_0x5789('0x2e')](_0x46bd62);}}exports[_0x5789('0x95')]=function(_0x3ab864,_0x2c2bd4,_0x1a0bfd){return db[_0x5789('0x33')][_0x5789('0x4d')]({'where':{'id':_0x3ab864[_0x5789('0x4b')]['id']}})[_0x5789('0x2b')](handleEntityNotFound(_0x2c2bd4,null))[_0x5789('0x2b')](saveUpdates(_0x3ab864[_0x5789('0x8b')],null))[_0x5789('0x2b')](respondWithResult(_0x2c2bd4,null))[_0x5789('0x49')](handleError(_0x2c2bd4,null));};exports['delete']=function(_0x474efb,_0x2264ee,_0x3ebd46){return db['Plugin']['find']({'where':{'id':_0x474efb[_0x5789('0x4b')]['id']}})[_0x5789('0x2b')](function(_0x111f68){if(_0x111f68){return _0x111f68['destroy']();}})[_0x5789('0x2b')](function(_0x39451e){rimraf(path[_0x5789('0x4f')](config['root'],_0x5789('0x5c'),path[_0x5789('0x96')](_0x39451e[_0x5789('0x5')])),function(){});return _0x39451e;})[_0x5789('0x2b')](handleEntityNotFound(_0x2264ee,null))[_0x5789('0x2b')](respondWithStatusCode(_0x2264ee,null))[_0x5789('0x49')](handleError(_0x2264ee,null));};exports[_0x5789('0x97')]=function(_0x448630,_0x201c98,_0x580469){return BPromise[_0x5789('0x98')]()[_0x5789('0x2b')](function(){if(!_0x448630[_0x5789('0x39')][_0x5789('0x5')]){throw new Error(_0x5789('0x99'));}if(!_0x448630[_0x5789('0x39')][_0x5789('0x9a')]){throw new Error(_0x5789('0x9b'));}var _0x5731a9=_0x448630[_0x5789('0x39')]['hostname']?_0x448630[_0x5789('0x39')][_0x5789('0x9c')]+':'+_0x448630[_0x5789('0x39')]['port']:_0x5789('0x9d')+_0x448630[_0x5789('0x39')][_0x5789('0x9a')];var _0x3fa6d6=_0x448630[_0x5789('0x39')]['json']?_0x448630[_0x5789('0x39')][_0x5789('0x20')]:!![];var _0x2679a7=_0x448630[_0x5789('0x39')][_0x5789('0x9e')]?_0x448630[_0x5789('0x39')][_0x5789('0x9e')]:null;var _0x300dd8={'method':_0x448630[_0x5789('0x9f')],'uri':util[_0x5789('0x62')](_0x5789('0xa0'),_0x5731a9,_0x448630[_0x5789('0x39')][_0x5789('0x5')]),'json':_0x3fa6d6,'resolveWithFullResponse':!![],'encoding':_0x2679a7,'qs':_0x448630[_0x5789('0x39')]};if(_0x448630['headers']){_0x300dd8[_0x5789('0xa1')]=_0x448630[_0x5789('0xa1')];if(_0x300dd8['headers'][_0x5789('0xa2')]){delete _0x300dd8[_0x5789('0xa1')][_0x5789('0xa2')];}}if(_0x300dd8[_0x5789('0xa1')][_0x5789('0xa3')]){delete _0x300dd8['headers'][_0x5789('0xa3')];}return rp(_0x300dd8);})[_0x5789('0x2b')](function(_0x55443d){if(_0x55443d){_0x201c98[_0x5789('0x25')](_0x55443d[_0x5789('0xa1')]);logger[_0x5789('0x66')](_0x55443d[_0x5789('0x8b')]);if(_[_0x5789('0xa4')](_0x448630[_0x5789('0x39')][_0x5789('0x5')],_0x5789('0x4e'))&&_0x55443d[_0x5789('0xa5')]==0x1f4){return _0x201c98[_0x5789('0x2d')](_0x55443d['statusCode']);}else{return _0x201c98[_0x5789('0x1e')](_0x55443d[_0x5789('0xa5')])['send'](_0x55443d[_0x5789('0x8b')]);}}else{return _0x201c98[_0x5789('0x2d')](0xc8);}})[_0x5789('0x49')](handleError(_0x201c98,null));};exports[_0x5789('0xa6')]=function(_0x363acb,_0x1d50bd,_0xdde86){return BPromise[_0x5789('0x98')]()[_0x5789('0x2b')](function(){if(!_0x363acb['query'][_0x5789('0x5')]){throw new Error(_0x5789('0x99'));}if(!_0x363acb[_0x5789('0x39')][_0x5789('0x9a')]){throw new Error(_0x5789('0x9b'));}var _0x23e75e=_0x363acb['query'][_0x5789('0x9c')]?_0x363acb[_0x5789('0x39')][_0x5789('0x9c')]+':'+_0x363acb['query']['port']:_0x5789('0x9d')+_0x363acb[_0x5789('0x39')]['port'];var _0x2bbd98=_0x363acb[_0x5789('0x39')][_0x5789('0x20')]?_0x363acb[_0x5789('0x39')]['json']:!![];var _0x47d4d3=_0x363acb[_0x5789('0x39')][_0x5789('0x9e')]?_0x363acb[_0x5789('0x39')][_0x5789('0x9e')]:null;var _0x4d288e={'method':_0x363acb[_0x5789('0x9f')],'uri':util['format'](_0x5789('0xa0'),_0x23e75e,_0x363acb[_0x5789('0x39')][_0x5789('0x5')]),'json':_0x2bbd98,'resolveWithFullResponse':!![],'encoding':_0x47d4d3,'body':_0x363acb[_0x5789('0x8b')]};if(_0x363acb[_0x5789('0xa1')]){_0x4d288e['headers']=_0x363acb[_0x5789('0xa1')];if(_0x4d288e['headers']['content-length']){delete _0x4d288e[_0x5789('0xa1')][_0x5789('0xa2')];}}if(_0x4d288e[_0x5789('0xa1')][_0x5789('0xa3')]){delete _0x4d288e[_0x5789('0xa1')][_0x5789('0xa3')];}return rp(_0x4d288e);})[_0x5789('0x2b')](function(_0x52f723){if(_0x52f723){_0x1d50bd[_0x5789('0x25')](_0x52f723[_0x5789('0xa1')]);logger[_0x5789('0x66')](_0x52f723['body']);return _0x1d50bd['status'](_0x52f723[_0x5789('0xa5')])[_0x5789('0x31')](_0x52f723['body']);}else{return _0x1d50bd['sendStatus'](0xc8);}})['catch'](handleError(_0x1d50bd,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8204fb6..7066244 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 _0x8085=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x57fd40,_0x391864){var _0x5a6b51=function(_0x4dc485){while(--_0x4dc485){_0x57fd40['push'](_0x57fd40['shift']());}};_0x5a6b51(++_0x391864);}(_0x8085,0x71));var _0x5808=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x8085[_0x2f5a22];return _0x326b70;};'use strict';var EventEmitter=require(_0x5808('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x5808('0x1')](0x0);var events={'afterCreate':_0x5808('0x2'),'afterUpdate':_0x5808('0x3'),'afterDestroy':_0x5808('0x4')};function emitEvent(_0x5565fd){return function(_0x55952d,_0x46a877,_0x32aa93){PluginEvents['emit'](_0x5565fd+':'+_0x55952d['id'],_0x55952d);PluginEvents[_0x5808('0x5')](_0x5565fd,_0x55952d);_0x32aa93(null);};}for(var e in events){if(events[_0x5808('0x6')](e)){var event=events[e];Plugin[_0x5808('0x7')](e,emitEvent(event));}}module[_0x5808('0x8')]=PluginEvents; \ No newline at end of file +var _0x8a5c=['emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a5c,0x112));var _0xc8a5=function(_0x405b97,_0x5efe2c){_0x405b97=_0x405b97-0x0;var _0x4bd69d=_0x8a5c[_0x405b97];return _0x4bd69d;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xc8a5('0x0'))['db'][_0xc8a5('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xc8a5('0x2')](0x0);var events={'afterCreate':_0xc8a5('0x3'),'afterUpdate':_0xc8a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe06918){return function(_0x2f628e,_0x5e4dda,_0x2931ea){PluginEvents['emit'](_0xe06918+':'+_0x2f628e['id'],_0x2f628e);PluginEvents[_0xc8a5('0x5')](_0xe06918,_0x2f628e);_0x2931ea(null);};}for(var e in events){if(events[_0xc8a5('0x6')](e)){var event=events[e];Plugin[_0xc8a5('0x7')](e,emitEvent(event));}}module[_0xc8a5('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 47b0d35..dd4b64a 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 _0x9512=['bluebird','request-promise','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment'];(function(_0x410e2f,_0x5b3989){var _0x2553f0=function(_0x4be816){while(--_0x4be816){_0x410e2f['push'](_0x410e2f['shift']());}};_0x2553f0(++_0x5b3989);}(_0x9512,0x1ac));var _0x2951=function(_0x35825e,_0x657421){_0x35825e=_0x35825e-0x0;var _0x4f4d90=_0x9512[_0x35825e];return _0x4f4d90;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var logger=require(_0x2951('0x2'))('api');var moment=require(_0x2951('0x3'));var BPromise=require(_0x2951('0x4'));var rp=require(_0x2951('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2951('0x6'));var attributes=require(_0x2951('0x7'));module[_0x2951('0x8')]=function(_0x4448b3,_0x363f0d){return _0x4448b3[_0x2951('0x9')](_0x2951('0xa'),attributes,{'tableName':_0x2951('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf2d=['moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','define','plugins','util'];(function(_0x500d82,_0x1d3db0){var _0x371a97=function(_0x5be2c1){while(--_0x5be2c1){_0x500d82['push'](_0x500d82['shift']());}};_0x371a97(++_0x1d3db0);}(_0xaf2d,0xbc));var _0xdaf2=function(_0x3e47da,_0x109260){_0x3e47da=_0x3e47da-0x0;var _0x4ea942=_0xaf2d[_0x3e47da];return _0x4ea942;};'use strict';var _=require('lodash');var util=require(_0xdaf2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdaf2('0x1'));var BPromise=require(_0xdaf2('0x2'));var rp=require(_0xdaf2('0x3'));var fs=require('fs');var path=require(_0xdaf2('0x4'));var rimraf=require('rimraf');var config=require(_0xdaf2('0x5'));var attributes=require(_0xdaf2('0x6'));module['exports']=function(_0x2374bc,_0x549b8d){return _0x2374bc[_0xdaf2('0x7')]('Plugin',attributes,{'tableName':_0xdaf2('0x8'),'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 d105c47..4824c69 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 _0x2f2d=['http','redis','defaults','socket.io-emitter','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','CreatePlugin','body','options','raw','then','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x232579,_0xbcc905){var _0x2ba56f=function(_0x36de8d){while(--_0x36de8d){_0x232579['push'](_0x232579['shift']());}};_0x2ba56f(++_0xbcc905);}(_0x2f2d,0x17f));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd2f2('0x0'));var moment=require(_0xd2f2('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2f2('0x2'));var fs=require('fs');var Redis=require(_0xd2f2('0x3'));var db=require(_0xd2f2('0x4'))['db'];var utils=require(_0xd2f2('0x5'));var logger=require('../../config/logger')(_0xd2f2('0x6'));var config=require('../../config/environment');var jayson=require(_0xd2f2('0x7'));var client=jayson[_0xd2f2('0x8')][_0xd2f2('0x9')]({'port':0x232a});config[_0xd2f2('0xa')]=_[_0xd2f2('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd2f2('0xc'))(new Redis(config[_0xd2f2('0xa')]));require(_0xd2f2('0xd'))[_0xd2f2('0xe')](socket);function respondWithRpcPromise(_0x5997bb,_0x363886,_0x357026){return new BPromise(function(_0x19413d,_0x1fca2f){return client['request'](_0x5997bb,_0x357026)['then'](function(_0x1056cd){logger[_0xd2f2('0xf')](_0xd2f2('0x10'),_0x363886,_0xd2f2('0x11'));logger[_0xd2f2('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x363886,_0xd2f2('0x11'),JSON['stringify'](_0x1056cd));if(_0x1056cd[_0xd2f2('0x13')]){if(_0x1056cd[_0xd2f2('0x13')]['code']===0x1f4){logger[_0xd2f2('0x13')](_0xd2f2('0x10'),_0x363886,_0x1056cd[_0xd2f2('0x13')][_0xd2f2('0x14')]);return _0x1fca2f(_0x1056cd[_0xd2f2('0x13')][_0xd2f2('0x14')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x363886,_0x1056cd[_0xd2f2('0x13')][_0xd2f2('0x14')]);return _0x19413d(_0x1056cd['error'][_0xd2f2('0x14')]);}else{logger[_0xd2f2('0xf')](_0xd2f2('0x10'),_0x363886,_0xd2f2('0x11'));_0x19413d(_0x1056cd['result'][_0xd2f2('0x14')]);}})[_0xd2f2('0x15')](function(_0x38c677){logger[_0xd2f2('0x13')](_0xd2f2('0x10'),_0x363886,_0x38c677);_0x1fca2f(_0x38c677);});});}exports[_0xd2f2('0x16')]=function(_0x3296fe){var _0x13000c=this;return new Promise(function(_0x2df5ca,_0x15bd02){return db['Plugin']['create'](_0x3296fe[_0xd2f2('0x17')],{'raw':_0x3296fe['options']?_0x3296fe[_0xd2f2('0x18')][_0xd2f2('0x19')]===undefined?!![]:![]:!![]})[_0xd2f2('0x1a')](function(_0x197501){logger[_0xd2f2('0xf')](_0xd2f2('0x16'),_0x3296fe);logger['debug'](_0xd2f2('0x16'),_0x3296fe,JSON[_0xd2f2('0x1b')](_0x197501));_0x2df5ca(_0x197501);})[_0xd2f2('0x15')](function(_0x19e6e0){logger[_0xd2f2('0x13')](_0xd2f2('0x16'),_0x19e6e0[_0xd2f2('0x14')],_0x3296fe);_0x15bd02(_0x13000c['error'](0x1f4,_0x19e6e0[_0xd2f2('0x14')]));});});}; \ No newline at end of file +var _0x53a1=['../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x53a1,0x9d));var _0x153a=function(_0x4c63da,_0x2076f7){_0x4c63da=_0x4c63da-0x0;var _0x4de585=_0x53a1[_0x4c63da];return _0x4de585;};'use strict';var _=require(_0x153a('0x0'));var util=require(_0x153a('0x1'));var moment=require(_0x153a('0x2'));var BPromise=require(_0x153a('0x3'));var rs=require(_0x153a('0x4'));var fs=require('fs');var Redis=require(_0x153a('0x5'));var db=require(_0x153a('0x6'))['db'];var utils=require(_0x153a('0x7'));var logger=require(_0x153a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x153a('0x9'));var client=jayson['client'][_0x153a('0xa')]({'port':0x232a});config[_0x153a('0xb')]=_[_0x153a('0xc')](config['redis'],{'host':_0x153a('0xd'),'port':0x18eb});var socket=require(_0x153a('0xe'))(new Redis(config[_0x153a('0xb')]));require('./plugin.socket')[_0x153a('0xf')](socket);function respondWithRpcPromise(_0x27f8d3,_0x911fed,_0xd568ed){return new BPromise(function(_0x5ce0d1,_0x1bc152){return client[_0x153a('0x10')](_0x27f8d3,_0xd568ed)[_0x153a('0x11')](function(_0x265f5e){logger[_0x153a('0x12')]('Plugin,\x20%s,\x20%s',_0x911fed,_0x153a('0x13'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x911fed,'request\x20sent',JSON[_0x153a('0x14')](_0x265f5e));if(_0x265f5e[_0x153a('0x15')]){if(_0x265f5e[_0x153a('0x15')][_0x153a('0x16')]===0x1f4){logger[_0x153a('0x15')](_0x153a('0x17'),_0x911fed,_0x265f5e[_0x153a('0x15')][_0x153a('0x18')]);return _0x1bc152(_0x265f5e[_0x153a('0x15')][_0x153a('0x18')]);}logger[_0x153a('0x15')](_0x153a('0x17'),_0x911fed,_0x265f5e[_0x153a('0x15')]['message']);return _0x5ce0d1(_0x265f5e['error']['message']);}else{logger[_0x153a('0x12')]('Plugin,\x20%s,\x20%s',_0x911fed,'request\x20sent');_0x5ce0d1(_0x265f5e[_0x153a('0x19')]['message']);}})['catch'](function(_0x24196e){logger['error'](_0x153a('0x17'),_0x911fed,_0x24196e);_0x1bc152(_0x24196e);});});}exports[_0x153a('0x1a')]=function(_0x381b1e){var _0x2c6bca=this;return new Promise(function(_0x85cb4c,_0x29c98e){return db[_0x153a('0x1b')]['create'](_0x381b1e[_0x153a('0x1c')],{'raw':_0x381b1e['options']?_0x381b1e[_0x153a('0x1d')][_0x153a('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5d9133){logger[_0x153a('0x12')]('CreatePlugin',_0x381b1e);logger[_0x153a('0x1f')](_0x153a('0x1a'),_0x381b1e,JSON[_0x153a('0x14')](_0x5d9133));_0x85cb4c(_0x5d9133);})[_0x153a('0x20')](function(_0x1392e1){logger['error'](_0x153a('0x1a'),_0x1392e1[_0x153a('0x18')],_0x381b1e);_0x29c98e(_0x2c6bca['error'](0x1f4,_0x1392e1[_0x153a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 9e9cc97..de87485 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 _0x47ea=['length','plugin:','save','remove','emit','removeListener','register'];(function(_0xef814,_0x4142a2){var _0x4ee2c9=function(_0x89c640){while(--_0x89c640){_0xef814['push'](_0xef814['shift']());}};_0x4ee2c9(++_0x4142a2);}(_0x47ea,0xb8));var _0xa47e=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x47ea[_0x3ff085];return _0x2b68c3;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xa47e('0x0'),_0xa47e('0x1'),'update'];function createListener(_0x38fff2,_0x2666ff){return function(_0x1e0d13){_0x2666ff[_0xa47e('0x2')](_0x38fff2,_0x1e0d13);};}function removeListener(_0x93f7d2,_0x39dde3){return function(){PluginEvents[_0xa47e('0x3')](_0x93f7d2,_0x39dde3);};}exports[_0xa47e('0x4')]=function(_0x3ed4f6){for(var _0x3c1932=0x0,_0x559e33=events[_0xa47e('0x5')];_0x3c1932<_0x559e33;_0x3c1932++){var _0x1ba351=events[_0x3c1932];var _0x1224f0=createListener(_0xa47e('0x6')+_0x1ba351,_0x3ed4f6);PluginEvents['on'](_0x1ba351,_0x1224f0);}}; \ No newline at end of file +var _0x346f=['length','plugin:','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0x97d6d5,_0x4453e7){var _0x3baaa2=function(_0x1df1a8){while(--_0x1df1a8){_0x97d6d5['push'](_0x97d6d5['shift']());}};_0x3baaa2(++_0x4453e7);}(_0x346f,0xd1));var _0xf346=function(_0x53fa2,_0x3e89fb){_0x53fa2=_0x53fa2-0x0;var _0x1a22d5=_0x346f[_0x53fa2];return _0x1a22d5;};'use strict';var PluginEvents=require(_0xf346('0x0'));var events=[_0xf346('0x1'),_0xf346('0x2'),_0xf346('0x3')];function createListener(_0x429c21,_0x2f7454){return function(_0x4893e6){_0x2f7454[_0xf346('0x4')](_0x429c21,_0x4893e6);};}function removeListener(_0x3c5b22,_0x106c9a){return function(){PluginEvents[_0xf346('0x5')](_0x3c5b22,_0x106c9a);};}exports[_0xf346('0x6')]=function(_0xb7edb3){for(var _0x580ac3=0x0,_0x32cf21=events[_0xf346('0x7')];_0x580ac3<_0x32cf21;_0x580ac3++){var _0x15ed10=events[_0x580ac3];var _0x42d613=createListener(_0xf346('0x8')+_0x15ed10,_0xb7edb3);PluginEvents['on'](_0x15ed10,_0x42d613);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 37de29e..9a21712 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(_0x3091ef,_0x5e3c99){var _0xee7dc7=function(_0x51c23b){while(--_0x51c23b){_0x3091ef['push'](_0x3091ef['shift']());}};_0xee7dc7(++_0x5e3c99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x500937,_0x14ab05){var _0x11fb02=function(_0x2848f5){while(--_0x2848f5){_0x500937['push'](_0x500937['shift']());}};_0x11fb02(++_0x14ab05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 06fcf6d..fac2c6f 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 _0x3c81=['../../config/pm2','api','path','sendStatus','status','error','stack','name','send','npm\x20install','info','index','then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3c81,0x102));var _0x13c8=function(_0x405eef,_0x357f36){_0x405eef=_0x405eef-0x0;var _0xeee697=_0x3c81[_0x405eef];return _0xeee697;};'use strict';var _=require(_0x13c8('0x0'));var pm2=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var path=require(_0x13c8('0x3'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x548599,_0x101d4f){return function(_0x3ec886){if(!_0x3ec886){_0x548599[_0x13c8('0x4')](0x194);;}return _0x3ec886;};}function respondWithResult(_0x1c16f1,_0x2a4d66){_0x2a4d66=_0x2a4d66||0xc8;return function(_0x3f0bd2){if(_0x3f0bd2){return _0x1c16f1[_0x13c8('0x5')](_0x2a4d66)['json'](_0x3f0bd2);}return null;};}function handleError(_0x17c228,_0x4905c3){_0x4905c3=_0x4905c3||0x1f4;return function(_0x380aed){logger[_0x13c8('0x6')](_0x380aed[_0x13c8('0x7')]);if(_0x380aed[_0x13c8('0x8')]){delete _0x380aed[_0x13c8('0x8')];}_0x17c228[_0x13c8('0x5')](_0x4905c3)[_0x13c8('0x9')](_0x380aed);};}function execChildProcess(){return new BPromise(function(_0x2ce95a,_0x26e7d9){exec(_0x13c8('0xa'),function(_0x3ca0a6,_0x2468b3,_0x28417e){logger[_0x13c8('0xb')](_0x2468b3);logger['info'](_0x28417e);if(_0x3ca0a6){logger[_0x13c8('0x6')](_0x3ca0a6);return _0x26e7d9(_0x3ca0a6);}return _0x2ce95a(_0x2468b3);});});}exports[_0x13c8('0xc')]=function(_0x2304b5,_0x1f9b6f){return pm2['list']()[_0x13c8('0xd')](function(_0x515681){if(_0x515681){var _0x4d7a88=_['reject'](_0x515681,function(_0x126359){return _0x126359['name']===_0x13c8('0xe')||_0x126359[_0x13c8('0x8')]===_0x13c8('0xf');});return{'rows':_0x4d7a88,'count':_0x4d7a88[_0x13c8('0x10')]};}return null;})['then'](respondWithResult(_0x1f9b6f,null))[_0x13c8('0x11')](handleError(_0x1f9b6f,null));};exports[_0x13c8('0x12')]=function(_0x31ae02,_0x3bc5a9){return pm2[_0x13c8('0x13')](_0x31ae02[_0x13c8('0x14')]['id'])[_0x13c8('0xd')](respondWithResult(_0x3bc5a9,null))[_0x13c8('0xd')](handleEntityNotFound(_0x3bc5a9,null))[_0x13c8('0x11')](handleError(_0x3bc5a9,null));};exports[_0x13c8('0x15')]=function(_0xe9386a,_0x5ac776){if(_0xe9386a[_0x13c8('0x16')][_0x13c8('0x8')]&&_0xe9386a[_0x13c8('0x16')][_0x13c8('0x17')]){var _0x513085=path[_0x13c8('0x18')](__dirname,_0x13c8('0x19'),_0xe9386a[_0x13c8('0x16')][_0x13c8('0x17')]);var _0x436d5d=process[_0x13c8('0x1a')]();process['chdir'](path[_0x13c8('0x1b')](_0x513085));return execChildProcess()[_0x13c8('0xd')](function(_0x315d6c){process[_0x13c8('0x1c')](_0x436d5d);return pm2['start']({'name':_0xe9386a[_0x13c8('0x16')][_0x13c8('0x8')],'script':_0x513085});})['then'](function(_0x49b552){pm2[_0x13c8('0x1d')]();return _0x49b552[0x0];})[_0x13c8('0xd')](respondWithResult(_0x5ac776,0xc9))['catch'](handleError(_0x5ac776,null));}else{return _0x5ac776['status'](0x1f4)[_0x13c8('0x9')]({'message':_0x13c8('0x1e')});}};exports['update']=function(_0x4df077,_0x196983){if(_0x4df077['body']['id']){delete _0x4df077['body']['id'];}var _0x1c7dc4={'online':_0x13c8('0x1f'),'stopped':_0x13c8('0x20')};if(_0x1c7dc4['hasOwnProperty'](_0x4df077['body'][_0x13c8('0x5')])){return pm2[_0x1c7dc4[_0x4df077[_0x13c8('0x16')][_0x13c8('0x5')]]](_0x4df077[_0x13c8('0x14')]['id'])[_0x13c8('0xd')](respondWithResult(_0x196983,0xc8))[_0x13c8('0x11')](handleError(_0x196983,null));}else{return _0x196983[_0x13c8('0x5')](0x1f4)['send']({'message':_0x13c8('0x21')});}};exports[_0x13c8('0x22')]=function(_0x5a5911,_0x5c85e4){if(_0x5a5911[_0x13c8('0x16')]['id']){delete _0x5a5911[_0x13c8('0x16')]['id'];}if(_0x5a5911['params']['id']){return pm2[_0x13c8('0x23')](_0x5a5911[_0x13c8('0x14')]['id'])['then'](function(_0x21224a){pm2[_0x13c8('0x1d')]();return _0x21224a[0x0];})[_0x13c8('0xd')](respondWithResult(_0x5c85e4,null))[_0x13c8('0x11')](handleError(_0x5c85e4,null));}else{return _0x5c85e4[_0x13c8('0x5')](0x1f4)[_0x13c8('0x9')]({'message':_0x13c8('0x24')});}}; \ No newline at end of file +var _0x4ea3=['dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','params','create','body','script','../../files/plugins','chdir'];(function(_0x184a51,_0x1fa811){var _0x383eca=function(_0x5527b2){while(--_0x5527b2){_0x184a51['push'](_0x184a51['shift']());}};_0x383eca(++_0x1fa811);}(_0x4ea3,0x70));var _0x34ea=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4ea3[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x34ea('0x0'));var pm2=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var path=require('path');var exec=require(_0x34ea('0x4'))['exec'];var BPromise=require(_0x34ea('0x5'));function handleEntityNotFound(_0x571f1b,_0x5e5a84){return function(_0x2ce955){if(!_0x2ce955){_0x571f1b[_0x34ea('0x6')](0x194);;}return _0x2ce955;};}function respondWithResult(_0x962596,_0x123d48){_0x123d48=_0x123d48||0xc8;return function(_0x40434e){if(_0x40434e){return _0x962596[_0x34ea('0x7')](_0x123d48)[_0x34ea('0x8')](_0x40434e);}return null;};}function handleError(_0x5bec7c,_0x341727){_0x341727=_0x341727||0x1f4;return function(_0x6e9ccc){logger[_0x34ea('0x9')](_0x6e9ccc['stack']);if(_0x6e9ccc[_0x34ea('0xa')]){delete _0x6e9ccc[_0x34ea('0xa')];}_0x5bec7c['status'](_0x341727)['send'](_0x6e9ccc);};}function execChildProcess(){return new BPromise(function(_0x5bd8b6,_0x346287){exec(_0x34ea('0xb'),function(_0x58bb0d,_0x11229e,_0x29a5c8){logger[_0x34ea('0xc')](_0x11229e);logger[_0x34ea('0xc')](_0x29a5c8);if(_0x58bb0d){logger[_0x34ea('0x9')](_0x58bb0d);return _0x346287(_0x58bb0d);}return _0x5bd8b6(_0x11229e);});});}exports[_0x34ea('0xd')]=function(_0x37e1b4,_0x36af43){return pm2[_0x34ea('0xe')]()[_0x34ea('0xf')](function(_0x36a4c6){if(_0x36a4c6){var _0x5ef9ae=_[_0x34ea('0x10')](_0x36a4c6,function(_0x89e3f2){return _0x89e3f2[_0x34ea('0xa')]===_0x34ea('0x11')||_0x89e3f2[_0x34ea('0xa')]==='motion2';});return{'rows':_0x5ef9ae,'count':_0x5ef9ae[_0x34ea('0x12')]};}return null;})[_0x34ea('0xf')](respondWithResult(_0x36af43,null))[_0x34ea('0x13')](handleError(_0x36af43,null));};exports[_0x34ea('0x14')]=function(_0x5f420f,_0x2680e0){return pm2[_0x34ea('0x15')](_0x5f420f[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x2680e0,null))[_0x34ea('0xf')](handleEntityNotFound(_0x2680e0,null))[_0x34ea('0x13')](handleError(_0x2680e0,null));};exports[_0x34ea('0x17')]=function(_0x127308,_0x52af16){if(_0x127308[_0x34ea('0x18')][_0x34ea('0xa')]&&_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]){var _0x4fc1a2=path['join'](__dirname,_0x34ea('0x1a'),_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]);var _0x51022f=process['cwd']();process[_0x34ea('0x1b')](path[_0x34ea('0x1c')](_0x4fc1a2));return execChildProcess()[_0x34ea('0xf')](function(_0x30c4b0){process[_0x34ea('0x1b')](_0x51022f);return pm2[_0x34ea('0x1d')]({'name':_0x127308['body'][_0x34ea('0xa')],'script':_0x4fc1a2});})[_0x34ea('0xf')](function(_0x3c0983){pm2[_0x34ea('0x1e')]();return _0x3c0983[0x0];})['then'](respondWithResult(_0x52af16,0xc9))['catch'](handleError(_0x52af16,null));}else{return _0x52af16['status'](0x1f4)[_0x34ea('0x1f')]({'message':_0x34ea('0x20')});}};exports[_0x34ea('0x21')]=function(_0x4204d7,_0x5b8b3e){if(_0x4204d7[_0x34ea('0x18')]['id']){delete _0x4204d7[_0x34ea('0x18')]['id'];}var _0x27c6f7={'online':'restart','stopped':'stop'};if(_0x27c6f7['hasOwnProperty'](_0x4204d7['body'][_0x34ea('0x7')])){return pm2[_0x27c6f7[_0x4204d7[_0x34ea('0x18')][_0x34ea('0x7')]]](_0x4204d7[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x5b8b3e,0xc8))[_0x34ea('0x13')](handleError(_0x5b8b3e,null));}else{return _0x5b8b3e['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x34ea('0x22')]=function(_0x14e018,_0x3cb968){if(_0x14e018['body']['id']){delete _0x14e018[_0x34ea('0x18')]['id'];}if(_0x14e018[_0x34ea('0x16')]['id']){return pm2['delete'](_0x14e018[_0x34ea('0x16')]['id'])['then'](function(_0x1392b6){pm2[_0x34ea('0x1e')]();return _0x1392b6[0x0];})[_0x34ea('0xf')](respondWithResult(_0x3cb968,null))['catch'](handleError(_0x3cb968,null));}else{return _0x3cb968['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index cf69f60..28573e2 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 _0x0e1c=['exports','express','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','/queues','getQueues'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x0e1c,0x7f));var _0xc0e1=function(_0xdfc220,_0x25ae39){_0xdfc220=_0xdfc220-0x0;var _0x4b4d9c=_0x0e1c[_0xdfc220];return _0x4b4d9c;};'use strict';var express=require(_0xc0e1('0x0'));var router=express['Router']();var auth=require(_0xc0e1('0x1'));var controller=require(_0xc0e1('0x2'));router[_0xc0e1('0x3')](_0xc0e1('0x4'),auth[_0xc0e1('0x5')](),controller['getAgents']);router[_0xc0e1('0x3')](_0xc0e1('0x6'),auth[_0xc0e1('0x5')](),controller[_0xc0e1('0x7')]);module[_0xc0e1('0x8')]=router; \ No newline at end of file +var _0x4b77=['getQueues','express','Router','../../components/auth/service','./realtime.controller','get','/queues','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b77,0xa1));var _0x74b7=function(_0x1fa99c,_0x2c6b4e){_0x1fa99c=_0x1fa99c-0x0;var _0x2ae662=_0x4b77[_0x1fa99c];return _0x2ae662;};'use strict';var express=require(_0x74b7('0x0'));var router=express[_0x74b7('0x1')]();var auth=require(_0x74b7('0x2'));var controller=require(_0x74b7('0x3'));router[_0x74b7('0x4')]('/agents',auth['isAuthenticated'](),controller['getAgents']);router[_0x74b7('0x4')](_0x74b7('0x5'),auth[_0x74b7('0x6')](),controller[_0x74b7('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 7463fd0..9b90b70 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 _0xfdbd=['loggedIn','voice','busy','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','agents','User','Queue','QueueId','idle','unknown','isNil','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','smsPause','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','fieldName','query','getOptions','raw','user','userProfileId','agent','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','mail','chat','sms','resolve','channel','includes','Invalid\x20channel','toLowerCase','rawAttributes','type','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','status','set','json','error','stack','name','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','outbound','push','pTalking','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','paused','loggedInDb'];(function(_0x1df099,_0x353123){var _0x35f53f=function(_0x7d55fd){while(--_0x7d55fd){_0x1df099['push'](_0x1df099['shift']());}};_0x35f53f(++_0x353123);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xfdbd[_0xa8883];return _0x479426;};'use strict';var util=require(_0xdfdb('0x0'));var _=require(_0xdfdb('0x1'));var jayson=require(_0xdfdb('0x2'));var qs=require(_0xdfdb('0x3'));var logger=require(_0xdfdb('0x4'))(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var amiClient=jayson[_0xdfdb('0x7')][_0xdfdb('0x8')]({'port':0x232a});var routingClient=jayson['client'][_0xdfdb('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x4a4a3f,_0x453ef6){return function(_0x41bd5e){if(_0x41bd5e){var _0x489f19=typeof _0x453ef6['offset']==='undefined'&&typeof _0x453ef6[_0xdfdb('0x9')]===_0xdfdb('0xa');var _0x47c629=_0x41bd5e[_0xdfdb('0xb')];var _0x444c19=_0x489f19?0x0:_0x453ef6[_0xdfdb('0xc')];var _0x27ddcd=_0x489f19?_0x41bd5e[_0xdfdb('0xb')]:_0x453ef6[_0xdfdb('0xc')]+_0x453ef6[_0xdfdb('0x9')];var _0x47dccc;if(_0x27ddcd>=_0x47c629){_0x27ddcd=_0x47c629;_0x47dccc=0xc8;}else{_0x47dccc=0xce;}_0x4a4a3f[_0xdfdb('0xd')](_0x47dccc);return _0x4a4a3f[_0xdfdb('0xe')]('Content-Range',_0x444c19+'-'+_0x27ddcd+'/'+_0x47c629)[_0xdfdb('0xf')](_0x41bd5e);}return null;};}function handleError(_0x33a706,_0x2bee3b){_0x2bee3b=_0x2bee3b||0x1f4;return function(_0x1918c1){logger[_0xdfdb('0x10')](_0x1918c1[_0xdfdb('0x11')]);if(_0x1918c1[_0xdfdb('0x12')]){delete _0x1918c1[_0xdfdb('0x12')];}_0x33a706['status'](_0x2bee3b)['send'](_0x1918c1);};}function getRealtimeAgents(){return new Promise(function(_0x2c44dc,_0x4b1ff7){return amiClient[_0xdfdb('0x13')](_0xdfdb('0x14'),{})[_0xdfdb('0x15')](function(_0x40bc8a){if(_0x40bc8a[_0xdfdb('0x10')])throw new Error(_0xdfdb('0x16'));var _0x54ff23=_0x40bc8a['result'];return routingClient[_0xdfdb('0x13')](_0xdfdb('0x14'),{})[_0xdfdb('0x15')](function(_0x55ab5a){if(_0x55ab5a[_0xdfdb('0x10')])throw new Error(_0xdfdb('0x17'));var _0x467653=_0x55ab5a[_0xdfdb('0x18')];return _0x2c44dc(_[_0xdfdb('0x19')]({},_0x54ff23,_0x467653));});})[_0xdfdb('0x1a')](function(_0x693a2c){_0x4b1ff7(_0x693a2c);});});}function getRealtimeQueues(_0x29a639,_0x5b8cb5){return new Promise(function(_0x14638a,_0xb7417c){var _0x172c63=_0x5b8cb5==='voice'?amiClient:routingClient;return _0x172c63[_0xdfdb('0x13')](_[_0xdfdb('0x1b')](_0x5b8cb5)+_0xdfdb('0x1c'),_0x29a639)['then'](function(_0x280e53){if(_0x280e53[_0xdfdb('0x10')])throw new Error(util[_0xdfdb('0x1d')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x5b8cb5));return _0x14638a(_0x280e53[_0xdfdb('0x18')]);})['catch'](function(_0x2db1c1){_0xb7417c(_0x2db1c1);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x145350,_0x1fa2f3){return amiClient[_0xdfdb('0x13')]('VoiceQueuesChannels',{})[_0xdfdb('0x15')](function(_0x4363d8){if(_0x4363d8[_0xdfdb('0x10')])throw new Error(_0xdfdb('0x1e'));return _0x145350(_0x4363d8[_0xdfdb('0x18')]);})[_0xdfdb('0x1a')](function(_0x57d24f){_0x1fa2f3(_0x57d24f);});});}function initializeQueues(_0xec4d22,_0x2d5fe2,_0xdf3a5c,_0x4f8057){var _0x466932=['loggedIn',_0xdfdb('0x1f'),_0xdfdb('0x20'),_0xdfdb('0x21'),'paused'];if(_0xdf3a5c==='voice'&&_0x4f8057===_0xdfdb('0x22')){_0x466932[_0xdfdb('0x23')](_0xdfdb('0x24'),_0xdfdb('0x25'),_0xdfdb('0x26'),_0xdfdb('0x27'),'dialMethod',_0xdfdb('0x28'),_0xdfdb('0x29'),_0xdfdb('0x2a'),_0xdfdb('0x2b'),_0xdfdb('0x2c'),_0xdfdb('0x2d'),_0xdfdb('0x2e'),_0xdfdb('0x2f'),_0xdfdb('0x30'),_0xdfdb('0x31'),_0xdfdb('0x32'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xdfdb('0x33'),'predictiveIntervalDroppedCallsCallersExit',_0xdfdb('0x34'),_0xdfdb('0x35'));}return _0xec4d22[_0xdfdb('0x36')](function(_0x36d91f){var _0x514232=_0x36d91f[_0xdfdb('0x37')]({'plain':!![]});_0x514232['agents']=[];_0x514232[_0xdfdb('0x38')]=0x0;_0x514232[_0xdfdb('0x39')]=0x0;_0x514232[_0xdfdb('0x3a')]=0x0;_0x514232[_0xdfdb('0x1f')]=0x0;_0x514232[_0xdfdb('0x20')]=0x0;if(_0xdf3a5c===_0xdfdb('0x3b')){_0x514232['talking']=0x0;_0x514232[_0xdfdb('0x3c')]=0x0;if(_0x4f8057===_0xdfdb('0x22')){_0x514232['pTalking']=0x0;_0x514232[_0xdfdb('0x25')]=0x0;}}var _0x4377d6=_[_0xdfdb('0x3d')](_0x2d5fe2,['id',_0x514232['id']]);if(_0x4377d6)_[_0xdfdb('0x19')](_0x514232,_[_0xdfdb('0x3e')](_0x4377d6,_0x466932));return _0x514232;});}function updateAgentVoiceStatus(_0x286fdb,_0x16d5b8,_0x1d1f4f){var _0x21f4c7=_[_0xdfdb('0x3f')](_0x1d1f4f,[_0xdfdb('0x40'),_0x16d5b8['name']]);if(_0x21f4c7[_0xdfdb('0x41')]===0x0)return _0x286fdb[_0xdfdb('0x3c')]=!![];if(_[_0xdfdb('0x42')](_0x21f4c7,[_0xdfdb('0x43'),_0x286fdb[_0xdfdb('0x44')][_0xdfdb('0x45')]()]))return _0x286fdb[_0xdfdb('0x21')]=!![];if(!_0x286fdb[_0xdfdb('0x21')])return _0x286fdb['busy']=!![];}function getVoiceQueueAgents(_0x55d707,_0x435557,_0x2146b2,_0x16e100){var _0x1e7688=_[_0xdfdb('0x3d')](_0x435557,['id',_0x55d707['id']]);if(!_0x1e7688)return _0x55d707;return _0x1e7688[_0xdfdb('0x46')]({'raw':!![]})[_0xdfdb('0x15')](function(_0x2eb46c){for(var _0xcee274=0x0;_0xcee274<_0x2eb46c['length'];_0xcee274++){var _0x175f57=_[_0xdfdb('0x3d')](_0x2146b2,['id',_0x2eb46c[_0xcee274][_0xdfdb('0x47')]]);if(!_0x175f57){_0x175f57={'id':_0x2eb46c[_0xcee274][_0xdfdb('0x47')],'name':_0x2eb46c[_0xcee274][_0xdfdb('0x47')],'accountcode':'','online':![]};}var _0x5a1bee={'id':_0x175f57['id'],'name':_0x175f57[_0xdfdb('0x12')],'internal':_0x175f57[_0xdfdb('0x48')],'online':Boolean(_0x175f57[_0xdfdb('0x49')]),'paused':Boolean(_0x2eb46c[_0xcee274][_0xdfdb('0x38')])};if(_0x175f57[_0xdfdb('0x4a')]==='talking')updateAgentVoiceStatus(_0x5a1bee,_0x55d707,_0x16e100);if(_0x5a1bee[_0xdfdb('0x49')])_0x55d707[_0xdfdb('0x39')]++;if(_0x5a1bee[_0xdfdb('0x3c')])_0x55d707['busy']++;if(_0x5a1bee[_0xdfdb('0x38')]&&!_0x5a1bee['busy']&&!_0x5a1bee[_0xdfdb('0x21')])_0x55d707['paused']++;_0x55d707[_0xdfdb('0x4b')][_0xdfdb('0x23')](_0x5a1bee);}return _0x55d707;});}function getQueueAgents(_0x5c14a1,_0xc92f82,_0x4e8ead){var _0xfea790=_0xdfdb('0x4c')+_[_0xdfdb('0x1b')](_0x4e8ead)+_0xdfdb('0x4d');var _0x25cc2f=_0x4e8ead+'Pause';return db[_0xfea790]['findAll']({'where':{[_[_0xdfdb('0x1b')](_0x4e8ead)+_0xdfdb('0x4e')]:_0x5c14a1['id']},'raw':!![]})['then'](function(_0x2b0a8b){for(var _0x59d0c3=0x0;_0x59d0c3<_0x2b0a8b[_0xdfdb('0x41')];_0x59d0c3++){var _0x158407=_[_0xdfdb('0x3d')](_0xc92f82,['id',_0x2b0a8b[_0x59d0c3][_0xdfdb('0x47')]]);if(!_0x158407){_0x158407={'id':_0x2b0a8b[_0x59d0c3][_0xdfdb('0x47')],'name':_0x2b0a8b[_0x59d0c3][_0xdfdb('0x47')],'online':![],['pauseField']:![]};}var _0x41701c={'id':_0x158407['id'],'name':_0x158407[_0xdfdb('0x12')],'online':Boolean(_0x158407[_0xdfdb('0x49')]),'paused':Boolean(_0x158407[_0x25cc2f])};if(_0x41701c[_0xdfdb('0x49')])_0x5c14a1[_0xdfdb('0x39')]++;_0x5c14a1[_0xdfdb('0x4b')][_0xdfdb('0x23')](_0x41701c);}return _0x5c14a1;});}function isIdle(_0x202c25){return _0x202c25===_0xdfdb('0x4f')||_0x202c25===_0xdfdb('0x50')||_0x202c25==='unavailable'||_0x202c25==='ringing'||_[_0xdfdb('0x51')](_0x202c25);}function isAgentPaused(_0x1aff71,_0x2f1d06){var _0x4bbb88=[_0x1aff71[_0xdfdb('0x52')],_0x1aff71[_0xdfdb('0x53')],_0x1aff71[_0xdfdb('0x54')],_0x1aff71[_0xdfdb('0x55')],_0x1aff71['smsPause'],_0x1aff71[_0xdfdb('0x56')],_0x1aff71[_0xdfdb('0x57')]];if(!_0x2f1d06)return _['every'](_0x4bbb88);var _0x3a6ce2=_[_0xdfdb('0x3f')](_0x4bbb88);return _0x3a6ce2[_0xdfdb('0x41')]>0x0&&_0x3a6ce2[_0xdfdb('0x41')]<_0x4bbb88[_0xdfdb('0x41')]?!![]:![];}function isAgentIdle(_0x10b490){if(_0x10b490[_0xdfdb('0x4a')]!==_0xdfdb('0x4f')&&_0x10b490[_0xdfdb('0x56')]){_0x10b490['voiceStatus']=_0xdfdb('0x58');return![];}return _['every']([_0x10b490[_0xdfdb('0x59')],_0x10b490[_0xdfdb('0x5a')],_0x10b490[_0xdfdb('0x5b')],_0x10b490[_0xdfdb('0x5c')],_0x10b490[_0xdfdb('0x5d')],_0x10b490[_0xdfdb('0x4a')],_0x10b490[_0xdfdb('0x5e')]],isIdle);}function getAgentStatus(_0x480e98){var _0x2a5803=_0xdfdb('0x50');if(isAgentPaused(_0x480e98))_0x2a5803=_0xdfdb('0x58');else if(isAgentPaused(_0x480e98,!![]))_0x2a5803=_0xdfdb('0x5f');else if(isAgentIdle(_0x480e98))_0x2a5803=_0xdfdb('0x4f');else _0x2a5803='busy';return _0x2a5803;}exports[_0xdfdb('0x60')]=function(_0x4df3b6,_0x9bbf0e){var _0x1331eb={'count':0x0,'rows':[]},_0xdd48cd={},_0x6d7407,_0x3f10fe,_0x5e7388=[_0xdfdb('0x61'),'online',_0xdfdb('0x62'),_0xdfdb('0x63'),_0xdfdb('0x64'),'lastPauseAt',_0xdfdb('0x44'),_0xdfdb('0x65'),_0xdfdb('0x52'),_0xdfdb('0x55'),_0xdfdb('0x54'),_0xdfdb('0x66'),'whatsappPause','faxPause',_0xdfdb('0x56'),'chatCapacity','openchannelCapacity','mailCapacity',_0xdfdb('0x67'),_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e'),_0xdfdb('0x6f'),'chatStatus','openchannelStatus',_0xdfdb('0x5b'),'smsStatus',_0xdfdb('0x5e'),_0xdfdb('0x5a'),_0xdfdb('0x4a'),'chatStatusTime',_0xdfdb('0x70'),_0xdfdb('0x71'),_0xdfdb('0x72'),_0xdfdb('0x73'),_0xdfdb('0x74'),_0xdfdb('0x75'),_0xdfdb('0x40'),_0xdfdb('0x76'),'screenrecording',_0xdfdb('0x77'),_0xdfdb('0x78'),'routealias'],_0x3fbbb5=[_0xdfdb('0x52'),_0xdfdb('0x55'),_0xdfdb('0x54'),_0xdfdb('0x66'),'whatsappPause','faxPause',_0xdfdb('0x56'),_0xdfdb('0x49')];Promise['resolve']()[_0xdfdb('0x15')](function(){var _0x2b8776=_[_0xdfdb('0x36')](db['User']['rawAttributes'],function(_0x42ad97){return{'name':_0x42ad97[_0xdfdb('0x79')],'type':_0x42ad97['type']['key']};});_0x4df3b6[_0xdfdb('0x7a')]['role']='agent';_0x4df3b6[_0xdfdb('0x7a')]['online']=!![];_0xdd48cd=qs[_0xdfdb('0x7b')](_0x2b8776,_0x4df3b6);_0xdd48cd[_0xdfdb('0x7c')]=!![];if(_0x4df3b6['user']['role']===_0xdfdb('0x7d')){var _0x2a218a={'params':{'id':_0x4df3b6['user'][_0xdfdb('0x7e')]},'query':{'section':_0xdfdb('0x14'),'role':_0xdfdb('0x7f'),'online':!![],'nolimit':_0x4df3b6[_0xdfdb('0x7a')][_0xdfdb('0x80')],'sort':_0x4df3b6['query']['sort'],'filter':_0x4df3b6[_0xdfdb('0x7a')][_0xdfdb('0x3f')],'raw':!![]}};return db[_0xdfdb('0x81')][_0xdfdb('0x82')](_0x2a218a);}return db[_0xdfdb('0x4c')][_0xdfdb('0x83')](_0xdd48cd);})['then'](function(_0xd226af){_0x1331eb[_0xdfdb('0xb')]=_0xd226af[_0xdfdb('0xb')];_0x6d7407=_0xd226af[_0xdfdb('0x84')];return getRealtimeAgents();})[_0xdfdb('0x15')](function(_0x1bcfdd){_0x3f10fe=_0x1bcfdd[_0xdfdb('0x84')];return _0x6d7407[_0xdfdb('0x36')](function(_0x38fa9c){var _0x3eca7f=_['find'](_0x3f10fe,['id',_0x38fa9c['id']]);if(_0x3eca7f)_[_0xdfdb('0x19')](_0x38fa9c,_[_0xdfdb('0x3e')](_[_0xdfdb('0x85')](_0x3eca7f,_0x3fbbb5),_0x5e7388));_0x38fa9c[_0xdfdb('0x86')]=getAgentStatus(_0x38fa9c);return _0x38fa9c;});})[_0xdfdb('0x15')](function(_0x590a16){if(_0x4df3b6[_0xdfdb('0x7a')][_0xdfdb('0x87')]){var _0x234882=_[_0xdfdb('0x3f')](_0x590a16,['globalStatus',_0x4df3b6[_0xdfdb('0x7a')][_0xdfdb('0x87')]]);if(_0x4df3b6[_0xdfdb('0x7a')][_0xdfdb('0x88')]){_0x234882=_[_0xdfdb('0x3f')](_0x234882,[_0xdfdb('0x64'),_0x4df3b6[_0xdfdb('0x7a')][_0xdfdb('0x88')]]);}}_0x1331eb[_0xdfdb('0x84')]=_0x234882||_0x590a16;return _0x1331eb;})[_0xdfdb('0x15')](respondWithFilteredResult(_0x9bbf0e,_0xdd48cd))[_0xdfdb('0x1a')](handleError(_0x9bbf0e,null));};exports['getQueues']=function(_0x1bf0d2,_0x616d29){var _0x5ad38a=[_0xdfdb('0x89'),_0xdfdb('0x8a'),_0xdfdb('0x8b'),'openchannel','fax','whatsapp',_0xdfdb('0x3b')];var _0x465565={'count':0x0,'rows':[]},_0x1c7964={},_0x8e68a8,_0xd4b817,_0x394536,_0xf60176,_0x4b2c31;Promise[_0xdfdb('0x8c')]()[_0xdfdb('0x15')](function(){if(_0x1bf0d2[_0xdfdb('0x7a')][_0xdfdb('0x8d')]){if(!_[_0xdfdb('0x8e')](_0x5ad38a,_0x1bf0d2[_0xdfdb('0x7a')][_0xdfdb('0x8d')]['toLowerCase']()))throw new Error(_0xdfdb('0x8f'));_0x8e68a8=_0x1bf0d2[_0xdfdb('0x7a')][_0xdfdb('0x8d')][_0xdfdb('0x90')]();}var _0x275e5f=_['startCase'](_0x8e68a8)+_0xdfdb('0x4d');var _0x56a633=_[_0xdfdb('0x36')](db[_0x275e5f][_0xdfdb('0x91')],function(_0x18c6d1){return{'name':_0x18c6d1[_0xdfdb('0x79')],'type':_0x18c6d1[_0xdfdb('0x92')]['key']};});_0x1c7964=qs[_0xdfdb('0x7b')](_0x56a633,_0x1bf0d2);if(_0x1bf0d2[_0xdfdb('0x7d')]['role']==='user'){var _0x284439={'params':{'id':_0x1bf0d2['user']['userProfileId']},'query':{'section':_0x8e68a8===_0xdfdb('0x3b')&&_0x1bf0d2[_0xdfdb('0x7a')][_0xdfdb('0x92')]===_0xdfdb('0x22')?_0xdfdb('0x93'):_[_0xdfdb('0x1b')](_0x8e68a8)+_0xdfdb('0x1c'),'type':_0x1bf0d2[_0xdfdb('0x7a')]['type'],'nolimit':!![],'sort':_0xdfdb('0x12'),'filter':_0x1bf0d2['query'][_0xdfdb('0x3f')]}};return db[_0xdfdb('0x81')][_0xdfdb('0x82')](_0x284439);}return db[_0x275e5f][_0xdfdb('0x83')](_0x1c7964);})[_0xdfdb('0x15')](function(_0x52a8a5){_0x465565[_0xdfdb('0xb')]=_0x52a8a5[_0xdfdb('0xb')];_0xd4b817=_0x52a8a5[_0xdfdb('0x84')];return getRealtimeQueues(_0x1bf0d2,_0x8e68a8);})[_0xdfdb('0x15')](function(_0x36241c){_0xf60176=_0x36241c['rows'];return getRealtimeAgents();})['then'](function(_0x231f20){_0x394536=_0x231f20[_0xdfdb('0x84')];if(_0x8e68a8!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xdfdb('0x15')](function(_0x50d5d4){_0x4b2c31=_0x50d5d4?_0x50d5d4[_0xdfdb('0x84')]:[];return initializeQueues(_0xd4b817,_0xf60176,_0x8e68a8,_0x1bf0d2[_0xdfdb('0x7a')][_0xdfdb('0x92')]);})['then'](function(_0x2828a5){var _0x53ca83=_0x2828a5['map'](function(_0x3eb36e){if(_0x8e68a8==='voice')return getVoiceQueueAgents(_0x3eb36e,_0xd4b817,_0x394536,_0x4b2c31);else return getQueueAgents(_0x3eb36e,_0x394536,_0x8e68a8);});return Promise[_0xdfdb('0x94')](_0x53ca83);})[_0xdfdb('0x15')](function(_0x162eeb){_0x465565[_0xdfdb('0x84')]=_0x162eeb;return _0x465565;})[_0xdfdb('0x15')](respondWithFilteredResult(_0x616d29,_0x1c7964))[_0xdfdb('0x1a')](handleError(_0x616d29,null));}; \ No newline at end of file +var _0x1cb9=['mailStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','fieldName','type','key','query','role','getOptions','raw','user','agent','nolimit','sort','UserProfile','getResources','rows','pick','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','sms','openchannel','fax','toLowerCase','Invalid\x20channel','channel','userProfileId','outbound','QueueCampaigns','findAndCountAll','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','limit','count','status','set','Content-Range','error','stack','name','then','result','Agents','catch','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','available','waiting','talking','paused','voice','push','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','pTalking','find','merge','length','some','connectedlinenum','toString','busy','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','agents','User','Pause','QueueId','idle','unknown','unavailable','ringing','chatPause','mailPause','whatsappPause','every','filter','voicePause','chatStatus','mailStatus','smsStatus','whatsappStatus','pause','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','internal','address','openchannelPause','smsPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','faxStatus'];(function(_0xc2e449,_0x326ca6){var _0x32e619=function(_0x5033fa){while(--_0x5033fa){_0xc2e449['push'](_0xc2e449['shift']());}};_0x32e619(++_0x326ca6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1b3107,_0x1f8783){_0x1b3107=_0x1b3107-0x0;var _0x369682=_0x1cb9[_0x1b3107];return _0x369682;};'use strict';var util=require(_0x91cb('0x0'));var _=require('lodash');var jayson=require(_0x91cb('0x1'));var qs=require(_0x91cb('0x2'));var logger=require(_0x91cb('0x3'))(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x91cb('0x5')][_0x91cb('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x91cb('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x3640f9,_0x186dc3){return function(_0x28543e){if(_0x28543e){var _0x3b9d98=typeof _0x186dc3[_0x91cb('0x7')]==='undefined'&&typeof _0x186dc3[_0x91cb('0x8')]==='undefined';var _0x2fdfce=_0x28543e['count'];var _0xa43e7a=_0x3b9d98?0x0:_0x186dc3[_0x91cb('0x7')];var _0x45317f=_0x3b9d98?_0x28543e[_0x91cb('0x9')]:_0x186dc3[_0x91cb('0x7')]+_0x186dc3[_0x91cb('0x8')];var _0x21a0a5;if(_0x45317f>=_0x2fdfce){_0x45317f=_0x2fdfce;_0x21a0a5=0xc8;}else{_0x21a0a5=0xce;}_0x3640f9[_0x91cb('0xa')](_0x21a0a5);return _0x3640f9[_0x91cb('0xb')](_0x91cb('0xc'),_0xa43e7a+'-'+_0x45317f+'/'+_0x2fdfce)['json'](_0x28543e);}return null;};}function handleError(_0x3c1f56,_0x366f09){_0x366f09=_0x366f09||0x1f4;return function(_0x4ba2f2){logger[_0x91cb('0xd')](_0x4ba2f2[_0x91cb('0xe')]);if(_0x4ba2f2[_0x91cb('0xf')]){delete _0x4ba2f2[_0x91cb('0xf')];}_0x3c1f56['status'](_0x366f09)['send'](_0x4ba2f2);};}function getRealtimeAgents(){return new Promise(function(_0x4aae25,_0x3d22b7){return amiClient['request']('Agents',{})[_0x91cb('0x10')](function(_0xc3629e){if(_0xc3629e[_0x91cb('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x238f11=_0xc3629e[_0x91cb('0x11')];return routingClient['request'](_0x91cb('0x12'),{})[_0x91cb('0x10')](function(_0x1cd34b){if(_0x1cd34b[_0x91cb('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x3fba4f=_0x1cd34b[_0x91cb('0x11')];return _0x4aae25(_['merge']({},_0x238f11,_0x3fba4f));});})[_0x91cb('0x13')](function(_0x4c9fb2){_0x3d22b7(_0x4c9fb2);});});}function getRealtimeQueues(_0x55042a,_0x281ff3){return new Promise(function(_0x160ded,_0x56e409){var _0x51a1d5=_0x281ff3==='voice'?amiClient:routingClient;return _0x51a1d5[_0x91cb('0x14')](_[_0x91cb('0x15')](_0x281ff3)+_0x91cb('0x16'),_0x55042a)[_0x91cb('0x10')](function(_0x5c6a15){if(_0x5c6a15[_0x91cb('0xd')])throw new Error(util[_0x91cb('0x17')](_0x91cb('0x18'),_0x281ff3));return _0x160ded(_0x5c6a15['result']);})[_0x91cb('0x13')](function(_0x1a7a54){_0x56e409(_0x1a7a54);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2447e7,_0x422d14){return amiClient[_0x91cb('0x14')](_0x91cb('0x19'),{})[_0x91cb('0x10')](function(_0x423c4f){if(_0x423c4f[_0x91cb('0xd')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x2447e7(_0x423c4f['result']);})[_0x91cb('0x13')](function(_0x554350){_0x422d14(_0x554350);});});}function initializeQueues(_0x1c67d2,_0x34d372,_0x318031,_0x5595c5){var _0x9b26a6=['loggedIn',_0x91cb('0x1a'),_0x91cb('0x1b'),_0x91cb('0x1c'),_0x91cb('0x1d')];if(_0x318031===_0x91cb('0x1e')&&_0x5595c5==='outbound'){_0x9b26a6[_0x91cb('0x1f')]('pTalking',_0x91cb('0x20'),_0x91cb('0x21'),_0x91cb('0x22'),'dialMethod',_0x91cb('0x23'),_0x91cb('0x24'),_0x91cb('0x25'),_0x91cb('0x26'),_0x91cb('0x27'),_0x91cb('0x28'),_0x91cb('0x29'),_0x91cb('0x2a'),_0x91cb('0x2b'),'dialPredictiveIntervalMinThreshold',_0x91cb('0x2c'),_0x91cb('0x2d'),_0x91cb('0x2e'),_0x91cb('0x2f'),_0x91cb('0x30'),'predictiveIntervalAvgHoldtime',_0x91cb('0x31'));}return _0x1c67d2[_0x91cb('0x32')](function(_0x2e317c){var _0x46db02=_0x2e317c[_0x91cb('0x33')]({'plain':!![]});_0x46db02['agents']=[];_0x46db02[_0x91cb('0x1d')]=0x0;_0x46db02['loggedInDb']=0x0;_0x46db02['loggedIn']=0x0;_0x46db02['available']=0x0;_0x46db02[_0x91cb('0x1b')]=0x0;if(_0x318031==='voice'){_0x46db02[_0x91cb('0x1c')]=0x0;_0x46db02['busy']=0x0;if(_0x5595c5==='outbound'){_0x46db02[_0x91cb('0x34')]=0x0;_0x46db02[_0x91cb('0x20')]=0x0;}}var _0x1deabb=_[_0x91cb('0x35')](_0x34d372,['id',_0x46db02['id']]);if(_0x1deabb)_[_0x91cb('0x36')](_0x46db02,_['pick'](_0x1deabb,_0x9b26a6));return _0x46db02;});}function updateAgentVoiceStatus(_0x8beb3a,_0x3ddc0b,_0x13a5ea){var _0x8496a3=_['filter'](_0x13a5ea,['queue',_0x3ddc0b[_0x91cb('0xf')]]);if(_0x8496a3[_0x91cb('0x37')]===0x0)return _0x8beb3a['busy']=!![];if(_[_0x91cb('0x38')](_0x8496a3,[_0x91cb('0x39'),_0x8beb3a['internal'][_0x91cb('0x3a')]()]))return _0x8beb3a[_0x91cb('0x1c')]=!![];if(!_0x8beb3a['talking'])return _0x8beb3a[_0x91cb('0x3b')]=!![];}function getVoiceQueueAgents(_0x545687,_0x4117db,_0xabe6a3,_0x9de25d){var _0x279ad5=_[_0x91cb('0x35')](_0x4117db,['id',_0x545687['id']]);if(!_0x279ad5)return _0x545687;return _0x279ad5[_0x91cb('0x3c')]({'raw':!![]})['then'](function(_0xa90111){for(var _0x425fa4=0x0;_0x425fa4<_0xa90111['length'];_0x425fa4++){var _0x312581=_['find'](_0xabe6a3,['id',_0xa90111[_0x425fa4][_0x91cb('0x3d')]]);if(!_0x312581){_0x312581={'id':_0xa90111[_0x425fa4][_0x91cb('0x3d')],'name':_0xa90111[_0x425fa4][_0x91cb('0x3d')],'accountcode':'','online':![]};}var _0x174794={'id':_0x312581['id'],'name':_0x312581['name'],'internal':_0x312581[_0x91cb('0x3e')],'online':Boolean(_0x312581[_0x91cb('0x3f')]),'paused':Boolean(_0xa90111[_0x425fa4][_0x91cb('0x1d')])};if(_0x312581[_0x91cb('0x40')]===_0x91cb('0x1c'))updateAgentVoiceStatus(_0x174794,_0x545687,_0x9de25d);if(_0x174794[_0x91cb('0x3f')])_0x545687[_0x91cb('0x41')]++;if(_0x174794[_0x91cb('0x3b')])_0x545687[_0x91cb('0x3b')]++;if(_0x174794[_0x91cb('0x1d')]&&!_0x174794['busy']&&!_0x174794[_0x91cb('0x1c')])_0x545687['paused']++;_0x545687[_0x91cb('0x42')]['push'](_0x174794);}return _0x545687;});}function getQueueAgents(_0x335879,_0x52e82c,_0x138f48){var _0x477131=_0x91cb('0x43')+_[_0x91cb('0x15')](_0x138f48)+'Queue';var _0x2cdb61=_0x138f48+_0x91cb('0x44');return db[_0x477131]['findAll']({'where':{[_[_0x91cb('0x15')](_0x138f48)+_0x91cb('0x45')]:_0x335879['id']},'raw':!![]})[_0x91cb('0x10')](function(_0x32517d){for(var _0x267efb=0x0;_0x267efb<_0x32517d[_0x91cb('0x37')];_0x267efb++){var _0x17d319=_[_0x91cb('0x35')](_0x52e82c,['id',_0x32517d[_0x267efb][_0x91cb('0x3d')]]);if(!_0x17d319){_0x17d319={'id':_0x32517d[_0x267efb]['UserId'],'name':_0x32517d[_0x267efb][_0x91cb('0x3d')],'online':![],['pauseField']:![]};}var _0x3e20d1={'id':_0x17d319['id'],'name':_0x17d319[_0x91cb('0xf')],'online':Boolean(_0x17d319[_0x91cb('0x3f')]),'paused':Boolean(_0x17d319[_0x2cdb61])};if(_0x3e20d1[_0x91cb('0x3f')])_0x335879[_0x91cb('0x41')]++;_0x335879[_0x91cb('0x42')][_0x91cb('0x1f')](_0x3e20d1);}return _0x335879;});}function isIdle(_0x4830d3){return _0x4830d3===_0x91cb('0x46')||_0x4830d3===_0x91cb('0x47')||_0x4830d3===_0x91cb('0x48')||_0x4830d3===_0x91cb('0x49')||_['isNil'](_0x4830d3);}function isAgentPaused(_0x9dae06,_0x1aa461){var _0x4fad1b=[_0x9dae06[_0x91cb('0x4a')],_0x9dae06['faxPause'],_0x9dae06[_0x91cb('0x4b')],_0x9dae06['openchannelPause'],_0x9dae06['smsPause'],_0x9dae06['voicePause'],_0x9dae06[_0x91cb('0x4c')]];if(!_0x1aa461)return _[_0x91cb('0x4d')](_0x4fad1b);var _0x3d62c4=_[_0x91cb('0x4e')](_0x4fad1b);return _0x3d62c4[_0x91cb('0x37')]>0x0&&_0x3d62c4['length']<_0x4fad1b['length']?!![]:![];}function isAgentIdle(_0x1d26b8){if(_0x1d26b8[_0x91cb('0x40')]!==_0x91cb('0x46')&&_0x1d26b8[_0x91cb('0x4f')]){_0x1d26b8['voiceStatus']='pause';return![];}return _['every']([_0x1d26b8[_0x91cb('0x50')],_0x1d26b8['faxStatus'],_0x1d26b8[_0x91cb('0x51')],_0x1d26b8['openchannelStatus'],_0x1d26b8[_0x91cb('0x52')],_0x1d26b8[_0x91cb('0x40')],_0x1d26b8[_0x91cb('0x53')]],isIdle);}function getAgentStatus(_0x649976){var _0x1884bc=_0x91cb('0x47');if(isAgentPaused(_0x649976))_0x1884bc=_0x91cb('0x54');else if(isAgentPaused(_0x649976,!![]))_0x1884bc=_0x91cb('0x55');else if(isAgentIdle(_0x649976))_0x1884bc=_0x91cb('0x46');else _0x1884bc=_0x91cb('0x3b');return _0x1884bc;}exports[_0x91cb('0x56')]=function(_0x5752ed,_0x1e445a){var _0x1fa45a={'count':0x0,'rows':[]},_0x4d7a34={},_0x3f719b,_0x32fb40,_0x4bab7d=[_0x91cb('0x57'),_0x91cb('0x3f'),_0x91cb('0x58'),_0x91cb('0x59'),_0x91cb('0x5a'),_0x91cb('0x59'),_0x91cb('0x5b'),_0x91cb('0x5c'),_0x91cb('0x4a'),_0x91cb('0x5d'),'mailPause',_0x91cb('0x5e'),'whatsappPause',_0x91cb('0x5f'),'voicePause',_0x91cb('0x60'),_0x91cb('0x61'),_0x91cb('0x62'),'smsCapacity',_0x91cb('0x63'),_0x91cb('0x64'),'chatCurrentCapacity',_0x91cb('0x65'),_0x91cb('0x66'),_0x91cb('0x67'),_0x91cb('0x68'),'faxCurrentCapacity',_0x91cb('0x50'),_0x91cb('0x69'),_0x91cb('0x51'),_0x91cb('0x52'),'whatsappStatus',_0x91cb('0x6a'),_0x91cb('0x40'),'chatStatusTime','openchannelStatusTime',_0x91cb('0x6b'),'smsStatusTime',_0x91cb('0x6c'),_0x91cb('0x6d'),'voiceStatusTime','queue',_0x91cb('0x6e'),'screenrecording',_0x91cb('0x6f'),_0x91cb('0x70'),_0x91cb('0x71')],_0x2f5311=['chatPause',_0x91cb('0x5d'),'mailPause',_0x91cb('0x5e'),_0x91cb('0x4c'),_0x91cb('0x5f'),_0x91cb('0x4f'),'online'];Promise[_0x91cb('0x72')]()[_0x91cb('0x10')](function(){var _0x1c8179=_[_0x91cb('0x32')](db[_0x91cb('0x43')][_0x91cb('0x73')],function(_0x14114d){return{'name':_0x14114d[_0x91cb('0x74')],'type':_0x14114d[_0x91cb('0x75')][_0x91cb('0x76')]};});_0x5752ed[_0x91cb('0x77')][_0x91cb('0x78')]='agent';_0x5752ed[_0x91cb('0x77')][_0x91cb('0x3f')]=!![];_0x4d7a34=qs[_0x91cb('0x79')](_0x1c8179,_0x5752ed);_0x4d7a34[_0x91cb('0x7a')]=!![];if(_0x5752ed[_0x91cb('0x7b')][_0x91cb('0x78')]===_0x91cb('0x7b')){var _0x47bd4d={'params':{'id':_0x5752ed[_0x91cb('0x7b')]['userProfileId']},'query':{'section':_0x91cb('0x12'),'role':_0x91cb('0x7c'),'online':!![],'nolimit':_0x5752ed[_0x91cb('0x77')][_0x91cb('0x7d')],'sort':_0x5752ed['query'][_0x91cb('0x7e')],'filter':_0x5752ed[_0x91cb('0x77')][_0x91cb('0x4e')],'raw':!![]}};return db[_0x91cb('0x7f')][_0x91cb('0x80')](_0x47bd4d);}return db[_0x91cb('0x43')]['findAndCountAll'](_0x4d7a34);})[_0x91cb('0x10')](function(_0x28bfe5){_0x1fa45a[_0x91cb('0x9')]=_0x28bfe5[_0x91cb('0x9')];_0x3f719b=_0x28bfe5[_0x91cb('0x81')];return getRealtimeAgents();})[_0x91cb('0x10')](function(_0x18b812){_0x32fb40=_0x18b812[_0x91cb('0x81')];return _0x3f719b[_0x91cb('0x32')](function(_0x457f81){var _0x1347df=_[_0x91cb('0x35')](_0x32fb40,['id',_0x457f81['id']]);if(_0x1347df)_[_0x91cb('0x36')](_0x457f81,_[_0x91cb('0x82')](_[_0x91cb('0x83')](_0x1347df,_0x2f5311),_0x4bab7d));_0x457f81[_0x91cb('0x84')]=getAgentStatus(_0x457f81);return _0x457f81;});})[_0x91cb('0x10')](function(_0x4866aa){if(_0x5752ed[_0x91cb('0x77')][_0x91cb('0x85')]){var _0x4b639d=_[_0x91cb('0x4e')](_0x4866aa,[_0x91cb('0x84'),_0x5752ed[_0x91cb('0x77')]['globalStatusFilter']]);if(_0x5752ed[_0x91cb('0x77')][_0x91cb('0x86')]){_0x4b639d=_['filter'](_0x4b639d,['pauseType',_0x5752ed[_0x91cb('0x77')]['pauseTypeFilter']]);}}_0x1fa45a[_0x91cb('0x81')]=_0x4b639d||_0x4866aa;return _0x1fa45a;})[_0x91cb('0x10')](respondWithFilteredResult(_0x1e445a,_0x4d7a34))['catch'](handleError(_0x1e445a,null));};exports[_0x91cb('0x87')]=function(_0x4ad2ea,_0x2c44ca){var _0x73febc=['mail','chat',_0x91cb('0x88'),_0x91cb('0x89'),_0x91cb('0x8a'),'whatsapp',_0x91cb('0x1e')];var _0x23a458={'count':0x0,'rows':[]},_0x98fb94={},_0x127b93,_0x570f6b,_0x440209,_0x4ee1e3,_0x342587;Promise[_0x91cb('0x72')]()[_0x91cb('0x10')](function(){if(_0x4ad2ea[_0x91cb('0x77')]['channel']){if(!_['includes'](_0x73febc,_0x4ad2ea[_0x91cb('0x77')]['channel'][_0x91cb('0x8b')]()))throw new Error(_0x91cb('0x8c'));_0x127b93=_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x8d')][_0x91cb('0x8b')]();}var _0x46874e=_[_0x91cb('0x15')](_0x127b93)+'Queue';var _0xcf93d0=_[_0x91cb('0x32')](db[_0x46874e]['rawAttributes'],function(_0x10ec48){return{'name':_0x10ec48['fieldName'],'type':_0x10ec48[_0x91cb('0x75')][_0x91cb('0x76')]};});_0x98fb94=qs[_0x91cb('0x79')](_0xcf93d0,_0x4ad2ea);if(_0x4ad2ea[_0x91cb('0x7b')][_0x91cb('0x78')]===_0x91cb('0x7b')){var _0x1459c4={'params':{'id':_0x4ad2ea[_0x91cb('0x7b')][_0x91cb('0x8e')]},'query':{'section':_0x127b93===_0x91cb('0x1e')&&_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x75')]===_0x91cb('0x8f')?_0x91cb('0x90'):_[_0x91cb('0x15')](_0x127b93)+_0x91cb('0x16'),'type':_0x4ad2ea['query'][_0x91cb('0x75')],'nolimit':!![],'sort':'name','filter':_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x4e')]}};return db[_0x91cb('0x7f')][_0x91cb('0x80')](_0x1459c4);}return db[_0x46874e][_0x91cb('0x91')](_0x98fb94);})[_0x91cb('0x10')](function(_0x324bdb){_0x23a458[_0x91cb('0x9')]=_0x324bdb['count'];_0x570f6b=_0x324bdb[_0x91cb('0x81')];return getRealtimeQueues(_0x4ad2ea,_0x127b93);})[_0x91cb('0x10')](function(_0x59defe){_0x4ee1e3=_0x59defe['rows'];return getRealtimeAgents();})[_0x91cb('0x10')](function(_0x4dfa8b){_0x440209=_0x4dfa8b['rows'];if(_0x127b93!=_0x91cb('0x1e'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3cb938){_0x342587=_0x3cb938?_0x3cb938['rows']:[];return initializeQueues(_0x570f6b,_0x4ee1e3,_0x127b93,_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x75')]);})[_0x91cb('0x10')](function(_0x443c01){var _0x4e899c=_0x443c01[_0x91cb('0x32')](function(_0x1b5137){if(_0x127b93===_0x91cb('0x1e'))return getVoiceQueueAgents(_0x1b5137,_0x570f6b,_0x440209,_0x342587);else return getQueueAgents(_0x1b5137,_0x440209,_0x127b93);});return Promise[_0x91cb('0x92')](_0x4e899c);})[_0x91cb('0x10')](function(_0x22f871){_0x23a458[_0x91cb('0x81')]=_0x22f871;return _0x23a458;})[_0x91cb('0x10')](respondWithFilteredResult(_0x2c44ca,_0x98fb94))[_0x91cb('0x13')](handleError(_0x2c44ca,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3854d57..ddaea8a 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x14cde4,_0x5d5b62){var _0x865fc6=function(_0x5c1b1f){while(--_0x5c1b1f){_0x14cde4['push'](_0x14cde4['shift']());}};_0x865fc6(++_0x5d5b62);}(_0xe706,0xa3));var _0x6e70=function(_0x59625f,_0x3b2c76){_0x59625f=_0x59625f-0x0;var _0x498e1e=_0xe706[_0x59625f];return _0x498e1e;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1ddee1,_0x36957a){var _0x256afe=function(_0x31a054){while(--_0x31a054){_0x1ddee1['push'](_0x1ddee1['shift']());}};_0x256afe(++_0x36957a);}(_0x70e0,0x17b));var _0x070e=function(_0x1a85ff,_0x5ea502){_0x1a85ff=_0x1a85ff-0x0;var _0xa217c2=_0x70e0[_0x1a85ff];return _0xa217c2;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 20419ad..28bfde8 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 _0xf52f=['sequelize','exports','INTEGER','DATE','STRING'];(function(_0x3d2a6d,_0x565404){var _0x51b513=function(_0x2f2351){while(--_0x2f2351){_0x3d2a6d['push'](_0x3d2a6d['shift']());}};_0x51b513(++_0x565404);}(_0xf52f,0x113));var _0xff52=function(_0x13d2e8,_0x193847){_0x13d2e8=_0x13d2e8-0x0;var _0x230601=_0xf52f[_0x13d2e8];return _0x230601;};'use strict';var Sequelize=require(_0xff52('0x0'));module[_0xff52('0x1')]={'state':{'type':Sequelize[_0xff52('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xff52('0x3')]},'uniqueid':{'type':Sequelize[_0xff52('0x4')]},'starttime':{'type':Sequelize[_0xff52('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xff52('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xff52('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xff52('0x4')]}}; \ No newline at end of file +var _0x5ff9=['sequelize','exports','STRING','DATE'];(function(_0x240250,_0x4ee6fb){var _0x4f9a5a=function(_0x42d9cf){while(--_0x42d9cf){_0x240250['push'](_0x240250['shift']());}};_0x4f9a5a(++_0x4ee6fb);}(_0x5ff9,0xa0));var _0x95ff=function(_0x287abf,_0x35c2ce){_0x287abf=_0x287abf-0x0;var _0x2b0a26=_0x5ff9[_0x287abf];return _0x2b0a26;};'use strict';var Sequelize=require(_0x95ff('0x0'));module[_0x95ff('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x95ff('0x2')]},'scheduledat':{'type':Sequelize[_0x95ff('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x95ff('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x95ff('0x2')]},'membername':{'type':Sequelize[_0x95ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a1bcdb5..e568e45 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 _0x6030=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x384def,_0x32cc63){var _0x1150c7=function(_0x5bfed6){while(--_0x5bfed6){_0x384def['push'](_0x384def['shift']());}};_0x1150c7(++_0x32cc63);}(_0x6030,0x8b));var _0x0603=function(_0x1bfbd6,_0x20ee75){_0x1bfbd6=_0x1bfbd6-0x0;var _0x38c3ac=_0x6030[_0x1bfbd6];return _0x38c3ac;};'use strict';var _=require(_0x0603('0x0'));var util=require(_0x0603('0x1'));var logger=require(_0x0603('0x2'))(_0x0603('0x3'));var moment=require(_0x0603('0x4'));var BPromise=require(_0x0603('0x5'));var rp=require(_0x0603('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0603('0x7'));var config=require(_0x0603('0x8'));var attributes=require(_0x0603('0x9'));module[_0x0603('0xa')]=function(_0x416d8c,_0x2fdccd){return _0x416d8c[_0x0603('0xb')](_0x0603('0xc'),attributes,{'tableName':_0x0603('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5664=['moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash','util','../../config/logger'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5664,0x131));var _0x4566=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x5664[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0x4566('0x0'));var util=require(_0x4566('0x1'));var logger=require(_0x4566('0x2'))('api');var moment=require(_0x4566('0x3'));var BPromise=require(_0x4566('0x4'));var rp=require(_0x4566('0x5'));var fs=require('fs');var path=require(_0x4566('0x6'));var rimraf=require('rimraf');var config=require(_0x4566('0x7'));var attributes=require(_0x4566('0x8'));module[_0x4566('0x9')]=function(_0x1b2283,_0x548ce3){return _0x1b2283['define'](_0x4566('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index dc3dce4..8fa59c0 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 _0x134f=['http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1564d6,_0x34645d){var _0x4636fc=function(_0x3d7885){while(--_0x3d7885){_0x1564d6['push'](_0x1564d6['shift']());}};_0x4636fc(++_0x34645d);}(_0x134f,0x12a));var _0xf134=function(_0x5d20e9,_0x1e7832){_0x5d20e9=_0x5d20e9-0x0;var _0x3f10b6=_0x134f[_0x5d20e9];return _0x3f10b6;};'use strict';var _=require(_0xf134('0x0'));var util=require(_0xf134('0x1'));var moment=require(_0xf134('0x2'));var BPromise=require(_0xf134('0x3'));var rs=require(_0xf134('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf134('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf134('0x6'))(_0xf134('0x7'));var config=require(_0xf134('0x8'));var jayson=require(_0xf134('0x9'));var client=jayson['client'][_0xf134('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b423f,_0x16f316,_0x95692){return new BPromise(function(_0x32946f,_0x4fccd0){return client[_0xf134('0xb')](_0x2b423f,_0x95692)[_0xf134('0xc')](function(_0x261dd5){logger[_0xf134('0xd')](_0xf134('0xe'),_0x16f316,_0xf134('0xf'));logger[_0xf134('0x10')](_0xf134('0x11'),_0x16f316,_0xf134('0xf'),JSON[_0xf134('0x12')](_0x261dd5));if(_0x261dd5[_0xf134('0x13')]){if(_0x261dd5[_0xf134('0x13')][_0xf134('0x14')]===0x1f4){logger[_0xf134('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x16f316,_0x261dd5[_0xf134('0x13')][_0xf134('0x15')]);return _0x4fccd0(_0x261dd5[_0xf134('0x13')][_0xf134('0x15')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x16f316,_0x261dd5[_0xf134('0x13')][_0xf134('0x15')]);return _0x32946f(_0x261dd5[_0xf134('0x13')][_0xf134('0x15')]);}else{logger[_0xf134('0xd')](_0xf134('0xe'),_0x16f316,_0xf134('0xf'));_0x32946f(_0x261dd5['result'][_0xf134('0x15')]);}})['catch'](function(_0x3e5d21){logger[_0xf134('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x16f316,_0x3e5d21);_0x4fccd0(_0x3e5d21);});});}exports[_0xf134('0x16')]=function(_0x30d68b){var _0x21b8f5=this;return new Promise(function(_0x43bfcd,_0x1ac8f9){return db[_0xf134('0x17')][_0xf134('0x18')](_0x30d68b['body'],{'raw':_0x30d68b[_0xf134('0x19')]?_0x30d68b[_0xf134('0x19')][_0xf134('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xe869e6){logger[_0xf134('0xd')](_0xf134('0x16'),_0x30d68b);logger[_0xf134('0x10')]('CreateReportAgentPreview',_0x30d68b,JSON[_0xf134('0x12')](_0xe869e6));_0x43bfcd(_0xe869e6);})[_0xf134('0x1b')](function(_0x229844){logger[_0xf134('0x13')](_0xf134('0x16'),_0x229844[_0xf134('0x15')],_0x30d68b);_0x1ac8f9(_0x21b8f5['error'](0x1f4,_0x229844[_0xf134('0x15')]));});});}; \ No newline at end of file +var _0x354c=['ioredis','../../config/utils','jayson/promise','http','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','CreateReportAgentPreview','debug','util','moment','bluebird','randomstring'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x354c,0x173));var _0xc354=function(_0x48c985,_0x289ccb){_0x48c985=_0x48c985-0x0;var _0x39b565=_0x354c[_0x48c985];return _0x39b565;};'use strict';var _=require('lodash');var util=require(_0xc354('0x0'));var moment=require(_0xc354('0x1'));var BPromise=require(_0xc354('0x2'));var rs=require(_0xc354('0x3'));var fs=require('fs');var Redis=require(_0xc354('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc354('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc354('0x6'));var client=jayson['client'][_0xc354('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb1f768,_0x22a0a3,_0x1fe55b){return new BPromise(function(_0x635f0f,_0x48b665){return client['request'](_0xb1f768,_0x1fe55b)[_0xc354('0x8')](function(_0x167cf3){logger[_0xc354('0x9')](_0xc354('0xa'),_0x22a0a3,'request\x20sent');logger['debug'](_0xc354('0xb'),_0x22a0a3,_0xc354('0xc'),JSON[_0xc354('0xd')](_0x167cf3));if(_0x167cf3[_0xc354('0xe')]){if(_0x167cf3[_0xc354('0xe')][_0xc354('0xf')]===0x1f4){logger[_0xc354('0xe')](_0xc354('0xa'),_0x22a0a3,_0x167cf3[_0xc354('0xe')][_0xc354('0x10')]);return _0x48b665(_0x167cf3['error'][_0xc354('0x10')]);}logger[_0xc354('0xe')](_0xc354('0xa'),_0x22a0a3,_0x167cf3[_0xc354('0xe')]['message']);return _0x635f0f(_0x167cf3[_0xc354('0xe')][_0xc354('0x10')]);}else{logger[_0xc354('0x9')](_0xc354('0xa'),_0x22a0a3,_0xc354('0xc'));_0x635f0f(_0x167cf3[_0xc354('0x11')]['message']);}})[_0xc354('0x12')](function(_0x42c945){logger[_0xc354('0xe')](_0xc354('0xa'),_0x22a0a3,_0x42c945);_0x48b665(_0x42c945);});});}exports['CreateReportAgentPreview']=function(_0x5a60a7){var _0x4d5af1=this;return new Promise(function(_0x321244,_0x127099){return db[_0xc354('0x13')][_0xc354('0x14')](_0x5a60a7[_0xc354('0x15')],{'raw':_0x5a60a7[_0xc354('0x16')]?_0x5a60a7[_0xc354('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xc354('0x8')](function(_0x1a9263){logger[_0xc354('0x9')](_0xc354('0x17'),_0x5a60a7);logger[_0xc354('0x18')]('CreateReportAgentPreview',_0x5a60a7,JSON['stringify'](_0x1a9263));_0x321244(_0x1a9263);})[_0xc354('0x12')](function(_0x40b6ff){logger['error'](_0xc354('0x17'),_0x40b6ff[_0xc354('0x10')],_0x5a60a7);_0x127099(_0x4d5af1[_0xc354('0xe')](0x1f4,_0x40b6ff[_0xc354('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1191682..6504475 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 _0x73bd=['/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','agents','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x73bd,0x1f0));var _0xd73b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x73bd[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd73b('0x0'));var util=require(_0xd73b('0x1'));var path=require('path');var express=require(_0xd73b('0x2'));var router=express[_0xd73b('0x3')]();var auth=require(_0xd73b('0x4'));var controller=require(_0xd73b('0x5'));router[_0xd73b('0x6')]('/voice/channels',auth[_0xd73b('0x7')](),controller[_0xd73b('0x8')]);router[_0xd73b('0x6')](_0xd73b('0x9'),auth[_0xd73b('0x7')](),controller['voiceChannelMixMonitor']);router['get'](_0xd73b('0xa'),auth[_0xd73b('0x7')](),controller[_0xd73b('0xb')]);router[_0xd73b('0x6')](_0xd73b('0xc'),auth[_0xd73b('0x7')](),controller['voiceQueues']);router['get'](_0xd73b('0xd'),auth['isAuthenticated'](),controller[_0xd73b('0xe')]);router[_0xd73b('0x6')](_0xd73b('0xf'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x10')]);router[_0xd73b('0x6')](_0xd73b('0x11'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x12')]);router[_0xd73b('0x6')](_0xd73b('0x13'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x14')]);router[_0xd73b('0x6')](_0xd73b('0x15'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x16')]);router['get'](_0xd73b('0x17'),auth[_0xd73b('0x7')](),controller['whatsappQueues']);router[_0xd73b('0x6')]('/fax/queues',auth[_0xd73b('0x7')](),controller[_0xd73b('0x18')]);router['get'](_0xd73b('0x19'),auth[_0xd73b('0x7')](),controller['voiceQueuesPreview']);router[_0xd73b('0x6')](_0xd73b('0x1a'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x1b')]);router[_0xd73b('0x6')](_0xd73b('0x1c'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x1d')]);router[_0xd73b('0x6')](_0xd73b('0x1e'),auth[_0xd73b('0x7')](),controller['voiceQueuesChannelHangup']);router[_0xd73b('0x6')](_0xd73b('0x1f'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xd73b('0x6')](_0xd73b('0x20'),auth['isAuthenticated'](),controller[_0xd73b('0x21')]);router[_0xd73b('0x22')](_0xd73b('0x20'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x23')]);router[_0xd73b('0x6')]('/outbound',auth[_0xd73b('0x7')](),controller[_0xd73b('0x24')]);router[_0xd73b('0x6')](_0xd73b('0x25'),auth[_0xd73b('0x7')](),controller['outboundChannels']);router[_0xd73b('0x6')]('/agents',auth[_0xd73b('0x7')](),controller[_0xd73b('0x26')]);router['put']('/agents/:id/capacity',auth[_0xd73b('0x7')](),controller[_0xd73b('0x27')]);router[_0xd73b('0x6')](_0xd73b('0x28'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x29')]);router[_0xd73b('0x6')](_0xd73b('0x2a'),auth[_0xd73b('0x7')](),controller['trunks']);router[_0xd73b('0x6')](_0xd73b('0x2b'),auth['isAuthenticated'](),controller[_0xd73b('0x2c')]);router[_0xd73b('0x6')]('/fax/accounts',auth[_0xd73b('0x7')](),controller[_0xd73b('0x2d')]);router[_0xd73b('0x6')](_0xd73b('0x2e'),auth[_0xd73b('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xd73b('0x6')](_0xd73b('0x2f'),auth[_0xd73b('0x7')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xd73b('0x30'),auth[_0xd73b('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0xd73b('0x6')](_0xd73b('0x31'),auth['isAuthenticated'](),controller[_0xd73b('0x32')]);router[_0xd73b('0x6')](_0xd73b('0x33'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x34')]);router['get'](_0xd73b('0x35'),auth[_0xd73b('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0xd73b('0x6')](_0xd73b('0x36'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x37')]);router[_0xd73b('0x38')](_0xd73b('0x39'),auth['isAuthenticated'](),controller[_0xd73b('0x3a')](_0xd73b('0x3b')));router['get'](_0xd73b('0x3c'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x3d')]);router['post'](_0xd73b('0x3e'),auth[_0xd73b('0x7')](),controller['queueNotify'](_0xd73b('0x3f')));router[_0xd73b('0x6')](_0xd73b('0x40'),auth['isAuthenticated'](),controller[_0xd73b('0x41')]);router[_0xd73b('0x38')](_0xd73b('0x42'),auth['isAuthenticated'](),controller[_0xd73b('0x3a')](_0xd73b('0x43')));router['get'](_0xd73b('0x44'),auth[_0xd73b('0x7')](),controller[_0xd73b('0x45')]);router[_0xd73b('0x38')](_0xd73b('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0xd73b('0x47')));router[_0xd73b('0x6')](_0xd73b('0x48'),auth[_0xd73b('0x7')](),controller['showOpenchannelQueues']);router[_0xd73b('0x38')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xd73b('0x3a')](_0xd73b('0x49')));router['post'](_0xd73b('0x4a'),auth[_0xd73b('0x7')](),controller['queueNotify'](_0xd73b('0x4b')));router[_0xd73b('0x6')](_0xd73b('0x4c'),auth[_0xd73b('0x7')](),controller['showSmsQueues']);router[_0xd73b('0x6')]('/whatsapp/queues/:id',auth[_0xd73b('0x7')](),controller[_0xd73b('0x4d')]);router['post'](_0xd73b('0x4e'),auth['isAuthenticated'](),controller['agentNotify']);module[_0xd73b('0x4f')]=router; \ No newline at end of file +var _0xb556=['post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','exports','multer','path','express','Router','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','showMailQueues'];(function(_0x5a1aca,_0x4f95e7){var _0x4918d1=function(_0x4dd12c){while(--_0x4dd12c){_0x5a1aca['push'](_0x5a1aca['shift']());}};_0x4918d1(++_0x4f95e7);}(_0xb556,0x1df));var _0x6b55=function(_0x3c04dd,_0x28a5b1){_0x3c04dd=_0x3c04dd-0x0;var _0x26e974=_0xb556[_0x3c04dd];return _0x26e974;};'use strict';var multer=require(_0x6b55('0x0'));var util=require('util');var path=require(_0x6b55('0x1'));var express=require(_0x6b55('0x2'));var router=express[_0x6b55('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x6b55('0x4'));router[_0x6b55('0x5')]('/voice/channels',auth[_0x6b55('0x6')](),controller[_0x6b55('0x7')]);router[_0x6b55('0x5')](_0x6b55('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x6b55('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x6b55('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x6b55('0x5')](_0x6b55('0x9'),auth[_0x6b55('0x6')](),controller[_0x6b55('0xa')]);router[_0x6b55('0x5')](_0x6b55('0xb'),auth[_0x6b55('0x6')](),controller[_0x6b55('0xc')]);router[_0x6b55('0x5')](_0x6b55('0xd'),auth[_0x6b55('0x6')](),controller[_0x6b55('0xe')]);router['get'](_0x6b55('0xf'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x10')]);router['get'](_0x6b55('0x11'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x12')]);router['get'](_0x6b55('0x13'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x14')]);router[_0x6b55('0x5')]('/whatsapp/queues',auth[_0x6b55('0x6')](),controller[_0x6b55('0x15')]);router[_0x6b55('0x5')](_0x6b55('0x16'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x17')]);router[_0x6b55('0x5')]('/voice/queues/preview/:id',auth[_0x6b55('0x6')](),controller[_0x6b55('0x18')]);router[_0x6b55('0x5')](_0x6b55('0x19'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x1a')]);router['get'](_0x6b55('0x1b'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x1c')]);router[_0x6b55('0x5')](_0x6b55('0x1d'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x1e')]);router[_0x6b55('0x5')](_0x6b55('0x1f'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x6b55('0x5')](_0x6b55('0x20'),auth[_0x6b55('0x6')](),controller['showVoiceQueues']);router[_0x6b55('0x21')](_0x6b55('0x20'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x22')]);router[_0x6b55('0x5')](_0x6b55('0x23'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x24')]);router[_0x6b55('0x5')](_0x6b55('0x25'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x26')]);router['get'](_0x6b55('0x27'),auth[_0x6b55('0x6')](),controller['agents']);router[_0x6b55('0x21')](_0x6b55('0x28'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x29')]);router['get'](_0x6b55('0x2a'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x2b')]);router[_0x6b55('0x5')](_0x6b55('0x2c'),auth[_0x6b55('0x6')](),controller['trunks']);router['get']('/campaigns',auth['isAuthenticated'](),controller['campaigns']);router[_0x6b55('0x5')](_0x6b55('0x2d'),auth[_0x6b55('0x6')](),controller['faxAccounts']);router[_0x6b55('0x5')](_0x6b55('0x2e'),auth['isAuthenticated'](),controller[_0x6b55('0x2f')]);router[_0x6b55('0x5')]('/mail/queues/waitinginteractions',auth[_0x6b55('0x6')](),controller[_0x6b55('0x30')]);router[_0x6b55('0x5')](_0x6b55('0x31'),auth[_0x6b55('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x6b55('0x5')](_0x6b55('0x32'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x33')]);router[_0x6b55('0x5')]('/sms/queues/waitinginteractions',auth[_0x6b55('0x6')](),controller[_0x6b55('0x34')]);router[_0x6b55('0x5')](_0x6b55('0x35'),auth['isAuthenticated'](),controller[_0x6b55('0x36')]);router[_0x6b55('0x5')](_0x6b55('0x37'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x38')]);router['post']('/mail/queues/:id/notify',auth[_0x6b55('0x6')](),controller[_0x6b55('0x39')](_0x6b55('0x3a')));router[_0x6b55('0x5')]('/mail/queues/:id',auth[_0x6b55('0x6')](),controller[_0x6b55('0x3b')]);router[_0x6b55('0x3c')](_0x6b55('0x3d'),auth['isAuthenticated'](),controller[_0x6b55('0x39')](_0x6b55('0x3e')));router[_0x6b55('0x5')](_0x6b55('0x3f'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x6b55('0x3c')](_0x6b55('0x40'),auth['isAuthenticated'](),controller[_0x6b55('0x39')]('fax'));router[_0x6b55('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x6b55('0x41')]);router[_0x6b55('0x3c')](_0x6b55('0x42'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x39')](_0x6b55('0x43')));router[_0x6b55('0x5')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x6b55('0x44')]);router['post'](_0x6b55('0x45'),auth[_0x6b55('0x6')](),controller[_0x6b55('0x39')](_0x6b55('0x46')));router[_0x6b55('0x3c')](_0x6b55('0x47'),auth['isAuthenticated'](),controller['queueNotify'](_0x6b55('0x48')));router[_0x6b55('0x5')](_0x6b55('0x49'),auth[_0x6b55('0x6')](),controller['showSmsQueues']);router[_0x6b55('0x5')](_0x6b55('0x4a'),auth[_0x6b55('0x6')](),controller['showWhatsappQueues']);router[_0x6b55('0x3c')](_0x6b55('0x4b'),auth[_0x6b55('0x6')](),controller['agentNotify']);module[_0x6b55('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5c88976..23db126 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 _0x814b=['whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','create','Start','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues'];(function(_0x271756,_0x3c72d8){var _0x59e12c=function(_0x26d1c8){while(--_0x26d1c8){_0x271756['push'](_0x271756['shift']());}};_0x59e12c(++_0x3c72d8);}(_0x814b,0x1a2));var _0xb814=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x814b[_0x21f9c2];return _0x3da17f;};'use strict';var BPromise=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var db=require(_0xb814('0x4'))['db'];var logger=require(_0xb814('0x5'))('api');var jayson=require(_0xb814('0x6'));var amiClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232a});var mailClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232b});var routingClient=jayson[_0xb814('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){var _0x186d5a=_0x5c8539?_0x5c8539:amiClient;return _0x186d5a[_0xb814('0x9')](_0x3b0829,_0x2e6272)[_0xb814('0xa')](function(_0x21d4a5){if(_0x21d4a5[_0xb814('0xb')]){if(_0x21d4a5[_0xb814('0xb')][_0xb814('0xc')]===0x1f4){return _0x2913a6(_0x21d4a5[_0xb814('0xb')][_0xb814('0xd')]);}return _0x271af9(_0x21d4a5['error'][_0xb814('0xd')]);}else{_0x271af9(_0x21d4a5['result']);}})[_0xb814('0xe')](function(_0x15d6ef){_0x2913a6(_0x15d6ef);});});}function respondWithResult(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xc8;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0xf')](_0x2cc46b)[_0xb814('0x10')](_0x2ce718);}return _0x35b10d[_0xb814('0x11')](0x194);};}function handleError(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0x1f4;return function(_0x3f4881){logger[_0xb814('0xb')](_0x3f4881[_0xb814('0x12')]);if(_0x3f4881[_0xb814('0x13')]){delete _0x3f4881[_0xb814('0x13')];}_0xa0a2e5[_0xb814('0xf')](_0x2ab627)[_0xb814('0x14')](_0x3f4881);};}function findById(_0x265a83){return function(_0x125ce2){if(!_[_0xb814('0x15')](_0x265a83)&&!_[_0xb814('0x15')](_0x125ce2)&&!_['isNil'](_0x125ce2[_0xb814('0x16')])){return _['find'](_0x125ce2[_0xb814('0x16')],function(_0xfac75b){return _0xfac75b['id']==_0x265a83;});}return null;};}exports['voiceChannels']=function(_0x4b55a7,_0x55d63c){return respondWithRpcPromise(_0xb814('0x17'),_0x4b55a7['query'])['then'](respondWithResult(_0x55d63c,null))[_0xb814('0xe')](handleError(_0x55d63c,null));};exports[_0xb814('0x18')]=function(_0x25b6b6,_0x4e139e){return respondWithRpcPromise(_0xb814('0x19'),_['merge'](_0x25b6b6[_0xb814('0x1a')],_0x25b6b6[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4e139e,null))[_0xb814('0xe')](handleError(_0x4e139e,null));};exports[_0xb814('0x1c')]=function(_0x2bd039,_0x1f5d40){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xb814('0x1d')](_0x2bd039['query'],_0x2bd039[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1f5d40,null))[_0xb814('0xe')](handleError(_0x1f5d40,null));};exports[_0xb814('0x1e')]=function(_0x1c8a2e,_0xb9e57d){return respondWithRpcPromise(_0xb814('0x1f'),_0x1c8a2e['query'])[_0xb814('0xa')](respondWithResult(_0xb9e57d,null))[_0xb814('0xe')](handleError(_0xb9e57d,null));};exports[_0xb814('0x20')]=function(_0x349394,_0x32ed56){return respondWithRpcPromise(_0xb814('0x1f'),_0x349394[_0xb814('0x1a')])[_0xb814('0xa')](findById(_0x349394['params']['id']))[_0xb814('0xa')](respondWithResult(_0x32ed56,null))[_0xb814('0xe')](handleError(_0x32ed56,null));};exports['updateVoiceQueue']=function(_0x9008b2,_0x37d24d){return respondWithRpcPromise(_0xb814('0x21'),_['merge'](_0x9008b2[_0xb814('0x22')],_0x9008b2[_0xb814('0x1b')]))['then'](respondWithResult(_0x37d24d,null))[_0xb814('0xe')](handleError(_0x37d24d,null));};exports['voiceQueuesPreview']=function(_0x6efe9a,_0x5f3e9b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xb814('0x1d')](_0x6efe9a['query'],_0x6efe9a[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x5f3e9b,null))[_0xb814('0xe')](handleError(_0x5f3e9b,null));};exports['voiceQueuesChannels']=function(_0x51d5ae,_0x26d3a9){return respondWithRpcPromise(_0xb814('0x23'),_0x51d5ae['query'])[_0xb814('0xa')](respondWithResult(_0x26d3a9,null))[_0xb814('0xe')](handleError(_0x26d3a9,null));};exports[_0xb814('0x24')]=function(_0x217b7e,_0x1b78de){return respondWithRpcPromise(_0xb814('0x25'),_[_0xb814('0x1d')](_0x217b7e['query'],_0x217b7e[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1b78de,null))[_0xb814('0xe')](handleError(_0x1b78de,null));};exports[_0xb814('0x26')]=function(_0x14100d,_0x4ff31a){return respondWithRpcPromise(_0xb814('0x27'),_['merge'](_0x14100d[_0xb814('0x1a')],_0x14100d[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ff31a,null))['catch'](handleError(_0x4ff31a,null));};exports[_0xb814('0x28')]=function(_0xbdb3e9,_0x4ea6f8){return respondWithRpcPromise(_0xb814('0x29'),_[_0xb814('0x1d')](_0xbdb3e9[_0xb814('0x1a')],_0xbdb3e9[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ea6f8,null))[_0xb814('0xe')](handleError(_0x4ea6f8,null));};exports['outbound']=function(_0xa6ce87,_0x4e4684){return respondWithRpcPromise(_0xb814('0x2a'),_0xa6ce87['query'])[_0xb814('0xa')](respondWithResult(_0x4e4684,null))['catch'](handleError(_0x4e4684,null));};exports[_0xb814('0x2b')]=function(_0x26675a,_0x54a7fb){return respondWithRpcPromise('OutboundChannels',_0x26675a['query'])['then'](respondWithResult(_0x54a7fb,null))[_0xb814('0xe')](handleError(_0x54a7fb,null));};exports[_0xb814('0x2c')]=function(_0x38cdc2,_0x42c2ed){var _0x51cdba;return respondWithRpcPromise('Agents',_0x38cdc2[_0xb814('0x1a')])['then'](function(_0x2a93da){_0x51cdba=_0x2a93da;return respondWithRpcPromise(_0xb814('0x2d'),_0x38cdc2[_0xb814('0x1a')],routingClient);})[_0xb814('0xa')](function(_0x42653f){return _[_0xb814('0x1d')]({},_0x42653f,_0x51cdba);})[_0xb814('0xa')](respondWithResult(_0x42c2ed,null))[_0xb814('0xe')](handleError(_0x42c2ed,null));};exports[_0xb814('0x2e')]=function(_0x4b6ff8,_0x544d36){if(_0x4b6ff8['body']&&_0x4b6ff8[_0xb814('0x22')]['interaction']&&_0x4b6ff8[_0xb814('0x2f')]&&_0x4b6ff8['user'][_0xb814('0x13')]){for(var _0x44ff56 in _0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')]){if(_0x4b6ff8['body'][_0xb814('0x30')][_0xb814('0x31')](_0x44ff56)){db[_0xb814('0x32')][_0xb814('0x33')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]&&_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')]?{'$notIn':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]}:{'$ne':null}}})['then'](function(_0x4a5e84){var _0xe751c3=moment()[_0xb814('0x35')](_0xb814('0x36'));for(var _0x2bf906=0x0,_0x43f1b=_0x4a5e84[_0xb814('0x34')];_0x2bf906<_0x43f1b;_0x2bf906+=0x1){_0x4a5e84[_0x2bf906][_0xb814('0x37')]({'exitAt':_0xe751c3});}});for(var _0x40af85=0x0;_0x40af85<_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')];_0x40af85+=0x1){db['MemberReport'][_0xb814('0x38')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')]['name'],'type':_0xb814('0x39'),'uniqueid':_0x4b6ff8['body'][_0xb814('0x30')][_0x44ff56][_0x40af85],'exitAt':null},'defaults':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'interface':_[_0xb814('0x15')](_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3a')])?util[_0xb814('0x35')](_0xb814('0x3b'),_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')]):_0x4b6ff8['user']['interface'],'type':_0xb814('0x39'),'enterAt':moment()[_0xb814('0x35')](_0xb814('0x36')),'role':_0xb814('0x3c'),'internal':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3d')],'uniqueid':_0x4b6ff8[_0xb814('0x22')]['interaction'][_0x44ff56][_0x40af85]}});}}}}return respondWithRpcPromise(_0xb814('0x3e'),{'id':_0x4b6ff8[_0xb814('0x1b')]['id'],'capacity':_0x4b6ff8[_0xb814('0x22')]['capacity']},routingClient)[_0xb814('0xa')](respondWithResult(_0x544d36,null))['catch'](handleError(_0x544d36,null));};exports[_0xb814('0x3f')]=function(_0x5dc28e,_0x403872){return respondWithRpcPromise(_0xb814('0x40'),_0x5dc28e['query'])[_0xb814('0xa')](respondWithResult(_0x403872,null))[_0xb814('0xe')](handleError(_0x403872,null));};exports[_0xb814('0x41')]=function(_0x5209d1,_0x3da050){return respondWithRpcPromise('Trunks',_0x5209d1[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x3da050,null))['catch'](handleError(_0x3da050,null));};exports[_0xb814('0x42')]=function(_0x4a3f84,_0x539be7){return respondWithRpcPromise(_0xb814('0x43'),_0x4a3f84[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x539be7,null))['catch'](handleError(_0x539be7,null));};exports[_0xb814('0x44')]=function(_0x538b0f,_0xf88d23){return respondWithRpcPromise(_0xb814('0x45'),_0x538b0f['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0xf88d23,null))['catch'](handleError(_0xf88d23,null));};exports[_0xb814('0x46')]=function(_0x1656ed,_0xb2bd82){return respondWithRpcPromise(_0xb814('0x45'),_0x1656ed[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x1656ed[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0xb2bd82,null))['catch'](handleError(_0xb2bd82,null));};exports[_0xb814('0x47')]=function(_0x5441c5,_0x5d71d5){return respondWithRpcPromise(_0xb814('0x48'),_0x5441c5[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x5d71d5,null))[_0xb814('0xe')](handleError(_0x5d71d5,null));};exports['showMailQueues']=function(_0x48362c,_0x2114ca){return respondWithRpcPromise('MailQueues',_0x48362c[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x48362c[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x2114ca,null))[_0xb814('0xe')](handleError(_0x2114ca,null));};exports['mailAccounts']=function(_0x2ef77d,_0x1e9196){return respondWithRpcPromise(_0xb814('0x49'),_0x2ef77d[_0xb814('0x1a')],mailClient)[_0xb814('0xa')](respondWithResult(_0x1e9196,null))[_0xb814('0xe')](handleError(_0x1e9196,null));};exports[_0xb814('0x4a')]=function(_0x113350,_0x46014f){return respondWithRpcPromise('OpenchannelQueues',_0x113350[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x46014f,null))[_0xb814('0xe')](handleError(_0x46014f,null));};exports[_0xb814('0x4b')]=function(_0x3b35a8,_0x3d4843){return respondWithRpcPromise('OpenchannelQueues',_0x3b35a8[_0xb814('0x1a')],routingClient)['then'](findById(_0x3b35a8[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x3d4843,null))[_0xb814('0xe')](handleError(_0x3d4843,null));};exports['smsQueues']=function(_0x150e73,_0x579351){return respondWithRpcPromise(_0xb814('0x4c'),_0x150e73['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x579351,null))[_0xb814('0xe')](handleError(_0x579351,null));};exports[_0xb814('0x4d')]=function(_0x1b024f,_0x3377d4){return respondWithRpcPromise(_0xb814('0x4c'),_0x1b024f[_0xb814('0x1a')],routingClient)['then'](findById(_0x1b024f[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3377d4,null))[_0xb814('0xe')](handleError(_0x3377d4,null));};exports[_0xb814('0x4e')]=function(_0x1b989d,_0x3dcaeb){return respondWithRpcPromise(_0xb814('0x4f'),_0x1b989d[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x3dcaeb,null))[_0xb814('0xe')](handleError(_0x3dcaeb,null));};exports[_0xb814('0x50')]=function(_0x4a49ba,_0x3bb2b4){return respondWithRpcPromise(_0xb814('0x4f'),_0x4a49ba[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x4a49ba[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3bb2b4,null))[_0xb814('0xe')](handleError(_0x3bb2b4,null));};exports['faxQueues']=function(_0x24594a,_0x16f8f2){return respondWithRpcPromise(_0xb814('0x51'),_0x24594a[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x16f8f2,null))[_0xb814('0xe')](handleError(_0x16f8f2,null));};exports['showFaxQueues']=function(_0x506bf2,_0x5d064b){return respondWithRpcPromise(_0xb814('0x51'),_0x506bf2['query'],routingClient)[_0xb814('0xa')](findById(_0x506bf2[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x5d064b,null))['catch'](handleError(_0x5d064b,null));};exports[_0xb814('0x52')]=function(_0x3e5ce8,_0xee204){return respondWithRpcPromise('FaxAccounts',_0x3e5ce8[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0xee204,null))[_0xb814('0xe')](handleError(_0xee204,null));};exports[_0xb814('0x53')]=function(_0x555be0,_0x5dedd7){return respondWithRpcPromise(_0xb814('0x54'),_0x555be0[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5dedd7,null))[_0xb814('0xe')](handleError(_0x5dedd7,null));};exports[_0xb814('0x55')]=function(_0xe5fc12,_0x34a0b3){return respondWithRpcPromise(_0xb814('0x56'),_0xe5fc12[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x34a0b3,null))[_0xb814('0xe')](handleError(_0x34a0b3,null));};exports[_0xb814('0x57')]=function(_0x3ef474,_0x21fc41){return respondWithRpcPromise(_0xb814('0x58'),_0x3ef474['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x21fc41,null))[_0xb814('0xe')](handleError(_0x21fc41,null));};exports[_0xb814('0x59')]=function(_0x357b90,_0xec821a){return respondWithRpcPromise(_0xb814('0x58'),_0x357b90['query'],routingClient)[_0xb814('0xa')](function(_0x52e1fc){if(_0x357b90[_0xb814('0x1a')][_0xb814('0x5a')]!==undefined){var _0x3c5a58=_(_0x52e1fc[_0xb814('0x16')])[_0xb814('0x5b')]([_0x357b90['query']['type'],_0x357b90[_0xb814('0x1b')]['id']])[_0xb814('0x5c')](_0xb814('0x5d'))[_0xb814('0x5e')]()['value']();return _0x52e1fc[_0xb814('0x16')]['filter'](function(_0x39073c){return _0x3c5a58[_0xb814('0x5f')](_0x39073c['queue_id'])>-0x1;});}else{return _0x52e1fc['rows'][_0xb814('0x5b')](function(_0x52e17a){return _0x52e17a[_0xb814('0x5d')]===parseInt(_0x357b90[_0xb814('0x1b')]['id']);});}})[_0xb814('0xa')](respondWithResult(_0xec821a,null))[_0xb814('0xe')](handleError(_0xec821a,null));};exports[_0xb814('0x60')]=function(_0x420bde,_0x40fe4a){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x420bde[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x40fe4a,null))[_0xb814('0xe')](handleError(_0x40fe4a,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2838cb,_0x43ee60){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2838cb[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x43ee60,null))[_0xb814('0xe')](handleError(_0x43ee60,null));};exports[_0xb814('0x61')]=function(_0x4e15c2,_0x5a0c4a){return respondWithRpcPromise(_0xb814('0x62'),_0x4e15c2[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5a0c4a,null))[_0xb814('0xe')](handleError(_0x5a0c4a,null));};exports[_0xb814('0x63')]=function(_0x4394da){return function(_0x2b12a9,_0x314600){var _0x8cb107,_0x34f49c;var _0x53e705=_['capitalize'](_0x4394da);var _0x5bee4d=_0x4394da==='chat'?'Website':_0xb814('0x64');return db[_0x53e705+_0xb814('0x65')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x2b12a9['params']['id']}})[_0xb814('0xa')](function(_0x1fb1ea){if(_[_0xb814('0x15')](_0x1fb1ea)){throw new Error(_0x53e705+_0xb814('0x67'));}_0x8cb107=_0x1fb1ea;return db[_0x53e705+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x2b12a9[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x53e705+'Interaction'],'as':_0xb814('0x6a')},{'model':db[_0x53e705+_0x5bee4d],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x30faa0){if(_['isNil'](_0x30faa0)){throw new Error(_0x53e705+_0xb814('0x6b'));}_0x34f49c=_0x30faa0;return _0x30faa0[_0xb814('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3037f2={'uniqueid':_0x4394da+'.'+_0x34f49c['id']+'.'+_0x34f49c[_0xb814('0x6a')]['id'],'FromUserId':_0x2b12a9['user']['id'],'type':'queue'};_0x3037f2[_0x53e705+_0xb814('0x6d')]=_0x34f49c['id'];_0x3037f2[_0x53e705+'InteractionId']=_0x34f49c[_0xb814('0x6a')]['id'];_0x3037f2[_0xb814('0x6e')+_0x53e705+_0x5bee4d+'Id']=_0x34f49c['Account']['id'];_0x3037f2['To'+_0x53e705+_0xb814('0x6f')]=_0x8cb107['id'];return db[_0x53e705+'TransferReport'][_0xb814('0x70')](_0x3037f2);})['then'](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x4394da,'interaction':_0x34f49c[_0xb814('0x6a')],'message':_0x34f49c,'account':_0x34f49c[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x72'),'appdata':_0x8cb107[_0xb814('0x13')]+','+(_0x34f49c[_0xb814('0x64')][_0xb814('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x314600,null))[_0xb814('0xe')](handleError(_0x314600,null));};};exports['agentNotify']=function(_0x511e03,_0x2d0061){var _0x8fbda1,_0x25d42d;if(_['isNil'](_0x511e03[_0xb814('0x22')]['channel'])){throw new Error(_0xb814('0x74'));}var _0x19d508=_0x511e03[_0xb814('0x22')][_0xb814('0x75')];var _0x4c8a00=_[_0xb814('0x76')](_0x19d508);var _0xc0ff3c=_0x19d508===_0xb814('0x77')?'Website':_0xb814('0x64');return db[_0xb814('0x78')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x511e03['params']['id'],'role':_0xb814('0x3c')}})[_0xb814('0xa')](function(_0x9dc06b){if(_[_0xb814('0x15')](_0x9dc06b)){throw new Error(_0xb814('0x79'));}_0x8fbda1=_0x9dc06b;return db[_0x4c8a00+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x511e03[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x4c8a00+_0xb814('0x6a')],'as':_0xb814('0x6a')},{'model':db[_0x4c8a00+_0xc0ff3c],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x5b8d2e){if(_['isNil'](_0x5b8d2e)){throw new Error(_0x4c8a00+_0xb814('0x6b'));}_0x25d42d=_0x5b8d2e;return _0x5b8d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3949fd={'uniqueid':_0x19d508+'.'+_0x25d42d['id']+'.'+_0x25d42d[_0xb814('0x6a')]['id'],'FromUserId':_0x511e03[_0xb814('0x2f')]['id'],'type':_0xb814('0x72'),'ToUserId':_0x8fbda1['id']};_0x3949fd[_0x4c8a00+_0xb814('0x6d')]=_0x25d42d['id'];_0x3949fd[_0x4c8a00+_0xb814('0x7a')]=_0x25d42d['Interaction']['id'];_0x3949fd['From'+_0x4c8a00+_0xc0ff3c+'Id']=_0x25d42d[_0xb814('0x64')]['id'];return db[_0x4c8a00+'TransferReport'][_0xb814('0x70')](_0x3949fd);})[_0xb814('0xa')](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x19d508,'interaction':_0x25d42d['Interaction'],'message':_0x25d42d,'account':_0x25d42d[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x3c'),'appdata':_0x8fbda1[_0xb814('0x13')]+','+(_0x25d42d[_0xb814('0x64')][_0xb814('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb814('0xa')](respondWithResult(_0x2d0061,null))[_0xb814('0xe')](handleError(_0x2d0061,null));}; \ No newline at end of file +var _0xf494=['WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','MessageId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','messageId','update','InteractionId','From','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','status','json','sendStatus','stack','name','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues'];(function(_0x3ddb2,_0x386ec3){var _0x41cc1f=function(_0x13e620){while(--_0x13e620){_0x3ddb2['push'](_0x3ddb2['shift']());}};_0x41cc1f(++_0x386ec3);}(_0xf494,0x1c6));var _0x4f49=function(_0x40c0d1,_0x12887e){_0x40c0d1=_0x40c0d1-0x0;var _0x452f86=_0xf494[_0x40c0d1];return _0x452f86;};'use strict';var BPromise=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));var util=require('util');var db=require(_0x4f49('0x3'))['db'];var logger=require(_0x4f49('0x4'))(_0x4f49('0x5'));var jayson=require(_0x4f49('0x6'));var amiClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232a});var mailClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232b});var routingClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){var _0x31a725=_0x58e9a0?_0x58e9a0:amiClient;return _0x31a725[_0x4f49('0x9')](_0x42b0e8,_0x5eb186)[_0x4f49('0xa')](function(_0x174d0d){if(_0x174d0d[_0x4f49('0xb')]){if(_0x174d0d[_0x4f49('0xb')]['code']===0x1f4){return _0x327bd5(_0x174d0d[_0x4f49('0xb')][_0x4f49('0xc')]);}return _0x169c95(_0x174d0d['error'][_0x4f49('0xc')]);}else{_0x169c95(_0x174d0d['result']);}})['catch'](function(_0x4b9cd3){_0x327bd5(_0x4b9cd3);});});}function respondWithResult(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xc8;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0xd')](_0x4bf89f)[_0x4f49('0xe')](_0x1e1c37);}return _0x12527d[_0x4f49('0xf')](0x194);};}function handleError(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0x1f4;return function(_0xfdb477){logger['error'](_0xfdb477[_0x4f49('0x10')]);if(_0xfdb477[_0x4f49('0x11')]){delete _0xfdb477[_0x4f49('0x11')];}_0x1a0f1e['status'](_0x2f0131)['send'](_0xfdb477);};}function findById(_0x2f0a0d){return function(_0x2ecaaa){if(!_[_0x4f49('0x12')](_0x2f0a0d)&&!_['isNil'](_0x2ecaaa)&&!_[_0x4f49('0x12')](_0x2ecaaa[_0x4f49('0x13')])){return _[_0x4f49('0x14')](_0x2ecaaa['rows'],function(_0x5bb23b){return _0x5bb23b['id']==_0x2f0a0d;});}return null;};}exports['voiceChannels']=function(_0x47f1e8,_0xb2081a){return respondWithRpcPromise(_0x4f49('0x15'),_0x47f1e8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0xb2081a,null))['catch'](handleError(_0xb2081a,null));};exports[_0x4f49('0x17')]=function(_0x2aed27,_0x197a49){return respondWithRpcPromise(_0x4f49('0x18'),_[_0x4f49('0x19')](_0x2aed27['query'],_0x2aed27[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x197a49,null))[_0x4f49('0x1b')](handleError(_0x197a49,null));};exports['voiceChannelStopMixMonitor']=function(_0x40755e,_0x1d70a7){return respondWithRpcPromise(_0x4f49('0x1c'),_[_0x4f49('0x19')](_0x40755e[_0x4f49('0x16')],_0x40755e[_0x4f49('0x1a')]))['then'](respondWithResult(_0x1d70a7,null))['catch'](handleError(_0x1d70a7,null));};exports[_0x4f49('0x1d')]=function(_0x429de7,_0x4fedbb){return respondWithRpcPromise(_0x4f49('0x1e'),_0x429de7[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x4fedbb,null))['catch'](handleError(_0x4fedbb,null));};exports[_0x4f49('0x1f')]=function(_0x2eed1c,_0x298785){return respondWithRpcPromise(_0x4f49('0x1e'),_0x2eed1c[_0x4f49('0x16')])[_0x4f49('0xa')](findById(_0x2eed1c['params']['id']))['then'](respondWithResult(_0x298785,null))[_0x4f49('0x1b')](handleError(_0x298785,null));};exports[_0x4f49('0x20')]=function(_0x605c91,_0x560050){return respondWithRpcPromise(_0x4f49('0x21'),_[_0x4f49('0x19')](_0x605c91[_0x4f49('0x22')],_0x605c91['params']))['then'](respondWithResult(_0x560050,null))[_0x4f49('0x1b')](handleError(_0x560050,null));};exports[_0x4f49('0x23')]=function(_0x7a6ea0,_0x5e7076){return respondWithRpcPromise(_0x4f49('0x24'),_[_0x4f49('0x19')](_0x7a6ea0[_0x4f49('0x16')],_0x7a6ea0[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x5e7076,null))[_0x4f49('0x1b')](handleError(_0x5e7076,null));};exports[_0x4f49('0x25')]=function(_0x45ae19,_0x1f38d3){return respondWithRpcPromise(_0x4f49('0x26'),_0x45ae19[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f38d3,null))[_0x4f49('0x1b')](handleError(_0x1f38d3,null));};exports[_0x4f49('0x27')]=function(_0x135d17,_0x97ef98){return respondWithRpcPromise(_0x4f49('0x28'),_[_0x4f49('0x19')](_0x135d17[_0x4f49('0x16')],_0x135d17['params']))[_0x4f49('0xa')](respondWithResult(_0x97ef98,null))[_0x4f49('0x1b')](handleError(_0x97ef98,null));};exports[_0x4f49('0x29')]=function(_0x1cb3cc,_0x1c3af8){return respondWithRpcPromise(_0x4f49('0x2a'),_[_0x4f49('0x19')](_0x1cb3cc[_0x4f49('0x16')],_0x1cb3cc[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x1c3af8,null))[_0x4f49('0x1b')](handleError(_0x1c3af8,null));};exports[_0x4f49('0x2b')]=function(_0x3ec6c4,_0x4d2d57){return respondWithRpcPromise(_0x4f49('0x2c'),_[_0x4f49('0x19')](_0x3ec6c4[_0x4f49('0x16')],_0x3ec6c4[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x4d2d57,null))[_0x4f49('0x1b')](handleError(_0x4d2d57,null));};exports[_0x4f49('0x2d')]=function(_0x25fdf8,_0x10bfc4){return respondWithRpcPromise(_0x4f49('0x2e'),_0x25fdf8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x10bfc4,null))[_0x4f49('0x1b')](handleError(_0x10bfc4,null));};exports[_0x4f49('0x2f')]=function(_0x4e3f72,_0x802f20){return respondWithRpcPromise(_0x4f49('0x30'),_0x4e3f72['query'])[_0x4f49('0xa')](respondWithResult(_0x802f20,null))[_0x4f49('0x1b')](handleError(_0x802f20,null));};exports['agents']=function(_0x29e762,_0x1dd1a6){var _0x2548ad;return respondWithRpcPromise(_0x4f49('0x31'),_0x29e762[_0x4f49('0x16')])[_0x4f49('0xa')](function(_0x29e910){_0x2548ad=_0x29e910;return respondWithRpcPromise('Agents',_0x29e762['query'],routingClient);})['then'](function(_0x15e4b3){return _[_0x4f49('0x19')]({},_0x15e4b3,_0x2548ad);})[_0x4f49('0xa')](respondWithResult(_0x1dd1a6,null))[_0x4f49('0x1b')](handleError(_0x1dd1a6,null));};exports[_0x4f49('0x32')]=function(_0x1ecf6c,_0x38aff8){if(_0x1ecf6c[_0x4f49('0x22')]&&_0x1ecf6c[_0x4f49('0x22')]['interaction']&&_0x1ecf6c['user']&&_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]){for(var _0x159642 in _0x1ecf6c['body'][_0x4f49('0x34')]){if(_0x1ecf6c['body']['interaction'][_0x4f49('0x35')](_0x159642)){db[_0x4f49('0x36')][_0x4f49('0x37')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'exitAt':null,'uniqueid':_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642]&&_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')]?{'$notIn':_0x1ecf6c[_0x4f49('0x22')]['interaction'][_0x159642]}:{'$ne':null}}})[_0x4f49('0xa')](function(_0x1e5f0b){var _0x33bb04=moment()[_0x4f49('0x3a')](_0x4f49('0x3b'));for(var _0x1c41e4=0x0,_0xe66867=_0x1e5f0b[_0x4f49('0x39')];_0x1c41e4<_0xe66867;_0x1c41e4+=0x1){_0x1e5f0b[_0x1c41e4][_0x4f49('0x3c')]({'exitAt':_0x33bb04});}});for(var _0x157a55=0x0;_0x157a55<_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')];_0x157a55+=0x1){db['MemberReport'][_0x4f49('0x3d')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'uniqueid':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x34')][_0x159642][_0x157a55],'exitAt':null},'defaults':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'interface':_[_0x4f49('0x12')](_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')])?util[_0x4f49('0x3a')](_0x4f49('0x3f'),_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]):_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')],'type':_0x4f49('0x38'),'enterAt':moment()[_0x4f49('0x3a')](_0x4f49('0x3b')),'role':_0x4f49('0x40'),'internal':_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x41')],'uniqueid':_0x1ecf6c['body']['interaction'][_0x159642][_0x157a55]}});}}}}return respondWithRpcPromise(_0x4f49('0x42'),{'id':_0x1ecf6c[_0x4f49('0x1a')]['id'],'capacity':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x43')]},routingClient)[_0x4f49('0xa')](respondWithResult(_0x38aff8,null))[_0x4f49('0x1b')](handleError(_0x38aff8,null));};exports[_0x4f49('0x44')]=function(_0x51c756,_0x6637f4){return respondWithRpcPromise('Telephones',_0x51c756[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x6637f4,null))[_0x4f49('0x1b')](handleError(_0x6637f4,null));};exports[_0x4f49('0x45')]=function(_0x586095,_0x342980){return respondWithRpcPromise('Trunks',_0x586095['query'])[_0x4f49('0xa')](respondWithResult(_0x342980,null))[_0x4f49('0x1b')](handleError(_0x342980,null));};exports[_0x4f49('0x46')]=function(_0x26ae33,_0x56375a){return respondWithRpcPromise('Campaigns',_0x26ae33[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x56375a,null))['catch'](handleError(_0x56375a,null));};exports[_0x4f49('0x47')]=function(_0x5b50bc,_0x5a929a){return respondWithRpcPromise(_0x4f49('0x48'),_0x5b50bc['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5a929a,null))['catch'](handleError(_0x5a929a,null));};exports[_0x4f49('0x49')]=function(_0x38a640,_0x2472c9){return respondWithRpcPromise(_0x4f49('0x48'),_0x38a640[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x38a640[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x2472c9,null))['catch'](handleError(_0x2472c9,null));};exports[_0x4f49('0x4a')]=function(_0x51f57e,_0x213608){return respondWithRpcPromise(_0x4f49('0x4b'),_0x51f57e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x213608,null))[_0x4f49('0x1b')](handleError(_0x213608,null));};exports[_0x4f49('0x4c')]=function(_0x553981,_0x426c50){return respondWithRpcPromise(_0x4f49('0x4b'),_0x553981['query'],routingClient)['then'](findById(_0x553981[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x426c50,null))[_0x4f49('0x1b')](handleError(_0x426c50,null));};exports[_0x4f49('0x4d')]=function(_0x19a788,_0x4af08d){return respondWithRpcPromise(_0x4f49('0x4e'),_0x19a788['query'],mailClient)[_0x4f49('0xa')](respondWithResult(_0x4af08d,null))[_0x4f49('0x1b')](handleError(_0x4af08d,null));};exports[_0x4f49('0x4f')]=function(_0x4aae7c,_0x1dade6){return respondWithRpcPromise(_0x4f49('0x50'),_0x4aae7c[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x1dade6,null))['catch'](handleError(_0x1dade6,null));};exports[_0x4f49('0x51')]=function(_0x269564,_0x5e6898){return respondWithRpcPromise(_0x4f49('0x50'),_0x269564[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x269564[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x5e6898,null))[_0x4f49('0x1b')](handleError(_0x5e6898,null));};exports[_0x4f49('0x52')]=function(_0x30fc21,_0x519721){return respondWithRpcPromise(_0x4f49('0x53'),_0x30fc21[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x519721,null))[_0x4f49('0x1b')](handleError(_0x519721,null));};exports[_0x4f49('0x54')]=function(_0x26b022,_0x335875){return respondWithRpcPromise('SmsQueues',_0x26b022[_0x4f49('0x16')],routingClient)['then'](findById(_0x26b022[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x335875,null))[_0x4f49('0x1b')](handleError(_0x335875,null));};exports[_0x4f49('0x55')]=function(_0xc7743e,_0x3f2f3f){return respondWithRpcPromise(_0x4f49('0x56'),_0xc7743e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x3f2f3f,null))[_0x4f49('0x1b')](handleError(_0x3f2f3f,null));};exports['showWhatsappQueues']=function(_0x2f9f2e,_0x141554){return respondWithRpcPromise(_0x4f49('0x56'),_0x2f9f2e[_0x4f49('0x16')],routingClient)['then'](findById(_0x2f9f2e['params']['id']))[_0x4f49('0xa')](respondWithResult(_0x141554,null))['catch'](handleError(_0x141554,null));};exports[_0x4f49('0x57')]=function(_0x287705,_0x43bdde){return respondWithRpcPromise(_0x4f49('0x58'),_0x287705[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x43bdde,null))[_0x4f49('0x1b')](handleError(_0x43bdde,null));};exports[_0x4f49('0x59')]=function(_0x3823f0,_0x3e9b47){return respondWithRpcPromise(_0x4f49('0x58'),_0x3823f0[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x3823f0[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x3e9b47,null))[_0x4f49('0x1b')](handleError(_0x3e9b47,null));};exports[_0x4f49('0x5a')]=function(_0x753863,_0x1f9161){return respondWithRpcPromise(_0x4f49('0x5b'),_0x753863[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f9161,null))[_0x4f49('0x1b')](handleError(_0x1f9161,null));};exports[_0x4f49('0x5c')]=function(_0x2d0990,_0x49a79d){return respondWithRpcPromise(_0x4f49('0x5d'),_0x2d0990['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x49a79d,null))[_0x4f49('0x1b')](handleError(_0x49a79d,null));};exports[_0x4f49('0x5e')]=function(_0x3c0f69,_0x26de18){return respondWithRpcPromise(_0x4f49('0x5f'),_0x3c0f69[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x26de18,null))[_0x4f49('0x1b')](handleError(_0x26de18,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4b6ef4,_0x539e21){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4b6ef4[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x539e21,null))[_0x4f49('0x1b')](handleError(_0x539e21,null));};exports[_0x4f49('0x60')]=function(_0x1fc88a,_0x5a8b1c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1fc88a[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](function(_0x4bdd1b){if(_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')]!==undefined){var _0x5c824f=_(_0x4bdd1b[_0x4f49('0x13')])['filter']([_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')],_0x1fc88a['params']['id']])[_0x4f49('0x62')](_0x4f49('0x63'))[_0x4f49('0x64')]()[_0x4f49('0x65')]();return _0x4bdd1b[_0x4f49('0x13')][_0x4f49('0x66')](function(_0x5f0dbf){return _0x5c824f[_0x4f49('0x67')](_0x5f0dbf['queue_id'])>-0x1;});}else{return _0x4bdd1b[_0x4f49('0x13')]['filter'](function(_0x50c06e){return _0x50c06e['queue_id']===parseInt(_0x1fc88a[_0x4f49('0x1a')]['id']);});}})[_0x4f49('0xa')](respondWithResult(_0x5a8b1c,null))[_0x4f49('0x1b')](handleError(_0x5a8b1c,null));};exports[_0x4f49('0x68')]=function(_0x47af99,_0x39024d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x47af99[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x39024d,null))[_0x4f49('0x1b')](handleError(_0x39024d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x4938a6,_0x329a49){return respondWithRpcPromise(_0x4f49('0x69'),_0x4938a6[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x329a49,null))[_0x4f49('0x1b')](handleError(_0x329a49,null));};exports[_0x4f49('0x6a')]=function(_0x5c33c9,_0x5d52ae){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5c33c9[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5d52ae,null))[_0x4f49('0x1b')](handleError(_0x5d52ae,null));};exports[_0x4f49('0x6b')]=function(_0x1643fc){return function(_0x517144,_0x15b7e4){var _0x1b922e,_0x29de92;var _0x58d07e=_[_0x4f49('0x6c')](_0x1643fc);var _0x34843a=_0x1643fc===_0x4f49('0x6d')?_0x4f49('0x6e'):'Account';return db[_0x58d07e+_0x4f49('0x6f')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x517144[_0x4f49('0x1a')]['id']}})[_0x4f49('0xa')](function(_0x389679){if(_['isNil'](_0x389679)){throw new Error(_0x58d07e+_0x4f49('0x71'));}_0x1b922e=_0x389679;return db[_0x58d07e+_0x4f49('0x72')]['findOne']({'where':{'id':_0x517144[_0x4f49('0x22')]['messageId']},'include':[{'model':db[_0x58d07e+_0x4f49('0x73')],'as':'Interaction'},{'model':db[_0x58d07e+_0x34843a],'as':_0x4f49('0x74')}]});})[_0x4f49('0xa')](function(_0x2ef19e){if(_[_0x4f49('0x12')](_0x2ef19e)){throw new Error(_0x58d07e+_0x4f49('0x75'));}_0x29de92=_0x2ef19e;return _0x2ef19e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4f49('0xa')](function(){var _0x1f3556={'uniqueid':_0x1643fc+'.'+_0x29de92['id']+'.'+_0x29de92[_0x4f49('0x73')]['id'],'FromUserId':_0x517144[_0x4f49('0x33')]['id'],'type':'queue'};_0x1f3556[_0x58d07e+_0x4f49('0x76')]=_0x29de92['id'];_0x1f3556[_0x58d07e+'InteractionId']=_0x29de92[_0x4f49('0x73')]['id'];_0x1f3556['From'+_0x58d07e+_0x34843a+'Id']=_0x29de92[_0x4f49('0x74')]['id'];_0x1f3556['To'+_0x58d07e+_0x4f49('0x77')]=_0x1b922e['id'];return db[_0x58d07e+_0x4f49('0x78')][_0x4f49('0x79')](_0x1f3556);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x1643fc,'interaction':_0x29de92[_0x4f49('0x73')],'message':_0x29de92,'account':_0x29de92[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4f49('0x7b'),'appdata':_0x1b922e[_0x4f49('0x11')]+','+(_0x29de92['Account'][_0x4f49('0x7c')]||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x15b7e4,null))[_0x4f49('0x1b')](handleError(_0x15b7e4,null));};};exports[_0x4f49('0x7e')]=function(_0x24b033,_0x55b28b){var _0x2ec42b,_0x20a0d4;if(_[_0x4f49('0x12')](_0x24b033[_0x4f49('0x22')]['channel'])){throw new Error(_0x4f49('0x7f'));}var _0x57567a=_0x24b033[_0x4f49('0x22')][_0x4f49('0x80')];var _0x5c5d2=_[_0x4f49('0x6c')](_0x57567a);var _0x4cfb48=_0x57567a===_0x4f49('0x6d')?_0x4f49('0x6e'):_0x4f49('0x74');return db[_0x4f49('0x81')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x24b033[_0x4f49('0x1a')]['id'],'role':_0x4f49('0x40')}})[_0x4f49('0xa')](function(_0x355787){if(_[_0x4f49('0x12')](_0x355787)){throw new Error(_0x4f49('0x82'));}_0x2ec42b=_0x355787;return db[_0x5c5d2+_0x4f49('0x72')][_0x4f49('0x70')]({'where':{'id':_0x24b033[_0x4f49('0x22')][_0x4f49('0x83')]},'include':[{'model':db[_0x5c5d2+_0x4f49('0x73')],'as':_0x4f49('0x73')},{'model':db[_0x5c5d2+_0x4cfb48],'as':_0x4f49('0x74')}]});})['then'](function(_0x1979ef){if(_[_0x4f49('0x12')](_0x1979ef)){throw new Error(_0x5c5d2+_0x4f49('0x75'));}_0x20a0d4=_0x1979ef;return _0x1979ef[_0x4f49('0x84')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x225e63={'uniqueid':_0x57567a+'.'+_0x20a0d4['id']+'.'+_0x20a0d4[_0x4f49('0x73')]['id'],'FromUserId':_0x24b033['user']['id'],'type':_0x4f49('0x7b'),'ToUserId':_0x2ec42b['id']};_0x225e63[_0x5c5d2+'MessageId']=_0x20a0d4['id'];_0x225e63[_0x5c5d2+_0x4f49('0x85')]=_0x20a0d4[_0x4f49('0x73')]['id'];_0x225e63[_0x4f49('0x86')+_0x5c5d2+_0x4cfb48+'Id']=_0x20a0d4[_0x4f49('0x74')]['id'];return db[_0x5c5d2+_0x4f49('0x78')][_0x4f49('0x79')](_0x225e63);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x57567a,'interaction':_0x20a0d4[_0x4f49('0x73')],'message':_0x20a0d4,'account':_0x20a0d4[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2ec42b['name']+','+(_0x20a0d4[_0x4f49('0x74')]['agentTransferTimeout']||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x55b28b,null))['catch'](handleError(_0x55b28b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 276f510..1c59f96 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 _0x6391=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','isAuthenticated','show','/:id/run','run','post','create','put','/:id','update','destroy'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0x6391,0x1e3));var _0x1639=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x6391[_0x4ac424];return _0xe1b890;};'use strict';var multer=require(_0x1639('0x0'));var util=require(_0x1639('0x1'));var path=require(_0x1639('0x2'));var timeout=require(_0x1639('0x3'));var express=require(_0x1639('0x4'));var router=express[_0x1639('0x5')]();var fs_extra=require(_0x1639('0x6'));var auth=require(_0x1639('0x7'));var interaction=require(_0x1639('0x8'));var config=require(_0x1639('0x9'));var controller=require(_0x1639('0xa'));router[_0x1639('0xb')]('/',auth['isAuthenticated'](),controller[_0x1639('0xc')]);router['get']('/:id',auth[_0x1639('0xd')](),controller[_0x1639('0xe')]);router[_0x1639('0xb')](_0x1639('0xf'),auth[_0x1639('0xd')](),controller[_0x1639('0x10')]);router[_0x1639('0x11')]('/',auth[_0x1639('0xd')](),controller[_0x1639('0x12')]);router[_0x1639('0x13')](_0x1639('0x14'),auth[_0x1639('0xd')](),controller[_0x1639('0x15')]);router['delete'](_0x1639('0x14'),auth['isAuthenticated'](),controller[_0x1639('0x16')]);module['exports']=router; \ No newline at end of file +var _0x05c2=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','put','update'];(function(_0x2cbd50,_0x5dada1){var _0x332da8=function(_0x4359dd){while(--_0x4359dd){_0x2cbd50['push'](_0x2cbd50['shift']());}};_0x332da8(++_0x5dada1);}(_0x05c2,0x121));var _0x205c=function(_0x72ded8,_0x37c5e8){_0x72ded8=_0x72ded8-0x0;var _0x4d2d4e=_0x05c2[_0x72ded8];return _0x4d2d4e;};'use strict';var multer=require(_0x205c('0x0'));var util=require('util');var path=require(_0x205c('0x1'));var timeout=require(_0x205c('0x2'));var express=require(_0x205c('0x3'));var router=express[_0x205c('0x4')]();var fs_extra=require(_0x205c('0x5'));var auth=require(_0x205c('0x6'));var interaction=require(_0x205c('0x7'));var config=require(_0x205c('0x8'));var controller=require(_0x205c('0x9'));router[_0x205c('0xa')]('/',auth[_0x205c('0xb')](),controller[_0x205c('0xc')]);router[_0x205c('0xa')](_0x205c('0xd'),auth[_0x205c('0xb')](),controller[_0x205c('0xe')]);router['get'](_0x205c('0xf'),auth['isAuthenticated'](),controller['run']);router[_0x205c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x205c('0x11')](_0x205c('0xd'),auth[_0x205c('0xb')](),controller[_0x205c('0x12')]);router[_0x205c('0x13')](_0x205c('0xd'),auth[_0x205c('0xb')](),controller[_0x205c('0x14')]);module[_0x205c('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 1d550d6..40d7b50 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 _0x43f2=['days','hours','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x55e159,_0x391722){var _0x2ca0fc=function(_0x3635b3){while(--_0x3635b3){_0x55e159['push'](_0x55e159['shift']());}};_0x2ca0fc(++_0x391722);}(_0x43f2,0xa0));var _0x243f=function(_0x39ee73,_0x5a2e30){_0x39ee73=_0x39ee73-0x0;var _0x2cc418=_0x43f2[_0x39ee73];return _0x2cc418;};'use strict';var Sequelize=require(_0x243f('0x0'));module[_0x243f('0x1')]={'name':{'type':Sequelize[_0x243f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x243f('0x2')]},'active':{'type':Sequelize[_0x243f('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x243f('0x4')},'startAt':{'type':Sequelize[_0x243f('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x243f('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x243f('0x7')](_0x243f('0x8'),_0x243f('0x9'),'months','weeks',_0x243f('0xa'),_0x243f('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x243f('0xa')},'output':{'type':Sequelize[_0x243f('0x7')](_0x243f('0xc'),'pdf',_0x243f('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x243f('0xe'),_0x243f('0xf')),'allowNull':![],'defaultValue':_0x243f('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x243f('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x56ab=['months','days','hours','csv','pdf','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters'];(function(_0x1bfae0,_0x5becff){var _0x3e837f=function(_0x5c3406){while(--_0x5c3406){_0x1bfae0['push'](_0x1bfae0['shift']());}};_0x3e837f(++_0x5becff);}(_0x56ab,0x108));var _0xb56a=function(_0x5b0a92,_0x33262f){_0x5b0a92=_0x5b0a92-0x0;var _0x22ec0b=_0x56ab[_0x5b0a92];return _0x22ec0b;};'use strict';var Sequelize=require(_0xb56a('0x0'));module['exports']={'name':{'type':Sequelize[_0xb56a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb56a('0x1')]},'active':{'type':Sequelize[_0xb56a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb56a('0x3')},'startAt':{'type':Sequelize[_0xb56a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb56a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb56a('0x5')](_0xb56a('0x6'),_0xb56a('0x7'),_0xb56a('0x8'),'weeks',_0xb56a('0x9'),_0xb56a('0xa'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb56a('0x5')](_0xb56a('0xb'),_0xb56a('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0xb56a('0xb')},'type':{'type':Sequelize[_0xb56a('0x5')](_0xb56a('0xd'),_0xb56a('0xe')),'allowNull':![],'defaultValue':_0xb56a('0xd')},'sendMail':{'type':Sequelize[_0xb56a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xb56a('0x1')]},'cc':{'type':Sequelize[_0xb56a('0xf')]},'bcc':{'type':Sequelize[_0xb56a('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6c0b2fa..b33e6b4 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 _0x5e66=['options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','UserProfileResource','then','end','sendStatus','error','name','send','index','map','Schedule','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e66,0xfd));var _0x65e6=function(_0x27ba25,_0x172a0b){_0x27ba25=_0x27ba25-0x0;var _0x33de82=_0x5e66[_0x27ba25];return _0x33de82;};'use strict';var emlformat=require(_0x65e6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x65e6('0x1'));var BPromise=require(_0x65e6('0x2'));var Mustache=require(_0x65e6('0x3'));var util=require(_0x65e6('0x4'));var path=require('path');var sox=require(_0x65e6('0x5'));var csv=require(_0x65e6('0x6'));var ejs=require(_0x65e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65e6('0x8'));var squel=require(_0x65e6('0x9'));var crypto=require(_0x65e6('0xa'));var jsforce=require(_0x65e6('0xb'));var deskjs=require(_0x65e6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x65e6('0xd'));var Papa=require('papaparse');var Redis=require(_0x65e6('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65e6('0xf'));var hardwareService=require(_0x65e6('0x10'));var logger=require('../../config/logger')(_0x65e6('0x11'));var utils=require('../../config/utils');var config=require(_0x65e6('0x12'));var licenseUtil=require(_0x65e6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xefc4b3,_0x1d87fc){_0x1d87fc=_0x1d87fc||0xcc;return function(_0x5182a7){if(_0x5182a7){return _0xefc4b3['sendStatus'](_0x1d87fc);}return _0xefc4b3[_0x65e6('0x14')](_0x1d87fc)['end']();};}function respondWithResult(_0x4796e3,_0x324112){_0x324112=_0x324112||0xc8;return function(_0x58713b){if(_0x58713b){return _0x4796e3[_0x65e6('0x14')](_0x324112)[_0x65e6('0x15')](_0x58713b);}};}function respondWithFilteredResult(_0x42a867,_0x220d8f){return function(_0x57933b){if(_0x57933b){var _0x350a43=typeof _0x220d8f[_0x65e6('0x16')]==='undefined'&&typeof _0x220d8f[_0x65e6('0x17')]===_0x65e6('0x18');var _0x198a90=_0x57933b[_0x65e6('0x19')];var _0x5c3cc1=_0x350a43?0x0:_0x220d8f['offset'];var _0x5b253d=_0x350a43?_0x57933b[_0x65e6('0x19')]:_0x220d8f['offset']+_0x220d8f[_0x65e6('0x17')];var _0x4c47f7;if(_0x5b253d>=_0x198a90){_0x5b253d=_0x198a90;_0x4c47f7=0xc8;}else{_0x4c47f7=0xce;}_0x42a867[_0x65e6('0x14')](_0x4c47f7);return _0x42a867[_0x65e6('0x1a')](_0x65e6('0x1b'),_0x5c3cc1+'-'+_0x5b253d+'/'+_0x198a90)[_0x65e6('0x15')](_0x57933b);}return null;};}function patchUpdates(_0xe5ceae){return function(_0x52c34f){try{jsonpatch[_0x65e6('0x1c')](_0x52c34f,_0xe5ceae,!![]);}catch(_0x4054aa){return BPromise['reject'](_0x4054aa);}return _0x52c34f[_0x65e6('0x1d')]();};}function saveUpdates(_0x12dc0b,_0x1fe767){return function(_0x420571){if(_0x420571){return _0x420571[_0x65e6('0x1e')](_0x12dc0b)['then'](function(_0x473634){return _0x473634;});}return null;};}function removeEntity(_0x2f1f6e,_0xc6a1f2){return function(_0x3da0a7){if(_0x3da0a7){return _0x3da0a7[_0x65e6('0x1f')]()['then'](function(){var _0x1a6b1a=_0x3da0a7['get']({'plain':!![]});var _0x185d01='Scheduler';return db[_0x65e6('0x20')]['destroy']({'where':{'type':_0x185d01,'resourceId':_0x1a6b1a['id']}})['then'](function(){return _0x3da0a7;});})[_0x65e6('0x21')](function(){_0x2f1f6e[_0x65e6('0x14')](0xcc)[_0x65e6('0x22')]();});}};}function handleEntityNotFound(_0x5c66db,_0x143160){return function(_0x4dea6f){if(!_0x4dea6f){_0x5c66db[_0x65e6('0x23')](0x194);}return _0x4dea6f;};}function handleError(_0x3ccdb8,_0x388346){_0x388346=_0x388346||0x1f4;return function(_0x2b4080){logger[_0x65e6('0x24')](_0x2b4080['stack']);if(_0x2b4080[_0x65e6('0x25')]){delete _0x2b4080[_0x65e6('0x25')];}_0x3ccdb8['status'](_0x388346)[_0x65e6('0x26')](_0x2b4080);};}exports[_0x65e6('0x27')]=function(_0x31f25a,_0x5df931){var _0x49cf23={},_0x326754={},_0x390fc6={'count':0x0,'rows':[]};var _0x924fe8=_[_0x65e6('0x28')](db[_0x65e6('0x29')][_0x65e6('0x2a')],function(_0x2ca047){return{'name':_0x2ca047[_0x65e6('0x2b')],'type':_0x2ca047['type']['key']};});_0x326754[_0x65e6('0x2c')]=_[_0x65e6('0x28')](_0x924fe8,_0x65e6('0x25'));_0x326754[_0x65e6('0x2d')]=_[_0x65e6('0x2e')](_0x31f25a[_0x65e6('0x2d')]);_0x326754['filters']=_['intersection'](_0x326754[_0x65e6('0x2c')],_0x326754['query']);_0x49cf23[_0x65e6('0x2f')]=_[_0x65e6('0x30')](_0x326754[_0x65e6('0x2c')],qs[_0x65e6('0x31')](_0x31f25a[_0x65e6('0x2d')][_0x65e6('0x31')]));_0x49cf23[_0x65e6('0x2f')]=_0x49cf23[_0x65e6('0x2f')][_0x65e6('0x32')]?_0x49cf23[_0x65e6('0x2f')]:_0x326754[_0x65e6('0x2c')];if(!_0x31f25a[_0x65e6('0x2d')][_0x65e6('0x33')](_0x65e6('0x34'))){_0x49cf23[_0x65e6('0x17')]=qs[_0x65e6('0x17')](_0x31f25a[_0x65e6('0x2d')][_0x65e6('0x17')]);_0x49cf23[_0x65e6('0x16')]=qs[_0x65e6('0x16')](_0x31f25a[_0x65e6('0x2d')]['offset']);}_0x49cf23[_0x65e6('0x35')]=qs[_0x65e6('0x36')](_0x31f25a['query'][_0x65e6('0x36')]);_0x49cf23[_0x65e6('0x37')]=qs[_0x65e6('0x38')](_[_0x65e6('0x39')](_0x31f25a[_0x65e6('0x2d')],_0x326754[_0x65e6('0x38')]),_0x924fe8);if(_0x31f25a[_0x65e6('0x2d')][_0x65e6('0x3a')]){_0x49cf23[_0x65e6('0x37')]=_[_0x65e6('0x3b')](_0x49cf23['where'],{'$or':_[_0x65e6('0x28')](_0x924fe8,function(_0x52d1ac){if(_0x52d1ac['type']!=='VIRTUAL'){var _0x330c6d={};_0x330c6d[_0x52d1ac[_0x65e6('0x25')]]={'$like':'%'+_0x31f25a[_0x65e6('0x2d')][_0x65e6('0x3a')]+'%'};return _0x330c6d;}})});}_0x49cf23=_['merge']({},_0x49cf23,_0x31f25a['options']);var _0x5b3ec8={'where':_0x49cf23[_0x65e6('0x37')]};return db[_0x65e6('0x29')][_0x65e6('0x19')](_0x5b3ec8)[_0x65e6('0x21')](function(_0xbe0372){_0x390fc6[_0x65e6('0x19')]=_0xbe0372;if(_0x31f25a[_0x65e6('0x2d')]['includeAll']){_0x49cf23[_0x65e6('0x3c')]=[{'all':!![]}];}return db[_0x65e6('0x29')][_0x65e6('0x3d')](_0x49cf23);})[_0x65e6('0x21')](function(_0x12e0c0){_0x390fc6[_0x65e6('0x3e')]=_0x12e0c0;return _0x390fc6;})['then'](respondWithFilteredResult(_0x5df931,_0x49cf23))[_0x65e6('0x3f')](handleError(_0x5df931,null));};exports[_0x65e6('0x40')]=function(_0x328ae1,_0x4196f1){var _0x404de2={'raw':![],'where':{'id':_0x328ae1[_0x65e6('0x41')]['id']}},_0x440734={};_0x440734['model']=_[_0x65e6('0x2e')](db[_0x65e6('0x29')][_0x65e6('0x2a')]);_0x440734[_0x65e6('0x2d')]=_[_0x65e6('0x2e')](_0x328ae1[_0x65e6('0x2d')]);_0x440734['filters']=_[_0x65e6('0x30')](_0x440734['model'],_0x440734['query']);_0x404de2['attributes']=_[_0x65e6('0x30')](_0x440734[_0x65e6('0x2c')],qs[_0x65e6('0x31')](_0x328ae1[_0x65e6('0x2d')][_0x65e6('0x31')]));_0x404de2[_0x65e6('0x2f')]=_0x404de2['attributes'][_0x65e6('0x32')]?_0x404de2[_0x65e6('0x2f')]:_0x440734[_0x65e6('0x2c')];if(_0x328ae1[_0x65e6('0x2d')][_0x65e6('0x42')]){_0x404de2['include']=[{'all':!![]}];}_0x404de2=_[_0x65e6('0x3b')]({},_0x404de2,_0x328ae1[_0x65e6('0x43')]);return db['Schedule'][_0x65e6('0x44')](_0x404de2)[_0x65e6('0x21')](handleEntityNotFound(_0x4196f1,null))['then'](respondWithResult(_0x4196f1,null))[_0x65e6('0x3f')](handleError(_0x4196f1,null));};exports['create']=function(_0x2c3456,_0x2500de){return db[_0x65e6('0x29')][_0x65e6('0x45')](_0x2c3456[_0x65e6('0x46')],{})[_0x65e6('0x21')](function(_0x34f74b){var _0x1c1522=_0x2c3456[_0x65e6('0x47')]['get']({'plain':!![]});if(!_0x1c1522)throw new Error(_0x65e6('0x48'));if(_0x1c1522['role']===_0x65e6('0x47')){var _0x3bb785=_0x34f74b[_0x65e6('0x49')]({'plain':!![]});var _0x3f1bf3='Scheduler';return db[_0x65e6('0x4a')]['find']({'where':{'name':_0x3f1bf3,'userProfileId':_0x1c1522[_0x65e6('0x4b')]},'raw':!![]})['then'](function(_0xf1454f){if(_0xf1454f&&_0xf1454f[_0x65e6('0x4c')]===0x0){return db[_0x65e6('0x20')][_0x65e6('0x45')]({'name':_0x3bb785[_0x65e6('0x25')],'resourceId':_0x3bb785['id'],'type':_0xf1454f[_0x65e6('0x25')],'sectionId':_0xf1454f['id']},{})[_0x65e6('0x21')](function(){return _0x34f74b;});}else{return _0x34f74b;}})[_0x65e6('0x3f')](function(_0x2f3f60){logger[_0x65e6('0x24')](_0x65e6('0x4d'),_0x2f3f60);throw _0x2f3f60;});}return _0x34f74b;})['then'](respondWithResult(_0x2500de,0xc9))[_0x65e6('0x3f')](handleError(_0x2500de,null));};exports[_0x65e6('0x1e')]=function(_0x2ca1c4,_0x284579){if(_0x2ca1c4[_0x65e6('0x46')]['id']){delete _0x2ca1c4[_0x65e6('0x46')]['id'];}return db['Schedule']['find']({'where':{'id':_0x2ca1c4['params']['id']}})[_0x65e6('0x21')](handleEntityNotFound(_0x284579,null))[_0x65e6('0x21')](saveUpdates(_0x2ca1c4['body'],null))[_0x65e6('0x21')](respondWithResult(_0x284579,null))[_0x65e6('0x3f')](handleError(_0x284579,null));};exports[_0x65e6('0x1f')]=function(_0x2efde1,_0x532628){return db[_0x65e6('0x29')][_0x65e6('0x44')]({'where':{'id':_0x2efde1[_0x65e6('0x41')]['id']}})[_0x65e6('0x21')](handleEntityNotFound(_0x532628,null))[_0x65e6('0x21')](removeEntity(_0x532628,null))[_0x65e6('0x3f')](handleError(_0x532628,null));};exports[_0x65e6('0x4e')]=function(_0x1b4d7b,_0x3a38a0,_0x281517){var _0x33a36e=require(_0x65e6('0x4f'));return db[_0x65e6('0x29')][_0x65e6('0x44')]({'where':{'id':_0x1b4d7b[_0x65e6('0x41')]['id']},'raw':!![]})[_0x65e6('0x21')](handleEntityNotFound(_0x3a38a0,null))[_0x65e6('0x21')](function(){_0x33a36e[_0x65e6('0x4e')](_0x1b4d7b[_0x65e6('0x41')]['id']);})[_0x65e6('0x21')](respondWithStatusCode(_0x3a38a0,null))['catch'](handleError(_0x3a38a0,null));}; \ No newline at end of file +var _0xaa02=['end','offset','limit','undefined','count','status','Content-Range','json','reject','save','update','then','destroy','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','length','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xaa02,0x1ea));var _0x2aa0=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xaa02[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x2aa0('0x0'));var rimraf=require(_0x2aa0('0x1'));var zipdir=require(_0x2aa0('0x2'));var jsonpatch=require(_0x2aa0('0x3'));var rp=require(_0x2aa0('0x4'));var moment=require('moment');var BPromise=require(_0x2aa0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2aa0('0x6'));var sox=require(_0x2aa0('0x7'));var csv=require(_0x2aa0('0x8'));var ejs=require(_0x2aa0('0x9'));var fs=require('fs');var fs_extra=require(_0x2aa0('0xa'));var _=require(_0x2aa0('0xb'));var squel=require(_0x2aa0('0xc'));var crypto=require(_0x2aa0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2aa0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2aa0('0xf'));var Papa=require(_0x2aa0('0x10'));var Redis=require(_0x2aa0('0x11'));var authService=require(_0x2aa0('0x12'));var qs=require(_0x2aa0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2aa0('0x14'))(_0x2aa0('0x15'));var utils=require(_0x2aa0('0x16'));var config=require(_0x2aa0('0x17'));var licenseUtil=require(_0x2aa0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c949,_0x373631){_0x373631=_0x373631||0xcc;return function(_0x56ac9b){if(_0x56ac9b){return _0x3c949[_0x2aa0('0x19')](_0x373631);}return _0x3c949['status'](_0x373631)[_0x2aa0('0x1a')]();};}function respondWithResult(_0x4ad752,_0x29fa30){_0x29fa30=_0x29fa30||0xc8;return function(_0x275622){if(_0x275622){return _0x4ad752['status'](_0x29fa30)['json'](_0x275622);}};}function respondWithFilteredResult(_0x11f1d9,_0x175678){return function(_0x142439){if(_0x142439){var _0x29a1a4=typeof _0x175678[_0x2aa0('0x1b')]==='undefined'&&typeof _0x175678[_0x2aa0('0x1c')]===_0x2aa0('0x1d');var _0x60b49c=_0x142439[_0x2aa0('0x1e')];var _0x1fcbd0=_0x29a1a4?0x0:_0x175678[_0x2aa0('0x1b')];var _0x48cf29=_0x29a1a4?_0x142439['count']:_0x175678[_0x2aa0('0x1b')]+_0x175678['limit'];var _0x4dbd4f;if(_0x48cf29>=_0x60b49c){_0x48cf29=_0x60b49c;_0x4dbd4f=0xc8;}else{_0x4dbd4f=0xce;}_0x11f1d9[_0x2aa0('0x1f')](_0x4dbd4f);return _0x11f1d9['set'](_0x2aa0('0x20'),_0x1fcbd0+'-'+_0x48cf29+'/'+_0x60b49c)[_0x2aa0('0x21')](_0x142439);}return null;};}function patchUpdates(_0x12a019){return function(_0x186ac0){try{jsonpatch['apply'](_0x186ac0,_0x12a019,!![]);}catch(_0x5cba51){return BPromise[_0x2aa0('0x22')](_0x5cba51);}return _0x186ac0[_0x2aa0('0x23')]();};}function saveUpdates(_0x26e80b,_0x406040){return function(_0x4035f8){if(_0x4035f8){return _0x4035f8[_0x2aa0('0x24')](_0x26e80b)[_0x2aa0('0x25')](function(_0x3b58a8){return _0x3b58a8;});}return null;};}function removeEntity(_0x47e826,_0x2fa0d6){return function(_0x3b5d8c){if(_0x3b5d8c){return _0x3b5d8c[_0x2aa0('0x26')]()[_0x2aa0('0x25')](function(){var _0x4a0d8d=_0x3b5d8c['get']({'plain':!![]});var _0x19d6ae=_0x2aa0('0x27');return db[_0x2aa0('0x28')][_0x2aa0('0x26')]({'where':{'type':_0x19d6ae,'resourceId':_0x4a0d8d['id']}})[_0x2aa0('0x25')](function(){return _0x3b5d8c;});})[_0x2aa0('0x25')](function(){_0x47e826[_0x2aa0('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf2a7be,_0x438fb9){return function(_0x57ddee){if(!_0x57ddee){_0xf2a7be[_0x2aa0('0x19')](0x194);}return _0x57ddee;};}function handleError(_0x493b38,_0x1a2fc2){_0x1a2fc2=_0x1a2fc2||0x1f4;return function(_0x4f62e9){logger[_0x2aa0('0x29')](_0x4f62e9[_0x2aa0('0x2a')]);if(_0x4f62e9[_0x2aa0('0x2b')]){delete _0x4f62e9[_0x2aa0('0x2b')];}_0x493b38['status'](_0x1a2fc2)[_0x2aa0('0x2c')](_0x4f62e9);};}exports['index']=function(_0x31b57c,_0x1b39c0){var _0x5cb56a={},_0x42120d={},_0x5f0b41={'count':0x0,'rows':[]};var _0x230c1f=_[_0x2aa0('0x2d')](db[_0x2aa0('0x2e')][_0x2aa0('0x2f')],function(_0x3562d8){return{'name':_0x3562d8[_0x2aa0('0x30')],'type':_0x3562d8[_0x2aa0('0x31')]['key']};});_0x42120d[_0x2aa0('0x32')]=_['map'](_0x230c1f,_0x2aa0('0x2b'));_0x42120d[_0x2aa0('0x33')]=_['keys'](_0x31b57c[_0x2aa0('0x33')]);_0x42120d[_0x2aa0('0x34')]=_[_0x2aa0('0x35')](_0x42120d[_0x2aa0('0x32')],_0x42120d[_0x2aa0('0x33')]);_0x5cb56a[_0x2aa0('0x36')]=_[_0x2aa0('0x35')](_0x42120d[_0x2aa0('0x32')],qs[_0x2aa0('0x37')](_0x31b57c['query']['fields']));_0x5cb56a[_0x2aa0('0x36')]=_0x5cb56a[_0x2aa0('0x36')]['length']?_0x5cb56a[_0x2aa0('0x36')]:_0x42120d[_0x2aa0('0x32')];if(!_0x31b57c[_0x2aa0('0x33')][_0x2aa0('0x38')]('nolimit')){_0x5cb56a['limit']=qs[_0x2aa0('0x1c')](_0x31b57c[_0x2aa0('0x33')][_0x2aa0('0x1c')]);_0x5cb56a[_0x2aa0('0x1b')]=qs[_0x2aa0('0x1b')](_0x31b57c['query'][_0x2aa0('0x1b')]);}_0x5cb56a[_0x2aa0('0x39')]=qs[_0x2aa0('0x3a')](_0x31b57c[_0x2aa0('0x33')][_0x2aa0('0x3a')]);_0x5cb56a[_0x2aa0('0x3b')]=qs['filters'](_[_0x2aa0('0x3c')](_0x31b57c[_0x2aa0('0x33')],_0x42120d[_0x2aa0('0x34')]),_0x230c1f);if(_0x31b57c[_0x2aa0('0x33')][_0x2aa0('0x3d')]){_0x5cb56a[_0x2aa0('0x3b')]=_[_0x2aa0('0x3e')](_0x5cb56a['where'],{'$or':_[_0x2aa0('0x2d')](_0x230c1f,function(_0x3c66a8){if(_0x3c66a8[_0x2aa0('0x31')]!==_0x2aa0('0x3f')){var _0x22e53e={};_0x22e53e[_0x3c66a8[_0x2aa0('0x2b')]]={'$like':'%'+_0x31b57c[_0x2aa0('0x33')][_0x2aa0('0x3d')]+'%'};return _0x22e53e;}})});}_0x5cb56a=_['merge']({},_0x5cb56a,_0x31b57c['options']);var _0x4bde70={'where':_0x5cb56a[_0x2aa0('0x3b')]};return db[_0x2aa0('0x2e')][_0x2aa0('0x1e')](_0x4bde70)[_0x2aa0('0x25')](function(_0x429b93){_0x5f0b41['count']=_0x429b93;if(_0x31b57c[_0x2aa0('0x33')][_0x2aa0('0x40')]){_0x5cb56a[_0x2aa0('0x41')]=[{'all':!![]}];}return db[_0x2aa0('0x2e')]['findAll'](_0x5cb56a);})['then'](function(_0x3f6f7e){_0x5f0b41[_0x2aa0('0x42')]=_0x3f6f7e;return _0x5f0b41;})[_0x2aa0('0x25')](respondWithFilteredResult(_0x1b39c0,_0x5cb56a))[_0x2aa0('0x43')](handleError(_0x1b39c0,null));};exports[_0x2aa0('0x44')]=function(_0x184d87,_0x5ae3b4){var _0x399a86={'raw':![],'where':{'id':_0x184d87['params']['id']}},_0x5e3a20={};_0x5e3a20[_0x2aa0('0x32')]=_[_0x2aa0('0x45')](db[_0x2aa0('0x2e')][_0x2aa0('0x2f')]);_0x5e3a20[_0x2aa0('0x33')]=_[_0x2aa0('0x45')](_0x184d87[_0x2aa0('0x33')]);_0x5e3a20[_0x2aa0('0x34')]=_[_0x2aa0('0x35')](_0x5e3a20[_0x2aa0('0x32')],_0x5e3a20['query']);_0x399a86[_0x2aa0('0x36')]=_[_0x2aa0('0x35')](_0x5e3a20[_0x2aa0('0x32')],qs[_0x2aa0('0x37')](_0x184d87[_0x2aa0('0x33')][_0x2aa0('0x37')]));_0x399a86['attributes']=_0x399a86[_0x2aa0('0x36')][_0x2aa0('0x46')]?_0x399a86[_0x2aa0('0x36')]:_0x5e3a20[_0x2aa0('0x32')];if(_0x184d87['query'][_0x2aa0('0x40')]){_0x399a86[_0x2aa0('0x41')]=[{'all':!![]}];}_0x399a86=_[_0x2aa0('0x3e')]({},_0x399a86,_0x184d87[_0x2aa0('0x47')]);return db[_0x2aa0('0x2e')]['find'](_0x399a86)[_0x2aa0('0x25')](handleEntityNotFound(_0x5ae3b4,null))[_0x2aa0('0x25')](respondWithResult(_0x5ae3b4,null))[_0x2aa0('0x43')](handleError(_0x5ae3b4,null));};exports[_0x2aa0('0x48')]=function(_0x539455,_0x37156c){return db[_0x2aa0('0x2e')][_0x2aa0('0x48')](_0x539455['body'],{})[_0x2aa0('0x25')](function(_0x408f23){var _0x1fce7d=_0x539455['user'][_0x2aa0('0x49')]({'plain':!![]});if(!_0x1fce7d)throw new Error(_0x2aa0('0x4a'));if(_0x1fce7d[_0x2aa0('0x4b')]===_0x2aa0('0x4c')){var _0x366f44=_0x408f23[_0x2aa0('0x49')]({'plain':!![]});var _0x10253e=_0x2aa0('0x27');return db[_0x2aa0('0x4d')][_0x2aa0('0x4e')]({'where':{'name':_0x10253e,'userProfileId':_0x1fce7d[_0x2aa0('0x4f')]},'raw':!![]})[_0x2aa0('0x25')](function(_0x21da35){if(_0x21da35&&_0x21da35[_0x2aa0('0x50')]===0x0){return db['UserProfileResource'][_0x2aa0('0x48')]({'name':_0x366f44[_0x2aa0('0x2b')],'resourceId':_0x366f44['id'],'type':_0x21da35[_0x2aa0('0x2b')],'sectionId':_0x21da35['id']},{})[_0x2aa0('0x25')](function(){return _0x408f23;});}else{return _0x408f23;}})[_0x2aa0('0x43')](function(_0xa42db2){logger[_0x2aa0('0x29')](_0x2aa0('0x51'),_0xa42db2);throw _0xa42db2;});}return _0x408f23;})[_0x2aa0('0x25')](respondWithResult(_0x37156c,0xc9))[_0x2aa0('0x43')](handleError(_0x37156c,null));};exports['update']=function(_0x368843,_0x2c2660){if(_0x368843[_0x2aa0('0x52')]['id']){delete _0x368843['body']['id'];}return db[_0x2aa0('0x2e')]['find']({'where':{'id':_0x368843['params']['id']}})['then'](handleEntityNotFound(_0x2c2660,null))[_0x2aa0('0x25')](saveUpdates(_0x368843['body'],null))[_0x2aa0('0x25')](respondWithResult(_0x2c2660,null))[_0x2aa0('0x43')](handleError(_0x2c2660,null));};exports[_0x2aa0('0x26')]=function(_0x58c124,_0x5b4398){return db[_0x2aa0('0x2e')][_0x2aa0('0x4e')]({'where':{'id':_0x58c124[_0x2aa0('0x53')]['id']}})[_0x2aa0('0x25')](handleEntityNotFound(_0x5b4398,null))[_0x2aa0('0x25')](removeEntity(_0x5b4398,null))[_0x2aa0('0x43')](handleError(_0x5b4398,null));};exports[_0x2aa0('0x54')]=function(_0x53441b,_0x26591c,_0x572e3c){var _0x59437a=require(_0x2aa0('0x55'));return db[_0x2aa0('0x2e')][_0x2aa0('0x4e')]({'where':{'id':_0x53441b[_0x2aa0('0x53')]['id']},'raw':!![]})[_0x2aa0('0x25')](handleEntityNotFound(_0x26591c,null))[_0x2aa0('0x25')](function(){_0x59437a[_0x2aa0('0x54')](_0x53441b[_0x2aa0('0x53')]['id']);})[_0x2aa0('0x25')](respondWithStatusCode(_0x26591c,null))['catch'](handleError(_0x26591c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index e4e977f..f6f7f45 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 _0x1c5d=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','lodash'];(function(_0x4baa2b,_0x518bb6){var _0x3b6cd0=function(_0x254e78){while(--_0x254e78){_0x4baa2b['push'](_0x4baa2b['shift']());}};_0x3b6cd0(++_0x518bb6);}(_0x1c5d,0x17f));var _0xd1c5=function(_0x21ed7d,_0x50e3ee){_0x21ed7d=_0x21ed7d-0x0;var _0x5392a0=_0x1c5d[_0x21ed7d];return _0x5392a0;};'use strict';var _=require(_0xd1c5('0x0'));var util=require(_0xd1c5('0x1'));var logger=require(_0xd1c5('0x2'))(_0xd1c5('0x3'));var moment=require('moment');var BPromise=require(_0xd1c5('0x4'));var rp=require(_0xd1c5('0x5'));var fs=require('fs');var path=require(_0xd1c5('0x6'));var rimraf=require(_0xd1c5('0x7'));var config=require(_0xd1c5('0x8'));var attributes=require(_0xd1c5('0x9'));module[_0xd1c5('0xa')]=function(_0x383ed4,_0x63b2f2){return _0x383ed4['define'](_0xd1c5('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f2=['tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./schedule.attributes','define','Schedule'];(function(_0x304fbd,_0x401f58){var _0x3a4448=function(_0x261bc9){while(--_0x261bc9){_0x304fbd['push'](_0x304fbd['shift']());}};_0x3a4448(++_0x401f58);}(_0xf0f2,0x7a));var _0x2f0f=function(_0x212a17,_0x1749f6){_0x212a17=_0x212a17-0x0;var _0x578aa4=_0xf0f2[_0x212a17];return _0x578aa4;};'use strict';var _=require(_0x2f0f('0x0'));var util=require(_0x2f0f('0x1'));var logger=require(_0x2f0f('0x2'))(_0x2f0f('0x3'));var moment=require(_0x2f0f('0x4'));var BPromise=require(_0x2f0f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2f0f('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f0f('0x7'));module['exports']=function(_0x278efc,_0x7c57c2){return _0x278efc[_0x2f0f('0x8')](_0x2f0f('0x9'),attributes,{'tableName':_0x2f0f('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 9802b41..c0e9d69 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 _0xdc94=['message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','Schedule,\x20%s,\x20%s'];(function(_0x55a629,_0x212491){var _0x67f2c2=function(_0x521661){while(--_0x521661){_0x55a629['push'](_0x55a629['shift']());}};_0x67f2c2(++_0x212491);}(_0xdc94,0x81));var _0x4dc9=function(_0x481a63,_0x119ad4){_0x481a63=_0x481a63-0x0;var _0x3d3d34=_0xdc94[_0x481a63];return _0x3d3d34;};'use strict';var _=require(_0x4dc9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4dc9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4dc9('0x2'));var db=require(_0x4dc9('0x3'))['db'];var utils=require(_0x4dc9('0x4'));var logger=require(_0x4dc9('0x5'))(_0x4dc9('0x6'));var config=require(_0x4dc9('0x7'));var jayson=require(_0x4dc9('0x8'));var client=jayson[_0x4dc9('0x9')][_0x4dc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x236b6f,_0x1c3791,_0x16eb70){return new BPromise(function(_0x39d9d4,_0x111134){return client[_0x4dc9('0xb')](_0x236b6f,_0x16eb70)[_0x4dc9('0xc')](function(_0x128124){logger['info']('Schedule,\x20%s,\x20%s',_0x1c3791,_0x4dc9('0xd'));logger[_0x4dc9('0xe')](_0x4dc9('0xf'),_0x1c3791,_0x4dc9('0xd'),JSON['stringify'](_0x128124));if(_0x128124[_0x4dc9('0x10')]){if(_0x128124[_0x4dc9('0x10')]['code']===0x1f4){logger[_0x4dc9('0x10')](_0x4dc9('0x11'),_0x1c3791,_0x128124[_0x4dc9('0x10')][_0x4dc9('0x12')]);return _0x111134(_0x128124[_0x4dc9('0x10')][_0x4dc9('0x12')]);}logger[_0x4dc9('0x10')](_0x4dc9('0x11'),_0x1c3791,_0x128124['error']['message']);return _0x39d9d4(_0x128124[_0x4dc9('0x10')][_0x4dc9('0x12')]);}else{logger[_0x4dc9('0x13')](_0x4dc9('0x11'),_0x1c3791,_0x4dc9('0xd'));_0x39d9d4(_0x128124['result'][_0x4dc9('0x12')]);}})[_0x4dc9('0x14')](function(_0x1b3c09){logger[_0x4dc9('0x10')]('Schedule,\x20%s,\x20%s',_0x1c3791,_0x1b3c09);_0x111134(_0x1b3c09);});});} \ No newline at end of file +var _0xcae6=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x48ccc4,_0x4045e4){var _0x49d8bd=function(_0x25fc2b){while(--_0x25fc2b){_0x48ccc4['push'](_0x48ccc4['shift']());}};_0x49d8bd(++_0x4045e4);}(_0xcae6,0xc6));var _0x6cae=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xcae6[_0x1bc0ae];return _0x501104;};'use strict';var _=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var moment=require('moment');var BPromise=require(_0x6cae('0x2'));var rs=require(_0x6cae('0x3'));var fs=require('fs');var Redis=require(_0x6cae('0x4'));var db=require(_0x6cae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cae('0x6'))(_0x6cae('0x7'));var config=require(_0x6cae('0x8'));var jayson=require(_0x6cae('0x9'));var client=jayson[_0x6cae('0xa')][_0x6cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x429ea9,_0x277a53,_0x3e1dc1){return new BPromise(function(_0x14a594,_0x49a9bf){return client['request'](_0x429ea9,_0x3e1dc1)[_0x6cae('0xc')](function(_0x338964){logger['info'](_0x6cae('0xd'),_0x277a53,'request\x20sent');logger[_0x6cae('0xe')](_0x6cae('0xf'),_0x277a53,_0x6cae('0x10'),JSON[_0x6cae('0x11')](_0x338964));if(_0x338964[_0x6cae('0x12')]){if(_0x338964[_0x6cae('0x12')]['code']===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x277a53,_0x338964[_0x6cae('0x12')][_0x6cae('0x13')]);return _0x49a9bf(_0x338964[_0x6cae('0x12')][_0x6cae('0x13')]);}logger[_0x6cae('0x12')](_0x6cae('0xd'),_0x277a53,_0x338964[_0x6cae('0x12')][_0x6cae('0x13')]);return _0x14a594(_0x338964['error'][_0x6cae('0x13')]);}else{logger[_0x6cae('0x14')](_0x6cae('0xd'),_0x277a53,_0x6cae('0x10'));_0x14a594(_0x338964[_0x6cae('0x15')][_0x6cae('0x13')]);}})['catch'](function(_0x49dc18){logger[_0x6cae('0x12')](_0x6cae('0xd'),_0x277a53,_0x49dc18);_0x49a9bf(_0x49dc18);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 876afaf..9e936c2 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 _0xc423=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','put','update','delete','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xc423,0x159));var _0x3c42=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc423[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x3c42('0x0'));var util=require(_0x3c42('0x1'));var path=require(_0x3c42('0x2'));var timeout=require(_0x3c42('0x3'));var express=require(_0x3c42('0x4'));var router=express['Router']();var fs_extra=require(_0x3c42('0x5'));var auth=require(_0x3c42('0x6'));var interaction=require(_0x3c42('0x7'));var config=require('../../config/environment');var controller=require(_0x3c42('0x8'));router[_0x3c42('0x9')]('/',auth[_0x3c42('0xa')](),controller[_0x3c42('0xb')]);router[_0x3c42('0x9')](_0x3c42('0xc'),auth[_0x3c42('0xa')](),controller[_0x3c42('0xd')]);router['get'](_0x3c42('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3c42('0x9')](_0x3c42('0xf'),auth[_0x3c42('0xa')](),controller[_0x3c42('0x10')]);router[_0x3c42('0x11')]('/',auth[_0x3c42('0xa')](),controller[_0x3c42('0x12')]);router[_0x3c42('0x13')]('/:id',auth[_0x3c42('0xa')](),controller[_0x3c42('0x14')]);router[_0x3c42('0x15')](_0x3c42('0xe'),auth[_0x3c42('0xa')](),controller['destroy']);module[_0x3c42('0x16')]=router; \ No newline at end of file +var _0x7463=['download','post','create','put','/:id','update','destroy','util','path','connect-timeout','Router','fs-extra','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/download'];(function(_0x387725,_0xa2a5a){var _0x48a143=function(_0x12f5be){while(--_0x12f5be){_0x387725['push'](_0x387725['shift']());}};_0x48a143(++_0xa2a5a);}(_0x7463,0x147));var _0x3746=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x7463[_0x2984d0];return _0x2885f2;};'use strict';var multer=require('multer');var util=require(_0x3746('0x0'));var path=require(_0x3746('0x1'));var timeout=require(_0x3746('0x2'));var express=require('express');var router=express[_0x3746('0x3')]();var fs_extra=require(_0x3746('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3746('0x5'));var controller=require(_0x3746('0x6'));router[_0x3746('0x7')]('/',auth[_0x3746('0x8')](),controller['index']);router['get'](_0x3746('0x9'),auth[_0x3746('0x8')](),controller[_0x3746('0xa')]);router['get']('/:id',auth[_0x3746('0x8')](),controller[_0x3746('0xb')]);router['get'](_0x3746('0xc'),auth[_0x3746('0x8')](),controller[_0x3746('0xd')]);router[_0x3746('0xe')]('/',auth[_0x3746('0x8')](),controller[_0x3746('0xf')]);router[_0x3746('0x10')](_0x3746('0x11'),auth[_0x3746('0x8')](),controller[_0x3746('0x12')]);router['delete'](_0x3746('0x11'),auth[_0x3746('0x8')](),controller[_0x3746('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 23675d0..0d4e45b 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 _0x731b=['subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0x731b,0xf7));var _0xb731=function(_0x103aad,_0x8cd043){_0x103aad=_0x103aad-0x0;var _0x3371cb=_0x731b[_0x103aad];return _0x3371cb;};'use strict';var Sequelize=require(_0xb731('0x0'));var moment=require(_0xb731('0x1'));var path=require('path');var config=require(_0xb731('0x2'));module[_0xb731('0x3')]={'format':{'type':Sequelize[_0xb731('0x4')],'get':function(){return this[_0xb731('0x5')](_0xb731('0x6'))?path[_0xb731('0x7')](this['getDataValue'](_0xb731('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb731('0x8')]},'channel':{'type':Sequelize[_0xb731('0x8')]},'value':{'type':Sequelize[_0xb731('0x8')],'set':function(_0x12c59b){var _0x2b475d=_0x12c59b[_0xb731('0x9')](/\\/g,'/');this['setDataValue'](_0xb731('0x6'),_0x2b475d);}},'rating':{'type':Sequelize[_0xb731('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb731('0xa')],'set':function(_0x26488c){this[_0xb731('0xb')](_0xb731('0xc'),moment()[_0xb731('0xd')](_0x26488c,'ms'));this[_0xb731('0xb')](_0xb731('0xe'),moment());this[_0xb731('0xb')](_0xb731('0xf'),_0x26488c);}},'startedAt':{'type':Sequelize[_0xb731('0x10')],'get':function(){return moment(this[_0xb731('0x5')](_0xb731('0xc')))[_0xb731('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xb731('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb731('0x5')](_0xb731('0xe')))[_0xb731('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xb731('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xb731('0x11')](_0xb731('0x13'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb731('0x10')],'get':function(){return moment(this[_0xb731('0x5')]('updatedAt'))[_0xb731('0x11')](_0xb731('0x13'))[_0xb731('0x12')]();}}}; \ No newline at end of file +var _0xb6fa=['DATE','updatedAt','sequelize','../../config/environment','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0xd037a1,_0x22cb02){var _0x297ec1=function(_0x1ba1c6){while(--_0x1ba1c6){_0xd037a1['push'](_0xd037a1['shift']());}};_0x297ec1(++_0x22cb02);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0xb6fa[_0x1c5142];return _0x1268cb;};'use strict';var Sequelize=require(_0xab6f('0x0'));var moment=require('moment');var path=require('path');var config=require(_0xab6f('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xab6f('0x2')](_0xab6f('0x3'))?path['extname'](this[_0xab6f('0x2')](_0xab6f('0x3'))):undefined;}},'interactionid':{'type':Sequelize[_0xab6f('0x4')]},'channel':{'type':Sequelize[_0xab6f('0x4')]},'value':{'type':Sequelize[_0xab6f('0x4')],'set':function(_0x895acc){var _0x16b84e=_0x895acc[_0xab6f('0x5')](/\\/g,'/');this[_0xab6f('0x6')](_0xab6f('0x3'),_0x16b84e);}},'rating':{'type':Sequelize[_0xab6f('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xab6f('0x7')],'set':function(_0x199f2d){this[_0xab6f('0x6')](_0xab6f('0x8'),moment()[_0xab6f('0x9')](_0x199f2d,'ms'));this['setDataValue']('closedAt',moment());this[_0xab6f('0x6')](_0xab6f('0xa'),_0x199f2d);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xab6f('0x2')](_0xab6f('0x8')))[_0xab6f('0xb')](_0xab6f('0xc'))[_0xab6f('0xd')]();}},'closedAt':{'type':Sequelize[_0xab6f('0xe')],'get':function(){return moment(this[_0xab6f('0x2')]('closedAt'))[_0xab6f('0xb')](_0xab6f('0xc'))[_0xab6f('0xd')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xab6f('0x2')]('createdAt'))['format'](_0xab6f('0xc'))['toString']();}},'updatedAt':{'type':Sequelize[_0xab6f('0xe')],'get':function(){return moment(this[_0xab6f('0x2')](_0xab6f('0xf')))['format'](_0xab6f('0xc'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6302cc7..9ead4e5 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 _0x5fc3=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','existsSync','decryptFile','secrets','join','Sequelize','ValidationError','filename','unlink','message','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x9177c8,_0x46ec6a){var _0xfb35c0=function(_0x3c455e){while(--_0x3c455e){_0x9177c8['push'](_0x9177c8['shift']());}};_0xfb35c0(++_0x46ec6a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0x5fc3[_0x29bf80];return _0x932096;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26')),[_0x35fc('0x2e')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x26b7cb[_0x35fc('0x2f')]);_0x9f3c8a[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x9f3c8a['model'],_0x9f3c8a['query']);_0x383837[_0x35fc('0x33')]=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs[_0x35fc('0x34')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x34')]));_0x383837[_0x35fc('0x33')]=_0x383837[_0x35fc('0x33')]['length']?_0x383837[_0x35fc('0x33')]:_0x9f3c8a[_0x35fc('0x2c')];if(!_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x35')](_0x35fc('0x36'))){_0x383837[_0x35fc('0x1c')]=qs['limit'](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x1c')]);_0x383837[_0x35fc('0x1a')]=qs['offset'](_0x26b7cb[_0x35fc('0x2f')]['offset']);}_0x383837[_0x35fc('0x37')]=qs[_0x35fc('0x38')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x38')]);_0x383837['where']=qs['filters'](_['pick'](_0x26b7cb[_0x35fc('0x2f')],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2f')]['filter']){_0x383837[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x383837[_0x35fc('0x39')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x1c10e0){if(_0x1c10e0[_0x35fc('0x2b')]!==_0x35fc('0x3b')){var _0x4ec0dc={};_0x4ec0dc[_0x1c10e0[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb[_0x35fc('0x2f')]['filter']+'%'};return _0x4ec0dc;}})});}_0x383837=_[_0x35fc('0x3a')]({},_0x383837,_0x26b7cb[_0x35fc('0x3c')]);var _0x1aac67={'where':_0x383837[_0x35fc('0x39')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1aac67)['then'](function(_0x3f6480){_0x3735da[_0x35fc('0x1d')]=_0x3f6480;if(_0x26b7cb[_0x35fc('0x2f')]['includeAll']){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db[_0x35fc('0x29')]['findAll'](_0x383837);})[_0x35fc('0x24')](function(_0x280af1){_0x3735da[_0x35fc('0x3e')]=_0x280af1;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x3f')](handleError(_0x645eac,null));};exports[_0x35fc('0x40')]=function(_0x211b70,_0x3ec51f){var _0x5a7e9e={'raw':![],'where':{'id':_0x211b70[_0x35fc('0x41')]['id']}},_0x596e83={};_0x596e83[_0x35fc('0x2c')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x596e83[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x211b70['query']);_0x596e83[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x596e83[_0x35fc('0x2c')],_0x596e83[_0x35fc('0x2f')]);_0x5a7e9e['attributes']=_['intersection'](_0x596e83['model'],qs['fields'](_0x211b70['query'][_0x35fc('0x34')]));_0x5a7e9e[_0x35fc('0x33')]=_0x5a7e9e['attributes'][_0x35fc('0x42')]?_0x5a7e9e['attributes']:_0x596e83[_0x35fc('0x2c')];if(_0x211b70[_0x35fc('0x2f')][_0x35fc('0x43')]){_0x5a7e9e[_0x35fc('0x3d')]=[{'all':!![]}];}_0x5a7e9e=_[_0x35fc('0x3a')]({},_0x5a7e9e,_0x211b70['options']);return db[_0x35fc('0x29')][_0x35fc('0x44')](_0x5a7e9e)['then'](handleEntityNotFound(_0x3ec51f,null))[_0x35fc('0x24')](respondWithResult(_0x3ec51f,null))[_0x35fc('0x3f')](handleError(_0x3ec51f,null));};exports[_0x35fc('0x45')]=function(_0x211746,_0x5bc8c3){return db[_0x35fc('0x29')]['create'](_0x211746['body'],{})[_0x35fc('0x24')](respondWithResult(_0x5bc8c3,0xc9))[_0x35fc('0x3f')](handleError(_0x5bc8c3,null));};exports[_0x35fc('0x23')]=function(_0xca8aef,_0xf2ca20){if(_0xca8aef[_0x35fc('0x46')]['id']){delete _0xca8aef[_0x35fc('0x46')]['id'];}delete _0xca8aef[_0x35fc('0x46')]['duration'];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x47')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x48')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x49')];return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0xca8aef[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0xf2ca20,null))[_0x35fc('0x24')](saveUpdates(_0xca8aef[_0x35fc('0x46')],null))[_0x35fc('0x24')](respondWithResult(_0xf2ca20,null))[_0x35fc('0x3f')](handleError(_0xf2ca20,null));};exports['describe']=function(_0x553ed6,_0x144f77){return db[_0x35fc('0x29')][_0x35fc('0x4a')]()[_0x35fc('0x24')](respondWithResult(_0x144f77,null))[_0x35fc('0x3f')](handleError(_0x144f77,null));};exports[_0x35fc('0x4b')]=function(_0x4a4798,_0x4f024c,_0x388521){var _0x19b2ce=require(_0x35fc('0x4c'));var _0x38bc78=![];var _0x5b2595={};if(_0x4a4798[_0x35fc('0x2f')][_0x35fc('0x2b')]&&_0x4a4798['query'][_0x35fc('0x2b')]===_0x35fc('0x4d')){_0x5b2595['uniqueid']=_0x4a4798[_0x35fc('0x41')]['id'];}else{_0x5b2595['id']=_0x4a4798[_0x35fc('0x41')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':_0x5b2595,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4f024c,null))['then'](function(_0x240338){if(_0x240338){var _0x2ea8d6=path['join'](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x240338[_0x35fc('0x49')]);var _0x145854=util[_0x35fc('0x2e')]('%s.cypher',_0x2ea8d6);if(fs[_0x35fc('0x50')](_0x145854)){_0x38bc78=!![];return _0x19b2ce[_0x35fc('0x51')](_0x145854,_0x2ea8d6,config[_0x35fc('0x52')]['recording'])[_0x35fc('0x24')](function(){return _0x240338;});}return _0x240338;}})[_0x35fc('0x24')](function(_0x47fb1a){if(_0x47fb1a){var _0x35a676=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x47fb1a[_0x35fc('0x49')]);if(!fs[_0x35fc('0x50')](_0x35a676)){throw new db[(_0x35fc('0x54'))][(_0x35fc('0x55'))]('ScreenRecording\x20not\x20found');}if(_0x47fb1a[_0x35fc('0x56')]){return _0x4f024c[_0x35fc('0x4b')](_0x35a676,_0x47fb1a[_0x35fc('0x56')]+path['extname'](_0x35a676),function(){if(_0x38bc78){fs[_0x35fc('0x57')](_0x35a676);}});}else{return _0x4f024c['download'](_0x35a676,function(_0x4ceacc){if(_0x38bc78){fs['unlink'](_0x35a676);}});}}})[_0x35fc('0x3f')](function(_0xb1c68a){if(_0xb1c68a[_0x35fc('0x58')]===_0x35fc('0x59')){_0x4f024c[_0x35fc('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x4f024c,null);}});};exports['destroy']=function(_0x4faef4,_0x51d231){return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0x4faef4[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](function(_0x511e8b){if(_[_0x35fc('0x5a')](_0x511e8b)){throw new ReferenceError(_0x35fc('0x5b'));}return _0x511e8b;})[_0x35fc('0x24')](function(_0x1b0063){var _0x37bea1=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x1b0063[_0x35fc('0x49')]);logger['info'](_0x35fc('0x5c'),_0x37bea1);if(!_['isNil'](_0x1b0063[_0x35fc('0x49')])&&fs[_0x35fc('0x50')](_0x37bea1)){logger[_0x35fc('0x5d')](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}_0x37bea1=_0x37bea1+'.cypher';if(!_['isNil'](_0x1b0063['value'])&&fs[_0x35fc('0x50')](_0x37bea1)){logger['info'](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}return _0x1b0063;})['then'](function(_0x42a53a){if(!_0x42a53a)throw new InternalError();return _0x42a53a[_0x35fc('0x25')]();})[_0x35fc('0x24')](function(){_0x51d231[_0x35fc('0x18')](0xcc)['end']();})[_0x35fc('0x3f')](handleError(_0x51d231,null));}; \ No newline at end of file +var _0x3e74=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','catch','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','decryptFile','secrets','server/files/screen_recordings','Sequelize','ValidationError','filename','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','existsSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x2415e7,_0x1c8b95){var _0x137760=function(_0x59fd14){while(--_0x59fd14){_0x2415e7['push'](_0x2415e7['shift']());}};_0x137760(++_0x1c8b95);}(_0x3e74,0x175));var _0x43e7=function(_0x191727,_0x4a5cd8){_0x191727=_0x191727-0x0;var _0x208475=_0x3e74[_0x191727];return _0x208475;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_[_0x43e7('0x27')](_0x50f9f5,'name'),[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0xb1fc63[_0x43e7('0x30')]);_0x4690a6[_0x43e7('0x32')]=_['intersection'](_0x4690a6[_0x43e7('0x2d')],_0x4690a6[_0x43e7('0x30')]);_0x33a1a5[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x4690a6['model'],qs['fields'](_0xb1fc63['query'][_0x43e7('0x35')]));_0x33a1a5[_0x43e7('0x33')]=_0x33a1a5[_0x43e7('0x33')][_0x43e7('0x36')]?_0x33a1a5[_0x43e7('0x33')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63['query']['hasOwnProperty']('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5[_0x43e7('0x19')]=qs['offset'](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x19')]);}_0x33a1a5[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x38')]);_0x33a1a5[_0x43e7('0x39')]=qs['filters'](_['pick'](_0xb1fc63['query'],_0x4690a6[_0x43e7('0x32')]),_0x50f9f5);if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x39')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x2ffd43){if(_0x2ffd43['type']!==_0x43e7('0x3c')){var _0x2b0ffe={};_0x2b0ffe[_0x2ffd43['name']]={'$like':'%'+_0xb1fc63[_0x43e7('0x30')]['filter']+'%'};return _0x2b0ffe;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63[_0x43e7('0x3d')]);var _0x1c6f45={'where':_0x33a1a5[_0x43e7('0x39')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x1c6f45)['then'](function(_0x574a93){_0x45b675[_0x43e7('0x1a')]=_0x574a93;if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x33a1a5[_0x43e7('0x3f')]=[{'all':!![]}];}return db[_0x43e7('0x28')]['findAll'](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4227c4){_0x45b675['rows']=_0x4227c4;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x40')]=function(_0x504101,_0x3d81ae){var _0x3b4235={'raw':![],'where':{'id':_0x504101[_0x43e7('0x41')]['id']}},_0x3a5807={};_0x3a5807['model']=_['keys'](db[_0x43e7('0x28')][_0x43e7('0x29')]);_0x3a5807[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x504101['query']);_0x3a5807['filters']=_['intersection'](_0x3a5807[_0x43e7('0x2d')],_0x3a5807['query']);_0x3b4235[_0x43e7('0x33')]=_['intersection'](_0x3a5807['model'],qs[_0x43e7('0x35')](_0x504101['query'][_0x43e7('0x35')]));_0x3b4235[_0x43e7('0x33')]=_0x3b4235[_0x43e7('0x33')][_0x43e7('0x36')]?_0x3b4235['attributes']:_0x3a5807[_0x43e7('0x2d')];if(_0x504101[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x3b4235[_0x43e7('0x3f')]=[{'all':!![]}];}_0x3b4235=_[_0x43e7('0x3b')]({},_0x3b4235,_0x504101[_0x43e7('0x3d')]);return db['ScreenRecording']['find'](_0x3b4235)[_0x43e7('0x21')](handleEntityNotFound(_0x3d81ae,null))[_0x43e7('0x21')](respondWithResult(_0x3d81ae,null))[_0x43e7('0x42')](handleError(_0x3d81ae,null));};exports['create']=function(_0x5c1c18,_0x56489b){return db[_0x43e7('0x28')][_0x43e7('0x43')](_0x5c1c18['body'],{})[_0x43e7('0x21')](respondWithResult(_0x56489b,0xc9))[_0x43e7('0x42')](handleError(_0x56489b,null));};exports[_0x43e7('0x20')]=function(_0x560329,_0x593155){if(_0x560329['body']['id']){delete _0x560329['body']['id'];}delete _0x560329[_0x43e7('0x44')][_0x43e7('0x45')];delete _0x560329['body'][_0x43e7('0x46')];delete _0x560329[_0x43e7('0x44')][_0x43e7('0x47')];delete _0x560329[_0x43e7('0x44')]['value'];return db[_0x43e7('0x28')]['find']({'where':{'id':_0x560329['params']['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x593155,null))[_0x43e7('0x21')](saveUpdates(_0x560329[_0x43e7('0x44')],null))[_0x43e7('0x21')](respondWithResult(_0x593155,null))[_0x43e7('0x42')](handleError(_0x593155,null));};exports[_0x43e7('0x48')]=function(_0x1cd87c,_0x256ddd){return db[_0x43e7('0x28')][_0x43e7('0x48')]()['then'](respondWithResult(_0x256ddd,null))[_0x43e7('0x42')](handleError(_0x256ddd,null));};exports[_0x43e7('0x49')]=function(_0x499c03,_0x39e3ca,_0x4e6f6d){var _0x35b799=require(_0x43e7('0x4a'));var _0x34e2ec=![];var _0x1f561f={};if(_0x499c03[_0x43e7('0x30')]['type']&&_0x499c03['query'][_0x43e7('0x2b')]===_0x43e7('0x4b')){_0x1f561f[_0x43e7('0x4b')]=_0x499c03[_0x43e7('0x41')]['id'];}else{_0x1f561f['id']=_0x499c03[_0x43e7('0x41')]['id'];}return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':_0x1f561f,'attributes':['id',_0x43e7('0x4d')],'raw':!![]})[_0x43e7('0x21')](handleEntityNotFound(_0x39e3ca,null))[_0x43e7('0x21')](function(_0x312306){if(_0x312306){var _0x4ace49=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],'server/files/screen_recordings',_0x312306[_0x43e7('0x4d')]);var _0x220bf2=util[_0x43e7('0x2f')]('%s.cypher',_0x4ace49);if(fs['existsSync'](_0x220bf2)){_0x34e2ec=!![];return _0x35b799[_0x43e7('0x50')](_0x220bf2,_0x4ace49,config[_0x43e7('0x51')]['recording'])[_0x43e7('0x21')](function(){return _0x312306;});}return _0x312306;}})['then'](function(_0x49a6ce){if(_0x49a6ce){var _0x1fa3f6=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],_0x43e7('0x52'),_0x49a6ce[_0x43e7('0x4d')]);if(!fs['existsSync'](_0x1fa3f6)){throw new db[(_0x43e7('0x53'))][(_0x43e7('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x49a6ce[_0x43e7('0x55')]){return _0x39e3ca[_0x43e7('0x49')](_0x1fa3f6,_0x49a6ce[_0x43e7('0x55')]+path['extname'](_0x1fa3f6),function(){if(_0x34e2ec){fs['unlink'](_0x1fa3f6);}});}else{return _0x39e3ca['download'](_0x1fa3f6,function(_0x2ada55){if(_0x34e2ec){fs[_0x43e7('0x56')](_0x1fa3f6);}});}}})[_0x43e7('0x42')](function(_0x3a6404){if(_0x3a6404['message']==='ScreenRecording\x20not\x20found'){_0x39e3ca[_0x43e7('0x1b')](0x194)[_0x43e7('0x25')](_0x43e7('0x57'));}else{return handleError(_0x39e3ca,null);}});};exports[_0x43e7('0x22')]=function(_0x5ea0db,_0x4438c0){return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':{'id':_0x5ea0db[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](function(_0xd41e79){if(_[_0x43e7('0x58')](_0xd41e79)){throw new ReferenceError(_0x43e7('0x59'));}return _0xd41e79;})[_0x43e7('0x21')](function(_0x381208){var _0x252f00=path['join'](config['root'],_0x43e7('0x52'),_0x381208['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x252f00);if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs['existsSync'](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}_0x252f00=_0x252f00+_0x43e7('0x5d');if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs[_0x43e7('0x5e')](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}return _0x381208;})[_0x43e7('0x21')](function(_0x40d0c0){if(!_0x40d0c0)throw new InternalError();return _0x40d0c0[_0x43e7('0x22')]();})['then'](function(){_0x4438c0['status'](0xcc)[_0x43e7('0x15')]();})['catch'](handleError(_0x4438c0,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5765dd9..86d65d9 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 _0x9b83=['screen_recordings','interactionid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./screenRecording.attributes','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b83,0xf4));var _0x39b8=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x9b83[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var logger=require(_0x39b8('0x2'))('api');var moment=require(_0x39b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x39b8('0x4'));var fs=require('fs');var path=require(_0x39b8('0x5'));var rimraf=require('rimraf');var config=require(_0x39b8('0x6'));var attributes=require(_0x39b8('0x7'));module['exports']=function(_0x213d97,_0x193ce7){return _0x213d97[_0x39b8('0x8')]('ScreenRecording',attributes,{'tableName':_0x39b8('0x9'),'paranoid':![],'indexes':[{'name':_0x39b8('0xa'),'fields':[_0x39b8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef85=['./screenRecording.attributes','exports','define','ScreenRecording','interactionid','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x3fae4f,_0x3ed2e9){var _0x312000=function(_0x247287){while(--_0x247287){_0x3fae4f['push'](_0x3fae4f['shift']());}};_0x312000(++_0x3ed2e9);}(_0xef85,0x94));var _0x5ef8=function(_0x4e5920,_0x543ec9){_0x4e5920=_0x4e5920-0x0;var _0x520dae=_0xef85[_0x4e5920];return _0x520dae;};'use strict';var _=require('lodash');var util=require(_0x5ef8('0x0'));var logger=require(_0x5ef8('0x1'))(_0x5ef8('0x2'));var moment=require(_0x5ef8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ef8('0x4'));var rimraf=require('rimraf');var config=require(_0x5ef8('0x5'));var attributes=require(_0x5ef8('0x6'));module[_0x5ef8('0x7')]=function(_0x4d01ea,_0x4141c8){return _0x4d01ea[_0x5ef8('0x8')](_0x5ef8('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x5ef8('0xa'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 1b79cdc..a55f654 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 _0x9118=['http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x297cba,_0x353448){var _0x4a8dfb=function(_0x1502ce){while(--_0x1502ce){_0x297cba['push'](_0x297cba['shift']());}};_0x4a8dfb(++_0x353448);}(_0x9118,0x1ec));var _0x8911=function(_0xeda16c,_0x4c3476){_0xeda16c=_0xeda16c-0x0;var _0x393764=_0x9118[_0xeda16c];return _0x393764;};'use strict';var _=require(_0x8911('0x0'));var util=require(_0x8911('0x1'));var moment=require(_0x8911('0x2'));var BPromise=require(_0x8911('0x3'));var rs=require(_0x8911('0x4'));var fs=require('fs');var Redis=require(_0x8911('0x5'));var db=require(_0x8911('0x6'))['db'];var utils=require(_0x8911('0x7'));var logger=require(_0x8911('0x8'))(_0x8911('0x9'));var config=require(_0x8911('0xa'));var jayson=require(_0x8911('0xb'));var client=jayson['client'][_0x8911('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a4d85,_0x58c44f,_0x2b3105){return new BPromise(function(_0x46f16d,_0x485c8a){return client['request'](_0x2a4d85,_0x2b3105)[_0x8911('0xd')](function(_0x521e76){logger[_0x8911('0xe')](_0x8911('0xf'),_0x58c44f,_0x8911('0x10'));logger[_0x8911('0x11')](_0x8911('0x12'),_0x58c44f,_0x8911('0x10'),JSON[_0x8911('0x13')](_0x521e76));if(_0x521e76[_0x8911('0x14')]){if(_0x521e76[_0x8911('0x14')][_0x8911('0x15')]===0x1f4){logger[_0x8911('0x14')](_0x8911('0xf'),_0x58c44f,_0x521e76[_0x8911('0x14')][_0x8911('0x16')]);return _0x485c8a(_0x521e76[_0x8911('0x14')]['message']);}logger[_0x8911('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x58c44f,_0x521e76[_0x8911('0x14')][_0x8911('0x16')]);return _0x46f16d(_0x521e76[_0x8911('0x14')][_0x8911('0x16')]);}else{logger['info'](_0x8911('0xf'),_0x58c44f,'request\x20sent');_0x46f16d(_0x521e76[_0x8911('0x17')]['message']);}})['catch'](function(_0x23eaf5){logger['error'](_0x8911('0xf'),_0x58c44f,_0x23eaf5);_0x485c8a(_0x23eaf5);});});} \ No newline at end of file +var _0xb027=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util'];(function(_0x18138c,_0x4d3f6f){var _0x4ea8a2=function(_0x5a9303){while(--_0x5a9303){_0x18138c['push'](_0x18138c['shift']());}};_0x4ea8a2(++_0x4d3f6f);}(_0xb027,0x68));var _0x7b02=function(_0x19b26d,_0x147e71){_0x19b26d=_0x19b26d-0x0;var _0x502f37=_0xb027[_0x19b26d];return _0x502f37;};'use strict';var _=require('lodash');var util=require(_0x7b02('0x0'));var moment=require(_0x7b02('0x1'));var BPromise=require(_0x7b02('0x2'));var rs=require(_0x7b02('0x3'));var fs=require('fs');var Redis=require(_0x7b02('0x4'));var db=require(_0x7b02('0x5'))['db'];var utils=require(_0x7b02('0x6'));var logger=require(_0x7b02('0x7'))(_0x7b02('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b02('0x9'));var client=jayson[_0x7b02('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bebfe,_0x58731e,_0xf419ec){return new BPromise(function(_0x175724,_0x3059cd){return client[_0x7b02('0xb')](_0x4bebfe,_0xf419ec)['then'](function(_0x5d426c){logger['info'](_0x7b02('0xc'),_0x58731e,_0x7b02('0xd'));logger[_0x7b02('0xe')](_0x7b02('0xf'),_0x58731e,_0x7b02('0xd'),JSON[_0x7b02('0x10')](_0x5d426c));if(_0x5d426c[_0x7b02('0x11')]){if(_0x5d426c[_0x7b02('0x11')]['code']===0x1f4){logger[_0x7b02('0x11')](_0x7b02('0xc'),_0x58731e,_0x5d426c[_0x7b02('0x11')][_0x7b02('0x12')]);return _0x3059cd(_0x5d426c[_0x7b02('0x11')][_0x7b02('0x12')]);}logger['error'](_0x7b02('0xc'),_0x58731e,_0x5d426c[_0x7b02('0x11')][_0x7b02('0x12')]);return _0x175724(_0x5d426c[_0x7b02('0x11')]['message']);}else{logger[_0x7b02('0x13')](_0x7b02('0xc'),_0x58731e,'request\x20sent');_0x175724(_0x5d426c[_0x7b02('0x14')][_0x7b02('0x12')]);}})['catch'](function(_0x57d726){logger[_0x7b02('0x11')](_0x7b02('0xc'),_0x58731e,_0x57d726);_0x3059cd(_0x57d726);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6d7bbe8..6931af1 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 _0xe9a9=['getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','addLogo','originalname','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login'];(function(_0x30af8e,_0x5d741a){var _0x549c27=function(_0x4e5655){while(--_0x4e5655){_0x30af8e['push'](_0x30af8e['shift']());}};_0x549c27(++_0x5d741a);}(_0xe9a9,0x12f));var _0x9e9a=function(_0x3c3238,_0x5e45ed){_0x3c3238=_0x3c3238-0x0;var _0x4b00ee=_0xe9a9[_0x3c3238];return _0x4b00ee;};'use strict';var multer=require(_0x9e9a('0x0'));var util=require(_0x9e9a('0x1'));var path=require(_0x9e9a('0x2'));var timeout=require(_0x9e9a('0x3'));var express=require(_0x9e9a('0x4'));var router=express[_0x9e9a('0x5')]();var fs_extra=require(_0x9e9a('0x6'));var auth=require(_0x9e9a('0x7'));var interaction=require(_0x9e9a('0x8'));var config=require('../../config/environment');var controller=require(_0x9e9a('0x9'));router[_0x9e9a('0xa')]('/',auth[_0x9e9a('0xb')](),controller[_0x9e9a('0xc')]);router[_0x9e9a('0xa')](_0x9e9a('0xd'),controller['getDate']);router[_0x9e9a('0xa')](_0x9e9a('0xe'),controller[_0x9e9a('0xf')]);router[_0x9e9a('0xa')](_0x9e9a('0x10'),controller[_0x9e9a('0x11')]);router[_0x9e9a('0xa')](_0x9e9a('0x12'),controller[_0x9e9a('0x13')]);router[_0x9e9a('0xa')](_0x9e9a('0x14'),controller[_0x9e9a('0x15')]);router[_0x9e9a('0xa')](_0x9e9a('0x16'),controller[_0x9e9a('0x17')]);router[_0x9e9a('0xa')]('/:id/favicon',controller[_0x9e9a('0x18')]);var upload=multer({'storage':multer[_0x9e9a('0x19')]({'destination':function(_0x4994ab,_0x4f12b2,_0xff58e1){_0xff58e1(null,path[_0x9e9a('0x1a')](config[_0x9e9a('0x1b')],_0x9e9a('0x1c')));},'filename':function(_0x2263d2,_0x123c9b,_0x2315c4){_0x2315c4(null,util[_0x9e9a('0x1d')](_0x9e9a('0x1e'),_0x9e9a('0x1f'),path[_0x9e9a('0x20')](_0x123c9b['originalname'])));}})});router[_0x9e9a('0x21')]('/:id/logo',upload[_0x9e9a('0x22')](_0x9e9a('0x23')),controller[_0x9e9a('0x24')]);var upload=multer({'storage':multer[_0x9e9a('0x19')]({'destination':function(_0x2586e4,_0x2ee502,_0x36a1ef){_0x36a1ef(null,path[_0x9e9a('0x1a')](config[_0x9e9a('0x1b')],_0x9e9a('0x1c')));},'filename':function(_0x108f06,_0x3b0be0,_0xde8804){_0xde8804(null,util['format'](_0x9e9a('0x1e'),'logologin',path[_0x9e9a('0x20')](_0x3b0be0[_0x9e9a('0x25')])));}})});router[_0x9e9a('0x21')](_0x9e9a('0x12'),upload[_0x9e9a('0x22')](_0x9e9a('0x23')),controller[_0x9e9a('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x494e04,_0x7affc8,_0x58e039){_0x58e039(null,path[_0x9e9a('0x1a')](config['root'],_0x9e9a('0x1c')));},'filename':function(_0x26d38b,_0x566e5d,_0xc722c3){_0xc722c3(null,util['format'](_0x9e9a('0x1e'),_0x9e9a('0x27'),path[_0x9e9a('0x20')](_0x566e5d[_0x9e9a('0x25')])));}})});router[_0x9e9a('0x21')](_0x9e9a('0x16'),upload[_0x9e9a('0x22')](_0x9e9a('0x23')),controller[_0x9e9a('0x28')]);var upload=multer({'storage':multer[_0x9e9a('0x19')]({'destination':function(_0x484573,_0x54aae6,_0xf14926){_0xf14926(null,path[_0x9e9a('0x1a')](config['root'],_0x9e9a('0x1c')));},'filename':function(_0x34c36a,_0x2e9331,_0x437f78){_0x437f78(null,util[_0x9e9a('0x1d')](_0x9e9a('0x1e'),_0x9e9a('0x29'),path[_0x9e9a('0x20')](_0x2e9331['originalname'])));}})});router['post'](_0x9e9a('0x2a'),upload['single'](_0x9e9a('0x23')),controller[_0x9e9a('0x2b')]);router['put']('/:id',auth[_0x9e9a('0xb')](),controller[_0x9e9a('0x2c')]);module[_0x9e9a('0x2d')]=router; \ No newline at end of file +var _0x8e94=['put','isAuthenticated','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','addLogo','root','format','logologin','file','addLogoLogin','preferred','/:id/preferred','addPreferred','addFavicon'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x8e94,0x1ef));var _0x48e9=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x8e94[_0x173452];return _0xee3fd0;};'use strict';var multer=require(_0x48e9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x48e9('0x1'));var auth=require(_0x48e9('0x2'));var interaction=require(_0x48e9('0x3'));var config=require(_0x48e9('0x4'));var controller=require('./setting.controller');router[_0x48e9('0x5')]('/',auth['isAuthenticated'](),controller[_0x48e9('0x6')]);router[_0x48e9('0x5')](_0x48e9('0x7'),controller[_0x48e9('0x8')]);router['get'](_0x48e9('0x9'),controller[_0x48e9('0xa')]);router[_0x48e9('0x5')](_0x48e9('0xb'),controller[_0x48e9('0xc')]);router[_0x48e9('0x5')](_0x48e9('0xd'),controller[_0x48e9('0xe')]);router[_0x48e9('0x5')](_0x48e9('0xf'),controller['gdpr']);router[_0x48e9('0x5')]('/:id/preferred',controller[_0x48e9('0x10')]);router[_0x48e9('0x5')](_0x48e9('0x11'),controller[_0x48e9('0x12')]);var upload=multer({'storage':multer[_0x48e9('0x13')]({'destination':function(_0xa92c76,_0x5b2cd4,_0x11023b){_0x11023b(null,path[_0x48e9('0x14')](config['root'],_0x48e9('0x15')));},'filename':function(_0x3ab1b3,_0x1c66a4,_0x39fe65){_0x39fe65(null,util['format'](_0x48e9('0x16'),_0x48e9('0x17'),path[_0x48e9('0x18')](_0x1c66a4[_0x48e9('0x19')])));}})});router[_0x48e9('0x1a')]('/:id/logo',upload[_0x48e9('0x1b')]('file'),controller[_0x48e9('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x374407,_0x28240e,_0x1853ac){_0x1853ac(null,path[_0x48e9('0x14')](config[_0x48e9('0x1d')],_0x48e9('0x15')));},'filename':function(_0x202df3,_0x37710f,_0x4b70b4){_0x4b70b4(null,util[_0x48e9('0x1e')](_0x48e9('0x16'),_0x48e9('0x1f'),path[_0x48e9('0x18')](_0x37710f[_0x48e9('0x19')])));}})});router[_0x48e9('0x1a')](_0x48e9('0xd'),upload[_0x48e9('0x1b')](_0x48e9('0x20')),controller[_0x48e9('0x21')]);var upload=multer({'storage':multer[_0x48e9('0x13')]({'destination':function(_0x3e9168,_0x77a6ed,_0x2b2c1b){_0x2b2c1b(null,path[_0x48e9('0x14')](config['root'],_0x48e9('0x15')));},'filename':function(_0x4beddf,_0xe09c2a,_0x447d22){_0x447d22(null,util[_0x48e9('0x1e')](_0x48e9('0x16'),_0x48e9('0x22'),path[_0x48e9('0x18')](_0xe09c2a[_0x48e9('0x19')])));}})});router[_0x48e9('0x1a')](_0x48e9('0x23'),upload[_0x48e9('0x1b')]('file'),controller[_0x48e9('0x24')]);var upload=multer({'storage':multer[_0x48e9('0x13')]({'destination':function(_0x334706,_0x4a2151,_0x26a499){_0x26a499(null,path[_0x48e9('0x14')](config[_0x48e9('0x1d')],_0x48e9('0x15')));},'filename':function(_0x117859,_0xafdfbc,_0x53ef00){_0x53ef00(null,util[_0x48e9('0x1e')]('%s%s','favicon',path[_0x48e9('0x18')](_0xafdfbc[_0x48e9('0x19')])));}})});router[_0x48e9('0x1a')](_0x48e9('0x11'),upload['single']('file'),controller[_0x48e9('0x25')]);router[_0x48e9('0x26')]('/:id',auth[_0x48e9('0x27')](),controller['update']);module[_0x48e9('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7ed13d1..3df378a 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef7e=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1bb07c,_0x43cd16){var _0x30bb8a=function(_0x12ba2f){while(--_0x12ba2f){_0x1bb07c['push'](_0x1bb07c['shift']());}};_0x30bb8a(++_0x43cd16);}(_0xef7e,0x194));var _0xeef7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef7e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xeef7('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xeef7('0x1')](0xb),'unique':_0xeef7('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xeef7('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xeef7('0x4')],'defaultValue':_0xeef7('0x5')},'logo':{'type':Sequelize[_0xeef7('0x4')]},'defaultLogo':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xeef7('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xeef7('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xeef7('0x4')]},'turnaddr':{'type':Sequelize[_0xeef7('0x4')]},'turnusername':{'type':Sequelize[_0xeef7('0x4')]},'turnpassword':{'type':Sequelize[_0xeef7('0x4')]},'pageTitle':{'type':Sequelize[_0xeef7('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xeef7('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xeef7('0x4')],'defaultValue':_0xeef7('0x7')},'enableEmailPreview':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xeef7('0x8')},'chatTimeout':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xeef7('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xeef7('0x4')]},'defaultFavicon':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xeef7('0x1')]},'transcribeRegion':{'type':Sequelize[_0xeef7('0x4')]},'sentiment':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xeef7('0x4')]},'language':{'type':Sequelize[_0xeef7('0x4')]},'bucket':{'type':Sequelize[_0xeef7('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xeef7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xeef7('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xeef7('0x1')](0x2)[_0xeef7('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xeef7('0x1')](0x2)[_0xeef7('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xeef7('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xeef7('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}}; \ No newline at end of file +var _0x7462=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x7462,0x165));var _0x2746=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7462[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2746('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2746('0x3')],'defaultValue':_0x2746('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2746('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2746('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2746('0x3')]},'turnaddr':{'type':Sequelize[_0x2746('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x2746('0x3')]},'pageTitle':{'type':Sequelize[_0x2746('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2746('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x2746('0x6')},'enableEmailPreview':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2746('0x3')],'defaultValue':_0x2746('0x7')},'chatTimeout':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2746('0x3')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2746('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x2746('0x3')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x2746('0x3')]},'sentiment':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x2746('0x2')]},'sentimentRegion':{'type':Sequelize[_0x2746('0x3')]},'language':{'type':Sequelize[_0x2746('0x3')]},'bucket':{'type':Sequelize[_0x2746('0x3')]},'googleSsoEnabled':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x2746('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x2746('0x2')](0x2)[_0x2746('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x2746('0x2')](0x2)[_0x2746('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x2746('0x2')](0x2)[_0x2746('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x2746('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x2746('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x2746('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index fae69e6..2f10f78 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 _0xe0e7=['attributes','fields','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','params','rawAttributes','options','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','Setting','type','key','model','map','query','keys','filters','intersection'];(function(_0x4ee192,_0x1e8f15){var _0xe9538d=function(_0x1f8ac5){while(--_0x1f8ac5){_0x4ee192['push'](_0x4ee192['shift']());}};_0xe9538d(++_0x1e8f15);}(_0xe0e7,0x1a2));var _0x7e0e=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0xe0e7[_0x1cfc39];return _0x957a28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e0e('0x0'));var zipdir=require(_0x7e0e('0x1'));var jsonpatch=require(_0x7e0e('0x2'));var rp=require(_0x7e0e('0x3'));var moment=require(_0x7e0e('0x4'));var BPromise=require(_0x7e0e('0x5'));var Mustache=require('mustache');var util=require(_0x7e0e('0x6'));var path=require(_0x7e0e('0x7'));var sox=require(_0x7e0e('0x8'));var csv=require(_0x7e0e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e0e('0xa'));var _=require(_0x7e0e('0xb'));var squel=require(_0x7e0e('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e0e('0x9'));var querystring=require('querystring');var Papa=require(_0x7e0e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e0e('0xf'));var as=require(_0x7e0e('0x10'));var hardwareService=require(_0x7e0e('0x11'));var logger=require(_0x7e0e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7e0e('0x13'));var licenseUtil=require(_0x7e0e('0x14'));var db=require(_0x7e0e('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7e0e('0x16')][_0x7e0e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4ff342,_0x331b66,_0xe1a93a,_0x353702){return new BPromise(function(_0x1b67df,_0x4ddcfe){var _0x3a0e20=_0x353702||client;return _0x3a0e20[_0x7e0e('0x18')](_0x4ff342,_0xe1a93a)[_0x7e0e('0x19')](function(_0x2e2717){logger['info']('Setting,\x20%s,\x20%s',_0x331b66,_0x7e0e('0x1a'));logger[_0x7e0e('0x1b')](_0x7e0e('0x1c'),_0x331b66,'request\x20sent',JSON['stringify'](_0x2e2717));if(_0x2e2717[_0x7e0e('0x1d')]){if(_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x1e')]===0x1f4){logger[_0x7e0e('0x1d')](_0x7e0e('0x1f'),_0x331b66,_0x2e2717['error'][_0x7e0e('0x20')]);return _0x4ddcfe(_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x20')]);}logger[_0x7e0e('0x1d')](_0x7e0e('0x1f'),_0x331b66,_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x20')]);return _0x1b67df(_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x20')]);}else{logger[_0x7e0e('0x21')](_0x7e0e('0x1f'),_0x331b66,_0x7e0e('0x1a'));_0x1b67df(_0x2e2717[_0x7e0e('0x22')][_0x7e0e('0x20')]);}})[_0x7e0e('0x23')](function(_0x4ca566){logger['error'](_0x7e0e('0x1f'),_0x331b66,_0x4ca566);_0x4ddcfe(_0x4ca566);});});}function respondWithStatusCode(_0x375061,_0x5e1cf9){_0x5e1cf9=_0x5e1cf9||0xcc;return function(_0x102cfa){if(_0x102cfa){return _0x375061[_0x7e0e('0x24')](_0x5e1cf9);}return _0x375061[_0x7e0e('0x25')](_0x5e1cf9)['end']();};}function respondWithResult(_0x1665e4,_0x34e2c5){_0x34e2c5=_0x34e2c5||0xc8;return function(_0x5beb92){if(_0x5beb92){return _0x1665e4[_0x7e0e('0x25')](_0x34e2c5)[_0x7e0e('0x26')](_0x5beb92);}};}function respondWithFilteredResult(_0xe1cf7b,_0x4382b3){return function(_0x26c71c){if(_0x26c71c){var _0x36b473=typeof _0x4382b3[_0x7e0e('0x27')]===_0x7e0e('0x28')&&typeof _0x4382b3[_0x7e0e('0x29')]===_0x7e0e('0x28');var _0x1c5572=_0x26c71c[_0x7e0e('0x2a')];var _0x371b5f=_0x36b473?0x0:_0x4382b3[_0x7e0e('0x27')];var _0x8c4b36=_0x36b473?_0x26c71c[_0x7e0e('0x2a')]:_0x4382b3[_0x7e0e('0x27')]+_0x4382b3[_0x7e0e('0x29')];var _0x243414;if(_0x8c4b36>=_0x1c5572){_0x8c4b36=_0x1c5572;_0x243414=0xc8;}else{_0x243414=0xce;}_0xe1cf7b[_0x7e0e('0x25')](_0x243414);return _0xe1cf7b[_0x7e0e('0x2b')](_0x7e0e('0x2c'),_0x371b5f+'-'+_0x8c4b36+'/'+_0x1c5572)['json'](_0x26c71c);}return null;};}function patchUpdates(_0x5239e1){return function(_0x2479c4){try{jsonpatch[_0x7e0e('0x2d')](_0x2479c4,_0x5239e1,!![]);}catch(_0x3f2094){return BPromise[_0x7e0e('0x2e')](_0x3f2094);}return _0x2479c4[_0x7e0e('0x2f')]();};}function saveUpdates(_0x21cab2,_0x5b3a21){return function(_0x36a72c){if(_0x36a72c){return _0x36a72c['update'](_0x21cab2)[_0x7e0e('0x19')](function(_0x13d772){return _0x13d772;});}return null;};}function removeEntity(_0x9a9e01,_0x1d5ba7){return function(_0x42f448){if(_0x42f448){return _0x42f448[_0x7e0e('0x30')]()[_0x7e0e('0x19')](function(){_0x9a9e01[_0x7e0e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x468bbc,_0x4ba0a4){return function(_0x340013){if(!_0x340013){_0x468bbc[_0x7e0e('0x24')](0x194);}return _0x340013;};}function handleError(_0x53bde9,_0x1ead3e){_0x1ead3e=_0x1ead3e||0x1f4;return function(_0xc44719){logger['error'](_0xc44719[_0x7e0e('0x31')]);if(_0xc44719['name']){delete _0xc44719[_0x7e0e('0x32')];}_0x53bde9[_0x7e0e('0x25')](_0x1ead3e)[_0x7e0e('0x33')](_0xc44719);};}exports[_0x7e0e('0x34')]=function(_0x6f534a,_0x5242b8){var _0x396293={},_0x15205e={},_0xc00baa={'count':0x0,'rows':[]};var _0x3b1b41=_['map'](db[_0x7e0e('0x35')]['rawAttributes'],function(_0x4d8d23){return{'name':_0x4d8d23['fieldName'],'type':_0x4d8d23[_0x7e0e('0x36')][_0x7e0e('0x37')]};});_0x15205e[_0x7e0e('0x38')]=_[_0x7e0e('0x39')](_0x3b1b41,_0x7e0e('0x32'));_0x15205e[_0x7e0e('0x3a')]=_[_0x7e0e('0x3b')](_0x6f534a['query']);_0x15205e[_0x7e0e('0x3c')]=_[_0x7e0e('0x3d')](_0x15205e[_0x7e0e('0x38')],_0x15205e['query']);_0x396293[_0x7e0e('0x3e')]=_[_0x7e0e('0x3d')](_0x15205e[_0x7e0e('0x38')],qs[_0x7e0e('0x3f')](_0x6f534a[_0x7e0e('0x3a')]['fields']));_0x396293[_0x7e0e('0x3e')]=_0x396293[_0x7e0e('0x3e')]['length']?_0x396293[_0x7e0e('0x3e')]:_0x15205e[_0x7e0e('0x38')];if(!_0x6f534a[_0x7e0e('0x3a')][_0x7e0e('0x40')](_0x7e0e('0x41'))){_0x396293[_0x7e0e('0x29')]=qs['limit'](_0x6f534a[_0x7e0e('0x3a')]['limit']);_0x396293[_0x7e0e('0x27')]=qs[_0x7e0e('0x27')](_0x6f534a['query'][_0x7e0e('0x27')]);}_0x396293['order']=qs[_0x7e0e('0x42')](_0x6f534a['query']['sort']);_0x396293['where']=qs[_0x7e0e('0x3c')](_[_0x7e0e('0x43')](_0x6f534a['query'],_0x15205e['filters']),_0x3b1b41);if(_0x6f534a[_0x7e0e('0x3a')]['filter']){_0x396293['where']=_[_0x7e0e('0x44')](_0x396293[_0x7e0e('0x45')],{'$or':_[_0x7e0e('0x39')](_0x3b1b41,function(_0x396802){if(_0x396802[_0x7e0e('0x36')]!==_0x7e0e('0x46')){var _0x5db5e3={};_0x5db5e3[_0x396802[_0x7e0e('0x32')]]={'$like':'%'+_0x6f534a[_0x7e0e('0x3a')][_0x7e0e('0x47')]+'%'};return _0x5db5e3;}})});}_0x396293=_['merge']({},_0x396293,_0x6f534a['options']);var _0x5391ee={'where':_0x396293[_0x7e0e('0x45')]};return db['Setting'][_0x7e0e('0x2a')](_0x5391ee)[_0x7e0e('0x19')](function(_0x2d3fd6){_0xc00baa[_0x7e0e('0x2a')]=_0x2d3fd6;if(_0x6f534a[_0x7e0e('0x3a')][_0x7e0e('0x48')]){_0x396293[_0x7e0e('0x49')]=[{'all':!![]}];}return db[_0x7e0e('0x35')][_0x7e0e('0x4a')](_0x396293);})['then'](function(_0x2163c8){_0xc00baa[_0x7e0e('0x4b')]=_0x2163c8;return _0xc00baa;})['then'](respondWithFilteredResult(_0x5242b8,_0x396293))['catch'](handleError(_0x5242b8,null));};exports['show']=function(_0x3be26f,_0xa23d2f){var _0x14cbce={'raw':![],'where':{'id':_0x3be26f[_0x7e0e('0x4c')]['id']}},_0xc69fc4={};_0xc69fc4[_0x7e0e('0x38')]=_['keys'](db[_0x7e0e('0x35')][_0x7e0e('0x4d')]);_0xc69fc4[_0x7e0e('0x3a')]=_['keys'](_0x3be26f['query']);_0xc69fc4[_0x7e0e('0x3c')]=_[_0x7e0e('0x3d')](_0xc69fc4[_0x7e0e('0x38')],_0xc69fc4[_0x7e0e('0x3a')]);_0x14cbce[_0x7e0e('0x3e')]=_['intersection'](_0xc69fc4[_0x7e0e('0x38')],qs[_0x7e0e('0x3f')](_0x3be26f[_0x7e0e('0x3a')][_0x7e0e('0x3f')]));_0x14cbce[_0x7e0e('0x3e')]=_0x14cbce[_0x7e0e('0x3e')]['length']?_0x14cbce[_0x7e0e('0x3e')]:_0xc69fc4[_0x7e0e('0x38')];if(_0x3be26f['query'][_0x7e0e('0x48')]){_0x14cbce['include']=[{'all':!![]}];}_0x14cbce=_[_0x7e0e('0x44')]({},_0x14cbce,_0x3be26f[_0x7e0e('0x4e')]);return db['Setting'][_0x7e0e('0x4f')](_0x14cbce)[_0x7e0e('0x19')](handleEntityNotFound(_0xa23d2f,null))[_0x7e0e('0x19')](respondWithResult(_0xa23d2f,null))[_0x7e0e('0x23')](handleError(_0xa23d2f,null));};exports[_0x7e0e('0x50')]=function(_0x5977ef,_0x1a9f7f){if(_0x5977ef['body']['id']){delete _0x5977ef[_0x7e0e('0x51')]['id'];}return db[_0x7e0e('0x35')][_0x7e0e('0x4f')]({'where':{'id':_0x5977ef[_0x7e0e('0x4c')]['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x1a9f7f,null))[_0x7e0e('0x19')](saveUpdates(_0x5977ef[_0x7e0e('0x51')],null))[_0x7e0e('0x19')](respondWithResult(_0x1a9f7f,null))[_0x7e0e('0x23')](handleError(_0x1a9f7f,null));};exports[_0x7e0e('0x52')]=function(_0x27ae49,_0x29bd0f,_0x2d15a5){if(_0x27ae49[_0x7e0e('0x53')]&&_0x27ae49[_0x7e0e('0x53')][_0x7e0e('0x54')]){_0x27ae49[_0x7e0e('0x51')][_0x7e0e('0x55')]=_0x27ae49[_0x7e0e('0x53')]['filename'];}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x27ae49[_0x7e0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29bd0f,null))['then'](saveUpdates(_0x27ae49['body'],null))[_0x7e0e('0x19')](respondWithResult(_0x29bd0f,null))[_0x7e0e('0x23')](handleError(_0x29bd0f,null));};exports[_0x7e0e('0x56')]=function(_0xa6553e,_0x5786f3,_0x352364){if(_0xa6553e[_0x7e0e('0x53')]&&_0xa6553e['file'][_0x7e0e('0x54')]){_0xa6553e[_0x7e0e('0x51')][_0x7e0e('0x57')]=_0xa6553e[_0x7e0e('0x53')][_0x7e0e('0x54')];}return db[_0x7e0e('0x35')][_0x7e0e('0x4f')]({'where':{'id':_0xa6553e['params']['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x5786f3,null))[_0x7e0e('0x19')](saveUpdates(_0xa6553e['body'],null))[_0x7e0e('0x19')](respondWithResult(_0x5786f3,null))['catch'](handleError(_0x5786f3,null));};var utilLicense=require(_0x7e0e('0x14'));exports[_0x7e0e('0x58')]=function(_0x577522,_0x4822c3,_0x50ca69){var _0x51aa6e=_0x7e0e('0x59');var _0xe79ebd={'custom':![]};return utilLicense[_0x7e0e('0x5a')]()[_0x7e0e('0x19')](function(_0x35e39d){if(_0x35e39d){_0xe79ebd=_0x35e39d;}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x577522[_0x7e0e('0x4c')]['id']},'attributes':[_0x7e0e('0x55'),'loginLogo',_0x7e0e('0x5b'),_0x7e0e('0x5c'),_0x7e0e('0x5d'),_0x7e0e('0x5e'),_0x7e0e('0x5f'),_0x7e0e('0x60')],'raw':!![]});})[_0x7e0e('0x19')](handleEntityNotFound(_0x4822c3,null))[_0x7e0e('0x19')](function(_0x2eb787){if(_0x2eb787){var _0x3f9571=_0x2eb787['logo']&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config['root'],_0x51aa6e,_[_0x7e0e('0x63')](_0x2eb787[_0x7e0e('0x55')])))?path['join'](config[_0x7e0e('0x64')],_0x51aa6e,_[_0x7e0e('0x63')](_0x2eb787[_0x7e0e('0x55')])):path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x51aa6e,_[_0x7e0e('0x63')](_0x7e0e('0x65')));var _0x1fd82a=_0x7e0e('0x66')+_[_0x7e0e('0x67')](_0x7e0e('0x55'));if(_0x2eb787[_0x1fd82a]||!_0xe79ebd[_0x7e0e('0x68')]){_0x3f9571=path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x51aa6e,_[_0x7e0e('0x63')](_0x7e0e('0x65')));}if(!fs['existsSync'](_0x3f9571)){throw new db[(_0x7e0e('0x69'))][(_0x7e0e('0x6a'))](_[_0x7e0e('0x67')]('logo')+_0x7e0e('0x6b'));}return _0x4822c3[_0x7e0e('0x6c')](_0x3f9571);}})[_0x7e0e('0x23')](handleError(_0x4822c3,null));};var utilLicense=require(_0x7e0e('0x14'));exports['getLogoLogin']=function(_0x3c6e63,_0x27f792,_0x1e3cfc){var _0x3b969e=_0x7e0e('0x59');var _0x3b2a75={'custom':![]};return utilLicense[_0x7e0e('0x5a')]()[_0x7e0e('0x19')](function(_0x2090c8){if(_0x2090c8){_0x3b2a75=_0x2090c8;}return db[_0x7e0e('0x35')]['find']({'where':{'id':_0x3c6e63[_0x7e0e('0x4c')]['id']},'attributes':['logo','loginLogo',_0x7e0e('0x5b'),'favicon','defaultLogo',_0x7e0e('0x5e'),_0x7e0e('0x5f'),_0x7e0e('0x60')],'raw':!![]});})[_0x7e0e('0x19')](handleEntityNotFound(_0x27f792,null))[_0x7e0e('0x19')](function(_0x20ce67){if(_0x20ce67){var _0x24011d=_0x20ce67['loginLogo']&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_[_0x7e0e('0x63')](_0x20ce67[_0x7e0e('0x57')])))?path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_[_0x7e0e('0x63')](_0x20ce67[_0x7e0e('0x57')])):path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_[_0x7e0e('0x63')](_0x7e0e('0x6d')));var _0x238b0e=_0x7e0e('0x66')+_['upperFirst'](_0x7e0e('0x57'));if(_0x20ce67[_0x238b0e]||!_0x3b2a75[_0x7e0e('0x68')]){_0x24011d=path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_['toLower'](_0x7e0e('0x6d')));}if(!fs[_0x7e0e('0x61')](_0x24011d)){throw new db[(_0x7e0e('0x69'))][(_0x7e0e('0x6a'))](_[_0x7e0e('0x67')](_0x7e0e('0x57'))+_0x7e0e('0x6b'));}return _0x27f792[_0x7e0e('0x6c')](_0x24011d);}})[_0x7e0e('0x23')](handleError(_0x27f792,null));};exports[_0x7e0e('0x6e')]=function(_0x440d03,_0x27ddcb){return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x440d03[_0x7e0e('0x4c')]['id']},'attributes':['securePassword']})[_0x7e0e('0x19')](respondWithResult(_0x27ddcb,null))[_0x7e0e('0x23')](handleError(_0x27ddcb,null));};exports[_0x7e0e('0x6f')]=function(_0x2f2efd,_0x16dc16,_0x2c3003){if(_0x2f2efd[_0x7e0e('0x53')]&&_0x2f2efd[_0x7e0e('0x53')][_0x7e0e('0x54')]){_0x2f2efd[_0x7e0e('0x51')][_0x7e0e('0x5b')]=_0x2f2efd['file'][_0x7e0e('0x54')];}return db[_0x7e0e('0x35')]['find']({'where':{'id':_0x2f2efd[_0x7e0e('0x4c')]['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x16dc16,null))['then'](saveUpdates(_0x2f2efd[_0x7e0e('0x51')],null))[_0x7e0e('0x19')](respondWithResult(_0x16dc16,null))['catch'](handleError(_0x16dc16,null));};var utilLicense=require(_0x7e0e('0x14'));exports[_0x7e0e('0x70')]=function(_0x12d636,_0x327b82,_0x2c55c2){var _0x389b93='server/files/images/logos';var _0x56f673={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x189513){if(_0x189513){_0x56f673=_0x189513;}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x12d636[_0x7e0e('0x4c')]['id']},'attributes':[_0x7e0e('0x55'),_0x7e0e('0x57'),'preferred',_0x7e0e('0x5c'),_0x7e0e('0x5d'),_0x7e0e('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x327b82,null))[_0x7e0e('0x19')](function(_0x5f582f){if(_0x5f582f){var _0x5f2179=_0x5f582f[_0x7e0e('0x5b')]&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config['root'],_0x389b93,_[_0x7e0e('0x63')](_0x5f582f['preferred'])))?path['join'](config[_0x7e0e('0x64')],_0x389b93,_[_0x7e0e('0x63')](_0x5f582f[_0x7e0e('0x5b')])):path['join'](config[_0x7e0e('0x64')],_0x389b93,_[_0x7e0e('0x63')](_0x7e0e('0x71')));var _0x34a715=_0x7e0e('0x66')+_[_0x7e0e('0x67')](_0x7e0e('0x5b'));if(_0x5f582f[_0x34a715]||!_0x56f673[_0x7e0e('0x68')]||!_0x56f673[_0x7e0e('0x5b')]){_0x5f2179=path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x389b93,_[_0x7e0e('0x63')](_0x7e0e('0x71')));}if(!fs['existsSync'](_0x5f2179)){throw new db[(_0x7e0e('0x69'))]['ValidationError'](_[_0x7e0e('0x67')](_0x7e0e('0x5b'))+_0x7e0e('0x6b'));}return _0x327b82[_0x7e0e('0x6c')](_0x5f2179);}})['catch'](handleError(_0x327b82,null));};exports[_0x7e0e('0x72')]=function(_0x19b9ca,_0x1ed898,_0x47b3b8){if(_0x19b9ca[_0x7e0e('0x53')]&&_0x19b9ca[_0x7e0e('0x53')][_0x7e0e('0x54')]){_0x19b9ca[_0x7e0e('0x51')][_0x7e0e('0x5c')]=_0x19b9ca[_0x7e0e('0x53')]['filename'];}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x19b9ca['params']['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x1ed898,null))[_0x7e0e('0x19')](saveUpdates(_0x19b9ca[_0x7e0e('0x51')],null))[_0x7e0e('0x19')](respondWithResult(_0x1ed898,null))[_0x7e0e('0x23')](handleError(_0x1ed898,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x29ebd0,_0x308a6b,_0x40cf8d){var _0x162846=_0x7e0e('0x59');var _0xbaeb00={'custom':![]};return utilLicense['getLicense']()[_0x7e0e('0x19')](function(_0x195642){if(_0x195642){_0xbaeb00=_0x195642;}return db[_0x7e0e('0x35')]['find']({'where':{'id':_0x29ebd0[_0x7e0e('0x4c')]['id']},'attributes':[_0x7e0e('0x55'),_0x7e0e('0x57'),_0x7e0e('0x5b'),'favicon',_0x7e0e('0x5d'),_0x7e0e('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x308a6b,null))[_0x7e0e('0x19')](function(_0x4966c2){if(_0x4966c2){var _0x391e4e=_0x4966c2['favicon']&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x162846,_[_0x7e0e('0x63')](_0x4966c2[_0x7e0e('0x5c')])))?path[_0x7e0e('0x62')](config['root'],_0x162846,_[_0x7e0e('0x63')](_0x4966c2['favicon'])):path['join'](config[_0x7e0e('0x64')],_0x162846,_['toLower'](_0x7e0e('0x73')));var _0x30f207=_0x7e0e('0x66')+_[_0x7e0e('0x67')](_0x7e0e('0x5c'));if(_0x4966c2[_0x30f207]||!_0xbaeb00[_0x7e0e('0x68')]){_0x391e4e=path['join'](config['root'],_0x162846,_[_0x7e0e('0x63')](_0x7e0e('0x73')));}if(!fs[_0x7e0e('0x61')](_0x391e4e)){throw new db[(_0x7e0e('0x69'))][(_0x7e0e('0x6a'))](_[_0x7e0e('0x67')](_0x7e0e('0x5c'))+_0x7e0e('0x6b'));}return _0x308a6b[_0x7e0e('0x6c')](_0x391e4e);}})[_0x7e0e('0x23')](handleError(_0x308a6b,null));};exports[_0x7e0e('0x74')]=function(_0x3d8559,_0x33e987){var _0x234857={'offset':moment()[_0x7e0e('0x75')]()};_0x234857[_0x7e0e('0x76')]=moment()[_0x7e0e('0x75')](_0x234857[_0x7e0e('0x27')])['format'](_0x7e0e('0x77'));return _0x33e987[_0x7e0e('0x25')](0xc8)['send'](_0x234857);}; \ No newline at end of file +var _0x55ca=['includeAll','include','findAll','rows','show','params','keys','intersection','merge','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','getLogoLogin','favicon','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','Sequelize','download','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','end','sendStatus','stack','name','map','rawAttributes','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','options','Setting'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0x55ca,0x126));var _0xa55c=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0x55ca[_0x4de877];return _0xb2cfeb;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Setting,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Setting,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){_0x24d44d['status'](0xcc)[_0xa55c('0x30')]();});}};}function handleEntityNotFound(_0x19733e,_0x4932d0){return function(_0x30fadd){if(!_0x30fadd){_0x19733e[_0xa55c('0x31')](0x194);}return _0x30fadd;};}function handleError(_0x2e9623,_0x1839ac){_0x1839ac=_0x1839ac||0x1f4;return function(_0x30d4f8){logger[_0xa55c('0x21')](_0x30d4f8[_0xa55c('0x32')]);if(_0x30d4f8[_0xa55c('0x33')]){delete _0x30d4f8[_0xa55c('0x33')];}_0x2e9623['status'](_0x1839ac)['send'](_0x30d4f8);};}exports['index']=function(_0x3fd75f,_0x18e00e){var _0x2bb4f0={},_0x5802e4={},_0x768408={'count':0x0,'rows':[]};var _0x547930=_[_0xa55c('0x34')](db['Setting'][_0xa55c('0x35')],function(_0x39267c){return{'name':_0x39267c[_0xa55c('0x36')],'type':_0x39267c['type'][_0xa55c('0x37')]};});_0x5802e4[_0xa55c('0x38')]=_['map'](_0x547930,_0xa55c('0x33'));_0x5802e4[_0xa55c('0x39')]=_['keys'](_0x3fd75f['query']);_0x5802e4[_0xa55c('0x3a')]=_['intersection'](_0x5802e4[_0xa55c('0x38')],_0x5802e4[_0xa55c('0x39')]);_0x2bb4f0['attributes']=_['intersection'](_0x5802e4['model'],qs['fields'](_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x3b')]));_0x2bb4f0[_0xa55c('0x3c')]=_0x2bb4f0[_0xa55c('0x3c')][_0xa55c('0x3d')]?_0x2bb4f0['attributes']:_0x5802e4[_0xa55c('0x38')];if(!_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x3e')](_0xa55c('0x3f'))){_0x2bb4f0[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x3fd75f['query'][_0xa55c('0x2a')]);_0x2bb4f0['offset']=qs['offset'](_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x27')]);}_0x2bb4f0['order']=qs[_0xa55c('0x40')](_0x3fd75f['query']['sort']);_0x2bb4f0[_0xa55c('0x41')]=qs[_0xa55c('0x3a')](_[_0xa55c('0x42')](_0x3fd75f['query'],_0x5802e4[_0xa55c('0x3a')]),_0x547930);if(_0x3fd75f[_0xa55c('0x39')]['filter']){_0x2bb4f0[_0xa55c('0x41')]=_['merge'](_0x2bb4f0[_0xa55c('0x41')],{'$or':_[_0xa55c('0x34')](_0x547930,function(_0x5be43f){if(_0x5be43f[_0xa55c('0x43')]!==_0xa55c('0x44')){var _0x5d834d={};_0x5d834d[_0x5be43f[_0xa55c('0x33')]]={'$like':'%'+_0x3fd75f[_0xa55c('0x39')][_0xa55c('0x45')]+'%'};return _0x5d834d;}})});}_0x2bb4f0=_['merge']({},_0x2bb4f0,_0x3fd75f[_0xa55c('0x46')]);var _0x582901={'where':_0x2bb4f0[_0xa55c('0x41')]};return db[_0xa55c('0x47')][_0xa55c('0x29')](_0x582901)['then'](function(_0x41eab1){_0x768408[_0xa55c('0x29')]=_0x41eab1;if(_0x3fd75f['query'][_0xa55c('0x48')]){_0x2bb4f0[_0xa55c('0x49')]=[{'all':!![]}];}return db['Setting'][_0xa55c('0x4a')](_0x2bb4f0);})[_0xa55c('0x1a')](function(_0x52f9a7){_0x768408[_0xa55c('0x4b')]=_0x52f9a7;return _0x768408;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x18e00e,_0x2bb4f0))[_0xa55c('0x24')](handleError(_0x18e00e,null));};exports[_0xa55c('0x4c')]=function(_0x564cb3,_0x143989){var _0x58a7ea={'raw':![],'where':{'id':_0x564cb3[_0xa55c('0x4d')]['id']}},_0x2157d6={};_0x2157d6[_0xa55c('0x38')]=_['keys'](db[_0xa55c('0x47')][_0xa55c('0x35')]);_0x2157d6['query']=_[_0xa55c('0x4e')](_0x564cb3[_0xa55c('0x39')]);_0x2157d6[_0xa55c('0x3a')]=_[_0xa55c('0x4f')](_0x2157d6[_0xa55c('0x38')],_0x2157d6[_0xa55c('0x39')]);_0x58a7ea[_0xa55c('0x3c')]=_[_0xa55c('0x4f')](_0x2157d6[_0xa55c('0x38')],qs[_0xa55c('0x3b')](_0x564cb3['query'][_0xa55c('0x3b')]));_0x58a7ea[_0xa55c('0x3c')]=_0x58a7ea[_0xa55c('0x3c')]['length']?_0x58a7ea[_0xa55c('0x3c')]:_0x2157d6[_0xa55c('0x38')];if(_0x564cb3['query'][_0xa55c('0x48')]){_0x58a7ea['include']=[{'all':!![]}];}_0x58a7ea=_[_0xa55c('0x50')]({},_0x58a7ea,_0x564cb3[_0xa55c('0x46')]);return db[_0xa55c('0x47')][_0xa55c('0x51')](_0x58a7ea)[_0xa55c('0x1a')](handleEntityNotFound(_0x143989,null))['then'](respondWithResult(_0x143989,null))[_0xa55c('0x24')](handleError(_0x143989,null));};exports[_0xa55c('0x2e')]=function(_0x4b85cc,_0x3929a6){if(_0x4b85cc[_0xa55c('0x52')]['id']){delete _0x4b85cc[_0xa55c('0x52')]['id'];}return db[_0xa55c('0x47')]['find']({'where':{'id':_0x4b85cc['params']['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x3929a6,null))[_0xa55c('0x1a')](saveUpdates(_0x4b85cc[_0xa55c('0x52')],null))[_0xa55c('0x1a')](respondWithResult(_0x3929a6,null))['catch'](handleError(_0x3929a6,null));};exports[_0xa55c('0x53')]=function(_0x5ce463,_0x2742e4,_0x437ced){if(_0x5ce463[_0xa55c('0x54')]&&_0x5ce463[_0xa55c('0x54')][_0xa55c('0x55')]){_0x5ce463['body'][_0xa55c('0x56')]=_0x5ce463['file'][_0xa55c('0x55')];}return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0x5ce463[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x2742e4,null))[_0xa55c('0x1a')](saveUpdates(_0x5ce463[_0xa55c('0x52')],null))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0x24')](handleError(_0x2742e4,null));};exports[_0xa55c('0x57')]=function(_0x2f2d21,_0x23a30e,_0x3fa00f){if(_0x2f2d21['file']&&_0x2f2d21[_0xa55c('0x54')][_0xa55c('0x55')]){_0x2f2d21[_0xa55c('0x52')][_0xa55c('0x58')]=_0x2f2d21[_0xa55c('0x54')]['filename'];}return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0x2f2d21[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x23a30e,null))[_0xa55c('0x1a')](saveUpdates(_0x2f2d21['body'],null))[_0xa55c('0x1a')](respondWithResult(_0x23a30e,null))['catch'](handleError(_0x23a30e,null));};var utilLicense=require(_0xa55c('0x16'));exports['getLogo']=function(_0x3495a7,_0x5a8897,_0x34edc5){var _0x1333da=_0xa55c('0x59');var _0x2f811e={'custom':![]};return utilLicense[_0xa55c('0x5a')]()[_0xa55c('0x1a')](function(_0xafaf8c){if(_0xafaf8c){_0x2f811e=_0xafaf8c;}return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0x3495a7[_0xa55c('0x4d')]['id']},'attributes':['logo',_0xa55c('0x58'),_0xa55c('0x5b'),'favicon',_0xa55c('0x5c'),_0xa55c('0x5d'),_0xa55c('0x5e'),_0xa55c('0x5f')],'raw':!![]});})[_0xa55c('0x1a')](handleEntityNotFound(_0x5a8897,null))[_0xa55c('0x1a')](function(_0x3cef1f){if(_0x3cef1f){var _0x202191=_0x3cef1f['logo']&&fs[_0xa55c('0x60')](path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x1333da,_[_0xa55c('0x63')](_0x3cef1f[_0xa55c('0x56')])))?path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x1333da,_[_0xa55c('0x63')](_0x3cef1f[_0xa55c('0x56')])):path['join'](config[_0xa55c('0x62')],_0x1333da,_[_0xa55c('0x63')](_0xa55c('0x64')));var _0x26606c=_0xa55c('0x65')+_[_0xa55c('0x66')](_0xa55c('0x56'));if(_0x3cef1f[_0x26606c]||!_0x2f811e[_0xa55c('0x67')]){_0x202191=path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x1333da,_[_0xa55c('0x63')]('default_logo.svg'));}if(!fs[_0xa55c('0x60')](_0x202191)){throw new db['Sequelize'][(_0xa55c('0x68'))](_[_0xa55c('0x66')](_0xa55c('0x56'))+'\x20not\x20found');}return _0x5a8897['download'](_0x202191);}})[_0xa55c('0x24')](handleError(_0x5a8897,null));};var utilLicense=require(_0xa55c('0x16'));exports[_0xa55c('0x69')]=function(_0x42529f,_0x4c7ee1,_0x149cb9){var _0xd02251=_0xa55c('0x59');var _0x3a9910={'custom':![]};return utilLicense[_0xa55c('0x5a')]()['then'](function(_0x4b090c){if(_0x4b090c){_0x3a9910=_0x4b090c;}return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0x42529f[_0xa55c('0x4d')]['id']},'attributes':[_0xa55c('0x56'),_0xa55c('0x58'),'preferred',_0xa55c('0x6a'),_0xa55c('0x5c'),'defaultLoginLogo',_0xa55c('0x5e'),_0xa55c('0x5f')],'raw':!![]});})[_0xa55c('0x1a')](handleEntityNotFound(_0x4c7ee1,null))['then'](function(_0x1521d5){if(_0x1521d5){var _0x3ff604=_0x1521d5[_0xa55c('0x58')]&&fs[_0xa55c('0x60')](path[_0xa55c('0x61')](config['root'],_0xd02251,_[_0xa55c('0x63')](_0x1521d5[_0xa55c('0x58')])))?path['join'](config['root'],_0xd02251,_[_0xa55c('0x63')](_0x1521d5['loginLogo'])):path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0xd02251,_[_0xa55c('0x63')](_0xa55c('0x6b')));var _0x30d1c1=_0xa55c('0x65')+_[_0xa55c('0x66')](_0xa55c('0x58'));if(_0x1521d5[_0x30d1c1]||!_0x3a9910[_0xa55c('0x67')]){_0x3ff604=path['join'](config[_0xa55c('0x62')],_0xd02251,_[_0xa55c('0x63')](_0xa55c('0x6b')));}if(!fs[_0xa55c('0x60')](_0x3ff604)){throw new db['Sequelize'][(_0xa55c('0x68'))](_[_0xa55c('0x66')](_0xa55c('0x58'))+_0xa55c('0x6c'));}return _0x4c7ee1['download'](_0x3ff604);}})['catch'](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x6d')]=function(_0x428872,_0x12e3a8){return db[_0xa55c('0x47')]['find']({'where':{'id':_0x428872['params']['id']},'attributes':[_0xa55c('0x6e')]})[_0xa55c('0x1a')](respondWithResult(_0x12e3a8,null))[_0xa55c('0x24')](handleError(_0x12e3a8,null));};exports[_0xa55c('0x6f')]=function(_0x2e90a6,_0x346060,_0x239269){if(_0x2e90a6['file']&&_0x2e90a6[_0xa55c('0x54')]['filename']){_0x2e90a6[_0xa55c('0x52')]['preferred']=_0x2e90a6[_0xa55c('0x54')][_0xa55c('0x55')];}return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0x2e90a6[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x346060,null))[_0xa55c('0x1a')](saveUpdates(_0x2e90a6[_0xa55c('0x52')],null))['then'](respondWithResult(_0x346060,null))['catch'](handleError(_0x346060,null));};var utilLicense=require(_0xa55c('0x16'));exports[_0xa55c('0x70')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728='server/files/images/logos';var _0x889869={'custom':![]};return utilLicense[_0xa55c('0x5a')]()[_0xa55c('0x1a')](function(_0x3b117e){if(_0x3b117e){_0x889869=_0x3b117e;}return db[_0xa55c('0x47')][_0xa55c('0x51')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4d')]['id']},'attributes':[_0xa55c('0x56'),'loginLogo',_0xa55c('0x5b'),_0xa55c('0x6a'),_0xa55c('0x5c'),_0xa55c('0x5d'),_0xa55c('0x5e'),'defaultFavicon'],'raw':!![]});})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](function(_0x58296a){if(_0x58296a){var _0x4863d5=_0x58296a[_0xa55c('0x5b')]&&fs[_0xa55c('0x60')](path['join'](config['root'],_0x137728,_['toLower'](_0x58296a['preferred'])))?path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x137728,_[_0xa55c('0x63')](_0x58296a[_0xa55c('0x5b')])):path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x137728,_['toLower'](_0xa55c('0x71')));var _0x3b6abe=_0xa55c('0x65')+_[_0xa55c('0x66')]('preferred');if(_0x58296a[_0x3b6abe]||!_0x889869[_0xa55c('0x67')]||!_0x889869[_0xa55c('0x5b')]){_0x4863d5=path[_0xa55c('0x61')](config['root'],_0x137728,_[_0xa55c('0x63')]('default_preferred.png'));}if(!fs['existsSync'](_0x4863d5)){throw new db[(_0xa55c('0x72'))][(_0xa55c('0x68'))](_[_0xa55c('0x66')](_0xa55c('0x5b'))+_0xa55c('0x6c'));}return _0x256db0[_0xa55c('0x73')](_0x4863d5);}})[_0xa55c('0x24')](handleError(_0x256db0,null));};exports['addFavicon']=function(_0x5aa06a,_0x71bd0d,_0x2bc885){if(_0x5aa06a[_0xa55c('0x54')]&&_0x5aa06a[_0xa55c('0x54')][_0xa55c('0x55')]){_0x5aa06a[_0xa55c('0x52')][_0xa55c('0x6a')]=_0x5aa06a[_0xa55c('0x54')][_0xa55c('0x55')];}return db[_0xa55c('0x47')]['find']({'where':{'id':_0x5aa06a[_0xa55c('0x4d')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x71bd0d,null))['then'](saveUpdates(_0x5aa06a[_0xa55c('0x52')],null))['then'](respondWithResult(_0x71bd0d,null))[_0xa55c('0x24')](handleError(_0x71bd0d,null));};var utilLicense=require(_0xa55c('0x16'));exports[_0xa55c('0x74')]=function(_0x314205,_0x24e0ff,_0x554b0e){var _0x22092a=_0xa55c('0x59');var _0x1f2f86={'custom':![]};return utilLicense[_0xa55c('0x5a')]()[_0xa55c('0x1a')](function(_0x31287c){if(_0x31287c){_0x1f2f86=_0x31287c;}return db[_0xa55c('0x47')]['find']({'where':{'id':_0x314205['params']['id']},'attributes':['logo',_0xa55c('0x58'),'preferred',_0xa55c('0x6a'),_0xa55c('0x5c'),_0xa55c('0x5d'),_0xa55c('0x5e'),_0xa55c('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x24e0ff,null))[_0xa55c('0x1a')](function(_0x58baca){if(_0x58baca){var _0x210db6=_0x58baca[_0xa55c('0x6a')]&&fs[_0xa55c('0x60')](path[_0xa55c('0x61')](config['root'],_0x22092a,_[_0xa55c('0x63')](_0x58baca[_0xa55c('0x6a')])))?path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x22092a,_[_0xa55c('0x63')](_0x58baca[_0xa55c('0x6a')])):path[_0xa55c('0x61')](config[_0xa55c('0x62')],_0x22092a,_['toLower'](_0xa55c('0x75')));var _0x1538dc=_0xa55c('0x65')+_[_0xa55c('0x66')](_0xa55c('0x6a'));if(_0x58baca[_0x1538dc]||!_0x1f2f86[_0xa55c('0x67')]){_0x210db6=path['join'](config[_0xa55c('0x62')],_0x22092a,_['toLower'](_0xa55c('0x75')));}if(!fs['existsSync'](_0x210db6)){throw new db[(_0xa55c('0x72'))][(_0xa55c('0x68'))](_[_0xa55c('0x66')]('favicon')+_0xa55c('0x6c'));}return _0x24e0ff[_0xa55c('0x73')](_0x210db6);}})[_0xa55c('0x24')](handleError(_0x24e0ff,null));};exports['getDate']=function(_0x230614,_0x4c0c82){var _0x777c32={'offset':moment()[_0xa55c('0x76')]()};_0x777c32['now']=moment()[_0xa55c('0x76')](_0x777c32['offset'])[_0xa55c('0x77')](_0xa55c('0x78'));return _0x4c0c82['status'](0xc8)[_0xa55c('0x79')](_0x777c32);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b36a6c5..d3d20fc 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index ad592c2..9a0aea8 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 _0x20eb=['result','catch','ShowSetting','Setting','find','options','where','attributes','map','include','model','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x20eb,0x160));var _0xb20e=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x20eb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb20e('0x0'));var util=require('util');var moment=require(_0xb20e('0x1'));var BPromise=require('bluebird');var rs=require(_0xb20e('0x2'));var fs=require('fs');var Redis=require(_0xb20e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb20e('0x4'));var logger=require(_0xb20e('0x5'))(_0xb20e('0x6'));var config=require('../../config/environment');var jayson=require(_0xb20e('0x7'));var client=jayson[_0xb20e('0x8')][_0xb20e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe048d6,_0x3963c5,_0x362929){return new BPromise(function(_0x51edb6,_0x55dd2a){return client[_0xb20e('0xa')](_0xe048d6,_0x362929)[_0xb20e('0xb')](function(_0x5da8d7){logger[_0xb20e('0xc')](_0xb20e('0xd'),_0x3963c5,_0xb20e('0xe'));logger[_0xb20e('0xf')](_0xb20e('0x10'),_0x3963c5,_0xb20e('0xe'),JSON[_0xb20e('0x11')](_0x5da8d7));if(_0x5da8d7[_0xb20e('0x12')]){if(_0x5da8d7[_0xb20e('0x12')]['code']===0x1f4){logger[_0xb20e('0x12')](_0xb20e('0xd'),_0x3963c5,_0x5da8d7['error'][_0xb20e('0x13')]);return _0x55dd2a(_0x5da8d7[_0xb20e('0x12')][_0xb20e('0x13')]);}logger[_0xb20e('0x12')]('Setting,\x20%s,\x20%s',_0x3963c5,_0x5da8d7[_0xb20e('0x12')][_0xb20e('0x13')]);return _0x51edb6(_0x5da8d7[_0xb20e('0x12')]['message']);}else{logger[_0xb20e('0xc')](_0xb20e('0xd'),_0x3963c5,_0xb20e('0xe'));_0x51edb6(_0x5da8d7[_0xb20e('0x14')][_0xb20e('0x13')]);}})[_0xb20e('0x15')](function(_0x31bd9b){logger[_0xb20e('0x12')]('Setting,\x20%s,\x20%s',_0x3963c5,_0x31bd9b);_0x55dd2a(_0x31bd9b);});});}exports[_0xb20e('0x16')]=function(_0x12989f){var _0x1f7bbc=this;return new Promise(function(_0x33b13e,_0x1185b6){return db[_0xb20e('0x17')][_0xb20e('0x18')]({'raw':_0x12989f['options']?_0x12989f[_0xb20e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x12989f[_0xb20e('0x19')]?_0x12989f[_0xb20e('0x19')][_0xb20e('0x1a')]||null:null,'attributes':_0x12989f[_0xb20e('0x19')]?_0x12989f[_0xb20e('0x19')][_0xb20e('0x1b')]||null:null,'include':_0x12989f[_0xb20e('0x19')]?_0x12989f['options']['include']?_[_0xb20e('0x1c')](_0x12989f[_0xb20e('0x19')][_0xb20e('0x1d')],function(_0x3ffa07){return{'model':db[_0x3ffa07['model']],'as':_0x3ffa07['as'],'attributes':_0x3ffa07['attributes'],'include':_0x3ffa07[_0xb20e('0x1d')]?_[_0xb20e('0x1c')](_0x3ffa07[_0xb20e('0x1d')],function(_0x3ca70d){return{'model':db[_0x3ca70d[_0xb20e('0x1e')]],'as':_0x3ca70d['as'],'attributes':_0x3ca70d[_0xb20e('0x1b')],'include':_0x3ca70d[_0xb20e('0x1d')]?_[_0xb20e('0x1c')](_0x3ca70d['include'],function(_0x564187){return{'model':db[_0x564187['model']],'as':_0x564187['as'],'attributes':_0x564187[_0xb20e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb20e('0xb')](function(_0x16def2){logger[_0xb20e('0xc')](_0xb20e('0x16'),_0x12989f);logger[_0xb20e('0xf')]('ShowSetting',_0x12989f,JSON[_0xb20e('0x11')](_0x16def2));_0x33b13e(_0x16def2);})[_0xb20e('0x15')](function(_0x8ada0c){logger[_0xb20e('0x12')](_0xb20e('0x16'),_0x8ada0c[_0xb20e('0x13')],_0x12989f);_0x1185b6(_0x1f7bbc[_0xb20e('0x12')](0x1f4,_0x8ada0c[_0xb20e('0x13')]));});});}; \ No newline at end of file +var _0x6421=['randomstring','../../mysqldb','../../config/logger','client','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','include','map','model','attributes','lodash','util','moment','bluebird'];(function(_0x40d5cc,_0xf9d2c7){var _0x6950af=function(_0x295221){while(--_0x295221){_0x40d5cc['push'](_0x40d5cc['shift']());}};_0x6950af(++_0xf9d2c7);}(_0x6421,0x191));var _0x1642=function(_0x2cfee6,_0x21ad68){_0x2cfee6=_0x2cfee6-0x0;var _0x161725=_0x6421[_0x2cfee6];return _0x161725;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var moment=require(_0x1642('0x2'));var BPromise=require(_0x1642('0x3'));var rs=require(_0x1642('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1642('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1642('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1642('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473b4f,_0x1d1aa1,_0x5f399d){return new BPromise(function(_0x4a5365,_0x22c85e){return client['request'](_0x473b4f,_0x5f399d)[_0x1642('0x8')](function(_0x32afef){logger[_0x1642('0x9')](_0x1642('0xa'),_0x1d1aa1,'request\x20sent');logger[_0x1642('0xb')]('Setting,\x20%s,\x20%s,\x20%s',_0x1d1aa1,_0x1642('0xc'),JSON[_0x1642('0xd')](_0x32afef));if(_0x32afef[_0x1642('0xe')]){if(_0x32afef['error'][_0x1642('0xf')]===0x1f4){logger[_0x1642('0xe')](_0x1642('0xa'),_0x1d1aa1,_0x32afef['error'][_0x1642('0x10')]);return _0x22c85e(_0x32afef[_0x1642('0xe')]['message']);}logger['error'](_0x1642('0xa'),_0x1d1aa1,_0x32afef[_0x1642('0xe')][_0x1642('0x10')]);return _0x4a5365(_0x32afef[_0x1642('0xe')][_0x1642('0x10')]);}else{logger['info'](_0x1642('0xa'),_0x1d1aa1,'request\x20sent');_0x4a5365(_0x32afef['result'][_0x1642('0x10')]);}})[_0x1642('0x11')](function(_0x59acd4){logger[_0x1642('0xe')](_0x1642('0xa'),_0x1d1aa1,_0x59acd4);_0x22c85e(_0x59acd4);});});}exports[_0x1642('0x12')]=function(_0x462619){var _0x465ec3=this;return new Promise(function(_0x29703a,_0x5dd5b9){return db[_0x1642('0x13')][_0x1642('0x14')]({'raw':_0x462619[_0x1642('0x15')]?_0x462619[_0x1642('0x15')][_0x1642('0x16')]===undefined?!![]:![]:!![],'where':_0x462619['options']?_0x462619[_0x1642('0x15')]['where']||null:null,'attributes':_0x462619[_0x1642('0x15')]?_0x462619['options']['attributes']||null:null,'include':_0x462619[_0x1642('0x15')]?_0x462619[_0x1642('0x15')][_0x1642('0x17')]?_[_0x1642('0x18')](_0x462619[_0x1642('0x15')][_0x1642('0x17')],function(_0x249168){return{'model':db[_0x249168[_0x1642('0x19')]],'as':_0x249168['as'],'attributes':_0x249168[_0x1642('0x1a')],'include':_0x249168[_0x1642('0x17')]?_[_0x1642('0x18')](_0x249168[_0x1642('0x17')],function(_0x38dec1){return{'model':db[_0x38dec1['model']],'as':_0x38dec1['as'],'attributes':_0x38dec1[_0x1642('0x1a')],'include':_0x38dec1[_0x1642('0x17')]?_[_0x1642('0x18')](_0x38dec1[_0x1642('0x17')],function(_0x11ff1b){return{'model':db[_0x11ff1b[_0x1642('0x19')]],'as':_0x11ff1b['as'],'attributes':_0x11ff1b[_0x1642('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x82e443){logger[_0x1642('0x9')](_0x1642('0x12'),_0x462619);logger[_0x1642('0xb')]('ShowSetting',_0x462619,JSON['stringify'](_0x82e443));_0x29703a(_0x82e443);})[_0x1642('0x11')](function(_0x3cb5fb){logger[_0x1642('0xe')]('ShowSetting',_0x3cb5fb[_0x1642('0x10')],_0x462619);_0x5dd5b9(_0x465ec3[_0x1642('0xe')](0x1f4,_0x3cb5fb[_0x1642('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9051ac7..2f4b2c5 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(_0x17d795,_0x21056a){var _0xb02afd=function(_0x468245){while(--_0x468245){_0x17d795['push'](_0x17d795['shift']());}};_0xb02afd(++_0x21056a);}(_0x5fc3,0xa8));var _0x35fc=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x5fc3[_0xf10840];return _0x1fdf7e;};'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 _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x196ea7,_0x585485){_0x196ea7=_0x196ea7-0x0;var _0x2a0736=_0x1cb9[_0x196ea7];return _0x2a0736;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 5b281a0..25db8c2 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 _0x06c4=['randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x206994,_0x475925){var _0x2a79c6=function(_0x54029a){while(--_0x54029a){_0x206994['push'](_0x206994['shift']());}};_0x2a79c6(++_0x475925);}(_0x06c4,0x175));var _0x406c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06c4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x406c('0x0'));var rs=require(_0x406c('0x1'));module[_0x406c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x406c('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x406c('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x406c('0x4')],'defaultValue':function(){return rs[_0x406c('0x5')]();}},'phone':{'type':Sequelize[_0x406c('0x4')]},'type':{'type':Sequelize[_0x406c('0x6')](_0x406c('0x7'),_0x406c('0x8'),_0x406c('0x9'),_0x406c('0xa'),_0x406c('0xb'),_0x406c('0xc'),'bandwidth','csc','infobip',_0x406c('0xd'))},'accountSid':{'type':Sequelize[_0x406c('0x4')]},'authId':{'type':Sequelize[_0x406c('0x4')]},'authToken':{'type':Sequelize[_0x406c('0x4')]},'smsMethod':{'type':Sequelize[_0x406c('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x406c('0x4')]},'password':{'type':Sequelize[_0x406c('0x4')]},'apiKey':{'type':Sequelize[_0x406c('0x4')]},'applicationId':{'type':Sequelize[_0x406c('0x4')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x406c('0x4')]},'deliveryReport':{'type':Sequelize[_0x406c('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x406c('0xf')],'defaultValue':function(){return _0x406c('0x10');}},'notificationSound':{'type':Sequelize[_0x406c('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x406c('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x406c('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x406c('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x406c('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x406c('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x406c('0x11')],'comment':_0x406c('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x406c('0x13'),'set':function(_0x171f4d){if(!_0x171f4d)this[_0x406c('0x14')](_0x406c('0x15'),null);this[_0x406c('0x14')]('mandatoryDisposition',_0x171f4d);}}}; \ No newline at end of file +var _0x8784=['clicksend','plivo','clickatell','bandwidth','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','sequelize','exports','name','STRING','generate','ENUM','skebby'];(function(_0x136a60,_0x5bb51b){var _0xc72bc2=function(_0xdc9201){while(--_0xdc9201){_0x136a60['push'](_0x136a60['shift']());}};_0xc72bc2(++_0x5bb51b);}(_0x8784,0xca));var _0x4878=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x8784[_0x3f3bad];return _0x4f0801;};'use strict';var Sequelize=require(_0x4878('0x0'));var rs=require('randomstring');module[_0x4878('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4878('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x4878('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4878('0x3')],'defaultValue':function(){return rs[_0x4878('0x4')]();}},'phone':{'type':Sequelize[_0x4878('0x3')]},'type':{'type':Sequelize[_0x4878('0x5')]('twilio',_0x4878('0x6'),'connectel',_0x4878('0x7'),_0x4878('0x8'),_0x4878('0x9'),_0x4878('0xa'),'csc',_0x4878('0xb'),_0x4878('0xc'))},'accountSid':{'type':Sequelize[_0x4878('0x3')]},'authId':{'type':Sequelize[_0x4878('0x3')]},'authToken':{'type':Sequelize[_0x4878('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x4878('0x3')]},'deliveryReport':{'type':Sequelize[_0x4878('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4878('0xe')],'defaultValue':function(){return _0x4878('0xf');}},'notificationSound':{'type':Sequelize[_0x4878('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4878('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4878('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4878('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4878('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4878('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4878('0x10')],'comment':_0x4878('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x4878('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x597164){if(!_0x597164)this[_0x4878('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x597164);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index f493698..27c8b23 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 _0xdfea=['../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','SmsAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','mobile','from','Body','messageId','MessageSid','sender','text','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','defaults','SmsInteraction','spread','interaction','created','applications','close','unmanaged','SmsMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','twilio','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','map','priority','getApplications','Contact','Owner','internal','Tag','Tags','tag','List','ListId','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','skebby','statusInt','requestid','message_id','status_code','DELIVERED','groupName','redif','inspect','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xbab353,_0x37e159){var _0x56871e=function(_0x474f77){while(--_0x474f77){_0xbab353['push'](_0xbab353['shift']());}};_0x56871e(++_0x37e159);}(_0xdfea,0xd0));var _0xadfe=function(_0x2b37e6,_0x412827){_0x2b37e6=_0x2b37e6-0x0;var _0xa77c38=_0xdfea[_0x2b37e6];return _0xa77c38;};'use strict';var emlformat=require(_0xadfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadfe('0x2'));var moment=require(_0xadfe('0x3'));var BPromise=require(_0xadfe('0x4'));var Mustache=require(_0xadfe('0x5'));var util=require(_0xadfe('0x6'));var path=require('path');var sox=require(_0xadfe('0x7'));var csv=require(_0xadfe('0x8'));var ejs=require(_0xadfe('0x9'));var fs=require('fs');var fs_extra=require(_0xadfe('0xa'));var _=require(_0xadfe('0xb'));var squel=require('squel');var crypto=require(_0xadfe('0xc'));var jsforce=require(_0xadfe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xadfe('0x8'));var querystring=require('querystring');var Papa=require(_0xadfe('0xe'));var Redis=require('ioredis');var authService=require(_0xadfe('0xf'));var qs=require(_0xadfe('0x10'));var as=require(_0xadfe('0x11'));var hardwareService=require(_0xadfe('0x12'));var logger=require(_0xadfe('0x13'))(_0xadfe('0x14'));var utils=require(_0xadfe('0x15'));var config=require(_0xadfe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xadfe('0x17'))['db'];config[_0xadfe('0x18')]=_['defaults'](config[_0xadfe('0x18')],{'host':_0xadfe('0x19'),'port':0x18eb});var socket=require(_0xadfe('0x1a'))(new Redis(config[_0xadfe('0x18')]));require(_0xadfe('0x1b'))[_0xadfe('0x1c')](socket);var jayson=require(_0xadfe('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x354ab8,_0x118b28,_0x53e54f,_0x26f049){return new BPromise(function(_0x41f72c,_0x559682){var _0x4c0cfb=_0x26f049||client;return _0x4c0cfb[_0xadfe('0x1e')](_0x354ab8,_0x53e54f)[_0xadfe('0x1f')](function(_0x547e7b){logger[_0xadfe('0x20')](_0xadfe('0x21'),_0x118b28,_0xadfe('0x22'));logger[_0xadfe('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x118b28,_0xadfe('0x22'),JSON['stringify'](_0x547e7b));if(_0x547e7b[_0xadfe('0x24')]){if(_0x547e7b[_0xadfe('0x24')]['code']===0x1f4){logger[_0xadfe('0x24')](_0xadfe('0x21'),_0x118b28,_0x547e7b[_0xadfe('0x24')]['message']);return _0x559682(_0x547e7b['error'][_0xadfe('0x25')]);}logger[_0xadfe('0x24')](_0xadfe('0x21'),_0x118b28,_0x547e7b['error'][_0xadfe('0x25')]);return _0x41f72c(_0x547e7b[_0xadfe('0x24')][_0xadfe('0x25')]);}else{logger[_0xadfe('0x20')]('SmsAccount,\x20%s,\x20%s',_0x118b28,_0xadfe('0x22'));_0x41f72c(_0x547e7b[_0xadfe('0x26')][_0xadfe('0x25')]);}})[_0xadfe('0x27')](function(_0x42d4b1){logger[_0xadfe('0x24')]('SmsAccount,\x20%s,\x20%s',_0x118b28,_0x42d4b1);_0x559682(_0x42d4b1);});});}function respondWithStatusCode(_0x4a6adc,_0x80d8){_0x80d8=_0x80d8||0xcc;return function(_0x313c96){if(_0x313c96){return _0x4a6adc[_0xadfe('0x28')](_0x80d8);}return _0x4a6adc[_0xadfe('0x29')](_0x80d8)[_0xadfe('0x2a')]();};}function respondWithResult(_0x4f6663,_0x4b51a3){_0x4b51a3=_0x4b51a3||0xc8;return function(_0x30cf51){if(_0x30cf51){return _0x4f6663[_0xadfe('0x29')](_0x4b51a3)[_0xadfe('0x2b')](_0x30cf51);}};}function respondWithFilteredResult(_0x2ff8fb,_0x273666){return function(_0x47e35f){if(_0x47e35f){var _0x1399d0=typeof _0x273666[_0xadfe('0x2c')]===_0xadfe('0x2d')&&typeof _0x273666['limit']==='undefined';var _0x159e76=_0x47e35f[_0xadfe('0x2e')];var _0x5d700a=_0x1399d0?0x0:_0x273666[_0xadfe('0x2c')];var _0x19e108=_0x1399d0?_0x47e35f[_0xadfe('0x2e')]:_0x273666[_0xadfe('0x2c')]+_0x273666[_0xadfe('0x2f')];var _0xf1bddd;if(_0x19e108>=_0x159e76){_0x19e108=_0x159e76;_0xf1bddd=0xc8;}else{_0xf1bddd=0xce;}_0x2ff8fb['status'](_0xf1bddd);return _0x2ff8fb[_0xadfe('0x30')](_0xadfe('0x31'),_0x5d700a+'-'+_0x19e108+'/'+_0x159e76)[_0xadfe('0x2b')](_0x47e35f);}return null;};}function patchUpdates(_0x4b7cf6){return function(_0x36a869){try{jsonpatch[_0xadfe('0x32')](_0x36a869,_0x4b7cf6,!![]);}catch(_0x3a6535){return BPromise[_0xadfe('0x33')](_0x3a6535);}return _0x36a869[_0xadfe('0x34')]();};}function saveUpdates(_0x2da548,_0x17127f){return function(_0x5c5e18){if(_0x5c5e18){return _0x5c5e18[_0xadfe('0x35')](_0x2da548)[_0xadfe('0x1f')](function(_0x51950e){return _0x51950e;});}return null;};}function removeEntity(_0x927dcb,_0x185196){return function(_0x4ea29d){if(_0x4ea29d){return _0x4ea29d[_0xadfe('0x36')]()['then'](function(){var _0x24a7d9=_0x4ea29d[_0xadfe('0x37')]({'plain':!![]});var _0x3a5357='SmsAccounts';return db[_0xadfe('0x38')][_0xadfe('0x36')]({'where':{'type':_0x3a5357,'resourceId':_0x24a7d9['id']}})[_0xadfe('0x1f')](function(){return _0x4ea29d;});})[_0xadfe('0x1f')](function(){_0x927dcb['status'](0xcc)[_0xadfe('0x2a')]();});}};}function handleEntityNotFound(_0xd3507d,_0xcbec8d){return function(_0x885fbf){if(!_0x885fbf){_0xd3507d[_0xadfe('0x28')](0x194);}return _0x885fbf;};}function handleError(_0x2bcb7e,_0x335c1a){_0x335c1a=_0x335c1a||0x1f4;return function(_0x1c26ef){logger[_0xadfe('0x24')](_0x1c26ef[_0xadfe('0x39')]);if(_0x1c26ef[_0xadfe('0x3a')]){delete _0x1c26ef[_0xadfe('0x3a')];}_0x2bcb7e['status'](_0x335c1a)[_0xadfe('0x3b')](_0x1c26ef);};}exports[_0xadfe('0x3c')]=function(_0x3f205d,_0x6d6020){var _0x50a28c={'include':[{'model':db[_0xadfe('0x3d')],'as':_0xadfe('0x3e')}]},_0x47f1f8={},_0xd25cf={'count':0x0,'rows':[]};var _0x577af9=_['map'](db[_0xadfe('0x3f')][_0xadfe('0x40')],function(_0x2c319d){return{'name':_0x2c319d[_0xadfe('0x41')],'type':_0x2c319d[_0xadfe('0x42')][_0xadfe('0x43')]};});_0x47f1f8[_0xadfe('0x44')]=_['map'](_0x577af9,_0xadfe('0x3a'));_0x47f1f8[_0xadfe('0x45')]=_[_0xadfe('0x46')](_0x3f205d[_0xadfe('0x45')]);_0x47f1f8['filters']=_[_0xadfe('0x47')](_0x47f1f8[_0xadfe('0x44')],_0x47f1f8['query']);_0x50a28c[_0xadfe('0x48')]=_['intersection'](_0x47f1f8['model'],qs['fields'](_0x3f205d[_0xadfe('0x45')][_0xadfe('0x49')]));_0x50a28c['attributes']=_0x50a28c[_0xadfe('0x48')][_0xadfe('0x4a')]?_0x50a28c['attributes']:_0x47f1f8[_0xadfe('0x44')];if(!_0x3f205d['query']['hasOwnProperty'](_0xadfe('0x4b'))){_0x50a28c[_0xadfe('0x2f')]=qs[_0xadfe('0x2f')](_0x3f205d[_0xadfe('0x45')][_0xadfe('0x2f')]);_0x50a28c['offset']=qs[_0xadfe('0x2c')](_0x3f205d[_0xadfe('0x45')][_0xadfe('0x2c')]);}_0x50a28c[_0xadfe('0x4c')]=qs[_0xadfe('0x4d')](_0x3f205d[_0xadfe('0x45')][_0xadfe('0x4d')]);_0x50a28c[_0xadfe('0x4e')]=qs[_0xadfe('0x4f')](_[_0xadfe('0x50')](_0x3f205d['query'],_0x47f1f8[_0xadfe('0x4f')]),_0x577af9);if(_0x3f205d[_0xadfe('0x45')][_0xadfe('0x51')]){_0x50a28c[_0xadfe('0x4e')]=_[_0xadfe('0x52')](_0x50a28c[_0xadfe('0x4e')],{'$or':_['map'](_0x577af9,function(_0x9a79b2){if(_0x9a79b2[_0xadfe('0x42')]!==_0xadfe('0x53')){var _0x1abf1a={};_0x1abf1a[_0x9a79b2[_0xadfe('0x3a')]]={'$like':'%'+_0x3f205d[_0xadfe('0x45')][_0xadfe('0x51')]+'%'};return _0x1abf1a;}})});}_0x50a28c=_[_0xadfe('0x52')]({},_0x50a28c,_0x3f205d[_0xadfe('0x54')]);var _0x45e08a={'where':_0x50a28c[_0xadfe('0x4e')]};return db[_0xadfe('0x3f')][_0xadfe('0x2e')](_0x45e08a)[_0xadfe('0x1f')](function(_0x3c5f9b){_0xd25cf[_0xadfe('0x2e')]=_0x3c5f9b;if(_0x3f205d[_0xadfe('0x45')]['includeAll']){_0x50a28c[_0xadfe('0x55')]=[{'all':!![]}];}return db[_0xadfe('0x3f')][_0xadfe('0x56')](_0x50a28c);})[_0xadfe('0x1f')](function(_0x5a80fc){_0xd25cf[_0xadfe('0x57')]=_0x5a80fc;return _0xd25cf;})[_0xadfe('0x1f')](respondWithFilteredResult(_0x6d6020,_0x50a28c))[_0xadfe('0x27')](handleError(_0x6d6020,null));};exports[_0xadfe('0x58')]=function(_0x1425a8,_0x2df5d2){var _0x27bb59={'raw':![],'where':{'id':_0x1425a8[_0xadfe('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x55bd49={};_0x55bd49[_0xadfe('0x44')]=_[_0xadfe('0x46')](db['SmsAccount'][_0xadfe('0x40')]);_0x55bd49[_0xadfe('0x45')]=_[_0xadfe('0x46')](_0x1425a8[_0xadfe('0x45')]);_0x55bd49[_0xadfe('0x4f')]=_[_0xadfe('0x47')](_0x55bd49[_0xadfe('0x44')],_0x55bd49['query']);_0x27bb59['attributes']=_[_0xadfe('0x47')](_0x55bd49['model'],qs[_0xadfe('0x49')](_0x1425a8[_0xadfe('0x45')][_0xadfe('0x49')]));_0x27bb59[_0xadfe('0x48')]=_0x27bb59[_0xadfe('0x48')]['length']?_0x27bb59[_0xadfe('0x48')]:_0x55bd49[_0xadfe('0x44')];if(_0x1425a8['query'][_0xadfe('0x5a')]){_0x27bb59[_0xadfe('0x55')]=[{'all':!![]}];}_0x27bb59=_[_0xadfe('0x52')]({},_0x27bb59,_0x1425a8['options']);return db[_0xadfe('0x3f')][_0xadfe('0x5b')](_0x27bb59)[_0xadfe('0x1f')](handleEntityNotFound(_0x2df5d2,null))[_0xadfe('0x1f')](respondWithResult(_0x2df5d2,null))['catch'](handleError(_0x2df5d2,null));};exports[_0xadfe('0x5c')]=function(_0x60575e,_0x2cbd9e){return db[_0xadfe('0x3f')][_0xadfe('0x5c')](_0x60575e['body'],{})[_0xadfe('0x1f')](function(_0x45eb16){var _0xddfcec=_0x60575e[_0xadfe('0x5d')][_0xadfe('0x37')]({'plain':!![]});if(!_0xddfcec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xddfcec[_0xadfe('0x5e')]===_0xadfe('0x5d')){var _0x36cdf2=_0x45eb16['get']({'plain':!![]});var _0x4cae14=_0xadfe('0x5f');return db[_0xadfe('0x60')][_0xadfe('0x5b')]({'where':{'name':_0x4cae14,'userProfileId':_0xddfcec['userProfileId']},'raw':!![]})[_0xadfe('0x1f')](function(_0x5d70a6){if(_0x5d70a6&&_0x5d70a6[_0xadfe('0x61')]===0x0){return db['UserProfileResource'][_0xadfe('0x5c')]({'name':_0x36cdf2['name'],'resourceId':_0x36cdf2['id'],'type':_0x5d70a6[_0xadfe('0x3a')],'sectionId':_0x5d70a6['id']},{})[_0xadfe('0x1f')](function(){return _0x45eb16;});}else{return _0x45eb16;}})[_0xadfe('0x27')](function(_0x211ddd){logger['error'](_0xadfe('0x62'),_0x211ddd);throw _0x211ddd;});}return _0x45eb16;})[_0xadfe('0x1f')](respondWithResult(_0x2cbd9e,0xc9))['catch'](handleError(_0x2cbd9e,null));};exports[_0xadfe('0x35')]=function(_0x51c12a,_0x6f950a){if(_0x51c12a[_0xadfe('0x63')]['id']){delete _0x51c12a['body']['id'];}return db[_0xadfe('0x3f')][_0xadfe('0x5b')]({'where':{'id':_0x51c12a[_0xadfe('0x59')]['id']},'include':[{'model':db[_0xadfe('0x3d')],'as':_0xadfe('0x3e')}]})['then'](handleEntityNotFound(_0x6f950a,null))[_0xadfe('0x1f')](saveUpdates(_0x51c12a['body'],null))[_0xadfe('0x1f')](respondWithResult(_0x6f950a,null))[_0xadfe('0x27')](handleError(_0x6f950a,null));};exports[_0xadfe('0x36')]=function(_0x39e317,_0x51a5ae){return db[_0xadfe('0x3f')][_0xadfe('0x5b')]({'where':{'id':_0x39e317[_0xadfe('0x59')]['id']}})['then'](handleEntityNotFound(_0x51a5ae,null))[_0xadfe('0x1f')](removeEntity(_0x51a5ae,null))[_0xadfe('0x27')](handleError(_0x51a5ae,null));};exports[_0xadfe('0x64')]=function(_0xcca820,_0x160829){return db[_0xadfe('0x3f')][_0xadfe('0x64')]()[_0xadfe('0x1f')](respondWithResult(_0x160829,null))[_0xadfe('0x27')](handleError(_0x160829,null));};exports[_0xadfe('0x65')]=function(_0xb93785,_0x505681,_0xc59ff3){if(_0xb93785[_0xadfe('0x63')]['id']){delete _0xb93785[_0xadfe('0x63')]['id'];}return db[_0xadfe('0x3f')][_0xadfe('0x5b')]({'where':{'id':_0xb93785[_0xadfe('0x59')]['id']}})['then'](handleEntityNotFound(_0x505681,null))[_0xadfe('0x1f')](function(_0x4b87e5){if(_0x4b87e5){_0xb93785[_0xadfe('0x63')]['SmsAccountId']=_0x4b87e5['id'];return db[_0xadfe('0x66')][_0xadfe('0x5c')](_0xb93785[_0xadfe('0x63')]);}})[_0xadfe('0x1f')](respondWithResult(_0x505681,null))[_0xadfe('0x27')](handleError(_0x505681,null));};exports[_0xadfe('0x67')]=function(_0x393f37,_0x4ec729,_0x1d7db8){var _0x15b31e={'raw':![],'where':{}};var _0x5f4d00={};var _0x416dda={'count':0x0,'rows':[]};return db[_0xadfe('0x3f')][_0xadfe('0x68')]({'where':{'id':_0x393f37[_0xadfe('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ec729,null))[_0xadfe('0x1f')](function(_0x2f6ce7){if(_0x2f6ce7){_0x5f4d00['model']=_[_0xadfe('0x46')](db['Disposition'][_0xadfe('0x40')]);_0x5f4d00[_0xadfe('0x45')]=_['keys'](_0x393f37['query']);_0x5f4d00[_0xadfe('0x4f')]=_[_0xadfe('0x47')](_0x5f4d00[_0xadfe('0x44')],_0x5f4d00[_0xadfe('0x45')]);_0x15b31e[_0xadfe('0x48')]=_['intersection'](_0x5f4d00[_0xadfe('0x44')],qs[_0xadfe('0x49')](_0x393f37['query'][_0xadfe('0x49')]));_0x15b31e['attributes']=_0x15b31e[_0xadfe('0x48')][_0xadfe('0x4a')]?_0x15b31e[_0xadfe('0x48')]:_0x5f4d00['model'];if(!_0x393f37[_0xadfe('0x45')][_0xadfe('0x69')]('nolimit')){_0x15b31e[_0xadfe('0x2f')]=qs[_0xadfe('0x2f')](_0x393f37['query'][_0xadfe('0x2f')]);_0x15b31e['offset']=qs['offset'](_0x393f37[_0xadfe('0x45')][_0xadfe('0x2c')]);}_0x15b31e[_0xadfe('0x4c')]=qs['sort'](_0x393f37[_0xadfe('0x45')][_0xadfe('0x4d')]);_0x15b31e[_0xadfe('0x4e')]=qs[_0xadfe('0x4f')](_['pick'](_0x393f37[_0xadfe('0x45')],_0x5f4d00[_0xadfe('0x4f')]));_0x15b31e[_0xadfe('0x4e')][_0xadfe('0x6a')]=_0x2f6ce7['id'];if(_0x393f37[_0xadfe('0x45')][_0xadfe('0x51')]){_0x15b31e[_0xadfe('0x4e')]=_[_0xadfe('0x52')](_0x15b31e[_0xadfe('0x4e')],{'$or':_['map'](_0x15b31e[_0xadfe('0x48')],function(_0x33ba96){var _0x233e7f={};_0x233e7f[_0x33ba96]={'$like':'%'+_0x393f37[_0xadfe('0x45')]['filter']+'%'};return _0x233e7f;})});}_0x15b31e=_[_0xadfe('0x52')]({},_0x15b31e,_0x393f37[_0xadfe('0x54')]);return db[_0xadfe('0x66')]['count']({'where':_0x15b31e[_0xadfe('0x4e')]})[_0xadfe('0x1f')](function(_0x56ac65){_0x416dda[_0xadfe('0x2e')]=_0x56ac65;if(_0x393f37[_0xadfe('0x45')][_0xadfe('0x5a')]){_0x15b31e[_0xadfe('0x55')]=[{'all':!![]}];}return db[_0xadfe('0x66')][_0xadfe('0x56')](_0x15b31e);})[_0xadfe('0x1f')](function(_0x3715d3){_0x416dda['rows']=_0x3715d3;return _0x416dda;});}})[_0xadfe('0x1f')](respondWithFilteredResult(_0x4ec729,_0x15b31e))['catch'](handleError(_0x4ec729,null));};exports[_0xadfe('0x6b')]=function(_0x2b839c,_0x3efbbe,_0x1b76d7){return db[_0xadfe('0x3f')]['find']({'where':{'id':_0x2b839c[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x3efbbe,null))['then'](function(_0x3bbf9b){if(_0x3bbf9b){return _0x3bbf9b[_0xadfe('0x6b')](_0x2b839c[_0xadfe('0x45')][_0xadfe('0x6c')]);}})['then'](respondWithStatusCode(_0x3efbbe,null))['catch'](handleError(_0x3efbbe,null));};exports['addAnswer']=function(_0x3cb468,_0x1b23d5,_0x383834){if(_0x3cb468[_0xadfe('0x63')]['id']){delete _0x3cb468[_0xadfe('0x63')]['id'];}return db[_0xadfe('0x3f')]['find']({'where':{'id':_0x3cb468[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x1b23d5,null))[_0xadfe('0x1f')](function(_0x4480fd){if(_0x4480fd){_0x3cb468[_0xadfe('0x63')][_0xadfe('0x6a')]=_0x4480fd['id'];return db[_0xadfe('0x6d')][_0xadfe('0x5c')](_0x3cb468[_0xadfe('0x63')]);}})['then'](respondWithResult(_0x1b23d5,null))[_0xadfe('0x27')](handleError(_0x1b23d5,null));};exports[_0xadfe('0x6e')]=function(_0x37ff2f,_0x2b7f08,_0x50cec1){var _0x42fa04={'raw':![],'where':{}};var _0x42ac02={};var _0x1126cd={'count':0x0,'rows':[]};return db[_0xadfe('0x3f')][_0xadfe('0x68')]({'where':{'id':_0x37ff2f[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x2b7f08,null))[_0xadfe('0x1f')](function(_0x111243){if(_0x111243){_0x42ac02[_0xadfe('0x44')]=_[_0xadfe('0x46')](db[_0xadfe('0x6d')][_0xadfe('0x40')]);_0x42ac02[_0xadfe('0x45')]=_[_0xadfe('0x46')](_0x37ff2f['query']);_0x42ac02['filters']=_[_0xadfe('0x47')](_0x42ac02[_0xadfe('0x44')],_0x42ac02['query']);_0x42fa04[_0xadfe('0x48')]=_[_0xadfe('0x47')](_0x42ac02[_0xadfe('0x44')],qs[_0xadfe('0x49')](_0x37ff2f[_0xadfe('0x45')][_0xadfe('0x49')]));_0x42fa04[_0xadfe('0x48')]=_0x42fa04['attributes'][_0xadfe('0x4a')]?_0x42fa04['attributes']:_0x42ac02['model'];if(!_0x37ff2f[_0xadfe('0x45')]['hasOwnProperty']('nolimit')){_0x42fa04[_0xadfe('0x2f')]=qs[_0xadfe('0x2f')](_0x37ff2f[_0xadfe('0x45')][_0xadfe('0x2f')]);_0x42fa04[_0xadfe('0x2c')]=qs[_0xadfe('0x2c')](_0x37ff2f['query'][_0xadfe('0x2c')]);}_0x42fa04[_0xadfe('0x4c')]=qs['sort'](_0x37ff2f[_0xadfe('0x45')][_0xadfe('0x4d')]);_0x42fa04[_0xadfe('0x4e')]=qs['filters'](_[_0xadfe('0x50')](_0x37ff2f[_0xadfe('0x45')],_0x42ac02[_0xadfe('0x4f')]));_0x42fa04[_0xadfe('0x4e')][_0xadfe('0x6a')]=_0x111243['id'];if(_0x37ff2f['query'][_0xadfe('0x51')]){_0x42fa04[_0xadfe('0x4e')]=_[_0xadfe('0x52')](_0x42fa04['where'],{'$or':_['map'](_0x42fa04['attributes'],function(_0x56144c){var _0x2155a0={};_0x2155a0[_0x56144c]={'$like':'%'+_0x37ff2f['query'][_0xadfe('0x51')]+'%'};return _0x2155a0;})});}_0x42fa04=_[_0xadfe('0x52')]({},_0x42fa04,_0x37ff2f[_0xadfe('0x54')]);return db[_0xadfe('0x6d')][_0xadfe('0x2e')]({'where':_0x42fa04[_0xadfe('0x4e')]})[_0xadfe('0x1f')](function(_0x472f2b){_0x1126cd[_0xadfe('0x2e')]=_0x472f2b;if(_0x37ff2f[_0xadfe('0x45')]['includeAll']){_0x42fa04[_0xadfe('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xadfe('0x56')](_0x42fa04);})[_0xadfe('0x1f')](function(_0x4eb832){_0x1126cd[_0xadfe('0x57')]=_0x4eb832;return _0x1126cd;});}})['then'](respondWithFilteredResult(_0x2b7f08,_0x42fa04))['catch'](handleError(_0x2b7f08,null));};exports[_0xadfe('0x6f')]=function(_0x53a164,_0x3e3eb4,_0x1d627){return db['SmsAccount'][_0xadfe('0x5b')]({'where':{'id':_0x53a164[_0xadfe('0x59')]['id']}})['then'](handleEntityNotFound(_0x3e3eb4,null))['then'](function(_0x2d0598){if(_0x2d0598){return _0x2d0598[_0xadfe('0x6f')](_0x53a164['query'][_0xadfe('0x6c')]);}})[_0xadfe('0x1f')](respondWithStatusCode(_0x3e3eb4,null))[_0xadfe('0x27')](handleError(_0x3e3eb4,null));};exports[_0xadfe('0x70')]=function(_0xe6688e,_0x6da19a,_0x5a1d9d){var _0x4468fe={'channel':'sms'};var _0x1c5c17=[];var _0xe9b1f3=[];var _0x1952c2={};return db[_0xadfe('0x3f')]['find']({'where':{'id':_0xe6688e[_0xadfe('0x59')]['id']},'include':[{'model':db[_0xadfe('0x71')],'as':_0xadfe('0x72')}]})['then'](handleEntityNotFound(_0x6da19a,null))[_0xadfe('0x1f')](function(_0x112e21){_0x4468fe['account']=_0x112e21;_0x4468fe['applications']=_[_0xadfe('0x73')](_0x112e21['Applications'],['priority'],[_0xadfe('0x74')]);if(_0x4468fe[_0xadfe('0x75')][_0xadfe('0x72')]){delete _0x4468fe[_0xadfe('0x75')][_0xadfe('0x72')];}return db[_0xadfe('0x76')][_0xadfe('0x64')]();})[_0xadfe('0x1f')](function(_0x17eeb2){if(!_0x17eeb2){throw new db[(_0xadfe('0x77'))][(_0xadfe('0x78'))](_0xadfe('0x79'));}_0x1c5c17=_['difference'](_[_0xadfe('0x46')](_0x17eeb2),[_0xadfe('0x7a'),'updatedAt']);_0xe9b1f3=_['difference'](_[_0xadfe('0x46')](_0x17eeb2),[_0xadfe('0x7a'),_0xadfe('0x7b'),_0xadfe('0x7c'),'ListId']);_0x4468fe[_0xadfe('0x63')]={'mapKey':_0xadfe('0x7d')};if(_0x4468fe[_0xadfe('0x75')][_0xadfe('0x42')]){switch(_0x4468fe[_0xadfe('0x75')][_0xadfe('0x42')]){case'twilio':_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')]=_0xe6688e[_0xadfe('0x63')]['From'];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e['body'][_0xadfe('0x7f')];_0x4468fe['body'][_0xadfe('0x80')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x81')];break;case'skebby':_0x4468fe['body'][_0xadfe('0x7e')]='+'+_0xe6688e[_0xadfe('0x63')][_0xadfe('0x82')];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x83')];break;case _0xadfe('0x84'):_0x4468fe[_0xadfe('0x63')]['from']=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x7e')];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x25')];break;case _0xadfe('0x85'):_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')]=_0xe6688e['body']['from'];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e['body'][_0xadfe('0x63')];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x80')]=_0xe6688e[_0xadfe('0x63')]['message_id'];break;case _0xadfe('0x86'):_0x4468fe['body'][_0xadfe('0x7e')]=_0xe6688e[_0xadfe('0x63')]['From'];_0x4468fe[_0xadfe('0x63')]['body']=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x87')];_0x4468fe['body'][_0xadfe('0x80')]=_0xe6688e['body'][_0xadfe('0x88')];break;case _0xadfe('0x89'):_0x4468fe[_0xadfe('0x63')]['from']='+'+_0xe6688e[_0xadfe('0x63')]['results'][0x0][_0xadfe('0x7e')];_0x4468fe[_0xadfe('0x63')]['body']=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x8a')][0x0]['text'];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x80')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x8a')][0x0][_0xadfe('0x80')];break;case _0xadfe('0x8b'):_0x4468fe[_0xadfe('0x63')]['from']=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x8c')];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x8d')][_0xadfe('0x25')];break;case'clickatell':_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x8e')];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x83')];_0x4468fe[_0xadfe('0x63')]['messageId']=_0xe6688e[_0xadfe('0x63')][_0xadfe('0x8f')];break;case _0xadfe('0x90'):_0x4468fe[_0xadfe('0x63')][_0xadfe('0x80')]=_0xe6688e[_0xadfe('0x63')][0x0][_0xadfe('0x25')]['id'];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')]=_0xe6688e[_0xadfe('0x63')][0x0][_0xadfe('0x25')][_0xadfe('0x7e')];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x63')]=_0xe6688e[_0xadfe('0x63')][0x0][_0xadfe('0x25')]['text'];break;case _0xadfe('0x91'):_0x4468fe['body']['from']=_0xe6688e['body'][_0xadfe('0x7e')];_0x4468fe['body']['body']=_0xe6688e[_0xadfe('0x63')]['message'];_0x4468fe[_0xadfe('0x63')][_0xadfe('0x80')]=_0xe6688e['body'][_0xadfe('0x92')];break;}}if(_0x4468fe[_0xadfe('0x63')]['id']){delete _0x4468fe['body']['id'];}if(_[_0xadfe('0x93')](_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')])){throw new db['Sequelize']['ValidationError'](_0xadfe('0x94'));}if(_['isNil'](_0x4468fe['body'][_0xadfe('0x63')])||_0x4468fe[_0xadfe('0x63')]['body']===''){throw new db[(_0xadfe('0x77'))][(_0xadfe('0x78'))](_0xadfe('0x95'));}if(_[_0xadfe('0x93')](_0x4468fe[_0xadfe('0x63')][_0xadfe('0x96')])){throw new db[(_0xadfe('0x77'))][(_0xadfe('0x78'))](_0xadfe('0x97')+_0xe9b1f3);}if(!_[_0xadfe('0x98')](_0xe9b1f3,_0x4468fe['body'][_0xadfe('0x96')])){throw new db['Sequelize'][(_0xadfe('0x78'))](_0xadfe('0x99')+_0xe9b1f3);}_0x1952c2[_0x4468fe[_0xadfe('0x63')][_0xadfe('0x96')]]=_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')];return db[_0xadfe('0x9a')]['find']({'where':{'id':_0x4468fe[_0xadfe('0x75')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xadfe('0x9b'),'where':_0x1952c2,'limit':0x1,'order':[[_0xadfe('0x7b'),_0xadfe('0x9c')]]}]});})[_0xadfe('0x1f')](handleEntityNotFound(_0x6da19a,null))[_0xadfe('0x1f')](function(_0x487367){if(_0x487367){_0x4468fe[_0xadfe('0x9d')]=_['omit'](_0x487367,[_0xadfe('0x9b')]);if(_0x487367[_0xadfe('0x9b')]['length']){return _0x487367[_0xadfe('0x9b')][0x0];}var _0x1304cd=_[_0xadfe('0x9e')](_0x4468fe['body'],{'firstName':_0x4468fe['body'][_0xadfe('0x7e')],'ListId':_0x487367['id']});_0x1304cd[_0x4468fe['body'][_0xadfe('0x96')]]=_0x4468fe[_0xadfe('0x63')][_0xadfe('0x7e')];return db[_0xadfe('0x76')][_0xadfe('0x5c')](_0x1304cd,{'fields':_0x1c5c17,'raw':!![]});}})[_0xadfe('0x1f')](handleEntityNotFound(_0x6da19a,null))[_0xadfe('0x1f')](function(_0x574651){if(_0x574651){_0x4468fe['contact']=_0x574651;var _0xe64f70={'ContactId':_0x574651['id'],'phone':_0x4468fe['body'][_0xadfe('0x7e')],'SmsAccountId':_0xe6688e[_0xadfe('0x59')]['id']};var _0x541981={'ContactId':_0x574651['id'],'SmsAccountId':_0xe6688e['params']['id'],'closed':![]};return db[_0xadfe('0x9f')]['find']({'where':_0x541981})[_0xadfe('0x1f')](function(_0x4d8f1f){if(_0x4d8f1f){return[_0x4d8f1f,![]];}return db[_0xadfe('0x9f')]['create'](_0xe64f70)[_0xadfe('0x1f')](function(_0x2fabd5){return[_0x2fabd5,!![]];});});}})[_0xadfe('0xa0')](function(_0x55c942,_0x25fe4a){_0x4468fe[_0xadfe('0xa1')]=_0x55c942[_0xadfe('0x37')]({'plain':!![]});_0x4468fe['interaction'][_0xadfe('0xa2')]=![];if(_0x25fe4a){if(_0x4468fe['account']['autoclose']){_0x4468fe[_0xadfe('0xa3')]['push']({'id':0x0,'priority':_0x4468fe[_0xadfe('0xa3')]['length']+0x1,'app':_0xadfe('0xa4'),'appdata':_0xadfe('0xa5'),'interval':'*,*,*,*'});}_0x4468fe[_0xadfe('0xa1')][_0xadfe('0xa2')]=!![];}return db[_0xadfe('0xa6')]['create']({'phone':_0x4468fe['body'][_0xadfe('0x7e')],'messageId':_0x4468fe[_0xadfe('0x63')][_0xadfe('0x80')],'body':_0x4468fe['body'][_0xadfe('0x63')],'SmsAccountId':_0xe6688e[_0xadfe('0x59')]['id'],'SmsInteractionId':_0x55c942['id'],'direction':'in','ContactId':_0x55c942['ContactId'],'AttachmentId':_0x4468fe['body'][_0xadfe('0xa7')]});})[_0xadfe('0x1f')](function(_0xdf2cc7){_0x4468fe[_0xadfe('0x25')]=_0xdf2cc7;if(_0x4468fe[_0xadfe('0xa1')][_0xadfe('0xa8')]){return db[_0xadfe('0xa9')][_0xadfe('0x5b')]({'attributes':['id',_0xadfe('0x3a')],'where':{'id':_0x4468fe[_0xadfe('0xa1')][_0xadfe('0xa8')]}})['then'](function(_0x2f06d3){if(_0x2f06d3){_0x4468fe[_0xadfe('0xa3')][_0xadfe('0xaa')]({'id':0x0,'priority':0x0,'app':_0xadfe('0xab'),'appdata':_0x2f06d3[_0xadfe('0x3a')]+','+(_0x4468fe[_0xadfe('0x75')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xadfe('0xac'),'startRouting',_0x4468fe);});}return respondWithRpcPromise(_0xadfe('0xac'),_0xadfe('0xad'),_0x4468fe);})[_0xadfe('0x1f')](function(_0x1abcb0){if(_0x1abcb0){var _0x5c93d2=0xc8;var _0x12de51=_0xadfe('0xae');logger[_0xadfe('0x20')](_0xadfe('0xaf'),_0x12de51,_0x5c93d2,'entity\x20found');logger[_0xadfe('0x23')](_0xadfe('0xb0'),_0x12de51,_0x5c93d2,_0xadfe('0xb1'),JSON[_0xadfe('0xb2')](_0x1abcb0));if(_0x4468fe[_0xadfe('0x75')]['type']===_0xadfe('0xb3')){return _0x6da19a[_0xadfe('0x29')](_0x5c93d2)['set'](_0xadfe('0xb4'),_0xadfe('0xb5'))['send']('\x0a');}else{return _0x6da19a['status'](_0x5c93d2)[_0xadfe('0x2b')](_0x1abcb0);}}})[_0xadfe('0x27')](handleError(_0x6da19a,null));};exports[_0xadfe('0xb6')]=function(_0xe566c5,_0xdd92a9){var _0x1520ee=_0xe566c5[_0xadfe('0x59')]['id'];var _0x24348a=_0xe566c5['body'];var _0x5ebca1=0xc8;var _0x5288d5=null;return db[_0xadfe('0xb7')][_0xadfe('0xb8')]({'isolationLevel':db[_0xadfe('0xb7')][_0xadfe('0xb9')][_0xadfe('0xba')][_0xadfe('0xbb')]},function(_0x5c1c6e){return db[_0xadfe('0x3f')][_0xadfe('0x68')]({'where':{'id':_0x1520ee},'transaction':_0x5c1c6e})[_0xadfe('0x1f')](function(_0x323c3d){if(_0x323c3d){return db[_0xadfe('0x71')][_0xadfe('0x36')]({'where':{'SmsAccountId':_0x1520ee},'transaction':_0x5c1c6e})[_0xadfe('0x1f')](function(){var _0x261b0f=_[_0xadfe('0xbc')](_0x24348a,function(_0xe97de6){_0xe97de6[_0xadfe('0x6a')]=_0x1520ee;return _0xe97de6;});return db[_0xadfe('0x71')]['bulkCreate'](_0x261b0f,{'transaction':_0x5c1c6e});});}else{_0x5ebca1=0x194;_0x5288d5=[];}});})['then'](function(){if(_0x5ebca1!==0x194){return db[_0xadfe('0x71')]['findAndCountAll']({'where':{'SmsAccountId':_0x1520ee},'order':_0xadfe('0xbd')})['then'](function(_0x608f34){_0x5288d5=_0x608f34;});}})['catch'](function(_0x109dfa){_0x5ebca1=0x1f4;logger[_0xadfe('0x24')](_0x109dfa[_0xadfe('0x39')]);if(_0x109dfa[_0xadfe('0x3a')]){delete _0x109dfa[_0xadfe('0x3a')];}_0x5288d5=_0x109dfa;})['finally'](function(){if(_0x5288d5===null){_0xdd92a9[_0xadfe('0x28')](_0x5ebca1);}else{if(_0x5ebca1===0x1f4){_0xdd92a9[_0xadfe('0x29')](_0x5ebca1)['send'](_0x5288d5);}else{_0xdd92a9[_0xadfe('0x29')](_0x5ebca1)[_0xadfe('0x2b')](_0x5288d5);}}});};exports[_0xadfe('0xbe')]=function(_0x374e97,_0x50ed3a,_0x3a1ab6){var _0x17d64f={};var _0x169e36={};var _0x59317a;var _0x420895;return db['SmsAccount'][_0xadfe('0x68')]({'where':{'id':_0x374e97[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x50ed3a,null))['then'](function(_0x1da6b8){if(_0x1da6b8){_0x59317a=_0x1da6b8;_0x169e36[_0xadfe('0x44')]=_[_0xadfe('0x46')](db[_0xadfe('0x71')][_0xadfe('0x40')]);_0x169e36['query']=_[_0xadfe('0x46')](_0x374e97[_0xadfe('0x45')]);_0x169e36['filters']=_[_0xadfe('0x47')](_0x169e36['model'],_0x169e36[_0xadfe('0x45')]);_0x17d64f[_0xadfe('0x48')]=_[_0xadfe('0x47')](_0x169e36[_0xadfe('0x44')],qs[_0xadfe('0x49')](_0x374e97[_0xadfe('0x45')]['fields']));_0x17d64f[_0xadfe('0x48')]=_0x17d64f[_0xadfe('0x48')]['length']?_0x17d64f[_0xadfe('0x48')]:_0x169e36['model'];_0x17d64f['order']=qs[_0xadfe('0x4d')](_0x374e97[_0xadfe('0x45')]['sort']);_0x17d64f[_0xadfe('0x4e')]=qs[_0xadfe('0x4f')](_[_0xadfe('0x50')](_0x374e97['query'],_0x169e36[_0xadfe('0x4f')]));if(_0x374e97[_0xadfe('0x45')][_0xadfe('0x51')]){_0x17d64f['where']=_[_0xadfe('0x52')](_0x17d64f[_0xadfe('0x4e')],{'$or':_['map'](_0x17d64f[_0xadfe('0x48')],function(_0x77592){var _0x134d56={};_0x134d56[_0x77592]={'$like':'%'+_0x374e97[_0xadfe('0x45')]['filter']+'%'};return _0x134d56;})});}_0x17d64f=_[_0xadfe('0x52')]({},_0x17d64f,_0x374e97['options']);return _0x59317a[_0xadfe('0xbe')](_0x17d64f);}})[_0xadfe('0x1f')](function(_0x400308){if(_0x400308){_0x420895=_0x400308['length'];if(!_0x374e97['query'][_0xadfe('0x69')](_0xadfe('0x4b'))){_0x17d64f[_0xadfe('0x2f')]=qs[_0xadfe('0x2f')](_0x374e97['query']['limit']);_0x17d64f[_0xadfe('0x2c')]=qs[_0xadfe('0x2c')](_0x374e97[_0xadfe('0x45')]['offset']);}return _0x59317a['getApplications'](_0x17d64f);}})[_0xadfe('0x1f')](function(_0x489611){if(_0x489611){return _0x489611?{'count':_0x420895,'rows':_0x489611}:null;}})[_0xadfe('0x1f')](respondWithResult(_0x50ed3a,null))[_0xadfe('0x27')](handleError(_0x50ed3a,null));};exports['getInteractions']=function(_0x4caa56,_0x32d433,_0x3765ab){var _0x19cee0={'raw':![],'where':{}};var _0x373f7a={};var _0x28aad8={'count':0x0,'rows':[]};return db[_0xadfe('0x3f')][_0xadfe('0x68')]({'where':{'id':_0x4caa56[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x32d433,null))[_0xadfe('0x1f')](function(_0x20003c){if(_0x20003c){_0x373f7a['model']=_['keys'](db[_0xadfe('0x9f')]['rawAttributes']);_0x373f7a[_0xadfe('0x45')]=_[_0xadfe('0x46')](_0x4caa56['query']);_0x373f7a[_0xadfe('0x4f')]=_[_0xadfe('0x47')](_0x373f7a[_0xadfe('0x44')],_0x373f7a[_0xadfe('0x45')]);_0x19cee0[_0xadfe('0x48')]=_['intersection'](_0x373f7a['model'],qs[_0xadfe('0x49')](_0x4caa56['query'][_0xadfe('0x49')]));_0x19cee0[_0xadfe('0x48')]=_0x19cee0[_0xadfe('0x48')][_0xadfe('0x4a')]?_0x19cee0[_0xadfe('0x48')]:_0x373f7a[_0xadfe('0x44')];if(!_0x4caa56['query'][_0xadfe('0x69')](_0xadfe('0x4b'))){_0x19cee0[_0xadfe('0x2f')]=qs[_0xadfe('0x2f')](_0x4caa56[_0xadfe('0x45')]['limit']);_0x19cee0['offset']=qs['offset'](_0x4caa56[_0xadfe('0x45')]['offset']);}_0x19cee0[_0xadfe('0x4c')]=qs[_0xadfe('0x4d')](_0x4caa56[_0xadfe('0x45')]['sort']);_0x19cee0[_0xadfe('0x4e')]=qs[_0xadfe('0x4f')](_[_0xadfe('0x50')](_0x4caa56[_0xadfe('0x45')],_0x373f7a[_0xadfe('0x4f')]));_0x19cee0[_0xadfe('0x4e')][_0xadfe('0x6a')]=_0x20003c['id'];if(_0x4caa56[_0xadfe('0x45')][_0xadfe('0x51')]){_0x19cee0['where']=_[_0xadfe('0x52')](_0x19cee0[_0xadfe('0x4e')],{'$or':_[_0xadfe('0xbc')](_0x19cee0[_0xadfe('0x48')],function(_0x437d9d){var _0x5bff40={};_0x5bff40[_0x437d9d]={'$like':'%'+_0x4caa56['query'][_0xadfe('0x51')]+'%'};return _0x5bff40;})});}_0x19cee0=_[_0xadfe('0x52')]({},_0x19cee0,_0x4caa56[_0xadfe('0x54')]);return db[_0xadfe('0x9f')][_0xadfe('0x2e')]({'where':_0x19cee0[_0xadfe('0x4e')]})[_0xadfe('0x1f')](function(_0x2a002d){_0x28aad8[_0xadfe('0x2e')]=_0x2a002d;if(_0x4caa56[_0xadfe('0x45')]['includeAll']){_0x19cee0[_0xadfe('0x55')]=[{'model':db[_0xadfe('0x76')],'as':_0xadfe('0xbf'),'required':![]},{'model':db[_0xadfe('0xa9')],'as':_0xadfe('0xc0'),'attributes':[_0xadfe('0x3a'),'fullname',_0xadfe('0xc1')],'required':![]},{'model':db[_0xadfe('0xc2')],'as':_0xadfe('0xc3'),'attributes':['id','name','color'],'where':_0x4caa56[_0xadfe('0x45')][_0xadfe('0xc4')]?{'id':_0x4caa56['query']['tag']}:undefined,'required':_0x4caa56['query'][_0xadfe('0xc4')]?!![]:![]}];}return db[_0xadfe('0x9f')][_0xadfe('0x56')](_0x19cee0);})['then'](function(_0x459022){_0x28aad8[_0xadfe('0x57')]=_0x459022;return _0x28aad8;});}})['then'](respondWithFilteredResult(_0x32d433,_0x19cee0))['catch'](handleError(_0x32d433,null));};exports[_0xadfe('0x3b')]=function(_0x260a01,_0x15d05b,_0x4ba03f){var _0x31fbac,_0x458571,_0xc9071a;if(_['isNil'](_0x260a01[_0xadfe('0x63')][_0xadfe('0x63')])||_0x260a01['body'][_0xadfe('0x63')]===''){throw new db[(_0xadfe('0x77'))][(_0xadfe('0x78'))](_0xadfe('0x95'));}if(_[_0xadfe('0x93')](_0x260a01[_0xadfe('0x63')]['to'])){throw new db[(_0xadfe('0x77'))][(_0xadfe('0x78'))]('to\x20is\x20mandatory');}_0x31fbac=_0x260a01[_0xadfe('0x63')]['to'];return db[_0xadfe('0x3f')][_0xadfe('0x5b')]({'where':{'id':_0x260a01[_0xadfe('0x59')]['id']},'include':[{'model':db[_0xadfe('0x9a')],'as':_0xadfe('0xc5'),'include':[{'model':db[_0xadfe('0x76')],'as':_0xadfe('0x9b'),'where':{'mobile':_0x31fbac},'limit':0x1,'order':[[_0xadfe('0x7b'),_0xadfe('0x9c')]]}]}]})[_0xadfe('0x1f')](handleEntityNotFound(_0x15d05b,null))[_0xadfe('0x1f')](function(_0x356dc9){if(_0x356dc9&&_0x356dc9[_0xadfe('0xc5')]){_0x458571=_0x356dc9[_0xadfe('0x37')]({'plain':!![]});if(_0x458571[_0xadfe('0xc5')]&&_0x458571['List'][_0xadfe('0x9b')][_0xadfe('0x4a')]){return _0x458571[_0xadfe('0xc5')][_0xadfe('0x9b')][0x0];}return db[_0xadfe('0x76')]['create'](_[_0xadfe('0x9e')](_0x260a01['body'],{'firstName':_0x31fbac,'mobile':_0x31fbac,'phone':_0x31fbac,'ListId':_0x458571[_0xadfe('0xc6')]}));}})['then'](handleEntityNotFound(_0x15d05b,null))['then'](function(_0x3149aa){if(_0x3149aa){_0xc9071a=_0x3149aa;return db[_0xadfe('0x9f')]['find']({'where':{'ContactId':_0xc9071a['id'],'closed':![],'SmsAccountId':_0x458571['id']}})[_0xadfe('0x1f')](function(_0x364445){if(_0x364445){return[_0x364445,![]];}return db[_0xadfe('0x9f')][_0xadfe('0x5c')]({'UserId':_0x260a01[_0xadfe('0x5d')]['id'],'ContactId':_0xc9071a['id'],'SmsAccountId':_0x458571['id'],'phone':_0x31fbac,'firstMsgDirection':_0xadfe('0xc7'),'Messages':[_[_0xadfe('0x52')](_0x260a01['body'],{'read':![],'body':_0x260a01['body'][_0xadfe('0x63')],'phone':_0x31fbac,'SmsAccountId':_0x458571['id'],'UserId':_0x260a01[_0xadfe('0x5d')]['id'],'ContactId':_0xc9071a['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xadfe('0xc8')}]})['then'](function(_0x2c2ec3){return[_0x2c2ec3,!![]];});});}})[_0xadfe('0xa0')](function(_0x138b7c,_0x8115de){if(_0x8115de){return _0x138b7c;}return db['SmsMessage'][_0xadfe('0x5c')](_['merge'](_0x260a01[_0xadfe('0x63')],{'read':![],'body':_0x260a01[_0xadfe('0x63')][_0xadfe('0x63')],'phone':_0x31fbac,'SmsAccountId':_0x458571['id'],'SmsInteractionId':_0x138b7c['id'],'UserId':_0x260a01['user']['id'],'ContactId':_0xc9071a['id']}))[_0xadfe('0x1f')](function(_0x3e9c1d){_0x138b7c[_0xadfe('0xc9')]['Messages']=[];_0x138b7c['dataValues'][_0xadfe('0xc8')][_0xadfe('0xca')](_0x3e9c1d[_0xadfe('0xc9')]);return _0x138b7c;});})['then'](respondWithResult(_0x15d05b,null))[_0xadfe('0x27')](handleError(_0x15d05b,null));};exports[_0xadfe('0x29')]=function(_0x1f93ac,_0x98e69f,_0x306ae7){if(_0x1f93ac[_0xadfe('0x63')]['id']){delete _0x1f93ac[_0xadfe('0x63')]['id'];}var _0x355fb9,_0xb5fe11,_0x39ea5f;return db[_0xadfe('0x3f')]['find']({'where':{'id':_0x1f93ac[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x98e69f,null))[_0xadfe('0x1f')](function(_0x3b8fd7){if(_0x3b8fd7){_0x39ea5f=_0x3b8fd7;logger[_0xadfe('0x23')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0xcb'),_0x3b8fd7[_0xadfe('0x42')],util['inspect'](_0x1f93ac[_0xadfe('0x63')],{'showHidden':![],'depth':null}));switch(_0x3b8fd7[_0xadfe('0x42')]){case _0xadfe('0xcc'):if(_0x1f93ac['body']['skebby_dispatch_id']&&_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x29')]){_0xb5fe11=_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x29')];return db[_0xadfe('0xa6')]['find']({'where':{'messageId':_0x1f93ac[_0xadfe('0x63')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x1f93ac[_0xadfe('0x63')]['requestid']&&_0x1f93ac[_0xadfe('0x63')][_0xadfe('0xcd')]){_0xb5fe11=_0x1f93ac[_0xadfe('0x63')]['statusInt'];return db[_0xadfe('0xa6')][_0xadfe('0x5b')]({'where':{'messageId':_0x1f93ac['body'][_0xadfe('0xce')]}});}break;case _0xadfe('0x85'):if(_0x1f93ac['body'][_0xadfe('0xcf')]&&_0x1f93ac[_0xadfe('0x63')][_0xadfe('0xd0')]){_0xb5fe11=_0x1f93ac[_0xadfe('0x63')][_0xadfe('0xd0')];return db[_0xadfe('0xa6')][_0xadfe('0x5b')]({'where':{'messageId':_0x1f93ac[_0xadfe('0x63')]['message_id']}});}break;case _0xadfe('0x89'):var _0xcc91f9=_0x1f93ac['body'][_0xadfe('0x8a')][0x0];if(_0xcc91f9[_0xadfe('0x80')]&&_0xcc91f9[_0xadfe('0x29')]['groupName']===_0xadfe('0xd1')){_0xb5fe11=_0xcc91f9[_0xadfe('0x29')][_0xadfe('0xd2')];return db[_0xadfe('0xa6')][_0xadfe('0x5b')]({'where':{'messageId':_0xcc91f9['messageId']}});}break;case'clickatell':if(_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x80')]&&_0x1f93ac[_0xadfe('0x63')]['status']){_0xb5fe11=_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x80')]}});}break;case _0xadfe('0x90'):if(_0x1f93ac['body'][0x0][_0xadfe('0x25')]['id']){_0xb5fe11=_0x1f93ac[_0xadfe('0x63')][0x0][_0xadfe('0x42')];return db[_0xadfe('0xa6')]['find']({'where':{'messageId':_0x1f93ac[_0xadfe('0x63')][0x0]['message']['id']}});}break;case _0xadfe('0x91'):if(_0x1f93ac[_0xadfe('0x63')][_0xadfe('0xd3')]&&_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x29')]){_0xb5fe11=_0x1f93ac[_0xadfe('0x63')][_0xadfe('0x29')];return db[_0xadfe('0xa6')][_0xadfe('0x5b')]({'where':{'messageId':_0x1f93ac['body'][_0xadfe('0xd3')]}});}break;}}})['then'](handleEntityNotFound(_0x98e69f,null))[_0xadfe('0x1f')](function(_0x3d3029){if(_0x3d3029){_0x355fb9=_0x3d3029;switch(_0x39ea5f[_0xadfe('0x42')]){case _0xadfe('0xcc'):if(_0xb5fe11==='DELIVERED'){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0xcc'),util['inspect'](_0x1f93ac['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0xb5fe11==='1'){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0xcc'),util[_0xadfe('0xd4')](_0x1f93ac['body'],{'showHidden':![],'depth':null}));}break;case _0xadfe('0x85'):if(!_0x1f93ac[_0xadfe('0x63')]['error_code']&&_0xb5fe11>=0xc8&&_0xb5fe11<=0xce){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0x85'),util[_0xadfe('0xd4')](_0x1f93ac['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4022f2=_0x1f93ac['body']['results'][0x0];if(_0x4022f2[_0xadfe('0x29')][_0xadfe('0xd2')]===_0xadfe('0xd1')){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0x89'),util['inspect'](_0x1f93ac['body'],{'showHidden':![],'depth':null}));}break;case _0xadfe('0xd5'):if(_0xb5fe11==_0xadfe('0xd6')||_0xb5fe11==_0xadfe('0xd7')){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),'status','clickatell',util[_0xadfe('0xd4')](_0x1f93ac[_0xadfe('0x63')],{'showHidden':![],'depth':null}));}break;case _0xadfe('0x90'):if(_0xb5fe11==_0xadfe('0xd8')){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0x90'),util['inspect'](_0x1f93ac[_0xadfe('0x63')],{'showHidden':![],'depth':null}));}break;case _0xadfe('0x91'):if(_0xb5fe11===_0xadfe('0xd9')||_0xb5fe11===_0xadfe('0xda')){return _0x355fb9[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0x91'),util['inspect'](_0x1f93ac[_0xadfe('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x355fb9;}})[_0xadfe('0x1f')](respondWithResult(_0x98e69f,null))[_0xadfe('0x27')](handleError(_0x98e69f,null));};exports[_0xadfe('0xdb')]=function(_0x11e063,_0x107c98,_0x1c7d95){var _0x14f0e2,_0x172c14,_0x436380;return db['SmsAccount']['find']({'where':{'id':_0x11e063[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x107c98,null))[_0xadfe('0x1f')](function(_0x340344){if(_0x340344){_0x436380=_0x340344;logger[_0xadfe('0x23')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0xcb'),_0x340344[_0xadfe('0x42')],util['inspect'](_0x11e063[_0xadfe('0x45')],{'showHidden':![],'depth':null}));switch(_0x340344[_0xadfe('0x42')]){case _0xadfe('0x8b'):if(_0x11e063[_0xadfe('0x45')][_0xadfe('0xdc')]&&_0x11e063['query'][_0xadfe('0xdd')]){_0x172c14=_0x11e063[_0xadfe('0x45')][_0xadfe('0xdd')];return db[_0xadfe('0xa6')][_0xadfe('0x5b')]({'where':{'messageId':_0x11e063['query'][_0xadfe('0xdc')]}});}break;}}})[_0xadfe('0x1f')](handleEntityNotFound(_0x107c98,null))[_0xadfe('0x1f')](function(_0x35a7fb){if(_0x35a7fb){_0x14f0e2=_0x35a7fb;switch(_0x436380['type']){case _0xadfe('0x8b'):if(_0x172c14==='2'||_0x172c14==='6'){return _0x14f0e2[_0xadfe('0x35')]({'read':!![]});}else{logger[_0xadfe('0x24')](_0xadfe('0xaf'),_0xadfe('0x29'),_0xadfe('0x8b'),util[_0xadfe('0xd4')](_0x11e063[_0xadfe('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x14f0e2;}})[_0xadfe('0x1f')](respondWithResult(_0x107c98,null))[_0xadfe('0x27')](handleError(_0x107c98,null));};exports['addAgents']=function(_0x56ee20,_0x7d0b53,_0x472906){return db['SmsAccount'][_0xadfe('0x5b')]({'where':{'id':_0x56ee20[_0xadfe('0x59')]['id']}})['then'](handleEntityNotFound(_0x7d0b53,null))[_0xadfe('0x1f')](function(_0x165c4e){if(_0x165c4e){return _0x165c4e[_0xadfe('0xde')](_0x56ee20[_0xadfe('0x63')]['ids'],_[_0xadfe('0xdf')](_0x56ee20['body'],['ids','id'])||{})[_0xadfe('0xa0')](function(_0x3e831e){for(var _0x5e6629=0x0;_0x5e6629<_0x56ee20[_0xadfe('0x63')][_0xadfe('0x6c')][_0xadfe('0x4a')];_0x5e6629+=0x1){socket[_0xadfe('0xe0')]('userSmsAccount:save',{'UserId':Number(_0x56ee20[_0xadfe('0x63')]['ids'][_0x5e6629]),'SmsAccountId':Number(_0x56ee20[_0xadfe('0x59')]['id'])});}return _0x3e831e;});}})['then'](respondWithResult(_0x7d0b53,null))[_0xadfe('0x27')](handleError(_0x7d0b53,null));};exports[_0xadfe('0xe1')]=function(_0x3215c9,_0x65a04a,_0x4d10c9){return db[_0xadfe('0x3f')]['find']({'where':{'id':_0x3215c9[_0xadfe('0x59')]['id']}})[_0xadfe('0x1f')](handleEntityNotFound(_0x65a04a,null))['then'](function(_0x2cdb0c){if(_0x2cdb0c){return _0x2cdb0c['removeAgents'](_0x3215c9[_0xadfe('0x45')][_0xadfe('0x6c')])['then'](function(){if(_[_0xadfe('0xe2')](_0x3215c9[_0xadfe('0x45')][_0xadfe('0x6c')])){for(var _0x345d5e=0x0;_0x345d5e<_0x3215c9[_0xadfe('0x45')][_0xadfe('0x6c')][_0xadfe('0x4a')];_0x345d5e+=0x1){socket[_0xadfe('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x3215c9['query'][_0xadfe('0x6c')][_0x345d5e]),'SmsAccountId':Number(_0x3215c9[_0xadfe('0x59')]['id'])});}}else{socket[_0xadfe('0xe0')](_0xadfe('0xe3'),{'UserId':Number(_0x3215c9[_0xadfe('0x45')]['ids']),'SmsAccountId':Number(_0x3215c9[_0xadfe('0x59')]['id'])});}});}})[_0xadfe('0x1f')](respondWithStatusCode(_0x65a04a,null))[_0xadfe('0x27')](handleError(_0x65a04a,null));};exports[_0xadfe('0xe4')]=function(_0x4ad8b9,_0x3739bb,_0x4851e0){var _0x4a775f={};var _0x102b40={};var _0x3d6ed7;var _0x2e1046;return db[_0xadfe('0x3f')][_0xadfe('0x68')]({'where':{'id':_0x4ad8b9[_0xadfe('0x59')]['id']}})['then'](handleEntityNotFound(_0x3739bb,null))[_0xadfe('0x1f')](function(_0x4cc44b){if(_0x4cc44b){_0x3d6ed7=_0x4cc44b;_0x102b40[_0xadfe('0x44')]=_[_0xadfe('0x46')](db[_0xadfe('0xa9')][_0xadfe('0x40')]);_0x102b40[_0xadfe('0x45')]=_[_0xadfe('0x46')](_0x4ad8b9[_0xadfe('0x45')]);_0x102b40[_0xadfe('0x4f')]=_[_0xadfe('0x47')](_0x102b40[_0xadfe('0x44')],_0x102b40[_0xadfe('0x45')]);_0x4a775f[_0xadfe('0x48')]=_['intersection'](_0x102b40[_0xadfe('0x44')],qs[_0xadfe('0x49')](_0x4ad8b9['query'][_0xadfe('0x49')]));_0x4a775f[_0xadfe('0x48')]=_0x4a775f[_0xadfe('0x48')]['length']?_0x4a775f['attributes']:_0x102b40[_0xadfe('0x44')];_0x4a775f[_0xadfe('0x4c')]=qs[_0xadfe('0x4d')](_0x4ad8b9[_0xadfe('0x45')][_0xadfe('0x4d')]);_0x4a775f[_0xadfe('0x4e')]=qs['filters'](_[_0xadfe('0x50')](_0x4ad8b9[_0xadfe('0x45')],_0x102b40[_0xadfe('0x4f')]));if(_0x4ad8b9['query'][_0xadfe('0x51')]){_0x4a775f[_0xadfe('0x4e')]=_[_0xadfe('0x52')](_0x4a775f[_0xadfe('0x4e')],{'$or':_[_0xadfe('0xbc')](_0x4a775f['attributes'],function(_0x4debe2){var _0x75c2f1={};_0x75c2f1[_0x4debe2]={'$like':'%'+_0x4ad8b9['query'][_0xadfe('0x51')]+'%'};return _0x75c2f1;})});}_0x4a775f=_[_0xadfe('0x52')]({},_0x4a775f,_0x4ad8b9[_0xadfe('0x54')]);return _0x3d6ed7['getAgents'](_0x4a775f);}})['then'](function(_0x264f30){if(_0x264f30){_0x2e1046=_0x264f30[_0xadfe('0x4a')];if(!_0x4ad8b9['query'][_0xadfe('0x69')]('nolimit')){_0x4a775f[_0xadfe('0x2f')]=qs[_0xadfe('0x2f')](_0x4ad8b9[_0xadfe('0x45')][_0xadfe('0x2f')]);_0x4a775f[_0xadfe('0x2c')]=qs['offset'](_0x4ad8b9[_0xadfe('0x45')][_0xadfe('0x2c')]);}return _0x3d6ed7[_0xadfe('0xe4')](_0x4a775f);}})['then'](function(_0x4130cd){if(_0x4130cd){return _0x4130cd?{'count':_0x2e1046,'rows':_0x4130cd}:null;}})['then'](respondWithResult(_0x3739bb,null))[_0xadfe('0x27')](handleError(_0x3739bb,null));}; \ No newline at end of file +var _0x3227=['query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','find','userProfileId','autoAssociation','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','createdAt','mobile','twilio','from','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','defaults','contact','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','entity\x20found','debug','\x0a','addApplications','sequelize','Transaction','bulkCreate','finally','getApplications','SmsInteraction','Contact','Owner','fullname','internal','Tag','tag','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','groupName','redif','error_code','DELIVERED','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','apply','update','get','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x3227,0x9a));var _0x7322=function(_0x1ca813,_0x47c9ce){_0x1ca813=_0x1ca813-0x0;var _0x2d84b5=_0x3227[_0x1ca813];return _0x2d84b5;};'use strict';var emlformat=require(_0x7322('0x0'));var rimraf=require(_0x7322('0x1'));var zipdir=require(_0x7322('0x2'));var jsonpatch=require(_0x7322('0x3'));var rp=require(_0x7322('0x4'));var moment=require(_0x7322('0x5'));var BPromise=require(_0x7322('0x6'));var Mustache=require('mustache');var util=require(_0x7322('0x7'));var path=require(_0x7322('0x8'));var sox=require('sox');var csv=require(_0x7322('0x9'));var ejs=require(_0x7322('0xa'));var fs=require('fs');var fs_extra=require(_0x7322('0xb'));var _=require(_0x7322('0xc'));var squel=require(_0x7322('0xd'));var crypto=require('crypto');var jsforce=require(_0x7322('0xe'));var deskjs=require(_0x7322('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7322('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7322('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7322('0x12'));var logger=require('../../config/logger')(_0x7322('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7322('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7322('0x15'),'port':0x18eb});var socket=require(_0x7322('0x16'))(new Redis(config['redis']));require(_0x7322('0x17'))[_0x7322('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7322('0x19')][_0x7322('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x6476c0,_0x421b2a,_0x5e82d6,_0x509cc0){return new BPromise(function(_0x5eb65b,_0x16d9a0){var _0xdb0282=_0x509cc0||client;return _0xdb0282[_0x7322('0x1b')](_0x6476c0,_0x5e82d6)[_0x7322('0x1c')](function(_0x21a9ca){logger['info'](_0x7322('0x1d'),_0x421b2a,_0x7322('0x1e'));logger['debug'](_0x7322('0x1f'),_0x421b2a,_0x7322('0x1e'),JSON[_0x7322('0x20')](_0x21a9ca));if(_0x21a9ca[_0x7322('0x21')]){if(_0x21a9ca[_0x7322('0x21')][_0x7322('0x22')]===0x1f4){logger[_0x7322('0x21')]('SmsAccount,\x20%s,\x20%s',_0x421b2a,_0x21a9ca[_0x7322('0x21')][_0x7322('0x23')]);return _0x16d9a0(_0x21a9ca[_0x7322('0x21')][_0x7322('0x23')]);}logger[_0x7322('0x21')](_0x7322('0x1d'),_0x421b2a,_0x21a9ca[_0x7322('0x21')]['message']);return _0x5eb65b(_0x21a9ca[_0x7322('0x21')]['message']);}else{logger['info'](_0x7322('0x1d'),_0x421b2a,_0x7322('0x1e'));_0x5eb65b(_0x21a9ca[_0x7322('0x24')]['message']);}})[_0x7322('0x25')](function(_0x4c0278){logger[_0x7322('0x21')]('SmsAccount,\x20%s,\x20%s',_0x421b2a,_0x4c0278);_0x16d9a0(_0x4c0278);});});}function respondWithStatusCode(_0x1bb001,_0x155589){_0x155589=_0x155589||0xcc;return function(_0x10e5c7){if(_0x10e5c7){return _0x1bb001['sendStatus'](_0x155589);}return _0x1bb001[_0x7322('0x26')](_0x155589)['end']();};}function respondWithResult(_0x5158fa,_0x47c48e){_0x47c48e=_0x47c48e||0xc8;return function(_0x159305){if(_0x159305){return _0x5158fa[_0x7322('0x26')](_0x47c48e)[_0x7322('0x27')](_0x159305);}};}function respondWithFilteredResult(_0x1153b2,_0x5646fb){return function(_0xf06b24){if(_0xf06b24){var _0x391474=typeof _0x5646fb[_0x7322('0x28')]===_0x7322('0x29')&&typeof _0x5646fb[_0x7322('0x2a')]===_0x7322('0x29');var _0x212379=_0xf06b24[_0x7322('0x2b')];var _0x59f18e=_0x391474?0x0:_0x5646fb[_0x7322('0x28')];var _0x2e56a4=_0x391474?_0xf06b24[_0x7322('0x2b')]:_0x5646fb[_0x7322('0x28')]+_0x5646fb[_0x7322('0x2a')];var _0x21764f;if(_0x2e56a4>=_0x212379){_0x2e56a4=_0x212379;_0x21764f=0xc8;}else{_0x21764f=0xce;}_0x1153b2['status'](_0x21764f);return _0x1153b2[_0x7322('0x2c')]('Content-Range',_0x59f18e+'-'+_0x2e56a4+'/'+_0x212379)[_0x7322('0x27')](_0xf06b24);}return null;};}function patchUpdates(_0x129b8a){return function(_0x3a7b41){try{jsonpatch[_0x7322('0x2d')](_0x3a7b41,_0x129b8a,!![]);}catch(_0xba02d5){return BPromise['reject'](_0xba02d5);}return _0x3a7b41['save']();};}function saveUpdates(_0x3fc3bb,_0x1221d9){return function(_0x2bb031){if(_0x2bb031){return _0x2bb031[_0x7322('0x2e')](_0x3fc3bb)[_0x7322('0x1c')](function(_0x169fd7){return _0x169fd7;});}return null;};}function removeEntity(_0x4c297c,_0x304b72){return function(_0x2925f2){if(_0x2925f2){return _0x2925f2['destroy']()[_0x7322('0x1c')](function(){var _0x498ea2=_0x2925f2[_0x7322('0x2f')]({'plain':!![]});var _0x3ac441='SmsAccounts';return db[_0x7322('0x30')][_0x7322('0x31')]({'where':{'type':_0x3ac441,'resourceId':_0x498ea2['id']}})[_0x7322('0x1c')](function(){return _0x2925f2;});})[_0x7322('0x1c')](function(){_0x4c297c[_0x7322('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d08c7,_0x3f23f4){return function(_0x3d071f){if(!_0x3d071f){_0x4d08c7['sendStatus'](0x194);}return _0x3d071f;};}function handleError(_0x5f57d5,_0x13b7a8){_0x13b7a8=_0x13b7a8||0x1f4;return function(_0x13d725){logger['error'](_0x13d725[_0x7322('0x32')]);if(_0x13d725[_0x7322('0x33')]){delete _0x13d725[_0x7322('0x33')];}_0x5f57d5['status'](_0x13b7a8)[_0x7322('0x34')](_0x13d725);};}exports[_0x7322('0x35')]=function(_0x1af821,_0x227e87){var _0x48e585={'include':[{'model':db[_0x7322('0x36')],'as':_0x7322('0x37')}]},_0x49908c={},_0x19b33e={'count':0x0,'rows':[]};var _0x9f737d=_['map'](db[_0x7322('0x38')][_0x7322('0x39')],function(_0x1a1d33){return{'name':_0x1a1d33[_0x7322('0x3a')],'type':_0x1a1d33[_0x7322('0x3b')][_0x7322('0x3c')]};});_0x49908c[_0x7322('0x3d')]=_[_0x7322('0x3e')](_0x9f737d,'name');_0x49908c[_0x7322('0x3f')]=_[_0x7322('0x40')](_0x1af821[_0x7322('0x3f')]);_0x49908c[_0x7322('0x41')]=_[_0x7322('0x42')](_0x49908c[_0x7322('0x3d')],_0x49908c[_0x7322('0x3f')]);_0x48e585[_0x7322('0x43')]=_[_0x7322('0x42')](_0x49908c['model'],qs['fields'](_0x1af821['query'][_0x7322('0x44')]));_0x48e585['attributes']=_0x48e585[_0x7322('0x43')]['length']?_0x48e585[_0x7322('0x43')]:_0x49908c[_0x7322('0x3d')];if(!_0x1af821['query']['hasOwnProperty'](_0x7322('0x45'))){_0x48e585[_0x7322('0x2a')]=qs['limit'](_0x1af821[_0x7322('0x3f')][_0x7322('0x2a')]);_0x48e585[_0x7322('0x28')]=qs[_0x7322('0x28')](_0x1af821['query'][_0x7322('0x28')]);}_0x48e585[_0x7322('0x46')]=qs[_0x7322('0x47')](_0x1af821['query']['sort']);_0x48e585[_0x7322('0x48')]=qs[_0x7322('0x41')](_[_0x7322('0x49')](_0x1af821[_0x7322('0x3f')],_0x49908c[_0x7322('0x41')]),_0x9f737d);if(_0x1af821[_0x7322('0x3f')][_0x7322('0x4a')]){_0x48e585[_0x7322('0x48')]=_['merge'](_0x48e585['where'],{'$or':_[_0x7322('0x3e')](_0x9f737d,function(_0x552295){if(_0x552295[_0x7322('0x3b')]!==_0x7322('0x4b')){var _0x156f99={};_0x156f99[_0x552295[_0x7322('0x33')]]={'$like':'%'+_0x1af821[_0x7322('0x3f')][_0x7322('0x4a')]+'%'};return _0x156f99;}})});}_0x48e585=_[_0x7322('0x4c')]({},_0x48e585,_0x1af821[_0x7322('0x4d')]);var _0x3f1c50={'where':_0x48e585[_0x7322('0x48')]};return db['SmsAccount'][_0x7322('0x2b')](_0x3f1c50)[_0x7322('0x1c')](function(_0x5f6f77){_0x19b33e[_0x7322('0x2b')]=_0x5f6f77;if(_0x1af821[_0x7322('0x3f')][_0x7322('0x4e')]){_0x48e585[_0x7322('0x4f')]=[{'all':!![]}];}return db[_0x7322('0x38')][_0x7322('0x50')](_0x48e585);})[_0x7322('0x1c')](function(_0x462746){_0x19b33e['rows']=_0x462746;return _0x19b33e;})['then'](respondWithFilteredResult(_0x227e87,_0x48e585))[_0x7322('0x25')](handleError(_0x227e87,null));};exports[_0x7322('0x51')]=function(_0x2dda22,_0x4aa788){var _0x2257ae={'raw':![],'where':{'id':_0x2dda22['params']['id']},'include':[{'model':db[_0x7322('0x36')],'as':_0x7322('0x37')}]},_0x53f4be={};_0x53f4be[_0x7322('0x3d')]=_[_0x7322('0x40')](db['SmsAccount'][_0x7322('0x39')]);_0x53f4be[_0x7322('0x3f')]=_[_0x7322('0x40')](_0x2dda22[_0x7322('0x3f')]);_0x53f4be['filters']=_[_0x7322('0x42')](_0x53f4be[_0x7322('0x3d')],_0x53f4be[_0x7322('0x3f')]);_0x2257ae[_0x7322('0x43')]=_[_0x7322('0x42')](_0x53f4be[_0x7322('0x3d')],qs[_0x7322('0x44')](_0x2dda22['query'][_0x7322('0x44')]));_0x2257ae[_0x7322('0x43')]=_0x2257ae[_0x7322('0x43')][_0x7322('0x52')]?_0x2257ae[_0x7322('0x43')]:_0x53f4be[_0x7322('0x3d')];if(_0x2dda22[_0x7322('0x3f')]['includeAll']){_0x2257ae[_0x7322('0x4f')]=[{'all':!![]}];}_0x2257ae=_[_0x7322('0x4c')]({},_0x2257ae,_0x2dda22['options']);return db['SmsAccount']['find'](_0x2257ae)[_0x7322('0x1c')](handleEntityNotFound(_0x4aa788,null))[_0x7322('0x1c')](respondWithResult(_0x4aa788,null))[_0x7322('0x25')](handleError(_0x4aa788,null));};exports['create']=function(_0x5d5dea,_0x32a40e){return db[_0x7322('0x38')][_0x7322('0x53')](_0x5d5dea[_0x7322('0x54')],{})[_0x7322('0x1c')](function(_0x1e371b){var _0x10df20=_0x5d5dea[_0x7322('0x55')]['get']({'plain':!![]});if(!_0x10df20)throw new Error(_0x7322('0x56'));if(_0x10df20[_0x7322('0x57')]===_0x7322('0x55')){var _0x5c341d=_0x1e371b[_0x7322('0x2f')]({'plain':!![]});var _0x932e30=_0x7322('0x58');return db[_0x7322('0x59')][_0x7322('0x5a')]({'where':{'name':_0x932e30,'userProfileId':_0x10df20[_0x7322('0x5b')]},'raw':!![]})[_0x7322('0x1c')](function(_0x1e0e70){if(_0x1e0e70&&_0x1e0e70[_0x7322('0x5c')]===0x0){return db['UserProfileResource'][_0x7322('0x53')]({'name':_0x5c341d['name'],'resourceId':_0x5c341d['id'],'type':_0x1e0e70[_0x7322('0x33')],'sectionId':_0x1e0e70['id']},{})['then'](function(){return _0x1e371b;});}else{return _0x1e371b;}})[_0x7322('0x25')](function(_0x459ae3){logger[_0x7322('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x459ae3);throw _0x459ae3;});}return _0x1e371b;})[_0x7322('0x1c')](respondWithResult(_0x32a40e,0xc9))['catch'](handleError(_0x32a40e,null));};exports['update']=function(_0x1a952d,_0x4312d2){if(_0x1a952d['body']['id']){delete _0x1a952d[_0x7322('0x54')]['id'];}return db[_0x7322('0x38')][_0x7322('0x5a')]({'where':{'id':_0x1a952d[_0x7322('0x5d')]['id']},'include':[{'model':db[_0x7322('0x36')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4312d2,null))[_0x7322('0x1c')](saveUpdates(_0x1a952d['body'],null))['then'](respondWithResult(_0x4312d2,null))[_0x7322('0x25')](handleError(_0x4312d2,null));};exports[_0x7322('0x31')]=function(_0xe7d542,_0x1b0be6){return db['SmsAccount'][_0x7322('0x5a')]({'where':{'id':_0xe7d542[_0x7322('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1b0be6,null))[_0x7322('0x1c')](removeEntity(_0x1b0be6,null))['catch'](handleError(_0x1b0be6,null));};exports[_0x7322('0x5e')]=function(_0xf0e63a,_0xfbfc03){return db[_0x7322('0x38')][_0x7322('0x5e')]()[_0x7322('0x1c')](respondWithResult(_0xfbfc03,null))['catch'](handleError(_0xfbfc03,null));};exports[_0x7322('0x5f')]=function(_0xc2e394,_0x4b68ae,_0xbb0d02){if(_0xc2e394[_0x7322('0x54')]['id']){delete _0xc2e394[_0x7322('0x54')]['id'];}return db[_0x7322('0x38')]['find']({'where':{'id':_0xc2e394[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x4b68ae,null))[_0x7322('0x1c')](function(_0x32fd53){if(_0x32fd53){_0xc2e394[_0x7322('0x54')][_0x7322('0x60')]=_0x32fd53['id'];return db[_0x7322('0x61')][_0x7322('0x53')](_0xc2e394['body']);}})[_0x7322('0x1c')](respondWithResult(_0x4b68ae,null))[_0x7322('0x25')](handleError(_0x4b68ae,null));};exports[_0x7322('0x62')]=function(_0x3cf2b1,_0x5de564,_0x4d1c35){var _0x10725c={'raw':![],'where':{}};var _0xf2bc19={};var _0x58a946={'count':0x0,'rows':[]};return db[_0x7322('0x38')][_0x7322('0x63')]({'where':{'id':_0x3cf2b1[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x5de564,null))[_0x7322('0x1c')](function(_0x17f3ed){if(_0x17f3ed){_0xf2bc19[_0x7322('0x3d')]=_[_0x7322('0x40')](db['Disposition'][_0x7322('0x39')]);_0xf2bc19[_0x7322('0x3f')]=_['keys'](_0x3cf2b1['query']);_0xf2bc19[_0x7322('0x41')]=_[_0x7322('0x42')](_0xf2bc19[_0x7322('0x3d')],_0xf2bc19[_0x7322('0x3f')]);_0x10725c[_0x7322('0x43')]=_[_0x7322('0x42')](_0xf2bc19['model'],qs['fields'](_0x3cf2b1[_0x7322('0x3f')][_0x7322('0x44')]));_0x10725c['attributes']=_0x10725c[_0x7322('0x43')][_0x7322('0x52')]?_0x10725c[_0x7322('0x43')]:_0xf2bc19[_0x7322('0x3d')];if(!_0x3cf2b1[_0x7322('0x3f')][_0x7322('0x64')]('nolimit')){_0x10725c[_0x7322('0x2a')]=qs[_0x7322('0x2a')](_0x3cf2b1[_0x7322('0x3f')][_0x7322('0x2a')]);_0x10725c['offset']=qs['offset'](_0x3cf2b1[_0x7322('0x3f')][_0x7322('0x28')]);}_0x10725c[_0x7322('0x46')]=qs['sort'](_0x3cf2b1[_0x7322('0x3f')]['sort']);_0x10725c[_0x7322('0x48')]=qs[_0x7322('0x41')](_['pick'](_0x3cf2b1[_0x7322('0x3f')],_0xf2bc19['filters']));_0x10725c[_0x7322('0x48')][_0x7322('0x60')]=_0x17f3ed['id'];if(_0x3cf2b1['query'][_0x7322('0x4a')]){_0x10725c[_0x7322('0x48')]=_[_0x7322('0x4c')](_0x10725c[_0x7322('0x48')],{'$or':_[_0x7322('0x3e')](_0x10725c['attributes'],function(_0xbe9ffb){var _0x483ec8={};_0x483ec8[_0xbe9ffb]={'$like':'%'+_0x3cf2b1[_0x7322('0x3f')]['filter']+'%'};return _0x483ec8;})});}_0x10725c=_[_0x7322('0x4c')]({},_0x10725c,_0x3cf2b1[_0x7322('0x4d')]);return db[_0x7322('0x61')]['count']({'where':_0x10725c[_0x7322('0x48')]})[_0x7322('0x1c')](function(_0x281f05){_0x58a946[_0x7322('0x2b')]=_0x281f05;if(_0x3cf2b1['query'][_0x7322('0x4e')]){_0x10725c['include']=[{'all':!![]}];}return db[_0x7322('0x61')][_0x7322('0x50')](_0x10725c);})['then'](function(_0x8bea05){_0x58a946[_0x7322('0x65')]=_0x8bea05;return _0x58a946;});}})['then'](respondWithFilteredResult(_0x5de564,_0x10725c))[_0x7322('0x25')](handleError(_0x5de564,null));};exports[_0x7322('0x66')]=function(_0x18b32f,_0x300239,_0x335b0b){return db['SmsAccount'][_0x7322('0x5a')]({'where':{'id':_0x18b32f['params']['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x300239,null))[_0x7322('0x1c')](function(_0x315308){if(_0x315308){return _0x315308[_0x7322('0x66')](_0x18b32f[_0x7322('0x3f')][_0x7322('0x67')]);}})[_0x7322('0x1c')](respondWithStatusCode(_0x300239,null))[_0x7322('0x25')](handleError(_0x300239,null));};exports['addAnswer']=function(_0xce9fca,_0x1a6b06,_0x4304be){if(_0xce9fca[_0x7322('0x54')]['id']){delete _0xce9fca[_0x7322('0x54')]['id'];}return db[_0x7322('0x38')][_0x7322('0x5a')]({'where':{'id':_0xce9fca[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x1a6b06,null))['then'](function(_0x164fa5){if(_0x164fa5){_0xce9fca[_0x7322('0x54')][_0x7322('0x60')]=_0x164fa5['id'];return db[_0x7322('0x68')][_0x7322('0x53')](_0xce9fca[_0x7322('0x54')]);}})[_0x7322('0x1c')](respondWithResult(_0x1a6b06,null))[_0x7322('0x25')](handleError(_0x1a6b06,null));};exports[_0x7322('0x69')]=function(_0x349a63,_0xe6068,_0x2128a1){var _0x3e522a={'raw':![],'where':{}};var _0x117906={};var _0x3b720c={'count':0x0,'rows':[]};return db[_0x7322('0x38')][_0x7322('0x63')]({'where':{'id':_0x349a63[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0xe6068,null))[_0x7322('0x1c')](function(_0x187646){if(_0x187646){_0x117906[_0x7322('0x3d')]=_[_0x7322('0x40')](db[_0x7322('0x68')][_0x7322('0x39')]);_0x117906['query']=_[_0x7322('0x40')](_0x349a63[_0x7322('0x3f')]);_0x117906[_0x7322('0x41')]=_[_0x7322('0x42')](_0x117906[_0x7322('0x3d')],_0x117906[_0x7322('0x3f')]);_0x3e522a[_0x7322('0x43')]=_[_0x7322('0x42')](_0x117906[_0x7322('0x3d')],qs['fields'](_0x349a63[_0x7322('0x3f')]['fields']));_0x3e522a['attributes']=_0x3e522a[_0x7322('0x43')]['length']?_0x3e522a['attributes']:_0x117906[_0x7322('0x3d')];if(!_0x349a63[_0x7322('0x3f')][_0x7322('0x64')](_0x7322('0x45'))){_0x3e522a[_0x7322('0x2a')]=qs[_0x7322('0x2a')](_0x349a63[_0x7322('0x3f')][_0x7322('0x2a')]);_0x3e522a[_0x7322('0x28')]=qs['offset'](_0x349a63[_0x7322('0x3f')][_0x7322('0x28')]);}_0x3e522a[_0x7322('0x46')]=qs['sort'](_0x349a63[_0x7322('0x3f')][_0x7322('0x47')]);_0x3e522a[_0x7322('0x48')]=qs[_0x7322('0x41')](_['pick'](_0x349a63[_0x7322('0x3f')],_0x117906['filters']));_0x3e522a[_0x7322('0x48')][_0x7322('0x60')]=_0x187646['id'];if(_0x349a63['query']['filter']){_0x3e522a[_0x7322('0x48')]=_[_0x7322('0x4c')](_0x3e522a[_0x7322('0x48')],{'$or':_['map'](_0x3e522a['attributes'],function(_0x42d3c9){var _0x2ab487={};_0x2ab487[_0x42d3c9]={'$like':'%'+_0x349a63['query'][_0x7322('0x4a')]+'%'};return _0x2ab487;})});}_0x3e522a=_[_0x7322('0x4c')]({},_0x3e522a,_0x349a63[_0x7322('0x4d')]);return db[_0x7322('0x68')]['count']({'where':_0x3e522a[_0x7322('0x48')]})[_0x7322('0x1c')](function(_0x3dc611){_0x3b720c['count']=_0x3dc611;if(_0x349a63[_0x7322('0x3f')][_0x7322('0x4e')]){_0x3e522a['include']=[{'all':!![]}];}return db[_0x7322('0x68')]['findAll'](_0x3e522a);})['then'](function(_0x5d1729){_0x3b720c[_0x7322('0x65')]=_0x5d1729;return _0x3b720c;});}})['then'](respondWithFilteredResult(_0xe6068,_0x3e522a))['catch'](handleError(_0xe6068,null));};exports[_0x7322('0x6a')]=function(_0x1104fd,_0x43bd7d,_0x19405b){return db[_0x7322('0x38')]['find']({'where':{'id':_0x1104fd['params']['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x43bd7d,null))[_0x7322('0x1c')](function(_0x134d0b){if(_0x134d0b){return _0x134d0b[_0x7322('0x6a')](_0x1104fd[_0x7322('0x3f')][_0x7322('0x67')]);}})[_0x7322('0x1c')](respondWithStatusCode(_0x43bd7d,null))['catch'](handleError(_0x43bd7d,null));};exports[_0x7322('0x6b')]=function(_0x1e0065,_0x4ef100,_0x500fb5){var _0x4e211e={'channel':'sms'};var _0x5e4003=[];var _0x55df82=[];var _0x5ee3d8={};return db[_0x7322('0x38')]['find']({'where':{'id':_0x1e0065[_0x7322('0x5d')]['id']},'include':[{'model':db[_0x7322('0x6c')],'as':_0x7322('0x6d')}]})[_0x7322('0x1c')](handleEntityNotFound(_0x4ef100,null))[_0x7322('0x1c')](function(_0x5ad153){_0x4e211e[_0x7322('0x6e')]=_0x5ad153;_0x4e211e[_0x7322('0x6f')]=_[_0x7322('0x70')](_0x5ad153[_0x7322('0x6d')],[_0x7322('0x71')],[_0x7322('0x72')]);if(_0x4e211e['account'][_0x7322('0x6d')]){delete _0x4e211e['account'][_0x7322('0x6d')];}return db[_0x7322('0x73')]['describe']();})[_0x7322('0x1c')](function(_0x2184b6){if(!_0x2184b6){throw new db[(_0x7322('0x74'))][(_0x7322('0x75'))](_0x7322('0x76'));}_0x5e4003=_['difference'](_[_0x7322('0x40')](_0x2184b6),['createdAt',_0x7322('0x77')]);_0x55df82=_['difference'](_[_0x7322('0x40')](_0x2184b6),[_0x7322('0x78'),_0x7322('0x77'),'CompanyId','ListId']);_0x4e211e['body']={'mapKey':_0x7322('0x79')};if(_0x4e211e['account'][_0x7322('0x3b')]){switch(_0x4e211e[_0x7322('0x6e')][_0x7322('0x3b')]){case _0x7322('0x7a'):_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')]=_0x1e0065[_0x7322('0x54')]['From'];_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]=_0x1e0065['body']['Body'];_0x4e211e[_0x7322('0x54')][_0x7322('0x7c')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x7d')];break;case _0x7322('0x7e'):_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')]='+'+_0x1e0065[_0x7322('0x54')]['sender'];_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x7f')];break;case _0x7322('0x80'):_0x4e211e['body'][_0x7322('0x7b')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x7b')];_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x23')];break;case _0x7322('0x81'):_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x7b')];_0x4e211e['body'][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x54')];_0x4e211e['body'][_0x7322('0x7c')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x82')];break;case'plivo':_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')]=_0x1e0065['body'][_0x7322('0x83')];_0x4e211e['body'][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x84')];_0x4e211e[_0x7322('0x54')]['messageId']=_0x1e0065['body'][_0x7322('0x85')];break;case _0x7322('0x86'):_0x4e211e['body']['from']='+'+_0x1e0065[_0x7322('0x54')][_0x7322('0x87')][0x0][_0x7322('0x7b')];_0x4e211e['body']['body']=_0x1e0065['body'][_0x7322('0x87')][0x0][_0x7322('0x7f')];_0x4e211e[_0x7322('0x54')][_0x7322('0x7c')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x87')][0x0][_0x7322('0x7c')];break;case _0x7322('0x88'):_0x4e211e[_0x7322('0x54')]['from']=_0x1e0065[_0x7322('0x54')][_0x7322('0x89')];_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x8a')]['message'];break;case _0x7322('0x8b'):_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x8c')];_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x7f')];_0x4e211e['body'][_0x7322('0x7c')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x8d')];break;case _0x7322('0x8e'):_0x4e211e['body']['messageId']=_0x1e0065[_0x7322('0x54')][0x0][_0x7322('0x23')]['id'];_0x4e211e['body']['from']=_0x1e0065[_0x7322('0x54')][0x0][_0x7322('0x23')]['from'];_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]=_0x1e0065[_0x7322('0x54')][0x0][_0x7322('0x23')][_0x7322('0x7f')];break;case _0x7322('0x8f'):_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')]=_0x1e0065['body']['from'];_0x4e211e[_0x7322('0x54')]['body']=_0x1e0065[_0x7322('0x54')][_0x7322('0x23')];_0x4e211e[_0x7322('0x54')][_0x7322('0x7c')]=_0x1e0065[_0x7322('0x54')][_0x7322('0x90')];break;}}if(_0x4e211e[_0x7322('0x54')]['id']){delete _0x4e211e[_0x7322('0x54')]['id'];}if(_[_0x7322('0x91')](_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')])){throw new db['Sequelize'][(_0x7322('0x75'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x4e211e['body']['body'])||_0x4e211e[_0x7322('0x54')][_0x7322('0x54')]===''){throw new db[(_0x7322('0x74'))][(_0x7322('0x75'))](_0x7322('0x92'));}if(_[_0x7322('0x91')](_0x4e211e[_0x7322('0x54')][_0x7322('0x93')])){throw new db[(_0x7322('0x74'))]['ValidationError'](_0x7322('0x94')+_0x55df82);}if(!_[_0x7322('0x95')](_0x55df82,_0x4e211e[_0x7322('0x54')][_0x7322('0x93')])){throw new db[(_0x7322('0x74'))][(_0x7322('0x75'))](_0x7322('0x96')+_0x55df82);}_0x5ee3d8[_0x4e211e[_0x7322('0x54')][_0x7322('0x93')]]=_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')];return db[_0x7322('0x97')][_0x7322('0x5a')]({'where':{'id':_0x4e211e[_0x7322('0x6e')][_0x7322('0x98')]},'include':[{'model':db[_0x7322('0x73')],'as':_0x7322('0x99'),'where':_0x5ee3d8,'limit':0x1,'order':[['updatedAt',_0x7322('0x9a')]]}]});})[_0x7322('0x1c')](handleEntityNotFound(_0x4ef100,null))[_0x7322('0x1c')](function(_0x3a1bf1){if(_0x3a1bf1){_0x4e211e[_0x7322('0x9b')]=_['omit'](_0x3a1bf1,[_0x7322('0x99')]);if(_0x3a1bf1['Contacts'][_0x7322('0x52')]){return _0x3a1bf1[_0x7322('0x99')][0x0];}var _0x1ab7c3=_[_0x7322('0x9c')](_0x4e211e[_0x7322('0x54')],{'firstName':_0x4e211e[_0x7322('0x54')]['from'],'ListId':_0x3a1bf1['id']});_0x1ab7c3[_0x4e211e[_0x7322('0x54')][_0x7322('0x93')]]=_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')];return db[_0x7322('0x73')][_0x7322('0x53')](_0x1ab7c3,{'fields':_0x5e4003,'raw':!![]});}})['then'](handleEntityNotFound(_0x4ef100,null))[_0x7322('0x1c')](function(_0x320f70){if(_0x320f70){_0x4e211e[_0x7322('0x9d')]=_0x320f70;var _0xe8744={'ContactId':_0x320f70['id'],'phone':_0x4e211e['body'][_0x7322('0x7b')],'SmsAccountId':_0x1e0065[_0x7322('0x5d')]['id']};var _0x2b5e73={'ContactId':_0x320f70['id'],'SmsAccountId':_0x1e0065[_0x7322('0x5d')]['id'],'closed':![]};return db['SmsInteraction'][_0x7322('0x5a')]({'where':_0x2b5e73})[_0x7322('0x1c')](function(_0x12bfef){if(_0x12bfef){return[_0x12bfef,![]];}return db['SmsInteraction']['create'](_0xe8744)[_0x7322('0x1c')](function(_0x5ea555){return[_0x5ea555,!![]];});});}})[_0x7322('0x9e')](function(_0x2526e2,_0x73691){_0x4e211e[_0x7322('0x9f')]=_0x2526e2['get']({'plain':!![]});_0x4e211e[_0x7322('0x9f')][_0x7322('0xa0')]=![];if(_0x73691){if(_0x4e211e[_0x7322('0x6e')][_0x7322('0xa1')]){_0x4e211e['applications'][_0x7322('0xa2')]({'id':0x0,'priority':_0x4e211e[_0x7322('0x6f')][_0x7322('0x52')]+0x1,'app':_0x7322('0xa3'),'appdata':_0x7322('0xa4'),'interval':_0x7322('0xa5')});}_0x4e211e['interaction']['created']=!![];}return db[_0x7322('0xa6')][_0x7322('0x53')]({'phone':_0x4e211e[_0x7322('0x54')][_0x7322('0x7b')],'messageId':_0x4e211e['body'][_0x7322('0x7c')],'body':_0x4e211e[_0x7322('0x54')]['body'],'SmsAccountId':_0x1e0065[_0x7322('0x5d')]['id'],'SmsInteractionId':_0x2526e2['id'],'direction':'in','ContactId':_0x2526e2[_0x7322('0xa7')],'AttachmentId':_0x4e211e[_0x7322('0x54')][_0x7322('0xa8')]});})['then'](function(_0xe7b681){_0x4e211e[_0x7322('0x23')]=_0xe7b681;if(_0x4e211e[_0x7322('0x9f')][_0x7322('0xa9')]){return db[_0x7322('0xaa')][_0x7322('0x5a')]({'attributes':['id',_0x7322('0x33')],'where':{'id':_0x4e211e['interaction'][_0x7322('0xa9')]}})[_0x7322('0x1c')](function(_0x74d29){if(_0x74d29){_0x4e211e[_0x7322('0x6f')][_0x7322('0xab')]({'id':0x0,'priority':0x0,'app':_0x7322('0xac'),'appdata':_0x74d29[_0x7322('0x33')]+','+(_0x4e211e[_0x7322('0x6e')][_0x7322('0xad')]||0xa),'interval':_0x7322('0xa5')});}return respondWithRpcPromise(_0x7322('0xae'),'startRouting',_0x4e211e);});}return respondWithRpcPromise(_0x7322('0xae'),_0x7322('0xaf'),_0x4e211e);})[_0x7322('0x1c')](function(_0x466554){if(_0x466554){var _0x4dbc56=0xc8;var _0x11c397=_0x7322('0xb0');logger[_0x7322('0xb1')](_0x7322('0x1f'),_0x11c397,_0x4dbc56,_0x7322('0xb2'));logger[_0x7322('0xb3')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x11c397,_0x4dbc56,_0x7322('0xb2'),JSON[_0x7322('0x20')](_0x466554));if(_0x4e211e[_0x7322('0x6e')][_0x7322('0x3b')]===_0x7322('0x7a')){return _0x4ef100[_0x7322('0x26')](_0x4dbc56)[_0x7322('0x2c')]('Content-Type','text/xml')['send'](_0x7322('0xb4'));}else{return _0x4ef100['status'](_0x4dbc56)[_0x7322('0x27')](_0x466554);}}})[_0x7322('0x25')](handleError(_0x4ef100,null));};exports[_0x7322('0xb5')]=function(_0x2a9e5b,_0x49c337){var _0x325e2c=_0x2a9e5b['params']['id'];var _0x373e98=_0x2a9e5b[_0x7322('0x54')];var _0x2fe125=0xc8;var _0x494783=null;return db[_0x7322('0xb6')]['transaction']({'isolationLevel':db[_0x7322('0xb6')][_0x7322('0xb7')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5ba353){return db[_0x7322('0x38')][_0x7322('0x63')]({'where':{'id':_0x325e2c},'transaction':_0x5ba353})[_0x7322('0x1c')](function(_0x16cb12){if(_0x16cb12){return db[_0x7322('0x6c')]['destroy']({'where':{'SmsAccountId':_0x325e2c},'transaction':_0x5ba353})['then'](function(){var _0x1cb3ee=_[_0x7322('0x3e')](_0x373e98,function(_0x3dbc8f){_0x3dbc8f['SmsAccountId']=_0x325e2c;return _0x3dbc8f;});return db[_0x7322('0x6c')][_0x7322('0xb8')](_0x1cb3ee,{'transaction':_0x5ba353});});}else{_0x2fe125=0x194;_0x494783=[];}});})['then'](function(){if(_0x2fe125!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x325e2c},'order':'priority'})[_0x7322('0x1c')](function(_0x4fce26){_0x494783=_0x4fce26;});}})['catch'](function(_0x394eb8){_0x2fe125=0x1f4;logger[_0x7322('0x21')](_0x394eb8[_0x7322('0x32')]);if(_0x394eb8[_0x7322('0x33')]){delete _0x394eb8['name'];}_0x494783=_0x394eb8;})[_0x7322('0xb9')](function(){if(_0x494783===null){_0x49c337['sendStatus'](_0x2fe125);}else{if(_0x2fe125===0x1f4){_0x49c337[_0x7322('0x26')](_0x2fe125)[_0x7322('0x34')](_0x494783);}else{_0x49c337[_0x7322('0x26')](_0x2fe125)[_0x7322('0x27')](_0x494783);}}});};exports[_0x7322('0xba')]=function(_0x5807db,_0x2c3479,_0x2e2092){var _0xe02f4f={};var _0x271d09={};var _0x4e77f7;var _0x369e49;return db[_0x7322('0x38')][_0x7322('0x63')]({'where':{'id':_0x5807db[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x2c3479,null))[_0x7322('0x1c')](function(_0x48f9c4){if(_0x48f9c4){_0x4e77f7=_0x48f9c4;_0x271d09[_0x7322('0x3d')]=_[_0x7322('0x40')](db[_0x7322('0x6c')][_0x7322('0x39')]);_0x271d09[_0x7322('0x3f')]=_[_0x7322('0x40')](_0x5807db['query']);_0x271d09['filters']=_[_0x7322('0x42')](_0x271d09[_0x7322('0x3d')],_0x271d09[_0x7322('0x3f')]);_0xe02f4f['attributes']=_['intersection'](_0x271d09[_0x7322('0x3d')],qs[_0x7322('0x44')](_0x5807db[_0x7322('0x3f')][_0x7322('0x44')]));_0xe02f4f[_0x7322('0x43')]=_0xe02f4f['attributes'][_0x7322('0x52')]?_0xe02f4f[_0x7322('0x43')]:_0x271d09['model'];_0xe02f4f['order']=qs['sort'](_0x5807db[_0x7322('0x3f')][_0x7322('0x47')]);_0xe02f4f['where']=qs[_0x7322('0x41')](_[_0x7322('0x49')](_0x5807db[_0x7322('0x3f')],_0x271d09[_0x7322('0x41')]));if(_0x5807db[_0x7322('0x3f')][_0x7322('0x4a')]){_0xe02f4f['where']=_['merge'](_0xe02f4f[_0x7322('0x48')],{'$or':_['map'](_0xe02f4f[_0x7322('0x43')],function(_0x1e0943){var _0x500bdb={};_0x500bdb[_0x1e0943]={'$like':'%'+_0x5807db[_0x7322('0x3f')][_0x7322('0x4a')]+'%'};return _0x500bdb;})});}_0xe02f4f=_[_0x7322('0x4c')]({},_0xe02f4f,_0x5807db[_0x7322('0x4d')]);return _0x4e77f7['getApplications'](_0xe02f4f);}})[_0x7322('0x1c')](function(_0x54d616){if(_0x54d616){_0x369e49=_0x54d616['length'];if(!_0x5807db[_0x7322('0x3f')]['hasOwnProperty']('nolimit')){_0xe02f4f[_0x7322('0x2a')]=qs[_0x7322('0x2a')](_0x5807db[_0x7322('0x3f')][_0x7322('0x2a')]);_0xe02f4f[_0x7322('0x28')]=qs['offset'](_0x5807db['query'][_0x7322('0x28')]);}return _0x4e77f7[_0x7322('0xba')](_0xe02f4f);}})[_0x7322('0x1c')](function(_0x59b076){if(_0x59b076){return _0x59b076?{'count':_0x369e49,'rows':_0x59b076}:null;}})[_0x7322('0x1c')](respondWithResult(_0x2c3479,null))['catch'](handleError(_0x2c3479,null));};exports['getInteractions']=function(_0x45a48c,_0x3c2ef7,_0x303dc3){var _0x7a65af={'raw':![],'where':{}};var _0x349fb9={};var _0x25ac89={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x45a48c[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x3c2ef7,null))['then'](function(_0x2d4dc1){if(_0x2d4dc1){_0x349fb9[_0x7322('0x3d')]=_[_0x7322('0x40')](db[_0x7322('0xbb')][_0x7322('0x39')]);_0x349fb9['query']=_['keys'](_0x45a48c[_0x7322('0x3f')]);_0x349fb9[_0x7322('0x41')]=_['intersection'](_0x349fb9[_0x7322('0x3d')],_0x349fb9[_0x7322('0x3f')]);_0x7a65af[_0x7322('0x43')]=_[_0x7322('0x42')](_0x349fb9[_0x7322('0x3d')],qs[_0x7322('0x44')](_0x45a48c['query'][_0x7322('0x44')]));_0x7a65af['attributes']=_0x7a65af[_0x7322('0x43')][_0x7322('0x52')]?_0x7a65af[_0x7322('0x43')]:_0x349fb9[_0x7322('0x3d')];if(!_0x45a48c[_0x7322('0x3f')][_0x7322('0x64')]('nolimit')){_0x7a65af['limit']=qs[_0x7322('0x2a')](_0x45a48c[_0x7322('0x3f')][_0x7322('0x2a')]);_0x7a65af[_0x7322('0x28')]=qs[_0x7322('0x28')](_0x45a48c['query']['offset']);}_0x7a65af[_0x7322('0x46')]=qs[_0x7322('0x47')](_0x45a48c[_0x7322('0x3f')][_0x7322('0x47')]);_0x7a65af['where']=qs['filters'](_[_0x7322('0x49')](_0x45a48c[_0x7322('0x3f')],_0x349fb9[_0x7322('0x41')]));_0x7a65af[_0x7322('0x48')]['SmsAccountId']=_0x2d4dc1['id'];if(_0x45a48c[_0x7322('0x3f')][_0x7322('0x4a')]){_0x7a65af[_0x7322('0x48')]=_[_0x7322('0x4c')](_0x7a65af[_0x7322('0x48')],{'$or':_[_0x7322('0x3e')](_0x7a65af[_0x7322('0x43')],function(_0x4ca864){var _0x416f97={};_0x416f97[_0x4ca864]={'$like':'%'+_0x45a48c['query']['filter']+'%'};return _0x416f97;})});}_0x7a65af=_[_0x7322('0x4c')]({},_0x7a65af,_0x45a48c[_0x7322('0x4d')]);return db[_0x7322('0xbb')][_0x7322('0x2b')]({'where':_0x7a65af[_0x7322('0x48')]})[_0x7322('0x1c')](function(_0x51b8be){_0x25ac89[_0x7322('0x2b')]=_0x51b8be;if(_0x45a48c[_0x7322('0x3f')][_0x7322('0x4e')]){_0x7a65af[_0x7322('0x4f')]=[{'model':db[_0x7322('0x73')],'as':_0x7322('0xbc'),'required':![]},{'model':db[_0x7322('0xaa')],'as':_0x7322('0xbd'),'attributes':[_0x7322('0x33'),_0x7322('0xbe'),_0x7322('0xbf')],'required':![]},{'model':db[_0x7322('0xc0')],'as':'Tags','attributes':['id',_0x7322('0x33'),'color'],'where':_0x45a48c[_0x7322('0x3f')][_0x7322('0xc1')]?{'id':_0x45a48c[_0x7322('0x3f')]['tag']}:undefined,'required':_0x45a48c[_0x7322('0x3f')]['tag']?!![]:![]}];}return db[_0x7322('0xbb')]['findAll'](_0x7a65af);})[_0x7322('0x1c')](function(_0x17884e){_0x25ac89[_0x7322('0x65')]=_0x17884e;return _0x25ac89;});}})[_0x7322('0x1c')](respondWithFilteredResult(_0x3c2ef7,_0x7a65af))['catch'](handleError(_0x3c2ef7,null));};exports[_0x7322('0x34')]=function(_0x38e0ae,_0x14d274,_0xedea3f){var _0x2c7ff6,_0x306a4c,_0xe245ff;if(_[_0x7322('0x91')](_0x38e0ae['body']['body'])||_0x38e0ae[_0x7322('0x54')][_0x7322('0x54')]===''){throw new db[(_0x7322('0x74'))][(_0x7322('0x75'))](_0x7322('0x92'));}if(_[_0x7322('0x91')](_0x38e0ae['body']['to'])){throw new db[(_0x7322('0x74'))]['ValidationError']('to\x20is\x20mandatory');}_0x2c7ff6=_0x38e0ae[_0x7322('0x54')]['to'];return db['SmsAccount'][_0x7322('0x5a')]({'where':{'id':_0x38e0ae[_0x7322('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x7322('0xc2'),'include':[{'model':db[_0x7322('0x73')],'as':_0x7322('0x99'),'where':{'mobile':_0x2c7ff6},'limit':0x1,'order':[[_0x7322('0x77'),'DESC']]}]}]})[_0x7322('0x1c')](handleEntityNotFound(_0x14d274,null))[_0x7322('0x1c')](function(_0x15bc82){if(_0x15bc82&&_0x15bc82[_0x7322('0xc2')]){_0x306a4c=_0x15bc82['get']({'plain':!![]});if(_0x306a4c[_0x7322('0xc2')]&&_0x306a4c[_0x7322('0xc2')][_0x7322('0x99')][_0x7322('0x52')]){return _0x306a4c[_0x7322('0xc2')][_0x7322('0x99')][0x0];}return db[_0x7322('0x73')][_0x7322('0x53')](_[_0x7322('0x9c')](_0x38e0ae['body'],{'firstName':_0x2c7ff6,'mobile':_0x2c7ff6,'phone':_0x2c7ff6,'ListId':_0x306a4c[_0x7322('0x98')]}));}})['then'](handleEntityNotFound(_0x14d274,null))[_0x7322('0x1c')](function(_0x56f992){if(_0x56f992){_0xe245ff=_0x56f992;return db[_0x7322('0xbb')]['find']({'where':{'ContactId':_0xe245ff['id'],'closed':![],'SmsAccountId':_0x306a4c['id']}})[_0x7322('0x1c')](function(_0x62de96){if(_0x62de96){return[_0x62de96,![]];}return db[_0x7322('0xbb')][_0x7322('0x53')]({'UserId':_0x38e0ae[_0x7322('0x55')]['id'],'ContactId':_0xe245ff['id'],'SmsAccountId':_0x306a4c['id'],'phone':_0x2c7ff6,'firstMsgDirection':'out','Messages':[_[_0x7322('0x4c')](_0x38e0ae[_0x7322('0x54')],{'read':![],'body':_0x38e0ae[_0x7322('0x54')][_0x7322('0x54')],'phone':_0x2c7ff6,'SmsAccountId':_0x306a4c['id'],'UserId':_0x38e0ae[_0x7322('0x55')]['id'],'ContactId':_0xe245ff['id']})]},{'include':[{'model':db[_0x7322('0xa6')],'as':_0x7322('0xc3')}]})['then'](function(_0x28abee){return[_0x28abee,!![]];});});}})[_0x7322('0x9e')](function(_0x2ef0bf,_0x164d89){if(_0x164d89){return _0x2ef0bf;}return db[_0x7322('0xa6')][_0x7322('0x53')](_[_0x7322('0x4c')](_0x38e0ae[_0x7322('0x54')],{'read':![],'body':_0x38e0ae[_0x7322('0x54')][_0x7322('0x54')],'phone':_0x2c7ff6,'SmsAccountId':_0x306a4c['id'],'SmsInteractionId':_0x2ef0bf['id'],'UserId':_0x38e0ae[_0x7322('0x55')]['id'],'ContactId':_0xe245ff['id']}))[_0x7322('0x1c')](function(_0x2dbba4){_0x2ef0bf['dataValues']['Messages']=[];_0x2ef0bf[_0x7322('0xc4')][_0x7322('0xc3')][_0x7322('0xa2')](_0x2dbba4[_0x7322('0xc4')]);return _0x2ef0bf;});})[_0x7322('0x1c')](respondWithResult(_0x14d274,null))[_0x7322('0x25')](handleError(_0x14d274,null));};exports[_0x7322('0x26')]=function(_0x2530b9,_0x3517f5,_0x191bd7){if(_0x2530b9[_0x7322('0x54')]['id']){delete _0x2530b9['body']['id'];}var _0x18892f,_0x385820,_0x55686b;return db[_0x7322('0x38')][_0x7322('0x5a')]({'where':{'id':_0x2530b9['params']['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x3517f5,null))[_0x7322('0x1c')](function(_0x582899){if(_0x582899){_0x55686b=_0x582899;logger[_0x7322('0xb3')](_0x7322('0x1f'),_0x7322('0x26'),_0x7322('0xc5'),_0x582899[_0x7322('0x3b')],util[_0x7322('0xc6')](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));switch(_0x582899[_0x7322('0x3b')]){case _0x7322('0x7e'):if(_0x2530b9[_0x7322('0x54')][_0x7322('0xc7')]&&_0x2530b9['body'][_0x7322('0x26')]){_0x385820=_0x2530b9[_0x7322('0x54')][_0x7322('0x26')];return db[_0x7322('0xa6')][_0x7322('0x5a')]({'where':{'messageId':_0x2530b9['body']['skebby_dispatch_id']}});}break;case _0x7322('0x80'):if(_0x2530b9[_0x7322('0x54')][_0x7322('0xc8')]&&_0x2530b9['body']['statusInt']){_0x385820=_0x2530b9['body'][_0x7322('0xc9')];return db[_0x7322('0xa6')][_0x7322('0x5a')]({'where':{'messageId':_0x2530b9[_0x7322('0x54')][_0x7322('0xc8')]}});}break;case _0x7322('0x81'):if(_0x2530b9[_0x7322('0x54')][_0x7322('0x82')]&&_0x2530b9['body']['status_code']){_0x385820=_0x2530b9[_0x7322('0x54')]['status_code'];return db[_0x7322('0xa6')][_0x7322('0x5a')]({'where':{'messageId':_0x2530b9[_0x7322('0x54')]['message_id']}});}break;case'infobip':var _0xe90eda=_0x2530b9[_0x7322('0x54')][_0x7322('0x87')][0x0];if(_0xe90eda['messageId']&&_0xe90eda[_0x7322('0x26')][_0x7322('0xca')]==='DELIVERED'){_0x385820=_0xe90eda['status']['groupName'];return db['SmsMessage'][_0x7322('0x5a')]({'where':{'messageId':_0xe90eda[_0x7322('0x7c')]}});}break;case _0x7322('0x8b'):if(_0x2530b9['body']['messageId']&&_0x2530b9[_0x7322('0x54')][_0x7322('0x26')]){_0x385820=_0x2530b9['body'][_0x7322('0x26')];return db['SmsMessage']['find']({'where':{'messageId':_0x2530b9['body'][_0x7322('0x7c')]}});}break;case'bandwidth':if(_0x2530b9[_0x7322('0x54')][0x0][_0x7322('0x23')]['id']){_0x385820=_0x2530b9[_0x7322('0x54')][0x0]['type'];return db[_0x7322('0xa6')][_0x7322('0x5a')]({'where':{'messageId':_0x2530b9[_0x7322('0x54')][0x0][_0x7322('0x23')]['id']}});}break;case _0x7322('0x8f'):if(_0x2530b9[_0x7322('0x54')][_0x7322('0xcb')]&&_0x2530b9['body']['status']){_0x385820=_0x2530b9[_0x7322('0x54')][_0x7322('0x26')];return db['SmsMessage']['find']({'where':{'messageId':_0x2530b9[_0x7322('0x54')][_0x7322('0xcb')]}});}break;}}})['then'](handleEntityNotFound(_0x3517f5,null))['then'](function(_0x335da1){if(_0x335da1){_0x18892f=_0x335da1;switch(_0x55686b[_0x7322('0x3b')]){case _0x7322('0x7e'):if(_0x385820==='DELIVERED'){return _0x18892f[_0x7322('0x2e')]({'read':!![]});}else{logger[_0x7322('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7322('0x26'),_0x7322('0x7e'),util['inspect'](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x385820==='1'){return _0x18892f['update']({'read':!![]});}else{logger[_0x7322('0x21')](_0x7322('0x1f'),'status',_0x7322('0x7e'),util[_0x7322('0xc6')](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;case _0x7322('0x81'):if(!_0x2530b9[_0x7322('0x54')][_0x7322('0xcc')]&&_0x385820>=0xc8&&_0x385820<=0xce){return _0x18892f['update']({'read':!![]});}else{logger['error'](_0x7322('0x1f'),_0x7322('0x26'),_0x7322('0x81'),util[_0x7322('0xc6')](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;case _0x7322('0x86'):var _0x44fd9d=_0x2530b9[_0x7322('0x54')][_0x7322('0x87')][0x0];if(_0x44fd9d[_0x7322('0x26')][_0x7322('0xca')]===_0x7322('0xcd')){return _0x18892f[_0x7322('0x2e')]({'read':!![]});}else{logger[_0x7322('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7322('0x26'),'infobip',util['inspect'](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;case _0x7322('0x8b'):if(_0x385820=='DELIVERED_TO_GATEWAY'||_0x385820=='RECEIVED_BY_RECIPIENT'){return _0x18892f[_0x7322('0x2e')]({'read':!![]});}else{logger['error'](_0x7322('0x1f'),_0x7322('0x26'),_0x7322('0x8b'),util[_0x7322('0xc6')](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x385820==_0x7322('0xce')){return _0x18892f[_0x7322('0x2e')]({'read':!![]});}else{logger[_0x7322('0x21')](_0x7322('0x1f'),_0x7322('0x26'),_0x7322('0x8e'),util[_0x7322('0xc6')](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;case _0x7322('0x8f'):if(_0x385820===_0x7322('0xcf')||_0x385820===_0x7322('0xd0')){return _0x18892f['update']({'read':!![]});}else{logger[_0x7322('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7322('0x8f'),util[_0x7322('0xc6')](_0x2530b9[_0x7322('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x18892f;}})[_0x7322('0x1c')](respondWithResult(_0x3517f5,null))[_0x7322('0x25')](handleError(_0x3517f5,null));};exports['statusGet']=function(_0x2053db,_0x328473,_0x53b079){var _0x3294bf,_0x210e09,_0x4cd85c;return db[_0x7322('0x38')][_0x7322('0x5a')]({'where':{'id':_0x2053db[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x328473,null))[_0x7322('0x1c')](function(_0x4cff9d){if(_0x4cff9d){_0x4cd85c=_0x4cff9d;logger['debug'](_0x7322('0x1f'),_0x7322('0x26'),_0x7322('0xc5'),_0x4cff9d[_0x7322('0x3b')],util['inspect'](_0x2053db[_0x7322('0x3f')],{'showHidden':![],'depth':null}));switch(_0x4cff9d[_0x7322('0x3b')]){case'csc':if(_0x2053db[_0x7322('0x3f')][_0x7322('0xd1')]&&_0x2053db['query'][_0x7322('0xd2')]){_0x210e09=_0x2053db[_0x7322('0x3f')][_0x7322('0xd2')];return db['SmsMessage'][_0x7322('0x5a')]({'where':{'messageId':_0x2053db[_0x7322('0x3f')][_0x7322('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x328473,null))[_0x7322('0x1c')](function(_0x201d2a){if(_0x201d2a){_0x3294bf=_0x201d2a;switch(_0x4cd85c['type']){case _0x7322('0x88'):if(_0x210e09==='2'||_0x210e09==='6'){return _0x3294bf[_0x7322('0x2e')]({'read':!![]});}else{logger[_0x7322('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7322('0x26'),_0x7322('0x88'),util[_0x7322('0xc6')](_0x2053db[_0x7322('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x3294bf;}})['then'](respondWithResult(_0x328473,null))[_0x7322('0x25')](handleError(_0x328473,null));};exports['addAgents']=function(_0x1838e1,_0x2405b6,_0x2bde76){return db['SmsAccount']['find']({'where':{'id':_0x1838e1[_0x7322('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2405b6,null))[_0x7322('0x1c')](function(_0x19c72e){if(_0x19c72e){return _0x19c72e[_0x7322('0xd3')](_0x1838e1[_0x7322('0x54')][_0x7322('0x67')],_['omit'](_0x1838e1[_0x7322('0x54')],[_0x7322('0x67'),'id'])||{})[_0x7322('0x9e')](function(_0x51783b){for(var _0x1b3898=0x0;_0x1b3898<_0x1838e1[_0x7322('0x54')][_0x7322('0x67')]['length'];_0x1b3898+=0x1){socket[_0x7322('0xd4')](_0x7322('0xd5'),{'UserId':Number(_0x1838e1[_0x7322('0x54')][_0x7322('0x67')][_0x1b3898]),'SmsAccountId':Number(_0x1838e1[_0x7322('0x5d')]['id'])});}return _0x51783b;});}})[_0x7322('0x1c')](respondWithResult(_0x2405b6,null))[_0x7322('0x25')](handleError(_0x2405b6,null));};exports['removeAgents']=function(_0x418113,_0x445202,_0x2336f3){return db[_0x7322('0x38')][_0x7322('0x5a')]({'where':{'id':_0x418113[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x445202,null))[_0x7322('0x1c')](function(_0x891999){if(_0x891999){return _0x891999['removeAgents'](_0x418113[_0x7322('0x3f')][_0x7322('0x67')])[_0x7322('0x1c')](function(){if(_[_0x7322('0xd6')](_0x418113['query'][_0x7322('0x67')])){for(var _0x169314=0x0;_0x169314<_0x418113[_0x7322('0x3f')]['ids']['length'];_0x169314+=0x1){socket[_0x7322('0xd4')](_0x7322('0xd7'),{'UserId':Number(_0x418113[_0x7322('0x3f')]['ids'][_0x169314]),'SmsAccountId':Number(_0x418113[_0x7322('0x5d')]['id'])});}}else{socket[_0x7322('0xd4')](_0x7322('0xd7'),{'UserId':Number(_0x418113[_0x7322('0x3f')]['ids']),'SmsAccountId':Number(_0x418113[_0x7322('0x5d')]['id'])});}});}})[_0x7322('0x1c')](respondWithStatusCode(_0x445202,null))['catch'](handleError(_0x445202,null));};exports[_0x7322('0xd8')]=function(_0x5195df,_0x13d219,_0x1a4bec){var _0x55fe99={};var _0x4a0297={};var _0x457478;var _0x31c376;return db[_0x7322('0x38')][_0x7322('0x63')]({'where':{'id':_0x5195df[_0x7322('0x5d')]['id']}})[_0x7322('0x1c')](handleEntityNotFound(_0x13d219,null))[_0x7322('0x1c')](function(_0x1d2a1a){if(_0x1d2a1a){_0x457478=_0x1d2a1a;_0x4a0297[_0x7322('0x3d')]=_[_0x7322('0x40')](db[_0x7322('0xaa')]['rawAttributes']);_0x4a0297[_0x7322('0x3f')]=_[_0x7322('0x40')](_0x5195df[_0x7322('0x3f')]);_0x4a0297[_0x7322('0x41')]=_['intersection'](_0x4a0297[_0x7322('0x3d')],_0x4a0297[_0x7322('0x3f')]);_0x55fe99[_0x7322('0x43')]=_['intersection'](_0x4a0297['model'],qs[_0x7322('0x44')](_0x5195df[_0x7322('0x3f')]['fields']));_0x55fe99[_0x7322('0x43')]=_0x55fe99[_0x7322('0x43')]['length']?_0x55fe99[_0x7322('0x43')]:_0x4a0297['model'];_0x55fe99[_0x7322('0x46')]=qs['sort'](_0x5195df['query'][_0x7322('0x47')]);_0x55fe99['where']=qs[_0x7322('0x41')](_[_0x7322('0x49')](_0x5195df[_0x7322('0x3f')],_0x4a0297[_0x7322('0x41')]));if(_0x5195df['query'][_0x7322('0x4a')]){_0x55fe99['where']=_[_0x7322('0x4c')](_0x55fe99[_0x7322('0x48')],{'$or':_[_0x7322('0x3e')](_0x55fe99['attributes'],function(_0x235449){var _0x3c2e49={};_0x3c2e49[_0x235449]={'$like':'%'+_0x5195df['query']['filter']+'%'};return _0x3c2e49;})});}_0x55fe99=_['merge']({},_0x55fe99,_0x5195df[_0x7322('0x4d')]);return _0x457478[_0x7322('0xd8')](_0x55fe99);}})[_0x7322('0x1c')](function(_0x1a021e){if(_0x1a021e){_0x31c376=_0x1a021e[_0x7322('0x52')];if(!_0x5195df[_0x7322('0x3f')]['hasOwnProperty'](_0x7322('0x45'))){_0x55fe99[_0x7322('0x2a')]=qs[_0x7322('0x2a')](_0x5195df[_0x7322('0x3f')]['limit']);_0x55fe99['offset']=qs[_0x7322('0x28')](_0x5195df['query'][_0x7322('0x28')]);}return _0x457478[_0x7322('0xd8')](_0x55fe99);}})[_0x7322('0x1c')](function(_0x5f42a1){if(_0x5f42a1){return _0x5f42a1?{'count':_0x31c376,'rows':_0x5f42a1}:null;}})[_0x7322('0x1c')](respondWithResult(_0x13d219,null))['catch'](handleError(_0x13d219,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 78add7a..882b5b5 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 _0x4757=['remove','emit','events','../../mysqldb','setMaxListeners','save'];(function(_0xb0f09f,_0x177e87){var _0x5a8624=function(_0x4b8f64){while(--_0x4b8f64){_0xb0f09f['push'](_0xb0f09f['shift']());}};_0x5a8624(++_0x177e87);}(_0x4757,0x182));var _0x7475=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x4757[_0x4b2251];return _0x5d22fb;};'use strict';var EventEmitter=require(_0x7475('0x0'));var SmsAccount=require(_0x7475('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7475('0x2')](0x0);var events={'afterCreate':_0x7475('0x3'),'afterUpdate':'update','afterDestroy':_0x7475('0x4')};function emitEvent(_0x5eefb2){return function(_0x4e9fc1,_0x185cb6,_0x5c7db1){SmsAccountEvents[_0x7475('0x5')](_0x5eefb2+':'+_0x4e9fc1['id'],_0x4e9fc1);SmsAccountEvents[_0x7475('0x5')](_0x5eefb2,_0x4e9fc1);_0x5c7db1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x014e=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x014e,0xcb));var _0xe014=function(_0x2204c8,_0x467482){_0x2204c8=_0x2204c8-0x0;var _0x33d651=_0x014e[_0x2204c8];return _0x33d651;};'use strict';var EventEmitter=require(_0xe014('0x0'));var SmsAccount=require(_0xe014('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe014('0x2')](0x0);var events={'afterCreate':_0xe014('0x3'),'afterUpdate':_0xe014('0x4'),'afterDestroy':_0xe014('0x5')};function emitEvent(_0x1e145f){return function(_0x1d054c,_0x6c29b4,_0xa71dc4){SmsAccountEvents[_0xe014('0x6')](_0x1e145f+':'+_0x1d054c['id'],_0x1d054c);SmsAccountEvents[_0xe014('0x6')](_0x1e145f,_0x1d054c);_0xa71dc4(null);};}for(var e in events){if(events[_0xe014('0x7')](e)){var event=events[e];SmsAccount[_0xe014('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 8579d3e..a59827b 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 _0xd23a=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','sms_accounts'];(function(_0x1460e8,_0x32dd02){var _0x774acf=function(_0x18f3d0){while(--_0x18f3d0){_0x1460e8['push'](_0x1460e8['shift']());}};_0x774acf(++_0x32dd02);}(_0xd23a,0xe7));var _0xad23=function(_0x39452c,_0x463b7f){_0x39452c=_0x39452c-0x0;var _0x2cd62b=_0xd23a[_0x39452c];return _0x2cd62b;};'use strict';var _=require(_0xad23('0x0'));var util=require('util');var logger=require(_0xad23('0x1'))(_0xad23('0x2'));var moment=require(_0xad23('0x3'));var BPromise=require(_0xad23('0x4'));var rp=require(_0xad23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad23('0x6'));var config=require(_0xad23('0x7'));var attributes=require('./smsAccount.attributes');module[_0xad23('0x8')]=function(_0x1246b7,_0x46c3e2){return _0x1246b7[_0xad23('0x9')]('SmsAccount',attributes,{'tableName':_0xad23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf96=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount'];(function(_0x2c763e,_0x4654de){var _0x53b5b8=function(_0x449c4b){while(--_0x449c4b){_0x2c763e['push'](_0x2c763e['shift']());}};_0x53b5b8(++_0x4654de);}(_0xbf96,0x190));var _0x6bf9=function(_0x4e989b,_0x38f1a4){_0x4e989b=_0x4e989b-0x0;var _0x3dc278=_0xbf96[_0x4e989b];return _0x3dc278;};'use strict';var _=require('lodash');var util=require(_0x6bf9('0x0'));var logger=require(_0x6bf9('0x1'))(_0x6bf9('0x2'));var moment=require('moment');var BPromise=require(_0x6bf9('0x3'));var rp=require(_0x6bf9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bf9('0x5'));var config=require(_0x6bf9('0x6'));var attributes=require(_0x6bf9('0x7'));module['exports']=function(_0x2607d7,_0x168c3e){return _0x2607d7[_0x6bf9('0x8')](_0x6bf9('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 8f9ce05..c88c53e 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 _0x3f59=['../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsAccount.socket','register','info','request\x20sent','debug','error','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','model','attributes','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x261d89,_0x643421){var _0x407b65=function(_0x2f0f97){while(--_0x2f0f97){_0x261d89['push'](_0x261d89['shift']());}};_0x407b65(++_0x643421);}(_0x3f59,0x7e));var _0x93f5=function(_0x2900b5,_0xb0c872){_0x2900b5=_0x2900b5-0x0;var _0x35eceb=_0x3f59[_0x2900b5];return _0x35eceb;};'use strict';var _=require('lodash');var util=require(_0x93f5('0x0'));var moment=require(_0x93f5('0x1'));var BPromise=require(_0x93f5('0x2'));var rs=require(_0x93f5('0x3'));var fs=require('fs');var Redis=require(_0x93f5('0x4'));var db=require(_0x93f5('0x5'))['db'];var utils=require(_0x93f5('0x6'));var logger=require('../../config/logger')(_0x93f5('0x7'));var config=require(_0x93f5('0x8'));var jayson=require(_0x93f5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x93f5('0xa')]=_['defaults'](config[_0x93f5('0xa')],{'host':_0x93f5('0xb'),'port':0x18eb});var socket=require(_0x93f5('0xc'))(new Redis(config[_0x93f5('0xa')]));require(_0x93f5('0xd'))[_0x93f5('0xe')](socket);function respondWithRpcPromise(_0x1e5f55,_0x4783bf,_0x22e5a2){return new BPromise(function(_0x5687ea,_0x476971){return client['request'](_0x1e5f55,_0x22e5a2)['then'](function(_0x461325){logger[_0x93f5('0xf')]('SmsAccount,\x20%s,\x20%s',_0x4783bf,_0x93f5('0x10'));logger[_0x93f5('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4783bf,_0x93f5('0x10'),JSON['stringify'](_0x461325));if(_0x461325['error']){if(_0x461325[_0x93f5('0x12')]['code']===0x1f4){logger[_0x93f5('0x12')](_0x93f5('0x13'),_0x4783bf,_0x461325[_0x93f5('0x12')]['message']);return _0x476971(_0x461325[_0x93f5('0x12')][_0x93f5('0x14')]);}logger[_0x93f5('0x12')](_0x93f5('0x13'),_0x4783bf,_0x461325[_0x93f5('0x12')][_0x93f5('0x14')]);return _0x5687ea(_0x461325[_0x93f5('0x12')][_0x93f5('0x14')]);}else{logger[_0x93f5('0xf')]('SmsAccount,\x20%s,\x20%s',_0x4783bf,_0x93f5('0x10'));_0x5687ea(_0x461325['result'][_0x93f5('0x14')]);}})[_0x93f5('0x15')](function(_0x19e7d5){logger[_0x93f5('0x12')](_0x93f5('0x13'),_0x4783bf,_0x19e7d5);_0x476971(_0x19e7d5);});});}exports[_0x93f5('0x16')]=function(_0x1c07fc){var _0x37c339=this;return new Promise(function(_0x4ad93c,_0x3be803){return db[_0x93f5('0x17')][_0x93f5('0x18')]({'raw':_0x1c07fc[_0x93f5('0x19')]?_0x1c07fc[_0x93f5('0x19')][_0x93f5('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c07fc[_0x93f5('0x19')]?_0x1c07fc[_0x93f5('0x19')][_0x93f5('0x1b')]||null:null,'attributes':_0x1c07fc['options']?_0x1c07fc['options']['attributes']||null:null,'include':_0x1c07fc['options']?_0x1c07fc[_0x93f5('0x19')][_0x93f5('0x1c')]?_[_0x93f5('0x1d')](_0x1c07fc['options'][_0x93f5('0x1c')],function(_0x1f890a){return{'model':db[_0x1f890a[_0x93f5('0x1e')]],'as':_0x1f890a['as'],'attributes':_0x1f890a[_0x93f5('0x1f')],'include':_0x1f890a[_0x93f5('0x1c')]?_[_0x93f5('0x1d')](_0x1f890a['include'],function(_0x4ecfb7){return{'model':db[_0x4ecfb7['model']],'as':_0x4ecfb7['as'],'attributes':_0x4ecfb7[_0x93f5('0x1f')],'include':_0x4ecfb7[_0x93f5('0x1c')]?_['map'](_0x4ecfb7['include'],function(_0x54c88a){return{'model':db[_0x54c88a[_0x93f5('0x1e')]],'as':_0x54c88a['as'],'attributes':_0x54c88a[_0x93f5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21ece6){logger[_0x93f5('0xf')](_0x93f5('0x16'),_0x1c07fc);logger[_0x93f5('0x11')](_0x93f5('0x16'),_0x1c07fc,JSON[_0x93f5('0x20')](_0x21ece6));_0x4ad93c(_0x21ece6);})[_0x93f5('0x15')](function(_0x5a253d){logger[_0x93f5('0x12')](_0x93f5('0x16'),_0x5a253d[_0x93f5('0x14')],_0x1c07fc);_0x3be803(_0x37c339[_0x93f5('0x12')](0x1f4,_0x5a253d[_0x93f5('0x14')]));});});}; \ No newline at end of file +var _0x4f4d=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsAccount','find','options','raw','attributes','include','model','map','ShowSmsAccount','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4f4d,0x1e7));var _0xd4f4=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0x4f4d[_0x1b1365];return _0x5edfd8;};'use strict';var _=require(_0xd4f4('0x0'));var util=require(_0xd4f4('0x1'));var moment=require(_0xd4f4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd4f4('0x4'));var logger=require(_0xd4f4('0x5'))(_0xd4f4('0x6'));var config=require(_0xd4f4('0x7'));var jayson=require(_0xd4f4('0x8'));var client=jayson['client'][_0xd4f4('0x9')]({'port':0x232a});config[_0xd4f4('0xa')]=_['defaults'](config[_0xd4f4('0xa')],{'host':_0xd4f4('0xb'),'port':0x18eb});var socket=require(_0xd4f4('0xc'))(new Redis(config[_0xd4f4('0xa')]));require(_0xd4f4('0xd'))[_0xd4f4('0xe')](socket);function respondWithRpcPromise(_0xee4cb9,_0x4f8e06,_0x14dad3){return new BPromise(function(_0x257899,_0x5d0ae4){return client[_0xd4f4('0xf')](_0xee4cb9,_0x14dad3)[_0xd4f4('0x10')](function(_0xa38617){logger[_0xd4f4('0x11')](_0xd4f4('0x12'),_0x4f8e06,_0xd4f4('0x13'));logger[_0xd4f4('0x14')](_0xd4f4('0x15'),_0x4f8e06,_0xd4f4('0x13'),JSON[_0xd4f4('0x16')](_0xa38617));if(_0xa38617[_0xd4f4('0x17')]){if(_0xa38617[_0xd4f4('0x17')]['code']===0x1f4){logger['error'](_0xd4f4('0x12'),_0x4f8e06,_0xa38617['error'][_0xd4f4('0x18')]);return _0x5d0ae4(_0xa38617[_0xd4f4('0x17')]['message']);}logger[_0xd4f4('0x17')](_0xd4f4('0x12'),_0x4f8e06,_0xa38617['error'][_0xd4f4('0x18')]);return _0x257899(_0xa38617[_0xd4f4('0x17')][_0xd4f4('0x18')]);}else{logger['info'](_0xd4f4('0x12'),_0x4f8e06,_0xd4f4('0x13'));_0x257899(_0xa38617[_0xd4f4('0x19')][_0xd4f4('0x18')]);}})['catch'](function(_0x1e87d3){logger[_0xd4f4('0x17')](_0xd4f4('0x12'),_0x4f8e06,_0x1e87d3);_0x5d0ae4(_0x1e87d3);});});}exports['ShowSmsAccount']=function(_0x1dda57){var _0x5a4cd7=this;return new Promise(function(_0x23465f,_0x56047e){return db[_0xd4f4('0x1a')][_0xd4f4('0x1b')]({'raw':_0x1dda57[_0xd4f4('0x1c')]?_0x1dda57[_0xd4f4('0x1c')][_0xd4f4('0x1d')]===undefined?!![]:![]:!![],'where':_0x1dda57[_0xd4f4('0x1c')]?_0x1dda57['options']['where']||null:null,'attributes':_0x1dda57[_0xd4f4('0x1c')]?_0x1dda57[_0xd4f4('0x1c')][_0xd4f4('0x1e')]||null:null,'include':_0x1dda57[_0xd4f4('0x1c')]?_0x1dda57['options'][_0xd4f4('0x1f')]?_['map'](_0x1dda57[_0xd4f4('0x1c')][_0xd4f4('0x1f')],function(_0x2f677b){return{'model':db[_0x2f677b[_0xd4f4('0x20')]],'as':_0x2f677b['as'],'attributes':_0x2f677b[_0xd4f4('0x1e')],'include':_0x2f677b['include']?_[_0xd4f4('0x21')](_0x2f677b['include'],function(_0x15f4d7){return{'model':db[_0x15f4d7[_0xd4f4('0x20')]],'as':_0x15f4d7['as'],'attributes':_0x15f4d7[_0xd4f4('0x1e')],'include':_0x15f4d7[_0xd4f4('0x1f')]?_[_0xd4f4('0x21')](_0x15f4d7[_0xd4f4('0x1f')],function(_0x529943){return{'model':db[_0x529943['model']],'as':_0x529943['as'],'attributes':_0x529943[_0xd4f4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd4f4('0x10')](function(_0x55b146){logger[_0xd4f4('0x11')]('ShowSmsAccount',_0x1dda57);logger[_0xd4f4('0x14')](_0xd4f4('0x22'),_0x1dda57,JSON[_0xd4f4('0x16')](_0x55b146));_0x23465f(_0x55b146);})[_0xd4f4('0x23')](function(_0x375a10){logger[_0xd4f4('0x17')](_0xd4f4('0x22'),_0x375a10[_0xd4f4('0x18')],_0x1dda57);_0x56047e(_0x5a4cd7[_0xd4f4('0x17')](0x1f4,_0x375a10[_0xd4f4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 25f06a4..30e6a1d 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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 +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(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 00691ca..ef1f829 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x4961f6,_0x30cb09){var _0x5f1504=function(_0x28830e){while(--_0x28830e){_0x4961f6['push'](_0x4961f6['shift']());}};_0x5f1504(++_0x30cb09);}(_0x008c,0x188));var _0xc008=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x008c[_0x5c7525];return _0x2e2ec8;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=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(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 8c6473e..6e72262 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 _0xc4f1=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0xc4f1,0x11f));var _0x1c4f=function(_0x551811,_0xa8b3cd){_0x551811=_0x551811-0x0;var _0x423607=_0xc4f1[_0x551811];return _0x423607;};'use strict';var Sequelize=require('sequelize');module[_0x1c4f('0x0')]={'priority':{'type':Sequelize[_0x1c4f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1c4f('0x2')],'allowNull':![],'defaultValue':_0x1c4f('0x3')},'appdata':{'type':Sequelize[_0x1c4f('0x4')]()},'description':{'type':Sequelize[_0x1c4f('0x2')]},'interval':{'type':Sequelize[_0x1c4f('0x2')],'defaultValue':_0x1c4f('0x5')}}; \ No newline at end of file +var _0x757c=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xe71557,_0x40fb88){var _0x144f1b=function(_0x47cd6e){while(--_0x47cd6e){_0xe71557['push'](_0xe71557['shift']());}};_0x144f1b(++_0x40fb88);}(_0x757c,0x191));var _0xc757=function(_0x20b437,_0x5ceb88){_0x20b437=_0x20b437-0x0;var _0x3caa58=_0x757c[_0x20b437];return _0x3caa58;};'use strict';var Sequelize=require(_0xc757('0x0'));module[_0xc757('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc757('0x2')],'allowNull':![],'defaultValue':_0xc757('0x3')},'appdata':{'type':Sequelize[_0xc757('0x4')]()},'description':{'type':Sequelize[_0xc757('0x2')]},'interval':{'type':Sequelize[_0xc757('0x2')],'defaultValue':_0xc757('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0faa4df..a5cffc1 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 _0x6519=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','include','findAll','rows','catch','includeAll','options','create','body','find','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0x6519,0x120));var _0x9651=function(_0x2f71c1,_0x319017){_0x2f71c1=_0x2f71c1-0x0;var _0x411bb7=_0x6519[_0x2f71c1];return _0x411bb7;};'use strict';var emlformat=require(_0x9651('0x0'));var rimraf=require(_0x9651('0x1'));var zipdir=require(_0x9651('0x2'));var jsonpatch=require(_0x9651('0x3'));var rp=require(_0x9651('0x4'));var moment=require(_0x9651('0x5'));var BPromise=require(_0x9651('0x6'));var Mustache=require('mustache');var util=require(_0x9651('0x7'));var path=require(_0x9651('0x8'));var sox=require(_0x9651('0x9'));var csv=require(_0x9651('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9651('0xb'));var _=require(_0x9651('0xc'));var squel=require(_0x9651('0xd'));var crypto=require(_0x9651('0xe'));var jsforce=require(_0x9651('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9651('0xa'));var querystring=require('querystring');var Papa=require(_0x9651('0x10'));var Redis=require(_0x9651('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9651('0x12'));var hardwareService=require(_0x9651('0x13'));var logger=require(_0x9651('0x14'))(_0x9651('0x15'));var utils=require(_0x9651('0x16'));var config=require(_0x9651('0x17'));var licenseUtil=require(_0x9651('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f540a,_0x2f8adb){_0x2f8adb=_0x2f8adb||0xcc;return function(_0x5e881d){if(_0x5e881d){return _0x2f540a[_0x9651('0x19')](_0x2f8adb);}return _0x2f540a[_0x9651('0x1a')](_0x2f8adb)[_0x9651('0x1b')]();};}function respondWithResult(_0x271481,_0x39d774){_0x39d774=_0x39d774||0xc8;return function(_0xcecbc8){if(_0xcecbc8){return _0x271481[_0x9651('0x1a')](_0x39d774)[_0x9651('0x1c')](_0xcecbc8);}};}function respondWithFilteredResult(_0x472be1,_0x485721){return function(_0x5dfe9a){if(_0x5dfe9a){var _0x5ef68a=typeof _0x485721[_0x9651('0x1d')]===_0x9651('0x1e')&&typeof _0x485721[_0x9651('0x1f')]===_0x9651('0x1e');var _0x5b63d9=_0x5dfe9a[_0x9651('0x20')];var _0xe11615=_0x5ef68a?0x0:_0x485721[_0x9651('0x1d')];var _0x3d007b=_0x5ef68a?_0x5dfe9a[_0x9651('0x20')]:_0x485721[_0x9651('0x1d')]+_0x485721[_0x9651('0x1f')];var _0x1769a3;if(_0x3d007b>=_0x5b63d9){_0x3d007b=_0x5b63d9;_0x1769a3=0xc8;}else{_0x1769a3=0xce;}_0x472be1[_0x9651('0x1a')](_0x1769a3);return _0x472be1[_0x9651('0x21')](_0x9651('0x22'),_0xe11615+'-'+_0x3d007b+'/'+_0x5b63d9)[_0x9651('0x1c')](_0x5dfe9a);}return null;};}function patchUpdates(_0x55445d){return function(_0x345dbf){try{jsonpatch[_0x9651('0x23')](_0x345dbf,_0x55445d,!![]);}catch(_0x3ff2e6){return BPromise[_0x9651('0x24')](_0x3ff2e6);}return _0x345dbf[_0x9651('0x25')]();};}function saveUpdates(_0x338823,_0x517f87){return function(_0xc79d32){if(_0xc79d32){return _0xc79d32[_0x9651('0x26')](_0x338823)['then'](function(_0x1b43a6){return _0x1b43a6;});}return null;};}function removeEntity(_0x2bb4dc,_0x4e0951){return function(_0x1d1463){if(_0x1d1463){return _0x1d1463['destroy']()[_0x9651('0x27')](function(){_0x2bb4dc['status'](0xcc)[_0x9651('0x1b')]();});}};}function handleEntityNotFound(_0x7b5fa,_0x76fd09){return function(_0x51fecb){if(!_0x51fecb){_0x7b5fa['sendStatus'](0x194);}return _0x51fecb;};}function handleError(_0x15a697,_0x3aa045){_0x3aa045=_0x3aa045||0x1f4;return function(_0x58b5a9){logger[_0x9651('0x28')](_0x58b5a9[_0x9651('0x29')]);if(_0x58b5a9['name']){delete _0x58b5a9[_0x9651('0x2a')];}_0x15a697['status'](_0x3aa045)[_0x9651('0x2b')](_0x58b5a9);};}exports[_0x9651('0x2c')]=function(_0x4e3ad5,_0x84a959){var _0x1bbe01={},_0x195270={},_0x128230={'count':0x0,'rows':[]};var _0x5085f9=_[_0x9651('0x2d')](db[_0x9651('0x2e')][_0x9651('0x2f')],function(_0x389c97){return{'name':_0x389c97[_0x9651('0x30')],'type':_0x389c97[_0x9651('0x31')]['key']};});_0x195270['model']=_[_0x9651('0x2d')](_0x5085f9,_0x9651('0x2a'));_0x195270[_0x9651('0x32')]=_[_0x9651('0x33')](_0x4e3ad5['query']);_0x195270[_0x9651('0x34')]=_[_0x9651('0x35')](_0x195270[_0x9651('0x36')],_0x195270['query']);_0x1bbe01['attributes']=_[_0x9651('0x35')](_0x195270[_0x9651('0x36')],qs[_0x9651('0x37')](_0x4e3ad5[_0x9651('0x32')][_0x9651('0x37')]));_0x1bbe01[_0x9651('0x38')]=_0x1bbe01[_0x9651('0x38')][_0x9651('0x39')]?_0x1bbe01[_0x9651('0x38')]:_0x195270['model'];if(!_0x4e3ad5['query'][_0x9651('0x3a')]('nolimit')){_0x1bbe01[_0x9651('0x1f')]=qs['limit'](_0x4e3ad5[_0x9651('0x32')][_0x9651('0x1f')]);_0x1bbe01[_0x9651('0x1d')]=qs[_0x9651('0x1d')](_0x4e3ad5[_0x9651('0x32')][_0x9651('0x1d')]);}_0x1bbe01['order']=qs[_0x9651('0x3b')](_0x4e3ad5[_0x9651('0x32')][_0x9651('0x3b')]);_0x1bbe01[_0x9651('0x3c')]=qs[_0x9651('0x34')](_[_0x9651('0x3d')](_0x4e3ad5[_0x9651('0x32')],_0x195270['filters']),_0x5085f9);if(_0x4e3ad5[_0x9651('0x32')][_0x9651('0x3e')]){_0x1bbe01[_0x9651('0x3c')]=_['merge'](_0x1bbe01[_0x9651('0x3c')],{'$or':_[_0x9651('0x2d')](_0x5085f9,function(_0x46b2ef){if(_0x46b2ef['type']!=='VIRTUAL'){var _0x337fa9={};_0x337fa9[_0x46b2ef[_0x9651('0x2a')]]={'$like':'%'+_0x4e3ad5['query'][_0x9651('0x3e')]+'%'};return _0x337fa9;}})});}_0x1bbe01=_[_0x9651('0x3f')]({},_0x1bbe01,_0x4e3ad5['options']);var _0x1bd05e={'where':_0x1bbe01['where']};return db[_0x9651('0x2e')]['count'](_0x1bd05e)['then'](function(_0x4a9c55){_0x128230[_0x9651('0x20')]=_0x4a9c55;if(_0x4e3ad5[_0x9651('0x32')]['includeAll']){_0x1bbe01[_0x9651('0x40')]=[{'all':!![]}];}return db[_0x9651('0x2e')][_0x9651('0x41')](_0x1bbe01);})['then'](function(_0x5e18dd){_0x128230[_0x9651('0x42')]=_0x5e18dd;return _0x128230;})['then'](respondWithFilteredResult(_0x84a959,_0x1bbe01))[_0x9651('0x43')](handleError(_0x84a959,null));};exports['show']=function(_0x349671,_0x15926b){var _0x5d1b08={'raw':!![],'where':{'id':_0x349671['params']['id']}},_0x204743={};_0x204743['model']=_['keys'](db['SmsApplication'][_0x9651('0x2f')]);_0x204743['query']=_[_0x9651('0x33')](_0x349671[_0x9651('0x32')]);_0x204743[_0x9651('0x34')]=_[_0x9651('0x35')](_0x204743[_0x9651('0x36')],_0x204743[_0x9651('0x32')]);_0x5d1b08[_0x9651('0x38')]=_[_0x9651('0x35')](_0x204743['model'],qs['fields'](_0x349671[_0x9651('0x32')][_0x9651('0x37')]));_0x5d1b08['attributes']=_0x5d1b08[_0x9651('0x38')]['length']?_0x5d1b08[_0x9651('0x38')]:_0x204743[_0x9651('0x36')];if(_0x349671[_0x9651('0x32')][_0x9651('0x44')]){_0x5d1b08[_0x9651('0x40')]=[{'all':!![]}];}_0x5d1b08=_[_0x9651('0x3f')]({},_0x5d1b08,_0x349671[_0x9651('0x45')]);return db[_0x9651('0x2e')]['find'](_0x5d1b08)[_0x9651('0x27')](handleEntityNotFound(_0x15926b,null))[_0x9651('0x27')](respondWithResult(_0x15926b,null))[_0x9651('0x43')](handleError(_0x15926b,null));};exports[_0x9651('0x46')]=function(_0x55a560,_0x450a54){return db[_0x9651('0x2e')][_0x9651('0x46')](_0x55a560['body'],{})[_0x9651('0x27')](respondWithResult(_0x450a54,0xc9))[_0x9651('0x43')](handleError(_0x450a54,null));};exports['update']=function(_0x3917bd,_0x255da9){if(_0x3917bd[_0x9651('0x47')]['id']){delete _0x3917bd[_0x9651('0x47')]['id'];}return db[_0x9651('0x2e')][_0x9651('0x48')]({'where':{'id':_0x3917bd['params']['id']}})[_0x9651('0x27')](handleEntityNotFound(_0x255da9,null))[_0x9651('0x27')](saveUpdates(_0x3917bd['body'],null))[_0x9651('0x27')](respondWithResult(_0x255da9,null))[_0x9651('0x43')](handleError(_0x255da9,null));};exports[_0x9651('0x49')]=function(_0x359d2d,_0x2385f2){return db[_0x9651('0x2e')][_0x9651('0x48')]({'where':{'id':_0x359d2d[_0x9651('0x4a')]['id']}})[_0x9651('0x27')](handleEntityNotFound(_0x2385f2,null))[_0x9651('0x27')](removeEntity(_0x2385f2,null))['catch'](handleError(_0x2385f2,null));}; \ No newline at end of file +var _0xd2ce=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','stack','name','index','map','SmsApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','fields','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util'];(function(_0xf998a2,_0x5c0ae2){var _0xf83892=function(_0x5b6dee){while(--_0x5b6dee){_0xf998a2['push'](_0xf998a2['shift']());}};_0xf83892(++_0x5c0ae2);}(_0xd2ce,0x76));var _0xed2c=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xd2ce[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0xed2c('0x0'));var rimraf=require(_0xed2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed2c('0x2'));var rp=require(_0xed2c('0x3'));var moment=require('moment');var BPromise=require(_0xed2c('0x4'));var Mustache=require(_0xed2c('0x5'));var util=require(_0xed2c('0x6'));var path=require(_0xed2c('0x7'));var sox=require(_0xed2c('0x8'));var csv=require(_0xed2c('0x9'));var ejs=require(_0xed2c('0xa'));var fs=require('fs');var fs_extra=require(_0xed2c('0xb'));var _=require(_0xed2c('0xc'));var squel=require(_0xed2c('0xd'));var crypto=require(_0xed2c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed2c('0x9'));var querystring=require(_0xed2c('0xf'));var Papa=require(_0xed2c('0x10'));var Redis=require('ioredis');var authService=require(_0xed2c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed2c('0x12'));var hardwareService=require(_0xed2c('0x13'));var logger=require(_0xed2c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed2c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27a7cf,_0x19e090){_0x19e090=_0x19e090||0xcc;return function(_0x3799ff){if(_0x3799ff){return _0x27a7cf[_0xed2c('0x16')](_0x19e090);}return _0x27a7cf[_0xed2c('0x17')](_0x19e090)[_0xed2c('0x18')]();};}function respondWithResult(_0x1a35f2,_0x245251){_0x245251=_0x245251||0xc8;return function(_0x15a33c){if(_0x15a33c){return _0x1a35f2['status'](_0x245251)[_0xed2c('0x19')](_0x15a33c);}};}function respondWithFilteredResult(_0x26f9e6,_0x1d40aa){return function(_0x31a43b){if(_0x31a43b){var _0x9182a2=typeof _0x1d40aa[_0xed2c('0x1a')]==='undefined'&&typeof _0x1d40aa['limit']===_0xed2c('0x1b');var _0x145455=_0x31a43b[_0xed2c('0x1c')];var _0x166587=_0x9182a2?0x0:_0x1d40aa[_0xed2c('0x1a')];var _0x5d629f=_0x9182a2?_0x31a43b[_0xed2c('0x1c')]:_0x1d40aa[_0xed2c('0x1a')]+_0x1d40aa[_0xed2c('0x1d')];var _0x54ffb7;if(_0x5d629f>=_0x145455){_0x5d629f=_0x145455;_0x54ffb7=0xc8;}else{_0x54ffb7=0xce;}_0x26f9e6[_0xed2c('0x17')](_0x54ffb7);return _0x26f9e6[_0xed2c('0x1e')](_0xed2c('0x1f'),_0x166587+'-'+_0x5d629f+'/'+_0x145455)['json'](_0x31a43b);}return null;};}function patchUpdates(_0x485fbe){return function(_0x4e8c94){try{jsonpatch['apply'](_0x4e8c94,_0x485fbe,!![]);}catch(_0x5dc59c){return BPromise[_0xed2c('0x20')](_0x5dc59c);}return _0x4e8c94['save']();};}function saveUpdates(_0x411642,_0x2ab28b){return function(_0x349ba8){if(_0x349ba8){return _0x349ba8[_0xed2c('0x21')](_0x411642)[_0xed2c('0x22')](function(_0x2afdb8){return _0x2afdb8;});}return null;};}function removeEntity(_0x5ce40e,_0x5683d1){return function(_0x260c30){if(_0x260c30){return _0x260c30[_0xed2c('0x23')]()['then'](function(){_0x5ce40e[_0xed2c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a22a,_0x4c64d2){return function(_0x1a8017){if(!_0x1a8017){_0x31a22a['sendStatus'](0x194);}return _0x1a8017;};}function handleError(_0x45d9bb,_0x3babd5){_0x3babd5=_0x3babd5||0x1f4;return function(_0x5e8c4f){logger['error'](_0x5e8c4f[_0xed2c('0x24')]);if(_0x5e8c4f['name']){delete _0x5e8c4f[_0xed2c('0x25')];}_0x45d9bb[_0xed2c('0x17')](_0x3babd5)['send'](_0x5e8c4f);};}exports[_0xed2c('0x26')]=function(_0x142887,_0x178400){var _0x51e5df={},_0x1fc7a1={},_0x52ff8={'count':0x0,'rows':[]};var _0x107469=_[_0xed2c('0x27')](db[_0xed2c('0x28')]['rawAttributes'],function(_0x20dbc4){return{'name':_0x20dbc4[_0xed2c('0x29')],'type':_0x20dbc4[_0xed2c('0x2a')][_0xed2c('0x2b')]};});_0x1fc7a1[_0xed2c('0x2c')]=_[_0xed2c('0x27')](_0x107469,'name');_0x1fc7a1[_0xed2c('0x2d')]=_[_0xed2c('0x2e')](_0x142887['query']);_0x1fc7a1[_0xed2c('0x2f')]=_[_0xed2c('0x30')](_0x1fc7a1[_0xed2c('0x2c')],_0x1fc7a1[_0xed2c('0x2d')]);_0x51e5df[_0xed2c('0x31')]=_[_0xed2c('0x30')](_0x1fc7a1[_0xed2c('0x2c')],qs['fields'](_0x142887['query']['fields']));_0x51e5df[_0xed2c('0x31')]=_0x51e5df[_0xed2c('0x31')][_0xed2c('0x32')]?_0x51e5df['attributes']:_0x1fc7a1[_0xed2c('0x2c')];if(!_0x142887[_0xed2c('0x2d')]['hasOwnProperty'](_0xed2c('0x33'))){_0x51e5df[_0xed2c('0x1d')]=qs[_0xed2c('0x1d')](_0x142887['query'][_0xed2c('0x1d')]);_0x51e5df['offset']=qs['offset'](_0x142887[_0xed2c('0x2d')]['offset']);}_0x51e5df[_0xed2c('0x34')]=qs['sort'](_0x142887['query']['sort']);_0x51e5df[_0xed2c('0x35')]=qs['filters'](_[_0xed2c('0x36')](_0x142887['query'],_0x1fc7a1[_0xed2c('0x2f')]),_0x107469);if(_0x142887[_0xed2c('0x2d')][_0xed2c('0x37')]){_0x51e5df[_0xed2c('0x35')]=_[_0xed2c('0x38')](_0x51e5df['where'],{'$or':_[_0xed2c('0x27')](_0x107469,function(_0x5ec3e0){if(_0x5ec3e0[_0xed2c('0x2a')]!==_0xed2c('0x39')){var _0x16902c={};_0x16902c[_0x5ec3e0[_0xed2c('0x25')]]={'$like':'%'+_0x142887[_0xed2c('0x2d')][_0xed2c('0x37')]+'%'};return _0x16902c;}})});}_0x51e5df=_[_0xed2c('0x38')]({},_0x51e5df,_0x142887[_0xed2c('0x3a')]);var _0x2d51eb={'where':_0x51e5df[_0xed2c('0x35')]};return db['SmsApplication']['count'](_0x2d51eb)[_0xed2c('0x22')](function(_0x268812){_0x52ff8[_0xed2c('0x1c')]=_0x268812;if(_0x142887['query'][_0xed2c('0x3b')]){_0x51e5df[_0xed2c('0x3c')]=[{'all':!![]}];}return db[_0xed2c('0x28')][_0xed2c('0x3d')](_0x51e5df);})[_0xed2c('0x22')](function(_0x345906){_0x52ff8['rows']=_0x345906;return _0x52ff8;})[_0xed2c('0x22')](respondWithFilteredResult(_0x178400,_0x51e5df))[_0xed2c('0x3e')](handleError(_0x178400,null));};exports[_0xed2c('0x3f')]=function(_0x46ec18,_0x1249b9){var _0x3880d6={'raw':!![],'where':{'id':_0x46ec18['params']['id']}},_0x132ca0={};_0x132ca0[_0xed2c('0x2c')]=_[_0xed2c('0x2e')](db[_0xed2c('0x28')][_0xed2c('0x40')]);_0x132ca0[_0xed2c('0x2d')]=_[_0xed2c('0x2e')](_0x46ec18['query']);_0x132ca0[_0xed2c('0x2f')]=_[_0xed2c('0x30')](_0x132ca0[_0xed2c('0x2c')],_0x132ca0[_0xed2c('0x2d')]);_0x3880d6[_0xed2c('0x31')]=_[_0xed2c('0x30')](_0x132ca0[_0xed2c('0x2c')],qs[_0xed2c('0x41')](_0x46ec18['query'][_0xed2c('0x41')]));_0x3880d6[_0xed2c('0x31')]=_0x3880d6[_0xed2c('0x31')][_0xed2c('0x32')]?_0x3880d6['attributes']:_0x132ca0[_0xed2c('0x2c')];if(_0x46ec18[_0xed2c('0x2d')][_0xed2c('0x3b')]){_0x3880d6[_0xed2c('0x3c')]=[{'all':!![]}];}_0x3880d6=_[_0xed2c('0x38')]({},_0x3880d6,_0x46ec18['options']);return db[_0xed2c('0x28')][_0xed2c('0x42')](_0x3880d6)[_0xed2c('0x22')](handleEntityNotFound(_0x1249b9,null))['then'](respondWithResult(_0x1249b9,null))[_0xed2c('0x3e')](handleError(_0x1249b9,null));};exports[_0xed2c('0x43')]=function(_0x4f630f,_0x1dfa09){return db[_0xed2c('0x28')][_0xed2c('0x43')](_0x4f630f[_0xed2c('0x44')],{})['then'](respondWithResult(_0x1dfa09,0xc9))['catch'](handleError(_0x1dfa09,null));};exports['update']=function(_0x5d744e,_0x4e69d1){if(_0x5d744e[_0xed2c('0x44')]['id']){delete _0x5d744e[_0xed2c('0x44')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x5d744e[_0xed2c('0x45')]['id']}})[_0xed2c('0x22')](handleEntityNotFound(_0x4e69d1,null))['then'](saveUpdates(_0x5d744e[_0xed2c('0x44')],null))[_0xed2c('0x22')](respondWithResult(_0x4e69d1,null))['catch'](handleError(_0x4e69d1,null));};exports['destroy']=function(_0x12f5d2,_0x320227){return db['SmsApplication']['find']({'where':{'id':_0x12f5d2['params']['id']}})[_0xed2c('0x22')](handleEntityNotFound(_0x320227,null))[_0xed2c('0x22')](removeEntity(_0x320227,null))[_0xed2c('0x3e')](handleError(_0x320227,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index da2c263..13c5137 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 _0xfcfc=['rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x3addfb,_0xcf5491){var _0x25bf60=function(_0x545cc1){while(--_0x545cc1){_0x3addfb['push'](_0x3addfb['shift']());}};_0x25bf60(++_0xcf5491);}(_0xfcfc,0xf9));var _0xcfcf=function(_0x53877a,_0x25b41b){_0x53877a=_0x53877a-0x0;var _0x57b517=_0xfcfc[_0x53877a];return _0x57b517;};'use strict';var _=require('lodash');var util=require(_0xcfcf('0x0'));var logger=require(_0xcfcf('0x1'))(_0xcfcf('0x2'));var moment=require(_0xcfcf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfcf('0x4'));var config=require(_0xcfcf('0x5'));var attributes=require('./smsApplication.attributes');module[_0xcfcf('0x6')]=function(_0x192a69,_0x39cfea){return _0x192a69[_0xcfcf('0x7')](_0xcfcf('0x8'),attributes,{'tableName':_0xcfcf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcfcf('0xa')});}; \ No newline at end of file +var _0x9be9=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9be9,0x98));var _0x99be=function(_0x186e07,_0x49a464){_0x186e07=_0x186e07-0x0;var _0x568b29=_0x9be9[_0x186e07];return _0x568b29;};'use strict';var _=require(_0x99be('0x0'));var util=require(_0x99be('0x1'));var logger=require(_0x99be('0x2'))(_0x99be('0x3'));var moment=require(_0x99be('0x4'));var BPromise=require(_0x99be('0x5'));var rp=require(_0x99be('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99be('0x7'));var config=require('../../config/environment');var attributes=require(_0x99be('0x8'));module['exports']=function(_0x41dd7b,_0x370167){return _0x41dd7b[_0x99be('0x9')](_0x99be('0xa'),attributes,{'tableName':_0x99be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99be('0xc'),'collate':_0x99be('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 016a407..4a66548 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 _0xf55c=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x59a24c,_0x370f28){var _0x447e2f=function(_0x121aab){while(--_0x121aab){_0x59a24c['push'](_0x59a24c['shift']());}};_0x447e2f(++_0x370f28);}(_0xf55c,0x1e7));var _0xcf55=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xf55c[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xcf55('0x0'));var util=require('util');var moment=require(_0xcf55('0x1'));var BPromise=require(_0xcf55('0x2'));var rs=require(_0xcf55('0x3'));var fs=require('fs');var Redis=require(_0xcf55('0x4'));var db=require(_0xcf55('0x5'))['db'];var utils=require(_0xcf55('0x6'));var logger=require(_0xcf55('0x7'))('rpc');var config=require(_0xcf55('0x8'));var jayson=require(_0xcf55('0x9'));var client=jayson[_0xcf55('0xa')][_0xcf55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b3453,_0x29566b,_0x53deb4){return new BPromise(function(_0x7003f1,_0x3018aa){return client['request'](_0x4b3453,_0x53deb4)[_0xcf55('0xc')](function(_0x3ce5d2){logger[_0xcf55('0xd')](_0xcf55('0xe'),_0x29566b,_0xcf55('0xf'));logger[_0xcf55('0x10')](_0xcf55('0x11'),_0x29566b,'request\x20sent',JSON[_0xcf55('0x12')](_0x3ce5d2));if(_0x3ce5d2[_0xcf55('0x13')]){if(_0x3ce5d2['error']['code']===0x1f4){logger[_0xcf55('0x13')](_0xcf55('0xe'),_0x29566b,_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);return _0x3018aa(_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);}logger[_0xcf55('0x13')](_0xcf55('0xe'),_0x29566b,_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);return _0x7003f1(_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);}else{logger['info'](_0xcf55('0xe'),_0x29566b,_0xcf55('0xf'));_0x7003f1(_0x3ce5d2[_0xcf55('0x15')][_0xcf55('0x14')]);}})[_0xcf55('0x16')](function(_0x4b0c1a){logger[_0xcf55('0x13')](_0xcf55('0xe'),_0x29566b,_0x4b0c1a);_0x3018aa(_0x4b0c1a);});});} \ No newline at end of file +var _0x689b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','lodash','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x689b,0x142));var _0xb689=function(_0x485586,_0x2581aa){_0x485586=_0x485586-0x0;var _0x2bc07c=_0x689b[_0x485586];return _0x2bc07c;};'use strict';var _=require(_0xb689('0x0'));var util=require('util');var moment=require(_0xb689('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb689('0x2'));var db=require(_0xb689('0x3'))['db'];var utils=require(_0xb689('0x4'));var logger=require(_0xb689('0x5'))(_0xb689('0x6'));var config=require(_0xb689('0x7'));var jayson=require(_0xb689('0x8'));var client=jayson['client'][_0xb689('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ee263,_0x47752c,_0x56c6ba){return new BPromise(function(_0x6eaf58,_0x1cad3e){return client[_0xb689('0xa')](_0x5ee263,_0x56c6ba)['then'](function(_0x14ef33){logger['info']('SmsApplication,\x20%s,\x20%s',_0x47752c,_0xb689('0xb'));logger['debug'](_0xb689('0xc'),_0x47752c,'request\x20sent',JSON[_0xb689('0xd')](_0x14ef33));if(_0x14ef33[_0xb689('0xe')]){if(_0x14ef33[_0xb689('0xe')][_0xb689('0xf')]===0x1f4){logger[_0xb689('0xe')](_0xb689('0x10'),_0x47752c,_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);return _0x1cad3e(_0x14ef33[_0xb689('0xe')]['message']);}logger[_0xb689('0xe')](_0xb689('0x10'),_0x47752c,_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);return _0x6eaf58(_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);}else{logger['info'](_0xb689('0x10'),_0x47752c,_0xb689('0xb'));_0x6eaf58(_0x14ef33['result'][_0xb689('0x11')]);}})['catch'](function(_0xf950eb){logger['error']('SmsApplication,\x20%s,\x20%s',_0x47752c,_0xf950eb);_0x1cad3e(_0xf950eb);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5a0e430..07e472f 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 _0xac4a=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','get','describe','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','multer'];(function(_0x3032f8,_0x1e97a1){var _0x2b99bf=function(_0x4d1f36){while(--_0x4d1f36){_0x3032f8['push'](_0x3032f8['shift']());}};_0x2b99bf(++_0x1e97a1);}(_0xac4a,0x13f));var _0xaac4=function(_0x3b1964,_0x4544ce){_0x3b1964=_0x3b1964-0x0;var _0x207b6=_0xac4a[_0x3b1964];return _0x207b6;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/describe',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')](_0xaac4('0x11'),auth['isAuthenticated'](),controller[_0xaac4('0x12')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),interaction[_0xaac4('0x13')](_0xaac4('0x14'),_0xaac4('0x15')),controller[_0xaac4('0x16')]);router[_0xaac4('0x17')](_0xaac4('0x18'),auth[_0xaac4('0x9')](),interaction[_0xaac4('0x13')](_0xaac4('0x14'),_0xaac4('0x19')),controller[_0xaac4('0x1a')]);router[_0xaac4('0x1b')]('/:id',auth[_0xaac4('0x9')](),interaction['tracked'](_0xaac4('0x14'),'smsinteraction:destroy'),controller[_0xaac4('0x1c')]);router[_0xaac4('0x1b')](_0xaac4('0x1d'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x1e')]);module[_0xaac4('0x1f')]=router; \ No newline at end of file +var _0xb688=['destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','sms'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb688,0xcf));var _0x8b68=function(_0xf7a636,_0x571230){_0xf7a636=_0xf7a636-0x0;var _0x5c90dc=_0xb688[_0xf7a636];return _0x5c90dc;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x14')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x16')]);router[_0x8b68('0x14')]('/:id/tags',auth[_0x8b68('0xc')](),interaction['tracked']('sms',_0x8b68('0x17')),controller[_0x8b68('0x18')]);router[_0x8b68('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x8b68('0x1a')]('sms',_0x8b68('0x1b')),controller[_0x8b68('0x1c')]);router[_0x8b68('0x1d')](_0x8b68('0xe'),auth['isAuthenticated'](),interaction[_0x8b68('0x1a')](_0x8b68('0x1e'),'smsinteraction:destroy'),controller[_0x8b68('0x1f')]);router[_0x8b68('0x1d')](_0x8b68('0x20'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index a6c34a2..c21319a 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 _0x7f27=['ENUM','BOOLEAN','sequelize','moment','DATE','STRING'];(function(_0x2b3cc2,_0x5c9f2c){var _0x11d37b=function(_0x4adf48){while(--_0x4adf48){_0x2b3cc2['push'](_0x2b3cc2['shift']());}};_0x11d37b(++_0x5c9f2c);}(_0x7f27,0x12e));var _0x77f2=function(_0x224061,_0x389eb0){_0x224061=_0x224061-0x0;var _0x2fb816=_0x7f27[_0x224061];return _0x2fb816;};'use strict';var Sequelize=require(_0x77f2('0x0'));var moment=require(_0x77f2('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x77f2('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x77f2('0x3')]},'note':{'type':Sequelize[_0x77f2('0x3')]},'phone':{'type':Sequelize[_0x77f2('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x77f2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x77f2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x77f2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x77f2('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xe7de=['STRING','DATE','ENUM','out','BOOLEAN','sequelize','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7de,0x165));var _0xee7d=function(_0x31b060,_0x34e89b){_0x31b060=_0x31b060-0x0;var _0x443d2a=_0xe7de[_0x31b060];return _0x443d2a;};'use strict';var Sequelize=require(_0xee7d('0x0'));var moment=require(_0xee7d('0x1'));module[_0xee7d('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xee7d('0x3')]},'secondDisposition':{'type':Sequelize[_0xee7d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xee7d('0x3')]},'note':{'type':Sequelize[_0xee7d('0x3')]},'phone':{'type':Sequelize[_0xee7d('0x3')]},'read1stAt':{'type':Sequelize[_0xee7d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xee7d('0x5')]('in',_0xee7d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xee7d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xee7d('0x5')]('in',_0xee7d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xee7d('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 988c653..d84b321 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 _0x3bff=['register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','answered','unmanaged','UserId','closed','total','index','SmsInteraction','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','having','`\x20=\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','value','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','find','some','compact','i.SmsAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','order','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','SmsAccountId','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','params','includeAll','include','options','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','User','CmContact','firstName','lastName','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','closedAt','disposition','Messages','System','out','renderFile','views','downloadInteraction.ejs','.pdf','Sms','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsInteraction.socket'];(function(_0x238d08,_0x128ce4){var _0x540205=function(_0x15f6f2){while(--_0x15f6f2){_0x238d08['push'](_0x238d08['shift']());}};_0x540205(++_0x128ce4);}(_0x3bff,0xd0));var _0xf3bf=function(_0x17f145,_0x3422bb){_0x17f145=_0x17f145-0x0;var _0x2d5420=_0x3bff[_0x17f145];return _0x2d5420;};'use strict';var emlformat=require(_0xf3bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3bf('0x1'));var jsonpatch=require(_0xf3bf('0x2'));var rp=require('request-promise');var moment=require(_0xf3bf('0x3'));var BPromise=require(_0xf3bf('0x4'));var Mustache=require(_0xf3bf('0x5'));var util=require(_0xf3bf('0x6'));var path=require('path');var sox=require(_0xf3bf('0x7'));var csv=require('to-csv');var ejs=require(_0xf3bf('0x8'));var fs=require('fs');var fs_extra=require(_0xf3bf('0x9'));var _=require(_0xf3bf('0xa'));var squel=require(_0xf3bf('0xb'));var crypto=require('crypto');var jsforce=require(_0xf3bf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3bf('0xd'));var querystring=require(_0xf3bf('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3bf('0xf'));var authService=require(_0xf3bf('0x10'));var qs=require(_0xf3bf('0x11'));var as=require(_0xf3bf('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xf3bf('0x13'));var logger=require(_0xf3bf('0x14'))('api');var utils=require(_0xf3bf('0x15'));var config=require(_0xf3bf('0x16'));var licenseUtil=require(_0xf3bf('0x17'));var db=require(_0xf3bf('0x18'))['db'];config['redis']=_[_0xf3bf('0x19')](config[_0xf3bf('0x1a')],{'host':_0xf3bf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3bf('0x1a')]));require(_0xf3bf('0x1c'))[_0xf3bf('0x1d')](socket);function respondWithStatusCode(_0x5c2e97,_0x3b4661){_0x3b4661=_0x3b4661||0xcc;return function(_0x7bd11c){if(_0x7bd11c){return _0x5c2e97[_0xf3bf('0x1e')](_0x3b4661);}return _0x5c2e97['status'](_0x3b4661)[_0xf3bf('0x1f')]();};}function respondWithResult(_0x4d324d,_0x4fea40){_0x4fea40=_0x4fea40||0xc8;return function(_0x209f1a){if(_0x209f1a){return _0x4d324d[_0xf3bf('0x20')](_0x4fea40)[_0xf3bf('0x21')](_0x209f1a);}};}function respondWithFilteredResult(_0xd494e0,_0x1809cd){return function(_0x45074c){if(_0x45074c){var _0x58fd34=typeof _0x1809cd[_0xf3bf('0x22')]===_0xf3bf('0x23')&&typeof _0x1809cd[_0xf3bf('0x24')]===_0xf3bf('0x23');var _0x104b3b=_0x45074c[_0xf3bf('0x25')];var _0x2e68fa=_0x58fd34?0x0:_0x1809cd['offset'];var _0x216dcc=_0x58fd34?_0x45074c[_0xf3bf('0x25')]:_0x1809cd['offset']+_0x1809cd['limit'];var _0x3bf677;if(_0x216dcc>=_0x104b3b){_0x216dcc=_0x104b3b;_0x3bf677=0xc8;}else{_0x3bf677=0xce;}_0xd494e0[_0xf3bf('0x20')](_0x3bf677);return _0xd494e0[_0xf3bf('0x26')](_0xf3bf('0x27'),_0x2e68fa+'-'+_0x216dcc+'/'+_0x104b3b)[_0xf3bf('0x21')](_0x45074c);}return null;};}function patchUpdates(_0x28e632){return function(_0x524e62){try{jsonpatch[_0xf3bf('0x28')](_0x524e62,_0x28e632,!![]);}catch(_0x5ed437){return BPromise[_0xf3bf('0x29')](_0x5ed437);}return _0x524e62[_0xf3bf('0x2a')]();};}function saveUpdates(_0x5d3162,_0x124327){return function(_0x2e6d5c){if(_0x2e6d5c){return _0x2e6d5c[_0xf3bf('0x2b')](_0x5d3162)[_0xf3bf('0x2c')](function(_0x237e59){return _0x237e59;});}return null;};}function removeEntity(_0x4b9a76,_0x9bc58f){return function(_0x52190e){if(_0x52190e){return _0x52190e['destroy']()[_0xf3bf('0x2c')](function(){_0x4b9a76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x378c2d,_0x27774d){return function(_0x41e632){if(!_0x41e632){_0x378c2d[_0xf3bf('0x1e')](0x194);}return _0x41e632;};}function handleError(_0x2da15d,_0x381146){_0x381146=_0x381146||0x1f4;return function(_0x80706b){logger[_0xf3bf('0x2d')](_0x80706b[_0xf3bf('0x2e')]);if(_0x80706b[_0xf3bf('0x2f')]){delete _0x80706b['name'];}_0x2da15d[_0xf3bf('0x20')](_0x381146)[_0xf3bf('0x30')](_0x80706b);};}function getInteractionUsers(_0x320006,_0x5bc4b5){return new BPromise(function(_0x111d3f,_0x5e0a77){try{if(_0x5bc4b5[_0x320006['id']]){_0x320006['Users']=_[_0xf3bf('0x31')](_0x5bc4b5[_0x320006['id']],function(_0x3b12c5){return{'id':_0x3b12c5['id'],'fullname':_0x3b12c5[_0xf3bf('0x32')]};});}}catch(_0x117349){_0x5e0a77(_0x117349);}_0x111d3f(_0x320006);});}function getInteractionTags(_0xe15525,_0x5028cd){return new BPromise(function(_0x36b555,_0x1abd90){try{if(_0xe15525[_0xf3bf('0x33')]){_0xe15525[_0xf3bf('0x34')]=[];_0xe15525[_0xf3bf('0x33')]['split'](',')[_0xf3bf('0x35')](function(_0x21df94){_0xe15525[_0xf3bf('0x34')][_0xf3bf('0x36')](_0x5028cd[_0x21df94]);});}delete _0xe15525[_0xf3bf('0x33')];}catch(_0x59a1ec){_0x1abd90(_0x59a1ec);}_0x36b555(_0xe15525);});}function updateSmsInteraction(_0x59064e,_0x43a4c5,_0x58ef92){return new BPromise(function(_0xb26519,_0x17cc12){return getInteractionUsers(_0x59064e,_0x58ef92)['then'](function(_0x3300d0){return getInteractionTags(_0x3300d0,_0x43a4c5);})[_0xf3bf('0x2c')](function(_0x4ee522){return getStateInteraction(_0x4ee522);})[_0xf3bf('0x2c')](function(_0x4dd780){_0xb26519(_0x4dd780);})[_0xf3bf('0x37')](function(_0x3a66c3){_0x17cc12(_0x3a66c3);});});}function getStateInteraction(_0x4c7bb5){return new BPromise(function(_0x5535e7){_0x4c7bb5[_0xf3bf('0x38')]=0x0;_0x4c7bb5[_0xf3bf('0x39')]=0x0;_0x4c7bb5[_0xf3bf('0x3a')]=0x0;_0x4c7bb5[_0xf3bf('0x3b')]=0x0;_0x4c7bb5['total']=0x0;if(!_0x4c7bb5['closed']&&!_0x4c7bb5[_0xf3bf('0x3c')]){_0x4c7bb5['waiting']+=0x1;}if(!_0x4c7bb5['closed']&&_0x4c7bb5['UserId']){_0x4c7bb5[_0xf3bf('0x39')]+=0x1;if(_0x4c7bb5[_0xf3bf('0x38')]){_0x4c7bb5[_0xf3bf('0x38')]-=0x1;}}if(_0x4c7bb5[_0xf3bf('0x3d')]&&_0x4c7bb5[_0xf3bf('0x3c')]){_0x4c7bb5[_0xf3bf('0x3a')]+=0x1;if(_0x4c7bb5['talking']){_0x4c7bb5['talking']-=0x1;}}if(_0x4c7bb5[_0xf3bf('0x3d')]&&!_0x4c7bb5['UserId']){_0x4c7bb5[_0xf3bf('0x3b')]+=0x1;if(_0x4c7bb5[_0xf3bf('0x38')]){_0x4c7bb5[_0xf3bf('0x38')]-=0x1;}}_0x4c7bb5[_0xf3bf('0x3e')]+=0x1;_0x5535e7(_0x4c7bb5);});}exports[_0xf3bf('0x3f')]=function(_0x428d70,_0x210620){var _0x59906d={},_0x2a88ef={},_0x2750c4={'count':0x0,'rows':[]};var _0xa076f=_[_0xf3bf('0x31')](db[_0xf3bf('0x40')][_0xf3bf('0x41')],function(_0x4c3a09){return{'name':_0x4c3a09['fieldName'],'type':_0x4c3a09[_0xf3bf('0x42')]['key']};});_0x2a88ef[_0xf3bf('0x43')]=_['map'](_0xa076f,_0xf3bf('0x2f'));_0x2a88ef[_0xf3bf('0x44')]=_[_0xf3bf('0x45')](_0x428d70['query']);_0x2a88ef[_0xf3bf('0x46')]=_[_0xf3bf('0x47')](_0x2a88ef[_0xf3bf('0x43')],_0x2a88ef['query']);_0x59906d[_0xf3bf('0x48')]=_[_0xf3bf('0x47')](_0x2a88ef['model'],qs[_0xf3bf('0x49')](_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x49')]));_0x59906d[_0xf3bf('0x48')]=_0x59906d[_0xf3bf('0x48')][_0xf3bf('0x4a')]?_0x59906d[_0xf3bf('0x48')]:_0x2a88ef[_0xf3bf('0x43')];if(!_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x4b')](_0xf3bf('0x4c'))){_0x59906d[_0xf3bf('0x24')]=qs[_0xf3bf('0x24')](_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x24')]);_0x59906d['offset']=qs['offset'](_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x22')]);}_0x59906d['order']=qs[_0xf3bf('0x4d')](_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x4d')]);_0x59906d[_0xf3bf('0x4e')]=qs['filters'](_[_0xf3bf('0x4f')](_0x428d70[_0xf3bf('0x44')],_0x2a88ef['filters']),_0xa076f);var _0x2e1608=[];var _0x2afda4=squel[_0xf3bf('0x50')]()[_0xf3bf('0x51')]('id')[_0xf3bf('0x51')](_0xf3bf('0x2f'))[_0xf3bf('0x51')]('color')[_0xf3bf('0x52')](_0xf3bf('0x53'));var _0x5c0194=squel[_0xf3bf('0x50')]()[_0xf3bf('0x51')](_0xf3bf('0x54'))[_0xf3bf('0x51')](_0xf3bf('0x55'))[_0xf3bf('0x51')](_0xf3bf('0x56'))[_0xf3bf('0x52')](_0xf3bf('0x57'),'ui')[_0xf3bf('0x58')](_0xf3bf('0x59'),'u',_0xf3bf('0x5a'));var _0x1710f1=squel[_0xf3bf('0x50')]()[_0xf3bf('0x52')](_0xf3bf('0x5b'),'i')[_0xf3bf('0x58')](_0xf3bf('0x5c'),'c',_0xf3bf('0x5d'))['left_join'](_0xf3bf('0x59'),'o',_0xf3bf('0x5e'))['left_join'](_0xf3bf('0x5f'),'a','a.id\x20=\x20i.SmsAccountId')[_0xf3bf('0x58')](_0xf3bf('0x60'),'me',_0xf3bf('0x61'))[_0xf3bf('0x58')](_0xf3bf('0x62'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xf3bf('0x58')](_0xf3bf('0x53'),'t',_0xf3bf('0x63'));var _0x192624=squel[_0xf3bf('0x64')]();var _0x20b333=[];var _0x5636c8=squel[_0xf3bf('0x64')]();var _0x30a00f;if(_0x428d70['query'][_0xf3bf('0x65')]){_0x30a00f=as[_0xf3bf('0x66')](_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x65')]);var _0x4391b8=_0x30a00f['sqlOperator'];for(var _0xa32aac=0x0;_0xa32aac<_0x30a00f[_0xf3bf('0x67')][_0xf3bf('0x4a')];_0xa32aac++){var _0x22b29e=_0x30a00f[_0xf3bf('0x67')][_0xa32aac];var _0x5c69f1='i';var _0x2a9197=_['find'](_0xa076f,['name',_0x22b29e['field']]);if(!_0x2a9197){switch(_0x22b29e['field']){case _0xf3bf('0x68'):if(_0x22b29e['value']==0x1){_0x1710f1[_0xf3bf('0x69')]('`'+_0x22b29e[_0xf3bf('0x51')]+_0xf3bf('0x6a'));}else{_0x1710f1[_0xf3bf('0x69')]('`'+_0x22b29e[_0xf3bf('0x51')]+'`\x20>\x200');}break;case _0xf3bf('0x6b'):if(_0x22b29e[_0xf3bf('0x6c')]==='$substring'){if(_0x22b29e['value'][_0xf3bf('0x6d')]('\x20')[_0xf3bf('0x4a')]>0x1){_0x192624[_0x4391b8](_0xf3bf('0x6e'),qs[_0xf3bf('0x6f')](_0x22b29e['value']),null);}else{var _0x269b10='%'+_0x22b29e['value']+'%';_0x192624[_0x4391b8]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x269b10,_0x269b10,_0x269b10);}}else{_0x2a9197=_['find'](_0xa076f,[_0xf3bf('0x2f'),'ContactId']);_0x22b29e[_0xf3bf('0x51')]=_0xf3bf('0x70');_0x59f3e6=as[_0xf3bf('0x71')](_0x5c69f1,_0x2a9197['type'],_0x22b29e);_0x192624[_0x4391b8](_0x59f3e6[_0xf3bf('0x72')],_0x59f3e6[_0xf3bf('0x73')][_0xf3bf('0x74')],_0x59f3e6[_0xf3bf('0x73')][_0xf3bf('0x1f')]);}break;case _0xf3bf('0x75'):var _0x2b853b=_0x22b29e['value'][_0xf3bf('0x6d')](',')[_0xf3bf('0x31')](function(_0xf65105){return Number(_0xf65105);});_0x2b853b[_0xf3bf('0x35')](function(_0x46c9b2){_0x5636c8['or'](_0xf3bf('0x76'),'%,'+_0x46c9b2+',%');});_0x20b333=_[_0xf3bf('0x77')](_0x20b333,_0x2b853b);break;case'User':if(_0x22b29e['operator']===_0xf3bf('0x78')){_0x192624[_0x4391b8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x22b29e[_0xf3bf('0x73')]+'%',null);}else{_0x2a9197=_[_0xf3bf('0x79')](_0xa076f,['name','UserId']);_0x22b29e['field']='UserId';_0x59f3e6=as[_0xf3bf('0x71')](_0x5c69f1,_0x2a9197['type'],_0x22b29e);_0x192624[_0x4391b8](_0x59f3e6[_0xf3bf('0x72')],_0x59f3e6[_0xf3bf('0x73')]['start'],_0x59f3e6['value'][_0xf3bf('0x1f')]);}break;case'body':_0x59f3e6=as[_0xf3bf('0x71')]('me',null,_0x22b29e);_0x192624[_0x4391b8](_0x59f3e6[_0xf3bf('0x72')],_0x59f3e6[_0xf3bf('0x73')][_0xf3bf('0x74')],_0x59f3e6['value'][_0xf3bf('0x1f')]);break;}}else{var _0x59f3e6=as[_0xf3bf('0x71')](_0x5c69f1,_0x2a9197[_0xf3bf('0x42')],_0x22b29e);_0x192624[_0x4391b8](_0x59f3e6[_0xf3bf('0x72')],_0x59f3e6[_0xf3bf('0x73')][_0xf3bf('0x74')],_0x59f3e6['value']['end']);}}}else{var _0xf4f767=_(_0x428d70[_0xf3bf('0x44')])[_0xf3bf('0x45')]()['map'](function(_0x32184b){return _[_0xf3bf('0x7a')](_0xa076f,[_0xf3bf('0x2f'),_0x32184b])?_0x32184b:undefined;})[_0xf3bf('0x7b')]()[_0xf3bf('0x73')]();if(!_['isEmpty'](_0xf4f767)){_0xf4f767['forEach'](function(_0x2ee168){if(_0x2ee168==='SmsAccountId'){_0x1710f1[_0xf3bf('0x4e')](_0xf3bf('0x7c'),[]['concat'](_0x428d70[_0xf3bf('0x44')][_0x2ee168]));}else if(_0x2ee168===_0xf3bf('0x7d')){var _0xfa19cc=JSON[_0xf3bf('0x7e')](_0x428d70[_0xf3bf('0x44')][_0x2ee168])['$gte'];var _0x117b05=JSON[_0xf3bf('0x7e')](_0x428d70[_0xf3bf('0x44')][_0x2ee168])[_0xf3bf('0x7f')];_0x1710f1['where'](_0xf3bf('0x80'),_0xfa19cc,_0x117b05);}else{if(_0x428d70[_0xf3bf('0x44')][_0x2ee168]===_0xf3bf('0x81')){_0x1710f1[_0xf3bf('0x4e')]('i.'+_0x2ee168+_0xf3bf('0x82'));}else{_0x1710f1[_0xf3bf('0x4e')]('i.'+_0x2ee168+_0xf3bf('0x83'),_0x428d70[_0xf3bf('0x44')][_0x2ee168]);}}});}if(_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x84')]){if(_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x84')]==0x1){_0x1710f1[_0xf3bf('0x69')](_0xf3bf('0x85'));}else{_0x1710f1['having'](_0xf3bf('0x86'));}}if(_0x428d70['query'][_0xf3bf('0x87')]){_0x20b333=_['isArray'](_0x428d70['query']['tag'])?_0x428d70['query']['tag']:new Array(_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x87')]);_0x20b333['forEach'](function(_0x5dc4a4){_0x5636c8['or'](_0xf3bf('0x76'),'%,'+_0x5dc4a4+',%');});}if(_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x88')]){var _0x3d4475=_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x88')][_0xf3bf('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf3bf('0x8a')](_0x3d4475)){_0x192624['or'](_0xf3bf('0x8b'),_0x3d4475+'%')['or'](_0xf3bf('0x8c'),_0x3d4475+'%');}else{_0x192624['or'](_0xf3bf('0x8d'),qs[_0xf3bf('0x6f')](_0x3d4475))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3d4475+'%');}}}_0x1710f1[_0xf3bf('0x4e')](_0x192624);_0x1710f1[_0xf3bf('0x8e')](_0xf3bf('0x8f'));var _0x16f022={'type':db[_0xf3bf('0x90')][_0xf3bf('0x91')][_0xf3bf('0x92')],'raw':!![]};var _0x378c76=_0x1710f1[_0xf3bf('0x93')]();_0x378c76[_0xf3bf('0x51')](_0xf3bf('0x8f'));_0x378c76[_0xf3bf('0x51')](_0xf3bf('0x94'),'unreadMessages');if(_0x59906d['order']){_0x59906d['order'][_0xf3bf('0x35')](function(_0x2a10b6){var _0x3203be=_0x2a10b6[0x0]===_0xf3bf('0x95')?_0x2a10b6[0x0]:'i.'+_0x2a10b6[0x0];_0x1710f1[_0xf3bf('0x96')](_0x3203be,_0x2a10b6[0x1]===_0xf3bf('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x20b333)){_0x1710f1['having'](_0x5636c8);_0x378c76[_0xf3bf('0x4e')]('t.id\x20IN\x20?',_0x20b333);}BPromise[_0xf3bf('0x98')]()[_0xf3bf('0x2c')](function(){if(!_0x30a00f){if(_0x428d70[_0xf3bf('0x44')]['SmsAccountId'])return;_0x378c76[_0xf3bf('0x4e')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1710f1['where'](_0xf3bf('0x99'));return;}if(_0x428d70['user'][_0xf3bf('0x9a')]!==_0xf3bf('0x9b'))return;return _0x428d70[_0xf3bf('0x9c')][_0xf3bf('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf3bf('0x2c')](function(_0x27d23e){if(_[_0xf3bf('0x9e')](_0x27d23e)){_0x378c76['where'](_0xf3bf('0x9f'));_0x1710f1['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x378c76['where']('i.SmsAccountId\x20IN\x20?',_[_0xf3bf('0x31')](_0x27d23e,'id'));_0x1710f1['where']('i.SmsAccountId\x20IN\x20?',_[_0xf3bf('0x31')](_0x27d23e,'id'));}});})[_0xf3bf('0x2c')](function(){if(_0x428d70[_0xf3bf('0x9c')][_0xf3bf('0x9a')]===_0xf3bf('0x9b')&&!_0x30a00f&&!_0x428d70[_0xf3bf('0x44')][_0xf3bf('0xa0')])return[];return db[_0xf3bf('0xa1')][_0xf3bf('0x44')](_0x378c76[_0xf3bf('0xa2')](),_0x16f022);})[_0xf3bf('0x2c')](function(_0x23193c){_0x2750c4[_0xf3bf('0x25')]=_0x23193c[_0xf3bf('0x4a')];if(_0x2750c4[_0xf3bf('0x25')]===0x0)return[];return db[_0xf3bf('0xa1')][_0xf3bf('0x44')](_0x2afda4[_0xf3bf('0xa2')](),_0x16f022)['then'](function(_0x33e6cc){_0x2e1608=_[_0xf3bf('0xa3')](_0x33e6cc,'id');_0x16f022=_[_0xf3bf('0xa4')](_0x16f022,{'model':db[_0xf3bf('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x428d70[_0xf3bf('0x44')][_0xf3bf('0x49')]){_0x59906d[_0xf3bf('0x48')][_0xf3bf('0x35')](function(_0x2993bf){_0x1710f1[_0xf3bf('0x51')]('i.'+_0x2993bf);});}else{_0x1710f1[_0xf3bf('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf3bf('0x68'));_0x1710f1[_0xf3bf('0x51')]('a.key','Account.key');_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xa5'),_0xf3bf('0xa6'));_0x1710f1['field'](_0xf3bf('0xa7'),_0xf3bf('0x95'));_0x1710f1['field'](_0xf3bf('0xa8'));_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xa9'),'Contact.firstName');_0x1710f1[_0xf3bf('0x51')]('c.lastName','Contact.lastName');_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xaa'),'Contact.email');_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xab'),_0xf3bf('0xac'));_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xad'),_0xf3bf('0xae'));_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xaf'),_0xf3bf('0xb0'));_0x1710f1[_0xf3bf('0x51')]('o.fullname',_0xf3bf('0xb1'));_0x1710f1['field']('o.internal',_0xf3bf('0xb2'));_0x1710f1[_0xf3bf('0x51')](_0xf3bf('0xb3'),_0xf3bf('0x33'));}if(_0x59906d[_0xf3bf('0x24')])_0x1710f1[_0xf3bf('0x24')](_0x59906d[_0xf3bf('0x24')]);if(_0x59906d[_0xf3bf('0x22')])_0x1710f1[_0xf3bf('0x22')](_0x59906d[_0xf3bf('0x22')]);return db[_0xf3bf('0xa1')][_0xf3bf('0x44')](_0x1710f1[_0xf3bf('0xa2')](),_0x16f022);})[_0xf3bf('0x2c')](function(_0x1b4546){if(_0x1b4546[_0xf3bf('0x4a')]>0x0)_0x5c0194[_0xf3bf('0x4e')](_0xf3bf('0xb4'),_[_0xf3bf('0x31')](_0x1b4546,'id'));return db[_0xf3bf('0xa1')]['query'](_0x5c0194[_0xf3bf('0xa2')](),_0x16f022)[_0xf3bf('0x2c')](function(_0xd81c4a){var _0x11f11e=_[_0xf3bf('0xb5')](_0xd81c4a,_0xf3bf('0xb6'));var _0x2d88c0=[];_0x1b4546[_0xf3bf('0x35')](function(_0x2ecb45){_0x2d88c0[_0xf3bf('0x36')](updateSmsInteraction(_0x2ecb45,_0x2e1608,_0x11f11e));});return BPromise['all'](_0x2d88c0);});});})[_0xf3bf('0x2c')](function(_0x4fe13b){_0x2750c4[_0xf3bf('0xb7')]=_0x4fe13b;return _0x2750c4;})[_0xf3bf('0x2c')](respondWithFilteredResult(_0x210620,_0x59906d))['catch'](handleError(_0x210620,null));};exports[_0xf3bf('0xb8')]=function(_0x1374a4,_0x45d2e1){var _0x2328be={'raw':![],'where':{'id':_0x1374a4[_0xf3bf('0xb9')]['id']}},_0x22a6a4={};_0x22a6a4[_0xf3bf('0x43')]=_[_0xf3bf('0x45')](db[_0xf3bf('0x40')]['rawAttributes']);_0x22a6a4['query']=_[_0xf3bf('0x45')](_0x1374a4[_0xf3bf('0x44')]);_0x22a6a4['filters']=_['intersection'](_0x22a6a4[_0xf3bf('0x43')],_0x22a6a4[_0xf3bf('0x44')]);_0x2328be[_0xf3bf('0x48')]=_['intersection'](_0x22a6a4['model'],qs[_0xf3bf('0x49')](_0x1374a4[_0xf3bf('0x44')]['fields']));_0x2328be[_0xf3bf('0x48')]=_0x2328be[_0xf3bf('0x48')][_0xf3bf('0x4a')]?_0x2328be['attributes']:_0x22a6a4[_0xf3bf('0x43')];if(_0x1374a4[_0xf3bf('0x44')][_0xf3bf('0xba')]){_0x2328be[_0xf3bf('0xbb')]=[{'all':!![]}];}_0x2328be=_['merge']({},_0x2328be,_0x1374a4[_0xf3bf('0xbc')]);return db['SmsInteraction'][_0xf3bf('0x79')](_0x2328be)[_0xf3bf('0x2c')](handleEntityNotFound(_0x45d2e1,null))[_0xf3bf('0x2c')](respondWithResult(_0x45d2e1,null))[_0xf3bf('0x37')](handleError(_0x45d2e1,null));};exports[_0xf3bf('0xbd')]=function(_0x563509,_0x9e77d0){return db[_0xf3bf('0x40')][_0xf3bf('0xbd')](_0x563509[_0xf3bf('0xbe')],{})[_0xf3bf('0x2c')](respondWithResult(_0x9e77d0,0xc9))[_0xf3bf('0x37')](handleError(_0x9e77d0,null));};exports[_0xf3bf('0x2b')]=function(_0x3864de,_0x2d6802){if(_0x3864de[_0xf3bf('0xbe')]['id']){delete _0x3864de['body']['id'];}return db[_0xf3bf('0x40')]['find']({'where':{'id':_0x3864de[_0xf3bf('0xb9')]['id']}})[_0xf3bf('0x2c')](handleEntityNotFound(_0x2d6802,null))[_0xf3bf('0x2c')](saveUpdates(_0x3864de[_0xf3bf('0xbe')],null))[_0xf3bf('0x2c')](respondWithResult(_0x2d6802,null))[_0xf3bf('0x37')](handleError(_0x2d6802,null));};exports['destroy']=function(_0x5c6135,_0x1d5107){return db['SmsInteraction'][_0xf3bf('0x79')]({'where':{'id':_0x5c6135['params']['id']}})['then'](handleEntityNotFound(_0x1d5107,null))[_0xf3bf('0x2c')](removeEntity(_0x1d5107,null))['catch'](handleError(_0x1d5107,null));};exports['describe']=function(_0x3d14c1,_0x3ce0dc){return db['SmsInteraction'][_0xf3bf('0xbf')]()[_0xf3bf('0x2c')](respondWithResult(_0x3ce0dc,null))[_0xf3bf('0x37')](handleError(_0x3ce0dc,null));};exports[_0xf3bf('0xc0')]=function(_0x10c5c1,_0x5946f6,_0xa31473){return db[_0xf3bf('0xc1')]['find']({'where':{'id':_0x10c5c1[_0xf3bf('0xb9')]['id']}})[_0xf3bf('0x2c')](handleEntityNotFound(_0x5946f6,null))[_0xf3bf('0x2c')](function(_0x1d822e){if(_0x1d822e){return _0x1d822e['addMessage'](_0x10c5c1[_0xf3bf('0xbe')][_0xf3bf('0xc2')],_[_0xf3bf('0xc3')](_0x10c5c1['body'],['ids','id'])||{});}})[_0xf3bf('0x2c')](respondWithResult(_0x5946f6,null))[_0xf3bf('0x37')](handleError(_0x5946f6,null));};exports[_0xf3bf('0xc4')]=function(_0x241c02,_0x452be5,_0x4012f1){var _0x5c5b3c={'raw':![],'where':{}};var _0xc4ac26={};var _0x271a46={'count':0x0,'rows':[]};return db[_0xf3bf('0x40')][_0xf3bf('0xc5')]({'where':{'id':_0x241c02[_0xf3bf('0xb9')]['id']}})['then'](handleEntityNotFound(_0x452be5,null))[_0xf3bf('0x2c')](function(_0x44f5f9){if(_0x44f5f9){_0xc4ac26[_0xf3bf('0x43')]=_[_0xf3bf('0x45')](db[_0xf3bf('0xc1')][_0xf3bf('0x41')]);_0xc4ac26[_0xf3bf('0x44')]=_['keys'](_0x241c02['query']);_0xc4ac26[_0xf3bf('0x46')]=_['intersection'](_0xc4ac26[_0xf3bf('0x43')],_0xc4ac26[_0xf3bf('0x44')]);_0x5c5b3c[_0xf3bf('0x48')]=_['intersection'](_0xc4ac26[_0xf3bf('0x43')],qs[_0xf3bf('0x49')](_0x241c02[_0xf3bf('0x44')][_0xf3bf('0x49')]));_0x5c5b3c[_0xf3bf('0x48')]=_0x5c5b3c['attributes']['length']?_0x5c5b3c['attributes']:_0xc4ac26[_0xf3bf('0x43')];if(!_0x241c02[_0xf3bf('0x44')][_0xf3bf('0x4b')](_0xf3bf('0x4c'))){_0x5c5b3c[_0xf3bf('0x24')]=qs[_0xf3bf('0x24')](_0x241c02[_0xf3bf('0x44')][_0xf3bf('0x24')]);_0x5c5b3c[_0xf3bf('0x22')]=qs[_0xf3bf('0x22')](_0x241c02[_0xf3bf('0x44')][_0xf3bf('0x22')]);}_0x5c5b3c[_0xf3bf('0x96')]=qs[_0xf3bf('0x4d')](_0x241c02[_0xf3bf('0x44')][_0xf3bf('0x4d')]);_0x5c5b3c['where']=qs[_0xf3bf('0x46')](_[_0xf3bf('0x4f')](_0x241c02[_0xf3bf('0x44')],_0xc4ac26['filters']));_0x5c5b3c[_0xf3bf('0x4e')][_0xf3bf('0xb6')]=_0x44f5f9['id'];if(_0x241c02[_0xf3bf('0x44')][_0xf3bf('0x88')]){_0x5c5b3c['where']=_[_0xf3bf('0xa4')](_0x5c5b3c[_0xf3bf('0x4e')],{'$or':_[_0xf3bf('0x31')](_0x5c5b3c[_0xf3bf('0x48')],function(_0x17cfb4){var _0x47a603={};_0x47a603[_0x17cfb4]={'$like':'%'+_0x241c02[_0xf3bf('0x44')]['filter']+'%'};return _0x47a603;})});}if(_0x241c02[_0xf3bf('0x44')]['$gte']){var _0x2662d7=_0x241c02[_0xf3bf('0x44')][_0xf3bf('0xc6')]['split'](',');var _0x3770a7={};_0x3770a7[_0x2662d7[0x0]]={'$gte':moment(_0x2662d7[0x1])[_0xf3bf('0xc7')](_0xf3bf('0xc8'))};_0x5c5b3c[_0xf3bf('0x4e')]=_[_0xf3bf('0xa4')](_0x5c5b3c[_0xf3bf('0x4e')],_0x3770a7);}_0x5c5b3c=_['merge']({},_0x5c5b3c,_0x241c02[_0xf3bf('0xbc')]);return db[_0xf3bf('0xc1')][_0xf3bf('0x25')]({'where':_0x5c5b3c[_0xf3bf('0x4e')]})[_0xf3bf('0x2c')](function(_0x29af2b){_0x271a46['count']=_0x29af2b;if(_0x241c02[_0xf3bf('0x44')][_0xf3bf('0xba')]){_0x5c5b3c['include']=[{'all':!![]}];}return db[_0xf3bf('0xc1')]['findAll'](_0x5c5b3c);})[_0xf3bf('0x2c')](function(_0x5eb116){_0x271a46['rows']=_0x5eb116;return _0x271a46;});}})[_0xf3bf('0x2c')](respondWithFilteredResult(_0x452be5,_0x5c5b3c))[_0xf3bf('0x37')](handleError(_0x452be5,null));};exports[_0xf3bf('0xc9')]=function(_0x1f869d,_0x1d23b8,_0x6e630a){return db[_0xf3bf('0x40')]['find']({'where':{'id':_0x1f869d[_0xf3bf('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1d23b8,null))['then'](function(_0x121e27){if(_0x121e27){return _0x121e27['setTags'](_0x1f869d['body']['ids'],_['omit'](_0x1f869d[_0xf3bf('0xbe')],[_0xf3bf('0xc2'),'id'])||{})[_0xf3bf('0xca')](function(){return db[_0xf3bf('0x75')][_0xf3bf('0xcb')]({'attributes':['id',_0xf3bf('0x2f'),_0xf3bf('0xcc')],'where':{'id':_0x1f869d[_0xf3bf('0xbe')][_0xf3bf('0xc2')]}});})[_0xf3bf('0x2c')](function(_0x20696b){socket[_0xf3bf('0xcd')](_0xf3bf('0xce'),{'id':Number(_0x1f869d['params']['id']),'tags':_0x20696b||[]});return{'id':Number(_0x1f869d[_0xf3bf('0xb9')]['id']),'tags':_0x20696b||[]};});}})['then'](respondWithResult(_0x1d23b8,null))['catch'](handleError(_0x1d23b8,null));};exports[_0xf3bf('0xcf')]=function(_0x46ce5c,_0x50c4ae,_0x16b8fc){return db['SmsInteraction'][_0xf3bf('0x79')]({'where':{'id':_0x46ce5c[_0xf3bf('0xb9')]['id']}})[_0xf3bf('0x2c')](handleEntityNotFound(_0x50c4ae,null))[_0xf3bf('0x2c')](function(_0xf78a29){if(_0xf78a29){return _0xf78a29['removeTags'](_0x46ce5c[_0xf3bf('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x50c4ae,null))[_0xf3bf('0x37')](handleError(_0x50c4ae,null));};exports[_0xf3bf('0xd0')]=function(_0x43aced,_0x520e0c){var _0x3cf693=moment()['unix']()[_0xf3bf('0xa2')]();var _0x1e0fe5=path[_0xf3bf('0xd1')](config[_0xf3bf('0xd2')],'server',_0xf3bf('0xd3'),_0xf3bf('0xd4'));var _0xfc5962=path['join'](config[_0xf3bf('0xd2')],_0xf3bf('0xd5'),_0xf3bf('0xd3'),_0xf3bf('0xd6'));var _0x5e1df8=path['join'](_0x1e0fe5,_0x3cf693);var _0x3efb12=util[_0xf3bf('0xc7')]('transcript-%d-%s.zip',_0x43aced['params']['id'],_0x3cf693);var _0x42e49d=path[_0xf3bf('0xd1')](_0x1e0fe5,_0x3efb12);var _0x5706a6=[];_0x5706a6[_0xf3bf('0x36')]({'model':db[_0xf3bf('0xd7')],'as':_0xf3bf('0xd7'),'attributes':['id',_0xf3bf('0x32')],'raw':!![]});_0x5706a6[_0xf3bf('0x36')]({'model':db[_0xf3bf('0xd8')],'as':_0xf3bf('0x6b'),'attributes':['id',_0xf3bf('0xd9'),_0xf3bf('0xda')],'raw':!![]});var _0x2bc2f4=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xf3bf('0xbe'),'createdAt',_0xf3bf('0xdb'),_0xf3bf('0xdc'),_0xf3bf('0x84')],'include':_0x5706a6}];_0x2bc2f4[_0xf3bf('0x36')]({'model':db[_0xf3bf('0xdd')],'as':_0xf3bf('0xde'),'attributes':['id','name']});_0x2bc2f4[_0xf3bf('0x36')]({'model':db['User'],'as':_0xf3bf('0xdf'),'attributes':['id',_0xf3bf('0x32')]});return db[_0xf3bf('0x40')]['find']({'where':{'id':_0x43aced[_0xf3bf('0xb9')]['id']},'include':_0x2bc2f4})['then'](handleEntityNotFound(_0x520e0c,null))['then'](function(_0x1628d8){if(_0x1628d8){var _0x50a374=_0x1628d8[_0xf3bf('0xe0')]({'plain':!![]});fs[_0xf3bf('0xe1')](_0x5e1df8);var _0xbac191={'channel':'Sms','account':_0x50a374[_0xf3bf('0xde')]['name'],'agent':_0x50a374[_0xf3bf('0xdf')]?_0x50a374[_0xf3bf('0xdf')]['fullname']:'N.A.','createdAt':moment(_0x50a374[_0xf3bf('0x7d')])[_0xf3bf('0xc7')](_0xf3bf('0xc8'))[_0xf3bf('0xa2')](),'closedAt':_0x50a374['closed']?moment(_0x50a374[_0xf3bf('0xe2')])[_0xf3bf('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf3bf('0xa2')]():'','disposition':_0x50a374[_0xf3bf('0xe3')],'messages':_(_0x50a374[_0xf3bf('0xe4')])[_0xf3bf('0x88')]({'secret':![]})[_0xf3bf('0x31')](function(_0x186ffe){return{'date':moment(_0x186ffe[_0xf3bf('0x7d')])[_0xf3bf('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf3bf('0xa2')](),'sender':_0x186ffe['direction']==='out'?_0x186ffe[_0xf3bf('0xd7')]?_0x186ffe[_0xf3bf('0xd7')][_0xf3bf('0x32')]:_0xf3bf('0xe5'):_0x186ffe['Contact'][_0xf3bf('0xd9')]+(_0x186ffe[_0xf3bf('0x6b')][_0xf3bf('0xda')]?'\x20'+_0x186ffe['Contact'][_0xf3bf('0xda')]:''),'body':_0x186ffe['body'],'direction':_0x186ffe[_0xf3bf('0xdb')]===_0xf3bf('0xe6')?'A':'C','secret':_0x186ffe['secret'],'read':_0x186ffe[_0xf3bf('0x84')]};})[_0xf3bf('0x73')]()};return ejs[_0xf3bf('0xe7')](path[_0xf3bf('0xd1')](config[_0xf3bf('0xd2')],_0xf3bf('0xd5'),_0xf3bf('0xe8'),_0xf3bf('0xe9')),{'interaction':_0xbac191})[_0xf3bf('0x2c')](function(_0x16b98a){var _0xe8806b=path[_0xf3bf('0xd1')](_0x5e1df8,'transcript-'+_0x50a374['id']+'-'+_0x3cf693+_0xf3bf('0xea'));var _0xbe8989={'path':_0xe8806b,'channel':_0xf3bf('0xeb'),'interactionId':_0x50a374['id']};return pdf['createPdfFromHTML'](_0x16b98a,_0xbe8989);})[_0xf3bf('0x2c')](function(){return new BPromise(function(_0x21a38b,_0x5a2846){zipdir(_0x5e1df8,{'saveTo':_0x42e49d},function(_0x414a68,_0x5c8464){if(_0x414a68)return _0x5a2846(_0x414a68);return _0x21a38b(_0x5c8464);});})[_0xf3bf('0x2c')](function(){return new BPromise(function(_0x22305e,_0x38640d){rimraf(_0x5e1df8,function(_0x121263){if(_0x121263)_0x38640d(_0x121263);return _0x22305e();});});})[_0xf3bf('0x2c')](function(){return _0x520e0c[_0xf3bf('0xd0')](_0x42e49d,_0x3efb12,function(_0x9a9c28){if(_0x9a9c28){console['log']('err',_0x9a9c28);}else{fs[_0xf3bf('0xec')](_0x42e49d);}});});});}else{return _0x520e0c['sendStatus'](0xc8);}})[_0xf3bf('0x37')](handleError(_0x520e0c,null));}; \ No newline at end of file +var _0xa311=['show','params','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','includeAll','findAll','addTags','Tag','removeTags','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','Owner','get','Account','N.A.','closedAt','disposition','out','System','renderFile','downloadInteraction.ejs','transcript-','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','map','SmsInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','field','from','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','text','keys','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','sequelize','toString','merge','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.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','rows'];(function(_0xcf1ed9,_0x561e9c){var _0xd18d49=function(_0x117e59){while(--_0x117e59){_0xcf1ed9['push'](_0xcf1ed9['shift']());}};_0xd18d49(++_0x561e9c);}(_0xa311,0x118));var _0x1a31=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xa311[_0x59162a];return _0x35e50d;};'use strict';var emlformat=require(_0x1a31('0x0'));var rimraf=require(_0x1a31('0x1'));var zipdir=require(_0x1a31('0x2'));var jsonpatch=require(_0x1a31('0x3'));var rp=require('request-promise');var moment=require(_0x1a31('0x4'));var BPromise=require(_0x1a31('0x5'));var Mustache=require(_0x1a31('0x6'));var util=require(_0x1a31('0x7'));var path=require(_0x1a31('0x8'));var sox=require(_0x1a31('0x9'));var csv=require(_0x1a31('0xa'));var ejs=require(_0x1a31('0xb'));var fs=require('fs');var fs_extra=require(_0x1a31('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a31('0xd'));var deskjs=require(_0x1a31('0xe'));var toCsv=require(_0x1a31('0xa'));var querystring=require('querystring');var Papa=require(_0x1a31('0xf'));var Redis=require(_0x1a31('0x10'));var authService=require(_0x1a31('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a31('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x1a31('0x13'));var logger=require(_0x1a31('0x14'))('api');var utils=require(_0x1a31('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a31('0x16'));var db=require(_0x1a31('0x17'))['db'];config[_0x1a31('0x18')]=_[_0x1a31('0x19')](config[_0x1a31('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a31('0x1a'))(new Redis(config[_0x1a31('0x18')]));require('./smsInteraction.socket')[_0x1a31('0x1b')](socket);function respondWithStatusCode(_0x5f05e5,_0x1ae087){_0x1ae087=_0x1ae087||0xcc;return function(_0x5d2063){if(_0x5d2063){return _0x5f05e5[_0x1a31('0x1c')](_0x1ae087);}return _0x5f05e5[_0x1a31('0x1d')](_0x1ae087)[_0x1a31('0x1e')]();};}function respondWithResult(_0x4c6da6,_0x57dd86){_0x57dd86=_0x57dd86||0xc8;return function(_0x2c6828){if(_0x2c6828){return _0x4c6da6[_0x1a31('0x1d')](_0x57dd86)[_0x1a31('0x1f')](_0x2c6828);}};}function respondWithFilteredResult(_0x1e6b9a,_0x215e49){return function(_0x8eff01){if(_0x8eff01){var _0x21b414=typeof _0x215e49['offset']===_0x1a31('0x20')&&typeof _0x215e49[_0x1a31('0x21')]===_0x1a31('0x20');var _0x395063=_0x8eff01['count'];var _0x4c2a3f=_0x21b414?0x0:_0x215e49[_0x1a31('0x22')];var _0x1eb0d8=_0x21b414?_0x8eff01[_0x1a31('0x23')]:_0x215e49[_0x1a31('0x22')]+_0x215e49[_0x1a31('0x21')];var _0x505710;if(_0x1eb0d8>=_0x395063){_0x1eb0d8=_0x395063;_0x505710=0xc8;}else{_0x505710=0xce;}_0x1e6b9a[_0x1a31('0x1d')](_0x505710);return _0x1e6b9a['set'](_0x1a31('0x24'),_0x4c2a3f+'-'+_0x1eb0d8+'/'+_0x395063)[_0x1a31('0x1f')](_0x8eff01);}return null;};}function patchUpdates(_0x2e9eed){return function(_0x5ef92e){try{jsonpatch[_0x1a31('0x25')](_0x5ef92e,_0x2e9eed,!![]);}catch(_0x3ef738){return BPromise[_0x1a31('0x26')](_0x3ef738);}return _0x5ef92e[_0x1a31('0x27')]();};}function saveUpdates(_0x4cd092,_0x4eae9a){return function(_0x293079){if(_0x293079){return _0x293079[_0x1a31('0x28')](_0x4cd092)[_0x1a31('0x29')](function(_0x4bcc70){return _0x4bcc70;});}return null;};}function removeEntity(_0x1c0e04,_0x359926){return function(_0x2c1e21){if(_0x2c1e21){return _0x2c1e21[_0x1a31('0x2a')]()[_0x1a31('0x29')](function(){_0x1c0e04[_0x1a31('0x1d')](0xcc)[_0x1a31('0x1e')]();});}};}function handleEntityNotFound(_0x6e42f5,_0xe114d5){return function(_0x1b2006){if(!_0x1b2006){_0x6e42f5['sendStatus'](0x194);}return _0x1b2006;};}function handleError(_0x11bdf4,_0x32becd){_0x32becd=_0x32becd||0x1f4;return function(_0x482b8d){logger[_0x1a31('0x2b')](_0x482b8d[_0x1a31('0x2c')]);if(_0x482b8d['name']){delete _0x482b8d[_0x1a31('0x2d')];}_0x11bdf4['status'](_0x32becd)[_0x1a31('0x2e')](_0x482b8d);};}function getInteractionUsers(_0x2b8748,_0x619fbb){return new BPromise(function(_0x45a4c7,_0x2b33f4){try{if(_0x619fbb[_0x2b8748['id']]){_0x2b8748['Users']=_['map'](_0x619fbb[_0x2b8748['id']],function(_0x38a658){return{'id':_0x38a658['id'],'fullname':_0x38a658[_0x1a31('0x2f')]};});}}catch(_0x172976){_0x2b33f4(_0x172976);}_0x45a4c7(_0x2b8748);});}function getInteractionTags(_0x7f36b5,_0x1092ab){return new BPromise(function(_0x2f7c7d,_0x30b9b9){try{if(_0x7f36b5[_0x1a31('0x30')]){_0x7f36b5[_0x1a31('0x31')]=[];_0x7f36b5[_0x1a31('0x30')][_0x1a31('0x32')](',')[_0x1a31('0x33')](function(_0x3733e1){_0x7f36b5[_0x1a31('0x31')][_0x1a31('0x34')](_0x1092ab[_0x3733e1]);});}delete _0x7f36b5[_0x1a31('0x30')];}catch(_0x683006){_0x30b9b9(_0x683006);}_0x2f7c7d(_0x7f36b5);});}function updateSmsInteraction(_0x52d840,_0x335267,_0x38dc56){return new BPromise(function(_0x17240c,_0x27cce6){return getInteractionUsers(_0x52d840,_0x38dc56)[_0x1a31('0x29')](function(_0x57bed5){return getInteractionTags(_0x57bed5,_0x335267);})[_0x1a31('0x29')](function(_0x1c43a1){return getStateInteraction(_0x1c43a1);})[_0x1a31('0x29')](function(_0x123222){_0x17240c(_0x123222);})[_0x1a31('0x35')](function(_0x1b649a){_0x27cce6(_0x1b649a);});});}function getStateInteraction(_0x2cab5b){return new BPromise(function(_0x4c3b9b){_0x2cab5b[_0x1a31('0x36')]=0x0;_0x2cab5b[_0x1a31('0x37')]=0x0;_0x2cab5b[_0x1a31('0x38')]=0x0;_0x2cab5b[_0x1a31('0x39')]=0x0;_0x2cab5b['total']=0x0;if(!_0x2cab5b[_0x1a31('0x3a')]&&!_0x2cab5b[_0x1a31('0x3b')]){_0x2cab5b[_0x1a31('0x36')]+=0x1;}if(!_0x2cab5b['closed']&&_0x2cab5b[_0x1a31('0x3b')]){_0x2cab5b[_0x1a31('0x37')]+=0x1;if(_0x2cab5b['waiting']){_0x2cab5b[_0x1a31('0x36')]-=0x1;}}if(_0x2cab5b[_0x1a31('0x3a')]&&_0x2cab5b[_0x1a31('0x3b')]){_0x2cab5b[_0x1a31('0x38')]+=0x1;if(_0x2cab5b[_0x1a31('0x37')]){_0x2cab5b['talking']-=0x1;}}if(_0x2cab5b[_0x1a31('0x3a')]&&!_0x2cab5b[_0x1a31('0x3b')]){_0x2cab5b[_0x1a31('0x39')]+=0x1;if(_0x2cab5b[_0x1a31('0x36')]){_0x2cab5b[_0x1a31('0x36')]-=0x1;}}_0x2cab5b[_0x1a31('0x3c')]+=0x1;_0x4c3b9b(_0x2cab5b);});}exports[_0x1a31('0x3d')]=function(_0x41d725,_0x54e748){var _0x3a78c9={},_0x3c26bb={},_0x2e1894={'count':0x0,'rows':[]};var _0x21c9e2=_[_0x1a31('0x3e')](db[_0x1a31('0x3f')][_0x1a31('0x40')],function(_0x5a60b5){return{'name':_0x5a60b5[_0x1a31('0x41')],'type':_0x5a60b5[_0x1a31('0x42')]['key']};});_0x3c26bb[_0x1a31('0x43')]=_[_0x1a31('0x3e')](_0x21c9e2,_0x1a31('0x2d'));_0x3c26bb['query']=_['keys'](_0x41d725[_0x1a31('0x44')]);_0x3c26bb[_0x1a31('0x45')]=_['intersection'](_0x3c26bb[_0x1a31('0x43')],_0x3c26bb[_0x1a31('0x44')]);_0x3a78c9['attributes']=_[_0x1a31('0x46')](_0x3c26bb[_0x1a31('0x43')],qs[_0x1a31('0x47')](_0x41d725[_0x1a31('0x44')]['fields']));_0x3a78c9[_0x1a31('0x48')]=_0x3a78c9[_0x1a31('0x48')][_0x1a31('0x49')]?_0x3a78c9[_0x1a31('0x48')]:_0x3c26bb[_0x1a31('0x43')];if(!_0x41d725[_0x1a31('0x44')][_0x1a31('0x4a')](_0x1a31('0x4b'))){_0x3a78c9['limit']=qs['limit'](_0x41d725[_0x1a31('0x44')][_0x1a31('0x21')]);_0x3a78c9['offset']=qs[_0x1a31('0x22')](_0x41d725['query'][_0x1a31('0x22')]);}_0x3a78c9['order']=qs[_0x1a31('0x4c')](_0x41d725['query'][_0x1a31('0x4c')]);_0x3a78c9[_0x1a31('0x4d')]=qs[_0x1a31('0x45')](_[_0x1a31('0x4e')](_0x41d725[_0x1a31('0x44')],_0x3c26bb[_0x1a31('0x45')]),_0x21c9e2);var _0x4c60e4=[];var _0x782f3d=squel['select']()[_0x1a31('0x4f')]('id')[_0x1a31('0x4f')]('name')[_0x1a31('0x4f')]('color')[_0x1a31('0x50')]('tools_tags');var _0x2c849a=squel[_0x1a31('0x51')]()['field']('u.id')[_0x1a31('0x4f')](_0x1a31('0x52'))[_0x1a31('0x4f')](_0x1a31('0x53'))['from'](_0x1a31('0x54'),'ui')['left_join']('users','u',_0x1a31('0x55'));var _0x1bfa65=squel[_0x1a31('0x51')]()['from'](_0x1a31('0x56'),'i')[_0x1a31('0x57')](_0x1a31('0x58'),'c',_0x1a31('0x59'))[_0x1a31('0x57')](_0x1a31('0x5a'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1a31('0x5b'),'a',_0x1a31('0x5c'))[_0x1a31('0x57')](_0x1a31('0x5d'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x1a31('0x57')](_0x1a31('0x5e'),'it',_0x1a31('0x5f'))[_0x1a31('0x57')](_0x1a31('0x60'),'t',_0x1a31('0x61'));var _0x4d16d9=squel[_0x1a31('0x62')]();var _0x53a06a=[];var _0x33e5d4=squel[_0x1a31('0x62')]();var _0x40d95b;if(_0x41d725['query'][_0x1a31('0x63')]){_0x40d95b=as[_0x1a31('0x64')](_0x41d725[_0x1a31('0x44')]['search']);var _0x205842=_0x40d95b['sqlOperator'];for(var _0x54a2ed=0x0;_0x54a2ed<_0x40d95b[_0x1a31('0x65')][_0x1a31('0x49')];_0x54a2ed++){var _0x518b65=_0x40d95b[_0x1a31('0x65')][_0x54a2ed];var _0x21fcb0='i';var _0x275896=_[_0x1a31('0x66')](_0x21c9e2,['name',_0x518b65['field']]);if(!_0x275896){switch(_0x518b65[_0x1a31('0x4f')]){case _0x1a31('0x67'):if(_0x518b65[_0x1a31('0x68')]==0x1){_0x1bfa65[_0x1a31('0x69')]('`'+_0x518b65[_0x1a31('0x4f')]+_0x1a31('0x6a'));}else{_0x1bfa65['having']('`'+_0x518b65[_0x1a31('0x4f')]+_0x1a31('0x6b'));}break;case _0x1a31('0x6c'):if(_0x518b65[_0x1a31('0x6d')]===_0x1a31('0x6e')){if(_0x518b65[_0x1a31('0x68')][_0x1a31('0x32')]('\x20')[_0x1a31('0x49')]>0x1){_0x4d16d9[_0x205842](_0x1a31('0x6f'),qs['getFullTextValue'](_0x518b65[_0x1a31('0x68')]),null);}else{var _0x577b1c='%'+_0x518b65[_0x1a31('0x68')]+'%';_0x4d16d9[_0x205842](_0x1a31('0x70'),_0x577b1c,_0x577b1c,_0x577b1c);}}else{_0x275896=_[_0x1a31('0x66')](_0x21c9e2,[_0x1a31('0x2d'),_0x1a31('0x71')]);_0x518b65[_0x1a31('0x4f')]='ContactId';_0x64f743=as[_0x1a31('0x72')](_0x21fcb0,_0x275896['type'],_0x518b65);_0x4d16d9[_0x205842](_0x64f743['text'],_0x64f743['value'][_0x1a31('0x73')],_0x64f743[_0x1a31('0x68')]['end']);}break;case'Tag':var _0x43273c=_0x518b65['value'][_0x1a31('0x32')](',')[_0x1a31('0x3e')](function(_0xf7954b){return Number(_0xf7954b);});_0x43273c[_0x1a31('0x33')](function(_0x21fc9a){_0x33e5d4['or'](_0x1a31('0x74'),'%,'+_0x21fc9a+',%');});_0x53a06a=_[_0x1a31('0x75')](_0x53a06a,_0x43273c);break;case _0x1a31('0x76'):if(_0x518b65['operator']===_0x1a31('0x6e')){_0x4d16d9[_0x205842](_0x1a31('0x77'),'%'+_0x518b65['value']+'%',null);}else{_0x275896=_[_0x1a31('0x66')](_0x21c9e2,['name',_0x1a31('0x3b')]);_0x518b65[_0x1a31('0x4f')]=_0x1a31('0x3b');_0x64f743=as['buildExpression'](_0x21fcb0,_0x275896[_0x1a31('0x42')],_0x518b65);_0x4d16d9[_0x205842](_0x64f743['text'],_0x64f743[_0x1a31('0x68')][_0x1a31('0x73')],_0x64f743[_0x1a31('0x68')]['end']);}break;case _0x1a31('0x78'):_0x64f743=as[_0x1a31('0x72')]('me',null,_0x518b65);_0x4d16d9[_0x205842](_0x64f743[_0x1a31('0x79')],_0x64f743[_0x1a31('0x68')][_0x1a31('0x73')],_0x64f743[_0x1a31('0x68')]['end']);break;}}else{var _0x64f743=as[_0x1a31('0x72')](_0x21fcb0,_0x275896[_0x1a31('0x42')],_0x518b65);_0x4d16d9[_0x205842](_0x64f743[_0x1a31('0x79')],_0x64f743[_0x1a31('0x68')][_0x1a31('0x73')],_0x64f743[_0x1a31('0x68')][_0x1a31('0x1e')]);}}}else{var _0x3235cd=_(_0x41d725[_0x1a31('0x44')])[_0x1a31('0x7a')]()['map'](function(_0x3b0419){return _[_0x1a31('0x7b')](_0x21c9e2,[_0x1a31('0x2d'),_0x3b0419])?_0x3b0419:undefined;})['compact']()[_0x1a31('0x68')]();if(!_[_0x1a31('0x7c')](_0x3235cd)){_0x3235cd[_0x1a31('0x33')](function(_0x8fed20){if(_0x8fed20===_0x1a31('0x7d')){_0x1bfa65['where'](_0x1a31('0x7e'),[][_0x1a31('0x7f')](_0x41d725[_0x1a31('0x44')][_0x8fed20]));}else if(_0x8fed20===_0x1a31('0x80')){var _0x1dde04=JSON['parse'](_0x41d725['query'][_0x8fed20])[_0x1a31('0x81')];var _0x583c25=JSON['parse'](_0x41d725[_0x1a31('0x44')][_0x8fed20])[_0x1a31('0x82')];_0x1bfa65[_0x1a31('0x4d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1dde04,_0x583c25);}else{if(_0x41d725[_0x1a31('0x44')][_0x8fed20]===_0x1a31('0x83')){_0x1bfa65[_0x1a31('0x4d')]('i.'+_0x8fed20+_0x1a31('0x84'));}else{_0x1bfa65['where']('i.'+_0x8fed20+'\x20=\x20?',_0x41d725[_0x1a31('0x44')][_0x8fed20]);}}});}if(_0x41d725[_0x1a31('0x44')][_0x1a31('0x85')]){if(_0x41d725[_0x1a31('0x44')][_0x1a31('0x85')]==0x1){_0x1bfa65['having']('`unreadMessages`\x20=\x200');}else{_0x1bfa65[_0x1a31('0x69')](_0x1a31('0x86'));}}if(_0x41d725[_0x1a31('0x44')]['tag']){_0x53a06a=_[_0x1a31('0x87')](_0x41d725[_0x1a31('0x44')]['tag'])?_0x41d725[_0x1a31('0x44')][_0x1a31('0x88')]:new Array(_0x41d725['query']['tag']);_0x53a06a['forEach'](function(_0x43beba){_0x33e5d4['or'](_0x1a31('0x74'),'%,'+_0x43beba+',%');});}if(_0x41d725['query']['filter']){var _0x18ad4d=_0x41d725[_0x1a31('0x44')][_0x1a31('0x89')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1a31('0x8a')](_0x18ad4d)){_0x4d16d9['or'](_0x1a31('0x8b'),_0x18ad4d+'%')['or'](_0x1a31('0x8c'),_0x18ad4d+'%');}else{_0x4d16d9['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1a31('0x8d')](_0x18ad4d))['or'](_0x1a31('0x8e'),_0x18ad4d+'%');}}}_0x1bfa65[_0x1a31('0x4d')](_0x4d16d9);_0x1bfa65[_0x1a31('0x8f')](_0x1a31('0x90'));var _0x39ac99={'type':db[_0x1a31('0x91')][_0x1a31('0x92')][_0x1a31('0x93')],'raw':!![]};var _0x2d01a3=_0x1bfa65[_0x1a31('0x94')]();_0x2d01a3['field'](_0x1a31('0x90'));_0x2d01a3[_0x1a31('0x4f')](_0x1a31('0x95'),_0x1a31('0x67'));if(_0x3a78c9[_0x1a31('0x96')]){_0x3a78c9['order'][_0x1a31('0x33')](function(_0x5b7480){var _0x51ce34=_0x5b7480[0x0]===_0x1a31('0x97')?_0x5b7480[0x0]:'i.'+_0x5b7480[0x0];_0x1bfa65['order'](_0x51ce34,_0x5b7480[0x1]===_0x1a31('0x98')?![]:!![]);});}if(!_[_0x1a31('0x7c')](_0x53a06a)){_0x1bfa65['having'](_0x33e5d4);_0x2d01a3['where'](_0x1a31('0x99'),_0x53a06a);}BPromise[_0x1a31('0x9a')]()[_0x1a31('0x29')](function(){if(!_0x40d95b){if(_0x41d725[_0x1a31('0x44')]['SmsAccountId'])return;_0x2d01a3[_0x1a31('0x4d')](_0x1a31('0x9b'));_0x1bfa65['where'](_0x1a31('0x9b'));return;}if(_0x41d725[_0x1a31('0x9c')][_0x1a31('0x9d')]!=='agent')return;return _0x41d725[_0x1a31('0x9c')][_0x1a31('0x9e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1c35c0){if(_[_0x1a31('0x7c')](_0x1c35c0)){_0x2d01a3[_0x1a31('0x4d')]('i.SmsAccountId\x20IS\x20NULL');_0x1bfa65[_0x1a31('0x4d')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x2d01a3['where'](_0x1a31('0x7e'),_[_0x1a31('0x3e')](_0x1c35c0,'id'));_0x1bfa65['where'](_0x1a31('0x7e'),_[_0x1a31('0x3e')](_0x1c35c0,'id'));}});})[_0x1a31('0x29')](function(){if(_0x41d725['user'][_0x1a31('0x9d')]==='agent'&&!_0x40d95b&&!_0x41d725['query'][_0x1a31('0x7d')])return[];return db[_0x1a31('0x9f')][_0x1a31('0x44')](_0x2d01a3[_0x1a31('0xa0')](),_0x39ac99);})['then'](function(_0x2ae9ac){_0x2e1894[_0x1a31('0x23')]=_0x2ae9ac[_0x1a31('0x49')];if(_0x2e1894['count']===0x0)return[];return db[_0x1a31('0x9f')][_0x1a31('0x44')](_0x782f3d[_0x1a31('0xa0')](),_0x39ac99)[_0x1a31('0x29')](function(_0x3acaca){_0x4c60e4=_['keyBy'](_0x3acaca,'id');_0x39ac99=_[_0x1a31('0xa1')](_0x39ac99,{'model':db[_0x1a31('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41d725[_0x1a31('0x44')][_0x1a31('0x47')]){_0x3a78c9[_0x1a31('0x48')]['forEach'](function(_0x137583){_0x1bfa65[_0x1a31('0x4f')]('i.'+_0x137583);});}else{_0x1bfa65[_0x1a31('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1a31('0x67'));_0x1bfa65[_0x1a31('0x4f')]('a.key',_0x1a31('0xa2'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xa3'),'Account.mandatoryDisposition');_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xa4'),'contactName');_0x1bfa65[_0x1a31('0x4f')]('i.*');_0x1bfa65['field'](_0x1a31('0xa5'),_0x1a31('0xa6'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xa7'),_0x1a31('0xa8'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xa9'),_0x1a31('0xaa'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xab'),_0x1a31('0xac'));_0x1bfa65['field']('c.mobile',_0x1a31('0xad'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xae'),_0x1a31('0xaf'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xb0'),_0x1a31('0xb1'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xb2'),_0x1a31('0xb3'));_0x1bfa65[_0x1a31('0x4f')](_0x1a31('0xb4'),_0x1a31('0x30'));}if(_0x3a78c9[_0x1a31('0x21')])_0x1bfa65['limit'](_0x3a78c9['limit']);if(_0x3a78c9[_0x1a31('0x22')])_0x1bfa65[_0x1a31('0x22')](_0x3a78c9[_0x1a31('0x22')]);return db[_0x1a31('0x9f')][_0x1a31('0x44')](_0x1bfa65[_0x1a31('0xa0')](),_0x39ac99);})[_0x1a31('0x29')](function(_0x1e003e){if(_0x1e003e[_0x1a31('0x49')]>0x0)_0x2c849a['where'](_0x1a31('0xb5'),_[_0x1a31('0x3e')](_0x1e003e,'id'));return db['sequelize'][_0x1a31('0x44')](_0x2c849a[_0x1a31('0xa0')](),_0x39ac99)[_0x1a31('0x29')](function(_0x4a5344){var _0xdf3a69=_['groupBy'](_0x4a5344,_0x1a31('0xb6'));var _0x12f1cb=[];_0x1e003e[_0x1a31('0x33')](function(_0x1b516b){_0x12f1cb[_0x1a31('0x34')](updateSmsInteraction(_0x1b516b,_0x4c60e4,_0xdf3a69));});return BPromise['all'](_0x12f1cb);});});})[_0x1a31('0x29')](function(_0x1aecd7){_0x2e1894[_0x1a31('0xb7')]=_0x1aecd7;return _0x2e1894;})[_0x1a31('0x29')](respondWithFilteredResult(_0x54e748,_0x3a78c9))[_0x1a31('0x35')](handleError(_0x54e748,null));};exports[_0x1a31('0xb8')]=function(_0x53fae3,_0x77410f){var _0x909963={'raw':![],'where':{'id':_0x53fae3[_0x1a31('0xb9')]['id']}},_0x16c087={};_0x16c087['model']=_[_0x1a31('0x7a')](db[_0x1a31('0x3f')][_0x1a31('0x40')]);_0x16c087[_0x1a31('0x44')]=_['keys'](_0x53fae3[_0x1a31('0x44')]);_0x16c087['filters']=_[_0x1a31('0x46')](_0x16c087['model'],_0x16c087[_0x1a31('0x44')]);_0x909963[_0x1a31('0x48')]=_['intersection'](_0x16c087[_0x1a31('0x43')],qs[_0x1a31('0x47')](_0x53fae3[_0x1a31('0x44')][_0x1a31('0x47')]));_0x909963[_0x1a31('0x48')]=_0x909963[_0x1a31('0x48')][_0x1a31('0x49')]?_0x909963['attributes']:_0x16c087[_0x1a31('0x43')];if(_0x53fae3[_0x1a31('0x44')]['includeAll']){_0x909963[_0x1a31('0xba')]=[{'all':!![]}];}_0x909963=_[_0x1a31('0xa1')]({},_0x909963,_0x53fae3[_0x1a31('0xbb')]);return db[_0x1a31('0x3f')][_0x1a31('0x66')](_0x909963)[_0x1a31('0x29')](handleEntityNotFound(_0x77410f,null))['then'](respondWithResult(_0x77410f,null))['catch'](handleError(_0x77410f,null));};exports['create']=function(_0x5463fa,_0x750d95){return db[_0x1a31('0x3f')][_0x1a31('0xbc')](_0x5463fa[_0x1a31('0x78')],{})['then'](respondWithResult(_0x750d95,0xc9))['catch'](handleError(_0x750d95,null));};exports[_0x1a31('0x28')]=function(_0x28c673,_0x2fe4c0){if(_0x28c673[_0x1a31('0x78')]['id']){delete _0x28c673[_0x1a31('0x78')]['id'];}return db[_0x1a31('0x3f')][_0x1a31('0x66')]({'where':{'id':_0x28c673[_0x1a31('0xb9')]['id']}})[_0x1a31('0x29')](handleEntityNotFound(_0x2fe4c0,null))[_0x1a31('0x29')](saveUpdates(_0x28c673['body'],null))[_0x1a31('0x29')](respondWithResult(_0x2fe4c0,null))[_0x1a31('0x35')](handleError(_0x2fe4c0,null));};exports[_0x1a31('0x2a')]=function(_0x421675,_0x4a2cd){return db[_0x1a31('0x3f')][_0x1a31('0x66')]({'where':{'id':_0x421675[_0x1a31('0xb9')]['id']}})[_0x1a31('0x29')](handleEntityNotFound(_0x4a2cd,null))[_0x1a31('0x29')](removeEntity(_0x4a2cd,null))[_0x1a31('0x35')](handleError(_0x4a2cd,null));};exports['describe']=function(_0x3d3301,_0x2e66e3){return db[_0x1a31('0x3f')][_0x1a31('0xbd')]()[_0x1a31('0x29')](respondWithResult(_0x2e66e3,null))['catch'](handleError(_0x2e66e3,null));};exports[_0x1a31('0xbe')]=function(_0x1bd924,_0x432dec,_0x2073e2){return db['SmsMessage'][_0x1a31('0x66')]({'where':{'id':_0x1bd924['params']['id']}})[_0x1a31('0x29')](handleEntityNotFound(_0x432dec,null))[_0x1a31('0x29')](function(_0x3200c5){if(_0x3200c5){return _0x3200c5['addMessage'](_0x1bd924[_0x1a31('0x78')][_0x1a31('0xbf')],_[_0x1a31('0xc0')](_0x1bd924['body'],[_0x1a31('0xbf'),'id'])||{});}})[_0x1a31('0x29')](respondWithResult(_0x432dec,null))[_0x1a31('0x35')](handleError(_0x432dec,null));};exports[_0x1a31('0xc1')]=function(_0x3ae604,_0x1e6136,_0x43ec2c){var _0x53589d={'raw':![],'where':{}};var _0x582f8c={};var _0x117672={'count':0x0,'rows':[]};return db[_0x1a31('0x3f')][_0x1a31('0xc2')]({'where':{'id':_0x3ae604[_0x1a31('0xb9')]['id']}})[_0x1a31('0x29')](handleEntityNotFound(_0x1e6136,null))['then'](function(_0x12717b){if(_0x12717b){_0x582f8c['model']=_['keys'](db['SmsMessage'][_0x1a31('0x40')]);_0x582f8c[_0x1a31('0x44')]=_[_0x1a31('0x7a')](_0x3ae604['query']);_0x582f8c[_0x1a31('0x45')]=_[_0x1a31('0x46')](_0x582f8c['model'],_0x582f8c[_0x1a31('0x44')]);_0x53589d[_0x1a31('0x48')]=_['intersection'](_0x582f8c[_0x1a31('0x43')],qs['fields'](_0x3ae604[_0x1a31('0x44')][_0x1a31('0x47')]));_0x53589d[_0x1a31('0x48')]=_0x53589d[_0x1a31('0x48')]['length']?_0x53589d['attributes']:_0x582f8c[_0x1a31('0x43')];if(!_0x3ae604[_0x1a31('0x44')][_0x1a31('0x4a')](_0x1a31('0x4b'))){_0x53589d[_0x1a31('0x21')]=qs[_0x1a31('0x21')](_0x3ae604[_0x1a31('0x44')][_0x1a31('0x21')]);_0x53589d[_0x1a31('0x22')]=qs['offset'](_0x3ae604['query'][_0x1a31('0x22')]);}_0x53589d[_0x1a31('0x96')]=qs[_0x1a31('0x4c')](_0x3ae604[_0x1a31('0x44')][_0x1a31('0x4c')]);_0x53589d[_0x1a31('0x4d')]=qs['filters'](_[_0x1a31('0x4e')](_0x3ae604['query'],_0x582f8c[_0x1a31('0x45')]));_0x53589d[_0x1a31('0x4d')][_0x1a31('0xb6')]=_0x12717b['id'];if(_0x3ae604[_0x1a31('0x44')][_0x1a31('0x89')]){_0x53589d[_0x1a31('0x4d')]=_[_0x1a31('0xa1')](_0x53589d['where'],{'$or':_[_0x1a31('0x3e')](_0x53589d[_0x1a31('0x48')],function(_0x9fdd47){var _0x27c19b={};_0x27c19b[_0x9fdd47]={'$like':'%'+_0x3ae604[_0x1a31('0x44')][_0x1a31('0x89')]+'%'};return _0x27c19b;})});}if(_0x3ae604['query']['$gte']){var _0x6f9336=_0x3ae604[_0x1a31('0x44')][_0x1a31('0x81')][_0x1a31('0x32')](',');var _0x15543c={};_0x15543c[_0x6f9336[0x0]]={'$gte':moment(_0x6f9336[0x1])[_0x1a31('0xc3')](_0x1a31('0xc4'))};_0x53589d[_0x1a31('0x4d')]=_[_0x1a31('0xa1')](_0x53589d[_0x1a31('0x4d')],_0x15543c);}_0x53589d=_[_0x1a31('0xa1')]({},_0x53589d,_0x3ae604[_0x1a31('0xbb')]);return db[_0x1a31('0xc5')]['count']({'where':_0x53589d[_0x1a31('0x4d')]})[_0x1a31('0x29')](function(_0x20240b){_0x117672[_0x1a31('0x23')]=_0x20240b;if(_0x3ae604[_0x1a31('0x44')][_0x1a31('0xc6')]){_0x53589d[_0x1a31('0xba')]=[{'all':!![]}];}return db[_0x1a31('0xc5')][_0x1a31('0xc7')](_0x53589d);})[_0x1a31('0x29')](function(_0x3c716b){_0x117672[_0x1a31('0xb7')]=_0x3c716b;return _0x117672;});}})['then'](respondWithFilteredResult(_0x1e6136,_0x53589d))[_0x1a31('0x35')](handleError(_0x1e6136,null));};exports[_0x1a31('0xc8')]=function(_0x57cb31,_0x13fd60,_0x18a048){return db['SmsInteraction'][_0x1a31('0x66')]({'where':{'id':_0x57cb31[_0x1a31('0xb9')]['id']}})['then'](handleEntityNotFound(_0x13fd60,null))['then'](function(_0x69ff1d){if(_0x69ff1d){return _0x69ff1d['setTags'](_0x57cb31[_0x1a31('0x78')]['ids'],_[_0x1a31('0xc0')](_0x57cb31[_0x1a31('0x78')],[_0x1a31('0xbf'),'id'])||{})['spread'](function(){return db[_0x1a31('0xc9')]['findAll']({'attributes':['id',_0x1a31('0x2d'),'color'],'where':{'id':_0x57cb31[_0x1a31('0x78')]['ids']}});})[_0x1a31('0x29')](function(_0x541358){socket['emit']('smsInteractionTags:save',{'id':Number(_0x57cb31[_0x1a31('0xb9')]['id']),'tags':_0x541358||[]});return{'id':Number(_0x57cb31[_0x1a31('0xb9')]['id']),'tags':_0x541358||[]};});}})[_0x1a31('0x29')](respondWithResult(_0x13fd60,null))[_0x1a31('0x35')](handleError(_0x13fd60,null));};exports['removeTags']=function(_0x257396,_0x3b2025,_0x44b2d5){return db[_0x1a31('0x3f')]['find']({'where':{'id':_0x257396[_0x1a31('0xb9')]['id']}})['then'](handleEntityNotFound(_0x3b2025,null))[_0x1a31('0x29')](function(_0x878c12){if(_0x878c12){return _0x878c12[_0x1a31('0xca')](_0x257396[_0x1a31('0x44')]['ids']);}})[_0x1a31('0x29')](respondWithStatusCode(_0x3b2025,null))['catch'](handleError(_0x3b2025,null));};exports['download']=function(_0x32fc2e,_0x3bf44c){var _0x4f423b=moment()[_0x1a31('0xcb')]()['toString']();var _0x562fa3=path['join'](config[_0x1a31('0xcc')],_0x1a31('0xcd'),_0x1a31('0xce'),_0x1a31('0xcf'));var _0x5aeb2a=path['join'](config['root'],'server',_0x1a31('0xce'),_0x1a31('0xd0'));var _0x257748=path[_0x1a31('0xd1')](_0x562fa3,_0x4f423b);var _0x2551a6=util[_0x1a31('0xc3')](_0x1a31('0xd2'),_0x32fc2e[_0x1a31('0xb9')]['id'],_0x4f423b);var _0xcdc6d4=path[_0x1a31('0xd1')](_0x562fa3,_0x2551a6);var _0x55490c=[];_0x55490c[_0x1a31('0x34')]({'model':db[_0x1a31('0x76')],'as':'User','attributes':['id',_0x1a31('0x2f')],'raw':!![]});_0x55490c[_0x1a31('0x34')]({'model':db[_0x1a31('0xd3')],'as':_0x1a31('0x6c'),'attributes':['id',_0x1a31('0xd4'),_0x1a31('0xd5')],'raw':!![]});var _0x23adbe=[{'model':db[_0x1a31('0xc5')],'as':_0x1a31('0xd6'),'attributes':['id',_0x1a31('0x78'),_0x1a31('0x80'),_0x1a31('0xd7'),_0x1a31('0xd8'),_0x1a31('0x85')],'include':_0x55490c}];_0x23adbe[_0x1a31('0x34')]({'model':db['SmsAccount'],'as':'Account','attributes':['id','name']});_0x23adbe[_0x1a31('0x34')]({'model':db[_0x1a31('0x76')],'as':_0x1a31('0xd9'),'attributes':['id',_0x1a31('0x2f')]});return db[_0x1a31('0x3f')][_0x1a31('0x66')]({'where':{'id':_0x32fc2e[_0x1a31('0xb9')]['id']},'include':_0x23adbe})[_0x1a31('0x29')](handleEntityNotFound(_0x3bf44c,null))[_0x1a31('0x29')](function(_0x3202df){if(_0x3202df){var _0xe0483a=_0x3202df[_0x1a31('0xda')]({'plain':!![]});fs['mkdirSync'](_0x257748);var _0x7468d1={'channel':'Sms','account':_0xe0483a[_0x1a31('0xdb')]['name'],'agent':_0xe0483a[_0x1a31('0xd9')]?_0xe0483a[_0x1a31('0xd9')][_0x1a31('0x2f')]:_0x1a31('0xdc'),'createdAt':moment(_0xe0483a['createdAt'])[_0x1a31('0xc3')](_0x1a31('0xc4'))[_0x1a31('0xa0')](),'closedAt':_0xe0483a['closed']?moment(_0xe0483a[_0x1a31('0xdd')])['format'](_0x1a31('0xc4'))[_0x1a31('0xa0')]():'','disposition':_0xe0483a[_0x1a31('0xde')],'messages':_(_0xe0483a[_0x1a31('0xd6')])['filter']({'secret':![]})[_0x1a31('0x3e')](function(_0x214ec7){return{'date':moment(_0x214ec7[_0x1a31('0x80')])[_0x1a31('0xc3')](_0x1a31('0xc4'))[_0x1a31('0xa0')](),'sender':_0x214ec7[_0x1a31('0xd7')]===_0x1a31('0xdf')?_0x214ec7['User']?_0x214ec7['User'][_0x1a31('0x2f')]:_0x1a31('0xe0'):_0x214ec7[_0x1a31('0x6c')][_0x1a31('0xd4')]+(_0x214ec7[_0x1a31('0x6c')]['lastName']?'\x20'+_0x214ec7[_0x1a31('0x6c')][_0x1a31('0xd5')]:''),'body':_0x214ec7[_0x1a31('0x78')],'direction':_0x214ec7['direction']===_0x1a31('0xdf')?'A':'C','secret':_0x214ec7[_0x1a31('0xd8')],'read':_0x214ec7[_0x1a31('0x85')]};})[_0x1a31('0x68')]()};return ejs[_0x1a31('0xe1')](path[_0x1a31('0xd1')](config[_0x1a31('0xcc')],_0x1a31('0xcd'),'views',_0x1a31('0xe2')),{'interaction':_0x7468d1})['then'](function(_0x35997e){var _0x16f937=path[_0x1a31('0xd1')](_0x257748,_0x1a31('0xe3')+_0xe0483a['id']+'-'+_0x4f423b+'.pdf');var _0xe6a1af={'path':_0x16f937,'channel':'Sms','interactionId':_0xe0483a['id']};return pdf['createPdfFromHTML'](_0x35997e,_0xe6a1af);})['then'](function(){return new BPromise(function(_0x3632b6,_0x2f34fa){zipdir(_0x257748,{'saveTo':_0xcdc6d4},function(_0x559331,_0x18abc){if(_0x559331)return _0x2f34fa(_0x559331);return _0x3632b6(_0x18abc);});})[_0x1a31('0x29')](function(){return new BPromise(function(_0x14dd6b,_0x406f62){rimraf(_0x257748,function(_0x4565a6){if(_0x4565a6)_0x406f62(_0x4565a6);return _0x14dd6b();});});})['then'](function(){return _0x3bf44c[_0x1a31('0xe4')](_0xcdc6d4,_0x2551a6,function(_0x50b65d){if(_0x50b65d){console[_0x1a31('0xe5')](_0x1a31('0xe6'),_0x50b65d);}else{fs[_0x1a31('0xe7')](_0xcdc6d4);}});});});}else{return _0x3bf44c[_0x1a31('0x1c')](0xc8);}})[_0x1a31('0x35')](handleError(_0x3bf44c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index e9e5a7b..c399045 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 _0xc2c7=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then'];(function(_0x3d9622,_0xb8191e){var _0x16923b=function(_0x519198){while(--_0x519198){_0x3d9622['push'](_0x3d9622['shift']());}};_0x16923b(++_0xb8191e);}(_0xc2c7,0x134));var _0x7c2c=function(_0x8b9aa0,_0x3ed4f4){_0x8b9aa0=_0x8b9aa0-0x0;var _0x4371c2=_0xc2c7[_0x8b9aa0];return _0x4371c2;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x1')];var SmsMessage=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7c2c('0x3')](0x0);var events={'afterCreate':_0x7c2c('0x4'),'afterUpdate':_0x7c2c('0x5'),'afterDestroy':_0x7c2c('0x6')};function emitEvent(_0x4bbc14){return function(_0x59f346,_0x31dc4e,_0x42ecc9){_0x59f346[_0x7c2c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4abe93){_0x59f346['setDataValue'](_0x7c2c('0x8'),_0x4abe93[_0x7c2c('0x9')](function(_0x3e668f){return{'id':_0x3e668f['id']};}));return SmsMessage[_0x7c2c('0xa')]({'where':{'SmsInteractionId':_0x59f346['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c2c('0xb')](function(_0x57b107){_0x59f346[_0x7c2c('0xc')](_0x7c2c('0xd'),_0x57b107[_0x7c2c('0xe')]);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14+':'+_0x59f346['id'],_0x59f346);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14,_0x59f346);_0x42ecc9(null);})[_0x7c2c('0x10')](_0x42ecc9(null));};}for(var e in events){if(events[_0x7c2c('0x11')](e)){var event=events[e];SmsInteraction[_0x7c2c('0x12')](e,emitEvent(event));}}module[_0x7c2c('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x4c64a7,_0x295330){var _0x354d71=function(_0x447ec8){while(--_0x447ec8){_0x4c64a7['push'](_0x4c64a7['shift']());}};_0x354d71(++_0x295330);}(_0x583c,0x12b));var _0xc583=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x583c[_0x4c6d6f];return _0x2d4478;};'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 diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b82776c..6383dbe 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 _0x88c5=['rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3e0912,_0x393b7a){var _0x37474c=function(_0x220ecf){while(--_0x220ecf){_0x3e0912['push'](_0x3e0912['shift']());}};_0x37474c(++_0x393b7a);}(_0x88c5,0x1ba));var _0x588c=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x88c5[_0x21353c];return _0xa99120;};'use strict';var _=require(_0x588c('0x0'));var util=require('util');var logger=require(_0x588c('0x1'))(_0x588c('0x2'));var moment=require('moment');var BPromise=require(_0x588c('0x3'));var rp=require(_0x588c('0x4'));var fs=require('fs');var path=require(_0x588c('0x5'));var rimraf=require(_0x588c('0x6'));var config=require('../../config/environment');var attributes=require(_0x588c('0x7'));module[_0x588c('0x8')]=function(_0x4d260a,_0x42a1a7){return _0x4d260a[_0x588c('0x9')](_0x588c('0xa'),attributes,{'tableName':_0x588c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x303898,_0x4fef39,_0x4adff8){if(_0x303898[_0x588c('0xc')]('closed')){_0x303898[_0x588c('0xd')]=moment()[_0x588c('0xe')](_0x588c('0xf'));}_0x4adff8(null,_0x303898);}}});}; \ No newline at end of file +var _0xa9e5=['bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x5eefe3,_0x86b991){var _0x57ad7d=function(_0x4adbaf){while(--_0x4adbaf){_0x5eefe3['push'](_0x5eefe3['shift']());}};_0x57ad7d(++_0x86b991);}(_0xa9e5,0x80));var _0x5a9e=function(_0x33ae87,_0x1389c2){_0x33ae87=_0x33ae87-0x0;var _0x408461=_0xa9e5[_0x33ae87];return _0x408461;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5a9e('0x2'));var rp=require(_0x5a9e('0x3'));var fs=require('fs');var path=require(_0x5a9e('0x4'));var rimraf=require(_0x5a9e('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a9e('0x6'));module[_0x5a9e('0x7')]=function(_0x5c4d5c,_0x1b755f){return _0x5c4d5c[_0x5a9e('0x8')](_0x5a9e('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42ef17,_0x4aa2d8,_0x1da9e5){if(_0x42ef17['changed'](_0x5a9e('0xa'))){_0x42ef17['closedAt']=moment()[_0x5a9e('0xb')](_0x5a9e('0xc'));}_0x1da9e5(null,_0x42ef17);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 5389a4c..3c8f2aa 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 _0xadf0=['rpc','jayson/promise','client','redis','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','find','addTags','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x548a75,_0x23d943){var _0x5dd44c=function(_0x4a650a){while(--_0x4a650a){_0x548a75['push'](_0x548a75['shift']());}};_0x5dd44c(++_0x23d943);}(_0xadf0,0x132));var _0x0adf=function(_0x14621c,_0x2c0942){_0x14621c=_0x14621c-0x0;var _0x42994=_0xadf0[_0x14621c];return _0x42994;};'use strict';var _=require('lodash');var util=require(_0x0adf('0x0'));var moment=require(_0x0adf('0x1'));var BPromise=require(_0x0adf('0x2'));var rs=require(_0x0adf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0adf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0adf('0x5'))(_0x0adf('0x6'));var config=require('../../config/environment');var jayson=require(_0x0adf('0x7'));var client=jayson[_0x0adf('0x8')]['http']({'port':0x232a});config[_0x0adf('0x9')]=_['defaults'](config[_0x0adf('0x9')],{'host':_0x0adf('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0adf('0xb'))[_0x0adf('0xc')](socket);function respondWithRpcPromise(_0x3f4f2a,_0x2391a5,_0x3c3f9c){return new BPromise(function(_0x139cb7,_0x49fecc){return client[_0x0adf('0xd')](_0x3f4f2a,_0x3c3f9c)[_0x0adf('0xe')](function(_0x57abd8){logger[_0x0adf('0xf')](_0x0adf('0x10'),_0x2391a5,_0x0adf('0x11'));logger[_0x0adf('0x12')](_0x0adf('0x13'),_0x2391a5,_0x0adf('0x11'),JSON[_0x0adf('0x14')](_0x57abd8));if(_0x57abd8['error']){if(_0x57abd8[_0x0adf('0x15')][_0x0adf('0x16')]===0x1f4){logger['error'](_0x0adf('0x10'),_0x2391a5,_0x57abd8['error'][_0x0adf('0x17')]);return _0x49fecc(_0x57abd8[_0x0adf('0x15')]['message']);}logger[_0x0adf('0x15')](_0x0adf('0x10'),_0x2391a5,_0x57abd8['error'][_0x0adf('0x17')]);return _0x139cb7(_0x57abd8[_0x0adf('0x15')][_0x0adf('0x17')]);}else{logger[_0x0adf('0xf')](_0x0adf('0x10'),_0x2391a5,_0x0adf('0x11'));_0x139cb7(_0x57abd8['result']['message']);}})[_0x0adf('0x18')](function(_0xdfc463){logger[_0x0adf('0x15')](_0x0adf('0x10'),_0x2391a5,_0xdfc463);_0x49fecc(_0xdfc463);});});}exports[_0x0adf('0x19')]=function(_0x376b62){var _0x5a7b1c=this;return new Promise(function(_0x469839,_0x13beac){return db['SmsInteraction'][_0x0adf('0x1a')](_0x376b62[_0x0adf('0x1b')],{'raw':_0x376b62[_0x0adf('0x1c')]?_0x376b62[_0x0adf('0x1c')][_0x0adf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x376b62[_0x0adf('0x1c')]?_0x376b62['options'][_0x0adf('0x1e')]||null:null,'attributes':_0x376b62[_0x0adf('0x1c')]?_0x376b62['options'][_0x0adf('0x1f')]||null:null,'limit':_0x376b62['options']?_0x376b62[_0x0adf('0x1c')][_0x0adf('0x20')]||null:null})[_0x0adf('0xe')](function(_0x5f38ab){logger[_0x0adf('0xf')](_0x0adf('0x19'),_0x376b62);logger[_0x0adf('0x12')]('UpdateSmsInteraction',_0x376b62,JSON[_0x0adf('0x14')](_0x5f38ab));_0x469839(_0x5f38ab);})[_0x0adf('0x18')](function(_0x18588f){logger[_0x0adf('0x15')](_0x0adf('0x19'),_0x18588f['message'],_0x376b62);_0x13beac(_0x5a7b1c[_0x0adf('0x15')](0x1f4,_0x18588f['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x525972){return new Promise(function(_0x3477eb,_0x4d06f2){return db['SmsInteraction'][_0x0adf('0x21')]({'where':_0x525972[_0x0adf('0x1c')]?_0x525972[_0x0adf('0x1c')][_0x0adf('0x1e')]||null:null})[_0x0adf('0xe')](function(_0x830bb2){if(_0x830bb2){return _0x830bb2[_0x0adf('0x22')](_0x525972[_0x0adf('0x1b')]['ids'],_[_0x0adf('0x23')](_0x525972[_0x0adf('0x1b')],[_0x0adf('0x24'),'id'])||{});}})[_0x0adf('0x25')](function(_0x70e704){logger[_0x0adf('0xf')](_0x0adf('0x26'),_0x525972);logger[_0x0adf('0x12')](_0x0adf('0x26'),_0x525972,JSON[_0x0adf('0x14')](_0x70e704));_0x3477eb(_0x70e704);})[_0x0adf('0x18')](function(_0x4c0227){logger[_0x0adf('0x15')](_0x0adf('0x26'),_0x4c0227[_0x0adf('0x17')],_0x525972);_0x4d06f2(_this[_0x0adf('0x15')](0x1f4,_0x4c0227[_0x0adf('0x17')]));});});}; \ No newline at end of file +var _0x7dff=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','body','AddTags','lodash','util'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0x7dff,0x116));var _0xf7df=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x7dff[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xf7df('0x0'));var util=require(_0xf7df('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7df('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf7df('0x3'));var logger=require(_0xf7df('0x4'))(_0xf7df('0x5'));var config=require(_0xf7df('0x6'));var jayson=require(_0xf7df('0x7'));var client=jayson[_0xf7df('0x8')][_0xf7df('0x9')]({'port':0x232a});config['redis']=_[_0xf7df('0xa')](config[_0xf7df('0xb')],{'host':_0xf7df('0xc'),'port':0x18eb});var socket=require(_0xf7df('0xd'))(new Redis(config['redis']));require(_0xf7df('0xe'))[_0xf7df('0xf')](socket);function respondWithRpcPromise(_0x928871,_0xbf1de8,_0x346c40){return new BPromise(function(_0x114b12,_0x4d336b){return client['request'](_0x928871,_0x346c40)[_0xf7df('0x10')](function(_0x11e2e0){logger[_0xf7df('0x11')](_0xf7df('0x12'),_0xbf1de8,_0xf7df('0x13'));logger[_0xf7df('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xbf1de8,_0xf7df('0x13'),JSON[_0xf7df('0x15')](_0x11e2e0));if(_0x11e2e0['error']){if(_0x11e2e0[_0xf7df('0x16')][_0xf7df('0x17')]===0x1f4){logger[_0xf7df('0x16')](_0xf7df('0x12'),_0xbf1de8,_0x11e2e0['error'][_0xf7df('0x18')]);return _0x4d336b(_0x11e2e0[_0xf7df('0x16')]['message']);}logger[_0xf7df('0x16')](_0xf7df('0x12'),_0xbf1de8,_0x11e2e0[_0xf7df('0x16')]['message']);return _0x114b12(_0x11e2e0['error'][_0xf7df('0x18')]);}else{logger[_0xf7df('0x11')](_0xf7df('0x12'),_0xbf1de8,'request\x20sent');_0x114b12(_0x11e2e0[_0xf7df('0x19')]['message']);}})[_0xf7df('0x1a')](function(_0x2ed4e2){logger[_0xf7df('0x16')](_0xf7df('0x12'),_0xbf1de8,_0x2ed4e2);_0x4d336b(_0x2ed4e2);});});}exports[_0xf7df('0x1b')]=function(_0x2fd232){var _0x22f13d=this;return new Promise(function(_0x58f258,_0x34d22c){return db[_0xf7df('0x1c')]['update'](_0x2fd232['body'],{'raw':_0x2fd232[_0xf7df('0x1d')]?_0x2fd232['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fd232['options']?_0x2fd232[_0xf7df('0x1d')][_0xf7df('0x1e')]||null:null,'attributes':_0x2fd232['options']?_0x2fd232['options'][_0xf7df('0x1f')]||null:null,'limit':_0x2fd232[_0xf7df('0x1d')]?_0x2fd232[_0xf7df('0x1d')][_0xf7df('0x20')]||null:null})[_0xf7df('0x10')](function(_0x5c9dd7){logger['info'](_0xf7df('0x1b'),_0x2fd232);logger[_0xf7df('0x14')](_0xf7df('0x1b'),_0x2fd232,JSON[_0xf7df('0x15')](_0x5c9dd7));_0x58f258(_0x5c9dd7);})['catch'](function(_0x15223f){logger['error'](_0xf7df('0x1b'),_0x15223f['message'],_0x2fd232);_0x34d22c(_0x22f13d[_0xf7df('0x16')](0x1f4,_0x15223f['message']));});});};exports[_0xf7df('0x21')]=function(_0x7644df){return new Promise(function(_0x465db6,_0x2c2543){return db['SmsInteraction'][_0xf7df('0x22')]({'where':_0x7644df[_0xf7df('0x1d')]?_0x7644df['options'][_0xf7df('0x1e')]||null:null})[_0xf7df('0x10')](function(_0x545691){if(_0x545691){return _0x545691[_0xf7df('0x23')](_0x7644df['body'][_0xf7df('0x24')],_[_0xf7df('0x25')](_0x7644df[_0xf7df('0x26')],[_0xf7df('0x24'),'id'])||{});}})['spread'](function(_0x2496d8){logger['info']('AddTags',_0x7644df);logger['debug']('AddTags',_0x7644df,JSON[_0xf7df('0x15')](_0x2496d8));_0x465db6(_0x2496d8);})[_0xf7df('0x1a')](function(_0x4dd5a2){logger[_0xf7df('0x16')](_0xf7df('0x27'),_0x4dd5a2[_0xf7df('0x18')],_0x7644df);_0x2c2543(_this[_0xf7df('0x16')](0x1f4,_0x4dd5a2[_0xf7df('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8e65d28..852b916 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 _0xf4b3=['./smsInteraction.events','remove','emit','removeListener','register','length'];(function(_0x25cb08,_0x265b42){var _0x4da0fd=function(_0x5bc2eb){while(--_0x5bc2eb){_0x25cb08['push'](_0x25cb08['shift']());}};_0x4da0fd(++_0x265b42);}(_0xf4b3,0xae));var _0x3f4b=function(_0x4f507b,_0x1a0e8a){_0x4f507b=_0x4f507b-0x0;var _0x50de21=_0xf4b3[_0x4f507b];return _0x50de21;};'use strict';var SmsInteractionEvents=require(_0x3f4b('0x0'));var events=['save',_0x3f4b('0x1'),'update'];function createListener(_0x3ca5ad,_0x3e0ca2){return function(_0x5c83bc){_0x3e0ca2[_0x3f4b('0x2')](_0x3ca5ad,_0x5c83bc);};}function removeListener(_0x414bf6,_0xe879a8){return function(){SmsInteractionEvents[_0x3f4b('0x3')](_0x414bf6,_0xe879a8);};}exports[_0x3f4b('0x4')]=function(_0x160bc1){for(var _0x3fa97f=0x0,_0x57c79a=events[_0x3f4b('0x5')];_0x3fa97f<_0x57c79a;_0x3fa97f++){var _0x591cd7=events[_0x3fa97f];var _0x3b9763=createListener('smsInteraction:'+_0x591cd7,_0x160bc1);SmsInteractionEvents['on'](_0x591cd7,_0x3b9763);}}; \ No newline at end of file +var _0x959c=['smsInteraction:','./smsInteraction.events','save','update','emit','removeListener','length'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x959c,0xb7));var _0xc959=function(_0x40a1dd,_0x4487ae){_0x40a1dd=_0x40a1dd-0x0;var _0x4808ae=_0x959c[_0x40a1dd];return _0x4808ae;};'use strict';var SmsInteractionEvents=require(_0xc959('0x0'));var events=[_0xc959('0x1'),'remove',_0xc959('0x2')];function createListener(_0x52b293,_0x2b32f0){return function(_0x1803c3){_0x2b32f0[_0xc959('0x3')](_0x52b293,_0x1803c3);};}function removeListener(_0x1e72e4,_0x4cab20){return function(){SmsInteractionEvents[_0xc959('0x4')](_0x1e72e4,_0x4cab20);};}exports['register']=function(_0x6ec8ac){for(var _0x2db196=0x0,_0x298bc6=events[_0xc959('0x5')];_0x2db196<_0x298bc6;_0x2db196++){var _0x1ceb8d=events[_0x2db196];var _0x3d445a=createListener(_0xc959('0x6')+_0x1ceb8d,_0x6ec8ac);SmsInteractionEvents['on'](_0x1ceb8d,_0x3d445a);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 96cb8b7..e1b141f 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 _0x70a8=['../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','sms','smsmessage:create','post','update','put','accept','/:id/reject','reject','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2b0024,_0xfa0edf){var _0x54d67c=function(_0x44b5c8){while(--_0x44b5c8){_0x2b0024['push'](_0x2b0024['shift']());}};_0x54d67c(++_0xfa0edf);}(_0x70a8,0x1f4));var _0x870a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x70a8[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x870a('0x0'));var timeout=require(_0x870a('0x1'));var express=require('express');var router=express[_0x870a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x870a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x870a('0x4'));var controller=require(_0x870a('0x5'));router[_0x870a('0x6')]('/',auth[_0x870a('0x7')](),controller[_0x870a('0x8')]);router[_0x870a('0x6')]('/describe',auth[_0x870a('0x7')](),controller[_0x870a('0x9')]);router['get'](_0x870a('0xa'),auth['isAuthenticated'](),controller[_0x870a('0xb')]);router['post']('/',auth[_0x870a('0x7')](),interaction[_0x870a('0xc')](_0x870a('0xd'),_0x870a('0xe')),controller['create']);router[_0x870a('0xf')]('/:id/status',controller['status']);router['put'](_0x870a('0xa'),auth[_0x870a('0x7')](),controller[_0x870a('0x10')]);router[_0x870a('0x11')]('/:id/accept',auth[_0x870a('0x7')](),controller[_0x870a('0x12')]);router[_0x870a('0x11')](_0x870a('0x13'),auth[_0x870a('0x7')](),controller[_0x870a('0x14')]);router['delete'](_0x870a('0xa'),auth[_0x870a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3cdb=['smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0x3cdb,0xa6));var _0xb3cd=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x3cdb[_0x1d30a3];return _0x32bba1;};'use strict';var multer=require(_0xb3cd('0x0'));var util=require(_0xb3cd('0x1'));var path=require(_0xb3cd('0x2'));var timeout=require(_0xb3cd('0x3'));var express=require(_0xb3cd('0x4'));var router=express[_0xb3cd('0x5')]();var fs_extra=require(_0xb3cd('0x6'));var auth=require(_0xb3cd('0x7'));var interaction=require(_0xb3cd('0x8'));var config=require('../../config/environment');var controller=require(_0xb3cd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb3cd('0xa')]);router[_0xb3cd('0xb')](_0xb3cd('0xc'),auth[_0xb3cd('0xd')](),controller[_0xb3cd('0xe')]);router['get'](_0xb3cd('0xf'),auth['isAuthenticated'](),controller[_0xb3cd('0x10')]);router[_0xb3cd('0x11')]('/',auth[_0xb3cd('0xd')](),interaction[_0xb3cd('0x12')](_0xb3cd('0x13'),_0xb3cd('0x14')),controller[_0xb3cd('0x15')]);router[_0xb3cd('0x11')](_0xb3cd('0x16'),controller[_0xb3cd('0x17')]);router[_0xb3cd('0x18')](_0xb3cd('0xf'),auth[_0xb3cd('0xd')](),controller[_0xb3cd('0x19')]);router['put'](_0xb3cd('0x1a'),auth[_0xb3cd('0xd')](),controller[_0xb3cd('0x1b')]);router[_0xb3cd('0x18')](_0xb3cd('0x1c'),auth['isAuthenticated'](),controller['reject']);router[_0xb3cd('0x1d')](_0xb3cd('0xf'),auth[_0xb3cd('0xd')](),controller[_0xb3cd('0x1e')]);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 5548202..60a7c6c 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 _0x57b3=['BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT','medium'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x57b3,0x1ad));var _0x357b=function(_0x4cddca,_0x4e3979){_0x4cddca=_0x4cddca-0x0;var _0x4b7593=_0x57b3[_0x4cddca];return _0x4b7593;};'use strict';var Sequelize=require('sequelize');module[_0x357b('0x0')]={'body':{'type':Sequelize[_0x357b('0x1')](_0x357b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x357b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x357b('0x4')]('in','out'),'defaultValue':_0x357b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x357b('0x6')](0xbe)},'phone':{'type':Sequelize[_0x357b('0x6')]},'readAt':{'type':Sequelize[_0x357b('0x7')]},'secret':{'type':Sequelize[_0x357b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x357b('0x1')]}}; \ No newline at end of file +var _0x5d08=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x1799aa,_0x431883){var _0xa57b66=function(_0x43e344){while(--_0x43e344){_0x1799aa['push'](_0x1799aa['shift']());}};_0xa57b66(++_0x431883);}(_0x5d08,0x1e0));var _0x85d0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5d08[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x85d0('0x0'));module[_0x85d0('0x1')]={'body':{'type':Sequelize[_0x85d0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x85d0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x85d0('0x4')]('in',_0x85d0('0x5')),'defaultValue':_0x85d0('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x85d0('0x6')](0xbe)},'phone':{'type':Sequelize[_0x85d0('0x6')]},'readAt':{'type':Sequelize[_0x85d0('0x7')]},'secret':{'type':Sequelize[_0x85d0('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x85d0('0x6')]},'providerResponse':{'type':Sequelize[_0x85d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 7fc9dd1..e8b0976 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 _0xed1c=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','params','keys','find','create','body','destroy','describe','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','email','internal','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model'];(function(_0x845f9e,_0x2c11a9){var _0x456292=function(_0x476fa8){while(--_0x476fa8){_0x845f9e['push'](_0x845f9e['shift']());}};_0x456292(++_0x2c11a9);}(_0xed1c,0xe4));var _0xced1=function(_0x3168f1,_0x412e04){_0x3168f1=_0x3168f1-0x0;var _0x50aa16=_0xed1c[_0x3168f1];return _0x50aa16;};'use strict';var emlformat=require(_0xced1('0x0'));var rimraf=require(_0xced1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xced1('0x2'));var Mustache=require(_0xced1('0x3'));var util=require(_0xced1('0x4'));var path=require('path');var sox=require(_0xced1('0x5'));var csv=require(_0xced1('0x6'));var ejs=require(_0xced1('0x7'));var fs=require('fs');var fs_extra=require(_0xced1('0x8'));var _=require('lodash');var squel=require(_0xced1('0x9'));var crypto=require(_0xced1('0xa'));var jsforce=require(_0xced1('0xb'));var deskjs=require(_0xced1('0xc'));var toCsv=require(_0xced1('0x6'));var querystring=require(_0xced1('0xd'));var Papa=require(_0xced1('0xe'));var Redis=require(_0xced1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xced1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xced1('0x11'));var logger=require(_0xced1('0x12'))(_0xced1('0x13'));var utils=require(_0xced1('0x14'));var config=require(_0xced1('0x15'));var licenseUtil=require(_0xced1('0x16'));var db=require(_0xced1('0x17'))['db'];config['redis']=_[_0xced1('0x18')](config[_0xced1('0x19')],{'host':_0xced1('0x1a'),'port':0x18eb});var socket=require(_0xced1('0x1b'))(new Redis(config['redis']));require(_0xced1('0x1c'))[_0xced1('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xced1('0x1e')][_0xced1('0x1f')]({'port':0x232c});var client9002=jayson[_0xced1('0x1e')][_0xced1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x47baec,_0x5560af,_0x3eb3ac,_0x4178d8){return new BPromise(function(_0x236473,_0x17e8ab){var _0x3e53bd=_0x4178d8||client;return _0x3e53bd[_0xced1('0x20')](_0x47baec,_0x3eb3ac)['then'](function(_0x56fc50){logger[_0xced1('0x21')](_0xced1('0x22'),_0x5560af,_0xced1('0x23'));logger['debug'](_0xced1('0x24'),_0x5560af,_0xced1('0x23'),JSON[_0xced1('0x25')](_0x56fc50));if(_0x56fc50['error']){if(_0x56fc50[_0xced1('0x26')][_0xced1('0x27')]===0x1f4){logger[_0xced1('0x26')]('SmsMessage,\x20%s,\x20%s',_0x5560af,_0x56fc50[_0xced1('0x26')][_0xced1('0x28')]);return _0x17e8ab(_0x56fc50[_0xced1('0x26')]['message']);}logger['error'](_0xced1('0x22'),_0x5560af,_0x56fc50[_0xced1('0x26')][_0xced1('0x28')]);return _0x236473(_0x56fc50[_0xced1('0x26')][_0xced1('0x28')]);}else{logger['info'](_0xced1('0x22'),_0x5560af,_0xced1('0x23'));_0x236473(_0x56fc50['result']['message']);}})[_0xced1('0x29')](function(_0x258c9a){logger[_0xced1('0x26')](_0xced1('0x22'),_0x5560af,_0x258c9a);_0x17e8ab(_0x258c9a);});});}function respondWithStatusCode(_0x1c2ba7,_0x25b6e7){_0x25b6e7=_0x25b6e7||0xcc;return function(_0x50c543){if(_0x50c543){return _0x1c2ba7[_0xced1('0x2a')](_0x25b6e7);}return _0x1c2ba7[_0xced1('0x2b')](_0x25b6e7)[_0xced1('0x2c')]();};}function respondWithResult(_0x351afc,_0x34dd2e){_0x34dd2e=_0x34dd2e||0xc8;return function(_0x8b3ffb){if(_0x8b3ffb){return _0x351afc[_0xced1('0x2b')](_0x34dd2e)['json'](_0x8b3ffb);}};}function respondWithFilteredResult(_0x15c4f4,_0x4ef64e){return function(_0x45cb03){if(_0x45cb03){var _0x2c2269=typeof _0x4ef64e[_0xced1('0x2d')]===_0xced1('0x2e')&&typeof _0x4ef64e['limit']==='undefined';var _0xec7760=_0x45cb03[_0xced1('0x2f')];var _0x2bc785=_0x2c2269?0x0:_0x4ef64e['offset'];var _0x573146=_0x2c2269?_0x45cb03['count']:_0x4ef64e[_0xced1('0x2d')]+_0x4ef64e[_0xced1('0x30')];var _0x2a6197;if(_0x573146>=_0xec7760){_0x573146=_0xec7760;_0x2a6197=0xc8;}else{_0x2a6197=0xce;}_0x15c4f4[_0xced1('0x2b')](_0x2a6197);return _0x15c4f4['set'](_0xced1('0x31'),_0x2bc785+'-'+_0x573146+'/'+_0xec7760)[_0xced1('0x32')](_0x45cb03);}return null;};}function patchUpdates(_0x46b672){return function(_0x2109c4){try{jsonpatch[_0xced1('0x33')](_0x2109c4,_0x46b672,!![]);}catch(_0x33ac43){return BPromise[_0xced1('0x34')](_0x33ac43);}return _0x2109c4['save']();};}function saveUpdates(_0x5453e6,_0x31f14e){return function(_0x2091f6){if(_0x2091f6){return _0x2091f6[_0xced1('0x35')](_0x5453e6)[_0xced1('0x36')](function(_0x63d21e){return _0x63d21e;});}return null;};}function removeEntity(_0x3eb109,_0x512c76){return function(_0x486562){if(_0x486562){return _0x486562['destroy']()['then'](function(){_0x3eb109[_0xced1('0x2b')](0xcc)[_0xced1('0x2c')]();});}};}function handleEntityNotFound(_0x1b68a8,_0x12da46){return function(_0x5c76bb){if(!_0x5c76bb){_0x1b68a8[_0xced1('0x2a')](0x194);}return _0x5c76bb;};}function handleError(_0x3c32c5,_0x11205e){_0x11205e=_0x11205e||0x1f4;return function(_0x4021de){logger[_0xced1('0x26')](_0x4021de[_0xced1('0x37')]);if(_0x4021de[_0xced1('0x38')]){delete _0x4021de[_0xced1('0x38')];}_0x3c32c5['status'](_0x11205e)[_0xced1('0x39')](_0x4021de);};}exports[_0xced1('0x3a')]=function(_0x1116de,_0x376927){var _0x3bdc6f={},_0x1bfd61={},_0x4b8187={'count':0x0,'rows':[]};var _0xc7afa1=_[_0xced1('0x3b')](db[_0xced1('0x3c')][_0xced1('0x3d')],function(_0x282361){return{'name':_0x282361[_0xced1('0x3e')],'type':_0x282361[_0xced1('0x3f')][_0xced1('0x40')]};});_0x1bfd61[_0xced1('0x41')]=_[_0xced1('0x3b')](_0xc7afa1,_0xced1('0x38'));_0x1bfd61['query']=_['keys'](_0x1116de[_0xced1('0x42')]);_0x1bfd61[_0xced1('0x43')]=_[_0xced1('0x44')](_0x1bfd61['model'],_0x1bfd61[_0xced1('0x42')]);_0x3bdc6f[_0xced1('0x45')]=_[_0xced1('0x44')](_0x1bfd61['model'],qs[_0xced1('0x46')](_0x1116de[_0xced1('0x42')]['fields']));_0x3bdc6f[_0xced1('0x45')]=_0x3bdc6f['attributes'][_0xced1('0x47')]?_0x3bdc6f[_0xced1('0x45')]:_0x1bfd61['model'];if(!_0x1116de[_0xced1('0x42')][_0xced1('0x48')](_0xced1('0x49'))){_0x3bdc6f['limit']=qs[_0xced1('0x30')](_0x1116de[_0xced1('0x42')]['limit']);_0x3bdc6f[_0xced1('0x2d')]=qs['offset'](_0x1116de['query'][_0xced1('0x2d')]);}_0x3bdc6f['order']=qs[_0xced1('0x4a')](_0x1116de[_0xced1('0x42')][_0xced1('0x4a')]);_0x3bdc6f['where']=qs[_0xced1('0x43')](_['pick'](_0x1116de[_0xced1('0x42')],_0x1bfd61[_0xced1('0x43')]),_0xc7afa1);if(_0x1116de[_0xced1('0x42')][_0xced1('0x4b')]){_0x3bdc6f['where']=_[_0xced1('0x4c')](_0x3bdc6f[_0xced1('0x4d')],{'$or':_['map'](_0xc7afa1,function(_0x4733f0){if(_0x4733f0[_0xced1('0x3f')]!=='VIRTUAL'){var _0x1800c8={};_0x1800c8[_0x4733f0[_0xced1('0x38')]]={'$like':'%'+_0x1116de[_0xced1('0x42')]['filter']+'%'};return _0x1800c8;}})});}_0x3bdc6f=_[_0xced1('0x4c')]({},_0x3bdc6f,_0x1116de[_0xced1('0x4e')]);var _0x39fc4a={'where':_0x3bdc6f[_0xced1('0x4d')]};return db[_0xced1('0x3c')]['count'](_0x39fc4a)[_0xced1('0x36')](function(_0x5e6669){_0x4b8187[_0xced1('0x2f')]=_0x5e6669;if(_0x1116de[_0xced1('0x42')][_0xced1('0x4f')]){_0x3bdc6f[_0xced1('0x50')]=[{'all':!![]}];}return db[_0xced1('0x3c')][_0xced1('0x51')](_0x3bdc6f);})['then'](function(_0x3570ff){_0x4b8187[_0xced1('0x52')]=_0x3570ff;return _0x4b8187;})['then'](respondWithFilteredResult(_0x376927,_0x3bdc6f))[_0xced1('0x29')](handleError(_0x376927,null));};exports['show']=function(_0x5153a6,_0x296d62){var _0x43d982={'raw':!![],'where':{'id':_0x5153a6[_0xced1('0x53')]['id']}},_0x1b3a1c={};_0x1b3a1c['model']=_[_0xced1('0x54')](db[_0xced1('0x3c')][_0xced1('0x3d')]);_0x1b3a1c['query']=_['keys'](_0x5153a6[_0xced1('0x42')]);_0x1b3a1c[_0xced1('0x43')]=_[_0xced1('0x44')](_0x1b3a1c[_0xced1('0x41')],_0x1b3a1c['query']);_0x43d982['attributes']=_['intersection'](_0x1b3a1c[_0xced1('0x41')],qs[_0xced1('0x46')](_0x5153a6[_0xced1('0x42')][_0xced1('0x46')]));_0x43d982[_0xced1('0x45')]=_0x43d982[_0xced1('0x45')][_0xced1('0x47')]?_0x43d982[_0xced1('0x45')]:_0x1b3a1c[_0xced1('0x41')];if(_0x5153a6['query'][_0xced1('0x4f')]){_0x43d982[_0xced1('0x50')]=[{'all':!![]}];}_0x43d982=_[_0xced1('0x4c')]({},_0x43d982,_0x5153a6['options']);return db[_0xced1('0x3c')][_0xced1('0x55')](_0x43d982)[_0xced1('0x36')](handleEntityNotFound(_0x296d62,null))[_0xced1('0x36')](respondWithResult(_0x296d62,null))['catch'](handleError(_0x296d62,null));};exports[_0xced1('0x56')]=function(_0x4e96eb,_0x539ee2){return db[_0xced1('0x3c')][_0xced1('0x56')](_0x4e96eb['body'],{})['then'](respondWithResult(_0x539ee2,0xc9))['catch'](handleError(_0x539ee2,null));};exports[_0xced1('0x35')]=function(_0x5dfcf4,_0x1af125){if(_0x5dfcf4[_0xced1('0x57')]['id']){delete _0x5dfcf4[_0xced1('0x57')]['id'];}return db[_0xced1('0x3c')][_0xced1('0x55')]({'where':{'id':_0x5dfcf4[_0xced1('0x53')]['id']}})[_0xced1('0x36')](handleEntityNotFound(_0x1af125,null))[_0xced1('0x36')](saveUpdates(_0x5dfcf4['body'],null))['then'](respondWithResult(_0x1af125,null))[_0xced1('0x29')](handleError(_0x1af125,null));};exports[_0xced1('0x58')]=function(_0x235651,_0x34262e){return db['SmsMessage'][_0xced1('0x55')]({'where':{'id':_0x235651[_0xced1('0x53')]['id']}})[_0xced1('0x36')](handleEntityNotFound(_0x34262e,null))[_0xced1('0x36')](removeEntity(_0x34262e,null))['catch'](handleError(_0x34262e,null));};exports[_0xced1('0x59')]=function(_0x2abd02,_0xf0d72a){return db[_0xced1('0x3c')][_0xced1('0x59')]()[_0xced1('0x36')](respondWithResult(_0xf0d72a,null))[_0xced1('0x29')](handleError(_0xf0d72a,null));};var interaction_log=require(_0xced1('0x12'))('sms-interactions');exports['accept']=function(_0x4cc559,_0x440b22,_0x52e873){var _0x398264={'agent':{},'channel':'sms'};if(_0x4cc559['body']['id']){delete _0x4cc559[_0xced1('0x57')]['id'];}_0x4cc559[_0xced1('0x57')][_0xced1('0x5a')]=!![];_0x4cc559[_0xced1('0x57')][_0xced1('0x5b')]=moment()[_0xced1('0x5c')](_0xced1('0x5d'));_0x4cc559[_0xced1('0x57')][_0xced1('0x5e')]=_0x4cc559[_0xced1('0x57')][_0xced1('0x5e')]||_0x4cc559['user']['id'];_0x398264[_0xced1('0x5f')]['id']=_0x4cc559[_0xced1('0x57')]['UserId'];return db[_0xced1('0x3c')][_0xced1('0x55')]({'where':{'id':_0x4cc559['params']['id'],'UserId':null}})[_0xced1('0x36')](handleEntityNotFound(_0x440b22,null))[_0xced1('0x36')](saveUpdates(_0x4cc559[_0xced1('0x57')],null))[_0xced1('0x36')](function(_0x16a7ce){if(_0x16a7ce){_0x398264['message']=_0x16a7ce['get']({'plain':!![]});return db['SmsInteraction'][_0xced1('0x55')]({'where':{'id':_0x16a7ce[_0xced1('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x440b22,null))[_0xced1('0x36')](function(_0x10447b){if(_0x10447b){return _0x10447b[_0xced1('0x35')]({'UserId':_0x4cc559['body'][_0xced1('0x5e')],'read1stAt':_[_0xced1('0x61')](_0x10447b['read1stAt'])?moment()[_0xced1('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xced1('0x36')](function(_0x355046){if(_0x355046){_0x398264[_0xced1('0x62')]=_0x355046[_0xced1('0x63')]({'plain':!![]});interaction_log[_0xced1('0x21')](_0xced1('0x64'),_0x4cc559[_0xced1('0x65')]['id'],_0x4cc559['user'][_0xced1('0x38')],_0x4cc559[_0xced1('0x65')][_0xced1('0x66')],_0x398264['interaction']['id'],_0x4cc559['body']?JSON[_0xced1('0x25')](_0x4cc559[_0xced1('0x57')]):'null');return respondWithRpcPromise(_0xced1('0x67'),_0xced1('0x68'),_0x398264);}return null;})[_0xced1('0x36')](function(_0x51c879){var _0x57107b=_0xced1('0x69')+_0x51c879[_0xced1('0x28')][_0xced1('0x6a')];return db[_0xced1('0x6b')][_0xced1('0x42')](_0x57107b,{'type':db[_0xced1('0x6c')]['QueryTypes'][_0xced1('0x6d')],'raw':!![]})['then'](function(_0x513315){return _0x513315;});})['then'](function(_0x4ae2af){if(_0x4ae2af){_0x398264[_0xced1('0x28')][_0xced1('0x6e')]=_0x4ae2af[0x0];if(!_0x4cc559['body']['UserId'])return;return db[_0xced1('0x6f')][_0xced1('0x55')]({'where':{'id':_0x4cc559['body']['UserId'],'role':_0xced1('0x5f')},'attributes':['id',_0xced1('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x45bc94){if(!_0x45bc94)return null;_0x398264[_0xced1('0x28')][_0xced1('0x5f')]=_0x45bc94;return _0x398264;})[_0xced1('0x36')](function(_0x3314e4){if(_0x3314e4){if(_0x4cc559[_0xced1('0x57')]['manual']){_0x398264[_0xced1('0x28')][_0xced1('0x70')]=util[_0xced1('0x5c')](_0xced1('0x71'),_0x4cc559[_0xced1('0x65')][_0xced1('0x38')]);_0x398264[_0xced1('0x28')][_0xced1('0x72')]=_0x398264[_0xced1('0x72')];_0x398264['message']['motionChannel']=_0x398264[_0xced1('0x72')];_0x398264['message'][_0xced1('0x73')]='accept';return respondWithRpcPromise(_0xced1('0x74'),_0xced1('0x74'),{'event':_0xced1('0x75'),'message':_0x398264[_0xced1('0x28')]},client9002)[_0xced1('0x36')](function(){return _0x398264;});}return _0x398264;}return null;})[_0xced1('0x36')](respondWithResult(_0x440b22,null))['catch'](handleError(_0x440b22,null));};var interaction_log=require(_0xced1('0x12'))(_0xced1('0x76'));exports[_0xced1('0x34')]=function(_0x3e7070,_0x137460,_0x2ec441){var _0x4fc259={'agent':{},'channel':'sms'};if(_0x3e7070[_0xced1('0x57')]['id']){delete _0x3e7070[_0xced1('0x57')]['id'];}_0x3e7070[_0xced1('0x57')][_0xced1('0x5e')]=_0x3e7070[_0xced1('0x57')]['UserId']||_0x3e7070[_0xced1('0x65')]['id'];_0x4fc259[_0xced1('0x5f')]['id']=_0x3e7070[_0xced1('0x57')][_0xced1('0x5e')];return db['SmsMessage'][_0xced1('0x55')]({'where':{'id':_0x3e7070[_0xced1('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x137460,null))[_0xced1('0x36')](function(_0x5854ee){if(_0x5854ee){_0x4fc259[_0xced1('0x28')]=_0x5854ee[_0xced1('0x63')]({'plain':!![]});return db[_0xced1('0x77')][_0xced1('0x55')]({'where':{'id':_0x5854ee[_0xced1('0x60')]}});}return null;})[_0xced1('0x36')](handleEntityNotFound(_0x137460,null))[_0xced1('0x36')](function(_0x17137e){if(_0x17137e){_0x4fc259[_0xced1('0x62')]=_0x17137e[_0xced1('0x63')]({'plain':!![]});interaction_log['info'](_0xced1('0x78'),_0x3e7070[_0xced1('0x65')]['id'],_0x3e7070[_0xced1('0x65')][_0xced1('0x38')],_0x3e7070['user'][_0xced1('0x66')],_0x4fc259[_0xced1('0x62')]['id'],_0x3e7070[_0xced1('0x57')]?JSON[_0xced1('0x25')](_0x3e7070['body']):_0xced1('0x79'));return respondWithRpcPromise(_0xced1('0x7a'),_0xced1('0x7b'),_0x4fc259);}return null;})[_0xced1('0x36')](function(_0x3beefd){var _0x4fa469=_0xced1('0x69')+_0x3beefd['message'][_0xced1('0x6a')];return db[_0xced1('0x6b')][_0xced1('0x42')](_0x4fa469,{'type':db['Sequelize'][_0xced1('0x7c')][_0xced1('0x6d')],'raw':!![]})['then'](function(_0x217afb){return _0x217afb;});})['then'](function(_0xc4a5c8){if(_0xc4a5c8){_0x4fc259[_0xced1('0x28')][_0xced1('0x6e')]=_0xc4a5c8[0x0];if(!_0x3e7070['body']['UserId'])return;return db[_0xced1('0x6f')][_0xced1('0x55')]({'where':{'id':_0x3e7070[_0xced1('0x57')][_0xced1('0x5e')],'role':_0xced1('0x5f')},'attributes':['id','name','fullname',_0xced1('0x7d'),_0xced1('0x7e')],'raw':!![]});}return null;})[_0xced1('0x36')](function(_0x4cf606){if(!_0x4cf606)return null;_0x4fc259[_0xced1('0x28')]['agent']=_0x4cf606;return _0x4fc259;})['then'](function(_0xd54ed3){if(_0xd54ed3){_0xd54ed3['message'][_0xced1('0x70')]=util['format'](_0xced1('0x71'),_0x3e7070[_0xced1('0x65')][_0xced1('0x38')]);_0xd54ed3[_0xced1('0x28')][_0xced1('0x72')]=_0x4fc259[_0xced1('0x72')];_0xd54ed3[_0xced1('0x28')]['motionChannel']=_0x4fc259['channel'];_0xd54ed3[_0xced1('0x28')][_0xced1('0x73')]=_0xced1('0x34');respondWithRpcPromise(_0xced1('0x74'),'EventManager',{'event':'rejectmessage','message':_0xd54ed3[_0xced1('0x28')]},client9002);return _0x4fc259;}return null;})['then'](respondWithResult(_0x137460,null))[_0xced1('0x29')](handleError(_0x137460,null));};exports[_0xced1('0x2b')]=function(_0x36184c,_0x4e13d1,_0x41f0a6){if(_0x36184c[_0xced1('0x57')]['id']){delete _0x36184c['body']['id'];}var _0x2e1c96;return db[_0xced1('0x3c')][_0xced1('0x55')]({'where':{'id':_0x36184c['params']['id']}})[_0xced1('0x36')](handleEntityNotFound(_0x4e13d1,null))[_0xced1('0x36')](function(_0x273987){if(_0x273987){_0x2e1c96=_0x273987;return db[_0xced1('0x7f')][_0xced1('0x55')]({'where':{'id':_0x273987[_0xced1('0x80')]}});}})['then'](handleEntityNotFound(_0x4e13d1,null))['then'](function(_0x35aefb){if(_0x35aefb){logger[_0xced1('0x81')](_0xced1('0x24'),_0xced1('0x2b'),_0xced1('0x82'),_0x35aefb[_0xced1('0x3f')],util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));switch(_0x35aefb[_0xced1('0x3f')]){case _0xced1('0x84'):if(_0x36184c[_0xced1('0x57')]['MessageSid']&&_0x36184c['body'][_0xced1('0x85')]===_0x2e1c96[_0xced1('0x86')]){return _0x2e1c96[_0xced1('0x35')]({'read':!![]});}else{logger[_0xced1('0x26')](_0xced1('0x87'),_0xced1('0x2b'),_0xced1('0x84'),util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));}break;case _0xced1('0x88'):if(_0x36184c[_0xced1('0x57')][_0xced1('0x89')]&&_0x36184c[_0xced1('0x57')][_0xced1('0x89')]===_0x2e1c96[_0xced1('0x86')]&&_[_0xced1('0x8a')]([_0xced1('0x8b'),_0xced1('0x8c')],_0x36184c['body'][_0xced1('0x8d')])>=0x0){return _0x2e1c96['update']({'read':!![]});}else{logger[_0xced1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xced1('0x2b'),_0xced1('0x8e'),util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));}break;case _0xced1('0x8f'):var _0x3a0f4b=_0x36184c[_0xced1('0x57')][_0xced1('0x90')][0x0];if(_0x3a0f4b[_0xced1('0x2b')][_0xced1('0x91')]===_0xced1('0x92')){return _0x2e1c96[_0xced1('0x35')]({'read':!![]});}else{logger[_0xced1('0x26')](_0xced1('0x87'),_0xced1('0x2b'),_0xced1('0x8f'),util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x2e1c96;}})[_0xced1('0x36')](respondWithResult(_0x4e13d1,null))[_0xced1('0x29')](handleError(_0x4e13d1,null));}; \ No newline at end of file +var _0x9931=['results','groupName','DELIVERED','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','map','SmsMessage','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','create','body','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','rejectmessage','params','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip'];(function(_0x523db8,_0x522f84){var _0x2f2cea=function(_0x4a42de){while(--_0x4a42de){_0x523db8['push'](_0x523db8['shift']());}};_0x2f2cea(++_0x522f84);}(_0x9931,0x1b6));var _0x1993=function(_0xea438a,_0x395b4c){_0xea438a=_0xea438a-0x0;var _0xb1bd2b=_0x9931[_0xea438a];return _0xb1bd2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1993('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1993('0x1'));var rp=require(_0x1993('0x2'));var moment=require(_0x1993('0x3'));var BPromise=require(_0x1993('0x4'));var Mustache=require(_0x1993('0x5'));var util=require(_0x1993('0x6'));var path=require(_0x1993('0x7'));var sox=require(_0x1993('0x8'));var csv=require(_0x1993('0x9'));var ejs=require(_0x1993('0xa'));var fs=require('fs');var fs_extra=require(_0x1993('0xb'));var _=require(_0x1993('0xc'));var squel=require(_0x1993('0xd'));var crypto=require(_0x1993('0xe'));var jsforce=require(_0x1993('0xf'));var deskjs=require(_0x1993('0x10'));var toCsv=require(_0x1993('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1993('0x11'));var authService=require(_0x1993('0x12'));var qs=require(_0x1993('0x13'));var as=require(_0x1993('0x14'));var hardwareService=require(_0x1993('0x15'));var logger=require(_0x1993('0x16'))(_0x1993('0x17'));var utils=require(_0x1993('0x18'));var config=require(_0x1993('0x19'));var licenseUtil=require(_0x1993('0x1a'));var db=require(_0x1993('0x1b'))['db'];config[_0x1993('0x1c')]=_['defaults'](config['redis'],{'host':_0x1993('0x1d'),'port':0x18eb});var socket=require(_0x1993('0x1e'))(new Redis(config[_0x1993('0x1c')]));require(_0x1993('0x1f'))['register'](socket);var jayson=require(_0x1993('0x20'));var client=jayson[_0x1993('0x21')][_0x1993('0x22')]({'port':0x232c});var client9002=jayson[_0x1993('0x21')][_0x1993('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x32b2cb,_0x9c0ac5,_0x48ddac,_0xadc21){return new BPromise(function(_0x58162c,_0x25e878){var _0x2b268f=_0xadc21||client;return _0x2b268f['request'](_0x32b2cb,_0x48ddac)[_0x1993('0x23')](function(_0x230f8a){logger[_0x1993('0x24')](_0x1993('0x25'),_0x9c0ac5,_0x1993('0x26'));logger[_0x1993('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c0ac5,_0x1993('0x26'),JSON[_0x1993('0x28')](_0x230f8a));if(_0x230f8a[_0x1993('0x29')]){if(_0x230f8a['error'][_0x1993('0x2a')]===0x1f4){logger[_0x1993('0x29')](_0x1993('0x25'),_0x9c0ac5,_0x230f8a[_0x1993('0x29')]['message']);return _0x25e878(_0x230f8a[_0x1993('0x29')][_0x1993('0x2b')]);}logger[_0x1993('0x29')](_0x1993('0x25'),_0x9c0ac5,_0x230f8a[_0x1993('0x29')][_0x1993('0x2b')]);return _0x58162c(_0x230f8a[_0x1993('0x29')][_0x1993('0x2b')]);}else{logger[_0x1993('0x24')](_0x1993('0x25'),_0x9c0ac5,_0x1993('0x26'));_0x58162c(_0x230f8a['result']['message']);}})[_0x1993('0x2c')](function(_0x2e046b){logger['error']('SmsMessage,\x20%s,\x20%s',_0x9c0ac5,_0x2e046b);_0x25e878(_0x2e046b);});});}function respondWithStatusCode(_0x317bbc,_0x3bd970){_0x3bd970=_0x3bd970||0xcc;return function(_0x31baaa){if(_0x31baaa){return _0x317bbc[_0x1993('0x2d')](_0x3bd970);}return _0x317bbc[_0x1993('0x2e')](_0x3bd970)[_0x1993('0x2f')]();};}function respondWithResult(_0x4a8b57,_0x569d68){_0x569d68=_0x569d68||0xc8;return function(_0x2588e2){if(_0x2588e2){return _0x4a8b57[_0x1993('0x2e')](_0x569d68)[_0x1993('0x30')](_0x2588e2);}};}function respondWithFilteredResult(_0x14537b,_0x998e7e){return function(_0x262958){if(_0x262958){var _0x3fb166=typeof _0x998e7e[_0x1993('0x31')]===_0x1993('0x32')&&typeof _0x998e7e[_0x1993('0x33')]==='undefined';var _0x226e29=_0x262958[_0x1993('0x34')];var _0x1b69e7=_0x3fb166?0x0:_0x998e7e[_0x1993('0x31')];var _0x593f83=_0x3fb166?_0x262958['count']:_0x998e7e[_0x1993('0x31')]+_0x998e7e[_0x1993('0x33')];var _0x3ceadb;if(_0x593f83>=_0x226e29){_0x593f83=_0x226e29;_0x3ceadb=0xc8;}else{_0x3ceadb=0xce;}_0x14537b[_0x1993('0x2e')](_0x3ceadb);return _0x14537b[_0x1993('0x35')]('Content-Range',_0x1b69e7+'-'+_0x593f83+'/'+_0x226e29)['json'](_0x262958);}return null;};}function patchUpdates(_0x52e44f){return function(_0x2a9c6a){try{jsonpatch[_0x1993('0x36')](_0x2a9c6a,_0x52e44f,!![]);}catch(_0x5913c9){return BPromise[_0x1993('0x37')](_0x5913c9);}return _0x2a9c6a['save']();};}function saveUpdates(_0x523ec7,_0x588c18){return function(_0x4f95e1){if(_0x4f95e1){return _0x4f95e1[_0x1993('0x38')](_0x523ec7)[_0x1993('0x23')](function(_0x23fdfa){return _0x23fdfa;});}return null;};}function removeEntity(_0x3878b2,_0x573c40){return function(_0x66fb8a){if(_0x66fb8a){return _0x66fb8a[_0x1993('0x39')]()[_0x1993('0x23')](function(){_0x3878b2[_0x1993('0x2e')](0xcc)[_0x1993('0x2f')]();});}};}function handleEntityNotFound(_0x46a98e,_0x37ad72){return function(_0x186b14){if(!_0x186b14){_0x46a98e[_0x1993('0x2d')](0x194);}return _0x186b14;};}function handleError(_0x2c7e53,_0x1c9b00){_0x1c9b00=_0x1c9b00||0x1f4;return function(_0xf33241){logger[_0x1993('0x29')](_0xf33241[_0x1993('0x3a')]);if(_0xf33241[_0x1993('0x3b')]){delete _0xf33241[_0x1993('0x3b')];}_0x2c7e53[_0x1993('0x2e')](_0x1c9b00)['send'](_0xf33241);};}exports['index']=function(_0x51cdba,_0x4aa8e1){var _0xcd427e={},_0x52e010={},_0x2395b8={'count':0x0,'rows':[]};var _0x5ac00c=_[_0x1993('0x3c')](db[_0x1993('0x3d')][_0x1993('0x3e')],function(_0x407efd){return{'name':_0x407efd['fieldName'],'type':_0x407efd[_0x1993('0x3f')]['key']};});_0x52e010[_0x1993('0x40')]=_[_0x1993('0x3c')](_0x5ac00c,_0x1993('0x3b'));_0x52e010[_0x1993('0x41')]=_['keys'](_0x51cdba[_0x1993('0x41')]);_0x52e010[_0x1993('0x42')]=_[_0x1993('0x43')](_0x52e010[_0x1993('0x40')],_0x52e010[_0x1993('0x41')]);_0xcd427e[_0x1993('0x44')]=_['intersection'](_0x52e010[_0x1993('0x40')],qs[_0x1993('0x45')](_0x51cdba[_0x1993('0x41')]['fields']));_0xcd427e[_0x1993('0x44')]=_0xcd427e[_0x1993('0x44')]['length']?_0xcd427e[_0x1993('0x44')]:_0x52e010[_0x1993('0x40')];if(!_0x51cdba[_0x1993('0x41')][_0x1993('0x46')](_0x1993('0x47'))){_0xcd427e[_0x1993('0x33')]=qs[_0x1993('0x33')](_0x51cdba[_0x1993('0x41')][_0x1993('0x33')]);_0xcd427e[_0x1993('0x31')]=qs[_0x1993('0x31')](_0x51cdba[_0x1993('0x41')][_0x1993('0x31')]);}_0xcd427e[_0x1993('0x48')]=qs[_0x1993('0x49')](_0x51cdba[_0x1993('0x41')][_0x1993('0x49')]);_0xcd427e[_0x1993('0x4a')]=qs[_0x1993('0x42')](_['pick'](_0x51cdba[_0x1993('0x41')],_0x52e010[_0x1993('0x42')]),_0x5ac00c);if(_0x51cdba[_0x1993('0x41')]['filter']){_0xcd427e[_0x1993('0x4a')]=_[_0x1993('0x4b')](_0xcd427e['where'],{'$or':_[_0x1993('0x3c')](_0x5ac00c,function(_0x1200e){if(_0x1200e[_0x1993('0x3f')]!==_0x1993('0x4c')){var _0x958fbc={};_0x958fbc[_0x1200e[_0x1993('0x3b')]]={'$like':'%'+_0x51cdba[_0x1993('0x41')]['filter']+'%'};return _0x958fbc;}})});}_0xcd427e=_[_0x1993('0x4b')]({},_0xcd427e,_0x51cdba[_0x1993('0x4d')]);var _0x5c9274={'where':_0xcd427e['where']};return db[_0x1993('0x3d')][_0x1993('0x34')](_0x5c9274)[_0x1993('0x23')](function(_0x4d907a){_0x2395b8[_0x1993('0x34')]=_0x4d907a;if(_0x51cdba['query']['includeAll']){_0xcd427e[_0x1993('0x4e')]=[{'all':!![]}];}return db[_0x1993('0x3d')][_0x1993('0x4f')](_0xcd427e);})[_0x1993('0x23')](function(_0x17a51b){_0x2395b8[_0x1993('0x50')]=_0x17a51b;return _0x2395b8;})[_0x1993('0x23')](respondWithFilteredResult(_0x4aa8e1,_0xcd427e))[_0x1993('0x2c')](handleError(_0x4aa8e1,null));};exports[_0x1993('0x51')]=function(_0x2ee059,_0x1d961d){var _0x45c56a={'raw':!![],'where':{'id':_0x2ee059['params']['id']}},_0xfeeaf8={};_0xfeeaf8['model']=_[_0x1993('0x52')](db[_0x1993('0x3d')][_0x1993('0x3e')]);_0xfeeaf8['query']=_['keys'](_0x2ee059[_0x1993('0x41')]);_0xfeeaf8['filters']=_[_0x1993('0x43')](_0xfeeaf8['model'],_0xfeeaf8[_0x1993('0x41')]);_0x45c56a[_0x1993('0x44')]=_[_0x1993('0x43')](_0xfeeaf8[_0x1993('0x40')],qs[_0x1993('0x45')](_0x2ee059[_0x1993('0x41')][_0x1993('0x45')]));_0x45c56a[_0x1993('0x44')]=_0x45c56a[_0x1993('0x44')][_0x1993('0x53')]?_0x45c56a[_0x1993('0x44')]:_0xfeeaf8[_0x1993('0x40')];if(_0x2ee059[_0x1993('0x41')][_0x1993('0x54')]){_0x45c56a[_0x1993('0x4e')]=[{'all':!![]}];}_0x45c56a=_[_0x1993('0x4b')]({},_0x45c56a,_0x2ee059[_0x1993('0x4d')]);return db[_0x1993('0x3d')][_0x1993('0x55')](_0x45c56a)[_0x1993('0x23')](handleEntityNotFound(_0x1d961d,null))[_0x1993('0x23')](respondWithResult(_0x1d961d,null))[_0x1993('0x2c')](handleError(_0x1d961d,null));};exports[_0x1993('0x56')]=function(_0x35158c,_0x46859f){return db[_0x1993('0x3d')][_0x1993('0x56')](_0x35158c[_0x1993('0x57')],{})[_0x1993('0x23')](respondWithResult(_0x46859f,0xc9))[_0x1993('0x2c')](handleError(_0x46859f,null));};exports[_0x1993('0x38')]=function(_0x3c370f,_0x4c855f){if(_0x3c370f[_0x1993('0x57')]['id']){delete _0x3c370f[_0x1993('0x57')]['id'];}return db[_0x1993('0x3d')][_0x1993('0x55')]({'where':{'id':_0x3c370f['params']['id']}})[_0x1993('0x23')](handleEntityNotFound(_0x4c855f,null))[_0x1993('0x23')](saveUpdates(_0x3c370f[_0x1993('0x57')],null))['then'](respondWithResult(_0x4c855f,null))[_0x1993('0x2c')](handleError(_0x4c855f,null));};exports[_0x1993('0x39')]=function(_0x418bc6,_0x431681){return db[_0x1993('0x3d')]['find']({'where':{'id':_0x418bc6['params']['id']}})[_0x1993('0x23')](handleEntityNotFound(_0x431681,null))[_0x1993('0x23')](removeEntity(_0x431681,null))[_0x1993('0x2c')](handleError(_0x431681,null));};exports['describe']=function(_0x48123c,_0x119184){return db[_0x1993('0x3d')][_0x1993('0x58')]()['then'](respondWithResult(_0x119184,null))[_0x1993('0x2c')](handleError(_0x119184,null));};var interaction_log=require(_0x1993('0x16'))(_0x1993('0x59'));exports[_0x1993('0x5a')]=function(_0x2c9836,_0xee089e,_0x4009a0){var _0x1785a5={'agent':{},'channel':_0x1993('0x5b')};if(_0x2c9836[_0x1993('0x57')]['id']){delete _0x2c9836['body']['id'];}_0x2c9836['body'][_0x1993('0x5c')]=!![];_0x2c9836[_0x1993('0x57')]['readAt']=moment()['format'](_0x1993('0x5d'));_0x2c9836['body'][_0x1993('0x5e')]=_0x2c9836['body']['UserId']||_0x2c9836[_0x1993('0x5f')]['id'];_0x1785a5[_0x1993('0x60')]['id']=_0x2c9836[_0x1993('0x57')][_0x1993('0x5e')];return db[_0x1993('0x3d')]['find']({'where':{'id':_0x2c9836['params']['id'],'UserId':null}})[_0x1993('0x23')](handleEntityNotFound(_0xee089e,null))['then'](saveUpdates(_0x2c9836[_0x1993('0x57')],null))[_0x1993('0x23')](function(_0x3d46c7){if(_0x3d46c7){_0x1785a5[_0x1993('0x2b')]=_0x3d46c7[_0x1993('0x61')]({'plain':!![]});return db['SmsInteraction'][_0x1993('0x55')]({'where':{'id':_0x3d46c7['SmsInteractionId']}});}return null;})[_0x1993('0x23')](handleEntityNotFound(_0xee089e,null))[_0x1993('0x23')](function(_0x17876e){if(_0x17876e){return _0x17876e[_0x1993('0x38')]({'UserId':_0x2c9836['body'][_0x1993('0x5e')],'read1stAt':_[_0x1993('0x62')](_0x17876e[_0x1993('0x63')])?moment()[_0x1993('0x64')](_0x1993('0x5d')):undefined});}return null;})[_0x1993('0x23')](function(_0x2d039e){if(_0x2d039e){_0x1785a5[_0x1993('0x65')]=_0x2d039e[_0x1993('0x61')]({'plain':!![]});interaction_log[_0x1993('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c9836['user']['id'],_0x2c9836[_0x1993('0x5f')][_0x1993('0x3b')],_0x2c9836['user'][_0x1993('0x66')],_0x1785a5[_0x1993('0x65')]['id'],_0x2c9836[_0x1993('0x57')]?JSON[_0x1993('0x28')](_0x2c9836[_0x1993('0x57')]):_0x1993('0x67'));return respondWithRpcPromise(_0x1993('0x68'),_0x1993('0x69'),_0x1785a5);}return null;})[_0x1993('0x23')](function(_0x5cf790){var _0x56bde7=_0x1993('0x6a')+_0x5cf790['message'][_0x1993('0x6b')];return db[_0x1993('0x6c')][_0x1993('0x41')](_0x56bde7,{'type':db[_0x1993('0x6d')][_0x1993('0x6e')][_0x1993('0x6f')],'raw':!![]})['then'](function(_0x21fd6a){return _0x21fd6a;});})['then'](function(_0x6587d7){if(_0x6587d7){_0x1785a5[_0x1993('0x2b')][_0x1993('0x70')]=_0x6587d7[0x0];if(!_0x2c9836[_0x1993('0x57')][_0x1993('0x5e')])return;return db[_0x1993('0x71')][_0x1993('0x55')]({'where':{'id':_0x2c9836['body'][_0x1993('0x5e')],'role':'agent'},'attributes':['id',_0x1993('0x3b'),_0x1993('0x72'),'email','internal'],'raw':!![]});}return null;})[_0x1993('0x23')](function(_0x17441c){if(!_0x17441c)return null;_0x1785a5[_0x1993('0x2b')][_0x1993('0x60')]=_0x17441c;return _0x1785a5;})['then'](function(_0x5b155d){if(_0x5b155d){if(_0x2c9836[_0x1993('0x57')][_0x1993('0x73')]){_0x1785a5[_0x1993('0x2b')]['interface']=util['format'](_0x1993('0x74'),_0x2c9836[_0x1993('0x5f')]['name']);_0x1785a5[_0x1993('0x2b')]['channel']=_0x1785a5[_0x1993('0x75')];_0x1785a5[_0x1993('0x2b')]['motionChannel']=_0x1785a5[_0x1993('0x75')];_0x1785a5[_0x1993('0x2b')][_0x1993('0x76')]=_0x1993('0x5a');return respondWithRpcPromise(_0x1993('0x77'),'EventManager',{'event':_0x1993('0x78'),'message':_0x1785a5[_0x1993('0x2b')]},client9002)[_0x1993('0x23')](function(){return _0x1785a5;});}return _0x1785a5;}return null;})['then'](respondWithResult(_0xee089e,null))['catch'](handleError(_0xee089e,null));};var interaction_log=require('../../config/logger')(_0x1993('0x59'));exports[_0x1993('0x37')]=function(_0x4c627c,_0x117f58,_0x234ca8){var _0x99e853={'agent':{},'channel':_0x1993('0x5b')};if(_0x4c627c[_0x1993('0x57')]['id']){delete _0x4c627c[_0x1993('0x57')]['id'];}_0x4c627c[_0x1993('0x57')][_0x1993('0x5e')]=_0x4c627c[_0x1993('0x57')][_0x1993('0x5e')]||_0x4c627c[_0x1993('0x5f')]['id'];_0x99e853[_0x1993('0x60')]['id']=_0x4c627c[_0x1993('0x57')][_0x1993('0x5e')];return db[_0x1993('0x3d')]['find']({'where':{'id':_0x4c627c['params']['id'],'UserId':null}})[_0x1993('0x23')](handleEntityNotFound(_0x117f58,null))[_0x1993('0x23')](function(_0x3f9ef7){if(_0x3f9ef7){_0x99e853[_0x1993('0x2b')]=_0x3f9ef7[_0x1993('0x61')]({'plain':!![]});return db['SmsInteraction'][_0x1993('0x55')]({'where':{'id':_0x3f9ef7[_0x1993('0x79')]}});}return null;})[_0x1993('0x23')](handleEntityNotFound(_0x117f58,null))[_0x1993('0x23')](function(_0x243052){if(_0x243052){_0x99e853['interaction']=_0x243052[_0x1993('0x61')]({'plain':!![]});interaction_log['info'](_0x1993('0x7a'),_0x4c627c[_0x1993('0x5f')]['id'],_0x4c627c[_0x1993('0x5f')]['name'],_0x4c627c[_0x1993('0x5f')][_0x1993('0x66')],_0x99e853[_0x1993('0x65')]['id'],_0x4c627c[_0x1993('0x57')]?JSON[_0x1993('0x28')](_0x4c627c[_0x1993('0x57')]):_0x1993('0x67'));return respondWithRpcPromise(_0x1993('0x7b'),_0x1993('0x7c'),_0x99e853);}return null;})[_0x1993('0x23')](function(_0x2b95ac){var _0x12cb2c=_0x1993('0x6a')+_0x2b95ac[_0x1993('0x2b')][_0x1993('0x6b')];return db['sequelize'][_0x1993('0x41')](_0x12cb2c,{'type':db['Sequelize'][_0x1993('0x6e')]['SELECT'],'raw':!![]})[_0x1993('0x23')](function(_0x5473e0){return _0x5473e0;});})['then'](function(_0x26773e){if(_0x26773e){_0x99e853[_0x1993('0x2b')][_0x1993('0x70')]=_0x26773e[0x0];if(!_0x4c627c[_0x1993('0x57')][_0x1993('0x5e')])return;return db[_0x1993('0x71')]['find']({'where':{'id':_0x4c627c[_0x1993('0x57')][_0x1993('0x5e')],'role':_0x1993('0x60')},'attributes':['id',_0x1993('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x250a92){if(!_0x250a92)return null;_0x99e853['message'][_0x1993('0x60')]=_0x250a92;return _0x99e853;})[_0x1993('0x23')](function(_0xd43b6e){if(_0xd43b6e){_0xd43b6e[_0x1993('0x2b')]['interface']=util[_0x1993('0x64')]('SIP/%s',_0x4c627c['user']['name']);_0xd43b6e[_0x1993('0x2b')][_0x1993('0x75')]=_0x99e853['channel'];_0xd43b6e['message'][_0x1993('0x7d')]=_0x99e853[_0x1993('0x75')];_0xd43b6e['message']['event']=_0x1993('0x37');respondWithRpcPromise('EventManager',_0x1993('0x77'),{'event':_0x1993('0x7e'),'message':_0xd43b6e[_0x1993('0x2b')]},client9002);return _0x99e853;}return null;})['then'](respondWithResult(_0x117f58,null))[_0x1993('0x2c')](handleError(_0x117f58,null));};exports['status']=function(_0x54be96,_0x120116,_0x51d97f){if(_0x54be96['body']['id']){delete _0x54be96[_0x1993('0x57')]['id'];}var _0xbe3853;return db['SmsMessage'][_0x1993('0x55')]({'where':{'id':_0x54be96[_0x1993('0x7f')]['id']}})[_0x1993('0x23')](handleEntityNotFound(_0x120116,null))['then'](function(_0xe286a2){if(_0xe286a2){_0xbe3853=_0xe286a2;return db[_0x1993('0x80')][_0x1993('0x55')]({'where':{'id':_0xe286a2['SmsAccountId']}});}})[_0x1993('0x23')](handleEntityNotFound(_0x120116,null))['then'](function(_0x44b4af){if(_0x44b4af){logger['debug'](_0x1993('0x81'),_0x1993('0x2e'),'received\x20delivery\x20report\x20from',_0x44b4af[_0x1993('0x3f')],util[_0x1993('0x82')](_0x54be96[_0x1993('0x57')],{'showHidden':![],'depth':null}));switch(_0x44b4af[_0x1993('0x3f')]){case _0x1993('0x83'):if(_0x54be96[_0x1993('0x57')][_0x1993('0x84')]&&_0x54be96[_0x1993('0x57')][_0x1993('0x84')]===_0xbe3853[_0x1993('0x85')]){return _0xbe3853[_0x1993('0x38')]({'read':!![]});}else{logger[_0x1993('0x29')](_0x1993('0x86'),_0x1993('0x2e'),_0x1993('0x83'),util['inspect'](_0x54be96[_0x1993('0x57')],{'showHidden':![],'depth':null}));}break;case _0x1993('0x87'):if(_0x54be96[_0x1993('0x57')][_0x1993('0x88')]&&_0x54be96[_0x1993('0x57')][_0x1993('0x88')]===_0xbe3853['messageId']&&_[_0x1993('0x89')]([_0x1993('0x8a'),_0x1993('0x8b')],_0x54be96['body']['Status'])>=0x0){return _0xbe3853[_0x1993('0x38')]({'read':!![]});}else{logger[_0x1993('0x29')](_0x1993('0x86'),_0x1993('0x2e'),_0x1993('0x8c'),util[_0x1993('0x82')](_0x54be96['body'],{'showHidden':![],'depth':null}));}break;case _0x1993('0x8d'):var _0x359eff=_0x54be96[_0x1993('0x57')][_0x1993('0x8e')][0x0];if(_0x359eff[_0x1993('0x2e')][_0x1993('0x8f')]===_0x1993('0x90')){return _0xbe3853[_0x1993('0x38')]({'read':!![]});}else{logger['error'](_0x1993('0x86'),'status',_0x1993('0x8d'),util['inspect'](_0x54be96['body'],{'showHidden':![],'depth':null}));}break;}return _0xbe3853;}})[_0x1993('0x23')](respondWithResult(_0x120116,null))[_0x1993('0x2c')](handleError(_0x120116,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 71b0e83..e50f425 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 _0x9120=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x1b4c44,_0x1149f5){var _0x28d604=function(_0x2c36cc){while(--_0x2c36cc){_0x1b4c44['push'](_0x1b4c44['shift']());}};_0x28d604(++_0x1149f5);}(_0x9120,0x16b));var _0x0912=function(_0x15b4f5,_0x2ac5e6){_0x15b4f5=_0x15b4f5-0x0;var _0x158b27=_0x9120[_0x15b4f5];return _0x158b27;};'use strict';var EventEmitter=require(_0x0912('0x0'));var SmsMessage=require(_0x0912('0x1'))['db'][_0x0912('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0912('0x3')](0x0);var events={'afterCreate':_0x0912('0x4'),'afterUpdate':_0x0912('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1063fa){return function(_0x52aca5,_0x4c9adb,_0x4578d3){SmsMessageEvents[_0x0912('0x6')](_0x1063fa+':'+_0x52aca5['id'],_0x52aca5);SmsMessageEvents['emit'](_0x1063fa,_0x52aca5);_0x4578d3(null);};}for(var e in events){if(events[_0x0912('0x7')](e)){var event=events[e];SmsMessage[_0x0912('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x7f2c=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsMessage'];(function(_0x351bc8,_0x3fe06d){var _0x4d77b1=function(_0x229b48){while(--_0x229b48){_0x351bc8['push'](_0x351bc8['shift']());}};_0x4d77b1(++_0x3fe06d);}(_0x7f2c,0xc6));var _0xc7f2=function(_0x493c7a,_0x30ea93){_0x493c7a=_0x493c7a-0x0;var _0x1ad499=_0x7f2c[_0x493c7a];return _0x1ad499;};'use strict';var EventEmitter=require(_0xc7f2('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xc7f2('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc7f2('0x2'),'afterDestroy':_0xc7f2('0x3')};function emitEvent(_0xe6fd4e){return function(_0x220d09,_0x30be19,_0x32e8c1){SmsMessageEvents['emit'](_0xe6fd4e+':'+_0x220d09['id'],_0x220d09);SmsMessageEvents[_0xc7f2('0x4')](_0xe6fd4e,_0x220d09);_0x32e8c1(null);};}for(var e in events){if(events[_0xc7f2('0x5')](e)){var event=events[e];SmsMessage[_0xc7f2('0x6')](e,emitEvent(event));}}module[_0xc7f2('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 1c52b32..fd2e7b2 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 _0x3c1c=['smsMethod','sender','login?username=','&password=','GET','split','sms','POST','total_sent','internal_order_id','deliveryReport','read','skebby','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','message_id','clickSend','plivo','authId','/api/sms/messages/','/status?token=','token','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','apiKey','login','timestamp','keys','sort','length','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','intelepeer','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0x3c1c,0xbe));var _0xc3c1=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x3c1c[_0x2fff83];return _0xa2a722;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3c1('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc3c1('0x1'));var rp=require(_0xc3c1('0x2'));var fs=require('fs');var path=require(_0xc3c1('0x3'));var rimraf=require(_0xc3c1('0x4'));var config=require(_0xc3c1('0x5'));var attributes=require(_0xc3c1('0x6'));module[_0xc3c1('0x7')]=function(_0x11cb9e,_0x4d86e8){return _0x11cb9e['define']('SmsMessage',attributes,{'tableName':_0xc3c1('0x8'),'paranoid':![],'indexes':[{'name':_0xc3c1('0x9'),'fields':['messageId']},{'name':_0xc3c1('0xa'),'fields':[_0xc3c1('0xb')],'type':_0xc3c1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c2a0a,_0x5c4aab,_0x5b8910){var _0x4f0d4f=_0x11cb9e['models'];var _0x317054=_0x4c2a0a[_0xc3c1('0xd')]({'plain':!![]});if(_0x317054[_0xc3c1('0xe')][_0xc3c1('0xf')]()==='in'||_0x317054['direction'][_0xc3c1('0xf')]()==='out'&&!_0x317054['secret']&&!_[_0xc3c1('0x10')](_0x317054[_0xc3c1('0x11')])&&!_[_0xc3c1('0x10')](_0x317054[_0xc3c1('0x12')])){_0x4f0d4f['SmsInteraction'][_0xc3c1('0x13')]({'where':{'id':_0x317054[_0xc3c1('0x12')]}})[_0xc3c1('0x14')](function(_0x10e1d4){if(_0x10e1d4){_0x10e1d4[_0xc3c1('0x15')]({'lastMsgAt':_0x317054[_0xc3c1('0x16')],'lastMsgDirection':_0x317054['direction']['toLowerCase']()});}})[_0xc3c1('0x17')](function(_0x5997a3){console[_0xc3c1('0x18')](_0x5997a3);});}if(_0x317054[_0xc3c1('0xe')]==='out'&&!_0x317054[_0xc3c1('0x19')]){var _0x32f43f;_0x4f0d4f[_0xc3c1('0x1a')][_0xc3c1('0x1b')]({'where':{'id':_0x317054[_0xc3c1('0x1c')]},'raw':!![]})[_0xc3c1('0x14')](function(_0x1ffff3){_0x32f43f=_0x1ffff3;if(_0x32f43f&&_0x32f43f[_0xc3c1('0x1d')]){switch(_0x32f43f[_0xc3c1('0x1d')]){case _0xc3c1('0x1e'):var _0x5535d3=require(_0xc3c1('0x1e'));if(_0x32f43f['accountSid']&&_0x32f43f[_0xc3c1('0x1f')]&&_0x32f43f[_0xc3c1('0x20')]){var _0x4f5d1f=new _0x5535d3(_0x32f43f[_0xc3c1('0x21')],_0x32f43f[_0xc3c1('0x1f')]);_0x4f5d1f[_0xc3c1('0x22')][_0xc3c1('0x23')]({'body':_0x317054[_0xc3c1('0xb')],'to':_0x317054[_0xc3c1('0x20')],'from':_0x32f43f[_0xc3c1('0x20')],'statusCallback':_0x32f43f[_0xc3c1('0x24')]+'/api/sms/messages/'+_0x317054['id']+'/status?token='+_0x32f43f['token']})[_0xc3c1('0x14')](function(_0x50b9f7){if(_0x50b9f7[_0xc3c1('0x25')]){return _0x4c2a0a[_0xc3c1('0x15')]({'messageId':_0x50b9f7['sid']});}})[_0xc3c1('0x17')](function(_0x434a6a){logger['error'](_0xc3c1('0x26'),'afterCreate',_0xc3c1('0x1e'),util[_0xc3c1('0x27')](_0x434a6a,{'showHidden':![],'depth':null}));});}else{logger[_0xc3c1('0x18')](_0xc3c1('0x26'),'afterCreate',_0xc3c1('0x1e'),_0xc3c1('0x28'));}break;case'skebby':var _0x2f0ff7=_0xc3c1('0x29');if(_0x32f43f[_0xc3c1('0x2a')]&&_0x32f43f[_0xc3c1('0x2b')]){var _0x2a8592={'recipient':[_0x317054[_0xc3c1('0x20')]],'message':_0x317054[_0xc3c1('0xb')],'message_type':_0x32f43f[_0xc3c1('0x2c')]};if(_0x32f43f[_0xc3c1('0x2c')]&&_0x32f43f[_0xc3c1('0x2c')]!=='SI'){_0x2a8592[_0xc3c1('0x2d')]=_0x32f43f[_0xc3c1('0x20')];}var _0x409a0d={'url':_0x2f0ff7+_0xc3c1('0x2e')+_0x32f43f[_0xc3c1('0x2a')]+_0xc3c1('0x2f')+_0x32f43f[_0xc3c1('0x2b')],'method':_0xc3c1('0x30')};rp(_0x409a0d)[_0xc3c1('0x14')](function(_0x359195){var _0x3d69a8=_0x359195[_0xc3c1('0x31')](';');var _0x133760={'user_key':_0x3d69a8[0x0],'session_key':_0x3d69a8[0x1]};_0x409a0d={'url':_0x2f0ff7+_0xc3c1('0x32'),'method':_0xc3c1('0x33'),'headers':{'user_key':_0x133760['user_key'],'Session_key':_0x133760['session_key']},'json':!![],'body':_0x2a8592};return rp(_0x409a0d);})['then'](function(_0x4a6372){if(_0x4a6372[_0xc3c1('0x34')]>=0x1){var _0x14814e={'messageId':_0x4a6372[_0xc3c1('0x35')]};if(_0x32f43f[_0xc3c1('0x2c')]!=='GP'||!_0x32f43f[_0xc3c1('0x36')]){_0x14814e[_0xc3c1('0x37')]=!![];}return _0x4c2a0a[_0xc3c1('0x15')](_0x14814e);}else{return logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3c1('0x38'),util[_0xc3c1('0x27')](_0x4a6372,{'showHidden':![],'depth':null}));}})[_0xc3c1('0x17')](function(_0x270af9){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x38'),util[_0xc3c1('0x27')](_0x270af9,{'showHidden':![],'depth':null}));});}else{logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x38'),_0xc3c1('0x3a'));}break;case _0xc3c1('0x3b'):if(_0x32f43f[_0xc3c1('0x1f')]){var _0xdb5d25={'recipient':_0x317054[_0xc3c1('0x20')],'message':_0x317054[_0xc3c1('0xb')],'sender':_0x32f43f[_0xc3c1('0x3c')]||_0x32f43f[_0xc3c1('0x20')],'authorization':_0x32f43f[_0xc3c1('0x1f')]};var _0x5c4aab={'method':_0xc3c1('0x33'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xdb5d25,'json':!![]};rp(_0x5c4aab)[_0xc3c1('0x14')](function(_0x48d82d){var _0xbcb3df={'messageId':_0x48d82d[_0xc3c1('0x3d')]};if(!_0x32f43f[_0xc3c1('0x36')]){_0xbcb3df[_0xc3c1('0x37')]=!![];}return _0x4c2a0a[_0xc3c1('0x15')](_0xbcb3df);})[_0xc3c1('0x17')](function(_0x16a6b0){logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x3b'),util[_0xc3c1('0x27')](_0x16a6b0,{'showHidden':![],'depth':null}));});}else{logger[_0xc3c1('0x18')](_0xc3c1('0x26'),'afterCreate',_0xc3c1('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0xc3c1('0x3e'):if(_0x32f43f[_0xc3c1('0x2a')]&&_0x32f43f[_0xc3c1('0x2b')]){var _0xdb5d25={'messages':[{'source':_0xc3c1('0x3f'),'to':_0x317054[_0xc3c1('0x20')],'body':_0x317054[_0xc3c1('0xb')],'from':_0x32f43f['senderString']||_0x32f43f['phone']}]};var _0x3d5f29=util[_0xc3c1('0x40')](_0xc3c1('0x41'),_0x32f43f[_0xc3c1('0x2a')],_0x32f43f[_0xc3c1('0x2b')]);var _0x5c4aab={'method':'POST','uri':_0xc3c1('0x42'),'body':_0xdb5d25,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x3d5f29)[_0xc3c1('0x43')](_0xc3c1('0x44')))},'json':!![]};rp(_0x5c4aab)['then'](function(_0x21c3d9){if(_0x21c3d9[_0xc3c1('0x45')]>=0xc8&&_0x21c3d9[_0xc3c1('0x45')]<=0xce){if(_0x21c3d9[_0xc3c1('0x46')]&&_0x21c3d9[_0xc3c1('0x46')]['queued_count']>0x0){var _0x4ad99a=_['head'](_0x21c3d9['data'][_0xc3c1('0x22')]);var _0x218003={'messageId':_0x4ad99a[_0xc3c1('0x47')]};if(!_0x32f43f[_0xc3c1('0x36')]){_0x218003[_0xc3c1('0x37')]=!![];}return _0x4c2a0a[_0xc3c1('0x15')](_0x218003);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x48'),util[_0xc3c1('0x27')](_0x21c3d9,{'showHidden':![],'depth':null}));}}else{logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),'clickSend',util[_0xc3c1('0x27')](_0x21c3d9,{'showHidden':![],'depth':null}));}})[_0xc3c1('0x17')](function(_0x5a277f){logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x48'),util[_0xc3c1('0x27')](_0x5a277f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc3c1('0x26'),'afterCreate',_0xc3c1('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc3c1('0x49'):if(_0x32f43f[_0xc3c1('0x4a')]&&_0x32f43f[_0xc3c1('0x1f')]){var _0xdb5d25={'dst':_0x317054[_0xc3c1('0x20')],'text':_0x317054[_0xc3c1('0xb')],'src':_0x32f43f['senderString']||_0x32f43f['phone'],'url':_0x32f43f['remote']+_0xc3c1('0x4b')+_0x317054['id']+_0xc3c1('0x4c')+_0x32f43f[_0xc3c1('0x4d')]};var _0x3d5f29=util['format'](_0xc3c1('0x41'),_0x32f43f[_0xc3c1('0x4a')],_0x32f43f[_0xc3c1('0x1f')]);var _0x5c4aab={'method':_0xc3c1('0x33'),'uri':util[_0xc3c1('0x40')]('https://api.plivo.com/v1/Account/%s/Message/',_0x32f43f[_0xc3c1('0x4a')]),'body':_0xdb5d25,'headers':{'Authorization':util[_0xc3c1('0x40')](_0xc3c1('0x4e'),new Buffer(_0x3d5f29)[_0xc3c1('0x43')](_0xc3c1('0x44')))},'json':!![]};rp(_0x5c4aab)['then'](function(_0x1b01e2){var _0xe2fad9={'messageId':_0x1b01e2[_0xc3c1('0x4f')][0x0]};return _0x4c2a0a[_0xc3c1('0x15')](_0xe2fad9);})[_0xc3c1('0x17')](function(_0x3fc1fd){logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x49'),util[_0xc3c1('0x27')](_0x3fc1fd,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x49'),_0xc3c1('0x50'));}break;case _0xc3c1('0x51'):if(_0x32f43f[_0xc3c1('0x2a')]&&_0x32f43f['password']){if(_0x32f43f[_0xc3c1('0x52')]){var _0x291f73={'method':_0xc3c1('0x33'),'uri':_0x32f43f[_0xc3c1('0x52')]+_0xc3c1('0x53'),'body':{'username':_0x32f43f['username'],'password':_0x32f43f[_0xc3c1('0x2b')]},'json':!![]};return rp(_0x291f73)['then'](function(_0x2ca0e7){var _0x3fe4f5={'method':_0xc3c1('0x33'),'uri':_0x32f43f[_0xc3c1('0x52')]+_0xc3c1('0x54'),'body':{'messages':[{'from':_0x32f43f[_0xc3c1('0x20')],'destinations':[{'to':_0x317054[_0xc3c1('0x20')]}],'text':_0x317054[_0xc3c1('0xb')],'notifyUrl':_0x32f43f[_0xc3c1('0x24')]+'/api/sms/messages/'+_0x317054['id']+_0xc3c1('0x4c')+_0x32f43f['token'],'notifyContentType':'application/json','callbackData':_0x32f43f[_0xc3c1('0x20')]+';'+_0x317054[_0xc3c1('0xb')]}]},'headers':{'Authorization':_0xc3c1('0x55')+_0x2ca0e7[_0xc3c1('0x4d')]},'json':!![]};return rp(_0x3fe4f5)[_0xc3c1('0x14')](function(_0x5ca55f){if(_0x5ca55f['messages']){var _0x55666c={'messageId':_0x5ca55f[_0xc3c1('0x22')][0x0]['messageId']};if(!_0x32f43f[_0xc3c1('0x36')]){_0x55666c[_0xc3c1('0x37')]=!![];}return _0x4c2a0a[_0xc3c1('0x15')](_0x55666c);}else{return logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x51'),util[_0xc3c1('0x27')](_0x5ca55f,{'showHidden':![],'depth':null}));}});})[_0xc3c1('0x17')](function(_0x3a6d7d){return logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x51'),util[_0xc3c1('0x27')](_0x3a6d7d,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x51'),_0xc3c1('0x56'));}}else{logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),'infobip',_0xc3c1('0x3a'));}break;case'csc':var _0x1778cf=require('crypto');if(_0x32f43f[_0xc3c1('0x57')]){var _0x5db34b={};_0x5db34b[_0xc3c1('0x58')]=_0x32f43f[_0xc3c1('0x2a')];_0x5db34b[_0xc3c1('0x20')]=_0x317054[_0xc3c1('0x20')];_0x5db34b[_0xc3c1('0x2d')]=_0x32f43f[_0xc3c1('0x20')];_0x5db34b['text']=_0x317054[_0xc3c1('0xb')];_0x5db34b[_0xc3c1('0x59')]=+new Date();var _0x4b37c6='';var _0x1f891d='';var _0x333325=Object[_0xc3c1('0x5a')](_0x5db34b);_0x333325[_0xc3c1('0x5b')]();for(var _0x50b334=0x0;_0x50b334<_0x333325[_0xc3c1('0x5c')];_0x50b334++){if(_0x4b37c6!=''){_0x4b37c6+='&';}_0x4b37c6+=_0x333325[_0x50b334]+'='+encodeURIComponent(_0x5db34b[_0x333325[_0x50b334]]);_0x1f891d+=_0x5db34b[_0x333325[_0x50b334]];}_0x1f891d+=_0x32f43f['apiKey'];_0x1f891d=_0x1778cf['createHash']('md5')[_0xc3c1('0x15')](_0x1f891d)[_0xc3c1('0x5d')](_0xc3c1('0x5e'));if(_0x4b37c6!==''){_0x4b37c6+='&';}_0x4b37c6+=_0xc3c1('0x5f')+_0x1f891d;var _0x409a0d={'method':_0xc3c1('0x30'),'uri':_0x32f43f[_0xc3c1('0x52')]+_0xc3c1('0x60')+_0x4b37c6,'json':!![]};return rp(_0x409a0d)['then'](function(_0x2d18e5){var _0x7097b3=Object[_0xc3c1('0x5a')](_0x2d18e5);if(_0x2d18e5[_0x7097b3[0x0]][_0xc3c1('0x18')]&&parseInt(_0x2d18e5[_0x7097b3[0x0]][_0xc3c1('0x18')])===0x0){var _0xaa9a48={'messageId':_0x2d18e5[_0x7097b3[0x0]][_0xc3c1('0x61')]};if(!_0x32f43f['deliveryReport']){_0xaa9a48[_0xc3c1('0x37')]=!![];}return _0x4c2a0a[_0xc3c1('0x15')](_0xaa9a48);}else{return logger['error'](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x62'),util['inspect'](_0x2d18e5[_0xc3c1('0x18')],{'showHidden':![],'depth':null}));}})[_0xc3c1('0x17')](function(_0x28a1b4){return logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x62'),util[_0xc3c1('0x27')](_0x28a1b4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc3c1('0x26'),_0xc3c1('0x39'),'csc',_0xc3c1('0x63'));}break;case'clickatell':if(_0x32f43f[_0xc3c1('0x57')]){var _0x2f9fbd={'method':_0xc3c1('0x33'),'uri':_0xc3c1('0x64'),'headers':{'Authorization':_0x32f43f['apiKey']},'body':{'content':_0x317054[_0xc3c1('0xb')],'to':[_0x317054[_0xc3c1('0x20')]],'from':_0x32f43f[_0xc3c1('0x20')],'binary':![],'clientMessageId':_0xc3c1('0x65'),'charset':_0xc3c1('0x66')},'json':!![]};rp(_0x2f9fbd)[_0xc3c1('0x14')](function(_0x4c9535){if(!_0x4c9535[_0xc3c1('0x18')]){var _0x1a6d39={'messageId':_0x4c9535['messages'][0x0][_0xc3c1('0x67')]};if(!_0x32f43f[_0xc3c1('0x36')]){_0x1a6d39[_0xc3c1('0x37')]=!![];}return _0x4c2a0a['update'](_0x1a6d39);}else{return logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3c1('0x68'),util[_0xc3c1('0x27')](_0x4c9535['error'],{'showHidden':![],'depth':null}));}})[_0xc3c1('0x17')](function(_0x79fc54){return logger[_0xc3c1('0x18')](_0xc3c1('0x26'),'afterCreate',_0xc3c1('0x68'),util[_0xc3c1('0x27')](_0x79fc54,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc3c1('0x26'),_0xc3c1('0x39'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case _0xc3c1('0x69'):if(_0x32f43f[_0xc3c1('0x2a')]&&_0x32f43f[_0xc3c1('0x2b')]){var _0x3d5f29=util['format'](_0xc3c1('0x41'),_0x32f43f[_0xc3c1('0x2a')],_0x32f43f[_0xc3c1('0x2b')]);var _0x5c4aab={'method':'POST','uri':_0xc3c1('0x6a')+_0x32f43f['accountId']+'/messages','body':{'to':[_0x317054['phone']],'text':_0x317054[_0xc3c1('0xb')],'from':_0x32f43f[_0xc3c1('0x20')],'applicationId':_0x32f43f['applicationId']},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x3d5f29)[_0xc3c1('0x43')](_0xc3c1('0x44')))},'json':!![]};rp(_0x5c4aab)['then'](function(_0x4b9484){if(_0x4b9484['id']){var _0x497c4a={'messageId':_0x4b9484['id']};return _0x4c2a0a[_0xc3c1('0x15')](_0x497c4a);}else{logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x69'),util[_0xc3c1('0x27')](_0x4b9484,{'showHidden':![],'depth':null}));}})[_0xc3c1('0x17')](function(_0x234ec5){logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),'bandwidth',util[_0xc3c1('0x27')](_0x234ec5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),_0xc3c1('0x69'),_0xc3c1('0x3a'));}break;case _0xc3c1('0x6b'):if(_0x32f43f[_0xc3c1('0x57')]){var _0x3f2997={};var _0x409a0d={'method':_0xc3c1('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x32f43f['apiKey'],'Content-Type':_0xc3c1('0x6c')},'body':{'from':_0x32f43f[_0xc3c1('0x20')],'to':_0x317054['phone'],'text':_0x317054[_0xc3c1('0xb')]},'json':!![]};return rp(_0x409a0d)[_0xc3c1('0x14')](function(_0x375845){if(_0x375845['code']==0xca){_0x3f2997[_0xc3c1('0x6d')]=_0x375845;var _0xc5cabe={'method':'POST','uri':_0xc3c1('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x32f43f[_0xc3c1('0x57')],'Content-Type':_0xc3c1('0x6c')},'body':{'refid':_0x3f2997[_0xc3c1('0x6d')][_0xc3c1('0x6f')]},'json':!![]};return rp(_0xc5cabe)['then'](function(_0x34610f){_0x3f2997[_0xc3c1('0x70')]=_0x34610f;var _0x1e463b={'messageId':_0x3f2997[_0xc3c1('0x6d')][_0xc3c1('0x6f')],'read':!![]};return _0x4c2a0a[_0xc3c1('0x15')](_0x1e463b);});}else{return logger['error'](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x6b'),util[_0xc3c1('0x27')](_0x375845,{'showHidden':![],'depth':null}));}})[_0xc3c1('0x17')](function(_0x2eef2e){return logger[_0xc3c1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3c1('0x39'),'intelepeer',util['inspect'](_0x2eef2e,{'showHidden':![],'depth':null}));});}else{return logger[_0xc3c1('0x18')](_0xc3c1('0x26'),_0xc3c1('0x39'),_0xc3c1('0x6b'),_0xc3c1('0x71'));}break;}}})[_0xc3c1('0x72')](function(){_0x5b8910();});}else{_0x5b8910();}}},'charset':_0xc3c1('0x73'),'collate':_0xc3c1('0x74')});}; \ No newline at end of file +var _0xb836=['https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','senderString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','find','SmsAccountId','type','twilio','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','phone','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel'];(function(_0x20d08e,_0x4cc575){var _0x2cbd12=function(_0x3de355){while(--_0x3de355){_0x20d08e['push'](_0x20d08e['shift']());}};_0x2cbd12(++_0x4cc575);}(_0xb836,0x13a));var _0x6b83=function(_0x55180a,_0x226b4b){_0x55180a=_0x55180a-0x0;var _0x406db7=_0xb836[_0x55180a];return _0x406db7;};'use strict';var _=require(_0x6b83('0x0'));var util=require(_0x6b83('0x1'));var logger=require(_0x6b83('0x2'))(_0x6b83('0x3'));var moment=require(_0x6b83('0x4'));var BPromise=require(_0x6b83('0x5'));var rp=require(_0x6b83('0x6'));var fs=require('fs');var path=require(_0x6b83('0x7'));var rimraf=require(_0x6b83('0x8'));var config=require(_0x6b83('0x9'));var attributes=require(_0x6b83('0xa'));module[_0x6b83('0xb')]=function(_0x17b06b,_0x5c6b27){return _0x17b06b[_0x6b83('0xc')](_0x6b83('0xd'),attributes,{'tableName':_0x6b83('0xe'),'paranoid':![],'indexes':[{'name':_0x6b83('0xf'),'fields':[_0x6b83('0xf')]},{'name':_0x6b83('0x10'),'fields':[_0x6b83('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x581065,_0x9388a8,_0x30ca5c){var _0x2a40fb=_0x17b06b[_0x6b83('0x12')];var _0x350d85=_0x581065[_0x6b83('0x13')]({'plain':!![]});if(_0x350d85[_0x6b83('0x14')][_0x6b83('0x15')]()==='in'||_0x350d85[_0x6b83('0x14')][_0x6b83('0x15')]()===_0x6b83('0x16')&&!_0x350d85['secret']&&!_[_0x6b83('0x17')](_0x350d85[_0x6b83('0x18')])&&!_[_0x6b83('0x17')](_0x350d85[_0x6b83('0x19')])){_0x2a40fb[_0x6b83('0x1a')]['findOne']({'where':{'id':_0x350d85['SmsInteractionId']}})[_0x6b83('0x1b')](function(_0x48d36e){if(_0x48d36e){_0x48d36e[_0x6b83('0x1c')]({'lastMsgAt':_0x350d85[_0x6b83('0x1d')],'lastMsgDirection':_0x350d85[_0x6b83('0x14')][_0x6b83('0x15')]()});}})[_0x6b83('0x1e')](function(_0xe9501e){console[_0x6b83('0x1f')](_0xe9501e);});}if(_0x350d85['direction']===_0x6b83('0x16')&&!_0x350d85['secret']){var _0x2d30f1;_0x2a40fb['SmsAccount'][_0x6b83('0x20')]({'where':{'id':_0x350d85[_0x6b83('0x21')]},'raw':!![]})[_0x6b83('0x1b')](function(_0x355f60){_0x2d30f1=_0x355f60;if(_0x2d30f1&&_0x2d30f1[_0x6b83('0x22')]){switch(_0x2d30f1[_0x6b83('0x22')]){case'twilio':var _0x199cda=require(_0x6b83('0x23'));if(_0x2d30f1['accountSid']&&_0x2d30f1[_0x6b83('0x24')]&&_0x2d30f1['phone']){var _0x482d24=new _0x199cda(_0x2d30f1['accountSid'],_0x2d30f1[_0x6b83('0x24')]);_0x482d24[_0x6b83('0x25')][_0x6b83('0x26')]({'body':_0x350d85[_0x6b83('0x11')],'to':_0x350d85['phone'],'from':_0x2d30f1['phone'],'statusCallback':_0x2d30f1[_0x6b83('0x27')]+_0x6b83('0x28')+_0x350d85['id']+_0x6b83('0x29')+_0x2d30f1[_0x6b83('0x2a')]})['then'](function(_0x3e2610){if(_0x3e2610[_0x6b83('0x2b')]){return _0x581065[_0x6b83('0x1c')]({'messageId':_0x3e2610[_0x6b83('0x2b')]});}})[_0x6b83('0x1e')](function(_0x3b5e5b){logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x23'),util[_0x6b83('0x2e')](_0x3b5e5b,{'showHidden':![],'depth':null}));});}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x6b83('0x2f'):var _0x3822ec=_0x6b83('0x30');if(_0x2d30f1[_0x6b83('0x31')]&&_0x2d30f1[_0x6b83('0x32')]){var _0xec7c1e={'recipient':[_0x350d85[_0x6b83('0x33')]],'message':_0x350d85[_0x6b83('0x11')],'message_type':_0x2d30f1['smsMethod']};if(_0x2d30f1['smsMethod']&&_0x2d30f1['smsMethod']!=='SI'){_0xec7c1e[_0x6b83('0x34')]=_0x2d30f1['phone'];}var _0x4c5c6d={'url':_0x3822ec+_0x6b83('0x35')+_0x2d30f1[_0x6b83('0x31')]+_0x6b83('0x36')+_0x2d30f1[_0x6b83('0x32')],'method':_0x6b83('0x37')};rp(_0x4c5c6d)[_0x6b83('0x1b')](function(_0x35ff04){var _0x19f59c=_0x35ff04[_0x6b83('0x38')](';');var _0x395c3a={'user_key':_0x19f59c[0x0],'session_key':_0x19f59c[0x1]};_0x4c5c6d={'url':_0x3822ec+_0x6b83('0x39'),'method':_0x6b83('0x3a'),'headers':{'user_key':_0x395c3a[_0x6b83('0x3b')],'Session_key':_0x395c3a[_0x6b83('0x3c')]},'json':!![],'body':_0xec7c1e};return rp(_0x4c5c6d);})[_0x6b83('0x1b')](function(_0x63fdaa){if(_0x63fdaa[_0x6b83('0x3d')]>=0x1){var _0x1e46b8={'messageId':_0x63fdaa[_0x6b83('0x3e')]};if(_0x2d30f1['smsMethod']!=='GP'||!_0x2d30f1[_0x6b83('0x3f')]){_0x1e46b8[_0x6b83('0x40')]=!![];}return _0x581065['update'](_0x1e46b8);}else{return logger[_0x6b83('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6b83('0x2d'),_0x6b83('0x2f'),util[_0x6b83('0x2e')](_0x63fdaa,{'showHidden':![],'depth':null}));}})[_0x6b83('0x1e')](function(_0x4b81d6){return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x2f'),util['inspect'](_0x4b81d6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6b83('0x2c'),'afterCreate',_0x6b83('0x2f'),_0x6b83('0x41'));}break;case _0x6b83('0x42'):if(_0x2d30f1['authToken']){var _0x3283c1={'recipient':_0x350d85[_0x6b83('0x33')],'message':_0x350d85[_0x6b83('0x11')],'sender':_0x2d30f1['senderString']||_0x2d30f1[_0x6b83('0x33')],'authorization':_0x2d30f1[_0x6b83('0x24')]};var _0x9388a8={'method':'POST','uri':_0x6b83('0x43'),'body':_0x3283c1,'json':!![]};rp(_0x9388a8)['then'](function(_0x899a6a){var _0x16a759={'messageId':_0x899a6a[_0x6b83('0x44')]};if(!_0x2d30f1[_0x6b83('0x3f')]){_0x16a759[_0x6b83('0x40')]=!![];}return _0x581065[_0x6b83('0x1c')](_0x16a759);})[_0x6b83('0x1e')](function(_0x4847b2){logger[_0x6b83('0x1f')](_0x6b83('0x2c'),'afterCreate',_0x6b83('0x42'),util[_0x6b83('0x2e')](_0x4847b2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x42'),_0x6b83('0x45'));}break;case _0x6b83('0x46'):if(_0x2d30f1[_0x6b83('0x31')]&&_0x2d30f1['password']){var _0x3283c1={'messages':[{'source':_0x6b83('0x47'),'to':_0x350d85[_0x6b83('0x33')],'body':_0x350d85[_0x6b83('0x11')],'from':_0x2d30f1['senderString']||_0x2d30f1[_0x6b83('0x33')]}]};var _0x375020=util['format'](_0x6b83('0x48'),_0x2d30f1[_0x6b83('0x31')],_0x2d30f1[_0x6b83('0x32')]);var _0x9388a8={'method':'POST','uri':_0x6b83('0x49'),'body':_0x3283c1,'headers':{'Authorization':util[_0x6b83('0x4a')](_0x6b83('0x4b'),new Buffer(_0x375020)[_0x6b83('0x4c')](_0x6b83('0x4d')))},'json':!![]};rp(_0x9388a8)['then'](function(_0x13daa2){if(_0x13daa2['http_code']>=0xc8&&_0x13daa2[_0x6b83('0x4e')]<=0xce){if(_0x13daa2['data']&&_0x13daa2[_0x6b83('0x4f')][_0x6b83('0x50')]>0x0){var _0x1d7a3f=_[_0x6b83('0x51')](_0x13daa2['data'][_0x6b83('0x25')]);var _0x2dd333={'messageId':_0x1d7a3f[_0x6b83('0x52')]};if(!_0x2d30f1['deliveryReport']){_0x2dd333[_0x6b83('0x40')]=!![];}return _0x581065['update'](_0x2dd333);}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x53'),util[_0x6b83('0x2e')](_0x13daa2,{'showHidden':![],'depth':null}));}}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),'afterCreate',_0x6b83('0x53'),util[_0x6b83('0x2e')](_0x13daa2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x50a2ba){logger['error'](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x53'),util[_0x6b83('0x2e')](_0x50a2ba,{'showHidden':![],'depth':null}));});}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),'clickSend',_0x6b83('0x41'));}break;case _0x6b83('0x54'):if(_0x2d30f1[_0x6b83('0x55')]&&_0x2d30f1[_0x6b83('0x24')]){var _0x3283c1={'dst':_0x350d85[_0x6b83('0x33')],'text':_0x350d85[_0x6b83('0x11')],'src':_0x2d30f1[_0x6b83('0x56')]||_0x2d30f1['phone'],'url':_0x2d30f1[_0x6b83('0x27')]+_0x6b83('0x28')+_0x350d85['id']+'/status?token='+_0x2d30f1['token']};var _0x375020=util[_0x6b83('0x4a')]('%s:%s',_0x2d30f1['authId'],_0x2d30f1[_0x6b83('0x24')]);var _0x9388a8={'method':_0x6b83('0x3a'),'uri':util[_0x6b83('0x4a')]('https://api.plivo.com/v1/Account/%s/Message/',_0x2d30f1[_0x6b83('0x55')]),'body':_0x3283c1,'headers':{'Authorization':util[_0x6b83('0x4a')](_0x6b83('0x4b'),new Buffer(_0x375020)['toString'](_0x6b83('0x4d')))},'json':!![]};rp(_0x9388a8)[_0x6b83('0x1b')](function(_0x2ddc3b){var _0x2db02b={'messageId':_0x2ddc3b[_0x6b83('0x57')][0x0]};return _0x581065['update'](_0x2db02b);})[_0x6b83('0x1e')](function(_0x3370dc){logger[_0x6b83('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6b83('0x2d'),_0x6b83('0x54'),util['inspect'](_0x3370dc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x54'),_0x6b83('0x58'));}break;case _0x6b83('0x59'):if(_0x2d30f1['username']&&_0x2d30f1['password']){if(_0x2d30f1[_0x6b83('0x5a')]){var _0x59f92d={'method':_0x6b83('0x3a'),'uri':_0x2d30f1[_0x6b83('0x5a')]+'/auth/1/session','body':{'username':_0x2d30f1['username'],'password':_0x2d30f1[_0x6b83('0x32')]},'json':!![]};return rp(_0x59f92d)[_0x6b83('0x1b')](function(_0x2248b5){var _0x28b902={'method':'POST','uri':_0x2d30f1[_0x6b83('0x5a')]+_0x6b83('0x5b'),'body':{'messages':[{'from':_0x2d30f1[_0x6b83('0x33')],'destinations':[{'to':_0x350d85[_0x6b83('0x33')]}],'text':_0x350d85[_0x6b83('0x11')],'notifyUrl':_0x2d30f1[_0x6b83('0x27')]+_0x6b83('0x28')+_0x350d85['id']+_0x6b83('0x29')+_0x2d30f1[_0x6b83('0x2a')],'notifyContentType':_0x6b83('0x5c'),'callbackData':_0x2d30f1[_0x6b83('0x33')]+';'+_0x350d85[_0x6b83('0x11')]}]},'headers':{'Authorization':_0x6b83('0x5d')+_0x2248b5[_0x6b83('0x2a')]},'json':!![]};return rp(_0x28b902)['then'](function(_0x1b6342){if(_0x1b6342[_0x6b83('0x25')]){var _0x136244={'messageId':_0x1b6342['messages'][0x0]['messageId']};if(!_0x2d30f1['deliveryReport']){_0x136244[_0x6b83('0x40')]=!![];}return _0x581065['update'](_0x136244);}else{return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),'infobip',util['inspect'](_0x1b6342,{'showHidden':![],'depth':null}));}});})[_0x6b83('0x1e')](function(_0x5b4e84){return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x59'),util['inspect'](_0x5b4e84,{'showHidden':![],'depth':null}));});}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),'afterCreate',_0x6b83('0x59'),_0x6b83('0x5e'));}}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x59'),_0x6b83('0x41'));}break;case _0x6b83('0x5f'):var _0x51032d=require(_0x6b83('0x60'));if(_0x2d30f1[_0x6b83('0x61')]){var _0x313ca7={};_0x313ca7[_0x6b83('0x62')]=_0x2d30f1[_0x6b83('0x31')];_0x313ca7[_0x6b83('0x33')]=_0x350d85[_0x6b83('0x33')];_0x313ca7[_0x6b83('0x34')]=_0x2d30f1[_0x6b83('0x33')];_0x313ca7[_0x6b83('0x63')]=_0x350d85[_0x6b83('0x11')];_0x313ca7[_0x6b83('0x64')]=+new Date();var _0x39882e='';var _0x33cd8c='';var _0x2d6961=Object[_0x6b83('0x65')](_0x313ca7);_0x2d6961[_0x6b83('0x66')]();for(var _0x2b0dc0=0x0;_0x2b0dc0<_0x2d6961[_0x6b83('0x67')];_0x2b0dc0++){if(_0x39882e!=''){_0x39882e+='&';}_0x39882e+=_0x2d6961[_0x2b0dc0]+'='+encodeURIComponent(_0x313ca7[_0x2d6961[_0x2b0dc0]]);_0x33cd8c+=_0x313ca7[_0x2d6961[_0x2b0dc0]];}_0x33cd8c+=_0x2d30f1[_0x6b83('0x61')];_0x33cd8c=_0x51032d['createHash']('md5')[_0x6b83('0x1c')](_0x33cd8c)[_0x6b83('0x68')](_0x6b83('0x69'));if(_0x39882e!==''){_0x39882e+='&';}_0x39882e+='signature='+_0x33cd8c;var _0x4c5c6d={'method':_0x6b83('0x37'),'uri':_0x2d30f1[_0x6b83('0x5a')]+_0x6b83('0x6a')+_0x39882e,'json':!![]};return rp(_0x4c5c6d)[_0x6b83('0x1b')](function(_0x30b198){var _0x2be59f=Object[_0x6b83('0x65')](_0x30b198);if(_0x30b198[_0x2be59f[0x0]][_0x6b83('0x1f')]&&parseInt(_0x30b198[_0x2be59f[0x0]][_0x6b83('0x1f')])===0x0){var _0x461ed4={'messageId':_0x30b198[_0x2be59f[0x0]][_0x6b83('0x6b')]};if(!_0x2d30f1[_0x6b83('0x3f')]){_0x461ed4[_0x6b83('0x40')]=!![];}return _0x581065[_0x6b83('0x1c')](_0x461ed4);}else{return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x5f'),util[_0x6b83('0x2e')](_0x30b198[_0x6b83('0x1f')],{'showHidden':![],'depth':null}));}})[_0x6b83('0x1e')](function(_0x5e592a){return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),'afterCreate','csc',util[_0x6b83('0x2e')](_0x5e592a,{'showHidden':![],'depth':null}));});}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x5f'),_0x6b83('0x6c'));}break;case _0x6b83('0x6d'):if(_0x2d30f1['apiKey']){var _0x41dff8={'method':_0x6b83('0x3a'),'uri':_0x6b83('0x6e'),'headers':{'Authorization':_0x2d30f1[_0x6b83('0x61')]},'body':{'content':_0x350d85[_0x6b83('0x11')],'to':[_0x350d85['phone']],'from':_0x2d30f1['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x6b83('0x6f')},'json':!![]};rp(_0x41dff8)['then'](function(_0x57b748){if(!_0x57b748[_0x6b83('0x1f')]){var _0xd0e7cd={'messageId':_0x57b748[_0x6b83('0x25')][0x0][_0x6b83('0x70')]};if(!_0x2d30f1[_0x6b83('0x3f')]){_0xd0e7cd[_0x6b83('0x40')]=!![];}return _0x581065[_0x6b83('0x1c')](_0xd0e7cd);}else{return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x6d'),util[_0x6b83('0x2e')](_0x57b748['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x5a1bcd){return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),'clickatell',util[_0x6b83('0x2e')](_0x5a1bcd,{'showHidden':![],'depth':null}));});}else{logger[_0x6b83('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6b83('0x2d'),'clickatell',_0x6b83('0x6c'));}break;case _0x6b83('0x71'):if(_0x2d30f1[_0x6b83('0x31')]&&_0x2d30f1['password']){var _0x375020=util[_0x6b83('0x4a')](_0x6b83('0x48'),_0x2d30f1['username'],_0x2d30f1[_0x6b83('0x32')]);var _0x9388a8={'method':'POST','uri':_0x6b83('0x72')+_0x2d30f1[_0x6b83('0x73')]+'/messages','body':{'to':[_0x350d85['phone']],'text':_0x350d85[_0x6b83('0x11')],'from':_0x2d30f1[_0x6b83('0x33')],'applicationId':_0x2d30f1[_0x6b83('0x74')]},'headers':{'Authorization':util[_0x6b83('0x4a')](_0x6b83('0x4b'),new Buffer(_0x375020)[_0x6b83('0x4c')](_0x6b83('0x4d')))},'json':!![]};rp(_0x9388a8)[_0x6b83('0x1b')](function(_0x4e40a2){if(_0x4e40a2['id']){var _0x527468={'messageId':_0x4e40a2['id']};return _0x581065[_0x6b83('0x1c')](_0x527468);}else{logger[_0x6b83('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6b83('0x2d'),_0x6b83('0x71'),util[_0x6b83('0x2e')](_0x4e40a2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2cf457){logger[_0x6b83('0x1f')](_0x6b83('0x2c'),'afterCreate','bandwidth',util[_0x6b83('0x2e')](_0x2cf457,{'showHidden':![],'depth':null}));});}else{logger[_0x6b83('0x1f')](_0x6b83('0x2c'),'afterCreate',_0x6b83('0x71'),_0x6b83('0x41'));}break;case _0x6b83('0x75'):if(_0x2d30f1[_0x6b83('0x61')]){var _0x51c774={};var _0x4c5c6d={'method':_0x6b83('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x6b83('0x76')+_0x2d30f1['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x2d30f1['phone'],'to':_0x350d85[_0x6b83('0x33')],'text':_0x350d85['body']},'json':!![]};return rp(_0x4c5c6d)[_0x6b83('0x1b')](function(_0x149410){if(_0x149410[_0x6b83('0x77')]==0xca){_0x51c774[_0x6b83('0x78')]=_0x149410;var _0x51ca57={'method':_0x6b83('0x3a'),'uri':_0x6b83('0x79'),'headers':{'Authorization':_0x6b83('0x76')+_0x2d30f1[_0x6b83('0x61')],'Content-Type':_0x6b83('0x5c')},'body':{'refid':_0x51c774[_0x6b83('0x78')]['refid']},'json':!![]};return rp(_0x51ca57)[_0x6b83('0x1b')](function(_0x52cc3a){_0x51c774[_0x6b83('0x7a')]=_0x52cc3a;var _0x187d4f={'messageId':_0x51c774[_0x6b83('0x78')]['refid'],'read':!![]};return _0x581065[_0x6b83('0x1c')](_0x187d4f);});}else{return logger[_0x6b83('0x1f')](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x75'),util['inspect'](_0x149410,{'showHidden':![],'depth':null}));}})[_0x6b83('0x1e')](function(_0xd97209){return logger['error'](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x75'),util[_0x6b83('0x2e')](_0xd97209,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x6b83('0x2c'),_0x6b83('0x2d'),_0x6b83('0x75'),_0x6b83('0x7b'));}break;}}})[_0x6b83('0x7c')](function(){_0x30ca5c();});}else{_0x30ca5c();}}},'charset':_0x6b83('0x7d'),'collate':_0x6b83('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2f5d100..6bb1322 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 _0x52b8=['options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','SmsMessage','create','body'];(function(_0x57454f,_0x3a75dd){var _0x361fda=function(_0x447af1){while(--_0x447af1){_0x57454f['push'](_0x57454f['shift']());}};_0x361fda(++_0x3a75dd);}(_0x52b8,0x163));var _0x852b=function(_0x329ec3,_0x51616d){_0x329ec3=_0x329ec3-0x0;var _0x466f47=_0x52b8[_0x329ec3];return _0x466f47;};'use strict';var _=require('lodash');var util=require(_0x852b('0x0'));var moment=require(_0x852b('0x1'));var BPromise=require(_0x852b('0x2'));var rs=require(_0x852b('0x3'));var fs=require('fs');var Redis=require(_0x852b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x852b('0x5'));var logger=require(_0x852b('0x6'))(_0x852b('0x7'));var config=require('../../config/environment');var jayson=require(_0x852b('0x8'));var client=jayson[_0x852b('0x9')][_0x852b('0xa')]({'port':0x232a});config[_0x852b('0xb')]=_['defaults'](config['redis'],{'host':_0x852b('0xc'),'port':0x18eb});var socket=require(_0x852b('0xd'))(new Redis(config[_0x852b('0xb')]));require(_0x852b('0xe'))[_0x852b('0xf')](socket);function respondWithRpcPromise(_0x2547c9,_0x3be49d,_0x10188b){return new BPromise(function(_0x5e92ac,_0x3f558c){return client['request'](_0x2547c9,_0x10188b)[_0x852b('0x10')](function(_0x18cc42){logger['info'](_0x852b('0x11'),_0x3be49d,_0x852b('0x12'));logger[_0x852b('0x13')](_0x852b('0x14'),_0x3be49d,'request\x20sent',JSON['stringify'](_0x18cc42));if(_0x18cc42[_0x852b('0x15')]){if(_0x18cc42[_0x852b('0x15')]['code']===0x1f4){logger[_0x852b('0x15')](_0x852b('0x11'),_0x3be49d,_0x18cc42['error'][_0x852b('0x16')]);return _0x3f558c(_0x18cc42['error']['message']);}logger[_0x852b('0x15')](_0x852b('0x11'),_0x3be49d,_0x18cc42[_0x852b('0x15')][_0x852b('0x16')]);return _0x5e92ac(_0x18cc42['error'][_0x852b('0x16')]);}else{logger[_0x852b('0x17')](_0x852b('0x11'),_0x3be49d,_0x852b('0x12'));_0x5e92ac(_0x18cc42[_0x852b('0x18')][_0x852b('0x16')]);}})[_0x852b('0x19')](function(_0x1884c1){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3be49d,_0x1884c1);_0x3f558c(_0x1884c1);});});}exports['CreateSmsMessage']=function(_0xed974d){var _0x9baa57=this;return new Promise(function(_0x32e968,_0xfa9ff9){return db[_0x852b('0x1a')][_0x852b('0x1b')](_0xed974d[_0x852b('0x1c')],{'raw':_0xed974d['options']?_0xed974d[_0x852b('0x1d')][_0x852b('0x1e')]===undefined?!![]:![]:!![]})[_0x852b('0x10')](function(_0x138348){logger[_0x852b('0x17')]('CreateSmsMessage',_0xed974d);logger['debug']('CreateSmsMessage',_0xed974d,JSON[_0x852b('0x1f')](_0x138348));_0x32e968(_0x138348);})[_0x852b('0x19')](function(_0x449d64){logger[_0x852b('0x15')]('CreateSmsMessage',_0x449d64[_0x852b('0x16')],_0xed974d);_0xfa9ff9(_0x9baa57[_0x852b('0x15')](0x1f4,_0x449d64['message']));});});}; \ No newline at end of file +var _0xc684=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc684,0x1be));var _0x4c68=function(_0x334c85,_0x274837){_0x334c85=_0x334c85-0x0;var _0x46ae06=_0xc684[_0x334c85];return _0x46ae06;};'use strict';var _=require(_0x4c68('0x0'));var util=require(_0x4c68('0x1'));var moment=require(_0x4c68('0x2'));var BPromise=require(_0x4c68('0x3'));var rs=require(_0x4c68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4c68('0x5'));var logger=require(_0x4c68('0x6'))(_0x4c68('0x7'));var config=require(_0x4c68('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4c68('0x9')]['http']({'port':0x232a});config[_0x4c68('0xa')]=_[_0x4c68('0xb')](config[_0x4c68('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c68('0xc'))(new Redis(config[_0x4c68('0xa')]));require('./smsMessage.socket')[_0x4c68('0xd')](socket);function respondWithRpcPromise(_0x53979f,_0x51a337,_0x2b0a71){return new BPromise(function(_0x5d17dd,_0x210993){return client[_0x4c68('0xe')](_0x53979f,_0x2b0a71)[_0x4c68('0xf')](function(_0x14385a){logger[_0x4c68('0x10')](_0x4c68('0x11'),_0x51a337,_0x4c68('0x12'));logger[_0x4c68('0x13')](_0x4c68('0x14'),_0x51a337,_0x4c68('0x12'),JSON[_0x4c68('0x15')](_0x14385a));if(_0x14385a['error']){if(_0x14385a[_0x4c68('0x16')][_0x4c68('0x17')]===0x1f4){logger[_0x4c68('0x16')](_0x4c68('0x11'),_0x51a337,_0x14385a[_0x4c68('0x16')][_0x4c68('0x18')]);return _0x210993(_0x14385a['error'][_0x4c68('0x18')]);}logger['error'](_0x4c68('0x11'),_0x51a337,_0x14385a['error'][_0x4c68('0x18')]);return _0x5d17dd(_0x14385a[_0x4c68('0x16')]['message']);}else{logger['info'](_0x4c68('0x11'),_0x51a337,_0x4c68('0x12'));_0x5d17dd(_0x14385a['result'][_0x4c68('0x18')]);}})[_0x4c68('0x19')](function(_0x1c2031){logger[_0x4c68('0x16')]('SmsMessage,\x20%s,\x20%s',_0x51a337,_0x1c2031);_0x210993(_0x1c2031);});});}exports[_0x4c68('0x1a')]=function(_0x12f64a){var _0x340f61=this;return new Promise(function(_0xc848d3,_0x2334fd){return db[_0x4c68('0x1b')][_0x4c68('0x1c')](_0x12f64a[_0x4c68('0x1d')],{'raw':_0x12f64a[_0x4c68('0x1e')]?_0x12f64a[_0x4c68('0x1e')][_0x4c68('0x1f')]===undefined?!![]:![]:!![]})[_0x4c68('0xf')](function(_0x4da0a0){logger[_0x4c68('0x10')](_0x4c68('0x1a'),_0x12f64a);logger[_0x4c68('0x13')]('CreateSmsMessage',_0x12f64a,JSON[_0x4c68('0x15')](_0x4da0a0));_0xc848d3(_0x4da0a0);})[_0x4c68('0x19')](function(_0x6cb755){logger['error'](_0x4c68('0x1a'),_0x6cb755['message'],_0x12f64a);_0x2334fd(_0x340f61['error'](0x1f4,_0x6cb755[_0x4c68('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d81209f..7e91603 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 _0xc02b=['./smsMessage.events','save','remove','emit','removeListener','smsMessage:'];(function(_0x20bd9a,_0x4d3e33){var _0x4d5f6f=function(_0x44d3f7){while(--_0x44d3f7){_0x20bd9a['push'](_0x20bd9a['shift']());}};_0x4d5f6f(++_0x4d3e33);}(_0xc02b,0x18c));var _0xbc02=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0xc02b[_0x5a1cc9];return _0x471761;};'use strict';var SmsMessageEvents=require(_0xbc02('0x0'));var events=[_0xbc02('0x1'),_0xbc02('0x2'),'update'];function createListener(_0x1749d1,_0x2419c3){return function(_0x51afdd){_0x2419c3[_0xbc02('0x3')](_0x1749d1,_0x51afdd);};}function removeListener(_0x55ad6d,_0x3a2fa9){return function(){SmsMessageEvents[_0xbc02('0x4')](_0x55ad6d,_0x3a2fa9);};}exports['register']=function(_0x47828a){for(var _0x2550a3=0x0,_0x40cac1=events['length'];_0x2550a3<_0x40cac1;_0x2550a3++){var _0x4ceaf5=events[_0x2550a3];var _0x4e75b7=createListener(_0xbc02('0x5')+_0x4ceaf5,_0x47828a);SmsMessageEvents['on'](_0x4ceaf5,_0x4e75b7);}}; \ No newline at end of file +var _0xbc7a=['remove','update','emit','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x330686,_0x493e25){var _0x5e2fa9=function(_0x3b723a){while(--_0x3b723a){_0x330686['push'](_0x330686['shift']());}};_0x5e2fa9(++_0x493e25);}(_0xbc7a,0x12e));var _0xabc7=function(_0x23dd7c,_0x37191d){_0x23dd7c=_0x23dd7c-0x0;var _0x38434f=_0xbc7a[_0x23dd7c];return _0x38434f;};'use strict';var SmsMessageEvents=require(_0xabc7('0x0'));var events=[_0xabc7('0x1'),_0xabc7('0x2'),_0xabc7('0x3')];function createListener(_0x145b10,_0x43e90b){return function(_0x3c8ec9){_0x43e90b[_0xabc7('0x4')](_0x145b10,_0x3c8ec9);};}function removeListener(_0x19026f,_0x1626d3){return function(){SmsMessageEvents['removeListener'](_0x19026f,_0x1626d3);};}exports[_0xabc7('0x5')]=function(_0x27b63a){for(var _0x3c29ce=0x0,_0x46d748=events[_0xabc7('0x6')];_0x3c29ce<_0x46d748;_0x3c29ce++){var _0x186298=events[_0x3c29ce];var _0x34c02c=createListener(_0xabc7('0x7')+_0x186298,_0x27b63a);SmsMessageEvents['on'](_0x186298,_0x34c02c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 06926ac..33b0a9f 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 _0xecd0=['post','addTeams','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0xecd0,0x162));var _0x0ecd=function(_0x361e5d,_0x15e1a4){_0x361e5d=_0x361e5d-0x0;var _0x4c303d=_0xecd0[_0x361e5d];return _0x4c303d;};'use strict';var multer=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var path=require(_0x0ecd('0x2'));var timeout=require(_0x0ecd('0x3'));var express=require(_0x0ecd('0x4'));var router=express['Router']();var fs_extra=require(_0x0ecd('0x5'));var auth=require(_0x0ecd('0x6'));var interaction=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var controller=require('./smsQueue.controller');router[_0x0ecd('0x9')]('/',auth[_0x0ecd('0xa')](),controller[_0x0ecd('0xb')]);router[_0x0ecd('0x9')](_0x0ecd('0xc'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0xd')]);router[_0x0ecd('0x9')](_0x0ecd('0xe'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0xf')]);router[_0x0ecd('0x9')](_0x0ecd('0x10'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x11')]);router['get'](_0x0ecd('0x12'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x13')]);router[_0x0ecd('0x9')](_0x0ecd('0x14'),auth['isAuthenticated'](),controller[_0x0ecd('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0ecd('0x16')]);router[_0x0ecd('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0ecd('0x18')]);router[_0x0ecd('0x17')](_0x0ecd('0x14'),auth[_0x0ecd('0xa')](),controller['addAgents']);router['put'](_0x0ecd('0xe'),auth[_0x0ecd('0xa')](),controller['update']);router['delete'](_0x0ecd('0xe'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x19')]);router['delete'](_0x0ecd('0x12'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x1a')]);router['delete'](_0x0ecd('0x14'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x1b')]);module[_0x0ecd('0x1c')]=router; \ No newline at end of file +var _0x581f=['update','delete','destroy','removeTeams','removeAgents','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','get','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id'];(function(_0x46e93f,_0x276661){var _0x17495e=function(_0x312e1c){while(--_0x312e1c){_0x46e93f['push'](_0x46e93f['shift']());}};_0x17495e(++_0x276661);}(_0x581f,0x6d));var _0xf581=function(_0x14bed4,_0x568f1a){_0x14bed4=_0x14bed4-0x0;var _0x29507f=_0x581f[_0x14bed4];return _0x29507f;};'use strict';var multer=require('multer');var util=require(_0xf581('0x0'));var path=require(_0xf581('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf581('0x2'));var auth=require(_0xf581('0x3'));var interaction=require(_0xf581('0x4'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0xf581('0x5')](),controller[_0xf581('0x6')]);router['get'](_0xf581('0x7'),auth[_0xf581('0x5')](),controller['describe']);router[_0xf581('0x8')]('/:id',auth[_0xf581('0x5')](),controller[_0xf581('0x9')]);router[_0xf581('0x8')](_0xf581('0xa'),auth[_0xf581('0x5')](),controller[_0xf581('0xb')]);router[_0xf581('0x8')](_0xf581('0xc'),auth[_0xf581('0x5')](),controller[_0xf581('0xd')]);router['get'](_0xf581('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf581('0xf')]('/',auth[_0xf581('0x5')](),controller[_0xf581('0x10')]);router['post'](_0xf581('0xc'),auth[_0xf581('0x5')](),controller[_0xf581('0x11')]);router[_0xf581('0xf')](_0xf581('0xe'),auth[_0xf581('0x5')](),controller[_0xf581('0x12')]);router[_0xf581('0x13')](_0xf581('0x14'),auth[_0xf581('0x5')](),controller[_0xf581('0x15')]);router[_0xf581('0x16')](_0xf581('0x14'),auth[_0xf581('0x5')](),controller[_0xf581('0x17')]);router[_0xf581('0x16')](_0xf581('0xc'),auth['isAuthenticated'](),controller[_0xf581('0x18')]);router[_0xf581('0x16')](_0xf581('0xe'),auth[_0xf581('0x5')](),controller[_0xf581('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 3976b69..1c13629 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 _0x6723=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6723,0xb2));var _0x3672=function(_0x522f11,_0x37fad4){_0x522f11=_0x522f11-0x0;var _0xdf42b9=_0x6723[_0x522f11];return _0xdf42b9;};'use strict';var Sequelize=require(_0x3672('0x0'));module[_0x3672('0x1')]={'name':{'type':Sequelize[_0x3672('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3672('0x2')]},'timeout':{'type':Sequelize[_0x3672('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3672('0x4')](_0x3672('0x5'),_0x3672('0x6'),_0x3672('0x7'))}}; \ No newline at end of file +var _0xbe5f=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xbe5f,0x1f4));var _0xfbe5=function(_0x5ad334,_0x4d63ec){_0x5ad334=_0x5ad334-0x0;var _0x26522c=_0xbe5f[_0x5ad334];return _0x26522c;};'use strict';var Sequelize=require(_0xfbe5('0x0'));module[_0xfbe5('0x1')]={'name':{'type':Sequelize[_0xfbe5('0x2')],'unique':_0xfbe5('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['ENUM'](_0xfbe5('0x4'),_0xfbe5('0x5'),_0xfbe5('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8e781fa..7945478 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 _0xd71f=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','SmsQueueId','UserSmsQueue','User','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','order','addTeams','ids','online','voicePause','interface','flatMap','Agents','findOrCreate','emit','userSmsQueue:save','removeTeams','field','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','userSmsQueue:remove','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','stack','name','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0xbfadd5,_0x59f51a){var _0x1f3036=function(_0x5f292e){while(--_0x5f292e){_0xbfadd5['push'](_0xbfadd5['shift']());}};_0x1f3036(++_0x59f51a);}(_0xd71f,0xcb));var _0xfd71=function(_0x309ba5,_0x3a14df){_0x309ba5=_0x309ba5-0x0;var _0x2947b2=_0xd71f[_0x309ba5];return _0x2947b2;};'use strict';var emlformat=require(_0xfd71('0x0'));var rimraf=require(_0xfd71('0x1'));var zipdir=require(_0xfd71('0x2'));var jsonpatch=require(_0xfd71('0x3'));var rp=require(_0xfd71('0x4'));var moment=require(_0xfd71('0x5'));var BPromise=require(_0xfd71('0x6'));var Mustache=require(_0xfd71('0x7'));var util=require(_0xfd71('0x8'));var path=require(_0xfd71('0x9'));var sox=require(_0xfd71('0xa'));var csv=require(_0xfd71('0xb'));var ejs=require(_0xfd71('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd71('0xd'));var squel=require('squel');var crypto=require(_0xfd71('0xe'));var jsforce=require(_0xfd71('0xf'));var deskjs=require(_0xfd71('0x10'));var toCsv=require(_0xfd71('0xb'));var querystring=require('querystring');var Papa=require(_0xfd71('0x11'));var Redis=require(_0xfd71('0x12'));var authService=require(_0xfd71('0x13'));var qs=require(_0xfd71('0x14'));var as=require(_0xfd71('0x15'));var hardwareService=require(_0xfd71('0x16'));var logger=require('../../config/logger')(_0xfd71('0x17'));var utils=require(_0xfd71('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfd71('0x19'));var db=require(_0xfd71('0x1a'))['db'];config[_0xfd71('0x1b')]=_[_0xfd71('0x1c')](config[_0xfd71('0x1b')],{'host':_0xfd71('0x1d'),'port':0x18eb});var socket=require(_0xfd71('0x1e'))(new Redis(config[_0xfd71('0x1b')]));require(_0xfd71('0x1f'))[_0xfd71('0x20')](socket);function respondWithStatusCode(_0x58a00b,_0x29d992){_0x29d992=_0x29d992||0xcc;return function(_0x479bc3){if(_0x479bc3){return _0x58a00b[_0xfd71('0x21')](_0x29d992);}return _0x58a00b[_0xfd71('0x22')](_0x29d992)['end']();};}function respondWithResult(_0x4fc905,_0x1ba210){_0x1ba210=_0x1ba210||0xc8;return function(_0x1c1661){if(_0x1c1661){return _0x4fc905[_0xfd71('0x22')](_0x1ba210)[_0xfd71('0x23')](_0x1c1661);}};}function respondWithFilteredResult(_0x406fd8,_0x498153){return function(_0x22bc6d){if(_0x22bc6d){var _0x2f5cb2=typeof _0x498153['offset']===_0xfd71('0x24')&&typeof _0x498153['limit']==='undefined';var _0x3f4016=_0x22bc6d[_0xfd71('0x25')];var _0x2e9179=_0x2f5cb2?0x0:_0x498153[_0xfd71('0x26')];var _0x41f0c5=_0x2f5cb2?_0x22bc6d['count']:_0x498153[_0xfd71('0x26')]+_0x498153[_0xfd71('0x27')];var _0x51732e;if(_0x41f0c5>=_0x3f4016){_0x41f0c5=_0x3f4016;_0x51732e=0xc8;}else{_0x51732e=0xce;}_0x406fd8['status'](_0x51732e);return _0x406fd8[_0xfd71('0x28')](_0xfd71('0x29'),_0x2e9179+'-'+_0x41f0c5+'/'+_0x3f4016)['json'](_0x22bc6d);}return null;};}function patchUpdates(_0x4773f7){return function(_0x4161a6){try{jsonpatch['apply'](_0x4161a6,_0x4773f7,!![]);}catch(_0x2fd1f5){return BPromise[_0xfd71('0x2a')](_0x2fd1f5);}return _0x4161a6[_0xfd71('0x2b')]();};}function saveUpdates(_0x142210,_0x35174d){return function(_0x2dd034){if(_0x2dd034){return _0x2dd034[_0xfd71('0x2c')](_0x142210)[_0xfd71('0x2d')](function(_0x3da52c){return _0x3da52c;});}return null;};}function removeEntity(_0x58fee8,_0x4ba845){return function(_0x4b820e){if(_0x4b820e){return _0x4b820e[_0xfd71('0x2e')]()[_0xfd71('0x2d')](function(){var _0x217f17=_0x4b820e[_0xfd71('0x2f')]({'plain':!![]});var _0x140d46=_0xfd71('0x30');return db[_0xfd71('0x31')][_0xfd71('0x2e')]({'where':{'type':_0x140d46,'resourceId':_0x217f17['id']}})[_0xfd71('0x2d')](function(){return _0x4b820e;});})['then'](function(){_0x58fee8[_0xfd71('0x22')](0xcc)[_0xfd71('0x32')]();});}};}function handleEntityNotFound(_0x1fd017,_0x12a63a){return function(_0x594fb2){if(!_0x594fb2){_0x1fd017[_0xfd71('0x21')](0x194);}return _0x594fb2;};}function handleError(_0x122775,_0x21318a){_0x21318a=_0x21318a||0x1f4;return function(_0x2f107e){logger['error'](_0x2f107e[_0xfd71('0x33')]);if(_0x2f107e[_0xfd71('0x34')]){delete _0x2f107e[_0xfd71('0x34')];}_0x122775[_0xfd71('0x22')](_0x21318a)['send'](_0x2f107e);};}exports[_0xfd71('0x35')]=function(_0xa42f43,_0x54981f){var _0x42cf26={},_0x3ceae2={},_0x374b91={'count':0x0,'rows':[]};var _0x1bbefa=_[_0xfd71('0x36')](db[_0xfd71('0x37')][_0xfd71('0x38')],function(_0x2bd0cf){return{'name':_0x2bd0cf[_0xfd71('0x39')],'type':_0x2bd0cf['type'][_0xfd71('0x3a')]};});_0x3ceae2[_0xfd71('0x3b')]=_[_0xfd71('0x36')](_0x1bbefa,_0xfd71('0x34'));_0x3ceae2[_0xfd71('0x3c')]=_[_0xfd71('0x3d')](_0xa42f43[_0xfd71('0x3c')]);_0x3ceae2[_0xfd71('0x3e')]=_[_0xfd71('0x3f')](_0x3ceae2[_0xfd71('0x3b')],_0x3ceae2['query']);_0x42cf26['attributes']=_['intersection'](_0x3ceae2[_0xfd71('0x3b')],qs[_0xfd71('0x40')](_0xa42f43[_0xfd71('0x3c')][_0xfd71('0x40')]));_0x42cf26[_0xfd71('0x41')]=_0x42cf26[_0xfd71('0x41')][_0xfd71('0x42')]?_0x42cf26[_0xfd71('0x41')]:_0x3ceae2['model'];if(!_0xa42f43['query'][_0xfd71('0x43')](_0xfd71('0x44'))){_0x42cf26['limit']=qs[_0xfd71('0x27')](_0xa42f43[_0xfd71('0x3c')][_0xfd71('0x27')]);_0x42cf26[_0xfd71('0x26')]=qs[_0xfd71('0x26')](_0xa42f43[_0xfd71('0x3c')][_0xfd71('0x26')]);}_0x42cf26['order']=qs[_0xfd71('0x45')](_0xa42f43[_0xfd71('0x3c')][_0xfd71('0x45')]);_0x42cf26['where']=qs[_0xfd71('0x3e')](_[_0xfd71('0x46')](_0xa42f43[_0xfd71('0x3c')],_0x3ceae2[_0xfd71('0x3e')]),_0x1bbefa);if(_0xa42f43['query'][_0xfd71('0x47')]){_0x42cf26[_0xfd71('0x48')]=_['merge'](_0x42cf26['where'],{'$or':_[_0xfd71('0x36')](_0x1bbefa,function(_0x59c015){if(_0x59c015[_0xfd71('0x49')]!==_0xfd71('0x4a')){var _0x1b02f3={};_0x1b02f3[_0x59c015[_0xfd71('0x34')]]={'$like':'%'+_0xa42f43['query']['filter']+'%'};return _0x1b02f3;}})});}_0x42cf26=_[_0xfd71('0x4b')]({},_0x42cf26,_0xa42f43[_0xfd71('0x4c')]);var _0x180e56={'where':_0x42cf26[_0xfd71('0x48')]};return db['SmsQueue'][_0xfd71('0x25')](_0x180e56)[_0xfd71('0x2d')](function(_0x4176df){_0x374b91[_0xfd71('0x25')]=_0x4176df;if(_0xa42f43[_0xfd71('0x3c')][_0xfd71('0x4d')]){_0x42cf26[_0xfd71('0x4e')]=[{'all':!![]}];}return db[_0xfd71('0x37')][_0xfd71('0x4f')](_0x42cf26);})[_0xfd71('0x2d')](function(_0x55116f){_0x374b91[_0xfd71('0x50')]=_0x55116f;return _0x374b91;})['then'](respondWithFilteredResult(_0x54981f,_0x42cf26))[_0xfd71('0x51')](handleError(_0x54981f,null));};exports[_0xfd71('0x52')]=function(_0x5ccb17,_0x7f3110){var _0x17a280={'raw':!![],'where':{'id':_0x5ccb17[_0xfd71('0x53')]['id']}},_0x1825b8={};_0x1825b8[_0xfd71('0x3b')]=_['keys'](db['SmsQueue'][_0xfd71('0x38')]);_0x1825b8[_0xfd71('0x3c')]=_[_0xfd71('0x3d')](_0x5ccb17[_0xfd71('0x3c')]);_0x1825b8['filters']=_['intersection'](_0x1825b8[_0xfd71('0x3b')],_0x1825b8['query']);_0x17a280[_0xfd71('0x41')]=_['intersection'](_0x1825b8[_0xfd71('0x3b')],qs[_0xfd71('0x40')](_0x5ccb17[_0xfd71('0x3c')][_0xfd71('0x40')]));_0x17a280['attributes']=_0x17a280['attributes'][_0xfd71('0x42')]?_0x17a280[_0xfd71('0x41')]:_0x1825b8[_0xfd71('0x3b')];if(_0x5ccb17[_0xfd71('0x3c')][_0xfd71('0x4d')]){_0x17a280[_0xfd71('0x4e')]=[{'all':!![]}];}_0x17a280=_[_0xfd71('0x4b')]({},_0x17a280,_0x5ccb17['options']);return db[_0xfd71('0x37')][_0xfd71('0x54')](_0x17a280)[_0xfd71('0x2d')](handleEntityNotFound(_0x7f3110,null))[_0xfd71('0x2d')](respondWithResult(_0x7f3110,null))[_0xfd71('0x51')](handleError(_0x7f3110,null));};exports[_0xfd71('0x55')]=function(_0x2a4696,_0x3feb7b){return db[_0xfd71('0x37')]['create'](_0x2a4696['body'],{})[_0xfd71('0x2d')](function(_0x4bee54){var _0x3956cf=_0x2a4696[_0xfd71('0x56')][_0xfd71('0x2f')]({'plain':!![]});if(!_0x3956cf)throw new Error(_0xfd71('0x57'));if(_0x3956cf[_0xfd71('0x58')]===_0xfd71('0x56')){var _0x40f224=_0x4bee54[_0xfd71('0x2f')]({'plain':!![]});var _0x124ba1=_0xfd71('0x30');return db[_0xfd71('0x59')][_0xfd71('0x54')]({'where':{'name':_0x124ba1,'userProfileId':_0x3956cf[_0xfd71('0x5a')]},'raw':!![]})[_0xfd71('0x2d')](function(_0x1751cd){if(_0x1751cd&&_0x1751cd[_0xfd71('0x5b')]===0x0){return db[_0xfd71('0x31')][_0xfd71('0x55')]({'name':_0x40f224['name'],'resourceId':_0x40f224['id'],'type':_0x1751cd[_0xfd71('0x34')],'sectionId':_0x1751cd['id']},{})[_0xfd71('0x2d')](function(){return _0x4bee54;});}else{return _0x4bee54;}})[_0xfd71('0x51')](function(_0x1b825d){logger[_0xfd71('0x5c')](_0xfd71('0x5d'),_0x1b825d);throw _0x1b825d;});}return _0x4bee54;})[_0xfd71('0x2d')](respondWithResult(_0x3feb7b,0xc9))[_0xfd71('0x51')](handleError(_0x3feb7b,null));};exports[_0xfd71('0x2c')]=function(_0x108f4b,_0x5df735){if(_0x108f4b['body']['id']){delete _0x108f4b[_0xfd71('0x5e')]['id'];}return db['SmsQueue'][_0xfd71('0x54')]({'where':{'id':_0x108f4b[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](handleEntityNotFound(_0x5df735,null))[_0xfd71('0x2d')](saveUpdates(_0x108f4b['body'],null))[_0xfd71('0x2d')](respondWithResult(_0x5df735,null))['catch'](handleError(_0x5df735,null));};exports[_0xfd71('0x2e')]=function(_0x1e037f,_0x136c09){return db['SmsQueue']['find']({'where':{'id':_0x1e037f[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](handleEntityNotFound(_0x136c09,null))['then'](removeEntity(_0x136c09,null))[_0xfd71('0x51')](handleError(_0x136c09,null));};exports[_0xfd71('0x5f')]=function(_0xd35712,_0x59ec77){return db[_0xfd71('0x37')][_0xfd71('0x5f')]()['then'](respondWithResult(_0x59ec77,null))[_0xfd71('0x51')](handleError(_0x59ec77,null));};exports[_0xfd71('0x60')]=function(_0x3f6622,_0x44ae44,_0x4d6cee){var _0x248dee={'raw':!![],'where':{}},_0xd26ed4={},_0x1d1bc2;return db['SmsQueue'][_0xfd71('0x61')]({'where':{'id':_0x3f6622[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](handleEntityNotFound(_0x44ae44,null))['then'](function(_0x4bcc41){if(_0x4bcc41){_0x1d1bc2=_0x4bcc41[_0xfd71('0x2f')]({'plain':!![]});_0xd26ed4['model']=_['keys'](db['UserSmsQueue'][_0xfd71('0x38')]);_0xd26ed4['query']=_[_0xfd71('0x3d')](_0x3f6622[_0xfd71('0x3c')]);_0xd26ed4[_0xfd71('0x3e')]=_[_0xfd71('0x3f')](_0xd26ed4[_0xfd71('0x3b')],_0xd26ed4[_0xfd71('0x3c')]);_0x248dee[_0xfd71('0x41')]=_[_0xfd71('0x3f')](_0xd26ed4[_0xfd71('0x3b')],qs[_0xfd71('0x40')](_0x3f6622[_0xfd71('0x3c')][_0xfd71('0x40')]));_0x248dee['attributes']=_0x248dee['attributes'][_0xfd71('0x42')]?_0x248dee[_0xfd71('0x41')]:_0xd26ed4[_0xfd71('0x3b')];if(!_0x3f6622[_0xfd71('0x3c')]['hasOwnProperty']('nolimit')){_0x248dee[_0xfd71('0x27')]=qs[_0xfd71('0x27')](_0x3f6622[_0xfd71('0x3c')][_0xfd71('0x27')]);_0x248dee[_0xfd71('0x26')]=qs[_0xfd71('0x26')](_0x3f6622[_0xfd71('0x3c')][_0xfd71('0x26')]);}_0x248dee['order']=qs['sort'](_0x3f6622[_0xfd71('0x3c')][_0xfd71('0x45')]);_0x248dee[_0xfd71('0x48')]=qs[_0xfd71('0x3e')](_[_0xfd71('0x46')](_0x3f6622[_0xfd71('0x3c')],_0xd26ed4[_0xfd71('0x3e')]));_0x248dee['where'][_0xfd71('0x62')]=_0x4bcc41['id'];if(_0x3f6622['query'][_0xfd71('0x47')]){_0x248dee[_0xfd71('0x48')]=_['merge'](_0x248dee['where'],{'$or':_[_0xfd71('0x36')](_0x248dee[_0xfd71('0x41')],function(_0x2ad68c){var _0x4dfb84={};_0x4dfb84[_0x2ad68c]={'$like':'%'+_0x3f6622[_0xfd71('0x3c')][_0xfd71('0x47')]+'%'};return _0x4dfb84;})});}_0x248dee=_[_0xfd71('0x4b')]({},_0x248dee,_0x3f6622['options']);return db[_0xfd71('0x63')][_0xfd71('0x4f')](_0x248dee);}})[_0xfd71('0x2d')](function(_0x2867bb){if(_0x2867bb){return db[_0xfd71('0x64')]['findAndCountAll']({'where':{'id':_[_0xfd71('0x36')](_0x2867bb,_0xfd71('0x65')),'role':_0xfd71('0x66')},'attributes':['id',_0xfd71('0x34'),_0xfd71('0x67'),_0xfd71('0x68'),'createdAt']});}})['then'](function(_0x11c2bb){if(_0x11c2bb){return{'count':_0x11c2bb[_0xfd71('0x25')],'rows':_[_0xfd71('0x36')](_0x11c2bb['rows'],function(_0x1af8a8){return{'membername':_0x1af8a8[_0xfd71('0x34')],'UserId':_0x1af8a8['id'],'queue_name':_0x1d1bc2[_0xfd71('0x34')],'SmsQueueId':_0x1d1bc2['id'],'interface':util[_0xfd71('0x69')](_0xfd71('0x6a'),_0xfd71('0x6b'),_0x1af8a8['name']),'penalty':0x0,'paused':_0x1af8a8['smsPause'],'createdAt':_0x1af8a8[_0xfd71('0x6c')],'updatedAt':_0x1af8a8[_0xfd71('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfd71('0x2d')](respondWithFilteredResult(_0x44ae44,_0x248dee))[_0xfd71('0x51')](handleError(_0x44ae44,null));};exports[_0xfd71('0x6d')]=function(_0x22c761,_0x593b57,_0x23c90e){var _0x20356e={};var _0x25af14={};var _0x644278;var _0x10916d;return db[_0xfd71('0x37')][_0xfd71('0x61')]({'where':{'id':_0x22c761[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](handleEntityNotFound(_0x593b57,null))[_0xfd71('0x2d')](function(_0x39fb1c){if(_0x39fb1c){_0x644278=_0x39fb1c;_0x25af14[_0xfd71('0x3b')]=_[_0xfd71('0x3d')](db[_0xfd71('0x6e')][_0xfd71('0x38')]);_0x25af14['query']=_[_0xfd71('0x3d')](_0x22c761[_0xfd71('0x3c')]);_0x25af14[_0xfd71('0x3e')]=_[_0xfd71('0x3f')](_0x25af14[_0xfd71('0x3b')],_0x25af14[_0xfd71('0x3c')]);_0x20356e[_0xfd71('0x41')]=_[_0xfd71('0x3f')](_0x25af14[_0xfd71('0x3b')],qs[_0xfd71('0x40')](_0x22c761[_0xfd71('0x3c')]['fields']));_0x20356e[_0xfd71('0x41')]=_0x20356e[_0xfd71('0x41')][_0xfd71('0x42')]?_0x20356e['attributes']:_0x25af14[_0xfd71('0x3b')];_0x20356e[_0xfd71('0x6f')]=qs['sort'](_0x22c761[_0xfd71('0x3c')]['sort']);_0x20356e[_0xfd71('0x48')]=qs[_0xfd71('0x3e')](_[_0xfd71('0x46')](_0x22c761['query'],_0x25af14['filters']));if(_0x22c761['query']['filter']){_0x20356e[_0xfd71('0x48')]=_[_0xfd71('0x4b')](_0x20356e[_0xfd71('0x48')],{'$or':_[_0xfd71('0x36')](_0x20356e[_0xfd71('0x41')],function(_0x561fcc){var _0x1840c3={};_0x1840c3[_0x561fcc]={'$like':'%'+_0x22c761[_0xfd71('0x3c')][_0xfd71('0x47')]+'%'};return _0x1840c3;})});}_0x20356e=_[_0xfd71('0x4b')]({},_0x20356e,_0x22c761[_0xfd71('0x4c')]);return _0x644278[_0xfd71('0x6d')](_0x20356e);}})[_0xfd71('0x2d')](function(_0x16150d){if(_0x16150d){_0x10916d=_0x16150d['length'];if(!_0x22c761[_0xfd71('0x3c')]['hasOwnProperty'](_0xfd71('0x44'))){_0x20356e['limit']=qs[_0xfd71('0x27')](_0x22c761[_0xfd71('0x3c')][_0xfd71('0x27')]);_0x20356e['offset']=qs[_0xfd71('0x26')](_0x22c761[_0xfd71('0x3c')][_0xfd71('0x26')]);}return _0x644278[_0xfd71('0x6d')](_0x20356e);}})[_0xfd71('0x2d')](function(_0x513e4e){if(_0x513e4e){return _0x513e4e?{'count':_0x10916d,'rows':_0x513e4e}:null;}})[_0xfd71('0x2d')](respondWithResult(_0x593b57,null))[_0xfd71('0x51')](handleError(_0x593b57,null));};exports[_0xfd71('0x70')]=function(_0x1a1ff5,_0x1f4476,_0x7bd988){var _0x2201c3=_0x1a1ff5['body'][_0xfd71('0x71')];return db[_0xfd71('0x6e')]['findAll']({'where':{'id':_0x2201c3},'attributes':['id'],'include':[{'model':db[_0xfd71('0x64')],'as':'Agents','attributes':['id','name',_0xfd71('0x72'),_0xfd71('0x73'),_0xfd71('0x74')],'raw':!![]}]})[_0xfd71('0x2d')](function(_0x28b3b8){if(_0x28b3b8){var _0x4c05f3=_[_0xfd71('0x75')](_0x28b3b8,function(_0x35dcb9){var _0x3b18fe=_0x35dcb9[_0xfd71('0x2f')]({'plain':!![]});return _0x3b18fe[_0xfd71('0x76')];});return db[_0xfd71('0x37')][_0xfd71('0x54')]({'where':{'id':_0x1a1ff5[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](function(_0x46256d){return db['sequelize']['transaction'](function(_0x7c897e){return _0x46256d[_0xfd71('0x70')](_0x2201c3,{'transaction':_0x7c897e})[_0xfd71('0x2d')](function(){return BPromise['each'](_0x4c05f3,function(_0x1f7b53){return db[_0xfd71('0x63')][_0xfd71('0x77')]({'where':{'UserId':_0x1f7b53['id'],'SmsQueueId':_0x1a1ff5[_0xfd71('0x53')]['id']},'transaction':_0x7c897e});});})[_0xfd71('0x2d')](function(){_0x4c05f3['forEach'](function(_0x4242af){socket[_0xfd71('0x78')](_0xfd71('0x79'),{'UserId':_0x4242af['id'],'SmsQueueId':_0x46256d['id']});});});});});}})[_0xfd71('0x2d')](respondWithStatusCode(_0x1f4476,null))[_0xfd71('0x51')](handleError(_0x1f4476,null));};exports[_0xfd71('0x7a')]=function(_0x5001b0,_0x423745,_0x2e5c25){return db[_0xfd71('0x6e')][_0xfd71('0x4f')]({'where':{'id':_0x5001b0[_0xfd71('0x3c')][_0xfd71('0x71')]},'attributes':['id'],'include':[{'model':db[_0xfd71('0x64')],'as':_0xfd71('0x76'),'attributes':['id'],'raw':!![]}]})[_0xfd71('0x2d')](handleEntityNotFound(_0x423745,null))[_0xfd71('0x2d')](function(_0x15645f){var _0x2d463a=_['map'](_0x15645f,'id');var _0x59e773=[];var _0x53ada3=[];var _0x123929=squel['select']();_0x123929[_0xfd71('0x7b')]('tq.TeamId')[_0xfd71('0x7c')]('team_has_sms_queues','tq')[_0xfd71('0x7d')](_0xfd71('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfd71('0x48')]('SmsQueueId\x20=\x20?',_0x5001b0[_0xfd71('0x53')]['id']);for(var _0x1f7f3c=0x0;_0x1f7f3c<_0x15645f[_0xfd71('0x42')];_0x1f7f3c+=0x1){let _0x5e9867=_0x15645f[_0x1f7f3c];for(var _0xd5cd31=0x0;_0xd5cd31<_0x5e9867[_0xfd71('0x76')][_0xfd71('0x42')];_0xd5cd31+=0x1){let _0xf998f0=_0x5e9867[_0xfd71('0x76')][_0xd5cd31];var _0x3bae90=_0x123929[_0xfd71('0x7f')]();_0x3bae90[_0xfd71('0x48')](_0xfd71('0x80'),_0xf998f0['id']);_0x53ada3[_0xfd71('0x81')](db[_0xfd71('0x82')][_0xfd71('0x3c')](_0x3bae90[_0xfd71('0x83')](),{'type':db[_0xfd71('0x82')][_0xfd71('0x84')][_0xfd71('0x85')]})[_0xfd71('0x2d')](function(_0x90ebee){if(_0x90ebee[_0xfd71('0x42')]===0x1){return _0xf998f0['id'];}else{var _0x492ac9=_['every'](_[_0xfd71('0x36')](_0x90ebee,_0xfd71('0x86')),function(_0x54d14e){return _[_0xfd71('0x87')](_0x2d463a,_0x54d14e);});if(_0x492ac9){return _0xf998f0['id'];}}}));}}return BPromise[_0xfd71('0x88')](_0x53ada3)['then'](function(_0x97c3e9){_0x59e773=_(_0x59e773)[_0xfd71('0x89')](_0x97c3e9)[_0xfd71('0x8a')]()[_0xfd71('0x8b')]();return db['SmsQueue'][_0xfd71('0x54')]({'where':{'id':_0x5001b0[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](function(_0x240b7e){return db[_0xfd71('0x82')][_0xfd71('0x8c')](function(_0x5f382d){return _0x240b7e[_0xfd71('0x7a')](_0x5001b0['query']['ids'],{'transaction':_0x5f382d})['then'](function(){if(!_[_0xfd71('0x8d')](_0x59e773)){return _0x240b7e[_0xfd71('0x8e')](_0x59e773,{'transaction':_0x5f382d});}})[_0xfd71('0x2d')](function(){_0x59e773[_0xfd71('0x8f')](function(_0xb83f5a){socket[_0xfd71('0x78')](_0xfd71('0x90'),{'UserId':_0xb83f5a,'SmsQueueId':_0x240b7e['id']});});});});});});})['then'](respondWithStatusCode(_0x423745,null))[_0xfd71('0x51')](handleError(_0x423745,null));};exports['addAgents']=function(_0x535837,_0x10b758,_0x1d58d9){return db[_0xfd71('0x37')][_0xfd71('0x54')]({'where':{'id':_0x535837[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](handleEntityNotFound(_0x10b758,null))['then'](function(_0x4f08a8){if(_0x4f08a8){return _0x4f08a8['addAgents'](_0x535837[_0xfd71('0x5e')][_0xfd71('0x71')],_[_0xfd71('0x91')](_0x535837[_0xfd71('0x5e')],[_0xfd71('0x71'),'id'])||{})['spread'](function(_0x346577){for(var _0x48fce7=0x0;_0x48fce7<_0x535837[_0xfd71('0x5e')][_0xfd71('0x71')][_0xfd71('0x42')];_0x48fce7+=0x1){socket[_0xfd71('0x78')](_0xfd71('0x79'),{'UserId':Number(_0x535837[_0xfd71('0x5e')][_0xfd71('0x71')][_0x48fce7]),'SmsQueueId':Number(_0x535837['params']['id'])});}return _0x346577;});}})['then'](respondWithResult(_0x10b758,null))['catch'](handleError(_0x10b758,null));};exports[_0xfd71('0x8e')]=function(_0x18d65f,_0x286309,_0x18cac5){return db[_0xfd71('0x37')][_0xfd71('0x54')]({'where':{'id':_0x18d65f[_0xfd71('0x53')]['id']}})['then'](handleEntityNotFound(_0x286309,null))[_0xfd71('0x2d')](function(_0x1039ac){if(_0x1039ac){return _0x1039ac[_0xfd71('0x8e')](_0x18d65f['query'][_0xfd71('0x71')])[_0xfd71('0x2d')](function(){if(_[_0xfd71('0x92')](_0x18d65f[_0xfd71('0x3c')]['ids'])){for(var _0xfb81ba=0x0;_0xfb81ba<_0x18d65f[_0xfd71('0x3c')][_0xfd71('0x71')][_0xfd71('0x42')];_0xfb81ba+=0x1){socket['emit'](_0xfd71('0x90'),{'UserId':Number(_0x18d65f[_0xfd71('0x3c')][_0xfd71('0x71')][_0xfb81ba]),'SmsQueueId':Number(_0x18d65f[_0xfd71('0x53')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x18d65f[_0xfd71('0x3c')]['ids']),'SmsQueueId':Number(_0x18d65f[_0xfd71('0x53')]['id'])});}});}})[_0xfd71('0x2d')](respondWithStatusCode(_0x286309,null))[_0xfd71('0x51')](handleError(_0x286309,null));};exports[_0xfd71('0x93')]=function(_0x21ee3e,_0x285941,_0xaf726a){var _0x594ef8={};var _0x19d7c3={};var _0x4ebb46;var _0x1fdfeb;return db[_0xfd71('0x37')][_0xfd71('0x61')]({'where':{'id':_0x21ee3e[_0xfd71('0x53')]['id']}})[_0xfd71('0x2d')](handleEntityNotFound(_0x285941,null))[_0xfd71('0x2d')](function(_0x43ad8e){if(_0x43ad8e){_0x4ebb46=_0x43ad8e;_0x19d7c3[_0xfd71('0x3b')]=_['keys'](db[_0xfd71('0x64')][_0xfd71('0x38')]);_0x19d7c3[_0xfd71('0x3c')]=_[_0xfd71('0x3d')](_0x21ee3e[_0xfd71('0x3c')]);_0x19d7c3['filters']=_[_0xfd71('0x3f')](_0x19d7c3[_0xfd71('0x3b')],_0x19d7c3[_0xfd71('0x3c')]);_0x594ef8['attributes']=_[_0xfd71('0x3f')](_0x19d7c3[_0xfd71('0x3b')],qs[_0xfd71('0x40')](_0x21ee3e[_0xfd71('0x3c')]['fields']));_0x594ef8['attributes']=_0x594ef8[_0xfd71('0x41')][_0xfd71('0x42')]?_0x594ef8['attributes']:_0x19d7c3[_0xfd71('0x3b')];_0x594ef8['order']=qs[_0xfd71('0x45')](_0x21ee3e['query'][_0xfd71('0x45')]);_0x594ef8[_0xfd71('0x48')]=qs[_0xfd71('0x3e')](_['pick'](_0x21ee3e[_0xfd71('0x3c')],_0x19d7c3[_0xfd71('0x3e')]));if(_0x21ee3e[_0xfd71('0x3c')][_0xfd71('0x47')]){_0x594ef8['where']=_[_0xfd71('0x4b')](_0x594ef8['where'],{'$or':_[_0xfd71('0x36')](_0x594ef8[_0xfd71('0x41')],function(_0x59f2e7){var _0x2764f1={};_0x2764f1[_0x59f2e7]={'$like':'%'+_0x21ee3e['query'][_0xfd71('0x47')]+'%'};return _0x2764f1;})});}_0x594ef8=_['merge']({},_0x594ef8,_0x21ee3e['options']);return _0x4ebb46[_0xfd71('0x93')](_0x594ef8);}})[_0xfd71('0x2d')](function(_0x34ec9c){if(_0x34ec9c){_0x1fdfeb=_0x34ec9c[_0xfd71('0x42')];if(!_0x21ee3e[_0xfd71('0x3c')][_0xfd71('0x43')]('nolimit')){_0x594ef8['limit']=qs[_0xfd71('0x27')](_0x21ee3e[_0xfd71('0x3c')][_0xfd71('0x27')]);_0x594ef8[_0xfd71('0x26')]=qs[_0xfd71('0x26')](_0x21ee3e[_0xfd71('0x3c')]['offset']);}return _0x4ebb46[_0xfd71('0x93')](_0x594ef8);}})['then'](function(_0x3312be){if(_0x3312be){return _0x3312be?{'count':_0x1fdfeb,'rows':_0x3312be}:null;}})[_0xfd71('0x2d')](respondWithResult(_0x285941,null))[_0xfd71('0x51')](handleError(_0x285941,null));}; \ No newline at end of file +var _0x4ef9=['getTeams','addTeams','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','ids','Agents','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','UserProfileResource','end','error','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','fields','attributes','length','nolimit','order','sort','filter','merge','where','options','then','includeAll','include','findAll','rows','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','pick','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','Team'];(function(_0x27e047,_0x4f4c53){var _0x19d572=function(_0x29d54d){while(--_0x29d54d){_0x27e047['push'](_0x27e047['shift']());}};_0x19d572(++_0x4f4c53);}(_0x4ef9,0x144));var _0x94ef=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x4ef9[_0x363ef8];return _0x148822;};'use strict';var emlformat=require(_0x94ef('0x0'));var rimraf=require(_0x94ef('0x1'));var zipdir=require(_0x94ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94ef('0x3'));var moment=require(_0x94ef('0x4'));var BPromise=require(_0x94ef('0x5'));var Mustache=require('mustache');var util=require(_0x94ef('0x6'));var path=require(_0x94ef('0x7'));var sox=require('sox');var csv=require(_0x94ef('0x8'));var ejs=require(_0x94ef('0x9'));var fs=require('fs');var fs_extra=require(_0x94ef('0xa'));var _=require(_0x94ef('0xb'));var squel=require(_0x94ef('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x94ef('0xd'));var toCsv=require(_0x94ef('0x8'));var querystring=require(_0x94ef('0xe'));var Papa=require(_0x94ef('0xf'));var Redis=require(_0x94ef('0x10'));var authService=require(_0x94ef('0x11'));var qs=require(_0x94ef('0x12'));var as=require(_0x94ef('0x13'));var hardwareService=require(_0x94ef('0x14'));var logger=require('../../config/logger')(_0x94ef('0x15'));var utils=require(_0x94ef('0x16'));var config=require(_0x94ef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x94ef('0x18'))['db'];config[_0x94ef('0x19')]=_[_0x94ef('0x1a')](config[_0x94ef('0x19')],{'host':_0x94ef('0x1b'),'port':0x18eb});var socket=require(_0x94ef('0x1c'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x94ef('0x1d')](socket);function respondWithStatusCode(_0x5ab3ba,_0x38c4d1){_0x38c4d1=_0x38c4d1||0xcc;return function(_0x207b6a){if(_0x207b6a){return _0x5ab3ba[_0x94ef('0x1e')](_0x38c4d1);}return _0x5ab3ba[_0x94ef('0x1f')](_0x38c4d1)['end']();};}function respondWithResult(_0x3128fd,_0x487147){_0x487147=_0x487147||0xc8;return function(_0x595e11){if(_0x595e11){return _0x3128fd[_0x94ef('0x1f')](_0x487147)[_0x94ef('0x20')](_0x595e11);}};}function respondWithFilteredResult(_0x1f8ee3,_0x25f829){return function(_0x56f406){if(_0x56f406){var _0x1b217d=typeof _0x25f829[_0x94ef('0x21')]===_0x94ef('0x22')&&typeof _0x25f829[_0x94ef('0x23')]==='undefined';var _0x407298=_0x56f406['count'];var _0x1120b2=_0x1b217d?0x0:_0x25f829[_0x94ef('0x21')];var _0x21951d=_0x1b217d?_0x56f406[_0x94ef('0x24')]:_0x25f829[_0x94ef('0x21')]+_0x25f829[_0x94ef('0x23')];var _0x332544;if(_0x21951d>=_0x407298){_0x21951d=_0x407298;_0x332544=0xc8;}else{_0x332544=0xce;}_0x1f8ee3[_0x94ef('0x1f')](_0x332544);return _0x1f8ee3['set'](_0x94ef('0x25'),_0x1120b2+'-'+_0x21951d+'/'+_0x407298)[_0x94ef('0x20')](_0x56f406);}return null;};}function patchUpdates(_0x12b039){return function(_0x193c73){try{jsonpatch[_0x94ef('0x26')](_0x193c73,_0x12b039,!![]);}catch(_0xb2781){return BPromise[_0x94ef('0x27')](_0xb2781);}return _0x193c73[_0x94ef('0x28')]();};}function saveUpdates(_0x368f7b,_0x2c95c2){return function(_0x1aa7b3){if(_0x1aa7b3){return _0x1aa7b3[_0x94ef('0x29')](_0x368f7b)['then'](function(_0x46f856){return _0x46f856;});}return null;};}function removeEntity(_0x3d4adc,_0x561a3c){return function(_0xbee12d){if(_0xbee12d){return _0xbee12d['destroy']()['then'](function(){var _0x4c5714=_0xbee12d[_0x94ef('0x2a')]({'plain':!![]});var _0x5b9a41='SmsQueues';return db[_0x94ef('0x2b')]['destroy']({'where':{'type':_0x5b9a41,'resourceId':_0x4c5714['id']}})['then'](function(){return _0xbee12d;});})['then'](function(){_0x3d4adc['status'](0xcc)[_0x94ef('0x2c')]();});}};}function handleEntityNotFound(_0x266fb4,_0x22abf9){return function(_0x3efca1){if(!_0x3efca1){_0x266fb4[_0x94ef('0x1e')](0x194);}return _0x3efca1;};}function handleError(_0x15dda0,_0xfb3ea){_0xfb3ea=_0xfb3ea||0x1f4;return function(_0x158512){logger[_0x94ef('0x2d')](_0x158512['stack']);if(_0x158512[_0x94ef('0x2e')]){delete _0x158512[_0x94ef('0x2e')];}_0x15dda0[_0x94ef('0x1f')](_0xfb3ea)[_0x94ef('0x2f')](_0x158512);};}exports[_0x94ef('0x30')]=function(_0x30e8b4,_0x14028e){var _0x3be071={},_0x4ec3f2={},_0x792849={'count':0x0,'rows':[]};var _0x45e46b=_['map'](db[_0x94ef('0x31')][_0x94ef('0x32')],function(_0x204a18){return{'name':_0x204a18[_0x94ef('0x33')],'type':_0x204a18[_0x94ef('0x34')][_0x94ef('0x35')]};});_0x4ec3f2[_0x94ef('0x36')]=_[_0x94ef('0x37')](_0x45e46b,_0x94ef('0x2e'));_0x4ec3f2[_0x94ef('0x38')]=_[_0x94ef('0x39')](_0x30e8b4[_0x94ef('0x38')]);_0x4ec3f2[_0x94ef('0x3a')]=_['intersection'](_0x4ec3f2['model'],_0x4ec3f2[_0x94ef('0x38')]);_0x3be071['attributes']=_['intersection'](_0x4ec3f2[_0x94ef('0x36')],qs[_0x94ef('0x3b')](_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x3b')]));_0x3be071[_0x94ef('0x3c')]=_0x3be071[_0x94ef('0x3c')][_0x94ef('0x3d')]?_0x3be071[_0x94ef('0x3c')]:_0x4ec3f2[_0x94ef('0x36')];if(!_0x30e8b4[_0x94ef('0x38')]['hasOwnProperty'](_0x94ef('0x3e'))){_0x3be071[_0x94ef('0x23')]=qs[_0x94ef('0x23')](_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x23')]);_0x3be071[_0x94ef('0x21')]=qs[_0x94ef('0x21')](_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x21')]);}_0x3be071[_0x94ef('0x3f')]=qs[_0x94ef('0x40')](_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x40')]);_0x3be071['where']=qs['filters'](_['pick'](_0x30e8b4[_0x94ef('0x38')],_0x4ec3f2['filters']),_0x45e46b);if(_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x41')]){_0x3be071['where']=_[_0x94ef('0x42')](_0x3be071[_0x94ef('0x43')],{'$or':_[_0x94ef('0x37')](_0x45e46b,function(_0x58eba){if(_0x58eba[_0x94ef('0x34')]!=='VIRTUAL'){var _0x19d7ac={};_0x19d7ac[_0x58eba['name']]={'$like':'%'+_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x41')]+'%'};return _0x19d7ac;}})});}_0x3be071=_[_0x94ef('0x42')]({},_0x3be071,_0x30e8b4[_0x94ef('0x44')]);var _0x5850fa={'where':_0x3be071['where']};return db['SmsQueue'][_0x94ef('0x24')](_0x5850fa)[_0x94ef('0x45')](function(_0x41ac0d){_0x792849[_0x94ef('0x24')]=_0x41ac0d;if(_0x30e8b4[_0x94ef('0x38')][_0x94ef('0x46')]){_0x3be071[_0x94ef('0x47')]=[{'all':!![]}];}return db[_0x94ef('0x31')][_0x94ef('0x48')](_0x3be071);})[_0x94ef('0x45')](function(_0x2226e5){_0x792849[_0x94ef('0x49')]=_0x2226e5;return _0x792849;})[_0x94ef('0x45')](respondWithFilteredResult(_0x14028e,_0x3be071))['catch'](handleError(_0x14028e,null));};exports['show']=function(_0x5eb155,_0x10241c){var _0x3da43d={'raw':!![],'where':{'id':_0x5eb155['params']['id']}},_0x1beb89={};_0x1beb89[_0x94ef('0x36')]=_[_0x94ef('0x39')](db[_0x94ef('0x31')][_0x94ef('0x32')]);_0x1beb89[_0x94ef('0x38')]=_[_0x94ef('0x39')](_0x5eb155[_0x94ef('0x38')]);_0x1beb89[_0x94ef('0x3a')]=_[_0x94ef('0x4a')](_0x1beb89[_0x94ef('0x36')],_0x1beb89[_0x94ef('0x38')]);_0x3da43d['attributes']=_[_0x94ef('0x4a')](_0x1beb89[_0x94ef('0x36')],qs[_0x94ef('0x3b')](_0x5eb155[_0x94ef('0x38')]['fields']));_0x3da43d['attributes']=_0x3da43d[_0x94ef('0x3c')][_0x94ef('0x3d')]?_0x3da43d[_0x94ef('0x3c')]:_0x1beb89[_0x94ef('0x36')];if(_0x5eb155[_0x94ef('0x38')]['includeAll']){_0x3da43d[_0x94ef('0x47')]=[{'all':!![]}];}_0x3da43d=_['merge']({},_0x3da43d,_0x5eb155[_0x94ef('0x44')]);return db[_0x94ef('0x31')]['find'](_0x3da43d)[_0x94ef('0x45')](handleEntityNotFound(_0x10241c,null))[_0x94ef('0x45')](respondWithResult(_0x10241c,null))[_0x94ef('0x4b')](handleError(_0x10241c,null));};exports[_0x94ef('0x4c')]=function(_0x20e3c3,_0x452fac){return db[_0x94ef('0x31')][_0x94ef('0x4c')](_0x20e3c3[_0x94ef('0x4d')],{})[_0x94ef('0x45')](function(_0x3843d8){var _0x4a2a1a=_0x20e3c3[_0x94ef('0x4e')][_0x94ef('0x2a')]({'plain':!![]});if(!_0x4a2a1a)throw new Error(_0x94ef('0x4f'));if(_0x4a2a1a[_0x94ef('0x50')]===_0x94ef('0x4e')){var _0x1c7f05=_0x3843d8[_0x94ef('0x2a')]({'plain':!![]});var _0x52ee83=_0x94ef('0x51');return db[_0x94ef('0x52')][_0x94ef('0x53')]({'where':{'name':_0x52ee83,'userProfileId':_0x4a2a1a['userProfileId']},'raw':!![]})[_0x94ef('0x45')](function(_0xa3f62d){if(_0xa3f62d&&_0xa3f62d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1c7f05['name'],'resourceId':_0x1c7f05['id'],'type':_0xa3f62d['name'],'sectionId':_0xa3f62d['id']},{})[_0x94ef('0x45')](function(){return _0x3843d8;});}else{return _0x3843d8;}})[_0x94ef('0x4b')](function(_0x1b0e1f){logger['error'](_0x94ef('0x54'),_0x1b0e1f);throw _0x1b0e1f;});}return _0x3843d8;})[_0x94ef('0x45')](respondWithResult(_0x452fac,0xc9))['catch'](handleError(_0x452fac,null));};exports['update']=function(_0x22fee2,_0x36c435){if(_0x22fee2[_0x94ef('0x4d')]['id']){delete _0x22fee2[_0x94ef('0x4d')]['id'];}return db[_0x94ef('0x31')][_0x94ef('0x53')]({'where':{'id':_0x22fee2['params']['id']}})['then'](handleEntityNotFound(_0x36c435,null))[_0x94ef('0x45')](saveUpdates(_0x22fee2[_0x94ef('0x4d')],null))[_0x94ef('0x45')](respondWithResult(_0x36c435,null))[_0x94ef('0x4b')](handleError(_0x36c435,null));};exports[_0x94ef('0x55')]=function(_0x154d24,_0x2851de){return db[_0x94ef('0x31')][_0x94ef('0x53')]({'where':{'id':_0x154d24[_0x94ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x2851de,null))[_0x94ef('0x45')](removeEntity(_0x2851de,null))[_0x94ef('0x4b')](handleError(_0x2851de,null));};exports[_0x94ef('0x57')]=function(_0x20db25,_0x499c0e){return db[_0x94ef('0x31')][_0x94ef('0x57')]()[_0x94ef('0x45')](respondWithResult(_0x499c0e,null))[_0x94ef('0x4b')](handleError(_0x499c0e,null));};exports[_0x94ef('0x58')]=function(_0x1a62d3,_0x4606f1,_0x210116){var _0x13f64f={'raw':!![],'where':{}},_0x553269={},_0xe3e03b;return db[_0x94ef('0x31')][_0x94ef('0x59')]({'where':{'id':_0x1a62d3[_0x94ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x4606f1,null))[_0x94ef('0x45')](function(_0x1ea502){if(_0x1ea502){_0xe3e03b=_0x1ea502[_0x94ef('0x2a')]({'plain':!![]});_0x553269[_0x94ef('0x36')]=_[_0x94ef('0x39')](db[_0x94ef('0x5a')][_0x94ef('0x32')]);_0x553269['query']=_[_0x94ef('0x39')](_0x1a62d3[_0x94ef('0x38')]);_0x553269[_0x94ef('0x3a')]=_[_0x94ef('0x4a')](_0x553269['model'],_0x553269['query']);_0x13f64f[_0x94ef('0x3c')]=_['intersection'](_0x553269['model'],qs[_0x94ef('0x3b')](_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x3b')]));_0x13f64f[_0x94ef('0x3c')]=_0x13f64f['attributes'][_0x94ef('0x3d')]?_0x13f64f[_0x94ef('0x3c')]:_0x553269[_0x94ef('0x36')];if(!_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x5b')]('nolimit')){_0x13f64f['limit']=qs[_0x94ef('0x23')](_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x23')]);_0x13f64f[_0x94ef('0x21')]=qs[_0x94ef('0x21')](_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x21')]);}_0x13f64f[_0x94ef('0x3f')]=qs['sort'](_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x40')]);_0x13f64f[_0x94ef('0x43')]=qs[_0x94ef('0x3a')](_[_0x94ef('0x5c')](_0x1a62d3[_0x94ef('0x38')],_0x553269[_0x94ef('0x3a')]));_0x13f64f[_0x94ef('0x43')][_0x94ef('0x5d')]=_0x1ea502['id'];if(_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x41')]){_0x13f64f['where']=_[_0x94ef('0x42')](_0x13f64f[_0x94ef('0x43')],{'$or':_[_0x94ef('0x37')](_0x13f64f[_0x94ef('0x3c')],function(_0x2f2759){var _0x2dd2a8={};_0x2dd2a8[_0x2f2759]={'$like':'%'+_0x1a62d3[_0x94ef('0x38')][_0x94ef('0x41')]+'%'};return _0x2dd2a8;})});}_0x13f64f=_[_0x94ef('0x42')]({},_0x13f64f,_0x1a62d3[_0x94ef('0x44')]);return db[_0x94ef('0x5a')][_0x94ef('0x48')](_0x13f64f);}})['then'](function(_0x209d5c){if(_0x209d5c){return db[_0x94ef('0x5e')][_0x94ef('0x5f')]({'where':{'id':_[_0x94ef('0x37')](_0x209d5c,_0x94ef('0x60')),'role':_0x94ef('0x61')},'attributes':['id',_0x94ef('0x2e'),_0x94ef('0x62'),_0x94ef('0x63'),'createdAt']});}})['then'](function(_0x39b3c6){if(_0x39b3c6){return{'count':_0x39b3c6['count'],'rows':_[_0x94ef('0x37')](_0x39b3c6[_0x94ef('0x49')],function(_0x1e13c3){return{'membername':_0x1e13c3[_0x94ef('0x2e')],'UserId':_0x1e13c3['id'],'queue_name':_0xe3e03b[_0x94ef('0x2e')],'SmsQueueId':_0xe3e03b['id'],'interface':util[_0x94ef('0x64')](_0x94ef('0x65'),_0x94ef('0x66'),_0x1e13c3['name']),'penalty':0x0,'paused':_0x1e13c3['smsPause'],'createdAt':_0x1e13c3[_0x94ef('0x67')],'updatedAt':_0x1e13c3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4606f1,_0x13f64f))[_0x94ef('0x4b')](handleError(_0x4606f1,null));};exports['getTeams']=function(_0x5f4e83,_0x89a601,_0x140452){var _0x31e793={};var _0x2ce686={};var _0x46b9d0;var _0x543a40;return db['SmsQueue']['findOne']({'where':{'id':_0x5f4e83[_0x94ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x89a601,null))[_0x94ef('0x45')](function(_0x2f48e7){if(_0x2f48e7){_0x46b9d0=_0x2f48e7;_0x2ce686[_0x94ef('0x36')]=_['keys'](db[_0x94ef('0x68')][_0x94ef('0x32')]);_0x2ce686[_0x94ef('0x38')]=_[_0x94ef('0x39')](_0x5f4e83['query']);_0x2ce686[_0x94ef('0x3a')]=_[_0x94ef('0x4a')](_0x2ce686[_0x94ef('0x36')],_0x2ce686[_0x94ef('0x38')]);_0x31e793[_0x94ef('0x3c')]=_['intersection'](_0x2ce686[_0x94ef('0x36')],qs[_0x94ef('0x3b')](_0x5f4e83['query']['fields']));_0x31e793[_0x94ef('0x3c')]=_0x31e793['attributes'][_0x94ef('0x3d')]?_0x31e793[_0x94ef('0x3c')]:_0x2ce686[_0x94ef('0x36')];_0x31e793['order']=qs[_0x94ef('0x40')](_0x5f4e83[_0x94ef('0x38')][_0x94ef('0x40')]);_0x31e793[_0x94ef('0x43')]=qs[_0x94ef('0x3a')](_[_0x94ef('0x5c')](_0x5f4e83[_0x94ef('0x38')],_0x2ce686['filters']));if(_0x5f4e83[_0x94ef('0x38')][_0x94ef('0x41')]){_0x31e793[_0x94ef('0x43')]=_[_0x94ef('0x42')](_0x31e793[_0x94ef('0x43')],{'$or':_[_0x94ef('0x37')](_0x31e793[_0x94ef('0x3c')],function(_0x10e393){var _0x4d3444={};_0x4d3444[_0x10e393]={'$like':'%'+_0x5f4e83[_0x94ef('0x38')][_0x94ef('0x41')]+'%'};return _0x4d3444;})});}_0x31e793=_[_0x94ef('0x42')]({},_0x31e793,_0x5f4e83[_0x94ef('0x44')]);return _0x46b9d0[_0x94ef('0x69')](_0x31e793);}})[_0x94ef('0x45')](function(_0x6a87f5){if(_0x6a87f5){_0x543a40=_0x6a87f5[_0x94ef('0x3d')];if(!_0x5f4e83['query'][_0x94ef('0x5b')](_0x94ef('0x3e'))){_0x31e793[_0x94ef('0x23')]=qs[_0x94ef('0x23')](_0x5f4e83[_0x94ef('0x38')]['limit']);_0x31e793[_0x94ef('0x21')]=qs['offset'](_0x5f4e83[_0x94ef('0x38')][_0x94ef('0x21')]);}return _0x46b9d0['getTeams'](_0x31e793);}})['then'](function(_0x5ac837){if(_0x5ac837){return _0x5ac837?{'count':_0x543a40,'rows':_0x5ac837}:null;}})['then'](respondWithResult(_0x89a601,null))[_0x94ef('0x4b')](handleError(_0x89a601,null));};exports[_0x94ef('0x6a')]=function(_0x3464f5,_0x16408e,_0x346f46){var _0x3d2989=_0x3464f5['body']['ids'];return db[_0x94ef('0x68')]['findAll']({'where':{'id':_0x3d2989},'attributes':['id'],'include':[{'model':db[_0x94ef('0x5e')],'as':'Agents','attributes':['id','name','online','voicePause',_0x94ef('0x6b')],'raw':!![]}]})[_0x94ef('0x45')](function(_0x21fcdc){if(_0x21fcdc){var _0x562551=_[_0x94ef('0x6c')](_0x21fcdc,function(_0x4fddf5){var _0x12e248=_0x4fddf5[_0x94ef('0x2a')]({'plain':!![]});return _0x12e248['Agents'];});return db[_0x94ef('0x31')]['find']({'where':{'id':_0x3464f5[_0x94ef('0x56')]['id']}})[_0x94ef('0x45')](function(_0x4192a8){return db[_0x94ef('0x6d')][_0x94ef('0x6e')](function(_0x5cc155){return _0x4192a8[_0x94ef('0x6a')](_0x3d2989,{'transaction':_0x5cc155})[_0x94ef('0x45')](function(){return BPromise[_0x94ef('0x6f')](_0x562551,function(_0x10c590){return db[_0x94ef('0x5a')]['findOrCreate']({'where':{'UserId':_0x10c590['id'],'SmsQueueId':_0x3464f5[_0x94ef('0x56')]['id']},'transaction':_0x5cc155});});})[_0x94ef('0x45')](function(){_0x562551[_0x94ef('0x70')](function(_0x585895){socket[_0x94ef('0x71')](_0x94ef('0x72'),{'UserId':_0x585895['id'],'SmsQueueId':_0x4192a8['id']});});});});});}})[_0x94ef('0x45')](respondWithStatusCode(_0x16408e,null))[_0x94ef('0x4b')](handleError(_0x16408e,null));};exports['removeTeams']=function(_0x328629,_0x1fafca,_0x3a2af8){return db[_0x94ef('0x68')]['findAll']({'where':{'id':_0x328629['query'][_0x94ef('0x73')]},'attributes':['id'],'include':[{'model':db[_0x94ef('0x5e')],'as':_0x94ef('0x74'),'attributes':['id'],'raw':!![]}]})[_0x94ef('0x45')](handleEntityNotFound(_0x1fafca,null))[_0x94ef('0x45')](function(_0x5a7008){var _0x110f82=_[_0x94ef('0x37')](_0x5a7008,'id');var _0x52443e=[];var _0x1c2b7a=[];var _0x446133=squel['select']();_0x446133[_0x94ef('0x75')](_0x94ef('0x76'))[_0x94ef('0x77')](_0x94ef('0x78'),'tq')[_0x94ef('0x79')](_0x94ef('0x7a'),'ut',_0x94ef('0x7b'))[_0x94ef('0x43')](_0x94ef('0x7c'),_0x328629[_0x94ef('0x56')]['id']);for(var _0x28cb48=0x0;_0x28cb48<_0x5a7008[_0x94ef('0x3d')];_0x28cb48+=0x1){let _0x2ed631=_0x5a7008[_0x28cb48];for(var _0x306361=0x0;_0x306361<_0x2ed631['Agents'][_0x94ef('0x3d')];_0x306361+=0x1){let _0x1ecfa6=_0x2ed631[_0x94ef('0x74')][_0x306361];var _0x4efb63=_0x446133[_0x94ef('0x7d')]();_0x4efb63[_0x94ef('0x43')](_0x94ef('0x7e'),_0x1ecfa6['id']);_0x1c2b7a['push'](db['sequelize'][_0x94ef('0x38')](_0x4efb63['toString'](),{'type':db[_0x94ef('0x6d')][_0x94ef('0x7f')][_0x94ef('0x80')]})[_0x94ef('0x45')](function(_0x347f6d){if(_0x347f6d[_0x94ef('0x3d')]===0x1){return _0x1ecfa6['id'];}else{var _0x4af7e3=_[_0x94ef('0x81')](_['map'](_0x347f6d,_0x94ef('0x82')),function(_0x589513){return _[_0x94ef('0x83')](_0x110f82,_0x589513);});if(_0x4af7e3){return _0x1ecfa6['id'];}}}));}}return BPromise[_0x94ef('0x84')](_0x1c2b7a)[_0x94ef('0x45')](function(_0x2bfcea){_0x52443e=_(_0x52443e)[_0x94ef('0x85')](_0x2bfcea)[_0x94ef('0x86')]()['value']();return db[_0x94ef('0x31')][_0x94ef('0x53')]({'where':{'id':_0x328629[_0x94ef('0x56')]['id']}})['then'](function(_0x3cc44f){return db[_0x94ef('0x6d')][_0x94ef('0x6e')](function(_0x11ee46){return _0x3cc44f[_0x94ef('0x87')](_0x328629[_0x94ef('0x38')][_0x94ef('0x73')],{'transaction':_0x11ee46})[_0x94ef('0x45')](function(){if(!_[_0x94ef('0x88')](_0x52443e)){return _0x3cc44f[_0x94ef('0x89')](_0x52443e,{'transaction':_0x11ee46});}})[_0x94ef('0x45')](function(){_0x52443e[_0x94ef('0x70')](function(_0x5ef4d7){socket[_0x94ef('0x71')]('userSmsQueue:remove',{'UserId':_0x5ef4d7,'SmsQueueId':_0x3cc44f['id']});});});});});});})[_0x94ef('0x45')](respondWithStatusCode(_0x1fafca,null))[_0x94ef('0x4b')](handleError(_0x1fafca,null));};exports['addAgents']=function(_0x135f32,_0x3161d2,_0x298b81){return db['SmsQueue'][_0x94ef('0x53')]({'where':{'id':_0x135f32[_0x94ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x3161d2,null))[_0x94ef('0x45')](function(_0x23a6af){if(_0x23a6af){return _0x23a6af[_0x94ef('0x8a')](_0x135f32['body']['ids'],_[_0x94ef('0x8b')](_0x135f32[_0x94ef('0x4d')],[_0x94ef('0x73'),'id'])||{})['spread'](function(_0x54047a){for(var _0xb47f2b=0x0;_0xb47f2b<_0x135f32['body'][_0x94ef('0x73')]['length'];_0xb47f2b+=0x1){socket[_0x94ef('0x71')](_0x94ef('0x72'),{'UserId':Number(_0x135f32[_0x94ef('0x4d')][_0x94ef('0x73')][_0xb47f2b]),'SmsQueueId':Number(_0x135f32[_0x94ef('0x56')]['id'])});}return _0x54047a;});}})['then'](respondWithResult(_0x3161d2,null))[_0x94ef('0x4b')](handleError(_0x3161d2,null));};exports[_0x94ef('0x89')]=function(_0xa6983b,_0x12db7f,_0x1904c0){return db['SmsQueue']['find']({'where':{'id':_0xa6983b[_0x94ef('0x56')]['id']}})[_0x94ef('0x45')](handleEntityNotFound(_0x12db7f,null))['then'](function(_0x2bb713){if(_0x2bb713){return _0x2bb713['removeAgents'](_0xa6983b[_0x94ef('0x38')][_0x94ef('0x73')])[_0x94ef('0x45')](function(){if(_[_0x94ef('0x8c')](_0xa6983b[_0x94ef('0x38')]['ids'])){for(var _0x19cb07=0x0;_0x19cb07<_0xa6983b[_0x94ef('0x38')][_0x94ef('0x73')][_0x94ef('0x3d')];_0x19cb07+=0x1){socket['emit'](_0x94ef('0x8d'),{'UserId':Number(_0xa6983b[_0x94ef('0x38')][_0x94ef('0x73')][_0x19cb07]),'SmsQueueId':Number(_0xa6983b['params']['id'])});}}else{socket[_0x94ef('0x71')]('userSmsQueue:remove',{'UserId':Number(_0xa6983b[_0x94ef('0x38')]['ids']),'SmsQueueId':Number(_0xa6983b[_0x94ef('0x56')]['id'])});}});}})[_0x94ef('0x45')](respondWithStatusCode(_0x12db7f,null))[_0x94ef('0x4b')](handleError(_0x12db7f,null));};exports[_0x94ef('0x8e')]=function(_0x561e8d,_0x5dba40,_0x1decc3){var _0x5379af={};var _0x25fea7={};var _0x54c6e4;var _0x468ed8;return db[_0x94ef('0x31')][_0x94ef('0x59')]({'where':{'id':_0x561e8d[_0x94ef('0x56')]['id']}})[_0x94ef('0x45')](handleEntityNotFound(_0x5dba40,null))[_0x94ef('0x45')](function(_0x119d55){if(_0x119d55){_0x54c6e4=_0x119d55;_0x25fea7[_0x94ef('0x36')]=_[_0x94ef('0x39')](db[_0x94ef('0x5e')]['rawAttributes']);_0x25fea7['query']=_[_0x94ef('0x39')](_0x561e8d['query']);_0x25fea7[_0x94ef('0x3a')]=_[_0x94ef('0x4a')](_0x25fea7[_0x94ef('0x36')],_0x25fea7['query']);_0x5379af[_0x94ef('0x3c')]=_['intersection'](_0x25fea7[_0x94ef('0x36')],qs['fields'](_0x561e8d[_0x94ef('0x38')][_0x94ef('0x3b')]));_0x5379af[_0x94ef('0x3c')]=_0x5379af[_0x94ef('0x3c')][_0x94ef('0x3d')]?_0x5379af[_0x94ef('0x3c')]:_0x25fea7['model'];_0x5379af[_0x94ef('0x3f')]=qs[_0x94ef('0x40')](_0x561e8d['query']['sort']);_0x5379af[_0x94ef('0x43')]=qs[_0x94ef('0x3a')](_[_0x94ef('0x5c')](_0x561e8d[_0x94ef('0x38')],_0x25fea7[_0x94ef('0x3a')]));if(_0x561e8d[_0x94ef('0x38')][_0x94ef('0x41')]){_0x5379af[_0x94ef('0x43')]=_[_0x94ef('0x42')](_0x5379af['where'],{'$or':_[_0x94ef('0x37')](_0x5379af['attributes'],function(_0x4ba7bc){var _0x566f22={};_0x566f22[_0x4ba7bc]={'$like':'%'+_0x561e8d[_0x94ef('0x38')][_0x94ef('0x41')]+'%'};return _0x566f22;})});}_0x5379af=_[_0x94ef('0x42')]({},_0x5379af,_0x561e8d['options']);return _0x54c6e4[_0x94ef('0x8e')](_0x5379af);}})[_0x94ef('0x45')](function(_0x2087cb){if(_0x2087cb){_0x468ed8=_0x2087cb[_0x94ef('0x3d')];if(!_0x561e8d[_0x94ef('0x38')]['hasOwnProperty'](_0x94ef('0x3e'))){_0x5379af[_0x94ef('0x23')]=qs['limit'](_0x561e8d['query'][_0x94ef('0x23')]);_0x5379af['offset']=qs['offset'](_0x561e8d[_0x94ef('0x38')][_0x94ef('0x21')]);}return _0x54c6e4[_0x94ef('0x8e')](_0x5379af);}})[_0x94ef('0x45')](function(_0x2ba118){if(_0x2ba118){return _0x2ba118?{'count':_0x468ed8,'rows':_0x2ba118}:null;}})[_0x94ef('0x45')](respondWithResult(_0x5dba40,null))[_0x94ef('0x4b')](handleError(_0x5dba40,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index d9b63d3..580bd8c 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 _0x2104=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x505713,_0x30847e){var _0x591c0b=function(_0x5a3dc6){while(--_0x5a3dc6){_0x505713['push'](_0x505713['shift']());}};_0x591c0b(++_0x30847e);}(_0x2104,0x65));var _0x4210=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x2104[_0x2cc711];return _0x31a52e;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x4210('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4210('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4210('0x2'),'afterDestroy':_0x4210('0x3')};function emitEvent(_0x3b8f10){return function(_0x287c8a,_0x4817af,_0x1bfd9f){SmsQueueEvents[_0x4210('0x4')](_0x3b8f10+':'+_0x287c8a['id'],_0x287c8a);SmsQueueEvents[_0x4210('0x4')](_0x3b8f10,_0x287c8a);_0x1bfd9f(null);};}for(var e in events){if(events[_0x4210('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x4210('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x20a4=['emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove'];(function(_0x50180c,_0x3fc232){var _0x5eaa41=function(_0x24fe64){while(--_0x24fe64){_0x50180c['push'](_0x50180c['shift']());}};_0x5eaa41(++_0x3fc232);}(_0x20a4,0xb3));var _0x420a=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0x20a4[_0x17823f];return _0x51fc21;};'use strict';var EventEmitter=require(_0x420a('0x0'));var SmsQueue=require(_0x420a('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x420a('0x2'),'afterUpdate':_0x420a('0x3'),'afterDestroy':_0x420a('0x4')};function emitEvent(_0x1e7c35){return function(_0x53638b,_0x35b36d,_0x37b349){SmsQueueEvents[_0x420a('0x5')](_0x1e7c35+':'+_0x53638b['id'],_0x53638b);SmsQueueEvents[_0x420a('0x5')](_0x1e7c35,_0x53638b);_0x37b349(null);};}for(var e in events){if(events[_0x420a('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x420a('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 c8cd1fb..69bb65c 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 _0x30ee=['moment','request-promise','path','rimraf','./smsQueue.attributes','exports','SmsQueue','lodash','util','../../config/logger','api'];(function(_0x300464,_0x4bdf5c){var _0x100b81=function(_0x5ae8c7){while(--_0x5ae8c7){_0x300464['push'](_0x300464['shift']());}};_0x100b81(++_0x4bdf5c);}(_0x30ee,0x17d));var _0xe30e=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x30ee[_0x5538d5];return _0x323b1a;};'use strict';var _=require(_0xe30e('0x0'));var util=require(_0xe30e('0x1'));var logger=require(_0xe30e('0x2'))(_0xe30e('0x3'));var moment=require(_0xe30e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe30e('0x5'));var fs=require('fs');var path=require(_0xe30e('0x6'));var rimraf=require(_0xe30e('0x7'));var config=require('../../config/environment');var attributes=require(_0xe30e('0x8'));module[_0xe30e('0x9')]=function(_0x38ba7f,_0x582f45){return _0x38ba7f['define'](_0xe30e('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0df7=['rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3ddfad,_0x27cac9){var _0x1aeaf1=function(_0x60645d){while(--_0x60645d){_0x3ddfad['push'](_0x3ddfad['shift']());}};_0x1aeaf1(++_0x27cac9);}(_0x0df7,0xd7));var _0x70df=function(_0x156258,_0x5268b1){_0x156258=_0x156258-0x0;var _0x322c5a=_0x0df7[_0x156258];return _0x322c5a;};'use strict';var _=require(_0x70df('0x0'));var util=require(_0x70df('0x1'));var logger=require(_0x70df('0x2'))('api');var moment=require(_0x70df('0x3'));var BPromise=require('bluebird');var rp=require(_0x70df('0x4'));var fs=require('fs');var path=require(_0x70df('0x5'));var rimraf=require(_0x70df('0x6'));var config=require(_0x70df('0x7'));var attributes=require(_0x70df('0x8'));module[_0x70df('0x9')]=function(_0x198924,_0x170e38){return _0x198924[_0x70df('0xa')](_0x70df('0xb'),attributes,{'tableName':_0x70df('0xc'),'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 02a2844..07bf3b6 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 _0x1c3d=['SmsQueue','findAll','options','raw','where','attributes','include','map','model','debug','stringify','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','defaults','localhost','./smsQueue.socket','register','request','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch','GetSmsQueue'];(function(_0x2fd086,_0x117a4d){var _0x471e13=function(_0xcaf073){while(--_0xcaf073){_0x2fd086['push'](_0x2fd086['shift']());}};_0x471e13(++_0x117a4d);}(_0x1c3d,0xf7));var _0xd1c3=function(_0xe967ef,_0x444e7b){_0xe967ef=_0xe967ef-0x0;var _0x3e63d8=_0x1c3d[_0xe967ef];return _0x3e63d8;};'use strict';var _=require(_0xd1c3('0x0'));var util=require('util');var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require(_0xd1c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1c3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd1c3('0x7')][_0xd1c3('0x8')]({'port':0x232a});config[_0xd1c3('0x9')]=_[_0xd1c3('0xa')](config[_0xd1c3('0x9')],{'host':_0xd1c3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd1c3('0xc'))[_0xd1c3('0xd')](socket);function respondWithRpcPromise(_0x5ed143,_0x55d781,_0x11ae27){return new BPromise(function(_0x2ef78d,_0x443126){return client[_0xd1c3('0xe')](_0x5ed143,_0x11ae27)[_0xd1c3('0xf')](function(_0x726b7c){logger[_0xd1c3('0x10')]('SmsQueue,\x20%s,\x20%s',_0x55d781,_0xd1c3('0x11'));logger['debug'](_0xd1c3('0x12'),_0x55d781,'request\x20sent',JSON['stringify'](_0x726b7c));if(_0x726b7c[_0xd1c3('0x13')]){if(_0x726b7c['error'][_0xd1c3('0x14')]===0x1f4){logger[_0xd1c3('0x13')]('SmsQueue,\x20%s,\x20%s',_0x55d781,_0x726b7c[_0xd1c3('0x13')][_0xd1c3('0x15')]);return _0x443126(_0x726b7c[_0xd1c3('0x13')][_0xd1c3('0x15')]);}logger[_0xd1c3('0x13')](_0xd1c3('0x16'),_0x55d781,_0x726b7c[_0xd1c3('0x13')][_0xd1c3('0x15')]);return _0x2ef78d(_0x726b7c[_0xd1c3('0x13')]['message']);}else{logger[_0xd1c3('0x10')](_0xd1c3('0x16'),_0x55d781,_0xd1c3('0x11'));_0x2ef78d(_0x726b7c[_0xd1c3('0x17')][_0xd1c3('0x15')]);}})[_0xd1c3('0x18')](function(_0x41433e){logger[_0xd1c3('0x13')]('SmsQueue,\x20%s,\x20%s',_0x55d781,_0x41433e);_0x443126(_0x41433e);});});}exports[_0xd1c3('0x19')]=function(_0x2e89ad){var _0x1d1d5f=this;return new Promise(function(_0x128369,_0x22018){return db[_0xd1c3('0x1a')][_0xd1c3('0x1b')]({'raw':_0x2e89ad[_0xd1c3('0x1c')]?_0x2e89ad[_0xd1c3('0x1c')][_0xd1c3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e89ad[_0xd1c3('0x1c')]?_0x2e89ad['options'][_0xd1c3('0x1e')]||null:null,'attributes':_0x2e89ad[_0xd1c3('0x1c')]?_0x2e89ad[_0xd1c3('0x1c')][_0xd1c3('0x1f')]||null:null,'limit':_0x2e89ad[_0xd1c3('0x1c')]?_0x2e89ad[_0xd1c3('0x1c')]['limit']||null:null,'include':_0x2e89ad['options']?_0x2e89ad['options'][_0xd1c3('0x20')]?_['map'](_0x2e89ad[_0xd1c3('0x1c')][_0xd1c3('0x20')],function(_0xd35a81){return{'model':db[_0xd35a81['model']],'as':_0xd35a81['as'],'attributes':_0xd35a81[_0xd1c3('0x1f')],'include':_0xd35a81[_0xd1c3('0x20')]?_[_0xd1c3('0x21')](_0xd35a81[_0xd1c3('0x20')],function(_0x2e81f6){return{'model':db[_0x2e81f6['model']],'as':_0x2e81f6['as'],'attributes':_0x2e81f6['attributes'],'include':_0x2e81f6['include']?_['map'](_0x2e81f6['include'],function(_0x541c79){return{'model':db[_0x541c79[_0xd1c3('0x22')]],'as':_0x541c79['as'],'attributes':_0x541c79['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cd276){logger[_0xd1c3('0x10')](_0xd1c3('0x19'),_0x2e89ad);logger[_0xd1c3('0x23')]('GetSmsQueue',_0x2e89ad,JSON[_0xd1c3('0x24')](_0x1cd276));_0x128369(_0x1cd276);})[_0xd1c3('0x18')](function(_0x1dc6e4){logger[_0xd1c3('0x13')](_0xd1c3('0x19'),_0x1dc6e4[_0xd1c3('0x15')],_0x2e89ad);_0x22018(_0x1d1d5f[_0xd1c3('0x13')](0x1f4,_0x1dc6e4[_0xd1c3('0x15')]));});});};exports[_0xd1c3('0x25')]=function(_0x17e71a){var _0x13fd5b=this;return new Promise(function(_0x25f4b0,_0x2296ec){return db['SmsQueue'][_0xd1c3('0x26')]({'raw':_0x17e71a[_0xd1c3('0x1c')]?_0x17e71a[_0xd1c3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x17e71a[_0xd1c3('0x1c')]?_0x17e71a[_0xd1c3('0x1c')][_0xd1c3('0x1e')]||null:null,'attributes':_0x17e71a[_0xd1c3('0x1c')]?_0x17e71a[_0xd1c3('0x1c')][_0xd1c3('0x1f')]||null:null,'include':_0x17e71a['options']?_0x17e71a[_0xd1c3('0x1c')][_0xd1c3('0x20')]?_[_0xd1c3('0x21')](_0x17e71a[_0xd1c3('0x1c')][_0xd1c3('0x20')],function(_0xca1a83){return{'model':db[_0xca1a83[_0xd1c3('0x22')]],'as':_0xca1a83['as'],'attributes':_0xca1a83[_0xd1c3('0x1f')],'include':_0xca1a83[_0xd1c3('0x20')]?_['map'](_0xca1a83[_0xd1c3('0x20')],function(_0x29cb1c){return{'model':db[_0x29cb1c[_0xd1c3('0x22')]],'as':_0x29cb1c['as'],'attributes':_0x29cb1c[_0xd1c3('0x1f')],'include':_0x29cb1c[_0xd1c3('0x20')]?_['map'](_0x29cb1c[_0xd1c3('0x20')],function(_0x44e30a){return{'model':db[_0x44e30a[_0xd1c3('0x22')]],'as':_0x44e30a['as'],'attributes':_0x44e30a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ae793){logger[_0xd1c3('0x10')](_0xd1c3('0x25'),_0x17e71a);logger['debug'](_0xd1c3('0x25'),_0x17e71a,JSON[_0xd1c3('0x24')](_0x1ae793));_0x25f4b0(_0x1ae793);})[_0xd1c3('0x18')](function(_0x173db6){logger['error'](_0xd1c3('0x25'),_0x173db6[_0xd1c3('0x15')],_0x17e71a);_0x2296ec(_0x13fd5b[_0xd1c3('0x13')](0x1f4,_0x173db6[_0xd1c3('0x15')]));});});}; \ No newline at end of file +var _0xd719=['defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','then','ShowSmsQueue','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x24515e,_0x55f9b8){var _0x10ed6e=function(_0x20750a){while(--_0x20750a){_0x24515e['push'](_0x24515e['shift']());}};_0x10ed6e(++_0x55f9b8);}(_0xd719,0x6a));var _0x9d71=function(_0x543d0f,_0x175439){_0x543d0f=_0x543d0f-0x0;var _0x4f6fb4=_0xd719[_0x543d0f];return _0x4f6fb4;};'use strict';var _=require(_0x9d71('0x0'));var util=require(_0x9d71('0x1'));var moment=require('moment');var BPromise=require(_0x9d71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9d71('0x3'));var logger=require(_0x9d71('0x4'))(_0x9d71('0x5'));var config=require(_0x9d71('0x6'));var jayson=require(_0x9d71('0x7'));var client=jayson[_0x9d71('0x8')][_0x9d71('0x9')]({'port':0x232a});config[_0x9d71('0xa')]=_[_0x9d71('0xb')](config[_0x9d71('0xa')],{'host':_0x9d71('0xc'),'port':0x18eb});var socket=require(_0x9d71('0xd'))(new Redis(config[_0x9d71('0xa')]));require(_0x9d71('0xe'))[_0x9d71('0xf')](socket);function respondWithRpcPromise(_0x46a00c,_0x4be526,_0x36764a){return new BPromise(function(_0x1c080e,_0x338f4f){return client[_0x9d71('0x10')](_0x46a00c,_0x36764a)['then'](function(_0x234400){logger['info'](_0x9d71('0x11'),_0x4be526,_0x9d71('0x12'));logger[_0x9d71('0x13')](_0x9d71('0x14'),_0x4be526,_0x9d71('0x12'),JSON[_0x9d71('0x15')](_0x234400));if(_0x234400['error']){if(_0x234400[_0x9d71('0x16')]['code']===0x1f4){logger['error'](_0x9d71('0x11'),_0x4be526,_0x234400['error'][_0x9d71('0x17')]);return _0x338f4f(_0x234400['error'][_0x9d71('0x17')]);}logger[_0x9d71('0x16')](_0x9d71('0x11'),_0x4be526,_0x234400[_0x9d71('0x16')][_0x9d71('0x17')]);return _0x1c080e(_0x234400[_0x9d71('0x16')][_0x9d71('0x17')]);}else{logger[_0x9d71('0x18')](_0x9d71('0x11'),_0x4be526,_0x9d71('0x12'));_0x1c080e(_0x234400[_0x9d71('0x19')][_0x9d71('0x17')]);}})[_0x9d71('0x1a')](function(_0x4223ef){logger['error'](_0x9d71('0x11'),_0x4be526,_0x4223ef);_0x338f4f(_0x4223ef);});});}exports[_0x9d71('0x1b')]=function(_0x2ddc49){var _0x5ed221=this;return new Promise(function(_0x3e19f8,_0xd8225d){return db[_0x9d71('0x1c')][_0x9d71('0x1d')]({'raw':_0x2ddc49[_0x9d71('0x1e')]?_0x2ddc49[_0x9d71('0x1e')][_0x9d71('0x1f')]===undefined?!![]:![]:!![],'where':_0x2ddc49[_0x9d71('0x1e')]?_0x2ddc49[_0x9d71('0x1e')]['where']||null:null,'attributes':_0x2ddc49[_0x9d71('0x1e')]?_0x2ddc49[_0x9d71('0x1e')][_0x9d71('0x20')]||null:null,'limit':_0x2ddc49[_0x9d71('0x1e')]?_0x2ddc49[_0x9d71('0x1e')][_0x9d71('0x21')]||null:null,'include':_0x2ddc49[_0x9d71('0x1e')]?_0x2ddc49[_0x9d71('0x1e')][_0x9d71('0x22')]?_[_0x9d71('0x23')](_0x2ddc49['options']['include'],function(_0x1018d8){return{'model':db[_0x1018d8[_0x9d71('0x24')]],'as':_0x1018d8['as'],'attributes':_0x1018d8[_0x9d71('0x20')],'include':_0x1018d8[_0x9d71('0x22')]?_[_0x9d71('0x23')](_0x1018d8[_0x9d71('0x22')],function(_0x456aec){return{'model':db[_0x456aec[_0x9d71('0x24')]],'as':_0x456aec['as'],'attributes':_0x456aec[_0x9d71('0x20')],'include':_0x456aec[_0x9d71('0x22')]?_[_0x9d71('0x23')](_0x456aec['include'],function(_0xbeed23){return{'model':db[_0xbeed23[_0x9d71('0x24')]],'as':_0xbeed23['as'],'attributes':_0xbeed23[_0x9d71('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9d71('0x25')](function(_0x2f7835){logger[_0x9d71('0x18')](_0x9d71('0x1b'),_0x2ddc49);logger['debug'](_0x9d71('0x1b'),_0x2ddc49,JSON[_0x9d71('0x15')](_0x2f7835));_0x3e19f8(_0x2f7835);})[_0x9d71('0x1a')](function(_0x5655c9){logger[_0x9d71('0x16')](_0x9d71('0x1b'),_0x5655c9[_0x9d71('0x17')],_0x2ddc49);_0xd8225d(_0x5ed221[_0x9d71('0x16')](0x1f4,_0x5655c9['message']));});});};exports[_0x9d71('0x26')]=function(_0x370b46){var _0xd795f1=this;return new Promise(function(_0x39d020,_0x26f0e){return db[_0x9d71('0x1c')]['find']({'raw':_0x370b46[_0x9d71('0x1e')]?_0x370b46[_0x9d71('0x1e')][_0x9d71('0x1f')]===undefined?!![]:![]:!![],'where':_0x370b46[_0x9d71('0x1e')]?_0x370b46[_0x9d71('0x1e')]['where']||null:null,'attributes':_0x370b46[_0x9d71('0x1e')]?_0x370b46[_0x9d71('0x1e')][_0x9d71('0x20')]||null:null,'include':_0x370b46[_0x9d71('0x1e')]?_0x370b46[_0x9d71('0x1e')]['include']?_['map'](_0x370b46['options'][_0x9d71('0x22')],function(_0x4e83b7){return{'model':db[_0x4e83b7['model']],'as':_0x4e83b7['as'],'attributes':_0x4e83b7[_0x9d71('0x20')],'include':_0x4e83b7[_0x9d71('0x22')]?_[_0x9d71('0x23')](_0x4e83b7[_0x9d71('0x22')],function(_0x7ec8d8){return{'model':db[_0x7ec8d8[_0x9d71('0x24')]],'as':_0x7ec8d8['as'],'attributes':_0x7ec8d8[_0x9d71('0x20')],'include':_0x7ec8d8[_0x9d71('0x22')]?_[_0x9d71('0x23')](_0x7ec8d8[_0x9d71('0x22')],function(_0x41802b){return{'model':db[_0x41802b[_0x9d71('0x24')]],'as':_0x41802b['as'],'attributes':_0x41802b[_0x9d71('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9d71('0x25')](function(_0x624e8a){logger[_0x9d71('0x18')](_0x9d71('0x26'),_0x370b46);logger[_0x9d71('0x13')](_0x9d71('0x26'),_0x370b46,JSON[_0x9d71('0x15')](_0x624e8a));_0x39d020(_0x624e8a);})[_0x9d71('0x1a')](function(_0x36e835){logger[_0x9d71('0x16')](_0x9d71('0x26'),_0x36e835[_0x9d71('0x17')],_0x370b46);_0x26f0e(_0xd795f1[_0x9d71('0x16')](0x1f4,_0x36e835['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c5223a7..2269da1 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 _0x05a1=['length','smsQueue:','remove','update','emit','removeListener','register'];(function(_0x4a3549,_0x570167){var _0xdd9cab=function(_0x548c0b){while(--_0x548c0b){_0x4a3549['push'](_0x4a3549['shift']());}};_0xdd9cab(++_0x570167);}(_0x05a1,0x11a));var _0x105a=function(_0x423d49,_0x10a8b0){_0x423d49=_0x423d49-0x0;var _0x575362=_0x05a1[_0x423d49];return _0x575362;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x105a('0x0'),_0x105a('0x1')];function createListener(_0x585ed7,_0x16e411){return function(_0x1cc86e){_0x16e411[_0x105a('0x2')](_0x585ed7,_0x1cc86e);};}function removeListener(_0x1c6470,_0x144bda){return function(){SmsQueueEvents[_0x105a('0x3')](_0x1c6470,_0x144bda);};}exports[_0x105a('0x4')]=function(_0x4f11e4){for(var _0x5b29db=0x0,_0x402ea4=events[_0x105a('0x5')];_0x5b29db<_0x402ea4;_0x5b29db++){var _0x3b898d=events[_0x5b29db];var _0x5ce4aa=createListener(_0x105a('0x6')+_0x3b898d,_0x4f11e4);SmsQueueEvents['on'](_0x3b898d,_0x5ce4aa);}}; \ No newline at end of file +var _0x464d=['./smsQueue.events','save','remove','length','smsQueue:'];(function(_0x4ce832,_0x27608d){var _0x271342=function(_0x5d1d15){while(--_0x5d1d15){_0x4ce832['push'](_0x4ce832['shift']());}};_0x271342(++_0x27608d);}(_0x464d,0x131));var _0xd464=function(_0x348683,_0x3ec631){_0x348683=_0x348683-0x0;var _0x35f06a=_0x464d[_0x348683];return _0x35f06a;};'use strict';var SmsQueueEvents=require(_0xd464('0x0'));var events=[_0xd464('0x1'),_0xd464('0x2'),'update'];function createListener(_0x23980b,_0x52a121){return function(_0x19f5f3){_0x52a121['emit'](_0x23980b,_0x19f5f3);};}function removeListener(_0xc8ca2d,_0x339276){return function(){SmsQueueEvents['removeListener'](_0xc8ca2d,_0x339276);};}exports['register']=function(_0x391f56){for(var _0x53c0f4=0x0,_0x4c9c19=events[_0xd464('0x3')];_0x53c0f4<_0x4c9c19;_0x53c0f4++){var _0x447090=events[_0x53c0f4];var _0x135f7d=createListener(_0xd464('0x4')+_0x447090,_0x391f56);SmsQueueEvents['on'](_0x447090,_0x135f7d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 231971b..f4c7ec5 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 _0x114b=['/describe','describe','/:id','show','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x19a66d,_0x967810){var _0x554682=function(_0x45d66a){while(--_0x45d66a){_0x19a66d['push'](_0x19a66d['shift']());}};_0x554682(++_0x967810);}(_0x114b,0x1e9));var _0xb114=function(_0x5a88ff,_0x25df94){_0x5a88ff=_0x5a88ff-0x0;var _0x22f3c0=_0x114b[_0x5a88ff];return _0x22f3c0;};'use strict';var multer=require('multer');var util=require(_0xb114('0x0'));var path=require(_0xb114('0x1'));var timeout=require(_0xb114('0x2'));var express=require(_0xb114('0x3'));var router=express[_0xb114('0x4')]();var fs_extra=require(_0xb114('0x5'));var auth=require(_0xb114('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb114('0x7'));var controller=require(_0xb114('0x8'));router[_0xb114('0x9')]('/',auth[_0xb114('0xa')](),controller['index']);router['get'](_0xb114('0xb'),auth[_0xb114('0xa')](),controller[_0xb114('0xc')]);router[_0xb114('0x9')](_0xb114('0xd'),auth[_0xb114('0xa')](),controller[_0xb114('0xe')]);router[_0xb114('0xf')]('/',auth[_0xb114('0xa')](),controller[_0xb114('0x10')]);router['put'](_0xb114('0xd'),auth[_0xb114('0xa')](),controller[_0xb114('0x11')]);router['delete'](_0xb114('0xd'),auth[_0xb114('0xa')](),controller[_0xb114('0x12')]);module[_0xb114('0x13')]=router; \ No newline at end of file +var _0x22d3=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','destroy'];(function(_0xf169ec,_0x21c729){var _0x2c4f8e=function(_0x3456fa){while(--_0x3456fa){_0xf169ec['push'](_0xf169ec['shift']());}};_0x2c4f8e(++_0x21c729);}(_0x22d3,0x66));var _0x322d=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x22d3[_0x15fc7a];return _0x3aa9f4;};'use strict';var multer=require('multer');var util=require(_0x322d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x322d('0x1'));var router=express[_0x322d('0x2')]();var fs_extra=require(_0x322d('0x3'));var auth=require(_0x322d('0x4'));var interaction=require(_0x322d('0x5'));var config=require('../../config/environment');var controller=require(_0x322d('0x6'));router[_0x322d('0x7')]('/',auth['isAuthenticated'](),controller[_0x322d('0x8')]);router[_0x322d('0x7')](_0x322d('0x9'),auth[_0x322d('0xa')](),controller['describe']);router[_0x322d('0x7')](_0x322d('0xb'),auth[_0x322d('0xa')](),controller[_0x322d('0xc')]);router[_0x322d('0xd')]('/',auth[_0x322d('0xa')](),controller[_0x322d('0xe')]);router[_0x322d('0xf')](_0x322d('0xb'),auth[_0x322d('0xa')](),controller['update']);router['delete'](_0x322d('0xb'),auth['isAuthenticated'](),controller[_0x322d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a5c0e4e..1cfb68c 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 _0x5336=['DATE','sequelize','exports','STRING'];(function(_0x32684b,_0x845736){var _0x19adc6=function(_0x5ede77){while(--_0x5ede77){_0x32684b['push'](_0x32684b['shift']());}};_0x19adc6(++_0x845736);}(_0x5336,0xa9));var _0x6533=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x5336[_0x9dfc10];return _0x4f938a;};'use strict';var moment=require('moment');var Sequelize=require(_0x6533('0x0'));module[_0x6533('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6533('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6533('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6533('0x3')]},'reason':{'type':Sequelize[_0x6533('0x2')]}}; \ No newline at end of file +var _0x5949=['STRING','DATE','moment','sequelize'];(function(_0x312a30,_0x269d61){var _0x1e8e8e=function(_0x116206){while(--_0x116206){_0x312a30['push'](_0x312a30['shift']());}};_0x1e8e8e(++_0x269d61);}(_0x5949,0x176));var _0x9594=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x5949[_0x53e3de];return _0x7b905b;};'use strict';var moment=require(_0x9594('0x0'));var Sequelize=require(_0x9594('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9594('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9594('0x3')]},'acceptAt':{'type':Sequelize[_0x9594('0x3')]},'exitAt':{'type':Sequelize[_0x9594('0x3')]},'reason':{'type':Sequelize[_0x9594('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 85c948a..1fe046d 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 _0x0411=['util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','save','update','then','destroy','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','order','sort','filters','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','length','include','options','find','create','body','describe','rimraf','zip-dir','moment','bluebird'];(function(_0x3680cd,_0x46627f){var _0x4b8a9d=function(_0x10059d){while(--_0x10059d){_0x3680cd['push'](_0x3680cd['shift']());}};_0x4b8a9d(++_0x46627f);}(_0x0411,0x100));var _0x1041=function(_0x1f0f74,_0x53b3cd){_0x1f0f74=_0x1f0f74-0x0;var _0x2f0484=_0x0411[_0x1f0f74];return _0x2f0484;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1041('0x0'));var zipdir=require(_0x1041('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1041('0x2'));var BPromise=require(_0x1041('0x3'));var Mustache=require('mustache');var util=require(_0x1041('0x4'));var path=require('path');var sox=require(_0x1041('0x5'));var csv=require(_0x1041('0x6'));var ejs=require(_0x1041('0x7'));var fs=require('fs');var fs_extra=require(_0x1041('0x8'));var _=require(_0x1041('0x9'));var squel=require(_0x1041('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1041('0xb'));var toCsv=require(_0x1041('0x6'));var querystring=require('querystring');var Papa=require(_0x1041('0xc'));var Redis=require(_0x1041('0xd'));var authService=require(_0x1041('0xe'));var qs=require(_0x1041('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1041('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1041('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1041('0x12'));var db=require(_0x1041('0x13'))['db'];function respondWithStatusCode(_0x1d90bf,_0x206e80){_0x206e80=_0x206e80||0xcc;return function(_0x5a96e6){if(_0x5a96e6){return _0x1d90bf[_0x1041('0x14')](_0x206e80);}return _0x1d90bf[_0x1041('0x15')](_0x206e80)[_0x1041('0x16')]();};}function respondWithResult(_0x4a9e09,_0xf7a201){_0xf7a201=_0xf7a201||0xc8;return function(_0x4485e1){if(_0x4485e1){return _0x4a9e09[_0x1041('0x15')](_0xf7a201)[_0x1041('0x17')](_0x4485e1);}};}function respondWithFilteredResult(_0x34518d,_0x37b53b){return function(_0x566425){if(_0x566425){var _0x458855=typeof _0x37b53b[_0x1041('0x18')]==='undefined'&&typeof _0x37b53b[_0x1041('0x19')]==='undefined';var _0x1e0081=_0x566425[_0x1041('0x1a')];var _0x29c88d=_0x458855?0x0:_0x37b53b[_0x1041('0x18')];var _0x3d2637=_0x458855?_0x566425['count']:_0x37b53b[_0x1041('0x18')]+_0x37b53b[_0x1041('0x19')];var _0x1e815f;if(_0x3d2637>=_0x1e0081){_0x3d2637=_0x1e0081;_0x1e815f=0xc8;}else{_0x1e815f=0xce;}_0x34518d['status'](_0x1e815f);return _0x34518d['set'](_0x1041('0x1b'),_0x29c88d+'-'+_0x3d2637+'/'+_0x1e0081)[_0x1041('0x17')](_0x566425);}return null;};}function patchUpdates(_0x2335c4){return function(_0x407e9d){try{jsonpatch['apply'](_0x407e9d,_0x2335c4,!![]);}catch(_0x5b9419){return BPromise['reject'](_0x5b9419);}return _0x407e9d[_0x1041('0x1c')]();};}function saveUpdates(_0x51380b,_0x16d345){return function(_0x38dd5e){if(_0x38dd5e){return _0x38dd5e[_0x1041('0x1d')](_0x51380b)[_0x1041('0x1e')](function(_0x214bb2){return _0x214bb2;});}return null;};}function removeEntity(_0x50daaf,_0x2733a9){return function(_0x51c8f2){if(_0x51c8f2){return _0x51c8f2[_0x1041('0x1f')]()[_0x1041('0x1e')](function(){_0x50daaf[_0x1041('0x15')](0xcc)[_0x1041('0x16')]();});}};}function handleEntityNotFound(_0x18df62,_0x4b44ce){return function(_0x372ce3){if(!_0x372ce3){_0x18df62[_0x1041('0x14')](0x194);}return _0x372ce3;};}function handleError(_0x451988,_0x360522){_0x360522=_0x360522||0x1f4;return function(_0x2a9ae2){logger['error'](_0x2a9ae2['stack']);if(_0x2a9ae2[_0x1041('0x20')]){delete _0x2a9ae2[_0x1041('0x20')];}_0x451988[_0x1041('0x15')](_0x360522)[_0x1041('0x21')](_0x2a9ae2);};}exports[_0x1041('0x22')]=function(_0x34462d,_0x768f07){var _0xd60939={},_0x239c1e={},_0x910aef={'count':0x0,'rows':[]};var _0x2e232d=_[_0x1041('0x23')](db[_0x1041('0x24')][_0x1041('0x25')],function(_0x251e57){return{'name':_0x251e57[_0x1041('0x26')],'type':_0x251e57[_0x1041('0x27')][_0x1041('0x28')]};});_0x239c1e[_0x1041('0x29')]=_[_0x1041('0x23')](_0x2e232d,_0x1041('0x20'));_0x239c1e[_0x1041('0x2a')]=_[_0x1041('0x2b')](_0x34462d[_0x1041('0x2a')]);_0x239c1e['filters']=_[_0x1041('0x2c')](_0x239c1e['model'],_0x239c1e[_0x1041('0x2a')]);_0xd60939['attributes']=_[_0x1041('0x2c')](_0x239c1e[_0x1041('0x29')],qs[_0x1041('0x2d')](_0x34462d[_0x1041('0x2a')]['fields']));_0xd60939[_0x1041('0x2e')]=_0xd60939[_0x1041('0x2e')]['length']?_0xd60939[_0x1041('0x2e')]:_0x239c1e[_0x1041('0x29')];if(!_0x34462d[_0x1041('0x2a')]['hasOwnProperty']('nolimit')){_0xd60939['limit']=qs[_0x1041('0x19')](_0x34462d[_0x1041('0x2a')][_0x1041('0x19')]);_0xd60939['offset']=qs[_0x1041('0x18')](_0x34462d[_0x1041('0x2a')][_0x1041('0x18')]);}_0xd60939[_0x1041('0x2f')]=qs[_0x1041('0x30')](_0x34462d[_0x1041('0x2a')][_0x1041('0x30')]);_0xd60939['where']=qs[_0x1041('0x31')](_['pick'](_0x34462d[_0x1041('0x2a')],_0x239c1e[_0x1041('0x31')]),_0x2e232d);if(_0x34462d[_0x1041('0x2a')]['filter']){_0xd60939[_0x1041('0x32')]=_[_0x1041('0x33')](_0xd60939[_0x1041('0x32')],{'$or':_[_0x1041('0x23')](_0x2e232d,function(_0x24c8c3){if(_0x24c8c3['type']!==_0x1041('0x34')){var _0x264084={};_0x264084[_0x24c8c3['name']]={'$like':'%'+_0x34462d[_0x1041('0x2a')]['filter']+'%'};return _0x264084;}})});}_0xd60939=_['merge']({},_0xd60939,_0x34462d['options']);var _0x130d73={'where':_0xd60939[_0x1041('0x32')]};return db[_0x1041('0x24')][_0x1041('0x1a')](_0x130d73)[_0x1041('0x1e')](function(_0x310525){_0x910aef[_0x1041('0x1a')]=_0x310525;if(_0x34462d[_0x1041('0x2a')][_0x1041('0x35')]){_0xd60939['include']=[{'all':!![]}];}return db[_0x1041('0x24')][_0x1041('0x36')](_0xd60939);})[_0x1041('0x1e')](function(_0x2f7e59){_0x910aef['rows']=_0x2f7e59;return _0x910aef;})[_0x1041('0x1e')](respondWithFilteredResult(_0x768f07,_0xd60939))[_0x1041('0x37')](handleError(_0x768f07,null));};exports[_0x1041('0x38')]=function(_0x44e5fe,_0x322b42){var _0x2eafeb={'raw':!![],'where':{'id':_0x44e5fe[_0x1041('0x39')]['id']}},_0x4fe5e1={};_0x4fe5e1[_0x1041('0x29')]=_[_0x1041('0x2b')](db[_0x1041('0x24')][_0x1041('0x25')]);_0x4fe5e1['query']=_[_0x1041('0x2b')](_0x44e5fe[_0x1041('0x2a')]);_0x4fe5e1[_0x1041('0x31')]=_[_0x1041('0x2c')](_0x4fe5e1[_0x1041('0x29')],_0x4fe5e1[_0x1041('0x2a')]);_0x2eafeb[_0x1041('0x2e')]=_[_0x1041('0x2c')](_0x4fe5e1[_0x1041('0x29')],qs[_0x1041('0x2d')](_0x44e5fe[_0x1041('0x2a')][_0x1041('0x2d')]));_0x2eafeb['attributes']=_0x2eafeb[_0x1041('0x2e')][_0x1041('0x3a')]?_0x2eafeb[_0x1041('0x2e')]:_0x4fe5e1[_0x1041('0x29')];if(_0x44e5fe[_0x1041('0x2a')]['includeAll']){_0x2eafeb[_0x1041('0x3b')]=[{'all':!![]}];}_0x2eafeb=_[_0x1041('0x33')]({},_0x2eafeb,_0x44e5fe[_0x1041('0x3c')]);return db[_0x1041('0x24')][_0x1041('0x3d')](_0x2eafeb)[_0x1041('0x1e')](handleEntityNotFound(_0x322b42,null))[_0x1041('0x1e')](respondWithResult(_0x322b42,null))[_0x1041('0x37')](handleError(_0x322b42,null));};exports[_0x1041('0x3e')]=function(_0x325e43,_0xcd8678){return db[_0x1041('0x24')][_0x1041('0x3e')](_0x325e43['body'],{})[_0x1041('0x1e')](respondWithResult(_0xcd8678,0xc9))[_0x1041('0x37')](handleError(_0xcd8678,null));};exports[_0x1041('0x1d')]=function(_0x40c8bf,_0x372d86){if(_0x40c8bf[_0x1041('0x3f')]['id']){delete _0x40c8bf[_0x1041('0x3f')]['id'];}return db['SmsQueueReport'][_0x1041('0x3d')]({'where':{'id':_0x40c8bf[_0x1041('0x39')]['id']}})[_0x1041('0x1e')](handleEntityNotFound(_0x372d86,null))['then'](saveUpdates(_0x40c8bf[_0x1041('0x3f')],null))[_0x1041('0x1e')](respondWithResult(_0x372d86,null))[_0x1041('0x37')](handleError(_0x372d86,null));};exports[_0x1041('0x1f')]=function(_0x18e506,_0x45ee38){return db[_0x1041('0x24')]['find']({'where':{'id':_0x18e506[_0x1041('0x39')]['id']}})[_0x1041('0x1e')](handleEntityNotFound(_0x45ee38,null))[_0x1041('0x1e')](removeEntity(_0x45ee38,null))[_0x1041('0x37')](handleError(_0x45ee38,null));};exports[_0x1041('0x40')]=function(_0x2e46ad,_0x45482f){return db[_0x1041('0x24')][_0x1041('0x40')]()[_0x1041('0x1e')](respondWithResult(_0x45482f,null))[_0x1041('0x37')](handleError(_0x45482f,null));}; \ No newline at end of file +var _0x282e=['update','then','destroy','end','sendStatus','error','stack','name','send','index','map','SmsQueueReport','key','model','keys','query','fields','attributes','hasOwnProperty','order','filters','pick','where','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','create','body','find','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','Content-Range','reject'];(function(_0x3174c7,_0x4f7aa9){var _0x47b5e4=function(_0x5d8288){while(--_0x5d8288){_0x3174c7['push'](_0x3174c7['shift']());}};_0x47b5e4(++_0x4f7aa9);}(_0x282e,0x144));var _0xe282=function(_0x45e064,_0x411c6a){_0x45e064=_0x45e064-0x0;var _0x1c1ee4=_0x282e[_0x45e064];return _0x1c1ee4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe282('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe282('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe282('0x2'));var util=require(_0xe282('0x3'));var path=require(_0xe282('0x4'));var sox=require(_0xe282('0x5'));var csv=require(_0xe282('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe282('0x7'));var _=require(_0xe282('0x8'));var squel=require(_0xe282('0x9'));var crypto=require(_0xe282('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe282('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe282('0xc'));var Papa=require(_0xe282('0xd'));var Redis=require(_0xe282('0xe'));var authService=require(_0xe282('0xf'));var qs=require(_0xe282('0x10'));var as=require(_0xe282('0x11'));var hardwareService=require(_0xe282('0x12'));var logger=require(_0xe282('0x13'))(_0xe282('0x14'));var utils=require('../../config/utils');var config=require(_0xe282('0x15'));var licenseUtil=require(_0xe282('0x16'));var db=require(_0xe282('0x17'))['db'];function respondWithStatusCode(_0x4318b0,_0x4831e9){_0x4831e9=_0x4831e9||0xcc;return function(_0x1df937){if(_0x1df937){return _0x4318b0['sendStatus'](_0x4831e9);}return _0x4318b0[_0xe282('0x18')](_0x4831e9)['end']();};}function respondWithResult(_0x2a2340,_0x9550fc){_0x9550fc=_0x9550fc||0xc8;return function(_0x5a8f31){if(_0x5a8f31){return _0x2a2340[_0xe282('0x18')](_0x9550fc)['json'](_0x5a8f31);}};}function respondWithFilteredResult(_0x23654d,_0x1eed84){return function(_0x4f55fb){if(_0x4f55fb){var _0x176a43=typeof _0x1eed84[_0xe282('0x19')]===_0xe282('0x1a')&&typeof _0x1eed84['limit']===_0xe282('0x1a');var _0x41c934=_0x4f55fb['count'];var _0x1cd157=_0x176a43?0x0:_0x1eed84[_0xe282('0x19')];var _0x2304a4=_0x176a43?_0x4f55fb[_0xe282('0x1b')]:_0x1eed84[_0xe282('0x19')]+_0x1eed84[_0xe282('0x1c')];var _0x773204;if(_0x2304a4>=_0x41c934){_0x2304a4=_0x41c934;_0x773204=0xc8;}else{_0x773204=0xce;}_0x23654d['status'](_0x773204);return _0x23654d['set'](_0xe282('0x1d'),_0x1cd157+'-'+_0x2304a4+'/'+_0x41c934)['json'](_0x4f55fb);}return null;};}function patchUpdates(_0x48ab8b){return function(_0x1611f1){try{jsonpatch['apply'](_0x1611f1,_0x48ab8b,!![]);}catch(_0x4b0615){return BPromise[_0xe282('0x1e')](_0x4b0615);}return _0x1611f1['save']();};}function saveUpdates(_0x45d43d,_0x1b76f8){return function(_0x173177){if(_0x173177){return _0x173177[_0xe282('0x1f')](_0x45d43d)[_0xe282('0x20')](function(_0x20446d){return _0x20446d;});}return null;};}function removeEntity(_0x20cec4,_0x3f0bcd){return function(_0x9c57ae){if(_0x9c57ae){return _0x9c57ae[_0xe282('0x21')]()['then'](function(){_0x20cec4['status'](0xcc)[_0xe282('0x22')]();});}};}function handleEntityNotFound(_0x12a104,_0x2682ba){return function(_0x56fb93){if(!_0x56fb93){_0x12a104[_0xe282('0x23')](0x194);}return _0x56fb93;};}function handleError(_0x31dfe4,_0x242a0f){_0x242a0f=_0x242a0f||0x1f4;return function(_0x1cb2b2){logger[_0xe282('0x24')](_0x1cb2b2[_0xe282('0x25')]);if(_0x1cb2b2[_0xe282('0x26')]){delete _0x1cb2b2[_0xe282('0x26')];}_0x31dfe4[_0xe282('0x18')](_0x242a0f)[_0xe282('0x27')](_0x1cb2b2);};}exports[_0xe282('0x28')]=function(_0x1ae630,_0xaba981){var _0x1bbe7b={},_0x18632e={},_0x33065b={'count':0x0,'rows':[]};var _0x425324=_[_0xe282('0x29')](db[_0xe282('0x2a')]['rawAttributes'],function(_0xd65611){return{'name':_0xd65611['fieldName'],'type':_0xd65611['type'][_0xe282('0x2b')]};});_0x18632e[_0xe282('0x2c')]=_['map'](_0x425324,_0xe282('0x26'));_0x18632e['query']=_[_0xe282('0x2d')](_0x1ae630[_0xe282('0x2e')]);_0x18632e['filters']=_['intersection'](_0x18632e[_0xe282('0x2c')],_0x18632e[_0xe282('0x2e')]);_0x1bbe7b['attributes']=_['intersection'](_0x18632e[_0xe282('0x2c')],qs[_0xe282('0x2f')](_0x1ae630['query'][_0xe282('0x2f')]));_0x1bbe7b[_0xe282('0x30')]=_0x1bbe7b['attributes']['length']?_0x1bbe7b[_0xe282('0x30')]:_0x18632e['model'];if(!_0x1ae630['query'][_0xe282('0x31')]('nolimit')){_0x1bbe7b[_0xe282('0x1c')]=qs[_0xe282('0x1c')](_0x1ae630[_0xe282('0x2e')][_0xe282('0x1c')]);_0x1bbe7b[_0xe282('0x19')]=qs[_0xe282('0x19')](_0x1ae630[_0xe282('0x2e')][_0xe282('0x19')]);}_0x1bbe7b[_0xe282('0x32')]=qs['sort'](_0x1ae630[_0xe282('0x2e')]['sort']);_0x1bbe7b['where']=qs[_0xe282('0x33')](_[_0xe282('0x34')](_0x1ae630[_0xe282('0x2e')],_0x18632e['filters']),_0x425324);if(_0x1ae630['query']['filter']){_0x1bbe7b[_0xe282('0x35')]=_[_0xe282('0x36')](_0x1bbe7b[_0xe282('0x35')],{'$or':_[_0xe282('0x29')](_0x425324,function(_0x4298dd){if(_0x4298dd[_0xe282('0x37')]!=='VIRTUAL'){var _0x324db5={};_0x324db5[_0x4298dd[_0xe282('0x26')]]={'$like':'%'+_0x1ae630[_0xe282('0x2e')][_0xe282('0x38')]+'%'};return _0x324db5;}})});}_0x1bbe7b=_[_0xe282('0x36')]({},_0x1bbe7b,_0x1ae630[_0xe282('0x39')]);var _0x1aa424={'where':_0x1bbe7b[_0xe282('0x35')]};return db[_0xe282('0x2a')]['count'](_0x1aa424)['then'](function(_0x366a2f){_0x33065b[_0xe282('0x1b')]=_0x366a2f;if(_0x1ae630['query'][_0xe282('0x3a')]){_0x1bbe7b[_0xe282('0x3b')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xe282('0x3c')](_0x1bbe7b);})[_0xe282('0x20')](function(_0x11ebed){_0x33065b[_0xe282('0x3d')]=_0x11ebed;return _0x33065b;})['then'](respondWithFilteredResult(_0xaba981,_0x1bbe7b))[_0xe282('0x3e')](handleError(_0xaba981,null));};exports[_0xe282('0x3f')]=function(_0x1360b5,_0x4f237c){var _0x11d41e={'raw':!![],'where':{'id':_0x1360b5[_0xe282('0x40')]['id']}},_0x51080c={};_0x51080c['model']=_[_0xe282('0x2d')](db['SmsQueueReport'][_0xe282('0x41')]);_0x51080c['query']=_[_0xe282('0x2d')](_0x1360b5[_0xe282('0x2e')]);_0x51080c[_0xe282('0x33')]=_[_0xe282('0x42')](_0x51080c[_0xe282('0x2c')],_0x51080c[_0xe282('0x2e')]);_0x11d41e[_0xe282('0x30')]=_[_0xe282('0x42')](_0x51080c[_0xe282('0x2c')],qs[_0xe282('0x2f')](_0x1360b5['query'][_0xe282('0x2f')]));_0x11d41e['attributes']=_0x11d41e[_0xe282('0x30')][_0xe282('0x43')]?_0x11d41e[_0xe282('0x30')]:_0x51080c[_0xe282('0x2c')];if(_0x1360b5[_0xe282('0x2e')][_0xe282('0x3a')]){_0x11d41e[_0xe282('0x3b')]=[{'all':!![]}];}_0x11d41e=_[_0xe282('0x36')]({},_0x11d41e,_0x1360b5[_0xe282('0x39')]);return db[_0xe282('0x2a')]['find'](_0x11d41e)['then'](handleEntityNotFound(_0x4f237c,null))[_0xe282('0x20')](respondWithResult(_0x4f237c,null))['catch'](handleError(_0x4f237c,null));};exports['create']=function(_0x2a2c76,_0x5f3075){return db[_0xe282('0x2a')][_0xe282('0x44')](_0x2a2c76[_0xe282('0x45')],{})[_0xe282('0x20')](respondWithResult(_0x5f3075,0xc9))['catch'](handleError(_0x5f3075,null));};exports[_0xe282('0x1f')]=function(_0x3a82d8,_0x3ea80d){if(_0x3a82d8[_0xe282('0x45')]['id']){delete _0x3a82d8[_0xe282('0x45')]['id'];}return db[_0xe282('0x2a')][_0xe282('0x46')]({'where':{'id':_0x3a82d8['params']['id']}})[_0xe282('0x20')](handleEntityNotFound(_0x3ea80d,null))[_0xe282('0x20')](saveUpdates(_0x3a82d8['body'],null))['then'](respondWithResult(_0x3ea80d,null))['catch'](handleError(_0x3ea80d,null));};exports['destroy']=function(_0x189e58,_0x2fe0b9){return db['SmsQueueReport'][_0xe282('0x46')]({'where':{'id':_0x189e58['params']['id']}})['then'](handleEntityNotFound(_0x2fe0b9,null))[_0xe282('0x20')](removeEntity(_0x2fe0b9,null))['catch'](handleError(_0x2fe0b9,null));};exports['describe']=function(_0x5575d0,_0x2bea2b){return db[_0xe282('0x2a')]['describe']()['then'](respondWithResult(_0x2bea2b,null))[_0xe282('0x3e')](handleError(_0x2bea2b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 6c6cef5..d2a23a1 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27f48f,_0x55e2aa){var _0x5cbcfc=function(_0x5f5069){while(--_0x5f5069){_0x27f48f['push'](_0x27f48f['shift']());}};_0x5cbcfc(++_0x55e2aa);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x236098,_0x5b7c1a){var _0x1ea445=function(_0x4ad4ca){while(--_0x4ad4ca){_0x236098['push'](_0x236098['shift']());}};_0x1ea445(++_0x5b7c1a);}(_0x70e0,0x17b));var _0x070e=function(_0x2181fe,_0xffef8d){_0x2181fe=_0x2181fe-0x0;var _0x1ed2e5=_0x70e0[_0x2181fe];return _0x1ed2e5;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b9eb5e4..6bf50ad 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 _0x6890=['raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','SmsQueueReport','body','options'];(function(_0x53d7b0,_0x51a9ea){var _0x11211f=function(_0xe41f8c){while(--_0xe41f8c){_0x53d7b0['push'](_0x53d7b0['shift']());}};_0x11211f(++_0x51a9ea);}(_0x6890,0x8a));var _0x0689=function(_0x50beda,_0x59b77c){_0x50beda=_0x50beda-0x0;var _0x2b80b6=_0x6890[_0x50beda];return _0x2b80b6;};'use strict';var _=require(_0x0689('0x0'));var util=require('util');var moment=require(_0x0689('0x1'));var BPromise=require(_0x0689('0x2'));var rs=require(_0x0689('0x3'));var fs=require('fs');var Redis=require(_0x0689('0x4'));var db=require(_0x0689('0x5'))['db'];var utils=require(_0x0689('0x6'));var logger=require(_0x0689('0x7'))(_0x0689('0x8'));var config=require('../../config/environment');var jayson=require(_0x0689('0x9'));var client=jayson[_0x0689('0xa')][_0x0689('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d71c8,_0x14032,_0x13c17f){return new BPromise(function(_0x5030fb,_0x205924){return client[_0x0689('0xc')](_0x2d71c8,_0x13c17f)[_0x0689('0xd')](function(_0x406f05){logger[_0x0689('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x14032,'request\x20sent');logger[_0x0689('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x14032,_0x0689('0x10'),JSON[_0x0689('0x11')](_0x406f05));if(_0x406f05[_0x0689('0x12')]){if(_0x406f05[_0x0689('0x12')][_0x0689('0x13')]===0x1f4){logger[_0x0689('0x12')](_0x0689('0x14'),_0x14032,_0x406f05[_0x0689('0x12')]['message']);return _0x205924(_0x406f05['error']['message']);}logger[_0x0689('0x12')](_0x0689('0x14'),_0x14032,_0x406f05[_0x0689('0x12')][_0x0689('0x15')]);return _0x5030fb(_0x406f05[_0x0689('0x12')][_0x0689('0x15')]);}else{logger[_0x0689('0xe')](_0x0689('0x14'),_0x14032,'request\x20sent');_0x5030fb(_0x406f05[_0x0689('0x16')][_0x0689('0x15')]);}})[_0x0689('0x17')](function(_0x4c5815){logger[_0x0689('0x12')](_0x0689('0x14'),_0x14032,_0x4c5815);_0x205924(_0x4c5815);});});}exports['CreateSmsQueueReport']=function(_0x14cd54){var _0x1f905a=this;return new Promise(function(_0xaa6c9e,_0x23ea29){return db[_0x0689('0x18')]['create'](_0x14cd54[_0x0689('0x19')],{'raw':_0x14cd54[_0x0689('0x1a')]?_0x14cd54[_0x0689('0x1a')][_0x0689('0x1b')]===undefined?!![]:![]:!![]})[_0x0689('0xd')](function(_0x277ae9){logger[_0x0689('0xe')](_0x0689('0x1c'),_0x14cd54);logger['debug'](_0x0689('0x1c'),_0x14cd54,JSON[_0x0689('0x11')](_0x277ae9));_0xaa6c9e(_0x277ae9);})['catch'](function(_0x38b431){logger[_0x0689('0x12')](_0x0689('0x1c'),_0x38b431[_0x0689('0x15')],_0x14cd54);_0x23ea29(_0x1f905a[_0x0689('0x12')](0x1f4,_0x38b431['message']));});});};exports[_0x0689('0x1d')]=function(_0x4cc412){var _0x3ee63f=this;return new Promise(function(_0x5a473c,_0x2d31d7){return db['SmsQueueReport'][_0x0689('0x1e')](_0x4cc412['body'],{'raw':_0x4cc412[_0x0689('0x1a')]?_0x4cc412[_0x0689('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cc412[_0x0689('0x1a')]?_0x4cc412[_0x0689('0x1a')][_0x0689('0x1f')]||null:null,'attributes':_0x4cc412[_0x0689('0x1a')]?_0x4cc412[_0x0689('0x1a')][_0x0689('0x20')]||null:null,'limit':_0x4cc412['options']?_0x4cc412[_0x0689('0x1a')]['limit']||null:null})['then'](function(_0x1d6edb){logger[_0x0689('0xe')](_0x0689('0x1d'),_0x4cc412);logger[_0x0689('0xf')](_0x0689('0x1d'),_0x4cc412,JSON[_0x0689('0x11')](_0x1d6edb));_0x5a473c(_0x1d6edb);})[_0x0689('0x17')](function(_0x130da2){logger[_0x0689('0x12')](_0x0689('0x1d'),_0x130da2[_0x0689('0x15')],_0x4cc412);_0x2d31d7(_0x3ee63f[_0x0689('0x12')](0x1f4,_0x130da2['message']));});});}; \ No newline at end of file +var _0xfaad=['then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4130c3,_0x4216fb){var _0x10e68d=function(_0x2be3f7){while(--_0x2be3f7){_0x4130c3['push'](_0x4130c3['shift']());}};_0x10e68d(++_0x4216fb);}(_0xfaad,0x94));var _0xdfaa=function(_0x48715e,_0x103c9e){_0x48715e=_0x48715e-0x0;var _0x32a705=_0xfaad[_0x48715e];return _0x32a705;};'use strict';var _=require('lodash');var util=require(_0xdfaa('0x0'));var moment=require(_0xdfaa('0x1'));var BPromise=require(_0xdfaa('0x2'));var rs=require(_0xdfaa('0x3'));var fs=require('fs');var Redis=require(_0xdfaa('0x4'));var db=require(_0xdfaa('0x5'))['db'];var utils=require(_0xdfaa('0x6'));var logger=require(_0xdfaa('0x7'))('rpc');var config=require(_0xdfaa('0x8'));var jayson=require(_0xdfaa('0x9'));var client=jayson[_0xdfaa('0xa')][_0xdfaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25fdc2,_0x1682bd,_0xe19d79){return new BPromise(function(_0x238e5b,_0x3a839a){return client['request'](_0x25fdc2,_0xe19d79)[_0xdfaa('0xc')](function(_0x69b274){logger['info'](_0xdfaa('0xd'),_0x1682bd,_0xdfaa('0xe'));logger[_0xdfaa('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1682bd,_0xdfaa('0xe'),JSON[_0xdfaa('0x10')](_0x69b274));if(_0x69b274[_0xdfaa('0x11')]){if(_0x69b274['error'][_0xdfaa('0x12')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x1682bd,_0x69b274[_0xdfaa('0x11')][_0xdfaa('0x13')]);return _0x3a839a(_0x69b274[_0xdfaa('0x11')]['message']);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x1682bd,_0x69b274['error']['message']);return _0x238e5b(_0x69b274[_0xdfaa('0x11')]['message']);}else{logger[_0xdfaa('0x14')](_0xdfaa('0xd'),_0x1682bd,'request\x20sent');_0x238e5b(_0x69b274[_0xdfaa('0x15')]['message']);}})[_0xdfaa('0x16')](function(_0x564465){logger[_0xdfaa('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1682bd,_0x564465);_0x3a839a(_0x564465);});});}exports[_0xdfaa('0x17')]=function(_0x599d90){var _0x33e53a=this;return new Promise(function(_0x384657,_0x141969){return db[_0xdfaa('0x18')][_0xdfaa('0x19')](_0x599d90[_0xdfaa('0x1a')],{'raw':_0x599d90[_0xdfaa('0x1b')]?_0x599d90['options']['raw']===undefined?!![]:![]:!![]})[_0xdfaa('0xc')](function(_0x594a9a){logger[_0xdfaa('0x14')](_0xdfaa('0x17'),_0x599d90);logger['debug']('CreateSmsQueueReport',_0x599d90,JSON[_0xdfaa('0x10')](_0x594a9a));_0x384657(_0x594a9a);})[_0xdfaa('0x16')](function(_0x2d8353){logger['error'](_0xdfaa('0x17'),_0x2d8353[_0xdfaa('0x13')],_0x599d90);_0x141969(_0x33e53a[_0xdfaa('0x11')](0x1f4,_0x2d8353['message']));});});};exports[_0xdfaa('0x1c')]=function(_0x55e5c2){var _0x445bbb=this;return new Promise(function(_0x3ad9de,_0x282646){return db[_0xdfaa('0x18')][_0xdfaa('0x1d')](_0x55e5c2[_0xdfaa('0x1a')],{'raw':_0x55e5c2[_0xdfaa('0x1b')]?_0x55e5c2[_0xdfaa('0x1b')][_0xdfaa('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e5c2[_0xdfaa('0x1b')]?_0x55e5c2[_0xdfaa('0x1b')]['where']||null:null,'attributes':_0x55e5c2['options']?_0x55e5c2[_0xdfaa('0x1b')][_0xdfaa('0x1f')]||null:null,'limit':_0x55e5c2['options']?_0x55e5c2[_0xdfaa('0x1b')]['limit']||null:null})[_0xdfaa('0xc')](function(_0x2b80ed){logger[_0xdfaa('0x14')]('UpdateSmsQueueReport',_0x55e5c2);logger[_0xdfaa('0xf')](_0xdfaa('0x1c'),_0x55e5c2,JSON[_0xdfaa('0x10')](_0x2b80ed));_0x3ad9de(_0x2b80ed);})[_0xdfaa('0x16')](function(_0x3852b7){logger[_0xdfaa('0x11')](_0xdfaa('0x1c'),_0x3852b7[_0xdfaa('0x13')],_0x55e5c2);_0x282646(_0x445bbb['error'](0x1f4,_0x3852b7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index aac2173..091017c 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 _0x31f0=['./smsTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x6c6630,_0x420022){var _0xc5fec9=function(_0x3b9571){while(--_0x3b9571){_0x6c6630['push'](_0x6c6630['shift']());}};_0xc5fec9(++_0x420022);}(_0x31f0,0xb7));var _0x031f=function(_0x3c2922,_0xdbe8f6){_0x3c2922=_0x3c2922-0x0;var _0x1549af=_0x31f0[_0x3c2922];return _0x1549af;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x031f('0x8')]('/describe',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0x8')](_0x031f('0xb'),auth['isAuthenticated'](),controller[_0x031f('0xc')]);router[_0x031f('0xd')]('/',auth[_0x031f('0x9')](),controller[_0x031f('0xe')]);router[_0x031f('0xf')](_0x031f('0xb'),auth[_0x031f('0x9')](),controller[_0x031f('0x10')]);router['delete'](_0x031f('0xb'),auth[_0x031f('0x9')](),controller[_0x031f('0x11')]);module[_0x031f('0x12')]=router; \ No newline at end of file +var _0xfd0f=['index','/describe','describe','/:id','show','post','put','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated'];(function(_0x532030,_0x1f1869){var _0xaa320=function(_0x27e5e9){while(--_0x27e5e9){_0x532030['push'](_0x532030['shift']());}};_0xaa320(++_0x1f1869);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x380135,_0x5e289c){_0x380135=_0x380135-0x0;var _0x4aed98=_0xfd0f[_0x380135];return _0x4aed98;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffd0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd0('0x6'));var controller=require(_0xffd0('0x7'));router[_0xffd0('0x8')]('/',auth[_0xffd0('0x9')](),controller[_0xffd0('0xa')]);router[_0xffd0('0x8')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xc')]);router['get'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xe')]);router[_0xffd0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xffd0('0x10')](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['update']);router['delete'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['destroy']);module[_0xffd0('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 30546a3..2d3e7aa 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3333bb,_0x1df222){var _0x273d39=function(_0x5c411b){while(--_0x5c411b){_0x3333bb['push'](_0x3333bb['shift']());}};_0x273d39(++_0x1df222);}(_0x34e8,0x12c));var _0x834e=function(_0x5cd50e,_0x3b28b2){_0x5cd50e=_0x5cd50e-0x0;var _0x5e1fb2=_0x34e8[_0x5cd50e];return _0x5e1fb2;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3cbdc8,_0x5a16bb){var _0x19288a=function(_0x132780){while(--_0x132780){_0x3cbdc8['push'](_0x3cbdc8['shift']());}};_0x19288a(++_0x5a16bb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0xcb91[_0x393500];return _0x120d3b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6a1601a..d8050ed 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 _0x1d5f=['Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset'];(function(_0x6021f3,_0x36e9d5){var _0x257986=function(_0x45cb25){while(--_0x45cb25){_0x6021f3['push'](_0x6021f3['shift']());}};_0x257986(++_0x36e9d5);}(_0x1d5f,0x110));var _0xf1d5=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x1d5f[_0x220afa];return _0x1b79d1;};'use strict';var emlformat=require(_0xf1d5('0x0'));var rimraf=require(_0xf1d5('0x1'));var zipdir=require(_0xf1d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1d5('0x3'));var moment=require(_0xf1d5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf1d5('0x5'));var path=require(_0xf1d5('0x6'));var sox=require(_0xf1d5('0x7'));var csv=require('to-csv');var ejs=require(_0xf1d5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1d5('0x9'));var squel=require(_0xf1d5('0xa'));var crypto=require(_0xf1d5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf1d5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf1d5('0xd'));var Papa=require(_0xf1d5('0xe'));var Redis=require(_0xf1d5('0xf'));var authService=require(_0xf1d5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf1d5('0x11'));var hardwareService=require(_0xf1d5('0x12'));var logger=require(_0xf1d5('0x13'))(_0xf1d5('0x14'));var utils=require(_0xf1d5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf1d5('0x16'));var db=require(_0xf1d5('0x17'))['db'];function respondWithStatusCode(_0x3fe9a2,_0x27d972){_0x27d972=_0x27d972||0xcc;return function(_0x262cd6){if(_0x262cd6){return _0x3fe9a2[_0xf1d5('0x18')](_0x27d972);}return _0x3fe9a2[_0xf1d5('0x19')](_0x27d972)[_0xf1d5('0x1a')]();};}function respondWithResult(_0x4e3a93,_0x3d83b8){_0x3d83b8=_0x3d83b8||0xc8;return function(_0x1d0d0e){if(_0x1d0d0e){return _0x4e3a93[_0xf1d5('0x19')](_0x3d83b8)[_0xf1d5('0x1b')](_0x1d0d0e);}};}function respondWithFilteredResult(_0x108a95,_0x22ca92){return function(_0x2f51ce){if(_0x2f51ce){var _0x5d64af=typeof _0x22ca92['offset']==='undefined'&&typeof _0x22ca92[_0xf1d5('0x1c')]===_0xf1d5('0x1d');var _0x5a8b4b=_0x2f51ce[_0xf1d5('0x1e')];var _0x3ef34b=_0x5d64af?0x0:_0x22ca92[_0xf1d5('0x1f')];var _0x2f486f=_0x5d64af?_0x2f51ce[_0xf1d5('0x1e')]:_0x22ca92['offset']+_0x22ca92[_0xf1d5('0x1c')];var _0x1bd953;if(_0x2f486f>=_0x5a8b4b){_0x2f486f=_0x5a8b4b;_0x1bd953=0xc8;}else{_0x1bd953=0xce;}_0x108a95[_0xf1d5('0x19')](_0x1bd953);return _0x108a95['set'](_0xf1d5('0x20'),_0x3ef34b+'-'+_0x2f486f+'/'+_0x5a8b4b)[_0xf1d5('0x1b')](_0x2f51ce);}return null;};}function patchUpdates(_0x14c832){return function(_0x1776f9){try{jsonpatch[_0xf1d5('0x21')](_0x1776f9,_0x14c832,!![]);}catch(_0x21024f){return BPromise[_0xf1d5('0x22')](_0x21024f);}return _0x1776f9[_0xf1d5('0x23')]();};}function saveUpdates(_0x4726f5,_0x205059){return function(_0x59c926){if(_0x59c926){return _0x59c926[_0xf1d5('0x24')](_0x4726f5)['then'](function(_0x55d12d){return _0x55d12d;});}return null;};}function removeEntity(_0x2a8992,_0x5e453f){return function(_0x4d9558){if(_0x4d9558){return _0x4d9558[_0xf1d5('0x25')]()[_0xf1d5('0x26')](function(){_0x2a8992[_0xf1d5('0x19')](0xcc)[_0xf1d5('0x1a')]();});}};}function handleEntityNotFound(_0x360bee,_0x12c304){return function(_0x1eaa69){if(!_0x1eaa69){_0x360bee[_0xf1d5('0x18')](0x194);}return _0x1eaa69;};}function handleError(_0x14f60c,_0x3f0277){_0x3f0277=_0x3f0277||0x1f4;return function(_0x2363e1){logger[_0xf1d5('0x27')](_0x2363e1['stack']);if(_0x2363e1[_0xf1d5('0x28')]){delete _0x2363e1[_0xf1d5('0x28')];}_0x14f60c[_0xf1d5('0x19')](_0x3f0277)['send'](_0x2363e1);};}exports[_0xf1d5('0x29')]=function(_0x28e442,_0x78352c){var _0x2c3810={},_0x17c48c={},_0xfc8af7={'count':0x0,'rows':[]};var _0x3f7e94=_[_0xf1d5('0x2a')](db[_0xf1d5('0x2b')]['rawAttributes'],function(_0x1c5eec){return{'name':_0x1c5eec[_0xf1d5('0x2c')],'type':_0x1c5eec[_0xf1d5('0x2d')][_0xf1d5('0x2e')]};});_0x17c48c[_0xf1d5('0x2f')]=_[_0xf1d5('0x2a')](_0x3f7e94,_0xf1d5('0x28'));_0x17c48c[_0xf1d5('0x30')]=_[_0xf1d5('0x31')](_0x28e442[_0xf1d5('0x30')]);_0x17c48c['filters']=_[_0xf1d5('0x32')](_0x17c48c[_0xf1d5('0x2f')],_0x17c48c[_0xf1d5('0x30')]);_0x2c3810[_0xf1d5('0x33')]=_[_0xf1d5('0x32')](_0x17c48c[_0xf1d5('0x2f')],qs[_0xf1d5('0x34')](_0x28e442[_0xf1d5('0x30')][_0xf1d5('0x34')]));_0x2c3810[_0xf1d5('0x33')]=_0x2c3810[_0xf1d5('0x33')][_0xf1d5('0x35')]?_0x2c3810[_0xf1d5('0x33')]:_0x17c48c[_0xf1d5('0x2f')];if(!_0x28e442[_0xf1d5('0x30')]['hasOwnProperty'](_0xf1d5('0x36'))){_0x2c3810[_0xf1d5('0x1c')]=qs[_0xf1d5('0x1c')](_0x28e442[_0xf1d5('0x30')][_0xf1d5('0x1c')]);_0x2c3810['offset']=qs[_0xf1d5('0x1f')](_0x28e442[_0xf1d5('0x30')][_0xf1d5('0x1f')]);}_0x2c3810[_0xf1d5('0x37')]=qs[_0xf1d5('0x38')](_0x28e442['query'][_0xf1d5('0x38')]);_0x2c3810['where']=qs[_0xf1d5('0x39')](_[_0xf1d5('0x3a')](_0x28e442['query'],_0x17c48c[_0xf1d5('0x39')]),_0x3f7e94);if(_0x28e442[_0xf1d5('0x30')][_0xf1d5('0x3b')]){_0x2c3810[_0xf1d5('0x3c')]=_[_0xf1d5('0x3d')](_0x2c3810[_0xf1d5('0x3c')],{'$or':_[_0xf1d5('0x2a')](_0x3f7e94,function(_0x2b861c){if(_0x2b861c['type']!==_0xf1d5('0x3e')){var _0x177141={};_0x177141[_0x2b861c['name']]={'$like':'%'+_0x28e442[_0xf1d5('0x30')][_0xf1d5('0x3b')]+'%'};return _0x177141;}})});}_0x2c3810=_[_0xf1d5('0x3d')]({},_0x2c3810,_0x28e442['options']);var _0x5651f8={'where':_0x2c3810[_0xf1d5('0x3c')]};return db[_0xf1d5('0x2b')]['count'](_0x5651f8)['then'](function(_0x4e0379){_0xfc8af7[_0xf1d5('0x1e')]=_0x4e0379;if(_0x28e442[_0xf1d5('0x30')][_0xf1d5('0x3f')]){_0x2c3810[_0xf1d5('0x40')]=[{'all':!![]}];}return db[_0xf1d5('0x2b')][_0xf1d5('0x41')](_0x2c3810);})[_0xf1d5('0x26')](function(_0x88db09){_0xfc8af7[_0xf1d5('0x42')]=_0x88db09;return _0xfc8af7;})[_0xf1d5('0x26')](respondWithFilteredResult(_0x78352c,_0x2c3810))['catch'](handleError(_0x78352c,null));};exports[_0xf1d5('0x43')]=function(_0x37b0b1,_0x2b3ae0){var _0x3cbfdc={'raw':!![],'where':{'id':_0x37b0b1[_0xf1d5('0x44')]['id']}},_0x22821f={};_0x22821f[_0xf1d5('0x2f')]=_[_0xf1d5('0x31')](db[_0xf1d5('0x2b')][_0xf1d5('0x45')]);_0x22821f[_0xf1d5('0x30')]=_[_0xf1d5('0x31')](_0x37b0b1[_0xf1d5('0x30')]);_0x22821f[_0xf1d5('0x39')]=_[_0xf1d5('0x32')](_0x22821f[_0xf1d5('0x2f')],_0x22821f[_0xf1d5('0x30')]);_0x3cbfdc['attributes']=_['intersection'](_0x22821f[_0xf1d5('0x2f')],qs[_0xf1d5('0x34')](_0x37b0b1[_0xf1d5('0x30')][_0xf1d5('0x34')]));_0x3cbfdc['attributes']=_0x3cbfdc['attributes'][_0xf1d5('0x35')]?_0x3cbfdc['attributes']:_0x22821f['model'];if(_0x37b0b1[_0xf1d5('0x30')][_0xf1d5('0x3f')]){_0x3cbfdc[_0xf1d5('0x40')]=[{'all':!![]}];}_0x3cbfdc=_[_0xf1d5('0x3d')]({},_0x3cbfdc,_0x37b0b1[_0xf1d5('0x46')]);return db['SmsTransferReport'][_0xf1d5('0x47')](_0x3cbfdc)[_0xf1d5('0x26')](handleEntityNotFound(_0x2b3ae0,null))[_0xf1d5('0x26')](respondWithResult(_0x2b3ae0,null))[_0xf1d5('0x48')](handleError(_0x2b3ae0,null));};exports['create']=function(_0x5878bd,_0x1d8d3b){return db['SmsTransferReport'][_0xf1d5('0x49')](_0x5878bd[_0xf1d5('0x4a')],{})['then'](respondWithResult(_0x1d8d3b,0xc9))[_0xf1d5('0x48')](handleError(_0x1d8d3b,null));};exports[_0xf1d5('0x24')]=function(_0x50c175,_0x2d3f2e){if(_0x50c175['body']['id']){delete _0x50c175[_0xf1d5('0x4a')]['id'];}return db[_0xf1d5('0x2b')]['find']({'where':{'id':_0x50c175[_0xf1d5('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d3f2e,null))[_0xf1d5('0x26')](saveUpdates(_0x50c175[_0xf1d5('0x4a')],null))[_0xf1d5('0x26')](respondWithResult(_0x2d3f2e,null))[_0xf1d5('0x48')](handleError(_0x2d3f2e,null));};exports[_0xf1d5('0x25')]=function(_0x57087d,_0x46d521){return db[_0xf1d5('0x2b')]['find']({'where':{'id':_0x57087d[_0xf1d5('0x44')]['id']}})[_0xf1d5('0x26')](handleEntityNotFound(_0x46d521,null))[_0xf1d5('0x26')](removeEntity(_0x46d521,null))['catch'](handleError(_0x46d521,null));};exports[_0xf1d5('0x4b')]=function(_0x239f8b,_0x19c63c){return db[_0xf1d5('0x2b')][_0xf1d5('0x4b')]()['then'](respondWithResult(_0x19c63c,null))['catch'](handleError(_0x19c63c,null));}; \ No newline at end of file +var _0xf3ad=['options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x2623a4,_0x344dae){var _0x382487=function(_0x8bb37f){while(--_0x8bb37f){_0x2623a4['push'](_0x2623a4['shift']());}};_0x382487(++_0x344dae);}(_0xf3ad,0xee));var _0xdf3a=function(_0x10b41e,_0x55ba1c){_0x10b41e=_0x10b41e-0x0;var _0x248a6f=_0xf3ad[_0x10b41e];return _0x248a6f;};'use strict';var emlformat=require(_0xdf3a('0x0'));var rimraf=require(_0xdf3a('0x1'));var zipdir=require(_0xdf3a('0x2'));var jsonpatch=require(_0xdf3a('0x3'));var rp=require('request-promise');var moment=require(_0xdf3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf3a('0x5'));var util=require(_0xdf3a('0x6'));var path=require(_0xdf3a('0x7'));var sox=require(_0xdf3a('0x8'));var csv=require(_0xdf3a('0x9'));var ejs=require(_0xdf3a('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3a('0xb'));var _=require(_0xdf3a('0xc'));var squel=require('squel');var crypto=require(_0xdf3a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdf3a('0xe'));var toCsv=require(_0xdf3a('0x9'));var querystring=require('querystring');var Papa=require(_0xdf3a('0xf'));var Redis=require('ioredis');var authService=require(_0xdf3a('0x10'));var qs=require(_0xdf3a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf3a('0x12'));var utils=require(_0xdf3a('0x13'));var config=require(_0xdf3a('0x14'));var licenseUtil=require(_0xdf3a('0x15'));var db=require(_0xdf3a('0x16'))['db'];function respondWithStatusCode(_0x1cb9a3,_0x3cab76){_0x3cab76=_0x3cab76||0xcc;return function(_0x32a3b8){if(_0x32a3b8){return _0x1cb9a3[_0xdf3a('0x17')](_0x3cab76);}return _0x1cb9a3[_0xdf3a('0x18')](_0x3cab76)[_0xdf3a('0x19')]();};}function respondWithResult(_0x1c8d19,_0x3aa4a9){_0x3aa4a9=_0x3aa4a9||0xc8;return function(_0x5ac03b){if(_0x5ac03b){return _0x1c8d19[_0xdf3a('0x18')](_0x3aa4a9)[_0xdf3a('0x1a')](_0x5ac03b);}};}function respondWithFilteredResult(_0x109242,_0x3eaace){return function(_0x1ec28e){if(_0x1ec28e){var _0xea4ec=typeof _0x3eaace[_0xdf3a('0x1b')]===_0xdf3a('0x1c')&&typeof _0x3eaace['limit']===_0xdf3a('0x1c');var _0x49e613=_0x1ec28e[_0xdf3a('0x1d')];var _0x3652e4=_0xea4ec?0x0:_0x3eaace[_0xdf3a('0x1b')];var _0x1896d3=_0xea4ec?_0x1ec28e[_0xdf3a('0x1d')]:_0x3eaace[_0xdf3a('0x1b')]+_0x3eaace[_0xdf3a('0x1e')];var _0x2e7a27;if(_0x1896d3>=_0x49e613){_0x1896d3=_0x49e613;_0x2e7a27=0xc8;}else{_0x2e7a27=0xce;}_0x109242['status'](_0x2e7a27);return _0x109242[_0xdf3a('0x1f')]('Content-Range',_0x3652e4+'-'+_0x1896d3+'/'+_0x49e613)[_0xdf3a('0x1a')](_0x1ec28e);}return null;};}function patchUpdates(_0x2a4d13){return function(_0x210938){try{jsonpatch[_0xdf3a('0x20')](_0x210938,_0x2a4d13,!![]);}catch(_0x5f052e){return BPromise[_0xdf3a('0x21')](_0x5f052e);}return _0x210938[_0xdf3a('0x22')]();};}function saveUpdates(_0x59ea3f,_0x7e095a){return function(_0x4d9448){if(_0x4d9448){return _0x4d9448[_0xdf3a('0x23')](_0x59ea3f)[_0xdf3a('0x24')](function(_0x261e63){return _0x261e63;});}return null;};}function removeEntity(_0x31bb2c,_0x21d10f){return function(_0x1d4dc1){if(_0x1d4dc1){return _0x1d4dc1['destroy']()[_0xdf3a('0x24')](function(){_0x31bb2c[_0xdf3a('0x18')](0xcc)[_0xdf3a('0x19')]();});}};}function handleEntityNotFound(_0x10c822,_0x521c60){return function(_0x236395){if(!_0x236395){_0x10c822['sendStatus'](0x194);}return _0x236395;};}function handleError(_0x26dca6,_0x16a5cd){_0x16a5cd=_0x16a5cd||0x1f4;return function(_0x17ed6c){logger['error'](_0x17ed6c[_0xdf3a('0x25')]);if(_0x17ed6c['name']){delete _0x17ed6c[_0xdf3a('0x26')];}_0x26dca6['status'](_0x16a5cd)['send'](_0x17ed6c);};}exports[_0xdf3a('0x27')]=function(_0x29dce5,_0x1ab248){var _0x2b1ccc={},_0x340b40={},_0x41e6c3={'count':0x0,'rows':[]};var _0x652009=_[_0xdf3a('0x28')](db[_0xdf3a('0x29')][_0xdf3a('0x2a')],function(_0x431221){return{'name':_0x431221[_0xdf3a('0x2b')],'type':_0x431221[_0xdf3a('0x2c')][_0xdf3a('0x2d')]};});_0x340b40[_0xdf3a('0x2e')]=_[_0xdf3a('0x28')](_0x652009,_0xdf3a('0x26'));_0x340b40[_0xdf3a('0x2f')]=_[_0xdf3a('0x30')](_0x29dce5[_0xdf3a('0x2f')]);_0x340b40[_0xdf3a('0x31')]=_['intersection'](_0x340b40[_0xdf3a('0x2e')],_0x340b40[_0xdf3a('0x2f')]);_0x2b1ccc[_0xdf3a('0x32')]=_[_0xdf3a('0x33')](_0x340b40['model'],qs['fields'](_0x29dce5['query'][_0xdf3a('0x34')]));_0x2b1ccc['attributes']=_0x2b1ccc[_0xdf3a('0x32')][_0xdf3a('0x35')]?_0x2b1ccc[_0xdf3a('0x32')]:_0x340b40[_0xdf3a('0x2e')];if(!_0x29dce5['query'][_0xdf3a('0x36')]('nolimit')){_0x2b1ccc[_0xdf3a('0x1e')]=qs[_0xdf3a('0x1e')](_0x29dce5[_0xdf3a('0x2f')][_0xdf3a('0x1e')]);_0x2b1ccc[_0xdf3a('0x1b')]=qs['offset'](_0x29dce5[_0xdf3a('0x2f')][_0xdf3a('0x1b')]);}_0x2b1ccc[_0xdf3a('0x37')]=qs[_0xdf3a('0x38')](_0x29dce5[_0xdf3a('0x2f')][_0xdf3a('0x38')]);_0x2b1ccc[_0xdf3a('0x39')]=qs['filters'](_[_0xdf3a('0x3a')](_0x29dce5[_0xdf3a('0x2f')],_0x340b40[_0xdf3a('0x31')]),_0x652009);if(_0x29dce5[_0xdf3a('0x2f')]['filter']){_0x2b1ccc[_0xdf3a('0x39')]=_[_0xdf3a('0x3b')](_0x2b1ccc['where'],{'$or':_['map'](_0x652009,function(_0x618751){if(_0x618751[_0xdf3a('0x2c')]!==_0xdf3a('0x3c')){var _0x21c7ff={};_0x21c7ff[_0x618751['name']]={'$like':'%'+_0x29dce5[_0xdf3a('0x2f')][_0xdf3a('0x3d')]+'%'};return _0x21c7ff;}})});}_0x2b1ccc=_[_0xdf3a('0x3b')]({},_0x2b1ccc,_0x29dce5[_0xdf3a('0x3e')]);var _0x23e8ac={'where':_0x2b1ccc[_0xdf3a('0x39')]};return db[_0xdf3a('0x29')][_0xdf3a('0x1d')](_0x23e8ac)[_0xdf3a('0x24')](function(_0x1d7b41){_0x41e6c3[_0xdf3a('0x1d')]=_0x1d7b41;if(_0x29dce5['query'][_0xdf3a('0x3f')]){_0x2b1ccc[_0xdf3a('0x40')]=[{'all':!![]}];}return db[_0xdf3a('0x29')][_0xdf3a('0x41')](_0x2b1ccc);})[_0xdf3a('0x24')](function(_0x746a41){_0x41e6c3[_0xdf3a('0x42')]=_0x746a41;return _0x41e6c3;})[_0xdf3a('0x24')](respondWithFilteredResult(_0x1ab248,_0x2b1ccc))[_0xdf3a('0x43')](handleError(_0x1ab248,null));};exports[_0xdf3a('0x44')]=function(_0x452488,_0x1b0a25){var _0x2d3a25={'raw':!![],'where':{'id':_0x452488[_0xdf3a('0x45')]['id']}},_0x82ae81={};_0x82ae81['model']=_[_0xdf3a('0x30')](db[_0xdf3a('0x29')][_0xdf3a('0x2a')]);_0x82ae81[_0xdf3a('0x2f')]=_[_0xdf3a('0x30')](_0x452488[_0xdf3a('0x2f')]);_0x82ae81['filters']=_[_0xdf3a('0x33')](_0x82ae81[_0xdf3a('0x2e')],_0x82ae81['query']);_0x2d3a25[_0xdf3a('0x32')]=_['intersection'](_0x82ae81[_0xdf3a('0x2e')],qs['fields'](_0x452488[_0xdf3a('0x2f')][_0xdf3a('0x34')]));_0x2d3a25[_0xdf3a('0x32')]=_0x2d3a25[_0xdf3a('0x32')]['length']?_0x2d3a25[_0xdf3a('0x32')]:_0x82ae81['model'];if(_0x452488[_0xdf3a('0x2f')]['includeAll']){_0x2d3a25[_0xdf3a('0x40')]=[{'all':!![]}];}_0x2d3a25=_[_0xdf3a('0x3b')]({},_0x2d3a25,_0x452488['options']);return db[_0xdf3a('0x29')]['find'](_0x2d3a25)[_0xdf3a('0x24')](handleEntityNotFound(_0x1b0a25,null))['then'](respondWithResult(_0x1b0a25,null))[_0xdf3a('0x43')](handleError(_0x1b0a25,null));};exports[_0xdf3a('0x46')]=function(_0x398e2c,_0x14f2f1){return db['SmsTransferReport'][_0xdf3a('0x46')](_0x398e2c[_0xdf3a('0x47')],{})[_0xdf3a('0x24')](respondWithResult(_0x14f2f1,0xc9))[_0xdf3a('0x43')](handleError(_0x14f2f1,null));};exports[_0xdf3a('0x23')]=function(_0x424d6c,_0x56d800){if(_0x424d6c[_0xdf3a('0x47')]['id']){delete _0x424d6c[_0xdf3a('0x47')]['id'];}return db[_0xdf3a('0x29')][_0xdf3a('0x48')]({'where':{'id':_0x424d6c[_0xdf3a('0x45')]['id']}})[_0xdf3a('0x24')](handleEntityNotFound(_0x56d800,null))['then'](saveUpdates(_0x424d6c[_0xdf3a('0x47')],null))['then'](respondWithResult(_0x56d800,null))['catch'](handleError(_0x56d800,null));};exports[_0xdf3a('0x49')]=function(_0x1c1b26,_0x4335a0){return db[_0xdf3a('0x29')][_0xdf3a('0x48')]({'where':{'id':_0x1c1b26['params']['id']}})[_0xdf3a('0x24')](handleEntityNotFound(_0x4335a0,null))[_0xdf3a('0x24')](removeEntity(_0x4335a0,null))[_0xdf3a('0x43')](handleError(_0x4335a0,null));};exports['describe']=function(_0x5434f5,_0x52d9a4){return db[_0xdf3a('0x29')][_0xdf3a('0x4a')]()[_0xdf3a('0x24')](respondWithResult(_0x52d9a4,null))['catch'](handleError(_0x52d9a4,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 72ae28c..06ccf0e 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 _0xf322=['request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment'];(function(_0x2432bc,_0x3f5872){var _0xfd5f16=function(_0x1275f7){while(--_0x1275f7){_0x2432bc['push'](_0x2432bc['shift']());}};_0xfd5f16(++_0x3f5872);}(_0xf322,0x141));var _0x2f32=function(_0x212561,_0x34f7e2){_0x212561=_0x212561-0x0;var _0x68b31d=_0xf322[_0x212561];return _0x68b31d;};'use strict';var _=require(_0x2f32('0x0'));var util=require(_0x2f32('0x1'));var logger=require('../../config/logger')(_0x2f32('0x2'));var moment=require(_0x2f32('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f32('0x4'));var fs=require('fs');var path=require(_0x2f32('0x5'));var rimraf=require('rimraf');var config=require(_0x2f32('0x6'));var attributes=require(_0x2f32('0x7'));module[_0x2f32('0x8')]=function(_0x1ae861,_0x57ffa5){return _0x1ae861[_0x2f32('0x9')](_0x2f32('0xa'),attributes,{'tableName':_0x2f32('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2f32('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9fd=['lodash','util','../../config/logger','moment','bluebird','path','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x503b29,_0x2f268c){var _0x2bb807=function(_0x32949c){while(--_0x32949c){_0x503b29['push'](_0x503b29['shift']());}};_0x2bb807(++_0x2f268c);}(_0xf9fd,0x118));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdf9f('0x0'));var util=require(_0xdf9f('0x1'));var logger=require(_0xdf9f('0x2'))('api');var moment=require(_0xdf9f('0x3'));var BPromise=require(_0xdf9f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf9f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf9f('0x6'));module['exports']=function(_0x2de026,_0x2e45bb){return _0x2de026['define'](_0xdf9f('0x7'),attributes,{'tableName':_0xdf9f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdf9f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 8d6cbc0..7bd7b3a 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 _0x5db2=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x599dcc,_0x549466){var _0x48da6d=function(_0x2c45b3){while(--_0x2c45b3){_0x599dcc['push'](_0x599dcc['shift']());}};_0x48da6d(++_0x549466);}(_0x5db2,0xf3));var _0x25db=function(_0x34f6a1,_0x252bd6){_0x34f6a1=_0x34f6a1-0x0;var _0x395dbb=_0x5db2[_0x34f6a1];return _0x395dbb;};'use strict';var _=require(_0x25db('0x0'));var util=require(_0x25db('0x1'));var moment=require(_0x25db('0x2'));var BPromise=require('bluebird');var rs=require(_0x25db('0x3'));var fs=require('fs');var Redis=require(_0x25db('0x4'));var db=require(_0x25db('0x5'))['db'];var utils=require(_0x25db('0x6'));var logger=require(_0x25db('0x7'))(_0x25db('0x8'));var config=require(_0x25db('0x9'));var jayson=require(_0x25db('0xa'));var client=jayson[_0x25db('0xb')][_0x25db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x497759,_0x3573fa,_0x310762){return new BPromise(function(_0x40f7eb,_0x2ad688){return client['request'](_0x497759,_0x310762)['then'](function(_0x2e6018){logger[_0x25db('0xd')](_0x25db('0xe'),_0x3573fa,_0x25db('0xf'));logger[_0x25db('0x10')](_0x25db('0x11'),_0x3573fa,_0x25db('0xf'),JSON[_0x25db('0x12')](_0x2e6018));if(_0x2e6018[_0x25db('0x13')]){if(_0x2e6018[_0x25db('0x13')][_0x25db('0x14')]===0x1f4){logger[_0x25db('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x3573fa,_0x2e6018[_0x25db('0x13')][_0x25db('0x15')]);return _0x2ad688(_0x2e6018[_0x25db('0x13')]['message']);}logger[_0x25db('0x13')](_0x25db('0xe'),_0x3573fa,_0x2e6018[_0x25db('0x13')][_0x25db('0x15')]);return _0x40f7eb(_0x2e6018[_0x25db('0x13')][_0x25db('0x15')]);}else{logger[_0x25db('0xd')](_0x25db('0xe'),_0x3573fa,_0x25db('0xf'));_0x40f7eb(_0x2e6018[_0x25db('0x16')]['message']);}})[_0x25db('0x17')](function(_0x58fccf){logger['error'](_0x25db('0xe'),_0x3573fa,_0x58fccf);_0x2ad688(_0x58fccf);});});} \ No newline at end of file +var _0xb76d=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0xc2c353,_0x41a5a3){var _0x806605=function(_0x439e06){while(--_0x439e06){_0xc2c353['push'](_0xc2c353['shift']());}};_0x806605(++_0x41a5a3);}(_0xb76d,0x119));var _0xdb76=function(_0x38ca61,_0x232698){_0x38ca61=_0x38ca61-0x0;var _0x19f85c=_0xb76d[_0x38ca61];return _0x19f85c;};'use strict';var _=require(_0xdb76('0x0'));var util=require('util');var moment=require(_0xdb76('0x1'));var BPromise=require(_0xdb76('0x2'));var rs=require(_0xdb76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb76('0x4'))['db'];var utils=require(_0xdb76('0x5'));var logger=require(_0xdb76('0x6'))(_0xdb76('0x7'));var config=require(_0xdb76('0x8'));var jayson=require(_0xdb76('0x9'));var client=jayson['client'][_0xdb76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c442,_0x34ccdc,_0x3d80a0){return new BPromise(function(_0x4e60dc,_0x11a14c){return client[_0xdb76('0xb')](_0x39c442,_0x3d80a0)['then'](function(_0x32c333){logger[_0xdb76('0xc')](_0xdb76('0xd'),_0x34ccdc,_0xdb76('0xe'));logger[_0xdb76('0xf')](_0xdb76('0x10'),_0x34ccdc,_0xdb76('0xe'),JSON['stringify'](_0x32c333));if(_0x32c333['error']){if(_0x32c333[_0xdb76('0x11')][_0xdb76('0x12')]===0x1f4){logger[_0xdb76('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x34ccdc,_0x32c333['error'][_0xdb76('0x13')]);return _0x11a14c(_0x32c333['error'][_0xdb76('0x13')]);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x34ccdc,_0x32c333[_0xdb76('0x11')][_0xdb76('0x13')]);return _0x4e60dc(_0x32c333[_0xdb76('0x11')][_0xdb76('0x13')]);}else{logger['info'](_0xdb76('0xd'),_0x34ccdc,_0xdb76('0xe'));_0x4e60dc(_0x32c333['result'][_0xdb76('0x13')]);}})[_0xdb76('0x14')](function(_0x39329f){logger[_0xdb76('0x11')](_0xdb76('0xd'),_0x34ccdc,_0x39329f);_0x11a14c(_0x39329f);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index b32f25d..2963217 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 _0x8208=['/:id','show','/:id/download','download','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','single','file','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x29e7b5,_0x48e509){var _0x2a93b0=function(_0x2960dd){while(--_0x2960dd){_0x29e7b5['push'](_0x29e7b5['shift']());}};_0x2a93b0(++_0x48e509);}(_0x8208,0xc6));var _0x8820=function(_0x203f5f,_0x438fa1){_0x203f5f=_0x203f5f-0x0;var _0x2004c0=_0x8208[_0x203f5f];return _0x2004c0;};'use strict';var multer=require(_0x8820('0x0'));var util=require('util');var path=require(_0x8820('0x1'));var timeout=require(_0x8820('0x2'));var express=require(_0x8820('0x3'));var router=express[_0x8820('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8820('0x5'));var interaction=require(_0x8820('0x6'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x8820('0x7')]('/',auth[_0x8820('0x8')](),controller[_0x8820('0x9')]);router[_0x8820('0x7')](_0x8820('0xa'),auth[_0x8820('0x8')](),controller[_0x8820('0xb')]);router[_0x8820('0x7')](_0x8820('0xc'),auth[_0x8820('0x8')](),controller[_0x8820('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x88085c,_0x592713,_0x32ec2c){_0x32ec2c(null,path['join'](config[_0x8820('0xe')],_0x8820('0xf')));},'filename':function(_0x3599bc,_0x31968d,_0x46f75b){_0x31968d[_0x8820('0x10')]=_0x31968d[_0x8820('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46f75b(null,util[_0x8820('0x11')](_0x8820('0x12'),path['basename'](_0x31968d[_0x8820('0x10')],path[_0x8820('0x13')](_0x31968d[_0x8820('0x10')])),Date[_0x8820('0x14')](),path[_0x8820('0x13')](_0x31968d[_0x8820('0x10')])));}})});router['post']('/',upload[_0x8820('0x15')](_0x8820('0x16')),controller['create']);router[_0x8820('0x17')]('/:id',auth[_0x8820('0x8')](),controller['update']);router[_0x8820('0x18')](_0x8820('0xa'),auth[_0x8820('0x8')](),controller[_0x8820('0x18')]);module[_0x8820('0x19')]=router; \ No newline at end of file +var _0x2f77=['put','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create'];(function(_0x3adf4f,_0x1d5a60){var _0x52d9ee=function(_0x5db565){while(--_0x5db565){_0x3adf4f['push'](_0x3adf4f['shift']());}};_0x52d9ee(++_0x1d5a60);}(_0x2f77,0xfb));var _0x72f7=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x2f77[_0x2c7b86];return _0x256735;};'use strict';var multer=require(_0x72f7('0x0'));var util=require('util');var path=require(_0x72f7('0x1'));var timeout=require(_0x72f7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x72f7('0x3'));var auth=require(_0x72f7('0x4'));var interaction=require(_0x72f7('0x5'));var config=require(_0x72f7('0x6'));var controller=require(_0x72f7('0x7'));router[_0x72f7('0x8')]('/',auth[_0x72f7('0x9')](),controller[_0x72f7('0xa')]);router[_0x72f7('0x8')](_0x72f7('0xb'),auth[_0x72f7('0x9')](),controller[_0x72f7('0xc')]);router['get']('/:id/download',auth[_0x72f7('0x9')](),controller[_0x72f7('0xd')]);var upload=multer({'storage':multer[_0x72f7('0xe')]({'destination':function(_0x22707c,_0x26d133,_0xb7b0b3){_0xb7b0b3(null,path[_0x72f7('0xf')](config[_0x72f7('0x10')],_0x72f7('0x11')));},'filename':function(_0x37f53e,_0xe4b621,_0x171bf3){_0xe4b621[_0x72f7('0x12')]=_0xe4b621['originalname'][_0x72f7('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x171bf3(null,util[_0x72f7('0x14')](_0x72f7('0x15'),path['basename'](_0xe4b621[_0x72f7('0x12')],path[_0x72f7('0x16')](_0xe4b621[_0x72f7('0x12')])),Date[_0x72f7('0x17')](),path[_0x72f7('0x16')](_0xe4b621['originalname'])));}})});router[_0x72f7('0x18')]('/',upload[_0x72f7('0x19')](_0x72f7('0x1a')),controller[_0x72f7('0x1b')]);router[_0x72f7('0x1c')](_0x72f7('0xb'),auth[_0x72f7('0x9')](),controller[_0x72f7('0x1d')]);router[_0x72f7('0x1e')]('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 5e0e4d0..615a95f 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 _0x34bd=['STRING','name','FLOAT','INTEGER','BIGINT','sequelize','exports'];(function(_0xc2715b,_0x4903a5){var _0x181f84=function(_0x19eca7){while(--_0x19eca7){_0xc2715b['push'](_0xc2715b['shift']());}};_0x181f84(++_0x4903a5);}(_0x34bd,0x1a9));var _0xd34b=function(_0xb04cb1,_0x13b8e3){_0xb04cb1=_0xb04cb1-0x0;var _0x309445=_0x34bd[_0xb04cb1];return _0x309445;};'use strict';var Sequelize=require(_0xd34b('0x0'));module[_0xd34b('0x1')]={'name':{'type':Sequelize[_0xd34b('0x2')],'unique':_0xd34b('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd34b('0x2')]},'display_name':{'type':Sequelize[_0xd34b('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xd34b('0x2')]},'original_format':{'type':Sequelize[_0xd34b('0x2')]},'original_duration':{'type':Sequelize[_0xd34b('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xd34b('0x5')]},'original_bitRate':{'type':Sequelize[_0xd34b('0x6')]},'original_sampleRate':{'type':Sequelize[_0xd34b('0x5')]},'converted_format':{'type':Sequelize[_0xd34b('0x2')]},'converted_duration':{'type':Sequelize[_0xd34b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xd34b('0x6')]},'converted_channelCount':{'type':Sequelize[_0xd34b('0x5')]},'converted_bitRate':{'type':Sequelize[_0xd34b('0x6')]},'converted_sampleRate':{'type':Sequelize[_0xd34b('0x5')]}}; \ No newline at end of file +var _0x88dc=['INTEGER','exports','STRING','FLOAT','BIGINT'];(function(_0x2eda48,_0x1d2076){var _0x4dd763=function(_0x35f72d){while(--_0x35f72d){_0x2eda48['push'](_0x2eda48['shift']());}};_0x4dd763(++_0x1d2076);}(_0x88dc,0xa6));var _0xc88d=function(_0x21a44f,_0x9ba874){_0x21a44f=_0x21a44f-0x0;var _0x27d451=_0x88dc[_0x21a44f];return _0x27d451;};'use strict';var Sequelize=require('sequelize');module[_0xc88d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xc88d('0x1')]},'display_name':{'type':Sequelize[_0xc88d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xc88d('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xc88d('0x2')]},'original_sampleCount':{'type':Sequelize[_0xc88d('0x3')]},'original_channelCount':{'type':Sequelize[_0xc88d('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xc88d('0x1')]},'converted_duration':{'type':Sequelize[_0xc88d('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xc88d('0x4')]},'converted_bitRate':{'type':Sequelize[_0xc88d('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a2a5f46..86b52c4 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 _0x1ad9=['status','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','Sounds','UserProfileResource','destroy','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','catch','download','save_name','converted_format','existsSync','root','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','join','server/files/sounds/original','server/files/sounds/converted','Sound\x20upload\x20filepath:\x20%s','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','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus'];(function(_0x4ea809,_0x5416a6){var _0x31be45=function(_0x347d68){while(--_0x347d68){_0x4ea809['push'](_0x4ea809['shift']());}};_0x31be45(++_0x5416a6);}(_0x1ad9,0x64));var _0x91ad=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x1ad9[_0x490be3];return _0x3f5140;};'use strict';var emlformat=require(_0x91ad('0x0'));var rimraf=require(_0x91ad('0x1'));var zipdir=require(_0x91ad('0x2'));var jsonpatch=require(_0x91ad('0x3'));var rp=require(_0x91ad('0x4'));var moment=require(_0x91ad('0x5'));var BPromise=require(_0x91ad('0x6'));var Mustache=require(_0x91ad('0x7'));var util=require(_0x91ad('0x8'));var path=require(_0x91ad('0x9'));var sox=require('sox');var csv=require(_0x91ad('0xa'));var ejs=require(_0x91ad('0xb'));var fs=require('fs');var fs_extra=require(_0x91ad('0xc'));var _=require(_0x91ad('0xd'));var squel=require(_0x91ad('0xe'));var crypto=require(_0x91ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x91ad('0x10'));var Papa=require(_0x91ad('0x11'));var Redis=require(_0x91ad('0x12'));var authService=require(_0x91ad('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x91ad('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x91ad('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x91ad('0x16'))['db'];function respondWithStatusCode(_0xb33b12,_0x1a3ab1){_0x1a3ab1=_0x1a3ab1||0xcc;return function(_0x54150e){if(_0x54150e){return _0xb33b12[_0x91ad('0x17')](_0x1a3ab1);}return _0xb33b12[_0x91ad('0x18')](_0x1a3ab1)['end']();};}function respondWithResult(_0x4bb47d,_0x3bff76){_0x3bff76=_0x3bff76||0xc8;return function(_0x14a4aa){if(_0x14a4aa){return _0x4bb47d[_0x91ad('0x18')](_0x3bff76)['json'](_0x14a4aa);}};}function respondWithFilteredResult(_0xd76b57,_0x3e3bc1){return function(_0x6c714e){if(_0x6c714e){var _0x224b23=typeof _0x3e3bc1['offset']===_0x91ad('0x19')&&typeof _0x3e3bc1[_0x91ad('0x1a')]==='undefined';var _0x5c865d=_0x6c714e['count'];var _0x10e538=_0x224b23?0x0:_0x3e3bc1[_0x91ad('0x1b')];var _0x1abe4f=_0x224b23?_0x6c714e[_0x91ad('0x1c')]:_0x3e3bc1[_0x91ad('0x1b')]+_0x3e3bc1['limit'];var _0x191b59;if(_0x1abe4f>=_0x5c865d){_0x1abe4f=_0x5c865d;_0x191b59=0xc8;}else{_0x191b59=0xce;}_0xd76b57['status'](_0x191b59);return _0xd76b57['set'](_0x91ad('0x1d'),_0x10e538+'-'+_0x1abe4f+'/'+_0x5c865d)[_0x91ad('0x1e')](_0x6c714e);}return null;};}function patchUpdates(_0x348616){return function(_0x4d85db){try{jsonpatch[_0x91ad('0x1f')](_0x4d85db,_0x348616,!![]);}catch(_0x39a921){return BPromise[_0x91ad('0x20')](_0x39a921);}return _0x4d85db[_0x91ad('0x21')]();};}function saveUpdates(_0x4186d7,_0x224899){return function(_0xcfb684){if(_0xcfb684){return _0xcfb684[_0x91ad('0x22')](_0x4186d7)[_0x91ad('0x23')](function(_0x12519e){return _0x12519e;});}return null;};}function removeEntity(_0x26c741,_0x94d1a3){return function(_0x291cba){if(_0x291cba){return _0x291cba['destroy']()[_0x91ad('0x23')](function(){var _0xb432c7=_0x291cba['get']({'plain':!![]});var _0x398451=_0x91ad('0x24');return db[_0x91ad('0x25')][_0x91ad('0x26')]({'where':{'type':_0x398451,'resourceId':_0xb432c7['id']}})['then'](function(){return _0x291cba;});})[_0x91ad('0x23')](function(){_0x26c741[_0x91ad('0x18')](0xcc)[_0x91ad('0x27')]();});}};}function handleEntityNotFound(_0x35bcdf,_0x3e0613){return function(_0x27eadc){if(!_0x27eadc){_0x35bcdf[_0x91ad('0x17')](0x194);}return _0x27eadc;};}function handleError(_0x293507,_0x1a3702){_0x1a3702=_0x1a3702||0x1f4;return function(_0xf4d977){logger[_0x91ad('0x28')](_0xf4d977[_0x91ad('0x29')]);if(_0xf4d977[_0x91ad('0x2a')]){delete _0xf4d977['name'];}_0x293507[_0x91ad('0x18')](_0x1a3702)[_0x91ad('0x2b')](_0xf4d977);};}exports[_0x91ad('0x2c')]=function(_0xd4aad9,_0x302b6d){var _0x2475d8={},_0x380486={},_0x47f944={'count':0x0,'rows':[]};var _0x966ba3=_[_0x91ad('0x2d')](db[_0x91ad('0x2e')][_0x91ad('0x2f')],function(_0xe551e2){return{'name':_0xe551e2[_0x91ad('0x30')],'type':_0xe551e2['type']['key']};});_0x380486[_0x91ad('0x31')]=_['map'](_0x966ba3,'name');_0x380486[_0x91ad('0x32')]=_['keys'](_0xd4aad9[_0x91ad('0x32')]);_0x380486[_0x91ad('0x33')]=_[_0x91ad('0x34')](_0x380486[_0x91ad('0x31')],_0x380486[_0x91ad('0x32')]);_0x2475d8[_0x91ad('0x35')]=_[_0x91ad('0x34')](_0x380486[_0x91ad('0x31')],qs['fields'](_0xd4aad9[_0x91ad('0x32')]['fields']));_0x2475d8[_0x91ad('0x35')]=_0x2475d8[_0x91ad('0x35')][_0x91ad('0x36')]?_0x2475d8[_0x91ad('0x35')]:_0x380486[_0x91ad('0x31')];if(!_0xd4aad9[_0x91ad('0x32')]['hasOwnProperty'](_0x91ad('0x37'))){_0x2475d8[_0x91ad('0x1a')]=qs[_0x91ad('0x1a')](_0xd4aad9[_0x91ad('0x32')]['limit']);_0x2475d8['offset']=qs[_0x91ad('0x1b')](_0xd4aad9[_0x91ad('0x32')][_0x91ad('0x1b')]);}_0x2475d8[_0x91ad('0x38')]=qs[_0x91ad('0x39')](_0xd4aad9['query'][_0x91ad('0x39')]);_0x2475d8['where']=qs[_0x91ad('0x33')](_[_0x91ad('0x3a')](_0xd4aad9[_0x91ad('0x32')],_0x380486[_0x91ad('0x33')]),_0x966ba3);if(_0xd4aad9[_0x91ad('0x32')]['filter']){_0x2475d8[_0x91ad('0x3b')]=_[_0x91ad('0x3c')](_0x2475d8[_0x91ad('0x3b')],{'$or':_[_0x91ad('0x2d')](_0x966ba3,function(_0x347984){if(_0x347984['type']!==_0x91ad('0x3d')){var _0x2c2a4c={};_0x2c2a4c[_0x347984[_0x91ad('0x2a')]]={'$like':'%'+_0xd4aad9['query'][_0x91ad('0x3e')]+'%'};return _0x2c2a4c;}})});}_0x2475d8=_[_0x91ad('0x3c')]({},_0x2475d8,_0xd4aad9['options']);var _0x330001={'where':_0x2475d8[_0x91ad('0x3b')]};return db[_0x91ad('0x2e')]['count'](_0x330001)['then'](function(_0x1296b3){_0x47f944[_0x91ad('0x1c')]=_0x1296b3;if(_0xd4aad9[_0x91ad('0x32')][_0x91ad('0x3f')]){_0x2475d8[_0x91ad('0x40')]=[{'all':!![]}];}return db[_0x91ad('0x2e')][_0x91ad('0x41')](_0x2475d8);})['then'](function(_0x3f2b37){_0x47f944[_0x91ad('0x42')]=_0x3f2b37;return _0x47f944;})[_0x91ad('0x23')](respondWithFilteredResult(_0x302b6d,_0x2475d8))['catch'](handleError(_0x302b6d,null));};exports[_0x91ad('0x43')]=function(_0x460b6e,_0x5c358d){var _0x429172={'raw':!![],'where':{'id':_0x460b6e[_0x91ad('0x44')]['id']}},_0x2e2e9a={};_0x2e2e9a['model']=_[_0x91ad('0x45')](db['Sound'][_0x91ad('0x2f')]);_0x2e2e9a['query']=_[_0x91ad('0x45')](_0x460b6e[_0x91ad('0x32')]);_0x2e2e9a[_0x91ad('0x33')]=_[_0x91ad('0x34')](_0x2e2e9a[_0x91ad('0x31')],_0x2e2e9a[_0x91ad('0x32')]);_0x429172['attributes']=_['intersection'](_0x2e2e9a[_0x91ad('0x31')],qs['fields'](_0x460b6e['query']['fields']));_0x429172[_0x91ad('0x35')]=_0x429172[_0x91ad('0x35')][_0x91ad('0x36')]?_0x429172[_0x91ad('0x35')]:_0x2e2e9a[_0x91ad('0x31')];if(_0x460b6e['query'][_0x91ad('0x3f')]){_0x429172[_0x91ad('0x40')]=[{'all':!![]}];}_0x429172=_[_0x91ad('0x3c')]({},_0x429172,_0x460b6e[_0x91ad('0x46')]);return db['Sound'][_0x91ad('0x47')](_0x429172)[_0x91ad('0x23')](handleEntityNotFound(_0x5c358d,null))[_0x91ad('0x23')](respondWithResult(_0x5c358d,null))[_0x91ad('0x48')](handleError(_0x5c358d,null));};exports[_0x91ad('0x49')]=function(_0x297346,_0x1b1c69,_0x34576d){return db['Sound']['find']({'where':{'id':_0x297346[_0x91ad('0x44')]['id']},'attributes':[_0x91ad('0x2a'),_0x91ad('0x4a'),_0x91ad('0x4b')],'raw':!![]})[_0x91ad('0x23')](handleEntityNotFound(_0x1b1c69,null))['then'](function(_0x23ac0c){if(_0x23ac0c){if(!fs[_0x91ad('0x4c')](path['join'](config[_0x91ad('0x4d')],'server/files/sounds/converted',_0x23ac0c[_0x91ad('0x4a')]+'.'+_0x23ac0c[_0x91ad('0x4b')]))){throw new db['Sequelize'][(_0x91ad('0x4e'))](_0x91ad('0x4f'));}return _0x1b1c69['download'](path['join'](config[_0x91ad('0x4d')],'server/files/sounds/converted',util[_0x91ad('0x50')](_0x91ad('0x51'),_0x23ac0c[_0x91ad('0x4a')],_0x23ac0c[_0x91ad('0x4b')])),util[_0x91ad('0x50')](_0x91ad('0x51'),_0x23ac0c[_0x91ad('0x2a')],_0x23ac0c['converted_format']));}return null;})[_0x91ad('0x48')](handleError(_0x1b1c69,null));};exports['create']=function(_0x1f532e,_0x4f6521,_0x21a2a0){var _0xf2e43c={'name':path[_0x91ad('0x52')](_0x1f532e[_0x91ad('0x53')][_0x91ad('0x54')],path[_0x91ad('0x55')](_0x1f532e[_0x91ad('0x53')][_0x91ad('0x54')])),'save_name':path['basename'](_0x1f532e[_0x91ad('0x53')][_0x91ad('0x56')],path['extname'](_0x1f532e['file']['filename'])),'original_format':path['extname'](_0x1f532e[_0x91ad('0x53')][_0x91ad('0x54')])[_0x91ad('0x57')](0x1),'converted_format':_0x91ad('0x58')};var _0xf88705=path[_0x91ad('0x59')](config[_0x91ad('0x4d')],_0x91ad('0x5a'),_0x1f532e[_0x91ad('0x53')][_0x91ad('0x56')]);var _0x5340fe=path[_0x91ad('0x59')](config[_0x91ad('0x4d')],_0x91ad('0x5b'),util[_0x91ad('0x50')](_0x91ad('0x51'),path[_0x91ad('0x52')](_0x1f532e[_0x91ad('0x53')][_0x91ad('0x56')],path[_0x91ad('0x55')](_0x1f532e[_0x91ad('0x53')]['filename'])),_0xf2e43c[_0x91ad('0x4b')]));logger['info'](_0x91ad('0x5c'),_0xf88705);logger[_0x91ad('0x5d')](_0x91ad('0x5e'),_0x5340fe);try{fs[_0x91ad('0x5f')](_0xf88705,parseInt(_0x91ad('0x60'),0x8));var _0x25f796=sox[_0x91ad('0x61')](_0xf88705,_0x5340fe,{'sampleRate':0x1f40,'format':_0x91ad('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x25f796['on'](_0x91ad('0x28'),function(_0x17eb6b){fs[_0x91ad('0x62')](_0xf88705);_0x4f6521[_0x91ad('0x18')](0x1f4)[_0x91ad('0x2b')](_0x17eb6b);});_0x25f796['on'](_0x91ad('0x63'),function(_0x5d48e4){_0xf2e43c[_0x91ad('0x64')]=isNaN(_0x5d48e4[_0x91ad('0x65')])?null:_0x5d48e4[_0x91ad('0x65')]*0x3e8;_0xf2e43c[_0x91ad('0x66')]=isNaN(_0x5d48e4[_0x91ad('0x67')])?null:_0x5d48e4[_0x91ad('0x67')];_0xf2e43c[_0x91ad('0x68')]=isNaN(_0x5d48e4[_0x91ad('0x69')])?null:_0x5d48e4[_0x91ad('0x69')];_0xf2e43c[_0x91ad('0x6a')]=isNaN(_0x5d48e4['bitRate'])?null:_0x5d48e4[_0x91ad('0x6b')];_0xf2e43c[_0x91ad('0x6c')]=isNaN(_0x5d48e4[_0x91ad('0x6d')])?null:_0x5d48e4[_0x91ad('0x6d')];});_0x25f796['on']('dest',function(_0x1cc45c){_0xf2e43c[_0x91ad('0x6e')]=isNaN(_0x1cc45c[_0x91ad('0x65')])?null:_0x1cc45c['duration']*0x3e8;_0xf2e43c['converted_sampleCount']=isNaN(_0x1cc45c[_0x91ad('0x67')])?null:_0x1cc45c[_0x91ad('0x67')];_0xf2e43c[_0x91ad('0x6f')]=isNaN(_0x1cc45c[_0x91ad('0x69')])?null:_0x1cc45c[_0x91ad('0x69')];_0xf2e43c[_0x91ad('0x70')]=isNaN(_0x1cc45c[_0x91ad('0x6b')])?null:_0x1cc45c['bitRate'];_0xf2e43c[_0x91ad('0x71')]=isNaN(_0x1cc45c[_0x91ad('0x6d')])?null:_0x1cc45c[_0x91ad('0x6d')];});_0x25f796['on']('end',function(){fs[_0x91ad('0x5f')](_0x5340fe,parseInt(_0x91ad('0x60'),0x8));return db[_0x91ad('0x2e')][_0x91ad('0x72')](_0xf2e43c)[_0x91ad('0x23')](function(_0x29fd87){var _0x150940={'role':_0x1f532e[_0x91ad('0x73')][_0x91ad('0x74')],'userProfileId':_0x1f532e[_0x91ad('0x73')][_0x91ad('0x75')]};if(!_0x150940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x150940[_0x91ad('0x74')]==='user'){var _0x2c169b=_0x29fd87['get']({'plain':!![]});return db[_0x91ad('0x76')][_0x91ad('0x47')]({'where':{'name':_0x91ad('0x24'),'userProfileId':_0x150940[_0x91ad('0x75')]},'raw':!![]})['then'](function(_0x25dd6a){if(_0x25dd6a&&_0x25dd6a[_0x91ad('0x77')]===0x0){return db[_0x91ad('0x25')][_0x91ad('0x72')]({'name':_0x2c169b[_0x91ad('0x2a')],'resourceId':_0x2c169b['id'],'type':_0x25dd6a[_0x91ad('0x2a')],'sectionId':_0x25dd6a['id']},{})[_0x91ad('0x23')](function(){return _0x29fd87;});}else{return _0x29fd87;}})[_0x91ad('0x48')](function(_0x173836){logger['error'](_0x91ad('0x78'),_0x173836);throw _0x173836;});}return _0x29fd87;})[_0x91ad('0x23')](respondWithResult(_0x4f6521,null))[_0x91ad('0x48')](handleError(_0x4f6521,null));});_0x25f796[_0x91ad('0x79')]();}catch(_0x23d824){_0x4f6521['status'](0x1f4)[_0x91ad('0x2b')](_0x23d824);}};exports[_0x91ad('0x22')]=function(_0x3ea5e0,_0x1ec8aa,_0x249765){return db['Sound'][_0x91ad('0x47')]({'where':{'id':_0x3ea5e0[_0x91ad('0x44')]['id']}})[_0x91ad('0x23')](handleEntityNotFound(_0x1ec8aa,null))[_0x91ad('0x23')](saveUpdates(_[_0x91ad('0x3a')](_0x3ea5e0[_0x91ad('0x73')],[_0x91ad('0x2a'),'description']),null))[_0x91ad('0x23')](respondWithResult(_0x1ec8aa,null))[_0x91ad('0x48')](handleError(_0x1ec8aa,null));};exports[_0x91ad('0x7a')]=function(_0x2cfc78,_0x2dbc03,_0x2aedca){return db[_0x91ad('0x2e')][_0x91ad('0x47')]({'where':{'id':_0x2cfc78[_0x91ad('0x44')]['id']}})[_0x91ad('0x23')](function(_0x37e7d4){if(_0x37e7d4){return _0x37e7d4[_0x91ad('0x26')]();}})[_0x91ad('0x23')](function(_0x23339d){var _0x2f4b61=path[_0x91ad('0x59')](config[_0x91ad('0x4d')],_0x91ad('0x5a'),util[_0x91ad('0x50')](_0x91ad('0x51'),_0x23339d['save_name'],_0x23339d[_0x91ad('0x7b')]));var _0x493aab=path['join'](config[_0x91ad('0x4d')],_0x91ad('0x5b'),util[_0x91ad('0x50')](_0x91ad('0x51'),_0x23339d[_0x91ad('0x4a')],_0x23339d['converted_format']));fs[_0x91ad('0x62')](_0x2f4b61);fs[_0x91ad('0x62')](_0x493aab);return _0x23339d;})['then'](function(_0x56398d){if(_0x56398d){return _0x2dbc03[_0x91ad('0x18')](0xcc)['end']();}})[_0x91ad('0x23')](handleEntityNotFound(_0x2dbc03,null))[_0x91ad('0x48')](handleError(_0x2dbc03,null));}; \ No newline at end of file +var _0x63f0=['sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','original_format','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','format','%s.%s','create','file','basename','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','error','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate'];(function(_0x38d6e8,_0x21c3b9){var _0x37e27f=function(_0x2e9a3e){while(--_0x2e9a3e){_0x38d6e8['push'](_0x38d6e8['shift']());}};_0x37e27f(++_0x21c3b9);}(_0x63f0,0x17a));var _0x063f=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x63f0[_0x1d5400];return _0x21d9fe;};'use strict';var emlformat=require(_0x063f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x063f('0x1'));var rp=require(_0x063f('0x2'));var moment=require(_0x063f('0x3'));var BPromise=require(_0x063f('0x4'));var Mustache=require('mustache');var util=require(_0x063f('0x5'));var path=require(_0x063f('0x6'));var sox=require('sox');var csv=require(_0x063f('0x7'));var ejs=require(_0x063f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x063f('0x9'));var squel=require(_0x063f('0xa'));var crypto=require(_0x063f('0xb'));var jsforce=require(_0x063f('0xc'));var deskjs=require(_0x063f('0xd'));var toCsv=require(_0x063f('0x7'));var querystring=require(_0x063f('0xe'));var Papa=require('papaparse');var Redis=require(_0x063f('0xf'));var authService=require(_0x063f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x063f('0x11'))(_0x063f('0x12'));var utils=require('../../config/utils');var config=require(_0x063f('0x13'));var licenseUtil=require(_0x063f('0x14'));var db=require(_0x063f('0x15'))['db'];function respondWithStatusCode(_0x956401,_0x207a0f){_0x207a0f=_0x207a0f||0xcc;return function(_0x491fcf){if(_0x491fcf){return _0x956401[_0x063f('0x16')](_0x207a0f);}return _0x956401['status'](_0x207a0f)[_0x063f('0x17')]();};}function respondWithResult(_0x3142c0,_0x23820f){_0x23820f=_0x23820f||0xc8;return function(_0x15767a){if(_0x15767a){return _0x3142c0['status'](_0x23820f)[_0x063f('0x18')](_0x15767a);}};}function respondWithFilteredResult(_0x46a348,_0xe5e25d){return function(_0x4d396d){if(_0x4d396d){var _0x58868f=typeof _0xe5e25d[_0x063f('0x19')]==='undefined'&&typeof _0xe5e25d[_0x063f('0x1a')]===_0x063f('0x1b');var _0x31d277=_0x4d396d['count'];var _0x4ec0cd=_0x58868f?0x0:_0xe5e25d[_0x063f('0x19')];var _0x23a70a=_0x58868f?_0x4d396d[_0x063f('0x1c')]:_0xe5e25d[_0x063f('0x19')]+_0xe5e25d[_0x063f('0x1a')];var _0x181ab2;if(_0x23a70a>=_0x31d277){_0x23a70a=_0x31d277;_0x181ab2=0xc8;}else{_0x181ab2=0xce;}_0x46a348[_0x063f('0x1d')](_0x181ab2);return _0x46a348[_0x063f('0x1e')](_0x063f('0x1f'),_0x4ec0cd+'-'+_0x23a70a+'/'+_0x31d277)[_0x063f('0x18')](_0x4d396d);}return null;};}function patchUpdates(_0x5e5a9b){return function(_0x3f94f8){try{jsonpatch[_0x063f('0x20')](_0x3f94f8,_0x5e5a9b,!![]);}catch(_0x202dae){return BPromise[_0x063f('0x21')](_0x202dae);}return _0x3f94f8[_0x063f('0x22')]();};}function saveUpdates(_0x4cd012,_0x3989bc){return function(_0x2082df){if(_0x2082df){return _0x2082df[_0x063f('0x23')](_0x4cd012)[_0x063f('0x24')](function(_0x3aa09c){return _0x3aa09c;});}return null;};}function removeEntity(_0x11b436,_0x515929){return function(_0x1bbb02){if(_0x1bbb02){return _0x1bbb02[_0x063f('0x25')]()[_0x063f('0x24')](function(){var _0x24f75b=_0x1bbb02[_0x063f('0x26')]({'plain':!![]});var _0x59c885=_0x063f('0x27');return db[_0x063f('0x28')][_0x063f('0x25')]({'where':{'type':_0x59c885,'resourceId':_0x24f75b['id']}})[_0x063f('0x24')](function(){return _0x1bbb02;});})[_0x063f('0x24')](function(){_0x11b436[_0x063f('0x1d')](0xcc)[_0x063f('0x17')]();});}};}function handleEntityNotFound(_0x30b757,_0x2376d1){return function(_0x4f2788){if(!_0x4f2788){_0x30b757[_0x063f('0x16')](0x194);}return _0x4f2788;};}function handleError(_0x1042fd,_0x1821c1){_0x1821c1=_0x1821c1||0x1f4;return function(_0x54217d){logger['error'](_0x54217d[_0x063f('0x29')]);if(_0x54217d[_0x063f('0x2a')]){delete _0x54217d['name'];}_0x1042fd[_0x063f('0x1d')](_0x1821c1)[_0x063f('0x2b')](_0x54217d);};}exports[_0x063f('0x2c')]=function(_0x128557,_0x4acdda){var _0x35b605={},_0x12dbe8={},_0x212b5c={'count':0x0,'rows':[]};var _0x1aa63b=_[_0x063f('0x2d')](db[_0x063f('0x2e')]['rawAttributes'],function(_0x4fb7a3){return{'name':_0x4fb7a3[_0x063f('0x2f')],'type':_0x4fb7a3[_0x063f('0x30')][_0x063f('0x31')]};});_0x12dbe8[_0x063f('0x32')]=_[_0x063f('0x2d')](_0x1aa63b,_0x063f('0x2a'));_0x12dbe8['query']=_['keys'](_0x128557[_0x063f('0x33')]);_0x12dbe8[_0x063f('0x34')]=_['intersection'](_0x12dbe8[_0x063f('0x32')],_0x12dbe8[_0x063f('0x33')]);_0x35b605['attributes']=_[_0x063f('0x35')](_0x12dbe8['model'],qs['fields'](_0x128557[_0x063f('0x33')][_0x063f('0x36')]));_0x35b605[_0x063f('0x37')]=_0x35b605['attributes'][_0x063f('0x38')]?_0x35b605[_0x063f('0x37')]:_0x12dbe8['model'];if(!_0x128557['query'][_0x063f('0x39')](_0x063f('0x3a'))){_0x35b605[_0x063f('0x1a')]=qs[_0x063f('0x1a')](_0x128557[_0x063f('0x33')][_0x063f('0x1a')]);_0x35b605[_0x063f('0x19')]=qs[_0x063f('0x19')](_0x128557[_0x063f('0x33')][_0x063f('0x19')]);}_0x35b605[_0x063f('0x3b')]=qs[_0x063f('0x3c')](_0x128557['query'][_0x063f('0x3c')]);_0x35b605[_0x063f('0x3d')]=qs[_0x063f('0x34')](_[_0x063f('0x3e')](_0x128557[_0x063f('0x33')],_0x12dbe8['filters']),_0x1aa63b);if(_0x128557[_0x063f('0x33')][_0x063f('0x3f')]){_0x35b605[_0x063f('0x3d')]=_[_0x063f('0x40')](_0x35b605[_0x063f('0x3d')],{'$or':_[_0x063f('0x2d')](_0x1aa63b,function(_0x2f334a){if(_0x2f334a['type']!=='VIRTUAL'){var _0x3185cf={};_0x3185cf[_0x2f334a['name']]={'$like':'%'+_0x128557[_0x063f('0x33')][_0x063f('0x3f')]+'%'};return _0x3185cf;}})});}_0x35b605=_['merge']({},_0x35b605,_0x128557[_0x063f('0x41')]);var _0x44f416={'where':_0x35b605['where']};return db[_0x063f('0x2e')][_0x063f('0x1c')](_0x44f416)[_0x063f('0x24')](function(_0x361bb8){_0x212b5c[_0x063f('0x1c')]=_0x361bb8;if(_0x128557[_0x063f('0x33')][_0x063f('0x42')]){_0x35b605['include']=[{'all':!![]}];}return db[_0x063f('0x2e')][_0x063f('0x43')](_0x35b605);})['then'](function(_0x25cfd2){_0x212b5c['rows']=_0x25cfd2;return _0x212b5c;})[_0x063f('0x24')](respondWithFilteredResult(_0x4acdda,_0x35b605))[_0x063f('0x44')](handleError(_0x4acdda,null));};exports[_0x063f('0x45')]=function(_0x141476,_0x322e50){var _0x1bdaf4={'raw':!![],'where':{'id':_0x141476[_0x063f('0x46')]['id']}},_0x42a5b2={};_0x42a5b2['model']=_['keys'](db[_0x063f('0x2e')]['rawAttributes']);_0x42a5b2[_0x063f('0x33')]=_[_0x063f('0x47')](_0x141476[_0x063f('0x33')]);_0x42a5b2['filters']=_[_0x063f('0x35')](_0x42a5b2['model'],_0x42a5b2[_0x063f('0x33')]);_0x1bdaf4[_0x063f('0x37')]=_[_0x063f('0x35')](_0x42a5b2[_0x063f('0x32')],qs[_0x063f('0x36')](_0x141476[_0x063f('0x33')]['fields']));_0x1bdaf4[_0x063f('0x37')]=_0x1bdaf4[_0x063f('0x37')][_0x063f('0x38')]?_0x1bdaf4[_0x063f('0x37')]:_0x42a5b2['model'];if(_0x141476[_0x063f('0x33')]['includeAll']){_0x1bdaf4[_0x063f('0x48')]=[{'all':!![]}];}_0x1bdaf4=_[_0x063f('0x40')]({},_0x1bdaf4,_0x141476[_0x063f('0x41')]);return db['Sound'][_0x063f('0x49')](_0x1bdaf4)['then'](handleEntityNotFound(_0x322e50,null))[_0x063f('0x24')](respondWithResult(_0x322e50,null))['catch'](handleError(_0x322e50,null));};exports[_0x063f('0x4a')]=function(_0x3446be,_0x11f7ab,_0x5f3608){return db[_0x063f('0x2e')][_0x063f('0x49')]({'where':{'id':_0x3446be['params']['id']},'attributes':[_0x063f('0x2a'),_0x063f('0x4b'),'converted_format'],'raw':!![]})[_0x063f('0x24')](handleEntityNotFound(_0x11f7ab,null))[_0x063f('0x24')](function(_0x3850c3){if(_0x3850c3){if(!fs[_0x063f('0x4c')](path[_0x063f('0x4d')](config[_0x063f('0x4e')],_0x063f('0x4f'),_0x3850c3[_0x063f('0x4b')]+'.'+_0x3850c3[_0x063f('0x50')]))){throw new db['Sequelize'][(_0x063f('0x51'))](_0x063f('0x52'));}return _0x11f7ab[_0x063f('0x4a')](path[_0x063f('0x4d')](config['root'],_0x063f('0x4f'),util[_0x063f('0x53')](_0x063f('0x54'),_0x3850c3['save_name'],_0x3850c3[_0x063f('0x50')])),util[_0x063f('0x53')](_0x063f('0x54'),_0x3850c3[_0x063f('0x2a')],_0x3850c3[_0x063f('0x50')]));}return null;})[_0x063f('0x44')](handleError(_0x11f7ab,null));};exports[_0x063f('0x55')]=function(_0x29af66,_0x52b242,_0x491a75){var _0x279254={'name':path['basename'](_0x29af66['file']['originalname'],path['extname'](_0x29af66[_0x063f('0x56')]['originalname'])),'save_name':path[_0x063f('0x57')](_0x29af66[_0x063f('0x56')][_0x063f('0x58')],path[_0x063f('0x59')](_0x29af66[_0x063f('0x56')][_0x063f('0x58')])),'original_format':path[_0x063f('0x59')](_0x29af66['file']['originalname'])[_0x063f('0x5a')](0x1),'converted_format':_0x063f('0x5b')};var _0x3d3777=path['join'](config[_0x063f('0x4e')],_0x063f('0x5c'),_0x29af66[_0x063f('0x56')][_0x063f('0x58')]);var _0x355a20=path[_0x063f('0x4d')](config[_0x063f('0x4e')],_0x063f('0x4f'),util[_0x063f('0x53')](_0x063f('0x54'),path[_0x063f('0x57')](_0x29af66[_0x063f('0x56')][_0x063f('0x58')],path[_0x063f('0x59')](_0x29af66[_0x063f('0x56')][_0x063f('0x58')])),_0x279254[_0x063f('0x50')]));logger[_0x063f('0x5d')](_0x063f('0x5e'),_0x3d3777);logger[_0x063f('0x5d')](_0x063f('0x5f'),_0x355a20);try{fs[_0x063f('0x60')](_0x3d3777,parseInt('0777',0x8));var _0x519f69=sox['transcode'](_0x3d3777,_0x355a20,{'sampleRate':0x1f40,'format':_0x063f('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x519f69['on'](_0x063f('0x61'),function(_0x444bc1){fs['unlinkSync'](_0x3d3777);_0x52b242[_0x063f('0x1d')](0x1f4)[_0x063f('0x2b')](_0x444bc1);});_0x519f69['on'](_0x063f('0x62'),function(_0x538557){_0x279254['original_duration']=isNaN(_0x538557[_0x063f('0x63')])?null:_0x538557[_0x063f('0x63')]*0x3e8;_0x279254[_0x063f('0x64')]=isNaN(_0x538557[_0x063f('0x65')])?null:_0x538557[_0x063f('0x65')];_0x279254[_0x063f('0x66')]=isNaN(_0x538557[_0x063f('0x67')])?null:_0x538557[_0x063f('0x67')];_0x279254[_0x063f('0x68')]=isNaN(_0x538557[_0x063f('0x69')])?null:_0x538557[_0x063f('0x69')];_0x279254['original_sampleRate']=isNaN(_0x538557[_0x063f('0x6a')])?null:_0x538557[_0x063f('0x6a')];});_0x519f69['on'](_0x063f('0x6b'),function(_0x2c666f){_0x279254['converted_duration']=isNaN(_0x2c666f['duration'])?null:_0x2c666f[_0x063f('0x63')]*0x3e8;_0x279254[_0x063f('0x6c')]=isNaN(_0x2c666f[_0x063f('0x65')])?null:_0x2c666f['sampleCount'];_0x279254[_0x063f('0x6d')]=isNaN(_0x2c666f[_0x063f('0x67')])?null:_0x2c666f[_0x063f('0x67')];_0x279254[_0x063f('0x6e')]=isNaN(_0x2c666f[_0x063f('0x69')])?null:_0x2c666f['bitRate'];_0x279254[_0x063f('0x6f')]=isNaN(_0x2c666f[_0x063f('0x6a')])?null:_0x2c666f[_0x063f('0x6a')];});_0x519f69['on']('end',function(){fs[_0x063f('0x60')](_0x355a20,parseInt(_0x063f('0x70'),0x8));return db['Sound'][_0x063f('0x55')](_0x279254)[_0x063f('0x24')](function(_0x4fe054){var _0x3d02f3={'role':_0x29af66['body'][_0x063f('0x71')],'userProfileId':_0x29af66[_0x063f('0x72')]['userProfileId']};if(!_0x3d02f3)throw new Error(_0x063f('0x73'));if(_0x3d02f3['role']==='user'){var _0x3bc126=_0x4fe054[_0x063f('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x063f('0x49')]({'where':{'name':_0x063f('0x27'),'userProfileId':_0x3d02f3[_0x063f('0x74')]},'raw':!![]})[_0x063f('0x24')](function(_0x29af9a){if(_0x29af9a&&_0x29af9a['autoAssociation']===0x0){return db[_0x063f('0x28')][_0x063f('0x55')]({'name':_0x3bc126[_0x063f('0x2a')],'resourceId':_0x3bc126['id'],'type':_0x29af9a[_0x063f('0x2a')],'sectionId':_0x29af9a['id']},{})[_0x063f('0x24')](function(){return _0x4fe054;});}else{return _0x4fe054;}})[_0x063f('0x44')](function(_0x32ab22){logger[_0x063f('0x61')](_0x063f('0x75'),_0x32ab22);throw _0x32ab22;});}return _0x4fe054;})[_0x063f('0x24')](respondWithResult(_0x52b242,null))[_0x063f('0x44')](handleError(_0x52b242,null));});_0x519f69['start']();}catch(_0x2821f2){_0x52b242[_0x063f('0x1d')](0x1f4)[_0x063f('0x2b')](_0x2821f2);}};exports['update']=function(_0x5e6f28,_0x15f19a,_0x1fc132){return db[_0x063f('0x2e')][_0x063f('0x49')]({'where':{'id':_0x5e6f28['params']['id']}})[_0x063f('0x24')](handleEntityNotFound(_0x15f19a,null))[_0x063f('0x24')](saveUpdates(_[_0x063f('0x3e')](_0x5e6f28[_0x063f('0x72')],[_0x063f('0x2a'),_0x063f('0x76')]),null))[_0x063f('0x24')](respondWithResult(_0x15f19a,null))['catch'](handleError(_0x15f19a,null));};exports['delete']=function(_0x101126,_0x4460e2,_0x2cc94f){return db[_0x063f('0x2e')][_0x063f('0x49')]({'where':{'id':_0x101126[_0x063f('0x46')]['id']}})['then'](function(_0x36a5d0){if(_0x36a5d0){return _0x36a5d0[_0x063f('0x25')]();}})[_0x063f('0x24')](function(_0x58bca2){var _0x21133d=path[_0x063f('0x4d')](config[_0x063f('0x4e')],_0x063f('0x5c'),util[_0x063f('0x53')](_0x063f('0x54'),_0x58bca2[_0x063f('0x4b')],_0x58bca2[_0x063f('0x77')]));var _0x364c33=path[_0x063f('0x4d')](config[_0x063f('0x4e')],'server/files/sounds/converted',util[_0x063f('0x53')](_0x063f('0x54'),_0x58bca2[_0x063f('0x4b')],_0x58bca2[_0x063f('0x50')]));fs[_0x063f('0x78')](_0x21133d);fs[_0x063f('0x78')](_0x364c33);return _0x58bca2;})[_0x063f('0x24')](function(_0x25a1a4){if(_0x25a1a4){return _0x4460e2[_0x063f('0x1d')](0xcc)[_0x063f('0x17')]();}})[_0x063f('0x24')](handleEntityNotFound(_0x4460e2,null))[_0x063f('0x44')](handleError(_0x4460e2,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e1d28c7..763425b 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 _0x8af2=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./sound.attributes','define','Sound'];(function(_0x65478a,_0x293eea){var _0x15968c=function(_0x32c1f3){while(--_0x32c1f3){_0x65478a['push'](_0x65478a['shift']());}};_0x15968c(++_0x293eea);}(_0x8af2,0x108));var _0x28af=function(_0x3c06d1,_0x193d6e){_0x3c06d1=_0x3c06d1-0x0;var _0x5ee2be=_0x8af2[_0x3c06d1];return _0x5ee2be;};'use strict';var _=require(_0x28af('0x0'));var util=require(_0x28af('0x1'));var logger=require(_0x28af('0x2'))(_0x28af('0x3'));var moment=require(_0x28af('0x4'));var BPromise=require('bluebird');var rp=require(_0x28af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28af('0x6'));var config=require(_0x28af('0x7'));var attributes=require(_0x28af('0x8'));module['exports']=function(_0x2b5091,_0x471c8){return _0x2b5091[_0x28af('0x9')](_0x28af('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda9=['moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','../../config/logger'];(function(_0x5bb749,_0x1ffb5e){var _0x27b620=function(_0xd6bd94){while(--_0xd6bd94){_0x5bb749['push'](_0x5bb749['shift']());}};_0x27b620(++_0x1ffb5e);}(_0xeda9,0x1b7));var _0x9eda=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0xeda9[_0x1344d6];return _0xf45b24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9eda('0x0'))('api');var moment=require(_0x9eda('0x1'));var BPromise=require(_0x9eda('0x2'));var rp=require(_0x9eda('0x3'));var fs=require('fs');var path=require(_0x9eda('0x4'));var rimraf=require(_0x9eda('0x5'));var config=require('../../config/environment');var attributes=require(_0x9eda('0x6'));module[_0x9eda('0x7')]=function(_0x3186ee,_0x48c508){return _0x3186ee[_0x9eda('0x8')](_0x9eda('0x9'),attributes,{'tableName':_0x9eda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index e1761ce..4914306 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 _0x3b44=['info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSound','Sound','find','options','raw','where','include','map','model','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b44,0x9c));var _0x43b4=function(_0x18b209,_0xee1b3d){_0x18b209=_0x18b209-0x0;var _0x2b9aef=_0x3b44[_0x18b209];return _0x2b9aef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43b4('0x0'));var BPromise=require(_0x43b4('0x1'));var rs=require(_0x43b4('0x2'));var fs=require('fs');var Redis=require(_0x43b4('0x3'));var db=require(_0x43b4('0x4'))['db'];var utils=require(_0x43b4('0x5'));var logger=require('../../config/logger')(_0x43b4('0x6'));var config=require(_0x43b4('0x7'));var jayson=require(_0x43b4('0x8'));var client=jayson['client'][_0x43b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31141a,_0x5c0026,_0x14ee31){return new BPromise(function(_0x337679,_0x10e8fa){return client[_0x43b4('0xa')](_0x31141a,_0x14ee31)['then'](function(_0x5233d8){logger['info'](_0x43b4('0xb'),_0x5c0026,'request\x20sent');logger[_0x43b4('0xc')](_0x43b4('0xd'),_0x5c0026,_0x43b4('0xe'),JSON[_0x43b4('0xf')](_0x5233d8));if(_0x5233d8[_0x43b4('0x10')]){if(_0x5233d8[_0x43b4('0x10')][_0x43b4('0x11')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x5c0026,_0x5233d8['error'][_0x43b4('0x12')]);return _0x10e8fa(_0x5233d8['error']['message']);}logger[_0x43b4('0x10')](_0x43b4('0xb'),_0x5c0026,_0x5233d8[_0x43b4('0x10')][_0x43b4('0x12')]);return _0x337679(_0x5233d8['error'][_0x43b4('0x12')]);}else{logger['info'](_0x43b4('0xb'),_0x5c0026,_0x43b4('0xe'));_0x337679(_0x5233d8['result'][_0x43b4('0x12')]);}})[_0x43b4('0x13')](function(_0x334aed){logger['error'](_0x43b4('0xb'),_0x5c0026,_0x334aed);_0x10e8fa(_0x334aed);});});}exports[_0x43b4('0x14')]=function(_0x44fad9){var _0x261afc=this;return new Promise(function(_0xb84bac,_0x3ae78e){return db[_0x43b4('0x15')][_0x43b4('0x16')]({'raw':_0x44fad9[_0x43b4('0x17')]?_0x44fad9[_0x43b4('0x17')][_0x43b4('0x18')]===undefined?!![]:![]:!![],'where':_0x44fad9['options']?_0x44fad9[_0x43b4('0x17')][_0x43b4('0x19')]||null:null,'attributes':_0x44fad9[_0x43b4('0x17')]?_0x44fad9[_0x43b4('0x17')]['attributes']||null:null,'include':_0x44fad9[_0x43b4('0x17')]?_0x44fad9['options'][_0x43b4('0x1a')]?_[_0x43b4('0x1b')](_0x44fad9[_0x43b4('0x17')][_0x43b4('0x1a')],function(_0x10fa3b){return{'model':db[_0x10fa3b[_0x43b4('0x1c')]],'as':_0x10fa3b['as'],'attributes':_0x10fa3b[_0x43b4('0x1d')],'include':_0x10fa3b['include']?_[_0x43b4('0x1b')](_0x10fa3b[_0x43b4('0x1a')],function(_0x36d64e){return{'model':db[_0x36d64e[_0x43b4('0x1c')]],'as':_0x36d64e['as'],'attributes':_0x36d64e[_0x43b4('0x1d')],'include':_0x36d64e['include']?_['map'](_0x36d64e[_0x43b4('0x1a')],function(_0x371718){return{'model':db[_0x371718['model']],'as':_0x371718['as'],'attributes':_0x371718[_0x43b4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20d7e2){logger[_0x43b4('0x1e')](_0x43b4('0x14'),_0x44fad9);logger[_0x43b4('0xc')](_0x43b4('0x14'),_0x44fad9,JSON[_0x43b4('0xf')](_0x20d7e2));_0xb84bac(_0x20d7e2);})[_0x43b4('0x13')](function(_0x4ad3de){logger[_0x43b4('0x10')](_0x43b4('0x14'),_0x4ad3de[_0x43b4('0x12')],_0x44fad9);_0x3ae78e(_0x261afc['error'](0x1f4,_0x4ad3de[_0x43b4('0x12')]));});});}; \ No newline at end of file +var _0xa95d=['message','result','catch','ShowSound','Sound','options','raw','where','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0xa95d,0x91));var _0xda95=function(_0x3e6478,_0x58d025){_0x3e6478=_0x3e6478-0x0;var _0x3f821a=_0xa95d[_0x3e6478];return _0x3f821a;};'use strict';var _=require(_0xda95('0x0'));var util=require(_0xda95('0x1'));var moment=require(_0xda95('0x2'));var BPromise=require(_0xda95('0x3'));var rs=require(_0xda95('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda95('0x5'))['db'];var utils=require(_0xda95('0x6'));var logger=require(_0xda95('0x7'))(_0xda95('0x8'));var config=require(_0xda95('0x9'));var jayson=require(_0xda95('0xa'));var client=jayson['client'][_0xda95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346b00,_0x3c3687,_0x236d17){return new BPromise(function(_0x339c14,_0x44a79e){return client[_0xda95('0xc')](_0x346b00,_0x236d17)[_0xda95('0xd')](function(_0x1233b0){logger[_0xda95('0xe')](_0xda95('0xf'),_0x3c3687,_0xda95('0x10'));logger[_0xda95('0x11')]('Sound,\x20%s,\x20%s,\x20%s',_0x3c3687,'request\x20sent',JSON['stringify'](_0x1233b0));if(_0x1233b0[_0xda95('0x12')]){if(_0x1233b0[_0xda95('0x12')][_0xda95('0x13')]===0x1f4){logger[_0xda95('0x12')](_0xda95('0xf'),_0x3c3687,_0x1233b0[_0xda95('0x12')][_0xda95('0x14')]);return _0x44a79e(_0x1233b0[_0xda95('0x12')][_0xda95('0x14')]);}logger[_0xda95('0x12')](_0xda95('0xf'),_0x3c3687,_0x1233b0[_0xda95('0x12')][_0xda95('0x14')]);return _0x339c14(_0x1233b0[_0xda95('0x12')][_0xda95('0x14')]);}else{logger[_0xda95('0xe')](_0xda95('0xf'),_0x3c3687,_0xda95('0x10'));_0x339c14(_0x1233b0[_0xda95('0x15')][_0xda95('0x14')]);}})[_0xda95('0x16')](function(_0x30b33f){logger[_0xda95('0x12')]('Sound,\x20%s,\x20%s',_0x3c3687,_0x30b33f);_0x44a79e(_0x30b33f);});});}exports[_0xda95('0x17')]=function(_0x413db6){var _0x3204da=this;return new Promise(function(_0xaecd9f,_0x52fbb1){return db[_0xda95('0x18')]['find']({'raw':_0x413db6[_0xda95('0x19')]?_0x413db6[_0xda95('0x19')][_0xda95('0x1a')]===undefined?!![]:![]:!![],'where':_0x413db6[_0xda95('0x19')]?_0x413db6['options'][_0xda95('0x1b')]||null:null,'attributes':_0x413db6[_0xda95('0x19')]?_0x413db6[_0xda95('0x19')]['attributes']||null:null,'include':_0x413db6['options']?_0x413db6[_0xda95('0x19')][_0xda95('0x1c')]?_[_0xda95('0x1d')](_0x413db6[_0xda95('0x19')]['include'],function(_0x22fc8f){return{'model':db[_0x22fc8f[_0xda95('0x1e')]],'as':_0x22fc8f['as'],'attributes':_0x22fc8f['attributes'],'include':_0x22fc8f[_0xda95('0x1c')]?_[_0xda95('0x1d')](_0x22fc8f[_0xda95('0x1c')],function(_0x26ca4a){return{'model':db[_0x26ca4a[_0xda95('0x1e')]],'as':_0x26ca4a['as'],'attributes':_0x26ca4a['attributes'],'include':_0x26ca4a[_0xda95('0x1c')]?_[_0xda95('0x1d')](_0x26ca4a[_0xda95('0x1c')],function(_0x1f2f3d){return{'model':db[_0x1f2f3d[_0xda95('0x1e')]],'as':_0x1f2f3d['as'],'attributes':_0x1f2f3d[_0xda95('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xda95('0xd')](function(_0x34737e){logger['info']('ShowSound',_0x413db6);logger['debug'](_0xda95('0x17'),_0x413db6,JSON[_0xda95('0x20')](_0x34737e));_0xaecd9f(_0x34737e);})['catch'](function(_0x30d4f1){logger[_0xda95('0x12')](_0xda95('0x17'),_0x30d4f1[_0xda95('0x14')],_0x413db6);_0x52fbb1(_0x3204da[_0xda95('0x12')](0x1f4,_0x30d4f1[_0xda95('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 824ce4c..01d446f 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2ca972,_0x131f3d){_0x2ca972=_0x2ca972-0x0;var _0x267a33=_0x9ffd[_0x2ca972];return _0x267a33;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x3004da,_0x238bef){var _0x3025cc=function(_0x23c69d){while(--_0x23c69d){_0x3004da['push'](_0x3004da['shift']());}};_0x3025cc(++_0x238bef);}(_0x757a,0xde));var _0xa757=function(_0x4e67cd,_0x1f6c4c){_0x4e67cd=_0x4e67cd-0x0;var _0x304088=_0x757a[_0x4e67cd];return _0x304088;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1aa05d9..367867d 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 _0xe30e=['medium','ENUM','out','sequelize','exports'];(function(_0x263a8a,_0x5c088d){var _0x226a79=function(_0x53a7d1){while(--_0x53a7d1){_0x263a8a['push'](_0x263a8a['shift']());}};_0x226a79(++_0x5c088d);}(_0xe30e,0xee));var _0xee30=function(_0x27ccb6,_0x103913){_0x27ccb6=_0x27ccb6-0x0;var _0x412043=_0xe30e[_0x27ccb6];return _0x412043;};'use strict';var Sequelize=require(_0xee30('0x0'));module[_0xee30('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xee30('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xee30('0x3')]('in',_0xee30('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xedb0=['exports','TEXT','medium','STRING'];(function(_0x2fdee8,_0xa3fed7){var _0x5cd20b=function(_0x8678b3){while(--_0x8678b3){_0x2fdee8['push'](_0x2fdee8['shift']());}};_0x5cd20b(++_0xa3fed7);}(_0xedb0,0x15c));var _0x0edb=function(_0x45457c,_0x3af641){_0x45457c=_0x45457c-0x0;var _0xed9983=_0xedb0[_0x45457c];return _0xed9983;};'use strict';var Sequelize=require('sequelize');module[_0x0edb('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x0edb('0x1')](_0x0edb('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x0edb('0x3')]},'providerResponse':{'type':Sequelize[_0x0edb('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 847f73b..4b1b9a5 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 _0x783c=['SquareMessage','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','create','body','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map'];(function(_0x50c2cf,_0x2448fd){var _0x2133cd=function(_0x57f6f9){while(--_0x57f6f9){_0x50c2cf['push'](_0x50c2cf['shift']());}};_0x2133cd(++_0x2448fd);}(_0x783c,0xaf));var _0xc783=function(_0x4e5982,_0x330657){_0x4e5982=_0x4e5982-0x0;var _0x1ca74f=_0x783c[_0x4e5982];return _0x1ca74f;};'use strict';var emlformat=require(_0xc783('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc783('0x1'));var jsonpatch=require(_0xc783('0x2'));var rp=require(_0xc783('0x3'));var moment=require('moment');var BPromise=require(_0xc783('0x4'));var Mustache=require('mustache');var util=require(_0xc783('0x5'));var path=require(_0xc783('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc783('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc783('0x8'));var jsforce=require(_0xc783('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc783('0xa'));var Papa=require(_0xc783('0xb'));var Redis=require(_0xc783('0xc'));var authService=require(_0xc783('0xd'));var qs=require(_0xc783('0xe'));var as=require(_0xc783('0xf'));var hardwareService=require(_0xc783('0x10'));var logger=require('../../config/logger')(_0xc783('0x11'));var utils=require(_0xc783('0x12'));var config=require(_0xc783('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc783('0x14'))['db'];function respondWithStatusCode(_0x22d535,_0xe21c3e){_0xe21c3e=_0xe21c3e||0xcc;return function(_0xfb8f0){if(_0xfb8f0){return _0x22d535[_0xc783('0x15')](_0xe21c3e);}return _0x22d535[_0xc783('0x16')](_0xe21c3e)['end']();};}function respondWithResult(_0x733116,_0x1bbd52){_0x1bbd52=_0x1bbd52||0xc8;return function(_0x1ba7f6){if(_0x1ba7f6){return _0x733116[_0xc783('0x16')](_0x1bbd52)[_0xc783('0x17')](_0x1ba7f6);}};}function respondWithFilteredResult(_0xf12081,_0x1e7ab9){return function(_0xb26d99){if(_0xb26d99){var _0x5b3ee5=typeof _0x1e7ab9[_0xc783('0x18')]==='undefined'&&typeof _0x1e7ab9['limit']===_0xc783('0x19');var _0x63103b=_0xb26d99[_0xc783('0x1a')];var _0x3e6056=_0x5b3ee5?0x0:_0x1e7ab9[_0xc783('0x18')];var _0x2bed66=_0x5b3ee5?_0xb26d99['count']:_0x1e7ab9['offset']+_0x1e7ab9[_0xc783('0x1b')];var _0x4a7196;if(_0x2bed66>=_0x63103b){_0x2bed66=_0x63103b;_0x4a7196=0xc8;}else{_0x4a7196=0xce;}_0xf12081[_0xc783('0x16')](_0x4a7196);return _0xf12081[_0xc783('0x1c')](_0xc783('0x1d'),_0x3e6056+'-'+_0x2bed66+'/'+_0x63103b)['json'](_0xb26d99);}return null;};}function patchUpdates(_0x2d3dfa){return function(_0x205e74){try{jsonpatch[_0xc783('0x1e')](_0x205e74,_0x2d3dfa,!![]);}catch(_0x125bb9){return BPromise['reject'](_0x125bb9);}return _0x205e74[_0xc783('0x1f')]();};}function saveUpdates(_0x169228,_0x5720f6){return function(_0x3db82f){if(_0x3db82f){return _0x3db82f[_0xc783('0x20')](_0x169228)[_0xc783('0x21')](function(_0x6e8724){return _0x6e8724;});}return null;};}function removeEntity(_0x2182df,_0x2c2132){return function(_0x378456){if(_0x378456){return _0x378456['destroy']()[_0xc783('0x21')](function(){_0x2182df[_0xc783('0x16')](0xcc)[_0xc783('0x22')]();});}};}function handleEntityNotFound(_0x3c4b51,_0x221d1d){return function(_0x37dad1){if(!_0x37dad1){_0x3c4b51[_0xc783('0x15')](0x194);}return _0x37dad1;};}function handleError(_0xf28a23,_0x42d4f4){_0x42d4f4=_0x42d4f4||0x1f4;return function(_0x220b62){logger[_0xc783('0x23')](_0x220b62[_0xc783('0x24')]);if(_0x220b62[_0xc783('0x25')]){delete _0x220b62[_0xc783('0x25')];}_0xf28a23['status'](_0x42d4f4)[_0xc783('0x26')](_0x220b62);};}exports[_0xc783('0x27')]=function(_0x3e9035,_0x3f2a3b){var _0x5c6f3e={},_0x54ca7c={},_0x19b0ca={'count':0x0,'rows':[]};var _0x56c0cd=_[_0xc783('0x28')](db[_0xc783('0x29')]['rawAttributes'],function(_0x4218cf){return{'name':_0x4218cf[_0xc783('0x2a')],'type':_0x4218cf[_0xc783('0x2b')][_0xc783('0x2c')]};});_0x54ca7c['model']=_[_0xc783('0x28')](_0x56c0cd,_0xc783('0x25'));_0x54ca7c[_0xc783('0x2d')]=_[_0xc783('0x2e')](_0x3e9035['query']);_0x54ca7c['filters']=_[_0xc783('0x2f')](_0x54ca7c[_0xc783('0x30')],_0x54ca7c[_0xc783('0x2d')]);_0x5c6f3e[_0xc783('0x31')]=_[_0xc783('0x2f')](_0x54ca7c['model'],qs['fields'](_0x3e9035[_0xc783('0x2d')][_0xc783('0x32')]));_0x5c6f3e[_0xc783('0x31')]=_0x5c6f3e[_0xc783('0x31')][_0xc783('0x33')]?_0x5c6f3e['attributes']:_0x54ca7c[_0xc783('0x30')];if(!_0x3e9035[_0xc783('0x2d')][_0xc783('0x34')](_0xc783('0x35'))){_0x5c6f3e['limit']=qs[_0xc783('0x1b')](_0x3e9035[_0xc783('0x2d')][_0xc783('0x1b')]);_0x5c6f3e[_0xc783('0x18')]=qs[_0xc783('0x18')](_0x3e9035[_0xc783('0x2d')][_0xc783('0x18')]);}_0x5c6f3e[_0xc783('0x36')]=qs[_0xc783('0x37')](_0x3e9035[_0xc783('0x2d')][_0xc783('0x37')]);_0x5c6f3e[_0xc783('0x38')]=qs[_0xc783('0x39')](_['pick'](_0x3e9035[_0xc783('0x2d')],_0x54ca7c[_0xc783('0x39')]),_0x56c0cd);if(_0x3e9035[_0xc783('0x2d')][_0xc783('0x3a')]){_0x5c6f3e[_0xc783('0x38')]=_[_0xc783('0x3b')](_0x5c6f3e[_0xc783('0x38')],{'$or':_['map'](_0x56c0cd,function(_0x462b88){if(_0x462b88[_0xc783('0x2b')]!==_0xc783('0x3c')){var _0x4a934d={};_0x4a934d[_0x462b88['name']]={'$like':'%'+_0x3e9035[_0xc783('0x2d')][_0xc783('0x3a')]+'%'};return _0x4a934d;}})});}_0x5c6f3e=_[_0xc783('0x3b')]({},_0x5c6f3e,_0x3e9035[_0xc783('0x3d')]);var _0x142894={'where':_0x5c6f3e[_0xc783('0x38')]};return db['SquareMessage'][_0xc783('0x1a')](_0x142894)[_0xc783('0x21')](function(_0x572978){_0x19b0ca[_0xc783('0x1a')]=_0x572978;if(_0x3e9035['query'][_0xc783('0x3e')]){_0x5c6f3e[_0xc783('0x3f')]=[{'all':!![]}];}return db[_0xc783('0x29')]['findAll'](_0x5c6f3e);})[_0xc783('0x21')](function(_0x163581){_0x19b0ca['rows']=_0x163581;return _0x19b0ca;})[_0xc783('0x21')](respondWithFilteredResult(_0x3f2a3b,_0x5c6f3e))[_0xc783('0x40')](handleError(_0x3f2a3b,null));};exports[_0xc783('0x41')]=function(_0x17a2ae,_0xcc2457){var _0x49019c={'raw':!![],'where':{'id':_0x17a2ae[_0xc783('0x42')]['id']}},_0x196f0c={};_0x196f0c[_0xc783('0x30')]=_['keys'](db[_0xc783('0x29')][_0xc783('0x43')]);_0x196f0c[_0xc783('0x2d')]=_[_0xc783('0x2e')](_0x17a2ae[_0xc783('0x2d')]);_0x196f0c[_0xc783('0x39')]=_[_0xc783('0x2f')](_0x196f0c[_0xc783('0x30')],_0x196f0c['query']);_0x49019c[_0xc783('0x31')]=_[_0xc783('0x2f')](_0x196f0c[_0xc783('0x30')],qs[_0xc783('0x32')](_0x17a2ae['query'][_0xc783('0x32')]));_0x49019c[_0xc783('0x31')]=_0x49019c[_0xc783('0x31')][_0xc783('0x33')]?_0x49019c[_0xc783('0x31')]:_0x196f0c['model'];if(_0x17a2ae[_0xc783('0x2d')][_0xc783('0x3e')]){_0x49019c[_0xc783('0x3f')]=[{'all':!![]}];}_0x49019c=_[_0xc783('0x3b')]({},_0x49019c,_0x17a2ae['options']);return db[_0xc783('0x29')]['find'](_0x49019c)[_0xc783('0x21')](handleEntityNotFound(_0xcc2457,null))['then'](respondWithResult(_0xcc2457,null))['catch'](handleError(_0xcc2457,null));};exports[_0xc783('0x44')]=function(_0x232de3,_0x1f2b3a){return db[_0xc783('0x29')]['create'](_0x232de3[_0xc783('0x45')],{})['then'](respondWithResult(_0x1f2b3a,0xc9))[_0xc783('0x40')](handleError(_0x1f2b3a,null));};exports[_0xc783('0x20')]=function(_0x5b40e1,_0x319875){if(_0x5b40e1['body']['id']){delete _0x5b40e1[_0xc783('0x45')]['id'];}return db[_0xc783('0x29')]['find']({'where':{'id':_0x5b40e1[_0xc783('0x42')]['id']}})[_0xc783('0x21')](handleEntityNotFound(_0x319875,null))[_0xc783('0x21')](saveUpdates(_0x5b40e1[_0xc783('0x45')],null))['then'](respondWithResult(_0x319875,null))[_0xc783('0x40')](handleError(_0x319875,null));};exports[_0xc783('0x46')]=function(_0x1674fa,_0x2249a5){return db[_0xc783('0x29')][_0xc783('0x47')]({'where':{'id':_0x1674fa[_0xc783('0x42')]['id']}})[_0xc783('0x21')](handleEntityNotFound(_0x2249a5,null))[_0xc783('0x21')](removeEntity(_0x2249a5,null))[_0xc783('0x40')](handleError(_0x2249a5,null));}; \ No newline at end of file +var _0x1177=['length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x488bc8,_0x5a50aa){var _0x148b19=function(_0x415198){while(--_0x415198){_0x488bc8['push'](_0x488bc8['shift']());}};_0x148b19(++_0x5a50aa);}(_0x1177,0x143));var _0x7117=function(_0x572fdb,_0x87c666){_0x572fdb=_0x572fdb-0x0;var _0x5478a7=_0x1177[_0x572fdb];return _0x5478a7;};'use strict';var emlformat=require(_0x7117('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7117('0x1'));var jsonpatch=require(_0x7117('0x2'));var rp=require(_0x7117('0x3'));var moment=require('moment');var BPromise=require(_0x7117('0x4'));var Mustache=require(_0x7117('0x5'));var util=require(_0x7117('0x6'));var path=require(_0x7117('0x7'));var sox=require(_0x7117('0x8'));var csv=require(_0x7117('0x9'));var ejs=require(_0x7117('0xa'));var fs=require('fs');var fs_extra=require(_0x7117('0xb'));var _=require(_0x7117('0xc'));var squel=require('squel');var crypto=require(_0x7117('0xd'));var jsforce=require(_0x7117('0xe'));var deskjs=require(_0x7117('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7117('0x10'));var Papa=require(_0x7117('0x11'));var Redis=require(_0x7117('0x12'));var authService=require(_0x7117('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7117('0x14'));var hardwareService=require(_0x7117('0x15'));var logger=require('../../config/logger')(_0x7117('0x16'));var utils=require(_0x7117('0x17'));var config=require(_0x7117('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x165b1a,_0x288cc9){_0x288cc9=_0x288cc9||0xcc;return function(_0x532d3f){if(_0x532d3f){return _0x165b1a[_0x7117('0x19')](_0x288cc9);}return _0x165b1a['status'](_0x288cc9)['end']();};}function respondWithResult(_0x4bf645,_0x244406){_0x244406=_0x244406||0xc8;return function(_0x30342e){if(_0x30342e){return _0x4bf645[_0x7117('0x1a')](_0x244406)[_0x7117('0x1b')](_0x30342e);}};}function respondWithFilteredResult(_0x530040,_0x145e70){return function(_0x5f1be9){if(_0x5f1be9){var _0xe683af=typeof _0x145e70[_0x7117('0x1c')]===_0x7117('0x1d')&&typeof _0x145e70[_0x7117('0x1e')]==='undefined';var _0x227066=_0x5f1be9[_0x7117('0x1f')];var _0x4f32a9=_0xe683af?0x0:_0x145e70['offset'];var _0x3e3163=_0xe683af?_0x5f1be9[_0x7117('0x1f')]:_0x145e70['offset']+_0x145e70[_0x7117('0x1e')];var _0x308e39;if(_0x3e3163>=_0x227066){_0x3e3163=_0x227066;_0x308e39=0xc8;}else{_0x308e39=0xce;}_0x530040[_0x7117('0x1a')](_0x308e39);return _0x530040[_0x7117('0x20')](_0x7117('0x21'),_0x4f32a9+'-'+_0x3e3163+'/'+_0x227066)[_0x7117('0x1b')](_0x5f1be9);}return null;};}function patchUpdates(_0x56b843){return function(_0x10f278){try{jsonpatch['apply'](_0x10f278,_0x56b843,!![]);}catch(_0x458a49){return BPromise[_0x7117('0x22')](_0x458a49);}return _0x10f278[_0x7117('0x23')]();};}function saveUpdates(_0x3098aa,_0x4e9561){return function(_0x45f1e3){if(_0x45f1e3){return _0x45f1e3[_0x7117('0x24')](_0x3098aa)[_0x7117('0x25')](function(_0x296062){return _0x296062;});}return null;};}function removeEntity(_0x52b830,_0x13ed85){return function(_0x15503d){if(_0x15503d){return _0x15503d[_0x7117('0x26')]()[_0x7117('0x25')](function(){_0x52b830['status'](0xcc)[_0x7117('0x27')]();});}};}function handleEntityNotFound(_0x5e4033,_0x2905cc){return function(_0x478c15){if(!_0x478c15){_0x5e4033[_0x7117('0x19')](0x194);}return _0x478c15;};}function handleError(_0x3641e5,_0x407126){_0x407126=_0x407126||0x1f4;return function(_0x904b4e){logger[_0x7117('0x28')](_0x904b4e['stack']);if(_0x904b4e[_0x7117('0x29')]){delete _0x904b4e[_0x7117('0x29')];}_0x3641e5[_0x7117('0x1a')](_0x407126)[_0x7117('0x2a')](_0x904b4e);};}exports[_0x7117('0x2b')]=function(_0x1eb600,_0x18315e){var _0x140eff={},_0x204389={},_0x581be0={'count':0x0,'rows':[]};var _0x50f967=_[_0x7117('0x2c')](db[_0x7117('0x2d')][_0x7117('0x2e')],function(_0xa04523){return{'name':_0xa04523[_0x7117('0x2f')],'type':_0xa04523[_0x7117('0x30')][_0x7117('0x31')]};});_0x204389[_0x7117('0x32')]=_[_0x7117('0x2c')](_0x50f967,_0x7117('0x29'));_0x204389[_0x7117('0x33')]=_[_0x7117('0x34')](_0x1eb600[_0x7117('0x33')]);_0x204389[_0x7117('0x35')]=_[_0x7117('0x36')](_0x204389[_0x7117('0x32')],_0x204389[_0x7117('0x33')]);_0x140eff[_0x7117('0x37')]=_[_0x7117('0x36')](_0x204389['model'],qs['fields'](_0x1eb600[_0x7117('0x33')][_0x7117('0x38')]));_0x140eff[_0x7117('0x37')]=_0x140eff[_0x7117('0x37')][_0x7117('0x39')]?_0x140eff[_0x7117('0x37')]:_0x204389[_0x7117('0x32')];if(!_0x1eb600['query']['hasOwnProperty'](_0x7117('0x3a'))){_0x140eff[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x1eb600[_0x7117('0x33')][_0x7117('0x1e')]);_0x140eff[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0x1eb600['query'][_0x7117('0x1c')]);}_0x140eff[_0x7117('0x3b')]=qs['sort'](_0x1eb600[_0x7117('0x33')][_0x7117('0x3c')]);_0x140eff['where']=qs[_0x7117('0x35')](_[_0x7117('0x3d')](_0x1eb600['query'],_0x204389[_0x7117('0x35')]),_0x50f967);if(_0x1eb600[_0x7117('0x33')]['filter']){_0x140eff[_0x7117('0x3e')]=_[_0x7117('0x3f')](_0x140eff['where'],{'$or':_[_0x7117('0x2c')](_0x50f967,function(_0x129d04){if(_0x129d04[_0x7117('0x30')]!==_0x7117('0x40')){var _0x435896={};_0x435896[_0x129d04[_0x7117('0x29')]]={'$like':'%'+_0x1eb600[_0x7117('0x33')][_0x7117('0x41')]+'%'};return _0x435896;}})});}_0x140eff=_[_0x7117('0x3f')]({},_0x140eff,_0x1eb600[_0x7117('0x42')]);var _0x39e60e={'where':_0x140eff['where']};return db[_0x7117('0x2d')][_0x7117('0x1f')](_0x39e60e)[_0x7117('0x25')](function(_0x1879ad){_0x581be0[_0x7117('0x1f')]=_0x1879ad;if(_0x1eb600[_0x7117('0x33')][_0x7117('0x43')]){_0x140eff[_0x7117('0x44')]=[{'all':!![]}];}return db[_0x7117('0x2d')]['findAll'](_0x140eff);})[_0x7117('0x25')](function(_0x4bc8a4){_0x581be0[_0x7117('0x45')]=_0x4bc8a4;return _0x581be0;})[_0x7117('0x25')](respondWithFilteredResult(_0x18315e,_0x140eff))[_0x7117('0x46')](handleError(_0x18315e,null));};exports[_0x7117('0x47')]=function(_0x287617,_0x29e9cd){var _0x1c22e8={'raw':!![],'where':{'id':_0x287617[_0x7117('0x48')]['id']}},_0x4f3ff0={};_0x4f3ff0[_0x7117('0x32')]=_['keys'](db[_0x7117('0x2d')][_0x7117('0x2e')]);_0x4f3ff0['query']=_['keys'](_0x287617[_0x7117('0x33')]);_0x4f3ff0[_0x7117('0x35')]=_[_0x7117('0x36')](_0x4f3ff0[_0x7117('0x32')],_0x4f3ff0[_0x7117('0x33')]);_0x1c22e8[_0x7117('0x37')]=_['intersection'](_0x4f3ff0[_0x7117('0x32')],qs[_0x7117('0x38')](_0x287617[_0x7117('0x33')]['fields']));_0x1c22e8[_0x7117('0x37')]=_0x1c22e8[_0x7117('0x37')][_0x7117('0x39')]?_0x1c22e8['attributes']:_0x4f3ff0[_0x7117('0x32')];if(_0x287617[_0x7117('0x33')][_0x7117('0x43')]){_0x1c22e8['include']=[{'all':!![]}];}_0x1c22e8=_['merge']({},_0x1c22e8,_0x287617[_0x7117('0x42')]);return db[_0x7117('0x2d')][_0x7117('0x49')](_0x1c22e8)[_0x7117('0x25')](handleEntityNotFound(_0x29e9cd,null))[_0x7117('0x25')](respondWithResult(_0x29e9cd,null))['catch'](handleError(_0x29e9cd,null));};exports['create']=function(_0x21742d,_0x25eb5a){return db['SquareMessage'][_0x7117('0x4a')](_0x21742d['body'],{})['then'](respondWithResult(_0x25eb5a,0xc9))[_0x7117('0x46')](handleError(_0x25eb5a,null));};exports['update']=function(_0x33543e,_0x336ac7){if(_0x33543e[_0x7117('0x4b')]['id']){delete _0x33543e['body']['id'];}return db[_0x7117('0x2d')][_0x7117('0x49')]({'where':{'id':_0x33543e[_0x7117('0x48')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x336ac7,null))[_0x7117('0x25')](saveUpdates(_0x33543e[_0x7117('0x4b')],null))[_0x7117('0x25')](respondWithResult(_0x336ac7,null))['catch'](handleError(_0x336ac7,null));};exports[_0x7117('0x26')]=function(_0x161b33,_0x434be2){return db[_0x7117('0x2d')][_0x7117('0x49')]({'where':{'id':_0x161b33[_0x7117('0x48')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x434be2,null))['then'](removeEntity(_0x434be2,null))[_0x7117('0x46')](handleError(_0x434be2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index be3e4d3..7a0faab 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 _0x6a2f=['request-promise','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x6a2f,0x140));var _0xf6a2=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x6a2f[_0x216008];return _0x4d384f;};'use strict';var _=require(_0xf6a2('0x0'));var util=require(_0xf6a2('0x1'));var logger=require(_0xf6a2('0x2'))(_0xf6a2('0x3'));var moment=require(_0xf6a2('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6a2('0x5'));var fs=require('fs');var path=require(_0xf6a2('0x6'));var rimraf=require('rimraf');var config=require(_0xf6a2('0x7'));var attributes=require(_0xf6a2('0x8'));module[_0xf6a2('0x9')]=function(_0x3810f7,_0x2f0393){return _0x3810f7[_0xf6a2('0xa')](_0xf6a2('0xb'),attributes,{'tableName':_0xf6a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb1=['define','SquareMessage','square_messages','../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareMessage.attributes','exports'];(function(_0xece535,_0x23de0d){var _0x97f68a=function(_0x50cca3){while(--_0x50cca3){_0xece535['push'](_0xece535['shift']());}};_0x97f68a(++_0x23de0d);}(_0x5eb1,0xc9));var _0x15eb=function(_0x233a13,_0x355a55){_0x233a13=_0x233a13-0x0;var _0x5ed596=_0x5eb1[_0x233a13];return _0x5ed596;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x15eb('0x0'))(_0x15eb('0x1'));var moment=require(_0x15eb('0x2'));var BPromise=require(_0x15eb('0x3'));var rp=require(_0x15eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x5'));var config=require('../../config/environment');var attributes=require(_0x15eb('0x6'));module[_0x15eb('0x7')]=function(_0x15feeb,_0x431cb2){return _0x15feeb[_0x15eb('0x8')](_0x15eb('0x9'),attributes,{'tableName':_0x15eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index ea414b9..8c2514a 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 _0xe4b9=['request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x7c51a6,_0x2138c3){var _0x53936c=function(_0x653722){while(--_0x653722){_0x7c51a6['push'](_0x7c51a6['shift']());}};_0x53936c(++_0x2138c3);}(_0xe4b9,0x1a9));var _0x9e4b=function(_0x21a0cb,_0x5a4cc5){_0x21a0cb=_0x21a0cb-0x0;var _0x2e9bb4=_0xe4b9[_0x21a0cb];return _0x2e9bb4;};'use strict';var _=require(_0x9e4b('0x0'));var util=require(_0x9e4b('0x1'));var moment=require(_0x9e4b('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e4b('0x3'));var fs=require('fs');var Redis=require(_0x9e4b('0x4'));var db=require(_0x9e4b('0x5'))['db'];var utils=require(_0x9e4b('0x6'));var logger=require('../../config/logger')(_0x9e4b('0x7'));var config=require('../../config/environment');var jayson=require(_0x9e4b('0x8'));var client=jayson['client'][_0x9e4b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb8697,_0x5ae900,_0x1210e1){return new BPromise(function(_0x2b3c04,_0x555849){return client[_0x9e4b('0xa')](_0xbb8697,_0x1210e1)[_0x9e4b('0xb')](function(_0x2155db){logger[_0x9e4b('0xc')](_0x9e4b('0xd'),_0x5ae900,_0x9e4b('0xe'));logger[_0x9e4b('0xf')](_0x9e4b('0x10'),_0x5ae900,_0x9e4b('0xe'),JSON[_0x9e4b('0x11')](_0x2155db));if(_0x2155db[_0x9e4b('0x12')]){if(_0x2155db['error'][_0x9e4b('0x13')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5ae900,_0x2155db['error'][_0x9e4b('0x14')]);return _0x555849(_0x2155db[_0x9e4b('0x12')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x5ae900,_0x2155db['error'][_0x9e4b('0x14')]);return _0x2b3c04(_0x2155db[_0x9e4b('0x12')][_0x9e4b('0x14')]);}else{logger[_0x9e4b('0xc')](_0x9e4b('0xd'),_0x5ae900,'request\x20sent');_0x2b3c04(_0x2155db[_0x9e4b('0x15')][_0x9e4b('0x14')]);}})[_0x9e4b('0x16')](function(_0x1b09b8){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5ae900,_0x1b09b8);_0x555849(_0x1b09b8);});});}exports[_0x9e4b('0x17')]=function(_0xb763d0){var _0x3b6d35=this;return new Promise(function(_0x571e72,_0x1e2079){return db[_0x9e4b('0x18')][_0x9e4b('0x19')](_0xb763d0[_0x9e4b('0x1a')],{'raw':_0xb763d0[_0x9e4b('0x1b')]?_0xb763d0[_0x9e4b('0x1b')][_0x9e4b('0x1c')]===undefined?!![]:![]:!![]})[_0x9e4b('0xb')](function(_0x14c996){logger[_0x9e4b('0xc')](_0x9e4b('0x17'),_0xb763d0);logger[_0x9e4b('0xf')]('CreateSquareMessage',_0xb763d0,JSON[_0x9e4b('0x11')](_0x14c996));_0x571e72(_0x14c996);})[_0x9e4b('0x16')](function(_0x51cce8){logger[_0x9e4b('0x12')]('CreateSquareMessage',_0x51cce8[_0x9e4b('0x14')],_0xb763d0);_0x1e2079(_0x3b6d35[_0x9e4b('0x12')](0x1f4,_0x51cce8['message']));});});}; \ No newline at end of file +var _0x9ffe=['catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5beb1e,_0x5f148a){var _0x2c2734=function(_0x2d8672){while(--_0x2d8672){_0x5beb1e['push'](_0x5beb1e['shift']());}};_0x2c2734(++_0x5f148a);}(_0x9ffe,0xfa));var _0xe9ff=function(_0x552e94,_0x110f92){_0x552e94=_0x552e94-0x0;var _0x12587b=_0x9ffe[_0x552e94];return _0x12587b;};'use strict';var _=require(_0xe9ff('0x0'));var util=require(_0xe9ff('0x1'));var moment=require(_0xe9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9ff('0x4'));var logger=require(_0xe9ff('0x5'))('rpc');var config=require(_0xe9ff('0x6'));var jayson=require(_0xe9ff('0x7'));var client=jayson[_0xe9ff('0x8')][_0xe9ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e9cdd,_0x9bd762,_0x1dc4c0){return new BPromise(function(_0xdaf2d9,_0x798053){return client['request'](_0x3e9cdd,_0x1dc4c0)[_0xe9ff('0xa')](function(_0x24fd99){logger[_0xe9ff('0xb')](_0xe9ff('0xc'),_0x9bd762,_0xe9ff('0xd'));logger[_0xe9ff('0xe')](_0xe9ff('0xf'),_0x9bd762,'request\x20sent',JSON[_0xe9ff('0x10')](_0x24fd99));if(_0x24fd99['error']){if(_0x24fd99[_0xe9ff('0x11')][_0xe9ff('0x12')]===0x1f4){logger[_0xe9ff('0x11')]('SquareMessage,\x20%s,\x20%s',_0x9bd762,_0x24fd99[_0xe9ff('0x11')][_0xe9ff('0x13')]);return _0x798053(_0x24fd99['error'][_0xe9ff('0x13')]);}logger[_0xe9ff('0x11')](_0xe9ff('0xc'),_0x9bd762,_0x24fd99['error']['message']);return _0xdaf2d9(_0x24fd99['error']['message']);}else{logger[_0xe9ff('0xb')](_0xe9ff('0xc'),_0x9bd762,_0xe9ff('0xd'));_0xdaf2d9(_0x24fd99['result'][_0xe9ff('0x13')]);}})[_0xe9ff('0x14')](function(_0x42beaa){logger[_0xe9ff('0x11')](_0xe9ff('0xc'),_0x9bd762,_0x42beaa);_0x798053(_0x42beaa);});});}exports[_0xe9ff('0x15')]=function(_0x5efe81){var _0x5123f6=this;return new Promise(function(_0x1dbfe3,_0x4c908a){return db[_0xe9ff('0x16')][_0xe9ff('0x17')](_0x5efe81[_0xe9ff('0x18')],{'raw':_0x5efe81['options']?_0x5efe81[_0xe9ff('0x19')][_0xe9ff('0x1a')]===undefined?!![]:![]:!![]})[_0xe9ff('0xa')](function(_0x377a0f){logger[_0xe9ff('0xb')](_0xe9ff('0x15'),_0x5efe81);logger[_0xe9ff('0xe')](_0xe9ff('0x15'),_0x5efe81,JSON[_0xe9ff('0x10')](_0x377a0f));_0x1dbfe3(_0x377a0f);})[_0xe9ff('0x14')](function(_0x17bbe6){logger['error'](_0xe9ff('0x15'),_0x17bbe6['message'],_0x5efe81);_0x4c908a(_0x5123f6['error'](0x1f4,_0x17bbe6[_0xe9ff('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e76feff..66159bf 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 _0x8219=['test','post','create','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','15s'];(function(_0x281178,_0x33887e){var _0x1bfe18=function(_0x4cfd9f){while(--_0x4cfd9f){_0x281178['push'](_0x281178['shift']());}};_0x1bfe18(++_0x33887e);}(_0x8219,0x1d5));var _0x9821=function(_0x5b6375,_0x563718){_0x5b6375=_0x5b6375-0x0;var _0x4045b4=_0x8219[_0x5b6375];return _0x4045b4;};'use strict';var multer=require(_0x9821('0x0'));var util=require(_0x9821('0x1'));var path=require('path');var timeout=require(_0x9821('0x2'));var express=require(_0x9821('0x3'));var router=express[_0x9821('0x4')]();var fs_extra=require(_0x9821('0x5'));var auth=require(_0x9821('0x6'));var interaction=require(_0x9821('0x7'));var config=require(_0x9821('0x8'));var controller=require(_0x9821('0x9'));router[_0x9821('0xa')]('/',auth[_0x9821('0xb')](),controller[_0x9821('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9821('0xd')]);router[_0x9821('0xa')]('/:id/test',auth[_0x9821('0xb')](),timeout(_0x9821('0xe')),controller[_0x9821('0xf')]);router[_0x9821('0x10')]('/',auth['isAuthenticated'](),controller[_0x9821('0x11')]);router['put'](_0x9821('0x12'),auth[_0x9821('0xb')](),controller[_0x9821('0x13')]);router[_0x9821('0x14')](_0x9821('0x12'),auth[_0x9821('0xb')](),controller['destroy']);module[_0x9821('0x15')]=router; \ No newline at end of file +var _0xc136=['exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','/:id/test','test','post','create','put','/:id','update','delete','destroy'];(function(_0x269873,_0x2e0f41){var _0x3a6c63=function(_0x5d8721){while(--_0x5d8721){_0x269873['push'](_0x269873['shift']());}};_0x3a6c63(++_0x2e0f41);}(_0xc136,0x145));var _0x6c13=function(_0x54c160,_0x1141bb){_0x54c160=_0x54c160-0x0;var _0x51dc47=_0xc136[_0x54c160];return _0x51dc47;};'use strict';var multer=require(_0x6c13('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c13('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6c13('0x2'));var interaction=require(_0x6c13('0x3'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth[_0x6c13('0x4')](),controller[_0x6c13('0x5')]);router[_0x6c13('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x6c13('0x7')]);router['get'](_0x6c13('0x8'),auth[_0x6c13('0x4')](),timeout('15s'),controller[_0x6c13('0x9')]);router[_0x6c13('0xa')]('/',auth['isAuthenticated'](),controller[_0x6c13('0xb')]);router[_0x6c13('0xc')](_0x6c13('0xd'),auth[_0x6c13('0x4')](),controller[_0x6c13('0xe')]);router[_0x6c13('0xf')](_0x6c13('0xd'),auth['isAuthenticated'](),controller[_0x6c13('0x10')]);module[_0x6c13('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 97d90b3..72160d6 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 _0x3739=['sequelize','exports','STRING','name'];(function(_0x478d72,_0x2d6b7a){var _0x5ef7cf=function(_0x199aea){while(--_0x199aea){_0x478d72['push'](_0x478d72['shift']());}};_0x5ef7cf(++_0x2d6b7a);}(_0x3739,0xf0));var _0x9373=function(_0x2872bd,_0x2ea2ca){_0x2872bd=_0x2872bd-0x0;var _0x5af7cb=_0x3739[_0x2872bd];return _0x5af7cb;};'use strict';var Sequelize=require(_0x9373('0x0'));module[_0x9373('0x1')]={'name':{'type':Sequelize[_0x9373('0x2')],'unique':_0x9373('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x9373('0x2')]},'description':{'type':Sequelize[_0x9373('0x2')]}}; \ No newline at end of file +var _0x1fa3=['STRING','sequelize','exports'];(function(_0x31c8b4,_0x515625){var _0x17997a=function(_0x4b760e){while(--_0x4b760e){_0x31c8b4['push'](_0x31c8b4['shift']());}};_0x17997a(++_0x515625);}(_0x1fa3,0x127));var _0x31fa=function(_0x303bce,_0x99ed79){_0x303bce=_0x303bce-0x0;var _0x5d70bf=_0x1fa3[_0x303bce];return _0x5d70bf;};'use strict';var Sequelize=require(_0x31fa('0x0'));module[_0x31fa('0x1')]={'name':{'type':Sequelize[_0x31fa('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x31fa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index db7fbeb..03f8d36 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 _0x1904=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','update','then','destroy','get','ODBC','UserProfileResource','name','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0x1904,0x18b));var _0x4190=function(_0x485527,_0x5f0b95){_0x485527=_0x485527-0x0;var _0x2ac334=_0x1904[_0x485527];return _0x2ac334;};'use strict';var emlformat=require(_0x4190('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4190('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4190('0x2'));var moment=require(_0x4190('0x3'));var BPromise=require(_0x4190('0x4'));var Mustache=require(_0x4190('0x5'));var util=require(_0x4190('0x6'));var path=require(_0x4190('0x7'));var sox=require(_0x4190('0x8'));var csv=require('to-csv');var ejs=require(_0x4190('0x9'));var fs=require('fs');var fs_extra=require(_0x4190('0xa'));var _=require(_0x4190('0xb'));var squel=require(_0x4190('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4190('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4190('0xe'));var Papa=require(_0x4190('0xf'));var Redis=require(_0x4190('0x10'));var authService=require(_0x4190('0x11'));var qs=require(_0x4190('0x12'));var as=require(_0x4190('0x13'));var hardwareService=require(_0x4190('0x14'));var logger=require(_0x4190('0x15'))(_0x4190('0x16'));var utils=require('../../config/utils');var config=require(_0x4190('0x17'));var licenseUtil=require(_0x4190('0x18'));var db=require(_0x4190('0x19'))['db'];function respondWithStatusCode(_0x2e7cf8,_0x4e2649){_0x4e2649=_0x4e2649||0xcc;return function(_0x396740){if(_0x396740){return _0x2e7cf8[_0x4190('0x1a')](_0x4e2649);}return _0x2e7cf8['status'](_0x4e2649)[_0x4190('0x1b')]();};}function respondWithResult(_0x1447ec,_0x10b4e8){_0x10b4e8=_0x10b4e8||0xc8;return function(_0x5851a5){if(_0x5851a5){return _0x1447ec['status'](_0x10b4e8)[_0x4190('0x1c')](_0x5851a5);}};}function respondWithFilteredResult(_0x23e2f3,_0x25be15){return function(_0x28faef){if(_0x28faef){var _0x46d57b=typeof _0x25be15[_0x4190('0x1d')]==='undefined'&&typeof _0x25be15['limit']===_0x4190('0x1e');var _0x2dd3bc=_0x28faef[_0x4190('0x1f')];var _0x1b7ca9=_0x46d57b?0x0:_0x25be15[_0x4190('0x1d')];var _0x13dcae=_0x46d57b?_0x28faef[_0x4190('0x1f')]:_0x25be15[_0x4190('0x1d')]+_0x25be15[_0x4190('0x20')];var _0x5693dd;if(_0x13dcae>=_0x2dd3bc){_0x13dcae=_0x2dd3bc;_0x5693dd=0xc8;}else{_0x5693dd=0xce;}_0x23e2f3[_0x4190('0x21')](_0x5693dd);return _0x23e2f3['set'](_0x4190('0x22'),_0x1b7ca9+'-'+_0x13dcae+'/'+_0x2dd3bc)[_0x4190('0x1c')](_0x28faef);}return null;};}function patchUpdates(_0x498f64){return function(_0xdaeb2a){try{jsonpatch['apply'](_0xdaeb2a,_0x498f64,!![]);}catch(_0x171f10){return BPromise['reject'](_0x171f10);}return _0xdaeb2a['save']();};}function saveUpdates(_0x817345,_0x31f052){return function(_0x4b3de3){if(_0x4b3de3){return _0x4b3de3[_0x4190('0x23')](_0x817345)[_0x4190('0x24')](function(_0x3f4235){return _0x3f4235;});}return null;};}function removeEntity(_0x4a76d2,_0x5cbd8d){return function(_0x150248){if(_0x150248){return _0x150248[_0x4190('0x25')]()[_0x4190('0x24')](function(){var _0x1975ed=_0x150248[_0x4190('0x26')]({'plain':!![]});var _0x45e1a4=_0x4190('0x27');return db[_0x4190('0x28')][_0x4190('0x25')]({'where':{'type':_0x45e1a4,'resourceId':_0x1975ed['id']}})[_0x4190('0x24')](function(){return _0x150248;});})[_0x4190('0x24')](function(){_0x4a76d2['status'](0xcc)[_0x4190('0x1b')]();});}};}function handleEntityNotFound(_0x40e33a,_0x3413d7){return function(_0x8bcc00){if(!_0x8bcc00){_0x40e33a['sendStatus'](0x194);}return _0x8bcc00;};}function handleError(_0x37fdc6,_0x441d4b){_0x441d4b=_0x441d4b||0x1f4;return function(_0x41e355){logger['error'](_0x41e355['stack']);if(_0x41e355[_0x4190('0x29')]){delete _0x41e355['name'];}_0x37fdc6['status'](_0x441d4b)['send'](_0x41e355);};}exports['index']=function(_0x4da88a,_0x1ead55){var _0x3654d6={},_0x47f131={},_0xb64a8f={'count':0x0,'rows':[]};var _0x2b24ad=_[_0x4190('0x2a')](db['SquareOdbc'][_0x4190('0x2b')],function(_0x2fb159){return{'name':_0x2fb159[_0x4190('0x2c')],'type':_0x2fb159['type']['key']};});_0x47f131[_0x4190('0x2d')]=_[_0x4190('0x2a')](_0x2b24ad,'name');_0x47f131[_0x4190('0x2e')]=_['keys'](_0x4da88a[_0x4190('0x2e')]);_0x47f131['filters']=_[_0x4190('0x2f')](_0x47f131['model'],_0x47f131[_0x4190('0x2e')]);_0x3654d6[_0x4190('0x30')]=_[_0x4190('0x2f')](_0x47f131[_0x4190('0x2d')],qs[_0x4190('0x31')](_0x4da88a[_0x4190('0x2e')][_0x4190('0x31')]));_0x3654d6[_0x4190('0x30')]=_0x3654d6['attributes'][_0x4190('0x32')]?_0x3654d6[_0x4190('0x30')]:_0x47f131[_0x4190('0x2d')];if(!_0x4da88a[_0x4190('0x2e')][_0x4190('0x33')](_0x4190('0x34'))){_0x3654d6[_0x4190('0x20')]=qs[_0x4190('0x20')](_0x4da88a['query'][_0x4190('0x20')]);_0x3654d6[_0x4190('0x1d')]=qs['offset'](_0x4da88a[_0x4190('0x2e')][_0x4190('0x1d')]);}_0x3654d6[_0x4190('0x35')]=qs['sort'](_0x4da88a[_0x4190('0x2e')]['sort']);_0x3654d6[_0x4190('0x36')]=qs[_0x4190('0x37')](_['pick'](_0x4da88a[_0x4190('0x2e')],_0x47f131[_0x4190('0x37')]),_0x2b24ad);if(_0x4da88a['query'][_0x4190('0x38')]){_0x3654d6['where']=_[_0x4190('0x39')](_0x3654d6['where'],{'$or':_['map'](_0x2b24ad,function(_0x555412){if(_0x555412[_0x4190('0x3a')]!==_0x4190('0x3b')){var _0x5e7407={};_0x5e7407[_0x555412[_0x4190('0x29')]]={'$like':'%'+_0x4da88a[_0x4190('0x2e')][_0x4190('0x38')]+'%'};return _0x5e7407;}})});}_0x3654d6=_[_0x4190('0x39')]({},_0x3654d6,_0x4da88a[_0x4190('0x3c')]);var _0x2b2476={'where':_0x3654d6[_0x4190('0x36')]};return db[_0x4190('0x3d')][_0x4190('0x1f')](_0x2b2476)[_0x4190('0x24')](function(_0x4e10fe){_0xb64a8f[_0x4190('0x1f')]=_0x4e10fe;if(_0x4da88a[_0x4190('0x2e')][_0x4190('0x3e')]){_0x3654d6[_0x4190('0x3f')]=[{'all':!![]}];}return db[_0x4190('0x3d')][_0x4190('0x40')](_0x3654d6);})[_0x4190('0x24')](function(_0x137c6a){_0xb64a8f['rows']=_0x137c6a;return _0xb64a8f;})[_0x4190('0x24')](respondWithFilteredResult(_0x1ead55,_0x3654d6))[_0x4190('0x41')](handleError(_0x1ead55,null));};exports[_0x4190('0x42')]=function(_0x5150c1,_0x153209){var _0x2ef646={'raw':!![],'where':{'id':_0x5150c1['params']['id']}},_0x36fa3c={};_0x36fa3c[_0x4190('0x2d')]=_[_0x4190('0x43')](db[_0x4190('0x3d')][_0x4190('0x2b')]);_0x36fa3c[_0x4190('0x2e')]=_[_0x4190('0x43')](_0x5150c1[_0x4190('0x2e')]);_0x36fa3c[_0x4190('0x37')]=_[_0x4190('0x2f')](_0x36fa3c[_0x4190('0x2d')],_0x36fa3c[_0x4190('0x2e')]);_0x2ef646[_0x4190('0x30')]=_[_0x4190('0x2f')](_0x36fa3c[_0x4190('0x2d')],qs[_0x4190('0x31')](_0x5150c1[_0x4190('0x2e')]['fields']));_0x2ef646[_0x4190('0x30')]=_0x2ef646['attributes'][_0x4190('0x32')]?_0x2ef646[_0x4190('0x30')]:_0x36fa3c[_0x4190('0x2d')];if(_0x5150c1['query'][_0x4190('0x3e')]){_0x2ef646[_0x4190('0x3f')]=[{'all':!![]}];}_0x2ef646=_['merge']({},_0x2ef646,_0x5150c1['options']);return db[_0x4190('0x3d')][_0x4190('0x44')](_0x2ef646)[_0x4190('0x24')](handleEntityNotFound(_0x153209,null))[_0x4190('0x24')](respondWithResult(_0x153209,null))[_0x4190('0x41')](handleError(_0x153209,null));};exports[_0x4190('0x45')]=function(_0x16673a,_0x59c592){return db[_0x4190('0x3d')]['create'](_0x16673a[_0x4190('0x46')],{})['then'](function(_0x54d041){var _0x4b9f2d=_0x16673a[_0x4190('0x47')][_0x4190('0x26')]({'plain':!![]});if(!_0x4b9f2d)throw new Error(_0x4190('0x48'));if(_0x4b9f2d[_0x4190('0x49')]===_0x4190('0x47')){var _0x45b639=_0x54d041[_0x4190('0x26')]({'plain':!![]});var _0x48bd33=_0x4190('0x27');return db[_0x4190('0x4a')]['find']({'where':{'name':_0x48bd33,'userProfileId':_0x4b9f2d[_0x4190('0x4b')]},'raw':!![]})[_0x4190('0x24')](function(_0x4971ac){if(_0x4971ac&&_0x4971ac['autoAssociation']===0x0){return db[_0x4190('0x28')]['create']({'name':_0x45b639['name'],'resourceId':_0x45b639['id'],'type':_0x4971ac['name'],'sectionId':_0x4971ac['id']},{})[_0x4190('0x24')](function(){return _0x54d041;});}else{return _0x54d041;}})[_0x4190('0x41')](function(_0x3e07a9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e07a9);throw _0x3e07a9;});}return _0x54d041;})[_0x4190('0x24')](respondWithResult(_0x59c592,0xc9))[_0x4190('0x41')](handleError(_0x59c592,null));};exports[_0x4190('0x23')]=function(_0x22b56d,_0x1906b2){if(_0x22b56d[_0x4190('0x46')]['id']){delete _0x22b56d[_0x4190('0x46')]['id'];}return db[_0x4190('0x3d')][_0x4190('0x44')]({'where':{'id':_0x22b56d[_0x4190('0x4c')]['id']}})[_0x4190('0x24')](handleEntityNotFound(_0x1906b2,null))[_0x4190('0x24')](saveUpdates(_0x22b56d[_0x4190('0x46')],null))['then'](respondWithResult(_0x1906b2,null))[_0x4190('0x41')](handleError(_0x1906b2,null));};exports['destroy']=function(_0xeeed8e,_0x42ec06){return db[_0x4190('0x3d')][_0x4190('0x44')]({'where':{'id':_0xeeed8e['params']['id']}})[_0x4190('0x24')](handleEntityNotFound(_0x42ec06,null))['then'](removeEntity(_0x42ec06,null))[_0x4190('0x41')](handleError(_0x42ec06,null));};exports[_0x4190('0x4d')]=function(_0x112a72,_0x41bfc9,_0x49f022){var _0x2f29d3;return db[_0x4190('0x3d')][_0x4190('0x44')]({'where':{'id':_0x112a72[_0x4190('0x4c')]['id']},'attributes':['id',_0x4190('0x4e')]})[_0x4190('0x24')](handleEntityNotFound(_0x41bfc9,null))[_0x4190('0x24')](function(_0x36af2e){if(_0x36af2e){var _0xea1ec5=require(_0x4190('0x4f'))();_0xea1ec5[_0x4190('0x50')](_0x36af2e[_0x4190('0x4e')]);_0xea1ec5[_0x4190('0x51')]();return _0x36af2e;}})[_0x4190('0x24')](respondWithResult(_0x41bfc9,null))[_0x4190('0x41')](handleError(_0x41bfc9,null));}; \ No newline at end of file +var _0xf579=['destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','openSync','closeSync','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','ODBC','UserProfileResource'];(function(_0xccdde3,_0x4786bb){var _0x3e3a29=function(_0x4e9bc2){while(--_0x4e9bc2){_0xccdde3['push'](_0xccdde3['shift']());}};_0x3e3a29(++_0x4786bb);}(_0xf579,0x84));var _0x9f57=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf579[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f57('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f57('0x1'));var moment=require(_0x9f57('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9f57('0x3'));var util=require(_0x9f57('0x4'));var path=require(_0x9f57('0x5'));var sox=require(_0x9f57('0x6'));var csv=require(_0x9f57('0x7'));var ejs=require(_0x9f57('0x8'));var fs=require('fs');var fs_extra=require(_0x9f57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f57('0xa'));var jsforce=require(_0x9f57('0xb'));var deskjs=require(_0x9f57('0xc'));var toCsv=require(_0x9f57('0x7'));var querystring=require('querystring');var Papa=require(_0x9f57('0xd'));var Redis=require(_0x9f57('0xe'));var authService=require(_0x9f57('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9f57('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f57('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9f57('0x12'));var licenseUtil=require(_0x9f57('0x13'));var db=require(_0x9f57('0x14'))['db'];function respondWithStatusCode(_0x6d99ef,_0x889271){_0x889271=_0x889271||0xcc;return function(_0x4dbc75){if(_0x4dbc75){return _0x6d99ef[_0x9f57('0x15')](_0x889271);}return _0x6d99ef[_0x9f57('0x16')](_0x889271)['end']();};}function respondWithResult(_0x171b2e,_0x520f99){_0x520f99=_0x520f99||0xc8;return function(_0x36d1fb){if(_0x36d1fb){return _0x171b2e['status'](_0x520f99)[_0x9f57('0x17')](_0x36d1fb);}};}function respondWithFilteredResult(_0x5d0b60,_0x447a53){return function(_0x473805){if(_0x473805){var _0x4555b6=typeof _0x447a53[_0x9f57('0x18')]===_0x9f57('0x19')&&typeof _0x447a53[_0x9f57('0x1a')]===_0x9f57('0x19');var _0x1147df=_0x473805[_0x9f57('0x1b')];var _0x3505ba=_0x4555b6?0x0:_0x447a53[_0x9f57('0x18')];var _0x336b5e=_0x4555b6?_0x473805[_0x9f57('0x1b')]:_0x447a53[_0x9f57('0x18')]+_0x447a53[_0x9f57('0x1a')];var _0x24cc05;if(_0x336b5e>=_0x1147df){_0x336b5e=_0x1147df;_0x24cc05=0xc8;}else{_0x24cc05=0xce;}_0x5d0b60[_0x9f57('0x16')](_0x24cc05);return _0x5d0b60['set'](_0x9f57('0x1c'),_0x3505ba+'-'+_0x336b5e+'/'+_0x1147df)[_0x9f57('0x17')](_0x473805);}return null;};}function patchUpdates(_0x171db3){return function(_0x57bc0d){try{jsonpatch[_0x9f57('0x1d')](_0x57bc0d,_0x171db3,!![]);}catch(_0x7ff4b9){return BPromise[_0x9f57('0x1e')](_0x7ff4b9);}return _0x57bc0d['save']();};}function saveUpdates(_0x2f709f,_0x432bf6){return function(_0x2e14f5){if(_0x2e14f5){return _0x2e14f5['update'](_0x2f709f)[_0x9f57('0x1f')](function(_0x1bb57b){return _0x1bb57b;});}return null;};}function removeEntity(_0x1e3a13,_0x4853ef){return function(_0x5e5f85){if(_0x5e5f85){return _0x5e5f85['destroy']()['then'](function(){var _0x4befb6=_0x5e5f85['get']({'plain':!![]});var _0x25661b=_0x9f57('0x20');return db[_0x9f57('0x21')][_0x9f57('0x22')]({'where':{'type':_0x25661b,'resourceId':_0x4befb6['id']}})[_0x9f57('0x1f')](function(){return _0x5e5f85;});})[_0x9f57('0x1f')](function(){_0x1e3a13['status'](0xcc)[_0x9f57('0x23')]();});}};}function handleEntityNotFound(_0x2d7fb8,_0x61a1b6){return function(_0x4d56e4){if(!_0x4d56e4){_0x2d7fb8[_0x9f57('0x15')](0x194);}return _0x4d56e4;};}function handleError(_0x2bf897,_0x403c06){_0x403c06=_0x403c06||0x1f4;return function(_0x53db9f){logger[_0x9f57('0x24')](_0x53db9f['stack']);if(_0x53db9f[_0x9f57('0x25')]){delete _0x53db9f[_0x9f57('0x25')];}_0x2bf897[_0x9f57('0x16')](_0x403c06)[_0x9f57('0x26')](_0x53db9f);};}exports[_0x9f57('0x27')]=function(_0x1cfc9e,_0x5c0b30){var _0x97ae5e={},_0x37c9b5={},_0x1ea666={'count':0x0,'rows':[]};var _0x5c5616=_[_0x9f57('0x28')](db['SquareOdbc'][_0x9f57('0x29')],function(_0x28f721){return{'name':_0x28f721[_0x9f57('0x2a')],'type':_0x28f721[_0x9f57('0x2b')][_0x9f57('0x2c')]};});_0x37c9b5['model']=_[_0x9f57('0x28')](_0x5c5616,_0x9f57('0x25'));_0x37c9b5[_0x9f57('0x2d')]=_[_0x9f57('0x2e')](_0x1cfc9e[_0x9f57('0x2d')]);_0x37c9b5[_0x9f57('0x2f')]=_[_0x9f57('0x30')](_0x37c9b5['model'],_0x37c9b5['query']);_0x97ae5e[_0x9f57('0x31')]=_[_0x9f57('0x30')](_0x37c9b5[_0x9f57('0x32')],qs[_0x9f57('0x33')](_0x1cfc9e[_0x9f57('0x2d')]['fields']));_0x97ae5e[_0x9f57('0x31')]=_0x97ae5e[_0x9f57('0x31')]['length']?_0x97ae5e[_0x9f57('0x31')]:_0x37c9b5[_0x9f57('0x32')];if(!_0x1cfc9e[_0x9f57('0x2d')][_0x9f57('0x34')]('nolimit')){_0x97ae5e[_0x9f57('0x1a')]=qs[_0x9f57('0x1a')](_0x1cfc9e[_0x9f57('0x2d')][_0x9f57('0x1a')]);_0x97ae5e[_0x9f57('0x18')]=qs[_0x9f57('0x18')](_0x1cfc9e[_0x9f57('0x2d')][_0x9f57('0x18')]);}_0x97ae5e[_0x9f57('0x35')]=qs[_0x9f57('0x36')](_0x1cfc9e[_0x9f57('0x2d')][_0x9f57('0x36')]);_0x97ae5e['where']=qs['filters'](_[_0x9f57('0x37')](_0x1cfc9e[_0x9f57('0x2d')],_0x37c9b5[_0x9f57('0x2f')]),_0x5c5616);if(_0x1cfc9e[_0x9f57('0x2d')][_0x9f57('0x38')]){_0x97ae5e[_0x9f57('0x39')]=_[_0x9f57('0x3a')](_0x97ae5e[_0x9f57('0x39')],{'$or':_[_0x9f57('0x28')](_0x5c5616,function(_0x3700b3){if(_0x3700b3[_0x9f57('0x2b')]!==_0x9f57('0x3b')){var _0x5a184d={};_0x5a184d[_0x3700b3[_0x9f57('0x25')]]={'$like':'%'+_0x1cfc9e['query'][_0x9f57('0x38')]+'%'};return _0x5a184d;}})});}_0x97ae5e=_[_0x9f57('0x3a')]({},_0x97ae5e,_0x1cfc9e[_0x9f57('0x3c')]);var _0x4b67ec={'where':_0x97ae5e[_0x9f57('0x39')]};return db[_0x9f57('0x3d')][_0x9f57('0x1b')](_0x4b67ec)[_0x9f57('0x1f')](function(_0x16db08){_0x1ea666[_0x9f57('0x1b')]=_0x16db08;if(_0x1cfc9e[_0x9f57('0x2d')][_0x9f57('0x3e')]){_0x97ae5e[_0x9f57('0x3f')]=[{'all':!![]}];}return db[_0x9f57('0x3d')][_0x9f57('0x40')](_0x97ae5e);})[_0x9f57('0x1f')](function(_0x722890){_0x1ea666[_0x9f57('0x41')]=_0x722890;return _0x1ea666;})[_0x9f57('0x1f')](respondWithFilteredResult(_0x5c0b30,_0x97ae5e))['catch'](handleError(_0x5c0b30,null));};exports['show']=function(_0x463c56,_0x3e7142){var _0x2287d2={'raw':!![],'where':{'id':_0x463c56[_0x9f57('0x42')]['id']}},_0xee2923={};_0xee2923[_0x9f57('0x32')]=_[_0x9f57('0x2e')](db[_0x9f57('0x3d')]['rawAttributes']);_0xee2923[_0x9f57('0x2d')]=_[_0x9f57('0x2e')](_0x463c56[_0x9f57('0x2d')]);_0xee2923[_0x9f57('0x2f')]=_['intersection'](_0xee2923[_0x9f57('0x32')],_0xee2923[_0x9f57('0x2d')]);_0x2287d2[_0x9f57('0x31')]=_[_0x9f57('0x30')](_0xee2923[_0x9f57('0x32')],qs[_0x9f57('0x33')](_0x463c56['query'][_0x9f57('0x33')]));_0x2287d2['attributes']=_0x2287d2[_0x9f57('0x31')]['length']?_0x2287d2['attributes']:_0xee2923[_0x9f57('0x32')];if(_0x463c56['query'][_0x9f57('0x3e')]){_0x2287d2[_0x9f57('0x3f')]=[{'all':!![]}];}_0x2287d2=_[_0x9f57('0x3a')]({},_0x2287d2,_0x463c56[_0x9f57('0x3c')]);return db['SquareOdbc'][_0x9f57('0x43')](_0x2287d2)['then'](handleEntityNotFound(_0x3e7142,null))[_0x9f57('0x1f')](respondWithResult(_0x3e7142,null))[_0x9f57('0x44')](handleError(_0x3e7142,null));};exports[_0x9f57('0x45')]=function(_0x22d53f,_0x4bc47b){return db[_0x9f57('0x3d')][_0x9f57('0x45')](_0x22d53f[_0x9f57('0x46')],{})[_0x9f57('0x1f')](function(_0x4a4364){var _0x1a4d8e=_0x22d53f['user']['get']({'plain':!![]});if(!_0x1a4d8e)throw new Error(_0x9f57('0x47'));if(_0x1a4d8e[_0x9f57('0x48')]===_0x9f57('0x49')){var _0x4c7044=_0x4a4364[_0x9f57('0x4a')]({'plain':!![]});var _0x3ee5b4=_0x9f57('0x20');return db[_0x9f57('0x4b')][_0x9f57('0x43')]({'where':{'name':_0x3ee5b4,'userProfileId':_0x1a4d8e[_0x9f57('0x4c')]},'raw':!![]})[_0x9f57('0x1f')](function(_0x383aa2){if(_0x383aa2&&_0x383aa2['autoAssociation']===0x0){return db[_0x9f57('0x21')][_0x9f57('0x45')]({'name':_0x4c7044[_0x9f57('0x25')],'resourceId':_0x4c7044['id'],'type':_0x383aa2[_0x9f57('0x25')],'sectionId':_0x383aa2['id']},{})['then'](function(){return _0x4a4364;});}else{return _0x4a4364;}})[_0x9f57('0x44')](function(_0x3bd93d){logger[_0x9f57('0x24')](_0x9f57('0x4d'),_0x3bd93d);throw _0x3bd93d;});}return _0x4a4364;})[_0x9f57('0x1f')](respondWithResult(_0x4bc47b,0xc9))[_0x9f57('0x44')](handleError(_0x4bc47b,null));};exports[_0x9f57('0x4e')]=function(_0x223351,_0x1af47a){if(_0x223351[_0x9f57('0x46')]['id']){delete _0x223351[_0x9f57('0x46')]['id'];}return db[_0x9f57('0x3d')]['find']({'where':{'id':_0x223351['params']['id']}})[_0x9f57('0x1f')](handleEntityNotFound(_0x1af47a,null))[_0x9f57('0x1f')](saveUpdates(_0x223351['body'],null))[_0x9f57('0x1f')](respondWithResult(_0x1af47a,null))[_0x9f57('0x44')](handleError(_0x1af47a,null));};exports['destroy']=function(_0x2dedd2,_0x5d1b83){return db['SquareOdbc'][_0x9f57('0x43')]({'where':{'id':_0x2dedd2[_0x9f57('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d1b83,null))[_0x9f57('0x1f')](removeEntity(_0x5d1b83,null))[_0x9f57('0x44')](handleError(_0x5d1b83,null));};exports[_0x9f57('0x4f')]=function(_0x588cee,_0x5d9ffd,_0x1b3f66){var _0x2883dc;return db[_0x9f57('0x3d')][_0x9f57('0x43')]({'where':{'id':_0x588cee[_0x9f57('0x42')]['id']},'attributes':['id',_0x9f57('0x50')]})[_0x9f57('0x1f')](handleEntityNotFound(_0x5d9ffd,null))[_0x9f57('0x1f')](function(_0x3c72ac){if(_0x3c72ac){var _0x3c68c6=require('odbc')();_0x3c68c6[_0x9f57('0x51')](_0x3c72ac[_0x9f57('0x50')]);_0x3c68c6[_0x9f57('0x52')]();return _0x3c72ac;}})[_0x9f57('0x1f')](respondWithResult(_0x5d9ffd,null))[_0x9f57('0x44')](handleError(_0x5d9ffd,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9aa60bb..2b811c3 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 _0x2a40=['exports','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes'];(function(_0x5903c9,_0x406773){var _0x40c65c=function(_0x5038bb){while(--_0x5038bb){_0x5903c9['push'](_0x5903c9['shift']());}};_0x40c65c(++_0x406773);}(_0x2a40,0x17c));var _0x02a4=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0x2a40[_0x322bef];return _0x229e60;};'use strict';var _=require(_0x02a4('0x0'));var util=require(_0x02a4('0x1'));var logger=require(_0x02a4('0x2'))(_0x02a4('0x3'));var moment=require(_0x02a4('0x4'));var BPromise=require(_0x02a4('0x5'));var rp=require(_0x02a4('0x6'));var fs=require('fs');var path=require(_0x02a4('0x7'));var rimraf=require(_0x02a4('0x8'));var config=require('../../config/environment');var attributes=require(_0x02a4('0x9'));module[_0x02a4('0xa')]=function(_0xf0c904,_0x2fd65e){return _0xf0c904[_0x02a4('0xb')]('SquareOdbc',attributes,{'tableName':_0x02a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac6e=['define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xac6e,0x10d));var _0xeac6=function(_0x21e109,_0x539982){_0x21e109=_0x21e109-0x0;var _0x25f285=_0xac6e[_0x21e109];return _0x25f285;};'use strict';var _=require(_0xeac6('0x0'));var util=require(_0xeac6('0x1'));var logger=require(_0xeac6('0x2'))(_0xeac6('0x3'));var moment=require(_0xeac6('0x4'));var BPromise=require(_0xeac6('0x5'));var rp=require(_0xeac6('0x6'));var fs=require('fs');var path=require(_0xeac6('0x7'));var rimraf=require('rimraf');var config=require(_0xeac6('0x8'));var attributes=require(_0xeac6('0x9'));module[_0xeac6('0xa')]=function(_0x18e57d,_0x3ff0ef){return _0x18e57d[_0xeac6('0xb')](_0xeac6('0xc'),attributes,{'tableName':_0xeac6('0xd'),'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 5e434f0..1c13d24 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 _0xa8f2=['rpc','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf0ad7d,_0x13b558){var _0x152ea9=function(_0x3b0bda){while(--_0x3b0bda){_0xf0ad7d['push'](_0xf0ad7d['shift']());}};_0x152ea9(++_0x13b558);}(_0xa8f2,0xe5));var _0x2a8f=function(_0x505d3b,_0x1da651){_0x505d3b=_0x505d3b-0x0;var _0x254603=_0xa8f2[_0x505d3b];return _0x254603;};'use strict';var _=require(_0x2a8f('0x0'));var util=require(_0x2a8f('0x1'));var moment=require(_0x2a8f('0x2'));var BPromise=require(_0x2a8f('0x3'));var rs=require(_0x2a8f('0x4'));var fs=require('fs');var Redis=require(_0x2a8f('0x5'));var db=require(_0x2a8f('0x6'))['db'];var utils=require(_0x2a8f('0x7'));var logger=require(_0x2a8f('0x8'))(_0x2a8f('0x9'));var config=require('../../config/environment');var jayson=require(_0x2a8f('0xa'));var client=jayson[_0x2a8f('0xb')][_0x2a8f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe78dfd,_0x56e945,_0x273f27){return new BPromise(function(_0x317fde,_0x549d57){return client['request'](_0xe78dfd,_0x273f27)[_0x2a8f('0xd')](function(_0x213a70){logger[_0x2a8f('0xe')](_0x2a8f('0xf'),_0x56e945,_0x2a8f('0x10'));logger['debug'](_0x2a8f('0x11'),_0x56e945,_0x2a8f('0x10'),JSON[_0x2a8f('0x12')](_0x213a70));if(_0x213a70['error']){if(_0x213a70[_0x2a8f('0x13')][_0x2a8f('0x14')]===0x1f4){logger[_0x2a8f('0x13')](_0x2a8f('0xf'),_0x56e945,_0x213a70[_0x2a8f('0x13')][_0x2a8f('0x15')]);return _0x549d57(_0x213a70[_0x2a8f('0x13')]['message']);}logger[_0x2a8f('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x56e945,_0x213a70['error'][_0x2a8f('0x15')]);return _0x317fde(_0x213a70['error']['message']);}else{logger['info'](_0x2a8f('0xf'),_0x56e945,_0x2a8f('0x10'));_0x317fde(_0x213a70[_0x2a8f('0x16')][_0x2a8f('0x15')]);}})[_0x2a8f('0x17')](function(_0x58fcf7){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x56e945,_0x58fcf7);_0x549d57(_0x58fcf7);});});}exports[_0x2a8f('0x18')]=function(_0x257a43){var _0x21412c=this;return new Promise(function(_0x218291,_0x378eea){return db[_0x2a8f('0x19')]['find']({'raw':_0x257a43[_0x2a8f('0x1a')]?_0x257a43['options'][_0x2a8f('0x1b')]===undefined?!![]:![]:!![],'where':_0x257a43[_0x2a8f('0x1a')]?_0x257a43[_0x2a8f('0x1a')][_0x2a8f('0x1c')]||null:null,'attributes':_0x257a43[_0x2a8f('0x1a')]?_0x257a43['options'][_0x2a8f('0x1d')]||null:null,'include':_0x257a43[_0x2a8f('0x1a')]?_0x257a43[_0x2a8f('0x1a')]['include']?_['map'](_0x257a43[_0x2a8f('0x1a')][_0x2a8f('0x1e')],function(_0x589204){return{'model':db[_0x589204[_0x2a8f('0x1f')]],'as':_0x589204['as'],'attributes':_0x589204[_0x2a8f('0x1d')],'include':_0x589204[_0x2a8f('0x1e')]?_['map'](_0x589204[_0x2a8f('0x1e')],function(_0x1d2666){return{'model':db[_0x1d2666[_0x2a8f('0x1f')]],'as':_0x1d2666['as'],'attributes':_0x1d2666[_0x2a8f('0x1d')],'include':_0x1d2666[_0x2a8f('0x1e')]?_[_0x2a8f('0x20')](_0x1d2666[_0x2a8f('0x1e')],function(_0x3fc22d){return{'model':db[_0x3fc22d[_0x2a8f('0x1f')]],'as':_0x3fc22d['as'],'attributes':_0x3fc22d[_0x2a8f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2155a9){logger[_0x2a8f('0xe')]('ShowSquareOdbc',_0x257a43);logger[_0x2a8f('0x21')](_0x2a8f('0x18'),_0x257a43,JSON[_0x2a8f('0x12')](_0x2155a9));_0x218291(_0x2155a9);})[_0x2a8f('0x17')](function(_0x346794){logger[_0x2a8f('0x13')]('ShowSquareOdbc',_0x346794['message'],_0x257a43);_0x378eea(_0x21412c[_0x2a8f('0x13')](0x1f4,_0x346794['message']));});});}; \ No newline at end of file +var _0x25ac=['stringify','error','code','message','catch','ShowSquareOdbc','find','options','raw','where','attributes','map','include','model','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x30156e,_0x4f5e62){var _0x3fdd6d=function(_0x2bf853){while(--_0x2bf853){_0x30156e['push'](_0x30156e['shift']());}};_0x3fdd6d(++_0x4f5e62);}(_0x25ac,0x14f));var _0xc25a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc25a('0x0'));var BPromise=require(_0xc25a('0x1'));var rs=require(_0xc25a('0x2'));var fs=require('fs');var Redis=require(_0xc25a('0x3'));var db=require(_0xc25a('0x4'))['db'];var utils=require(_0xc25a('0x5'));var logger=require('../../config/logger')(_0xc25a('0x6'));var config=require(_0xc25a('0x7'));var jayson=require(_0xc25a('0x8'));var client=jayson[_0xc25a('0x9')][_0xc25a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bbb97,_0x24c11f,_0x1445d1){return new BPromise(function(_0x9c6755,_0x456b6d){return client[_0xc25a('0xb')](_0x4bbb97,_0x1445d1)['then'](function(_0x496661){logger[_0xc25a('0xc')](_0xc25a('0xd'),_0x24c11f,_0xc25a('0xe'));logger[_0xc25a('0xf')](_0xc25a('0x10'),_0x24c11f,_0xc25a('0xe'),JSON[_0xc25a('0x11')](_0x496661));if(_0x496661[_0xc25a('0x12')]){if(_0x496661[_0xc25a('0x12')][_0xc25a('0x13')]===0x1f4){logger[_0xc25a('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x24c11f,_0x496661[_0xc25a('0x12')][_0xc25a('0x14')]);return _0x456b6d(_0x496661[_0xc25a('0x12')]['message']);}logger[_0xc25a('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x24c11f,_0x496661[_0xc25a('0x12')][_0xc25a('0x14')]);return _0x9c6755(_0x496661[_0xc25a('0x12')]['message']);}else{logger['info'](_0xc25a('0xd'),_0x24c11f,_0xc25a('0xe'));_0x9c6755(_0x496661['result'][_0xc25a('0x14')]);}})[_0xc25a('0x15')](function(_0x5a4037){logger[_0xc25a('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x24c11f,_0x5a4037);_0x456b6d(_0x5a4037);});});}exports[_0xc25a('0x16')]=function(_0x516e7c){var _0x2f370b=this;return new Promise(function(_0x157a92,_0x2fdbe9){return db['SquareOdbc'][_0xc25a('0x17')]({'raw':_0x516e7c['options']?_0x516e7c[_0xc25a('0x18')][_0xc25a('0x19')]===undefined?!![]:![]:!![],'where':_0x516e7c[_0xc25a('0x18')]?_0x516e7c[_0xc25a('0x18')][_0xc25a('0x1a')]||null:null,'attributes':_0x516e7c['options']?_0x516e7c[_0xc25a('0x18')][_0xc25a('0x1b')]||null:null,'include':_0x516e7c[_0xc25a('0x18')]?_0x516e7c[_0xc25a('0x18')]['include']?_[_0xc25a('0x1c')](_0x516e7c[_0xc25a('0x18')][_0xc25a('0x1d')],function(_0x427ee7){return{'model':db[_0x427ee7[_0xc25a('0x1e')]],'as':_0x427ee7['as'],'attributes':_0x427ee7['attributes'],'include':_0x427ee7[_0xc25a('0x1d')]?_['map'](_0x427ee7[_0xc25a('0x1d')],function(_0x8e9537){return{'model':db[_0x8e9537[_0xc25a('0x1e')]],'as':_0x8e9537['as'],'attributes':_0x8e9537[_0xc25a('0x1b')],'include':_0x8e9537[_0xc25a('0x1d')]?_[_0xc25a('0x1c')](_0x8e9537[_0xc25a('0x1d')],function(_0x1ee45b){return{'model':db[_0x1ee45b['model']],'as':_0x1ee45b['as'],'attributes':_0x1ee45b[_0xc25a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc25a('0x1f')](function(_0x296d0f){logger[_0xc25a('0xc')](_0xc25a('0x16'),_0x516e7c);logger[_0xc25a('0xf')](_0xc25a('0x16'),_0x516e7c,JSON['stringify'](_0x296d0f));_0x157a92(_0x296d0f);})[_0xc25a('0x15')](function(_0x5d943a){logger['error']('ShowSquareOdbc',_0x5d943a[_0xc25a('0x14')],_0x516e7c);_0x2fdbe9(_0x2f370b['error'](0x1f4,_0x5d943a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 28590b3..59a9b9b 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 _0xa329=['./squareProject.controller','get','isAuthenticated','index','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa329,0x162));var _0x9a32=function(_0x33c364,_0xa6c8a0){_0x33c364=_0x33c364-0x0;var _0x87421d=_0xa329[_0x33c364];return _0x87421d;};'use strict';var multer=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var path=require('path');var timeout=require(_0x9a32('0x2'));var express=require('express');var router=express[_0x9a32('0x3')]();var fs_extra=require(_0x9a32('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a32('0x5'));var controller=require(_0x9a32('0x6'));router[_0x9a32('0x7')]('/',auth[_0x9a32('0x8')](),controller[_0x9a32('0x9')]);router[_0x9a32('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9a32('0x7')](_0x9a32('0xa'),auth['isAuthenticated'](),controller[_0x9a32('0xb')]);router[_0x9a32('0xc')]('/',auth[_0x9a32('0x8')](),controller[_0x9a32('0xd')]);router[_0x9a32('0xc')](_0x9a32('0xa'),auth['isAuthenticated'](),controller[_0x9a32('0xe')]);router[_0x9a32('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9a32('0x10')]);router[_0x9a32('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9a32('0x12')]);router[_0x9a32('0x11')](_0x9a32('0xa'),auth[_0x9a32('0x8')](),controller['removeUsers']);module[_0x9a32('0x13')]=router; \ No newline at end of file +var _0xd844=['update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','/:id','get','/:id/users','getUsers','create','post','addUsers','put'];(function(_0x34ef8e,_0x5a9507){var _0x339bf3=function(_0x33cd72){while(--_0x33cd72){_0x34ef8e['push'](_0x34ef8e['shift']());}};_0x339bf3(++_0x5a9507);}(_0xd844,0x6d));var _0x4d84=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd844[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x4d84('0x0'));var util=require(_0x4d84('0x1'));var path=require('path');var timeout=require(_0x4d84('0x2'));var express=require(_0x4d84('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d84('0x4'));var interaction=require(_0x4d84('0x5'));var config=require(_0x4d84('0x6'));var controller=require(_0x4d84('0x7'));router['get']('/',auth[_0x4d84('0x8')](),controller['index']);router['get'](_0x4d84('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4d84('0xa')](_0x4d84('0xb'),auth['isAuthenticated'](),controller[_0x4d84('0xc')]);router['post']('/',auth[_0x4d84('0x8')](),controller[_0x4d84('0xd')]);router[_0x4d84('0xe')]('/:id/users',auth[_0x4d84('0x8')](),controller[_0x4d84('0xf')]);router[_0x4d84('0x10')](_0x4d84('0x9'),auth[_0x4d84('0x8')](),controller[_0x4d84('0x11')]);router[_0x4d84('0x12')](_0x4d84('0x9'),auth[_0x4d84('0x8')](),controller[_0x4d84('0x13')]);router[_0x4d84('0x12')]('/:id/users',auth[_0x4d84('0x8')](),controller['removeUsers']);module[_0x4d84('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 07e03e7..c63e477 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 _0xb098=['BLOB','long','preproduction','toString','utf8','getDataValue','production','DATE','sequelize','exports','STRING','TEXT'];(function(_0x5ac2f4,_0x410a6a){var _0x202c69=function(_0x45e9e6){while(--_0x45e9e6){_0x5ac2f4['push'](_0x5ac2f4['shift']());}};_0x202c69(++_0x410a6a);}(_0xb098,0x1c4));var _0x8b09=function(_0x1502b6,_0x4d1ca3){_0x1502b6=_0x1502b6-0x0;var _0x562e45=_0xb098[_0x1502b6];return _0x562e45;};'use strict';var Sequelize=require(_0x8b09('0x0'));module[_0x8b09('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8b09('0x2')]},'notes':{'type':Sequelize[_0x8b09('0x3')]},'preproduction':{'type':Sequelize[_0x8b09('0x4')](_0x8b09('0x5')),'get':function(){if(this['getDataValue'](_0x8b09('0x6'))){return this['getDataValue'](_0x8b09('0x6'))[_0x8b09('0x7')](_0x8b09('0x8'));}}},'production':{'type':Sequelize[_0x8b09('0x4')](_0x8b09('0x5')),'get':function(){if(this[_0x8b09('0x9')](_0x8b09('0xa'))){return this[_0x8b09('0x9')](_0x8b09('0xa'))[_0x8b09('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8b09('0xb')]},'publishedAt':{'type':Sequelize[_0x8b09('0xb')]}}; \ No newline at end of file +var _0x8124=['utf8','BLOB','production','DATE','sequelize','exports','name','STRING','TEXT','long','preproduction','getDataValue','toString'];(function(_0x499b0f,_0x29e483){var _0x16b348=function(_0x4372d4){while(--_0x4372d4){_0x499b0f['push'](_0x499b0f['shift']());}};_0x16b348(++_0x29e483);}(_0x8124,0x79));var _0x4812=function(_0x559702,_0x2fa1a9){_0x559702=_0x559702-0x0;var _0x25a86b=_0x8124[_0x559702];return _0x25a86b;};'use strict';var Sequelize=require(_0x4812('0x0'));module[_0x4812('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4812('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4812('0x3')]},'notes':{'type':Sequelize[_0x4812('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x4812('0x5')),'get':function(){if(this['getDataValue'](_0x4812('0x6'))){return this[_0x4812('0x7')](_0x4812('0x6'))[_0x4812('0x8')](_0x4812('0x9'));}}},'production':{'type':Sequelize[_0x4812('0xa')](_0x4812('0x5')),'get':function(){if(this[_0x4812('0x7')](_0x4812('0xb'))){return this['getDataValue']('production')[_0x4812('0x8')](_0x4812('0x9'));}}},'savedAt':{'type':Sequelize[_0x4812('0xc')]},'publishedAt':{'type':Sequelize[_0x4812('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index cc9a983..b963ea1 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 _0xbca7=['redis','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','sort','pick','filters','where','VIRTUAL','SquareProject','includeAll','findAll','rows','catch','show','keys','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','User','order','filter','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x35bafb,_0x2b3556){var _0x1db03a=function(_0x599754){while(--_0x599754){_0x35bafb['push'](_0x35bafb['shift']());}};_0x1db03a(++_0x2b3556);}(_0xbca7,0xa4));var _0x7bca=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbca7[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bca('0x0'));var zipdir=require(_0x7bca('0x1'));var jsonpatch=require(_0x7bca('0x2'));var rp=require(_0x7bca('0x3'));var moment=require('moment');var BPromise=require(_0x7bca('0x4'));var Mustache=require(_0x7bca('0x5'));var util=require(_0x7bca('0x6'));var path=require(_0x7bca('0x7'));var sox=require(_0x7bca('0x8'));var csv=require(_0x7bca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bca('0xa'));var _=require('lodash');var squel=require(_0x7bca('0xb'));var crypto=require(_0x7bca('0xc'));var jsforce=require(_0x7bca('0xd'));var deskjs=require(_0x7bca('0xe'));var toCsv=require(_0x7bca('0x9'));var querystring=require(_0x7bca('0xf'));var Papa=require(_0x7bca('0x10'));var Redis=require('ioredis');var authService=require(_0x7bca('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7bca('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bca('0x13'))(_0x7bca('0x14'));var utils=require(_0x7bca('0x15'));var config=require(_0x7bca('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bca('0x17'))['db'];config[_0x7bca('0x18')]=_['defaults'](config['redis'],{'host':_0x7bca('0x19'),'port':0x18eb});var socket=require(_0x7bca('0x1a'))(new Redis(config[_0x7bca('0x18')]));require(_0x7bca('0x1b'))[_0x7bca('0x1c')](socket);function respondWithStatusCode(_0x3e2271,_0x36f2d0){_0x36f2d0=_0x36f2d0||0xcc;return function(_0x26a4bb){if(_0x26a4bb){return _0x3e2271['sendStatus'](_0x36f2d0);}return _0x3e2271[_0x7bca('0x1d')](_0x36f2d0)[_0x7bca('0x1e')]();};}function respondWithResult(_0x10bb8b,_0x3d5238){_0x3d5238=_0x3d5238||0xc8;return function(_0x1f3c29){if(_0x1f3c29){return _0x10bb8b[_0x7bca('0x1d')](_0x3d5238)[_0x7bca('0x1f')](_0x1f3c29);}};}function respondWithFilteredResult(_0x2be6ab,_0x4b4379){return function(_0x4292c9){if(_0x4292c9){var _0x5abb23=typeof _0x4b4379[_0x7bca('0x20')]==='undefined'&&typeof _0x4b4379[_0x7bca('0x21')]==='undefined';var _0x77f875=_0x4292c9['count'];var _0x12ee30=_0x5abb23?0x0:_0x4b4379[_0x7bca('0x20')];var _0x2e9bc0=_0x5abb23?_0x4292c9[_0x7bca('0x22')]:_0x4b4379['offset']+_0x4b4379[_0x7bca('0x21')];var _0x4092c4;if(_0x2e9bc0>=_0x77f875){_0x2e9bc0=_0x77f875;_0x4092c4=0xc8;}else{_0x4092c4=0xce;}_0x2be6ab['status'](_0x4092c4);return _0x2be6ab[_0x7bca('0x23')](_0x7bca('0x24'),_0x12ee30+'-'+_0x2e9bc0+'/'+_0x77f875)[_0x7bca('0x1f')](_0x4292c9);}return null;};}function patchUpdates(_0x1e5757){return function(_0x15175e){try{jsonpatch[_0x7bca('0x25')](_0x15175e,_0x1e5757,!![]);}catch(_0xdf5d6b){return BPromise[_0x7bca('0x26')](_0xdf5d6b);}return _0x15175e['save']();};}function saveUpdates(_0x4100cf,_0x14fa93){return function(_0x557c3b){if(_0x557c3b){return _0x557c3b[_0x7bca('0x27')](_0x4100cf)[_0x7bca('0x28')](function(_0x3fb271){return _0x3fb271;});}return null;};}function removeEntity(_0x27cb4d,_0x3a907a){return function(_0x5022e0){if(_0x5022e0){return _0x5022e0[_0x7bca('0x29')]()[_0x7bca('0x28')](function(){var _0x902155=_0x5022e0[_0x7bca('0x2a')]({'plain':!![]});var _0x50da9e=_0x7bca('0x2b');return db[_0x7bca('0x2c')][_0x7bca('0x29')]({'where':{'type':_0x50da9e,'resourceId':_0x902155['id']}})[_0x7bca('0x28')](function(){return _0x5022e0;});})[_0x7bca('0x28')](function(){_0x27cb4d[_0x7bca('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b35d8,_0x12563f){return function(_0x3a5a84){if(!_0x3a5a84){_0x5b35d8[_0x7bca('0x2d')](0x194);}return _0x3a5a84;};}function handleError(_0x5b1ea4,_0x178bb4){_0x178bb4=_0x178bb4||0x1f4;return function(_0x13fcb1){logger[_0x7bca('0x2e')](_0x13fcb1[_0x7bca('0x2f')]);if(_0x13fcb1[_0x7bca('0x30')]){delete _0x13fcb1[_0x7bca('0x30')];}_0x5b1ea4[_0x7bca('0x1d')](_0x178bb4)['send'](_0x13fcb1);};}exports[_0x7bca('0x31')]=function(_0x21e93b,_0x43ac52){var _0x95a697={},_0xa45b70={},_0xf6db3a={'count':0x0,'rows':[]};var _0x406a20=_[_0x7bca('0x32')](db['SquareProject'][_0x7bca('0x33')],function(_0x57cf76){return{'name':_0x57cf76[_0x7bca('0x34')],'type':_0x57cf76['type'][_0x7bca('0x35')]};});_0xa45b70[_0x7bca('0x36')]=_[_0x7bca('0x32')](_0x406a20,_0x7bca('0x30'));_0xa45b70[_0x7bca('0x37')]=_['keys'](_0x21e93b['query']);_0xa45b70['filters']=_[_0x7bca('0x38')](_0xa45b70[_0x7bca('0x36')],_0xa45b70[_0x7bca('0x37')]);_0x95a697[_0x7bca('0x39')]=_[_0x7bca('0x38')](_0xa45b70[_0x7bca('0x36')],qs['fields'](_0x21e93b[_0x7bca('0x37')][_0x7bca('0x3a')]));_0x95a697[_0x7bca('0x39')]=_0x95a697[_0x7bca('0x39')][_0x7bca('0x3b')]?_0x95a697[_0x7bca('0x39')]:_0xa45b70[_0x7bca('0x36')];if(!_0x21e93b['query']['hasOwnProperty'](_0x7bca('0x3c'))){_0x95a697[_0x7bca('0x21')]=qs['limit'](_0x21e93b[_0x7bca('0x37')][_0x7bca('0x21')]);_0x95a697[_0x7bca('0x20')]=qs['offset'](_0x21e93b['query'][_0x7bca('0x20')]);}_0x95a697['order']=qs[_0x7bca('0x3d')](_0x21e93b[_0x7bca('0x37')]['sort']);_0x95a697['where']=qs['filters'](_[_0x7bca('0x3e')](_0x21e93b[_0x7bca('0x37')],_0xa45b70[_0x7bca('0x3f')]),_0x406a20);if(_0x21e93b[_0x7bca('0x37')]['filter']){_0x95a697['where']=_['merge'](_0x95a697[_0x7bca('0x40')],{'$or':_[_0x7bca('0x32')](_0x406a20,function(_0x2de970){if(_0x2de970['type']!==_0x7bca('0x41')){var _0x388ad7={};_0x388ad7[_0x2de970[_0x7bca('0x30')]]={'$like':'%'+_0x21e93b[_0x7bca('0x37')]['filter']+'%'};return _0x388ad7;}})});}_0x95a697=_['merge']({},_0x95a697,_0x21e93b['options']);var _0x126203={'where':_0x95a697[_0x7bca('0x40')]};return db[_0x7bca('0x42')]['count'](_0x126203)[_0x7bca('0x28')](function(_0x5aacc8){_0xf6db3a[_0x7bca('0x22')]=_0x5aacc8;if(_0x21e93b[_0x7bca('0x37')][_0x7bca('0x43')]){_0x95a697['include']=[{'all':!![]}];}return db[_0x7bca('0x42')][_0x7bca('0x44')](_0x95a697);})['then'](function(_0x1346ef){_0xf6db3a[_0x7bca('0x45')]=_0x1346ef;return _0xf6db3a;})[_0x7bca('0x28')](respondWithFilteredResult(_0x43ac52,_0x95a697))[_0x7bca('0x46')](handleError(_0x43ac52,null));};exports[_0x7bca('0x47')]=function(_0x368362,_0x2ba52b){var _0x5c7a95={'raw':![],'where':{'id':_0x368362['params']['id']}},_0x2e62f3={};_0x2e62f3[_0x7bca('0x36')]=_['keys'](db[_0x7bca('0x42')][_0x7bca('0x33')]);_0x2e62f3[_0x7bca('0x37')]=_[_0x7bca('0x48')](_0x368362[_0x7bca('0x37')]);_0x2e62f3[_0x7bca('0x3f')]=_[_0x7bca('0x38')](_0x2e62f3['model'],_0x2e62f3['query']);_0x5c7a95[_0x7bca('0x39')]=_[_0x7bca('0x38')](_0x2e62f3['model'],qs[_0x7bca('0x3a')](_0x368362['query'][_0x7bca('0x3a')]));_0x5c7a95[_0x7bca('0x39')]=_0x5c7a95[_0x7bca('0x39')][_0x7bca('0x3b')]?_0x5c7a95[_0x7bca('0x39')]:_0x2e62f3[_0x7bca('0x36')];if(_0x368362[_0x7bca('0x37')][_0x7bca('0x43')]){_0x5c7a95['include']=[{'all':!![]}];}_0x5c7a95=_[_0x7bca('0x49')]({},_0x5c7a95,_0x368362[_0x7bca('0x4a')]);return db[_0x7bca('0x42')][_0x7bca('0x4b')](_0x5c7a95)[_0x7bca('0x28')](handleEntityNotFound(_0x2ba52b,null))[_0x7bca('0x28')](respondWithResult(_0x2ba52b,null))[_0x7bca('0x46')](handleError(_0x2ba52b,null));};exports[_0x7bca('0x4c')]=function(_0x48ebee,_0x25f560){return db[_0x7bca('0x42')]['create'](_0x48ebee[_0x7bca('0x4d')],{})['then'](function(_0x31ca20){var _0x12b17a=_0x48ebee[_0x7bca('0x4e')][_0x7bca('0x2a')]({'plain':!![]});if(!_0x12b17a)throw new Error(_0x7bca('0x4f'));if(_0x12b17a['role']===_0x7bca('0x4e')){var _0xc76b9a=_0x31ca20[_0x7bca('0x2a')]({'plain':!![]});var _0x274b63=_0x7bca('0x2b');return db[_0x7bca('0x50')][_0x7bca('0x4b')]({'where':{'name':_0x274b63,'userProfileId':_0x12b17a[_0x7bca('0x51')]},'raw':!![]})['then'](function(_0x5bd406){if(_0x5bd406&&_0x5bd406['autoAssociation']===0x0){return db['UserProfileResource'][_0x7bca('0x4c')]({'name':_0xc76b9a['name'],'resourceId':_0xc76b9a['id'],'type':_0x5bd406[_0x7bca('0x30')],'sectionId':_0x5bd406['id']},{})[_0x7bca('0x28')](function(){return _0x31ca20;});}else{return _0x31ca20;}})[_0x7bca('0x46')](function(_0x172ead){logger[_0x7bca('0x2e')](_0x7bca('0x52'),_0x172ead);throw _0x172ead;});}return _0x31ca20;})['then'](respondWithResult(_0x25f560,0xc9))[_0x7bca('0x46')](handleError(_0x25f560,null));};exports['update']=function(_0x3492e1,_0x503ce9){if(_0x3492e1[_0x7bca('0x4d')]['id']){delete _0x3492e1[_0x7bca('0x4d')]['id'];}return db[_0x7bca('0x42')][_0x7bca('0x4b')]({'where':{'id':_0x3492e1[_0x7bca('0x53')]['id']}})[_0x7bca('0x28')](handleEntityNotFound(_0x503ce9,null))[_0x7bca('0x28')](saveUpdates(_0x3492e1[_0x7bca('0x4d')],null))[_0x7bca('0x28')](respondWithResult(_0x503ce9,null))[_0x7bca('0x46')](handleError(_0x503ce9,null));};exports[_0x7bca('0x29')]=function(_0x5ac27d,_0x8002f3){return db[_0x7bca('0x42')][_0x7bca('0x4b')]({'where':{'id':_0x5ac27d[_0x7bca('0x53')]['id']}})[_0x7bca('0x28')](handleEntityNotFound(_0x8002f3,null))['then'](removeEntity(_0x8002f3,null))[_0x7bca('0x46')](handleError(_0x8002f3,null));};exports['addUsers']=function(_0x88dd33,_0x2f24f8,_0x4c6ae6){return db[_0x7bca('0x42')]['find']({'where':{'id':_0x88dd33[_0x7bca('0x53')]['id']}})[_0x7bca('0x28')](handleEntityNotFound(_0x2f24f8,null))[_0x7bca('0x28')](function(_0x5eb960){if(_0x5eb960){return _0x5eb960[_0x7bca('0x54')](_0x88dd33['body'][_0x7bca('0x55')],_['omit'](_0x88dd33[_0x7bca('0x4d')],[_0x7bca('0x55'),'id'])||{});}})['then'](respondWithResult(_0x2f24f8,null))['catch'](handleError(_0x2f24f8,null));};exports[_0x7bca('0x56')]=function(_0x4e77c1,_0x1581b1,_0x1548ad){return db[_0x7bca('0x42')][_0x7bca('0x4b')]({'where':{'id':_0x4e77c1['params']['id']}})[_0x7bca('0x28')](handleEntityNotFound(_0x1581b1,null))['then'](function(_0x449651){if(_0x449651){return _0x449651[_0x7bca('0x56')](_0x4e77c1[_0x7bca('0x37')][_0x7bca('0x55')])[_0x7bca('0x28')](function(){if(_['isArray'](_0x4e77c1[_0x7bca('0x37')][_0x7bca('0x55')])){for(var _0x45bf08=0x0;_0x45bf08<_0x4e77c1[_0x7bca('0x37')][_0x7bca('0x55')]['length'];_0x45bf08+=0x1){socket[_0x7bca('0x57')](_0x7bca('0x58'),{'UserId':Number(_0x4e77c1[_0x7bca('0x37')][_0x7bca('0x55')][_0x45bf08]),'SquareProjectId':Number(_0x4e77c1[_0x7bca('0x53')]['id'])});}}else{socket['emit'](_0x7bca('0x58'),{'UserId':Number(_0x4e77c1[_0x7bca('0x37')]['ids']),'SquareProjectId':Number(_0x4e77c1['params']['id'])});}});}})[_0x7bca('0x28')](respondWithStatusCode(_0x1581b1,null))[_0x7bca('0x46')](handleError(_0x1581b1,null));};exports[_0x7bca('0x59')]=function(_0x3e79d9,_0x81da31,_0x16cfda){var _0x533a8b={};var _0x1f05a4={};var _0x5a42d3;var _0x13b9c2;return db[_0x7bca('0x42')]['findOne']({'where':{'id':_0x3e79d9['params']['id']}})[_0x7bca('0x28')](handleEntityNotFound(_0x81da31,null))['then'](function(_0x485c12){if(_0x485c12){_0x5a42d3=_0x485c12;_0x1f05a4[_0x7bca('0x36')]=_[_0x7bca('0x48')](db[_0x7bca('0x5a')][_0x7bca('0x33')]);_0x1f05a4[_0x7bca('0x37')]=_['keys'](_0x3e79d9['query']);_0x1f05a4[_0x7bca('0x3f')]=_[_0x7bca('0x38')](_0x1f05a4[_0x7bca('0x36')],_0x1f05a4[_0x7bca('0x37')]);_0x533a8b[_0x7bca('0x39')]=_[_0x7bca('0x38')](_0x1f05a4['model'],qs['fields'](_0x3e79d9[_0x7bca('0x37')][_0x7bca('0x3a')]));_0x533a8b['attributes']=_0x533a8b[_0x7bca('0x39')][_0x7bca('0x3b')]?_0x533a8b['attributes']:_0x1f05a4['model'];_0x533a8b[_0x7bca('0x5b')]=qs[_0x7bca('0x3d')](_0x3e79d9[_0x7bca('0x37')][_0x7bca('0x3d')]);_0x533a8b['where']=qs[_0x7bca('0x3f')](_[_0x7bca('0x3e')](_0x3e79d9[_0x7bca('0x37')],_0x1f05a4[_0x7bca('0x3f')]));if(_0x3e79d9['query'][_0x7bca('0x5c')]){_0x533a8b[_0x7bca('0x40')]=_[_0x7bca('0x49')](_0x533a8b[_0x7bca('0x40')],{'$or':_[_0x7bca('0x32')](_0x533a8b[_0x7bca('0x39')],function(_0x40fa24){var _0x44e771={};_0x44e771[_0x40fa24]={'$like':'%'+_0x3e79d9[_0x7bca('0x37')]['filter']+'%'};return _0x44e771;})});}_0x533a8b=_[_0x7bca('0x49')]({},_0x533a8b,_0x3e79d9['options']);return _0x5a42d3[_0x7bca('0x59')](_0x533a8b);}})[_0x7bca('0x28')](function(_0xe54d25){if(_0xe54d25){_0x13b9c2=_0xe54d25[_0x7bca('0x3b')];if(!_0x3e79d9[_0x7bca('0x37')][_0x7bca('0x5d')]('nolimit')){_0x533a8b['limit']=qs[_0x7bca('0x21')](_0x3e79d9[_0x7bca('0x37')][_0x7bca('0x21')]);_0x533a8b[_0x7bca('0x20')]=qs[_0x7bca('0x20')](_0x3e79d9['query'][_0x7bca('0x20')]);}return _0x5a42d3[_0x7bca('0x59')](_0x533a8b);}})['then'](function(_0x560bd1){if(_0x560bd1){return _0x560bd1?{'count':_0x13b9c2,'rows':_0x560bd1}:null;}})['then'](respondWithResult(_0x81da31,null))['catch'](handleError(_0x81da31,null));}; \ No newline at end of file +var _0x2275=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','./squareProject.socket','register','sendStatus','status','json','offset','count','limit','Content-Range','reject','save','update','destroy','then','get','SquareProjects','UserProfileResource','end','error','stack','map','SquareProject','rawAttributes','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','options','findAll','rows','catch','params','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','order','rimraf','zip-dir'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x2275,0x16e));var _0x5227=function(_0x5bb633,_0x118d8e){_0x5bb633=_0x5bb633-0x0;var _0x2661b8=_0x2275[_0x5bb633];return _0x2661b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5227('0x0'));var zipdir=require(_0x5227('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5227('0x2'));var moment=require(_0x5227('0x3'));var BPromise=require(_0x5227('0x4'));var Mustache=require(_0x5227('0x5'));var util=require(_0x5227('0x6'));var path=require(_0x5227('0x7'));var sox=require(_0x5227('0x8'));var csv=require(_0x5227('0x9'));var ejs=require(_0x5227('0xa'));var fs=require('fs');var fs_extra=require(_0x5227('0xb'));var _=require(_0x5227('0xc'));var squel=require('squel');var crypto=require(_0x5227('0xd'));var jsforce=require(_0x5227('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5227('0x9'));var querystring=require(_0x5227('0xf'));var Papa=require('papaparse');var Redis=require(_0x5227('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5227('0x11'));var as=require(_0x5227('0x12'));var hardwareService=require(_0x5227('0x13'));var logger=require(_0x5227('0x14'))(_0x5227('0x15'));var utils=require(_0x5227('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5227('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5227('0x18')](config[_0x5227('0x19')],{'host':_0x5227('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5227('0x19')]));require(_0x5227('0x1b'))[_0x5227('0x1c')](socket);function respondWithStatusCode(_0x7888cf,_0x3a95e8){_0x3a95e8=_0x3a95e8||0xcc;return function(_0x5ad0a9){if(_0x5ad0a9){return _0x7888cf[_0x5227('0x1d')](_0x3a95e8);}return _0x7888cf[_0x5227('0x1e')](_0x3a95e8)['end']();};}function respondWithResult(_0x5d52e1,_0x15b9b5){_0x15b9b5=_0x15b9b5||0xc8;return function(_0x121481){if(_0x121481){return _0x5d52e1['status'](_0x15b9b5)[_0x5227('0x1f')](_0x121481);}};}function respondWithFilteredResult(_0xdd2282,_0x572470){return function(_0x4b27a2){if(_0x4b27a2){var _0x165817=typeof _0x572470[_0x5227('0x20')]==='undefined'&&typeof _0x572470['limit']==='undefined';var _0x358a6c=_0x4b27a2[_0x5227('0x21')];var _0x202c87=_0x165817?0x0:_0x572470[_0x5227('0x20')];var _0x154470=_0x165817?_0x4b27a2['count']:_0x572470['offset']+_0x572470[_0x5227('0x22')];var _0x9abcf7;if(_0x154470>=_0x358a6c){_0x154470=_0x358a6c;_0x9abcf7=0xc8;}else{_0x9abcf7=0xce;}_0xdd2282['status'](_0x9abcf7);return _0xdd2282['set'](_0x5227('0x23'),_0x202c87+'-'+_0x154470+'/'+_0x358a6c)['json'](_0x4b27a2);}return null;};}function patchUpdates(_0x59e8d8){return function(_0x258633){try{jsonpatch['apply'](_0x258633,_0x59e8d8,!![]);}catch(_0x2aebfa){return BPromise[_0x5227('0x24')](_0x2aebfa);}return _0x258633[_0x5227('0x25')]();};}function saveUpdates(_0x52452d,_0xd7b079){return function(_0x272ce8){if(_0x272ce8){return _0x272ce8[_0x5227('0x26')](_0x52452d)['then'](function(_0x240361){return _0x240361;});}return null;};}function removeEntity(_0x2a3e2b,_0x18ab0e){return function(_0x3b187a){if(_0x3b187a){return _0x3b187a[_0x5227('0x27')]()[_0x5227('0x28')](function(){var _0x53fdc5=_0x3b187a[_0x5227('0x29')]({'plain':!![]});var _0x5261cc=_0x5227('0x2a');return db[_0x5227('0x2b')]['destroy']({'where':{'type':_0x5261cc,'resourceId':_0x53fdc5['id']}})[_0x5227('0x28')](function(){return _0x3b187a;});})[_0x5227('0x28')](function(){_0x2a3e2b['status'](0xcc)[_0x5227('0x2c')]();});}};}function handleEntityNotFound(_0x127b83,_0x48006e){return function(_0x123798){if(!_0x123798){_0x127b83['sendStatus'](0x194);}return _0x123798;};}function handleError(_0x4f1796,_0x14e239){_0x14e239=_0x14e239||0x1f4;return function(_0xb7fafd){logger[_0x5227('0x2d')](_0xb7fafd[_0x5227('0x2e')]);if(_0xb7fafd['name']){delete _0xb7fafd['name'];}_0x4f1796[_0x5227('0x1e')](_0x14e239)['send'](_0xb7fafd);};}exports['index']=function(_0x1c41e9,_0x1da96c){var _0x9cfe16={},_0x4a25d1={},_0x1e298c={'count':0x0,'rows':[]};var _0x1b30d6=_[_0x5227('0x2f')](db[_0x5227('0x30')][_0x5227('0x31')],function(_0x269cf9){return{'name':_0x269cf9['fieldName'],'type':_0x269cf9['type'][_0x5227('0x32')]};});_0x4a25d1[_0x5227('0x33')]=_[_0x5227('0x2f')](_0x1b30d6,_0x5227('0x34'));_0x4a25d1[_0x5227('0x35')]=_['keys'](_0x1c41e9['query']);_0x4a25d1['filters']=_[_0x5227('0x36')](_0x4a25d1[_0x5227('0x33')],_0x4a25d1[_0x5227('0x35')]);_0x9cfe16[_0x5227('0x37')]=_[_0x5227('0x36')](_0x4a25d1[_0x5227('0x33')],qs[_0x5227('0x38')](_0x1c41e9[_0x5227('0x35')][_0x5227('0x38')]));_0x9cfe16['attributes']=_0x9cfe16[_0x5227('0x37')][_0x5227('0x39')]?_0x9cfe16[_0x5227('0x37')]:_0x4a25d1[_0x5227('0x33')];if(!_0x1c41e9[_0x5227('0x35')][_0x5227('0x3a')](_0x5227('0x3b'))){_0x9cfe16['limit']=qs[_0x5227('0x22')](_0x1c41e9[_0x5227('0x35')][_0x5227('0x22')]);_0x9cfe16['offset']=qs[_0x5227('0x20')](_0x1c41e9[_0x5227('0x35')][_0x5227('0x20')]);}_0x9cfe16['order']=qs[_0x5227('0x3c')](_0x1c41e9[_0x5227('0x35')][_0x5227('0x3c')]);_0x9cfe16['where']=qs[_0x5227('0x3d')](_[_0x5227('0x3e')](_0x1c41e9[_0x5227('0x35')],_0x4a25d1[_0x5227('0x3d')]),_0x1b30d6);if(_0x1c41e9[_0x5227('0x35')][_0x5227('0x3f')]){_0x9cfe16[_0x5227('0x40')]=_[_0x5227('0x41')](_0x9cfe16[_0x5227('0x40')],{'$or':_[_0x5227('0x2f')](_0x1b30d6,function(_0x45042c){if(_0x45042c[_0x5227('0x42')]!=='VIRTUAL'){var _0x50a12f={};_0x50a12f[_0x45042c[_0x5227('0x34')]]={'$like':'%'+_0x1c41e9[_0x5227('0x35')]['filter']+'%'};return _0x50a12f;}})});}_0x9cfe16=_[_0x5227('0x41')]({},_0x9cfe16,_0x1c41e9[_0x5227('0x43')]);var _0x207b48={'where':_0x9cfe16[_0x5227('0x40')]};return db[_0x5227('0x30')]['count'](_0x207b48)[_0x5227('0x28')](function(_0x37b55c){_0x1e298c[_0x5227('0x21')]=_0x37b55c;if(_0x1c41e9[_0x5227('0x35')]['includeAll']){_0x9cfe16['include']=[{'all':!![]}];}return db['SquareProject'][_0x5227('0x44')](_0x9cfe16);})[_0x5227('0x28')](function(_0x5b1606){_0x1e298c[_0x5227('0x45')]=_0x5b1606;return _0x1e298c;})['then'](respondWithFilteredResult(_0x1da96c,_0x9cfe16))[_0x5227('0x46')](handleError(_0x1da96c,null));};exports['show']=function(_0x113430,_0x131b57){var _0x3f8b83={'raw':![],'where':{'id':_0x113430[_0x5227('0x47')]['id']}},_0x204186={};_0x204186[_0x5227('0x33')]=_[_0x5227('0x48')](db[_0x5227('0x30')]['rawAttributes']);_0x204186['query']=_[_0x5227('0x48')](_0x113430[_0x5227('0x35')]);_0x204186[_0x5227('0x3d')]=_['intersection'](_0x204186[_0x5227('0x33')],_0x204186['query']);_0x3f8b83[_0x5227('0x37')]=_[_0x5227('0x36')](_0x204186['model'],qs[_0x5227('0x38')](_0x113430[_0x5227('0x35')][_0x5227('0x38')]));_0x3f8b83[_0x5227('0x37')]=_0x3f8b83[_0x5227('0x37')][_0x5227('0x39')]?_0x3f8b83[_0x5227('0x37')]:_0x204186[_0x5227('0x33')];if(_0x113430['query'][_0x5227('0x49')]){_0x3f8b83['include']=[{'all':!![]}];}_0x3f8b83=_[_0x5227('0x41')]({},_0x3f8b83,_0x113430[_0x5227('0x43')]);return db[_0x5227('0x30')]['find'](_0x3f8b83)[_0x5227('0x28')](handleEntityNotFound(_0x131b57,null))['then'](respondWithResult(_0x131b57,null))['catch'](handleError(_0x131b57,null));};exports[_0x5227('0x4a')]=function(_0x5a1bbf,_0x426463){return db['SquareProject']['create'](_0x5a1bbf[_0x5227('0x4b')],{})[_0x5227('0x28')](function(_0x244775){var _0x3b439e=_0x5a1bbf['user'][_0x5227('0x29')]({'plain':!![]});if(!_0x3b439e)throw new Error(_0x5227('0x4c'));if(_0x3b439e[_0x5227('0x4d')]==='user'){var _0x3da3df=_0x244775[_0x5227('0x29')]({'plain':!![]});var _0x591226='SquareProjects';return db[_0x5227('0x4e')][_0x5227('0x4f')]({'where':{'name':_0x591226,'userProfileId':_0x3b439e[_0x5227('0x50')]},'raw':!![]})[_0x5227('0x28')](function(_0x4d4b0a){if(_0x4d4b0a&&_0x4d4b0a[_0x5227('0x51')]===0x0){return db['UserProfileResource'][_0x5227('0x4a')]({'name':_0x3da3df['name'],'resourceId':_0x3da3df['id'],'type':_0x4d4b0a[_0x5227('0x34')],'sectionId':_0x4d4b0a['id']},{})[_0x5227('0x28')](function(){return _0x244775;});}else{return _0x244775;}})[_0x5227('0x46')](function(_0x368859){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368859);throw _0x368859;});}return _0x244775;})[_0x5227('0x28')](respondWithResult(_0x426463,0xc9))[_0x5227('0x46')](handleError(_0x426463,null));};exports['update']=function(_0x54300c,_0x38fedf){if(_0x54300c[_0x5227('0x4b')]['id']){delete _0x54300c[_0x5227('0x4b')]['id'];}return db[_0x5227('0x30')][_0x5227('0x4f')]({'where':{'id':_0x54300c['params']['id']}})[_0x5227('0x28')](handleEntityNotFound(_0x38fedf,null))['then'](saveUpdates(_0x54300c[_0x5227('0x4b')],null))['then'](respondWithResult(_0x38fedf,null))[_0x5227('0x46')](handleError(_0x38fedf,null));};exports[_0x5227('0x27')]=function(_0x41bd4c,_0x255bc2){return db[_0x5227('0x30')][_0x5227('0x4f')]({'where':{'id':_0x41bd4c[_0x5227('0x47')]['id']}})[_0x5227('0x28')](handleEntityNotFound(_0x255bc2,null))[_0x5227('0x28')](removeEntity(_0x255bc2,null))[_0x5227('0x46')](handleError(_0x255bc2,null));};exports[_0x5227('0x52')]=function(_0x339ac0,_0x4769c3,_0x464fa4){return db[_0x5227('0x30')][_0x5227('0x4f')]({'where':{'id':_0x339ac0[_0x5227('0x47')]['id']}})[_0x5227('0x28')](handleEntityNotFound(_0x4769c3,null))[_0x5227('0x28')](function(_0x569e34){if(_0x569e34){return _0x569e34['addUsers'](_0x339ac0[_0x5227('0x4b')][_0x5227('0x53')],_[_0x5227('0x54')](_0x339ac0[_0x5227('0x4b')],[_0x5227('0x53'),'id'])||{});}})[_0x5227('0x28')](respondWithResult(_0x4769c3,null))[_0x5227('0x46')](handleError(_0x4769c3,null));};exports[_0x5227('0x55')]=function(_0x6fa8d1,_0x154e6b,_0x5d4cf3){return db[_0x5227('0x30')][_0x5227('0x4f')]({'where':{'id':_0x6fa8d1[_0x5227('0x47')]['id']}})[_0x5227('0x28')](handleEntityNotFound(_0x154e6b,null))[_0x5227('0x28')](function(_0x3f42e1){if(_0x3f42e1){return _0x3f42e1[_0x5227('0x55')](_0x6fa8d1[_0x5227('0x35')][_0x5227('0x53')])[_0x5227('0x28')](function(){if(_[_0x5227('0x56')](_0x6fa8d1['query']['ids'])){for(var _0x288ba7=0x0;_0x288ba7<_0x6fa8d1[_0x5227('0x35')][_0x5227('0x53')][_0x5227('0x39')];_0x288ba7+=0x1){socket[_0x5227('0x57')](_0x5227('0x58'),{'UserId':Number(_0x6fa8d1[_0x5227('0x35')][_0x5227('0x53')][_0x288ba7]),'SquareProjectId':Number(_0x6fa8d1[_0x5227('0x47')]['id'])});}}else{socket[_0x5227('0x57')](_0x5227('0x58'),{'UserId':Number(_0x6fa8d1[_0x5227('0x35')]['ids']),'SquareProjectId':Number(_0x6fa8d1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x154e6b,null))[_0x5227('0x46')](handleError(_0x154e6b,null));};exports[_0x5227('0x59')]=function(_0x2e3ba4,_0x13a167,_0xde275c){var _0x1d8259={};var _0x336b22={};var _0xfdf2fa;var _0x1f186;return db[_0x5227('0x30')][_0x5227('0x5a')]({'where':{'id':_0x2e3ba4[_0x5227('0x47')]['id']}})[_0x5227('0x28')](handleEntityNotFound(_0x13a167,null))[_0x5227('0x28')](function(_0x5c4a2c){if(_0x5c4a2c){_0xfdf2fa=_0x5c4a2c;_0x336b22[_0x5227('0x33')]=_[_0x5227('0x48')](db['User']['rawAttributes']);_0x336b22[_0x5227('0x35')]=_[_0x5227('0x48')](_0x2e3ba4[_0x5227('0x35')]);_0x336b22[_0x5227('0x3d')]=_[_0x5227('0x36')](_0x336b22[_0x5227('0x33')],_0x336b22['query']);_0x1d8259[_0x5227('0x37')]=_['intersection'](_0x336b22[_0x5227('0x33')],qs[_0x5227('0x38')](_0x2e3ba4[_0x5227('0x35')][_0x5227('0x38')]));_0x1d8259[_0x5227('0x37')]=_0x1d8259[_0x5227('0x37')][_0x5227('0x39')]?_0x1d8259[_0x5227('0x37')]:_0x336b22[_0x5227('0x33')];_0x1d8259[_0x5227('0x5b')]=qs['sort'](_0x2e3ba4[_0x5227('0x35')][_0x5227('0x3c')]);_0x1d8259[_0x5227('0x40')]=qs['filters'](_[_0x5227('0x3e')](_0x2e3ba4['query'],_0x336b22[_0x5227('0x3d')]));if(_0x2e3ba4['query']['filter']){_0x1d8259['where']=_[_0x5227('0x41')](_0x1d8259['where'],{'$or':_[_0x5227('0x2f')](_0x1d8259['attributes'],function(_0x3297a6){var _0x1011bd={};_0x1011bd[_0x3297a6]={'$like':'%'+_0x2e3ba4[_0x5227('0x35')][_0x5227('0x3f')]+'%'};return _0x1011bd;})});}_0x1d8259=_[_0x5227('0x41')]({},_0x1d8259,_0x2e3ba4['options']);return _0xfdf2fa[_0x5227('0x59')](_0x1d8259);}})['then'](function(_0x4cd903){if(_0x4cd903){_0x1f186=_0x4cd903[_0x5227('0x39')];if(!_0x2e3ba4[_0x5227('0x35')][_0x5227('0x3a')](_0x5227('0x3b'))){_0x1d8259[_0x5227('0x22')]=qs[_0x5227('0x22')](_0x2e3ba4[_0x5227('0x35')][_0x5227('0x22')]);_0x1d8259[_0x5227('0x20')]=qs['offset'](_0x2e3ba4[_0x5227('0x35')][_0x5227('0x20')]);}return _0xfdf2fa[_0x5227('0x59')](_0x1d8259);}})[_0x5227('0x28')](function(_0x84c97f){if(_0x84c97f){return _0x84c97f?{'count':_0x1f186,'rows':_0x84c97f}:null;}})[_0x5227('0x28')](respondWithResult(_0x13a167,null))[_0x5227('0x46')](handleError(_0x13a167,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 990d0f7..98a661f 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 _0x3e95=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','update'];(function(_0x22acca,_0x4547d2){var _0x2bca25=function(_0x42bba6){while(--_0x42bba6){_0x22acca['push'](_0x22acca['shift']());}};_0x2bca25(++_0x4547d2);}(_0x3e95,0xef));var _0x53e9=function(_0x287f8d,_0x428412){_0x287f8d=_0x287f8d-0x0;var _0x42361a=_0x3e95[_0x287f8d];return _0x42361a;};'use strict';var EventEmitter=require(_0x53e9('0x0'));var SquareProject=require(_0x53e9('0x1'))['db'][_0x53e9('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x53e9('0x3'),'afterDestroy':_0x53e9('0x4')};function emitEvent(_0x5d4700){return function(_0x1060ec,_0x5ac4a0,_0x14f230){SquareProjectEvents[_0x53e9('0x5')](_0x5d4700+':'+_0x1060ec['id'],_0x1060ec);SquareProjectEvents[_0x53e9('0x5')](_0x5d4700,_0x1060ec);_0x14f230(null);};}for(var e in events){if(events[_0x53e9('0x6')](e)){var event=events[e];SquareProject[_0x53e9('0x7')](e,emitEvent(event));}}module[_0x53e9('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xfa4a=['events','SquareProject','save','remove','exports'];(function(_0x51559d,_0xd0155a){var _0x2e9b97=function(_0x366f3b){while(--_0x366f3b){_0x51559d['push'](_0x51559d['shift']());}};_0x2e9b97(++_0xd0155a);}(_0xfa4a,0x122));var _0xafa4=function(_0x453583,_0x5ca1e8){_0x453583=_0x453583-0x0;var _0x3e9101=_0xfa4a[_0x453583];return _0x3e9101;};'use strict';var EventEmitter=require(_0xafa4('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xafa4('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xafa4('0x2'),'afterUpdate':'update','afterDestroy':_0xafa4('0x3')};function emitEvent(_0x209903){return function(_0xa9cdae,_0x5b5761,_0x38d955){SquareProjectEvents['emit'](_0x209903+':'+_0xa9cdae['id'],_0xa9cdae);SquareProjectEvents['emit'](_0x209903,_0xa9cdae);_0x38d955(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xafa4('0x4')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 14f570f..0587247 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 _0x1625=['YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt'];(function(_0x41bff8,_0x3c45d4){var _0x51090f=function(_0xaeac10){while(--_0xaeac10){_0x41bff8['push'](_0x41bff8['shift']());}};_0x51090f(++_0x3c45d4);}(_0x1625,0xa7));var _0x5162=function(_0x1aa0c5,_0x22c6d0){_0x1aa0c5=_0x1aa0c5-0x0;var _0x44df89=_0x1625[_0x1aa0c5];return _0x44df89;};'use strict';var _=require(_0x5162('0x0'));var util=require('util');var logger=require(_0x5162('0x1'))('api');var moment=require(_0x5162('0x2'));var BPromise=require(_0x5162('0x3'));var rp=require(_0x5162('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5162('0x5'));var config=require('../../config/environment');var attributes=require(_0x5162('0x6'));module[_0x5162('0x7')]=function(_0x46a175,_0x4fdff8){return _0x46a175[_0x5162('0x8')](_0x5162('0x9'),attributes,{'tableName':_0x5162('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d8549,_0x3c4e5b,_0x4588f0){if(_0x4d8549['changed'](_0x5162('0xb'))){_0x4d8549[_0x5162('0xc')]=moment()['format'](_0x5162('0xd'));}if(_0x4d8549[_0x5162('0xe')](_0x5162('0xf'))){_0x4d8549[_0x5162('0x10')]=moment()[_0x5162('0x11')](_0x5162('0xd'));}_0x4588f0(null,_0x4d8549);}}});}; \ No newline at end of file +var _0x1866=['format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1866,0xe4));var _0x6186=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1866[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x6186('0x0'));var util=require(_0x6186('0x1'));var logger=require('../../config/logger')(_0x6186('0x2'));var moment=require(_0x6186('0x3'));var BPromise=require('bluebird');var rp=require(_0x6186('0x4'));var fs=require('fs');var path=require(_0x6186('0x5'));var rimraf=require(_0x6186('0x6'));var config=require(_0x6186('0x7'));var attributes=require(_0x6186('0x8'));module[_0x6186('0x9')]=function(_0x329115,_0x4eb9fe){return _0x329115['define'](_0x6186('0xa'),attributes,{'tableName':_0x6186('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a465d,_0x48a652,_0x4f0bad){if(_0x3a465d['changed']('preproduction')){_0x3a465d['savedAt']=moment()[_0x6186('0xc')](_0x6186('0xd'));}if(_0x3a465d['changed'](_0x6186('0xe'))){_0x3a465d[_0x6186('0xf')]=moment()[_0x6186('0xc')](_0x6186('0xd'));}_0x4f0bad(null,_0x3a465d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0e60b67..01dadbf 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 _0x4d6c=['defaults','redis','localhost','socket.io-emitter','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','model','map','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x4ab0f2,_0x1f72b9){var _0x4c5089=function(_0x543cf6){while(--_0x543cf6){_0x4ab0f2['push'](_0x4ab0f2['shift']());}};_0x4c5089(++_0x1f72b9);}(_0x4d6c,0x171));var _0xc4d6=function(_0x27629,_0x24b0e0){_0x27629=_0x27629-0x0;var _0xf4f0db=_0x4d6c[_0x27629];return _0xf4f0db;};'use strict';var _=require(_0xc4d6('0x0'));var util=require(_0xc4d6('0x1'));var moment=require(_0xc4d6('0x2'));var BPromise=require(_0xc4d6('0x3'));var rs=require(_0xc4d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4d6('0x5'))['db'];var utils=require(_0xc4d6('0x6'));var logger=require(_0xc4d6('0x7'))(_0xc4d6('0x8'));var config=require(_0xc4d6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc4d6('0xa')]({'port':0x232a});config['redis']=_[_0xc4d6('0xb')](config[_0xc4d6('0xc')],{'host':_0xc4d6('0xd'),'port':0x18eb});var socket=require(_0xc4d6('0xe'))(new Redis(config[_0xc4d6('0xc')]));require('./squareProject.socket')[_0xc4d6('0xf')](socket);function respondWithRpcPromise(_0x2483a8,_0x21f6ca,_0x487482){return new BPromise(function(_0x56be0d,_0x32e25e){return client[_0xc4d6('0x10')](_0x2483a8,_0x487482)['then'](function(_0x2c5362){logger[_0xc4d6('0x11')](_0xc4d6('0x12'),_0x21f6ca,_0xc4d6('0x13'));logger[_0xc4d6('0x14')](_0xc4d6('0x15'),_0x21f6ca,'request\x20sent',JSON['stringify'](_0x2c5362));if(_0x2c5362[_0xc4d6('0x16')]){if(_0x2c5362['error'][_0xc4d6('0x17')]===0x1f4){logger[_0xc4d6('0x16')](_0xc4d6('0x12'),_0x21f6ca,_0x2c5362[_0xc4d6('0x16')][_0xc4d6('0x18')]);return _0x32e25e(_0x2c5362[_0xc4d6('0x16')]['message']);}logger['error'](_0xc4d6('0x12'),_0x21f6ca,_0x2c5362[_0xc4d6('0x16')][_0xc4d6('0x18')]);return _0x56be0d(_0x2c5362['error'][_0xc4d6('0x18')]);}else{logger[_0xc4d6('0x11')](_0xc4d6('0x12'),_0x21f6ca,_0xc4d6('0x13'));_0x56be0d(_0x2c5362[_0xc4d6('0x19')][_0xc4d6('0x18')]);}})[_0xc4d6('0x1a')](function(_0x884cc4){logger[_0xc4d6('0x16')](_0xc4d6('0x12'),_0x21f6ca,_0x884cc4);_0x32e25e(_0x884cc4);});});}exports[_0xc4d6('0x1b')]=function(_0x51e146){var _0xe25638=this;return new Promise(function(_0x398fdf,_0x2a64af){return db['SquareProject'][_0xc4d6('0x1c')]({'raw':_0x51e146[_0xc4d6('0x1d')]?_0x51e146['options'][_0xc4d6('0x1e')]===undefined?!![]:![]:!![],'where':_0x51e146[_0xc4d6('0x1d')]?_0x51e146[_0xc4d6('0x1d')][_0xc4d6('0x1f')]||null:null,'attributes':_0x51e146['options']?_0x51e146['options'][_0xc4d6('0x20')]||null:null,'include':_0x51e146[_0xc4d6('0x1d')]?_0x51e146[_0xc4d6('0x1d')]['include']?_['map'](_0x51e146[_0xc4d6('0x1d')][_0xc4d6('0x21')],function(_0x4e9f49){return{'model':db[_0x4e9f49[_0xc4d6('0x22')]],'as':_0x4e9f49['as'],'attributes':_0x4e9f49['attributes'],'include':_0x4e9f49['include']?_[_0xc4d6('0x23')](_0x4e9f49['include'],function(_0x520078){return{'model':db[_0x520078[_0xc4d6('0x22')]],'as':_0x520078['as'],'attributes':_0x520078[_0xc4d6('0x20')],'include':_0x520078[_0xc4d6('0x21')]?_[_0xc4d6('0x23')](_0x520078[_0xc4d6('0x21')],function(_0x5a6624){return{'model':db[_0x5a6624[_0xc4d6('0x22')]],'as':_0x5a6624['as'],'attributes':_0x5a6624[_0xc4d6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc4d6('0x24')](function(_0x4e6f88){logger[_0xc4d6('0x11')](_0xc4d6('0x1b'),_0x51e146);logger[_0xc4d6('0x14')](_0xc4d6('0x1b'),_0x51e146,JSON[_0xc4d6('0x25')](_0x4e6f88));_0x398fdf(_0x4e6f88);})[_0xc4d6('0x1a')](function(_0x5950f0){logger[_0xc4d6('0x16')]('ShowSquareProject',_0x5950f0[_0xc4d6('0x18')],_0x51e146);_0x2a64af(_0xe25638['error'](0x1f4,_0x5950f0['message']));});});}; \ No newline at end of file +var _0x08f6=['include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSquareProject','find','options','raw','where','attributes'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x08f6,0x147));var _0x608f=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x08f6[_0x25efdf];return _0x22c495;};'use strict';var _=require(_0x608f('0x0'));var util=require(_0x608f('0x1'));var moment=require(_0x608f('0x2'));var BPromise=require('bluebird');var rs=require(_0x608f('0x3'));var fs=require('fs');var Redis=require(_0x608f('0x4'));var db=require(_0x608f('0x5'))['db'];var utils=require(_0x608f('0x6'));var logger=require(_0x608f('0x7'))(_0x608f('0x8'));var config=require(_0x608f('0x9'));var jayson=require(_0x608f('0xa'));var client=jayson[_0x608f('0xb')]['http']({'port':0x232a});config[_0x608f('0xc')]=_[_0x608f('0xd')](config[_0x608f('0xc')],{'host':_0x608f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x608f('0xc')]));require(_0x608f('0xf'))['register'](socket);function respondWithRpcPromise(_0x3404bc,_0x111486,_0x33b2d6){return new BPromise(function(_0x540c59,_0x1b60ed){return client[_0x608f('0x10')](_0x3404bc,_0x33b2d6)[_0x608f('0x11')](function(_0x41a684){logger[_0x608f('0x12')](_0x608f('0x13'),_0x111486,_0x608f('0x14'));logger[_0x608f('0x15')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x111486,_0x608f('0x14'),JSON[_0x608f('0x16')](_0x41a684));if(_0x41a684[_0x608f('0x17')]){if(_0x41a684['error']['code']===0x1f4){logger[_0x608f('0x17')](_0x608f('0x13'),_0x111486,_0x41a684[_0x608f('0x17')][_0x608f('0x18')]);return _0x1b60ed(_0x41a684[_0x608f('0x17')][_0x608f('0x18')]);}logger['error']('SquareProject,\x20%s,\x20%s',_0x111486,_0x41a684[_0x608f('0x17')][_0x608f('0x18')]);return _0x540c59(_0x41a684[_0x608f('0x17')]['message']);}else{logger[_0x608f('0x12')]('SquareProject,\x20%s,\x20%s',_0x111486,'request\x20sent');_0x540c59(_0x41a684[_0x608f('0x19')][_0x608f('0x18')]);}})[_0x608f('0x1a')](function(_0x102818){logger[_0x608f('0x17')]('SquareProject,\x20%s,\x20%s',_0x111486,_0x102818);_0x1b60ed(_0x102818);});});}exports[_0x608f('0x1b')]=function(_0x41f816){var _0x2e8754=this;return new Promise(function(_0x2b8168,_0x561fb7){return db['SquareProject'][_0x608f('0x1c')]({'raw':_0x41f816[_0x608f('0x1d')]?_0x41f816[_0x608f('0x1d')][_0x608f('0x1e')]===undefined?!![]:![]:!![],'where':_0x41f816[_0x608f('0x1d')]?_0x41f816[_0x608f('0x1d')][_0x608f('0x1f')]||null:null,'attributes':_0x41f816['options']?_0x41f816[_0x608f('0x1d')][_0x608f('0x20')]||null:null,'include':_0x41f816[_0x608f('0x1d')]?_0x41f816['options'][_0x608f('0x21')]?_[_0x608f('0x22')](_0x41f816[_0x608f('0x1d')]['include'],function(_0x3b2138){return{'model':db[_0x3b2138[_0x608f('0x23')]],'as':_0x3b2138['as'],'attributes':_0x3b2138[_0x608f('0x20')],'include':_0x3b2138[_0x608f('0x21')]?_['map'](_0x3b2138[_0x608f('0x21')],function(_0x10492c){return{'model':db[_0x10492c['model']],'as':_0x10492c['as'],'attributes':_0x10492c[_0x608f('0x20')],'include':_0x10492c[_0x608f('0x21')]?_[_0x608f('0x22')](_0x10492c[_0x608f('0x21')],function(_0x1728ee){return{'model':db[_0x1728ee[_0x608f('0x23')]],'as':_0x1728ee['as'],'attributes':_0x1728ee[_0x608f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c0cd5){logger[_0x608f('0x12')]('ShowSquareProject',_0x41f816);logger[_0x608f('0x15')](_0x608f('0x1b'),_0x41f816,JSON['stringify'](_0x3c0cd5));_0x2b8168(_0x3c0cd5);})[_0x608f('0x1a')](function(_0x1338de){logger['error']('ShowSquareProject',_0x1338de[_0x608f('0x18')],_0x41f816);_0x561fb7(_0x2e8754[_0x608f('0x17')](0x1f4,_0x1338de[_0x608f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 4e0b10c..3845b9e 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 _0xfc5f=['remove','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x445769,_0x3488a7){var _0x41ba21=function(_0x30ba11){while(--_0x30ba11){_0x445769['push'](_0x445769['shift']());}};_0x41ba21(++_0x3488a7);}(_0xfc5f,0x1a9));var _0xffc5=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xfc5f[_0x4baae2];return _0x1a2285;};'use strict';var SquareProjectEvents=require(_0xffc5('0x0'));var events=['save',_0xffc5('0x1'),'update'];function createListener(_0x1b4c81,_0x47838e){return function(_0x578bb8){_0x47838e['emit'](_0x1b4c81,_0x578bb8);};}function removeListener(_0x3161e0,_0x403df0){return function(){SquareProjectEvents[_0xffc5('0x2')](_0x3161e0,_0x403df0);};}exports[_0xffc5('0x3')]=function(_0x2112a7){for(var _0x535c15=0x0,_0x32a4ed=events[_0xffc5('0x4')];_0x535c15<_0x32a4ed;_0x535c15++){var _0x49be39=events[_0x535c15];var _0x2659af=createListener(_0xffc5('0x5')+_0x49be39,_0x2112a7);SquareProjectEvents['on'](_0x49be39,_0x2659af);}}; \ No newline at end of file +var _0x6166=['squareProject:','remove','update','emit','removeListener','register','length'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6166,0x7f));var _0x6616=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x6166[_0x1f36bb];return _0xaf97fa;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x6616('0x0'),_0x6616('0x1')];function createListener(_0x521242,_0x26d6e3){return function(_0x18660e){_0x26d6e3[_0x6616('0x2')](_0x521242,_0x18660e);};}function removeListener(_0x3d788f,_0x4dee00){return function(){SquareProjectEvents[_0x6616('0x3')](_0x3d788f,_0x4dee00);};}exports[_0x6616('0x4')]=function(_0x13e92b){for(var _0x139d27=0x0,_0x614e9=events[_0x6616('0x5')];_0x139d27<_0x614e9;_0x139d27++){var _0xc53a8f=events[_0x139d27];var _0x92180c=createListener(_0x6616('0x6')+_0xc53a8f,_0x13e92b);SquareProjectEvents['on'](_0xc53a8f,_0x92180c);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 4ca9ccb..a1eede9 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 _0x7217=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x7217,0x19e));var _0x7721=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7217[_0x5b561d];return _0x431060;};'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('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x37beda,_0x55f651){var _0xaf613f=function(_0x40f07d){while(--_0x40f07d){_0x37beda['push'](_0x37beda['shift']());}};_0xaf613f(++_0x55f651);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3a9fd9,_0x3d76e4){_0x3a9fd9=_0x3a9fd9-0x0;var _0x2f8890=_0x1cb9[_0x3a9fd9];return _0x2f8890;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e0e5390..7b4d2b4 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 _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x45310c,_0x106a46){var _0x5e941f=function(_0x17f122){while(--_0x17f122){_0x45310c['push'](_0x45310c['shift']());}};_0x5e941f(++_0x106a46);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7995('0x2')]},'extension':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7995('0x2')]},'saveName':{'type':Sequelize[_0x7995('0x2')]},'filename':{'type':Sequelize[_0x7995('0x2')]},'savePath':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize[_0x7995('0x3')],'get':function(){var _0x326741='';var _0x4996ca=this[_0x7995('0x4')](_0x7995('0x5'));if(_0x4996ca){_0x326741=_0x4996ca['substring'](_0x4996ca[_0x7995('0x6')]('.'));}return _0x326741;}}}; \ No newline at end of file +var _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x84d48b,_0x16bc23){var _0x5e6aa2=function(_0x664f75){while(--_0x664f75){_0x84d48b['push'](_0x84d48b['shift']());}};_0x5e6aa2(++_0x16bc23);}(_0x032e,0x124));var _0xe032=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x032e[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2671062..bc2cab2 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 _0x75d5=['download','../../components/encryptor','uniqueid','params','savePath','filename','format','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareRecording','rawAttributes','type','model','keys','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','intersection','body','find'];(function(_0x598d33,_0xbfd60f){var _0x4eec56=function(_0x4902a6){while(--_0x4902a6){_0x598d33['push'](_0x598d33['shift']());}};_0x4eec56(++_0xbfd60f);}(_0x75d5,0xe3));var _0x575d=function(_0x3262e3,_0x5be8d7){_0x3262e3=_0x3262e3-0x0;var _0x1c75dc=_0x75d5[_0x3262e3];return _0x1c75dc;};'use strict';var emlformat=require(_0x575d('0x0'));var rimraf=require(_0x575d('0x1'));var zipdir=require(_0x575d('0x2'));var jsonpatch=require(_0x575d('0x3'));var rp=require(_0x575d('0x4'));var moment=require(_0x575d('0x5'));var BPromise=require(_0x575d('0x6'));var Mustache=require(_0x575d('0x7'));var util=require(_0x575d('0x8'));var path=require(_0x575d('0x9'));var sox=require(_0x575d('0xa'));var csv=require(_0x575d('0xb'));var ejs=require(_0x575d('0xc'));var fs=require('fs');var fs_extra=require(_0x575d('0xd'));var _=require(_0x575d('0xe'));var squel=require(_0x575d('0xf'));var crypto=require(_0x575d('0x10'));var jsforce=require(_0x575d('0x11'));var deskjs=require(_0x575d('0x12'));var toCsv=require(_0x575d('0xb'));var querystring=require(_0x575d('0x13'));var Papa=require(_0x575d('0x14'));var Redis=require(_0x575d('0x15'));var authService=require(_0x575d('0x16'));var qs=require(_0x575d('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x575d('0x18'));var logger=require(_0x575d('0x19'))(_0x575d('0x1a'));var utils=require(_0x575d('0x1b'));var config=require(_0x575d('0x1c'));var licenseUtil=require(_0x575d('0x1d'));var db=require(_0x575d('0x1e'))['db'];function respondWithStatusCode(_0x37bba6,_0x3038ca){_0x3038ca=_0x3038ca||0xcc;return function(_0x1ed358){if(_0x1ed358){return _0x37bba6[_0x575d('0x1f')](_0x3038ca);}return _0x37bba6[_0x575d('0x20')](_0x3038ca)[_0x575d('0x21')]();};}function respondWithResult(_0x44d9cc,_0xcc2df9){_0xcc2df9=_0xcc2df9||0xc8;return function(_0x4c1958){if(_0x4c1958){return _0x44d9cc['status'](_0xcc2df9)['json'](_0x4c1958);}};}function respondWithFilteredResult(_0x242749,_0x140515){return function(_0x4d36d2){if(_0x4d36d2){var _0x3254e2=typeof _0x140515[_0x575d('0x22')]===_0x575d('0x23')&&typeof _0x140515[_0x575d('0x24')]===_0x575d('0x23');var _0x234988=_0x4d36d2[_0x575d('0x25')];var _0x149139=_0x3254e2?0x0:_0x140515[_0x575d('0x22')];var _0x41863c=_0x3254e2?_0x4d36d2[_0x575d('0x25')]:_0x140515['offset']+_0x140515[_0x575d('0x24')];var _0x41d063;if(_0x41863c>=_0x234988){_0x41863c=_0x234988;_0x41d063=0xc8;}else{_0x41d063=0xce;}_0x242749[_0x575d('0x20')](_0x41d063);return _0x242749[_0x575d('0x26')](_0x575d('0x27'),_0x149139+'-'+_0x41863c+'/'+_0x234988)[_0x575d('0x28')](_0x4d36d2);}return null;};}function patchUpdates(_0x354715){return function(_0x5bfa76){try{jsonpatch[_0x575d('0x29')](_0x5bfa76,_0x354715,!![]);}catch(_0x2d5963){return BPromise[_0x575d('0x2a')](_0x2d5963);}return _0x5bfa76[_0x575d('0x2b')]();};}function saveUpdates(_0x45bb2d,_0x225690){return function(_0x3eeb2f){if(_0x3eeb2f){return _0x3eeb2f[_0x575d('0x2c')](_0x45bb2d)[_0x575d('0x2d')](function(_0x4ba1ce){return _0x4ba1ce;});}return null;};}function removeEntity(_0x33d51e,_0x2cd7fd){return function(_0x19012c){if(_0x19012c){return _0x19012c[_0x575d('0x2e')]()['then'](function(){_0x33d51e['status'](0xcc)[_0x575d('0x21')]();});}};}function handleEntityNotFound(_0x30d50d,_0x5dd24b){return function(_0x263bb4){if(!_0x263bb4){_0x30d50d[_0x575d('0x1f')](0x194);}return _0x263bb4;};}function handleError(_0x1cac81,_0x3f734c){_0x3f734c=_0x3f734c||0x1f4;return function(_0x268923){logger[_0x575d('0x2f')](_0x268923[_0x575d('0x30')]);if(_0x268923[_0x575d('0x31')]){delete _0x268923[_0x575d('0x31')];}_0x1cac81['status'](_0x3f734c)['send'](_0x268923);};}exports[_0x575d('0x32')]=function(_0x11526c,_0x43865d){var _0x5a115a={},_0x4f1c56={},_0x5aeaa9={'count':0x0,'rows':[]};var _0x460ab2=_[_0x575d('0x33')](db[_0x575d('0x34')][_0x575d('0x35')],function(_0x38b155){return{'name':_0x38b155['fieldName'],'type':_0x38b155[_0x575d('0x36')]['key']};});_0x4f1c56[_0x575d('0x37')]=_[_0x575d('0x33')](_0x460ab2,'name');_0x4f1c56['query']=_[_0x575d('0x38')](_0x11526c[_0x575d('0x39')]);_0x4f1c56[_0x575d('0x3a')]=_['intersection'](_0x4f1c56[_0x575d('0x37')],_0x4f1c56[_0x575d('0x39')]);_0x5a115a['attributes']=_['intersection'](_0x4f1c56['model'],qs[_0x575d('0x3b')](_0x11526c[_0x575d('0x39')][_0x575d('0x3b')]));_0x5a115a[_0x575d('0x3c')]=_0x5a115a[_0x575d('0x3c')][_0x575d('0x3d')]?_0x5a115a[_0x575d('0x3c')]:_0x4f1c56['model'];if(!_0x11526c[_0x575d('0x39')]['hasOwnProperty'](_0x575d('0x3e'))){_0x5a115a[_0x575d('0x24')]=qs[_0x575d('0x24')](_0x11526c[_0x575d('0x39')][_0x575d('0x24')]);_0x5a115a[_0x575d('0x22')]=qs[_0x575d('0x22')](_0x11526c[_0x575d('0x39')][_0x575d('0x22')]);}_0x5a115a[_0x575d('0x3f')]=qs[_0x575d('0x40')](_0x11526c[_0x575d('0x39')][_0x575d('0x40')]);_0x5a115a[_0x575d('0x41')]=qs[_0x575d('0x3a')](_[_0x575d('0x42')](_0x11526c[_0x575d('0x39')],_0x4f1c56[_0x575d('0x3a')]),_0x460ab2);if(_0x11526c[_0x575d('0x39')][_0x575d('0x43')]){_0x5a115a[_0x575d('0x41')]=_[_0x575d('0x44')](_0x5a115a[_0x575d('0x41')],{'$or':_[_0x575d('0x33')](_0x460ab2,function(_0x2eca00){if(_0x2eca00['type']!=='VIRTUAL'){var _0x173724={};_0x173724[_0x2eca00[_0x575d('0x31')]]={'$like':'%'+_0x11526c[_0x575d('0x39')][_0x575d('0x43')]+'%'};return _0x173724;}})});}_0x5a115a=_[_0x575d('0x44')]({},_0x5a115a,_0x11526c[_0x575d('0x45')]);var _0x5417d3={'where':_0x5a115a[_0x575d('0x41')]};return db['SquareRecording'][_0x575d('0x25')](_0x5417d3)['then'](function(_0xe659b){_0x5aeaa9[_0x575d('0x25')]=_0xe659b;if(_0x11526c[_0x575d('0x39')][_0x575d('0x46')]){_0x5a115a[_0x575d('0x47')]=[{'all':!![]}];}return db[_0x575d('0x34')][_0x575d('0x48')](_0x5a115a);})[_0x575d('0x2d')](function(_0x96cb71){_0x5aeaa9[_0x575d('0x49')]=_0x96cb71;return _0x5aeaa9;})[_0x575d('0x2d')](respondWithFilteredResult(_0x43865d,_0x5a115a))[_0x575d('0x4a')](handleError(_0x43865d,null));};exports[_0x575d('0x4b')]=function(_0x30c7a,_0x3c869d){var _0x5ba06f={'raw':!![],'where':{'id':_0x30c7a['params']['id']}},_0x59af82={};_0x59af82['model']=_[_0x575d('0x38')](db[_0x575d('0x34')][_0x575d('0x35')]);_0x59af82[_0x575d('0x39')]=_[_0x575d('0x38')](_0x30c7a['query']);_0x59af82[_0x575d('0x3a')]=_[_0x575d('0x4c')](_0x59af82[_0x575d('0x37')],_0x59af82['query']);_0x5ba06f[_0x575d('0x3c')]=_['intersection'](_0x59af82[_0x575d('0x37')],qs[_0x575d('0x3b')](_0x30c7a[_0x575d('0x39')][_0x575d('0x3b')]));_0x5ba06f['attributes']=_0x5ba06f[_0x575d('0x3c')][_0x575d('0x3d')]?_0x5ba06f[_0x575d('0x3c')]:_0x59af82[_0x575d('0x37')];if(_0x30c7a[_0x575d('0x39')][_0x575d('0x46')]){_0x5ba06f[_0x575d('0x47')]=[{'all':!![]}];}_0x5ba06f=_[_0x575d('0x44')]({},_0x5ba06f,_0x30c7a['options']);return db[_0x575d('0x34')]['find'](_0x5ba06f)['then'](handleEntityNotFound(_0x3c869d,null))[_0x575d('0x2d')](respondWithResult(_0x3c869d,null))[_0x575d('0x4a')](handleError(_0x3c869d,null));};exports['create']=function(_0x567043,_0x1bc8d5){return db[_0x575d('0x34')]['create'](_0x567043[_0x575d('0x4d')],{})['then'](respondWithResult(_0x1bc8d5,0xc9))[_0x575d('0x4a')](handleError(_0x1bc8d5,null));};exports['update']=function(_0x3346ae,_0x18f7fd){if(_0x3346ae[_0x575d('0x4d')]['id']){delete _0x3346ae[_0x575d('0x4d')]['id'];}return db['SquareRecording'][_0x575d('0x4e')]({'where':{'id':_0x3346ae['params']['id']}})[_0x575d('0x2d')](handleEntityNotFound(_0x18f7fd,null))[_0x575d('0x2d')](saveUpdates(_0x3346ae['body'],null))[_0x575d('0x2d')](respondWithResult(_0x18f7fd,null))[_0x575d('0x4a')](handleError(_0x18f7fd,null));};exports[_0x575d('0x4f')]=function(_0x376117,_0x47a3ab,_0x23c00e){var _0x158c7f=require(_0x575d('0x50'));var _0x21c3bb=![];var _0x16f308={};if(_0x376117[_0x575d('0x39')][_0x575d('0x36')]&&_0x376117[_0x575d('0x39')][_0x575d('0x36')]===_0x575d('0x51')){_0x16f308[_0x575d('0x51')]=_0x376117[_0x575d('0x52')]['id'];}else{_0x16f308['id']=_0x376117[_0x575d('0x52')]['id'];}return db[_0x575d('0x34')][_0x575d('0x4e')]({'where':_0x16f308,'attributes':['id',_0x575d('0x53'),_0x575d('0x54')],'raw':!![]})[_0x575d('0x2d')](handleEntityNotFound(_0x47a3ab,null))[_0x575d('0x2d')](function(_0x242764){if(_0x242764){var _0x6bcab8=_0x242764[_0x575d('0x53')];var _0x3ddfe6=util[_0x575d('0x55')]('%s.cypher',_0x6bcab8);if(fs[_0x575d('0x56')](_0x3ddfe6)){_0x21c3bb=!![];return _0x158c7f[_0x575d('0x57')](_0x3ddfe6,_0x6bcab8,config['secrets'][_0x575d('0x58')])['then'](function(){return _0x242764;});}return _0x242764;}})[_0x575d('0x2d')](function(_0x4b4711){if(_0x4b4711){var _0x23d526=_0x4b4711[_0x575d('0x53')];if(!fs[_0x575d('0x56')](_0x23d526)){throw new db[(_0x575d('0x59'))][(_0x575d('0x5a'))](_0x575d('0x5b'));}if(_0x4b4711[_0x575d('0x54')]){return _0x47a3ab[_0x575d('0x4f')](_0x23d526,_0x4b4711['filename']+path['extname'](_0x23d526),function(){if(_0x21c3bb){fs[_0x575d('0x5c')](_0x23d526);}});}else{return _0x47a3ab[_0x575d('0x4f')](_0x23d526,function(_0x863518){if(_0x21c3bb){fs[_0x575d('0x5c')](_0x23d526);}});}}})[_0x575d('0x4a')](function(_0xbec347){if(_0xbec347[_0x575d('0x5d')]===_0x575d('0x5b')){_0x47a3ab[_0x575d('0x20')](0x194)['send'](_0x575d('0x5e'));}else{return handleError(_0x47a3ab,null);}});};exports[_0x575d('0x2e')]=function(_0x173747,_0x169ce1){return db[_0x575d('0x34')][_0x575d('0x4e')]({'where':{'id':_0x173747[_0x575d('0x52')]['id']}})[_0x575d('0x2d')](function(_0xef9078){if(_[_0x575d('0x5f')](_0xef9078)){throw new ReferenceError(_0x575d('0x60'));}return _0xef9078;})[_0x575d('0x2d')](function(_0x54f1b8){var _0x5c44f8=_0x54f1b8[_0x575d('0x53')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5c44f8);if(!_[_0x575d('0x5f')](_0x54f1b8['savePath'])&&fs['existsSync'](_0x5c44f8)){logger[_0x575d('0x61')](_0x575d('0x62')+_0x5c44f8+_0x575d('0x63'));fs[_0x575d('0x64')](_0x5c44f8);}_0x5c44f8=_0x5c44f8+_0x575d('0x65');if(!_['isNil'](_0x54f1b8[_0x575d('0x53')])&&fs[_0x575d('0x56')](_0x5c44f8)){logger['info'](_0x575d('0x62')+_0x5c44f8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5c44f8);}return _0x54f1b8;})[_0x575d('0x2d')](function(_0x2cc13a){if(!_0x2cc13a)throw new InternalError();return _0x2cc13a[_0x575d('0x2e')]();})[_0x575d('0x2d')](function(){_0x169ce1[_0x575d('0x20')](0xcc)[_0x575d('0x21')]();})[_0x575d('0x4a')](handleError(_0x169ce1,null));}; \ No newline at end of file +var _0x084e=['stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','find','create','body','catch','download','uniqueid','savePath','%s.cypher','existsSync','decryptFile','secrets','ValidationError','SquareRecording\x20not\x20found','filename','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','json','offset','undefined','limit','count','save','update','then','destroy','error'];(function(_0x11fa3d,_0x402a8d){var _0x52b603=function(_0x240664){while(--_0x240664){_0x11fa3d['push'](_0x11fa3d['shift']());}};_0x52b603(++_0x402a8d);}(_0x084e,0x145));var _0xe084=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x084e[_0x81e39d];return _0x548fbb;};'use strict';var emlformat=require(_0xe084('0x0'));var rimraf=require(_0xe084('0x1'));var zipdir=require(_0xe084('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe084('0x3'));var moment=require(_0xe084('0x4'));var BPromise=require(_0xe084('0x5'));var Mustache=require('mustache');var util=require(_0xe084('0x6'));var path=require(_0xe084('0x7'));var sox=require(_0xe084('0x8'));var csv=require(_0xe084('0x9'));var ejs=require(_0xe084('0xa'));var fs=require('fs');var fs_extra=require(_0xe084('0xb'));var _=require(_0xe084('0xc'));var squel=require(_0xe084('0xd'));var crypto=require(_0xe084('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe084('0xf'));var toCsv=require(_0xe084('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe084('0x10'));var authService=require(_0xe084('0x11'));var qs=require(_0xe084('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe084('0x13'));var logger=require(_0xe084('0x14'))(_0xe084('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x584ca8,_0x54553c){_0x54553c=_0x54553c||0xcc;return function(_0x2206b6){if(_0x2206b6){return _0x584ca8[_0xe084('0x16')](_0x54553c);}return _0x584ca8['status'](_0x54553c)[_0xe084('0x17')]();};}function respondWithResult(_0x24eb24,_0x2e4251){_0x2e4251=_0x2e4251||0xc8;return function(_0x477d93){if(_0x477d93){return _0x24eb24[_0xe084('0x18')](_0x2e4251)[_0xe084('0x19')](_0x477d93);}};}function respondWithFilteredResult(_0x5441df,_0x4c400b){return function(_0x3870fb){if(_0x3870fb){var _0x3afc37=typeof _0x4c400b[_0xe084('0x1a')]===_0xe084('0x1b')&&typeof _0x4c400b[_0xe084('0x1c')]===_0xe084('0x1b');var _0x517712=_0x3870fb[_0xe084('0x1d')];var _0x50335d=_0x3afc37?0x0:_0x4c400b[_0xe084('0x1a')];var _0x30d54c=_0x3afc37?_0x3870fb[_0xe084('0x1d')]:_0x4c400b[_0xe084('0x1a')]+_0x4c400b[_0xe084('0x1c')];var _0x199b20;if(_0x30d54c>=_0x517712){_0x30d54c=_0x517712;_0x199b20=0xc8;}else{_0x199b20=0xce;}_0x5441df['status'](_0x199b20);return _0x5441df['set']('Content-Range',_0x50335d+'-'+_0x30d54c+'/'+_0x517712)[_0xe084('0x19')](_0x3870fb);}return null;};}function patchUpdates(_0x650fbf){return function(_0x2db2d4){try{jsonpatch['apply'](_0x2db2d4,_0x650fbf,!![]);}catch(_0x12b642){return BPromise['reject'](_0x12b642);}return _0x2db2d4[_0xe084('0x1e')]();};}function saveUpdates(_0x11745a,_0x3f75a2){return function(_0x4136ef){if(_0x4136ef){return _0x4136ef[_0xe084('0x1f')](_0x11745a)[_0xe084('0x20')](function(_0x443679){return _0x443679;});}return null;};}function removeEntity(_0x2da7cd,_0x42e6a8){return function(_0x262a33){if(_0x262a33){return _0x262a33[_0xe084('0x21')]()[_0xe084('0x20')](function(){_0x2da7cd[_0xe084('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26020a,_0x5819c2){return function(_0x164180){if(!_0x164180){_0x26020a[_0xe084('0x16')](0x194);}return _0x164180;};}function handleError(_0x40b8ef,_0xfa84d0){_0xfa84d0=_0xfa84d0||0x1f4;return function(_0x2a382f){logger[_0xe084('0x22')](_0x2a382f[_0xe084('0x23')]);if(_0x2a382f[_0xe084('0x24')]){delete _0x2a382f[_0xe084('0x24')];}_0x40b8ef[_0xe084('0x18')](_0xfa84d0)[_0xe084('0x25')](_0x2a382f);};}exports['index']=function(_0x5ba748,_0x4b6d71){var _0x1012e8={},_0x50e269={},_0x14cefd={'count':0x0,'rows':[]};var _0x5c3003=_[_0xe084('0x26')](db[_0xe084('0x27')][_0xe084('0x28')],function(_0x37cf20){return{'name':_0x37cf20[_0xe084('0x29')],'type':_0x37cf20[_0xe084('0x2a')][_0xe084('0x2b')]};});_0x50e269[_0xe084('0x2c')]=_[_0xe084('0x26')](_0x5c3003,_0xe084('0x24'));_0x50e269['query']=_[_0xe084('0x2d')](_0x5ba748[_0xe084('0x2e')]);_0x50e269['filters']=_[_0xe084('0x2f')](_0x50e269[_0xe084('0x2c')],_0x50e269[_0xe084('0x2e')]);_0x1012e8['attributes']=_[_0xe084('0x2f')](_0x50e269[_0xe084('0x2c')],qs[_0xe084('0x30')](_0x5ba748[_0xe084('0x2e')][_0xe084('0x30')]));_0x1012e8[_0xe084('0x31')]=_0x1012e8[_0xe084('0x31')][_0xe084('0x32')]?_0x1012e8[_0xe084('0x31')]:_0x50e269['model'];if(!_0x5ba748[_0xe084('0x2e')][_0xe084('0x33')](_0xe084('0x34'))){_0x1012e8[_0xe084('0x1c')]=qs[_0xe084('0x1c')](_0x5ba748[_0xe084('0x2e')][_0xe084('0x1c')]);_0x1012e8[_0xe084('0x1a')]=qs[_0xe084('0x1a')](_0x5ba748['query']['offset']);}_0x1012e8[_0xe084('0x35')]=qs[_0xe084('0x36')](_0x5ba748[_0xe084('0x2e')][_0xe084('0x36')]);_0x1012e8[_0xe084('0x37')]=qs[_0xe084('0x38')](_[_0xe084('0x39')](_0x5ba748[_0xe084('0x2e')],_0x50e269['filters']),_0x5c3003);if(_0x5ba748[_0xe084('0x2e')]['filter']){_0x1012e8['where']=_[_0xe084('0x3a')](_0x1012e8[_0xe084('0x37')],{'$or':_[_0xe084('0x26')](_0x5c3003,function(_0x14ad10){if(_0x14ad10[_0xe084('0x2a')]!==_0xe084('0x3b')){var _0x327989={};_0x327989[_0x14ad10['name']]={'$like':'%'+_0x5ba748[_0xe084('0x2e')][_0xe084('0x3c')]+'%'};return _0x327989;}})});}_0x1012e8=_[_0xe084('0x3a')]({},_0x1012e8,_0x5ba748[_0xe084('0x3d')]);var _0x2ab001={'where':_0x1012e8[_0xe084('0x37')]};return db[_0xe084('0x27')][_0xe084('0x1d')](_0x2ab001)[_0xe084('0x20')](function(_0x292fd7){_0x14cefd[_0xe084('0x1d')]=_0x292fd7;if(_0x5ba748[_0xe084('0x2e')][_0xe084('0x3e')]){_0x1012e8[_0xe084('0x3f')]=[{'all':!![]}];}return db[_0xe084('0x27')][_0xe084('0x40')](_0x1012e8);})[_0xe084('0x20')](function(_0x19dd01){_0x14cefd['rows']=_0x19dd01;return _0x14cefd;})[_0xe084('0x20')](respondWithFilteredResult(_0x4b6d71,_0x1012e8))['catch'](handleError(_0x4b6d71,null));};exports['show']=function(_0x2a1548,_0x4c7453){var _0x2eee38={'raw':!![],'where':{'id':_0x2a1548[_0xe084('0x41')]['id']}},_0x212aa6={};_0x212aa6['model']=_[_0xe084('0x2d')](db[_0xe084('0x27')][_0xe084('0x28')]);_0x212aa6[_0xe084('0x2e')]=_[_0xe084('0x2d')](_0x2a1548[_0xe084('0x2e')]);_0x212aa6[_0xe084('0x38')]=_[_0xe084('0x2f')](_0x212aa6[_0xe084('0x2c')],_0x212aa6['query']);_0x2eee38['attributes']=_[_0xe084('0x2f')](_0x212aa6[_0xe084('0x2c')],qs['fields'](_0x2a1548[_0xe084('0x2e')]['fields']));_0x2eee38[_0xe084('0x31')]=_0x2eee38['attributes']['length']?_0x2eee38['attributes']:_0x212aa6[_0xe084('0x2c')];if(_0x2a1548[_0xe084('0x2e')][_0xe084('0x3e')]){_0x2eee38['include']=[{'all':!![]}];}_0x2eee38=_[_0xe084('0x3a')]({},_0x2eee38,_0x2a1548['options']);return db[_0xe084('0x27')][_0xe084('0x42')](_0x2eee38)[_0xe084('0x20')](handleEntityNotFound(_0x4c7453,null))[_0xe084('0x20')](respondWithResult(_0x4c7453,null))['catch'](handleError(_0x4c7453,null));};exports['create']=function(_0x292266,_0x18b08d){return db['SquareRecording'][_0xe084('0x43')](_0x292266[_0xe084('0x44')],{})[_0xe084('0x20')](respondWithResult(_0x18b08d,0xc9))[_0xe084('0x45')](handleError(_0x18b08d,null));};exports[_0xe084('0x1f')]=function(_0x3ad6d3,_0x1fbf45){if(_0x3ad6d3[_0xe084('0x44')]['id']){delete _0x3ad6d3['body']['id'];}return db[_0xe084('0x27')][_0xe084('0x42')]({'where':{'id':_0x3ad6d3[_0xe084('0x41')]['id']}})[_0xe084('0x20')](handleEntityNotFound(_0x1fbf45,null))[_0xe084('0x20')](saveUpdates(_0x3ad6d3[_0xe084('0x44')],null))['then'](respondWithResult(_0x1fbf45,null))['catch'](handleError(_0x1fbf45,null));};exports[_0xe084('0x46')]=function(_0x4574c7,_0x1d977e,_0x38242e){var _0x426de5=require('../../components/encryptor');var _0x3b43ed=![];var _0x581956={};if(_0x4574c7[_0xe084('0x2e')][_0xe084('0x2a')]&&_0x4574c7[_0xe084('0x2e')][_0xe084('0x2a')]===_0xe084('0x47')){_0x581956['uniqueid']=_0x4574c7['params']['id'];}else{_0x581956['id']=_0x4574c7['params']['id'];}return db[_0xe084('0x27')][_0xe084('0x42')]({'where':_0x581956,'attributes':['id',_0xe084('0x48'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x1d977e,null))[_0xe084('0x20')](function(_0x18856d){if(_0x18856d){var _0x42b0ab=_0x18856d['savePath'];var _0x273f82=util['format'](_0xe084('0x49'),_0x42b0ab);if(fs[_0xe084('0x4a')](_0x273f82)){_0x3b43ed=!![];return _0x426de5[_0xe084('0x4b')](_0x273f82,_0x42b0ab,config[_0xe084('0x4c')]['recording'])['then'](function(){return _0x18856d;});}return _0x18856d;}})[_0xe084('0x20')](function(_0x3a1cb9){if(_0x3a1cb9){var _0x369b77=_0x3a1cb9[_0xe084('0x48')];if(!fs[_0xe084('0x4a')](_0x369b77)){throw new db['Sequelize'][(_0xe084('0x4d'))](_0xe084('0x4e'));}if(_0x3a1cb9[_0xe084('0x4f')]){return _0x1d977e[_0xe084('0x46')](_0x369b77,_0x3a1cb9[_0xe084('0x4f')]+path['extname'](_0x369b77),function(){if(_0x3b43ed){fs[_0xe084('0x50')](_0x369b77);}});}else{return _0x1d977e[_0xe084('0x46')](_0x369b77,function(_0x16b872){if(_0x3b43ed){fs[_0xe084('0x50')](_0x369b77);}});}}})[_0xe084('0x45')](function(_0x276b53){if(_0x276b53[_0xe084('0x51')]===_0xe084('0x4e')){_0x1d977e['status'](0x194)[_0xe084('0x25')](_0xe084('0x52'));}else{return handleError(_0x1d977e,null);}});};exports[_0xe084('0x21')]=function(_0x5d1ee9,_0x37ba1f){return db[_0xe084('0x27')][_0xe084('0x42')]({'where':{'id':_0x5d1ee9['params']['id']}})['then'](function(_0x4bcfec){if(_['isNil'](_0x4bcfec)){throw new ReferenceError(_0xe084('0x53'));}return _0x4bcfec;})[_0xe084('0x20')](function(_0x4d531e){var _0x2eda8d=_0x4d531e[_0xe084('0x48')];logger['info'](_0xe084('0x54'),_0x2eda8d);if(!_[_0xe084('0x55')](_0x4d531e[_0xe084('0x48')])&&fs['existsSync'](_0x2eda8d)){logger[_0xe084('0x56')](_0xe084('0x57')+_0x2eda8d+_0xe084('0x58'));fs[_0xe084('0x59')](_0x2eda8d);}_0x2eda8d=_0x2eda8d+'.cypher';if(!_['isNil'](_0x4d531e['savePath'])&&fs[_0xe084('0x4a')](_0x2eda8d)){logger[_0xe084('0x56')](_0xe084('0x57')+_0x2eda8d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe084('0x59')](_0x2eda8d);}return _0x4d531e;})[_0xe084('0x20')](function(_0xf06c94){if(!_0xf06c94)throw new InternalError();return _0xf06c94['destroy']();})['then'](function(){_0x37ba1f[_0xe084('0x18')](0xcc)[_0xe084('0x17')]();})[_0xe084('0x45')](handleError(_0x37ba1f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e7c92df..41f1790 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 _0x5532=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./squareRecording.attributes','define','square_recordings'];(function(_0x341bda,_0x15a85f){var _0x38aba1=function(_0x898c36){while(--_0x898c36){_0x341bda['push'](_0x341bda['shift']());}};_0x38aba1(++_0x15a85f);}(_0x5532,0x19a));var _0x2553=function(_0x529a30,_0x4ea831){_0x529a30=_0x529a30-0x0;var _0xc826b2=_0x5532[_0x529a30];return _0xc826b2;};'use strict';var _=require(_0x2553('0x0'));var util=require(_0x2553('0x1'));var logger=require(_0x2553('0x2'))('api');var moment=require(_0x2553('0x3'));var BPromise=require('bluebird');var rp=require(_0x2553('0x4'));var fs=require('fs');var path=require(_0x2553('0x5'));var rimraf=require(_0x2553('0x6'));var config=require('../../config/environment');var attributes=require(_0x2553('0x7'));module['exports']=function(_0x506c9a,_0x45358c){return _0x506c9a[_0x2553('0x8')]('SquareRecording',attributes,{'tableName':_0x2553('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa701=['SquareRecording','square_recordings','util','../../config/logger','bluebird','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xa701,0xd4));var _0x1a70=function(_0x5564fd,_0x32a19b){_0x5564fd=_0x5564fd-0x0;var _0x399ec5=_0xa701[_0x5564fd];return _0x399ec5;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var logger=require(_0x1a70('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1a70('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a70('0x3'));var config=require(_0x1a70('0x4'));var attributes=require(_0x1a70('0x5'));module[_0x1a70('0x6')]=function(_0x48532f,_0x5ec401){return _0x48532f[_0x1a70('0x7')](_0x1a70('0x8'),attributes,{'tableName':_0x1a70('0x9'),'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 9b057e7..91537ab 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 _0x6b83=['error','code','message','info','result','SquareRecording','create','body','options','raw','CreateSquareRecording','debug','stringify','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x6b83,0x194));var _0x36b8=function(_0x2815d5,_0x3530be){_0x2815d5=_0x2815d5-0x0;var _0x2969bc=_0x6b83[_0x2815d5];return _0x2969bc;};'use strict';var _=require(_0x36b8('0x0'));var util=require(_0x36b8('0x1'));var moment=require(_0x36b8('0x2'));var BPromise=require('bluebird');var rs=require(_0x36b8('0x3'));var fs=require('fs');var Redis=require(_0x36b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x36b8('0x5'));var logger=require(_0x36b8('0x6'))(_0x36b8('0x7'));var config=require(_0x36b8('0x8'));var jayson=require(_0x36b8('0x9'));var client=jayson[_0x36b8('0xa')][_0x36b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x285271,_0x3757d3,_0x2700fa){return new BPromise(function(_0x52b927,_0x7b6aed){return client[_0x36b8('0xc')](_0x285271,_0x2700fa)[_0x36b8('0xd')](function(_0x4a0969){logger['info'](_0x36b8('0xe'),_0x3757d3,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x3757d3,_0x36b8('0xf'),JSON['stringify'](_0x4a0969));if(_0x4a0969['error']){if(_0x4a0969[_0x36b8('0x10')][_0x36b8('0x11')]===0x1f4){logger[_0x36b8('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3757d3,_0x4a0969[_0x36b8('0x10')][_0x36b8('0x12')]);return _0x7b6aed(_0x4a0969[_0x36b8('0x10')]['message']);}logger[_0x36b8('0x10')](_0x36b8('0xe'),_0x3757d3,_0x4a0969['error'][_0x36b8('0x12')]);return _0x52b927(_0x4a0969[_0x36b8('0x10')][_0x36b8('0x12')]);}else{logger[_0x36b8('0x13')](_0x36b8('0xe'),_0x3757d3,_0x36b8('0xf'));_0x52b927(_0x4a0969[_0x36b8('0x14')][_0x36b8('0x12')]);}})['catch'](function(_0x4a86d5){logger[_0x36b8('0x10')](_0x36b8('0xe'),_0x3757d3,_0x4a86d5);_0x7b6aed(_0x4a86d5);});});}exports['CreateSquareRecording']=function(_0x13cb12){var _0x4ddc6d=this;return new Promise(function(_0x1ff70f,_0x4d8e18){return db[_0x36b8('0x15')][_0x36b8('0x16')](_0x13cb12[_0x36b8('0x17')],{'raw':_0x13cb12[_0x36b8('0x18')]?_0x13cb12[_0x36b8('0x18')][_0x36b8('0x19')]===undefined?!![]:![]:!![]})[_0x36b8('0xd')](function(_0x7f53c9){logger[_0x36b8('0x13')](_0x36b8('0x1a'),_0x13cb12);logger[_0x36b8('0x1b')](_0x36b8('0x1a'),_0x13cb12,JSON[_0x36b8('0x1c')](_0x7f53c9));_0x1ff70f(_0x7f53c9);})[_0x36b8('0x1d')](function(_0x1e896e){logger['error'](_0x36b8('0x1a'),_0x1e896e['message'],_0x13cb12);_0x4d8e18(_0x4ddc6d['error'](0x1f4,_0x1e896e[_0x36b8('0x12')]));});});}; \ No newline at end of file +var _0x1f31=['debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then'];(function(_0x235e2b,_0x232235){var _0x4e9f0a=function(_0x2f5bf2){while(--_0x2f5bf2){_0x235e2b['push'](_0x235e2b['shift']());}};_0x4e9f0a(++_0x232235);}(_0x1f31,0x92));var _0x11f3=function(_0x170bba,_0x2be92f){_0x170bba=_0x170bba-0x0;var _0xa7c249=_0x1f31[_0x170bba];return _0xa7c249;};'use strict';var _=require(_0x11f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x11f3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11f3('0x2'));var db=require(_0x11f3('0x3'))['db'];var utils=require(_0x11f3('0x4'));var logger=require(_0x11f3('0x5'))(_0x11f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x11f3('0x7'));var client=jayson[_0x11f3('0x8')][_0x11f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3682c7,_0x519c33,_0x1a1ce1){return new BPromise(function(_0x1102ee,_0x449bfd){return client[_0x11f3('0xa')](_0x3682c7,_0x1a1ce1)['then'](function(_0x5ed4a2){logger[_0x11f3('0xb')](_0x11f3('0xc'),_0x519c33,_0x11f3('0xd'));logger['debug'](_0x11f3('0xe'),_0x519c33,_0x11f3('0xd'),JSON[_0x11f3('0xf')](_0x5ed4a2));if(_0x5ed4a2[_0x11f3('0x10')]){if(_0x5ed4a2[_0x11f3('0x10')][_0x11f3('0x11')]===0x1f4){logger[_0x11f3('0x10')](_0x11f3('0xc'),_0x519c33,_0x5ed4a2['error'][_0x11f3('0x12')]);return _0x449bfd(_0x5ed4a2[_0x11f3('0x10')]['message']);}logger[_0x11f3('0x10')](_0x11f3('0xc'),_0x519c33,_0x5ed4a2[_0x11f3('0x10')]['message']);return _0x1102ee(_0x5ed4a2[_0x11f3('0x10')][_0x11f3('0x12')]);}else{logger[_0x11f3('0xb')](_0x11f3('0xc'),_0x519c33,_0x11f3('0xd'));_0x1102ee(_0x5ed4a2[_0x11f3('0x13')][_0x11f3('0x12')]);}})[_0x11f3('0x14')](function(_0x27bcee){logger[_0x11f3('0x10')](_0x11f3('0xc'),_0x519c33,_0x27bcee);_0x449bfd(_0x27bcee);});});}exports[_0x11f3('0x15')]=function(_0x316978){var _0x490a1f=this;return new Promise(function(_0x345c4d,_0xd223f9){return db[_0x11f3('0x16')][_0x11f3('0x17')](_0x316978[_0x11f3('0x18')],{'raw':_0x316978['options']?_0x316978[_0x11f3('0x19')][_0x11f3('0x1a')]===undefined?!![]:![]:!![]})[_0x11f3('0x1b')](function(_0x8dd3de){logger[_0x11f3('0xb')]('CreateSquareRecording',_0x316978);logger[_0x11f3('0x1c')](_0x11f3('0x15'),_0x316978,JSON[_0x11f3('0xf')](_0x8dd3de));_0x345c4d(_0x8dd3de);})['catch'](function(_0xf5e1d7){logger['error'](_0x11f3('0x15'),_0xf5e1d7[_0x11f3('0x12')],_0x316978);_0xd223f9(_0x490a1f[_0x11f3('0x10')](0x1f4,_0xf5e1d7[_0x11f3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index f402d1a..65fd2df 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x43c3bc,_0x4bfa56){var _0x50033f=function(_0x552feb){while(--_0x552feb){_0x43c3bc['push'](_0x43c3bc['shift']());}};_0x50033f(++_0x4bfa56);}(_0xe706,0xa3));var _0x6e70=function(_0x5e909d,_0xcb0787){_0x5e909d=_0x5e909d-0x0;var _0x4cf7b5=_0xe706[_0x5e909d];return _0x4cf7b5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x16c90a,_0x394d17){var _0x4c2fba=function(_0x4d9286){while(--_0x4d9286){_0x16c90a['push'](_0x16c90a['shift']());}};_0x4c2fba(++_0x394d17);}(_0xe706,0xa3));var _0x6e70=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0xe706[_0x1ce9ea];return _0x2a95b9;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 157afbd..1f5f751 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 _0xf0a5=['BOOLEAN','exports','STRING','DATE'];(function(_0x150bff,_0x1fb61a){var _0x296f9a=function(_0x179044){while(--_0x179044){_0x150bff['push'](_0x150bff['shift']());}};_0x296f9a(++_0x1fb61a);}(_0xf0a5,0x139));var _0x5f0a=function(_0x22d05c,_0x3eccab){_0x22d05c=_0x22d05c-0x0;var _0x35233e=_0xf0a5[_0x22d05c];return _0x35233e;};'use strict';var Sequelize=require('sequelize');module[_0x5f0a('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5f0a('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5f0a('0x1')]},'calleridname':{'type':Sequelize[_0x5f0a('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x5f0a('0x1')]},'callington':{'type':Sequelize[_0x5f0a('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5f0a('0x1')]},'rdnis':{'type':Sequelize[_0x5f0a('0x1')]},'context':{'type':Sequelize[_0x5f0a('0x1')]},'extension':{'type':Sequelize[_0x5f0a('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x5f0a('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x5f0a('0x1')]},'project_name':{'type':Sequelize[_0x5f0a('0x1')]},'joinAt':{'type':Sequelize[_0x5f0a('0x2')]},'leaveAt':{'type':Sequelize[_0x5f0a('0x2')]},'bot':{'type':Sequelize[_0x5f0a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1776=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x474cd6,_0x2edaae){var _0x54c5f6=function(_0x561bcb){while(--_0x561bcb){_0x474cd6['push'](_0x474cd6['shift']());}};_0x54c5f6(++_0x2edaae);}(_0x1776,0xff));var _0x6177=function(_0x5f238b,_0x115973){_0x5f238b=_0x5f238b-0x0;var _0x253c17=_0x1776[_0x5f238b];return _0x253c17;};'use strict';var Sequelize=require(_0x6177('0x0'));module[_0x6177('0x1')]={'network':{'type':Sequelize[_0x6177('0x2')]},'network_script':{'type':Sequelize[_0x6177('0x2')]},'request':{'type':Sequelize[_0x6177('0x2')]},'channel':{'type':Sequelize[_0x6177('0x2')]},'language':{'type':Sequelize[_0x6177('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6177('0x2')]},'version':{'type':Sequelize[_0x6177('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6177('0x2')]},'callingpres':{'type':Sequelize[_0x6177('0x2')]},'callingani2':{'type':Sequelize[_0x6177('0x2')]},'callington':{'type':Sequelize[_0x6177('0x2')]},'callingtns':{'type':Sequelize[_0x6177('0x2')]},'dnid':{'type':Sequelize[_0x6177('0x2')]},'rdnis':{'type':Sequelize[_0x6177('0x2')]},'context':{'type':Sequelize[_0x6177('0x2')]},'extension':{'type':Sequelize[_0x6177('0x2')]},'priority':{'type':Sequelize[_0x6177('0x2')]},'enhanced':{'type':Sequelize[_0x6177('0x2')]},'accountcode':{'type':Sequelize[_0x6177('0x2')]},'threadid':{'type':Sequelize[_0x6177('0x2')]},'project_name':{'type':Sequelize[_0x6177('0x2')]},'joinAt':{'type':Sequelize[_0x6177('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x6177('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 63b7d45..cc25af9 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 _0x3a7b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','SquareReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','include','catch','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x12abef,_0x30e20c){var _0x4c84bc=function(_0x467e01){while(--_0x467e01){_0x12abef['push'](_0x12abef['shift']());}};_0x4c84bc(++_0x30e20c);}(_0x3a7b,0x1d2));var _0xb3a7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3a7b[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xb3a7('0x0'));var rimraf=require(_0xb3a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3a7('0x2'));var rp=require(_0xb3a7('0x3'));var moment=require(_0xb3a7('0x4'));var BPromise=require(_0xb3a7('0x5'));var Mustache=require(_0xb3a7('0x6'));var util=require(_0xb3a7('0x7'));var path=require(_0xb3a7('0x8'));var sox=require(_0xb3a7('0x9'));var csv=require(_0xb3a7('0xa'));var ejs=require(_0xb3a7('0xb'));var fs=require('fs');var fs_extra=require(_0xb3a7('0xc'));var _=require(_0xb3a7('0xd'));var squel=require(_0xb3a7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb3a7('0xf'));var toCsv=require(_0xb3a7('0xa'));var querystring=require(_0xb3a7('0x10'));var Papa=require(_0xb3a7('0x11'));var Redis=require(_0xb3a7('0x12'));var authService=require(_0xb3a7('0x13'));var qs=require(_0xb3a7('0x14'));var as=require(_0xb3a7('0x15'));var hardwareService=require(_0xb3a7('0x16'));var logger=require(_0xb3a7('0x17'))(_0xb3a7('0x18'));var utils=require(_0xb3a7('0x19'));var config=require(_0xb3a7('0x1a'));var licenseUtil=require(_0xb3a7('0x1b'));var db=require(_0xb3a7('0x1c'))['db'];function respondWithStatusCode(_0xbbceea,_0x50fe51){_0x50fe51=_0x50fe51||0xcc;return function(_0x173cd5){if(_0x173cd5){return _0xbbceea[_0xb3a7('0x1d')](_0x50fe51);}return _0xbbceea[_0xb3a7('0x1e')](_0x50fe51)[_0xb3a7('0x1f')]();};}function respondWithResult(_0xb79758,_0x57511c){_0x57511c=_0x57511c||0xc8;return function(_0x481033){if(_0x481033){return _0xb79758[_0xb3a7('0x1e')](_0x57511c)['json'](_0x481033);}};}function respondWithFilteredResult(_0x481944,_0x281049){return function(_0x3fe693){if(_0x3fe693){var _0xe76732=typeof _0x281049[_0xb3a7('0x20')]===_0xb3a7('0x21')&&typeof _0x281049[_0xb3a7('0x22')]===_0xb3a7('0x21');var _0x3c369f=_0x3fe693['count'];var _0x44a318=_0xe76732?0x0:_0x281049[_0xb3a7('0x20')];var _0x35b4f8=_0xe76732?_0x3fe693[_0xb3a7('0x23')]:_0x281049[_0xb3a7('0x20')]+_0x281049['limit'];var _0x3d3c56;if(_0x35b4f8>=_0x3c369f){_0x35b4f8=_0x3c369f;_0x3d3c56=0xc8;}else{_0x3d3c56=0xce;}_0x481944[_0xb3a7('0x1e')](_0x3d3c56);return _0x481944[_0xb3a7('0x24')](_0xb3a7('0x25'),_0x44a318+'-'+_0x35b4f8+'/'+_0x3c369f)['json'](_0x3fe693);}return null;};}function patchUpdates(_0x171ac9){return function(_0x265559){try{jsonpatch[_0xb3a7('0x26')](_0x265559,_0x171ac9,!![]);}catch(_0x31085d){return BPromise[_0xb3a7('0x27')](_0x31085d);}return _0x265559[_0xb3a7('0x28')]();};}function saveUpdates(_0x2c0027,_0x40d22c){return function(_0x4d6380){if(_0x4d6380){return _0x4d6380[_0xb3a7('0x29')](_0x2c0027)['then'](function(_0xa6d078){return _0xa6d078;});}return null;};}function removeEntity(_0x4a6892,_0x416390){return function(_0x1d19eb){if(_0x1d19eb){return _0x1d19eb[_0xb3a7('0x2a')]()[_0xb3a7('0x2b')](function(){_0x4a6892[_0xb3a7('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x120310,_0x57ffa9){return function(_0x4e30ea){if(!_0x4e30ea){_0x120310['sendStatus'](0x194);}return _0x4e30ea;};}function handleError(_0xeaa382,_0x489823){_0x489823=_0x489823||0x1f4;return function(_0x1e0353){logger[_0xb3a7('0x2c')](_0x1e0353[_0xb3a7('0x2d')]);if(_0x1e0353['name']){delete _0x1e0353[_0xb3a7('0x2e')];}_0xeaa382[_0xb3a7('0x1e')](_0x489823)[_0xb3a7('0x2f')](_0x1e0353);};}exports['index']=function(_0x58ea13,_0x5124d0){var _0x132e9f={},_0x47b37f={},_0x2c813a={'count':0x0,'rows':[]};var _0x17dec4=_['map'](db[_0xb3a7('0x30')][_0xb3a7('0x31')],function(_0x41725b){return{'name':_0x41725b[_0xb3a7('0x32')],'type':_0x41725b[_0xb3a7('0x33')]['key']};});_0x47b37f[_0xb3a7('0x34')]=_[_0xb3a7('0x35')](_0x17dec4,_0xb3a7('0x2e'));_0x47b37f[_0xb3a7('0x36')]=_[_0xb3a7('0x37')](_0x58ea13[_0xb3a7('0x36')]);_0x47b37f[_0xb3a7('0x38')]=_['intersection'](_0x47b37f[_0xb3a7('0x34')],_0x47b37f[_0xb3a7('0x36')]);_0x132e9f[_0xb3a7('0x39')]=_['intersection'](_0x47b37f['model'],qs['fields'](_0x58ea13['query'][_0xb3a7('0x3a')]));_0x132e9f[_0xb3a7('0x39')]=_0x132e9f[_0xb3a7('0x39')][_0xb3a7('0x3b')]?_0x132e9f[_0xb3a7('0x39')]:_0x47b37f[_0xb3a7('0x34')];if(!_0x58ea13[_0xb3a7('0x36')][_0xb3a7('0x3c')](_0xb3a7('0x3d'))){_0x132e9f[_0xb3a7('0x22')]=qs[_0xb3a7('0x22')](_0x58ea13['query'][_0xb3a7('0x22')]);_0x132e9f['offset']=qs['offset'](_0x58ea13[_0xb3a7('0x36')][_0xb3a7('0x20')]);}_0x132e9f['order']=qs[_0xb3a7('0x3e')](_0x58ea13['query'][_0xb3a7('0x3e')]);_0x132e9f[_0xb3a7('0x3f')]=qs['filters'](_[_0xb3a7('0x40')](_0x58ea13['query'],_0x47b37f[_0xb3a7('0x38')]),_0x17dec4);if(_0x58ea13[_0xb3a7('0x36')][_0xb3a7('0x41')]){_0x132e9f[_0xb3a7('0x3f')]=_[_0xb3a7('0x42')](_0x132e9f['where'],{'$or':_['map'](_0x17dec4,function(_0x2abd94){if(_0x2abd94[_0xb3a7('0x33')]!==_0xb3a7('0x43')){var _0x4bef0d={};_0x4bef0d[_0x2abd94[_0xb3a7('0x2e')]]={'$like':'%'+_0x58ea13[_0xb3a7('0x36')][_0xb3a7('0x41')]+'%'};return _0x4bef0d;}})});}_0x132e9f=_[_0xb3a7('0x42')]({},_0x132e9f,_0x58ea13[_0xb3a7('0x44')]);var _0x215d72={'where':_0x132e9f['where']};return db[_0xb3a7('0x30')][_0xb3a7('0x23')](_0x215d72)[_0xb3a7('0x2b')](function(_0x4db628){_0x2c813a['count']=_0x4db628;if(_0x58ea13['query'][_0xb3a7('0x45')]){_0x132e9f['include']=[{'all':!![]}];}return db[_0xb3a7('0x30')][_0xb3a7('0x46')](_0x132e9f);})[_0xb3a7('0x2b')](function(_0x31765e){_0x2c813a[_0xb3a7('0x47')]=_0x31765e;return _0x2c813a;})['then'](respondWithFilteredResult(_0x5124d0,_0x132e9f))['catch'](handleError(_0x5124d0,null));};exports[_0xb3a7('0x48')]=function(_0x29e058,_0x3ecae2){var _0x32018f={'raw':!![],'where':{'id':_0x29e058[_0xb3a7('0x49')]['id']}},_0x24de7f={};_0x24de7f[_0xb3a7('0x34')]=_[_0xb3a7('0x37')](db['SquareReport']['rawAttributes']);_0x24de7f[_0xb3a7('0x36')]=_[_0xb3a7('0x37')](_0x29e058['query']);_0x24de7f['filters']=_[_0xb3a7('0x4a')](_0x24de7f['model'],_0x24de7f[_0xb3a7('0x36')]);_0x32018f[_0xb3a7('0x39')]=_[_0xb3a7('0x4a')](_0x24de7f['model'],qs['fields'](_0x29e058[_0xb3a7('0x36')]['fields']));_0x32018f[_0xb3a7('0x39')]=_0x32018f[_0xb3a7('0x39')]['length']?_0x32018f['attributes']:_0x24de7f['model'];if(_0x29e058[_0xb3a7('0x36')][_0xb3a7('0x45')]){_0x32018f[_0xb3a7('0x4b')]=[{'all':!![]}];}_0x32018f=_[_0xb3a7('0x42')]({},_0x32018f,_0x29e058['options']);return db[_0xb3a7('0x30')]['find'](_0x32018f)[_0xb3a7('0x2b')](handleEntityNotFound(_0x3ecae2,null))[_0xb3a7('0x2b')](respondWithResult(_0x3ecae2,null))[_0xb3a7('0x4c')](handleError(_0x3ecae2,null));};exports[_0xb3a7('0x4d')]=function(_0x4e5e09,_0x3f1f10){return db[_0xb3a7('0x30')][_0xb3a7('0x4d')](_0x4e5e09[_0xb3a7('0x4e')],{})[_0xb3a7('0x2b')](respondWithResult(_0x3f1f10,0xc9))[_0xb3a7('0x4c')](handleError(_0x3f1f10,null));};exports[_0xb3a7('0x29')]=function(_0x368efb,_0x3360b7){if(_0x368efb[_0xb3a7('0x4e')]['id']){delete _0x368efb[_0xb3a7('0x4e')]['id'];}return db[_0xb3a7('0x30')][_0xb3a7('0x4f')]({'where':{'id':_0x368efb[_0xb3a7('0x49')]['id']}})['then'](handleEntityNotFound(_0x3360b7,null))[_0xb3a7('0x2b')](saveUpdates(_0x368efb[_0xb3a7('0x4e')],null))[_0xb3a7('0x2b')](respondWithResult(_0x3360b7,null))[_0xb3a7('0x4c')](handleError(_0x3360b7,null));};exports['destroy']=function(_0x57025d,_0x1fb82b){return db[_0xb3a7('0x30')]['find']({'where':{'id':_0x57025d['params']['id']}})[_0xb3a7('0x2b')](handleEntityNotFound(_0x1fb82b,null))[_0xb3a7('0x2b')](removeEntity(_0x1fb82b,null))[_0xb3a7('0x4c')](handleError(_0x1fb82b,null));};exports[_0xb3a7('0x50')]=function(_0x115341,_0x9075d8){return db['SquareReport'][_0xb3a7('0x50')]()[_0xb3a7('0x2b')](respondWithResult(_0x9075d8,null))[_0xb3a7('0x4c')](handleError(_0x9075d8,null));}; \ No newline at end of file +var _0x6db6=['fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6db6,0xea));var _0x66db=function(_0x38c610,_0x36be14){_0x38c610=_0x38c610-0x0;var _0x5f3698=_0x6db6[_0x38c610];return _0x5f3698;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66db('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x66db('0x2'));var Mustache=require(_0x66db('0x3'));var util=require(_0x66db('0x4'));var path=require(_0x66db('0x5'));var sox=require(_0x66db('0x6'));var csv=require(_0x66db('0x7'));var ejs=require(_0x66db('0x8'));var fs=require('fs');var fs_extra=require(_0x66db('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66db('0xa'));var deskjs=require(_0x66db('0xb'));var toCsv=require(_0x66db('0x7'));var querystring=require('querystring');var Papa=require(_0x66db('0xc'));var Redis=require(_0x66db('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66db('0xe'));var hardwareService=require(_0x66db('0xf'));var logger=require(_0x66db('0x10'))('api');var utils=require(_0x66db('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x66db('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34dae5,_0x31108c){_0x31108c=_0x31108c||0xcc;return function(_0x573ece){if(_0x573ece){return _0x34dae5[_0x66db('0x13')](_0x31108c);}return _0x34dae5[_0x66db('0x14')](_0x31108c)[_0x66db('0x15')]();};}function respondWithResult(_0x3b01db,_0x1b6dfb){_0x1b6dfb=_0x1b6dfb||0xc8;return function(_0x54da69){if(_0x54da69){return _0x3b01db[_0x66db('0x14')](_0x1b6dfb)[_0x66db('0x16')](_0x54da69);}};}function respondWithFilteredResult(_0x5c9122,_0x1ddd44){return function(_0x3928c8){if(_0x3928c8){var _0x287cf1=typeof _0x1ddd44[_0x66db('0x17')]===_0x66db('0x18')&&typeof _0x1ddd44[_0x66db('0x19')]===_0x66db('0x18');var _0x52122c=_0x3928c8[_0x66db('0x1a')];var _0x1d7ff8=_0x287cf1?0x0:_0x1ddd44[_0x66db('0x17')];var _0xa3b88c=_0x287cf1?_0x3928c8[_0x66db('0x1a')]:_0x1ddd44[_0x66db('0x17')]+_0x1ddd44[_0x66db('0x19')];var _0x5e88c3;if(_0xa3b88c>=_0x52122c){_0xa3b88c=_0x52122c;_0x5e88c3=0xc8;}else{_0x5e88c3=0xce;}_0x5c9122[_0x66db('0x14')](_0x5e88c3);return _0x5c9122[_0x66db('0x1b')](_0x66db('0x1c'),_0x1d7ff8+'-'+_0xa3b88c+'/'+_0x52122c)[_0x66db('0x16')](_0x3928c8);}return null;};}function patchUpdates(_0x3ea786){return function(_0x4911e4){try{jsonpatch[_0x66db('0x1d')](_0x4911e4,_0x3ea786,!![]);}catch(_0x3d34c7){return BPromise[_0x66db('0x1e')](_0x3d34c7);}return _0x4911e4[_0x66db('0x1f')]();};}function saveUpdates(_0x18246d,_0x36830b){return function(_0x22a99d){if(_0x22a99d){return _0x22a99d[_0x66db('0x20')](_0x18246d)[_0x66db('0x21')](function(_0x249b11){return _0x249b11;});}return null;};}function removeEntity(_0x28dd67,_0x13cc46){return function(_0x3f775a){if(_0x3f775a){return _0x3f775a[_0x66db('0x22')]()[_0x66db('0x21')](function(){_0x28dd67['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2517d5,_0x2ba1c0){return function(_0x1ec294){if(!_0x1ec294){_0x2517d5[_0x66db('0x13')](0x194);}return _0x1ec294;};}function handleError(_0x44f100,_0x545464){_0x545464=_0x545464||0x1f4;return function(_0x3c9b87){logger[_0x66db('0x23')](_0x3c9b87[_0x66db('0x24')]);if(_0x3c9b87[_0x66db('0x25')]){delete _0x3c9b87[_0x66db('0x25')];}_0x44f100[_0x66db('0x14')](_0x545464)[_0x66db('0x26')](_0x3c9b87);};}exports[_0x66db('0x27')]=function(_0x1d2966,_0x42a7e6){var _0x29918d={},_0x516053={},_0x36a1e2={'count':0x0,'rows':[]};var _0x36b305=_[_0x66db('0x28')](db[_0x66db('0x29')]['rawAttributes'],function(_0xd0d91d){return{'name':_0xd0d91d['fieldName'],'type':_0xd0d91d[_0x66db('0x2a')][_0x66db('0x2b')]};});_0x516053[_0x66db('0x2c')]=_[_0x66db('0x28')](_0x36b305,_0x66db('0x25'));_0x516053[_0x66db('0x2d')]=_[_0x66db('0x2e')](_0x1d2966[_0x66db('0x2d')]);_0x516053[_0x66db('0x2f')]=_[_0x66db('0x30')](_0x516053['model'],_0x516053['query']);_0x29918d[_0x66db('0x31')]=_[_0x66db('0x30')](_0x516053[_0x66db('0x2c')],qs[_0x66db('0x32')](_0x1d2966[_0x66db('0x2d')][_0x66db('0x32')]));_0x29918d[_0x66db('0x31')]=_0x29918d[_0x66db('0x31')][_0x66db('0x33')]?_0x29918d[_0x66db('0x31')]:_0x516053[_0x66db('0x2c')];if(!_0x1d2966['query']['hasOwnProperty']('nolimit')){_0x29918d['limit']=qs[_0x66db('0x19')](_0x1d2966[_0x66db('0x2d')][_0x66db('0x19')]);_0x29918d[_0x66db('0x17')]=qs[_0x66db('0x17')](_0x1d2966['query'][_0x66db('0x17')]);}_0x29918d[_0x66db('0x34')]=qs[_0x66db('0x35')](_0x1d2966[_0x66db('0x2d')]['sort']);_0x29918d[_0x66db('0x36')]=qs[_0x66db('0x2f')](_[_0x66db('0x37')](_0x1d2966['query'],_0x516053[_0x66db('0x2f')]),_0x36b305);if(_0x1d2966[_0x66db('0x2d')][_0x66db('0x38')]){_0x29918d[_0x66db('0x36')]=_[_0x66db('0x39')](_0x29918d[_0x66db('0x36')],{'$or':_[_0x66db('0x28')](_0x36b305,function(_0x271d1b){if(_0x271d1b[_0x66db('0x2a')]!==_0x66db('0x3a')){var _0x2b1550={};_0x2b1550[_0x271d1b[_0x66db('0x25')]]={'$like':'%'+_0x1d2966['query'][_0x66db('0x38')]+'%'};return _0x2b1550;}})});}_0x29918d=_[_0x66db('0x39')]({},_0x29918d,_0x1d2966[_0x66db('0x3b')]);var _0x3dcfd6={'where':_0x29918d[_0x66db('0x36')]};return db[_0x66db('0x29')][_0x66db('0x1a')](_0x3dcfd6)[_0x66db('0x21')](function(_0x4621f1){_0x36a1e2[_0x66db('0x1a')]=_0x4621f1;if(_0x1d2966[_0x66db('0x2d')][_0x66db('0x3c')]){_0x29918d[_0x66db('0x3d')]=[{'all':!![]}];}return db[_0x66db('0x29')]['findAll'](_0x29918d);})[_0x66db('0x21')](function(_0xb4472){_0x36a1e2[_0x66db('0x3e')]=_0xb4472;return _0x36a1e2;})['then'](respondWithFilteredResult(_0x42a7e6,_0x29918d))[_0x66db('0x3f')](handleError(_0x42a7e6,null));};exports[_0x66db('0x40')]=function(_0x459390,_0x3f90b6){var _0x4ef345={'raw':!![],'where':{'id':_0x459390[_0x66db('0x41')]['id']}},_0x282cf3={};_0x282cf3[_0x66db('0x2c')]=_['keys'](db[_0x66db('0x29')][_0x66db('0x42')]);_0x282cf3[_0x66db('0x2d')]=_[_0x66db('0x2e')](_0x459390[_0x66db('0x2d')]);_0x282cf3[_0x66db('0x2f')]=_['intersection'](_0x282cf3[_0x66db('0x2c')],_0x282cf3[_0x66db('0x2d')]);_0x4ef345[_0x66db('0x31')]=_[_0x66db('0x30')](_0x282cf3[_0x66db('0x2c')],qs['fields'](_0x459390[_0x66db('0x2d')][_0x66db('0x32')]));_0x4ef345[_0x66db('0x31')]=_0x4ef345[_0x66db('0x31')][_0x66db('0x33')]?_0x4ef345[_0x66db('0x31')]:_0x282cf3['model'];if(_0x459390[_0x66db('0x2d')]['includeAll']){_0x4ef345[_0x66db('0x3d')]=[{'all':!![]}];}_0x4ef345=_[_0x66db('0x39')]({},_0x4ef345,_0x459390[_0x66db('0x3b')]);return db['SquareReport']['find'](_0x4ef345)[_0x66db('0x21')](handleEntityNotFound(_0x3f90b6,null))[_0x66db('0x21')](respondWithResult(_0x3f90b6,null))['catch'](handleError(_0x3f90b6,null));};exports[_0x66db('0x43')]=function(_0x5caa54,_0x2c895e){return db['SquareReport']['create'](_0x5caa54[_0x66db('0x44')],{})[_0x66db('0x21')](respondWithResult(_0x2c895e,0xc9))[_0x66db('0x3f')](handleError(_0x2c895e,null));};exports[_0x66db('0x20')]=function(_0x59fe58,_0x1a9917){if(_0x59fe58[_0x66db('0x44')]['id']){delete _0x59fe58['body']['id'];}return db['SquareReport'][_0x66db('0x45')]({'where':{'id':_0x59fe58[_0x66db('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a9917,null))[_0x66db('0x21')](saveUpdates(_0x59fe58[_0x66db('0x44')],null))['then'](respondWithResult(_0x1a9917,null))[_0x66db('0x3f')](handleError(_0x1a9917,null));};exports[_0x66db('0x22')]=function(_0x38bde4,_0x2a8073){return db[_0x66db('0x29')][_0x66db('0x45')]({'where':{'id':_0x38bde4['params']['id']}})[_0x66db('0x21')](handleEntityNotFound(_0x2a8073,null))[_0x66db('0x21')](removeEntity(_0x2a8073,null))[_0x66db('0x3f')](handleError(_0x2a8073,null));};exports[_0x66db('0x46')]=function(_0x569985,_0x558aa5){return db[_0x66db('0x29')][_0x66db('0x46')]()[_0x66db('0x21')](respondWithResult(_0x558aa5,null))[_0x66db('0x3f')](handleError(_0x558aa5,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1b19996..d65e257 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 _0xa166=['moment','bluebird','rimraf','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','api'];(function(_0x4b6fb7,_0x1536c9){var _0xfa1543=function(_0x2ae5c3){while(--_0x2ae5c3){_0x4b6fb7['push'](_0x4b6fb7['shift']());}};_0xfa1543(++_0x1536c9);}(_0xa166,0xc1));var _0x6a16=function(_0x30abde,_0x21670c){_0x30abde=_0x30abde-0x0;var _0x368149=_0xa166[_0x30abde];return _0x368149;};'use strict';var _=require(_0x6a16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6a16('0x1'));var moment=require(_0x6a16('0x2'));var BPromise=require(_0x6a16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6a16('0x4'));var config=require('../../config/environment');var attributes=require(_0x6a16('0x5'));module[_0x6a16('0x6')]=function(_0x45be3e,_0x3cc46b){return _0x45be3e['define'](_0x6a16('0x7'),attributes,{'tableName':_0x6a16('0x8'),'paranoid':![],'indexes':[{'name':_0x6a16('0x9'),'fields':[_0x6a16('0xa'),_0x6a16('0xb')]},{'name':_0x6a16('0xc'),'fields':[_0x6a16('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x59c3=['../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','api','moment','bluebird','path','rimraf'];(function(_0x5e2a72,_0x725538){var _0x401b4d=function(_0x3f9ca5){while(--_0x3f9ca5){_0x5e2a72['push'](_0x5e2a72['shift']());}};_0x401b4d(++_0x725538);}(_0x59c3,0x181));var _0x359c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x59c3[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x359c('0x0'));var moment=require(_0x359c('0x1'));var BPromise=require(_0x359c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x359c('0x3'));var rimraf=require(_0x359c('0x4'));var config=require(_0x359c('0x5'));var attributes=require(_0x359c('0x6'));module[_0x359c('0x7')]=function(_0x4dcd5a,_0x1aee2d){return _0x4dcd5a[_0x359c('0x8')](_0x359c('0x9'),attributes,{'tableName':_0x359c('0xa'),'paranoid':![],'indexes':[{'name':_0x359c('0xb'),'fields':[_0x359c('0xc'),_0x359c('0xd')]},{'name':_0x359c('0xe'),'fields':[_0x359c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 790d7f1..97de4f0 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 _0xb7e5=['client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','SquareReport','options','raw','then','CreateSquareReport','body','limit','debug','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xb7e5,0x1de));var _0x5b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5b7e('0x0'));var util=require(_0x5b7e('0x1'));var moment=require(_0x5b7e('0x2'));var BPromise=require(_0x5b7e('0x3'));var rs=require(_0x5b7e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b7e('0x5'))(_0x5b7e('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b7e('0x7'));var client=jayson[_0x5b7e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173dd6,_0x109356,_0x433aad){return new BPromise(function(_0x36b529,_0x23ea1e){return client[_0x5b7e('0x9')](_0x173dd6,_0x433aad)['then'](function(_0x15ed58){logger[_0x5b7e('0xa')](_0x5b7e('0xb'),_0x109356,_0x5b7e('0xc'));logger['debug'](_0x5b7e('0xd'),_0x109356,_0x5b7e('0xc'),JSON['stringify'](_0x15ed58));if(_0x15ed58[_0x5b7e('0xe')]){if(_0x15ed58['error']['code']===0x1f4){logger[_0x5b7e('0xe')](_0x5b7e('0xb'),_0x109356,_0x15ed58['error'][_0x5b7e('0xf')]);return _0x23ea1e(_0x15ed58['error']['message']);}logger[_0x5b7e('0xe')](_0x5b7e('0xb'),_0x109356,_0x15ed58[_0x5b7e('0xe')][_0x5b7e('0xf')]);return _0x36b529(_0x15ed58[_0x5b7e('0xe')][_0x5b7e('0xf')]);}else{logger[_0x5b7e('0xa')](_0x5b7e('0xb'),_0x109356,_0x5b7e('0xc'));_0x36b529(_0x15ed58[_0x5b7e('0x10')][_0x5b7e('0xf')]);}})[_0x5b7e('0x11')](function(_0x5bad7c){logger[_0x5b7e('0xe')](_0x5b7e('0xb'),_0x109356,_0x5bad7c);_0x23ea1e(_0x5bad7c);});});}exports['CreateSquareReport']=function(_0x5304c7){var _0x308ca5=this;return new Promise(function(_0x5370d0,_0x528f35){return db[_0x5b7e('0x12')]['create'](_0x5304c7['body'],{'raw':_0x5304c7[_0x5b7e('0x13')]?_0x5304c7[_0x5b7e('0x13')][_0x5b7e('0x14')]===undefined?!![]:![]:!![]})[_0x5b7e('0x15')](function(_0x2f0848){logger[_0x5b7e('0xa')]('CreateSquareReport',_0x5304c7);logger['debug'](_0x5b7e('0x16'),_0x5304c7,JSON['stringify'](_0x2f0848));_0x5370d0(_0x2f0848);})['catch'](function(_0x5cdb86){logger['error']('CreateSquareReport',_0x5cdb86[_0x5b7e('0xf')],_0x5304c7);_0x528f35(_0x308ca5[_0x5b7e('0xe')](0x1f4,_0x5cdb86[_0x5b7e('0xf')]));});});};exports['UpdateSquareReport']=function(_0x2e13e1){var _0x4ddfb4=this;return new Promise(function(_0x2bd063,_0x5b0af2){return db['SquareReport']['update'](_0x2e13e1[_0x5b7e('0x17')],{'raw':_0x2e13e1['options']?_0x2e13e1['options'][_0x5b7e('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e13e1[_0x5b7e('0x13')]?_0x2e13e1[_0x5b7e('0x13')]['where']||null:null,'attributes':_0x2e13e1[_0x5b7e('0x13')]?_0x2e13e1['options']['attributes']||null:null,'limit':_0x2e13e1[_0x5b7e('0x13')]?_0x2e13e1[_0x5b7e('0x13')][_0x5b7e('0x18')]||null:null})[_0x5b7e('0x15')](function(_0xed8daf){logger[_0x5b7e('0xa')]('UpdateSquareReport',_0x2e13e1);logger[_0x5b7e('0x19')](_0x5b7e('0x1a'),_0x2e13e1,JSON['stringify'](_0xed8daf));_0x2bd063(_0xed8daf);})['catch'](function(_0x52cd01){logger[_0x5b7e('0xe')](_0x5b7e('0x1a'),_0x52cd01[_0x5b7e('0xf')],_0x2e13e1);_0x5b0af2(_0x4ddfb4[_0x5b7e('0xe')](0x1f4,_0x52cd01[_0x5b7e('0xf')]));});});}; \ No newline at end of file +var _0x4018=['update','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','create','options','raw','then','debug','SquareReport'];(function(_0x273873,_0x1853fa){var _0x42f50b=function(_0x2e2248){while(--_0x2e2248){_0x273873['push'](_0x273873['shift']());}};_0x42f50b(++_0x1853fa);}(_0x4018,0xcf));var _0x8401=function(_0x415e7b,_0x1214e7){_0x415e7b=_0x415e7b-0x0;var _0x14bd6f=_0x4018[_0x415e7b];return _0x14bd6f;};'use strict';var _=require(_0x8401('0x0'));var util=require(_0x8401('0x1'));var moment=require(_0x8401('0x2'));var BPromise=require(_0x8401('0x3'));var rs=require(_0x8401('0x4'));var fs=require('fs');var Redis=require(_0x8401('0x5'));var db=require(_0x8401('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8401('0x7'));var config=require('../../config/environment');var jayson=require(_0x8401('0x8'));var client=jayson['client'][_0x8401('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7ff24a,_0x26b842,_0x4769b9){return new BPromise(function(_0x125de8,_0x5a14fc){return client['request'](_0x7ff24a,_0x4769b9)['then'](function(_0x194e17){logger[_0x8401('0xa')](_0x8401('0xb'),_0x26b842,_0x8401('0xc'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x26b842,_0x8401('0xc'),JSON[_0x8401('0xd')](_0x194e17));if(_0x194e17['error']){if(_0x194e17[_0x8401('0xe')]['code']===0x1f4){logger['error'](_0x8401('0xb'),_0x26b842,_0x194e17[_0x8401('0xe')][_0x8401('0xf')]);return _0x5a14fc(_0x194e17[_0x8401('0xe')][_0x8401('0xf')]);}logger[_0x8401('0xe')](_0x8401('0xb'),_0x26b842,_0x194e17[_0x8401('0xe')][_0x8401('0xf')]);return _0x125de8(_0x194e17[_0x8401('0xe')][_0x8401('0xf')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x26b842,'request\x20sent');_0x125de8(_0x194e17[_0x8401('0x10')]['message']);}})[_0x8401('0x11')](function(_0x5389cf){logger[_0x8401('0xe')](_0x8401('0xb'),_0x26b842,_0x5389cf);_0x5a14fc(_0x5389cf);});});}exports[_0x8401('0x12')]=function(_0x81eec3){var _0x31fe91=this;return new Promise(function(_0x24279c,_0x2cd655){return db['SquareReport'][_0x8401('0x13')](_0x81eec3['body'],{'raw':_0x81eec3[_0x8401('0x14')]?_0x81eec3[_0x8401('0x14')][_0x8401('0x15')]===undefined?!![]:![]:!![]})[_0x8401('0x16')](function(_0x56bcc2){logger[_0x8401('0xa')]('CreateSquareReport',_0x81eec3);logger[_0x8401('0x17')](_0x8401('0x12'),_0x81eec3,JSON[_0x8401('0xd')](_0x56bcc2));_0x24279c(_0x56bcc2);})[_0x8401('0x11')](function(_0xe4694d){logger['error'](_0x8401('0x12'),_0xe4694d[_0x8401('0xf')],_0x81eec3);_0x2cd655(_0x31fe91[_0x8401('0xe')](0x1f4,_0xe4694d[_0x8401('0xf')]));});});};exports['UpdateSquareReport']=function(_0x408370){var _0x31b6e8=this;return new Promise(function(_0xa675b1,_0x3fa13){return db[_0x8401('0x18')][_0x8401('0x19')](_0x408370['body'],{'raw':_0x408370[_0x8401('0x14')]?_0x408370[_0x8401('0x14')][_0x8401('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x408370['options']?_0x408370[_0x8401('0x14')]['where']||null:null,'attributes':_0x408370[_0x8401('0x14')]?_0x408370['options'][_0x8401('0x1a')]||null:null,'limit':_0x408370[_0x8401('0x14')]?_0x408370['options'][_0x8401('0x1b')]||null:null})[_0x8401('0x16')](function(_0x40f429){logger[_0x8401('0xa')](_0x8401('0x1c'),_0x408370);logger[_0x8401('0x17')](_0x8401('0x1c'),_0x408370,JSON[_0x8401('0xd')](_0x40f429));_0xa675b1(_0x40f429);})[_0x8401('0x11')](function(_0x6b26c5){logger[_0x8401('0xe')](_0x8401('0x1c'),_0x6b26c5['message'],_0x408370);_0x3fa13(_0x31b6e8[_0x8401('0xe')](0x1f4,_0x6b26c5['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ef35d56..f365612 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 _0x3bb9=['/:id','post','create','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x42cb74,_0xd030f0){var _0x264737=function(_0x4ac595){while(--_0x4ac595){_0x42cb74['push'](_0x42cb74['shift']());}};_0x264737(++_0xd030f0);}(_0x3bb9,0x1e1));var _0x93bb=function(_0x366279,_0x209a2b){_0x366279=_0x366279-0x0;var _0x3d11b1=_0x3bb9[_0x366279];return _0x3d11b1;};'use strict';var multer=require('multer');var util=require(_0x93bb('0x0'));var path=require('path');var timeout=require(_0x93bb('0x1'));var express=require(_0x93bb('0x2'));var router=express[_0x93bb('0x3')]();var fs_extra=require(_0x93bb('0x4'));var auth=require(_0x93bb('0x5'));var interaction=require(_0x93bb('0x6'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x93bb('0x7')]('/',auth[_0x93bb('0x8')](),controller[_0x93bb('0x9')]);router[_0x93bb('0x7')](_0x93bb('0xa'),auth[_0x93bb('0x8')](),controller[_0x93bb('0xb')]);router[_0x93bb('0x7')](_0x93bb('0xc'),auth[_0x93bb('0x8')](),controller['show']);router[_0x93bb('0xd')]('/',auth[_0x93bb('0x8')](),controller[_0x93bb('0xe')]);router['put']('/:id',auth[_0x93bb('0x8')](),controller['update']);router['delete'](_0x93bb('0xc'),auth[_0x93bb('0x8')](),controller[_0x93bb('0xf')]);module[_0x93bb('0x10')]=router; \ No newline at end of file +var _0xf786=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','/:id','isAuthenticated','create','put','update','delete'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xf786,0x156));var _0x6f78=function(_0x27c188,_0x28f37d){_0x27c188=_0x27c188-0x0;var _0x4b3717=_0xf786[_0x27c188];return _0x4b3717;};'use strict';var multer=require(_0x6f78('0x0'));var util=require(_0x6f78('0x1'));var path=require('path');var timeout=require(_0x6f78('0x2'));var express=require(_0x6f78('0x3'));var router=express[_0x6f78('0x4')]();var fs_extra=require(_0x6f78('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6f78('0x6'));var config=require(_0x6f78('0x7'));var controller=require(_0x6f78('0x8'));router[_0x6f78('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f78('0xa')]);router[_0x6f78('0x9')](_0x6f78('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6f78('0x9')](_0x6f78('0xc'),auth[_0x6f78('0xd')](),controller['show']);router['post']('/',auth[_0x6f78('0xd')](),controller[_0x6f78('0xe')]);router[_0x6f78('0xf')](_0x6f78('0xc'),auth[_0x6f78('0xd')](),controller[_0x6f78('0x10')]);router[_0x6f78('0x11')](_0x6f78('0xc'),auth[_0x6f78('0xd')](),controller[_0x6f78('0x12')]);module[_0x6f78('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index cd65dad..f15267a 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 _0x0225=['sequelize','exports','STRING','TEXT'];(function(_0x4ebe34,_0x392ae1){var _0x832bbe=function(_0x509f49){while(--_0x509f49){_0x4ebe34['push'](_0x4ebe34['shift']());}};_0x832bbe(++_0x392ae1);}(_0x0225,0x1dc));var _0x5022=function(_0x365296,_0x4a8e50){_0x365296=_0x365296-0x0;var _0x205033=_0x0225[_0x365296];return _0x205033;};'use strict';var Sequelize=require(_0x5022('0x0'));module[_0x5022('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x5022('0x2')]},'application':{'type':Sequelize[_0x5022('0x2')]},'data':{'type':Sequelize[_0x5022('0x3')]},'project_name':{'type':Sequelize[_0x5022('0x2')]},'callerid':{'type':Sequelize[_0x5022('0x2')]}}; \ No newline at end of file +var _0x7e67=['sequelize','STRING'];(function(_0x3f703b,_0xf546eb){var _0x5f358b=function(_0x2d3c5b){while(--_0x2d3c5b){_0x3f703b['push'](_0x3f703b['shift']());}};_0x5f358b(++_0xf546eb);}(_0x7e67,0x86));var _0x77e6=function(_0x412e5,_0x39732a){_0x412e5=_0x412e5-0x0;var _0x17ed00=_0x7e67[_0x412e5];return _0x17ed00;};'use strict';var Sequelize=require(_0x77e6('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x77e6('0x1')]},'node':{'type':Sequelize[_0x77e6('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'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 f19eb03..e94bb1e 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 _0xcfb3=['include','find','create','body','catch','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../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','index','map','SquareDetailsReport','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','merge','options','includeAll','findAll','show','params','rawAttributes'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0xcfb3,0x168));var _0x3cfb=function(_0x1c01fa,_0x8a5a1e){_0x1c01fa=_0x1c01fa-0x0;var _0x21591a=_0xcfb3[_0x1c01fa];return _0x21591a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3cfb('0x0'));var jsonpatch=require(_0x3cfb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3cfb('0x2'));var Mustache=require(_0x3cfb('0x3'));var util=require(_0x3cfb('0x4'));var path=require('path');var sox=require(_0x3cfb('0x5'));var csv=require('to-csv');var ejs=require(_0x3cfb('0x6'));var fs=require('fs');var fs_extra=require(_0x3cfb('0x7'));var _=require('lodash');var squel=require(_0x3cfb('0x8'));var crypto=require(_0x3cfb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3cfb('0xa'));var toCsv=require(_0x3cfb('0xb'));var querystring=require('querystring');var Papa=require(_0x3cfb('0xc'));var Redis=require(_0x3cfb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3cfb('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cfb('0xf'));var logger=require(_0x3cfb('0x10'))('api');var utils=require(_0x3cfb('0x11'));var config=require(_0x3cfb('0x12'));var licenseUtil=require(_0x3cfb('0x13'));var db=require(_0x3cfb('0x14'))['db'];function respondWithStatusCode(_0x2d614c,_0x2670ba){_0x2670ba=_0x2670ba||0xcc;return function(_0x5b97a6){if(_0x5b97a6){return _0x2d614c[_0x3cfb('0x15')](_0x2670ba);}return _0x2d614c[_0x3cfb('0x16')](_0x2670ba)[_0x3cfb('0x17')]();};}function respondWithResult(_0x470cdb,_0x4a0465){_0x4a0465=_0x4a0465||0xc8;return function(_0x4ad0d8){if(_0x4ad0d8){return _0x470cdb[_0x3cfb('0x16')](_0x4a0465)[_0x3cfb('0x18')](_0x4ad0d8);}};}function respondWithFilteredResult(_0x4bb100,_0x5424e7){return function(_0x2b6e1a){if(_0x2b6e1a){var _0x92e655=typeof _0x5424e7[_0x3cfb('0x19')]===_0x3cfb('0x1a')&&typeof _0x5424e7['limit']==='undefined';var _0xce372d=_0x2b6e1a[_0x3cfb('0x1b')];var _0x15e9a3=_0x92e655?0x0:_0x5424e7[_0x3cfb('0x19')];var _0x137646=_0x92e655?_0x2b6e1a[_0x3cfb('0x1b')]:_0x5424e7[_0x3cfb('0x19')]+_0x5424e7[_0x3cfb('0x1c')];var _0x39a4fb;if(_0x137646>=_0xce372d){_0x137646=_0xce372d;_0x39a4fb=0xc8;}else{_0x39a4fb=0xce;}_0x4bb100[_0x3cfb('0x16')](_0x39a4fb);return _0x4bb100[_0x3cfb('0x1d')](_0x3cfb('0x1e'),_0x15e9a3+'-'+_0x137646+'/'+_0xce372d)['json'](_0x2b6e1a);}return null;};}function patchUpdates(_0x527084){return function(_0x18500d){try{jsonpatch[_0x3cfb('0x1f')](_0x18500d,_0x527084,!![]);}catch(_0x11a939){return BPromise['reject'](_0x11a939);}return _0x18500d[_0x3cfb('0x20')]();};}function saveUpdates(_0x532661,_0x373a6c){return function(_0x10f4db){if(_0x10f4db){return _0x10f4db[_0x3cfb('0x21')](_0x532661)[_0x3cfb('0x22')](function(_0x131692){return _0x131692;});}return null;};}function removeEntity(_0x27ae9e,_0x4b5c4b){return function(_0x4a2d6e){if(_0x4a2d6e){return _0x4a2d6e[_0x3cfb('0x23')]()[_0x3cfb('0x22')](function(){_0x27ae9e[_0x3cfb('0x16')](0xcc)[_0x3cfb('0x17')]();});}};}function handleEntityNotFound(_0x19a2b8,_0x13dba6){return function(_0x4c7149){if(!_0x4c7149){_0x19a2b8['sendStatus'](0x194);}return _0x4c7149;};}function handleError(_0x8e1e91,_0xb7c9e6){_0xb7c9e6=_0xb7c9e6||0x1f4;return function(_0x464cd9){logger[_0x3cfb('0x24')](_0x464cd9[_0x3cfb('0x25')]);if(_0x464cd9[_0x3cfb('0x26')]){delete _0x464cd9[_0x3cfb('0x26')];}_0x8e1e91[_0x3cfb('0x16')](_0xb7c9e6)[_0x3cfb('0x27')](_0x464cd9);};}exports[_0x3cfb('0x28')]=function(_0x243d01,_0x1105d2){var _0x486c8a={},_0x13ab56={},_0x24119f={'count':0x0,'rows':[]};var _0x1d8def=_[_0x3cfb('0x29')](db[_0x3cfb('0x2a')]['rawAttributes'],function(_0x1c7672){return{'name':_0x1c7672[_0x3cfb('0x2b')],'type':_0x1c7672['type'][_0x3cfb('0x2c')]};});_0x13ab56['model']=_[_0x3cfb('0x29')](_0x1d8def,_0x3cfb('0x26'));_0x13ab56[_0x3cfb('0x2d')]=_[_0x3cfb('0x2e')](_0x243d01['query']);_0x13ab56[_0x3cfb('0x2f')]=_[_0x3cfb('0x30')](_0x13ab56['model'],_0x13ab56[_0x3cfb('0x2d')]);_0x486c8a[_0x3cfb('0x31')]=_[_0x3cfb('0x30')](_0x13ab56[_0x3cfb('0x32')],qs['fields'](_0x243d01[_0x3cfb('0x2d')][_0x3cfb('0x33')]));_0x486c8a[_0x3cfb('0x31')]=_0x486c8a[_0x3cfb('0x31')][_0x3cfb('0x34')]?_0x486c8a[_0x3cfb('0x31')]:_0x13ab56[_0x3cfb('0x32')];if(!_0x243d01[_0x3cfb('0x2d')][_0x3cfb('0x35')](_0x3cfb('0x36'))){_0x486c8a[_0x3cfb('0x1c')]=qs['limit'](_0x243d01[_0x3cfb('0x2d')][_0x3cfb('0x1c')]);_0x486c8a[_0x3cfb('0x19')]=qs[_0x3cfb('0x19')](_0x243d01[_0x3cfb('0x2d')]['offset']);}_0x486c8a['order']=qs['sort'](_0x243d01[_0x3cfb('0x2d')][_0x3cfb('0x37')]);_0x486c8a[_0x3cfb('0x38')]=qs[_0x3cfb('0x2f')](_['pick'](_0x243d01[_0x3cfb('0x2d')],_0x13ab56['filters']),_0x1d8def);if(_0x243d01[_0x3cfb('0x2d')]['filter']){_0x486c8a[_0x3cfb('0x38')]=_['merge'](_0x486c8a['where'],{'$or':_['map'](_0x1d8def,function(_0x44250c){if(_0x44250c[_0x3cfb('0x39')]!==_0x3cfb('0x3a')){var _0xd7402b={};_0xd7402b[_0x44250c[_0x3cfb('0x26')]]={'$like':'%'+_0x243d01['query']['filter']+'%'};return _0xd7402b;}})});}_0x486c8a=_[_0x3cfb('0x3b')]({},_0x486c8a,_0x243d01[_0x3cfb('0x3c')]);var _0x5721a1={'where':_0x486c8a[_0x3cfb('0x38')]};return db[_0x3cfb('0x2a')][_0x3cfb('0x1b')](_0x5721a1)[_0x3cfb('0x22')](function(_0x1ea672){_0x24119f[_0x3cfb('0x1b')]=_0x1ea672;if(_0x243d01[_0x3cfb('0x2d')][_0x3cfb('0x3d')]){_0x486c8a['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x3cfb('0x3e')](_0x486c8a);})[_0x3cfb('0x22')](function(_0x4afdab){_0x24119f['rows']=_0x4afdab;return _0x24119f;})[_0x3cfb('0x22')](respondWithFilteredResult(_0x1105d2,_0x486c8a))['catch'](handleError(_0x1105d2,null));};exports[_0x3cfb('0x3f')]=function(_0x5414c3,_0x128eec){var _0xd99993={'raw':!![],'where':{'id':_0x5414c3[_0x3cfb('0x40')]['id']}},_0x663435={};_0x663435[_0x3cfb('0x32')]=_[_0x3cfb('0x2e')](db[_0x3cfb('0x2a')][_0x3cfb('0x41')]);_0x663435[_0x3cfb('0x2d')]=_[_0x3cfb('0x2e')](_0x5414c3[_0x3cfb('0x2d')]);_0x663435['filters']=_['intersection'](_0x663435['model'],_0x663435[_0x3cfb('0x2d')]);_0xd99993[_0x3cfb('0x31')]=_[_0x3cfb('0x30')](_0x663435[_0x3cfb('0x32')],qs['fields'](_0x5414c3[_0x3cfb('0x2d')][_0x3cfb('0x33')]));_0xd99993['attributes']=_0xd99993[_0x3cfb('0x31')][_0x3cfb('0x34')]?_0xd99993[_0x3cfb('0x31')]:_0x663435[_0x3cfb('0x32')];if(_0x5414c3[_0x3cfb('0x2d')][_0x3cfb('0x3d')]){_0xd99993[_0x3cfb('0x42')]=[{'all':!![]}];}_0xd99993=_['merge']({},_0xd99993,_0x5414c3[_0x3cfb('0x3c')]);return db[_0x3cfb('0x2a')][_0x3cfb('0x43')](_0xd99993)[_0x3cfb('0x22')](handleEntityNotFound(_0x128eec,null))[_0x3cfb('0x22')](respondWithResult(_0x128eec,null))['catch'](handleError(_0x128eec,null));};exports[_0x3cfb('0x44')]=function(_0x592865,_0x4840cb){return db[_0x3cfb('0x2a')]['create'](_0x592865[_0x3cfb('0x45')],{})['then'](respondWithResult(_0x4840cb,0xc9))[_0x3cfb('0x46')](handleError(_0x4840cb,null));};exports[_0x3cfb('0x21')]=function(_0x5cfc98,_0x3ae5c1){if(_0x5cfc98['body']['id']){delete _0x5cfc98[_0x3cfb('0x45')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x5cfc98['params']['id']}})[_0x3cfb('0x22')](handleEntityNotFound(_0x3ae5c1,null))['then'](saveUpdates(_0x5cfc98[_0x3cfb('0x45')],null))[_0x3cfb('0x22')](respondWithResult(_0x3ae5c1,null))[_0x3cfb('0x46')](handleError(_0x3ae5c1,null));};exports[_0x3cfb('0x23')]=function(_0x3e0283,_0x4de165){return db[_0x3cfb('0x2a')]['find']({'where':{'id':_0x3e0283['params']['id']}})[_0x3cfb('0x22')](handleEntityNotFound(_0x4de165,null))[_0x3cfb('0x22')](removeEntity(_0x4de165,null))[_0x3cfb('0x46')](handleError(_0x4de165,null));};exports['describe']=function(_0x470f76,_0x3c89ad){return db['SquareDetailsReport']['describe']()[_0x3cfb('0x22')](respondWithResult(_0x3c89ad,null))[_0x3cfb('0x46')](handleError(_0x3c89ad,null));}; \ No newline at end of file +var _0x1fe8=['stack','name','send','index','map','SquareDetailsReport','rawAttributes','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','body','update','describe','eml-format','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error'];(function(_0xa8f776,_0x420cbf){var _0x435961=function(_0x241c69){while(--_0x241c69){_0xa8f776['push'](_0xa8f776['shift']());}};_0x435961(++_0x420cbf);}(_0x1fe8,0xb8));var _0x81fe=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1fe8[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x81fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x81fe('0x1'));var moment=require(_0x81fe('0x2'));var BPromise=require(_0x81fe('0x3'));var Mustache=require('mustache');var util=require(_0x81fe('0x4'));var path=require('path');var sox=require(_0x81fe('0x5'));var csv=require(_0x81fe('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x81fe('0x7'));var _=require(_0x81fe('0x8'));var squel=require(_0x81fe('0x9'));var crypto=require(_0x81fe('0xa'));var jsforce=require(_0x81fe('0xb'));var deskjs=require(_0x81fe('0xc'));var toCsv=require(_0x81fe('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x81fe('0xd'));var authService=require(_0x81fe('0xe'));var qs=require(_0x81fe('0xf'));var as=require(_0x81fe('0x10'));var hardwareService=require(_0x81fe('0x11'));var logger=require(_0x81fe('0x12'))('api');var utils=require(_0x81fe('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x81fe('0x14'));var db=require(_0x81fe('0x15'))['db'];function respondWithStatusCode(_0x1ce15f,_0x3f9826){_0x3f9826=_0x3f9826||0xcc;return function(_0x53ecd6){if(_0x53ecd6){return _0x1ce15f['sendStatus'](_0x3f9826);}return _0x1ce15f[_0x81fe('0x16')](_0x3f9826)[_0x81fe('0x17')]();};}function respondWithResult(_0x2ae290,_0x207154){_0x207154=_0x207154||0xc8;return function(_0x2d4328){if(_0x2d4328){return _0x2ae290[_0x81fe('0x16')](_0x207154)[_0x81fe('0x18')](_0x2d4328);}};}function respondWithFilteredResult(_0x4f2186,_0x3ac65b){return function(_0x3e1dcb){if(_0x3e1dcb){var _0x38e146=typeof _0x3ac65b[_0x81fe('0x19')]===_0x81fe('0x1a')&&typeof _0x3ac65b[_0x81fe('0x1b')]===_0x81fe('0x1a');var _0x256b20=_0x3e1dcb[_0x81fe('0x1c')];var _0x2bb564=_0x38e146?0x0:_0x3ac65b[_0x81fe('0x19')];var _0x35cef9=_0x38e146?_0x3e1dcb['count']:_0x3ac65b[_0x81fe('0x19')]+_0x3ac65b[_0x81fe('0x1b')];var _0x2d2cb8;if(_0x35cef9>=_0x256b20){_0x35cef9=_0x256b20;_0x2d2cb8=0xc8;}else{_0x2d2cb8=0xce;}_0x4f2186['status'](_0x2d2cb8);return _0x4f2186[_0x81fe('0x1d')](_0x81fe('0x1e'),_0x2bb564+'-'+_0x35cef9+'/'+_0x256b20)[_0x81fe('0x18')](_0x3e1dcb);}return null;};}function patchUpdates(_0x17b1ad){return function(_0x28ca44){try{jsonpatch[_0x81fe('0x1f')](_0x28ca44,_0x17b1ad,!![]);}catch(_0x405f66){return BPromise[_0x81fe('0x20')](_0x405f66);}return _0x28ca44[_0x81fe('0x21')]();};}function saveUpdates(_0x15d27e,_0x185137){return function(_0x3b8b99){if(_0x3b8b99){return _0x3b8b99['update'](_0x15d27e)[_0x81fe('0x22')](function(_0x487a20){return _0x487a20;});}return null;};}function removeEntity(_0x2e4e24,_0x56d161){return function(_0x3ff200){if(_0x3ff200){return _0x3ff200[_0x81fe('0x23')]()[_0x81fe('0x22')](function(){_0x2e4e24[_0x81fe('0x16')](0xcc)[_0x81fe('0x17')]();});}};}function handleEntityNotFound(_0x5226bb,_0x53e3ee){return function(_0x469cb6){if(!_0x469cb6){_0x5226bb[_0x81fe('0x24')](0x194);}return _0x469cb6;};}function handleError(_0x5abe45,_0x22ff9a){_0x22ff9a=_0x22ff9a||0x1f4;return function(_0x184626){logger[_0x81fe('0x25')](_0x184626[_0x81fe('0x26')]);if(_0x184626['name']){delete _0x184626[_0x81fe('0x27')];}_0x5abe45['status'](_0x22ff9a)[_0x81fe('0x28')](_0x184626);};}exports[_0x81fe('0x29')]=function(_0x5baf65,_0x143857){var _0x5c4cbc={},_0x32c47c={},_0x376f54={'count':0x0,'rows':[]};var _0xf92d3b=_[_0x81fe('0x2a')](db[_0x81fe('0x2b')][_0x81fe('0x2c')],function(_0x3781b9){return{'name':_0x3781b9['fieldName'],'type':_0x3781b9['type'][_0x81fe('0x2d')]};});_0x32c47c[_0x81fe('0x2e')]=_['map'](_0xf92d3b,_0x81fe('0x27'));_0x32c47c['query']=_[_0x81fe('0x2f')](_0x5baf65['query']);_0x32c47c[_0x81fe('0x30')]=_[_0x81fe('0x31')](_0x32c47c[_0x81fe('0x2e')],_0x32c47c['query']);_0x5c4cbc['attributes']=_[_0x81fe('0x31')](_0x32c47c['model'],qs[_0x81fe('0x32')](_0x5baf65[_0x81fe('0x33')]['fields']));_0x5c4cbc[_0x81fe('0x34')]=_0x5c4cbc[_0x81fe('0x34')][_0x81fe('0x35')]?_0x5c4cbc[_0x81fe('0x34')]:_0x32c47c[_0x81fe('0x2e')];if(!_0x5baf65['query'][_0x81fe('0x36')]('nolimit')){_0x5c4cbc[_0x81fe('0x1b')]=qs['limit'](_0x5baf65[_0x81fe('0x33')][_0x81fe('0x1b')]);_0x5c4cbc[_0x81fe('0x19')]=qs[_0x81fe('0x19')](_0x5baf65[_0x81fe('0x33')]['offset']);}_0x5c4cbc[_0x81fe('0x37')]=qs[_0x81fe('0x38')](_0x5baf65[_0x81fe('0x33')][_0x81fe('0x38')]);_0x5c4cbc[_0x81fe('0x39')]=qs[_0x81fe('0x30')](_[_0x81fe('0x3a')](_0x5baf65[_0x81fe('0x33')],_0x32c47c['filters']),_0xf92d3b);if(_0x5baf65[_0x81fe('0x33')][_0x81fe('0x3b')]){_0x5c4cbc['where']=_['merge'](_0x5c4cbc[_0x81fe('0x39')],{'$or':_['map'](_0xf92d3b,function(_0x113af9){if(_0x113af9['type']!==_0x81fe('0x3c')){var _0x3477e2={};_0x3477e2[_0x113af9[_0x81fe('0x27')]]={'$like':'%'+_0x5baf65[_0x81fe('0x33')][_0x81fe('0x3b')]+'%'};return _0x3477e2;}})});}_0x5c4cbc=_[_0x81fe('0x3d')]({},_0x5c4cbc,_0x5baf65['options']);var _0x19fbad={'where':_0x5c4cbc['where']};return db[_0x81fe('0x2b')]['count'](_0x19fbad)['then'](function(_0x4c8c64){_0x376f54['count']=_0x4c8c64;if(_0x5baf65[_0x81fe('0x33')]['includeAll']){_0x5c4cbc[_0x81fe('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x81fe('0x3f')](_0x5c4cbc);})['then'](function(_0xcd3a9d){_0x376f54[_0x81fe('0x40')]=_0xcd3a9d;return _0x376f54;})[_0x81fe('0x22')](respondWithFilteredResult(_0x143857,_0x5c4cbc))[_0x81fe('0x41')](handleError(_0x143857,null));};exports[_0x81fe('0x42')]=function(_0x1f011b,_0x40491b){var _0x5a2aa3={'raw':!![],'where':{'id':_0x1f011b[_0x81fe('0x43')]['id']}},_0x53bbdb={};_0x53bbdb['model']=_['keys'](db[_0x81fe('0x2b')][_0x81fe('0x2c')]);_0x53bbdb['query']=_[_0x81fe('0x2f')](_0x1f011b[_0x81fe('0x33')]);_0x53bbdb[_0x81fe('0x30')]=_[_0x81fe('0x31')](_0x53bbdb[_0x81fe('0x2e')],_0x53bbdb[_0x81fe('0x33')]);_0x5a2aa3[_0x81fe('0x34')]=_[_0x81fe('0x31')](_0x53bbdb[_0x81fe('0x2e')],qs[_0x81fe('0x32')](_0x1f011b[_0x81fe('0x33')][_0x81fe('0x32')]));_0x5a2aa3[_0x81fe('0x34')]=_0x5a2aa3[_0x81fe('0x34')][_0x81fe('0x35')]?_0x5a2aa3[_0x81fe('0x34')]:_0x53bbdb[_0x81fe('0x2e')];if(_0x1f011b[_0x81fe('0x33')][_0x81fe('0x44')]){_0x5a2aa3[_0x81fe('0x3e')]=[{'all':!![]}];}_0x5a2aa3=_[_0x81fe('0x3d')]({},_0x5a2aa3,_0x1f011b[_0x81fe('0x45')]);return db['SquareDetailsReport'][_0x81fe('0x46')](_0x5a2aa3)[_0x81fe('0x22')](handleEntityNotFound(_0x40491b,null))['then'](respondWithResult(_0x40491b,null))[_0x81fe('0x41')](handleError(_0x40491b,null));};exports['create']=function(_0x413161,_0xd307ed){return db[_0x81fe('0x2b')]['create'](_0x413161[_0x81fe('0x47')],{})[_0x81fe('0x22')](respondWithResult(_0xd307ed,0xc9))[_0x81fe('0x41')](handleError(_0xd307ed,null));};exports[_0x81fe('0x48')]=function(_0x3cca0e,_0x4d9d0c){if(_0x3cca0e[_0x81fe('0x47')]['id']){delete _0x3cca0e[_0x81fe('0x47')]['id'];}return db['SquareDetailsReport'][_0x81fe('0x46')]({'where':{'id':_0x3cca0e[_0x81fe('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d9d0c,null))[_0x81fe('0x22')](saveUpdates(_0x3cca0e[_0x81fe('0x47')],null))[_0x81fe('0x22')](respondWithResult(_0x4d9d0c,null))[_0x81fe('0x41')](handleError(_0x4d9d0c,null));};exports[_0x81fe('0x23')]=function(_0x2395c6,_0x5f3088){return db[_0x81fe('0x2b')]['find']({'where':{'id':_0x2395c6[_0x81fe('0x43')]['id']}})[_0x81fe('0x22')](handleEntityNotFound(_0x5f3088,null))[_0x81fe('0x22')](removeEntity(_0x5f3088,null))[_0x81fe('0x41')](handleError(_0x5f3088,null));};exports[_0x81fe('0x49')]=function(_0x3baf45,_0x1bb33d){return db[_0x81fe('0x2b')][_0x81fe('0x49')]()[_0x81fe('0x22')](respondWithResult(_0x1bb33d,null))[_0x81fe('0x41')](handleError(_0x1bb33d,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 6e6598a..4864fb0 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 _0x94fc=['exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x2954ab,_0x2de559){var _0x46273a=function(_0x534456){while(--_0x534456){_0x2954ab['push'](_0x2954ab['shift']());}};_0x46273a(++_0x2de559);}(_0x94fc,0x1a4));var _0xc94f=function(_0x420655,_0x4ed734){_0x420655=_0x420655-0x0;var _0x20ae95=_0x94fc[_0x420655];return _0x20ae95;};'use strict';var _=require(_0xc94f('0x0'));var util=require('util');var logger=require(_0xc94f('0x1'))('api');var moment=require(_0xc94f('0x2'));var BPromise=require(_0xc94f('0x3'));var rp=require(_0xc94f('0x4'));var fs=require('fs');var path=require(_0xc94f('0x5'));var rimraf=require(_0xc94f('0x6'));var config=require(_0xc94f('0x7'));var attributes=require(_0xc94f('0x8'));module[_0xc94f('0x9')]=function(_0xdbf78e,_0x2a4cba){return _0xdbf78e[_0xc94f('0xa')](_0xc94f('0xb'),attributes,{'tableName':_0xc94f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39da=['moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','api'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x39da,0x8c));var _0xa39d=function(_0x47c310,_0x83e49f){_0x47c310=_0x47c310-0x0;var _0x366648=_0x39da[_0x47c310];return _0x366648;};'use strict';var _=require(_0xa39d('0x0'));var util=require(_0xa39d('0x1'));var logger=require('../../config/logger')(_0xa39d('0x2'));var moment=require(_0xa39d('0x3'));var BPromise=require(_0xa39d('0x4'));var rp=require(_0xa39d('0x5'));var fs=require('fs');var path=require(_0xa39d('0x6'));var rimraf=require(_0xa39d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa39d('0x8'));module[_0xa39d('0x9')]=function(_0x428947,_0x4c9452){return _0x428947[_0xa39d('0xa')](_0xa39d('0xb'),attributes,{'tableName':_0xa39d('0xc'),'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 82760eb..dafd0db 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 _0x1775=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x59012a,_0x213863){var _0x20a14d=function(_0x4d663a){while(--_0x4d663a){_0x59012a['push'](_0x59012a['shift']());}};_0x20a14d(++_0x213863);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'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});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['create'](_0x1b4102[_0x5177('0x1c')],{'raw':_0x1b4102['options']?_0x1b4102[_0x5177('0x1d')][_0x5177('0x1e')]===undefined?!![]:![]:!![]})[_0x5177('0xe')](function(_0x27b732){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON[_0x5177('0x13')](_0x27b732));_0x3e6944(_0x27b732);})[_0x5177('0x19')](function(_0x23dad2){logger[_0x5177('0x14')]('CreateSquareDetailsReport',_0x23dad2[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4['error'](0x1f4,_0x23dad2[_0x5177('0x17')]));});});}; \ No newline at end of file +var _0xdb94=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then'];(function(_0x4526e6,_0xa7df21){var _0x1edb22=function(_0x4e4685){while(--_0x4e4685){_0x4526e6['push'](_0x4526e6['shift']());}};_0x1edb22(++_0xa7df21);}(_0xdb94,0xab));var _0x4db9=function(_0x5c862a,_0x381592){_0x5c862a=_0x5c862a-0x0;var _0x279403=_0xdb94[_0x5c862a];return _0x279403;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});}exports[_0x4db9('0x13')]=function(_0x462af3){var _0xa693c4=this;return new Promise(function(_0x1d3c33,_0x55494a){return db[_0x4db9('0x14')][_0x4db9('0x15')](_0x462af3[_0x4db9('0x16')],{'raw':_0x462af3['options']?_0x462af3[_0x4db9('0x17')][_0x4db9('0x18')]===undefined?!![]:![]:!![]})[_0x4db9('0xa')](function(_0x4c92e8){logger[_0x4db9('0xb')](_0x4db9('0x13'),_0x462af3);logger[_0x4db9('0xe')](_0x4db9('0x13'),_0x462af3,JSON[_0x4db9('0x19')](_0x4c92e8));_0x1d3c33(_0x4c92e8);})[_0x4db9('0x12')](function(_0x3585d5){logger['error'](_0x4db9('0x13'),_0x3585d5[_0x4db9('0x11')],_0x462af3);_0x55494a(_0xa693c4[_0x4db9('0x10')](0x1f4,_0x3585d5[_0x4db9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c6cf480..fd7e95a 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 _0x1fb5=['isAuthenticated','get','killProcess','express','Router'];(function(_0x4398da,_0x9e6f5e){var _0x3b87a5=function(_0x65278b){while(--_0x65278b){_0x4398da['push'](_0x4398da['shift']());}};_0x3b87a5(++_0x9e6f5e);}(_0x1fb5,0x161));var _0x51fb=function(_0x3d23ee,_0x38d6aa){_0x3d23ee=_0x3d23ee-0x0;var _0x1fbadb=_0x1fb5[_0x3d23ee];return _0x1fbadb;};'use strict';var express=require(_0x51fb('0x0'));var router=express[_0x51fb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0x51fb('0x2')](),controller['index']);router[_0x51fb('0x3')]('/process/:pid/kill',auth[_0x51fb('0x2')](),controller[_0x51fb('0x4')]);module['exports']=router; \ No newline at end of file +var _0x2c3c=['../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess','exports','express','Router'];(function(_0x1cbc93,_0x1cbbb2){var _0x39b6cb=function(_0x22010a){while(--_0x22010a){_0x1cbc93['push'](_0x1cbc93['shift']());}};_0x39b6cb(++_0x1cbbb2);}(_0x2c3c,0x103));var _0xc2c3=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x2c3c[_0xac0de1];return _0x1c1995;};'use strict';var express=require(_0xc2c3('0x0'));var router=express[_0xc2c3('0x1')]();var auth=require(_0xc2c3('0x2'));var controller=require(_0xc2c3('0x3'));router[_0xc2c3('0x4')]('/',auth[_0xc2c3('0x5')](),controller[_0xc2c3('0x6')]);router[_0xc2c3('0x4')]('/process/:pid/kill',auth[_0xc2c3('0x5')](),controller[_0xc2c3('0x7')]);module[_0xc2c3('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 28bba33..f7649c4 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 _0xe183=['json','catch','killProcess','components/import/cm','format','params','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','pid','systeminformation','child_process','exec','util','bluebird','lodash','inspect','name','status','send','index','getAllData','then'];(function(_0x18b1a2,_0x10d260){var _0x50b5b8=function(_0x46219d){while(--_0x46219d){_0x18b1a2['push'](_0x18b1a2['shift']());}};_0x50b5b8(++_0x10d260);}(_0xe183,0xdd));var _0x3e18=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xe183[_0x45bf86];return _0x1f02b7;};'use strict';var info=require(_0x3e18('0x0'));var exec=require(_0x3e18('0x1'))[_0x3e18('0x2')];var logger=require('../../config/logger')('api');var util=require(_0x3e18('0x3'));var BPromise=require(_0x3e18('0x4'));var _=require(_0x3e18('0x5'));function handleError(_0x35513b,_0x52709b,_0x1ccfb7){_0x52709b=_0x52709b||0x1f4;return function(_0x4d2288){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1ccfb7,_0x52709b,util[_0x3e18('0x6')](_0x4d2288,{'showHidden':![],'depth':null}));delete _0x4d2288[_0x3e18('0x7')];_0x35513b[_0x3e18('0x8')](_0x52709b)[_0x3e18('0x9')](_0x4d2288);};}exports[_0x3e18('0xa')]=function(_0x402f9b,_0xfb0102){return info[_0x3e18('0xb')]()[_0x3e18('0xc')](function(_0x2a924d){return _0xfb0102[_0x3e18('0x8')](0xc8)[_0x3e18('0xd')](_0x2a924d);})[_0x3e18('0xe')](function(_0xbf7f3d){return _0xfb0102[_0x3e18('0x8')](0x1f4)[_0x3e18('0xd')](_0xbf7f3d);});};exports[_0x3e18('0xf')]=function(_0x21fbd4,_0x28232e){var _0x1d182c=[_0x3e18('0x10')];return new BPromise(function(_0x14a1f7,_0x5414b6){return exec(util[_0x3e18('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x21fbd4[_0x3e18('0x12')]['pid']),function(_0x2b62c0,_0x416700,_0x3dbc04){if(_0x2b62c0){return _0x5414b6(_0x2b62c0);}return _0x14a1f7(_0x416700);});})[_0x3e18('0xc')](function(_0x4a4c0a){var _0x2234c6=![];var _0x3ae2ab=_0x4a4c0a['split'](/\n/);for(var _0x4203e0=0x0,_0x5d90e4=_0x1d182c[_0x3e18('0x13')];_0x4203e0<_0x5d90e4,_0x2234c6===![];_0x4203e0+=0x1){if(_0x4a4c0a[_0x3e18('0x14')](_0x1d182c[_0x4203e0])>=0x0){_0x2234c6=!![];}}if(!_0x2234c6){throw new Error(util[_0x3e18('0x11')](_0x3e18('0x15'),_0x21fbd4[_0x3e18('0x12')]['pid']));}process[_0x3e18('0x16')](_0x21fbd4[_0x3e18('0x12')]['pid'],_0x3e18('0x17'));return _0x28232e[_0x3e18('0x8')](0xc8)['json']({'message':util[_0x3e18('0x11')](_0x3e18('0x18'),_0x21fbd4[_0x3e18('0x12')][_0x3e18('0x19')])});})[_0x3e18('0xe')](handleError(_0x28232e,null,_0x3e18('0xf')));}; \ No newline at end of file +var _0xced5=['catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then'];(function(_0x58a801,_0x7c63f0){var _0x4ae197=function(_0xf83c58){while(--_0xf83c58){_0x58a801['push'](_0x58a801['shift']());}};_0x4ae197(++_0x7c63f0);}(_0xced5,0x152));var _0x5ced=function(_0x5ece0d,_0x3a963e){_0x5ece0d=_0x5ece0d-0x0;var _0x2893a3=_0xced5[_0x5ece0d];return _0x2893a3;};'use strict';var info=require(_0x5ced('0x0'));var exec=require(_0x5ced('0x1'))[_0x5ced('0x2')];var logger=require(_0x5ced('0x3'))(_0x5ced('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x1d5a88,_0x243193,_0x2081a8){_0x243193=_0x243193||0x1f4;return function(_0x3d3598){logger[_0x5ced('0x5')](_0x5ced('0x6'),_0x2081a8,_0x243193,util[_0x5ced('0x7')](_0x3d3598,{'showHidden':![],'depth':null}));delete _0x3d3598[_0x5ced('0x8')];_0x1d5a88[_0x5ced('0x9')](_0x243193)['send'](_0x3d3598);};}exports[_0x5ced('0xa')]=function(_0x194439,_0x467c33){return info[_0x5ced('0xb')]()[_0x5ced('0xc')](function(_0x50f3fb){return _0x467c33[_0x5ced('0x9')](0xc8)['json'](_0x50f3fb);})[_0x5ced('0xd')](function(_0x1257b3){return _0x467c33[_0x5ced('0x9')](0x1f4)[_0x5ced('0xe')](_0x1257b3);});};exports['killProcess']=function(_0x2faf22,_0x3dce60){var _0x4a7166=[_0x5ced('0xf')];return new BPromise(function(_0x1fe338,_0x324e1a){return exec(util[_0x5ced('0x10')](_0x5ced('0x11'),_0x2faf22[_0x5ced('0x12')]['pid']),function(_0x1d08f9,_0x4cd766,_0x4d0dc8){if(_0x1d08f9){return _0x324e1a(_0x1d08f9);}return _0x1fe338(_0x4cd766);});})[_0x5ced('0xc')](function(_0x2e46d2){var _0x3a0d4e=![];var _0x4cc56c=_0x2e46d2[_0x5ced('0x13')](/\n/);for(var _0x37e7e9=0x0,_0x465fa1=_0x4a7166[_0x5ced('0x14')];_0x37e7e9<_0x465fa1,_0x3a0d4e===![];_0x37e7e9+=0x1){if(_0x2e46d2['indexOf'](_0x4a7166[_0x37e7e9])>=0x0){_0x3a0d4e=!![];}}if(!_0x3a0d4e){throw new Error(util[_0x5ced('0x10')](_0x5ced('0x15'),_0x2faf22['params']['pid']));}process[_0x5ced('0x16')](_0x2faf22['params'][_0x5ced('0x17')],_0x5ced('0x18'));return _0x3dce60['status'](0xc8)[_0x5ced('0xe')]({'message':util[_0x5ced('0x10')](_0x5ced('0x19'),_0x2faf22[_0x5ced('0x12')]['pid'])});})[_0x5ced('0xd')](handleError(_0x3dce60,null,_0x5ced('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 2f9698a..0f471ab 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 _0x1dcd=['create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x1dcd,0x100));var _0xd1dc=function(_0x7e918f,_0x48cf10){_0x7e918f=_0x7e918f-0x0;var _0x5b35ab=_0x1dcd[_0x7e918f];return _0x5b35ab;};'use strict';var multer=require(_0xd1dc('0x0'));var util=require(_0xd1dc('0x1'));var path=require(_0xd1dc('0x2'));var timeout=require(_0xd1dc('0x3'));var express=require(_0xd1dc('0x4'));var router=express[_0xd1dc('0x5')]();var fs_extra=require(_0xd1dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd1dc('0x7'));var config=require(_0xd1dc('0x8'));var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd1dc('0x9')]);router['get'](_0xd1dc('0xa'),auth[_0xd1dc('0xb')](),controller[_0xd1dc('0xc')]);router[_0xd1dc('0xd')]('/',auth['isAuthenticated'](),controller[_0xd1dc('0xe')]);router[_0xd1dc('0xf')](_0xd1dc('0xa'),auth[_0xd1dc('0xb')](),controller[_0xd1dc('0x10')]);router[_0xd1dc('0x11')](_0xd1dc('0xa'),auth[_0xd1dc('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x43fb=['isAuthenticated','index','/:id','show','create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get'];(function(_0x7a5100,_0x46b744){var _0x464d08=function(_0x2fef21){while(--_0x2fef21){_0x7a5100['push'](_0x7a5100['shift']());}};_0x464d08(++_0x46b744);}(_0x43fb,0x170));var _0xb43f=function(_0x5ea313,_0x2cb3d2){_0x5ea313=_0x5ea313-0x0;var _0x78b8aa=_0x43fb[_0x5ea313];return _0x78b8aa;};'use strict';var multer=require(_0xb43f('0x0'));var util=require(_0xb43f('0x1'));var path=require(_0xb43f('0x2'));var timeout=require(_0xb43f('0x3'));var express=require(_0xb43f('0x4'));var router=express[_0xb43f('0x5')]();var fs_extra=require(_0xb43f('0x6'));var auth=require(_0xb43f('0x7'));var interaction=require(_0xb43f('0x8'));var config=require(_0xb43f('0x9'));var controller=require(_0xb43f('0xa'));router[_0xb43f('0xb')]('/',auth[_0xb43f('0xc')](),controller[_0xb43f('0xd')]);router[_0xb43f('0xb')](_0xb43f('0xe'),auth[_0xb43f('0xc')](),controller[_0xb43f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb43f('0x10')]);router['put']('/:id',auth[_0xb43f('0xc')](),controller[_0xb43f('0x11')]);router[_0xb43f('0x12')](_0xb43f('0xe'),auth['isAuthenticated'](),controller['destroy']);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 0306bfc..90bea15 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 _0x9158=['sequelize','exports','STRING'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9158,0x16e));var _0x8915=function(_0x3e35a7,_0x3a65cc){_0x3e35a7=_0x3e35a7-0x0;var _0x2be78a=_0x9158[_0x3e35a7];return _0x2be78a;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'name':{'type':Sequelize[_0x8915('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8915('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x8915('0x2')]}}; \ No newline at end of file +var _0x2e21=['sequelize','exports','STRING'];(function(_0x4ba774,_0x511e84){var _0x54051f=function(_0x32454e){while(--_0x32454e){_0x4ba774['push'](_0x4ba774['shift']());}};_0x54051f(++_0x511e84);}(_0x2e21,0xba));var _0x12e2=function(_0x3285cd,_0x3bf9b8){_0x3285cd=_0x3285cd-0x0;var _0x4ddeac=_0x2e21[_0x3285cd];return _0x4ddeac;};'use strict';var Sequelize=require(_0x12e2('0x0'));module[_0x12e2('0x1')]={'name':{'type':Sequelize[_0x12e2('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x12e2('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x12e2('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 6c2ec2d..56ec281 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 _0x4b1f=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','findAll','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4b1f,0x195));var _0xf4b1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4b1f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf4b1('0x0'));var rimraf=require(_0xf4b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4b1('0x2'));var rp=require(_0xf4b1('0x3'));var moment=require(_0xf4b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4b1('0x5'));var util=require(_0xf4b1('0x6'));var path=require(_0xf4b1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b1('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b1('0x9'));var _=require(_0xf4b1('0xa'));var squel=require(_0xf4b1('0xb'));var crypto=require(_0xf4b1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4b1('0xd'));var Papa=require('papaparse');var Redis=require(_0xf4b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b1('0xf'));var hardwareService=require(_0xf4b1('0x10'));var logger=require(_0xf4b1('0x11'))(_0xf4b1('0x12'));var utils=require(_0xf4b1('0x13'));var config=require(_0xf4b1('0x14'));var licenseUtil=require(_0xf4b1('0x15'));var db=require(_0xf4b1('0x16'))['db'];function respondWithStatusCode(_0x38afbb,_0xf66b4c){_0xf66b4c=_0xf66b4c||0xcc;return function(_0x2c4eb9){if(_0x2c4eb9){return _0x38afbb[_0xf4b1('0x17')](_0xf66b4c);}return _0x38afbb[_0xf4b1('0x18')](_0xf66b4c)['end']();};}function respondWithResult(_0x591476,_0x3ea6f3){_0x3ea6f3=_0x3ea6f3||0xc8;return function(_0x5cbc25){if(_0x5cbc25){return _0x591476['status'](_0x3ea6f3)[_0xf4b1('0x19')](_0x5cbc25);}};}function respondWithFilteredResult(_0x51c39f,_0x5764b1){return function(_0x293f59){if(_0x293f59){var _0x4968f4=typeof _0x5764b1['offset']==='undefined'&&typeof _0x5764b1['limit']===_0xf4b1('0x1a');var _0x3ee70a=_0x293f59['count'];var _0x3b378e=_0x4968f4?0x0:_0x5764b1[_0xf4b1('0x1b')];var _0x322b38=_0x4968f4?_0x293f59[_0xf4b1('0x1c')]:_0x5764b1[_0xf4b1('0x1b')]+_0x5764b1[_0xf4b1('0x1d')];var _0x5b0214;if(_0x322b38>=_0x3ee70a){_0x322b38=_0x3ee70a;_0x5b0214=0xc8;}else{_0x5b0214=0xce;}_0x51c39f[_0xf4b1('0x18')](_0x5b0214);return _0x51c39f[_0xf4b1('0x1e')]('Content-Range',_0x3b378e+'-'+_0x322b38+'/'+_0x3ee70a)[_0xf4b1('0x19')](_0x293f59);}return null;};}function patchUpdates(_0x30c239){return function(_0x56ef48){try{jsonpatch[_0xf4b1('0x1f')](_0x56ef48,_0x30c239,!![]);}catch(_0x559a64){return BPromise[_0xf4b1('0x20')](_0x559a64);}return _0x56ef48[_0xf4b1('0x21')]();};}function saveUpdates(_0x5c50e8,_0x20013c){return function(_0x29b8c1){if(_0x29b8c1){return _0x29b8c1[_0xf4b1('0x22')](_0x5c50e8)[_0xf4b1('0x23')](function(_0x58376d){return _0x58376d;});}return null;};}function removeEntity(_0x92b390,_0x474212){return function(_0x4b6c08){if(_0x4b6c08){return _0x4b6c08[_0xf4b1('0x24')]()['then'](function(){var _0x15cfc4=_0x4b6c08['get']({'plain':!![]});var _0x238fbe=_0xf4b1('0x25');return db[_0xf4b1('0x26')]['destroy']({'where':{'type':_0x238fbe,'resourceId':_0x15cfc4['id']}})[_0xf4b1('0x23')](function(){return _0x4b6c08;});})['then'](function(){_0x92b390[_0xf4b1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29493b,_0x447ae7){return function(_0x5d28af){if(!_0x5d28af){_0x29493b[_0xf4b1('0x17')](0x194);}return _0x5d28af;};}function handleError(_0x23693b,_0x5bd8ee){_0x5bd8ee=_0x5bd8ee||0x1f4;return function(_0x125bf4){logger[_0xf4b1('0x27')](_0x125bf4[_0xf4b1('0x28')]);if(_0x125bf4[_0xf4b1('0x29')]){delete _0x125bf4[_0xf4b1('0x29')];}_0x23693b[_0xf4b1('0x18')](_0x5bd8ee)[_0xf4b1('0x2a')](_0x125bf4);};}exports['index']=function(_0x56ee5e,_0x31c13c){var _0xff9a65={},_0x1cbcff={},_0x29b9f9={'count':0x0,'rows':[]};var _0x35d81b=_['map'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')],function(_0xa6bdd7){return{'name':_0xa6bdd7[_0xf4b1('0x2d')],'type':_0xa6bdd7[_0xf4b1('0x2e')][_0xf4b1('0x2f')]};});_0x1cbcff[_0xf4b1('0x30')]=_[_0xf4b1('0x31')](_0x35d81b,'name');_0x1cbcff[_0xf4b1('0x32')]=_['keys'](_0x56ee5e['query']);_0x1cbcff['filters']=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],_0x1cbcff[_0xf4b1('0x32')]);_0xff9a65[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],qs[_0xf4b1('0x35')](_0x56ee5e[_0xf4b1('0x32')]['fields']));_0xff9a65[_0xf4b1('0x34')]=_0xff9a65['attributes'][_0xf4b1('0x36')]?_0xff9a65[_0xf4b1('0x34')]:_0x1cbcff['model'];if(!_0x56ee5e[_0xf4b1('0x32')][_0xf4b1('0x37')](_0xf4b1('0x38'))){_0xff9a65[_0xf4b1('0x1d')]=qs[_0xf4b1('0x1d')](_0x56ee5e['query'][_0xf4b1('0x1d')]);_0xff9a65['offset']=qs[_0xf4b1('0x1b')](_0x56ee5e['query'][_0xf4b1('0x1b')]);}_0xff9a65[_0xf4b1('0x39')]=qs[_0xf4b1('0x3a')](_0x56ee5e['query'][_0xf4b1('0x3a')]);_0xff9a65[_0xf4b1('0x3b')]=qs[_0xf4b1('0x3c')](_[_0xf4b1('0x3d')](_0x56ee5e[_0xf4b1('0x32')],_0x1cbcff[_0xf4b1('0x3c')]),_0x35d81b);if(_0x56ee5e[_0xf4b1('0x32')]['filter']){_0xff9a65[_0xf4b1('0x3b')]=_[_0xf4b1('0x3e')](_0xff9a65[_0xf4b1('0x3b')],{'$or':_[_0xf4b1('0x31')](_0x35d81b,function(_0x39de7f){if(_0x39de7f[_0xf4b1('0x2e')]!=='VIRTUAL'){var _0x33879b={};_0x33879b[_0x39de7f[_0xf4b1('0x29')]]={'$like':'%'+_0x56ee5e['query']['filter']+'%'};return _0x33879b;}})});}_0xff9a65=_[_0xf4b1('0x3e')]({},_0xff9a65,_0x56ee5e[_0xf4b1('0x3f')]);var _0x439c9d={'where':_0xff9a65[_0xf4b1('0x3b')]};return db[_0xf4b1('0x2b')][_0xf4b1('0x1c')](_0x439c9d)[_0xf4b1('0x23')](function(_0x1600b6){_0x29b9f9['count']=_0x1600b6;if(_0x56ee5e[_0xf4b1('0x32')]['includeAll']){_0xff9a65['include']=[{'all':!![]}];}return db['Tag'][_0xf4b1('0x40')](_0xff9a65);})[_0xf4b1('0x23')](function(_0x28b9f2){_0x29b9f9['rows']=_0x28b9f2;return _0x29b9f9;})[_0xf4b1('0x23')](respondWithFilteredResult(_0x31c13c,_0xff9a65))[_0xf4b1('0x41')](handleError(_0x31c13c,null));};exports[_0xf4b1('0x42')]=function(_0x5597d5,_0x13c130){var _0x15845a={'raw':!![],'where':{'id':_0x5597d5['params']['id']}},_0x1f856c={};_0x1f856c[_0xf4b1('0x30')]=_['keys'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')]);_0x1f856c[_0xf4b1('0x32')]=_['keys'](_0x5597d5[_0xf4b1('0x32')]);_0x1f856c[_0xf4b1('0x3c')]=_['intersection'](_0x1f856c[_0xf4b1('0x30')],_0x1f856c[_0xf4b1('0x32')]);_0x15845a[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1f856c['model'],qs['fields'](_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x35')]));_0x15845a['attributes']=_0x15845a[_0xf4b1('0x34')]['length']?_0x15845a[_0xf4b1('0x34')]:_0x1f856c['model'];if(_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x43')]){_0x15845a['include']=[{'all':!![]}];}_0x15845a=_[_0xf4b1('0x3e')]({},_0x15845a,_0x5597d5[_0xf4b1('0x3f')]);return db[_0xf4b1('0x2b')][_0xf4b1('0x44')](_0x15845a)[_0xf4b1('0x23')](handleEntityNotFound(_0x13c130,null))[_0xf4b1('0x23')](respondWithResult(_0x13c130,null))[_0xf4b1('0x41')](handleError(_0x13c130,null));};exports[_0xf4b1('0x45')]=function(_0x4e6e04,_0x4a9761){return db[_0xf4b1('0x2b')][_0xf4b1('0x45')](_0x4e6e04['body'],{})[_0xf4b1('0x23')](function(_0x3476b3){var _0x21dc3b=_0x4e6e04[_0xf4b1('0x46')][_0xf4b1('0x47')]({'plain':!![]});if(!_0x21dc3b)throw new Error(_0xf4b1('0x48'));if(_0x21dc3b[_0xf4b1('0x49')]===_0xf4b1('0x46')){var _0x29c3c1=_0x3476b3[_0xf4b1('0x47')]({'plain':!![]});var _0x407ecf=_0xf4b1('0x25');return db[_0xf4b1('0x4a')][_0xf4b1('0x44')]({'where':{'name':_0x407ecf,'userProfileId':_0x21dc3b[_0xf4b1('0x4b')]},'raw':!![]})[_0xf4b1('0x23')](function(_0xacaa0e){if(_0xacaa0e&&_0xacaa0e[_0xf4b1('0x4c')]===0x0){return db[_0xf4b1('0x26')][_0xf4b1('0x45')]({'name':_0x29c3c1[_0xf4b1('0x29')],'resourceId':_0x29c3c1['id'],'type':_0xacaa0e[_0xf4b1('0x29')],'sectionId':_0xacaa0e['id']},{})[_0xf4b1('0x23')](function(){return _0x3476b3;});}else{return _0x3476b3;}})[_0xf4b1('0x41')](function(_0x389ad7){logger[_0xf4b1('0x27')](_0xf4b1('0x4d'),_0x389ad7);throw _0x389ad7;});}return _0x3476b3;})[_0xf4b1('0x23')](respondWithResult(_0x4a9761,0xc9))['catch'](handleError(_0x4a9761,null));};exports[_0xf4b1('0x22')]=function(_0x479e71,_0x5bdd65){if(_0x479e71[_0xf4b1('0x4e')]['id']){delete _0x479e71[_0xf4b1('0x4e')]['id'];}return db['Tag'][_0xf4b1('0x44')]({'where':{'id':_0x479e71[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x5bdd65,null))['then'](saveUpdates(_0x479e71['body'],null))[_0xf4b1('0x23')](respondWithResult(_0x5bdd65,null))[_0xf4b1('0x41')](handleError(_0x5bdd65,null));};exports[_0xf4b1('0x24')]=function(_0x38938f,_0x402e6c){return db[_0xf4b1('0x2b')][_0xf4b1('0x44')]({'where':{'id':_0x38938f[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x402e6c,null))[_0xf4b1('0x23')](removeEntity(_0x402e6c,null))[_0xf4b1('0x41')](handleError(_0x402e6c,null));}; \ No newline at end of file +var _0x4c6d=['apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','find','userProfileId','autoAssociation','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x376527,_0x490829){_0x376527=_0x376527-0x0;var _0x1ffec9=_0x4c6d[_0x376527];return _0x1ffec9;};'use strict';var emlformat=require(_0xd4c6('0x0'));var rimraf=require(_0xd4c6('0x1'));var zipdir=require(_0xd4c6('0x2'));var jsonpatch=require(_0xd4c6('0x3'));var rp=require(_0xd4c6('0x4'));var moment=require('moment');var BPromise=require(_0xd4c6('0x5'));var Mustache=require(_0xd4c6('0x6'));var util=require(_0xd4c6('0x7'));var path=require('path');var sox=require(_0xd4c6('0x8'));var csv=require(_0xd4c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4c6('0xa'));var _=require(_0xd4c6('0xb'));var squel=require(_0xd4c6('0xc'));var crypto=require('crypto');var jsforce=require(_0xd4c6('0xd'));var deskjs=require(_0xd4c6('0xe'));var toCsv=require(_0xd4c6('0x9'));var querystring=require('querystring');var Papa=require(_0xd4c6('0xf'));var Redis=require(_0xd4c6('0x10'));var authService=require(_0xd4c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd4c6('0x12'));var hardwareService=require(_0xd4c6('0x13'));var logger=require(_0xd4c6('0x14'))(_0xd4c6('0x15'));var utils=require(_0xd4c6('0x16'));var config=require(_0xd4c6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35b902,_0x489171){_0x489171=_0x489171||0xcc;return function(_0x162681){if(_0x162681){return _0x35b902[_0xd4c6('0x18')](_0x489171);}return _0x35b902[_0xd4c6('0x19')](_0x489171)[_0xd4c6('0x1a')]();};}function respondWithResult(_0x3a2143,_0x384a98){_0x384a98=_0x384a98||0xc8;return function(_0x94f42e){if(_0x94f42e){return _0x3a2143['status'](_0x384a98)['json'](_0x94f42e);}};}function respondWithFilteredResult(_0x11e6c2,_0x3deb85){return function(_0x25e1fb){if(_0x25e1fb){var _0x25204d=typeof _0x3deb85[_0xd4c6('0x1b')]===_0xd4c6('0x1c')&&typeof _0x3deb85[_0xd4c6('0x1d')]==='undefined';var _0x761a3e=_0x25e1fb[_0xd4c6('0x1e')];var _0x23a16f=_0x25204d?0x0:_0x3deb85[_0xd4c6('0x1b')];var _0x31f328=_0x25204d?_0x25e1fb['count']:_0x3deb85[_0xd4c6('0x1b')]+_0x3deb85[_0xd4c6('0x1d')];var _0x359577;if(_0x31f328>=_0x761a3e){_0x31f328=_0x761a3e;_0x359577=0xc8;}else{_0x359577=0xce;}_0x11e6c2['status'](_0x359577);return _0x11e6c2[_0xd4c6('0x1f')](_0xd4c6('0x20'),_0x23a16f+'-'+_0x31f328+'/'+_0x761a3e)[_0xd4c6('0x21')](_0x25e1fb);}return null;};}function patchUpdates(_0x3b1658){return function(_0x48dbf8){try{jsonpatch[_0xd4c6('0x22')](_0x48dbf8,_0x3b1658,!![]);}catch(_0x4a10d8){return BPromise[_0xd4c6('0x23')](_0x4a10d8);}return _0x48dbf8[_0xd4c6('0x24')]();};}function saveUpdates(_0x2750c9,_0x222813){return function(_0xf536e0){if(_0xf536e0){return _0xf536e0[_0xd4c6('0x25')](_0x2750c9)[_0xd4c6('0x26')](function(_0x3f99e8){return _0x3f99e8;});}return null;};}function removeEntity(_0x155cb3,_0x466330){return function(_0x1ebb17){if(_0x1ebb17){return _0x1ebb17[_0xd4c6('0x27')]()['then'](function(){var _0x582326=_0x1ebb17[_0xd4c6('0x28')]({'plain':!![]});var _0x2febbf='Tags';return db[_0xd4c6('0x29')][_0xd4c6('0x27')]({'where':{'type':_0x2febbf,'resourceId':_0x582326['id']}})[_0xd4c6('0x26')](function(){return _0x1ebb17;});})['then'](function(){_0x155cb3[_0xd4c6('0x19')](0xcc)[_0xd4c6('0x1a')]();});}};}function handleEntityNotFound(_0x5614f3,_0x406ed0){return function(_0x8ce066){if(!_0x8ce066){_0x5614f3[_0xd4c6('0x18')](0x194);}return _0x8ce066;};}function handleError(_0x488e7e,_0x3ce942){_0x3ce942=_0x3ce942||0x1f4;return function(_0x3b656d){logger[_0xd4c6('0x2a')](_0x3b656d[_0xd4c6('0x2b')]);if(_0x3b656d[_0xd4c6('0x2c')]){delete _0x3b656d[_0xd4c6('0x2c')];}_0x488e7e[_0xd4c6('0x19')](_0x3ce942)[_0xd4c6('0x2d')](_0x3b656d);};}exports[_0xd4c6('0x2e')]=function(_0x1de7ae,_0x441119){var _0x31e3d0={},_0x15d312={},_0x112969={'count':0x0,'rows':[]};var _0x5d7997=_[_0xd4c6('0x2f')](db[_0xd4c6('0x30')][_0xd4c6('0x31')],function(_0x38d423){return{'name':_0x38d423['fieldName'],'type':_0x38d423['type']['key']};});_0x15d312[_0xd4c6('0x32')]=_[_0xd4c6('0x2f')](_0x5d7997,_0xd4c6('0x2c'));_0x15d312[_0xd4c6('0x33')]=_[_0xd4c6('0x34')](_0x1de7ae[_0xd4c6('0x33')]);_0x15d312[_0xd4c6('0x35')]=_['intersection'](_0x15d312[_0xd4c6('0x32')],_0x15d312[_0xd4c6('0x33')]);_0x31e3d0[_0xd4c6('0x36')]=_['intersection'](_0x15d312[_0xd4c6('0x32')],qs[_0xd4c6('0x37')](_0x1de7ae[_0xd4c6('0x33')]['fields']));_0x31e3d0[_0xd4c6('0x36')]=_0x31e3d0[_0xd4c6('0x36')][_0xd4c6('0x38')]?_0x31e3d0[_0xd4c6('0x36')]:_0x15d312['model'];if(!_0x1de7ae[_0xd4c6('0x33')][_0xd4c6('0x39')](_0xd4c6('0x3a'))){_0x31e3d0[_0xd4c6('0x1d')]=qs[_0xd4c6('0x1d')](_0x1de7ae['query'][_0xd4c6('0x1d')]);_0x31e3d0[_0xd4c6('0x1b')]=qs[_0xd4c6('0x1b')](_0x1de7ae[_0xd4c6('0x33')][_0xd4c6('0x1b')]);}_0x31e3d0[_0xd4c6('0x3b')]=qs['sort'](_0x1de7ae[_0xd4c6('0x33')][_0xd4c6('0x3c')]);_0x31e3d0[_0xd4c6('0x3d')]=qs['filters'](_[_0xd4c6('0x3e')](_0x1de7ae[_0xd4c6('0x33')],_0x15d312[_0xd4c6('0x35')]),_0x5d7997);if(_0x1de7ae[_0xd4c6('0x33')][_0xd4c6('0x3f')]){_0x31e3d0[_0xd4c6('0x3d')]=_[_0xd4c6('0x40')](_0x31e3d0[_0xd4c6('0x3d')],{'$or':_[_0xd4c6('0x2f')](_0x5d7997,function(_0x4c00f0){if(_0x4c00f0[_0xd4c6('0x41')]!=='VIRTUAL'){var _0x55063c={};_0x55063c[_0x4c00f0[_0xd4c6('0x2c')]]={'$like':'%'+_0x1de7ae[_0xd4c6('0x33')][_0xd4c6('0x3f')]+'%'};return _0x55063c;}})});}_0x31e3d0=_[_0xd4c6('0x40')]({},_0x31e3d0,_0x1de7ae[_0xd4c6('0x42')]);var _0x536d65={'where':_0x31e3d0['where']};return db[_0xd4c6('0x30')][_0xd4c6('0x1e')](_0x536d65)[_0xd4c6('0x26')](function(_0x14ee8f){_0x112969['count']=_0x14ee8f;if(_0x1de7ae[_0xd4c6('0x33')]['includeAll']){_0x31e3d0[_0xd4c6('0x43')]=[{'all':!![]}];}return db[_0xd4c6('0x30')][_0xd4c6('0x44')](_0x31e3d0);})['then'](function(_0x470157){_0x112969[_0xd4c6('0x45')]=_0x470157;return _0x112969;})[_0xd4c6('0x26')](respondWithFilteredResult(_0x441119,_0x31e3d0))[_0xd4c6('0x46')](handleError(_0x441119,null));};exports[_0xd4c6('0x47')]=function(_0x3ef1b0,_0x11f62e){var _0x3beb89={'raw':!![],'where':{'id':_0x3ef1b0['params']['id']}},_0x343d94={};_0x343d94[_0xd4c6('0x32')]=_[_0xd4c6('0x34')](db[_0xd4c6('0x30')]['rawAttributes']);_0x343d94[_0xd4c6('0x33')]=_[_0xd4c6('0x34')](_0x3ef1b0[_0xd4c6('0x33')]);_0x343d94['filters']=_['intersection'](_0x343d94[_0xd4c6('0x32')],_0x343d94[_0xd4c6('0x33')]);_0x3beb89[_0xd4c6('0x36')]=_['intersection'](_0x343d94[_0xd4c6('0x32')],qs[_0xd4c6('0x37')](_0x3ef1b0[_0xd4c6('0x33')][_0xd4c6('0x37')]));_0x3beb89[_0xd4c6('0x36')]=_0x3beb89[_0xd4c6('0x36')]['length']?_0x3beb89[_0xd4c6('0x36')]:_0x343d94[_0xd4c6('0x32')];if(_0x3ef1b0[_0xd4c6('0x33')][_0xd4c6('0x48')]){_0x3beb89[_0xd4c6('0x43')]=[{'all':!![]}];}_0x3beb89=_[_0xd4c6('0x40')]({},_0x3beb89,_0x3ef1b0[_0xd4c6('0x42')]);return db[_0xd4c6('0x30')]['find'](_0x3beb89)['then'](handleEntityNotFound(_0x11f62e,null))[_0xd4c6('0x26')](respondWithResult(_0x11f62e,null))[_0xd4c6('0x46')](handleError(_0x11f62e,null));};exports[_0xd4c6('0x49')]=function(_0x5bb875,_0x37aa81){return db[_0xd4c6('0x30')][_0xd4c6('0x49')](_0x5bb875['body'],{})[_0xd4c6('0x26')](function(_0xa6bd55){var _0x17193f=_0x5bb875[_0xd4c6('0x4a')]['get']({'plain':!![]});if(!_0x17193f)throw new Error(_0xd4c6('0x4b'));if(_0x17193f[_0xd4c6('0x4c')]===_0xd4c6('0x4a')){var _0x14279d=_0xa6bd55[_0xd4c6('0x28')]({'plain':!![]});var _0x2803ef=_0xd4c6('0x4d');return db['UserProfileSection'][_0xd4c6('0x4e')]({'where':{'name':_0x2803ef,'userProfileId':_0x17193f[_0xd4c6('0x4f')]},'raw':!![]})[_0xd4c6('0x26')](function(_0x4a62a8){if(_0x4a62a8&&_0x4a62a8[_0xd4c6('0x50')]===0x0){return db[_0xd4c6('0x29')][_0xd4c6('0x49')]({'name':_0x14279d[_0xd4c6('0x2c')],'resourceId':_0x14279d['id'],'type':_0x4a62a8[_0xd4c6('0x2c')],'sectionId':_0x4a62a8['id']},{})[_0xd4c6('0x26')](function(){return _0xa6bd55;});}else{return _0xa6bd55;}})[_0xd4c6('0x46')](function(_0x591c7c){logger[_0xd4c6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x591c7c);throw _0x591c7c;});}return _0xa6bd55;})['then'](respondWithResult(_0x37aa81,0xc9))[_0xd4c6('0x46')](handleError(_0x37aa81,null));};exports['update']=function(_0x868da9,_0x574665){if(_0x868da9[_0xd4c6('0x51')]['id']){delete _0x868da9['body']['id'];}return db['Tag'][_0xd4c6('0x4e')]({'where':{'id':_0x868da9[_0xd4c6('0x52')]['id']}})[_0xd4c6('0x26')](handleEntityNotFound(_0x574665,null))[_0xd4c6('0x26')](saveUpdates(_0x868da9[_0xd4c6('0x51')],null))[_0xd4c6('0x26')](respondWithResult(_0x574665,null))[_0xd4c6('0x46')](handleError(_0x574665,null));};exports[_0xd4c6('0x27')]=function(_0x33fac6,_0x5e52db){return db[_0xd4c6('0x30')][_0xd4c6('0x4e')]({'where':{'id':_0x33fac6[_0xd4c6('0x52')]['id']}})[_0xd4c6('0x26')](handleEntityNotFound(_0x5e52db,null))[_0xd4c6('0x26')](removeEntity(_0x5e52db,null))[_0xd4c6('0x46')](handleError(_0x5e52db,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index c8aea5b..0343348 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 _0x7052=['path','rimraf','../../config/environment','exports','define','Tag','lodash','util','api','moment','bluebird','request-promise'];(function(_0x21d4c6,_0x4585e5){var _0x439472=function(_0x49a575){while(--_0x49a575){_0x21d4c6['push'](_0x21d4c6['shift']());}};_0x439472(++_0x4585e5);}(_0x7052,0x162));var _0x2705=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7052[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x2705('0x0'));var util=require(_0x2705('0x1'));var logger=require('../../config/logger')(_0x2705('0x2'));var moment=require(_0x2705('0x3'));var BPromise=require(_0x2705('0x4'));var rp=require(_0x2705('0x5'));var fs=require('fs');var path=require(_0x2705('0x6'));var rimraf=require(_0x2705('0x7'));var config=require(_0x2705('0x8'));var attributes=require('./tag.attributes');module[_0x2705('0x9')]=function(_0x3c647f,_0x298585){return _0x3c647f[_0x2705('0xa')](_0x2705('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ec7=['exports','Tag','lodash','util','api','request-promise','path','../../config/environment','./tag.attributes'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0x8ec7[_0x593752];return _0x4612be;};'use strict';var _=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var logger=require('../../config/logger')(_0x78ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78ec('0x3'));var fs=require('fs');var path=require(_0x78ec('0x4'));var rimraf=require('rimraf');var config=require(_0x78ec('0x5'));var attributes=require(_0x78ec('0x6'));module[_0x78ec('0x7')]=function(_0x1f4732,_0xef2f90){return _0x1f4732['define'](_0x78ec('0x8'),attributes,{'tableName':'tools_tags','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 4f2c81e..04e323e 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5597ab,_0x36f4a5){var _0x4d9ad8=function(_0x4d2f57){while(--_0x4d2f57){_0x5597ab['push'](_0x5597ab['shift']());}};_0x4d9ad8(++_0x36f4a5);}(_0xac9d,0x14d));var _0xdac9=function(_0x1c3e42,_0x1a4fe9){_0x1c3e42=_0x1c3e42-0x0;var _0x348fdc=_0xac9d[_0x1c3e42];return _0x348fdc;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0x106f=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird'];(function(_0x3829d8,_0x5c6da9){var _0x485cbc=function(_0x4cbed4){while(--_0x4cbed4){_0x3829d8['push'](_0x3829d8['shift']());}};_0x485cbc(++_0x5c6da9);}(_0x106f,0x162));var _0xf106=function(_0x4f1bb4,_0x416b08){_0x4f1bb4=_0x4f1bb4-0x0;var _0xde94eb=_0x106f[_0x4f1bb4];return _0xde94eb;};'use strict';var _=require(_0xf106('0x0'));var util=require(_0xf106('0x1'));var moment=require('moment');var BPromise=require(_0xf106('0x2'));var rs=require(_0xf106('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf106('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf106('0x5'))(_0xf106('0x6'));var config=require(_0xf106('0x7'));var jayson=require(_0xf106('0x8'));var client=jayson[_0xf106('0x9')][_0xf106('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc9588d,_0x546acc,_0x4ea3b8){return new BPromise(function(_0x3ac1bd,_0x5ea4f0){return client['request'](_0xc9588d,_0x4ea3b8)['then'](function(_0x4bd78d){logger['info'](_0xf106('0xb'),_0x546acc,_0xf106('0xc'));logger[_0xf106('0xd')](_0xf106('0xe'),_0x546acc,_0xf106('0xc'),JSON[_0xf106('0xf')](_0x4bd78d));if(_0x4bd78d[_0xf106('0x10')]){if(_0x4bd78d[_0xf106('0x10')][_0xf106('0x11')]===0x1f4){logger[_0xf106('0x10')](_0xf106('0xb'),_0x546acc,_0x4bd78d['error'][_0xf106('0x12')]);return _0x5ea4f0(_0x4bd78d[_0xf106('0x10')]['message']);}logger['error'](_0xf106('0xb'),_0x546acc,_0x4bd78d[_0xf106('0x10')][_0xf106('0x12')]);return _0x3ac1bd(_0x4bd78d['error'][_0xf106('0x12')]);}else{logger[_0xf106('0x13')](_0xf106('0xb'),_0x546acc,'request\x20sent');_0x3ac1bd(_0x4bd78d[_0xf106('0x14')][_0xf106('0x12')]);}})['catch'](function(_0x134f6d){logger[_0xf106('0x10')](_0xf106('0xb'),_0x546acc,_0x134f6d);_0x5ea4f0(_0x134f6d);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 4c86e74..6ec14e9 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 961fe21..1a1d156 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 _0x757a=['exports','STRING'];(function(_0x22827a,_0x1be888){var _0x46398e=function(_0x4e610d){while(--_0x4e610d){_0x22827a['push'](_0x22827a['shift']());}};_0x46398e(++_0x1be888);}(_0x757a,0xde));var _0xa757=function(_0x49ea40,_0x1337b8){_0x49ea40=_0x49ea40-0x0;var _0x4fbd34=_0x757a[_0x49ea40];return _0x4fbd34;};'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 +var _0x2032=['name','exports','STRING'];(function(_0x562ec8,_0x3ce86c){var _0x39d8f8=function(_0x59bb97){while(--_0x59bb97){_0x562ec8['push'](_0x562ec8['shift']());}};_0x39d8f8(++_0x3ce86c);}(_0x2032,0xd9));var _0x2203=function(_0x646c20,_0x4aaf64){_0x646c20=_0x646c20-0x0;var _0x6644c2=_0x2032[_0x646c20];return _0x6644c2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 712bec4..33e6170 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 _0xa733=['Whatsapp','transaction','through','penalty','TeamVoiceQueue','User','emit','Queue:save','QueueId','voicePause','interface','upsert','isNil','format','SIP/%s','all','VoicePrefixId','removeAgents','Sms','Openchannel','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./team.socket','sendStatus','end','status','json','offset','undefined','limit','count','save','error','stack','name','send','index','map','Team','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','length','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','sort','Queues','addQueues','add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Fax'];(function(_0x13a4bf,_0x56cb27){var _0x2933d6=function(_0x4a966f){while(--_0x4a966f){_0x13a4bf['push'](_0x13a4bf['shift']());}};_0x2933d6(++_0x56cb27);}(_0xa733,0xb3));var _0x3a73=function(_0x4bf0be,_0x5444c0){_0x4bf0be=_0x4bf0be-0x0;var _0x13d426=_0xa733[_0x4bf0be];return _0x13d426;};'use strict';var emlformat=require(_0x3a73('0x0'));var rimraf=require(_0x3a73('0x1'));var zipdir=require(_0x3a73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3a73('0x3'));var BPromise=require(_0x3a73('0x4'));var Mustache=require('mustache');var util=require(_0x3a73('0x5'));var path=require(_0x3a73('0x6'));var sox=require(_0x3a73('0x7'));var csv=require('to-csv');var ejs=require(_0x3a73('0x8'));var fs=require('fs');var fs_extra=require(_0x3a73('0x9'));var _=require(_0x3a73('0xa'));var squel=require(_0x3a73('0xb'));var crypto=require(_0x3a73('0xc'));var jsforce=require(_0x3a73('0xd'));var deskjs=require(_0x3a73('0xe'));var toCsv=require(_0x3a73('0xf'));var querystring=require('querystring');var Papa=require(_0x3a73('0x10'));var Redis=require(_0x3a73('0x11'));var authService=require(_0x3a73('0x12'));var qs=require(_0x3a73('0x13'));var as=require(_0x3a73('0x14'));var hardwareService=require(_0x3a73('0x15'));var logger=require(_0x3a73('0x16'))(_0x3a73('0x17'));var utils=require(_0x3a73('0x18'));var config=require(_0x3a73('0x19'));var licenseUtil=require(_0x3a73('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3a73('0x1b')](config[_0x3a73('0x1c')],{'host':_0x3a73('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a73('0x1c')]));require(_0x3a73('0x1e'))['register'](socket);function respondWithStatusCode(_0x4cbc4d,_0x82f6b4){_0x82f6b4=_0x82f6b4||0xcc;return function(_0x2a9e08){if(_0x2a9e08){return _0x4cbc4d[_0x3a73('0x1f')](_0x82f6b4);}return _0x4cbc4d['status'](_0x82f6b4)[_0x3a73('0x20')]();};}function respondWithResult(_0x21edcc,_0x5a836e){_0x5a836e=_0x5a836e||0xc8;return function(_0x527180){if(_0x527180){return _0x21edcc[_0x3a73('0x21')](_0x5a836e)[_0x3a73('0x22')](_0x527180);}};}function respondWithFilteredResult(_0x42ceb9,_0x31d555){return function(_0x4712f6){if(_0x4712f6){var _0x14756d=typeof _0x31d555[_0x3a73('0x23')]===_0x3a73('0x24')&&typeof _0x31d555[_0x3a73('0x25')]===_0x3a73('0x24');var _0x3d2190=_0x4712f6[_0x3a73('0x26')];var _0x15b612=_0x14756d?0x0:_0x31d555['offset'];var _0x3f9205=_0x14756d?_0x4712f6[_0x3a73('0x26')]:_0x31d555['offset']+_0x31d555[_0x3a73('0x25')];var _0x1760f0;if(_0x3f9205>=_0x3d2190){_0x3f9205=_0x3d2190;_0x1760f0=0xc8;}else{_0x1760f0=0xce;}_0x42ceb9[_0x3a73('0x21')](_0x1760f0);return _0x42ceb9['set']('Content-Range',_0x15b612+'-'+_0x3f9205+'/'+_0x3d2190)[_0x3a73('0x22')](_0x4712f6);}return null;};}function patchUpdates(_0x1e53b2){return function(_0x226668){try{jsonpatch['apply'](_0x226668,_0x1e53b2,!![]);}catch(_0x10f7de){return BPromise['reject'](_0x10f7de);}return _0x226668[_0x3a73('0x27')]();};}function saveUpdates(_0x52b6f1,_0x102792){return function(_0x5633d0){if(_0x5633d0){return _0x5633d0['update'](_0x52b6f1)['then'](function(_0x57f5b7){return _0x57f5b7;});}return null;};}function handleEntityNotFound(_0x38b9c6,_0x5ce2b7){return function(_0x3ba8cc){if(!_0x3ba8cc){_0x38b9c6[_0x3a73('0x1f')](0x194);}return _0x3ba8cc;};}function handleError(_0xaf4a9c,_0x5a7feb){_0x5a7feb=_0x5a7feb||0x1f4;return function(_0x577808){logger[_0x3a73('0x28')](_0x577808[_0x3a73('0x29')]);if(_0x577808['name']){delete _0x577808[_0x3a73('0x2a')];}_0xaf4a9c[_0x3a73('0x21')](_0x5a7feb)[_0x3a73('0x2b')](_0x577808);};}exports[_0x3a73('0x2c')]=function(_0x395f41,_0x58da3a){var _0x45ffec={},_0x500299={},_0x5c8f2e={'count':0x0,'rows':[]};var _0x10fe2a=_[_0x3a73('0x2d')](db[_0x3a73('0x2e')][_0x3a73('0x2f')],function(_0x48d605){return{'name':_0x48d605[_0x3a73('0x30')],'type':_0x48d605['type']['key']};});_0x500299[_0x3a73('0x31')]=_[_0x3a73('0x2d')](_0x10fe2a,_0x3a73('0x2a'));_0x500299[_0x3a73('0x32')]=_[_0x3a73('0x33')](_0x395f41['query']);_0x500299[_0x3a73('0x34')]=_[_0x3a73('0x35')](_0x500299[_0x3a73('0x31')],_0x500299[_0x3a73('0x32')]);_0x45ffec[_0x3a73('0x36')]=_[_0x3a73('0x35')](_0x500299[_0x3a73('0x31')],qs[_0x3a73('0x37')](_0x395f41[_0x3a73('0x32')][_0x3a73('0x37')]));_0x45ffec[_0x3a73('0x36')]=_0x45ffec['attributes']['length']?_0x45ffec['attributes']:_0x500299[_0x3a73('0x31')];if(!_0x395f41[_0x3a73('0x32')][_0x3a73('0x38')](_0x3a73('0x39'))){_0x45ffec[_0x3a73('0x25')]=qs[_0x3a73('0x25')](_0x395f41[_0x3a73('0x32')][_0x3a73('0x25')]);_0x45ffec['offset']=qs[_0x3a73('0x23')](_0x395f41['query'][_0x3a73('0x23')]);}_0x45ffec[_0x3a73('0x3a')]=qs['sort'](_0x395f41['query']['sort']);_0x45ffec[_0x3a73('0x3b')]=qs[_0x3a73('0x34')](_[_0x3a73('0x3c')](_0x395f41['query'],_0x500299[_0x3a73('0x34')]),_0x10fe2a);if(_0x395f41[_0x3a73('0x32')][_0x3a73('0x3d')]){_0x45ffec[_0x3a73('0x3b')]=_[_0x3a73('0x3e')](_0x45ffec[_0x3a73('0x3b')],{'$or':_[_0x3a73('0x2d')](_0x10fe2a,function(_0xc5bdfb){if(_0xc5bdfb[_0x3a73('0x3f')]!==_0x3a73('0x40')){var _0x1df67b={};_0x1df67b[_0xc5bdfb[_0x3a73('0x2a')]]={'$like':'%'+_0x395f41[_0x3a73('0x32')][_0x3a73('0x3d')]+'%'};return _0x1df67b;}})});}_0x45ffec=_['merge']({},_0x45ffec,_0x395f41[_0x3a73('0x41')]);var _0x122401={'where':_0x45ffec['where']};return db[_0x3a73('0x2e')][_0x3a73('0x26')](_0x122401)[_0x3a73('0x42')](function(_0x58e6b2){_0x5c8f2e[_0x3a73('0x26')]=_0x58e6b2;if(_0x395f41[_0x3a73('0x32')][_0x3a73('0x43')]){_0x45ffec[_0x3a73('0x44')]=[{'all':!![]}];}return db['Team'][_0x3a73('0x45')](_0x45ffec);})[_0x3a73('0x42')](function(_0x526b0b){_0x5c8f2e[_0x3a73('0x46')]=_0x526b0b;return _0x5c8f2e;})[_0x3a73('0x42')](respondWithFilteredResult(_0x58da3a,_0x45ffec))[_0x3a73('0x47')](handleError(_0x58da3a,null));};exports[_0x3a73('0x48')]=function(_0xf5aed,_0x3b8992){var _0x4f0314={'raw':![],'where':{'id':_0xf5aed[_0x3a73('0x49')]['id']}},_0x1c8f3a={};_0x1c8f3a['model']=_['keys'](db[_0x3a73('0x2e')][_0x3a73('0x2f')]);_0x1c8f3a[_0x3a73('0x32')]=_[_0x3a73('0x33')](_0xf5aed['query']);_0x1c8f3a[_0x3a73('0x34')]=_[_0x3a73('0x35')](_0x1c8f3a['model'],_0x1c8f3a[_0x3a73('0x32')]);_0x4f0314['attributes']=_['intersection'](_0x1c8f3a['model'],qs[_0x3a73('0x37')](_0xf5aed[_0x3a73('0x32')][_0x3a73('0x37')]));_0x4f0314['attributes']=_0x4f0314['attributes'][_0x3a73('0x4a')]?_0x4f0314[_0x3a73('0x36')]:_0x1c8f3a[_0x3a73('0x31')];if(_0xf5aed[_0x3a73('0x32')][_0x3a73('0x43')]){_0x4f0314[_0x3a73('0x44')]=[{'all':!![]}];}_0x4f0314=_[_0x3a73('0x3e')]({},_0x4f0314,_0xf5aed['options']);return db[_0x3a73('0x2e')][_0x3a73('0x4b')](_0x4f0314)[_0x3a73('0x42')](handleEntityNotFound(_0x3b8992,null))[_0x3a73('0x42')](respondWithResult(_0x3b8992,null))[_0x3a73('0x47')](handleError(_0x3b8992,null));};exports['create']=function(_0x3b1b78,_0x37ca01){return db[_0x3a73('0x2e')]['create'](_0x3b1b78['body'],{})[_0x3a73('0x42')](function(_0x2a4173){var _0xf0ce2e=_0x3b1b78[_0x3a73('0x4c')][_0x3a73('0x4d')]({'plain':!![]});if(!_0xf0ce2e)throw new Error(_0x3a73('0x4e'));if(_0xf0ce2e[_0x3a73('0x4f')]===_0x3a73('0x4c')){var _0x3d9e6f=_0x2a4173['get']({'plain':!![]});var _0x1d9d78=_0x3a73('0x50');return db[_0x3a73('0x51')][_0x3a73('0x4b')]({'where':{'name':_0x1d9d78,'userProfileId':_0xf0ce2e[_0x3a73('0x52')]},'raw':!![]})['then'](function(_0xf8e516){if(_0xf8e516&&_0xf8e516[_0x3a73('0x53')]===0x0){return db[_0x3a73('0x54')][_0x3a73('0x55')]({'name':_0x3d9e6f[_0x3a73('0x2a')],'resourceId':_0x3d9e6f['id'],'type':_0xf8e516[_0x3a73('0x2a')],'sectionId':_0xf8e516['id']},{})[_0x3a73('0x42')](function(){return _0x2a4173;});}else{return _0x2a4173;}})[_0x3a73('0x47')](function(_0x514c34){logger[_0x3a73('0x28')](_0x3a73('0x56'),_0x514c34);throw _0x514c34;});}return _0x2a4173;})[_0x3a73('0x42')](respondWithResult(_0x37ca01,0xc9))[_0x3a73('0x47')](handleError(_0x37ca01,null));};exports[_0x3a73('0x57')]=function(_0x208a78,_0xe7e8ef){if(_0x208a78[_0x3a73('0x58')]['id']){delete _0x208a78[_0x3a73('0x58')]['id'];}return db[_0x3a73('0x2e')][_0x3a73('0x4b')]({'where':{'id':_0x208a78[_0x3a73('0x49')]['id']}})[_0x3a73('0x42')](handleEntityNotFound(_0xe7e8ef,null))['then'](saveUpdates(_0x208a78[_0x3a73('0x58')],null))[_0x3a73('0x42')](respondWithResult(_0xe7e8ef,null))[_0x3a73('0x47')](handleError(_0xe7e8ef,null));};exports[_0x3a73('0x59')]=function(_0x269435,_0xef1cdf){var _0x358fb6=_0x269435['params']['id'];var _0x47f0c5=[];return db['sequelize']['transaction'](function(_0x3c8625){var _0x5a3641=_0x3a73('0x5a')+_0x358fb6;return db[_0x3a73('0x5b')][_0x3a73('0x32')](_0x5a3641,{'type':db[_0x3a73('0x5c')][_0x3a73('0x5d')][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625})[_0x3a73('0x42')](function(_0x3bb3e2){_0x47f0c5=_[_0x3a73('0x2d')](_0x3bb3e2,function(_0x340344){return Number(_0x340344['UserId']);});})[_0x3a73('0x42')](function(){var _0x442552='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x358fb6;return db[_0x3a73('0x5b')][_0x3a73('0x32')](_0x442552,{'type':db[_0x3a73('0x5c')]['QueryTypes'][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625});})[_0x3a73('0x42')](function(_0x371a68){var _0x4e887e=_[_0x3a73('0x2d')](_0x371a68,function(_0x1405a4){return Number(_0x1405a4[_0x3a73('0x5f')]);});return db[_0x3a73('0x60')]['destroy']({'where':{'UserId':{'$in':_0x47f0c5},'VoiceQueueId':{'$in':_0x4e887e}},'transaction':_0x3c8625});})[_0x3a73('0x42')](function(){var _0x5632dd=_0x3a73('0x61')+_0x358fb6;return db[_0x3a73('0x5b')][_0x3a73('0x32')](_0x5632dd,{'type':db['Sequelize'][_0x3a73('0x5d')][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625});})['then'](function(_0x4baf3b){var _0x43df0a=_[_0x3a73('0x2d')](_0x4baf3b,function(_0x54b0d5){return Number(_0x54b0d5[_0x3a73('0x62')]);});return db[_0x3a73('0x63')]['destroy']({'where':{'UserId':{'$in':_0x47f0c5},'MailQueueId':{'$in':_0x43df0a}},'transaction':_0x3c8625});})[_0x3a73('0x42')](function(){var _0x4c67e5='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x358fb6;return db[_0x3a73('0x5b')][_0x3a73('0x32')](_0x4c67e5,{'type':db[_0x3a73('0x5c')][_0x3a73('0x5d')][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625});})[_0x3a73('0x42')](function(_0x4bc379){var _0xcff21d=_[_0x3a73('0x2d')](_0x4bc379,function(_0x3b82dd){return Number(_0x3b82dd[_0x3a73('0x64')]);});return db[_0x3a73('0x65')][_0x3a73('0x59')]({'where':{'UserId':{'$in':_0x47f0c5},'SmsQueueId':{'$in':_0xcff21d}},'transaction':_0x3c8625});})[_0x3a73('0x42')](function(){var _0x3e4636=_0x3a73('0x66')+_0x358fb6;return db[_0x3a73('0x5b')][_0x3a73('0x32')](_0x3e4636,{'type':db[_0x3a73('0x5c')][_0x3a73('0x5d')]['SELECT'],'raw':!![],'transaction':_0x3c8625});})[_0x3a73('0x42')](function(_0xe9fe12){var _0x440587=_[_0x3a73('0x2d')](_0xe9fe12,function(_0xeeb461){return Number(_0xeeb461[_0x3a73('0x67')]);});return db[_0x3a73('0x68')][_0x3a73('0x59')]({'where':{'UserId':{'$in':_0x47f0c5},'ChatQueueId':{'$in':_0x440587}},'transaction':_0x3c8625});})['then'](function(){var _0x370384=_0x3a73('0x69')+_0x358fb6;return db[_0x3a73('0x5b')]['query'](_0x370384,{'type':db[_0x3a73('0x5c')][_0x3a73('0x5d')][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625});})['then'](function(_0x4a422b){var _0x438430=_[_0x3a73('0x2d')](_0x4a422b,function(_0xc3657e){return Number(_0xc3657e[_0x3a73('0x6a')]);});return db[_0x3a73('0x6b')][_0x3a73('0x59')]({'where':{'UserId':{'$in':_0x47f0c5},'FaxQueueId':{'$in':_0x438430}},'transaction':_0x3c8625});})[_0x3a73('0x42')](function(){var _0x1106b5=_0x3a73('0x6c')+_0x358fb6;return db['sequelize'][_0x3a73('0x32')](_0x1106b5,{'type':db['Sequelize'][_0x3a73('0x5d')][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625});})[_0x3a73('0x42')](function(_0x3ef70f){var _0x41e6e9=_['map'](_0x3ef70f,function(_0x24ebb2){return Number(_0x24ebb2[_0x3a73('0x6d')]);});return db[_0x3a73('0x6e')][_0x3a73('0x59')]({'where':{'UserId':{'$in':_0x47f0c5},'OpenchannelQueueId':{'$in':_0x41e6e9}},'transaction':_0x3c8625});})[_0x3a73('0x42')](function(){var _0x4da2c2='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x358fb6;return db[_0x3a73('0x5b')][_0x3a73('0x32')](_0x4da2c2,{'type':db[_0x3a73('0x5c')][_0x3a73('0x5d')][_0x3a73('0x5e')],'raw':!![],'transaction':_0x3c8625});})[_0x3a73('0x42')](function(_0x713966){var _0x25e7ed=_[_0x3a73('0x2d')](_0x713966,function(_0xf9b163){return Number(_0xf9b163[_0x3a73('0x6f')]);});return db[_0x3a73('0x70')][_0x3a73('0x59')]({'where':{'UserId':{'$in':_0x47f0c5},'WhatsappQueueId':{'$in':_0x25e7ed}},'transaction':_0x3c8625});})['then'](function(){return db[_0x3a73('0x71')]['find']({'where':{'TeamId':_0x358fb6}});})[_0x3a73('0x42')](function(_0x356eba){if(_0x356eba===null){return;}return db[_0x3a73('0x72')][_0x3a73('0x59')]({'where':{'UserId':{'$in':_0x47f0c5},'VoicePrefixId':_0x356eba['VoicePrefixId']},'transaction':_0x3c8625});})[_0x3a73('0x42')](function(){return db['Team'][_0x3a73('0x59')]({'where':{'id':_0x358fb6},'cascade':!![],'transaction':_0x3c8625});})['then'](function(_0x2b568e){if(_0x2b568e===0x0){_0xef1cdf[_0x3a73('0x1f')](0x194);}else{return db[_0x3a73('0x54')][_0x3a73('0x59')]({'where':{'type':'Teams','resourceId':_0x358fb6},'cascade':!![],'transaction':_0x3c8625})[_0x3a73('0x42')](function(){_0xef1cdf[_0x3a73('0x21')](0xcc)[_0x3a73('0x20')]();});}})[_0x3a73('0x47')](function(_0x540481){_0xef1cdf['status'](0x1f4)[_0x3a73('0x2b')](_0x540481);});});};exports[_0x3a73('0x73')]=function(_0x48002c,_0x3cf289,_0x56e0ac){return db[_0x3a73('0x2e')][_0x3a73('0x74')]({'where':{'id':_0x48002c[_0x3a73('0x49')]['id']}})[_0x3a73('0x42')](handleEntityNotFound(_0x3cf289,null))['then'](function(_0x152086){if(!_0x48002c['query'][_0x3a73('0x75')]||!utils[_0x3a73('0x76')](_0x48002c[_0x3a73('0x32')][_0x3a73('0x75')])){throw new db[(_0x3a73('0x5c'))][(_0x3a73('0x77'))](_0x3a73('0x78'));}var _0x381b0f={};var _0x389134={};_0x389134[_0x3a73('0x31')]=_[_0x3a73('0x33')](db[_[_0x3a73('0x79')](_0x48002c[_0x3a73('0x32')][_0x3a73('0x75')][_0x3a73('0x7a')]())+'Queue']['rawAttributes']);_0x389134[_0x3a73('0x32')]=_[_0x3a73('0x33')](_0x48002c[_0x3a73('0x32')]);_0x389134[_0x3a73('0x34')]=_[_0x3a73('0x35')](_0x389134[_0x3a73('0x31')],_0x389134[_0x3a73('0x32')]);_0x381b0f[_0x3a73('0x36')]=_[_0x3a73('0x35')](_0x389134[_0x3a73('0x31')],qs[_0x3a73('0x37')](_0x48002c[_0x3a73('0x32')]['fields']));_0x381b0f[_0x3a73('0x36')]=_0x381b0f[_0x3a73('0x36')]['length']?_0x381b0f[_0x3a73('0x36')]:_0x389134[_0x3a73('0x31')];_0x381b0f[_0x3a73('0x25')]=qs['limit'](_0x48002c[_0x3a73('0x32')][_0x3a73('0x25')]);_0x381b0f['offset']=qs['offset'](_0x48002c[_0x3a73('0x32')][_0x3a73('0x23')]);_0x381b0f[_0x3a73('0x3a')]=qs[_0x3a73('0x7b')](_0x48002c[_0x3a73('0x32')][_0x3a73('0x7b')]);_0x381b0f['where']=qs[_0x3a73('0x34')](_[_0x3a73('0x3c')](_0x48002c['query'],_0x389134[_0x3a73('0x34')]));_0x381b0f=_[_0x3a73('0x3e')]({},_0x381b0f,_0x48002c['options']);return _0x152086[_0x3a73('0x4d')+_['capitalize'](_0x48002c[_0x3a73('0x32')][_0x3a73('0x75')]['toLowerCase']())+_0x3a73('0x7c')](_0x381b0f);})[_0x3a73('0x42')](respondWithResult(_0x3cf289,null))[_0x3a73('0x47')](handleError(_0x3cf289,null));};exports[_0x3a73('0x7d')]=function(_0x26d166,_0x27f0b5,_0x1e30f7){return db['Team']['findOne']({'where':{'id':_0x26d166[_0x3a73('0x49')]['id']}})[_0x3a73('0x42')](function(_0x366649){if(_0x366649){if(!_0x26d166[_0x3a73('0x58')][_0x3a73('0x75')]||!utils[_0x3a73('0x76')](_0x26d166[_0x3a73('0x58')][_0x3a73('0x75')])){throw new db[(_0x3a73('0x5c'))][(_0x3a73('0x77'))](_0x3a73('0x78'));}return _0x366649[_0x3a73('0x7e')+_[_0x3a73('0x79')](_0x26d166[_0x3a73('0x58')][_0x3a73('0x75')][_0x3a73('0x7a')]())+_0x3a73('0x7c')](_0x26d166[_0x3a73('0x58')][_0x3a73('0x7f')]);}return null;})[_0x3a73('0x42')](handleEntityNotFound(_0x27f0b5,null))[_0x3a73('0x42')](respondWithStatusCode(_0x27f0b5,null))['catch'](handleError(_0x27f0b5,null));};exports[_0x3a73('0x80')]=function(_0x46ce95,_0x41c456,_0x31ada4){return db[_0x3a73('0x2e')][_0x3a73('0x74')]({'where':{'id':_0x46ce95[_0x3a73('0x49')]['id']}})[_0x3a73('0x42')](function(_0x37a48b){if(_0x37a48b){if(!_0x46ce95[_0x3a73('0x32')][_0x3a73('0x75')]||!utils[_0x3a73('0x76')](_0x46ce95['query'][_0x3a73('0x75')])){throw new db['Sequelize'][(_0x3a73('0x77'))](_0x3a73('0x78'));}return _0x37a48b[_0x3a73('0x81')+_[_0x3a73('0x79')](_0x46ce95['query']['channel'][_0x3a73('0x7a')]())+_0x3a73('0x7c')](_0x46ce95[_0x3a73('0x32')][_0x3a73('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x41c456,null))[_0x3a73('0x42')](respondWithStatusCode(_0x41c456,null))['catch'](handleError(_0x41c456,null));};exports['addAgents']=function(_0x4eac0d,_0x31cc88){var _0x3a62ad=_[_0x3a73('0x82')](_0x4eac0d['body']['ids'])?_0x4eac0d['body'][_0x3a73('0x7f')]:[_0x4eac0d[_0x3a73('0x58')]['ids']];var _0x20d178=_0x4eac0d['params']['id'];return db[_0x3a73('0x2e')][_0x3a73('0x4b')]({'where':{'id':_0x20d178}})['then'](handleEntityNotFound(_0x31cc88,null))[_0x3a73('0x42')](function(_0x59ff73){if(_0x59ff73){var _0x5b3b2f=[_0x3a73('0x83'),_0x3a73('0x84'),_0x3a73('0x85'),'Sms',_0x3a73('0x86'),'Openchannel',_0x3a73('0x87')];return db[_0x3a73('0x5b')][_0x3a73('0x88')](function(_0x1093dd){var _0x32e107=_['map'](_0x5b3b2f,function(_0x188cc3){var _0x56289e={'attributes':['id',_0x3a73('0x2a')]};if(_0x188cc3===_0x3a73('0x83')){_0x56289e[_0x3a73('0x89')]={'attributes':[_0x3a73('0x8a')]};}return _0x59ff73[_0x3a73('0x4d')+_0x188cc3+_0x3a73('0x7c')](_0x56289e)[_0x3a73('0x42')](function(_0x3a30a9){var _0x56f22e=_[_0x3a73('0x2d')](_0x3a30a9,function(_0xa4c81d){var _0x3cf902=_[_0x3a73('0x2d')](_0x3a62ad,function(_0x423910){var _0x275db1={'where':{'UserId':_0x423910,[_0x188cc3+'QueueId']:_0xa4c81d['id']},'transaction':_0x1093dd};if(_0x188cc3===_0x3a73('0x83')){_0x275db1[_0x3a73('0x1b')]={'penalty':_0xa4c81d[_0x3a73('0x8b')][_0x3a73('0x8a')]};}return db[_0x3a73('0x8c')+_0x188cc3+'Queue']['findOrCreate'](_0x275db1)['then'](function(){socket[_0x3a73('0x8d')](_0x3a73('0x4c')+_0x188cc3+_0x3a73('0x8e'),{'UserId':_0x423910,[_0x188cc3+_0x3a73('0x8f')]:_0xa4c81d['id']});if(_0x188cc3!=='Voice'){return;}return db[_0x3a73('0x8c')][_0x3a73('0x45')]({'where':{'id':_0x3a62ad,'online':0x1},'attributes':['id',_0x3a73('0x2a'),'online',_0x3a73('0x90'),_0x3a73('0x91')],'raw':!![]})[_0x3a73('0x42')](function(_0x86ac8){var _0xc2282b=_[_0x3a73('0x2d')](_0x86ac8,function(_0x28b1b7){return db['UserVoiceQueueRt'][_0x3a73('0x92')]({'membername':_0x28b1b7[_0x3a73('0x2a')],'UserId':_0x28b1b7['id'],'queue_name':_0xa4c81d[_0x3a73('0x2a')],'VoiceQueueId':_0xa4c81d['id'],'interface':_[_0x3a73('0x93')](_0x28b1b7[_0x3a73('0x91')])?util[_0x3a73('0x94')](_0x3a73('0x95'),_0x28b1b7[_0x3a73('0x2a')]):_0x28b1b7[_0x3a73('0x91')],'paused':_0x28b1b7[_0x3a73('0x90')]||![],'penalty':_0xa4c81d[_0x3a73('0x8b')]['penalty']},{'transaction':_0x1093dd});});return Promise[_0x3a73('0x96')](_0xc2282b);});});});return Promise[_0x3a73('0x96')](_0x3cf902);});return Promise[_0x3a73('0x96')](_0x56f22e);})[_0x3a73('0x42')](function(){return db[_0x3a73('0x71')]['findOne']({'where':{'teamId':_0x20d178}})[_0x3a73('0x42')](function(_0x5e34d5){if(_0x5e34d5){var _0x2acf9d=_[_0x3a73('0x2d')](_0x3a62ad,function(_0x56c603){db['UserVoicePrefix'][_0x3a73('0x92')]({'UserId':_0x56c603,'VoicePrefixId':_0x5e34d5[_0x3a73('0x97')]});});return Promise[_0x3a73('0x96')](_0x2acf9d);}});});});return Promise['all'](_0x32e107)[_0x3a73('0x42')](function(){return _0x59ff73['addAgents'](_0x3a62ad,{'transaction':_0x1093dd})['spread'](function(_0x3594e5){return _0x3594e5;});});});}})[_0x3a73('0x42')](respondWithResult(_0x31cc88,null))[_0x3a73('0x47')](handleError(_0x31cc88,null));};exports[_0x3a73('0x98')]=function(_0x330adb,_0x4b0b78){var _0x5a21c5=_[_0x3a73('0x82')](_0x330adb[_0x3a73('0x32')][_0x3a73('0x7f')])?_0x330adb['query'][_0x3a73('0x7f')]:[_0x330adb['query'][_0x3a73('0x7f')]];var _0x113e80=_0x330adb[_0x3a73('0x49')]['id'];return db[_0x3a73('0x2e')][_0x3a73('0x4b')]({'where':{'id':_0x113e80}})[_0x3a73('0x42')](handleEntityNotFound(_0x4b0b78,null))[_0x3a73('0x42')](function(_0x52b1ab){if(_0x52b1ab){var _0x4eafac=[_0x3a73('0x83'),_0x3a73('0x84'),_0x3a73('0x85'),_0x3a73('0x99'),_0x3a73('0x86'),_0x3a73('0x9a'),_0x3a73('0x87')];return db[_0x3a73('0x5b')][_0x3a73('0x88')](function(_0x231c25){var _0x239e58=_['map'](_0x4eafac,function(_0x49456a){var _0x3e8353={'attributes':['id','name']};return _0x52b1ab[_0x3a73('0x4d')+_0x49456a+'Queues'](_0x3e8353)[_0x3a73('0x42')](function(_0x4893bb){var _0x18261a=_[_0x3a73('0x2d')](_0x4893bb,function(_0x547676){return _0x547676[_0x3a73('0x98')](_0x5a21c5,{'transaction':_0x231c25})[_0x3a73('0x42')](function(){var _0x47f3d4=_[_0x3a73('0x2d')](_0x5a21c5,function(_0x397c2c){socket['emit'](_0x3a73('0x4c')+_0x49456a+'Queue:remove',{'UserId':Number(_0x397c2c),[_0x49456a+_0x3a73('0x8f')]:_0x547676['id']});if(_0x49456a!==_0x3a73('0x83')){return;}return db[_0x3a73('0x9b')][_0x3a73('0x59')]({'where':{'VoiceQueueId':_0x547676['id'],'UserId':_0x397c2c},'transaction':_0x231c25});});return Promise[_0x3a73('0x96')](_0x47f3d4);});});return Promise[_0x3a73('0x96')](_0x18261a);});});return Promise[_0x3a73('0x96')](_0x239e58)[_0x3a73('0x42')](function(){return _0x52b1ab['removeAgents'](_0x5a21c5,{'transaction':_0x231c25});})['then'](function(){return db[_0x3a73('0x71')]['findOne']({'where':{'teamId':_0x113e80}})[_0x3a73('0x42')](function(_0x2d6947){if(_0x2d6947){var _0x221a7f=_[_0x3a73('0x2d')](_0x5a21c5,function(_0x452ec2){db[_0x3a73('0x72')][_0x3a73('0x59')]({'where':{'UserId':_0x452ec2,'VoicePrefixId':_0x2d6947[_0x3a73('0x97')]}});});return Promise[_0x3a73('0x96')](_0x221a7f);}});});});}})[_0x3a73('0x42')](respondWithStatusCode(_0x4b0b78,null))[_0x3a73('0x47')](handleError(_0x4b0b78,null));};exports['getAgents']=function(_0x51c4e0,_0x419378,_0x3756fb){var _0x4c98fa={};var _0x2352e8={};var _0x58a137;var _0x3e1d17;return db[_0x3a73('0x2e')][_0x3a73('0x74')]({'where':{'id':_0x51c4e0[_0x3a73('0x49')]['id']}})['then'](handleEntityNotFound(_0x419378,null))[_0x3a73('0x42')](function(_0x175759){if(_0x175759){_0x58a137=_0x175759;_0x2352e8[_0x3a73('0x31')]=_[_0x3a73('0x33')](db[_0x3a73('0x8c')][_0x3a73('0x2f')]);_0x2352e8[_0x3a73('0x32')]=_[_0x3a73('0x33')](_0x51c4e0[_0x3a73('0x32')]);_0x2352e8[_0x3a73('0x34')]=_['intersection'](_0x2352e8[_0x3a73('0x31')],_0x2352e8['query']);_0x4c98fa[_0x3a73('0x36')]=_[_0x3a73('0x35')](_0x2352e8[_0x3a73('0x31')],qs[_0x3a73('0x37')](_0x51c4e0['query'][_0x3a73('0x37')]));_0x4c98fa[_0x3a73('0x36')]=_0x4c98fa[_0x3a73('0x36')][_0x3a73('0x4a')]?_0x4c98fa[_0x3a73('0x36')]:_0x2352e8['model'];_0x4c98fa[_0x3a73('0x3a')]=qs['sort'](_0x51c4e0[_0x3a73('0x32')][_0x3a73('0x7b')]);_0x4c98fa[_0x3a73('0x3b')]=qs[_0x3a73('0x34')](_[_0x3a73('0x3c')](_0x51c4e0['query'],_0x2352e8[_0x3a73('0x34')]));if(_0x51c4e0[_0x3a73('0x32')][_0x3a73('0x3d')]){_0x4c98fa[_0x3a73('0x3b')]=_[_0x3a73('0x3e')](_0x4c98fa[_0x3a73('0x3b')],{'$or':_[_0x3a73('0x2d')](_0x4c98fa[_0x3a73('0x36')],function(_0x3e8f03){var _0x40360b={};_0x40360b[_0x3e8f03]={'$like':'%'+_0x51c4e0['query']['filter']+'%'};return _0x40360b;})});}_0x4c98fa=_['merge']({},_0x4c98fa,_0x51c4e0[_0x3a73('0x41')]);return _0x58a137[_0x3a73('0x9c')](_0x4c98fa);}})[_0x3a73('0x42')](function(_0xa3ad87){if(_0xa3ad87){_0x3e1d17=_0xa3ad87['length'];if(!_0x51c4e0[_0x3a73('0x32')]['hasOwnProperty']('nolimit')){_0x4c98fa[_0x3a73('0x25')]=qs['limit'](_0x51c4e0[_0x3a73('0x32')][_0x3a73('0x25')]);_0x4c98fa['offset']=qs[_0x3a73('0x23')](_0x51c4e0[_0x3a73('0x32')][_0x3a73('0x23')]);}return _0x58a137[_0x3a73('0x9c')](_0x4c98fa);}})['then'](function(_0x72b865){if(_0x72b865){return _0x72b865?{'count':_0x3e1d17,'rows':_0x72b865}:null;}})['then'](respondWithResult(_0x419378,null))['catch'](handleError(_0x419378,null));}; \ No newline at end of file +var _0x72b6=['create','user','role','get','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','merge','catch','addQueues','Queues','ids','removeQueues','ValidationError','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','penalty','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','isNil','format','SIP/%s','interface','TeamVoiceQueue','all','upsert','spread','removeAgents','Queue:remove','getAgents','filter','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','options','Team','include','findAll','rows','show','params','find'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x72b6,0x193));var _0x672b=function(_0x558104,_0x8c8f6a){_0x558104=_0x558104-0x0;var _0x52ac59=_0x72b6[_0x558104];return _0x52ac59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x672b('0x0'));var rp=require('request-promise');var moment=require(_0x672b('0x1'));var BPromise=require(_0x672b('0x2'));var Mustache=require(_0x672b('0x3'));var util=require('util');var path=require(_0x672b('0x4'));var sox=require('sox');var csv=require(_0x672b('0x5'));var ejs=require(_0x672b('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x672b('0x7'));var crypto=require(_0x672b('0x8'));var jsforce=require(_0x672b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x672b('0x5'));var querystring=require(_0x672b('0xa'));var Papa=require(_0x672b('0xb'));var Redis=require(_0x672b('0xc'));var authService=require(_0x672b('0xd'));var qs=require(_0x672b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x672b('0xf'));var logger=require('../../config/logger')(_0x672b('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x672b('0x11'));var db=require(_0x672b('0x12'))['db'];config[_0x672b('0x13')]=_[_0x672b('0x14')](config[_0x672b('0x13')],{'host':_0x672b('0x15'),'port':0x18eb});var socket=require(_0x672b('0x16'))(new Redis(config[_0x672b('0x13')]));require(_0x672b('0x17'))[_0x672b('0x18')](socket);function respondWithStatusCode(_0x4a07e7,_0x4fab59){_0x4fab59=_0x4fab59||0xcc;return function(_0x1f38ca){if(_0x1f38ca){return _0x4a07e7[_0x672b('0x19')](_0x4fab59);}return _0x4a07e7[_0x672b('0x1a')](_0x4fab59)[_0x672b('0x1b')]();};}function respondWithResult(_0x13a60b,_0x88a1d8){_0x88a1d8=_0x88a1d8||0xc8;return function(_0x5b6932){if(_0x5b6932){return _0x13a60b[_0x672b('0x1a')](_0x88a1d8)['json'](_0x5b6932);}};}function respondWithFilteredResult(_0x5dcd47,_0x412de7){return function(_0xfcceae){if(_0xfcceae){var _0x15e94f=typeof _0x412de7[_0x672b('0x1c')]===_0x672b('0x1d')&&typeof _0x412de7[_0x672b('0x1e')]===_0x672b('0x1d');var _0x36ac4c=_0xfcceae[_0x672b('0x1f')];var _0x3d0f36=_0x15e94f?0x0:_0x412de7['offset'];var _0x2a6cb3=_0x15e94f?_0xfcceae['count']:_0x412de7[_0x672b('0x1c')]+_0x412de7[_0x672b('0x1e')];var _0x536644;if(_0x2a6cb3>=_0x36ac4c){_0x2a6cb3=_0x36ac4c;_0x536644=0xc8;}else{_0x536644=0xce;}_0x5dcd47[_0x672b('0x1a')](_0x536644);return _0x5dcd47[_0x672b('0x20')](_0x672b('0x21'),_0x3d0f36+'-'+_0x2a6cb3+'/'+_0x36ac4c)[_0x672b('0x22')](_0xfcceae);}return null;};}function patchUpdates(_0x473482){return function(_0x894b18){try{jsonpatch[_0x672b('0x23')](_0x894b18,_0x473482,!![]);}catch(_0x57c08e){return BPromise[_0x672b('0x24')](_0x57c08e);}return _0x894b18[_0x672b('0x25')]();};}function saveUpdates(_0x1e05fb,_0x3f66b5){return function(_0xc3511){if(_0xc3511){return _0xc3511['update'](_0x1e05fb)[_0x672b('0x26')](function(_0x364482){return _0x364482;});}return null;};}function handleEntityNotFound(_0x4a3c73,_0x1c27e5){return function(_0x5505bc){if(!_0x5505bc){_0x4a3c73['sendStatus'](0x194);}return _0x5505bc;};}function handleError(_0x2d8943,_0x2cf43e){_0x2cf43e=_0x2cf43e||0x1f4;return function(_0x532bcb){logger[_0x672b('0x27')](_0x532bcb[_0x672b('0x28')]);if(_0x532bcb[_0x672b('0x29')]){delete _0x532bcb[_0x672b('0x29')];}_0x2d8943[_0x672b('0x1a')](_0x2cf43e)['send'](_0x532bcb);};}exports[_0x672b('0x2a')]=function(_0x3d535c,_0x3761e7){var _0x46ed90={},_0x5273ac={},_0x2b5879={'count':0x0,'rows':[]};var _0x30eb16=_['map'](db['Team'][_0x672b('0x2b')],function(_0x3f9bbd){return{'name':_0x3f9bbd['fieldName'],'type':_0x3f9bbd[_0x672b('0x2c')][_0x672b('0x2d')]};});_0x5273ac['model']=_[_0x672b('0x2e')](_0x30eb16,'name');_0x5273ac[_0x672b('0x2f')]=_[_0x672b('0x30')](_0x3d535c[_0x672b('0x2f')]);_0x5273ac[_0x672b('0x31')]=_[_0x672b('0x32')](_0x5273ac['model'],_0x5273ac[_0x672b('0x2f')]);_0x46ed90['attributes']=_[_0x672b('0x32')](_0x5273ac[_0x672b('0x33')],qs[_0x672b('0x34')](_0x3d535c['query'][_0x672b('0x34')]));_0x46ed90[_0x672b('0x35')]=_0x46ed90[_0x672b('0x35')][_0x672b('0x36')]?_0x46ed90[_0x672b('0x35')]:_0x5273ac['model'];if(!_0x3d535c[_0x672b('0x2f')][_0x672b('0x37')]('nolimit')){_0x46ed90[_0x672b('0x1e')]=qs[_0x672b('0x1e')](_0x3d535c['query'][_0x672b('0x1e')]);_0x46ed90['offset']=qs[_0x672b('0x1c')](_0x3d535c[_0x672b('0x2f')]['offset']);}_0x46ed90[_0x672b('0x38')]=qs[_0x672b('0x39')](_0x3d535c['query'][_0x672b('0x39')]);_0x46ed90[_0x672b('0x3a')]=qs['filters'](_[_0x672b('0x3b')](_0x3d535c['query'],_0x5273ac[_0x672b('0x31')]),_0x30eb16);if(_0x3d535c['query']['filter']){_0x46ed90[_0x672b('0x3a')]=_['merge'](_0x46ed90[_0x672b('0x3a')],{'$or':_[_0x672b('0x2e')](_0x30eb16,function(_0x53f526){if(_0x53f526[_0x672b('0x2c')]!=='VIRTUAL'){var _0xe51048={};_0xe51048[_0x53f526['name']]={'$like':'%'+_0x3d535c[_0x672b('0x2f')]['filter']+'%'};return _0xe51048;}})});}_0x46ed90=_['merge']({},_0x46ed90,_0x3d535c[_0x672b('0x3c')]);var _0x227796={'where':_0x46ed90[_0x672b('0x3a')]};return db[_0x672b('0x3d')][_0x672b('0x1f')](_0x227796)[_0x672b('0x26')](function(_0xe23cb1){_0x2b5879[_0x672b('0x1f')]=_0xe23cb1;if(_0x3d535c['query']['includeAll']){_0x46ed90[_0x672b('0x3e')]=[{'all':!![]}];}return db['Team'][_0x672b('0x3f')](_0x46ed90);})['then'](function(_0x2d5c14){_0x2b5879[_0x672b('0x40')]=_0x2d5c14;return _0x2b5879;})['then'](respondWithFilteredResult(_0x3761e7,_0x46ed90))['catch'](handleError(_0x3761e7,null));};exports[_0x672b('0x41')]=function(_0x1589b2,_0xec3999){var _0x3acf14={'raw':![],'where':{'id':_0x1589b2[_0x672b('0x42')]['id']}},_0x53cf22={};_0x53cf22[_0x672b('0x33')]=_[_0x672b('0x30')](db[_0x672b('0x3d')][_0x672b('0x2b')]);_0x53cf22[_0x672b('0x2f')]=_[_0x672b('0x30')](_0x1589b2['query']);_0x53cf22['filters']=_[_0x672b('0x32')](_0x53cf22['model'],_0x53cf22[_0x672b('0x2f')]);_0x3acf14['attributes']=_[_0x672b('0x32')](_0x53cf22[_0x672b('0x33')],qs[_0x672b('0x34')](_0x1589b2['query']['fields']));_0x3acf14[_0x672b('0x35')]=_0x3acf14[_0x672b('0x35')][_0x672b('0x36')]?_0x3acf14[_0x672b('0x35')]:_0x53cf22[_0x672b('0x33')];if(_0x1589b2[_0x672b('0x2f')]['includeAll']){_0x3acf14[_0x672b('0x3e')]=[{'all':!![]}];}_0x3acf14=_['merge']({},_0x3acf14,_0x1589b2[_0x672b('0x3c')]);return db[_0x672b('0x3d')][_0x672b('0x43')](_0x3acf14)['then'](handleEntityNotFound(_0xec3999,null))[_0x672b('0x26')](respondWithResult(_0xec3999,null))['catch'](handleError(_0xec3999,null));};exports[_0x672b('0x44')]=function(_0x3d4065,_0x83a461){return db[_0x672b('0x3d')][_0x672b('0x44')](_0x3d4065['body'],{})[_0x672b('0x26')](function(_0x5dc113){var _0x2cb8aa=_0x3d4065[_0x672b('0x45')]['get']({'plain':!![]});if(!_0x2cb8aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cb8aa[_0x672b('0x46')]===_0x672b('0x45')){var _0x317002=_0x5dc113[_0x672b('0x47')]({'plain':!![]});var _0x3abacd=_0x672b('0x48');return db[_0x672b('0x49')]['find']({'where':{'name':_0x3abacd,'userProfileId':_0x2cb8aa['userProfileId']},'raw':!![]})['then'](function(_0x17a118){if(_0x17a118&&_0x17a118[_0x672b('0x4a')]===0x0){return db[_0x672b('0x4b')][_0x672b('0x44')]({'name':_0x317002[_0x672b('0x29')],'resourceId':_0x317002['id'],'type':_0x17a118[_0x672b('0x29')],'sectionId':_0x17a118['id']},{})['then'](function(){return _0x5dc113;});}else{return _0x5dc113;}})['catch'](function(_0x3dfb8f){logger[_0x672b('0x27')](_0x672b('0x4c'),_0x3dfb8f);throw _0x3dfb8f;});}return _0x5dc113;})[_0x672b('0x26')](respondWithResult(_0x83a461,0xc9))['catch'](handleError(_0x83a461,null));};exports[_0x672b('0x4d')]=function(_0x1048e2,_0x28d3e9){if(_0x1048e2[_0x672b('0x4e')]['id']){delete _0x1048e2['body']['id'];}return db[_0x672b('0x3d')][_0x672b('0x43')]({'where':{'id':_0x1048e2['params']['id']}})['then'](handleEntityNotFound(_0x28d3e9,null))['then'](saveUpdates(_0x1048e2[_0x672b('0x4e')],null))[_0x672b('0x26')](respondWithResult(_0x28d3e9,null))['catch'](handleError(_0x28d3e9,null));};exports['destroy']=function(_0x56d51e,_0x5c28c2){var _0x145644=_0x56d51e[_0x672b('0x42')]['id'];var _0x51d024=[];return db['sequelize'][_0x672b('0x4f')](function(_0x40c9f7){var _0x407766=_0x672b('0x50')+_0x145644;return db[_0x672b('0x51')]['query'](_0x407766,{'type':db[_0x672b('0x52')][_0x672b('0x53')]['SELECT'],'raw':!![],'transaction':_0x40c9f7})[_0x672b('0x26')](function(_0x3ba6ec){_0x51d024=_[_0x672b('0x2e')](_0x3ba6ec,function(_0x1b6b02){return Number(_0x1b6b02[_0x672b('0x54')]);});})['then'](function(){var _0x498350=_0x672b('0x55')+_0x145644;return db[_0x672b('0x51')][_0x672b('0x2f')](_0x498350,{'type':db[_0x672b('0x52')][_0x672b('0x53')]['SELECT'],'raw':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x36cd8e){var _0x22c26d=_[_0x672b('0x2e')](_0x36cd8e,function(_0x5f4b85){return Number(_0x5f4b85[_0x672b('0x56')]);});return db[_0x672b('0x57')][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'VoiceQueueId':{'$in':_0x22c26d}},'transaction':_0x40c9f7});})['then'](function(){var _0x52c0c9=_0x672b('0x59')+_0x145644;return db['sequelize']['query'](_0x52c0c9,{'type':db[_0x672b('0x52')][_0x672b('0x53')]['SELECT'],'raw':!![],'transaction':_0x40c9f7});})['then'](function(_0x444dbc){var _0x4d7139=_[_0x672b('0x2e')](_0x444dbc,function(_0x1ddd87){return Number(_0x1ddd87[_0x672b('0x5a')]);});return db['UserMailQueue'][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'MailQueueId':{'$in':_0x4d7139}},'transaction':_0x40c9f7});})['then'](function(){var _0x2ada60=_0x672b('0x5b')+_0x145644;return db[_0x672b('0x51')][_0x672b('0x2f')](_0x2ada60,{'type':db[_0x672b('0x52')][_0x672b('0x53')][_0x672b('0x5c')],'raw':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x515ce1){var _0x3ad92a=_[_0x672b('0x2e')](_0x515ce1,function(_0x2fbbd2){return Number(_0x2fbbd2[_0x672b('0x5d')]);});return db[_0x672b('0x5e')][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'SmsQueueId':{'$in':_0x3ad92a}},'transaction':_0x40c9f7});})[_0x672b('0x26')](function(){var _0x26d514=_0x672b('0x5f')+_0x145644;return db['sequelize'][_0x672b('0x2f')](_0x26d514,{'type':db[_0x672b('0x52')][_0x672b('0x53')][_0x672b('0x5c')],'raw':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x4271d3){var _0x228ba4=_[_0x672b('0x2e')](_0x4271d3,function(_0x160828){return Number(_0x160828[_0x672b('0x60')]);});return db[_0x672b('0x61')][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'ChatQueueId':{'$in':_0x228ba4}},'transaction':_0x40c9f7});})['then'](function(){var _0x1880a5=_0x672b('0x62')+_0x145644;return db[_0x672b('0x51')][_0x672b('0x2f')](_0x1880a5,{'type':db['Sequelize'][_0x672b('0x53')]['SELECT'],'raw':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x3f9653){var _0x336682=_[_0x672b('0x2e')](_0x3f9653,function(_0x1cf0b1){return Number(_0x1cf0b1[_0x672b('0x63')]);});return db[_0x672b('0x64')]['destroy']({'where':{'UserId':{'$in':_0x51d024},'FaxQueueId':{'$in':_0x336682}},'transaction':_0x40c9f7});})['then'](function(){var _0x16c72b=_0x672b('0x65')+_0x145644;return db[_0x672b('0x51')][_0x672b('0x2f')](_0x16c72b,{'type':db[_0x672b('0x52')]['QueryTypes'][_0x672b('0x5c')],'raw':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x29436c){var _0x3ee52b=_[_0x672b('0x2e')](_0x29436c,function(_0x4eb00d){return Number(_0x4eb00d[_0x672b('0x66')]);});return db[_0x672b('0x67')][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'OpenchannelQueueId':{'$in':_0x3ee52b}},'transaction':_0x40c9f7});})['then'](function(){var _0x31d6ee=_0x672b('0x68')+_0x145644;return db['sequelize'][_0x672b('0x2f')](_0x31d6ee,{'type':db[_0x672b('0x52')][_0x672b('0x53')][_0x672b('0x5c')],'raw':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x323b64){var _0x1d6ea0=_[_0x672b('0x2e')](_0x323b64,function(_0x284d7d){return Number(_0x284d7d[_0x672b('0x69')]);});return db[_0x672b('0x6a')][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'WhatsappQueueId':{'$in':_0x1d6ea0}},'transaction':_0x40c9f7});})['then'](function(){return db[_0x672b('0x6b')]['find']({'where':{'TeamId':_0x145644}});})['then'](function(_0x1eacab){if(_0x1eacab===null){return;}return db[_0x672b('0x6c')][_0x672b('0x58')]({'where':{'UserId':{'$in':_0x51d024},'VoicePrefixId':_0x1eacab[_0x672b('0x6d')]},'transaction':_0x40c9f7});})[_0x672b('0x26')](function(){return db[_0x672b('0x3d')][_0x672b('0x58')]({'where':{'id':_0x145644},'cascade':!![],'transaction':_0x40c9f7});})[_0x672b('0x26')](function(_0x1f6244){if(_0x1f6244===0x0){_0x5c28c2['sendStatus'](0x194);}else{return db[_0x672b('0x4b')]['destroy']({'where':{'type':_0x672b('0x48'),'resourceId':_0x145644},'cascade':!![],'transaction':_0x40c9f7})['then'](function(){_0x5c28c2[_0x672b('0x1a')](0xcc)[_0x672b('0x1b')]();});}})['catch'](function(_0x34b092){_0x5c28c2[_0x672b('0x1a')](0x1f4)[_0x672b('0x6e')](_0x34b092);});});};exports['getQueues']=function(_0x32a851,_0x2662ea,_0x1b0f13){return db[_0x672b('0x3d')][_0x672b('0x6f')]({'where':{'id':_0x32a851['params']['id']}})[_0x672b('0x26')](handleEntityNotFound(_0x2662ea,null))[_0x672b('0x26')](function(_0x3d942a){if(!_0x32a851[_0x672b('0x2f')][_0x672b('0x70')]||!utils[_0x672b('0x71')](_0x32a851['query'][_0x672b('0x70')])){throw new db[(_0x672b('0x52'))]['ValidationError'](_0x672b('0x72'));}var _0x14dae0={};var _0x1ecf6f={};_0x1ecf6f[_0x672b('0x33')]=_[_0x672b('0x30')](db[_[_0x672b('0x73')](_0x32a851[_0x672b('0x2f')][_0x672b('0x70')][_0x672b('0x74')]())+'Queue'][_0x672b('0x2b')]);_0x1ecf6f[_0x672b('0x2f')]=_[_0x672b('0x30')](_0x32a851[_0x672b('0x2f')]);_0x1ecf6f['filters']=_[_0x672b('0x32')](_0x1ecf6f[_0x672b('0x33')],_0x1ecf6f[_0x672b('0x2f')]);_0x14dae0[_0x672b('0x35')]=_[_0x672b('0x32')](_0x1ecf6f['model'],qs[_0x672b('0x34')](_0x32a851[_0x672b('0x2f')][_0x672b('0x34')]));_0x14dae0[_0x672b('0x35')]=_0x14dae0[_0x672b('0x35')]['length']?_0x14dae0[_0x672b('0x35')]:_0x1ecf6f[_0x672b('0x33')];_0x14dae0['limit']=qs[_0x672b('0x1e')](_0x32a851['query']['limit']);_0x14dae0[_0x672b('0x1c')]=qs['offset'](_0x32a851['query'][_0x672b('0x1c')]);_0x14dae0[_0x672b('0x38')]=qs[_0x672b('0x39')](_0x32a851[_0x672b('0x2f')][_0x672b('0x39')]);_0x14dae0[_0x672b('0x3a')]=qs[_0x672b('0x31')](_['pick'](_0x32a851['query'],_0x1ecf6f['filters']));_0x14dae0=_[_0x672b('0x75')]({},_0x14dae0,_0x32a851[_0x672b('0x3c')]);return _0x3d942a['get'+_['capitalize'](_0x32a851[_0x672b('0x2f')][_0x672b('0x70')][_0x672b('0x74')]())+'Queues'](_0x14dae0);})['then'](respondWithResult(_0x2662ea,null))[_0x672b('0x76')](handleError(_0x2662ea,null));};exports[_0x672b('0x77')]=function(_0x58ddf0,_0x3fda2,_0x7fb09e){return db[_0x672b('0x3d')][_0x672b('0x6f')]({'where':{'id':_0x58ddf0[_0x672b('0x42')]['id']}})[_0x672b('0x26')](function(_0x24f812){if(_0x24f812){if(!_0x58ddf0['body'][_0x672b('0x70')]||!utils[_0x672b('0x71')](_0x58ddf0['body']['channel'])){throw new db['Sequelize']['ValidationError'](_0x672b('0x72'));}return _0x24f812['add'+_['capitalize'](_0x58ddf0[_0x672b('0x4e')][_0x672b('0x70')][_0x672b('0x74')]())+_0x672b('0x78')](_0x58ddf0['body'][_0x672b('0x79')]);}return null;})[_0x672b('0x26')](handleEntityNotFound(_0x3fda2,null))['then'](respondWithStatusCode(_0x3fda2,null))[_0x672b('0x76')](handleError(_0x3fda2,null));};exports[_0x672b('0x7a')]=function(_0xbc8730,_0x3b3484,_0x5ed01a){return db['Team'][_0x672b('0x6f')]({'where':{'id':_0xbc8730['params']['id']}})[_0x672b('0x26')](function(_0x4b90c7){if(_0x4b90c7){if(!_0xbc8730[_0x672b('0x2f')]['channel']||!utils['isValidChannel'](_0xbc8730[_0x672b('0x2f')]['channel'])){throw new db[(_0x672b('0x52'))][(_0x672b('0x7b'))](_0x672b('0x72'));}return _0x4b90c7[_0x672b('0x7c')+_[_0x672b('0x73')](_0xbc8730['query'][_0x672b('0x70')][_0x672b('0x74')]())+_0x672b('0x78')](_0xbc8730['query'][_0x672b('0x79')]);}return null;})[_0x672b('0x26')](handleEntityNotFound(_0x3b3484,null))[_0x672b('0x26')](respondWithStatusCode(_0x3b3484,null))[_0x672b('0x76')](handleError(_0x3b3484,null));};exports[_0x672b('0x7d')]=function(_0x416bce,_0x831889){var _0x19d4d8=_[_0x672b('0x7e')](_0x416bce['body'][_0x672b('0x79')])?_0x416bce[_0x672b('0x4e')][_0x672b('0x79')]:[_0x416bce[_0x672b('0x4e')][_0x672b('0x79')]];var _0x2ab48d=_0x416bce[_0x672b('0x42')]['id'];return db['Team'][_0x672b('0x43')]({'where':{'id':_0x2ab48d}})[_0x672b('0x26')](handleEntityNotFound(_0x831889,null))[_0x672b('0x26')](function(_0x14b137){if(_0x14b137){var _0x1fc095=[_0x672b('0x7f'),_0x672b('0x80'),_0x672b('0x81'),_0x672b('0x82'),_0x672b('0x83'),_0x672b('0x84'),_0x672b('0x85')];return db[_0x672b('0x51')][_0x672b('0x4f')](function(_0x30de6b){var _0x2f23e5=_[_0x672b('0x2e')](_0x1fc095,function(_0x56d47e){var _0x137262={'attributes':['id','name']};if(_0x56d47e===_0x672b('0x7f')){_0x137262[_0x672b('0x86')]={'attributes':['penalty']};}return _0x14b137['get'+_0x56d47e+_0x672b('0x78')](_0x137262)[_0x672b('0x26')](function(_0x108ba7){var _0x634466=_['map'](_0x108ba7,function(_0x21d5fd){var _0x13b686=_[_0x672b('0x2e')](_0x19d4d8,function(_0x39a39a){var _0x3aaf1c={'where':{'UserId':_0x39a39a,[_0x56d47e+_0x672b('0x87')]:_0x21d5fd['id']},'transaction':_0x30de6b};if(_0x56d47e===_0x672b('0x7f')){_0x3aaf1c['defaults']={'penalty':_0x21d5fd['TeamVoiceQueue'][_0x672b('0x88')]};}return db[_0x672b('0x89')+_0x56d47e+_0x672b('0x8a')][_0x672b('0x8b')](_0x3aaf1c)[_0x672b('0x26')](function(){socket[_0x672b('0x8c')](_0x672b('0x45')+_0x56d47e+_0x672b('0x8d'),{'UserId':_0x39a39a,[_0x56d47e+_0x672b('0x87')]:_0x21d5fd['id']});if(_0x56d47e!==_0x672b('0x7f')){return;}return db[_0x672b('0x89')][_0x672b('0x3f')]({'where':{'id':_0x19d4d8,'online':0x1},'attributes':['id',_0x672b('0x29'),_0x672b('0x8e'),_0x672b('0x8f'),'interface'],'raw':!![]})[_0x672b('0x26')](function(_0x13536e){var _0x4d9853=_[_0x672b('0x2e')](_0x13536e,function(_0x178256){return db[_0x672b('0x90')]['upsert']({'membername':_0x178256[_0x672b('0x29')],'UserId':_0x178256['id'],'queue_name':_0x21d5fd[_0x672b('0x29')],'VoiceQueueId':_0x21d5fd['id'],'interface':_[_0x672b('0x91')](_0x178256['interface'])?util[_0x672b('0x92')](_0x672b('0x93'),_0x178256[_0x672b('0x29')]):_0x178256[_0x672b('0x94')],'paused':_0x178256[_0x672b('0x8f')]||![],'penalty':_0x21d5fd[_0x672b('0x95')][_0x672b('0x88')]},{'transaction':_0x30de6b});});return Promise[_0x672b('0x96')](_0x4d9853);});});});return Promise[_0x672b('0x96')](_0x13b686);});return Promise[_0x672b('0x96')](_0x634466);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2ab48d}})[_0x672b('0x26')](function(_0x1baf7c){if(_0x1baf7c){var _0x22e7f5=_[_0x672b('0x2e')](_0x19d4d8,function(_0x8c4a22){db[_0x672b('0x6c')][_0x672b('0x97')]({'UserId':_0x8c4a22,'VoicePrefixId':_0x1baf7c[_0x672b('0x6d')]});});return Promise['all'](_0x22e7f5);}});});});return Promise['all'](_0x2f23e5)[_0x672b('0x26')](function(){return _0x14b137[_0x672b('0x7d')](_0x19d4d8,{'transaction':_0x30de6b})[_0x672b('0x98')](function(_0x3670ce){return _0x3670ce;});});});}})['then'](respondWithResult(_0x831889,null))[_0x672b('0x76')](handleError(_0x831889,null));};exports[_0x672b('0x99')]=function(_0x32351c,_0x26781f){var _0x187dd9=_['isArray'](_0x32351c[_0x672b('0x2f')]['ids'])?_0x32351c[_0x672b('0x2f')][_0x672b('0x79')]:[_0x32351c[_0x672b('0x2f')][_0x672b('0x79')]];var _0x3db277=_0x32351c[_0x672b('0x42')]['id'];return db[_0x672b('0x3d')][_0x672b('0x43')]({'where':{'id':_0x3db277}})[_0x672b('0x26')](handleEntityNotFound(_0x26781f,null))[_0x672b('0x26')](function(_0x58f875){if(_0x58f875){var _0x3213ab=[_0x672b('0x7f'),_0x672b('0x80'),_0x672b('0x81'),_0x672b('0x82'),'Fax',_0x672b('0x84'),_0x672b('0x85')];return db['sequelize'][_0x672b('0x4f')](function(_0x3a8d6d){var _0x37c4a4=_['map'](_0x3213ab,function(_0x34948c){var _0x12971e={'attributes':['id',_0x672b('0x29')]};return _0x58f875[_0x672b('0x47')+_0x34948c+'Queues'](_0x12971e)['then'](function(_0x493c2c){var _0x5be21f=_[_0x672b('0x2e')](_0x493c2c,function(_0x45fefe){return _0x45fefe[_0x672b('0x99')](_0x187dd9,{'transaction':_0x3a8d6d})[_0x672b('0x26')](function(){var _0x2995d4=_[_0x672b('0x2e')](_0x187dd9,function(_0x48ecb7){socket[_0x672b('0x8c')](_0x672b('0x45')+_0x34948c+_0x672b('0x9a'),{'UserId':Number(_0x48ecb7),[_0x34948c+_0x672b('0x87')]:_0x45fefe['id']});if(_0x34948c!==_0x672b('0x7f')){return;}return db[_0x672b('0x90')][_0x672b('0x58')]({'where':{'VoiceQueueId':_0x45fefe['id'],'UserId':_0x48ecb7},'transaction':_0x3a8d6d});});return Promise[_0x672b('0x96')](_0x2995d4);});});return Promise[_0x672b('0x96')](_0x5be21f);});});return Promise[_0x672b('0x96')](_0x37c4a4)[_0x672b('0x26')](function(){return _0x58f875['removeAgents'](_0x187dd9,{'transaction':_0x3a8d6d});})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x3db277}})[_0x672b('0x26')](function(_0x3774ef){if(_0x3774ef){var _0x5b3ebd=_[_0x672b('0x2e')](_0x187dd9,function(_0x159922){db['UserVoicePrefix'][_0x672b('0x58')]({'where':{'UserId':_0x159922,'VoicePrefixId':_0x3774ef['VoicePrefixId']}});});return Promise['all'](_0x5b3ebd);}});});});}})[_0x672b('0x26')](respondWithStatusCode(_0x26781f,null))['catch'](handleError(_0x26781f,null));};exports[_0x672b('0x9b')]=function(_0x42aa8d,_0xebd658,_0x48ef03){var _0x1f9ba9={};var _0x29c908={};var _0x3e9b5e;var _0x2af5f9;return db[_0x672b('0x3d')]['findOne']({'where':{'id':_0x42aa8d[_0x672b('0x42')]['id']}})['then'](handleEntityNotFound(_0xebd658,null))[_0x672b('0x26')](function(_0x32342e){if(_0x32342e){_0x3e9b5e=_0x32342e;_0x29c908[_0x672b('0x33')]=_['keys'](db[_0x672b('0x89')][_0x672b('0x2b')]);_0x29c908[_0x672b('0x2f')]=_['keys'](_0x42aa8d[_0x672b('0x2f')]);_0x29c908['filters']=_[_0x672b('0x32')](_0x29c908[_0x672b('0x33')],_0x29c908[_0x672b('0x2f')]);_0x1f9ba9[_0x672b('0x35')]=_[_0x672b('0x32')](_0x29c908[_0x672b('0x33')],qs['fields'](_0x42aa8d[_0x672b('0x2f')]['fields']));_0x1f9ba9['attributes']=_0x1f9ba9['attributes'][_0x672b('0x36')]?_0x1f9ba9[_0x672b('0x35')]:_0x29c908[_0x672b('0x33')];_0x1f9ba9[_0x672b('0x38')]=qs[_0x672b('0x39')](_0x42aa8d[_0x672b('0x2f')][_0x672b('0x39')]);_0x1f9ba9[_0x672b('0x3a')]=qs[_0x672b('0x31')](_[_0x672b('0x3b')](_0x42aa8d['query'],_0x29c908[_0x672b('0x31')]));if(_0x42aa8d[_0x672b('0x2f')]['filter']){_0x1f9ba9['where']=_[_0x672b('0x75')](_0x1f9ba9[_0x672b('0x3a')],{'$or':_['map'](_0x1f9ba9[_0x672b('0x35')],function(_0xd0ed9b){var _0x20d499={};_0x20d499[_0xd0ed9b]={'$like':'%'+_0x42aa8d[_0x672b('0x2f')][_0x672b('0x9c')]+'%'};return _0x20d499;})});}_0x1f9ba9=_['merge']({},_0x1f9ba9,_0x42aa8d[_0x672b('0x3c')]);return _0x3e9b5e['getAgents'](_0x1f9ba9);}})['then'](function(_0x5a5176){if(_0x5a5176){_0x2af5f9=_0x5a5176[_0x672b('0x36')];if(!_0x42aa8d[_0x672b('0x2f')][_0x672b('0x37')]('nolimit')){_0x1f9ba9[_0x672b('0x1e')]=qs[_0x672b('0x1e')](_0x42aa8d[_0x672b('0x2f')]['limit']);_0x1f9ba9[_0x672b('0x1c')]=qs[_0x672b('0x1c')](_0x42aa8d[_0x672b('0x2f')]['offset']);}return _0x3e9b5e[_0x672b('0x9b')](_0x1f9ba9);}})[_0x672b('0x26')](function(_0x5015d7){if(_0x5015d7){return _0x5015d7?{'count':_0x2af5f9,'rows':_0x5015d7}:null;}})[_0x672b('0x26')](respondWithResult(_0xebd658,null))[_0x672b('0x76')](handleError(_0xebd658,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 415376c..c937bd5 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 _0x0b1e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team'];(function(_0x42a374,_0x36c585){var _0x2da4cd=function(_0x4a7fa8){while(--_0x4a7fa8){_0x42a374['push'](_0x42a374['shift']());}};_0x2da4cd(++_0x36c585);}(_0x0b1e,0xb1));var _0xe0b1=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x0b1e[_0x4709c0];return _0x13348b;};'use strict';var EventEmitter=require(_0xe0b1('0x0'));var Team=require(_0xe0b1('0x1'))['db'][_0xe0b1('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b1('0x3'),'afterUpdate':_0xe0b1('0x4'),'afterDestroy':_0xe0b1('0x5')};function emitEvent(_0x33412d){return function(_0x14c373,_0x529792,_0x5048f6){TeamEvents[_0xe0b1('0x6')](_0x33412d+':'+_0x14c373['id'],_0x14c373);TeamEvents[_0xe0b1('0x6')](_0x33412d,_0x14c373);_0x5048f6(null);};}for(var e in events){if(events[_0xe0b1('0x7')](e)){var event=events[e];Team[_0xe0b1('0x8')](e,emitEvent(event));}}module[_0xe0b1('0x9')]=TeamEvents; \ No newline at end of file +var _0x2c3d=['save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2c3d,0x195));var _0xd2c3=function(_0x3e9065,_0x8a1c27){_0x3e9065=_0x3e9065-0x0;var _0x286609=_0x2c3d[_0x3e9065];return _0x286609;};'use strict';var EventEmitter=require(_0xd2c3('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd2c3('0x1'),'afterUpdate':_0xd2c3('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4accce){return function(_0x3acc8b,_0x5064d7,_0x105895){TeamEvents[_0xd2c3('0x3')](_0x4accce+':'+_0x3acc8b['id'],_0x3acc8b);TeamEvents[_0xd2c3('0x3')](_0x4accce,_0x3acc8b);_0x105895(null);};}for(var e in events){if(events[_0xd2c3('0x4')](e)){var event=events[e];Team[_0xd2c3('0x5')](e,emitEvent(event));}}module[_0xd2c3('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b3a934a..eecc887 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 _0x75f0=['api','moment','bluebird','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','util'];(function(_0x40ef9b,_0x473a3a){var _0x12d45f=function(_0x7ed884){while(--_0x7ed884){_0x40ef9b['push'](_0x40ef9b['shift']());}};_0x12d45f(++_0x473a3a);}(_0x75f0,0x113));var _0x075f=function(_0x4e4c01,_0x1cb08b){_0x4e4c01=_0x4e4c01-0x0;var _0x3c2374=_0x75f0[_0x4e4c01];return _0x3c2374;};'use strict';var _=require('lodash');var util=require(_0x075f('0x0'));var logger=require('../../config/logger')(_0x075f('0x1'));var moment=require(_0x075f('0x2'));var BPromise=require(_0x075f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x075f('0x4'));var rimraf=require(_0x075f('0x5'));var config=require(_0x075f('0x6'));var attributes=require(_0x075f('0x7'));module[_0x075f('0x8')]=function(_0x2c85d7,_0x1c86c0){return _0x2c85d7[_0x075f('0x9')](_0x075f('0xa'),attributes,{'tableName':_0x075f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19ad=['request-promise','path','rimraf','exports','define','../../config/logger','api','bluebird'];(function(_0x11ac76,_0x526165){var _0x368b13=function(_0x233788){while(--_0x233788){_0x11ac76['push'](_0x11ac76['shift']());}};_0x368b13(++_0x526165);}(_0x19ad,0x1d5));var _0xd19a=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x19ad[_0x1ee9a1];return _0x21270f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd19a('0x0'))(_0xd19a('0x1'));var moment=require('moment');var BPromise=require(_0xd19a('0x2'));var rp=require(_0xd19a('0x3'));var fs=require('fs');var path=require(_0xd19a('0x4'));var rimraf=require(_0xd19a('0x5'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xd19a('0x6')]=function(_0x5adf25,_0x33d9dd){return _0x5adf25[_0xd19a('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 3244f7d..addb853 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 _0xe7ab=['Team,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0xe7ab,0xe7));var _0xbe7a=function(_0x24da92,_0xb53327){_0x24da92=_0x24da92-0x0;var _0x3a6144=_0xe7ab[_0x24da92];return _0x3a6144;};'use strict';var _=require(_0xbe7a('0x0'));var util=require(_0xbe7a('0x1'));var moment=require(_0xbe7a('0x2'));var BPromise=require(_0xbe7a('0x3'));var rs=require(_0xbe7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe7a('0x6'))(_0xbe7a('0x7'));var config=require(_0xbe7a('0x8'));var jayson=require(_0xbe7a('0x9'));var client=jayson[_0xbe7a('0xa')][_0xbe7a('0xb')]({'port':0x232a});config[_0xbe7a('0xc')]=_[_0xbe7a('0xd')](config[_0xbe7a('0xc')],{'host':_0xbe7a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe7a('0xc')]));require(_0xbe7a('0xf'))[_0xbe7a('0x10')](socket);function respondWithRpcPromise(_0x5df137,_0x2918b5,_0x220969){return new BPromise(function(_0x15f013,_0x4676f0){return client[_0xbe7a('0x11')](_0x5df137,_0x220969)[_0xbe7a('0x12')](function(_0x8cf745){logger[_0xbe7a('0x13')](_0xbe7a('0x14'),_0x2918b5,'request\x20sent');logger['debug'](_0xbe7a('0x15'),_0x2918b5,'request\x20sent',JSON[_0xbe7a('0x16')](_0x8cf745));if(_0x8cf745[_0xbe7a('0x17')]){if(_0x8cf745[_0xbe7a('0x17')]['code']===0x1f4){logger['error'](_0xbe7a('0x14'),_0x2918b5,_0x8cf745['error'][_0xbe7a('0x18')]);return _0x4676f0(_0x8cf745['error'][_0xbe7a('0x18')]);}logger[_0xbe7a('0x17')]('Team,\x20%s,\x20%s',_0x2918b5,_0x8cf745[_0xbe7a('0x17')][_0xbe7a('0x18')]);return _0x15f013(_0x8cf745[_0xbe7a('0x17')]['message']);}else{logger[_0xbe7a('0x13')](_0xbe7a('0x14'),_0x2918b5,_0xbe7a('0x19'));_0x15f013(_0x8cf745[_0xbe7a('0x1a')][_0xbe7a('0x18')]);}})[_0xbe7a('0x1b')](function(_0x17a0f9){logger[_0xbe7a('0x17')](_0xbe7a('0x14'),_0x2918b5,_0x17a0f9);_0x4676f0(_0x17a0f9);});});} \ No newline at end of file +var _0x6394=['redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x38d7f8,_0x2d1f73){var _0x4d7607=function(_0x430f36){while(--_0x430f36){_0x38d7f8['push'](_0x38d7f8['shift']());}};_0x4d7607(++_0x2d1f73);}(_0x6394,0x17e));var _0x4639=function(_0x435ded,_0x1b9602){_0x435ded=_0x435ded-0x0;var _0x4635ec=_0x6394[_0x435ded];return _0x4635ec;};'use strict';var _=require(_0x4639('0x0'));var util=require(_0x4639('0x1'));var moment=require(_0x4639('0x2'));var BPromise=require('bluebird');var rs=require(_0x4639('0x3'));var fs=require('fs');var Redis=require(_0x4639('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4639('0x5'));var config=require(_0x4639('0x6'));var jayson=require(_0x4639('0x7'));var client=jayson[_0x4639('0x8')][_0x4639('0x9')]({'port':0x232a});config[_0x4639('0xa')]=_[_0x4639('0xb')](config[_0x4639('0xa')],{'host':_0x4639('0xc'),'port':0x18eb});var socket=require(_0x4639('0xd'))(new Redis(config[_0x4639('0xa')]));require(_0x4639('0xe'))[_0x4639('0xf')](socket);function respondWithRpcPromise(_0x3524d0,_0x43ee32,_0x45a31f){return new BPromise(function(_0x44aae2,_0x36e3cf){return client[_0x4639('0x10')](_0x3524d0,_0x45a31f)[_0x4639('0x11')](function(_0x2ec91c){logger[_0x4639('0x12')](_0x4639('0x13'),_0x43ee32,_0x4639('0x14'));logger[_0x4639('0x15')](_0x4639('0x16'),_0x43ee32,_0x4639('0x14'),JSON[_0x4639('0x17')](_0x2ec91c));if(_0x2ec91c[_0x4639('0x18')]){if(_0x2ec91c[_0x4639('0x18')][_0x4639('0x19')]===0x1f4){logger['error'](_0x4639('0x13'),_0x43ee32,_0x2ec91c['error'][_0x4639('0x1a')]);return _0x36e3cf(_0x2ec91c[_0x4639('0x18')][_0x4639('0x1a')]);}logger[_0x4639('0x18')](_0x4639('0x13'),_0x43ee32,_0x2ec91c[_0x4639('0x18')][_0x4639('0x1a')]);return _0x44aae2(_0x2ec91c[_0x4639('0x18')][_0x4639('0x1a')]);}else{logger['info'](_0x4639('0x13'),_0x43ee32,_0x4639('0x14'));_0x44aae2(_0x2ec91c[_0x4639('0x1b')][_0x4639('0x1a')]);}})['catch'](function(_0x1582e1){logger[_0x4639('0x18')](_0x4639('0x13'),_0x43ee32,_0x1582e1);_0x36e3cf(_0x1582e1);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4cbd8da..9a06f3d 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 _0x066e=['emit','register','length','team:','./team.events','update'];(function(_0x13135d,_0x29c098){var _0x305815=function(_0x4fea31){while(--_0x4fea31){_0x13135d['push'](_0x13135d['shift']());}};_0x305815(++_0x29c098);}(_0x066e,0xca));var _0xe066=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x066e[_0x2cf2e9];return _0xd3670d;};'use strict';var TeamEvents=require(_0xe066('0x0'));var events=['save','remove',_0xe066('0x1')];function createListener(_0x3fbaab,_0x2cb8c4){return function(_0x538a93){_0x2cb8c4[_0xe066('0x2')](_0x3fbaab,_0x538a93);};}function removeListener(_0x1ab9aa,_0x4f742d){return function(){TeamEvents['removeListener'](_0x1ab9aa,_0x4f742d);};}exports[_0xe066('0x3')]=function(_0x3a9310){for(var _0x14bbb5=0x0,_0x38aa87=events[_0xe066('0x4')];_0x14bbb5<_0x38aa87;_0x14bbb5++){var _0x31ae4d=events[_0x14bbb5];var _0x1e012b=createListener(_0xe066('0x5')+_0x31ae4d,_0x3a9310);TeamEvents['on'](_0x31ae4d,_0x1e012b);}}; \ No newline at end of file +var _0xfd8e=['length','team:','./team.events','save','remove','update'];(function(_0x3559c4,_0x47580b){var _0x124053=function(_0x2edf1){while(--_0x2edf1){_0x3559c4['push'](_0x3559c4['shift']());}};_0x124053(++_0x47580b);}(_0xfd8e,0xa4));var _0xefd8=function(_0xe8732f,_0x3d4c47){_0xe8732f=_0xe8732f-0x0;var _0xfb5575=_0xfd8e[_0xe8732f];return _0xfb5575;};'use strict';var TeamEvents=require(_0xefd8('0x0'));var events=[_0xefd8('0x1'),_0xefd8('0x2'),_0xefd8('0x3')];function createListener(_0x2640c5,_0x379384){return function(_0x51c2e1){_0x379384['emit'](_0x2640c5,_0x51c2e1);};}function removeListener(_0x25beac,_0x518995){return function(){TeamEvents['removeListener'](_0x25beac,_0x518995);};}exports['register']=function(_0x57b155){for(var _0xd31d77=0x0,_0x112abd=events[_0xefd8('0x4')];_0xd31d77<_0x112abd;_0xd31d77++){var _0x389311=events[_0xd31d77];var _0x5aaf2e=createListener(_0xefd8('0x5')+_0x389311,_0x57b155);TeamEvents['on'](_0x389311,_0x5aaf2e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1916106..ddcd96b 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 _0x534d=['INTEGER','sequelize','exports'];(function(_0x5c7c01,_0x47c322){var _0x205004=function(_0x5585f0){while(--_0x5585f0){_0x5c7c01['push'](_0x5c7c01['shift']());}};_0x205004(++_0x47c322);}(_0x534d,0x79));var _0xd534=function(_0x324df5,_0x3b122b){_0x324df5=_0x324df5-0x0;var _0x4396ee=_0x534d[_0x324df5];return _0x4396ee;};'use strict';var Sequelize=require(_0xd534('0x0'));module[_0xd534('0x1')]={'TeamId':{'type':Sequelize[_0xd534('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd534('0x2')]}}; \ No newline at end of file +var _0xf6fb=['INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6fb,0x111));var _0xbf6f=function(_0x5d4b34,_0x25799c){_0x5d4b34=_0x5d4b34-0x0;var _0x5244d9=_0xf6fb[_0x5d4b34];return _0x5244d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0xbf6f('0x0')]},'VoicePrefixId':{'type':Sequelize[_0xbf6f('0x0')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d36957d..25e8fe6 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 _0x7fce=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x7fce,0xdc));var _0xe7fc=function(_0x4cd130,_0x2be861){_0x4cd130=_0x4cd130-0x0;var _0x3c7f7d=_0x7fce[_0x4cd130];return _0x3c7f7d;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var logger=require(_0xe7fc('0x2'))('api');var moment=require(_0xe7fc('0x3'));var BPromise=require('bluebird');var rp=require(_0xe7fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7fc('0x5'));var config=require(_0xe7fc('0x6'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x223d07,_0x51c63b){return _0x223d07[_0xe7fc('0x7')](_0xe7fc('0x8'),attributes,{'tableName':_0xe7fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bb4=['util','api','moment','bluebird','request-promise','rimraf','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x3255ae,_0x11e5a8){var _0x2ce254=function(_0x1c3963){while(--_0x1c3963){_0x3255ae['push'](_0x3255ae['shift']());}};_0x2ce254(++_0x11e5a8);}(_0x0bb4,0x77));var _0x40bb=function(_0x21f47f,_0x356611){_0x21f47f=_0x21f47f-0x0;var _0x4889bf=_0x0bb4[_0x21f47f];return _0x4889bf;};'use strict';var _=require(_0x40bb('0x0'));var util=require(_0x40bb('0x1'));var logger=require('../../config/logger')(_0x40bb('0x2'));var moment=require(_0x40bb('0x3'));var BPromise=require(_0x40bb('0x4'));var rp=require(_0x40bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x40bb('0x7'));module['exports']=function(_0xa8c628,_0xe75667){return _0xa8c628['define'](_0x40bb('0x8'),attributes,{'tableName':_0x40bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 8338551..c01e3e5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1860d6,_0x30b762){var _0x3cf719=function(_0x3fe9b6){while(--_0x3fe9b6){_0x1860d6['push'](_0x1860d6['shift']());}};_0x3cf719(++_0x30b762);}(_0xe706,0xa3));var _0x6e70=function(_0x520f7e,_0x67518d){_0x520f7e=_0x520f7e-0x0;var _0x587f49=_0xe706[_0x520f7e];return _0x587f49;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4342b6,_0x41fc20){var _0x166fa5=function(_0x500c96){while(--_0x500c96){_0x4342b6['push'](_0x4342b6['shift']());}};_0x166fa5(++_0x41fc20);}(_0xe706,0xa3));var _0x6e70=function(_0x5480e7,_0x2a6133){_0x5480e7=_0x5480e7-0x0;var _0x30eabf=_0xe706[_0x5480e7];return _0x30eabf;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a0ac3a8..dc2f0e6 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 _0x3c39=['exports','INTEGER'];(function(_0x384eb6,_0x15744d){var _0x40ff9e=function(_0xb85376){while(--_0xb85376){_0x384eb6['push'](_0x384eb6['shift']());}};_0x40ff9e(++_0x15744d);}(_0x3c39,0x1ac));var _0x93c3=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x3c39[_0x4a93bb];return _0x208468;};'use strict';var Sequelize=require('sequelize');module[_0x93c3('0x0')]={'penalty':{'type':Sequelize[_0x93c3('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe8bc=['sequelize','exports'];(function(_0x8aa3a4,_0x3a0c11){var _0x284db7=function(_0x41ed4b){while(--_0x41ed4b){_0x8aa3a4['push'](_0x8aa3a4['shift']());}};_0x284db7(++_0x3a0c11);}(_0xe8bc,0x15c));var _0xce8b=function(_0x7e91d5,_0x4a9b9e){_0x7e91d5=_0x7e91d5-0x0;var _0xae72d6=_0xe8bc[_0x7e91d5];return _0xae72d6;};'use strict';var Sequelize=require(_0xce8b('0x0'));module[_0xce8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 18dcc21..40f9c7b 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 _0x54f3=['api','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54f3,0x120));var _0x354f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x54f3[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var logger=require(_0x354f('0x1'))(_0x354f('0x2'));var moment=require(_0x354f('0x3'));var BPromise=require(_0x354f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x354f('0x5'));var config=require(_0x354f('0x6'));var attributes=require(_0x354f('0x7'));module['exports']=function(_0x5618ac,_0x234ac6){return _0x5618ac['define'](_0x354f('0x8'),attributes,{'tableName':_0x354f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5620=['TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','path','../../config/environment','exports','define'];(function(_0x1941c7,_0x1df6a1){var _0x4356f5=function(_0x104e2a){while(--_0x104e2a){_0x1941c7['push'](_0x1941c7['shift']());}};_0x4356f5(++_0x1df6a1);}(_0x5620,0xbf));var _0x0562=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x5620[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x0562('0x0'));var util=require('util');var logger=require(_0x0562('0x1'))(_0x0562('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0562('0x3'));var rimraf=require('rimraf');var config=require(_0x0562('0x4'));var attributes=require('./teamVoiceQueue.attributes');module[_0x0562('0x5')]=function(_0x39ab9a,_0x4155b9){return _0x39ab9a[_0x0562('0x6')](_0x0562('0x7'),attributes,{'tableName':_0x0562('0x8'),'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 7b510d3..577b8f2 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 _0x42bd=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','TeamVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x42bd,0xd9));var _0xd42b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x42bd[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd42b('0x0'));var BPromise=require(_0xd42b('0x1'));var rs=require(_0xd42b('0x2'));var fs=require('fs');var Redis=require(_0xd42b('0x3'));var db=require(_0xd42b('0x4'))['db'];var utils=require(_0xd42b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd42b('0x6'));var client=jayson['client'][_0xd42b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x42c28f,_0x1ee395,_0xe44aa3){return new BPromise(function(_0x135898,_0x343d09){return client['request'](_0x42c28f,_0xe44aa3)[_0xd42b('0x8')](function(_0xf1943f){logger[_0xd42b('0x9')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1ee395,_0xd42b('0xa'));logger[_0xd42b('0xb')](_0xd42b('0xc'),_0x1ee395,'request\x20sent',JSON['stringify'](_0xf1943f));if(_0xf1943f[_0xd42b('0xd')]){if(_0xf1943f[_0xd42b('0xd')]['code']===0x1f4){logger[_0xd42b('0xd')](_0xd42b('0xe'),_0x1ee395,_0xf1943f[_0xd42b('0xd')]['message']);return _0x343d09(_0xf1943f['error'][_0xd42b('0xf')]);}logger[_0xd42b('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1ee395,_0xf1943f['error'][_0xd42b('0xf')]);return _0x135898(_0xf1943f[_0xd42b('0xd')]['message']);}else{logger['info'](_0xd42b('0xe'),_0x1ee395,_0xd42b('0xa'));_0x135898(_0xf1943f[_0xd42b('0x10')][_0xd42b('0xf')]);}})[_0xd42b('0x11')](function(_0x2595ad){logger[_0xd42b('0xd')](_0xd42b('0xe'),_0x1ee395,_0x2595ad);_0x343d09(_0x2595ad);});});} \ No newline at end of file +var _0xbb8f=['rpc','../../config/environment','jayson/promise','client','http','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5891d5,_0x2621c4){var _0x38624b=function(_0x28e0b2){while(--_0x28e0b2){_0x5891d5['push'](_0x5891d5['shift']());}};_0x38624b(++_0x2621c4);}(_0xbb8f,0x99));var _0xfbb8=function(_0x57e713,_0x31e064){_0x57e713=_0x57e713-0x0;var _0x4794a1=_0xbb8f[_0x57e713];return _0x4794a1;};'use strict';var _=require(_0xfbb8('0x0'));var util=require('util');var moment=require(_0xfbb8('0x1'));var BPromise=require(_0xfbb8('0x2'));var rs=require(_0xfbb8('0x3'));var fs=require('fs');var Redis=require(_0xfbb8('0x4'));var db=require(_0xfbb8('0x5'))['db'];var utils=require(_0xfbb8('0x6'));var logger=require(_0xfbb8('0x7'))(_0xfbb8('0x8'));var config=require(_0xfbb8('0x9'));var jayson=require(_0xfbb8('0xa'));var client=jayson[_0xfbb8('0xb')][_0xfbb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bec5c,_0x1833d5,_0x475473){return new BPromise(function(_0x873ef9,_0x57d771){return client['request'](_0x3bec5c,_0x475473)['then'](function(_0x58f298){logger[_0xfbb8('0xd')](_0xfbb8('0xe'),_0x1833d5,'request\x20sent');logger['debug'](_0xfbb8('0xf'),_0x1833d5,_0xfbb8('0x10'),JSON[_0xfbb8('0x11')](_0x58f298));if(_0x58f298[_0xfbb8('0x12')]){if(_0x58f298[_0xfbb8('0x12')][_0xfbb8('0x13')]===0x1f4){logger[_0xfbb8('0x12')](_0xfbb8('0xe'),_0x1833d5,_0x58f298[_0xfbb8('0x12')][_0xfbb8('0x14')]);return _0x57d771(_0x58f298['error'][_0xfbb8('0x14')]);}logger[_0xfbb8('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1833d5,_0x58f298[_0xfbb8('0x12')]['message']);return _0x873ef9(_0x58f298[_0xfbb8('0x12')][_0xfbb8('0x14')]);}else{logger[_0xfbb8('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1833d5,_0xfbb8('0x10'));_0x873ef9(_0x58f298[_0xfbb8('0x15')][_0xfbb8('0x14')]);}})[_0xfbb8('0x16')](function(_0x2a17da){logger[_0xfbb8('0x12')](_0xfbb8('0xe'),_0x1833d5,_0x2a17da);_0x57d771(_0x2a17da);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b9de142..151343d 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 _0x341c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x8a355d,_0x1a87b4){var _0x5528e3=function(_0x3e8d7d){while(--_0x3e8d7d){_0x8a355d['push'](_0x8a355d['shift']());}};_0x5528e3(++_0x1a87b4);}(_0x341c,0xcc));var _0xc341=function(_0x1f9862,_0x1047d7){_0x1f9862=_0x1f9862-0x0;var _0x5c41b0=_0x341c[_0x1f9862];return _0x5c41b0;};'use strict';var multer=require(_0xc341('0x0'));var util=require('util');var path=require(_0xc341('0x1'));var timeout=require('connect-timeout');var express=require(_0xc341('0x2'));var router=express[_0xc341('0x3')]();var fs_extra=require(_0xc341('0x4'));var auth=require(_0xc341('0x5'));var interaction=require(_0xc341('0x6'));var config=require(_0xc341('0x7'));var controller=require(_0xc341('0x8'));router[_0xc341('0x9')]('/',auth['isAuthenticated'](),controller[_0xc341('0xa')]);router[_0xc341('0x9')](_0xc341('0xb'),auth[_0xc341('0xc')](),controller[_0xc341('0xd')]);router['post']('/',auth[_0xc341('0xc')](),controller[_0xc341('0xe')]);router[_0xc341('0xf')](_0xc341('0xb'),auth[_0xc341('0xc')](),controller[_0xc341('0x10')]);router['delete'](_0xc341('0xb'),auth[_0xc341('0xc')](),controller[_0xc341('0x11')]);module[_0xc341('0x12')]=router; \ No newline at end of file +var _0x5ae0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router'];(function(_0x99e1bd,_0x6b3f9f){var _0x208ae5=function(_0x13359c){while(--_0x13359c){_0x99e1bd['push'](_0x99e1bd['shift']());}};_0x208ae5(++_0x6b3f9f);}(_0x5ae0,0xf8));var _0x05ae=function(_0x30f66d,_0x4de526){_0x30f66d=_0x30f66d-0x0;var _0x126934=_0x5ae0[_0x30f66d];return _0x126934;};'use strict';var multer=require('multer');var util=require(_0x05ae('0x0'));var path=require(_0x05ae('0x1'));var timeout=require('connect-timeout');var express=require(_0x05ae('0x2'));var router=express[_0x05ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05ae('0x4'));var interaction=require(_0x05ae('0x5'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x05ae('0x6')]('/',auth[_0x05ae('0x7')](),controller[_0x05ae('0x8')]);router['get'](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0xa')]);router[_0x05ae('0xb')]('/',auth[_0x05ae('0x7')](),controller[_0x05ae('0xc')]);router[_0x05ae('0xd')](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0xe')]);router[_0x05ae('0xf')](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0x10')]);module[_0x05ae('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 7167c1d..d51d001 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 _0x6583=['sequelize','exports','STRING','TEXT'];(function(_0x4830d0,_0x1b5ac6){var _0x26d720=function(_0x179dca){while(--_0x179dca){_0x4830d0['push'](_0x4830d0['shift']());}};_0x26d720(++_0x1b5ac6);}(_0x6583,0x160));var _0x3658=function(_0x5a2a75,_0xe3a29e){_0x5a2a75=_0x5a2a75-0x0;var _0x4109c3=_0x6583[_0x5a2a75];return _0x4109c3;};'use strict';var Sequelize=require(_0x3658('0x0'));module[_0x3658('0x1')]={'name':{'type':Sequelize[_0x3658('0x2')]},'description':{'type':Sequelize[_0x3658('0x2')]},'html':{'type':Sequelize[_0x3658('0x3')]}}; \ No newline at end of file +var _0x164e=['sequelize','exports','STRING','TEXT'];(function(_0x3aaa91,_0x30e3d3){var _0x151836=function(_0x1038e4){while(--_0x1038e4){_0x3aaa91['push'](_0x3aaa91['shift']());}};_0x151836(++_0x30e3d3);}(_0x164e,0x144));var _0xe164=function(_0x556de6,_0x116f99){_0x556de6=_0x556de6-0x0;var _0x7bd7e0=_0x164e[_0x556de6];return _0x7bd7e0;};'use strict';var Sequelize=require(_0xe164('0x0'));module[_0xe164('0x1')]={'name':{'type':Sequelize[_0xe164('0x2')]},'description':{'type':Sequelize[_0xe164('0x2')]},'html':{'type':Sequelize[_0xe164('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 85d1118..b6317ae 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 _0x0d71=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','Templates','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','Template','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x7585be,_0x370f7b){var _0x3ec508=function(_0x557169){while(--_0x557169){_0x7585be['push'](_0x7585be['shift']());}};_0x3ec508(++_0x370f7b);}(_0x0d71,0x1bf));var _0x10d7=function(_0xd0fa51,_0x56e80a){_0xd0fa51=_0xd0fa51-0x0;var _0x348c19=_0x0d71[_0xd0fa51];return _0x348c19;};'use strict';var emlformat=require(_0x10d7('0x0'));var rimraf=require(_0x10d7('0x1'));var zipdir=require(_0x10d7('0x2'));var jsonpatch=require(_0x10d7('0x3'));var rp=require(_0x10d7('0x4'));var moment=require(_0x10d7('0x5'));var BPromise=require(_0x10d7('0x6'));var Mustache=require(_0x10d7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x10d7('0x8'));var csv=require('to-csv');var ejs=require(_0x10d7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x10d7('0xa'));var crypto=require(_0x10d7('0xb'));var jsforce=require(_0x10d7('0xc'));var deskjs=require(_0x10d7('0xd'));var toCsv=require(_0x10d7('0xe'));var querystring=require(_0x10d7('0xf'));var Papa=require(_0x10d7('0x10'));var Redis=require(_0x10d7('0x11'));var authService=require(_0x10d7('0x12'));var qs=require(_0x10d7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10d7('0x14'));var logger=require(_0x10d7('0x15'))(_0x10d7('0x16'));var utils=require('../../config/utils');var config=require(_0x10d7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x10d7('0x18'))['db'];function respondWithStatusCode(_0x40bea2,_0x48563c){_0x48563c=_0x48563c||0xcc;return function(_0x28e2dc){if(_0x28e2dc){return _0x40bea2[_0x10d7('0x19')](_0x48563c);}return _0x40bea2['status'](_0x48563c)['end']();};}function respondWithResult(_0x1f5694,_0x530b28){_0x530b28=_0x530b28||0xc8;return function(_0x37336a){if(_0x37336a){return _0x1f5694[_0x10d7('0x1a')](_0x530b28)[_0x10d7('0x1b')](_0x37336a);}};}function respondWithFilteredResult(_0x2936ab,_0x50e1d4){return function(_0x23f761){if(_0x23f761){var _0x34091d=typeof _0x50e1d4[_0x10d7('0x1c')]==='undefined'&&typeof _0x50e1d4[_0x10d7('0x1d')]===_0x10d7('0x1e');var _0x5a97e9=_0x23f761[_0x10d7('0x1f')];var _0x5ad0fa=_0x34091d?0x0:_0x50e1d4[_0x10d7('0x1c')];var _0x52b806=_0x34091d?_0x23f761[_0x10d7('0x1f')]:_0x50e1d4['offset']+_0x50e1d4[_0x10d7('0x1d')];var _0x27936e;if(_0x52b806>=_0x5a97e9){_0x52b806=_0x5a97e9;_0x27936e=0xc8;}else{_0x27936e=0xce;}_0x2936ab[_0x10d7('0x1a')](_0x27936e);return _0x2936ab['set'](_0x10d7('0x20'),_0x5ad0fa+'-'+_0x52b806+'/'+_0x5a97e9)[_0x10d7('0x1b')](_0x23f761);}return null;};}function patchUpdates(_0x3caacc){return function(_0x1d56f8){try{jsonpatch[_0x10d7('0x21')](_0x1d56f8,_0x3caacc,!![]);}catch(_0x2bf90c){return BPromise[_0x10d7('0x22')](_0x2bf90c);}return _0x1d56f8[_0x10d7('0x23')]();};}function saveUpdates(_0x28bc5f,_0x4a9c20){return function(_0x5a91fa){if(_0x5a91fa){return _0x5a91fa[_0x10d7('0x24')](_0x28bc5f)[_0x10d7('0x25')](function(_0x4bf941){return _0x4bf941;});}return null;};}function removeEntity(_0x2dcd99,_0x5db77a){return function(_0x56434f){if(_0x56434f){return _0x56434f[_0x10d7('0x26')]()[_0x10d7('0x25')](function(){var _0x47910e=_0x56434f['get']({'plain':!![]});var _0x2f5e4f=_0x10d7('0x27');return db[_0x10d7('0x28')][_0x10d7('0x26')]({'where':{'type':_0x2f5e4f,'resourceId':_0x47910e['id']}})[_0x10d7('0x25')](function(){return _0x56434f;});})[_0x10d7('0x25')](function(){_0x2dcd99['status'](0xcc)[_0x10d7('0x29')]();});}};}function handleEntityNotFound(_0x285353,_0x52726b){return function(_0x345aa2){if(!_0x345aa2){_0x285353[_0x10d7('0x19')](0x194);}return _0x345aa2;};}function handleError(_0x2fa1ae,_0x11a112){_0x11a112=_0x11a112||0x1f4;return function(_0x222726){logger[_0x10d7('0x2a')](_0x222726['stack']);if(_0x222726[_0x10d7('0x2b')]){delete _0x222726[_0x10d7('0x2b')];}_0x2fa1ae[_0x10d7('0x1a')](_0x11a112)[_0x10d7('0x2c')](_0x222726);};}exports[_0x10d7('0x2d')]=function(_0x175b96,_0x24e68c){var _0x2befca={},_0x2e33af={},_0x95828b={'count':0x0,'rows':[]};var _0x30776d=_[_0x10d7('0x2e')](db['Template'][_0x10d7('0x2f')],function(_0x5bad49){return{'name':_0x5bad49[_0x10d7('0x30')],'type':_0x5bad49[_0x10d7('0x31')]['key']};});_0x2e33af[_0x10d7('0x32')]=_['map'](_0x30776d,'name');_0x2e33af['query']=_['keys'](_0x175b96[_0x10d7('0x33')]);_0x2e33af[_0x10d7('0x34')]=_[_0x10d7('0x35')](_0x2e33af[_0x10d7('0x32')],_0x2e33af[_0x10d7('0x33')]);_0x2befca['attributes']=_[_0x10d7('0x35')](_0x2e33af[_0x10d7('0x32')],qs[_0x10d7('0x36')](_0x175b96[_0x10d7('0x33')][_0x10d7('0x36')]));_0x2befca[_0x10d7('0x37')]=_0x2befca['attributes'][_0x10d7('0x38')]?_0x2befca['attributes']:_0x2e33af[_0x10d7('0x32')];if(!_0x175b96[_0x10d7('0x33')][_0x10d7('0x39')](_0x10d7('0x3a'))){_0x2befca[_0x10d7('0x1d')]=qs[_0x10d7('0x1d')](_0x175b96[_0x10d7('0x33')][_0x10d7('0x1d')]);_0x2befca[_0x10d7('0x1c')]=qs[_0x10d7('0x1c')](_0x175b96[_0x10d7('0x33')][_0x10d7('0x1c')]);}_0x2befca[_0x10d7('0x3b')]=qs[_0x10d7('0x3c')](_0x175b96[_0x10d7('0x33')]['sort']);_0x2befca[_0x10d7('0x3d')]=qs['filters'](_[_0x10d7('0x3e')](_0x175b96[_0x10d7('0x33')],_0x2e33af[_0x10d7('0x34')]),_0x30776d);if(_0x175b96['query'][_0x10d7('0x3f')]){_0x2befca['where']=_['merge'](_0x2befca[_0x10d7('0x3d')],{'$or':_[_0x10d7('0x2e')](_0x30776d,function(_0x569a03){if(_0x569a03[_0x10d7('0x31')]!=='VIRTUAL'){var _0x5b8a80={};_0x5b8a80[_0x569a03[_0x10d7('0x2b')]]={'$like':'%'+_0x175b96[_0x10d7('0x33')][_0x10d7('0x3f')]+'%'};return _0x5b8a80;}})});}_0x2befca=_[_0x10d7('0x40')]({},_0x2befca,_0x175b96[_0x10d7('0x41')]);var _0x2d4e25={'where':_0x2befca[_0x10d7('0x3d')]};return db['Template']['count'](_0x2d4e25)[_0x10d7('0x25')](function(_0x107ac4){_0x95828b['count']=_0x107ac4;if(_0x175b96[_0x10d7('0x33')][_0x10d7('0x42')]){_0x2befca[_0x10d7('0x43')]=[{'all':!![]}];}return db[_0x10d7('0x44')]['findAll'](_0x2befca);})[_0x10d7('0x25')](function(_0xadcfbd){_0x95828b['rows']=_0xadcfbd;return _0x95828b;})[_0x10d7('0x25')](respondWithFilteredResult(_0x24e68c,_0x2befca))[_0x10d7('0x45')](handleError(_0x24e68c,null));};exports['show']=function(_0x2cfc41,_0x3e446a){var _0x4b388b={'raw':!![],'where':{'id':_0x2cfc41['params']['id']}},_0x2fc7df={};_0x2fc7df[_0x10d7('0x32')]=_[_0x10d7('0x46')](db[_0x10d7('0x44')][_0x10d7('0x2f')]);_0x2fc7df[_0x10d7('0x33')]=_[_0x10d7('0x46')](_0x2cfc41['query']);_0x2fc7df[_0x10d7('0x34')]=_[_0x10d7('0x35')](_0x2fc7df[_0x10d7('0x32')],_0x2fc7df['query']);_0x4b388b[_0x10d7('0x37')]=_['intersection'](_0x2fc7df[_0x10d7('0x32')],qs[_0x10d7('0x36')](_0x2cfc41[_0x10d7('0x33')][_0x10d7('0x36')]));_0x4b388b[_0x10d7('0x37')]=_0x4b388b['attributes'][_0x10d7('0x38')]?_0x4b388b[_0x10d7('0x37')]:_0x2fc7df['model'];if(_0x2cfc41[_0x10d7('0x33')][_0x10d7('0x42')]){_0x4b388b[_0x10d7('0x43')]=[{'all':!![]}];}_0x4b388b=_[_0x10d7('0x40')]({},_0x4b388b,_0x2cfc41[_0x10d7('0x41')]);return db[_0x10d7('0x44')][_0x10d7('0x47')](_0x4b388b)['then'](handleEntityNotFound(_0x3e446a,null))['then'](respondWithResult(_0x3e446a,null))[_0x10d7('0x45')](handleError(_0x3e446a,null));};exports[_0x10d7('0x48')]=function(_0x21ee20,_0x35de4c){return db[_0x10d7('0x44')][_0x10d7('0x48')](_0x21ee20[_0x10d7('0x49')],{})[_0x10d7('0x25')](function(_0x1f0855){var _0x32357d=_0x21ee20[_0x10d7('0x4a')]['get']({'plain':!![]});if(!_0x32357d)throw new Error(_0x10d7('0x4b'));if(_0x32357d[_0x10d7('0x4c')]===_0x10d7('0x4a')){var _0x590c26=_0x1f0855['get']({'plain':!![]});var _0x4ffd02=_0x10d7('0x27');return db['UserProfileSection'][_0x10d7('0x47')]({'where':{'name':_0x4ffd02,'userProfileId':_0x32357d['userProfileId']},'raw':!![]})[_0x10d7('0x25')](function(_0x841f54){if(_0x841f54&&_0x841f54['autoAssociation']===0x0){return db[_0x10d7('0x28')]['create']({'name':_0x590c26[_0x10d7('0x2b')],'resourceId':_0x590c26['id'],'type':_0x841f54[_0x10d7('0x2b')],'sectionId':_0x841f54['id']},{})[_0x10d7('0x25')](function(){return _0x1f0855;});}else{return _0x1f0855;}})['catch'](function(_0x5bfc89){logger[_0x10d7('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bfc89);throw _0x5bfc89;});}return _0x1f0855;})[_0x10d7('0x25')](respondWithResult(_0x35de4c,0xc9))[_0x10d7('0x45')](handleError(_0x35de4c,null));};exports[_0x10d7('0x24')]=function(_0x5457d6,_0x331168){if(_0x5457d6[_0x10d7('0x49')]['id']){delete _0x5457d6['body']['id'];}return db['Template'][_0x10d7('0x47')]({'where':{'id':_0x5457d6[_0x10d7('0x4d')]['id']}})[_0x10d7('0x25')](handleEntityNotFound(_0x331168,null))[_0x10d7('0x25')](saveUpdates(_0x5457d6[_0x10d7('0x49')],null))[_0x10d7('0x25')](respondWithResult(_0x331168,null))[_0x10d7('0x45')](handleError(_0x331168,null));};exports['destroy']=function(_0xc5fcc6,_0x2f6933){return db[_0x10d7('0x44')][_0x10d7('0x47')]({'where':{'id':_0xc5fcc6[_0x10d7('0x4d')]['id']}})[_0x10d7('0x25')](handleEntityNotFound(_0x2f6933,null))[_0x10d7('0x25')](removeEntity(_0x2f6933,null))[_0x10d7('0x45')](handleError(_0x2f6933,null));}; \ No newline at end of file +var _0x890e=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x890e,0x90));var _0xe890=function(_0x2bc1a6,_0x38214f){_0x2bc1a6=_0x2bc1a6-0x0;var _0x1aff3b=_0x890e[_0x2bc1a6];return _0x1aff3b;};'use strict';var emlformat=require(_0xe890('0x0'));var rimraf=require(_0xe890('0x1'));var zipdir=require(_0xe890('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe890('0x3'));var moment=require(_0xe890('0x4'));var BPromise=require(_0xe890('0x5'));var Mustache=require('mustache');var util=require(_0xe890('0x6'));var path=require('path');var sox=require(_0xe890('0x7'));var csv=require(_0xe890('0x8'));var ejs=require(_0xe890('0x9'));var fs=require('fs');var fs_extra=require(_0xe890('0xa'));var _=require('lodash');var squel=require(_0xe890('0xb'));var crypto=require(_0xe890('0xc'));var jsforce=require(_0xe890('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe890('0xe'));var Papa=require(_0xe890('0xf'));var Redis=require(_0xe890('0x10'));var authService=require(_0xe890('0x11'));var qs=require(_0xe890('0x12'));var as=require(_0xe890('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe890('0x14'));var utils=require(_0xe890('0x15'));var config=require(_0xe890('0x16'));var licenseUtil=require(_0xe890('0x17'));var db=require(_0xe890('0x18'))['db'];function respondWithStatusCode(_0x4bc423,_0x1edd7e){_0x1edd7e=_0x1edd7e||0xcc;return function(_0x4f15c3){if(_0x4f15c3){return _0x4bc423[_0xe890('0x19')](_0x1edd7e);}return _0x4bc423[_0xe890('0x1a')](_0x1edd7e)[_0xe890('0x1b')]();};}function respondWithResult(_0x5b9309,_0xa8cb2e){_0xa8cb2e=_0xa8cb2e||0xc8;return function(_0x2a6249){if(_0x2a6249){return _0x5b9309['status'](_0xa8cb2e)['json'](_0x2a6249);}};}function respondWithFilteredResult(_0x22136f,_0x18b46d){return function(_0x289c64){if(_0x289c64){var _0x5a5ff0=typeof _0x18b46d[_0xe890('0x1c')]===_0xe890('0x1d')&&typeof _0x18b46d[_0xe890('0x1e')]==='undefined';var _0x27f222=_0x289c64[_0xe890('0x1f')];var _0x42e49d=_0x5a5ff0?0x0:_0x18b46d['offset'];var _0xe8218a=_0x5a5ff0?_0x289c64['count']:_0x18b46d[_0xe890('0x1c')]+_0x18b46d[_0xe890('0x1e')];var _0x20d6b3;if(_0xe8218a>=_0x27f222){_0xe8218a=_0x27f222;_0x20d6b3=0xc8;}else{_0x20d6b3=0xce;}_0x22136f[_0xe890('0x1a')](_0x20d6b3);return _0x22136f[_0xe890('0x20')]('Content-Range',_0x42e49d+'-'+_0xe8218a+'/'+_0x27f222)['json'](_0x289c64);}return null;};}function patchUpdates(_0x50dcee){return function(_0x405e09){try{jsonpatch[_0xe890('0x21')](_0x405e09,_0x50dcee,!![]);}catch(_0x1087dd){return BPromise[_0xe890('0x22')](_0x1087dd);}return _0x405e09[_0xe890('0x23')]();};}function saveUpdates(_0x712d6a,_0xaddc3){return function(_0x4ecbed){if(_0x4ecbed){return _0x4ecbed[_0xe890('0x24')](_0x712d6a)[_0xe890('0x25')](function(_0x5d13b4){return _0x5d13b4;});}return null;};}function removeEntity(_0x2b4f19,_0x316428){return function(_0x59350f){if(_0x59350f){return _0x59350f[_0xe890('0x26')]()['then'](function(){var _0x59a970=_0x59350f[_0xe890('0x27')]({'plain':!![]});var _0x187c7f='Templates';return db[_0xe890('0x28')][_0xe890('0x26')]({'where':{'type':_0x187c7f,'resourceId':_0x59a970['id']}})['then'](function(){return _0x59350f;});})[_0xe890('0x25')](function(){_0x2b4f19[_0xe890('0x1a')](0xcc)[_0xe890('0x1b')]();});}};}function handleEntityNotFound(_0x2e2225,_0x4fd886){return function(_0x1dc15c){if(!_0x1dc15c){_0x2e2225[_0xe890('0x19')](0x194);}return _0x1dc15c;};}function handleError(_0x148dec,_0x524be9){_0x524be9=_0x524be9||0x1f4;return function(_0x5c3e66){logger[_0xe890('0x29')](_0x5c3e66[_0xe890('0x2a')]);if(_0x5c3e66[_0xe890('0x2b')]){delete _0x5c3e66[_0xe890('0x2b')];}_0x148dec['status'](_0x524be9)[_0xe890('0x2c')](_0x5c3e66);};}exports['index']=function(_0x1d55bd,_0x464e3c){var _0x1b7786={},_0xde45dd={},_0x4416ac={'count':0x0,'rows':[]};var _0x240916=_[_0xe890('0x2d')](db['Template'][_0xe890('0x2e')],function(_0x233e5a){return{'name':_0x233e5a[_0xe890('0x2f')],'type':_0x233e5a[_0xe890('0x30')][_0xe890('0x31')]};});_0xde45dd[_0xe890('0x32')]=_[_0xe890('0x2d')](_0x240916,_0xe890('0x2b'));_0xde45dd['query']=_['keys'](_0x1d55bd[_0xe890('0x33')]);_0xde45dd[_0xe890('0x34')]=_[_0xe890('0x35')](_0xde45dd['model'],_0xde45dd[_0xe890('0x33')]);_0x1b7786[_0xe890('0x36')]=_[_0xe890('0x35')](_0xde45dd[_0xe890('0x32')],qs[_0xe890('0x37')](_0x1d55bd[_0xe890('0x33')][_0xe890('0x37')]));_0x1b7786[_0xe890('0x36')]=_0x1b7786[_0xe890('0x36')]['length']?_0x1b7786[_0xe890('0x36')]:_0xde45dd[_0xe890('0x32')];if(!_0x1d55bd[_0xe890('0x33')]['hasOwnProperty'](_0xe890('0x38'))){_0x1b7786[_0xe890('0x1e')]=qs[_0xe890('0x1e')](_0x1d55bd[_0xe890('0x33')][_0xe890('0x1e')]);_0x1b7786['offset']=qs['offset'](_0x1d55bd[_0xe890('0x33')][_0xe890('0x1c')]);}_0x1b7786[_0xe890('0x39')]=qs['sort'](_0x1d55bd[_0xe890('0x33')][_0xe890('0x3a')]);_0x1b7786[_0xe890('0x3b')]=qs['filters'](_['pick'](_0x1d55bd[_0xe890('0x33')],_0xde45dd[_0xe890('0x34')]),_0x240916);if(_0x1d55bd[_0xe890('0x33')][_0xe890('0x3c')]){_0x1b7786[_0xe890('0x3b')]=_['merge'](_0x1b7786[_0xe890('0x3b')],{'$or':_[_0xe890('0x2d')](_0x240916,function(_0x442fc6){if(_0x442fc6[_0xe890('0x30')]!==_0xe890('0x3d')){var _0x489e07={};_0x489e07[_0x442fc6[_0xe890('0x2b')]]={'$like':'%'+_0x1d55bd[_0xe890('0x33')][_0xe890('0x3c')]+'%'};return _0x489e07;}})});}_0x1b7786=_['merge']({},_0x1b7786,_0x1d55bd[_0xe890('0x3e')]);var _0x3cb550={'where':_0x1b7786[_0xe890('0x3b')]};return db[_0xe890('0x3f')]['count'](_0x3cb550)['then'](function(_0x5c50f2){_0x4416ac['count']=_0x5c50f2;if(_0x1d55bd[_0xe890('0x33')][_0xe890('0x40')]){_0x1b7786[_0xe890('0x41')]=[{'all':!![]}];}return db[_0xe890('0x3f')][_0xe890('0x42')](_0x1b7786);})[_0xe890('0x25')](function(_0x43906b){_0x4416ac[_0xe890('0x43')]=_0x43906b;return _0x4416ac;})[_0xe890('0x25')](respondWithFilteredResult(_0x464e3c,_0x1b7786))[_0xe890('0x44')](handleError(_0x464e3c,null));};exports[_0xe890('0x45')]=function(_0x3584f0,_0x2bab71){var _0x1df6ea={'raw':!![],'where':{'id':_0x3584f0[_0xe890('0x46')]['id']}},_0x3c830e={};_0x3c830e['model']=_[_0xe890('0x47')](db[_0xe890('0x3f')]['rawAttributes']);_0x3c830e['query']=_['keys'](_0x3584f0[_0xe890('0x33')]);_0x3c830e[_0xe890('0x34')]=_[_0xe890('0x35')](_0x3c830e['model'],_0x3c830e['query']);_0x1df6ea[_0xe890('0x36')]=_[_0xe890('0x35')](_0x3c830e[_0xe890('0x32')],qs[_0xe890('0x37')](_0x3584f0['query']['fields']));_0x1df6ea['attributes']=_0x1df6ea['attributes']['length']?_0x1df6ea[_0xe890('0x36')]:_0x3c830e['model'];if(_0x3584f0[_0xe890('0x33')]['includeAll']){_0x1df6ea[_0xe890('0x41')]=[{'all':!![]}];}_0x1df6ea=_[_0xe890('0x48')]({},_0x1df6ea,_0x3584f0['options']);return db['Template'][_0xe890('0x49')](_0x1df6ea)[_0xe890('0x25')](handleEntityNotFound(_0x2bab71,null))['then'](respondWithResult(_0x2bab71,null))[_0xe890('0x44')](handleError(_0x2bab71,null));};exports[_0xe890('0x4a')]=function(_0x5ce4d4,_0x29791e){return db[_0xe890('0x3f')]['create'](_0x5ce4d4['body'],{})['then'](function(_0xcfc907){var _0x4bf4de=_0x5ce4d4['user'][_0xe890('0x27')]({'plain':!![]});if(!_0x4bf4de)throw new Error(_0xe890('0x4b'));if(_0x4bf4de[_0xe890('0x4c')]===_0xe890('0x4d')){var _0x2d4a15=_0xcfc907[_0xe890('0x27')]({'plain':!![]});var _0x497f26='Templates';return db[_0xe890('0x4e')][_0xe890('0x49')]({'where':{'name':_0x497f26,'userProfileId':_0x4bf4de[_0xe890('0x4f')]},'raw':!![]})[_0xe890('0x25')](function(_0x3c41d9){if(_0x3c41d9&&_0x3c41d9[_0xe890('0x50')]===0x0){return db['UserProfileResource'][_0xe890('0x4a')]({'name':_0x2d4a15[_0xe890('0x2b')],'resourceId':_0x2d4a15['id'],'type':_0x3c41d9[_0xe890('0x2b')],'sectionId':_0x3c41d9['id']},{})[_0xe890('0x25')](function(){return _0xcfc907;});}else{return _0xcfc907;}})[_0xe890('0x44')](function(_0x581179){logger[_0xe890('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x581179);throw _0x581179;});}return _0xcfc907;})[_0xe890('0x25')](respondWithResult(_0x29791e,0xc9))[_0xe890('0x44')](handleError(_0x29791e,null));};exports[_0xe890('0x24')]=function(_0x5167f6,_0x2c3f7f){if(_0x5167f6[_0xe890('0x51')]['id']){delete _0x5167f6[_0xe890('0x51')]['id'];}return db[_0xe890('0x3f')][_0xe890('0x49')]({'where':{'id':_0x5167f6['params']['id']}})[_0xe890('0x25')](handleEntityNotFound(_0x2c3f7f,null))[_0xe890('0x25')](saveUpdates(_0x5167f6[_0xe890('0x51')],null))[_0xe890('0x25')](respondWithResult(_0x2c3f7f,null))[_0xe890('0x44')](handleError(_0x2c3f7f,null));};exports[_0xe890('0x26')]=function(_0x55f68c,_0x204f3f){return db[_0xe890('0x3f')][_0xe890('0x49')]({'where':{'id':_0x55f68c[_0xe890('0x46')]['id']}})['then'](handleEntityNotFound(_0x204f3f,null))[_0xe890('0x25')](removeEntity(_0x204f3f,null))[_0xe890('0x44')](handleError(_0x204f3f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 2061218..92e6c0a 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 _0x3d97=['../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','api','moment','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d97,0x192));var _0x73d9=function(_0x5e63d0,_0x492232){_0x5e63d0=_0x5e63d0-0x0;var _0x22ed25=_0x3d97[_0x5e63d0];return _0x22ed25;};'use strict';var _=require(_0x73d9('0x0'));var util=require(_0x73d9('0x1'));var logger=require('../../config/logger')(_0x73d9('0x2'));var moment=require(_0x73d9('0x3'));var BPromise=require('bluebird');var rp=require(_0x73d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73d9('0x5'));var config=require(_0x73d9('0x6'));var attributes=require(_0x73d9('0x7'));module[_0x73d9('0x8')]=function(_0x2399e6,_0xa4f1f4){return _0x2399e6[_0x73d9('0x9')](_0x73d9('0xa'),attributes,{'tableName':_0x73d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d09=['request-promise','path','rimraf','../../config/environment','exports','define','Template','tools_templates','util','../../config/logger','api','moment','bluebird'];(function(_0x16f9bf,_0x46d7b2){var _0x4d79fb=function(_0x273c29){while(--_0x273c29){_0x16f9bf['push'](_0x16f9bf['shift']());}};_0x4d79fb(++_0x46d7b2);}(_0x4d09,0x174));var _0x94d0=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x4d09[_0x211632];return _0x5a1da1;};'use strict';var _=require('lodash');var util=require(_0x94d0('0x0'));var logger=require(_0x94d0('0x1'))(_0x94d0('0x2'));var moment=require(_0x94d0('0x3'));var BPromise=require(_0x94d0('0x4'));var rp=require(_0x94d0('0x5'));var fs=require('fs');var path=require(_0x94d0('0x6'));var rimraf=require(_0x94d0('0x7'));var config=require(_0x94d0('0x8'));var attributes=require('./template.attributes');module[_0x94d0('0x9')]=function(_0x452ab3,_0x22ac38){return _0x452ab3[_0x94d0('0xa')](_0x94d0('0xb'),attributes,{'tableName':_0x94d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 955dd81..a7e0855 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 _0x4163=['Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','options','limit','map','model','attributes','include','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','Template,\x20%s,\x20%s','debug'];(function(_0x5f36da,_0x2bc8c9){var _0x2104b0=function(_0x48c127){while(--_0x48c127){_0x5f36da['push'](_0x5f36da['shift']());}};_0x2104b0(++_0x2bc8c9);}(_0x4163,0x17c));var _0x3416=function(_0x127a5b,_0x46a722){_0x127a5b=_0x127a5b-0x0;var _0x1ddf6d=_0x4163[_0x127a5b];return _0x1ddf6d;};'use strict';var _=require(_0x3416('0x0'));var util=require('util');var moment=require(_0x3416('0x1'));var BPromise=require('bluebird');var rs=require(_0x3416('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3416('0x3'))['db'];var utils=require(_0x3416('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3416('0x5'));var jayson=require(_0x3416('0x6'));var client=jayson[_0x3416('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554c0d,_0x265f31,_0x4cd797){return new BPromise(function(_0x748260,_0x4cad5b){return client[_0x3416('0x8')](_0x554c0d,_0x4cd797)['then'](function(_0x453e36){logger[_0x3416('0x9')](_0x3416('0xa'),_0x265f31,'request\x20sent');logger[_0x3416('0xb')](_0x3416('0xc'),_0x265f31,_0x3416('0xd'),JSON[_0x3416('0xe')](_0x453e36));if(_0x453e36['error']){if(_0x453e36[_0x3416('0xf')][_0x3416('0x10')]===0x1f4){logger[_0x3416('0xf')](_0x3416('0xa'),_0x265f31,_0x453e36[_0x3416('0xf')]['message']);return _0x4cad5b(_0x453e36[_0x3416('0xf')][_0x3416('0x11')]);}logger['error'](_0x3416('0xa'),_0x265f31,_0x453e36[_0x3416('0xf')][_0x3416('0x11')]);return _0x748260(_0x453e36[_0x3416('0xf')][_0x3416('0x11')]);}else{logger['info'](_0x3416('0xa'),_0x265f31,_0x3416('0xd'));_0x748260(_0x453e36[_0x3416('0x12')][_0x3416('0x11')]);}})[_0x3416('0x13')](function(_0xcc4c7c){logger[_0x3416('0xf')](_0x3416('0xa'),_0x265f31,_0xcc4c7c);_0x4cad5b(_0xcc4c7c);});});}exports[_0x3416('0x14')]=function(_0x3cbaf6){var _0x7ca027=this;return new Promise(function(_0x34d483,_0x4b2f37){return db[_0x3416('0x15')]['findAll']({'raw':_0x3cbaf6[_0x3416('0x16')]?_0x3cbaf6['options']['raw']===undefined?!![]:![]:!![],'where':_0x3cbaf6[_0x3416('0x16')]?_0x3cbaf6[_0x3416('0x16')]['where']||null:null,'attributes':_0x3cbaf6[_0x3416('0x16')]?_0x3cbaf6['options']['attributes']||null:null,'limit':_0x3cbaf6['options']?_0x3cbaf6['options'][_0x3416('0x17')]||null:null,'include':_0x3cbaf6['options']?_0x3cbaf6[_0x3416('0x16')]['include']?_[_0x3416('0x18')](_0x3cbaf6[_0x3416('0x16')]['include'],function(_0x5941fd){return{'model':db[_0x5941fd[_0x3416('0x19')]],'as':_0x5941fd['as'],'attributes':_0x5941fd[_0x3416('0x1a')],'include':_0x5941fd[_0x3416('0x1b')]?_[_0x3416('0x18')](_0x5941fd['include'],function(_0x23a0a7){return{'model':db[_0x23a0a7['model']],'as':_0x23a0a7['as'],'attributes':_0x23a0a7[_0x3416('0x1a')],'include':_0x23a0a7['include']?_[_0x3416('0x18')](_0x23a0a7[_0x3416('0x1b')],function(_0x1ca684){return{'model':db[_0x1ca684['model']],'as':_0x1ca684['as'],'attributes':_0x1ca684[_0x3416('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2688f4){logger[_0x3416('0x9')](_0x3416('0x14'),_0x3cbaf6);logger[_0x3416('0xb')](_0x3416('0x14'),_0x3cbaf6,JSON[_0x3416('0xe')](_0x2688f4));_0x34d483(_0x2688f4);})['catch'](function(_0x5c0d35){logger[_0x3416('0xf')](_0x3416('0x14'),_0x5c0d35['message'],_0x3cbaf6);_0x4b2f37(_0x7ca027[_0x3416('0xf')](0x1f4,_0x5c0d35[_0x3416('0x11')]));});});}; \ No newline at end of file +var _0x420d=['debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent'];(function(_0x49f222,_0x2d901f){var _0x4e0bf8=function(_0x295980){while(--_0x295980){_0x49f222['push'](_0x49f222['shift']());}};_0x4e0bf8(++_0x2d901f);}(_0x420d,0x19e));var _0xd420=function(_0x4528e4,_0x5cd15f){_0x4528e4=_0x4528e4-0x0;var _0x33ac80=_0x420d[_0x4528e4];return _0x33ac80;};'use strict';var _=require(_0xd420('0x0'));var util=require(_0xd420('0x1'));var moment=require(_0xd420('0x2'));var BPromise=require('bluebird');var rs=require(_0xd420('0x3'));var fs=require('fs');var Redis=require(_0xd420('0x4'));var db=require(_0xd420('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd420('0x6'));var config=require(_0xd420('0x7'));var jayson=require(_0xd420('0x8'));var client=jayson[_0xd420('0x9')][_0xd420('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4056c3,_0x34c562,_0xf5a7c4){return new BPromise(function(_0x3fb795,_0x442a7c){return client[_0xd420('0xb')](_0x4056c3,_0xf5a7c4)[_0xd420('0xc')](function(_0x26decf){logger['info'](_0xd420('0xd'),_0x34c562,_0xd420('0xe'));logger[_0xd420('0xf')](_0xd420('0x10'),_0x34c562,_0xd420('0xe'),JSON[_0xd420('0x11')](_0x26decf));if(_0x26decf[_0xd420('0x12')]){if(_0x26decf[_0xd420('0x12')][_0xd420('0x13')]===0x1f4){logger[_0xd420('0x12')]('Template,\x20%s,\x20%s',_0x34c562,_0x26decf[_0xd420('0x12')][_0xd420('0x14')]);return _0x442a7c(_0x26decf[_0xd420('0x12')]['message']);}logger[_0xd420('0x12')](_0xd420('0xd'),_0x34c562,_0x26decf[_0xd420('0x12')][_0xd420('0x14')]);return _0x3fb795(_0x26decf[_0xd420('0x12')][_0xd420('0x14')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x34c562,_0xd420('0xe'));_0x3fb795(_0x26decf[_0xd420('0x15')][_0xd420('0x14')]);}})[_0xd420('0x16')](function(_0x1ab57d){logger[_0xd420('0x12')](_0xd420('0xd'),_0x34c562,_0x1ab57d);_0x442a7c(_0x1ab57d);});});}exports[_0xd420('0x17')]=function(_0x1a2a2e){var _0x6a79f9=this;return new Promise(function(_0x17ec0e,_0x267beb){return db[_0xd420('0x18')]['findAll']({'raw':_0x1a2a2e[_0xd420('0x19')]?_0x1a2a2e['options'][_0xd420('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a2a2e['options']?_0x1a2a2e['options'][_0xd420('0x1b')]||null:null,'attributes':_0x1a2a2e[_0xd420('0x19')]?_0x1a2a2e[_0xd420('0x19')][_0xd420('0x1c')]||null:null,'limit':_0x1a2a2e[_0xd420('0x19')]?_0x1a2a2e[_0xd420('0x19')][_0xd420('0x1d')]||null:null,'include':_0x1a2a2e[_0xd420('0x19')]?_0x1a2a2e['options'][_0xd420('0x1e')]?_[_0xd420('0x1f')](_0x1a2a2e['options'][_0xd420('0x1e')],function(_0x2e3a15){return{'model':db[_0x2e3a15[_0xd420('0x20')]],'as':_0x2e3a15['as'],'attributes':_0x2e3a15['attributes'],'include':_0x2e3a15[_0xd420('0x1e')]?_[_0xd420('0x1f')](_0x2e3a15['include'],function(_0x226261){return{'model':db[_0x226261['model']],'as':_0x226261['as'],'attributes':_0x226261['attributes'],'include':_0x226261[_0xd420('0x1e')]?_[_0xd420('0x1f')](_0x226261[_0xd420('0x1e')],function(_0x31f40f){return{'model':db[_0x31f40f[_0xd420('0x20')]],'as':_0x31f40f['as'],'attributes':_0x31f40f[_0xd420('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd420('0xc')](function(_0x501d4c){logger['info'](_0xd420('0x17'),_0x1a2a2e);logger['debug'](_0xd420('0x17'),_0x1a2a2e,JSON['stringify'](_0x501d4c));_0x17ec0e(_0x501d4c);})['catch'](function(_0x5a5b5b){logger[_0xd420('0x12')](_0xd420('0x17'),_0x5a5b5b[_0xd420('0x14')],_0x1a2a2e);_0x267beb(_0x6a79f9[_0xd420('0x12')](0x1f4,_0x5a5b5b[_0xd420('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8993338..8eac5df 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 _0xbaca=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','show','/:id/all_conditions','isAuthenticated','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAction','delete','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbaca,0x15d));var _0xabac=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0xbaca[_0xb7b878];return _0x3c84b9;};'use strict';var multer=require('multer');var util=require(_0xabac('0x0'));var path=require(_0xabac('0x1'));var timeout=require(_0xabac('0x2'));var express=require(_0xabac('0x3'));var router=express[_0xabac('0x4')]();var fs_extra=require(_0xabac('0x5'));var auth=require(_0xabac('0x6'));var interaction=require(_0xabac('0x7'));var config=require(_0xabac('0x8'));var controller=require(_0xabac('0x9'));router[_0xabac('0xa')]('/',auth['isAuthenticated'](),controller[_0xabac('0xb')]);router[_0xabac('0xa')](_0xabac('0xc'),auth['isAuthenticated'](),controller[_0xabac('0xd')]);router[_0xabac('0xa')](_0xabac('0xe'),auth[_0xabac('0xf')](),controller[_0xabac('0x10')]);router[_0xabac('0xa')]('/:id/any_conditions',auth[_0xabac('0xf')](),controller[_0xabac('0x11')]);router[_0xabac('0xa')](_0xabac('0x12'),auth['isAuthenticated'](),controller[_0xabac('0x13')]);router[_0xabac('0x14')]('/',auth[_0xabac('0xf')](),controller[_0xabac('0x15')]);router['post']('/:id/all_conditions',auth[_0xabac('0xf')](),controller[_0xabac('0x16')]);router[_0xabac('0x14')](_0xabac('0x17'),auth[_0xabac('0xf')](),controller['addAnyCondition']);router[_0xabac('0x14')]('/:id/actions',auth[_0xabac('0xf')](),controller[_0xabac('0x18')]);router['put']('/:id',auth[_0xabac('0xf')](),controller['update']);router[_0xabac('0x19')](_0xabac('0xc'),auth[_0xabac('0xf')](),controller['destroy']);module[_0xabac('0x1a')]=router; \ No newline at end of file +var _0x0703=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','/:id/all_conditions','addAnyCondition','addAction','put','update','delete'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x0703,0xaa));var _0x3070=function(_0x1d4835,_0x40b9e5){_0x1d4835=_0x1d4835-0x0;var _0x5ca756=_0x0703[_0x1d4835];return _0x5ca756;};'use strict';var multer=require(_0x3070('0x0'));var util=require('util');var path=require(_0x3070('0x1'));var timeout=require(_0x3070('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3070('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3070('0x4'));var config=require(_0x3070('0x5'));var controller=require(_0x3070('0x6'));router[_0x3070('0x7')]('/',auth[_0x3070('0x8')](),controller['index']);router[_0x3070('0x7')](_0x3070('0x9'),auth[_0x3070('0x8')](),controller[_0x3070('0xa')]);router[_0x3070('0x7')]('/:id/all_conditions',auth[_0x3070('0x8')](),controller['getAllConditions']);router[_0x3070('0x7')](_0x3070('0xb'),auth[_0x3070('0x8')](),controller[_0x3070('0xc')]);router['get'](_0x3070('0xd'),auth[_0x3070('0x8')](),controller[_0x3070('0xe')]);router[_0x3070('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3070('0xf')](_0x3070('0x10'),auth[_0x3070('0x8')](),controller['addAllCondition']);router[_0x3070('0xf')](_0x3070('0xb'),auth[_0x3070('0x8')](),controller[_0x3070('0x11')]);router['post'](_0x3070('0xd'),auth['isAuthenticated'](),controller[_0x3070('0x12')]);router[_0x3070('0x13')](_0x3070('0x9'),auth['isAuthenticated'](),controller[_0x3070('0x14')]);router[_0x3070('0x15')](_0x3070('0x9'),auth[_0x3070('0x8')](),controller[_0x3070('0x16')]);module[_0x3070('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d21c177..f121176 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 _0xda9d=['BOOLEAN','exports','STRING'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0xda9d,0x85));var _0xdda9=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0xda9d[_0x5a99db];return _0x3aad62;};'use strict';var Sequelize=require('sequelize');module[_0xdda9('0x0')]={'name':{'type':Sequelize[_0xdda9('0x1')]},'channel':{'type':Sequelize[_0xdda9('0x1')]},'description':{'type':Sequelize[_0xdda9('0x1')]},'status':{'type':Sequelize[_0xdda9('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0e12=['BOOLEAN','sequelize','STRING'];(function(_0x42d40b,_0x17bd57){var _0x3b1e0a=function(_0x2107fc){while(--_0x2107fc){_0x42d40b['push'](_0x42d40b['shift']());}};_0x3b1e0a(++_0x17bd57);}(_0x0e12,0x169));var _0x20e1=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x0e12[_0x3f4891];return _0x54f2d8;};'use strict';var Sequelize=require(_0x20e1('0x0'));module['exports']={'name':{'type':Sequelize[_0x20e1('0x1')]},'channel':{'type':Sequelize[_0x20e1('0x1')]},'description':{'type':Sequelize[_0x20e1('0x1')]},'status':{'type':Sequelize[_0x20e1('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 83ed760..e4946c3 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 _0x2c5e=['../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','stack','name','index','Trigger','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','findOne','getAllConditions','getAnyConditions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4478d2,_0x3184ac){var _0x315c87=function(_0x5bc4f5){while(--_0x5bc4f5){_0x4478d2['push'](_0x4478d2['shift']());}};_0x315c87(++_0x3184ac);}(_0x2c5e,0x161));var _0xe2c5=function(_0x22e953,_0x10a297){_0x22e953=_0x22e953-0x0;var _0x2d4bdc=_0x2c5e[_0x22e953];return _0x2d4bdc;};'use strict';var emlformat=require(_0xe2c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2c5('0x1'));var jsonpatch=require(_0xe2c5('0x2'));var rp=require(_0xe2c5('0x3'));var moment=require('moment');var BPromise=require(_0xe2c5('0x4'));var Mustache=require(_0xe2c5('0x5'));var util=require(_0xe2c5('0x6'));var path=require(_0xe2c5('0x7'));var sox=require(_0xe2c5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2c5('0x9'));var _=require(_0xe2c5('0xa'));var squel=require(_0xe2c5('0xb'));var crypto=require(_0xe2c5('0xc'));var jsforce=require(_0xe2c5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe2c5('0xe'));var querystring=require('querystring');var Papa=require(_0xe2c5('0xf'));var Redis=require(_0xe2c5('0x10'));var authService=require(_0xe2c5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe2c5('0x12'));var hardwareService=require(_0xe2c5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe2c5('0x14'));var config=require(_0xe2c5('0x15'));var licenseUtil=require(_0xe2c5('0x16'));var db=require(_0xe2c5('0x17'))['db'];function respondWithStatusCode(_0x95a531,_0x3ef248){_0x3ef248=_0x3ef248||0xcc;return function(_0x213708){if(_0x213708){return _0x95a531[_0xe2c5('0x18')](_0x3ef248);}return _0x95a531[_0xe2c5('0x19')](_0x3ef248)['end']();};}function respondWithResult(_0x33277f,_0x100e9e){_0x100e9e=_0x100e9e||0xc8;return function(_0x2be141){if(_0x2be141){return _0x33277f[_0xe2c5('0x19')](_0x100e9e)['json'](_0x2be141);}};}function respondWithFilteredResult(_0x4a7f45,_0x507139){return function(_0x480ddd){if(_0x480ddd){var _0x2c4edd=typeof _0x507139[_0xe2c5('0x1a')]===_0xe2c5('0x1b')&&typeof _0x507139[_0xe2c5('0x1c')]==='undefined';var _0x39afaa=_0x480ddd['count'];var _0x558e85=_0x2c4edd?0x0:_0x507139[_0xe2c5('0x1a')];var _0x431cc1=_0x2c4edd?_0x480ddd[_0xe2c5('0x1d')]:_0x507139[_0xe2c5('0x1a')]+_0x507139[_0xe2c5('0x1c')];var _0x533cec;if(_0x431cc1>=_0x39afaa){_0x431cc1=_0x39afaa;_0x533cec=0xc8;}else{_0x533cec=0xce;}_0x4a7f45[_0xe2c5('0x19')](_0x533cec);return _0x4a7f45[_0xe2c5('0x1e')](_0xe2c5('0x1f'),_0x558e85+'-'+_0x431cc1+'/'+_0x39afaa)[_0xe2c5('0x20')](_0x480ddd);}return null;};}function patchUpdates(_0x42b76e){return function(_0x3899c9){try{jsonpatch[_0xe2c5('0x21')](_0x3899c9,_0x42b76e,!![]);}catch(_0x49b334){return BPromise[_0xe2c5('0x22')](_0x49b334);}return _0x3899c9[_0xe2c5('0x23')]();};}function saveUpdates(_0x2cb957,_0x1f6c45){return function(_0x300571){if(_0x300571){return _0x300571[_0xe2c5('0x24')](_0x2cb957)[_0xe2c5('0x25')](function(_0x1c6f0d){return _0x1c6f0d;});}return null;};}function removeEntity(_0x3d0021,_0x313a87){return function(_0x4b8c28){if(_0x4b8c28){return _0x4b8c28[_0xe2c5('0x26')]()[_0xe2c5('0x25')](function(){var _0x41c8d0=_0x4b8c28[_0xe2c5('0x27')]({'plain':!![]});var _0x4dddae=_0xe2c5('0x28');return db[_0xe2c5('0x29')]['destroy']({'where':{'type':_0x4dddae,'resourceId':_0x41c8d0['id']}})['then'](function(){return _0x4b8c28;});})[_0xe2c5('0x25')](function(){_0x3d0021[_0xe2c5('0x19')](0xcc)[_0xe2c5('0x2a')]();});}};}function handleEntityNotFound(_0x59fa6c,_0x450399){return function(_0x89448b){if(!_0x89448b){_0x59fa6c['sendStatus'](0x194);}return _0x89448b;};}function handleError(_0x190606,_0x523111){_0x523111=_0x523111||0x1f4;return function(_0x3e025e){logger[_0xe2c5('0x2b')](_0x3e025e[_0xe2c5('0x2c')]);if(_0x3e025e[_0xe2c5('0x2d')]){delete _0x3e025e[_0xe2c5('0x2d')];}_0x190606[_0xe2c5('0x19')](_0x523111)['send'](_0x3e025e);};}exports[_0xe2c5('0x2e')]=function(_0x12c955,_0x5d563f){var _0x264c94={},_0xbc6417={},_0x424426={'count':0x0,'rows':[]};var _0x419b9a=_['map'](db[_0xe2c5('0x2f')]['rawAttributes'],function(_0x5d1a85){return{'name':_0x5d1a85['fieldName'],'type':_0x5d1a85[_0xe2c5('0x30')][_0xe2c5('0x31')]};});_0xbc6417[_0xe2c5('0x32')]=_[_0xe2c5('0x33')](_0x419b9a,_0xe2c5('0x2d'));_0xbc6417[_0xe2c5('0x34')]=_[_0xe2c5('0x35')](_0x12c955[_0xe2c5('0x34')]);_0xbc6417[_0xe2c5('0x36')]=_[_0xe2c5('0x37')](_0xbc6417[_0xe2c5('0x32')],_0xbc6417[_0xe2c5('0x34')]);_0x264c94[_0xe2c5('0x38')]=_[_0xe2c5('0x37')](_0xbc6417[_0xe2c5('0x32')],qs[_0xe2c5('0x39')](_0x12c955[_0xe2c5('0x34')][_0xe2c5('0x39')]));_0x264c94[_0xe2c5('0x38')]=_0x264c94[_0xe2c5('0x38')][_0xe2c5('0x3a')]?_0x264c94['attributes']:_0xbc6417[_0xe2c5('0x32')];if(!_0x12c955[_0xe2c5('0x34')][_0xe2c5('0x3b')](_0xe2c5('0x3c'))){_0x264c94[_0xe2c5('0x1c')]=qs['limit'](_0x12c955[_0xe2c5('0x34')][_0xe2c5('0x1c')]);_0x264c94[_0xe2c5('0x1a')]=qs[_0xe2c5('0x1a')](_0x12c955[_0xe2c5('0x34')][_0xe2c5('0x1a')]);}_0x264c94[_0xe2c5('0x3d')]=qs[_0xe2c5('0x3e')](_0x12c955['query']['sort']);_0x264c94[_0xe2c5('0x3f')]=qs['filters'](_[_0xe2c5('0x40')](_0x12c955[_0xe2c5('0x34')],_0xbc6417['filters']),_0x419b9a);if(_0x12c955[_0xe2c5('0x34')][_0xe2c5('0x41')]){_0x264c94[_0xe2c5('0x3f')]=_[_0xe2c5('0x42')](_0x264c94[_0xe2c5('0x3f')],{'$or':_[_0xe2c5('0x33')](_0x419b9a,function(_0x42e438){if(_0x42e438[_0xe2c5('0x30')]!==_0xe2c5('0x43')){var _0x563c71={};_0x563c71[_0x42e438['name']]={'$like':'%'+_0x12c955[_0xe2c5('0x34')]['filter']+'%'};return _0x563c71;}})});}_0x264c94=_['merge']({},_0x264c94,_0x12c955[_0xe2c5('0x44')]);var _0x2d5053={'where':_0x264c94['where']};return db['Trigger'][_0xe2c5('0x1d')](_0x2d5053)[_0xe2c5('0x25')](function(_0x29d55d){_0x424426['count']=_0x29d55d;if(_0x12c955[_0xe2c5('0x34')][_0xe2c5('0x45')]){_0x264c94['include']=[{'all':!![]}];}return db[_0xe2c5('0x2f')][_0xe2c5('0x46')](_0x264c94);})[_0xe2c5('0x25')](function(_0x476d38){_0x424426[_0xe2c5('0x47')]=_0x476d38;return _0x424426;})[_0xe2c5('0x25')](respondWithFilteredResult(_0x5d563f,_0x264c94))[_0xe2c5('0x48')](handleError(_0x5d563f,null));};exports['show']=function(_0x31aa3e,_0x33363b){var _0x46286d={'raw':![],'where':{'id':_0x31aa3e[_0xe2c5('0x49')]['id']}},_0x17b02e={};_0x17b02e[_0xe2c5('0x32')]=_[_0xe2c5('0x35')](db[_0xe2c5('0x2f')][_0xe2c5('0x4a')]);_0x17b02e[_0xe2c5('0x34')]=_[_0xe2c5('0x35')](_0x31aa3e[_0xe2c5('0x34')]);_0x17b02e[_0xe2c5('0x36')]=_[_0xe2c5('0x37')](_0x17b02e['model'],_0x17b02e[_0xe2c5('0x34')]);_0x46286d[_0xe2c5('0x38')]=_[_0xe2c5('0x37')](_0x17b02e[_0xe2c5('0x32')],qs[_0xe2c5('0x39')](_0x31aa3e[_0xe2c5('0x34')]['fields']));_0x46286d[_0xe2c5('0x38')]=_0x46286d[_0xe2c5('0x38')][_0xe2c5('0x3a')]?_0x46286d[_0xe2c5('0x38')]:_0x17b02e['model'];if(_0x31aa3e['query']['includeAll']){_0x46286d[_0xe2c5('0x4b')]=[{'all':!![]}];}_0x46286d=_['merge']({},_0x46286d,_0x31aa3e['options']);return db['Trigger'][_0xe2c5('0x4c')](_0x46286d)[_0xe2c5('0x25')](handleEntityNotFound(_0x33363b,null))[_0xe2c5('0x25')](respondWithResult(_0x33363b,null))['catch'](handleError(_0x33363b,null));};exports[_0xe2c5('0x4d')]=function(_0x9a7c81,_0x128704){return db[_0xe2c5('0x2f')][_0xe2c5('0x4d')](_0x9a7c81[_0xe2c5('0x4e')],{})[_0xe2c5('0x25')](function(_0x82ee6f){var _0x3d7ede=_0x9a7c81[_0xe2c5('0x4f')][_0xe2c5('0x27')]({'plain':!![]});if(!_0x3d7ede)throw new Error(_0xe2c5('0x50'));if(_0x3d7ede['role']===_0xe2c5('0x4f')){var _0x22d13d=_0x82ee6f['get']({'plain':!![]});var _0x20483f='Triggers';return db[_0xe2c5('0x51')][_0xe2c5('0x4c')]({'where':{'name':_0x20483f,'userProfileId':_0x3d7ede[_0xe2c5('0x52')]},'raw':!![]})['then'](function(_0x26d554){if(_0x26d554&&_0x26d554[_0xe2c5('0x53')]===0x0){return db[_0xe2c5('0x29')][_0xe2c5('0x4d')]({'name':_0x22d13d[_0xe2c5('0x2d')],'resourceId':_0x22d13d['id'],'type':_0x26d554[_0xe2c5('0x2d')],'sectionId':_0x26d554['id']},{})[_0xe2c5('0x25')](function(){return _0x82ee6f;});}else{return _0x82ee6f;}})[_0xe2c5('0x48')](function(_0x1f2959){logger[_0xe2c5('0x2b')](_0xe2c5('0x54'),_0x1f2959);throw _0x1f2959;});}return _0x82ee6f;})[_0xe2c5('0x25')](respondWithResult(_0x128704,0xc9))[_0xe2c5('0x48')](handleError(_0x128704,null));};exports['update']=function(_0x382868,_0x4b233c){if(_0x382868['body']['id']){delete _0x382868[_0xe2c5('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x382868[_0xe2c5('0x49')]['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x4b233c,null))['then'](saveUpdates(_0x382868[_0xe2c5('0x4e')],null))[_0xe2c5('0x25')](respondWithResult(_0x4b233c,null))['catch'](handleError(_0x4b233c,null));};exports[_0xe2c5('0x26')]=function(_0x39d2b5,_0x294ceb){return db[_0xe2c5('0x2f')][_0xe2c5('0x4c')]({'where':{'id':_0x39d2b5['params']['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x294ceb,null))['then'](removeEntity(_0x294ceb,null))[_0xe2c5('0x48')](handleError(_0x294ceb,null));};exports[_0xe2c5('0x55')]=function(_0x4175ae,_0x448cf1,_0x1f2886){if(_0x4175ae[_0xe2c5('0x4e')]['id']){delete _0x4175ae['body']['id'];}return db[_0xe2c5('0x2f')]['find']({'where':{'id':_0x4175ae[_0xe2c5('0x49')]['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x448cf1,null))['then'](function(_0x454f0e){if(_0x454f0e){_0x4175ae[_0xe2c5('0x4e')][_0xe2c5('0x56')]=_0x454f0e['id'];return db[_0xe2c5('0x57')][_0xe2c5('0x4d')](_0x4175ae[_0xe2c5('0x4e')]);}})['then'](respondWithResult(_0x448cf1,null))[_0xe2c5('0x48')](handleError(_0x448cf1,null));};exports[_0xe2c5('0x58')]=function(_0x2f1f6c,_0x290704,_0x440800){if(_0x2f1f6c['body']['id']){delete _0x2f1f6c[_0xe2c5('0x4e')]['id'];}return db[_0xe2c5('0x2f')]['find']({'where':{'id':_0x2f1f6c[_0xe2c5('0x49')]['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x290704,null))[_0xe2c5('0x25')](function(_0x5e36d8){if(_0x5e36d8){_0x2f1f6c[_0xe2c5('0x4e')]['TriggerAnyId']=_0x5e36d8['id'];return db[_0xe2c5('0x57')][_0xe2c5('0x4d')](_0x2f1f6c[_0xe2c5('0x4e')]);}})['then'](respondWithResult(_0x290704,null))['catch'](handleError(_0x290704,null));};exports['getAllConditions']=function(_0x5026d3,_0x3220ea,_0x582d9e){var _0x272576={};var _0x23d71a={};var _0x469663;var _0xd8f5b3;return db[_0xe2c5('0x2f')][_0xe2c5('0x59')]({'where':{'id':_0x5026d3['params']['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x3220ea,null))[_0xe2c5('0x25')](function(_0x4e71e4){if(_0x4e71e4){_0x469663=_0x4e71e4;_0x23d71a[_0xe2c5('0x32')]=_[_0xe2c5('0x35')](db[_0xe2c5('0x57')][_0xe2c5('0x4a')]);_0x23d71a[_0xe2c5('0x34')]=_[_0xe2c5('0x35')](_0x5026d3[_0xe2c5('0x34')]);_0x23d71a[_0xe2c5('0x36')]=_[_0xe2c5('0x37')](_0x23d71a[_0xe2c5('0x32')],_0x23d71a['query']);_0x272576[_0xe2c5('0x38')]=_[_0xe2c5('0x37')](_0x23d71a[_0xe2c5('0x32')],qs[_0xe2c5('0x39')](_0x5026d3[_0xe2c5('0x34')][_0xe2c5('0x39')]));_0x272576[_0xe2c5('0x38')]=_0x272576['attributes'][_0xe2c5('0x3a')]?_0x272576[_0xe2c5('0x38')]:_0x23d71a['model'];_0x272576['order']=qs[_0xe2c5('0x3e')](_0x5026d3['query'][_0xe2c5('0x3e')]);_0x272576[_0xe2c5('0x3f')]=qs[_0xe2c5('0x36')](_[_0xe2c5('0x40')](_0x5026d3[_0xe2c5('0x34')],_0x23d71a[_0xe2c5('0x36')]));if(_0x5026d3[_0xe2c5('0x34')][_0xe2c5('0x41')]){_0x272576[_0xe2c5('0x3f')]=_[_0xe2c5('0x42')](_0x272576[_0xe2c5('0x3f')],{'$or':_[_0xe2c5('0x33')](_0x272576[_0xe2c5('0x38')],function(_0x1e8780){var _0x2c67f2={};_0x2c67f2[_0x1e8780]={'$like':'%'+_0x5026d3['query'][_0xe2c5('0x41')]+'%'};return _0x2c67f2;})});}_0x272576=_[_0xe2c5('0x42')]({},_0x272576,_0x5026d3['options']);return _0x469663[_0xe2c5('0x5a')](_0x272576);}})['then'](function(_0x4cceb9){if(_0x4cceb9){_0xd8f5b3=_0x4cceb9[_0xe2c5('0x3a')];if(!_0x5026d3[_0xe2c5('0x34')][_0xe2c5('0x3b')](_0xe2c5('0x3c'))){_0x272576['limit']=qs[_0xe2c5('0x1c')](_0x5026d3[_0xe2c5('0x34')][_0xe2c5('0x1c')]);_0x272576[_0xe2c5('0x1a')]=qs['offset'](_0x5026d3['query']['offset']);}return _0x469663[_0xe2c5('0x5a')](_0x272576);}})[_0xe2c5('0x25')](function(_0xe58a28){if(_0xe58a28){return _0xe58a28?{'count':_0xd8f5b3,'rows':_0xe58a28}:null;}})['then'](respondWithResult(_0x3220ea,null))[_0xe2c5('0x48')](handleError(_0x3220ea,null));};exports[_0xe2c5('0x5b')]=function(_0x323d01,_0x95c9f0,_0xb567){var _0x4a0eee={};var _0x37f488={};var _0x3b1a67;var _0x4c2ee4;return db[_0xe2c5('0x2f')][_0xe2c5('0x59')]({'where':{'id':_0x323d01[_0xe2c5('0x49')]['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x95c9f0,null))[_0xe2c5('0x25')](function(_0xa39a50){if(_0xa39a50){_0x3b1a67=_0xa39a50;_0x37f488[_0xe2c5('0x32')]=_[_0xe2c5('0x35')](db[_0xe2c5('0x57')][_0xe2c5('0x4a')]);_0x37f488[_0xe2c5('0x34')]=_[_0xe2c5('0x35')](_0x323d01[_0xe2c5('0x34')]);_0x37f488['filters']=_[_0xe2c5('0x37')](_0x37f488['model'],_0x37f488[_0xe2c5('0x34')]);_0x4a0eee['attributes']=_[_0xe2c5('0x37')](_0x37f488[_0xe2c5('0x32')],qs[_0xe2c5('0x39')](_0x323d01['query'][_0xe2c5('0x39')]));_0x4a0eee[_0xe2c5('0x38')]=_0x4a0eee['attributes'][_0xe2c5('0x3a')]?_0x4a0eee[_0xe2c5('0x38')]:_0x37f488['model'];_0x4a0eee[_0xe2c5('0x3d')]=qs[_0xe2c5('0x3e')](_0x323d01[_0xe2c5('0x34')][_0xe2c5('0x3e')]);_0x4a0eee['where']=qs[_0xe2c5('0x36')](_[_0xe2c5('0x40')](_0x323d01['query'],_0x37f488[_0xe2c5('0x36')]));if(_0x323d01['query']['filter']){_0x4a0eee[_0xe2c5('0x3f')]=_['merge'](_0x4a0eee[_0xe2c5('0x3f')],{'$or':_['map'](_0x4a0eee[_0xe2c5('0x38')],function(_0xfb61c9){var _0x59bac={};_0x59bac[_0xfb61c9]={'$like':'%'+_0x323d01[_0xe2c5('0x34')][_0xe2c5('0x41')]+'%'};return _0x59bac;})});}_0x4a0eee=_[_0xe2c5('0x42')]({},_0x4a0eee,_0x323d01[_0xe2c5('0x44')]);return _0x3b1a67['getAnyConditions'](_0x4a0eee);}})[_0xe2c5('0x25')](function(_0x439d10){if(_0x439d10){_0x4c2ee4=_0x439d10['length'];if(!_0x323d01[_0xe2c5('0x34')][_0xe2c5('0x3b')](_0xe2c5('0x3c'))){_0x4a0eee[_0xe2c5('0x1c')]=qs['limit'](_0x323d01[_0xe2c5('0x34')]['limit']);_0x4a0eee[_0xe2c5('0x1a')]=qs[_0xe2c5('0x1a')](_0x323d01[_0xe2c5('0x34')][_0xe2c5('0x1a')]);}return _0x3b1a67['getAnyConditions'](_0x4a0eee);}})['then'](function(_0x4f29b8){if(_0x4f29b8){return _0x4f29b8?{'count':_0x4c2ee4,'rows':_0x4f29b8}:null;}})['then'](respondWithResult(_0x95c9f0,null))[_0xe2c5('0x48')](handleError(_0x95c9f0,null));};exports['addAction']=function(_0x1b691d,_0x52121d,_0x271d07){if(_0x1b691d[_0xe2c5('0x4e')]['id']){delete _0x1b691d[_0xe2c5('0x4e')]['id'];}return db[_0xe2c5('0x2f')]['find']({'where':{'id':_0x1b691d[_0xe2c5('0x49')]['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x52121d,null))[_0xe2c5('0x25')](function(_0x20f65d){if(_0x20f65d){_0x1b691d[_0xe2c5('0x4e')]['TriggerId']=_0x20f65d['id'];return db[_0xe2c5('0x5c')][_0xe2c5('0x4d')](_0x1b691d[_0xe2c5('0x4e')]);}})[_0xe2c5('0x25')](respondWithResult(_0x52121d,null))[_0xe2c5('0x48')](handleError(_0x52121d,null));};exports[_0xe2c5('0x5d')]=function(_0x238c9d,_0x2d3815,_0x10ce53){var _0x5834ae={};var _0x2e2e9e={};var _0x2a3233;var _0x51a503;return db[_0xe2c5('0x2f')][_0xe2c5('0x59')]({'where':{'id':_0x238c9d[_0xe2c5('0x49')]['id']}})[_0xe2c5('0x25')](handleEntityNotFound(_0x2d3815,null))[_0xe2c5('0x25')](function(_0x384225){if(_0x384225){_0x2a3233=_0x384225;_0x2e2e9e[_0xe2c5('0x32')]=_[_0xe2c5('0x35')](db[_0xe2c5('0x5c')]['rawAttributes']);_0x2e2e9e['query']=_['keys'](_0x238c9d[_0xe2c5('0x34')]);_0x2e2e9e[_0xe2c5('0x36')]=_[_0xe2c5('0x37')](_0x2e2e9e[_0xe2c5('0x32')],_0x2e2e9e[_0xe2c5('0x34')]);_0x5834ae[_0xe2c5('0x38')]=_['intersection'](_0x2e2e9e[_0xe2c5('0x32')],qs[_0xe2c5('0x39')](_0x238c9d[_0xe2c5('0x34')][_0xe2c5('0x39')]));_0x5834ae[_0xe2c5('0x38')]=_0x5834ae[_0xe2c5('0x38')]['length']?_0x5834ae['attributes']:_0x2e2e9e['model'];_0x5834ae[_0xe2c5('0x3d')]=qs[_0xe2c5('0x3e')](_0x238c9d[_0xe2c5('0x34')][_0xe2c5('0x3e')]);_0x5834ae[_0xe2c5('0x3f')]=qs[_0xe2c5('0x36')](_[_0xe2c5('0x40')](_0x238c9d[_0xe2c5('0x34')],_0x2e2e9e[_0xe2c5('0x36')]));if(_0x238c9d[_0xe2c5('0x34')]['filter']){_0x5834ae[_0xe2c5('0x3f')]=_[_0xe2c5('0x42')](_0x5834ae[_0xe2c5('0x3f')],{'$or':_['map'](_0x5834ae['attributes'],function(_0x4d7cf6){var _0x2595ac={};_0x2595ac[_0x4d7cf6]={'$like':'%'+_0x238c9d[_0xe2c5('0x34')][_0xe2c5('0x41')]+'%'};return _0x2595ac;})});}_0x5834ae=_['merge']({},_0x5834ae,_0x238c9d[_0xe2c5('0x44')]);return _0x2a3233[_0xe2c5('0x5d')](_0x5834ae);}})[_0xe2c5('0x25')](function(_0x7568b8){if(_0x7568b8){_0x51a503=_0x7568b8[_0xe2c5('0x3a')];if(!_0x238c9d[_0xe2c5('0x34')]['hasOwnProperty']('nolimit')){_0x5834ae[_0xe2c5('0x1c')]=qs[_0xe2c5('0x1c')](_0x238c9d[_0xe2c5('0x34')][_0xe2c5('0x1c')]);_0x5834ae['offset']=qs[_0xe2c5('0x1a')](_0x238c9d[_0xe2c5('0x34')]['offset']);}return _0x2a3233[_0xe2c5('0x5d')](_0x5834ae);}})[_0xe2c5('0x25')](function(_0x1918eb){if(_0x1918eb){return _0x1918eb?{'count':_0x51a503,'rows':_0x1918eb}:null;}})[_0xe2c5('0x25')](respondWithResult(_0x2d3815,null))[_0xe2c5('0x48')](handleError(_0x2d3815,null));}; \ No newline at end of file +var _0x1893=['userProfileId','autoAssociation','update','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection'];(function(_0x18b388,_0x5b221e){var _0x26b268=function(_0x227efe){while(--_0x227efe){_0x18b388['push'](_0x18b388['shift']());}};_0x26b268(++_0x5b221e);}(_0x1893,0x75));var _0x3189=function(_0x3f9f9d,_0x923a36){_0x3f9f9d=_0x3f9f9d-0x0;var _0x3f9fc9=_0x1893[_0x3f9f9d];return _0x3f9fc9;};'use strict';var emlformat=require(_0x3189('0x0'));var rimraf=require(_0x3189('0x1'));var zipdir=require(_0x3189('0x2'));var jsonpatch=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var moment=require(_0x3189('0x5'));var BPromise=require(_0x3189('0x6'));var Mustache=require(_0x3189('0x7'));var util=require(_0x3189('0x8'));var path=require(_0x3189('0x9'));var sox=require(_0x3189('0xa'));var csv=require('to-csv');var ejs=require(_0x3189('0xb'));var fs=require('fs');var fs_extra=require(_0x3189('0xc'));var _=require(_0x3189('0xd'));var squel=require(_0x3189('0xe'));var crypto=require(_0x3189('0xf'));var jsforce=require(_0x3189('0x10'));var deskjs=require(_0x3189('0x11'));var toCsv=require(_0x3189('0x12'));var querystring=require(_0x3189('0x13'));var Papa=require(_0x3189('0x14'));var Redis=require(_0x3189('0x15'));var authService=require(_0x3189('0x16'));var qs=require(_0x3189('0x17'));var as=require(_0x3189('0x18'));var hardwareService=require(_0x3189('0x19'));var logger=require('../../config/logger')('api');var utils=require(_0x3189('0x1a'));var config=require(_0x3189('0x1b'));var licenseUtil=require(_0x3189('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259680,_0x5830c8){_0x5830c8=_0x5830c8||0xcc;return function(_0x57c7a1){if(_0x57c7a1){return _0x259680[_0x3189('0x1d')](_0x5830c8);}return _0x259680[_0x3189('0x1e')](_0x5830c8)[_0x3189('0x1f')]();};}function respondWithResult(_0x368799,_0x382d42){_0x382d42=_0x382d42||0xc8;return function(_0x50382e){if(_0x50382e){return _0x368799[_0x3189('0x1e')](_0x382d42)[_0x3189('0x20')](_0x50382e);}};}function respondWithFilteredResult(_0x49bb5a,_0x3e43c3){return function(_0x4e19ce){if(_0x4e19ce){var _0xe3db25=typeof _0x3e43c3['offset']===_0x3189('0x21')&&typeof _0x3e43c3[_0x3189('0x22')]===_0x3189('0x21');var _0x38f5de=_0x4e19ce[_0x3189('0x23')];var _0x21c2c7=_0xe3db25?0x0:_0x3e43c3[_0x3189('0x24')];var _0x29a96d=_0xe3db25?_0x4e19ce[_0x3189('0x23')]:_0x3e43c3[_0x3189('0x24')]+_0x3e43c3[_0x3189('0x22')];var _0x178ff9;if(_0x29a96d>=_0x38f5de){_0x29a96d=_0x38f5de;_0x178ff9=0xc8;}else{_0x178ff9=0xce;}_0x49bb5a[_0x3189('0x1e')](_0x178ff9);return _0x49bb5a[_0x3189('0x25')](_0x3189('0x26'),_0x21c2c7+'-'+_0x29a96d+'/'+_0x38f5de)[_0x3189('0x20')](_0x4e19ce);}return null;};}function patchUpdates(_0x28669b){return function(_0x2c8d8c){try{jsonpatch[_0x3189('0x27')](_0x2c8d8c,_0x28669b,!![]);}catch(_0x2c12fd){return BPromise[_0x3189('0x28')](_0x2c12fd);}return _0x2c8d8c[_0x3189('0x29')]();};}function saveUpdates(_0x469799,_0x4ae8dc){return function(_0x1f29fa){if(_0x1f29fa){return _0x1f29fa['update'](_0x469799)[_0x3189('0x2a')](function(_0x31700d){return _0x31700d;});}return null;};}function removeEntity(_0x49e5d7,_0x276e7e){return function(_0x5e1c4){if(_0x5e1c4){return _0x5e1c4[_0x3189('0x2b')]()[_0x3189('0x2a')](function(){var _0x440dd4=_0x5e1c4[_0x3189('0x2c')]({'plain':!![]});var _0x2bcb31=_0x3189('0x2d');return db[_0x3189('0x2e')]['destroy']({'where':{'type':_0x2bcb31,'resourceId':_0x440dd4['id']}})[_0x3189('0x2a')](function(){return _0x5e1c4;});})[_0x3189('0x2a')](function(){_0x49e5d7[_0x3189('0x1e')](0xcc)[_0x3189('0x1f')]();});}};}function handleEntityNotFound(_0x113fb5,_0x214218){return function(_0x17fdd2){if(!_0x17fdd2){_0x113fb5[_0x3189('0x1d')](0x194);}return _0x17fdd2;};}function handleError(_0x30b844,_0x3e79c6){_0x3e79c6=_0x3e79c6||0x1f4;return function(_0x13647c){logger['error'](_0x13647c[_0x3189('0x2f')]);if(_0x13647c['name']){delete _0x13647c[_0x3189('0x30')];}_0x30b844[_0x3189('0x1e')](_0x3e79c6)[_0x3189('0x31')](_0x13647c);};}exports[_0x3189('0x32')]=function(_0x4b480f,_0x551b76){var _0x5c0d9b={},_0x4caf2e={},_0x31c115={'count':0x0,'rows':[]};var _0x4d27d2=_[_0x3189('0x33')](db[_0x3189('0x34')][_0x3189('0x35')],function(_0x1fac4d){return{'name':_0x1fac4d[_0x3189('0x36')],'type':_0x1fac4d[_0x3189('0x37')][_0x3189('0x38')]};});_0x4caf2e[_0x3189('0x39')]=_[_0x3189('0x33')](_0x4d27d2,_0x3189('0x30'));_0x4caf2e[_0x3189('0x3a')]=_[_0x3189('0x3b')](_0x4b480f[_0x3189('0x3a')]);_0x4caf2e[_0x3189('0x3c')]=_['intersection'](_0x4caf2e[_0x3189('0x39')],_0x4caf2e[_0x3189('0x3a')]);_0x5c0d9b[_0x3189('0x3d')]=_[_0x3189('0x3e')](_0x4caf2e['model'],qs[_0x3189('0x3f')](_0x4b480f['query'][_0x3189('0x3f')]));_0x5c0d9b[_0x3189('0x3d')]=_0x5c0d9b[_0x3189('0x3d')][_0x3189('0x40')]?_0x5c0d9b['attributes']:_0x4caf2e[_0x3189('0x39')];if(!_0x4b480f[_0x3189('0x3a')][_0x3189('0x41')](_0x3189('0x42'))){_0x5c0d9b[_0x3189('0x22')]=qs['limit'](_0x4b480f[_0x3189('0x3a')][_0x3189('0x22')]);_0x5c0d9b['offset']=qs['offset'](_0x4b480f[_0x3189('0x3a')][_0x3189('0x24')]);}_0x5c0d9b[_0x3189('0x43')]=qs['sort'](_0x4b480f['query'][_0x3189('0x44')]);_0x5c0d9b[_0x3189('0x45')]=qs[_0x3189('0x3c')](_['pick'](_0x4b480f['query'],_0x4caf2e[_0x3189('0x3c')]),_0x4d27d2);if(_0x4b480f['query'][_0x3189('0x46')]){_0x5c0d9b['where']=_['merge'](_0x5c0d9b[_0x3189('0x45')],{'$or':_[_0x3189('0x33')](_0x4d27d2,function(_0xe73bbc){if(_0xe73bbc[_0x3189('0x37')]!==_0x3189('0x47')){var _0x4cad72={};_0x4cad72[_0xe73bbc['name']]={'$like':'%'+_0x4b480f[_0x3189('0x3a')][_0x3189('0x46')]+'%'};return _0x4cad72;}})});}_0x5c0d9b=_[_0x3189('0x48')]({},_0x5c0d9b,_0x4b480f[_0x3189('0x49')]);var _0x419ec2={'where':_0x5c0d9b[_0x3189('0x45')]};return db[_0x3189('0x34')][_0x3189('0x23')](_0x419ec2)['then'](function(_0x437ec0){_0x31c115['count']=_0x437ec0;if(_0x4b480f['query']['includeAll']){_0x5c0d9b[_0x3189('0x4a')]=[{'all':!![]}];}return db[_0x3189('0x34')][_0x3189('0x4b')](_0x5c0d9b);})[_0x3189('0x2a')](function(_0x2c9ff3){_0x31c115[_0x3189('0x4c')]=_0x2c9ff3;return _0x31c115;})[_0x3189('0x2a')](respondWithFilteredResult(_0x551b76,_0x5c0d9b))[_0x3189('0x4d')](handleError(_0x551b76,null));};exports[_0x3189('0x4e')]=function(_0x4ec115,_0x2a058a){var _0x23103d={'raw':![],'where':{'id':_0x4ec115[_0x3189('0x4f')]['id']}},_0x384d90={};_0x384d90[_0x3189('0x39')]=_['keys'](db[_0x3189('0x34')][_0x3189('0x35')]);_0x384d90[_0x3189('0x3a')]=_[_0x3189('0x3b')](_0x4ec115[_0x3189('0x3a')]);_0x384d90['filters']=_['intersection'](_0x384d90[_0x3189('0x39')],_0x384d90[_0x3189('0x3a')]);_0x23103d[_0x3189('0x3d')]=_[_0x3189('0x3e')](_0x384d90[_0x3189('0x39')],qs[_0x3189('0x3f')](_0x4ec115[_0x3189('0x3a')][_0x3189('0x3f')]));_0x23103d[_0x3189('0x3d')]=_0x23103d['attributes'][_0x3189('0x40')]?_0x23103d[_0x3189('0x3d')]:_0x384d90[_0x3189('0x39')];if(_0x4ec115[_0x3189('0x3a')][_0x3189('0x50')]){_0x23103d[_0x3189('0x4a')]=[{'all':!![]}];}_0x23103d=_[_0x3189('0x48')]({},_0x23103d,_0x4ec115['options']);return db['Trigger'][_0x3189('0x51')](_0x23103d)[_0x3189('0x2a')](handleEntityNotFound(_0x2a058a,null))[_0x3189('0x2a')](respondWithResult(_0x2a058a,null))['catch'](handleError(_0x2a058a,null));};exports[_0x3189('0x52')]=function(_0x100bf7,_0x1ad8ee){return db['Trigger'][_0x3189('0x52')](_0x100bf7[_0x3189('0x53')],{})[_0x3189('0x2a')](function(_0x288442){var _0x516f1c=_0x100bf7[_0x3189('0x54')][_0x3189('0x2c')]({'plain':!![]});if(!_0x516f1c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x516f1c[_0x3189('0x55')]===_0x3189('0x54')){var _0x4c9c6d=_0x288442[_0x3189('0x2c')]({'plain':!![]});var _0x328943='Triggers';return db[_0x3189('0x56')][_0x3189('0x51')]({'where':{'name':_0x328943,'userProfileId':_0x516f1c[_0x3189('0x57')]},'raw':!![]})[_0x3189('0x2a')](function(_0x316312){if(_0x316312&&_0x316312[_0x3189('0x58')]===0x0){return db['UserProfileResource'][_0x3189('0x52')]({'name':_0x4c9c6d[_0x3189('0x30')],'resourceId':_0x4c9c6d['id'],'type':_0x316312['name'],'sectionId':_0x316312['id']},{})[_0x3189('0x2a')](function(){return _0x288442;});}else{return _0x288442;}})[_0x3189('0x4d')](function(_0x34111c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34111c);throw _0x34111c;});}return _0x288442;})['then'](respondWithResult(_0x1ad8ee,0xc9))[_0x3189('0x4d')](handleError(_0x1ad8ee,null));};exports[_0x3189('0x59')]=function(_0x484e21,_0x154049){if(_0x484e21[_0x3189('0x53')]['id']){delete _0x484e21[_0x3189('0x53')]['id'];}return db[_0x3189('0x34')][_0x3189('0x51')]({'where':{'id':_0x484e21[_0x3189('0x4f')]['id']}})['then'](handleEntityNotFound(_0x154049,null))['then'](saveUpdates(_0x484e21['body'],null))[_0x3189('0x2a')](respondWithResult(_0x154049,null))[_0x3189('0x4d')](handleError(_0x154049,null));};exports[_0x3189('0x2b')]=function(_0x4d3366,_0x272b45){return db[_0x3189('0x34')][_0x3189('0x51')]({'where':{'id':_0x4d3366[_0x3189('0x4f')]['id']}})['then'](handleEntityNotFound(_0x272b45,null))[_0x3189('0x2a')](removeEntity(_0x272b45,null))['catch'](handleError(_0x272b45,null));};exports['addAllCondition']=function(_0xb32847,_0x4546a4,_0x57688c){if(_0xb32847['body']['id']){delete _0xb32847[_0x3189('0x53')]['id'];}return db[_0x3189('0x34')]['find']({'where':{'id':_0xb32847[_0x3189('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4546a4,null))[_0x3189('0x2a')](function(_0x2c3df9){if(_0x2c3df9){_0xb32847[_0x3189('0x53')][_0x3189('0x5a')]=_0x2c3df9['id'];return db[_0x3189('0x5b')][_0x3189('0x52')](_0xb32847['body']);}})[_0x3189('0x2a')](respondWithResult(_0x4546a4,null))[_0x3189('0x4d')](handleError(_0x4546a4,null));};exports[_0x3189('0x5c')]=function(_0x3b2e14,_0x57beb7,_0x2cb74c){if(_0x3b2e14[_0x3189('0x53')]['id']){delete _0x3b2e14[_0x3189('0x53')]['id'];}return db[_0x3189('0x34')]['find']({'where':{'id':_0x3b2e14['params']['id']}})[_0x3189('0x2a')](handleEntityNotFound(_0x57beb7,null))[_0x3189('0x2a')](function(_0x41defe){if(_0x41defe){_0x3b2e14[_0x3189('0x53')][_0x3189('0x5d')]=_0x41defe['id'];return db[_0x3189('0x5b')][_0x3189('0x52')](_0x3b2e14[_0x3189('0x53')]);}})[_0x3189('0x2a')](respondWithResult(_0x57beb7,null))[_0x3189('0x4d')](handleError(_0x57beb7,null));};exports[_0x3189('0x5e')]=function(_0x11d533,_0x2c28a2,_0x5827ed){var _0x590e1f={};var _0x32af86={};var _0x318981;var _0x1dd9f4;return db[_0x3189('0x34')][_0x3189('0x5f')]({'where':{'id':_0x11d533[_0x3189('0x4f')]['id']}})[_0x3189('0x2a')](handleEntityNotFound(_0x2c28a2,null))[_0x3189('0x2a')](function(_0x14665f){if(_0x14665f){_0x318981=_0x14665f;_0x32af86[_0x3189('0x39')]=_[_0x3189('0x3b')](db['Condition']['rawAttributes']);_0x32af86[_0x3189('0x3a')]=_['keys'](_0x11d533[_0x3189('0x3a')]);_0x32af86[_0x3189('0x3c')]=_[_0x3189('0x3e')](_0x32af86[_0x3189('0x39')],_0x32af86[_0x3189('0x3a')]);_0x590e1f[_0x3189('0x3d')]=_[_0x3189('0x3e')](_0x32af86['model'],qs[_0x3189('0x3f')](_0x11d533['query'][_0x3189('0x3f')]));_0x590e1f[_0x3189('0x3d')]=_0x590e1f[_0x3189('0x3d')][_0x3189('0x40')]?_0x590e1f['attributes']:_0x32af86[_0x3189('0x39')];_0x590e1f[_0x3189('0x43')]=qs[_0x3189('0x44')](_0x11d533[_0x3189('0x3a')][_0x3189('0x44')]);_0x590e1f[_0x3189('0x45')]=qs[_0x3189('0x3c')](_[_0x3189('0x60')](_0x11d533[_0x3189('0x3a')],_0x32af86[_0x3189('0x3c')]));if(_0x11d533['query'][_0x3189('0x46')]){_0x590e1f[_0x3189('0x45')]=_[_0x3189('0x48')](_0x590e1f[_0x3189('0x45')],{'$or':_[_0x3189('0x33')](_0x590e1f[_0x3189('0x3d')],function(_0x483ad0){var _0x419683={};_0x419683[_0x483ad0]={'$like':'%'+_0x11d533['query'][_0x3189('0x46')]+'%'};return _0x419683;})});}_0x590e1f=_[_0x3189('0x48')]({},_0x590e1f,_0x11d533[_0x3189('0x49')]);return _0x318981[_0x3189('0x5e')](_0x590e1f);}})[_0x3189('0x2a')](function(_0x56cdb3){if(_0x56cdb3){_0x1dd9f4=_0x56cdb3[_0x3189('0x40')];if(!_0x11d533[_0x3189('0x3a')][_0x3189('0x41')](_0x3189('0x42'))){_0x590e1f[_0x3189('0x22')]=qs['limit'](_0x11d533[_0x3189('0x3a')]['limit']);_0x590e1f[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x11d533[_0x3189('0x3a')][_0x3189('0x24')]);}return _0x318981[_0x3189('0x5e')](_0x590e1f);}})[_0x3189('0x2a')](function(_0x3be0c0){if(_0x3be0c0){return _0x3be0c0?{'count':_0x1dd9f4,'rows':_0x3be0c0}:null;}})[_0x3189('0x2a')](respondWithResult(_0x2c28a2,null))[_0x3189('0x4d')](handleError(_0x2c28a2,null));};exports[_0x3189('0x61')]=function(_0xf18d61,_0x3b30c3,_0x510f54){var _0x55e370={};var _0x44627b={};var _0x5c6c44;var _0x4b5ce7;return db[_0x3189('0x34')]['findOne']({'where':{'id':_0xf18d61[_0x3189('0x4f')]['id']}})[_0x3189('0x2a')](handleEntityNotFound(_0x3b30c3,null))['then'](function(_0xc49b81){if(_0xc49b81){_0x5c6c44=_0xc49b81;_0x44627b[_0x3189('0x39')]=_[_0x3189('0x3b')](db['Condition'][_0x3189('0x35')]);_0x44627b[_0x3189('0x3a')]=_[_0x3189('0x3b')](_0xf18d61[_0x3189('0x3a')]);_0x44627b[_0x3189('0x3c')]=_['intersection'](_0x44627b[_0x3189('0x39')],_0x44627b[_0x3189('0x3a')]);_0x55e370[_0x3189('0x3d')]=_['intersection'](_0x44627b[_0x3189('0x39')],qs[_0x3189('0x3f')](_0xf18d61[_0x3189('0x3a')][_0x3189('0x3f')]));_0x55e370[_0x3189('0x3d')]=_0x55e370[_0x3189('0x3d')][_0x3189('0x40')]?_0x55e370['attributes']:_0x44627b[_0x3189('0x39')];_0x55e370[_0x3189('0x43')]=qs[_0x3189('0x44')](_0xf18d61[_0x3189('0x3a')][_0x3189('0x44')]);_0x55e370[_0x3189('0x45')]=qs['filters'](_[_0x3189('0x60')](_0xf18d61[_0x3189('0x3a')],_0x44627b[_0x3189('0x3c')]));if(_0xf18d61[_0x3189('0x3a')][_0x3189('0x46')]){_0x55e370[_0x3189('0x45')]=_[_0x3189('0x48')](_0x55e370['where'],{'$or':_[_0x3189('0x33')](_0x55e370[_0x3189('0x3d')],function(_0x12d175){var _0x3a5a26={};_0x3a5a26[_0x12d175]={'$like':'%'+_0xf18d61['query'][_0x3189('0x46')]+'%'};return _0x3a5a26;})});}_0x55e370=_[_0x3189('0x48')]({},_0x55e370,_0xf18d61['options']);return _0x5c6c44[_0x3189('0x61')](_0x55e370);}})['then'](function(_0x1ae7bb){if(_0x1ae7bb){_0x4b5ce7=_0x1ae7bb[_0x3189('0x40')];if(!_0xf18d61[_0x3189('0x3a')][_0x3189('0x41')](_0x3189('0x42'))){_0x55e370[_0x3189('0x22')]=qs[_0x3189('0x22')](_0xf18d61[_0x3189('0x3a')][_0x3189('0x22')]);_0x55e370['offset']=qs[_0x3189('0x24')](_0xf18d61[_0x3189('0x3a')][_0x3189('0x24')]);}return _0x5c6c44[_0x3189('0x61')](_0x55e370);}})[_0x3189('0x2a')](function(_0x145b16){if(_0x145b16){return _0x145b16?{'count':_0x4b5ce7,'rows':_0x145b16}:null;}})[_0x3189('0x2a')](respondWithResult(_0x3b30c3,null))[_0x3189('0x4d')](handleError(_0x3b30c3,null));};exports[_0x3189('0x62')]=function(_0x1dae17,_0x5154ca,_0x420d27){if(_0x1dae17[_0x3189('0x53')]['id']){delete _0x1dae17[_0x3189('0x53')]['id'];}return db['Trigger'][_0x3189('0x51')]({'where':{'id':_0x1dae17[_0x3189('0x4f')]['id']}})[_0x3189('0x2a')](handleEntityNotFound(_0x5154ca,null))['then'](function(_0x4539bf){if(_0x4539bf){_0x1dae17[_0x3189('0x53')][_0x3189('0x63')]=_0x4539bf['id'];return db[_0x3189('0x64')][_0x3189('0x52')](_0x1dae17['body']);}})[_0x3189('0x2a')](respondWithResult(_0x5154ca,null))['catch'](handleError(_0x5154ca,null));};exports[_0x3189('0x65')]=function(_0x204418,_0x364337,_0x3c206f){var _0x29f9df={};var _0x33b6fe={};var _0x3e5c8c;var _0x169e78;return db[_0x3189('0x34')][_0x3189('0x5f')]({'where':{'id':_0x204418[_0x3189('0x4f')]['id']}})[_0x3189('0x2a')](handleEntityNotFound(_0x364337,null))[_0x3189('0x2a')](function(_0x305a62){if(_0x305a62){_0x3e5c8c=_0x305a62;_0x33b6fe[_0x3189('0x39')]=_['keys'](db[_0x3189('0x64')][_0x3189('0x35')]);_0x33b6fe[_0x3189('0x3a')]=_[_0x3189('0x3b')](_0x204418[_0x3189('0x3a')]);_0x33b6fe[_0x3189('0x3c')]=_['intersection'](_0x33b6fe[_0x3189('0x39')],_0x33b6fe[_0x3189('0x3a')]);_0x29f9df[_0x3189('0x3d')]=_['intersection'](_0x33b6fe[_0x3189('0x39')],qs[_0x3189('0x3f')](_0x204418['query'][_0x3189('0x3f')]));_0x29f9df[_0x3189('0x3d')]=_0x29f9df[_0x3189('0x3d')][_0x3189('0x40')]?_0x29f9df[_0x3189('0x3d')]:_0x33b6fe['model'];_0x29f9df['order']=qs[_0x3189('0x44')](_0x204418[_0x3189('0x3a')][_0x3189('0x44')]);_0x29f9df['where']=qs[_0x3189('0x3c')](_[_0x3189('0x60')](_0x204418['query'],_0x33b6fe[_0x3189('0x3c')]));if(_0x204418[_0x3189('0x3a')][_0x3189('0x46')]){_0x29f9df[_0x3189('0x45')]=_[_0x3189('0x48')](_0x29f9df['where'],{'$or':_[_0x3189('0x33')](_0x29f9df['attributes'],function(_0x3461bd){var _0x2c5100={};_0x2c5100[_0x3461bd]={'$like':'%'+_0x204418[_0x3189('0x3a')][_0x3189('0x46')]+'%'};return _0x2c5100;})});}_0x29f9df=_[_0x3189('0x48')]({},_0x29f9df,_0x204418[_0x3189('0x49')]);return _0x3e5c8c[_0x3189('0x65')](_0x29f9df);}})[_0x3189('0x2a')](function(_0x45a9b8){if(_0x45a9b8){_0x169e78=_0x45a9b8[_0x3189('0x40')];if(!_0x204418[_0x3189('0x3a')][_0x3189('0x41')](_0x3189('0x42'))){_0x29f9df[_0x3189('0x22')]=qs[_0x3189('0x22')](_0x204418[_0x3189('0x3a')][_0x3189('0x22')]);_0x29f9df['offset']=qs[_0x3189('0x24')](_0x204418['query'][_0x3189('0x24')]);}return _0x3e5c8c[_0x3189('0x65')](_0x29f9df);}})['then'](function(_0x5efd60){if(_0x5efd60){return _0x5efd60?{'count':_0x169e78,'rows':_0x5efd60}:null;}})['then'](respondWithResult(_0x364337,null))[_0x3189('0x4d')](handleError(_0x364337,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f395a34..4aafebf 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 _0xca8d=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment'];(function(_0x43ac28,_0x54d97e){var _0x3aa781=function(_0x49ab63){while(--_0x49ab63){_0x43ac28['push'](_0x43ac28['shift']());}};_0x3aa781(++_0x54d97e);}(_0xca8d,0x172));var _0xdca8=function(_0x399fb4,_0x3b9673){_0x399fb4=_0x399fb4-0x0;var _0x599673=_0xca8d[_0x399fb4];return _0x599673;};'use strict';var _=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var logger=require(_0xdca8('0x2'))(_0xdca8('0x3'));var moment=require(_0xdca8('0x4'));var BPromise=require(_0xdca8('0x5'));var rp=require(_0xdca8('0x6'));var fs=require('fs');var path=require(_0xdca8('0x7'));var rimraf=require(_0xdca8('0x8'));var config=require(_0xdca8('0x9'));var attributes=require(_0xdca8('0xa'));module[_0xdca8('0xb')]=function(_0x4d6383,_0x3366d5){return _0x4d6383[_0xdca8('0xc')](_0xdca8('0xd'),attributes,{'tableName':_0xdca8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94dc=['tools_triggers','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x42ef8f,_0x218273){var _0x1af3ab=function(_0x3ecdd8){while(--_0x3ecdd8){_0x42ef8f['push'](_0x42ef8f['shift']());}};_0x1af3ab(++_0x218273);}(_0x94dc,0xb1));var _0xc94d=function(_0x31339c,_0x275e3d){_0x31339c=_0x31339c-0x0;var _0x47d322=_0x94dc[_0x31339c];return _0x47d322;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var logger=require(_0xc94d('0x1'))('api');var moment=require(_0xc94d('0x2'));var BPromise=require(_0xc94d('0x3'));var rp=require(_0xc94d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc94d('0x5'));var config=require(_0xc94d('0x6'));var attributes=require(_0xc94d('0x7'));module[_0xc94d('0x8')]=function(_0x3c0601,_0x344188){return _0x3c0601[_0xc94d('0x9')]('Trigger',attributes,{'tableName':_0xc94d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 33a95b5..b01373c 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 _0x5c4d=['include','map','model','GetTrigger','stringify','ShowTrigger','Trigger','find','debug','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes'];(function(_0x1a3a6b,_0x505e36){var _0x44a61c=function(_0x57e0ff){while(--_0x57e0ff){_0x1a3a6b['push'](_0x1a3a6b['shift']());}};_0x44a61c(++_0x505e36);}(_0x5c4d,0x174));var _0xd5c4=function(_0x4ea1a0,_0x69e7ce){_0x4ea1a0=_0x4ea1a0-0x0;var _0x2e12bb=_0x5c4d[_0x4ea1a0];return _0x2e12bb;};'use strict';var _=require(_0xd5c4('0x0'));var util=require(_0xd5c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd5c4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5c4('0x3'))['db'];var utils=require(_0xd5c4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5c4('0x5'));var jayson=require(_0xd5c4('0x6'));var client=jayson[_0xd5c4('0x7')][_0xd5c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fd85d,_0x3ee9b0,_0x3d37fa){return new BPromise(function(_0x3137bc,_0x106436){return client['request'](_0x3fd85d,_0x3d37fa)[_0xd5c4('0x9')](function(_0x56c0e5){logger[_0xd5c4('0xa')](_0xd5c4('0xb'),_0x3ee9b0,_0xd5c4('0xc'));logger['debug'](_0xd5c4('0xd'),_0x3ee9b0,'request\x20sent',JSON['stringify'](_0x56c0e5));if(_0x56c0e5[_0xd5c4('0xe')]){if(_0x56c0e5[_0xd5c4('0xe')][_0xd5c4('0xf')]===0x1f4){logger[_0xd5c4('0xe')](_0xd5c4('0xb'),_0x3ee9b0,_0x56c0e5[_0xd5c4('0xe')][_0xd5c4('0x10')]);return _0x106436(_0x56c0e5[_0xd5c4('0xe')][_0xd5c4('0x10')]);}logger[_0xd5c4('0xe')](_0xd5c4('0xb'),_0x3ee9b0,_0x56c0e5[_0xd5c4('0xe')]['message']);return _0x3137bc(_0x56c0e5['error']['message']);}else{logger['info'](_0xd5c4('0xb'),_0x3ee9b0,_0xd5c4('0xc'));_0x3137bc(_0x56c0e5[_0xd5c4('0x11')][_0xd5c4('0x10')]);}})[_0xd5c4('0x12')](function(_0x5c36db){logger['error'](_0xd5c4('0xb'),_0x3ee9b0,_0x5c36db);_0x106436(_0x5c36db);});});}exports['GetTrigger']=function(_0x31b4ed){var _0x24ef1=this;return new Promise(function(_0x22222f,_0x2e69f2){return db['Trigger'][_0xd5c4('0x13')]({'raw':_0x31b4ed[_0xd5c4('0x14')]?_0x31b4ed[_0xd5c4('0x14')][_0xd5c4('0x15')]===undefined?!![]:![]:!![],'where':_0x31b4ed[_0xd5c4('0x14')]?_0x31b4ed[_0xd5c4('0x14')][_0xd5c4('0x16')]||null:null,'attributes':_0x31b4ed[_0xd5c4('0x14')]?_0x31b4ed[_0xd5c4('0x14')][_0xd5c4('0x17')]||null:null,'limit':_0x31b4ed[_0xd5c4('0x14')]?_0x31b4ed[_0xd5c4('0x14')]['limit']||null:null,'include':_0x31b4ed['options']?_0x31b4ed[_0xd5c4('0x14')][_0xd5c4('0x18')]?_[_0xd5c4('0x19')](_0x31b4ed[_0xd5c4('0x14')][_0xd5c4('0x18')],function(_0x1fc6e4){return{'model':db[_0x1fc6e4['model']],'as':_0x1fc6e4['as'],'attributes':_0x1fc6e4[_0xd5c4('0x17')],'include':_0x1fc6e4['include']?_['map'](_0x1fc6e4['include'],function(_0x2867c7){return{'model':db[_0x2867c7[_0xd5c4('0x1a')]],'as':_0x2867c7['as'],'attributes':_0x2867c7['attributes'],'include':_0x2867c7[_0xd5c4('0x18')]?_['map'](_0x2867c7['include'],function(_0x192c96){return{'model':db[_0x192c96['model']],'as':_0x192c96['as'],'attributes':_0x192c96[_0xd5c4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd5c4('0x9')](function(_0x1e63b2){logger[_0xd5c4('0xa')](_0xd5c4('0x1b'),_0x31b4ed);logger['debug'](_0xd5c4('0x1b'),_0x31b4ed,JSON[_0xd5c4('0x1c')](_0x1e63b2));_0x22222f(_0x1e63b2);})['catch'](function(_0x161300){logger[_0xd5c4('0xe')]('GetTrigger',_0x161300[_0xd5c4('0x10')],_0x31b4ed);_0x2e69f2(_0x24ef1[_0xd5c4('0xe')](0x1f4,_0x161300[_0xd5c4('0x10')]));});});};exports[_0xd5c4('0x1d')]=function(_0x59b3ff){var _0x4f3917=this;return new Promise(function(_0x327d33,_0x22b9e9){return db[_0xd5c4('0x1e')][_0xd5c4('0x1f')]({'raw':_0x59b3ff['options']?_0x59b3ff['options']['raw']===undefined?!![]:![]:!![],'where':_0x59b3ff[_0xd5c4('0x14')]?_0x59b3ff[_0xd5c4('0x14')]['where']||null:null,'attributes':_0x59b3ff[_0xd5c4('0x14')]?_0x59b3ff[_0xd5c4('0x14')][_0xd5c4('0x17')]||null:null,'include':_0x59b3ff[_0xd5c4('0x14')]?_0x59b3ff['options']['include']?_[_0xd5c4('0x19')](_0x59b3ff['options'][_0xd5c4('0x18')],function(_0x2ace9e){return{'model':db[_0x2ace9e[_0xd5c4('0x1a')]],'as':_0x2ace9e['as'],'attributes':_0x2ace9e['attributes'],'include':_0x2ace9e[_0xd5c4('0x18')]?_[_0xd5c4('0x19')](_0x2ace9e[_0xd5c4('0x18')],function(_0x5d84d1){return{'model':db[_0x5d84d1[_0xd5c4('0x1a')]],'as':_0x5d84d1['as'],'attributes':_0x5d84d1[_0xd5c4('0x17')],'include':_0x5d84d1[_0xd5c4('0x18')]?_[_0xd5c4('0x19')](_0x5d84d1[_0xd5c4('0x18')],function(_0x478fb7){return{'model':db[_0x478fb7[_0xd5c4('0x1a')]],'as':_0x478fb7['as'],'attributes':_0x478fb7[_0xd5c4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd5c4('0x9')](function(_0x4f3f04){logger[_0xd5c4('0xa')]('ShowTrigger',_0x59b3ff);logger[_0xd5c4('0x20')](_0xd5c4('0x1d'),_0x59b3ff,JSON[_0xd5c4('0x1c')](_0x4f3f04));_0x327d33(_0x4f3f04);})[_0xd5c4('0x12')](function(_0x28d9ea){logger[_0xd5c4('0xe')](_0xd5c4('0x1d'),_0x28d9ea[_0xd5c4('0x10')],_0x59b3ff);_0x22b9e9(_0x4f3917[_0xd5c4('0xe')](0x1f4,_0x28d9ea[_0xd5c4('0x10')]));});});}; \ No newline at end of file +var _0xed1c=['model','ShowTrigger','find','debug','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trigger,\x20%s,\x20%s','catch','GetTrigger','Trigger','options','raw','where','attributes','include','map'];(function(_0x1378e8,_0x1971fa){var _0x29aa13=function(_0x413dfc){while(--_0x413dfc){_0x1378e8['push'](_0x1378e8['shift']());}};_0x29aa13(++_0x1971fa);}(_0xed1c,0xe4));var _0xced1=function(_0x5386ed,_0xb40051){_0x5386ed=_0x5386ed-0x0;var _0x2d613a=_0xed1c[_0x5386ed];return _0x2d613a;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('Trigger,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('Trigger,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});}exports[_0xced1('0x14')]=function(_0x5a563a){var _0x56fc50=this;return new Promise(function(_0x2a92c8,_0x111fb0){return db[_0xced1('0x15')]['findAll']({'raw':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')][_0xced1('0x17')]===undefined?!![]:![]:!![],'where':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x5a563a[_0xced1('0x16')]?_0x5a563a['options'][_0xced1('0x19')]||null:null,'limit':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')]['limit']||null:null,'include':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')],function(_0x49c8b9){return{'model':db[_0x49c8b9[_0xced1('0x1c')]],'as':_0x49c8b9['as'],'attributes':_0x49c8b9[_0xced1('0x19')],'include':_0x49c8b9['include']?_['map'](_0x49c8b9[_0xced1('0x1a')],function(_0x258c9a){return{'model':db[_0x258c9a[_0xced1('0x1c')]],'as':_0x258c9a['as'],'attributes':_0x258c9a[_0xced1('0x19')],'include':_0x258c9a[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x258c9a['include'],function(_0x181f6e){return{'model':db[_0x181f6e[_0xced1('0x1c')]],'as':_0x181f6e['as'],'attributes':_0x181f6e[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x34dd2e){logger[_0xced1('0xb')](_0xced1('0x14'),_0x5a563a);logger['debug'](_0xced1('0x14'),_0x5a563a,JSON['stringify'](_0x34dd2e));_0x2a92c8(_0x34dd2e);})[_0xced1('0x13')](function(_0x2c2269){logger[_0xced1('0xf')](_0xced1('0x14'),_0x2c2269['message'],_0x5a563a);_0x111fb0(_0x56fc50['error'](0x1f4,_0x2c2269[_0xced1('0x11')]));});});};exports[_0xced1('0x1d')]=function(_0x2bc785){var _0x4ea07e=this;return new Promise(function(_0x573146,_0x543c47){return db[_0xced1('0x15')][_0xced1('0x1e')]({'raw':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x19')]||null:null,'include':_0x2bc785[_0xced1('0x16')]?_0x2bc785['options']['include']?_[_0xced1('0x1b')](_0x2bc785[_0xced1('0x16')][_0xced1('0x1a')],function(_0x7ebeb3){return{'model':db[_0x7ebeb3[_0xced1('0x1c')]],'as':_0x7ebeb3['as'],'attributes':_0x7ebeb3[_0xced1('0x19')],'include':_0x7ebeb3['include']?_['map'](_0x7ebeb3['include'],function(_0x4d305c){return{'model':db[_0x4d305c[_0xced1('0x1c')]],'as':_0x4d305c['as'],'attributes':_0x4d305c[_0xced1('0x19')],'include':_0x4d305c[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x4d305c[_0xced1('0x1a')],function(_0x1c36fa){return{'model':db[_0x1c36fa[_0xced1('0x1c')]],'as':_0x1c36fa['as'],'attributes':_0x1c36fa[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x3dfd2f){logger[_0xced1('0xb')](_0xced1('0x1d'),_0x2bc785);logger[_0xced1('0x1f')]('ShowTrigger',_0x2bc785,JSON[_0xced1('0xe')](_0x3dfd2f));_0x573146(_0x3dfd2f);})[_0xced1('0x13')](function(_0x1116de){logger[_0xced1('0xf')](_0xced1('0x1d'),_0x1116de[_0xced1('0x11')],_0x2bc785);_0x543c47(_0x4ea07e['error'](0x1f4,_0x1116de[_0xced1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 974e00f..6dd740a 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 _0xc04f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','clone','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc04f,0x8d));var _0xfc04=function(_0x288536,_0x369b51){_0x288536=_0x288536-0x0;var _0x525e94=_0xc04f[_0x288536];return _0x525e94;};'use strict';var multer=require('multer');var util=require(_0xfc04('0x0'));var path=require(_0xfc04('0x1'));var timeout=require(_0xfc04('0x2'));var express=require('express');var router=express[_0xfc04('0x3')]();var fs_extra=require(_0xfc04('0x4'));var auth=require(_0xfc04('0x5'));var interaction=require(_0xfc04('0x6'));var config=require(_0xfc04('0x7'));var controller=require('./trunk.controller');router[_0xfc04('0x8')]('/',auth[_0xfc04('0x9')](),controller[_0xfc04('0xa')]);router[_0xfc04('0x8')](_0xfc04('0xb'),auth[_0xfc04('0x9')](),controller[_0xfc04('0xc')]);router[_0xfc04('0xd')]('/:id/clone',auth[_0xfc04('0x9')](),controller[_0xfc04('0xe')]);router[_0xfc04('0xd')]('/',auth['isAuthenticated'](),controller[_0xfc04('0xf')]);router[_0xfc04('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfc04('0x11')]);router[_0xfc04('0x12')](_0xfc04('0xb'),auth[_0xfc04('0x9')](),controller[_0xfc04('0x13')]);module[_0xfc04('0x14')]=router; \ No newline at end of file +var _0x82d0=['/:id','show','/:id/clone','clone','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x360380,_0x3674b){var _0x1f417a=function(_0x45ea57){while(--_0x45ea57){_0x360380['push'](_0x360380['shift']());}};_0x1f417a(++_0x3674b);}(_0x82d0,0x1a7));var _0x082d=function(_0xd70515,_0x50cfb3){_0xd70515=_0xd70515-0x0;var _0x1e9a3a=_0x82d0[_0xd70515];return _0x1e9a3a;};'use strict';var multer=require('multer');var util=require(_0x082d('0x0'));var path=require('path');var timeout=require(_0x082d('0x1'));var express=require(_0x082d('0x2'));var router=express['Router']();var fs_extra=require(_0x082d('0x3'));var auth=require(_0x082d('0x4'));var interaction=require(_0x082d('0x5'));var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0x082d('0x6')](),controller[_0x082d('0x7')]);router[_0x082d('0x8')](_0x082d('0x9'),auth['isAuthenticated'](),controller[_0x082d('0xa')]);router['post'](_0x082d('0xb'),auth[_0x082d('0x6')](),controller[_0x082d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x082d('0xd')]);router[_0x082d('0xe')](_0x082d('0x9'),auth[_0x082d('0x6')](),controller['update']);router[_0x082d('0xf')](_0x082d('0x9'),auth[_0x082d('0x6')](),controller[_0x082d('0x10')]);module[_0x082d('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 78a9ba8..70b13ca 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 _0xf9cd=['join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','always','refuse','originate','INTEGER','uas','pai','certificate','passive','actpass','dynamic','BOOLEAN','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0xf9cd,0x142));var _0xdf9c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf9cd[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdf9c('0x0')],'allowNull':![],'unique':_0xdf9c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x3'),_0xdf9c('0x4'),'peer'),'allowNull':![],'defaultValue':_0xdf9c('0x3')},'context':{'type':Sequelize[_0xdf9c('0x0')],'allowNull':![],'defaultValue':_0xdf9c('0x5')},'callingpres':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x6'),_0xdf9c('0x7'),'ALLOWED_FAILED_SCREEN',_0xdf9c('0x8'),_0xdf9c('0x9'),_0xdf9c('0xa'),_0xdf9c('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0xdf9c('0x0')]},'permit':{'type':Sequelize[_0xdf9c('0x0')]},'secret':{'type':Sequelize[_0xdf9c('0x0')]},'md5secret':{'type':Sequelize[_0xdf9c('0x0')]},'remotesecret':{'type':Sequelize[_0xdf9c('0x0')]},'transport':{'type':Sequelize[_0xdf9c('0x0')],'defaultValue':_0xdf9c('0xc'),'set':function(_0xcf6ce2){this[_0xdf9c('0xd')]('transport',_0xcf6ce2?_0xcf6ce2[_0xdf9c('0xe')](','):null);},'get':function(){return this[_0xdf9c('0xf')](_0xdf9c('0x10'))?this['getDataValue'](_0xdf9c('0x10'))[_0xdf9c('0x11')](','):null;},'comment':_0xdf9c('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0xdf9c('0x13'),_0xdf9c('0x14'),_0xdf9c('0x15'),_0xdf9c('0x16'),_0xdf9c('0x17')),'defaultValue':_0xdf9c('0x13')},'directmedia':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no',_0xdf9c('0x19'),_0xdf9c('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdf9c('0x0')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xdf9c('0x1b'),'set':function(_0x2ad9f5){this[_0xdf9c('0xd')](_0xdf9c('0x1c'),_0x2ad9f5?_0x2ad9f5[_0xdf9c('0xe')](','):null);},'get':function(){return this[_0xdf9c('0xf')]('nat')?this[_0xdf9c('0xf')](_0xdf9c('0x1c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xdf9c('0x0')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xdf9c('0x0')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdf9c('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdf9c('0x0')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xdf9c('0x0')],'defaultValue':_0xdf9c('0x1d')},'allow':{'type':Sequelize[_0xdf9c('0x0')],'allowNull':![],'defaultValue':_0xdf9c('0x1e'),'set':function(_0x15dd93){this['setDataValue']('allow',_0x15dd93?_0x15dd93[_0xdf9c('0xe')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xdf9c('0xf')](_0xdf9c('0x1f'))?this[_0xdf9c('0xf')]('allow')['split'](';'):null;},'comment':_0xdf9c('0x20')},'autoframing':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'insecure':{'type':Sequelize[_0xdf9c('0x0')],'defaultValue':_0xdf9c('0x21'),'set':function(_0x11717f){this[_0xdf9c('0xd')]('insecure',_0x11717f?_0x11717f['join'](','):null);},'get':function(){return this[_0xdf9c('0xf')](_0xdf9c('0x22'))?this['getDataValue'](_0xdf9c('0x22'))[_0xdf9c('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdf9c('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdf9c('0x2')]('yes','no',_0xdf9c('0x23'))},'promiscredir':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xdf9c('0x0')]},'callerid':{'type':Sequelize[_0xdf9c('0x0')],'defaultValue':_0xdf9c('0x24')},'amaflags':{'type':Sequelize[_0xdf9c('0x0')]},'callcounter':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no'),'defaultValue':_0xdf9c('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xdf9c('0x0')]},'template':{'type':Sequelize[_0xdf9c('0x0')]},'videosupport':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no',_0xdf9c('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xdf9c('0x0')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xdf9c('0x26'),_0xdf9c('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0xdf9c('0x2')]('uac','uas'),'defaultValue':_0xdf9c('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xdf9c('0x0')]},'fromdomain':{'type':Sequelize[_0xdf9c('0x0')]},'fromuser':{'type':Sequelize[_0xdf9c('0x0')]},'port':{'type':Sequelize[_0xdf9c('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xdf9c('0x18')},'keepalive':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xdf9c('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0xdf9c('0x0')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xdf9c('0x0')]},'unsolicited_mailbox':{'type':Sequelize[_0xdf9c('0x0')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'force_avp':{'type':Sequelize[_0xdf9c('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xdf9c('0x2')](_0xdf9c('0x18'),'no','fingerprint',_0xdf9c('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xdf9c('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xdf9c('0x0')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xdf9c('0x0')]},'dtlscapath':{'type':Sequelize[_0xdf9c('0x0')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xdf9c('0x2c'),_0xdf9c('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdf9c('0x0')]},'usereqphone':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdf9c('0x0')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0xdf9c('0x0')]},'mohinterpret':{'type':Sequelize[_0xdf9c('0x0')]},'mohsuggest':{'type':Sequelize[_0xdf9c('0x0')]},'parkinglot':{'type':Sequelize[_0xdf9c('0x0')]},'description':{'type':Sequelize[_0xdf9c('0x0')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xdf9c('0x2e')},'canreinvite':{'type':Sequelize['ENUM'](_0xdf9c('0x18'),'no','nonat',_0xdf9c('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xdf9c('0x0')]},'otherFields':{'type':Sequelize[_0xdf9c('0x0')]},'active':{'type':Sequelize[_0xdf9c('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x0c94=['refuse','originate','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','exports','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','STRING','setDataValue','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','rfc2833','nonat','outgoing','force_rport,comedia','nat','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x0c94,0x6a));var _0x40c9=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x0c94[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');module[_0x40c9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x40c9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x3'),_0x40c9('0x4'),_0x40c9('0x5')),'allowNull':![],'defaultValue':_0x40c9('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x40c9('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x40c9('0x7'),'ALLOWED_PASSED_SCREEN',_0x40c9('0x8'),_0x40c9('0x9'),'PROHIB_NOT_SCREENED',_0x40c9('0xa'),_0x40c9('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x40c9('0xc')]},'md5secret':{'type':Sequelize[_0x40c9('0xc')]},'remotesecret':{'type':Sequelize[_0x40c9('0xc')]},'transport':{'type':Sequelize[_0x40c9('0xc')],'defaultValue':'udp','set':function(_0x5b9cb0){this[_0x40c9('0xd')](_0x40c9('0xe'),_0x5b9cb0?_0x5b9cb0[_0x40c9('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x40c9('0xe'))?this['getDataValue'](_0x40c9('0xe'))[_0x40c9('0x10')](','):null;},'comment':_0x40c9('0x11')},'dtmfmode':{'type':Sequelize[_0x40c9('0x2')]('rfc2833',_0x40c9('0x12'),'shortinfo','inband','auto'),'defaultValue':_0x40c9('0x13')},'directmedia':{'type':Sequelize[_0x40c9('0x2')]('yes','no',_0x40c9('0x14'),'update',_0x40c9('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x40c9('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x40c9('0xc')]},'nat':{'type':Sequelize[_0x40c9('0xc')],'defaultValue':_0x40c9('0x16'),'set':function(_0x2355be){this[_0x40c9('0xd')](_0x40c9('0x17'),_0x2355be?_0x2355be[_0x40c9('0xf')](','):null);},'get':function(){return this[_0x40c9('0x18')](_0x40c9('0x17'))?this[_0x40c9('0x18')](_0x40c9('0x17'))[_0x40c9('0x10')](','):null;},'comment':_0x40c9('0x19')},'callgroup':{'type':Sequelize[_0x40c9('0xc')]},'namedcallgroup':{'type':Sequelize[_0x40c9('0xc')]},'pickupgroup':{'type':Sequelize[_0x40c9('0xc')]},'namedpickupgroup':{'type':Sequelize[_0x40c9('0xc')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x40c9('0xc')],'defaultValue':_0x40c9('0x1a')},'allow':{'type':Sequelize[_0x40c9('0xc')],'allowNull':![],'defaultValue':_0x40c9('0x1b'),'set':function(_0x2ccfba){this[_0x40c9('0xd')]('allow',_0x2ccfba?_0x2ccfba['join'](';'):_0x40c9('0x1b'));},'get':function(){return this[_0x40c9('0x18')]('allow')?this[_0x40c9('0x18')]('allow')[_0x40c9('0x10')](';'):null;},'comment':_0x40c9('0x1c')},'autoframing':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no')},'insecure':{'type':Sequelize[_0x40c9('0xc')],'defaultValue':_0x40c9('0x1e'),'set':function(_0x501776){this['setDataValue']('insecure',_0x501776?_0x501776[_0x40c9('0xf')](','):null);},'get':function(){return this[_0x40c9('0x18')](_0x40c9('0x1f'))?this[_0x40c9('0x18')]('insecure')['split'](','):null;},'comment':_0x40c9('0x20')},'trustrpid':{'type':Sequelize[_0x40c9('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x40c9('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no',_0x40c9('0x21'))},'promiscredir':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no')},'useclientcode':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no')},'accountcode':{'type':Sequelize[_0x40c9('0x22')](0xb)},'setvar':{'type':Sequelize[_0x40c9('0xc')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x40c9('0x23')},'amaflags':{'type':Sequelize[_0x40c9('0xc')]},'callcounter':{'type':Sequelize[_0x40c9('0x2')]('yes','no'),'defaultValue':_0x40c9('0x1d')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no')},'allowsubscribe':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no')},'subscribecontext':{'type':Sequelize[_0x40c9('0xc')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no',_0x40c9('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x40c9('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x25'),_0x40c9('0x26'),_0x40c9('0x27'))},'session_expires':{'type':Sequelize[_0x40c9('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x40c9('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x40c9('0x2')]('uac',_0x40c9('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x40c9('0xc')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x40c9('0xc')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x40c9('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no'),'defaultValue':_0x40c9('0x1d')},'keepalive':{'type':Sequelize[_0x40c9('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x40c9('0xc')]},'defaultuser':{'type':Sequelize[_0x40c9('0xc')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x40c9('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x40c9('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no',_0x40c9('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x40c9('0xc')]},'timert1':{'type':Sequelize[_0x40c9('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x40c9('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x40c9('0xc')]},'contactdeny':{'type':Sequelize[_0x40c9('0xc')]},'contactacl':{'type':Sequelize[_0x40c9('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0x40c9('0xc')]},'use_q850_reason':{'type':Sequelize[_0x40c9('0xc')]},'maxforwards':{'type':Sequelize[_0x40c9('0x22')](0xb)},'encryption':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x40c9('0x1d'),'no')},'dtlsenable':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no')},'dtlsverify':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no',_0x40c9('0x2a'),_0x40c9('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x40c9('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x40c9('0xc')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x40c9('0xc')]},'dtlscafile':{'type':Sequelize[_0x40c9('0xc')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x2c'),_0x40c9('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x40c9('0xc')]},'recordofffeature':{'type':Sequelize[_0x40c9('0xc')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x40c9('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0x40c9('0xc')]},'mohinterpret':{'type':Sequelize[_0x40c9('0xc')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x40c9('0xc')]},'description':{'type':Sequelize[_0x40c9('0xc')]},'host':{'type':Sequelize[_0x40c9('0xc')],'defaultValue':_0x40c9('0x2e')},'canreinvite':{'type':Sequelize[_0x40c9('0x2')](_0x40c9('0x1d'),'no',_0x40c9('0x14'),'update',_0x40c9('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x40c9('0xc')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x40c9('0xc')],'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 5943724..4e5935e 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 _0x34e8=['limit','count','set','Content-Range','json','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','key','query','keys','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','clone','rawAttributes','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','Reload','chan_sip.so','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','offset','undefined'];(function(_0x4d9d88,_0x7088fd){var _0x4dba70=function(_0x9316e5){while(--_0x9316e5){_0x4d9d88['push'](_0x4d9d88['shift']());}};_0x4dba70(++_0x7088fd);}(_0x34e8,0x12c));var _0x834e=function(_0x47627a,_0x508034){_0x47627a=_0x47627a-0x0;var _0x331932=_0x34e8[_0x47627a];return _0x331932;};'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'];var jayson=require(_0x834e('0x1c'));var client=jayson[_0x834e('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23848e,_0x2d95f2,_0x28e659,_0x21cc0a){return new BPromise(function(_0x50e860,_0x43156c){var _0x302cbd=_0x21cc0a||client;return _0x302cbd['request'](_0x23848e,_0x28e659)[_0x834e('0x1e')](function(_0x4a9cdc){logger[_0x834e('0x1f')](_0x834e('0x20'),_0x2d95f2,'request\x20sent');logger[_0x834e('0x21')](_0x834e('0x22'),_0x2d95f2,_0x834e('0x23'),JSON['stringify'](_0x4a9cdc));if(_0x4a9cdc[_0x834e('0x24')]){if(_0x4a9cdc[_0x834e('0x24')][_0x834e('0x25')]===0x1f4){logger[_0x834e('0x24')](_0x834e('0x20'),_0x2d95f2,_0x4a9cdc[_0x834e('0x24')][_0x834e('0x26')]);return _0x43156c(_0x4a9cdc['error'][_0x834e('0x26')]);}logger[_0x834e('0x24')](_0x834e('0x20'),_0x2d95f2,_0x4a9cdc[_0x834e('0x24')]['message']);return _0x50e860(_0x4a9cdc[_0x834e('0x24')][_0x834e('0x26')]);}else{logger['info'](_0x834e('0x20'),_0x2d95f2,_0x834e('0x23'));_0x50e860(_0x4a9cdc[_0x834e('0x27')]['message']);}})['catch'](function(_0x231619){logger[_0x834e('0x24')]('Trunk,\x20%s,\x20%s',_0x2d95f2,_0x231619);_0x43156c(_0x231619);});});}function respondWithStatusCode(_0x25ee1d,_0x1dc1e0){_0x1dc1e0=_0x1dc1e0||0xcc;return function(_0x58f4fd){if(_0x58f4fd){return _0x25ee1d[_0x834e('0x28')](_0x1dc1e0);}return _0x25ee1d[_0x834e('0x29')](_0x1dc1e0)[_0x834e('0x2a')]();};}function respondWithResult(_0x561cd2,_0x24fcf7){_0x24fcf7=_0x24fcf7||0xc8;return function(_0x3e310f){if(_0x3e310f){return _0x561cd2['status'](_0x24fcf7)['json'](_0x3e310f);}};}function respondWithFilteredResult(_0x1e713a,_0x508a1d){return function(_0x2826ec){if(_0x2826ec){var _0x3f1b0b=typeof _0x508a1d[_0x834e('0x2b')]===_0x834e('0x2c')&&typeof _0x508a1d[_0x834e('0x2d')]===_0x834e('0x2c');var _0x491919=_0x2826ec['count'];var _0x4dc64a=_0x3f1b0b?0x0:_0x508a1d['offset'];var _0x2c7a8d=_0x3f1b0b?_0x2826ec[_0x834e('0x2e')]:_0x508a1d[_0x834e('0x2b')]+_0x508a1d['limit'];var _0xb5bc06;if(_0x2c7a8d>=_0x491919){_0x2c7a8d=_0x491919;_0xb5bc06=0xc8;}else{_0xb5bc06=0xce;}_0x1e713a[_0x834e('0x29')](_0xb5bc06);return _0x1e713a[_0x834e('0x2f')](_0x834e('0x30'),_0x4dc64a+'-'+_0x2c7a8d+'/'+_0x491919)[_0x834e('0x31')](_0x2826ec);}return null;};}function patchUpdates(_0x390119){return function(_0x3d149d){try{jsonpatch[_0x834e('0x32')](_0x3d149d,_0x390119,!![]);}catch(_0x278db3){return BPromise['reject'](_0x278db3);}return _0x3d149d[_0x834e('0x33')]();};}function saveUpdates(_0x5cad11,_0x2c75c2){return function(_0x3787b0){if(_0x3787b0){return _0x3787b0[_0x834e('0x34')](_0x5cad11)[_0x834e('0x1e')](function(_0x444366){return _0x444366;});}return null;};}function removeEntity(_0x4689c2,_0x4696a1){return function(_0x38cd29){if(_0x38cd29){return _0x38cd29[_0x834e('0x35')]()[_0x834e('0x1e')](function(){var _0x5bd232=_0x38cd29[_0x834e('0x36')]({'plain':!![]});var _0x2f408a=_0x834e('0x37');return db[_0x834e('0x38')]['destroy']({'where':{'type':_0x2f408a,'resourceId':_0x5bd232['id']}})[_0x834e('0x1e')](function(){return _0x38cd29;});})[_0x834e('0x1e')](function(){_0x4689c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59385a,_0x3e58fa){return function(_0x41bf4d){if(!_0x41bf4d){_0x59385a[_0x834e('0x28')](0x194);}return _0x41bf4d;};}function handleError(_0x34fefb,_0x339e28){_0x339e28=_0x339e28||0x1f4;return function(_0x1b76dd){logger['error'](_0x1b76dd[_0x834e('0x39')]);if(_0x1b76dd['name']){delete _0x1b76dd[_0x834e('0x3a')];}_0x34fefb[_0x834e('0x29')](_0x339e28)['send'](_0x1b76dd);};}exports[_0x834e('0x3b')]=function(_0x2f56c7,_0x491c28){var _0x481f70={},_0x388711={},_0xd0d43a={'count':0x0,'rows':[]};var _0x2e9383=_[_0x834e('0x3c')](db[_0x834e('0x3d')]['rawAttributes'],function(_0x1c5ed6){return{'name':_0x1c5ed6['fieldName'],'type':_0x1c5ed6['type'][_0x834e('0x3e')]};});_0x388711['model']=_[_0x834e('0x3c')](_0x2e9383,_0x834e('0x3a'));_0x388711[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x2f56c7[_0x834e('0x3f')]);_0x388711['filters']=_[_0x834e('0x41')](_0x388711[_0x834e('0x42')],_0x388711[_0x834e('0x3f')]);_0x481f70['attributes']=_[_0x834e('0x41')](_0x388711[_0x834e('0x42')],qs['fields'](_0x2f56c7[_0x834e('0x3f')]['fields']));_0x481f70[_0x834e('0x43')]=_0x481f70[_0x834e('0x43')]['length']?_0x481f70['attributes']:_0x388711[_0x834e('0x42')];if(!_0x2f56c7[_0x834e('0x3f')][_0x834e('0x44')](_0x834e('0x45'))){_0x481f70[_0x834e('0x2d')]=qs[_0x834e('0x2d')](_0x2f56c7[_0x834e('0x3f')]['limit']);_0x481f70[_0x834e('0x2b')]=qs['offset'](_0x2f56c7[_0x834e('0x3f')]['offset']);}_0x481f70[_0x834e('0x46')]=qs['sort'](_0x2f56c7[_0x834e('0x3f')][_0x834e('0x47')]);_0x481f70['where']=qs[_0x834e('0x48')](_[_0x834e('0x49')](_0x2f56c7[_0x834e('0x3f')],_0x388711[_0x834e('0x48')]),_0x2e9383);if(_0x2f56c7[_0x834e('0x3f')][_0x834e('0x4a')]){_0x481f70[_0x834e('0x4b')]=_[_0x834e('0x4c')](_0x481f70[_0x834e('0x4b')],{'$or':_[_0x834e('0x3c')](_0x2e9383,function(_0x5f3943){if(_0x5f3943[_0x834e('0x4d')]!==_0x834e('0x4e')){var _0x47a8a9={};_0x47a8a9[_0x5f3943[_0x834e('0x3a')]]={'$like':'%'+_0x2f56c7[_0x834e('0x3f')][_0x834e('0x4a')]+'%'};return _0x47a8a9;}})});}_0x481f70=_[_0x834e('0x4c')]({},_0x481f70,_0x2f56c7[_0x834e('0x4f')]);var _0x4264b8={'where':_0x481f70['where']};return db['Trunk'][_0x834e('0x2e')](_0x4264b8)[_0x834e('0x1e')](function(_0x30568e){_0xd0d43a[_0x834e('0x2e')]=_0x30568e;if(_0x2f56c7[_0x834e('0x3f')][_0x834e('0x50')]){_0x481f70[_0x834e('0x51')]=[{'all':!![]}];}return db[_0x834e('0x3d')][_0x834e('0x52')](_0x481f70);})[_0x834e('0x1e')](function(_0xf02f0d){_0xd0d43a[_0x834e('0x53')]=_0xf02f0d;return _0xd0d43a;})[_0x834e('0x1e')](respondWithFilteredResult(_0x491c28,_0x481f70))[_0x834e('0x54')](handleError(_0x491c28,null));};exports[_0x834e('0x55')]=function(_0x1a3855,_0x3df078){var _0x32b8f7={'raw':![],'where':{'id':_0x1a3855[_0x834e('0x56')]['id']}},_0x420841={};_0x420841['model']=_[_0x834e('0x40')](db[_0x834e('0x3d')]['rawAttributes']);_0x420841[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x1a3855['query']);_0x420841[_0x834e('0x48')]=_[_0x834e('0x41')](_0x420841[_0x834e('0x42')],_0x420841[_0x834e('0x3f')]);_0x32b8f7[_0x834e('0x43')]=_[_0x834e('0x41')](_0x420841[_0x834e('0x42')],qs['fields'](_0x1a3855[_0x834e('0x3f')][_0x834e('0x57')]));_0x32b8f7[_0x834e('0x43')]=_0x32b8f7[_0x834e('0x43')][_0x834e('0x58')]?_0x32b8f7[_0x834e('0x43')]:_0x420841[_0x834e('0x42')];if(_0x1a3855[_0x834e('0x3f')]['includeAll']){_0x32b8f7[_0x834e('0x51')]=[{'all':!![]}];}_0x32b8f7=_['merge']({},_0x32b8f7,_0x1a3855[_0x834e('0x4f')]);return db['Trunk'][_0x834e('0x59')](_0x32b8f7)['then'](handleEntityNotFound(_0x3df078,null))['then'](respondWithResult(_0x3df078,null))[_0x834e('0x54')](handleError(_0x3df078,null));};exports[_0x834e('0x5a')]=function(_0x5291ae,_0x5be43d){var _0x2c8155={'where':{'id':_0x5291ae[_0x834e('0x56')]['id']}},_0x2452b4={};_0x2452b4[_0x834e('0x42')]=_[_0x834e('0x40')](db[_0x834e('0x3d')][_0x834e('0x5b')]);_0x2c8155[_0x834e('0x43')]=_['intersection'](_0x2452b4[_0x834e('0x42')],qs[_0x834e('0x57')](_0x5291ae['query'][_0x834e('0x57')]));_0x2c8155['attributes']=_0x2c8155[_0x834e('0x43')][_0x834e('0x58')]?_0x2c8155['attributes']:_0x2452b4[_0x834e('0x42')];if(_0x5291ae[_0x834e('0x3f')][_0x834e('0x50')]){_0x2c8155[_0x834e('0x51')]=[{'all':!![]}];}_0x2c8155=_['merge']({},_0x2c8155,_0x5291ae[_0x834e('0x4f')]);return db[_0x834e('0x3d')][_0x834e('0x59')](_0x2c8155)['then'](handleEntityNotFound(_0x5be43d,null))[_0x834e('0x1e')](function(_0x1fcae9){if(_0x1fcae9){var _0x3a7683=_0x1fcae9[_0x834e('0x36')]({'plain':!![]});_0x3a7683=qs[_0x834e('0x5c')](_0x3a7683,['id',_0x834e('0x5d'),_0x834e('0x5e')]);_0x5291ae[_0x834e('0x5f')]=_[_0x834e('0x5c')](_0x5291ae[_0x834e('0x5f')],['id',_0x834e('0x5d'),_0x834e('0x5e')]);return db[_0x834e('0x3d')][_0x834e('0x60')](_[_0x834e('0x4c')](_0x3a7683,_0x5291ae[_0x834e('0x5f')]),{'include':_0x5291ae[_0x834e('0x3f')][_0x834e('0x50')]?[{'all':!![]}]:undefined})[_0x834e('0x1e')](function(_0x3e3467){var _0xed4081=_0x5291ae[_0x834e('0x61')]['get']({'plain':!![]});if(!_0xed4081)throw new Error(_0x834e('0x62'));if(_0xed4081[_0x834e('0x63')]===_0x834e('0x61')){var _0x36cc14=_0x3e3467['get']({'plain':!![]});var _0x30faa8='Trunks';return db['UserProfileSection'][_0x834e('0x59')]({'where':{'name':_0x30faa8,'userProfileId':_0xed4081[_0x834e('0x64')]},'raw':!![]})[_0x834e('0x1e')](function(_0xe79465){if(_0xe79465&&_0xe79465[_0x834e('0x65')]===0x0){return db[_0x834e('0x38')][_0x834e('0x60')]({'name':_0x36cc14[_0x834e('0x3a')],'resourceId':_0x36cc14['id'],'type':_0xe79465['name'],'sectionId':_0xe79465['id']},{})[_0x834e('0x1e')](function(){return _0x3e3467;});}else{return _0x3e3467;}})['catch'](function(_0x17e223){logger[_0x834e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17e223);throw _0x17e223;});}return _0x3e3467;});}})['then'](respondWithResult(_0x5be43d,0xc9))[_0x834e('0x54')](handleError(_0x5be43d,null));};exports[_0x834e('0x60')]=function(_0x363cc2,_0x2cca07,_0x2c41bd){var _0x5a4854;return db[_0x834e('0x3d')][_0x834e('0x60')](_0x363cc2[_0x834e('0x5f')],{'raw':!![]})[_0x834e('0x1e')](function(_0x3181af){_0x5a4854=_0x3181af;return db[_0x834e('0x3d')][_0x834e('0x52')]({'raw':!![]});})[_0x834e('0x1e')](function(_0x376f72){var _0x324f67=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],_0x834e('0x68')),_0x834e('0x69'));var _0x51cfab=fs[_0x834e('0x6a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0x834e('0x69'));var _0x332d8f=ejs['render'](_0x324f67,{'trunks':_0x376f72||[]});fs[_0x834e('0x6b')](_0x834e('0x6c'),_0x332d8f);if(_0x5a4854['registry']){var _0x353246=ejs[_0x834e('0x6d')](_0x51cfab,{'trunks':_0x376f72||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x353246);}})[_0x834e('0x1e')](function(){return respondWithRpcPromise(_0x834e('0x6e'),_0x834e('0x60'),{'module':_0x834e('0x6f')});})[_0x834e('0x1e')](function(){var _0x493239=_0x363cc2[_0x834e('0x61')]['get']({'plain':!![]});if(!_0x493239)throw new Error(_0x834e('0x62'));if(_0x493239[_0x834e('0x63')]===_0x834e('0x61')){var _0x5afb41=_0x5a4854[_0x834e('0x36')]({'plain':!![]});return db[_0x834e('0x70')]['find']({'where':{'name':_0x834e('0x37'),'userProfileId':_0x493239[_0x834e('0x64')]},'raw':!![]})[_0x834e('0x1e')](function(_0x50d0a3){if(_0x50d0a3&&_0x50d0a3[_0x834e('0x65')]===0x0){return db[_0x834e('0x38')][_0x834e('0x60')]({'name':_0x5afb41[_0x834e('0x3a')],'resourceId':_0x5afb41['id'],'type':_0x50d0a3[_0x834e('0x3a')],'sectionId':_0x50d0a3['id']},{})[_0x834e('0x1e')](function(){return _0x5a4854;});}else{return _0x5a4854;}})[_0x834e('0x54')](function(_0x23b5d9){logger[_0x834e('0x24')](_0x834e('0x71'),_0x23b5d9);throw _0x23b5d9;});}return _0x5a4854;})['then'](respondWithResult(_0x2cca07,0xc9))['catch'](handleError(_0x2cca07,null));};exports['update']=function(_0x36ede9,_0x1135a5,_0x313c03){var _0x37fa2c;return db[_0x834e('0x3d')]['find']({'where':{'id':_0x36ede9['params']['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x1135a5,null))[_0x834e('0x1e')](saveUpdates(_0x36ede9[_0x834e('0x5f')],null))[_0x834e('0x1e')](function(_0x40a705){if(_0x40a705){_0x37fa2c=_0x40a705;return db['Trunk'][_0x834e('0x52')]({'raw':!![]});}})[_0x834e('0x1e')](function(_0x113714){if(_0x113714){var _0x4e1735=fs[_0x834e('0x6a')](path[_0x834e('0x66')](config[_0x834e('0x67')],_0x834e('0x68')),_0x834e('0x69'));var _0x585d02=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],'server/files/templates/registry.ejs'),_0x834e('0x69'));var _0x509427=ejs[_0x834e('0x6d')](_0x4e1735,{'trunks':_0x113714||[]});fs[_0x834e('0x6b')](_0x834e('0x6c'),_0x509427);var _0x53012d=ejs[_0x834e('0x6d')](_0x585d02,{'trunks':_0x113714||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x53012d);return respondWithRpcPromise('Reload',_0x834e('0x34'),{'module':_0x834e('0x6f')});}return null;})[_0x834e('0x1e')](function(_0x1d76c6){if(_0x1d76c6){return _0x37fa2c;}})[_0x834e('0x1e')](respondWithResult(_0x1135a5,null))[_0x834e('0x54')](handleError(_0x1135a5,null));};exports[_0x834e('0x35')]=function(_0x179892,_0x17e61a,_0x53f6e3){var _0x2f775a;return db['Trunk'][_0x834e('0x59')]({'where':{'id':_0x179892[_0x834e('0x56')]['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x17e61a,null))[_0x834e('0x1e')](removeEntity(_0x17e61a,null))[_0x834e('0x1e')](function(){return db[_0x834e('0x3d')]['findAll']({'raw':!![]});})['then'](function(_0xeb096d){var _0x2a854a=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],_0x834e('0x68')),_0x834e('0x69'));var _0xc75f5e=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5ede29=ejs[_0x834e('0x6d')](_0x2a854a,{'trunks':_0xeb096d});var _0x1f3e26=ejs['render'](_0xc75f5e,{'trunks':_0xeb096d});fs[_0x834e('0x6b')](_0x834e('0x6c'),_0x5ede29);fs['writeFileSync'](_0x834e('0x72'),_0x1f3e26);return respondWithRpcPromise('Reload','destroy',{'module':_0x834e('0x6f')});})[_0x834e('0x54')](handleError(_0x17e61a,null));}; \ No newline at end of file +var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x1f0292,_0x4c58ae){var _0x126423=function(_0x509285){while(--_0x509285){_0x1f0292['push'](_0x1f0292['shift']());}};_0x126423(++_0x4c58ae);}(_0xbec5,0xe5));var _0x5bec=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0xbec5[_0x5e4b85];return _0x5cd3cb;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index bb7a1a4..07623f9 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 _0x4de1=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_trunks','lodash','util','../../config/logger'];(function(_0x5e8fc,_0x1ccc06){var _0x41c58c=function(_0x495f2c){while(--_0x495f2c){_0x5e8fc['push'](_0x5e8fc['shift']());}};_0x41c58c(++_0x1ccc06);}(_0x4de1,0x1c5));var _0x14de=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x4de1[_0x2601b4];return _0x3e3661;};'use strict';var _=require(_0x14de('0x0'));var util=require(_0x14de('0x1'));var logger=require(_0x14de('0x2'))(_0x14de('0x3'));var moment=require(_0x14de('0x4'));var BPromise=require(_0x14de('0x5'));var rp=require(_0x14de('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14de('0x7'));var config=require(_0x14de('0x8'));var attributes=require('./trunk.attributes');module[_0x14de('0x9')]=function(_0x399793,_0xe5e73){return _0x399793[_0x14de('0xa')]('Trunk',attributes,{'tableName':_0x14de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1f7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','../../config/logger'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xa1f7,0x83));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a1f('0x0'))('api');var moment=require(_0x7a1f('0x1'));var BPromise=require(_0x7a1f('0x2'));var rp=require(_0x7a1f('0x3'));var fs=require('fs');var path=require(_0x7a1f('0x4'));var rimraf=require(_0x7a1f('0x5'));var config=require(_0x7a1f('0x6'));var attributes=require(_0x7a1f('0x7'));module[_0x7a1f('0x8')]=function(_0x3ad3b0,_0x190729){return _0x3ad3b0[_0x7a1f('0x9')](_0x7a1f('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index e3f7c88..17682f4 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 _0x6a0d=['Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','Trunk','findAll','raw','options','where','attributes','map','include','model','then','GetTrunk','ShowTrunk','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2eaf88,_0x3354a2){var _0x39acae=function(_0x97a3c1){while(--_0x97a3c1){_0x2eaf88['push'](_0x2eaf88['shift']());}};_0x39acae(++_0x3354a2);}(_0x6a0d,0x1af));var _0xd6a0=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6a0d[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xd6a0('0x0'));var util=require('util');var moment=require(_0xd6a0('0x1'));var BPromise=require('bluebird');var rs=require(_0xd6a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6a0('0x3'))['db'];var utils=require(_0xd6a0('0x4'));var logger=require(_0xd6a0('0x5'))(_0xd6a0('0x6'));var config=require(_0xd6a0('0x7'));var jayson=require(_0xd6a0('0x8'));var client=jayson[_0xd6a0('0x9')][_0xd6a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeda5c4,_0x3e299a,_0x177964){return new BPromise(function(_0x5abd55,_0x4cebf3){return client['request'](_0xeda5c4,_0x177964)['then'](function(_0x3d6f2e){logger['info'](_0xd6a0('0xb'),_0x3e299a,'request\x20sent');logger[_0xd6a0('0xc')](_0xd6a0('0xd'),_0x3e299a,'request\x20sent',JSON[_0xd6a0('0xe')](_0x3d6f2e));if(_0x3d6f2e[_0xd6a0('0xf')]){if(_0x3d6f2e[_0xd6a0('0xf')][_0xd6a0('0x10')]===0x1f4){logger[_0xd6a0('0xf')](_0xd6a0('0xb'),_0x3e299a,_0x3d6f2e[_0xd6a0('0xf')][_0xd6a0('0x11')]);return _0x4cebf3(_0x3d6f2e['error'][_0xd6a0('0x11')]);}logger[_0xd6a0('0xf')]('Trunk,\x20%s,\x20%s',_0x3e299a,_0x3d6f2e[_0xd6a0('0xf')][_0xd6a0('0x11')]);return _0x5abd55(_0x3d6f2e['error'][_0xd6a0('0x11')]);}else{logger[_0xd6a0('0x12')](_0xd6a0('0xb'),_0x3e299a,_0xd6a0('0x13'));_0x5abd55(_0x3d6f2e['result']['message']);}})[_0xd6a0('0x14')](function(_0x15c308){logger[_0xd6a0('0xf')](_0xd6a0('0xb'),_0x3e299a,_0x15c308);_0x4cebf3(_0x15c308);});});}exports['GetTrunk']=function(_0x2c37df){var _0x49df5b=this;return new Promise(function(_0x53c49a,_0x4885f6){return db[_0xd6a0('0x15')][_0xd6a0('0x16')]({'raw':_0x2c37df['options']?_0x2c37df['options'][_0xd6a0('0x17')]===undefined?!![]:![]:!![],'where':_0x2c37df[_0xd6a0('0x18')]?_0x2c37df[_0xd6a0('0x18')][_0xd6a0('0x19')]||null:null,'attributes':_0x2c37df['options']?_0x2c37df[_0xd6a0('0x18')][_0xd6a0('0x1a')]||null:null,'limit':_0x2c37df[_0xd6a0('0x18')]?_0x2c37df['options']['limit']||null:null,'include':_0x2c37df[_0xd6a0('0x18')]?_0x2c37df[_0xd6a0('0x18')]['include']?_[_0xd6a0('0x1b')](_0x2c37df['options'][_0xd6a0('0x1c')],function(_0x420019){return{'model':db[_0x420019[_0xd6a0('0x1d')]],'as':_0x420019['as'],'attributes':_0x420019[_0xd6a0('0x1a')],'include':_0x420019[_0xd6a0('0x1c')]?_[_0xd6a0('0x1b')](_0x420019['include'],function(_0x4fd601){return{'model':db[_0x4fd601[_0xd6a0('0x1d')]],'as':_0x4fd601['as'],'attributes':_0x4fd601[_0xd6a0('0x1a')],'include':_0x4fd601[_0xd6a0('0x1c')]?_[_0xd6a0('0x1b')](_0x4fd601[_0xd6a0('0x1c')],function(_0x37e4d2){return{'model':db[_0x37e4d2['model']],'as':_0x37e4d2['as'],'attributes':_0x37e4d2['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6a0('0x1e')](function(_0x35263a){logger[_0xd6a0('0x12')](_0xd6a0('0x1f'),_0x2c37df);logger[_0xd6a0('0xc')]('GetTrunk',_0x2c37df,JSON['stringify'](_0x35263a));_0x53c49a(_0x35263a);})['catch'](function(_0x54af6d){logger[_0xd6a0('0xf')](_0xd6a0('0x1f'),_0x54af6d['message'],_0x2c37df);_0x4885f6(_0x49df5b[_0xd6a0('0xf')](0x1f4,_0x54af6d['message']));});});};exports[_0xd6a0('0x20')]=function(_0x514207){var _0x66a227=this;return new Promise(function(_0x3b8594,_0x39ee47){return db['Trunk'][_0xd6a0('0x21')]({'raw':_0x514207['options']?_0x514207[_0xd6a0('0x18')][_0xd6a0('0x17')]===undefined?!![]:![]:!![],'where':_0x514207[_0xd6a0('0x18')]?_0x514207[_0xd6a0('0x18')][_0xd6a0('0x19')]||null:null,'attributes':_0x514207[_0xd6a0('0x18')]?_0x514207[_0xd6a0('0x18')][_0xd6a0('0x1a')]||null:null,'include':_0x514207[_0xd6a0('0x18')]?_0x514207[_0xd6a0('0x18')]['include']?_[_0xd6a0('0x1b')](_0x514207[_0xd6a0('0x18')]['include'],function(_0x5a84ee){return{'model':db[_0x5a84ee[_0xd6a0('0x1d')]],'as':_0x5a84ee['as'],'attributes':_0x5a84ee[_0xd6a0('0x1a')],'include':_0x5a84ee[_0xd6a0('0x1c')]?_[_0xd6a0('0x1b')](_0x5a84ee[_0xd6a0('0x1c')],function(_0x484895){return{'model':db[_0x484895[_0xd6a0('0x1d')]],'as':_0x484895['as'],'attributes':_0x484895[_0xd6a0('0x1a')],'include':_0x484895['include']?_['map'](_0x484895['include'],function(_0x143292){return{'model':db[_0x143292[_0xd6a0('0x1d')]],'as':_0x143292['as'],'attributes':_0x143292[_0xd6a0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd6a0('0x1e')](function(_0x12fc0a){logger['info'](_0xd6a0('0x20'),_0x514207);logger[_0xd6a0('0xc')](_0xd6a0('0x20'),_0x514207,JSON[_0xd6a0('0xe')](_0x12fc0a));_0x3b8594(_0x12fc0a);})[_0xd6a0('0x14')](function(_0x5a9a83){logger['error']('ShowTrunk',_0x5a9a83['message'],_0x514207);_0x39ee47(_0x66a227[_0xd6a0('0xf')](0x1f4,_0x5a9a83[_0xd6a0('0x11')]));});});}; \ No newline at end of file +var _0x021c=['limit','include','map','model','GetTrunk','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','Trunk','options','raw','where','attributes'];(function(_0x1979d8,_0x10d8f2){var _0x1d5bb3=function(_0x42e0b4){while(--_0x42e0b4){_0x1979d8['push'](_0x1979d8['shift']());}};_0x1d5bb3(++_0x10d8f2);}(_0x021c,0x8e));var _0xc021=function(_0x20d81d,_0xe5667e){_0x20d81d=_0x20d81d-0x0;var _0x4242e8=_0x021c[_0x20d81d];return _0x4242e8;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var moment=require(_0xc021('0x2'));var BPromise=require(_0xc021('0x3'));var rs=require(_0xc021('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc021('0x5'))['db'];var utils=require(_0xc021('0x6'));var logger=require(_0xc021('0x7'))(_0xc021('0x8'));var config=require('../../config/environment');var jayson=require(_0xc021('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x276bab,_0x388e78,_0x3bbdb3){return new BPromise(function(_0x2fd87a,_0xd85336){return client[_0xc021('0xa')](_0x276bab,_0x3bbdb3)[_0xc021('0xb')](function(_0x2d9ebe){logger['info']('Trunk,\x20%s,\x20%s',_0x388e78,_0xc021('0xc'));logger[_0xc021('0xd')](_0xc021('0xe'),_0x388e78,_0xc021('0xc'),JSON[_0xc021('0xf')](_0x2d9ebe));if(_0x2d9ebe['error']){if(_0x2d9ebe[_0xc021('0x10')][_0xc021('0x11')]===0x1f4){logger[_0xc021('0x10')](_0xc021('0x12'),_0x388e78,_0x2d9ebe['error']['message']);return _0xd85336(_0x2d9ebe['error'][_0xc021('0x13')]);}logger[_0xc021('0x10')](_0xc021('0x12'),_0x388e78,_0x2d9ebe[_0xc021('0x10')][_0xc021('0x13')]);return _0x2fd87a(_0x2d9ebe[_0xc021('0x10')]['message']);}else{logger[_0xc021('0x14')]('Trunk,\x20%s,\x20%s',_0x388e78,_0xc021('0xc'));_0x2fd87a(_0x2d9ebe[_0xc021('0x15')][_0xc021('0x13')]);}})[_0xc021('0x16')](function(_0xe715b0){logger[_0xc021('0x10')](_0xc021('0x12'),_0x388e78,_0xe715b0);_0xd85336(_0xe715b0);});});}exports['GetTrunk']=function(_0x1d3416){var _0x5074d4=this;return new Promise(function(_0x5a7d24,_0x18e261){return db[_0xc021('0x17')]['findAll']({'raw':_0x1d3416[_0xc021('0x18')]?_0x1d3416[_0xc021('0x18')][_0xc021('0x19')]===undefined?!![]:![]:!![],'where':_0x1d3416[_0xc021('0x18')]?_0x1d3416[_0xc021('0x18')][_0xc021('0x1a')]||null:null,'attributes':_0x1d3416[_0xc021('0x18')]?_0x1d3416['options'][_0xc021('0x1b')]||null:null,'limit':_0x1d3416[_0xc021('0x18')]?_0x1d3416[_0xc021('0x18')][_0xc021('0x1c')]||null:null,'include':_0x1d3416[_0xc021('0x18')]?_0x1d3416[_0xc021('0x18')][_0xc021('0x1d')]?_['map'](_0x1d3416[_0xc021('0x18')][_0xc021('0x1d')],function(_0x1cbe98){return{'model':db[_0x1cbe98['model']],'as':_0x1cbe98['as'],'attributes':_0x1cbe98[_0xc021('0x1b')],'include':_0x1cbe98['include']?_[_0xc021('0x1e')](_0x1cbe98['include'],function(_0x1db039){return{'model':db[_0x1db039['model']],'as':_0x1db039['as'],'attributes':_0x1db039[_0xc021('0x1b')],'include':_0x1db039[_0xc021('0x1d')]?_[_0xc021('0x1e')](_0x1db039[_0xc021('0x1d')],function(_0x3fbc58){return{'model':db[_0x3fbc58[_0xc021('0x1f')]],'as':_0x3fbc58['as'],'attributes':_0x3fbc58['attributes']};}):[]};}):[]};}):[]:[]})[_0xc021('0xb')](function(_0x39e20c){logger[_0xc021('0x14')](_0xc021('0x20'),_0x1d3416);logger[_0xc021('0xd')](_0xc021('0x20'),_0x1d3416,JSON[_0xc021('0xf')](_0x39e20c));_0x5a7d24(_0x39e20c);})[_0xc021('0x16')](function(_0xc13b46){logger[_0xc021('0x10')](_0xc021('0x20'),_0xc13b46[_0xc021('0x13')],_0x1d3416);_0x18e261(_0x5074d4['error'](0x1f4,_0xc13b46[_0xc021('0x13')]));});});};exports[_0xc021('0x21')]=function(_0x3a2056){var _0x44d96e=this;return new Promise(function(_0x36cef6,_0x45fd93){return db['Trunk']['find']({'raw':_0x3a2056[_0xc021('0x18')]?_0x3a2056[_0xc021('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3a2056[_0xc021('0x18')]?_0x3a2056['options']['where']||null:null,'attributes':_0x3a2056[_0xc021('0x18')]?_0x3a2056[_0xc021('0x18')][_0xc021('0x1b')]||null:null,'include':_0x3a2056[_0xc021('0x18')]?_0x3a2056[_0xc021('0x18')][_0xc021('0x1d')]?_[_0xc021('0x1e')](_0x3a2056[_0xc021('0x18')][_0xc021('0x1d')],function(_0x386e05){return{'model':db[_0x386e05[_0xc021('0x1f')]],'as':_0x386e05['as'],'attributes':_0x386e05['attributes'],'include':_0x386e05[_0xc021('0x1d')]?_['map'](_0x386e05['include'],function(_0x3cc05b){return{'model':db[_0x3cc05b[_0xc021('0x1f')]],'as':_0x3cc05b['as'],'attributes':_0x3cc05b[_0xc021('0x1b')],'include':_0x3cc05b[_0xc021('0x1d')]?_[_0xc021('0x1e')](_0x3cc05b[_0xc021('0x1d')],function(_0x258564){return{'model':db[_0x258564['model']],'as':_0x258564['as'],'attributes':_0x258564[_0xc021('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc021('0xb')](function(_0x5044df){logger[_0xc021('0x14')](_0xc021('0x21'),_0x3a2056);logger[_0xc021('0xd')](_0xc021('0x21'),_0x3a2056,JSON['stringify'](_0x5044df));_0x36cef6(_0x5044df);})['catch'](function(_0x4b4d03){logger[_0xc021('0x10')](_0xc021('0x21'),_0x4b4d03[_0xc021('0x13')],_0x3a2056);_0x45fd93(_0x44d96e[_0xc021('0x10')](0x1f4,_0x4b4d03[_0xc021('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 22b2f67..5bca1e7 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 _0x33ad=['addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','put','/:id/password','delete','removeQueues','removeTeams','/:id','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','describe','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions'];(function(_0x3a115e,_0x3dac39){var _0x1b7e61=function(_0x393180){while(--_0x393180){_0x3a115e['push'](_0x3a115e['shift']());}};_0x1b7e61(++_0x3dac39);}(_0x33ad,0x18c));var _0xd33a=function(_0x5d213f,_0x2df816){_0x5d213f=_0x5d213f-0x0;var _0xb66c4a=_0x33ad[_0x5d213f];return _0xb66c4a;};'use strict';var multer=require('multer');var util=require(_0xd33a('0x0'));var path=require(_0xd33a('0x1'));var timeout=require(_0xd33a('0x2'));var express=require(_0xd33a('0x3'));var router=express['Router']();var fs_extra=require(_0xd33a('0x4'));var auth=require(_0xd33a('0x5'));var interaction=require(_0xd33a('0x6'));var config=require('../../config/environment');var controller=require(_0xd33a('0x7'));router[_0xd33a('0x8')]('/',auth[_0xd33a('0x9')](),controller[_0xd33a('0xa')]);router[_0xd33a('0x8')]('/describe',auth[_0xd33a('0x9')](),controller[_0xd33a('0xb')]);router['get']('/whoami',auth[_0xd33a('0x9')](),controller[_0xd33a('0xc')]);router[_0xd33a('0x8')](_0xd33a('0xd'),auth[_0xd33a('0x9')](),controller[_0xd33a('0xe')]);router[_0xd33a('0x8')]('/:id',auth[_0xd33a('0x9')](),controller[_0xd33a('0xf')]);router['get'](_0xd33a('0x10'),controller[_0xd33a('0x11')]);router[_0xd33a('0x8')](_0xd33a('0x12'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x13')]);router[_0xd33a('0x8')](_0xd33a('0x14'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x15')]);router[_0xd33a('0x8')](_0xd33a('0x16'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x17')]);router[_0xd33a('0x8')](_0xd33a('0x18'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x19')]);router[_0xd33a('0x8')](_0xd33a('0x1a'),auth[_0xd33a('0x9')](),controller['getGroups']);router[_0xd33a('0x8')](_0xd33a('0x1b'),auth['isAuthenticated'](),controller[_0xd33a('0x1c')]);router[_0xd33a('0x8')](_0xd33a('0x1d'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x1e')]);router[_0xd33a('0x8')](_0xd33a('0x1f'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x20')]);router[_0xd33a('0x8')]('/:id/openchannel/interactions',auth[_0xd33a('0x9')](),controller[_0xd33a('0x21')]);router[_0xd33a('0x8')](_0xd33a('0x22'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x23')]);router[_0xd33a('0x8')](_0xd33a('0x24'),auth[_0xd33a('0x9')](),controller['getSmsInteractions']);router[_0xd33a('0x8')](_0xd33a('0x25'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x26')]);router[_0xd33a('0x8')](_0xd33a('0x27'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x28')]);router[_0xd33a('0x8')](_0xd33a('0x29'),auth['isAuthenticated'](),controller[_0xd33a('0x2a')]);router[_0xd33a('0x8')](_0xd33a('0x2b'),auth['isAuthenticated'](),controller[_0xd33a('0x2c')]);router['get']('/:id/agents',auth[_0xd33a('0x9')](),controller[_0xd33a('0x2d')]);router[_0xd33a('0x8')](_0xd33a('0x2e'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x2f')]);router['get'](_0xd33a('0x30'),auth[_0xd33a('0x9')](),controller['getFaxAccounts']);router['get'](_0xd33a('0x31'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x32')]);router[_0xd33a('0x8')](_0xd33a('0x33'),auth['isAuthenticated'](),controller[_0xd33a('0x34')]);router['get'](_0xd33a('0x35'),auth[_0xd33a('0x9')](),controller['getSmsAccounts']);router[_0xd33a('0x8')]('/:id/chat_websites',auth[_0xd33a('0x9')](),controller['getChatWebsites']);router[_0xd33a('0x8')](_0xd33a('0x36'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x37')]);router[_0xd33a('0x8')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xd33a('0x38')]);router[_0xd33a('0x8')]('/:id/scheduled_calls',auth[_0xd33a('0x9')](),controller[_0xd33a('0x39')]);router['get'](_0xd33a('0x3a'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x3b')]);router['post'](_0xd33a('0x14'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x3c')]);router[_0xd33a('0x3d')]('/',auth[_0xd33a('0x9')](),controller[_0xd33a('0x3e')]);router[_0xd33a('0x3d')](_0xd33a('0x3f'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x40')]);router[_0xd33a('0x3d')](_0xd33a('0x16'),auth[_0xd33a('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xd33a('0x41')]({'destination':function(_0x320a29,_0x13ac0a,_0x507ea8){_0x507ea8(null,path[_0xd33a('0x42')](config[_0xd33a('0x43')],_0xd33a('0x44')));},'filename':function(_0x545289,_0x286089,_0x261234){_0x261234(null,util[_0xd33a('0x45')](_0xd33a('0x46'),Date['now'](),_0x286089[_0xd33a('0x47')]));}})});router['post']('/:id/avatar',upload[_0xd33a('0x48')](_0xd33a('0x49')),controller[_0xd33a('0x4a')]);router[_0xd33a('0x3d')](_0xd33a('0x4b'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x4c')]);router['post'](_0xd33a('0x4d'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x4e')]);router[_0xd33a('0x3d')](_0xd33a('0x4f'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x50')]);router['post'](_0xd33a('0x51'),auth[_0xd33a('0x9')](),controller['unpause']);router[_0xd33a('0x3d')]('/:id/teams',auth[_0xd33a('0x9')](),controller[_0xd33a('0x52')]);router[_0xd33a('0x3d')](_0xd33a('0x53'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x54')]);router[_0xd33a('0x3d')](_0xd33a('0x55'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x56')]);router[_0xd33a('0x3d')](_0xd33a('0x57'),auth[_0xd33a('0x9')](),controller['addFaxInteractions']);router[_0xd33a('0x3d')](_0xd33a('0x58'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x59')]);router['post']('/:id/openchannel_interactions',auth[_0xd33a('0x9')](),controller[_0xd33a('0x5a')]);router[_0xd33a('0x3d')](_0xd33a('0x5b'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x5c')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xd33a('0x5d')]);router['post'](_0xd33a('0x31'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x5e')]);router[_0xd33a('0x3d')](_0xd33a('0x33'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x5f')]);router[_0xd33a('0x3d')]('/:id/sms_accounts',auth[_0xd33a('0x9')](),controller['addSmsAccounts']);router[_0xd33a('0x3d')]('/:id/chat_websites',auth[_0xd33a('0x9')](),controller[_0xd33a('0x60')]);router[_0xd33a('0x3d')](_0xd33a('0x36'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x61')]);router[_0xd33a('0x3d')](_0xd33a('0x62'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x63')]);router['post'](_0xd33a('0x3a'),auth['isAuthenticated'](),controller['createApiKey']);router[_0xd33a('0x64')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd33a('0x64')](_0xd33a('0x65'),auth[_0xd33a('0x9')](),controller['changePassword']);router[_0xd33a('0x66')](_0xd33a('0x16'),auth['isAuthenticated'](),controller[_0xd33a('0x67')]);router[_0xd33a('0x66')](_0xd33a('0x29'),auth['isAuthenticated'](),controller[_0xd33a('0x68')]);router['delete'](_0xd33a('0x69'),auth['isAuthenticated'](),controller[_0xd33a('0x6a')]);router[_0xd33a('0x66')](_0xd33a('0x53'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x6b')]);router[_0xd33a('0x66')](_0xd33a('0x55'),auth['isAuthenticated'](),controller[_0xd33a('0x6c')]);router[_0xd33a('0x66')](_0xd33a('0x57'),auth[_0xd33a('0x9')](),controller['removeFaxInteractions']);router[_0xd33a('0x66')](_0xd33a('0x58'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x6d')]);router[_0xd33a('0x66')](_0xd33a('0x6e'),auth['isAuthenticated'](),controller[_0xd33a('0x6f')]);router[_0xd33a('0x66')]('/:id/whatsapp_interactions',auth[_0xd33a('0x9')](),controller[_0xd33a('0x70')]);router[_0xd33a('0x66')](_0xd33a('0x30'),auth[_0xd33a('0x9')](),controller['removeFaxAccounts']);router[_0xd33a('0x66')](_0xd33a('0x31'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x71')]);router[_0xd33a('0x66')](_0xd33a('0x33'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x72')]);router[_0xd33a('0x66')](_0xd33a('0x35'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x73')]);router['delete'](_0xd33a('0x74'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x75')]);router['delete'](_0xd33a('0x36'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x76')]);router[_0xd33a('0x66')](_0xd33a('0x62'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x77')]);router[_0xd33a('0x66')](_0xd33a('0x3a'),auth[_0xd33a('0x9')](),controller[_0xd33a('0x78')]);module[_0xd33a('0x79')]=router; \ No newline at end of file +var _0x1ef1=['now','originalname','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','removeMailInteractions','removeSmsInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','getVoicePrefixes','getFaxAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','bulkCreate','diskStorage','join','format','%s-%s'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x1ef1,0x95));var _0x11ef=function(_0x42defe,_0x413299){_0x42defe=_0x42defe-0x0;var _0x2977ca=_0x1ef1[_0x42defe];return _0x2977ca;};'use strict';var multer=require(_0x11ef('0x0'));var util=require(_0x11ef('0x1'));var path=require(_0x11ef('0x2'));var timeout=require(_0x11ef('0x3'));var express=require('express');var router=express[_0x11ef('0x4')]();var fs_extra=require(_0x11ef('0x5'));var auth=require(_0x11ef('0x6'));var interaction=require(_0x11ef('0x7'));var config=require(_0x11ef('0x8'));var controller=require('./user.controller');router[_0x11ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x11ef('0x9')](_0x11ef('0xa'),auth[_0x11ef('0xb')](),controller[_0x11ef('0xc')]);router['get']('/whoami',auth[_0x11ef('0xb')](),controller[_0x11ef('0xd')]);router['get'](_0x11ef('0xe'),auth[_0x11ef('0xb')](),controller[_0x11ef('0xf')]);router[_0x11ef('0x9')](_0x11ef('0x10'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x11')]);router[_0x11ef('0x9')](_0x11ef('0x12'),controller[_0x11ef('0x13')]);router[_0x11ef('0x9')](_0x11ef('0x14'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x15')]);router[_0x11ef('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x11ef('0x16')]);router[_0x11ef('0x9')](_0x11ef('0x17'),auth['isAuthenticated'](),controller[_0x11ef('0x18')]);router['get'](_0x11ef('0x19'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x1a')]);router['get'](_0x11ef('0x1b'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x1c')]);router[_0x11ef('0x9')](_0x11ef('0x1d'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x1e')]);router['get']('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x11ef('0x1f')]);router[_0x11ef('0x9')]('/:id/chat/interactions',auth[_0x11ef('0xb')](),controller[_0x11ef('0x20')]);router[_0x11ef('0x9')]('/:id/openchannel/interactions',auth[_0x11ef('0xb')](),controller[_0x11ef('0x21')]);router[_0x11ef('0x9')](_0x11ef('0x22'),auth[_0x11ef('0xb')](),controller['getMailInteractions']);router[_0x11ef('0x9')]('/:id/sms/interactions',auth[_0x11ef('0xb')](),controller[_0x11ef('0x23')]);router['get']('/:id/fax/interactions',auth[_0x11ef('0xb')](),controller['getFaxInteractions']);router['get'](_0x11ef('0x24'),auth['isAuthenticated'](),controller[_0x11ef('0x25')]);router[_0x11ef('0x9')](_0x11ef('0x26'),auth[_0x11ef('0xb')](),controller['getTeams']);router[_0x11ef('0x9')](_0x11ef('0x27'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x28')]);router[_0x11ef('0x9')]('/:id/agents',auth[_0x11ef('0xb')](),controller[_0x11ef('0x29')]);router[_0x11ef('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x11ef('0x2a')]);router[_0x11ef('0x9')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x11ef('0x2b')]);router['get']('/:id/mail_accounts',auth[_0x11ef('0xb')](),controller['getMailAccounts']);router[_0x11ef('0x9')](_0x11ef('0x2c'),auth[_0x11ef('0xb')](),controller['getOpenchannelAccounts']);router['get'](_0x11ef('0x2d'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x2e')]);router['get'](_0x11ef('0x2f'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x11ef('0x9')](_0x11ef('0x30'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x31')]);router[_0x11ef('0x9')](_0x11ef('0x32'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x11ef('0x9')](_0x11ef('0x33'),auth['isAuthenticated'](),controller[_0x11ef('0x34')]);router[_0x11ef('0x9')](_0x11ef('0x35'),auth['isAuthenticated'](),controller['getApiKey']);router[_0x11ef('0x36')](_0x11ef('0x37'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x38')]);router[_0x11ef('0x36')]('/',auth['isAuthenticated'](),controller[_0x11ef('0x39')]);router[_0x11ef('0x36')]('/create_many',auth[_0x11ef('0xb')](),controller[_0x11ef('0x3a')]);router[_0x11ef('0x36')](_0x11ef('0x17'),auth[_0x11ef('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x11ef('0x3b')]({'destination':function(_0x39613c,_0x4dc703,_0x4f7efb){_0x4f7efb(null,path[_0x11ef('0x3c')](config['root'],'server/files/images/'));},'filename':function(_0x44f32f,_0x290efb,_0x3f274b){_0x3f274b(null,util[_0x11ef('0x3d')](_0x11ef('0x3e'),Date[_0x11ef('0x3f')](),_0x290efb[_0x11ef('0x40')]));}})});router[_0x11ef('0x36')](_0x11ef('0x12'),upload['single']('file'),controller[_0x11ef('0x41')]);router[_0x11ef('0x36')](_0x11ef('0x42'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x43')]);router['post'](_0x11ef('0x44'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x45')]);router[_0x11ef('0x36')]('/:id/pause',auth[_0x11ef('0xb')](),controller[_0x11ef('0x46')]);router[_0x11ef('0x36')](_0x11ef('0x47'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x48')]);router['post'](_0x11ef('0x26'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x49')]);router[_0x11ef('0x36')](_0x11ef('0x4a'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x4b')]);router[_0x11ef('0x36')](_0x11ef('0x4c'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x4d')]);router['post'](_0x11ef('0x4e'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x4f')]);router[_0x11ef('0x36')](_0x11ef('0x50'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x51')]);router[_0x11ef('0x36')](_0x11ef('0x52'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x53')]);router['post'](_0x11ef('0x54'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x55')]);router[_0x11ef('0x36')]('/:id/fax_accounts',auth[_0x11ef('0xb')](),controller['addFaxAccounts']);router[_0x11ef('0x36')](_0x11ef('0x56'),auth['isAuthenticated'](),controller[_0x11ef('0x57')]);router[_0x11ef('0x36')]('/:id/openchannel_accounts',auth[_0x11ef('0xb')](),controller[_0x11ef('0x58')]);router[_0x11ef('0x36')](_0x11ef('0x2d'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x59')]);router[_0x11ef('0x36')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x11ef('0x5a')]);router['post'](_0x11ef('0x30'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x5b')]);router[_0x11ef('0x36')]('/:id/square_projects',auth[_0x11ef('0xb')](),controller['addSquareProjects']);router[_0x11ef('0x36')](_0x11ef('0x35'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x5c')]);router[_0x11ef('0x5d')](_0x11ef('0x10'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x5e')]);router[_0x11ef('0x5d')](_0x11ef('0x5f'),auth[_0x11ef('0xb')](),controller['changePassword']);router[_0x11ef('0x60')](_0x11ef('0x17'),auth[_0x11ef('0xb')](),controller['removeQueues']);router[_0x11ef('0x60')](_0x11ef('0x26'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x61')]);router[_0x11ef('0x60')](_0x11ef('0x10'),auth[_0x11ef('0xb')](),controller['destroy']);router[_0x11ef('0x60')](_0x11ef('0x4a'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x11ef('0x60')](_0x11ef('0x4c'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x62')]);router[_0x11ef('0x60')](_0x11ef('0x4e'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x11ef('0x60')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x11ef('0x63')]);router['delete'](_0x11ef('0x52'),auth[_0x11ef('0xb')](),controller['removeOpenchannelInteractions']);router[_0x11ef('0x60')](_0x11ef('0x54'),auth[_0x11ef('0xb')](),controller['removeWhatsappInteractions']);router[_0x11ef('0x60')](_0x11ef('0x64'),auth['isAuthenticated'](),controller[_0x11ef('0x65')]);router[_0x11ef('0x60')](_0x11ef('0x56'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x66')]);router[_0x11ef('0x60')]('/:id/openchannel_accounts',auth[_0x11ef('0xb')](),controller['removeOpenchannelAccounts']);router[_0x11ef('0x60')](_0x11ef('0x2d'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x67')]);router[_0x11ef('0x60')](_0x11ef('0x2f'),auth[_0x11ef('0xb')](),controller['removeChatWebsites']);router[_0x11ef('0x60')](_0x11ef('0x30'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x68')]);router[_0x11ef('0x60')](_0x11ef('0x32'),auth[_0x11ef('0xb')](),controller[_0x11ef('0x69')]);router['delete'](_0x11ef('0x35'),auth[_0x11ef('0xb')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e9c2a78..c989215 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 _0x9b7c=['STRING','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','telephone','local','INTEGER','accountcode','callerid','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','uas','certificate','active','passive','actpass','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','rtcp_mux','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user'];(function(_0x481c0c,_0xb182d6){var _0x20ffa2=function(_0x172fc7){while(--_0x172fc7){_0x481c0c['push'](_0x481c0c['shift']());}};_0x20ffa2(++_0xb182d6);}(_0x9b7c,0x170));var _0xc9b7=function(_0x49837e,_0x208c5f){_0x49837e=_0x49837e-0x0;var _0x2eeadd=_0x9b7c[_0x49837e];return _0x2eeadd;};'use strict';var Sequelize=require(_0xc9b7('0x0'));var moment=require(_0xc9b7('0x1'));var util=require('util');var _=require(_0xc9b7('0x2'));module[_0xc9b7('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc9b7('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xb938d){this[_0xc9b7('0x5')](_0xc9b7('0x4'),_0xb938d);this[_0xc9b7('0x5')](_0xc9b7('0x6'),_0xb938d);},'comment':_0xc9b7('0x7')},'fullname':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':![],'set':function(_0x4cc2af){this[_0xc9b7('0x5')]('fullname',_0x4cc2af);this['setDataValue']('callerid',util[_0xc9b7('0x9')](_0xc9b7('0xa'),_0x4cc2af,this[_0xc9b7('0xb')](_0xc9b7('0xc'))));}},'alias':{'type':Sequelize[_0xc9b7('0x8')]},'email':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':![],'unique':_0xc9b7('0xd'),'validate':{'isEmail':!![]},'set':function(_0x420242){if(_0x420242){this['setDataValue'](_0xc9b7('0xd'),_0x420242['toLowerCase']());}}},'role':{'type':Sequelize[_0xc9b7('0xe')]('admin',_0xc9b7('0xf'),'agent',_0xc9b7('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xc9b7('0x8')],'defaultValue':_0xc9b7('0x11')},'internal':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':![],'unique':_0xc9b7('0xc'),'set':function(_0x5b3c9d){this[_0xc9b7('0x5')](_0xc9b7('0xc'),_0x5b3c9d);this[_0xc9b7('0x5')](_0xc9b7('0x13'),_0x5b3c9d);this[_0xc9b7('0x5')](_0xc9b7('0x14'),util[_0xc9b7('0x9')]('\x22%s\x22\x20<%s>',this[_0xc9b7('0xb')](_0xc9b7('0x15')),_0x5b3c9d));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc9b7('0x8')]},'mobile':{'type':Sequelize[_0xc9b7('0x8')]},'address':{'type':Sequelize[_0xc9b7('0x8')]},'zipcode':{'type':Sequelize[_0xc9b7('0x8')]},'userpic':{'type':Sequelize[_0xc9b7('0x8')]},'city':{'type':Sequelize[_0xc9b7('0x8')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xc9b7('0x17')]},'voicePause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xc9b7('0x8')],'defaultValue':_0xc9b7('0x18')},'lastPauseAt':{'type':Sequelize[_0xc9b7('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xc9b7('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc9b7('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'host':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![],'defaultValue':_0xc9b7('0x19')},'ipaddr':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'port':{'type':Sequelize[_0xc9b7('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xc9b7('0x1a'),'user',_0xc9b7('0x1b')),'allowNull':!![],'defaultValue':_0xc9b7('0x1a')},'context':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![],'defaultValue':_0xc9b7('0x1c')},'callingpres':{'type':Sequelize[_0xc9b7('0xe')]('ALLOWED_NOT_SCREENED',_0xc9b7('0x1d'),_0xc9b7('0x1e'),_0xc9b7('0x1f'),'PROHIB_NOT_SCREENED',_0xc9b7('0x20'),_0xc9b7('0x21'),_0xc9b7('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![],'defaultValue':_0xc9b7('0x23'),'set':function(_0x40109b){this[_0xc9b7('0x5')]('transport',_0x40109b?_0x40109b['join'](','):null);},'get':function(){return this[_0xc9b7('0xb')]('transport')?this['getDataValue'](_0xc9b7('0x24'))[_0xc9b7('0x25')](','):null;},'comment':_0xc9b7('0x26')},'dtmfmode':{'type':Sequelize[_0xc9b7('0xe')]('rfc2833',_0xc9b7('0x27'),_0xc9b7('0x28'),_0xc9b7('0x29'),_0xc9b7('0x2a')),'allowNull':!![],'defaultValue':_0xc9b7('0x2b')},'directmedia':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no',_0xc9b7('0x2d'),'update',_0xc9b7('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc9b7('0x2f'),'set':function(_0x173f3b){this[_0xc9b7('0x5')]('nat',_0x173f3b?_0x173f3b[_0xc9b7('0x30')](','):null);},'get':function(){return this['getDataValue'](_0xc9b7('0x31'))?this[_0xc9b7('0xb')](_0xc9b7('0x31'))[_0xc9b7('0x25')](','):null;},'comment':_0xc9b7('0x32')},'callgroup':{'type':Sequelize[_0xc9b7('0x8')]},'namedcallgroup':{'type':Sequelize[_0xc9b7('0x8')]},'pickupgroup':{'type':Sequelize[_0xc9b7('0x8')]},'namedpickupgroup':{'type':Sequelize[_0xc9b7('0x8')]},'language':{'type':Sequelize[_0xc9b7('0x8')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc9b7('0x8')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc9b7('0x33')},'allow':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x20d21a){this['setDataValue'](_0xc9b7('0x34'),_0x20d21a?_0x20d21a[_0xc9b7('0x30')](';'):_0xc9b7('0x35'));},'get':function(){return this[_0xc9b7('0xb')]('allow')?this['getDataValue'](_0xc9b7('0x34'))[_0xc9b7('0x25')](';'):null;},'comment':_0xc9b7('0x36')},'autoframing':{'type':Sequelize[_0xc9b7('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![],'set':function(_0x5a13de){this[_0xc9b7('0x5')]('insecure',_0x5a13de?_0x5a13de[_0xc9b7('0x30')](','):null);},'get':function(){return this[_0xc9b7('0xb')](_0xc9b7('0x37'))?this[_0xc9b7('0xb')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no',_0xc9b7('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![],'defaultValue':_0xc9b7('0x39')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xc9b7('0x2c')},'busylevel':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc9b7('0xe')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no',_0xc9b7('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x3b'),_0xc9b7('0x3c'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc9b7('0xe')]('uac',_0xc9b7('0x3d')),'allowNull':!![],'defaultValue':_0xc9b7('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc9b7('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xc9b7('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no','fingerprint',_0xc9b7('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xc9b7('0x3f'),_0xc9b7('0x40'),_0xc9b7('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc9b7('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc9b7('0xe')](_0xc9b7('0x2c'),'no',_0xc9b7('0x2d'),_0xc9b7('0x42'),_0xc9b7('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc9b7('0x8')]},'resetPasswordExpires':{'type':Sequelize[_0xc9b7('0x17')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc9b7('0x44')]},'showWebBar':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0,'set':function(_0x52b762){this[_0xc9b7('0x5')](_0xc9b7('0x45'),_0x52b762);var _0x45ecd9=this[_0xc9b7('0x46')]({'plain':!![]});switch(_0x52b762){case 0x0:case 0x1:var _0xc18c75=_0x45ecd9[_0xc9b7('0x24')]?_[_0xc9b7('0x47')](_0x45ecd9['transport'])?_0x45ecd9[_0xc9b7('0x24')][_0xc9b7('0x30')]():_0x45ecd9[_0xc9b7('0x24')]:_0xc9b7('0x23');if(_0xc18c75===_0xc9b7('0x48')){_0xc18c75=_0xc9b7('0x23');}this[_0xc9b7('0x5')](_0xc9b7('0x24'),_0xc18c75);this[_0xc9b7('0x5')](_0xc9b7('0x49'),'no');this[_0xc9b7('0x5')](_0xc9b7('0x4a'),null);this[_0xc9b7('0x5')](_0xc9b7('0x4b'),null);this[_0xc9b7('0x5')](_0xc9b7('0x4c'),null);this[_0xc9b7('0x5')](_0xc9b7('0x4d'),null);this['setDataValue']('dtlsverify',null);this['setDataValue'](_0xc9b7('0x4e'),null);this[_0xc9b7('0x5')]('dtlscertfile',null);this[_0xc9b7('0x5')](_0xc9b7('0x4f'),null);this[_0xc9b7('0x5')](_0xc9b7('0x50'),'no');break;case 0x2:this['setDataValue'](_0xc9b7('0x24'),'wss');this[_0xc9b7('0x5')]('encryption','yes');this[_0xc9b7('0x5')](_0xc9b7('0x4a'),_0xc9b7('0x2c'));this['setDataValue'](_0xc9b7('0x4b'),_0xc9b7('0x2c'));this['setDataValue'](_0xc9b7('0x4c'),'yes');this[_0xc9b7('0x5')](_0xc9b7('0x4d'),_0xc9b7('0x2c'));this[_0xc9b7('0x5')](_0xc9b7('0x51'),'no');this[_0xc9b7('0x5')](_0xc9b7('0x4e'),_0xc9b7('0x41'));this[_0xc9b7('0x5')](_0xc9b7('0x52'),_0x45ecd9['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0xc9b7('0x5')](_0xc9b7('0x4f'),_0x45ecd9[_0xc9b7('0x4f')]||_0xc9b7('0x53'));this['setDataValue'](_0xc9b7('0x50'),_0xc9b7('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x570335){this[_0xc9b7('0x5')](_0xc9b7('0x54'),_0x570335?_0x570335[_0xc9b7('0x30')](','):[]);},'get':function(){return this['getDataValue'](_0xc9b7('0x54'))?_[_0xc9b7('0x55')](this['getDataValue'](_0xc9b7('0x54'))[_0xc9b7('0x25')](','),function(_0x34a54c){return parseInt(_0x34a54c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc9b7('0x8')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc9b7('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0xc9b7('0x8')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc9b7('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xc9b7('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xc9b7('0x8')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc9b7('0x56')],'get':function(){return this[_0xc9b7('0xb')](_0xc9b7('0x57'))?this[_0xc9b7('0xb')](_0xc9b7('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc9b7('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x14cf8c){if(typeof _0x14cf8c===_0xc9b7('0x58')){var _0x1ab6cf=_0x14cf8c==='1'?!![]:_0x14cf8c==='0'?![]:_0x14cf8c===_0xc9b7('0x59')?!![]:_0x14cf8c===_0xc9b7('0x5a')?![]:![];this[_0xc9b7('0x5')](_0xc9b7('0x5b'),_0x1ab6cf);}else{this[_0xc9b7('0x5')](_0xc9b7('0x5b'),_0x14cf8c);}}},'blocked':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![],'set':function(_0x49e2df){this[_0xc9b7('0x5')]('blocked',_0x49e2df);if(_0x49e2df===!![]){this['setDataValue'](_0xc9b7('0x5c'),moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0xc9b7('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xc9b7('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc9b7('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc9b7('0x12')](0x5)[_0xc9b7('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc9b7('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x16d7=['STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','accountcode','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','rfc2833','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','yes','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','udp','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','encryption','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports'];(function(_0x1be7ad,_0x5d6a06){var _0x56ae3c=function(_0x4f4c4a){while(--_0x4f4c4a){_0x1be7ad['push'](_0x1be7ad['shift']());}};_0x56ae3c(++_0x5d6a06);}(_0x16d7,0x1d6));var _0x716d=function(_0x25b6dc,_0x4e58e7){_0x25b6dc=_0x25b6dc-0x0;var _0x19af3e=_0x16d7[_0x25b6dc];return _0x19af3e;};'use strict';var Sequelize=require(_0x716d('0x0'));var moment=require(_0x716d('0x1'));var util=require(_0x716d('0x2'));var _=require(_0x716d('0x3'));module[_0x716d('0x4')]={'name':{'type':Sequelize[_0x716d('0x5')],'allowNull':![],'unique':_0x716d('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xf216b0){this['setDataValue']('name',_0xf216b0);this[_0x716d('0x7')]('defaultuser',_0xf216b0);},'comment':_0x716d('0x8')},'fullname':{'type':Sequelize[_0x716d('0x5')],'allowNull':![],'set':function(_0x171cbc){this['setDataValue'](_0x716d('0x9'),_0x171cbc);this['setDataValue'](_0x716d('0xa'),util[_0x716d('0xb')](_0x716d('0xc'),_0x171cbc,this['getDataValue'](_0x716d('0xd'))));}},'alias':{'type':Sequelize[_0x716d('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x716d('0xe'),'validate':{'isEmail':!![]},'set':function(_0x37a9eb){if(_0x37a9eb){this[_0x716d('0x7')](_0x716d('0xe'),_0x37a9eb[_0x716d('0xf')]());}}},'role':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x11'),_0x716d('0x12'),_0x716d('0x13'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x716d('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x716d('0xd'),'set':function(_0xf55898){this['setDataValue'](_0x716d('0xd'),_0xf55898);this[_0x716d('0x7')](_0x716d('0x14'),_0xf55898);this[_0x716d('0x7')](_0x716d('0xa'),util[_0x716d('0xb')](_0x716d('0xc'),this[_0x716d('0x15')]('fullname'),_0xf55898));}},'salt':{'type':Sequelize[_0x716d('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x716d('0x5')]},'address':{'type':Sequelize[_0x716d('0x5')]},'zipcode':{'type':Sequelize[_0x716d('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x716d('0x5')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x716d('0x17')]},'voicePause':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x716d('0x18')},'lastPauseAt':{'type':Sequelize[_0x716d('0x17')]},'chatCapacity':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x716d('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x716d('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x1a'),_0x716d('0x12'),_0x716d('0x1b')),'allowNull':!![],'defaultValue':_0x716d('0x1a')},'context':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![],'defaultValue':_0x716d('0x1c')},'callingpres':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x1d'),_0x716d('0x1e'),_0x716d('0x1f'),_0x716d('0x20'),_0x716d('0x21'),_0x716d('0x22'),_0x716d('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0xf967b1){this['setDataValue'](_0x716d('0x24'),_0xf967b1?_0xf967b1[_0x716d('0x25')](','):null);},'get':function(){return this[_0x716d('0x15')]('transport')?this['getDataValue'](_0x716d('0x24'))['split'](','):null;},'comment':_0x716d('0x26')},'dtmfmode':{'type':Sequelize[_0x716d('0x10')]('rfc2833',_0x716d('0x27'),_0x716d('0x28'),'inband',_0x716d('0x29')),'allowNull':!![],'defaultValue':_0x716d('0x2a')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x716d('0x2b'),_0x716d('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x716d('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![],'defaultValue':_0x716d('0x2d'),'set':function(_0x16b177){this[_0x716d('0x7')]('nat',_0x16b177?_0x16b177[_0x716d('0x25')](','):null);},'get':function(){return this[_0x716d('0x15')](_0x716d('0x2e'))?this['getDataValue']('nat')[_0x716d('0x2f')](','):null;},'comment':_0x716d('0x30')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x716d('0x5')]},'pickupgroup':{'type':Sequelize[_0x716d('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x716d('0x5')]},'language':{'type':Sequelize[_0x716d('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x716d('0x5')],'allowNull':![],'defaultValue':_0x716d('0x31')},'allow':{'type':Sequelize[_0x716d('0x5')],'allowNull':![],'defaultValue':_0x716d('0x32'),'set':function(_0xa5d957){this['setDataValue'](_0x716d('0x33'),_0xa5d957?_0xa5d957[_0x716d('0x25')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x716d('0x15')](_0x716d('0x33'))?this[_0x716d('0x15')](_0x716d('0x33'))[_0x716d('0x2f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x716d('0x10')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![],'set':function(_0x5353ec){this[_0x716d('0x7')](_0x716d('0x34'),_0x5353ec?_0x5353ec[_0x716d('0x25')](','):null);},'get':function(){return this[_0x716d('0x15')]('insecure')?this[_0x716d('0x15')](_0x716d('0x34'))[_0x716d('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x716d('0x35'),'no',_0x716d('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x716d('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x716d('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![],'defaultValue':_0x716d('0x37')},'amaflags':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x716d('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0x716d('0x35')},'busylevel':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x716d('0x35'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x716d('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x39'),_0x716d('0x3a'),_0x716d('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x716d('0x3c'),_0x716d('0x3d')),'allowNull':!![],'defaultValue':_0x716d('0x3d')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x716d('0x35'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x716d('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x716d('0x35'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no','fingerprint',_0x716d('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x3f'),_0x716d('0x40'),_0x716d('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x716d('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x716d('0x35'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x716d('0x10')]('yes','no','nonat',_0x716d('0x2c'),_0x716d('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x716d('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x716d('0x17')]},'passwordResetAt':{'type':Sequelize[_0x716d('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0,'set':function(_0x7f3728){this[_0x716d('0x7')](_0x716d('0x43'),_0x7f3728);var _0x3cbfa6=this['get']({'plain':!![]});switch(_0x7f3728){case 0x0:case 0x1:var _0x17b22d=_0x3cbfa6[_0x716d('0x24')]?_[_0x716d('0x44')](_0x3cbfa6[_0x716d('0x24')])?_0x3cbfa6[_0x716d('0x24')][_0x716d('0x25')]():_0x3cbfa6['transport']:_0x716d('0x45');if(_0x17b22d===_0x716d('0x46')){_0x17b22d=_0x716d('0x45');}this['setDataValue'](_0x716d('0x24'),_0x17b22d);this[_0x716d('0x7')]('encryption','no');this['setDataValue'](_0x716d('0x47'),null);this[_0x716d('0x7')](_0x716d('0x48'),null);this['setDataValue']('icesupport',null);this[_0x716d('0x7')](_0x716d('0x49'),null);this[_0x716d('0x7')](_0x716d('0x4a'),null);this[_0x716d('0x7')](_0x716d('0x4b'),null);this[_0x716d('0x7')](_0x716d('0x4c'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x716d('0x7')](_0x716d('0x4d'),'no');break;case 0x2:this[_0x716d('0x7')]('transport',_0x716d('0x46'));this[_0x716d('0x7')](_0x716d('0x4e'),_0x716d('0x35'));this[_0x716d('0x7')](_0x716d('0x47'),_0x716d('0x35'));this[_0x716d('0x7')](_0x716d('0x48'),_0x716d('0x35'));this[_0x716d('0x7')]('icesupport',_0x716d('0x35'));this[_0x716d('0x7')](_0x716d('0x49'),_0x716d('0x35'));this['setDataValue'](_0x716d('0x4a'),'no');this[_0x716d('0x7')](_0x716d('0x4b'),_0x716d('0x41'));this[_0x716d('0x7')](_0x716d('0x4c'),_0x3cbfa6['dtlscertfile']||_0x716d('0x4f'));this[_0x716d('0x7')](_0x716d('0x50'),_0x3cbfa6['dtlsprivatekey']||_0x716d('0x51'));this[_0x716d('0x7')](_0x716d('0x4d'),_0x716d('0x35'));break;default:}}},'permissions':{'type':Sequelize[_0x716d('0x52')],'set':function(_0x5d3fa8){this[_0x716d('0x7')](_0x716d('0x53'),_0x5d3fa8?_0x5d3fa8[_0x716d('0x25')](','):[]);},'get':function(){return this[_0x716d('0x15')](_0x716d('0x53'))?_[_0x716d('0x54')](this[_0x716d('0x15')](_0x716d('0x53'))['split'](','),function(_0x977551){return parseInt(_0x977551,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x716d('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x716d('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x716d('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x716d('0x10')](_0x716d('0x35'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x716d('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x716d('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x716d('0x55')],'get':function(){return this[_0x716d('0x15')](_0x716d('0x56'))?this[_0x716d('0x15')](_0x716d('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x716d('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x716d('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![],'set':function(_0x12e033){if(typeof _0x12e033===_0x716d('0x57')){var _0x322845=_0x12e033==='1'?!![]:_0x12e033==='0'?![]:_0x12e033===_0x716d('0x58')?!![]:_0x12e033===_0x716d('0x59')?![]:![];this['setDataValue'](_0x716d('0x5a'),_0x322845);}else{this[_0x716d('0x7')](_0x716d('0x5a'),_0x12e033);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x271c90){this[_0x716d('0x7')](_0x716d('0x5b'),_0x271c90);if(_0x271c90===!![]){this[_0x716d('0x7')](_0x716d('0x5c'),moment());this[_0x716d('0x7')](_0x716d('0x5d'),0x0);}else{this[_0x716d('0x7')](_0x716d('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0x716d('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x716d('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x716d('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x716d('0x19')](0x5)[_0x716d('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x716d('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x716d('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a220e75..bc2ab05 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 _0xb016=['attributes','findAll','rows','true','length','chat','dataValues','push','fax','mail','openchannel','all','model','keys','filters','intersection','fields','options','openTabs','sms','whatsapp','body','params','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','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)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','agent','permissions','101','102','103','106','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','autoAssociation','compact','changePassword','oldPassword','Sequelize','authenticate','ValidationError','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','voice','VoiceQueue','format','SIP/%s','removeQueues','remove','isArray','emit','Queue:remove','UserVoiceQueueRt','userpic','file','filename','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','createdAt','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','sort','pick','merge','hasOwnProperty','CmList','Tags','color','tag','nolimit','getContacts','order','Queue','Queues','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','bulkCreate','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','getTeams','Team','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','penalty','Queue:save','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','Sms','Fax','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','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','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','isEmpty','lower','col','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','select','ui.','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','socket.io-emitter','redis','defaults','localhost','client','then','info','User,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','admin','Users','user','Agents','Telephones','telephone','map','value','includes','role','find','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','filter','password','where','User','query','includeAll','include'];(function(_0x48f29a,_0x1f9f1a){var _0x467232=function(_0xf1ae7e){while(--_0xf1ae7e){_0x48f29a['push'](_0x48f29a['shift']());}};_0x467232(++_0x1f9f1a);}(_0xb016,0x159));var _0x6b01=function(_0x2c7d16,_0x27a315){_0x2c7d16=_0x2c7d16-0x0;var _0x21d847=_0xb016[_0x2c7d16];return _0x21d847;};'use strict';var moment=require(_0x6b01('0x0'));var BPromise=require(_0x6b01('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x6b01('0x2'));var squel=require('squel');var jayson=require(_0x6b01('0x3'));var Redis=require(_0x6b01('0x4'));var authService=require(_0x6b01('0x5'));var qs=require(_0x6b01('0x6'));var logger=require('../../config/logger')(_0x6b01('0x7'));var utils=require(_0x6b01('0x8'));var config=require(_0x6b01('0x9'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0x6b01('0xa'))(new Redis(config[_0x6b01('0xb')]));require('./user.socket')['register'](socket);config[_0x6b01('0xb')]=_[_0x6b01('0xc')](config[_0x6b01('0xb')],{'host':_0x6b01('0xd'),'port':0x18eb});var client=jayson[_0x6b01('0xe')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x4b4a4d,_0x4627ef,_0x24049f,_0x2660c7){return new BPromise(function(_0x5a8817,_0x200614){var _0x5c54e4=_0x2660c7||client;return _0x5c54e4['request'](_0x4b4a4d,_0x24049f)[_0x6b01('0xf')](function(_0x4fa826){logger[_0x6b01('0x10')](_0x6b01('0x11'),_0x4627ef,'request\x20sent');logger[_0x6b01('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x4627ef,'request\x20sent',JSON['stringify'](_0x4fa826));if(_0x4fa826[_0x6b01('0x13')]){if(_0x4fa826['error']['code']===0x1f4){logger[_0x6b01('0x13')](_0x6b01('0x11'),_0x4627ef,_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x200614(_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);}logger[_0x6b01('0x13')](_0x6b01('0x11'),_0x4627ef,_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x5a8817(_0x4fa826[_0x6b01('0x13')]['message']);}else{logger[_0x6b01('0x10')](_0x6b01('0x11'),_0x4627ef,_0x6b01('0x15'));_0x5a8817(_0x4fa826[_0x6b01('0x16')][_0x6b01('0x14')]);}})[_0x6b01('0x17')](function(_0x33753f){logger[_0x6b01('0x13')]('User,\x20%s,\x20%s',_0x4627ef,_0x33753f);_0x200614(_0x33753f);});});}function respondWithStatusCode(_0x3029e2,_0xc1f453){_0xc1f453=_0xc1f453||0xcc;return function(_0x424cd3){if(_0x424cd3){return _0x3029e2[_0x6b01('0x18')](_0xc1f453);}return _0x3029e2[_0x6b01('0x19')](_0xc1f453)[_0x6b01('0x1a')]();};}function respondWithResult(_0x2cea6e,_0x542fab){_0x542fab=_0x542fab||0xc8;return function(_0x7caa07){if(_0x7caa07){return _0x2cea6e[_0x6b01('0x19')](_0x542fab)[_0x6b01('0x1b')](_0x7caa07);}};}function respondWithFilteredResult(_0x51243c,_0x399808){return function(_0x70a1c0){if(_0x70a1c0){var _0x304393=typeof _0x399808[_0x6b01('0x1c')]===_0x6b01('0x1d')&&typeof _0x399808[_0x6b01('0x1e')]===_0x6b01('0x1d');var _0x136452=_0x70a1c0[_0x6b01('0x1f')];var _0x152dda=_0x304393?0x0:_0x399808[_0x6b01('0x1c')];var _0xa846d8=_0x304393?_0x70a1c0[_0x6b01('0x1f')]:_0x399808['offset']+_0x399808[_0x6b01('0x1e')];var _0x220efb;if(_0xa846d8>=_0x136452){_0xa846d8=_0x136452;_0x220efb=0xc8;}else{_0x220efb=0xce;}_0x51243c[_0x6b01('0x19')](_0x220efb);return _0x51243c[_0x6b01('0x20')](_0x6b01('0x21'),_0x152dda+'-'+_0xa846d8+'/'+_0x136452)['json'](_0x70a1c0);}return null;};}function saveUpdates(_0x54f030){return function(_0x3fae61){if(_0x3fae61){return _0x3fae61[_0x6b01('0x22')](_0x54f030)[_0x6b01('0xf')](function(_0x8883d1){return _0x8883d1;});}return null;};}function removeEntity(_0x2a894e){return function(_0x25d38d){if(_0x25d38d){return _0x25d38d['destroy']()[_0x6b01('0xf')](function(){var _0x5482a8=_0x25d38d[_0x6b01('0x23')]({'plain':!![]});if(_0x5482a8['role']===_0x6b01('0x24'))return;var _0xa6b2b6=[{'name':_0x6b01('0x25'),'value':_0x6b01('0x26'),'ignore':!![]},{'name':_0x6b01('0x27'),'value':'agent','ignore':![]},{'name':_0x6b01('0x28'),'value':_0x6b01('0x29'),'ignore':![]}];var _0x3bb4b1=_(_0xa6b2b6)['filter']('ignore')[_0x6b01('0x2a')]('value')[_0x6b01('0x2b')]();if(_[_0x6b01('0x2c')](_0x3bb4b1,_0x5482a8[_0x6b01('0x2d')])){return;}var _0x536641=_[_0x6b01('0x2e')](_0xa6b2b6,[_0x6b01('0x2b'),_0x5482a8[_0x6b01('0x2d')]])['name'];return db[_0x6b01('0x2f')][_0x6b01('0x30')]({'where':{'type':_0x536641,'resourceId':_0x5482a8['id']}})[_0x6b01('0xf')](function(){return _0x25d38d;});})[_0x6b01('0xf')](function(){_0x2a894e[_0x6b01('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa041ea){return function(_0x20ee6d){if(!_0x20ee6d){_0xa041ea[_0x6b01('0x18')](0x194);}return _0x20ee6d;};}function handleError(_0x5269c7,_0xce4545){_0xce4545=_0xce4545||0x1f4;return function(_0xc644f2){logger[_0x6b01('0x13')](_0xc644f2[_0x6b01('0x31')]);if(_0xc644f2['name']){delete _0xc644f2[_0x6b01('0x32')];}_0x5269c7['status'](_0xce4545)[_0x6b01('0x33')](_0xc644f2);};}exports[_0x6b01('0x34')]=function(_0x1baac5,_0x318b8b){var _0x167d08={},_0x457c93={'count':0x0,'rows':[]};var _0x3df1d8=_(db['User'][_0x6b01('0x35')])[_0x6b01('0x2a')](function(_0x2c3385){return{'name':_0x2c3385[_0x6b01('0x36')],'type':_0x2c3385[_0x6b01('0x37')][_0x6b01('0x38')]};})[_0x6b01('0x39')](function(_0x44bf46){return!_['includes']([_0x6b01('0x3a'),'salt'],_0x44bf46[_0x6b01('0x32')]);})[_0x6b01('0x2b')]();_0x167d08=qs['getOptions'](_0x3df1d8,_0x1baac5);var _0x37ae5d={'where':_0x167d08[_0x6b01('0x3b')]};return db[_0x6b01('0x3c')][_0x6b01('0x1f')](_0x37ae5d)[_0x6b01('0xf')](function(_0x33a9ea){_0x457c93[_0x6b01('0x1f')]=_0x33a9ea;if(_0x1baac5[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x167d08[_0x6b01('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x167d08[_0x6b01('0x40')],'id')){_0x167d08[_0x6b01('0x40')]['push']('id');}return db['User'][_0x6b01('0x41')](_0x167d08);})[_0x6b01('0xf')](function(_0x558ec1){_0x457c93[_0x6b01('0x42')]=_0x558ec1;if(_0x1baac5[_0x6b01('0x3d')]['openTabs']===_0x6b01('0x43')){var _0x5e6f28=[];for(var _0x2ab117=0x0;_0x2ab117<_0x457c93[_0x6b01('0x42')][_0x6b01('0x44')];_0x2ab117++){_0x5e6f28['push'](get_open_tabs(_0x6b01('0x45'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28['push'](get_open_tabs('sms',_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28['push'](get_open_tabs(_0x6b01('0x49'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x4a'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28[_0x6b01('0x47')](get_open_tabs('whatsapp',_0x457c93['rows'][_0x2ab117][_0x6b01('0x46')]));}return BPromise[_0x6b01('0x4b')](_0x5e6f28)['then'](function(_0x408bb0){return _0x457c93;});}else{return _0x457c93;}})[_0x6b01('0xf')](respondWithFilteredResult(_0x318b8b,_0x167d08))[_0x6b01('0x17')](handleError(_0x318b8b,null));};exports['show']=function(_0x51eec0,_0x5545f6){var _0x24b860={'raw':![],'where':{'id':_0x51eec0['params']['id']}},_0x12160f={};_0x12160f[_0x6b01('0x4c')]=_['differenceBy'](_['keys'](db['User'][_0x6b01('0x35')]),[_0x6b01('0x3a'),'salt']);_0x12160f['query']=_[_0x6b01('0x4d')](_0x51eec0['query']);_0x12160f[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x12160f[_0x6b01('0x4c')],_0x12160f[_0x6b01('0x3d')]);_0x24b860[_0x6b01('0x40')]=_['intersection'](_0x12160f[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x51eec0[_0x6b01('0x3d')]['fields']));_0x24b860[_0x6b01('0x40')]=_0x24b860[_0x6b01('0x40')]['length']?_0x24b860[_0x6b01('0x40')]:_0x12160f[_0x6b01('0x4c')];if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x24b860['include']=[{'all':!![]}];}_0x24b860=_['merge']({},_0x24b860,_0x51eec0[_0x6b01('0x51')]);if(!_['includes'](_0x24b860['attributes'],'id')){_0x24b860[_0x6b01('0x40')][_0x6b01('0x47')]('id');}return db['User'][_0x6b01('0x2e')](_0x24b860)[_0x6b01('0xf')](handleEntityNotFound(_0x5545f6,null))['then'](function(_0x1bd851){var _0x1ce46d=[];values=_0x1bd851;if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x52')]===_0x6b01('0x43')){_0x1ce46d['push'](get_open_tabs(_0x6b01('0x45'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x53'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs(_0x6b01('0x4a'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x54'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs('mail',_0x1bd851[_0x6b01('0x46')]));return BPromise[_0x6b01('0x4b')](_0x1ce46d);}else{return values;}})[_0x6b01('0xf')](function(_0x4e1702){return values;})[_0x6b01('0xf')](respondWithResult(_0x5545f6,null))[_0x6b01('0x17')](handleError(_0x5545f6,null));};exports[_0x6b01('0x22')]=function(_0x5459d5,_0x54b3ae){if(_0x5459d5[_0x6b01('0x55')]['id']){delete _0x5459d5[_0x6b01('0x55')]['id'];}delete _0x5459d5['body'][_0x6b01('0x2d')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5459d5[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x54b3ae,null))[_0x6b01('0xf')](saveUpdates(_0x5459d5[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x54b3ae,null))[_0x6b01('0x17')](handleError(_0x54b3ae,null));};exports['describe']=function(_0x2aa892,_0x204a9a){return db[_0x6b01('0x3c')][_0x6b01('0x57')]()[_0x6b01('0xf')](respondWithResult(_0x204a9a,null))[_0x6b01('0x17')](handleError(_0x204a9a,null));};exports[_0x6b01('0x58')]=function(_0x289294,_0x281e55){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x289294[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x281e55,null))[_0x6b01('0xf')](function(_0xef971f){if(_0xef971f){return _0xef971f[_0x6b01('0x58')](_0x289294['body']['ids'],_[_0x6b01('0x59')](_0x289294[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x281e55,null))[_0x6b01('0x17')](handleError(_0x281e55,null));};function validateUser(_0x41e8dc){return new BPromise(function(_0x59bf90,_0x2bd87d){if(_0x41e8dc[_0x6b01('0x5b')])return _0x59bf90(_0x41e8dc);return db[_0x6b01('0x5c')][_0x6b01('0x5d')](0x1)[_0x6b01('0xf')](function(_0xf31bfa){if(_0xf31bfa[_0x6b01('0x5e')])authService['validatePasswordPattern'](_0x41e8dc[_0x6b01('0x3a')]);db['User'][_0x6b01('0x5f')](_0x6b01('0x5b'))[_0x6b01('0xf')](function(_0x48bfcd){if(_[_0x6b01('0x60')](_0x48bfcd)){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')]||0x1;return;}if(_[_0x6b01('0x60')](_0xf31bfa[_0x6b01('0x61')])||_0xf31bfa[_0x6b01('0x61')]===_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0x48bfcd+0x1;return;}if(_0xf31bfa[_0x6b01('0x61')]>_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];return;}return db[_0x6b01('0x62')][_0x6b01('0x3d')](_0x6b01('0x63'),{'type':db[_0x6b01('0x62')][_0x6b01('0x64')][_0x6b01('0x65')]})[_0x6b01('0xf')](function(_0x3f077f){if(_0x3f077f&&_0x3f077f[_0x6b01('0x44')]){for(var _0x4a8fcb=0x0,_0x27526f=_0x3f077f[_0x6b01('0x44')];_0x4a8fcb<_0x27526f&&_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')]);_0x4a8fcb++){if(_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]){_0x41e8dc[_0x6b01('0x5b')]=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')];}else if(_0xf31bfa[_0x6b01('0x61')]>_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]&&_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb]['to']){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];}}}if(_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')])){_0x41e8dc['internal']=_0x48bfcd+0x1;}return _0x59bf90(_0x41e8dc);});});})[_0x6b01('0x17')](function(_0x2d42ec){_0x2bd87d(_0x2d42ec);});});}function updateUser(_0x19a6d9){return new BPromise(function(_0x3ec668,_0x191348){try{if(_0x19a6d9[_0x6b01('0x67')]){_0x19a6d9[_0x6b01('0x68')]=_0x19a6d9[_0x6b01('0x5b')];_0x19a6d9[_0x6b01('0x69')]={'mailbox':_0x19a6d9[_0x6b01('0x5b')],'password':_0x19a6d9[_0x6b01('0x3a')],'fullname':_0x19a6d9[_0x6b01('0x6a')],'email':_0x19a6d9[_0x6b01('0x6b')]};}if(_0x19a6d9[_0x6b01('0x2d')]===_0x6b01('0x6c')){if(!_0x19a6d9[_0x6b01('0x6d')])_0x19a6d9[_0x6b01('0x6d')]=[_0x6b01('0x6e'),_0x6b01('0x6f'),_0x6b01('0x70'),'113','110','104','105',_0x6b01('0x71'),'107','108','109',_0x6b01('0x72'),'111',_0x6b01('0x73'),_0x6b01('0x74')];}_0x3ec668(_0x19a6d9);}catch(_0x44ac98){_0x191348(_0x44ac98);}});}exports[_0x6b01('0x75')]=function(_0x3bd5d3,_0x59f807){if(_0x3bd5d3['user'][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_0x3bd5d3['body'][_0x6b01('0x2d')]===_0x6b01('0x26')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bd5d3[_0x6b01('0x55')]['role']===_0x6b01('0x24')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x77'));}return licenseUtil['checkUserLimits']([_0x3bd5d3[_0x6b01('0x55')]])[_0x6b01('0xf')](function(){return validateUser(_0x3bd5d3[_0x6b01('0x55')]);})[_0x6b01('0xf')](function(_0x4dbd69){return updateUser(_0x4dbd69)[_0x6b01('0xf')](function(_0x27c738){if(_0x27c738[_0x6b01('0x2d')]===_0x6b01('0x24')){_0x27c738[_0x6b01('0x78')]=_0x3bd5d3[_0x6b01('0x26')]['settingsEnabled'];delete _0x27c738['userProfileId'];}return _0x27c738;});})['then'](function(_0x16fa3b){return db[_0x6b01('0x3c')]['create'](_0x16fa3b,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]});})[_0x6b01('0xf')](function(_0x2c2c1c){if(_0x3bd5d3['body'][_0x6b01('0x2d')]==='user')return _0x2c2c1c;if(_0x3bd5d3[_0x6b01('0x26')]['role']!==_0x6b01('0x26'))return _0x2c2c1c;return db['UserProfileSection'][_0x6b01('0x2e')]({'where':{'name':_0x2c2c1c[_0x6b01('0x2d')]===_0x6b01('0x6c')?_0x6b01('0x27'):_0x6b01('0x28'),'userProfileId':_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})['then'](function(_0xc8f10){if(!_0xc8f10||_0xc8f10['autoAssociation']!=0x0)return _0x2c2c1c;return db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x2c2c1c[_0x6b01('0x32')],'resourceId':_0x2c2c1c['id'],'type':_0xc8f10[_0x6b01('0x32')],'sectionId':_0xc8f10['id']},{})[_0x6b01('0xf')](function(){return _0x2c2c1c;});})[_0x6b01('0x17')](function(_0x30ac0c){logger[_0x6b01('0x13')](_0x6b01('0x7a'),_0x30ac0c);throw _0x30ac0c;});})[_0x6b01('0xf')](respondWithResult(_0x59f807,0xc9))[_0x6b01('0x17')](handleError(_0x59f807,null));};exports['bulkCreate']=function(_0x1e9300,_0x4091a8){var _0x197c8d=_0x1e9300[_0x6b01('0x55')];var _0x5ac0b6=[];if(_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_[_0x6b01('0x7b')](_0x197c8d,['role',_0x6b01('0x26')])&&_0x1e9300['user'][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7c'));}if(_[_0x6b01('0x7b')](_0x197c8d,[_0x6b01('0x2d'),_0x6b01('0x24')])&&_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7d'));}return licenseUtil[_0x6b01('0x7e')](_0x197c8d)[_0x6b01('0xf')](function(){return validateUser(_0x197c8d[0x0]);})[_0x6b01('0xf')](function(){for(var _0x748219=0x1;_0x748219<_0x197c8d['length'];_0x748219++){var _0x2f180=_0x197c8d[_0x748219-0x1]['internal'];if(!_0x197c8d[_0x748219]['internal'])_0x197c8d[_0x748219][_0x6b01('0x5b')]=_0x2f180+0x1;_0x5ac0b6[_0x6b01('0x47')](validateUser(_0x197c8d[_0x748219]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})[_0x6b01('0xf')](function(){_0x5ac0b6=[];for(var _0x5dc77c=0x0;_0x5dc77c<_0x197c8d[_0x6b01('0x44')];_0x5dc77c++){_0x5ac0b6[_0x6b01('0x47')](updateUser(_0x197c8d[_0x5dc77c]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})['then'](function(){return BPromise[_0x6b01('0x7f')](_0x197c8d,function(_0x327f31){return db[_0x6b01('0x3c')][_0x6b01('0x75')](_0x327f31,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]})[_0x6b01('0xf')](function(_0x21b294){_0x327f31['id']=_0x21b294['id'];return _0x327f31;});});})['then'](function(_0x135aeb){if(_0x1e9300[_0x6b01('0x55')][_0x6b01('0x2d')]===_0x6b01('0x26'))return _0x135aeb;if(_0x1e9300['user']['role']!==_0x6b01('0x26'))return _0x135aeb;var _0x191fc0=_[_0x6b01('0x7b')](_0x135aeb,function(_0xcd8de3){return _0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x6c')||_0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x29');});if(!_0x191fc0)return _0x135aeb;return db['UserProfileSection'][_0x6b01('0x41')]({'where':{'name':{'$or':[_0x6b01('0x27'),_0x6b01('0x28')]},'userProfileId':_0x1e9300[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})[_0x6b01('0xf')](function(_0x188010){if(_['isEmpty'](_0x188010)||!_[_0x6b01('0x7b')](_0x188010,['autoAssociation',0x0]))return _0x135aeb;_0x5ac0b6=[];var _0xe9de3b=_(_0x188010)[_0x6b01('0x2a')](function(_0x16f234){if(_0x16f234[_0x6b01('0x80')]===0x1)return;return _0x16f234[_0x6b01('0x32')]==='Agents'?_0x6b01('0x6c'):'telephone';})[_0x6b01('0x81')]()[_0x6b01('0x2b')]();for(var _0x59141e=0x0;_0x59141e<_0x135aeb[_0x6b01('0x44')];_0x59141e++){if(!_[_0x6b01('0x2c')](_0xe9de3b,_0x135aeb[_0x59141e][_0x6b01('0x2d')]))return;var _0x2cc3eb=_0x135aeb[_0x59141e][_0x6b01('0x2d')]==='agent'?'Agents':_0x6b01('0x28');_0x5ac0b6[_0x6b01('0x47')](db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x135aeb[_0x59141e][_0x6b01('0x32')],'resourceId':_0x135aeb[_0x59141e]['id'],'type':_0x2cc3eb,'sectionId':_[_0x6b01('0x2e')](_0x188010,[_0x6b01('0x32'),_0x2cc3eb])['id']},{}));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);});})[_0x6b01('0xf')](respondWithResult(_0x4091a8,0xc9))['catch'](handleError(_0x4091a8,null));};exports[_0x6b01('0x82')]=function(_0x5ee5ed,_0x7ac756){if(_0x5ee5ed['body']['id']){delete _0x5ee5ed[_0x6b01('0x55')]['id'];}return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5ee5ed['params']['id']}})[_0x6b01('0xf')](function(_0xa9cd5f){if(!_0xa9cd5f)return null;if(_0xa9cd5f['id']===_0x5ee5ed[_0x6b01('0x26')]['id']){if(!_0x5ee5ed['body'][_0x6b01('0x83')]||!_0x5ee5ed[_0x6b01('0x55')]['newPassword']){throw new db[(_0x6b01('0x84'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xa9cd5f[_0x6b01('0x85')](_0x5ee5ed[_0x6b01('0x55')]['oldPassword'])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Wrong\x20credentials');}if(_0x5ee5ed['body'][_0x6b01('0x83')]===_0x5ee5ed['body'][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x88'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x24')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x26')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}if(_0xa9cd5f[_0x6b01('0x2d')]!=='agent'){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}}else{throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}return _0xa9cd5f;})[_0x6b01('0xf')](handleEntityNotFound(_0x7ac756,null))[_0x6b01('0xf')](function(_0x5736fe){return db[_0x6b01('0x5c')][_0x6b01('0x8a')]({'attributes':['id','securePassword',_0x6b01('0x8b'),_0x6b01('0x8c')]})[_0x6b01('0xf')](function(_0x51f42e){if(_0x51f42e[_0x6b01('0x5e')])authService[_0x6b01('0x8d')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]);if(!_0x51f42e['enforcePasswordHistory']||!_0x5736fe['previousPasswords'])return _0x5736fe;authService[_0x6b01('0x8e')](_0x5ee5ed[_0x6b01('0x55')]['newPassword'],_0x5736fe[_0x6b01('0x8f')],_0x51f42e[_0x6b01('0x8c')]);return _0x5736fe;})[_0x6b01('0xf')](saveUpdates({'password':_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],'passwordResetAt':_0x5ee5ed[_0x6b01('0x26')]['id']==_0x5ee5ed['params']['id']?moment():null,'previousPasswords':authService[_0x6b01('0x90')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],_0x5736fe[_0x6b01('0x8f')])},null));})[_0x6b01('0xf')](respondWithResult(_0x7ac756,null))[_0x6b01('0x17')](handleError(_0x7ac756,null));};exports['addQueues']=function(_0x471015,_0x3db037){var _0x59cdd1=_0x471015[_0x6b01('0x55')][_0x6b01('0x91')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x471015[_0x6b01('0x56')]['id']},'attributes':['id','name',_0x6b01('0x2d'),_0x6b01('0x92'),_0x6b01('0x93'),_0x6b01('0x94'),_0x6b01('0x95')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3db037,null))[_0x6b01('0xf')](function(_0x19167c){if(_0x19167c){if(!utils[_0x6b01('0x96')](_0x59cdd1)){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x97'));}return _0x19167c[_0x6b01('0x98')+_[_0x6b01('0x99')](_0x59cdd1[_0x6b01('0x9a')]())+'Queues'](_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')],{'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0})[_0x6b01('0x9b')](function(_0x2877ea){for(var _0x424865=0x0;_0x424865<_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x424865+=0x1){var _0x4ade00={'UserId':Number(_0x471015['params']['id'])};_0x4ade00[_['capitalize'](_0x59cdd1['toLowerCase']())+_0x6b01('0x9c')]=Number(_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x424865]);socket['emit'](_0x6b01('0x26')+_['capitalize'](_0x59cdd1[_0x6b01('0x9a')]())+'Queue:save',_0x4ade00);}return _0x2877ea;})[_0x6b01('0xf')](function(){if(_0x59cdd1===_0x6b01('0x9d')){return db[_0x6b01('0x9e')][_0x6b01('0x41')]({'where':{'id':_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')]||[]},'raw':!![],'attributes':['id',_0x6b01('0x32')]});}})[_0x6b01('0xf')](function(_0x353f84){var _0x4ad87a=_0x19167c['get']({'plain':!![]});var _0x40aaaa=[];if(_0x59cdd1===_0x6b01('0x9d')&&_0x4ad87a[_0x6b01('0x2d')]==='agent'&&_0x4ad87a['online']){for(var _0x446b91=0x0;_0x446b91<_0x353f84['length'];_0x446b91+=0x1){_0x40aaaa[_0x6b01('0x47')]({'membername':_0x4ad87a[_0x6b01('0x32')],'UserId':_0x4ad87a['id'],'queue_name':_0x353f84[_0x446b91][_0x6b01('0x32')],'VoiceQueueId':_0x353f84[_0x446b91]['id'],'interface':_[_0x6b01('0x60')](_0x4ad87a[_0x6b01('0x95')])?util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0x4ad87a[_0x6b01('0x32')]):_0x4ad87a[_0x6b01('0x95')],'paused':_0x4ad87a[_0x6b01('0x94')]||![],'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0});}return BPromise[_0x6b01('0x7f')](_0x40aaaa,function(_0x52d6b4){return db['UserVoiceQueueRt']['upsert'](_0x52d6b4);});}return _0x19167c;});}})[_0x6b01('0xf')](respondWithStatusCode(_0x3db037,null))['catch'](handleError(_0x3db037,null));};exports[_0x6b01('0xa1')]=function(_0x33b13f,_0x3a8609){var _0x26aa9b;return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x33b13f[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3a8609,null))[_0x6b01('0xf')](function(_0x14df77){if(_0x14df77){_0x26aa9b=_0x14df77;if(!_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]||!utils[_0x6b01('0x96')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Unknown\x20channel');}return _0x14df77[_0x6b01('0xa2')+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]['toLowerCase']())+'Queues'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](function(_0x34adde){if(_[_0x6b01('0xa3')](_0x33b13f[_0x6b01('0x3d')]['ids'])){for(var _0x5a7af0=0x0;_0x5a7af0<_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x5a7af0+=0x1){var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+'QueueId']=Number(_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x5a7af0]);socket[_0x6b01('0xa4')](_0x6b01('0x26')+_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel']['toLowerCase']())+'Queue:remove',_0x293fc0);}}else{var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel'][_0x6b01('0x9a')]())+_0x6b01('0x9c')]=Number(_0x33b13f['query'][_0x6b01('0x5a')]);socket['emit']('user'+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+_0x6b01('0xa5'),_0x293fc0);}return _0x34adde;})['then'](function(){if(_0x33b13f['query'][_0x6b01('0x91')]===_0x6b01('0x9d')){return db[_0x6b01('0xa6')][_0x6b01('0x30')]({'where':{'UserId':_0x33b13f['params']['id'],'VoiceQueueId':_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]},'individualHooks':!![]})[_0x6b01('0xf')](function(){return _0x26aa9b;});}return _0x26aa9b;})[_0x6b01('0xf')](respondWithStatusCode(_0x3a8609,null))[_0x6b01('0x17')](handleError(_0x3a8609,null));};exports['addAvatar']=function(_0x5175a7,_0x490a27){_0x5175a7['body'][_0x6b01('0xa7')]=_0x5175a7[_0x6b01('0xa8')][_0x6b01('0xa9')];return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x5175a7[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x490a27,null))[_0x6b01('0xf')](saveUpdates(_0x5175a7[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x490a27,null))[_0x6b01('0x17')](handleError(_0x490a27,null));};exports['getAvatar']=function(_0x1b8867,_0x7e66c2){var _0x141cfc=path[_0x6b01('0xaa')](config[_0x6b01('0xab')],'server/files/images/logos/default_profile.png');return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1b8867[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0xa7')],'raw':!![]})[_0x6b01('0xf')](handleEntityNotFound(_0x7e66c2,null))['then'](function(_0x34b8b4){if(_0x34b8b4){if(_[_0x6b01('0x60')](_0x34b8b4[_0x6b01('0xa7')])){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}else{if(!fs[_0x6b01('0xad')](path['join'](config[_0x6b01('0xab')],'server/files/images/',_0x34b8b4[_0x6b01('0xa7')]))){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}return _0x7e66c2['download'](path[_0x6b01('0xaa')](config[_0x6b01('0xab')],_0x6b01('0xae'),_0x34b8b4[_0x6b01('0xa7')]));}}})['catch'](handleError(_0x7e66c2,null));};exports[_0x6b01('0xaf')]=function(_0x2dcae8,_0x5bab46){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x2dcae8[_0x6b01('0x56')]['id']},'attributes':['id']})[_0x6b01('0xf')](handleEntityNotFound(_0x5bab46,null))[_0x6b01('0xf')](function(_0x45f78f){var _0x463454=[];values=_0x45f78f[_0x6b01('0x46')];_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x45'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('sms',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('openchannel',_0x45f78f[_0x6b01('0x46')]));_0x463454['push'](get_open_tabs('whatsapp',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x49'),_0x45f78f['dataValues']));return BPromise[_0x6b01('0x4b')](_0x463454);})['then'](function(_0x1b2744){var _0x24d53f=[];if(_0x1b2744){for(var _0x3f782a=0x0;_0x3f782a=_0x1e394f){_0x45c4a0=_0x1e394f;_0x18bdbb=0xc8;}else{_0x18bdbb=0xce;}_0x2c47c5[_0xee2f('0x1a')](_0x18bdbb);return _0x2c47c5[_0xee2f('0x21')](_0xee2f('0x22'),_0x168adc+'-'+_0x45c4a0+'/'+_0x1e394f)[_0xee2f('0x1c')](_0x70e308);}return null;};}function saveUpdates(_0x3737fd){return function(_0x4d8398){if(_0x4d8398){return _0x4d8398[_0xee2f('0x23')](_0x3737fd)['then'](function(_0x235697){return _0x235697;});}return null;};}function removeEntity(_0x180429){return function(_0x25ee9c){if(_0x25ee9c){return _0x25ee9c[_0xee2f('0x24')]()[_0xee2f('0xf')](function(){var _0x47d5a6=_0x25ee9c[_0xee2f('0x25')]({'plain':!![]});if(_0x47d5a6[_0xee2f('0x26')]==='admin')return;var _0x4ee0e1=[{'name':_0xee2f('0x27'),'value':'user','ignore':!![]},{'name':_0xee2f('0x28'),'value':_0xee2f('0x29'),'ignore':![]},{'name':'Telephones','value':_0xee2f('0x2a'),'ignore':![]}];var _0x5ca9f6=_(_0x4ee0e1)['filter']('ignore')[_0xee2f('0x2b')](_0xee2f('0x2c'))['value']();if(_[_0xee2f('0x2d')](_0x5ca9f6,_0x47d5a6[_0xee2f('0x26')])){return;}var _0xd64b7=_[_0xee2f('0x2e')](_0x4ee0e1,[_0xee2f('0x2c'),_0x47d5a6['role']])[_0xee2f('0x2f')];return db['UserProfileResource'][_0xee2f('0x24')]({'where':{'type':_0xd64b7,'resourceId':_0x47d5a6['id']}})[_0xee2f('0xf')](function(){return _0x25ee9c;});})[_0xee2f('0xf')](function(){_0x180429['status'](0xcc)[_0xee2f('0x1b')]();});}};}function handleEntityNotFound(_0x5ed71e){return function(_0xd3aaa9){if(!_0xd3aaa9){_0x5ed71e['sendStatus'](0x194);}return _0xd3aaa9;};}function handleError(_0x3e6dcc,_0x13a824){_0x13a824=_0x13a824||0x1f4;return function(_0x13149e){logger[_0xee2f('0x15')](_0x13149e[_0xee2f('0x30')]);if(_0x13149e[_0xee2f('0x2f')]){delete _0x13149e[_0xee2f('0x2f')];}_0x3e6dcc[_0xee2f('0x1a')](_0x13a824)[_0xee2f('0x31')](_0x13149e);};}exports[_0xee2f('0x32')]=function(_0x433547,_0x5ad0a7){var _0x4584b8={},_0x47e54b={'count':0x0,'rows':[]};var _0x46166f=_(db[_0xee2f('0x33')][_0xee2f('0x34')])[_0xee2f('0x2b')](function(_0xaddf3b){return{'name':_0xaddf3b[_0xee2f('0x35')],'type':_0xaddf3b[_0xee2f('0x36')][_0xee2f('0x37')]};})['filter'](function(_0x562d58){return!_['includes']([_0xee2f('0x38'),'salt'],_0x562d58[_0xee2f('0x2f')]);})['value']();_0x4584b8=qs['getOptions'](_0x46166f,_0x433547);var _0x5027a6={'where':_0x4584b8['where']};return db[_0xee2f('0x33')][_0xee2f('0x20')](_0x5027a6)[_0xee2f('0xf')](function(_0x268775){_0x47e54b['count']=_0x268775;if(_0x433547['query'][_0xee2f('0x39')]){_0x4584b8['include']=[{'all':!![]}];}if(!_['includes'](_0x4584b8[_0xee2f('0x3a')],'id')){_0x4584b8[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x3c')](_0x4584b8);})[_0xee2f('0xf')](function(_0x19bd4d){_0x47e54b['rows']=_0x19bd4d;if(_0x433547['query'][_0xee2f('0x3d')]===_0xee2f('0x3e')){var _0x3bf382=[];for(var _0x2b9b33=0x0;_0x2b9b33<_0x47e54b['rows'][_0xee2f('0x3f')];_0x2b9b33++){_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x40'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs('fax',_0x47e54b['rows'][_0x2b9b33]['dataValues']));_0x3bf382['push'](get_open_tabs(_0xee2f('0x44'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x47e54b['rows'][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33]['dataValues']));}return BPromise['all'](_0x3bf382)['then'](function(_0x1609f0){return _0x47e54b;});}else{return _0x47e54b;}})['then'](respondWithFilteredResult(_0x5ad0a7,_0x4584b8))['catch'](handleError(_0x5ad0a7,null));};exports['show']=function(_0x5f39b4,_0x3834d1){var _0x3ebb54={'raw':![],'where':{'id':_0x5f39b4['params']['id']}},_0x32da72={};_0x32da72[_0xee2f('0x47')]=_['differenceBy'](_[_0xee2f('0x48')](db[_0xee2f('0x33')][_0xee2f('0x34')]),[_0xee2f('0x38'),_0xee2f('0x49')]);_0x32da72['query']=_['keys'](_0x5f39b4[_0xee2f('0x4a')]);_0x32da72['filters']=_[_0xee2f('0x4b')](_0x32da72[_0xee2f('0x47')],_0x32da72[_0xee2f('0x4a')]);_0x3ebb54[_0xee2f('0x3a')]=_['intersection'](_0x32da72['model'],qs[_0xee2f('0x4c')](_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x4c')]));_0x3ebb54[_0xee2f('0x3a')]=_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3f')]?_0x3ebb54[_0xee2f('0x3a')]:_0x32da72[_0xee2f('0x47')];if(_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x39')]){_0x3ebb54[_0xee2f('0x4d')]=[{'all':!![]}];}_0x3ebb54=_[_0xee2f('0x4e')]({},_0x3ebb54,_0x5f39b4['options']);if(!_[_0xee2f('0x2d')](_0x3ebb54[_0xee2f('0x3a')],'id')){_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x2e')](_0x3ebb54)[_0xee2f('0xf')](handleEntityNotFound(_0x3834d1,null))[_0xee2f('0xf')](function(_0xda9ad5){var _0xa88c4c=[];values=_0xda9ad5;if(_0x5f39b4['query'][_0xee2f('0x3d')]==='true'){_0xa88c4c['push'](get_open_tabs(_0xee2f('0x40'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0xda9ad5['dataValues']));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0xda9ad5[_0xee2f('0x42')]));return BPromise['all'](_0xa88c4c);}else{return values;}})[_0xee2f('0xf')](function(_0x4b9d29){return values;})[_0xee2f('0xf')](respondWithResult(_0x3834d1,null))[_0xee2f('0x18')](handleError(_0x3834d1,null));};exports[_0xee2f('0x23')]=function(_0x11ba31,_0x2f3891){if(_0x11ba31['body']['id']){delete _0x11ba31[_0xee2f('0x50')]['id'];}delete _0x11ba31[_0xee2f('0x50')][_0xee2f('0x26')];return db[_0xee2f('0x33')]['find']({'where':{'id':_0x11ba31['params']['id']}})['then'](handleEntityNotFound(_0x2f3891,null))['then'](saveUpdates(_0x11ba31['body'],null))[_0xee2f('0xf')](respondWithResult(_0x2f3891,null))['catch'](handleError(_0x2f3891,null));};exports[_0xee2f('0x51')]=function(_0x1421da,_0xd967e9){return db[_0xee2f('0x33')][_0xee2f('0x51')]()[_0xee2f('0xf')](respondWithResult(_0xd967e9,null))['catch'](handleError(_0xd967e9,null));};exports['addContacts']=function(_0x1708c5,_0x58e464){return db[_0xee2f('0x33')]['find']({'where':{'id':_0x1708c5[_0xee2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x58e464,null))[_0xee2f('0xf')](function(_0x38616b){if(_0x38616b){return _0x38616b[_0xee2f('0x53')](_0x1708c5['body'][_0xee2f('0x54')],_[_0xee2f('0x55')](_0x1708c5[_0xee2f('0x50')],[_0xee2f('0x54'),'id'])||{});}})[_0xee2f('0xf')](respondWithResult(_0x58e464,null))[_0xee2f('0x18')](handleError(_0x58e464,null));};function validateUser(_0xf0c721){return new BPromise(function(_0x54f48f,_0x3ee766){if(_0xf0c721[_0xee2f('0x56')])return _0x54f48f(_0xf0c721);return db[_0xee2f('0x57')][_0xee2f('0x58')](0x1)[_0xee2f('0xf')](function(_0x3c9d47){if(_0x3c9d47[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0xf0c721[_0xee2f('0x38')]);db[_0xee2f('0x33')][_0xee2f('0x5b')]('internal')[_0xee2f('0xf')](function(_0xf15bc1){if(_['isNil'](_0xf15bc1)){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47['min_internal']||0x1;return;}if(_[_0xee2f('0x5c')](_0x3c9d47['min_internal'])||_0x3c9d47['min_internal']===_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;return;}if(_0x3c9d47[_0xee2f('0x5d')]>_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];return;}return db[_0xee2f('0x5e')]['query'](_0xee2f('0x5f'),{'type':db[_0xee2f('0x5e')][_0xee2f('0x60')]['SELECT']})[_0xee2f('0xf')](function(_0x413d70){if(_0x413d70&&_0x413d70['length']){for(var _0x1f1c55=0x0,_0x32800d=_0x413d70[_0xee2f('0x3f')];_0x1f1c55<_0x32800d&&_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')]);_0x1f1c55++){if(_0x3c9d47[_0xee2f('0x5d')]<=_0x413d70[_0x1f1c55][_0xee2f('0x61')]){_0xf0c721[_0xee2f('0x56')]=_0x413d70[_0x1f1c55][_0xee2f('0x61')];}else if(_0x3c9d47['min_internal']>_0x413d70[_0x1f1c55]['from']&&_0x3c9d47['min_internal']<=_0x413d70[_0x1f1c55]['to']){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];}}}if(_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')])){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;}return _0x54f48f(_0xf0c721);});});})['catch'](function(_0x2b69f0){_0x3ee766(_0x2b69f0);});});}function updateUser(_0x3a4464){return new BPromise(function(_0x4e39ba,_0x2c4a18){try{if(_0x3a4464[_0xee2f('0x62')]){_0x3a4464[_0xee2f('0x63')]=_0x3a4464['internal'];_0x3a4464[_0xee2f('0x64')]={'mailbox':_0x3a4464['internal'],'password':_0x3a4464[_0xee2f('0x38')],'fullname':_0x3a4464[_0xee2f('0x65')],'email':_0x3a4464['email']};}if(_0x3a4464[_0xee2f('0x26')]===_0xee2f('0x29')){if(!_0x3a4464['permissions'])_0x3a4464['permissions']=['101',_0xee2f('0x66'),'103','113',_0xee2f('0x67'),_0xee2f('0x68'),'105',_0xee2f('0x69'),'107',_0xee2f('0x6a'),_0xee2f('0x6b'),_0xee2f('0x6c'),_0xee2f('0x6d'),_0xee2f('0x6e'),_0xee2f('0x6f')];}_0x4e39ba(_0x3a4464);}catch(_0x20990f){_0x2c4a18(_0x20990f);}});}exports['create']=function(_0x86eb61,_0x2989a8){if(_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error('Unauthorized');if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]===_0xee2f('0x70')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x86eb61['body'][_0xee2f('0x26')]===_0xee2f('0x71')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x72'));}return licenseUtil[_0xee2f('0x73')]([_0x86eb61['body']])['then'](function(){return validateUser(_0x86eb61[_0xee2f('0x50')]);})[_0xee2f('0xf')](function(_0x12c4f9){return updateUser(_0x12c4f9)[_0xee2f('0xf')](function(_0x38ee46){if(_0x38ee46[_0xee2f('0x26')]===_0xee2f('0x71')){_0x38ee46[_0xee2f('0x74')]=_0x86eb61[_0xee2f('0x70')][_0xee2f('0x74')];delete _0x38ee46[_0xee2f('0x75')];}return _0x38ee46;});})[_0xee2f('0xf')](function(_0x563d01){return db['User'][_0xee2f('0x76')](_0x563d01,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x5a1fdc){if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]==='user')return _0x5a1fdc;if(_0x86eb61['user'][_0xee2f('0x26')]!==_0xee2f('0x70'))return _0x5a1fdc;return db[_0xee2f('0x77')]['find']({'where':{'name':_0x5a1fdc['role']===_0xee2f('0x29')?_0xee2f('0x28'):_0xee2f('0x78'),'userProfileId':_0x86eb61['user'][_0xee2f('0x75')]},'raw':!![]})['then'](function(_0x1afacf){if(!_0x1afacf||_0x1afacf['autoAssociation']!=0x0)return _0x5a1fdc;return db[_0xee2f('0x79')][_0xee2f('0x76')]({'name':_0x5a1fdc[_0xee2f('0x2f')],'resourceId':_0x5a1fdc['id'],'type':_0x1afacf['name'],'sectionId':_0x1afacf['id']},{})['then'](function(){return _0x5a1fdc;});})[_0xee2f('0x18')](function(_0x4448a6){logger[_0xee2f('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4448a6);throw _0x4448a6;});})[_0xee2f('0xf')](respondWithResult(_0x2989a8,0xc9))[_0xee2f('0x18')](handleError(_0x2989a8,null));};exports[_0xee2f('0x7a')]=function(_0x346fc2,_0x413340){var _0x2c14f=_0x346fc2[_0xee2f('0x50')];var _0x16326e=[];if(_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error(_0xee2f('0x7b'));if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),'user'])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7d'));}if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),_0xee2f('0x71')])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7e'));}return licenseUtil['checkUserLimits'](_0x2c14f)[_0xee2f('0xf')](function(){return validateUser(_0x2c14f[0x0]);})[_0xee2f('0xf')](function(){for(var _0x1422e9=0x1;_0x1422e9<_0x2c14f[_0xee2f('0x3f')];_0x1422e9++){var _0x53d769=_0x2c14f[_0x1422e9-0x1][_0xee2f('0x56')];if(!_0x2c14f[_0x1422e9][_0xee2f('0x56')])_0x2c14f[_0x1422e9][_0xee2f('0x56')]=_0x53d769+0x1;_0x16326e['push'](validateUser(_0x2c14f[_0x1422e9]));}return BPromise['all'](_0x16326e);})[_0xee2f('0xf')](function(){_0x16326e=[];for(var _0x48fe47=0x0;_0x48fe47<_0x2c14f['length'];_0x48fe47++){_0x16326e['push'](updateUser(_0x2c14f[_0x48fe47]));}return BPromise[_0xee2f('0x7f')](_0x16326e);})[_0xee2f('0xf')](function(){return BPromise[_0xee2f('0x80')](_0x2c14f,function(_0x172cee){return db['User'][_0xee2f('0x76')](_0x172cee,{'include':[{'model':db[_0xee2f('0x64')],'as':_0xee2f('0x64')}]})['then'](function(_0x20e5db){_0x172cee['id']=_0x20e5db['id'];return _0x172cee;});});})['then'](function(_0x150445){if(_0x346fc2['body']['role']===_0xee2f('0x70'))return _0x150445;if(_0x346fc2['user'][_0xee2f('0x26')]!=='user')return _0x150445;var _0x4e585b=_[_0xee2f('0x7c')](_0x150445,function(_0x20bc03){return _0x20bc03['role']===_0xee2f('0x29')||_0x20bc03[_0xee2f('0x26')]==='telephone';});if(!_0x4e585b)return _0x150445;return db['UserProfileSection'][_0xee2f('0x3c')]({'where':{'name':{'$or':[_0xee2f('0x28'),'Telephones']},'userProfileId':_0x346fc2[_0xee2f('0x70')][_0xee2f('0x75')]},'raw':!![]})[_0xee2f('0xf')](function(_0x2238c2){if(_[_0xee2f('0x81')](_0x2238c2)||!_['some'](_0x2238c2,['autoAssociation',0x0]))return _0x150445;_0x16326e=[];var _0x567de2=_(_0x2238c2)[_0xee2f('0x2b')](function(_0x1fe927){if(_0x1fe927[_0xee2f('0x82')]===0x1)return;return _0x1fe927[_0xee2f('0x2f')]===_0xee2f('0x28')?_0xee2f('0x29'):_0xee2f('0x2a');})[_0xee2f('0x83')]()[_0xee2f('0x2c')]();for(var _0x173f5f=0x0;_0x173f5f<_0x150445[_0xee2f('0x3f')];_0x173f5f++){if(!_[_0xee2f('0x2d')](_0x567de2,_0x150445[_0x173f5f][_0xee2f('0x26')]))return;var _0x470780=_0x150445[_0x173f5f][_0xee2f('0x26')]===_0xee2f('0x29')?'Agents':'Telephones';_0x16326e[_0xee2f('0x3b')](db[_0xee2f('0x79')]['create']({'name':_0x150445[_0x173f5f][_0xee2f('0x2f')],'resourceId':_0x150445[_0x173f5f]['id'],'type':_0x470780,'sectionId':_[_0xee2f('0x2e')](_0x2238c2,[_0xee2f('0x2f'),_0x470780])['id']},{}));}return BPromise['all'](_0x16326e);});})[_0xee2f('0xf')](respondWithResult(_0x413340,0xc9))[_0xee2f('0x18')](handleError(_0x413340,null));};exports[_0xee2f('0x84')]=function(_0x609bd9,_0x1954b5){if(_0x609bd9[_0xee2f('0x50')]['id']){delete _0x609bd9[_0xee2f('0x50')]['id'];}return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x609bd9['params']['id']}})[_0xee2f('0xf')](function(_0x16b101){if(!_0x16b101)return null;if(_0x16b101['id']===_0x609bd9[_0xee2f('0x70')]['id']){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]||!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x88'));}if(!_0x16b101[_0xee2f('0x89')](_0x609bd9['body'][_0xee2f('0x85')])){throw new db['Sequelize']['ValidationError'](_0xee2f('0x8a'));}if(_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]===_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x8b'));}}else if(_0x609bd9[_0xee2f('0x70')]['role']===_0xee2f('0x71')){if(!_0x609bd9[_0xee2f('0x50')]['newPassword']){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}}else if(_0x609bd9[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x70')){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}if(_0x16b101[_0xee2f('0x26')]!=='agent'){throw new db[(_0xee2f('0x87'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize'][(_0xee2f('0x8c'))]('Unauthorized');}return _0x16b101;})[_0xee2f('0xf')](handleEntityNotFound(_0x1954b5,null))[_0xee2f('0xf')](function(_0x344a3a){return db['Setting'][_0xee2f('0x8e')]({'attributes':['id',_0xee2f('0x59'),'enforcePasswordHistory',_0xee2f('0x8f')]})[_0xee2f('0xf')](function(_0x392446){if(_0x392446[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]);if(!_0x392446['enforcePasswordHistory']||!_0x344a3a[_0xee2f('0x90')])return _0x344a3a;authService[_0xee2f('0x91')](_0x609bd9['body'][_0xee2f('0x86')],_0x344a3a[_0xee2f('0x90')],_0x392446[_0xee2f('0x8f')]);return _0x344a3a;})['then'](saveUpdates({'password':_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')],'passwordResetAt':_0x609bd9[_0xee2f('0x70')]['id']==_0x609bd9[_0xee2f('0x52')]['id']?moment():null,'previousPasswords':authService[_0xee2f('0x92')](_0x609bd9[_0xee2f('0x50')]['newPassword'],_0x344a3a[_0xee2f('0x90')])},null));})[_0xee2f('0xf')](respondWithResult(_0x1954b5,null))[_0xee2f('0x18')](handleError(_0x1954b5,null));};exports['addQueues']=function(_0x50670a,_0xd39c00){var _0x52bb33=_0x50670a[_0xee2f('0x50')][_0xee2f('0x93')];return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x50670a[_0xee2f('0x52')]['id']},'attributes':['id','name','role',_0xee2f('0x94'),_0xee2f('0x95'),'voicePause',_0xee2f('0x96')]})[_0xee2f('0xf')](handleEntityNotFound(_0xd39c00,null))[_0xee2f('0xf')](function(_0xd98eab){if(_0xd98eab){if(!utils['isValidChannel'](_0x52bb33)){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0xd98eab['add'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x50670a[_0xee2f('0x50')]['ids'],{'penalty':_0x50670a['body'][_0xee2f('0x9b')]||0x0})[_0xee2f('0x9c')](function(_0x1fff43){for(var _0x56abfb=0x0;_0x56abfb<_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]['length'];_0x56abfb+=0x1){var _0x969efe={'UserId':Number(_0x50670a[_0xee2f('0x52')]['id'])};_0x969efe[_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')][_0x56abfb]);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9f'),_0x969efe);}return _0x1fff43;})['then'](function(){if(_0x52bb33===_0xee2f('0xa0')){return db[_0xee2f('0xa1')][_0xee2f('0x3c')]({'where':{'id':_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]||[]},'raw':!![],'attributes':['id',_0xee2f('0x2f')]});}})[_0xee2f('0xf')](function(_0x3a71fa){var _0x298dfa=_0xd98eab[_0xee2f('0x25')]({'plain':!![]});var _0x2bf351=[];if(_0x52bb33===_0xee2f('0xa0')&&_0x298dfa['role']===_0xee2f('0x29')&&_0x298dfa['online']){for(var _0xc1d07e=0x0;_0xc1d07e<_0x3a71fa[_0xee2f('0x3f')];_0xc1d07e+=0x1){_0x2bf351['push']({'membername':_0x298dfa[_0xee2f('0x2f')],'UserId':_0x298dfa['id'],'queue_name':_0x3a71fa[_0xc1d07e][_0xee2f('0x2f')],'VoiceQueueId':_0x3a71fa[_0xc1d07e]['id'],'interface':_[_0xee2f('0x5c')](_0x298dfa[_0xee2f('0x96')])?util[_0xee2f('0xa2')](_0xee2f('0xa3'),_0x298dfa['name']):_0x298dfa[_0xee2f('0x96')],'paused':_0x298dfa[_0xee2f('0xa4')]||![],'penalty':_0x50670a[_0xee2f('0x50')][_0xee2f('0x9b')]||0x0});}return BPromise[_0xee2f('0x80')](_0x2bf351,function(_0x31b0f7){return db[_0xee2f('0xa5')][_0xee2f('0xa6')](_0x31b0f7);});}return _0xd98eab;});}})[_0xee2f('0xf')](respondWithStatusCode(_0xd39c00,null))[_0xee2f('0x18')](handleError(_0xd39c00,null));};exports['removeQueues']=function(_0x1d4d12,_0x3ab6c7){var _0x37ebf7;return db['User']['find']({'where':{'id':_0x1d4d12[_0xee2f('0x52')]['id']},'attributes':['id',_0xee2f('0x2f'),_0xee2f('0x26')]})[_0xee2f('0xf')](handleEntityNotFound(_0x3ab6c7,null))[_0xee2f('0xf')](function(_0x4a91ca){if(_0x4a91ca){_0x37ebf7=_0x4a91ca;if(!_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')]||!utils['isValidChannel'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')])){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0x4a91ca[_0xee2f('0xa7')+_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')]);}})[_0xee2f('0xf')](function(_0x2bd952){if(_[_0xee2f('0xa8')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')])){for(var _0x5010eb=0x0;_0x5010eb<_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')][_0xee2f('0x3f')];_0x5010eb+=0x1){var _0x11e4f5={'UserId':Number(_0x1d4d12[_0xee2f('0x52')]['id'])};_0x11e4f5[_[_0xee2f('0x98')](_0x1d4d12['query'][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x1d4d12[_0xee2f('0x4a')]['ids'][_0x5010eb]);socket[_0xee2f('0x9e')](_0xee2f('0x70')+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0xa9'),_0x11e4f5);}}else{var _0x11e4f5={'UserId':Number(_0x1d4d12['params']['id'])};_0x11e4f5[_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+'QueueId']=Number(_0x1d4d12[_0xee2f('0x4a')]['ids']);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')]['channel'][_0xee2f('0x99')]())+'Queue:remove',_0x11e4f5);}return _0x2bd952;})[_0xee2f('0xf')](function(){if(_0x1d4d12['query'][_0xee2f('0x93')]===_0xee2f('0xa0')){return db[_0xee2f('0xa5')][_0xee2f('0x24')]({'where':{'UserId':_0x1d4d12[_0xee2f('0x52')]['id'],'VoiceQueueId':_0x1d4d12['query'][_0xee2f('0x54')]},'individualHooks':!![]})[_0xee2f('0xf')](function(){return _0x37ebf7;});}return _0x37ebf7;})[_0xee2f('0xf')](respondWithStatusCode(_0x3ab6c7,null))[_0xee2f('0x18')](handleError(_0x3ab6c7,null));};exports[_0xee2f('0xaa')]=function(_0x73e99a,_0x55f1bd){_0x73e99a[_0xee2f('0x50')][_0xee2f('0xab')]=_0x73e99a[_0xee2f('0xac')]['filename'];return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x73e99a[_0xee2f('0x52')]['id']}})[_0xee2f('0xf')](handleEntityNotFound(_0x55f1bd,null))[_0xee2f('0xf')](saveUpdates(_0x73e99a[_0xee2f('0x50')],null))[_0xee2f('0xf')](respondWithResult(_0x55f1bd,null))[_0xee2f('0x18')](handleError(_0x55f1bd,null));};exports[_0xee2f('0xad')]=function(_0x2dc4ff,_0x351e10){var _0x3f0ef6=path['join'](config[_0xee2f('0xae')],'server/files/images/logos/default_profile.png');return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x2dc4ff['params']['id']},'attributes':['id',_0xee2f('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0x351e10,null))[_0xee2f('0xf')](function(_0x34a358){if(_0x34a358){if(_[_0xee2f('0x5c')](_0x34a358[_0xee2f('0xab')])){return _0x351e10['download'](_0x3f0ef6);}else{if(!fs[_0xee2f('0xaf')](path[_0xee2f('0xb0')](config[_0xee2f('0xae')],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]))){return _0x351e10[_0xee2f('0xb2')](_0x3f0ef6);}return _0x351e10['download'](path[_0xee2f('0xb0')](config['root'],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]));}}})['catch'](handleError(_0x351e10,null));};exports[_0xee2f('0xb3')]=function(_0x44c1a8,_0x4b9d27){return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x44c1a8[_0xee2f('0x52')]['id']},'attributes':['id']})[_0xee2f('0xf')](handleEntityNotFound(_0x4b9d27,null))[_0xee2f('0xf')](function(_0x2f5a60){var _0x33182c=[];values=_0x2f5a60['dataValues'];_0x33182c[_0xee2f('0x3b')](get_open_tabs('chat',_0x2f5a60['dataValues']));_0x33182c['push'](get_open_tabs(_0xee2f('0x43'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x2f5a60[_0xee2f('0x42')]));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0x2f5a60[_0xee2f('0x42')]));return BPromise[_0xee2f('0x7f')](_0x33182c);})[_0xee2f('0xf')](function(_0x1cbce0){var _0x6e5a1d=[];if(_0x1cbce0){for(var _0xf2d880=0x0;_0xf2d880=_0x3e7cae[_0x9b80('0x56')]){throw new Error(_0x9b80('0x57'));}})['then'](function(){if(_0x30c7c8){return db[_0x9b80('0x2b')][_0x9b80('0x58')]({'where':{'membername':_0x30c7c8[_0x9b80('0x35')]},'individualHooks':!![]});}})[_0x9b80('0x10')](function(){if(_0x30c7c8){return _0x30c7c8[_0x9b80('0x59')]({'raw':!![]});}})[_0x9b80('0x10')](function(_0x29321b){if(_0x30c7c8){if(_0x29321b){var _0x176e69=[];_0x21a448=_0x29321b;if(_0x21a448[_0x9b80('0x2e')]){for(var _0x56b5d3=0x0;_0x56b5d3<_0x21a448[_0x9b80('0x2e')];_0x56b5d3++){_0x176e69[_0x9b80('0x34')](db[_0x9b80('0x2b')][_0x9b80('0x5a')]({'membername':_0x30c7c8[_0x9b80('0x35')],'UserId':_0x30c7c8['id'],'queue_name':_0x21a448[_0x56b5d3][_0x9b80('0x35')],'VoiceQueueId':_0x21a448[_0x56b5d3]['id'],'interface':_0x118d7b,'paused':_0x30c7c8[_0x9b80('0x51')]||![],'penalty':_0x21a448[_0x56b5d3]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x9b80('0x4d')](_0x176e69);}}}})[_0x9b80('0x10')](function(){if(_0x30c7c8){return db['MemberReport'][_0x9b80('0x4b')]({'where':{'membername':_0x30c7c8[_0x9b80('0x35')],'exitAt':null}});}})['then'](function(_0x21a762){if(_0x30c7c8){if(_0x21a762&&_0x21a762[_0x9b80('0x2e')]){var _0x4077b7=[];_0x21a762[_0x9b80('0x33')](function(_0x231c3b){_0x4077b7['push'](_0x231c3b[_0x9b80('0x42')]({'exitAt':moment()[_0x9b80('0x2f')](_0x9b80('0x30'))}));});return BPromise[_0x9b80('0x4d')](_0x4077b7);}}})['then'](function(_0x417d19){if(_0x30c7c8){var _0x3afd0b=[];var _0x2296ff=[];var _0xb67b20=utils[_0x9b80('0x32')]();var _0x5d466d={'membername':_0x30c7c8[_0x9b80('0x35')],'interface':_0x118d7b,'enterAt':moment()[_0x9b80('0x2f')](_0x9b80('0x30')),'role':_0x30c7c8[_0x9b80('0x28')],'internal':_0x30c7c8[_0x9b80('0x29')]};_0xb67b20[_0x9b80('0x33')](function(_0x3bf793){_0x3afd0b[_0x9b80('0x34')](_['merge']({'channel':_0x3bf793,'type':_0x9b80('0x5b'),'data1':_0x9b80('0x5c'),'data2':_0x118d7b},_0x5d466d));if(_0x30c7c8['loginInPause']){_0x2296ff[_0x9b80('0x34')](_[_0x9b80('0x5d')]({'channel':_0x3bf793,'type':_0x9b80('0x2d'),'data1':_0x9b80('0x5e')},_0x5d466d));}});return db[_0x9b80('0x2c')][_0x9b80('0x3c')](_0x3afd0b[_0x9b80('0x5f')](_0x2296ff),{'individualHooks':!![]});}})[_0x9b80('0x10')](function(){if(_0x30c7c8){return _0x30c7c8[_0x9b80('0x42')]({'online':!![],'lastLoginAt':moment()[_0x9b80('0x2f')](_0x9b80('0x30')),'voicePause':_0x30c7c8[_0x9b80('0x51')]||![],'mailPause':_0x30c7c8[_0x9b80('0x51')]||![],'chatPause':_0x30c7c8[_0x9b80('0x51')]||![],'faxPause':_0x30c7c8['loginInPause']||![],'smsPause':_0x30c7c8[_0x9b80('0x51')]||![],'openchannelPause':_0x30c7c8[_0x9b80('0x51')]||![],'pauseType':_0x30c7c8[_0x9b80('0x51')]?_0x9b80('0x5e'):null,'lastPauseAt':moment()[_0x9b80('0x2f')](_0x9b80('0x30')),'interface':_0x118d7b});}})[_0x9b80('0x10')](function(_0x144553){_0x516a8e(_0x144553);})[_0x9b80('0x1b')](function(_0x18e3a8){_0x21e964(_0x24dc9d[_0x9b80('0x17')](0x1f4,_0x18e3a8['message']));});});}; \ No newline at end of file +var _0x1964=['interface','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','channel','chat','fax','openchannel','whatsapp','system','set','%s%s','Pause','push','all','LogoutUser','findOne','destroy','LoginUser','mobile','phone','agent','getLicense','agents','getVoiceQueues','upsert','loginInPause','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw','attributes','limit','include','map','model','ShowUser','where','PauseUser','find','name','role','internal','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','forEach','isNil'];(function(_0x29161c,_0x454c8){var _0x3ec0db=function(_0x276488){while(--_0x276488){_0x29161c['push'](_0x29161c['shift']());}};_0x3ec0db(++_0x454c8);}(_0x1964,0xd7));var _0x4196=function(_0x3bd772,_0x310be5){_0x3bd772=_0x3bd772-0x0;var _0x28f755=_0x1964[_0x3bd772];return _0x28f755;};'use strict';var _=require(_0x4196('0x0'));var util=require(_0x4196('0x1'));var moment=require(_0x4196('0x2'));var BPromise=require(_0x4196('0x3'));var rs=require(_0x4196('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4196('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4196('0x6'))(_0x4196('0x7'));var config=require(_0x4196('0x8'));var jayson=require(_0x4196('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x4196('0xa')]=_[_0x4196('0xb')](config[_0x4196('0xa')],{'host':_0x4196('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4196('0xa')]));require('./user.socket')[_0x4196('0xd')](socket);function respondWithRpcPromise(_0x1e5181,_0xb9a615,_0x2ac483){return new BPromise(function(_0x129952,_0x539cfb){return client[_0x4196('0xe')](_0x1e5181,_0x2ac483)[_0x4196('0xf')](function(_0x54bc6a){logger[_0x4196('0x10')](_0x4196('0x11'),_0xb9a615,_0x4196('0x12'));logger[_0x4196('0x13')]('User,\x20%s,\x20%s,\x20%s',_0xb9a615,_0x4196('0x12'),JSON[_0x4196('0x14')](_0x54bc6a));if(_0x54bc6a['error']){if(_0x54bc6a[_0x4196('0x15')][_0x4196('0x16')]===0x1f4){logger[_0x4196('0x15')](_0x4196('0x11'),_0xb9a615,_0x54bc6a[_0x4196('0x15')]['message']);return _0x539cfb(_0x54bc6a[_0x4196('0x15')][_0x4196('0x17')]);}logger[_0x4196('0x15')](_0x4196('0x11'),_0xb9a615,_0x54bc6a[_0x4196('0x15')][_0x4196('0x17')]);return _0x129952(_0x54bc6a[_0x4196('0x15')]['message']);}else{logger[_0x4196('0x10')](_0x4196('0x11'),_0xb9a615,_0x4196('0x12'));_0x129952(_0x54bc6a[_0x4196('0x18')][_0x4196('0x17')]);}})[_0x4196('0x19')](function(_0x59711b){logger[_0x4196('0x15')](_0x4196('0x11'),_0xb9a615,_0x59711b);_0x539cfb(_0x59711b);});});}exports[_0x4196('0x1a')]=function(_0xbf4e7e){var _0x2f0b08=this;return new Promise(function(_0x57c3e6,_0x34de4a){return db[_0x4196('0x1b')][_0x4196('0x1c')]({'raw':_0xbf4e7e['options']?_0xbf4e7e[_0x4196('0x1d')][_0x4196('0x1e')]===undefined?!![]:![]:!![],'where':_0xbf4e7e[_0x4196('0x1d')]?_0xbf4e7e[_0x4196('0x1d')]['where']||null:null,'attributes':_0xbf4e7e[_0x4196('0x1d')]?_0xbf4e7e[_0x4196('0x1d')][_0x4196('0x1f')]||null:null,'limit':_0xbf4e7e[_0x4196('0x1d')]?_0xbf4e7e[_0x4196('0x1d')][_0x4196('0x20')]||null:null,'include':_0xbf4e7e[_0x4196('0x1d')]?_0xbf4e7e[_0x4196('0x1d')][_0x4196('0x21')]?_[_0x4196('0x22')](_0xbf4e7e[_0x4196('0x1d')][_0x4196('0x21')],function(_0x76e2ee){return{'model':db[_0x76e2ee[_0x4196('0x23')]],'as':_0x76e2ee['as'],'attributes':_0x76e2ee[_0x4196('0x1f')],'include':_0x76e2ee[_0x4196('0x21')]?_[_0x4196('0x22')](_0x76e2ee[_0x4196('0x21')],function(_0x4542a4){return{'model':db[_0x4542a4['model']],'as':_0x4542a4['as'],'attributes':_0x4542a4['attributes'],'include':_0x4542a4[_0x4196('0x21')]?_[_0x4196('0x22')](_0x4542a4[_0x4196('0x21')],function(_0x59583a){return{'model':db[_0x59583a[_0x4196('0x23')]],'as':_0x59583a['as'],'attributes':_0x59583a[_0x4196('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4196('0xf')](function(_0x8041c3){logger[_0x4196('0x10')](_0x4196('0x1a'),_0xbf4e7e);logger['debug'](_0x4196('0x1a'),_0xbf4e7e,JSON[_0x4196('0x14')](_0x8041c3));_0x57c3e6(_0x8041c3);})[_0x4196('0x19')](function(_0x44758d){logger['error'](_0x4196('0x1a'),_0x44758d[_0x4196('0x17')],_0xbf4e7e);_0x34de4a(_0x2f0b08[_0x4196('0x15')](0x1f4,_0x44758d[_0x4196('0x17')]));});});};exports[_0x4196('0x24')]=function(_0x508f54){var _0x30a5ee=this;return new Promise(function(_0x1cee08,_0x284160){return db[_0x4196('0x1b')]['find']({'raw':_0x508f54[_0x4196('0x1d')]?_0x508f54[_0x4196('0x1d')][_0x4196('0x1e')]===undefined?!![]:![]:!![],'where':_0x508f54['options']?_0x508f54[_0x4196('0x1d')][_0x4196('0x25')]||null:null,'attributes':_0x508f54[_0x4196('0x1d')]?_0x508f54[_0x4196('0x1d')]['attributes']||null:null,'include':_0x508f54[_0x4196('0x1d')]?_0x508f54[_0x4196('0x1d')][_0x4196('0x21')]?_[_0x4196('0x22')](_0x508f54[_0x4196('0x1d')][_0x4196('0x21')],function(_0x1b2c0f){return{'model':db[_0x1b2c0f[_0x4196('0x23')]],'as':_0x1b2c0f['as'],'attributes':_0x1b2c0f[_0x4196('0x1f')],'include':_0x1b2c0f[_0x4196('0x21')]?_['map'](_0x1b2c0f['include'],function(_0x3705ea){return{'model':db[_0x3705ea[_0x4196('0x23')]],'as':_0x3705ea['as'],'attributes':_0x3705ea['attributes'],'include':_0x3705ea['include']?_['map'](_0x3705ea['include'],function(_0x49ca63){return{'model':db[_0x49ca63['model']],'as':_0x49ca63['as'],'attributes':_0x49ca63[_0x4196('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd38dc1){logger[_0x4196('0x10')](_0x4196('0x24'),_0x508f54);logger[_0x4196('0x13')](_0x4196('0x24'),_0x508f54,JSON[_0x4196('0x14')](_0xd38dc1));_0x1cee08(_0xd38dc1);})['catch'](function(_0x36162e){logger[_0x4196('0x15')](_0x4196('0x24'),_0x36162e[_0x4196('0x17')],_0x508f54);_0x284160(_0x30a5ee[_0x4196('0x15')](0x1f4,_0x36162e[_0x4196('0x17')]));});});};exports[_0x4196('0x26')]=function(_0x40220e){var _0x3fdcd0=this;return new Promise(function(_0x340301,_0x4b2277){var _0x328440;return db['User'][_0x4196('0x27')]({'where':_0x40220e[_0x4196('0x1d')][_0x4196('0x25')]||{},'attributes':['id',_0x4196('0x28'),_0x4196('0x29'),_0x4196('0x2a'),'interface']})[_0x4196('0xf')](function(_0x30d31f){if(_0x30d31f){_0x328440=_0x30d31f;return db[_0x4196('0x2b')][_0x4196('0x2c')]({'paused':0x1},{'where':{'UserId':_0x328440['id']},'individualHooks':!![]});}})['then'](function(){if(_0x328440){return db[_0x4196('0x2d')][_0x4196('0x1c')]({'where':{'membername':_0x328440[_0x4196('0x28')],'type':_0x4196('0x2e'),'exitAt':null}});}})['then'](function(_0x5a7bfc){if(_0x328440){if(_0x5a7bfc&&_0x5a7bfc[_0x4196('0x2f')]){var _0x9d2a1a=moment()[_0x4196('0x30')](_0x4196('0x31'));for(var _0x2e87f2=0x0,_0x32ad41=_0x5a7bfc[_0x4196('0x2f')];_0x2e87f2<_0x32ad41;_0x2e87f2++){_0x5a7bfc[_0x2e87f2]['updateAttributes']({'exitAt':_0x9d2a1a});}}}})[_0x4196('0xf')](function(){if(_0x328440){var _0x41eb5f=[];var _0x447f3a=utils['getChannels']();_0x447f3a[_0x4196('0x32')](function(_0x5340d4){_0x41eb5f['push']({'channel':_0x5340d4,'membername':_0x328440[_0x4196('0x28')],'interface':_[_0x4196('0x33')](_0x328440[_0x4196('0x34')])?util[_0x4196('0x30')](_0x4196('0x35'),_0x328440['name']):_0x328440[_0x4196('0x34')],'type':_0x4196('0x2e'),'enterAt':moment()[_0x4196('0x30')](_0x4196('0x31')),'data1':_0x40220e[_0x4196('0x36')][_0x4196('0x37')]||_0x4196('0x38'),'role':_0x328440[_0x4196('0x29')],'internal':_0x328440[_0x4196('0x2a')],'uniqueid':_0x40220e['body'][_0x4196('0x39')]||null});});return db[_0x4196('0x2d')][_0x4196('0x3a')](_0x41eb5f,{'individualHooks':!![]});}})[_0x4196('0xf')](function(){if(_0x328440){return _0x328440[_0x4196('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x40220e[_0x4196('0x36')][_0x4196('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x4196('0xf')](function(_0x45500e){_0x340301(_0x45500e);})[_0x4196('0x19')](function(_0x2a9469){_0x4b2277(_0x3fdcd0[_0x4196('0x15')](0x1f4,_0x2a9469['message']));});});};exports[_0x4196('0x3b')]=function(_0x10163f){var _0x362445=this;return new Promise(function(_0x244247,_0x1c8bbc){var _0x3f6e38;return db[_0x4196('0x1b')]['findOne']({'where':_0x10163f[_0x4196('0x1d')][_0x4196('0x25')]||{},'attributes':['id',_0x4196('0x28')]})['then'](function(_0x477503){if(_0x477503){_0x3f6e38=_0x477503;if(_0x10163f[_0x4196('0x36')][_0x4196('0x3c')]&&!utils['isValidChannel'](_0x10163f[_0x4196('0x36')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x10163f['body']['channel']){case'voice':return db[_0x4196('0x2b')][_0x4196('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3f6e38['id']}})[_0x4196('0xf')](function(){return db['MemberReport'][_0x4196('0x27')]({'where':{'channel':_0x10163f[_0x4196('0x36')][_0x4196('0x3c')],'membername':_0x3f6e38['name'],'type':_0x4196('0x2e'),'exitAt':null}});})['then'](function(_0x3548e9){if(_0x3548e9){return _0x3548e9['update']({'exitAt':moment()[_0x4196('0x30')](_0x4196('0x31')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x4196('0xf')](function(){return _0x3f6e38[_0x4196('0x2c')]({'voicePause':![]});});case'mail':case _0x4196('0x3d'):case _0x4196('0x3e'):case'sms':case _0x4196('0x3f'):case _0x4196('0x40'):return db['MemberReport']['find']({'where':{'channel':_0x10163f['body']['channel'],'membername':_0x3f6e38[_0x4196('0x28')],'type':'PAUSE','exitAt':null}})['then'](function(_0x1e5e87){return _0x1e5e87[_0x4196('0x2c')]({'exitAt':moment()['format'](_0x4196('0x31')),'data2':_0x4196('0x41')},{'individualHooks':!![]});})['then'](function(){var _0x4da62d={};_[_0x4196('0x42')](_0x4da62d,util[_0x4196('0x30')](_0x4196('0x43'),_0x10163f[_0x4196('0x36')][_0x4196('0x3c')],_0x4196('0x44')),![]);return _0x3f6e38[_0x4196('0x2c')](_0x4da62d);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x3f6e38['id']}})[_0x4196('0xf')](function(){return db[_0x4196('0x2d')][_0x4196('0x1c')]({'where':{'membername':_0x3f6e38[_0x4196('0x28')],'type':_0x4196('0x2e'),'exitAt':null}});})[_0x4196('0xf')](function(_0x4b5b89){var _0x17a847=[];_0x4b5b89[_0x4196('0x32')](function(_0x1e6bad){_0x17a847[_0x4196('0x45')](_0x1e6bad['update']({'exitAt':moment()[_0x4196('0x30')](_0x4196('0x31')),'data2':_0x4196('0x41')}));});return BPromise[_0x4196('0x46')](_0x17a847);})[_0x4196('0xf')](function(){return _0x3f6e38[_0x4196('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x4196('0xf')](function(_0x22641c){_0x244247(_0x22641c);})['catch'](function(_0x485836){_0x1c8bbc(_0x362445[_0x4196('0x15')](0x1f4,_0x485836[_0x4196('0x17')]));});});};exports[_0x4196('0x47')]=function(_0x3ebbb2){var _0x51eda4=this;return new Promise(function(_0x36a188,_0x16381f){var _0x4ec355;return db[_0x4196('0x1b')][_0x4196('0x48')]({'where':_0x3ebbb2[_0x4196('0x1d')][_0x4196('0x25')]||{},'attributes':['id','name']})[_0x4196('0xf')](function(_0x2f5a1d){if(_0x2f5a1d){_0x4ec355=_0x2f5a1d;return db[_0x4196('0x2b')][_0x4196('0x49')]({'where':{'membername':_0x4ec355[_0x4196('0x28')]},'individualHooks':!![]});}})[_0x4196('0xf')](function(){if(_0x4ec355){return db[_0x4196('0x2d')]['findAll']({'where':{'membername':_0x4ec355[_0x4196('0x28')],'exitAt':null}});}})['then'](function(_0x438f65){if(_0x4ec355){if(_0x438f65&&_0x438f65[_0x4196('0x2f')]){var _0x151b44=[];_0x438f65[_0x4196('0x32')](function(_0x1357cc){_0x151b44[_0x4196('0x45')](_0x1357cc[_0x4196('0x2c')]({'exitAt':moment()[_0x4196('0x30')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x151b44);}}})[_0x4196('0xf')](function(){if(_0x4ec355){return _0x4ec355[_0x4196('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4196('0xf')](function(_0x44ad9c){_0x36a188(_0x44ad9c);})[_0x4196('0x19')](function(_0x56dccd){_0x16381f(_0x51eda4['error'](0x1f4,_0x56dccd[_0x4196('0x17')]));});});};exports[_0x4196('0x4a')]=function(_0x1381d1){var _0x438061=this;return new Promise(function(_0x3b0afb,_0x4f9ee7){var _0x406aa1;var _0x2a92de;var _0x5a3294;var _0x554add;return db['User'][_0x4196('0x48')]({'where':_0x1381d1[_0x4196('0x1d')][_0x4196('0x25')]||{},'attributes':['id',_0x4196('0x28'),_0x4196('0x29'),_0x4196('0x4b'),_0x4196('0x4c'),_0x4196('0x2a'),'loginInPause','interface']})['then'](function(_0x4d42b9){if(_0x4d42b9){_0x406aa1=_0x4d42b9;_0x554add=_0x1381d1[_0x4196('0x36')]['interface']?_0x1381d1[_0x4196('0x36')]['interface']:util[_0x4196('0x30')](_0x4196('0x35'),_0x406aa1[_0x4196('0x28')]);return db['User']['count']({'where':{'role':_0x4196('0x4d'),'online':!![],'id':{'$ne':_0x406aa1['id']}}});}})['then'](function(_0x1c6682){if(_0x1c6682){_0x5a3294=_0x1c6682;return require('../../config/license/util')[_0x4196('0x4e')]();}})[_0x4196('0xf')](function(_0x21c3f7){if(_0x21c3f7&&_0x21c3f7[_0x4196('0x4f')]&&_0x5a3294>=_0x21c3f7[_0x4196('0x4f')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4196('0xf')](function(){if(_0x406aa1){return db[_0x4196('0x2b')]['destroy']({'where':{'membername':_0x406aa1[_0x4196('0x28')]},'individualHooks':!![]});}})[_0x4196('0xf')](function(){if(_0x406aa1){return _0x406aa1[_0x4196('0x50')]({'raw':!![]});}})['then'](function(_0x276371){if(_0x406aa1){if(_0x276371){var _0x300219=[];_0x2a92de=_0x276371;if(_0x2a92de['length']){for(var _0x67bfbb=0x0;_0x67bfbb<_0x2a92de[_0x4196('0x2f')];_0x67bfbb++){_0x300219[_0x4196('0x45')](db[_0x4196('0x2b')][_0x4196('0x51')]({'membername':_0x406aa1['name'],'UserId':_0x406aa1['id'],'queue_name':_0x2a92de[_0x67bfbb]['name'],'VoiceQueueId':_0x2a92de[_0x67bfbb]['id'],'interface':_0x554add,'paused':_0x406aa1[_0x4196('0x52')]||![],'penalty':_0x2a92de[_0x67bfbb]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x4196('0x46')](_0x300219);}}}})[_0x4196('0xf')](function(){if(_0x406aa1){return db[_0x4196('0x2d')][_0x4196('0x1c')]({'where':{'membername':_0x406aa1[_0x4196('0x28')],'exitAt':null}});}})[_0x4196('0xf')](function(_0x5be49d){if(_0x406aa1){if(_0x5be49d&&_0x5be49d['length']){var _0x11d50f=[];_0x5be49d[_0x4196('0x32')](function(_0x4b4ee3){_0x11d50f[_0x4196('0x45')](_0x4b4ee3['update']({'exitAt':moment()[_0x4196('0x30')](_0x4196('0x31'))}));});return BPromise[_0x4196('0x46')](_0x11d50f);}}})[_0x4196('0xf')](function(_0x3ec603){if(_0x406aa1){var _0x2db95e=[];var _0x1af2fd=[];var _0xbffb4d=utils[_0x4196('0x53')]();var _0x23408b={'membername':_0x406aa1[_0x4196('0x28')],'interface':_0x554add,'enterAt':moment()[_0x4196('0x30')](_0x4196('0x31')),'role':_0x406aa1['role'],'internal':_0x406aa1[_0x4196('0x2a')]};_0xbffb4d[_0x4196('0x32')](function(_0x411293){_0x2db95e[_0x4196('0x45')](_[_0x4196('0x54')]({'channel':_0x411293,'type':_0x4196('0x55'),'data1':_0x4196('0x56'),'data2':_0x554add},_0x23408b));if(_0x406aa1[_0x4196('0x52')]){_0x1af2fd[_0x4196('0x45')](_[_0x4196('0x54')]({'channel':_0x411293,'type':_0x4196('0x2e'),'data1':_0x4196('0x57')},_0x23408b));}});return db[_0x4196('0x2d')][_0x4196('0x3a')](_0x2db95e[_0x4196('0x58')](_0x1af2fd),{'individualHooks':!![]});}})[_0x4196('0xf')](function(){if(_0x406aa1){return _0x406aa1['update']({'online':!![],'lastLoginAt':moment()[_0x4196('0x30')](_0x4196('0x31')),'voicePause':_0x406aa1[_0x4196('0x52')]||![],'mailPause':_0x406aa1['loginInPause']||![],'chatPause':_0x406aa1[_0x4196('0x52')]||![],'faxPause':_0x406aa1[_0x4196('0x52')]||![],'smsPause':_0x406aa1[_0x4196('0x52')]||![],'openchannelPause':_0x406aa1[_0x4196('0x52')]||![],'pauseType':_0x406aa1['loginInPause']?_0x4196('0x57'):null,'lastPauseAt':moment()[_0x4196('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x554add});}})[_0x4196('0xf')](function(_0x27c4ff){_0x3b0afb(_0x27c4ff);})[_0x4196('0x19')](function(_0x2dcaf1){_0x4f9ee7(_0x438061[_0x4196('0x15')](0x1f4,_0x2dcaf1[_0x4196('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 26ced26..53eaa47 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 _0xd411=['register','length','user:','save','remove','update','emit'];(function(_0x2bbbb6,_0x1161ef){var _0x40be50=function(_0x55e697){while(--_0x55e697){_0x2bbbb6['push'](_0x2bbbb6['shift']());}};_0x40be50(++_0x1161ef);}(_0xd411,0xff));var _0x1d41=function(_0x4c0dba,_0x3ad8cf){_0x4c0dba=_0x4c0dba-0x0;var _0x1624cf=_0xd411[_0x4c0dba];return _0x1624cf;};'use strict';var UserEvents=require('./user.events');var events=[_0x1d41('0x0'),_0x1d41('0x1'),_0x1d41('0x2')];function createListener(_0x8cd677,_0x41c732){return function(_0x6ea47a){_0x41c732[_0x1d41('0x3')](_0x8cd677,_0x6ea47a);};}function removeListener(_0x1edfa5,_0x1fee49){return function(){UserEvents['removeListener'](_0x1edfa5,_0x1fee49);};}exports[_0x1d41('0x4')]=function(_0x44b89d){for(var _0x320f58=0x0,_0x56a324=events[_0x1d41('0x5')];_0x320f58<_0x56a324;_0x320f58++){var _0x1b8c75=events[_0x320f58];var _0x562d0f=createListener(_0x1d41('0x6')+_0x1b8c75,_0x44b89d);UserEvents['on'](_0x1b8c75,_0x562d0f);}}; \ No newline at end of file +var _0xca7b=['removeListener','register','user:','./user.events','save','remove','update','emit'];(function(_0x48eae6,_0x16683d){var _0x5021aa=function(_0x200319){while(--_0x200319){_0x48eae6['push'](_0x48eae6['shift']());}};_0x5021aa(++_0x16683d);}(_0xca7b,0x11b));var _0xbca7=function(_0x3d8d92,_0x316f34){_0x3d8d92=_0x3d8d92-0x0;var _0x4c34fc=_0xca7b[_0x3d8d92];return _0x4c34fc;};'use strict';var UserEvents=require(_0xbca7('0x0'));var events=[_0xbca7('0x1'),_0xbca7('0x2'),_0xbca7('0x3')];function createListener(_0x110e60,_0x441785){return function(_0x5659d1){_0x441785[_0xbca7('0x4')](_0x110e60,_0x5659d1);};}function removeListener(_0x41b7be,_0x335ee7){return function(){UserEvents[_0xbca7('0x5')](_0x41b7be,_0x335ee7);};}exports[_0xbca7('0x6')]=function(_0x475825){for(var _0x39421f=0x0,_0x17e4f5=events['length'];_0x39421f<_0x17e4f5;_0x39421f++){var _0xa8009d=events[_0x39421f];var _0x4eb5e2=createListener(_0xbca7('0x7')+_0xa8009d,_0x475825);UserEvents['on'](_0xa8009d,_0x4eb5e2);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 75f5a32..804f30a 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5c4875,_0x519d8e){var _0xe01410=function(_0x2a7800){while(--_0x2a7800){_0x5c4875['push'](_0x5c4875['shift']());}};_0xe01410(++_0x519d8e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3a7bc1,_0x540a6d){var _0x4c753e=function(_0x350302){while(--_0x350302){_0x3a7bc1['push'](_0x3a7bc1['shift']());}};_0x4c753e(++_0x540a6d);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8e692e9..d9ee067 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 _0x3f67=['exports','INTEGER'];(function(_0x41ff82,_0xc4dc25){var _0x28c215=function(_0x239acd){while(--_0x239acd){_0x41ff82['push'](_0x41ff82['shift']());}};_0x28c215(++_0xc4dc25);}(_0x3f67,0x1f0));var _0x73f6=function(_0x39f9f2,_0x37fc06){_0x39f9f2=_0x39f9f2-0x0;var _0x3febf8=_0x3f67[_0x39f9f2];return _0x3febf8;};'use strict';var Sequelize=require('sequelize');module[_0x73f6('0x0')]={'penalty':{'type':Sequelize[_0x73f6('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e62=['exports','INTEGER','sequelize'];(function(_0x172c40,_0x1b45a4){var _0x46f43c=function(_0x5ab073){while(--_0x5ab073){_0x172c40['push'](_0x172c40['shift']());}};_0x46f43c(++_0x1b45a4);}(_0x8e62,0xe9));var _0x28e6=function(_0xd26500,_0xfa64ae){_0xd26500=_0xd26500-0x0;var _0x16cdba=_0x8e62[_0xd26500];return _0x16cdba;};'use strict';var Sequelize=require(_0x28e6('0x0'));module[_0x28e6('0x1')]={'penalty':{'type':Sequelize[_0x28e6('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 46c331b..ba5cbfd 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 _0x2070=['UserChatQueue','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x2070,0x172));var _0x0207=function(_0x18dd8b,_0x307e0c){_0x18dd8b=_0x18dd8b-0x0;var _0x29d5c2=_0x2070[_0x18dd8b];return _0x29d5c2;};'use strict';var _=require(_0x0207('0x0'));var util=require('util');var logger=require(_0x0207('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0207('0x2'));var rp=require(_0x0207('0x3'));var fs=require('fs');var path=require(_0x0207('0x4'));var rimraf=require(_0x0207('0x5'));var config=require(_0x0207('0x6'));var attributes=require(_0x0207('0x7'));module['exports']=function(_0x216880,_0x1bf19b){return _0x216880['define'](_0x0207('0x8'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb03e=['user_has_chat_queues','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue'];(function(_0x59fdc8,_0x17c363){var _0x5e9a1d=function(_0x2cf47e){while(--_0x2cf47e){_0x59fdc8['push'](_0x59fdc8['shift']());}};_0x5e9a1d(++_0x17c363);}(_0xb03e,0x156));var _0xeb03=function(_0x21abf4,_0x358cb1){_0x21abf4=_0x21abf4-0x0;var _0x12733b=_0xb03e[_0x21abf4];return _0x12733b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb03('0x0'))(_0xeb03('0x1'));var moment=require('moment');var BPromise=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var fs=require('fs');var path=require(_0xeb03('0x4'));var rimraf=require(_0xeb03('0x5'));var config=require(_0xeb03('0x6'));var attributes=require(_0xeb03('0x7'));module['exports']=function(_0xf16082,_0x16e448){return _0xf16082[_0xeb03('0x8')](_0xeb03('0x9'),attributes,{'tableName':_0xeb03('0xa'),'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 2b77ac1..a97db63 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 _0x8035=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8035,0x129));var _0x5803=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x8035[_0x15ec4e];return _0xb5e5dd;};'use strict';var _=require(_0x5803('0x0'));var util=require(_0x5803('0x1'));var moment=require(_0x5803('0x2'));var BPromise=require(_0x5803('0x3'));var rs=require(_0x5803('0x4'));var fs=require('fs');var Redis=require(_0x5803('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5803('0x6'));var logger=require(_0x5803('0x7'))(_0x5803('0x8'));var config=require('../../config/environment');var jayson=require(_0x5803('0x9'));var client=jayson['client'][_0x5803('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x949821,_0x4157f4,_0x192a2b){return new BPromise(function(_0x55c552,_0x393907){return client['request'](_0x949821,_0x192a2b)[_0x5803('0xb')](function(_0x40f4d4){logger[_0x5803('0xc')](_0x5803('0xd'),_0x4157f4,_0x5803('0xe'));logger['debug'](_0x5803('0xf'),_0x4157f4,_0x5803('0xe'),JSON['stringify'](_0x40f4d4));if(_0x40f4d4[_0x5803('0x10')]){if(_0x40f4d4[_0x5803('0x10')][_0x5803('0x11')]===0x1f4){logger[_0x5803('0x10')](_0x5803('0xd'),_0x4157f4,_0x40f4d4[_0x5803('0x10')][_0x5803('0x12')]);return _0x393907(_0x40f4d4[_0x5803('0x10')][_0x5803('0x12')]);}logger[_0x5803('0x10')](_0x5803('0xd'),_0x4157f4,_0x40f4d4[_0x5803('0x10')][_0x5803('0x12')]);return _0x55c552(_0x40f4d4[_0x5803('0x10')][_0x5803('0x12')]);}else{logger[_0x5803('0xc')](_0x5803('0xd'),_0x4157f4,_0x5803('0xe'));_0x55c552(_0x40f4d4[_0x5803('0x13')]['message']);}})[_0x5803('0x14')](function(_0x468804){logger[_0x5803('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x4157f4,_0x468804);_0x393907(_0x468804);});});} \ No newline at end of file +var _0xa96c=['../../mysqldb','rpc','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa96c,0xb8));var _0xca96=function(_0x9acf02,_0x59db8e){_0x9acf02=_0x9acf02-0x0;var _0x397a94=_0xa96c[_0x9acf02];return _0x397a94;};'use strict';var _=require(_0xca96('0x0'));var util=require('util');var moment=require(_0xca96('0x1'));var BPromise=require(_0xca96('0x2'));var rs=require(_0xca96('0x3'));var fs=require('fs');var Redis=require(_0xca96('0x4'));var db=require(_0xca96('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xca96('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xca96('0x7')][_0xca96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f8d61,_0x1cf451,_0xbbca9d){return new BPromise(function(_0xa4feb7,_0x3bea4c){return client[_0xca96('0x9')](_0x1f8d61,_0xbbca9d)['then'](function(_0x30b154){logger[_0xca96('0xa')](_0xca96('0xb'),_0x1cf451,_0xca96('0xc'));logger[_0xca96('0xd')](_0xca96('0xe'),_0x1cf451,'request\x20sent',JSON[_0xca96('0xf')](_0x30b154));if(_0x30b154[_0xca96('0x10')]){if(_0x30b154[_0xca96('0x10')][_0xca96('0x11')]===0x1f4){logger[_0xca96('0x10')](_0xca96('0xb'),_0x1cf451,_0x30b154['error'][_0xca96('0x12')]);return _0x3bea4c(_0x30b154['error'][_0xca96('0x12')]);}logger[_0xca96('0x10')](_0xca96('0xb'),_0x1cf451,_0x30b154[_0xca96('0x10')][_0xca96('0x12')]);return _0xa4feb7(_0x30b154[_0xca96('0x10')][_0xca96('0x12')]);}else{logger[_0xca96('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x1cf451,_0xca96('0xc'));_0xa4feb7(_0x30b154[_0xca96('0x13')]['message']);}})[_0xca96('0x14')](function(_0x16c72c){logger[_0xca96('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x1cf451,_0x16c72c);_0x3bea4c(_0x16c72c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c8666f5..89a9883 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2dac5e,_0x50d131){var _0x2b27a3=function(_0x2eb61b){while(--_0x2eb61b){_0x2dac5e['push'](_0x2dac5e['shift']());}};_0x2b27a3(++_0x50d131);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 70008b8..a90ccb7 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 _0x92d2=['sequelize','exports','INTEGER','STRING'];(function(_0x57ec95,_0x399633){var _0x305abd=function(_0x59fc74){while(--_0x59fc74){_0x57ec95['push'](_0x57ec95['shift']());}};_0x305abd(++_0x399633);}(_0x92d2,0xa0));var _0x292d=function(_0x3a153b,_0x48191c){_0x3a153b=_0x3a153b-0x0;var _0x1ab9ce=_0x92d2[_0x3a153b];return _0x1ab9ce;};'use strict';var Sequelize=require(_0x292d('0x0'));module[_0x292d('0x1')]={'penalty':{'type':Sequelize[_0x292d('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x292d('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x292d('0x3')]}}; \ No newline at end of file +var _0x9881=['exports','INTEGER','STRING','sequelize'];(function(_0x24a6de,_0x3ca788){var _0xe7fe1d=function(_0x966560){while(--_0x966560){_0x24a6de['push'](_0x24a6de['shift']());}};_0xe7fe1d(++_0x3ca788);}(_0x9881,0x10f));var _0x1988=function(_0x2967fe,_0x3cf05f){_0x2967fe=_0x2967fe-0x0;var _0xede87a=_0x9881[_0x2967fe];return _0xede87a;};'use strict';var Sequelize=require(_0x1988('0x0'));module[_0x1988('0x1')]={'penalty':{'type':Sequelize[_0x1988('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1988('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1988('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index f678243..adeee44 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 _0x665c=['./userFaxQueue.attributes','define','user_has_fax_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x23549d,_0x47d2d9){var _0x45312b=function(_0x2c14cf){while(--_0x2c14cf){_0x23549d['push'](_0x23549d['shift']());}};_0x45312b(++_0x47d2d9);}(_0x665c,0x1bb));var _0xc665=function(_0x18c921,_0x2590e6){_0x18c921=_0x18c921-0x0;var _0x2f85ee=_0x665c[_0x18c921];return _0x2f85ee;};'use strict';var _=require(_0xc665('0x0'));var util=require('util');var logger=require(_0xc665('0x1'))(_0xc665('0x2'));var moment=require('moment');var BPromise=require(_0xc665('0x3'));var rp=require(_0xc665('0x4'));var fs=require('fs');var path=require(_0xc665('0x5'));var rimraf=require(_0xc665('0x6'));var config=require(_0xc665('0x7'));var attributes=require(_0xc665('0x8'));module['exports']=function(_0x29ce87,_0x3081d7){return _0x29ce87[_0xc665('0x9')]('UserFaxQueue',attributes,{'tableName':_0xc665('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x345c=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x345c,0xff));var _0xc345=function(_0x592de7,_0x3cfdc6){_0x592de7=_0x592de7-0x0;var _0x372167=_0x345c[_0x592de7];return _0x372167;};'use strict';var _=require(_0xc345('0x0'));var util=require(_0xc345('0x1'));var logger=require(_0xc345('0x2'))(_0xc345('0x3'));var moment=require(_0xc345('0x4'));var BPromise=require(_0xc345('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc345('0x6'));var config=require(_0xc345('0x7'));var attributes=require(_0xc345('0x8'));module[_0xc345('0x9')]=function(_0x2a87d0,_0x4b3dcf){return _0x2a87d0[_0xc345('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 7b7bff0..d58f409 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 _0xd963=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c098b,_0x3d45c6){var _0x4a31ea=function(_0x195ac1){while(--_0x195ac1){_0x4c098b['push'](_0x4c098b['shift']());}};_0x4a31ea(++_0x3d45c6);}(_0xd963,0x67));var _0x3d96=function(_0x5dc0de,_0x25bba4){_0x5dc0de=_0x5dc0de-0x0;var _0x54ba0e=_0xd963[_0x5dc0de];return _0x54ba0e;};'use strict';var _=require(_0x3d96('0x0'));var util=require(_0x3d96('0x1'));var moment=require(_0x3d96('0x2'));var BPromise=require(_0x3d96('0x3'));var rs=require(_0x3d96('0x4'));var fs=require('fs');var Redis=require(_0x3d96('0x5'));var db=require(_0x3d96('0x6'))['db'];var utils=require(_0x3d96('0x7'));var logger=require(_0x3d96('0x8'))(_0x3d96('0x9'));var config=require(_0x3d96('0xa'));var jayson=require(_0x3d96('0xb'));var client=jayson[_0x3d96('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32f836,_0x2d1816,_0x22e95c){return new BPromise(function(_0x5742b6,_0x5d50ab){return client[_0x3d96('0xd')](_0x32f836,_0x22e95c)[_0x3d96('0xe')](function(_0x348193){logger[_0x3d96('0xf')](_0x3d96('0x10'),_0x2d1816,_0x3d96('0x11'));logger[_0x3d96('0x12')](_0x3d96('0x13'),_0x2d1816,_0x3d96('0x11'),JSON[_0x3d96('0x14')](_0x348193));if(_0x348193[_0x3d96('0x15')]){if(_0x348193[_0x3d96('0x15')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x2d1816,_0x348193[_0x3d96('0x15')][_0x3d96('0x16')]);return _0x5d50ab(_0x348193[_0x3d96('0x15')][_0x3d96('0x16')]);}logger[_0x3d96('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0x2d1816,_0x348193[_0x3d96('0x15')]['message']);return _0x5742b6(_0x348193['error']['message']);}else{logger[_0x3d96('0xf')](_0x3d96('0x10'),_0x2d1816,_0x3d96('0x11'));_0x5742b6(_0x348193[_0x3d96('0x17')][_0x3d96('0x16')]);}})[_0x3d96('0x18')](function(_0x14ef9){logger[_0x3d96('0x15')](_0x3d96('0x10'),_0x2d1816,_0x14ef9);_0x5d50ab(_0x14ef9);});});} \ No newline at end of file +var _0x9bf2=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5f5a7a,_0x440f2a){var _0x2fb9cd=function(_0x1889e2){while(--_0x1889e2){_0x5f5a7a['push'](_0x5f5a7a['shift']());}};_0x2fb9cd(++_0x440f2a);}(_0x9bf2,0x179));var _0x29bf=function(_0x25263b,_0x4cb51a){_0x25263b=_0x25263b-0x0;var _0x23e054=_0x9bf2[_0x25263b];return _0x23e054;};'use strict';var _=require(_0x29bf('0x0'));var util=require(_0x29bf('0x1'));var moment=require(_0x29bf('0x2'));var BPromise=require(_0x29bf('0x3'));var rs=require(_0x29bf('0x4'));var fs=require('fs');var Redis=require(_0x29bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x29bf('0x6'));var logger=require('../../config/logger')(_0x29bf('0x7'));var config=require(_0x29bf('0x8'));var jayson=require(_0x29bf('0x9'));var client=jayson['client'][_0x29bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f18f2,_0x57445c,_0x2fd698){return new BPromise(function(_0x4157fb,_0x5d11b5){return client['request'](_0x3f18f2,_0x2fd698)['then'](function(_0x48f525){logger[_0x29bf('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x57445c,'request\x20sent');logger[_0x29bf('0xc')](_0x29bf('0xd'),_0x57445c,_0x29bf('0xe'),JSON[_0x29bf('0xf')](_0x48f525));if(_0x48f525[_0x29bf('0x10')]){if(_0x48f525['error']['code']===0x1f4){logger[_0x29bf('0x10')](_0x29bf('0x11'),_0x57445c,_0x48f525['error'][_0x29bf('0x12')]);return _0x5d11b5(_0x48f525[_0x29bf('0x10')][_0x29bf('0x12')]);}logger['error'](_0x29bf('0x11'),_0x57445c,_0x48f525['error'][_0x29bf('0x12')]);return _0x4157fb(_0x48f525[_0x29bf('0x10')][_0x29bf('0x12')]);}else{logger[_0x29bf('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x57445c,_0x29bf('0xe'));_0x4157fb(_0x48f525[_0x29bf('0x13')][_0x29bf('0x12')]);}})[_0x29bf('0x14')](function(_0x5ed7e8){logger[_0x29bf('0x10')](_0x29bf('0x11'),_0x57445c,_0x5ed7e8);_0x5d11b5(_0x5ed7e8);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8c5e652..b1bcbe3 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x16c85f,_0x184d9c){var _0x52208f=function(_0x102113){while(--_0x102113){_0x16c85f['push'](_0x16c85f['shift']());}};_0x52208f(++_0x184d9c);}(_0x70e0,0x17b));var _0x070e=function(_0x138c35,_0x5f0b06){_0x138c35=_0x138c35-0x0;var _0x1ae302=_0x70e0[_0x138c35];return _0x1ae302;};'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(_0x36ed6c,_0x302b25){var _0x13a7e4=function(_0x429a79){while(--_0x429a79){_0x36ed6c['push'](_0x36ed6c['shift']());}};_0x13a7e4(++_0x302b25);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index fc170d9..939cf64 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 _0x1ec5=['INTEGER','sequelize','exports'];(function(_0x52d87d,_0x242189){var _0x33723d=function(_0x4c3fa2){while(--_0x4c3fa2){_0x52d87d['push'](_0x52d87d['shift']());}};_0x33723d(++_0x242189);}(_0x1ec5,0x19f));var _0x51ec=function(_0x526026,_0x3ca1dd){_0x526026=_0x526026-0x0;var _0x278f57=_0x1ec5[_0x526026];return _0x278f57;};'use strict';var Sequelize=require(_0x51ec('0x0'));module[_0x51ec('0x1')]={'penalty':{'type':Sequelize[_0x51ec('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdfaa=['INTEGER','sequelize','exports'];(function(_0x4b9aa0,_0x231795){var _0x4bc943=function(_0x24031a){while(--_0x24031a){_0x4b9aa0['push'](_0x4b9aa0['shift']());}};_0x4bc943(++_0x231795);}(_0xdfaa,0xd0));var _0xadfa=function(_0x1df8ac,_0xacf5e3){_0x1df8ac=_0x1df8ac-0x0;var _0x5f3109=_0xdfaa[_0x1df8ac];return _0x5f3109;};'use strict';var Sequelize=require(_0xadfa('0x0'));module[_0xadfa('0x1')]={'penalty':{'type':Sequelize[_0xadfa('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f18402e..cc0fe17 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 _0x6305=['UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x20c12f,_0x18ab02){var _0x476bf0=function(_0x56266d){while(--_0x56266d){_0x20c12f['push'](_0x20c12f['shift']());}};_0x476bf0(++_0x18ab02);}(_0x6305,0x1db));var _0x5630=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6305[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5630('0x0'));var util=require('util');var logger=require(_0x5630('0x1'))(_0x5630('0x2'));var moment=require('moment');var BPromise=require(_0x5630('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5630('0x4'));var rimraf=require(_0x5630('0x5'));var config=require(_0x5630('0x6'));var attributes=require(_0x5630('0x7'));module[_0x5630('0x8')]=function(_0x1cff80,_0x40e2d6){return _0x1cff80['define'](_0x5630('0x9'),attributes,{'tableName':_0x5630('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24b0=['request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x4ede93,_0x3ae7cc){var _0x5d135b=function(_0x26fd0b){while(--_0x26fd0b){_0x4ede93['push'](_0x4ede93['shift']());}};_0x5d135b(++_0x3ae7cc);}(_0x24b0,0x14d));var _0x024b=function(_0x49cc93,_0x24fdfa){_0x49cc93=_0x49cc93-0x0;var _0x6dddc6=_0x24b0[_0x49cc93];return _0x6dddc6;};'use strict';var _=require('lodash');var util=require(_0x024b('0x0'));var logger=require(_0x024b('0x1'))(_0x024b('0x2'));var moment=require(_0x024b('0x3'));var BPromise=require(_0x024b('0x4'));var rp=require(_0x024b('0x5'));var fs=require('fs');var path=require(_0x024b('0x6'));var rimraf=require(_0x024b('0x7'));var config=require('../../config/environment');var attributes=require(_0x024b('0x8'));module[_0x024b('0x9')]=function(_0x2d17a2,_0x2437d8){return _0x2d17a2[_0x024b('0xa')](_0x024b('0xb'),attributes,{'tableName':_0x024b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 1b79091..7a1fc1e 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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\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(_0x2824e7,_0x48bd3d){var _0x40c74f=function(_0x38ba67){while(--_0x38ba67){_0x2824e7['push'](_0x2824e7['shift']());}};_0x40c74f(++_0x48bd3d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4d9c3b,_0x3c4663){_0x4d9c3b=_0x4d9c3b-0x0;var _0x35c391=_0x7fbe[_0x4d9c3b];return _0x35c391;};'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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1b007b,_0x184faa){var _0x255040=function(_0x2569b1){while(--_0x2569b1){_0x1b007b['push'](_0x1b007b['shift']());}};_0x255040(++_0x184faa);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index f979112..39df1d4 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 _0xe58f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0xe58f,0x88));var _0xfe58=function(_0x49d43c,_0x25a159){_0x49d43c=_0x49d43c-0x0;var _0x2a3c49=_0xe58f[_0x49d43c];return _0x2a3c49;};'use strict';var multer=require(_0xfe58('0x0'));var util=require(_0xfe58('0x1'));var path=require(_0xfe58('0x2'));var timeout=require(_0xfe58('0x3'));var express=require(_0xfe58('0x4'));var router=express[_0xfe58('0x5')]();var fs_extra=require(_0xfe58('0x6'));var auth=require(_0xfe58('0x7'));var interaction=require(_0xfe58('0x8'));var config=require(_0xfe58('0x9'));var controller=require(_0xfe58('0xa'));router[_0xfe58('0xb')]('/',auth[_0xfe58('0xc')](),controller['sendUserNotification']);module[_0xfe58('0xd')]=router; \ No newline at end of file +var _0x2670=['isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2d4ad5,_0x72d32f){var _0x19fa5e=function(_0x364281){while(--_0x364281){_0x2d4ad5['push'](_0x2d4ad5['shift']());}};_0x19fa5e(++_0x72d32f);}(_0x2670,0x71));var _0x0267=function(_0x5b2ac3,_0x47a056){_0x5b2ac3=_0x5b2ac3-0x0;var _0x239837=_0x2670[_0x5b2ac3];return _0x239837;};'use strict';var multer=require('multer');var util=require(_0x0267('0x0'));var path=require(_0x0267('0x1'));var timeout=require(_0x0267('0x2'));var express=require('express');var router=express[_0x0267('0x3')]();var fs_extra=require(_0x0267('0x4'));var auth=require(_0x0267('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0267('0x6'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x0267('0x7')](),controller[_0x0267('0x8')]);module[_0x0267('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 2e4970d..5be790b 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 _0x8430=['STRING','sequelize','exports','TEXT'];(function(_0x4ccd32,_0x3b11c9){var _0x30b693=function(_0x1b816f){while(--_0x1b816f){_0x4ccd32['push'](_0x4ccd32['shift']());}};_0x30b693(++_0x3b11c9);}(_0x8430,0x1a1));var _0x0843=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x8430[_0x4d8789];return _0x404e41;};'use strict';var Sequelize=require(_0x0843('0x0'));module[_0x0843('0x1')]={'body':{'type':Sequelize[_0x0843('0x2')]},'senderName':{'type':Sequelize[_0x0843('0x3')]},'recipientsId':{'type':Sequelize[_0x0843('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0843('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x3103=['TEXT','STRING','BOOLEAN'];(function(_0x1c0ce4,_0x458bc6){var _0x17ed4a=function(_0x2b2469){while(--_0x2b2469){_0x1c0ce4['push'](_0x1c0ce4['shift']());}};_0x17ed4a(++_0x458bc6);}(_0x3103,0x1ef));var _0x3310=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0x3103[_0x19e08e];return _0x14c229;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3310('0x0')]},'senderName':{'type':Sequelize[_0x3310('0x1')]},'recipientsId':{'type':Sequelize[_0x3310('0x0')]},'recipientsDescription':{'type':Sequelize[_0x3310('0x1')]},'beep':{'type':Sequelize[_0x3310('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 5981a76..ceff837 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 _0x9fb3=['queue','ids','push','all','union','flatten','catch','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','user','recipientsId','join','sequelize','forEach','recipient','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','User'];(function(_0x1d7942,_0xf8e76){var _0x46f91e=function(_0x175f80){while(--_0x175f80){_0x1d7942['push'](_0x1d7942['shift']());}};_0x46f91e(++_0xf8e76);}(_0x9fb3,0xd1));var _0x39fb=function(_0x4946e3,_0xe02aed){_0x4946e3=_0x4946e3-0x0;var _0x51c293=_0x9fb3[_0x4946e3];return _0x51c293;};'use strict';var emlformat=require(_0x39fb('0x0'));var rimraf=require(_0x39fb('0x1'));var zipdir=require(_0x39fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39fb('0x3'));var moment=require(_0x39fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x39fb('0x5'));var util=require(_0x39fb('0x6'));var path=require(_0x39fb('0x7'));var sox=require(_0x39fb('0x8'));var csv=require(_0x39fb('0x9'));var ejs=require(_0x39fb('0xa'));var fs=require('fs');var fs_extra=require(_0x39fb('0xb'));var _=require(_0x39fb('0xc'));var squel=require(_0x39fb('0xd'));var crypto=require(_0x39fb('0xe'));var jsforce=require(_0x39fb('0xf'));var deskjs=require(_0x39fb('0x10'));var toCsv=require(_0x39fb('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x39fb('0x11'));var authService=require(_0x39fb('0x12'));var qs=require(_0x39fb('0x13'));var as=require(_0x39fb('0x14'));var hardwareService=require(_0x39fb('0x15'));var logger=require(_0x39fb('0x16'))(_0x39fb('0x17'));var utils=require(_0x39fb('0x18'));var config=require(_0x39fb('0x19'));var licenseUtil=require(_0x39fb('0x1a'));var db=require(_0x39fb('0x1b'))['db'];config['redis']=_[_0x39fb('0x1c')](config[_0x39fb('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x39fb('0x1e'))(new Redis(config[_0x39fb('0x1d')]));require(_0x39fb('0x1f'))[_0x39fb('0x20')](socket);function respondWithStatusCode(_0x1858c9,_0x425b8d){_0x425b8d=_0x425b8d||0xcc;return function(_0x14fedc){if(_0x14fedc){return _0x1858c9[_0x39fb('0x21')](_0x425b8d);}return _0x1858c9[_0x39fb('0x22')](_0x425b8d)['end']();};}function respondWithResult(_0x204550,_0x3c73c1){_0x3c73c1=_0x3c73c1||0xc8;return function(_0xecc7bf){if(_0xecc7bf){return _0x204550['status'](_0x3c73c1)[_0x39fb('0x23')](_0xecc7bf);}};}function respondWithFilteredResult(_0x270770,_0x375892){return function(_0x1f07ac){if(_0x1f07ac){var _0x5c331b=typeof _0x375892['offset']==='undefined'&&typeof _0x375892[_0x39fb('0x24')]===_0x39fb('0x25');var _0x5a058e=_0x1f07ac[_0x39fb('0x26')];var _0x35c335=_0x5c331b?0x0:_0x375892[_0x39fb('0x27')];var _0x2fa9f7=_0x5c331b?_0x1f07ac[_0x39fb('0x26')]:_0x375892[_0x39fb('0x27')]+_0x375892[_0x39fb('0x24')];var _0x572e35;if(_0x2fa9f7>=_0x5a058e){_0x2fa9f7=_0x5a058e;_0x572e35=0xc8;}else{_0x572e35=0xce;}_0x270770['status'](_0x572e35);return _0x270770[_0x39fb('0x28')](_0x39fb('0x29'),_0x35c335+'-'+_0x2fa9f7+'/'+_0x5a058e)[_0x39fb('0x23')](_0x1f07ac);}return null;};}function patchUpdates(_0x45835d){return function(_0x496a14){try{jsonpatch[_0x39fb('0x2a')](_0x496a14,_0x45835d,!![]);}catch(_0x25082c){return BPromise[_0x39fb('0x2b')](_0x25082c);}return _0x496a14[_0x39fb('0x2c')]();};}function saveUpdates(_0xb008d4,_0x2a038c){return function(_0x294b22){if(_0x294b22){return _0x294b22['update'](_0xb008d4)[_0x39fb('0x2d')](function(_0x3fcea4){return _0x3fcea4;});}return null;};}function removeEntity(_0x47e604,_0x221489){return function(_0x460b28){if(_0x460b28){return _0x460b28['destroy']()[_0x39fb('0x2d')](function(){_0x47e604['status'](0xcc)[_0x39fb('0x2e')]();});}};}function handleEntityNotFound(_0xdfa704,_0x52d61d){return function(_0x15c70c){if(!_0x15c70c){_0xdfa704[_0x39fb('0x21')](0x194);}return _0x15c70c;};}function handleError(_0x44fe22,_0x3e0a48){_0x3e0a48=_0x3e0a48||0x1f4;return function(_0xcec397){logger[_0x39fb('0x2f')](_0xcec397[_0x39fb('0x30')]);if(_0xcec397[_0x39fb('0x31')]){delete _0xcec397[_0x39fb('0x31')];}_0x44fe22[_0x39fb('0x22')](_0x3e0a48)[_0x39fb('0x32')](_0xcec397);};}exports['sendUserNotification']=function(_0x209548,_0x50b2f1,_0x4f0b92){if(!_0x209548[_0x39fb('0x33')][_0x39fb('0x34')](_0x39fb('0x35'))&&!_0x209548[_0x39fb('0x33')]['hasOwnProperty'](_0x39fb('0x36'))){throw new db[(_0x39fb('0x37'))][(_0x39fb('0x38'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x209548[_0x39fb('0x33')][_0x39fb('0x34')](_0x39fb('0x36'))&&!_0x209548[_0x39fb('0x33')]['hasOwnProperty']('view')){throw new db['Sequelize'][(_0x39fb('0x38'))](_0x39fb('0x39'));}if(!_0x209548[_0x39fb('0x33')][_0x39fb('0x34')]('recipients')){throw new db[(_0x39fb('0x37'))][(_0x39fb('0x38'))](_0x39fb('0x3a'));}else{try{var _0x2d91e0=JSON[_0x39fb('0x3b')](_0x209548[_0x39fb('0x33')][_0x39fb('0x3c')]);}catch(_0x4ac051){logger[_0x39fb('0x2f')](_0x4ac051);throw new db[(_0x39fb('0x37'))][(_0x39fb('0x38'))](_0x39fb('0x3d'));}var _0x9d0f9a=[_0x39fb('0x3e'),'faxqueue','mailqueue',_0x39fb('0x3f'),_0x39fb('0x40'),_0x39fb('0x41'),_0x39fb('0x42'),'team','user'];if(_[_0x39fb('0x43')](_0x2d91e0,function(_0x4184ca){return!_[_0x39fb('0x44')](_0x9d0f9a,_0x4184ca[_0x39fb('0x45')][_0x39fb('0x46')]());})){throw new db[(_0x39fb('0x37'))][(_0x39fb('0x38'))](_0x39fb('0x47'));}}}var _0x534a32={};_0x534a32['senderName']=_0x209548[_0x39fb('0x33')][_0x39fb('0x34')](_0x39fb('0x48'))?_0x209548[_0x39fb('0x33')][_0x39fb('0x48')]:_0x209548['user'][_0x39fb('0x49')];_0x534a32[_0x39fb('0x4a')]=_['isEmpty'](_0x209548[_0x39fb('0x33')][_0x39fb('0x4a')])?null:_0x209548[_0x39fb('0x33')][_0x39fb('0x4a')];_0x534a32[_0x39fb('0x4b')]=_0x209548[_0x39fb('0x33')][_0x39fb('0x4b')]||![];_0x534a32[_0x39fb('0x4c')]=_0x209548[_0x39fb('0x4d')]['id'];return getContent(_0x209548[_0x39fb('0x33')])[_0x39fb('0x2d')](function(_0x8e5a46){_0x534a32['body']=_0x8e5a46;return getRecipients(_0x2d91e0);})[_0x39fb('0x2d')](function(_0x576bc9){_0x534a32[_0x39fb('0x4e')]=_['sortBy'](_0x576bc9)[_0x39fb('0x4f')](',');return db[_0x39fb('0x50')]['transaction'](function(_0x3a7fe5){return db['UserNotification']['create'](_0x534a32,{'raw':!![],'transaction':_0x3a7fe5})[_0x39fb('0x2d')](function(_0x1d0fcd){var _0x4beca4={'sender':_0x534a32[_0x39fb('0x48')],'description':_0x534a32['recipientsDescription'],'content':_0x534a32[_0x39fb('0x33')],'beep':_0x534a32[_0x39fb('0x4b')]};_0x576bc9[_0x39fb('0x51')](function(_0x2c1cb8){_0x4beca4[_0x39fb('0x52')]=_0x2c1cb8;socket['emit'](_0x39fb('0x53'),_0x4beca4);});return _0x1d0fcd;});});})[_0x39fb('0x2d')](respondWithResult(_0x50b2f1,0xc9))['catch'](handleError(_0x50b2f1,null));};function getContent(_0x36d027){return new BPromise(function(_0x30848a,_0x28b1c2){if(_0x36d027[_0x39fb('0x35')]){_0x30848a(_0x36d027[_0x39fb('0x35')]);return;}return db[_0x39fb('0x54')][_0x39fb('0x55')]({'attributes':[_0x39fb('0x56')],'where':{'id':_0x36d027[_0x39fb('0x36')]},'raw':!![]})[_0x39fb('0x2d')](function(_0x5151d9){if(!_0x5151d9)throw new db[(_0x39fb('0x37'))][(_0x39fb('0x38'))](_0x39fb('0x57'));var _0x11c98b=Mustache[_0x39fb('0x58')](_0x5151d9[_0x39fb('0x56')],_0x36d027[_0x39fb('0x59')]);_0x30848a(_0x11c98b);})['catch'](function(_0x2cfdd3){_0x28b1c2(_0x2cfdd3);});});}function getRecipients(_0x3c817){return new BPromise(function(_0xe536ae,_0x2648af){var _0x4b9f60=[];var _0x591f11=[];_0x3c817[_0x39fb('0x51')](function(_0x181866){var _0x385b6a=_['startCase'](_0x181866['model'][_0x39fb('0x46')]());if(_0x385b6a===_0x39fb('0x5a')){_0x4b9f60=_['union'](_0x4b9f60,_0x181866['ids']);}else{if(_['includes'](_0x385b6a,_0x39fb('0x5b')))_0x385b6a=_0x385b6a['replace'](_0x39fb('0x5b'),'Queue');_0x181866[_0x39fb('0x5c')][_0x39fb('0x51')](function(_0x46aac1){_0x591f11[_0x39fb('0x5d')](getAgents(_0x385b6a,_0x46aac1));});}});return BPromise[_0x39fb('0x5e')](_0x591f11)[_0x39fb('0x2d')](function(_0x28efe3){_0x4b9f60=_[_0x39fb('0x5f')](_0x4b9f60,_[_0x39fb('0x60')](_0x28efe3));_0xe536ae(_0x4b9f60);})[_0x39fb('0x61')](function(_0x56d73f){_0x2648af(_0x56d73f);});});}function getAgents(_0x4d5c7a,_0x1c00c0){return new BPromise(function(_0x112fc3,_0x2f4ea9){return db[_0x4d5c7a][_0x39fb('0x55')]({'where':{'id':_0x1c00c0}})[_0x39fb('0x2d')](function(_0x3d9357){return _0x3d9357[_0x39fb('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22bd7f){var _0x2d60d2=_[_0x39fb('0x63')](_0x22bd7f,'id');_0x112fc3(_0x2d60d2);});})[_0x39fb('0x61')](function(_0x325035){_0x2f4ea9(_0x325035);});});} \ No newline at end of file +var _0xf14f=['User','union','ids','queue','replace','Queue','push','all','flatten','map','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','count','limit','then','destroy','error','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','model'];(function(_0x15ddc9,_0x209223){var _0x2fc9e8=function(_0x2d5e5f){while(--_0x2d5e5f){_0x15ddc9['push'](_0x15ddc9['shift']());}};_0x2fc9e8(++_0x209223);}(_0xf14f,0x1c7));var _0xff14=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xf14f[_0x545a3a];return _0x5a5493;};'use strict';var emlformat=require(_0xff14('0x0'));var rimraf=require(_0xff14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xff14('0x2'));var moment=require('moment');var BPromise=require(_0xff14('0x3'));var Mustache=require(_0xff14('0x4'));var util=require(_0xff14('0x5'));var path=require(_0xff14('0x6'));var sox=require('sox');var csv=require(_0xff14('0x7'));var ejs=require(_0xff14('0x8'));var fs=require('fs');var fs_extra=require(_0xff14('0x9'));var _=require('lodash');var squel=require(_0xff14('0xa'));var crypto=require(_0xff14('0xb'));var jsforce=require(_0xff14('0xc'));var deskjs=require(_0xff14('0xd'));var toCsv=require(_0xff14('0x7'));var querystring=require('querystring');var Papa=require(_0xff14('0xe'));var Redis=require(_0xff14('0xf'));var authService=require(_0xff14('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xff14('0x11'))(_0xff14('0x12'));var utils=require(_0xff14('0x13'));var config=require(_0xff14('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xff14('0x15'))['db'];config[_0xff14('0x16')]=_[_0xff14('0x17')](config[_0xff14('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff14('0x16')]));require('./userNotification.socket')[_0xff14('0x18')](socket);function respondWithStatusCode(_0x4a843b,_0x4a9d9f){_0x4a9d9f=_0x4a9d9f||0xcc;return function(_0x4bc5d8){if(_0x4bc5d8){return _0x4a843b[_0xff14('0x19')](_0x4a9d9f);}return _0x4a843b[_0xff14('0x1a')](_0x4a9d9f)[_0xff14('0x1b')]();};}function respondWithResult(_0x2938ee,_0x522f93){_0x522f93=_0x522f93||0xc8;return function(_0x53add6){if(_0x53add6){return _0x2938ee[_0xff14('0x1a')](_0x522f93)[_0xff14('0x1c')](_0x53add6);}};}function respondWithFilteredResult(_0x308532,_0x5e264b){return function(_0x4135db){if(_0x4135db){var _0x3c2417=typeof _0x5e264b[_0xff14('0x1d')]==='undefined'&&typeof _0x5e264b['limit']===_0xff14('0x1e');var _0x2f5289=_0x4135db['count'];var _0x2d1dae=_0x3c2417?0x0:_0x5e264b[_0xff14('0x1d')];var _0xb054dc=_0x3c2417?_0x4135db[_0xff14('0x1f')]:_0x5e264b[_0xff14('0x1d')]+_0x5e264b[_0xff14('0x20')];var _0xff5ed;if(_0xb054dc>=_0x2f5289){_0xb054dc=_0x2f5289;_0xff5ed=0xc8;}else{_0xff5ed=0xce;}_0x308532['status'](_0xff5ed);return _0x308532['set']('Content-Range',_0x2d1dae+'-'+_0xb054dc+'/'+_0x2f5289)[_0xff14('0x1c')](_0x4135db);}return null;};}function patchUpdates(_0x47d1b2){return function(_0x4e1049){try{jsonpatch['apply'](_0x4e1049,_0x47d1b2,!![]);}catch(_0x4312c6){return BPromise['reject'](_0x4312c6);}return _0x4e1049['save']();};}function saveUpdates(_0x122544,_0x197e3b){return function(_0x42ea41){if(_0x42ea41){return _0x42ea41['update'](_0x122544)[_0xff14('0x21')](function(_0x59e2a9){return _0x59e2a9;});}return null;};}function removeEntity(_0x55d4e9,_0x3c6958){return function(_0x30efaa){if(_0x30efaa){return _0x30efaa[_0xff14('0x22')]()[_0xff14('0x21')](function(){_0x55d4e9['status'](0xcc)[_0xff14('0x1b')]();});}};}function handleEntityNotFound(_0x5c403e,_0x158583){return function(_0x5f1267){if(!_0x5f1267){_0x5c403e[_0xff14('0x19')](0x194);}return _0x5f1267;};}function handleError(_0x5d2950,_0x1dbae8){_0x1dbae8=_0x1dbae8||0x1f4;return function(_0x54e9bb){logger[_0xff14('0x23')](_0x54e9bb['stack']);if(_0x54e9bb[_0xff14('0x24')]){delete _0x54e9bb['name'];}_0x5d2950[_0xff14('0x1a')](_0x1dbae8)[_0xff14('0x25')](_0x54e9bb);};}exports[_0xff14('0x26')]=function(_0x4a004d,_0x242fbb,_0x164ff5){if(!_0x4a004d['body'][_0xff14('0x27')](_0xff14('0x28'))&&!_0x4a004d[_0xff14('0x29')][_0xff14('0x27')](_0xff14('0x2a'))){throw new db[(_0xff14('0x2b'))][(_0xff14('0x2c'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x4a004d['body'][_0xff14('0x27')](_0xff14('0x2a'))&&!_0x4a004d[_0xff14('0x29')][_0xff14('0x27')]('view')){throw new db['Sequelize']['ValidationError'](_0xff14('0x2d'));}if(!_0x4a004d[_0xff14('0x29')][_0xff14('0x27')](_0xff14('0x2e'))){throw new db[(_0xff14('0x2b'))][(_0xff14('0x2c'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2992bf=JSON[_0xff14('0x2f')](_0x4a004d['body']['recipients']);}catch(_0x28fcf1){logger[_0xff14('0x23')](_0x28fcf1);throw new db[(_0xff14('0x2b'))][(_0xff14('0x2c'))](_0xff14('0x30'));}var _0x4ee75d=[_0xff14('0x31'),'faxqueue','mailqueue','openchannelqueue','smsqueue',_0xff14('0x32'),_0xff14('0x33'),_0xff14('0x34'),_0xff14('0x35')];if(_[_0xff14('0x36')](_0x2992bf,function(_0x26ffdb){return!_[_0xff14('0x37')](_0x4ee75d,_0x26ffdb['model'][_0xff14('0x38')]());})){throw new db[(_0xff14('0x2b'))][(_0xff14('0x2c'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x116da0={};_0x116da0['senderName']=_0x4a004d[_0xff14('0x29')][_0xff14('0x27')](_0xff14('0x39'))?_0x4a004d[_0xff14('0x29')][_0xff14('0x39')]:_0x4a004d['user'][_0xff14('0x3a')];_0x116da0[_0xff14('0x3b')]=_[_0xff14('0x3c')](_0x4a004d[_0xff14('0x29')][_0xff14('0x3b')])?null:_0x4a004d[_0xff14('0x29')][_0xff14('0x3b')];_0x116da0[_0xff14('0x3d')]=_0x4a004d[_0xff14('0x29')]['beep']||![];_0x116da0['SenderId']=_0x4a004d['user']['id'];return getContent(_0x4a004d[_0xff14('0x29')])['then'](function(_0x371911){_0x116da0[_0xff14('0x29')]=_0x371911;return getRecipients(_0x2992bf);})[_0xff14('0x21')](function(_0x55ed90){_0x116da0[_0xff14('0x3e')]=_[_0xff14('0x3f')](_0x55ed90)['join'](',');return db['sequelize'][_0xff14('0x40')](function(_0x4a6cd3){return db[_0xff14('0x41')][_0xff14('0x42')](_0x116da0,{'raw':!![],'transaction':_0x4a6cd3})[_0xff14('0x21')](function(_0x16b47f){var _0x49aa94={'sender':_0x116da0['senderName'],'description':_0x116da0[_0xff14('0x3b')],'content':_0x116da0['body'],'beep':_0x116da0[_0xff14('0x3d')]};_0x55ed90[_0xff14('0x43')](function(_0x4f0672){_0x49aa94[_0xff14('0x44')]=_0x4f0672;socket['emit'](_0xff14('0x45'),_0x49aa94);});return _0x16b47f;});});})[_0xff14('0x21')](respondWithResult(_0x242fbb,0xc9))[_0xff14('0x46')](handleError(_0x242fbb,null));};function getContent(_0x7e1965){return new BPromise(function(_0x4ecf1c,_0x595418){if(_0x7e1965[_0xff14('0x28')]){_0x4ecf1c(_0x7e1965['text']);return;}return db[_0xff14('0x47')][_0xff14('0x48')]({'attributes':[_0xff14('0x49')],'where':{'id':_0x7e1965['TemplateId']},'raw':!![]})[_0xff14('0x21')](function(_0x17328e){if(!_0x17328e)throw new db[(_0xff14('0x2b'))]['ValidationError'](_0xff14('0x4a'));var _0x1795ae=Mustache[_0xff14('0x4b')](_0x17328e[_0xff14('0x49')],_0x7e1965[_0xff14('0x4c')]);_0x4ecf1c(_0x1795ae);})[_0xff14('0x46')](function(_0x1bf99e){_0x595418(_0x1bf99e);});});}function getRecipients(_0x162823){return new BPromise(function(_0x50f3d9,_0xbf71b0){var _0x2acc50=[];var _0x44ea47=[];_0x162823[_0xff14('0x43')](function(_0x2d545c){var _0x1dc4c6=_[_0xff14('0x4d')](_0x2d545c[_0xff14('0x4e')][_0xff14('0x38')]());if(_0x1dc4c6===_0xff14('0x4f')){_0x2acc50=_[_0xff14('0x50')](_0x2acc50,_0x2d545c[_0xff14('0x51')]);}else{if(_[_0xff14('0x37')](_0x1dc4c6,_0xff14('0x52')))_0x1dc4c6=_0x1dc4c6[_0xff14('0x53')]('queue',_0xff14('0x54'));_0x2d545c['ids'][_0xff14('0x43')](function(_0x2202e9){_0x44ea47[_0xff14('0x55')](getAgents(_0x1dc4c6,_0x2202e9));});}});return BPromise[_0xff14('0x56')](_0x44ea47)[_0xff14('0x21')](function(_0x53e47b){_0x2acc50=_[_0xff14('0x50')](_0x2acc50,_[_0xff14('0x57')](_0x53e47b));_0x50f3d9(_0x2acc50);})[_0xff14('0x46')](function(_0x266d8f){_0xbf71b0(_0x266d8f);});});}function getAgents(_0x2a5c1c,_0x2b93d8){return new BPromise(function(_0x3457b8,_0x173ec4){return db[_0x2a5c1c]['findOne']({'where':{'id':_0x2b93d8}})[_0xff14('0x21')](function(_0x3806d1){return _0x3806d1['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x69e7c1){var _0x51f4be=_[_0xff14('0x58')](_0x69e7c1,'id');_0x3457b8(_0x51f4be);});})[_0xff14('0x46')](function(_0x3f0b22){_0x173ec4(_0x3f0b22);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 29c178d..3c7ed11 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 _0xd8ff=['remove','emit','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x246f6e,_0xc688e1){var _0x1d43be=function(_0x7fc0b7){while(--_0x7fc0b7){_0x246f6e['push'](_0x246f6e['shift']());}};_0x1d43be(++_0xc688e1);}(_0xd8ff,0xf4));var _0xfd8f=function(_0x4eb30f,_0x2bfad8){_0x4eb30f=_0x4eb30f-0x0;var _0xc26a9a=_0xd8ff[_0x4eb30f];return _0xc26a9a;};'use strict';var EventEmitter=require(_0xfd8f('0x0'));var UserNotification=require(_0xfd8f('0x1'))['db'][_0xfd8f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xfd8f('0x3')](0x0);var events={'afterCreate':_0xfd8f('0x4'),'afterUpdate':_0xfd8f('0x5'),'afterDestroy':_0xfd8f('0x6')};function emitEvent(_0x58c21f){return function(_0x228d09,_0x403182,_0x49f018){UserNotificationEvents[_0xfd8f('0x7')](_0x58c21f+':'+_0x228d09['id'],_0x228d09);UserNotificationEvents[_0xfd8f('0x7')](_0x58c21f,_0x228d09);_0x49f018(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xfd8f('0x8')](e,emitEvent(event));}}module[_0xfd8f('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xd15a=['events','../../mysqldb','UserNotification','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x1f4698,_0x178766){var _0x558451=function(_0x3e566a){while(--_0x3e566a){_0x1f4698['push'](_0x1f4698['shift']());}};_0x558451(++_0x178766);}(_0xd15a,0x168));var _0xad15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd15a[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xad15('0x0'));var UserNotification=require(_0xad15('0x1'))['db'][_0xad15('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xad15('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad15('0x4'),'afterDestroy':'remove'};function emitEvent(_0xfc996f){return function(_0x3c3346,_0x51ef3b,_0x100843){UserNotificationEvents[_0xad15('0x5')](_0xfc996f+':'+_0x3c3346['id'],_0x3c3346);UserNotificationEvents['emit'](_0xfc996f,_0x3c3346);_0x100843(null);};}for(var e in events){if(events[_0xad15('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xad15('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 3122237..5608a9f 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 _0xe51e=['UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0xe51e,0x1d1));var _0xee51=function(_0x3992da,_0x203d3e){_0x3992da=_0x3992da-0x0;var _0x11178a=_0xe51e[_0x3992da];return _0x11178a;};'use strict';var _=require(_0xee51('0x0'));var util=require(_0xee51('0x1'));var logger=require(_0xee51('0x2'))(_0xee51('0x3'));var moment=require('moment');var BPromise=require(_0xee51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee51('0x5'));var rimraf=require(_0xee51('0x6'));var config=require(_0xee51('0x7'));var attributes=require(_0xee51('0x8'));module[_0xee51('0x9')]=function(_0x57faae,_0x10b029){return _0x57faae[_0xee51('0xa')](_0xee51('0xb'),attributes,{'tableName':_0xee51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xee51('0xd')});}; \ No newline at end of file +var _0xb4cd=['api','moment','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x567600,_0x5d54d2){var _0x2be5cf=function(_0x400799){while(--_0x400799){_0x567600['push'](_0x567600['shift']());}};_0x2be5cf(++_0x5d54d2);}(_0xb4cd,0xed));var _0xdb4c=function(_0x3352f1,_0x184532){_0x3352f1=_0x3352f1-0x0;var _0x3dfdc0=_0xb4cd[_0x3352f1];return _0x3dfdc0;};'use strict';var _=require(_0xdb4c('0x0'));var util=require(_0xdb4c('0x1'));var logger=require(_0xdb4c('0x2'))(_0xdb4c('0x3'));var moment=require(_0xdb4c('0x4'));var BPromise=require(_0xdb4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb4c('0x6'));var rimraf=require(_0xdb4c('0x7'));var config=require(_0xdb4c('0x8'));var attributes=require(_0xdb4c('0x9'));module[_0xdb4c('0xa')]=function(_0x4af107,_0x1afd5a){return _0x4af107[_0xdb4c('0xb')](_0xdb4c('0xc'),attributes,{'tableName':_0xdb4c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdb4c('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 56b45e0..105dcba 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 _0x2e9d=['bluebird','ioredis','../../config/logger','rpc','http','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2b84c8,_0x183d8e){var _0x5cea29=function(_0xcf65d8){while(--_0xcf65d8){_0x2b84c8['push'](_0x2b84c8['shift']());}};_0x5cea29(++_0x183d8e);}(_0x2e9d,0x1f1));var _0xd2e9=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x2e9d[_0x382a62];return _0x490a25;};'use strict';var _=require(_0xd2e9('0x0'));var util=require(_0xd2e9('0x1'));var moment=require(_0xd2e9('0x2'));var BPromise=require(_0xd2e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd2e9('0x5'))(_0xd2e9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd2e9('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xd2e9('0x8'),'port':0x18eb});var socket=require(_0xd2e9('0x9'))(new Redis(config['redis']));require(_0xd2e9('0xa'))[_0xd2e9('0xb')](socket);function respondWithRpcPromise(_0x3a54f9,_0x318618,_0x3422fd){return new BPromise(function(_0x33d5f3,_0x11bcdd){return client[_0xd2e9('0xc')](_0x3a54f9,_0x3422fd)[_0xd2e9('0xd')](function(_0x3f7120){logger[_0xd2e9('0xe')](_0xd2e9('0xf'),_0x318618,'request\x20sent');logger[_0xd2e9('0x10')](_0xd2e9('0x11'),_0x318618,_0xd2e9('0x12'),JSON[_0xd2e9('0x13')](_0x3f7120));if(_0x3f7120[_0xd2e9('0x14')]){if(_0x3f7120[_0xd2e9('0x14')][_0xd2e9('0x15')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x318618,_0x3f7120[_0xd2e9('0x14')][_0xd2e9('0x16')]);return _0x11bcdd(_0x3f7120[_0xd2e9('0x14')][_0xd2e9('0x16')]);}logger[_0xd2e9('0x14')](_0xd2e9('0xf'),_0x318618,_0x3f7120[_0xd2e9('0x14')][_0xd2e9('0x16')]);return _0x33d5f3(_0x3f7120['error'][_0xd2e9('0x16')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x318618,'request\x20sent');_0x33d5f3(_0x3f7120[_0xd2e9('0x17')][_0xd2e9('0x16')]);}})[_0xd2e9('0x18')](function(_0x590415){logger[_0xd2e9('0x14')]('UserNotification,\x20%s,\x20%s',_0x318618,_0x590415);_0x11bcdd(_0x590415);});});} \ No newline at end of file +var _0x475a=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','UserNotification,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x4fc4af,_0x14d709){var _0x3c88ca=function(_0x736da){while(--_0x736da){_0x4fc4af['push'](_0x4fc4af['shift']());}};_0x3c88ca(++_0x14d709);}(_0x475a,0x161));var _0xa475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x475a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa475('0x0'));var util=require(_0xa475('0x1'));var moment=require(_0xa475('0x2'));var BPromise=require(_0xa475('0x3'));var rs=require(_0xa475('0x4'));var fs=require('fs');var Redis=require(_0xa475('0x5'));var db=require(_0xa475('0x6'))['db'];var utils=require(_0xa475('0x7'));var logger=require(_0xa475('0x8'))(_0xa475('0x9'));var config=require(_0xa475('0xa'));var jayson=require(_0xa475('0xb'));var client=jayson[_0xa475('0xc')][_0xa475('0xd')]({'port':0x232a});config[_0xa475('0xe')]=_[_0xa475('0xf')](config['redis'],{'host':_0xa475('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa475('0xe')]));require('./userNotification.socket')[_0xa475('0x11')](socket);function respondWithRpcPromise(_0x439bb7,_0xf631df,_0x199c76){return new BPromise(function(_0x3a6553,_0x4b3e8a){return client[_0xa475('0x12')](_0x439bb7,_0x199c76)[_0xa475('0x13')](function(_0x3ebde1){logger['info'](_0xa475('0x14'),_0xf631df,'request\x20sent');logger[_0xa475('0x15')]('UserNotification,\x20%s,\x20%s,\x20%s',_0xf631df,_0xa475('0x16'),JSON[_0xa475('0x17')](_0x3ebde1));if(_0x3ebde1[_0xa475('0x18')]){if(_0x3ebde1['error']['code']===0x1f4){logger[_0xa475('0x18')](_0xa475('0x14'),_0xf631df,_0x3ebde1[_0xa475('0x18')][_0xa475('0x19')]);return _0x4b3e8a(_0x3ebde1[_0xa475('0x18')][_0xa475('0x19')]);}logger[_0xa475('0x18')](_0xa475('0x14'),_0xf631df,_0x3ebde1['error'][_0xa475('0x19')]);return _0x3a6553(_0x3ebde1[_0xa475('0x18')][_0xa475('0x19')]);}else{logger[_0xa475('0x1a')](_0xa475('0x14'),_0xf631df,'request\x20sent');_0x3a6553(_0x3ebde1[_0xa475('0x1b')][_0xa475('0x19')]);}})[_0xa475('0x1c')](function(_0x188c94){logger[_0xa475('0x18')](_0xa475('0x14'),_0xf631df,_0x188c94);_0x4b3e8a(_0x188c94);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a8d1dab..983e537 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 _0xf774=['update','register','length','userNotification:','save','remove'];(function(_0x9099b9,_0x3fe867){var _0x345d1d=function(_0x19d1b7){while(--_0x19d1b7){_0x9099b9['push'](_0x9099b9['shift']());}};_0x345d1d(++_0x3fe867);}(_0xf774,0x82));var _0x4f77=function(_0x5a51ab,_0x49c1f5){_0x5a51ab=_0x5a51ab-0x0;var _0x35ea96=_0xf774[_0x5a51ab];return _0x35ea96;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x4f77('0x0'),_0x4f77('0x1'),_0x4f77('0x2')];function createListener(_0x2277e6,_0x34b59f){return function(_0x4626e7){_0x34b59f['emit'](_0x2277e6,_0x4626e7);};}function removeListener(_0x3e1fa0,_0x5528bc){return function(){UserNotificationEvents['removeListener'](_0x3e1fa0,_0x5528bc);};}exports[_0x4f77('0x3')]=function(_0x367018){for(var _0x519406=0x0,_0x1838c0=events[_0x4f77('0x4')];_0x519406<_0x1838c0;_0x519406++){var _0x379294=events[_0x519406];var _0x2d9019=createListener(_0x4f77('0x5')+_0x379294,_0x367018);UserNotificationEvents['on'](_0x379294,_0x2d9019);}}; \ No newline at end of file +var _0x0f39=['removeListener','register','length','userNotification:','./userNotification.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f39,0xac));var _0x90f3=function(_0x289001,_0x5580ce){_0x289001=_0x289001-0x0;var _0x509ab4=_0x0f39[_0x289001];return _0x509ab4;};'use strict';var UserNotificationEvents=require(_0x90f3('0x0'));var events=[_0x90f3('0x1'),_0x90f3('0x2'),'update'];function createListener(_0x4bcbee,_0x109d73){return function(_0x1c6421){_0x109d73[_0x90f3('0x3')](_0x4bcbee,_0x1c6421);};}function removeListener(_0x1e1dab,_0x330289){return function(){UserNotificationEvents[_0x90f3('0x4')](_0x1e1dab,_0x330289);};}exports[_0x90f3('0x5')]=function(_0x47f244){for(var _0x9f6dc8=0x0,_0x27d91d=events[_0x90f3('0x6')];_0x9f6dc8<_0x27d91d;_0x9f6dc8++){var _0x32a3b9=events[_0x9f6dc8];var _0x458288=createListener(_0x90f3('0x7')+_0x32a3b9,_0x47f244);UserNotificationEvents['on'](_0x32a3b9,_0x458288);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index f885631..5fea272 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3cebff,_0x20b43d){var _0x6e5423=function(_0x1043e1){while(--_0x1043e1){_0x3cebff['push'](_0x3cebff['shift']());}};_0x6e5423(++_0x20b43d);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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(_0x116c73,_0x23a123){var _0xec9bc0=function(_0x506c49){while(--_0x506c49){_0x116c73['push'](_0x116c73['shift']());}};_0xec9bc0(++_0x23a123);}(_0x70e0,0x17b));var _0x070e=function(_0x11f79c,_0x377d6b){_0x11f79c=_0x11f79c-0x0;var _0x292adc=_0x70e0[_0x11f79c];return _0x292adc;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index be1b88e..3cce332 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 _0x647c=['INTEGER','sequelize'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x647c,0x1d3));var _0xc647=function(_0x4f1789,_0x37fda7){_0x4f1789=_0x4f1789-0x0;var _0x5bb8fe=_0x647c[_0x4f1789];return _0x5bb8fe;};'use strict';var Sequelize=require(_0xc647('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc647('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20ec=['sequelize','exports','INTEGER'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x20ec,0x12f));var _0xc20e=function(_0x5b328a,_0x5c48bc){_0x5b328a=_0x5b328a-0x0;var _0xfcf474=_0x20ec[_0x5b328a];return _0xfcf474;};'use strict';var Sequelize=require(_0xc20e('0x0'));module[_0xc20e('0x1')]={'penalty':{'type':Sequelize[_0xc20e('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 a287eba..5f7b5ec 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 _0x0d8e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x0d8e,0xe6));var _0xe0d8=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0d8e[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe0d8('0x0'))(_0xe0d8('0x1'));var moment=require(_0xe0d8('0x2'));var BPromise=require(_0xe0d8('0x3'));var rp=require(_0xe0d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0d8('0x5'));var config=require(_0xe0d8('0x6'));var attributes=require(_0xe0d8('0x7'));module['exports']=function(_0x240d96,_0x3e7609){return _0x240d96[_0xe0d8('0x8')](_0xe0d8('0x9'),attributes,{'tableName':_0xe0d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d7=['./userOpenchannelQueue.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x434bbe,_0x349f3f){var _0x210e93=function(_0x1ec1dc){while(--_0x1ec1dc){_0x434bbe['push'](_0x434bbe['shift']());}};_0x210e93(++_0x349f3f);}(_0x47d7,0xf5));var _0x747d=function(_0x1c68e8,_0x352f57){_0x1c68e8=_0x1c68e8-0x0;var _0x59d55d=_0x47d7[_0x1c68e8];return _0x59d55d;};'use strict';var _=require(_0x747d('0x0'));var util=require(_0x747d('0x1'));var logger=require(_0x747d('0x2'))(_0x747d('0x3'));var moment=require(_0x747d('0x4'));var BPromise=require(_0x747d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x747d('0x6'));var config=require('../../config/environment');var attributes=require(_0x747d('0x7'));module[_0x747d('0x8')]=function(_0x380b8b,_0x36b649){return _0x380b8b['define']('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index f32d0d2..ab1807e 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 _0x61f1=['jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x15bd43,_0x8f71a6){var _0x2dc6bd=function(_0x3a0745){while(--_0x3a0745){_0x15bd43['push'](_0x15bd43['shift']());}};_0x2dc6bd(++_0x8f71a6);}(_0x61f1,0x147));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x161f('0x0'));var util=require(_0x161f('0x1'));var moment=require(_0x161f('0x2'));var BPromise=require(_0x161f('0x3'));var rs=require(_0x161f('0x4'));var fs=require('fs');var Redis=require(_0x161f('0x5'));var db=require(_0x161f('0x6'))['db'];var utils=require(_0x161f('0x7'));var logger=require(_0x161f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x161f('0x9'));var client=jayson[_0x161f('0xa')][_0x161f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x495158,_0x49d086,_0x259351){return new BPromise(function(_0x2f6eb7,_0x20b383){return client[_0x161f('0xc')](_0x495158,_0x259351)[_0x161f('0xd')](function(_0x283d87){logger[_0x161f('0xe')](_0x161f('0xf'),_0x49d086,_0x161f('0x10'));logger[_0x161f('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x49d086,'request\x20sent',JSON[_0x161f('0x12')](_0x283d87));if(_0x283d87[_0x161f('0x13')]){if(_0x283d87[_0x161f('0x13')][_0x161f('0x14')]===0x1f4){logger[_0x161f('0x13')](_0x161f('0xf'),_0x49d086,_0x283d87[_0x161f('0x13')]['message']);return _0x20b383(_0x283d87[_0x161f('0x13')][_0x161f('0x15')]);}logger[_0x161f('0x13')](_0x161f('0xf'),_0x49d086,_0x283d87['error'][_0x161f('0x15')]);return _0x2f6eb7(_0x283d87[_0x161f('0x13')]['message']);}else{logger[_0x161f('0xe')](_0x161f('0xf'),_0x49d086,_0x161f('0x10'));_0x2f6eb7(_0x283d87[_0x161f('0x16')]['message']);}})[_0x161f('0x17')](function(_0x288271){logger[_0x161f('0x13')](_0x161f('0xf'),_0x49d086,_0x288271);_0x20b383(_0x288271);});});} \ No newline at end of file +var _0xd585=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x223071,_0x375d8b){var _0x499c38=function(_0x5d67be){while(--_0x5d67be){_0x223071['push'](_0x223071['shift']());}};_0x499c38(++_0x375d8b);}(_0xd585,0x1d1));var _0x5d58=function(_0x453d35,_0x3df86d){_0x453d35=_0x453d35-0x0;var _0x289d11=_0xd585[_0x453d35];return _0x289d11;};'use strict';var _=require(_0x5d58('0x0'));var util=require(_0x5d58('0x1'));var moment=require(_0x5d58('0x2'));var BPromise=require(_0x5d58('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d58('0x4'));var db=require(_0x5d58('0x5'))['db'];var utils=require(_0x5d58('0x6'));var logger=require(_0x5d58('0x7'))(_0x5d58('0x8'));var config=require(_0x5d58('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x432aec,_0x4dc692,_0x4ee91a){return new BPromise(function(_0x1dce93,_0x4668e5){return client[_0x5d58('0xa')](_0x432aec,_0x4ee91a)[_0x5d58('0xb')](function(_0x1a9fcd){logger['info'](_0x5d58('0xc'),_0x4dc692,_0x5d58('0xd'));logger[_0x5d58('0xe')](_0x5d58('0xf'),_0x4dc692,_0x5d58('0xd'),JSON[_0x5d58('0x10')](_0x1a9fcd));if(_0x1a9fcd[_0x5d58('0x11')]){if(_0x1a9fcd[_0x5d58('0x11')][_0x5d58('0x12')]===0x1f4){logger[_0x5d58('0x11')](_0x5d58('0xc'),_0x4dc692,_0x1a9fcd[_0x5d58('0x11')][_0x5d58('0x13')]);return _0x4668e5(_0x1a9fcd[_0x5d58('0x11')]['message']);}logger[_0x5d58('0x11')](_0x5d58('0xc'),_0x4dc692,_0x1a9fcd[_0x5d58('0x11')][_0x5d58('0x13')]);return _0x1dce93(_0x1a9fcd[_0x5d58('0x11')][_0x5d58('0x13')]);}else{logger['info'](_0x5d58('0xc'),_0x4dc692,_0x5d58('0xd'));_0x1dce93(_0x1a9fcd[_0x5d58('0x14')][_0x5d58('0x13')]);}})[_0x5d58('0x15')](function(_0x40f98f){logger[_0x5d58('0x11')](_0x5d58('0xc'),_0x4dc692,_0x40f98f);_0x4668e5(_0x40f98f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3ac24e2..c7b091d 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 _0xd9f1=['delete','removeSections','removeResources','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addSections','addResources','update','destroy'];(function(_0x257e44,_0x5cb2ff){var _0x46a26a=function(_0x1bd8c0){while(--_0x1bd8c0){_0x257e44['push'](_0x257e44['shift']());}};_0x46a26a(++_0x5cb2ff);}(_0xd9f1,0x1df));var _0x1d9f=function(_0x58fcf5,_0x3685fd){_0x58fcf5=_0x58fcf5-0x0;var _0x4c53bc=_0xd9f1[_0x58fcf5];return _0x4c53bc;};'use strict';var multer=require(_0x1d9f('0x0'));var util=require(_0x1d9f('0x1'));var path=require('path');var timeout=require(_0x1d9f('0x2'));var express=require(_0x1d9f('0x3'));var router=express[_0x1d9f('0x4')]();var fs_extra=require(_0x1d9f('0x5'));var auth=require(_0x1d9f('0x6'));var interaction=require(_0x1d9f('0x7'));var config=require(_0x1d9f('0x8'));var controller=require('./userProfile.controller');router[_0x1d9f('0x9')]('/',auth[_0x1d9f('0xa')](),controller['index']);router[_0x1d9f('0x9')](_0x1d9f('0xb'),auth['isAuthenticated'](),controller[_0x1d9f('0xc')]);router[_0x1d9f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1d9f('0xd')]);router[_0x1d9f('0x9')]('/:id/sections',auth[_0x1d9f('0xa')](),controller[_0x1d9f('0xe')]);router[_0x1d9f('0x9')](_0x1d9f('0xf'),auth[_0x1d9f('0xa')](),controller[_0x1d9f('0x10')]);router[_0x1d9f('0x11')]('/',auth[_0x1d9f('0xa')](),controller[_0x1d9f('0x12')]);router[_0x1d9f('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0x1d9f('0x13')]);router['post'](_0x1d9f('0x14'),auth['isAuthenticated'](),controller[_0x1d9f('0x15')]);router[_0x1d9f('0x11')](_0x1d9f('0xf'),auth[_0x1d9f('0xa')](),controller[_0x1d9f('0x16')]);router['put']('/:id',auth[_0x1d9f('0xa')](),controller[_0x1d9f('0x17')]);router['delete']('/:id',auth[_0x1d9f('0xa')](),controller[_0x1d9f('0x18')]);router[_0x1d9f('0x19')](_0x1d9f('0x14'),auth['isAuthenticated'](),controller[_0x1d9f('0x1a')]);router['delete'](_0x1d9f('0xf'),auth['isAuthenticated'](),controller[_0x1d9f('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x4764=['/:id','show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x4764,0x14f));var _0x4476=function(_0x48e67b,_0x52b5fc){_0x48e67b=_0x48e67b-0x0;var _0x3d3dcb=_0x4764[_0x48e67b];return _0x3d3dcb;};'use strict';var multer=require(_0x4476('0x0'));var util=require(_0x4476('0x1'));var path=require(_0x4476('0x2'));var timeout=require(_0x4476('0x3'));var express=require('express');var router=express[_0x4476('0x4')]();var fs_extra=require(_0x4476('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4476('0x6'));var config=require(_0x4476('0x7'));var controller=require(_0x4476('0x8'));router[_0x4476('0x9')]('/',auth[_0x4476('0xa')](),controller[_0x4476('0xb')]);router['get'](_0x4476('0xc'),auth[_0x4476('0xa')](),controller['describe']);router[_0x4476('0x9')](_0x4476('0xd'),auth[_0x4476('0xa')](),controller[_0x4476('0xe')]);router[_0x4476('0x9')](_0x4476('0xf'),auth['isAuthenticated'](),controller[_0x4476('0x10')]);router[_0x4476('0x9')](_0x4476('0x11'),auth[_0x4476('0xa')](),controller[_0x4476('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4476('0x13')]);router[_0x4476('0x14')](_0x4476('0x15'),auth[_0x4476('0xa')](),controller['clone']);router[_0x4476('0x14')](_0x4476('0xf'),auth[_0x4476('0xa')](),controller['addSections']);router[_0x4476('0x14')]('/:id/resources',auth[_0x4476('0xa')](),controller['addResources']);router[_0x4476('0x16')](_0x4476('0xd'),auth[_0x4476('0xa')](),controller[_0x4476('0x17')]);router[_0x4476('0x18')](_0x4476('0xd'),auth[_0x4476('0xa')](),controller[_0x4476('0x19')]);router[_0x4476('0x18')](_0x4476('0xf'),auth['isAuthenticated'](),controller[_0x4476('0x1a')]);router[_0x4476('0x18')](_0x4476('0x11'),auth[_0x4476('0xa')](),controller[_0x4476('0x1b')]);module[_0x4476('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e9b3755..5710f80 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 _0x86e0=['sequelize','exports','STRING','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x37c10d,_0x46479b){var _0x38dca9=function(_0x4d95be){while(--_0x4d95be){_0x37c10d['push'](_0x37c10d['shift']());}};_0x38dca9(++_0x46479b);}(_0x86e0,0xc6));var _0x086e=function(_0x4fcdce,_0xc02f7d){_0x4fcdce=_0x4fcdce-0x0;var _0x5432df=_0x86e0[_0x4fcdce];return _0x5432df;};'use strict';var Sequelize=require(_0x086e('0x0'));module[_0x086e('0x1')]={'name':{'type':Sequelize[_0x086e('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x086e('0x2')],'set':function(_0x1b9429){this[_0x086e('0x3')]('crudPermissions',_0x1b9429?_0x1b9429[_0x086e('0x4')](''):[]);},'get':function(){return this[_0x086e('0x5')](_0x086e('0x6'))?this['getDataValue']('crudPermissions')[_0x086e('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x086e('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x086e('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x086e('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x086e('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x086e('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x086e('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x086e('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x086e('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa65d=['setDataValue','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5172b3,_0x1a7ebb){var _0x36092c=function(_0x300e9c){while(--_0x300e9c){_0x5172b3['push'](_0x5172b3['shift']());}};_0x36092c(++_0x1a7ebb);}(_0xa65d,0xb0));var _0xda65=function(_0x9ad586,_0x5dcbfc){_0x9ad586=_0x9ad586-0x0;var _0x2b1268=_0xa65d[_0x9ad586];return _0x2b1268;};'use strict';var Sequelize=require(_0xda65('0x0'));module[_0xda65('0x1')]={'name':{'type':Sequelize[_0xda65('0x2')],'allowNull':![],'unique':_0xda65('0x3')},'crudPermissions':{'type':Sequelize[_0xda65('0x2')],'set':function(_0x411faa){this[_0xda65('0x4')]('crudPermissions',_0x411faa?_0x411faa['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xda65('0x5')](_0xda65('0x6'))[_0xda65('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xda65('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xda65('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xda65('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xda65('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xda65('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xda65('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xda65('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 0e4038b..42470cb 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 _0x7177=['sectionId','userProfileId','Resources','describe','addSections','sequelize','push','get','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','UserProfile','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','omit','updatedAt','body','createdAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource'];(function(_0x5744d2,_0x1805cc){var _0x416bf4=function(_0x222d6d){while(--_0x222d6d){_0x5744d2['push'](_0x5744d2['shift']());}};_0x416bf4(++_0x1805cc);}(_0x7177,0x101));var _0x7717=function(_0x1ec8f9,_0x22f5e7){_0x1ec8f9=_0x1ec8f9-0x0;var _0x17cd3d=_0x7177[_0x1ec8f9];return _0x17cd3d;};'use strict';var emlformat=require(_0x7717('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7717('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7717('0x2'));var moment=require(_0x7717('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7717('0x4'));var util=require(_0x7717('0x5'));var path=require('path');var sox=require(_0x7717('0x6'));var csv=require(_0x7717('0x7'));var ejs=require(_0x7717('0x8'));var fs=require('fs');var fs_extra=require(_0x7717('0x9'));var _=require(_0x7717('0xa'));var squel=require(_0x7717('0xb'));var crypto=require(_0x7717('0xc'));var jsforce=require(_0x7717('0xd'));var deskjs=require(_0x7717('0xe'));var toCsv=require(_0x7717('0x7'));var querystring=require(_0x7717('0xf'));var Papa=require('papaparse');var Redis=require(_0x7717('0x10'));var authService=require(_0x7717('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7717('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7717('0x13'))(_0x7717('0x14'));var utils=require(_0x7717('0x15'));var config=require(_0x7717('0x16'));var licenseUtil=require(_0x7717('0x17'));var db=require('../../mysqldb')['db'];config[_0x7717('0x18')]=_[_0x7717('0x19')](config[_0x7717('0x18')],{'host':_0x7717('0x1a'),'port':0x18eb});var socket=require(_0x7717('0x1b'))(new Redis(config[_0x7717('0x18')]));require(_0x7717('0x1c'))['register'](socket);function respondWithStatusCode(_0xcb6d5c,_0x2cbe7b){_0x2cbe7b=_0x2cbe7b||0xcc;return function(_0x445bfd){if(_0x445bfd){return _0xcb6d5c[_0x7717('0x1d')](_0x2cbe7b);}return _0xcb6d5c[_0x7717('0x1e')](_0x2cbe7b)[_0x7717('0x1f')]();};}function respondWithResult(_0x1a63c4,_0x54671f){_0x54671f=_0x54671f||0xc8;return function(_0x546926){if(_0x546926){return _0x1a63c4[_0x7717('0x1e')](_0x54671f)['json'](_0x546926);}};}function respondWithFilteredResult(_0x2c9333,_0x48441c){return function(_0x11940a){if(_0x11940a){var _0x11fd4c=typeof _0x48441c[_0x7717('0x20')]==='undefined'&&typeof _0x48441c[_0x7717('0x21')]===_0x7717('0x22');var _0x4513d2=_0x11940a[_0x7717('0x23')];var _0x7c44aa=_0x11fd4c?0x0:_0x48441c['offset'];var _0x2c25c5=_0x11fd4c?_0x11940a[_0x7717('0x23')]:_0x48441c[_0x7717('0x20')]+_0x48441c[_0x7717('0x21')];var _0x54039f;if(_0x2c25c5>=_0x4513d2){_0x2c25c5=_0x4513d2;_0x54039f=0xc8;}else{_0x54039f=0xce;}_0x2c9333[_0x7717('0x1e')](_0x54039f);return _0x2c9333[_0x7717('0x24')](_0x7717('0x25'),_0x7c44aa+'-'+_0x2c25c5+'/'+_0x4513d2)['json'](_0x11940a);}return null;};}function patchUpdates(_0xd36587){return function(_0x31c2f6){try{jsonpatch[_0x7717('0x26')](_0x31c2f6,_0xd36587,!![]);}catch(_0x52abe9){return BPromise[_0x7717('0x27')](_0x52abe9);}return _0x31c2f6[_0x7717('0x28')]();};}function saveUpdates(_0x2e9001,_0x32ee21){return function(_0x1ab276){if(_0x1ab276){return _0x1ab276[_0x7717('0x29')](_0x2e9001)['then'](function(_0x33e592){return _0x33e592;});}return null;};}function removeEntity(_0x584fa6,_0x431d91){return function(_0x39fc4f){if(_0x39fc4f){return _0x39fc4f[_0x7717('0x2a')]()[_0x7717('0x2b')](function(){_0x584fa6[_0x7717('0x1e')](0xcc)[_0x7717('0x1f')]();});}};}function handleEntityNotFound(_0x7fa7a7,_0x59e312){return function(_0x7eab8){if(!_0x7eab8){_0x7fa7a7[_0x7717('0x1d')](0x194);}return _0x7eab8;};}function handleError(_0x208f36,_0x40242f){_0x40242f=_0x40242f||0x1f4;return function(_0x492c22){logger['error'](_0x492c22['stack']);if(_0x492c22['name']){delete _0x492c22[_0x7717('0x2c')];}_0x208f36['status'](_0x40242f)[_0x7717('0x2d')](_0x492c22);};}exports[_0x7717('0x2e')]=function(_0x18c831,_0x20e1cb){var _0x5106a0={},_0x47b4dc={},_0x5b1ee3={'count':0x0,'rows':[]};var _0x103f08=_['map'](db['UserProfile']['rawAttributes'],function(_0x18bf7a){return{'name':_0x18bf7a[_0x7717('0x2f')],'type':_0x18bf7a[_0x7717('0x30')][_0x7717('0x31')]};});_0x47b4dc[_0x7717('0x32')]=_[_0x7717('0x33')](_0x103f08,'name');_0x47b4dc[_0x7717('0x34')]=_['keys'](_0x18c831[_0x7717('0x34')]);_0x47b4dc[_0x7717('0x35')]=_['intersection'](_0x47b4dc[_0x7717('0x32')],_0x47b4dc[_0x7717('0x34')]);_0x5106a0['attributes']=_[_0x7717('0x36')](_0x47b4dc['model'],qs[_0x7717('0x37')](_0x18c831[_0x7717('0x34')]['fields']));_0x5106a0[_0x7717('0x38')]=_0x5106a0[_0x7717('0x38')]['length']?_0x5106a0[_0x7717('0x38')]:_0x47b4dc['model'];if(!_0x18c831[_0x7717('0x34')][_0x7717('0x39')](_0x7717('0x3a'))){_0x5106a0[_0x7717('0x21')]=qs[_0x7717('0x21')](_0x18c831[_0x7717('0x34')][_0x7717('0x21')]);_0x5106a0['offset']=qs['offset'](_0x18c831[_0x7717('0x34')]['offset']);}_0x5106a0[_0x7717('0x3b')]=qs['sort'](_0x18c831[_0x7717('0x34')][_0x7717('0x3c')]);_0x5106a0[_0x7717('0x3d')]=qs[_0x7717('0x35')](_[_0x7717('0x3e')](_0x18c831['query'],_0x47b4dc[_0x7717('0x35')]),_0x103f08);if(_0x18c831[_0x7717('0x34')][_0x7717('0x3f')]){_0x5106a0[_0x7717('0x3d')]=_[_0x7717('0x40')](_0x5106a0[_0x7717('0x3d')],{'$or':_[_0x7717('0x33')](_0x103f08,function(_0x31796a){if(_0x31796a[_0x7717('0x30')]!=='VIRTUAL'){var _0x329a57={};_0x329a57[_0x31796a['name']]={'$like':'%'+_0x18c831[_0x7717('0x34')][_0x7717('0x3f')]+'%'};return _0x329a57;}})});}_0x5106a0=_[_0x7717('0x40')]({},_0x5106a0,_0x18c831[_0x7717('0x41')]);var _0x1d1193={'where':_0x5106a0[_0x7717('0x3d')]};return db[_0x7717('0x42')][_0x7717('0x23')](_0x1d1193)[_0x7717('0x2b')](function(_0x4eac3a){_0x5b1ee3[_0x7717('0x23')]=_0x4eac3a;if(_0x18c831[_0x7717('0x34')]['includeAll']){_0x5106a0[_0x7717('0x43')]=[{'all':!![]}];}return db[_0x7717('0x42')][_0x7717('0x44')](_0x5106a0);})['then'](function(_0x32be90){_0x5b1ee3[_0x7717('0x45')]=_0x32be90;return _0x5b1ee3;})[_0x7717('0x2b')](respondWithFilteredResult(_0x20e1cb,_0x5106a0))[_0x7717('0x46')](handleError(_0x20e1cb,null));};exports[_0x7717('0x47')]=function(_0x208f18,_0x58427d){var _0x109485={'raw':![],'where':{'id':_0x208f18[_0x7717('0x48')]['id']}},_0x1376de={};_0x1376de['model']=_[_0x7717('0x49')](db['UserProfile'][_0x7717('0x4a')]);_0x1376de[_0x7717('0x34')]=_[_0x7717('0x49')](_0x208f18['query']);_0x1376de[_0x7717('0x35')]=_[_0x7717('0x36')](_0x1376de['model'],_0x1376de[_0x7717('0x34')]);_0x109485[_0x7717('0x38')]=_[_0x7717('0x36')](_0x1376de[_0x7717('0x32')],qs[_0x7717('0x37')](_0x208f18[_0x7717('0x34')][_0x7717('0x37')]));_0x109485['attributes']=_0x109485['attributes'][_0x7717('0x4b')]?_0x109485[_0x7717('0x38')]:_0x1376de[_0x7717('0x32')];if(_0x208f18[_0x7717('0x34')][_0x7717('0x4c')]){_0x109485[_0x7717('0x43')]=[{'all':!![]}];}_0x109485=_['merge']({},_0x109485,_0x208f18[_0x7717('0x41')]);return db[_0x7717('0x42')][_0x7717('0x4d')](_0x109485)['then'](handleEntityNotFound(_0x58427d,null))[_0x7717('0x2b')](respondWithResult(_0x58427d,null))[_0x7717('0x46')](handleError(_0x58427d,null));};exports[_0x7717('0x4e')]=function(_0x40f5e0,_0x3e1e85){return db['UserProfile'][_0x7717('0x4e')](_0x40f5e0['body'],{})[_0x7717('0x2b')](respondWithResult(_0x3e1e85,0xc9))[_0x7717('0x46')](handleError(_0x3e1e85,null));};exports['clone']=function(_0x566ad7,_0x377d5d){var _0x5b9dcb={'where':{'id':_0x566ad7[_0x7717('0x48')]['id']}},_0x4a3dba={};_0x4a3dba[_0x7717('0x32')]=_[_0x7717('0x49')](db['UserProfile'][_0x7717('0x4a')]);_0x5b9dcb['attributes']=_['intersection'](_0x4a3dba[_0x7717('0x32')],qs[_0x7717('0x37')](_0x566ad7[_0x7717('0x34')][_0x7717('0x37')]));_0x5b9dcb[_0x7717('0x38')]=_0x5b9dcb['attributes'][_0x7717('0x4b')]?_0x5b9dcb[_0x7717('0x38')]:_0x4a3dba['model'];if(_0x566ad7[_0x7717('0x34')][_0x7717('0x4c')]){_0x5b9dcb[_0x7717('0x43')]=[{'all':!![]}];}_0x5b9dcb=_[_0x7717('0x40')]({},_0x5b9dcb,_0x566ad7[_0x7717('0x41')]);return db[_0x7717('0x42')]['find'](_0x5b9dcb)[_0x7717('0x2b')](handleEntityNotFound(_0x377d5d,null))[_0x7717('0x2b')](function(_0x2f5ba8){if(_0x2f5ba8){var _0xcd1392=_0x2f5ba8['get']({'plain':!![]});_0xcd1392=qs[_0x7717('0x4f')](_0xcd1392,['id','createdAt',_0x7717('0x50'),'crudPermissions']);_0x566ad7[_0x7717('0x51')]=_['omit'](_0x566ad7[_0x7717('0x51')],['id',_0x7717('0x52'),_0x7717('0x50')]);return db['sequelize'][_0x7717('0x53')](function(_0x5d67a9){return db['UserProfile'][_0x7717('0x4e')](_[_0x7717('0x40')](_0xcd1392,_0x566ad7['body']),{'include':_0x566ad7['query'][_0x7717('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x5d67a9})[_0x7717('0x2b')](function(_0x2e434a){var _0x8c9521=_0x2e434a['get']({'plain':!![]});return db[_0x7717('0x54')][_0x7717('0x44')]({'where':{'userProfileId':_0x566ad7[_0x7717('0x48')]['id']},'raw':!![]})[_0x7717('0x2b')](function(_0x192469){if(_0x192469){return BPromise[_0x7717('0x55')](_0x192469,function(_0x2b1703){return new BPromise(function(_0x2e4acf,_0x31e24c){if(_0x2b1703[_0x7717('0x56')]===null||_0x2b1703[_0x7717('0x56')]===0x1)_0x2e4acf(null);return db[_0x7717('0x57')][_0x7717('0x44')]({'where':{'sectionId':_0x2b1703['id']},'raw':!![]})['then'](function(_0x59c136){var _0x542f5b=_[_0x7717('0x33')](_0x59c136,function(_0x408975){return qs[_0x7717('0x4f')](_0x408975,['id',_0x7717('0x52'),_0x7717('0x50'),_0x7717('0x58')]);});_0x2e4acf(_0x542f5b);})[_0x7717('0x46')](function(_0x407903){_0x31e24c(_0x407903);});})[_0x7717('0x2b')](function(_0x9db730){var _0x4e89fa=qs[_0x7717('0x4f')](_0x2b1703,['id','createdAt',_0x7717('0x50')]);_0x4e89fa[_0x7717('0x59')]=_0x8c9521['id'];if(_0x9db730)_0x4e89fa[_0x7717('0x5a')]=_0x9db730;return _0x4e89fa;})['then'](function(_0x1e2558){return db[_0x7717('0x54')][_0x7717('0x4e')](_0x1e2558,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x5d67a9});});})[_0x7717('0x2b')](function(){return _0x8c9521;});}});});});}})['then'](respondWithResult(_0x377d5d,0xc9))[_0x7717('0x46')](handleError(_0x377d5d,null));};exports[_0x7717('0x29')]=function(_0x59a8bf,_0x5ac292){if(_0x59a8bf['body']['id']){delete _0x59a8bf[_0x7717('0x51')]['id'];}return db[_0x7717('0x42')][_0x7717('0x4d')]({'where':{'id':_0x59a8bf[_0x7717('0x48')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x5ac292,null))[_0x7717('0x2b')](saveUpdates(_0x59a8bf[_0x7717('0x51')],null))[_0x7717('0x2b')](respondWithResult(_0x5ac292,null))[_0x7717('0x46')](handleError(_0x5ac292,null));};exports['destroy']=function(_0x3411a4,_0x5c7ac2){return db['UserProfile'][_0x7717('0x4d')]({'where':{'id':_0x3411a4[_0x7717('0x48')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x5c7ac2,null))[_0x7717('0x2b')](removeEntity(_0x5c7ac2,null))[_0x7717('0x46')](handleError(_0x5c7ac2,null));};exports[_0x7717('0x5b')]=function(_0x4cebb7,_0x33e94b){return db[_0x7717('0x42')][_0x7717('0x5b')]()[_0x7717('0x2b')](respondWithResult(_0x33e94b,null))['catch'](handleError(_0x33e94b,null));};exports[_0x7717('0x5c')]=function(_0x458018,_0xcb7508){var _0x1f4d73=_0x458018[_0x7717('0x51')];return db[_0x7717('0x42')][_0x7717('0x4d')]({'where':{'id':_0x458018[_0x7717('0x48')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0xcb7508,null))['then'](function(_0x4566b8){if(_0x4566b8){return db[_0x7717('0x5d')][_0x7717('0x53')](function(_0x20fd73){return db['UserProfileSection'][_0x7717('0x2a')]({'where':{'userProfileId':_0x458018[_0x7717('0x48')]['id'],'sectionId':_[_0x7717('0x33')](_0x1f4d73,function(_0x42b679){return _0x42b679['sectionId'];})},'transaction':_0x20fd73})[_0x7717('0x2b')](function(){var _0x32fa45=_['map'](_0x1f4d73,function(_0x336060){_0x336060[_0x7717('0x59')]=_0x458018[_0x7717('0x48')]['id'];return _0x336060;});var _0x1bb181=[];return BPromise['each'](_0x32fa45,function(_0x3528de){return db[_0x7717('0x54')][_0x7717('0x4e')](_0x3528de,{'include':[{'model':db[_0x7717('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x20fd73})[_0x7717('0x2b')](function(_0x4a225a){_0x1bb181[_0x7717('0x5e')](_0x4a225a[_0x7717('0x5f')]({'plain':!![]}));});})[_0x7717('0x2b')](function(){return _0x1bb181;});});});}})[_0x7717('0x2b')](function(_0x4949c3){return _0x4949c3;})['then'](respondWithResult(_0xcb7508,null))['catch'](handleError(_0xcb7508,null));};exports[_0x7717('0x60')]=function(_0x4066e0,_0x4914d4){var _0x3f221d;return db[_0x7717('0x42')][_0x7717('0x4d')]({'where':{'id':_0x4066e0['params']['id']},'attributes':['id',_0x7717('0x2c')]})[_0x7717('0x2b')](handleEntityNotFound(_0x4914d4,null))['then'](function(_0x2709d3){if(_0x2709d3){_0x3f221d=_0x2709d3;return db[_0x7717('0x54')][_0x7717('0x2a')]({'where':{'userProfileId':_0x4066e0[_0x7717('0x48')]['id'],'sectionId':_0x4066e0[_0x7717('0x34')][_0x7717('0x61')]}});}})['then'](function(){return _0x3f221d;})[_0x7717('0x2b')](respondWithStatusCode(_0x4914d4,null))[_0x7717('0x46')](handleError(_0x4914d4,null));};exports[_0x7717('0x62')]=function(_0xe3cf9a,_0x6b6049){var _0x1f9ec7=[];var _0xbf233c=[];return db[_0x7717('0x54')][_0x7717('0x44')]({'where':{'userProfileId':_0xe3cf9a['params']['id']},'raw':!![]})[_0x7717('0x2b')](function(_0x300aa7){_0x1f9ec7=_['filter'](_0x300aa7,function(_0x13eb0e){return _0x13eb0e[_0x7717('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x13eb0e[_0x7717('0x58')]);});if(!_[_0x7717('0x64')](_0x1f9ec7)){return _[_0x7717('0x33')](_0x1f9ec7,function(_0x2db551){return _0x2db551[_0x7717('0x58')];});}else{return;}})[_0x7717('0x2b')](function(_0x177084){if(_0x177084)_0xbf233c=_0x177084;if(_[_0x7717('0x65')](_0xbf233c,0x64)){var _0x49dcdc=_['find'](_0x1f9ec7,{'sectionId':0x64});return hasDefaultDashboard(_0x49dcdc)['then'](function(_0x294935){return _[_0x7717('0x33')](_0x1f9ec7,function(_0x53e677){if(_0x53e677['sectionId']===0x64){_0x53e677[_0x7717('0x66')]=_0x294935;}return _0x53e677;});});}else{return;}})[_0x7717('0x2b')](function(_0x2b6c79){if(_0x2b6c79)_0x1f9ec7=_0x2b6c79;if(_[_0x7717('0x65')](_0xbf233c,0x3eb)){var _0x31f2de=_['find'](_0x1f9ec7,{'sectionId':0x3eb});return getCustomDashboards(_0x31f2de)['then'](function(_0x1e8977){return _[_0x7717('0x33')](_0x1f9ec7,function(_0x4a2381){if(_0x31f2de['enabled']){if(_0x4a2381[_0x7717('0x58')]===0x3eb){_0x4a2381[_0x7717('0x66')]=_0x1e8977;}}else{if(_0x4a2381[_0x7717('0x58')]===0x64){_0x4a2381['subsections']=_0x1e8977;}}return _0x4a2381;});});}else{return;}})[_0x7717('0x2b')](function(_0x727f2f){if(_0x727f2f)_0x1f9ec7=_0x727f2f;if(_[_0x7717('0x65')](_0xbf233c,0x709)){var _0xb95373=_[_0x7717('0x4d')](_0x1f9ec7,{'sectionId':0x709});return getPlugins(_0xb95373)[_0x7717('0x2b')](function(_0x1dce0f){if(_0xb95373[_0x7717('0x63')]){return _[_0x7717('0x33')](_0x1f9ec7,function(_0x356a1f){if(_0x356a1f['sectionId']===0x709){_0x356a1f[_0x7717('0x66')]=_0x1dce0f;}return _0x356a1f;});}else{var _0x4c022b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1dce0f};var _0x58b082=_[_0x7717('0x33')](_0x1f9ec7);_0x58b082[_0x7717('0x5e')](_0x4c022b);return _0x58b082;}});}else{return;}})['then'](function(_0x2e59a6){if(_0x2e59a6)_0x1f9ec7=_0x2e59a6;return _[_0x7717('0x3f')](_0x1f9ec7,['enabled',0x1]);})[_0x7717('0x2b')](respondWithResult(_0x6b6049,null))[_0x7717('0x46')](handleError(_0x6b6049,null));};function hasDefaultDashboard(_0x202525){var _0x101352=[0x65];return new BPromise(function(_0x415a26,_0x372fea){try{if(_0x202525[_0x7717('0x56')]){_0x415a26(_0x101352);}else{return db[_0x7717('0x57')][_0x7717('0x67')]({'where':{'sectionId':_0x202525['id']},'raw':!![]})[_0x7717('0x2b')](function(_0x310259){_0x310259?_0x415a26(_0x101352):_0x415a26();});}}catch(_0x2ac112){_0x372fea(_0x2ac112);}});}function getCustomDashboards(_0x19edc2){var _0xe1ed07=[];return new BPromise(function(_0x3c384c,_0x425502){try{if(_0x19edc2[_0x7717('0x56')]){return db[_0x7717('0x68')][_0x7717('0x44')]({'raw':!![]})['then'](function(_0x18625f){_0x18625f['forEach'](function(_0x479ed6){_0xe1ed07['push'](_0x479ed6['id']+0x1869f);});_0x3c384c(_0xe1ed07);});}else{return db[_0x7717('0x57')]['findAll']({'where':{'sectionId':_0x19edc2['id']},'raw':!![]})[_0x7717('0x2b')](function(_0x783216){_0x783216[_0x7717('0x69')](function(_0x4e4100){_0xe1ed07[_0x7717('0x5e')](_0x4e4100[_0x7717('0x6a')]+0x1869f);});_0x3c384c(_0xe1ed07);});}}catch(_0x2186ab){_0x425502(_0x2186ab);}});}function getPlugins(_0x55269a){var _0x4f53d0=[];return new BPromise(function(_0x41ca15,_0x2f85a5){try{if(_0x55269a['autoAssociation']){return db[_0x7717('0x6b')][_0x7717('0x44')]({'raw':!![]})['then'](function(_0x3d3251){_0x3d3251['forEach'](function(_0x2d1f0c){_0x4f53d0[_0x7717('0x5e')](_0x2d1f0c['id']+0x15b38);});_0x41ca15(_0x4f53d0);});}else{return db[_0x7717('0x57')][_0x7717('0x44')]({'where':{'sectionId':_0x55269a['id']},'raw':!![]})[_0x7717('0x2b')](function(_0x11ff54){_0x11ff54['forEach'](function(_0x4dcf3b){_0x4f53d0['push'](_0x4dcf3b[_0x7717('0x6a')]+0x15b38);});_0x41ca15(_0x4f53d0);});}}catch(_0x471a93){_0x2f85a5(_0x471a93);}});}exports[_0x7717('0x6c')]=function(_0xb98030,_0x441833){return db[_0x7717('0x42')][_0x7717('0x4d')]({'where':{'id':_0xb98030[_0x7717('0x48')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x441833,null))['then'](function(_0x5ddab4){if(_0x5ddab4){return db[_0x7717('0x5d')][_0x7717('0x53')](function(_0x1be266){return db[_0x7717('0x54')][_0x7717('0x44')]({'where':{'userProfileId':_0xb98030[_0x7717('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x36166e){if(_0x36166e){return db['UserProfileSection'][_0x7717('0x2a')]({'where':{'userProfileId':_0xb98030[_0x7717('0x48')]['id'],'id':_[_0x7717('0x33')](_0x36166e,function(_0x3e5232){return _0x3e5232['id'];})},'transaction':_0x1be266});}})[_0x7717('0x2b')](function(_0x34a076){var _0x54279e=_[_0x7717('0x33')](_0xb98030[_0x7717('0x51')],function(_0xe922e4){_0xe922e4['userProfileId']=_0xb98030[_0x7717('0x48')]['id'];return _0xe922e4;});return db[_0x7717('0x54')][_0x7717('0x6d')](_0x54279e,{'raw':!![],'transaction':_0x1be266});})[_0x7717('0x2b')](function(_0x3308a8){var _0x519cef=_[_0x7717('0x3f')](_[_0x7717('0x33')](_0x3308a8,function(_0x5311b8){return _0x5311b8[_0x7717('0x5f')]({'plain':!![]});}),{'includeAll':![]});if(_0x519cef){return db['UserProfileSection'][_0x7717('0x44')]({'where':{'userProfileId':_0xb98030['params']['id'],'sectionId':_[_0x7717('0x33')](_0x519cef,function(_0x11491a){return _0x11491a[_0x7717('0x58')];})},'attributes':['id',_0x7717('0x58')],'raw':!![]})['then'](function(_0x49f860){var _0x5eeda3=_[_0x7717('0x33')](_0xb98030[_0x7717('0x51')],function(_0x17d08f){_0x17d08f[_0x7717('0x59')]=_0xb98030[_0x7717('0x48')]['id'];return _0x17d08f;});return db[_0x7717('0x57')][_0x7717('0x6d')](_0x5eeda3,{'raw':!![],'transaction':_0x1be266});});}})[_0x7717('0x46')](handleError(_0x441833,null));});}})[_0x7717('0x2b')](function(_0x225504){var _0x5ad623=_[_0x7717('0x33')](_0x225504,function(_0x128f1c){return _0x128f1c[_0x7717('0x5f')]({'plain':!![]});});})[_0x7717('0x2b')](respondWithResult(_0x441833,null))[_0x7717('0x46')](handleError(_0x441833,null));};exports[_0x7717('0x6e')]=function(_0x45981c,_0x5a4e3f,_0x102ba5){return db[_0x7717('0x42')]['find']({'where':{'id':_0x45981c[_0x7717('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a4e3f,null))[_0x7717('0x2b')](function(_0x540e54){if(_0x540e54){return _0x540e54['removeResources'](_0x45981c['query'][_0x7717('0x61')]);}})[_0x7717('0x2b')](respondWithStatusCode(_0x5a4e3f,null))[_0x7717('0x46')](handleError(_0x5a4e3f,null));};exports[_0x7717('0x6f')]=function(_0x397aa6,_0x2edc12){var _0x86ffb8={};if(!_0x397aa6[_0x7717('0x34')][_0x7717('0x70')])throw new Error(_0x7717('0x71'));if(!_0x397aa6[_0x7717('0x34')][_0x7717('0x39')](_0x7717('0x3a'))){_0x86ffb8[_0x7717('0x21')]=qs[_0x7717('0x21')](_0x397aa6['query']['limit']);_0x86ffb8[_0x7717('0x20')]=qs[_0x7717('0x20')](_0x397aa6[_0x7717('0x34')][_0x7717('0x20')]);}return db[_0x7717('0x42')][_0x7717('0x4d')]({'where':{'id':_0x397aa6[_0x7717('0x48')]['id']}})['then'](function(_0x410128){if(!_0x410128)throw new Error(_0x7717('0x72')+_0x397aa6[_0x7717('0x48')]['id']);return db[_0x7717('0x42')]['getResources'](_0x397aa6);})['then'](respondWithFilteredResult(_0x2edc12,_0x86ffb8))[_0x7717('0x46')](handleError(_0x2edc12,null));}; \ No newline at end of file +var _0x81cb=['length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','UserProfile','include','findAll','rows','catch','params','includeAll','options','find','body','clone','get','omit','createdAt','crudPermissions','updatedAt','create','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','transaction','each','push','removeSections','getSections','includes','isEmpty','enabled','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','end','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x20b94a,_0x489346){var _0x1ff6ee=function(_0x2cb557){while(--_0x2cb557){_0x20b94a['push'](_0x20b94a['shift']());}};_0x1ff6ee(++_0x489346);}(_0x81cb,0xaa));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xb81c('0x0'));var rimraf=require(_0xb81c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb81c('0x2'));var rp=require(_0xb81c('0x3'));var moment=require('moment');var BPromise=require(_0xb81c('0x4'));var Mustache=require(_0xb81c('0x5'));var util=require(_0xb81c('0x6'));var path=require(_0xb81c('0x7'));var sox=require('sox');var csv=require(_0xb81c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb81c('0x9'));var squel=require(_0xb81c('0xa'));var crypto=require(_0xb81c('0xb'));var jsforce=require(_0xb81c('0xc'));var deskjs=require(_0xb81c('0xd'));var toCsv=require(_0xb81c('0x8'));var querystring=require(_0xb81c('0xe'));var Papa=require(_0xb81c('0xf'));var Redis=require(_0xb81c('0x10'));var authService=require(_0xb81c('0x11'));var qs=require(_0xb81c('0x12'));var as=require(_0xb81c('0x13'));var hardwareService=require(_0xb81c('0x14'));var logger=require(_0xb81c('0x15'))('api');var utils=require(_0xb81c('0x16'));var config=require(_0xb81c('0x17'));var licenseUtil=require(_0xb81c('0x18'));var db=require(_0xb81c('0x19'))['db'];config[_0xb81c('0x1a')]=_['defaults'](config[_0xb81c('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb81c('0x1b'))(new Redis(config[_0xb81c('0x1a')]));require('./userProfile.socket')[_0xb81c('0x1c')](socket);function respondWithStatusCode(_0x2f50d3,_0x50574c){_0x50574c=_0x50574c||0xcc;return function(_0x21f5c8){if(_0x21f5c8){return _0x2f50d3[_0xb81c('0x1d')](_0x50574c);}return _0x2f50d3[_0xb81c('0x1e')](_0x50574c)['end']();};}function respondWithResult(_0x393e11,_0x112ad5){_0x112ad5=_0x112ad5||0xc8;return function(_0x4d95cd){if(_0x4d95cd){return _0x393e11[_0xb81c('0x1e')](_0x112ad5)[_0xb81c('0x1f')](_0x4d95cd);}};}function respondWithFilteredResult(_0x32916b,_0x4cbc9d){return function(_0x37341d){if(_0x37341d){var _0x31e686=typeof _0x4cbc9d[_0xb81c('0x20')]==='undefined'&&typeof _0x4cbc9d[_0xb81c('0x21')]===_0xb81c('0x22');var _0xfab47b=_0x37341d[_0xb81c('0x23')];var _0x3ca373=_0x31e686?0x0:_0x4cbc9d[_0xb81c('0x20')];var _0x445222=_0x31e686?_0x37341d['count']:_0x4cbc9d[_0xb81c('0x20')]+_0x4cbc9d[_0xb81c('0x21')];var _0x1aa39a;if(_0x445222>=_0xfab47b){_0x445222=_0xfab47b;_0x1aa39a=0xc8;}else{_0x1aa39a=0xce;}_0x32916b[_0xb81c('0x1e')](_0x1aa39a);return _0x32916b['set'](_0xb81c('0x24'),_0x3ca373+'-'+_0x445222+'/'+_0xfab47b)['json'](_0x37341d);}return null;};}function patchUpdates(_0x449ad7){return function(_0xed6e3b){try{jsonpatch[_0xb81c('0x25')](_0xed6e3b,_0x449ad7,!![]);}catch(_0x14650e){return BPromise['reject'](_0x14650e);}return _0xed6e3b['save']();};}function saveUpdates(_0x12798b,_0xff4c94){return function(_0x101e04){if(_0x101e04){return _0x101e04[_0xb81c('0x26')](_0x12798b)[_0xb81c('0x27')](function(_0x17d176){return _0x17d176;});}return null;};}function removeEntity(_0x45dbe5,_0xc1fadb){return function(_0x1db33d){if(_0x1db33d){return _0x1db33d[_0xb81c('0x28')]()[_0xb81c('0x27')](function(){_0x45dbe5[_0xb81c('0x1e')](0xcc)[_0xb81c('0x29')]();});}};}function handleEntityNotFound(_0x20b7ea,_0x183779){return function(_0x201051){if(!_0x201051){_0x20b7ea[_0xb81c('0x1d')](0x194);}return _0x201051;};}function handleError(_0x4ca99e,_0x5c07c0){_0x5c07c0=_0x5c07c0||0x1f4;return function(_0x15f86e){logger[_0xb81c('0x2a')](_0x15f86e['stack']);if(_0x15f86e[_0xb81c('0x2b')]){delete _0x15f86e[_0xb81c('0x2b')];}_0x4ca99e['status'](_0x5c07c0)[_0xb81c('0x2c')](_0x15f86e);};}exports['index']=function(_0xdff705,_0x5df2df){var _0x375fa3={},_0x2c98ed={},_0x2616b4={'count':0x0,'rows':[]};var _0x548fe2=_[_0xb81c('0x2d')](db['UserProfile'][_0xb81c('0x2e')],function(_0x317ed5){return{'name':_0x317ed5['fieldName'],'type':_0x317ed5[_0xb81c('0x2f')][_0xb81c('0x30')]};});_0x2c98ed[_0xb81c('0x31')]=_['map'](_0x548fe2,_0xb81c('0x2b'));_0x2c98ed[_0xb81c('0x32')]=_[_0xb81c('0x33')](_0xdff705[_0xb81c('0x32')]);_0x2c98ed[_0xb81c('0x34')]=_[_0xb81c('0x35')](_0x2c98ed[_0xb81c('0x31')],_0x2c98ed[_0xb81c('0x32')]);_0x375fa3[_0xb81c('0x36')]=_[_0xb81c('0x35')](_0x2c98ed['model'],qs[_0xb81c('0x37')](_0xdff705['query']['fields']));_0x375fa3[_0xb81c('0x36')]=_0x375fa3['attributes'][_0xb81c('0x38')]?_0x375fa3['attributes']:_0x2c98ed[_0xb81c('0x31')];if(!_0xdff705[_0xb81c('0x32')]['hasOwnProperty'](_0xb81c('0x39'))){_0x375fa3[_0xb81c('0x21')]=qs[_0xb81c('0x21')](_0xdff705['query'][_0xb81c('0x21')]);_0x375fa3[_0xb81c('0x20')]=qs[_0xb81c('0x20')](_0xdff705[_0xb81c('0x32')]['offset']);}_0x375fa3[_0xb81c('0x3a')]=qs[_0xb81c('0x3b')](_0xdff705[_0xb81c('0x32')][_0xb81c('0x3b')]);_0x375fa3[_0xb81c('0x3c')]=qs[_0xb81c('0x34')](_[_0xb81c('0x3d')](_0xdff705[_0xb81c('0x32')],_0x2c98ed['filters']),_0x548fe2);if(_0xdff705['query']['filter']){_0x375fa3['where']=_['merge'](_0x375fa3[_0xb81c('0x3c')],{'$or':_['map'](_0x548fe2,function(_0x38fc63){if(_0x38fc63[_0xb81c('0x2f')]!==_0xb81c('0x3e')){var _0x3cefd4={};_0x3cefd4[_0x38fc63[_0xb81c('0x2b')]]={'$like':'%'+_0xdff705['query'][_0xb81c('0x3f')]+'%'};return _0x3cefd4;}})});}_0x375fa3=_[_0xb81c('0x40')]({},_0x375fa3,_0xdff705['options']);var _0x597ff9={'where':_0x375fa3['where']};return db[_0xb81c('0x41')][_0xb81c('0x23')](_0x597ff9)[_0xb81c('0x27')](function(_0x1dff58){_0x2616b4[_0xb81c('0x23')]=_0x1dff58;if(_0xdff705[_0xb81c('0x32')]['includeAll']){_0x375fa3[_0xb81c('0x42')]=[{'all':!![]}];}return db['UserProfile'][_0xb81c('0x43')](_0x375fa3);})[_0xb81c('0x27')](function(_0x19b752){_0x2616b4[_0xb81c('0x44')]=_0x19b752;return _0x2616b4;})['then'](respondWithFilteredResult(_0x5df2df,_0x375fa3))[_0xb81c('0x45')](handleError(_0x5df2df,null));};exports['show']=function(_0x5c664f,_0x48fe30){var _0x28e76b={'raw':![],'where':{'id':_0x5c664f[_0xb81c('0x46')]['id']}},_0x82e80f={};_0x82e80f['model']=_[_0xb81c('0x33')](db['UserProfile'][_0xb81c('0x2e')]);_0x82e80f[_0xb81c('0x32')]=_[_0xb81c('0x33')](_0x5c664f['query']);_0x82e80f[_0xb81c('0x34')]=_[_0xb81c('0x35')](_0x82e80f[_0xb81c('0x31')],_0x82e80f[_0xb81c('0x32')]);_0x28e76b[_0xb81c('0x36')]=_[_0xb81c('0x35')](_0x82e80f[_0xb81c('0x31')],qs[_0xb81c('0x37')](_0x5c664f[_0xb81c('0x32')]['fields']));_0x28e76b[_0xb81c('0x36')]=_0x28e76b[_0xb81c('0x36')][_0xb81c('0x38')]?_0x28e76b[_0xb81c('0x36')]:_0x82e80f[_0xb81c('0x31')];if(_0x5c664f['query'][_0xb81c('0x47')]){_0x28e76b['include']=[{'all':!![]}];}_0x28e76b=_[_0xb81c('0x40')]({},_0x28e76b,_0x5c664f[_0xb81c('0x48')]);return db[_0xb81c('0x41')][_0xb81c('0x49')](_0x28e76b)[_0xb81c('0x27')](handleEntityNotFound(_0x48fe30,null))[_0xb81c('0x27')](respondWithResult(_0x48fe30,null))[_0xb81c('0x45')](handleError(_0x48fe30,null));};exports['create']=function(_0x40fbf6,_0x200464){return db['UserProfile']['create'](_0x40fbf6[_0xb81c('0x4a')],{})[_0xb81c('0x27')](respondWithResult(_0x200464,0xc9))[_0xb81c('0x45')](handleError(_0x200464,null));};exports[_0xb81c('0x4b')]=function(_0x2f7956,_0x455f0a){var _0x33872f={'where':{'id':_0x2f7956[_0xb81c('0x46')]['id']}},_0x2a1da4={};_0x2a1da4[_0xb81c('0x31')]=_['keys'](db['UserProfile'][_0xb81c('0x2e')]);_0x33872f['attributes']=_[_0xb81c('0x35')](_0x2a1da4[_0xb81c('0x31')],qs[_0xb81c('0x37')](_0x2f7956[_0xb81c('0x32')][_0xb81c('0x37')]));_0x33872f[_0xb81c('0x36')]=_0x33872f[_0xb81c('0x36')][_0xb81c('0x38')]?_0x33872f[_0xb81c('0x36')]:_0x2a1da4['model'];if(_0x2f7956[_0xb81c('0x32')][_0xb81c('0x47')]){_0x33872f['include']=[{'all':!![]}];}_0x33872f=_[_0xb81c('0x40')]({},_0x33872f,_0x2f7956[_0xb81c('0x48')]);return db[_0xb81c('0x41')]['find'](_0x33872f)[_0xb81c('0x27')](handleEntityNotFound(_0x455f0a,null))[_0xb81c('0x27')](function(_0x205f04){if(_0x205f04){var _0x5a6566=_0x205f04[_0xb81c('0x4c')]({'plain':!![]});_0x5a6566=qs[_0xb81c('0x4d')](_0x5a6566,['id',_0xb81c('0x4e'),'updatedAt',_0xb81c('0x4f')]);_0x2f7956[_0xb81c('0x4a')]=_['omit'](_0x2f7956[_0xb81c('0x4a')],['id',_0xb81c('0x4e'),_0xb81c('0x50')]);return db['sequelize']['transaction'](function(_0x32fd85){return db['UserProfile'][_0xb81c('0x51')](_[_0xb81c('0x40')](_0x5a6566,_0x2f7956[_0xb81c('0x4a')]),{'include':_0x2f7956[_0xb81c('0x32')][_0xb81c('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x32fd85})[_0xb81c('0x27')](function(_0x23abc6){var _0x50d521=_0x23abc6[_0xb81c('0x4c')]({'plain':!![]});return db[_0xb81c('0x52')][_0xb81c('0x43')]({'where':{'userProfileId':_0x2f7956[_0xb81c('0x46')]['id']},'raw':!![]})[_0xb81c('0x27')](function(_0x32e670){if(_0x32e670){return BPromise['each'](_0x32e670,function(_0xd05144){return new BPromise(function(_0x2b4222,_0x2b84a7){if(_0xd05144[_0xb81c('0x53')]===null||_0xd05144['autoAssociation']===0x1)_0x2b4222(null);return db[_0xb81c('0x54')][_0xb81c('0x43')]({'where':{'sectionId':_0xd05144['id']},'raw':!![]})[_0xb81c('0x27')](function(_0x1059bd){var _0x124bd7=_[_0xb81c('0x2d')](_0x1059bd,function(_0x58d6f6){return qs[_0xb81c('0x4d')](_0x58d6f6,['id',_0xb81c('0x4e'),_0xb81c('0x50'),_0xb81c('0x55')]);});_0x2b4222(_0x124bd7);})[_0xb81c('0x45')](function(_0x5de184){_0x2b84a7(_0x5de184);});})[_0xb81c('0x27')](function(_0x211229){var _0x1c1d9d=qs[_0xb81c('0x4d')](_0xd05144,['id',_0xb81c('0x4e'),_0xb81c('0x50')]);_0x1c1d9d[_0xb81c('0x56')]=_0x50d521['id'];if(_0x211229)_0x1c1d9d[_0xb81c('0x57')]=_0x211229;return _0x1c1d9d;})['then'](function(_0xacc3e9){return db['UserProfileSection'][_0xb81c('0x51')](_0xacc3e9,{'include':[{'model':db[_0xb81c('0x54')],'as':_0xb81c('0x57')}],'raw':!![],'transaction':_0x32fd85});});})[_0xb81c('0x27')](function(){return _0x50d521;});}});});});}})[_0xb81c('0x27')](respondWithResult(_0x455f0a,0xc9))[_0xb81c('0x45')](handleError(_0x455f0a,null));};exports[_0xb81c('0x26')]=function(_0x5c79ce,_0x43b493){if(_0x5c79ce[_0xb81c('0x4a')]['id']){delete _0x5c79ce[_0xb81c('0x4a')]['id'];}return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x5c79ce['params']['id']}})['then'](handleEntityNotFound(_0x43b493,null))['then'](saveUpdates(_0x5c79ce[_0xb81c('0x4a')],null))[_0xb81c('0x27')](respondWithResult(_0x43b493,null))[_0xb81c('0x45')](handleError(_0x43b493,null));};exports[_0xb81c('0x28')]=function(_0x15010f,_0x110d2e){return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x15010f['params']['id']}})[_0xb81c('0x27')](handleEntityNotFound(_0x110d2e,null))['then'](removeEntity(_0x110d2e,null))[_0xb81c('0x45')](handleError(_0x110d2e,null));};exports[_0xb81c('0x58')]=function(_0x367cce,_0xb147b7){return db['UserProfile'][_0xb81c('0x58')]()['then'](respondWithResult(_0xb147b7,null))[_0xb81c('0x45')](handleError(_0xb147b7,null));};exports[_0xb81c('0x59')]=function(_0x46d9fb,_0x20fe72){var _0x54c318=_0x46d9fb[_0xb81c('0x4a')];return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x46d9fb['params']['id']}})[_0xb81c('0x27')](handleEntityNotFound(_0x20fe72,null))[_0xb81c('0x27')](function(_0x257345){if(_0x257345){return db[_0xb81c('0x5a')][_0xb81c('0x5b')](function(_0x3e8c08){return db['UserProfileSection'][_0xb81c('0x28')]({'where':{'userProfileId':_0x46d9fb['params']['id'],'sectionId':_['map'](_0x54c318,function(_0x37fc0b){return _0x37fc0b[_0xb81c('0x55')];})},'transaction':_0x3e8c08})[_0xb81c('0x27')](function(){var _0x3320e2=_[_0xb81c('0x2d')](_0x54c318,function(_0x382fa3){_0x382fa3[_0xb81c('0x56')]=_0x46d9fb[_0xb81c('0x46')]['id'];return _0x382fa3;});var _0x4b484e=[];return BPromise[_0xb81c('0x5c')](_0x3320e2,function(_0x450aff){return db[_0xb81c('0x52')]['create'](_0x450aff,{'include':[{'model':db[_0xb81c('0x54')],'as':_0xb81c('0x57')}],'raw':!![],'transaction':_0x3e8c08})['then'](function(_0x54493d){_0x4b484e[_0xb81c('0x5d')](_0x54493d[_0xb81c('0x4c')]({'plain':!![]}));});})[_0xb81c('0x27')](function(){return _0x4b484e;});});});}})[_0xb81c('0x27')](function(_0x46193c){return _0x46193c;})[_0xb81c('0x27')](respondWithResult(_0x20fe72,null))['catch'](handleError(_0x20fe72,null));};exports[_0xb81c('0x5e')]=function(_0x45a430,_0x5f5202){var _0x49e4a0;return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x45a430['params']['id']},'attributes':['id',_0xb81c('0x2b')]})[_0xb81c('0x27')](handleEntityNotFound(_0x5f5202,null))[_0xb81c('0x27')](function(_0x1a7372){if(_0x1a7372){_0x49e4a0=_0x1a7372;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x45a430[_0xb81c('0x46')]['id'],'sectionId':_0x45a430[_0xb81c('0x32')]['ids']}});}})[_0xb81c('0x27')](function(){return _0x49e4a0;})[_0xb81c('0x27')](respondWithStatusCode(_0x5f5202,null))[_0xb81c('0x45')](handleError(_0x5f5202,null));};exports[_0xb81c('0x5f')]=function(_0x1c4f0b,_0x5b4f51){var _0x42a71c=[];var _0x3784df=[];return db[_0xb81c('0x52')][_0xb81c('0x43')]({'where':{'userProfileId':_0x1c4f0b['params']['id']},'raw':!![]})['then'](function(_0x594bc4){_0x42a71c=_[_0xb81c('0x3f')](_0x594bc4,function(_0x18f6e9){return _0x18f6e9['enabled']===0x1||_[_0xb81c('0x60')]([0x3eb,0x709],_0x18f6e9[_0xb81c('0x55')]);});if(!_[_0xb81c('0x61')](_0x42a71c)){return _[_0xb81c('0x2d')](_0x42a71c,function(_0x11d300){return _0x11d300['sectionId'];});}else{return;}})[_0xb81c('0x27')](function(_0xe72ab5){if(_0xe72ab5)_0x3784df=_0xe72ab5;if(_[_0xb81c('0x60')](_0x3784df,0x64)){var _0x1fce10=_[_0xb81c('0x49')](_0x42a71c,{'sectionId':0x64});return hasDefaultDashboard(_0x1fce10)[_0xb81c('0x27')](function(_0x949707){return _[_0xb81c('0x2d')](_0x42a71c,function(_0x4989c9){if(_0x4989c9['sectionId']===0x64){_0x4989c9['subsections']=_0x949707;}return _0x4989c9;});});}else{return;}})[_0xb81c('0x27')](function(_0x9bf76a){if(_0x9bf76a)_0x42a71c=_0x9bf76a;if(_[_0xb81c('0x60')](_0x3784df,0x3eb)){var _0x145adc=_[_0xb81c('0x49')](_0x42a71c,{'sectionId':0x3eb});return getCustomDashboards(_0x145adc)[_0xb81c('0x27')](function(_0x1eae2b){return _['map'](_0x42a71c,function(_0x5f4d27){if(_0x145adc[_0xb81c('0x62')]){if(_0x5f4d27['sectionId']===0x3eb){_0x5f4d27[_0xb81c('0x63')]=_0x1eae2b;}}else{if(_0x5f4d27[_0xb81c('0x55')]===0x64){_0x5f4d27[_0xb81c('0x63')]=_0x1eae2b;}}return _0x5f4d27;});});}else{return;}})[_0xb81c('0x27')](function(_0x29af9e){if(_0x29af9e)_0x42a71c=_0x29af9e;if(_['includes'](_0x3784df,0x709)){var _0x2c6a93=_[_0xb81c('0x49')](_0x42a71c,{'sectionId':0x709});return getPlugins(_0x2c6a93)[_0xb81c('0x27')](function(_0x47472e){if(_0x2c6a93[_0xb81c('0x62')]){return _['map'](_0x42a71c,function(_0x1dbc7a){if(_0x1dbc7a[_0xb81c('0x55')]===0x709){_0x1dbc7a[_0xb81c('0x63')]=_0x47472e;}return _0x1dbc7a;});}else{var _0x2c4733={'sectionId':0x76c,'enabled':0x1,'subsections':_0x47472e};var _0x4ce6d8=_[_0xb81c('0x2d')](_0x42a71c);_0x4ce6d8[_0xb81c('0x5d')](_0x2c4733);return _0x4ce6d8;}});}else{return;}})[_0xb81c('0x27')](function(_0x17fd05){if(_0x17fd05)_0x42a71c=_0x17fd05;return _[_0xb81c('0x3f')](_0x42a71c,[_0xb81c('0x62'),0x1]);})[_0xb81c('0x27')](respondWithResult(_0x5b4f51,null))[_0xb81c('0x45')](handleError(_0x5b4f51,null));};function hasDefaultDashboard(_0x43212d){var _0x10f855=[0x65];return new BPromise(function(_0x3e0fc5,_0x38d009){try{if(_0x43212d[_0xb81c('0x53')]){_0x3e0fc5(_0x10f855);}else{return db[_0xb81c('0x54')][_0xb81c('0x64')]({'where':{'sectionId':_0x43212d['id']},'raw':!![]})['then'](function(_0x5268e1){_0x5268e1?_0x3e0fc5(_0x10f855):_0x3e0fc5();});}}catch(_0x41fca8){_0x38d009(_0x41fca8);}});}function getCustomDashboards(_0x52f964){var _0x333469=[];return new BPromise(function(_0x46b9bf,_0x38c56e){try{if(_0x52f964[_0xb81c('0x53')]){return db[_0xb81c('0x65')][_0xb81c('0x43')]({'raw':!![]})[_0xb81c('0x27')](function(_0x5bc805){_0x5bc805[_0xb81c('0x66')](function(_0xef84a5){_0x333469[_0xb81c('0x5d')](_0xef84a5['id']+0x1869f);});_0x46b9bf(_0x333469);});}else{return db[_0xb81c('0x54')]['findAll']({'where':{'sectionId':_0x52f964['id']},'raw':!![]})['then'](function(_0xdcfc64){_0xdcfc64[_0xb81c('0x66')](function(_0x1c8ef2){_0x333469[_0xb81c('0x5d')](_0x1c8ef2[_0xb81c('0x67')]+0x1869f);});_0x46b9bf(_0x333469);});}}catch(_0x5a918a){_0x38c56e(_0x5a918a);}});}function getPlugins(_0x2d9f6b){var _0x487835=[];return new BPromise(function(_0x535ba4,_0x1ea6d3){try{if(_0x2d9f6b['autoAssociation']){return db[_0xb81c('0x68')][_0xb81c('0x43')]({'raw':!![]})[_0xb81c('0x27')](function(_0x429e00){_0x429e00[_0xb81c('0x66')](function(_0x2a1583){_0x487835['push'](_0x2a1583['id']+0x15b38);});_0x535ba4(_0x487835);});}else{return db['UserProfileResource'][_0xb81c('0x43')]({'where':{'sectionId':_0x2d9f6b['id']},'raw':!![]})[_0xb81c('0x27')](function(_0x755f85){_0x755f85[_0xb81c('0x66')](function(_0x2d96ae){_0x487835[_0xb81c('0x5d')](_0x2d96ae[_0xb81c('0x67')]+0x15b38);});_0x535ba4(_0x487835);});}}catch(_0x45b3ad){_0x1ea6d3(_0x45b3ad);}});}exports[_0xb81c('0x69')]=function(_0x55dc87,_0x3d4d14){return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x55dc87[_0xb81c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d4d14,null))[_0xb81c('0x27')](function(_0x3b2c94){if(_0x3b2c94){return db['sequelize']['transaction'](function(_0x366862){return db[_0xb81c('0x52')][_0xb81c('0x43')]({'where':{'userProfileId':_0x55dc87[_0xb81c('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0xb81c('0x27')](function(_0x143dec){if(_0x143dec){return db[_0xb81c('0x52')][_0xb81c('0x28')]({'where':{'userProfileId':_0x55dc87[_0xb81c('0x46')]['id'],'id':_[_0xb81c('0x2d')](_0x143dec,function(_0x3fdf25){return _0x3fdf25['id'];})},'transaction':_0x366862});}})[_0xb81c('0x27')](function(_0x5895c9){var _0x3e95b1=_[_0xb81c('0x2d')](_0x55dc87[_0xb81c('0x4a')],function(_0x75ba0c){_0x75ba0c[_0xb81c('0x56')]=_0x55dc87[_0xb81c('0x46')]['id'];return _0x75ba0c;});return db[_0xb81c('0x52')][_0xb81c('0x6a')](_0x3e95b1,{'raw':!![],'transaction':_0x366862});})['then'](function(_0x48c745){var _0x256632=_['filter'](_[_0xb81c('0x2d')](_0x48c745,function(_0x17c8ff){return _0x17c8ff['get']({'plain':!![]});}),{'includeAll':![]});if(_0x256632){return db['UserProfileSection'][_0xb81c('0x43')]({'where':{'userProfileId':_0x55dc87[_0xb81c('0x46')]['id'],'sectionId':_[_0xb81c('0x2d')](_0x256632,function(_0xd6b0b3){return _0xd6b0b3[_0xb81c('0x55')];})},'attributes':['id',_0xb81c('0x55')],'raw':!![]})['then'](function(_0x562a0f){var _0x5a6e98=_[_0xb81c('0x2d')](_0x55dc87[_0xb81c('0x4a')],function(_0x56954f){_0x56954f[_0xb81c('0x56')]=_0x55dc87[_0xb81c('0x46')]['id'];return _0x56954f;});return db[_0xb81c('0x54')][_0xb81c('0x6a')](_0x5a6e98,{'raw':!![],'transaction':_0x366862});});}})[_0xb81c('0x45')](handleError(_0x3d4d14,null));});}})[_0xb81c('0x27')](function(_0x21cf64){var _0x1a3a3c=_[_0xb81c('0x2d')](_0x21cf64,function(_0x21ca83){return _0x21ca83[_0xb81c('0x4c')]({'plain':!![]});});})[_0xb81c('0x27')](respondWithResult(_0x3d4d14,null))['catch'](handleError(_0x3d4d14,null));};exports[_0xb81c('0x6b')]=function(_0x1c3509,_0x5ae3c9,_0x2db6bd){return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x1c3509[_0xb81c('0x46')]['id']}})[_0xb81c('0x27')](handleEntityNotFound(_0x5ae3c9,null))[_0xb81c('0x27')](function(_0x90401d){if(_0x90401d){return _0x90401d[_0xb81c('0x6b')](_0x1c3509[_0xb81c('0x32')]['ids']);}})[_0xb81c('0x27')](respondWithStatusCode(_0x5ae3c9,null))[_0xb81c('0x45')](handleError(_0x5ae3c9,null));};exports[_0xb81c('0x6c')]=function(_0x3f1195,_0x4af3d5){var _0x2c2281={};if(!_0x3f1195['query'][_0xb81c('0x6d')])throw new Error(_0xb81c('0x6e'));if(!_0x3f1195[_0xb81c('0x32')][_0xb81c('0x6f')](_0xb81c('0x39'))){_0x2c2281[_0xb81c('0x21')]=qs[_0xb81c('0x21')](_0x3f1195['query'][_0xb81c('0x21')]);_0x2c2281[_0xb81c('0x20')]=qs[_0xb81c('0x20')](_0x3f1195[_0xb81c('0x32')]['offset']);}return db[_0xb81c('0x41')][_0xb81c('0x49')]({'where':{'id':_0x3f1195[_0xb81c('0x46')]['id']}})['then'](function(_0x456b23){if(!_0x456b23)throw new Error(_0xb81c('0x70')+_0x3f1195[_0xb81c('0x46')]['id']);return db[_0xb81c('0x41')][_0xb81c('0x6c')](_0x3f1195);})['then'](respondWithFilteredResult(_0x4af3d5,_0x2c2281))['catch'](handleError(_0x4af3d5,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9b396c1..b53b00a 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 _0x0f80=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','save','update','emit'];(function(_0xa0a635,_0x26c394){var _0x32f0e6=function(_0x5e175d){while(--_0x5e175d){_0xa0a635['push'](_0xa0a635['shift']());}};_0x32f0e6(++_0x26c394);}(_0x0f80,0x108));var _0x00f8=function(_0x54fd30,_0x4575ec){_0x54fd30=_0x54fd30-0x0;var _0xb51905=_0x0f80[_0x54fd30];return _0xb51905;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x00f8('0x0'))['db'][_0x00f8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x00f8('0x2')](0x0);var events={'afterCreate':_0x00f8('0x3'),'afterUpdate':_0x00f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c5e26){return function(_0x1921a1,_0x257013,_0x523990){UserProfileEvents[_0x00f8('0x5')](_0x1c5e26+':'+_0x1921a1['id'],_0x1921a1);UserProfileEvents[_0x00f8('0x5')](_0x1c5e26,_0x1921a1);_0x523990(null);};}for(var e in events){if(events[_0x00f8('0x6')](e)){var event=events[e];UserProfile[_0x00f8('0x7')](e,emitEvent(event));}}module[_0x00f8('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x044a=['hook','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4a74fa,_0x56e930){var _0x5255b8=function(_0x4ead6f){while(--_0x4ead6f){_0x4a74fa['push'](_0x4a74fa['shift']());}};_0x5255b8(++_0x56e930);}(_0x044a,0x173));var _0xa044=function(_0x328dbc,_0x3970c5){_0x328dbc=_0x328dbc-0x0;var _0x4d71bc=_0x044a[_0x328dbc];return _0x4d71bc;};'use strict';var EventEmitter=require(_0xa044('0x0'));var UserProfile=require(_0xa044('0x1'))['db'][_0xa044('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa044('0x3')](0x0);var events={'afterCreate':_0xa044('0x4'),'afterUpdate':_0xa044('0x5'),'afterDestroy':_0xa044('0x6')};function emitEvent(_0x30b0c9){return function(_0x25ed77,_0x116358,_0x566ddf){UserProfileEvents[_0xa044('0x7')](_0x30b0c9+':'+_0x25ed77['id'],_0x25ed77);UserProfileEvents[_0xa044('0x7')](_0x30b0c9,_0x25ed77);_0x566ddf(null);};}for(var e in events){if(events[_0xa044('0x8')](e)){var event=events[e];UserProfile[_0xa044('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ab45132..66595a5 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 _0xe296=['Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','model','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','Tags','color','tag','Tag','ThroughTags','openTabs','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','exports','filter','field','value','associatedResources','map','catch','findAll','then','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','childModel','SquareProject','odbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','chatqueues','chatwebsites','ChatWebsite','FaxQueue','inboundroutes','internalroutes','outboundroutes','contexts','voicemails','VoiceMail','voicerecordings','Agents','User','role','agent','membername','telephone','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','voicequeues','VoiceQueues','users','agents','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','sounds','Sound','tags','templates','triggers','trunks','Trunk','variables'];(function(_0x4fd389,_0x929335){var _0x370eb0=function(_0x56810c){while(--_0x56810c){_0x4fd389['push'](_0x4fd389['shift']());}};_0x370eb0(++_0x929335);}(_0xe296,0x1b6));var _0x6e29=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0xe296[_0xd3e0b9];return _0x470133;};'use strict';var _=require(_0x6e29('0x0'));var attributes=require(_0x6e29('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x6e29('0x2')]=function(_0x258fbf){var _0x2dd325=_0x258fbf['models'];function _0xd81eed(_0x2eb221,_0x554e92){return new Promise(function(_0x28d8b9,_0x5d89ab){if(!_0x554e92)return _0x28d8b9(null);var _0x1eddda=_0x554e92[_0x6e29('0x3')]?{[_0x554e92['filter'][_0x6e29('0x4')]]:_0x554e92[_0x6e29('0x3')][_0x6e29('0x5')]}:undefined;return _0x2dd325[_0x2eb221]['findAll']({'where':_0x1eddda,'raw':!![]})['then'](function(_0x21871f){_0x554e92[_0x6e29('0x6')]=_[_0x6e29('0x7')](_0x21871f,'id');_0x28d8b9(_0x554e92);})[_0x6e29('0x8')](function(_0x21a7dd){_0x5d89ab(_0x21a7dd);});});}function _0x56eadf(_0x2fccb7,_0x2b2f23){return new Promise(function(_0x2d1ed4,_0x1db766){var _0x41997d=_0x2fccb7[_0x6e29('0x3')]?{[_0x2fccb7[_0x6e29('0x3')][_0x6e29('0x4')]]:_0x2fccb7[_0x6e29('0x3')][_0x6e29('0x5')]}:undefined;return _0x2dd325[_0x2fccb7['model']][_0x6e29('0x9')]({'where':_0x41997d,'raw':!![]})[_0x6e29('0xa')](function(_0x36c1b8){_0x2b2f23[_0x6e29('0x6')]=_[_0x6e29('0x7')](_0x36c1b8,function(_0x128ca4){return _0x128ca4[_0x6e29('0xb')];});_0x2d1ed4(_0x2b2f23);})[_0x6e29('0x8')](function(_0x3b20cc){_0x1db766(_0x3b20cc);});});}function _0xbb8322(_0x5218df,_0x5498a4,_0x2842b1){if(!_0x5498a4)return Promise[_0x6e29('0xc')](null);return new Promise(function(_0x59f1ff,_0x30a95b){return _0x2dd325[_0x6e29('0xd')]['findAll']({'where':{'sectionId':_0x5498a4['id']},'raw':!![]})[_0x6e29('0xa')](function(_0x14a070){if(_0x5218df[_0x6e29('0x4')]&&_0x5218df['field']!=='id'){_0x5498a4[_0x6e29('0x6')]=_['map'](_0x14a070,function(_0x2f97a9){return _0x2f97a9[_0x5218df[_0x6e29('0x4')]];});}else{if(_0x2842b1===_0x6e29('0xe')){_0x5498a4[_0x6e29('0x6')]=_[_0x6e29('0x7')](_0x14a070,function(_0x988ed2){return{'id':_0x988ed2[_0x6e29('0xf')],'type':_0x988ed2['type']};});}else{_0x5498a4['associatedResources']=_[_0x6e29('0x7')](_0x14a070,function(_0x3bbbb0){return _0x3bbbb0['resourceId'];});}}_0x59f1ff(_0x5498a4);})['catch'](function(_0x55093d){_0x30a95b(_0x55093d);});});}function _0x5b767c(_0x212136,_0xe52d24){var _0x238b13={'parentSections':[]};switch(_0x212136[_0x6e29('0x10')]()){case'squareprojects':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x12');break;case _0x6e29('0x13'):_0x238b13['childModel']='SquareOdbc';break;case _0x6e29('0x14'):_0x238b13[_0x6e29('0x11')]='SquareRecording';_0x238b13[_0x6e29('0x15')]=[{'name':_0x6e29('0x16'),'field':_0x6e29('0xb'),'foreignKey':_0x6e29('0x17')}];break;case'projects':_0x238b13['childModel']=_0x6e29('0x18');break;case _0x6e29('0x19'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x1a');_0x238b13['parentSections']=[{'name':_0x6e29('0x1b'),'field':'id','foreignKey':_0x6e29('0x1c')}];break;case _0x6e29('0x1d'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x1e');break;case _0x6e29('0x1f'):_0x238b13[_0x6e29('0x11')]='CmCompany';break;case _0x6e29('0x20'):_0x238b13['childModel']='CmCustomField';break;case _0x6e29('0x21'):_0x238b13[_0x6e29('0x11')]='ChatQueue';break;case _0x6e29('0x22'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x23');break;case'faxqueues':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x24');break;case'faxaccounts':_0x238b13[_0x6e29('0x11')]='FaxAccount';break;case _0x6e29('0x25'):case _0x6e29('0x26'):case _0x6e29('0x27'):_0x238b13['childModel']='VoiceExtension';break;case _0x6e29('0x28'):_0x238b13['childModel']='VoiceContext';break;case _0x6e29('0x29'):_0x238b13['childModel']=_0x6e29('0x2a');break;case _0x6e29('0x2b'):_0x238b13['childModel']='VoiceRecording';_0x238b13[_0x6e29('0x15')]=[{'name':_0x6e29('0x2c'),'field':_0x6e29('0xb'),'foreignKey':'membername','model':_0x6e29('0x2d'),'filter':{'field':_0x6e29('0x2e'),'value':[_0x6e29('0x2f')]}},{'name':'Telephones','field':_0x6e29('0xb'),'foreignKey':_0x6e29('0x30'),'model':'User','filter':{'field':'role','value':[_0x6e29('0x31')]}},{'name':'VoiceQueues','field':_0x6e29('0xb'),'foreignKey':_0x6e29('0x32'),'model':_0x6e29('0x33'),'filter':{'field':_0x6e29('0x34'),'value':[_0x6e29('0x35')]}},{'name':_0x6e29('0x36'),'field':_0x6e29('0xb'),'foreignKey':_0x6e29('0x32'),'model':_0x6e29('0x33'),'filter':{'field':_0x6e29('0x34'),'value':[_0x6e29('0x37')]}}];break;case _0x6e29('0x38'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x39');break;case'chanspies':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x3a');break;case _0x6e29('0x3b'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x3c');break;case'ivrcampaigns':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x3d');break;case _0x6e29('0x3e'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x3f');break;case'mailaccounts':_0x238b13['childModel']=_0x6e29('0x40');break;case _0x6e29('0x41'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x42');break;case _0x6e29('0x43'):_0x238b13['childModel']='OpenchannelQueue';break;case _0x6e29('0x44'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x45');break;case'smsqueues':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x46');break;case _0x6e29('0x47'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x48');break;case'whatsappqueues':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x49');break;case _0x6e29('0x4a'):_0x238b13[_0x6e29('0x11')]='WhatsappAccount';break;case'teams':_0x238b13[_0x6e29('0x11')]='Team';break;case _0x6e29('0x4b'):case'queuecampaigns':_0x238b13[_0x6e29('0x11')]='VoiceQueue';if(_0xe52d24){_0x238b13[_0x6e29('0x15')]=[{'name':_0x6e29('0x4c')},{'name':_0x6e29('0x36')}];}break;case _0x6e29('0x4d'):case _0x6e29('0x4e'):case'telephones':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x2d');if(_0xe52d24){_0x238b13[_0x6e29('0x15')]=[{'name':_0x6e29('0x4f'),'filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0x6e29('0x2c')},{'name':'Telephones'}];}break;case _0x6e29('0x50'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x51');break;case _0x6e29('0x52'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x53');break;case _0x6e29('0x54'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x55');break;case _0x6e29('0x56'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x57');break;case _0x6e29('0x58'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x59');break;case'zohoaccounts':_0x238b13['childModel']=_0x6e29('0x5a');break;case'vtigeraccounts':_0x238b13[_0x6e29('0x11')]='User';break;case _0x6e29('0x5b'):_0x238b13[_0x6e29('0x11')]='CannedAnswer';break;case _0x6e29('0x5c'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x5d');break;case _0x6e29('0x5e'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x5f');break;case _0x6e29('0x60'):_0x238b13['childModel']=_0x6e29('0x61');break;case'pauses':_0x238b13[_0x6e29('0x11')]=_0x6e29('0x62');break;case _0x6e29('0x63'):_0x238b13['childModel']='Schedule';break;case _0x6e29('0x64'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x65');break;case _0x6e29('0x66'):_0x238b13['childModel']='Tag';break;case _0x6e29('0x67'):_0x238b13[_0x6e29('0x11')]='Template';break;case _0x6e29('0x68'):_0x238b13[_0x6e29('0x11')]='Trigger';break;case _0x6e29('0x69'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x6a');break;case _0x6e29('0x6b'):_0x238b13[_0x6e29('0x11')]=_0x6e29('0x6c');break;case _0x6e29('0x6d'):_0x238b13['childModel']=_0x6e29('0x6e');break;case _0x6e29('0x6f'):_0x238b13[_0x6e29('0x11')]='AnalyticExtractedReport';_0x238b13['parentSections']=[{'name':_0x6e29('0x70'),'field':'id','foreignKey':_0x6e29('0x71')}];break;case _0x6e29('0x72'):_0x238b13[_0x6e29('0x11')]='AnalyticMetric';break;}return _0x238b13;}function _0x2c8361(_0x45eeae,_0x25c7c1){var _0x68b8f0=_0x45eeae['charAt'](0x0)[_0x6e29('0x73')]()+_0x45eeae[_0x6e29('0x74')](0x1);var _0x464e7e={'type':_0x2dd325['Sequelize'][_0x6e29('0x75')][_0x6e29('0x76')],'raw':!![]};return new Promise(function(_0x2cf723,_0x2a2e0c){var _0x4a1262=squel[_0x6e29('0x77')]()['field'](_0x6e29('0x78')+_0x68b8f0+_0x6e29('0x79'),'id')['field'](_0x6e29('0x7a'))[_0x6e29('0x7b')](_0x6e29('0x7c')+_0x45eeae+'_interactions','ui')[_0x6e29('0x7d')]('ui.UserId\x20=\x20?',_0x25c7c1['id']);return _0x2dd325['sequelize'][_0x6e29('0x7e')](_0x4a1262[_0x6e29('0x7f')](),_0x464e7e)[_0x6e29('0xa')](function(_0x3b8e07){_0x25c7c1[_0x68b8f0+_0x6e29('0x80')]=_0x3b8e07;_0x2cf723(_0x3b8e07);})[_0x6e29('0x8')](function(_0xd76630){_0x2a2e0c(_0xd76630);});});}return _0x258fbf[_0x6e29('0x81')](_0x6e29('0x82'),attributes,{'tableName':_0x6e29('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x299a47){var _0x52e922={'raw':_0x299a47[_0x6e29('0x7e')][_0x6e29('0x84')],'where':{}};var _0x3dbca5={};var _0x5ffcd4={'count':0x0,'rows':[]};var _0x3b4380=_0x299a47['query'][_0x6e29('0x85')];var _0x807eb5=_0x299a47['query']['mergeResources']||![];var _0x2d1234=_0x5b767c(_0x3b4380,_0x807eb5);if(!_0x2d1234['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x3b4380+'\x27');var _0x4ecc5a=[{'name':_0x3b4380}];if(!_[_0x6e29('0x86')](_0x2d1234[_0x6e29('0x15')]))_0x4ecc5a=_0x2d1234[_0x6e29('0x15')];var _0x5b6261=[];for(var _0x2f4911=0x0;_0x2f4911<_0x4ecc5a[_0x6e29('0x87')];_0x2f4911++){_0x5b6261[_0x6e29('0x88')](_0x2dd325[_0x6e29('0x89')][_0x6e29('0x8a')]({'where':{'userProfileId':_0x299a47[_0x6e29('0x8b')]['id'],'name':_0x4ecc5a[_0x2f4911][_0x6e29('0xb')]},'raw':!![]}));}return Promise[_0x6e29('0x8c')](_0x5b6261)[_0x6e29('0xa')](function(_0x172f6f){var _0x41ac2d=_[_0x6e29('0x3')](_0x172f6f,function(_0x5440b6){return _0x5440b6?_0x5440b6:undefined;});var _0x250701=_[_0x6e29('0x3')](_0x4ecc5a,['ignore',!![]]);var _0x9744b7=_[_0x6e29('0x86')](_0x41ac2d)&&_[_0x6e29('0x86')](_0x250701)?null:_['union'](_0x250701,_0x41ac2d);if(!_0x9744b7)return null;var _0x1c7869=[];for(var _0x2100bb=0x0;_0x2100bb<_0x9744b7[_0x6e29('0x87')];_0x2100bb++){var _0x589871=_[_0x6e29('0x8a')](_0x4ecc5a,function(_0xec5af7){return _0x9744b7[_0x2100bb]?_0xec5af7['name']===_0x9744b7[_0x2100bb][_0x6e29('0xb')]:null;});if(_0x589871){if(_0x9744b7[_0x2100bb][_0x6e29('0x8d')]){_0x1c7869[_0x6e29('0x88')](_0xd81eed(_0x2d1234[_0x6e29('0x11')],_0x9744b7[_0x2100bb]));}else{if(!_0x9744b7[_0x2100bb][_0x6e29('0x8e')]){_0x1c7869['push'](_0xbb8322(_0x589871,_0x9744b7[_0x2100bb],_0x2d1234['childModel']));}else{if(_0x589871[_0x6e29('0x8f')]){_0x1c7869[_0x6e29('0x88')](_0x56eadf(_0x589871,_0x9744b7[_0x2100bb]));}}}}}return Promise[_0x6e29('0x8c')](_0x1c7869);})[_0x6e29('0xa')](function(_0xdfb629){var _0x59ee5a=_0xdfb629;var _0xfe08ac=null;if(_0x59ee5a){_0xfe08ac=_0x59ee5a[_0x6e29('0x87')]===0x1?_0x59ee5a[0x0]:null;}if(!_0xfe08ac&&!_0x59ee5a)return _0x5ffcd4;var _0x391bf5=_0x2dd325[_0x2d1234['childModel']][_0x6e29('0x90')];_0x3dbca5[_0x6e29('0x8f')]=_[_0x6e29('0x91')](_0x391bf5);_0x3dbca5[_0x6e29('0x7e')]=_['keys'](_0x299a47[_0x6e29('0x7e')]);_0x3dbca5[_0x6e29('0x92')]=_['intersection'](_0x3dbca5[_0x6e29('0x8f')],_0x3dbca5[_0x6e29('0x7e')]);_0x52e922[_0x6e29('0x93')]=_[_0x6e29('0x94')](_0x3dbca5[_0x6e29('0x8f')],qs['fields'](_0x299a47[_0x6e29('0x7e')][_0x6e29('0x95')]));_0x52e922['attributes']=_0x52e922['attributes']['length']?_0x52e922[_0x6e29('0x93')]:_0x3dbca5[_0x6e29('0x8f')];if(!_0x299a47[_0x6e29('0x7e')][_0x6e29('0x96')](_0x6e29('0x97'))){_0x52e922[_0x6e29('0x98')]=qs[_0x6e29('0x98')](_0x299a47[_0x6e29('0x7e')][_0x6e29('0x98')]);_0x52e922[_0x6e29('0x99')]=qs['offset'](_0x299a47[_0x6e29('0x7e')][_0x6e29('0x99')]);}_0x52e922['order']=qs['sort'](_0x299a47[_0x6e29('0x7e')][_0x6e29('0x9a')]);_0x52e922[_0x6e29('0x7d')]=qs[_0x6e29('0x92')](_[_0x6e29('0x9b')](_0x299a47[_0x6e29('0x7e')],_0x3dbca5[_0x6e29('0x92')]));if(_0x299a47[_0x6e29('0x7e')]['filter']){_0x52e922[_0x6e29('0x7d')]=_[_0x6e29('0x9c')](_0x52e922[_0x6e29('0x7d')],{'$or':_[_0x6e29('0x7')](_0x391bf5,function(_0x439fb7){if(_0x439fb7[_0x6e29('0x34')][_0x6e29('0x9d')]!==_0x6e29('0x9e')){var _0x558152={};_0x558152[_0x439fb7['field']]={'$like':'%'+_0x299a47[_0x6e29('0x7e')][_0x6e29('0x3')]+'%'};return _0x558152;}})});}var _0x4d72dd=[];var _0x169301=null;var _0x35d1b7={};if(_0xfe08ac){_0x169301=_[_0x6e29('0x8a')](_0x4ecc5a,['name',_0xfe08ac[_0x6e29('0xb')]]);if(_0x169301[_0x6e29('0x4')]){_0x35d1b7={};if(_0x2d1234[_0x6e29('0x11')]===_0x6e29('0xe')){_0x35d1b7[_0x169301[_0x6e29('0x9f')]]=_[_0x6e29('0x7')](_0xfe08ac[_0x6e29('0x6')],'id');}else{_0x35d1b7[_0x169301[_0x6e29('0x9f')]]=_0xfe08ac[_0x6e29('0x6')];}_0x4d72dd[_0x6e29('0x88')](_0x35d1b7);}else{_0x52e922['where']['id']=_0xfe08ac[_0x6e29('0x6')];}}else{for(var _0x52d52c=0x0;_0x52d52c<_0x59ee5a[_0x6e29('0x87')];_0x52d52c++){_0x169301=_['find'](_0x4ecc5a,[_0x6e29('0xb'),_0x59ee5a[_0x52d52c][_0x6e29('0xb')]]);if(_0x169301[_0x6e29('0x4')]){_0x35d1b7={};_0x35d1b7[_0x169301['foreignKey']]=_0x59ee5a[_0x52d52c][_0x6e29('0x6')];_0x4d72dd[_0x6e29('0x88')](_0x35d1b7);}else{if(!_0x52e922['where']['id'])_0x52e922['where']['id']=[];_0x59ee5a[_0x52d52c]['associatedResources'][_0x6e29('0xa0')](function(_0x370201){_0x52e922[_0x6e29('0x7d')]['id']['push'](_0x370201);});}}}if(!_['isEmpty'](_0x4d72dd)){_0x52e922['where']=_[_0x6e29('0x9c')](_0x52e922['where'],{'$and':{'$or':_0x4d72dd}});}_0x52e922=_['merge']({},_0x52e922,_0x299a47[_0x6e29('0xa1')]);if(_0xfe08ac&&!_0xfe08ac[_0x6e29('0x8e')]&&_0x2d1234[_0x6e29('0x11')]===_0x6e29('0xe')){if(_0x299a47['query'][_0x6e29('0xa2')]){_0x52e922[_0x6e29('0xa3')]=[{'all':!![]}];}return _0x2dd325[_0x2d1234[_0x6e29('0x11')]][_0x6e29('0x9')](_0x52e922)['then'](function(_0x374168){var _0x262765=[];_0x374168['forEach'](function(_0x1c5dc8){var _0x2d101c;switch(_0x1c5dc8[_0x6e29('0xa4')]){case'default':_0x2d101c=_[_0x6e29('0x8a')](_0xfe08ac['associatedResources'],function(_0x23a134){return _0x23a134['id']===_0x1c5dc8['reportId']&&_0x23a134[_0x6e29('0x34')]===_0x6e29('0xa5');});break;case _0x6e29('0xa6'):_0x2d101c=_['find'](_0xfe08ac[_0x6e29('0x6')],function(_0x4fdfb9){return _0x4fdfb9['id']===_0x1c5dc8[_0x6e29('0x71')]&&_0x4fdfb9['type']===_0x6e29('0xa7');});break;}if(_0x2d101c)_0x262765[_0x6e29('0x88')](_0x1c5dc8);});_0x5ffcd4[_0x6e29('0xa8')]=_0x262765[_0x6e29('0x87')];_0x5ffcd4[_0x6e29('0xa9')]=_0x262765;return _0x5ffcd4;});}else{return _0x2dd325[_0x2d1234['childModel']]['count']({'where':_0x52e922[_0x6e29('0x7d')]})[_0x6e29('0xa')](function(_0x488b6e){_0x5ffcd4[_0x6e29('0xa8')]=_0x488b6e;if(_0x299a47['query'][_0x6e29('0xa2')]){if(_0x2d1234[_0x6e29('0x11')]===_0x6e29('0x1a')){_0x52e922['include']=[{'model':_0x2dd325['Tag'],'as':_0x6e29('0xaa'),'attributes':['id',_0x6e29('0xb'),_0x6e29('0xab')],'required':_0x299a47['query'][_0x6e29('0xac')]?!![]:![]},{'model':_0x2dd325[_0x6e29('0xad')],'as':_0x6e29('0xae'),'attributes':['id','name',_0x6e29('0xab')],'through':_0x299a47[_0x6e29('0x7e')]['tag']?{'attributes':[],'where':{'TagId':_0x299a47[_0x6e29('0x7e')][_0x6e29('0xac')]||undefined}}:{},'required':_0x299a47['query'][_0x6e29('0xac')]?!![]:![]}];}else{_0x52e922[_0x6e29('0xa3')]=[{'all':!![]}];}}return _0x2dd325[_0x2d1234['childModel']][_0x6e29('0x9')](_0x52e922);})[_0x6e29('0xa')](function(_0x13e6eb){_0x5ffcd4[_0x6e29('0xa9')]=_0x13e6eb;if(_0x3b4380===_0x6e29('0x2c')&&_0x299a47['query'][_0x6e29('0xaf')]==='true'){var _0x308c55=[];for(var _0x542379=0x0;_0x542379<_0x5ffcd4[_0x6e29('0xa9')][_0x6e29('0x87')];_0x542379++){_0x308c55[_0x6e29('0x88')](_0x2c8361(_0x6e29('0xb0'),_0x5ffcd4[_0x6e29('0xa9')][_0x542379][_0x6e29('0xb1')]));_0x308c55[_0x6e29('0x88')](_0x2c8361(_0x6e29('0xb2'),_0x5ffcd4[_0x6e29('0xa9')][_0x542379][_0x6e29('0xb1')]));_0x308c55['push'](_0x2c8361(_0x6e29('0xb3'),_0x5ffcd4[_0x6e29('0xa9')][_0x542379]['dataValues']));_0x308c55[_0x6e29('0x88')](_0x2c8361(_0x6e29('0xb4'),_0x5ffcd4[_0x6e29('0xa9')][_0x542379][_0x6e29('0xb1')]));_0x308c55[_0x6e29('0x88')](_0x2c8361(_0x6e29('0xb5'),_0x5ffcd4[_0x6e29('0xa9')][_0x542379][_0x6e29('0xb1')]));_0x308c55[_0x6e29('0x88')](_0x2c8361('whatsapp',_0x5ffcd4['rows'][_0x542379][_0x6e29('0xb1')]));}return Promise[_0x6e29('0x8c')](_0x308c55)[_0x6e29('0xa')](function(){return _0x5ffcd4;});}return _0x5ffcd4;});}});}}});}; \ No newline at end of file +var _0xbaa8=['limit','offset','order','sort','filters','merge','key','VIRTUAL','foreignKey','forEach','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','includeAll','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','then','associatedResources','catch','field','model','findAll','map','name','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','projects','contacts','CmContact','parentSections','Lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','admin','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','Template','Trigger','trunks','Trunk','Variable','Reports','reportId','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','user_profiles','raw','section','Invalid\x20section\x20\x27','isEmpty','length','find','all','ignore','union','push','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xbaa8,0xd6));var _0x8baa=function(_0x2225e0,_0x14b541){_0x2225e0=_0x2225e0-0x0;var _0x26cb3f=_0xbaa8[_0x2225e0];return _0x26cb3f;};'use strict';var _=require(_0x8baa('0x0'));var attributes=require(_0x8baa('0x1'));var qs=require(_0x8baa('0x2'));var squel=require(_0x8baa('0x3'));module[_0x8baa('0x4')]=function(_0xa08455){var _0x34316c=_0xa08455[_0x8baa('0x5')];function _0x512883(_0x3e595d,_0x4f7fe6){return new Promise(function(_0x47585c,_0x4048a8){if(!_0x4f7fe6)return _0x47585c(null);var _0x386f30=_0x4f7fe6[_0x8baa('0x6')]?{[_0x4f7fe6[_0x8baa('0x6')]['field']]:_0x4f7fe6[_0x8baa('0x6')][_0x8baa('0x7')]}:undefined;return _0x34316c[_0x3e595d]['findAll']({'where':_0x386f30,'raw':!![]})[_0x8baa('0x8')](function(_0x44a7af){_0x4f7fe6[_0x8baa('0x9')]=_['map'](_0x44a7af,'id');_0x47585c(_0x4f7fe6);})[_0x8baa('0xa')](function(_0x3d0fbd){_0x4048a8(_0x3d0fbd);});});}function _0x3127cf(_0x556fd6,_0xcfdb86){return new Promise(function(_0x203480,_0x1f8776){var _0x2d3340=_0x556fd6[_0x8baa('0x6')]?{[_0x556fd6[_0x8baa('0x6')][_0x8baa('0xb')]]:_0x556fd6[_0x8baa('0x6')][_0x8baa('0x7')]}:undefined;return _0x34316c[_0x556fd6[_0x8baa('0xc')]][_0x8baa('0xd')]({'where':_0x2d3340,'raw':!![]})[_0x8baa('0x8')](function(_0x4193a3){_0xcfdb86[_0x8baa('0x9')]=_[_0x8baa('0xe')](_0x4193a3,function(_0x47ba7a){return _0x47ba7a[_0x8baa('0xf')];});_0x203480(_0xcfdb86);})['catch'](function(_0x57ae79){_0x1f8776(_0x57ae79);});});}function _0x77f547(_0x59136d,_0x3d7acd,_0x3828f1){if(!_0x3d7acd)return Promise['resolve'](null);return new Promise(function(_0x5b12ee,_0x30c0fe){return _0x34316c['UserProfileResource']['findAll']({'where':{'sectionId':_0x3d7acd['id']},'raw':!![]})[_0x8baa('0x8')](function(_0x3f0802){if(_0x59136d[_0x8baa('0xb')]&&_0x59136d[_0x8baa('0xb')]!=='id'){_0x3d7acd[_0x8baa('0x9')]=_[_0x8baa('0xe')](_0x3f0802,function(_0x127691){return _0x127691[_0x59136d[_0x8baa('0xb')]];});}else{if(_0x3828f1===_0x8baa('0x10')){_0x3d7acd[_0x8baa('0x9')]=_['map'](_0x3f0802,function(_0x28780d){return{'id':_0x28780d[_0x8baa('0x11')],'type':_0x28780d[_0x8baa('0x12')]};});}else{_0x3d7acd[_0x8baa('0x9')]=_['map'](_0x3f0802,function(_0xac1107){return _0xac1107[_0x8baa('0x11')];});}}_0x5b12ee(_0x3d7acd);})[_0x8baa('0xa')](function(_0x48ad4e){_0x30c0fe(_0x48ad4e);});});}function _0x24ca43(_0x216393,_0x1d0418){var _0x2627ed={'parentSections':[]};switch(_0x216393[_0x8baa('0x13')]()){case'squareprojects':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x15');break;case _0x8baa('0x16'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x17');break;case _0x8baa('0x18'):_0x2627ed['childModel']='SquareRecording';_0x2627ed['parentSections']=[{'name':_0x8baa('0x19'),'field':'name','foreignKey':_0x8baa('0x1a')}];break;case _0x8baa('0x1b'):_0x2627ed['childModel']='JscriptyProject';break;case _0x8baa('0x1c'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x1d');_0x2627ed[_0x8baa('0x1e')]=[{'name':_0x8baa('0x1f'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x2627ed['childModel']=_0x8baa('0x20');break;case _0x8baa('0x21'):_0x2627ed['childModel']=_0x8baa('0x22');break;case _0x8baa('0x23'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x24');break;case _0x8baa('0x25'):_0x2627ed[_0x8baa('0x14')]='ChatQueue';break;case _0x8baa('0x26'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x27');break;case _0x8baa('0x28'):_0x2627ed[_0x8baa('0x14')]='FaxQueue';break;case _0x8baa('0x29'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x2a');break;case _0x8baa('0x2b'):case'internalroutes':case'outboundroutes':_0x2627ed[_0x8baa('0x14')]='VoiceExtension';break;case _0x8baa('0x2c'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x2d');break;case _0x8baa('0x2e'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x2f');break;case _0x8baa('0x30'):_0x2627ed['childModel']='VoiceRecording';_0x2627ed[_0x8baa('0x1e')]=[{'name':_0x8baa('0x31'),'field':_0x8baa('0xf'),'foreignKey':_0x8baa('0x32'),'model':_0x8baa('0x33'),'filter':{'field':_0x8baa('0x34'),'value':[_0x8baa('0x35')]}},{'name':_0x8baa('0x36'),'field':_0x8baa('0xf'),'foreignKey':_0x8baa('0x32'),'model':_0x8baa('0x33'),'filter':{'field':_0x8baa('0x34'),'value':[_0x8baa('0x37')]}},{'name':_0x8baa('0x38'),'field':_0x8baa('0xf'),'foreignKey':_0x8baa('0x39'),'model':_0x8baa('0x3a'),'filter':{'field':'type','value':[_0x8baa('0x3b')]}},{'name':_0x8baa('0x3c'),'field':_0x8baa('0xf'),'foreignKey':_0x8baa('0x39'),'model':'VoiceQueue','filter':{'field':_0x8baa('0x12'),'value':['outbound']}}];break;case _0x8baa('0x3d'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x3e');break;case _0x8baa('0x3f'):_0x2627ed['childModel']=_0x8baa('0x40');break;case _0x8baa('0x41'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x42');break;case'ivrcampaigns':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x43');break;case'mailqueues':_0x2627ed['childModel']='MailQueue';break;case _0x8baa('0x44'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x45');break;case _0x8baa('0x46'):_0x2627ed['childModel']=_0x8baa('0x47');break;case _0x8baa('0x48'):_0x2627ed[_0x8baa('0x14')]='OpenchannelQueue';break;case _0x8baa('0x49'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x4a');break;case _0x8baa('0x4b'):_0x2627ed[_0x8baa('0x14')]='SmsQueue';break;case'smsaccounts':_0x2627ed[_0x8baa('0x14')]='SmsAccount';break;case _0x8baa('0x4c'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x4d');break;case _0x8baa('0x4e'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x4f');break;case _0x8baa('0x50'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x51');break;case _0x8baa('0x52'):case'queuecampaigns':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x3a');if(_0x1d0418){_0x2627ed[_0x8baa('0x1e')]=[{'name':_0x8baa('0x38')},{'name':'QueueCampaigns'}];}break;case _0x8baa('0x53'):case _0x8baa('0x54'):case _0x8baa('0x55'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x33');if(_0x1d0418){_0x2627ed[_0x8baa('0x1e')]=[{'name':'Users','filter':{'field':'role','value':[_0x8baa('0x56'),'user']},'ignore':!![]},{'name':_0x8baa('0x31')},{'name':_0x8baa('0x36')}];}break;case'zendeskaccounts':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x57');break;case _0x8baa('0x58'):_0x2627ed['childModel']='SalesforceAccount';break;case _0x8baa('0x59'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x5a');break;case _0x8baa('0x5b'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x5c');break;case _0x8baa('0x5d'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x5e');break;case _0x8baa('0x5f'):_0x2627ed[_0x8baa('0x14')]='ZohoAccount';break;case _0x8baa('0x60'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x33');break;case _0x8baa('0x61'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x62');break;case _0x8baa('0x63'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x64');break;case _0x8baa('0x65'):_0x2627ed['childModel']=_0x8baa('0x66');break;case _0x8baa('0x67'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x68');break;case _0x8baa('0x69'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x6a');break;case _0x8baa('0x6b'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x6c');break;case _0x8baa('0x6d'):_0x2627ed['childModel']=_0x8baa('0x6e');break;case _0x8baa('0x6f'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x70');break;case'templates':_0x2627ed['childModel']=_0x8baa('0x71');break;case'triggers':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x72');break;case _0x8baa('0x73'):_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x74');break;case'variables':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x75');break;case'plugins':_0x2627ed[_0x8baa('0x14')]='Plugin';break;case'extractedreports':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x10');_0x2627ed[_0x8baa('0x1e')]=[{'name':_0x8baa('0x76'),'field':'id','foreignKey':_0x8baa('0x77')}];break;case'metrics':_0x2627ed[_0x8baa('0x14')]=_0x8baa('0x78');break;}return _0x2627ed;}function _0x3eaf45(_0x490347,_0x148243){var _0x268e69=_0x490347['charAt'](0x0)[_0x8baa('0x79')]()+_0x490347[_0x8baa('0x7a')](0x1);var _0x371528={'type':_0x34316c[_0x8baa('0x7b')][_0x8baa('0x7c')][_0x8baa('0x7d')],'raw':!![]};return new Promise(function(_0x1b2c01,_0xe2200){var _0x1b7f8e=squel[_0x8baa('0x7e')]()[_0x8baa('0xb')](_0x8baa('0x7f')+_0x268e69+_0x8baa('0x80'),'id')[_0x8baa('0xb')](_0x8baa('0x81'))['from']('user_has_'+_0x490347+'_interactions','ui')[_0x8baa('0x82')](_0x8baa('0x83'),_0x148243['id']);return _0x34316c[_0x8baa('0x84')][_0x8baa('0x85')](_0x1b7f8e['toString'](),_0x371528)[_0x8baa('0x8')](function(_0x256982){_0x148243[_0x268e69+_0x8baa('0x86')]=_0x256982;_0x1b2c01(_0x256982);})[_0x8baa('0xa')](function(_0x26b21c){_0xe2200(_0x26b21c);});});}return _0xa08455['define'](_0x8baa('0x87'),attributes,{'tableName':_0x8baa('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1988bd){var _0x242e91={'raw':_0x1988bd[_0x8baa('0x85')][_0x8baa('0x89')],'where':{}};var _0xe5f02f={};var _0x51220f={'count':0x0,'rows':[]};var _0x16490c=_0x1988bd['query'][_0x8baa('0x8a')];var _0xec79ab=_0x1988bd[_0x8baa('0x85')]['mergeResources']||![];var _0x41c608=_0x24ca43(_0x16490c,_0xec79ab);if(!_0x41c608[_0x8baa('0x14')])throw new Error(_0x8baa('0x8b')+_0x16490c+'\x27');var _0x4d4abf=[{'name':_0x16490c}];if(!_[_0x8baa('0x8c')](_0x41c608[_0x8baa('0x1e')]))_0x4d4abf=_0x41c608[_0x8baa('0x1e')];var _0x477f56=[];for(var _0x2e0c0a=0x0;_0x2e0c0a<_0x4d4abf[_0x8baa('0x8d')];_0x2e0c0a++){_0x477f56['push'](_0x34316c['UserProfileSection'][_0x8baa('0x8e')]({'where':{'userProfileId':_0x1988bd['params']['id'],'name':_0x4d4abf[_0x2e0c0a][_0x8baa('0xf')]},'raw':!![]}));}return Promise[_0x8baa('0x8f')](_0x477f56)[_0x8baa('0x8')](function(_0x402ca9){var _0x5e5aef=_[_0x8baa('0x6')](_0x402ca9,function(_0x76cc84){return _0x76cc84?_0x76cc84:undefined;});var _0x3be1f4=_[_0x8baa('0x6')](_0x4d4abf,[_0x8baa('0x90'),!![]]);var _0x42d714=_[_0x8baa('0x8c')](_0x5e5aef)&&_[_0x8baa('0x8c')](_0x3be1f4)?null:_[_0x8baa('0x91')](_0x3be1f4,_0x5e5aef);if(!_0x42d714)return null;var _0x19bb6a=[];for(var _0x1dc39c=0x0;_0x1dc39c<_0x42d714[_0x8baa('0x8d')];_0x1dc39c++){var _0x667aae=_[_0x8baa('0x8e')](_0x4d4abf,function(_0x5e48af){return _0x42d714[_0x1dc39c]?_0x5e48af[_0x8baa('0xf')]===_0x42d714[_0x1dc39c][_0x8baa('0xf')]:null;});if(_0x667aae){if(_0x42d714[_0x1dc39c][_0x8baa('0x90')]){_0x19bb6a[_0x8baa('0x92')](_0x512883(_0x41c608[_0x8baa('0x14')],_0x42d714[_0x1dc39c]));}else{if(!_0x42d714[_0x1dc39c][_0x8baa('0x93')]){_0x19bb6a[_0x8baa('0x92')](_0x77f547(_0x667aae,_0x42d714[_0x1dc39c],_0x41c608[_0x8baa('0x14')]));}else{if(_0x667aae['model']){_0x19bb6a[_0x8baa('0x92')](_0x3127cf(_0x667aae,_0x42d714[_0x1dc39c]));}}}}}return Promise[_0x8baa('0x8f')](_0x19bb6a);})[_0x8baa('0x8')](function(_0x314163){var _0x268204=_0x314163;var _0x450387=null;if(_0x268204){_0x450387=_0x268204[_0x8baa('0x8d')]===0x1?_0x268204[0x0]:null;}if(!_0x450387&&!_0x268204)return _0x51220f;var _0x206e7d=_0x34316c[_0x41c608[_0x8baa('0x14')]][_0x8baa('0x94')];_0xe5f02f['model']=_[_0x8baa('0x95')](_0x206e7d);_0xe5f02f[_0x8baa('0x85')]=_[_0x8baa('0x95')](_0x1988bd[_0x8baa('0x85')]);_0xe5f02f['filters']=_[_0x8baa('0x96')](_0xe5f02f['model'],_0xe5f02f[_0x8baa('0x85')]);_0x242e91[_0x8baa('0x97')]=_[_0x8baa('0x96')](_0xe5f02f[_0x8baa('0xc')],qs[_0x8baa('0x98')](_0x1988bd['query'][_0x8baa('0x98')]));_0x242e91[_0x8baa('0x97')]=_0x242e91[_0x8baa('0x97')][_0x8baa('0x8d')]?_0x242e91[_0x8baa('0x97')]:_0xe5f02f['model'];if(!_0x1988bd[_0x8baa('0x85')][_0x8baa('0x99')]('nolimit')){_0x242e91['limit']=qs[_0x8baa('0x9a')](_0x1988bd['query'][_0x8baa('0x9a')]);_0x242e91['offset']=qs[_0x8baa('0x9b')](_0x1988bd[_0x8baa('0x85')][_0x8baa('0x9b')]);}_0x242e91[_0x8baa('0x9c')]=qs['sort'](_0x1988bd[_0x8baa('0x85')][_0x8baa('0x9d')]);_0x242e91[_0x8baa('0x82')]=qs[_0x8baa('0x9e')](_['pick'](_0x1988bd[_0x8baa('0x85')],_0xe5f02f[_0x8baa('0x9e')]));if(_0x1988bd[_0x8baa('0x85')][_0x8baa('0x6')]){_0x242e91[_0x8baa('0x82')]=_[_0x8baa('0x9f')](_0x242e91[_0x8baa('0x82')],{'$or':_[_0x8baa('0xe')](_0x206e7d,function(_0x4a7711){if(_0x4a7711[_0x8baa('0x12')][_0x8baa('0xa0')]!==_0x8baa('0xa1')){var _0x4591dc={};_0x4591dc[_0x4a7711[_0x8baa('0xb')]]={'$like':'%'+_0x1988bd[_0x8baa('0x85')][_0x8baa('0x6')]+'%'};return _0x4591dc;}})});}var _0x558841=[];var _0x2259bb=null;var _0x276907={};if(_0x450387){_0x2259bb=_[_0x8baa('0x8e')](_0x4d4abf,[_0x8baa('0xf'),_0x450387[_0x8baa('0xf')]]);if(_0x2259bb[_0x8baa('0xb')]){_0x276907={};if(_0x41c608[_0x8baa('0x14')]==='AnalyticExtractedReport'){_0x276907[_0x2259bb[_0x8baa('0xa2')]]=_[_0x8baa('0xe')](_0x450387[_0x8baa('0x9')],'id');}else{_0x276907[_0x2259bb['foreignKey']]=_0x450387['associatedResources'];}_0x558841[_0x8baa('0x92')](_0x276907);}else{_0x242e91[_0x8baa('0x82')]['id']=_0x450387[_0x8baa('0x9')];}}else{for(var _0x167302=0x0;_0x167302<_0x268204['length'];_0x167302++){_0x2259bb=_[_0x8baa('0x8e')](_0x4d4abf,[_0x8baa('0xf'),_0x268204[_0x167302][_0x8baa('0xf')]]);if(_0x2259bb[_0x8baa('0xb')]){_0x276907={};_0x276907[_0x2259bb[_0x8baa('0xa2')]]=_0x268204[_0x167302]['associatedResources'];_0x558841[_0x8baa('0x92')](_0x276907);}else{if(!_0x242e91[_0x8baa('0x82')]['id'])_0x242e91[_0x8baa('0x82')]['id']=[];_0x268204[_0x167302][_0x8baa('0x9')][_0x8baa('0xa3')](function(_0x34ebec){_0x242e91[_0x8baa('0x82')]['id'][_0x8baa('0x92')](_0x34ebec);});}}}if(!_['isEmpty'](_0x558841)){_0x242e91[_0x8baa('0x82')]=_['merge'](_0x242e91[_0x8baa('0x82')],{'$and':{'$or':_0x558841}});}_0x242e91=_[_0x8baa('0x9f')]({},_0x242e91,_0x1988bd['options']);if(_0x450387&&!_0x450387[_0x8baa('0x93')]&&_0x41c608[_0x8baa('0x14')]===_0x8baa('0x10')){if(_0x1988bd['query']['includeAll']){_0x242e91[_0x8baa('0xa4')]=[{'all':!![]}];}return _0x34316c[_0x41c608[_0x8baa('0x14')]]['findAll'](_0x242e91)['then'](function(_0x2e5ba2){var _0x5aedc2=[];_0x2e5ba2[_0x8baa('0xa3')](function(_0x4652b9){var _0x375b6a;switch(_0x4652b9[_0x8baa('0xa5')]){case _0x8baa('0xa6'):_0x375b6a=_['find'](_0x450387[_0x8baa('0x9')],function(_0x3ed7b6){return _0x3ed7b6['id']===_0x4652b9['reportId']&&_0x3ed7b6[_0x8baa('0x12')]===_0x8baa('0xa7');});break;case _0x8baa('0xa8'):_0x375b6a=_[_0x8baa('0x8e')](_0x450387['associatedResources'],function(_0x6e416a){return _0x6e416a['id']===_0x4652b9[_0x8baa('0x77')]&&_0x6e416a['type']===_0x8baa('0xa9');});break;}if(_0x375b6a)_0x5aedc2[_0x8baa('0x92')](_0x4652b9);});_0x51220f[_0x8baa('0xaa')]=_0x5aedc2['length'];_0x51220f[_0x8baa('0xab')]=_0x5aedc2;return _0x51220f;});}else{return _0x34316c[_0x41c608[_0x8baa('0x14')]][_0x8baa('0xaa')]({'where':_0x242e91[_0x8baa('0x82')]})[_0x8baa('0x8')](function(_0x471297){_0x51220f[_0x8baa('0xaa')]=_0x471297;if(_0x1988bd[_0x8baa('0x85')][_0x8baa('0xac')]){if(_0x41c608[_0x8baa('0x14')]===_0x8baa('0x1d')){_0x242e91['include']=[{'model':_0x34316c[_0x8baa('0x70')],'as':'Tags','attributes':['id',_0x8baa('0xf'),_0x8baa('0xad')],'required':_0x1988bd[_0x8baa('0x85')]['tag']?!![]:![]},{'model':_0x34316c[_0x8baa('0x70')],'as':'ThroughTags','attributes':['id','name',_0x8baa('0xad')],'through':_0x1988bd[_0x8baa('0x85')][_0x8baa('0xae')]?{'attributes':[],'where':{'TagId':_0x1988bd['query']['tag']||undefined}}:{},'required':_0x1988bd[_0x8baa('0x85')][_0x8baa('0xae')]?!![]:![]}];}else{_0x242e91[_0x8baa('0xa4')]=[{'all':!![]}];}}return _0x34316c[_0x41c608['childModel']]['findAll'](_0x242e91);})[_0x8baa('0x8')](function(_0x19af76){_0x51220f['rows']=_0x19af76;if(_0x16490c===_0x8baa('0x31')&&_0x1988bd[_0x8baa('0x85')][_0x8baa('0xaf')]===_0x8baa('0xb0')){var _0x58fae4=[];for(var _0x3b0de9=0x0;_0x3b0de9<_0x51220f[_0x8baa('0xab')][_0x8baa('0x8d')];_0x3b0de9++){_0x58fae4[_0x8baa('0x92')](_0x3eaf45(_0x8baa('0xb1'),_0x51220f['rows'][_0x3b0de9][_0x8baa('0xb2')]));_0x58fae4['push'](_0x3eaf45(_0x8baa('0xb3'),_0x51220f['rows'][_0x3b0de9][_0x8baa('0xb2')]));_0x58fae4[_0x8baa('0x92')](_0x3eaf45(_0x8baa('0xb4'),_0x51220f['rows'][_0x3b0de9][_0x8baa('0xb2')]));_0x58fae4[_0x8baa('0x92')](_0x3eaf45(_0x8baa('0xb5'),_0x51220f['rows'][_0x3b0de9]['dataValues']));_0x58fae4[_0x8baa('0x92')](_0x3eaf45(_0x8baa('0xb6'),_0x51220f[_0x8baa('0xab')][_0x3b0de9][_0x8baa('0xb2')]));_0x58fae4[_0x8baa('0x92')](_0x3eaf45(_0x8baa('0xb7'),_0x51220f[_0x8baa('0xab')][_0x3b0de9]['dataValues']));}return Promise['all'](_0x58fae4)[_0x8baa('0x8')](function(){return _0x51220f;});}return _0x51220f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 4e9edfe..f518fab 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 _0xfa9f=['stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x3f2e69,_0x2ca085){var _0x111edd=function(_0x17cc96){while(--_0x17cc96){_0x3f2e69['push'](_0x3f2e69['shift']());}};_0x111edd(++_0x2ca085);}(_0xfa9f,0x93));var _0xffa9=function(_0x2abf7f,_0x23b05a){_0x2abf7f=_0x2abf7f-0x0;var _0x248bce=_0xfa9f[_0x2abf7f];return _0x248bce;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var moment=require(_0xffa9('0x1'));var BPromise=require(_0xffa9('0x2'));var rs=require(_0xffa9('0x3'));var fs=require('fs');var Redis=require(_0xffa9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffa9('0x5'));var logger=require('../../config/logger')(_0xffa9('0x6'));var config=require(_0xffa9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xffa9('0x8')]['http']({'port':0x232a});config['redis']=_[_0xffa9('0x9')](config[_0xffa9('0xa')],{'host':_0xffa9('0xb'),'port':0x18eb});var socket=require(_0xffa9('0xc'))(new Redis(config['redis']));require(_0xffa9('0xd'))[_0xffa9('0xe')](socket);function respondWithRpcPromise(_0x387e98,_0x3a7a1a,_0x2f49f3){return new BPromise(function(_0x3bf42c,_0x1fe587){return client[_0xffa9('0xf')](_0x387e98,_0x2f49f3)[_0xffa9('0x10')](function(_0x3fb095){logger[_0xffa9('0x11')]('UserProfile,\x20%s,\x20%s',_0x3a7a1a,_0xffa9('0x12'));logger[_0xffa9('0x13')](_0xffa9('0x14'),_0x3a7a1a,_0xffa9('0x12'),JSON[_0xffa9('0x15')](_0x3fb095));if(_0x3fb095[_0xffa9('0x16')]){if(_0x3fb095[_0xffa9('0x16')][_0xffa9('0x17')]===0x1f4){logger[_0xffa9('0x16')](_0xffa9('0x18'),_0x3a7a1a,_0x3fb095['error'][_0xffa9('0x19')]);return _0x1fe587(_0x3fb095['error'][_0xffa9('0x19')]);}logger[_0xffa9('0x16')]('UserProfile,\x20%s,\x20%s',_0x3a7a1a,_0x3fb095[_0xffa9('0x16')][_0xffa9('0x19')]);return _0x3bf42c(_0x3fb095[_0xffa9('0x16')]['message']);}else{logger[_0xffa9('0x11')](_0xffa9('0x18'),_0x3a7a1a,_0xffa9('0x12'));_0x3bf42c(_0x3fb095[_0xffa9('0x1a')]['message']);}})[_0xffa9('0x1b')](function(_0x5919ac){logger[_0xffa9('0x16')](_0xffa9('0x18'),_0x3a7a1a,_0x5919ac);_0x1fe587(_0x5919ac);});});} \ No newline at end of file +var _0x18b2=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28974b,_0x56c08a){var _0x273ab0=function(_0x585ecf){while(--_0x585ecf){_0x28974b['push'](_0x28974b['shift']());}};_0x273ab0(++_0x56c08a);}(_0x18b2,0x85));var _0x218b=function(_0x3d8009,_0x4bb5cf){_0x3d8009=_0x3d8009-0x0;var _0x3c8b06=_0x18b2[_0x3d8009];return _0x3c8b06;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var moment=require(_0x218b('0x1'));var BPromise=require(_0x218b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218b('0x3'));var db=require(_0x218b('0x4'))['db'];var utils=require(_0x218b('0x5'));var logger=require(_0x218b('0x6'))(_0x218b('0x7'));var config=require(_0x218b('0x8'));var jayson=require(_0x218b('0x9'));var client=jayson[_0x218b('0xa')][_0x218b('0xb')]({'port':0x232a});config[_0x218b('0xc')]=_[_0x218b('0xd')](config[_0x218b('0xc')],{'host':_0x218b('0xe'),'port':0x18eb});var socket=require(_0x218b('0xf'))(new Redis(config[_0x218b('0xc')]));require('./userProfile.socket')[_0x218b('0x10')](socket);function respondWithRpcPromise(_0xc5f1d7,_0x413da9,_0x161acf){return new BPromise(function(_0x421a0f,_0x4ee68f){return client[_0x218b('0x11')](_0xc5f1d7,_0x161acf)['then'](function(_0xfc01c1){logger[_0x218b('0x12')](_0x218b('0x13'),_0x413da9,'request\x20sent');logger[_0x218b('0x14')](_0x218b('0x15'),_0x413da9,'request\x20sent',JSON[_0x218b('0x16')](_0xfc01c1));if(_0xfc01c1[_0x218b('0x17')]){if(_0xfc01c1['error'][_0x218b('0x18')]===0x1f4){logger[_0x218b('0x17')](_0x218b('0x13'),_0x413da9,_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);return _0x4ee68f(_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);}logger[_0x218b('0x17')](_0x218b('0x13'),_0x413da9,_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);return _0x421a0f(_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);}else{logger[_0x218b('0x12')](_0x218b('0x13'),_0x413da9,_0x218b('0x1a'));_0x421a0f(_0xfc01c1['result'][_0x218b('0x19')]);}})[_0x218b('0x1b')](function(_0x139ade){logger['error']('UserProfile,\x20%s,\x20%s',_0x413da9,_0x139ade);_0x4ee68f(_0x139ade);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 2085398..59de154 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 _0x29d3=['update','emit','removeListener','register','userProfile:','./userProfile.events','save','remove'];(function(_0x4673de,_0xeeef2d){var _0x5e500e=function(_0x3e4e02){while(--_0x3e4e02){_0x4673de['push'](_0x4673de['shift']());}};_0x5e500e(++_0xeeef2d);}(_0x29d3,0xed));var _0x329d=function(_0x46c97d,_0x1d2099){_0x46c97d=_0x46c97d-0x0;var _0x42cf4f=_0x29d3[_0x46c97d];return _0x42cf4f;};'use strict';var UserProfileEvents=require(_0x329d('0x0'));var events=[_0x329d('0x1'),_0x329d('0x2'),_0x329d('0x3')];function createListener(_0x64e358,_0x3522db){return function(_0x1aa690){_0x3522db[_0x329d('0x4')](_0x64e358,_0x1aa690);};}function removeListener(_0x40ad1f,_0x29bd5f){return function(){UserProfileEvents[_0x329d('0x5')](_0x40ad1f,_0x29bd5f);};}exports[_0x329d('0x6')]=function(_0xfa5b87){for(var _0x482fbb=0x0,_0x7ddada=events['length'];_0x482fbb<_0x7ddada;_0x482fbb++){var _0x540b79=events[_0x482fbb];var _0x2d4cd2=createListener(_0x329d('0x7')+_0x540b79,_0xfa5b87);UserProfileEvents['on'](_0x540b79,_0x2d4cd2);}}; \ No newline at end of file +var _0xccaa=['length','userProfile:','./userProfile.events','update','emit','removeListener','register'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xccaa,0x12f));var _0xacca=function(_0x3d5aef,_0x64e2d5){_0x3d5aef=_0x3d5aef-0x0;var _0x33e385=_0xccaa[_0x3d5aef];return _0x33e385;};'use strict';var UserProfileEvents=require(_0xacca('0x0'));var events=['save','remove',_0xacca('0x1')];function createListener(_0x490e82,_0x5c3f1a){return function(_0x1c2e39){_0x5c3f1a[_0xacca('0x2')](_0x490e82,_0x1c2e39);};}function removeListener(_0xaf43b4,_0x25378d){return function(){UserProfileEvents[_0xacca('0x3')](_0xaf43b4,_0x25378d);};}exports[_0xacca('0x4')]=function(_0xa1400f){for(var _0x275c0d=0x0,_0x32ea53=events[_0xacca('0x5')];_0x275c0d<_0x32ea53;_0x275c0d++){var _0x55d1db=events[_0x275c0d];var _0x1d0328=createListener(_0xacca('0x6')+_0x55d1db,_0xa1400f);UserProfileEvents['on'](_0x55d1db,_0x1d0328);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 64d210a..5314d50 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 _0x76d0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','destroy','exports','util','path'];(function(_0x2cfa09,_0x122348){var _0x4884fe=function(_0xaf9ba){while(--_0xaf9ba){_0x2cfa09['push'](_0x2cfa09['shift']());}};_0x4884fe(++_0x122348);}(_0x76d0,0xe2));var _0x076d=function(_0x29e1e6,_0x108249){_0x29e1e6=_0x29e1e6-0x0;var _0x356d8a=_0x76d0[_0x29e1e6];return _0x356d8a;};'use strict';var multer=require('multer');var util=require(_0x076d('0x0'));var path=require(_0x076d('0x1'));var timeout=require(_0x076d('0x2'));var express=require(_0x076d('0x3'));var router=express[_0x076d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x076d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x076d('0x6'));var controller=require(_0x076d('0x7'));router[_0x076d('0x8')]('/',auth['isAuthenticated'](),controller[_0x076d('0x9')]);router['get'](_0x076d('0xa'),auth[_0x076d('0xb')](),controller[_0x076d('0xc')]);router[_0x076d('0x8')](_0x076d('0xd'),auth['isAuthenticated'](),controller[_0x076d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x076d('0xf')](_0x076d('0xd'),auth['isAuthenticated'](),controller[_0x076d('0x10')]);router['delete'](_0x076d('0xd'),auth['isAuthenticated'](),controller[_0x076d('0x11')]);module[_0x076d('0x12')]=router; \ No newline at end of file +var _0xea1c=['describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xea1c,0xb1));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcea1('0x0'));var util=require(_0xcea1('0x1'));var path=require(_0xcea1('0x2'));var timeout=require(_0xcea1('0x3'));var express=require('express');var router=express[_0xcea1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcea1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcea1('0x6'));var controller=require(_0xcea1('0x7'));router[_0xcea1('0x8')]('/',auth[_0xcea1('0x9')](),controller[_0xcea1('0xa')]);router[_0xcea1('0x8')](_0xcea1('0xb'),auth['isAuthenticated'](),controller[_0xcea1('0xc')]);router[_0xcea1('0x8')](_0xcea1('0xd'),auth['isAuthenticated'](),controller[_0xcea1('0xe')]);router[_0xcea1('0xf')]('/',auth['isAuthenticated'](),controller[_0xcea1('0x10')]);router[_0xcea1('0x11')](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0x12')]);router['delete'](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0x13')]);module[_0xcea1('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 d495f04..6882f0b 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 _0x3541=['INTEGER','STRING'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x3541,0x135));var _0x1354=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x3541[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1354('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1354('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1429=['STRING','INTEGER','sequelize','exports'];(function(_0x4b1f35,_0x14ac3a){var _0x1d5df5=function(_0x5de6d8){while(--_0x5de6d8){_0x4b1f35['push'](_0x4b1f35['shift']());}};_0x1d5df5(++_0x14ac3a);}(_0x1429,0x176));var _0x9142=function(_0x5a4c2a,_0x30ac20){_0x5a4c2a=_0x5a4c2a-0x0;var _0x4d08dd=_0x1429[_0x5a4c2a];return _0x4d08dd;};'use strict';var Sequelize=require(_0x9142('0x0'));module[_0x9142('0x1')]={'name':{'type':Sequelize[_0x9142('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9142('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 f15726a..42b6f34 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 _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0x6343,0x168));var _0x3634=function(_0x719f00,_0x20f521){_0x719f00=_0x719f00-0x0;var _0x51bee6=_0x6343[_0x719f00];return _0x51bee6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0x66fa=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','UserProfileResource','findAll','rows','catch','merge','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x66fa,0x117));var _0xa66f=function(_0x24c793,_0x3601c0){_0x24c793=_0x24c793-0x0;var _0x2193e7=_0x66fa[_0x24c793];return _0x2193e7;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['UserProfileResource'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['UserProfileResource'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['UserProfileResource'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['UserProfileResource'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));};exports[_0xa66f('0x4a')]=function(_0x5d77d1,_0x389b9a){return db['UserProfileResource'][_0xa66f('0x4a')]()['then'](respondWithResult(_0x389b9a,null))['catch'](handleError(_0x389b9a,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0f90af8..5aadc37 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 _0x85d1=['./userProfileResource.attributes','exports','define','compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1a91e6,_0x3988e7){var _0x4efd66=function(_0x405aeb){while(--_0x405aeb){_0x1a91e6['push'](_0x1a91e6['shift']());}};_0x4efd66(++_0x3988e7);}(_0x85d1,0x1d9));var _0x185d=function(_0x2f1a6e,_0x3082cb){_0x2f1a6e=_0x2f1a6e-0x0;var _0x5865e5=_0x85d1[_0x2f1a6e];return _0x5865e5;};'use strict';var _=require(_0x185d('0x0'));var util=require(_0x185d('0x1'));var logger=require(_0x185d('0x2'))(_0x185d('0x3'));var moment=require(_0x185d('0x4'));var BPromise=require(_0x185d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x185d('0x6'));var config=require(_0x185d('0x7'));var attributes=require(_0x185d('0x8'));module[_0x185d('0x9')]=function(_0x1c69c6,_0x494720){return _0x1c69c6[_0x185d('0xa')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x185d('0xb'),'fields':[_0x185d('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa62d=['resourceId','sectionId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xa62d,0xf0));var _0xda62=function(_0x189766,_0x550d2f){_0x189766=_0x189766-0x0;var _0x46cced=_0xa62d[_0x189766];return _0x46cced;};'use strict';var _=require(_0xda62('0x0'));var util=require(_0xda62('0x1'));var logger=require('../../config/logger')(_0xda62('0x2'));var moment=require(_0xda62('0x3'));var BPromise=require(_0xda62('0x4'));var rp=require(_0xda62('0x5'));var fs=require('fs');var path=require(_0xda62('0x6'));var rimraf=require(_0xda62('0x7'));var config=require(_0xda62('0x8'));var attributes=require(_0xda62('0x9'));module[_0xda62('0xa')]=function(_0x2cd42e,_0x2c6954){return _0x2cd42e[_0xda62('0xb')](_0xda62('0xc'),attributes,{'tableName':_0xda62('0xd'),'paranoid':![],'indexes':[{'name':_0xda62('0xe'),'fields':[_0xda62('0xf'),_0xda62('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ff6cf6d..e284d9b 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 _0xa9fd=['jayson/promise','client','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9fd,0x1ef));var _0xda9f=function(_0x1ea318,_0x3ac0a9){_0x1ea318=_0x1ea318-0x0;var _0x38e105=_0xa9fd[_0x1ea318];return _0x38e105;};'use strict';var _=require(_0xda9f('0x0'));var util=require(_0xda9f('0x1'));var moment=require(_0xda9f('0x2'));var BPromise=require(_0xda9f('0x3'));var rs=require(_0xda9f('0x4'));var fs=require('fs');var Redis=require(_0xda9f('0x5'));var db=require(_0xda9f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda9f('0x7'))(_0xda9f('0x8'));var config=require('../../config/environment');var jayson=require(_0xda9f('0x9'));var client=jayson[_0xda9f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x334230,_0x57dc36,_0x22f805){return new BPromise(function(_0x5a1e68,_0x1632b0){return client[_0xda9f('0xb')](_0x334230,_0x22f805)[_0xda9f('0xc')](function(_0x134e03){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x57dc36,_0xda9f('0xd'));logger[_0xda9f('0xe')](_0xda9f('0xf'),_0x57dc36,_0xda9f('0xd'),JSON[_0xda9f('0x10')](_0x134e03));if(_0x134e03[_0xda9f('0x11')]){if(_0x134e03['error'][_0xda9f('0x12')]===0x1f4){logger[_0xda9f('0x11')](_0xda9f('0x13'),_0x57dc36,_0x134e03['error'][_0xda9f('0x14')]);return _0x1632b0(_0x134e03[_0xda9f('0x11')]['message']);}logger['error'](_0xda9f('0x13'),_0x57dc36,_0x134e03[_0xda9f('0x11')][_0xda9f('0x14')]);return _0x5a1e68(_0x134e03[_0xda9f('0x11')][_0xda9f('0x14')]);}else{logger[_0xda9f('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x57dc36,_0xda9f('0xd'));_0x5a1e68(_0x134e03[_0xda9f('0x16')]['message']);}})[_0xda9f('0x17')](function(_0x29e437){logger[_0xda9f('0x11')](_0xda9f('0x13'),_0x57dc36,_0x29e437);_0x1632b0(_0x29e437);});});} \ No newline at end of file +var _0xeb7b=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x4358d4,_0x241b8c){var _0xdb0f09=function(_0x26c319){while(--_0x26c319){_0x4358d4['push'](_0x4358d4['shift']());}};_0xdb0f09(++_0x241b8c);}(_0xeb7b,0x1a3));var _0xbeb7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeb7b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbeb7('0x0'));var util=require(_0xbeb7('0x1'));var moment=require('moment');var BPromise=require(_0xbeb7('0x2'));var rs=require(_0xbeb7('0x3'));var fs=require('fs');var Redis=require(_0xbeb7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbeb7('0x5'));var logger=require(_0xbeb7('0x6'))(_0xbeb7('0x7'));var config=require(_0xbeb7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbeb7('0x9')][_0xbeb7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441354,_0x57d2ef,_0x194265){return new BPromise(function(_0x536de7,_0x566d02){return client[_0xbeb7('0xb')](_0x441354,_0x194265)[_0xbeb7('0xc')](function(_0x5da0ca){logger[_0xbeb7('0xd')](_0xbeb7('0xe'),_0x57d2ef,_0xbeb7('0xf'));logger[_0xbeb7('0x10')](_0xbeb7('0x11'),_0x57d2ef,_0xbeb7('0xf'),JSON[_0xbeb7('0x12')](_0x5da0ca));if(_0x5da0ca[_0xbeb7('0x13')]){if(_0x5da0ca[_0xbeb7('0x13')][_0xbeb7('0x14')]===0x1f4){logger[_0xbeb7('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x57d2ef,_0x5da0ca[_0xbeb7('0x13')][_0xbeb7('0x15')]);return _0x566d02(_0x5da0ca[_0xbeb7('0x13')][_0xbeb7('0x15')]);}logger['error'](_0xbeb7('0xe'),_0x57d2ef,_0x5da0ca[_0xbeb7('0x13')][_0xbeb7('0x15')]);return _0x536de7(_0x5da0ca[_0xbeb7('0x13')][_0xbeb7('0x15')]);}else{logger[_0xbeb7('0xd')](_0xbeb7('0xe'),_0x57d2ef,_0xbeb7('0xf'));_0x536de7(_0x5da0ca[_0xbeb7('0x16')][_0xbeb7('0x15')]);}})[_0xbeb7('0x17')](function(_0x34e232){logger[_0xbeb7('0x13')](_0xbeb7('0xe'),_0x57d2ef,_0x34e232);_0x566d02(_0x34e232);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index b06c5da..d658efa 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 _0xf311=['index','/describe','/:id','show','post','create','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x14c3f2,_0x3d7975){var _0x3e54c1=function(_0x23f328){while(--_0x23f328){_0x14c3f2['push'](_0x14c3f2['shift']());}};_0x3e54c1(++_0x3d7975);}(_0xf311,0x76));var _0x1f31=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf311[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0x1f31('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1f31('0x1'));var router=express[_0x1f31('0x2')]();var fs_extra=require(_0x1f31('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1f31('0x4'));var config=require(_0x1f31('0x5'));var controller=require('./userProfileSection.controller');router[_0x1f31('0x6')]('/',auth[_0x1f31('0x7')](),controller[_0x1f31('0x8')]);router['get'](_0x1f31('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1f31('0x6')](_0x1f31('0xa'),auth[_0x1f31('0x7')](),controller[_0x1f31('0xb')]);router[_0x1f31('0xc')]('/',auth[_0x1f31('0x7')](),controller[_0x1f31('0xd')]);router['put'](_0x1f31('0xa'),auth[_0x1f31('0x7')](),controller[_0x1f31('0xe')]);router[_0x1f31('0xf')](_0x1f31('0xa'),auth[_0x1f31('0x7')](),controller[_0x1f31('0x10')]);module[_0x1f31('0x11')]=router; \ No newline at end of file +var _0xc799=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc799,0xd5));var _0x9c79=function(_0x106839,_0x137b39){_0x106839=_0x106839-0x0;var _0x3bd1c4=_0xc799[_0x106839];return _0x3bd1c4;};'use strict';var multer=require(_0x9c79('0x0'));var util=require(_0x9c79('0x1'));var path=require(_0x9c79('0x2'));var timeout=require(_0x9c79('0x3'));var express=require(_0x9c79('0x4'));var router=express['Router']();var fs_extra=require(_0x9c79('0x5'));var auth=require(_0x9c79('0x6'));var interaction=require(_0x9c79('0x7'));var config=require(_0x9c79('0x8'));var controller=require('./userProfileSection.controller');router[_0x9c79('0x9')]('/',auth[_0x9c79('0xa')](),controller[_0x9c79('0xb')]);router['get'](_0x9c79('0xc'),auth[_0x9c79('0xa')](),controller[_0x9c79('0xd')]);router['get'](_0x9c79('0xe'),auth[_0x9c79('0xa')](),controller['show']);router[_0x9c79('0xf')]('/',auth[_0x9c79('0xa')](),controller[_0x9c79('0x10')]);router[_0x9c79('0x11')](_0x9c79('0xe'),auth[_0x9c79('0xa')](),controller[_0x9c79('0x12')]);router['delete']('/:id',auth[_0x9c79('0xa')](),controller[_0x9c79('0x13')]);module[_0x9c79('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 048005e..c193ed8 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 _0xe1e3=['getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x46003f,_0x18a160){var _0x373521=function(_0x357002){while(--_0x357002){_0x46003f['push'](_0x46003f['shift']());}};_0x373521(++_0x18a160);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x3b70a6,_0x37e92b){_0x3b70a6=_0x3b70a6-0x0;var _0x4571cd=_0xe1e3[_0x3b70a6];return _0x4571cd;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x3e1e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3bacc){this[_0x3e1e('0x4')](_0x3e1e('0x5'),_0x3bacc?_0x3bacc[_0x3e1e('0x6')](''):[]);},'get':function(){return this[_0x3e1e('0x7')](_0x3e1e('0x5'))?this['getDataValue'](_0x3e1e('0x5'))[_0x3e1e('0x8')](''):[];}}}; \ No newline at end of file +var _0x9ffd=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x503d93,_0x4bfc88){var _0x5c1387=function(_0x2cc00a){while(--_0x2cc00a){_0x503d93['push'](_0x503d93['shift']());}};_0x5c1387(++_0x4bfc88);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x200dcf,_0x3926c6){_0x200dcf=_0x200dcf-0x0;var _0x4bfb4b=_0x9ffd[_0x200dcf];return _0x4bfb4b;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd9ff('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd9ff('0x2')],'set':function(_0x53e962){this[_0xd9ff('0x5')](_0xd9ff('0x6'),_0x53e962?_0x53e962['join'](''):[]);},'get':function(){return this[_0xd9ff('0x7')](_0xd9ff('0x6'))?this[_0xd9ff('0x7')](_0xd9ff('0x6'))[_0xd9ff('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 9e3e049..2cfaa8f 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 _0x8465=['then','end','error','stack','name','send','index','UserProfileSection','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','params','rawAttributes','include','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update'];(function(_0x3bc927,_0x90b7ea){var _0x4edd68=function(_0x4c90dd){while(--_0x4c90dd){_0x3bc927['push'](_0x3bc927['shift']());}};_0x4edd68(++_0x90b7ea);}(_0x8465,0x70));var _0x5846=function(_0x2d595f,_0xdfdb46){_0x2d595f=_0x2d595f-0x0;var _0x1e26a2=_0x8465[_0x2d595f];return _0x1e26a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5846('0x0'));var jsonpatch=require(_0x5846('0x1'));var rp=require(_0x5846('0x2'));var moment=require(_0x5846('0x3'));var BPromise=require(_0x5846('0x4'));var Mustache=require(_0x5846('0x5'));var util=require(_0x5846('0x6'));var path=require(_0x5846('0x7'));var sox=require(_0x5846('0x8'));var csv=require('to-csv');var ejs=require(_0x5846('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5846('0xa'));var squel=require(_0x5846('0xb'));var crypto=require(_0x5846('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5846('0xd'));var toCsv=require(_0x5846('0xe'));var querystring=require(_0x5846('0xf'));var Papa=require('papaparse');var Redis=require(_0x5846('0x10'));var authService=require(_0x5846('0x11'));var qs=require(_0x5846('0x12'));var as=require(_0x5846('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5846('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5846('0x15'));var licenseUtil=require(_0x5846('0x16'));var db=require(_0x5846('0x17'))['db'];function respondWithStatusCode(_0x508df4,_0x2c776f){_0x2c776f=_0x2c776f||0xcc;return function(_0x379b12){if(_0x379b12){return _0x508df4[_0x5846('0x18')](_0x2c776f);}return _0x508df4[_0x5846('0x19')](_0x2c776f)['end']();};}function respondWithResult(_0x14faff,_0x18d535){_0x18d535=_0x18d535||0xc8;return function(_0x477749){if(_0x477749){return _0x14faff[_0x5846('0x19')](_0x18d535)[_0x5846('0x1a')](_0x477749);}};}function respondWithFilteredResult(_0x3150b6,_0x2a9ff3){return function(_0x4953db){if(_0x4953db){var _0x8884e8=typeof _0x2a9ff3[_0x5846('0x1b')]===_0x5846('0x1c')&&typeof _0x2a9ff3[_0x5846('0x1d')]===_0x5846('0x1c');var _0x9832e0=_0x4953db[_0x5846('0x1e')];var _0x131655=_0x8884e8?0x0:_0x2a9ff3[_0x5846('0x1b')];var _0x4c0b55=_0x8884e8?_0x4953db[_0x5846('0x1e')]:_0x2a9ff3[_0x5846('0x1b')]+_0x2a9ff3['limit'];var _0x2a88c6;if(_0x4c0b55>=_0x9832e0){_0x4c0b55=_0x9832e0;_0x2a88c6=0xc8;}else{_0x2a88c6=0xce;}_0x3150b6[_0x5846('0x19')](_0x2a88c6);return _0x3150b6['set']('Content-Range',_0x131655+'-'+_0x4c0b55+'/'+_0x9832e0)[_0x5846('0x1a')](_0x4953db);}return null;};}function patchUpdates(_0x3cd4d3){return function(_0x5c4e3b){try{jsonpatch['apply'](_0x5c4e3b,_0x3cd4d3,!![]);}catch(_0x55c43f){return BPromise[_0x5846('0x1f')](_0x55c43f);}return _0x5c4e3b[_0x5846('0x20')]();};}function saveUpdates(_0x50504f,_0x16f249){return function(_0x153e60){if(_0x153e60){return _0x153e60[_0x5846('0x21')](_0x50504f)[_0x5846('0x22')](function(_0x4e0de1){return _0x4e0de1;});}return null;};}function removeEntity(_0x3be35d,_0x1ab1e8){return function(_0x2815b6){if(_0x2815b6){return _0x2815b6['destroy']()[_0x5846('0x22')](function(){_0x3be35d[_0x5846('0x19')](0xcc)[_0x5846('0x23')]();});}};}function handleEntityNotFound(_0x5c83c9,_0x33336b){return function(_0x5aaf27){if(!_0x5aaf27){_0x5c83c9[_0x5846('0x18')](0x194);}return _0x5aaf27;};}function handleError(_0x3df8f2,_0xf67f77){_0xf67f77=_0xf67f77||0x1f4;return function(_0x4625f3){logger[_0x5846('0x24')](_0x4625f3[_0x5846('0x25')]);if(_0x4625f3[_0x5846('0x26')]){delete _0x4625f3[_0x5846('0x26')];}_0x3df8f2[_0x5846('0x19')](_0xf67f77)[_0x5846('0x27')](_0x4625f3);};}exports[_0x5846('0x28')]=function(_0x4a8135,_0x264740){var _0x11010f={},_0x3fe40d={},_0x1993e3={'count':0x0,'rows':[]};var _0x40d4e1=_['map'](db[_0x5846('0x29')]['rawAttributes'],function(_0x20d5f6){return{'name':_0x20d5f6[_0x5846('0x2a')],'type':_0x20d5f6[_0x5846('0x2b')][_0x5846('0x2c')]};});_0x3fe40d[_0x5846('0x2d')]=_[_0x5846('0x2e')](_0x40d4e1,'name');_0x3fe40d[_0x5846('0x2f')]=_[_0x5846('0x30')](_0x4a8135[_0x5846('0x2f')]);_0x3fe40d['filters']=_[_0x5846('0x31')](_0x3fe40d['model'],_0x3fe40d[_0x5846('0x2f')]);_0x11010f[_0x5846('0x32')]=_[_0x5846('0x31')](_0x3fe40d[_0x5846('0x2d')],qs[_0x5846('0x33')](_0x4a8135[_0x5846('0x2f')]['fields']));_0x11010f[_0x5846('0x32')]=_0x11010f[_0x5846('0x32')][_0x5846('0x34')]?_0x11010f[_0x5846('0x32')]:_0x3fe40d[_0x5846('0x2d')];if(!_0x4a8135[_0x5846('0x2f')][_0x5846('0x35')]('nolimit')){_0x11010f[_0x5846('0x1d')]=qs[_0x5846('0x1d')](_0x4a8135[_0x5846('0x2f')][_0x5846('0x1d')]);_0x11010f['offset']=qs['offset'](_0x4a8135[_0x5846('0x2f')][_0x5846('0x1b')]);}_0x11010f[_0x5846('0x36')]=qs[_0x5846('0x37')](_0x4a8135[_0x5846('0x2f')][_0x5846('0x37')]);_0x11010f['where']=qs['filters'](_[_0x5846('0x38')](_0x4a8135[_0x5846('0x2f')],_0x3fe40d[_0x5846('0x39')]),_0x40d4e1);if(_0x4a8135['query']['filter']){_0x11010f[_0x5846('0x3a')]=_[_0x5846('0x3b')](_0x11010f[_0x5846('0x3a')],{'$or':_[_0x5846('0x2e')](_0x40d4e1,function(_0x13ff73){if(_0x13ff73[_0x5846('0x2b')]!==_0x5846('0x3c')){var _0x2034e2={};_0x2034e2[_0x13ff73[_0x5846('0x26')]]={'$like':'%'+_0x4a8135[_0x5846('0x2f')][_0x5846('0x3d')]+'%'};return _0x2034e2;}})});}_0x11010f=_[_0x5846('0x3b')]({},_0x11010f,_0x4a8135[_0x5846('0x3e')]);var _0x2709b2={'where':_0x11010f[_0x5846('0x3a')]};return db[_0x5846('0x29')][_0x5846('0x1e')](_0x2709b2)['then'](function(_0x1a303a){_0x1993e3[_0x5846('0x1e')]=_0x1a303a;if(_0x4a8135[_0x5846('0x2f')][_0x5846('0x3f')]){_0x11010f['include']=[{'all':!![]}];}return db[_0x5846('0x29')]['findAll'](_0x11010f);})['then'](function(_0x3279f9){_0x1993e3[_0x5846('0x40')]=_0x3279f9;return _0x1993e3;})[_0x5846('0x22')](respondWithFilteredResult(_0x264740,_0x11010f))[_0x5846('0x41')](handleError(_0x264740,null));};exports['show']=function(_0x4fcf74,_0x13e2c3){var _0x41d94f={'raw':![],'where':{'id':_0x4fcf74[_0x5846('0x42')]['id']}},_0x1e5996={};_0x1e5996[_0x5846('0x2d')]=_[_0x5846('0x30')](db[_0x5846('0x29')][_0x5846('0x43')]);_0x1e5996[_0x5846('0x2f')]=_[_0x5846('0x30')](_0x4fcf74[_0x5846('0x2f')]);_0x1e5996['filters']=_[_0x5846('0x31')](_0x1e5996[_0x5846('0x2d')],_0x1e5996[_0x5846('0x2f')]);_0x41d94f[_0x5846('0x32')]=_[_0x5846('0x31')](_0x1e5996[_0x5846('0x2d')],qs[_0x5846('0x33')](_0x4fcf74[_0x5846('0x2f')][_0x5846('0x33')]));_0x41d94f[_0x5846('0x32')]=_0x41d94f['attributes'][_0x5846('0x34')]?_0x41d94f[_0x5846('0x32')]:_0x1e5996[_0x5846('0x2d')];if(_0x4fcf74[_0x5846('0x2f')][_0x5846('0x3f')]){_0x41d94f[_0x5846('0x44')]=[{'all':!![]}];}_0x41d94f=_[_0x5846('0x3b')]({},_0x41d94f,_0x4fcf74['options']);return db['UserProfileSection']['find'](_0x41d94f)[_0x5846('0x22')](handleEntityNotFound(_0x13e2c3,null))[_0x5846('0x22')](respondWithResult(_0x13e2c3,null))[_0x5846('0x41')](handleError(_0x13e2c3,null));};exports[_0x5846('0x45')]=function(_0x3a0ee5,_0x3af7da){return db[_0x5846('0x29')]['create'](_0x3a0ee5[_0x5846('0x46')],{})['then'](respondWithResult(_0x3af7da,0xc9))[_0x5846('0x41')](handleError(_0x3af7da,null));};exports['update']=function(_0x525f53,_0x57d7ae){if(_0x525f53[_0x5846('0x46')]['id']){delete _0x525f53[_0x5846('0x46')]['id'];}return db[_0x5846('0x29')][_0x5846('0x47')]({'where':{'id':_0x525f53[_0x5846('0x42')]['id']}})[_0x5846('0x22')](handleEntityNotFound(_0x57d7ae,null))[_0x5846('0x22')](saveUpdates(_0x525f53[_0x5846('0x46')],null))['then'](respondWithResult(_0x57d7ae,null))[_0x5846('0x41')](handleError(_0x57d7ae,null));};exports['destroy']=function(_0x5ccb11,_0x22a11f){return db['UserProfileSection'][_0x5846('0x47')]({'where':{'id':_0x5ccb11['params']['id']}})[_0x5846('0x22')](handleEntityNotFound(_0x22a11f,null))[_0x5846('0x22')](removeEntity(_0x22a11f,null))['catch'](handleError(_0x22a11f,null));};exports['describe']=function(_0x26e578,_0x43162f){return db['UserProfileSection'][_0x5846('0x48')]()[_0x5846('0x22')](respondWithResult(_0x43162f,null))[_0x5846('0x41')](handleError(_0x43162f,null));}; \ No newline at end of file +var _0x1a8c=['type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x1a8c,0xbf));var _0xc1a8=function(_0xf67573,_0x1dc19c){_0xf67573=_0xf67573-0x0;var _0x1bdb01=_0x1a8c[_0xf67573];return _0x1bdb01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1a8('0x0'));var zipdir=require(_0xc1a8('0x1'));var jsonpatch=require(_0xc1a8('0x2'));var rp=require(_0xc1a8('0x3'));var moment=require(_0xc1a8('0x4'));var BPromise=require(_0xc1a8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc1a8('0x6'));var sox=require(_0xc1a8('0x7'));var csv=require(_0xc1a8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1a8('0x9'));var _=require(_0xc1a8('0xa'));var squel=require(_0xc1a8('0xb'));var crypto=require(_0xc1a8('0xc'));var jsforce=require(_0xc1a8('0xd'));var deskjs=require(_0xc1a8('0xe'));var toCsv=require(_0xc1a8('0x8'));var querystring=require('querystring');var Papa=require(_0xc1a8('0xf'));var Redis=require(_0xc1a8('0x10'));var authService=require(_0xc1a8('0x11'));var qs=require(_0xc1a8('0x12'));var as=require(_0xc1a8('0x13'));var hardwareService=require(_0xc1a8('0x14'));var logger=require(_0xc1a8('0x15'))(_0xc1a8('0x16'));var utils=require('../../config/utils');var config=require(_0xc1a8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1a8('0x18'))['db'];function respondWithStatusCode(_0x5b9df6,_0x4ef11e){_0x4ef11e=_0x4ef11e||0xcc;return function(_0x5c8a7c){if(_0x5c8a7c){return _0x5b9df6['sendStatus'](_0x4ef11e);}return _0x5b9df6['status'](_0x4ef11e)[_0xc1a8('0x19')]();};}function respondWithResult(_0x4ac37f,_0x14482a){_0x14482a=_0x14482a||0xc8;return function(_0x297d47){if(_0x297d47){return _0x4ac37f[_0xc1a8('0x1a')](_0x14482a)[_0xc1a8('0x1b')](_0x297d47);}};}function respondWithFilteredResult(_0x4f6666,_0x5a8f29){return function(_0x3f2a28){if(_0x3f2a28){var _0x4e2501=typeof _0x5a8f29[_0xc1a8('0x1c')]===_0xc1a8('0x1d')&&typeof _0x5a8f29[_0xc1a8('0x1e')]===_0xc1a8('0x1d');var _0x2597e2=_0x3f2a28[_0xc1a8('0x1f')];var _0x52ad01=_0x4e2501?0x0:_0x5a8f29[_0xc1a8('0x1c')];var _0x2efb00=_0x4e2501?_0x3f2a28[_0xc1a8('0x1f')]:_0x5a8f29['offset']+_0x5a8f29['limit'];var _0x3ac19d;if(_0x2efb00>=_0x2597e2){_0x2efb00=_0x2597e2;_0x3ac19d=0xc8;}else{_0x3ac19d=0xce;}_0x4f6666[_0xc1a8('0x1a')](_0x3ac19d);return _0x4f6666[_0xc1a8('0x20')](_0xc1a8('0x21'),_0x52ad01+'-'+_0x2efb00+'/'+_0x2597e2)[_0xc1a8('0x1b')](_0x3f2a28);}return null;};}function patchUpdates(_0x598ba6){return function(_0x4398cd){try{jsonpatch[_0xc1a8('0x22')](_0x4398cd,_0x598ba6,!![]);}catch(_0x259206){return BPromise[_0xc1a8('0x23')](_0x259206);}return _0x4398cd[_0xc1a8('0x24')]();};}function saveUpdates(_0x4e8784,_0xa95ff){return function(_0x1c5966){if(_0x1c5966){return _0x1c5966[_0xc1a8('0x25')](_0x4e8784)[_0xc1a8('0x26')](function(_0x22c466){return _0x22c466;});}return null;};}function removeEntity(_0x257902,_0x474b1f){return function(_0x22bb76){if(_0x22bb76){return _0x22bb76['destroy']()[_0xc1a8('0x26')](function(){_0x257902[_0xc1a8('0x1a')](0xcc)[_0xc1a8('0x19')]();});}};}function handleEntityNotFound(_0x344ca7,_0x17e475){return function(_0x3770f3){if(!_0x3770f3){_0x344ca7[_0xc1a8('0x27')](0x194);}return _0x3770f3;};}function handleError(_0x59fcfe,_0x38e443){_0x38e443=_0x38e443||0x1f4;return function(_0x4a1a36){logger[_0xc1a8('0x28')](_0x4a1a36[_0xc1a8('0x29')]);if(_0x4a1a36[_0xc1a8('0x2a')]){delete _0x4a1a36[_0xc1a8('0x2a')];}_0x59fcfe[_0xc1a8('0x1a')](_0x38e443)[_0xc1a8('0x2b')](_0x4a1a36);};}exports[_0xc1a8('0x2c')]=function(_0x4e4cc2,_0x4e03d9){var _0x4d0c40={},_0x56b709={},_0x208103={'count':0x0,'rows':[]};var _0x1c95c6=_[_0xc1a8('0x2d')](db[_0xc1a8('0x2e')][_0xc1a8('0x2f')],function(_0x190905){return{'name':_0x190905[_0xc1a8('0x30')],'type':_0x190905[_0xc1a8('0x31')][_0xc1a8('0x32')]};});_0x56b709[_0xc1a8('0x33')]=_[_0xc1a8('0x2d')](_0x1c95c6,_0xc1a8('0x2a'));_0x56b709['query']=_['keys'](_0x4e4cc2[_0xc1a8('0x34')]);_0x56b709[_0xc1a8('0x35')]=_[_0xc1a8('0x36')](_0x56b709['model'],_0x56b709[_0xc1a8('0x34')]);_0x4d0c40['attributes']=_['intersection'](_0x56b709['model'],qs[_0xc1a8('0x37')](_0x4e4cc2[_0xc1a8('0x34')][_0xc1a8('0x37')]));_0x4d0c40['attributes']=_0x4d0c40[_0xc1a8('0x38')][_0xc1a8('0x39')]?_0x4d0c40[_0xc1a8('0x38')]:_0x56b709['model'];if(!_0x4e4cc2[_0xc1a8('0x34')][_0xc1a8('0x3a')](_0xc1a8('0x3b'))){_0x4d0c40[_0xc1a8('0x1e')]=qs[_0xc1a8('0x1e')](_0x4e4cc2['query']['limit']);_0x4d0c40[_0xc1a8('0x1c')]=qs['offset'](_0x4e4cc2[_0xc1a8('0x34')][_0xc1a8('0x1c')]);}_0x4d0c40[_0xc1a8('0x3c')]=qs[_0xc1a8('0x3d')](_0x4e4cc2['query']['sort']);_0x4d0c40[_0xc1a8('0x3e')]=qs[_0xc1a8('0x35')](_[_0xc1a8('0x3f')](_0x4e4cc2['query'],_0x56b709['filters']),_0x1c95c6);if(_0x4e4cc2[_0xc1a8('0x34')][_0xc1a8('0x40')]){_0x4d0c40[_0xc1a8('0x3e')]=_[_0xc1a8('0x41')](_0x4d0c40[_0xc1a8('0x3e')],{'$or':_[_0xc1a8('0x2d')](_0x1c95c6,function(_0x30bc8b){if(_0x30bc8b['type']!==_0xc1a8('0x42')){var _0x30462b={};_0x30462b[_0x30bc8b[_0xc1a8('0x2a')]]={'$like':'%'+_0x4e4cc2['query'][_0xc1a8('0x40')]+'%'};return _0x30462b;}})});}_0x4d0c40=_['merge']({},_0x4d0c40,_0x4e4cc2[_0xc1a8('0x43')]);var _0x5c5d1c={'where':_0x4d0c40[_0xc1a8('0x3e')]};return db[_0xc1a8('0x2e')]['count'](_0x5c5d1c)['then'](function(_0x367c9a){_0x208103[_0xc1a8('0x1f')]=_0x367c9a;if(_0x4e4cc2['query'][_0xc1a8('0x44')]){_0x4d0c40[_0xc1a8('0x45')]=[{'all':!![]}];}return db['UserProfileSection'][_0xc1a8('0x46')](_0x4d0c40);})[_0xc1a8('0x26')](function(_0x6660fe){_0x208103['rows']=_0x6660fe;return _0x208103;})['then'](respondWithFilteredResult(_0x4e03d9,_0x4d0c40))[_0xc1a8('0x47')](handleError(_0x4e03d9,null));};exports[_0xc1a8('0x48')]=function(_0x43ad95,_0x34860d){var _0x18524d={'raw':![],'where':{'id':_0x43ad95['params']['id']}},_0x43ecf1={};_0x43ecf1[_0xc1a8('0x33')]=_['keys'](db[_0xc1a8('0x2e')]['rawAttributes']);_0x43ecf1[_0xc1a8('0x34')]=_[_0xc1a8('0x49')](_0x43ad95['query']);_0x43ecf1[_0xc1a8('0x35')]=_[_0xc1a8('0x36')](_0x43ecf1[_0xc1a8('0x33')],_0x43ecf1['query']);_0x18524d['attributes']=_['intersection'](_0x43ecf1['model'],qs[_0xc1a8('0x37')](_0x43ad95['query']['fields']));_0x18524d['attributes']=_0x18524d['attributes'][_0xc1a8('0x39')]?_0x18524d[_0xc1a8('0x38')]:_0x43ecf1[_0xc1a8('0x33')];if(_0x43ad95[_0xc1a8('0x34')][_0xc1a8('0x44')]){_0x18524d[_0xc1a8('0x45')]=[{'all':!![]}];}_0x18524d=_[_0xc1a8('0x41')]({},_0x18524d,_0x43ad95[_0xc1a8('0x43')]);return db['UserProfileSection'][_0xc1a8('0x4a')](_0x18524d)['then'](handleEntityNotFound(_0x34860d,null))[_0xc1a8('0x26')](respondWithResult(_0x34860d,null))[_0xc1a8('0x47')](handleError(_0x34860d,null));};exports[_0xc1a8('0x4b')]=function(_0x47e7e5,_0x2d89ab){return db[_0xc1a8('0x2e')][_0xc1a8('0x4b')](_0x47e7e5[_0xc1a8('0x4c')],{})['then'](respondWithResult(_0x2d89ab,0xc9))[_0xc1a8('0x47')](handleError(_0x2d89ab,null));};exports[_0xc1a8('0x25')]=function(_0x3e76c8,_0x30abe0){if(_0x3e76c8[_0xc1a8('0x4c')]['id']){delete _0x3e76c8[_0xc1a8('0x4c')]['id'];}return db[_0xc1a8('0x2e')][_0xc1a8('0x4a')]({'where':{'id':_0x3e76c8[_0xc1a8('0x4d')]['id']}})[_0xc1a8('0x26')](handleEntityNotFound(_0x30abe0,null))[_0xc1a8('0x26')](saveUpdates(_0x3e76c8['body'],null))[_0xc1a8('0x26')](respondWithResult(_0x30abe0,null))[_0xc1a8('0x47')](handleError(_0x30abe0,null));};exports[_0xc1a8('0x4e')]=function(_0x4e36af,_0x317269){return db[_0xc1a8('0x2e')][_0xc1a8('0x4a')]({'where':{'id':_0x4e36af[_0xc1a8('0x4d')]['id']}})[_0xc1a8('0x26')](handleEntityNotFound(_0x317269,null))[_0xc1a8('0x26')](removeEntity(_0x317269,null))['catch'](handleError(_0x317269,null));};exports[_0xc1a8('0x4f')]=function(_0x2228f7,_0x1fe169){return db[_0xc1a8('0x2e')][_0xc1a8('0x4f')]()['then'](respondWithResult(_0x1fe169,null))['catch'](handleError(_0x1fe169,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 06370dd..1f71301 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 _0x8a85=['bluebird','request-promise','path','rimraf','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','util','../../config/logger','api','moment'];(function(_0x5bbf6a,_0x29460a){var _0x5d051a=function(_0x2c76a7){while(--_0x2c76a7){_0x5bbf6a['push'](_0x5bbf6a['shift']());}};_0x5d051a(++_0x29460a);}(_0x8a85,0xe6));var _0x58a8=function(_0x477701,_0xfdfc3c){_0x477701=_0x477701-0x0;var _0x34e278=_0x8a85[_0x477701];return _0x34e278;};'use strict';var _=require('lodash');var util=require(_0x58a8('0x0'));var logger=require(_0x58a8('0x1'))(_0x58a8('0x2'));var moment=require(_0x58a8('0x3'));var BPromise=require(_0x58a8('0x4'));var rp=require(_0x58a8('0x5'));var fs=require('fs');var path=require(_0x58a8('0x6'));var rimraf=require(_0x58a8('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x58a8('0x8')]=function(_0x1274a2,_0x1c399a){return _0x1274a2[_0x58a8('0x9')](_0x58a8('0xa'),attributes,{'tableName':_0x58a8('0xb'),'paranoid':![],'indexes':[{'name':_0x58a8('0xc'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x17ac=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x17ac,0x13a));var _0xc17a=function(_0x8a7082,_0x39056c){_0x8a7082=_0x8a7082-0x0;var _0x4a6786=_0x17ac[_0x8a7082];return _0x4a6786;};'use strict';var _=require(_0xc17a('0x0'));var util=require(_0xc17a('0x1'));var logger=require(_0xc17a('0x2'))('api');var moment=require(_0xc17a('0x3'));var BPromise=require(_0xc17a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc17a('0x5'));var config=require(_0xc17a('0x6'));var attributes=require(_0xc17a('0x7'));module[_0xc17a('0x8')]=function(_0x4900b3,_0x27ce5e){return _0x4900b3[_0xc17a('0x9')](_0xc17a('0xa'),attributes,{'tableName':_0xc17a('0xb'),'paranoid':![],'indexes':[{'name':_0xc17a('0xc'),'fields':[_0xc17a('0xd'),_0xc17a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fa50824..f7e5d50 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 _0x9ca1=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14070a,_0x97c10f){var _0x4018df=function(_0x4f5936){while(--_0x4f5936){_0x14070a['push'](_0x14070a['shift']());}};_0x4018df(++_0x97c10f);}(_0x9ca1,0x1cc));var _0x19ca=function(_0x162de5,_0x5221e2){_0x162de5=_0x162de5-0x0;var _0x4f5255=_0x9ca1[_0x162de5];return _0x4f5255;};'use strict';var _=require(_0x19ca('0x0'));var util=require(_0x19ca('0x1'));var moment=require(_0x19ca('0x2'));var BPromise=require(_0x19ca('0x3'));var rs=require(_0x19ca('0x4'));var fs=require('fs');var Redis=require(_0x19ca('0x5'));var db=require(_0x19ca('0x6'))['db'];var utils=require(_0x19ca('0x7'));var logger=require(_0x19ca('0x8'))(_0x19ca('0x9'));var config=require(_0x19ca('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x19ca('0xb')][_0x19ca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x233730,_0x5578a4,_0x426329){return new BPromise(function(_0x18144a,_0x5bb989){return client[_0x19ca('0xd')](_0x233730,_0x426329)[_0x19ca('0xe')](function(_0x500a57){logger[_0x19ca('0xf')](_0x19ca('0x10'),_0x5578a4,_0x19ca('0x11'));logger[_0x19ca('0x12')](_0x19ca('0x13'),_0x5578a4,_0x19ca('0x11'),JSON[_0x19ca('0x14')](_0x500a57));if(_0x500a57[_0x19ca('0x15')]){if(_0x500a57[_0x19ca('0x15')][_0x19ca('0x16')]===0x1f4){logger['error'](_0x19ca('0x10'),_0x5578a4,_0x500a57['error'][_0x19ca('0x17')]);return _0x5bb989(_0x500a57['error']['message']);}logger['error'](_0x19ca('0x10'),_0x5578a4,_0x500a57[_0x19ca('0x15')][_0x19ca('0x17')]);return _0x18144a(_0x500a57[_0x19ca('0x15')][_0x19ca('0x17')]);}else{logger[_0x19ca('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x5578a4,'request\x20sent');_0x18144a(_0x500a57[_0x19ca('0x18')]['message']);}})[_0x19ca('0x19')](function(_0x2942a4){logger[_0x19ca('0x15')](_0x19ca('0x10'),_0x5578a4,_0x2942a4);_0x5bb989(_0x2942a4);});});} \ No newline at end of file +var _0xb10f=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4f8cba,_0x51d42b){var _0xe240a6=function(_0x5de3ea){while(--_0x5de3ea){_0x4f8cba['push'](_0x4f8cba['shift']());}};_0xe240a6(++_0x51d42b);}(_0xb10f,0xe9));var _0xfb10=function(_0x3e1e44,_0x19bed4){_0x3e1e44=_0x3e1e44-0x0;var _0x27a3de=_0xb10f[_0x3e1e44];return _0x27a3de;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfb10('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb10('0x1'));var db=require(_0xfb10('0x2'))['db'];var utils=require(_0xfb10('0x3'));var logger=require(_0xfb10('0x4'))('rpc');var config=require(_0xfb10('0x5'));var jayson=require(_0xfb10('0x6'));var client=jayson[_0xfb10('0x7')][_0xfb10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cb94f,_0x1d76b1,_0x375f6f){return new BPromise(function(_0x1c3440,_0x81a87b){return client[_0xfb10('0x9')](_0x4cb94f,_0x375f6f)[_0xfb10('0xa')](function(_0x44a546){logger[_0xfb10('0xb')](_0xfb10('0xc'),_0x1d76b1,_0xfb10('0xd'));logger[_0xfb10('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1d76b1,_0xfb10('0xd'),JSON[_0xfb10('0xf')](_0x44a546));if(_0x44a546['error']){if(_0x44a546[_0xfb10('0x10')]['code']===0x1f4){logger['error'](_0xfb10('0xc'),_0x1d76b1,_0x44a546['error'][_0xfb10('0x11')]);return _0x81a87b(_0x44a546['error'][_0xfb10('0x11')]);}logger[_0xfb10('0x10')](_0xfb10('0xc'),_0x1d76b1,_0x44a546[_0xfb10('0x10')]['message']);return _0x1c3440(_0x44a546[_0xfb10('0x10')][_0xfb10('0x11')]);}else{logger[_0xfb10('0xb')](_0xfb10('0xc'),_0x1d76b1,_0xfb10('0xd'));_0x1c3440(_0x44a546[_0xfb10('0x12')][_0xfb10('0x11')]);}})[_0xfb10('0x13')](function(_0xca3db5){logger[_0xfb10('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x1d76b1,_0xca3db5);_0x81a87b(_0xca3db5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bb8b8fa..ac06966 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(_0x6e5f5f,_0x2186d2){var _0x48d0c2=function(_0x55ea71){while(--_0x55ea71){_0x6e5f5f['push'](_0x6e5f5f['shift']());}};_0x48d0c2(++_0x2186d2);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x369d63,_0x386b47){var _0x433d80=function(_0x2933d2){while(--_0x2933d2){_0x369d63['push'](_0x369d63['shift']());}};_0x433d80(++_0x386b47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4cfbb8b..c12828a 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 _0xe4c0=['exports'];(function(_0x2db63f,_0x5e3dcc){var _0x2da78c=function(_0x3598ea){while(--_0x3598ea){_0x2db63f['push'](_0x2db63f['shift']());}};_0x2da78c(++_0x5e3dcc);}(_0xe4c0,0x1ca));var _0x0e4c=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xe4c0[_0x34f545];return _0x1ff6b8;};'use strict';var Sequelize=require('sequelize');module[_0x0e4c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf165=['sequelize','INTEGER'];(function(_0x2dba92,_0x3866cf){var _0x531f44=function(_0x2dc925){while(--_0x2dc925){_0x2dba92['push'](_0x2dba92['shift']());}};_0x531f44(++_0x3866cf);}(_0xf165,0xae));var _0x5f16=function(_0x34de3f,_0x1e63b8){_0x34de3f=_0x34de3f-0x0;var _0x479eb3=_0xf165[_0x34de3f];return _0x479eb3;};'use strict';var Sequelize=require(_0x5f16('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5f16('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index f97674e..83bdd93 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 _0x8aad=['api','bluebird','request-promise','../../config/environment','define','user_has_sms_queues','lodash','util'];(function(_0x1b91a9,_0x4dbb36){var _0xa702a7=function(_0x3f7f66){while(--_0x3f7f66){_0x1b91a9['push'](_0x1b91a9['shift']());}};_0xa702a7(++_0x4dbb36);}(_0x8aad,0x146));var _0xd8aa=function(_0x420618,_0xc6daff){_0x420618=_0x420618-0x0;var _0x47ed9b=_0x8aad[_0x420618];return _0x47ed9b;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('UserSmsQueue',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x392a06,_0x233e23){var _0x42fb44=function(_0x724c5f){while(--_0x724c5f){_0x392a06['push'](_0x392a06['shift']());}};_0x42fb44(++_0x233e23);}(_0x1883,0xab));var _0x3188=function(_0xb6b0bf,_0x4a5ccd){_0xb6b0bf=_0xb6b0bf-0x0;var _0x38c498=_0x1883[_0xb6b0bf];return _0x38c498;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'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 03603e8..4dc95f4 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 _0xbade=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird'];(function(_0xe85f87,_0x261056){var _0x492ec4=function(_0x22a165){while(--_0x22a165){_0xe85f87['push'](_0xe85f87['shift']());}};_0x492ec4(++_0x261056);}(_0xbade,0x81));var _0xebad=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0xbade[_0x3cf4d3];return _0x4e547b;};'use strict';var _=require(_0xebad('0x0'));var util=require(_0xebad('0x1'));var moment=require('moment');var BPromise=require(_0xebad('0x2'));var rs=require(_0xebad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebad('0x4'))['db'];var utils=require(_0xebad('0x5'));var logger=require('../../config/logger')(_0xebad('0x6'));var config=require(_0xebad('0x7'));var jayson=require(_0xebad('0x8'));var client=jayson[_0xebad('0x9')][_0xebad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x542aee,_0xc7f7f5,_0x4353c3){return new BPromise(function(_0x4d010e,_0x1541bf){return client[_0xebad('0xb')](_0x542aee,_0x4353c3)[_0xebad('0xc')](function(_0x490063){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0xc7f7f5,_0xebad('0xd'));logger[_0xebad('0xe')](_0xebad('0xf'),_0xc7f7f5,'request\x20sent',JSON[_0xebad('0x10')](_0x490063));if(_0x490063[_0xebad('0x11')]){if(_0x490063[_0xebad('0x11')][_0xebad('0x12')]===0x1f4){logger['error'](_0xebad('0x13'),_0xc7f7f5,_0x490063[_0xebad('0x11')][_0xebad('0x14')]);return _0x1541bf(_0x490063[_0xebad('0x11')][_0xebad('0x14')]);}logger[_0xebad('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xc7f7f5,_0x490063['error'][_0xebad('0x14')]);return _0x4d010e(_0x490063['error'][_0xebad('0x14')]);}else{logger['info'](_0xebad('0x13'),_0xc7f7f5,_0xebad('0xd'));_0x4d010e(_0x490063['result']['message']);}})[_0xebad('0x15')](function(_0x693a13){logger[_0xebad('0x11')](_0xebad('0x13'),_0xc7f7f5,_0x693a13);_0x1541bf(_0x693a13);});});} \ No newline at end of file +var _0xad64=['code','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a2b75,_0x52c39c){var _0x577f25=function(_0x1e995f){while(--_0x1e995f){_0x2a2b75['push'](_0x2a2b75['shift']());}};_0x577f25(++_0x52c39c);}(_0xad64,0x7a));var _0x4ad6=function(_0x3be481,_0x19df6c){_0x3be481=_0x3be481-0x0;var _0x293735=_0xad64[_0x3be481];return _0x293735;};'use strict';var _=require('lodash');var util=require(_0x4ad6('0x0'));var moment=require(_0x4ad6('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ad6('0x2'));var fs=require('fs');var Redis=require(_0x4ad6('0x3'));var db=require(_0x4ad6('0x4'))['db'];var utils=require(_0x4ad6('0x5'));var logger=require(_0x4ad6('0x6'))(_0x4ad6('0x7'));var config=require(_0x4ad6('0x8'));var jayson=require(_0x4ad6('0x9'));var client=jayson[_0x4ad6('0xa')][_0x4ad6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b8f0b,_0x56650a,_0x11afdc){return new BPromise(function(_0x476a2f,_0x3509b7){return client[_0x4ad6('0xc')](_0x3b8f0b,_0x11afdc)['then'](function(_0x3ba627){logger['info'](_0x4ad6('0xd'),_0x56650a,_0x4ad6('0xe'));logger['debug'](_0x4ad6('0xf'),_0x56650a,_0x4ad6('0xe'),JSON[_0x4ad6('0x10')](_0x3ba627));if(_0x3ba627[_0x4ad6('0x11')]){if(_0x3ba627[_0x4ad6('0x11')][_0x4ad6('0x12')]===0x1f4){logger[_0x4ad6('0x11')](_0x4ad6('0xd'),_0x56650a,_0x3ba627[_0x4ad6('0x11')]['message']);return _0x3509b7(_0x3ba627[_0x4ad6('0x11')][_0x4ad6('0x13')]);}logger[_0x4ad6('0x11')](_0x4ad6('0xd'),_0x56650a,_0x3ba627[_0x4ad6('0x11')]['message']);return _0x476a2f(_0x3ba627[_0x4ad6('0x11')][_0x4ad6('0x13')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x56650a,'request\x20sent');_0x476a2f(_0x3ba627['result'][_0x4ad6('0x13')]);}})['catch'](function(_0x2e6930){logger[_0x4ad6('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x56650a,_0x2e6930);_0x3509b7(_0x2e6930);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 92dc6e5..32c3804 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 _0x81b8=['INTEGER','sequelize'];(function(_0x28ea0b,_0x5a94d5){var _0x446f79=function(_0x176c78){while(--_0x176c78){_0x28ea0b['push'](_0x28ea0b['shift']());}};_0x446f79(++_0x5a94d5);}(_0x81b8,0x113));var _0x881b=function(_0x24dacc,_0x3736a0){_0x24dacc=_0x24dacc-0x0;var _0x4bbf55=_0x81b8[_0x24dacc];return _0x4bbf55;};'use strict';var Sequelize=require(_0x881b('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x881b('0x1')]}}; \ No newline at end of file +var _0x545c=['INTEGER','sequelize'];(function(_0x65959d,_0x4dd888){var _0x2d71aa=function(_0x51c2ae){while(--_0x51c2ae){_0x65959d['push'](_0x65959d['shift']());}};_0x2d71aa(++_0x4dd888);}(_0x545c,0x1e3));var _0xc545=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x545c[_0x4ec520];return _0xed49d7;};'use strict';var Sequelize=require(_0xc545('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc545('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 5aba312..ad16fef 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(_0x3339c2,_0x2e59a8){var _0x9ba078=function(_0x4ba8dd){while(--_0x4ba8dd){_0x3339c2['push'](_0x3339c2['shift']());}};_0x9ba078(++_0x2e59a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1899e1,_0xae2d8d){var _0x33eb49=function(_0x577bde){while(--_0x577bde){_0x1899e1['push'](_0x1899e1['shift']());}};_0x33eb49(++_0xae2d8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 aeeab12..c445780 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x42cbb7,_0x5da36b){var _0x536415=function(_0x1226a0){while(--_0x1226a0){_0x42cbb7['push'](_0x42cbb7['shift']());}};_0x536415(++_0x5da36b);}(_0x70e0,0x17b));var _0x070e=function(_0x36d111,_0x423414){_0x36d111=_0x36d111-0x0;var _0x2316db=_0x70e0[_0x36d111];return _0x2316db;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x57bcfb,_0x1ce300){var _0x469b56=function(_0xa8efe5){while(--_0xa8efe5){_0x57bcfb['push'](_0x57bcfb['shift']());}};_0x469b56(++_0x1ce300);}(_0x70e0,0x17b));var _0x070e=function(_0x33dc5a,_0x5d6a14){_0x33dc5a=_0x33dc5a-0x0;var _0x17cd9e=_0x70e0[_0x33dc5a];return _0x17cd9e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 7d0656e..4389d6c 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 _0x2b82=['sequelize','INTEGER'];(function(_0x16f5d5,_0x184bb0){var _0x1b9f8c=function(_0x224d6d){while(--_0x224d6d){_0x16f5d5['push'](_0x16f5d5['shift']());}};_0x1b9f8c(++_0x184bb0);}(_0x2b82,0x190));var _0x22b8=function(_0x4d63ad,_0x225cb4){_0x4d63ad=_0x4d63ad-0x0;var _0x1efbdd=_0x2b82[_0x4d63ad];return _0x1efbdd;};'use strict';var Sequelize=require(_0x22b8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x22b8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbcbe=['INTEGER','sequelize','exports'];(function(_0x14dbd3,_0x59385f){var _0x30fadc=function(_0x3c09a6){while(--_0x3c09a6){_0x14dbd3['push'](_0x14dbd3['shift']());}};_0x30fadc(++_0x59385f);}(_0xbcbe,0x1bd));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xebcb('0x0'));module[_0xebcb('0x1')]={'penalty':{'type':Sequelize[_0xebcb('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 9a470cc..7edbe13 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 _0x438d=['exports','define','UserVoiceQueue','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x438d,0x1c5));var _0xd438=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x438d[_0x515afd];return _0x536d53;};'use strict';var _=require(_0xd438('0x0'));var util=require('util');var logger=require(_0xd438('0x1'))('api');var moment=require(_0xd438('0x2'));var BPromise=require(_0xd438('0x3'));var rp=require(_0xd438('0x4'));var fs=require('fs');var path=require(_0xd438('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0xd438('0x6')]=function(_0x3628b5,_0x40c604){return _0x3628b5[_0xd438('0x7')](_0xd438('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa65=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5db0e3,_0x17136e){var _0x2132ba=function(_0x4bd8a2){while(--_0x4bd8a2){_0x5db0e3['push'](_0x5db0e3['shift']());}};_0x2132ba(++_0x17136e);}(_0xaa65,0x10b));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var logger=require(_0x5aa6('0x2'))('api');var moment=require(_0x5aa6('0x3'));var BPromise=require(_0x5aa6('0x4'));var rp=require(_0x5aa6('0x5'));var fs=require('fs');var path=require(_0x5aa6('0x6'));var rimraf=require(_0x5aa6('0x7'));var config=require(_0x5aa6('0x8'));var attributes=require(_0x5aa6('0x9'));module[_0x5aa6('0xa')]=function(_0x205203,_0x33ad1a){return _0x205203[_0x5aa6('0xb')]('UserVoiceQueue',attributes,{'tableName':_0x5aa6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index ad3ff3d..64c7d76 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 _0xa022=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x4ef11c,_0x387510){var _0x1c3026=function(_0x582d43){while(--_0x582d43){_0x4ef11c['push'](_0x4ef11c['shift']());}};_0x1c3026(++_0x387510);}(_0xa022,0x1e1));var _0x2a02=function(_0x2643c9,_0x1cbce5){_0x2643c9=_0x2643c9-0x0;var _0x41fbaa=_0xa022[_0x2643c9];return _0x41fbaa;};'use strict';var _=require('lodash');var util=require(_0x2a02('0x0'));var moment=require(_0x2a02('0x1'));var BPromise=require(_0x2a02('0x2'));var rs=require(_0x2a02('0x3'));var fs=require('fs');var Redis=require(_0x2a02('0x4'));var db=require(_0x2a02('0x5'))['db'];var utils=require(_0x2a02('0x6'));var logger=require(_0x2a02('0x7'))(_0x2a02('0x8'));var config=require(_0x2a02('0x9'));var jayson=require(_0x2a02('0xa'));var client=jayson[_0x2a02('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4175a5,_0x22fc36,_0x270462){return new BPromise(function(_0x5346eb,_0x4c9f4b){return client['request'](_0x4175a5,_0x270462)[_0x2a02('0xc')](function(_0x5f1c28){logger['info'](_0x2a02('0xd'),_0x22fc36,'request\x20sent');logger[_0x2a02('0xe')](_0x2a02('0xf'),_0x22fc36,_0x2a02('0x10'),JSON[_0x2a02('0x11')](_0x5f1c28));if(_0x5f1c28[_0x2a02('0x12')]){if(_0x5f1c28[_0x2a02('0x12')][_0x2a02('0x13')]===0x1f4){logger[_0x2a02('0x12')](_0x2a02('0xd'),_0x22fc36,_0x5f1c28[_0x2a02('0x12')]['message']);return _0x4c9f4b(_0x5f1c28['error'][_0x2a02('0x14')]);}logger[_0x2a02('0x12')](_0x2a02('0xd'),_0x22fc36,_0x5f1c28['error'][_0x2a02('0x14')]);return _0x5346eb(_0x5f1c28[_0x2a02('0x12')][_0x2a02('0x14')]);}else{logger[_0x2a02('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x22fc36,_0x2a02('0x10'));_0x5346eb(_0x5f1c28[_0x2a02('0x16')]['message']);}})[_0x2a02('0x17')](function(_0x4c421f){logger[_0x2a02('0x12')](_0x2a02('0xd'),_0x22fc36,_0x4c421f);_0x4c9f4b(_0x4c421f);});});} \ No newline at end of file +var _0x122c=['code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x31cf4a,_0x5c4d3){var _0x1e3773=function(_0x2d6fc4){while(--_0x2d6fc4){_0x31cf4a['push'](_0x31cf4a['shift']());}};_0x1e3773(++_0x5c4d3);}(_0x122c,0xc5));var _0xc122=function(_0x108d63,_0x14491b){_0x108d63=_0x108d63-0x0;var _0x51d6df=_0x122c[_0x108d63];return _0x51d6df;};'use strict';var _=require(_0xc122('0x0'));var util=require(_0xc122('0x1'));var moment=require(_0xc122('0x2'));var BPromise=require(_0xc122('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc122('0x4'));var db=require(_0xc122('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc122('0x6'))(_0xc122('0x7'));var config=require(_0xc122('0x8'));var jayson=require(_0xc122('0x9'));var client=jayson[_0xc122('0xa')][_0xc122('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f357a,_0x3ab62d,_0x18915e){return new BPromise(function(_0x7f8ec1,_0x4b50a6){return client[_0xc122('0xc')](_0x1f357a,_0x18915e)[_0xc122('0xd')](function(_0x503c4e){logger[_0xc122('0xe')](_0xc122('0xf'),_0x3ab62d,_0xc122('0x10'));logger[_0xc122('0x11')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3ab62d,'request\x20sent',JSON[_0xc122('0x12')](_0x503c4e));if(_0x503c4e['error']){if(_0x503c4e['error'][_0xc122('0x13')]===0x1f4){logger[_0xc122('0x14')](_0xc122('0xf'),_0x3ab62d,_0x503c4e[_0xc122('0x14')][_0xc122('0x15')]);return _0x4b50a6(_0x503c4e[_0xc122('0x14')][_0xc122('0x15')]);}logger['error'](_0xc122('0xf'),_0x3ab62d,_0x503c4e['error'][_0xc122('0x15')]);return _0x7f8ec1(_0x503c4e[_0xc122('0x14')][_0xc122('0x15')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x3ab62d,'request\x20sent');_0x7f8ec1(_0x503c4e[_0xc122('0x16')][_0xc122('0x15')]);}})[_0xc122('0x17')](function(_0x1bb261){logger[_0xc122('0x14')](_0xc122('0xf'),_0x3ab62d,_0x1bb261);_0x4b50a6(_0x1bb261);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 651e71b..d5076f8 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1b0846,_0x2c1c53){var _0x1872c6=function(_0x12768c){while(--_0x12768c){_0x1b0846['push'](_0x1b0846['shift']());}};_0x1872c6(++_0x2c1c53);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xcb91[_0x609988];return _0x159984;};'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(_0x33080b,_0x101ffd){var _0x3bd64b=function(_0x1583a8){while(--_0x1583a8){_0x33080b['push'](_0x33080b['shift']());}};_0x3bd64b(++_0x101ffd);}(_0xe706,0xa3));var _0x6e70=function(_0x288478,_0x23303e){_0x288478=_0x288478-0x0;var _0x234c05=_0xe706[_0x288478];return _0x234c05;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 6fecde1..856688f 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 _0xd9a8=['STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER'];(function(_0x2bf3de,_0x3565fc){var _0x28598f=function(_0x39850d){while(--_0x39850d){_0x2bf3de['push'](_0x2bf3de['shift']());}};_0x28598f(++_0x3565fc);}(_0xd9a8,0xc3));var _0x8d9a=function(_0x2a6252,_0x1b38ff){_0x2a6252=_0x2a6252-0x0;var _0x108c1b=_0xd9a8[_0x2a6252];return _0x108c1b;};'use strict';var Sequelize=require(_0x8d9a('0x0'));module[_0x8d9a('0x1')]={'uniqueid':{'type':Sequelize[_0x8d9a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x8d9a('0x3')],'allowNull':![],'comment':_0x8d9a('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8d9a('0x5'),'comment':_0x8d9a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x8d9a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x8d9a('0x3')],'allowNull':![],'unique':_0x8d9a('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x8d9a('0x2')](0xb),'defaultValue':0x0,'comment':_0x8d9a('0x4')},'paused':{'type':Sequelize[_0x8d9a('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x4a44=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x425673,_0x2be280){var _0x2a2311=function(_0x5d456e){while(--_0x5d456e){_0x425673['push'](_0x425673['shift']());}};_0x2a2311(++_0x2be280);}(_0x4a44,0x1ee));var _0x44a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4a44[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x44a4('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x44a4('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x44a4('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x44a4('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x44a4('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x44a4('0x2')},'VoiceQueueId':{'type':Sequelize[_0x44a4('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x44a4('0x3')],'allowNull':![],'unique':_0x44a4('0x4'),'comment':_0x44a4('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x44a4('0x1')](0xb),'defaultValue':0x0,'comment':_0x44a4('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 92b1f3e..18ab096 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 _0x5914=['UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x5914,0x1f2));var _0x4591=function(_0x2526ca,_0x267f63){_0x2526ca=_0x2526ca-0x0;var _0x1a335e=_0x5914[_0x2526ca];return _0x1a335e;};'use strict';var EventEmitter=require(_0x4591('0x0'));var UserVoiceQueueRt=require(_0x4591('0x1'))['db'][_0x4591('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4591('0x3')](0x0);var events={'afterCreate':_0x4591('0x4'),'afterUpdate':_0x4591('0x5'),'afterDestroy':_0x4591('0x6')};function emitEvent(_0x24b443){return function(_0x2619b4,_0x356d2e,_0x318e11){UserVoiceQueueRtEvents[_0x4591('0x7')](_0x24b443+':'+_0x2619b4['id'],_0x2619b4);UserVoiceQueueRtEvents[_0x4591('0x7')](_0x24b443,_0x2619b4);_0x318e11(null);};}for(var e in events){if(events[_0x4591('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4591('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x49ae=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x182b41,_0x3710ca){var _0x39e4dc=function(_0x9bf120){while(--_0x9bf120){_0x182b41['push'](_0x182b41['shift']());}};_0x39e4dc(++_0x3710ca);}(_0x49ae,0xd6));var _0xe49a=function(_0x24e1b5,_0x2f8dba){_0x24e1b5=_0x24e1b5-0x0;var _0x1cc39b=_0x49ae[_0x24e1b5];return _0x1cc39b;};'use strict';var EventEmitter=require(_0xe49a('0x0'));var UserVoiceQueueRt=require(_0xe49a('0x1'))['db'][_0xe49a('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe49a('0x3')](0x0);var events={'afterCreate':_0xe49a('0x4'),'afterUpdate':_0xe49a('0x5'),'afterDestroy':_0xe49a('0x6')};function emitEvent(_0x568991){return function(_0x587bae,_0x513d73,_0x510ffa){UserVoiceQueueRtEvents[_0xe49a('0x7')](_0x568991+':'+_0x587bae['id'],_0x587bae);UserVoiceQueueRtEvents[_0xe49a('0x7')](_0x568991,_0x587bae);_0x510ffa(null);};}for(var e in events){if(events[_0xe49a('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xe49a('0x9')](e,emitEvent(event));}}module[_0xe49a('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index a9c371e..42e1e5d 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 _0x4fb2=['exports','define','UserVoiceQueueRt','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x38662f,_0x494884){var _0xbb669=function(_0x153eec){while(--_0x153eec){_0x38662f['push'](_0x38662f['shift']());}};_0xbb669(++_0x494884);}(_0x4fb2,0xd5));var _0x24fb=function(_0x289166,_0x4480a8){_0x289166=_0x289166-0x0;var _0x249579=_0x4fb2[_0x289166];return _0x249579;};'use strict';var _=require('lodash');var util=require(_0x24fb('0x0'));var logger=require(_0x24fb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x24fb('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24fb('0x3'));var rimraf=require(_0x24fb('0x4'));var config=require(_0x24fb('0x5'));var attributes=require(_0x24fb('0x6'));module[_0x24fb('0x7')]=function(_0x31cc39,_0x41c1eb){return _0x31cc39[_0x24fb('0x8')](_0x24fb('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9df1=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','bluebird'];(function(_0x46a018,_0x30754f){var _0x54dc2e=function(_0x578469){while(--_0x578469){_0x46a018['push'](_0x46a018['shift']());}};_0x54dc2e(++_0x30754f);}(_0x9df1,0x170));var _0x19df=function(_0x4a22e5,_0x16e8d8){_0x4a22e5=_0x4a22e5-0x0;var _0x26bbe3=_0x9df1[_0x4a22e5];return _0x26bbe3;};'use strict';var _=require(_0x19df('0x0'));var util=require('util');var logger=require(_0x19df('0x1'))(_0x19df('0x2'));var moment=require('moment');var BPromise=require(_0x19df('0x3'));var rp=require(_0x19df('0x4'));var fs=require('fs');var path=require(_0x19df('0x5'));var rimraf=require(_0x19df('0x6'));var config=require(_0x19df('0x7'));var attributes=require(_0x19df('0x8'));module[_0x19df('0x9')]=function(_0x1a9b07,_0x29885f){return _0x1a9b07['define'](_0x19df('0xa'),attributes,{'tableName':_0x19df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 18c0d57..6f3d322 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 _0xfb7b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','literal','outboundQueuePauses','lodash','moment','bluebird','ioredis'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xfb7b,0x1c3));var _0xbfb7=function(_0xb3a300,_0x2b145a){_0xb3a300=_0xb3a300-0x0;var _0x273853=_0xfb7b[_0xb3a300];return _0x273853;};'use strict';var _=require(_0xbfb7('0x0'));var util=require('util');var moment=require(_0xbfb7('0x1'));var BPromise=require(_0xbfb7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfb7('0x3'));var db=require(_0xbfb7('0x4'))['db'];var utils=require(_0xbfb7('0x5'));var logger=require(_0xbfb7('0x6'))(_0xbfb7('0x7'));var config=require(_0xbfb7('0x8'));var jayson=require(_0xbfb7('0x9'));var client=jayson[_0xbfb7('0xa')][_0xbfb7('0xb')]({'port':0x232a});config[_0xbfb7('0xc')]=_[_0xbfb7('0xd')](config['redis'],{'host':_0xbfb7('0xe'),'port':0x18eb});var socket=require(_0xbfb7('0xf'))(new Redis(config[_0xbfb7('0xc')]));require(_0xbfb7('0x10'))['register'](socket);function respondWithRpcPromise(_0x3027c4,_0x1cf5ee,_0x4cdde6){return new BPromise(function(_0x50f36f,_0x53c893){return client['request'](_0x3027c4,_0x4cdde6)[_0xbfb7('0x11')](function(_0xd36d89){logger[_0xbfb7('0x12')](_0xbfb7('0x13'),_0x1cf5ee,'request\x20sent');logger[_0xbfb7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1cf5ee,_0xbfb7('0x15'),JSON[_0xbfb7('0x16')](_0xd36d89));if(_0xd36d89[_0xbfb7('0x17')]){if(_0xd36d89[_0xbfb7('0x17')][_0xbfb7('0x18')]===0x1f4){logger[_0xbfb7('0x17')](_0xbfb7('0x13'),_0x1cf5ee,_0xd36d89[_0xbfb7('0x17')][_0xbfb7('0x19')]);return _0x53c893(_0xd36d89[_0xbfb7('0x17')]['message']);}logger[_0xbfb7('0x17')](_0xbfb7('0x13'),_0x1cf5ee,_0xd36d89['error'][_0xbfb7('0x19')]);return _0x50f36f(_0xd36d89[_0xbfb7('0x17')][_0xbfb7('0x19')]);}else{logger[_0xbfb7('0x12')](_0xbfb7('0x13'),_0x1cf5ee,_0xbfb7('0x15'));_0x50f36f(_0xd36d89['result'][_0xbfb7('0x19')]);}})[_0xbfb7('0x1a')](function(_0x2137c5){logger[_0xbfb7('0x17')](_0xbfb7('0x13'),_0x1cf5ee,_0x2137c5);_0x53c893(_0x2137c5);});});}exports[_0xbfb7('0x1b')]=function(_0x1c285e){var _0x2c74a8=this;return new Promise(function(_0x396ff0,_0x77eb1){return db[_0xbfb7('0x1c')]['findAll']({'raw':_0x1c285e['options']?_0x1c285e[_0xbfb7('0x1d')][_0xbfb7('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c285e['options']?_0x1c285e['options'][_0xbfb7('0x1f')]||null:null,'attributes':[[db[_0xbfb7('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbfb7('0x20')][_0xbfb7('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0xbfb7('0x22')]]})[_0xbfb7('0x11')](function(_0x4a7041){logger[_0xbfb7('0x12')]('GetVoiceQueueRtPauses',_0x1c285e);logger['debug']('GetVoiceQueueRtPauses',_0x1c285e,JSON[_0xbfb7('0x16')](_0x4a7041));_0x396ff0(_0x4a7041);})[_0xbfb7('0x1a')](function(_0x1bdb4e){logger[_0xbfb7('0x17')](_0xbfb7('0x1b'),_0x1bdb4e[_0xbfb7('0x19')],_0x1c285e);_0x77eb1(_0x2c74a8['error'](0x1f4,_0x1bdb4e[_0xbfb7('0x19')]));});});}; \ No newline at end of file +var _0x918e=['raw','sequelize','COUNT','outboundQueuePauses','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','catch','GetVoiceQueueRtPauses','findAll','options'];(function(_0x4ea969,_0x4158c5){var _0x15237b=function(_0x235704){while(--_0x235704){_0x4ea969['push'](_0x4ea969['shift']());}};_0x15237b(++_0x4158c5);}(_0x918e,0x136));var _0xe918=function(_0x2950d2,_0x211a20){_0x2950d2=_0x2950d2-0x0;var _0x5f7567=_0x918e[_0x2950d2];return _0x5f7567;};'use strict';var _=require('lodash');var util=require(_0xe918('0x0'));var moment=require(_0xe918('0x1'));var BPromise=require(_0xe918('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe918('0x3'))['db'];var utils=require(_0xe918('0x4'));var logger=require('../../config/logger')(_0xe918('0x5'));var config=require(_0xe918('0x6'));var jayson=require(_0xe918('0x7'));var client=jayson[_0xe918('0x8')][_0xe918('0x9')]({'port':0x232a});config[_0xe918('0xa')]=_[_0xe918('0xb')](config[_0xe918('0xa')],{'host':_0xe918('0xc'),'port':0x18eb});var socket=require(_0xe918('0xd'))(new Redis(config[_0xe918('0xa')]));require(_0xe918('0xe'))[_0xe918('0xf')](socket);function respondWithRpcPromise(_0x5aae76,_0x653944,_0x2caee0){return new BPromise(function(_0x13af37,_0x5e411b){return client[_0xe918('0x10')](_0x5aae76,_0x2caee0)['then'](function(_0x477fd5){logger[_0xe918('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x653944,'request\x20sent');logger[_0xe918('0x12')](_0xe918('0x13'),_0x653944,_0xe918('0x14'),JSON[_0xe918('0x15')](_0x477fd5));if(_0x477fd5[_0xe918('0x16')]){if(_0x477fd5[_0xe918('0x16')][_0xe918('0x17')]===0x1f4){logger[_0xe918('0x16')](_0xe918('0x18'),_0x653944,_0x477fd5[_0xe918('0x16')]['message']);return _0x5e411b(_0x477fd5['error']['message']);}logger['error'](_0xe918('0x18'),_0x653944,_0x477fd5['error'][_0xe918('0x19')]);return _0x13af37(_0x477fd5[_0xe918('0x16')][_0xe918('0x19')]);}else{logger[_0xe918('0x11')](_0xe918('0x18'),_0x653944,'request\x20sent');_0x13af37(_0x477fd5['result'][_0xe918('0x19')]);}})[_0xe918('0x1a')](function(_0x2d8a65){logger[_0xe918('0x16')](_0xe918('0x18'),_0x653944,_0x2d8a65);_0x5e411b(_0x2d8a65);});});}exports[_0xe918('0x1b')]=function(_0x48601a){var _0x4d6ba2=this;return new Promise(function(_0xd87626,_0x2e3dfd){return db['UserVoiceQueueRt'][_0xe918('0x1c')]({'raw':_0x48601a[_0xe918('0x1d')]?_0x48601a[_0xe918('0x1d')][_0xe918('0x1e')]===undefined?!![]:![]:!![],'where':_0x48601a[_0xe918('0x1d')]?_0x48601a[_0xe918('0x1d')]['where']||null:null,'attributes':[[db[_0xe918('0x1f')]['fn'](_0xe918('0x20'),db['sequelize']['fn']('IF',db[_0xe918('0x1f')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0xe918('0x21')]]})['then'](function(_0x49d7de){logger[_0xe918('0x11')](_0xe918('0x1b'),_0x48601a);logger[_0xe918('0x12')](_0xe918('0x1b'),_0x48601a,JSON[_0xe918('0x15')](_0x49d7de));_0xd87626(_0x49d7de);})[_0xe918('0x1a')](function(_0x2531c4){logger[_0xe918('0x16')](_0xe918('0x1b'),_0x2531c4[_0xe918('0x19')],_0x48601a);_0x2e3dfd(_0x4d6ba2[_0xe918('0x16')](0x1f4,_0x2531c4['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 77d3964..6eceaaf 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 _0xd0c9=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','emit','length'];(function(_0x5d66c4,_0x6448c4){var _0x55e944=function(_0x1d7a6e){while(--_0x1d7a6e){_0x5d66c4['push'](_0x5d66c4['shift']());}};_0x55e944(++_0x6448c4);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xd0c9[_0x4ae829];return _0x256b31;};'use strict';var UserVoiceQueueRtEvents=require(_0x9d0c('0x0'));var events=[_0x9d0c('0x1'),'remove','update'];function createListener(_0x5d3eb1,_0x154c38){return function(_0x2eff0e){_0x154c38[_0x9d0c('0x2')](_0x5d3eb1,_0x2eff0e);};}function removeListener(_0x5922f1,_0x3b4b50){return function(){UserVoiceQueueRtEvents['removeListener'](_0x5922f1,_0x3b4b50);};}exports['register']=function(_0x6749){for(var _0x5bcaf9=0x0,_0x3eec5f=events[_0x9d0c('0x3')];_0x5bcaf9<_0x3eec5f;_0x5bcaf9++){var _0x308d9e=events[_0x5bcaf9];var _0x413a70=createListener(_0x9d0c('0x4')+_0x308d9e,_0x6749);UserVoiceQueueRtEvents['on'](_0x308d9e,_0x413a70);}}; \ No newline at end of file +var _0xad78=['./userVoiceQueueRt.events','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x3cb963,_0x5a0323){var _0x2b9aa3=function(_0x3b8606){while(--_0x3b8606){_0x3cb963['push'](_0x3cb963['shift']());}};_0x2b9aa3(++_0x5a0323);}(_0xad78,0x149));var _0x8ad7=function(_0x1f3996,_0x101cc9){_0x1f3996=_0x1f3996-0x0;var _0x5e2cde=_0xad78[_0x1f3996];return _0x5e2cde;};'use strict';var UserVoiceQueueRtEvents=require(_0x8ad7('0x0'));var events=['save','remove',_0x8ad7('0x1')];function createListener(_0x3d980d,_0x4fdce6){return function(_0x343c1d){_0x4fdce6[_0x8ad7('0x2')](_0x3d980d,_0x343c1d);};}function removeListener(_0x2daf59,_0x296a52){return function(){UserVoiceQueueRtEvents[_0x8ad7('0x3')](_0x2daf59,_0x296a52);};}exports[_0x8ad7('0x4')]=function(_0x160c84){for(var _0x4301d4=0x0,_0x415e9c=events[_0x8ad7('0x5')];_0x4301d4<_0x415e9c;_0x4301d4++){var _0x49aeb1=events[_0x4301d4];var _0x4822d3=createListener(_0x8ad7('0x6')+_0x49aeb1,_0x160c84);UserVoiceQueueRtEvents['on'](_0x49aeb1,_0x4822d3);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index aa46c1c..b961288 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x382310,_0x48387b){var _0x2020ca=function(_0x3a237c){while(--_0x3a237c){_0x382310['push'](_0x382310['shift']());}};_0x2020ca(++_0x48387b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0xcb91[_0x43a1b8];return _0x324ecc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x38e177,_0x59ec9f){var _0x1faf15=function(_0x4cf149){while(--_0x4cf149){_0x38e177['push'](_0x38e177['shift']());}};_0x1faf15(++_0x59ec9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index bb61dfd..4499283 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 _0x1280=['sequelize','exports','INTEGER'];(function(_0x4e1bb5,_0xde6ec0){var _0x3cfc7e=function(_0x2a3892){while(--_0x2a3892){_0x4e1bb5['push'](_0x4e1bb5['shift']());}};_0x3cfc7e(++_0xde6ec0);}(_0x1280,0xba));var _0x0128=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x1280[_0x4ed1d4];return _0x28e363;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'penalty':{'type':Sequelize[_0x0128('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae6c=['INTEGER','exports'];(function(_0x116b9c,_0x1d4b6b){var _0x7825e3=function(_0xa82c07){while(--_0xa82c07){_0x116b9c['push'](_0x116b9c['shift']());}};_0x7825e3(++_0x1d4b6b);}(_0xae6c,0x95));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xcae6('0x0')]={'penalty':{'type':Sequelize[_0xcae6('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 4774d19..0163b72 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 _0x6fa8=['path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x31c66b,_0x221dd0){var _0xf52cb=function(_0x537e4f){while(--_0x537e4f){_0x31c66b['push'](_0x31c66b['shift']());}};_0xf52cb(++_0x221dd0);}(_0x6fa8,0x1cf));var _0x86fa=function(_0x3d2b19,_0x349a5b){_0x3d2b19=_0x3d2b19-0x0;var _0x29769b=_0x6fa8[_0x3d2b19];return _0x29769b;};'use strict';var _=require('lodash');var util=require(_0x86fa('0x0'));var logger=require(_0x86fa('0x1'))('api');var moment=require(_0x86fa('0x2'));var BPromise=require(_0x86fa('0x3'));var rp=require(_0x86fa('0x4'));var fs=require('fs');var path=require(_0x86fa('0x5'));var rimraf=require(_0x86fa('0x6'));var config=require(_0x86fa('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x86fa('0x8')]=function(_0x369e6c,_0x3c5e00){return _0x369e6c[_0x86fa('0x9')](_0x86fa('0xa'),attributes,{'tableName':_0x86fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c33=['util','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x3fdf47,_0x4c03a1){var _0x409a13=function(_0xbfa315){while(--_0xbfa315){_0x3fdf47['push'](_0x3fdf47['shift']());}};_0x409a13(++_0x4c03a1);}(_0x0c33,0xbb));var _0x30c3=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x0c33[_0x47e549];return _0x251374;};'use strict';var _=require('lodash');var util=require(_0x30c3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x30c3('0x1'));var BPromise=require('bluebird');var rp=require(_0x30c3('0x2'));var fs=require('fs');var path=require(_0x30c3('0x3'));var rimraf=require(_0x30c3('0x4'));var config=require(_0x30c3('0x5'));var attributes=require(_0x30c3('0x6'));module[_0x30c3('0x7')]=function(_0x51cdc8,_0x281618){return _0x51cdc8[_0x30c3('0x8')](_0x30c3('0x9'),attributes,{'tableName':_0x30c3('0xa'),'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 befbf57..4d2e4f1 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 _0xf05e=['../../config/environment','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3006e9,_0x158c9b){var _0x111164=function(_0x252dc6){while(--_0x252dc6){_0x3006e9['push'](_0x3006e9['shift']());}};_0x111164(++_0x158c9b);}(_0xf05e,0x189));var _0xef05=function(_0x349f72,_0x502f47){_0x349f72=_0x349f72-0x0;var _0x1125bd=_0xf05e[_0x349f72];return _0x1125bd;};'use strict';var _=require('lodash');var util=require(_0xef05('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xef05('0x1'));var fs=require('fs');var Redis=require(_0xef05('0x2'));var db=require(_0xef05('0x3'))['db'];var utils=require(_0xef05('0x4'));var logger=require(_0xef05('0x5'))(_0xef05('0x6'));var config=require(_0xef05('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xef05('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b2d38,_0x25ef1,_0x2d556f){return new BPromise(function(_0x31806a,_0x286ed0){return client[_0xef05('0x9')](_0x5b2d38,_0x2d556f)[_0xef05('0xa')](function(_0x13e3cc){logger[_0xef05('0xb')](_0xef05('0xc'),_0x25ef1,_0xef05('0xd'));logger[_0xef05('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x25ef1,_0xef05('0xd'),JSON[_0xef05('0xf')](_0x13e3cc));if(_0x13e3cc[_0xef05('0x10')]){if(_0x13e3cc[_0xef05('0x10')]['code']===0x1f4){logger[_0xef05('0x10')](_0xef05('0xc'),_0x25ef1,_0x13e3cc[_0xef05('0x10')]['message']);return _0x286ed0(_0x13e3cc[_0xef05('0x10')]['message']);}logger['error'](_0xef05('0xc'),_0x25ef1,_0x13e3cc[_0xef05('0x10')][_0xef05('0x11')]);return _0x31806a(_0x13e3cc['error'][_0xef05('0x11')]);}else{logger[_0xef05('0xb')](_0xef05('0xc'),_0x25ef1,_0xef05('0xd'));_0x31806a(_0x13e3cc[_0xef05('0x12')][_0xef05('0x11')]);}})[_0xef05('0x13')](function(_0x4bdabb){logger[_0xef05('0x10')](_0xef05('0xc'),_0x25ef1,_0x4bdabb);_0x286ed0(_0x4bdabb);});});} \ No newline at end of file +var _0x3866=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','debug'];(function(_0x38da13,_0x3cd716){var _0x10bdd9=function(_0x52b887){while(--_0x52b887){_0x38da13['push'](_0x38da13['shift']());}};_0x10bdd9(++_0x3cd716);}(_0x3866,0x1a7));var _0x6386=function(_0x1617fe,_0x2faa0e){_0x1617fe=_0x1617fe-0x0;var _0x632abf=_0x3866[_0x1617fe];return _0x632abf;};'use strict';var _=require('lodash');var util=require(_0x6386('0x0'));var moment=require(_0x6386('0x1'));var BPromise=require(_0x6386('0x2'));var rs=require(_0x6386('0x3'));var fs=require('fs');var Redis=require(_0x6386('0x4'));var db=require(_0x6386('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6386('0x6'))('rpc');var config=require(_0x6386('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6386('0x8')][_0x6386('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x492461,_0x48a8c3,_0x238966){return new BPromise(function(_0x2cf901,_0xa4cc94){return client[_0x6386('0xa')](_0x492461,_0x238966)['then'](function(_0x977e7f){logger[_0x6386('0xb')](_0x6386('0xc'),_0x48a8c3,'request\x20sent');logger[_0x6386('0xd')](_0x6386('0xe'),_0x48a8c3,_0x6386('0xf'),JSON['stringify'](_0x977e7f));if(_0x977e7f[_0x6386('0x10')]){if(_0x977e7f[_0x6386('0x10')][_0x6386('0x11')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x48a8c3,_0x977e7f[_0x6386('0x10')][_0x6386('0x12')]);return _0xa4cc94(_0x977e7f[_0x6386('0x10')]['message']);}logger[_0x6386('0x10')](_0x6386('0xc'),_0x48a8c3,_0x977e7f[_0x6386('0x10')][_0x6386('0x12')]);return _0x2cf901(_0x977e7f['error'][_0x6386('0x12')]);}else{logger[_0x6386('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x48a8c3,_0x6386('0xf'));_0x2cf901(_0x977e7f['result'][_0x6386('0x12')]);}})['catch'](function(_0x40f877){logger[_0x6386('0x10')](_0x6386('0xc'),_0x48a8c3,_0x40f877);_0xa4cc94(_0x40f877);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 53c55f5..5d789df 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 _0x4f29=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','/:id','isAuthenticated','show','post','update','delete'];(function(_0x1f43f4,_0x16d500){var _0x5435b7=function(_0x54f029){while(--_0x54f029){_0x1f43f4['push'](_0x1f43f4['shift']());}};_0x5435b7(++_0x16d500);}(_0x4f29,0xfd));var _0x94f2=function(_0x207ff0,_0x526433){_0x207ff0=_0x207ff0-0x0;var _0x51da0e=_0x4f29[_0x207ff0];return _0x51da0e;};'use strict';var multer=require('multer');var util=require(_0x94f2('0x0'));var path=require(_0x94f2('0x1'));var timeout=require(_0x94f2('0x2'));var express=require(_0x94f2('0x3'));var router=express[_0x94f2('0x4')]();var fs_extra=require(_0x94f2('0x5'));var auth=require(_0x94f2('0x6'));var interaction=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var controller=require(_0x94f2('0x9'));router[_0x94f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x94f2('0xa')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller[_0x94f2('0xd')]);router[_0x94f2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x94f2('0xb'),auth['isAuthenticated'](),controller[_0x94f2('0xf')]);router[_0x94f2('0x10')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller['destroy']);module[_0x94f2('0x11')]=router; \ No newline at end of file +var _0x89c3=['Router','fs-extra','../../components/auth/service','../../config/environment','get','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2027a0,_0xd553c4){var _0x16c92f=function(_0xbdce5){while(--_0xbdce5){_0x2027a0['push'](_0x2027a0['shift']());}};_0x16c92f(++_0xd553c4);}(_0x89c3,0xff));var _0x389c=function(_0x32c730,_0x33fe69){_0x32c730=_0x32c730-0x0;var _0x3406bc=_0x89c3[_0x32c730];return _0x3406bc;};'use strict';var multer=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var path=require(_0x389c('0x2'));var timeout=require(_0x389c('0x3'));var express=require(_0x389c('0x4'));var router=express[_0x389c('0x5')]();var fs_extra=require(_0x389c('0x6'));var auth=require(_0x389c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x389c('0x8'));var controller=require('./variable.controller');router[_0x389c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x389c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x389c('0xa')]);router[_0x389c('0xb')]('/',auth[_0x389c('0xc')](),controller[_0x389c('0xd')]);router[_0x389c('0xe')](_0x389c('0xf'),auth[_0x389c('0xc')](),controller[_0x389c('0x10')]);router[_0x389c('0x11')]('/:id',auth[_0x389c('0xc')](),controller[_0x389c('0x12')]);module[_0x389c('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 2410673..7400664 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 _0xf363=['name','exports','STRING'];(function(_0x46180a,_0x23483e){var _0x3b3e78=function(_0x18d45c){while(--_0x18d45c){_0x46180a['push'](_0x46180a['shift']());}};_0x3b3e78(++_0x23483e);}(_0xf363,0xd9));var _0x3f36=function(_0x8faced,_0xffa79e){_0x8faced=_0x8faced-0x0;var _0xcf14af=_0xf363[_0x8faced];return _0xcf14af;};'use strict';var Sequelize=require('sequelize');module[_0x3f36('0x0')]={'name':{'type':Sequelize[_0x3f36('0x1')],'unique':_0x3f36('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3f36('0x1')]}}; \ No newline at end of file +var _0x5160=['STRING','sequelize','exports'];(function(_0x507af7,_0x5cfb83){var _0x496d57=function(_0x36f0c3){while(--_0x36f0c3){_0x507af7['push'](_0x507af7['shift']());}};_0x496d57(++_0x5cfb83);}(_0x5160,0x1cc));var _0x0516=function(_0x1aaf25,_0x1c78eb){_0x1aaf25=_0x1aaf25-0x0;var _0x153bf8=_0x5160[_0x1aaf25];return _0x153bf8;};'use strict';var Sequelize=require(_0x0516('0x0'));module[_0x0516('0x1')]={'name':{'type':Sequelize[_0x0516('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0516('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a07d56b..f3b5030 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 _0xab51=['create','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','get','Variables','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','Variable','include','findAll','rows','catch','show','params','merge','find'];(function(_0x485835,_0x4a0708){var _0x3e079f=function(_0xb015dc){while(--_0xb015dc){_0x485835['push'](_0x485835['shift']());}};_0x3e079f(++_0x4a0708);}(_0xab51,0xae));var _0x1ab5=function(_0x56b67a,_0x1a1838){_0x56b67a=_0x56b67a-0x0;var _0x17fa0d=_0xab51[_0x56b67a];return _0x17fa0d;};'use strict';var emlformat=require(_0x1ab5('0x0'));var rimraf=require(_0x1ab5('0x1'));var zipdir=require(_0x1ab5('0x2'));var jsonpatch=require(_0x1ab5('0x3'));var rp=require(_0x1ab5('0x4'));var moment=require(_0x1ab5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1ab5('0x6'));var util=require(_0x1ab5('0x7'));var path=require(_0x1ab5('0x8'));var sox=require(_0x1ab5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ab5('0xa'));var _=require(_0x1ab5('0xb'));var squel=require(_0x1ab5('0xc'));var crypto=require(_0x1ab5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ab5('0xe'));var querystring=require(_0x1ab5('0xf'));var Papa=require(_0x1ab5('0x10'));var Redis=require(_0x1ab5('0x11'));var authService=require(_0x1ab5('0x12'));var qs=require(_0x1ab5('0x13'));var as=require(_0x1ab5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ab5('0x15'))(_0x1ab5('0x16'));var utils=require(_0x1ab5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ab5('0x18'));var db=require(_0x1ab5('0x19'))['db'];function respondWithStatusCode(_0x55e988,_0x266b50){_0x266b50=_0x266b50||0xcc;return function(_0x151544){if(_0x151544){return _0x55e988[_0x1ab5('0x1a')](_0x266b50);}return _0x55e988[_0x1ab5('0x1b')](_0x266b50)[_0x1ab5('0x1c')]();};}function respondWithResult(_0x32f14a,_0x55f916){_0x55f916=_0x55f916||0xc8;return function(_0x53db19){if(_0x53db19){return _0x32f14a['status'](_0x55f916)[_0x1ab5('0x1d')](_0x53db19);}};}function respondWithFilteredResult(_0x42dfa5,_0xab1dbb){return function(_0x6256d){if(_0x6256d){var _0x39753e=typeof _0xab1dbb['offset']===_0x1ab5('0x1e')&&typeof _0xab1dbb[_0x1ab5('0x1f')]==='undefined';var _0x54ecdf=_0x6256d[_0x1ab5('0x20')];var _0x69ccfc=_0x39753e?0x0:_0xab1dbb[_0x1ab5('0x21')];var _0x50c76f=_0x39753e?_0x6256d[_0x1ab5('0x20')]:_0xab1dbb[_0x1ab5('0x21')]+_0xab1dbb[_0x1ab5('0x1f')];var _0x4aa21f;if(_0x50c76f>=_0x54ecdf){_0x50c76f=_0x54ecdf;_0x4aa21f=0xc8;}else{_0x4aa21f=0xce;}_0x42dfa5[_0x1ab5('0x1b')](_0x4aa21f);return _0x42dfa5[_0x1ab5('0x22')](_0x1ab5('0x23'),_0x69ccfc+'-'+_0x50c76f+'/'+_0x54ecdf)[_0x1ab5('0x1d')](_0x6256d);}return null;};}function patchUpdates(_0x2bf8e5){return function(_0x20a9c7){try{jsonpatch[_0x1ab5('0x24')](_0x20a9c7,_0x2bf8e5,!![]);}catch(_0x7a0135){return BPromise['reject'](_0x7a0135);}return _0x20a9c7[_0x1ab5('0x25')]();};}function saveUpdates(_0x7f87b5,_0x32d08b){return function(_0x1ed602){if(_0x1ed602){return _0x1ed602['update'](_0x7f87b5)[_0x1ab5('0x26')](function(_0xa4af0e){return _0xa4af0e;});}return null;};}function removeEntity(_0x1dfdcb,_0x28f17b){return function(_0x94003){if(_0x94003){return _0x94003['destroy']()[_0x1ab5('0x26')](function(){var _0x11ea84=_0x94003[_0x1ab5('0x27')]({'plain':!![]});var _0x564b3d=_0x1ab5('0x28');return db[_0x1ab5('0x29')][_0x1ab5('0x2a')]({'where':{'type':_0x564b3d,'resourceId':_0x11ea84['id']}})[_0x1ab5('0x26')](function(){return _0x94003;});})['then'](function(){_0x1dfdcb[_0x1ab5('0x1b')](0xcc)[_0x1ab5('0x1c')]();});}};}function handleEntityNotFound(_0x706430,_0x5194c8){return function(_0x3aba62){if(!_0x3aba62){_0x706430[_0x1ab5('0x1a')](0x194);}return _0x3aba62;};}function handleError(_0x467d69,_0x3d8c4e){_0x3d8c4e=_0x3d8c4e||0x1f4;return function(_0x467852){logger[_0x1ab5('0x2b')](_0x467852[_0x1ab5('0x2c')]);if(_0x467852[_0x1ab5('0x2d')]){delete _0x467852[_0x1ab5('0x2d')];}_0x467d69[_0x1ab5('0x1b')](_0x3d8c4e)['send'](_0x467852);};}exports[_0x1ab5('0x2e')]=function(_0x2628fe,_0x32b126){var _0x30c8c7={},_0x5bab89={},_0x325e22={'count':0x0,'rows':[]};var _0x4fb40a=_[_0x1ab5('0x2f')](db['Variable'][_0x1ab5('0x30')],function(_0x570196){return{'name':_0x570196[_0x1ab5('0x31')],'type':_0x570196['type'][_0x1ab5('0x32')]};});_0x5bab89[_0x1ab5('0x33')]=_[_0x1ab5('0x2f')](_0x4fb40a,_0x1ab5('0x2d'));_0x5bab89['query']=_[_0x1ab5('0x34')](_0x2628fe[_0x1ab5('0x35')]);_0x5bab89[_0x1ab5('0x36')]=_[_0x1ab5('0x37')](_0x5bab89[_0x1ab5('0x33')],_0x5bab89[_0x1ab5('0x35')]);_0x30c8c7[_0x1ab5('0x38')]=_[_0x1ab5('0x37')](_0x5bab89[_0x1ab5('0x33')],qs[_0x1ab5('0x39')](_0x2628fe[_0x1ab5('0x35')][_0x1ab5('0x39')]));_0x30c8c7[_0x1ab5('0x38')]=_0x30c8c7[_0x1ab5('0x38')][_0x1ab5('0x3a')]?_0x30c8c7[_0x1ab5('0x38')]:_0x5bab89[_0x1ab5('0x33')];if(!_0x2628fe[_0x1ab5('0x35')][_0x1ab5('0x3b')](_0x1ab5('0x3c'))){_0x30c8c7[_0x1ab5('0x1f')]=qs[_0x1ab5('0x1f')](_0x2628fe[_0x1ab5('0x35')][_0x1ab5('0x1f')]);_0x30c8c7[_0x1ab5('0x21')]=qs[_0x1ab5('0x21')](_0x2628fe[_0x1ab5('0x35')]['offset']);}_0x30c8c7[_0x1ab5('0x3d')]=qs[_0x1ab5('0x3e')](_0x2628fe[_0x1ab5('0x35')][_0x1ab5('0x3e')]);_0x30c8c7[_0x1ab5('0x3f')]=qs[_0x1ab5('0x36')](_['pick'](_0x2628fe['query'],_0x5bab89['filters']),_0x4fb40a);if(_0x2628fe['query'][_0x1ab5('0x40')]){_0x30c8c7[_0x1ab5('0x3f')]=_['merge'](_0x30c8c7['where'],{'$or':_['map'](_0x4fb40a,function(_0x16e17a){if(_0x16e17a['type']!==_0x1ab5('0x41')){var _0x660121={};_0x660121[_0x16e17a['name']]={'$like':'%'+_0x2628fe[_0x1ab5('0x35')]['filter']+'%'};return _0x660121;}})});}_0x30c8c7=_['merge']({},_0x30c8c7,_0x2628fe['options']);var _0x5dd012={'where':_0x30c8c7['where']};return db[_0x1ab5('0x42')][_0x1ab5('0x20')](_0x5dd012)[_0x1ab5('0x26')](function(_0x13357f){_0x325e22[_0x1ab5('0x20')]=_0x13357f;if(_0x2628fe[_0x1ab5('0x35')]['includeAll']){_0x30c8c7[_0x1ab5('0x43')]=[{'all':!![]}];}return db[_0x1ab5('0x42')][_0x1ab5('0x44')](_0x30c8c7);})[_0x1ab5('0x26')](function(_0x57ae77){_0x325e22[_0x1ab5('0x45')]=_0x57ae77;return _0x325e22;})['then'](respondWithFilteredResult(_0x32b126,_0x30c8c7))[_0x1ab5('0x46')](handleError(_0x32b126,null));};exports[_0x1ab5('0x47')]=function(_0x30b8e9,_0x40293d){var _0x26c6cb={'raw':!![],'where':{'id':_0x30b8e9[_0x1ab5('0x48')]['id']}},_0xc7dea7={};_0xc7dea7['model']=_[_0x1ab5('0x34')](db[_0x1ab5('0x42')]['rawAttributes']);_0xc7dea7['query']=_[_0x1ab5('0x34')](_0x30b8e9[_0x1ab5('0x35')]);_0xc7dea7[_0x1ab5('0x36')]=_[_0x1ab5('0x37')](_0xc7dea7['model'],_0xc7dea7['query']);_0x26c6cb[_0x1ab5('0x38')]=_['intersection'](_0xc7dea7[_0x1ab5('0x33')],qs['fields'](_0x30b8e9[_0x1ab5('0x35')][_0x1ab5('0x39')]));_0x26c6cb[_0x1ab5('0x38')]=_0x26c6cb['attributes'][_0x1ab5('0x3a')]?_0x26c6cb['attributes']:_0xc7dea7['model'];if(_0x30b8e9[_0x1ab5('0x35')]['includeAll']){_0x26c6cb[_0x1ab5('0x43')]=[{'all':!![]}];}_0x26c6cb=_[_0x1ab5('0x49')]({},_0x26c6cb,_0x30b8e9['options']);return db['Variable'][_0x1ab5('0x4a')](_0x26c6cb)['then'](handleEntityNotFound(_0x40293d,null))[_0x1ab5('0x26')](respondWithResult(_0x40293d,null))[_0x1ab5('0x46')](handleError(_0x40293d,null));};exports[_0x1ab5('0x4b')]=function(_0x98bc8c,_0x4bc4fe){return db['Variable'][_0x1ab5('0x4b')](_0x98bc8c['body'],{})[_0x1ab5('0x26')](function(_0x287bea){var _0x323552=_0x98bc8c['user']['get']({'plain':!![]});if(!_0x323552)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x323552[_0x1ab5('0x4c')]===_0x1ab5('0x4d')){var _0x11b793=_0x287bea[_0x1ab5('0x27')]({'plain':!![]});var _0x237796=_0x1ab5('0x28');return db['UserProfileSection'][_0x1ab5('0x4a')]({'where':{'name':_0x237796,'userProfileId':_0x323552[_0x1ab5('0x4e')]},'raw':!![]})['then'](function(_0x43f4b4){if(_0x43f4b4&&_0x43f4b4[_0x1ab5('0x4f')]===0x0){return db[_0x1ab5('0x29')][_0x1ab5('0x4b')]({'name':_0x11b793[_0x1ab5('0x2d')],'resourceId':_0x11b793['id'],'type':_0x43f4b4[_0x1ab5('0x2d')],'sectionId':_0x43f4b4['id']},{})[_0x1ab5('0x26')](function(){return _0x287bea;});}else{return _0x287bea;}})['catch'](function(_0x8abf7){logger[_0x1ab5('0x2b')](_0x1ab5('0x50'),_0x8abf7);throw _0x8abf7;});}return _0x287bea;})['then'](respondWithResult(_0x4bc4fe,0xc9))[_0x1ab5('0x46')](handleError(_0x4bc4fe,null));};exports[_0x1ab5('0x51')]=function(_0x50b7db,_0x57a4ff){if(_0x50b7db[_0x1ab5('0x52')]['id']){delete _0x50b7db['body']['id'];}return db['Variable'][_0x1ab5('0x4a')]({'where':{'id':_0x50b7db[_0x1ab5('0x48')]['id']}})[_0x1ab5('0x26')](handleEntityNotFound(_0x57a4ff,null))[_0x1ab5('0x26')](saveUpdates(_0x50b7db['body'],null))[_0x1ab5('0x26')](respondWithResult(_0x57a4ff,null))[_0x1ab5('0x46')](handleError(_0x57a4ff,null));};exports[_0x1ab5('0x2a')]=function(_0x5e2066,_0x23da5d){return db[_0x1ab5('0x42')][_0x1ab5('0x4a')]({'where':{'id':_0x5e2066['params']['id']}})[_0x1ab5('0x26')](handleEntityNotFound(_0x23da5d,null))[_0x1ab5('0x26')](removeEntity(_0x23da5d,null))[_0x1ab5('0x46')](handleError(_0x23da5d,null));}; \ No newline at end of file +var _0x5c2a=['error','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','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','find','userProfileId','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c2a,0x102));var _0xa5c2=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0x5c2a[_0x229128];return _0x1875b9;};'use strict';var emlformat=require(_0xa5c2('0x0'));var rimraf=require(_0xa5c2('0x1'));var zipdir=require(_0xa5c2('0x2'));var jsonpatch=require(_0xa5c2('0x3'));var rp=require(_0xa5c2('0x4'));var moment=require(_0xa5c2('0x5'));var BPromise=require(_0xa5c2('0x6'));var Mustache=require(_0xa5c2('0x7'));var util=require('util');var path=require(_0xa5c2('0x8'));var sox=require(_0xa5c2('0x9'));var csv=require(_0xa5c2('0xa'));var ejs=require(_0xa5c2('0xb'));var fs=require('fs');var fs_extra=require(_0xa5c2('0xc'));var _=require('lodash');var squel=require(_0xa5c2('0xd'));var crypto=require(_0xa5c2('0xe'));var jsforce=require(_0xa5c2('0xf'));var deskjs=require(_0xa5c2('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa5c2('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa5c2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa5c2('0x13'));var hardwareService=require(_0xa5c2('0x14'));var logger=require('../../config/logger')(_0xa5c2('0x15'));var utils=require(_0xa5c2('0x16'));var config=require(_0xa5c2('0x17'));var licenseUtil=require(_0xa5c2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25383c,_0x156103){_0x156103=_0x156103||0xcc;return function(_0xdd1d7d){if(_0xdd1d7d){return _0x25383c[_0xa5c2('0x19')](_0x156103);}return _0x25383c[_0xa5c2('0x1a')](_0x156103)[_0xa5c2('0x1b')]();};}function respondWithResult(_0xcd4fc,_0x44b99a){_0x44b99a=_0x44b99a||0xc8;return function(_0x3019c0){if(_0x3019c0){return _0xcd4fc[_0xa5c2('0x1a')](_0x44b99a)[_0xa5c2('0x1c')](_0x3019c0);}};}function respondWithFilteredResult(_0x27c276,_0x520e7a){return function(_0x411b3e){if(_0x411b3e){var _0x2639f9=typeof _0x520e7a['offset']===_0xa5c2('0x1d')&&typeof _0x520e7a[_0xa5c2('0x1e')]==='undefined';var _0x2d90ba=_0x411b3e[_0xa5c2('0x1f')];var _0x25595e=_0x2639f9?0x0:_0x520e7a[_0xa5c2('0x20')];var _0xc77d=_0x2639f9?_0x411b3e['count']:_0x520e7a[_0xa5c2('0x20')]+_0x520e7a[_0xa5c2('0x1e')];var _0x46f914;if(_0xc77d>=_0x2d90ba){_0xc77d=_0x2d90ba;_0x46f914=0xc8;}else{_0x46f914=0xce;}_0x27c276['status'](_0x46f914);return _0x27c276[_0xa5c2('0x21')](_0xa5c2('0x22'),_0x25595e+'-'+_0xc77d+'/'+_0x2d90ba)['json'](_0x411b3e);}return null;};}function patchUpdates(_0x21705f){return function(_0xb00c31){try{jsonpatch[_0xa5c2('0x23')](_0xb00c31,_0x21705f,!![]);}catch(_0x497eca){return BPromise[_0xa5c2('0x24')](_0x497eca);}return _0xb00c31[_0xa5c2('0x25')]();};}function saveUpdates(_0x3894d1,_0x3ce818){return function(_0x5838f6){if(_0x5838f6){return _0x5838f6[_0xa5c2('0x26')](_0x3894d1)['then'](function(_0x5d073d){return _0x5d073d;});}return null;};}function removeEntity(_0x40a895,_0x578be0){return function(_0x5f1ed2){if(_0x5f1ed2){return _0x5f1ed2[_0xa5c2('0x27')]()[_0xa5c2('0x28')](function(){var _0x280a53=_0x5f1ed2[_0xa5c2('0x29')]({'plain':!![]});var _0x475d7b='Variables';return db['UserProfileResource'][_0xa5c2('0x27')]({'where':{'type':_0x475d7b,'resourceId':_0x280a53['id']}})['then'](function(){return _0x5f1ed2;});})['then'](function(){_0x40a895[_0xa5c2('0x1a')](0xcc)[_0xa5c2('0x1b')]();});}};}function handleEntityNotFound(_0x5c32b0,_0x42a4e2){return function(_0x4b2339){if(!_0x4b2339){_0x5c32b0[_0xa5c2('0x19')](0x194);}return _0x4b2339;};}function handleError(_0x61d2ba,_0x5a6cdb){_0x5a6cdb=_0x5a6cdb||0x1f4;return function(_0x433209){logger['error'](_0x433209[_0xa5c2('0x2a')]);if(_0x433209['name']){delete _0x433209[_0xa5c2('0x2b')];}_0x61d2ba[_0xa5c2('0x1a')](_0x5a6cdb)[_0xa5c2('0x2c')](_0x433209);};}exports[_0xa5c2('0x2d')]=function(_0x3fd017,_0x15d6d3){var _0x588e00={},_0x564fde={},_0x13f4d0={'count':0x0,'rows':[]};var _0x30cac1=_[_0xa5c2('0x2e')](db[_0xa5c2('0x2f')][_0xa5c2('0x30')],function(_0x5cad14){return{'name':_0x5cad14[_0xa5c2('0x31')],'type':_0x5cad14[_0xa5c2('0x32')][_0xa5c2('0x33')]};});_0x564fde[_0xa5c2('0x34')]=_['map'](_0x30cac1,'name');_0x564fde[_0xa5c2('0x35')]=_[_0xa5c2('0x36')](_0x3fd017['query']);_0x564fde[_0xa5c2('0x37')]=_[_0xa5c2('0x38')](_0x564fde[_0xa5c2('0x34')],_0x564fde[_0xa5c2('0x35')]);_0x588e00[_0xa5c2('0x39')]=_[_0xa5c2('0x38')](_0x564fde[_0xa5c2('0x34')],qs[_0xa5c2('0x3a')](_0x3fd017[_0xa5c2('0x35')][_0xa5c2('0x3a')]));_0x588e00[_0xa5c2('0x39')]=_0x588e00[_0xa5c2('0x39')][_0xa5c2('0x3b')]?_0x588e00[_0xa5c2('0x39')]:_0x564fde[_0xa5c2('0x34')];if(!_0x3fd017[_0xa5c2('0x35')]['hasOwnProperty'](_0xa5c2('0x3c'))){_0x588e00['limit']=qs[_0xa5c2('0x1e')](_0x3fd017[_0xa5c2('0x35')][_0xa5c2('0x1e')]);_0x588e00[_0xa5c2('0x20')]=qs[_0xa5c2('0x20')](_0x3fd017[_0xa5c2('0x35')]['offset']);}_0x588e00[_0xa5c2('0x3d')]=qs[_0xa5c2('0x3e')](_0x3fd017[_0xa5c2('0x35')][_0xa5c2('0x3e')]);_0x588e00[_0xa5c2('0x3f')]=qs[_0xa5c2('0x37')](_['pick'](_0x3fd017[_0xa5c2('0x35')],_0x564fde[_0xa5c2('0x37')]),_0x30cac1);if(_0x3fd017[_0xa5c2('0x35')][_0xa5c2('0x40')]){_0x588e00[_0xa5c2('0x3f')]=_[_0xa5c2('0x41')](_0x588e00['where'],{'$or':_[_0xa5c2('0x2e')](_0x30cac1,function(_0x467faa){if(_0x467faa[_0xa5c2('0x32')]!=='VIRTUAL'){var _0x4aa277={};_0x4aa277[_0x467faa[_0xa5c2('0x2b')]]={'$like':'%'+_0x3fd017[_0xa5c2('0x35')]['filter']+'%'};return _0x4aa277;}})});}_0x588e00=_[_0xa5c2('0x41')]({},_0x588e00,_0x3fd017['options']);var _0x3c62fa={'where':_0x588e00[_0xa5c2('0x3f')]};return db[_0xa5c2('0x2f')]['count'](_0x3c62fa)['then'](function(_0x762d4){_0x13f4d0[_0xa5c2('0x1f')]=_0x762d4;if(_0x3fd017['query'][_0xa5c2('0x42')]){_0x588e00[_0xa5c2('0x43')]=[{'all':!![]}];}return db[_0xa5c2('0x2f')][_0xa5c2('0x44')](_0x588e00);})[_0xa5c2('0x28')](function(_0xe3022a){_0x13f4d0['rows']=_0xe3022a;return _0x13f4d0;})['then'](respondWithFilteredResult(_0x15d6d3,_0x588e00))[_0xa5c2('0x45')](handleError(_0x15d6d3,null));};exports[_0xa5c2('0x46')]=function(_0x2ddde8,_0x4aa3fb){var _0x40a9ca={'raw':!![],'where':{'id':_0x2ddde8[_0xa5c2('0x47')]['id']}},_0x1d5027={};_0x1d5027[_0xa5c2('0x34')]=_['keys'](db[_0xa5c2('0x2f')][_0xa5c2('0x30')]);_0x1d5027['query']=_[_0xa5c2('0x36')](_0x2ddde8[_0xa5c2('0x35')]);_0x1d5027[_0xa5c2('0x37')]=_['intersection'](_0x1d5027[_0xa5c2('0x34')],_0x1d5027['query']);_0x40a9ca[_0xa5c2('0x39')]=_[_0xa5c2('0x38')](_0x1d5027[_0xa5c2('0x34')],qs['fields'](_0x2ddde8[_0xa5c2('0x35')][_0xa5c2('0x3a')]));_0x40a9ca[_0xa5c2('0x39')]=_0x40a9ca[_0xa5c2('0x39')]['length']?_0x40a9ca[_0xa5c2('0x39')]:_0x1d5027[_0xa5c2('0x34')];if(_0x2ddde8[_0xa5c2('0x35')]['includeAll']){_0x40a9ca['include']=[{'all':!![]}];}_0x40a9ca=_[_0xa5c2('0x41')]({},_0x40a9ca,_0x2ddde8[_0xa5c2('0x48')]);return db[_0xa5c2('0x2f')]['find'](_0x40a9ca)[_0xa5c2('0x28')](handleEntityNotFound(_0x4aa3fb,null))[_0xa5c2('0x28')](respondWithResult(_0x4aa3fb,null))[_0xa5c2('0x45')](handleError(_0x4aa3fb,null));};exports['create']=function(_0x3e72b3,_0x4c63a1){return db['Variable'][_0xa5c2('0x49')](_0x3e72b3['body'],{})['then'](function(_0x39751a){var _0x2ad758=_0x3e72b3[_0xa5c2('0x4a')][_0xa5c2('0x29')]({'plain':!![]});if(!_0x2ad758)throw new Error(_0xa5c2('0x4b'));if(_0x2ad758[_0xa5c2('0x4c')]===_0xa5c2('0x4a')){var _0x153432=_0x39751a['get']({'plain':!![]});var _0x3d555a=_0xa5c2('0x4d');return db[_0xa5c2('0x4e')][_0xa5c2('0x4f')]({'where':{'name':_0x3d555a,'userProfileId':_0x2ad758[_0xa5c2('0x50')]},'raw':!![]})[_0xa5c2('0x28')](function(_0x182e30){if(_0x182e30&&_0x182e30['autoAssociation']===0x0){return db[_0xa5c2('0x51')]['create']({'name':_0x153432[_0xa5c2('0x2b')],'resourceId':_0x153432['id'],'type':_0x182e30[_0xa5c2('0x2b')],'sectionId':_0x182e30['id']},{})['then'](function(){return _0x39751a;});}else{return _0x39751a;}})['catch'](function(_0x591680){logger[_0xa5c2('0x52')](_0xa5c2('0x53'),_0x591680);throw _0x591680;});}return _0x39751a;})['then'](respondWithResult(_0x4c63a1,0xc9))['catch'](handleError(_0x4c63a1,null));};exports[_0xa5c2('0x26')]=function(_0xe4363,_0x47ce11){if(_0xe4363[_0xa5c2('0x54')]['id']){delete _0xe4363[_0xa5c2('0x54')]['id'];}return db['Variable'][_0xa5c2('0x4f')]({'where':{'id':_0xe4363['params']['id']}})[_0xa5c2('0x28')](handleEntityNotFound(_0x47ce11,null))[_0xa5c2('0x28')](saveUpdates(_0xe4363[_0xa5c2('0x54')],null))[_0xa5c2('0x28')](respondWithResult(_0x47ce11,null))['catch'](handleError(_0x47ce11,null));};exports[_0xa5c2('0x27')]=function(_0x4b5c44,_0x4171f6){return db[_0xa5c2('0x2f')][_0xa5c2('0x4f')]({'where':{'id':_0x4b5c44[_0xa5c2('0x47')]['id']}})[_0xa5c2('0x28')](handleEntityNotFound(_0x4171f6,null))[_0xa5c2('0x28')](removeEntity(_0x4171f6,null))[_0xa5c2('0x45')](handleError(_0x4171f6,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5885c8f..5abc0bb 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 _0x1b4e=['Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x3c26a,_0xf1e2d8){var _0xb03c48=function(_0x17a417){while(--_0x17a417){_0x3c26a['push'](_0x3c26a['shift']());}};_0xb03c48(++_0xf1e2d8);}(_0x1b4e,0xc6));var _0xe1b4=function(_0x5903dc,_0x24cf29){_0x5903dc=_0x5903dc-0x0;var _0x1653de=_0x1b4e[_0x5903dc];return _0x1653de;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var logger=require(_0xe1b4('0x2'))(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var BPromise=require(_0xe1b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1b4('0x6'));var rimraf=require(_0xe1b4('0x7'));var config=require(_0xe1b4('0x8'));var attributes=require(_0xe1b4('0x9'));module[_0xe1b4('0xa')]=function(_0x3d734d,_0x42dd2d){return _0x3d734d[_0xe1b4('0xb')](_0xe1b4('0xc'),attributes,{'tableName':_0xe1b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1e7=['../../config/environment','exports','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e60f9,_0x4c7637){var _0x4af1f3=function(_0x10224d){while(--_0x10224d){_0x2e60f9['push'](_0x2e60f9['shift']());}};_0x4af1f3(++_0x4c7637);}(_0xa1e7,0x1d8));var _0x7a1e=function(_0x59b2bd,_0x35bdce){_0x59b2bd=_0x59b2bd-0x0;var _0x2f5c7c=_0xa1e7[_0x59b2bd];return _0x2f5c7c;};'use strict';var _=require(_0x7a1e('0x0'));var util=require('util');var logger=require(_0x7a1e('0x1'))(_0x7a1e('0x2'));var moment=require(_0x7a1e('0x3'));var BPromise=require(_0x7a1e('0x4'));var rp=require(_0x7a1e('0x5'));var fs=require('fs');var path=require(_0x7a1e('0x6'));var rimraf=require(_0x7a1e('0x7'));var config=require(_0x7a1e('0x8'));var attributes=require('./variable.attributes');module[_0x7a1e('0x9')]=function(_0x17be5d,_0x301ccd){return _0x17be5d['define'](_0x7a1e('0xa'),attributes,{'tableName':_0x7a1e('0xb'),'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 1a31bfb..2532ea4 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa41a,0x6b));var _0xaa41=function(_0x2d5f44,_0x9af851){_0x2d5f44=_0x2d5f44-0x0;var _0x23d3e9=_0xa41a[_0x2d5f44];return _0x23d3e9;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xa41a,0x6b));var _0xaa41=function(_0x2cd282,_0x3cf642){_0x2cd282=_0x2cd282-0x0;var _0x838bdd=_0xa41a[_0x2cd282];return _0x838bdd;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f39bdfd..3d38f20 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 _0x1e0e=['pull','restart','/migrations','exports','express','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x4ffbd2,_0x41000){var _0xea9c5b=function(_0x2bfbba){while(--_0x2bfbba){_0x4ffbd2['push'](_0x4ffbd2['shift']());}};_0xea9c5b(++_0x41000);}(_0x1e0e,0x15d));var _0xe1e0=function(_0x52a181,_0x17720e){_0x52a181=_0x52a181-0x0;var _0x46ef87=_0x1e0e[_0x52a181];return _0x46ef87;};'use strict';var express=require(_0xe1e0('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe1e0('0x1'));router[_0xe1e0('0x2')]('/',controller[_0xe1e0('0x3')]);router[_0xe1e0('0x2')](_0xe1e0('0x4'),auth[_0xe1e0('0x5')](),auth[_0xe1e0('0x6')](),controller[_0xe1e0('0x7')]);router[_0xe1e0('0x2')](_0xe1e0('0x8'),auth[_0xe1e0('0x5')](),auth['canUpdate'](),controller[_0xe1e0('0x9')]);router[_0xe1e0('0x2')](_0xe1e0('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xe1e0('0xb')]);router['get']('/restart',auth[_0xe1e0('0x5')](),controller[_0xe1e0('0xc')]);router[_0xe1e0('0x2')](_0xe1e0('0xd'),controller['migrations']);module[_0xe1e0('0xe')]=router; \ No newline at end of file +var _0xd51b=['isAuthenticated','canUpdate','fetch','/pull','/restart','migrations','express','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x30d6cc,_0x5381ac){var _0x2e8690=function(_0x55e776){while(--_0x55e776){_0x30d6cc['push'](_0x30d6cc['shift']());}};_0x2e8690(++_0x5381ac);}(_0xd51b,0x158));var _0xbd51=function(_0x2b7952,_0x1c938c){_0x2b7952=_0x2b7952-0x0;var _0x57bd90=_0xd51b[_0x2b7952];return _0x57bd90;};'use strict';var express=require(_0xbd51('0x0'));var router=express[_0xbd51('0x1')]();var auth=require(_0xbd51('0x2'));var controller=require(_0xbd51('0x3'));router[_0xbd51('0x4')]('/',controller[_0xbd51('0x5')]);router[_0xbd51('0x4')](_0xbd51('0x6'),auth[_0xbd51('0x7')](),auth[_0xbd51('0x8')](),controller[_0xbd51('0x9')]);router[_0xbd51('0x4')]('/reset',auth[_0xbd51('0x7')](),auth[_0xbd51('0x8')](),controller['reset']);router[_0xbd51('0x4')](_0xbd51('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0xbd51('0x4')](_0xbd51('0xb'),auth['isAuthenticated'](),controller['restart']);router['get']('/migrations',controller[_0xbd51('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4de4486..4f013ac 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 _0xb3c0=['git\x20fetch','git\x20fetch\x20origin\x20master','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sequelize','Migration','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','index','exports','query','latest','tags','status','json','fetch','origin','master','error','info'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xb3c0,0x1dd));var _0x0b3c=function(_0x13a576,_0x5afb5b){_0x13a576=_0x13a576-0x0;var _0x7128b4=_0xb3c0[_0x13a576];return _0x7128b4;};'use strict';var Umzug=require(_0x0b3c('0x0'));var path=require(_0x0b3c('0x1'));var fs=require('fs');var _=require(_0x0b3c('0x2'));var pkginfo=require(_0x0b3c('0x3'))(module,_0x0b3c('0x4'));var compareVersions=require(_0x0b3c('0x5'));var exec=require('child_process')['exec'];var db=require(_0x0b3c('0x6'))['db'];var config=require(_0x0b3c('0x7'));var pm2=require(_0x0b3c('0x8'));var logger=require(_0x0b3c('0x9'))('update');var git=require('simple-git')(config[_0x0b3c('0xa')]);exports[_0x0b3c('0xb')]=function(_0x5e780e,_0x20bff2){var _0x124822={'current':module[_0x0b3c('0xc')][_0x0b3c('0x4')],'phonebar':0x2};if(_0x5e780e['query']&&_0x5e780e[_0x0b3c('0xd')][_0x0b3c('0xe')]){return git['fetch']()[_0x0b3c('0xf')](function(_0x352f5c,_0x19f5d4){_0x124822[_0x0b3c('0xe')]=(_0x352f5c?module[_0x0b3c('0xc')][_0x0b3c('0x4')]:_0x19f5d4[_0x0b3c('0xe')])||'2.0.0';return _0x20bff2[_0x0b3c('0x10')](0xc8)[_0x0b3c('0x11')](_0x124822);});}else{return _0x20bff2['status'](0xc8)['json'](_0x124822);}};exports['fetch']=function(_0x59d82f,_0x290568){return git[_0x0b3c('0x12')]([_0x0b3c('0x13'),_0x0b3c('0x14')],function(_0x36e1c8){if(_0x36e1c8){logger[_0x0b3c('0x15')](_0x36e1c8);return _0x290568[_0x0b3c('0x10')](0x1f4)[_0x0b3c('0x11')](_0x36e1c8);}logger[_0x0b3c('0x16')](_0x0b3c('0x17'));return _0x290568[_0x0b3c('0x10')](0xc8)[_0x0b3c('0x11')]({'output':_0x0b3c('0x18')});});};exports['reset']=function(_0x102771,_0x1bf3f7){return git['reset'](['--hard',_0x0b3c('0x19')],function(_0x226c5a){if(_0x226c5a){logger['error'](_0x226c5a);return _0x1bf3f7[_0x0b3c('0x10')](0x1f4)[_0x0b3c('0x11')](_0x226c5a);}logger[_0x0b3c('0x16')](_0x0b3c('0x1a'));return _0x1bf3f7[_0x0b3c('0x10')](0xc8)[_0x0b3c('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x0b3c('0x1b')]=function(_0x2f15e4,_0x312e6b){exec(_0x0b3c('0x1c'),function(_0x4f4dbf,_0x2887c2,_0x3ab3bc){logger[_0x0b3c('0x16')](_0x2887c2);logger[_0x0b3c('0x16')](_0x3ab3bc);if(_0x4f4dbf){logger[_0x0b3c('0x15')](_0x4f4dbf);return _0x312e6b[_0x0b3c('0x10')](0x1f4)[_0x0b3c('0x11')](_0x4f4dbf);}return _0x312e6b[_0x0b3c('0x10')](0xc8)[_0x0b3c('0x11')]({'output':_0x2887c2});});};exports[_0x0b3c('0x1d')]=function(_0x1ed970,_0x1c3351){return pm2[_0x0b3c('0x1d')]('motion2')[_0x0b3c('0x1e')](function(_0x35e222){logger[_0x0b3c('0x16')](_0x0b3c('0x1f'),_0x35e222);return _0x1c3351['status'](0xc8)[_0x0b3c('0x11')]({'output':_0x0b3c('0x20')});})[_0x0b3c('0x21')](function(_0x230dc1){logger[_0x0b3c('0x15')](_0x230dc1);return _0x1c3351['status'](0x1f4)[_0x0b3c('0x11')](_0x230dc1);});};exports[_0x0b3c('0x22')]=function(_0x36e6ac,_0x585ea5){var _0x546f5a=fs[_0x0b3c('0x23')](path[_0x0b3c('0x24')](config[_0x0b3c('0xa')],_0x0b3c('0x25'),_0x0b3c('0x22')));var _0x1649cf=[];for(var _0xf9ef2b=0x0;_0xf9ef2b<_0x546f5a[_0x0b3c('0x26')];_0xf9ef2b++){var _0x3bdb3d=_0x546f5a[_0xf9ef2b]['replace'](_0x0b3c('0x27'),'');if(compareVersions(module[_0x0b3c('0xc')]['version'],_0x3bdb3d)===-0x1){_0x1649cf[_0x0b3c('0x28')](_0x3bdb3d);}}if(_0x1649cf['length']){var _0x578783=_0x1649cf['sort'](compareVersions);var _0xbc27f9=new Umzug({'storage':_0x0b3c('0x29'),'storageOptions':{'model':db[_0x0b3c('0x2a')],'modelName':_0x0b3c('0x2a'),'columnName':_0x0b3c('0x4')},'migrations':{'params':[db[_0x0b3c('0x29')][_0x0b3c('0x2b')](),db[_0x0b3c('0x29')][_0x0b3c('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x0b3c('0x24')](config[_0x0b3c('0xa')],_0x0b3c('0x25'),_0x0b3c('0x22')),'pattern':/\.js$/}});_0xbc27f9['up']({'migrations':_[_0x0b3c('0x2d')](_0x578783,function(_0x11cd01){return _0x11cd01+_0x0b3c('0x27');})})[_0x0b3c('0x1e')](function(){return _0x585ea5['status'](0xc8)['json']({'output':_0x0b3c('0x2e')+module['exports'][_0x0b3c('0x4')]+'\x20to\x20'+_[_0x0b3c('0x2f')](_0x578783),'migrations':_[_0x0b3c('0x24')](_0x578783)});})['catch'](function(_0x450f16){if(_0x450f16 instanceof db[_0x0b3c('0x29')][_0x0b3c('0x30')]){return _0x585ea5[_0x0b3c('0x10')](0xc8)['json']({'output':_0x0b3c('0x31')});}else{return _0x585ea5['status'](0x1f4)[_0x0b3c('0x11')](_0x450f16);}});}else{return _0x585ea5['status'](0xc8)[_0x0b3c('0x11')]({'output':_0x0b3c('0x31')});}}; \ No newline at end of file +var _0xcf94=['json','fetch','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','server','migrations','length','.js','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','../../mysqldb','simple-git','index','exports','query','latest','2.0.0','status'];(function(_0x2d8b4a,_0x16c00e){var _0x1d50e3=function(_0x286e18){while(--_0x286e18){_0x2d8b4a['push'](_0x2d8b4a['shift']());}};_0x1d50e3(++_0x16c00e);}(_0xcf94,0x1dc));var _0x4cf9=function(_0x1993e3,_0x5e7177){_0x1993e3=_0x1993e3-0x0;var _0x239baa=_0xcf94[_0x1993e3];return _0x239baa;};'use strict';var Umzug=require(_0x4cf9('0x0'));var path=require(_0x4cf9('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x4cf9('0x2'))(module,_0x4cf9('0x3'));var compareVersions=require(_0x4cf9('0x4'));var exec=require(_0x4cf9('0x5'))['exec'];var db=require(_0x4cf9('0x6'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require('../../config/logger')('update');var git=require(_0x4cf9('0x7'))(config['root']);exports[_0x4cf9('0x8')]=function(_0x41464b,_0x529bb6){var _0x788171={'current':module[_0x4cf9('0x9')]['version'],'phonebar':0x2};if(_0x41464b['query']&&_0x41464b[_0x4cf9('0xa')][_0x4cf9('0xb')]){return git['fetch']()['tags'](function(_0x41b02c,_0x214115){_0x788171[_0x4cf9('0xb')]=(_0x41b02c?module[_0x4cf9('0x9')][_0x4cf9('0x3')]:_0x214115[_0x4cf9('0xb')])||_0x4cf9('0xc');return _0x529bb6[_0x4cf9('0xd')](0xc8)[_0x4cf9('0xe')](_0x788171);});}else{return _0x529bb6[_0x4cf9('0xd')](0xc8)['json'](_0x788171);}};exports[_0x4cf9('0xf')]=function(_0x3833f7,_0x236ca9){return git[_0x4cf9('0xf')]([_0x4cf9('0x10'),'master'],function(_0x3eed23){if(_0x3eed23){logger[_0x4cf9('0x11')](_0x3eed23);return _0x236ca9[_0x4cf9('0xd')](0x1f4)[_0x4cf9('0xe')](_0x3eed23);}logger['info'](_0x4cf9('0x12'));return _0x236ca9[_0x4cf9('0xd')](0xc8)[_0x4cf9('0xe')]({'output':_0x4cf9('0x13')});});};exports['reset']=function(_0x42010c,_0x5a0bd0){return git[_0x4cf9('0x14')]([_0x4cf9('0x15'),'FETCH_HEAD'],function(_0x57bb49){if(_0x57bb49){logger[_0x4cf9('0x11')](_0x57bb49);return _0x5a0bd0[_0x4cf9('0xd')](0x1f4)[_0x4cf9('0xe')](_0x57bb49);}logger[_0x4cf9('0x16')](_0x4cf9('0x17'));return _0x5a0bd0[_0x4cf9('0xd')](0xc8)[_0x4cf9('0xe')]({'output':'git\x20reset\x20--hard'});});};exports[_0x4cf9('0x18')]=function(_0x2cdcb0,_0x4d21d9){exec(_0x4cf9('0x19'),function(_0x2aeb05,_0x26c6bb,_0x1983b1){logger['info'](_0x26c6bb);logger[_0x4cf9('0x16')](_0x1983b1);if(_0x2aeb05){logger[_0x4cf9('0x11')](_0x2aeb05);return _0x4d21d9[_0x4cf9('0xd')](0x1f4)['json'](_0x2aeb05);}return _0x4d21d9[_0x4cf9('0xd')](0xc8)['json']({'output':_0x26c6bb});});};exports[_0x4cf9('0x1a')]=function(_0x330e9e,_0x1d64d5){return pm2['restart'](_0x4cf9('0x1b'))[_0x4cf9('0x1c')](function(_0x5d7dc4){logger[_0x4cf9('0x16')]('pm2\x20restart\x20motion\x20%s',_0x5d7dc4);return _0x1d64d5[_0x4cf9('0xd')](0xc8)[_0x4cf9('0xe')]({'output':_0x4cf9('0x1d')});})[_0x4cf9('0x1e')](function(_0xc1f27){logger[_0x4cf9('0x11')](_0xc1f27);return _0x1d64d5[_0x4cf9('0xd')](0x1f4)[_0x4cf9('0xe')](_0xc1f27);});};exports['migrations']=function(_0xd8e79d,_0x1ba24d){var _0x4f3248=fs[_0x4cf9('0x1f')](path[_0x4cf9('0x20')](config[_0x4cf9('0x21')],_0x4cf9('0x22'),_0x4cf9('0x23')));var _0x42c66c=[];for(var _0x40d3dc=0x0;_0x40d3dc<_0x4f3248[_0x4cf9('0x24')];_0x40d3dc++){var _0x5d843a=_0x4f3248[_0x40d3dc]['replace'](_0x4cf9('0x25'),'');if(compareVersions(module['exports'][_0x4cf9('0x3')],_0x5d843a)===-0x1){_0x42c66c['push'](_0x5d843a);}}if(_0x42c66c['length']){var _0x225525=_0x42c66c[_0x4cf9('0x26')](compareVersions);var _0x13a9dd=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x4cf9('0x27')],'modelName':'Migration','columnName':_0x4cf9('0x3')},'migrations':{'params':[db[_0x4cf9('0x28')][_0x4cf9('0x29')](),db['sequelize'][_0x4cf9('0x2a')],function(){throw new Error(_0x4cf9('0x2b'));}],'path':path[_0x4cf9('0x20')](config['root'],_0x4cf9('0x22'),'migrations'),'pattern':/\.js$/}});_0x13a9dd['up']({'migrations':_['map'](_0x225525,function(_0x516c7b){return _0x516c7b+_0x4cf9('0x25');})})[_0x4cf9('0x1c')](function(){return _0x1ba24d[_0x4cf9('0xd')](0xc8)['json']({'output':_0x4cf9('0x2c')+module[_0x4cf9('0x9')][_0x4cf9('0x3')]+_0x4cf9('0x2d')+_[_0x4cf9('0x2e')](_0x225525),'migrations':_[_0x4cf9('0x20')](_0x225525)});})[_0x4cf9('0x1e')](function(_0x285714){if(_0x285714 instanceof db[_0x4cf9('0x28')][_0x4cf9('0x2f')]){return _0x1ba24d[_0x4cf9('0xd')](0xc8)[_0x4cf9('0xe')]({'output':_0x4cf9('0x30')});}else{return _0x1ba24d[_0x4cf9('0xd')](0x1f4)[_0x4cf9('0xe')](_0x285714);}});}else{return _0x1ba24d[_0x4cf9('0xd')](0xc8)[_0x4cf9('0xe')]({'output':_0x4cf9('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7a89f16..a320a06 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 _0x978d=['post','create','put','destroy','util','path','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x978d,0x1e4));var _0xd978=function(_0x1743e7,_0x17cc22){_0x1743e7=_0x1743e7-0x0;var _0x26f3f7=_0x978d[_0x1743e7];return _0x26f3f7;};'use strict';var multer=require('multer');var util=require(_0xd978('0x0'));var path=require(_0xd978('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd978('0x2')]();var fs_extra=require(_0xd978('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd978('0x4'));var controller=require('./voiceAgentReport.controller');router[_0xd978('0x5')]('/',auth[_0xd978('0x6')](),controller[_0xd978('0x7')]);router[_0xd978('0x5')](_0xd978('0x8'),auth['isAuthenticated'](),controller[_0xd978('0x9')]);router[_0xd978('0x5')](_0xd978('0xa'),auth[_0xd978('0x6')](),controller[_0xd978('0xb')]);router[_0xd978('0xc')]('/',auth[_0xd978('0x6')](),controller[_0xd978('0xd')]);router[_0xd978('0xe')](_0xd978('0xa'),auth[_0xd978('0x6')](),controller['update']);router['delete'](_0xd978('0xa'),auth[_0xd978('0x6')](),controller[_0xd978('0xf')]);module['exports']=router; \ No newline at end of file +var _0x291d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0xdb951d,_0x1dc42b){var _0x5e789e=function(_0x1056cd){while(--_0x1056cd){_0xdb951d['push'](_0xdb951d['shift']());}};_0x5e789e(++_0x1dc42b);}(_0x291d,0xc1));var _0xd291=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x291d[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0xd291('0x0'));var util=require(_0xd291('0x1'));var path=require(_0xd291('0x2'));var timeout=require('connect-timeout');var express=require(_0xd291('0x3'));var router=express[_0xd291('0x4')]();var fs_extra=require(_0xd291('0x5'));var auth=require(_0xd291('0x6'));var interaction=require(_0xd291('0x7'));var config=require(_0xd291('0x8'));var controller=require(_0xd291('0x9'));router['get']('/',auth[_0xd291('0xa')](),controller[_0xd291('0xb')]);router['get'](_0xd291('0xc'),auth[_0xd291('0xa')](),controller[_0xd291('0xd')]);router['get'](_0xd291('0xe'),auth[_0xd291('0xa')](),controller[_0xd291('0xf')]);router[_0xd291('0x10')]('/',auth[_0xd291('0xa')](),controller[_0xd291('0x11')]);router[_0xd291('0x12')](_0xd291('0xe'),auth[_0xd291('0xa')](),controller[_0xd291('0x13')]);router[_0xd291('0x14')](_0xd291('0xe'),auth[_0xd291('0xa')](),controller[_0xd291('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a461227..b6b9ab8 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 _0x30fc=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x30fc,0x64));var _0xc30f=function(_0x1d2a1c,_0x16431c){_0x1d2a1c=_0x1d2a1c-0x0;var _0x5cbd69=_0x30fc[_0x1d2a1c];return _0x5cbd69;};'use strict';var Sequelize=require(_0xc30f('0x0'));module[_0xc30f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc30f('0x2')]},'calleridnum':{'type':Sequelize[_0xc30f('0x2')]},'calleridname':{'type':Sequelize[_0xc30f('0x2')]},'queue':{'type':Sequelize[_0xc30f('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc30f('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc30f('0x3')]},'agentconnectAt':{'type':Sequelize[_0xc30f('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xc30f('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xc30f('0x3')]},'agentdumpAt':{'type':Sequelize[_0xc30f('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xc30f('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc30f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc30f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc30f('0x5')]},'agentacw':{'type':Sequelize[_0xc30f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc30f('0x5')]},'reason':{'type':Sequelize[_0xc30f('0x2')]},'lastevent':{'type':Sequelize[_0xc30f('0x2')]},'channel':{'type':Sequelize[_0xc30f('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc30f('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc30f('0x2')]},'language':{'type':Sequelize[_0xc30f('0x2')]},'accountcode':{'type':Sequelize[_0xc30f('0x2')]},'context':{'type':Sequelize[_0xc30f('0x2')]},'exten':{'type':Sequelize[_0xc30f('0x2')]},'priority':{'type':Sequelize[_0xc30f('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xc30f('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc30f('0x2')]},'destcalleridname':{'type':Sequelize[_0xc30f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc30f('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xc30f('0x2')]},'destaccountcode':{'type':Sequelize[_0xc30f('0x2')]},'destcontext':{'type':Sequelize[_0xc30f('0x2')]},'destexten':{'type':Sequelize[_0xc30f('0x2')]},'destpriority':{'type':Sequelize[_0xc30f('0x2')]},'destuniqueid':{'type':Sequelize[_0xc30f('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc30f('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc30f('0x2')],'comment':_0xc30f('0x6')},'transferexten':{'type':Sequelize[_0xc30f('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc30f('0x2')]},'agententerreason':{'type':Sequelize[_0xc30f('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d0c=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x2da49c,_0x26f49a){var _0x2ccc5b=function(_0x2fe3bf){while(--_0x2fe3bf){_0x2da49c['push'](_0x2da49c['shift']());}};_0x2ccc5b(++_0x26f49a);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x1dd332,_0x252d90){_0x1dd332=_0x1dd332-0x0;var _0x558a3a=_0x6d0c[_0x1dd332];return _0x558a3a;};'use strict';var Sequelize=require(_0xc6d0('0x0'));module[_0xc6d0('0x1')]={'type':{'type':Sequelize[_0xc6d0('0x2')]},'uniqueid':{'type':Sequelize[_0xc6d0('0x2')]},'calleridnum':{'type':Sequelize[_0xc6d0('0x2')]},'calleridname':{'type':Sequelize[_0xc6d0('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc6d0('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xc6d0('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xc6d0('0x3')]},'holdtime':{'type':Sequelize[_0xc6d0('0x4')]},'agentcomplete':{'type':Sequelize[_0xc6d0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc6d0('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc6d0('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc6d0('0x4')]},'agentacw':{'type':Sequelize[_0xc6d0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc6d0('0x4')]},'reason':{'type':Sequelize[_0xc6d0('0x2')]},'lastevent':{'type':Sequelize[_0xc6d0('0x2')]},'channel':{'type':Sequelize[_0xc6d0('0x2')]},'channelstate':{'type':Sequelize[_0xc6d0('0x4')]},'channelstatedesc':{'type':Sequelize[_0xc6d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc6d0('0x2')]},'connectedlinename':{'type':Sequelize[_0xc6d0('0x2')]},'language':{'type':Sequelize[_0xc6d0('0x2')]},'accountcode':{'type':Sequelize[_0xc6d0('0x2')]},'context':{'type':Sequelize[_0xc6d0('0x2')]},'exten':{'type':Sequelize[_0xc6d0('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc6d0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xc6d0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc6d0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc6d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc6d0('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc6d0('0x2')]},'destexten':{'type':Sequelize[_0xc6d0('0x2')]},'destpriority':{'type':Sequelize[_0xc6d0('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc6d0('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xc6d0('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc6d0('0x2')],'comment':_0xc6d0('0x6')},'transferexten':{'type':Sequelize[_0xc6d0('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc6d0('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 0e15436..7bf9db9 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(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 0faf048..5a25c96 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 _0xc5c7=['request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x1eb7a1,_0x56182c){var _0x8dc48e=function(_0x3e693f){while(--_0x3e693f){_0x1eb7a1['push'](_0x1eb7a1['shift']());}};_0x8dc48e(++_0x56182c);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x1fefe6,_0x42d001){_0x1fefe6=_0x1fefe6-0x0;var _0x33e0e2=_0xc5c7[_0x1fefe6];return _0x33e0e2;};'use strict';var _=require('lodash');var util=require(_0x7c5c('0x0'));var logger=require(_0x7c5c('0x1'))(_0x7c5c('0x2'));var moment=require(_0x7c5c('0x3'));var BPromise=require(_0x7c5c('0x4'));var rp=require(_0x7c5c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c5c('0x6'));var config=require(_0x7c5c('0x7'));var attributes=require(_0x7c5c('0x8'));module[_0x7c5c('0x9')]=function(_0x1dc034,_0x4dd500){return _0x1dc034['define'](_0x7c5c('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x7c5c('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ba0=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x3d0c64,_0x4eb4fc){var _0x48d221=function(_0x435eb3){while(--_0x435eb3){_0x3d0c64['push'](_0x3d0c64['shift']());}};_0x48d221(++_0x4eb4fc);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x2f5a15,_0x304430){_0x2f5a15=_0x2f5a15-0x0;var _0x2e52f2=_0x8ba0[_0x2f5a15];return _0x2e52f2;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var logger=require(_0x08ba('0x2'))(_0x08ba('0x3'));var moment=require(_0x08ba('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08ba('0x5'));var rimraf=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var attributes=require(_0x08ba('0x8'));module[_0x08ba('0x9')]=function(_0x161a9d,_0x5f29fa){return _0x161a9d[_0x08ba('0xa')](_0x08ba('0xb'),attributes,{'tableName':_0x08ba('0xc'),'paranoid':![],'indexes':[{'fields':[_0x08ba('0xd'),_0x08ba('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 5d43593..8623fcc 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 _0xa74a=['error','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','then','update','options','raw','attributes','UpdateVoiceAgentReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2180be,_0x21bfaf){var _0x1bf2d=function(_0x3ca46b){while(--_0x3ca46b){_0x2180be['push'](_0x2180be['shift']());}};_0x1bf2d(++_0x21bfaf);}(_0xa74a,0x1ed));var _0xaa74=function(_0x475d36,_0x1873cc){_0x475d36=_0x475d36-0x0;var _0x56478f=_0xa74a[_0x475d36];return _0x56478f;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var moment=require(_0xaa74('0x2'));var BPromise=require(_0xaa74('0x3'));var rs=require(_0xaa74('0x4'));var fs=require('fs');var Redis=require(_0xaa74('0x5'));var db=require(_0xaa74('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa74('0x7'))(_0xaa74('0x8'));var config=require(_0xaa74('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa74('0xa')][_0xaa74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ece8a,_0x185655,_0x5d1c93){return new BPromise(function(_0x1e2217,_0x14eb9c){return client[_0xaa74('0xc')](_0x4ece8a,_0x5d1c93)['then'](function(_0x6213df){logger[_0xaa74('0xd')](_0xaa74('0xe'),_0x185655,_0xaa74('0xf'));logger[_0xaa74('0x10')](_0xaa74('0x11'),_0x185655,_0xaa74('0xf'),JSON[_0xaa74('0x12')](_0x6213df));if(_0x6213df[_0xaa74('0x13')]){if(_0x6213df['error']['code']===0x1f4){logger[_0xaa74('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x185655,_0x6213df[_0xaa74('0x13')][_0xaa74('0x14')]);return _0x14eb9c(_0x6213df['error']['message']);}logger['error'](_0xaa74('0xe'),_0x185655,_0x6213df['error'][_0xaa74('0x14')]);return _0x1e2217(_0x6213df[_0xaa74('0x13')][_0xaa74('0x14')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x185655,_0xaa74('0xf'));_0x1e2217(_0x6213df[_0xaa74('0x15')][_0xaa74('0x14')]);}})['catch'](function(_0x33d101){logger[_0xaa74('0x13')](_0xaa74('0xe'),_0x185655,_0x33d101);_0x14eb9c(_0x33d101);});});}exports[_0xaa74('0x16')]=function(_0x275eaf){var _0x17452c=this;return new Promise(function(_0x19c027,_0x563683){return db[_0xaa74('0x17')]['create'](_0x275eaf[_0xaa74('0x18')],{'raw':_0x275eaf['options']?_0x275eaf['options']['raw']===undefined?!![]:![]:!![]})[_0xaa74('0x19')](function(_0x42e68b){logger[_0xaa74('0xd')]('CreateVoiceAgentReport',_0x275eaf);logger['debug']('CreateVoiceAgentReport',_0x275eaf,JSON['stringify'](_0x42e68b));_0x19c027(_0x42e68b);})['catch'](function(_0x2d9f3f){logger[_0xaa74('0x13')]('CreateVoiceAgentReport',_0x2d9f3f['message'],_0x275eaf);_0x563683(_0x17452c[_0xaa74('0x13')](0x1f4,_0x2d9f3f[_0xaa74('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x752a69){var _0x3402a7=this;return new Promise(function(_0x55643c,_0x42a298){return db[_0xaa74('0x17')][_0xaa74('0x1a')](_0x752a69[_0xaa74('0x18')],{'raw':_0x752a69[_0xaa74('0x1b')]?_0x752a69[_0xaa74('0x1b')][_0xaa74('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x752a69['options']?_0x752a69[_0xaa74('0x1b')]['where']||null:null,'attributes':_0x752a69['options']?_0x752a69[_0xaa74('0x1b')][_0xaa74('0x1d')]||null:null,'limit':_0x752a69[_0xaa74('0x1b')]?_0x752a69[_0xaa74('0x1b')]['limit']||null:null})[_0xaa74('0x19')](function(_0x2112ac){logger[_0xaa74('0xd')]('UpdateVoiceAgentReport',_0x752a69);logger['debug'](_0xaa74('0x1e'),_0x752a69,JSON[_0xaa74('0x12')](_0x2112ac));_0x55643c(_0x2112ac);})[_0xaa74('0x1f')](function(_0x4db8cd){logger[_0xaa74('0x13')](_0xaa74('0x1e'),_0x4db8cd['message'],_0x752a69);_0x42a298(_0x3402a7['error'](0x1f4,_0x4db8cd[_0xaa74('0x14')]));});});}; \ No newline at end of file +var _0xf402=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent'];(function(_0x3e029,_0xde808a){var _0x111402=function(_0x1ed37f){while(--_0x1ed37f){_0x3e029['push'](_0x3e029['shift']());}};_0x111402(++_0xde808a);}(_0xf402,0x1e9));var _0x2f40=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf402[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x2f40('0x0'));var util=require(_0x2f40('0x1'));var moment=require(_0x2f40('0x2'));var BPromise=require(_0x2f40('0x3'));var rs=require(_0x2f40('0x4'));var fs=require('fs');var Redis=require(_0x2f40('0x5'));var db=require(_0x2f40('0x6'))['db'];var utils=require(_0x2f40('0x7'));var logger=require(_0x2f40('0x8'))(_0x2f40('0x9'));var config=require(_0x2f40('0xa'));var jayson=require(_0x2f40('0xb'));var client=jayson['client'][_0x2f40('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20d57f,_0x2aef56,_0x3301d8){return new BPromise(function(_0x2362e4,_0x439711){return client['request'](_0x20d57f,_0x3301d8)['then'](function(_0x359dba){logger[_0x2f40('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x2aef56,_0x2f40('0xe'));logger[_0x2f40('0xf')](_0x2f40('0x10'),_0x2aef56,_0x2f40('0xe'),JSON['stringify'](_0x359dba));if(_0x359dba['error']){if(_0x359dba[_0x2f40('0x11')][_0x2f40('0x12')]===0x1f4){logger[_0x2f40('0x11')](_0x2f40('0x13'),_0x2aef56,_0x359dba[_0x2f40('0x11')]['message']);return _0x439711(_0x359dba['error'][_0x2f40('0x14')]);}logger[_0x2f40('0x11')](_0x2f40('0x13'),_0x2aef56,_0x359dba[_0x2f40('0x11')][_0x2f40('0x14')]);return _0x2362e4(_0x359dba[_0x2f40('0x11')][_0x2f40('0x14')]);}else{logger[_0x2f40('0xd')](_0x2f40('0x13'),_0x2aef56,_0x2f40('0xe'));_0x2362e4(_0x359dba[_0x2f40('0x15')][_0x2f40('0x14')]);}})[_0x2f40('0x16')](function(_0x3ee204){logger['error'](_0x2f40('0x13'),_0x2aef56,_0x3ee204);_0x439711(_0x3ee204);});});}exports[_0x2f40('0x17')]=function(_0x50a832){var _0x25d684=this;return new Promise(function(_0x1bc06f,_0x14052e){return db[_0x2f40('0x18')][_0x2f40('0x19')](_0x50a832[_0x2f40('0x1a')],{'raw':_0x50a832[_0x2f40('0x1b')]?_0x50a832[_0x2f40('0x1b')][_0x2f40('0x1c')]===undefined?!![]:![]:!![]})[_0x2f40('0x1d')](function(_0x2c4f0e){logger[_0x2f40('0xd')](_0x2f40('0x17'),_0x50a832);logger[_0x2f40('0xf')]('CreateVoiceAgentReport',_0x50a832,JSON[_0x2f40('0x1e')](_0x2c4f0e));_0x1bc06f(_0x2c4f0e);})[_0x2f40('0x16')](function(_0x47e621){logger[_0x2f40('0x11')]('CreateVoiceAgentReport',_0x47e621[_0x2f40('0x14')],_0x50a832);_0x14052e(_0x25d684['error'](0x1f4,_0x47e621['message']));});});};exports[_0x2f40('0x1f')]=function(_0x4dfbe1){var _0x3c44bf=this;return new Promise(function(_0x2c747a,_0x4b972){return db[_0x2f40('0x18')][_0x2f40('0x20')](_0x4dfbe1[_0x2f40('0x1a')],{'raw':_0x4dfbe1[_0x2f40('0x1b')]?_0x4dfbe1[_0x2f40('0x1b')][_0x2f40('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dfbe1['options']?_0x4dfbe1['options'][_0x2f40('0x21')]||null:null,'attributes':_0x4dfbe1['options']?_0x4dfbe1['options'][_0x2f40('0x22')]||null:null,'limit':_0x4dfbe1[_0x2f40('0x1b')]?_0x4dfbe1['options'][_0x2f40('0x23')]||null:null})[_0x2f40('0x1d')](function(_0x11495f){logger['info'](_0x2f40('0x1f'),_0x4dfbe1);logger['debug'](_0x2f40('0x1f'),_0x4dfbe1,JSON[_0x2f40('0x1e')](_0x11495f));_0x2c747a(_0x11495f);})['catch'](function(_0x570162){logger['error'](_0x2f40('0x1f'),_0x570162['message'],_0x4dfbe1);_0x4b972(_0x3c44bf[_0x2f40('0x11')](0x1f4,_0x570162['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a20037b..d2a71a5 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 _0xc3b5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','exports','path','connect-timeout','express'];(function(_0x2c11e1,_0x49c2df){var _0xe2a467=function(_0x37155e){while(--_0x37155e){_0x2c11e1['push'](_0x2c11e1['shift']());}};_0xe2a467(++_0x49c2df);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x7c8f4e,_0x1ecbc3){_0x7c8f4e=_0x7c8f4e-0x0;var _0x175ee2=_0xc3b5[_0x7c8f4e];return _0x175ee2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var fs_extra=require(_0x5c3b('0x4'));var auth=require(_0x5c3b('0x5'));var interaction=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var controller=require('./voiceCallReport.controller');router[_0x5c3b('0x8')]('/',auth[_0x5c3b('0x9')](),controller['index']);router[_0x5c3b('0x8')](_0x5c3b('0xa'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xb')]);router['get'](_0x5c3b('0xc'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xd')]);router[_0x5c3b('0xe')]('/',auth['isAuthenticated'](),controller[_0x5c3b('0xf')]);router[_0x5c3b('0x10')](_0x5c3b('0xc'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0x11')]);router['delete'](_0x5c3b('0xc'),auth[_0x5c3b('0x9')](),controller['destroy']);module[_0x5c3b('0x12')]=router; \ No newline at end of file +var _0x7fbe=['/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x4b54a1,_0x365ff1){var _0x54b0c3=function(_0x5666a1){while(--_0x5666a1){_0x4b54a1['push'](_0x4b54a1['shift']());}};_0x54b0c3(++_0x365ff1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5ec334,_0x20923c){_0x5ec334=_0x5ec334-0x0;var _0x311347=_0x7fbe[_0x5ec334];return _0x311347;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index f44c27e..c4705e5 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 _0xf3ad=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM','internal','outbound'];(function(_0x1daab4,_0x32dcb8){var _0x220a44=function(_0x5abf63){while(--_0x5abf63){_0x1daab4['push'](_0x1daab4['shift']());}};_0x220a44(++_0x32dcb8);}(_0xf3ad,0xb6));var _0xdf3a=function(_0x4c2104,_0x4e5ba6){_0x4c2104=_0x4c2104-0x0;var _0x2a7992=_0xf3ad[_0x4c2104];return _0x2a7992;};'use strict';var Sequelize=require('sequelize');module[_0xdf3a('0x0')]={'uniqueid':{'type':Sequelize[_0xdf3a('0x1')]},'type':{'type':Sequelize[_0xdf3a('0x2')]('inbound',_0xdf3a('0x3'),_0xdf3a('0x4'),_0xdf3a('0x5'),_0xdf3a('0x6'),_0xdf3a('0x7'))},'tag':{'type':Sequelize[_0xdf3a('0x1')]},'accountcode':{'type':Sequelize[_0xdf3a('0x1')]},'source':{'type':Sequelize[_0xdf3a('0x1')]},'destination':{'type':Sequelize[_0xdf3a('0x1')]},'destinationcontext':{'type':Sequelize[_0xdf3a('0x1')]},'callerid':{'type':Sequelize[_0xdf3a('0x1')]},'channel':{'type':Sequelize[_0xdf3a('0x1')]},'destinationchannel':{'type':Sequelize[_0xdf3a('0x1')]},'lastapplication':{'type':Sequelize[_0xdf3a('0x1')]},'lastdata':{'type':Sequelize[_0xdf3a('0x8')]},'starttime':{'type':Sequelize[_0xdf3a('0x9')]},'systemanswertime':{'type':Sequelize[_0xdf3a('0x9')]},'answertime':{'type':Sequelize[_0xdf3a('0x9')]},'endtime':{'type':Sequelize[_0xdf3a('0x9')]},'duration':{'type':Sequelize[_0xdf3a('0xa')]},'billableseconds':{'type':Sequelize[_0xdf3a('0xa')]},'mohtime':{'type':Sequelize[_0xdf3a('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdf3a('0x1')]},'amaflags':{'type':Sequelize[_0xdf3a('0x1')]},'userfield':{'type':Sequelize[_0xdf3a('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xdf3a('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdf3a('0x1')]},'prefix':{'type':Sequelize[_0xdf3a('0x1')]},'routeid':{'type':Sequelize[_0xdf3a('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x685f=['outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x685f,0xc7));var _0xf685=function(_0x51db74,_0x221a26){_0x51db74=_0x51db74-0x0;var _0x553176=_0x685f[_0x51db74];return _0x553176;};'use strict';var Sequelize=require(_0xf685('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf685('0x1')]},'type':{'type':Sequelize[_0xf685('0x2')](_0xf685('0x3'),_0xf685('0x4'),_0xf685('0x5'),_0xf685('0x6'),_0xf685('0x7'),_0xf685('0x8'))},'tag':{'type':Sequelize[_0xf685('0x1')]},'accountcode':{'type':Sequelize[_0xf685('0x1')]},'source':{'type':Sequelize[_0xf685('0x1')]},'destination':{'type':Sequelize[_0xf685('0x1')]},'destinationcontext':{'type':Sequelize[_0xf685('0x1')]},'callerid':{'type':Sequelize[_0xf685('0x1')]},'channel':{'type':Sequelize[_0xf685('0x1')]},'destinationchannel':{'type':Sequelize[_0xf685('0x1')]},'lastapplication':{'type':Sequelize[_0xf685('0x1')]},'lastdata':{'type':Sequelize[_0xf685('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xf685('0xa')]},'answertime':{'type':Sequelize[_0xf685('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xf685('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf685('0x1')]},'amaflags':{'type':Sequelize[_0xf685('0x1')]},'userfield':{'type':Sequelize[_0xf685('0x1')]},'userDisposition':{'type':Sequelize[_0xf685('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xf685('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xf685('0x1')]},'note':{'type':Sequelize[_0xf685('0x1')]},'prefix':{'type':Sequelize[_0xf685('0x1')]},'routeid':{'type':Sequelize[_0xf685('0xb')]},'sipcallid':{'type':Sequelize[_0xf685('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 45f437e..922992b 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x5c9273,_0x4d348e){var _0x3daad7=function(_0x49a7af){while(--_0x49a7af){_0x5c9273['push'](_0x5c9273['shift']());}};_0x3daad7(++_0x4d348e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x0b0e[_0x402c8f];return _0x11e809;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 528ca8a..1b530b4 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 _0xc9c3=['api','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','util','../../config/logger'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x5e7d50,_0x34d7b0){_0x5e7d50=_0x5e7d50-0x0;var _0x1e65b4=_0xc9c3[_0x5e7d50];return _0x1e65b4;};'use strict';var _=require('lodash');var util=require(_0x3c9c('0x0'));var logger=require(_0x3c9c('0x1'))(_0x3c9c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c9c('0x3'));var fs=require('fs');var path=require(_0x3c9c('0x4'));var rimraf=require('rimraf');var config=require(_0x3c9c('0x5'));var attributes=require(_0x3c9c('0x6'));module[_0x3c9c('0x7')]=function(_0xfb5046,_0x40811c){return _0xfb5046[_0x3c9c('0x8')](_0x3c9c('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6e0=['path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x501d3e,_0x5e1ebb){var _0x155a91=function(_0x132f37){while(--_0x132f37){_0x501d3e['push'](_0x501d3e['shift']());}};_0x155a91(++_0x5e1ebb);}(_0xc6e0,0x14a));var _0x0c6e=function(_0xb2e670,_0x436e56){_0xb2e670=_0xb2e670-0x0;var _0x598b6b=_0xc6e0[_0xb2e670];return _0x598b6b;};'use strict';var _=require('lodash');var util=require(_0x0c6e('0x0'));var logger=require(_0x0c6e('0x1'))(_0x0c6e('0x2'));var moment=require(_0x0c6e('0x3'));var BPromise=require(_0x0c6e('0x4'));var rp=require(_0x0c6e('0x5'));var fs=require('fs');var path=require(_0x0c6e('0x6'));var rimraf=require(_0x0c6e('0x7'));var config=require(_0x0c6e('0x8'));var attributes=require(_0x0c6e('0x9'));module[_0x0c6e('0xa')]=function(_0x4c343d,_0xbd6bbc){return _0x4c343d[_0x0c6e('0xb')](_0x0c6e('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x0c6e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 070d422..6d90298 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 _0x157a=['VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','info','CreateVoiceCallReport','body','update','UpdateVoiceCallReport','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x157a,0x66));var _0xa157=function(_0x23439c,_0x5baf43){_0x23439c=_0x23439c-0x0;var _0x5f0922=_0x157a[_0x23439c];return _0x5f0922;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa157('0x0'));var rs=require(_0xa157('0x1'));var fs=require('fs');var Redis=require(_0xa157('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa157('0x3'));var logger=require(_0xa157('0x4'))(_0xa157('0x5'));var config=require(_0xa157('0x6'));var jayson=require(_0xa157('0x7'));var client=jayson[_0xa157('0x8')][_0xa157('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c017e,_0x4a4bdc,_0x50d508){return new BPromise(function(_0x3108fb,_0x81a08f){return client[_0xa157('0xa')](_0x2c017e,_0x50d508)[_0xa157('0xb')](function(_0x389dcc){logger['info'](_0xa157('0xc'),_0x4a4bdc,'request\x20sent');logger[_0xa157('0xd')](_0xa157('0xe'),_0x4a4bdc,_0xa157('0xf'),JSON[_0xa157('0x10')](_0x389dcc));if(_0x389dcc['error']){if(_0x389dcc[_0xa157('0x11')][_0xa157('0x12')]===0x1f4){logger['error'](_0xa157('0xc'),_0x4a4bdc,_0x389dcc[_0xa157('0x11')]['message']);return _0x81a08f(_0x389dcc['error']['message']);}logger['error'](_0xa157('0xc'),_0x4a4bdc,_0x389dcc[_0xa157('0x11')][_0xa157('0x13')]);return _0x3108fb(_0x389dcc['error'][_0xa157('0x13')]);}else{logger['info'](_0xa157('0xc'),_0x4a4bdc,'request\x20sent');_0x3108fb(_0x389dcc[_0xa157('0x14')][_0xa157('0x13')]);}})[_0xa157('0x15')](function(_0x47bd91){logger[_0xa157('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x4a4bdc,_0x47bd91);_0x81a08f(_0x47bd91);});});}exports[_0xa157('0x16')]=function(_0x5a91d0){var _0x197d46=this;return new Promise(function(_0x5140f2,_0x3b2f2f){return db[_0xa157('0x17')][_0xa157('0x18')]({'raw':_0x5a91d0[_0xa157('0x19')]?_0x5a91d0['options'][_0xa157('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a91d0[_0xa157('0x19')]?_0x5a91d0[_0xa157('0x19')][_0xa157('0x1b')]||null:null,'attributes':_0x5a91d0['options']?_0x5a91d0[_0xa157('0x19')][_0xa157('0x1c')]||null:null,'limit':_0x5a91d0[_0xa157('0x19')]?_0x5a91d0[_0xa157('0x19')][_0xa157('0x1d')]||null:null,'include':_0x5a91d0['options']?_0x5a91d0['options'][_0xa157('0x1e')]?_[_0xa157('0x1f')](_0x5a91d0['options'][_0xa157('0x1e')],function(_0x4c32d9){return{'model':db[_0x4c32d9[_0xa157('0x20')]],'as':_0x4c32d9['as'],'attributes':_0x4c32d9['attributes'],'include':_0x4c32d9['include']?_[_0xa157('0x1f')](_0x4c32d9[_0xa157('0x1e')],function(_0x3da189){return{'model':db[_0x3da189[_0xa157('0x20')]],'as':_0x3da189['as'],'attributes':_0x3da189['attributes'],'include':_0x3da189[_0xa157('0x1e')]?_[_0xa157('0x1f')](_0x3da189[_0xa157('0x1e')],function(_0x4f24bb){return{'model':db[_0x4f24bb[_0xa157('0x20')]],'as':_0x4f24bb['as'],'attributes':_0x4f24bb[_0xa157('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa157('0xb')](function(_0x36b6a8){logger[_0xa157('0x21')](_0xa157('0x16'),_0x5a91d0);logger['debug'](_0xa157('0x16'),_0x5a91d0,JSON[_0xa157('0x10')](_0x36b6a8));_0x5140f2(_0x36b6a8);})[_0xa157('0x15')](function(_0x218fca){logger[_0xa157('0x11')](_0xa157('0x16'),_0x218fca[_0xa157('0x13')],_0x5a91d0);_0x3b2f2f(_0x197d46[_0xa157('0x11')](0x1f4,_0x218fca[_0xa157('0x13')]));});});};exports[_0xa157('0x22')]=function(_0x307045){var _0xa346a4=this;return new Promise(function(_0x380fdb,_0x3435fe){return db[_0xa157('0x17')]['create'](_0x307045[_0xa157('0x23')],{'raw':_0x307045[_0xa157('0x19')]?_0x307045[_0xa157('0x19')][_0xa157('0x1a')]===undefined?!![]:![]:!![]})[_0xa157('0xb')](function(_0x55231b){logger[_0xa157('0x21')](_0xa157('0x22'),_0x307045);logger[_0xa157('0xd')](_0xa157('0x22'),_0x307045,JSON['stringify'](_0x55231b));_0x380fdb(_0x55231b);})[_0xa157('0x15')](function(_0x180977){logger['error'](_0xa157('0x22'),_0x180977[_0xa157('0x13')],_0x307045);_0x3435fe(_0xa346a4[_0xa157('0x11')](0x1f4,_0x180977[_0xa157('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x3fd52f){var _0x20e501=this;return new Promise(function(_0x4cc3cc,_0x2dbed6){return db[_0xa157('0x17')][_0xa157('0x24')](_0x3fd52f['body'],{'raw':_0x3fd52f[_0xa157('0x19')]?_0x3fd52f[_0xa157('0x19')][_0xa157('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd52f['options']?_0x3fd52f[_0xa157('0x19')][_0xa157('0x1b')]||null:null,'attributes':_0x3fd52f[_0xa157('0x19')]?_0x3fd52f[_0xa157('0x19')][_0xa157('0x1c')]||null:null,'limit':_0x3fd52f[_0xa157('0x19')]?_0x3fd52f['options']['limit']||null:null})['then'](function(_0x1c1eef){logger['info']('UpdateVoiceCallReport',_0x3fd52f);logger[_0xa157('0xd')](_0xa157('0x25'),_0x3fd52f,JSON[_0xa157('0x10')](_0x1c1eef));_0x4cc3cc(_0x1c1eef);})[_0xa157('0x15')](function(_0x132e23){logger[_0xa157('0x11')](_0xa157('0x25'),_0x132e23['message'],_0x3fd52f);_0x2dbed6(_0x20e501[_0xa157('0x11')](0x1f4,_0x132e23['message']));});});}; \ No newline at end of file +var _0x9dde=['where','limit','include','map','model','attributes','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x9dde,0xab));var _0xe9dd=function(_0x280214,_0x1ab22f){_0x280214=_0x280214-0x0;var _0x19ce63=_0x9dde[_0x280214];return _0x19ce63;};'use strict';var _=require(_0xe9dd('0x0'));var util=require(_0xe9dd('0x1'));var moment=require(_0xe9dd('0x2'));var BPromise=require(_0xe9dd('0x3'));var rs=require(_0xe9dd('0x4'));var fs=require('fs');var Redis=require(_0xe9dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9dd('0x6'));var logger=require(_0xe9dd('0x7'))(_0xe9dd('0x8'));var config=require(_0xe9dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe9dd('0xa')][_0xe9dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b14c4,_0x3381e7,_0x4ff69b){return new BPromise(function(_0x4ab679,_0x19099a){return client[_0xe9dd('0xc')](_0x4b14c4,_0x4ff69b)[_0xe9dd('0xd')](function(_0x2c29ec){logger[_0xe9dd('0xe')](_0xe9dd('0xf'),_0x3381e7,_0xe9dd('0x10'));logger[_0xe9dd('0x11')](_0xe9dd('0x12'),_0x3381e7,_0xe9dd('0x10'),JSON[_0xe9dd('0x13')](_0x2c29ec));if(_0x2c29ec['error']){if(_0x2c29ec[_0xe9dd('0x14')][_0xe9dd('0x15')]===0x1f4){logger[_0xe9dd('0x14')](_0xe9dd('0xf'),_0x3381e7,_0x2c29ec[_0xe9dd('0x14')][_0xe9dd('0x16')]);return _0x19099a(_0x2c29ec[_0xe9dd('0x14')][_0xe9dd('0x16')]);}logger[_0xe9dd('0x14')](_0xe9dd('0xf'),_0x3381e7,_0x2c29ec[_0xe9dd('0x14')][_0xe9dd('0x16')]);return _0x4ab679(_0x2c29ec['error'][_0xe9dd('0x16')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x3381e7,_0xe9dd('0x10'));_0x4ab679(_0x2c29ec[_0xe9dd('0x17')][_0xe9dd('0x16')]);}})['catch'](function(_0x3d1628){logger[_0xe9dd('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x3381e7,_0x3d1628);_0x19099a(_0x3d1628);});});}exports[_0xe9dd('0x18')]=function(_0x23b49c){var _0x4b794e=this;return new Promise(function(_0x5684db,_0x2bb960){return db[_0xe9dd('0x19')][_0xe9dd('0x1a')]({'raw':_0x23b49c[_0xe9dd('0x1b')]?_0x23b49c['options'][_0xe9dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x23b49c[_0xe9dd('0x1b')]?_0x23b49c['options'][_0xe9dd('0x1d')]||null:null,'attributes':_0x23b49c['options']?_0x23b49c[_0xe9dd('0x1b')]['attributes']||null:null,'limit':_0x23b49c[_0xe9dd('0x1b')]?_0x23b49c[_0xe9dd('0x1b')][_0xe9dd('0x1e')]||null:null,'include':_0x23b49c[_0xe9dd('0x1b')]?_0x23b49c[_0xe9dd('0x1b')][_0xe9dd('0x1f')]?_[_0xe9dd('0x20')](_0x23b49c[_0xe9dd('0x1b')][_0xe9dd('0x1f')],function(_0x402684){return{'model':db[_0x402684[_0xe9dd('0x21')]],'as':_0x402684['as'],'attributes':_0x402684[_0xe9dd('0x22')],'include':_0x402684[_0xe9dd('0x1f')]?_[_0xe9dd('0x20')](_0x402684[_0xe9dd('0x1f')],function(_0x291ea8){return{'model':db[_0x291ea8[_0xe9dd('0x21')]],'as':_0x291ea8['as'],'attributes':_0x291ea8['attributes'],'include':_0x291ea8[_0xe9dd('0x1f')]?_[_0xe9dd('0x20')](_0x291ea8['include'],function(_0x50a542){return{'model':db[_0x50a542[_0xe9dd('0x21')]],'as':_0x50a542['as'],'attributes':_0x50a542[_0xe9dd('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe9dd('0xd')](function(_0x1c4733){logger['info'](_0xe9dd('0x18'),_0x23b49c);logger[_0xe9dd('0x11')](_0xe9dd('0x18'),_0x23b49c,JSON[_0xe9dd('0x13')](_0x1c4733));_0x5684db(_0x1c4733);})[_0xe9dd('0x23')](function(_0x36f6d7){logger['error']('GetVoiceCallReport',_0x36f6d7[_0xe9dd('0x16')],_0x23b49c);_0x2bb960(_0x4b794e['error'](0x1f4,_0x36f6d7[_0xe9dd('0x16')]));});});};exports['CreateVoiceCallReport']=function(_0x1c93b1){var _0x5493f4=this;return new Promise(function(_0xb9d8dc,_0x108dc3){return db[_0xe9dd('0x19')][_0xe9dd('0x24')](_0x1c93b1[_0xe9dd('0x25')],{'raw':_0x1c93b1[_0xe9dd('0x1b')]?_0x1c93b1[_0xe9dd('0x1b')][_0xe9dd('0x1c')]===undefined?!![]:![]:!![]})[_0xe9dd('0xd')](function(_0x38d6a2){logger[_0xe9dd('0xe')](_0xe9dd('0x26'),_0x1c93b1);logger[_0xe9dd('0x11')](_0xe9dd('0x26'),_0x1c93b1,JSON[_0xe9dd('0x13')](_0x38d6a2));_0xb9d8dc(_0x38d6a2);})[_0xe9dd('0x23')](function(_0x424f7d){logger['error'](_0xe9dd('0x26'),_0x424f7d[_0xe9dd('0x16')],_0x1c93b1);_0x108dc3(_0x5493f4[_0xe9dd('0x14')](0x1f4,_0x424f7d['message']));});});};exports[_0xe9dd('0x27')]=function(_0xbc30e0){var _0x15ed6a=this;return new Promise(function(_0x4f73d2,_0x53561f){return db[_0xe9dd('0x19')]['update'](_0xbc30e0[_0xe9dd('0x25')],{'raw':_0xbc30e0['options']?_0xbc30e0[_0xe9dd('0x1b')][_0xe9dd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbc30e0[_0xe9dd('0x1b')]?_0xbc30e0[_0xe9dd('0x1b')]['where']||null:null,'attributes':_0xbc30e0[_0xe9dd('0x1b')]?_0xbc30e0[_0xe9dd('0x1b')][_0xe9dd('0x22')]||null:null,'limit':_0xbc30e0[_0xe9dd('0x1b')]?_0xbc30e0[_0xe9dd('0x1b')]['limit']||null:null})[_0xe9dd('0xd')](function(_0x37c8b4){logger[_0xe9dd('0xe')](_0xe9dd('0x27'),_0xbc30e0);logger[_0xe9dd('0x11')](_0xe9dd('0x27'),_0xbc30e0,JSON['stringify'](_0x37c8b4));_0x4f73d2(_0x37c8b4);})[_0xe9dd('0x23')](function(_0x4c0160){logger[_0xe9dd('0x14')](_0xe9dd('0x27'),_0x4c0160['message'],_0xbc30e0);_0x53561f(_0x15ed6a['error'](0x1f4,_0x4c0160[_0xe9dd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d8094ff..6c1ef82 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 _0x9053=['index','/:id','show','post','create','put','update','exports','util','express','Router','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0x10e627,_0x26b1a7){var _0x12153a=function(_0x54bb6b){while(--_0x54bb6b){_0x10e627['push'](_0x10e627['shift']());}};_0x12153a(++_0x26b1a7);}(_0x9053,0x161));var _0x3905=function(_0x265468,_0xcf7439){_0x265468=_0x265468-0x0;var _0x37d555=_0x9053[_0x265468];return _0x37d555;};'use strict';var multer=require('multer');var util=require(_0x3905('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3905('0x1'));var router=express[_0x3905('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3905('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3905('0x4'));router[_0x3905('0x5')]('/',auth[_0x3905('0x6')](),controller[_0x3905('0x7')]);router[_0x3905('0x5')](_0x3905('0x8'),auth['isAuthenticated'](),controller[_0x3905('0x9')]);router[_0x3905('0xa')]('/',auth[_0x3905('0x6')](),controller[_0x3905('0xb')]);router[_0x3905('0xc')](_0x3905('0x8'),auth[_0x3905('0x6')](),controller[_0x3905('0xd')]);router['delete'](_0x3905('0x8'),auth[_0x3905('0x6')](),controller['destroy']);module[_0x3905('0xe')]=router; \ No newline at end of file +var _0x314b=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x314b,0xcc));var _0xb314=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x314b[_0x13b392];return _0x39db24;};'use strict';var multer=require('multer');var util=require(_0xb314('0x0'));var path=require(_0xb314('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb314('0x2')]();var fs_extra=require(_0xb314('0x3'));var auth=require(_0xb314('0x4'));var interaction=require(_0xb314('0x5'));var config=require('../../config/environment');var controller=require(_0xb314('0x6'));router['get']('/',auth[_0xb314('0x7')](),controller[_0xb314('0x8')]);router[_0xb314('0x9')](_0xb314('0xa'),auth['isAuthenticated'](),controller[_0xb314('0xb')]);router[_0xb314('0xc')]('/',auth[_0xb314('0x7')](),controller[_0xb314('0xd')]);router[_0xb314('0xe')](_0xb314('0xa'),auth['isAuthenticated'](),controller[_0xb314('0xf')]);router['delete']('/:id',auth[_0xb314('0x7')](),controller[_0xb314('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 1735bd3..a2bc45b 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 _0xda21=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x3af34a,_0x225d3d){var _0x4df3e2=function(_0x4305a0){while(--_0x4305a0){_0x3af34a['push'](_0x3af34a['shift']());}};_0x4df3e2(++_0x225d3d);}(_0xda21,0xe8));var _0x1da2=function(_0x58d28b,_0x5a3aeb){_0x58d28b=_0x58d28b-0x0;var _0x401787=_0xda21[_0x58d28b];return _0x401787;};'use strict';var Sequelize=require('sequelize');module[_0x1da2('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x1da2('0x1')],'unique':_0x1da2('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0xc311e7){this[_0x1da2('0x3')](_0x1da2('0x4'),_0xc311e7?_0xc311e7[_0x1da2('0x5')](''):[]);},'get':function(){return this[_0x1da2('0x6')](_0x1da2('0x4'))?this['getDataValue'](_0x1da2('0x4'))[_0x1da2('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x1da2('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1da2('0x1')]},'description':{'type':Sequelize[_0x1da2('0x1')]}}; \ No newline at end of file +var _0xa7e2=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x93e604,_0x1dcb70){var _0x53b700=function(_0x5c2e48){while(--_0x5c2e48){_0x93e604['push'](_0x93e604['shift']());}};_0x53b700(++_0x1dcb70);}(_0xa7e2,0xb0));var _0x2a7e=function(_0x2f5f11,_0x21bf70){_0x2f5f11=_0x2f5f11-0x0;var _0x12bf64=_0xa7e2[_0x2f5f11];return _0x12bf64;};'use strict';var Sequelize=require(_0x2a7e('0x0'));module[_0x2a7e('0x1')]={'name':{'type':Sequelize[_0x2a7e('0x2')]},'prefix':{'type':Sequelize[_0x2a7e('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x2a7e('0x2')],'set':function(_0x3c0d49){this[_0x2a7e('0x3')](_0x2a7e('0x4'),_0x3c0d49?_0x3c0d49[_0x2a7e('0x5')](''):[]);},'get':function(){return this[_0x2a7e('0x6')](_0x2a7e('0x4'))?this['getDataValue'](_0x2a7e('0x4'))[_0x2a7e('0x7')](''):[];}},'auth':{'type':Sequelize[_0x2a7e('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x2a7e('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2a7e('0x2')]},'description':{'type':Sequelize[_0x2a7e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 85fcfb2..fda0e1d 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 _0x574d=['options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length'];(function(_0x57c0d4,_0x31c14e){var _0x3c4de2=function(_0x4868af){while(--_0x4868af){_0x57c0d4['push'](_0x57c0d4['shift']());}};_0x3c4de2(++_0x31c14e);}(_0x574d,0xc0));var _0xd574=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x574d[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xd574('0x0'));var rimraf=require(_0xd574('0x1'));var zipdir=require(_0xd574('0x2'));var jsonpatch=require(_0xd574('0x3'));var rp=require(_0xd574('0x4'));var moment=require(_0xd574('0x5'));var BPromise=require(_0xd574('0x6'));var Mustache=require('mustache');var util=require(_0xd574('0x7'));var path=require(_0xd574('0x8'));var sox=require(_0xd574('0x9'));var csv=require(_0xd574('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd574('0xb'));var _=require(_0xd574('0xc'));var squel=require(_0xd574('0xd'));var crypto=require(_0xd574('0xe'));var jsforce=require(_0xd574('0xf'));var deskjs=require(_0xd574('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd574('0x11'));var Redis=require(_0xd574('0x12'));var authService=require(_0xd574('0x13'));var qs=require(_0xd574('0x14'));var as=require(_0xd574('0x15'));var hardwareService=require(_0xd574('0x16'));var logger=require(_0xd574('0x17'))('api');var utils=require(_0xd574('0x18'));var config=require(_0xd574('0x19'));var licenseUtil=require(_0xd574('0x1a'));var db=require(_0xd574('0x1b'))['db'];function respondWithStatusCode(_0x1ddedb,_0x6c93de){_0x6c93de=_0x6c93de||0xcc;return function(_0x8dd760){if(_0x8dd760){return _0x1ddedb[_0xd574('0x1c')](_0x6c93de);}return _0x1ddedb[_0xd574('0x1d')](_0x6c93de)[_0xd574('0x1e')]();};}function respondWithResult(_0x43e251,_0x2cc660){_0x2cc660=_0x2cc660||0xc8;return function(_0x564b36){if(_0x564b36){return _0x43e251[_0xd574('0x1d')](_0x2cc660)[_0xd574('0x1f')](_0x564b36);}};}function respondWithFilteredResult(_0x2d66be,_0x1537f4){return function(_0x46fb4c){if(_0x46fb4c){var _0x341463=typeof _0x1537f4[_0xd574('0x20')]===_0xd574('0x21')&&typeof _0x1537f4['limit']==='undefined';var _0x1486c7=_0x46fb4c[_0xd574('0x22')];var _0x2ac01d=_0x341463?0x0:_0x1537f4['offset'];var _0x58a74b=_0x341463?_0x46fb4c[_0xd574('0x22')]:_0x1537f4[_0xd574('0x20')]+_0x1537f4[_0xd574('0x23')];var _0x46e331;if(_0x58a74b>=_0x1486c7){_0x58a74b=_0x1486c7;_0x46e331=0xc8;}else{_0x46e331=0xce;}_0x2d66be[_0xd574('0x1d')](_0x46e331);return _0x2d66be[_0xd574('0x24')](_0xd574('0x25'),_0x2ac01d+'-'+_0x58a74b+'/'+_0x1486c7)[_0xd574('0x1f')](_0x46fb4c);}return null;};}function patchUpdates(_0xefe45f){return function(_0x9f980d){try{jsonpatch[_0xd574('0x26')](_0x9f980d,_0xefe45f,!![]);}catch(_0x587f62){return BPromise[_0xd574('0x27')](_0x587f62);}return _0x9f980d[_0xd574('0x28')]();};}function saveUpdates(_0x481564,_0x39c39d){return function(_0x5e5b9f){if(_0x5e5b9f){return _0x5e5b9f[_0xd574('0x29')](_0x481564)[_0xd574('0x2a')](function(_0x199756){return _0x199756;});}return null;};}function removeEntity(_0x3f85cf,_0x1aec00){return function(_0x72d2b8){if(_0x72d2b8){return _0x72d2b8[_0xd574('0x2b')]()[_0xd574('0x2a')](function(){var _0x1e3316=_0x72d2b8[_0xd574('0x2c')]({'plain':!![]});var _0x1fbd81=_0xd574('0x2d');return db[_0xd574('0x2e')][_0xd574('0x2b')]({'where':{'type':_0x1fbd81,'resourceId':_0x1e3316['id']}})['then'](function(){return _0x72d2b8;});})[_0xd574('0x2a')](function(){_0x3f85cf['status'](0xcc)[_0xd574('0x1e')]();});}};}function handleEntityNotFound(_0x5c9224,_0x49f2e9){return function(_0x379d47){if(!_0x379d47){_0x5c9224[_0xd574('0x1c')](0x194);}return _0x379d47;};}function handleError(_0x2153d0,_0x5a36cc){_0x5a36cc=_0x5a36cc||0x1f4;return function(_0x2a8e86){logger[_0xd574('0x2f')](_0x2a8e86[_0xd574('0x30')]);if(_0x2a8e86[_0xd574('0x31')]){delete _0x2a8e86['name'];}_0x2153d0['status'](_0x5a36cc)[_0xd574('0x32')](_0x2a8e86);};}exports[_0xd574('0x33')]=function(_0x203bcb,_0x23a495){var _0x1e65b5={},_0x1c01f0={},_0x5b66eb={'count':0x0,'rows':[]};var _0x5575a8=_[_0xd574('0x34')](db[_0xd574('0x35')][_0xd574('0x36')],function(_0x18749f){return{'name':_0x18749f[_0xd574('0x37')],'type':_0x18749f[_0xd574('0x38')][_0xd574('0x39')]};});_0x1c01f0[_0xd574('0x3a')]=_['map'](_0x5575a8,'name');_0x1c01f0[_0xd574('0x3b')]=_[_0xd574('0x3c')](_0x203bcb[_0xd574('0x3b')]);_0x1c01f0[_0xd574('0x3d')]=_[_0xd574('0x3e')](_0x1c01f0['model'],_0x1c01f0[_0xd574('0x3b')]);_0x1e65b5[_0xd574('0x3f')]=_[_0xd574('0x3e')](_0x1c01f0[_0xd574('0x3a')],qs[_0xd574('0x40')](_0x203bcb[_0xd574('0x3b')][_0xd574('0x40')]));_0x1e65b5['attributes']=_0x1e65b5[_0xd574('0x3f')]['length']?_0x1e65b5[_0xd574('0x3f')]:_0x1c01f0[_0xd574('0x3a')];if(!_0x203bcb[_0xd574('0x3b')][_0xd574('0x41')](_0xd574('0x42'))){_0x1e65b5[_0xd574('0x23')]=qs[_0xd574('0x23')](_0x203bcb[_0xd574('0x3b')][_0xd574('0x23')]);_0x1e65b5[_0xd574('0x20')]=qs[_0xd574('0x20')](_0x203bcb['query'][_0xd574('0x20')]);}_0x1e65b5[_0xd574('0x43')]=qs[_0xd574('0x44')](_0x203bcb['query'][_0xd574('0x44')]);_0x1e65b5[_0xd574('0x45')]=qs[_0xd574('0x3d')](_[_0xd574('0x46')](_0x203bcb[_0xd574('0x3b')],_0x1c01f0[_0xd574('0x3d')]),_0x5575a8);if(_0x203bcb['query'][_0xd574('0x47')]){_0x1e65b5[_0xd574('0x45')]=_[_0xd574('0x48')](_0x1e65b5[_0xd574('0x45')],{'$or':_[_0xd574('0x34')](_0x5575a8,function(_0x4c154e){if(_0x4c154e[_0xd574('0x38')]!==_0xd574('0x49')){var _0x37b588={};_0x37b588[_0x4c154e['name']]={'$like':'%'+_0x203bcb['query']['filter']+'%'};return _0x37b588;}})});}_0x1e65b5=_[_0xd574('0x48')]({},_0x1e65b5,_0x203bcb['options']);var _0x5874e4={'where':_0x1e65b5['where']};return db[_0xd574('0x35')][_0xd574('0x22')](_0x5874e4)[_0xd574('0x2a')](function(_0x20b570){_0x5b66eb['count']=_0x20b570;if(_0x203bcb[_0xd574('0x3b')][_0xd574('0x4a')]){_0x1e65b5[_0xd574('0x4b')]=[{'all':!![]}];}return db[_0xd574('0x35')]['findAll'](_0x1e65b5);})[_0xd574('0x2a')](function(_0x4caf06){_0x5b66eb[_0xd574('0x4c')]=_0x4caf06;return _0x5b66eb;})[_0xd574('0x2a')](respondWithFilteredResult(_0x23a495,_0x1e65b5))[_0xd574('0x4d')](handleError(_0x23a495,null));};exports[_0xd574('0x4e')]=function(_0xcd3231,_0x1baedc){var _0x391b76={'raw':![],'where':{'id':_0xcd3231[_0xd574('0x4f')]['id']}},_0x323882={};_0x323882[_0xd574('0x3a')]=_[_0xd574('0x3c')](db[_0xd574('0x35')][_0xd574('0x36')]);_0x323882['query']=_[_0xd574('0x3c')](_0xcd3231['query']);_0x323882['filters']=_[_0xd574('0x3e')](_0x323882[_0xd574('0x3a')],_0x323882['query']);_0x391b76[_0xd574('0x3f')]=_[_0xd574('0x3e')](_0x323882[_0xd574('0x3a')],qs['fields'](_0xcd3231[_0xd574('0x3b')][_0xd574('0x40')]));_0x391b76[_0xd574('0x3f')]=_0x391b76[_0xd574('0x3f')][_0xd574('0x50')]?_0x391b76[_0xd574('0x3f')]:_0x323882['model'];if(_0xcd3231[_0xd574('0x3b')][_0xd574('0x4a')]){_0x391b76[_0xd574('0x4b')]=[{'all':!![]}];}_0x391b76=_[_0xd574('0x48')]({},_0x391b76,_0xcd3231[_0xd574('0x51')]);return db[_0xd574('0x35')][_0xd574('0x52')](_0x391b76)[_0xd574('0x2a')](handleEntityNotFound(_0x1baedc,null))[_0xd574('0x2a')](respondWithResult(_0x1baedc,null))[_0xd574('0x4d')](handleError(_0x1baedc,null));};exports[_0xd574('0x53')]=function(_0x3aa4e6,_0x1cad77){return db[_0xd574('0x35')][_0xd574('0x53')](_0x3aa4e6[_0xd574('0x54')],{})['then'](function(_0x3dbfdc){var _0x3be45f=_0x3aa4e6['user'][_0xd574('0x2c')]({'plain':!![]});if(!_0x3be45f)throw new Error(_0xd574('0x55'));if(_0x3be45f[_0xd574('0x56')]===_0xd574('0x57')){var _0x2fcf85=_0x3dbfdc[_0xd574('0x2c')]({'plain':!![]});var _0x462e5e=_0xd574('0x2d');return db[_0xd574('0x58')][_0xd574('0x52')]({'where':{'name':_0x462e5e,'userProfileId':_0x3be45f['userProfileId']},'raw':!![]})[_0xd574('0x2a')](function(_0xf27716){if(_0xf27716&&_0xf27716[_0xd574('0x59')]===0x0){return db[_0xd574('0x2e')][_0xd574('0x53')]({'name':_0x2fcf85[_0xd574('0x31')],'resourceId':_0x2fcf85['id'],'type':_0xf27716[_0xd574('0x31')],'sectionId':_0xf27716['id']},{})[_0xd574('0x2a')](function(){return _0x3dbfdc;});}else{return _0x3dbfdc;}})[_0xd574('0x4d')](function(_0xba391f){logger[_0xd574('0x2f')](_0xd574('0x5a'),_0xba391f);throw _0xba391f;});}return _0x3dbfdc;})[_0xd574('0x2a')](respondWithResult(_0x1cad77,0xc9))[_0xd574('0x4d')](handleError(_0x1cad77,null));};exports[_0xd574('0x29')]=function(_0xcd1e61,_0x7c3273){if(_0xcd1e61[_0xd574('0x54')]['id']){delete _0xcd1e61[_0xd574('0x54')]['id'];}return db[_0xd574('0x35')][_0xd574('0x52')]({'where':{'id':_0xcd1e61[_0xd574('0x4f')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x7c3273,null))[_0xd574('0x2a')](saveUpdates(_0xcd1e61[_0xd574('0x54')],null))['then'](respondWithResult(_0x7c3273,null))[_0xd574('0x4d')](handleError(_0x7c3273,null));};exports[_0xd574('0x2b')]=function(_0x2ec166,_0xd1a7e3){return db[_0xd574('0x35')][_0xd574('0x52')]({'where':{'id':_0x2ec166[_0xd574('0x4f')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0xd1a7e3,null))[_0xd574('0x2a')](removeEntity(_0xd1a7e3,null))['catch'](handleError(_0xd1a7e3,null));}; \ No newline at end of file +var _0xf72b=['sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','end','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xf72b,0x1d9));var _0xbf72=function(_0x10c50a,_0xcd728){_0x10c50a=_0x10c50a-0x0;var _0x56d222=_0xf72b[_0x10c50a];return _0x56d222;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf72('0x2'));var moment=require(_0xbf72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf72('0x4'));var util=require(_0xbf72('0x5'));var path=require(_0xbf72('0x6'));var sox=require(_0xbf72('0x7'));var csv=require(_0xbf72('0x8'));var ejs=require(_0xbf72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x8'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var licenseUtil=require(_0xbf72('0x17'));var db=require(_0xbf72('0x18'))['db'];function respondWithStatusCode(_0x5eb4cc,_0x5967f5){_0x5967f5=_0x5967f5||0xcc;return function(_0x3bd500){if(_0x3bd500){return _0x5eb4cc[_0xbf72('0x19')](_0x5967f5);}return _0x5eb4cc[_0xbf72('0x1a')](_0x5967f5)['end']();};}function respondWithResult(_0x25255e,_0x4f4fa5){_0x4f4fa5=_0x4f4fa5||0xc8;return function(_0x5625b3){if(_0x5625b3){return _0x25255e['status'](_0x4f4fa5)[_0xbf72('0x1b')](_0x5625b3);}};}function respondWithFilteredResult(_0xb96906,_0x3af48d){return function(_0x723eb1){if(_0x723eb1){var _0x39d0cd=typeof _0x3af48d[_0xbf72('0x1c')]==='undefined'&&typeof _0x3af48d[_0xbf72('0x1d')]===_0xbf72('0x1e');var _0x2a8609=_0x723eb1[_0xbf72('0x1f')];var _0x27dadc=_0x39d0cd?0x0:_0x3af48d['offset'];var _0x51d4c9=_0x39d0cd?_0x723eb1[_0xbf72('0x1f')]:_0x3af48d[_0xbf72('0x1c')]+_0x3af48d[_0xbf72('0x1d')];var _0x2584d9;if(_0x51d4c9>=_0x2a8609){_0x51d4c9=_0x2a8609;_0x2584d9=0xc8;}else{_0x2584d9=0xce;}_0xb96906[_0xbf72('0x1a')](_0x2584d9);return _0xb96906[_0xbf72('0x20')](_0xbf72('0x21'),_0x27dadc+'-'+_0x51d4c9+'/'+_0x2a8609)['json'](_0x723eb1);}return null;};}function patchUpdates(_0x2aecae){return function(_0x42a193){try{jsonpatch[_0xbf72('0x22')](_0x42a193,_0x2aecae,!![]);}catch(_0x200139){return BPromise[_0xbf72('0x23')](_0x200139);}return _0x42a193['save']();};}function saveUpdates(_0x3cd181,_0x1de926){return function(_0x536071){if(_0x536071){return _0x536071[_0xbf72('0x24')](_0x3cd181)[_0xbf72('0x25')](function(_0x267c41){return _0x267c41;});}return null;};}function removeEntity(_0x4c7f3d,_0x44f3f9){return function(_0x428361){if(_0x428361){return _0x428361[_0xbf72('0x26')]()[_0xbf72('0x25')](function(){var _0x4f4dc0=_0x428361[_0xbf72('0x27')]({'plain':!![]});var _0x392a8c=_0xbf72('0x28');return db['UserProfileResource'][_0xbf72('0x26')]({'where':{'type':_0x392a8c,'resourceId':_0x4f4dc0['id']}})[_0xbf72('0x25')](function(){return _0x428361;});})[_0xbf72('0x25')](function(){_0x4c7f3d[_0xbf72('0x1a')](0xcc)[_0xbf72('0x29')]();});}};}function handleEntityNotFound(_0x2b1ff1,_0x182154){return function(_0x25ecdf){if(!_0x25ecdf){_0x2b1ff1[_0xbf72('0x19')](0x194);}return _0x25ecdf;};}function handleError(_0x92307f,_0x280d7a){_0x280d7a=_0x280d7a||0x1f4;return function(_0x20e747){logger[_0xbf72('0x2a')](_0x20e747[_0xbf72('0x2b')]);if(_0x20e747[_0xbf72('0x2c')]){delete _0x20e747['name'];}_0x92307f[_0xbf72('0x1a')](_0x280d7a)[_0xbf72('0x2d')](_0x20e747);};}exports[_0xbf72('0x2e')]=function(_0x28850d,_0xb1ee4e){var _0x82c0f0={},_0x35ecdc={},_0x209b2b={'count':0x0,'rows':[]};var _0x1be26a=_[_0xbf72('0x2f')](db[_0xbf72('0x30')][_0xbf72('0x31')],function(_0x423c61){return{'name':_0x423c61[_0xbf72('0x32')],'type':_0x423c61['type'][_0xbf72('0x33')]};});_0x35ecdc[_0xbf72('0x34')]=_[_0xbf72('0x2f')](_0x1be26a,'name');_0x35ecdc['query']=_['keys'](_0x28850d[_0xbf72('0x35')]);_0x35ecdc[_0xbf72('0x36')]=_[_0xbf72('0x37')](_0x35ecdc['model'],_0x35ecdc[_0xbf72('0x35')]);_0x82c0f0[_0xbf72('0x38')]=_['intersection'](_0x35ecdc[_0xbf72('0x34')],qs['fields'](_0x28850d[_0xbf72('0x35')][_0xbf72('0x39')]));_0x82c0f0['attributes']=_0x82c0f0['attributes'][_0xbf72('0x3a')]?_0x82c0f0[_0xbf72('0x38')]:_0x35ecdc[_0xbf72('0x34')];if(!_0x28850d[_0xbf72('0x35')][_0xbf72('0x3b')](_0xbf72('0x3c'))){_0x82c0f0[_0xbf72('0x1d')]=qs[_0xbf72('0x1d')](_0x28850d[_0xbf72('0x35')]['limit']);_0x82c0f0[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x28850d[_0xbf72('0x35')][_0xbf72('0x1c')]);}_0x82c0f0['order']=qs[_0xbf72('0x3d')](_0x28850d[_0xbf72('0x35')]['sort']);_0x82c0f0[_0xbf72('0x3e')]=qs['filters'](_['pick'](_0x28850d['query'],_0x35ecdc['filters']),_0x1be26a);if(_0x28850d[_0xbf72('0x35')]['filter']){_0x82c0f0['where']=_[_0xbf72('0x3f')](_0x82c0f0['where'],{'$or':_[_0xbf72('0x2f')](_0x1be26a,function(_0xde4ed9){if(_0xde4ed9['type']!==_0xbf72('0x40')){var _0x4aee64={};_0x4aee64[_0xde4ed9['name']]={'$like':'%'+_0x28850d[_0xbf72('0x35')][_0xbf72('0x41')]+'%'};return _0x4aee64;}})});}_0x82c0f0=_[_0xbf72('0x3f')]({},_0x82c0f0,_0x28850d[_0xbf72('0x42')]);var _0xffb333={'where':_0x82c0f0[_0xbf72('0x3e')]};return db[_0xbf72('0x30')][_0xbf72('0x1f')](_0xffb333)['then'](function(_0x311a0c){_0x209b2b[_0xbf72('0x1f')]=_0x311a0c;if(_0x28850d['query'][_0xbf72('0x43')]){_0x82c0f0['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xbf72('0x44')](_0x82c0f0);})[_0xbf72('0x25')](function(_0x3992fd){_0x209b2b[_0xbf72('0x45')]=_0x3992fd;return _0x209b2b;})[_0xbf72('0x25')](respondWithFilteredResult(_0xb1ee4e,_0x82c0f0))['catch'](handleError(_0xb1ee4e,null));};exports['show']=function(_0x4b8f31,_0x359c2b){var _0x3a7828={'raw':![],'where':{'id':_0x4b8f31[_0xbf72('0x46')]['id']}},_0x3871d0={};_0x3871d0['model']=_['keys'](db[_0xbf72('0x30')]['rawAttributes']);_0x3871d0[_0xbf72('0x35')]=_[_0xbf72('0x47')](_0x4b8f31[_0xbf72('0x35')]);_0x3871d0[_0xbf72('0x36')]=_['intersection'](_0x3871d0[_0xbf72('0x34')],_0x3871d0[_0xbf72('0x35')]);_0x3a7828[_0xbf72('0x38')]=_[_0xbf72('0x37')](_0x3871d0['model'],qs[_0xbf72('0x39')](_0x4b8f31[_0xbf72('0x35')]['fields']));_0x3a7828[_0xbf72('0x38')]=_0x3a7828[_0xbf72('0x38')][_0xbf72('0x3a')]?_0x3a7828[_0xbf72('0x38')]:_0x3871d0[_0xbf72('0x34')];if(_0x4b8f31[_0xbf72('0x35')][_0xbf72('0x43')]){_0x3a7828['include']=[{'all':!![]}];}_0x3a7828=_['merge']({},_0x3a7828,_0x4b8f31['options']);return db[_0xbf72('0x30')]['find'](_0x3a7828)[_0xbf72('0x25')](handleEntityNotFound(_0x359c2b,null))['then'](respondWithResult(_0x359c2b,null))['catch'](handleError(_0x359c2b,null));};exports['create']=function(_0x9f94ea,_0x15a271){return db[_0xbf72('0x30')][_0xbf72('0x48')](_0x9f94ea[_0xbf72('0x49')],{})[_0xbf72('0x25')](function(_0x530663){var _0x3ffa72=_0x9f94ea['user'][_0xbf72('0x27')]({'plain':!![]});if(!_0x3ffa72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ffa72[_0xbf72('0x4a')]===_0xbf72('0x4b')){var _0x45e4d5=_0x530663[_0xbf72('0x27')]({'plain':!![]});var _0x26ce94=_0xbf72('0x28');return db[_0xbf72('0x4c')][_0xbf72('0x4d')]({'where':{'name':_0x26ce94,'userProfileId':_0x3ffa72[_0xbf72('0x4e')]},'raw':!![]})['then'](function(_0x1fb168){if(_0x1fb168&&_0x1fb168[_0xbf72('0x4f')]===0x0){return db[_0xbf72('0x50')]['create']({'name':_0x45e4d5[_0xbf72('0x2c')],'resourceId':_0x45e4d5['id'],'type':_0x1fb168[_0xbf72('0x2c')],'sectionId':_0x1fb168['id']},{})[_0xbf72('0x25')](function(){return _0x530663;});}else{return _0x530663;}})[_0xbf72('0x51')](function(_0x824918){logger['error'](_0xbf72('0x52'),_0x824918);throw _0x824918;});}return _0x530663;})[_0xbf72('0x25')](respondWithResult(_0x15a271,0xc9))['catch'](handleError(_0x15a271,null));};exports[_0xbf72('0x24')]=function(_0x5e2dcd,_0x58080b){if(_0x5e2dcd[_0xbf72('0x49')]['id']){delete _0x5e2dcd[_0xbf72('0x49')]['id'];}return db[_0xbf72('0x30')][_0xbf72('0x4d')]({'where':{'id':_0x5e2dcd[_0xbf72('0x46')]['id']}})['then'](handleEntityNotFound(_0x58080b,null))['then'](saveUpdates(_0x5e2dcd['body'],null))[_0xbf72('0x25')](respondWithResult(_0x58080b,null))[_0xbf72('0x51')](handleError(_0x58080b,null));};exports[_0xbf72('0x26')]=function(_0x1648d0,_0x5cfbc4){return db['VoiceChanSpy'][_0xbf72('0x4d')]({'where':{'id':_0x1648d0[_0xbf72('0x46')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x5cfbc4,null))['then'](removeEntity(_0x5cfbc4,null))[_0xbf72('0x51')](handleError(_0x5cfbc4,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e921954..69ff022 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 _0xa740=['VoiceExtension','destroy','lodash','bluebird','./voiceChanSpy.attributes','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate'];(function(_0x4263fd,_0x1cdd3f){var _0x187951=function(_0x10d274){while(--_0x10d274){_0x4263fd['push'](_0x4263fd['shift']());}};_0x187951(++_0x1cdd3f);}(_0xa740,0xe0));var _0x0a74=function(_0x6f6d62,_0x13996b){_0x6f6d62=_0x6f6d62-0x0;var _0x12010b=_0xa740[_0x6f6d62];return _0x12010b;};'use strict';var _=require(_0x0a74('0x0'));var util=require('util');var BPromise=require(_0x0a74('0x1'));var attributes=require(_0x0a74('0x2'));var getUserApplications=function(_0x1c025d,_0x4ad11e,_0x26c4b8){var _0x3e9d51=0x1;var _0x17bfc5=[];var _0x542907={'context':_0x4ad11e['context']||'from-sip','exten':util[_0x0a74('0x3')](_0x0a74('0x4'),_0x1c025d[_0x0a74('0x5')],_0x26c4b8),'type':_0x0a74('0x6'),'isApp':![],'ChanSpyId':_0x1c025d['id'],'UserId':_0x4ad11e['id']};_0x17bfc5[_0x0a74('0x7')](_[_0x0a74('0x8')]({'app':_0x0a74('0x9'),'appdata':util[_0x0a74('0x3')](_0x0a74('0xa'),'chanspy'),'priority':_0x3e9d51++},_0x542907));if(_0x1c025d[_0x0a74('0xb')]){_0x17bfc5[_0x0a74('0x7')](_[_0x0a74('0x8')]({'app':_0x0a74('0xc'),'appdata':util[_0x0a74('0x3')](_0x0a74('0xd'),_0x1c025d[_0x0a74('0xe')]),'priority':_0x3e9d51++},_0x542907));}if(_0x1c025d['auth']){_0x17bfc5[_0x0a74('0x7')](_[_0x0a74('0x8')]({'app':_0x0a74('0xf'),'appdata':_0x1c025d[_0x0a74('0x10')],'priority':_0x3e9d51++},_0x542907));}_0x17bfc5[_0x0a74('0x7')](_[_0x0a74('0x8')]({'app':_0x0a74('0x11'),'appdata':util[_0x0a74('0x3')](_0x0a74('0x12'),_0x4ad11e[_0x0a74('0x13')],_0x1c025d[_0x0a74('0x14')]?_0x1c025d[_0x0a74('0x14')]['join'](''):''),'priority':_0x3e9d51++},_0x542907));if(_0x1c025d['record']){_0x17bfc5[_0x0a74('0x7')](_['merge']({'app':_0x0a74('0x15'),'priority':_0x3e9d51++},_0x542907));}return _0x17bfc5;};var getChanSpyApplications=function(_0x4f09e4,_0x4f2269){var _0x139c49=[];for(var _0x2d59d6=0x0,_0x280d93=0x1;_0x2d59d6<_0x4f2269[_0x0a74('0x16')];_0x2d59d6++,_0x280d93=0x1){_0x139c49=_0x139c49[_0x0a74('0x17')](getUserApplications(_0x4f09e4,_0x4f2269[_0x2d59d6],_0x4f2269[_0x2d59d6][_0x0a74('0x18')]));if(_0x4f2269[_0x2d59d6][_0x0a74('0x18')]!=_0x4f2269[_0x2d59d6][_0x0a74('0x13')]){_0x139c49=_0x139c49[_0x0a74('0x17')](getUserApplications(_0x4f09e4,_0x4f2269[_0x2d59d6],_0x4f2269[_0x2d59d6][_0x0a74('0x13')]));}}return _0x139c49;};var getChanSpyPromise=function(_0x23e077,_0x1bae30){return new BPromise(function(_0x3e9263,_0x21ec41){return _0x23e077[_0x0a74('0x19')]['findAll']({'attributes':['id',_0x0a74('0x13'),_0x0a74('0x18')],'where':{'role':_0x0a74('0x1a'),'chanspy':!![]},'raw':!![]})[_0x0a74('0x1b')](function(_0x1a44f9){if(_0x1a44f9){return _0x3e9263(getChanSpyApplications(_0x1bae30,_0x1a44f9));}return _0x3e9263([]);})[_0x0a74('0x1c')](function(_0x5f255b){_0x21ec41(_0x5f255b);});});};module[_0x0a74('0x1d')]=function(_0x1c073b,_0x2f688b){var _0x131de1=_0x1c073b[_0x0a74('0x1e')];return _0x1c073b[_0x0a74('0x1f')](_0x0a74('0x20'),attributes,{'tableName':_0x0a74('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1191f4,_0x3aaf83,_0x13bff6){return getChanSpyPromise(_0x131de1,_0x1191f4)[_0x0a74('0x1b')](function(_0x6aa42e){if(_0x6aa42e&&_0x6aa42e[_0x0a74('0x16')]){return _0x131de1['VoiceExtension'][_0x0a74('0x22')](_0x6aa42e);}})['then'](function(){_0x13bff6();})[_0x0a74('0x1c')](function(_0x5e3a7b){_0x13bff6(_0x5e3a7b);});},'afterUpdate':function(_0x2063b2,_0xb83028,_0x5cd376){return _0x131de1[_0x0a74('0x23')][_0x0a74('0x24')]({'where':{'ChanSpyId':_0x2063b2['id']}})['then'](function(){return getChanSpyPromise(_0x131de1,_0x2063b2);})[_0x0a74('0x1b')](function(_0x7798cd){if(_0x7798cd&&_0x7798cd[_0x0a74('0x16')]){return _0x131de1[_0x0a74('0x23')][_0x0a74('0x22')](_0x7798cd);}})[_0x0a74('0x1b')](function(){_0x5cd376();})[_0x0a74('0x1c')](function(_0x439248){_0x5cd376(_0x439248);});},'afterDestroy':function(_0x40b08e,_0x20baca,_0x173d8b){return _0x131de1[_0x0a74('0x23')]['destroy']({'where':{'ChanSpyId':_0x40b08e['id']}})[_0x0a74('0x1b')](function(){_0x173d8b();})['catch'](function(_0x5460a2){_0x173d8b(_0x5460a2);});}}});}; \ No newline at end of file +var _0xa88f=['length','internal','User','findAll','catch','exports','define','VoiceChanSpy','voice_chanspy','then','bulkCreate','VoiceExtension','destroy','lodash','util','./voiceChanSpy.attributes','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','push','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor'];(function(_0x51b519,_0x5499da){var _0x4e31f1=function(_0x37ded5){while(--_0x37ded5){_0x51b519['push'](_0x51b519['shift']());}};_0x4e31f1(++_0x5499da);}(_0xa88f,0x99));var _0xfa88=function(_0x11451f,_0x343198){_0x11451f=_0x11451f-0x0;var _0x30fcac=_0xa88f[_0x11451f];return _0x30fcac;};'use strict';var _=require(_0xfa88('0x0'));var util=require(_0xfa88('0x1'));var BPromise=require('bluebird');var attributes=require(_0xfa88('0x2'));var getUserApplications=function(_0xaa6f64,_0x4f6ab9,_0x429467){var _0x389e94=0x1;var _0x55235c=[];var _0x214757={'context':_0x4f6ab9['context']||'from-sip','exten':util[_0xfa88('0x3')](_0xfa88('0x4'),_0xaa6f64[_0xfa88('0x5')],_0x429467),'type':_0xfa88('0x6'),'isApp':![],'ChanSpyId':_0xaa6f64['id'],'UserId':_0x4f6ab9['id']};_0x55235c['push'](_[_0xfa88('0x7')]({'app':_0xfa88('0x8'),'appdata':util[_0xfa88('0x3')](_0xfa88('0x9'),_0xfa88('0xa')),'priority':_0x389e94++},_0x214757));if(_0xaa6f64[_0xfa88('0xb')]){_0x55235c['push'](_['merge']({'app':'MixMonitor','appdata':util[_0xfa88('0x3')](_0xfa88('0xc'),_0xaa6f64[_0xfa88('0xd')]),'priority':_0x389e94++},_0x214757));}if(_0xaa6f64[_0xfa88('0xe')]){_0x55235c[_0xfa88('0xf')](_[_0xfa88('0x7')]({'app':'Authenticate','appdata':_0xaa6f64['password'],'priority':_0x389e94++},_0x214757));}_0x55235c[_0xfa88('0xf')](_[_0xfa88('0x7')]({'app':_0xfa88('0x10'),'appdata':util[_0xfa88('0x3')](_0xfa88('0x11'),_0x4f6ab9[_0xfa88('0x12')],_0xaa6f64[_0xfa88('0x13')]?_0xaa6f64[_0xfa88('0x13')][_0xfa88('0x14')](''):''),'priority':_0x389e94++},_0x214757));if(_0xaa6f64[_0xfa88('0xb')]){_0x55235c[_0xfa88('0xf')](_['merge']({'app':_0xfa88('0x15'),'priority':_0x389e94++},_0x214757));}return _0x55235c;};var getChanSpyApplications=function(_0xf47d3e,_0x1fd83a){var _0x490c35=[];for(var _0x1f736e=0x0,_0x2b0fbb=0x1;_0x1f736e<_0x1fd83a[_0xfa88('0x16')];_0x1f736e++,_0x2b0fbb=0x1){_0x490c35=_0x490c35['concat'](getUserApplications(_0xf47d3e,_0x1fd83a[_0x1f736e],_0x1fd83a[_0x1f736e][_0xfa88('0x17')]));if(_0x1fd83a[_0x1f736e][_0xfa88('0x17')]!=_0x1fd83a[_0x1f736e][_0xfa88('0x12')]){_0x490c35=_0x490c35['concat'](getUserApplications(_0xf47d3e,_0x1fd83a[_0x1f736e],_0x1fd83a[_0x1f736e][_0xfa88('0x12')]));}}return _0x490c35;};var getChanSpyPromise=function(_0x237112,_0x58e203){return new BPromise(function(_0x2d6750,_0x3a1e15){return _0x237112[_0xfa88('0x18')][_0xfa88('0x19')]({'attributes':['id',_0xfa88('0x12'),_0xfa88('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x33f685){if(_0x33f685){return _0x2d6750(getChanSpyApplications(_0x58e203,_0x33f685));}return _0x2d6750([]);})[_0xfa88('0x1a')](function(_0x1364ed){_0x3a1e15(_0x1364ed);});});};module[_0xfa88('0x1b')]=function(_0x3cfc71,_0x37c2fe){var _0x166137=_0x3cfc71['models'];return _0x3cfc71[_0xfa88('0x1c')](_0xfa88('0x1d'),attributes,{'tableName':_0xfa88('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x44ad34,_0x30c5c3,_0x2a9b6f){return getChanSpyPromise(_0x166137,_0x44ad34)[_0xfa88('0x1f')](function(_0x3e4ffe){if(_0x3e4ffe&&_0x3e4ffe[_0xfa88('0x16')]){return _0x166137['VoiceExtension'][_0xfa88('0x20')](_0x3e4ffe);}})[_0xfa88('0x1f')](function(){_0x2a9b6f();})[_0xfa88('0x1a')](function(_0x12ef4c){_0x2a9b6f(_0x12ef4c);});},'afterUpdate':function(_0x4835f7,_0x126815,_0x54d684){return _0x166137[_0xfa88('0x21')][_0xfa88('0x22')]({'where':{'ChanSpyId':_0x4835f7['id']}})[_0xfa88('0x1f')](function(){return getChanSpyPromise(_0x166137,_0x4835f7);})[_0xfa88('0x1f')](function(_0xacf72d){if(_0xacf72d&&_0xacf72d[_0xfa88('0x16')]){return _0x166137[_0xfa88('0x21')]['bulkCreate'](_0xacf72d);}})['then'](function(){_0x54d684();})[_0xfa88('0x1a')](function(_0x42b719){_0x54d684(_0x42b719);});},'afterDestroy':function(_0x585ba0,_0x101bff,_0x3413ab){return _0x166137[_0xfa88('0x21')][_0xfa88('0x22')]({'where':{'ChanSpyId':_0x585ba0['id']}})['then'](function(){_0x3413ab();})[_0xfa88('0x1a')](function(_0x226690){_0x3413ab(_0x226690);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a3bc8f2..23ec3dd 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 _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x3b9569,_0x8021bc){var _0x19892d=function(_0x3e0fe2){while(--_0x3e0fe2){_0x3b9569['push'](_0x3b9569['shift']());}};_0x19892d(++_0x8021bc);}(_0x54f3,0x120));var _0x354f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x54f3[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});} \ No newline at end of file +var _0x2dae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x2cbbfc,_0x3dfe62){var _0x5cda74=function(_0x1fa9dd){while(--_0x1fa9dd){_0x2cbbfc['push'](_0x2cbbfc['shift']());}};_0x5cda74(++_0x3dfe62);}(_0x2dae,0xc3));var _0xe2da=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x2dae[_0x3ad7ad];return _0x225a60;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9a2bec8..6a0f252 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 _0xd37d=['isAuthenticated','index','/:id','post','create','put','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get'];(function(_0x2cea84,_0x597dde){var _0x57315d=function(_0x307035){while(--_0x307035){_0x2cea84['push'](_0x2cea84['shift']());}};_0x57315d(++_0x597dde);}(_0xd37d,0x14a));var _0xdd37=function(_0x1707f0,_0x23f136){_0x1707f0=_0x1707f0-0x0;var _0xccacd1=_0xd37d[_0x1707f0];return _0xccacd1;};'use strict';var multer=require(_0xdd37('0x0'));var util=require('util');var path=require(_0xdd37('0x1'));var timeout=require(_0xdd37('0x2'));var express=require(_0xdd37('0x3'));var router=express[_0xdd37('0x4')]();var fs_extra=require(_0xdd37('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdd37('0x6'));var config=require(_0xdd37('0x7'));var controller=require(_0xdd37('0x8'));router[_0xdd37('0x9')]('/',auth[_0xdd37('0xa')](),controller[_0xdd37('0xb')]);router[_0xdd37('0x9')](_0xdd37('0xc'),auth[_0xdd37('0xa')](),controller['show']);router[_0xdd37('0xd')]('/',auth['isAuthenticated'](),controller[_0xdd37('0xe')]);router[_0xdd37('0xf')]('/:id',auth[_0xdd37('0xa')](),controller['update']);router['delete'](_0xdd37('0xc'),auth['isAuthenticated'](),controller[_0xdd37('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf336=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','post','create','put','/:id','delete','exports'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0xf336,0x99));var _0x6f33=function(_0x5d49e2,_0x14b335){_0x5d49e2=_0x5d49e2-0x0;var _0x379b9e=_0xf336[_0x5d49e2];return _0x379b9e;};'use strict';var multer=require(_0x6f33('0x0'));var util=require(_0x6f33('0x1'));var path=require(_0x6f33('0x2'));var timeout=require(_0x6f33('0x3'));var express=require(_0x6f33('0x4'));var router=express[_0x6f33('0x5')]();var fs_extra=require(_0x6f33('0x6'));var auth=require(_0x6f33('0x7'));var interaction=require(_0x6f33('0x8'));var config=require('../../config/environment');var controller=require(_0x6f33('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x6f33('0xa')](),controller['show']);router[_0x6f33('0xb')]('/',auth[_0x6f33('0xa')](),controller[_0x6f33('0xc')]);router[_0x6f33('0xd')](_0x6f33('0xe'),auth[_0x6f33('0xa')](),controller['update']);router[_0x6f33('0xf')]('/:id',auth[_0x6f33('0xa')](),controller['destroy']);module[_0x6f33('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 598cd05..bc66694 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 _0xabde=['STRING','name','BOOLEAN','sequelize'];(function(_0x594b73,_0x182dce){var _0x408451=function(_0x5a67ab){while(--_0x5a67ab){_0x594b73['push'](_0x594b73['shift']());}};_0x408451(++_0x182dce);}(_0xabde,0x147));var _0xeabd=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0xabde[_0x592d48];return _0x5d789e;};'use strict';var Sequelize=require(_0xeabd('0x0'));module['exports']={'name':{'type':Sequelize[_0xeabd('0x1')],'unique':_0xeabd('0x2')},'description':{'type':Sequelize[_0xeabd('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xeabd('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2bcc=['STRING','name','BOOLEAN','exports'];(function(_0x565697,_0x3b7acb){var _0x1b44bf=function(_0x4e9ff0){while(--_0x4e9ff0){_0x565697['push'](_0x565697['shift']());}};_0x1b44bf(++_0x3b7acb);}(_0x2bcc,0x1a7));var _0xc2bc=function(_0x1c60bf,_0x5398b8){_0x1c60bf=_0x1c60bf-0x0;var _0x4e7c04=_0x2bcc[_0x1c60bf];return _0x4e7c04;};'use strict';var Sequelize=require('sequelize');module[_0xc2bc('0x0')]={'name':{'type':Sequelize[_0xc2bc('0x1')],'unique':_0xc2bc('0x2')},'description':{'type':Sequelize[_0xc2bc('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc2bc('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 a50ade1..0f2600a 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 _0xf044=['Content-Range','apply','reject','update','then','destroy','get','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','merge','find','create','body','join','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','root','utf8','render','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x18de79,_0x484923){var _0x1d43e4=function(_0x4a4570){while(--_0x4a4570){_0x18de79['push'](_0x18de79['shift']());}};_0x1d43e4(++_0x484923);}(_0xf044,0xa4));var _0x4f04=function(_0x38b8bf,_0x13fe6d){_0x38b8bf=_0x38b8bf-0x0;var _0xdcb1a8=_0xf044[_0x38b8bf];return _0xdcb1a8;};'use strict';var emlformat=require(_0x4f04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f04('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f04('0x2'));var moment=require(_0x4f04('0x3'));var BPromise=require(_0x4f04('0x4'));var Mustache=require(_0x4f04('0x5'));var util=require(_0x4f04('0x6'));var path=require(_0x4f04('0x7'));var sox=require(_0x4f04('0x8'));var csv=require('to-csv');var ejs=require(_0x4f04('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f04('0xa'));var squel=require('squel');var crypto=require(_0x4f04('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4f04('0xc'));var toCsv=require(_0x4f04('0xd'));var querystring=require(_0x4f04('0xe'));var Papa=require(_0x4f04('0xf'));var Redis=require(_0x4f04('0x10'));var authService=require(_0x4f04('0x11'));var qs=require(_0x4f04('0x12'));var as=require(_0x4f04('0x13'));var hardwareService=require(_0x4f04('0x14'));var logger=require(_0x4f04('0x15'))(_0x4f04('0x16'));var utils=require(_0x4f04('0x17'));var config=require(_0x4f04('0x18'));var licenseUtil=require(_0x4f04('0x19'));var db=require(_0x4f04('0x1a'))['db'];var jayson=require(_0x4f04('0x1b'));var client=jayson['client'][_0x4f04('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x61315a,_0x5c4a08,_0x1a1f97,_0x324fc8){return new BPromise(function(_0x1edfda,_0x740c72){var _0x4f1e1f=_0x324fc8||client;return _0x4f1e1f[_0x4f04('0x1d')](_0x61315a,_0x1a1f97)['then'](function(_0x3f9c88){logger[_0x4f04('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x5c4a08,_0x4f04('0x1f'));logger[_0x4f04('0x20')](_0x4f04('0x21'),_0x5c4a08,_0x4f04('0x1f'),JSON[_0x4f04('0x22')](_0x3f9c88));if(_0x3f9c88[_0x4f04('0x23')]){if(_0x3f9c88[_0x4f04('0x23')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5c4a08,_0x3f9c88[_0x4f04('0x23')][_0x4f04('0x24')]);return _0x740c72(_0x3f9c88['error']['message']);}logger[_0x4f04('0x23')](_0x4f04('0x25'),_0x5c4a08,_0x3f9c88[_0x4f04('0x23')]['message']);return _0x1edfda(_0x3f9c88[_0x4f04('0x23')][_0x4f04('0x24')]);}else{logger[_0x4f04('0x1e')](_0x4f04('0x25'),_0x5c4a08,_0x4f04('0x1f'));_0x1edfda(_0x3f9c88[_0x4f04('0x26')][_0x4f04('0x24')]);}})[_0x4f04('0x27')](function(_0x12bd07){logger['error'](_0x4f04('0x25'),_0x5c4a08,_0x12bd07);_0x740c72(_0x12bd07);});});}function respondWithStatusCode(_0x398665,_0x4df74d){_0x4df74d=_0x4df74d||0xcc;return function(_0x53e704){if(_0x53e704){return _0x398665[_0x4f04('0x28')](_0x4df74d);}return _0x398665[_0x4f04('0x29')](_0x4df74d)[_0x4f04('0x2a')]();};}function respondWithResult(_0x3111ee,_0x2c6c88){_0x2c6c88=_0x2c6c88||0xc8;return function(_0x2973a2){if(_0x2973a2){return _0x3111ee[_0x4f04('0x29')](_0x2c6c88)[_0x4f04('0x2b')](_0x2973a2);}};}function respondWithFilteredResult(_0x4c514d,_0x57fdb3){return function(_0x368b1b){if(_0x368b1b){var _0x119bb4=typeof _0x57fdb3[_0x4f04('0x2c')]===_0x4f04('0x2d')&&typeof _0x57fdb3[_0x4f04('0x2e')]===_0x4f04('0x2d');var _0x5ce2b7=_0x368b1b['count'];var _0x362d4e=_0x119bb4?0x0:_0x57fdb3[_0x4f04('0x2c')];var _0x2ad821=_0x119bb4?_0x368b1b[_0x4f04('0x2f')]:_0x57fdb3['offset']+_0x57fdb3[_0x4f04('0x2e')];var _0x31a34d;if(_0x2ad821>=_0x5ce2b7){_0x2ad821=_0x5ce2b7;_0x31a34d=0xc8;}else{_0x31a34d=0xce;}_0x4c514d[_0x4f04('0x29')](_0x31a34d);return _0x4c514d['set'](_0x4f04('0x30'),_0x362d4e+'-'+_0x2ad821+'/'+_0x5ce2b7)[_0x4f04('0x2b')](_0x368b1b);}return null;};}function patchUpdates(_0x55f6db){return function(_0x3c0388){try{jsonpatch[_0x4f04('0x31')](_0x3c0388,_0x55f6db,!![]);}catch(_0x4a6149){return BPromise[_0x4f04('0x32')](_0x4a6149);}return _0x3c0388['save']();};}function saveUpdates(_0x1350c8,_0x5380ba){return function(_0x2c837b){if(_0x2c837b){return _0x2c837b[_0x4f04('0x33')](_0x1350c8)[_0x4f04('0x34')](function(_0x224a64){return _0x224a64;});}return null;};}function removeEntity(_0x403ecc,_0x48536c){return function(_0x1c4cf6){if(_0x1c4cf6){return _0x1c4cf6[_0x4f04('0x35')]()[_0x4f04('0x34')](function(){var _0x37cc85=_0x1c4cf6[_0x4f04('0x36')]({'plain':!![]});var _0x59c1c2='Contexts';return db['UserProfileResource'][_0x4f04('0x35')]({'where':{'type':_0x59c1c2,'resourceId':_0x37cc85['id']}})[_0x4f04('0x34')](function(){return _0x1c4cf6;});})[_0x4f04('0x34')](function(){_0x403ecc[_0x4f04('0x29')](0xcc)[_0x4f04('0x2a')]();});}};}function handleEntityNotFound(_0x2146a4,_0x5971da){return function(_0x4058d5){if(!_0x4058d5){_0x2146a4['sendStatus'](0x194);}return _0x4058d5;};}function handleError(_0x323094,_0x184e4a){_0x184e4a=_0x184e4a||0x1f4;return function(_0x596ff0){logger['error'](_0x596ff0[_0x4f04('0x37')]);if(_0x596ff0['name']){delete _0x596ff0[_0x4f04('0x38')];}_0x323094[_0x4f04('0x29')](_0x184e4a)[_0x4f04('0x39')](_0x596ff0);};}exports[_0x4f04('0x3a')]=function(_0xc961fd,_0x160bb7){var _0xe93da6={},_0x57067c={},_0x2d3f0d={'count':0x0,'rows':[]};var _0x4ecd91=_['map'](db['VoiceContext'][_0x4f04('0x3b')],function(_0x104820){return{'name':_0x104820[_0x4f04('0x3c')],'type':_0x104820[_0x4f04('0x3d')][_0x4f04('0x3e')]};});_0x57067c[_0x4f04('0x3f')]=_[_0x4f04('0x40')](_0x4ecd91,_0x4f04('0x38'));_0x57067c[_0x4f04('0x41')]=_[_0x4f04('0x42')](_0xc961fd['query']);_0x57067c['filters']=_[_0x4f04('0x43')](_0x57067c[_0x4f04('0x3f')],_0x57067c[_0x4f04('0x41')]);_0xe93da6['attributes']=_['intersection'](_0x57067c[_0x4f04('0x3f')],qs['fields'](_0xc961fd[_0x4f04('0x41')][_0x4f04('0x44')]));_0xe93da6[_0x4f04('0x45')]=_0xe93da6['attributes'][_0x4f04('0x46')]?_0xe93da6['attributes']:_0x57067c[_0x4f04('0x3f')];if(!_0xc961fd[_0x4f04('0x41')][_0x4f04('0x47')](_0x4f04('0x48'))){_0xe93da6[_0x4f04('0x2e')]=qs[_0x4f04('0x2e')](_0xc961fd[_0x4f04('0x41')][_0x4f04('0x2e')]);_0xe93da6[_0x4f04('0x2c')]=qs[_0x4f04('0x2c')](_0xc961fd[_0x4f04('0x41')][_0x4f04('0x2c')]);}_0xe93da6[_0x4f04('0x49')]=qs[_0x4f04('0x4a')](_0xc961fd['query'][_0x4f04('0x4a')]);_0xe93da6[_0x4f04('0x4b')]=qs[_0x4f04('0x4c')](_[_0x4f04('0x4d')](_0xc961fd[_0x4f04('0x41')],_0x57067c[_0x4f04('0x4c')]),_0x4ecd91);if(_0xc961fd[_0x4f04('0x41')][_0x4f04('0x4e')]){_0xe93da6[_0x4f04('0x4b')]=_['merge'](_0xe93da6[_0x4f04('0x4b')],{'$or':_[_0x4f04('0x40')](_0x4ecd91,function(_0x21a193){if(_0x21a193[_0x4f04('0x3d')]!==_0x4f04('0x4f')){var _0xfd958d={};_0xfd958d[_0x21a193[_0x4f04('0x38')]]={'$like':'%'+_0xc961fd[_0x4f04('0x41')][_0x4f04('0x4e')]+'%'};return _0xfd958d;}})});}_0xe93da6=_['merge']({},_0xe93da6,_0xc961fd[_0x4f04('0x50')]);var _0x47602e={'where':_0xe93da6['where']};return db[_0x4f04('0x51')][_0x4f04('0x2f')](_0x47602e)[_0x4f04('0x34')](function(_0x5adca8){_0x2d3f0d[_0x4f04('0x2f')]=_0x5adca8;if(_0xc961fd[_0x4f04('0x41')][_0x4f04('0x52')]){_0xe93da6[_0x4f04('0x53')]=[{'all':!![]}];}return db[_0x4f04('0x51')][_0x4f04('0x54')](_0xe93da6);})['then'](function(_0x594ba2){_0x2d3f0d[_0x4f04('0x55')]=_0x594ba2;return _0x2d3f0d;})['then'](respondWithFilteredResult(_0x160bb7,_0xe93da6))[_0x4f04('0x27')](handleError(_0x160bb7,null));};exports[_0x4f04('0x56')]=function(_0x320589,_0x28738d){var _0x1ee480={'raw':![],'where':{'id':_0x320589['params']['id']}},_0x1d404c={};_0x1d404c[_0x4f04('0x3f')]=_[_0x4f04('0x42')](db['VoiceContext']['rawAttributes']);_0x1d404c[_0x4f04('0x41')]=_['keys'](_0x320589[_0x4f04('0x41')]);_0x1d404c[_0x4f04('0x4c')]=_[_0x4f04('0x43')](_0x1d404c['model'],_0x1d404c[_0x4f04('0x41')]);_0x1ee480[_0x4f04('0x45')]=_[_0x4f04('0x43')](_0x1d404c[_0x4f04('0x3f')],qs[_0x4f04('0x44')](_0x320589[_0x4f04('0x41')][_0x4f04('0x44')]));_0x1ee480[_0x4f04('0x45')]=_0x1ee480[_0x4f04('0x45')][_0x4f04('0x46')]?_0x1ee480[_0x4f04('0x45')]:_0x1d404c[_0x4f04('0x3f')];if(_0x320589[_0x4f04('0x41')][_0x4f04('0x52')]){_0x1ee480[_0x4f04('0x53')]=[{'all':!![]}];}_0x1ee480=_[_0x4f04('0x57')]({},_0x1ee480,_0x320589['options']);return db[_0x4f04('0x51')][_0x4f04('0x58')](_0x1ee480)['then'](handleEntityNotFound(_0x28738d,null))[_0x4f04('0x34')](respondWithResult(_0x28738d,null))[_0x4f04('0x27')](handleError(_0x28738d,null));};exports[_0x4f04('0x59')]=function(_0x17fb09,_0x55d030,_0x34ebb8){var _0x1e8f24;return db[_0x4f04('0x51')][_0x4f04('0x59')](_0x17fb09[_0x4f04('0x5a')],{'raw':!![]})['then'](function(_0xf3840c){_0x1e8f24=_0xf3840c;return db['VoiceContext'][_0x4f04('0x54')]({'raw':!![]});})[_0x4f04('0x34')](function(_0x2ca674){var _0x168ec1=fs['readFileSync'](path[_0x4f04('0x5b')](config['root'],_0x4f04('0x5c')),'utf8');var _0x340556=ejs['render'](_0x168ec1,{'contexts':_0x2ca674||[]});fs[_0x4f04('0x5d')](_0x4f04('0x5e'),_0x340556);})[_0x4f04('0x34')](function(){return respondWithRpcPromise(_0x4f04('0x5f'),'create',{'module':_0x4f04('0x60')});})[_0x4f04('0x34')](function(){var _0x300c0a=_0x17fb09[_0x4f04('0x61')][_0x4f04('0x36')]({'plain':!![]});if(!_0x300c0a)throw new Error(_0x4f04('0x62'));if(_0x300c0a['role']===_0x4f04('0x61')){var _0x19986d=_0x1e8f24[_0x4f04('0x36')]({'plain':!![]});return db[_0x4f04('0x63')][_0x4f04('0x58')]({'where':{'name':'Contexts','userProfileId':_0x300c0a[_0x4f04('0x64')]},'raw':!![]})['then'](function(_0x48db70){if(_0x48db70&&_0x48db70[_0x4f04('0x65')]===0x0){return db['UserProfileResource'][_0x4f04('0x59')]({'name':_0x19986d['name'],'resourceId':_0x19986d['id'],'type':_0x48db70[_0x4f04('0x38')],'sectionId':_0x48db70['id']},{})['then'](function(){return _0x1e8f24;});}else{return _0x1e8f24;}})[_0x4f04('0x27')](function(_0x319bc5){logger[_0x4f04('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x319bc5);throw _0x319bc5;});}return _0x1e8f24;})[_0x4f04('0x34')](respondWithResult(_0x55d030,0xc9))['catch'](handleError(_0x55d030,null));};exports[_0x4f04('0x33')]=function(_0x2d6eba,_0x571e1c,_0xe1db7f){var _0x589b75;return db[_0x4f04('0x51')][_0x4f04('0x58')]({'where':{'id':_0x2d6eba[_0x4f04('0x66')]['id']}})[_0x4f04('0x34')](handleEntityNotFound(_0x571e1c,null))[_0x4f04('0x34')](saveUpdates(_0x2d6eba[_0x4f04('0x5a')],null))[_0x4f04('0x34')](function(_0x10ef88){if(_0x10ef88){_0x589b75=_0x10ef88;return db[_0x4f04('0x51')]['findAll']({'raw':!![]});}})[_0x4f04('0x34')](function(_0x1115fd){var _0x1c18a7=fs['readFileSync'](path[_0x4f04('0x5b')](config[_0x4f04('0x67')],_0x4f04('0x5c')),_0x4f04('0x68'));var _0x2c64a0=ejs[_0x4f04('0x69')](_0x1c18a7,{'contexts':_0x1115fd||[]});fs[_0x4f04('0x5d')](_0x4f04('0x5e'),_0x2c64a0);})[_0x4f04('0x34')](function(){return respondWithRpcPromise(_0x4f04('0x5f'),_0x4f04('0x33'),{'module':_0x4f04('0x60')});})[_0x4f04('0x34')](function(){return _0x589b75;})[_0x4f04('0x34')](respondWithResult(_0x571e1c,null))[_0x4f04('0x27')](handleError(_0x571e1c,null));};exports[_0x4f04('0x35')]=function(_0x27059d,_0x2c7719,_0x24b989){var _0x153e2b;return db[_0x4f04('0x51')]['find']({'where':{'id':_0x27059d[_0x4f04('0x66')]['id']}})['then'](handleEntityNotFound(_0x2c7719,null))[_0x4f04('0x34')](removeEntity(_0x2c7719,null))[_0x4f04('0x34')](function(){return db[_0x4f04('0x51')][_0x4f04('0x54')]({'raw':!![]});})[_0x4f04('0x34')](function(_0x215d83){var _0x1b40ae=fs['readFileSync'](path[_0x4f04('0x5b')](config[_0x4f04('0x67')],_0x4f04('0x5c')),_0x4f04('0x68'));var _0x3b5c20=ejs[_0x4f04('0x69')](_0x1b40ae,{'contexts':_0x215d83});fs[_0x4f04('0x5d')](_0x4f04('0x5e'),_0x3b5c20);return respondWithRpcPromise('Reload',_0x4f04('0x35'),{'module':_0x4f04('0x60')});})[_0x4f04('0x27')](handleError(_0x2c7719,null));}; \ No newline at end of file +var _0x12e6=['include','findAll','rows','show','params','find','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','writeFileSync','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','end','stack','name','map','VoiceContext','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x119d66,_0x22a22d){var _0x138874=function(_0x367a11){while(--_0x367a11){_0x119d66['push'](_0x119d66['shift']());}};_0x138874(++_0x22a22d);}(_0x12e6,0x1aa));var _0x612e=function(_0x1f6e75,_0x587078){_0x1f6e75=_0x1f6e75-0x0;var _0x40ea17=_0x12e6[_0x1f6e75];return _0x40ea17;};'use strict';var emlformat=require(_0x612e('0x0'));var rimraf=require(_0x612e('0x1'));var zipdir=require(_0x612e('0x2'));var jsonpatch=require(_0x612e('0x3'));var rp=require(_0x612e('0x4'));var moment=require(_0x612e('0x5'));var BPromise=require(_0x612e('0x6'));var Mustache=require(_0x612e('0x7'));var util=require('util');var path=require(_0x612e('0x8'));var sox=require(_0x612e('0x9'));var csv=require(_0x612e('0xa'));var ejs=require(_0x612e('0xb'));var fs=require('fs');var fs_extra=require(_0x612e('0xc'));var _=require(_0x612e('0xd'));var squel=require('squel');var crypto=require(_0x612e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x612e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x612e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x612e('0x11'));var hardwareService=require(_0x612e('0x12'));var logger=require('../../config/logger')(_0x612e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x612e('0x14'));var db=require(_0x612e('0x15'))['db'];var jayson=require(_0x612e('0x16'));var client=jayson[_0x612e('0x17')][_0x612e('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1e2e3c,_0x48d1c2,_0x1913c3,_0x1e107c){return new BPromise(function(_0x404f7e,_0x4397f4){var _0x541473=_0x1e107c||client;return _0x541473[_0x612e('0x19')](_0x1e2e3c,_0x1913c3)[_0x612e('0x1a')](function(_0x1425f5){logger[_0x612e('0x1b')](_0x612e('0x1c'),_0x48d1c2,_0x612e('0x1d'));logger[_0x612e('0x1e')](_0x612e('0x1f'),_0x48d1c2,_0x612e('0x1d'),JSON['stringify'](_0x1425f5));if(_0x1425f5[_0x612e('0x20')]){if(_0x1425f5[_0x612e('0x20')]['code']===0x1f4){logger['error'](_0x612e('0x1c'),_0x48d1c2,_0x1425f5[_0x612e('0x20')][_0x612e('0x21')]);return _0x4397f4(_0x1425f5[_0x612e('0x20')]['message']);}logger[_0x612e('0x20')](_0x612e('0x1c'),_0x48d1c2,_0x1425f5['error']['message']);return _0x404f7e(_0x1425f5['error'][_0x612e('0x21')]);}else{logger[_0x612e('0x1b')](_0x612e('0x1c'),_0x48d1c2,_0x612e('0x1d'));_0x404f7e(_0x1425f5[_0x612e('0x22')]['message']);}})[_0x612e('0x23')](function(_0x1f38ad){logger[_0x612e('0x20')](_0x612e('0x1c'),_0x48d1c2,_0x1f38ad);_0x4397f4(_0x1f38ad);});});}function respondWithStatusCode(_0x3453c5,_0x332727){_0x332727=_0x332727||0xcc;return function(_0x244721){if(_0x244721){return _0x3453c5[_0x612e('0x24')](_0x332727);}return _0x3453c5[_0x612e('0x25')](_0x332727)['end']();};}function respondWithResult(_0x121b91,_0x18f5fb){_0x18f5fb=_0x18f5fb||0xc8;return function(_0x3f42c7){if(_0x3f42c7){return _0x121b91[_0x612e('0x25')](_0x18f5fb)[_0x612e('0x26')](_0x3f42c7);}};}function respondWithFilteredResult(_0x50bd7a,_0x7850aa){return function(_0x43e949){if(_0x43e949){var _0x6b4a45=typeof _0x7850aa[_0x612e('0x27')]===_0x612e('0x28')&&typeof _0x7850aa[_0x612e('0x29')]===_0x612e('0x28');var _0x51285b=_0x43e949[_0x612e('0x2a')];var _0x4d99b0=_0x6b4a45?0x0:_0x7850aa['offset'];var _0xbfed3d=_0x6b4a45?_0x43e949['count']:_0x7850aa['offset']+_0x7850aa['limit'];var _0x47ca60;if(_0xbfed3d>=_0x51285b){_0xbfed3d=_0x51285b;_0x47ca60=0xc8;}else{_0x47ca60=0xce;}_0x50bd7a[_0x612e('0x25')](_0x47ca60);return _0x50bd7a[_0x612e('0x2b')](_0x612e('0x2c'),_0x4d99b0+'-'+_0xbfed3d+'/'+_0x51285b)['json'](_0x43e949);}return null;};}function patchUpdates(_0x8c3be){return function(_0xd57323){try{jsonpatch[_0x612e('0x2d')](_0xd57323,_0x8c3be,!![]);}catch(_0x25a9a9){return BPromise[_0x612e('0x2e')](_0x25a9a9);}return _0xd57323[_0x612e('0x2f')]();};}function saveUpdates(_0x5c2294,_0x2efb45){return function(_0x4e8358){if(_0x4e8358){return _0x4e8358[_0x612e('0x30')](_0x5c2294)[_0x612e('0x1a')](function(_0x37299e){return _0x37299e;});}return null;};}function removeEntity(_0x551f8b,_0x27f2e3){return function(_0x215f46){if(_0x215f46){return _0x215f46['destroy']()['then'](function(){var _0x26edc3=_0x215f46[_0x612e('0x31')]({'plain':!![]});var _0x15ae18=_0x612e('0x32');return db[_0x612e('0x33')]['destroy']({'where':{'type':_0x15ae18,'resourceId':_0x26edc3['id']}})[_0x612e('0x1a')](function(){return _0x215f46;});})[_0x612e('0x1a')](function(){_0x551f8b[_0x612e('0x25')](0xcc)[_0x612e('0x34')]();});}};}function handleEntityNotFound(_0x3f3c69,_0x3c3a82){return function(_0x19e3d4){if(!_0x19e3d4){_0x3f3c69[_0x612e('0x24')](0x194);}return _0x19e3d4;};}function handleError(_0xcded27,_0x2d2b77){_0x2d2b77=_0x2d2b77||0x1f4;return function(_0x642aed){logger[_0x612e('0x20')](_0x642aed[_0x612e('0x35')]);if(_0x642aed[_0x612e('0x36')]){delete _0x642aed['name'];}_0xcded27['status'](_0x2d2b77)['send'](_0x642aed);};}exports['index']=function(_0x32e005,_0x276ef3){var _0x4318c2={},_0x51dbed={},_0x3ae4b9={'count':0x0,'rows':[]};var _0x6b9ef2=_[_0x612e('0x37')](db[_0x612e('0x38')][_0x612e('0x39')],function(_0x2f33aa){return{'name':_0x2f33aa[_0x612e('0x3a')],'type':_0x2f33aa['type'][_0x612e('0x3b')]};});_0x51dbed[_0x612e('0x3c')]=_[_0x612e('0x37')](_0x6b9ef2,_0x612e('0x36'));_0x51dbed['query']=_[_0x612e('0x3d')](_0x32e005[_0x612e('0x3e')]);_0x51dbed[_0x612e('0x3f')]=_[_0x612e('0x40')](_0x51dbed[_0x612e('0x3c')],_0x51dbed[_0x612e('0x3e')]);_0x4318c2['attributes']=_[_0x612e('0x40')](_0x51dbed[_0x612e('0x3c')],qs[_0x612e('0x41')](_0x32e005[_0x612e('0x3e')][_0x612e('0x41')]));_0x4318c2[_0x612e('0x42')]=_0x4318c2['attributes'][_0x612e('0x43')]?_0x4318c2[_0x612e('0x42')]:_0x51dbed['model'];if(!_0x32e005[_0x612e('0x3e')][_0x612e('0x44')](_0x612e('0x45'))){_0x4318c2[_0x612e('0x29')]=qs[_0x612e('0x29')](_0x32e005['query']['limit']);_0x4318c2['offset']=qs[_0x612e('0x27')](_0x32e005[_0x612e('0x3e')]['offset']);}_0x4318c2['order']=qs[_0x612e('0x46')](_0x32e005[_0x612e('0x3e')]['sort']);_0x4318c2[_0x612e('0x47')]=qs['filters'](_[_0x612e('0x48')](_0x32e005[_0x612e('0x3e')],_0x51dbed[_0x612e('0x3f')]),_0x6b9ef2);if(_0x32e005[_0x612e('0x3e')][_0x612e('0x49')]){_0x4318c2[_0x612e('0x47')]=_[_0x612e('0x4a')](_0x4318c2['where'],{'$or':_[_0x612e('0x37')](_0x6b9ef2,function(_0x1f505a){if(_0x1f505a[_0x612e('0x4b')]!==_0x612e('0x4c')){var _0x24f386={};_0x24f386[_0x1f505a[_0x612e('0x36')]]={'$like':'%'+_0x32e005[_0x612e('0x3e')][_0x612e('0x49')]+'%'};return _0x24f386;}})});}_0x4318c2=_[_0x612e('0x4a')]({},_0x4318c2,_0x32e005[_0x612e('0x4d')]);var _0x5644d={'where':_0x4318c2[_0x612e('0x47')]};return db[_0x612e('0x38')][_0x612e('0x2a')](_0x5644d)[_0x612e('0x1a')](function(_0x897e46){_0x3ae4b9[_0x612e('0x2a')]=_0x897e46;if(_0x32e005[_0x612e('0x3e')][_0x612e('0x4e')]){_0x4318c2[_0x612e('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0x612e('0x50')](_0x4318c2);})[_0x612e('0x1a')](function(_0xf3a0a7){_0x3ae4b9[_0x612e('0x51')]=_0xf3a0a7;return _0x3ae4b9;})['then'](respondWithFilteredResult(_0x276ef3,_0x4318c2))[_0x612e('0x23')](handleError(_0x276ef3,null));};exports[_0x612e('0x52')]=function(_0x5cc7b8,_0x41bfc2){var _0x24e2ff={'raw':![],'where':{'id':_0x5cc7b8[_0x612e('0x53')]['id']}},_0x908a0b={};_0x908a0b[_0x612e('0x3c')]=_[_0x612e('0x3d')](db['VoiceContext']['rawAttributes']);_0x908a0b[_0x612e('0x3e')]=_['keys'](_0x5cc7b8[_0x612e('0x3e')]);_0x908a0b['filters']=_['intersection'](_0x908a0b[_0x612e('0x3c')],_0x908a0b[_0x612e('0x3e')]);_0x24e2ff[_0x612e('0x42')]=_[_0x612e('0x40')](_0x908a0b['model'],qs[_0x612e('0x41')](_0x5cc7b8['query'][_0x612e('0x41')]));_0x24e2ff[_0x612e('0x42')]=_0x24e2ff[_0x612e('0x42')]['length']?_0x24e2ff[_0x612e('0x42')]:_0x908a0b[_0x612e('0x3c')];if(_0x5cc7b8[_0x612e('0x3e')][_0x612e('0x4e')]){_0x24e2ff[_0x612e('0x4f')]=[{'all':!![]}];}_0x24e2ff=_[_0x612e('0x4a')]({},_0x24e2ff,_0x5cc7b8['options']);return db[_0x612e('0x38')][_0x612e('0x54')](_0x24e2ff)[_0x612e('0x1a')](handleEntityNotFound(_0x41bfc2,null))[_0x612e('0x1a')](respondWithResult(_0x41bfc2,null))[_0x612e('0x23')](handleError(_0x41bfc2,null));};exports[_0x612e('0x55')]=function(_0xf2105e,_0x246a7a,_0x580739){var _0x43d00a;return db[_0x612e('0x38')][_0x612e('0x55')](_0xf2105e['body'],{'raw':!![]})[_0x612e('0x1a')](function(_0x374f1f){_0x43d00a=_0x374f1f;return db[_0x612e('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x70c003){var _0x205cc3=fs[_0x612e('0x56')](path['join'](config[_0x612e('0x57')],_0x612e('0x58')),_0x612e('0x59'));var _0x5a98f2=ejs[_0x612e('0x5a')](_0x205cc3,{'contexts':_0x70c003||[]});fs['writeFileSync'](_0x612e('0x5b'),_0x5a98f2);})[_0x612e('0x1a')](function(){return respondWithRpcPromise(_0x612e('0x5c'),_0x612e('0x55'),{'module':_0x612e('0x5d')});})['then'](function(){var _0x3c0167=_0xf2105e['user']['get']({'plain':!![]});if(!_0x3c0167)throw new Error(_0x612e('0x5e'));if(_0x3c0167['role']==='user'){var _0x533c9f=_0x43d00a[_0x612e('0x31')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x612e('0x32'),'userProfileId':_0x3c0167[_0x612e('0x5f')]},'raw':!![]})[_0x612e('0x1a')](function(_0x23c6cb){if(_0x23c6cb&&_0x23c6cb[_0x612e('0x60')]===0x0){return db[_0x612e('0x33')][_0x612e('0x55')]({'name':_0x533c9f[_0x612e('0x36')],'resourceId':_0x533c9f['id'],'type':_0x23c6cb[_0x612e('0x36')],'sectionId':_0x23c6cb['id']},{})[_0x612e('0x1a')](function(){return _0x43d00a;});}else{return _0x43d00a;}})[_0x612e('0x23')](function(_0x39a134){logger[_0x612e('0x20')](_0x612e('0x61'),_0x39a134);throw _0x39a134;});}return _0x43d00a;})[_0x612e('0x1a')](respondWithResult(_0x246a7a,0xc9))[_0x612e('0x23')](handleError(_0x246a7a,null));};exports['update']=function(_0x22b345,_0x25bf49,_0x330a6d){var _0x1a54bc;return db[_0x612e('0x38')][_0x612e('0x54')]({'where':{'id':_0x22b345['params']['id']}})[_0x612e('0x1a')](handleEntityNotFound(_0x25bf49,null))[_0x612e('0x1a')](saveUpdates(_0x22b345['body'],null))['then'](function(_0x43c591){if(_0x43c591){_0x1a54bc=_0x43c591;return db[_0x612e('0x38')][_0x612e('0x50')]({'raw':!![]});}})[_0x612e('0x1a')](function(_0x2ef646){var _0x8e699b=fs[_0x612e('0x56')](path[_0x612e('0x62')](config[_0x612e('0x57')],_0x612e('0x58')),_0x612e('0x59'));var _0x5b497b=ejs[_0x612e('0x5a')](_0x8e699b,{'contexts':_0x2ef646||[]});fs[_0x612e('0x63')](_0x612e('0x5b'),_0x5b497b);})[_0x612e('0x1a')](function(){return respondWithRpcPromise(_0x612e('0x5c'),'update',{'module':_0x612e('0x5d')});})[_0x612e('0x1a')](function(){return _0x1a54bc;})[_0x612e('0x1a')](respondWithResult(_0x25bf49,null))[_0x612e('0x23')](handleError(_0x25bf49,null));};exports[_0x612e('0x64')]=function(_0x25b074,_0x50256a,_0x44e6d0){var _0x3144a6;return db[_0x612e('0x38')][_0x612e('0x54')]({'where':{'id':_0x25b074[_0x612e('0x53')]['id']}})[_0x612e('0x1a')](handleEntityNotFound(_0x50256a,null))['then'](removeEntity(_0x50256a,null))['then'](function(){return db[_0x612e('0x38')][_0x612e('0x50')]({'raw':!![]});})[_0x612e('0x1a')](function(_0x25754e){var _0x4b0b0c=fs['readFileSync'](path['join'](config[_0x612e('0x57')],_0x612e('0x58')),_0x612e('0x59'));var _0x4550e8=ejs[_0x612e('0x5a')](_0x4b0b0c,{'contexts':_0x25754e});fs['writeFileSync'](_0x612e('0x5b'),_0x4550e8);return respondWithRpcPromise(_0x612e('0x5c'),_0x612e('0x64'),{'module':_0x612e('0x5d')});})[_0x612e('0x23')](handleError(_0x50256a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 4ce053a..dba66bc 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 _0x0bd9=['voice_contexts','lodash','util','api','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x2ffba5,_0x3e7ef6){var _0x119679=function(_0x5e7b8e){while(--_0x5e7b8e){_0x2ffba5['push'](_0x2ffba5['shift']());}};_0x119679(++_0x3e7ef6);}(_0x0bd9,0xcd));var _0x90bd=function(_0x456c9d,_0xa6b604){_0x456c9d=_0x456c9d-0x0;var _0x38d5c=_0x0bd9[_0x456c9d];return _0x38d5c;};'use strict';var _=require(_0x90bd('0x0'));var util=require(_0x90bd('0x1'));var logger=require('../../config/logger')(_0x90bd('0x2'));var moment=require('moment');var BPromise=require(_0x90bd('0x3'));var rp=require(_0x90bd('0x4'));var fs=require('fs');var path=require(_0x90bd('0x5'));var rimraf=require('rimraf');var config=require(_0x90bd('0x6'));var attributes=require(_0x90bd('0x7'));module[_0x90bd('0x8')]=function(_0x59318d,_0x2bfeaf){return _0x59318d[_0x90bd('0x9')](_0x90bd('0xa'),attributes,{'tableName':_0x90bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73ac=['./voiceContext.attributes','define','VoiceContext','lodash','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x238837,_0xe5f1d9){var _0x33b3c0=function(_0x174583){while(--_0x174583){_0x238837['push'](_0x238837['shift']());}};_0x33b3c0(++_0xe5f1d9);}(_0x73ac,0x1a1));var _0xc73a=function(_0x3c3106,_0x1f907c){_0x3c3106=_0x3c3106-0x0;var _0x48a4b8=_0x73ac[_0x3c3106];return _0x48a4b8;};'use strict';var _=require(_0xc73a('0x0'));var util=require('util');var logger=require(_0xc73a('0x1'))(_0xc73a('0x2'));var moment=require(_0xc73a('0x3'));var BPromise=require(_0xc73a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc73a('0x5'));var attributes=require(_0xc73a('0x6'));module['exports']=function(_0x1a6a49,_0x5d91c3){return _0x1a6a49[_0xc73a('0x7')](_0xc73a('0x8'),attributes,{'tableName':'voice_contexts','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 1bb5c28..b683162 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 _0x3eae=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eae,0x126));var _0xe3ea=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3eae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var moment=require(_0xe3ea('0x2'));var BPromise=require(_0xe3ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ea('0x4'));var db=require(_0xe3ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ea('0x6'))(_0xe3ea('0x7'));var config=require(_0xe3ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3ea('0x9')][_0xe3ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x216558,_0x14394e,_0x106123){return new BPromise(function(_0x2cc86f,_0x58ee6b){return client[_0xe3ea('0xb')](_0x216558,_0x106123)[_0xe3ea('0xc')](function(_0x58f4c2){logger[_0xe3ea('0xd')](_0xe3ea('0xe'),_0x14394e,_0xe3ea('0xf'));logger[_0xe3ea('0x10')](_0xe3ea('0x11'),_0x14394e,'request\x20sent',JSON[_0xe3ea('0x12')](_0x58f4c2));if(_0x58f4c2[_0xe3ea('0x13')]){if(_0x58f4c2[_0xe3ea('0x13')]['code']===0x1f4){logger[_0xe3ea('0x13')](_0xe3ea('0xe'),_0x14394e,_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);return _0x58ee6b(_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x14394e,_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);return _0x2cc86f(_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);}else{logger[_0xe3ea('0xd')]('VoiceContext,\x20%s,\x20%s',_0x14394e,'request\x20sent');_0x2cc86f(_0x58f4c2[_0xe3ea('0x15')][_0xe3ea('0x14')]);}})['catch'](function(_0x1d2f47){logger[_0xe3ea('0x13')]('VoiceContext,\x20%s,\x20%s',_0x14394e,_0x1d2f47);_0x58ee6b(_0x1d2f47);});});} \ No newline at end of file +var _0x3d5d=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x38cfcd,_0x1eca8d){var _0x3eddaa=function(_0x4e651a){while(--_0x4e651a){_0x38cfcd['push'](_0x38cfcd['shift']());}};_0x3eddaa(++_0x1eca8d);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x3d5d[_0x1857c6];return _0x51011c;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var moment=require(_0xd3d5('0x1'));var BPromise=require(_0xd3d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d5('0x3'))['db'];var utils=require(_0xd3d5('0x4'));var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a449d,_0x155a2e,_0x40ae47){return new BPromise(function(_0x2b4892,_0x9e67b4){return client['request'](_0x1a449d,_0x40ae47)[_0xd3d5('0xa')](function(_0x48c5fd){logger[_0xd3d5('0xb')](_0xd3d5('0xc'),_0x155a2e,'request\x20sent');logger[_0xd3d5('0xd')](_0xd3d5('0xe'),_0x155a2e,'request\x20sent',JSON[_0xd3d5('0xf')](_0x48c5fd));if(_0x48c5fd[_0xd3d5('0x10')]){if(_0x48c5fd[_0xd3d5('0x10')]['code']===0x1f4){logger['error'](_0xd3d5('0xc'),_0x155a2e,_0x48c5fd[_0xd3d5('0x10')]['message']);return _0x9e67b4(_0x48c5fd[_0xd3d5('0x10')]['message']);}logger[_0xd3d5('0x10')](_0xd3d5('0xc'),_0x155a2e,_0x48c5fd[_0xd3d5('0x10')]['message']);return _0x2b4892(_0x48c5fd['error'][_0xd3d5('0x11')]);}else{logger[_0xd3d5('0xb')]('VoiceContext,\x20%s,\x20%s',_0x155a2e,_0xd3d5('0x12'));_0x2b4892(_0x48c5fd['result'][_0xd3d5('0x11')]);}})[_0xd3d5('0x13')](function(_0x2bb7b9){logger['error'](_0xd3d5('0xc'),_0x155a2e,_0x2bb7b9);_0x9e67b4(_0x2bb7b9);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8267ab6..d196260 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 _0xcae6=['post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2409ad,_0x5f4078){var _0x2c24c9=function(_0x4ea567){while(--_0x4ea567){_0x2409ad['push'](_0x2409ad['shift']());}};_0x2c24c9(++_0x5f4078);}(_0xcae6,0x146));var _0x6cae=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xcae6[_0x4bcf38];return _0x4a89be;};'use strict';var multer=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var path=require('path');var timeout=require(_0x6cae('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6cae('0x3'));var interaction=require(_0x6cae('0x4'));var config=require(_0x6cae('0x5'));var controller=require(_0x6cae('0x6'));router[_0x6cae('0x7')]('/',auth[_0x6cae('0x8')](),controller[_0x6cae('0x9')]);router[_0x6cae('0x7')](_0x6cae('0xa'),auth[_0x6cae('0x8')](),controller[_0x6cae('0xb')]);router[_0x6cae('0x7')](_0x6cae('0xc'),auth[_0x6cae('0x8')](),controller[_0x6cae('0xd')]);router[_0x6cae('0xe')]('/',auth['isAuthenticated'](),controller[_0x6cae('0xf')]);router[_0x6cae('0x10')](_0x6cae('0xc'),auth[_0x6cae('0x8')](),controller[_0x6cae('0x11')]);router[_0x6cae('0x12')](_0x6cae('0xc'),auth[_0x6cae('0x8')](),controller[_0x6cae('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd171=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','/:id','post','create','put','update','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x450032,_0x3465e8){var _0x1dcf2c=function(_0x4f491c){while(--_0x4f491c){_0x450032['push'](_0x450032['shift']());}};_0x1dcf2c(++_0x3465e8);}(_0xd171,0xa3));var _0x1d17=function(_0x21afd5,_0x57b9ba){_0x21afd5=_0x21afd5-0x0;var _0x59b71d=_0xd171[_0x21afd5];return _0x59b71d;};'use strict';var multer=require(_0x1d17('0x0'));var util=require(_0x1d17('0x1'));var path=require(_0x1d17('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1d17('0x3')]();var fs_extra=require(_0x1d17('0x4'));var auth=require(_0x1d17('0x5'));var interaction=require(_0x1d17('0x6'));var config=require(_0x1d17('0x7'));var controller=require(_0x1d17('0x8'));router['get']('/',auth[_0x1d17('0x9')](),controller[_0x1d17('0xa')]);router['get'](_0x1d17('0xb'),auth[_0x1d17('0x9')](),controller[_0x1d17('0xc')]);router[_0x1d17('0xd')](_0x1d17('0xe'),auth[_0x1d17('0x9')](),controller['show']);router[_0x1d17('0xf')]('/',auth[_0x1d17('0x9')](),controller[_0x1d17('0x10')]);router[_0x1d17('0x11')](_0x1d17('0xe'),auth[_0x1d17('0x9')](),controller[_0x1d17('0x12')]);router['delete']('/:id',auth[_0x1d17('0x9')](),controller[_0x1d17('0x13')]);module[_0x1d17('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index dc57eef..a25fa8d 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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x57e51,_0x27de3a){var _0x17c798=function(_0xf60782){while(--_0xf60782){_0x57e51['push'](_0x57e51['shift']());}};_0x17c798(++_0x27de3a);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5b4606,_0x1aa963){_0x5b4606=_0x5b4606-0x0;var _0x1e68a5=_0x8d0e[_0x5b4606];return _0x1e68a5;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x4b2835,_0x5d2c4e){var _0x34e1f2=function(_0xdebb44){while(--_0xdebb44){_0x4b2835['push'](_0x4b2835['shift']());}};_0x34e1f2(++_0x5d2c4e);}(_0x24ca,0x1bc));var _0xa24c=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x24ca[_0x466bc5];return _0x138952;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index c4c67dc..2f1e4d5 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 _0x7689=['undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x58eba0,_0x4c5a4d){var _0x80aa8b=function(_0x2578ae){while(--_0x2578ae){_0x58eba0['push'](_0x58eba0['shift']());}};_0x80aa8b(++_0x4c5a4d);}(_0x7689,0x144));var _0x9768=function(_0x46e341,_0x34388c){_0x46e341=_0x46e341-0x0;var _0x30284b=_0x7689[_0x46e341];return _0x30284b;};'use strict';var emlformat=require(_0x9768('0x0'));var rimraf=require(_0x9768('0x1'));var zipdir=require(_0x9768('0x2'));var jsonpatch=require(_0x9768('0x3'));var rp=require(_0x9768('0x4'));var moment=require(_0x9768('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9768('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9768('0x7'));var fs=require('fs');var fs_extra=require(_0x9768('0x8'));var _=require(_0x9768('0x9'));var squel=require(_0x9768('0xa'));var crypto=require(_0x9768('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9768('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9768('0xd'));var Papa=require('papaparse');var Redis=require(_0x9768('0xe'));var authService=require(_0x9768('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9768('0x10'))(_0x9768('0x11'));var utils=require(_0x9768('0x12'));var config=require(_0x9768('0x13'));var licenseUtil=require(_0x9768('0x14'));var db=require(_0x9768('0x15'))['db'];function respondWithStatusCode(_0x2735ac,_0x58531c){_0x58531c=_0x58531c||0xcc;return function(_0x36b523){if(_0x36b523){return _0x2735ac[_0x9768('0x16')](_0x58531c);}return _0x2735ac[_0x9768('0x17')](_0x58531c)[_0x9768('0x18')]();};}function respondWithResult(_0x46f6c1,_0x57c5f0){_0x57c5f0=_0x57c5f0||0xc8;return function(_0x314268){if(_0x314268){return _0x46f6c1[_0x9768('0x17')](_0x57c5f0)[_0x9768('0x19')](_0x314268);}};}function respondWithFilteredResult(_0xb1ff1e,_0x4199e3){return function(_0x7ae389){if(_0x7ae389){var _0x6735c8=typeof _0x4199e3['offset']===_0x9768('0x1a')&&typeof _0x4199e3['limit']==='undefined';var _0x4a2faf=_0x7ae389[_0x9768('0x1b')];var _0x1cc73f=_0x6735c8?0x0:_0x4199e3[_0x9768('0x1c')];var _0x434187=_0x6735c8?_0x7ae389['count']:_0x4199e3[_0x9768('0x1c')]+_0x4199e3[_0x9768('0x1d')];var _0x98ec9;if(_0x434187>=_0x4a2faf){_0x434187=_0x4a2faf;_0x98ec9=0xc8;}else{_0x98ec9=0xce;}_0xb1ff1e[_0x9768('0x17')](_0x98ec9);return _0xb1ff1e[_0x9768('0x1e')](_0x9768('0x1f'),_0x1cc73f+'-'+_0x434187+'/'+_0x4a2faf)[_0x9768('0x19')](_0x7ae389);}return null;};}function patchUpdates(_0x5b4627){return function(_0xbedb99){try{jsonpatch['apply'](_0xbedb99,_0x5b4627,!![]);}catch(_0x5d8fb7){return BPromise['reject'](_0x5d8fb7);}return _0xbedb99[_0x9768('0x20')]();};}function saveUpdates(_0x5b5a07,_0x56d15a){return function(_0x2e17ba){if(_0x2e17ba){return _0x2e17ba[_0x9768('0x21')](_0x5b5a07)[_0x9768('0x22')](function(_0x30c8cf){return _0x30c8cf;});}return null;};}function removeEntity(_0x3ef20e,_0x3c69be){return function(_0x4974d9){if(_0x4974d9){return _0x4974d9[_0x9768('0x23')]()[_0x9768('0x22')](function(){_0x3ef20e[_0x9768('0x17')](0xcc)[_0x9768('0x18')]();});}};}function handleEntityNotFound(_0x28e3fd,_0x1eac12){return function(_0x5decc1){if(!_0x5decc1){_0x28e3fd['sendStatus'](0x194);}return _0x5decc1;};}function handleError(_0xe3ec0d,_0x5ac49f){_0x5ac49f=_0x5ac49f||0x1f4;return function(_0x11f615){logger[_0x9768('0x24')](_0x11f615['stack']);if(_0x11f615[_0x9768('0x25')]){delete _0x11f615[_0x9768('0x25')];}_0xe3ec0d[_0x9768('0x17')](_0x5ac49f)[_0x9768('0x26')](_0x11f615);};}exports['index']=function(_0x291fde,_0x597db4){var _0x55772a={},_0x44d8ad={},_0x1b7d69={'count':0x0,'rows':[]};var _0x4c7baa=_[_0x9768('0x27')](db[_0x9768('0x28')][_0x9768('0x29')],function(_0x594e5f){return{'name':_0x594e5f['fieldName'],'type':_0x594e5f[_0x9768('0x2a')][_0x9768('0x2b')]};});_0x44d8ad[_0x9768('0x2c')]=_['map'](_0x4c7baa,_0x9768('0x25'));_0x44d8ad[_0x9768('0x2d')]=_[_0x9768('0x2e')](_0x291fde[_0x9768('0x2d')]);_0x44d8ad['filters']=_[_0x9768('0x2f')](_0x44d8ad[_0x9768('0x2c')],_0x44d8ad[_0x9768('0x2d')]);_0x55772a[_0x9768('0x30')]=_[_0x9768('0x2f')](_0x44d8ad[_0x9768('0x2c')],qs[_0x9768('0x31')](_0x291fde[_0x9768('0x2d')]['fields']));_0x55772a[_0x9768('0x30')]=_0x55772a['attributes'][_0x9768('0x32')]?_0x55772a[_0x9768('0x30')]:_0x44d8ad[_0x9768('0x2c')];if(!_0x291fde[_0x9768('0x2d')][_0x9768('0x33')](_0x9768('0x34'))){_0x55772a[_0x9768('0x1d')]=qs[_0x9768('0x1d')](_0x291fde[_0x9768('0x2d')][_0x9768('0x1d')]);_0x55772a[_0x9768('0x1c')]=qs[_0x9768('0x1c')](_0x291fde[_0x9768('0x2d')][_0x9768('0x1c')]);}_0x55772a[_0x9768('0x35')]=qs[_0x9768('0x36')](_0x291fde[_0x9768('0x2d')][_0x9768('0x36')]);_0x55772a['where']=qs[_0x9768('0x37')](_[_0x9768('0x38')](_0x291fde[_0x9768('0x2d')],_0x44d8ad[_0x9768('0x37')]),_0x4c7baa);if(_0x291fde['query']['filter']){_0x55772a[_0x9768('0x39')]=_[_0x9768('0x3a')](_0x55772a[_0x9768('0x39')],{'$or':_[_0x9768('0x27')](_0x4c7baa,function(_0x5bcc92){if(_0x5bcc92[_0x9768('0x2a')]!=='VIRTUAL'){var _0x46b74b={};_0x46b74b[_0x5bcc92['name']]={'$like':'%'+_0x291fde['query']['filter']+'%'};return _0x46b74b;}})});}_0x55772a=_[_0x9768('0x3a')]({},_0x55772a,_0x291fde['options']);var _0x3860c9={'where':_0x55772a[_0x9768('0x39')]};return db['VoiceDialReport'][_0x9768('0x1b')](_0x3860c9)['then'](function(_0x5713c9){_0x1b7d69['count']=_0x5713c9;if(_0x291fde[_0x9768('0x2d')][_0x9768('0x3b')]){_0x55772a[_0x9768('0x3c')]=[{'all':!![]}];}return db[_0x9768('0x28')][_0x9768('0x3d')](_0x55772a);})['then'](function(_0xc7561e){_0x1b7d69[_0x9768('0x3e')]=_0xc7561e;return _0x1b7d69;})[_0x9768('0x22')](respondWithFilteredResult(_0x597db4,_0x55772a))['catch'](handleError(_0x597db4,null));};exports['show']=function(_0x506b39,_0x772117){var _0x4da8f4={'raw':!![],'where':{'id':_0x506b39[_0x9768('0x3f')]['id']}},_0x2cd579={};_0x2cd579[_0x9768('0x2c')]=_[_0x9768('0x2e')](db[_0x9768('0x28')][_0x9768('0x29')]);_0x2cd579[_0x9768('0x2d')]=_[_0x9768('0x2e')](_0x506b39[_0x9768('0x2d')]);_0x2cd579['filters']=_[_0x9768('0x2f')](_0x2cd579[_0x9768('0x2c')],_0x2cd579['query']);_0x4da8f4[_0x9768('0x30')]=_['intersection'](_0x2cd579[_0x9768('0x2c')],qs['fields'](_0x506b39['query'][_0x9768('0x31')]));_0x4da8f4['attributes']=_0x4da8f4[_0x9768('0x30')]['length']?_0x4da8f4[_0x9768('0x30')]:_0x2cd579[_0x9768('0x2c')];if(_0x506b39[_0x9768('0x2d')][_0x9768('0x3b')]){_0x4da8f4['include']=[{'all':!![]}];}_0x4da8f4=_['merge']({},_0x4da8f4,_0x506b39[_0x9768('0x40')]);return db['VoiceDialReport'][_0x9768('0x41')](_0x4da8f4)[_0x9768('0x22')](handleEntityNotFound(_0x772117,null))['then'](respondWithResult(_0x772117,null))[_0x9768('0x42')](handleError(_0x772117,null));};exports['create']=function(_0x4fc889,_0xa5a8d4){return db[_0x9768('0x28')][_0x9768('0x43')](_0x4fc889[_0x9768('0x44')],{})[_0x9768('0x22')](respondWithResult(_0xa5a8d4,0xc9))[_0x9768('0x42')](handleError(_0xa5a8d4,null));};exports['update']=function(_0x335b48,_0x52c0c6){if(_0x335b48[_0x9768('0x44')]['id']){delete _0x335b48['body']['id'];}return db[_0x9768('0x28')][_0x9768('0x41')]({'where':{'id':_0x335b48[_0x9768('0x3f')]['id']}})[_0x9768('0x22')](handleEntityNotFound(_0x52c0c6,null))[_0x9768('0x22')](saveUpdates(_0x335b48[_0x9768('0x44')],null))[_0x9768('0x22')](respondWithResult(_0x52c0c6,null))[_0x9768('0x42')](handleError(_0x52c0c6,null));};exports[_0x9768('0x23')]=function(_0x1ac2c9,_0x50fa5c){return db[_0x9768('0x28')]['find']({'where':{'id':_0x1ac2c9[_0x9768('0x3f')]['id']}})[_0x9768('0x22')](handleEntityNotFound(_0x50fa5c,null))[_0x9768('0x22')](removeEntity(_0x50fa5c,null))[_0x9768('0x42')](handleError(_0x50fa5c,null));};exports[_0x9768('0x45')]=function(_0x364f11,_0x2146ca){return db[_0x9768('0x28')][_0x9768('0x45')]()['then'](respondWithResult(_0x2146ca,null))[_0x9768('0x42')](handleError(_0x2146ca,null));}; \ No newline at end of file +var _0xfccf=['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','end','offset','undefined','limit','count','set','json','apply','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','rows','catch','show','keys','fields','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4de6f8,_0x46c1dc){var _0x7252b9=function(_0x2e92ff){while(--_0x2e92ff){_0x4de6f8['push'](_0x4de6f8['shift']());}};_0x7252b9(++_0x46c1dc);}(_0xfccf,0x8d));var _0xffcc=function(_0x5a7c31,_0x3f357c){_0x5a7c31=_0x5a7c31-0x0;var _0x168f1a=_0xfccf[_0x5a7c31];return _0x168f1a;};'use strict';var emlformat=require(_0xffcc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffcc('0x1'));var jsonpatch=require(_0xffcc('0x2'));var rp=require(_0xffcc('0x3'));var moment=require(_0xffcc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xffcc('0x5'));var util=require(_0xffcc('0x6'));var path=require('path');var sox=require(_0xffcc('0x7'));var csv=require(_0xffcc('0x8'));var ejs=require(_0xffcc('0x9'));var fs=require('fs');var fs_extra=require(_0xffcc('0xa'));var _=require(_0xffcc('0xb'));var squel=require(_0xffcc('0xc'));var crypto=require(_0xffcc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xffcc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xffcc('0xf'));var Papa=require(_0xffcc('0x10'));var Redis=require(_0xffcc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xffcc('0x12'));var as=require(_0xffcc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffcc('0x14'))(_0xffcc('0x15'));var utils=require('../../config/utils');var config=require(_0xffcc('0x16'));var licenseUtil=require(_0xffcc('0x17'));var db=require(_0xffcc('0x18'))['db'];function respondWithStatusCode(_0x4584cf,_0x4b86e7){_0x4b86e7=_0x4b86e7||0xcc;return function(_0x41b089){if(_0x41b089){return _0x4584cf['sendStatus'](_0x4b86e7);}return _0x4584cf[_0xffcc('0x19')](_0x4b86e7)[_0xffcc('0x1a')]();};}function respondWithResult(_0x23d2a9,_0x18df5e){_0x18df5e=_0x18df5e||0xc8;return function(_0x36694c){if(_0x36694c){return _0x23d2a9['status'](_0x18df5e)['json'](_0x36694c);}};}function respondWithFilteredResult(_0x5f2d38,_0x41bc14){return function(_0x5516ec){if(_0x5516ec){var _0x4b5d5c=typeof _0x41bc14[_0xffcc('0x1b')]===_0xffcc('0x1c')&&typeof _0x41bc14[_0xffcc('0x1d')]===_0xffcc('0x1c');var _0x102b9e=_0x5516ec['count'];var _0x282de2=_0x4b5d5c?0x0:_0x41bc14['offset'];var _0x24bf38=_0x4b5d5c?_0x5516ec[_0xffcc('0x1e')]:_0x41bc14['offset']+_0x41bc14[_0xffcc('0x1d')];var _0x56812f;if(_0x24bf38>=_0x102b9e){_0x24bf38=_0x102b9e;_0x56812f=0xc8;}else{_0x56812f=0xce;}_0x5f2d38[_0xffcc('0x19')](_0x56812f);return _0x5f2d38[_0xffcc('0x1f')]('Content-Range',_0x282de2+'-'+_0x24bf38+'/'+_0x102b9e)[_0xffcc('0x20')](_0x5516ec);}return null;};}function patchUpdates(_0x517fe1){return function(_0x47cc73){try{jsonpatch[_0xffcc('0x21')](_0x47cc73,_0x517fe1,!![]);}catch(_0x50b6d4){return BPromise['reject'](_0x50b6d4);}return _0x47cc73[_0xffcc('0x22')]();};}function saveUpdates(_0x2cc21f,_0x5101fa){return function(_0x42089c){if(_0x42089c){return _0x42089c['update'](_0x2cc21f)['then'](function(_0x25be97){return _0x25be97;});}return null;};}function removeEntity(_0x5f3fb8,_0x3c16c2){return function(_0x49d8bb){if(_0x49d8bb){return _0x49d8bb[_0xffcc('0x23')]()[_0xffcc('0x24')](function(){_0x5f3fb8[_0xffcc('0x19')](0xcc)[_0xffcc('0x1a')]();});}};}function handleEntityNotFound(_0x4c42f9,_0x537bf3){return function(_0x52974e){if(!_0x52974e){_0x4c42f9['sendStatus'](0x194);}return _0x52974e;};}function handleError(_0x6f0e80,_0x15f5ba){_0x15f5ba=_0x15f5ba||0x1f4;return function(_0x8bc8b0){logger[_0xffcc('0x25')](_0x8bc8b0[_0xffcc('0x26')]);if(_0x8bc8b0[_0xffcc('0x27')]){delete _0x8bc8b0['name'];}_0x6f0e80[_0xffcc('0x19')](_0x15f5ba)['send'](_0x8bc8b0);};}exports[_0xffcc('0x28')]=function(_0x46fe59,_0x5c7de6){var _0x59d84d={},_0x2ca0ee={},_0x1015ae={'count':0x0,'rows':[]};var _0x5594fe=_[_0xffcc('0x29')](db['VoiceDialReport'][_0xffcc('0x2a')],function(_0x12c7d){return{'name':_0x12c7d[_0xffcc('0x2b')],'type':_0x12c7d[_0xffcc('0x2c')][_0xffcc('0x2d')]};});_0x2ca0ee[_0xffcc('0x2e')]=_[_0xffcc('0x29')](_0x5594fe,'name');_0x2ca0ee['query']=_['keys'](_0x46fe59[_0xffcc('0x2f')]);_0x2ca0ee[_0xffcc('0x30')]=_[_0xffcc('0x31')](_0x2ca0ee[_0xffcc('0x2e')],_0x2ca0ee[_0xffcc('0x2f')]);_0x59d84d[_0xffcc('0x32')]=_[_0xffcc('0x31')](_0x2ca0ee[_0xffcc('0x2e')],qs['fields'](_0x46fe59[_0xffcc('0x2f')]['fields']));_0x59d84d[_0xffcc('0x32')]=_0x59d84d[_0xffcc('0x32')][_0xffcc('0x33')]?_0x59d84d[_0xffcc('0x32')]:_0x2ca0ee['model'];if(!_0x46fe59[_0xffcc('0x2f')][_0xffcc('0x34')]('nolimit')){_0x59d84d['limit']=qs[_0xffcc('0x1d')](_0x46fe59[_0xffcc('0x2f')][_0xffcc('0x1d')]);_0x59d84d['offset']=qs[_0xffcc('0x1b')](_0x46fe59['query']['offset']);}_0x59d84d[_0xffcc('0x35')]=qs[_0xffcc('0x36')](_0x46fe59['query'][_0xffcc('0x36')]);_0x59d84d[_0xffcc('0x37')]=qs[_0xffcc('0x30')](_[_0xffcc('0x38')](_0x46fe59[_0xffcc('0x2f')],_0x2ca0ee[_0xffcc('0x30')]),_0x5594fe);if(_0x46fe59[_0xffcc('0x2f')][_0xffcc('0x39')]){_0x59d84d[_0xffcc('0x37')]=_[_0xffcc('0x3a')](_0x59d84d[_0xffcc('0x37')],{'$or':_[_0xffcc('0x29')](_0x5594fe,function(_0x915618){if(_0x915618['type']!==_0xffcc('0x3b')){var _0x507249={};_0x507249[_0x915618[_0xffcc('0x27')]]={'$like':'%'+_0x46fe59[_0xffcc('0x2f')][_0xffcc('0x39')]+'%'};return _0x507249;}})});}_0x59d84d=_['merge']({},_0x59d84d,_0x46fe59[_0xffcc('0x3c')]);var _0x169763={'where':_0x59d84d[_0xffcc('0x37')]};return db[_0xffcc('0x3d')]['count'](_0x169763)[_0xffcc('0x24')](function(_0x42c00a){_0x1015ae[_0xffcc('0x1e')]=_0x42c00a;if(_0x46fe59[_0xffcc('0x2f')][_0xffcc('0x3e')]){_0x59d84d['include']=[{'all':!![]}];}return db[_0xffcc('0x3d')]['findAll'](_0x59d84d);})[_0xffcc('0x24')](function(_0x5890cd){_0x1015ae[_0xffcc('0x3f')]=_0x5890cd;return _0x1015ae;})[_0xffcc('0x24')](respondWithFilteredResult(_0x5c7de6,_0x59d84d))[_0xffcc('0x40')](handleError(_0x5c7de6,null));};exports[_0xffcc('0x41')]=function(_0x42776e,_0x5a179c){var _0x3853f1={'raw':!![],'where':{'id':_0x42776e['params']['id']}},_0x1cd2e9={};_0x1cd2e9[_0xffcc('0x2e')]=_[_0xffcc('0x42')](db[_0xffcc('0x3d')][_0xffcc('0x2a')]);_0x1cd2e9[_0xffcc('0x2f')]=_[_0xffcc('0x42')](_0x42776e[_0xffcc('0x2f')]);_0x1cd2e9[_0xffcc('0x30')]=_['intersection'](_0x1cd2e9['model'],_0x1cd2e9[_0xffcc('0x2f')]);_0x3853f1['attributes']=_[_0xffcc('0x31')](_0x1cd2e9['model'],qs['fields'](_0x42776e['query'][_0xffcc('0x43')]));_0x3853f1[_0xffcc('0x32')]=_0x3853f1[_0xffcc('0x32')][_0xffcc('0x33')]?_0x3853f1[_0xffcc('0x32')]:_0x1cd2e9['model'];if(_0x42776e[_0xffcc('0x2f')][_0xffcc('0x3e')]){_0x3853f1['include']=[{'all':!![]}];}_0x3853f1=_[_0xffcc('0x3a')]({},_0x3853f1,_0x42776e[_0xffcc('0x3c')]);return db[_0xffcc('0x3d')][_0xffcc('0x44')](_0x3853f1)['then'](handleEntityNotFound(_0x5a179c,null))['then'](respondWithResult(_0x5a179c,null))[_0xffcc('0x40')](handleError(_0x5a179c,null));};exports['create']=function(_0x5594a3,_0x72c2f3){return db[_0xffcc('0x3d')][_0xffcc('0x45')](_0x5594a3['body'],{})['then'](respondWithResult(_0x72c2f3,0xc9))[_0xffcc('0x40')](handleError(_0x72c2f3,null));};exports[_0xffcc('0x46')]=function(_0x5cceff,_0x42f073){if(_0x5cceff[_0xffcc('0x47')]['id']){delete _0x5cceff[_0xffcc('0x47')]['id'];}return db[_0xffcc('0x3d')]['find']({'where':{'id':_0x5cceff[_0xffcc('0x48')]['id']}})[_0xffcc('0x24')](handleEntityNotFound(_0x42f073,null))[_0xffcc('0x24')](saveUpdates(_0x5cceff[_0xffcc('0x47')],null))[_0xffcc('0x24')](respondWithResult(_0x42f073,null))[_0xffcc('0x40')](handleError(_0x42f073,null));};exports['destroy']=function(_0x5da8e4,_0x1ad62d){return db[_0xffcc('0x3d')][_0xffcc('0x44')]({'where':{'id':_0x5da8e4[_0xffcc('0x48')]['id']}})[_0xffcc('0x24')](handleEntityNotFound(_0x1ad62d,null))[_0xffcc('0x24')](removeEntity(_0x1ad62d,null))[_0xffcc('0x40')](handleError(_0x1ad62d,null));};exports[_0xffcc('0x49')]=function(_0x130c16,_0x34c7bd){return db[_0xffcc('0x3d')][_0xffcc('0x49')]()[_0xffcc('0x24')](respondWithResult(_0x34c7bd,null))['catch'](handleError(_0x34c7bd,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 4635099..29b112e 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 _0xa232=['path','rimraf','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','api','moment','bluebird'];(function(_0x41fdcc,_0xef343d){var _0x11db4a=function(_0x514907){while(--_0x514907){_0x41fdcc['push'](_0x41fdcc['shift']());}};_0x11db4a(++_0xef343d);}(_0xa232,0x141));var _0x2a23=function(_0x2f2746,_0x56c889){_0x2f2746=_0x2f2746-0x0;var _0x12e091=_0xa232[_0x2f2746];return _0x12e091;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2a23('0x0'));var moment=require(_0x2a23('0x1'));var BPromise=require(_0x2a23('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a23('0x3'));var rimraf=require(_0x2a23('0x4'));var config=require('../../config/environment');var attributes=require(_0x2a23('0x5'));module[_0x2a23('0x6')]=function(_0x2e64a9,_0x4e805e){return _0x2e64a9['define'](_0x2a23('0x7'),attributes,{'tableName':_0x2a23('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x181c=['request-promise','path','rimraf','../../config/environment','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x181c,0x14b));var _0xc181=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x181c[_0x349367];return _0x14179b;};'use strict';var _=require(_0xc181('0x0'));var util=require(_0xc181('0x1'));var logger=require(_0xc181('0x2'))(_0xc181('0x3'));var moment=require(_0xc181('0x4'));var BPromise=require('bluebird');var rp=require(_0xc181('0x5'));var fs=require('fs');var path=require(_0xc181('0x6'));var rimraf=require(_0xc181('0x7'));var config=require(_0xc181('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x48c4b1,_0x4826b1){return _0x48c4b1[_0xc181('0x9')](_0xc181('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xc181('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6fe5b86..203fbb0 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 _0x1364=['result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','stringify','catch','UpdateVoiceDialReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x1364,0x122));var _0x4136=function(_0x3d69de,_0x3a2c66){_0x3d69de=_0x3d69de-0x0;var _0x331023=_0x1364[_0x3d69de];return _0x331023;};'use strict';var _=require(_0x4136('0x0'));var util=require(_0x4136('0x1'));var moment=require(_0x4136('0x2'));var BPromise=require(_0x4136('0x3'));var rs=require(_0x4136('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4136('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4136('0x6'));var config=require('../../config/environment');var jayson=require(_0x4136('0x7'));var client=jayson[_0x4136('0x8')][_0x4136('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b749f,_0xbfcf54,_0x3a1746){return new BPromise(function(_0x25f7c0,_0x27283c){return client[_0x4136('0xa')](_0x5b749f,_0x3a1746)[_0x4136('0xb')](function(_0x164fbb){logger['info'](_0x4136('0xc'),_0xbfcf54,_0x4136('0xd'));logger[_0x4136('0xe')](_0x4136('0xf'),_0xbfcf54,_0x4136('0xd'),JSON['stringify'](_0x164fbb));if(_0x164fbb[_0x4136('0x10')]){if(_0x164fbb['error'][_0x4136('0x11')]===0x1f4){logger[_0x4136('0x10')](_0x4136('0xc'),_0xbfcf54,_0x164fbb[_0x4136('0x10')]['message']);return _0x27283c(_0x164fbb['error'][_0x4136('0x12')]);}logger['error'](_0x4136('0xc'),_0xbfcf54,_0x164fbb[_0x4136('0x10')][_0x4136('0x12')]);return _0x25f7c0(_0x164fbb[_0x4136('0x10')][_0x4136('0x12')]);}else{logger[_0x4136('0x13')](_0x4136('0xc'),_0xbfcf54,'request\x20sent');_0x25f7c0(_0x164fbb[_0x4136('0x14')][_0x4136('0x12')]);}})['catch'](function(_0x731a0e){logger[_0x4136('0x10')](_0x4136('0xc'),_0xbfcf54,_0x731a0e);_0x27283c(_0x731a0e);});});}exports[_0x4136('0x15')]=function(_0x19f3a6){var _0x4b1f3d=this;return new Promise(function(_0x53495d,_0x3704a2){return db[_0x4136('0x16')]['create'](_0x19f3a6[_0x4136('0x17')],{'raw':_0x19f3a6[_0x4136('0x18')]?_0x19f3a6[_0x4136('0x18')][_0x4136('0x19')]===undefined?!![]:![]:!![]})[_0x4136('0xb')](function(_0x5f8ed9){logger['info'](_0x4136('0x15'),_0x19f3a6);logger[_0x4136('0xe')](_0x4136('0x15'),_0x19f3a6,JSON[_0x4136('0x1a')](_0x5f8ed9));_0x53495d(_0x5f8ed9);})[_0x4136('0x1b')](function(_0x306c0b){logger['error'](_0x4136('0x15'),_0x306c0b[_0x4136('0x12')],_0x19f3a6);_0x3704a2(_0x4b1f3d[_0x4136('0x10')](0x1f4,_0x306c0b['message']));});});};exports[_0x4136('0x1c')]=function(_0x338869){var _0x556c0e=this;return new Promise(function(_0x4881fc,_0x2aeaed){return db[_0x4136('0x16')][_0x4136('0x1d')](_0x338869['body'],{'raw':_0x338869[_0x4136('0x18')]?_0x338869[_0x4136('0x18')][_0x4136('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338869[_0x4136('0x18')]?_0x338869['options']['where']||null:null,'attributes':_0x338869['options']?_0x338869[_0x4136('0x18')]['attributes']||null:null,'limit':_0x338869[_0x4136('0x18')]?_0x338869[_0x4136('0x18')][_0x4136('0x1e')]||null:null})[_0x4136('0xb')](function(_0x7f9080){logger[_0x4136('0x13')](_0x4136('0x1c'),_0x338869);logger[_0x4136('0xe')]('UpdateVoiceDialReport',_0x338869,JSON[_0x4136('0x1a')](_0x7f9080));_0x4881fc(_0x7f9080);})['catch'](function(_0xa068f2){logger[_0x4136('0x10')](_0x4136('0x1c'),_0xa068f2[_0x4136('0x12')],_0x338869);_0x2aeaed(_0x556c0e['error'](0x1f4,_0xa068f2['message']));});});}; \ No newline at end of file +var _0x01ac=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','UpdateVoiceDialReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x01ac,0x194));var _0xc01a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01ac[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc01a('0x0'));var BPromise=require(_0xc01a('0x1'));var rs=require(_0xc01a('0x2'));var fs=require('fs');var Redis=require(_0xc01a('0x3'));var db=require(_0xc01a('0x4'))['db'];var utils=require(_0xc01a('0x5'));var logger=require('../../config/logger')(_0xc01a('0x6'));var config=require(_0xc01a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc01a('0x8')][_0xc01a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1914cc,_0x344efb,_0x46b164){return new BPromise(function(_0x243a6c,_0x3ff34c){return client[_0xc01a('0xa')](_0x1914cc,_0x46b164)['then'](function(_0x43abba){logger[_0xc01a('0xb')](_0xc01a('0xc'),_0x344efb,_0xc01a('0xd'));logger[_0xc01a('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x344efb,_0xc01a('0xd'),JSON[_0xc01a('0xf')](_0x43abba));if(_0x43abba['error']){if(_0x43abba[_0xc01a('0x10')][_0xc01a('0x11')]===0x1f4){logger[_0xc01a('0x10')](_0xc01a('0xc'),_0x344efb,_0x43abba['error'][_0xc01a('0x12')]);return _0x3ff34c(_0x43abba[_0xc01a('0x10')]['message']);}logger['error'](_0xc01a('0xc'),_0x344efb,_0x43abba[_0xc01a('0x10')][_0xc01a('0x12')]);return _0x243a6c(_0x43abba[_0xc01a('0x10')][_0xc01a('0x12')]);}else{logger[_0xc01a('0xb')](_0xc01a('0xc'),_0x344efb,_0xc01a('0xd'));_0x243a6c(_0x43abba['result'][_0xc01a('0x12')]);}})[_0xc01a('0x13')](function(_0x259e6e){logger[_0xc01a('0x10')](_0xc01a('0xc'),_0x344efb,_0x259e6e);_0x3ff34c(_0x259e6e);});});}exports[_0xc01a('0x14')]=function(_0x28f6d7){var _0x18c55d=this;return new Promise(function(_0x4b7983,_0x2b3349){return db[_0xc01a('0x15')][_0xc01a('0x16')](_0x28f6d7[_0xc01a('0x17')],{'raw':_0x28f6d7[_0xc01a('0x18')]?_0x28f6d7[_0xc01a('0x18')][_0xc01a('0x19')]===undefined?!![]:![]:!![]})[_0xc01a('0x1a')](function(_0x17000f){logger['info'](_0xc01a('0x14'),_0x28f6d7);logger[_0xc01a('0xe')]('CreateVoiceDialReport',_0x28f6d7,JSON[_0xc01a('0xf')](_0x17000f));_0x4b7983(_0x17000f);})[_0xc01a('0x13')](function(_0x567196){logger[_0xc01a('0x10')](_0xc01a('0x14'),_0x567196['message'],_0x28f6d7);_0x2b3349(_0x18c55d['error'](0x1f4,_0x567196[_0xc01a('0x12')]));});});};exports[_0xc01a('0x1b')]=function(_0x425fc8){var _0x205041=this;return new Promise(function(_0x47fa60,_0x3fd1e0){return db[_0xc01a('0x15')][_0xc01a('0x1c')](_0x425fc8[_0xc01a('0x17')],{'raw':_0x425fc8[_0xc01a('0x18')]?_0x425fc8[_0xc01a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x425fc8[_0xc01a('0x18')]?_0x425fc8[_0xc01a('0x18')][_0xc01a('0x1d')]||null:null,'attributes':_0x425fc8[_0xc01a('0x18')]?_0x425fc8[_0xc01a('0x18')][_0xc01a('0x1e')]||null:null,'limit':_0x425fc8[_0xc01a('0x18')]?_0x425fc8[_0xc01a('0x18')][_0xc01a('0x1f')]||null:null})[_0xc01a('0x1a')](function(_0x3a9213){logger[_0xc01a('0xb')](_0xc01a('0x1b'),_0x425fc8);logger[_0xc01a('0xe')]('UpdateVoiceDialReport',_0x425fc8,JSON['stringify'](_0x3a9213));_0x47fa60(_0x3a9213);})[_0xc01a('0x13')](function(_0x20e400){logger[_0xc01a('0x10')](_0xc01a('0x1b'),_0x20e400[_0xc01a('0x12')],_0x425fc8);_0x3fd1e0(_0x205041[_0xc01a('0x10')](0x1f4,_0x20e400['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 91d33d3..5f933fe 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 _0x747d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','addApplications','update','exports','util','path','connect-timeout'];(function(_0x1e4748,_0x3938a4){var _0x3ed610=function(_0x4e1aca){while(--_0x4e1aca){_0x1e4748['push'](_0x1e4748['shift']());}};_0x3ed610(++_0x3938a4);}(_0x747d,0x12d));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd747('0x0'));var path=require(_0xd747('0x1'));var timeout=require(_0xd747('0x2'));var express=require(_0xd747('0x3'));var router=express[_0xd747('0x4')]();var fs_extra=require(_0xd747('0x5'));var auth=require(_0xd747('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd747('0x7'));var controller=require(_0xd747('0x8'));router[_0xd747('0x9')]('/',auth[_0xd747('0xa')](),controller[_0xd747('0xb')]);router[_0xd747('0x9')](_0xd747('0xc'),auth[_0xd747('0xa')](),controller[_0xd747('0xd')]);router[_0xd747('0xe')]('/',auth[_0xd747('0xa')](),controller[_0xd747('0xf')]);router[_0xd747('0xe')]('/:id/applications',auth['isAuthenticated'](),controller[_0xd747('0x10')]);router['put'](_0xd747('0xc'),auth['isAuthenticated'](),controller[_0xd747('0x11')]);router['delete'](_0xd747('0xc'),auth[_0xd747('0xa')](),controller['destroy']);module[_0xd747('0x12')]=router; \ No newline at end of file +var _0x0f02=['./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2110c1,_0x13e5c6){var _0xf2caee=function(_0x4ccfd1){while(--_0x4ccfd1){_0x2110c1['push'](_0x2110c1['shift']());}};_0xf2caee(++_0x13e5c6);}(_0x0f02,0x13c));var _0x20f0=function(_0x3ee8a0,_0x4143bd){_0x3ee8a0=_0x3ee8a0-0x0;var _0x4c8512=_0x0f02[_0x3ee8a0];return _0x4c8512;};'use strict';var multer=require('multer');var util=require(_0x20f0('0x0'));var path=require('path');var timeout=require(_0x20f0('0x1'));var express=require(_0x20f0('0x2'));var router=express[_0x20f0('0x3')]();var fs_extra=require(_0x20f0('0x4'));var auth=require(_0x20f0('0x5'));var interaction=require(_0x20f0('0x6'));var config=require('../../config/environment');var controller=require(_0x20f0('0x7'));router[_0x20f0('0x8')]('/',auth[_0x20f0('0x9')](),controller[_0x20f0('0xa')]);router[_0x20f0('0x8')](_0x20f0('0xb'),auth['isAuthenticated'](),controller[_0x20f0('0xc')]);router[_0x20f0('0xd')]('/',auth[_0x20f0('0x9')](),controller[_0x20f0('0xe')]);router['post'](_0x20f0('0xf'),auth[_0x20f0('0x9')](),controller['addApplications']);router['put'](_0x20f0('0xb'),auth[_0x20f0('0x9')](),controller[_0x20f0('0x10')]);router['delete'](_0x20f0('0xb'),auth['isAuthenticated'](),controller[_0x20f0('0x11')]);module[_0x20f0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 14803f9..62e7b3c 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 _0x829c=['inbound','outbound','internal','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM'];(function(_0x38756d,_0x4c330f){var _0x3f000d=function(_0x672541){while(--_0x672541){_0x38756d['push'](_0x38756d['shift']());}};_0x3f000d(++_0x4c330f);}(_0x829c,0x14b));var _0xc829=function(_0xc9650b,_0x3e6832){_0xc9650b=_0xc9650b-0x0;var _0x1cffcb=_0x829c[_0xc9650b];return _0x1cffcb;};'use strict';var Sequelize=require(_0xc829('0x0'));module[_0xc829('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc829('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc829('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xc829('0x2')},'tag':{'type':Sequelize[_0xc829('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc829('0x4')](_0xc829('0x5'),_0xc829('0x6'),_0xc829('0x7'),'inbound-fax',_0xc829('0x8'),'system',_0xc829('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xc829('0xa')]},'isApp':{'type':Sequelize[_0xc829('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xc829('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xc829('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc829('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xc829('0xc')},'answer':{'type':Sequelize[_0xc829('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc829('0xd')],'get':function(_0x42b61d){return this[_0xc829('0xe')](_0xc829('0xf'));}},'alias':{'type':Sequelize[_0xc829('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xd532=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports'];(function(_0x4a08a2,_0x4805e3){var _0x2550b2=function(_0x5d0d10){while(--_0x5d0d10){_0x4a08a2['push'](_0x4a08a2['shift']());}};_0x2550b2(++_0x4805e3);}(_0xd532,0x154));var _0x2d53=function(_0x4c1503,_0x460c70){_0x4c1503=_0x4c1503-0x0;var _0x7e68d7=_0xd532[_0x4c1503];return _0x7e68d7;};'use strict';var Sequelize=require(_0x2d53('0x0'));module[_0x2d53('0x1')]={'context':{'type':Sequelize[_0x2d53('0x2')],'allowNull':![],'unique':_0x2d53('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2d53('0x2')],'allowNull':![],'unique':_0x2d53('0x3')},'priority':{'type':Sequelize[_0x2d53('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x2d53('0x3')},'tag':{'type':Sequelize[_0x2d53('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2d53('0x2')],'allowNull':![],'defaultValue':_0x2d53('0x4')},'appdata':{'type':Sequelize[_0x2d53('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2d53('0x5')](_0x2d53('0x6'),_0x2d53('0x7'),_0x2d53('0x8'),_0x2d53('0x9'),_0x2d53('0xa'),'system',_0x2d53('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2d53('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x2d53('0xc')]},'isApp':{'type':Sequelize[_0x2d53('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2d53('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x2d53('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2d53('0xc')]},'recordingFormat':{'type':Sequelize[_0x2d53('0x2')],'defaultValue':_0x2d53('0xe')},'answer':{'type':Sequelize[_0x2d53('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x2d53('0xf')],'get':function(_0x512cb1){return this[_0x2d53('0x10')](_0x2d53('0x11'));}},'alias':{'type':Sequelize[_0x2d53('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 2f5421e..8af3570 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 _0x3f22=['alias','addApplications','sequelize','Transaction','READ_COMMITTED','findOne','isApp','createRouting','findAndCountAll','finally','lodash','ioredis','../../config/logger','api','../../mysqldb','defaults','redis','sendStatus','status','end','offset','undefined','count','limit','Content-Range','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','then','error','stack','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','options','VoiceExtension','includeAll','include','findAll','catch','show','merge','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','inbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','cutdigits','mandatoryDisposition'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f22,0xb4));var _0x23f2=function(_0x344d34,_0x3faab7){_0x344d34=_0x344d34-0x0;var _0x445299=_0x3f22[_0x344d34];return _0x445299;};'use strict';var _=require(_0x23f2('0x0'));var Redis=require(_0x23f2('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x23f2('0x2'))(_0x23f2('0x3'));var config=require('../../config/environment');var db=require(_0x23f2('0x4'))['db'];config['redis']=_[_0x23f2('0x5')](config[_0x23f2('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23f2('0x6')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x578d9f,_0x369ee3){_0x369ee3=_0x369ee3||0xcc;return function(_0x3bf69a){if(_0x3bf69a){return _0x578d9f[_0x23f2('0x7')](_0x369ee3);}return _0x578d9f[_0x23f2('0x8')](_0x369ee3)[_0x23f2('0x9')]();};}function respondWithResult(_0x2a2b47,_0x528e32){_0x528e32=_0x528e32||0xc8;return function(_0x360dcd){if(_0x360dcd){return _0x2a2b47[_0x23f2('0x8')](_0x528e32)['json'](_0x360dcd);}};}function respondWithFilteredResult(_0x1d3915,_0x1f9937){return function(_0x4d5235){if(_0x4d5235){var _0x465d22=typeof _0x1f9937[_0x23f2('0xa')]===_0x23f2('0xb')&&typeof _0x1f9937['limit']===_0x23f2('0xb');var _0x1c9361=_0x4d5235[_0x23f2('0xc')];var _0x50b90e=_0x465d22?0x0:_0x1f9937[_0x23f2('0xa')];var _0x1b06f8=_0x465d22?_0x4d5235['count']:_0x1f9937['offset']+_0x1f9937[_0x23f2('0xd')];var _0x2bc59e;if(_0x1b06f8>=_0x1c9361){_0x1b06f8=_0x1c9361;_0x2bc59e=0xc8;}else{_0x2bc59e=0xce;}_0x1d3915[_0x23f2('0x8')](_0x2bc59e);return _0x1d3915['set'](_0x23f2('0xe'),_0x50b90e+'-'+_0x1b06f8+'/'+_0x1c9361)['json'](_0x4d5235);}return null;};}function removeEntity(_0x350afd){return function(_0xf27993){if(_0xf27993){return _0xf27993['destroy']()['then'](function(){var _0x35f307=_0xf27993[_0x23f2('0xf')]({'plain':!![]});var _0x44c292=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x23f2('0x10'),'value':_0x23f2('0x11'),'ignore':![]},{'name':_0x23f2('0x12'),'value':_0x23f2('0x13'),'ignore':![]}];var _0x1e5f44=_(_0x44c292)[_0x23f2('0x14')](_0x23f2('0x15'))[_0x23f2('0x16')](_0x23f2('0x17'))[_0x23f2('0x17')]();if(_[_0x23f2('0x18')](_0x1e5f44,_0x35f307[_0x23f2('0x19')])){return;}var _0x2aac6f=_[_0x23f2('0x1a')](_0x44c292,[_0x23f2('0x17'),_0x35f307[_0x23f2('0x19')]])[_0x23f2('0x1b')];return db[_0x23f2('0x1c')][_0x23f2('0x1d')]({'where':{'type':_0x2aac6f,'resourceId':_0x35f307['id']}})[_0x23f2('0x1e')](function(){return _0xf27993;});})[_0x23f2('0x1e')](function(){_0x350afd[_0x23f2('0x8')](0xcc)[_0x23f2('0x9')]();});}};}function handleEntityNotFound(_0x709af0){return function(_0x46254e){if(!_0x46254e){_0x709af0['sendStatus'](0x194);}return _0x46254e;};}function handleError(_0x1953ba,_0x5c0de0){_0x5c0de0=_0x5c0de0||0x1f4;return function(_0x42377b){logger[_0x23f2('0x1f')](_0x42377b[_0x23f2('0x20')]);if(_0x42377b[_0x23f2('0x1b')]){delete _0x42377b[_0x23f2('0x1b')];}_0x1953ba[_0x23f2('0x8')](_0x5c0de0)[_0x23f2('0x21')](_0x42377b);};}exports[_0x23f2('0x22')]=function(_0x3666bd,_0x58a790){var _0x59907c={},_0x2f9816={},_0x418450={'count':0x0,'rows':[]};var _0x3b0127=_[_0x23f2('0x16')](db['VoiceExtension'][_0x23f2('0x23')],function(_0x23db02){return{'name':_0x23db02['fieldName'],'type':_0x23db02[_0x23f2('0x19')][_0x23f2('0x24')]};});_0x2f9816[_0x23f2('0x25')]=_['map'](_0x3b0127,'name');_0x2f9816[_0x23f2('0x26')]=_[_0x23f2('0x27')](_0x3666bd[_0x23f2('0x26')]);_0x2f9816[_0x23f2('0x28')]=_[_0x23f2('0x29')](_0x2f9816[_0x23f2('0x25')],_0x2f9816[_0x23f2('0x26')]);_0x59907c[_0x23f2('0x2a')]=_[_0x23f2('0x29')](_0x2f9816[_0x23f2('0x25')],qs[_0x23f2('0x2b')](_0x3666bd[_0x23f2('0x26')][_0x23f2('0x2b')]));_0x59907c[_0x23f2('0x2a')]=_0x59907c[_0x23f2('0x2a')][_0x23f2('0x2c')]?_0x59907c[_0x23f2('0x2a')]:_0x2f9816[_0x23f2('0x25')];if(!_0x3666bd[_0x23f2('0x26')]['hasOwnProperty'](_0x23f2('0x2d'))){_0x59907c[_0x23f2('0xd')]=qs['limit'](_0x3666bd['query'][_0x23f2('0xd')]);_0x59907c['offset']=qs[_0x23f2('0xa')](_0x3666bd['query']['offset']);}_0x59907c[_0x23f2('0x2e')]=qs[_0x23f2('0x2f')](_0x3666bd[_0x23f2('0x26')][_0x23f2('0x2f')]);_0x59907c[_0x23f2('0x30')]=qs['filters'](_[_0x23f2('0x31')](_0x3666bd[_0x23f2('0x26')],_0x2f9816[_0x23f2('0x28')]),_0x3b0127);if(_0x3666bd['query']['filter']){_0x59907c[_0x23f2('0x30')]=_['merge'](_0x59907c['where'],{'$or':_['map'](_0x3b0127,function(_0x4c32a9){if(_0x4c32a9[_0x23f2('0x19')]!=='VIRTUAL'){var _0x3a321b={};_0x3a321b[_0x4c32a9['name']]={'$like':'%'+_0x3666bd['query'][_0x23f2('0x14')]+'%'};return _0x3a321b;}})});}_0x59907c=_['merge']({},_0x59907c,_0x3666bd[_0x23f2('0x32')]);var _0x4f4be8={'where':_0x59907c[_0x23f2('0x30')]};return db[_0x23f2('0x33')]['count'](_0x4f4be8)[_0x23f2('0x1e')](function(_0x55956a){_0x418450[_0x23f2('0xc')]=_0x55956a;if(_0x3666bd['query'][_0x23f2('0x34')]){_0x59907c[_0x23f2('0x35')]=[{'all':!![]}];}return db[_0x23f2('0x33')][_0x23f2('0x36')](_0x59907c);})[_0x23f2('0x1e')](function(_0xa84042){_0x418450['rows']=_0xa84042;return _0x418450;})[_0x23f2('0x1e')](respondWithFilteredResult(_0x58a790,_0x59907c))[_0x23f2('0x37')](handleError(_0x58a790,null));};exports[_0x23f2('0x38')]=function(_0x1233bb,_0x38642b){var _0x2cfab8={'raw':![],'where':{'id':_0x1233bb['params']['id']}},_0x4bb278={};_0x4bb278[_0x23f2('0x25')]=_[_0x23f2('0x27')](db[_0x23f2('0x33')][_0x23f2('0x23')]);_0x4bb278[_0x23f2('0x26')]=_[_0x23f2('0x27')](_0x1233bb['query']);_0x4bb278[_0x23f2('0x28')]=_[_0x23f2('0x29')](_0x4bb278[_0x23f2('0x25')],_0x4bb278[_0x23f2('0x26')]);_0x2cfab8[_0x23f2('0x2a')]=_[_0x23f2('0x29')](_0x4bb278[_0x23f2('0x25')],qs[_0x23f2('0x2b')](_0x1233bb[_0x23f2('0x26')][_0x23f2('0x2b')]));_0x2cfab8[_0x23f2('0x2a')]=_0x2cfab8[_0x23f2('0x2a')][_0x23f2('0x2c')]?_0x2cfab8[_0x23f2('0x2a')]:_0x4bb278['model'];if(_0x1233bb['query']['includeAll']){_0x2cfab8[_0x23f2('0x35')]=[{'all':!![]}];}_0x2cfab8=_[_0x23f2('0x39')]({},_0x2cfab8,_0x1233bb[_0x23f2('0x32')]);return db[_0x23f2('0x33')][_0x23f2('0x1a')](_0x2cfab8)[_0x23f2('0x1e')](handleEntityNotFound(_0x38642b,null))[_0x23f2('0x1e')](respondWithResult(_0x38642b,null))[_0x23f2('0x37')](handleError(_0x38642b,null));};exports[_0x23f2('0x1d')]=function(_0x536fbd,_0x5efeb0){return db[_0x23f2('0x33')][_0x23f2('0x1a')]({'where':{'id':_0x536fbd[_0x23f2('0x3a')]['id']}})[_0x23f2('0x1e')](handleEntityNotFound(_0x5efeb0,null))[_0x23f2('0x1e')](removeEntity(_0x5efeb0,null))['catch'](handleError(_0x5efeb0,null));};exports[_0x23f2('0x3b')]=function(_0x219d78,_0x5596f1){if(_0x219d78[_0x23f2('0x3c')]['type']===_0x23f2('0x11')&&!_[_0x23f2('0x3d')](_0x219d78[_0x23f2('0x3c')][_0x23f2('0x3e')],'_')){_0x219d78[_0x23f2('0x3c')][_0x23f2('0x3e')]='_'['concat'](_0x219d78[_0x23f2('0x3c')]['exten']);}return db[_0x23f2('0x33')]['create'](_0x219d78[_0x23f2('0x3c')],{'raw':![]})[_0x23f2('0x1e')](function(_0x5bc2f7){var _0x349c63=_0x219d78[_0x23f2('0x3f')]['get']({'plain':!![]});if(!_0x349c63)throw new Error(_0x23f2('0x40'));if(_0x349c63[_0x23f2('0x41')]==='user'){var _0x5e09c7=_0x5bc2f7[_0x23f2('0xf')]({'plain':!![]});var _0x19a36b=[{'name':_0x23f2('0x42'),'value':_0x23f2('0x43')},{'name':_0x23f2('0x10'),'value':_0x23f2('0x11')},{'name':_0x23f2('0x12'),'value':_0x23f2('0x13')}];var _0x324484=_[_0x23f2('0x1a')](_0x19a36b,[_0x23f2('0x17'),_0x5e09c7[_0x23f2('0x19')]])[_0x23f2('0x1b')];return db[_0x23f2('0x44')]['find']({'where':{'name':_0x324484,'userProfileId':_0x349c63[_0x23f2('0x45')]},'raw':!![]})[_0x23f2('0x1e')](function(_0x4ad78d){if(_0x4ad78d&&_0x4ad78d['autoAssociation']===0x0){return db[_0x23f2('0x1c')][_0x23f2('0x3b')]({'name':_0x5e09c7[_0x23f2('0x1b')],'resourceId':_0x5e09c7['id'],'type':_0x4ad78d['name'],'sectionId':_0x4ad78d['id']},{})[_0x23f2('0x1e')](function(){return _0x5bc2f7;});}else{return _0x5bc2f7;}})['catch'](function(_0x2ea4f6){logger['error'](_0x23f2('0x46'),_0x2ea4f6);throw _0x2ea4f6;});}return _0x5bc2f7;})[_0x23f2('0x1e')](respondWithResult(_0x5596f1,0xc9))[_0x23f2('0x37')](handleError(_0x5596f1,null));};exports[_0x23f2('0x47')]=function(_0x566792,_0x32d4b8){if(_0x566792[_0x23f2('0x3c')]['id']){delete _0x566792[_0x23f2('0x3c')]['id'];}return db['VoiceExtension'][_0x23f2('0x1a')]({'where':{'id':_0x566792[_0x23f2('0x3a')]['id']}})['then'](handleEntityNotFound(_0x32d4b8,null))[_0x23f2('0x1e')](function(_0x229412){if(_0x229412){return db[_0x23f2('0x33')][_0x23f2('0x47')](_[_0x23f2('0x31')](_0x566792[_0x23f2('0x3c')],[_0x23f2('0x3e'),_0x23f2('0x48'),'description','recordingFormat',_0x23f2('0x49'),_0x23f2('0x4a'),_0x23f2('0x4b')]),{'where':{'context':_0x229412[_0x23f2('0x48')],'exten':_0x229412[_0x23f2('0x3e')]},'individualHooks':!![]})[_0x23f2('0x1e')](function(_0x1e6ad1){return _0x1e6ad1;});}return null;})[_0x23f2('0x1e')](respondWithStatusCode(_0x32d4b8,null))[_0x23f2('0x37')](handleError(_0x32d4b8,null));};exports[_0x23f2('0x4c')]=function(_0x1df4ef,_0x1bae94){var _0x56544d=_0x1df4ef[_0x23f2('0x3a')]['id'];var _0x3374dc=_0x1df4ef[_0x23f2('0x3c')];var _0x5f1430=0xc8;var _0x396b9d=null;return db[_0x23f2('0x4d')]['transaction']({'isolationLevel':db[_0x23f2('0x4d')][_0x23f2('0x4e')]['ISOLATION_LEVELS'][_0x23f2('0x4f')]},function(_0x515983){return db[_0x23f2('0x33')][_0x23f2('0x50')]({'where':{'id':_0x56544d},'transaction':_0x515983})[_0x23f2('0x1e')](function(_0x157de6){if(_0x157de6){return db[_0x23f2('0x33')]['destroy']({'where':{'VoiceExtensionId':_0x56544d},'transaction':_0x515983})[_0x23f2('0x1e')](function(){var _0x2cd708=_[_0x23f2('0x16')](_0x3374dc,function(_0x2b0b73){_0x2b0b73['VoiceExtensionId']=_0x56544d;_0x2b0b73[_0x23f2('0x51')]=!![];return _0x2b0b73;});return _0x157de6[_0x23f2('0x52')](_0x2cd708);})[_0x23f2('0x1e')](function(_0x1a729e){return db[_0x23f2('0x33')]['bulkCreate'](_0x1a729e,{'transaction':_0x515983});});}else{_0x5f1430=0x194;_0x396b9d=[];}});})[_0x23f2('0x1e')](function(){if(_0x5f1430!==0x194){return db[_0x23f2('0x33')][_0x23f2('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x56544d},'order':'cast(priority\x20as\x20unsigned)'})[_0x23f2('0x1e')](function(_0x243378){_0x396b9d=_0x243378;});}})[_0x23f2('0x37')](function(_0x2b128b){_0x5f1430=0x1f4;logger['error'](_0x2b128b[_0x23f2('0x20')]);if(_0x2b128b[_0x23f2('0x1b')]){delete _0x2b128b['name'];}_0x396b9d=_0x2b128b;})[_0x23f2('0x54')](function(){if(_0x396b9d===null){_0x1bae94['sendStatus'](_0x5f1430);}else{if(_0x5f1430===0x1f4){_0x1bae94['status'](_0x5f1430)['send'](_0x396b9d);}else{_0x1bae94[_0x23f2('0x8')](_0x5f1430)['json'](_0x396b9d);}}});}; \ No newline at end of file +var _0xf898=['stack','name','send','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','pick','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','startsWith','exten','body','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','type','find','UserProfileResource'];(function(_0x29df94,_0x4f6a2c){var _0x361b9b=function(_0x27652b){while(--_0x27652b){_0x29df94['push'](_0x29df94['shift']());}};_0x361b9b(++_0x4f6a2c);}(_0xf898,0x98));var _0x8f89=function(_0x5aa497,_0xcbc412){_0x5aa497=_0x5aa497-0x0;var _0x2ce149=_0xf898[_0x5aa497];return _0x2ce149;};'use strict';var _=require(_0x8f89('0x0'));var Redis=require(_0x8f89('0x1'));var qs=require(_0x8f89('0x2'));var logger=require('../../config/logger')(_0x8f89('0x3'));var config=require(_0x8f89('0x4'));var db=require(_0x8f89('0x5'))['db'];config[_0x8f89('0x6')]=_[_0x8f89('0x7')](config[_0x8f89('0x6')],{'host':_0x8f89('0x8'),'port':0x18eb});var socket=require(_0x8f89('0x9'))(new Redis(config[_0x8f89('0x6')]));require(_0x8f89('0xa'))[_0x8f89('0xb')](socket);function respondWithStatusCode(_0x26551e,_0x8a05fe){_0x8a05fe=_0x8a05fe||0xcc;return function(_0x385b08){if(_0x385b08){return _0x26551e[_0x8f89('0xc')](_0x8a05fe);}return _0x26551e[_0x8f89('0xd')](_0x8a05fe)[_0x8f89('0xe')]();};}function respondWithResult(_0x5785f4,_0x179a75){_0x179a75=_0x179a75||0xc8;return function(_0x17f335){if(_0x17f335){return _0x5785f4[_0x8f89('0xd')](_0x179a75)[_0x8f89('0xf')](_0x17f335);}};}function respondWithFilteredResult(_0xedc87d,_0x3903d9){return function(_0x4c1b54){if(_0x4c1b54){var _0x10c842=typeof _0x3903d9[_0x8f89('0x10')]===_0x8f89('0x11')&&typeof _0x3903d9[_0x8f89('0x12')]===_0x8f89('0x11');var _0x20aa74=_0x4c1b54[_0x8f89('0x13')];var _0x46d1cd=_0x10c842?0x0:_0x3903d9[_0x8f89('0x10')];var _0x1730b2=_0x10c842?_0x4c1b54['count']:_0x3903d9[_0x8f89('0x10')]+_0x3903d9[_0x8f89('0x12')];var _0x292e30;if(_0x1730b2>=_0x20aa74){_0x1730b2=_0x20aa74;_0x292e30=0xc8;}else{_0x292e30=0xce;}_0xedc87d['status'](_0x292e30);return _0xedc87d[_0x8f89('0x14')]('Content-Range',_0x46d1cd+'-'+_0x1730b2+'/'+_0x20aa74)[_0x8f89('0xf')](_0x4c1b54);}return null;};}function removeEntity(_0x4a6fd7){return function(_0x3be7fd){if(_0x3be7fd){return _0x3be7fd[_0x8f89('0x15')]()[_0x8f89('0x16')](function(){var _0x158c92=_0x3be7fd[_0x8f89('0x17')]({'plain':!![]});var _0x17d5b3=[{'name':'InboundRoutes','value':_0x8f89('0x18'),'ignore':![]},{'name':_0x8f89('0x19'),'value':_0x8f89('0x1a'),'ignore':![]},{'name':_0x8f89('0x1b'),'value':_0x8f89('0x1c'),'ignore':![]}];var _0xa36a3c=_(_0x17d5b3)[_0x8f89('0x1d')](_0x8f89('0x1e'))['map']('value')[_0x8f89('0x1f')]();if(_[_0x8f89('0x20')](_0xa36a3c,_0x158c92[_0x8f89('0x21')])){return;}var _0x1aa5e6=_[_0x8f89('0x22')](_0x17d5b3,[_0x8f89('0x1f'),_0x158c92[_0x8f89('0x21')]])['name'];return db[_0x8f89('0x23')][_0x8f89('0x15')]({'where':{'type':_0x1aa5e6,'resourceId':_0x158c92['id']}})[_0x8f89('0x16')](function(){return _0x3be7fd;});})[_0x8f89('0x16')](function(){_0x4a6fd7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27860f){return function(_0x3fc442){if(!_0x3fc442){_0x27860f[_0x8f89('0xc')](0x194);}return _0x3fc442;};}function handleError(_0x2eb441,_0x2a18f3){_0x2a18f3=_0x2a18f3||0x1f4;return function(_0x49fe4e){logger['error'](_0x49fe4e[_0x8f89('0x24')]);if(_0x49fe4e[_0x8f89('0x25')]){delete _0x49fe4e['name'];}_0x2eb441[_0x8f89('0xd')](_0x2a18f3)[_0x8f89('0x26')](_0x49fe4e);};}exports[_0x8f89('0x27')]=function(_0x3c0226,_0x164b1b){var _0x484a62={},_0x39ea7a={},_0x15bda1={'count':0x0,'rows':[]};var _0x5605fc=_[_0x8f89('0x28')](db[_0x8f89('0x29')][_0x8f89('0x2a')],function(_0x3b3548){return{'name':_0x3b3548[_0x8f89('0x2b')],'type':_0x3b3548[_0x8f89('0x21')][_0x8f89('0x2c')]};});_0x39ea7a[_0x8f89('0x2d')]=_[_0x8f89('0x28')](_0x5605fc,_0x8f89('0x25'));_0x39ea7a[_0x8f89('0x2e')]=_[_0x8f89('0x2f')](_0x3c0226['query']);_0x39ea7a[_0x8f89('0x30')]=_['intersection'](_0x39ea7a['model'],_0x39ea7a[_0x8f89('0x2e')]);_0x484a62['attributes']=_[_0x8f89('0x31')](_0x39ea7a[_0x8f89('0x2d')],qs[_0x8f89('0x32')](_0x3c0226[_0x8f89('0x2e')]['fields']));_0x484a62[_0x8f89('0x33')]=_0x484a62[_0x8f89('0x33')]['length']?_0x484a62[_0x8f89('0x33')]:_0x39ea7a[_0x8f89('0x2d')];if(!_0x3c0226[_0x8f89('0x2e')]['hasOwnProperty'](_0x8f89('0x34'))){_0x484a62[_0x8f89('0x12')]=qs['limit'](_0x3c0226['query'][_0x8f89('0x12')]);_0x484a62[_0x8f89('0x10')]=qs[_0x8f89('0x10')](_0x3c0226[_0x8f89('0x2e')][_0x8f89('0x10')]);}_0x484a62[_0x8f89('0x35')]=qs['sort'](_0x3c0226[_0x8f89('0x2e')]['sort']);_0x484a62['where']=qs[_0x8f89('0x30')](_[_0x8f89('0x36')](_0x3c0226[_0x8f89('0x2e')],_0x39ea7a['filters']),_0x5605fc);if(_0x3c0226['query'][_0x8f89('0x1d')]){_0x484a62['where']=_[_0x8f89('0x37')](_0x484a62[_0x8f89('0x38')],{'$or':_[_0x8f89('0x28')](_0x5605fc,function(_0x57783f){if(_0x57783f[_0x8f89('0x21')]!==_0x8f89('0x39')){var _0x425a6c={};_0x425a6c[_0x57783f[_0x8f89('0x25')]]={'$like':'%'+_0x3c0226['query'][_0x8f89('0x1d')]+'%'};return _0x425a6c;}})});}_0x484a62=_[_0x8f89('0x37')]({},_0x484a62,_0x3c0226[_0x8f89('0x3a')]);var _0x3e29d6={'where':_0x484a62[_0x8f89('0x38')]};return db[_0x8f89('0x29')][_0x8f89('0x13')](_0x3e29d6)[_0x8f89('0x16')](function(_0xacd5a9){_0x15bda1[_0x8f89('0x13')]=_0xacd5a9;if(_0x3c0226[_0x8f89('0x2e')][_0x8f89('0x3b')]){_0x484a62['include']=[{'all':!![]}];}return db[_0x8f89('0x29')][_0x8f89('0x3c')](_0x484a62);})[_0x8f89('0x16')](function(_0x3b9d54){_0x15bda1[_0x8f89('0x3d')]=_0x3b9d54;return _0x15bda1;})['then'](respondWithFilteredResult(_0x164b1b,_0x484a62))[_0x8f89('0x3e')](handleError(_0x164b1b,null));};exports[_0x8f89('0x3f')]=function(_0x72f2de,_0x25b668){var _0x2f3ae7={'raw':![],'where':{'id':_0x72f2de[_0x8f89('0x40')]['id']}},_0x128b8a={};_0x128b8a['model']=_[_0x8f89('0x2f')](db['VoiceExtension']['rawAttributes']);_0x128b8a[_0x8f89('0x2e')]=_[_0x8f89('0x2f')](_0x72f2de[_0x8f89('0x2e')]);_0x128b8a[_0x8f89('0x30')]=_[_0x8f89('0x31')](_0x128b8a[_0x8f89('0x2d')],_0x128b8a[_0x8f89('0x2e')]);_0x2f3ae7[_0x8f89('0x33')]=_[_0x8f89('0x31')](_0x128b8a[_0x8f89('0x2d')],qs[_0x8f89('0x32')](_0x72f2de[_0x8f89('0x2e')][_0x8f89('0x32')]));_0x2f3ae7['attributes']=_0x2f3ae7[_0x8f89('0x33')]['length']?_0x2f3ae7[_0x8f89('0x33')]:_0x128b8a['model'];if(_0x72f2de[_0x8f89('0x2e')][_0x8f89('0x3b')]){_0x2f3ae7[_0x8f89('0x41')]=[{'all':!![]}];}_0x2f3ae7=_[_0x8f89('0x37')]({},_0x2f3ae7,_0x72f2de[_0x8f89('0x3a')]);return db[_0x8f89('0x29')][_0x8f89('0x22')](_0x2f3ae7)[_0x8f89('0x16')](handleEntityNotFound(_0x25b668,null))[_0x8f89('0x16')](respondWithResult(_0x25b668,null))['catch'](handleError(_0x25b668,null));};exports[_0x8f89('0x15')]=function(_0x390f0e,_0x17bf01){return db[_0x8f89('0x29')]['find']({'where':{'id':_0x390f0e[_0x8f89('0x40')]['id']}})[_0x8f89('0x16')](handleEntityNotFound(_0x17bf01,null))[_0x8f89('0x16')](removeEntity(_0x17bf01,null))[_0x8f89('0x3e')](handleError(_0x17bf01,null));};exports[_0x8f89('0x42')]=function(_0xa13cc4,_0x434a0e){if(_0xa13cc4['body'][_0x8f89('0x21')]===_0x8f89('0x1a')&&!_[_0x8f89('0x43')](_0xa13cc4['body'][_0x8f89('0x44')],'_')){_0xa13cc4[_0x8f89('0x45')][_0x8f89('0x44')]='_'[_0x8f89('0x46')](_0xa13cc4[_0x8f89('0x45')]['exten']);}return db[_0x8f89('0x29')][_0x8f89('0x42')](_0xa13cc4[_0x8f89('0x45')],{'raw':![]})[_0x8f89('0x16')](function(_0x260b44){var _0x4d4f9b=_0xa13cc4['user']['get']({'plain':!![]});if(!_0x4d4f9b)throw new Error(_0x8f89('0x47'));if(_0x4d4f9b['role']==='user'){var _0x1d1aa2=_0x260b44[_0x8f89('0x17')]({'plain':!![]});var _0x5ebd44=[{'name':_0x8f89('0x48'),'value':'inbound'},{'name':_0x8f89('0x19'),'value':_0x8f89('0x1a')},{'name':'InternalRoutes','value':_0x8f89('0x1c')}];var _0x1e3d64=_['find'](_0x5ebd44,[_0x8f89('0x1f'),_0x1d1aa2[_0x8f89('0x21')]])[_0x8f89('0x25')];return db['UserProfileSection'][_0x8f89('0x22')]({'where':{'name':_0x1e3d64,'userProfileId':_0x4d4f9b[_0x8f89('0x49')]},'raw':!![]})[_0x8f89('0x16')](function(_0x4a5e15){if(_0x4a5e15&&_0x4a5e15[_0x8f89('0x4a')]===0x0){return db[_0x8f89('0x23')][_0x8f89('0x42')]({'name':_0x1d1aa2[_0x8f89('0x25')],'resourceId':_0x1d1aa2['id'],'type':_0x4a5e15[_0x8f89('0x25')],'sectionId':_0x4a5e15['id']},{})[_0x8f89('0x16')](function(){return _0x260b44;});}else{return _0x260b44;}})[_0x8f89('0x3e')](function(_0x9983f){logger[_0x8f89('0x4b')](_0x8f89('0x4c'),_0x9983f);throw _0x9983f;});}return _0x260b44;})[_0x8f89('0x16')](respondWithResult(_0x434a0e,0xc9))[_0x8f89('0x3e')](handleError(_0x434a0e,null));};exports[_0x8f89('0x4d')]=function(_0x721efc,_0x45e173){if(_0x721efc[_0x8f89('0x45')]['id']){delete _0x721efc[_0x8f89('0x45')]['id'];}return db['VoiceExtension'][_0x8f89('0x22')]({'where':{'id':_0x721efc[_0x8f89('0x40')]['id']}})[_0x8f89('0x16')](handleEntityNotFound(_0x45e173,null))[_0x8f89('0x16')](function(_0x358af1){if(_0x358af1){return db[_0x8f89('0x29')][_0x8f89('0x4d')](_[_0x8f89('0x36')](_0x721efc['body'],[_0x8f89('0x44'),'context','description',_0x8f89('0x4e'),_0x8f89('0x4f'),_0x8f89('0x50'),_0x8f89('0x51')]),{'where':{'context':_0x358af1[_0x8f89('0x52')],'exten':_0x358af1['exten']},'individualHooks':!![]})[_0x8f89('0x16')](function(_0x568374){return _0x568374;});}return null;})[_0x8f89('0x16')](respondWithStatusCode(_0x45e173,null))[_0x8f89('0x3e')](handleError(_0x45e173,null));};exports[_0x8f89('0x53')]=function(_0x58b6d8,_0xa1300e){var _0x529daa=_0x58b6d8[_0x8f89('0x40')]['id'];var _0x2eed2a=_0x58b6d8['body'];var _0x38349b=0xc8;var _0x1df428=null;return db[_0x8f89('0x54')][_0x8f89('0x55')]({'isolationLevel':db['sequelize'][_0x8f89('0x56')][_0x8f89('0x57')][_0x8f89('0x58')]},function(_0x4844bd){return db[_0x8f89('0x29')][_0x8f89('0x59')]({'where':{'id':_0x529daa},'transaction':_0x4844bd})[_0x8f89('0x16')](function(_0x592a6d){if(_0x592a6d){return db[_0x8f89('0x29')]['destroy']({'where':{'VoiceExtensionId':_0x529daa},'transaction':_0x4844bd})[_0x8f89('0x16')](function(){var _0x5c51a4=_[_0x8f89('0x28')](_0x2eed2a,function(_0x58ca3a){_0x58ca3a[_0x8f89('0x5a')]=_0x529daa;_0x58ca3a[_0x8f89('0x5b')]=!![];return _0x58ca3a;});return _0x592a6d['createRouting'](_0x5c51a4);})[_0x8f89('0x16')](function(_0xa4f9fa){return db[_0x8f89('0x29')]['bulkCreate'](_0xa4f9fa,{'transaction':_0x4844bd});});}else{_0x38349b=0x194;_0x1df428=[];}});})[_0x8f89('0x16')](function(){if(_0x38349b!==0x194){return db[_0x8f89('0x29')][_0x8f89('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x529daa},'order':_0x8f89('0x5d')})[_0x8f89('0x16')](function(_0x53510b){_0x1df428=_0x53510b;});}})[_0x8f89('0x3e')](function(_0x1f52f1){_0x38349b=0x1f4;logger[_0x8f89('0x4b')](_0x1f52f1[_0x8f89('0x24')]);if(_0x1f52f1[_0x8f89('0x25')]){delete _0x1f52f1[_0x8f89('0x25')];}_0x1df428=_0x1f52f1;})['finally'](function(){if(_0x1df428===null){_0xa1300e[_0x8f89('0xc')](_0x38349b);}else{if(_0x38349b===0x1f4){_0xa1300e['status'](_0x38349b)[_0x8f89('0x26')](_0x1df428);}else{_0xa1300e[_0x8f89('0xd')](_0x38349b)['json'](_0x1df428);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ce498bd..856fa96 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 _0xa377=['update','remove','emit','exports','events','VoiceExtension','setMaxListeners'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xa377,0x74));var _0x7a37=function(_0x4396a0,_0x115ff8){_0x4396a0=_0x4396a0-0x0;var _0x1f1793=_0xa377[_0x4396a0];return _0x1f1793;};'use strict';var EventEmitter=require(_0x7a37('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x7a37('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7a37('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7a37('0x3'),'afterDestroy':_0x7a37('0x4')};function emitEvent(_0xae6ccd){return function(_0x358f83,_0x3735db,_0x2946a2){VoiceExtensionEvents[_0x7a37('0x5')](_0xae6ccd+':'+_0x358f83['id'],_0x358f83);VoiceExtensionEvents[_0x7a37('0x5')](_0xae6ccd,_0x358f83);_0x2946a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x7a37('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xddf5=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3c1d98,_0x5e8a76){var _0x462c73=function(_0x402ddc){while(--_0x402ddc){_0x3c1d98['push'](_0x3c1d98['shift']());}};_0x462c73(++_0x5e8a76);}(_0xddf5,0x117));var _0x5ddf=function(_0x58b3ff,_0x43f7bd){_0x58b3ff=_0x58b3ff-0x0;var _0x1b08f0=_0xddf5[_0x58b3ff];return _0x1b08f0;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x5ddf('0x0'))['db'][_0x5ddf('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5ddf('0x2')](0x0);var events={'afterCreate':_0x5ddf('0x3'),'afterUpdate':'update','afterDestroy':_0x5ddf('0x4')};function emitEvent(_0x42129a){return function(_0x258d59,_0x2de33f,_0x2b8093){VoiceExtensionEvents[_0x5ddf('0x5')](_0x42129a+':'+_0x258d59['id'],_0x258d59);VoiceExtensionEvents[_0x5ddf('0x5')](_0x42129a,_0x258d59);_0x2b8093(null);};}for(var e in events){if(events[_0x5ddf('0x6')](e)){var event=events[e];VoiceExtension[_0x5ddf('0x7')](e,emitEvent(event));}}module[_0x5ddf('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 8ac2dbf..51ef078 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 _0xa1aa=['length','name','phone','prefix','param','SIP','none','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split'];(function(_0xa8d7ef,_0x4b8b3d){var _0x239d5e=function(_0x15150d){while(--_0x15150d){_0xa8d7ef['push'](_0xa8d7ef['shift']());}};_0x239d5e(++_0x4b8b3d);}(_0xa1aa,0x88));var _0xaa1a=function(_0x2908a9,_0x40730a){_0x2908a9=_0x2908a9-0x0;var _0x2ad3f7=_0xa1aa[_0x2908a9];return _0x2ad3f7;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0xaa1a('0x0')]=function(_0x35f77f){var _0x39e955=_0x35f77f[_0xaa1a('0x1')];function _0x1b5247(_0x1a66ed){var _0x34f7d0=0x2;var _0x4e7869=[{'type':_0x1a66ed[_0xaa1a('0x2')],'app':_0xaa1a('0x3'),'appdata':'CDR(type)='+_0x1a66ed[_0xaa1a('0x2')],'context':_0x1a66ed[_0xaa1a('0x4')],'exten':_0x1a66ed[_0xaa1a('0x5')],'priority':_0x34f7d0++,'VoiceExtensionId':_0x1a66ed['id']},{'type':_0x1a66ed[_0xaa1a('0x2')],'app':_0x1a66ed[_0xaa1a('0x6')]?_0xaa1a('0x3'):_0xaa1a('0x7'),'appdata':_0x1a66ed[_0xaa1a('0x6')]?_0xaa1a('0x8')+_0x1a66ed['alias']:_0xaa1a('0x9'),'context':_0x1a66ed['context'],'exten':_0x1a66ed[_0xaa1a('0x5')],'priority':_0x34f7d0++,'VoiceExtensionId':_0x1a66ed['id']}];if(_0x1a66ed[_0xaa1a('0x2')]===_0xaa1a('0xa')){_0x4e7869[_0xaa1a('0xb')]({'type':_0xaa1a('0xa'),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0xc')+_0x1a66ed['id'],'context':_0x1a66ed[_0xaa1a('0x4')],'exten':_0x1a66ed[_0xaa1a('0x5')],'priority':_0x34f7d0++,'VoiceExtensionId':_0x1a66ed['id']});}_0x4e7869[_0xaa1a('0xb')]({'type':_0x1a66ed[_0xaa1a('0x2')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1a66ed[_0xaa1a('0x4')],'exten':_0x1a66ed[_0xaa1a('0x5')],'priority':_0x34f7d0++,'VoiceExtensionId':_0x1a66ed['id']},{'type':_0x1a66ed[_0xaa1a('0x2')],'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0xd'),'context':_0x1a66ed[_0xaa1a('0x4')],'exten':_0x1a66ed['exten'],'priority':_0x34f7d0++,'VoiceExtensionId':_0x1a66ed['id']},{'type':_0x1a66ed[_0xaa1a('0x2')],'app':_0xaa1a('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1a66ed[_0xaa1a('0x4')],'exten':_0x1a66ed['exten'],'priority':_0x34f7d0++,'VoiceExtensionId':_0x1a66ed['id']});return _0x4e7869;}function _0x4f2807(_0x35ba97){var _0x3bb7c9=0x2;var _0x3a40c0=[{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0xf'),'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0x35ba97[_0xaa1a('0x6')]?'Set':_0xaa1a('0x7'),'appdata':_0x35ba97[_0xaa1a('0x6')]?_0xaa1a('0x8')+_0x35ba97[_0xaa1a('0x6')]:_0xaa1a('0x9'),'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':'Set','appdata':_0xaa1a('0x10')+(_0x35ba97[_0xaa1a('0x11')]?_0xaa1a('0x12')+_0x35ba97[_0xaa1a('0x11')]+'}':_0xaa1a('0x13')),'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':'CDR(routeid)='+_0x35ba97['id'],'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97['exten'],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x14'),'appdata':_0xaa1a('0x15')+(_0x3bb7c9+0x2)+_0xaa1a('0x16')+(_0x3bb7c9+0x1)+')','context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':'Set','appdata':_0x35ba97[_0xaa1a('0x11')]?_0xaa1a('0x17')+_0x35ba97['cutdigits']+'}':_0xaa1a('0x18'),'context':_0x35ba97['context'],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x35ba97['context'],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0x19'),'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':'outbound','app':'Set','appdata':_0xaa1a('0x1a')+_0x35ba97['id'],'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']}];if(_0x35ba97[_0xaa1a('0x1b')](_0xaa1a('0x1c'))&&_0x35ba97[_0xaa1a('0x1c')]!=='none'){_0x3a40c0[_0xaa1a('0xb')]({'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0x1d'),'context':_0x35ba97[_0xaa1a('0x4')],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']},{'type':_0xaa1a('0xe'),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0x1e')+_0x35ba97[_0xaa1a('0x1c')]||_0xaa1a('0x1f'),'context':_0x35ba97['context'],'exten':_0x35ba97[_0xaa1a('0x5')],'priority':_0x3bb7c9++,'VoiceExtensionId':_0x35ba97['id']});}return _0x3a40c0;}function _0x53be22(_0x42c57e,_0x1231f6){var _0x56dcb6=[{'name':_0xaa1a('0x20'),'param':0x0},{'name':_0xaa1a('0x21'),'param':0x1},{'name':_0xaa1a('0x22'),'param':0x2},{'name':'url','param':0x3}];var _0x3e724b={};var _0xe7446a=_0x1231f6[_0xaa1a('0x23')](',');var _0x251637=[];for(var _0x45a180=0x0;_0x45a180<_0x56dcb6[_0xaa1a('0x24')];_0x45a180++){switch(_0x56dcb6[_0x45a180][_0xaa1a('0x25')]){case'trunk':_0x3e724b[_0xaa1a('0x20')]=_0xe7446a[_0x56dcb6[_0x45a180]['param']][_0xaa1a('0x23')]('/')[0x1];_0x3e724b[_0xaa1a('0x26')]=_0xe7446a[_0x56dcb6[_0x45a180]['param']][_0xaa1a('0x23')]('/')[0x2];_0x3e724b[_0xaa1a('0x27')]=_0x3e724b[_0xaa1a('0x26')]?_0x3e724b[_0xaa1a('0x26')][_0xaa1a('0x23')]('$')[0x0]:undefined;_0x3e724b[_0xaa1a('0x26')]=_0x42c57e[_0xaa1a('0x11')]?(_0x3e724b[_0xaa1a('0x27')]||'')+_0xaa1a('0x12')+_0x42c57e[_0xaa1a('0x11')]+'}':(_0x3e724b[_0xaa1a('0x27')]||'')+_0xaa1a('0x13');_0x251637[_0x56dcb6[_0x45a180][_0xaa1a('0x28')]]=[_0xaa1a('0x29'),_0x3e724b[_0xaa1a('0x20')],_0x3e724b[_0xaa1a('0x26')]]['join']('/');break;case _0xaa1a('0x22'):_0x3e724b[_0xaa1a('0x22')]=_0xe7446a[_0x56dcb6[_0x45a180][_0xaa1a('0x28')]];if(_0x42c57e[_0xaa1a('0x1c')]!==_0xaa1a('0x2a')){if(_0x3e724b[_0xaa1a('0x22')][_0xaa1a('0x2b')](_0xaa1a('0x2c'))<0x0){_0x3e724b[_0xaa1a('0x22')]+=_0xaa1a('0x2c');}}else{_0x3e724b[_0xaa1a('0x22')]=_0x3e724b[_0xaa1a('0x22')][_0xaa1a('0x2d')]('U(xcally-mixmonitor-context)','');}_0x251637[_0x56dcb6[_0x45a180][_0xaa1a('0x28')]]=_0x3e724b[_0xaa1a('0x22')];break;default:_0x251637[_0x56dcb6[_0x45a180][_0xaa1a('0x28')]]=_0xe7446a[_0x56dcb6[_0x45a180]['param']];}}return _0x251637[_0xaa1a('0x2e')](',');}function _0x1822bb(_0x33b3d2,_0x5bd859,_0x40bffd){return new Promise(function(_0x13cd92,_0x21ea70){var _0x3b2b69=[];if(_[_0xaa1a('0x2f')](_0x5bd859))return _0x13cd92(_0x3b2b69);_0x39e955[_0xaa1a('0x30')][_0xaa1a('0x31')]({'attributes':['id',_0xaa1a('0x32'),_0xaa1a('0x33')],'raw':!![]})[_0xaa1a('0x34')](function(_0x2e60d2){for(var _0x2416a7=0x0,_0x418b39=0x0;_0x2416a7<_0x5bd859[_0xaa1a('0x24')];_0x2416a7++,_0x418b39=0x0){var _0x31ff00=_0x5bd859[_0x2416a7];var _0x3f8661=[];var _0x5d3a80=[];delete _0x31ff00['id'];if(_0x31ff00['interval']!==_0xaa1a('0x35')){_0x31ff00[_0xaa1a('0x36')]=[_0x31ff00[_0xaa1a('0x32')]];}else{_0x31ff00[_0xaa1a('0x36')]=_0x31ff00['IntervalId']?_[_0xaa1a('0x37')](_[_0xaa1a('0x38')](_0x2e60d2,{'IntervalId':_0x31ff00[_0xaa1a('0x33')]}),_0xaa1a('0x32')):[];}_0x31ff00[_0xaa1a('0x4')]=_0x33b3d2['context'];_0x31ff00[_0xaa1a('0x5')]=_0x33b3d2[_0xaa1a('0x5')];if(_0x31ff00[_0xaa1a('0x2')])_0x31ff00[_0xaa1a('0x2')]=_0x31ff00[_0xaa1a('0x2')]['toLowerCase']();if(_0x33b3d2[_0xaa1a('0x2')]===_0xaa1a('0xe')){if(_0x31ff00['hasOwnProperty'](_0xaa1a('0x39'))&&_0x31ff00['tag']&&_0x31ff00['tag']!=='--'){_0x3f8661[_0xaa1a('0xb')]({'type':_0x31ff00['type'][_0xaa1a('0x3a')](),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0x3b')+_0x31ff00[_0xaa1a('0x39')],'context':_0x33b3d2[_0xaa1a('0x4')],'exten':_0x33b3d2[_0xaa1a('0x5')],'priority':_0x31ff00[_0xaa1a('0x36')][_0xaa1a('0x24')]+_0x40bffd+_0x418b39++,'VoiceExtensionId':_0x33b3d2['id']});}_0x3f8661[_0xaa1a('0xb')]({'type':_0x31ff00[_0xaa1a('0x2')][_0xaa1a('0x3a')](),'app':_0xaa1a('0x14'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x31ff00[_0xaa1a('0x3c')]?'Set(CALLERID(all)='+_0x31ff00[_0xaa1a('0x3c')]+')':_0xaa1a('0x3d')),'context':_0x33b3d2[_0xaa1a('0x4')],'exten':_0x33b3d2[_0xaa1a('0x5')],'priority':_0x31ff00[_0xaa1a('0x36')][_0xaa1a('0x24')]+_0x40bffd+_0x418b39++,'VoiceExtensionId':_0x33b3d2['id']});}else{if(_0x31ff00[_0xaa1a('0x1b')](_0xaa1a('0x3e'))){if([_0xaa1a('0x3f'),_0xaa1a('0x40')][_0xaa1a('0x41')](_0x31ff00[_0xaa1a('0x42')][_0xaa1a('0x3a')]())&&_0x31ff00[_0xaa1a('0x43')]!==_0xaa1a('0x44')){if(_0x31ff00[_0xaa1a('0x3e')]){_0x3f8661[_0xaa1a('0xb')]({'type':_0x31ff00['type'][_0xaa1a('0x3a')](),'app':'ExecIf','appdata':_0xaa1a('0x45'),'context':_0x33b3d2[_0xaa1a('0x4')],'exten':_0x33b3d2[_0xaa1a('0x5')],'priority':_0x31ff00[_0xaa1a('0x36')][_0xaa1a('0x24')]+_0x40bffd+_0x418b39++,'VoiceExtensionId':_0x33b3d2['id']});_0x3f8661[_0xaa1a('0xb')]({'type':_0x31ff00['type']['toLowerCase'](),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0x46'),'context':_0x33b3d2['context'],'exten':_0x33b3d2['exten'],'priority':_0x31ff00['intervals']['length']+_0x40bffd+_0x418b39++,'VoiceExtensionId':_0x33b3d2['id']});}else{_0x3f8661[_0xaa1a('0xb')]({'type':_0x31ff00[_0xaa1a('0x2')][_0xaa1a('0x3a')](),'app':_0xaa1a('0x14'),'appdata':_0xaa1a('0x47'),'context':_0x33b3d2['context'],'exten':_0x33b3d2[_0xaa1a('0x5')],'priority':_0x31ff00[_0xaa1a('0x36')][_0xaa1a('0x24')]+_0x40bffd+_0x418b39++,'VoiceExtensionId':_0x33b3d2['id']});_0x3f8661[_0xaa1a('0xb')]({'type':_0x31ff00[_0xaa1a('0x2')][_0xaa1a('0x3a')](),'app':_0xaa1a('0x3'),'appdata':_0xaa1a('0x48'),'context':_0x33b3d2['context'],'exten':_0x33b3d2['exten'],'priority':_0x31ff00[_0xaa1a('0x36')][_0xaa1a('0x24')]+_0x40bffd+_0x418b39++,'VoiceExtensionId':_0x33b3d2['id']});}}}}for(var _0x3bb6b6=0x0;_0x3bb6b6<_0x31ff00['intervals']['length'];_0x3bb6b6++){var _0x150e5a=_0x40bffd+_0x31ff00['intervals'][_0xaa1a('0x24')];var _0x961ec0=_0x3bb6b6===_0x31ff00[_0xaa1a('0x36')][_0xaa1a('0x24')]-0x1?_0x40bffd+_0x3f8661[_0xaa1a('0x24')]+_0x5d3a80[_0xaa1a('0x24')]+0x2:_0x40bffd+_0x3bb6b6+0x1;_0x3f8661[_0xaa1a('0x49')](_0x3bb6b6,0x0,{'type':_0x33b3d2['type'],'app':'GotoIfTime','appdata':_0x31ff00[_0xaa1a('0x36')][_0x3bb6b6]+'?'+_0x33b3d2[_0xaa1a('0x4')]+_0xaa1a('0x4a')+_0x150e5a+':'+_0x33b3d2[_0xaa1a('0x4')]+_0xaa1a('0x4a')+_0x961ec0,'exten':_0x33b3d2[_0xaa1a('0x5')],'context':_0x33b3d2[_0xaa1a('0x4')],'priority':_0x40bffd+_0x3bb6b6,'VoiceExtensionId':_0x33b3d2['id']});}if(_0x31ff00[_0xaa1a('0x43')]===_0xaa1a('0x4b'))_0x31ff00[_0xaa1a('0x4c')]=_0x53be22(_0x33b3d2,_0x31ff00[_0xaa1a('0x4c')]);_0x31ff00[_0xaa1a('0x4d')]=_0x3f8661[_0xaa1a('0x24')]?_[_0xaa1a('0x4e')](_0x3f8661)[_0xaa1a('0x4d')]+0x1:_0x40bffd;_0x3b2b69=_[_0xaa1a('0x4f')](_0x3b2b69,_0x3f8661,[_0x31ff00],_0x5d3a80);_0x40bffd=_[_0xaa1a('0x4e')](_0x3b2b69)[_0xaa1a('0x4d')]+0x1;}return _0x13cd92(_0x3b2b69);})[_0xaa1a('0x50')](function(_0x163d39){_0x21ea70(_0x163d39);});});}return _0x35f77f[_0xaa1a('0x51')](_0xaa1a('0x52'),attributes,{'tableName':_0xaa1a('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x43630d){var _0x1cea01=this[_0xaa1a('0x54')]({'plain':!![]});var _0x45a8c7=_0x1cea01[_0xaa1a('0x2')]===_0xaa1a('0xe')?_0x4f2807(_0x1cea01):_0x1b5247(_0x1cea01);return _0x1822bb(_0x1cea01,_0x43630d,_[_0xaa1a('0x4e')](_0x45a8c7)[_0xaa1a('0x4d')]+0x1)['then'](function(_0x345cd1){var _0x44c4df=_[_0xaa1a('0x4f')](_0x45a8c7,_0x345cd1);_0x44c4df['push']({'type':_0x1cea01[_0xaa1a('0x2')],'app':_0xaa1a('0x55'),'exten':_0x1cea01[_0xaa1a('0x5')],'context':_0x1cea01['context'],'priority':_['last'](_0x44c4df)[_0xaa1a('0x4d')]+0x1,'VoiceExtensionId':_0x1cea01['id']});return _0x44c4df;});}}});}; \ No newline at end of file +var _0x63f2=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','recordingFormat','trunk','options','url','split','phone','param','prefix','join','U(xcally-mixmonitor-context)','replace','isEmpty','interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','length','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x421079,_0x11c3be){var _0x1f3158=function(_0xd16c5d){while(--_0xd16c5d){_0x421079['push'](_0x421079['shift']());}};_0x1f3158(++_0x11c3be);}(_0x63f2,0x19b));var _0x263f=function(_0x522851,_0x1f0f54){_0x522851=_0x522851-0x0;var _0x384ef3=_0x63f2[_0x522851];return _0x384ef3;};'use strict';var _=require(_0x263f('0x0'));var attributes=require(_0x263f('0x1'));module[_0x263f('0x2')]=function(_0x316e2d){var _0x158423=_0x316e2d[_0x263f('0x3')];function _0x15660c(_0x4cd09c){var _0x3e39a0=0x2;var _0x5926d1=[{'type':_0x4cd09c[_0x263f('0x4')],'app':_0x263f('0x5'),'appdata':'CDR(type)='+_0x4cd09c[_0x263f('0x4')],'context':_0x4cd09c[_0x263f('0x6')],'exten':_0x4cd09c[_0x263f('0x7')],'priority':_0x3e39a0++,'VoiceExtensionId':_0x4cd09c['id']},{'type':_0x4cd09c['type'],'app':_0x4cd09c[_0x263f('0x8')]?_0x263f('0x5'):_0x263f('0x9'),'appdata':_0x4cd09c[_0x263f('0x8')]?_0x263f('0xa')+_0x4cd09c[_0x263f('0x8')]:'No\x20alias\x20set','context':_0x4cd09c[_0x263f('0x6')],'exten':_0x4cd09c[_0x263f('0x7')],'priority':_0x3e39a0++,'VoiceExtensionId':_0x4cd09c['id']}];if(_0x4cd09c['type']===_0x263f('0xb')){_0x5926d1[_0x263f('0xc')]({'type':_0x263f('0xb'),'app':_0x263f('0x5'),'appdata':_0x263f('0xd')+_0x4cd09c['id'],'context':_0x4cd09c[_0x263f('0x6')],'exten':_0x4cd09c[_0x263f('0x7')],'priority':_0x3e39a0++,'VoiceExtensionId':_0x4cd09c['id']});}_0x5926d1[_0x263f('0xc')]({'type':_0x4cd09c[_0x263f('0x4')],'app':'Set','appdata':_0x263f('0xe'),'context':_0x4cd09c[_0x263f('0x6')],'exten':_0x4cd09c[_0x263f('0x7')],'priority':_0x3e39a0++,'VoiceExtensionId':_0x4cd09c['id']},{'type':_0x4cd09c[_0x263f('0x4')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4cd09c['context'],'exten':_0x4cd09c[_0x263f('0x7')],'priority':_0x3e39a0++,'VoiceExtensionId':_0x4cd09c['id']},{'type':_0x4cd09c[_0x263f('0x4')],'app':'Set','appdata':_0x263f('0xf'),'context':_0x4cd09c[_0x263f('0x6')],'exten':_0x4cd09c[_0x263f('0x7')],'priority':_0x3e39a0++,'VoiceExtensionId':_0x4cd09c['id']});return _0x5926d1;}function _0x2a0ff1(_0x5365ea){var _0x4169c4=0x2;var _0x45698d=[{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':'CDR(type)=outbound','context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x5365ea[_0x263f('0x8')]?_0x263f('0x5'):_0x263f('0x9'),'appdata':_0x5365ea[_0x263f('0x8')]?_0x263f('0xa')+_0x5365ea[_0x263f('0x8')]:_0x263f('0x11'),'context':_0x5365ea['context'],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':_0x263f('0x12')+(_0x5365ea[_0x263f('0x13')]?_0x263f('0x14')+_0x5365ea[_0x263f('0x13')]+'}':_0x263f('0x15')),'context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':'outbound','app':_0x263f('0x5'),'appdata':'CDR(routeid)='+_0x5365ea['id'],'context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea['exten'],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':'outbound','app':'ExecIf','appdata':_0x263f('0x16')+(_0x4169c4+0x2)+'):Goto('+(_0x4169c4+0x1)+')','context':_0x5365ea['context'],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':'Set','appdata':_0x5365ea[_0x263f('0x13')]?_0x263f('0x17')+_0x5365ea[_0x263f('0x13')]+'}':_0x263f('0x18'),'context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea['exten'],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':_0x263f('0x19'),'context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea['exten'],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':_0x263f('0xf'),'context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':_0x263f('0x1a')+_0x5365ea['id'],'context':_0x5365ea['context'],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']}];if(_0x5365ea[_0x263f('0x1b')]('recordingFormat')&&_0x5365ea['recordingFormat']!==_0x263f('0x1c')){_0x45698d[_0x263f('0xc')]({'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':_0x263f('0x1d'),'context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']},{'type':_0x263f('0x10'),'app':_0x263f('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5365ea[_0x263f('0x1e')]||'wav','context':_0x5365ea[_0x263f('0x6')],'exten':_0x5365ea[_0x263f('0x7')],'priority':_0x4169c4++,'VoiceExtensionId':_0x5365ea['id']});}return _0x45698d;}function _0x2aac31(_0x3577d7,_0x20b84a){var _0x59be1c=[{'name':_0x263f('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x263f('0x20'),'param':0x2},{'name':_0x263f('0x21'),'param':0x3}];var _0x27c30f={};var _0x1d4a7d=_0x20b84a[_0x263f('0x22')](',');var _0x18b972=[];for(var _0x452fcc=0x0;_0x452fcc<_0x59be1c['length'];_0x452fcc++){switch(_0x59be1c[_0x452fcc]['name']){case _0x263f('0x1f'):_0x27c30f['trunk']=_0x1d4a7d[_0x59be1c[_0x452fcc]['param']][_0x263f('0x22')]('/')[0x1];_0x27c30f[_0x263f('0x23')]=_0x1d4a7d[_0x59be1c[_0x452fcc][_0x263f('0x24')]][_0x263f('0x22')]('/')[0x2];_0x27c30f[_0x263f('0x25')]=_0x27c30f[_0x263f('0x23')]?_0x27c30f[_0x263f('0x23')][_0x263f('0x22')]('$')[0x0]:undefined;_0x27c30f[_0x263f('0x23')]=_0x3577d7[_0x263f('0x13')]?(_0x27c30f[_0x263f('0x25')]||'')+_0x263f('0x14')+_0x3577d7[_0x263f('0x13')]+'}':(_0x27c30f[_0x263f('0x25')]||'')+_0x263f('0x15');_0x18b972[_0x59be1c[_0x452fcc][_0x263f('0x24')]]=['SIP',_0x27c30f[_0x263f('0x1f')],_0x27c30f['phone']][_0x263f('0x26')]('/');break;case _0x263f('0x20'):_0x27c30f[_0x263f('0x20')]=_0x1d4a7d[_0x59be1c[_0x452fcc][_0x263f('0x24')]];if(_0x3577d7[_0x263f('0x1e')]!=='none'){if(_0x27c30f[_0x263f('0x20')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x27c30f[_0x263f('0x20')]+=_0x263f('0x27');}}else{_0x27c30f[_0x263f('0x20')]=_0x27c30f['options'][_0x263f('0x28')](_0x263f('0x27'),'');}_0x18b972[_0x59be1c[_0x452fcc][_0x263f('0x24')]]=_0x27c30f[_0x263f('0x20')];break;default:_0x18b972[_0x59be1c[_0x452fcc][_0x263f('0x24')]]=_0x1d4a7d[_0x59be1c[_0x452fcc][_0x263f('0x24')]];}}return _0x18b972[_0x263f('0x26')](',');}function _0x2e2b1a(_0x60eaac,_0x442de2,_0x135550){return new Promise(function(_0x51f09c,_0x30997d){var _0x4eef5f=[];if(_[_0x263f('0x29')](_0x442de2))return _0x51f09c(_0x4eef5f);_0x158423['Interval']['findAll']({'attributes':['id',_0x263f('0x2a'),_0x263f('0x2b')],'raw':!![]})['then'](function(_0x530a4b){for(var _0x589105=0x0,_0x40c8c9=0x0;_0x589105<_0x442de2['length'];_0x589105++,_0x40c8c9=0x0){var _0x523033=_0x442de2[_0x589105];var _0x3b45a4=[];var _0x12caef=[];delete _0x523033['id'];if(_0x523033['interval']!==_0x263f('0x2c')){_0x523033['intervals']=[_0x523033[_0x263f('0x2a')]];}else{_0x523033[_0x263f('0x2d')]=_0x523033[_0x263f('0x2b')]?_[_0x263f('0x2e')](_[_0x263f('0x2f')](_0x530a4b,{'IntervalId':_0x523033[_0x263f('0x2b')]}),_0x263f('0x2a')):[];}_0x523033[_0x263f('0x6')]=_0x60eaac[_0x263f('0x6')];_0x523033[_0x263f('0x7')]=_0x60eaac[_0x263f('0x7')];if(_0x523033[_0x263f('0x4')])_0x523033[_0x263f('0x4')]=_0x523033['type'][_0x263f('0x30')]();if(_0x60eaac[_0x263f('0x4')]===_0x263f('0x10')){if(_0x523033[_0x263f('0x1b')]('tag')&&_0x523033[_0x263f('0x31')]&&_0x523033[_0x263f('0x31')]!=='--'){_0x3b45a4[_0x263f('0xc')]({'type':_0x523033[_0x263f('0x4')][_0x263f('0x30')](),'app':_0x263f('0x5'),'appdata':'CDR(tag)='+_0x523033['tag'],'context':_0x60eaac[_0x263f('0x6')],'exten':_0x60eaac[_0x263f('0x7')],'priority':_0x523033[_0x263f('0x2d')]['length']+_0x135550+_0x40c8c9++,'VoiceExtensionId':_0x60eaac['id']});}_0x3b45a4[_0x263f('0xc')]({'type':_0x523033['type'][_0x263f('0x30')](),'app':_0x263f('0x32'),'appdata':_0x263f('0x33')+(_0x523033[_0x263f('0x34')]?'Set(CALLERID(all)='+_0x523033[_0x263f('0x34')]+')':_0x263f('0x35')),'context':_0x60eaac[_0x263f('0x6')],'exten':_0x60eaac[_0x263f('0x7')],'priority':_0x523033[_0x263f('0x2d')][_0x263f('0x36')]+_0x135550+_0x40c8c9++,'VoiceExtensionId':_0x60eaac['id']});}else{if(_0x523033['hasOwnProperty']('answer')){if([_0x263f('0x37'),_0x263f('0x38')][_0x263f('0x39')](_0x523033[_0x263f('0x3a')][_0x263f('0x30')]())&&_0x523033[_0x263f('0x3b')]!==_0x263f('0x3c')){if(_0x523033[_0x263f('0x3d')]){_0x3b45a4[_0x263f('0xc')]({'type':_0x523033[_0x263f('0x4')][_0x263f('0x30')](),'app':_0x263f('0x32'),'appdata':_0x263f('0x3e'),'context':_0x60eaac[_0x263f('0x6')],'exten':_0x60eaac[_0x263f('0x7')],'priority':_0x523033[_0x263f('0x2d')][_0x263f('0x36')]+_0x135550+_0x40c8c9++,'VoiceExtensionId':_0x60eaac['id']});_0x3b45a4['push']({'type':_0x523033[_0x263f('0x4')][_0x263f('0x30')](),'app':_0x263f('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x60eaac['context'],'exten':_0x60eaac[_0x263f('0x7')],'priority':_0x523033[_0x263f('0x2d')]['length']+_0x135550+_0x40c8c9++,'VoiceExtensionId':_0x60eaac['id']});}else{_0x3b45a4[_0x263f('0xc')]({'type':_0x523033[_0x263f('0x4')]['toLowerCase'](),'app':_0x263f('0x32'),'appdata':_0x263f('0x3f'),'context':_0x60eaac['context'],'exten':_0x60eaac[_0x263f('0x7')],'priority':_0x523033['intervals'][_0x263f('0x36')]+_0x135550+_0x40c8c9++,'VoiceExtensionId':_0x60eaac['id']});_0x3b45a4['push']({'type':_0x523033[_0x263f('0x4')]['toLowerCase'](),'app':_0x263f('0x5'),'appdata':_0x263f('0x40'),'context':_0x60eaac[_0x263f('0x6')],'exten':_0x60eaac[_0x263f('0x7')],'priority':_0x523033[_0x263f('0x2d')]['length']+_0x135550+_0x40c8c9++,'VoiceExtensionId':_0x60eaac['id']});}}}}for(var _0x47e2fa=0x0;_0x47e2fa<_0x523033[_0x263f('0x2d')][_0x263f('0x36')];_0x47e2fa++){var _0x236124=_0x135550+_0x523033[_0x263f('0x2d')]['length'];var _0x47bbce=_0x47e2fa===_0x523033[_0x263f('0x2d')][_0x263f('0x36')]-0x1?_0x135550+_0x3b45a4[_0x263f('0x36')]+_0x12caef[_0x263f('0x36')]+0x2:_0x135550+_0x47e2fa+0x1;_0x3b45a4[_0x263f('0x41')](_0x47e2fa,0x0,{'type':_0x60eaac[_0x263f('0x4')],'app':_0x263f('0x42'),'appdata':_0x523033[_0x263f('0x2d')][_0x47e2fa]+'?'+_0x60eaac[_0x263f('0x6')]+',${EXTEN},'+_0x236124+':'+_0x60eaac[_0x263f('0x6')]+_0x263f('0x43')+_0x47bbce,'exten':_0x60eaac[_0x263f('0x7')],'context':_0x60eaac[_0x263f('0x6')],'priority':_0x135550+_0x47e2fa,'VoiceExtensionId':_0x60eaac['id']});}if(_0x523033[_0x263f('0x3b')]===_0x263f('0x44'))_0x523033[_0x263f('0x45')]=_0x2aac31(_0x60eaac,_0x523033['appdata']);_0x523033[_0x263f('0x46')]=_0x3b45a4[_0x263f('0x36')]?_[_0x263f('0x47')](_0x3b45a4)[_0x263f('0x46')]+0x1:_0x135550;_0x4eef5f=_['concat'](_0x4eef5f,_0x3b45a4,[_0x523033],_0x12caef);_0x135550=_[_0x263f('0x47')](_0x4eef5f)[_0x263f('0x46')]+0x1;}return _0x51f09c(_0x4eef5f);})[_0x263f('0x48')](function(_0x57fecc){_0x30997d(_0x57fecc);});});}return _0x316e2d[_0x263f('0x49')](_0x263f('0x4a'),attributes,{'tableName':_0x263f('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2f5af6){var _0x72da0c=this[_0x263f('0x4c')]({'plain':!![]});var _0x17bc03=_0x72da0c['type']===_0x263f('0x10')?_0x2a0ff1(_0x72da0c):_0x15660c(_0x72da0c);return _0x2e2b1a(_0x72da0c,_0x2f5af6,_[_0x263f('0x47')](_0x17bc03)[_0x263f('0x46')]+0x1)[_0x263f('0x4d')](function(_0x15ebbd){var _0x52c4e0=_['concat'](_0x17bc03,_0x15ebbd);_0x52c4e0[_0x263f('0xc')]({'type':_0x72da0c[_0x263f('0x4')],'app':_0x263f('0x4e'),'exten':_0x72da0c['exten'],'context':_0x72da0c[_0x263f('0x6')],'priority':_[_0x263f('0x47')](_0x52c4e0)[_0x263f('0x46')]+0x1,'VoiceExtensionId':_0x72da0c['id']});return _0x52c4e0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index e589515..b0c38c1 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 _0xbe3b=['request\x20sent','debug','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s'];(function(_0x58b14b,_0x5ab912){var _0x5aec73=function(_0x43cdc1){while(--_0x43cdc1){_0x58b14b['push'](_0x58b14b['shift']());}};_0x5aec73(++_0x5ab912);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x1e8982,_0x37bfc7){_0x1e8982=_0x1e8982-0x0;var _0x115066=_0xbe3b[_0x1e8982];return _0x115066;};'use strict';var _=require('lodash');var util=require(_0xbbe3('0x0'));var moment=require(_0xbbe3('0x1'));var BPromise=require('bluebird');var rs=require(_0xbbe3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbe3('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xbbe3('0x4'));var jayson=require(_0xbbe3('0x5'));var client=jayson[_0xbbe3('0x6')][_0xbbe3('0x7')]({'port':0x232a});config['redis']=_[_0xbbe3('0x8')](config[_0xbbe3('0x9')],{'host':_0xbbe3('0xa'),'port':0x18eb});var socket=require(_0xbbe3('0xb'))(new Redis(config[_0xbbe3('0x9')]));require('./voiceExtension.socket')[_0xbbe3('0xc')](socket);function respondWithRpcPromise(_0x300552,_0x2be6e4,_0x2cb1f1){return new BPromise(function(_0x18f827,_0x400949){return client[_0xbbe3('0xd')](_0x300552,_0x2cb1f1)[_0xbbe3('0xe')](function(_0x4ff398){logger[_0xbbe3('0xf')](_0xbbe3('0x10'),_0x2be6e4,_0xbbe3('0x11'));logger[_0xbbe3('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2be6e4,'request\x20sent',JSON[_0xbbe3('0x13')](_0x4ff398));if(_0x4ff398[_0xbbe3('0x14')]){if(_0x4ff398[_0xbbe3('0x14')][_0xbbe3('0x15')]===0x1f4){logger[_0xbbe3('0x14')](_0xbbe3('0x10'),_0x2be6e4,_0x4ff398['error'][_0xbbe3('0x16')]);return _0x400949(_0x4ff398['error'][_0xbbe3('0x16')]);}logger[_0xbbe3('0x14')](_0xbbe3('0x10'),_0x2be6e4,_0x4ff398[_0xbbe3('0x14')][_0xbbe3('0x16')]);return _0x18f827(_0x4ff398[_0xbbe3('0x14')][_0xbbe3('0x16')]);}else{logger[_0xbbe3('0xf')](_0xbbe3('0x10'),_0x2be6e4,_0xbbe3('0x11'));_0x18f827(_0x4ff398[_0xbbe3('0x17')][_0xbbe3('0x16')]);}})['catch'](function(_0x546d6b){logger['error'](_0xbbe3('0x10'),_0x2be6e4,_0x546d6b);_0x400949(_0x546d6b);});});}exports[_0xbbe3('0x18')]=function(_0x1d6d62){var _0x3201e8=this;return new Promise(function(_0x42c84f,_0x4d13da){return db[_0xbbe3('0x19')][_0xbbe3('0x1a')]({'raw':_0x1d6d62[_0xbbe3('0x1b')]?_0x1d6d62[_0xbbe3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1d6d62['options']?_0x1d6d62['options']['where']||null:null,'attributes':_0x1d6d62[_0xbbe3('0x1b')]?_0x1d6d62[_0xbbe3('0x1b')][_0xbbe3('0x1c')]||null:null,'limit':_0x1d6d62['options']?_0x1d6d62[_0xbbe3('0x1b')][_0xbbe3('0x1d')]||null:null,'include':_0x1d6d62['options']?_0x1d6d62['options'][_0xbbe3('0x1e')]?_[_0xbbe3('0x1f')](_0x1d6d62[_0xbbe3('0x1b')][_0xbbe3('0x1e')],function(_0xa09178){return{'model':db[_0xa09178[_0xbbe3('0x20')]],'as':_0xa09178['as'],'attributes':_0xa09178[_0xbbe3('0x1c')],'include':_0xa09178['include']?_[_0xbbe3('0x1f')](_0xa09178[_0xbbe3('0x1e')],function(_0x392f9d){return{'model':db[_0x392f9d['model']],'as':_0x392f9d['as'],'attributes':_0x392f9d[_0xbbe3('0x1c')],'include':_0x392f9d['include']?_[_0xbbe3('0x1f')](_0x392f9d[_0xbbe3('0x1e')],function(_0x3e9cf9){return{'model':db[_0x3e9cf9[_0xbbe3('0x20')]],'as':_0x3e9cf9['as'],'attributes':_0x3e9cf9[_0xbbe3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57d480){logger[_0xbbe3('0xf')]('GetVoiceExtension',_0x1d6d62);logger['debug']('GetVoiceExtension',_0x1d6d62,JSON[_0xbbe3('0x13')](_0x57d480));_0x42c84f(_0x57d480);})['catch'](function(_0x30023d){logger[_0xbbe3('0x14')]('GetVoiceExtension',_0x30023d[_0xbbe3('0x16')],_0x1d6d62);_0x4d13da(_0x3201e8[_0xbbe3('0x14')](0x1f4,_0x30023d['message']));});});}; \ No newline at end of file +var _0x0e17=['message','info','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x15b501,_0x14f64b){var _0xd1727b=function(_0x439d8d){while(--_0x439d8d){_0x15b501['push'](_0x15b501['shift']());}};_0xd1727b(++_0x14f64b);}(_0x0e17,0xd6));var _0x70e1=function(_0x2e0a9e,_0x2da415){_0x2e0a9e=_0x2e0a9e-0x0;var _0x451359=_0x0e17[_0x2e0a9e];return _0x451359;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var moment=require(_0x70e1('0x2'));var BPromise=require(_0x70e1('0x3'));var rs=require(_0x70e1('0x4'));var fs=require('fs');var Redis=require(_0x70e1('0x5'));var db=require(_0x70e1('0x6'))['db'];var utils=require(_0x70e1('0x7'));var logger=require(_0x70e1('0x8'))(_0x70e1('0x9'));var config=require(_0x70e1('0xa'));var jayson=require(_0x70e1('0xb'));var client=jayson['client'][_0x70e1('0xc')]({'port':0x232a});config[_0x70e1('0xd')]=_[_0x70e1('0xe')](config[_0x70e1('0xd')],{'host':_0x70e1('0xf'),'port':0x18eb});var socket=require(_0x70e1('0x10'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x70e1('0x11')](socket);function respondWithRpcPromise(_0x4fc01f,_0x17f39c,_0x3ef3e1){return new BPromise(function(_0x556483,_0x7b2de4){return client[_0x70e1('0x12')](_0x4fc01f,_0x3ef3e1)['then'](function(_0x2f99a1){logger['info'](_0x70e1('0x13'),_0x17f39c,'request\x20sent');logger[_0x70e1('0x14')](_0x70e1('0x15'),_0x17f39c,_0x70e1('0x16'),JSON[_0x70e1('0x17')](_0x2f99a1));if(_0x2f99a1[_0x70e1('0x18')]){if(_0x2f99a1[_0x70e1('0x18')][_0x70e1('0x19')]===0x1f4){logger[_0x70e1('0x18')](_0x70e1('0x13'),_0x17f39c,_0x2f99a1[_0x70e1('0x18')][_0x70e1('0x1a')]);return _0x7b2de4(_0x2f99a1['error'][_0x70e1('0x1a')]);}logger[_0x70e1('0x18')](_0x70e1('0x13'),_0x17f39c,_0x2f99a1[_0x70e1('0x18')][_0x70e1('0x1a')]);return _0x556483(_0x2f99a1[_0x70e1('0x18')][_0x70e1('0x1a')]);}else{logger[_0x70e1('0x1b')](_0x70e1('0x13'),_0x17f39c,_0x70e1('0x16'));_0x556483(_0x2f99a1[_0x70e1('0x1c')]['message']);}})['catch'](function(_0x1002b6){logger[_0x70e1('0x18')](_0x70e1('0x13'),_0x17f39c,_0x1002b6);_0x7b2de4(_0x1002b6);});});}exports[_0x70e1('0x1d')]=function(_0xe86bd1){var _0x2d9130=this;return new Promise(function(_0x1cce5f,_0x17442e){return db[_0x70e1('0x1e')][_0x70e1('0x1f')]({'raw':_0xe86bd1[_0x70e1('0x20')]?_0xe86bd1[_0x70e1('0x20')][_0x70e1('0x21')]===undefined?!![]:![]:!![],'where':_0xe86bd1[_0x70e1('0x20')]?_0xe86bd1[_0x70e1('0x20')][_0x70e1('0x22')]||null:null,'attributes':_0xe86bd1['options']?_0xe86bd1[_0x70e1('0x20')]['attributes']||null:null,'limit':_0xe86bd1['options']?_0xe86bd1[_0x70e1('0x20')][_0x70e1('0x23')]||null:null,'include':_0xe86bd1[_0x70e1('0x20')]?_0xe86bd1[_0x70e1('0x20')][_0x70e1('0x24')]?_[_0x70e1('0x25')](_0xe86bd1['options'][_0x70e1('0x24')],function(_0x2f418b){return{'model':db[_0x2f418b[_0x70e1('0x26')]],'as':_0x2f418b['as'],'attributes':_0x2f418b[_0x70e1('0x27')],'include':_0x2f418b['include']?_[_0x70e1('0x25')](_0x2f418b[_0x70e1('0x24')],function(_0x15ded4){return{'model':db[_0x15ded4['model']],'as':_0x15ded4['as'],'attributes':_0x15ded4[_0x70e1('0x27')],'include':_0x15ded4[_0x70e1('0x24')]?_[_0x70e1('0x25')](_0x15ded4[_0x70e1('0x24')],function(_0x40c316){return{'model':db[_0x40c316[_0x70e1('0x26')]],'as':_0x40c316['as'],'attributes':_0x40c316['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x266fb0){logger['info']('GetVoiceExtension',_0xe86bd1);logger[_0x70e1('0x14')](_0x70e1('0x1d'),_0xe86bd1,JSON[_0x70e1('0x17')](_0x266fb0));_0x1cce5f(_0x266fb0);})['catch'](function(_0x54d187){logger['error'](_0x70e1('0x1d'),_0x54d187[_0x70e1('0x1a')],_0xe86bd1);_0x17442e(_0x2d9130[_0x70e1('0x18')](0x1f4,_0x54d187[_0x70e1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 522e22e..e8d5667 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x2b8c4f,_0x460079){var _0x45a8c7=function(_0x1f7ff8){while(--_0x1f7ff8){_0x2b8c4f['push'](_0x2b8c4f['shift']());}};_0x45a8c7(++_0x460079);}(_0x7a54,0x106));var _0x47a5=function(_0x511651,_0x424873){_0x511651=_0x511651-0x0;var _0x569ee3=_0x7a54[_0x511651];return _0x569ee3;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x5dd0b5,_0x5a7477){var _0x3dea30=function(_0x302061){while(--_0x302061){_0x5dd0b5['push'](_0x5dd0b5['shift']());}};_0x3dea30(++_0x5a7477);}(_0x1261,0x144));var _0x1126=function(_0x1c1577,_0x1d4d6d){_0x1c1577=_0x1c1577-0x0;var _0x566d1f=_0x1261[_0x1c1577];return _0x566d1f;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 207f4e2..5edb59a 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 _0x7278=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4b753a,_0x36beb1){var _0x224bee=function(_0x2ffb2d){while(--_0x2ffb2d){_0x4b753a['push'](_0x4b753a['shift']());}};_0x224bee(++_0x36beb1);}(_0x7278,0x161));var _0x8727=function(_0x49e6e0,_0x21e483){_0x49e6e0=_0x49e6e0-0x0;var _0x398571=_0x7278[_0x49e6e0];return _0x398571;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x8727('0xe')]('/',auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0x10')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router[_0x8727('0x12')]('/:id',auth[_0x8727('0xb')](),controller[_0x8727('0x13')]);module[_0x8727('0x14')]=router; \ No newline at end of file +var _0x01d9=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x54e55e,_0x3ad3de){var _0x4f0e1e=function(_0xc0c299){while(--_0xc0c299){_0x54e55e['push'](_0x54e55e['shift']());}};_0x4f0e1e(++_0x3ad3de);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router[_0x901d('0x13')]('/:id',auth[_0x901d('0xd')](),controller['update']);router[_0x901d('0x14')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0x15')]);module[_0x901d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 9d9b682..d682a6a 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 _0x9d42=['TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central','ENUM','yes'];(function(_0x592c0c,_0x4dfa48){var _0x3d8ab6=function(_0x4e5705){while(--_0x4e5705){_0x592c0c['push'](_0x592c0c['shift']());}};_0x3d8ab6(++_0x4dfa48);}(_0x9d42,0xe3));var _0x29d4=function(_0x6e7f6b,_0x488bb3){_0x6e7f6b=_0x6e7f6b-0x0;var _0x346190=_0x9d42[_0x6e7f6b];return _0x346190;};'use strict';var Sequelize=require(_0x29d4('0x0'));module[_0x29d4('0x1')]={'customer_id':{'type':Sequelize[_0x29d4('0x2')]},'context':{'type':Sequelize[_0x29d4('0x2')],'defaultValue':_0x29d4('0x3'),'unique':_0x29d4('0x4')},'mailbox':{'type':Sequelize[_0x29d4('0x2')],'defaultValue':'','allowNull':![],'unique':_0x29d4('0x4')},'password':{'type':Sequelize[_0x29d4('0x2')]},'fullname':{'type':Sequelize[_0x29d4('0x2')]},'email':{'type':Sequelize[_0x29d4('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1d9fa9){this[_0x29d4('0x5')](_0x29d4('0x6'),typeof _0x1d9fa9==='string'&&_0x1d9fa9[_0x29d4('0x7')]()?_0x1d9fa9['trim']():null);}},'pager':{'type':Sequelize[_0x29d4('0x2')]},'tz':{'type':Sequelize[_0x29d4('0x2')],'defaultValue':_0x29d4('0x8')},'attach':{'type':Sequelize[_0x29d4('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x29d4('0x2')]},'callback':{'type':Sequelize[_0x29d4('0x2')]},'review':{'type':Sequelize['ENUM'](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x29d4('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x29d4('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x29d4('0x9')]('yes','no'),'defaultValue':_0x29d4('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x29d4('0x9')](_0x29d4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x29d4('0x9')]('yes','no'),'defaultValue':_0x29d4('0xa'),'allowNull':![]},'stamp':{'type':_0x29d4('0xc')},'emailsubject':{'type':Sequelize[_0x29d4('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x29d4('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x29d4('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x29d4('0xe')](_0x29d4('0xf'))+'\x20-\x20'+this[_0x29d4('0xe')](_0x29d4('0x10'));}}}; \ No newline at end of file +var _0xc060=['contest_mailbox','email','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','STRING','from-voicemail'];(function(_0x1831d4,_0x44d811){var _0x188f10=function(_0x2f73cd){while(--_0x2f73cd){_0x1831d4['push'](_0x1831d4['shift']());}};_0x188f10(++_0x44d811);}(_0xc060,0x1d2));var _0x0c06=function(_0x1ec2b1,_0x55d177){_0x1ec2b1=_0x1ec2b1-0x0;var _0xe9439d=_0xc060[_0x1ec2b1];return _0xe9439d;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x0c06('0x0')]},'context':{'type':Sequelize[_0x0c06('0x0')],'defaultValue':_0x0c06('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x0c06('0x0')],'defaultValue':'','allowNull':![],'unique':_0x0c06('0x2')},'password':{'type':Sequelize[_0x0c06('0x0')]},'fullname':{'type':Sequelize[_0x0c06('0x0')]},'email':{'type':Sequelize[_0x0c06('0x0')],'validate':{'isEmail':!![]},'set':function(_0x3d8220){this['setDataValue'](_0x0c06('0x3'),typeof _0x3d8220==='string'&&_0x3d8220['trim']()?_0x3d8220[_0x0c06('0x4')]():null);}},'pager':{'type':Sequelize[_0x0c06('0x0')]},'tz':{'type':Sequelize[_0x0c06('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x0c06('0x5')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x0c06('0x5')](_0x0c06('0x6'),'no'),'defaultValue':_0x0c06('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0c06('0x0')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0c06('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0c06('0x5')](_0x0c06('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0c06('0x5')](_0x0c06('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0c06('0x5')](_0x0c06('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0c06('0x5')](_0x0c06('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x0c06('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x0c06('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0c06('0x5')](_0x0c06('0x6'),'no'),'defaultValue':_0x0c06('0x6'),'allowNull':![]},'stamp':{'type':_0x0c06('0x7')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0c06('0x0')]},'maxsecs':{'type':Sequelize[_0x0c06('0x8')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0c06('0x9')],'get':function(){return this[_0x0c06('0xa')](_0x0c06('0xb'))+'\x20-\x20'+this['getDataValue'](_0x0c06('0xc'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 88f06e4..36f892e 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 _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x548503,_0x1aa00c){var _0xf8f05f=function(_0x2014c2){while(--_0x2014c2){_0x548503['push'](_0x548503['shift']());}};_0xf8f05f(++_0x1aa00c);}(_0xcf66,0x71));var _0x6cf6=function(_0x4f00d7,_0x1f945f){_0x4f00d7=_0x4f00d7-0x0;var _0x2d5ad8=_0xcf66[_0x4f00d7];return _0x2d5ad8;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file +var _0x1be1=['set','Content-Range','apply','reject','save','update','then','get','Voicemails','destroy','sendStatus','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','include','findAll','rows','show','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','length','mailbox','findAndCountAll','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count'];(function(_0x3e01b8,_0x1d2fdf){var _0x163298=function(_0x1f99ed){while(--_0x1f99ed){_0x3e01b8['push'](_0x3e01b8['shift']());}};_0x163298(++_0x1d2fdf);}(_0x1be1,0x192));var _0x11be=function(_0x51d058,_0x430649){_0x51d058=_0x51d058-0x0;var _0x5b4c4e=_0x1be1[_0x51d058];return _0x5b4c4e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){var _0x10ce04=_0x5d1690[_0x11be('0x23')]({'plain':!![]});var _0x4cb27f=_0x11be('0x24');return db['UserProfileResource'][_0x11be('0x25')]({'where':{'type':_0x4cb27f,'resourceId':_0x10ce04['id']}})['then'](function(){return _0x5d1690;});})[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48029b,_0x28b3a0){return function(_0x1d3b5c){if(!_0x1d3b5c){_0x48029b[_0x11be('0x26')](0x194);}return _0x1d3b5c;};}function handleError(_0x30427b,_0x17c67f){_0x17c67f=_0x17c67f||0x1f4;return function(_0xf5a6ac){logger[_0x11be('0x27')](_0xf5a6ac[_0x11be('0x28')]);if(_0xf5a6ac['name']){delete _0xf5a6ac[_0x11be('0x29')];}_0x30427b['status'](_0x17c67f)[_0x11be('0x2a')](_0xf5a6ac);};}exports[_0x11be('0x2b')]=function(_0x510476,_0x584d4c){var _0x49fd5c={},_0x265fc9={},_0x5e8f9a={'count':0x0,'rows':[]};var _0x66316d=_[_0x11be('0x2c')](db[_0x11be('0x2d')][_0x11be('0x2e')],function(_0x25e214){return{'name':_0x25e214[_0x11be('0x2f')],'type':_0x25e214['type'][_0x11be('0x30')]};});_0x265fc9[_0x11be('0x31')]=_[_0x11be('0x2c')](_0x66316d,_0x11be('0x29'));_0x265fc9[_0x11be('0x32')]=_[_0x11be('0x33')](_0x510476['query']);_0x265fc9[_0x11be('0x34')]=_[_0x11be('0x35')](_0x265fc9[_0x11be('0x31')],_0x265fc9[_0x11be('0x32')]);_0x49fd5c[_0x11be('0x36')]=_['intersection'](_0x265fc9[_0x11be('0x31')],qs[_0x11be('0x37')](_0x510476[_0x11be('0x32')]['fields']));_0x49fd5c[_0x11be('0x36')]=_0x49fd5c['attributes']['length']?_0x49fd5c['attributes']:_0x265fc9['model'];if(!_0x510476[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x49fd5c['limit']=qs[_0x11be('0x1a')](_0x510476[_0x11be('0x32')]['limit']);_0x49fd5c[_0x11be('0x18')]=qs['offset'](_0x510476[_0x11be('0x32')]['offset']);}_0x49fd5c[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x510476[_0x11be('0x32')][_0x11be('0x3b')]);_0x49fd5c['where']=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x510476[_0x11be('0x32')],_0x265fc9[_0x11be('0x34')]),_0x66316d);if(_0x510476['query'][_0x11be('0x3d')]){_0x49fd5c[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x49fd5c[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x66316d,function(_0x1b1aac){if(_0x1b1aac[_0x11be('0x40')]!=='VIRTUAL'){var _0x2618f5={};_0x2618f5[_0x1b1aac[_0x11be('0x29')]]={'$like':'%'+_0x510476['query'][_0x11be('0x3d')]+'%'};return _0x2618f5;}})});}_0x49fd5c=_[_0x11be('0x3f')]({},_0x49fd5c,_0x510476['options']);var _0x30b67a={'where':_0x49fd5c['where']};return db[_0x11be('0x2d')]['count'](_0x30b67a)[_0x11be('0x22')](function(_0x30be21){_0x5e8f9a['count']=_0x30be21;if(_0x510476[_0x11be('0x32')]['includeAll']){_0x49fd5c[_0x11be('0x41')]=[{'all':!![]}];}return db[_0x11be('0x2d')][_0x11be('0x42')](_0x49fd5c);})[_0x11be('0x22')](function(_0x2b847a){_0x5e8f9a[_0x11be('0x43')]=_0x2b847a;return _0x5e8f9a;})[_0x11be('0x22')](respondWithFilteredResult(_0x584d4c,_0x49fd5c))['catch'](handleError(_0x584d4c,null));};exports[_0x11be('0x44')]=function(_0x18cddf,_0x9610a1){var _0x317e2d={'raw':!![],'where':{'id':_0x18cddf['params']['id']}},_0x589ac4={};_0x589ac4['model']=_[_0x11be('0x33')](db['VoiceMail'][_0x11be('0x2e')]);_0x589ac4['query']=_[_0x11be('0x33')](_0x18cddf[_0x11be('0x32')]);_0x589ac4[_0x11be('0x34')]=_[_0x11be('0x35')](_0x589ac4[_0x11be('0x31')],_0x589ac4[_0x11be('0x32')]);_0x317e2d[_0x11be('0x36')]=_['intersection'](_0x589ac4[_0x11be('0x31')],qs['fields'](_0x18cddf[_0x11be('0x32')][_0x11be('0x37')]));_0x317e2d[_0x11be('0x36')]=_0x317e2d['attributes']['length']?_0x317e2d['attributes']:_0x589ac4[_0x11be('0x31')];if(_0x18cddf[_0x11be('0x32')]['includeAll']){_0x317e2d['include']=[{'all':!![]}];}_0x317e2d=_['merge']({},_0x317e2d,_0x18cddf[_0x11be('0x45')]);return db[_0x11be('0x2d')][_0x11be('0x46')](_0x317e2d)[_0x11be('0x22')](handleEntityNotFound(_0x9610a1,null))[_0x11be('0x22')](respondWithResult(_0x9610a1,null))[_0x11be('0x47')](handleError(_0x9610a1,null));};exports[_0x11be('0x48')]=function(_0x3f2070,_0x2ce110){return db[_0x11be('0x2d')][_0x11be('0x48')](_0x3f2070['body'],{})[_0x11be('0x22')](function(_0x29f82f){var _0x534ee7=_0x3f2070['user']['get']({'plain':!![]});if(!_0x534ee7)throw new Error(_0x11be('0x49'));if(_0x534ee7['role']===_0x11be('0x4a')){var _0x1c1626=_0x29f82f[_0x11be('0x23')]({'plain':!![]});var _0x1fb48d=_0x11be('0x24');return db[_0x11be('0x4b')][_0x11be('0x46')]({'where':{'name':_0x1fb48d,'userProfileId':_0x534ee7[_0x11be('0x4c')]},'raw':!![]})[_0x11be('0x22')](function(_0x4c873a){if(_0x4c873a&&_0x4c873a[_0x11be('0x4d')]===0x0){return db['UserProfileResource'][_0x11be('0x48')]({'name':_0x1c1626[_0x11be('0x29')],'resourceId':_0x1c1626['id'],'type':_0x4c873a['name'],'sectionId':_0x4c873a['id']},{})[_0x11be('0x22')](function(){return _0x29f82f;});}else{return _0x29f82f;}})[_0x11be('0x47')](function(_0x4c0e37){logger[_0x11be('0x27')](_0x11be('0x4e'),_0x4c0e37);throw _0x4c0e37;});}return _0x29f82f;})['then'](respondWithResult(_0x2ce110,0xc9))['catch'](handleError(_0x2ce110,null));};exports[_0x11be('0x21')]=function(_0x2886ac,_0x50eeab){if(_0x2886ac['body']['id']){delete _0x2886ac[_0x11be('0x4f')]['id'];}return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x2886ac['params']['id']}})['then'](handleEntityNotFound(_0x50eeab,null))['then'](saveUpdates(_0x2886ac[_0x11be('0x4f')],null))[_0x11be('0x22')](respondWithResult(_0x50eeab,null))[_0x11be('0x47')](handleError(_0x50eeab,null));};exports['destroy']=function(_0x4db963,_0x33409c){return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x4db963[_0x11be('0x50')]['id']}})['then'](handleEntityNotFound(_0x33409c,null))[_0x11be('0x22')](removeEntity(_0x33409c,null))['catch'](handleError(_0x33409c,null));};exports['getMessages']=function(_0x568f20,_0x5aa6bf,_0x1a43df){return db[_0x11be('0x2d')][_0x11be('0x51')]({'where':{'id':_0x568f20[_0x11be('0x50')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x5aa6bf,null))[_0x11be('0x22')](function(_0xb97604){var _0x55e79d;var _0x54e52a={},_0x7c1ee5={};_0x7c1ee5[_0x11be('0x31')]=_[_0x11be('0x33')](db[_0x11be('0x52')][_0x11be('0x2e')]);_0x7c1ee5[_0x11be('0x32')]=_[_0x11be('0x33')](_0x568f20[_0x11be('0x32')]);_0x7c1ee5[_0x11be('0x34')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],_0x7c1ee5[_0x11be('0x32')]);_0x54e52a[_0x11be('0x36')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],qs[_0x11be('0x37')](_0x568f20['query']['fields']));_0x54e52a[_0x11be('0x36')]=_0x54e52a[_0x11be('0x36')][_0x11be('0x53')]?_0x54e52a[_0x11be('0x36')]:_0x7c1ee5['model'];if(!_0x568f20[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x54e52a[_0x11be('0x1a')]=qs[_0x11be('0x1a')](_0x568f20[_0x11be('0x32')][_0x11be('0x1a')]);_0x54e52a[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x568f20['query']['offset']);}_0x54e52a[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x568f20['query'][_0x11be('0x3b')]);_0x54e52a[_0x11be('0x3e')]=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x568f20[_0x11be('0x32')],_0x7c1ee5[_0x11be('0x34')]));if(_0x568f20[_0x11be('0x32')]['filter']){_0x54e52a['where']=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x54e52a['attributes'],function(_0x82c02c){var _0x422696={};_0x422696[_0x82c02c]={'$like':'%'+_0x568f20[_0x11be('0x32')][_0x11be('0x3d')]+'%'};return _0x422696;})});}_0x54e52a[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'mailboxuser':_0xb97604[_0x11be('0x54')]});_0x54e52a=_[_0x11be('0x3f')]({},_0x54e52a,_0x568f20[_0x11be('0x45')]);return db[_0x11be('0x52')][_0x11be('0x55')](_0x54e52a)[_0x11be('0x22')](respondWithFilteredResult(_0x5aa6bf,_0x54e52a));})[_0x11be('0x47')](handleError(_0x5aa6bf,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4f49747..f2c20ce 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 _0x41e5=['request-promise','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment'];(function(_0x5f550f,_0x1eb69a){var _0x2fa8fa=function(_0x178914){while(--_0x178914){_0x5f550f['push'](_0x5f550f['shift']());}};_0x2fa8fa(++_0x1eb69a);}(_0x41e5,0x190));var _0x541e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41e5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x541e('0x0'));var util=require(_0x541e('0x1'));var logger=require(_0x541e('0x2'))(_0x541e('0x3'));var moment=require(_0x541e('0x4'));var BPromise=require('bluebird');var rp=require(_0x541e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x541e('0x6'));var config=require(_0x541e('0x7'));var attributes=require('./voiceMail.attributes');module[_0x541e('0x8')]=function(_0x4a87f3,_0x59b204){return _0x4a87f3[_0x541e('0x9')](_0x541e('0xa'),attributes,{'tableName':_0x541e('0xb'),'paranoid':![],'indexes':[{'name':_0x541e('0xc'),'fields':[_0x541e('0xd'),_0x541e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd917=['VoiceMail','voice_voicemail','mailbox_context','mailbox','context','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd917,0x75));var _0x7d91=function(_0x582977,_0x367aa0){_0x582977=_0x582977-0x0;var _0x30cbd0=_0xd917[_0x582977];return _0x30cbd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7d91('0x0'))(_0x7d91('0x1'));var moment=require(_0x7d91('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d91('0x3'));var rimraf=require(_0x7d91('0x4'));var config=require(_0x7d91('0x5'));var attributes=require(_0x7d91('0x6'));module[_0x7d91('0x7')]=function(_0x5736bb,_0x3e6b67){return _0x5736bb[_0x7d91('0x8')](_0x7d91('0x9'),attributes,{'tableName':_0x7d91('0xa'),'paranoid':![],'indexes':[{'name':_0x7d91('0xb'),'fields':[_0x7d91('0xc'),_0x7d91('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 a895f4f..f20cf6e 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 _0x31dc=['info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','request\x20sent','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2ad188,_0x3af051){var _0x5436fa=function(_0x1ef875){while(--_0x1ef875){_0x2ad188['push'](_0x2ad188['shift']());}};_0x5436fa(++_0x3af051);}(_0x31dc,0x130));var _0xc31d=function(_0x59eb59,_0x32860e){_0x59eb59=_0x59eb59-0x0;var _0x243b4e=_0x31dc[_0x59eb59];return _0x243b4e;};'use strict';var _=require('lodash');var util=require(_0xc31d('0x0'));var moment=require('moment');var BPromise=require(_0xc31d('0x1'));var rs=require(_0xc31d('0x2'));var fs=require('fs');var Redis=require(_0xc31d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc31d('0x4'));var logger=require('../../config/logger')(_0xc31d('0x5'));var config=require(_0xc31d('0x6'));var jayson=require(_0xc31d('0x7'));var client=jayson[_0xc31d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323bd6,_0x320f31,_0x37385f){return new BPromise(function(_0x3dc56a,_0x1fe82e){return client[_0xc31d('0x9')](_0x323bd6,_0x37385f)[_0xc31d('0xa')](function(_0x3e19a6){logger[_0xc31d('0xb')]('VoiceMail,\x20%s,\x20%s',_0x320f31,'request\x20sent');logger[_0xc31d('0xc')](_0xc31d('0xd'),_0x320f31,'request\x20sent',JSON[_0xc31d('0xe')](_0x3e19a6));if(_0x3e19a6[_0xc31d('0xf')]){if(_0x3e19a6[_0xc31d('0xf')][_0xc31d('0x10')]===0x1f4){logger[_0xc31d('0xf')](_0xc31d('0x11'),_0x320f31,_0x3e19a6[_0xc31d('0xf')][_0xc31d('0x12')]);return _0x1fe82e(_0x3e19a6[_0xc31d('0xf')][_0xc31d('0x12')]);}logger[_0xc31d('0xf')](_0xc31d('0x11'),_0x320f31,_0x3e19a6['error'][_0xc31d('0x12')]);return _0x3dc56a(_0x3e19a6['error'][_0xc31d('0x12')]);}else{logger[_0xc31d('0xb')](_0xc31d('0x11'),_0x320f31,_0xc31d('0x13'));_0x3dc56a(_0x3e19a6[_0xc31d('0x14')][_0xc31d('0x12')]);}})['catch'](function(_0x179411){logger[_0xc31d('0xf')](_0xc31d('0x11'),_0x320f31,_0x179411);_0x1fe82e(_0x179411);});});} \ No newline at end of file +var _0xacd7=['then','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x3ed155,_0x3e29b9){var _0x385c84=function(_0x28c2d5){while(--_0x28c2d5){_0x3ed155['push'](_0x3ed155['shift']());}};_0x385c84(++_0x3e29b9);}(_0xacd7,0x139));var _0x7acd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7acd('0x0'));var util=require(_0x7acd('0x1'));var moment=require(_0x7acd('0x2'));var BPromise=require(_0x7acd('0x3'));var rs=require(_0x7acd('0x4'));var fs=require('fs');var Redis=require(_0x7acd('0x5'));var db=require(_0x7acd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7acd('0x7'))('rpc');var config=require(_0x7acd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7acd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e844d,_0x10cdbf,_0x11dcc2){return new BPromise(function(_0x417ee1,_0x1a5389){return client['request'](_0x1e844d,_0x11dcc2)[_0x7acd('0xa')](function(_0x1676a5){logger['info'](_0x7acd('0xb'),_0x10cdbf,_0x7acd('0xc'));logger['debug'](_0x7acd('0xd'),_0x10cdbf,_0x7acd('0xc'),JSON[_0x7acd('0xe')](_0x1676a5));if(_0x1676a5[_0x7acd('0xf')]){if(_0x1676a5[_0x7acd('0xf')]['code']===0x1f4){logger[_0x7acd('0xf')](_0x7acd('0xb'),_0x10cdbf,_0x1676a5[_0x7acd('0xf')][_0x7acd('0x10')]);return _0x1a5389(_0x1676a5[_0x7acd('0xf')][_0x7acd('0x10')]);}logger[_0x7acd('0xf')](_0x7acd('0xb'),_0x10cdbf,_0x1676a5[_0x7acd('0xf')][_0x7acd('0x10')]);return _0x417ee1(_0x1676a5[_0x7acd('0xf')][_0x7acd('0x10')]);}else{logger[_0x7acd('0x11')]('VoiceMail,\x20%s,\x20%s',_0x10cdbf,_0x7acd('0xc'));_0x417ee1(_0x1676a5['result']['message']);}})[_0x7acd('0x12')](function(_0x44cbdb){logger[_0x7acd('0xf')](_0x7acd('0xb'),_0x10cdbf,_0x44cbdb);_0x1a5389(_0x44cbdb);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index a4492b7..3cf2df4 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 _0x7bf7=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','/:id/download','download','post','create','put'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x7bf7,0x1a6));var _0x77bf=function(_0x3833ef,_0x10c21d){_0x3833ef=_0x3833ef-0x0;var _0x2d67ec=_0x7bf7[_0x3833ef];return _0x2d67ec;};'use strict';var multer=require(_0x77bf('0x0'));var util=require(_0x77bf('0x1'));var path=require(_0x77bf('0x2'));var timeout=require(_0x77bf('0x3'));var express=require('express');var router=express[_0x77bf('0x4')]();var fs_extra=require(_0x77bf('0x5'));var auth=require(_0x77bf('0x6'));var interaction=require(_0x77bf('0x7'));var config=require(_0x77bf('0x8'));var controller=require(_0x77bf('0x9'));router[_0x77bf('0xa')]('/',auth[_0x77bf('0xb')](),controller['index']);router[_0x77bf('0xa')](_0x77bf('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x77bf('0xd'),auth[_0x77bf('0xb')](),controller[_0x77bf('0xe')]);router[_0x77bf('0xf')]('/',auth[_0x77bf('0xb')](),controller[_0x77bf('0x10')]);router[_0x77bf('0x11')]('/:id',auth[_0x77bf('0xb')](),controller[_0x77bf('0x12')]);router[_0x77bf('0x13')](_0x77bf('0xc'),auth[_0x77bf('0xb')](),controller[_0x77bf('0x14')]);module[_0x77bf('0x15')]=router; \ No newline at end of file +var _0xea93=['/:id','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','show','get','/:id/download','post','create','put'];(function(_0x11b5a4,_0x3c80e0){var _0x2f1ece=function(_0x5d3ce5){while(--_0x5d3ce5){_0x11b5a4['push'](_0x11b5a4['shift']());}};_0x2f1ece(++_0x3c80e0);}(_0xea93,0x1e4));var _0x3ea9=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xea93[_0x479509];return _0x382da8;};'use strict';var multer=require('multer');var util=require(_0x3ea9('0x0'));var path=require(_0x3ea9('0x1'));var timeout=require(_0x3ea9('0x2'));var express=require('express');var router=express[_0x3ea9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3ea9('0x4'));var interaction=require(_0x3ea9('0x5'));var config=require(_0x3ea9('0x6'));var controller=require(_0x3ea9('0x7'));router['get']('/',auth[_0x3ea9('0x8')](),controller[_0x3ea9('0x9')]);router['get']('/:id',auth[_0x3ea9('0x8')](),controller[_0x3ea9('0xa')]);router[_0x3ea9('0xb')](_0x3ea9('0xc'),auth[_0x3ea9('0x8')](),controller['download']);router[_0x3ea9('0xd')]('/',auth[_0x3ea9('0x8')](),controller[_0x3ea9('0xe')]);router[_0x3ea9('0xf')](_0x3ea9('0x10'),auth[_0x3ea9('0x8')](),controller['update']);router[_0x3ea9('0x11')]('/:id',auth[_0x3ea9('0x8')](),controller[_0x3ea9('0x12')]);module[_0x3ea9('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 025939b..0e4a617 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 _0x4422=['exports','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x4ea17a,_0x4b9c83){var _0x58e65f=function(_0x46ad6d){while(--_0x46ad6d){_0x4ea17a['push'](_0x4ea17a['shift']());}};_0x58e65f(++_0x4b9c83);}(_0x4422,0x148));var _0x2442=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4422[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x2442('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x585a2b){return this[_0x2442('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x2442('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x2442('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2442('0x3')],'defaultValue':''},'stamp':{'type':_0x2442('0x5'),'defaultValue':Sequelize[_0x2442('0x6')](_0x2442('0x7'))}}; \ No newline at end of file +var _0xcaee=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x1d549b,_0x614cd1){var _0x21883e=function(_0x3065fe){while(--_0x3065fe){_0x1d549b['push'](_0x1d549b['shift']());}};_0x21883e(++_0x614cd1);}(_0xcaee,0x1b7));var _0xecae=function(_0x1a506c,_0x258a25){_0x1a506c=_0x1a506c-0x0;var _0x3be26c=_0xcaee[_0x1a506c];return _0x3be26c;};'use strict';var Sequelize=require('sequelize');module[_0xecae('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5e24c5){return this[_0xecae('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xecae('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xecae('0x4')](_0xecae('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xecae('0x3')],'defaultValue':''},'stamp':{'type':_0xecae('0x6'),'defaultValue':Sequelize['literal'](_0xecae('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index f4fe711..7b894aa 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 _0x3926=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','error','send','index','map','VoiceMailMessage','rawAttributes','type','key','model','name','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','update','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','rimraf','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x4bf4b6,_0xea8f29){var _0x221a98=function(_0x3f7810){while(--_0x3f7810){_0x4bf4b6['push'](_0x4bf4b6['shift']());}};_0x221a98(++_0xea8f29);}(_0x3926,0x12f));var _0x6392=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x3926[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6392('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6392('0x1'));var moment=require(_0x6392('0x2'));var BPromise=require(_0x6392('0x3'));var Mustache=require('mustache');var util=require(_0x6392('0x4'));var path=require(_0x6392('0x5'));var sox=require(_0x6392('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6392('0x7'));var _=require('lodash');var squel=require(_0x6392('0x8'));var crypto=require(_0x6392('0x9'));var jsforce=require(_0x6392('0xa'));var deskjs=require(_0x6392('0xb'));var toCsv=require(_0x6392('0xc'));var querystring=require('querystring');var Papa=require(_0x6392('0xd'));var Redis=require(_0x6392('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6392('0xf'));var as=require(_0x6392('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6392('0x11'))(_0x6392('0x12'));var utils=require(_0x6392('0x13'));var config=require(_0x6392('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6392('0x15'))['db'];function respondWithStatusCode(_0x1167ae,_0x394a12){_0x394a12=_0x394a12||0xcc;return function(_0x2c969a){if(_0x2c969a){return _0x1167ae[_0x6392('0x16')](_0x394a12);}return _0x1167ae[_0x6392('0x17')](_0x394a12)['end']();};}function respondWithResult(_0x4e9d17,_0x334abe){_0x334abe=_0x334abe||0xc8;return function(_0x20138d){if(_0x20138d){return _0x4e9d17[_0x6392('0x17')](_0x334abe)[_0x6392('0x18')](_0x20138d);}};}function respondWithFilteredResult(_0x246729,_0x4280a6){return function(_0x4d735a){if(_0x4d735a){var _0x5df7b8=typeof _0x4280a6[_0x6392('0x19')]==='undefined'&&typeof _0x4280a6[_0x6392('0x1a')]===_0x6392('0x1b');var _0x4b635a=_0x4d735a['count'];var _0x43ea89=_0x5df7b8?0x0:_0x4280a6['offset'];var _0x1a15a3=_0x5df7b8?_0x4d735a[_0x6392('0x1c')]:_0x4280a6['offset']+_0x4280a6[_0x6392('0x1a')];var _0x23e2ed;if(_0x1a15a3>=_0x4b635a){_0x1a15a3=_0x4b635a;_0x23e2ed=0xc8;}else{_0x23e2ed=0xce;}_0x246729[_0x6392('0x17')](_0x23e2ed);return _0x246729[_0x6392('0x1d')](_0x6392('0x1e'),_0x43ea89+'-'+_0x1a15a3+'/'+_0x4b635a)[_0x6392('0x18')](_0x4d735a);}return null;};}function patchUpdates(_0x116547){return function(_0x2e132c){try{jsonpatch[_0x6392('0x1f')](_0x2e132c,_0x116547,!![]);}catch(_0x23407f){return BPromise[_0x6392('0x20')](_0x23407f);}return _0x2e132c[_0x6392('0x21')]();};}function saveUpdates(_0x540dba,_0x41bd34){return function(_0x4c5c39){if(_0x4c5c39){return _0x4c5c39['update'](_0x540dba)[_0x6392('0x22')](function(_0x4e4824){return _0x4e4824;});}return null;};}function removeEntity(_0x12b1a6,_0xa8aa6e){return function(_0x3440cd){if(_0x3440cd){return _0x3440cd['destroy']()[_0x6392('0x22')](function(){_0x12b1a6[_0x6392('0x17')](0xcc)[_0x6392('0x23')]();});}};}function handleEntityNotFound(_0x2544ba,_0x40146c){return function(_0x50b439){if(!_0x50b439){_0x2544ba[_0x6392('0x16')](0x194);}return _0x50b439;};}function handleError(_0x180a42,_0x36e4db){_0x36e4db=_0x36e4db||0x1f4;return function(_0xc8fcfd){logger[_0x6392('0x24')](_0xc8fcfd['stack']);if(_0xc8fcfd['name']){delete _0xc8fcfd['name'];}_0x180a42[_0x6392('0x17')](_0x36e4db)[_0x6392('0x25')](_0xc8fcfd);};}exports[_0x6392('0x26')]=function(_0x6de432,_0x2c3068){var _0x3fa78c={},_0x5186fe={},_0xb6d100={'count':0x0,'rows':[]};var _0x293063=_[_0x6392('0x27')](db[_0x6392('0x28')][_0x6392('0x29')],function(_0x461aca){return{'name':_0x461aca['fieldName'],'type':_0x461aca[_0x6392('0x2a')][_0x6392('0x2b')]};});_0x5186fe[_0x6392('0x2c')]=_['differenceBy'](_[_0x6392('0x27')](_0x293063,_0x6392('0x2d')),[_0x6392('0x2d')]);_0x5186fe['query']=_[_0x6392('0x2e')](_0x6de432[_0x6392('0x2f')]);_0x5186fe[_0x6392('0x30')]=_['intersection'](_0x5186fe['model'],_0x5186fe[_0x6392('0x2f')]);_0x3fa78c[_0x6392('0x31')]=_[_0x6392('0x32')](_0x5186fe['model'],qs['fields'](_0x6de432[_0x6392('0x2f')]['fields']));_0x3fa78c[_0x6392('0x31')]=_0x3fa78c[_0x6392('0x31')][_0x6392('0x33')]?_0x3fa78c[_0x6392('0x31')]:_0x5186fe['model'];if(!_0x6de432['query'][_0x6392('0x34')](_0x6392('0x35'))){_0x3fa78c[_0x6392('0x1a')]=qs[_0x6392('0x1a')](_0x6de432[_0x6392('0x2f')][_0x6392('0x1a')]);_0x3fa78c[_0x6392('0x19')]=qs[_0x6392('0x19')](_0x6de432[_0x6392('0x2f')][_0x6392('0x19')]);}_0x3fa78c[_0x6392('0x36')]=qs[_0x6392('0x37')](_0x6de432[_0x6392('0x2f')][_0x6392('0x37')]);_0x3fa78c[_0x6392('0x38')]=qs[_0x6392('0x30')](_[_0x6392('0x39')](_0x6de432[_0x6392('0x2f')],_0x5186fe[_0x6392('0x30')]),_0x293063);if(_0x6de432['query'][_0x6392('0x3a')]){_0x3fa78c[_0x6392('0x38')]=_['merge'](_0x3fa78c['where'],{'$or':_[_0x6392('0x27')](_0x293063,function(_0x55cb0e){if(_0x55cb0e[_0x6392('0x2a')]!==_0x6392('0x3b')){var _0x325df1={};_0x325df1[_0x55cb0e['name']]={'$like':'%'+_0x6de432['query'][_0x6392('0x3a')]+'%'};return _0x325df1;}})});}_0x3fa78c=_['merge']({},_0x3fa78c,_0x6de432[_0x6392('0x3c')]);var _0x385314={'where':_0x3fa78c[_0x6392('0x38')]};return db[_0x6392('0x28')][_0x6392('0x1c')](_0x385314)[_0x6392('0x22')](function(_0x1769a4){_0xb6d100[_0x6392('0x1c')]=_0x1769a4;if(_0x6de432[_0x6392('0x2f')]['includeAll']){_0x3fa78c[_0x6392('0x3d')]=[{'all':!![]}];}return db[_0x6392('0x28')][_0x6392('0x3e')](_0x3fa78c);})[_0x6392('0x22')](function(_0x37ce27){_0xb6d100[_0x6392('0x3f')]=_0x37ce27;return _0xb6d100;})['then'](respondWithFilteredResult(_0x2c3068,_0x3fa78c))[_0x6392('0x40')](handleError(_0x2c3068,null));};exports[_0x6392('0x41')]=function(_0x8aa0d8,_0x20e241){var _0xb62576={'raw':!![],'where':{'id':_0x8aa0d8[_0x6392('0x42')]['id']}},_0x6fe0c8={};_0x6fe0c8[_0x6392('0x2c')]=_[_0x6392('0x2e')](db['VoiceMailMessage'][_0x6392('0x29')]);_0x6fe0c8[_0x6392('0x2f')]=_['keys'](_0x8aa0d8[_0x6392('0x2f')]);_0x6fe0c8[_0x6392('0x30')]=_[_0x6392('0x32')](_0x6fe0c8[_0x6392('0x2c')],_0x6fe0c8[_0x6392('0x2f')]);_0xb62576['attributes']=_['intersection'](_0x6fe0c8[_0x6392('0x2c')],qs[_0x6392('0x43')](_0x8aa0d8[_0x6392('0x2f')]['fields']));_0xb62576['attributes']=_0xb62576[_0x6392('0x31')][_0x6392('0x33')]?_0xb62576['attributes']:_0x6fe0c8[_0x6392('0x2c')];if(_0x8aa0d8[_0x6392('0x2f')][_0x6392('0x44')]){_0xb62576[_0x6392('0x3d')]=[{'all':!![]}];}_0xb62576=_['merge']({},_0xb62576,_0x8aa0d8[_0x6392('0x3c')]);return db[_0x6392('0x28')][_0x6392('0x45')](_0xb62576)[_0x6392('0x22')](handleEntityNotFound(_0x20e241,null))['then'](respondWithResult(_0x20e241,null))[_0x6392('0x40')](handleError(_0x20e241,null));};exports[_0x6392('0x46')]=function(_0x1634f5,_0x5a585d){return db['VoiceMailMessage']['create'](_0x1634f5[_0x6392('0x47')],{})[_0x6392('0x22')](respondWithResult(_0x5a585d,0xc9))[_0x6392('0x40')](handleError(_0x5a585d,null));};exports[_0x6392('0x48')]=function(_0xd090dc,_0x18a189){if(_0xd090dc[_0x6392('0x47')]['id']){delete _0xd090dc[_0x6392('0x47')]['id'];}return db[_0x6392('0x28')][_0x6392('0x45')]({'where':{'id':_0xd090dc['params']['id']}})['then'](handleEntityNotFound(_0x18a189,null))['then'](saveUpdates(_0xd090dc[_0x6392('0x47')],null))[_0x6392('0x22')](respondWithResult(_0x18a189,null))['catch'](handleError(_0x18a189,null));};exports['destroy']=function(_0x3ffd3a,_0x66de58){return db[_0x6392('0x28')]['find']({'where':{'id':_0x3ffd3a['params']['id']}})['then'](handleEntityNotFound(_0x66de58,null))[_0x6392('0x22')](removeEntity(_0x66de58,null))[_0x6392('0x40')](handleError(_0x66de58,null));};exports[_0x6392('0x49')]=function(_0x1d49a2,_0x417306,_0x28d841){return db[_0x6392('0x28')][_0x6392('0x45')]({'where':{'id':_0x1d49a2['params']['id']},'attributes':['id',_0x6392('0x4a'),_0x6392('0x4b')]})[_0x6392('0x22')](handleEntityNotFound(_0x417306,null))[_0x6392('0x22')](function(_0x4fc5d8){if(_0x4fc5d8){if(!_0x4fc5d8[_0x6392('0x4a')]){throw new db[(_0x6392('0x4c'))]['ValidationError'](_0x6392('0x4d'));}var _0x54b5a5={'Content-Type':_0x6392('0x4e'),'Content-Disposition':_0x6392('0x4f')};if(_0x4fc5d8[_0x6392('0x4b')]){_0x54b5a5[_0x6392('0x50')]=_0x6392('0x51')+_0x4fc5d8['msg_id']+'.wav\x22';}_0x417306[_0x6392('0x1d')](_0x54b5a5);return _0x417306[_0x6392('0x25')](new Buffer(_0x4fc5d8[_0x6392('0x4a')]));}})['catch'](handleError(_0x417306,null));}; \ No newline at end of file +var _0xd828=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','params','includeAll','find','create','body','recording','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format'];(function(_0x325e59,_0x56258c){var _0x45bff4=function(_0x4cbc2b){while(--_0x4cbc2b){_0x325e59['push'](_0x325e59['shift']());}};_0x45bff4(++_0x56258c);}(_0xd828,0xad));var _0x8d82=function(_0x29e658,_0x59ee52){_0x29e658=_0x29e658-0x0;var _0x961688=_0xd828[_0x29e658];return _0x961688;};'use strict';var emlformat=require(_0x8d82('0x0'));var rimraf=require(_0x8d82('0x1'));var zipdir=require(_0x8d82('0x2'));var jsonpatch=require(_0x8d82('0x3'));var rp=require(_0x8d82('0x4'));var moment=require(_0x8d82('0x5'));var BPromise=require(_0x8d82('0x6'));var Mustache=require(_0x8d82('0x7'));var util=require('util');var path=require(_0x8d82('0x8'));var sox=require('sox');var csv=require(_0x8d82('0x9'));var ejs=require(_0x8d82('0xa'));var fs=require('fs');var fs_extra=require(_0x8d82('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8d82('0xc'));var jsforce=require(_0x8d82('0xd'));var deskjs=require(_0x8d82('0xe'));var toCsv=require(_0x8d82('0x9'));var querystring=require(_0x8d82('0xf'));var Papa=require(_0x8d82('0x10'));var Redis=require(_0x8d82('0x11'));var authService=require(_0x8d82('0x12'));var qs=require(_0x8d82('0x13'));var as=require(_0x8d82('0x14'));var hardwareService=require(_0x8d82('0x15'));var logger=require(_0x8d82('0x16'))('api');var utils=require(_0x8d82('0x17'));var config=require(_0x8d82('0x18'));var licenseUtil=require(_0x8d82('0x19'));var db=require(_0x8d82('0x1a'))['db'];function respondWithStatusCode(_0x15f018,_0x2c9257){_0x2c9257=_0x2c9257||0xcc;return function(_0x40e13f){if(_0x40e13f){return _0x15f018['sendStatus'](_0x2c9257);}return _0x15f018['status'](_0x2c9257)[_0x8d82('0x1b')]();};}function respondWithResult(_0x174c63,_0x2b7f57){_0x2b7f57=_0x2b7f57||0xc8;return function(_0x433f04){if(_0x433f04){return _0x174c63[_0x8d82('0x1c')](_0x2b7f57)[_0x8d82('0x1d')](_0x433f04);}};}function respondWithFilteredResult(_0xd15691,_0x10a5b8){return function(_0x2a6324){if(_0x2a6324){var _0x140caa=typeof _0x10a5b8[_0x8d82('0x1e')]===_0x8d82('0x1f')&&typeof _0x10a5b8[_0x8d82('0x20')]==='undefined';var _0x1401b5=_0x2a6324[_0x8d82('0x21')];var _0x334c0a=_0x140caa?0x0:_0x10a5b8['offset'];var _0x1c0ba3=_0x140caa?_0x2a6324[_0x8d82('0x21')]:_0x10a5b8[_0x8d82('0x1e')]+_0x10a5b8[_0x8d82('0x20')];var _0x1a7af1;if(_0x1c0ba3>=_0x1401b5){_0x1c0ba3=_0x1401b5;_0x1a7af1=0xc8;}else{_0x1a7af1=0xce;}_0xd15691[_0x8d82('0x1c')](_0x1a7af1);return _0xd15691[_0x8d82('0x22')]('Content-Range',_0x334c0a+'-'+_0x1c0ba3+'/'+_0x1401b5)['json'](_0x2a6324);}return null;};}function patchUpdates(_0x5a6727){return function(_0x350557){try{jsonpatch[_0x8d82('0x23')](_0x350557,_0x5a6727,!![]);}catch(_0x3be251){return BPromise[_0x8d82('0x24')](_0x3be251);}return _0x350557[_0x8d82('0x25')]();};}function saveUpdates(_0x247e76,_0x383b97){return function(_0x4df00b){if(_0x4df00b){return _0x4df00b[_0x8d82('0x26')](_0x247e76)[_0x8d82('0x27')](function(_0x53b53e){return _0x53b53e;});}return null;};}function removeEntity(_0x332d26,_0x545eeb){return function(_0x310d8b){if(_0x310d8b){return _0x310d8b[_0x8d82('0x28')]()['then'](function(){_0x332d26[_0x8d82('0x1c')](0xcc)[_0x8d82('0x1b')]();});}};}function handleEntityNotFound(_0x3268a8,_0x88491b){return function(_0x18b9a8){if(!_0x18b9a8){_0x3268a8['sendStatus'](0x194);}return _0x18b9a8;};}function handleError(_0x44e6c3,_0x317551){_0x317551=_0x317551||0x1f4;return function(_0x6dc3cb){logger[_0x8d82('0x29')](_0x6dc3cb[_0x8d82('0x2a')]);if(_0x6dc3cb[_0x8d82('0x2b')]){delete _0x6dc3cb[_0x8d82('0x2b')];}_0x44e6c3['status'](_0x317551)['send'](_0x6dc3cb);};}exports[_0x8d82('0x2c')]=function(_0x20ddd3,_0x166852){var _0x5b784e={},_0x15ef88={},_0x286150={'count':0x0,'rows':[]};var _0x4a9a37=_['map'](db[_0x8d82('0x2d')][_0x8d82('0x2e')],function(_0x22975c){return{'name':_0x22975c[_0x8d82('0x2f')],'type':_0x22975c[_0x8d82('0x30')][_0x8d82('0x31')]};});_0x15ef88[_0x8d82('0x32')]=_[_0x8d82('0x33')](_[_0x8d82('0x34')](_0x4a9a37,_0x8d82('0x2b')),[_0x8d82('0x2b')]);_0x15ef88[_0x8d82('0x35')]=_[_0x8d82('0x36')](_0x20ddd3[_0x8d82('0x35')]);_0x15ef88['filters']=_[_0x8d82('0x37')](_0x15ef88[_0x8d82('0x32')],_0x15ef88[_0x8d82('0x35')]);_0x5b784e[_0x8d82('0x38')]=_[_0x8d82('0x37')](_0x15ef88[_0x8d82('0x32')],qs['fields'](_0x20ddd3[_0x8d82('0x35')][_0x8d82('0x39')]));_0x5b784e[_0x8d82('0x38')]=_0x5b784e[_0x8d82('0x38')][_0x8d82('0x3a')]?_0x5b784e[_0x8d82('0x38')]:_0x15ef88[_0x8d82('0x32')];if(!_0x20ddd3[_0x8d82('0x35')][_0x8d82('0x3b')](_0x8d82('0x3c'))){_0x5b784e[_0x8d82('0x20')]=qs[_0x8d82('0x20')](_0x20ddd3[_0x8d82('0x35')][_0x8d82('0x20')]);_0x5b784e['offset']=qs[_0x8d82('0x1e')](_0x20ddd3[_0x8d82('0x35')][_0x8d82('0x1e')]);}_0x5b784e[_0x8d82('0x3d')]=qs[_0x8d82('0x3e')](_0x20ddd3[_0x8d82('0x35')][_0x8d82('0x3e')]);_0x5b784e['where']=qs[_0x8d82('0x3f')](_[_0x8d82('0x40')](_0x20ddd3['query'],_0x15ef88[_0x8d82('0x3f')]),_0x4a9a37);if(_0x20ddd3['query'][_0x8d82('0x41')]){_0x5b784e[_0x8d82('0x42')]=_['merge'](_0x5b784e['where'],{'$or':_['map'](_0x4a9a37,function(_0x115f5e){if(_0x115f5e['type']!==_0x8d82('0x43')){var _0x35001c={};_0x35001c[_0x115f5e[_0x8d82('0x2b')]]={'$like':'%'+_0x20ddd3['query']['filter']+'%'};return _0x35001c;}})});}_0x5b784e=_[_0x8d82('0x44')]({},_0x5b784e,_0x20ddd3[_0x8d82('0x45')]);var _0xa94bc3={'where':_0x5b784e[_0x8d82('0x42')]};return db['VoiceMailMessage']['count'](_0xa94bc3)['then'](function(_0x7b04f6){_0x286150[_0x8d82('0x21')]=_0x7b04f6;if(_0x20ddd3['query']['includeAll']){_0x5b784e[_0x8d82('0x46')]=[{'all':!![]}];}return db[_0x8d82('0x2d')]['findAll'](_0x5b784e);})[_0x8d82('0x27')](function(_0x53fc55){_0x286150[_0x8d82('0x47')]=_0x53fc55;return _0x286150;})[_0x8d82('0x27')](respondWithFilteredResult(_0x166852,_0x5b784e))[_0x8d82('0x48')](handleError(_0x166852,null));};exports['show']=function(_0xeff564,_0x1640c2){var _0x560315={'raw':!![],'where':{'id':_0xeff564[_0x8d82('0x49')]['id']}},_0x514fe0={};_0x514fe0[_0x8d82('0x32')]=_[_0x8d82('0x36')](db[_0x8d82('0x2d')][_0x8d82('0x2e')]);_0x514fe0[_0x8d82('0x35')]=_[_0x8d82('0x36')](_0xeff564[_0x8d82('0x35')]);_0x514fe0[_0x8d82('0x3f')]=_[_0x8d82('0x37')](_0x514fe0['model'],_0x514fe0['query']);_0x560315['attributes']=_[_0x8d82('0x37')](_0x514fe0[_0x8d82('0x32')],qs[_0x8d82('0x39')](_0xeff564[_0x8d82('0x35')][_0x8d82('0x39')]));_0x560315[_0x8d82('0x38')]=_0x560315['attributes'][_0x8d82('0x3a')]?_0x560315[_0x8d82('0x38')]:_0x514fe0[_0x8d82('0x32')];if(_0xeff564[_0x8d82('0x35')][_0x8d82('0x4a')]){_0x560315[_0x8d82('0x46')]=[{'all':!![]}];}_0x560315=_['merge']({},_0x560315,_0xeff564[_0x8d82('0x45')]);return db[_0x8d82('0x2d')][_0x8d82('0x4b')](_0x560315)[_0x8d82('0x27')](handleEntityNotFound(_0x1640c2,null))[_0x8d82('0x27')](respondWithResult(_0x1640c2,null))['catch'](handleError(_0x1640c2,null));};exports['create']=function(_0x38d342,_0x5805a8){return db[_0x8d82('0x2d')][_0x8d82('0x4c')](_0x38d342[_0x8d82('0x4d')],{})[_0x8d82('0x27')](respondWithResult(_0x5805a8,0xc9))['catch'](handleError(_0x5805a8,null));};exports[_0x8d82('0x26')]=function(_0x3b2f61,_0x48efa7){if(_0x3b2f61['body']['id']){delete _0x3b2f61[_0x8d82('0x4d')]['id'];}return db[_0x8d82('0x2d')]['find']({'where':{'id':_0x3b2f61['params']['id']}})[_0x8d82('0x27')](handleEntityNotFound(_0x48efa7,null))['then'](saveUpdates(_0x3b2f61[_0x8d82('0x4d')],null))[_0x8d82('0x27')](respondWithResult(_0x48efa7,null))[_0x8d82('0x48')](handleError(_0x48efa7,null));};exports[_0x8d82('0x28')]=function(_0x280ecf,_0x568ca9){return db[_0x8d82('0x2d')][_0x8d82('0x4b')]({'where':{'id':_0x280ecf['params']['id']}})['then'](handleEntityNotFound(_0x568ca9,null))[_0x8d82('0x27')](removeEntity(_0x568ca9,null))['catch'](handleError(_0x568ca9,null));};exports['download']=function(_0x1f0c02,_0x5f2013,_0x27e6f5){return db[_0x8d82('0x2d')][_0x8d82('0x4b')]({'where':{'id':_0x1f0c02['params']['id']},'attributes':['id',_0x8d82('0x4e'),'msg_id']})[_0x8d82('0x27')](handleEntityNotFound(_0x5f2013,null))[_0x8d82('0x27')](function(_0x5f527c){if(_0x5f527c){if(!_0x5f527c[_0x8d82('0x4e')]){throw new db['Sequelize'][(_0x8d82('0x4f'))](_0x8d82('0x50'));}var _0xa1a43={'Content-Type':'audio/wav','Content-Disposition':_0x8d82('0x51')};if(_0x5f527c[_0x8d82('0x52')]){_0xa1a43[_0x8d82('0x53')]=_0x8d82('0x54')+_0x5f527c[_0x8d82('0x52')]+_0x8d82('0x55');}_0x5f2013['set'](_0xa1a43);return _0x5f2013[_0x8d82('0x56')](new Buffer(_0x5f527c['recording']));}})[_0x8d82('0x48')](handleError(_0x5f2013,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 044941a..6ddd8d6 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 _0xb54b=['exports','define','VoiceMailMessage','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb54b,0xea));var _0xbb54=function(_0x44f726,_0x2519eb){_0x44f726=_0x44f726-0x0;var _0x6d38ba=_0xb54b[_0x44f726];return _0x6d38ba;};'use strict';var _=require(_0xbb54('0x0'));var util=require('util');var logger=require(_0xbb54('0x1'))(_0xbb54('0x2'));var moment=require('moment');var BPromise=require(_0xbb54('0x3'));var rp=require(_0xbb54('0x4'));var fs=require('fs');var path=require(_0xbb54('0x5'));var rimraf=require(_0xbb54('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb54('0x7'));module[_0xbb54('0x8')]=function(_0x3f105b,_0x5a0710){return _0x3f105b[_0xbb54('0x9')](_0xbb54('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xe2fc=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x4ba152,_0xc4b1ed){var _0x1c7f4c=function(_0x3f0e99){while(--_0x3f0e99){_0x4ba152['push'](_0x4ba152['shift']());}};_0x1c7f4c(++_0xc4b1ed);}(_0xe2fc,0x168));var _0xce2f=function(_0x246489,_0x48f57a){_0x246489=_0x246489-0x0;var _0x1451bb=_0xe2fc[_0x246489];return _0x1451bb;};'use strict';var _=require(_0xce2f('0x0'));var util=require(_0xce2f('0x1'));var logger=require(_0xce2f('0x2'))(_0xce2f('0x3'));var moment=require(_0xce2f('0x4'));var BPromise=require('bluebird');var rp=require(_0xce2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xce2f('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0xce2f('0x7')]=function(_0x407e1b,_0x393bab){return _0x407e1b[_0xce2f('0x8')](_0xce2f('0x9'),attributes,{'tableName':_0xce2f('0xa'),'paranoid':![],'indexes':[{'name':_0xce2f('0xb'),'fields':[_0xce2f('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c13d97e..1a7b33a 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 _0xbe04=['jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2c1f1c,_0x3a1f2e){var _0xa603ab=function(_0x42f9b7){while(--_0x42f9b7){_0x2c1f1c['push'](_0x2c1f1c['shift']());}};_0xa603ab(++_0x3a1f2e);}(_0xbe04,0xc1));var _0x4be0=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xbe04[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0x4be0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4be0('0x1'));var fs=require('fs');var Redis=require(_0x4be0('0x2'));var db=require(_0x4be0('0x3'))['db'];var utils=require(_0x4be0('0x4'));var logger=require('../../config/logger')(_0x4be0('0x5'));var config=require(_0x4be0('0x6'));var jayson=require(_0x4be0('0x7'));var client=jayson[_0x4be0('0x8')][_0x4be0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18e103,_0x59459e,_0x479058){return new BPromise(function(_0x419ef5,_0x1d1b3a){return client[_0x4be0('0xa')](_0x18e103,_0x479058)[_0x4be0('0xb')](function(_0x253b25){logger[_0x4be0('0xc')](_0x4be0('0xd'),_0x59459e,_0x4be0('0xe'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x59459e,_0x4be0('0xe'),JSON[_0x4be0('0xf')](_0x253b25));if(_0x253b25[_0x4be0('0x10')]){if(_0x253b25[_0x4be0('0x10')][_0x4be0('0x11')]===0x1f4){logger[_0x4be0('0x10')](_0x4be0('0xd'),_0x59459e,_0x253b25['error'][_0x4be0('0x12')]);return _0x1d1b3a(_0x253b25['error'][_0x4be0('0x12')]);}logger['error'](_0x4be0('0xd'),_0x59459e,_0x253b25['error'][_0x4be0('0x12')]);return _0x419ef5(_0x253b25[_0x4be0('0x10')][_0x4be0('0x12')]);}else{logger[_0x4be0('0xc')](_0x4be0('0xd'),_0x59459e,_0x4be0('0xe'));_0x419ef5(_0x253b25[_0x4be0('0x13')][_0x4be0('0x12')]);}})['catch'](function(_0x411363){logger[_0x4be0('0x10')](_0x4be0('0xd'),_0x59459e,_0x411363);_0x1d1b3a(_0x411363);});});} \ No newline at end of file +var _0xd373=['error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x3b007a,_0x59d351){var _0x41520c=function(_0x274bd9){while(--_0x274bd9){_0x3b007a['push'](_0x3b007a['shift']());}};_0x41520c(++_0x59d351);}(_0xd373,0x103));var _0x3d37=function(_0x2f4301,_0x103114){_0x2f4301=_0x2f4301-0x0;var _0x3d0813=_0xd373[_0x2f4301];return _0x3d0813;};'use strict';var _=require('lodash');var util=require(_0x3d37('0x0'));var moment=require(_0x3d37('0x1'));var BPromise=require(_0x3d37('0x2'));var rs=require(_0x3d37('0x3'));var fs=require('fs');var Redis=require(_0x3d37('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d37('0x5'));var logger=require(_0x3d37('0x6'))(_0x3d37('0x7'));var config=require('../../config/environment');var jayson=require(_0x3d37('0x8'));var client=jayson[_0x3d37('0x9')][_0x3d37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5634a1,_0x3e13e5,_0x1cfe84){return new BPromise(function(_0x567921,_0x12aa84){return client[_0x3d37('0xb')](_0x5634a1,_0x1cfe84)[_0x3d37('0xc')](function(_0x5dcfe0){logger[_0x3d37('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x3e13e5,_0x3d37('0xe'));logger[_0x3d37('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3e13e5,_0x3d37('0xe'),JSON[_0x3d37('0x10')](_0x5dcfe0));if(_0x5dcfe0[_0x3d37('0x11')]){if(_0x5dcfe0[_0x3d37('0x11')][_0x3d37('0x12')]===0x1f4){logger['error'](_0x3d37('0x13'),_0x3e13e5,_0x5dcfe0['error'][_0x3d37('0x14')]);return _0x12aa84(_0x5dcfe0['error'][_0x3d37('0x14')]);}logger[_0x3d37('0x11')](_0x3d37('0x13'),_0x3e13e5,_0x5dcfe0['error'][_0x3d37('0x14')]);return _0x567921(_0x5dcfe0[_0x3d37('0x11')][_0x3d37('0x14')]);}else{logger[_0x3d37('0xd')](_0x3d37('0x13'),_0x3e13e5,'request\x20sent');_0x567921(_0x5dcfe0[_0x3d37('0x15')]['message']);}})[_0x3d37('0x16')](function(_0x5097e0){logger[_0x3d37('0x11')](_0x3d37('0x13'),_0x3e13e5,_0x5097e0);_0x12aa84(_0x5097e0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0762734..28556aa 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 _0x1982=['isAuthenticated','/:id','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x1982,0x111));var _0x2198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1982[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2198('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2198('0x1'));var express=require('express');var router=express[_0x2198('0x2')]();var fs_extra=require(_0x2198('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2198('0x4'));var config=require('../../config/environment');var controller=require(_0x2198('0x5'));router[_0x2198('0x6')]('/',auth[_0x2198('0x7')](),controller['index']);router[_0x2198('0x6')](_0x2198('0x8'),auth[_0x2198('0x7')](),controller['show']);router[_0x2198('0x6')](_0x2198('0x9'),auth[_0x2198('0x7')](),controller[_0x2198('0xa')]);router[_0x2198('0xb')]('/',auth[_0x2198('0x7')](),controller['create']);router[_0x2198('0xb')](_0x2198('0x9'),auth[_0x2198('0x7')](),controller[_0x2198('0xc')]);router[_0x2198('0xd')]('/:id',auth[_0x2198('0x7')](),controller[_0x2198('0xe')]);router[_0x2198('0xf')](_0x2198('0x8'),auth[_0x2198('0x7')](),controller[_0x2198('0x10')]);router['delete'](_0x2198('0x11'),auth[_0x2198('0x7')](),controller[_0x2198('0x12')]);module[_0x2198('0x13')]=router; \ No newline at end of file +var _0x2f76=['/:id/sounds','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getSounds','post'];(function(_0x366f62,_0x1d8759){var _0x4ce6a8=function(_0x582b67){while(--_0x582b67){_0x366f62['push'](_0x366f62['shift']());}};_0x4ce6a8(++_0x1d8759);}(_0x2f76,0x11d));var _0x62f7=function(_0x1962ef,_0x1f1d40){_0x1962ef=_0x1962ef-0x0;var _0x44c597=_0x2f76[_0x1962ef];return _0x44c597;};'use strict';var multer=require(_0x62f7('0x0'));var util=require('util');var path=require(_0x62f7('0x1'));var timeout=require(_0x62f7('0x2'));var express=require(_0x62f7('0x3'));var router=express[_0x62f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62f7('0x5'));var interaction=require(_0x62f7('0x6'));var config=require(_0x62f7('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x62f7('0x8')]('/',auth[_0x62f7('0x9')](),controller[_0x62f7('0xa')]);router[_0x62f7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x62f7('0xb')]);router['get']('/:id/sounds',auth[_0x62f7('0x9')](),controller[_0x62f7('0xc')]);router['post']('/',auth[_0x62f7('0x9')](),controller['create']);router[_0x62f7('0xd')](_0x62f7('0xe'),auth[_0x62f7('0x9')](),controller['addSound']);router[_0x62f7('0xf')](_0x62f7('0x10'),auth['isAuthenticated'](),controller[_0x62f7('0x11')]);router[_0x62f7('0x12')](_0x62f7('0x10'),auth['isAuthenticated'](),controller[_0x62f7('0x13')]);router[_0x62f7('0x12')](_0x62f7('0x14'),auth[_0x62f7('0x9')](),controller[_0x62f7('0x15')]);module[_0x62f7('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a5d6a49..b007fb3 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 _0xfb0c=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0xfb0c,0xe2));var _0xcfb0=function(_0x5d33a6,_0x1e923c){_0x5d33a6=_0x5d33a6-0x0;var _0x242abe=_0xfb0c[_0x5d33a6];return _0x242abe;};'use strict';var Sequelize=require(_0xcfb0('0x0'));module[_0xcfb0('0x1')]={'name':{'type':Sequelize[_0xcfb0('0x2')],'allowNull':![],'unique':_0xcfb0('0x3')},'mode':{'type':Sequelize[_0xcfb0('0x4')](_0xcfb0('0x5'),_0xcfb0('0x6'),_0xcfb0('0x7'),_0xcfb0('0x8'),_0xcfb0('0x9'),_0xcfb0('0xa')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xcfb0('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xcfb0('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcfb0('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcfb0('0x2')],'allowNull':!![],'defaultValue':_0xcfb0('0xb')},'format':{'type':Sequelize[_0xcfb0('0x2')],'allowNull':!![]},'stamp':{'type':_0xcfb0('0xc')},'defaultEntry':{'type':Sequelize[_0xcfb0('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe8b5=['quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','custom','files','mp3nb'];(function(_0xf969eb,_0x4c6c2d){var _0x2de570=function(_0x33f8f7){while(--_0x33f8f7){_0xf969eb['push'](_0xf969eb['shift']());}};_0x2de570(++_0x4c6c2d);}(_0xe8b5,0x72));var _0x5e8b=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xe8b5[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require(_0x5e8b('0x0'));module[_0x5e8b('0x1')]={'name':{'type':Sequelize[_0x5e8b('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x5e8b('0x3'),_0x5e8b('0x4'),_0x5e8b('0x5'),_0x5e8b('0x6'),_0x5e8b('0x7'),_0x5e8b('0x8')),'allowNull':!![],'defaultValue':_0x5e8b('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x5e8b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5e8b('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5e8b('0x2')],'allowNull':!![],'defaultValue':_0x5e8b('0x9')},'format':{'type':Sequelize[_0x5e8b('0x2')],'allowNull':!![]},'stamp':{'type':_0x5e8b('0xa')},'defaultEntry':{'type':Sequelize[_0x5e8b('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 ee15fd2..7b624a3 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 _0x3eb0=['message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','Sequelize','removeSound','id2','Sound','unlinkSync','getSounds','options','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','params','length','includeAll','body','find','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','rmdirSync','ValidationError'];(function(_0x3cbb8f,_0x8847c0){var _0x36d0ed=function(_0x417a63){while(--_0x417a63){_0x3cbb8f['push'](_0x3cbb8f['shift']());}};_0x36d0ed(++_0x8847c0);}(_0x3eb0,0x82));var _0x03eb=function(_0x30a6b3,_0x1e4e3e){_0x30a6b3=_0x30a6b3-0x0;var _0x5bca6a=_0x3eb0[_0x30a6b3];return _0x5bca6a;};'use strict';var emlformat=require(_0x03eb('0x0'));var rimraf=require(_0x03eb('0x1'));var zipdir=require(_0x03eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03eb('0x3'));var moment=require(_0x03eb('0x4'));var BPromise=require(_0x03eb('0x5'));var Mustache=require(_0x03eb('0x6'));var util=require('util');var path=require(_0x03eb('0x7'));var sox=require(_0x03eb('0x8'));var csv=require(_0x03eb('0x9'));var ejs=require(_0x03eb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03eb('0xb'));var squel=require(_0x03eb('0xc'));var crypto=require(_0x03eb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03eb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03eb('0xf'));var Redis=require(_0x03eb('0x10'));var authService=require(_0x03eb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x03eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03eb('0x13'));var utils=require(_0x03eb('0x14'));var config=require(_0x03eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb5bd8e,_0x2792d5){_0x2792d5=_0x2792d5||0xcc;return function(_0x2e4892){if(_0x2e4892){return _0xb5bd8e[_0x03eb('0x16')](_0x2792d5);}return _0xb5bd8e[_0x03eb('0x17')](_0x2792d5)[_0x03eb('0x18')]();};}function respondWithResult(_0xa6ecfb,_0x51606a){_0x51606a=_0x51606a||0xc8;return function(_0x284f1d){if(_0x284f1d){return _0xa6ecfb[_0x03eb('0x17')](_0x51606a)[_0x03eb('0x19')](_0x284f1d);}};}function respondWithFilteredResult(_0x17783e,_0x2b6a30){return function(_0x5472b6){if(_0x5472b6){var _0x2ba233=typeof _0x2b6a30[_0x03eb('0x1a')]==='undefined'&&typeof _0x2b6a30[_0x03eb('0x1b')]==='undefined';var _0x547357=_0x5472b6['count'];var _0x481890=_0x2ba233?0x0:_0x2b6a30[_0x03eb('0x1a')];var _0x1ee33f=_0x2ba233?_0x5472b6[_0x03eb('0x1c')]:_0x2b6a30[_0x03eb('0x1a')]+_0x2b6a30[_0x03eb('0x1b')];var _0x1a8bb0;if(_0x1ee33f>=_0x547357){_0x1ee33f=_0x547357;_0x1a8bb0=0xc8;}else{_0x1a8bb0=0xce;}_0x17783e[_0x03eb('0x17')](_0x1a8bb0);return _0x17783e[_0x03eb('0x1d')](_0x03eb('0x1e'),_0x481890+'-'+_0x1ee33f+'/'+_0x547357)[_0x03eb('0x19')](_0x5472b6);}return null;};}function patchUpdates(_0x59b318){return function(_0x1db58b){try{jsonpatch[_0x03eb('0x1f')](_0x1db58b,_0x59b318,!![]);}catch(_0x5758d2){return BPromise[_0x03eb('0x20')](_0x5758d2);}return _0x1db58b[_0x03eb('0x21')]();};}function saveUpdates(_0x4b2e35,_0x5edfd2){return function(_0x33a660){if(_0x33a660){return _0x33a660[_0x03eb('0x22')](_0x4b2e35)[_0x03eb('0x23')](function(_0x1e9473){return _0x1e9473;});}return null;};}function removeEntity(_0x20e6d4,_0x257144){return function(_0x3976f0){if(_0x3976f0){return _0x3976f0['destroy']()['then'](function(){var _0x444e85=_0x3976f0[_0x03eb('0x24')]({'plain':!![]});var _0x40f0ef=_0x03eb('0x25');return db[_0x03eb('0x26')][_0x03eb('0x27')]({'where':{'type':_0x40f0ef,'resourceId':_0x444e85['id']}})[_0x03eb('0x23')](function(){return _0x3976f0;});})['then'](function(){_0x20e6d4[_0x03eb('0x17')](0xcc)[_0x03eb('0x18')]();});}};}function handleEntityNotFound(_0x2f69d9,_0x534705){return function(_0x10d152){if(!_0x10d152){_0x2f69d9[_0x03eb('0x16')](0x194);}return _0x10d152;};}function handleError(_0x2b8387,_0x27397d){_0x27397d=_0x27397d||0x1f4;return function(_0x2ca629){logger[_0x03eb('0x28')](_0x2ca629[_0x03eb('0x29')]);if(_0x2ca629[_0x03eb('0x2a')]){delete _0x2ca629['name'];}_0x2b8387['status'](_0x27397d)[_0x03eb('0x2b')](_0x2ca629);};}exports['index']=function(_0x5c7224,_0x96b2c9){var _0x41ae9e={},_0x4dfd79={},_0x361a3e={'count':0x0,'rows':[]};var _0x3ee8b0=_['map'](db[_0x03eb('0x2c')][_0x03eb('0x2d')],function(_0x549aab){return{'name':_0x549aab[_0x03eb('0x2e')],'type':_0x549aab['type'][_0x03eb('0x2f')]};});_0x4dfd79[_0x03eb('0x30')]=_[_0x03eb('0x31')](_0x3ee8b0,_0x03eb('0x2a'));_0x4dfd79[_0x03eb('0x32')]=_[_0x03eb('0x33')](_0x5c7224[_0x03eb('0x32')]);_0x4dfd79['filters']=_[_0x03eb('0x34')](_0x4dfd79[_0x03eb('0x30')],_0x4dfd79[_0x03eb('0x32')]);_0x41ae9e[_0x03eb('0x35')]=_[_0x03eb('0x34')](_0x4dfd79['model'],qs[_0x03eb('0x36')](_0x5c7224[_0x03eb('0x32')][_0x03eb('0x36')]));_0x41ae9e['attributes']=_0x41ae9e[_0x03eb('0x35')]['length']?_0x41ae9e['attributes']:_0x4dfd79[_0x03eb('0x30')];if(!_0x5c7224[_0x03eb('0x32')][_0x03eb('0x37')]('nolimit')){_0x41ae9e['limit']=qs[_0x03eb('0x1b')](_0x5c7224['query'][_0x03eb('0x1b')]);_0x41ae9e[_0x03eb('0x1a')]=qs[_0x03eb('0x1a')](_0x5c7224[_0x03eb('0x32')]['offset']);}_0x41ae9e[_0x03eb('0x38')]=qs[_0x03eb('0x39')](_0x5c7224['query']['sort']);delete _0x5c7224[_0x03eb('0x32')][_0x03eb('0x39')];_0x41ae9e[_0x03eb('0x3a')]=qs[_0x03eb('0x3b')](_[_0x03eb('0x3c')](_0x5c7224[_0x03eb('0x32')],_0x4dfd79[_0x03eb('0x3b')]),_0x3ee8b0);if(_0x5c7224[_0x03eb('0x32')][_0x03eb('0x3d')]){_0x41ae9e['where']=_[_0x03eb('0x3e')](_0x41ae9e['where'],{'$or':_[_0x03eb('0x31')](_0x3ee8b0,function(_0x4dbaa2){if(_0x4dbaa2[_0x03eb('0x3f')]!==_0x03eb('0x40')){var _0x4a5169={};_0x4a5169[_0x4dbaa2[_0x03eb('0x2a')]]={'$like':'%'+_0x5c7224[_0x03eb('0x32')][_0x03eb('0x3d')]+'%'};return _0x4a5169;}})});}_0x41ae9e=_[_0x03eb('0x3e')]({},_0x41ae9e,_0x5c7224['options']);var _0x529a36={'where':_0x41ae9e[_0x03eb('0x3a')]};return db[_0x03eb('0x2c')][_0x03eb('0x1c')](_0x529a36)['then'](function(_0x410d99){_0x361a3e[_0x03eb('0x1c')]=_0x410d99;if(_0x5c7224['query']['includeAll']){_0x41ae9e[_0x03eb('0x41')]=[{'all':!![]}];}return db[_0x03eb('0x2c')][_0x03eb('0x42')](_0x41ae9e);})[_0x03eb('0x23')](function(_0x20ab77){_0x361a3e[_0x03eb('0x43')]=_0x20ab77;return _0x361a3e;})[_0x03eb('0x23')](respondWithFilteredResult(_0x96b2c9,_0x41ae9e))[_0x03eb('0x44')](handleError(_0x96b2c9,null));};exports['show']=function(_0x2e40a2,_0x22d0b5){var _0x285642={'raw':![],'where':{'id':_0x2e40a2[_0x03eb('0x45')]['id']}},_0x343882={};_0x343882[_0x03eb('0x30')]=_[_0x03eb('0x33')](db[_0x03eb('0x2c')][_0x03eb('0x2d')]);_0x343882[_0x03eb('0x32')]=_[_0x03eb('0x33')](_0x2e40a2[_0x03eb('0x32')]);_0x343882['filters']=_[_0x03eb('0x34')](_0x343882[_0x03eb('0x30')],_0x343882[_0x03eb('0x32')]);_0x285642[_0x03eb('0x35')]=_[_0x03eb('0x34')](_0x343882[_0x03eb('0x30')],qs['fields'](_0x2e40a2['query'][_0x03eb('0x36')]));_0x285642[_0x03eb('0x35')]=_0x285642[_0x03eb('0x35')][_0x03eb('0x46')]?_0x285642[_0x03eb('0x35')]:_0x343882[_0x03eb('0x30')];if(_0x2e40a2['query'][_0x03eb('0x47')]){_0x285642['include']=[{'all':!![]}];}_0x285642=_[_0x03eb('0x3e')]({},_0x285642,_0x2e40a2['options']);return db[_0x03eb('0x2c')]['find'](_0x285642)[_0x03eb('0x23')](handleEntityNotFound(_0x22d0b5,null))[_0x03eb('0x23')](respondWithResult(_0x22d0b5,null))[_0x03eb('0x44')](handleError(_0x22d0b5,null));};exports[_0x03eb('0x22')]=function(_0x51b538,_0x1dbaba){if(_0x51b538[_0x03eb('0x48')]['id']){delete _0x51b538[_0x03eb('0x48')]['id'];}return db[_0x03eb('0x2c')][_0x03eb('0x49')]({'where':{'id':_0x51b538[_0x03eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dbaba,null))[_0x03eb('0x23')](saveUpdates(_0x51b538[_0x03eb('0x48')],null))[_0x03eb('0x23')](respondWithResult(_0x1dbaba,null))['catch'](handleError(_0x1dbaba,null));};exports[_0x03eb('0x4a')]=function(_0x407903,_0x4e1c53,_0x3f15a1){return db[_0x03eb('0x4b')][_0x03eb('0x4c')](function(_0x56725b){if(_0x407903[_0x03eb('0x48')][_0x03eb('0x4d')]===_0x03eb('0x4e')){_0x407903[_0x03eb('0x48')][_0x03eb('0x4f')]=path[_0x03eb('0x50')](config['root'],_0x03eb('0x51'),_0x407903['body']['name']);}return db[_0x03eb('0x2c')][_0x03eb('0x4a')](_0x407903[_0x03eb('0x48')],{'transaction':_0x56725b})[_0x03eb('0x23')](function(_0xeda659){if(_0x407903[_0x03eb('0x48')]['mode']===_0x03eb('0x4e')){fs[_0x03eb('0x52')](_0xeda659[_0x03eb('0x4f')],parseInt('0777',0x8));}var _0x4b1201=_0x407903[_0x03eb('0x53')][_0x03eb('0x24')]({'plain':!![]});if(!_0x4b1201)throw new Error(_0x03eb('0x54'));if(_0x4b1201[_0x03eb('0x55')]==='user'){var _0x181156=_0xeda659[_0x03eb('0x24')]({'plain':!![]});return db[_0x03eb('0x56')][_0x03eb('0x49')]({'where':{'name':_0x03eb('0x25'),'userProfileId':_0x4b1201[_0x03eb('0x57')]},'raw':!![]})[_0x03eb('0x23')](function(_0x3db8d0){if(_0x3db8d0&&_0x3db8d0['autoAssociation']===0x0){return db[_0x03eb('0x26')]['create']({'name':_0x181156['name'],'resourceId':_0x181156['id'],'type':_0x3db8d0['name'],'sectionId':_0x3db8d0['id']},{})[_0x03eb('0x23')](function(){return _0xeda659;});}else{return _0xeda659;}})['catch'](function(_0x172cf8){logger[_0x03eb('0x28')](_0x03eb('0x58'),_0x172cf8);});}return _0xeda659;});})[_0x03eb('0x23')](respondWithResult(_0x4e1c53,0xc9))[_0x03eb('0x44')](handleError(_0x4e1c53,null));};exports[_0x03eb('0x27')]=function(_0x5c1a2c,_0x275fea,_0xbb1c83){var _0x22ffbc;return db[_0x03eb('0x2c')][_0x03eb('0x49')]({'where':{'id':_0x5c1a2c[_0x03eb('0x45')]['id']}})[_0x03eb('0x23')](function(_0x58197b){if(_0x58197b){return db['sequelize'][_0x03eb('0x4c')](function(_0x4d04d5){return _0x58197b['destroy']({'transaction':_0x4d04d5,'raw':!![]})['then'](function(_0x510816){if(_0x510816[_0x03eb('0x4f')]){fs[_0x03eb('0x59')](_0x510816[_0x03eb('0x4f')])['forEach'](function(_0x385324){fs['unlinkSync'](path[_0x03eb('0x50')](_0x510816[_0x03eb('0x4f')],_0x385324));});fs[_0x03eb('0x5a')](_0x510816[_0x03eb('0x4f')]);}return _0x510816;});})[_0x03eb('0x44')](function(_0xe57e5d){throw new db['Sequelize'][(_0x03eb('0x5b'))](_0xe57e5d[_0x03eb('0x5c')]);});}})['then'](handleEntityNotFound(_0x275fea,null))[_0x03eb('0x23')](removeEntity(_0x275fea,null))[_0x03eb('0x44')](handleError(_0x275fea,null));};exports[_0x03eb('0x5d')]=function(_0x51c3df,_0x54fe08,_0x2b0d30){return db[_0x03eb('0x4b')][_0x03eb('0x4c')](function(_0x2c00e8){var _0x58b82e;return db[_0x03eb('0x2c')][_0x03eb('0x49')]({'where':{'id':_0x51c3df[_0x03eb('0x45')]['id']}})[_0x03eb('0x23')](function(_0x2b2618){if(_0x2b2618){_0x58b82e=_0x2b2618;return _0x2b2618['addSound'](_0x51c3df[_0x03eb('0x48')]['id'],{'transaction':_0x2c00e8});}})['then'](function(_0x2342ce){if(_0x2342ce){return db['Sound'][_0x03eb('0x5e')]({'where':{'id':_0x51c3df[_0x03eb('0x48')]['id']},'attributes':['id',_0x03eb('0x2a'),_0x03eb('0x5f'),_0x03eb('0x60'),_0x03eb('0x61')],'raw':!![]});}})['then'](function(_0x2f99dd){if(_0x2f99dd){var _0x2ef5a5=path[_0x03eb('0x50')](config['root'],_0x03eb('0x62'),util[_0x03eb('0x63')](_0x03eb('0x64'),path['basename'](_0x2f99dd['save_name'],path[_0x03eb('0x65')](_0x2f99dd[_0x03eb('0x5f')])),_0x2f99dd[_0x03eb('0x60')]));var _0x2abedf=path[_0x03eb('0x50')](config['root'],_0x03eb('0x51'),_0x58b82e[_0x03eb('0x2a')],util[_0x03eb('0x63')](_0x03eb('0x64'),_0x2f99dd['name'],_0x2f99dd[_0x03eb('0x60')]));fs[_0x03eb('0x66')](_0x2ef5a5,_0x2abedf);return _0x2f99dd;}})['catch'](function(_0x19acfd){throw new db[(_0x03eb('0x67'))]['ValidationError'](_0x19acfd[_0x03eb('0x5c')]);});})[_0x03eb('0x23')](handleEntityNotFound(_0x54fe08,null))[_0x03eb('0x23')](respondWithResult(_0x54fe08,0xc9))[_0x03eb('0x44')](handleError(_0x54fe08,null));};exports['removeSound']=function(_0x453313,_0x2b1000,_0x4cd1c7){return db['sequelize'][_0x03eb('0x4c')](function(_0x150bd8){var _0x424646;return db[_0x03eb('0x2c')][_0x03eb('0x5e')]({'where':{'id':_0x453313['params']['id']}})[_0x03eb('0x23')](handleEntityNotFound(_0x2b1000,null))['then'](function(_0x26f8d2){if(_0x26f8d2){_0x424646=_0x26f8d2;return _0x26f8d2[_0x03eb('0x68')](_0x453313['params'][_0x03eb('0x69')]);}})['then'](function(_0x2360f8){if(_0x2360f8){return db[_0x03eb('0x6a')][_0x03eb('0x5e')]({'where':{'id':_0x453313[_0x03eb('0x45')][_0x03eb('0x69')]},'attributes':['id',_0x03eb('0x2a'),_0x03eb('0x5f'),_0x03eb('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0x5c0b85){if(_0x5c0b85){fs[_0x03eb('0x6b')](path[_0x03eb('0x50')](_0x424646['directory'],util['format']('%s.%s',_0x5c0b85['name'],_0x5c0b85[_0x03eb('0x60')])));return _0x5c0b85;}})[_0x03eb('0x44')](function(_0x48f14b){throw new db['Sequelize'][(_0x03eb('0x5b'))](_0x48f14b[_0x03eb('0x5c')]);});})[_0x03eb('0x23')](handleEntityNotFound(_0x2b1000,null))[_0x03eb('0x23')](respondWithStatusCode(_0x2b1000,0xcc))[_0x03eb('0x44')](handleError(_0x2b1000,null));};exports[_0x03eb('0x6c')]=function(_0x3b16d0,_0x523c71,_0x2bd2fb){var _0x51d186={};var _0x56322a={};var _0x2aa723;var _0x38b304;return db[_0x03eb('0x2c')][_0x03eb('0x5e')]({'where':{'id':_0x3b16d0[_0x03eb('0x45')]['id']}})[_0x03eb('0x23')](handleEntityNotFound(_0x523c71,null))[_0x03eb('0x23')](function(_0x50d7e8){if(_0x50d7e8){_0x2aa723=_0x50d7e8;_0x56322a[_0x03eb('0x30')]=_[_0x03eb('0x33')](db[_0x03eb('0x6a')][_0x03eb('0x2d')]);_0x56322a['query']=_[_0x03eb('0x33')](_0x3b16d0[_0x03eb('0x32')]);_0x56322a[_0x03eb('0x3b')]=_['intersection'](_0x56322a['model'],_0x56322a[_0x03eb('0x32')]);_0x51d186['attributes']=_[_0x03eb('0x34')](_0x56322a[_0x03eb('0x30')],qs[_0x03eb('0x36')](_0x3b16d0[_0x03eb('0x32')]['fields']));_0x51d186[_0x03eb('0x35')]=_0x51d186['attributes'][_0x03eb('0x46')]?_0x51d186[_0x03eb('0x35')]:_0x56322a[_0x03eb('0x30')];_0x51d186['order']=qs[_0x03eb('0x39')](_0x3b16d0[_0x03eb('0x32')]['sort']);_0x51d186[_0x03eb('0x3a')]=qs[_0x03eb('0x3b')](_[_0x03eb('0x3c')](_0x3b16d0['query'],_0x56322a[_0x03eb('0x3b')]));if(_0x3b16d0['query']['filter']){_0x51d186['where']=_[_0x03eb('0x3e')](_0x51d186['where'],{'$or':_[_0x03eb('0x31')](_0x51d186[_0x03eb('0x35')],function(_0x35115b){var _0xa9b9e9={};_0xa9b9e9[_0x35115b]={'$like':'%'+_0x3b16d0[_0x03eb('0x32')][_0x03eb('0x3d')]+'%'};return _0xa9b9e9;})});}_0x51d186=_[_0x03eb('0x3e')]({},_0x51d186,_0x3b16d0[_0x03eb('0x6d')]);return _0x2aa723['getSounds'](_0x51d186);}})['then'](function(_0x609820){if(_0x609820){_0x38b304=_0x609820[_0x03eb('0x46')];if(!_0x3b16d0[_0x03eb('0x32')]['hasOwnProperty'](_0x03eb('0x6e'))){_0x51d186[_0x03eb('0x1b')]=qs['limit'](_0x3b16d0[_0x03eb('0x32')][_0x03eb('0x1b')]);_0x51d186[_0x03eb('0x1a')]=qs[_0x03eb('0x1a')](_0x3b16d0[_0x03eb('0x32')][_0x03eb('0x1a')]);}return _0x2aa723['getSounds'](_0x51d186);}})['then'](function(_0x2983bd){if(_0x2983bd){return _0x2983bd?{'count':_0x38b304,'rows':_0x2983bd}:null;}})['then'](respondWithResult(_0x523c71,null))[_0x03eb('0x44')](handleError(_0x523c71,null));}; \ No newline at end of file +var _0xc3f4=['mode','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','destroy','sequelize','readdirSync','forEach','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','extname','symlinkSync','ValidationError','removeSound','id2','getSounds','order','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','MusicOnHolds','UserProfileResource','error','stack','send','index','VoiceMusicOnHold','rawAttributes','type','key','model','map','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','params','find','update','body','catch','create','transaction','files','directory','join','root','server/files/moh'];(function(_0x344357,_0x484651){var _0x1aaa49=function(_0x8392f0){while(--_0x8392f0){_0x344357['push'](_0x344357['shift']());}};_0x1aaa49(++_0x484651);}(_0xc3f4,0x1da));var _0x4c3f=function(_0x4ee1b8,_0x3cfa9e){_0x4ee1b8=_0x4ee1b8-0x0;var _0x4769f6=_0xc3f4[_0x4ee1b8];return _0x4769f6;};'use strict';var emlformat=require(_0x4c3f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4c3f('0x1'));var rp=require('request-promise');var moment=require(_0x4c3f('0x2'));var BPromise=require(_0x4c3f('0x3'));var Mustache=require(_0x4c3f('0x4'));var util=require(_0x4c3f('0x5'));var path=require(_0x4c3f('0x6'));var sox=require(_0x4c3f('0x7'));var csv=require(_0x4c3f('0x8'));var ejs=require(_0x4c3f('0x9'));var fs=require('fs');var fs_extra=require(_0x4c3f('0xa'));var _=require(_0x4c3f('0xb'));var squel=require(_0x4c3f('0xc'));var crypto=require('crypto');var jsforce=require(_0x4c3f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4c3f('0x8'));var querystring=require(_0x4c3f('0xe'));var Papa=require(_0x4c3f('0xf'));var Redis=require('ioredis');var authService=require(_0x4c3f('0x10'));var qs=require(_0x4c3f('0x11'));var as=require(_0x4c3f('0x12'));var hardwareService=require(_0x4c3f('0x13'));var logger=require(_0x4c3f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4c3f('0x15'));var licenseUtil=require(_0x4c3f('0x16'));var db=require(_0x4c3f('0x17'))['db'];function respondWithStatusCode(_0x54e64c,_0x3188e6){_0x3188e6=_0x3188e6||0xcc;return function(_0x81622){if(_0x81622){return _0x54e64c[_0x4c3f('0x18')](_0x3188e6);}return _0x54e64c[_0x4c3f('0x19')](_0x3188e6)[_0x4c3f('0x1a')]();};}function respondWithResult(_0x35667d,_0x309c7b){_0x309c7b=_0x309c7b||0xc8;return function(_0xbffe84){if(_0xbffe84){return _0x35667d[_0x4c3f('0x19')](_0x309c7b)[_0x4c3f('0x1b')](_0xbffe84);}};}function respondWithFilteredResult(_0x72a6a7,_0x5f48b0){return function(_0x1d33c6){if(_0x1d33c6){var _0x2c1ba0=typeof _0x5f48b0[_0x4c3f('0x1c')]==='undefined'&&typeof _0x5f48b0[_0x4c3f('0x1d')]===_0x4c3f('0x1e');var _0x4869dd=_0x1d33c6[_0x4c3f('0x1f')];var _0x2a906b=_0x2c1ba0?0x0:_0x5f48b0['offset'];var _0x1c7fcf=_0x2c1ba0?_0x1d33c6[_0x4c3f('0x1f')]:_0x5f48b0[_0x4c3f('0x1c')]+_0x5f48b0[_0x4c3f('0x1d')];var _0x31ad53;if(_0x1c7fcf>=_0x4869dd){_0x1c7fcf=_0x4869dd;_0x31ad53=0xc8;}else{_0x31ad53=0xce;}_0x72a6a7[_0x4c3f('0x19')](_0x31ad53);return _0x72a6a7[_0x4c3f('0x20')](_0x4c3f('0x21'),_0x2a906b+'-'+_0x1c7fcf+'/'+_0x4869dd)['json'](_0x1d33c6);}return null;};}function patchUpdates(_0x30bbc0){return function(_0x2ea695){try{jsonpatch[_0x4c3f('0x22')](_0x2ea695,_0x30bbc0,!![]);}catch(_0x1fa7fc){return BPromise[_0x4c3f('0x23')](_0x1fa7fc);}return _0x2ea695[_0x4c3f('0x24')]();};}function saveUpdates(_0x2a965f,_0x2fd5a1){return function(_0x5ed623){if(_0x5ed623){return _0x5ed623['update'](_0x2a965f)['then'](function(_0x568791){return _0x568791;});}return null;};}function removeEntity(_0x539e28,_0x189cb1){return function(_0x4c508f){if(_0x4c508f){return _0x4c508f['destroy']()[_0x4c3f('0x25')](function(){var _0x499f7b=_0x4c508f[_0x4c3f('0x26')]({'plain':!![]});var _0x200964=_0x4c3f('0x27');return db[_0x4c3f('0x28')]['destroy']({'where':{'type':_0x200964,'resourceId':_0x499f7b['id']}})[_0x4c3f('0x25')](function(){return _0x4c508f;});})[_0x4c3f('0x25')](function(){_0x539e28[_0x4c3f('0x19')](0xcc)[_0x4c3f('0x1a')]();});}};}function handleEntityNotFound(_0x1ecbb5,_0x15c93f){return function(_0x3a9bc9){if(!_0x3a9bc9){_0x1ecbb5[_0x4c3f('0x18')](0x194);}return _0x3a9bc9;};}function handleError(_0x3eb51b,_0x5f4da5){_0x5f4da5=_0x5f4da5||0x1f4;return function(_0x2b20f3){logger[_0x4c3f('0x29')](_0x2b20f3[_0x4c3f('0x2a')]);if(_0x2b20f3['name']){delete _0x2b20f3['name'];}_0x3eb51b['status'](_0x5f4da5)[_0x4c3f('0x2b')](_0x2b20f3);};}exports[_0x4c3f('0x2c')]=function(_0xcb6555,_0x24586a){var _0x442f3d={},_0x33156a={},_0x532e9b={'count':0x0,'rows':[]};var _0x38e2b5=_['map'](db[_0x4c3f('0x2d')][_0x4c3f('0x2e')],function(_0x1421a4){return{'name':_0x1421a4['fieldName'],'type':_0x1421a4[_0x4c3f('0x2f')][_0x4c3f('0x30')]};});_0x33156a[_0x4c3f('0x31')]=_[_0x4c3f('0x32')](_0x38e2b5,_0x4c3f('0x33'));_0x33156a['query']=_[_0x4c3f('0x34')](_0xcb6555[_0x4c3f('0x35')]);_0x33156a[_0x4c3f('0x36')]=_['intersection'](_0x33156a[_0x4c3f('0x31')],_0x33156a[_0x4c3f('0x35')]);_0x442f3d[_0x4c3f('0x37')]=_[_0x4c3f('0x38')](_0x33156a['model'],qs[_0x4c3f('0x39')](_0xcb6555[_0x4c3f('0x35')][_0x4c3f('0x39')]));_0x442f3d[_0x4c3f('0x37')]=_0x442f3d['attributes'][_0x4c3f('0x3a')]?_0x442f3d['attributes']:_0x33156a['model'];if(!_0xcb6555['query'][_0x4c3f('0x3b')](_0x4c3f('0x3c'))){_0x442f3d[_0x4c3f('0x1d')]=qs[_0x4c3f('0x1d')](_0xcb6555['query'][_0x4c3f('0x1d')]);_0x442f3d[_0x4c3f('0x1c')]=qs[_0x4c3f('0x1c')](_0xcb6555[_0x4c3f('0x35')][_0x4c3f('0x1c')]);}_0x442f3d['order']=qs[_0x4c3f('0x3d')](_0xcb6555[_0x4c3f('0x35')]['sort']);delete _0xcb6555['query']['sort'];_0x442f3d[_0x4c3f('0x3e')]=qs[_0x4c3f('0x36')](_['pick'](_0xcb6555[_0x4c3f('0x35')],_0x33156a[_0x4c3f('0x36')]),_0x38e2b5);if(_0xcb6555[_0x4c3f('0x35')][_0x4c3f('0x3f')]){_0x442f3d[_0x4c3f('0x3e')]=_['merge'](_0x442f3d['where'],{'$or':_['map'](_0x38e2b5,function(_0x1d7f31){if(_0x1d7f31[_0x4c3f('0x2f')]!=='VIRTUAL'){var _0x18ffa3={};_0x18ffa3[_0x1d7f31[_0x4c3f('0x33')]]={'$like':'%'+_0xcb6555[_0x4c3f('0x35')]['filter']+'%'};return _0x18ffa3;}})});}_0x442f3d=_[_0x4c3f('0x40')]({},_0x442f3d,_0xcb6555[_0x4c3f('0x41')]);var _0x5d4dfb={'where':_0x442f3d['where']};return db['VoiceMusicOnHold'][_0x4c3f('0x1f')](_0x5d4dfb)[_0x4c3f('0x25')](function(_0x2800c9){_0x532e9b['count']=_0x2800c9;if(_0xcb6555[_0x4c3f('0x35')][_0x4c3f('0x42')]){_0x442f3d[_0x4c3f('0x43')]=[{'all':!![]}];}return db[_0x4c3f('0x2d')][_0x4c3f('0x44')](_0x442f3d);})[_0x4c3f('0x25')](function(_0x448ba6){_0x532e9b['rows']=_0x448ba6;return _0x532e9b;})['then'](respondWithFilteredResult(_0x24586a,_0x442f3d))['catch'](handleError(_0x24586a,null));};exports['show']=function(_0x2868ca,_0x2c8a20){var _0x39d83f={'raw':![],'where':{'id':_0x2868ca[_0x4c3f('0x45')]['id']}},_0x51e33e={};_0x51e33e['model']=_[_0x4c3f('0x34')](db[_0x4c3f('0x2d')][_0x4c3f('0x2e')]);_0x51e33e[_0x4c3f('0x35')]=_[_0x4c3f('0x34')](_0x2868ca[_0x4c3f('0x35')]);_0x51e33e[_0x4c3f('0x36')]=_[_0x4c3f('0x38')](_0x51e33e[_0x4c3f('0x31')],_0x51e33e[_0x4c3f('0x35')]);_0x39d83f['attributes']=_[_0x4c3f('0x38')](_0x51e33e[_0x4c3f('0x31')],qs[_0x4c3f('0x39')](_0x2868ca[_0x4c3f('0x35')][_0x4c3f('0x39')]));_0x39d83f['attributes']=_0x39d83f[_0x4c3f('0x37')][_0x4c3f('0x3a')]?_0x39d83f['attributes']:_0x51e33e[_0x4c3f('0x31')];if(_0x2868ca['query'][_0x4c3f('0x42')]){_0x39d83f[_0x4c3f('0x43')]=[{'all':!![]}];}_0x39d83f=_[_0x4c3f('0x40')]({},_0x39d83f,_0x2868ca['options']);return db[_0x4c3f('0x2d')][_0x4c3f('0x46')](_0x39d83f)[_0x4c3f('0x25')](handleEntityNotFound(_0x2c8a20,null))[_0x4c3f('0x25')](respondWithResult(_0x2c8a20,null))['catch'](handleError(_0x2c8a20,null));};exports[_0x4c3f('0x47')]=function(_0x114882,_0x4b9c56){if(_0x114882[_0x4c3f('0x48')]['id']){delete _0x114882[_0x4c3f('0x48')]['id'];}return db[_0x4c3f('0x2d')][_0x4c3f('0x46')]({'where':{'id':_0x114882[_0x4c3f('0x45')]['id']}})[_0x4c3f('0x25')](handleEntityNotFound(_0x4b9c56,null))[_0x4c3f('0x25')](saveUpdates(_0x114882['body'],null))[_0x4c3f('0x25')](respondWithResult(_0x4b9c56,null))[_0x4c3f('0x49')](handleError(_0x4b9c56,null));};exports[_0x4c3f('0x4a')]=function(_0x1477a2,_0x4134ac,_0x385dbf){return db['sequelize'][_0x4c3f('0x4b')](function(_0x4e94a8){if(_0x1477a2[_0x4c3f('0x48')]['mode']===_0x4c3f('0x4c')){_0x1477a2[_0x4c3f('0x48')][_0x4c3f('0x4d')]=path[_0x4c3f('0x4e')](config[_0x4c3f('0x4f')],_0x4c3f('0x50'),_0x1477a2['body']['name']);}return db['VoiceMusicOnHold'][_0x4c3f('0x4a')](_0x1477a2[_0x4c3f('0x48')],{'transaction':_0x4e94a8})['then'](function(_0x1acd36){if(_0x1477a2['body'][_0x4c3f('0x51')]===_0x4c3f('0x4c')){fs['mkdirSync'](_0x1acd36['directory'],parseInt(_0x4c3f('0x52'),0x8));}var _0x19fbb8=_0x1477a2['user'][_0x4c3f('0x26')]({'plain':!![]});if(!_0x19fbb8)throw new Error(_0x4c3f('0x53'));if(_0x19fbb8[_0x4c3f('0x54')]===_0x4c3f('0x55')){var _0x292662=_0x1acd36[_0x4c3f('0x26')]({'plain':!![]});return db[_0x4c3f('0x56')][_0x4c3f('0x46')]({'where':{'name':_0x4c3f('0x27'),'userProfileId':_0x19fbb8[_0x4c3f('0x57')]},'raw':!![]})[_0x4c3f('0x25')](function(_0x2cbebf){if(_0x2cbebf&&_0x2cbebf['autoAssociation']===0x0){return db[_0x4c3f('0x28')][_0x4c3f('0x4a')]({'name':_0x292662[_0x4c3f('0x33')],'resourceId':_0x292662['id'],'type':_0x2cbebf[_0x4c3f('0x33')],'sectionId':_0x2cbebf['id']},{})['then'](function(){return _0x1acd36;});}else{return _0x1acd36;}})[_0x4c3f('0x49')](function(_0x546b31){logger[_0x4c3f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x546b31);});}return _0x1acd36;});})[_0x4c3f('0x25')](respondWithResult(_0x4134ac,0xc9))[_0x4c3f('0x49')](handleError(_0x4134ac,null));};exports[_0x4c3f('0x58')]=function(_0x5ea345,_0x289a00,_0x5ce804){var _0x660579;return db[_0x4c3f('0x2d')][_0x4c3f('0x46')]({'where':{'id':_0x5ea345[_0x4c3f('0x45')]['id']}})[_0x4c3f('0x25')](function(_0x11a337){if(_0x11a337){return db[_0x4c3f('0x59')][_0x4c3f('0x4b')](function(_0xfeb5b9){return _0x11a337[_0x4c3f('0x58')]({'transaction':_0xfeb5b9,'raw':!![]})[_0x4c3f('0x25')](function(_0x38a4e7){if(_0x38a4e7['directory']){fs[_0x4c3f('0x5a')](_0x38a4e7[_0x4c3f('0x4d')])[_0x4c3f('0x5b')](function(_0x21d1ca){fs['unlinkSync'](path[_0x4c3f('0x4e')](_0x38a4e7[_0x4c3f('0x4d')],_0x21d1ca));});fs[_0x4c3f('0x5c')](_0x38a4e7[_0x4c3f('0x4d')]);}return _0x38a4e7;});})[_0x4c3f('0x49')](function(_0x7994e1){throw new db[(_0x4c3f('0x5d'))]['ValidationError'](_0x7994e1[_0x4c3f('0x5e')]);});}})[_0x4c3f('0x25')](handleEntityNotFound(_0x289a00,null))[_0x4c3f('0x25')](removeEntity(_0x289a00,null))[_0x4c3f('0x49')](handleError(_0x289a00,null));};exports[_0x4c3f('0x5f')]=function(_0x45c4ee,_0x3de5c7,_0x3e6dc1){return db[_0x4c3f('0x59')][_0x4c3f('0x4b')](function(_0x4aebe6){var _0x2d3140;return db[_0x4c3f('0x2d')]['find']({'where':{'id':_0x45c4ee[_0x4c3f('0x45')]['id']}})[_0x4c3f('0x25')](function(_0x1be8a4){if(_0x1be8a4){_0x2d3140=_0x1be8a4;return _0x1be8a4[_0x4c3f('0x5f')](_0x45c4ee[_0x4c3f('0x48')]['id'],{'transaction':_0x4aebe6});}})[_0x4c3f('0x25')](function(_0xe3df29){if(_0xe3df29){return db[_0x4c3f('0x60')][_0x4c3f('0x61')]({'where':{'id':_0x45c4ee['body']['id']},'attributes':['id','name',_0x4c3f('0x62'),_0x4c3f('0x63'),_0x4c3f('0x64')],'raw':!![]});}})[_0x4c3f('0x25')](function(_0x13fa9e){if(_0x13fa9e){var _0x79e917=path[_0x4c3f('0x4e')](config[_0x4c3f('0x4f')],'server/files/sounds/converted',util[_0x4c3f('0x65')](_0x4c3f('0x66'),path[_0x4c3f('0x67')](_0x13fa9e[_0x4c3f('0x62')],path[_0x4c3f('0x68')](_0x13fa9e[_0x4c3f('0x62')])),_0x13fa9e[_0x4c3f('0x63')]));var _0x378a12=path[_0x4c3f('0x4e')](config[_0x4c3f('0x4f')],_0x4c3f('0x50'),_0x2d3140[_0x4c3f('0x33')],util[_0x4c3f('0x65')](_0x4c3f('0x66'),_0x13fa9e[_0x4c3f('0x33')],_0x13fa9e[_0x4c3f('0x63')]));fs[_0x4c3f('0x69')](_0x79e917,_0x378a12);return _0x13fa9e;}})[_0x4c3f('0x49')](function(_0x32874a){throw new db[(_0x4c3f('0x5d'))][(_0x4c3f('0x6a'))](_0x32874a[_0x4c3f('0x5e')]);});})[_0x4c3f('0x25')](handleEntityNotFound(_0x3de5c7,null))[_0x4c3f('0x25')](respondWithResult(_0x3de5c7,0xc9))[_0x4c3f('0x49')](handleError(_0x3de5c7,null));};exports[_0x4c3f('0x6b')]=function(_0x48b6ef,_0x243d9e,_0xe2a228){return db[_0x4c3f('0x59')]['transaction'](function(_0x47dfa3){var _0x3fb921;return db[_0x4c3f('0x2d')][_0x4c3f('0x61')]({'where':{'id':_0x48b6ef[_0x4c3f('0x45')]['id']}})[_0x4c3f('0x25')](handleEntityNotFound(_0x243d9e,null))['then'](function(_0x28f932){if(_0x28f932){_0x3fb921=_0x28f932;return _0x28f932['removeSound'](_0x48b6ef[_0x4c3f('0x45')][_0x4c3f('0x6c')]);}})[_0x4c3f('0x25')](function(_0x457770){if(_0x457770){return db[_0x4c3f('0x60')][_0x4c3f('0x61')]({'where':{'id':_0x48b6ef[_0x4c3f('0x45')][_0x4c3f('0x6c')]},'attributes':['id','name',_0x4c3f('0x62'),_0x4c3f('0x63'),_0x4c3f('0x64')],'raw':!![]});}})['then'](function(_0x25b835){if(_0x25b835){fs['unlinkSync'](path['join'](_0x3fb921[_0x4c3f('0x4d')],util[_0x4c3f('0x65')](_0x4c3f('0x66'),_0x25b835[_0x4c3f('0x33')],_0x25b835[_0x4c3f('0x63')])));return _0x25b835;}})[_0x4c3f('0x49')](function(_0x581938){throw new db[(_0x4c3f('0x5d'))][(_0x4c3f('0x6a'))](_0x581938['message']);});})[_0x4c3f('0x25')](handleEntityNotFound(_0x243d9e,null))[_0x4c3f('0x25')](respondWithStatusCode(_0x243d9e,0xcc))[_0x4c3f('0x49')](handleError(_0x243d9e,null));};exports[_0x4c3f('0x6d')]=function(_0x453955,_0x3a9753,_0x49048d){var _0x5d7506={};var _0xa4a3e6={};var _0x200df5;var _0xb80d78;return db[_0x4c3f('0x2d')]['findOne']({'where':{'id':_0x453955[_0x4c3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a9753,null))[_0x4c3f('0x25')](function(_0x51d23b){if(_0x51d23b){_0x200df5=_0x51d23b;_0xa4a3e6[_0x4c3f('0x31')]=_[_0x4c3f('0x34')](db['Sound'][_0x4c3f('0x2e')]);_0xa4a3e6['query']=_[_0x4c3f('0x34')](_0x453955[_0x4c3f('0x35')]);_0xa4a3e6['filters']=_[_0x4c3f('0x38')](_0xa4a3e6[_0x4c3f('0x31')],_0xa4a3e6['query']);_0x5d7506[_0x4c3f('0x37')]=_[_0x4c3f('0x38')](_0xa4a3e6['model'],qs['fields'](_0x453955[_0x4c3f('0x35')]['fields']));_0x5d7506[_0x4c3f('0x37')]=_0x5d7506[_0x4c3f('0x37')]['length']?_0x5d7506['attributes']:_0xa4a3e6['model'];_0x5d7506[_0x4c3f('0x6e')]=qs['sort'](_0x453955[_0x4c3f('0x35')][_0x4c3f('0x3d')]);_0x5d7506[_0x4c3f('0x3e')]=qs[_0x4c3f('0x36')](_['pick'](_0x453955[_0x4c3f('0x35')],_0xa4a3e6[_0x4c3f('0x36')]));if(_0x453955[_0x4c3f('0x35')][_0x4c3f('0x3f')]){_0x5d7506[_0x4c3f('0x3e')]=_[_0x4c3f('0x40')](_0x5d7506[_0x4c3f('0x3e')],{'$or':_[_0x4c3f('0x32')](_0x5d7506[_0x4c3f('0x37')],function(_0x2f3352){var _0x18847d={};_0x18847d[_0x2f3352]={'$like':'%'+_0x453955['query'][_0x4c3f('0x3f')]+'%'};return _0x18847d;})});}_0x5d7506=_[_0x4c3f('0x40')]({},_0x5d7506,_0x453955[_0x4c3f('0x41')]);return _0x200df5[_0x4c3f('0x6d')](_0x5d7506);}})[_0x4c3f('0x25')](function(_0x471427){if(_0x471427){_0xb80d78=_0x471427['length'];if(!_0x453955['query'][_0x4c3f('0x3b')](_0x4c3f('0x3c'))){_0x5d7506[_0x4c3f('0x1d')]=qs[_0x4c3f('0x1d')](_0x453955[_0x4c3f('0x35')][_0x4c3f('0x1d')]);_0x5d7506[_0x4c3f('0x1c')]=qs[_0x4c3f('0x1c')](_0x453955[_0x4c3f('0x35')][_0x4c3f('0x1c')]);}return _0x200df5[_0x4c3f('0x6d')](_0x5d7506);}})[_0x4c3f('0x25')](function(_0x2b797c){if(_0x2b797c){return _0x2b797c?{'count':_0xb80d78,'rows':_0x2b797c}:null;}})[_0x4c3f('0x25')](respondWithResult(_0x3a9753,null))[_0x4c3f('0x49')](handleError(_0x3a9753,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index dc042e3..055b048 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 _0x5a76=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5a76,0x15c));var _0x65a7=function(_0xbbc377,_0x5e1219){_0xbbc377=_0xbbc377-0x0;var _0x778d71=_0x5a76[_0xbbc377];return _0x778d71;};'use strict';var _=require(_0x65a7('0x0'));var util=require(_0x65a7('0x1'));var logger=require(_0x65a7('0x2'))(_0x65a7('0x3'));var moment=require(_0x65a7('0x4'));var BPromise=require(_0x65a7('0x5'));var rp=require(_0x65a7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x65a7('0x7'));var attributes=require(_0x65a7('0x8'));module['exports']=function(_0x2f9dc8,_0x3c2a12){return _0x2f9dc8[_0x65a7('0x9')](_0x65a7('0xa'),attributes,{'tableName':_0x65a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41d4=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','voice_musiconhold','lodash','util'];(function(_0x336d90,_0x5b23ff){var _0x18e582=function(_0x3f5150){while(--_0x3f5150){_0x336d90['push'](_0x336d90['shift']());}};_0x18e582(++_0x5b23ff);}(_0x41d4,0x6a));var _0x441d=function(_0x5d723a,_0x2c45eb){_0x5d723a=_0x5d723a-0x0;var _0x298403=_0x41d4[_0x5d723a];return _0x298403;};'use strict';var _=require(_0x441d('0x0'));var util=require(_0x441d('0x1'));var logger=require(_0x441d('0x2'))(_0x441d('0x3'));var moment=require(_0x441d('0x4'));var BPromise=require(_0x441d('0x5'));var rp=require(_0x441d('0x6'));var fs=require('fs');var path=require(_0x441d('0x7'));var rimraf=require('rimraf');var config=require(_0x441d('0x8'));var attributes=require(_0x441d('0x9'));module[_0x441d('0xa')]=function(_0x5dec42,_0x513d55){return _0x5dec42['define']('VoiceMusicOnHold',attributes,{'tableName':_0x441d('0xb'),'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 02f2438..ec36e46 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2866d8,_0x31d03a){var _0x44828c=function(_0x52867d){while(--_0x52867d){_0x2866d8['push'](_0x2866d8['shift']());}};_0x44828c(++_0x31d03a);}(_0x70e0,0x17b));var _0x070e=function(_0x825a6d,_0x454089){_0x825a6d=_0x825a6d-0x0;var _0x366515=_0x70e0[_0x825a6d];return _0x366515;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x428302,_0x2f3bc6){var _0x30f45b=function(_0x13b96f){while(--_0x13b96f){_0x428302['push'](_0x428302['shift']());}};_0x30f45b(++_0x2f3bc6);}(_0xedd9,0xfc));var _0x9edd=function(_0x593f07,_0x2b62f9){_0x593f07=_0x593f07-0x0;var _0x1fb4ff=_0xedd9[_0x593f07];return _0x1fb4ff;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e2c6b54..a3459b5 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 _0xfb82=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','/:id/teams','post','create','addAgents','put','delete','destroy','multer'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xfb82,0x17f));var _0x2fb8=function(_0x3e8a4c,_0x47f49d){_0x3e8a4c=_0x3e8a4c-0x0;var _0x257575=_0xfb82[_0x3e8a4c];return _0x257575;};'use strict';var multer=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var path=require(_0x2fb8('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb8('0x3'));var router=express[_0x2fb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fb8('0x5'));var interaction=require(_0x2fb8('0x6'));var config=require(_0x2fb8('0x7'));var controller=require(_0x2fb8('0x8'));router[_0x2fb8('0x9')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xb')]);router[_0x2fb8('0x9')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller['describe']);router[_0x2fb8('0x9')](_0x2fb8('0xd'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xe')]);router[_0x2fb8('0x9')](_0x2fb8('0xf'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x10')]);router[_0x2fb8('0x9')](_0x2fb8('0x11'),auth[_0x2fb8('0xa')](),controller['getTeams']);router[_0x2fb8('0x12')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x13')]);router[_0x2fb8('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x2fb8('0x14')]);router['post'](_0x2fb8('0x11'),auth[_0x2fb8('0xa')](),controller['addTeams']);router[_0x2fb8('0x15')](_0x2fb8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2fb8('0x16')](_0x2fb8('0xd'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x17')]);router['delete'](_0x2fb8('0xf'),auth[_0x2fb8('0xa')](),controller['removeAgents']);router[_0x2fb8('0x16')](_0x2fb8('0x11'),auth[_0x2fb8('0xa')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file +var _0x4ce6=['/:id/teams','getTeams','post','create','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users'];(function(_0x288fd0,_0x1ff437){var _0x2f08a8=function(_0x58ec5a){while(--_0x58ec5a){_0x288fd0['push'](_0x288fd0['shift']());}};_0x2f08a8(++_0x1ff437);}(_0x4ce6,0x108));var _0x64ce=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x4ce6[_0x57cb4f];return _0x29bb45;};'use strict';var multer=require(_0x64ce('0x0'));var util=require('util');var path=require(_0x64ce('0x1'));var timeout=require(_0x64ce('0x2'));var express=require(_0x64ce('0x3'));var router=express[_0x64ce('0x4')]();var fs_extra=require(_0x64ce('0x5'));var auth=require(_0x64ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x64ce('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x64ce('0x8')](),controller[_0x64ce('0x9')]);router['get'](_0x64ce('0xa'),auth[_0x64ce('0x8')](),controller[_0x64ce('0xb')]);router[_0x64ce('0xc')](_0x64ce('0xd'),auth[_0x64ce('0x8')](),controller[_0x64ce('0xe')]);router[_0x64ce('0xc')](_0x64ce('0xf'),auth[_0x64ce('0x8')](),controller['getAgents']);router[_0x64ce('0xc')](_0x64ce('0x10'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x11')]);router[_0x64ce('0x12')]('/',auth[_0x64ce('0x8')](),controller[_0x64ce('0x13')]);router[_0x64ce('0x12')]('/:id/users',auth[_0x64ce('0x8')](),controller['addAgents']);router['post'](_0x64ce('0x10'),auth['isAuthenticated'](),controller[_0x64ce('0x14')]);router[_0x64ce('0x15')](_0x64ce('0xd'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x16')]);router[_0x64ce('0x17')](_0x64ce('0xd'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x64ce('0x19')]);router[_0x64ce('0x17')](_0x64ce('0x10'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x1a')]);module[_0x64ce('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b24c985..2562d2e 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 _0xbe5f=['getDataValue','sequelize','exports','name','VIRTUAL','system-'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xbe5f,0xa9));var _0xfbe5=function(_0x5e13c2,_0x4e6aa2){_0x5e13c2=_0x5e13c2-0x0;var _0x47ba12=_0xbe5f[_0x5e13c2];return _0x47ba12;};'use strict';var Sequelize=require(_0xfbe5('0x0'));module[_0xfbe5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfbe5('0x2')},'prefix':{'type':Sequelize[_0xfbe5('0x3')],'get':function(_0x4b0b1b){return _0xfbe5('0x4')+this[_0xfbe5('0x5')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7ec9=['INTEGER','sequelize','exports','STRING','VIRTUAL','system-','getDataValue','name'];(function(_0x5af237,_0x296f23){var _0x48309a=function(_0x8dfd2d){while(--_0x8dfd2d){_0x5af237['push'](_0x5af237['shift']());}};_0x48309a(++_0x296f23);}(_0x7ec9,0x161));var _0x97ec=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x7ec9[_0x575057];return _0x49dbc8;};'use strict';var Sequelize=require(_0x97ec('0x0'));module[_0x97ec('0x1')]={'name':{'type':Sequelize[_0x97ec('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x97ec('0x3')],'get':function(_0x2025e2){return _0x97ec('0x4')+this[_0x97ec('0x5')](_0x97ec('0x6'))+'-';}},'description':{'type':Sequelize[_0x97ec('0x2')]},'callerIdAll':{'type':Sequelize[_0x97ec('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x97ec('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4249d27..584038b 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 _0x5204=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','filter','findOne','Team','getTeams','Agents','online','voicePause','interface','flatMap','addTeams','TeamVoicePrefix','each','UserVoicePrefix','findOrCreate','forEach','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeTeams','isEmpty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','name','index','map','VoicePrefix','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x2e64be,_0x45850e){var _0x44ef39=function(_0x27becf){while(--_0x27becf){_0x2e64be['push'](_0x2e64be['shift']());}};_0x44ef39(++_0x45850e);}(_0x5204,0xdf));var _0x4520=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x5204[_0x2605dc];return _0x4568c9;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4520('0x2'));var rp=require(_0x4520('0x3'));var moment=require(_0x4520('0x4'));var BPromise=require(_0x4520('0x5'));var Mustache=require(_0x4520('0x6'));var util=require('util');var path=require(_0x4520('0x7'));var sox=require('sox');var csv=require(_0x4520('0x8'));var ejs=require(_0x4520('0x9'));var fs=require('fs');var fs_extra=require(_0x4520('0xa'));var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x8'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var licenseUtil=require(_0x4520('0x19'));var db=require(_0x4520('0x1a'))['db'];config[_0x4520('0x1b')]=_[_0x4520('0x1c')](config[_0x4520('0x1b')],{'host':_0x4520('0x1d'),'port':0x18eb});var socket=require(_0x4520('0x1e'))(new Redis(config[_0x4520('0x1b')]));require(_0x4520('0x1f'))[_0x4520('0x20')](socket);function respondWithStatusCode(_0x32950a,_0x48b3e7){_0x48b3e7=_0x48b3e7||0xcc;return function(_0x3e53e5){if(_0x3e53e5){return _0x32950a[_0x4520('0x21')](_0x48b3e7);}return _0x32950a[_0x4520('0x22')](_0x48b3e7)[_0x4520('0x23')]();};}function respondWithResult(_0x32d8aa,_0x51d85f){_0x51d85f=_0x51d85f||0xc8;return function(_0x2c1805){if(_0x2c1805){return _0x32d8aa[_0x4520('0x22')](_0x51d85f)[_0x4520('0x24')](_0x2c1805);}};}function respondWithFilteredResult(_0x283ad4,_0x1b8b0f){return function(_0x2e00f4){if(_0x2e00f4){var _0x1dcf51=typeof _0x1b8b0f[_0x4520('0x25')]===_0x4520('0x26')&&typeof _0x1b8b0f[_0x4520('0x27')]===_0x4520('0x26');var _0x460521=_0x2e00f4['count'];var _0xc016a3=_0x1dcf51?0x0:_0x1b8b0f['offset'];var _0x5ceff6=_0x1dcf51?_0x2e00f4['count']:_0x1b8b0f[_0x4520('0x25')]+_0x1b8b0f['limit'];var _0x39e196;if(_0x5ceff6>=_0x460521){_0x5ceff6=_0x460521;_0x39e196=0xc8;}else{_0x39e196=0xce;}_0x283ad4[_0x4520('0x22')](_0x39e196);return _0x283ad4[_0x4520('0x28')]('Content-Range',_0xc016a3+'-'+_0x5ceff6+'/'+_0x460521)[_0x4520('0x24')](_0x2e00f4);}return null;};}function patchUpdates(_0x4000d4){return function(_0x3b2ede){try{jsonpatch['apply'](_0x3b2ede,_0x4000d4,!![]);}catch(_0x198c34){return BPromise[_0x4520('0x29')](_0x198c34);}return _0x3b2ede[_0x4520('0x2a')]();};}function saveUpdates(_0x3a4680,_0x2a8528){return function(_0x552da1){if(_0x552da1){return _0x552da1[_0x4520('0x2b')](_0x3a4680)[_0x4520('0x2c')](function(_0x3532aa){return _0x3532aa;});}return null;};}function removeEntity(_0x3e2906,_0x57306b){return function(_0x336c63){if(_0x336c63){return _0x336c63[_0x4520('0x2d')]()[_0x4520('0x2c')](function(){var _0x21e1f3=_0x336c63[_0x4520('0x2e')]({'plain':!![]});var _0x2c95ea=_0x4520('0x2f');return db[_0x4520('0x30')][_0x4520('0x2d')]({'where':{'type':_0x2c95ea,'resourceId':_0x21e1f3['id']}})[_0x4520('0x2c')](function(){return _0x336c63;});})['then'](function(){_0x3e2906[_0x4520('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7ce8d2,_0x14778a){return function(_0x43b4a2){if(!_0x43b4a2){_0x7ce8d2[_0x4520('0x21')](0x194);}return _0x43b4a2;};}function handleError(_0x1da740,_0x4751d1){_0x4751d1=_0x4751d1||0x1f4;return function(_0x5bb163){logger[_0x4520('0x31')](_0x5bb163['stack']);if(_0x5bb163[_0x4520('0x32')]){delete _0x5bb163['name'];}_0x1da740[_0x4520('0x22')](_0x4751d1)['send'](_0x5bb163);};}exports[_0x4520('0x33')]=function(_0x4e6a5f,_0x5087dc){var _0x18d6e9={},_0x14cbb5={},_0x24d5b9={'count':0x0,'rows':[]};var _0x4af381=_[_0x4520('0x34')](db[_0x4520('0x35')][_0x4520('0x36')],function(_0x2ad47f){return{'name':_0x2ad47f['fieldName'],'type':_0x2ad47f['type'][_0x4520('0x37')]};});_0x14cbb5[_0x4520('0x38')]=_['map'](_0x4af381,_0x4520('0x32'));_0x14cbb5[_0x4520('0x39')]=_[_0x4520('0x3a')](_0x4e6a5f[_0x4520('0x39')]);_0x14cbb5[_0x4520('0x3b')]=_[_0x4520('0x3c')](_0x14cbb5['model'],_0x14cbb5[_0x4520('0x39')]);_0x18d6e9[_0x4520('0x3d')]=_['intersection'](_0x14cbb5[_0x4520('0x38')],qs['fields'](_0x4e6a5f[_0x4520('0x39')][_0x4520('0x3e')]));_0x18d6e9['attributes']=_0x18d6e9['attributes']['length']?_0x18d6e9[_0x4520('0x3d')]:_0x14cbb5[_0x4520('0x38')];if(!_0x4e6a5f[_0x4520('0x39')][_0x4520('0x3f')](_0x4520('0x40'))){_0x18d6e9[_0x4520('0x27')]=qs[_0x4520('0x27')](_0x4e6a5f['query'][_0x4520('0x27')]);_0x18d6e9[_0x4520('0x25')]=qs[_0x4520('0x25')](_0x4e6a5f['query'][_0x4520('0x25')]);}_0x18d6e9[_0x4520('0x41')]=qs['sort'](_0x4e6a5f['query'][_0x4520('0x42')]);_0x18d6e9[_0x4520('0x43')]=qs[_0x4520('0x3b')](_[_0x4520('0x44')](_0x4e6a5f[_0x4520('0x39')],_0x14cbb5['filters']),_0x4af381);if(_0x4e6a5f['query']['filter']){_0x18d6e9[_0x4520('0x43')]=_['merge'](_0x18d6e9[_0x4520('0x43')],{'$or':_['map'](_0x4af381,function(_0x517fcb){if(_0x517fcb[_0x4520('0x45')]!==_0x4520('0x46')){var _0x2e005d={};_0x2e005d[_0x517fcb[_0x4520('0x32')]]={'$like':'%'+_0x4e6a5f[_0x4520('0x39')]['filter']+'%'};return _0x2e005d;}})});}_0x18d6e9=_[_0x4520('0x47')]({},_0x18d6e9,_0x4e6a5f[_0x4520('0x48')]);var _0x4a39d4={'where':_0x18d6e9['where']};return db[_0x4520('0x35')][_0x4520('0x49')](_0x4a39d4)['then'](function(_0x2978d5){_0x24d5b9[_0x4520('0x49')]=_0x2978d5;if(_0x4e6a5f[_0x4520('0x39')][_0x4520('0x4a')]){_0x18d6e9['include']=[{'all':!![]}];}return db[_0x4520('0x35')][_0x4520('0x4b')](_0x18d6e9);})[_0x4520('0x2c')](function(_0xb92e25){_0x24d5b9[_0x4520('0x4c')]=_0xb92e25;return _0x24d5b9;})[_0x4520('0x2c')](respondWithFilteredResult(_0x5087dc,_0x18d6e9))[_0x4520('0x4d')](handleError(_0x5087dc,null));};exports[_0x4520('0x4e')]=function(_0x3a2b55,_0x6c07fe){var _0x1e6ac0={'raw':![],'where':{'id':_0x3a2b55[_0x4520('0x4f')]['id']}},_0x199565={};_0x199565[_0x4520('0x38')]=_[_0x4520('0x3a')](db[_0x4520('0x35')][_0x4520('0x36')]);_0x199565['query']=_[_0x4520('0x3a')](_0x3a2b55[_0x4520('0x39')]);_0x199565['filters']=_['intersection'](_0x199565['model'],_0x199565['query']);_0x1e6ac0[_0x4520('0x3d')]=_['intersection'](_0x199565[_0x4520('0x38')],qs[_0x4520('0x3e')](_0x3a2b55[_0x4520('0x39')][_0x4520('0x3e')]));_0x1e6ac0[_0x4520('0x3d')]=_0x1e6ac0[_0x4520('0x3d')][_0x4520('0x50')]?_0x1e6ac0[_0x4520('0x3d')]:_0x199565[_0x4520('0x38')];if(_0x3a2b55[_0x4520('0x39')][_0x4520('0x4a')]){_0x1e6ac0[_0x4520('0x51')]=[{'all':!![]}];}_0x1e6ac0=_[_0x4520('0x47')]({},_0x1e6ac0,_0x3a2b55[_0x4520('0x48')]);return db[_0x4520('0x35')][_0x4520('0x52')](_0x1e6ac0)[_0x4520('0x2c')](handleEntityNotFound(_0x6c07fe,null))[_0x4520('0x2c')](respondWithResult(_0x6c07fe,null))['catch'](handleError(_0x6c07fe,null));};exports['destroy']=function(_0x2f14c1,_0x29e14c){return db[_0x4520('0x35')]['find']({'where':{'id':_0x2f14c1[_0x4520('0x4f')]['id']}})[_0x4520('0x2c')](handleEntityNotFound(_0x29e14c,null))[_0x4520('0x2c')](removeEntity(_0x29e14c,null))['catch'](handleError(_0x29e14c,null));};exports[_0x4520('0x53')]=function(_0x2eb8c2,_0x32d950){return db['VoicePrefix']['describe']()[_0x4520('0x2c')](respondWithResult(_0x32d950,null))[_0x4520('0x4d')](handleError(_0x32d950,null));};exports[_0x4520('0x54')]=function(_0x379da4,_0x2d37ed){var _0x1549cc;return db[_0x4520('0x55')][_0x4520('0x56')](function(_0x4d30d3){return db[_0x4520('0x35')][_0x4520('0x54')](_0x379da4[_0x4520('0x57')],{'transaction':_0x4d30d3})[_0x4520('0x2c')](function(_0xff7d4b){_0x1549cc=_0xff7d4b[_0x4520('0x2e')]({'plain':!![]});return db[_0x4520('0x58')][_0x4520('0x52')]({'where':{'id':_0x1549cc[_0x4520('0x59')]},'raw':!![]})[_0x4520('0x2c')](function(_0x381e0b){return createVoicePrefixExtensions(_0x1549cc,_0x381e0b,_0x4d30d3);});});})[_0x4520('0x2c')](function(){var _0x2f11d9=_0x379da4[_0x4520('0x5a')][_0x4520('0x2e')]({'plain':!![]});if(!_0x2f11d9)throw new Error(_0x4520('0x5b'));if(_0x2f11d9[_0x4520('0x5c')]==='user'){var _0x52bb6c=_0x1549cc;return db[_0x4520('0x5d')][_0x4520('0x52')]({'where':{'name':_0x4520('0x2f'),'userProfileId':_0x2f11d9[_0x4520('0x5e')]},'raw':!![]})[_0x4520('0x2c')](function(_0x2f071e){if(_0x2f071e&&_0x2f071e['autoAssociation']===0x0){return db[_0x4520('0x30')][_0x4520('0x54')]({'name':_0x52bb6c['name'],'resourceId':_0x52bb6c['id'],'type':_0x2f071e[_0x4520('0x32')],'sectionId':_0x2f071e['id']},{})[_0x4520('0x2c')](function(){return _0x1549cc;});}else{return _0x1549cc;}})[_0x4520('0x4d')](function(_0x325edb){logger['error'](_0x4520('0x5f'),_0x325edb);throw _0x325edb;});}return _0x1549cc;})[_0x4520('0x2c')](respondWithResult(_0x2d37ed,null))['catch'](handleError(_0x2d37ed,null));};function Extension(_0x4c7172,_0x347130,_0x83cac1,_0xe07bd0){this[_0x4520('0x60')]=_0x4520('0x61');this[_0x4520('0x62')]=_0x4c7172;this['app']=_0x83cac1;this[_0x4520('0x45')]=_0x4520('0x63');this[_0x4520('0x64')]=_0x4520('0x65');this['priority']=_0x347130;this[_0x4520('0x66')]=_0xe07bd0;}function createVoicePrefixExtensions(_0x26f172,_0x4c9108,_0x20a517){return new BPromise(function(_0x5a55d6,_0x7215a3){var _0xadedd0=new Extension(formatPrefixName(_0x26f172[_0x4520('0x67')]),0x1,_0x4520('0x68'),'Voice\x20Prefix');_0xadedd0[_0x4520('0x69')]=_0x26f172['id'];return db[_0x4520('0x58')][_0x4520('0x54')](_0xadedd0,{'transaction':_0x20a517})[_0x4520('0x2c')](function(_0x4b6f71){var _0x28a0fd=_0x4b6f71[_0x4520('0x2e')]({'plain':!![]});var _0x3c7b9e=_[_0x4520('0x34')](addVoicePrefixExtensions(_0x26f172,_0x4c9108),function(_0x196763){_0x196763[_0x4520('0x59')]=_0x28a0fd['id'];_0x196763['VoicePrefixId']=_0x26f172['id'];return _0x196763;});return db[_0x4520('0x58')]['bulkCreate'](_0x3c7b9e,{'transaction':_0x20a517})[_0x4520('0x2c')](function(_0x22e363){if(!_0x22e363){return _0x7215a3(_0x4520('0x6a'));}else{return _0x5a55d6(_0x22e363);}})[_0x4520('0x4d')](function(_0x393da3){return _0x7215a3(_0x393da3);});});;});};function addVoicePrefixExtensions(_0x41a204,_0x5d100c){var _0x4d5085=[];var _0xa7461b=formatPrefixName(_0x41a204['prefix']);_0x4d5085[_0x4520('0x6b')](new Extension(_0xa7461b,0x2,_0x4520('0x6c'),_0x4520('0x6d')+_0x41a204[_0x4520('0x32')]));if(_0x41a204[_0x4520('0x6e')]){_0x4d5085[_0x4520('0x6b')](new Extension(_0xa7461b,0x3,_0x4520('0x6c'),_0x4520('0x6f')+_0x41a204[_0x4520('0x6e')]));}else{_0x4d5085['push'](new Extension(_0xa7461b,0x3,_0x4520('0x68'),'No\x20callerid\x20available'));}_0x4d5085[_0x4520('0x6b')](new Extension(_0xa7461b,0x4,_0x4520('0x70'),_0x5d100c[_0x4520('0x60')]+','+_0x4520('0x71')+(0x8+_0x41a204[_0x4520('0x32')]['length'])+'}'+','+0x1));return _0x4d5085;}function formatPrefixName(_0x1f7ccb){var _0x375f5d='_';for(var _0x3892fa=0x0;_0x3892fa<_0x1f7ccb[_0x4520('0x50')];_0x3892fa++){if(_0x1f7ccb['charAt'](_0x3892fa)=='-'){_0x375f5d+=_0x1f7ccb['charAt'](_0x3892fa);}else{_0x375f5d+='['+_0x1f7ccb['charAt'](_0x3892fa)+']';}}_0x375f5d+='.';return _0x375f5d;}exports[_0x4520('0x2b')]=function(_0x14bd13,_0x390835,_0x5cf8b9){var _0x2842dc=_0x14bd13[_0x4520('0x57')];_0x2842dc[_0x4520('0x67')]=_0x4520('0x72')+_0x2842dc[_0x4520('0x32')]+'-';return db['sequelize'][_0x4520('0x56')](function(_0x3fa1ac){return db[_0x4520('0x35')]['update'](_0x2842dc,{'where':{'id':_0x2842dc['id']},'transaction':_0x3fa1ac})[_0x4520('0x2c')](function(){return db[_0x4520('0x58')][_0x4520('0x2d')]({'where':{'VoicePrefixId':_0x2842dc['id']},'transaction':_0x3fa1ac})[_0x4520('0x2c')](function(){return db[_0x4520('0x58')][_0x4520('0x52')]({'where':{'id':_0x2842dc[_0x4520('0x59')]},'raw':!![]})[_0x4520('0x2c')](function(_0x524942){return createVoicePrefixExtensions(_0x2842dc,_0x524942,_0x3fa1ac);});});});})['then'](function(){return db[_0x4520('0x35')][_0x4520('0x73')](_0x2842dc['id']);})['then'](respondWithResult(_0x390835,null))[_0x4520('0x4d')](handleError(_0x390835,null));};exports['addAgents']=function(_0x2d2f31,_0x231843,_0x536e21){return db[_0x4520('0x35')][_0x4520('0x52')]({'where':{'id':_0x2d2f31['params']['id']}})[_0x4520('0x2c')](handleEntityNotFound(_0x231843,null))[_0x4520('0x2c')](function(_0x5330cf){if(_0x5330cf){return _0x5330cf[_0x4520('0x74')](_0x2d2f31[_0x4520('0x57')][_0x4520('0x75')],_['omit'](_0x2d2f31[_0x4520('0x57')],[_0x4520('0x75'),'id'])||{})[_0x4520('0x76')](function(_0x17d595){for(var _0x2d21e9=0x0;_0x2d21e9<_0x2d2f31[_0x4520('0x57')][_0x4520('0x75')][_0x4520('0x50')];_0x2d21e9+=0x1){socket[_0x4520('0x77')](_0x4520('0x78'),{'UserId':Number(_0x2d2f31[_0x4520('0x57')][_0x4520('0x75')][_0x2d21e9]),'VoicePrefixId':Number(_0x2d2f31['params']['id'])});}return _0x17d595;});}})['then'](respondWithResult(_0x231843,null))[_0x4520('0x4d')](handleError(_0x231843,null));};exports['removeAgents']=function(_0x15b5ae,_0x15fb9c,_0x17c779){return db[_0x4520('0x35')][_0x4520('0x52')]({'where':{'id':_0x15b5ae['params']['id']}})['then'](handleEntityNotFound(_0x15fb9c,null))[_0x4520('0x2c')](function(_0x2f4226){if(_0x2f4226){return _0x2f4226[_0x4520('0x79')](_0x15b5ae[_0x4520('0x39')][_0x4520('0x75')])[_0x4520('0x2c')](function(){if(_['isArray'](_0x15b5ae[_0x4520('0x39')][_0x4520('0x75')])){for(var _0x55f3ab=0x0;_0x55f3ab<_0x15b5ae[_0x4520('0x39')]['ids']['length'];_0x55f3ab+=0x1){socket['emit'](_0x4520('0x7a'),{'UserId':Number(_0x15b5ae[_0x4520('0x39')][_0x4520('0x75')][_0x55f3ab]),'VoicePrefixId':Number(_0x15b5ae[_0x4520('0x4f')]['id'])});}}else{socket[_0x4520('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x15b5ae[_0x4520('0x39')][_0x4520('0x75')]),'VoicePrefixId':Number(_0x15b5ae['params']['id'])});}});}})['then'](respondWithStatusCode(_0x15fb9c,null))[_0x4520('0x4d')](handleError(_0x15fb9c,null));};exports[_0x4520('0x7b')]=function(_0x34b640,_0x539644,_0xc9bc2){var _0x341b55={};var _0x1df90c={};var _0x4866b5;var _0x80496a;return db[_0x4520('0x35')]['findOne']({'where':{'id':_0x34b640[_0x4520('0x4f')]['id']}})['then'](handleEntityNotFound(_0x539644,null))[_0x4520('0x2c')](function(_0x388177){if(_0x388177){_0x4866b5=_0x388177;_0x1df90c[_0x4520('0x38')]=_[_0x4520('0x3a')](db[_0x4520('0x7c')][_0x4520('0x36')]);_0x1df90c[_0x4520('0x39')]=_['keys'](_0x34b640[_0x4520('0x39')]);_0x1df90c['filters']=_[_0x4520('0x3c')](_0x1df90c[_0x4520('0x38')],_0x1df90c['query']);_0x341b55[_0x4520('0x3d')]=_[_0x4520('0x3c')](_0x1df90c[_0x4520('0x38')],qs[_0x4520('0x3e')](_0x34b640[_0x4520('0x39')][_0x4520('0x3e')]));_0x341b55[_0x4520('0x3d')]=_0x341b55[_0x4520('0x3d')][_0x4520('0x50')]?_0x341b55[_0x4520('0x3d')]:_0x1df90c[_0x4520('0x38')];_0x341b55['order']=qs['sort'](_0x34b640['query']['sort']);_0x341b55['where']=qs[_0x4520('0x3b')](_[_0x4520('0x44')](_0x34b640[_0x4520('0x39')],_0x1df90c[_0x4520('0x3b')]));if(_0x34b640['query'][_0x4520('0x7d')]){_0x341b55['where']=_[_0x4520('0x47')](_0x341b55['where'],{'$or':_[_0x4520('0x34')](_0x341b55['attributes'],function(_0x2b334a){var _0x2e08ab={};_0x2e08ab[_0x2b334a]={'$like':'%'+_0x34b640[_0x4520('0x39')][_0x4520('0x7d')]+'%'};return _0x2e08ab;})});}_0x341b55=_['merge']({},_0x341b55,_0x34b640[_0x4520('0x48')]);return _0x4866b5['getAgents'](_0x341b55);}})[_0x4520('0x2c')](function(_0x322d47){if(_0x322d47){_0x80496a=_0x322d47[_0x4520('0x50')];if(!_0x34b640[_0x4520('0x39')][_0x4520('0x3f')]('nolimit')){_0x341b55[_0x4520('0x27')]=qs[_0x4520('0x27')](_0x34b640['query'][_0x4520('0x27')]);_0x341b55[_0x4520('0x25')]=qs['offset'](_0x34b640[_0x4520('0x39')]['offset']);}return _0x4866b5['getAgents'](_0x341b55);}})[_0x4520('0x2c')](function(_0x39af12){if(_0x39af12){return _0x39af12?{'count':_0x80496a,'rows':_0x39af12}:null;}})['then'](respondWithResult(_0x539644,null))[_0x4520('0x4d')](handleError(_0x539644,null));};exports['getTeams']=function(_0x2739c5,_0x3b29de,_0x41b2d7){var _0x1ea71c={};var _0x47273c={};var _0x1c5bf5;var _0x1079e1;return db[_0x4520('0x35')][_0x4520('0x7e')]({'where':{'id':_0x2739c5[_0x4520('0x4f')]['id']}})[_0x4520('0x2c')](handleEntityNotFound(_0x3b29de,null))[_0x4520('0x2c')](function(_0x42a394){if(_0x42a394){_0x1c5bf5=_0x42a394;_0x47273c[_0x4520('0x38')]=_['keys'](db[_0x4520('0x7f')][_0x4520('0x36')]);_0x47273c['query']=_[_0x4520('0x3a')](_0x2739c5[_0x4520('0x39')]);_0x47273c['filters']=_[_0x4520('0x3c')](_0x47273c[_0x4520('0x38')],_0x47273c[_0x4520('0x39')]);_0x1ea71c[_0x4520('0x3d')]=_[_0x4520('0x3c')](_0x47273c[_0x4520('0x38')],qs['fields'](_0x2739c5[_0x4520('0x39')][_0x4520('0x3e')]));_0x1ea71c[_0x4520('0x3d')]=_0x1ea71c[_0x4520('0x3d')][_0x4520('0x50')]?_0x1ea71c['attributes']:_0x47273c['model'];_0x1ea71c[_0x4520('0x41')]=qs[_0x4520('0x42')](_0x2739c5[_0x4520('0x39')][_0x4520('0x42')]);_0x1ea71c[_0x4520('0x43')]=qs[_0x4520('0x3b')](_[_0x4520('0x44')](_0x2739c5[_0x4520('0x39')],_0x47273c[_0x4520('0x3b')]));if(_0x2739c5[_0x4520('0x39')]['filter']){_0x1ea71c[_0x4520('0x43')]=_[_0x4520('0x47')](_0x1ea71c['where'],{'$or':_[_0x4520('0x34')](_0x1ea71c[_0x4520('0x3d')],function(_0x54d969){var _0x14724f={};_0x14724f[_0x54d969]={'$like':'%'+_0x2739c5[_0x4520('0x39')]['filter']+'%'};return _0x14724f;})});}_0x1ea71c=_['merge']({},_0x1ea71c,_0x2739c5[_0x4520('0x48')]);return _0x1c5bf5[_0x4520('0x80')](_0x1ea71c);}})[_0x4520('0x2c')](function(_0xf3ef3f){if(_0xf3ef3f){_0x1079e1=_0xf3ef3f['length'];if(!_0x2739c5[_0x4520('0x39')][_0x4520('0x3f')](_0x4520('0x40'))){_0x1ea71c[_0x4520('0x27')]=qs[_0x4520('0x27')](_0x2739c5[_0x4520('0x39')][_0x4520('0x27')]);_0x1ea71c[_0x4520('0x25')]=qs[_0x4520('0x25')](_0x2739c5['query'][_0x4520('0x25')]);}return _0x1c5bf5[_0x4520('0x80')](_0x1ea71c);}})[_0x4520('0x2c')](function(_0x5e273e){if(_0x5e273e){return _0x5e273e?{'count':_0x1079e1,'rows':_0x5e273e}:null;}})['then'](respondWithResult(_0x3b29de,null))[_0x4520('0x4d')](handleError(_0x3b29de,null));};exports['addTeams']=function(_0x770d66,_0xe8aa53,_0xd57838){var _0x12b063=_0x770d66[_0x4520('0x57')][_0x4520('0x75')];var _0x1b2c01;return db[_0x4520('0x7f')][_0x4520('0x4b')]({'where':{'id':_0x12b063},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4520('0x81'),'attributes':['id',_0x4520('0x32'),_0x4520('0x82'),_0x4520('0x83'),_0x4520('0x84')],'raw':!![]}]})[_0x4520('0x2c')](function(_0x3d21a1){if(_0x3d21a1){_0x1b2c01=_0x3d21a1;var _0x53acec=_[_0x4520('0x85')](_0x3d21a1,function(_0x249502){var _0x3780ad=_0x249502[_0x4520('0x2e')]({'plain':!![]});return _0x3780ad[_0x4520('0x81')];});return db['VoicePrefix']['find']({'where':{'id':_0x770d66[_0x4520('0x4f')]['id']}})[_0x4520('0x2c')](function(_0x36b481){return db['sequelize']['transaction'](function(_0x321c4b){return _0x36b481[_0x4520('0x86')](_0x12b063,{'transaction':_0x321c4b})[_0x4520('0x2c')](function(){return BPromise['each'](_0x1b2c01,function(_0x509de6){return db[_0x4520('0x87')]['upsert']({'TeamId':_0x509de6['id'],'VoicePrefixId':_0x770d66[_0x4520('0x4f')]['id']},{'transaction':_0x321c4b});});})[_0x4520('0x2c')](function(){return BPromise[_0x4520('0x88')](_0x53acec,function(_0x3c5501){return db[_0x4520('0x89')][_0x4520('0x8a')]({'where':{'UserId':_0x3c5501['id'],'VoicePrefixId':_0x770d66[_0x4520('0x4f')]['id']},'transaction':_0x321c4b});});})[_0x4520('0x2c')](function(){_0x53acec[_0x4520('0x8b')](function(_0x3eb1fd){socket['emit'](_0x4520('0x78'),{'UserId':_0x3eb1fd['id'],'VoicePrefixId':_0x36b481['id']});});});});});}})['then'](respondWithStatusCode(_0xe8aa53,null))[_0x4520('0x4d')](handleError(_0xe8aa53,null));};exports['removeTeams']=function(_0x3262ef,_0x31ab69,_0x245180){return db[_0x4520('0x7f')]['findAll']({'where':{'id':_0x3262ef[_0x4520('0x39')][_0x4520('0x75')]},'attributes':['id'],'include':[{'model':db[_0x4520('0x7c')],'as':_0x4520('0x81'),'attributes':['id'],'raw':!![]}]})[_0x4520('0x2c')](handleEntityNotFound(_0x31ab69,null))[_0x4520('0x2c')](function(_0x22a5cd){var _0x4d108f=_[_0x4520('0x34')](_0x22a5cd,'id');var _0x56f398=[];var _0x4ab423=[];var _0x320603=squel['select']();_0x320603[_0x4520('0x8c')](_0x4520('0x8d'))[_0x4520('0x8e')](_0x4520('0x8f'),'tq')[_0x4520('0x90')](_0x4520('0x91'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4520('0x43')](_0x4520('0x92'),_0x3262ef[_0x4520('0x4f')]['id']);for(var _0x353b3e=0x0;_0x353b3e<_0x22a5cd['length'];_0x353b3e+=0x1){let _0x21bb01=_0x22a5cd[_0x353b3e];for(var _0x4e7421=0x0;_0x4e7421<_0x21bb01[_0x4520('0x81')][_0x4520('0x50')];_0x4e7421+=0x1){let _0x490a08=_0x21bb01[_0x4520('0x81')][_0x4e7421];var _0x1872d2=_0x320603[_0x4520('0x93')]();_0x1872d2['where'](_0x4520('0x94'),_0x490a08['id']);_0x4ab423[_0x4520('0x6b')](db['sequelize'][_0x4520('0x39')](_0x1872d2[_0x4520('0x95')](),{'type':db[_0x4520('0x55')][_0x4520('0x96')][_0x4520('0x97')]})['then'](function(_0x7058b0){if(_0x7058b0[_0x4520('0x50')]===0x1){return _0x490a08['id'];}else{var _0x3398e2=_['every'](_[_0x4520('0x34')](_0x7058b0,'TeamId'),function(_0x408dff){return _[_0x4520('0x98')](_0x4d108f,_0x408dff);});if(_0x3398e2){return _0x490a08['id'];}}}));}}return BPromise[_0x4520('0x99')](_0x4ab423)[_0x4520('0x2c')](function(_0x2f0c56){_0x56f398=_(_0x56f398)[_0x4520('0x9a')](_0x2f0c56)[_0x4520('0x9b')]()[_0x4520('0x9c')]();return db[_0x4520('0x35')]['find']({'where':{'id':_0x3262ef[_0x4520('0x4f')]['id']}})[_0x4520('0x2c')](function(_0x4b7ffd){return db['sequelize'][_0x4520('0x56')](function(_0x11709d){return _0x4b7ffd[_0x4520('0x9d')](_0x3262ef[_0x4520('0x39')][_0x4520('0x75')],{'transaction':_0x11709d})[_0x4520('0x2c')](function(){if(!_[_0x4520('0x9e')](_0x56f398)){return _0x4b7ffd[_0x4520('0x79')](_0x56f398,{'transaction':_0x11709d});}})[_0x4520('0x2c')](function(){_0x56f398[_0x4520('0x8b')](function(_0x43e7c7){socket['emit'](_0x4520('0x7a'),{'UserId':_0x43e7c7,'VoicePrefixId':_0x4b7ffd['id']});});});});});});})[_0x4520('0x2c')](respondWithStatusCode(_0x31ab69,null))[_0x4520('0x4d')](handleError(_0x31ab69,null));}; \ No newline at end of file +var _0xfff0=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voicePrefix.socket','register','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','sendStatus','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','find','catch','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','removeTeams','isEmpty','rimraf','zip-dir','fast-json-patch'];(function(_0x2644dd,_0x39d79e){var _0x4dad81=function(_0x4acbef){while(--_0x4acbef){_0x2644dd['push'](_0x2644dd['shift']());}};_0x4dad81(++_0x39d79e);}(_0xfff0,0x139));var _0x0fff=function(_0x44bb30,_0x10f818){_0x44bb30=_0x44bb30-0x0;var _0x400e23=_0xfff0[_0x44bb30];return _0x400e23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];config[_0x0fff('0x19')]=_['defaults'](config[_0x0fff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0x1a'))(new Redis(config[_0x0fff('0x19')]));require(_0x0fff('0x1b'))[_0x0fff('0x1c')](socket);function respondWithStatusCode(_0x55e5fa,_0x53bde9){_0x53bde9=_0x53bde9||0xcc;return function(_0x1daf30){if(_0x1daf30){return _0x55e5fa['sendStatus'](_0x53bde9);}return _0x55e5fa['status'](_0x53bde9)['end']();};}function respondWithResult(_0x1fb430,_0x41e2e7){_0x41e2e7=_0x41e2e7||0xc8;return function(_0x5eab2e){if(_0x5eab2e){return _0x1fb430[_0x0fff('0x1d')](_0x41e2e7)[_0x0fff('0x1e')](_0x5eab2e);}};}function respondWithFilteredResult(_0x540a67,_0x528071){return function(_0x48f36d){if(_0x48f36d){var _0x2337f=typeof _0x528071[_0x0fff('0x1f')]===_0x0fff('0x20')&&typeof _0x528071[_0x0fff('0x21')]===_0x0fff('0x20');var _0xe89b4a=_0x48f36d['count'];var _0x44a54a=_0x2337f?0x0:_0x528071[_0x0fff('0x1f')];var _0x48e6f9=_0x2337f?_0x48f36d['count']:_0x528071['offset']+_0x528071[_0x0fff('0x21')];var _0x330e29;if(_0x48e6f9>=_0xe89b4a){_0x48e6f9=_0xe89b4a;_0x330e29=0xc8;}else{_0x330e29=0xce;}_0x540a67[_0x0fff('0x1d')](_0x330e29);return _0x540a67[_0x0fff('0x22')]('Content-Range',_0x44a54a+'-'+_0x48e6f9+'/'+_0xe89b4a)[_0x0fff('0x1e')](_0x48f36d);}return null;};}function patchUpdates(_0x2f8665){return function(_0x29d703){try{jsonpatch[_0x0fff('0x23')](_0x29d703,_0x2f8665,!![]);}catch(_0x16e7f4){return BPromise[_0x0fff('0x24')](_0x16e7f4);}return _0x29d703['save']();};}function saveUpdates(_0x6a116c,_0x29f702){return function(_0x37e090){if(_0x37e090){return _0x37e090[_0x0fff('0x25')](_0x6a116c)[_0x0fff('0x26')](function(_0x23d9f8){return _0x23d9f8;});}return null;};}function removeEntity(_0x482e1e,_0x2c9725){return function(_0x87b3a6){if(_0x87b3a6){return _0x87b3a6[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){var _0x36d268=_0x87b3a6[_0x0fff('0x28')]({'plain':!![]});var _0x27bd76=_0x0fff('0x29');return db[_0x0fff('0x2a')][_0x0fff('0x27')]({'where':{'type':_0x27bd76,'resourceId':_0x36d268['id']}})[_0x0fff('0x26')](function(){return _0x87b3a6;});})[_0x0fff('0x26')](function(){_0x482e1e['status'](0xcc)[_0x0fff('0x2b')]();});}};}function handleEntityNotFound(_0x2d1800,_0x17ab6f){return function(_0x42441e){if(!_0x42441e){_0x2d1800[_0x0fff('0x2c')](0x194);}return _0x42441e;};}function handleError(_0x125844,_0x47dde0){_0x47dde0=_0x47dde0||0x1f4;return function(_0x31f9a4){logger[_0x0fff('0x2d')](_0x31f9a4[_0x0fff('0x2e')]);if(_0x31f9a4['name']){delete _0x31f9a4[_0x0fff('0x2f')];}_0x125844[_0x0fff('0x1d')](_0x47dde0)['send'](_0x31f9a4);};}exports[_0x0fff('0x30')]=function(_0x433de6,_0x15bb46){var _0x15ae24={},_0x25ab2a={},_0x263e9e={'count':0x0,'rows':[]};var _0x1da352=_[_0x0fff('0x31')](db[_0x0fff('0x32')][_0x0fff('0x33')],function(_0x58469b){return{'name':_0x58469b[_0x0fff('0x34')],'type':_0x58469b[_0x0fff('0x35')][_0x0fff('0x36')]};});_0x25ab2a[_0x0fff('0x37')]=_[_0x0fff('0x31')](_0x1da352,'name');_0x25ab2a['query']=_[_0x0fff('0x38')](_0x433de6[_0x0fff('0x39')]);_0x25ab2a[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x25ab2a['model'],_0x25ab2a[_0x0fff('0x39')]);_0x15ae24[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x25ab2a[_0x0fff('0x37')],qs['fields'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x15ae24[_0x0fff('0x3c')]=_0x15ae24[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x15ae24[_0x0fff('0x3c')]:_0x25ab2a[_0x0fff('0x37')];if(!_0x433de6[_0x0fff('0x39')][_0x0fff('0x3f')](_0x0fff('0x40'))){_0x15ae24[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x433de6['query'][_0x0fff('0x21')]);_0x15ae24[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x433de6[_0x0fff('0x39')][_0x0fff('0x1f')]);}_0x15ae24[_0x0fff('0x41')]=qs['sort'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x42')]);_0x15ae24[_0x0fff('0x43')]=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x433de6[_0x0fff('0x39')],_0x25ab2a[_0x0fff('0x3a')]),_0x1da352);if(_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]){_0x15ae24['where']=_[_0x0fff('0x46')](_0x15ae24['where'],{'$or':_[_0x0fff('0x31')](_0x1da352,function(_0x30f329){if(_0x30f329[_0x0fff('0x35')]!=='VIRTUAL'){var _0x5d4c24={};_0x5d4c24[_0x30f329[_0x0fff('0x2f')]]={'$like':'%'+_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]+'%'};return _0x5d4c24;}})});}_0x15ae24=_['merge']({},_0x15ae24,_0x433de6['options']);var _0x4668b3={'where':_0x15ae24['where']};return db[_0x0fff('0x32')][_0x0fff('0x47')](_0x4668b3)[_0x0fff('0x26')](function(_0x309d75){_0x263e9e[_0x0fff('0x47')]=_0x309d75;if(_0x433de6[_0x0fff('0x39')]['includeAll']){_0x15ae24[_0x0fff('0x48')]=[{'all':!![]}];}return db[_0x0fff('0x32')][_0x0fff('0x49')](_0x15ae24);})[_0x0fff('0x26')](function(_0x7157e5){_0x263e9e[_0x0fff('0x4a')]=_0x7157e5;return _0x263e9e;})[_0x0fff('0x26')](respondWithFilteredResult(_0x15bb46,_0x15ae24))['catch'](handleError(_0x15bb46,null));};exports[_0x0fff('0x4b')]=function(_0x244a27,_0x101b3a){var _0x56a121={'raw':![],'where':{'id':_0x244a27[_0x0fff('0x4c')]['id']}},_0x2de540={};_0x2de540[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x32')][_0x0fff('0x33')]);_0x2de540[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x244a27[_0x0fff('0x39')]);_0x2de540[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x2de540['model'],_0x2de540[_0x0fff('0x39')]);_0x56a121[_0x0fff('0x3c')]=_['intersection'](_0x2de540[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x244a27[_0x0fff('0x39')]['fields']));_0x56a121['attributes']=_0x56a121[_0x0fff('0x3c')]['length']?_0x56a121['attributes']:_0x2de540[_0x0fff('0x37')];if(_0x244a27[_0x0fff('0x39')][_0x0fff('0x4d')]){_0x56a121[_0x0fff('0x48')]=[{'all':!![]}];}_0x56a121=_[_0x0fff('0x46')]({},_0x56a121,_0x244a27[_0x0fff('0x4e')]);return db['VoicePrefix'][_0x0fff('0x4f')](_0x56a121)[_0x0fff('0x26')](handleEntityNotFound(_0x101b3a,null))[_0x0fff('0x26')](respondWithResult(_0x101b3a,null))[_0x0fff('0x50')](handleError(_0x101b3a,null));};exports[_0x0fff('0x27')]=function(_0x2c725c,_0x5d1739){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x2c725c['params']['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5d1739,null))['then'](removeEntity(_0x5d1739,null))['catch'](handleError(_0x5d1739,null));};exports['describe']=function(_0x218e1c,_0x30967c){return db[_0x0fff('0x32')][_0x0fff('0x51')]()[_0x0fff('0x26')](respondWithResult(_0x30967c,null))['catch'](handleError(_0x30967c,null));};exports[_0x0fff('0x52')]=function(_0x2c765f,_0x2cbe43){var _0x3b6c98;return db[_0x0fff('0x53')]['transaction'](function(_0x3b401c){return db[_0x0fff('0x32')][_0x0fff('0x52')](_0x2c765f[_0x0fff('0x54')],{'transaction':_0x3b401c})[_0x0fff('0x26')](function(_0x2e8242){_0x3b6c98=_0x2e8242[_0x0fff('0x28')]({'plain':!![]});return db[_0x0fff('0x55')][_0x0fff('0x4f')]({'where':{'id':_0x3b6c98[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x38168e){return createVoicePrefixExtensions(_0x3b6c98,_0x38168e,_0x3b401c);});});})[_0x0fff('0x26')](function(){var _0x2608be=_0x2c765f[_0x0fff('0x57')][_0x0fff('0x28')]({'plain':!![]});if(!_0x2608be)throw new Error(_0x0fff('0x58'));if(_0x2608be[_0x0fff('0x59')]===_0x0fff('0x57')){var _0x398513=_0x3b6c98;return db[_0x0fff('0x5a')]['find']({'where':{'name':_0x0fff('0x29'),'userProfileId':_0x2608be[_0x0fff('0x5b')]},'raw':!![]})[_0x0fff('0x26')](function(_0x2744b4){if(_0x2744b4&&_0x2744b4['autoAssociation']===0x0){return db[_0x0fff('0x2a')]['create']({'name':_0x398513[_0x0fff('0x2f')],'resourceId':_0x398513['id'],'type':_0x2744b4[_0x0fff('0x2f')],'sectionId':_0x2744b4['id']},{})[_0x0fff('0x26')](function(){return _0x3b6c98;});}else{return _0x3b6c98;}})[_0x0fff('0x50')](function(_0x4bf865){logger[_0x0fff('0x2d')](_0x0fff('0x5c'),_0x4bf865);throw _0x4bf865;});}return _0x3b6c98;})[_0x0fff('0x26')](respondWithResult(_0x2cbe43,null))[_0x0fff('0x50')](handleError(_0x2cbe43,null));};function Extension(_0x4cf619,_0x5ba7e7,_0x449da4,_0x40b8f0){this[_0x0fff('0x5d')]=_0x0fff('0x5e');this[_0x0fff('0x5f')]=_0x4cf619;this[_0x0fff('0x60')]=_0x449da4;this['type']='system';this[_0x0fff('0x61')]=_0x0fff('0x62');this[_0x0fff('0x63')]=_0x5ba7e7;this[_0x0fff('0x64')]=_0x40b8f0;}function createVoicePrefixExtensions(_0x28403f,_0x6a37c9,_0x33eb07){return new BPromise(function(_0x40e5ec,_0x5f2fcc){var _0x12fe95=new Extension(formatPrefixName(_0x28403f['prefix']),0x1,_0x0fff('0x65'),_0x0fff('0x66'));_0x12fe95[_0x0fff('0x67')]=_0x28403f['id'];return db['VoiceExtension']['create'](_0x12fe95,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x504212){var _0x140a35=_0x504212[_0x0fff('0x28')]({'plain':!![]});var _0x452160=_[_0x0fff('0x31')](addVoicePrefixExtensions(_0x28403f,_0x6a37c9),function(_0x4e3a31){_0x4e3a31[_0x0fff('0x56')]=_0x140a35['id'];_0x4e3a31[_0x0fff('0x67')]=_0x28403f['id'];return _0x4e3a31;});return db['VoiceExtension'][_0x0fff('0x68')](_0x452160,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x1111c8){if(!_0x1111c8){return _0x5f2fcc('Extensions\x20creation\x20failed');}else{return _0x40e5ec(_0x1111c8);}})[_0x0fff('0x50')](function(_0x1dc3d6){return _0x5f2fcc(_0x1dc3d6);});});;});};function addVoicePrefixExtensions(_0x1414af,_0x383d78){var _0x3bb183=[];var _0xf4fb1e=formatPrefixName(_0x1414af[_0x0fff('0x69')]);_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x2,_0x0fff('0x6b'),_0x0fff('0x6c')+_0x1414af[_0x0fff('0x2f')]));if(_0x1414af[_0x0fff('0x6d')]){_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,'Set',_0x0fff('0x6e')+_0x1414af['callerIdAll']));}else{_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,_0x0fff('0x65'),_0x0fff('0x6f')));}_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x4,'goto',_0x383d78['context']+','+_0x0fff('0x70')+(0x8+_0x1414af[_0x0fff('0x2f')][_0x0fff('0x3e')])+'}'+','+0x1));return _0x3bb183;}function formatPrefixName(_0x2586c6){var _0x5af278='_';for(var _0x2f865a=0x0;_0x2f865a<_0x2586c6[_0x0fff('0x3e')];_0x2f865a++){if(_0x2586c6[_0x0fff('0x71')](_0x2f865a)=='-'){_0x5af278+=_0x2586c6[_0x0fff('0x71')](_0x2f865a);}else{_0x5af278+='['+_0x2586c6['charAt'](_0x2f865a)+']';}}_0x5af278+='.';return _0x5af278;}exports[_0x0fff('0x25')]=function(_0x1858fb,_0x4c08c3,_0x51fbf5){var _0x33ed23=_0x1858fb[_0x0fff('0x54')];_0x33ed23[_0x0fff('0x69')]=_0x0fff('0x72')+_0x33ed23[_0x0fff('0x2f')]+'-';return db['sequelize'][_0x0fff('0x73')](function(_0x7b040){return db[_0x0fff('0x32')][_0x0fff('0x25')](_0x33ed23,{'where':{'id':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension'][_0x0fff('0x4f')]({'where':{'id':_0x33ed23[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x712db4){return createVoicePrefixExtensions(_0x33ed23,_0x712db4,_0x7b040);});});});})[_0x0fff('0x26')](function(){return db['VoicePrefix'][_0x0fff('0x74')](_0x33ed23['id']);})[_0x0fff('0x26')](respondWithResult(_0x4c08c3,null))[_0x0fff('0x50')](handleError(_0x4c08c3,null));};exports[_0x0fff('0x75')]=function(_0x31ff4e,_0x15ab8e,_0x38e2e9){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x31ff4e[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x15ab8e,null))['then'](function(_0x134012){if(_0x134012){return _0x134012[_0x0fff('0x75')](_0x31ff4e['body'][_0x0fff('0x76')],_['omit'](_0x31ff4e[_0x0fff('0x54')],[_0x0fff('0x76'),'id'])||{})[_0x0fff('0x77')](function(_0x8799c2){for(var _0x13d90e=0x0;_0x13d90e<_0x31ff4e['body'][_0x0fff('0x76')][_0x0fff('0x3e')];_0x13d90e+=0x1){socket['emit'](_0x0fff('0x78'),{'UserId':Number(_0x31ff4e[_0x0fff('0x54')][_0x0fff('0x76')][_0x13d90e]),'VoicePrefixId':Number(_0x31ff4e['params']['id'])});}return _0x8799c2;});}})[_0x0fff('0x26')](respondWithResult(_0x15ab8e,null))[_0x0fff('0x50')](handleError(_0x15ab8e,null));};exports['removeAgents']=function(_0x567544,_0x404b97,_0x49711a){return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x567544[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x404b97,null))['then'](function(_0x4f7282){if(_0x4f7282){return _0x4f7282[_0x0fff('0x79')](_0x567544['query'][_0x0fff('0x76')])[_0x0fff('0x26')](function(){if(_[_0x0fff('0x7a')](_0x567544[_0x0fff('0x39')][_0x0fff('0x76')])){for(var _0x1e940c=0x0;_0x1e940c<_0x567544[_0x0fff('0x39')]['ids'][_0x0fff('0x3e')];_0x1e940c+=0x1){socket[_0x0fff('0x7b')](_0x0fff('0x7c'),{'UserId':Number(_0x567544[_0x0fff('0x39')][_0x0fff('0x76')][_0x1e940c]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}}else{socket['emit'](_0x0fff('0x7c'),{'UserId':Number(_0x567544['query'][_0x0fff('0x76')]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}});}})[_0x0fff('0x26')](respondWithStatusCode(_0x404b97,null))[_0x0fff('0x50')](handleError(_0x404b97,null));};exports['getAgents']=function(_0x4fc7c7,_0x34dd99,_0x5baf7f){var _0x3d820e={};var _0x125b12={};var _0x5093fc;var _0x5b04f2;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x4fc7c7[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x34dd99,null))['then'](function(_0x407f0a){if(_0x407f0a){_0x5093fc=_0x407f0a;_0x125b12['model']=_[_0x0fff('0x38')](db[_0x0fff('0x7e')][_0x0fff('0x33')]);_0x125b12['query']=_['keys'](_0x4fc7c7['query']);_0x125b12[_0x0fff('0x3a')]=_['intersection'](_0x125b12[_0x0fff('0x37')],_0x125b12[_0x0fff('0x39')]);_0x3d820e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x125b12[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x3d820e[_0x0fff('0x3c')]=_0x3d820e[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x3d820e['attributes']:_0x125b12[_0x0fff('0x37')];_0x3d820e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x42')]);_0x3d820e['where']=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x4fc7c7['query'],_0x125b12[_0x0fff('0x3a')]));if(_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x45')]){_0x3d820e[_0x0fff('0x43')]=_[_0x0fff('0x46')](_0x3d820e[_0x0fff('0x43')],{'$or':_[_0x0fff('0x31')](_0x3d820e[_0x0fff('0x3c')],function(_0x40c4f3){var _0x1c059b={};_0x1c059b[_0x40c4f3]={'$like':'%'+_0x4fc7c7['query'][_0x0fff('0x45')]+'%'};return _0x1c059b;})});}_0x3d820e=_[_0x0fff('0x46')]({},_0x3d820e,_0x4fc7c7[_0x0fff('0x4e')]);return _0x5093fc[_0x0fff('0x7f')](_0x3d820e);}})[_0x0fff('0x26')](function(_0x2fdf96){if(_0x2fdf96){_0x5b04f2=_0x2fdf96[_0x0fff('0x3e')];if(!_0x4fc7c7['query'][_0x0fff('0x3f')]('nolimit')){_0x3d820e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x21')]);_0x3d820e[_0x0fff('0x1f')]=qs['offset'](_0x4fc7c7[_0x0fff('0x39')]['offset']);}return _0x5093fc['getAgents'](_0x3d820e);}})[_0x0fff('0x26')](function(_0x173b44){if(_0x173b44){return _0x173b44?{'count':_0x5b04f2,'rows':_0x173b44}:null;}})[_0x0fff('0x26')](respondWithResult(_0x34dd99,null))[_0x0fff('0x50')](handleError(_0x34dd99,null));};exports[_0x0fff('0x80')]=function(_0x3995b9,_0x5bc4e1,_0x50f95c){var _0x5b637e={};var _0x1bd02a={};var _0x41b755;var _0x4012aa;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x3995b9[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5bc4e1,null))[_0x0fff('0x26')](function(_0xed7e93){if(_0xed7e93){_0x41b755=_0xed7e93;_0x1bd02a[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x81')][_0x0fff('0x33')]);_0x1bd02a[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x3995b9[_0x0fff('0x39')]);_0x1bd02a[_0x0fff('0x3a')]=_['intersection'](_0x1bd02a[_0x0fff('0x37')],_0x1bd02a[_0x0fff('0x39')]);_0x5b637e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x1bd02a[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x3995b9[_0x0fff('0x39')]['fields']));_0x5b637e[_0x0fff('0x3c')]=_0x5b637e[_0x0fff('0x3c')]['length']?_0x5b637e[_0x0fff('0x3c')]:_0x1bd02a['model'];_0x5b637e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x3995b9['query']['sort']);_0x5b637e['where']=qs[_0x0fff('0x3a')](_['pick'](_0x3995b9['query'],_0x1bd02a['filters']));if(_0x3995b9['query'][_0x0fff('0x45')]){_0x5b637e['where']=_[_0x0fff('0x46')](_0x5b637e['where'],{'$or':_[_0x0fff('0x31')](_0x5b637e['attributes'],function(_0x465dde){var _0x9ca531={};_0x9ca531[_0x465dde]={'$like':'%'+_0x3995b9['query']['filter']+'%'};return _0x9ca531;})});}_0x5b637e=_[_0x0fff('0x46')]({},_0x5b637e,_0x3995b9[_0x0fff('0x4e')]);return _0x41b755[_0x0fff('0x80')](_0x5b637e);}})[_0x0fff('0x26')](function(_0x675250){if(_0x675250){_0x4012aa=_0x675250[_0x0fff('0x3e')];if(!_0x3995b9[_0x0fff('0x39')]['hasOwnProperty'](_0x0fff('0x40'))){_0x5b637e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x3995b9[_0x0fff('0x39')]['limit']);_0x5b637e[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x3995b9[_0x0fff('0x39')]['offset']);}return _0x41b755['getTeams'](_0x5b637e);}})[_0x0fff('0x26')](function(_0x37b5b4){if(_0x37b5b4){return _0x37b5b4?{'count':_0x4012aa,'rows':_0x37b5b4}:null;}})['then'](respondWithResult(_0x5bc4e1,null))[_0x0fff('0x50')](handleError(_0x5bc4e1,null));};exports[_0x0fff('0x82')]=function(_0x4ab665,_0x2ab827,_0x2a2af9){var _0x2ca40b=_0x4ab665['body']['ids'];var _0x2eeee9;return db[_0x0fff('0x81')]['findAll']({'where':{'id':_0x2ca40b},'attributes':['id'],'include':[{'model':db[_0x0fff('0x7e')],'as':_0x0fff('0x83'),'attributes':['id',_0x0fff('0x2f'),_0x0fff('0x84'),_0x0fff('0x85'),_0x0fff('0x86')],'raw':!![]}]})[_0x0fff('0x26')](function(_0x1b500a){if(_0x1b500a){_0x2eeee9=_0x1b500a;var _0x327b5=_[_0x0fff('0x87')](_0x1b500a,function(_0x10aa61){var _0xc99224=_0x10aa61['get']({'plain':!![]});return _0xc99224[_0x0fff('0x83')];});return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x4ab665['params']['id']}})[_0x0fff('0x26')](function(_0x5336){return db[_0x0fff('0x53')][_0x0fff('0x73')](function(_0x42fbff){return _0x5336[_0x0fff('0x82')](_0x2ca40b,{'transaction':_0x42fbff})['then'](function(){return BPromise[_0x0fff('0x88')](_0x2eeee9,function(_0x39565f){return db['TeamVoicePrefix'][_0x0fff('0x89')]({'TeamId':_0x39565f['id'],'VoicePrefixId':_0x4ab665['params']['id']},{'transaction':_0x42fbff});});})['then'](function(){return BPromise[_0x0fff('0x88')](_0x327b5,function(_0x2e38c3){return db[_0x0fff('0x8a')][_0x0fff('0x8b')]({'where':{'UserId':_0x2e38c3['id'],'VoicePrefixId':_0x4ab665[_0x0fff('0x4c')]['id']},'transaction':_0x42fbff});});})[_0x0fff('0x26')](function(){_0x327b5['forEach'](function(_0xe02ca6){socket[_0x0fff('0x7b')](_0x0fff('0x78'),{'UserId':_0xe02ca6['id'],'VoicePrefixId':_0x5336['id']});});});});});}})[_0x0fff('0x26')](respondWithStatusCode(_0x2ab827,null))[_0x0fff('0x50')](handleError(_0x2ab827,null));};exports['removeTeams']=function(_0x25e9f2,_0xf73eb6,_0x87df03){return db[_0x0fff('0x81')][_0x0fff('0x49')]({'where':{'id':_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fff('0x26')](handleEntityNotFound(_0xf73eb6,null))['then'](function(_0x2d206c){var _0x5ed120=_['map'](_0x2d206c,'id');var _0x592341=[];var _0x2e1625=[];var _0x128fe1=squel[_0x0fff('0x8c')]();_0x128fe1[_0x0fff('0x8d')](_0x0fff('0x8e'))['from'](_0x0fff('0x8f'),'tq')[_0x0fff('0x90')](_0x0fff('0x91'),'ut',_0x0fff('0x92'))[_0x0fff('0x43')](_0x0fff('0x93'),_0x25e9f2[_0x0fff('0x4c')]['id']);for(var _0x115445=0x0;_0x115445<_0x2d206c['length'];_0x115445+=0x1){let _0x596074=_0x2d206c[_0x115445];for(var _0x1f1946=0x0;_0x1f1946<_0x596074[_0x0fff('0x83')][_0x0fff('0x3e')];_0x1f1946+=0x1){let _0x47ff09=_0x596074[_0x0fff('0x83')][_0x1f1946];var _0x2ae986=_0x128fe1[_0x0fff('0x94')]();_0x2ae986['where'](_0x0fff('0x95'),_0x47ff09['id']);_0x2e1625[_0x0fff('0x6a')](db[_0x0fff('0x53')][_0x0fff('0x39')](_0x2ae986[_0x0fff('0x96')](),{'type':db[_0x0fff('0x53')][_0x0fff('0x97')]['SELECT']})['then'](function(_0x4a70ee){if(_0x4a70ee[_0x0fff('0x3e')]===0x1){return _0x47ff09['id'];}else{var _0x425412=_[_0x0fff('0x98')](_[_0x0fff('0x31')](_0x4a70ee,_0x0fff('0x99')),function(_0x41afce){return _['includes'](_0x5ed120,_0x41afce);});if(_0x425412){return _0x47ff09['id'];}}}));}}return BPromise[_0x0fff('0x9a')](_0x2e1625)[_0x0fff('0x26')](function(_0x7928f7){_0x592341=_(_0x592341)['union'](_0x7928f7)['compact']()[_0x0fff('0x9b')]();return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x25e9f2[_0x0fff('0x4c')]['id']}})['then'](function(_0x1bf39f){return db[_0x0fff('0x53')]['transaction'](function(_0xb6faf){return _0x1bf39f[_0x0fff('0x9c')](_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')],{'transaction':_0xb6faf})[_0x0fff('0x26')](function(){if(!_[_0x0fff('0x9d')](_0x592341)){return _0x1bf39f['removeAgents'](_0x592341,{'transaction':_0xb6faf});}})[_0x0fff('0x26')](function(){_0x592341['forEach'](function(_0xf72b2b){socket['emit'](_0x0fff('0x7c'),{'UserId':_0xf72b2b,'VoicePrefixId':_0x1bf39f['id']});});});});});});})['then'](respondWithStatusCode(_0xf73eb6,null))[_0x0fff('0x50')](handleError(_0xf73eb6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 932f643..0c580c7 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 _0x0ece=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xf35d3a,_0x22f631){var _0x27f031=function(_0x4c8810){while(--_0x4c8810){_0xf35d3a['push'](_0xf35d3a['shift']());}};_0x27f031(++_0x22f631);}(_0x0ece,0x188));var _0xe0ec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0ece[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xe0ec('0x0'));var VoicePrefix=require(_0xe0ec('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe0ec('0x2')](0x0);var events={'afterCreate':_0xe0ec('0x3'),'afterUpdate':_0xe0ec('0x4'),'afterDestroy':_0xe0ec('0x5')};function emitEvent(_0x8f9fb){return function(_0x18582c,_0x56a7a0,_0x18d2e2){VoicePrefixEvents[_0xe0ec('0x6')](_0x8f9fb+':'+_0x18582c['id'],_0x18582c);VoicePrefixEvents['emit'](_0x8f9fb,_0x18582c);_0x18d2e2(null);};}for(var e in events){if(events[_0xe0ec('0x7')](e)){var event=events[e];VoicePrefix[_0xe0ec('0x8')](e,emitEvent(event));}}module[_0xe0ec('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0xf970=['../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xae995c,_0x15b260){var _0x2d57a4=function(_0x4a5e43){while(--_0x4a5e43){_0xae995c['push'](_0xae995c['shift']());}};_0x2d57a4(++_0x15b260);}(_0xf970,0x1d3));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x0f97('0x0'));var VoicePrefix=require(_0x0f97('0x1'))['db'][_0x0f97('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0f97('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f97('0x4'),'afterDestroy':_0x0f97('0x5')};function emitEvent(_0x5c29f6){return function(_0x2e30a5,_0x3e257e,_0x336867){VoicePrefixEvents[_0x0f97('0x6')](_0x5c29f6+':'+_0x2e30a5['id'],_0x2e30a5);VoicePrefixEvents[_0x0f97('0x6')](_0x5c29f6,_0x2e30a5);_0x336867(null);};}for(var e in events){if(events[_0x0f97('0x7')](e)){var event=events[e];VoicePrefix[_0x0f97('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index c68eb5f..4dee221 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 _0xedd1=['api','bluebird','request-promise','path','./voicePrefix.attributes','exports','define'];(function(_0x370556,_0x11ef03){var _0x589cd3=function(_0x25aed8){while(--_0x25aed8){_0x370556['push'](_0x370556['shift']());}};_0x589cd3(++_0x11ef03);}(_0xedd1,0x134));var _0x1edd=function(_0x11e213,_0x4f2b14){_0x11e213=_0x11e213-0x0;var _0x504df2=_0xedd1[_0x11e213];return _0x504df2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1edd('0x0'));var moment=require('moment');var BPromise=require(_0x1edd('0x1'));var rp=require(_0x1edd('0x2'));var fs=require('fs');var path=require(_0x1edd('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1edd('0x4'));module[_0x1edd('0x5')]=function(_0x248569,_0x1bc6c8){return _0x248569[_0x1edd('0x6')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd9f=['../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','api','moment','path','rimraf'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xcd9f,0x95));var _0xfcd9=function(_0x5a4a6c,_0x1d29a0){_0x5a4a6c=_0x5a4a6c-0x0;var _0x4ba0a4=_0xcd9f[_0x5a4a6c];return _0x4ba0a4;};'use strict';var _=require('lodash');var util=require(_0xfcd9('0x0'));var logger=require('../../config/logger')(_0xfcd9('0x1'));var moment=require(_0xfcd9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcd9('0x3'));var rimraf=require(_0xfcd9('0x4'));var config=require(_0xfcd9('0x5'));var attributes=require(_0xfcd9('0x6'));module[_0xfcd9('0x7')]=function(_0x2d1f94,_0x23953c){return _0x2d1f94[_0xfcd9('0x8')](_0xfcd9('0x9'),attributes,{'tableName':_0xfcd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index be71249..b68cfeb 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 _0x6bfc=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','then','request\x20sent','debug','stringify','error','code','message','VoicePrefix,\x20%s,\x20%s','catch'];(function(_0x588418,_0x4b835e){var _0x46c15f=function(_0x478b76){while(--_0x478b76){_0x588418['push'](_0x588418['shift']());}};_0x46c15f(++_0x4b835e);}(_0x6bfc,0x159));var _0xc6bf=function(_0x188d9d,_0x1cad66){_0x188d9d=_0x188d9d-0x0;var _0x16e587=_0x6bfc[_0x188d9d];return _0x16e587;};'use strict';var _=require('lodash');var util=require(_0xc6bf('0x0'));var moment=require(_0xc6bf('0x1'));var BPromise=require(_0xc6bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6bf('0x4'));var logger=require('../../config/logger')(_0xc6bf('0x5'));var config=require(_0xc6bf('0x6'));var jayson=require(_0xc6bf('0x7'));var client=jayson['client'][_0xc6bf('0x8')]({'port':0x232a});config[_0xc6bf('0x9')]=_[_0xc6bf('0xa')](config[_0xc6bf('0x9')],{'host':_0xc6bf('0xb'),'port':0x18eb});var socket=require(_0xc6bf('0xc'))(new Redis(config[_0xc6bf('0x9')]));require(_0xc6bf('0xd'))['register'](socket);function respondWithRpcPromise(_0x3beb64,_0x39aa81,_0x1cb846){return new BPromise(function(_0x343148,_0x5f2f8f){return client['request'](_0x3beb64,_0x1cb846)[_0xc6bf('0xe')](function(_0x3e9c8a){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x39aa81,_0xc6bf('0xf'));logger[_0xc6bf('0x10')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x39aa81,_0xc6bf('0xf'),JSON[_0xc6bf('0x11')](_0x3e9c8a));if(_0x3e9c8a[_0xc6bf('0x12')]){if(_0x3e9c8a[_0xc6bf('0x12')][_0xc6bf('0x13')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x39aa81,_0x3e9c8a[_0xc6bf('0x12')][_0xc6bf('0x14')]);return _0x5f2f8f(_0x3e9c8a[_0xc6bf('0x12')][_0xc6bf('0x14')]);}logger[_0xc6bf('0x12')](_0xc6bf('0x15'),_0x39aa81,_0x3e9c8a[_0xc6bf('0x12')]['message']);return _0x343148(_0x3e9c8a[_0xc6bf('0x12')]['message']);}else{logger['info'](_0xc6bf('0x15'),_0x39aa81,_0xc6bf('0xf'));_0x343148(_0x3e9c8a['result'][_0xc6bf('0x14')]);}})[_0xc6bf('0x16')](function(_0x498c02){logger[_0xc6bf('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x39aa81,_0x498c02);_0x5f2f8f(_0x498c02);});});} \ No newline at end of file +var _0xaee6=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x328185,_0x1988ff){var _0x473eb9=function(_0x310b86){while(--_0x310b86){_0x328185['push'](_0x328185['shift']());}};_0x473eb9(++_0x1988ff);}(_0xaee6,0x187));var _0x6aee=function(_0x1e02dd,_0x255be9){_0x1e02dd=_0x1e02dd-0x0;var _0x3b1332=_0xaee6[_0x1e02dd];return _0x3b1332;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var moment=require(_0x6aee('0x2'));var BPromise=require(_0x6aee('0x3'));var rs=require(_0x6aee('0x4'));var fs=require('fs');var Redis=require(_0x6aee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6aee('0x6'));var logger=require(_0x6aee('0x7'))(_0x6aee('0x8'));var config=require('../../config/environment');var jayson=require(_0x6aee('0x9'));var client=jayson[_0x6aee('0xa')][_0x6aee('0xb')]({'port':0x232a});config[_0x6aee('0xc')]=_[_0x6aee('0xd')](config[_0x6aee('0xc')],{'host':_0x6aee('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6aee('0xf'))['register'](socket);function respondWithRpcPromise(_0x27a179,_0x2552ec,_0x1f81fa){return new BPromise(function(_0x57e596,_0xd99e94){return client[_0x6aee('0x10')](_0x27a179,_0x1f81fa)[_0x6aee('0x11')](function(_0x1092d9){logger['info'](_0x6aee('0x12'),_0x2552ec,'request\x20sent');logger[_0x6aee('0x13')](_0x6aee('0x14'),_0x2552ec,_0x6aee('0x15'),JSON[_0x6aee('0x16')](_0x1092d9));if(_0x1092d9[_0x6aee('0x17')]){if(_0x1092d9['error'][_0x6aee('0x18')]===0x1f4){logger[_0x6aee('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x2552ec,_0x1092d9['error'][_0x6aee('0x19')]);return _0xd99e94(_0x1092d9[_0x6aee('0x17')][_0x6aee('0x19')]);}logger[_0x6aee('0x17')](_0x6aee('0x12'),_0x2552ec,_0x1092d9[_0x6aee('0x17')][_0x6aee('0x19')]);return _0x57e596(_0x1092d9[_0x6aee('0x17')]['message']);}else{logger[_0x6aee('0x1a')](_0x6aee('0x12'),_0x2552ec,'request\x20sent');_0x57e596(_0x1092d9[_0x6aee('0x1b')][_0x6aee('0x19')]);}})['catch'](function(_0x1848a9){logger[_0x6aee('0x17')](_0x6aee('0x12'),_0x2552ec,_0x1848a9);_0xd99e94(_0x1848a9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d202c19..bf758c8 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 _0xb75c=['./voicePrefix.events','save','remove','emit','removeListener','length'];(function(_0x584780,_0x292308){var _0x4c6ad9=function(_0x475a64){while(--_0x475a64){_0x584780['push'](_0x584780['shift']());}};_0x4c6ad9(++_0x292308);}(_0xb75c,0x1ce));var _0xcb75=function(_0x497093,_0x27333f){_0x497093=_0x497093-0x0;var _0x464f0b=_0xb75c[_0x497093];return _0x464f0b;};'use strict';var VoicePrefixEvents=require(_0xcb75('0x0'));var events=[_0xcb75('0x1'),_0xcb75('0x2'),'update'];function createListener(_0x348403,_0x4da54f){return function(_0x21a350){_0x4da54f[_0xcb75('0x3')](_0x348403,_0x21a350);};}function removeListener(_0x390961,_0x4a39a6){return function(){VoicePrefixEvents[_0xcb75('0x4')](_0x390961,_0x4a39a6);};}exports['register']=function(_0x5f488c){for(var _0xb12187=0x0,_0x284ea6=events[_0xcb75('0x5')];_0xb12187<_0x284ea6;_0xb12187++){var _0x498656=events[_0xb12187];var _0x57ef56=createListener('voicePrefix:'+_0x498656,_0x5f488c);VoicePrefixEvents['on'](_0x498656,_0x57ef56);}}; \ No newline at end of file +var _0x9e5e=['removeListener','voicePrefix:','./voicePrefix.events','save','update','emit'];(function(_0x597bfd,_0x504109){var _0x555965=function(_0x2ee4ae){while(--_0x2ee4ae){_0x597bfd['push'](_0x597bfd['shift']());}};_0x555965(++_0x504109);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x9e5e[_0x45783c];return _0x1161da;};'use strict';var VoicePrefixEvents=require(_0xe9e5('0x0'));var events=[_0xe9e5('0x1'),'remove',_0xe9e5('0x2')];function createListener(_0x1d631c,_0x41408c){return function(_0x4c9784){_0x41408c[_0xe9e5('0x3')](_0x1d631c,_0x4c9784);};}function removeListener(_0x5c29f3,_0x396715){return function(){VoicePrefixEvents[_0xe9e5('0x4')](_0x5c29f3,_0x396715);};}exports['register']=function(_0x5c09f0){for(var _0xf4d974=0x0,_0x2333df=events['length'];_0xf4d974<_0x2333df;_0xf4d974++){var _0x3648a5=events[_0xf4d974];var _0x2533d8=createListener(_0xe9e5('0x5')+_0x3648a5,_0x5c09f0);VoicePrefixEvents['on'](_0x3648a5,_0x2533d8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 5e9c30e..d335441 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x2baf40,_0x5ebef2){var _0x2bb2cb=function(_0x1a3fc1){while(--_0x1a3fc1){_0x2baf40['push'](_0x2baf40['shift']());}};_0x2bb2cb(++_0x5ebef2);}(_0xb10b,0x12a));var _0xbb10=function(_0x35b7b3,_0x62c34e){_0x35b7b3=_0x35b7b3-0x0;var _0x5afb26=_0xb10b[_0x35b7b3];return _0x5afb26;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xb10b[_0x2ed8f3];return _0x525a55;};'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 1ac1e2c..976277f 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 _0x6281=['getDataValue','type','strategy','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','split','joinempty','leavewhenempty','join','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','UNSIGNED','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','ENUM','ringall','fewestcalls','random','rrmemory','linear','rrordered'];(function(_0x314c95,_0x132267){var _0x4b97d2=function(_0x20eb7f){while(--_0x20eb7f){_0x314c95['push'](_0x314c95['shift']());}};_0x4b97d2(++_0x132267);}(_0x6281,0x1de));var _0x1628=function(_0x5b0d6a,_0x42c4d9){_0x5b0d6a=_0x5b0d6a-0x0;var _0x57d965=_0x6281[_0x5b0d6a];return _0x57d965;};'use strict';var Sequelize=require(_0x1628('0x0'));module[_0x1628('0x1')]={'name':{'type':Sequelize[_0x1628('0x2')],'allowNull':![],'unique':_0x1628('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x1628('0x4'),_0x1628('0x5')),'allowNull':![],'defaultValue':_0x1628('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x1628('0x6')},'announce':{'type':Sequelize[_0x1628('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1628('0x7')]('rr',_0x1628('0x8'),'leastrecent',_0x1628('0x9'),_0x1628('0xa'),_0x1628('0xb'),_0x1628('0xc'),'wrandom',_0x1628('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3bf1ba){this['setDataValue']('strategy',_0x3bf1ba?_0x3bf1ba:_0x1628('0xb'));},'get':function(){var _0x178674=this[_0x1628('0xe')](_0x1628('0xf'));var _0xa831ee=this[_0x1628('0xe')]('dialMethod');var _0x4b1584=this[_0x1628('0xe')](_0x1628('0x10'));if(_0x178674===_0x1628('0x4')){return _0x4b1584;}if(_0xa831ee===_0x1628('0x11')&&_0x4b1584===_0x1628('0xb')||_0xa831ee===_0x1628('0x11')&&_0x4b1584==='roundrobin'){return _0x4b1584;}if(_0xa831ee===_0x1628('0x12')||_0xa831ee===_0x1628('0x13')||_0xa831ee===_0x1628('0x14')){return _0x4b1584;}return null;}},'servicelevel':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1628('0x15')](0xb)},'timeout':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1628('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no'),'defaultValue':_0x1628('0x16')},'autopause':{'type':Sequelize[_0x1628('0x7')]('yes','no',_0x1628('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1628('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x1628('0x7')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1628('0x7')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1628('0x7')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1628('0x7')]('yes','no'),'defaultValue':_0x1628('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x1628('0x16'),'no',_0x1628('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1628('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1628('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1628('0x2')]},'queue_youarenext':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1628('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1628('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1628('0x2')]},'queue_quantity1':{'type':Sequelize[_0x1628('0x2')]},'queue_quantity2':{'type':Sequelize[_0x1628('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x1628('0x2')]},'queue_less_than':{'type':Sequelize[_0x1628('0x2')]},'periodic_announce':{'type':Sequelize[_0x1628('0x19')],'set':function(_0x40f6a8){this[_0x1628('0x1a')]('periodic_announce',_0x40f6a8?_0x40f6a8['join'](','):[]);},'get':function(){return this[_0x1628('0xe')](_0x1628('0x1b'))?this[_0x1628('0xe')]('periodic_announce')[_0x1628('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x1628('0x2')],'defaultValue':_0x1628('0x16'),'set':function(_0x5961f7){this[_0x1628('0x1a')](_0x1628('0x1d'),_0x5961f7?_0x5961f7['join'](','):undefined);},'get':function(){return this[_0x1628('0xe')]('joinempty')?this[_0x1628('0xe')](_0x1628('0x1d'))[_0x1628('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1628('0x2')],'defaultValue':'no','set':function(_0x707bfe){this[_0x1628('0x1a')](_0x1628('0x1e'),_0x707bfe?_0x707bfe[_0x1628('0x1f')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x1628('0xe')]('leavewhenempty')[_0x1628('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x1628('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1628('0x2')]},'acw':{'type':Sequelize[_0x1628('0x20')],'defaultValue':0x0,'set':function(_0x2783eb){this[_0x1628('0x1a')](_0x1628('0x21'),_0x2783eb);if(_0x2783eb){if(this[_0x1628('0xe')](_0x1628('0x22'))<0x2){this[_0x1628('0x1a')](_0x1628('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1628('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1628('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x1628('0x23'),'progressive',_0x1628('0x14'),_0x1628('0x13'),_0x1628('0x11')),'defaultValue':'progressive','comment':_0x1628('0x24')},'dialLimitChannel':{'type':Sequelize[_0x1628('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x1628('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1628('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x1628('0x7')](_0x1628('0x26'),_0x1628('0x27')),'defaultValue':_0x1628('0x27'),'comment':_0x1628('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1628('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x1628('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1628('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1628('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x1628('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x1628('0x2')],'comment':_0x1628('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1628('0x32')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1628('0x33')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1628('0x34'),_0x1628('0x35'),_0x1628('0x36')),'defaultValue':_0x1628('0x34')},'dialAMDActive':{'type':Sequelize[_0x1628('0x20')],'defaultValue':0x0,'comment':_0x1628('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x1628('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1628('0x15')](0x9)[_0x1628('0x29')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1628('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1628('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1628('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1628('0x15')](0x9)[_0x1628('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1628('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x1628('0x15')](0x9)[_0x1628('0x29')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1628('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1628('0x29')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1628('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1628('0x15')](0x9)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1628('0x15')](0x9)[_0x1628('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1628('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x1628('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1628('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x1628('0x20')],'defaultValue':0x0,'comment':_0x1628('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1628('0x40'),_0x1628('0x41')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x1628('0x2')],'comment':_0x1628('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1628('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1628('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1628('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1628('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1628('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1628('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)[_0x1628('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1628('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1628('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1628('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1628('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1628('0x15')],'allowNull':!![],'comment':_0x1628('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x1628('0x20')],'defaultValue':![],'comment':_0x1628('0x4f'),'set':function(_0x4d3d62){if(!_0x4d3d62)this[_0x1628('0x1a')](_0x1628('0x50'),null);this[_0x1628('0x1a')](_0x1628('0x51'),_0x4d3d62);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1628('0x15')](0x3)[_0x1628('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1628('0x29')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1628('0x20')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1628('0x20')],'defaultValue':![]}}; \ No newline at end of file +var _0x24a7=['inbound','ringall','leastrecent','fewestcalls','random','rrmemory','rrordered','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','Active/Disactive\x20Campaign','preview','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','name','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x24a7,0x159));var _0x724a=function(_0x51d442,_0x524e1e){_0x51d442=_0x51d442-0x0;var _0x385fbf=_0x24a7[_0x51d442];return _0x385fbf;};'use strict';var Sequelize=require(_0x724a('0x0'));module[_0x724a('0x1')]={'name':{'type':Sequelize[_0x724a('0x2')],'allowNull':![],'unique':_0x724a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x724a('0x4')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x724a('0x5')},'musiconhold':{'type':Sequelize[_0x724a('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x724a('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x724a('0x6'),_0x724a('0x7'),_0x724a('0x8'),_0x724a('0x9'),_0x724a('0xa'),'linear','wrandom',_0x724a('0xb')),'allowNull':![],'defaultValue':_0x724a('0x6'),'set':function(_0x3163c0){this['setDataValue'](_0x724a('0xc'),_0x3163c0?_0x3163c0:_0x724a('0xa'));},'get':function(){var _0x40d6fd=this[_0x724a('0xd')](_0x724a('0xe'));var _0xa7ecd5=this[_0x724a('0xd')](_0x724a('0xf'));var _0x4a21e=this[_0x724a('0xd')]('strategy');if(_0x40d6fd===_0x724a('0x5')){return _0x4a21e;}if(_0xa7ecd5===_0x724a('0x10')&&_0x4a21e===_0x724a('0xa')||_0xa7ecd5===_0x724a('0x10')&&_0x4a21e===_0x724a('0x11')){return _0x4a21e;}if(_0xa7ecd5===_0x724a('0x12')||_0xa7ecd5===_0x724a('0x13')||_0xa7ecd5===_0x724a('0x14')){return _0x4a21e;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x724a('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x724a('0x15')](0xb)},'timeout':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x724a('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x724a('0x4')]('yes','no'),'defaultValue':_0x724a('0x16')},'autopause':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no',_0x724a('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x724a('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x724a('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x724a('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x724a('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x724a('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x724a('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defaultValue':_0x724a('0x16')},'announce_holdtime':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x724a('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x724a('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x724a('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x724a('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x724a('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x724a('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x724a('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x724a('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x724a('0x2')]},'queue_quantity1':{'type':Sequelize[_0x724a('0x2')]},'queue_quantity2':{'type':Sequelize[_0x724a('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x724a('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x380800){this[_0x724a('0x18')](_0x724a('0x19'),_0x380800?_0x380800[_0x724a('0x1a')](','):[]);},'get':function(){return this[_0x724a('0xd')](_0x724a('0x19'))?this['getDataValue']('periodic_announce')[_0x724a('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x724a('0x2')],'defaultValue':_0x724a('0x16'),'set':function(_0x47bac8){this[_0x724a('0x18')](_0x724a('0x1c'),_0x47bac8?_0x47bac8[_0x724a('0x1a')](','):undefined);},'get':function(){return this[_0x724a('0xd')]('joinempty')?this[_0x724a('0xd')](_0x724a('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x724a('0x2')],'defaultValue':'no','set':function(_0x10c21f){this['setDataValue'](_0x724a('0x1d'),_0x10c21f?_0x10c21f[_0x724a('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x724a('0x1d'))?this[_0x724a('0xd')]('leavewhenempty')[_0x724a('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x724a('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x724a('0x2')]},'acw':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':0x0,'set':function(_0x95ffd){this[_0x724a('0x18')](_0x724a('0x1f'),_0x95ffd);if(_0x95ffd){if(this[_0x724a('0xd')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x724a('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':0x0,'comment':_0x724a('0x20')},'dialMethod':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x21'),_0x724a('0x12'),_0x724a('0x14'),_0x724a('0x13'),_0x724a('0x10')),'defaultValue':_0x724a('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x724a('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x724a('0x22')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x724a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x724a('0x24')},'dialPowerLevel':{'type':Sequelize[_0x724a('0x25')](0x2)[_0x724a('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x724a('0x26')),'defaultValue':_0x724a('0x26'),'comment':_0x724a('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x724a('0x25')](0x2)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x724a('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0x724a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x724a('0x29')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x724a('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x724a('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x724a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x724a('0x2b')},'dialBusyMaxRetry':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x724a('0x2c')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x724a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x724a('0x2d')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x724a('0x15')](0x5)[_0x724a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x724a('0x2e')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x724a('0x2f')},'dialPrefix':{'type':Sequelize[_0x724a('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x30'),_0x724a('0x31'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x724a('0x32')},'dialAMDGreeting':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x724a('0x33')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x724a('0x34')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x724a('0x35')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x724a('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x724a('0x36')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x724a('0x37')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x724a('0x15')](0x5)[_0x724a('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x724a('0x15')](0x9)[_0x724a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x724a('0x38')},'dialRecallMeTimeout':{'type':Sequelize[_0x724a('0x15')](0x5)[_0x724a('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x724a('0x39')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x724a('0x4')](_0x724a('0x3a'),_0x724a('0x3b')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x724a('0x3c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x724a('0x3d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x724a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x724a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x724a('0x3e')},'dialDropMaxRetry':{'type':Sequelize[_0x724a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x724a('0x3f')},'dialDropRetryFrequency':{'type':Sequelize[_0x724a('0x15')](0x5)[_0x724a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x724a('0x40')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x724a('0x15')](0x5)[_0x724a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x724a('0x41')},'dialMachineRetryFrequency':{'type':Sequelize[_0x724a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x724a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x724a('0x42')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x724a('0x15')](0x5)[_0x724a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x724a('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x724a('0x15')],'allowNull':!![],'comment':_0x724a('0x44')},'mandatoryDisposition':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x19cd8d){if(!_0x19cd8d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x724a('0x18')](_0x724a('0x45'),_0x19cd8d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x724a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x724a('0x15')](0x3)[_0x724a('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x724a('0x1e')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ddb25d1..a4cab12 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 _0x00f3=['CmHopper','length','hasOwnProperty','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','flatMap','penalty','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','ids','Agents','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','userVoiceQueue:remove','addAgents','spread','isEmpty','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','updatedAt','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','NOW()','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','type','name','UserProfileResource','error','stack','VoiceQueue','rawAttributes','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','UserProfileSection','getHoppers','findOne'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x00f3,0x112));var _0x300f=function(_0x39b15e,_0x120bf8){_0x39b15e=_0x39b15e-0x0;var _0x1378a7=_0x00f3[_0x39b15e];return _0x1378a7;};'use strict';var emlformat=require(_0x300f('0x0'));var rimraf=require(_0x300f('0x1'));var zipdir=require(_0x300f('0x2'));var jsonpatch=require(_0x300f('0x3'));var rp=require(_0x300f('0x4'));var moment=require(_0x300f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x300f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x300f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x300f('0x8'));var squel=require(_0x300f('0x9'));var crypto=require(_0x300f('0xa'));var jsforce=require(_0x300f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x300f('0xc'));var querystring=require(_0x300f('0xd'));var Papa=require(_0x300f('0xe'));var Redis=require(_0x300f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x300f('0x10'));var logger=require(_0x300f('0x11'))('api');var utils=require(_0x300f('0x12'));var config=require(_0x300f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300f('0x14'))['db'];config[_0x300f('0x15')]=_[_0x300f('0x16')](config['redis'],{'host':_0x300f('0x17'),'port':0x18eb});var socket=require(_0x300f('0x18'))(new Redis(config[_0x300f('0x15')]));require(_0x300f('0x19'))[_0x300f('0x1a')](socket);function respondWithStatusCode(_0x1c584,_0x24f858){_0x24f858=_0x24f858||0xcc;return function(_0x9946e7){if(_0x9946e7){return _0x1c584[_0x300f('0x1b')](_0x24f858);}return _0x1c584[_0x300f('0x1c')](_0x24f858)[_0x300f('0x1d')]();};}function respondWithResult(_0x342475,_0x173c2c){_0x173c2c=_0x173c2c||0xc8;return function(_0x4410ff){if(_0x4410ff){return _0x342475[_0x300f('0x1c')](_0x173c2c)[_0x300f('0x1e')](_0x4410ff);}};}function respondWithFilteredResult(_0x2a57f5,_0x48ff05){return function(_0x2f263d){if(_0x2f263d){var _0x10e892=typeof _0x48ff05[_0x300f('0x1f')]===_0x300f('0x20')&&typeof _0x48ff05[_0x300f('0x21')]===_0x300f('0x20');var _0x27284d=_0x2f263d[_0x300f('0x22')];var _0x5763b7=_0x10e892?0x0:_0x48ff05[_0x300f('0x1f')];var _0x58c007=_0x10e892?_0x2f263d['count']:_0x48ff05['offset']+_0x48ff05['limit'];var _0x4b34c6;if(_0x58c007>=_0x27284d){_0x58c007=_0x27284d;_0x4b34c6=0xc8;}else{_0x4b34c6=0xce;}_0x2a57f5[_0x300f('0x1c')](_0x4b34c6);return _0x2a57f5[_0x300f('0x23')](_0x300f('0x24'),_0x5763b7+'-'+_0x58c007+'/'+_0x27284d)[_0x300f('0x1e')](_0x2f263d);}return null;};}function patchUpdates(_0x44187e){return function(_0x18e61e){try{jsonpatch[_0x300f('0x25')](_0x18e61e,_0x44187e,!![]);}catch(_0xc60811){return BPromise[_0x300f('0x26')](_0xc60811);}return _0x18e61e[_0x300f('0x27')]();};}function saveUpdates(_0x190354,_0x102d95){return function(_0x196ba1){if(_0x196ba1){return _0x196ba1[_0x300f('0x28')](_0x190354)[_0x300f('0x29')](function(_0x5ac67c){return _0x5ac67c;});}return null;};}function removeEntity(_0x19822d,_0x2a8f7f){return function(_0x72b1cd){if(_0x72b1cd){return _0x72b1cd[_0x300f('0x2a')]()[_0x300f('0x29')](function(){var _0x2e51a1=_0x72b1cd[_0x300f('0x2b')]({'plain':!![]});var _0x270ace=[{'name':_0x300f('0x2c'),'value':'inbound','ignore':![]},{'name':_0x300f('0x2d'),'value':_0x300f('0x2e'),'ignore':![]}];var _0x97484c=_(_0x270ace)[_0x300f('0x2f')](_0x300f('0x30'))[_0x300f('0x31')](_0x300f('0x32'))['value']();if(_['includes'](_0x97484c,_0x2e51a1[_0x300f('0x33')])){return;}var _0x1f456d=_['find'](_0x270ace,['value',_0x2e51a1[_0x300f('0x33')]])[_0x300f('0x34')];return db[_0x300f('0x35')][_0x300f('0x2a')]({'where':{'type':_0x1f456d,'resourceId':_0x2e51a1['id']}})[_0x300f('0x29')](function(){return _0x72b1cd;});})['then'](function(){_0x19822d[_0x300f('0x1c')](0xcc)[_0x300f('0x1d')]();});}};}function handleEntityNotFound(_0x16fb2b,_0xb14a28){return function(_0xc2a8b6){if(!_0xc2a8b6){_0x16fb2b['sendStatus'](0x194);}return _0xc2a8b6;};}function handleError(_0x5e5279,_0x290af5){_0x290af5=_0x290af5||0x1f4;return function(_0x565bb8){logger[_0x300f('0x36')](_0x565bb8[_0x300f('0x37')]);if(_0x565bb8[_0x300f('0x34')]){delete _0x565bb8[_0x300f('0x34')];}_0x5e5279[_0x300f('0x1c')](_0x290af5)['send'](_0x565bb8);};}exports['index']=function(_0x14183c,_0x1f625b){var _0x46e736={},_0x419352={},_0x4d11a3={'count':0x0,'rows':[]};var _0x5d8118=_[_0x300f('0x31')](db[_0x300f('0x38')][_0x300f('0x39')],function(_0x39eaf8){return{'name':_0x39eaf8['fieldName'],'type':_0x39eaf8['type']['key']};});_0x419352[_0x300f('0x3a')]=_['map'](_0x5d8118,'name');_0x419352['query']=_['keys'](_0x14183c[_0x300f('0x3b')]);_0x419352[_0x300f('0x3c')]=_['intersection'](_0x419352[_0x300f('0x3a')],_0x419352[_0x300f('0x3b')]);_0x46e736[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x419352['model'],qs[_0x300f('0x3f')](_0x14183c[_0x300f('0x3b')][_0x300f('0x3f')]));_0x46e736['attributes']=_0x46e736[_0x300f('0x3d')]['length']?_0x46e736[_0x300f('0x3d')]:_0x419352['model'];if(!_0x14183c[_0x300f('0x3b')]['hasOwnProperty'](_0x300f('0x40'))){_0x46e736[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x14183c[_0x300f('0x3b')]['limit']);_0x46e736[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x14183c['query']['offset']);}_0x46e736[_0x300f('0x41')]=qs['sort'](_0x14183c['query'][_0x300f('0x42')]);_0x46e736[_0x300f('0x43')]=qs[_0x300f('0x3c')](_[_0x300f('0x44')](_0x14183c[_0x300f('0x3b')],_0x419352[_0x300f('0x3c')]),_0x5d8118);if(_0x14183c['query']['filter']){_0x46e736[_0x300f('0x43')]=_[_0x300f('0x45')](_0x46e736[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0x5d8118,function(_0x41ec14){if(_0x41ec14[_0x300f('0x33')]!==_0x300f('0x46')){var _0x5e2eff={};_0x5e2eff[_0x41ec14['name']]={'$like':'%'+_0x14183c['query'][_0x300f('0x2f')]+'%'};return _0x5e2eff;}})});}_0x46e736=_[_0x300f('0x45')]({},_0x46e736,_0x14183c['options']);var _0x30ac2b={'where':_0x46e736[_0x300f('0x43')]};return db[_0x300f('0x38')]['count'](_0x30ac2b)[_0x300f('0x29')](function(_0x677c72){_0x4d11a3[_0x300f('0x22')]=_0x677c72;if(_0x14183c['query'][_0x300f('0x47')]){_0x46e736[_0x300f('0x48')]=[{'all':!![]}];}return db[_0x300f('0x38')][_0x300f('0x49')](_0x46e736);})[_0x300f('0x29')](function(_0x489e95){_0x4d11a3[_0x300f('0x4a')]=_0x489e95;return _0x4d11a3;})[_0x300f('0x29')](respondWithFilteredResult(_0x1f625b,_0x46e736))[_0x300f('0x4b')](handleError(_0x1f625b,null));};exports[_0x300f('0x4c')]=function(_0x5baf85,_0x3289e5){var _0x4a7580={'raw':![],'where':{'id':_0x5baf85[_0x300f('0x4d')]['id']}},_0x2b77c2={};_0x2b77c2['model']=_[_0x300f('0x4e')](db[_0x300f('0x38')][_0x300f('0x39')]);_0x2b77c2['query']=_[_0x300f('0x4e')](_0x5baf85[_0x300f('0x3b')]);_0x2b77c2['filters']=_[_0x300f('0x3e')](_0x2b77c2[_0x300f('0x3a')],_0x2b77c2['query']);_0x4a7580[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x2b77c2[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x5baf85[_0x300f('0x3b')][_0x300f('0x3f')]));_0x4a7580[_0x300f('0x3d')]=_0x4a7580[_0x300f('0x3d')]['length']?_0x4a7580[_0x300f('0x3d')]:_0x2b77c2[_0x300f('0x3a')];if(_0x5baf85[_0x300f('0x3b')][_0x300f('0x47')]){_0x4a7580['include']=[{'all':!![]}];}_0x4a7580=_['merge']({},_0x4a7580,_0x5baf85[_0x300f('0x4f')]);return db[_0x300f('0x38')][_0x300f('0x50')](_0x4a7580)['then'](handleEntityNotFound(_0x3289e5,null))['then'](respondWithResult(_0x3289e5,null))[_0x300f('0x4b')](handleError(_0x3289e5,null));};exports[_0x300f('0x51')]=function(_0x5b5a4e,_0x1903d0){return db[_0x300f('0x38')][_0x300f('0x51')](_0x5b5a4e[_0x300f('0x52')],{})[_0x300f('0x29')](function(_0x557ff6){var _0x335ddc=_0x5b5a4e[_0x300f('0x53')]['get']({'plain':!![]});if(!_0x335ddc)throw new Error(_0x300f('0x54'));if(_0x335ddc[_0x300f('0x55')]==='user'){var _0x22e4eb=_0x557ff6['get']({'plain':!![]});var _0x11c8db=[{'name':_0x300f('0x2c'),'value':_0x300f('0x56')},{'name':_0x300f('0x2d'),'value':_0x300f('0x2e')}];var _0x508e54=_[_0x300f('0x50')](_0x11c8db,['value',_0x22e4eb[_0x300f('0x33')]])['name'];return db['UserProfileSection'][_0x300f('0x50')]({'where':{'name':_0x508e54,'userProfileId':_0x335ddc[_0x300f('0x57')]},'raw':!![]})['then'](function(_0x50bc6b){if(_0x50bc6b&&_0x50bc6b[_0x300f('0x58')]===0x0){return db[_0x300f('0x35')][_0x300f('0x51')]({'name':_0x22e4eb[_0x300f('0x34')],'resourceId':_0x22e4eb['id'],'type':_0x50bc6b[_0x300f('0x34')],'sectionId':_0x50bc6b['id']},{})[_0x300f('0x29')](function(){return _0x557ff6;});}else{return _0x557ff6;}})['catch'](function(_0xa30219){logger['error'](_0x300f('0x59'),_0xa30219);throw _0xa30219;});}return _0x557ff6;})[_0x300f('0x29')](respondWithResult(_0x1903d0,0xc9))[_0x300f('0x4b')](handleError(_0x1903d0,null));};exports[_0x300f('0x5a')]=function(_0x58483d,_0x381514){var _0x2fb42c={'where':{'id':_0x58483d[_0x300f('0x4d')]['id']}},_0x3a9e64={};_0x3a9e64['model']=_[_0x300f('0x4e')](db[_0x300f('0x38')][_0x300f('0x39')]);_0x2fb42c[_0x300f('0x3d')]=_['intersection'](_0x3a9e64[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x58483d[_0x300f('0x3b')][_0x300f('0x3f')]));_0x2fb42c[_0x300f('0x3d')]=_0x2fb42c[_0x300f('0x3d')]['length']?_0x2fb42c[_0x300f('0x3d')]:_0x3a9e64[_0x300f('0x3a')];if(_0x58483d['query'][_0x300f('0x47')]){_0x2fb42c['include']=[{'all':!![]}];}_0x2fb42c=_[_0x300f('0x45')]({},_0x2fb42c,_0x58483d['options']);return db[_0x300f('0x38')][_0x300f('0x50')](_0x2fb42c)[_0x300f('0x29')](handleEntityNotFound(_0x381514,null))[_0x300f('0x29')](function(_0x3333a5){if(_0x3333a5){var _0x4ea607=_0x3333a5[_0x300f('0x2b')]({'plain':!![]});_0x4ea607=qs[_0x300f('0x5b')](_0x4ea607,['id',_0x300f('0x5c'),'updatedAt']);_0x58483d[_0x300f('0x52')]=_[_0x300f('0x5b')](_0x58483d['body'],['id',_0x300f('0x5c'),'updatedAt']);return db['VoiceQueue'][_0x300f('0x51')](_['merge'](_0x4ea607,_0x58483d[_0x300f('0x52')]),{'include':_0x58483d[_0x300f('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x541b86){var _0x4ffb78=_0x58483d[_0x300f('0x53')][_0x300f('0x2b')]({'plain':!![]});if(!_0x4ffb78)throw new Error(_0x300f('0x54'));if(_0x4ffb78[_0x300f('0x55')]===_0x300f('0x53')){var _0x1be7d0=_0x541b86['get']({'plain':!![]});var _0x515946=[{'name':_0x300f('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x300f('0x2e')}];var _0x12fa90=_['find'](_0x515946,[_0x300f('0x32'),_0x1be7d0['type']])[_0x300f('0x34')];return db[_0x300f('0x5d')]['find']({'where':{'name':_0x12fa90,'userProfileId':_0x4ffb78['userProfileId']},'raw':!![]})[_0x300f('0x29')](function(_0x39571e){if(_0x39571e&&_0x39571e[_0x300f('0x58')]===0x0){return db[_0x300f('0x35')][_0x300f('0x51')]({'name':_0x1be7d0[_0x300f('0x34')],'resourceId':_0x1be7d0['id'],'type':_0x39571e[_0x300f('0x34')],'sectionId':_0x39571e['id']},{})[_0x300f('0x29')](function(){return _0x541b86;});}else{return _0x541b86;}})['catch'](function(_0x16fe2c){logger[_0x300f('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16fe2c);throw _0x16fe2c;});}return _0x541b86;});}})[_0x300f('0x29')](respondWithResult(_0x381514,0xc9))[_0x300f('0x4b')](handleError(_0x381514,null));};exports[_0x300f('0x28')]=function(_0x56e13c,_0x5026c6){if(_0x56e13c['body']['id']){delete _0x56e13c[_0x300f('0x52')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x56e13c[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x5026c6,null))[_0x300f('0x29')](saveUpdates(_0x56e13c[_0x300f('0x52')],null))[_0x300f('0x29')](respondWithResult(_0x5026c6,null))[_0x300f('0x4b')](handleError(_0x5026c6,null));};exports[_0x300f('0x2a')]=function(_0x193d91,_0x1154e2){return db[_0x300f('0x38')][_0x300f('0x50')]({'where':{'id':_0x193d91[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x1154e2,null))['then'](removeEntity(_0x1154e2,null))[_0x300f('0x4b')](handleError(_0x1154e2,null));};exports[_0x300f('0x5e')]=function(_0x4ce605,_0xb2db8,_0x2f1c26){var _0xdf7880={'raw':![],'where':{}};var _0x105a3a={};var _0x2f6b15={'count':0x0,'rows':[]};return db[_0x300f('0x38')][_0x300f('0x5f')]({'where':{'id':_0x4ce605[_0x300f('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb2db8,null))[_0x300f('0x29')](function(_0x3a7105){if(_0x3a7105){_0x105a3a[_0x300f('0x3a')]=_[_0x300f('0x4e')](db[_0x300f('0x60')]['rawAttributes']);_0x105a3a[_0x300f('0x3b')]=_[_0x300f('0x4e')](_0x4ce605[_0x300f('0x3b')]);_0x105a3a[_0x300f('0x3c')]=_[_0x300f('0x3e')](_0x105a3a[_0x300f('0x3a')],_0x105a3a['query']);_0xdf7880[_0x300f('0x3d')]=_['intersection'](_0x105a3a['model'],qs['fields'](_0x4ce605['query'][_0x300f('0x3f')]));_0xdf7880[_0x300f('0x3d')]=_0xdf7880[_0x300f('0x3d')][_0x300f('0x61')]?_0xdf7880[_0x300f('0x3d')]:_0x105a3a[_0x300f('0x3a')];if(!_0x4ce605['query'][_0x300f('0x62')](_0x300f('0x40'))){_0xdf7880[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x4ce605['query'][_0x300f('0x21')]);_0xdf7880[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x4ce605[_0x300f('0x3b')][_0x300f('0x1f')]);}_0xdf7880[_0x300f('0x41')]=qs['sort'](_0x4ce605['query'][_0x300f('0x42')]);_0xdf7880[_0x300f('0x43')]=qs[_0x300f('0x3c')](_[_0x300f('0x44')](_0x4ce605[_0x300f('0x3b')],_0x105a3a[_0x300f('0x3c')]));_0xdf7880[_0x300f('0x43')][_0x300f('0x63')]=_0x3a7105['id'];if(_0x4ce605[_0x300f('0x3b')][_0x300f('0x2f')]){_0xdf7880[_0x300f('0x43')]=_[_0x300f('0x45')](_0xdf7880[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0xdf7880[_0x300f('0x3d')],function(_0x4460d2){var _0x553e3d={};_0x553e3d[_0x4460d2]={'$like':'%'+_0x4ce605[_0x300f('0x3b')][_0x300f('0x2f')]+'%'};return _0x553e3d;})});}_0xdf7880=_['merge']({},_0xdf7880,_0x4ce605['options']);return db[_0x300f('0x60')]['count']({'where':_0xdf7880[_0x300f('0x43')]})[_0x300f('0x29')](function(_0x471c55){_0x2f6b15['count']=_0x471c55;if(_0x4ce605[_0x300f('0x3b')][_0x300f('0x47')]){_0xdf7880[_0x300f('0x48')]=[{'all':!![]}];}return db[_0x300f('0x60')]['findAll'](_0xdf7880);})[_0x300f('0x29')](function(_0x28a8ad){_0x2f6b15['rows']=_0x28a8ad;return _0x2f6b15;});}})[_0x300f('0x29')](respondWithFilteredResult(_0xb2db8,_0xdf7880))[_0x300f('0x4b')](handleError(_0xb2db8,null));};exports[_0x300f('0x64')]=function(_0x125e30,_0x2fbaae,_0x57505e){var _0x543c1b={'raw':!![],'where':{}};var _0x11a11c={};var _0x708fb3={'count':0x0,'rows':[]};return db[_0x300f('0x38')]['findOne']({'where':{'id':_0x125e30['params']['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x2fbaae,null))[_0x300f('0x29')](function(_0x3a6957){if(_0x3a6957){_0x11a11c[_0x300f('0x3a')]=_[_0x300f('0x4e')](db[_0x300f('0x65')]['rawAttributes']);_0x11a11c['query']=_[_0x300f('0x4e')](_0x125e30[_0x300f('0x3b')]);_0x11a11c[_0x300f('0x3c')]=_['intersection'](_0x11a11c[_0x300f('0x3a')],_0x11a11c['query']);_0x543c1b[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x11a11c[_0x300f('0x3a')],qs['fields'](_0x125e30[_0x300f('0x3b')]['fields']));_0x543c1b[_0x300f('0x3d')]=_0x543c1b['attributes']['length']?_0x543c1b[_0x300f('0x3d')]:_0x11a11c[_0x300f('0x3a')];if(!_0x125e30[_0x300f('0x3b')][_0x300f('0x62')](_0x300f('0x40'))){_0x543c1b[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x125e30[_0x300f('0x3b')][_0x300f('0x21')]);_0x543c1b[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x125e30['query'][_0x300f('0x1f')]);}_0x543c1b[_0x300f('0x41')]=qs[_0x300f('0x42')](_0x125e30[_0x300f('0x3b')]['sort']);_0x543c1b[_0x300f('0x43')]=qs[_0x300f('0x3c')](_[_0x300f('0x44')](_0x125e30['query'],_0x11a11c[_0x300f('0x3c')]));_0x543c1b['where'][_0x300f('0x63')]=_0x3a6957['id'];if(_0x125e30[_0x300f('0x3b')][_0x300f('0x2f')]){_0x543c1b['where']=_['merge'](_0x543c1b[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0x543c1b[_0x300f('0x3d')],function(_0x2ad777){var _0x5ecdfe={};_0x5ecdfe[_0x2ad777]={'$like':'%'+_0x125e30[_0x300f('0x3b')]['filter']+'%'};return _0x5ecdfe;})});}_0x543c1b=_['merge']({},_0x543c1b,_0x125e30[_0x300f('0x4f')]);return db['CmHopperHistory'][_0x300f('0x22')]({'where':_0x543c1b['where']})[_0x300f('0x29')](function(_0x32f696){_0x708fb3[_0x300f('0x22')]=_0x32f696;if(_0x125e30[_0x300f('0x3b')][_0x300f('0x47')]){_0x543c1b[_0x300f('0x48')]=[{'all':!![]}];}return db[_0x300f('0x65')][_0x300f('0x49')](_0x543c1b);})[_0x300f('0x29')](function(_0x525a2a){_0x708fb3[_0x300f('0x4a')]=_0x525a2a;return _0x708fb3;});}})[_0x300f('0x29')](respondWithFilteredResult(_0x2fbaae,_0x543c1b))['catch'](handleError(_0x2fbaae,null));};exports['getHopperFinals']=function(_0x3d5be3,_0xb84dcc,_0x7c6cac){var _0x16d256={'raw':!![],'where':{}};var _0x46a8cf={};var _0x533847={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x300f('0x5f')]({'where':{'id':_0x3d5be3[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0xb84dcc,null))['then'](function(_0x316fb5){if(_0x316fb5){_0x46a8cf['model']=_[_0x300f('0x4e')](db[_0x300f('0x66')][_0x300f('0x39')]);_0x46a8cf[_0x300f('0x3b')]=_[_0x300f('0x4e')](_0x3d5be3['query']);_0x46a8cf[_0x300f('0x3c')]=_[_0x300f('0x3e')](_0x46a8cf[_0x300f('0x3a')],_0x46a8cf[_0x300f('0x3b')]);_0x16d256[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x46a8cf[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x3d5be3['query'][_0x300f('0x3f')]));_0x16d256['attributes']=_0x16d256[_0x300f('0x3d')][_0x300f('0x61')]?_0x16d256[_0x300f('0x3d')]:_0x46a8cf['model'];if(!_0x3d5be3['query'][_0x300f('0x62')]('nolimit')){_0x16d256[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x3d5be3['query'][_0x300f('0x21')]);_0x16d256[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x3d5be3[_0x300f('0x3b')][_0x300f('0x1f')]);}_0x16d256[_0x300f('0x41')]=qs[_0x300f('0x42')](_0x3d5be3[_0x300f('0x3b')][_0x300f('0x42')]);_0x16d256[_0x300f('0x43')]=qs['filters'](_[_0x300f('0x44')](_0x3d5be3[_0x300f('0x3b')],_0x46a8cf['filters']));_0x16d256[_0x300f('0x43')]['VoiceQueueId']=_0x316fb5['id'];if(_0x3d5be3['query'][_0x300f('0x2f')]){_0x16d256[_0x300f('0x43')]=_[_0x300f('0x45')](_0x16d256[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0x16d256[_0x300f('0x3d')],function(_0x3d8434){var _0x3beb2a={};_0x3beb2a[_0x3d8434]={'$like':'%'+_0x3d5be3[_0x300f('0x3b')][_0x300f('0x2f')]+'%'};return _0x3beb2a;})});}_0x16d256=_[_0x300f('0x45')]({},_0x16d256,_0x3d5be3['options']);return db[_0x300f('0x66')]['count']({'where':_0x16d256[_0x300f('0x43')]})[_0x300f('0x29')](function(_0x1e09ad){_0x533847[_0x300f('0x22')]=_0x1e09ad;if(_0x3d5be3['query']['includeAll']){_0x16d256[_0x300f('0x48')]=[{'all':!![]}];}return db[_0x300f('0x66')][_0x300f('0x49')](_0x16d256);})['then'](function(_0x548db7){_0x533847[_0x300f('0x4a')]=_0x548db7;return _0x533847;});}})[_0x300f('0x29')](respondWithFilteredResult(_0xb84dcc,_0x16d256))[_0x300f('0x4b')](handleError(_0xb84dcc,null));};exports[_0x300f('0x67')]=function(_0x571552,_0x5d94e0,_0xca602b){var _0x381bc4={'raw':!![],'where':{}};var _0x54512c={};var _0x559e0d={'count':0x0,'rows':[]};return db[_0x300f('0x38')][_0x300f('0x5f')]({'where':{'id':_0x571552['params']['id']}})['then'](handleEntityNotFound(_0x5d94e0,null))['then'](function(_0x136cc0){if(_0x136cc0){_0x54512c[_0x300f('0x3a')]=_[_0x300f('0x4e')](db['CmHopperBlack'][_0x300f('0x39')]);_0x54512c['query']=_[_0x300f('0x4e')](_0x571552[_0x300f('0x3b')]);_0x54512c[_0x300f('0x3c')]=_[_0x300f('0x3e')](_0x54512c[_0x300f('0x3a')],_0x54512c['query']);_0x381bc4['attributes']=_['intersection'](_0x54512c[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x571552[_0x300f('0x3b')][_0x300f('0x3f')]));_0x381bc4[_0x300f('0x3d')]=_0x381bc4[_0x300f('0x3d')]['length']?_0x381bc4[_0x300f('0x3d')]:_0x54512c['model'];if(!_0x571552[_0x300f('0x3b')][_0x300f('0x62')](_0x300f('0x40'))){_0x381bc4[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x571552['query']['limit']);_0x381bc4[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x571552[_0x300f('0x3b')][_0x300f('0x1f')]);}_0x381bc4['order']=qs[_0x300f('0x42')](_0x571552[_0x300f('0x3b')][_0x300f('0x42')]);_0x381bc4[_0x300f('0x43')]=qs[_0x300f('0x3c')](_[_0x300f('0x44')](_0x571552[_0x300f('0x3b')],_0x54512c[_0x300f('0x3c')]));_0x381bc4['where'][_0x300f('0x63')]=_0x136cc0['id'];if(_0x571552[_0x300f('0x3b')][_0x300f('0x2f')]){_0x381bc4['where']=_['merge'](_0x381bc4[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0x381bc4[_0x300f('0x3d')],function(_0x5051e1){var _0x50b2d9={};_0x50b2d9[_0x5051e1]={'$like':'%'+_0x571552[_0x300f('0x3b')]['filter']+'%'};return _0x50b2d9;})});}_0x381bc4=_['merge']({},_0x381bc4,_0x571552['options']);return db[_0x300f('0x68')][_0x300f('0x22')]({'where':_0x381bc4['where']})[_0x300f('0x29')](function(_0x667e94){_0x559e0d[_0x300f('0x22')]=_0x667e94;if(_0x571552[_0x300f('0x3b')][_0x300f('0x47')]){_0x381bc4[_0x300f('0x48')]=[{'all':!![]}];}return db[_0x300f('0x68')][_0x300f('0x49')](_0x381bc4);})[_0x300f('0x29')](function(_0x327158){_0x559e0d[_0x300f('0x4a')]=_0x327158;return _0x559e0d;});}})[_0x300f('0x29')](respondWithFilteredResult(_0x5d94e0,_0x381bc4))['catch'](handleError(_0x5d94e0,null));};exports[_0x300f('0x69')]=function(_0x52a2a3,_0x6d029e,_0x14e0ed){var _0x378c8c={};var _0x1a7ab9={};var _0x48a88d;var _0x153923;return db[_0x300f('0x38')][_0x300f('0x5f')]({'where':{'id':_0x52a2a3[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x6d029e,null))[_0x300f('0x29')](function(_0x32d545){if(_0x32d545){_0x48a88d=_0x32d545;_0x1a7ab9[_0x300f('0x3a')]=_[_0x300f('0x4e')](db[_0x300f('0x6a')][_0x300f('0x39')]);_0x1a7ab9[_0x300f('0x3b')]=_[_0x300f('0x4e')](_0x52a2a3[_0x300f('0x3b')]);_0x1a7ab9[_0x300f('0x3c')]=_[_0x300f('0x3e')](_0x1a7ab9[_0x300f('0x3a')],_0x1a7ab9[_0x300f('0x3b')]);_0x378c8c[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x1a7ab9[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x52a2a3['query'][_0x300f('0x3f')]));_0x378c8c[_0x300f('0x3d')]=_0x378c8c['attributes'][_0x300f('0x61')]?_0x378c8c['attributes']:_0x1a7ab9[_0x300f('0x3a')];_0x378c8c[_0x300f('0x41')]=qs['sort'](_0x52a2a3['query'][_0x300f('0x42')]);_0x378c8c[_0x300f('0x43')]=qs[_0x300f('0x3c')](_['pick'](_0x52a2a3['query'],_0x1a7ab9[_0x300f('0x3c')]));if(_0x52a2a3[_0x300f('0x3b')][_0x300f('0x2f')]){_0x378c8c[_0x300f('0x43')]=_[_0x300f('0x45')](_0x378c8c['where'],{'$or':_[_0x300f('0x31')](_0x378c8c['attributes'],function(_0x8e4f61){var _0x537288={};_0x537288[_0x8e4f61]={'$like':'%'+_0x52a2a3[_0x300f('0x3b')][_0x300f('0x2f')]+'%'};return _0x537288;})});}_0x378c8c=_['merge']({},_0x378c8c,_0x52a2a3[_0x300f('0x4f')]);return _0x48a88d[_0x300f('0x69')](_0x378c8c);}})['then'](function(_0x43995a){if(_0x43995a){_0x153923=_0x43995a[_0x300f('0x61')];if(!_0x52a2a3[_0x300f('0x3b')][_0x300f('0x62')](_0x300f('0x40'))){_0x378c8c[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x52a2a3[_0x300f('0x3b')][_0x300f('0x21')]);_0x378c8c[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x52a2a3[_0x300f('0x3b')][_0x300f('0x1f')]);}return _0x48a88d[_0x300f('0x69')](_0x378c8c);}})[_0x300f('0x29')](function(_0x1673ac){if(_0x1673ac){return _0x1673ac?{'count':_0x153923,'rows':_0x1673ac}:null;}})['then'](respondWithResult(_0x6d029e,null))[_0x300f('0x4b')](handleError(_0x6d029e,null));};exports[_0x300f('0x6b')]=function(_0x9cd3bf,_0x21c1a2,_0x511115){var _0x91b899=_0x9cd3bf['body'][_0x300f('0x6c')];var _0x27504b=_[_0x300f('0x31')](_0x91b899,'id');return db['Team']['findAll']({'where':{'id':_0x27504b},'attributes':['id'],'include':[{'model':db[_0x300f('0x6d')],'as':'Agents','attributes':['id',_0x300f('0x34'),_0x300f('0x6e'),_0x300f('0x6f'),'interface'],'raw':!![]}]})[_0x300f('0x29')](function(_0x531073){if(_0x531073){var _0x4834b9=_[_0x300f('0x70')](_0x531073,function(_0x5ceb9c){var _0xe80d6c=_0x5ceb9c[_0x300f('0x2b')]({'plain':!![]});_0xe80d6c['Agents']['forEach'](function(_0x301dcd){_0x301dcd[_0x300f('0x71')]=_[_0x300f('0x50')](_0x91b899,{'id':_0xe80d6c['id']})['penalty'];});return _0xe80d6c['Agents'];});return db[_0x300f('0x38')][_0x300f('0x50')]({'where':{'id':_0x9cd3bf[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](function(_0x397dd9){return db['sequelize'][_0x300f('0x72')](function(_0x226ee6){return _0x397dd9[_0x300f('0x6b')](_0x27504b,{'transaction':_0x226ee6})[_0x300f('0x29')](function(){return BPromise[_0x300f('0x73')](_0x91b899,function(_0x4af6a1){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x4af6a1['id'],'VoiceQueueId':_0x9cd3bf[_0x300f('0x4d')]['id'],'penalty':_0x4af6a1[_0x300f('0x71')]},{'transaction':_0x226ee6});});})[_0x300f('0x29')](function(){return BPromise['each'](_0x4834b9,function(_0x500cb5){return db['UserVoiceQueue'][_0x300f('0x74')]({'where':{'UserId':_0x500cb5['id'],'VoiceQueueId':_0x9cd3bf['params']['id']},'defaults':{'penalty':_0x500cb5[_0x300f('0x71')]},'transaction':_0x226ee6});});})[_0x300f('0x29')](function(){return BPromise['each'](_[_0x300f('0x2f')](_0x4834b9,{'online':!![]}),function(_0x1d9dc6){return db[_0x300f('0x75')][_0x300f('0x76')]({'membername':_0x1d9dc6[_0x300f('0x34')],'UserId':_0x1d9dc6['id'],'queue_name':_0x397dd9[_0x300f('0x34')],'VoiceQueueId':_0x397dd9['id'],'interface':_[_0x300f('0x77')](_0x1d9dc6[_0x300f('0x78')])?util[_0x300f('0x79')](_0x300f('0x7a'),_0x1d9dc6['name']):_0x1d9dc6[_0x300f('0x78')],'paused':_0x1d9dc6['voicePause']||![],'penalty':_0x1d9dc6['penalty']},{'transaction':_0x226ee6});});})[_0x300f('0x29')](function(){_0x4834b9[_0x300f('0x7b')](function(_0x4dde4f){socket[_0x300f('0x7c')](_0x300f('0x7d'),{'UserId':_0x4dde4f['id'],'VoiceQueueId':_0x397dd9['id']});});});});});}})[_0x300f('0x29')](respondWithStatusCode(_0x21c1a2,null))[_0x300f('0x4b')](handleError(_0x21c1a2,null));};exports[_0x300f('0x7e')]=function(_0x1f2b0e,_0x4d0706,_0x298ad6){return db['Team'][_0x300f('0x49')]({'where':{'id':_0x1f2b0e[_0x300f('0x3b')][_0x300f('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x300f('0x6d')],'as':_0x300f('0x80'),'attributes':['id'],'raw':!![]}]})[_0x300f('0x29')](handleEntityNotFound(_0x4d0706,null))[_0x300f('0x29')](function(_0x7c5db){var _0x5836ca=_['map'](_0x7c5db,'id');var _0x3e7903=[];var _0x5367ab=[];var _0x16e8fa=squel[_0x300f('0x81')]();_0x16e8fa['field'](_0x300f('0x82'))[_0x300f('0x83')]('team_has_voice_queues','tq')['join'](_0x300f('0x84'),'ut',_0x300f('0x85'))['where'](_0x300f('0x86'),_0x1f2b0e['params']['id']);for(var _0x4966d2=0x0;_0x4966d2<_0x7c5db[_0x300f('0x61')];_0x4966d2+=0x1){let _0x48d609=_0x7c5db[_0x4966d2];for(var _0xc53839=0x0;_0xc53839<_0x48d609[_0x300f('0x80')][_0x300f('0x61')];_0xc53839+=0x1){let _0xca5341=_0x48d609[_0x300f('0x80')][_0xc53839];var _0x2384a6=_0x16e8fa[_0x300f('0x5a')]();_0x2384a6['where'](_0x300f('0x87'),_0xca5341['id']);_0x5367ab[_0x300f('0x88')](db['sequelize'][_0x300f('0x3b')](_0x2384a6['toString'](),{'type':db[_0x300f('0x89')][_0x300f('0x8a')][_0x300f('0x8b')]})[_0x300f('0x29')](function(_0x4f608f){if(_0x4f608f[_0x300f('0x61')]===0x1){return _0xca5341['id'];}else{var _0x1a1c75=_[_0x300f('0x8c')](_[_0x300f('0x31')](_0x4f608f,_0x300f('0x8d')),function(_0x17913e){return _[_0x300f('0x8e')](_0x5836ca,_0x17913e);});if(_0x1a1c75){return _0xca5341['id'];}}}));}}return BPromise[_0x300f('0x8f')](_0x5367ab)[_0x300f('0x29')](function(_0x56794f){_0x3e7903=_(_0x3e7903)[_0x300f('0x90')](_0x56794f)[_0x300f('0x91')]()['value']();return db[_0x300f('0x38')]['find']({'where':{'id':_0x1f2b0e[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](function(_0x4ececc){return db[_0x300f('0x89')][_0x300f('0x72')](function(_0x4c6d8a){return _0x4ececc[_0x300f('0x7e')](_0x1f2b0e[_0x300f('0x3b')][_0x300f('0x7f')],{'transaction':_0x4c6d8a})[_0x300f('0x29')](function(){if(!_['isEmpty'](_0x3e7903)){return _0x4ececc['removeAgents'](_0x3e7903,{'transaction':_0x4c6d8a})[_0x300f('0x29')](function(){return db[_0x300f('0x75')][_0x300f('0x2a')]({'where':{'VoiceQueueId':_0x1f2b0e[_0x300f('0x4d')]['id'],'UserId':_0x3e7903},'transaction':_0x4c6d8a});});}})[_0x300f('0x29')](function(){_0x3e7903[_0x300f('0x7b')](function(_0x497e02){socket['emit'](_0x300f('0x92'),{'UserId':_0x497e02,'VoiceQueueId':_0x4ececc['id']});});});});});});})[_0x300f('0x29')](respondWithStatusCode(_0x4d0706,null))[_0x300f('0x4b')](handleError(_0x4d0706,null));};exports['addAgents']=function(_0x5e1e66,_0x476451,_0xa9449f){var _0x19478f,_0x1e17b3;return db[_0x300f('0x38')]['find']({'where':{'id':_0x5e1e66[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x476451,null))[_0x300f('0x29')](function(_0x2fadf4){if(_0x2fadf4){_0x1e17b3=_0x2fadf4;return _0x2fadf4[_0x300f('0x93')](_0x5e1e66['body']['ids'],_[_0x300f('0x5b')](_0x5e1e66[_0x300f('0x52')],[_0x300f('0x7f'),'id'])||{})[_0x300f('0x94')](function(_0x25fbb8){for(var _0x5bb59b=0x0;_0x5bb59b<_0x5e1e66[_0x300f('0x52')][_0x300f('0x7f')][_0x300f('0x61')];_0x5bb59b+=0x1){socket['emit'](_0x300f('0x7d'),{'UserId':Number(_0x5e1e66[_0x300f('0x52')][_0x300f('0x7f')][_0x5bb59b]),'VoiceQueueId':Number(_0x5e1e66[_0x300f('0x4d')]['id'])});}return _0x25fbb8;});}})['then'](function(_0x4dc3de){_0x19478f=_0x4dc3de||[];if(_0x1e17b3){return db[_0x300f('0x6d')]['findAll']({'where':{'id':_0x5e1e66[_0x300f('0x52')][_0x300f('0x7f')]},'attributes':['id','name',_0x300f('0x6e'),_0x300f('0x6f'),'interface'],'raw':!![]});}})[_0x300f('0x29')](function(_0x525ebd){if(!_[_0x300f('0x95')](_0x525ebd)){var _0x216c3d=[];for(var _0x288c69=0x0;_0x288c69<_0x525ebd[_0x300f('0x61')];_0x288c69++){if(_0x525ebd[_0x288c69][_0x300f('0x6e')]){_0x216c3d[_0x300f('0x88')](db[_0x300f('0x75')][_0x300f('0x76')]({'membername':_0x525ebd[_0x288c69][_0x300f('0x34')],'UserId':_0x525ebd[_0x288c69]['id'],'queue_name':_0x1e17b3[_0x300f('0x34')],'VoiceQueueId':_0x1e17b3['id'],'interface':_[_0x300f('0x77')](_0x525ebd[_0x288c69][_0x300f('0x78')])?util['format'](_0x300f('0x7a'),_0x525ebd[_0x288c69][_0x300f('0x34')]):_0x525ebd[_0x288c69][_0x300f('0x78')],'paused':_0x525ebd[_0x288c69][_0x300f('0x6f')]||![],'penalty':_0x5e1e66['body']['penalty']||0x0}));}}return BPromise[_0x300f('0x8f')](_0x216c3d);}})['then'](function(){return _0x19478f;})['then'](respondWithResult(_0x476451,null))[_0x300f('0x4b')](handleError(_0x476451,null));};exports[_0x300f('0x96')]=function(_0x4271a6,_0x16b992,_0x6c2ca1){return db[_0x300f('0x38')]['find']({'where':{'id':_0x4271a6[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x16b992,null))[_0x300f('0x29')](function(_0x3fdd03){if(_0x3fdd03){return _0x3fdd03['removeAgents'](_0x4271a6[_0x300f('0x3b')][_0x300f('0x7f')])[_0x300f('0x29')](function(){if(_[_0x300f('0x97')](_0x4271a6['query'][_0x300f('0x7f')])){for(var _0x5a823d=0x0;_0x5a823d<_0x4271a6[_0x300f('0x3b')][_0x300f('0x7f')][_0x300f('0x61')];_0x5a823d+=0x1){socket['emit'](_0x300f('0x92'),{'UserId':Number(_0x4271a6[_0x300f('0x3b')][_0x300f('0x7f')][_0x5a823d]),'VoiceQueueId':Number(_0x4271a6[_0x300f('0x4d')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4271a6[_0x300f('0x3b')][_0x300f('0x7f')]),'VoiceQueueId':Number(_0x4271a6[_0x300f('0x4d')]['id'])});}});}})[_0x300f('0x29')](function(_0x553599){return db['UserVoiceQueueRt'][_0x300f('0x2a')]({'where':{'VoiceQueueId':_0x4271a6[_0x300f('0x4d')]['id'],'UserId':_0x4271a6[_0x300f('0x3b')][_0x300f('0x7f')]}})['then'](function(){return _0x553599;});})[_0x300f('0x29')](respondWithStatusCode(_0x16b992,null))[_0x300f('0x4b')](handleError(_0x16b992,null));};exports[_0x300f('0x98')]=function(_0x26929b,_0x231582,_0x425c7b){var _0x18e4bb={};var _0x2c93b0={};var _0x13b2e2;var _0x2c39dc;return db['VoiceQueue'][_0x300f('0x5f')]({'where':{'id':_0x26929b[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x231582,null))[_0x300f('0x29')](function(_0x221f5e){if(_0x221f5e){_0x13b2e2=_0x221f5e;_0x2c93b0[_0x300f('0x3a')]=_[_0x300f('0x4e')](db[_0x300f('0x6d')][_0x300f('0x39')]);_0x2c93b0[_0x300f('0x3b')]=_[_0x300f('0x4e')](_0x26929b[_0x300f('0x3b')]);_0x2c93b0['filters']=_[_0x300f('0x3e')](_0x2c93b0[_0x300f('0x3a')],_0x2c93b0[_0x300f('0x3b')]);_0x18e4bb['attributes']=_[_0x300f('0x3e')](_0x2c93b0[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x26929b[_0x300f('0x3b')][_0x300f('0x3f')]));_0x18e4bb[_0x300f('0x3d')]=_0x18e4bb[_0x300f('0x3d')]['length']?_0x18e4bb[_0x300f('0x3d')]:_0x2c93b0[_0x300f('0x3a')];_0x18e4bb[_0x300f('0x41')]=qs['sort'](_0x26929b[_0x300f('0x3b')][_0x300f('0x42')]);_0x18e4bb[_0x300f('0x43')]=qs[_0x300f('0x3c')](_[_0x300f('0x44')](_0x26929b[_0x300f('0x3b')],_0x2c93b0[_0x300f('0x3c')]));if(_0x26929b[_0x300f('0x3b')][_0x300f('0x2f')]){_0x18e4bb[_0x300f('0x43')]=_[_0x300f('0x45')](_0x18e4bb[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0x18e4bb[_0x300f('0x3d')],function(_0x3c0ba7){var _0x1f04b0={};_0x1f04b0[_0x3c0ba7]={'$like':'%'+_0x26929b[_0x300f('0x3b')][_0x300f('0x2f')]+'%'};return _0x1f04b0;})});}_0x18e4bb=_[_0x300f('0x45')]({},_0x18e4bb,_0x26929b[_0x300f('0x4f')]);return _0x13b2e2['getAgents'](_0x18e4bb);}})[_0x300f('0x29')](function(_0x55a60b){if(_0x55a60b){_0x2c39dc=_0x55a60b[_0x300f('0x61')];if(!_0x26929b['query'][_0x300f('0x62')]('nolimit')){_0x18e4bb[_0x300f('0x21')]=qs['limit'](_0x26929b[_0x300f('0x3b')][_0x300f('0x21')]);_0x18e4bb[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x26929b[_0x300f('0x3b')]['offset']);}return _0x13b2e2[_0x300f('0x98')](_0x18e4bb);}})[_0x300f('0x29')](function(_0x24c7da){if(_0x24c7da){return _0x24c7da?{'count':_0x2c39dc,'rows':_0x24c7da}:null;}})[_0x300f('0x29')](respondWithResult(_0x231582,null))['catch'](handleError(_0x231582,null));};exports[_0x300f('0x99')]=function(_0x3e0d50,_0x299261,_0x2414d0){var _0x322e9f={};var _0x74d549={};var _0xcc4139;var _0x123ba8;return db[_0x300f('0x38')][_0x300f('0x5f')]({'where':{'id':_0x3e0d50[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x299261,null))[_0x300f('0x29')](function(_0x21c811){if(_0x21c811){_0xcc4139=_0x21c811;_0x74d549[_0x300f('0x3a')]=_[_0x300f('0x4e')](db[_0x300f('0x75')][_0x300f('0x39')]);_0x74d549[_0x300f('0x3b')]=_[_0x300f('0x4e')](_0x3e0d50[_0x300f('0x3b')]);_0x74d549[_0x300f('0x3c')]=_[_0x300f('0x3e')](_0x74d549[_0x300f('0x3a')],_0x74d549[_0x300f('0x3b')]);_0x322e9f[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x74d549['model'],qs[_0x300f('0x3f')](_0x3e0d50[_0x300f('0x3b')][_0x300f('0x3f')]));_0x322e9f[_0x300f('0x3d')]=_0x322e9f[_0x300f('0x3d')][_0x300f('0x61')]?_0x322e9f[_0x300f('0x3d')]:_0x74d549[_0x300f('0x3a')];_0x322e9f['order']=qs['sort'](_0x3e0d50[_0x300f('0x3b')][_0x300f('0x42')]);_0x322e9f[_0x300f('0x43')]=qs['filters'](_[_0x300f('0x44')](_0x3e0d50[_0x300f('0x3b')],_0x74d549['filters']));if(_0x3e0d50[_0x300f('0x3b')][_0x300f('0x2f')]){_0x322e9f[_0x300f('0x43')]=_['merge'](_0x322e9f[_0x300f('0x43')],{'$or':_[_0x300f('0x31')](_0x322e9f[_0x300f('0x3d')],function(_0x176482){var _0x2ca06b={};_0x2ca06b[_0x176482]={'$like':'%'+_0x3e0d50[_0x300f('0x3b')][_0x300f('0x2f')]+'%'};return _0x2ca06b;})});}_0x322e9f=_[_0x300f('0x45')]({},_0x322e9f,_0x3e0d50['options']);return _0xcc4139[_0x300f('0x99')](_0x322e9f);}})[_0x300f('0x29')](function(_0x18e12b){if(_0x18e12b){_0x123ba8=_0x18e12b[_0x300f('0x61')];if(!_0x3e0d50[_0x300f('0x3b')][_0x300f('0x62')](_0x300f('0x40'))){_0x322e9f[_0x300f('0x21')]=qs['limit'](_0x3e0d50['query'][_0x300f('0x21')]);_0x322e9f[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x3e0d50[_0x300f('0x3b')][_0x300f('0x1f')]);}return _0xcc4139[_0x300f('0x99')](_0x322e9f);}})[_0x300f('0x29')](function(_0x1fcf99){return _0x1fcf99?{'count':_0x123ba8,'rows':_0x1fcf99}:null;})[_0x300f('0x29')](respondWithResult(_0x299261,null))['catch'](handleError(_0x299261,null));};exports[_0x300f('0x9a')]=function(_0x28d432,_0x3adaaf,_0x3c5fec){var _0x270062={};var _0x256fdb={};var _0x3b558c;var _0x48a4db;return db[_0x300f('0x38')]['findOne']({'where':{'id':_0x28d432[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x3adaaf,null))[_0x300f('0x29')](function(_0x45de50){if(_0x45de50){_0x3b558c=_0x45de50;_0x256fdb['model']=_['keys'](db[_0x300f('0x9b')][_0x300f('0x39')]);_0x256fdb[_0x300f('0x3b')]=_['keys'](_0x28d432[_0x300f('0x3b')]);_0x256fdb[_0x300f('0x3c')]=_['intersection'](_0x256fdb[_0x300f('0x3a')],_0x256fdb[_0x300f('0x3b')]);_0x270062[_0x300f('0x3d')]=_['intersection'](_0x256fdb[_0x300f('0x3a')],qs[_0x300f('0x3f')](_0x28d432['query'][_0x300f('0x3f')]));_0x270062[_0x300f('0x3d')]=_0x270062[_0x300f('0x3d')][_0x300f('0x61')]?_0x270062[_0x300f('0x3d')]:_0x256fdb['model'];_0x270062[_0x300f('0x41')]=qs[_0x300f('0x42')](_0x28d432['query'][_0x300f('0x42')]);_0x270062[_0x300f('0x43')]=qs['filters'](_[_0x300f('0x44')](_0x28d432['query'],_0x256fdb['filters']));if(_0x28d432[_0x300f('0x3b')][_0x300f('0x2f')]){_0x270062['where']=_['merge'](_0x270062[_0x300f('0x43')],{'$or':_['map'](_0x270062['attributes'],function(_0x44b8c0){var _0x4cd512={};_0x4cd512[_0x44b8c0]={'$like':'%'+_0x28d432['query'][_0x300f('0x2f')]+'%'};return _0x4cd512;})});}_0x270062=_[_0x300f('0x45')]({},_0x270062,_0x28d432['options']);return _0x3b558c['getLists'](_0x270062);}})[_0x300f('0x29')](function(_0x486335){if(_0x486335){_0x48a4db=_0x486335[_0x300f('0x61')];if(!_0x28d432[_0x300f('0x3b')][_0x300f('0x62')](_0x300f('0x40'))){_0x270062[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x28d432[_0x300f('0x3b')][_0x300f('0x21')]);_0x270062[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x28d432[_0x300f('0x3b')][_0x300f('0x1f')]);}return _0x3b558c['getLists'](_0x270062);}})[_0x300f('0x29')](function(_0x49f831){if(_0x49f831){return _0x49f831?{'count':_0x48a4db,'rows':_0x49f831}:null;}})[_0x300f('0x29')](respondWithResult(_0x3adaaf,null))[_0x300f('0x4b')](handleError(_0x3adaaf,null));};exports[_0x300f('0x9c')]=function(_0x537f4d,_0x2c57b3,_0x573521){var _0x16e7c8,_0x979b42;return db[_0x300f('0x38')]['find']({'where':{'id':_0x537f4d[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x2c57b3,null))[_0x300f('0x29')](function(_0x2cc97f){if(_0x2cc97f){_0x979b42=_0x2cc97f;return _0x2cc97f[_0x300f('0x9c')](_0x537f4d[_0x300f('0x52')][_0x300f('0x7f')],_[_0x300f('0x5b')](_0x537f4d[_0x300f('0x52')],['ids','id'])||{});}return null;})[_0x300f('0x94')](function(_0x5cacb9){var _0x14109f;_0x16e7c8=_0x5cacb9||[];var _0x3d48ed=[];if(_0x5cacb9){for(var _0x2b981a=0x0;_0x2b981a<_0x5cacb9[_0x300f('0x61')];_0x2b981a+=0x1){var _0x16cfad=_0x5cacb9[_0x2b981a][_0x300f('0x2b')]({'plain':!![]});_0x979b42[_0x300f('0x9d')]=_0x537f4d[_0x300f('0x52')][_0x300f('0x9d')]?_0x537f4d[_0x300f('0x52')][_0x300f('0x9d')]:_0x979b42['dialCheckDuplicateType'];switch(_0x979b42[_0x300f('0x9d')]){case _0x300f('0x9e'):_0x14109f=squel['insert']()[_0x300f('0x9f')](_0x300f('0xa0'))[_0x300f('0xa1')]([_0x300f('0xa2'),_0x300f('0xa3'),_0x300f('0xa4'),'ListId','VoiceQueueId',_0x300f('0x5c'),_0x300f('0xa5')],squel[_0x300f('0x81')]()[_0x300f('0xa6')](_0x300f('0xa2'),_0x300f('0xa2'))[_0x300f('0xa6')]('NOW()',_0x300f('0xa3'))[_0x300f('0xa6')]('id','ContactId')[_0x300f('0xa6')](_0x16cfad[_0x300f('0xa7')][_0x300f('0xa8')](),'ListId')[_0x300f('0xa6')](_0x537f4d[_0x300f('0x4d')]['id']['toString'](),_0x300f('0x63'))[_0x300f('0xa6')]('NOW()',_0x300f('0x5c'))[_0x300f('0xa6')]('NOW()',_0x300f('0xa5'))['from'](_0x300f('0xa9'))[_0x300f('0x43')](_0x300f('0xaa'))[_0x300f('0x43')]('ListId\x20=\x20?',_0x16cfad[_0x300f('0xa7')][_0x300f('0xa8')]())[_0x300f('0x43')](_0x300f('0xab'))[_0x300f('0x43')](_0x300f('0xac'),squel['select']()[_0x300f('0xa6')]('COALESCE(calleridnum,\x27\x27)')[_0x300f('0x83')](_0x300f('0xad'))[_0x300f('0x43')](_0x300f('0x86'),_0x537f4d[_0x300f('0x4d')]['id'][_0x300f('0xa8')]()))[_0x300f('0x43')](_0x300f('0xac'),squel[_0x300f('0x81')]()[_0x300f('0xa6')](_0x300f('0xae'))[_0x300f('0x83')](_0x300f('0xa0'))[_0x300f('0x43')](_0x300f('0x86'),_0x537f4d[_0x300f('0x4d')]['id'][_0x300f('0xa8')]())))[_0x300f('0xa8')]();break;case _0x300f('0xaf'):_0x14109f=squel[_0x300f('0xb0')]()[_0x300f('0x9f')]('cm_hopper')[_0x300f('0xa1')](['phone',_0x300f('0xa3'),_0x300f('0xa4'),_0x300f('0xb1'),_0x300f('0x63'),_0x300f('0x5c'),_0x300f('0xa5')],squel['select']()['field'](_0x300f('0xa2'),'phone')['field'](_0x300f('0xb2'),'scheduledAt')[_0x300f('0xa6')]('id',_0x300f('0xa4'))[_0x300f('0xa6')](_0x16cfad['CmListId']['toString'](),'ListId')[_0x300f('0xa6')](_0x537f4d['params']['id']['toString'](),_0x300f('0x63'))[_0x300f('0xa6')](_0x300f('0xb2'),'createdAt')[_0x300f('0xa6')](_0x300f('0xb2'),_0x300f('0xa5'))[_0x300f('0x83')](_0x300f('0xa9'))[_0x300f('0x43')](_0x300f('0xaa'))[_0x300f('0x43')](_0x300f('0xb3'),_0x16cfad[_0x300f('0xa7')][_0x300f('0xa8')]())[_0x300f('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x300f('0x43')](_0x300f('0xac'),squel[_0x300f('0x81')]()['field'](_0x300f('0xae'))['from'](_0x300f('0xa0'))[_0x300f('0x43')]('VoiceQueueId\x20=\x20?',_0x537f4d[_0x300f('0x4d')]['id'][_0x300f('0xa8')]())))['toString']();break;default:_0x14109f=squel['insert']()['into'](_0x300f('0xa0'))[_0x300f('0xa1')]([_0x300f('0xa2'),_0x300f('0xa3'),_0x300f('0xa4'),_0x300f('0xb1'),_0x300f('0x63'),_0x300f('0x5c'),_0x300f('0xa5')],squel[_0x300f('0x81')]()[_0x300f('0xa6')](_0x300f('0xa2'),_0x300f('0xa2'))[_0x300f('0xa6')](_0x300f('0xb2'),_0x300f('0xa3'))[_0x300f('0xa6')]('id',_0x300f('0xa4'))['field'](_0x16cfad[_0x300f('0xa7')][_0x300f('0xa8')](),_0x300f('0xb1'))['field'](_0x537f4d[_0x300f('0x4d')]['id'][_0x300f('0xa8')](),_0x300f('0x63'))['field'](_0x300f('0xb2'),'createdAt')[_0x300f('0xa6')](_0x300f('0xb2'),'updatedAt')['from']('cm_contacts')[_0x300f('0x43')](_0x300f('0xaa'))[_0x300f('0x43')](_0x300f('0xb3'),_0x16cfad[_0x300f('0xa7')][_0x300f('0xa8')]())[_0x300f('0x43')](_0x300f('0xab')))[_0x300f('0xa8')]();}_0x3d48ed[_0x300f('0x88')](db[_0x300f('0x89')][_0x300f('0x3b')](_0x14109f));}return BPromise[_0x300f('0x8f')](_0x3d48ed);}})[_0x300f('0x29')](function(){return _0x16e7c8;})[_0x300f('0x29')](respondWithResult(_0x2c57b3,null))[_0x300f('0x4b')](handleError(_0x2c57b3,null));};exports[_0x300f('0xb4')]=function(_0x48a737,_0x5259fd,_0x459eef){return db[_0x300f('0x38')]['find']({'where':{'id':_0x48a737[_0x300f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5259fd,null))[_0x300f('0x29')](function(_0x4af295){if(_0x4af295){return _0x4af295['removeLists'](_0x48a737['query'][_0x300f('0x7f')]);}})[_0x300f('0x29')](function(_0x135dd2){if(_0x135dd2){return db[_0x300f('0x60')][_0x300f('0x2a')]({'where':{'ListId':_0x48a737['query'][_0x300f('0x7f')],'VoiceQueueId':_0x48a737[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](function(){return _0x135dd2;});}})[_0x300f('0x29')](respondWithStatusCode(_0x5259fd,null))[_0x300f('0x4b')](handleError(_0x5259fd,null));};exports[_0x300f('0xb5')]=function(_0x29ce5b,_0x5c0636,_0x36d615){var _0x3fdf21={};var _0x416b60={};var _0x52120a;var _0x11494a;return db[_0x300f('0x38')][_0x300f('0x5f')]({'where':{'id':_0x29ce5b[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x5c0636,null))[_0x300f('0x29')](function(_0x391cf9){if(_0x391cf9){_0x52120a=_0x391cf9;_0x416b60[_0x300f('0x3a')]=_[_0x300f('0x4e')](db[_0x300f('0x9b')][_0x300f('0x39')]);_0x416b60[_0x300f('0x3b')]=_[_0x300f('0x4e')](_0x29ce5b['query']);_0x416b60['filters']=_[_0x300f('0x3e')](_0x416b60['model'],_0x416b60[_0x300f('0x3b')]);_0x3fdf21[_0x300f('0x3d')]=_[_0x300f('0x3e')](_0x416b60['model'],qs[_0x300f('0x3f')](_0x29ce5b['query']['fields']));_0x3fdf21['attributes']=_0x3fdf21[_0x300f('0x3d')]['length']?_0x3fdf21['attributes']:_0x416b60['model'];_0x3fdf21[_0x300f('0x41')]=qs[_0x300f('0x42')](_0x29ce5b[_0x300f('0x3b')][_0x300f('0x42')]);_0x3fdf21['where']=qs[_0x300f('0x3c')](_[_0x300f('0x44')](_0x29ce5b[_0x300f('0x3b')],_0x416b60[_0x300f('0x3c')]));if(_0x29ce5b[_0x300f('0x3b')]['filter']){_0x3fdf21[_0x300f('0x43')]=_[_0x300f('0x45')](_0x3fdf21['where'],{'$or':_[_0x300f('0x31')](_0x3fdf21['attributes'],function(_0x1ba2b7){var _0x80b19d={};_0x80b19d[_0x1ba2b7]={'$like':'%'+_0x29ce5b['query'][_0x300f('0x2f')]+'%'};return _0x80b19d;})});}_0x3fdf21=_[_0x300f('0x45')]({},_0x3fdf21,_0x29ce5b['options']);return _0x52120a[_0x300f('0xb5')](_0x3fdf21);}})['then'](function(_0x49da46){if(_0x49da46){_0x11494a=_0x49da46['length'];if(!_0x29ce5b['query'][_0x300f('0x62')](_0x300f('0x40'))){_0x3fdf21[_0x300f('0x21')]=qs[_0x300f('0x21')](_0x29ce5b[_0x300f('0x3b')][_0x300f('0x21')]);_0x3fdf21[_0x300f('0x1f')]=qs[_0x300f('0x1f')](_0x29ce5b[_0x300f('0x3b')]['offset']);}return _0x52120a[_0x300f('0xb5')](_0x3fdf21);}})['then'](function(_0x595736){if(_0x595736){return _0x595736?{'count':_0x11494a,'rows':_0x595736}:null;}})['then'](respondWithResult(_0x5c0636,null))['catch'](handleError(_0x5c0636,null));};exports[_0x300f('0xb6')]=function(_0x28fdd1,_0xf4c293,_0x60c3f3){var _0x1a65f9,_0x417ec6;return db[_0x300f('0x38')]['find']({'where':{'id':_0x28fdd1[_0x300f('0x4d')]['id']}})['then'](handleEntityNotFound(_0xf4c293,null))[_0x300f('0x29')](function(_0x275890){if(_0x275890){_0x417ec6=_0x275890;return _0x275890[_0x300f('0xb6')](_0x28fdd1[_0x300f('0x52')][_0x300f('0x7f')],_[_0x300f('0x5b')](_0x28fdd1[_0x300f('0x52')],[_0x300f('0x7f'),'id'])||{});}return null;})[_0x300f('0x94')](function(_0x8c7062){var _0x4138ff;_0x1a65f9=_0x8c7062||[];var _0x1f00a5=[];if(_0x8c7062){for(var _0x3a084f=0x0;_0x3a084f<_0x8c7062[_0x300f('0x61')];_0x3a084f+=0x1){var _0x3c3f9b=_0x8c7062[_0x3a084f]['get']({'plain':!![]});_0x4138ff=squel[_0x300f('0xb0')]()[_0x300f('0x9f')](_0x300f('0xb7'))[_0x300f('0xa1')]([_0x300f('0xa2'),_0x300f('0xa4'),'ListId',_0x300f('0x63'),_0x300f('0x5c'),_0x300f('0xa5')],squel[_0x300f('0x81')]()[_0x300f('0xa6')](_0x300f('0xa2'),_0x300f('0xa2'))[_0x300f('0xa6')]('id',_0x300f('0xa4'))[_0x300f('0xa6')](_0x3c3f9b[_0x300f('0xa7')][_0x300f('0xa8')](),_0x300f('0xb1'))[_0x300f('0xa6')](_0x28fdd1['params']['id'][_0x300f('0xa8')](),_0x300f('0x63'))[_0x300f('0xa6')](_0x300f('0xb2'),'createdAt')[_0x300f('0xa6')](_0x300f('0xb2'),_0x300f('0xa5'))[_0x300f('0x83')](_0x300f('0xa9'))[_0x300f('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0x300f('0xb3'),_0x3c3f9b[_0x300f('0xa7')][_0x300f('0xa8')]())[_0x300f('0x43')](_0x300f('0xab')))['toString']();_0x1f00a5[_0x300f('0x88')](db['sequelize'][_0x300f('0x3b')](_0x4138ff));}return BPromise[_0x300f('0x8f')](_0x1f00a5);}})[_0x300f('0x29')](function(){return _0x1a65f9;})[_0x300f('0x29')](respondWithResult(_0xf4c293,null))[_0x300f('0x4b')](handleError(_0xf4c293,null));};exports[_0x300f('0xb8')]=function(_0x19cfe2,_0x2ba5df,_0x5f1c1d){return db['VoiceQueue'][_0x300f('0x50')]({'where':{'id':_0x19cfe2[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](handleEntityNotFound(_0x2ba5df,null))[_0x300f('0x29')](function(_0xdc47f6){if(_0xdc47f6){return _0xdc47f6[_0x300f('0xb8')](_0x19cfe2[_0x300f('0x3b')][_0x300f('0x7f')]);}})[_0x300f('0x29')](function(_0xedf953){if(_0xedf953){return db[_0x300f('0x68')][_0x300f('0x2a')]({'where':{'ListId':_0x19cfe2[_0x300f('0x3b')][_0x300f('0x7f')],'VoiceQueueId':_0x19cfe2[_0x300f('0x4d')]['id']}})[_0x300f('0x29')](function(){return _0xedf953;});}})['then'](respondWithStatusCode(_0x2ba5df,null))[_0x300f('0x4b')](handleError(_0x2ba5df,null));}; \ No newline at end of file +var _0xdd21=['online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','all','compact','isEmpty','removeAgents','addAgents','spread','User','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','cm_hopper','phone','scheduledAt','ListId','field','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','into','fromQuery','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','includes','type','name','sendStatus','stack','send','VoiceQueue','rawAttributes','fieldName','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','clone','intersection','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams'];(function(_0x4f691f,_0x1abd4f){var _0x5303eb=function(_0x48900a){while(--_0x48900a){_0x4f691f['push'](_0x4f691f['shift']());}};_0x5303eb(++_0x1abd4f);}(_0xdd21,0x1b7));var _0x1dd2=function(_0x4bad92,_0x3fb493){_0x4bad92=_0x4bad92-0x0;var _0x4bb5c8=_0xdd21[_0x4bad92];return _0x4bb5c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1dd2('0x0'));var zipdir=require(_0x1dd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1dd2('0x2'));var moment=require(_0x1dd2('0x3'));var BPromise=require(_0x1dd2('0x4'));var Mustache=require('mustache');var util=require(_0x1dd2('0x5'));var path=require(_0x1dd2('0x6'));var sox=require('sox');var csv=require(_0x1dd2('0x7'));var ejs=require(_0x1dd2('0x8'));var fs=require('fs');var fs_extra=require(_0x1dd2('0x9'));var _=require(_0x1dd2('0xa'));var squel=require(_0x1dd2('0xb'));var crypto=require(_0x1dd2('0xc'));var jsforce=require(_0x1dd2('0xd'));var deskjs=require(_0x1dd2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1dd2('0xf'));var authService=require(_0x1dd2('0x10'));var qs=require(_0x1dd2('0x11'));var as=require(_0x1dd2('0x12'));var hardwareService=require(_0x1dd2('0x13'));var logger=require(_0x1dd2('0x14'))('api');var utils=require(_0x1dd2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1dd2('0x16'));var db=require(_0x1dd2('0x17'))['db'];config['redis']=_[_0x1dd2('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1dd2('0x19')]));require('./voiceQueue.socket')[_0x1dd2('0x1a')](socket);function respondWithStatusCode(_0x2bc829,_0x4e46c2){_0x4e46c2=_0x4e46c2||0xcc;return function(_0x6110a4){if(_0x6110a4){return _0x2bc829['sendStatus'](_0x4e46c2);}return _0x2bc829['status'](_0x4e46c2)[_0x1dd2('0x1b')]();};}function respondWithResult(_0x3daa92,_0x29c022){_0x29c022=_0x29c022||0xc8;return function(_0x1985dd){if(_0x1985dd){return _0x3daa92[_0x1dd2('0x1c')](_0x29c022)[_0x1dd2('0x1d')](_0x1985dd);}};}function respondWithFilteredResult(_0x2dfa88,_0x4cc0d6){return function(_0x2fd600){if(_0x2fd600){var _0x1a6956=typeof _0x4cc0d6[_0x1dd2('0x1e')]===_0x1dd2('0x1f')&&typeof _0x4cc0d6[_0x1dd2('0x20')]===_0x1dd2('0x1f');var _0x539a53=_0x2fd600[_0x1dd2('0x21')];var _0x28e910=_0x1a6956?0x0:_0x4cc0d6[_0x1dd2('0x1e')];var _0x58daad=_0x1a6956?_0x2fd600[_0x1dd2('0x21')]:_0x4cc0d6['offset']+_0x4cc0d6[_0x1dd2('0x20')];var _0x5e4b66;if(_0x58daad>=_0x539a53){_0x58daad=_0x539a53;_0x5e4b66=0xc8;}else{_0x5e4b66=0xce;}_0x2dfa88[_0x1dd2('0x1c')](_0x5e4b66);return _0x2dfa88[_0x1dd2('0x22')](_0x1dd2('0x23'),_0x28e910+'-'+_0x58daad+'/'+_0x539a53)[_0x1dd2('0x1d')](_0x2fd600);}return null;};}function patchUpdates(_0x382b10){return function(_0x3bcb08){try{jsonpatch[_0x1dd2('0x24')](_0x3bcb08,_0x382b10,!![]);}catch(_0x42abe2){return BPromise[_0x1dd2('0x25')](_0x42abe2);}return _0x3bcb08['save']();};}function saveUpdates(_0x44e6a5,_0x6bae5f){return function(_0x3d7497){if(_0x3d7497){return _0x3d7497[_0x1dd2('0x26')](_0x44e6a5)[_0x1dd2('0x27')](function(_0x4a6e80){return _0x4a6e80;});}return null;};}function removeEntity(_0x2dac11,_0x240a2c){return function(_0x4bde8c){if(_0x4bde8c){return _0x4bde8c[_0x1dd2('0x28')]()['then'](function(){var _0x4839d4=_0x4bde8c[_0x1dd2('0x29')]({'plain':!![]});var _0x51a245=[{'name':_0x1dd2('0x2a'),'value':'inbound','ignore':![]},{'name':_0x1dd2('0x2b'),'value':'outbound','ignore':![]}];var _0x22a797=_(_0x51a245)[_0x1dd2('0x2c')]('ignore')[_0x1dd2('0x2d')](_0x1dd2('0x2e'))[_0x1dd2('0x2e')]();if(_[_0x1dd2('0x2f')](_0x22a797,_0x4839d4['type'])){return;}var _0x486ea4=_['find'](_0x51a245,[_0x1dd2('0x2e'),_0x4839d4[_0x1dd2('0x30')]])[_0x1dd2('0x31')];return db['UserProfileResource'][_0x1dd2('0x28')]({'where':{'type':_0x486ea4,'resourceId':_0x4839d4['id']}})[_0x1dd2('0x27')](function(){return _0x4bde8c;});})[_0x1dd2('0x27')](function(){_0x2dac11[_0x1dd2('0x1c')](0xcc)[_0x1dd2('0x1b')]();});}};}function handleEntityNotFound(_0x1953cd,_0x59b58c){return function(_0x3ab68b){if(!_0x3ab68b){_0x1953cd[_0x1dd2('0x32')](0x194);}return _0x3ab68b;};}function handleError(_0x1a332c,_0x2a9743){_0x2a9743=_0x2a9743||0x1f4;return function(_0x2bab7f){logger['error'](_0x2bab7f[_0x1dd2('0x33')]);if(_0x2bab7f['name']){delete _0x2bab7f[_0x1dd2('0x31')];}_0x1a332c[_0x1dd2('0x1c')](_0x2a9743)[_0x1dd2('0x34')](_0x2bab7f);};}exports['index']=function(_0x3f35d5,_0x410aec){var _0xfdd75a={},_0x3790b8={},_0x364a57={'count':0x0,'rows':[]};var _0x8775f0=_[_0x1dd2('0x2d')](db[_0x1dd2('0x35')][_0x1dd2('0x36')],function(_0x12c684){return{'name':_0x12c684[_0x1dd2('0x37')],'type':_0x12c684[_0x1dd2('0x30')]['key']};});_0x3790b8[_0x1dd2('0x38')]=_['map'](_0x8775f0,_0x1dd2('0x31'));_0x3790b8['query']=_[_0x1dd2('0x39')](_0x3f35d5[_0x1dd2('0x3a')]);_0x3790b8['filters']=_['intersection'](_0x3790b8[_0x1dd2('0x38')],_0x3790b8[_0x1dd2('0x3a')]);_0xfdd75a[_0x1dd2('0x3b')]=_['intersection'](_0x3790b8[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x3f35d5[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0xfdd75a[_0x1dd2('0x3b')]=_0xfdd75a[_0x1dd2('0x3b')][_0x1dd2('0x3d')]?_0xfdd75a[_0x1dd2('0x3b')]:_0x3790b8[_0x1dd2('0x38')];if(!_0x3f35d5[_0x1dd2('0x3a')][_0x1dd2('0x3e')](_0x1dd2('0x3f'))){_0xfdd75a['limit']=qs[_0x1dd2('0x20')](_0x3f35d5[_0x1dd2('0x3a')][_0x1dd2('0x20')]);_0xfdd75a[_0x1dd2('0x1e')]=qs[_0x1dd2('0x1e')](_0x3f35d5[_0x1dd2('0x3a')][_0x1dd2('0x1e')]);}_0xfdd75a[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x3f35d5[_0x1dd2('0x3a')][_0x1dd2('0x41')]);_0xfdd75a[_0x1dd2('0x42')]=qs[_0x1dd2('0x43')](_[_0x1dd2('0x44')](_0x3f35d5[_0x1dd2('0x3a')],_0x3790b8[_0x1dd2('0x43')]),_0x8775f0);if(_0x3f35d5[_0x1dd2('0x3a')]['filter']){_0xfdd75a[_0x1dd2('0x42')]=_[_0x1dd2('0x45')](_0xfdd75a['where'],{'$or':_[_0x1dd2('0x2d')](_0x8775f0,function(_0x417d3c){if(_0x417d3c[_0x1dd2('0x30')]!==_0x1dd2('0x46')){var _0x2d22ec={};_0x2d22ec[_0x417d3c['name']]={'$like':'%'+_0x3f35d5[_0x1dd2('0x3a')][_0x1dd2('0x2c')]+'%'};return _0x2d22ec;}})});}_0xfdd75a=_[_0x1dd2('0x45')]({},_0xfdd75a,_0x3f35d5['options']);var _0x27608e={'where':_0xfdd75a['where']};return db['VoiceQueue']['count'](_0x27608e)[_0x1dd2('0x27')](function(_0xceec02){_0x364a57[_0x1dd2('0x21')]=_0xceec02;if(_0x3f35d5['query'][_0x1dd2('0x47')]){_0xfdd75a[_0x1dd2('0x48')]=[{'all':!![]}];}return db[_0x1dd2('0x35')][_0x1dd2('0x49')](_0xfdd75a);})[_0x1dd2('0x27')](function(_0xab3142){_0x364a57['rows']=_0xab3142;return _0x364a57;})[_0x1dd2('0x27')](respondWithFilteredResult(_0x410aec,_0xfdd75a))['catch'](handleError(_0x410aec,null));};exports[_0x1dd2('0x4a')]=function(_0x3ceba7,_0x37d788){var _0x5da771={'raw':![],'where':{'id':_0x3ceba7[_0x1dd2('0x4b')]['id']}},_0x21c2ac={};_0x21c2ac['model']=_['keys'](db[_0x1dd2('0x35')][_0x1dd2('0x36')]);_0x21c2ac['query']=_['keys'](_0x3ceba7[_0x1dd2('0x3a')]);_0x21c2ac[_0x1dd2('0x43')]=_['intersection'](_0x21c2ac[_0x1dd2('0x38')],_0x21c2ac['query']);_0x5da771[_0x1dd2('0x3b')]=_['intersection'](_0x21c2ac[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x3ceba7['query'][_0x1dd2('0x3c')]));_0x5da771[_0x1dd2('0x3b')]=_0x5da771[_0x1dd2('0x3b')]['length']?_0x5da771[_0x1dd2('0x3b')]:_0x21c2ac[_0x1dd2('0x38')];if(_0x3ceba7[_0x1dd2('0x3a')]['includeAll']){_0x5da771[_0x1dd2('0x48')]=[{'all':!![]}];}_0x5da771=_[_0x1dd2('0x45')]({},_0x5da771,_0x3ceba7[_0x1dd2('0x4c')]);return db[_0x1dd2('0x35')][_0x1dd2('0x4d')](_0x5da771)['then'](handleEntityNotFound(_0x37d788,null))[_0x1dd2('0x27')](respondWithResult(_0x37d788,null))[_0x1dd2('0x4e')](handleError(_0x37d788,null));};exports[_0x1dd2('0x4f')]=function(_0x54d83b,_0x540e97){return db[_0x1dd2('0x35')]['create'](_0x54d83b[_0x1dd2('0x50')],{})[_0x1dd2('0x27')](function(_0x5e30e0){var _0x2a8fca=_0x54d83b['user'][_0x1dd2('0x29')]({'plain':!![]});if(!_0x2a8fca)throw new Error(_0x1dd2('0x51'));if(_0x2a8fca[_0x1dd2('0x52')]===_0x1dd2('0x53')){var _0xfb1faa=_0x5e30e0['get']({'plain':!![]});var _0x5c6559=[{'name':_0x1dd2('0x2a'),'value':_0x1dd2('0x54')},{'name':_0x1dd2('0x2b'),'value':_0x1dd2('0x55')}];var _0x20286d=_[_0x1dd2('0x4d')](_0x5c6559,['value',_0xfb1faa[_0x1dd2('0x30')]])[_0x1dd2('0x31')];return db[_0x1dd2('0x56')][_0x1dd2('0x4d')]({'where':{'name':_0x20286d,'userProfileId':_0x2a8fca[_0x1dd2('0x57')]},'raw':!![]})[_0x1dd2('0x27')](function(_0x5340aa){if(_0x5340aa&&_0x5340aa[_0x1dd2('0x58')]===0x0){return db[_0x1dd2('0x59')][_0x1dd2('0x4f')]({'name':_0xfb1faa['name'],'resourceId':_0xfb1faa['id'],'type':_0x5340aa['name'],'sectionId':_0x5340aa['id']},{})['then'](function(){return _0x5e30e0;});}else{return _0x5e30e0;}})[_0x1dd2('0x4e')](function(_0x40ba9e){logger[_0x1dd2('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40ba9e);throw _0x40ba9e;});}return _0x5e30e0;})[_0x1dd2('0x27')](respondWithResult(_0x540e97,0xc9))[_0x1dd2('0x4e')](handleError(_0x540e97,null));};exports[_0x1dd2('0x5b')]=function(_0xcf9e39,_0xe15684){var _0xbbe5bf={'where':{'id':_0xcf9e39[_0x1dd2('0x4b')]['id']}},_0x1be8b8={};_0x1be8b8[_0x1dd2('0x38')]=_[_0x1dd2('0x39')](db['VoiceQueue'][_0x1dd2('0x36')]);_0xbbe5bf[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x1be8b8[_0x1dd2('0x38')],qs['fields'](_0xcf9e39[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0xbbe5bf[_0x1dd2('0x3b')]=_0xbbe5bf['attributes']['length']?_0xbbe5bf['attributes']:_0x1be8b8[_0x1dd2('0x38')];if(_0xcf9e39[_0x1dd2('0x3a')][_0x1dd2('0x47')]){_0xbbe5bf['include']=[{'all':!![]}];}_0xbbe5bf=_[_0x1dd2('0x45')]({},_0xbbe5bf,_0xcf9e39[_0x1dd2('0x4c')]);return db['VoiceQueue'][_0x1dd2('0x4d')](_0xbbe5bf)[_0x1dd2('0x27')](handleEntityNotFound(_0xe15684,null))['then'](function(_0x157872){if(_0x157872){var _0x109281=_0x157872[_0x1dd2('0x29')]({'plain':!![]});_0x109281=qs[_0x1dd2('0x5d')](_0x109281,['id',_0x1dd2('0x5e'),'updatedAt']);_0xcf9e39[_0x1dd2('0x50')]=_[_0x1dd2('0x5d')](_0xcf9e39[_0x1dd2('0x50')],['id','createdAt',_0x1dd2('0x5f')]);return db[_0x1dd2('0x35')][_0x1dd2('0x4f')](_[_0x1dd2('0x45')](_0x109281,_0xcf9e39[_0x1dd2('0x50')]),{'include':_0xcf9e39[_0x1dd2('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x1dd2('0x27')](function(_0x1a7f74){var _0x75e0a8=_0xcf9e39[_0x1dd2('0x53')][_0x1dd2('0x29')]({'plain':!![]});if(!_0x75e0a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x75e0a8[_0x1dd2('0x52')]==='user'){var _0x1bf905=_0x1a7f74[_0x1dd2('0x29')]({'plain':!![]});var _0x4d9d76=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x1dd2('0x2b'),'value':_0x1dd2('0x55')}];var _0x4ed621=_[_0x1dd2('0x4d')](_0x4d9d76,[_0x1dd2('0x2e'),_0x1bf905[_0x1dd2('0x30')]])[_0x1dd2('0x31')];return db[_0x1dd2('0x56')][_0x1dd2('0x4d')]({'where':{'name':_0x4ed621,'userProfileId':_0x75e0a8[_0x1dd2('0x57')]},'raw':!![]})[_0x1dd2('0x27')](function(_0x5d10c7){if(_0x5d10c7&&_0x5d10c7[_0x1dd2('0x58')]===0x0){return db['UserProfileResource'][_0x1dd2('0x4f')]({'name':_0x1bf905[_0x1dd2('0x31')],'resourceId':_0x1bf905['id'],'type':_0x5d10c7[_0x1dd2('0x31')],'sectionId':_0x5d10c7['id']},{})[_0x1dd2('0x27')](function(){return _0x1a7f74;});}else{return _0x1a7f74;}})['catch'](function(_0x2bd058){logger[_0x1dd2('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bd058);throw _0x2bd058;});}return _0x1a7f74;});}})[_0x1dd2('0x27')](respondWithResult(_0xe15684,0xc9))[_0x1dd2('0x4e')](handleError(_0xe15684,null));};exports[_0x1dd2('0x26')]=function(_0x46fea7,_0x401cee){if(_0x46fea7['body']['id']){delete _0x46fea7[_0x1dd2('0x50')]['id'];}return db[_0x1dd2('0x35')]['find']({'where':{'id':_0x46fea7[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x401cee,null))[_0x1dd2('0x27')](saveUpdates(_0x46fea7['body'],null))[_0x1dd2('0x27')](respondWithResult(_0x401cee,null))['catch'](handleError(_0x401cee,null));};exports[_0x1dd2('0x28')]=function(_0x57d5db,_0x5b648b){return db[_0x1dd2('0x35')]['find']({'where':{'id':_0x57d5db[_0x1dd2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b648b,null))[_0x1dd2('0x27')](removeEntity(_0x5b648b,null))[_0x1dd2('0x4e')](handleError(_0x5b648b,null));};exports[_0x1dd2('0x60')]=function(_0x4d3945,_0x1824a7,_0x459938){var _0x1d5a11={'raw':![],'where':{}};var _0x8cadb={};var _0x163343={'count':0x0,'rows':[]};return db[_0x1dd2('0x35')][_0x1dd2('0x61')]({'where':{'id':_0x4d3945[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x1824a7,null))[_0x1dd2('0x27')](function(_0x5c7841){if(_0x5c7841){_0x8cadb['model']=_[_0x1dd2('0x39')](db[_0x1dd2('0x62')]['rawAttributes']);_0x8cadb[_0x1dd2('0x3a')]=_[_0x1dd2('0x39')](_0x4d3945[_0x1dd2('0x3a')]);_0x8cadb['filters']=_[_0x1dd2('0x5c')](_0x8cadb[_0x1dd2('0x38')],_0x8cadb['query']);_0x1d5a11[_0x1dd2('0x3b')]=_['intersection'](_0x8cadb[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x4d3945['query'][_0x1dd2('0x3c')]));_0x1d5a11[_0x1dd2('0x3b')]=_0x1d5a11[_0x1dd2('0x3b')]['length']?_0x1d5a11['attributes']:_0x8cadb[_0x1dd2('0x38')];if(!_0x4d3945[_0x1dd2('0x3a')]['hasOwnProperty'](_0x1dd2('0x3f'))){_0x1d5a11[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x4d3945['query'][_0x1dd2('0x20')]);_0x1d5a11[_0x1dd2('0x1e')]=qs['offset'](_0x4d3945[_0x1dd2('0x3a')]['offset']);}_0x1d5a11[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x4d3945[_0x1dd2('0x3a')][_0x1dd2('0x41')]);_0x1d5a11[_0x1dd2('0x42')]=qs[_0x1dd2('0x43')](_[_0x1dd2('0x44')](_0x4d3945[_0x1dd2('0x3a')],_0x8cadb[_0x1dd2('0x43')]));_0x1d5a11[_0x1dd2('0x42')]['VoiceQueueId']=_0x5c7841['id'];if(_0x4d3945[_0x1dd2('0x3a')][_0x1dd2('0x2c')]){_0x1d5a11['where']=_[_0x1dd2('0x45')](_0x1d5a11[_0x1dd2('0x42')],{'$or':_['map'](_0x1d5a11[_0x1dd2('0x3b')],function(_0x408f95){var _0x4ba476={};_0x4ba476[_0x408f95]={'$like':'%'+_0x4d3945[_0x1dd2('0x3a')]['filter']+'%'};return _0x4ba476;})});}_0x1d5a11=_[_0x1dd2('0x45')]({},_0x1d5a11,_0x4d3945[_0x1dd2('0x4c')]);return db[_0x1dd2('0x62')][_0x1dd2('0x21')]({'where':_0x1d5a11[_0x1dd2('0x42')]})['then'](function(_0x3fecdc){_0x163343[_0x1dd2('0x21')]=_0x3fecdc;if(_0x4d3945['query'][_0x1dd2('0x47')]){_0x1d5a11[_0x1dd2('0x48')]=[{'all':!![]}];}return db[_0x1dd2('0x62')][_0x1dd2('0x49')](_0x1d5a11);})[_0x1dd2('0x27')](function(_0x20cdbf){_0x163343[_0x1dd2('0x63')]=_0x20cdbf;return _0x163343;});}})[_0x1dd2('0x27')](respondWithFilteredResult(_0x1824a7,_0x1d5a11))['catch'](handleError(_0x1824a7,null));};exports[_0x1dd2('0x64')]=function(_0x41ec76,_0x106a8e,_0x4e05fa){var _0x2284f1={'raw':!![],'where':{}};var _0x20a746={};var _0x2fc99e={'count':0x0,'rows':[]};return db[_0x1dd2('0x35')]['findOne']({'where':{'id':_0x41ec76[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x106a8e,null))[_0x1dd2('0x27')](function(_0x88a1c0){if(_0x88a1c0){_0x20a746[_0x1dd2('0x38')]=_['keys'](db[_0x1dd2('0x65')][_0x1dd2('0x36')]);_0x20a746[_0x1dd2('0x3a')]=_[_0x1dd2('0x39')](_0x41ec76[_0x1dd2('0x3a')]);_0x20a746['filters']=_[_0x1dd2('0x5c')](_0x20a746['model'],_0x20a746[_0x1dd2('0x3a')]);_0x2284f1[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x20a746['model'],qs[_0x1dd2('0x3c')](_0x41ec76[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x2284f1[_0x1dd2('0x3b')]=_0x2284f1[_0x1dd2('0x3b')][_0x1dd2('0x3d')]?_0x2284f1['attributes']:_0x20a746[_0x1dd2('0x38')];if(!_0x41ec76[_0x1dd2('0x3a')]['hasOwnProperty'](_0x1dd2('0x3f'))){_0x2284f1[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x41ec76['query']['limit']);_0x2284f1[_0x1dd2('0x1e')]=qs['offset'](_0x41ec76[_0x1dd2('0x3a')][_0x1dd2('0x1e')]);}_0x2284f1[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x41ec76[_0x1dd2('0x3a')][_0x1dd2('0x41')]);_0x2284f1[_0x1dd2('0x42')]=qs['filters'](_[_0x1dd2('0x44')](_0x41ec76[_0x1dd2('0x3a')],_0x20a746[_0x1dd2('0x43')]));_0x2284f1['where']['VoiceQueueId']=_0x88a1c0['id'];if(_0x41ec76[_0x1dd2('0x3a')][_0x1dd2('0x2c')]){_0x2284f1[_0x1dd2('0x42')]=_[_0x1dd2('0x45')](_0x2284f1['where'],{'$or':_['map'](_0x2284f1[_0x1dd2('0x3b')],function(_0x345568){var _0x4a5340={};_0x4a5340[_0x345568]={'$like':'%'+_0x41ec76[_0x1dd2('0x3a')][_0x1dd2('0x2c')]+'%'};return _0x4a5340;})});}_0x2284f1=_[_0x1dd2('0x45')]({},_0x2284f1,_0x41ec76[_0x1dd2('0x4c')]);return db[_0x1dd2('0x65')]['count']({'where':_0x2284f1[_0x1dd2('0x42')]})[_0x1dd2('0x27')](function(_0x2ce87d){_0x2fc99e[_0x1dd2('0x21')]=_0x2ce87d;if(_0x41ec76[_0x1dd2('0x3a')]['includeAll']){_0x2284f1[_0x1dd2('0x48')]=[{'all':!![]}];}return db[_0x1dd2('0x65')][_0x1dd2('0x49')](_0x2284f1);})[_0x1dd2('0x27')](function(_0x2c4c46){_0x2fc99e[_0x1dd2('0x63')]=_0x2c4c46;return _0x2fc99e;});}})[_0x1dd2('0x27')](respondWithFilteredResult(_0x106a8e,_0x2284f1))['catch'](handleError(_0x106a8e,null));};exports[_0x1dd2('0x66')]=function(_0x4c6aa3,_0x376f6c,_0x192e78){var _0x484176={'raw':!![],'where':{}};var _0x5aada2={};var _0x23fcc6={'count':0x0,'rows':[]};return db[_0x1dd2('0x35')][_0x1dd2('0x61')]({'where':{'id':_0x4c6aa3[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x376f6c,null))[_0x1dd2('0x27')](function(_0x26f5b4){if(_0x26f5b4){_0x5aada2['model']=_[_0x1dd2('0x39')](db['CmHopperFinal'][_0x1dd2('0x36')]);_0x5aada2[_0x1dd2('0x3a')]=_[_0x1dd2('0x39')](_0x4c6aa3['query']);_0x5aada2[_0x1dd2('0x43')]=_[_0x1dd2('0x5c')](_0x5aada2[_0x1dd2('0x38')],_0x5aada2[_0x1dd2('0x3a')]);_0x484176[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x5aada2[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x4c6aa3[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x484176[_0x1dd2('0x3b')]=_0x484176[_0x1dd2('0x3b')][_0x1dd2('0x3d')]?_0x484176['attributes']:_0x5aada2[_0x1dd2('0x38')];if(!_0x4c6aa3[_0x1dd2('0x3a')][_0x1dd2('0x3e')](_0x1dd2('0x3f'))){_0x484176[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x4c6aa3[_0x1dd2('0x3a')]['limit']);_0x484176[_0x1dd2('0x1e')]=qs['offset'](_0x4c6aa3[_0x1dd2('0x3a')][_0x1dd2('0x1e')]);}_0x484176['order']=qs[_0x1dd2('0x41')](_0x4c6aa3[_0x1dd2('0x3a')]['sort']);_0x484176[_0x1dd2('0x42')]=qs['filters'](_['pick'](_0x4c6aa3[_0x1dd2('0x3a')],_0x5aada2['filters']));_0x484176[_0x1dd2('0x42')][_0x1dd2('0x67')]=_0x26f5b4['id'];if(_0x4c6aa3[_0x1dd2('0x3a')]['filter']){_0x484176[_0x1dd2('0x42')]=_[_0x1dd2('0x45')](_0x484176['where'],{'$or':_['map'](_0x484176[_0x1dd2('0x3b')],function(_0x464bed){var _0x24441f={};_0x24441f[_0x464bed]={'$like':'%'+_0x4c6aa3[_0x1dd2('0x3a')][_0x1dd2('0x2c')]+'%'};return _0x24441f;})});}_0x484176=_[_0x1dd2('0x45')]({},_0x484176,_0x4c6aa3[_0x1dd2('0x4c')]);return db[_0x1dd2('0x68')]['count']({'where':_0x484176['where']})['then'](function(_0x1d3535){_0x23fcc6['count']=_0x1d3535;if(_0x4c6aa3[_0x1dd2('0x3a')][_0x1dd2('0x47')]){_0x484176[_0x1dd2('0x48')]=[{'all':!![]}];}return db[_0x1dd2('0x68')][_0x1dd2('0x49')](_0x484176);})[_0x1dd2('0x27')](function(_0x44498b){_0x23fcc6[_0x1dd2('0x63')]=_0x44498b;return _0x23fcc6;});}})['then'](respondWithFilteredResult(_0x376f6c,_0x484176))[_0x1dd2('0x4e')](handleError(_0x376f6c,null));};exports[_0x1dd2('0x69')]=function(_0x2dccf8,_0x3e2346,_0x1de6f2){var _0x250626={'raw':!![],'where':{}};var _0x40e7b2={};var _0x5eca6f={'count':0x0,'rows':[]};return db[_0x1dd2('0x35')]['findOne']({'where':{'id':_0x2dccf8[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x3e2346,null))[_0x1dd2('0x27')](function(_0x4b9abf){if(_0x4b9abf){_0x40e7b2['model']=_[_0x1dd2('0x39')](db[_0x1dd2('0x6a')]['rawAttributes']);_0x40e7b2[_0x1dd2('0x3a')]=_[_0x1dd2('0x39')](_0x2dccf8[_0x1dd2('0x3a')]);_0x40e7b2[_0x1dd2('0x43')]=_[_0x1dd2('0x5c')](_0x40e7b2['model'],_0x40e7b2[_0x1dd2('0x3a')]);_0x250626[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x40e7b2[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x2dccf8[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x250626['attributes']=_0x250626[_0x1dd2('0x3b')][_0x1dd2('0x3d')]?_0x250626[_0x1dd2('0x3b')]:_0x40e7b2[_0x1dd2('0x38')];if(!_0x2dccf8[_0x1dd2('0x3a')][_0x1dd2('0x3e')](_0x1dd2('0x3f'))){_0x250626['limit']=qs['limit'](_0x2dccf8[_0x1dd2('0x3a')][_0x1dd2('0x20')]);_0x250626[_0x1dd2('0x1e')]=qs[_0x1dd2('0x1e')](_0x2dccf8[_0x1dd2('0x3a')]['offset']);}_0x250626[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x2dccf8['query'][_0x1dd2('0x41')]);_0x250626[_0x1dd2('0x42')]=qs[_0x1dd2('0x43')](_[_0x1dd2('0x44')](_0x2dccf8['query'],_0x40e7b2[_0x1dd2('0x43')]));_0x250626[_0x1dd2('0x42')][_0x1dd2('0x67')]=_0x4b9abf['id'];if(_0x2dccf8[_0x1dd2('0x3a')]['filter']){_0x250626[_0x1dd2('0x42')]=_[_0x1dd2('0x45')](_0x250626[_0x1dd2('0x42')],{'$or':_['map'](_0x250626[_0x1dd2('0x3b')],function(_0x27e7e4){var _0x172b4c={};_0x172b4c[_0x27e7e4]={'$like':'%'+_0x2dccf8['query'][_0x1dd2('0x2c')]+'%'};return _0x172b4c;})});}_0x250626=_[_0x1dd2('0x45')]({},_0x250626,_0x2dccf8['options']);return db['CmHopperBlack'][_0x1dd2('0x21')]({'where':_0x250626['where']})[_0x1dd2('0x27')](function(_0x288021){_0x5eca6f['count']=_0x288021;if(_0x2dccf8['query'][_0x1dd2('0x47')]){_0x250626['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x1dd2('0x49')](_0x250626);})[_0x1dd2('0x27')](function(_0x8a311d){_0x5eca6f[_0x1dd2('0x63')]=_0x8a311d;return _0x5eca6f;});}})[_0x1dd2('0x27')](respondWithFilteredResult(_0x3e2346,_0x250626))[_0x1dd2('0x4e')](handleError(_0x3e2346,null));};exports[_0x1dd2('0x6b')]=function(_0x288870,_0x42cab0,_0x151565){var _0x48c9dc={};var _0x5c0f0b={};var _0x5b0940;var _0x1d0066;return db[_0x1dd2('0x35')][_0x1dd2('0x61')]({'where':{'id':_0x288870[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x42cab0,null))[_0x1dd2('0x27')](function(_0x915d42){if(_0x915d42){_0x5b0940=_0x915d42;_0x5c0f0b['model']=_[_0x1dd2('0x39')](db[_0x1dd2('0x6c')][_0x1dd2('0x36')]);_0x5c0f0b['query']=_[_0x1dd2('0x39')](_0x288870[_0x1dd2('0x3a')]);_0x5c0f0b[_0x1dd2('0x43')]=_[_0x1dd2('0x5c')](_0x5c0f0b[_0x1dd2('0x38')],_0x5c0f0b[_0x1dd2('0x3a')]);_0x48c9dc[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x5c0f0b[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x288870[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x48c9dc[_0x1dd2('0x3b')]=_0x48c9dc[_0x1dd2('0x3b')]['length']?_0x48c9dc[_0x1dd2('0x3b')]:_0x5c0f0b['model'];_0x48c9dc[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x288870[_0x1dd2('0x3a')]['sort']);_0x48c9dc[_0x1dd2('0x42')]=qs['filters'](_[_0x1dd2('0x44')](_0x288870[_0x1dd2('0x3a')],_0x5c0f0b['filters']));if(_0x288870[_0x1dd2('0x3a')]['filter']){_0x48c9dc['where']=_['merge'](_0x48c9dc[_0x1dd2('0x42')],{'$or':_[_0x1dd2('0x2d')](_0x48c9dc[_0x1dd2('0x3b')],function(_0x684ac7){var _0x283aff={};_0x283aff[_0x684ac7]={'$like':'%'+_0x288870[_0x1dd2('0x3a')][_0x1dd2('0x2c')]+'%'};return _0x283aff;})});}_0x48c9dc=_['merge']({},_0x48c9dc,_0x288870[_0x1dd2('0x4c')]);return _0x5b0940[_0x1dd2('0x6b')](_0x48c9dc);}})[_0x1dd2('0x27')](function(_0x131731){if(_0x131731){_0x1d0066=_0x131731['length'];if(!_0x288870[_0x1dd2('0x3a')]['hasOwnProperty'](_0x1dd2('0x3f'))){_0x48c9dc[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x288870[_0x1dd2('0x3a')][_0x1dd2('0x20')]);_0x48c9dc['offset']=qs['offset'](_0x288870['query']['offset']);}return _0x5b0940[_0x1dd2('0x6b')](_0x48c9dc);}})[_0x1dd2('0x27')](function(_0x3f849c){if(_0x3f849c){return _0x3f849c?{'count':_0x1d0066,'rows':_0x3f849c}:null;}})[_0x1dd2('0x27')](respondWithResult(_0x42cab0,null))['catch'](handleError(_0x42cab0,null));};exports['addTeams']=function(_0x3d2d8d,_0x4f8b95,_0x37c62b){var _0x54c55a=_0x3d2d8d['body'][_0x1dd2('0x6d')];var _0x73d8f4=_['map'](_0x54c55a,'id');return db[_0x1dd2('0x6c')][_0x1dd2('0x49')]({'where':{'id':_0x73d8f4},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1dd2('0x31'),_0x1dd2('0x6e'),_0x1dd2('0x6f'),_0x1dd2('0x70')],'raw':!![]}]})[_0x1dd2('0x27')](function(_0x1a9489){if(_0x1a9489){var _0x600c02=_['flatMap'](_0x1a9489,function(_0x234a6f){var _0x59856c=_0x234a6f[_0x1dd2('0x29')]({'plain':!![]});_0x59856c[_0x1dd2('0x71')][_0x1dd2('0x72')](function(_0x18fc90){_0x18fc90[_0x1dd2('0x73')]=_[_0x1dd2('0x4d')](_0x54c55a,{'id':_0x59856c['id']})[_0x1dd2('0x73')];});return _0x59856c[_0x1dd2('0x71')];});return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x3d2d8d[_0x1dd2('0x4b')]['id']}})['then'](function(_0x34edea){return db[_0x1dd2('0x74')][_0x1dd2('0x75')](function(_0x4e94cc){return _0x34edea[_0x1dd2('0x76')](_0x73d8f4,{'transaction':_0x4e94cc})[_0x1dd2('0x27')](function(){return BPromise[_0x1dd2('0x77')](_0x54c55a,function(_0x36047f){return db[_0x1dd2('0x78')][_0x1dd2('0x79')]({'TeamId':_0x36047f['id'],'VoiceQueueId':_0x3d2d8d['params']['id'],'penalty':_0x36047f[_0x1dd2('0x73')]},{'transaction':_0x4e94cc});});})[_0x1dd2('0x27')](function(){return BPromise[_0x1dd2('0x77')](_0x600c02,function(_0x4303bb){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x4303bb['id'],'VoiceQueueId':_0x3d2d8d[_0x1dd2('0x4b')]['id']},'defaults':{'penalty':_0x4303bb[_0x1dd2('0x73')]},'transaction':_0x4e94cc});});})[_0x1dd2('0x27')](function(){return BPromise['each'](_['filter'](_0x600c02,{'online':!![]}),function(_0x31bade){return db[_0x1dd2('0x7a')]['upsert']({'membername':_0x31bade['name'],'UserId':_0x31bade['id'],'queue_name':_0x34edea[_0x1dd2('0x31')],'VoiceQueueId':_0x34edea['id'],'interface':_[_0x1dd2('0x7b')](_0x31bade[_0x1dd2('0x70')])?util[_0x1dd2('0x7c')](_0x1dd2('0x7d'),_0x31bade[_0x1dd2('0x31')]):_0x31bade[_0x1dd2('0x70')],'paused':_0x31bade[_0x1dd2('0x6f')]||![],'penalty':_0x31bade['penalty']},{'transaction':_0x4e94cc});});})[_0x1dd2('0x27')](function(){_0x600c02[_0x1dd2('0x72')](function(_0x4a6c32){socket[_0x1dd2('0x7e')](_0x1dd2('0x7f'),{'UserId':_0x4a6c32['id'],'VoiceQueueId':_0x34edea['id']});});});});});}})[_0x1dd2('0x27')](respondWithStatusCode(_0x4f8b95,null))[_0x1dd2('0x4e')](handleError(_0x4f8b95,null));};exports[_0x1dd2('0x80')]=function(_0x266e10,_0x5a8b89,_0x4e600a){return db[_0x1dd2('0x6c')][_0x1dd2('0x49')]({'where':{'id':_0x266e10[_0x1dd2('0x3a')][_0x1dd2('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1dd2('0x71'),'attributes':['id'],'raw':!![]}]})[_0x1dd2('0x27')](handleEntityNotFound(_0x5a8b89,null))['then'](function(_0x249ce0){var _0xfb2170=_['map'](_0x249ce0,'id');var _0x4335a9=[];var _0x165c3f=[];var _0x55de66=squel[_0x1dd2('0x82')]();_0x55de66['field'](_0x1dd2('0x83'))[_0x1dd2('0x84')]('team_has_voice_queues','tq')[_0x1dd2('0x85')](_0x1dd2('0x86'),'ut',_0x1dd2('0x87'))[_0x1dd2('0x42')](_0x1dd2('0x88'),_0x266e10[_0x1dd2('0x4b')]['id']);for(var _0x220a66=0x0;_0x220a66<_0x249ce0[_0x1dd2('0x3d')];_0x220a66+=0x1){let _0x34d288=_0x249ce0[_0x220a66];for(var _0x3ca26a=0x0;_0x3ca26a<_0x34d288[_0x1dd2('0x71')][_0x1dd2('0x3d')];_0x3ca26a+=0x1){let _0x457297=_0x34d288[_0x1dd2('0x71')][_0x3ca26a];var _0x5cab74=_0x55de66[_0x1dd2('0x5b')]();_0x5cab74['where'](_0x1dd2('0x89'),_0x457297['id']);_0x165c3f[_0x1dd2('0x8a')](db[_0x1dd2('0x74')][_0x1dd2('0x3a')](_0x5cab74[_0x1dd2('0x8b')](),{'type':db['sequelize']['QueryTypes'][_0x1dd2('0x8c')]})[_0x1dd2('0x27')](function(_0x1fd7b4){if(_0x1fd7b4[_0x1dd2('0x3d')]===0x1){return _0x457297['id'];}else{var _0xf1d5cf=_[_0x1dd2('0x8d')](_[_0x1dd2('0x2d')](_0x1fd7b4,'TeamId'),function(_0x9fba79){return _[_0x1dd2('0x2f')](_0xfb2170,_0x9fba79);});if(_0xf1d5cf){return _0x457297['id'];}}}));}}return BPromise[_0x1dd2('0x8e')](_0x165c3f)[_0x1dd2('0x27')](function(_0x4c6829){_0x4335a9=_(_0x4335a9)['union'](_0x4c6829)[_0x1dd2('0x8f')]()['value']();return db['VoiceQueue']['find']({'where':{'id':_0x266e10[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](function(_0x1fe32e){return db['sequelize'][_0x1dd2('0x75')](function(_0x4a353a){return _0x1fe32e['removeTeams'](_0x266e10[_0x1dd2('0x3a')][_0x1dd2('0x81')],{'transaction':_0x4a353a})['then'](function(){if(!_[_0x1dd2('0x90')](_0x4335a9)){return _0x1fe32e[_0x1dd2('0x91')](_0x4335a9,{'transaction':_0x4a353a})[_0x1dd2('0x27')](function(){return db[_0x1dd2('0x7a')][_0x1dd2('0x28')]({'where':{'VoiceQueueId':_0x266e10[_0x1dd2('0x4b')]['id'],'UserId':_0x4335a9},'transaction':_0x4a353a});});}})[_0x1dd2('0x27')](function(){_0x4335a9[_0x1dd2('0x72')](function(_0x134131){socket[_0x1dd2('0x7e')]('userVoiceQueue:remove',{'UserId':_0x134131,'VoiceQueueId':_0x1fe32e['id']});});});});});});})[_0x1dd2('0x27')](respondWithStatusCode(_0x5a8b89,null))[_0x1dd2('0x4e')](handleError(_0x5a8b89,null));};exports['addAgents']=function(_0x6f01e5,_0x3d384c,_0x2e5d8f){var _0x5e8507,_0x2ac8ef;return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x6f01e5[_0x1dd2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d384c,null))[_0x1dd2('0x27')](function(_0x3f2662){if(_0x3f2662){_0x2ac8ef=_0x3f2662;return _0x3f2662[_0x1dd2('0x92')](_0x6f01e5[_0x1dd2('0x50')][_0x1dd2('0x81')],_[_0x1dd2('0x5d')](_0x6f01e5[_0x1dd2('0x50')],[_0x1dd2('0x81'),'id'])||{})[_0x1dd2('0x93')](function(_0x4f4c37){for(var _0x50ecff=0x0;_0x50ecff<_0x6f01e5[_0x1dd2('0x50')][_0x1dd2('0x81')][_0x1dd2('0x3d')];_0x50ecff+=0x1){socket[_0x1dd2('0x7e')]('userVoiceQueue:save',{'UserId':Number(_0x6f01e5['body'][_0x1dd2('0x81')][_0x50ecff]),'VoiceQueueId':Number(_0x6f01e5['params']['id'])});}return _0x4f4c37;});}})[_0x1dd2('0x27')](function(_0x549dce){_0x5e8507=_0x549dce||[];if(_0x2ac8ef){return db[_0x1dd2('0x94')][_0x1dd2('0x49')]({'where':{'id':_0x6f01e5[_0x1dd2('0x50')][_0x1dd2('0x81')]},'attributes':['id',_0x1dd2('0x31'),_0x1dd2('0x6e'),'voicePause',_0x1dd2('0x70')],'raw':!![]});}})['then'](function(_0x4084ff){if(!_[_0x1dd2('0x90')](_0x4084ff)){var _0x24c634=[];for(var _0x6cfdcb=0x0;_0x6cfdcb<_0x4084ff[_0x1dd2('0x3d')];_0x6cfdcb++){if(_0x4084ff[_0x6cfdcb][_0x1dd2('0x6e')]){_0x24c634[_0x1dd2('0x8a')](db[_0x1dd2('0x7a')][_0x1dd2('0x79')]({'membername':_0x4084ff[_0x6cfdcb][_0x1dd2('0x31')],'UserId':_0x4084ff[_0x6cfdcb]['id'],'queue_name':_0x2ac8ef[_0x1dd2('0x31')],'VoiceQueueId':_0x2ac8ef['id'],'interface':_['isNil'](_0x4084ff[_0x6cfdcb][_0x1dd2('0x70')])?util[_0x1dd2('0x7c')](_0x1dd2('0x7d'),_0x4084ff[_0x6cfdcb]['name']):_0x4084ff[_0x6cfdcb][_0x1dd2('0x70')],'paused':_0x4084ff[_0x6cfdcb]['voicePause']||![],'penalty':_0x6f01e5[_0x1dd2('0x50')][_0x1dd2('0x73')]||0x0}));}}return BPromise[_0x1dd2('0x8e')](_0x24c634);}})[_0x1dd2('0x27')](function(){return _0x5e8507;})['then'](respondWithResult(_0x3d384c,null))[_0x1dd2('0x4e')](handleError(_0x3d384c,null));};exports['removeAgents']=function(_0x107b8b,_0x2c7847,_0x1abe3f){return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x107b8b[_0x1dd2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c7847,null))[_0x1dd2('0x27')](function(_0x3c05a1){if(_0x3c05a1){return _0x3c05a1['removeAgents'](_0x107b8b['query']['ids'])[_0x1dd2('0x27')](function(){if(_[_0x1dd2('0x95')](_0x107b8b[_0x1dd2('0x3a')][_0x1dd2('0x81')])){for(var _0x12a370=0x0;_0x12a370<_0x107b8b[_0x1dd2('0x3a')][_0x1dd2('0x81')][_0x1dd2('0x3d')];_0x12a370+=0x1){socket[_0x1dd2('0x7e')](_0x1dd2('0x96'),{'UserId':Number(_0x107b8b[_0x1dd2('0x3a')][_0x1dd2('0x81')][_0x12a370]),'VoiceQueueId':Number(_0x107b8b[_0x1dd2('0x4b')]['id'])});}}else{socket[_0x1dd2('0x7e')](_0x1dd2('0x96'),{'UserId':Number(_0x107b8b['query'][_0x1dd2('0x81')]),'VoiceQueueId':Number(_0x107b8b[_0x1dd2('0x4b')]['id'])});}});}})[_0x1dd2('0x27')](function(_0x4c0a62){return db['UserVoiceQueueRt'][_0x1dd2('0x28')]({'where':{'VoiceQueueId':_0x107b8b[_0x1dd2('0x4b')]['id'],'UserId':_0x107b8b[_0x1dd2('0x3a')][_0x1dd2('0x81')]}})[_0x1dd2('0x27')](function(){return _0x4c0a62;});})[_0x1dd2('0x27')](respondWithStatusCode(_0x2c7847,null))[_0x1dd2('0x4e')](handleError(_0x2c7847,null));};exports[_0x1dd2('0x97')]=function(_0x22b45f,_0xaeaae3,_0xc2a615){var _0x2b4a00={};var _0x42a165={};var _0x52f99a;var _0x44dfd0;return db[_0x1dd2('0x35')][_0x1dd2('0x61')]({'where':{'id':_0x22b45f[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0xaeaae3,null))['then'](function(_0x402d0d){if(_0x402d0d){_0x52f99a=_0x402d0d;_0x42a165['model']=_['keys'](db['User'][_0x1dd2('0x36')]);_0x42a165[_0x1dd2('0x3a')]=_[_0x1dd2('0x39')](_0x22b45f[_0x1dd2('0x3a')]);_0x42a165['filters']=_['intersection'](_0x42a165['model'],_0x42a165['query']);_0x2b4a00[_0x1dd2('0x3b')]=_['intersection'](_0x42a165[_0x1dd2('0x38')],qs[_0x1dd2('0x3c')](_0x22b45f[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x2b4a00[_0x1dd2('0x3b')]=_0x2b4a00[_0x1dd2('0x3b')]['length']?_0x2b4a00[_0x1dd2('0x3b')]:_0x42a165[_0x1dd2('0x38')];_0x2b4a00[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x22b45f[_0x1dd2('0x3a')][_0x1dd2('0x41')]);_0x2b4a00['where']=qs[_0x1dd2('0x43')](_[_0x1dd2('0x44')](_0x22b45f[_0x1dd2('0x3a')],_0x42a165['filters']));if(_0x22b45f[_0x1dd2('0x3a')][_0x1dd2('0x2c')]){_0x2b4a00[_0x1dd2('0x42')]=_[_0x1dd2('0x45')](_0x2b4a00[_0x1dd2('0x42')],{'$or':_[_0x1dd2('0x2d')](_0x2b4a00[_0x1dd2('0x3b')],function(_0xc48bf0){var _0x1a0256={};_0x1a0256[_0xc48bf0]={'$like':'%'+_0x22b45f[_0x1dd2('0x3a')][_0x1dd2('0x2c')]+'%'};return _0x1a0256;})});}_0x2b4a00=_[_0x1dd2('0x45')]({},_0x2b4a00,_0x22b45f[_0x1dd2('0x4c')]);return _0x52f99a[_0x1dd2('0x97')](_0x2b4a00);}})[_0x1dd2('0x27')](function(_0x316414){if(_0x316414){_0x44dfd0=_0x316414[_0x1dd2('0x3d')];if(!_0x22b45f[_0x1dd2('0x3a')]['hasOwnProperty'](_0x1dd2('0x3f'))){_0x2b4a00['limit']=qs[_0x1dd2('0x20')](_0x22b45f[_0x1dd2('0x3a')][_0x1dd2('0x20')]);_0x2b4a00['offset']=qs[_0x1dd2('0x1e')](_0x22b45f[_0x1dd2('0x3a')][_0x1dd2('0x1e')]);}return _0x52f99a[_0x1dd2('0x97')](_0x2b4a00);}})[_0x1dd2('0x27')](function(_0x562bbb){if(_0x562bbb){return _0x562bbb?{'count':_0x44dfd0,'rows':_0x562bbb}:null;}})[_0x1dd2('0x27')](respondWithResult(_0xaeaae3,null))[_0x1dd2('0x4e')](handleError(_0xaeaae3,null));};exports['getMembers']=function(_0x43b6ad,_0x49e626,_0x3625e7){var _0x57201c={};var _0x36ab56={};var _0x5bda73;var _0x20283b;return db['VoiceQueue'][_0x1dd2('0x61')]({'where':{'id':_0x43b6ad[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x49e626,null))[_0x1dd2('0x27')](function(_0x523d6d){if(_0x523d6d){_0x5bda73=_0x523d6d;_0x36ab56['model']=_[_0x1dd2('0x39')](db[_0x1dd2('0x7a')][_0x1dd2('0x36')]);_0x36ab56[_0x1dd2('0x3a')]=_[_0x1dd2('0x39')](_0x43b6ad[_0x1dd2('0x3a')]);_0x36ab56[_0x1dd2('0x43')]=_[_0x1dd2('0x5c')](_0x36ab56[_0x1dd2('0x38')],_0x36ab56[_0x1dd2('0x3a')]);_0x57201c[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x36ab56[_0x1dd2('0x38')],qs['fields'](_0x43b6ad[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x57201c[_0x1dd2('0x3b')]=_0x57201c[_0x1dd2('0x3b')][_0x1dd2('0x3d')]?_0x57201c['attributes']:_0x36ab56[_0x1dd2('0x38')];_0x57201c[_0x1dd2('0x40')]=qs[_0x1dd2('0x41')](_0x43b6ad['query'][_0x1dd2('0x41')]);_0x57201c[_0x1dd2('0x42')]=qs[_0x1dd2('0x43')](_[_0x1dd2('0x44')](_0x43b6ad[_0x1dd2('0x3a')],_0x36ab56['filters']));if(_0x43b6ad[_0x1dd2('0x3a')][_0x1dd2('0x2c')]){_0x57201c[_0x1dd2('0x42')]=_['merge'](_0x57201c[_0x1dd2('0x42')],{'$or':_[_0x1dd2('0x2d')](_0x57201c[_0x1dd2('0x3b')],function(_0x54d605){var _0x5a262a={};_0x5a262a[_0x54d605]={'$like':'%'+_0x43b6ad['query'][_0x1dd2('0x2c')]+'%'};return _0x5a262a;})});}_0x57201c=_[_0x1dd2('0x45')]({},_0x57201c,_0x43b6ad['options']);return _0x5bda73[_0x1dd2('0x98')](_0x57201c);}})[_0x1dd2('0x27')](function(_0x1f3977){if(_0x1f3977){_0x20283b=_0x1f3977[_0x1dd2('0x3d')];if(!_0x43b6ad[_0x1dd2('0x3a')]['hasOwnProperty'](_0x1dd2('0x3f'))){_0x57201c['limit']=qs[_0x1dd2('0x20')](_0x43b6ad['query'][_0x1dd2('0x20')]);_0x57201c['offset']=qs[_0x1dd2('0x1e')](_0x43b6ad[_0x1dd2('0x3a')][_0x1dd2('0x1e')]);}return _0x5bda73['getMembers'](_0x57201c);}})[_0x1dd2('0x27')](function(_0x522cec){return _0x522cec?{'count':_0x20283b,'rows':_0x522cec}:null;})[_0x1dd2('0x27')](respondWithResult(_0x49e626,null))[_0x1dd2('0x4e')](handleError(_0x49e626,null));};exports[_0x1dd2('0x99')]=function(_0x822e58,_0x49e146,_0x3b0be3){var _0x5a6bc8={};var _0x132092={};var _0x48c799;var _0xf371b6;return db[_0x1dd2('0x35')][_0x1dd2('0x61')]({'where':{'id':_0x822e58[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x49e146,null))['then'](function(_0x532672){if(_0x532672){_0x48c799=_0x532672;_0x132092[_0x1dd2('0x38')]=_[_0x1dd2('0x39')](db[_0x1dd2('0x9a')][_0x1dd2('0x36')]);_0x132092[_0x1dd2('0x3a')]=_['keys'](_0x822e58[_0x1dd2('0x3a')]);_0x132092['filters']=_['intersection'](_0x132092[_0x1dd2('0x38')],_0x132092['query']);_0x5a6bc8[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x132092['model'],qs[_0x1dd2('0x3c')](_0x822e58[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0x5a6bc8[_0x1dd2('0x3b')]=_0x5a6bc8['attributes'][_0x1dd2('0x3d')]?_0x5a6bc8[_0x1dd2('0x3b')]:_0x132092[_0x1dd2('0x38')];_0x5a6bc8[_0x1dd2('0x40')]=qs['sort'](_0x822e58[_0x1dd2('0x3a')][_0x1dd2('0x41')]);_0x5a6bc8[_0x1dd2('0x42')]=qs[_0x1dd2('0x43')](_[_0x1dd2('0x44')](_0x822e58[_0x1dd2('0x3a')],_0x132092['filters']));if(_0x822e58[_0x1dd2('0x3a')][_0x1dd2('0x2c')]){_0x5a6bc8[_0x1dd2('0x42')]=_['merge'](_0x5a6bc8['where'],{'$or':_[_0x1dd2('0x2d')](_0x5a6bc8[_0x1dd2('0x3b')],function(_0x1a9972){var _0x36e0da={};_0x36e0da[_0x1a9972]={'$like':'%'+_0x822e58[_0x1dd2('0x3a')][_0x1dd2('0x2c')]+'%'};return _0x36e0da;})});}_0x5a6bc8=_[_0x1dd2('0x45')]({},_0x5a6bc8,_0x822e58['options']);return _0x48c799[_0x1dd2('0x99')](_0x5a6bc8);}})[_0x1dd2('0x27')](function(_0x3a3bf9){if(_0x3a3bf9){_0xf371b6=_0x3a3bf9[_0x1dd2('0x3d')];if(!_0x822e58[_0x1dd2('0x3a')][_0x1dd2('0x3e')](_0x1dd2('0x3f'))){_0x5a6bc8['limit']=qs[_0x1dd2('0x20')](_0x822e58[_0x1dd2('0x3a')][_0x1dd2('0x20')]);_0x5a6bc8[_0x1dd2('0x1e')]=qs['offset'](_0x822e58['query']['offset']);}return _0x48c799[_0x1dd2('0x99')](_0x5a6bc8);}})['then'](function(_0x1b2ee7){if(_0x1b2ee7){return _0x1b2ee7?{'count':_0xf371b6,'rows':_0x1b2ee7}:null;}})['then'](respondWithResult(_0x49e146,null))[_0x1dd2('0x4e')](handleError(_0x49e146,null));};exports[_0x1dd2('0x9b')]=function(_0x5bad73,_0x1207e8,_0x810d08){var _0x57ae4e,_0x2637e9;return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x5bad73['params']['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x1207e8,null))['then'](function(_0x3e9c21){if(_0x3e9c21){_0x2637e9=_0x3e9c21;return _0x3e9c21[_0x1dd2('0x9b')](_0x5bad73[_0x1dd2('0x50')][_0x1dd2('0x81')],_[_0x1dd2('0x5d')](_0x5bad73[_0x1dd2('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x645392){var _0x460d60;_0x57ae4e=_0x645392||[];var _0x1f733b=[];if(_0x645392){for(var _0x4bd748=0x0;_0x4bd748<_0x645392[_0x1dd2('0x3d')];_0x4bd748+=0x1){var _0x177cba=_0x645392[_0x4bd748][_0x1dd2('0x29')]({'plain':!![]});_0x2637e9[_0x1dd2('0x9c')]=_0x5bad73['body'][_0x1dd2('0x9c')]?_0x5bad73[_0x1dd2('0x50')]['dialCheckDuplicateType']:_0x2637e9[_0x1dd2('0x9c')];switch(_0x2637e9[_0x1dd2('0x9c')]){case _0x1dd2('0x9d'):_0x460d60=squel['insert']()['into'](_0x1dd2('0x9e'))['fromQuery']([_0x1dd2('0x9f'),_0x1dd2('0xa0'),'ContactId',_0x1dd2('0xa1'),'VoiceQueueId','createdAt',_0x1dd2('0x5f')],squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')](_0x1dd2('0x9f'),'phone')[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0xa0'))[_0x1dd2('0xa2')]('id',_0x1dd2('0xa4'))[_0x1dd2('0xa2')](_0x177cba[_0x1dd2('0xa5')][_0x1dd2('0x8b')](),_0x1dd2('0xa1'))[_0x1dd2('0xa2')](_0x5bad73[_0x1dd2('0x4b')]['id']['toString'](),_0x1dd2('0x67'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0x5e'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0x5f'))[_0x1dd2('0x84')](_0x1dd2('0xa6'))[_0x1dd2('0x42')](_0x1dd2('0xa7'))['where'](_0x1dd2('0xa8'),_0x177cba[_0x1dd2('0xa5')][_0x1dd2('0x8b')]())['where'](_0x1dd2('0xa9'))[_0x1dd2('0x42')](_0x1dd2('0xaa'),squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')](_0x1dd2('0xab'))['from'](_0x1dd2('0xac'))[_0x1dd2('0x42')]('VoiceQueueId\x20=\x20?',_0x5bad73[_0x1dd2('0x4b')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')]('COALESCE(phone,\x27\x27)')[_0x1dd2('0x84')](_0x1dd2('0x9e'))['where'](_0x1dd2('0x88'),_0x5bad73[_0x1dd2('0x4b')]['id']['toString']())))['toString']();break;case _0x1dd2('0xad'):_0x460d60=squel[_0x1dd2('0xae')]()[_0x1dd2('0xaf')]('cm_hopper')[_0x1dd2('0xb0')]([_0x1dd2('0x9f'),_0x1dd2('0xa0'),_0x1dd2('0xa4'),_0x1dd2('0xa1'),_0x1dd2('0x67'),_0x1dd2('0x5e'),_0x1dd2('0x5f')],squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')]('phone',_0x1dd2('0x9f'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0xa0'))[_0x1dd2('0xa2')]('id',_0x1dd2('0xa4'))[_0x1dd2('0xa2')](_0x177cba[_0x1dd2('0xa5')][_0x1dd2('0x8b')](),'ListId')[_0x1dd2('0xa2')](_0x5bad73['params']['id'][_0x1dd2('0x8b')](),_0x1dd2('0x67'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0x5e'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0x5f'))[_0x1dd2('0x84')](_0x1dd2('0xa6'))[_0x1dd2('0x42')](_0x1dd2('0xa7'))[_0x1dd2('0x42')](_0x1dd2('0xa8'),_0x177cba['CmListId'][_0x1dd2('0x8b')]())[_0x1dd2('0x42')](_0x1dd2('0xa9'))[_0x1dd2('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')](_0x1dd2('0xb1'))[_0x1dd2('0x84')](_0x1dd2('0x9e'))[_0x1dd2('0x42')](_0x1dd2('0x88'),_0x5bad73[_0x1dd2('0x4b')]['id'][_0x1dd2('0x8b')]())))['toString']();break;default:_0x460d60=squel[_0x1dd2('0xae')]()['into']('cm_hopper')[_0x1dd2('0xb0')]([_0x1dd2('0x9f'),'scheduledAt','ContactId',_0x1dd2('0xa1'),_0x1dd2('0x67'),_0x1dd2('0x5e'),_0x1dd2('0x5f')],squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')](_0x1dd2('0x9f'),_0x1dd2('0x9f'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0xa0'))[_0x1dd2('0xa2')]('id',_0x1dd2('0xa4'))[_0x1dd2('0xa2')](_0x177cba['CmListId'][_0x1dd2('0x8b')](),_0x1dd2('0xa1'))[_0x1dd2('0xa2')](_0x5bad73[_0x1dd2('0x4b')]['id']['toString'](),_0x1dd2('0x67'))[_0x1dd2('0xa2')]('NOW()',_0x1dd2('0x5e'))['field']('NOW()',_0x1dd2('0x5f'))[_0x1dd2('0x84')](_0x1dd2('0xa6'))[_0x1dd2('0x42')]('deletedAt\x20IS\x20NULL')[_0x1dd2('0x42')](_0x1dd2('0xa8'),_0x177cba[_0x1dd2('0xa5')]['toString']())['where'](_0x1dd2('0xa9')))[_0x1dd2('0x8b')]();}_0x1f733b['push'](db[_0x1dd2('0x74')][_0x1dd2('0x3a')](_0x460d60));}return BPromise['all'](_0x1f733b);}})['then'](function(){return _0x57ae4e;})[_0x1dd2('0x27')](respondWithResult(_0x1207e8,null))[_0x1dd2('0x4e')](handleError(_0x1207e8,null));};exports[_0x1dd2('0xb2')]=function(_0x31fc3d,_0x17a0f4,_0x2ebd72){return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x31fc3d[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x17a0f4,null))[_0x1dd2('0x27')](function(_0x27f627){if(_0x27f627){return _0x27f627[_0x1dd2('0xb2')](_0x31fc3d[_0x1dd2('0x3a')][_0x1dd2('0x81')]);}})[_0x1dd2('0x27')](function(_0x1557ee){if(_0x1557ee){return db[_0x1dd2('0x62')]['destroy']({'where':{'ListId':_0x31fc3d[_0x1dd2('0x3a')][_0x1dd2('0x81')],'VoiceQueueId':_0x31fc3d['params']['id']}})[_0x1dd2('0x27')](function(){return _0x1557ee;});}})[_0x1dd2('0x27')](respondWithStatusCode(_0x17a0f4,null))['catch'](handleError(_0x17a0f4,null));};exports[_0x1dd2('0xb3')]=function(_0x3614c6,_0x3180e6,_0x7cfd19){var _0xa38181={};var _0x55c89f={};var _0x36615a;var _0x4ebb68;return db[_0x1dd2('0x35')][_0x1dd2('0x61')]({'where':{'id':_0x3614c6[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x3180e6,null))[_0x1dd2('0x27')](function(_0x394d6c){if(_0x394d6c){_0x36615a=_0x394d6c;_0x55c89f[_0x1dd2('0x38')]=_[_0x1dd2('0x39')](db[_0x1dd2('0x9a')]['rawAttributes']);_0x55c89f['query']=_['keys'](_0x3614c6[_0x1dd2('0x3a')]);_0x55c89f[_0x1dd2('0x43')]=_['intersection'](_0x55c89f[_0x1dd2('0x38')],_0x55c89f[_0x1dd2('0x3a')]);_0xa38181[_0x1dd2('0x3b')]=_[_0x1dd2('0x5c')](_0x55c89f['model'],qs[_0x1dd2('0x3c')](_0x3614c6[_0x1dd2('0x3a')][_0x1dd2('0x3c')]));_0xa38181[_0x1dd2('0x3b')]=_0xa38181['attributes'][_0x1dd2('0x3d')]?_0xa38181[_0x1dd2('0x3b')]:_0x55c89f['model'];_0xa38181['order']=qs[_0x1dd2('0x41')](_0x3614c6[_0x1dd2('0x3a')][_0x1dd2('0x41')]);_0xa38181[_0x1dd2('0x42')]=qs['filters'](_['pick'](_0x3614c6[_0x1dd2('0x3a')],_0x55c89f['filters']));if(_0x3614c6[_0x1dd2('0x3a')][_0x1dd2('0x2c')]){_0xa38181[_0x1dd2('0x42')]=_[_0x1dd2('0x45')](_0xa38181[_0x1dd2('0x42')],{'$or':_[_0x1dd2('0x2d')](_0xa38181[_0x1dd2('0x3b')],function(_0x4bd322){var _0x49e7f6={};_0x49e7f6[_0x4bd322]={'$like':'%'+_0x3614c6['query']['filter']+'%'};return _0x49e7f6;})});}_0xa38181=_[_0x1dd2('0x45')]({},_0xa38181,_0x3614c6[_0x1dd2('0x4c')]);return _0x36615a['getBlackLists'](_0xa38181);}})[_0x1dd2('0x27')](function(_0x16e14c){if(_0x16e14c){_0x4ebb68=_0x16e14c[_0x1dd2('0x3d')];if(!_0x3614c6[_0x1dd2('0x3a')][_0x1dd2('0x3e')](_0x1dd2('0x3f'))){_0xa38181[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x3614c6[_0x1dd2('0x3a')]['limit']);_0xa38181[_0x1dd2('0x1e')]=qs[_0x1dd2('0x1e')](_0x3614c6['query'][_0x1dd2('0x1e')]);}return _0x36615a['getBlackLists'](_0xa38181);}})['then'](function(_0x42ee60){if(_0x42ee60){return _0x42ee60?{'count':_0x4ebb68,'rows':_0x42ee60}:null;}})[_0x1dd2('0x27')](respondWithResult(_0x3180e6,null))[_0x1dd2('0x4e')](handleError(_0x3180e6,null));};exports[_0x1dd2('0xb4')]=function(_0x30773f,_0x531b69,_0x341c2b){var _0x58a73b,_0x1e6136;return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x30773f[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x531b69,null))[_0x1dd2('0x27')](function(_0x2acca2){if(_0x2acca2){_0x1e6136=_0x2acca2;return _0x2acca2[_0x1dd2('0xb4')](_0x30773f[_0x1dd2('0x50')][_0x1dd2('0x81')],_['omit'](_0x30773f[_0x1dd2('0x50')],['ids','id'])||{});}return null;})[_0x1dd2('0x93')](function(_0x32932f){var _0x30993d;_0x58a73b=_0x32932f||[];var _0x218211=[];if(_0x32932f){for(var _0x76c2a2=0x0;_0x76c2a2<_0x32932f[_0x1dd2('0x3d')];_0x76c2a2+=0x1){var _0x1e62d2=_0x32932f[_0x76c2a2][_0x1dd2('0x29')]({'plain':!![]});_0x30993d=squel['insert']()['into'](_0x1dd2('0xb5'))[_0x1dd2('0xb0')](['phone',_0x1dd2('0xa4'),_0x1dd2('0xa1'),'VoiceQueueId',_0x1dd2('0x5e'),'updatedAt'],squel[_0x1dd2('0x82')]()[_0x1dd2('0xa2')](_0x1dd2('0x9f'),_0x1dd2('0x9f'))[_0x1dd2('0xa2')]('id',_0x1dd2('0xa4'))[_0x1dd2('0xa2')](_0x1e62d2[_0x1dd2('0xa5')]['toString'](),'ListId')[_0x1dd2('0xa2')](_0x30773f['params']['id'][_0x1dd2('0x8b')](),_0x1dd2('0x67'))[_0x1dd2('0xa2')]('NOW()',_0x1dd2('0x5e'))[_0x1dd2('0xa2')](_0x1dd2('0xa3'),_0x1dd2('0x5f'))['from'](_0x1dd2('0xa6'))['where'](_0x1dd2('0xa7'))['where']('ListId\x20=\x20?',_0x1e62d2[_0x1dd2('0xa5')][_0x1dd2('0x8b')]())[_0x1dd2('0x42')](_0x1dd2('0xa9')))[_0x1dd2('0x8b')]();_0x218211[_0x1dd2('0x8a')](db['sequelize']['query'](_0x30993d));}return BPromise['all'](_0x218211);}})['then'](function(){return _0x58a73b;})[_0x1dd2('0x27')](respondWithResult(_0x531b69,null))['catch'](handleError(_0x531b69,null));};exports['removeBlackLists']=function(_0x57e950,_0x47a74b,_0x587261){return db[_0x1dd2('0x35')][_0x1dd2('0x4d')]({'where':{'id':_0x57e950[_0x1dd2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47a74b,null))[_0x1dd2('0x27')](function(_0x48ea69){if(_0x48ea69){return _0x48ea69[_0x1dd2('0xb6')](_0x57e950['query'][_0x1dd2('0x81')]);}})['then'](function(_0x3a0c81){if(_0x3a0c81){return db[_0x1dd2('0x6a')][_0x1dd2('0x28')]({'where':{'ListId':_0x57e950[_0x1dd2('0x3a')][_0x1dd2('0x81')],'VoiceQueueId':_0x57e950[_0x1dd2('0x4b')]['id']}})[_0x1dd2('0x27')](function(){return _0x3a0c81;});}})[_0x1dd2('0x27')](respondWithStatusCode(_0x47a74b,null))['catch'](handleError(_0x47a74b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5097cd5..1cc73e7 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 _0x08ca=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x26ee89,_0xa3a77){var _0x3d9b69=function(_0x2097b1){while(--_0x2097b1){_0x26ee89['push'](_0x26ee89['shift']());}};_0x3d9b69(++_0xa3a77);}(_0x08ca,0x9a));var _0xa08c=function(_0x3b289e,_0x1ff1a8){_0x3b289e=_0x3b289e-0x0;var _0x5d1f05=_0x08ca[_0x3b289e];return _0x5d1f05;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xa08c('0x0'))['db'][_0xa08c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa08c('0x2')](0x0);var events={'afterCreate':_0xa08c('0x3'),'afterUpdate':_0xa08c('0x4'),'afterDestroy':_0xa08c('0x5')};function emitEvent(_0x469d64){return function(_0x33969c,_0x2aa7b4,_0x1eecb1){VoiceQueueEvents['emit'](_0x469d64+':'+_0x33969c['id'],_0x33969c);VoiceQueueEvents[_0xa08c('0x6')](_0x469d64,_0x33969c);_0x1eecb1(null);};}for(var e in events){if(events[_0xa08c('0x7')](e)){var event=events[e];VoiceQueue[_0xa08c('0x8')](e,emitEvent(event));}}module[_0xa08c('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x5392=['hook','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x47a708,_0x281d4a){var _0x48d2b1=function(_0x2eaa1e){while(--_0x2eaa1e){_0x47a708['push'](_0x47a708['shift']());}};_0x48d2b1(++_0x281d4a);}(_0x5392,0x13c));var _0x2539=function(_0x464905,_0x1bf535){_0x464905=_0x464905-0x0;var _0x13946f=_0x5392[_0x464905];return _0x13946f;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x2539('0x0'))['db'][_0x2539('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2539('0x2')](0x0);var events={'afterCreate':_0x2539('0x3'),'afterUpdate':_0x2539('0x4'),'afterDestroy':_0x2539('0x5')};function emitEvent(_0x5cf9a5){return function(_0x50cc4a,_0x1a03e5,_0x1446a9){VoiceQueueEvents[_0x2539('0x6')](_0x5cf9a5+':'+_0x50cc4a['id'],_0x50cc4a);VoiceQueueEvents[_0x2539('0x6')](_0x5cf9a5,_0x50cc4a);_0x1446a9(null);};}for(var e in events){if(events[_0x2539('0x7')](e)){var event=events[e];VoiceQueue[_0x2539('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 1e151d3..30a28fd 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x55ca,0x126));var _0xa55c=function(_0x449b54,_0x3776f3){_0x449b54=_0x449b54-0x0;var _0x32d6b9=_0x55ca[_0x449b54];return _0x32d6b9;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3a95a1,_0x5d8fa9){var _0x1f2929=function(_0x48accc){while(--_0x48accc){_0x3a95a1['push'](_0x3a95a1['shift']());}};_0x1f2929(++_0x5d8fa9);}(_0x34e8,0x12c));var _0x834e=function(_0x31d742,_0x2dec41){_0x31d742=_0x31d742-0x0;var _0x3b9db5=_0x34e8[_0x31d742];return _0x3b9db5;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 9508b20..72e3d18 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 _0xf1c8=['rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x591053,_0x523072){var _0x31ab80=function(_0x4a543f){while(--_0x4a543f){_0x591053['push'](_0x591053['shift']());}};_0x31ab80(++_0x523072);}(_0xf1c8,0x1b2));var _0x8f1c=function(_0x284e43,_0x99d604){_0x284e43=_0x284e43-0x0;var _0x30b34f=_0xf1c8[_0x284e43];return _0x30b34f;};'use strict';var _=require(_0x8f1c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8f1c('0x1'));var rs=require(_0x8f1c('0x2'));var fs=require('fs');var Redis=require(_0x8f1c('0x3'));var db=require(_0x8f1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f1c('0x5'))(_0x8f1c('0x6'));var config=require(_0x8f1c('0x7'));var jayson=require(_0x8f1c('0x8'));var client=jayson['client'][_0x8f1c('0x9')]({'port':0x232a});config['redis']=_[_0x8f1c('0xa')](config[_0x8f1c('0xb')],{'host':_0x8f1c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f1c('0xb')]));require(_0x8f1c('0xd'))[_0x8f1c('0xe')](socket);function respondWithRpcPromise(_0x17a782,_0x582071,_0x2ec4e4){return new BPromise(function(_0x8991b1,_0x11bb70){return client[_0x8f1c('0xf')](_0x17a782,_0x2ec4e4)[_0x8f1c('0x10')](function(_0x3093fc){logger[_0x8f1c('0x11')](_0x8f1c('0x12'),_0x582071,'request\x20sent');logger['debug'](_0x8f1c('0x13'),_0x582071,'request\x20sent',JSON[_0x8f1c('0x14')](_0x3093fc));if(_0x3093fc[_0x8f1c('0x15')]){if(_0x3093fc[_0x8f1c('0x15')]['code']===0x1f4){logger[_0x8f1c('0x15')](_0x8f1c('0x12'),_0x582071,_0x3093fc[_0x8f1c('0x15')][_0x8f1c('0x16')]);return _0x11bb70(_0x3093fc[_0x8f1c('0x15')][_0x8f1c('0x16')]);}logger[_0x8f1c('0x15')](_0x8f1c('0x12'),_0x582071,_0x3093fc[_0x8f1c('0x15')][_0x8f1c('0x16')]);return _0x8991b1(_0x3093fc[_0x8f1c('0x15')]['message']);}else{logger[_0x8f1c('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x582071,_0x8f1c('0x17'));_0x8991b1(_0x3093fc[_0x8f1c('0x18')]['message']);}})[_0x8f1c('0x19')](function(_0x3c921f){logger[_0x8f1c('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x582071,_0x3c921f);_0x11bb70(_0x3c921f);});});}exports[_0x8f1c('0x1a')]=function(_0x20b782){var _0x48ee7a=this;return new Promise(function(_0xe4a542,_0x435f2f){return db[_0x8f1c('0x1b')][_0x8f1c('0x1c')]({'raw':_0x20b782[_0x8f1c('0x1d')]?_0x20b782['options'][_0x8f1c('0x1e')]===undefined?!![]:![]:!![],'where':_0x20b782['options']?_0x20b782['options'][_0x8f1c('0x1f')]||null:null,'attributes':_0x20b782[_0x8f1c('0x1d')]?_0x20b782[_0x8f1c('0x1d')][_0x8f1c('0x20')]||null:null,'limit':_0x20b782[_0x8f1c('0x1d')]?_0x20b782[_0x8f1c('0x1d')][_0x8f1c('0x21')]||null:null,'include':_0x20b782[_0x8f1c('0x1d')]?_0x20b782[_0x8f1c('0x1d')]['include']?_[_0x8f1c('0x22')](_0x20b782[_0x8f1c('0x1d')][_0x8f1c('0x23')],function(_0x5d6092){return{'model':db[_0x5d6092[_0x8f1c('0x24')]],'as':_0x5d6092['as'],'attributes':_0x5d6092['attributes'],'include':_0x5d6092[_0x8f1c('0x23')]?_[_0x8f1c('0x22')](_0x5d6092[_0x8f1c('0x23')],function(_0x6a5f73){return{'model':db[_0x6a5f73[_0x8f1c('0x24')]],'as':_0x6a5f73['as'],'attributes':_0x6a5f73[_0x8f1c('0x20')],'include':_0x6a5f73[_0x8f1c('0x23')]?_[_0x8f1c('0x22')](_0x6a5f73[_0x8f1c('0x23')],function(_0x211b01){return{'model':db[_0x211b01[_0x8f1c('0x24')]],'as':_0x211b01['as'],'attributes':_0x211b01[_0x8f1c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8f1c('0x10')](function(_0x5e6aab){logger['info'](_0x8f1c('0x1a'),_0x20b782);logger['debug'](_0x8f1c('0x1a'),_0x20b782,JSON[_0x8f1c('0x14')](_0x5e6aab));_0xe4a542(_0x5e6aab);})[_0x8f1c('0x19')](function(_0x42418b){logger[_0x8f1c('0x15')](_0x8f1c('0x1a'),_0x42418b[_0x8f1c('0x16')],_0x20b782);_0x435f2f(_0x48ee7a[_0x8f1c('0x15')](0x1f4,_0x42418b[_0x8f1c('0x16')]));});});};exports[_0x8f1c('0x25')]=function(_0x47aa58){var _0x51c8a7=this;return new Promise(function(_0x2cf28c,_0x1d3c37){return db[_0x8f1c('0x1b')][_0x8f1c('0x26')]({'raw':_0x47aa58['options']?_0x47aa58[_0x8f1c('0x1d')][_0x8f1c('0x1e')]===undefined?!![]:![]:!![],'where':_0x47aa58[_0x8f1c('0x1d')]?_0x47aa58[_0x8f1c('0x1d')][_0x8f1c('0x1f')]||null:null,'attributes':_0x47aa58[_0x8f1c('0x1d')]?_0x47aa58['options'][_0x8f1c('0x20')]||null:null,'include':_0x47aa58[_0x8f1c('0x1d')]?_0x47aa58[_0x8f1c('0x1d')][_0x8f1c('0x23')]?_[_0x8f1c('0x22')](_0x47aa58[_0x8f1c('0x1d')][_0x8f1c('0x23')],function(_0x579cf1){return{'model':db[_0x579cf1['model']],'as':_0x579cf1['as'],'attributes':_0x579cf1[_0x8f1c('0x20')],'include':_0x579cf1['include']?_['map'](_0x579cf1['include'],function(_0x58494a){return{'model':db[_0x58494a['model']],'as':_0x58494a['as'],'attributes':_0x58494a[_0x8f1c('0x20')],'include':_0x58494a['include']?_[_0x8f1c('0x22')](_0x58494a[_0x8f1c('0x23')],function(_0x32f2ea){return{'model':db[_0x32f2ea['model']],'as':_0x32f2ea['as'],'attributes':_0x32f2ea[_0x8f1c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8f1c('0x10')](function(_0x4390de){logger[_0x8f1c('0x11')](_0x8f1c('0x25'),_0x47aa58);logger[_0x8f1c('0x27')](_0x8f1c('0x25'),_0x47aa58,JSON['stringify'](_0x4390de));_0x2cf28c(_0x4390de);})[_0x8f1c('0x19')](function(_0xf7b272){logger[_0x8f1c('0x15')](_0x8f1c('0x25'),_0xf7b272['message'],_0x47aa58);_0x1d3c37(_0x51c8a7[_0x8f1c('0x15')](0x1f4,_0xf7b272['message']));});});}; \ No newline at end of file +var _0xbdb9=['util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','catch','ShowVoiceQueue','find','lodash'];(function(_0x5c398a,_0x3eef7a){var _0x269869=function(_0x4724ca){while(--_0x4724ca){_0x5c398a['push'](_0x5c398a['shift']());}};_0x269869(++_0x3eef7a);}(_0xbdb9,0x13f));var _0x9bdb=function(_0x1c2c81,_0x2137b0){_0x1c2c81=_0x1c2c81-0x0;var _0x2e1166=_0xbdb9[_0x1c2c81];return _0x2e1166;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var moment=require(_0x9bdb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bdb('0x3'));var db=require(_0x9bdb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9bdb('0x5'))(_0x9bdb('0x6'));var config=require('../../config/environment');var jayson=require(_0x9bdb('0x7'));var client=jayson[_0x9bdb('0x8')][_0x9bdb('0x9')]({'port':0x232a});config[_0x9bdb('0xa')]=_[_0x9bdb('0xb')](config[_0x9bdb('0xa')],{'host':_0x9bdb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0x9bdb('0xd')](socket);function respondWithRpcPromise(_0x2adf34,_0x1133c0,_0x3e541f){return new BPromise(function(_0x4564bb,_0x2f1b71){return client[_0x9bdb('0xe')](_0x2adf34,_0x3e541f)[_0x9bdb('0xf')](function(_0x3a2d76){logger[_0x9bdb('0x10')](_0x9bdb('0x11'),_0x1133c0,_0x9bdb('0x12'));logger[_0x9bdb('0x13')](_0x9bdb('0x14'),_0x1133c0,_0x9bdb('0x12'),JSON[_0x9bdb('0x15')](_0x3a2d76));if(_0x3a2d76['error']){if(_0x3a2d76[_0x9bdb('0x16')][_0x9bdb('0x17')]===0x1f4){logger[_0x9bdb('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1133c0,_0x3a2d76[_0x9bdb('0x16')][_0x9bdb('0x18')]);return _0x2f1b71(_0x3a2d76[_0x9bdb('0x16')]['message']);}logger[_0x9bdb('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1133c0,_0x3a2d76[_0x9bdb('0x16')][_0x9bdb('0x18')]);return _0x4564bb(_0x3a2d76[_0x9bdb('0x16')][_0x9bdb('0x18')]);}else{logger['info'](_0x9bdb('0x11'),_0x1133c0,'request\x20sent');_0x4564bb(_0x3a2d76[_0x9bdb('0x19')][_0x9bdb('0x18')]);}})['catch'](function(_0x47eb23){logger[_0x9bdb('0x16')](_0x9bdb('0x11'),_0x1133c0,_0x47eb23);_0x2f1b71(_0x47eb23);});});}exports['GetVoiceQueue']=function(_0x17fdb9){var _0x14306d=this;return new Promise(function(_0x4f6d61,_0x584184){return db[_0x9bdb('0x1a')][_0x9bdb('0x1b')]({'raw':_0x17fdb9['options']?_0x17fdb9[_0x9bdb('0x1c')][_0x9bdb('0x1d')]===undefined?!![]:![]:!![],'where':_0x17fdb9['options']?_0x17fdb9[_0x9bdb('0x1c')][_0x9bdb('0x1e')]||null:null,'attributes':_0x17fdb9[_0x9bdb('0x1c')]?_0x17fdb9[_0x9bdb('0x1c')][_0x9bdb('0x1f')]||null:null,'limit':_0x17fdb9[_0x9bdb('0x1c')]?_0x17fdb9[_0x9bdb('0x1c')][_0x9bdb('0x20')]||null:null,'include':_0x17fdb9[_0x9bdb('0x1c')]?_0x17fdb9[_0x9bdb('0x1c')][_0x9bdb('0x21')]?_[_0x9bdb('0x22')](_0x17fdb9['options']['include'],function(_0x4557ce){return{'model':db[_0x4557ce[_0x9bdb('0x23')]],'as':_0x4557ce['as'],'attributes':_0x4557ce['attributes'],'include':_0x4557ce[_0x9bdb('0x21')]?_[_0x9bdb('0x22')](_0x4557ce[_0x9bdb('0x21')],function(_0x30206b){return{'model':db[_0x30206b['model']],'as':_0x30206b['as'],'attributes':_0x30206b[_0x9bdb('0x1f')],'include':_0x30206b[_0x9bdb('0x21')]?_[_0x9bdb('0x22')](_0x30206b[_0x9bdb('0x21')],function(_0x4a99cc){return{'model':db[_0x4a99cc[_0x9bdb('0x23')]],'as':_0x4a99cc['as'],'attributes':_0x4a99cc['attributes']};}):[]};}):[]};}):[]:[]})[_0x9bdb('0xf')](function(_0x28cdc3){logger[_0x9bdb('0x10')](_0x9bdb('0x24'),_0x17fdb9);logger[_0x9bdb('0x13')](_0x9bdb('0x24'),_0x17fdb9,JSON[_0x9bdb('0x15')](_0x28cdc3));_0x4f6d61(_0x28cdc3);})[_0x9bdb('0x25')](function(_0x4d5017){logger[_0x9bdb('0x16')](_0x9bdb('0x24'),_0x4d5017[_0x9bdb('0x18')],_0x17fdb9);_0x584184(_0x14306d[_0x9bdb('0x16')](0x1f4,_0x4d5017[_0x9bdb('0x18')]));});});};exports[_0x9bdb('0x26')]=function(_0x205f7f){var _0x7b4648=this;return new Promise(function(_0xc98544,_0x5db85a){return db[_0x9bdb('0x1a')][_0x9bdb('0x27')]({'raw':_0x205f7f[_0x9bdb('0x1c')]?_0x205f7f[_0x9bdb('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x205f7f['options']?_0x205f7f[_0x9bdb('0x1c')][_0x9bdb('0x1e')]||null:null,'attributes':_0x205f7f[_0x9bdb('0x1c')]?_0x205f7f[_0x9bdb('0x1c')][_0x9bdb('0x1f')]||null:null,'include':_0x205f7f[_0x9bdb('0x1c')]?_0x205f7f['options'][_0x9bdb('0x21')]?_[_0x9bdb('0x22')](_0x205f7f[_0x9bdb('0x1c')][_0x9bdb('0x21')],function(_0x368a83){return{'model':db[_0x368a83[_0x9bdb('0x23')]],'as':_0x368a83['as'],'attributes':_0x368a83[_0x9bdb('0x1f')],'include':_0x368a83[_0x9bdb('0x21')]?_[_0x9bdb('0x22')](_0x368a83['include'],function(_0x201b35){return{'model':db[_0x201b35['model']],'as':_0x201b35['as'],'attributes':_0x201b35[_0x9bdb('0x1f')],'include':_0x201b35['include']?_[_0x9bdb('0x22')](_0x201b35[_0x9bdb('0x21')],function(_0x132ef0){return{'model':db[_0x132ef0[_0x9bdb('0x23')]],'as':_0x132ef0['as'],'attributes':_0x132ef0[_0x9bdb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9bdb('0xf')](function(_0xe3b8a1){logger[_0x9bdb('0x10')]('ShowVoiceQueue',_0x205f7f);logger[_0x9bdb('0x13')](_0x9bdb('0x26'),_0x205f7f,JSON[_0x9bdb('0x15')](_0xe3b8a1));_0xc98544(_0xe3b8a1);})[_0x9bdb('0x25')](function(_0x4ba289){logger['error'](_0x9bdb('0x26'),_0x4ba289[_0x9bdb('0x18')],_0x205f7f);_0x5db85a(_0x7b4648[_0x9bdb('0x16')](0x1f4,_0x4ba289['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index f129b0c..7da490d 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 _0x51fd=['remove','update','emit','removeListener','register','./voiceQueue.events','save'];(function(_0x386cdf,_0x4945ed){var _0x3dc542=function(_0x4421ea){while(--_0x4421ea){_0x386cdf['push'](_0x386cdf['shift']());}};_0x3dc542(++_0x4945ed);}(_0x51fd,0xc2));var _0xd51f=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x51fd[_0x4ff09b];return _0x3f5c2e;};'use strict';var VoiceQueueEvents=require(_0xd51f('0x0'));var events=[_0xd51f('0x1'),_0xd51f('0x2'),_0xd51f('0x3')];function createListener(_0x16a04f,_0x5615a3){return function(_0x3770e1){_0x5615a3[_0xd51f('0x4')](_0x16a04f,_0x3770e1);};}function removeListener(_0x1fa8fb,_0x1bc5d0){return function(){VoiceQueueEvents[_0xd51f('0x5')](_0x1fa8fb,_0x1bc5d0);};}exports[_0xd51f('0x6')]=function(_0x20fa64){for(var _0x3b76f9=0x0,_0x110244=events['length'];_0x3b76f9<_0x110244;_0x3b76f9++){var _0x3f2829=events[_0x3b76f9];var _0x52d4a0=createListener('voiceQueue:'+_0x3f2829,_0x20fa64);VoiceQueueEvents['on'](_0x3f2829,_0x52d4a0);}}; \ No newline at end of file +var _0x22fc=['emit','removeListener','register','length','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22fc,0xeb));var _0xc22f=function(_0x487715,_0x266349){_0x487715=_0x487715-0x0;var _0x400918=_0x22fc[_0x487715];return _0x400918;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xc22f('0x0'),_0xc22f('0x1'),_0xc22f('0x2')];function createListener(_0x5a2fea,_0xf02dc1){return function(_0x5a6836){_0xf02dc1[_0xc22f('0x3')](_0x5a2fea,_0x5a6836);};}function removeListener(_0x5220a8,_0x2b6ce){return function(){VoiceQueueEvents[_0xc22f('0x4')](_0x5220a8,_0x2b6ce);};}exports[_0xc22f('0x5')]=function(_0x305df7){for(var _0x2f9940=0x0,_0x3c3dba=events[_0xc22f('0x6')];_0x2f9940<_0x3c3dba;_0x2f9940++){var _0x4e2098=events[_0x2f9940];var _0x257858=createListener('voiceQueue:'+_0x4e2098,_0x305df7);VoiceQueueEvents['on'](_0x4e2098,_0x257858);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index af49ccf..19d5cbd 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 _0xf027=['isAuthenticated','index','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get'];(function(_0xef6334,_0x161d77){var _0x4f7ce2=function(_0x407195){while(--_0x407195){_0xef6334['push'](_0xef6334['shift']());}};_0x4f7ce2(++_0x161d77);}(_0xf027,0x145));var _0x7f02=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf027[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x7f02('0x0'));var util=require(_0x7f02('0x1'));var path=require(_0x7f02('0x2'));var timeout=require(_0x7f02('0x3'));var express=require(_0x7f02('0x4'));var router=express['Router']();var fs_extra=require(_0x7f02('0x5'));var auth=require(_0x7f02('0x6'));var interaction=require(_0x7f02('0x7'));var config=require(_0x7f02('0x8'));var controller=require(_0x7f02('0x9'));router[_0x7f02('0xa')]('/',auth[_0x7f02('0xb')](),controller[_0x7f02('0xc')]);router[_0x7f02('0xa')]('/describe',auth[_0x7f02('0xb')](),controller[_0x7f02('0xd')]);router[_0x7f02('0xa')]('/index',auth[_0x7f02('0xb')](),controller[_0x7f02('0xe')]);router[_0x7f02('0xa')](_0x7f02('0xf'),auth[_0x7f02('0xb')](),controller[_0x7f02('0x10')]);router[_0x7f02('0x11')]('/',auth[_0x7f02('0xb')](),controller[_0x7f02('0x12')]);router[_0x7f02('0x13')](_0x7f02('0xf'),auth[_0x7f02('0xb')](),controller[_0x7f02('0x14')]);router[_0x7f02('0x15')](_0x7f02('0xf'),auth[_0x7f02('0xb')](),controller[_0x7f02('0x16')]);module[_0x7f02('0x17')]=router; \ No newline at end of file +var _0x5f8b=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','show','post','create','put'];(function(_0x7c4d7d,_0x4215a2){var _0x1f9c06=function(_0x239307){while(--_0x239307){_0x7c4d7d['push'](_0x7c4d7d['shift']());}};_0x1f9c06(++_0x4215a2);}(_0x5f8b,0x183));var _0xb5f8=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x5f8b[_0x4ae829];return _0x256b31;};'use strict';var multer=require(_0xb5f8('0x0'));var util=require(_0xb5f8('0x1'));var path=require(_0xb5f8('0x2'));var timeout=require(_0xb5f8('0x3'));var express=require(_0xb5f8('0x4'));var router=express['Router']();var fs_extra=require(_0xb5f8('0x5'));var auth=require(_0xb5f8('0x6'));var interaction=require(_0xb5f8('0x7'));var config=require(_0xb5f8('0x8'));var controller=require(_0xb5f8('0x9'));router[_0xb5f8('0xa')]('/',auth[_0xb5f8('0xb')](),controller[_0xb5f8('0xc')]);router[_0xb5f8('0xa')](_0xb5f8('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xb5f8('0xa')](_0xb5f8('0xe'),auth[_0xb5f8('0xb')](),controller[_0xb5f8('0xf')]);router['get'](_0xb5f8('0x10'),auth[_0xb5f8('0xb')](),controller[_0xb5f8('0x11')]);router[_0xb5f8('0x12')]('/',auth[_0xb5f8('0xb')](),controller[_0xb5f8('0x13')]);router[_0xb5f8('0x14')](_0xb5f8('0x10'),auth['isAuthenticated'](),controller[_0xb5f8('0x15')]);router[_0xb5f8('0x16')](_0xb5f8('0x10'),auth[_0xb5f8('0xb')](),controller[_0xb5f8('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8462595..a84af7b 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 _0xfa4f=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xfa4f,0x1ea));var _0xffa4=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xfa4f[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0xffa4('0x0'));var moment=require(_0xffa4('0x1'));module[_0xffa4('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xffa4('0x3')]},'calleridnum':{'type':Sequelize[_0xffa4('0x3')]},'calleridname':{'type':Sequelize[_0xffa4('0x3')]},'queue':{'type':Sequelize[_0xffa4('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xffa4('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xffa4('0x4')],'set':function(_0x148735){var _0x51179b=moment(_0x148735);var _0x3a97e6=moment(this[_0xffa4('0x5')](_0xffa4('0x6')))[_0xffa4('0x7')](_0xffa4('0x8'));var _0x376e5b=_0x51179b[_0xffa4('0x9')](_0x3a97e6,_0xffa4('0xa'));this[_0xffa4('0xb')]('queuecallerleaveAt',_0x148735);this[_0xffa4('0xb')](_0xffa4('0xc'),_0x376e5b||null);}},'position':{'type':Sequelize[_0xffa4('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xffa4('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xffa4('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xffa4('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xffa4('0xf')},'originalposition':{'type':Sequelize[_0xffa4('0xd')]},'channel':{'type':Sequelize[_0xffa4('0x3')]},'connectedlinenum':{'type':Sequelize[_0xffa4('0x3')]},'connectedlinename':{'type':Sequelize[_0xffa4('0x3')]},'accountcode':{'type':Sequelize[_0xffa4('0x3')]},'context':{'type':Sequelize[_0xffa4('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xffa4('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xffa4('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xffa4('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xffa4('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xffa4('0x3')]},'transferuniqueid':{'type':Sequelize[_0xffa4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xffa4('0x3')]},'thirdDisposition':{'type':Sequelize[_0xffa4('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xffa4('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b05=['diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xd1c75e,_0x43ef5b){var _0x480887=function(_0x23405d){while(--_0x23405d){_0xd1c75e['push'](_0xd1c75e['shift']());}};_0x480887(++_0x43ef5b);}(_0x1b05,0x1e7));var _0x51b0=function(_0x8cdbfb,_0xf05cda){_0x8cdbfb=_0x8cdbfb-0x0;var _0x4f1dd6=_0x1b05[_0x8cdbfb];return _0x4f1dd6;};'use strict';var Sequelize=require(_0x51b0('0x0'));var moment=require(_0x51b0('0x1'));module[_0x51b0('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x51b0('0x3')]},'calleridnum':{'type':Sequelize[_0x51b0('0x3')]},'calleridname':{'type':Sequelize[_0x51b0('0x3')]},'queue':{'type':Sequelize[_0x51b0('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x51b0('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x51b0('0x4')],'set':function(_0x21b9e1){var _0x4e7160=moment(_0x21b9e1);var _0x140c0e=moment(this[_0x51b0('0x5')](_0x51b0('0x6')))['format'](_0x51b0('0x7'));var _0x48e631=_0x4e7160[_0x51b0('0x8')](_0x140c0e,'seconds');this['setDataValue'](_0x51b0('0x9'),_0x21b9e1);this[_0x51b0('0xa')](_0x51b0('0xb'),_0x48e631||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x51b0('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x51b0('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x51b0('0x4')]},'queuecallerexit':{'type':Sequelize[_0x51b0('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x51b0('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x51b0('0x3')],'comment':_0x51b0('0xe')},'originalposition':{'type':Sequelize[_0x51b0('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x51b0('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x51b0('0x3')]},'context':{'type':Sequelize[_0x51b0('0x3')]},'exten':{'type':Sequelize[_0x51b0('0x3')]},'priority':{'type':Sequelize[_0x51b0('0x3')]},'holdtime':{'type':Sequelize[_0x51b0('0xc')]},'mohtime':{'type':Sequelize[_0x51b0('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x51b0('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x51b0('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x51b0('0x3')]},'transferuniqueid':{'type':Sequelize[_0x51b0('0x3')]},'disposition':{'type':Sequelize[_0x51b0('0x3')]},'secondDisposition':{'type':Sequelize[_0x51b0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x51b0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x51b0('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 64363ed..8490eb5 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 _0x3d06=['name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','then','catch','show','params','VoiceQueueReport','find','create','body','describe','getVoiceQueuesReport','pick','includeAll','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','end','error','stack'];(function(_0x948e76,_0x34a0dd){var _0x44184c=function(_0x2c0256){while(--_0x2c0256){_0x948e76['push'](_0x948e76['shift']());}};_0x44184c(++_0x34a0dd);}(_0x3d06,0xcb));var _0x63d0=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0x3d06[_0x2a7b8e];return _0x29b5c8;};'use strict';var emlformat=require(_0x63d0('0x0'));var rimraf=require(_0x63d0('0x1'));var zipdir=require(_0x63d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x63d0('0x3'));var BPromise=require(_0x63d0('0x4'));var Mustache=require(_0x63d0('0x5'));var util=require('util');var path=require(_0x63d0('0x6'));var sox=require(_0x63d0('0x7'));var csv=require(_0x63d0('0x8'));var ejs=require(_0x63d0('0x9'));var fs=require('fs');var fs_extra=require(_0x63d0('0xa'));var _=require(_0x63d0('0xb'));var squel=require('squel');var crypto=require(_0x63d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x63d0('0xd'));var toCsv=require(_0x63d0('0x8'));var querystring=require('querystring');var Papa=require(_0x63d0('0xe'));var Redis=require(_0x63d0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x63d0('0x10'));var as=require(_0x63d0('0x11'));var hardwareService=require(_0x63d0('0x12'));var logger=require(_0x63d0('0x13'))(_0x63d0('0x14'));var utils=require('../../config/utils');var config=require(_0x63d0('0x15'));var licenseUtil=require(_0x63d0('0x16'));var db=require(_0x63d0('0x17'))['db'];config['redis']=_['defaults'](config[_0x63d0('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63d0('0x18')]));require(_0x63d0('0x19'))[_0x63d0('0x1a')](socket);function respondWithStatusCode(_0x9dae07,_0x583a62){_0x583a62=_0x583a62||0xcc;return function(_0x39e66d){if(_0x39e66d){return _0x9dae07[_0x63d0('0x1b')](_0x583a62);}return _0x9dae07[_0x63d0('0x1c')](_0x583a62)['end']();};}function respondWithResult(_0x410c2b,_0x18e719){_0x18e719=_0x18e719||0xc8;return function(_0x5195f3){if(_0x5195f3){return _0x410c2b[_0x63d0('0x1c')](_0x18e719)['json'](_0x5195f3);}};}function respondWithFilteredResult(_0x4c6958,_0x48261c){return function(_0x41399e){if(_0x41399e){var _0x3b3858=typeof _0x48261c[_0x63d0('0x1d')]===_0x63d0('0x1e')&&typeof _0x48261c[_0x63d0('0x1f')]===_0x63d0('0x1e');var _0x4648fa=_0x41399e[_0x63d0('0x20')];var _0x353652=_0x3b3858?0x0:_0x48261c[_0x63d0('0x1d')];var _0xa3caf0=_0x3b3858?_0x41399e[_0x63d0('0x20')]:_0x48261c[_0x63d0('0x1d')]+_0x48261c[_0x63d0('0x1f')];var _0x2bef27;if(_0xa3caf0>=_0x4648fa){_0xa3caf0=_0x4648fa;_0x2bef27=0xc8;}else{_0x2bef27=0xce;}_0x4c6958[_0x63d0('0x1c')](_0x2bef27);return _0x4c6958[_0x63d0('0x21')]('Content-Range',_0x353652+'-'+_0xa3caf0+'/'+_0x4648fa)[_0x63d0('0x22')](_0x41399e);}return null;};}function patchUpdates(_0x1edccd){return function(_0x540d5d){try{jsonpatch[_0x63d0('0x23')](_0x540d5d,_0x1edccd,!![]);}catch(_0xfac39b){return BPromise[_0x63d0('0x24')](_0xfac39b);}return _0x540d5d[_0x63d0('0x25')]();};}function saveUpdates(_0x363c98,_0x21d27f){return function(_0x22cf08){if(_0x22cf08){return _0x22cf08[_0x63d0('0x26')](_0x363c98)['then'](function(_0x266bb7){return _0x266bb7;});}return null;};}function removeEntity(_0x3bc6d5,_0x5d8de3){return function(_0x2fedfc){if(_0x2fedfc){return _0x2fedfc[_0x63d0('0x27')]()['then'](function(){_0x3bc6d5[_0x63d0('0x1c')](0xcc)[_0x63d0('0x28')]();});}};}function handleEntityNotFound(_0x5ef67b,_0x521e1a){return function(_0x3dfce2){if(!_0x3dfce2){_0x5ef67b[_0x63d0('0x1b')](0x194);}return _0x3dfce2;};}function handleError(_0x319900,_0x44061d){_0x44061d=_0x44061d||0x1f4;return function(_0x1845ad){logger[_0x63d0('0x29')](_0x1845ad[_0x63d0('0x2a')]);if(_0x1845ad['name']){delete _0x1845ad[_0x63d0('0x2b')];}_0x319900['status'](_0x44061d)[_0x63d0('0x2c')](_0x1845ad);};}exports[_0x63d0('0x2d')]=function(_0x1a651c,_0x3ea472){var _0x1db533={},_0x4b39f4={},_0x1be1b0={'count':0x0,'rows':[]};var _0x3bb002=_[_0x63d0('0x2e')](db['VoiceQueueReport'][_0x63d0('0x2f')],function(_0x28a728){return{'name':_0x28a728[_0x63d0('0x30')],'type':_0x28a728[_0x63d0('0x31')]['key']};});_0x4b39f4['model']=_[_0x63d0('0x2e')](_0x3bb002,_0x63d0('0x2b'));_0x4b39f4['query']=_[_0x63d0('0x32')](_0x1a651c[_0x63d0('0x33')]);_0x4b39f4[_0x63d0('0x34')]=_['intersection'](_0x4b39f4[_0x63d0('0x35')],_0x4b39f4[_0x63d0('0x33')]);_0x1db533[_0x63d0('0x36')]=_[_0x63d0('0x37')](_0x4b39f4[_0x63d0('0x35')],qs[_0x63d0('0x38')](_0x1a651c[_0x63d0('0x33')][_0x63d0('0x38')]));_0x1db533['attributes']=_0x1db533[_0x63d0('0x36')][_0x63d0('0x39')]?_0x1db533[_0x63d0('0x36')]:_0x4b39f4[_0x63d0('0x35')];if(!_0x1a651c[_0x63d0('0x33')][_0x63d0('0x3a')](_0x63d0('0x3b'))){_0x1db533[_0x63d0('0x1f')]=qs[_0x63d0('0x1f')](_0x1a651c[_0x63d0('0x33')]['limit']);_0x1db533['offset']=qs[_0x63d0('0x1d')](_0x1a651c[_0x63d0('0x33')][_0x63d0('0x1d')]);}_0x1db533[_0x63d0('0x3c')]=qs[_0x63d0('0x3d')](_0x1a651c[_0x63d0('0x33')][_0x63d0('0x3d')]);_0x1db533['where']=qs[_0x63d0('0x34')](_['pick'](_0x1a651c[_0x63d0('0x33')],_0x4b39f4[_0x63d0('0x34')]),_0x3bb002);if(_0x1a651c[_0x63d0('0x33')][_0x63d0('0x3e')]){_0x1db533[_0x63d0('0x3f')]=_[_0x63d0('0x40')](_0x1db533[_0x63d0('0x3f')],{'$or':_['map'](_0x3bb002,function(_0x3878cc){if(_0x3878cc['type']!==_0x63d0('0x41')){var _0x3ec86b={};_0x3ec86b[_0x3878cc['name']]={'$like':'%'+_0x1a651c[_0x63d0('0x33')][_0x63d0('0x3e')]+'%'};return _0x3ec86b;}})});}_0x1db533=_[_0x63d0('0x40')]({},_0x1db533,_0x1a651c[_0x63d0('0x42')]);var _0x2f14a1={'where':_0x1db533[_0x63d0('0x3f')]};return db['VoiceQueueReport'][_0x63d0('0x20')](_0x2f14a1)['then'](function(_0x4cf736){_0x1be1b0[_0x63d0('0x20')]=_0x4cf736;if(_0x1a651c[_0x63d0('0x33')]['includeAll']){_0x1db533[_0x63d0('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x63d0('0x44')](_0x1db533);})['then'](function(_0x6b6556){_0x1be1b0[_0x63d0('0x45')]=_0x6b6556;return _0x1be1b0;})[_0x63d0('0x46')](respondWithFilteredResult(_0x3ea472,_0x1db533))[_0x63d0('0x47')](handleError(_0x3ea472,null));};exports[_0x63d0('0x48')]=function(_0x25e403,_0x26de67){var _0x2aa18d={'raw':![],'where':{'id':_0x25e403[_0x63d0('0x49')]['id']}},_0x185e1c={};_0x185e1c[_0x63d0('0x35')]=_[_0x63d0('0x32')](db[_0x63d0('0x4a')][_0x63d0('0x2f')]);_0x185e1c[_0x63d0('0x33')]=_['keys'](_0x25e403[_0x63d0('0x33')]);_0x185e1c[_0x63d0('0x34')]=_[_0x63d0('0x37')](_0x185e1c[_0x63d0('0x35')],_0x185e1c[_0x63d0('0x33')]);_0x2aa18d[_0x63d0('0x36')]=_['intersection'](_0x185e1c[_0x63d0('0x35')],qs[_0x63d0('0x38')](_0x25e403[_0x63d0('0x33')][_0x63d0('0x38')]));_0x2aa18d['attributes']=_0x2aa18d[_0x63d0('0x36')][_0x63d0('0x39')]?_0x2aa18d[_0x63d0('0x36')]:_0x185e1c[_0x63d0('0x35')];if(_0x25e403[_0x63d0('0x33')]['includeAll']){_0x2aa18d['include']=[{'all':!![]}];}_0x2aa18d=_[_0x63d0('0x40')]({},_0x2aa18d,_0x25e403[_0x63d0('0x42')]);return db[_0x63d0('0x4a')][_0x63d0('0x4b')](_0x2aa18d)[_0x63d0('0x46')](handleEntityNotFound(_0x26de67,null))[_0x63d0('0x46')](respondWithResult(_0x26de67,null))[_0x63d0('0x47')](handleError(_0x26de67,null));};exports['create']=function(_0x233d39,_0x820fcd){return db[_0x63d0('0x4a')][_0x63d0('0x4c')](_0x233d39[_0x63d0('0x4d')],{})[_0x63d0('0x46')](respondWithResult(_0x820fcd,0xc9))['catch'](handleError(_0x820fcd,null));};exports[_0x63d0('0x26')]=function(_0x225a80,_0x59ccc8){if(_0x225a80[_0x63d0('0x4d')]['id']){delete _0x225a80[_0x63d0('0x4d')]['id'];}return db[_0x63d0('0x4a')][_0x63d0('0x4b')]({'where':{'id':_0x225a80[_0x63d0('0x49')]['id']}})[_0x63d0('0x46')](handleEntityNotFound(_0x59ccc8,null))['then'](saveUpdates(_0x225a80[_0x63d0('0x4d')],null))[_0x63d0('0x46')](respondWithResult(_0x59ccc8,null))[_0x63d0('0x47')](handleError(_0x59ccc8,null));};exports[_0x63d0('0x27')]=function(_0x7159df,_0x370342){return db[_0x63d0('0x4a')]['find']({'where':{'id':_0x7159df['params']['id']}})[_0x63d0('0x46')](handleEntityNotFound(_0x370342,null))[_0x63d0('0x46')](removeEntity(_0x370342,null))['catch'](handleError(_0x370342,null));};exports[_0x63d0('0x4e')]=function(_0x4ce574,_0x3752e9){return db['VoiceQueueReport'][_0x63d0('0x4e')]()[_0x63d0('0x46')](respondWithResult(_0x3752e9,null))[_0x63d0('0x47')](handleError(_0x3752e9,null));};exports[_0x63d0('0x4f')]=function(_0x25756c,_0xfbeee3){var _0x3c1127={},_0x520f07={},_0x286ad5={'count':0x0,'rows':[]};_0x520f07['model']=_[_0x63d0('0x32')](db[_0x63d0('0x4a')]['rawAttributes']);_0x520f07[_0x63d0('0x33')]=_['keys'](_0x25756c['query']);_0x520f07[_0x63d0('0x34')]=_[_0x63d0('0x37')](_0x520f07[_0x63d0('0x35')],_0x520f07[_0x63d0('0x33')]);_0x3c1127[_0x63d0('0x36')]=_[_0x63d0('0x37')](_0x520f07[_0x63d0('0x35')],qs[_0x63d0('0x38')](_0x25756c[_0x63d0('0x33')][_0x63d0('0x38')]));_0x3c1127['attributes']=_0x3c1127[_0x63d0('0x36')][_0x63d0('0x39')]?_0x3c1127['attributes']:_0x520f07[_0x63d0('0x35')];if(!_0x25756c[_0x63d0('0x33')][_0x63d0('0x3a')](_0x63d0('0x3b'))){_0x3c1127[_0x63d0('0x1f')]=qs[_0x63d0('0x1f')](_0x25756c['query'][_0x63d0('0x1f')]);_0x3c1127[_0x63d0('0x1d')]=qs[_0x63d0('0x1d')](_0x25756c['query'][_0x63d0('0x1d')]);}_0x3c1127['order']=qs[_0x63d0('0x3d')](_0x25756c[_0x63d0('0x33')]['sort']);_0x3c1127['where']=qs[_0x63d0('0x34')](_[_0x63d0('0x50')](_0x25756c[_0x63d0('0x33')],_0x520f07[_0x63d0('0x34')]));if(_0x25756c['query']['filter']){_0x3c1127[_0x63d0('0x3f')]=_['merge'](_0x3c1127[_0x63d0('0x3f')],{'$or':_[_0x63d0('0x2e')](_0x3c1127[_0x63d0('0x36')],function(_0x3539aa){var _0x3f477a={};_0x3f477a[_0x3539aa]={'$like':'%'+_0x25756c[_0x63d0('0x33')][_0x63d0('0x3e')]+'%'};return _0x3f477a;})});}_0x3c1127=_[_0x63d0('0x40')]({},_0x3c1127,_0x25756c[_0x63d0('0x42')]);var _0x118595={'where':_0x3c1127[_0x63d0('0x3f')]};return db[_0x63d0('0x4a')]['count'](_0x118595)[_0x63d0('0x46')](function(_0x66c637){_0x286ad5['count']=_0x66c637;if(_0x25756c[_0x63d0('0x33')][_0x63d0('0x51')]){_0x3c1127[_0x63d0('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x63d0('0x44')](_0x3c1127);})['then'](function(_0x5297f2){_0x286ad5[_0x63d0('0x45')]=_0x5297f2;return _0x286ad5;})[_0x63d0('0x46')](respondWithFilteredResult(_0xfbeee3,_0x3c1127,'getVoiceQueuesReport'))[_0x63d0('0x47')](handleError(_0xfbeee3,null,_0x63d0('0x4f')));}; \ No newline at end of file +var _0x3db9=['mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','order','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3db9,0xa1));var _0x93db=function(_0x5829b0,_0x4860ec){_0x5829b0=_0x5829b0-0x0;var _0x6b0950=_0x3db9[_0x5829b0];return _0x6b0950;};'use strict';var emlformat=require(_0x93db('0x0'));var rimraf=require(_0x93db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93db('0x2'));var rp=require(_0x93db('0x3'));var moment=require(_0x93db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93db('0x5'));var util=require(_0x93db('0x6'));var path=require('path');var sox=require(_0x93db('0x7'));var csv=require('to-csv');var ejs=require(_0x93db('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93db('0x9'));var squel=require(_0x93db('0xa'));var crypto=require('crypto');var jsforce=require(_0x93db('0xb'));var deskjs=require(_0x93db('0xc'));var toCsv=require(_0x93db('0xd'));var querystring=require(_0x93db('0xe'));var Papa=require(_0x93db('0xf'));var Redis=require(_0x93db('0x10'));var authService=require(_0x93db('0x11'));var qs=require(_0x93db('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x93db('0x13'))('api');var utils=require(_0x93db('0x14'));var config=require(_0x93db('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x93db('0x16'))['db'];config[_0x93db('0x17')]=_[_0x93db('0x18')](config[_0x93db('0x17')],{'host':_0x93db('0x19'),'port':0x18eb});var socket=require(_0x93db('0x1a'))(new Redis(config['redis']));require(_0x93db('0x1b'))[_0x93db('0x1c')](socket);function respondWithStatusCode(_0x71594d,_0x5543ea){_0x5543ea=_0x5543ea||0xcc;return function(_0x3d7d38){if(_0x3d7d38){return _0x71594d['sendStatus'](_0x5543ea);}return _0x71594d['status'](_0x5543ea)['end']();};}function respondWithResult(_0x45e7bd,_0x2f3e19){_0x2f3e19=_0x2f3e19||0xc8;return function(_0x27f3ae){if(_0x27f3ae){return _0x45e7bd[_0x93db('0x1d')](_0x2f3e19)[_0x93db('0x1e')](_0x27f3ae);}};}function respondWithFilteredResult(_0x2093b6,_0x461617){return function(_0x115a15){if(_0x115a15){var _0x50c8bd=typeof _0x461617[_0x93db('0x1f')]===_0x93db('0x20')&&typeof _0x461617[_0x93db('0x21')]===_0x93db('0x20');var _0x48a039=_0x115a15[_0x93db('0x22')];var _0xbfe0d3=_0x50c8bd?0x0:_0x461617[_0x93db('0x1f')];var _0x292a34=_0x50c8bd?_0x115a15['count']:_0x461617['offset']+_0x461617[_0x93db('0x21')];var _0x6daf0a;if(_0x292a34>=_0x48a039){_0x292a34=_0x48a039;_0x6daf0a=0xc8;}else{_0x6daf0a=0xce;}_0x2093b6[_0x93db('0x1d')](_0x6daf0a);return _0x2093b6[_0x93db('0x23')](_0x93db('0x24'),_0xbfe0d3+'-'+_0x292a34+'/'+_0x48a039)[_0x93db('0x1e')](_0x115a15);}return null;};}function patchUpdates(_0x41ad02){return function(_0x5bcc24){try{jsonpatch[_0x93db('0x25')](_0x5bcc24,_0x41ad02,!![]);}catch(_0x62fb98){return BPromise[_0x93db('0x26')](_0x62fb98);}return _0x5bcc24[_0x93db('0x27')]();};}function saveUpdates(_0x5bd802,_0x96833a){return function(_0x5daa56){if(_0x5daa56){return _0x5daa56[_0x93db('0x28')](_0x5bd802)[_0x93db('0x29')](function(_0x23bfd5){return _0x23bfd5;});}return null;};}function removeEntity(_0x154774,_0x5e7b3d){return function(_0x2aa5fa){if(_0x2aa5fa){return _0x2aa5fa[_0x93db('0x2a')]()[_0x93db('0x29')](function(){_0x154774['status'](0xcc)[_0x93db('0x2b')]();});}};}function handleEntityNotFound(_0x1cd90c,_0x4be285){return function(_0x298d87){if(!_0x298d87){_0x1cd90c['sendStatus'](0x194);}return _0x298d87;};}function handleError(_0x2858eb,_0x5e0707){_0x5e0707=_0x5e0707||0x1f4;return function(_0x328e79){logger[_0x93db('0x2c')](_0x328e79['stack']);if(_0x328e79[_0x93db('0x2d')]){delete _0x328e79['name'];}_0x2858eb[_0x93db('0x1d')](_0x5e0707)[_0x93db('0x2e')](_0x328e79);};}exports['index']=function(_0x42f199,_0x35a51f){var _0x391ae9={},_0x33b302={},_0x386e32={'count':0x0,'rows':[]};var _0x136823=_['map'](db['VoiceQueueReport'][_0x93db('0x2f')],function(_0x277459){return{'name':_0x277459[_0x93db('0x30')],'type':_0x277459[_0x93db('0x31')][_0x93db('0x32')]};});_0x33b302[_0x93db('0x33')]=_[_0x93db('0x34')](_0x136823,_0x93db('0x2d'));_0x33b302[_0x93db('0x35')]=_[_0x93db('0x36')](_0x42f199[_0x93db('0x35')]);_0x33b302[_0x93db('0x37')]=_[_0x93db('0x38')](_0x33b302[_0x93db('0x33')],_0x33b302[_0x93db('0x35')]);_0x391ae9[_0x93db('0x39')]=_[_0x93db('0x38')](_0x33b302[_0x93db('0x33')],qs['fields'](_0x42f199[_0x93db('0x35')][_0x93db('0x3a')]));_0x391ae9[_0x93db('0x39')]=_0x391ae9[_0x93db('0x39')][_0x93db('0x3b')]?_0x391ae9[_0x93db('0x39')]:_0x33b302[_0x93db('0x33')];if(!_0x42f199[_0x93db('0x35')][_0x93db('0x3c')](_0x93db('0x3d'))){_0x391ae9['limit']=qs[_0x93db('0x21')](_0x42f199[_0x93db('0x35')]['limit']);_0x391ae9[_0x93db('0x1f')]=qs['offset'](_0x42f199[_0x93db('0x35')][_0x93db('0x1f')]);}_0x391ae9['order']=qs[_0x93db('0x3e')](_0x42f199['query'][_0x93db('0x3e')]);_0x391ae9[_0x93db('0x3f')]=qs[_0x93db('0x37')](_[_0x93db('0x40')](_0x42f199['query'],_0x33b302[_0x93db('0x37')]),_0x136823);if(_0x42f199[_0x93db('0x35')]['filter']){_0x391ae9['where']=_[_0x93db('0x41')](_0x391ae9[_0x93db('0x3f')],{'$or':_[_0x93db('0x34')](_0x136823,function(_0x6fc464){if(_0x6fc464[_0x93db('0x31')]!==_0x93db('0x42')){var _0x2353c0={};_0x2353c0[_0x6fc464['name']]={'$like':'%'+_0x42f199[_0x93db('0x35')][_0x93db('0x43')]+'%'};return _0x2353c0;}})});}_0x391ae9=_[_0x93db('0x41')]({},_0x391ae9,_0x42f199['options']);var _0x57e180={'where':_0x391ae9[_0x93db('0x3f')]};return db[_0x93db('0x44')][_0x93db('0x22')](_0x57e180)['then'](function(_0x44ec6f){_0x386e32[_0x93db('0x22')]=_0x44ec6f;if(_0x42f199['query'][_0x93db('0x45')]){_0x391ae9[_0x93db('0x46')]=[{'all':!![]}];}return db[_0x93db('0x44')][_0x93db('0x47')](_0x391ae9);})[_0x93db('0x29')](function(_0x1b028d){_0x386e32[_0x93db('0x48')]=_0x1b028d;return _0x386e32;})[_0x93db('0x29')](respondWithFilteredResult(_0x35a51f,_0x391ae9))[_0x93db('0x49')](handleError(_0x35a51f,null));};exports[_0x93db('0x4a')]=function(_0x4cd060,_0x5b0f09){var _0x6f8413={'raw':![],'where':{'id':_0x4cd060[_0x93db('0x4b')]['id']}},_0x24120b={};_0x24120b[_0x93db('0x33')]=_[_0x93db('0x36')](db[_0x93db('0x44')][_0x93db('0x2f')]);_0x24120b[_0x93db('0x35')]=_[_0x93db('0x36')](_0x4cd060[_0x93db('0x35')]);_0x24120b[_0x93db('0x37')]=_['intersection'](_0x24120b[_0x93db('0x33')],_0x24120b['query']);_0x6f8413['attributes']=_[_0x93db('0x38')](_0x24120b[_0x93db('0x33')],qs[_0x93db('0x3a')](_0x4cd060[_0x93db('0x35')][_0x93db('0x3a')]));_0x6f8413['attributes']=_0x6f8413[_0x93db('0x39')]['length']?_0x6f8413[_0x93db('0x39')]:_0x24120b['model'];if(_0x4cd060[_0x93db('0x35')][_0x93db('0x45')]){_0x6f8413[_0x93db('0x46')]=[{'all':!![]}];}_0x6f8413=_[_0x93db('0x41')]({},_0x6f8413,_0x4cd060[_0x93db('0x4c')]);return db[_0x93db('0x44')][_0x93db('0x4d')](_0x6f8413)[_0x93db('0x29')](handleEntityNotFound(_0x5b0f09,null))[_0x93db('0x29')](respondWithResult(_0x5b0f09,null))[_0x93db('0x49')](handleError(_0x5b0f09,null));};exports[_0x93db('0x4e')]=function(_0x5c8924,_0x559204){return db['VoiceQueueReport'][_0x93db('0x4e')](_0x5c8924[_0x93db('0x4f')],{})[_0x93db('0x29')](respondWithResult(_0x559204,0xc9))['catch'](handleError(_0x559204,null));};exports[_0x93db('0x28')]=function(_0x4f3828,_0x34de96){if(_0x4f3828['body']['id']){delete _0x4f3828[_0x93db('0x4f')]['id'];}return db[_0x93db('0x44')][_0x93db('0x4d')]({'where':{'id':_0x4f3828[_0x93db('0x4b')]['id']}})[_0x93db('0x29')](handleEntityNotFound(_0x34de96,null))[_0x93db('0x29')](saveUpdates(_0x4f3828[_0x93db('0x4f')],null))['then'](respondWithResult(_0x34de96,null))[_0x93db('0x49')](handleError(_0x34de96,null));};exports[_0x93db('0x2a')]=function(_0x248b98,_0x40a838){return db[_0x93db('0x44')][_0x93db('0x4d')]({'where':{'id':_0x248b98[_0x93db('0x4b')]['id']}})['then'](handleEntityNotFound(_0x40a838,null))[_0x93db('0x29')](removeEntity(_0x40a838,null))[_0x93db('0x49')](handleError(_0x40a838,null));};exports[_0x93db('0x50')]=function(_0x10fe8e,_0x334df4){return db['VoiceQueueReport']['describe']()[_0x93db('0x29')](respondWithResult(_0x334df4,null))[_0x93db('0x49')](handleError(_0x334df4,null));};exports[_0x93db('0x51')]=function(_0x209930,_0x1e3729){var _0x87f180={},_0x4e3336={},_0x29f586={'count':0x0,'rows':[]};_0x4e3336[_0x93db('0x33')]=_['keys'](db[_0x93db('0x44')][_0x93db('0x2f')]);_0x4e3336[_0x93db('0x35')]=_[_0x93db('0x36')](_0x209930[_0x93db('0x35')]);_0x4e3336[_0x93db('0x37')]=_['intersection'](_0x4e3336[_0x93db('0x33')],_0x4e3336[_0x93db('0x35')]);_0x87f180[_0x93db('0x39')]=_[_0x93db('0x38')](_0x4e3336[_0x93db('0x33')],qs['fields'](_0x209930[_0x93db('0x35')]['fields']));_0x87f180[_0x93db('0x39')]=_0x87f180[_0x93db('0x39')][_0x93db('0x3b')]?_0x87f180['attributes']:_0x4e3336[_0x93db('0x33')];if(!_0x209930[_0x93db('0x35')][_0x93db('0x3c')]('nolimit')){_0x87f180[_0x93db('0x21')]=qs[_0x93db('0x21')](_0x209930[_0x93db('0x35')][_0x93db('0x21')]);_0x87f180[_0x93db('0x1f')]=qs[_0x93db('0x1f')](_0x209930['query'][_0x93db('0x1f')]);}_0x87f180[_0x93db('0x52')]=qs[_0x93db('0x3e')](_0x209930['query']['sort']);_0x87f180['where']=qs[_0x93db('0x37')](_[_0x93db('0x40')](_0x209930[_0x93db('0x35')],_0x4e3336[_0x93db('0x37')]));if(_0x209930['query'][_0x93db('0x43')]){_0x87f180[_0x93db('0x3f')]=_[_0x93db('0x41')](_0x87f180[_0x93db('0x3f')],{'$or':_[_0x93db('0x34')](_0x87f180[_0x93db('0x39')],function(_0x1fe42f){var _0x376c26={};_0x376c26[_0x1fe42f]={'$like':'%'+_0x209930[_0x93db('0x35')][_0x93db('0x43')]+'%'};return _0x376c26;})});}_0x87f180=_[_0x93db('0x41')]({},_0x87f180,_0x209930[_0x93db('0x4c')]);var _0x3b12e1={'where':_0x87f180[_0x93db('0x3f')]};return db['VoiceQueueReport'][_0x93db('0x22')](_0x3b12e1)[_0x93db('0x29')](function(_0x52d000){_0x29f586[_0x93db('0x22')]=_0x52d000;if(_0x209930[_0x93db('0x35')][_0x93db('0x45')]){_0x87f180['include']=[{'all':!![]}];}return db[_0x93db('0x44')][_0x93db('0x47')](_0x87f180);})[_0x93db('0x29')](function(_0xa99482){_0x29f586[_0x93db('0x48')]=_0xa99482;return _0x29f586;})[_0x93db('0x29')](respondWithFilteredResult(_0x1e3729,_0x87f180,_0x93db('0x51')))[_0x93db('0x49')](handleError(_0x1e3729,null,_0x93db('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 8597739..a7cd5ca 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 _0x60cc=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3fd50c,_0x5b1e4b){var _0x55e690=function(_0x280442){while(--_0x280442){_0x3fd50c['push'](_0x3fd50c['shift']());}};_0x55e690(++_0x5b1e4b);}(_0x60cc,0x1ba));var _0xc60c=function(_0x44af77,_0x353100){_0x44af77=_0x44af77-0x0;var _0x3847e0=_0x60cc[_0x44af77];return _0x3847e0;};'use strict';var EventEmitter=require(_0xc60c('0x0'));var VoiceQueueReport=require(_0xc60c('0x1'))['db'][_0xc60c('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc60c('0x3')](0x0);var events={'afterCreate':_0xc60c('0x4'),'afterUpdate':_0xc60c('0x5'),'afterDestroy':_0xc60c('0x6')};function emitEvent(_0x593364){return function(_0x5b4721,_0x145469,_0x319e9e){VoiceQueueReportEvents[_0xc60c('0x7')](_0x593364+':'+_0x5b4721['id'],_0x5b4721);VoiceQueueReportEvents['emit'](_0x593364,_0x5b4721);_0x319e9e(null);};}for(var e in events){if(events[_0xc60c('0x8')](e)){var event=events[e];VoiceQueueReport[_0xc60c('0x9')](e,emitEvent(event));}}module[_0xc60c('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf47f=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xf47f,0xf7));var _0xff47=function(_0x2e9495,_0xeb67a3){_0x2e9495=_0x2e9495-0x0;var _0x3c6ac0=_0xf47f[_0x2e9495];return _0x3c6ac0;};'use strict';var EventEmitter=require(_0xff47('0x0'));var VoiceQueueReport=require(_0xff47('0x1'))['db'][_0xff47('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xff47('0x3')](0x0);var events={'afterCreate':_0xff47('0x4'),'afterUpdate':_0xff47('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc0b948){return function(_0x1a7d0f,_0x3ed641,_0x222921){VoiceQueueReportEvents[_0xff47('0x6')](_0xc0b948+':'+_0x1a7d0f['id'],_0x1a7d0f);VoiceQueueReportEvents['emit'](_0xc0b948,_0x1a7d0f);_0x222921(null);};}for(var e in events){if(events[_0xff47('0x7')](e)){var event=events[e];VoiceQueueReport[_0xff47('0x8')](e,emitEvent(event));}}module[_0xff47('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index c07b9b8..c3b4337 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 _0x34e1=['define','VoiceQueueReport','uniqueid','calleridnum','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x34e1,0x148));var _0x134e=function(_0x507710,_0x14d2f9){_0x507710=_0x507710-0x0;var _0x7a2815=_0x34e1[_0x507710];return _0x7a2815;};'use strict';var _=require('lodash');var util=require(_0x134e('0x0'));var logger=require(_0x134e('0x1'))(_0x134e('0x2'));var moment=require('moment');var BPromise=require(_0x134e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x134e('0x4'));var config=require(_0x134e('0x5'));var attributes=require(_0x134e('0x6'));module[_0x134e('0x7')]=function(_0x30b78a,_0x238502){return _0x30b78a[_0x134e('0x8')](_0x134e('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x134e('0xa')]},{'fields':[_0x134e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9fbd=['request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','../../config/logger','api','bluebird'];(function(_0x1bf032,_0x487049){var _0x27477c=function(_0x64254f){while(--_0x64254f){_0x1bf032['push'](_0x1bf032['shift']());}};_0x27477c(++_0x487049);}(_0x9fbd,0x1ca));var _0xd9fb=function(_0x5a5fea,_0x4c41cb){_0x5a5fea=_0x5a5fea-0x0;var _0x3e3213=_0x9fbd[_0x5a5fea];return _0x3e3213;};'use strict';var _=require(_0xd9fb('0x0'));var util=require('util');var logger=require(_0xd9fb('0x1'))(_0xd9fb('0x2'));var moment=require('moment');var BPromise=require(_0xd9fb('0x3'));var rp=require(_0xd9fb('0x4'));var fs=require('fs');var path=require(_0xd9fb('0x5'));var rimraf=require(_0xd9fb('0x6'));var config=require(_0xd9fb('0x7'));var attributes=require(_0xd9fb('0x8'));module[_0xd9fb('0x9')]=function(_0x115201,_0x24f33d){return _0x115201[_0xd9fb('0xa')](_0xd9fb('0xb'),attributes,{'tableName':_0xd9fb('0xc'),'paranoid':![],'indexes':[{'fields':[_0xd9fb('0xd')]},{'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 931d44b..e530654 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 _0xebc9=['attributes','limit','include','map','model','create','body','raw','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','where'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xebc9,0x173));var _0x9ebc=function(_0x3fd241,_0x1e0484){_0x3fd241=_0x3fd241-0x0;var _0x38695a=_0xebc9[_0x3fd241];return _0x38695a;};'use strict';var _=require(_0x9ebc('0x0'));var util=require(_0x9ebc('0x1'));var moment=require(_0x9ebc('0x2'));var BPromise=require(_0x9ebc('0x3'));var rs=require(_0x9ebc('0x4'));var fs=require('fs');var Redis=require(_0x9ebc('0x5'));var db=require(_0x9ebc('0x6'))['db'];var utils=require(_0x9ebc('0x7'));var logger=require(_0x9ebc('0x8'))(_0x9ebc('0x9'));var config=require(_0x9ebc('0xa'));var jayson=require(_0x9ebc('0xb'));var client=jayson[_0x9ebc('0xc')]['http']({'port':0x232a});config[_0x9ebc('0xd')]=_[_0x9ebc('0xe')](config['redis'],{'host':_0x9ebc('0xf'),'port':0x18eb});var socket=require(_0x9ebc('0x10'))(new Redis(config[_0x9ebc('0xd')]));require(_0x9ebc('0x11'))['register'](socket);function respondWithRpcPromise(_0xa2a713,_0x263363,_0x5284a8){return new BPromise(function(_0x2d7d9a,_0x33a68a){return client[_0x9ebc('0x12')](_0xa2a713,_0x5284a8)[_0x9ebc('0x13')](function(_0x525713){logger[_0x9ebc('0x14')](_0x9ebc('0x15'),_0x263363,_0x9ebc('0x16'));logger[_0x9ebc('0x17')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x263363,_0x9ebc('0x16'),JSON[_0x9ebc('0x18')](_0x525713));if(_0x525713[_0x9ebc('0x19')]){if(_0x525713['error'][_0x9ebc('0x1a')]===0x1f4){logger[_0x9ebc('0x19')](_0x9ebc('0x15'),_0x263363,_0x525713[_0x9ebc('0x19')][_0x9ebc('0x1b')]);return _0x33a68a(_0x525713[_0x9ebc('0x19')][_0x9ebc('0x1b')]);}logger[_0x9ebc('0x19')](_0x9ebc('0x15'),_0x263363,_0x525713['error'][_0x9ebc('0x1b')]);return _0x2d7d9a(_0x525713[_0x9ebc('0x19')]['message']);}else{logger[_0x9ebc('0x14')](_0x9ebc('0x15'),_0x263363,_0x9ebc('0x16'));_0x2d7d9a(_0x525713[_0x9ebc('0x1c')][_0x9ebc('0x1b')]);}})[_0x9ebc('0x1d')](function(_0x24b0ed){logger[_0x9ebc('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x263363,_0x24b0ed);_0x33a68a(_0x24b0ed);});});}exports[_0x9ebc('0x1e')]=function(_0x32f4bd){var _0x3e4ec4=this;return new Promise(function(_0x12f07f,_0x1f1913){return db[_0x9ebc('0x1f')]['findAll']({'raw':_0x32f4bd[_0x9ebc('0x20')]?_0x32f4bd[_0x9ebc('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x32f4bd[_0x9ebc('0x20')]?_0x32f4bd['options'][_0x9ebc('0x21')]||null:null,'attributes':_0x32f4bd['options']?_0x32f4bd[_0x9ebc('0x20')][_0x9ebc('0x22')]||null:null,'limit':_0x32f4bd['options']?_0x32f4bd['options'][_0x9ebc('0x23')]||null:null,'include':_0x32f4bd[_0x9ebc('0x20')]?_0x32f4bd['options'][_0x9ebc('0x24')]?_[_0x9ebc('0x25')](_0x32f4bd['options'][_0x9ebc('0x24')],function(_0x1fcaba){return{'model':db[_0x1fcaba[_0x9ebc('0x26')]],'as':_0x1fcaba['as'],'attributes':_0x1fcaba[_0x9ebc('0x22')],'include':_0x1fcaba[_0x9ebc('0x24')]?_['map'](_0x1fcaba[_0x9ebc('0x24')],function(_0x10c20c){return{'model':db[_0x10c20c['model']],'as':_0x10c20c['as'],'attributes':_0x10c20c[_0x9ebc('0x22')],'include':_0x10c20c['include']?_[_0x9ebc('0x25')](_0x10c20c[_0x9ebc('0x24')],function(_0x321293){return{'model':db[_0x321293['model']],'as':_0x321293['as'],'attributes':_0x321293[_0x9ebc('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9ebc('0x13')](function(_0x481449){logger[_0x9ebc('0x14')](_0x9ebc('0x1e'),_0x32f4bd);logger[_0x9ebc('0x17')](_0x9ebc('0x1e'),_0x32f4bd,JSON[_0x9ebc('0x18')](_0x481449));_0x12f07f(_0x481449);})['catch'](function(_0x32e698){logger['error']('GetVoiceQueueReport',_0x32e698[_0x9ebc('0x1b')],_0x32f4bd);_0x1f1913(_0x3e4ec4['error'](0x1f4,_0x32e698[_0x9ebc('0x1b')]));});});};exports['CreateVoiceQueueReport']=function(_0xa370b){var _0x56a3cf=this;return new Promise(function(_0x4ce686,_0x2d385a){return db[_0x9ebc('0x1f')][_0x9ebc('0x27')](_0xa370b[_0x9ebc('0x28')],{'raw':_0xa370b[_0x9ebc('0x20')]?_0xa370b['options'][_0x9ebc('0x29')]===undefined?!![]:![]:!![]})[_0x9ebc('0x13')](function(_0x7d4bcf){logger[_0x9ebc('0x14')](_0x9ebc('0x2a'),_0xa370b);logger[_0x9ebc('0x17')](_0x9ebc('0x2a'),_0xa370b,JSON[_0x9ebc('0x18')](_0x7d4bcf));_0x4ce686(_0x7d4bcf);})[_0x9ebc('0x1d')](function(_0x352cdf){logger['error'](_0x9ebc('0x2a'),_0x352cdf[_0x9ebc('0x1b')],_0xa370b);_0x2d385a(_0x56a3cf['error'](0x1f4,_0x352cdf[_0x9ebc('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x1e1401){var _0x4e3ee7=this;return new Promise(function(_0x234f02,_0x41d877){return db['VoiceQueueReport'][_0x9ebc('0x2b')](_0x1e1401[_0x9ebc('0x28')],{'raw':_0x1e1401[_0x9ebc('0x20')]?_0x1e1401[_0x9ebc('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1401[_0x9ebc('0x20')]?_0x1e1401['options'][_0x9ebc('0x21')]||null:null,'attributes':_0x1e1401[_0x9ebc('0x20')]?_0x1e1401[_0x9ebc('0x20')][_0x9ebc('0x22')]||null:null,'limit':_0x1e1401[_0x9ebc('0x20')]?_0x1e1401[_0x9ebc('0x20')][_0x9ebc('0x23')]||null:null})[_0x9ebc('0x13')](function(_0x3fc324){logger[_0x9ebc('0x14')]('UpdateVoiceQueueReport',_0x1e1401);logger[_0x9ebc('0x17')](_0x9ebc('0x2c'),_0x1e1401,JSON[_0x9ebc('0x18')](_0x3fc324));_0x234f02(_0x3fc324);})['catch'](function(_0x1ee99a){logger[_0x9ebc('0x19')](_0x9ebc('0x2c'),_0x1ee99a[_0x9ebc('0x1b')],_0x1e1401);_0x41d877(_0x4e3ee7['error'](0x1f4,_0x1ee99a[_0x9ebc('0x1b')]));});});}; \ No newline at end of file +var _0x21b4=['then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueueReport','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request'];(function(_0x41476c,_0x515ff2){var _0x8ccf44=function(_0x5bd0ea){while(--_0x5bd0ea){_0x41476c['push'](_0x41476c['shift']());}};_0x8ccf44(++_0x515ff2);}(_0x21b4,0xdf));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x421b('0x0'));var util=require(_0x421b('0x1'));var moment=require(_0x421b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x421b('0x3'));var db=require(_0x421b('0x4'))['db'];var utils=require(_0x421b('0x5'));var logger=require('../../config/logger')(_0x421b('0x6'));var config=require(_0x421b('0x7'));var jayson=require(_0x421b('0x8'));var client=jayson[_0x421b('0x9')]['http']({'port':0x232a});config[_0x421b('0xa')]=_[_0x421b('0xb')](config[_0x421b('0xa')],{'host':_0x421b('0xc'),'port':0x18eb});var socket=require(_0x421b('0xd'))(new Redis(config['redis']));require(_0x421b('0xe'))[_0x421b('0xf')](socket);function respondWithRpcPromise(_0x36ce48,_0x586d3f,_0x1b089a){return new BPromise(function(_0x22a178,_0x4a46dd){return client[_0x421b('0x10')](_0x36ce48,_0x1b089a)[_0x421b('0x11')](function(_0x4ae003){logger[_0x421b('0x12')](_0x421b('0x13'),_0x586d3f,'request\x20sent');logger[_0x421b('0x14')](_0x421b('0x15'),_0x586d3f,'request\x20sent',JSON[_0x421b('0x16')](_0x4ae003));if(_0x4ae003['error']){if(_0x4ae003[_0x421b('0x17')]['code']===0x1f4){logger['error'](_0x421b('0x13'),_0x586d3f,_0x4ae003['error'][_0x421b('0x18')]);return _0x4a46dd(_0x4ae003[_0x421b('0x17')][_0x421b('0x18')]);}logger['error'](_0x421b('0x13'),_0x586d3f,_0x4ae003[_0x421b('0x17')][_0x421b('0x18')]);return _0x22a178(_0x4ae003['error'][_0x421b('0x18')]);}else{logger[_0x421b('0x12')](_0x421b('0x13'),_0x586d3f,'request\x20sent');_0x22a178(_0x4ae003['result'][_0x421b('0x18')]);}})[_0x421b('0x19')](function(_0x5b2959){logger[_0x421b('0x17')](_0x421b('0x13'),_0x586d3f,_0x5b2959);_0x4a46dd(_0x5b2959);});});}exports[_0x421b('0x1a')]=function(_0x2ff2ea){var _0x5d594b=this;return new Promise(function(_0x4523c9,_0xa83f4f){return db['VoiceQueueReport']['findAll']({'raw':_0x2ff2ea[_0x421b('0x1b')]?_0x2ff2ea[_0x421b('0x1b')][_0x421b('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ff2ea[_0x421b('0x1b')]?_0x2ff2ea['options'][_0x421b('0x1d')]||null:null,'attributes':_0x2ff2ea['options']?_0x2ff2ea[_0x421b('0x1b')][_0x421b('0x1e')]||null:null,'limit':_0x2ff2ea[_0x421b('0x1b')]?_0x2ff2ea[_0x421b('0x1b')][_0x421b('0x1f')]||null:null,'include':_0x2ff2ea['options']?_0x2ff2ea['options'][_0x421b('0x20')]?_[_0x421b('0x21')](_0x2ff2ea['options'][_0x421b('0x20')],function(_0x50d9ce){return{'model':db[_0x50d9ce[_0x421b('0x22')]],'as':_0x50d9ce['as'],'attributes':_0x50d9ce[_0x421b('0x1e')],'include':_0x50d9ce[_0x421b('0x20')]?_[_0x421b('0x21')](_0x50d9ce[_0x421b('0x20')],function(_0x77da96){return{'model':db[_0x77da96[_0x421b('0x22')]],'as':_0x77da96['as'],'attributes':_0x77da96[_0x421b('0x1e')],'include':_0x77da96['include']?_['map'](_0x77da96[_0x421b('0x20')],function(_0x227f2c){return{'model':db[_0x227f2c['model']],'as':_0x227f2c['as'],'attributes':_0x227f2c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a6262){logger[_0x421b('0x12')]('GetVoiceQueueReport',_0x2ff2ea);logger[_0x421b('0x14')](_0x421b('0x1a'),_0x2ff2ea,JSON[_0x421b('0x16')](_0x5a6262));_0x4523c9(_0x5a6262);})['catch'](function(_0x434e8e){logger[_0x421b('0x17')](_0x421b('0x1a'),_0x434e8e[_0x421b('0x18')],_0x2ff2ea);_0xa83f4f(_0x5d594b[_0x421b('0x17')](0x1f4,_0x434e8e['message']));});});};exports[_0x421b('0x23')]=function(_0x8af905){var _0x367c90=this;return new Promise(function(_0x632b54,_0x3c83ed){return db[_0x421b('0x24')][_0x421b('0x25')](_0x8af905[_0x421b('0x26')],{'raw':_0x8af905[_0x421b('0x1b')]?_0x8af905['options'][_0x421b('0x1c')]===undefined?!![]:![]:!![]})[_0x421b('0x11')](function(_0x284993){logger[_0x421b('0x12')](_0x421b('0x23'),_0x8af905);logger['debug'](_0x421b('0x23'),_0x8af905,JSON[_0x421b('0x16')](_0x284993));_0x632b54(_0x284993);})['catch'](function(_0x11e217){logger[_0x421b('0x17')](_0x421b('0x23'),_0x11e217['message'],_0x8af905);_0x3c83ed(_0x367c90['error'](0x1f4,_0x11e217[_0x421b('0x18')]));});});};exports[_0x421b('0x27')]=function(_0x7514ee){var _0x5d75a9=this;return new Promise(function(_0x59be64,_0x213278){return db[_0x421b('0x24')]['update'](_0x7514ee['body'],{'raw':_0x7514ee[_0x421b('0x1b')]?_0x7514ee[_0x421b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7514ee[_0x421b('0x1b')]?_0x7514ee[_0x421b('0x1b')][_0x421b('0x1d')]||null:null,'attributes':_0x7514ee[_0x421b('0x1b')]?_0x7514ee['options']['attributes']||null:null,'limit':_0x7514ee[_0x421b('0x1b')]?_0x7514ee['options'][_0x421b('0x1f')]||null:null})[_0x421b('0x11')](function(_0x5791ff){logger['info'](_0x421b('0x27'),_0x7514ee);logger[_0x421b('0x14')](_0x421b('0x27'),_0x7514ee,JSON[_0x421b('0x16')](_0x5791ff));_0x59be64(_0x5791ff);})[_0x421b('0x19')](function(_0x4b8134){logger['error'](_0x421b('0x27'),_0x4b8134['message'],_0x7514ee);_0x213278(_0x5d75a9['error'](0x1f4,_0x4b8134[_0x421b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 4efe719..2bf9625 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 _0x740a=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x1d3019,_0x8dbbd5){var _0x36458e=function(_0x5d60db){while(--_0x5d60db){_0x1d3019['push'](_0x1d3019['shift']());}};_0x36458e(++_0x8dbbd5);}(_0x740a,0x175));var _0xa740=function(_0x5a2f48,_0x5ef398){_0x5a2f48=_0x5a2f48-0x0;var _0x229036=_0x740a[_0x5a2f48];return _0x229036;};'use strict';var VoiceQueueReportEvents=require(_0xa740('0x0'));var events=[_0xa740('0x1'),_0xa740('0x2'),_0xa740('0x3')];function createListener(_0x216cea,_0x2e7f6c){return function(_0x23caee){_0x2e7f6c[_0xa740('0x4')](_0x216cea,_0x23caee);};}function removeListener(_0x4e3da6,_0x308c48){return function(){VoiceQueueReportEvents['removeListener'](_0x4e3da6,_0x308c48);};}exports['register']=function(_0x1d3daa){for(var _0x9583c8=0x0,_0x1858d7=events[_0xa740('0x5')];_0x9583c8<_0x1858d7;_0x9583c8++){var _0x356379=events[_0x9583c8];var _0x74b3cd=createListener(_0xa740('0x6')+_0x356379,_0x1d3daa);VoiceQueueReportEvents['on'](_0x356379,_0x74b3cd);}}; \ No newline at end of file +var _0x1294=['length','voiceQueueReport:','./voiceQueueReport.events','remove','emit','removeListener','register'];(function(_0x367abd,_0xcdbf19){var _0x5c3686=function(_0x3fbcc3){while(--_0x3fbcc3){_0x367abd['push'](_0x367abd['shift']());}};_0x5c3686(++_0xcdbf19);}(_0x1294,0xb8));var _0x4129=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1294[_0x46698a];return _0x356db0;};'use strict';var VoiceQueueReportEvents=require(_0x4129('0x0'));var events=['save',_0x4129('0x1'),'update'];function createListener(_0x20a946,_0x461b4e){return function(_0x56ce8d){_0x461b4e[_0x4129('0x2')](_0x20a946,_0x56ce8d);};}function removeListener(_0xbd37d4,_0x987ec2){return function(){VoiceQueueReportEvents[_0x4129('0x3')](_0xbd37d4,_0x987ec2);};}exports[_0x4129('0x4')]=function(_0x3ea6a1){for(var _0x1aa4dd=0x0,_0x45ea1d=events[_0x4129('0x5')];_0x1aa4dd<_0x45ea1d;_0x1aa4dd++){var _0x3e9d3a=events[_0x1aa4dd];var _0x1b6a36=createListener(_0x4129('0x6')+_0x3e9d3a,_0x3ea6a1);VoiceQueueReportEvents['on'](_0x3e9d3a,_0x1b6a36);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 73e6e1a..9e5231a 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 _0xe2a3=['util','express','Router','fs-extra','../../config/environment','index','/:id','isAuthenticated','show','post','put','update','multer'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xe2a3,0x67));var _0x3e2a=function(_0x185f01,_0x3930e3){_0x185f01=_0x185f01-0x0;var _0x330844=_0xe2a3[_0x185f01];return _0x330844;};'use strict';var multer=require(_0x3e2a('0x0'));var util=require(_0x3e2a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3e2a('0x2'));var router=express[_0x3e2a('0x3')]();var fs_extra=require(_0x3e2a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e2a('0x5'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3e2a('0x6')]);router['get'](_0x3e2a('0x7'),auth[_0x3e2a('0x8')](),controller[_0x3e2a('0x9')]);router[_0x3e2a('0xa')]('/',auth[_0x3e2a('0x8')](),controller['create']);router[_0x3e2a('0xb')](_0x3e2a('0x7'),auth[_0x3e2a('0x8')](),controller[_0x3e2a('0xc')]);router['delete'](_0x3e2a('0x7'),auth[_0x3e2a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x099f=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer'];(function(_0x40de05,_0x25afb0){var _0x32f8d9=function(_0x44ac63){while(--_0x44ac63){_0x40de05['push'](_0x40de05['shift']());}};_0x32f8d9(++_0x25afb0);}(_0x099f,0x12f));var _0xf099=function(_0x104906,_0x4ca963){_0x104906=_0x104906-0x0;var _0x2f5aaa=_0x099f[_0x104906];return _0x2f5aaa;};'use strict';var multer=require(_0xf099('0x0'));var util=require(_0xf099('0x1'));var path=require(_0xf099('0x2'));var timeout=require('connect-timeout');var express=require(_0xf099('0x3'));var router=express[_0xf099('0x4')]();var fs_extra=require(_0xf099('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf099('0x6'));var config=require(_0xf099('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xf099('0x8')]('/',auth['isAuthenticated'](),controller[_0xf099('0x9')]);router['get'](_0xf099('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf099('0xb')]('/',auth[_0xf099('0xc')](),controller[_0xf099('0xd')]);router[_0xf099('0xe')](_0xf099('0xa'),auth[_0xf099('0xc')](),controller[_0xf099('0xf')]);router[_0xf099('0x10')](_0xf099('0xa'),auth['isAuthenticated'](),controller[_0xf099('0x11')]);module[_0xf099('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 0a55cbd..6899ce5 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 _0x1bd4=['sequelize','moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1d6528,_0x1c20a3){var _0x3928df=function(_0x520799){while(--_0x520799){_0x1d6528['push'](_0x1d6528['shift']());}};_0x3928df(++_0x1c20a3);}(_0x1bd4,0xf6));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x41bd('0x0'));var moment=require(_0x41bd('0x1'));module['exports']={'time':{'type':Sequelize[_0x41bd('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x41bd('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x41bd('0x3')],'allowNull':![],'defaultValue':moment()[_0x41bd('0x4')](_0x41bd('0x5'))}}; \ No newline at end of file +var _0x933c=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x57aa92,_0x5cd2ae){var _0x30d9de=function(_0x189e67){while(--_0x189e67){_0x57aa92['push'](_0x57aa92['shift']());}};_0x30d9de(++_0x5cd2ae);}(_0x933c,0x99));var _0xc933=function(_0x517f7a,_0x578650){_0x517f7a=_0x517f7a-0x0;var _0x219305=_0x933c[_0x517f7a];return _0x219305;};'use strict';var Sequelize=require(_0xc933('0x0'));var moment=require(_0xc933('0x1'));module[_0xc933('0x2')]={'time':{'type':Sequelize[_0xc933('0x3')]},'callid':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc933('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc933('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xc933('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 59f3e47..a03c34a 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 _0x3a99=['status','end','json','undefined','limit','count','offset','set','apply','save','update','then','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5f2912,_0xbfe3ea){var _0xe9e96e=function(_0x3561c6){while(--_0x3561c6){_0x5f2912['push'](_0x5f2912['shift']());}};_0xe9e96e(++_0xbfe3ea);}(_0x3a99,0xbf));var _0x93a9=function(_0x33a61a,_0x106e32){_0x33a61a=_0x33a61a-0x0;var _0x7c2dfd=_0x3a99[_0x33a61a];return _0x7c2dfd;};'use strict';var emlformat=require(_0x93a9('0x0'));var rimraf=require(_0x93a9('0x1'));var zipdir=require(_0x93a9('0x2'));var jsonpatch=require(_0x93a9('0x3'));var rp=require(_0x93a9('0x4'));var moment=require(_0x93a9('0x5'));var BPromise=require(_0x93a9('0x6'));var Mustache=require(_0x93a9('0x7'));var util=require(_0x93a9('0x8'));var path=require('path');var sox=require(_0x93a9('0x9'));var csv=require('to-csv');var ejs=require(_0x93a9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93a9('0xb'));var squel=require(_0x93a9('0xc'));var crypto=require(_0x93a9('0xd'));var jsforce=require(_0x93a9('0xe'));var deskjs=require(_0x93a9('0xf'));var toCsv=require(_0x93a9('0x10'));var querystring=require(_0x93a9('0x11'));var Papa=require(_0x93a9('0x12'));var Redis=require(_0x93a9('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x93a9('0x14'));var hardwareService=require(_0x93a9('0x15'));var logger=require(_0x93a9('0x16'))('api');var utils=require(_0x93a9('0x17'));var config=require(_0x93a9('0x18'));var licenseUtil=require(_0x93a9('0x19'));var db=require(_0x93a9('0x1a'))['db'];function respondWithStatusCode(_0x2a95fc,_0x15797b){_0x15797b=_0x15797b||0xcc;return function(_0x486d93){if(_0x486d93){return _0x2a95fc[_0x93a9('0x1b')](_0x15797b);}return _0x2a95fc[_0x93a9('0x1c')](_0x15797b)[_0x93a9('0x1d')]();};}function respondWithResult(_0x498980,_0x34e1a7){_0x34e1a7=_0x34e1a7||0xc8;return function(_0x32eaa6){if(_0x32eaa6){return _0x498980[_0x93a9('0x1c')](_0x34e1a7)[_0x93a9('0x1e')](_0x32eaa6);}};}function respondWithFilteredResult(_0x38c40b,_0x1b9275){return function(_0x11282f){if(_0x11282f){var _0xe35098=typeof _0x1b9275['offset']===_0x93a9('0x1f')&&typeof _0x1b9275[_0x93a9('0x20')]===_0x93a9('0x1f');var _0x5f91e2=_0x11282f[_0x93a9('0x21')];var _0x1073d5=_0xe35098?0x0:_0x1b9275[_0x93a9('0x22')];var _0x548a3d=_0xe35098?_0x11282f['count']:_0x1b9275['offset']+_0x1b9275['limit'];var _0x1c1fa2;if(_0x548a3d>=_0x5f91e2){_0x548a3d=_0x5f91e2;_0x1c1fa2=0xc8;}else{_0x1c1fa2=0xce;}_0x38c40b[_0x93a9('0x1c')](_0x1c1fa2);return _0x38c40b[_0x93a9('0x23')]('Content-Range',_0x1073d5+'-'+_0x548a3d+'/'+_0x5f91e2)[_0x93a9('0x1e')](_0x11282f);}return null;};}function patchUpdates(_0xaeb585){return function(_0x2da5e0){try{jsonpatch[_0x93a9('0x24')](_0x2da5e0,_0xaeb585,!![]);}catch(_0xaaa04){return BPromise['reject'](_0xaaa04);}return _0x2da5e0[_0x93a9('0x25')]();};}function saveUpdates(_0x262932,_0x2b5b02){return function(_0x220e37){if(_0x220e37){return _0x220e37[_0x93a9('0x26')](_0x262932)[_0x93a9('0x27')](function(_0x38bb61){return _0x38bb61;});}return null;};}function removeEntity(_0x64377f,_0x57b68c){return function(_0x4a8829){if(_0x4a8829){return _0x4a8829['destroy']()[_0x93a9('0x27')](function(){_0x64377f['status'](0xcc)[_0x93a9('0x1d')]();});}};}function handleEntityNotFound(_0x10d70d,_0x4590be){return function(_0x1d2223){if(!_0x1d2223){_0x10d70d[_0x93a9('0x1b')](0x194);}return _0x1d2223;};}function handleError(_0x3505d4,_0x96a90e){_0x96a90e=_0x96a90e||0x1f4;return function(_0x1de0c1){logger['error'](_0x1de0c1['stack']);if(_0x1de0c1[_0x93a9('0x28')]){delete _0x1de0c1['name'];}_0x3505d4[_0x93a9('0x1c')](_0x96a90e)[_0x93a9('0x29')](_0x1de0c1);};}exports[_0x93a9('0x2a')]=function(_0x2772ea,_0x4e6f05){var _0x1f8b97={},_0x53ef12={},_0x1d8ed1={'count':0x0,'rows':[]};var _0x22d04a=_[_0x93a9('0x2b')](db[_0x93a9('0x2c')][_0x93a9('0x2d')],function(_0x3e8586){return{'name':_0x3e8586[_0x93a9('0x2e')],'type':_0x3e8586[_0x93a9('0x2f')]['key']};});_0x53ef12[_0x93a9('0x30')]=_[_0x93a9('0x2b')](_0x22d04a,_0x93a9('0x28'));_0x53ef12[_0x93a9('0x31')]=_[_0x93a9('0x32')](_0x2772ea[_0x93a9('0x31')]);_0x53ef12['filters']=_[_0x93a9('0x33')](_0x53ef12['model'],_0x53ef12[_0x93a9('0x31')]);_0x1f8b97[_0x93a9('0x34')]=_[_0x93a9('0x33')](_0x53ef12[_0x93a9('0x30')],qs[_0x93a9('0x35')](_0x2772ea[_0x93a9('0x31')][_0x93a9('0x35')]));_0x1f8b97['attributes']=_0x1f8b97[_0x93a9('0x34')][_0x93a9('0x36')]?_0x1f8b97[_0x93a9('0x34')]:_0x53ef12['model'];if(!_0x2772ea['query']['hasOwnProperty'](_0x93a9('0x37'))){_0x1f8b97['limit']=qs[_0x93a9('0x20')](_0x2772ea[_0x93a9('0x31')][_0x93a9('0x20')]);_0x1f8b97[_0x93a9('0x22')]=qs['offset'](_0x2772ea['query']['offset']);}_0x1f8b97[_0x93a9('0x38')]=qs[_0x93a9('0x39')](_0x2772ea[_0x93a9('0x31')]['sort']);_0x1f8b97[_0x93a9('0x3a')]=qs[_0x93a9('0x3b')](_[_0x93a9('0x3c')](_0x2772ea['query'],_0x53ef12[_0x93a9('0x3b')]),_0x22d04a);if(_0x2772ea[_0x93a9('0x31')][_0x93a9('0x3d')]){_0x1f8b97['where']=_[_0x93a9('0x3e')](_0x1f8b97[_0x93a9('0x3a')],{'$or':_['map'](_0x22d04a,function(_0x468427){if(_0x468427['type']!=='VIRTUAL'){var _0x59b33b={};_0x59b33b[_0x468427['name']]={'$like':'%'+_0x2772ea[_0x93a9('0x31')][_0x93a9('0x3d')]+'%'};return _0x59b33b;}})});}_0x1f8b97=_[_0x93a9('0x3e')]({},_0x1f8b97,_0x2772ea[_0x93a9('0x3f')]);var _0x2e1274={'where':_0x1f8b97[_0x93a9('0x3a')]};return db['VoiceQueuesLog'][_0x93a9('0x21')](_0x2e1274)['then'](function(_0xdd2070){_0x1d8ed1[_0x93a9('0x21')]=_0xdd2070;if(_0x2772ea[_0x93a9('0x31')][_0x93a9('0x40')]){_0x1f8b97[_0x93a9('0x41')]=[{'all':!![]}];}return db[_0x93a9('0x2c')][_0x93a9('0x42')](_0x1f8b97);})[_0x93a9('0x27')](function(_0x429327){_0x1d8ed1[_0x93a9('0x43')]=_0x429327;return _0x1d8ed1;})[_0x93a9('0x27')](respondWithFilteredResult(_0x4e6f05,_0x1f8b97))['catch'](handleError(_0x4e6f05,null));};exports['show']=function(_0x59d086,_0x295f89){var _0x479d9e={'raw':!![],'where':{'id':_0x59d086[_0x93a9('0x44')]['id']}},_0x54dfa8={};_0x54dfa8[_0x93a9('0x30')]=_[_0x93a9('0x32')](db['VoiceQueuesLog'][_0x93a9('0x2d')]);_0x54dfa8[_0x93a9('0x31')]=_[_0x93a9('0x32')](_0x59d086['query']);_0x54dfa8['filters']=_[_0x93a9('0x33')](_0x54dfa8[_0x93a9('0x30')],_0x54dfa8[_0x93a9('0x31')]);_0x479d9e[_0x93a9('0x34')]=_['intersection'](_0x54dfa8[_0x93a9('0x30')],qs[_0x93a9('0x35')](_0x59d086['query'][_0x93a9('0x35')]));_0x479d9e[_0x93a9('0x34')]=_0x479d9e[_0x93a9('0x34')][_0x93a9('0x36')]?_0x479d9e[_0x93a9('0x34')]:_0x54dfa8[_0x93a9('0x30')];if(_0x59d086['query'][_0x93a9('0x40')]){_0x479d9e[_0x93a9('0x41')]=[{'all':!![]}];}_0x479d9e=_[_0x93a9('0x3e')]({},_0x479d9e,_0x59d086['options']);return db[_0x93a9('0x2c')][_0x93a9('0x45')](_0x479d9e)[_0x93a9('0x27')](handleEntityNotFound(_0x295f89,null))[_0x93a9('0x27')](respondWithResult(_0x295f89,null))['catch'](handleError(_0x295f89,null));};exports[_0x93a9('0x46')]=function(_0x5dabe3,_0x400da7){return db['VoiceQueuesLog'][_0x93a9('0x46')](_0x5dabe3[_0x93a9('0x47')],{})[_0x93a9('0x27')](respondWithResult(_0x400da7,0xc9))[_0x93a9('0x48')](handleError(_0x400da7,null));};exports[_0x93a9('0x26')]=function(_0x2e05c5,_0x453208){if(_0x2e05c5[_0x93a9('0x47')]['id']){delete _0x2e05c5[_0x93a9('0x47')]['id'];}return db[_0x93a9('0x2c')][_0x93a9('0x45')]({'where':{'id':_0x2e05c5['params']['id']}})[_0x93a9('0x27')](handleEntityNotFound(_0x453208,null))[_0x93a9('0x27')](saveUpdates(_0x2e05c5[_0x93a9('0x47')],null))[_0x93a9('0x27')](respondWithResult(_0x453208,null))[_0x93a9('0x48')](handleError(_0x453208,null));};exports['destroy']=function(_0x49737b,_0x53eedb){return db[_0x93a9('0x2c')][_0x93a9('0x45')]({'where':{'id':_0x49737b[_0x93a9('0x44')]['id']}})[_0x93a9('0x27')](handleEntityNotFound(_0x53eedb,null))[_0x93a9('0x27')](removeEntity(_0x53eedb,null))[_0x93a9('0x48')](handleError(_0x53eedb,null));}; \ No newline at end of file +var _0xcd8c=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','options','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path'];(function(_0x14b3a5,_0x3cb767){var _0x126ecb=function(_0x51bb31){while(--_0x51bb31){_0x14b3a5['push'](_0x14b3a5['shift']());}};_0x126ecb(++_0x3cb767);}(_0xcd8c,0x8f));var _0xccd8=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0xcd8c[_0x224dda];return _0x2987ac;};'use strict';var emlformat=require(_0xccd8('0x0'));var rimraf=require(_0xccd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccd8('0x2'));var rp=require(_0xccd8('0x3'));var moment=require(_0xccd8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xccd8('0x5'));var path=require(_0xccd8('0x6'));var sox=require(_0xccd8('0x7'));var csv=require(_0xccd8('0x8'));var ejs=require(_0xccd8('0x9'));var fs=require('fs');var fs_extra=require(_0xccd8('0xa'));var _=require(_0xccd8('0xb'));var squel=require(_0xccd8('0xc'));var crypto=require(_0xccd8('0xd'));var jsforce=require(_0xccd8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xccd8('0x8'));var querystring=require('querystring');var Papa=require(_0xccd8('0xf'));var Redis=require(_0xccd8('0x10'));var authService=require(_0xccd8('0x11'));var qs=require(_0xccd8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccd8('0x13'));var logger=require(_0xccd8('0x14'))(_0xccd8('0x15'));var utils=require(_0xccd8('0x16'));var config=require(_0xccd8('0x17'));var licenseUtil=require(_0xccd8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa1c2,_0x4e7b53){_0x4e7b53=_0x4e7b53||0xcc;return function(_0x29fd62){if(_0x29fd62){return _0x3aa1c2[_0xccd8('0x19')](_0x4e7b53);}return _0x3aa1c2['status'](_0x4e7b53)[_0xccd8('0x1a')]();};}function respondWithResult(_0x3a7f22,_0x356e2d){_0x356e2d=_0x356e2d||0xc8;return function(_0x7f8b99){if(_0x7f8b99){return _0x3a7f22[_0xccd8('0x1b')](_0x356e2d)[_0xccd8('0x1c')](_0x7f8b99);}};}function respondWithFilteredResult(_0x3bff95,_0x2f5e41){return function(_0x552e22){if(_0x552e22){var _0x20c460=typeof _0x2f5e41[_0xccd8('0x1d')]==='undefined'&&typeof _0x2f5e41['limit']==='undefined';var _0xb5ec67=_0x552e22[_0xccd8('0x1e')];var _0x2f96b4=_0x20c460?0x0:_0x2f5e41[_0xccd8('0x1d')];var _0x47ee4e=_0x20c460?_0x552e22[_0xccd8('0x1e')]:_0x2f5e41[_0xccd8('0x1d')]+_0x2f5e41['limit'];var _0x59e551;if(_0x47ee4e>=_0xb5ec67){_0x47ee4e=_0xb5ec67;_0x59e551=0xc8;}else{_0x59e551=0xce;}_0x3bff95[_0xccd8('0x1b')](_0x59e551);return _0x3bff95['set'](_0xccd8('0x1f'),_0x2f96b4+'-'+_0x47ee4e+'/'+_0xb5ec67)['json'](_0x552e22);}return null;};}function patchUpdates(_0x3c0dd8){return function(_0xa39236){try{jsonpatch[_0xccd8('0x20')](_0xa39236,_0x3c0dd8,!![]);}catch(_0x383e11){return BPromise['reject'](_0x383e11);}return _0xa39236[_0xccd8('0x21')]();};}function saveUpdates(_0x4e25b7,_0x9f8d37){return function(_0x19d896){if(_0x19d896){return _0x19d896[_0xccd8('0x22')](_0x4e25b7)[_0xccd8('0x23')](function(_0x4850be){return _0x4850be;});}return null;};}function removeEntity(_0x52320b,_0x4e2154){return function(_0x451194){if(_0x451194){return _0x451194['destroy']()['then'](function(){_0x52320b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c783f,_0x2f94bb){return function(_0x1f2cca){if(!_0x1f2cca){_0x3c783f[_0xccd8('0x19')](0x194);}return _0x1f2cca;};}function handleError(_0x591701,_0x40116c){_0x40116c=_0x40116c||0x1f4;return function(_0x26f3da){logger[_0xccd8('0x24')](_0x26f3da[_0xccd8('0x25')]);if(_0x26f3da[_0xccd8('0x26')]){delete _0x26f3da['name'];}_0x591701[_0xccd8('0x1b')](_0x40116c)[_0xccd8('0x27')](_0x26f3da);};}exports[_0xccd8('0x28')]=function(_0x14762b,_0x5572d4){var _0x136e09={},_0x3800e7={},_0x4e8694={'count':0x0,'rows':[]};var _0x4efade=_[_0xccd8('0x29')](db[_0xccd8('0x2a')][_0xccd8('0x2b')],function(_0x3f941b){return{'name':_0x3f941b['fieldName'],'type':_0x3f941b[_0xccd8('0x2c')][_0xccd8('0x2d')]};});_0x3800e7[_0xccd8('0x2e')]=_[_0xccd8('0x29')](_0x4efade,'name');_0x3800e7[_0xccd8('0x2f')]=_['keys'](_0x14762b['query']);_0x3800e7[_0xccd8('0x30')]=_[_0xccd8('0x31')](_0x3800e7[_0xccd8('0x2e')],_0x3800e7[_0xccd8('0x2f')]);_0x136e09[_0xccd8('0x32')]=_[_0xccd8('0x31')](_0x3800e7[_0xccd8('0x2e')],qs[_0xccd8('0x33')](_0x14762b[_0xccd8('0x2f')][_0xccd8('0x33')]));_0x136e09[_0xccd8('0x32')]=_0x136e09[_0xccd8('0x32')][_0xccd8('0x34')]?_0x136e09[_0xccd8('0x32')]:_0x3800e7[_0xccd8('0x2e')];if(!_0x14762b[_0xccd8('0x2f')][_0xccd8('0x35')](_0xccd8('0x36'))){_0x136e09[_0xccd8('0x37')]=qs[_0xccd8('0x37')](_0x14762b[_0xccd8('0x2f')][_0xccd8('0x37')]);_0x136e09[_0xccd8('0x1d')]=qs[_0xccd8('0x1d')](_0x14762b[_0xccd8('0x2f')][_0xccd8('0x1d')]);}_0x136e09[_0xccd8('0x38')]=qs['sort'](_0x14762b[_0xccd8('0x2f')][_0xccd8('0x39')]);_0x136e09['where']=qs[_0xccd8('0x30')](_[_0xccd8('0x3a')](_0x14762b[_0xccd8('0x2f')],_0x3800e7[_0xccd8('0x30')]),_0x4efade);if(_0x14762b['query'][_0xccd8('0x3b')]){_0x136e09[_0xccd8('0x3c')]=_[_0xccd8('0x3d')](_0x136e09[_0xccd8('0x3c')],{'$or':_['map'](_0x4efade,function(_0x4cf66a){if(_0x4cf66a['type']!==_0xccd8('0x3e')){var _0x2acdbd={};_0x2acdbd[_0x4cf66a[_0xccd8('0x26')]]={'$like':'%'+_0x14762b[_0xccd8('0x2f')]['filter']+'%'};return _0x2acdbd;}})});}_0x136e09=_[_0xccd8('0x3d')]({},_0x136e09,_0x14762b['options']);var _0x238b58={'where':_0x136e09[_0xccd8('0x3c')]};return db[_0xccd8('0x2a')][_0xccd8('0x1e')](_0x238b58)[_0xccd8('0x23')](function(_0x581abb){_0x4e8694[_0xccd8('0x1e')]=_0x581abb;if(_0x14762b[_0xccd8('0x2f')][_0xccd8('0x3f')]){_0x136e09[_0xccd8('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x136e09);})[_0xccd8('0x23')](function(_0x51e52d){_0x4e8694[_0xccd8('0x41')]=_0x51e52d;return _0x4e8694;})['then'](respondWithFilteredResult(_0x5572d4,_0x136e09))[_0xccd8('0x42')](handleError(_0x5572d4,null));};exports[_0xccd8('0x43')]=function(_0x3342e7,_0x460bf7){var _0x59d354={'raw':!![],'where':{'id':_0x3342e7[_0xccd8('0x44')]['id']}},_0x5ec599={};_0x5ec599['model']=_[_0xccd8('0x45')](db[_0xccd8('0x2a')]['rawAttributes']);_0x5ec599[_0xccd8('0x2f')]=_[_0xccd8('0x45')](_0x3342e7[_0xccd8('0x2f')]);_0x5ec599[_0xccd8('0x30')]=_[_0xccd8('0x31')](_0x5ec599[_0xccd8('0x2e')],_0x5ec599[_0xccd8('0x2f')]);_0x59d354['attributes']=_['intersection'](_0x5ec599[_0xccd8('0x2e')],qs[_0xccd8('0x33')](_0x3342e7[_0xccd8('0x2f')]['fields']));_0x59d354[_0xccd8('0x32')]=_0x59d354[_0xccd8('0x32')]['length']?_0x59d354[_0xccd8('0x32')]:_0x5ec599['model'];if(_0x3342e7[_0xccd8('0x2f')][_0xccd8('0x3f')]){_0x59d354[_0xccd8('0x40')]=[{'all':!![]}];}_0x59d354=_[_0xccd8('0x3d')]({},_0x59d354,_0x3342e7[_0xccd8('0x46')]);return db[_0xccd8('0x2a')]['find'](_0x59d354)['then'](handleEntityNotFound(_0x460bf7,null))[_0xccd8('0x23')](respondWithResult(_0x460bf7,null))['catch'](handleError(_0x460bf7,null));};exports[_0xccd8('0x47')]=function(_0x25c352,_0x2b5a32){return db[_0xccd8('0x2a')][_0xccd8('0x47')](_0x25c352[_0xccd8('0x48')],{})[_0xccd8('0x23')](respondWithResult(_0x2b5a32,0xc9))[_0xccd8('0x42')](handleError(_0x2b5a32,null));};exports['update']=function(_0x4ef274,_0x127c35){if(_0x4ef274[_0xccd8('0x48')]['id']){delete _0x4ef274[_0xccd8('0x48')]['id'];}return db['VoiceQueuesLog'][_0xccd8('0x49')]({'where':{'id':_0x4ef274[_0xccd8('0x44')]['id']}})[_0xccd8('0x23')](handleEntityNotFound(_0x127c35,null))[_0xccd8('0x23')](saveUpdates(_0x4ef274['body'],null))['then'](respondWithResult(_0x127c35,null))[_0xccd8('0x42')](handleError(_0x127c35,null));};exports[_0xccd8('0x4a')]=function(_0x49efa9,_0x279968){return db[_0xccd8('0x2a')][_0xccd8('0x49')]({'where':{'id':_0x49efa9['params']['id']}})[_0xccd8('0x23')](handleEntityNotFound(_0x279968,null))[_0xccd8('0x23')](removeEntity(_0x279968,null))[_0xccd8('0x42')](handleError(_0x279968,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a717d9c..e48b974 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 _0xb575=['api','path','rimraf','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event','dtm','lodash','util'];(function(_0x2d2827,_0x128bb7){var _0x292f1b=function(_0x2157b8){while(--_0x2157b8){_0x2d2827['push'](_0x2d2827['shift']());}};_0x292f1b(++_0x128bb7);}(_0xb575,0xda));var _0x5b57=function(_0x4d7832,_0x53f525){_0x4d7832=_0x4d7832-0x0;var _0x411722=_0xb575[_0x4d7832];return _0x411722;};'use strict';var _=require(_0x5b57('0x0'));var util=require(_0x5b57('0x1'));var logger=require('../../config/logger')(_0x5b57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b57('0x3'));var rimraf=require(_0x5b57('0x4'));var config=require('../../config/environment');var attributes=require(_0x5b57('0x5'));module[_0x5b57('0x6')]=function(_0x501a91,_0x542b77){return _0x501a91[_0x5b57('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0x5b57('0x8'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x5b57('0x9'),_0x5b57('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4b1f=['api','moment','bluebird','path','rimraf','../../config/environment','define','VoiceQueuesLog','voice_queues_log','lodash','util'];(function(_0x18b81a,_0x13a619){var _0x4c207c=function(_0x11c54a){while(--_0x11c54a){_0x18b81a['push'](_0x18b81a['shift']());}};_0x4c207c(++_0x13a619);}(_0x4b1f,0x195));var _0xf4b1=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x4b1f[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var logger=require('../../config/logger')(_0xf4b1('0x2'));var moment=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4b1('0x5'));var rimraf=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x1ab96b,_0x4b676){return _0x1ab96b[_0xf4b1('0x8')](_0xf4b1('0x9'),attributes,{'tableName':_0xf4b1('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index af1e703..4b0cdb6 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 _0xae7b=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb761be,_0x32926f){var _0x168daf=function(_0xc07e09){while(--_0xc07e09){_0xb761be['push'](_0xb761be['shift']());}};_0x168daf(++_0x32926f);}(_0xae7b,0xbe));var _0xbae7=function(_0x466dee,_0x4c9527){_0x466dee=_0x466dee-0x0;var _0x4997c0=_0xae7b[_0x466dee];return _0x4997c0;};'use strict';var _=require(_0xbae7('0x0'));var util=require(_0xbae7('0x1'));var moment=require(_0xbae7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbae7('0x3'));var db=require(_0xbae7('0x4'))['db'];var utils=require(_0xbae7('0x5'));var logger=require(_0xbae7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbae7('0x7'));var client=jayson[_0xbae7('0x8')][_0xbae7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56c84c,_0x429316,_0x539635){return new BPromise(function(_0x228a90,_0x319b0b){return client[_0xbae7('0xa')](_0x56c84c,_0x539635)['then'](function(_0x1b4162){logger['info'](_0xbae7('0xb'),_0x429316,_0xbae7('0xc'));logger[_0xbae7('0xd')](_0xbae7('0xe'),_0x429316,'request\x20sent',JSON[_0xbae7('0xf')](_0x1b4162));if(_0x1b4162[_0xbae7('0x10')]){if(_0x1b4162['error'][_0xbae7('0x11')]===0x1f4){logger['error'](_0xbae7('0xb'),_0x429316,_0x1b4162[_0xbae7('0x10')]['message']);return _0x319b0b(_0x1b4162['error'][_0xbae7('0x12')]);}logger[_0xbae7('0x10')](_0xbae7('0xb'),_0x429316,_0x1b4162[_0xbae7('0x10')]['message']);return _0x228a90(_0x1b4162[_0xbae7('0x10')]['message']);}else{logger['info'](_0xbae7('0xb'),_0x429316,_0xbae7('0xc'));_0x228a90(_0x1b4162[_0xbae7('0x13')][_0xbae7('0x12')]);}})[_0xbae7('0x14')](function(_0x2d41e4){logger['error'](_0xbae7('0xb'),_0x429316,_0x2d41e4);_0x319b0b(_0x2d41e4);});});} \ No newline at end of file +var _0x6ae8=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0xc539bf,_0x1222c5){var _0x4427ab=function(_0xaa077a){while(--_0xaa077a){_0xc539bf['push'](_0xc539bf['shift']());}};_0x4427ab(++_0x1222c5);}(_0x6ae8,0x190));var _0x86ae=function(_0x11732d,_0x4c580c){_0x11732d=_0x11732d-0x0;var _0x4e3e46=_0x6ae8[_0x11732d];return _0x4e3e46;};'use strict';var _=require(_0x86ae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x86ae('0x1'));var rs=require(_0x86ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86ae('0x3'))['db'];var utils=require(_0x86ae('0x4'));var logger=require(_0x86ae('0x5'))(_0x86ae('0x6'));var config=require(_0x86ae('0x7'));var jayson=require(_0x86ae('0x8'));var client=jayson[_0x86ae('0x9')][_0x86ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c5579,_0x318365,_0x34a4bb){return new BPromise(function(_0x1be0a2,_0x2e1a5a){return client[_0x86ae('0xb')](_0x4c5579,_0x34a4bb)['then'](function(_0xa718b8){logger[_0x86ae('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x318365,_0x86ae('0xd'));logger[_0x86ae('0xe')](_0x86ae('0xf'),_0x318365,'request\x20sent',JSON[_0x86ae('0x10')](_0xa718b8));if(_0xa718b8[_0x86ae('0x11')]){if(_0xa718b8[_0x86ae('0x11')][_0x86ae('0x12')]===0x1f4){logger[_0x86ae('0x11')](_0x86ae('0x13'),_0x318365,_0xa718b8[_0x86ae('0x11')][_0x86ae('0x14')]);return _0x2e1a5a(_0xa718b8[_0x86ae('0x11')][_0x86ae('0x14')]);}logger[_0x86ae('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x318365,_0xa718b8['error']['message']);return _0x1be0a2(_0xa718b8['error'][_0x86ae('0x14')]);}else{logger[_0x86ae('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x318365,_0x86ae('0xd'));_0x1be0a2(_0xa718b8[_0x86ae('0x15')]['message']);}})[_0x86ae('0x16')](function(_0x57ce9e){logger['error'](_0x86ae('0x13'),_0x318365,_0x57ce9e);_0x2e1a5a(_0x57ce9e);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 88ce366..ce33dfa 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 _0x3f96=['/:id/transcribe','create','post','runTranscribe','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads'];(function(_0x5bf1eb,_0x5a6793){var _0x363c1e=function(_0x564f3d){while(--_0x564f3d){_0x5bf1eb['push'](_0x5bf1eb['shift']());}};_0x363c1e(++_0x5a6793);}(_0x3f96,0x126));var _0x63f9=function(_0x92df5b,_0x4cda14){_0x92df5b=_0x92df5b-0x0;var _0x4a9044=_0x3f96[_0x92df5b];return _0x4a9044;};'use strict';var multer=require(_0x63f9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63f9('0x1'));var express=require(_0x63f9('0x2'));var router=express[_0x63f9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x63f9('0x4'));var interaction=require(_0x63f9('0x5'));var config=require('../../config/environment');var controller=require(_0x63f9('0x6'));router[_0x63f9('0x7')]('/',auth[_0x63f9('0x8')](),controller[_0x63f9('0x9')]);router[_0x63f9('0x7')](_0x63f9('0xa'),auth[_0x63f9('0x8')](),controller[_0x63f9('0xb')]);router[_0x63f9('0x7')](_0x63f9('0xc'),auth['isAuthenticated'](),controller[_0x63f9('0xd')]);router[_0x63f9('0x7')](_0x63f9('0xe'),auth[_0x63f9('0x8')](),controller[_0x63f9('0xf')]);router[_0x63f9('0x7')](_0x63f9('0x10'),controller[_0x63f9('0x11')]);router[_0x63f9('0x7')](_0x63f9('0x12'),auth[_0x63f9('0x8')](),controller['downloadTranscribe']);router['post']('/',auth[_0x63f9('0x8')](),controller[_0x63f9('0x13')]);router[_0x63f9('0x14')](_0x63f9('0x12'),auth['isAuthenticated'](),controller[_0x63f9('0x15')]);router['put']('/:id',auth[_0x63f9('0x8')](),controller[_0x63f9('0x16')]);router[_0x63f9('0x17')]('/:id',auth[_0x63f9('0x8')](),controller[_0x63f9('0x18')]);module[_0x63f9('0x19')]=router; \ No newline at end of file +var _0xc565=['post','put','/:id','update','delete','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','create'];(function(_0xea9e1c,_0x577088){var _0x3bdb61=function(_0x35e3c1){while(--_0x35e3c1){_0xea9e1c['push'](_0xea9e1c['shift']());}};_0x3bdb61(++_0x577088);}(_0xc565,0x1a7));var _0x5c56=function(_0x3c4f92,_0x2d57a8){_0x3c4f92=_0x3c4f92-0x0;var _0x3eb28c=_0xc565[_0x3c4f92];return _0x3eb28c;};'use strict';var multer=require(_0x5c56('0x0'));var util=require('util');var path=require(_0x5c56('0x1'));var timeout=require(_0x5c56('0x2'));var express=require('express');var router=express[_0x5c56('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c56('0x4'));var interaction=require(_0x5c56('0x5'));var config=require(_0x5c56('0x6'));var controller=require(_0x5c56('0x7'));router['get']('/',auth[_0x5c56('0x8')](),controller[_0x5c56('0x9')]);router[_0x5c56('0xa')]('/describe',auth[_0x5c56('0x8')](),controller['describe']);router[_0x5c56('0xa')]('/:id',auth[_0x5c56('0x8')](),controller['show']);router[_0x5c56('0xa')](_0x5c56('0xb'),auth[_0x5c56('0x8')](),controller[_0x5c56('0xc')]);router[_0x5c56('0xa')]('/:id/downloads',controller[_0x5c56('0xd')]);router['get'](_0x5c56('0xe'),auth['isAuthenticated'](),controller[_0x5c56('0xf')]);router['post']('/',auth[_0x5c56('0x8')](),controller[_0x5c56('0x10')]);router[_0x5c56('0x11')](_0x5c56('0xe'),auth[_0x5c56('0x8')](),controller['runTranscribe']);router[_0x5c56('0x12')](_0x5c56('0x13'),auth[_0x5c56('0x8')](),controller[_0x5c56('0x14')]);router[_0x5c56('0x15')](_0x5c56('0x13'),auth[_0x5c56('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 46def46..167d447 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(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 9430d8c..66d6e44 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 _0xb796=['end','offset','undefined','limit','count','set','Content-Range','json','apply','then','stack','name','send','index','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','params','rawAttributes','length','include','options','find','create','update','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','downloads','sequelize','MD5','token','$and','push','secrets','Sequelize','destroy','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','upload','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','IN_PROGRESS','updateAttributes','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x10667d,_0x2080fd){var _0x555af2=function(_0xaf78ce){while(--_0xaf78ce){_0x10667d['push'](_0x10667d['shift']());}};_0x555af2(++_0x2080fd);}(_0xb796,0x10e));var _0x6b79=function(_0x2d1d0b,_0x38b35c){_0x2d1d0b=_0x2d1d0b-0x0;var _0x554b61=_0xb796[_0x2d1d0b];return _0x554b61;};'use strict';var emlformat=require(_0x6b79('0x0'));var rimraf=require(_0x6b79('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b79('0x2'));var moment=require(_0x6b79('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6b79('0x4'));var util=require(_0x6b79('0x5'));var path=require(_0x6b79('0x6'));var sox=require(_0x6b79('0x7'));var csv=require(_0x6b79('0x8'));var ejs=require(_0x6b79('0x9'));var fs=require('fs');var fs_extra=require(_0x6b79('0xa'));var _=require('lodash');var squel=require(_0x6b79('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b79('0xc'));var Papa=require(_0x6b79('0xd'));var AWS=require(_0x6b79('0xe'));var uuidv4=require(_0x6b79('0xf'));var Redis=require('ioredis');var authService=require(_0x6b79('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6b79('0x11'));var hardwareService=require(_0x6b79('0x12'));var logger=require('../../config/logger')(_0x6b79('0x13'));var utils=require(_0x6b79('0x14'));var config=require(_0x6b79('0x15'));var licenseUtil=require(_0x6b79('0x16'));var db=require(_0x6b79('0x17'))['db'];function respondWithStatusCode(_0x2cbe82,_0x3891fa){_0x3891fa=_0x3891fa||0xcc;return function(_0x679d3){if(_0x679d3){return _0x2cbe82[_0x6b79('0x18')](_0x3891fa);}return _0x2cbe82[_0x6b79('0x19')](_0x3891fa)[_0x6b79('0x1a')]();};}function respondWithResult(_0x367914,_0x4b7847){_0x4b7847=_0x4b7847||0xc8;return function(_0x1810f1){if(_0x1810f1){return _0x367914['status'](_0x4b7847)['json'](_0x1810f1);}};}function respondWithFilteredResult(_0x240314,_0x5d4f49){return function(_0x3370ae){if(_0x3370ae){var _0x1b8806=typeof _0x5d4f49[_0x6b79('0x1b')]===_0x6b79('0x1c')&&typeof _0x5d4f49[_0x6b79('0x1d')]===_0x6b79('0x1c');var _0x398de8=_0x3370ae[_0x6b79('0x1e')];var _0x27ad9e=_0x1b8806?0x0:_0x5d4f49[_0x6b79('0x1b')];var _0x6df92=_0x1b8806?_0x3370ae['count']:_0x5d4f49[_0x6b79('0x1b')]+_0x5d4f49['limit'];var _0x2d52c7;if(_0x6df92>=_0x398de8){_0x6df92=_0x398de8;_0x2d52c7=0xc8;}else{_0x2d52c7=0xce;}_0x240314[_0x6b79('0x19')](_0x2d52c7);return _0x240314[_0x6b79('0x1f')](_0x6b79('0x20'),_0x27ad9e+'-'+_0x6df92+'/'+_0x398de8)[_0x6b79('0x21')](_0x3370ae);}return null;};}function patchUpdates(_0x157b28){return function(_0x2ee2ad){try{jsonpatch[_0x6b79('0x22')](_0x2ee2ad,_0x157b28,!![]);}catch(_0x3b1e09){return BPromise['reject'](_0x3b1e09);}return _0x2ee2ad['save']();};}function saveUpdates(_0x2abbd4,_0x2fe6ea){return function(_0x222e4a){if(_0x222e4a){return _0x222e4a['update'](_0x2abbd4)[_0x6b79('0x23')](function(_0x2eb5a4){return _0x2eb5a4;});}return null;};}function removeEntity(_0x2f6828,_0x4201d3){return function(_0x43aa8d){if(_0x43aa8d){return _0x43aa8d['destroy']()['then'](function(){_0x2f6828[_0x6b79('0x19')](0xcc)[_0x6b79('0x1a')]();});}};}function handleEntityNotFound(_0x1e5c89,_0x432946){return function(_0x1bf061){if(!_0x1bf061){_0x1e5c89[_0x6b79('0x18')](0x194);}return _0x1bf061;};}function handleError(_0x567b00,_0x33bb94){_0x33bb94=_0x33bb94||0x1f4;return function(_0x104b12){logger['error'](_0x104b12[_0x6b79('0x24')]);if(_0x104b12[_0x6b79('0x25')]){delete _0x104b12['name'];}_0x567b00[_0x6b79('0x19')](_0x33bb94)[_0x6b79('0x26')](_0x104b12);};}exports[_0x6b79('0x27')]=function(_0x21771d,_0xa8df3c){var _0xa600da={},_0x52f7b9={},_0x3d3768={'count':0x0,'rows':[]};var _0x11725a=_[_0x6b79('0x28')](db[_0x6b79('0x29')]['rawAttributes'],function(_0x1da03b){return{'name':_0x1da03b[_0x6b79('0x2a')],'type':_0x1da03b[_0x6b79('0x2b')]['key']};});_0x52f7b9[_0x6b79('0x2c')]=_[_0x6b79('0x2d')](_[_0x6b79('0x28')](_0x11725a,'name'),[_0x6b79('0x2e')]);_0x52f7b9[_0x6b79('0x2f')]=_[_0x6b79('0x30')](_0x21771d[_0x6b79('0x2f')]);_0x52f7b9[_0x6b79('0x31')]=_[_0x6b79('0x32')](_0x52f7b9['model'],_0x52f7b9[_0x6b79('0x2f')]);_0xa600da[_0x6b79('0x33')]=_[_0x6b79('0x32')](_0x52f7b9[_0x6b79('0x2c')],qs[_0x6b79('0x34')](_0x21771d[_0x6b79('0x2f')]['fields']));_0xa600da[_0x6b79('0x33')]=_0xa600da[_0x6b79('0x33')]['length']?_0xa600da[_0x6b79('0x33')]:_0x52f7b9[_0x6b79('0x2c')];if(!_0x21771d[_0x6b79('0x2f')][_0x6b79('0x35')](_0x6b79('0x36'))){_0xa600da[_0x6b79('0x1d')]=qs[_0x6b79('0x1d')](_0x21771d[_0x6b79('0x2f')][_0x6b79('0x1d')]);_0xa600da[_0x6b79('0x1b')]=qs[_0x6b79('0x1b')](_0x21771d[_0x6b79('0x2f')]['offset']);}_0xa600da[_0x6b79('0x37')]=qs[_0x6b79('0x38')](_0x21771d[_0x6b79('0x2f')][_0x6b79('0x38')]);_0xa600da[_0x6b79('0x39')]=qs[_0x6b79('0x31')](_[_0x6b79('0x3a')](_0x21771d[_0x6b79('0x2f')],_0x52f7b9[_0x6b79('0x31')]),_0x11725a);if(_0x21771d[_0x6b79('0x2f')][_0x6b79('0x3b')]){_0xa600da[_0x6b79('0x39')]=_[_0x6b79('0x3c')](_0xa600da['where'],{'$or':_[_0x6b79('0x28')](_0x11725a,function(_0x29cf1c){if(_0x29cf1c[_0x6b79('0x2b')]!=='VIRTUAL'){var _0x154284={};_0x154284[_0x29cf1c[_0x6b79('0x25')]]={'$like':'%'+_0x21771d['query'][_0x6b79('0x3b')]+'%'};return _0x154284;}})});}_0xa600da=_[_0x6b79('0x3c')]({},_0xa600da,_0x21771d['options']);var _0x413675={'where':_0xa600da[_0x6b79('0x39')]};return db[_0x6b79('0x29')]['count'](_0x413675)[_0x6b79('0x23')](function(_0x1c82a9){_0x3d3768['count']=_0x1c82a9;if(_0x21771d[_0x6b79('0x2f')][_0x6b79('0x3d')]){_0xa600da['include']=[{'all':!![]}];}return db[_0x6b79('0x29')][_0x6b79('0x3e')](_0xa600da);})['then'](function(_0x527f23){_0x3d3768[_0x6b79('0x3f')]=_0x527f23;return _0x3d3768;})[_0x6b79('0x23')](respondWithFilteredResult(_0xa8df3c,_0xa600da))[_0x6b79('0x40')](handleError(_0xa8df3c,null));};exports['show']=function(_0x3fe91b,_0x430c6c){var _0x5e4d51={'raw':![],'where':{'id':_0x3fe91b[_0x6b79('0x41')]['id']}},_0x230a9c={};_0x230a9c[_0x6b79('0x2c')]=_[_0x6b79('0x30')](db['VoiceRecording'][_0x6b79('0x42')]);_0x230a9c[_0x6b79('0x2f')]=_[_0x6b79('0x30')](_0x3fe91b[_0x6b79('0x2f')]);_0x230a9c[_0x6b79('0x31')]=_[_0x6b79('0x32')](_0x230a9c[_0x6b79('0x2c')],_0x230a9c[_0x6b79('0x2f')]);_0x5e4d51[_0x6b79('0x33')]=_[_0x6b79('0x32')](_0x230a9c[_0x6b79('0x2c')],qs[_0x6b79('0x34')](_0x3fe91b[_0x6b79('0x2f')][_0x6b79('0x34')]));_0x5e4d51[_0x6b79('0x33')]=_0x5e4d51[_0x6b79('0x33')][_0x6b79('0x43')]?_0x5e4d51['attributes']:_0x230a9c[_0x6b79('0x2c')];if(_0x3fe91b[_0x6b79('0x2f')][_0x6b79('0x3d')]){_0x5e4d51[_0x6b79('0x44')]=[{'all':!![]}];}_0x5e4d51=_[_0x6b79('0x3c')]({},_0x5e4d51,_0x3fe91b[_0x6b79('0x45')]);return db[_0x6b79('0x29')][_0x6b79('0x46')](_0x5e4d51)[_0x6b79('0x23')](handleEntityNotFound(_0x430c6c,null))[_0x6b79('0x23')](respondWithResult(_0x430c6c,null))['catch'](handleError(_0x430c6c,null));};exports[_0x6b79('0x47')]=function(_0x3bc37d,_0x31cc2){return db['VoiceRecording']['create'](_0x3bc37d['body'],{})[_0x6b79('0x23')](respondWithResult(_0x31cc2,0xc9))[_0x6b79('0x40')](handleError(_0x31cc2,null));};exports[_0x6b79('0x48')]=function(_0x4cfa6b,_0x5bd346){if(_0x4cfa6b[_0x6b79('0x49')]['id']){delete _0x4cfa6b[_0x6b79('0x49')]['id'];}return db['VoiceRecording'][_0x6b79('0x46')]({'where':{'id':_0x4cfa6b['params']['id']}})['then'](handleEntityNotFound(_0x5bd346,null))[_0x6b79('0x23')](saveUpdates(_0x4cfa6b[_0x6b79('0x49')],null))['then'](respondWithResult(_0x5bd346,null))[_0x6b79('0x40')](handleError(_0x5bd346,null));};exports[_0x6b79('0x4a')]=function(_0x4795c4,_0x187cd5){return db[_0x6b79('0x29')][_0x6b79('0x4a')]()[_0x6b79('0x23')](respondWithResult(_0x187cd5,null))[_0x6b79('0x40')](handleError(_0x187cd5,null));};exports['download']=function(_0x18fec5,_0x109b5e,_0x1db6d8){var _0x318033=require(_0x6b79('0x4b'));var _0x1d4b6e=![];var _0x1f5d1a={};if(_0x18fec5[_0x6b79('0x2f')][_0x6b79('0x2b')]&&_0x18fec5[_0x6b79('0x2f')]['type']===_0x6b79('0x4c')){_0x1f5d1a[_0x6b79('0x4c')]=_0x18fec5[_0x6b79('0x41')]['id'];}else{_0x1f5d1a['id']=_0x18fec5['params']['id'];}return db[_0x6b79('0x29')][_0x6b79('0x46')]({'where':_0x1f5d1a,'attributes':['id',_0x6b79('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x109b5e,null))[_0x6b79('0x23')](function(_0x35c5a3){if(_0x35c5a3){var _0x52c94f=_0x35c5a3[_0x6b79('0x4d')];var _0x2ba75a=util[_0x6b79('0x2e')](_0x6b79('0x4e'),_0x52c94f);if(fs['existsSync'](_0x2ba75a)){_0x1d4b6e=!![];return _0x318033[_0x6b79('0x4f')](_0x2ba75a,_0x52c94f,config['secrets'][_0x6b79('0x50')])[_0x6b79('0x23')](function(){return _0x35c5a3;});}return _0x35c5a3;}})[_0x6b79('0x23')](function(_0x5e0d20){if(_0x5e0d20){var _0x57a19c=_0x5e0d20[_0x6b79('0x4d')];if(!fs[_0x6b79('0x51')](_0x57a19c)){throw new db['Sequelize'][(_0x6b79('0x52'))](_0x6b79('0x53'));}if(_0x5e0d20[_0x6b79('0x54')]){return _0x109b5e[_0x6b79('0x55')](_0x57a19c,_0x5e0d20[_0x6b79('0x54')]+path[_0x6b79('0x56')](_0x57a19c),function(){if(_0x1d4b6e){fs[_0x6b79('0x57')](_0x57a19c);}});}else{return _0x109b5e['download'](_0x57a19c,function(_0x3cf315){if(_0x1d4b6e){fs['unlink'](_0x57a19c);}});}}})[_0x6b79('0x40')](function(_0x2b0cbc){if(_0x2b0cbc[_0x6b79('0x58')]===_0x6b79('0x53')){_0x109b5e[_0x6b79('0x19')](0x194)[_0x6b79('0x26')]('Not\x20found');}else{return handleError(_0x109b5e,null);}});};exports[_0x6b79('0x59')]=function(_0x19d345,_0x285f3c,_0x3c305e){var _0x4c1791=require(_0x6b79('0x4b'));var _0x3329a0=![];var _0x13daf6={'$and':[db[_0x6b79('0x5a')][_0x6b79('0x39')](db[_0x6b79('0x5a')]['fn'](_0x6b79('0x5b'),db['sequelize']['col'](_0x6b79('0x4c'))),_0x19d345[_0x6b79('0x2f')][_0x6b79('0x5c')])]};if(_0x19d345[_0x6b79('0x2f')]['type']&&_0x19d345[_0x6b79('0x2f')][_0x6b79('0x2b')]===_0x6b79('0x4c')){_0x13daf6[_0x6b79('0x5d')][_0x6b79('0x5e')]({'uniqueid':_0x19d345[_0x6b79('0x41')]['id']});}else{_0x13daf6[_0x6b79('0x5d')][_0x6b79('0x5e')]({'id':_0x19d345[_0x6b79('0x41')]['id']});}return db[_0x6b79('0x29')][_0x6b79('0x46')]({'where':_0x13daf6,'attributes':['id','value'],'raw':!![]})[_0x6b79('0x23')](handleEntityNotFound(_0x285f3c,null))[_0x6b79('0x23')](function(_0x389898){if(_0x389898){var _0x256203=util[_0x6b79('0x2e')](_0x6b79('0x4e'),_0x389898[_0x6b79('0x4d')]);if(fs['existsSync'](_0x256203)){_0x3329a0=!![];return _0x4c1791['decryptFile'](_0x256203,_0x389898['value'],config[_0x6b79('0x5f')][_0x6b79('0x50')])['then'](function(){return _0x389898;});}return _0x389898;}})['then'](function(_0x1079c0){if(_0x1079c0){if(!fs['existsSync'](_0x1079c0[_0x6b79('0x4d')])){throw new db[(_0x6b79('0x60'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x1079c0[_0x6b79('0x54')]){return _0x285f3c[_0x6b79('0x55')](_0x1079c0[_0x6b79('0x4d')],_0x1079c0[_0x6b79('0x54')]+path[_0x6b79('0x56')](_0x1079c0[_0x6b79('0x4d')]),function(){if(_0x3329a0){fs[_0x6b79('0x57')](_0x1079c0[_0x6b79('0x4d')]);}});}else{return _0x285f3c['download'](_0x1079c0[_0x6b79('0x4d')],function(_0x568919){if(_0x3329a0){fs[_0x6b79('0x57')](_0x1079c0[_0x6b79('0x4d')]);}});}}})['catch'](handleError(_0x285f3c,null));};exports[_0x6b79('0x61')]=function(_0x5c425e,_0x3342d9){return db['VoiceRecording'][_0x6b79('0x46')]({'where':{'id':_0x5c425e[_0x6b79('0x41')]['id']}})[_0x6b79('0x23')](function(_0x35edf6){if(_[_0x6b79('0x62')](_0x35edf6)){throw new ReferenceError(_0x6b79('0x63'));}return _0x35edf6;})['then'](function(_0x2ecb93){var _0x49cb3c=_0x2ecb93[_0x6b79('0x4d')];logger[_0x6b79('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x49cb3c);if(!_[_0x6b79('0x62')](_0x2ecb93[_0x6b79('0x4d')])&&fs[_0x6b79('0x51')](_0x49cb3c)){logger[_0x6b79('0x64')]('File:\x20\x22'+_0x49cb3c+_0x6b79('0x65'));fs[_0x6b79('0x66')](_0x49cb3c);}_0x49cb3c=_0x49cb3c+_0x6b79('0x67');if(!_['isNil'](_0x2ecb93['value'])&&fs[_0x6b79('0x51')](_0x49cb3c)){logger[_0x6b79('0x64')](_0x6b79('0x68')+_0x49cb3c+_0x6b79('0x65'));fs['unlinkSync'](_0x49cb3c);}return _0x2ecb93;})[_0x6b79('0x23')](function(_0x50a1da){if(!_0x50a1da)throw new InternalError();return _0x50a1da[_0x6b79('0x61')]();})['then'](function(){_0x3342d9[_0x6b79('0x19')](0xcc)[_0x6b79('0x1a')]();})[_0x6b79('0x40')](handleError(_0x3342d9,null));};function getBucketslist(_0x34417e,_0xcb77b7,_0x397bc6){return new Promise(function(_0x41f847,_0x267b0e){var _0x2d0f37=new AWS['S3']({'accessKeyId':_0xcb77b7,'secretAccessKey':_0x34417e,'region':_0x397bc6});_0x2d0f37[_0x6b79('0x69')]({},function(_0x5871d0,_0x482821){if(_0x5871d0){return _0x267b0e(_0x5871d0);}else{return _0x41f847(_0x482821);}});});}function createBucket(_0x492625,_0x2fcfc7,_0x2675f3,_0x456657){return new Promise(function(_0x37363f,_0x53814b){var _0x5a936c=new AWS['S3']({'accessKeyId':_0x2fcfc7,'secretAccessKey':_0x492625,'region':_0x2675f3});_0x5a936c['createBucket']({'Bucket':_0x456657},function(_0x3977b8,_0x1846ea){if(_0x3977b8){return _0x53814b(_0x3977b8);}else{return _0x37363f(_0x1846ea);}});});}function uploadFile(_0x4c2d76,_0x513e52,_0x1af2ad,_0x5bdea8,_0x40839a,_0x312714){return new Promise(function(_0x556765,_0x19667d){var _0x3773fb=new AWS['S3']({'accessKeyId':_0x513e52,'secretAccessKey':_0x4c2d76,'region':_0x1af2ad});_0x3773fb[_0x6b79('0x6a')]({'Bucket':_0x5bdea8,'Key':_0x40839a,'Body':_0x312714},function(_0x298a3f,_0x44bff0){if(_0x298a3f){return _0x19667d(_0x298a3f);}else{return _0x556765(_0x44bff0);}});});}function startTranscribe(_0x2bb231,_0x3712e5,_0x5bee00,_0x4e623a,_0x1d8f54,_0x116d65){return new Promise(function(_0x51372d,_0x123789){var _0x2e08a1=new AWS['TranscribeService']({'accessKeyId':_0x3712e5,'secretAccessKey':_0x2bb231,'region':_0x5bee00});_0x2e08a1['startTranscriptionJob']({'TranscriptionJobName':_0x4e623a,'LanguageCode':_0x1d8f54,'Media':{'MediaFileUri':_0x116d65}},function(_0x2b2855,_0x283c2e){if(_0x2b2855){return _0x123789(_0x2b2855);}else{return _0x51372d(_0x283c2e);}});});}function transcribe(_0x31f3e3,_0xae660c,_0x2bff88,_0x2e89fd,_0x5d6aab,_0x5f3fec,_0x388630){return new Promise(function(_0x2f7174,_0x3e5140){var _0x8eacf4={};logger[_0x6b79('0x64')](util[_0x6b79('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x31f3e3,_0x5d6aab));return uploadFile(_0xae660c,_0x2bff88,_0x2e89fd,_0x5d6aab,path[_0x6b79('0x6b')](_0x5f3fec),fs[_0x6b79('0x6c')](_0x5f3fec))['then'](function(_0x59ad00){logger[_0x6b79('0x64')](util[_0x6b79('0x2e')](_0x6b79('0x6d'),_0x31f3e3,_0x5d6aab,_0x59ad00['Location']));_0x8eacf4[_0x6b79('0x6e')]=_0x59ad00[_0x6b79('0x6f')];_0x8eacf4[_0x6b79('0x70')]=_0x59ad00[_0x6b79('0x71')];logger[_0x6b79('0x64')](util[_0x6b79('0x2e')](_0x6b79('0x72'),_0x31f3e3));return startTranscribe(_0xae660c,_0x2bff88,_0x2e89fd,uuidv4(),_0x388630,_0x59ad00['Location']);})[_0x6b79('0x23')](function(_0x3e0ffd){logger[_0x6b79('0x64')](util[_0x6b79('0x2e')](_0x6b79('0x73'),_0x31f3e3,_0x3e0ffd[_0x6b79('0x74')]['TranscriptionJobName']));_0x8eacf4[_0x6b79('0x75')]=_0x3e0ffd['TranscriptionJob'][_0x6b79('0x76')];_0x8eacf4['transcribeStatus']=_0x3e0ffd[_0x6b79('0x74')]['TranscriptionJobStatus'];return _0x2f7174(_0x8eacf4);})[_0x6b79('0x40')](function(_0x4cd0f1){return _0x3e5140(_0x4cd0f1);});});}exports[_0x6b79('0x77')]=function(_0x2ad4c9,_0x4a9d02,_0x286627){var _0x15c663;var _0x2c59e6;var _0x54f762;var _0x4e3e2b=require(_0x6b79('0x4b'));return db[_0x6b79('0x29')][_0x6b79('0x78')]({'where':{'id':_0x2ad4c9[_0x6b79('0x41')]['id']}})[_0x6b79('0x23')](function(_0x239f77){if(_0x239f77){var _0x11864f=util[_0x6b79('0x2e')]('%s.cypher',_0x239f77[_0x6b79('0x4d')]);if(fs['existsSync'](_0x11864f)){cypher=!![];return _0x4e3e2b[_0x6b79('0x4f')](_0x11864f,_0x239f77[_0x6b79('0x4d')],config[_0x6b79('0x5f')][_0x6b79('0x50')])[_0x6b79('0x23')](function(){return _0x239f77;});}return _0x239f77;}})['then'](function(_0xf95303){if(!_0xf95303){throw new db[(_0x6b79('0x60'))][(_0x6b79('0x52'))](_0x6b79('0x79'));}_0x2c59e6=_0xf95303;return db[_0x6b79('0x7a')][_0x6b79('0x78')]({'where':{'id':0x1}});})[_0x6b79('0x23')](handleEntityNotFound(_0x4a9d02,null))[_0x6b79('0x23')](function(_0x3bbc16){if(_0x3bbc16){_0x15c663=_0x3bbc16;if(!_0x15c663[_0x6b79('0x7b')]||!_0x15c663[_0x6b79('0x7c')]||!_0x15c663[_0x6b79('0x7d')]||!_0x15c663[_0x6b79('0x7e')]||!_0x15c663[_0x6b79('0x6e')]){throw new db[(_0x6b79('0x60'))][(_0x6b79('0x52'))]('Transcribe\x20not\x20configured');}if(_0x2ad4c9[_0x6b79('0x49')][_0x6b79('0x7f')]&&(!_0x15c663[_0x6b79('0x80')]||!_0x15c663[_0x6b79('0x81')]||!_0x15c663[_0x6b79('0x82')]||!_0x15c663[_0x6b79('0x7e')]||!_0x15c663[_0x6b79('0x6e')])){throw new db[(_0x6b79('0x60'))][(_0x6b79('0x52'))](_0x6b79('0x83'));}return db['CloudProvider'][_0x6b79('0x78')]({'where':{'id':_0x15c663[_0x6b79('0x7c')]}});}})[_0x6b79('0x23')](function(_0x5c095b){if(!_0x5c095b){throw new db[(_0x6b79('0x60'))]['ValidationError'](_0x6b79('0x84'));}if(!_0x5c095b['data1']||!_0x5c095b[_0x6b79('0x85')]){throw new db[(_0x6b79('0x60'))][(_0x6b79('0x52'))](_0x6b79('0x86'));}_0x54f762=_0x5c095b;return getBucketslist(_0x54f762['data1'],_0x54f762[_0x6b79('0x85')],_0x15c663[_0x6b79('0x7d')]);})[_0x6b79('0x23')](function(_0x48b9d8){if(_0x48b9d8&&_0x48b9d8[_0x6b79('0x87')]){var _0x21b636=_[_0x6b79('0x46')](_0x48b9d8['Buckets'],function(_0x2fa7dc){return _0x2fa7dc[_0x6b79('0x88')]===_0x15c663['bucket'];});if(!_0x21b636){logger[_0x6b79('0x64')](util[_0x6b79('0x2e')](_0x6b79('0x89'),_0x2ad4c9[_0x6b79('0x41')]['id'],_0x15c663[_0x6b79('0x6e')]));return createBucket(_0x54f762[_0x6b79('0x8a')],_0x54f762[_0x6b79('0x85')],_0x15c663[_0x6b79('0x7d')],_0x15c663[_0x6b79('0x6e')]);}logger[_0x6b79('0x64')](util[_0x6b79('0x2e')](_0x6b79('0x8b'),_0x2ad4c9['params']['id'],_0x15c663[_0x6b79('0x6e')]));return;}})['then'](function(_0x41b687){if(_0x2c59e6[_0x6b79('0x8c')]==='NEW'){return transcribe(_0x2ad4c9[_0x6b79('0x41')]['id'],_0x54f762[_0x6b79('0x8a')],_0x54f762[_0x6b79('0x85')],_0x15c663['transcribeRegion'],_0x15c663['bucket'],_0x2c59e6[_0x6b79('0x4d')],_0x15c663[_0x6b79('0x7e')]);}else{logger[_0x6b79('0x64')](util[_0x6b79('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2ad4c9['params']['id']));return{'transcribeStatus':_0x6b79('0x8d')};}})[_0x6b79('0x23')](function(_0x1fa3ce){if(_0x1fa3ce){_0x1fa3ce['tempSentiment']=_0x2ad4c9[_0x6b79('0x49')]['runSentiment'];return _0x2c59e6[_0x6b79('0x8e')](_0x1fa3ce);}})['then'](respondWithResult(_0x4a9d02,null))[_0x6b79('0x40')](handleError(_0x4a9d02,null));};function writeFile(_0x3a2868,_0x2736bc){return new Promise(function(_0x18f5db,_0x5b9216){fs['writeFile'](_0x2736bc,_0x3a2868,function(_0x136c74,_0x11ef8b){if(_0x136c74){return _0x5b9216(_0x136c74);}else{return _0x18f5db(_0x11ef8b);}});});}exports[_0x6b79('0x8f')]=function(_0xba1ac3,_0x26fa38,_0x9e35ea){return db[_0x6b79('0x29')]['findOne']({'where':{'id':_0xba1ac3[_0x6b79('0x41')]['id']}})['then'](handleEntityNotFound(_0x26fa38))[_0x6b79('0x23')](function(_0x34e882){if(_0x34e882&&_0x34e882[_0x6b79('0x90')]){var _0x412117=_0x34e882[_0x6b79('0x90')];var _0x211a44=config['root']+_0x6b79('0x91')+_0x34e882['id']+_0x6b79('0x92');if(fs[_0x6b79('0x51')](_0x211a44)){return _0x211a44;}return writeFile(_0x412117,_0x211a44)[_0x6b79('0x23')](function(){return _0x211a44;});}else{throw new db[(_0x6b79('0x60'))][(_0x6b79('0x52'))](_0x6b79('0x93'));}})[_0x6b79('0x23')](function(_0x58ecf8){return _0x26fa38[_0x6b79('0x55')](_0x58ecf8);})[_0x6b79('0x40')](handleError(_0x26fa38));}; \ No newline at end of file +var _0x4b02=['type','model','format','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','unlink','message','Not\x20found','downloads','sequelize','MD5','col','push','$and','recording','isNil','Entity\x20not\x20found','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','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName'];(function(_0x49cb92,_0x3c31a6){var _0x16ee5a=function(_0x48e0c6){while(--_0x48e0c6){_0x49cb92['push'](_0x49cb92['shift']());}};_0x16ee5a(++_0x3c31a6);}(_0x4b02,0x67));var _0x24b0=function(_0x38df04,_0x1144b0){_0x38df04=_0x38df04-0x0;var _0x38e0c1=_0x4b02[_0x38df04];return _0x38e0c1;};'use strict';var emlformat=require(_0x24b0('0x0'));var rimraf=require(_0x24b0('0x1'));var zipdir=require(_0x24b0('0x2'));var jsonpatch=require(_0x24b0('0x3'));var rp=require('request-promise');var moment=require(_0x24b0('0x4'));var BPromise=require(_0x24b0('0x5'));var Mustache=require(_0x24b0('0x6'));var util=require(_0x24b0('0x7'));var path=require(_0x24b0('0x8'));var sox=require('sox');var csv=require(_0x24b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24b0('0xa'));var _=require(_0x24b0('0xb'));var squel=require(_0x24b0('0xc'));var crypto=require('crypto');var jsforce=require(_0x24b0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x24b0('0x9'));var querystring=require('querystring');var Papa=require(_0x24b0('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0x24b0('0xf'));var Redis=require(_0x24b0('0x10'));var authService=require(_0x24b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x24b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x24b0('0x13'));var utils=require(_0x24b0('0x14'));var config=require(_0x24b0('0x15'));var licenseUtil=require(_0x24b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x383360,_0x4fc7fd){_0x4fc7fd=_0x4fc7fd||0xcc;return function(_0x287190){if(_0x287190){return _0x383360['sendStatus'](_0x4fc7fd);}return _0x383360[_0x24b0('0x17')](_0x4fc7fd)[_0x24b0('0x18')]();};}function respondWithResult(_0x2f822c,_0x2395fb){_0x2395fb=_0x2395fb||0xc8;return function(_0x502da2){if(_0x502da2){return _0x2f822c[_0x24b0('0x17')](_0x2395fb)[_0x24b0('0x19')](_0x502da2);}};}function respondWithFilteredResult(_0x4c7e3d,_0x3114a5){return function(_0x1032c0){if(_0x1032c0){var _0x6cd9c1=typeof _0x3114a5['offset']===_0x24b0('0x1a')&&typeof _0x3114a5[_0x24b0('0x1b')]===_0x24b0('0x1a');var _0x4de25b=_0x1032c0[_0x24b0('0x1c')];var _0x3a2ef9=_0x6cd9c1?0x0:_0x3114a5['offset'];var _0x5af931=_0x6cd9c1?_0x1032c0['count']:_0x3114a5['offset']+_0x3114a5[_0x24b0('0x1b')];var _0x3862e0;if(_0x5af931>=_0x4de25b){_0x5af931=_0x4de25b;_0x3862e0=0xc8;}else{_0x3862e0=0xce;}_0x4c7e3d[_0x24b0('0x17')](_0x3862e0);return _0x4c7e3d[_0x24b0('0x1d')](_0x24b0('0x1e'),_0x3a2ef9+'-'+_0x5af931+'/'+_0x4de25b)[_0x24b0('0x19')](_0x1032c0);}return null;};}function patchUpdates(_0x2718a3){return function(_0x2480a0){try{jsonpatch[_0x24b0('0x1f')](_0x2480a0,_0x2718a3,!![]);}catch(_0x5b0719){return BPromise[_0x24b0('0x20')](_0x5b0719);}return _0x2480a0[_0x24b0('0x21')]();};}function saveUpdates(_0x8ad8b9,_0x5ce2a8){return function(_0x548200){if(_0x548200){return _0x548200[_0x24b0('0x22')](_0x8ad8b9)[_0x24b0('0x23')](function(_0x12d54e){return _0x12d54e;});}return null;};}function removeEntity(_0x226da2,_0x4bc61f){return function(_0x5c712b){if(_0x5c712b){return _0x5c712b[_0x24b0('0x24')]()[_0x24b0('0x23')](function(){_0x226da2[_0x24b0('0x17')](0xcc)[_0x24b0('0x18')]();});}};}function handleEntityNotFound(_0x23cbce,_0x37d67c){return function(_0x2c97fc){if(!_0x2c97fc){_0x23cbce[_0x24b0('0x25')](0x194);}return _0x2c97fc;};}function handleError(_0x51bd99,_0xcca1a7){_0xcca1a7=_0xcca1a7||0x1f4;return function(_0x236b3a){logger['error'](_0x236b3a[_0x24b0('0x26')]);if(_0x236b3a[_0x24b0('0x27')]){delete _0x236b3a[_0x24b0('0x27')];}_0x51bd99[_0x24b0('0x17')](_0xcca1a7)[_0x24b0('0x28')](_0x236b3a);};}exports[_0x24b0('0x29')]=function(_0x31943c,_0xde067d){var _0x34b490={},_0x579b53={},_0x221b79={'count':0x0,'rows':[]};var _0x2c8557=_[_0x24b0('0x2a')](db[_0x24b0('0x2b')][_0x24b0('0x2c')],function(_0x2f23bb){return{'name':_0x2f23bb[_0x24b0('0x2d')],'type':_0x2f23bb[_0x24b0('0x2e')]['key']};});_0x579b53[_0x24b0('0x2f')]=_['differenceBy'](_[_0x24b0('0x2a')](_0x2c8557,'name'),[_0x24b0('0x30')]);_0x579b53[_0x24b0('0x31')]=_[_0x24b0('0x32')](_0x31943c[_0x24b0('0x31')]);_0x579b53['filters']=_[_0x24b0('0x33')](_0x579b53[_0x24b0('0x2f')],_0x579b53[_0x24b0('0x31')]);_0x34b490[_0x24b0('0x34')]=_[_0x24b0('0x33')](_0x579b53['model'],qs[_0x24b0('0x35')](_0x31943c[_0x24b0('0x31')][_0x24b0('0x35')]));_0x34b490['attributes']=_0x34b490[_0x24b0('0x34')][_0x24b0('0x36')]?_0x34b490[_0x24b0('0x34')]:_0x579b53[_0x24b0('0x2f')];if(!_0x31943c[_0x24b0('0x31')]['hasOwnProperty'](_0x24b0('0x37'))){_0x34b490['limit']=qs[_0x24b0('0x1b')](_0x31943c['query'][_0x24b0('0x1b')]);_0x34b490['offset']=qs[_0x24b0('0x38')](_0x31943c['query'][_0x24b0('0x38')]);}_0x34b490[_0x24b0('0x39')]=qs[_0x24b0('0x3a')](_0x31943c[_0x24b0('0x31')][_0x24b0('0x3a')]);_0x34b490[_0x24b0('0x3b')]=qs[_0x24b0('0x3c')](_['pick'](_0x31943c[_0x24b0('0x31')],_0x579b53[_0x24b0('0x3c')]),_0x2c8557);if(_0x31943c['query'][_0x24b0('0x3d')]){_0x34b490[_0x24b0('0x3b')]=_['merge'](_0x34b490[_0x24b0('0x3b')],{'$or':_[_0x24b0('0x2a')](_0x2c8557,function(_0x8df546){if(_0x8df546['type']!==_0x24b0('0x3e')){var _0x5cf8b3={};_0x5cf8b3[_0x8df546[_0x24b0('0x27')]]={'$like':'%'+_0x31943c[_0x24b0('0x31')][_0x24b0('0x3d')]+'%'};return _0x5cf8b3;}})});}_0x34b490=_[_0x24b0('0x3f')]({},_0x34b490,_0x31943c[_0x24b0('0x40')]);var _0x84fdd0={'where':_0x34b490[_0x24b0('0x3b')]};return db[_0x24b0('0x2b')][_0x24b0('0x1c')](_0x84fdd0)[_0x24b0('0x23')](function(_0x3ba298){_0x221b79[_0x24b0('0x1c')]=_0x3ba298;if(_0x31943c['query'][_0x24b0('0x41')]){_0x34b490[_0x24b0('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0x24b0('0x43')](_0x34b490);})[_0x24b0('0x23')](function(_0x2eb524){_0x221b79[_0x24b0('0x44')]=_0x2eb524;return _0x221b79;})[_0x24b0('0x23')](respondWithFilteredResult(_0xde067d,_0x34b490))[_0x24b0('0x45')](handleError(_0xde067d,null));};exports['show']=function(_0x687ee,_0x5811a8){var _0xd511c2={'raw':![],'where':{'id':_0x687ee[_0x24b0('0x46')]['id']}},_0x40a728={};_0x40a728[_0x24b0('0x2f')]=_[_0x24b0('0x32')](db['VoiceRecording']['rawAttributes']);_0x40a728[_0x24b0('0x31')]=_[_0x24b0('0x32')](_0x687ee[_0x24b0('0x31')]);_0x40a728[_0x24b0('0x3c')]=_[_0x24b0('0x33')](_0x40a728[_0x24b0('0x2f')],_0x40a728[_0x24b0('0x31')]);_0xd511c2[_0x24b0('0x34')]=_[_0x24b0('0x33')](_0x40a728[_0x24b0('0x2f')],qs[_0x24b0('0x35')](_0x687ee[_0x24b0('0x31')][_0x24b0('0x35')]));_0xd511c2[_0x24b0('0x34')]=_0xd511c2[_0x24b0('0x34')][_0x24b0('0x36')]?_0xd511c2['attributes']:_0x40a728[_0x24b0('0x2f')];if(_0x687ee['query'][_0x24b0('0x41')]){_0xd511c2[_0x24b0('0x42')]=[{'all':!![]}];}_0xd511c2=_[_0x24b0('0x3f')]({},_0xd511c2,_0x687ee['options']);return db[_0x24b0('0x2b')][_0x24b0('0x47')](_0xd511c2)[_0x24b0('0x23')](handleEntityNotFound(_0x5811a8,null))[_0x24b0('0x23')](respondWithResult(_0x5811a8,null))[_0x24b0('0x45')](handleError(_0x5811a8,null));};exports[_0x24b0('0x48')]=function(_0x115652,_0x1f76ba){return db[_0x24b0('0x2b')]['create'](_0x115652[_0x24b0('0x49')],{})['then'](respondWithResult(_0x1f76ba,0xc9))[_0x24b0('0x45')](handleError(_0x1f76ba,null));};exports[_0x24b0('0x22')]=function(_0x19aa93,_0x43872b){if(_0x19aa93[_0x24b0('0x49')]['id']){delete _0x19aa93['body']['id'];}return db[_0x24b0('0x2b')][_0x24b0('0x47')]({'where':{'id':_0x19aa93[_0x24b0('0x46')]['id']}})['then'](handleEntityNotFound(_0x43872b,null))['then'](saveUpdates(_0x19aa93[_0x24b0('0x49')],null))[_0x24b0('0x23')](respondWithResult(_0x43872b,null))['catch'](handleError(_0x43872b,null));};exports[_0x24b0('0x4a')]=function(_0x30e6a6,_0xf80ab6){return db['VoiceRecording'][_0x24b0('0x4a')]()[_0x24b0('0x23')](respondWithResult(_0xf80ab6,null))[_0x24b0('0x45')](handleError(_0xf80ab6,null));};exports['download']=function(_0x9edd80,_0x1ede10,_0x2e12ac){var _0x3d62d6=require(_0x24b0('0x4b'));var _0x2f4cf7=![];var _0x1cf70e={};if(_0x9edd80[_0x24b0('0x31')][_0x24b0('0x2e')]&&_0x9edd80[_0x24b0('0x31')]['type']===_0x24b0('0x4c')){_0x1cf70e['uniqueid']=_0x9edd80['params']['id'];}else{_0x1cf70e['id']=_0x9edd80[_0x24b0('0x46')]['id'];}return db[_0x24b0('0x2b')][_0x24b0('0x47')]({'where':_0x1cf70e,'attributes':['id',_0x24b0('0x4d')],'raw':!![]})[_0x24b0('0x23')](handleEntityNotFound(_0x1ede10,null))['then'](function(_0x33db40){if(_0x33db40){var _0x2283c0=_0x33db40[_0x24b0('0x4d')];var _0x50fbad=util[_0x24b0('0x30')](_0x24b0('0x4e'),_0x2283c0);if(fs[_0x24b0('0x4f')](_0x50fbad)){_0x2f4cf7=!![];return _0x3d62d6[_0x24b0('0x50')](_0x50fbad,_0x2283c0,config[_0x24b0('0x51')]['recording'])['then'](function(){return _0x33db40;});}return _0x33db40;}})[_0x24b0('0x23')](function(_0x5995d3){if(_0x5995d3){var _0x5e984a=_0x5995d3[_0x24b0('0x4d')];if(!fs[_0x24b0('0x4f')](_0x5e984a)){throw new db[(_0x24b0('0x52'))][(_0x24b0('0x53'))](_0x24b0('0x54'));}if(_0x5995d3[_0x24b0('0x55')]){return _0x1ede10[_0x24b0('0x56')](_0x5e984a,_0x5995d3['filename']+path['extname'](_0x5e984a),function(){if(_0x2f4cf7){fs[_0x24b0('0x57')](_0x5e984a);}});}else{return _0x1ede10[_0x24b0('0x56')](_0x5e984a,function(_0xe3baed){if(_0x2f4cf7){fs['unlink'](_0x5e984a);}});}}})[_0x24b0('0x45')](function(_0x2b52b9){if(_0x2b52b9[_0x24b0('0x58')]===_0x24b0('0x54')){_0x1ede10[_0x24b0('0x17')](0x194)['send'](_0x24b0('0x59'));}else{return handleError(_0x1ede10,null);}});};exports[_0x24b0('0x5a')]=function(_0x2b1977,_0x5a94f1,_0x333bd6){var _0x4ecad1=require(_0x24b0('0x4b'));var _0xf73168=![];var _0x1d1a4f={'$and':[db[_0x24b0('0x5b')][_0x24b0('0x3b')](db[_0x24b0('0x5b')]['fn'](_0x24b0('0x5c'),db['sequelize'][_0x24b0('0x5d')](_0x24b0('0x4c'))),_0x2b1977['query']['token'])]};if(_0x2b1977[_0x24b0('0x31')][_0x24b0('0x2e')]&&_0x2b1977[_0x24b0('0x31')][_0x24b0('0x2e')]==='uniqueid'){_0x1d1a4f['$and'][_0x24b0('0x5e')]({'uniqueid':_0x2b1977[_0x24b0('0x46')]['id']});}else{_0x1d1a4f[_0x24b0('0x5f')][_0x24b0('0x5e')]({'id':_0x2b1977[_0x24b0('0x46')]['id']});}return db[_0x24b0('0x2b')][_0x24b0('0x47')]({'where':_0x1d1a4f,'attributes':['id',_0x24b0('0x4d')],'raw':!![]})[_0x24b0('0x23')](handleEntityNotFound(_0x5a94f1,null))[_0x24b0('0x23')](function(_0x1f6bec){if(_0x1f6bec){var _0x259b87=util['format']('%s.cypher',_0x1f6bec[_0x24b0('0x4d')]);if(fs[_0x24b0('0x4f')](_0x259b87)){_0xf73168=!![];return _0x4ecad1[_0x24b0('0x50')](_0x259b87,_0x1f6bec[_0x24b0('0x4d')],config[_0x24b0('0x51')][_0x24b0('0x60')])[_0x24b0('0x23')](function(){return _0x1f6bec;});}return _0x1f6bec;}})[_0x24b0('0x23')](function(_0x2c628a){if(_0x2c628a){if(!fs[_0x24b0('0x4f')](_0x2c628a[_0x24b0('0x4d')])){throw new db[(_0x24b0('0x52'))][(_0x24b0('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x2c628a['filename']){return _0x5a94f1[_0x24b0('0x56')](_0x2c628a[_0x24b0('0x4d')],_0x2c628a[_0x24b0('0x55')]+path['extname'](_0x2c628a['value']),function(){if(_0xf73168){fs[_0x24b0('0x57')](_0x2c628a['value']);}});}else{return _0x5a94f1[_0x24b0('0x56')](_0x2c628a['value'],function(_0x155779){if(_0xf73168){fs[_0x24b0('0x57')](_0x2c628a[_0x24b0('0x4d')]);}});}}})[_0x24b0('0x45')](handleError(_0x5a94f1,null));};exports[_0x24b0('0x24')]=function(_0x598bdc,_0x43412b){return db[_0x24b0('0x2b')][_0x24b0('0x47')]({'where':{'id':_0x598bdc[_0x24b0('0x46')]['id']}})[_0x24b0('0x23')](function(_0x5a7949){if(_[_0x24b0('0x61')](_0x5a7949)){throw new ReferenceError(_0x24b0('0x62'));}return _0x5a7949;})[_0x24b0('0x23')](function(_0x585dda){var _0x45bcee=_0x585dda[_0x24b0('0x4d')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x45bcee);if(!_[_0x24b0('0x61')](_0x585dda[_0x24b0('0x4d')])&&fs[_0x24b0('0x4f')](_0x45bcee)){logger[_0x24b0('0x63')](_0x24b0('0x64')+_0x45bcee+_0x24b0('0x65'));fs[_0x24b0('0x66')](_0x45bcee);}_0x45bcee=_0x45bcee+_0x24b0('0x67');if(!_[_0x24b0('0x61')](_0x585dda[_0x24b0('0x4d')])&&fs[_0x24b0('0x4f')](_0x45bcee)){logger[_0x24b0('0x63')](_0x24b0('0x64')+_0x45bcee+_0x24b0('0x65'));fs['unlinkSync'](_0x45bcee);}return _0x585dda;})[_0x24b0('0x23')](function(_0x38df43){if(!_0x38df43)throw new InternalError();return _0x38df43[_0x24b0('0x24')]();})['then'](function(){_0x43412b[_0x24b0('0x17')](0xcc)[_0x24b0('0x18')]();})[_0x24b0('0x45')](handleError(_0x43412b,null));};function getBucketslist(_0x410a5a,_0x23ae3b,_0x5b4b90){return new Promise(function(_0x172fb5,_0x2c21f5){var _0x56766f=new AWS['S3']({'accessKeyId':_0x23ae3b,'secretAccessKey':_0x410a5a,'region':_0x5b4b90});_0x56766f[_0x24b0('0x68')]({},function(_0x4e1e67,_0x56d164){if(_0x4e1e67){return _0x2c21f5(_0x4e1e67);}else{return _0x172fb5(_0x56d164);}});});}function createBucket(_0x1459b7,_0x3e8b87,_0x3a176e,_0x1bb0b9){return new Promise(function(_0x15a356,_0x5122b5){var _0x32f475=new AWS['S3']({'accessKeyId':_0x3e8b87,'secretAccessKey':_0x1459b7,'region':_0x3a176e});_0x32f475[_0x24b0('0x69')]({'Bucket':_0x1bb0b9},function(_0x36b977,_0x478d24){if(_0x36b977){return _0x5122b5(_0x36b977);}else{return _0x15a356(_0x478d24);}});});}function uploadFile(_0x133751,_0x59d010,_0x36007d,_0x167f94,_0x7435e,_0x4954a1){return new Promise(function(_0x38aabd,_0x35d27e){var _0x47a810=new AWS['S3']({'accessKeyId':_0x59d010,'secretAccessKey':_0x133751,'region':_0x36007d});_0x47a810['upload']({'Bucket':_0x167f94,'Key':_0x7435e,'Body':_0x4954a1},function(_0x497d8c,_0x9f6945){if(_0x497d8c){return _0x35d27e(_0x497d8c);}else{return _0x38aabd(_0x9f6945);}});});}function startTranscribe(_0x805e9d,_0x5d9aaa,_0x1fd784,_0x36bc32,_0x279d7b,_0x38a1f9){return new Promise(function(_0x2a6182,_0x3d453e){var _0x54a042=new AWS[(_0x24b0('0x6a'))]({'accessKeyId':_0x5d9aaa,'secretAccessKey':_0x805e9d,'region':_0x1fd784});_0x54a042[_0x24b0('0x6b')]({'TranscriptionJobName':_0x36bc32,'LanguageCode':_0x279d7b,'Media':{'MediaFileUri':_0x38a1f9}},function(_0x4134cb,_0x4721af){if(_0x4134cb){return _0x3d453e(_0x4134cb);}else{return _0x2a6182(_0x4721af);}});});}function transcribe(_0x384a8d,_0x507d7a,_0x1cf7f2,_0x263ea7,_0x4f85e5,_0x1278ac,_0x59217){return new Promise(function(_0x108b6a,_0x98281f){var _0x1e8dce={};logger[_0x24b0('0x63')](util[_0x24b0('0x30')](_0x24b0('0x6c'),_0x384a8d,_0x4f85e5));return uploadFile(_0x507d7a,_0x1cf7f2,_0x263ea7,_0x4f85e5,path['basename'](_0x1278ac),fs[_0x24b0('0x6d')](_0x1278ac))[_0x24b0('0x23')](function(_0x5ebea6){logger[_0x24b0('0x63')](util[_0x24b0('0x30')](_0x24b0('0x6e'),_0x384a8d,_0x4f85e5,_0x5ebea6['Location']));_0x1e8dce[_0x24b0('0x6f')]=_0x5ebea6[_0x24b0('0x70')];_0x1e8dce[_0x24b0('0x71')]=_0x5ebea6[_0x24b0('0x72')];logger['info'](util[_0x24b0('0x30')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x384a8d));return startTranscribe(_0x507d7a,_0x1cf7f2,_0x263ea7,uuidv4(),_0x59217,_0x5ebea6[_0x24b0('0x72')]);})[_0x24b0('0x23')](function(_0x3cc245){logger[_0x24b0('0x63')](util['format'](_0x24b0('0x73'),_0x384a8d,_0x3cc245[_0x24b0('0x74')][_0x24b0('0x75')]));_0x1e8dce['transcribeName']=_0x3cc245[_0x24b0('0x74')]['TranscriptionJobName'];_0x1e8dce[_0x24b0('0x76')]=_0x3cc245[_0x24b0('0x74')][_0x24b0('0x77')];return _0x108b6a(_0x1e8dce);})[_0x24b0('0x45')](function(_0x5c47d0){return _0x98281f(_0x5c47d0);});});}exports[_0x24b0('0x78')]=function(_0x1477bd,_0x444ad9,_0x483ec3){var _0x8ba9ec;var _0x2b0673;var _0x4ae961;var _0x40bf61=require('../../components/encryptor');return db[_0x24b0('0x2b')][_0x24b0('0x79')]({'where':{'id':_0x1477bd['params']['id']}})['then'](function(_0x2c26a0){if(_0x2c26a0){var _0x4878ad=util[_0x24b0('0x30')](_0x24b0('0x4e'),_0x2c26a0['value']);if(fs['existsSync'](_0x4878ad)){cypher=!![];return _0x40bf61[_0x24b0('0x50')](_0x4878ad,_0x2c26a0[_0x24b0('0x4d')],config[_0x24b0('0x51')][_0x24b0('0x60')])[_0x24b0('0x23')](function(){return _0x2c26a0;});}return _0x2c26a0;}})[_0x24b0('0x23')](function(_0x54d9bc){if(!_0x54d9bc){throw new db[(_0x24b0('0x52'))][(_0x24b0('0x53'))]('Voice\x20Recording\x20not\x20found');}_0x2b0673=_0x54d9bc;return db[_0x24b0('0x7a')][_0x24b0('0x79')]({'where':{'id':0x1}});})[_0x24b0('0x23')](handleEntityNotFound(_0x444ad9,null))['then'](function(_0x5c049f){if(_0x5c049f){_0x8ba9ec=_0x5c049f;if(!_0x8ba9ec[_0x24b0('0x7b')]||!_0x8ba9ec['transcribeAccountId']||!_0x8ba9ec['transcribeRegion']||!_0x8ba9ec[_0x24b0('0x7c')]||!_0x8ba9ec[_0x24b0('0x6f')]){throw new db['Sequelize'][(_0x24b0('0x53'))](_0x24b0('0x7d'));}if(_0x1477bd['body'][_0x24b0('0x7e')]&&(!_0x8ba9ec[_0x24b0('0x7f')]||!_0x8ba9ec[_0x24b0('0x80')]||!_0x8ba9ec[_0x24b0('0x81')]||!_0x8ba9ec['language']||!_0x8ba9ec[_0x24b0('0x6f')])){throw new db[(_0x24b0('0x52'))][(_0x24b0('0x53'))](_0x24b0('0x82'));}return db[_0x24b0('0x83')][_0x24b0('0x79')]({'where':{'id':_0x8ba9ec['transcribeAccountId']}});}})[_0x24b0('0x23')](function(_0x5971d1){if(!_0x5971d1){throw new db[(_0x24b0('0x52'))]['ValidationError'](_0x24b0('0x84'));}if(!_0x5971d1[_0x24b0('0x85')]||!_0x5971d1[_0x24b0('0x86')]){throw new db[(_0x24b0('0x52'))][(_0x24b0('0x53'))](_0x24b0('0x87'));}_0x4ae961=_0x5971d1;return getBucketslist(_0x4ae961['data1'],_0x4ae961[_0x24b0('0x86')],_0x8ba9ec[_0x24b0('0x88')]);})['then'](function(_0x518c06){if(_0x518c06&&_0x518c06[_0x24b0('0x89')]){var _0x5583ac=_[_0x24b0('0x47')](_0x518c06['Buckets'],function(_0x134eda){return _0x134eda[_0x24b0('0x8a')]===_0x8ba9ec[_0x24b0('0x6f')];});if(!_0x5583ac){logger[_0x24b0('0x63')](util[_0x24b0('0x30')](_0x24b0('0x8b'),_0x1477bd[_0x24b0('0x46')]['id'],_0x8ba9ec['bucket']));return createBucket(_0x4ae961[_0x24b0('0x85')],_0x4ae961[_0x24b0('0x86')],_0x8ba9ec[_0x24b0('0x88')],_0x8ba9ec[_0x24b0('0x6f')]);}logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1477bd[_0x24b0('0x46')]['id'],_0x8ba9ec[_0x24b0('0x6f')]));return;}})['then'](function(_0x164e41){if(_0x2b0673[_0x24b0('0x76')]==='NEW'){return transcribe(_0x1477bd[_0x24b0('0x46')]['id'],_0x4ae961['data1'],_0x4ae961[_0x24b0('0x86')],_0x8ba9ec[_0x24b0('0x88')],_0x8ba9ec[_0x24b0('0x6f')],_0x2b0673['value'],_0x8ba9ec[_0x24b0('0x7c')]);}else{logger['info'](util['format'](_0x24b0('0x8c'),_0x1477bd[_0x24b0('0x46')]['id']));return{'transcribeStatus':_0x24b0('0x8d')};}})[_0x24b0('0x23')](function(_0x815ce2){if(_0x815ce2){_0x815ce2['tempSentiment']=_0x1477bd[_0x24b0('0x49')][_0x24b0('0x7e')];return _0x2b0673[_0x24b0('0x8e')](_0x815ce2);}})[_0x24b0('0x23')](respondWithResult(_0x444ad9,null))[_0x24b0('0x45')](handleError(_0x444ad9,null));};function writeFile(_0x4be761,_0x39e7e0){return new Promise(function(_0x48cc57,_0x2fcdda){fs[_0x24b0('0x8f')](_0x39e7e0,_0x4be761,function(_0x53ac97,_0x38ec){if(_0x53ac97){return _0x2fcdda(_0x53ac97);}else{return _0x48cc57(_0x38ec);}});});}exports[_0x24b0('0x90')]=function(_0x2d770f,_0x3ccfd8,_0xe6c1dc){return db[_0x24b0('0x2b')]['findOne']({'where':{'id':_0x2d770f[_0x24b0('0x46')]['id']}})[_0x24b0('0x23')](handleEntityNotFound(_0x3ccfd8))[_0x24b0('0x23')](function(_0x34c083){if(_0x34c083&&_0x34c083[_0x24b0('0x91')]){var _0x5d06c7=_0x34c083[_0x24b0('0x91')];var _0x5f139f=config[_0x24b0('0x92')]+'/server/files/transcribes/transcribe_'+_0x34c083['id']+_0x24b0('0x93');if(fs[_0x24b0('0x4f')](_0x5f139f)){return _0x5f139f;}return writeFile(_0x5d06c7,_0x5f139f)[_0x24b0('0x23')](function(){return _0x5f139f;});}else{throw new db[(_0x24b0('0x52'))][(_0x24b0('0x53'))](_0x24b0('0x94'));}})[_0x24b0('0x23')](function(_0xd038ec){return _0x3ccfd8[_0x24b0('0x56')](_0xd038ec);})['catch'](handleError(_0x3ccfd8));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8b68d22..5ebfc71 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 _0x5205=['moment','request-promise','rimraf','../../config/environment','exports','define','VoiceRecording','uniqueid','lodash','util','api'];(function(_0x2c1fc6,_0x292eab){var _0x59335b=function(_0x585949){while(--_0x585949){_0x2c1fc6['push'](_0x2c1fc6['shift']());}};_0x59335b(++_0x292eab);}(_0x5205,0x1e1));var _0x5520=function(_0x5eb7f3,_0x4d5199){_0x5eb7f3=_0x5eb7f3-0x0;var _0x48b100=_0x5205[_0x5eb7f3];return _0x48b100;};'use strict';var _=require(_0x5520('0x0'));var util=require(_0x5520('0x1'));var logger=require('../../config/logger')(_0x5520('0x2'));var moment=require(_0x5520('0x3'));var BPromise=require('bluebird');var rp=require(_0x5520('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5520('0x5'));var config=require(_0x5520('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x5520('0x7')]=function(_0x2c8387,_0x8a4261){return _0x2c8387[_0x5520('0x8')](_0x5520('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x5520('0xa'),'fields':[_0x5520('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5777=['lodash','util','moment','request-promise','path','rimraf','./voiceRecording.attributes','define','VoiceRecording','uniqueid'];(function(_0x578b45,_0x36751e){var _0x28aafa=function(_0x40468a){while(--_0x40468a){_0x578b45['push'](_0x578b45['shift']());}};_0x28aafa(++_0x36751e);}(_0x5777,0x15e));var _0x7577=function(_0x54c672,_0x5eb3a5){_0x54c672=_0x54c672-0x0;var _0x5f0c69=_0x5777[_0x54c672];return _0x5f0c69;};'use strict';var _=require(_0x7577('0x0'));var util=require(_0x7577('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7577('0x2'));var BPromise=require('bluebird');var rp=require(_0x7577('0x3'));var fs=require('fs');var path=require(_0x7577('0x4'));var rimraf=require(_0x7577('0x5'));var config=require('../../config/environment');var attributes=require(_0x7577('0x6'));module['exports']=function(_0x52fb2c,_0xee7411){return _0x52fb2c[_0x7577('0x7')](_0x7577('0x8'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7577('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6340983..b992af7 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 _0x82c4=['value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','options','raw','where','attributes','CreateVoiceRecording','../../components/encryptor','findOne','create','body','callRecordingEncryption','existsSync'];(function(_0x28a0e1,_0x38ecdb){var _0x2cfa79=function(_0x486e37){while(--_0x486e37){_0x28a0e1['push'](_0x28a0e1['shift']());}};_0x2cfa79(++_0x38ecdb);}(_0x82c4,0x1ca));var _0x482c=function(_0x4ef241,_0x3c4685){_0x4ef241=_0x4ef241-0x0;var _0x3cefce=_0x82c4[_0x4ef241];return _0x3cefce;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});}exports[_0x482c('0x15')]=function(_0x5b6f7e){var _0x3aed45=this;return new Promise(function(_0x258148,_0x4af05a){return db['VoiceRecording'][_0x482c('0x16')](_0x5b6f7e['body'],{'raw':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e['options'][_0x482c('0x19')]||null:null,'attributes':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x1a')]||null:null,'limit':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e['options']['limit']||null:null})[_0x482c('0xa')](function(_0x147d05){logger[_0x482c('0xb')]('UpdateVoiceRecording',_0x5b6f7e);logger[_0x482c('0xe')]('UpdateVoiceRecording',_0x5b6f7e,JSON[_0x482c('0xf')](_0x147d05));_0x258148(_0x147d05);})[_0x482c('0x14')](function(_0x4f1108){logger[_0x482c('0x10')]('UpdateVoiceRecording',_0x4f1108['message'],_0x5b6f7e);_0x4af05a(_0x3aed45[_0x482c('0x10')](0x1f4,_0x4f1108[_0x482c('0x12')]));});});};exports[_0x482c('0x1b')]=function(_0x1f4501){var _0x3bd5bb=this;return new Promise(function(_0x215826,_0x2981d2){var _0x5ad788=require(_0x482c('0x1c'));var _0x255417;return db['Setting'][_0x482c('0x1d')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x207441){_0x255417=_0x207441;return db['VoiceRecording'][_0x482c('0x1e')](_0x1f4501[_0x482c('0x1f')]);})[_0x482c('0xa')](function(_0x11fa65){if(_0x255417[_0x482c('0x20')]&&fs[_0x482c('0x21')](_0x11fa65[_0x482c('0x22')])){var _0x3e9b22=util[_0x482c('0x23')](_0x482c('0x24'),_0x11fa65[_0x482c('0x22')]);return _0x5ad788[_0x482c('0x25')](_0x11fa65[_0x482c('0x22')],_0x3e9b22,config[_0x482c('0x26')][_0x482c('0x27')])[_0x482c('0xa')](function(){fs[_0x482c('0x28')](_0x11fa65[_0x482c('0x22')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x11fa65;});}return _0x11fa65;})['then'](function(_0x2fd9d0){logger[_0x482c('0xb')](_0x482c('0x1b'),_0x1f4501);logger[_0x482c('0xe')]('CreateVoiceRecording',_0x1f4501,JSON[_0x482c('0xf')](_0x2fd9d0));_0x215826(_0x2fd9d0);})['catch'](function(_0x31428c){logger[_0x482c('0x10')](_0x482c('0x1b'),_0x31428c[_0x482c('0x12')],_0x1f4501);_0x2981d2(_0x3bd5bb[_0x482c('0x10')](0x1f4,_0x31428c[_0x482c('0x12')]));});});}; \ No newline at end of file +var _0x0120=['attributes','limit','then','debug','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','value','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateVoiceRecording','update','body','options','raw'];(function(_0x54607e,_0x3a9a22){var _0x1058d2=function(_0x55a98b){while(--_0x55a98b){_0x54607e['push'](_0x54607e['shift']());}};_0x1058d2(++_0x3a9a22);}(_0x0120,0x6f));var _0x0012=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0120[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['VoiceRecording'][_0x0012('0x17')](_0x1d0423[_0x0012('0x18')],{'raw':_0x1d0423['options']?_0x1d0423[_0x0012('0x19')][_0x0012('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0423[_0x0012('0x19')]?_0x1d0423[_0x0012('0x19')]['where']||null:null,'attributes':_0x1d0423['options']?_0x1d0423[_0x0012('0x19')][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x19')]?_0x1d0423[_0x0012('0x19')][_0x0012('0x1c')]||null:null})[_0x0012('0x1d')](function(_0x2c9a96){logger[_0x0012('0xd')]('UpdateVoiceRecording',_0x1d0423);logger[_0x0012('0x1e')](_0x0012('0x16'),_0x1d0423,JSON['stringify'](_0x2c9a96));_0x1e78ee(_0x2c9a96);})[_0x0012('0x1f')](function(_0x13a78e){logger[_0x0012('0x12')](_0x0012('0x16'),_0x13a78e[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1['error'](0x1f4,_0x13a78e[_0x0012('0x14')]));});});};exports[_0x0012('0x20')]=function(_0xbb5b55){var _0x2a0302=this;return new Promise(function(_0x173cb3,_0xb37ef5){var _0x15d48a=require(_0x0012('0x21'));var _0x300e13;return db[_0x0012('0x22')][_0x0012('0x23')]({'attributes':['id',_0x0012('0x24')],'where':{'id':0x1},'raw':!![]})[_0x0012('0x1d')](function(_0x3ce788){_0x300e13=_0x3ce788;return db[_0x0012('0x25')][_0x0012('0x26')](_0xbb5b55[_0x0012('0x18')]);})[_0x0012('0x1d')](function(_0x1c23e0){if(_0x300e13[_0x0012('0x24')]&&fs[_0x0012('0x27')](_0x1c23e0['value'])){var _0x283134=util[_0x0012('0x28')]('%s.cypher',_0x1c23e0[_0x0012('0x29')]);return _0x15d48a[_0x0012('0x2a')](_0x1c23e0[_0x0012('0x29')],_0x283134,config[_0x0012('0x2b')][_0x0012('0x2c')])['then'](function(){fs[_0x0012('0x2d')](_0x1c23e0[_0x0012('0x29')]);logger[_0x0012('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x1c23e0;});}return _0x1c23e0;})[_0x0012('0x1d')](function(_0x31225a){logger[_0x0012('0xd')](_0x0012('0x20'),_0xbb5b55);logger[_0x0012('0x1e')](_0x0012('0x20'),_0xbb5b55,JSON['stringify'](_0x31225a));_0x173cb3(_0x31225a);})[_0x0012('0x1f')](function(_0x30dfd8){logger[_0x0012('0x12')](_0x0012('0x20'),_0x30dfd8['message'],_0xbb5b55);_0xb37ef5(_0x2a0302['error'](0x1f4,_0x30dfd8[_0x0012('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 029da06..d232b83 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 _0xa86a=['get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x32874f,_0x2b45c6){var _0x5a89c6=function(_0xce908){while(--_0xce908){_0x32874f['push'](_0x32874f['shift']());}};_0x5a89c6(++_0x2b45c6);}(_0xa86a,0xe0));var _0xaa86=function(_0x572a0b,_0x2763dd){_0x572a0b=_0x572a0b-0x0;var _0x2c81be=_0xa86a[_0x572a0b];return _0x2c81be;};'use strict';var multer=require(_0xaa86('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa86('0x1'));var express=require('express');var router=express[_0xaa86('0x2')]();var fs_extra=require(_0xaa86('0x3'));var auth=require(_0xaa86('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaa86('0x5'));var controller=require(_0xaa86('0x6'));router[_0xaa86('0x7')]('/',auth['isAuthenticated'](),controller[_0xaa86('0x8')]);router[_0xaa86('0x7')](_0xaa86('0x9'),auth['isAuthenticated'](),controller[_0xaa86('0xa')]);router[_0xaa86('0x7')](_0xaa86('0xb'),auth[_0xaa86('0xc')](),controller[_0xaa86('0xd')]);router[_0xaa86('0xe')]('/',auth[_0xaa86('0xc')](),controller[_0xaa86('0xf')]);router[_0xaa86('0x10')](_0xaa86('0xb'),auth[_0xaa86('0xc')](),controller[_0xaa86('0x11')]);router[_0xaa86('0x12')](_0xaa86('0xb'),auth['isAuthenticated'](),controller[_0xaa86('0x13')]);module[_0xaa86('0x14')]=router; \ No newline at end of file +var _0xe433=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0xe433,0x1f3));var _0x3e43=function(_0x1840c1,_0x217972){_0x1840c1=_0x1840c1-0x0;var _0x4587b0=_0xe433[_0x1840c1];return _0x4587b0;};'use strict';var multer=require(_0x3e43('0x0'));var util=require('util');var path=require(_0x3e43('0x1'));var timeout=require(_0x3e43('0x2'));var express=require(_0x3e43('0x3'));var router=express['Router']();var fs_extra=require(_0x3e43('0x4'));var auth=require(_0x3e43('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3e43('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x3e43('0x7')]('/',auth[_0x3e43('0x8')](),controller['index']);router['get'](_0x3e43('0x9'),auth[_0x3e43('0x8')](),controller[_0x3e43('0xa')]);router[_0x3e43('0x7')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0xc')]);router[_0x3e43('0xd')]('/',auth[_0x3e43('0x8')](),controller[_0x3e43('0xe')]);router[_0x3e43('0xf')](_0x3e43('0xb'),auth['isAuthenticated'](),controller[_0x3e43('0x10')]);router[_0x3e43('0x11')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0x12')]);module[_0x3e43('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index f6864fd..ca8d628 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 _0x7bef=['STRING','ENUM','Yes','moment','exports','blind'];(function(_0xb96f8b,_0x4b0abe){var _0x43a994=function(_0x5bb90e){while(--_0x5bb90e){_0xb96f8b['push'](_0xb96f8b['shift']());}};_0x43a994(++_0x4b0abe);}(_0x7bef,0xd5));var _0xf7be=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x7bef[_0x2e3545];return _0xcf18f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf7be('0x0'));module[_0xf7be('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf7be('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xf7be('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xf7be('0x3')]},'transferercalleridname':{'type':Sequelize[_0xf7be('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xf7be('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xf7be('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xf7be('0x3')]},'transfereechannel':{'type':Sequelize[_0xf7be('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xf7be('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf7be('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xf7be('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xf7be('0x3')]},'transfereecontext':{'type':Sequelize[_0xf7be('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xf7be('0x3')]},'isexternal':{'type':Sequelize[_0xf7be('0x4')](_0xf7be('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xf7be('0x3')]}}; \ No newline at end of file +var _0xff5e=['sequelize','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x572a43,_0x16d0c3){var _0x4658a6=function(_0x2f430c){while(--_0x2f430c){_0x572a43['push'](_0x572a43['shift']());}};_0x4658a6(++_0x16d0c3);}(_0xff5e,0xb6));var _0xeff5=function(_0x4c5f3e,_0x1f630a){_0x4c5f3e=_0x4c5f3e-0x0;var _0x5948d5=_0xff5e[_0x4c5f3e];return _0x5948d5;};'use strict';var Sequelize=require(_0xeff5('0x0'));var moment=require('moment');module[_0xeff5('0x1')]={'type':{'type':Sequelize[_0xeff5('0x2')](_0xeff5('0x3'),_0xeff5('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xeff5('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xeff5('0x5')]},'transferercalleridname':{'type':Sequelize[_0xeff5('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xeff5('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xeff5('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xeff5('0x5')]},'transferercontext':{'type':Sequelize[_0xeff5('0x5')]},'transfererexten':{'type':Sequelize[_0xeff5('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xeff5('0x5')]},'transfereechannel':{'type':Sequelize[_0xeff5('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xeff5('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xeff5('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xeff5('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xeff5('0x2')](_0xeff5('0x6'),'No')},'context':{'type':Sequelize[_0xeff5('0x5')]},'extension':{'type':Sequelize[_0xeff5('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c006458..2a5e855 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 _0xfd80=['api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','VoiceTransferReport','rawAttributes','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x23018e,_0x11e5e3){var _0x29de10=function(_0x4fa28a){while(--_0x4fa28a){_0x23018e['push'](_0x23018e['shift']());}};_0x29de10(++_0x11e5e3);}(_0xfd80,0xc0));var _0x0fd8=function(_0x9175cf,_0x54659a){_0x9175cf=_0x9175cf-0x0;var _0x8c6d5b=_0xfd80[_0x9175cf];return _0x8c6d5b;};'use strict';var emlformat=require(_0x0fd8('0x0'));var rimraf=require(_0x0fd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fd8('0x2'));var rp=require(_0x0fd8('0x3'));var moment=require(_0x0fd8('0x4'));var BPromise=require(_0x0fd8('0x5'));var Mustache=require(_0x0fd8('0x6'));var util=require(_0x0fd8('0x7'));var path=require(_0x0fd8('0x8'));var sox=require('sox');var csv=require(_0x0fd8('0x9'));var ejs=require(_0x0fd8('0xa'));var fs=require('fs');var fs_extra=require(_0x0fd8('0xb'));var _=require(_0x0fd8('0xc'));var squel=require(_0x0fd8('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fd8('0xe'));var deskjs=require(_0x0fd8('0xf'));var toCsv=require(_0x0fd8('0x9'));var querystring=require(_0x0fd8('0x10'));var Papa=require('papaparse');var Redis=require(_0x0fd8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0fd8('0x12'));var as=require(_0x0fd8('0x13'));var hardwareService=require(_0x0fd8('0x14'));var logger=require('../../config/logger')(_0x0fd8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0fd8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d32f1,_0x3ffc7a){_0x3ffc7a=_0x3ffc7a||0xcc;return function(_0x2a3096){if(_0x2a3096){return _0x5d32f1[_0x0fd8('0x17')](_0x3ffc7a);}return _0x5d32f1[_0x0fd8('0x18')](_0x3ffc7a)['end']();};}function respondWithResult(_0x54968e,_0x4f077c){_0x4f077c=_0x4f077c||0xc8;return function(_0x55ce3f){if(_0x55ce3f){return _0x54968e['status'](_0x4f077c)[_0x0fd8('0x19')](_0x55ce3f);}};}function respondWithFilteredResult(_0x1fbf66,_0x3ba1c3){return function(_0x5af4d6){if(_0x5af4d6){var _0x1c4581=typeof _0x3ba1c3[_0x0fd8('0x1a')]===_0x0fd8('0x1b')&&typeof _0x3ba1c3[_0x0fd8('0x1c')]===_0x0fd8('0x1b');var _0xdfc034=_0x5af4d6['count'];var _0xb79607=_0x1c4581?0x0:_0x3ba1c3[_0x0fd8('0x1a')];var _0x5d0f98=_0x1c4581?_0x5af4d6[_0x0fd8('0x1d')]:_0x3ba1c3[_0x0fd8('0x1a')]+_0x3ba1c3[_0x0fd8('0x1c')];var _0x25880c;if(_0x5d0f98>=_0xdfc034){_0x5d0f98=_0xdfc034;_0x25880c=0xc8;}else{_0x25880c=0xce;}_0x1fbf66[_0x0fd8('0x18')](_0x25880c);return _0x1fbf66[_0x0fd8('0x1e')](_0x0fd8('0x1f'),_0xb79607+'-'+_0x5d0f98+'/'+_0xdfc034)[_0x0fd8('0x19')](_0x5af4d6);}return null;};}function patchUpdates(_0x3b7ec7){return function(_0x17278c){try{jsonpatch[_0x0fd8('0x20')](_0x17278c,_0x3b7ec7,!![]);}catch(_0xcb4d14){return BPromise[_0x0fd8('0x21')](_0xcb4d14);}return _0x17278c['save']();};}function saveUpdates(_0x174cf4,_0x22c58e){return function(_0x522e7e){if(_0x522e7e){return _0x522e7e[_0x0fd8('0x22')](_0x174cf4)[_0x0fd8('0x23')](function(_0x562deb){return _0x562deb;});}return null;};}function removeEntity(_0x2f81be,_0x169537){return function(_0x1baa37){if(_0x1baa37){return _0x1baa37[_0x0fd8('0x24')]()[_0x0fd8('0x23')](function(){_0x2f81be[_0x0fd8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e697,_0x183b30){return function(_0x45a67a){if(!_0x45a67a){_0x52e697[_0x0fd8('0x17')](0x194);}return _0x45a67a;};}function handleError(_0xd97ac2,_0x3a6baa){_0x3a6baa=_0x3a6baa||0x1f4;return function(_0x37da65){logger['error'](_0x37da65['stack']);if(_0x37da65['name']){delete _0x37da65[_0x0fd8('0x25')];}_0xd97ac2['status'](_0x3a6baa)[_0x0fd8('0x26')](_0x37da65);};}exports[_0x0fd8('0x27')]=function(_0x220df4,_0x253c1d){var _0x12bf96={},_0x2606fa={},_0x38fd6a={'count':0x0,'rows':[]};var _0x25f205=_[_0x0fd8('0x28')](db[_0x0fd8('0x29')][_0x0fd8('0x2a')],function(_0x189a64){return{'name':_0x189a64['fieldName'],'type':_0x189a64[_0x0fd8('0x2b')]['key']};});_0x2606fa['model']=_[_0x0fd8('0x28')](_0x25f205,_0x0fd8('0x25'));_0x2606fa[_0x0fd8('0x2c')]=_[_0x0fd8('0x2d')](_0x220df4[_0x0fd8('0x2c')]);_0x2606fa['filters']=_['intersection'](_0x2606fa[_0x0fd8('0x2e')],_0x2606fa[_0x0fd8('0x2c')]);_0x12bf96['attributes']=_[_0x0fd8('0x2f')](_0x2606fa[_0x0fd8('0x2e')],qs[_0x0fd8('0x30')](_0x220df4[_0x0fd8('0x2c')][_0x0fd8('0x30')]));_0x12bf96[_0x0fd8('0x31')]=_0x12bf96[_0x0fd8('0x31')][_0x0fd8('0x32')]?_0x12bf96[_0x0fd8('0x31')]:_0x2606fa[_0x0fd8('0x2e')];if(!_0x220df4[_0x0fd8('0x2c')][_0x0fd8('0x33')](_0x0fd8('0x34'))){_0x12bf96[_0x0fd8('0x1c')]=qs['limit'](_0x220df4[_0x0fd8('0x2c')][_0x0fd8('0x1c')]);_0x12bf96[_0x0fd8('0x1a')]=qs[_0x0fd8('0x1a')](_0x220df4[_0x0fd8('0x2c')][_0x0fd8('0x1a')]);}_0x12bf96[_0x0fd8('0x35')]=qs['sort'](_0x220df4[_0x0fd8('0x2c')]['sort']);_0x12bf96[_0x0fd8('0x36')]=qs['filters'](_['pick'](_0x220df4[_0x0fd8('0x2c')],_0x2606fa[_0x0fd8('0x37')]),_0x25f205);if(_0x220df4['query'][_0x0fd8('0x38')]){_0x12bf96[_0x0fd8('0x36')]=_['merge'](_0x12bf96[_0x0fd8('0x36')],{'$or':_[_0x0fd8('0x28')](_0x25f205,function(_0x5c2210){if(_0x5c2210[_0x0fd8('0x2b')]!==_0x0fd8('0x39')){var _0x49af98={};_0x49af98[_0x5c2210['name']]={'$like':'%'+_0x220df4['query']['filter']+'%'};return _0x49af98;}})});}_0x12bf96=_[_0x0fd8('0x3a')]({},_0x12bf96,_0x220df4[_0x0fd8('0x3b')]);var _0x5cbe27={'where':_0x12bf96[_0x0fd8('0x36')]};return db[_0x0fd8('0x29')][_0x0fd8('0x1d')](_0x5cbe27)[_0x0fd8('0x23')](function(_0x54490b){_0x38fd6a[_0x0fd8('0x1d')]=_0x54490b;if(_0x220df4['query'][_0x0fd8('0x3c')]){_0x12bf96[_0x0fd8('0x3d')]=[{'all':!![]}];}return db[_0x0fd8('0x29')][_0x0fd8('0x3e')](_0x12bf96);})[_0x0fd8('0x23')](function(_0x3ea181){_0x38fd6a[_0x0fd8('0x3f')]=_0x3ea181;return _0x38fd6a;})[_0x0fd8('0x23')](respondWithFilteredResult(_0x253c1d,_0x12bf96))['catch'](handleError(_0x253c1d,null));};exports[_0x0fd8('0x40')]=function(_0x30b8b8,_0x257199){var _0x22778f={'raw':!![],'where':{'id':_0x30b8b8[_0x0fd8('0x41')]['id']}},_0x443e79={};_0x443e79[_0x0fd8('0x2e')]=_[_0x0fd8('0x2d')](db[_0x0fd8('0x29')][_0x0fd8('0x2a')]);_0x443e79[_0x0fd8('0x2c')]=_[_0x0fd8('0x2d')](_0x30b8b8[_0x0fd8('0x2c')]);_0x443e79[_0x0fd8('0x37')]=_[_0x0fd8('0x2f')](_0x443e79[_0x0fd8('0x2e')],_0x443e79[_0x0fd8('0x2c')]);_0x22778f[_0x0fd8('0x31')]=_[_0x0fd8('0x2f')](_0x443e79[_0x0fd8('0x2e')],qs['fields'](_0x30b8b8[_0x0fd8('0x2c')][_0x0fd8('0x30')]));_0x22778f[_0x0fd8('0x31')]=_0x22778f['attributes'][_0x0fd8('0x32')]?_0x22778f[_0x0fd8('0x31')]:_0x443e79[_0x0fd8('0x2e')];if(_0x30b8b8[_0x0fd8('0x2c')][_0x0fd8('0x3c')]){_0x22778f[_0x0fd8('0x3d')]=[{'all':!![]}];}_0x22778f=_['merge']({},_0x22778f,_0x30b8b8['options']);return db['VoiceTransferReport'][_0x0fd8('0x42')](_0x22778f)[_0x0fd8('0x23')](handleEntityNotFound(_0x257199,null))[_0x0fd8('0x23')](respondWithResult(_0x257199,null))[_0x0fd8('0x43')](handleError(_0x257199,null));};exports['create']=function(_0x2935e8,_0x218ec2){return db[_0x0fd8('0x29')][_0x0fd8('0x44')](_0x2935e8[_0x0fd8('0x45')],{})[_0x0fd8('0x23')](respondWithResult(_0x218ec2,0xc9))['catch'](handleError(_0x218ec2,null));};exports[_0x0fd8('0x22')]=function(_0x3407fd,_0x1e2931){if(_0x3407fd[_0x0fd8('0x45')]['id']){delete _0x3407fd[_0x0fd8('0x45')]['id'];}return db[_0x0fd8('0x29')]['find']({'where':{'id':_0x3407fd['params']['id']}})[_0x0fd8('0x23')](handleEntityNotFound(_0x1e2931,null))[_0x0fd8('0x23')](saveUpdates(_0x3407fd[_0x0fd8('0x45')],null))[_0x0fd8('0x23')](respondWithResult(_0x1e2931,null))[_0x0fd8('0x43')](handleError(_0x1e2931,null));};exports['destroy']=function(_0x5ef1fa,_0x45bcc5){return db[_0x0fd8('0x29')]['find']({'where':{'id':_0x5ef1fa[_0x0fd8('0x41')]['id']}})['then'](handleEntityNotFound(_0x45bcc5,null))['then'](removeEntity(_0x45bcc5,null))[_0x0fd8('0x43')](handleError(_0x45bcc5,null));};exports[_0x0fd8('0x46')]=function(_0x3c457a,_0x59a4d7){return db['VoiceTransferReport'][_0x0fd8('0x46')]()['then'](respondWithResult(_0x59a4d7,null))[_0x0fd8('0x43')](handleError(_0x59a4d7,null));}; \ No newline at end of file +var _0x63dd=['model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','catch','show','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','error','name','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0x304bd5,_0xea943d){var _0x2bcd87=function(_0x53d3c5){while(--_0x53d3c5){_0x304bd5['push'](_0x304bd5['shift']());}};_0x2bcd87(++_0xea943d);}(_0x63dd,0x64));var _0xd63d=function(_0x35f7c8,_0x4808eb){_0x35f7c8=_0x35f7c8-0x0;var _0x30bda5=_0x63dd[_0x35f7c8];return _0x30bda5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd63d('0x0'));var zipdir=require(_0xd63d('0x1'));var jsonpatch=require(_0xd63d('0x2'));var rp=require(_0xd63d('0x3'));var moment=require(_0xd63d('0x4'));var BPromise=require(_0xd63d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd63d('0x6'));var csv=require(_0xd63d('0x7'));var ejs=require(_0xd63d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd63d('0x9'));var squel=require(_0xd63d('0xa'));var crypto=require(_0xd63d('0xb'));var jsforce=require(_0xd63d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd63d('0x7'));var querystring=require('querystring');var Papa=require(_0xd63d('0xd'));var Redis=require(_0xd63d('0xe'));var authService=require(_0xd63d('0xf'));var qs=require(_0xd63d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd63d('0x11'));var logger=require(_0xd63d('0x12'))(_0xd63d('0x13'));var utils=require(_0xd63d('0x14'));var config=require(_0xd63d('0x15'));var licenseUtil=require(_0xd63d('0x16'));var db=require(_0xd63d('0x17'))['db'];function respondWithStatusCode(_0x1c43b9,_0x58ad94){_0x58ad94=_0x58ad94||0xcc;return function(_0x583d44){if(_0x583d44){return _0x1c43b9[_0xd63d('0x18')](_0x58ad94);}return _0x1c43b9[_0xd63d('0x19')](_0x58ad94)[_0xd63d('0x1a')]();};}function respondWithResult(_0x1c3ec3,_0x305132){_0x305132=_0x305132||0xc8;return function(_0x5c8945){if(_0x5c8945){return _0x1c3ec3[_0xd63d('0x19')](_0x305132)['json'](_0x5c8945);}};}function respondWithFilteredResult(_0x2c3214,_0x209afa){return function(_0x22bbcf){if(_0x22bbcf){var _0xd61690=typeof _0x209afa[_0xd63d('0x1b')]==='undefined'&&typeof _0x209afa[_0xd63d('0x1c')]===_0xd63d('0x1d');var _0x5036b6=_0x22bbcf[_0xd63d('0x1e')];var _0x249769=_0xd61690?0x0:_0x209afa['offset'];var _0x369f5b=_0xd61690?_0x22bbcf[_0xd63d('0x1e')]:_0x209afa[_0xd63d('0x1b')]+_0x209afa['limit'];var _0x21107f;if(_0x369f5b>=_0x5036b6){_0x369f5b=_0x5036b6;_0x21107f=0xc8;}else{_0x21107f=0xce;}_0x2c3214[_0xd63d('0x19')](_0x21107f);return _0x2c3214[_0xd63d('0x1f')](_0xd63d('0x20'),_0x249769+'-'+_0x369f5b+'/'+_0x5036b6)[_0xd63d('0x21')](_0x22bbcf);}return null;};}function patchUpdates(_0x3de687){return function(_0x4f0981){try{jsonpatch[_0xd63d('0x22')](_0x4f0981,_0x3de687,!![]);}catch(_0x2d1e2c){return BPromise[_0xd63d('0x23')](_0x2d1e2c);}return _0x4f0981['save']();};}function saveUpdates(_0xfa0ac3,_0x31038d){return function(_0x4eb67b){if(_0x4eb67b){return _0x4eb67b[_0xd63d('0x24')](_0xfa0ac3)['then'](function(_0x287c67){return _0x287c67;});}return null;};}function removeEntity(_0xcbb37,_0x3062e5){return function(_0x1e91d3){if(_0x1e91d3){return _0x1e91d3[_0xd63d('0x25')]()['then'](function(){_0xcbb37['status'](0xcc)[_0xd63d('0x1a')]();});}};}function handleEntityNotFound(_0x49d20f,_0x88cb95){return function(_0x123d4e){if(!_0x123d4e){_0x49d20f['sendStatus'](0x194);}return _0x123d4e;};}function handleError(_0xa31a59,_0x5d69d6){_0x5d69d6=_0x5d69d6||0x1f4;return function(_0x5c1053){logger[_0xd63d('0x26')](_0x5c1053['stack']);if(_0x5c1053[_0xd63d('0x27')]){delete _0x5c1053['name'];}_0xa31a59[_0xd63d('0x19')](_0x5d69d6)['send'](_0x5c1053);};}exports['index']=function(_0x5930a6,_0xf80d88){var _0x57934e={},_0x3ff096={},_0x32b5c2={'count':0x0,'rows':[]};var _0x2a99a1=_['map'](db[_0xd63d('0x28')][_0xd63d('0x29')],function(_0x17bd5c){return{'name':_0x17bd5c[_0xd63d('0x2a')],'type':_0x17bd5c[_0xd63d('0x2b')]['key']};});_0x3ff096[_0xd63d('0x2c')]=_[_0xd63d('0x2d')](_0x2a99a1,_0xd63d('0x27'));_0x3ff096[_0xd63d('0x2e')]=_[_0xd63d('0x2f')](_0x5930a6[_0xd63d('0x2e')]);_0x3ff096[_0xd63d('0x30')]=_[_0xd63d('0x31')](_0x3ff096[_0xd63d('0x2c')],_0x3ff096['query']);_0x57934e[_0xd63d('0x32')]=_[_0xd63d('0x31')](_0x3ff096[_0xd63d('0x2c')],qs[_0xd63d('0x33')](_0x5930a6[_0xd63d('0x2e')][_0xd63d('0x33')]));_0x57934e['attributes']=_0x57934e[_0xd63d('0x32')]['length']?_0x57934e[_0xd63d('0x32')]:_0x3ff096[_0xd63d('0x2c')];if(!_0x5930a6[_0xd63d('0x2e')][_0xd63d('0x34')](_0xd63d('0x35'))){_0x57934e[_0xd63d('0x1c')]=qs['limit'](_0x5930a6[_0xd63d('0x2e')][_0xd63d('0x1c')]);_0x57934e['offset']=qs['offset'](_0x5930a6['query'][_0xd63d('0x1b')]);}_0x57934e['order']=qs[_0xd63d('0x36')](_0x5930a6[_0xd63d('0x2e')][_0xd63d('0x36')]);_0x57934e[_0xd63d('0x37')]=qs[_0xd63d('0x30')](_[_0xd63d('0x38')](_0x5930a6[_0xd63d('0x2e')],_0x3ff096[_0xd63d('0x30')]),_0x2a99a1);if(_0x5930a6[_0xd63d('0x2e')]['filter']){_0x57934e[_0xd63d('0x37')]=_[_0xd63d('0x39')](_0x57934e[_0xd63d('0x37')],{'$or':_[_0xd63d('0x2d')](_0x2a99a1,function(_0x1e7cb0){if(_0x1e7cb0[_0xd63d('0x2b')]!==_0xd63d('0x3a')){var _0x5653a7={};_0x5653a7[_0x1e7cb0['name']]={'$like':'%'+_0x5930a6['query'][_0xd63d('0x3b')]+'%'};return _0x5653a7;}})});}_0x57934e=_[_0xd63d('0x39')]({},_0x57934e,_0x5930a6[_0xd63d('0x3c')]);var _0x59a66d={'where':_0x57934e[_0xd63d('0x37')]};return db[_0xd63d('0x28')][_0xd63d('0x1e')](_0x59a66d)[_0xd63d('0x3d')](function(_0x556d3f){_0x32b5c2[_0xd63d('0x1e')]=_0x556d3f;if(_0x5930a6['query'][_0xd63d('0x3e')]){_0x57934e[_0xd63d('0x3f')]=[{'all':!![]}];}return db[_0xd63d('0x28')][_0xd63d('0x40')](_0x57934e);})['then'](function(_0x51718d){_0x32b5c2['rows']=_0x51718d;return _0x32b5c2;})[_0xd63d('0x3d')](respondWithFilteredResult(_0xf80d88,_0x57934e))[_0xd63d('0x41')](handleError(_0xf80d88,null));};exports[_0xd63d('0x42')]=function(_0x23911b,_0x4f8cfe){var _0x2a7ef4={'raw':!![],'where':{'id':_0x23911b[_0xd63d('0x43')]['id']}},_0x552ab5={};_0x552ab5[_0xd63d('0x2c')]=_[_0xd63d('0x2f')](db[_0xd63d('0x28')]['rawAttributes']);_0x552ab5[_0xd63d('0x2e')]=_[_0xd63d('0x2f')](_0x23911b['query']);_0x552ab5[_0xd63d('0x30')]=_[_0xd63d('0x31')](_0x552ab5['model'],_0x552ab5['query']);_0x2a7ef4[_0xd63d('0x32')]=_[_0xd63d('0x31')](_0x552ab5[_0xd63d('0x2c')],qs[_0xd63d('0x33')](_0x23911b[_0xd63d('0x2e')][_0xd63d('0x33')]));_0x2a7ef4[_0xd63d('0x32')]=_0x2a7ef4[_0xd63d('0x32')][_0xd63d('0x44')]?_0x2a7ef4[_0xd63d('0x32')]:_0x552ab5['model'];if(_0x23911b[_0xd63d('0x2e')][_0xd63d('0x3e')]){_0x2a7ef4[_0xd63d('0x3f')]=[{'all':!![]}];}_0x2a7ef4=_[_0xd63d('0x39')]({},_0x2a7ef4,_0x23911b[_0xd63d('0x3c')]);return db[_0xd63d('0x28')][_0xd63d('0x45')](_0x2a7ef4)[_0xd63d('0x3d')](handleEntityNotFound(_0x4f8cfe,null))[_0xd63d('0x3d')](respondWithResult(_0x4f8cfe,null))[_0xd63d('0x41')](handleError(_0x4f8cfe,null));};exports[_0xd63d('0x46')]=function(_0x13173a,_0x6fe759){return db[_0xd63d('0x28')][_0xd63d('0x46')](_0x13173a[_0xd63d('0x47')],{})['then'](respondWithResult(_0x6fe759,0xc9))['catch'](handleError(_0x6fe759,null));};exports[_0xd63d('0x24')]=function(_0x65d567,_0x58bda4){if(_0x65d567[_0xd63d('0x47')]['id']){delete _0x65d567[_0xd63d('0x47')]['id'];}return db['VoiceTransferReport'][_0xd63d('0x45')]({'where':{'id':_0x65d567[_0xd63d('0x43')]['id']}})['then'](handleEntityNotFound(_0x58bda4,null))['then'](saveUpdates(_0x65d567[_0xd63d('0x47')],null))[_0xd63d('0x3d')](respondWithResult(_0x58bda4,null))[_0xd63d('0x41')](handleError(_0x58bda4,null));};exports[_0xd63d('0x25')]=function(_0x5a772d,_0x3539bb){return db[_0xd63d('0x28')][_0xd63d('0x45')]({'where':{'id':_0x5a772d['params']['id']}})[_0xd63d('0x3d')](handleEntityNotFound(_0x3539bb,null))[_0xd63d('0x3d')](removeEntity(_0x3539bb,null))['catch'](handleError(_0x3539bb,null));};exports['describe']=function(_0x29857c,_0x55311a){return db[_0xd63d('0x28')]['describe']()[_0xd63d('0x3d')](respondWithResult(_0x55311a,null))['catch'](handleError(_0x55311a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index f8fbbad..caae7db 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 _0xb8ef=['api','moment','bluebird','path','../../config/environment','exports','define','VoiceTransferReport','lodash','../../config/logger'];(function(_0x1da330,_0x2cbd43){var _0x346efa=function(_0x143cd5){while(--_0x143cd5){_0x1da330['push'](_0x1da330['shift']());}};_0x346efa(++_0x2cbd43);}(_0xb8ef,0xe4));var _0xfb8e=function(_0x2b3080,_0xbd591c){_0x2b3080=_0x2b3080-0x0;var _0x3f8118=_0xb8ef[_0x2b3080];return _0x3f8118;};'use strict';var _=require(_0xfb8e('0x0'));var util=require('util');var logger=require(_0xfb8e('0x1'))(_0xfb8e('0x2'));var moment=require(_0xfb8e('0x3'));var BPromise=require(_0xfb8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb8e('0x5'));var rimraf=require('rimraf');var config=require(_0xfb8e('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xfb8e('0x7')]=function(_0x4b36d9,_0x407e1a){return _0x4b36d9[_0xfb8e('0x8')](_0xfb8e('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ae9=['./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','moment','request-promise','path'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x5ae9,0x70));var _0x95ae=function(_0x435c89,_0x2b6da8){_0x435c89=_0x435c89-0x0;var _0x183449=_0x5ae9[_0x435c89];return _0x183449;};'use strict';var _=require(_0x95ae('0x0'));var util=require(_0x95ae('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x95ae('0x2'));var BPromise=require('bluebird');var rp=require(_0x95ae('0x3'));var fs=require('fs');var path=require(_0x95ae('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95ae('0x5'));module[_0x95ae('0x6')]=function(_0x2a9103,_0x116345){return _0x2a9103[_0x95ae('0x7')]('VoiceTransferReport',attributes,{'tableName':_0x95ae('0x8'),'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 849b4fc..989b1cd 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 _0xf250=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','VoiceTransferReport','create','body','options','raw','stringify','CreateVoiceTransferReport','lodash'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xf250,0xb5));var _0x0f25=function(_0x1e20f4,_0x103413){_0x1e20f4=_0x1e20f4-0x0;var _0x7d34cd=_0xf250[_0x1e20f4];return _0x7d34cd;};'use strict';var _=require(_0x0f25('0x0'));var util=require(_0x0f25('0x1'));var moment=require(_0x0f25('0x2'));var BPromise=require(_0x0f25('0x3'));var rs=require(_0x0f25('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f25('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0f25('0x6'));var config=require(_0x0f25('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0f25('0x8')][_0x0f25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44cbcd,_0x516cf3,_0x4937fa){return new BPromise(function(_0xe35a6c,_0x488890){return client['request'](_0x44cbcd,_0x4937fa)[_0x0f25('0xa')](function(_0x2b06ea){logger[_0x0f25('0xb')](_0x0f25('0xc'),_0x516cf3,'request\x20sent');logger[_0x0f25('0xd')](_0x0f25('0xe'),_0x516cf3,_0x0f25('0xf'),JSON['stringify'](_0x2b06ea));if(_0x2b06ea[_0x0f25('0x10')]){if(_0x2b06ea[_0x0f25('0x10')]['code']===0x1f4){logger['error'](_0x0f25('0xc'),_0x516cf3,_0x2b06ea[_0x0f25('0x10')]['message']);return _0x488890(_0x2b06ea['error'][_0x0f25('0x11')]);}logger[_0x0f25('0x10')](_0x0f25('0xc'),_0x516cf3,_0x2b06ea[_0x0f25('0x10')][_0x0f25('0x11')]);return _0xe35a6c(_0x2b06ea['error'][_0x0f25('0x11')]);}else{logger[_0x0f25('0xb')](_0x0f25('0xc'),_0x516cf3,_0x0f25('0xf'));_0xe35a6c(_0x2b06ea[_0x0f25('0x12')][_0x0f25('0x11')]);}})['catch'](function(_0x3c38fa){logger['error'](_0x0f25('0xc'),_0x516cf3,_0x3c38fa);_0x488890(_0x3c38fa);});});}exports['CreateVoiceTransferReport']=function(_0x25fca8){var _0x35a81c=this;return new Promise(function(_0x452a51,_0x473632){return db[_0x0f25('0x13')][_0x0f25('0x14')](_0x25fca8[_0x0f25('0x15')],{'raw':_0x25fca8['options']?_0x25fca8[_0x0f25('0x16')][_0x0f25('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4de6b0){logger[_0x0f25('0xb')]('CreateVoiceTransferReport',_0x25fca8);logger['debug']('CreateVoiceTransferReport',_0x25fca8,JSON[_0x0f25('0x18')](_0x4de6b0));_0x452a51(_0x4de6b0);})['catch'](function(_0x20e318){logger[_0x0f25('0x10')](_0x0f25('0x19'),_0x20e318[_0x0f25('0x11')],_0x25fca8);_0x473632(_0x35a81c['error'](0x1f4,_0x20e318[_0x0f25('0x11')]));});});}; \ No newline at end of file +var _0xa939=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','create','body','options','raw','CreateVoiceTransferReport','lodash','util'];(function(_0x21d253,_0xb2d0e6){var _0x2be880=function(_0x1cb26b){while(--_0x1cb26b){_0x21d253['push'](_0x21d253['shift']());}};_0x2be880(++_0xb2d0e6);}(_0xa939,0x142));var _0x9a93=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xa939[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x9a93('0x0'));var util=require(_0x9a93('0x1'));var moment=require(_0x9a93('0x2'));var BPromise=require(_0x9a93('0x3'));var rs=require(_0x9a93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a93('0x5'))['db'];var utils=require(_0x9a93('0x6'));var logger=require(_0x9a93('0x7'))('rpc');var config=require(_0x9a93('0x8'));var jayson=require(_0x9a93('0x9'));var client=jayson[_0x9a93('0xa')][_0x9a93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a5e8e,_0x186ebf,_0x2e5999){return new BPromise(function(_0x2ee4ae,_0x252778){return client[_0x9a93('0xc')](_0x4a5e8e,_0x2e5999)['then'](function(_0x234d66){logger[_0x9a93('0xd')](_0x9a93('0xe'),_0x186ebf,_0x9a93('0xf'));logger[_0x9a93('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x186ebf,_0x9a93('0xf'),JSON[_0x9a93('0x11')](_0x234d66));if(_0x234d66['error']){if(_0x234d66['error']['code']===0x1f4){logger[_0x9a93('0x12')](_0x9a93('0xe'),_0x186ebf,_0x234d66[_0x9a93('0x12')][_0x9a93('0x13')]);return _0x252778(_0x234d66['error'][_0x9a93('0x13')]);}logger[_0x9a93('0x12')](_0x9a93('0xe'),_0x186ebf,_0x234d66['error'][_0x9a93('0x13')]);return _0x2ee4ae(_0x234d66[_0x9a93('0x12')][_0x9a93('0x13')]);}else{logger[_0x9a93('0xd')](_0x9a93('0xe'),_0x186ebf,_0x9a93('0xf'));_0x2ee4ae(_0x234d66[_0x9a93('0x14')][_0x9a93('0x13')]);}})[_0x9a93('0x15')](function(_0x4b8ae9){logger['error'](_0x9a93('0xe'),_0x186ebf,_0x4b8ae9);_0x252778(_0x4b8ae9);});});}exports['CreateVoiceTransferReport']=function(_0x58a247){var _0xa6205f=this;return new Promise(function(_0x30f9f7,_0xe18bcf){return db['VoiceTransferReport'][_0x9a93('0x16')](_0x58a247[_0x9a93('0x17')],{'raw':_0x58a247['options']?_0x58a247[_0x9a93('0x18')][_0x9a93('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2c28be){logger[_0x9a93('0xd')](_0x9a93('0x1a'),_0x58a247);logger[_0x9a93('0x10')](_0x9a93('0x1a'),_0x58a247,JSON['stringify'](_0x2c28be));_0x30f9f7(_0x2c28be);})[_0x9a93('0x15')](function(_0x43a8b7){logger[_0x9a93('0x12')](_0x9a93('0x1a'),_0x43a8b7[_0x9a93('0x13')],_0x58a247);_0xe18bcf(_0xa6205f[_0x9a93('0x12')](0x1f4,_0x43a8b7['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 733c4e8..e875380 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 _0x153f=['hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','isWebrtcLicence','hangup','answer','/hold'];(function(_0x34299a,_0x1608d5){var _0x52b00d=function(_0x4b5bf5){while(--_0x4b5bf5){_0x34299a['push'](_0x34299a['shift']());}};_0x52b00d(++_0x1608d5);}(_0x153f,0x15b));var _0xf153=function(_0x4e7277,_0x7fa76f){_0x4e7277=_0x4e7277-0x0;var _0x298e3=_0x153f[_0x4e7277];return _0x298e3;};'use strict';var express=require(_0xf153('0x0'));var router=express[_0xf153('0x1')]();var auth=require(_0xf153('0x2'));var controller=require(_0xf153('0x3'));router[_0xf153('0x4')](_0xf153('0x5'),auth[_0xf153('0x6')](),auth['isWebrtcLicence'](),controller[_0xf153('0x7')]);router['post'](_0xf153('0x8'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x4')]('/answer',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xb')]);router[_0xf153('0x4')](_0xf153('0xc'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xd')]);router[_0xf153('0x4')](_0xf153('0xe'),auth['isAuthenticated'](),auth[_0xf153('0x9')](),controller[_0xf153('0xf')]);router[_0xf153('0x4')]('/calls',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x4')](_0xf153('0x11'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x4f265e,_0x54e4d4){var _0x2a9598=function(_0x3d76e1){while(--_0x3d76e1){_0x4f265e['push'](_0x4f265e['shift']());}};_0x2a9598(++_0x54e4d4);}(_0x5b02,0xe9));var _0x25b0=function(_0x4127c2,_0x92947f){_0x4127c2=_0x4127c2-0x0;var _0x21a2a0=_0x5b02[_0x4127c2];return _0x21a2a0;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index cb7e23d..e546915 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 _0x4b1f=['originate','info','originate\x20fired:','body','validate','userId','callNumber','callerId','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','json','hangup\x20executed!','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transferNumber','webbar:transfer','path','lodash','../../config/environment','util','bluebird','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','callNumber\x20is\x20required','number','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','result','catch','User','agent','all','UserId','sessionId','length','sessionId\x20'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b1f,0x195));var _0xf4b1=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x4b1f[_0x1b6186];return _0x186121;};'use strict';var path=require(_0xf4b1('0x0'));var fs=require('fs');var _=require(_0xf4b1('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xf4b1('0x2'));var util=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xf4b1('0x5')][_0xf4b1('0x6')]({'port':0x232a});var logger=require(_0xf4b1('0x7'))('webbarapi');var Redis=require('ioredis');config[_0xf4b1('0x8')]=_[_0xf4b1('0x9')](config[_0xf4b1('0x8')],{'host':_0xf4b1('0xa'),'port':0x18eb});var io=require(_0xf4b1('0xb'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4b1('0xc')]},'callNumber':{'type':'string','required':[!![],_0xf4b1('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],_0xf4b1('0xc')]},'sessionId':{'type':_0xf4b1('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],_0xf4b1('0xc')]},'sessionId':{'type':_0xf4b1('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],_0xf4b1('0xc')]},'sessionId':{'type':_0xf4b1('0xf'),'required':[!![],_0xf4b1('0x10')]},'transferNumber':{'type':_0xf4b1('0xf'),'required':[!![],_0xf4b1('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4b1('0xc')]}});function emit(_0x4968f4,_0x5e7206,_0x554517){logger['info'](_0x4968f4,_0x5e7206,JSON[_0xf4b1('0x12')](_0x554517));io['to'](_0x4968f4)[_0xf4b1('0x13')](_0x5e7206,_0x554517);}function handleError(_0x534fd8){return function(_0x3b378e){console[_0xf4b1('0x14')](_0xf4b1('0x15'),_0x3b378e,_0x3b378e instanceof RangeError);logger[_0xf4b1('0x16')](_0x3b378e[_0xf4b1('0x17')]);if(_0x3b378e instanceof RangeError){if(_0x3b378e[_0xf4b1('0x18')]){delete _0x3b378e['name'];}_0x534fd8[_0xf4b1('0x19')](0x194)[_0xf4b1('0x1a')](_0x3b378e);}else{if(_0x3b378e['name']){delete _0x3b378e[_0xf4b1('0x18')];}_0x534fd8[_0xf4b1('0x19')](0x1f4)['send'](_0x3b378e);}};}function checkError(){return function(_0x13892d){if(!_0x13892d){throw new RangeError(_0xf4b1('0x1b'));}return _0x13892d;};}function respondWithRpcPromise(_0xbfab1e,_0x466739){return new BPromise(function(_0x5c50e8,_0x20013c){var _0x29b8c1=amiClient;return _0x29b8c1[_0xf4b1('0x1c')](_0xbfab1e,_0x466739)[_0xf4b1('0x1d')](function(_0x58376d){if(_0x58376d[_0xf4b1('0x16')]){if(_0x58376d[_0xf4b1('0x16')]['code']===0x1f4){return _0x20013c(_0x58376d[_0xf4b1('0x16')]['message']);}return _0x5c50e8(_0x58376d[_0xf4b1('0x16')]['message']);}else{_0x5c50e8(_0x58376d[_0xf4b1('0x1e')]);}})[_0xf4b1('0x1f')](function(_0x2e803d){_0x20013c(_0x2e803d);});});}function getAgent(_0x5a0285){return db[_0xf4b1('0x20')]['findOne']({'where':{'id':_0x5a0285,'role':_0xf4b1('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x29493b,_0x447ae7){return new BPromise(function(_0x5d28af,_0x22353e){var _0x23693b=respondWithRpcPromise('VoiceChannels');var _0x125bf4=getAgent(_0x29493b);Promise[_0xf4b1('0x22')]([_0x23693b,_0x125bf4])[_0xf4b1('0x1d')](function(_0x11ffb3){var _0x3046dc=_0x11ffb3[0x0];var _0x36243e=_0x11ffb3[0x1];var _0x2f830c=_['filter'](_0x3046dc['rows'],function(_0x31c13c){return _0x31c13c[_0xf4b1('0x23')]==_0x36243e['id']&&_0x31c13c[_0xf4b1('0x24')]==_0x447ae7;});if(_0x2f830c[_0xf4b1('0x25')]==0x1){_0x5d28af(_0x36243e);}else{_0x22353e(new RangeError(_0xf4b1('0x26')+_0x447ae7+'\x20not\x20found!'));}});});}exports[_0xf4b1('0x27')]=function(_0xa08452,_0xa6bdd7){logger[_0xf4b1('0x28')](_0xf4b1('0x29'),_0xa08452[_0xf4b1('0x2a')]);var _0x186dd3=originateValidation[_0xf4b1('0x2b')](_0xa08452['body']);if(_0x186dd3[_0xf4b1('0x25')]>0x0){return _0xa6bdd7['status'](0x190)['json'](_0x186dd3);}var _0x48f672=_0xa08452[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x75f753=_0xa08452[_0xf4b1('0x2a')][_0xf4b1('0x2d')];var _0x2ddbc8=_0xa08452[_0xf4b1('0x2a')][_0xf4b1('0x2e')];var _0x55a5a6=_0xa08452[_0xf4b1('0x2a')]['callbackUrl'];return getAgent(_0x48f672)[_0xf4b1('0x1d')](function(_0x303290){logger['info'](_0xf4b1('0x2f'),_0x303290[_0xf4b1('0x18')]);emit(util[_0xf4b1('0x30')](_0xf4b1('0x31'),_0x303290[_0xf4b1('0x18')]),'webbar:originate',{'callNumber':_0x75f753,'callerId':_0x2ddbc8,'callbackUrl':_0x55a5a6});return _0xa6bdd7[_0xf4b1('0x19')](0xc8)['json']({'error':![],'message':_0xf4b1('0x32')});})['catch'](handleError(_0xa6bdd7));};exports[_0xf4b1('0x33')]=function(_0x366621,_0xfe587f){logger['info'](_0xf4b1('0x34'),_0x366621[_0xf4b1('0x2a')]);var _0x207020=hangupValidation[_0xf4b1('0x2b')](_0x366621[_0xf4b1('0x2a')]);if(_0x207020[_0xf4b1('0x25')]>0x0){return _0xfe587f[_0xf4b1('0x19')](0x190)['json'](_0x207020);}var _0x393da0=_0x366621[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x3553c3=_0x366621[_0xf4b1('0x2a')][_0xf4b1('0x24')];return getAgent(_0x393da0)['then'](function(_0x33879b){logger[_0xf4b1('0x28')]('entityFound:',_0x33879b['name']);emit(util[_0xf4b1('0x30')](_0xf4b1('0x31'),_0x33879b[_0xf4b1('0x18')]),_0xf4b1('0x35'),{'sessionId':_0x3553c3});return _0xfe587f[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x37')});})[_0xf4b1('0x1f')](handleError(_0xfe587f));};exports['answer']=function(_0x3a4383,_0x5e9da4){logger['info']('answer\x20fired:',_0x3a4383[_0xf4b1('0x2a')]);var _0x3feed5=answerValidation[_0xf4b1('0x2b')](_0x3a4383['body']);if(_0x3feed5[_0xf4b1('0x25')]>0x0){return _0x5e9da4[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x3feed5);}var _0x5597d5=_0x3a4383[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x1f856c=_0x3a4383['body'][_0xf4b1('0x24')];return getAgent(_0x5597d5)['then'](function(_0x2e4f2a){logger[_0xf4b1('0x28')](_0xf4b1('0x2f'),_0x2e4f2a['name']);emit(util[_0xf4b1('0x30')](_0xf4b1('0x31'),_0x2e4f2a['name']),_0xf4b1('0x38'),{'sessionId':_0x1f856c});return _0x5e9da4[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x39')});})['catch'](handleError(_0x5e9da4));};exports['hold']=function(_0x14cdc6,_0x1638a6){logger['info'](_0xf4b1('0x3a'),_0x14cdc6['body']);var _0x202381=holdValidation['validate'](_0x14cdc6[_0xf4b1('0x2a')]);if(_0x202381[_0xf4b1('0x25')]>0x0){return _0x1638a6['status'](0x190)[_0xf4b1('0x36')](_0x202381);}var _0x104819=_0x14cdc6[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x2f4c27=_0x14cdc6[_0xf4b1('0x2a')][_0xf4b1('0x24')];return getAgent(_0x104819)[_0xf4b1('0x1d')](function(_0x4e6e04){logger['info'](_0xf4b1('0x2f'),_0x4e6e04[_0xf4b1('0x18')]);emit(util['format'](_0xf4b1('0x31'),_0x4e6e04[_0xf4b1('0x18')]),_0xf4b1('0x3b'),{'sessionId':_0x2f4c27});return _0x1638a6[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x3c')});})[_0xf4b1('0x1f')](handleError(_0x1638a6));};exports[_0xf4b1('0x3d')]=function(_0x29c3c1,_0x2bca13){logger[_0xf4b1('0x28')](_0xf4b1('0x3e'),_0x29c3c1[_0xf4b1('0x2a')]);var _0x1bf70f=unholdValidation[_0xf4b1('0x2b')](_0x29c3c1[_0xf4b1('0x2a')]);if(_0x1bf70f[_0xf4b1('0x25')]>0x0){return _0x2bca13[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x1bf70f);}var _0x3a1362=_0x29c3c1[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x38efcd=_0x29c3c1[_0xf4b1('0x2a')][_0xf4b1('0x24')];return getAgent(_0x3a1362)[_0xf4b1('0x1d')](function(_0x755ecb){logger[_0xf4b1('0x28')]('entityFound:',_0x755ecb[_0xf4b1('0x18')]);emit(util['format']('user:%s',_0x755ecb[_0xf4b1('0x18')]),_0xf4b1('0x3f'),{'sessionId':_0x38efcd});return _0x2bca13['status'](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x40')});})[_0xf4b1('0x1f')](handleError(_0x2bca13));};exports['calls']=function(_0x59b8e8,_0x1fc659){logger[_0xf4b1('0x28')](_0xf4b1('0x41'),_0x1fc659[_0xf4b1('0x2a')]);var _0x402e6c=callsValidation[_0xf4b1('0x2b')](_0x59b8e8[_0xf4b1('0x2a')]);if(_0x402e6c[_0xf4b1('0x25')]>0x0){return _0x1fc659[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x402e6c);}var _0x1fec6d=_0x59b8e8[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x24d0a6=respondWithRpcPromise('VoiceChannels');var _0x193bab=getAgent(_0x1fec6d);return Promise[_0xf4b1('0x22')]([_0x24d0a6,_0x193bab])[_0xf4b1('0x1d')](function(_0x427126){var _0xb53593=_0x427126[0x0];var _0x43d373=_0x427126[0x1];var _0xe7b6a3=_[_0xf4b1('0x42')](_0xb53593[_0xf4b1('0x43')],function(_0x47abe5){return _0x47abe5[_0xf4b1('0x23')]==_0x43d373['id'];});return _0x1fc659[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'count':_0xe7b6a3['length'],'rows':_0xe7b6a3});})['catch'](handleError(_0x1fc659));};exports[_0xf4b1('0x44')]=function(_0x1cc591,_0x4db29b){logger[_0xf4b1('0x28')](_0xf4b1('0x45'),_0x1cc591[_0xf4b1('0x2a')]);var _0x22d27f=conferenceValidation[_0xf4b1('0x2b')](_0x1cc591[_0xf4b1('0x2a')]);if(_0x22d27f[_0xf4b1('0x25')]>0x0){return _0x4db29b[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x22d27f);}var _0x36cf63=_0x1cc591[_0xf4b1('0x2a')]['userId'];return getAgent(_0x36cf63)[_0xf4b1('0x1d')](function(_0x350d07){logger['info'](_0xf4b1('0x2f'),_0x350d07[_0xf4b1('0x18')]);emit(util[_0xf4b1('0x30')]('user:%s',_0x350d07[_0xf4b1('0x18')]),_0xf4b1('0x46'));return _0x4db29b['status'](0xc8)['json']({'error':![],'message':_0xf4b1('0x47')});})['catch'](handleError(_0x4db29b));};exports['transfer']=function(_0x2de44d,_0x844121){logger['info']('transfer\x20fired:',_0x2de44d[_0xf4b1('0x2a')]);var _0x17eb9e=transferValidation['validate'](_0x2de44d[_0xf4b1('0x2a')]);if(_0x17eb9e[_0xf4b1('0x25')]>0x0){return _0x844121[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x17eb9e);}var _0xe82df1=_0x2de44d[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x55341b=_0x2de44d[_0xf4b1('0x2a')][_0xf4b1('0x24')];var _0xca5281=_0x2de44d[_0xf4b1('0x2a')][_0xf4b1('0x48')];return getAgent(_0xe82df1)[_0xf4b1('0x1d')](function(_0xe9ac5){logger['info']('entityFound:',_0xe9ac5[_0xf4b1('0x18')]);emit(util[_0xf4b1('0x30')]('user:%s',_0xe9ac5[_0xf4b1('0x18')]),_0xf4b1('0x49'),{'sessionId':_0x55341b,'transferNumber':_0xca5281});return _0x844121[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':'transfer\x20executed!'});})[_0xf4b1('0x1f')](handleError(_0x844121));}; \ No newline at end of file +var _0xb248=['VoiceChannels','all','filter','rows','sessionId','length','sessionId\x20','info','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','client','http','webbarapi','ioredis','defaults','redis','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','emit','log','error','name','status','send','request','then','code','message','result','catch','User','findOne','agent'];(function(_0x57b659,_0x38a651){var _0x582dc9=function(_0x2f487c){while(--_0x2f487c){_0x57b659['push'](_0x57b659['shift']());}};_0x582dc9(++_0x38a651);}(_0xb248,0xc6));var _0x8b24=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb248[_0x2d7f0e];return _0x110b07;};'use strict';var path=require(_0x8b24('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x8b24('0x1'))['db'];var config=require(_0x8b24('0x2'));var util=require(_0x8b24('0x3'));var BPromise=require(_0x8b24('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x8b24('0x5')][_0x8b24('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x8b24('0x7'));var Redis=require(_0x8b24('0x8'));config['redis']=_[_0x8b24('0x9')](config[_0x8b24('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x8b24('0xb'))(new Redis(config['redis']));var Schema=require(_0x8b24('0xc'));var originateValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],_0x8b24('0xe')]},'callNumber':{'type':'string','required':[!![],_0x8b24('0xf')]},'callerId':{'type':_0x8b24('0x10')},'callbackUrl':{'type':_0x8b24('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],_0x8b24('0xe')]},'sessionId':{'type':_0x8b24('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],_0x8b24('0xe')]},'sessionId':{'type':_0x8b24('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],_0x8b24('0xe')]},'sessionId':{'type':_0x8b24('0x10'),'required':[!![],_0x8b24('0x11')]},'transferNumber':{'type':_0x8b24('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8b24('0xe')]},'sessionId':{'type':_0x8b24('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],_0x8b24('0xe')]},'sessionId':{'type':_0x8b24('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],_0x8b24('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x8b24('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x5a5745,_0x552a28,_0xfe489b){logger['info'](_0x5a5745,_0x552a28,JSON['stringify'](_0xfe489b));io['to'](_0x5a5745)[_0x8b24('0x12')](_0x552a28,_0xfe489b);}function handleError(_0x1d7722){return function(_0x527af7){console[_0x8b24('0x13')]('handleError:',_0x527af7,_0x527af7 instanceof RangeError);logger[_0x8b24('0x14')](_0x527af7['stack']);if(_0x527af7 instanceof RangeError){if(_0x527af7[_0x8b24('0x15')]){delete _0x527af7['name'];}_0x1d7722[_0x8b24('0x16')](0x194)[_0x8b24('0x17')](_0x527af7);}else{if(_0x527af7[_0x8b24('0x15')]){delete _0x527af7[_0x8b24('0x15')];}_0x1d7722[_0x8b24('0x16')](0x1f4)[_0x8b24('0x17')](_0x527af7);}};}function checkError(){return function(_0x2f62b3){if(!_0x2f62b3){throw new RangeError('NotFound');}return _0x2f62b3;};}function respondWithRpcPromise(_0x265879,_0x237d62){return new BPromise(function(_0x4fff3c,_0xd9b96){var _0x13dd68=amiClient;return _0x13dd68[_0x8b24('0x18')](_0x265879,_0x237d62)[_0x8b24('0x19')](function(_0x12a9f4){if(_0x12a9f4[_0x8b24('0x14')]){if(_0x12a9f4[_0x8b24('0x14')][_0x8b24('0x1a')]===0x1f4){return _0xd9b96(_0x12a9f4[_0x8b24('0x14')][_0x8b24('0x1b')]);}return _0x4fff3c(_0x12a9f4[_0x8b24('0x14')][_0x8b24('0x1b')]);}else{_0x4fff3c(_0x12a9f4[_0x8b24('0x1c')]);}})[_0x8b24('0x1d')](function(_0x19600a){_0xd9b96(_0x19600a);});});}function getAgent(_0x35d496){return db[_0x8b24('0x1e')][_0x8b24('0x1f')]({'where':{'id':_0x35d496,'role':_0x8b24('0x20')}})[_0x8b24('0x19')](checkError());}function getAgentCheckSession(_0x1adcb4,_0xa6f06b){return new BPromise(function(_0x2be377,_0x3d4dca){var _0x1934d2=respondWithRpcPromise(_0x8b24('0x21'));var _0x267f1e=getAgent(_0x1adcb4);Promise[_0x8b24('0x22')]([_0x1934d2,_0x267f1e])['then'](function(_0x36ff89){var _0x59d6e1=_0x36ff89[0x0];var _0xadbba0=_0x36ff89[0x1];var _0x14316c=_[_0x8b24('0x23')](_0x59d6e1[_0x8b24('0x24')],function(_0x1ab949){return _0x1ab949['UserId']==_0xadbba0['id']&&_0x1ab949[_0x8b24('0x25')]==_0xa6f06b;});if(_0x14316c[_0x8b24('0x26')]==0x1){_0x2be377(_0xadbba0);}else{_0x3d4dca(new RangeError(_0x8b24('0x27')+_0xa6f06b+'\x20not\x20found!'));}});});}exports['originate']=function(_0x51f4cd,_0x27cc28){logger[_0x8b24('0x28')](_0x8b24('0x29'),_0x51f4cd[_0x8b24('0x2a')]);var _0x1e5910=originateValidation[_0x8b24('0xc')](_0x51f4cd[_0x8b24('0x2a')]);if(_0x1e5910[_0x8b24('0x26')]>0x0){return _0x27cc28[_0x8b24('0x16')](0x190)['json'](_0x1e5910);}var _0x4bfaa0=_0x51f4cd[_0x8b24('0x2a')][_0x8b24('0x2b')];var _0x55f12a=_0x51f4cd[_0x8b24('0x2a')][_0x8b24('0x2c')];var _0xe11487=_0x51f4cd[_0x8b24('0x2a')][_0x8b24('0x2d')];var _0x3fbf90=_0x51f4cd[_0x8b24('0x2a')][_0x8b24('0x2e')];return getAgent(_0x4bfaa0)[_0x8b24('0x19')](function(_0x4e10b3){logger[_0x8b24('0x28')](_0x8b24('0x2f'),_0x4e10b3['name']);emit(util[_0x8b24('0x30')](_0x8b24('0x31'),_0x4e10b3['name']),_0x8b24('0x32'),{'callNumber':_0x55f12a,'callerId':_0xe11487,'callbackUrl':_0x3fbf90});return _0x27cc28[_0x8b24('0x16')](0xc8)[_0x8b24('0x33')]({'error':![],'message':_0x8b24('0x34')});})['catch'](handleError(_0x27cc28));};exports[_0x8b24('0x35')]=function(_0xe7a659,_0x23b4eb){logger[_0x8b24('0x28')](_0x8b24('0x36'),_0xe7a659[_0x8b24('0x2a')]);var _0x52fdb8=hangupValidation[_0x8b24('0xc')](_0xe7a659[_0x8b24('0x2a')]);if(_0x52fdb8[_0x8b24('0x26')]>0x0){return _0x23b4eb[_0x8b24('0x16')](0x190)[_0x8b24('0x33')](_0x52fdb8);}var _0x3405b2=_0xe7a659[_0x8b24('0x2a')][_0x8b24('0x2b')];var _0x2f9ea5=_0xe7a659[_0x8b24('0x2a')][_0x8b24('0x25')];return getAgent(_0x3405b2)['then'](function(_0x1d319e){logger['info'](_0x8b24('0x2f'),_0x1d319e[_0x8b24('0x15')]);emit(util[_0x8b24('0x30')]('user:%s',_0x1d319e[_0x8b24('0x15')]),_0x8b24('0x37'),{'sessionId':_0x2f9ea5});return _0x23b4eb[_0x8b24('0x16')](0xc8)['json']({'error':![],'message':_0x8b24('0x38')});})['catch'](handleError(_0x23b4eb));};exports['answer']=function(_0xa34e41,_0x5ce1c1){logger['info'](_0x8b24('0x39'),_0xa34e41[_0x8b24('0x2a')]);var _0x3ee117=answerValidation[_0x8b24('0xc')](_0xa34e41[_0x8b24('0x2a')]);if(_0x3ee117[_0x8b24('0x26')]>0x0){return _0x5ce1c1[_0x8b24('0x16')](0x190)['json'](_0x3ee117);}var _0x58cd75=_0xa34e41[_0x8b24('0x2a')][_0x8b24('0x2b')];var _0x1752b0=_0xa34e41[_0x8b24('0x2a')]['sessionId'];return getAgent(_0x58cd75)[_0x8b24('0x19')](function(_0x2dd45a){logger[_0x8b24('0x28')]('entityFound:',_0x2dd45a[_0x8b24('0x15')]);emit(util['format'](_0x8b24('0x31'),_0x2dd45a[_0x8b24('0x15')]),'webbar:answer',{'sessionId':_0x1752b0});return _0x5ce1c1[_0x8b24('0x16')](0xc8)[_0x8b24('0x33')]({'error':![],'message':_0x8b24('0x3a')});})[_0x8b24('0x1d')](handleError(_0x5ce1c1));};exports[_0x8b24('0x3b')]=function(_0x60215,_0x120ef0){logger[_0x8b24('0x28')](_0x8b24('0x3c'),_0x60215[_0x8b24('0x2a')]);var _0xc1f95=holdValidation[_0x8b24('0xc')](_0x60215['body']);if(_0xc1f95[_0x8b24('0x26')]>0x0){return _0x120ef0['status'](0x190)[_0x8b24('0x33')](_0xc1f95);}var _0x43cd46=_0x60215['body']['userId'];var _0x303864=_0x60215[_0x8b24('0x2a')][_0x8b24('0x25')];return getAgent(_0x43cd46)[_0x8b24('0x19')](function(_0x407b2f){logger[_0x8b24('0x28')](_0x8b24('0x2f'),_0x407b2f[_0x8b24('0x15')]);emit(util['format']('user:%s',_0x407b2f['name']),_0x8b24('0x3d'),{'sessionId':_0x303864});return _0x120ef0['status'](0xc8)[_0x8b24('0x33')]({'error':![],'message':_0x8b24('0x3e')});})[_0x8b24('0x1d')](handleError(_0x120ef0));};exports[_0x8b24('0x3f')]=function(_0x58a26d,_0x3bc90a){logger[_0x8b24('0x28')](_0x8b24('0x40'),_0x58a26d[_0x8b24('0x2a')]);var _0x3b5c51=unholdValidation[_0x8b24('0xc')](_0x58a26d[_0x8b24('0x2a')]);if(_0x3b5c51[_0x8b24('0x26')]>0x0){return _0x3bc90a[_0x8b24('0x16')](0x190)[_0x8b24('0x33')](_0x3b5c51);}var _0x229377=_0x58a26d[_0x8b24('0x2a')][_0x8b24('0x2b')];var _0x437919=_0x58a26d[_0x8b24('0x2a')][_0x8b24('0x25')];return getAgent(_0x229377)[_0x8b24('0x19')](function(_0x571b84){logger[_0x8b24('0x28')](_0x8b24('0x2f'),_0x571b84[_0x8b24('0x15')]);emit(util[_0x8b24('0x30')]('user:%s',_0x571b84[_0x8b24('0x15')]),_0x8b24('0x41'),{'sessionId':_0x437919});return _0x3bc90a[_0x8b24('0x16')](0xc8)[_0x8b24('0x33')]({'error':![],'message':_0x8b24('0x42')});})[_0x8b24('0x1d')](handleError(_0x3bc90a));};exports[_0x8b24('0x43')]=function(_0x20188b,_0x15b96f){logger[_0x8b24('0x28')](_0x8b24('0x44'),_0x15b96f[_0x8b24('0x2a')]);var _0x3ee4e2=callsValidation[_0x8b24('0xc')](_0x20188b[_0x8b24('0x2a')]);if(_0x3ee4e2[_0x8b24('0x26')]>0x0){return _0x15b96f['status'](0x190)['json'](_0x3ee4e2);}var _0x496364=_0x20188b[_0x8b24('0x2a')]['userId'];var _0x5a507a=respondWithRpcPromise(_0x8b24('0x21'));var _0x124478=getAgent(_0x496364);return Promise['all']([_0x5a507a,_0x124478])[_0x8b24('0x19')](function(_0x6e0a03){var _0x144f29=_0x6e0a03[0x0];var _0x1d4daa=_0x6e0a03[0x1];var _0x323fa1=_[_0x8b24('0x23')](_0x144f29[_0x8b24('0x24')],function(_0x4787d7){return _0x4787d7[_0x8b24('0x45')]==_0x1d4daa['id'];});return _0x15b96f[_0x8b24('0x16')](0xc8)[_0x8b24('0x33')]({'count':_0x323fa1['length'],'rows':_0x323fa1});})['catch'](handleError(_0x15b96f));};exports[_0x8b24('0x46')]=function(_0x2c3552,_0x3b0442){logger['info'](_0x8b24('0x47'),_0x2c3552['body']);var _0x3b2fd6=conferenceValidation[_0x8b24('0xc')](_0x2c3552[_0x8b24('0x2a')]);if(_0x3b2fd6[_0x8b24('0x26')]>0x0){return _0x3b0442[_0x8b24('0x16')](0x190)['json'](_0x3b2fd6);}var _0x4166f1=_0x2c3552[_0x8b24('0x2a')][_0x8b24('0x2b')];return getAgent(_0x4166f1)[_0x8b24('0x19')](function(_0x948e8){logger['info']('entityFound:',_0x948e8[_0x8b24('0x15')]);emit(util[_0x8b24('0x30')](_0x8b24('0x31'),_0x948e8['name']),_0x8b24('0x48'));return _0x3b0442[_0x8b24('0x16')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x8b24('0x1d')](handleError(_0x3b0442));};exports[_0x8b24('0x49')]=function(_0x2f2525,_0x2c4f42){logger[_0x8b24('0x28')](_0x8b24('0x4a'),_0x2f2525[_0x8b24('0x2a')]);var _0x455127=transferValidation[_0x8b24('0xc')](_0x2f2525['body']);if(_0x455127[_0x8b24('0x26')]>0x0){return _0x2c4f42[_0x8b24('0x16')](0x190)[_0x8b24('0x33')](_0x455127);}var _0x7c2917=_0x2f2525[_0x8b24('0x2a')]['userId'];var _0x4b5178=_0x2f2525[_0x8b24('0x2a')][_0x8b24('0x25')];var _0x5adb3e=_0x2f2525[_0x8b24('0x2a')]['transferNumber'];return getAgent(_0x7c2917)[_0x8b24('0x19')](function(_0x548b6a){logger['info'](_0x8b24('0x2f'),_0x548b6a[_0x8b24('0x15')]);emit(util['format'](_0x8b24('0x31'),_0x548b6a['name']),_0x8b24('0x4b'),{'sessionId':_0x4b5178,'transferNumber':_0x5adb3e});return _0x2c4f42['status'](0xc8)[_0x8b24('0x33')]({'error':![],'message':_0x8b24('0x4c')});})[_0x8b24('0x1d')](handleError(_0x2c4f42));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index dc1784b..7b7a620 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 _0x4888=['/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','getApplications','addDisposition','post','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4888,0x198));var _0x8488=function(_0x337800,_0x1e986e){_0x337800=_0x337800-0x0;var _0x2caa1d=_0x4888[_0x337800];return _0x2caa1d;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['show']);router[_0x8488('0x9')](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router['get'](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x9')](_0x8488('0x11'),auth['isAuthenticated'](),controller[_0x8488('0x12')]);router[_0x8488('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8488('0x13')]);router['post']('/',auth[_0x8488('0xa')](),controller['create']);router['post'](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0x14')]);router[_0x8488('0x15')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x16')]);router['post'](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x17')]);router[_0x8488('0x15')](_0x8488('0x18'),auth[_0x8488('0xa')](),controller[_0x8488('0x19')]);router[_0x8488('0x15')](_0x8488('0x1a'),controller[_0x8488('0x1b')]);router[_0x8488('0x15')](_0x8488('0x1c'),auth[_0x8488('0xa')](),controller['send']);router['put'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x1d')]);router[_0x8488('0x1e')](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x1f')]);router[_0x8488('0x1e')](_0x8488('0xd'),auth['isAuthenticated'](),controller[_0x8488('0x20')]);router[_0x8488('0x1e')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x8488('0x22')]=router; \ No newline at end of file +var _0xfcf0=['/:id/applications','getApplications','post','addAnswer','/:id/users','addAgents','addApplications','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents'];(function(_0x52b7cb,_0x20d4a4){var _0x4f727a=function(_0x3f342e){while(--_0x3f342e){_0x52b7cb['push'](_0x52b7cb['shift']());}};_0x4f727a(++_0x20d4a4);}(_0xfcf0,0x138));var _0x0fcf=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0xfcf0[_0x14e27a];return _0x288688;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['get'](_0x0fcf('0x15'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x17')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x17')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller['addDisposition']);router[_0x0fcf('0x17')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x18')]);router['post'](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x17')](_0x0fcf('0x15'),auth['isAuthenticated'](),controller[_0x0fcf('0x1b')]);router[_0x0fcf('0x17')]('/:id/notify',controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x17')]('/:id/send',auth[_0x0fcf('0xa')](),controller['send']);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x1e')]);router[_0x0fcf('0x1f')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x20')]);router[_0x0fcf('0x1f')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x21')]);router[_0x0fcf('0x1f')]('/:id/canned_answers',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x22')]);router[_0x0fcf('0x1f')](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x23')]);module[_0x0fcf('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 6467b3c..376935e 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 _0xa1d0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa1d0,0x74));var _0x0a1d=function(_0x53412e,_0x3d652c){_0x53412e=_0x53412e-0x0;var _0x3c65db=_0xa1d0[_0x53412e];return _0x3c65db;};'use strict';var Sequelize=require(_0x0a1d('0x0'));var rs=require('randomstring');module[_0x0a1d('0x1')]={'name':{'type':Sequelize[_0x0a1d('0x2')],'unique':_0x0a1d('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0a1d('0x2')],'defaultValue':function(){return rs[_0x0a1d('0x4')]();}},'phone':{'type':Sequelize[_0x0a1d('0x2')]},'type':{'type':Sequelize[_0x0a1d('0x5')](_0x0a1d('0x6'),_0x0a1d('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0a1d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x0a1d('0x8')],'defaultValue':function(){return _0x0a1d('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a1d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0a1d('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a1d('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a1d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0a1d('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x0a1d('0xb')],'defaultValue':![],'comment':_0x0a1d('0xd'),'set':function(_0x3d9b82){if(!_0x3d9b82){this['setDataValue'](_0x0a1d('0xe'),null);}this[_0x0a1d('0xf')]('mandatoryDisposition',_0x3d9b82);}},'description':{'type':Sequelize[_0x0a1d('0x2')]}}; \ No newline at end of file +var _0xbc8d=['ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0xbc8d,0x65));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdbc8('0x0'));module[_0xdbc8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xdbc8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xdbc8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xdbc8('0x2')],'defaultValue':function(){return rs[_0xdbc8('0x3')]();}},'phone':{'type':Sequelize[_0xdbc8('0x2')]},'type':{'type':Sequelize[_0xdbc8('0x4')](_0xdbc8('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0xdbc8('0x2')]},'baseUrl':{'type':Sequelize[_0xdbc8('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xdbc8('0x6')],'defaultValue':function(){return _0xdbc8('0x7');}},'notificationSound':{'type':Sequelize[_0xdbc8('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xdbc8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdbc8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdbc8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdbc8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdbc8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdbc8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xdbc8('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xdbc8('0x8')],'defaultValue':![],'comment':_0xdbc8('0xb'),'set':function(_0xf11d0d){if(!_0xf11d0d){this[_0xdbc8('0xc')](_0xdbc8('0xd'),null);}this[_0xdbc8('0xc')](_0xdbc8('0xe'),_0xf11d0d);}},'description':{'type':Sequelize[_0xdbc8('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index f532b92..e0ae574 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 _0xc370=['includeAll','include','rows','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','order','pick','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','Applications','account','statuses','state','read','timestamp','message_id','applications','Sequelize','no\x20available\x20attributes','createdAt','difference','CompanyId','mobile','from','From','Body','messageId','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','DESC','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','WhatsappMessage','ContactId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','CmContact','updatedAt','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','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','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xc370,0x133));var _0x0c37=function(_0x15d67d,_0x5875b0){_0x15d67d=_0x15d67d-0x0;var _0x151c8e=_0xc370[_0x15d67d];return _0x151c8e;};'use strict';var emlformat=require(_0x0c37('0x0'));var rimraf=require(_0x0c37('0x1'));var zipdir=require(_0x0c37('0x2'));var jsonpatch=require(_0x0c37('0x3'));var rp=require('request-promise');var moment=require(_0x0c37('0x4'));var BPromise=require(_0x0c37('0x5'));var Mustache=require(_0x0c37('0x6'));var util=require(_0x0c37('0x7'));var path=require('path');var sox=require(_0x0c37('0x8'));var csv=require('to-csv');var ejs=require(_0x0c37('0x9'));var fs=require('fs');var fs_extra=require(_0x0c37('0xa'));var _=require(_0x0c37('0xb'));var squel=require(_0x0c37('0xc'));var crypto=require(_0x0c37('0xd'));var jsforce=require(_0x0c37('0xe'));var deskjs=require(_0x0c37('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0c37('0x10'));var Papa=require(_0x0c37('0x11'));var Redis=require(_0x0c37('0x12'));var authService=require(_0x0c37('0x13'));var qs=require(_0x0c37('0x14'));var as=require(_0x0c37('0x15'));var hardwareService=require(_0x0c37('0x16'));var logger=require(_0x0c37('0x17'))(_0x0c37('0x18'));var utils=require(_0x0c37('0x19'));var config=require(_0x0c37('0x1a'));var licenseUtil=require(_0x0c37('0x1b'));var db=require('../../mysqldb')['db'];config[_0x0c37('0x1c')]=_[_0x0c37('0x1d')](config[_0x0c37('0x1c')],{'host':_0x0c37('0x1e'),'port':0x18eb});var socket=require(_0x0c37('0x1f'))(new Redis(config['redis']));require(_0x0c37('0x20'))[_0x0c37('0x21')](socket);var jayson=require(_0x0c37('0x22'));var client=jayson[_0x0c37('0x23')][_0x0c37('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x4baebf,_0x5dd8b7,_0x508de9,_0x291163){return new BPromise(function(_0x319c1b,_0x3dae4a){var _0x3f43e4=_0x291163||client;return _0x3f43e4[_0x0c37('0x25')](_0x4baebf,_0x508de9)[_0x0c37('0x26')](function(_0x831ddd){logger[_0x0c37('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x5dd8b7,_0x0c37('0x28'));logger[_0x0c37('0x29')](_0x0c37('0x2a'),_0x5dd8b7,_0x0c37('0x28'),JSON[_0x0c37('0x2b')](_0x831ddd));if(_0x831ddd['error']){if(_0x831ddd['error'][_0x0c37('0x2c')]===0x1f4){logger[_0x0c37('0x2d')](_0x0c37('0x2e'),_0x5dd8b7,_0x831ddd['error'][_0x0c37('0x2f')]);return _0x3dae4a(_0x831ddd[_0x0c37('0x2d')][_0x0c37('0x2f')]);}logger[_0x0c37('0x2d')](_0x0c37('0x2e'),_0x5dd8b7,_0x831ddd[_0x0c37('0x2d')][_0x0c37('0x2f')]);return _0x319c1b(_0x831ddd[_0x0c37('0x2d')]['message']);}else{logger[_0x0c37('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x5dd8b7,'request\x20sent');_0x319c1b(_0x831ddd[_0x0c37('0x30')][_0x0c37('0x2f')]);}})[_0x0c37('0x31')](function(_0x574785){logger[_0x0c37('0x2d')](_0x0c37('0x2e'),_0x5dd8b7,_0x574785);_0x3dae4a(_0x574785);});});}function respondWithStatusCode(_0x3c50e8,_0x389a95){_0x389a95=_0x389a95||0xcc;return function(_0x3b24c3){if(_0x3b24c3){return _0x3c50e8[_0x0c37('0x32')](_0x389a95);}return _0x3c50e8[_0x0c37('0x33')](_0x389a95)[_0x0c37('0x34')]();};}function respondWithResult(_0xe3a0f9,_0x44e51b){_0x44e51b=_0x44e51b||0xc8;return function(_0x4b14bc){if(_0x4b14bc){return _0xe3a0f9[_0x0c37('0x33')](_0x44e51b)[_0x0c37('0x35')](_0x4b14bc);}};}function respondWithFilteredResult(_0x3c4595,_0x3ac275){return function(_0x4e6637){if(_0x4e6637){var _0x26a4df=typeof _0x3ac275[_0x0c37('0x36')]===_0x0c37('0x37')&&typeof _0x3ac275[_0x0c37('0x38')]===_0x0c37('0x37');var _0x1ad45e=_0x4e6637['count'];var _0x2236a2=_0x26a4df?0x0:_0x3ac275[_0x0c37('0x36')];var _0xafa56d=_0x26a4df?_0x4e6637[_0x0c37('0x39')]:_0x3ac275['offset']+_0x3ac275[_0x0c37('0x38')];var _0x96b874;if(_0xafa56d>=_0x1ad45e){_0xafa56d=_0x1ad45e;_0x96b874=0xc8;}else{_0x96b874=0xce;}_0x3c4595[_0x0c37('0x33')](_0x96b874);return _0x3c4595['set'](_0x0c37('0x3a'),_0x2236a2+'-'+_0xafa56d+'/'+_0x1ad45e)[_0x0c37('0x35')](_0x4e6637);}return null;};}function patchUpdates(_0x5d7535){return function(_0x4fab99){try{jsonpatch[_0x0c37('0x3b')](_0x4fab99,_0x5d7535,!![]);}catch(_0x60dc18){return BPromise[_0x0c37('0x3c')](_0x60dc18);}return _0x4fab99[_0x0c37('0x3d')]();};}function saveUpdates(_0x557491,_0x1e5fd1){return function(_0x6b8e10){if(_0x6b8e10){return _0x6b8e10[_0x0c37('0x3e')](_0x557491)[_0x0c37('0x26')](function(_0x59a0dd){return _0x59a0dd;});}return null;};}function removeEntity(_0x550e95,_0x4e9182){return function(_0x49edf9){if(_0x49edf9){return _0x49edf9['destroy']()[_0x0c37('0x26')](function(){var _0x1daed9=_0x49edf9[_0x0c37('0x3f')]({'plain':!![]});var _0x4f1886='WhatsappAccounts';return db[_0x0c37('0x40')]['destroy']({'where':{'type':_0x4f1886,'resourceId':_0x1daed9['id']}})[_0x0c37('0x26')](function(){return _0x49edf9;});})[_0x0c37('0x26')](function(){_0x550e95[_0x0c37('0x33')](0xcc)[_0x0c37('0x34')]();});}};}function handleEntityNotFound(_0x488f22,_0x4b4488){return function(_0x2cfdb5){if(!_0x2cfdb5){_0x488f22[_0x0c37('0x32')](0x194);}return _0x2cfdb5;};}function handleError(_0x96dfe1,_0x4c8858){_0x4c8858=_0x4c8858||0x1f4;return function(_0x45b451){logger[_0x0c37('0x2d')](_0x45b451[_0x0c37('0x41')]);if(_0x45b451['name']){delete _0x45b451[_0x0c37('0x42')];}_0x96dfe1[_0x0c37('0x33')](_0x4c8858)[_0x0c37('0x43')](_0x45b451);};}exports[_0x0c37('0x44')]=function(_0x35d714,_0x503526){var _0x1132ea={'include':[{'model':db[_0x0c37('0x45')],'as':_0x0c37('0x46')}]},_0x46cffd={},_0x182e84={'count':0x0,'rows':[]};var _0x293fa4=_['map'](db[_0x0c37('0x47')]['rawAttributes'],function(_0x121c90){return{'name':_0x121c90[_0x0c37('0x48')],'type':_0x121c90[_0x0c37('0x49')]['key']};});_0x46cffd['model']=_[_0x0c37('0x4a')](_0x293fa4,_0x0c37('0x42'));_0x46cffd[_0x0c37('0x4b')]=_[_0x0c37('0x4c')](_0x35d714[_0x0c37('0x4b')]);_0x46cffd[_0x0c37('0x4d')]=_[_0x0c37('0x4e')](_0x46cffd[_0x0c37('0x4f')],_0x46cffd[_0x0c37('0x4b')]);_0x1132ea[_0x0c37('0x50')]=_['intersection'](_0x46cffd[_0x0c37('0x4f')],qs['fields'](_0x35d714[_0x0c37('0x4b')][_0x0c37('0x51')]));_0x1132ea[_0x0c37('0x50')]=_0x1132ea[_0x0c37('0x50')][_0x0c37('0x52')]?_0x1132ea[_0x0c37('0x50')]:_0x46cffd['model'];if(!_0x35d714['query'][_0x0c37('0x53')](_0x0c37('0x54'))){_0x1132ea[_0x0c37('0x38')]=qs[_0x0c37('0x38')](_0x35d714[_0x0c37('0x4b')][_0x0c37('0x38')]);_0x1132ea[_0x0c37('0x36')]=qs[_0x0c37('0x36')](_0x35d714[_0x0c37('0x4b')][_0x0c37('0x36')]);}_0x1132ea['order']=qs[_0x0c37('0x55')](_0x35d714[_0x0c37('0x4b')]['sort']);_0x1132ea[_0x0c37('0x56')]=qs['filters'](_['pick'](_0x35d714[_0x0c37('0x4b')],_0x46cffd[_0x0c37('0x4d')]),_0x293fa4);if(_0x35d714[_0x0c37('0x4b')][_0x0c37('0x57')]){_0x1132ea[_0x0c37('0x56')]=_[_0x0c37('0x58')](_0x1132ea['where'],{'$or':_[_0x0c37('0x4a')](_0x293fa4,function(_0x1e4d50){if(_0x1e4d50[_0x0c37('0x49')]!==_0x0c37('0x59')){var _0x2502b1={};_0x2502b1[_0x1e4d50[_0x0c37('0x42')]]={'$like':'%'+_0x35d714[_0x0c37('0x4b')][_0x0c37('0x57')]+'%'};return _0x2502b1;}})});}_0x1132ea=_[_0x0c37('0x58')]({},_0x1132ea,_0x35d714[_0x0c37('0x5a')]);var _0x24a6c2={'where':_0x1132ea['where']};return db[_0x0c37('0x47')][_0x0c37('0x39')](_0x24a6c2)[_0x0c37('0x26')](function(_0x494f10){_0x182e84['count']=_0x494f10;if(_0x35d714[_0x0c37('0x4b')][_0x0c37('0x5b')]){_0x1132ea[_0x0c37('0x5c')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x1132ea);})[_0x0c37('0x26')](function(_0x33d1ee){_0x182e84[_0x0c37('0x5d')]=_0x33d1ee;return _0x182e84;})['then'](respondWithFilteredResult(_0x503526,_0x1132ea))[_0x0c37('0x31')](handleError(_0x503526,null));};exports[_0x0c37('0x5e')]=function(_0x4096ef,_0x4d91f1){var _0x4ac9e3={'raw':![],'where':{'id':_0x4096ef['params']['id']},'include':[{'model':db[_0x0c37('0x45')],'as':_0x0c37('0x46')}]},_0x2d3473={};_0x2d3473[_0x0c37('0x4f')]=_[_0x0c37('0x4c')](db['WhatsappAccount'][_0x0c37('0x5f')]);_0x2d3473[_0x0c37('0x4b')]=_[_0x0c37('0x4c')](_0x4096ef['query']);_0x2d3473[_0x0c37('0x4d')]=_[_0x0c37('0x4e')](_0x2d3473[_0x0c37('0x4f')],_0x2d3473[_0x0c37('0x4b')]);_0x4ac9e3[_0x0c37('0x50')]=_[_0x0c37('0x4e')](_0x2d3473[_0x0c37('0x4f')],qs[_0x0c37('0x51')](_0x4096ef[_0x0c37('0x4b')][_0x0c37('0x51')]));_0x4ac9e3['attributes']=_0x4ac9e3[_0x0c37('0x50')][_0x0c37('0x52')]?_0x4ac9e3[_0x0c37('0x50')]:_0x2d3473['model'];if(_0x4096ef[_0x0c37('0x4b')][_0x0c37('0x5b')]){_0x4ac9e3['include']=[{'all':!![]}];}_0x4ac9e3=_['merge']({},_0x4ac9e3,_0x4096ef['options']);return db['WhatsappAccount'][_0x0c37('0x60')](_0x4ac9e3)['then'](handleEntityNotFound(_0x4d91f1,null))['then'](respondWithResult(_0x4d91f1,null))[_0x0c37('0x31')](handleError(_0x4d91f1,null));};exports[_0x0c37('0x61')]=function(_0x3b3136,_0x639773){return db[_0x0c37('0x47')]['create'](_0x3b3136[_0x0c37('0x62')],{})['then'](function(_0x20202e){var _0x5c263a=_0x3b3136['user'][_0x0c37('0x3f')]({'plain':!![]});if(!_0x5c263a)throw new Error(_0x0c37('0x63'));if(_0x5c263a[_0x0c37('0x64')]===_0x0c37('0x65')){var _0x23b0fc=_0x20202e['get']({'plain':!![]});var _0xb5db50=_0x0c37('0x66');return db['UserProfileSection'][_0x0c37('0x60')]({'where':{'name':_0xb5db50,'userProfileId':_0x5c263a['userProfileId']},'raw':!![]})[_0x0c37('0x26')](function(_0x10e740){if(_0x10e740&&_0x10e740['autoAssociation']===0x0){return db[_0x0c37('0x40')][_0x0c37('0x61')]({'name':_0x23b0fc[_0x0c37('0x42')],'resourceId':_0x23b0fc['id'],'type':_0x10e740[_0x0c37('0x42')],'sectionId':_0x10e740['id']},{})[_0x0c37('0x26')](function(){return _0x20202e;});}else{return _0x20202e;}})['catch'](function(_0x2f1ea0){logger[_0x0c37('0x2d')](_0x0c37('0x67'),_0x2f1ea0);throw _0x2f1ea0;});}return _0x20202e;})[_0x0c37('0x26')](respondWithResult(_0x639773,0xc9))['catch'](handleError(_0x639773,null));};exports[_0x0c37('0x3e')]=function(_0x2ad8fd,_0x552d59){if(_0x2ad8fd['body']['id']){delete _0x2ad8fd[_0x0c37('0x62')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2ad8fd[_0x0c37('0x68')]['id']},'include':[{'model':db[_0x0c37('0x45')],'as':_0x0c37('0x46')}]})[_0x0c37('0x26')](handleEntityNotFound(_0x552d59,null))[_0x0c37('0x26')](saveUpdates(_0x2ad8fd[_0x0c37('0x62')],null))[_0x0c37('0x26')](respondWithResult(_0x552d59,null))['catch'](handleError(_0x552d59,null));};exports[_0x0c37('0x69')]=function(_0x57fa60,_0x4a6e37){return db[_0x0c37('0x47')]['find']({'where':{'id':_0x57fa60[_0x0c37('0x68')]['id']}})['then'](handleEntityNotFound(_0x4a6e37,null))[_0x0c37('0x26')](removeEntity(_0x4a6e37,null))['catch'](handleError(_0x4a6e37,null));};exports[_0x0c37('0x6a')]=function(_0x382f6e,_0xf88c81){return db[_0x0c37('0x47')][_0x0c37('0x6a')]()[_0x0c37('0x26')](respondWithResult(_0xf88c81,null))[_0x0c37('0x31')](handleError(_0xf88c81,null));};exports['addDisposition']=function(_0x475185,_0x141f3c,_0x387ebe){if(_0x475185[_0x0c37('0x62')]['id']){delete _0x475185[_0x0c37('0x62')]['id'];}return db['WhatsappAccount'][_0x0c37('0x60')]({'where':{'id':_0x475185[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x141f3c,null))[_0x0c37('0x26')](function(_0x1e2fd0){if(_0x1e2fd0){_0x475185[_0x0c37('0x62')][_0x0c37('0x6b')]=_0x1e2fd0['id'];return db[_0x0c37('0x6c')]['create'](_0x475185[_0x0c37('0x62')]);}})['then'](respondWithResult(_0x141f3c,null))[_0x0c37('0x31')](handleError(_0x141f3c,null));};exports[_0x0c37('0x6d')]=function(_0x2ecba0,_0x15a8df,_0x37f9e2){var _0x593dd4={'raw':![],'where':{}};var _0x4e56c2={};var _0x3152bf={'count':0x0,'rows':[]};return db[_0x0c37('0x47')][_0x0c37('0x6e')]({'where':{'id':_0x2ecba0[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x15a8df,null))['then'](function(_0x3e1353){if(_0x3e1353){_0x4e56c2[_0x0c37('0x4f')]=_[_0x0c37('0x4c')](db[_0x0c37('0x6c')][_0x0c37('0x5f')]);_0x4e56c2[_0x0c37('0x4b')]=_[_0x0c37('0x4c')](_0x2ecba0[_0x0c37('0x4b')]);_0x4e56c2['filters']=_[_0x0c37('0x4e')](_0x4e56c2[_0x0c37('0x4f')],_0x4e56c2['query']);_0x593dd4[_0x0c37('0x50')]=_[_0x0c37('0x4e')](_0x4e56c2['model'],qs['fields'](_0x2ecba0[_0x0c37('0x4b')][_0x0c37('0x51')]));_0x593dd4[_0x0c37('0x50')]=_0x593dd4['attributes'][_0x0c37('0x52')]?_0x593dd4[_0x0c37('0x50')]:_0x4e56c2[_0x0c37('0x4f')];if(!_0x2ecba0[_0x0c37('0x4b')]['hasOwnProperty'](_0x0c37('0x54'))){_0x593dd4[_0x0c37('0x38')]=qs['limit'](_0x2ecba0['query']['limit']);_0x593dd4[_0x0c37('0x36')]=qs['offset'](_0x2ecba0[_0x0c37('0x4b')][_0x0c37('0x36')]);}_0x593dd4['order']=qs[_0x0c37('0x55')](_0x2ecba0[_0x0c37('0x4b')]['sort']);_0x593dd4['where']=qs[_0x0c37('0x4d')](_['pick'](_0x2ecba0[_0x0c37('0x4b')],_0x4e56c2[_0x0c37('0x4d')]));_0x593dd4[_0x0c37('0x56')][_0x0c37('0x6b')]=_0x3e1353['id'];if(_0x2ecba0[_0x0c37('0x4b')][_0x0c37('0x57')]){_0x593dd4[_0x0c37('0x56')]=_[_0x0c37('0x58')](_0x593dd4[_0x0c37('0x56')],{'$or':_[_0x0c37('0x4a')](_0x593dd4[_0x0c37('0x50')],function(_0x5e0d3c){var _0x466d63={};_0x466d63[_0x5e0d3c]={'$like':'%'+_0x2ecba0[_0x0c37('0x4b')][_0x0c37('0x57')]+'%'};return _0x466d63;})});}_0x593dd4=_['merge']({},_0x593dd4,_0x2ecba0[_0x0c37('0x5a')]);return db[_0x0c37('0x6c')][_0x0c37('0x39')]({'where':_0x593dd4[_0x0c37('0x56')]})[_0x0c37('0x26')](function(_0xc8b677){_0x3152bf[_0x0c37('0x39')]=_0xc8b677;if(_0x2ecba0['query']['includeAll']){_0x593dd4['include']=[{'all':!![]}];}return db['Disposition'][_0x0c37('0x6f')](_0x593dd4);})[_0x0c37('0x26')](function(_0x16f69d){_0x3152bf[_0x0c37('0x5d')]=_0x16f69d;return _0x3152bf;});}})[_0x0c37('0x26')](respondWithFilteredResult(_0x15a8df,_0x593dd4))[_0x0c37('0x31')](handleError(_0x15a8df,null));};exports[_0x0c37('0x70')]=function(_0x52928b,_0x3b520f,_0x599d91){return db[_0x0c37('0x47')][_0x0c37('0x60')]({'where':{'id':_0x52928b[_0x0c37('0x68')]['id']}})['then'](handleEntityNotFound(_0x3b520f,null))[_0x0c37('0x26')](function(_0x48cbd5){if(_0x48cbd5){return _0x48cbd5[_0x0c37('0x70')](_0x52928b['query'][_0x0c37('0x71')]);}})['then'](respondWithStatusCode(_0x3b520f,null))['catch'](handleError(_0x3b520f,null));};exports[_0x0c37('0x72')]=function(_0x294efd,_0x338fcb,_0x133a49){if(_0x294efd['body']['id']){delete _0x294efd[_0x0c37('0x62')]['id'];}return db['WhatsappAccount'][_0x0c37('0x60')]({'where':{'id':_0x294efd[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x338fcb,null))[_0x0c37('0x26')](function(_0x52ff1a){if(_0x52ff1a){_0x294efd[_0x0c37('0x62')]['WhatsappAccountId']=_0x52ff1a['id'];return db[_0x0c37('0x73')][_0x0c37('0x61')](_0x294efd[_0x0c37('0x62')]);}})[_0x0c37('0x26')](respondWithResult(_0x338fcb,null))[_0x0c37('0x31')](handleError(_0x338fcb,null));};exports['getAnswers']=function(_0x33c4f9,_0x479fda,_0x44a824){var _0x2c8084={'raw':![],'where':{}};var _0x4f6937={};var _0xaee68d={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x0c37('0x6e')]({'where':{'id':_0x33c4f9[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x479fda,null))['then'](function(_0x292e67){if(_0x292e67){_0x4f6937[_0x0c37('0x4f')]=_[_0x0c37('0x4c')](db['CannedAnswer'][_0x0c37('0x5f')]);_0x4f6937[_0x0c37('0x4b')]=_[_0x0c37('0x4c')](_0x33c4f9[_0x0c37('0x4b')]);_0x4f6937['filters']=_['intersection'](_0x4f6937['model'],_0x4f6937[_0x0c37('0x4b')]);_0x2c8084[_0x0c37('0x50')]=_[_0x0c37('0x4e')](_0x4f6937['model'],qs['fields'](_0x33c4f9['query'][_0x0c37('0x51')]));_0x2c8084[_0x0c37('0x50')]=_0x2c8084[_0x0c37('0x50')][_0x0c37('0x52')]?_0x2c8084[_0x0c37('0x50')]:_0x4f6937[_0x0c37('0x4f')];if(!_0x33c4f9[_0x0c37('0x4b')][_0x0c37('0x53')]('nolimit')){_0x2c8084[_0x0c37('0x38')]=qs[_0x0c37('0x38')](_0x33c4f9[_0x0c37('0x4b')][_0x0c37('0x38')]);_0x2c8084['offset']=qs[_0x0c37('0x36')](_0x33c4f9[_0x0c37('0x4b')][_0x0c37('0x36')]);}_0x2c8084[_0x0c37('0x74')]=qs[_0x0c37('0x55')](_0x33c4f9[_0x0c37('0x4b')][_0x0c37('0x55')]);_0x2c8084['where']=qs[_0x0c37('0x4d')](_[_0x0c37('0x75')](_0x33c4f9['query'],_0x4f6937[_0x0c37('0x4d')]));_0x2c8084[_0x0c37('0x56')]['WhatsappAccountId']=_0x292e67['id'];if(_0x33c4f9[_0x0c37('0x4b')][_0x0c37('0x57')]){_0x2c8084[_0x0c37('0x56')]=_[_0x0c37('0x58')](_0x2c8084['where'],{'$or':_[_0x0c37('0x4a')](_0x2c8084[_0x0c37('0x50')],function(_0x45c87e){var _0x567e75={};_0x567e75[_0x45c87e]={'$like':'%'+_0x33c4f9[_0x0c37('0x4b')][_0x0c37('0x57')]+'%'};return _0x567e75;})});}_0x2c8084=_['merge']({},_0x2c8084,_0x33c4f9[_0x0c37('0x5a')]);return db['CannedAnswer'][_0x0c37('0x39')]({'where':_0x2c8084[_0x0c37('0x56')]})['then'](function(_0x2f3191){_0xaee68d[_0x0c37('0x39')]=_0x2f3191;if(_0x33c4f9[_0x0c37('0x4b')]['includeAll']){_0x2c8084[_0x0c37('0x5c')]=[{'all':!![]}];}return db[_0x0c37('0x73')][_0x0c37('0x6f')](_0x2c8084);})['then'](function(_0x1cabe1){_0xaee68d[_0x0c37('0x5d')]=_0x1cabe1;return _0xaee68d;});}})[_0x0c37('0x26')](respondWithFilteredResult(_0x479fda,_0x2c8084))[_0x0c37('0x31')](handleError(_0x479fda,null));};exports['removeAnswers']=function(_0x1f7fd0,_0x38da99,_0xd60c79){return db[_0x0c37('0x47')][_0x0c37('0x60')]({'where':{'id':_0x1f7fd0[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x38da99,null))[_0x0c37('0x26')](function(_0x28aff2){if(_0x28aff2){return _0x28aff2[_0x0c37('0x76')](_0x1f7fd0[_0x0c37('0x4b')]['ids']);}})[_0x0c37('0x26')](respondWithStatusCode(_0x38da99,null))[_0x0c37('0x31')](handleError(_0x38da99,null));};exports['addAgents']=function(_0x34a96d,_0x1d8b9c,_0x2cc5bc){return db[_0x0c37('0x47')]['find']({'where':{'id':_0x34a96d['params']['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x1d8b9c,null))['then'](function(_0x38f50f){if(_0x38f50f){return _0x38f50f[_0x0c37('0x77')](_0x34a96d[_0x0c37('0x62')][_0x0c37('0x71')],_[_0x0c37('0x78')](_0x34a96d[_0x0c37('0x62')],[_0x0c37('0x71'),'id'])||{})[_0x0c37('0x79')](function(_0x39989f){for(var _0x5b5a3b=0x0;_0x5b5a3b<_0x34a96d[_0x0c37('0x62')][_0x0c37('0x71')]['length'];_0x5b5a3b+=0x1){socket['emit'](_0x0c37('0x7a'),{'UserId':Number(_0x34a96d[_0x0c37('0x62')][_0x0c37('0x71')][_0x5b5a3b]),'WhatsappAccountId':Number(_0x34a96d[_0x0c37('0x68')]['id'])});}return _0x39989f;});}})[_0x0c37('0x26')](respondWithResult(_0x1d8b9c,null))[_0x0c37('0x31')](handleError(_0x1d8b9c,null));};exports[_0x0c37('0x7b')]=function(_0xfc42d6,_0x2ce0b1,_0x3e8f31){return db[_0x0c37('0x47')][_0x0c37('0x60')]({'where':{'id':_0xfc42d6[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x2ce0b1,null))[_0x0c37('0x26')](function(_0x5250a6){if(_0x5250a6){return _0x5250a6[_0x0c37('0x7b')](_0xfc42d6[_0x0c37('0x4b')]['ids'])[_0x0c37('0x26')](function(){if(_[_0x0c37('0x7c')](_0xfc42d6['query']['ids'])){for(var _0x55d90d=0x0;_0x55d90d<_0xfc42d6[_0x0c37('0x4b')]['ids'][_0x0c37('0x52')];_0x55d90d+=0x1){socket[_0x0c37('0x7d')]('userWhatsappAccount:remove',{'UserId':Number(_0xfc42d6[_0x0c37('0x4b')][_0x0c37('0x71')][_0x55d90d]),'WhatsappAccountId':Number(_0xfc42d6[_0x0c37('0x68')]['id'])});}}else{socket['emit'](_0x0c37('0x7e'),{'UserId':Number(_0xfc42d6[_0x0c37('0x4b')]['ids']),'WhatsappAccountId':Number(_0xfc42d6[_0x0c37('0x68')]['id'])});}});}})[_0x0c37('0x26')](respondWithStatusCode(_0x2ce0b1,null))['catch'](handleError(_0x2ce0b1,null));};exports[_0x0c37('0x7f')]=function(_0xfec232,_0x4de695,_0x31e9c3){var _0x262412={};var _0x494a3a={};var _0x15d5bd;var _0x2d8ec5;return db[_0x0c37('0x47')][_0x0c37('0x6e')]({'where':{'id':_0xfec232['params']['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x4de695,null))['then'](function(_0x492914){if(_0x492914){_0x15d5bd=_0x492914;_0x494a3a['model']=_['keys'](db[_0x0c37('0x80')][_0x0c37('0x5f')]);_0x494a3a[_0x0c37('0x4b')]=_[_0x0c37('0x4c')](_0xfec232[_0x0c37('0x4b')]);_0x494a3a[_0x0c37('0x4d')]=_['intersection'](_0x494a3a[_0x0c37('0x4f')],_0x494a3a['query']);_0x262412[_0x0c37('0x50')]=_[_0x0c37('0x4e')](_0x494a3a['model'],qs[_0x0c37('0x51')](_0xfec232[_0x0c37('0x4b')][_0x0c37('0x51')]));_0x262412['attributes']=_0x262412[_0x0c37('0x50')][_0x0c37('0x52')]?_0x262412[_0x0c37('0x50')]:_0x494a3a[_0x0c37('0x4f')];_0x262412['order']=qs[_0x0c37('0x55')](_0xfec232[_0x0c37('0x4b')][_0x0c37('0x55')]);_0x262412[_0x0c37('0x56')]=qs['filters'](_[_0x0c37('0x75')](_0xfec232[_0x0c37('0x4b')],_0x494a3a['filters']));if(_0xfec232[_0x0c37('0x4b')][_0x0c37('0x57')]){_0x262412['where']=_['merge'](_0x262412['where'],{'$or':_[_0x0c37('0x4a')](_0x262412[_0x0c37('0x50')],function(_0x451679){var _0x33edbd={};_0x33edbd[_0x451679]={'$like':'%'+_0xfec232[_0x0c37('0x4b')][_0x0c37('0x57')]+'%'};return _0x33edbd;})});}_0x262412=_['merge']({},_0x262412,_0xfec232['options']);return _0x15d5bd[_0x0c37('0x7f')](_0x262412);}})[_0x0c37('0x26')](function(_0x2b1ac8){if(_0x2b1ac8){_0x2d8ec5=_0x2b1ac8['length'];if(!_0xfec232[_0x0c37('0x4b')][_0x0c37('0x53')]('nolimit')){_0x262412['limit']=qs['limit'](_0xfec232[_0x0c37('0x4b')][_0x0c37('0x38')]);_0x262412['offset']=qs[_0x0c37('0x36')](_0xfec232['query']['offset']);}return _0x15d5bd[_0x0c37('0x7f')](_0x262412);}})[_0x0c37('0x26')](function(_0x2afe8c){if(_0x2afe8c){return _0x2afe8c?{'count':_0x2d8ec5,'rows':_0x2afe8c}:null;}})['then'](respondWithResult(_0x4de695,null))[_0x0c37('0x31')](handleError(_0x4de695,null));};exports['addApplications']=function(_0x228145,_0x218f25){var _0x323570=_0x228145['params']['id'];var _0x4afb3b=_0x228145[_0x0c37('0x62')];var _0x3b1a3f=0xc8;var _0x5bfd06=null;return db['sequelize'][_0x0c37('0x81')]({'isolationLevel':db[_0x0c37('0x82')][_0x0c37('0x83')][_0x0c37('0x84')][_0x0c37('0x85')]},function(_0x26e4a0){return db[_0x0c37('0x47')][_0x0c37('0x6e')]({'where':{'id':_0x323570},'transaction':_0x26e4a0})[_0x0c37('0x26')](function(_0x2f7e25){if(_0x2f7e25){return db[_0x0c37('0x86')][_0x0c37('0x69')]({'where':{'WhatsappAccountId':_0x323570},'transaction':_0x26e4a0})[_0x0c37('0x26')](function(){var _0x56444f=_['map'](_0x4afb3b,function(_0x2f7224){_0x2f7224['WhatsappAccountId']=_0x323570;return _0x2f7224;});return db[_0x0c37('0x86')][_0x0c37('0x87')](_0x56444f,{'transaction':_0x26e4a0});});}else{_0x3b1a3f=0x194;_0x5bfd06=[];}});})['then'](function(){if(_0x3b1a3f!==0x194){return db[_0x0c37('0x86')][_0x0c37('0x88')]({'where':{'WhatsappAccountId':_0x323570},'order':_0x0c37('0x89')})['then'](function(_0xd1efdb){_0x5bfd06=_0xd1efdb;});}})[_0x0c37('0x31')](function(_0x1df603){_0x3b1a3f=0x1f4;logger[_0x0c37('0x2d')](_0x1df603[_0x0c37('0x41')]);if(_0x1df603[_0x0c37('0x42')]){delete _0x1df603[_0x0c37('0x42')];}_0x5bfd06=_0x1df603;})[_0x0c37('0x8a')](function(){if(_0x5bfd06===null){_0x218f25[_0x0c37('0x32')](_0x3b1a3f);}else{if(_0x3b1a3f===0x1f4){_0x218f25['status'](_0x3b1a3f)[_0x0c37('0x43')](_0x5bfd06);}else{_0x218f25[_0x0c37('0x33')](_0x3b1a3f)['json'](_0x5bfd06);}}});};exports[_0x0c37('0x8b')]=function(_0x525e68,_0x48d6fa,_0x5c6e){var _0x46868c={};var _0x23a174={};var _0x217f97;var _0x5a0e84;return db[_0x0c37('0x47')]['findOne']({'where':{'id':_0x525e68[_0x0c37('0x68')]['id']}})[_0x0c37('0x26')](handleEntityNotFound(_0x48d6fa,null))['then'](function(_0x39cd95){if(_0x39cd95){_0x217f97=_0x39cd95;_0x23a174[_0x0c37('0x4f')]=_[_0x0c37('0x4c')](db['WhatsappApplication']['rawAttributes']);_0x23a174['query']=_[_0x0c37('0x4c')](_0x525e68['query']);_0x23a174['filters']=_[_0x0c37('0x4e')](_0x23a174[_0x0c37('0x4f')],_0x23a174[_0x0c37('0x4b')]);_0x46868c[_0x0c37('0x50')]=_[_0x0c37('0x4e')](_0x23a174[_0x0c37('0x4f')],qs[_0x0c37('0x51')](_0x525e68['query'][_0x0c37('0x51')]));_0x46868c['attributes']=_0x46868c[_0x0c37('0x50')]['length']?_0x46868c[_0x0c37('0x50')]:_0x23a174[_0x0c37('0x4f')];_0x46868c[_0x0c37('0x74')]=qs['sort'](_0x525e68[_0x0c37('0x4b')][_0x0c37('0x55')]);_0x46868c[_0x0c37('0x56')]=qs[_0x0c37('0x4d')](_[_0x0c37('0x75')](_0x525e68[_0x0c37('0x4b')],_0x23a174[_0x0c37('0x4d')]));if(_0x525e68[_0x0c37('0x4b')]['filter']){_0x46868c[_0x0c37('0x56')]=_[_0x0c37('0x58')](_0x46868c[_0x0c37('0x56')],{'$or':_['map'](_0x46868c[_0x0c37('0x50')],function(_0x42bfb9){var _0x4b6e5f={};_0x4b6e5f[_0x42bfb9]={'$like':'%'+_0x525e68['query'][_0x0c37('0x57')]+'%'};return _0x4b6e5f;})});}_0x46868c=_['merge']({},_0x46868c,_0x525e68['options']);return _0x217f97[_0x0c37('0x8b')](_0x46868c);}})['then'](function(_0x3ce791){if(_0x3ce791){_0x5a0e84=_0x3ce791[_0x0c37('0x52')];if(!_0x525e68[_0x0c37('0x4b')][_0x0c37('0x53')](_0x0c37('0x54'))){_0x46868c[_0x0c37('0x38')]=qs[_0x0c37('0x38')](_0x525e68[_0x0c37('0x4b')]['limit']);_0x46868c[_0x0c37('0x36')]=qs['offset'](_0x525e68[_0x0c37('0x4b')][_0x0c37('0x36')]);}return _0x217f97[_0x0c37('0x8b')](_0x46868c);}})['then'](function(_0x38e90a){if(_0x38e90a){return _0x38e90a?{'count':_0x5a0e84,'rows':_0x38e90a}:null;}})['then'](respondWithResult(_0x48d6fa,null))[_0x0c37('0x31')](handleError(_0x48d6fa,null));};exports[_0x0c37('0x8c')]=function(_0x398df1,_0x8e9f04,_0x54df32){var _0x195103={'channel':'whatsapp'};var _0x454a09=[];var _0x29f0bc=[];var _0x2f1d31={};return db['WhatsappAccount']['find']({'where':{'id':_0x398df1[_0x0c37('0x68')]['id']},'include':[{'model':db[_0x0c37('0x86')],'as':_0x0c37('0x8d')}]})[_0x0c37('0x26')](handleEntityNotFound(_0x8e9f04,null))[_0x0c37('0x26')](function(_0x3e4578){_0x195103[_0x0c37('0x8e')]=_0x3e4578;if(_0x195103[_0x0c37('0x8e')]&&_0x195103['account']['type']==='sinch'&&_0x398df1['body'][_0x0c37('0x8f')]){if(_0x398df1['body'][_0x0c37('0x8f')][_0x0c37('0x52')]===0x0)return;if(_0x398df1[_0x0c37('0x62')][_0x0c37('0x8f')][0x0][_0x0c37('0x90')]!==_0x0c37('0x91'))return;return db['WhatsappMessage'][_0x0c37('0x3e')]({'read':!![],'readAt':_0x398df1[_0x0c37('0x62')][_0x0c37('0x8f')][0x0][_0x0c37('0x92')]},{'where':{'messageId':_0x398df1[_0x0c37('0x62')][_0x0c37('0x8f')][0x0][_0x0c37('0x93')]},'individualHooks':!![]})[_0x0c37('0x26')](function(_0x505118){return _0x8e9f04[_0x0c37('0x33')](0xc8)[_0x0c37('0x35')](_0x505118);});}_0x195103[_0x0c37('0x94')]=_['orderBy'](_0x3e4578[_0x0c37('0x8d')],[_0x0c37('0x89')],['asc']);if(_0x195103[_0x0c37('0x8e')][_0x0c37('0x8d')]){delete _0x195103['account'][_0x0c37('0x8d')];}return db['CmContact'][_0x0c37('0x6a')]()[_0x0c37('0x26')](function(_0x3f4692){if(!_0x3f4692){throw new db[(_0x0c37('0x95'))]['ValidationError'](_0x0c37('0x96'));}_0x454a09=_['difference'](_[_0x0c37('0x4c')](_0x3f4692),[_0x0c37('0x97'),'updatedAt']);_0x29f0bc=_[_0x0c37('0x98')](_[_0x0c37('0x4c')](_0x3f4692),[_0x0c37('0x97'),'updatedAt',_0x0c37('0x99'),'ListId']);_0x195103[_0x0c37('0x62')]={'mapKey':_0x0c37('0x9a')};if(_0x195103[_0x0c37('0x8e')]&&_0x195103[_0x0c37('0x8e')][_0x0c37('0x49')]==='twilio'){_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')]=_0x398df1[_0x0c37('0x62')][_0x0c37('0x9c')]['replace']('whatsapp:','');_0x195103[_0x0c37('0x62')][_0x0c37('0x62')]=_0x398df1[_0x0c37('0x62')][_0x0c37('0x9d')];_0x195103[_0x0c37('0x62')][_0x0c37('0x9e')]=_0x398df1[_0x0c37('0x62')]['MessageSid'];}if(_0x195103[_0x0c37('0x8e')]&&_0x195103['account'][_0x0c37('0x49')]==='sinch'){_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')]=_0x398df1['body'][_0x0c37('0x9f')][0x0][_0x0c37('0x9b')];_0x195103['body'][_0x0c37('0x62')]=_0x398df1['body'][_0x0c37('0x9f')][0x0][_0x0c37('0x2f')][_0x0c37('0x62')];_0x195103[_0x0c37('0x62')][_0x0c37('0x9e')]=_0x398df1[_0x0c37('0x62')][_0x0c37('0x9f')][0x0][_0x0c37('0x93')];}if(_0x195103[_0x0c37('0x62')]['id']){delete _0x195103['body']['id'];}if(_[_0x0c37('0xa0')](_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')])){throw new db[(_0x0c37('0x95'))][(_0x0c37('0xa1'))](_0x0c37('0xa2'));}if(_[_0x0c37('0xa0')](_0x195103[_0x0c37('0x62')][_0x0c37('0x62')])||_0x195103[_0x0c37('0x62')][_0x0c37('0x62')]===''){throw new db[(_0x0c37('0x95'))][(_0x0c37('0xa1'))](_0x0c37('0xa3'));}if(_['isNil'](_0x195103[_0x0c37('0x62')][_0x0c37('0xa4')])){throw new db[(_0x0c37('0x95'))][(_0x0c37('0xa1'))](_0x0c37('0xa5')+_0x29f0bc);}if(!_[_0x0c37('0xa6')](_0x29f0bc,_0x195103['body']['mapKey'])){throw new db['Sequelize'][(_0x0c37('0xa1'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x29f0bc);}_0x2f1d31[_0x195103[_0x0c37('0x62')][_0x0c37('0xa4')]]=_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')];return db['CmList'][_0x0c37('0x60')]({'where':{'id':_0x195103[_0x0c37('0x8e')][_0x0c37('0xa7')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2f1d31,'limit':0x1,'order':[['updatedAt',_0x0c37('0xa8')]]}]});})[_0x0c37('0x26')](handleEntityNotFound(_0x8e9f04,null))[_0x0c37('0x26')](function(_0x5de424){if(_0x5de424){_0x195103['list']=_['omit'](_0x5de424,[_0x0c37('0xa9')]);if(_0x5de424[_0x0c37('0xa9')]['length']){return _0x5de424['Contacts'][0x0];}var _0x482153=_[_0x0c37('0x1d')](_0x195103[_0x0c37('0x62')],{'firstName':_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')],'ListId':_0x5de424['id']});_0x482153[_0x195103[_0x0c37('0x62')][_0x0c37('0xa4')]]=_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')];return db['CmContact']['create'](_0x482153,{'fields':_0x454a09,'raw':!![]});}})['then'](handleEntityNotFound(_0x8e9f04,null))['then'](function(_0x4c8ea4){if(_0x4c8ea4){_0x195103[_0x0c37('0xaa')]=_0x4c8ea4;var _0x49c5e7={'ContactId':_0x4c8ea4['id'],'phone':_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')],'WhatsappAccountId':_0x398df1[_0x0c37('0x68')]['id']};var _0x1f8e2f={'ContactId':_0x4c8ea4['id'],'WhatsappAccountId':_0x398df1[_0x0c37('0x68')]['id'],'closed':![]};return db[_0x0c37('0xab')][_0x0c37('0x60')]({'where':_0x1f8e2f})['then'](function(_0x535256){if(_0x535256){return[_0x535256,![]];}return db[_0x0c37('0xab')][_0x0c37('0x61')](_0x49c5e7)[_0x0c37('0x26')](function(_0x629b49){return[_0x629b49,!![]];});});}})[_0x0c37('0x79')](function(_0x541b9e,_0x1563f1){_0x195103[_0x0c37('0xac')]=_0x541b9e[_0x0c37('0x3f')]({'plain':!![]});_0x195103['interaction'][_0x0c37('0xad')]=![];if(_0x1563f1){if(_0x195103['account'][_0x0c37('0xae')]){_0x195103[_0x0c37('0x94')][_0x0c37('0xaf')]({'id':0x0,'priority':_0x195103[_0x0c37('0x94')][_0x0c37('0x52')]+0x1,'app':_0x0c37('0xb0'),'appdata':_0x0c37('0xb1'),'interval':'*,*,*,*'});}_0x195103['interaction'][_0x0c37('0xad')]=!![];}return db[_0x0c37('0xb2')]['create']({'phone':_0x195103[_0x0c37('0x62')][_0x0c37('0x9b')],'messageId':_0x195103[_0x0c37('0x62')][_0x0c37('0x9e')],'body':_0x195103['body'][_0x0c37('0x62')],'WhatsappAccountId':_0x398df1['params']['id'],'WhatsappInteractionId':_0x541b9e['id'],'direction':'in','ContactId':_0x541b9e[_0x0c37('0xb3')],'AttachmentId':_0x195103['body']['AttachmentId']});})[_0x0c37('0x26')](function(_0x1f20ed){_0x195103['message']=_0x1f20ed;if(_0x195103[_0x0c37('0xac')][_0x0c37('0xb4')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x195103[_0x0c37('0xac')][_0x0c37('0xb4')]}})['then'](function(_0xd82c7){if(_0xd82c7){_0x195103[_0x0c37('0x94')][_0x0c37('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd82c7['name']+','+(_0x195103[_0x0c37('0x8e')][_0x0c37('0xb6')]||0xa),'interval':_0x0c37('0xb7')});}return respondWithRpcPromise(_0x0c37('0xb8'),_0x0c37('0xb9'),_0x195103);});}return respondWithRpcPromise('Start',_0x0c37('0xb9'),_0x195103);})[_0x0c37('0x26')](function(_0x1257ba){if(_0x1257ba){var _0x58568b=0xc8;var _0x719dbb='receiveMessage';logger[_0x0c37('0x27')](_0x0c37('0x2a'),_0x719dbb,_0x58568b,_0x0c37('0xba'));logger['debug'](_0x0c37('0xbb'),_0x719dbb,_0x58568b,_0x0c37('0xba'),JSON[_0x0c37('0x2b')](_0x1257ba));if(_0x195103[_0x0c37('0x8e')][_0x0c37('0x49')]==='twilio'){return _0x8e9f04['status'](_0x58568b)[_0x0c37('0xbc')](_0x0c37('0xbd'),_0x0c37('0xbe'))[_0x0c37('0x43')](_0x0c37('0xbf'));}else{return _0x8e9f04['status'](_0x58568b)[_0x0c37('0x35')](_0x1257ba);}}});})[_0x0c37('0x31')](handleError(_0x8e9f04,null));};exports[_0x0c37('0x43')]=function(_0x50bfe7,_0x102072,_0x383d1a){var _0x57dc9b,_0x502684,_0x862d43;if(_[_0x0c37('0xa0')](_0x50bfe7[_0x0c37('0x62')][_0x0c37('0x62')])||_0x50bfe7[_0x0c37('0x62')][_0x0c37('0x62')]===''){throw new db[(_0x0c37('0x95'))][(_0x0c37('0xa1'))](_0x0c37('0xa3'));}if(_[_0x0c37('0xa0')](_0x50bfe7[_0x0c37('0x62')]['to'])){throw new db[(_0x0c37('0x95'))][(_0x0c37('0xa1'))](_0x0c37('0xc0'));}_0x57dc9b=_0x50bfe7[_0x0c37('0x62')]['to'];return db[_0x0c37('0x47')][_0x0c37('0x60')]({'where':{'id':_0x50bfe7[_0x0c37('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0x0c37('0xc1'),'include':[{'model':db[_0x0c37('0xc2')],'as':_0x0c37('0xa9'),'where':{'mobile':_0x57dc9b},'limit':0x1,'order':[[_0x0c37('0xc3'),_0x0c37('0xa8')]]}]}]})[_0x0c37('0x26')](handleEntityNotFound(_0x102072,null))['then'](function(_0x2c6ae8){if(_0x2c6ae8&&_0x2c6ae8[_0x0c37('0xc1')]){_0x502684=_0x2c6ae8[_0x0c37('0x3f')]({'plain':!![]});if(_0x502684[_0x0c37('0xc1')]&&_0x502684[_0x0c37('0xc1')][_0x0c37('0xa9')][_0x0c37('0x52')]){return _0x502684[_0x0c37('0xc1')][_0x0c37('0xa9')][0x0];}return db['CmContact']['create'](_[_0x0c37('0x1d')](_0x50bfe7['body'],{'firstName':_0x57dc9b,'mobile':_0x57dc9b,'phone':_0x57dc9b,'ListId':_0x502684[_0x0c37('0xa7')]}));}})[_0x0c37('0x26')](handleEntityNotFound(_0x102072,null))['then'](function(_0x43d305){if(_0x43d305){_0x862d43=_0x43d305;return db[_0x0c37('0xab')][_0x0c37('0x60')]({'where':{'ContactId':_0x862d43['id'],'closed':![],'WhatsappAccountId':_0x502684['id']}})[_0x0c37('0x26')](function(_0x13f31d){if(_0x13f31d){return[_0x13f31d,![]];}return db[_0x0c37('0xab')][_0x0c37('0x61')]({'UserId':_0x50bfe7[_0x0c37('0x65')]['id'],'ContactId':_0x862d43['id'],'WhatsappAccountId':_0x502684['id'],'phone':_0x57dc9b,'firstMsgDirection':_0x0c37('0xc4'),'Messages':[_[_0x0c37('0x58')](_0x50bfe7[_0x0c37('0x62')],{'read':![],'body':_0x50bfe7[_0x0c37('0x62')][_0x0c37('0x62')],'phone':_0x57dc9b,'WhatsappAccountId':_0x502684['id'],'UserId':_0x50bfe7[_0x0c37('0x65')]['id'],'ContactId':_0x862d43['id']})]},{'include':[{'model':db[_0x0c37('0xb2')],'as':_0x0c37('0xc5')}]})['then'](function(_0x36a63c){return[_0x36a63c,!![]];});});}})[_0x0c37('0x79')](function(_0x491286,_0x10dfab){if(_0x10dfab){return _0x491286;}return db['WhatsappMessage'][_0x0c37('0x61')](_['merge'](_0x50bfe7[_0x0c37('0x62')],{'read':![],'body':_0x50bfe7[_0x0c37('0x62')]['body'],'phone':_0x57dc9b,'WhatsappAccountId':_0x502684['id'],'WhatsappInteractionId':_0x491286['id'],'UserId':_0x50bfe7[_0x0c37('0x65')]['id'],'ContactId':_0x862d43['id']}))[_0x0c37('0x26')](function(_0x462d7e){_0x491286[_0x0c37('0xc6')][_0x0c37('0xc5')]=[];_0x491286[_0x0c37('0xc6')][_0x0c37('0xc5')]['push'](_0x462d7e['dataValues']);return _0x491286;});})['then'](respondWithResult(_0x102072,null))['catch'](handleError(_0x102072,null));}; \ No newline at end of file +var _0x7425=['UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','findOne','hasOwnProperty','rows','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','pick','removeAnswers','addAgents','omit','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','sequelize','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','finally','send','getApplications','notify','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','Applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','isNil','Sequelize','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','Contacts','list','contact','WhatsappInteraction','interaction','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','DESC','List','Messages','spread','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','WhatsappAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','limit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','show','params','Pause','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5186da,_0x2d87cd){var _0x4974dc=function(_0x109da5){while(--_0x109da5){_0x5186da['push'](_0x5186da['shift']());}};_0x4974dc(++_0x2d87cd);}(_0x7425,0x121));var _0x5742=function(_0x3a69fd,_0x4feae3){_0x3a69fd=_0x3a69fd-0x0;var _0x153739=_0x7425[_0x3a69fd];return _0x153739;};'use strict';var emlformat=require(_0x5742('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5742('0x1'));var jsonpatch=require(_0x5742('0x2'));var rp=require('request-promise');var moment=require(_0x5742('0x3'));var BPromise=require(_0x5742('0x4'));var Mustache=require(_0x5742('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5742('0x6'));var csv=require(_0x5742('0x7'));var ejs=require(_0x5742('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5742('0x9'));var squel=require(_0x5742('0xa'));var crypto=require(_0x5742('0xb'));var jsforce=require(_0x5742('0xc'));var deskjs=require(_0x5742('0xd'));var toCsv=require(_0x5742('0x7'));var querystring=require(_0x5742('0xe'));var Papa=require('papaparse');var Redis=require(_0x5742('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5742('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5742('0x11'));var logger=require('../../config/logger')(_0x5742('0x12'));var utils=require('../../config/utils');var config=require(_0x5742('0x13'));var licenseUtil=require(_0x5742('0x14'));var db=require('../../mysqldb')['db'];config[_0x5742('0x15')]=_[_0x5742('0x16')](config[_0x5742('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5742('0x17'))(new Redis(config[_0x5742('0x15')]));require(_0x5742('0x18'))[_0x5742('0x19')](socket);var jayson=require(_0x5742('0x1a'));var client=jayson[_0x5742('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x325e0c,_0x57e860,_0x34028a,_0x5be720){return new BPromise(function(_0x4a293f,_0x2827ff){var _0x1e77ee=_0x5be720||client;return _0x1e77ee[_0x5742('0x1c')](_0x325e0c,_0x34028a)['then'](function(_0x5c4d65){logger[_0x5742('0x1d')](_0x5742('0x1e'),_0x57e860,_0x5742('0x1f'));logger['debug'](_0x5742('0x20'),_0x57e860,'request\x20sent',JSON['stringify'](_0x5c4d65));if(_0x5c4d65[_0x5742('0x21')]){if(_0x5c4d65[_0x5742('0x21')][_0x5742('0x22')]===0x1f4){logger['error'](_0x5742('0x1e'),_0x57e860,_0x5c4d65[_0x5742('0x21')][_0x5742('0x23')]);return _0x2827ff(_0x5c4d65[_0x5742('0x21')][_0x5742('0x23')]);}logger[_0x5742('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x57e860,_0x5c4d65['error'][_0x5742('0x23')]);return _0x4a293f(_0x5c4d65[_0x5742('0x21')][_0x5742('0x23')]);}else{logger[_0x5742('0x1d')](_0x5742('0x1e'),_0x57e860,_0x5742('0x1f'));_0x4a293f(_0x5c4d65[_0x5742('0x24')]['message']);}})[_0x5742('0x25')](function(_0xd709e4){logger[_0x5742('0x21')](_0x5742('0x1e'),_0x57e860,_0xd709e4);_0x2827ff(_0xd709e4);});});}function respondWithStatusCode(_0x51a665,_0x11664e){_0x11664e=_0x11664e||0xcc;return function(_0x2958ab){if(_0x2958ab){return _0x51a665[_0x5742('0x26')](_0x11664e);}return _0x51a665[_0x5742('0x27')](_0x11664e)[_0x5742('0x28')]();};}function respondWithResult(_0x2d25a3,_0x1b5cf0){_0x1b5cf0=_0x1b5cf0||0xc8;return function(_0x85ecd5){if(_0x85ecd5){return _0x2d25a3[_0x5742('0x27')](_0x1b5cf0)[_0x5742('0x29')](_0x85ecd5);}};}function respondWithFilteredResult(_0x2f72d0,_0x10dcdf){return function(_0x78774a){if(_0x78774a){var _0x362689=typeof _0x10dcdf[_0x5742('0x2a')]==='undefined'&&typeof _0x10dcdf['limit']===_0x5742('0x2b');var _0x1738d9=_0x78774a[_0x5742('0x2c')];var _0x23104c=_0x362689?0x0:_0x10dcdf[_0x5742('0x2a')];var _0x57122d=_0x362689?_0x78774a[_0x5742('0x2c')]:_0x10dcdf[_0x5742('0x2a')]+_0x10dcdf['limit'];var _0xf29864;if(_0x57122d>=_0x1738d9){_0x57122d=_0x1738d9;_0xf29864=0xc8;}else{_0xf29864=0xce;}_0x2f72d0[_0x5742('0x27')](_0xf29864);return _0x2f72d0[_0x5742('0x2d')](_0x5742('0x2e'),_0x23104c+'-'+_0x57122d+'/'+_0x1738d9)[_0x5742('0x29')](_0x78774a);}return null;};}function patchUpdates(_0x589cc7){return function(_0x372d83){try{jsonpatch[_0x5742('0x2f')](_0x372d83,_0x589cc7,!![]);}catch(_0xb46fa3){return BPromise[_0x5742('0x30')](_0xb46fa3);}return _0x372d83['save']();};}function saveUpdates(_0x158f43,_0x4ec29e){return function(_0x3c499f){if(_0x3c499f){return _0x3c499f[_0x5742('0x31')](_0x158f43)['then'](function(_0x5395ed){return _0x5395ed;});}return null;};}function removeEntity(_0x3bc98a,_0x252ef9){return function(_0x55fdae){if(_0x55fdae){return _0x55fdae[_0x5742('0x32')]()[_0x5742('0x33')](function(){var _0x3066c3=_0x55fdae['get']({'plain':!![]});var _0x38f022=_0x5742('0x34');return db[_0x5742('0x35')][_0x5742('0x32')]({'where':{'type':_0x38f022,'resourceId':_0x3066c3['id']}})[_0x5742('0x33')](function(){return _0x55fdae;});})[_0x5742('0x33')](function(){_0x3bc98a[_0x5742('0x27')](0xcc)[_0x5742('0x28')]();});}};}function handleEntityNotFound(_0x3beaac,_0x28dbc3){return function(_0x57728b){if(!_0x57728b){_0x3beaac[_0x5742('0x26')](0x194);}return _0x57728b;};}function handleError(_0x49315f,_0x2d384b){_0x2d384b=_0x2d384b||0x1f4;return function(_0x23e8d5){logger[_0x5742('0x21')](_0x23e8d5[_0x5742('0x36')]);if(_0x23e8d5['name']){delete _0x23e8d5[_0x5742('0x37')];}_0x49315f[_0x5742('0x27')](_0x2d384b)['send'](_0x23e8d5);};}exports[_0x5742('0x38')]=function(_0x483bb9,_0x3aa36c){var _0x226400={'include':[{'model':db['Pause'],'as':_0x5742('0x39')}]},_0x16cd18={},_0x597d98={'count':0x0,'rows':[]};var _0x7cde7f=_[_0x5742('0x3a')](db[_0x5742('0x3b')][_0x5742('0x3c')],function(_0x2429d3){return{'name':_0x2429d3['fieldName'],'type':_0x2429d3[_0x5742('0x3d')][_0x5742('0x3e')]};});_0x16cd18[_0x5742('0x3f')]=_['map'](_0x7cde7f,_0x5742('0x37'));_0x16cd18['query']=_[_0x5742('0x40')](_0x483bb9[_0x5742('0x41')]);_0x16cd18['filters']=_[_0x5742('0x42')](_0x16cd18['model'],_0x16cd18[_0x5742('0x41')]);_0x226400[_0x5742('0x43')]=_['intersection'](_0x16cd18['model'],qs[_0x5742('0x44')](_0x483bb9[_0x5742('0x41')]['fields']));_0x226400[_0x5742('0x43')]=_0x226400[_0x5742('0x43')][_0x5742('0x45')]?_0x226400[_0x5742('0x43')]:_0x16cd18[_0x5742('0x3f')];if(!_0x483bb9[_0x5742('0x41')]['hasOwnProperty']('nolimit')){_0x226400[_0x5742('0x46')]=qs['limit'](_0x483bb9[_0x5742('0x41')][_0x5742('0x46')]);_0x226400[_0x5742('0x2a')]=qs[_0x5742('0x2a')](_0x483bb9[_0x5742('0x41')][_0x5742('0x2a')]);}_0x226400[_0x5742('0x47')]=qs[_0x5742('0x48')](_0x483bb9['query'][_0x5742('0x48')]);_0x226400[_0x5742('0x49')]=qs[_0x5742('0x4a')](_['pick'](_0x483bb9[_0x5742('0x41')],_0x16cd18['filters']),_0x7cde7f);if(_0x483bb9[_0x5742('0x41')][_0x5742('0x4b')]){_0x226400[_0x5742('0x49')]=_[_0x5742('0x4c')](_0x226400[_0x5742('0x49')],{'$or':_[_0x5742('0x3a')](_0x7cde7f,function(_0x57bb69){if(_0x57bb69[_0x5742('0x3d')]!=='VIRTUAL'){var _0x3cf0bf={};_0x3cf0bf[_0x57bb69[_0x5742('0x37')]]={'$like':'%'+_0x483bb9[_0x5742('0x41')]['filter']+'%'};return _0x3cf0bf;}})});}_0x226400=_['merge']({},_0x226400,_0x483bb9[_0x5742('0x4d')]);var _0x3b02e6={'where':_0x226400[_0x5742('0x49')]};return db[_0x5742('0x3b')][_0x5742('0x2c')](_0x3b02e6)[_0x5742('0x33')](function(_0x1be066){_0x597d98['count']=_0x1be066;if(_0x483bb9['query'][_0x5742('0x4e')]){_0x226400[_0x5742('0x4f')]=[{'all':!![]}];}return db[_0x5742('0x3b')][_0x5742('0x50')](_0x226400);})['then'](function(_0x54939e){_0x597d98['rows']=_0x54939e;return _0x597d98;})['then'](respondWithFilteredResult(_0x3aa36c,_0x226400))[_0x5742('0x25')](handleError(_0x3aa36c,null));};exports[_0x5742('0x51')]=function(_0x406b4a,_0xf63067){var _0x411582={'raw':![],'where':{'id':_0x406b4a[_0x5742('0x52')]['id']},'include':[{'model':db[_0x5742('0x53')],'as':'mandatoryDispositionPause'}]},_0x27a5f0={};_0x27a5f0['model']=_['keys'](db['WhatsappAccount']['rawAttributes']);_0x27a5f0[_0x5742('0x41')]=_['keys'](_0x406b4a[_0x5742('0x41')]);_0x27a5f0['filters']=_[_0x5742('0x42')](_0x27a5f0[_0x5742('0x3f')],_0x27a5f0['query']);_0x411582[_0x5742('0x43')]=_[_0x5742('0x42')](_0x27a5f0[_0x5742('0x3f')],qs[_0x5742('0x44')](_0x406b4a[_0x5742('0x41')][_0x5742('0x44')]));_0x411582['attributes']=_0x411582[_0x5742('0x43')][_0x5742('0x45')]?_0x411582[_0x5742('0x43')]:_0x27a5f0[_0x5742('0x3f')];if(_0x406b4a[_0x5742('0x41')][_0x5742('0x4e')]){_0x411582['include']=[{'all':!![]}];}_0x411582=_[_0x5742('0x4c')]({},_0x411582,_0x406b4a[_0x5742('0x4d')]);return db[_0x5742('0x3b')][_0x5742('0x54')](_0x411582)[_0x5742('0x33')](handleEntityNotFound(_0xf63067,null))[_0x5742('0x33')](respondWithResult(_0xf63067,null))[_0x5742('0x25')](handleError(_0xf63067,null));};exports[_0x5742('0x55')]=function(_0x445eca,_0xe2df9c){return db[_0x5742('0x3b')]['create'](_0x445eca['body'],{})[_0x5742('0x33')](function(_0x3c7176){var _0x1cbaec=_0x445eca[_0x5742('0x56')][_0x5742('0x57')]({'plain':!![]});if(!_0x1cbaec)throw new Error(_0x5742('0x58'));if(_0x1cbaec['role']===_0x5742('0x56')){var _0x2953a3=_0x3c7176[_0x5742('0x57')]({'plain':!![]});var _0x5ce996=_0x5742('0x34');return db[_0x5742('0x59')][_0x5742('0x54')]({'where':{'name':_0x5ce996,'userProfileId':_0x1cbaec[_0x5742('0x5a')]},'raw':!![]})['then'](function(_0x4b98f8){if(_0x4b98f8&&_0x4b98f8['autoAssociation']===0x0){return db[_0x5742('0x35')][_0x5742('0x55')]({'name':_0x2953a3[_0x5742('0x37')],'resourceId':_0x2953a3['id'],'type':_0x4b98f8[_0x5742('0x37')],'sectionId':_0x4b98f8['id']},{})[_0x5742('0x33')](function(){return _0x3c7176;});}else{return _0x3c7176;}})[_0x5742('0x25')](function(_0x46708e){logger[_0x5742('0x21')](_0x5742('0x5b'),_0x46708e);throw _0x46708e;});}return _0x3c7176;})[_0x5742('0x33')](respondWithResult(_0xe2df9c,0xc9))[_0x5742('0x25')](handleError(_0xe2df9c,null));};exports[_0x5742('0x31')]=function(_0x2df402,_0x18f848){if(_0x2df402['body']['id']){delete _0x2df402[_0x5742('0x5c')]['id'];}return db[_0x5742('0x3b')][_0x5742('0x54')]({'where':{'id':_0x2df402[_0x5742('0x52')]['id']},'include':[{'model':db[_0x5742('0x53')],'as':_0x5742('0x39')}]})[_0x5742('0x33')](handleEntityNotFound(_0x18f848,null))[_0x5742('0x33')](saveUpdates(_0x2df402[_0x5742('0x5c')],null))['then'](respondWithResult(_0x18f848,null))[_0x5742('0x25')](handleError(_0x18f848,null));};exports[_0x5742('0x32')]=function(_0x37c64c,_0x4feebe){return db[_0x5742('0x3b')][_0x5742('0x54')]({'where':{'id':_0x37c64c[_0x5742('0x52')]['id']}})[_0x5742('0x33')](handleEntityNotFound(_0x4feebe,null))[_0x5742('0x33')](removeEntity(_0x4feebe,null))[_0x5742('0x25')](handleError(_0x4feebe,null));};exports[_0x5742('0x5d')]=function(_0x14adc7,_0x13e2a0){return db[_0x5742('0x3b')][_0x5742('0x5d')]()[_0x5742('0x33')](respondWithResult(_0x13e2a0,null))[_0x5742('0x25')](handleError(_0x13e2a0,null));};exports[_0x5742('0x5e')]=function(_0x3d8a1f,_0xf9918a,_0x409df7){if(_0x3d8a1f['body']['id']){delete _0x3d8a1f[_0x5742('0x5c')]['id'];}return db['WhatsappAccount'][_0x5742('0x54')]({'where':{'id':_0x3d8a1f[_0x5742('0x52')]['id']}})[_0x5742('0x33')](handleEntityNotFound(_0xf9918a,null))[_0x5742('0x33')](function(_0x198538){if(_0x198538){_0x3d8a1f[_0x5742('0x5c')][_0x5742('0x5f')]=_0x198538['id'];return db[_0x5742('0x60')][_0x5742('0x55')](_0x3d8a1f[_0x5742('0x5c')]);}})[_0x5742('0x33')](respondWithResult(_0xf9918a,null))[_0x5742('0x25')](handleError(_0xf9918a,null));};exports['getDispositions']=function(_0x5f5318,_0x3d7f5c,_0x44ff75){var _0x1de6f6={'raw':![],'where':{}};var _0x423166={};var _0x71ebff={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5742('0x61')]({'where':{'id':_0x5f5318['params']['id']}})['then'](handleEntityNotFound(_0x3d7f5c,null))['then'](function(_0x377c76){if(_0x377c76){_0x423166[_0x5742('0x3f')]=_[_0x5742('0x40')](db[_0x5742('0x60')][_0x5742('0x3c')]);_0x423166[_0x5742('0x41')]=_[_0x5742('0x40')](_0x5f5318[_0x5742('0x41')]);_0x423166['filters']=_['intersection'](_0x423166[_0x5742('0x3f')],_0x423166[_0x5742('0x41')]);_0x1de6f6[_0x5742('0x43')]=_[_0x5742('0x42')](_0x423166['model'],qs[_0x5742('0x44')](_0x5f5318['query'][_0x5742('0x44')]));_0x1de6f6[_0x5742('0x43')]=_0x1de6f6[_0x5742('0x43')][_0x5742('0x45')]?_0x1de6f6['attributes']:_0x423166['model'];if(!_0x5f5318['query'][_0x5742('0x62')]('nolimit')){_0x1de6f6[_0x5742('0x46')]=qs[_0x5742('0x46')](_0x5f5318[_0x5742('0x41')][_0x5742('0x46')]);_0x1de6f6[_0x5742('0x2a')]=qs['offset'](_0x5f5318[_0x5742('0x41')]['offset']);}_0x1de6f6[_0x5742('0x47')]=qs['sort'](_0x5f5318[_0x5742('0x41')][_0x5742('0x48')]);_0x1de6f6['where']=qs['filters'](_['pick'](_0x5f5318[_0x5742('0x41')],_0x423166[_0x5742('0x4a')]));_0x1de6f6[_0x5742('0x49')][_0x5742('0x5f')]=_0x377c76['id'];if(_0x5f5318['query']['filter']){_0x1de6f6['where']=_[_0x5742('0x4c')](_0x1de6f6['where'],{'$or':_[_0x5742('0x3a')](_0x1de6f6[_0x5742('0x43')],function(_0x57f4e4){var _0x14a9cd={};_0x14a9cd[_0x57f4e4]={'$like':'%'+_0x5f5318[_0x5742('0x41')][_0x5742('0x4b')]+'%'};return _0x14a9cd;})});}_0x1de6f6=_['merge']({},_0x1de6f6,_0x5f5318[_0x5742('0x4d')]);return db[_0x5742('0x60')][_0x5742('0x2c')]({'where':_0x1de6f6[_0x5742('0x49')]})[_0x5742('0x33')](function(_0x1a6f17){_0x71ebff[_0x5742('0x2c')]=_0x1a6f17;if(_0x5f5318['query'][_0x5742('0x4e')]){_0x1de6f6['include']=[{'all':!![]}];}return db['Disposition'][_0x5742('0x50')](_0x1de6f6);})[_0x5742('0x33')](function(_0x4d4ab5){_0x71ebff[_0x5742('0x63')]=_0x4d4ab5;return _0x71ebff;});}})[_0x5742('0x33')](respondWithFilteredResult(_0x3d7f5c,_0x1de6f6))[_0x5742('0x25')](handleError(_0x3d7f5c,null));};exports[_0x5742('0x64')]=function(_0x501056,_0xc30dc8,_0x4e01dc){return db[_0x5742('0x3b')]['find']({'where':{'id':_0x501056[_0x5742('0x52')]['id']}})[_0x5742('0x33')](handleEntityNotFound(_0xc30dc8,null))['then'](function(_0x388876){if(_0x388876){return _0x388876[_0x5742('0x64')](_0x501056['query'][_0x5742('0x65')]);}})[_0x5742('0x33')](respondWithStatusCode(_0xc30dc8,null))[_0x5742('0x25')](handleError(_0xc30dc8,null));};exports['addAnswer']=function(_0x53d524,_0x4b1995,_0x4ee4d1){if(_0x53d524[_0x5742('0x5c')]['id']){delete _0x53d524[_0x5742('0x5c')]['id'];}return db['WhatsappAccount'][_0x5742('0x54')]({'where':{'id':_0x53d524[_0x5742('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b1995,null))[_0x5742('0x33')](function(_0x2653cc){if(_0x2653cc){_0x53d524[_0x5742('0x5c')]['WhatsappAccountId']=_0x2653cc['id'];return db[_0x5742('0x66')][_0x5742('0x55')](_0x53d524[_0x5742('0x5c')]);}})['then'](respondWithResult(_0x4b1995,null))[_0x5742('0x25')](handleError(_0x4b1995,null));};exports[_0x5742('0x67')]=function(_0x53e73f,_0x135961,_0x1168dc){var _0x3d8822={'raw':![],'where':{}};var _0x5d9470={};var _0x5c6966={'count':0x0,'rows':[]};return db[_0x5742('0x3b')]['findOne']({'where':{'id':_0x53e73f[_0x5742('0x52')]['id']}})[_0x5742('0x33')](handleEntityNotFound(_0x135961,null))['then'](function(_0xb5c7a4){if(_0xb5c7a4){_0x5d9470[_0x5742('0x3f')]=_[_0x5742('0x40')](db[_0x5742('0x66')]['rawAttributes']);_0x5d9470[_0x5742('0x41')]=_[_0x5742('0x40')](_0x53e73f[_0x5742('0x41')]);_0x5d9470['filters']=_[_0x5742('0x42')](_0x5d9470[_0x5742('0x3f')],_0x5d9470[_0x5742('0x41')]);_0x3d8822[_0x5742('0x43')]=_['intersection'](_0x5d9470['model'],qs[_0x5742('0x44')](_0x53e73f[_0x5742('0x41')][_0x5742('0x44')]));_0x3d8822[_0x5742('0x43')]=_0x3d8822[_0x5742('0x43')][_0x5742('0x45')]?_0x3d8822[_0x5742('0x43')]:_0x5d9470['model'];if(!_0x53e73f['query'][_0x5742('0x62')](_0x5742('0x68'))){_0x3d8822[_0x5742('0x46')]=qs[_0x5742('0x46')](_0x53e73f['query']['limit']);_0x3d8822[_0x5742('0x2a')]=qs[_0x5742('0x2a')](_0x53e73f[_0x5742('0x41')][_0x5742('0x2a')]);}_0x3d8822[_0x5742('0x47')]=qs[_0x5742('0x48')](_0x53e73f['query'][_0x5742('0x48')]);_0x3d8822[_0x5742('0x49')]=qs[_0x5742('0x4a')](_[_0x5742('0x69')](_0x53e73f[_0x5742('0x41')],_0x5d9470[_0x5742('0x4a')]));_0x3d8822[_0x5742('0x49')]['WhatsappAccountId']=_0xb5c7a4['id'];if(_0x53e73f['query'][_0x5742('0x4b')]){_0x3d8822[_0x5742('0x49')]=_[_0x5742('0x4c')](_0x3d8822[_0x5742('0x49')],{'$or':_[_0x5742('0x3a')](_0x3d8822[_0x5742('0x43')],function(_0x326a5f){var _0x40f6af={};_0x40f6af[_0x326a5f]={'$like':'%'+_0x53e73f['query'][_0x5742('0x4b')]+'%'};return _0x40f6af;})});}_0x3d8822=_[_0x5742('0x4c')]({},_0x3d8822,_0x53e73f['options']);return db[_0x5742('0x66')][_0x5742('0x2c')]({'where':_0x3d8822['where']})[_0x5742('0x33')](function(_0x62432c){_0x5c6966[_0x5742('0x2c')]=_0x62432c;if(_0x53e73f[_0x5742('0x41')][_0x5742('0x4e')]){_0x3d8822[_0x5742('0x4f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5742('0x50')](_0x3d8822);})[_0x5742('0x33')](function(_0x28429a){_0x5c6966['rows']=_0x28429a;return _0x5c6966;});}})['then'](respondWithFilteredResult(_0x135961,_0x3d8822))[_0x5742('0x25')](handleError(_0x135961,null));};exports[_0x5742('0x6a')]=function(_0x33e828,_0x3a005b,_0x3e510d){return db[_0x5742('0x3b')][_0x5742('0x54')]({'where':{'id':_0x33e828['params']['id']}})[_0x5742('0x33')](handleEntityNotFound(_0x3a005b,null))[_0x5742('0x33')](function(_0x4ff220){if(_0x4ff220){return _0x4ff220[_0x5742('0x6a')](_0x33e828[_0x5742('0x41')][_0x5742('0x65')]);}})[_0x5742('0x33')](respondWithStatusCode(_0x3a005b,null))[_0x5742('0x25')](handleError(_0x3a005b,null));};exports['addAgents']=function(_0x363704,_0xd5e3cb,_0x41029e){return db[_0x5742('0x3b')]['find']({'where':{'id':_0x363704[_0x5742('0x52')]['id']}})[_0x5742('0x33')](handleEntityNotFound(_0xd5e3cb,null))[_0x5742('0x33')](function(_0x366914){if(_0x366914){return _0x366914[_0x5742('0x6b')](_0x363704[_0x5742('0x5c')][_0x5742('0x65')],_[_0x5742('0x6c')](_0x363704[_0x5742('0x5c')],[_0x5742('0x65'),'id'])||{})['spread'](function(_0x33950f){for(var _0x1c8552=0x0;_0x1c8552<_0x363704[_0x5742('0x5c')][_0x5742('0x65')][_0x5742('0x45')];_0x1c8552+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x363704[_0x5742('0x5c')]['ids'][_0x1c8552]),'WhatsappAccountId':Number(_0x363704[_0x5742('0x52')]['id'])});}return _0x33950f;});}})[_0x5742('0x33')](respondWithResult(_0xd5e3cb,null))[_0x5742('0x25')](handleError(_0xd5e3cb,null));};exports['removeAgents']=function(_0x1c2e3c,_0x536afb,_0x5b0b4d){return db[_0x5742('0x3b')][_0x5742('0x54')]({'where':{'id':_0x1c2e3c[_0x5742('0x52')]['id']}})[_0x5742('0x33')](handleEntityNotFound(_0x536afb,null))[_0x5742('0x33')](function(_0x4fcfa8){if(_0x4fcfa8){return _0x4fcfa8[_0x5742('0x6d')](_0x1c2e3c[_0x5742('0x41')]['ids'])[_0x5742('0x33')](function(){if(_['isArray'](_0x1c2e3c[_0x5742('0x41')][_0x5742('0x65')])){for(var _0x355ec0=0x0;_0x355ec0<_0x1c2e3c[_0x5742('0x41')]['ids'][_0x5742('0x45')];_0x355ec0+=0x1){socket[_0x5742('0x6e')](_0x5742('0x6f'),{'UserId':Number(_0x1c2e3c['query']['ids'][_0x355ec0]),'WhatsappAccountId':Number(_0x1c2e3c[_0x5742('0x52')]['id'])});}}else{socket[_0x5742('0x6e')]('userWhatsappAccount:remove',{'UserId':Number(_0x1c2e3c[_0x5742('0x41')]['ids']),'WhatsappAccountId':Number(_0x1c2e3c[_0x5742('0x52')]['id'])});}});}})[_0x5742('0x33')](respondWithStatusCode(_0x536afb,null))[_0x5742('0x25')](handleError(_0x536afb,null));};exports[_0x5742('0x70')]=function(_0x217fae,_0x3c54e6,_0x4c2387){var _0x464821={};var _0x5379f0={};var _0x1cc84f;var _0x40cea8;return db[_0x5742('0x3b')][_0x5742('0x61')]({'where':{'id':_0x217fae[_0x5742('0x52')]['id']}})['then'](handleEntityNotFound(_0x3c54e6,null))[_0x5742('0x33')](function(_0x27cb52){if(_0x27cb52){_0x1cc84f=_0x27cb52;_0x5379f0[_0x5742('0x3f')]=_[_0x5742('0x40')](db[_0x5742('0x71')][_0x5742('0x3c')]);_0x5379f0['query']=_[_0x5742('0x40')](_0x217fae[_0x5742('0x41')]);_0x5379f0[_0x5742('0x4a')]=_['intersection'](_0x5379f0['model'],_0x5379f0[_0x5742('0x41')]);_0x464821[_0x5742('0x43')]=_[_0x5742('0x42')](_0x5379f0['model'],qs[_0x5742('0x44')](_0x217fae[_0x5742('0x41')][_0x5742('0x44')]));_0x464821[_0x5742('0x43')]=_0x464821[_0x5742('0x43')][_0x5742('0x45')]?_0x464821[_0x5742('0x43')]:_0x5379f0['model'];_0x464821[_0x5742('0x47')]=qs[_0x5742('0x48')](_0x217fae[_0x5742('0x41')][_0x5742('0x48')]);_0x464821[_0x5742('0x49')]=qs['filters'](_['pick'](_0x217fae[_0x5742('0x41')],_0x5379f0[_0x5742('0x4a')]));if(_0x217fae[_0x5742('0x41')][_0x5742('0x4b')]){_0x464821['where']=_[_0x5742('0x4c')](_0x464821[_0x5742('0x49')],{'$or':_[_0x5742('0x3a')](_0x464821[_0x5742('0x43')],function(_0x2b204e){var _0x53bb8b={};_0x53bb8b[_0x2b204e]={'$like':'%'+_0x217fae[_0x5742('0x41')]['filter']+'%'};return _0x53bb8b;})});}_0x464821=_['merge']({},_0x464821,_0x217fae[_0x5742('0x4d')]);return _0x1cc84f[_0x5742('0x70')](_0x464821);}})['then'](function(_0x4fa5eb){if(_0x4fa5eb){_0x40cea8=_0x4fa5eb[_0x5742('0x45')];if(!_0x217fae[_0x5742('0x41')][_0x5742('0x62')](_0x5742('0x68'))){_0x464821[_0x5742('0x46')]=qs['limit'](_0x217fae[_0x5742('0x41')][_0x5742('0x46')]);_0x464821[_0x5742('0x2a')]=qs['offset'](_0x217fae[_0x5742('0x41')][_0x5742('0x2a')]);}return _0x1cc84f[_0x5742('0x70')](_0x464821);}})[_0x5742('0x33')](function(_0x1be6a0){if(_0x1be6a0){return _0x1be6a0?{'count':_0x40cea8,'rows':_0x1be6a0}:null;}})['then'](respondWithResult(_0x3c54e6,null))[_0x5742('0x25')](handleError(_0x3c54e6,null));};exports['addApplications']=function(_0x25301a,_0x32a543){var _0x5e196f=_0x25301a[_0x5742('0x52')]['id'];var _0x579851=_0x25301a['body'];var _0x2a7774=0xc8;var _0x302eff=null;return db[_0x5742('0x72')]['transaction']({'isolationLevel':db[_0x5742('0x72')][_0x5742('0x73')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5000ff){return db[_0x5742('0x3b')][_0x5742('0x61')]({'where':{'id':_0x5e196f},'transaction':_0x5000ff})[_0x5742('0x33')](function(_0x47159f){if(_0x47159f){return db[_0x5742('0x74')][_0x5742('0x32')]({'where':{'WhatsappAccountId':_0x5e196f},'transaction':_0x5000ff})[_0x5742('0x33')](function(){var _0x4a17d0=_['map'](_0x579851,function(_0x430831){_0x430831['WhatsappAccountId']=_0x5e196f;return _0x430831;});return db[_0x5742('0x74')][_0x5742('0x75')](_0x4a17d0,{'transaction':_0x5000ff});});}else{_0x2a7774=0x194;_0x302eff=[];}});})[_0x5742('0x33')](function(){if(_0x2a7774!==0x194){return db[_0x5742('0x74')][_0x5742('0x76')]({'where':{'WhatsappAccountId':_0x5e196f},'order':'priority'})['then'](function(_0x3bf85d){_0x302eff=_0x3bf85d;});}})[_0x5742('0x25')](function(_0x262e5a){_0x2a7774=0x1f4;logger['error'](_0x262e5a[_0x5742('0x36')]);if(_0x262e5a[_0x5742('0x37')]){delete _0x262e5a[_0x5742('0x37')];}_0x302eff=_0x262e5a;})[_0x5742('0x77')](function(){if(_0x302eff===null){_0x32a543[_0x5742('0x26')](_0x2a7774);}else{if(_0x2a7774===0x1f4){_0x32a543[_0x5742('0x27')](_0x2a7774)[_0x5742('0x78')](_0x302eff);}else{_0x32a543[_0x5742('0x27')](_0x2a7774)[_0x5742('0x29')](_0x302eff);}}});};exports['getApplications']=function(_0xca0201,_0x731bab,_0x10ba51){var _0x3ae63d={};var _0x33d33f={};var _0x239f0d;var _0x31f23e;return db['WhatsappAccount']['findOne']({'where':{'id':_0xca0201['params']['id']}})[_0x5742('0x33')](handleEntityNotFound(_0x731bab,null))[_0x5742('0x33')](function(_0x49fbb5){if(_0x49fbb5){_0x239f0d=_0x49fbb5;_0x33d33f[_0x5742('0x3f')]=_[_0x5742('0x40')](db[_0x5742('0x74')][_0x5742('0x3c')]);_0x33d33f[_0x5742('0x41')]=_[_0x5742('0x40')](_0xca0201['query']);_0x33d33f[_0x5742('0x4a')]=_[_0x5742('0x42')](_0x33d33f['model'],_0x33d33f[_0x5742('0x41')]);_0x3ae63d[_0x5742('0x43')]=_[_0x5742('0x42')](_0x33d33f[_0x5742('0x3f')],qs['fields'](_0xca0201[_0x5742('0x41')][_0x5742('0x44')]));_0x3ae63d['attributes']=_0x3ae63d[_0x5742('0x43')][_0x5742('0x45')]?_0x3ae63d['attributes']:_0x33d33f[_0x5742('0x3f')];_0x3ae63d['order']=qs[_0x5742('0x48')](_0xca0201['query']['sort']);_0x3ae63d[_0x5742('0x49')]=qs[_0x5742('0x4a')](_[_0x5742('0x69')](_0xca0201[_0x5742('0x41')],_0x33d33f[_0x5742('0x4a')]));if(_0xca0201[_0x5742('0x41')][_0x5742('0x4b')]){_0x3ae63d['where']=_[_0x5742('0x4c')](_0x3ae63d['where'],{'$or':_[_0x5742('0x3a')](_0x3ae63d[_0x5742('0x43')],function(_0x12ebdd){var _0x403afc={};_0x403afc[_0x12ebdd]={'$like':'%'+_0xca0201[_0x5742('0x41')][_0x5742('0x4b')]+'%'};return _0x403afc;})});}_0x3ae63d=_[_0x5742('0x4c')]({},_0x3ae63d,_0xca0201[_0x5742('0x4d')]);return _0x239f0d[_0x5742('0x79')](_0x3ae63d);}})['then'](function(_0x466548){if(_0x466548){_0x31f23e=_0x466548[_0x5742('0x45')];if(!_0xca0201[_0x5742('0x41')][_0x5742('0x62')](_0x5742('0x68'))){_0x3ae63d[_0x5742('0x46')]=qs[_0x5742('0x46')](_0xca0201[_0x5742('0x41')][_0x5742('0x46')]);_0x3ae63d[_0x5742('0x2a')]=qs['offset'](_0xca0201[_0x5742('0x41')][_0x5742('0x2a')]);}return _0x239f0d[_0x5742('0x79')](_0x3ae63d);}})['then'](function(_0x1f902b){if(_0x1f902b){return _0x1f902b?{'count':_0x31f23e,'rows':_0x1f902b}:null;}})['then'](respondWithResult(_0x731bab,null))['catch'](handleError(_0x731bab,null));};exports[_0x5742('0x7a')]=function(_0x556d87,_0x4322fb,_0x495289){var _0x38abcd={'channel':_0x5742('0x7b')};var _0x26ad5f=[];var _0xfe0419=[];var _0x485242={};return db['WhatsappAccount'][_0x5742('0x54')]({'where':{'id':_0x556d87[_0x5742('0x52')]['id']},'include':[{'model':db[_0x5742('0x74')],'as':'Applications'}]})[_0x5742('0x33')](handleEntityNotFound(_0x4322fb,null))[_0x5742('0x33')](function(_0xadbfff){_0x38abcd['account']=_0xadbfff;if(_0x38abcd[_0x5742('0x7c')]&&_0x38abcd['account'][_0x5742('0x3d')]===_0x5742('0x7d')&&_0x556d87['body']['statuses']){if(_0x556d87[_0x5742('0x5c')][_0x5742('0x7e')][_0x5742('0x45')]===0x0)return;if(_0x556d87[_0x5742('0x5c')]['statuses'][0x0][_0x5742('0x7f')]!==_0x5742('0x80'))return;return db[_0x5742('0x81')][_0x5742('0x31')]({'read':!![],'readAt':_0x556d87[_0x5742('0x5c')][_0x5742('0x7e')][0x0][_0x5742('0x82')]},{'where':{'messageId':_0x556d87[_0x5742('0x5c')][_0x5742('0x7e')][0x0][_0x5742('0x83')]},'individualHooks':!![]})[_0x5742('0x33')](function(_0x85f84b){return _0x4322fb[_0x5742('0x27')](0xc8)[_0x5742('0x29')](_0x85f84b);});}_0x38abcd[_0x5742('0x84')]=_['orderBy'](_0xadbfff[_0x5742('0x85')],[_0x5742('0x86')],[_0x5742('0x87')]);if(_0x38abcd[_0x5742('0x7c')][_0x5742('0x85')]){delete _0x38abcd[_0x5742('0x7c')][_0x5742('0x85')];}return db[_0x5742('0x88')][_0x5742('0x5d')]()['then'](function(_0x5a6387){if(!_0x5a6387){throw new db['Sequelize'][(_0x5742('0x89'))](_0x5742('0x8a'));}_0x26ad5f=_[_0x5742('0x8b')](_['keys'](_0x5a6387),[_0x5742('0x8c'),_0x5742('0x8d')]);_0xfe0419=_[_0x5742('0x8b')](_[_0x5742('0x40')](_0x5a6387),[_0x5742('0x8c'),_0x5742('0x8d'),'CompanyId',_0x5742('0x8e')]);_0x38abcd[_0x5742('0x5c')]={'mapKey':_0x5742('0x8f')};if(_0x38abcd[_0x5742('0x7c')]&&_0x38abcd[_0x5742('0x7c')][_0x5742('0x3d')]===_0x5742('0x90')){_0x38abcd['body'][_0x5742('0x91')]=_0x556d87[_0x5742('0x5c')][_0x5742('0x92')][_0x5742('0x93')]('whatsapp:','');_0x38abcd['body'][_0x5742('0x5c')]=_0x556d87[_0x5742('0x5c')][_0x5742('0x94')];_0x38abcd[_0x5742('0x5c')][_0x5742('0x95')]=_0x556d87[_0x5742('0x5c')][_0x5742('0x96')];}if(_0x38abcd[_0x5742('0x7c')]&&_0x38abcd['account']['type']==='sinch'){_0x38abcd['body'][_0x5742('0x91')]=_0x556d87[_0x5742('0x5c')]['notifications'][0x0]['from'];_0x38abcd[_0x5742('0x5c')]['body']=_0x556d87[_0x5742('0x5c')][_0x5742('0x97')][0x0][_0x5742('0x23')]['body'];_0x38abcd[_0x5742('0x5c')][_0x5742('0x95')]=_0x556d87[_0x5742('0x5c')][_0x5742('0x97')][0x0]['message_id'];}if(_0x38abcd[_0x5742('0x5c')]['id']){delete _0x38abcd[_0x5742('0x5c')]['id'];}if(_[_0x5742('0x98')](_0x38abcd['body'][_0x5742('0x91')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x5742('0x98')](_0x38abcd['body']['body'])||_0x38abcd[_0x5742('0x5c')]['body']===''){throw new db[(_0x5742('0x99'))][(_0x5742('0x89'))](_0x5742('0x9a'));}if(_[_0x5742('0x98')](_0x38abcd[_0x5742('0x5c')][_0x5742('0x9b')])){throw new db[(_0x5742('0x99'))][(_0x5742('0x89'))](_0x5742('0x9c')+_0xfe0419);}if(!_[_0x5742('0x9d')](_0xfe0419,_0x38abcd['body'][_0x5742('0x9b')])){throw new db[(_0x5742('0x99'))]['ValidationError'](_0x5742('0x9e')+_0xfe0419);}_0x485242[_0x38abcd[_0x5742('0x5c')][_0x5742('0x9b')]]=_0x38abcd[_0x5742('0x5c')][_0x5742('0x91')];return db['CmList'][_0x5742('0x54')]({'where':{'id':_0x38abcd[_0x5742('0x7c')][_0x5742('0x8e')]},'include':[{'model':db[_0x5742('0x88')],'as':_0x5742('0x9f'),'where':_0x485242,'limit':0x1,'order':[[_0x5742('0x8d'),'DESC']]}]});})['then'](handleEntityNotFound(_0x4322fb,null))['then'](function(_0x3f9071){if(_0x3f9071){_0x38abcd[_0x5742('0xa0')]=_['omit'](_0x3f9071,[_0x5742('0x9f')]);if(_0x3f9071[_0x5742('0x9f')][_0x5742('0x45')]){return _0x3f9071[_0x5742('0x9f')][0x0];}var _0x5ef052=_[_0x5742('0x16')](_0x38abcd[_0x5742('0x5c')],{'firstName':_0x38abcd[_0x5742('0x5c')]['from'],'ListId':_0x3f9071['id']});_0x5ef052[_0x38abcd[_0x5742('0x5c')][_0x5742('0x9b')]]=_0x38abcd[_0x5742('0x5c')]['from'];return db[_0x5742('0x88')]['create'](_0x5ef052,{'fields':_0x26ad5f,'raw':!![]});}})[_0x5742('0x33')](handleEntityNotFound(_0x4322fb,null))['then'](function(_0x357de7){if(_0x357de7){_0x38abcd[_0x5742('0xa1')]=_0x357de7;var _0x427a17={'ContactId':_0x357de7['id'],'phone':_0x38abcd[_0x5742('0x5c')][_0x5742('0x91')],'WhatsappAccountId':_0x556d87[_0x5742('0x52')]['id']};var _0x5c00da={'ContactId':_0x357de7['id'],'WhatsappAccountId':_0x556d87[_0x5742('0x52')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x5c00da})[_0x5742('0x33')](function(_0xc85037){if(_0xc85037){return[_0xc85037,![]];}return db[_0x5742('0xa2')][_0x5742('0x55')](_0x427a17)[_0x5742('0x33')](function(_0x19180c){return[_0x19180c,!![]];});});}})['spread'](function(_0x5f0522,_0x1530e5){_0x38abcd[_0x5742('0xa3')]=_0x5f0522[_0x5742('0x57')]({'plain':!![]});_0x38abcd[_0x5742('0xa3')]['created']=![];if(_0x1530e5){if(_0x38abcd[_0x5742('0x7c')][_0x5742('0xa4')]){_0x38abcd[_0x5742('0x84')]['push']({'id':0x0,'priority':_0x38abcd[_0x5742('0x84')]['length']+0x1,'app':_0x5742('0xa5'),'appdata':_0x5742('0xa6'),'interval':_0x5742('0xa7')});}_0x38abcd[_0x5742('0xa3')]['created']=!![];}return db[_0x5742('0x81')]['create']({'phone':_0x38abcd['body'][_0x5742('0x91')],'messageId':_0x38abcd['body']['messageId'],'body':_0x38abcd[_0x5742('0x5c')][_0x5742('0x5c')],'WhatsappAccountId':_0x556d87['params']['id'],'WhatsappInteractionId':_0x5f0522['id'],'direction':'in','ContactId':_0x5f0522[_0x5742('0xa8')],'AttachmentId':_0x38abcd[_0x5742('0x5c')][_0x5742('0xa9')]});})[_0x5742('0x33')](function(_0x102b7d){_0x38abcd[_0x5742('0x23')]=_0x102b7d;if(_0x38abcd[_0x5742('0xa3')]['UserId']){return db[_0x5742('0x71')][_0x5742('0x54')]({'attributes':['id',_0x5742('0x37')],'where':{'id':_0x38abcd[_0x5742('0xa3')][_0x5742('0xaa')]}})[_0x5742('0x33')](function(_0x5d3d68){if(_0x5d3d68){_0x38abcd['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5742('0xab'),'appdata':_0x5d3d68['name']+','+(_0x38abcd[_0x5742('0x7c')]['waitForTheAssignedAgent']||0xa),'interval':_0x5742('0xa7')});}return respondWithRpcPromise(_0x5742('0xac'),_0x5742('0xad'),_0x38abcd);});}return respondWithRpcPromise('Start',_0x5742('0xad'),_0x38abcd);})['then'](function(_0x3026fd){if(_0x3026fd){var _0x3c8b51=0xc8;var _0x2e11d3=_0x5742('0xae');logger[_0x5742('0x1d')](_0x5742('0x20'),_0x2e11d3,_0x3c8b51,_0x5742('0xaf'));logger[_0x5742('0xb0')](_0x5742('0xb1'),_0x2e11d3,_0x3c8b51,_0x5742('0xaf'),JSON[_0x5742('0xb2')](_0x3026fd));if(_0x38abcd[_0x5742('0x7c')][_0x5742('0x3d')]==='twilio'){return _0x4322fb[_0x5742('0x27')](_0x3c8b51)[_0x5742('0x2d')](_0x5742('0xb3'),_0x5742('0xb4'))[_0x5742('0x78')](_0x5742('0xb5'));}else{return _0x4322fb[_0x5742('0x27')](_0x3c8b51)['json'](_0x3026fd);}}});})[_0x5742('0x25')](handleError(_0x4322fb,null));};exports['send']=function(_0x9e688b,_0x4e74f6,_0xa77ba4){var _0x5285b3,_0x456842,_0x94aa;if(_[_0x5742('0x98')](_0x9e688b[_0x5742('0x5c')][_0x5742('0x5c')])||_0x9e688b[_0x5742('0x5c')]['body']===''){throw new db[(_0x5742('0x99'))][(_0x5742('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5742('0x98')](_0x9e688b[_0x5742('0x5c')]['to'])){throw new db[(_0x5742('0x99'))][(_0x5742('0x89'))](_0x5742('0xb6'));}_0x5285b3=_0x9e688b[_0x5742('0x5c')]['to'];return db[_0x5742('0x3b')][_0x5742('0x54')]({'where':{'id':_0x9e688b[_0x5742('0x52')]['id']},'include':[{'model':db[_0x5742('0xb7')],'as':'List','include':[{'model':db[_0x5742('0x88')],'as':_0x5742('0x9f'),'where':{'mobile':_0x5285b3},'limit':0x1,'order':[[_0x5742('0x8d'),_0x5742('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x4e74f6,null))[_0x5742('0x33')](function(_0x2ef16e){if(_0x2ef16e&&_0x2ef16e[_0x5742('0xb9')]){_0x456842=_0x2ef16e['get']({'plain':!![]});if(_0x456842[_0x5742('0xb9')]&&_0x456842[_0x5742('0xb9')][_0x5742('0x9f')][_0x5742('0x45')]){return _0x456842['List'][_0x5742('0x9f')][0x0];}return db[_0x5742('0x88')]['create'](_['defaults'](_0x9e688b['body'],{'firstName':_0x5285b3,'mobile':_0x5285b3,'phone':_0x5285b3,'ListId':_0x456842[_0x5742('0x8e')]}));}})['then'](handleEntityNotFound(_0x4e74f6,null))[_0x5742('0x33')](function(_0x343275){if(_0x343275){_0x94aa=_0x343275;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x94aa['id'],'closed':![],'WhatsappAccountId':_0x456842['id']}})['then'](function(_0xbc7f5){if(_0xbc7f5){return[_0xbc7f5,![]];}return db[_0x5742('0xa2')][_0x5742('0x55')]({'UserId':_0x9e688b[_0x5742('0x56')]['id'],'ContactId':_0x94aa['id'],'WhatsappAccountId':_0x456842['id'],'phone':_0x5285b3,'firstMsgDirection':'out','Messages':[_['merge'](_0x9e688b[_0x5742('0x5c')],{'read':![],'body':_0x9e688b[_0x5742('0x5c')]['body'],'phone':_0x5285b3,'WhatsappAccountId':_0x456842['id'],'UserId':_0x9e688b[_0x5742('0x56')]['id'],'ContactId':_0x94aa['id']})]},{'include':[{'model':db[_0x5742('0x81')],'as':_0x5742('0xba')}]})[_0x5742('0x33')](function(_0x713cb7){return[_0x713cb7,!![]];});});}})[_0x5742('0xbb')](function(_0x236f82,_0x91c238){if(_0x91c238){return _0x236f82;}return db[_0x5742('0x81')][_0x5742('0x55')](_[_0x5742('0x4c')](_0x9e688b[_0x5742('0x5c')],{'read':![],'body':_0x9e688b[_0x5742('0x5c')][_0x5742('0x5c')],'phone':_0x5285b3,'WhatsappAccountId':_0x456842['id'],'WhatsappInteractionId':_0x236f82['id'],'UserId':_0x9e688b[_0x5742('0x56')]['id'],'ContactId':_0x94aa['id']}))[_0x5742('0x33')](function(_0x346ca5){_0x236f82[_0x5742('0xbc')][_0x5742('0xba')]=[];_0x236f82[_0x5742('0xbc')][_0x5742('0xba')]['push'](_0x346ca5[_0x5742('0xbc')]);return _0x236f82;});})['then'](respondWithResult(_0x4e74f6,null))['catch'](handleError(_0x4e74f6,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 828ae13..a14a306 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 _0xa424=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove'];(function(_0x26ccb6,_0x24ff65){var _0x4846b8=function(_0x4ec6ac){while(--_0x4ec6ac){_0x26ccb6['push'](_0x26ccb6['shift']());}};_0x4846b8(++_0x24ff65);}(_0xa424,0x72));var _0x4a42=function(_0x3a043c,_0x4da71e){_0x3a043c=_0x3a043c-0x0;var _0x29e17f=_0xa424[_0x3a043c];return _0x29e17f;};'use strict';var EventEmitter=require(_0x4a42('0x0'));var WhatsappAccount=require(_0x4a42('0x1'))['db'][_0x4a42('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4a42('0x3')](0x0);var events={'afterCreate':_0x4a42('0x4'),'afterUpdate':'update','afterDestroy':_0x4a42('0x5')};function emitEvent(_0x2f2db4){return function(_0x24a8b9,_0xd41807,_0x466b66){WhatsappAccountEvents[_0x4a42('0x6')](_0x2f2db4+':'+_0x24a8b9['id'],_0x24a8b9);WhatsappAccountEvents[_0x4a42('0x6')](_0x2f2db4,_0x24a8b9);_0x466b66(null);};}for(var e in events){if(events[_0x4a42('0x7')](e)){var event=events[e];WhatsappAccount[_0x4a42('0x8')](e,emitEvent(event));}}module[_0x4a42('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x7a9d=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a9d,0x1c1));var _0xd7a9=function(_0x134e36,_0x21a8d7){_0x134e36=_0x134e36-0x0;var _0x5b4af5=_0x7a9d[_0x134e36];return _0x5b4af5;};'use strict';var EventEmitter=require(_0xd7a9('0x0'));var WhatsappAccount=require(_0xd7a9('0x1'))['db'][_0xd7a9('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd7a9('0x3')](0x0);var events={'afterCreate':_0xd7a9('0x4'),'afterUpdate':_0xd7a9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5bf1d5){return function(_0x2417ef,_0xd9345e,_0x1fafff){WhatsappAccountEvents['emit'](_0x5bf1d5+':'+_0x2417ef['id'],_0x2417ef);WhatsappAccountEvents[_0xd7a9('0x6')](_0x5bf1d5,_0x2417ef);_0x1fafff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xd7a9('0x7')](e,emitEvent(event));}}module[_0xd7a9('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 6e713d7..3d120d6 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 _0xa6c6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x1f73c3,_0xa8af11){var _0x20450e=function(_0x2f30fb){while(--_0x2f30fb){_0x1f73c3['push'](_0x1f73c3['shift']());}};_0x20450e(++_0xa8af11);}(_0xa6c6,0x137));var _0x6a6c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa6c6[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6a6c('0x0'));var util=require(_0x6a6c('0x1'));var logger=require(_0x6a6c('0x2'))(_0x6a6c('0x3'));var moment=require(_0x6a6c('0x4'));var BPromise=require(_0x6a6c('0x5'));var rp=require(_0x6a6c('0x6'));var fs=require('fs');var path=require(_0x6a6c('0x7'));var rimraf=require(_0x6a6c('0x8'));var config=require(_0x6a6c('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0x6a6c('0xa')]=function(_0x489fce,_0x1430a8){return _0x489fce['define'](_0x6a6c('0xb'),attributes,{'tableName':_0x6a6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x070f=['api','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger'];(function(_0x15e69f,_0x1275fb){var _0x489a08=function(_0x2a524a){while(--_0x2a524a){_0x15e69f['push'](_0x15e69f['shift']());}};_0x489a08(++_0x1275fb);}(_0x070f,0x107));var _0xf070=function(_0x3b5537,_0x50eaf3){_0x3b5537=_0x3b5537-0x0;var _0xf78ad8=_0x070f[_0x3b5537];return _0xf78ad8;};'use strict';var _=require(_0xf070('0x0'));var util=require(_0xf070('0x1'));var logger=require(_0xf070('0x2'))(_0xf070('0x3'));var moment=require(_0xf070('0x4'));var BPromise=require(_0xf070('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf070('0x6'));var rimraf=require(_0xf070('0x7'));var config=require(_0xf070('0x8'));var attributes=require(_0xf070('0x9'));module[_0xf070('0xa')]=function(_0x279e01,_0x5a839f){return _0x279e01[_0xf070('0xb')](_0xf070('0xc'),attributes,{'tableName':_0xf070('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 4a51af6..d1c8f01 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 _0x4ca7=['error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','stringify','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x428046,_0x1ac24d){_0x428046=_0x428046-0x0;var _0xdd5d8b=_0x4ca7[_0x428046];return _0xdd5d8b;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var moment=require(_0x74ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x74ca('0x3'));var fs=require('fs');var Redis=require(_0x74ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x74ca('0x5'))('rpc');var config=require(_0x74ca('0x6'));var jayson=require(_0x74ca('0x7'));var client=jayson['client'][_0x74ca('0x8')]({'port':0x232a});config['redis']=_[_0x74ca('0x9')](config[_0x74ca('0xa')],{'host':_0x74ca('0xb'),'port':0x18eb});var socket=require(_0x74ca('0xc'))(new Redis(config[_0x74ca('0xa')]));require(_0x74ca('0xd'))[_0x74ca('0xe')](socket);function respondWithRpcPromise(_0x589f6a,_0x2d6679,_0x4b4f09){return new BPromise(function(_0x578574,_0x16764e){return client['request'](_0x589f6a,_0x4b4f09)[_0x74ca('0xf')](function(_0x349cea){logger[_0x74ca('0x10')](_0x74ca('0x11'),_0x2d6679,_0x74ca('0x12'));logger[_0x74ca('0x13')](_0x74ca('0x14'),_0x2d6679,_0x74ca('0x12'),JSON['stringify'](_0x349cea));if(_0x349cea[_0x74ca('0x15')]){if(_0x349cea[_0x74ca('0x15')][_0x74ca('0x16')]===0x1f4){logger[_0x74ca('0x15')](_0x74ca('0x11'),_0x2d6679,_0x349cea[_0x74ca('0x15')][_0x74ca('0x17')]);return _0x16764e(_0x349cea[_0x74ca('0x15')][_0x74ca('0x17')]);}logger[_0x74ca('0x15')](_0x74ca('0x11'),_0x2d6679,_0x349cea[_0x74ca('0x15')][_0x74ca('0x17')]);return _0x578574(_0x349cea[_0x74ca('0x15')]['message']);}else{logger[_0x74ca('0x10')](_0x74ca('0x11'),_0x2d6679,_0x74ca('0x12'));_0x578574(_0x349cea[_0x74ca('0x18')][_0x74ca('0x17')]);}})['catch'](function(_0x522014){logger[_0x74ca('0x15')](_0x74ca('0x11'),_0x2d6679,_0x522014);_0x16764e(_0x522014);});});}exports[_0x74ca('0x19')]=function(_0x2b4e1f){var _0x119208=this;return new Promise(function(_0x1fe991,_0x4eab63){return db[_0x74ca('0x1a')][_0x74ca('0x1b')]({'raw':_0x2b4e1f['options']?_0x2b4e1f['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b4e1f[_0x74ca('0x1c')]?_0x2b4e1f[_0x74ca('0x1c')][_0x74ca('0x1d')]||null:null,'attributes':_0x2b4e1f[_0x74ca('0x1c')]?_0x2b4e1f[_0x74ca('0x1c')][_0x74ca('0x1e')]||null:null,'include':_0x2b4e1f[_0x74ca('0x1c')]?_0x2b4e1f[_0x74ca('0x1c')][_0x74ca('0x1f')]?_[_0x74ca('0x20')](_0x2b4e1f['options']['include'],function(_0x1aeded){return{'model':db[_0x1aeded[_0x74ca('0x21')]],'as':_0x1aeded['as'],'attributes':_0x1aeded[_0x74ca('0x1e')],'include':_0x1aeded[_0x74ca('0x1f')]?_[_0x74ca('0x20')](_0x1aeded['include'],function(_0x422dad){return{'model':db[_0x422dad[_0x74ca('0x21')]],'as':_0x422dad['as'],'attributes':_0x422dad[_0x74ca('0x1e')],'include':_0x422dad[_0x74ca('0x1f')]?_[_0x74ca('0x20')](_0x422dad[_0x74ca('0x1f')],function(_0x227930){return{'model':db[_0x227930[_0x74ca('0x21')]],'as':_0x227930['as'],'attributes':_0x227930[_0x74ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x74ca('0xf')](function(_0x3491ef){logger[_0x74ca('0x10')]('ShowWhatsappAccount',_0x2b4e1f);logger['debug'](_0x74ca('0x19'),_0x2b4e1f,JSON[_0x74ca('0x22')](_0x3491ef));_0x1fe991(_0x3491ef);})[_0x74ca('0x23')](function(_0x27da17){logger[_0x74ca('0x15')]('ShowWhatsappAccount',_0x27da17[_0x74ca('0x17')],_0x2b4e1f);_0x4eab63(_0x119208[_0x74ca('0x15')](0x1f4,_0x27da17['message']));});});}; \ No newline at end of file +var _0xf88a=['attributes','map','include','model','ShowWhatsappAccount','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','WhatsappAccount','find','options','where'];(function(_0x10db59,_0x736186){var _0x1f2da6=function(_0x4511da){while(--_0x4511da){_0x10db59['push'](_0x10db59['shift']());}};_0x1f2da6(++_0x736186);}(_0xf88a,0x1ef));var _0xaf88=function(_0x5a7428,_0x5b1822){_0x5a7428=_0x5a7428-0x0;var _0x295ef9=_0xf88a[_0x5a7428];return _0x295ef9;};'use strict';var _=require(_0xaf88('0x0'));var util=require(_0xaf88('0x1'));var moment=require(_0xaf88('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf88('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf88('0x5'));var config=require(_0xaf88('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf88('0x7')]({'port':0x232a});config[_0xaf88('0x8')]=_[_0xaf88('0x9')](config[_0xaf88('0x8')],{'host':_0xaf88('0xa'),'port':0x18eb});var socket=require(_0xaf88('0xb'))(new Redis(config[_0xaf88('0x8')]));require(_0xaf88('0xc'))[_0xaf88('0xd')](socket);function respondWithRpcPromise(_0x40a099,_0x125e72,_0x5bf420){return new BPromise(function(_0x1899ae,_0xbddd1a){return client[_0xaf88('0xe')](_0x40a099,_0x5bf420)[_0xaf88('0xf')](function(_0x570f77){logger[_0xaf88('0x10')](_0xaf88('0x11'),_0x125e72,'request\x20sent');logger[_0xaf88('0x12')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x125e72,_0xaf88('0x13'),JSON[_0xaf88('0x14')](_0x570f77));if(_0x570f77[_0xaf88('0x15')]){if(_0x570f77[_0xaf88('0x15')][_0xaf88('0x16')]===0x1f4){logger[_0xaf88('0x15')](_0xaf88('0x11'),_0x125e72,_0x570f77[_0xaf88('0x15')][_0xaf88('0x17')]);return _0xbddd1a(_0x570f77['error'][_0xaf88('0x17')]);}logger['error'](_0xaf88('0x11'),_0x125e72,_0x570f77[_0xaf88('0x15')]['message']);return _0x1899ae(_0x570f77[_0xaf88('0x15')]['message']);}else{logger[_0xaf88('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x125e72,_0xaf88('0x13'));_0x1899ae(_0x570f77[_0xaf88('0x18')][_0xaf88('0x17')]);}})[_0xaf88('0x19')](function(_0x5205cb){logger[_0xaf88('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x125e72,_0x5205cb);_0xbddd1a(_0x5205cb);});});}exports['ShowWhatsappAccount']=function(_0x547844){var _0x4e2fdc=this;return new Promise(function(_0x42d793,_0x57b8e9){return db[_0xaf88('0x1a')][_0xaf88('0x1b')]({'raw':_0x547844[_0xaf88('0x1c')]?_0x547844[_0xaf88('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x547844[_0xaf88('0x1c')]?_0x547844['options'][_0xaf88('0x1d')]||null:null,'attributes':_0x547844['options']?_0x547844[_0xaf88('0x1c')][_0xaf88('0x1e')]||null:null,'include':_0x547844[_0xaf88('0x1c')]?_0x547844[_0xaf88('0x1c')]['include']?_[_0xaf88('0x1f')](_0x547844[_0xaf88('0x1c')][_0xaf88('0x20')],function(_0x5bcddc){return{'model':db[_0x5bcddc['model']],'as':_0x5bcddc['as'],'attributes':_0x5bcddc['attributes'],'include':_0x5bcddc['include']?_[_0xaf88('0x1f')](_0x5bcddc[_0xaf88('0x20')],function(_0x2a7f9f){return{'model':db[_0x2a7f9f[_0xaf88('0x21')]],'as':_0x2a7f9f['as'],'attributes':_0x2a7f9f[_0xaf88('0x1e')],'include':_0x2a7f9f[_0xaf88('0x20')]?_[_0xaf88('0x1f')](_0x2a7f9f[_0xaf88('0x20')],function(_0x1c109a){return{'model':db[_0x1c109a[_0xaf88('0x21')]],'as':_0x1c109a['as'],'attributes':_0x1c109a[_0xaf88('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da145){logger[_0xaf88('0x10')]('ShowWhatsappAccount',_0x547844);logger[_0xaf88('0x12')](_0xaf88('0x22'),_0x547844,JSON[_0xaf88('0x14')](_0x5da145));_0x42d793(_0x5da145);})[_0xaf88('0x19')](function(_0x230cb1){logger[_0xaf88('0x15')]('ShowWhatsappAccount',_0x230cb1[_0xaf88('0x17')],_0x547844);_0x57b8e9(_0x4e2fdc[_0xaf88('0x15')](0x1f4,_0x230cb1['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 364c162..7e239db 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 _0x6aa2=['save','remove','update','register','whatsappAccount:'];(function(_0x4f5d32,_0x1667bf){var _0x5e9aeb=function(_0x5eff51){while(--_0x5eff51){_0x4f5d32['push'](_0x4f5d32['shift']());}};_0x5e9aeb(++_0x1667bf);}(_0x6aa2,0x118));var _0x26aa=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x6aa2[_0x2f0057];return _0x17f2c3;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x26aa('0x0'),_0x26aa('0x1'),_0x26aa('0x2')];function createListener(_0x1cc12f,_0x395c5a){return function(_0x1fb869){_0x395c5a['emit'](_0x1cc12f,_0x1fb869);};}function removeListener(_0x10055f,_0x344cf3){return function(){WhatsappAccountEvents['removeListener'](_0x10055f,_0x344cf3);};}exports[_0x26aa('0x3')]=function(_0x530a18){for(var _0x47bbe7=0x0,_0x5c5500=events['length'];_0x47bbe7<_0x5c5500;_0x47bbe7++){var _0x359ebd=events[_0x47bbe7];var _0x12312d=createListener(_0x26aa('0x4')+_0x359ebd,_0x530a18);WhatsappAccountEvents['on'](_0x359ebd,_0x12312d);}}; \ No newline at end of file +var _0x90a9=['emit','register','length','save','remove','update'];(function(_0x9dbfd4,_0xfe06b5){var _0x234639=function(_0x19b58a){while(--_0x19b58a){_0x9dbfd4['push'](_0x9dbfd4['shift']());}};_0x234639(++_0xfe06b5);}(_0x90a9,0x1b9));var _0x990a=function(_0xb3950e,_0xa6364f){_0xb3950e=_0xb3950e-0x0;var _0x1d9fec=_0x90a9[_0xb3950e];return _0x1d9fec;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x990a('0x0'),_0x990a('0x1'),_0x990a('0x2')];function createListener(_0x36c21a,_0x1261e1){return function(_0x2ab7b9){_0x1261e1[_0x990a('0x3')](_0x36c21a,_0x2ab7b9);};}function removeListener(_0x42b282,_0x1d9a0e){return function(){WhatsappAccountEvents['removeListener'](_0x42b282,_0x1d9a0e);};}exports[_0x990a('0x4')]=function(_0x58c0e5){for(var _0x448502=0x0,_0x395d8e=events[_0x990a('0x5')];_0x448502<_0x395d8e;_0x448502++){var _0x196e1f=events[_0x448502];var _0x256b06=createListener('whatsappAccount:'+_0x196e1f,_0x58c0e5);WhatsappAccountEvents['on'](_0x196e1f,_0x256b06);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 4d634c1..dc38127 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 _0x0286=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x52c05f,_0x478d75){var _0x331c22=function(_0x290dd0){while(--_0x290dd0){_0x52c05f['push'](_0x52c05f['shift']());}};_0x331c22(++_0x478d75);}(_0x0286,0xe6));var _0x6028=function(_0x186097,_0x5b9921){_0x186097=_0x186097-0x0;var _0xa1f939=_0x0286[_0x186097];return _0xa1f939;};'use strict';var multer=require(_0x6028('0x0'));var util=require(_0x6028('0x1'));var path=require('path');var timeout=require(_0x6028('0x2'));var express=require(_0x6028('0x3'));var router=express[_0x6028('0x4')]();var fs_extra=require(_0x6028('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6028('0x6'));var config=require(_0x6028('0x7'));var controller=require(_0x6028('0x8'));router[_0x6028('0x9')]('/',auth[_0x6028('0xa')](),controller[_0x6028('0xb')]);router['get']('/:id',auth[_0x6028('0xa')](),controller[_0x6028('0xc')]);router[_0x6028('0xd')]('/',auth[_0x6028('0xa')](),controller[_0x6028('0xe')]);router[_0x6028('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6028('0x10'),auth[_0x6028('0xa')](),controller[_0x6028('0x11')]);module[_0x6028('0x12')]=router; \ No newline at end of file +var _0x5cff=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','create'];(function(_0x1f2780,_0x32914c){var _0x2e758e=function(_0x58b11e){while(--_0x58b11e){_0x1f2780['push'](_0x1f2780['shift']());}};_0x2e758e(++_0x32914c);}(_0x5cff,0x135));var _0xf5cf=function(_0x402b1f,_0x3df329){_0x402b1f=_0x402b1f-0x0;var _0x5d22f2=_0x5cff[_0x402b1f];return _0x5d22f2;};'use strict';var multer=require(_0xf5cf('0x0'));var util=require(_0xf5cf('0x1'));var path=require(_0xf5cf('0x2'));var timeout=require(_0xf5cf('0x3'));var express=require(_0xf5cf('0x4'));var router=express[_0xf5cf('0x5')]();var fs_extra=require(_0xf5cf('0x6'));var auth=require(_0xf5cf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf5cf('0x8'));var controller=require('./whatsappApplication.controller');router[_0xf5cf('0x9')]('/',auth[_0xf5cf('0xa')](),controller['index']);router['get'](_0xf5cf('0xb'),auth[_0xf5cf('0xa')](),controller[_0xf5cf('0xc')]);router['post']('/',auth[_0xf5cf('0xa')](),controller[_0xf5cf('0xd')]);router['put']('/:id',auth[_0xf5cf('0xa')](),controller[_0xf5cf('0xe')]);router[_0xf5cf('0xf')](_0xf5cf('0xb'),auth[_0xf5cf('0xa')](),controller['destroy']);module[_0xf5cf('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 704c0f4..06c91a3 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 _0xa56b=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xa56b,0x1ab));var _0xba56=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xa56b[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xba56('0x0'));module[_0xba56('0x1')]={'priority':{'type':Sequelize[_0xba56('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xba56('0x3')],'allowNull':![],'defaultValue':_0xba56('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xba56('0x3')]},'interval':{'type':Sequelize[_0xba56('0x3')],'defaultValue':_0xba56('0x5')}}; \ No newline at end of file +var _0x263f=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x54b88e,_0x6a35b3){var _0x305bda=function(_0x443633){while(--_0x443633){_0x54b88e['push'](_0x54b88e['shift']());}};_0x305bda(++_0x6a35b3);}(_0x263f,0x133));var _0xf263=function(_0x34213b,_0x4ada25){_0x34213b=_0x34213b-0x0;var _0x651e2d=_0x263f[_0x34213b];return _0x651e2d;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf263('0x2')},'appdata':{'type':Sequelize[_0xf263('0x3')]()},'description':{'type':Sequelize[_0xf263('0x4')]},'interval':{'type':Sequelize[_0xf263('0x4')],'defaultValue':_0xf263('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 3b5196f..00352ca 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 _0x23bb=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','body','update','find','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x589345,_0x359e0f){var _0x23540e=function(_0x67d4c){while(--_0x67d4c){_0x589345['push'](_0x589345['shift']());}};_0x23540e(++_0x359e0f);}(_0x23bb,0x79));var _0xb23b=function(_0x55c76f,_0x13b7f4){_0x55c76f=_0x55c76f-0x0;var _0x1571ff=_0x23bb[_0x55c76f];return _0x1571ff;};'use strict';var emlformat=require(_0xb23b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb23b('0x1'));var rp=require(_0xb23b('0x2'));var moment=require(_0xb23b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb23b('0x4'));var util=require(_0xb23b('0x5'));var path=require(_0xb23b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb23b('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb23b('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xb23b('0x9'));var querystring=require('querystring');var Papa=require(_0xb23b('0xa'));var Redis=require(_0xb23b('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xb23b('0xc'));var as=require(_0xb23b('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb23b('0xe'))(_0xb23b('0xf'));var utils=require(_0xb23b('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xb23b('0x11'));var db=require(_0xb23b('0x12'))['db'];function respondWithStatusCode(_0x1966f0,_0x3f956c){_0x3f956c=_0x3f956c||0xcc;return function(_0x40a2da){if(_0x40a2da){return _0x1966f0[_0xb23b('0x13')](_0x3f956c);}return _0x1966f0[_0xb23b('0x14')](_0x3f956c)[_0xb23b('0x15')]();};}function respondWithResult(_0x114f6f,_0x2ff6e8){_0x2ff6e8=_0x2ff6e8||0xc8;return function(_0x3ff740){if(_0x3ff740){return _0x114f6f[_0xb23b('0x14')](_0x2ff6e8)[_0xb23b('0x16')](_0x3ff740);}};}function respondWithFilteredResult(_0x447365,_0x338275){return function(_0x1a03a6){if(_0x1a03a6){var _0xaa2b4e=typeof _0x338275['offset']===_0xb23b('0x17')&&typeof _0x338275[_0xb23b('0x18')]===_0xb23b('0x17');var _0x2d9584=_0x1a03a6[_0xb23b('0x19')];var _0x582554=_0xaa2b4e?0x0:_0x338275[_0xb23b('0x1a')];var _0x547704=_0xaa2b4e?_0x1a03a6[_0xb23b('0x19')]:_0x338275[_0xb23b('0x1a')]+_0x338275[_0xb23b('0x18')];var _0x5ddf16;if(_0x547704>=_0x2d9584){_0x547704=_0x2d9584;_0x5ddf16=0xc8;}else{_0x5ddf16=0xce;}_0x447365['status'](_0x5ddf16);return _0x447365[_0xb23b('0x1b')](_0xb23b('0x1c'),_0x582554+'-'+_0x547704+'/'+_0x2d9584)[_0xb23b('0x16')](_0x1a03a6);}return null;};}function patchUpdates(_0x4201b5){return function(_0x1ca831){try{jsonpatch[_0xb23b('0x1d')](_0x1ca831,_0x4201b5,!![]);}catch(_0x65c746){return BPromise['reject'](_0x65c746);}return _0x1ca831[_0xb23b('0x1e')]();};}function saveUpdates(_0x197b14,_0xe57b69){return function(_0x2ea872){if(_0x2ea872){return _0x2ea872['update'](_0x197b14)[_0xb23b('0x1f')](function(_0x3bec93){return _0x3bec93;});}return null;};}function removeEntity(_0x4c2d1d,_0x11aaac){return function(_0x5b7777){if(_0x5b7777){return _0x5b7777[_0xb23b('0x20')]()['then'](function(){_0x4c2d1d[_0xb23b('0x14')](0xcc)[_0xb23b('0x15')]();});}};}function handleEntityNotFound(_0x50af31,_0x2040c6){return function(_0xb537db){if(!_0xb537db){_0x50af31[_0xb23b('0x13')](0x194);}return _0xb537db;};}function handleError(_0x1f2b76,_0x1d87dc){_0x1d87dc=_0x1d87dc||0x1f4;return function(_0x5ebe63){logger[_0xb23b('0x21')](_0x5ebe63[_0xb23b('0x22')]);if(_0x5ebe63[_0xb23b('0x23')]){delete _0x5ebe63[_0xb23b('0x23')];}_0x1f2b76[_0xb23b('0x14')](_0x1d87dc)[_0xb23b('0x24')](_0x5ebe63);};}exports[_0xb23b('0x25')]=function(_0x40622d,_0x4b3eb5){var _0x2be1a1={},_0x2758d7={},_0x42c230={'count':0x0,'rows':[]};var _0x5e4e42=_[_0xb23b('0x26')](db[_0xb23b('0x27')][_0xb23b('0x28')],function(_0x307367){return{'name':_0x307367[_0xb23b('0x29')],'type':_0x307367['type'][_0xb23b('0x2a')]};});_0x2758d7[_0xb23b('0x2b')]=_[_0xb23b('0x26')](_0x5e4e42,_0xb23b('0x23'));_0x2758d7[_0xb23b('0x2c')]=_[_0xb23b('0x2d')](_0x40622d[_0xb23b('0x2c')]);_0x2758d7[_0xb23b('0x2e')]=_[_0xb23b('0x2f')](_0x2758d7[_0xb23b('0x2b')],_0x2758d7[_0xb23b('0x2c')]);_0x2be1a1[_0xb23b('0x30')]=_['intersection'](_0x2758d7[_0xb23b('0x2b')],qs[_0xb23b('0x31')](_0x40622d[_0xb23b('0x2c')][_0xb23b('0x31')]));_0x2be1a1['attributes']=_0x2be1a1[_0xb23b('0x30')][_0xb23b('0x32')]?_0x2be1a1[_0xb23b('0x30')]:_0x2758d7[_0xb23b('0x2b')];if(!_0x40622d[_0xb23b('0x2c')]['hasOwnProperty'](_0xb23b('0x33'))){_0x2be1a1['limit']=qs[_0xb23b('0x18')](_0x40622d['query'][_0xb23b('0x18')]);_0x2be1a1['offset']=qs[_0xb23b('0x1a')](_0x40622d['query']['offset']);}_0x2be1a1[_0xb23b('0x34')]=qs[_0xb23b('0x35')](_0x40622d[_0xb23b('0x2c')]['sort']);_0x2be1a1[_0xb23b('0x36')]=qs[_0xb23b('0x2e')](_[_0xb23b('0x37')](_0x40622d[_0xb23b('0x2c')],_0x2758d7[_0xb23b('0x2e')]),_0x5e4e42);if(_0x40622d[_0xb23b('0x2c')][_0xb23b('0x38')]){_0x2be1a1[_0xb23b('0x36')]=_[_0xb23b('0x39')](_0x2be1a1[_0xb23b('0x36')],{'$or':_['map'](_0x5e4e42,function(_0x28ab4d){if(_0x28ab4d[_0xb23b('0x3a')]!==_0xb23b('0x3b')){var _0x239143={};_0x239143[_0x28ab4d[_0xb23b('0x23')]]={'$like':'%'+_0x40622d[_0xb23b('0x2c')][_0xb23b('0x38')]+'%'};return _0x239143;}})});}_0x2be1a1=_[_0xb23b('0x39')]({},_0x2be1a1,_0x40622d[_0xb23b('0x3c')]);var _0x24b7a7={'where':_0x2be1a1[_0xb23b('0x36')]};return db[_0xb23b('0x27')][_0xb23b('0x19')](_0x24b7a7)[_0xb23b('0x1f')](function(_0x6777f9){_0x42c230['count']=_0x6777f9;if(_0x40622d[_0xb23b('0x2c')]['includeAll']){_0x2be1a1[_0xb23b('0x3d')]=[{'all':!![]}];}return db[_0xb23b('0x27')][_0xb23b('0x3e')](_0x2be1a1);})[_0xb23b('0x1f')](function(_0x1390d7){_0x42c230[_0xb23b('0x3f')]=_0x1390d7;return _0x42c230;})['then'](respondWithFilteredResult(_0x4b3eb5,_0x2be1a1))[_0xb23b('0x40')](handleError(_0x4b3eb5,null));};exports[_0xb23b('0x41')]=function(_0x13c0a1,_0x2529d8){var _0x28abda={'raw':!![],'where':{'id':_0x13c0a1[_0xb23b('0x42')]['id']}},_0x177c79={};_0x177c79[_0xb23b('0x2b')]=_[_0xb23b('0x2d')](db[_0xb23b('0x27')][_0xb23b('0x28')]);_0x177c79['query']=_[_0xb23b('0x2d')](_0x13c0a1[_0xb23b('0x2c')]);_0x177c79['filters']=_[_0xb23b('0x2f')](_0x177c79[_0xb23b('0x2b')],_0x177c79['query']);_0x28abda[_0xb23b('0x30')]=_[_0xb23b('0x2f')](_0x177c79[_0xb23b('0x2b')],qs[_0xb23b('0x31')](_0x13c0a1[_0xb23b('0x2c')][_0xb23b('0x31')]));_0x28abda[_0xb23b('0x30')]=_0x28abda['attributes'][_0xb23b('0x32')]?_0x28abda[_0xb23b('0x30')]:_0x177c79[_0xb23b('0x2b')];if(_0x13c0a1['query']['includeAll']){_0x28abda[_0xb23b('0x3d')]=[{'all':!![]}];}_0x28abda=_['merge']({},_0x28abda,_0x13c0a1[_0xb23b('0x3c')]);return db[_0xb23b('0x27')]['find'](_0x28abda)[_0xb23b('0x1f')](handleEntityNotFound(_0x2529d8,null))[_0xb23b('0x1f')](respondWithResult(_0x2529d8,null))[_0xb23b('0x40')](handleError(_0x2529d8,null));};exports['create']=function(_0x40cf85,_0x39c6c0){return db[_0xb23b('0x27')]['create'](_0x40cf85[_0xb23b('0x43')],{})[_0xb23b('0x1f')](respondWithResult(_0x39c6c0,0xc9))[_0xb23b('0x40')](handleError(_0x39c6c0,null));};exports[_0xb23b('0x44')]=function(_0x16163e,_0x3dd7a1){if(_0x16163e[_0xb23b('0x43')]['id']){delete _0x16163e[_0xb23b('0x43')]['id'];}return db[_0xb23b('0x27')][_0xb23b('0x45')]({'where':{'id':_0x16163e[_0xb23b('0x42')]['id']}})[_0xb23b('0x1f')](handleEntityNotFound(_0x3dd7a1,null))[_0xb23b('0x1f')](saveUpdates(_0x16163e[_0xb23b('0x43')],null))[_0xb23b('0x1f')](respondWithResult(_0x3dd7a1,null))['catch'](handleError(_0x3dd7a1,null));};exports[_0xb23b('0x20')]=function(_0x5c4eb9,_0xb6460b){return db['WhatsappApplication']['find']({'where':{'id':_0x5c4eb9[_0xb23b('0x42')]['id']}})['then'](handleEntityNotFound(_0xb6460b,null))[_0xb23b('0x1f')](removeEntity(_0xb6460b,null))[_0xb23b('0x40')](handleError(_0xb6460b,null));}; \ No newline at end of file +var _0x25a9=['model','attributes','fields','hasOwnProperty','order','sort','filters','where','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys','intersection'];(function(_0x14735c,_0x4c3938){var _0xde3389=function(_0x5b8c06){while(--_0x5b8c06){_0x14735c['push'](_0x14735c['shift']());}};_0xde3389(++_0x4c3938);}(_0x25a9,0xf1));var _0x925a=function(_0x34fab4,_0x194738){_0x34fab4=_0x34fab4-0x0;var _0x42fa5c=_0x25a9[_0x34fab4];return _0x42fa5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x925a('0x0'));var zipdir=require(_0x925a('0x1'));var jsonpatch=require(_0x925a('0x2'));var rp=require(_0x925a('0x3'));var moment=require(_0x925a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x925a('0x5'));var util=require(_0x925a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x925a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x925a('0x8'));var _=require(_0x925a('0x9'));var squel=require(_0x925a('0xa'));var crypto=require(_0x925a('0xb'));var jsforce=require(_0x925a('0xc'));var deskjs=require(_0x925a('0xd'));var toCsv=require(_0x925a('0x7'));var querystring=require('querystring');var Papa=require(_0x925a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x925a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x925a('0x10'))(_0x925a('0x11'));var utils=require(_0x925a('0x12'));var config=require(_0x925a('0x13'));var licenseUtil=require(_0x925a('0x14'));var db=require(_0x925a('0x15'))['db'];function respondWithStatusCode(_0x55552e,_0x22c673){_0x22c673=_0x22c673||0xcc;return function(_0x39df47){if(_0x39df47){return _0x55552e[_0x925a('0x16')](_0x22c673);}return _0x55552e[_0x925a('0x17')](_0x22c673)[_0x925a('0x18')]();};}function respondWithResult(_0x4bd135,_0x26e2c0){_0x26e2c0=_0x26e2c0||0xc8;return function(_0x530360){if(_0x530360){return _0x4bd135[_0x925a('0x17')](_0x26e2c0)[_0x925a('0x19')](_0x530360);}};}function respondWithFilteredResult(_0xf0efa7,_0x4639b1){return function(_0x494bc5){if(_0x494bc5){var _0xa915f0=typeof _0x4639b1[_0x925a('0x1a')]==='undefined'&&typeof _0x4639b1[_0x925a('0x1b')]===_0x925a('0x1c');var _0x3a08f0=_0x494bc5[_0x925a('0x1d')];var _0x54fa22=_0xa915f0?0x0:_0x4639b1[_0x925a('0x1a')];var _0x2643ad=_0xa915f0?_0x494bc5[_0x925a('0x1d')]:_0x4639b1[_0x925a('0x1a')]+_0x4639b1[_0x925a('0x1b')];var _0x517cef;if(_0x2643ad>=_0x3a08f0){_0x2643ad=_0x3a08f0;_0x517cef=0xc8;}else{_0x517cef=0xce;}_0xf0efa7['status'](_0x517cef);return _0xf0efa7[_0x925a('0x1e')](_0x925a('0x1f'),_0x54fa22+'-'+_0x2643ad+'/'+_0x3a08f0)['json'](_0x494bc5);}return null;};}function patchUpdates(_0x2abbdc){return function(_0x374dd0){try{jsonpatch[_0x925a('0x20')](_0x374dd0,_0x2abbdc,!![]);}catch(_0x34fec0){return BPromise[_0x925a('0x21')](_0x34fec0);}return _0x374dd0[_0x925a('0x22')]();};}function saveUpdates(_0x2a0f28,_0x3458d5){return function(_0x5a0683){if(_0x5a0683){return _0x5a0683[_0x925a('0x23')](_0x2a0f28)[_0x925a('0x24')](function(_0x2c3949){return _0x2c3949;});}return null;};}function removeEntity(_0x5be491,_0x3e8be6){return function(_0x6079b9){if(_0x6079b9){return _0x6079b9['destroy']()[_0x925a('0x24')](function(){_0x5be491['status'](0xcc)[_0x925a('0x18')]();});}};}function handleEntityNotFound(_0x30fb0e,_0x22c2dc){return function(_0x2d4e16){if(!_0x2d4e16){_0x30fb0e[_0x925a('0x16')](0x194);}return _0x2d4e16;};}function handleError(_0x126aa5,_0x12c76e){_0x12c76e=_0x12c76e||0x1f4;return function(_0x1741b2){logger[_0x925a('0x25')](_0x1741b2[_0x925a('0x26')]);if(_0x1741b2['name']){delete _0x1741b2[_0x925a('0x27')];}_0x126aa5[_0x925a('0x17')](_0x12c76e)[_0x925a('0x28')](_0x1741b2);};}exports[_0x925a('0x29')]=function(_0x5cb909,_0x296337){var _0x495bff={},_0x2e3ad9={},_0x5d704a={'count':0x0,'rows':[]};var _0x1a9791=_[_0x925a('0x2a')](db[_0x925a('0x2b')][_0x925a('0x2c')],function(_0x28e81b){return{'name':_0x28e81b[_0x925a('0x2d')],'type':_0x28e81b[_0x925a('0x2e')][_0x925a('0x2f')]};});_0x2e3ad9['model']=_[_0x925a('0x2a')](_0x1a9791,'name');_0x2e3ad9[_0x925a('0x30')]=_[_0x925a('0x31')](_0x5cb909[_0x925a('0x30')]);_0x2e3ad9['filters']=_[_0x925a('0x32')](_0x2e3ad9[_0x925a('0x33')],_0x2e3ad9[_0x925a('0x30')]);_0x495bff[_0x925a('0x34')]=_[_0x925a('0x32')](_0x2e3ad9[_0x925a('0x33')],qs['fields'](_0x5cb909[_0x925a('0x30')][_0x925a('0x35')]));_0x495bff[_0x925a('0x34')]=_0x495bff[_0x925a('0x34')]['length']?_0x495bff['attributes']:_0x2e3ad9[_0x925a('0x33')];if(!_0x5cb909[_0x925a('0x30')][_0x925a('0x36')]('nolimit')){_0x495bff[_0x925a('0x1b')]=qs[_0x925a('0x1b')](_0x5cb909[_0x925a('0x30')][_0x925a('0x1b')]);_0x495bff['offset']=qs['offset'](_0x5cb909[_0x925a('0x30')][_0x925a('0x1a')]);}_0x495bff[_0x925a('0x37')]=qs[_0x925a('0x38')](_0x5cb909[_0x925a('0x30')][_0x925a('0x38')]);_0x495bff['where']=qs[_0x925a('0x39')](_['pick'](_0x5cb909['query'],_0x2e3ad9[_0x925a('0x39')]),_0x1a9791);if(_0x5cb909[_0x925a('0x30')]['filter']){_0x495bff[_0x925a('0x3a')]=_[_0x925a('0x3b')](_0x495bff['where'],{'$or':_[_0x925a('0x2a')](_0x1a9791,function(_0x5da482){if(_0x5da482['type']!=='VIRTUAL'){var _0x2717dd={};_0x2717dd[_0x5da482[_0x925a('0x27')]]={'$like':'%'+_0x5cb909[_0x925a('0x30')][_0x925a('0x3c')]+'%'};return _0x2717dd;}})});}_0x495bff=_[_0x925a('0x3b')]({},_0x495bff,_0x5cb909[_0x925a('0x3d')]);var _0x599c1b={'where':_0x495bff[_0x925a('0x3a')]};return db[_0x925a('0x2b')][_0x925a('0x1d')](_0x599c1b)[_0x925a('0x24')](function(_0x212384){_0x5d704a[_0x925a('0x1d')]=_0x212384;if(_0x5cb909[_0x925a('0x30')][_0x925a('0x3e')]){_0x495bff[_0x925a('0x3f')]=[{'all':!![]}];}return db[_0x925a('0x2b')][_0x925a('0x40')](_0x495bff);})[_0x925a('0x24')](function(_0x4e4d0c){_0x5d704a['rows']=_0x4e4d0c;return _0x5d704a;})[_0x925a('0x24')](respondWithFilteredResult(_0x296337,_0x495bff))[_0x925a('0x41')](handleError(_0x296337,null));};exports[_0x925a('0x42')]=function(_0x4a7114,_0x3c25f7){var _0x73606c={'raw':!![],'where':{'id':_0x4a7114[_0x925a('0x43')]['id']}},_0x3d5365={};_0x3d5365['model']=_[_0x925a('0x31')](db['WhatsappApplication']['rawAttributes']);_0x3d5365[_0x925a('0x30')]=_[_0x925a('0x31')](_0x4a7114['query']);_0x3d5365['filters']=_[_0x925a('0x32')](_0x3d5365['model'],_0x3d5365['query']);_0x73606c[_0x925a('0x34')]=_[_0x925a('0x32')](_0x3d5365[_0x925a('0x33')],qs['fields'](_0x4a7114[_0x925a('0x30')][_0x925a('0x35')]));_0x73606c[_0x925a('0x34')]=_0x73606c[_0x925a('0x34')][_0x925a('0x44')]?_0x73606c[_0x925a('0x34')]:_0x3d5365[_0x925a('0x33')];if(_0x4a7114[_0x925a('0x30')]['includeAll']){_0x73606c[_0x925a('0x3f')]=[{'all':!![]}];}_0x73606c=_[_0x925a('0x3b')]({},_0x73606c,_0x4a7114[_0x925a('0x3d')]);return db[_0x925a('0x2b')][_0x925a('0x45')](_0x73606c)['then'](handleEntityNotFound(_0x3c25f7,null))[_0x925a('0x24')](respondWithResult(_0x3c25f7,null))[_0x925a('0x41')](handleError(_0x3c25f7,null));};exports[_0x925a('0x46')]=function(_0x2fdf99,_0x2bf5bf){return db[_0x925a('0x2b')]['create'](_0x2fdf99[_0x925a('0x47')],{})[_0x925a('0x24')](respondWithResult(_0x2bf5bf,0xc9))[_0x925a('0x41')](handleError(_0x2bf5bf,null));};exports['update']=function(_0x1d1975,_0x22db0b){if(_0x1d1975[_0x925a('0x47')]['id']){delete _0x1d1975['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x1d1975[_0x925a('0x43')]['id']}})[_0x925a('0x24')](handleEntityNotFound(_0x22db0b,null))[_0x925a('0x24')](saveUpdates(_0x1d1975[_0x925a('0x47')],null))[_0x925a('0x24')](respondWithResult(_0x22db0b,null))['catch'](handleError(_0x22db0b,null));};exports[_0x925a('0x48')]=function(_0xe15d43,_0x3c7543){return db[_0x925a('0x2b')]['find']({'where':{'id':_0xe15d43[_0x925a('0x43')]['id']}})[_0x925a('0x24')](handleEntityNotFound(_0x3c7543,null))[_0x925a('0x24')](removeEntity(_0x3c7543,null))[_0x925a('0x41')](handleError(_0x3c7543,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1692ba6..53f8224 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 _0xe132=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappApplication'];(function(_0x49b1c8,_0x28b282){var _0xc31401=function(_0x4ddcb8){while(--_0x4ddcb8){_0x49b1c8['push'](_0x49b1c8['shift']());}};_0xc31401(++_0x28b282);}(_0xe132,0x162));var _0x2e13=function(_0x1ded7b,_0x19ec1e){_0x1ded7b=_0x1ded7b-0x0;var _0x4ea128=_0xe132[_0x1ded7b];return _0x4ea128;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e13('0xb'),'collate':_0x2e13('0xc')});}; \ No newline at end of file +var _0xec39=['bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1b852e,_0x185f0d){var _0x2fd5cf=function(_0x1dc638){while(--_0x1dc638){_0x1b852e['push'](_0x1b852e['shift']());}};_0x2fd5cf(++_0x185f0d);}(_0xec39,0x19f));var _0x9ec3=function(_0x536656,_0x3d7c02){_0x536656=_0x536656-0x0;var _0x1a10c8=_0xec39[_0x536656];return _0x1a10c8;};'use strict';var _=require(_0x9ec3('0x0'));var util=require(_0x9ec3('0x1'));var logger=require(_0x9ec3('0x2'))(_0x9ec3('0x3'));var moment=require(_0x9ec3('0x4'));var BPromise=require(_0x9ec3('0x5'));var rp=require(_0x9ec3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ec3('0x7'));var config=require(_0x9ec3('0x8'));var attributes=require(_0x9ec3('0x9'));module['exports']=function(_0x49ddff,_0x55adba){return _0x49ddff[_0x9ec3('0xa')](_0x9ec3('0xb'),attributes,{'tableName':_0x9ec3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9ec3('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c9a2cde..44dfe2c 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 _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(_0x44515b,_0x42422d){var _0x3753da=function(_0x425f3c){while(--_0x425f3c){_0x44515b['push'](_0x44515b['shift']());}};_0x3753da(++_0x42422d);}(_0xa41a,0x6b));var _0xaa41=function(_0x2b4692,_0x3984b7){_0x2b4692=_0x2b4692-0x0;var _0x15c833=_0xa41a[_0x2b4692];return _0x15c833;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','WhatsappApplication,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2066d5,_0x293aa5){var _0x3dc4c1=function(_0x455adf){while(--_0x455adf){_0x2066d5['push'](_0x2066d5['shift']());}};_0x3dc4c1(++_0x293aa5);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index e273752..dc87643 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 _0x938d=['addMessage','/:id/tags','whatsappinteraction:addtags','addTags','put','tracked','whatsapp','whatsappinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd938('0x0'));var util=require(_0xd938('0x1'));var path=require('path');var timeout=require(_0xd938('0x2'));var express=require(_0xd938('0x3'));var router=express[_0xd938('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd938('0x5'));var config=require(_0xd938('0x6'));var controller=require(_0xd938('0x7'));router['get']('/',auth[_0xd938('0x8')](),controller[_0xd938('0x9')]);router[_0xd938('0xa')](_0xd938('0xb'),auth[_0xd938('0x8')](),controller[_0xd938('0xc')]);router['get'](_0xd938('0xd'),auth[_0xd938('0x8')](),controller[_0xd938('0xe')]);router[_0xd938('0xa')](_0xd938('0xf'),auth[_0xd938('0x8')](),controller['getMessages']);router[_0xd938('0xa')](_0xd938('0x10'),auth[_0xd938('0x8')](),controller[_0xd938('0x11')]);router[_0xd938('0x12')]('/',auth[_0xd938('0x8')](),controller[_0xd938('0x13')]);router[_0xd938('0x12')](_0xd938('0xf'),auth[_0xd938('0x8')](),controller[_0xd938('0x14')]);router[_0xd938('0x12')](_0xd938('0x15'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0xd938('0x16')),controller[_0xd938('0x17')]);router[_0xd938('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0xd938('0x19')](_0xd938('0x1a'),'whatsappinteraction:update'),controller['update']);router['delete'](_0xd938('0xd'),auth[_0xd938('0x8')](),interaction[_0xd938('0x19')]('whatsapp',_0xd938('0x1b')),controller[_0xd938('0x1c')]);router[_0xd938('0x1d')](_0xd938('0x15'),auth[_0xd938('0x8')](),controller['removeTags']);module[_0xd938('0x1e')]=router; \ No newline at end of file +var _0xfb65=['/:id/tags','tracked','addTags','put','whatsapp','update','delete','destroy','removeTags','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage'];(function(_0x3c7d1b,_0x1be40f){var _0x3a1585=function(_0x28ca81){while(--_0x28ca81){_0x3c7d1b['push'](_0x3c7d1b['shift']());}};_0x3a1585(++_0x1be40f);}(_0xfb65,0x82));var _0x5fb6=function(_0x1dfc71,_0x52cbd3){_0x1dfc71=_0x1dfc71-0x0;var _0x449188=_0xfb65[_0x1dfc71];return _0x449188;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0x8')]('/:id/messages',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xe')]);router['get'](_0x5fb6('0xf'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);router[_0x5fb6('0x11')]('/',auth[_0x5fb6('0xa')](),controller['create']);router[_0x5fb6('0x11')](_0x5fb6('0x12'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x13')]);router[_0x5fb6('0x11')](_0x5fb6('0x14'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')]('whatsapp','whatsappinteraction:addtags'),controller[_0x5fb6('0x16')]);router[_0x5fb6('0x17')]('/:id',auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:update'),controller[_0x5fb6('0x19')]);router[_0x5fb6('0x1a')](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:destroy'),controller[_0x5fb6('0x1b')]);router['delete'](_0x5fb6('0x14'),auth['isAuthenticated'](),controller[_0x5fb6('0x1c')]);module[_0x5fb6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 1e730ae..2bd4322 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 _0xd072=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd072,0x132));var _0x2d07=function(_0x490623,_0x363471){_0x490623=_0x490623-0x0;var _0x29d219=_0xd072[_0x490623];return _0x29d219;};'use strict';var Sequelize=require(_0x2d07('0x0'));var moment=require(_0x2d07('0x1'));module[_0x2d07('0x2')]={'closed':{'type':Sequelize[_0x2d07('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2d07('0x4')]},'disposition':{'type':Sequelize[_0x2d07('0x5')]},'secondDisposition':{'type':Sequelize[_0x2d07('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2d07('0x5')]},'phone':{'type':Sequelize[_0x2d07('0x5')]},'read1stAt':{'type':Sequelize[_0x2d07('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2d07('0x6')]('in',_0x2d07('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2d07('0x6')]('in',_0x2d07('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2d07('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f71=['DATE','STRING','ENUM','out','BOOLEAN','sequelize','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5f71,0xc9));var _0x15f7=function(_0x23ac1a,_0x30da95){_0x23ac1a=_0x23ac1a-0x0;var _0x324bf3=_0x5f71[_0x23ac1a];return _0x324bf3;};'use strict';var Sequelize=require(_0x15f7('0x0'));var moment=require('moment');module[_0x15f7('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x15f7('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x15f7('0x3')]},'phone':{'type':Sequelize[_0x15f7('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x15f7('0x4')]('in',_0x15f7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x15f7('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x15f7('0x4')]('in',_0x15f7('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x15f7('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 37bb216..c2a7114 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 _0x5204=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','push','answered','unmanaged','total','closed','UserId','waiting','talking','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','where','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','includeAll','include','options','catch','create','params','describe','addMessage','WhatsappMessage','ids','omit','findOne','findAll','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','Attachment','Messages','createdAt','direction','WhatsappAccount','Account','Owner','closedAt','existsSync','createReadStream','createWriteStream','basename','format','YYYY-MM-DD\x20HH:mm:ss','lastName','secret','renderFile','views','downloadInteraction.ejs','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x5204,0xdf));var _0x4520=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x5204[_0x2f9467];return _0x39894c;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4520('0x2'));var rp=require(_0x4520('0x3'));var moment=require(_0x4520('0x4'));var BPromise=require(_0x4520('0x5'));var Mustache=require(_0x4520('0x6'));var util=require('util');var path=require(_0x4520('0x7'));var sox=require('sox');var csv=require(_0x4520('0x8'));var ejs=require(_0x4520('0x9'));var fs=require('fs');var fs_extra=require(_0x4520('0xa'));var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x8'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var pdf=require(_0x4520('0x14'));var hardwareService=require(_0x4520('0x15'));var logger=require(_0x4520('0x16'))(_0x4520('0x17'));var utils=require(_0x4520('0x18'));var config=require(_0x4520('0x19'));var licenseUtil=require(_0x4520('0x1a'));var db=require(_0x4520('0x1b'))['db'];config[_0x4520('0x1c')]=_[_0x4520('0x1d')](config[_0x4520('0x1c')],{'host':_0x4520('0x1e'),'port':0x18eb});var socket=require(_0x4520('0x1f'))(new Redis(config[_0x4520('0x1c')]));require(_0x4520('0x20'))[_0x4520('0x21')](socket);function respondWithStatusCode(_0x48b3e7,_0x3e53e5){_0x3e53e5=_0x3e53e5||0xcc;return function(_0x20de6b){if(_0x20de6b){return _0x48b3e7[_0x4520('0x22')](_0x3e53e5);}return _0x48b3e7[_0x4520('0x23')](_0x3e53e5)[_0x4520('0x24')]();};}function respondWithResult(_0x51d85f,_0x2c1805){_0x2c1805=_0x2c1805||0xc8;return function(_0x33ac29){if(_0x33ac29){return _0x51d85f[_0x4520('0x23')](_0x2c1805)[_0x4520('0x25')](_0x33ac29);}};}function respondWithFilteredResult(_0x1b8b0f,_0x2e00f4){return function(_0x1dcf51){if(_0x1dcf51){var _0x4ba69f=typeof _0x2e00f4[_0x4520('0x26')]===_0x4520('0x27')&&typeof _0x2e00f4[_0x4520('0x28')]===_0x4520('0x27');var _0x4ac41d=_0x1dcf51[_0x4520('0x29')];var _0x52ca8c=_0x4ba69f?0x0:_0x2e00f4['offset'];var _0x4c46c5=_0x4ba69f?_0x1dcf51[_0x4520('0x29')]:_0x2e00f4['offset']+_0x2e00f4[_0x4520('0x28')];var _0x270dc2;if(_0x4c46c5>=_0x4ac41d){_0x4c46c5=_0x4ac41d;_0x270dc2=0xc8;}else{_0x270dc2=0xce;}_0x1b8b0f[_0x4520('0x23')](_0x270dc2);return _0x1b8b0f['set'](_0x4520('0x2a'),_0x52ca8c+'-'+_0x4c46c5+'/'+_0x4ac41d)[_0x4520('0x25')](_0x1dcf51);}return null;};}function patchUpdates(_0x3b2ede){return function(_0x4b889a){try{jsonpatch[_0x4520('0x2b')](_0x4b889a,_0x3b2ede,!![]);}catch(_0x847d15){return BPromise[_0x4520('0x2c')](_0x847d15);}return _0x4b889a[_0x4520('0x2d')]();};}function saveUpdates(_0x2a8528,_0x552da1){return function(_0x3774bd){if(_0x3774bd){return _0x3774bd[_0x4520('0x2e')](_0x2a8528)[_0x4520('0x2f')](function(_0x3e2906){return _0x3e2906;});}return null;};}function removeEntity(_0x57306b,_0x336c63){return function(_0x4602a4){if(_0x4602a4){return _0x4602a4[_0x4520('0x30')]()[_0x4520('0x2f')](function(){_0x57306b[_0x4520('0x23')](0xcc)[_0x4520('0x24')]();});}};}function handleEntityNotFound(_0x2d6902,_0x195c58){return function(_0x180c44){if(!_0x180c44){_0x2d6902[_0x4520('0x22')](0x194);}return _0x180c44;};}function handleError(_0x58836d,_0x222dbd){_0x222dbd=_0x222dbd||0x1f4;return function(_0x5c1a0b){logger[_0x4520('0x31')](_0x5c1a0b[_0x4520('0x32')]);if(_0x5c1a0b[_0x4520('0x33')]){delete _0x5c1a0b[_0x4520('0x33')];}_0x58836d[_0x4520('0x23')](_0x222dbd)[_0x4520('0x34')](_0x5c1a0b);};}function getInteractionUsers(_0x5bb163,_0x2c32ce){return new BPromise(function(_0x508c05,_0x2585eb){try{if(_0x2c32ce[_0x5bb163['id']]){_0x5bb163['Users']=_[_0x4520('0x35')](_0x2c32ce[_0x5bb163['id']],function(_0x5c140c){return{'id':_0x5c140c['id'],'fullname':_0x5c140c[_0x4520('0x36')]};});}}catch(_0x4e6a5f){_0x2585eb(_0x4e6a5f);}_0x508c05(_0x5bb163);});}function getInteractionTags(_0x5087dc,_0x18d6e9){return new BPromise(function(_0x14cbb5,_0x24d5b9){try{if(_0x5087dc['TagIds']){_0x5087dc[_0x4520('0x37')]=[];_0x5087dc[_0x4520('0x38')][_0x4520('0x39')](',')[_0x4520('0x3a')](function(_0x59b4ff){_0x5087dc['Tags'][_0x4520('0x3b')](_0x18d6e9[_0x59b4ff]);});}delete _0x5087dc[_0x4520('0x38')];}catch(_0x4a57d3){_0x24d5b9(_0x4a57d3);}_0x14cbb5(_0x5087dc);});}function updateWhatsappInteraction(_0x779e94,_0x3ee94f,_0x1b61d6){return new BPromise(function(_0x345bdc,_0x1eb998){return getInteractionUsers(_0x779e94,_0x1b61d6)[_0x4520('0x2f')](function(_0x550a0f){return getInteractionTags(_0x550a0f,_0x3ee94f);})[_0x4520('0x2f')](function(_0x368644){return getStateInteraction(_0x368644);})['then'](function(_0x3acc82){_0x345bdc(_0x3acc82);})['catch'](function(_0x8bf557){_0x1eb998(_0x8bf557);});});}function getStateInteraction(_0x268c05){return new BPromise(function(_0x4f2dc4){_0x268c05['waiting']=0x0;_0x268c05['talking']=0x0;_0x268c05[_0x4520('0x3c')]=0x0;_0x268c05[_0x4520('0x3d')]=0x0;_0x268c05[_0x4520('0x3e')]=0x0;if(!_0x268c05[_0x4520('0x3f')]&&!_0x268c05[_0x4520('0x40')]){_0x268c05[_0x4520('0x41')]+=0x1;}if(!_0x268c05[_0x4520('0x3f')]&&_0x268c05['UserId']){_0x268c05[_0x4520('0x42')]+=0x1;if(_0x268c05[_0x4520('0x41')]){_0x268c05[_0x4520('0x41')]-=0x1;}}if(_0x268c05['closed']&&_0x268c05[_0x4520('0x40')]){_0x268c05[_0x4520('0x3c')]+=0x1;if(_0x268c05['talking']){_0x268c05['talking']-=0x1;}}if(_0x268c05[_0x4520('0x3f')]&&!_0x268c05[_0x4520('0x40')]){_0x268c05[_0x4520('0x3d')]+=0x1;if(_0x268c05[_0x4520('0x41')]){_0x268c05[_0x4520('0x41')]-=0x1;}}_0x268c05['total']+=0x1;_0x4f2dc4(_0x268c05);});}exports['index']=function(_0x4f5aa1,_0x57a165){var _0x516993={},_0x43dc36={},_0x54da7a={'count':0x0,'rows':[]};var _0x517fcb=_[_0x4520('0x35')](db[_0x4520('0x43')][_0x4520('0x44')],function(_0x214026){return{'name':_0x214026[_0x4520('0x45')],'type':_0x214026['type'][_0x4520('0x46')]};});_0x43dc36[_0x4520('0x47')]=_['map'](_0x517fcb,'name');_0x43dc36[_0x4520('0x48')]=_[_0x4520('0x49')](_0x4f5aa1['query']);_0x43dc36[_0x4520('0x4a')]=_[_0x4520('0x4b')](_0x43dc36[_0x4520('0x47')],_0x43dc36[_0x4520('0x48')]);_0x516993['attributes']=_[_0x4520('0x4b')](_0x43dc36[_0x4520('0x47')],qs[_0x4520('0x4c')](_0x4f5aa1[_0x4520('0x48')][_0x4520('0x4c')]));_0x516993[_0x4520('0x4d')]=_0x516993[_0x4520('0x4d')][_0x4520('0x4e')]?_0x516993[_0x4520('0x4d')]:_0x43dc36[_0x4520('0x47')];if(!_0x4f5aa1[_0x4520('0x48')][_0x4520('0x4f')](_0x4520('0x50'))){_0x516993[_0x4520('0x28')]=qs[_0x4520('0x28')](_0x4f5aa1[_0x4520('0x48')][_0x4520('0x28')]);_0x516993['offset']=qs[_0x4520('0x26')](_0x4f5aa1[_0x4520('0x48')]['offset']);}_0x516993['order']=qs['sort'](_0x4f5aa1['query'][_0x4520('0x51')]);_0x516993['where']=qs[_0x4520('0x4a')](_[_0x4520('0x52')](_0x4f5aa1[_0x4520('0x48')],_0x43dc36[_0x4520('0x4a')]),_0x517fcb);var _0x177c4e=[];var _0x5e3eef=squel[_0x4520('0x53')]()[_0x4520('0x54')]('id')[_0x4520('0x54')](_0x4520('0x33'))[_0x4520('0x54')](_0x4520('0x55'))[_0x4520('0x56')](_0x4520('0x57'));var _0x17e353=squel[_0x4520('0x53')]()[_0x4520('0x54')](_0x4520('0x58'))['field']('u.fullname')[_0x4520('0x54')](_0x4520('0x59'))[_0x4520('0x56')]('user_has_whatsapp_interactions','ui')[_0x4520('0x5a')](_0x4520('0x5b'),'u',_0x4520('0x5c'));var _0x5398c2=squel[_0x4520('0x53')]()[_0x4520('0x56')](_0x4520('0x5d'),'i')['left_join']('cm_contacts','c',_0x4520('0x5e'))[_0x4520('0x5a')](_0x4520('0x5b'),'o',_0x4520('0x5f'))[_0x4520('0x5a')](_0x4520('0x60'),'a',_0x4520('0x61'))[_0x4520('0x5a')]('whatsapp_messages','me',_0x4520('0x62'))[_0x4520('0x5a')](_0x4520('0x63'),'it',_0x4520('0x64'))[_0x4520('0x5a')](_0x4520('0x57'),'t',_0x4520('0x65'));var _0x1a9a2d=squel[_0x4520('0x66')]();var _0x4562c4=[];var _0x381e0b=squel[_0x4520('0x66')]();var _0x2f11d9;if(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x67')]){_0x2f11d9=as[_0x4520('0x68')](_0x4f5aa1[_0x4520('0x48')]['search']);var _0x52bb6c=_0x2f11d9[_0x4520('0x69')];for(var _0x35defa=0x0;_0x35defa<_0x2f11d9[_0x4520('0x6a')][_0x4520('0x4e')];_0x35defa++){var _0x265bb4=_0x2f11d9[_0x4520('0x6a')][_0x35defa];var _0x54372b='i';var _0xdd3a69=_[_0x4520('0x6b')](_0x517fcb,['name',_0x265bb4[_0x4520('0x54')]]);if(!_0xdd3a69){switch(_0x265bb4[_0x4520('0x54')]){case _0x4520('0x6c'):if(_0x265bb4[_0x4520('0x6d')]==0x1){_0x5398c2['having']('`'+_0x265bb4[_0x4520('0x54')]+_0x4520('0x6e'));}else{_0x5398c2['having']('`'+_0x265bb4['field']+_0x4520('0x6f'));}break;case _0x4520('0x70'):if(_0x265bb4[_0x4520('0x71')]===_0x4520('0x72')){if(_0x265bb4[_0x4520('0x6d')][_0x4520('0x39')]('\x20')['length']>0x1){_0x1a9a2d[_0x52bb6c](_0x4520('0x73'),qs[_0x4520('0x74')](_0x265bb4[_0x4520('0x6d')]),null);}else{var _0x11966f='%'+_0x265bb4['value']+'%';_0x1a9a2d[_0x52bb6c](_0x4520('0x75'),_0x11966f,_0x11966f,_0x11966f);}}else{_0xdd3a69=_[_0x4520('0x6b')](_0x517fcb,['name',_0x4520('0x76')]);_0x265bb4['field']=_0x4520('0x76');_0x116328=as[_0x4520('0x77')](_0x54372b,_0xdd3a69[_0x4520('0x78')],_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328['value'][_0x4520('0x7a')],_0x116328[_0x4520('0x6d')][_0x4520('0x24')]);}break;case _0x4520('0x7b'):var _0x4b6f71=_0x265bb4[_0x4520('0x6d')][_0x4520('0x39')](',')[_0x4520('0x35')](function(_0x2d5bf6){return Number(_0x2d5bf6);});_0x4b6f71[_0x4520('0x3a')](function(_0x8d166){_0x381e0b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x8d166+',%');});_0x4562c4=_[_0x4520('0x7c')](_0x4562c4,_0x4b6f71);break;case'User':if(_0x265bb4[_0x4520('0x71')]===_0x4520('0x72')){_0x1a9a2d[_0x52bb6c](_0x4520('0x7d'),'%'+_0x265bb4[_0x4520('0x6d')]+'%',null);}else{_0xdd3a69=_[_0x4520('0x6b')](_0x517fcb,[_0x4520('0x33'),'UserId']);_0x265bb4['field']=_0x4520('0x40');_0x116328=as['buildExpression'](_0x54372b,_0xdd3a69[_0x4520('0x78')],_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328[_0x4520('0x6d')][_0x4520('0x7a')],_0x116328[_0x4520('0x6d')][_0x4520('0x24')]);}break;case _0x4520('0x7e'):_0x116328=as[_0x4520('0x77')]('me',null,_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328['value'][_0x4520('0x7a')],_0x116328['value'][_0x4520('0x24')]);break;}}else{var _0x116328=as[_0x4520('0x77')](_0x54372b,_0xdd3a69[_0x4520('0x78')],_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328['value'][_0x4520('0x7a')],_0x116328[_0x4520('0x6d')][_0x4520('0x24')]);}}}else{var _0x228973=_(_0x4f5aa1['query'])['keys']()['map'](function(_0x2bf316){return _[_0x4520('0x7f')](_0x517fcb,[_0x4520('0x33'),_0x2bf316])?_0x2bf316:undefined;})['compact']()[_0x4520('0x6d')]();if(!_[_0x4520('0x80')](_0x228973)){_0x228973[_0x4520('0x3a')](function(_0xc560a8){if(_0xc560a8===_0x4520('0x81')){_0x5398c2['where'](_0x4520('0x82'),[][_0x4520('0x83')](_0x4f5aa1[_0x4520('0x48')][_0xc560a8]));}else if(_0xc560a8==='createdAt'){var _0x3419bd=JSON[_0x4520('0x84')](_0x4f5aa1[_0x4520('0x48')][_0xc560a8])[_0x4520('0x85')];var _0x2e8474=JSON[_0x4520('0x84')](_0x4f5aa1[_0x4520('0x48')][_0xc560a8])[_0x4520('0x86')];_0x5398c2['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3419bd,_0x2e8474);}else{if(_0x4f5aa1[_0x4520('0x48')][_0xc560a8]===_0x4520('0x87')){_0x5398c2['where']('i.'+_0xc560a8+_0x4520('0x88'));}else{_0x5398c2['where']('i.'+_0xc560a8+_0x4520('0x89'),_0x4f5aa1[_0x4520('0x48')][_0xc560a8]);}}});}if(_0x4f5aa1['query'][_0x4520('0x8a')]){if(_0x4f5aa1[_0x4520('0x48')]['read']==0x1){_0x5398c2[_0x4520('0x8b')](_0x4520('0x8c'));}else{_0x5398c2['having'](_0x4520('0x8d'));}}if(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')]){_0x4562c4=_['isArray'](_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')])?_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')]:new Array(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')]);_0x4562c4[_0x4520('0x3a')](function(_0x2a1503){_0x381e0b['or'](_0x4520('0x8f'),'%,'+_0x2a1503+',%');});}if(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x90')]){var _0x31676c=_0x4f5aa1['query']['filter'][_0x4520('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x4520('0x92')](_0x31676c)){_0x1a9a2d['or'](_0x4520('0x93'),_0x31676c+'%')['or'](_0x4520('0x94'),_0x31676c+'%');}else{_0x1a9a2d['or'](_0x4520('0x95'),qs[_0x4520('0x74')](_0x31676c))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x31676c+'%');}}}_0x5398c2['where'](_0x1a9a2d);_0x5398c2[_0x4520('0x96')](_0x4520('0x97'));var _0x415d7f={'type':db[_0x4520('0x98')][_0x4520('0x99')][_0x4520('0x9a')],'raw':!![]};var _0x4b60e2=_0x5398c2[_0x4520('0x9b')]();_0x4b60e2[_0x4520('0x54')]('i.id');_0x4b60e2[_0x4520('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x516993['order']){_0x516993[_0x4520('0x9c')][_0x4520('0x3a')](function(_0x74297e){var _0x454b8c=_0x74297e[0x0]===_0x4520('0x9d')?_0x74297e[0x0]:'i.'+_0x74297e[0x0];_0x5398c2['order'](_0x454b8c,_0x74297e[0x1]===_0x4520('0x9e')?![]:!![]);});}if(!_[_0x4520('0x80')](_0x4562c4)){_0x5398c2['having'](_0x381e0b);_0x4b60e2['where'](_0x4520('0x9f'),_0x4562c4);}BPromise[_0x4520('0xa0')]()[_0x4520('0x2f')](function(){if(!_0x2f11d9){if(_0x4f5aa1['query'][_0x4520('0x81')])return;_0x4b60e2[_0x4520('0xa1')](_0x4520('0xa2'));_0x5398c2['where'](_0x4520('0xa2'));return;}if(_0x4f5aa1[_0x4520('0xa3')]['role']!==_0x4520('0xa4'))return;return _0x4f5aa1['user'][_0x4520('0xa5')]({'attributes':['id'],'raw':!![]})[_0x4520('0x2f')](function(_0x3e53d7){if(_[_0x4520('0x80')](_0x3e53d7)){_0x4b60e2[_0x4520('0xa1')](_0x4520('0xa6'));_0x5398c2[_0x4520('0xa1')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x4b60e2[_0x4520('0xa1')]('i.WhatsappAccountId\x20IN\x20?',_[_0x4520('0x35')](_0x3e53d7,'id'));_0x5398c2[_0x4520('0xa1')]('i.WhatsappAccountId\x20IN\x20?',_[_0x4520('0x35')](_0x3e53d7,'id'));}});})[_0x4520('0x2f')](function(){if(_0x4f5aa1[_0x4520('0xa3')][_0x4520('0xa7')]===_0x4520('0xa4')&&!_0x2f11d9&&!_0x4f5aa1[_0x4520('0x48')][_0x4520('0x81')])return[];return db[_0x4520('0xa8')][_0x4520('0x48')](_0x4b60e2[_0x4520('0xa9')](),_0x415d7f);})[_0x4520('0x2f')](function(_0x5b86ad){_0x54da7a['count']=_0x5b86ad['length'];if(_0x54da7a['count']===0x0)return[];return db['sequelize'][_0x4520('0x48')](_0x5e3eef[_0x4520('0xa9')](),_0x415d7f)[_0x4520('0x2f')](function(_0x3896fc){_0x177c4e=_['keyBy'](_0x3896fc,'id');_0x415d7f=_[_0x4520('0xaa')](_0x415d7f,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f5aa1[_0x4520('0x48')]['fields']){_0x516993[_0x4520('0x4d')]['forEach'](function(_0x2b334a){_0x5398c2[_0x4520('0x54')]('i.'+_0x2b334a);});}else{_0x5398c2[_0x4520('0x54')](_0x4520('0xab'),'unreadMessages');_0x5398c2[_0x4520('0x54')]('a.key',_0x4520('0xac'));_0x5398c2[_0x4520('0x54')](_0x4520('0xad'),_0x4520('0xae'));_0x5398c2[_0x4520('0x54')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x4520('0x9d'));_0x5398c2[_0x4520('0x54')]('i.*');_0x5398c2[_0x4520('0x54')](_0x4520('0xaf'),'Contact.firstName');_0x5398c2[_0x4520('0x54')]('c.lastName','Contact.lastName');_0x5398c2[_0x4520('0x54')](_0x4520('0xb0'),'Contact.email');_0x5398c2[_0x4520('0x54')]('c.phone',_0x4520('0xb1'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb2'),_0x4520('0xb3'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb4'),_0x4520('0xb5'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb6'),_0x4520('0xb7'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb8'),_0x4520('0xb9'));_0x5398c2[_0x4520('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4520('0x38'));}if(_0x516993[_0x4520('0x28')])_0x5398c2['limit'](_0x516993[_0x4520('0x28')]);if(_0x516993[_0x4520('0x26')])_0x5398c2['offset'](_0x516993[_0x4520('0x26')]);return db[_0x4520('0xa8')][_0x4520('0x48')](_0x5398c2[_0x4520('0xa9')](),_0x415d7f);})[_0x4520('0x2f')](function(_0xad6e88){if(_0xad6e88['length']>0x0)_0x17e353[_0x4520('0xa1')](_0x4520('0xba'),_[_0x4520('0x35')](_0xad6e88,'id'));return db[_0x4520('0xa8')][_0x4520('0x48')](_0x17e353['toString'](),_0x415d7f)['then'](function(_0x1f9fc1){var _0x3e46bd=_[_0x4520('0xbb')](_0x1f9fc1,_0x4520('0xbc'));var _0x28f486=[];_0xad6e88[_0x4520('0x3a')](function(_0x423c7e){_0x28f486[_0x4520('0x3b')](updateWhatsappInteraction(_0x423c7e,_0x177c4e,_0x3e46bd));});return BPromise[_0x4520('0xbd')](_0x28f486);});});})[_0x4520('0x2f')](function(_0x480939){_0x54da7a[_0x4520('0xbe')]=_0x480939;return _0x54da7a;})[_0x4520('0x2f')](respondWithFilteredResult(_0x57a165,_0x516993))['catch'](handleError(_0x57a165,null));};exports[_0x4520('0xbf')]=function(_0x572f6b,_0x54d969){var _0x14724f={'raw':![],'where':{'id':_0x572f6b['params']['id']}},_0x1823a2={};_0x1823a2['model']=_[_0x4520('0x49')](db[_0x4520('0x43')][_0x4520('0x44')]);_0x1823a2[_0x4520('0x48')]=_['keys'](_0x572f6b[_0x4520('0x48')]);_0x1823a2[_0x4520('0x4a')]=_[_0x4520('0x4b')](_0x1823a2[_0x4520('0x47')],_0x1823a2[_0x4520('0x48')]);_0x14724f[_0x4520('0x4d')]=_[_0x4520('0x4b')](_0x1823a2[_0x4520('0x47')],qs[_0x4520('0x4c')](_0x572f6b['query'][_0x4520('0x4c')]));_0x14724f[_0x4520('0x4d')]=_0x14724f[_0x4520('0x4d')]['length']?_0x14724f['attributes']:_0x1823a2[_0x4520('0x47')];if(_0x572f6b['query'][_0x4520('0xc0')]){_0x14724f[_0x4520('0xc1')]=[{'all':!![]}];}_0x14724f=_[_0x4520('0xaa')]({},_0x14724f,_0x572f6b[_0x4520('0xc2')]);return db[_0x4520('0x43')][_0x4520('0x6b')](_0x14724f)[_0x4520('0x2f')](handleEntityNotFound(_0x54d969,null))[_0x4520('0x2f')](respondWithResult(_0x54d969,null))[_0x4520('0xc3')](handleError(_0x54d969,null));};exports['create']=function(_0x309d14,_0x3cfb78){return db[_0x4520('0x43')][_0x4520('0xc4')](_0x309d14[_0x4520('0x7e')],{})[_0x4520('0x2f')](respondWithResult(_0x3cfb78,0xc9))[_0x4520('0xc3')](handleError(_0x3cfb78,null));};exports['update']=function(_0x666f9c,_0x249502){if(_0x666f9c[_0x4520('0x7e')]['id']){delete _0x666f9c[_0x4520('0x7e')]['id'];}return db[_0x4520('0x43')]['find']({'where':{'id':_0x666f9c['params']['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x249502,null))[_0x4520('0x2f')](saveUpdates(_0x666f9c[_0x4520('0x7e')],null))['then'](respondWithResult(_0x249502,null))['catch'](handleError(_0x249502,null));};exports[_0x4520('0x30')]=function(_0x904f4f,_0x3e99e3){return db['WhatsappInteraction'][_0x4520('0x6b')]({'where':{'id':_0x904f4f[_0x4520('0xc5')]['id']}})['then'](handleEntityNotFound(_0x3e99e3,null))[_0x4520('0x2f')](removeEntity(_0x3e99e3,null))[_0x4520('0xc3')](handleError(_0x3e99e3,null));};exports[_0x4520('0xc6')]=function(_0x3c5501,_0xea598f){return db[_0x4520('0x43')][_0x4520('0xc6')]()[_0x4520('0x2f')](respondWithResult(_0xea598f,null))[_0x4520('0xc3')](handleError(_0xea598f,null));};exports[_0x4520('0xc7')]=function(_0x5de8f9,_0x31b6f5,_0x4f8512){return db[_0x4520('0xc8')]['find']({'where':{'id':_0x5de8f9[_0x4520('0xc5')]['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x31b6f5,null))[_0x4520('0x2f')](function(_0x3639f1){if(_0x3639f1){return _0x3639f1['addMessage'](_0x5de8f9[_0x4520('0x7e')][_0x4520('0xc9')],_[_0x4520('0xca')](_0x5de8f9[_0x4520('0x7e')],[_0x4520('0xc9'),'id'])||{});}})[_0x4520('0x2f')](respondWithResult(_0x31b6f5,null))[_0x4520('0xc3')](handleError(_0x31b6f5,null));};exports['getMessages']=function(_0x39fa27,_0x56f398,_0x4ab423){var _0x320603={'raw':![],'where':{}};var _0x59d564={};var _0x9cbef9={'count':0x0,'rows':[]};return db[_0x4520('0x43')][_0x4520('0xcb')]({'where':{'id':_0x39fa27[_0x4520('0xc5')]['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x56f398,null))[_0x4520('0x2f')](function(_0x550969){if(_0x550969){_0x59d564[_0x4520('0x47')]=_[_0x4520('0x49')](db[_0x4520('0xc8')][_0x4520('0x44')]);_0x59d564['query']=_[_0x4520('0x49')](_0x39fa27['query']);_0x59d564[_0x4520('0x4a')]=_[_0x4520('0x4b')](_0x59d564['model'],_0x59d564[_0x4520('0x48')]);_0x320603[_0x4520('0x4d')]=_[_0x4520('0x4b')](_0x59d564['model'],qs[_0x4520('0x4c')](_0x39fa27[_0x4520('0x48')]['fields']));_0x320603[_0x4520('0x4d')]=_0x320603[_0x4520('0x4d')][_0x4520('0x4e')]?_0x320603[_0x4520('0x4d')]:_0x59d564[_0x4520('0x47')];if(!_0x39fa27['query'][_0x4520('0x4f')](_0x4520('0x50'))){_0x320603[_0x4520('0x28')]=qs['limit'](_0x39fa27[_0x4520('0x48')]['limit']);_0x320603[_0x4520('0x26')]=qs[_0x4520('0x26')](_0x39fa27[_0x4520('0x48')][_0x4520('0x26')]);}_0x320603[_0x4520('0x9c')]=qs[_0x4520('0x51')](_0x39fa27[_0x4520('0x48')][_0x4520('0x51')]);_0x320603[_0x4520('0xa1')]=qs['filters'](_[_0x4520('0x52')](_0x39fa27[_0x4520('0x48')],_0x59d564['filters']));_0x320603['where'][_0x4520('0xbc')]=_0x550969['id'];if(_0x39fa27[_0x4520('0x48')][_0x4520('0x90')]){_0x320603[_0x4520('0xa1')]=_[_0x4520('0xaa')](_0x320603[_0x4520('0xa1')],{'$or':_[_0x4520('0x35')](_0x320603[_0x4520('0x4d')],function(_0x1cea0e){var _0x156129={};_0x156129[_0x1cea0e]={'$like':'%'+_0x39fa27[_0x4520('0x48')]['filter']+'%'};return _0x156129;})});}if(_0x39fa27[_0x4520('0x48')][_0x4520('0x85')]){var _0x3847ca=_0x39fa27[_0x4520('0x48')][_0x4520('0x85')][_0x4520('0x39')](',');var _0x2d596d={};_0x2d596d[_0x3847ca[0x0]]={'$gte':moment(_0x3847ca[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x320603['where']=_[_0x4520('0xaa')](_0x320603[_0x4520('0xa1')],_0x2d596d);}_0x320603=_[_0x4520('0xaa')]({},_0x320603,_0x39fa27[_0x4520('0xc2')]);return db[_0x4520('0xc8')][_0x4520('0x29')]({'where':_0x320603[_0x4520('0xa1')]})[_0x4520('0x2f')](function(_0xdc61bd){_0x9cbef9[_0x4520('0x29')]=_0xdc61bd;if(_0x39fa27[_0x4520('0x48')][_0x4520('0xc0')]){_0x320603[_0x4520('0xc1')]=[{'all':!![]}];}return db[_0x4520('0xc8')][_0x4520('0xcc')](_0x320603);})[_0x4520('0x2f')](function(_0x45c3ad){_0x9cbef9['rows']=_0x45c3ad;return _0x9cbef9;});}})[_0x4520('0x2f')](respondWithFilteredResult(_0x56f398,_0x320603))[_0x4520('0xc3')](handleError(_0x56f398,null));};exports['addTags']=function(_0x49eaec,_0x5068cc,_0x574eb5){return db['WhatsappInteraction'][_0x4520('0x6b')]({'where':{'id':_0x49eaec[_0x4520('0xc5')]['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x5068cc,null))[_0x4520('0x2f')](function(_0x3427d8){if(_0x3427d8){return _0x3427d8[_0x4520('0xcd')](_0x49eaec[_0x4520('0x7e')][_0x4520('0xc9')],_[_0x4520('0xca')](_0x49eaec['body'],['ids','id'])||{})[_0x4520('0xce')](function(){return db[_0x4520('0x7b')][_0x4520('0xcc')]({'attributes':['id',_0x4520('0x33'),_0x4520('0x55')],'where':{'id':_0x49eaec['body']['ids']}});})['then'](function(_0x2751fe){socket[_0x4520('0xcf')](_0x4520('0xd0'),{'id':Number(_0x49eaec['params']['id']),'tags':_0x2751fe||[]});return{'id':Number(_0x49eaec[_0x4520('0xc5')]['id']),'tags':_0x2751fe||[]};});}})[_0x4520('0x2f')](respondWithResult(_0x5068cc,null))['catch'](handleError(_0x5068cc,null));};exports[_0x4520('0xd1')]=function(_0x5f3712,_0x75a51a,_0x444ecd){return db['WhatsappInteraction']['find']({'where':{'id':_0x5f3712[_0x4520('0xc5')]['id']}})['then'](handleEntityNotFound(_0x75a51a,null))[_0x4520('0x2f')](function(_0x15783d){if(_0x15783d){return _0x15783d[_0x4520('0xd1')](_0x5f3712[_0x4520('0x48')][_0x4520('0xc9')]);}})[_0x4520('0x2f')](respondWithStatusCode(_0x75a51a,null))[_0x4520('0xc3')](handleError(_0x75a51a,null));};exports[_0x4520('0xd2')]=function(_0xf9306d,_0x942005){var _0x1d62df=moment()['unix']()[_0x4520('0xa9')]();var _0x349912=path['join'](config[_0x4520('0xd3')],_0x4520('0xd4'),_0x4520('0xd5'),_0x4520('0xd6'));var _0x2199ac=path[_0x4520('0xd7')](config[_0x4520('0xd3')],'server',_0x4520('0xd5'),_0x4520('0xd8'));var _0x490ec8=path[_0x4520('0xd7')](_0x349912,_0x1d62df);var _0x4d7a3c=util['format'](_0x4520('0xd9'),_0xf9306d[_0x4520('0xc5')]['id'],_0x1d62df);var _0x2edd95=path[_0x4520('0xd7')](_0x349912,_0x4d7a3c);var _0x51f4da=[];_0x51f4da[_0x4520('0x3b')]({'model':db['User'],'as':_0x4520('0xda'),'attributes':['id',_0x4520('0x36')],'raw':!![]});_0x51f4da[_0x4520('0x3b')]({'model':db['CmContact'],'as':_0x4520('0x70'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0xf9306d[_0x4520('0x48')][_0x4520('0xd8')]){_0x51f4da[_0x4520('0x3b')]({'model':db[_0x4520('0xdb')],'as':_0x4520('0xdb'),'raw':!![]});}var _0x500f4b=[{'model':db[_0x4520('0xc8')],'as':_0x4520('0xdc'),'attributes':['id',_0x4520('0x7e'),_0x4520('0xdd'),_0x4520('0xde'),'secret',_0x4520('0x8a')],'include':_0x51f4da}];_0x500f4b[_0x4520('0x3b')]({'model':db[_0x4520('0xdf')],'as':_0x4520('0xe0'),'attributes':['id',_0x4520('0x33')]});_0x500f4b[_0x4520('0x3b')]({'model':db['User'],'as':_0x4520('0xe1'),'attributes':['id',_0x4520('0x36')]});return db['WhatsappInteraction']['find']({'where':{'id':_0xf9306d[_0x4520('0xc5')]['id']},'include':_0x500f4b})[_0x4520('0x2f')](handleEntityNotFound(_0x942005,null))[_0x4520('0x2f')](function(_0x522ba6){if(_0x522ba6){var _0x559ff3=_0x522ba6['get']({'plain':!![]});fs['mkdirSync'](_0x490ec8);var _0x117ec3={'channel':'Whatsapp','account':_0x559ff3[_0x4520('0xe0')][_0x4520('0x33')],'agent':_0x559ff3['Owner']?_0x559ff3[_0x4520('0xe1')]['fullname']:'N.A.','createdAt':moment(_0x559ff3[_0x4520('0xdd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4520('0xa9')](),'closedAt':_0x559ff3[_0x4520('0x3f')]?moment(_0x559ff3[_0x4520('0xe2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4520('0xa9')]():'','disposition':_0x559ff3['disposition'],'messages':_(_0x559ff3['Messages'])[_0x4520('0x90')]({'secret':![]})[_0x4520('0x35')](function(_0x5bdd2b){if(_0x5bdd2b[_0x4520('0xdb')]){var _0x5eb334=path[_0x4520('0xd7')](_0x2199ac,_0x5bdd2b[_0x4520('0xdb')]['basename']);if(fs[_0x4520('0xe3')](_0x5eb334)){fs[_0x4520('0xe4')](_0x5eb334)['pipe'](fs[_0x4520('0xe5')](path['join'](_0x490ec8,_0x5bdd2b['Attachment'][_0x4520('0xe6')])));}}return{'date':moment(_0x5bdd2b[_0x4520('0xdd')])[_0x4520('0xe7')](_0x4520('0xe8'))[_0x4520('0xa9')](),'sender':_0x5bdd2b[_0x4520('0xde')]==='out'?_0x5bdd2b[_0x4520('0xda')]?_0x5bdd2b[_0x4520('0xda')]['fullname']:'System':_0x5bdd2b['Contact']['firstName']+(_0x5bdd2b[_0x4520('0x70')][_0x4520('0xe9')]?'\x20'+_0x5bdd2b[_0x4520('0x70')]['lastName']:''),'body':_0x5bdd2b['Attachment']?_0x5bdd2b[_0x4520('0xdb')][_0x4520('0xe6')]:_0x5bdd2b[_0x4520('0x7e')],'direction':_0x5bdd2b['direction']==='out'?'A':'C','secret':_0x5bdd2b[_0x4520('0xea')],'read':_0x5bdd2b[_0x4520('0x8a')],'attachment':_0x5bdd2b[_0x4520('0xdb')]};})['value']()};return ejs[_0x4520('0xeb')](path[_0x4520('0xd7')](config[_0x4520('0xd3')],_0x4520('0xd4'),_0x4520('0xec'),_0x4520('0xed')),{'interaction':_0x117ec3})[_0x4520('0x2f')](function(_0x5be947){var _0xfac206=path[_0x4520('0xd7')](_0x490ec8,'transcript-'+_0x559ff3['id']+'-'+_0x1d62df+'.pdf');var _0x29b1af={'path':_0xfac206,'channel':'Whatsapp','interactionId':_0x559ff3['id']};return pdf['createPdfFromHTML'](_0x5be947,_0x29b1af);})[_0x4520('0x2f')](function(){return new BPromise(function(_0x13d892,_0x3b0c7a){zipdir(_0x490ec8,{'saveTo':_0x2edd95},function(_0x129f52,_0x7fb324){if(_0x129f52)return _0x3b0c7a(_0x129f52);return _0x13d892(_0x7fb324);});})[_0x4520('0x2f')](function(){return new BPromise(function(_0x347acf,_0x24a450){rimraf(_0x490ec8,function(_0x2096ed){if(_0x2096ed)_0x24a450(_0x2096ed);return _0x347acf();});});})[_0x4520('0x2f')](function(){return _0x942005[_0x4520('0xd2')](_0x2edd95,_0x4d7a3c,function(_0x492714){if(_0x492714){console[_0x4520('0xee')](_0x4520('0xef'),_0x492714);}else{fs[_0x4520('0xf0')](_0x2edd95);}});});});}else{return _0x942005[_0x4520('0x22')](0xc8);}})[_0x4520('0xc3')](handleError(_0x942005,null));}; \ No newline at end of file +var _0x4213=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','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)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','toString','merge','WhatsappInteraction','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.email','Contact.email','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','rawAttributes','includeAll','options','create','destroy','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','transcript-%d-%s.zip','lastName','Attachment','Messages','direction','secret','Owner','Account','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','firstName','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','name','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','from','user_has_whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4213,0x77));var _0x3421=function(_0x29e656,_0x4aec83){_0x29e656=_0x29e656-0x0;var _0x6e0c81=_0x4213[_0x29e656];return _0x6e0c81;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3421('0x12'));var hardwareService=require(_0x3421('0x13'));var logger=require(_0x3421('0x14'))(_0x3421('0x15'));var utils=require(_0x3421('0x16'));var config=require(_0x3421('0x17'));var licenseUtil=require(_0x3421('0x18'));var db=require('../../mysqldb')['db'];config[_0x3421('0x19')]=_[_0x3421('0x1a')](config[_0x3421('0x19')],{'host':_0x3421('0x1b'),'port':0x18eb});var socket=require(_0x3421('0x1c'))(new Redis(config[_0x3421('0x19')]));require(_0x3421('0x1d'))['register'](socket);function respondWithStatusCode(_0xafd9e0,_0x4b5f43){_0x4b5f43=_0x4b5f43||0xcc;return function(_0x372d21){if(_0x372d21){return _0xafd9e0[_0x3421('0x1e')](_0x4b5f43);}return _0xafd9e0['status'](_0x4b5f43)[_0x3421('0x1f')]();};}function respondWithResult(_0x4c6f7b,_0x16bc8f){_0x16bc8f=_0x16bc8f||0xc8;return function(_0x23694b){if(_0x23694b){return _0x4c6f7b['status'](_0x16bc8f)[_0x3421('0x20')](_0x23694b);}};}function respondWithFilteredResult(_0x3dec08,_0x130d3c){return function(_0x104cc5){if(_0x104cc5){var _0x18acc1=typeof _0x130d3c[_0x3421('0x21')]===_0x3421('0x22')&&typeof _0x130d3c[_0x3421('0x23')]===_0x3421('0x22');var _0x4776ec=_0x104cc5[_0x3421('0x24')];var _0x50d9a5=_0x18acc1?0x0:_0x130d3c[_0x3421('0x21')];var _0x4b59a5=_0x18acc1?_0x104cc5['count']:_0x130d3c['offset']+_0x130d3c[_0x3421('0x23')];var _0x467f8d;if(_0x4b59a5>=_0x4776ec){_0x4b59a5=_0x4776ec;_0x467f8d=0xc8;}else{_0x467f8d=0xce;}_0x3dec08[_0x3421('0x25')](_0x467f8d);return _0x3dec08[_0x3421('0x26')](_0x3421('0x27'),_0x50d9a5+'-'+_0x4b59a5+'/'+_0x4776ec)[_0x3421('0x20')](_0x104cc5);}return null;};}function patchUpdates(_0x3df305){return function(_0x705591){try{jsonpatch[_0x3421('0x28')](_0x705591,_0x3df305,!![]);}catch(_0x34389e){return BPromise['reject'](_0x34389e);}return _0x705591['save']();};}function saveUpdates(_0x494423,_0x3fef90){return function(_0x958899){if(_0x958899){return _0x958899[_0x3421('0x29')](_0x494423)['then'](function(_0x506af4){return _0x506af4;});}return null;};}function removeEntity(_0x1b65d0,_0x5b53b6){return function(_0x2bf001){if(_0x2bf001){return _0x2bf001['destroy']()[_0x3421('0x2a')](function(){_0x1b65d0[_0x3421('0x25')](0xcc)[_0x3421('0x1f')]();});}};}function handleEntityNotFound(_0x2e6a75,_0x186885){return function(_0x5df4dc){if(!_0x5df4dc){_0x2e6a75[_0x3421('0x1e')](0x194);}return _0x5df4dc;};}function handleError(_0x52fd41,_0x5efe73){_0x5efe73=_0x5efe73||0x1f4;return function(_0x17f501){logger['error'](_0x17f501['stack']);if(_0x17f501[_0x3421('0x2b')]){delete _0x17f501['name'];}_0x52fd41[_0x3421('0x25')](_0x5efe73)['send'](_0x17f501);};}function getInteractionUsers(_0xc7f9fb,_0xbe9f09){return new BPromise(function(_0x48d828,_0x3f7c0b){try{if(_0xbe9f09[_0xc7f9fb['id']]){_0xc7f9fb[_0x3421('0x2c')]=_[_0x3421('0x2d')](_0xbe9f09[_0xc7f9fb['id']],function(_0x4a0ac7){return{'id':_0x4a0ac7['id'],'fullname':_0x4a0ac7[_0x3421('0x2e')]};});}}catch(_0x50d61b){_0x3f7c0b(_0x50d61b);}_0x48d828(_0xc7f9fb);});}function getInteractionTags(_0x2b5af4,_0xf0039){return new BPromise(function(_0x1045ab,_0x841e08){try{if(_0x2b5af4[_0x3421('0x2f')]){_0x2b5af4[_0x3421('0x30')]=[];_0x2b5af4[_0x3421('0x2f')][_0x3421('0x31')](',')[_0x3421('0x32')](function(_0x220f14){_0x2b5af4['Tags']['push'](_0xf0039[_0x220f14]);});}delete _0x2b5af4[_0x3421('0x2f')];}catch(_0x1c21a8){_0x841e08(_0x1c21a8);}_0x1045ab(_0x2b5af4);});}function updateWhatsappInteraction(_0x5218cd,_0xc22dab,_0x186d64){return new BPromise(function(_0x3dbd29,_0x17292a){return getInteractionUsers(_0x5218cd,_0x186d64)[_0x3421('0x2a')](function(_0x4a33f8){return getInteractionTags(_0x4a33f8,_0xc22dab);})[_0x3421('0x2a')](function(_0xebf5fc){return getStateInteraction(_0xebf5fc);})[_0x3421('0x2a')](function(_0x5df941){_0x3dbd29(_0x5df941);})[_0x3421('0x33')](function(_0x4ba1b9){_0x17292a(_0x4ba1b9);});});}function getStateInteraction(_0x137e98){return new BPromise(function(_0x195d9b){_0x137e98[_0x3421('0x34')]=0x0;_0x137e98[_0x3421('0x35')]=0x0;_0x137e98[_0x3421('0x36')]=0x0;_0x137e98[_0x3421('0x37')]=0x0;_0x137e98[_0x3421('0x38')]=0x0;if(!_0x137e98['closed']&&!_0x137e98['UserId']){_0x137e98['waiting']+=0x1;}if(!_0x137e98[_0x3421('0x39')]&&_0x137e98['UserId']){_0x137e98['talking']+=0x1;if(_0x137e98[_0x3421('0x34')]){_0x137e98['waiting']-=0x1;}}if(_0x137e98[_0x3421('0x39')]&&_0x137e98[_0x3421('0x3a')]){_0x137e98['answered']+=0x1;if(_0x137e98[_0x3421('0x35')]){_0x137e98[_0x3421('0x35')]-=0x1;}}if(_0x137e98[_0x3421('0x39')]&&!_0x137e98[_0x3421('0x3a')]){_0x137e98['unmanaged']+=0x1;if(_0x137e98[_0x3421('0x34')]){_0x137e98[_0x3421('0x34')]-=0x1;}}_0x137e98[_0x3421('0x38')]+=0x1;_0x195d9b(_0x137e98);});}exports[_0x3421('0x3b')]=function(_0x25de09,_0x4a007d){var _0x16dd0b={},_0x454859={},_0x5e3a2f={'count':0x0,'rows':[]};var _0x15551c=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x418e80){return{'name':_0x418e80[_0x3421('0x3c')],'type':_0x418e80[_0x3421('0x3d')][_0x3421('0x3e')]};});_0x454859[_0x3421('0x3f')]=_[_0x3421('0x2d')](_0x15551c,_0x3421('0x2b'));_0x454859[_0x3421('0x40')]=_[_0x3421('0x41')](_0x25de09[_0x3421('0x40')]);_0x454859[_0x3421('0x42')]=_[_0x3421('0x43')](_0x454859[_0x3421('0x3f')],_0x454859[_0x3421('0x40')]);_0x16dd0b['attributes']=_[_0x3421('0x43')](_0x454859[_0x3421('0x3f')],qs[_0x3421('0x44')](_0x25de09[_0x3421('0x40')]['fields']));_0x16dd0b[_0x3421('0x45')]=_0x16dd0b['attributes'][_0x3421('0x46')]?_0x16dd0b[_0x3421('0x45')]:_0x454859[_0x3421('0x3f')];if(!_0x25de09[_0x3421('0x40')][_0x3421('0x47')](_0x3421('0x48'))){_0x16dd0b[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x25de09[_0x3421('0x40')][_0x3421('0x23')]);_0x16dd0b[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x25de09[_0x3421('0x40')]['offset']);}_0x16dd0b[_0x3421('0x49')]=qs['sort'](_0x25de09[_0x3421('0x40')][_0x3421('0x4a')]);_0x16dd0b[_0x3421('0x4b')]=qs[_0x3421('0x42')](_[_0x3421('0x4c')](_0x25de09[_0x3421('0x40')],_0x454859[_0x3421('0x42')]),_0x15551c);var _0x44bf06=[];var _0x406ea9=squel[_0x3421('0x4d')]()['field']('id')[_0x3421('0x4e')](_0x3421('0x2b'))[_0x3421('0x4e')]('color')['from'](_0x3421('0x4f'));var _0x60747d=squel[_0x3421('0x4d')]()['field'](_0x3421('0x50'))[_0x3421('0x4e')](_0x3421('0x51'))[_0x3421('0x4e')]('ui.WhatsappInteractionId')[_0x3421('0x52')](_0x3421('0x53'),'ui')[_0x3421('0x54')]('users','u','u.id\x20=\x20ui.UserId');var _0x5a2004=squel[_0x3421('0x4d')]()[_0x3421('0x52')]('whatsapp_interactions','i')['left_join'](_0x3421('0x55'),'c',_0x3421('0x56'))[_0x3421('0x54')](_0x3421('0x57'),'o',_0x3421('0x58'))['left_join'](_0x3421('0x59'),'a',_0x3421('0x5a'))[_0x3421('0x54')](_0x3421('0x5b'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x3421('0x54')](_0x3421('0x5c'),'it',_0x3421('0x5d'))['left_join'](_0x3421('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x598dfa=squel[_0x3421('0x5e')]();var _0x498be5=[];var _0x4e33a0=squel[_0x3421('0x5e')]();var _0x12bd9a;if(_0x25de09['query'][_0x3421('0x5f')]){_0x12bd9a=as[_0x3421('0x60')](_0x25de09[_0x3421('0x40')][_0x3421('0x5f')]);var _0x1c73b9=_0x12bd9a[_0x3421('0x61')];for(var _0x4e1103=0x0;_0x4e1103<_0x12bd9a[_0x3421('0x62')][_0x3421('0x46')];_0x4e1103++){var _0x484c92=_0x12bd9a[_0x3421('0x62')][_0x4e1103];var _0x23ddd5='i';var _0x5bef38=_[_0x3421('0x63')](_0x15551c,[_0x3421('0x2b'),_0x484c92[_0x3421('0x4e')]]);if(!_0x5bef38){switch(_0x484c92['field']){case _0x3421('0x64'):if(_0x484c92[_0x3421('0x65')]==0x1){_0x5a2004[_0x3421('0x66')]('`'+_0x484c92[_0x3421('0x4e')]+_0x3421('0x67'));}else{_0x5a2004[_0x3421('0x66')]('`'+_0x484c92[_0x3421('0x4e')]+_0x3421('0x68'));}break;case _0x3421('0x69'):if(_0x484c92[_0x3421('0x6a')]===_0x3421('0x6b')){if(_0x484c92[_0x3421('0x65')][_0x3421('0x31')]('\x20')[_0x3421('0x46')]>0x1){_0x598dfa[_0x1c73b9](_0x3421('0x6c'),qs['getFullTextValue'](_0x484c92[_0x3421('0x65')]),null);}else{var _0x2aaab0='%'+_0x484c92[_0x3421('0x65')]+'%';_0x598dfa[_0x1c73b9](_0x3421('0x6d'),_0x2aaab0,_0x2aaab0,_0x2aaab0);}}else{_0x5bef38=_[_0x3421('0x63')](_0x15551c,[_0x3421('0x2b'),_0x3421('0x6e')]);_0x484c92[_0x3421('0x4e')]='ContactId';_0x4fd786=as[_0x3421('0x6f')](_0x23ddd5,_0x5bef38['type'],_0x484c92);_0x598dfa[_0x1c73b9](_0x4fd786[_0x3421('0x70')],_0x4fd786[_0x3421('0x65')][_0x3421('0x71')],_0x4fd786[_0x3421('0x65')]['end']);}break;case _0x3421('0x72'):var _0x21e11b=_0x484c92[_0x3421('0x65')][_0x3421('0x31')](',')[_0x3421('0x2d')](function(_0x823366){return Number(_0x823366);});_0x21e11b['forEach'](function(_0x8a35b5){_0x4e33a0['or'](_0x3421('0x73'),'%,'+_0x8a35b5+',%');});_0x498be5=_[_0x3421('0x74')](_0x498be5,_0x21e11b);break;case _0x3421('0x75'):if(_0x484c92[_0x3421('0x6a')]===_0x3421('0x6b')){_0x598dfa[_0x1c73b9](_0x3421('0x76'),'%'+_0x484c92[_0x3421('0x65')]+'%',null);}else{_0x5bef38=_['find'](_0x15551c,[_0x3421('0x2b'),_0x3421('0x3a')]);_0x484c92[_0x3421('0x4e')]=_0x3421('0x3a');_0x4fd786=as[_0x3421('0x6f')](_0x23ddd5,_0x5bef38['type'],_0x484c92);_0x598dfa[_0x1c73b9](_0x4fd786['text'],_0x4fd786[_0x3421('0x65')][_0x3421('0x71')],_0x4fd786[_0x3421('0x65')]['end']);}break;case _0x3421('0x77'):_0x4fd786=as['buildExpression']('me',null,_0x484c92);_0x598dfa[_0x1c73b9](_0x4fd786[_0x3421('0x70')],_0x4fd786['value']['start'],_0x4fd786['value']['end']);break;}}else{var _0x4fd786=as[_0x3421('0x6f')](_0x23ddd5,_0x5bef38[_0x3421('0x3d')],_0x484c92);_0x598dfa[_0x1c73b9](_0x4fd786[_0x3421('0x70')],_0x4fd786[_0x3421('0x65')][_0x3421('0x71')],_0x4fd786[_0x3421('0x65')][_0x3421('0x1f')]);}}}else{var _0x11e770=_(_0x25de09[_0x3421('0x40')])[_0x3421('0x41')]()['map'](function(_0x297184){return _['some'](_0x15551c,[_0x3421('0x2b'),_0x297184])?_0x297184:undefined;})[_0x3421('0x78')]()[_0x3421('0x65')]();if(!_[_0x3421('0x79')](_0x11e770)){_0x11e770[_0x3421('0x32')](function(_0x1d5f5d){if(_0x1d5f5d===_0x3421('0x7a')){_0x5a2004[_0x3421('0x4b')](_0x3421('0x7b'),[]['concat'](_0x25de09[_0x3421('0x40')][_0x1d5f5d]));}else if(_0x1d5f5d===_0x3421('0x7c')){var _0x1ed098=JSON['parse'](_0x25de09['query'][_0x1d5f5d])['$gte'];var _0x5dba56=JSON[_0x3421('0x7d')](_0x25de09['query'][_0x1d5f5d])[_0x3421('0x7e')];_0x5a2004[_0x3421('0x4b')](_0x3421('0x7f'),_0x1ed098,_0x5dba56);}else{if(_0x25de09[_0x3421('0x40')][_0x1d5f5d]==='null'){_0x5a2004[_0x3421('0x4b')]('i.'+_0x1d5f5d+_0x3421('0x80'));}else{_0x5a2004[_0x3421('0x4b')]('i.'+_0x1d5f5d+_0x3421('0x81'),_0x25de09[_0x3421('0x40')][_0x1d5f5d]);}}});}if(_0x25de09[_0x3421('0x40')]['read']){if(_0x25de09[_0x3421('0x40')][_0x3421('0x82')]==0x1){_0x5a2004[_0x3421('0x66')](_0x3421('0x83'));}else{_0x5a2004[_0x3421('0x66')](_0x3421('0x84'));}}if(_0x25de09[_0x3421('0x40')]['tag']){_0x498be5=_['isArray'](_0x25de09[_0x3421('0x40')][_0x3421('0x85')])?_0x25de09[_0x3421('0x40')]['tag']:new Array(_0x25de09[_0x3421('0x40')]['tag']);_0x498be5[_0x3421('0x32')](function(_0x5349d6){_0x4e33a0['or'](_0x3421('0x73'),'%,'+_0x5349d6+',%');});}if(_0x25de09[_0x3421('0x40')][_0x3421('0x86')]){var _0x226e58=_0x25de09[_0x3421('0x40')][_0x3421('0x86')][_0x3421('0x87')]('\x5c','\x5c\x5c')[_0x3421('0x87')](/'/g,'\x27\x27');if(qs[_0x3421('0x88')](_0x226e58)){_0x598dfa['or'](_0x3421('0x89'),_0x226e58+'%')['or'](_0x3421('0x8a'),_0x226e58+'%');}else{_0x598dfa['or'](_0x3421('0x8b'),qs['getFullTextValue'](_0x226e58))['or'](_0x3421('0x8c'),_0x226e58+'%');}}}_0x5a2004[_0x3421('0x4b')](_0x598dfa);_0x5a2004[_0x3421('0x8d')](_0x3421('0x8e'));var _0x190bb5={'type':db[_0x3421('0x8f')][_0x3421('0x90')][_0x3421('0x91')],'raw':!![]};var _0x54b6e6=_0x5a2004[_0x3421('0x92')]();_0x54b6e6['field']('i.id');_0x54b6e6['field'](_0x3421('0x93'),_0x3421('0x64'));if(_0x16dd0b[_0x3421('0x49')]){_0x16dd0b[_0x3421('0x49')]['forEach'](function(_0x3ef962){var _0x3e157c=_0x3ef962[0x0]===_0x3421('0x94')?_0x3ef962[0x0]:'i.'+_0x3ef962[0x0];_0x5a2004[_0x3421('0x49')](_0x3e157c,_0x3ef962[0x1]===_0x3421('0x95')?![]:!![]);});}if(!_[_0x3421('0x79')](_0x498be5)){_0x5a2004[_0x3421('0x66')](_0x4e33a0);_0x54b6e6[_0x3421('0x4b')](_0x3421('0x96'),_0x498be5);}BPromise[_0x3421('0x97')]()[_0x3421('0x2a')](function(){if(!_0x12bd9a){if(_0x25de09[_0x3421('0x40')][_0x3421('0x7a')])return;_0x54b6e6[_0x3421('0x4b')](_0x3421('0x98'));_0x5a2004[_0x3421('0x4b')](_0x3421('0x98'));return;}if(_0x25de09['user']['role']!==_0x3421('0x99'))return;return _0x25de09['user'][_0x3421('0x9a')]({'attributes':['id'],'raw':!![]})[_0x3421('0x2a')](function(_0x5c1c7b){if(_[_0x3421('0x79')](_0x5c1c7b)){_0x54b6e6[_0x3421('0x4b')](_0x3421('0x9b'));_0x5a2004[_0x3421('0x4b')](_0x3421('0x9b'));}else{_0x54b6e6[_0x3421('0x4b')](_0x3421('0x7b'),_[_0x3421('0x2d')](_0x5c1c7b,'id'));_0x5a2004[_0x3421('0x4b')](_0x3421('0x7b'),_[_0x3421('0x2d')](_0x5c1c7b,'id'));}});})[_0x3421('0x2a')](function(){if(_0x25de09[_0x3421('0x9c')]['role']===_0x3421('0x99')&&!_0x12bd9a&&!_0x25de09['query'][_0x3421('0x7a')])return[];return db[_0x3421('0x9d')]['query'](_0x54b6e6[_0x3421('0x9e')](),_0x190bb5);})['then'](function(_0x554b53){_0x5e3a2f[_0x3421('0x24')]=_0x554b53[_0x3421('0x46')];if(_0x5e3a2f[_0x3421('0x24')]===0x0)return[];return db['sequelize'][_0x3421('0x40')](_0x406ea9[_0x3421('0x9e')](),_0x190bb5)[_0x3421('0x2a')](function(_0x53d081){_0x44bf06=_['keyBy'](_0x53d081,'id');_0x190bb5=_[_0x3421('0x9f')](_0x190bb5,{'model':db[_0x3421('0xa0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x25de09[_0x3421('0x40')][_0x3421('0x44')]){_0x16dd0b['attributes'][_0x3421('0x32')](function(_0x1fcd4b){_0x5a2004[_0x3421('0x4e')]('i.'+_0x1fcd4b);});}else{_0x5a2004[_0x3421('0x4e')](_0x3421('0x93'),_0x3421('0x64'));_0x5a2004[_0x3421('0x4e')](_0x3421('0xa1'),'Account.key');_0x5a2004[_0x3421('0x4e')](_0x3421('0xa2'),'Account.mandatoryDisposition');_0x5a2004['field'](_0x3421('0xa3'),_0x3421('0x94'));_0x5a2004[_0x3421('0x4e')](_0x3421('0xa4'));_0x5a2004[_0x3421('0x4e')]('c.firstName','Contact.firstName');_0x5a2004[_0x3421('0x4e')]('c.lastName','Contact.lastName');_0x5a2004[_0x3421('0x4e')](_0x3421('0xa5'),_0x3421('0xa6'));_0x5a2004[_0x3421('0x4e')]('c.phone','Contact.phone');_0x5a2004[_0x3421('0x4e')]('c.mobile','Contact.mobile');_0x5a2004[_0x3421('0x4e')](_0x3421('0xa7'),_0x3421('0xa8'));_0x5a2004['field']('o.fullname','Owner.fullname');_0x5a2004[_0x3421('0x4e')](_0x3421('0xa9'),_0x3421('0xaa'));_0x5a2004[_0x3421('0x4e')](_0x3421('0xab'),_0x3421('0x2f'));}if(_0x16dd0b[_0x3421('0x23')])_0x5a2004['limit'](_0x16dd0b[_0x3421('0x23')]);if(_0x16dd0b[_0x3421('0x21')])_0x5a2004[_0x3421('0x21')](_0x16dd0b[_0x3421('0x21')]);return db[_0x3421('0x9d')][_0x3421('0x40')](_0x5a2004[_0x3421('0x9e')](),_0x190bb5);})[_0x3421('0x2a')](function(_0x276656){if(_0x276656['length']>0x0)_0x60747d['where'](_0x3421('0xac'),_['map'](_0x276656,'id'));return db[_0x3421('0x9d')]['query'](_0x60747d[_0x3421('0x9e')](),_0x190bb5)[_0x3421('0x2a')](function(_0x1decdf){var _0x264345=_[_0x3421('0xad')](_0x1decdf,'WhatsappInteractionId');var _0x560911=[];_0x276656[_0x3421('0x32')](function(_0x214ba4){_0x560911[_0x3421('0xae')](updateWhatsappInteraction(_0x214ba4,_0x44bf06,_0x264345));});return BPromise[_0x3421('0xaf')](_0x560911);});});})['then'](function(_0xa399ed){_0x5e3a2f[_0x3421('0xb0')]=_0xa399ed;return _0x5e3a2f;})[_0x3421('0x2a')](respondWithFilteredResult(_0x4a007d,_0x16dd0b))[_0x3421('0x33')](handleError(_0x4a007d,null));};exports[_0x3421('0xb1')]=function(_0x3274a1,_0x31095c){var _0x4c3058={'raw':![],'where':{'id':_0x3274a1[_0x3421('0xb2')]['id']}},_0x25a05b={};_0x25a05b['model']=_[_0x3421('0x41')](db[_0x3421('0xa0')][_0x3421('0xb3')]);_0x25a05b['query']=_[_0x3421('0x41')](_0x3274a1[_0x3421('0x40')]);_0x25a05b['filters']=_[_0x3421('0x43')](_0x25a05b[_0x3421('0x3f')],_0x25a05b[_0x3421('0x40')]);_0x4c3058[_0x3421('0x45')]=_[_0x3421('0x43')](_0x25a05b[_0x3421('0x3f')],qs[_0x3421('0x44')](_0x3274a1[_0x3421('0x40')]['fields']));_0x4c3058[_0x3421('0x45')]=_0x4c3058['attributes']['length']?_0x4c3058[_0x3421('0x45')]:_0x25a05b[_0x3421('0x3f')];if(_0x3274a1[_0x3421('0x40')][_0x3421('0xb4')]){_0x4c3058['include']=[{'all':!![]}];}_0x4c3058=_[_0x3421('0x9f')]({},_0x4c3058,_0x3274a1[_0x3421('0xb5')]);return db[_0x3421('0xa0')][_0x3421('0x63')](_0x4c3058)[_0x3421('0x2a')](handleEntityNotFound(_0x31095c,null))[_0x3421('0x2a')](respondWithResult(_0x31095c,null))[_0x3421('0x33')](handleError(_0x31095c,null));};exports[_0x3421('0xb6')]=function(_0x18c232,_0x2bc604){return db[_0x3421('0xa0')][_0x3421('0xb6')](_0x18c232[_0x3421('0x77')],{})[_0x3421('0x2a')](respondWithResult(_0x2bc604,0xc9))[_0x3421('0x33')](handleError(_0x2bc604,null));};exports[_0x3421('0x29')]=function(_0x15fff9,_0x34f980){if(_0x15fff9[_0x3421('0x77')]['id']){delete _0x15fff9[_0x3421('0x77')]['id'];}return db[_0x3421('0xa0')]['find']({'where':{'id':_0x15fff9['params']['id']}})[_0x3421('0x2a')](handleEntityNotFound(_0x34f980,null))[_0x3421('0x2a')](saveUpdates(_0x15fff9[_0x3421('0x77')],null))[_0x3421('0x2a')](respondWithResult(_0x34f980,null))['catch'](handleError(_0x34f980,null));};exports[_0x3421('0xb7')]=function(_0x12799a,_0x594404){return db[_0x3421('0xa0')][_0x3421('0x63')]({'where':{'id':_0x12799a[_0x3421('0xb2')]['id']}})['then'](handleEntityNotFound(_0x594404,null))[_0x3421('0x2a')](removeEntity(_0x594404,null))['catch'](handleError(_0x594404,null));};exports[_0x3421('0xb8')]=function(_0x3f6f2c,_0x19a1fb){return db[_0x3421('0xa0')][_0x3421('0xb8')]()[_0x3421('0x2a')](respondWithResult(_0x19a1fb,null))[_0x3421('0x33')](handleError(_0x19a1fb,null));};exports['addMessage']=function(_0x12205c,_0x4e2ff1,_0x5e2b22){return db[_0x3421('0xb9')][_0x3421('0x63')]({'where':{'id':_0x12205c['params']['id']}})[_0x3421('0x2a')](handleEntityNotFound(_0x4e2ff1,null))['then'](function(_0x334657){if(_0x334657){return _0x334657[_0x3421('0xba')](_0x12205c[_0x3421('0x77')][_0x3421('0xbb')],_[_0x3421('0xbc')](_0x12205c[_0x3421('0x77')],[_0x3421('0xbb'),'id'])||{});}})[_0x3421('0x2a')](respondWithResult(_0x4e2ff1,null))[_0x3421('0x33')](handleError(_0x4e2ff1,null));};exports[_0x3421('0xbd')]=function(_0x3b8014,_0x2d7330,_0x5bf9a4){var _0x36868f={'raw':![],'where':{}};var _0x59e80e={};var _0x531bdc={'count':0x0,'rows':[]};return db[_0x3421('0xa0')][_0x3421('0xbe')]({'where':{'id':_0x3b8014[_0x3421('0xb2')]['id']}})[_0x3421('0x2a')](handleEntityNotFound(_0x2d7330,null))['then'](function(_0x1641dc){if(_0x1641dc){_0x59e80e[_0x3421('0x3f')]=_['keys'](db[_0x3421('0xb9')]['rawAttributes']);_0x59e80e[_0x3421('0x40')]=_[_0x3421('0x41')](_0x3b8014[_0x3421('0x40')]);_0x59e80e['filters']=_[_0x3421('0x43')](_0x59e80e[_0x3421('0x3f')],_0x59e80e[_0x3421('0x40')]);_0x36868f[_0x3421('0x45')]=_[_0x3421('0x43')](_0x59e80e[_0x3421('0x3f')],qs[_0x3421('0x44')](_0x3b8014[_0x3421('0x40')]['fields']));_0x36868f[_0x3421('0x45')]=_0x36868f[_0x3421('0x45')][_0x3421('0x46')]?_0x36868f[_0x3421('0x45')]:_0x59e80e[_0x3421('0x3f')];if(!_0x3b8014[_0x3421('0x40')][_0x3421('0x47')]('nolimit')){_0x36868f[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x3b8014['query']['limit']);_0x36868f['offset']=qs[_0x3421('0x21')](_0x3b8014[_0x3421('0x40')]['offset']);}_0x36868f[_0x3421('0x49')]=qs[_0x3421('0x4a')](_0x3b8014[_0x3421('0x40')][_0x3421('0x4a')]);_0x36868f[_0x3421('0x4b')]=qs[_0x3421('0x42')](_[_0x3421('0x4c')](_0x3b8014['query'],_0x59e80e[_0x3421('0x42')]));_0x36868f[_0x3421('0x4b')][_0x3421('0xbf')]=_0x1641dc['id'];if(_0x3b8014[_0x3421('0x40')][_0x3421('0x86')]){_0x36868f[_0x3421('0x4b')]=_['merge'](_0x36868f[_0x3421('0x4b')],{'$or':_[_0x3421('0x2d')](_0x36868f['attributes'],function(_0x315dc0){var _0x425f96={};_0x425f96[_0x315dc0]={'$like':'%'+_0x3b8014[_0x3421('0x40')][_0x3421('0x86')]+'%'};return _0x425f96;})});}if(_0x3b8014[_0x3421('0x40')][_0x3421('0xc0')]){var _0x39e922=_0x3b8014[_0x3421('0x40')][_0x3421('0xc0')][_0x3421('0x31')](',');var _0x5939eb={};_0x5939eb[_0x39e922[0x0]]={'$gte':moment(_0x39e922[0x1])[_0x3421('0xc1')](_0x3421('0xc2'))};_0x36868f['where']=_[_0x3421('0x9f')](_0x36868f['where'],_0x5939eb);}_0x36868f=_[_0x3421('0x9f')]({},_0x36868f,_0x3b8014['options']);return db['WhatsappMessage'][_0x3421('0x24')]({'where':_0x36868f[_0x3421('0x4b')]})[_0x3421('0x2a')](function(_0x5afa76){_0x531bdc[_0x3421('0x24')]=_0x5afa76;if(_0x3b8014[_0x3421('0x40')][_0x3421('0xb4')]){_0x36868f['include']=[{'all':!![]}];}return db[_0x3421('0xb9')][_0x3421('0xc3')](_0x36868f);})['then'](function(_0x51abd2){_0x531bdc[_0x3421('0xb0')]=_0x51abd2;return _0x531bdc;});}})[_0x3421('0x2a')](respondWithFilteredResult(_0x2d7330,_0x36868f))[_0x3421('0x33')](handleError(_0x2d7330,null));};exports[_0x3421('0xc4')]=function(_0x2e9b66,_0x1147a7,_0x4d52f5){return db['WhatsappInteraction']['find']({'where':{'id':_0x2e9b66[_0x3421('0xb2')]['id']}})[_0x3421('0x2a')](handleEntityNotFound(_0x1147a7,null))[_0x3421('0x2a')](function(_0x2c8298){if(_0x2c8298){return _0x2c8298[_0x3421('0xc5')](_0x2e9b66['body'][_0x3421('0xbb')],_[_0x3421('0xbc')](_0x2e9b66[_0x3421('0x77')],[_0x3421('0xbb'),'id'])||{})[_0x3421('0xc6')](function(){return db['Tag'][_0x3421('0xc3')]({'attributes':['id','name',_0x3421('0xc7')],'where':{'id':_0x2e9b66['body'][_0x3421('0xbb')]}});})[_0x3421('0x2a')](function(_0x27afa2){socket[_0x3421('0xc8')](_0x3421('0xc9'),{'id':Number(_0x2e9b66[_0x3421('0xb2')]['id']),'tags':_0x27afa2||[]});return{'id':Number(_0x2e9b66[_0x3421('0xb2')]['id']),'tags':_0x27afa2||[]};});}})[_0x3421('0x2a')](respondWithResult(_0x1147a7,null))['catch'](handleError(_0x1147a7,null));};exports[_0x3421('0xca')]=function(_0x4a4ffb,_0x39e690,_0x31ec58){return db[_0x3421('0xa0')][_0x3421('0x63')]({'where':{'id':_0x4a4ffb[_0x3421('0xb2')]['id']}})['then'](handleEntityNotFound(_0x39e690,null))[_0x3421('0x2a')](function(_0x1540ba){if(_0x1540ba){return _0x1540ba['removeTags'](_0x4a4ffb['query'][_0x3421('0xbb')]);}})[_0x3421('0x2a')](respondWithStatusCode(_0x39e690,null))['catch'](handleError(_0x39e690,null));};exports['download']=function(_0x18b105,_0x4a2455){var _0x444c81=moment()[_0x3421('0xcb')]()['toString']();var _0x4d62fe=path[_0x3421('0xcc')](config[_0x3421('0xcd')],_0x3421('0xce'),_0x3421('0xcf'),_0x3421('0xd0'));var _0xf81bb2=path[_0x3421('0xcc')](config[_0x3421('0xcd')],'server',_0x3421('0xcf'),'attachments');var _0x252dc0=path[_0x3421('0xcc')](_0x4d62fe,_0x444c81);var _0x33aaaa=util[_0x3421('0xc1')](_0x3421('0xd1'),_0x18b105[_0x3421('0xb2')]['id'],_0x444c81);var _0x858e81=path[_0x3421('0xcc')](_0x4d62fe,_0x33aaaa);var _0x295ceb=[];_0x295ceb[_0x3421('0xae')]({'model':db[_0x3421('0x75')],'as':_0x3421('0x75'),'attributes':['id',_0x3421('0x2e')],'raw':!![]});_0x295ceb[_0x3421('0xae')]({'model':db['CmContact'],'as':_0x3421('0x69'),'attributes':['id','firstName',_0x3421('0xd2')],'raw':!![]});if(_0x18b105['query']['attachments']){_0x295ceb[_0x3421('0xae')]({'model':db[_0x3421('0xd3')],'as':_0x3421('0xd3'),'raw':!![]});}var _0x59fcde=[{'model':db[_0x3421('0xb9')],'as':_0x3421('0xd4'),'attributes':['id',_0x3421('0x77'),_0x3421('0x7c'),_0x3421('0xd5'),_0x3421('0xd6'),_0x3421('0x82')],'include':_0x295ceb}];_0x59fcde['push']({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x3421('0x2b')]});_0x59fcde[_0x3421('0xae')]({'model':db[_0x3421('0x75')],'as':_0x3421('0xd7'),'attributes':['id',_0x3421('0x2e')]});return db[_0x3421('0xa0')][_0x3421('0x63')]({'where':{'id':_0x18b105[_0x3421('0xb2')]['id']},'include':_0x59fcde})[_0x3421('0x2a')](handleEntityNotFound(_0x4a2455,null))[_0x3421('0x2a')](function(_0x31ff99){if(_0x31ff99){var _0x1cc1ee=_0x31ff99['get']({'plain':!![]});fs['mkdirSync'](_0x252dc0);var _0x188ccb={'channel':'Whatsapp','account':_0x1cc1ee[_0x3421('0xd8')][_0x3421('0x2b')],'agent':_0x1cc1ee['Owner']?_0x1cc1ee[_0x3421('0xd7')]['fullname']:'N.A.','createdAt':moment(_0x1cc1ee[_0x3421('0x7c')])[_0x3421('0xc1')](_0x3421('0xc2'))[_0x3421('0x9e')](),'closedAt':_0x1cc1ee[_0x3421('0x39')]?moment(_0x1cc1ee[_0x3421('0xd9')])[_0x3421('0xc1')](_0x3421('0xc2'))[_0x3421('0x9e')]():'','disposition':_0x1cc1ee[_0x3421('0xda')],'messages':_(_0x1cc1ee[_0x3421('0xd4')])[_0x3421('0x86')]({'secret':![]})[_0x3421('0x2d')](function(_0x4a11f9){if(_0x4a11f9[_0x3421('0xd3')]){var _0x4ee6bf=path[_0x3421('0xcc')](_0xf81bb2,_0x4a11f9[_0x3421('0xd3')][_0x3421('0xdb')]);if(fs[_0x3421('0xdc')](_0x4ee6bf)){fs[_0x3421('0xdd')](_0x4ee6bf)[_0x3421('0xde')](fs[_0x3421('0xdf')](path['join'](_0x252dc0,_0x4a11f9['Attachment'][_0x3421('0xdb')])));}}return{'date':moment(_0x4a11f9[_0x3421('0x7c')])[_0x3421('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3421('0x9e')](),'sender':_0x4a11f9[_0x3421('0xd5')]==='out'?_0x4a11f9[_0x3421('0x75')]?_0x4a11f9[_0x3421('0x75')][_0x3421('0x2e')]:'System':_0x4a11f9[_0x3421('0x69')][_0x3421('0xe0')]+(_0x4a11f9[_0x3421('0x69')]['lastName']?'\x20'+_0x4a11f9[_0x3421('0x69')][_0x3421('0xd2')]:''),'body':_0x4a11f9[_0x3421('0xd3')]?_0x4a11f9['Attachment'][_0x3421('0xdb')]:_0x4a11f9['body'],'direction':_0x4a11f9[_0x3421('0xd5')]===_0x3421('0xe1')?'A':'C','secret':_0x4a11f9[_0x3421('0xd6')],'read':_0x4a11f9[_0x3421('0x82')],'attachment':_0x4a11f9['Attachment']};})[_0x3421('0x65')]()};return ejs[_0x3421('0xe2')](path['join'](config[_0x3421('0xcd')],'server',_0x3421('0xe3'),_0x3421('0xe4')),{'interaction':_0x188ccb})[_0x3421('0x2a')](function(_0x4407af){var _0x1a971e=path['join'](_0x252dc0,_0x3421('0xe5')+_0x1cc1ee['id']+'-'+_0x444c81+_0x3421('0xe6'));var _0x216657={'path':_0x1a971e,'channel':_0x3421('0xe7'),'interactionId':_0x1cc1ee['id']};return pdf[_0x3421('0xe8')](_0x4407af,_0x216657);})[_0x3421('0x2a')](function(){return new BPromise(function(_0x3afced,_0x20d6d3){zipdir(_0x252dc0,{'saveTo':_0x858e81},function(_0x48a0de,_0x1cf30a){if(_0x48a0de)return _0x20d6d3(_0x48a0de);return _0x3afced(_0x1cf30a);});})[_0x3421('0x2a')](function(){return new BPromise(function(_0x1a5ed4,_0xac9646){rimraf(_0x252dc0,function(_0x33bca8){if(_0x33bca8)_0xac9646(_0x33bca8);return _0x1a5ed4();});});})[_0x3421('0x2a')](function(){return _0x4a2455[_0x3421('0xe9')](_0x858e81,_0x33aaaa,function(_0x4cdc07){if(_0x4cdc07){console[_0x3421('0xea')](_0x3421('0xeb'),_0x4cdc07);}else{fs[_0x3421('0xec')](_0x858e81);}});});});}else{return _0x4a2455[_0x3421('0x1e')](0xc8);}})['catch'](handleError(_0x4a2455,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index ba569d8..e32b96a 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 _0x7cda=['then','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','WhatsappInteraction','setMaxListeners','save','remove','getUsers','setDataValue','map','findAll'];(function(_0x334bd6,_0x502f0d){var _0x55f8b0=function(_0x24c72a){while(--_0x24c72a){_0x334bd6['push'](_0x334bd6['shift']());}};_0x55f8b0(++_0x502f0d);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xa7cd('0x0'))['db'][_0xa7cd('0x1')];var WhatsappMessage=require(_0xa7cd('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa7cd('0x2')](0x0);var events={'afterCreate':_0xa7cd('0x3'),'afterUpdate':'update','afterDestroy':_0xa7cd('0x4')};function emitEvent(_0xdb8470){return function(_0x5560e0,_0x37990d,_0x5f20a2){_0x5560e0[_0xa7cd('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x596ad6){_0x5560e0[_0xa7cd('0x6')]('Users',_0x596ad6[_0xa7cd('0x7')](function(_0x205075){return{'id':_0x205075['id']};}));return WhatsappMessage[_0xa7cd('0x8')]({'where':{'WhatsappInteractionId':_0x5560e0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa7cd('0x9')](function(_0x31879f){_0x5560e0[_0xa7cd('0x6')](_0xa7cd('0xa'),_0x31879f[_0xa7cd('0xb')]);WhatsappInteractionEvents[_0xa7cd('0xc')](_0xdb8470+':'+_0x5560e0['id'],_0x5560e0);WhatsappInteractionEvents['emit'](_0xdb8470,_0x5560e0);_0x5f20a2(null);})['catch'](_0x5f20a2(null));};}for(var e in events){if(events[_0xa7cd('0xd')](e)){var event=events[e];WhatsappInteraction[_0xa7cd('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xde13=['emit','catch','hasOwnProperty','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xde13,0x146));var _0x3de1=function(_0x25437b,_0x15942e){_0x25437b=_0x25437b-0x0;var _0x14d93c=_0xde13[_0x25437b];return _0x14d93c;};'use strict';var EventEmitter=require(_0x3de1('0x0'));var WhatsappInteraction=require(_0x3de1('0x1'))['db'][_0x3de1('0x2')];var WhatsappMessage=require(_0x3de1('0x1'))['db'][_0x3de1('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3de1('0x4'),'afterUpdate':_0x3de1('0x5'),'afterDestroy':_0x3de1('0x6')};function emitEvent(_0x4b5b09){return function(_0x32386c,_0x5f04fe,_0xa7fd83){_0x32386c[_0x3de1('0x7')]({'attributes':['id'],'raw':!![]})[_0x3de1('0x8')](function(_0x34291a){_0x32386c['setDataValue'](_0x3de1('0x9'),_0x34291a[_0x3de1('0xa')](function(_0x441539){return{'id':_0x441539['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x32386c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4a4848){_0x32386c[_0x3de1('0xb')](_0x3de1('0xc'),_0x4a4848[_0x3de1('0xd')]);WhatsappInteractionEvents['emit'](_0x4b5b09+':'+_0x32386c['id'],_0x32386c);WhatsappInteractionEvents[_0x3de1('0xe')](_0x4b5b09,_0x32386c);_0xa7fd83(null);})[_0x3de1('0xf')](_0xa7fd83(null));};}for(var e in events){if(events[_0x3de1('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](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 5989907..f4de9ce 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 _0xa6c4=['../../config/environment','./whatsappInteraction.attributes','whatsapp_interactions','changed','closed','format','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53c52d,_0x207d70){var _0x4e6598=function(_0x46000e){while(--_0x46000e){_0x53c52d['push'](_0x53c52d['shift']());}};_0x4e6598(++_0x207d70);}(_0xa6c4,0x1da));var _0x4a6c=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0xa6c4[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0x4a6c('0x0'));var util=require('util');var logger=require(_0x4a6c('0x1'))(_0x4a6c('0x2'));var moment=require(_0x4a6c('0x3'));var BPromise=require(_0x4a6c('0x4'));var rp=require(_0x4a6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a6c('0x6'));var attributes=require(_0x4a6c('0x7'));module['exports']=function(_0x20c607,_0x520426){return _0x20c607['define']('WhatsappInteraction',attributes,{'tableName':_0x4a6c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2915b9,_0x5c07fc,_0x32c5a2){if(_0x2915b9[_0x4a6c('0x9')](_0x4a6c('0xa'))){_0x2915b9['closedAt']=moment()[_0x4a6c('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x32c5a2(null,_0x2915b9);}}});}; \ No newline at end of file +var _0x4689=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','path','rimraf','exports','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0xd6ab42,_0x4a76f8){var _0x445960=function(_0x16ca59){while(--_0x16ca59){_0xd6ab42['push'](_0xd6ab42['shift']());}};_0x445960(++_0x4a76f8);}(_0x4689,0xf2));var _0x9468=function(_0x43c365,_0x145fc3){_0x43c365=_0x43c365-0x0;var _0x3bb66f=_0x4689[_0x43c365];return _0x3bb66f;};'use strict';var _=require('lodash');var util=require(_0x9468('0x0'));var logger=require(_0x9468('0x1'))(_0x9468('0x2'));var moment=require('moment');var BPromise=require(_0x9468('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9468('0x4'));var rimraf=require(_0x9468('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x9468('0x6')]=function(_0x293c65,_0x1141c3){return _0x293c65['define'](_0x9468('0x7'),attributes,{'tableName':_0x9468('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3be103,_0x16ff0b,_0x325565){if(_0x3be103[_0x9468('0x9')](_0x9468('0xa'))){_0x3be103[_0x9468('0xb')]=moment()[_0x9468('0xc')](_0x9468('0xd'));}_0x325565(null,_0x3be103);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 864072a..6814bde 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 _0x19d9=['then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x208798,_0x1dfbd4){var _0x2e76c8=function(_0x4844a0){while(--_0x4844a0){_0x208798['push'](_0x208798['shift']());}};_0x2e76c8(++_0x1dfbd4);}(_0x19d9,0x1be));var _0x919d=function(_0x2ae509,_0x57f95c){_0x2ae509=_0x2ae509-0x0;var _0x56f03a=_0x19d9[_0x2ae509];return _0x56f03a;};'use strict';var _=require(_0x919d('0x0'));var util=require(_0x919d('0x1'));var moment=require(_0x919d('0x2'));var BPromise=require('bluebird');var rs=require(_0x919d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x919d('0x4'))['db'];var utils=require(_0x919d('0x5'));var logger=require(_0x919d('0x6'))('rpc');var config=require(_0x919d('0x7'));var jayson=require(_0x919d('0x8'));var client=jayson[_0x919d('0x9')][_0x919d('0xa')]({'port':0x232a});config[_0x919d('0xb')]=_[_0x919d('0xc')](config[_0x919d('0xb')],{'host':_0x919d('0xd'),'port':0x18eb});var socket=require(_0x919d('0xe'))(new Redis(config[_0x919d('0xb')]));require('./whatsappInteraction.socket')[_0x919d('0xf')](socket);function respondWithRpcPromise(_0xeda03e,_0xd83e3b,_0xdc1c6e){return new BPromise(function(_0x17709a,_0x3ff9dd){return client['request'](_0xeda03e,_0xdc1c6e)[_0x919d('0x10')](function(_0x8e0051){logger[_0x919d('0x11')](_0x919d('0x12'),_0xd83e3b,'request\x20sent');logger[_0x919d('0x13')](_0x919d('0x14'),_0xd83e3b,'request\x20sent',JSON['stringify'](_0x8e0051));if(_0x8e0051[_0x919d('0x15')]){if(_0x8e0051[_0x919d('0x15')][_0x919d('0x16')]===0x1f4){logger[_0x919d('0x15')](_0x919d('0x12'),_0xd83e3b,_0x8e0051[_0x919d('0x15')][_0x919d('0x17')]);return _0x3ff9dd(_0x8e0051[_0x919d('0x15')][_0x919d('0x17')]);}logger['error'](_0x919d('0x12'),_0xd83e3b,_0x8e0051['error'][_0x919d('0x17')]);return _0x17709a(_0x8e0051[_0x919d('0x15')][_0x919d('0x17')]);}else{logger['info'](_0x919d('0x12'),_0xd83e3b,_0x919d('0x18'));_0x17709a(_0x8e0051[_0x919d('0x19')][_0x919d('0x17')]);}})[_0x919d('0x1a')](function(_0x7ae1c7){logger['error'](_0x919d('0x12'),_0xd83e3b,_0x7ae1c7);_0x3ff9dd(_0x7ae1c7);});});}exports[_0x919d('0x1b')]=function(_0x3b574b){var _0x2f3f1f=this;return new Promise(function(_0xa6f916,_0x1b84f6){return db[_0x919d('0x1c')][_0x919d('0x1d')](_0x3b574b[_0x919d('0x1e')],{'raw':_0x3b574b[_0x919d('0x1f')]?_0x3b574b[_0x919d('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b574b[_0x919d('0x1f')]?_0x3b574b['options'][_0x919d('0x20')]||null:null,'attributes':_0x3b574b[_0x919d('0x1f')]?_0x3b574b['options'][_0x919d('0x21')]||null:null,'limit':_0x3b574b[_0x919d('0x1f')]?_0x3b574b[_0x919d('0x1f')][_0x919d('0x22')]||null:null})[_0x919d('0x10')](function(_0x17dedd){logger[_0x919d('0x11')](_0x919d('0x1b'),_0x3b574b);logger[_0x919d('0x13')](_0x919d('0x1b'),_0x3b574b,JSON['stringify'](_0x17dedd));_0xa6f916(_0x17dedd);})[_0x919d('0x1a')](function(_0x553973){logger[_0x919d('0x15')]('UpdateWhatsappInteraction',_0x553973[_0x919d('0x17')],_0x3b574b);_0x1b84f6(_0x2f3f1f['error'](0x1f4,_0x553973[_0x919d('0x17')]));});});};exports[_0x919d('0x23')]=function(_0x43c16b){return new Promise(function(_0x4f98f1,_0x42b825){return db[_0x919d('0x1c')][_0x919d('0x24')]({'where':_0x43c16b[_0x919d('0x1f')]?_0x43c16b[_0x919d('0x1f')][_0x919d('0x20')]||null:null})[_0x919d('0x10')](function(_0x408668){if(_0x408668){return _0x408668[_0x919d('0x25')](_0x43c16b[_0x919d('0x1e')][_0x919d('0x26')],_['omit'](_0x43c16b[_0x919d('0x1e')],[_0x919d('0x26'),'id'])||{});}})[_0x919d('0x27')](function(_0x2895d5){logger[_0x919d('0x11')](_0x919d('0x28'),_0x43c16b);logger[_0x919d('0x13')](_0x919d('0x28'),_0x43c16b,JSON[_0x919d('0x29')](_0x2895d5));_0x4f98f1(_0x2895d5);})['catch'](function(_0x3f5d2b){logger[_0x919d('0x15')]('AddTags',_0x3f5d2b[_0x919d('0x17')],_0x43c16b);_0x42b825(_this[_0x919d('0x15')](0x1f4,_0x3f5d2b[_0x919d('0x17')]));});});}; \ No newline at end of file +var _0x9011=['redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','attributes','limit','find','where','addTags','body','ids','spread','AddTags','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4da9cc,_0x1328d9){var _0x54cc22=function(_0x4537a4){while(--_0x4537a4){_0x4da9cc['push'](_0x4da9cc['shift']());}};_0x54cc22(++_0x1328d9);}(_0x9011,0x166));var _0x1901=function(_0x4c557f,_0x5e3986){_0x4c557f=_0x4c557f-0x0;var _0x4a894c=_0x9011[_0x4c557f];return _0x4a894c;};'use strict';var _=require('lodash');var util=require(_0x1901('0x0'));var moment=require(_0x1901('0x1'));var BPromise=require(_0x1901('0x2'));var rs=require(_0x1901('0x3'));var fs=require('fs');var Redis=require(_0x1901('0x4'));var db=require(_0x1901('0x5'))['db'];var utils=require(_0x1901('0x6'));var logger=require(_0x1901('0x7'))(_0x1901('0x8'));var config=require(_0x1901('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1901('0xa')]['http']({'port':0x232a});config[_0x1901('0xb')]=_[_0x1901('0xc')](config[_0x1901('0xb')],{'host':_0x1901('0xd'),'port':0x18eb});var socket=require(_0x1901('0xe'))(new Redis(config[_0x1901('0xb')]));require(_0x1901('0xf'))['register'](socket);function respondWithRpcPromise(_0x3841b0,_0x46ce2c,_0xba6de4){return new BPromise(function(_0x2c48ec,_0x3ac97a){return client[_0x1901('0x10')](_0x3841b0,_0xba6de4)[_0x1901('0x11')](function(_0x50cea4){logger['info'](_0x1901('0x12'),_0x46ce2c,_0x1901('0x13'));logger[_0x1901('0x14')](_0x1901('0x15'),_0x46ce2c,'request\x20sent',JSON['stringify'](_0x50cea4));if(_0x50cea4[_0x1901('0x16')]){if(_0x50cea4[_0x1901('0x16')][_0x1901('0x17')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x46ce2c,_0x50cea4['error']['message']);return _0x3ac97a(_0x50cea4[_0x1901('0x16')][_0x1901('0x18')]);}logger[_0x1901('0x16')](_0x1901('0x12'),_0x46ce2c,_0x50cea4[_0x1901('0x16')][_0x1901('0x18')]);return _0x2c48ec(_0x50cea4['error'][_0x1901('0x18')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x46ce2c,_0x1901('0x13'));_0x2c48ec(_0x50cea4[_0x1901('0x19')][_0x1901('0x18')]);}})[_0x1901('0x1a')](function(_0x57fdf8){logger[_0x1901('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x46ce2c,_0x57fdf8);_0x3ac97a(_0x57fdf8);});});}exports[_0x1901('0x1b')]=function(_0x3a1e10){var _0x48828a=this;return new Promise(function(_0x318477,_0x79a8e1){return db[_0x1901('0x1c')]['update'](_0x3a1e10['body'],{'raw':_0x3a1e10[_0x1901('0x1d')]?_0x3a1e10['options'][_0x1901('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a1e10[_0x1901('0x1d')]?_0x3a1e10[_0x1901('0x1d')]['where']||null:null,'attributes':_0x3a1e10[_0x1901('0x1d')]?_0x3a1e10[_0x1901('0x1d')][_0x1901('0x1f')]||null:null,'limit':_0x3a1e10[_0x1901('0x1d')]?_0x3a1e10[_0x1901('0x1d')][_0x1901('0x20')]||null:null})[_0x1901('0x11')](function(_0x36b435){logger['info'](_0x1901('0x1b'),_0x3a1e10);logger['debug'](_0x1901('0x1b'),_0x3a1e10,JSON['stringify'](_0x36b435));_0x318477(_0x36b435);})[_0x1901('0x1a')](function(_0x209eae){logger[_0x1901('0x16')](_0x1901('0x1b'),_0x209eae[_0x1901('0x18')],_0x3a1e10);_0x79a8e1(_0x48828a[_0x1901('0x16')](0x1f4,_0x209eae[_0x1901('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x238543){return new Promise(function(_0x8b51a7,_0x5a30c2){return db['WhatsappInteraction'][_0x1901('0x21')]({'where':_0x238543[_0x1901('0x1d')]?_0x238543[_0x1901('0x1d')][_0x1901('0x22')]||null:null})[_0x1901('0x11')](function(_0x14c86f){if(_0x14c86f){return _0x14c86f[_0x1901('0x23')](_0x238543[_0x1901('0x24')][_0x1901('0x25')],_['omit'](_0x238543['body'],[_0x1901('0x25'),'id'])||{});}})[_0x1901('0x26')](function(_0xe9ff5f){logger['info'](_0x1901('0x27'),_0x238543);logger[_0x1901('0x14')](_0x1901('0x27'),_0x238543,JSON[_0x1901('0x28')](_0xe9ff5f));_0x8b51a7(_0xe9ff5f);})['catch'](function(_0x463848){logger[_0x1901('0x16')](_0x1901('0x27'),_0x463848[_0x1901('0x18')],_0x238543);_0x5a30c2(_this[_0x1901('0x16')](0x1f4,_0x463848['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index e1ca6e5..547dc37 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 _0xb6d2=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xb6d2,0x1b4));var _0x2b6d=function(_0x5eec17,_0x148c9a){_0x5eec17=_0x5eec17-0x0;var _0x3de1ff=_0xb6d2[_0x5eec17];return _0x3de1ff;};'use strict';var WhatsappInteractionEvents=require(_0x2b6d('0x0'));var events=[_0x2b6d('0x1'),_0x2b6d('0x2'),_0x2b6d('0x3')];function createListener(_0x3cf435,_0x5e6b3f){return function(_0x3840a0){_0x5e6b3f[_0x2b6d('0x4')](_0x3cf435,_0x3840a0);};}function removeListener(_0x2db4c2,_0x7e760f){return function(){WhatsappInteractionEvents[_0x2b6d('0x5')](_0x2db4c2,_0x7e760f);};}exports['register']=function(_0x2f2b27){for(var _0x21bbc9=0x0,_0x3fc9c3=events[_0x2b6d('0x6')];_0x21bbc9<_0x3fc9c3;_0x21bbc9++){var _0xc06f21=events[_0x21bbc9];var _0x144cc7=createListener(_0x2b6d('0x7')+_0xc06f21,_0x2f2b27);WhatsappInteractionEvents['on'](_0xc06f21,_0x144cc7);}}; \ No newline at end of file +var _0xdc38=['save','remove','update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x322d5f,_0x348a9d){var _0x4fec46=function(_0x2e9064){while(--_0x2e9064){_0x322d5f['push'](_0x322d5f['shift']());}};_0x4fec46(++_0x348a9d);}(_0xdc38,0x1a7));var _0x8dc3=function(_0x10e940,_0x591784){_0x10e940=_0x10e940-0x0;var _0x1e0b0b=_0xdc38[_0x10e940];return _0x1e0b0b;};'use strict';var WhatsappInteractionEvents=require(_0x8dc3('0x0'));var events=[_0x8dc3('0x1'),_0x8dc3('0x2'),_0x8dc3('0x3')];function createListener(_0x5cd579,_0x423ea7){return function(_0x1e7bc2){_0x423ea7[_0x8dc3('0x4')](_0x5cd579,_0x1e7bc2);};}function removeListener(_0x5d903f,_0x1a2a1d){return function(){WhatsappInteractionEvents['removeListener'](_0x5d903f,_0x1a2a1d);};}exports[_0x8dc3('0x5')]=function(_0x5d73bc){for(var _0x5ebb35=0x0,_0x1bac44=events[_0x8dc3('0x6')];_0x5ebb35<_0x1bac44;_0x5ebb35++){var _0xf5e598=events[_0x5ebb35];var _0x359c9b=createListener(_0x8dc3('0x7')+_0xf5e598,_0x5d73bc);WhatsappInteractionEvents['on'](_0xf5e598,_0x359c9b);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f1ab1a9..7366650 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 _0xe82c=['/:id/reject','reject','delete','exports','util','path','express','Router','fs-extra','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','accept'];(function(_0x860316,_0x110f13){var _0x51d54e=function(_0x162a97){while(--_0x162a97){_0x860316['push'](_0x860316['shift']());}};_0x51d54e(++_0x110f13);}(_0xe82c,0xee));var _0xce82=function(_0x4fb28c,_0x1066cb){_0x4fb28c=_0x4fb28c-0x0;var _0x3f30a9=_0xe82c[_0x4fb28c];return _0x3f30a9;};'use strict';var multer=require('multer');var util=require(_0xce82('0x0'));var path=require(_0xce82('0x1'));var timeout=require('connect-timeout');var express=require(_0xce82('0x2'));var router=express[_0xce82('0x3')]();var fs_extra=require(_0xce82('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xce82('0x5'));var controller=require('./whatsappMessage.controller');router[_0xce82('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce82('0x6')](_0xce82('0x7'),auth[_0xce82('0x8')](),controller[_0xce82('0x9')]);router[_0xce82('0x6')](_0xce82('0xa'),auth[_0xce82('0x8')](),controller[_0xce82('0xb')]);router[_0xce82('0xc')]('/',auth[_0xce82('0x8')](),interaction[_0xce82('0xd')](_0xce82('0xe'),_0xce82('0xf')),controller[_0xce82('0x10')]);router[_0xce82('0xc')](_0xce82('0x11'),controller['status']);router[_0xce82('0x12')]('/:id',auth[_0xce82('0x8')](),controller[_0xce82('0x13')]);router['put'](_0xce82('0x14'),auth[_0xce82('0x8')](),controller[_0xce82('0x15')]);router['put'](_0xce82('0x16'),auth['isAuthenticated'](),controller[_0xce82('0x17')]);router[_0xce82('0x18')](_0xce82('0xa'),auth[_0xce82('0x8')](),controller['destroy']);module[_0xce82('0x19')]=router; \ No newline at end of file +var _0x2786=['fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','create','/:id/status','put','/:id/accept','accept','reject','delete','destroy','multer','util','express','Router'];(function(_0x11a74c,_0x462455){var _0xf99b1a=function(_0x4b1c66){while(--_0x4b1c66){_0x11a74c['push'](_0x11a74c['shift']());}};_0xf99b1a(++_0x462455);}(_0x2786,0xec));var _0x6278=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2786[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x6278('0x0'));var util=require(_0x6278('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6278('0x2'));var router=express[_0x6278('0x3')]();var fs_extra=require(_0x6278('0x4'));var auth=require(_0x6278('0x5'));var interaction=require(_0x6278('0x6'));var config=require('../../config/environment');var controller=require(_0x6278('0x7'));router[_0x6278('0x8')]('/',auth[_0x6278('0x9')](),controller[_0x6278('0xa')]);router[_0x6278('0x8')](_0x6278('0xb'),auth[_0x6278('0x9')](),controller[_0x6278('0xc')]);router[_0x6278('0x8')](_0x6278('0xd'),auth[_0x6278('0x9')](),controller['show']);router[_0x6278('0xe')]('/',auth[_0x6278('0x9')](),interaction[_0x6278('0xf')]('whatsapp','whatsappmessage:create'),controller[_0x6278('0x10')]);router[_0x6278('0xe')](_0x6278('0x11'),controller['status']);router['put']('/:id',auth[_0x6278('0x9')](),controller['update']);router[_0x6278('0x12')](_0x6278('0x13'),auth['isAuthenticated'](),controller[_0x6278('0x14')]);router[_0x6278('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x6278('0x15')]);router[_0x6278('0x16')](_0x6278('0xd'),auth[_0x6278('0x9')](),controller[_0x6278('0x17')]);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 9901d82..99da254 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 _0xf582=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','medium'];(function(_0x23644,_0x48c952){var _0xd295e1=function(_0x4b2e29){while(--_0x4b2e29){_0x23644['push'](_0x23644['shift']());}};_0xd295e1(++_0x48c952);}(_0xf582,0x1c5));var _0x2f58=function(_0x33f5c8,_0x5202bb){_0x33f5c8=_0x33f5c8-0x0;var _0x4ea43f=_0xf582[_0x33f5c8];return _0x4ea43f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2f58('0x0')](_0x2f58('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x2f58('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f58('0x3')]('in','out'),'defaultValue':_0x2f58('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2f58('0x5')]},'readAt':{'type':Sequelize[_0x2f58('0x6')]},'secret':{'type':Sequelize[_0x2f58('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2f58('0x5')]},'providerResponse':{'type':Sequelize[_0x2f58('0x0')]}}; \ No newline at end of file +var _0xa0c9=['BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize','exports','medium'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0xa0c9,0xf0));var _0x9a0c=function(_0x59f836,_0x5ef66a){_0x59f836=_0x59f836-0x0;var _0x520541=_0xa0c9[_0x59f836];return _0x520541;};'use strict';var Sequelize=require(_0x9a0c('0x0'));module[_0x9a0c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9a0c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9a0c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a0c('0x4')]('in',_0x9a0c('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x9a0c('0x6')]},'secret':{'type':Sequelize[_0x9a0c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9a0c('0x7')]},'providerResponse':{'type':Sequelize[_0x9a0c('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index eb5a624..3c7c8dd 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 _0x234b=['email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','http','client','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','find','create','update','body','params','destroy','describe','../../config/logger','whatsapp-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','sequelize','Sequelize','contact','User','fullname'];(function(_0x3fd750,_0x120661){var _0x4f15d9=function(_0x3181b8){while(--_0x3181b8){_0x3fd750['push'](_0x3fd750['shift']());}};_0x4f15d9(++_0x120661);}(_0x234b,0xa3));var _0xb234=function(_0xfe6c93,_0x4b26eb){_0xfe6c93=_0xfe6c93-0x0;var _0x2aba7d=_0x234b[_0xfe6c93];return _0x2aba7d;};'use strict';var emlformat=require(_0xb234('0x0'));var rimraf=require(_0xb234('0x1'));var zipdir=require(_0xb234('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb234('0x3'));var BPromise=require(_0xb234('0x4'));var Mustache=require(_0xb234('0x5'));var util=require(_0xb234('0x6'));var path=require('path');var sox=require(_0xb234('0x7'));var csv=require(_0xb234('0x8'));var ejs=require(_0xb234('0x9'));var fs=require('fs');var fs_extra=require(_0xb234('0xa'));var _=require(_0xb234('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb234('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb234('0xd'));var Papa=require(_0xb234('0xe'));var Redis=require(_0xb234('0xf'));var authService=require(_0xb234('0x10'));var qs=require(_0xb234('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb234('0x12'));var config=require(_0xb234('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb234('0x14')]=_[_0xb234('0x15')](config[_0xb234('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xb234('0x16'))(new Redis(config[_0xb234('0x14')]));require(_0xb234('0x17'))[_0xb234('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb234('0x19')]({'port':0x232c});var client9002=jayson[_0xb234('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x355878,_0x36a550,_0x450e89,_0x2e1ba1){return new BPromise(function(_0x41f8dc,_0x22519b){var _0x23f7d5=_0x2e1ba1||client;return _0x23f7d5[_0xb234('0x1b')](_0x355878,_0x450e89)[_0xb234('0x1c')](function(_0x3b9bb1){logger[_0xb234('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0x36a550,'request\x20sent');logger[_0xb234('0x1e')](_0xb234('0x1f'),_0x36a550,'request\x20sent',JSON[_0xb234('0x20')](_0x3b9bb1));if(_0x3b9bb1[_0xb234('0x21')]){if(_0x3b9bb1[_0xb234('0x21')][_0xb234('0x22')]===0x1f4){logger[_0xb234('0x21')](_0xb234('0x23'),_0x36a550,_0x3b9bb1[_0xb234('0x21')][_0xb234('0x24')]);return _0x22519b(_0x3b9bb1[_0xb234('0x21')][_0xb234('0x24')]);}logger[_0xb234('0x21')](_0xb234('0x23'),_0x36a550,_0x3b9bb1[_0xb234('0x21')][_0xb234('0x24')]);return _0x41f8dc(_0x3b9bb1['error']['message']);}else{logger[_0xb234('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0x36a550,'request\x20sent');_0x41f8dc(_0x3b9bb1[_0xb234('0x25')][_0xb234('0x24')]);}})[_0xb234('0x26')](function(_0x24d8ee){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x36a550,_0x24d8ee);_0x22519b(_0x24d8ee);});});}function respondWithStatusCode(_0x448601,_0x103b4c){_0x103b4c=_0x103b4c||0xcc;return function(_0x225108){if(_0x225108){return _0x448601['sendStatus'](_0x103b4c);}return _0x448601[_0xb234('0x27')](_0x103b4c)['end']();};}function respondWithResult(_0x3689d0,_0x99b945){_0x99b945=_0x99b945||0xc8;return function(_0x1024de){if(_0x1024de){return _0x3689d0[_0xb234('0x27')](_0x99b945)['json'](_0x1024de);}};}function respondWithFilteredResult(_0x31bca0,_0x16b8c1){return function(_0x3b7b47){if(_0x3b7b47){var _0x5f6586=typeof _0x16b8c1[_0xb234('0x28')]===_0xb234('0x29')&&typeof _0x16b8c1[_0xb234('0x2a')]==='undefined';var _0x1971dd=_0x3b7b47['count'];var _0x2b208b=_0x5f6586?0x0:_0x16b8c1[_0xb234('0x28')];var _0x32022f=_0x5f6586?_0x3b7b47[_0xb234('0x2b')]:_0x16b8c1[_0xb234('0x28')]+_0x16b8c1[_0xb234('0x2a')];var _0x3cfb40;if(_0x32022f>=_0x1971dd){_0x32022f=_0x1971dd;_0x3cfb40=0xc8;}else{_0x3cfb40=0xce;}_0x31bca0[_0xb234('0x27')](_0x3cfb40);return _0x31bca0[_0xb234('0x2c')](_0xb234('0x2d'),_0x2b208b+'-'+_0x32022f+'/'+_0x1971dd)['json'](_0x3b7b47);}return null;};}function patchUpdates(_0xaecf3e){return function(_0x237089){try{jsonpatch[_0xb234('0x2e')](_0x237089,_0xaecf3e,!![]);}catch(_0x1f6bae){return BPromise[_0xb234('0x2f')](_0x1f6bae);}return _0x237089[_0xb234('0x30')]();};}function saveUpdates(_0x1f3e83,_0x1f4aab){return function(_0x4deced){if(_0x4deced){return _0x4deced['update'](_0x1f3e83)['then'](function(_0x1c67c2){return _0x1c67c2;});}return null;};}function removeEntity(_0x1ac970,_0x332002){return function(_0x55b36e){if(_0x55b36e){return _0x55b36e['destroy']()[_0xb234('0x1c')](function(){_0x1ac970['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x163356,_0x4fb7be){return function(_0x4351d6){if(!_0x4351d6){_0x163356['sendStatus'](0x194);}return _0x4351d6;};}function handleError(_0x22ad3e,_0x1ea575){_0x1ea575=_0x1ea575||0x1f4;return function(_0x50e593){logger[_0xb234('0x21')](_0x50e593[_0xb234('0x31')]);if(_0x50e593[_0xb234('0x32')]){delete _0x50e593[_0xb234('0x32')];}_0x22ad3e[_0xb234('0x27')](_0x1ea575)[_0xb234('0x33')](_0x50e593);};}exports[_0xb234('0x34')]=function(_0x1b69f1,_0x2a0dc6){var _0x31b9ad={},_0x543a11={},_0x51f9ef={'count':0x0,'rows':[]};var _0x3f7d8f=_[_0xb234('0x35')](db[_0xb234('0x36')][_0xb234('0x37')],function(_0x34d22b){return{'name':_0x34d22b[_0xb234('0x38')],'type':_0x34d22b[_0xb234('0x39')][_0xb234('0x3a')]};});_0x543a11[_0xb234('0x3b')]=_[_0xb234('0x35')](_0x3f7d8f,_0xb234('0x32'));_0x543a11[_0xb234('0x3c')]=_[_0xb234('0x3d')](_0x1b69f1['query']);_0x543a11[_0xb234('0x3e')]=_[_0xb234('0x3f')](_0x543a11[_0xb234('0x3b')],_0x543a11[_0xb234('0x3c')]);_0x31b9ad[_0xb234('0x40')]=_['intersection'](_0x543a11[_0xb234('0x3b')],qs[_0xb234('0x41')](_0x1b69f1['query'][_0xb234('0x41')]));_0x31b9ad[_0xb234('0x40')]=_0x31b9ad[_0xb234('0x40')][_0xb234('0x42')]?_0x31b9ad[_0xb234('0x40')]:_0x543a11[_0xb234('0x3b')];if(!_0x1b69f1['query'][_0xb234('0x43')](_0xb234('0x44'))){_0x31b9ad[_0xb234('0x2a')]=qs[_0xb234('0x2a')](_0x1b69f1['query'][_0xb234('0x2a')]);_0x31b9ad['offset']=qs['offset'](_0x1b69f1[_0xb234('0x3c')][_0xb234('0x28')]);}_0x31b9ad['order']=qs[_0xb234('0x45')](_0x1b69f1[_0xb234('0x3c')][_0xb234('0x45')]);_0x31b9ad[_0xb234('0x46')]=qs[_0xb234('0x3e')](_[_0xb234('0x47')](_0x1b69f1[_0xb234('0x3c')],_0x543a11[_0xb234('0x3e')]),_0x3f7d8f);if(_0x1b69f1[_0xb234('0x3c')][_0xb234('0x48')]){_0x31b9ad[_0xb234('0x46')]=_[_0xb234('0x49')](_0x31b9ad[_0xb234('0x46')],{'$or':_[_0xb234('0x35')](_0x3f7d8f,function(_0x216d73){if(_0x216d73[_0xb234('0x39')]!==_0xb234('0x4a')){var _0x4b9e3a={};_0x4b9e3a[_0x216d73[_0xb234('0x32')]]={'$like':'%'+_0x1b69f1[_0xb234('0x3c')][_0xb234('0x48')]+'%'};return _0x4b9e3a;}})});}_0x31b9ad=_[_0xb234('0x49')]({},_0x31b9ad,_0x1b69f1[_0xb234('0x4b')]);var _0x88745a={'where':_0x31b9ad[_0xb234('0x46')]};return db[_0xb234('0x36')][_0xb234('0x2b')](_0x88745a)[_0xb234('0x1c')](function(_0x39c7be){_0x51f9ef[_0xb234('0x2b')]=_0x39c7be;if(_0x1b69f1[_0xb234('0x3c')][_0xb234('0x4c')]){_0x31b9ad['include']=[{'all':!![]}];}return db[_0xb234('0x36')][_0xb234('0x4d')](_0x31b9ad);})[_0xb234('0x1c')](function(_0xe8ce03){_0x51f9ef[_0xb234('0x4e')]=_0xe8ce03;return _0x51f9ef;})[_0xb234('0x1c')](respondWithFilteredResult(_0x2a0dc6,_0x31b9ad))[_0xb234('0x26')](handleError(_0x2a0dc6,null));};exports[_0xb234('0x4f')]=function(_0x1f292b,_0x334f16){var _0x245afe={'raw':!![],'where':{'id':_0x1f292b['params']['id']}},_0x27ba59={};_0x27ba59[_0xb234('0x3b')]=_[_0xb234('0x3d')](db[_0xb234('0x36')][_0xb234('0x37')]);_0x27ba59['query']=_['keys'](_0x1f292b[_0xb234('0x3c')]);_0x27ba59[_0xb234('0x3e')]=_[_0xb234('0x3f')](_0x27ba59[_0xb234('0x3b')],_0x27ba59[_0xb234('0x3c')]);_0x245afe[_0xb234('0x40')]=_['intersection'](_0x27ba59[_0xb234('0x3b')],qs[_0xb234('0x41')](_0x1f292b[_0xb234('0x3c')][_0xb234('0x41')]));_0x245afe[_0xb234('0x40')]=_0x245afe[_0xb234('0x40')][_0xb234('0x42')]?_0x245afe[_0xb234('0x40')]:_0x27ba59[_0xb234('0x3b')];if(_0x1f292b[_0xb234('0x3c')][_0xb234('0x4c')]){_0x245afe['include']=[{'all':!![]}];}_0x245afe=_[_0xb234('0x49')]({},_0x245afe,_0x1f292b[_0xb234('0x4b')]);return db[_0xb234('0x36')][_0xb234('0x50')](_0x245afe)[_0xb234('0x1c')](handleEntityNotFound(_0x334f16,null))['then'](respondWithResult(_0x334f16,null))[_0xb234('0x26')](handleError(_0x334f16,null));};exports[_0xb234('0x51')]=function(_0x50c290,_0x39f059){return db[_0xb234('0x36')][_0xb234('0x51')](_0x50c290['body'],{})[_0xb234('0x1c')](respondWithResult(_0x39f059,0xc9))['catch'](handleError(_0x39f059,null));};exports[_0xb234('0x52')]=function(_0xaf0ab,_0x141c9b){if(_0xaf0ab['body']['id']){delete _0xaf0ab[_0xb234('0x53')]['id'];}return db[_0xb234('0x36')]['find']({'where':{'id':_0xaf0ab[_0xb234('0x54')]['id']}})[_0xb234('0x1c')](handleEntityNotFound(_0x141c9b,null))[_0xb234('0x1c')](saveUpdates(_0xaf0ab[_0xb234('0x53')],null))[_0xb234('0x1c')](respondWithResult(_0x141c9b,null))[_0xb234('0x26')](handleError(_0x141c9b,null));};exports[_0xb234('0x55')]=function(_0x421541,_0x2e508c){return db[_0xb234('0x36')][_0xb234('0x50')]({'where':{'id':_0x421541[_0xb234('0x54')]['id']}})[_0xb234('0x1c')](handleEntityNotFound(_0x2e508c,null))[_0xb234('0x1c')](removeEntity(_0x2e508c,null))[_0xb234('0x26')](handleError(_0x2e508c,null));};exports[_0xb234('0x56')]=function(_0x3eccf3,_0x19f1f2){return db[_0xb234('0x36')][_0xb234('0x56')]()[_0xb234('0x1c')](respondWithResult(_0x19f1f2,null))[_0xb234('0x26')](handleError(_0x19f1f2,null));};var interaction_log=require(_0xb234('0x57'))(_0xb234('0x58'));exports[_0xb234('0x59')]=function(_0x44263a,_0x38ec8a,_0x2263a3){var _0x4e601d={'agent':{},'channel':'whatsapp'};if(_0x44263a[_0xb234('0x53')]['id']){delete _0x44263a[_0xb234('0x53')]['id'];}_0x44263a[_0xb234('0x53')]['read']=!![];_0x44263a[_0xb234('0x53')][_0xb234('0x5a')]=moment()[_0xb234('0x5b')](_0xb234('0x5c'));_0x44263a['body'][_0xb234('0x5d')]=_0x44263a['body'][_0xb234('0x5d')]||_0x44263a[_0xb234('0x5e')]['id'];_0x4e601d['agent']['id']=_0x44263a[_0xb234('0x53')]['UserId'];return db[_0xb234('0x36')][_0xb234('0x50')]({'where':{'id':_0x44263a['params']['id'],'UserId':null}})[_0xb234('0x1c')](handleEntityNotFound(_0x38ec8a,null))['then'](saveUpdates(_0x44263a[_0xb234('0x53')],null))[_0xb234('0x1c')](function(_0xa1638b){if(_0xa1638b){_0x4e601d[_0xb234('0x24')]=_0xa1638b[_0xb234('0x5f')]({'plain':!![]});return db[_0xb234('0x60')][_0xb234('0x50')]({'where':{'id':_0xa1638b[_0xb234('0x61')]}});}return null;})[_0xb234('0x1c')](handleEntityNotFound(_0x38ec8a,null))[_0xb234('0x1c')](function(_0x28b047){if(_0x28b047){return _0x28b047[_0xb234('0x52')]({'UserId':_0x44263a[_0xb234('0x53')]['UserId'],'read1stAt':_['isNil'](_0x28b047[_0xb234('0x62')])?moment()[_0xb234('0x5b')](_0xb234('0x5c')):undefined});}return null;})['then'](function(_0x5df670){if(_0x5df670){_0x4e601d['interaction']=_0x5df670['get']({'plain':!![]});interaction_log[_0xb234('0x1d')](_0xb234('0x63'),_0x44263a[_0xb234('0x5e')]['id'],_0x44263a[_0xb234('0x5e')][_0xb234('0x32')],_0x44263a[_0xb234('0x5e')][_0xb234('0x64')],_0x4e601d[_0xb234('0x65')]['id'],_0x44263a[_0xb234('0x53')]?JSON['stringify'](_0x44263a['body']):_0xb234('0x66'));return respondWithRpcPromise('AcceptMessage',_0xb234('0x67'),_0x4e601d);}return null;})['then'](function(_0x93ea17){var _0x3eac66='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x93ea17[_0xb234('0x24')]['ContactId'];return db[_0xb234('0x68')][_0xb234('0x3c')](_0x3eac66,{'type':db[_0xb234('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x11ee00){return _0x11ee00;});})[_0xb234('0x1c')](function(_0x41637d){if(_0x41637d){_0x4e601d[_0xb234('0x24')][_0xb234('0x6a')]=_0x41637d[0x0];if(!_0x44263a[_0xb234('0x53')][_0xb234('0x5d')])return;return db[_0xb234('0x6b')][_0xb234('0x50')]({'where':{'id':_0x44263a[_0xb234('0x53')][_0xb234('0x5d')],'role':'agent'},'attributes':['id','name',_0xb234('0x6c'),_0xb234('0x6d'),_0xb234('0x6e')],'raw':!![]});}return null;})[_0xb234('0x1c')](function(_0xe67a04){if(!_0xe67a04)return null;_0x4e601d[_0xb234('0x24')][_0xb234('0x6f')]=_0xe67a04;return _0x4e601d;})[_0xb234('0x1c')](function(_0x249b61){if(_0x249b61){if(_0x44263a[_0xb234('0x53')][_0xb234('0x70')]){_0x4e601d[_0xb234('0x24')][_0xb234('0x71')]=util[_0xb234('0x5b')](_0xb234('0x72'),_0x44263a[_0xb234('0x5e')][_0xb234('0x32')]);_0x4e601d[_0xb234('0x24')][_0xb234('0x73')]=_0x4e601d['channel'];_0x4e601d[_0xb234('0x24')][_0xb234('0x74')]=_0x4e601d[_0xb234('0x73')];_0x4e601d[_0xb234('0x24')][_0xb234('0x75')]=_0xb234('0x59');return respondWithRpcPromise('EventManager',_0xb234('0x76'),{'event':'acceptmessage','message':_0x4e601d[_0xb234('0x24')]},client9002)['then'](function(){return _0x4e601d;});}return _0x4e601d;}return null;})[_0xb234('0x1c')](respondWithResult(_0x38ec8a,null))['catch'](handleError(_0x38ec8a,null));};var interaction_log=require(_0xb234('0x57'))(_0xb234('0x58'));exports['reject']=function(_0x310359,_0xffe19,_0x5cb7da){var _0x2d5ba0={'agent':{},'channel':'whatsapp'};if(_0x310359[_0xb234('0x53')]['id']){delete _0x310359[_0xb234('0x53')]['id'];}_0x310359['body'][_0xb234('0x5d')]=_0x310359['body']['UserId']||_0x310359[_0xb234('0x5e')]['id'];_0x2d5ba0[_0xb234('0x6f')]['id']=_0x310359[_0xb234('0x53')][_0xb234('0x5d')];return db[_0xb234('0x36')][_0xb234('0x50')]({'where':{'id':_0x310359['params']['id'],'UserId':null}})[_0xb234('0x1c')](handleEntityNotFound(_0xffe19,null))[_0xb234('0x1c')](function(_0x262fb2){if(_0x262fb2){_0x2d5ba0['message']=_0x262fb2['get']({'plain':!![]});return db[_0xb234('0x60')]['find']({'where':{'id':_0x262fb2[_0xb234('0x61')]}});}return null;})[_0xb234('0x1c')](handleEntityNotFound(_0xffe19,null))['then'](function(_0x1ea342){if(_0x1ea342){_0x2d5ba0['interaction']=_0x1ea342[_0xb234('0x5f')]({'plain':!![]});interaction_log[_0xb234('0x1d')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x310359[_0xb234('0x5e')]['id'],_0x310359[_0xb234('0x5e')][_0xb234('0x32')],_0x310359[_0xb234('0x5e')][_0xb234('0x64')],_0x2d5ba0[_0xb234('0x65')]['id'],_0x310359['body']?JSON['stringify'](_0x310359[_0xb234('0x53')]):_0xb234('0x66'));return respondWithRpcPromise(_0xb234('0x77'),_0xb234('0x78'),_0x2d5ba0);}return null;})[_0xb234('0x1c')](function(_0x5ab349){var _0x50b5fe=_0xb234('0x79')+_0x5ab349[_0xb234('0x24')][_0xb234('0x7a')];return db['sequelize']['query'](_0x50b5fe,{'type':db['Sequelize'][_0xb234('0x7b')][_0xb234('0x7c')],'raw':!![]})['then'](function(_0x56eb63){return _0x56eb63;});})[_0xb234('0x1c')](function(_0x56fa28){if(_0x56fa28){_0x2d5ba0[_0xb234('0x24')][_0xb234('0x6a')]=_0x56fa28[0x0];if(!_0x310359[_0xb234('0x53')]['UserId'])return;return db[_0xb234('0x6b')][_0xb234('0x50')]({'where':{'id':_0x310359[_0xb234('0x53')]['UserId'],'role':_0xb234('0x6f')},'attributes':['id',_0xb234('0x32'),_0xb234('0x6c'),_0xb234('0x6d'),_0xb234('0x6e')],'raw':!![]});}return null;})[_0xb234('0x1c')](function(_0x5bcd9b){if(!_0x5bcd9b)return null;_0x2d5ba0[_0xb234('0x24')]['agent']=_0x5bcd9b;return _0x2d5ba0;})[_0xb234('0x1c')](function(_0x1b683e){if(_0x1b683e){_0x1b683e[_0xb234('0x24')][_0xb234('0x71')]=util[_0xb234('0x5b')](_0xb234('0x72'),_0x310359[_0xb234('0x5e')][_0xb234('0x32')]);_0x1b683e[_0xb234('0x24')][_0xb234('0x73')]=_0x2d5ba0[_0xb234('0x73')];_0x1b683e[_0xb234('0x24')][_0xb234('0x74')]=_0x2d5ba0[_0xb234('0x73')];_0x1b683e[_0xb234('0x24')]['event']=_0xb234('0x2f');respondWithRpcPromise(_0xb234('0x76'),_0xb234('0x76'),{'event':_0xb234('0x7d'),'message':_0x1b683e[_0xb234('0x24')]},client9002);return _0x2d5ba0;}return null;})[_0xb234('0x1c')](respondWithResult(_0xffe19,null))[_0xb234('0x26')](handleError(_0xffe19,null));};exports[_0xb234('0x27')]=function(_0x5c123d,_0x231e06,_0x2011a2){if(_0x5c123d[_0xb234('0x53')]['id']){delete _0x5c123d[_0xb234('0x53')]['id'];}var _0x4da34c;return db['WhatsappMessage'][_0xb234('0x50')]({'where':{'id':_0x5c123d[_0xb234('0x54')]['id']}})[_0xb234('0x1c')](handleEntityNotFound(_0x231e06,null))[_0xb234('0x1c')](function(_0x201376){if(_0x201376){_0x4da34c=_0x201376;return db[_0xb234('0x7e')][_0xb234('0x50')]({'where':{'id':_0x201376[_0xb234('0x7f')]}});}})['then'](handleEntityNotFound(_0x231e06,null))[_0xb234('0x1c')](function(_0x5ec257){if(_0x5ec257){logger['debug'](_0xb234('0x80'),_0xb234('0x27'),_0xb234('0x81'),_0x5ec257[_0xb234('0x39')],util[_0xb234('0x82')](_0x5c123d[_0xb234('0x53')],{'showHidden':![],'depth':null}));switch(_0x5ec257[_0xb234('0x39')]){case _0xb234('0x83'):if(_0x5c123d[_0xb234('0x53')][_0xb234('0x84')]&&_0x5c123d['body'][_0xb234('0x84')]===_0x4da34c[_0xb234('0x85')]&&_0x5c123d[_0xb234('0x53')][_0xb234('0x86')]&&_0x5c123d['body'][_0xb234('0x86')]==='read'){return _0x4da34c['update']({'read':!![]});}else{logger['error'](_0xb234('0x87'),_0xb234('0x27'),_0xb234('0x83'),util[_0xb234('0x82')](_0x5c123d[_0xb234('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x4da34c;}})[_0xb234('0x1c')](respondWithResult(_0x231e06,null))[_0xb234('0x26')](handleError(_0x231e06,null));}; \ No newline at end of file +var _0xb533=['util','path','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','undefined','limit','offset','count','set','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','options','WhatsappMessage','includeAll','findAll','rows','show','keys','include','find','create','body','params','describe','whatsapp-interactions','whatsapp','read','readAt','format','UserId','user','WhatsappInteraction','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','agent','interface','SIP/%s','channel','event','accept','EventManager','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','motionChannel','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb533,0x173));var _0x3b53=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xb533[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require(_0x3b53('0x0'));var rimraf=require(_0x3b53('0x1'));var zipdir=require(_0x3b53('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b53('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3b53('0x4'));var path=require(_0x3b53('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b53('0x6'));var _=require('lodash');var squel=require(_0x3b53('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b53('0x8'));var toCsv=require(_0x3b53('0x9'));var querystring=require('querystring');var Papa=require(_0x3b53('0xa'));var Redis=require(_0x3b53('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3b53('0xc'));var hardwareService=require(_0x3b53('0xd'));var logger=require(_0x3b53('0xe'))(_0x3b53('0xf'));var utils=require(_0x3b53('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x3b53('0x11'));var db=require(_0x3b53('0x12'))['db'];config[_0x3b53('0x13')]=_['defaults'](config[_0x3b53('0x13')],{'host':_0x3b53('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b53('0x13')]));require(_0x3b53('0x15'))[_0x3b53('0x16')](socket);var jayson=require(_0x3b53('0x17'));var client=jayson[_0x3b53('0x18')][_0x3b53('0x19')]({'port':0x232c});var client9002=jayson['client'][_0x3b53('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x500740,_0x338385,_0x2d0845,_0x1d5930){return new BPromise(function(_0x1651a9,_0x5de724){var _0x1c7a38=_0x1d5930||client;return _0x1c7a38[_0x3b53('0x1a')](_0x500740,_0x2d0845)['then'](function(_0x58774a){logger[_0x3b53('0x1b')](_0x3b53('0x1c'),_0x338385,_0x3b53('0x1d'));logger[_0x3b53('0x1e')](_0x3b53('0x1f'),_0x338385,_0x3b53('0x1d'),JSON[_0x3b53('0x20')](_0x58774a));if(_0x58774a[_0x3b53('0x21')]){if(_0x58774a[_0x3b53('0x21')]['code']===0x1f4){logger[_0x3b53('0x21')](_0x3b53('0x1c'),_0x338385,_0x58774a[_0x3b53('0x21')]['message']);return _0x5de724(_0x58774a['error'][_0x3b53('0x22')]);}logger[_0x3b53('0x21')](_0x3b53('0x1c'),_0x338385,_0x58774a[_0x3b53('0x21')]['message']);return _0x1651a9(_0x58774a['error'][_0x3b53('0x22')]);}else{logger[_0x3b53('0x1b')](_0x3b53('0x1c'),_0x338385,'request\x20sent');_0x1651a9(_0x58774a[_0x3b53('0x23')][_0x3b53('0x22')]);}})[_0x3b53('0x24')](function(_0x4c73d8){logger['error'](_0x3b53('0x1c'),_0x338385,_0x4c73d8);_0x5de724(_0x4c73d8);});});}function respondWithStatusCode(_0x4880d2,_0x1221a2){_0x1221a2=_0x1221a2||0xcc;return function(_0x50979a){if(_0x50979a){return _0x4880d2['sendStatus'](_0x1221a2);}return _0x4880d2[_0x3b53('0x25')](_0x1221a2)['end']();};}function respondWithResult(_0x56bca1,_0x7902f3){_0x7902f3=_0x7902f3||0xc8;return function(_0x64ebdd){if(_0x64ebdd){return _0x56bca1['status'](_0x7902f3)['json'](_0x64ebdd);}};}function respondWithFilteredResult(_0x3c3a54,_0x385a91){return function(_0xae2757){if(_0xae2757){var _0x4bde71=typeof _0x385a91['offset']===_0x3b53('0x26')&&typeof _0x385a91[_0x3b53('0x27')]===_0x3b53('0x26');var _0x3e07dc=_0xae2757['count'];var _0x10733f=_0x4bde71?0x0:_0x385a91[_0x3b53('0x28')];var _0x57c728=_0x4bde71?_0xae2757[_0x3b53('0x29')]:_0x385a91[_0x3b53('0x28')]+_0x385a91['limit'];var _0x25e8a5;if(_0x57c728>=_0x3e07dc){_0x57c728=_0x3e07dc;_0x25e8a5=0xc8;}else{_0x25e8a5=0xce;}_0x3c3a54[_0x3b53('0x25')](_0x25e8a5);return _0x3c3a54[_0x3b53('0x2a')]('Content-Range',_0x10733f+'-'+_0x57c728+'/'+_0x3e07dc)['json'](_0xae2757);}return null;};}function patchUpdates(_0x40a337){return function(_0x386a28){try{jsonpatch[_0x3b53('0x2b')](_0x386a28,_0x40a337,!![]);}catch(_0x494358){return BPromise[_0x3b53('0x2c')](_0x494358);}return _0x386a28['save']();};}function saveUpdates(_0x291189,_0xb03355){return function(_0x443e6e){if(_0x443e6e){return _0x443e6e[_0x3b53('0x2d')](_0x291189)[_0x3b53('0x2e')](function(_0x50151b){return _0x50151b;});}return null;};}function removeEntity(_0x2d5f0c,_0x5dd7db){return function(_0x278bc9){if(_0x278bc9){return _0x278bc9[_0x3b53('0x2f')]()[_0x3b53('0x2e')](function(){_0x2d5f0c[_0x3b53('0x25')](0xcc)[_0x3b53('0x30')]();});}};}function handleEntityNotFound(_0x3ada32,_0x439f2d){return function(_0x32a8d1){if(!_0x32a8d1){_0x3ada32[_0x3b53('0x31')](0x194);}return _0x32a8d1;};}function handleError(_0xaeee5a,_0x2308b7){_0x2308b7=_0x2308b7||0x1f4;return function(_0x3b0082){logger[_0x3b53('0x21')](_0x3b0082[_0x3b53('0x32')]);if(_0x3b0082['name']){delete _0x3b0082[_0x3b53('0x33')];}_0xaeee5a['status'](_0x2308b7)[_0x3b53('0x34')](_0x3b0082);};}exports['index']=function(_0xd5b2cb,_0x5b31e5){var _0x13a87e={},_0x5b2cb0={},_0x4238d5={'count':0x0,'rows':[]};var _0x2b36ce=_[_0x3b53('0x35')](db['WhatsappMessage'][_0x3b53('0x36')],function(_0x27970d){return{'name':_0x27970d[_0x3b53('0x37')],'type':_0x27970d[_0x3b53('0x38')][_0x3b53('0x39')]};});_0x5b2cb0['model']=_[_0x3b53('0x35')](_0x2b36ce,_0x3b53('0x33'));_0x5b2cb0[_0x3b53('0x3a')]=_['keys'](_0xd5b2cb[_0x3b53('0x3a')]);_0x5b2cb0[_0x3b53('0x3b')]=_[_0x3b53('0x3c')](_0x5b2cb0['model'],_0x5b2cb0[_0x3b53('0x3a')]);_0x13a87e[_0x3b53('0x3d')]=_[_0x3b53('0x3c')](_0x5b2cb0[_0x3b53('0x3e')],qs[_0x3b53('0x3f')](_0xd5b2cb[_0x3b53('0x3a')][_0x3b53('0x3f')]));_0x13a87e[_0x3b53('0x3d')]=_0x13a87e['attributes'][_0x3b53('0x40')]?_0x13a87e[_0x3b53('0x3d')]:_0x5b2cb0[_0x3b53('0x3e')];if(!_0xd5b2cb[_0x3b53('0x3a')]['hasOwnProperty'](_0x3b53('0x41'))){_0x13a87e[_0x3b53('0x27')]=qs[_0x3b53('0x27')](_0xd5b2cb[_0x3b53('0x3a')][_0x3b53('0x27')]);_0x13a87e[_0x3b53('0x28')]=qs[_0x3b53('0x28')](_0xd5b2cb[_0x3b53('0x3a')]['offset']);}_0x13a87e[_0x3b53('0x42')]=qs[_0x3b53('0x43')](_0xd5b2cb['query'][_0x3b53('0x43')]);_0x13a87e[_0x3b53('0x44')]=qs[_0x3b53('0x3b')](_['pick'](_0xd5b2cb[_0x3b53('0x3a')],_0x5b2cb0[_0x3b53('0x3b')]),_0x2b36ce);if(_0xd5b2cb[_0x3b53('0x3a')][_0x3b53('0x45')]){_0x13a87e[_0x3b53('0x44')]=_[_0x3b53('0x46')](_0x13a87e[_0x3b53('0x44')],{'$or':_[_0x3b53('0x35')](_0x2b36ce,function(_0x4fbabc){if(_0x4fbabc['type']!=='VIRTUAL'){var _0x4ef03d={};_0x4ef03d[_0x4fbabc['name']]={'$like':'%'+_0xd5b2cb['query'][_0x3b53('0x45')]+'%'};return _0x4ef03d;}})});}_0x13a87e=_[_0x3b53('0x46')]({},_0x13a87e,_0xd5b2cb[_0x3b53('0x47')]);var _0x2d1fb6={'where':_0x13a87e[_0x3b53('0x44')]};return db[_0x3b53('0x48')][_0x3b53('0x29')](_0x2d1fb6)[_0x3b53('0x2e')](function(_0x1fcd08){_0x4238d5['count']=_0x1fcd08;if(_0xd5b2cb[_0x3b53('0x3a')][_0x3b53('0x49')]){_0x13a87e['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x3b53('0x4a')](_0x13a87e);})[_0x3b53('0x2e')](function(_0x1c1b18){_0x4238d5[_0x3b53('0x4b')]=_0x1c1b18;return _0x4238d5;})['then'](respondWithFilteredResult(_0x5b31e5,_0x13a87e))[_0x3b53('0x24')](handleError(_0x5b31e5,null));};exports[_0x3b53('0x4c')]=function(_0x575bd9,_0x9e6630){var _0x5cab9a={'raw':!![],'where':{'id':_0x575bd9['params']['id']}},_0x4ae4bf={};_0x4ae4bf['model']=_[_0x3b53('0x4d')](db['WhatsappMessage'][_0x3b53('0x36')]);_0x4ae4bf[_0x3b53('0x3a')]=_['keys'](_0x575bd9[_0x3b53('0x3a')]);_0x4ae4bf[_0x3b53('0x3b')]=_[_0x3b53('0x3c')](_0x4ae4bf['model'],_0x4ae4bf[_0x3b53('0x3a')]);_0x5cab9a[_0x3b53('0x3d')]=_['intersection'](_0x4ae4bf[_0x3b53('0x3e')],qs[_0x3b53('0x3f')](_0x575bd9[_0x3b53('0x3a')][_0x3b53('0x3f')]));_0x5cab9a['attributes']=_0x5cab9a[_0x3b53('0x3d')]['length']?_0x5cab9a['attributes']:_0x4ae4bf[_0x3b53('0x3e')];if(_0x575bd9[_0x3b53('0x3a')]['includeAll']){_0x5cab9a[_0x3b53('0x4e')]=[{'all':!![]}];}_0x5cab9a=_[_0x3b53('0x46')]({},_0x5cab9a,_0x575bd9[_0x3b53('0x47')]);return db[_0x3b53('0x48')][_0x3b53('0x4f')](_0x5cab9a)[_0x3b53('0x2e')](handleEntityNotFound(_0x9e6630,null))[_0x3b53('0x2e')](respondWithResult(_0x9e6630,null))[_0x3b53('0x24')](handleError(_0x9e6630,null));};exports[_0x3b53('0x50')]=function(_0xdb22e5,_0x3fe19b){return db[_0x3b53('0x48')][_0x3b53('0x50')](_0xdb22e5['body'],{})[_0x3b53('0x2e')](respondWithResult(_0x3fe19b,0xc9))[_0x3b53('0x24')](handleError(_0x3fe19b,null));};exports[_0x3b53('0x2d')]=function(_0x50d702,_0x48979d){if(_0x50d702[_0x3b53('0x51')]['id']){delete _0x50d702['body']['id'];}return db[_0x3b53('0x48')][_0x3b53('0x4f')]({'where':{'id':_0x50d702[_0x3b53('0x52')]['id']}})[_0x3b53('0x2e')](handleEntityNotFound(_0x48979d,null))[_0x3b53('0x2e')](saveUpdates(_0x50d702['body'],null))[_0x3b53('0x2e')](respondWithResult(_0x48979d,null))[_0x3b53('0x24')](handleError(_0x48979d,null));};exports[_0x3b53('0x2f')]=function(_0x17acd6,_0x2059e9){return db['WhatsappMessage'][_0x3b53('0x4f')]({'where':{'id':_0x17acd6[_0x3b53('0x52')]['id']}})[_0x3b53('0x2e')](handleEntityNotFound(_0x2059e9,null))[_0x3b53('0x2e')](removeEntity(_0x2059e9,null))[_0x3b53('0x24')](handleError(_0x2059e9,null));};exports[_0x3b53('0x53')]=function(_0x934778,_0x4287b4){return db[_0x3b53('0x48')][_0x3b53('0x53')]()[_0x3b53('0x2e')](respondWithResult(_0x4287b4,null))[_0x3b53('0x24')](handleError(_0x4287b4,null));};var interaction_log=require(_0x3b53('0xe'))(_0x3b53('0x54'));exports['accept']=function(_0x5a0691,_0x4833bc,_0x3da454){var _0xc84df6={'agent':{},'channel':_0x3b53('0x55')};if(_0x5a0691[_0x3b53('0x51')]['id']){delete _0x5a0691[_0x3b53('0x51')]['id'];}_0x5a0691[_0x3b53('0x51')][_0x3b53('0x56')]=!![];_0x5a0691[_0x3b53('0x51')][_0x3b53('0x57')]=moment()[_0x3b53('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a0691[_0x3b53('0x51')][_0x3b53('0x59')]=_0x5a0691[_0x3b53('0x51')][_0x3b53('0x59')]||_0x5a0691[_0x3b53('0x5a')]['id'];_0xc84df6['agent']['id']=_0x5a0691['body'][_0x3b53('0x59')];return db['WhatsappMessage'][_0x3b53('0x4f')]({'where':{'id':_0x5a0691['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4833bc,null))[_0x3b53('0x2e')](saveUpdates(_0x5a0691[_0x3b53('0x51')],null))[_0x3b53('0x2e')](function(_0x2a435b){if(_0x2a435b){_0xc84df6[_0x3b53('0x22')]=_0x2a435b['get']({'plain':!![]});return db[_0x3b53('0x5b')][_0x3b53('0x4f')]({'where':{'id':_0x2a435b['WhatsappInteractionId']}});}return null;})[_0x3b53('0x2e')](handleEntityNotFound(_0x4833bc,null))[_0x3b53('0x2e')](function(_0x151339){if(_0x151339){return _0x151339[_0x3b53('0x2d')]({'UserId':_0x5a0691[_0x3b53('0x51')][_0x3b53('0x59')],'read1stAt':_['isNil'](_0x151339['read1stAt'])?moment()[_0x3b53('0x58')](_0x3b53('0x5c')):undefined});}return null;})[_0x3b53('0x2e')](function(_0x37ef13){if(_0x37ef13){_0xc84df6[_0x3b53('0x5d')]=_0x37ef13['get']({'plain':!![]});interaction_log['info'](_0x3b53('0x5e'),_0x5a0691[_0x3b53('0x5a')]['id'],_0x5a0691[_0x3b53('0x5a')][_0x3b53('0x33')],_0x5a0691['user']['role'],_0xc84df6['interaction']['id'],_0x5a0691['body']?JSON[_0x3b53('0x20')](_0x5a0691[_0x3b53('0x51')]):_0x3b53('0x5f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xc84df6);}return null;})[_0x3b53('0x2e')](function(_0x3aeb89){var _0x1054cc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3aeb89['message']['ContactId'];return db[_0x3b53('0x60')][_0x3b53('0x3a')](_0x1054cc,{'type':db[_0x3b53('0x61')][_0x3b53('0x62')]['SELECT'],'raw':!![]})[_0x3b53('0x2e')](function(_0x4d1158){return _0x4d1158;});})[_0x3b53('0x2e')](function(_0x4c3172){if(_0x4c3172){_0xc84df6[_0x3b53('0x22')][_0x3b53('0x63')]=_0x4c3172[0x0];if(!_0x5a0691[_0x3b53('0x51')][_0x3b53('0x59')])return;return db[_0x3b53('0x64')][_0x3b53('0x4f')]({'where':{'id':_0x5a0691['body'][_0x3b53('0x59')],'role':'agent'},'attributes':['id',_0x3b53('0x33'),_0x3b53('0x65'),_0x3b53('0x66'),_0x3b53('0x67')],'raw':!![]});}return null;})[_0x3b53('0x2e')](function(_0x15f6b7){if(!_0x15f6b7)return null;_0xc84df6[_0x3b53('0x22')][_0x3b53('0x68')]=_0x15f6b7;return _0xc84df6;})['then'](function(_0x529859){if(_0x529859){if(_0x5a0691[_0x3b53('0x51')]['manual']){_0xc84df6['message'][_0x3b53('0x69')]=util['format'](_0x3b53('0x6a'),_0x5a0691[_0x3b53('0x5a')][_0x3b53('0x33')]);_0xc84df6['message'][_0x3b53('0x6b')]=_0xc84df6['channel'];_0xc84df6['message']['motionChannel']=_0xc84df6[_0x3b53('0x6b')];_0xc84df6[_0x3b53('0x22')][_0x3b53('0x6c')]=_0x3b53('0x6d');return respondWithRpcPromise(_0x3b53('0x6e'),_0x3b53('0x6e'),{'event':'acceptmessage','message':_0xc84df6[_0x3b53('0x22')]},client9002)[_0x3b53('0x2e')](function(){return _0xc84df6;});}return _0xc84df6;}return null;})[_0x3b53('0x2e')](respondWithResult(_0x4833bc,null))[_0x3b53('0x24')](handleError(_0x4833bc,null));};var interaction_log=require(_0x3b53('0xe'))(_0x3b53('0x54'));exports['reject']=function(_0x127eb1,_0x27c883,_0x1f09f5){var _0x36c4ed={'agent':{},'channel':_0x3b53('0x55')};if(_0x127eb1[_0x3b53('0x51')]['id']){delete _0x127eb1[_0x3b53('0x51')]['id'];}_0x127eb1[_0x3b53('0x51')][_0x3b53('0x59')]=_0x127eb1[_0x3b53('0x51')][_0x3b53('0x59')]||_0x127eb1[_0x3b53('0x5a')]['id'];_0x36c4ed['agent']['id']=_0x127eb1[_0x3b53('0x51')][_0x3b53('0x59')];return db[_0x3b53('0x48')][_0x3b53('0x4f')]({'where':{'id':_0x127eb1['params']['id'],'UserId':null}})[_0x3b53('0x2e')](handleEntityNotFound(_0x27c883,null))[_0x3b53('0x2e')](function(_0x1fd0df){if(_0x1fd0df){_0x36c4ed[_0x3b53('0x22')]=_0x1fd0df[_0x3b53('0x6f')]({'plain':!![]});return db[_0x3b53('0x5b')][_0x3b53('0x4f')]({'where':{'id':_0x1fd0df['WhatsappInteractionId']}});}return null;})[_0x3b53('0x2e')](handleEntityNotFound(_0x27c883,null))[_0x3b53('0x2e')](function(_0x1dddaa){if(_0x1dddaa){_0x36c4ed[_0x3b53('0x5d')]=_0x1dddaa[_0x3b53('0x6f')]({'plain':!![]});interaction_log[_0x3b53('0x1b')](_0x3b53('0x70'),_0x127eb1[_0x3b53('0x5a')]['id'],_0x127eb1['user']['name'],_0x127eb1[_0x3b53('0x5a')]['role'],_0x36c4ed['interaction']['id'],_0x127eb1[_0x3b53('0x51')]?JSON[_0x3b53('0x20')](_0x127eb1['body']):_0x3b53('0x5f'));return respondWithRpcPromise(_0x3b53('0x71'),_0x3b53('0x72'),_0x36c4ed);}return null;})['then'](function(_0x5109e0){var _0x513236=_0x3b53('0x73')+_0x5109e0['message'][_0x3b53('0x74')];return db[_0x3b53('0x60')][_0x3b53('0x3a')](_0x513236,{'type':db[_0x3b53('0x61')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3b53('0x2e')](function(_0x573dae){return _0x573dae;});})[_0x3b53('0x2e')](function(_0x52b6e2){if(_0x52b6e2){_0x36c4ed[_0x3b53('0x22')][_0x3b53('0x63')]=_0x52b6e2[0x0];if(!_0x127eb1['body'][_0x3b53('0x59')])return;return db[_0x3b53('0x64')]['find']({'where':{'id':_0x127eb1[_0x3b53('0x51')][_0x3b53('0x59')],'role':'agent'},'attributes':['id',_0x3b53('0x33'),'fullname',_0x3b53('0x66'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2a83a6){if(!_0x2a83a6)return null;_0x36c4ed[_0x3b53('0x22')][_0x3b53('0x68')]=_0x2a83a6;return _0x36c4ed;})['then'](function(_0x352f27){if(_0x352f27){_0x352f27[_0x3b53('0x22')][_0x3b53('0x69')]=util[_0x3b53('0x58')]('SIP/%s',_0x127eb1['user'][_0x3b53('0x33')]);_0x352f27['message'][_0x3b53('0x6b')]=_0x36c4ed['channel'];_0x352f27[_0x3b53('0x22')][_0x3b53('0x75')]=_0x36c4ed[_0x3b53('0x6b')];_0x352f27[_0x3b53('0x22')]['event']='reject';respondWithRpcPromise('EventManager',_0x3b53('0x6e'),{'event':'rejectmessage','message':_0x352f27[_0x3b53('0x22')]},client9002);return _0x36c4ed;}return null;})['then'](respondWithResult(_0x27c883,null))[_0x3b53('0x24')](handleError(_0x27c883,null));};exports[_0x3b53('0x25')]=function(_0x212c40,_0x4150b1,_0x32f42){if(_0x212c40['body']['id']){delete _0x212c40[_0x3b53('0x51')]['id'];}var _0x3622bf;return db[_0x3b53('0x48')][_0x3b53('0x4f')]({'where':{'id':_0x212c40[_0x3b53('0x52')]['id']}})[_0x3b53('0x2e')](handleEntityNotFound(_0x4150b1,null))[_0x3b53('0x2e')](function(_0x1f6d82){if(_0x1f6d82){_0x3622bf=_0x1f6d82;return db[_0x3b53('0x76')][_0x3b53('0x4f')]({'where':{'id':_0x1f6d82[_0x3b53('0x77')]}});}})[_0x3b53('0x2e')](handleEntityNotFound(_0x4150b1,null))[_0x3b53('0x2e')](function(_0x598df2){if(_0x598df2){logger[_0x3b53('0x1e')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x3b53('0x25'),_0x3b53('0x78'),_0x598df2[_0x3b53('0x38')],util['inspect'](_0x212c40[_0x3b53('0x51')],{'showHidden':![],'depth':null}));switch(_0x598df2[_0x3b53('0x38')]){case _0x3b53('0x79'):if(_0x212c40[_0x3b53('0x51')][_0x3b53('0x7a')]&&_0x212c40[_0x3b53('0x51')][_0x3b53('0x7a')]===_0x3622bf['messageId']&&_0x212c40['body'][_0x3b53('0x7b')]&&_0x212c40[_0x3b53('0x51')]['MessageStatus']==='read'){return _0x3622bf['update']({'read':!![]});}else{logger['error'](_0x3b53('0x7c'),'status','twilio',util['inspect'](_0x212c40[_0x3b53('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x3622bf;}})[_0x3b53('0x2e')](respondWithResult(_0x4150b1,null))[_0x3b53('0x24')](handleError(_0x4150b1,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 3c2fca5..b359d91 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 _0xd64b=['exports','events','WhatsappMessage','save','update','remove','hasOwnProperty','hook'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd64b,0xc1));var _0xbd64=function(_0x2b5a41,_0x5ac813){_0x2b5a41=_0x2b5a41-0x0;var _0x50f282=_0xd64b[_0x2b5a41];return _0x50f282;};'use strict';var EventEmitter=require(_0xbd64('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbd64('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd64('0x2'),'afterUpdate':_0xbd64('0x3'),'afterDestroy':_0xbd64('0x4')};function emitEvent(_0x3f1f05){return function(_0x30fe29,_0x5458d8,_0x5446e4){WhatsappMessageEvents['emit'](_0x3f1f05+':'+_0x30fe29['id'],_0x30fe29);WhatsappMessageEvents['emit'](_0x3f1f05,_0x30fe29);_0x5446e4(null);};}for(var e in events){if(events[_0xbd64('0x5')](e)){var event=events[e];WhatsappMessage[_0xbd64('0x6')](e,emitEvent(event));}}module[_0xbd64('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0833=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x2354c0,_0x287493){var _0x4c1dff=function(_0x1a05bd){while(--_0x1a05bd){_0x2354c0['push'](_0x2354c0['shift']());}};_0x4c1dff(++_0x287493);}(_0x0833,0x1bd));var _0x3083=function(_0x1f11ae,_0x40ba40){_0x1f11ae=_0x1f11ae-0x0;var _0x230e52=_0x0833[_0x1f11ae];return _0x230e52;};'use strict';var EventEmitter=require(_0x3083('0x0'));var WhatsappMessage=require(_0x3083('0x1'))['db'][_0x3083('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3083('0x3')](0x0);var events={'afterCreate':_0x3083('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4eec30){return function(_0x22717c,_0x58a865,_0xa26470){WhatsappMessageEvents[_0x3083('0x5')](_0x4eec30+':'+_0x22717c['id'],_0x22717c);WhatsappMessageEvents[_0x3083('0x5')](_0x4eec30,_0x22717c);_0xa26470(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x3083('0x6')](e,emitEvent(event));}}module[_0x3083('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 46c1c5d..73a630b 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 _0x0da2=['create','whatsapp:','remote','/status?token=','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','sinch','authToken','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','phone','accountSid','messages'];(function(_0x170729,_0x555fda){var _0x1177b3=function(_0x25fab3){while(--_0x25fab3){_0x170729['push'](_0x170729['shift']());}};_0x1177b3(++_0x555fda);}(_0x0da2,0x1bb));var _0x20da=function(_0x3eb4f6,_0x54c3e6){_0x3eb4f6=_0x3eb4f6-0x0;var _0xac120=_0x0da2[_0x3eb4f6];return _0xac120;};'use strict';var _=require(_0x20da('0x0'));var util=require(_0x20da('0x1'));var logger=require(_0x20da('0x2'))(_0x20da('0x3'));var moment=require(_0x20da('0x4'));var BPromise=require('bluebird');var rp=require(_0x20da('0x5'));var fetch=require(_0x20da('0x6'));var fs=require('fs');var path=require(_0x20da('0x7'));var rimraf=require('rimraf');var config=require(_0x20da('0x8'));var attributes=require(_0x20da('0x9'));module[_0x20da('0xa')]=function(_0x5b3331,_0x2c94bc){return _0x5b3331[_0x20da('0xb')]('WhatsappMessage',attributes,{'tableName':_0x20da('0xc'),'paranoid':![],'indexes':[{'name':_0x20da('0xd'),'fields':['messageId']},{'name':_0x20da('0xe'),'fields':[_0x20da('0xf')],'type':_0x20da('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2dfc66,_0x150769,_0x1829d){var _0x52d392=_0x5b3331[_0x20da('0x11')];var _0x2c202b=_0x2dfc66[_0x20da('0x12')]({'plain':!![]});if(_0x2c202b['direction']['toLowerCase']()==='in'||_0x2c202b[_0x20da('0x13')][_0x20da('0x14')]()===_0x20da('0x15')&&!_0x2c202b[_0x20da('0x16')]&&!_[_0x20da('0x17')](_0x2c202b['UserId'])){_0x52d392[_0x20da('0x18')][_0x20da('0x19')]({'where':{'id':_0x2c202b[_0x20da('0x1a')]}})[_0x20da('0x1b')](function(_0x5968af){if(_0x5968af){_0x5968af['update']({'lastMsgAt':_0x2c202b['createdAt'],'lastMsgDirection':_0x2c202b['direction'][_0x20da('0x14')]()});}})[_0x20da('0x1c')](function(_0x57ec0d){console[_0x20da('0x1d')](_0x57ec0d);});}if(_0x2c202b[_0x20da('0x13')]===_0x20da('0x15')&&!_0x2c202b[_0x20da('0x16')]){var _0x3562fb;_0x52d392[_0x20da('0x1e')]['find']({'where':{'id':_0x2c202b[_0x20da('0x1f')]},'raw':!![]})[_0x20da('0x1b')](function(_0x42b7b9){_0x3562fb=_0x42b7b9;if(_0x3562fb&&_0x3562fb[_0x20da('0x20')]){switch(_0x3562fb[_0x20da('0x20')]){case _0x20da('0x21'):var _0x1ba60d=require(_0x20da('0x21'));if(_0x3562fb['accountSid']&&_0x3562fb['authToken']&&_0x3562fb[_0x20da('0x22')]){var _0x10f76e=new _0x1ba60d(_0x3562fb[_0x20da('0x23')],_0x3562fb['authToken']);_0x10f76e[_0x20da('0x24')][_0x20da('0x25')]({'body':_0x2c202b[_0x20da('0xf')],'to':_0x20da('0x26')+_0x2c202b[_0x20da('0x22')],'from':_0x20da('0x26')+_0x3562fb['phone'],'statusCallback':_0x3562fb[_0x20da('0x27')]+'/api/whatsapp/messages/'+_0x2c202b['id']+_0x20da('0x28')+_0x3562fb[_0x20da('0x29')]})[_0x20da('0x1b')](function(_0x177848){if(_0x177848[_0x20da('0x2a')]){return _0x2dfc66[_0x20da('0x2b')]({'messageId':_0x177848[_0x20da('0x2a')]});}})[_0x20da('0x1c')](function(_0x5eaf4e){logger['error'](_0x20da('0x2c'),'afterCreate',_0x20da('0x21'),util[_0x20da('0x2d')](_0x5eaf4e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x20da('0x2c'),_0x20da('0x2e'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x20da('0x2f'):var _0x1b0648=_0x3562fb[_0x20da('0x23')];var _0x1d32ae=_0x3562fb[_0x20da('0x30')];var _0x408dcc=_0x3562fb['baseUrl']+_0x20da('0x31')+_0x1b0648+_0x20da('0x32');var _0x5c0319={'to':[_0x2c202b[_0x20da('0x22')]],'message':{'type':_0x20da('0x33'),'text':_0x2c202b[_0x20da('0xf')]}};var _0x338ba1={'method':_0x20da('0x34'),'uri':_0x408dcc,'headers':{'Authorization':_0x20da('0x35')+_0x1d32ae,'Content-Type':_0x20da('0x36')},'body':_0x5c0319,'json':!![]};rp(_0x338ba1)[_0x20da('0x1b')](function(_0x120f22){if(_0x120f22[_0x20da('0x37')][0x0][_0x20da('0x38')]){return _0x2dfc66[_0x20da('0x2b')]({'messageId':_0x120f22['statuses'][0x0][_0x20da('0x38')]});}})[_0x20da('0x1c')](function(_0x52fba0){logger['err']('WhatsappMessage,\x20%s',_0x52fba0);});break;}}})[_0x20da('0x39')](function(){_0x1829d();});}else{_0x1829d();}}},'charset':_0x20da('0x3a'),'collate':_0x20da('0x3b')});}; \ No newline at end of file +var _0xaab2=['./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','WhatsappInteraction','WhatsappInteractionId','then','createdAt','catch','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','whatsapp:','phone','remote','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','POST','Bearer\x20','statuses','update','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','node-fetch','path','../../config/environment'];(function(_0x2e1bcb,_0x14b4b6){var _0x363375=function(_0x143037){while(--_0x143037){_0x2e1bcb['push'](_0x2e1bcb['shift']());}};_0x363375(++_0x14b4b6);}(_0xaab2,0x15b));var _0x2aab=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xaab2[_0x411add];return _0x238242;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2aab('0x0'))(_0x2aab('0x1'));var moment=require(_0x2aab('0x2'));var BPromise=require('bluebird');var rp=require(_0x2aab('0x3'));var fetch=require(_0x2aab('0x4'));var fs=require('fs');var path=require(_0x2aab('0x5'));var rimraf=require('rimraf');var config=require(_0x2aab('0x6'));var attributes=require(_0x2aab('0x7'));module[_0x2aab('0x8')]=function(_0x19984a,_0x1c567d){return _0x19984a[_0x2aab('0x9')](_0x2aab('0xa'),attributes,{'tableName':_0x2aab('0xb'),'paranoid':![],'indexes':[{'name':_0x2aab('0xc'),'fields':[_0x2aab('0xc')]},{'name':_0x2aab('0xd'),'fields':[_0x2aab('0xe')],'type':_0x2aab('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5add48,_0x1825c6,_0x2b2215){var _0x350a70=_0x19984a[_0x2aab('0x10')];var _0x37735f=_0x5add48[_0x2aab('0x11')]({'plain':!![]});if(_0x37735f['direction'][_0x2aab('0x12')]()==='in'||_0x37735f[_0x2aab('0x13')]['toLowerCase']()==='out'&&!_0x37735f[_0x2aab('0x14')]&&!_['isNil'](_0x37735f['UserId'])){_0x350a70[_0x2aab('0x15')]['findOne']({'where':{'id':_0x37735f[_0x2aab('0x16')]}})[_0x2aab('0x17')](function(_0xcc7a79){if(_0xcc7a79){_0xcc7a79['update']({'lastMsgAt':_0x37735f[_0x2aab('0x18')],'lastMsgDirection':_0x37735f['direction']['toLowerCase']()});}})[_0x2aab('0x19')](function(_0xe96ab5){console['error'](_0xe96ab5);});}if(_0x37735f[_0x2aab('0x13')]===_0x2aab('0x1a')&&!_0x37735f[_0x2aab('0x14')]){var _0x28b3af;_0x350a70[_0x2aab('0x1b')][_0x2aab('0x1c')]({'where':{'id':_0x37735f[_0x2aab('0x1d')]},'raw':!![]})[_0x2aab('0x17')](function(_0x20bc22){_0x28b3af=_0x20bc22;if(_0x28b3af&&_0x28b3af['type']){switch(_0x28b3af[_0x2aab('0x1e')]){case _0x2aab('0x1f'):var _0x1015aa=require(_0x2aab('0x1f'));if(_0x28b3af[_0x2aab('0x20')]&&_0x28b3af[_0x2aab('0x21')]&&_0x28b3af['phone']){var _0x5bbebb=new _0x1015aa(_0x28b3af[_0x2aab('0x20')],_0x28b3af[_0x2aab('0x21')]);_0x5bbebb[_0x2aab('0x22')]['create']({'body':_0x37735f[_0x2aab('0xe')],'to':_0x2aab('0x23')+_0x37735f[_0x2aab('0x24')],'from':'whatsapp:'+_0x28b3af[_0x2aab('0x24')],'statusCallback':_0x28b3af[_0x2aab('0x25')]+'/api/whatsapp/messages/'+_0x37735f['id']+_0x2aab('0x26')+_0x28b3af[_0x2aab('0x27')]})[_0x2aab('0x17')](function(_0x833a09){if(_0x833a09[_0x2aab('0x28')]){return _0x5add48['update']({'messageId':_0x833a09['sid']});}})[_0x2aab('0x19')](function(_0x701383){logger[_0x2aab('0x29')](_0x2aab('0x2a'),_0x2aab('0x2b'),_0x2aab('0x1f'),util['inspect'](_0x701383,{'showHidden':![],'depth':null}));});}else{logger[_0x2aab('0x29')](_0x2aab('0x2a'),'afterCreate',_0x2aab('0x1f'),_0x2aab('0x2c'));}break;case _0x2aab('0x2d'):var _0x8d2294=_0x28b3af[_0x2aab('0x20')];var _0x9a643b=_0x28b3af[_0x2aab('0x21')];var _0x5e39d1=_0x28b3af[_0x2aab('0x2e')]+'/whatsapp/v1/'+_0x8d2294+_0x2aab('0x2f');var _0x1b445d={'to':[_0x37735f['phone']],'message':{'type':_0x2aab('0x30'),'text':_0x37735f[_0x2aab('0xe')]}};var _0x1b3429={'method':_0x2aab('0x31'),'uri':_0x5e39d1,'headers':{'Authorization':_0x2aab('0x32')+_0x9a643b,'Content-Type':'application/json'},'body':_0x1b445d,'json':!![]};rp(_0x1b3429)[_0x2aab('0x17')](function(_0x5483f2){if(_0x5483f2[_0x2aab('0x33')][0x0]['message_id']){return _0x5add48[_0x2aab('0x34')]({'messageId':_0x5483f2[_0x2aab('0x33')][0x0][_0x2aab('0x35')]});}})[_0x2aab('0x19')](function(_0x378510){logger[_0x2aab('0x36')](_0x2aab('0x37'),_0x378510);});break;}}})[_0x2aab('0x38')](function(){_0x2b2215();});}else{_0x2b2215();}}},'charset':_0x2aab('0x39'),'collate':_0x2aab('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 7099da5..f3847f4 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 _0x854e=['request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register'];(function(_0x5df5c9,_0x5961cc){var _0x394816=function(_0x4f7588){while(--_0x4f7588){_0x5df5c9['push'](_0x5df5c9['shift']());}};_0x394816(++_0x5961cc);}(_0x854e,0xb2));var _0xe854=function(_0x5137dd,_0x55c6cb){_0x5137dd=_0x5137dd-0x0;var _0x11dea6=_0x854e[_0x5137dd];return _0x11dea6;};'use strict';var _=require('lodash');var util=require(_0xe854('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe854('0x1'));var fs=require('fs');var Redis=require(_0xe854('0x2'));var db=require(_0xe854('0x3'))['db'];var utils=require(_0xe854('0x4'));var logger=require(_0xe854('0x5'))(_0xe854('0x6'));var config=require(_0xe854('0x7'));var jayson=require(_0xe854('0x8'));var client=jayson[_0xe854('0x9')]['http']({'port':0x232a});config[_0xe854('0xa')]=_['defaults'](config['redis'],{'host':_0xe854('0xb'),'port':0x18eb});var socket=require(_0xe854('0xc'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xe854('0xd')](socket);function respondWithRpcPromise(_0x5ec9c4,_0x3f3ab7,_0xd0e2c1){return new BPromise(function(_0x1f8f40,_0x52cc8a){return client[_0xe854('0xe')](_0x5ec9c4,_0xd0e2c1)[_0xe854('0xf')](function(_0x1e28aa){logger[_0xe854('0x10')](_0xe854('0x11'),_0x3f3ab7,_0xe854('0x12'));logger[_0xe854('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3f3ab7,_0xe854('0x12'),JSON[_0xe854('0x14')](_0x1e28aa));if(_0x1e28aa[_0xe854('0x15')]){if(_0x1e28aa[_0xe854('0x15')][_0xe854('0x16')]===0x1f4){logger['error'](_0xe854('0x11'),_0x3f3ab7,_0x1e28aa[_0xe854('0x15')][_0xe854('0x17')]);return _0x52cc8a(_0x1e28aa[_0xe854('0x15')]['message']);}logger[_0xe854('0x15')](_0xe854('0x11'),_0x3f3ab7,_0x1e28aa[_0xe854('0x15')]['message']);return _0x1f8f40(_0x1e28aa[_0xe854('0x15')][_0xe854('0x17')]);}else{logger[_0xe854('0x10')](_0xe854('0x11'),_0x3f3ab7,_0xe854('0x12'));_0x1f8f40(_0x1e28aa[_0xe854('0x18')]['message']);}})[_0xe854('0x19')](function(_0x52cc8f){logger['error'](_0xe854('0x11'),_0x3f3ab7,_0x52cc8f);_0x52cc8a(_0x52cc8f);});});}exports[_0xe854('0x1a')]=function(_0x24fd5e){var _0x12e5d3=this;return new Promise(function(_0xbe4c65,_0x340db3){return db[_0xe854('0x1b')][_0xe854('0x1c')](_0x24fd5e[_0xe854('0x1d')],{'raw':_0x24fd5e[_0xe854('0x1e')]?_0x24fd5e['options'][_0xe854('0x1f')]===undefined?!![]:![]:!![]})[_0xe854('0xf')](function(_0xec68b8){logger[_0xe854('0x10')]('CreateWhatsappMessage',_0x24fd5e);logger[_0xe854('0x13')](_0xe854('0x1a'),_0x24fd5e,JSON['stringify'](_0xec68b8));_0xbe4c65(_0xec68b8);})[_0xe854('0x19')](function(_0x37d451){logger[_0xe854('0x15')](_0xe854('0x1a'),_0x37d451[_0xe854('0x17')],_0x24fd5e);_0x340db3(_0x12e5d3['error'](0x1f4,_0x37d451['message']));});});}; \ No newline at end of file +var _0x30d4=['raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x30d4,0x1d2));var _0x430d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x30d4[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x430d('0x0'));var util=require(_0x430d('0x1'));var moment=require(_0x430d('0x2'));var BPromise=require(_0x430d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x430d('0x4'));var db=require(_0x430d('0x5'))['db'];var utils=require(_0x430d('0x6'));var logger=require(_0x430d('0x7'))(_0x430d('0x8'));var config=require(_0x430d('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x430d('0xa')]=_[_0x430d('0xb')](config[_0x430d('0xa')],{'host':_0x430d('0xc'),'port':0x18eb});var socket=require(_0x430d('0xd'))(new Redis(config[_0x430d('0xa')]));require('./whatsappMessage.socket')[_0x430d('0xe')](socket);function respondWithRpcPromise(_0x7eb129,_0x33d19b,_0x3b05a2){return new BPromise(function(_0x30964d,_0x3051df){return client[_0x430d('0xf')](_0x7eb129,_0x3b05a2)['then'](function(_0x1cc145){logger[_0x430d('0x10')](_0x430d('0x11'),_0x33d19b,_0x430d('0x12'));logger[_0x430d('0x13')](_0x430d('0x14'),_0x33d19b,_0x430d('0x12'),JSON[_0x430d('0x15')](_0x1cc145));if(_0x1cc145['error']){if(_0x1cc145['error']['code']===0x1f4){logger['error'](_0x430d('0x11'),_0x33d19b,_0x1cc145[_0x430d('0x16')]['message']);return _0x3051df(_0x1cc145[_0x430d('0x16')][_0x430d('0x17')]);}logger['error'](_0x430d('0x11'),_0x33d19b,_0x1cc145[_0x430d('0x16')][_0x430d('0x17')]);return _0x30964d(_0x1cc145[_0x430d('0x16')][_0x430d('0x17')]);}else{logger['info'](_0x430d('0x11'),_0x33d19b,_0x430d('0x12'));_0x30964d(_0x1cc145[_0x430d('0x18')][_0x430d('0x17')]);}})[_0x430d('0x19')](function(_0x5b63b8){logger[_0x430d('0x16')](_0x430d('0x11'),_0x33d19b,_0x5b63b8);_0x3051df(_0x5b63b8);});});}exports[_0x430d('0x1a')]=function(_0x4f6a92){var _0x48a37d=this;return new Promise(function(_0x1694db,_0x17e3f6){return db[_0x430d('0x1b')][_0x430d('0x1c')](_0x4f6a92['body'],{'raw':_0x4f6a92[_0x430d('0x1d')]?_0x4f6a92[_0x430d('0x1d')][_0x430d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x589611){logger['info'](_0x430d('0x1a'),_0x4f6a92);logger[_0x430d('0x13')]('CreateWhatsappMessage',_0x4f6a92,JSON['stringify'](_0x589611));_0x1694db(_0x589611);})['catch'](function(_0x14854e){logger['error']('CreateWhatsappMessage',_0x14854e['message'],_0x4f6a92);_0x17e3f6(_0x48a37d[_0x430d('0x16')](0x1f4,_0x14854e[_0x430d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 70bc5c1..fe406bd 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 _0x15bf=['remove','update','emit','register','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x20dedb,_0x51d614){var _0x14df1c=function(_0x1b4301){while(--_0x1b4301){_0x20dedb['push'](_0x20dedb['shift']());}};_0x14df1c(++_0x51d614);}(_0x15bf,0x18d));var _0xf15b=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x15bf[_0xe15270];return _0x1e813b;};'use strict';var WhatsappMessageEvents=require(_0xf15b('0x0'));var events=[_0xf15b('0x1'),_0xf15b('0x2'),_0xf15b('0x3')];function createListener(_0xd05b8e,_0x2523c2){return function(_0x17d849){_0x2523c2[_0xf15b('0x4')](_0xd05b8e,_0x17d849);};}function removeListener(_0x21e467,_0x35c91a){return function(){WhatsappMessageEvents['removeListener'](_0x21e467,_0x35c91a);};}exports[_0xf15b('0x5')]=function(_0x17db88){for(var _0x4f7417=0x0,_0x244ddc=events['length'];_0x4f7417<_0x244ddc;_0x4f7417++){var _0x16c4d5=events[_0x4f7417];var _0xb3a46d=createListener(_0xf15b('0x6')+_0x16c4d5,_0x17db88);WhatsappMessageEvents['on'](_0x16c4d5,_0xb3a46d);}}; \ No newline at end of file +var _0xb562=['removeListener','length','whatsappMessage:','save','remove','update'];(function(_0x207411,_0x510818){var _0x421e8d=function(_0x1459e3){while(--_0x1459e3){_0x207411['push'](_0x207411['shift']());}};_0x421e8d(++_0x510818);}(_0xb562,0x123));var _0x2b56=function(_0x503ba3,_0x156308){_0x503ba3=_0x503ba3-0x0;var _0x56ecea=_0xb562[_0x503ba3];return _0x56ecea;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x2b56('0x0'),_0x2b56('0x1'),_0x2b56('0x2')];function createListener(_0x39fe1d,_0x30c15a){return function(_0x2c2b9e){_0x30c15a['emit'](_0x39fe1d,_0x2c2b9e);};}function removeListener(_0x4c6d0e,_0x94e837){return function(){WhatsappMessageEvents[_0x2b56('0x3')](_0x4c6d0e,_0x94e837);};}exports['register']=function(_0x42a390){for(var _0x1ac9c2=0x0,_0x37a3b9=events[_0x2b56('0x4')];_0x1ac9c2<_0x37a3b9;_0x1ac9c2++){var _0x4d028f=events[_0x1ac9c2];var _0x3a7801=createListener(_0x2b56('0x5')+_0x4d028f,_0x42a390);WhatsappMessageEvents['on'](_0x4d028f,_0x3a7801);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 636cc76..1be2d46 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 _0x382b=['delete','/:id/teams','removeTeams','removeAgents','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','addTeams','addAgents','put','update'];(function(_0x3adf4e,_0x26d25f){var _0x4dc28b=function(_0x38d031){while(--_0x38d031){_0x3adf4e['push'](_0x3adf4e['shift']());}};_0x4dc28b(++_0x26d25f);}(_0x382b,0x11c));var _0xb382=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x382b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb382('0x0'));var util=require(_0xb382('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb382('0x2'));var router=express[_0xb382('0x3')]();var fs_extra=require(_0xb382('0x4'));var auth=require(_0xb382('0x5'));var interaction=require(_0xb382('0x6'));var config=require(_0xb382('0x7'));var controller=require(_0xb382('0x8'));router[_0xb382('0x9')]('/',auth[_0xb382('0xa')](),controller[_0xb382('0xb')]);router[_0xb382('0x9')]('/describe',auth[_0xb382('0xa')](),controller[_0xb382('0xc')]);router[_0xb382('0x9')](_0xb382('0xd'),auth[_0xb382('0xa')](),controller[_0xb382('0xe')]);router[_0xb382('0x9')](_0xb382('0xf'),auth['isAuthenticated'](),controller[_0xb382('0x10')]);router[_0xb382('0x9')]('/:id/teams',auth[_0xb382('0xa')](),controller['getTeams']);router['get'](_0xb382('0x11'),auth[_0xb382('0xa')](),controller[_0xb382('0x12')]);router['post']('/',auth[_0xb382('0xa')](),controller['create']);router[_0xb382('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb382('0x14')]);router[_0xb382('0x13')](_0xb382('0x11'),auth[_0xb382('0xa')](),controller[_0xb382('0x15')]);router[_0xb382('0x16')](_0xb382('0xd'),auth[_0xb382('0xa')](),controller[_0xb382('0x17')]);router['delete'](_0xb382('0xd'),auth[_0xb382('0xa')](),controller['destroy']);router[_0xb382('0x18')](_0xb382('0x19'),auth[_0xb382('0xa')](),controller[_0xb382('0x1a')]);router[_0xb382('0x18')]('/:id/users',auth[_0xb382('0xa')](),controller[_0xb382('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x807a=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x15d6d4,_0x4f2fab){var _0x54cc7c=function(_0x1d0aff){while(--_0x1d0aff){_0x15d6d4['push'](_0x15d6d4['shift']());}};_0x54cc7c(++_0x4f2fab);}(_0x807a,0x16a));var _0xa807=function(_0x211911,_0x348fdb){_0x211911=_0x211911-0x0;var _0x3d40c8=_0x807a[_0x211911];return _0x3d40c8;};'use strict';var multer=require(_0xa807('0x0'));var util=require(_0xa807('0x1'));var path=require(_0xa807('0x2'));var timeout=require(_0xa807('0x3'));var express=require('express');var router=express[_0xa807('0x4')]();var fs_extra=require(_0xa807('0x5'));var auth=require(_0xa807('0x6'));var interaction=require(_0xa807('0x7'));var config=require(_0xa807('0x8'));var controller=require(_0xa807('0x9'));router[_0xa807('0xa')]('/',auth[_0xa807('0xb')](),controller[_0xa807('0xc')]);router[_0xa807('0xa')](_0xa807('0xd'),auth[_0xa807('0xb')](),controller['describe']);router[_0xa807('0xa')](_0xa807('0xe'),auth[_0xa807('0xb')](),controller[_0xa807('0xf')]);router[_0xa807('0xa')](_0xa807('0x10'),auth[_0xa807('0xb')](),controller[_0xa807('0x11')]);router[_0xa807('0xa')](_0xa807('0x12'),auth[_0xa807('0xb')](),controller[_0xa807('0x13')]);router[_0xa807('0xa')](_0xa807('0x14'),auth['isAuthenticated'](),controller[_0xa807('0x15')]);router[_0xa807('0x16')]('/',auth[_0xa807('0xb')](),controller[_0xa807('0x17')]);router[_0xa807('0x16')]('/:id/teams',auth[_0xa807('0xb')](),controller[_0xa807('0x18')]);router[_0xa807('0x16')](_0xa807('0x14'),auth[_0xa807('0xb')](),controller[_0xa807('0x19')]);router[_0xa807('0x1a')](_0xa807('0xe'),auth[_0xa807('0xb')](),controller['update']);router[_0xa807('0x1b')](_0xa807('0xe'),auth[_0xa807('0xb')](),controller['destroy']);router[_0xa807('0x1b')](_0xa807('0x12'),auth[_0xa807('0xb')](),controller[_0xa807('0x1c')]);router[_0xa807('0x1b')](_0xa807('0x14'),auth[_0xa807('0xb')](),controller[_0xa807('0x1d')]);module[_0xa807('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 4afdebe..df6739e 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 _0xe130=['exports','name','INTEGER','ENUM','rrmemory','beepall','STRING','sequelize'];(function(_0x70fa81,_0x5568a1){var _0x3c3bb0=function(_0x48ddab){while(--_0x48ddab){_0x70fa81['push'](_0x70fa81['shift']());}};_0x3c3bb0(++_0x5568a1);}(_0xe130,0x127));var _0x0e13=function(_0x319b19,_0x161f8b){_0x319b19=_0x319b19-0x0;var _0x1cf1d6=_0xe130[_0x319b19];return _0x1cf1d6;};'use strict';var Sequelize=require(_0x0e13('0x0'));module[_0x0e13('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0e13('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0e13('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e13('0x4')](_0x0e13('0x5'),_0x0e13('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x0e13('0x7')]}}; \ No newline at end of file +var _0x6953=['STRING','sequelize','exports','ENUM','beepall','roundrobin'];(function(_0x3ccac1,_0x5cc7ea){var _0x10b20b=function(_0x4ed4f5){while(--_0x4ed4f5){_0x3ccac1['push'](_0x3ccac1['shift']());}};_0x10b20b(++_0x5cc7ea);}(_0x6953,0x91));var _0x3695=function(_0x55aa15,_0x203620){_0x55aa15=_0x55aa15-0x0;var _0x3d7314=_0x6953[_0x55aa15];return _0x3d7314;};'use strict';var Sequelize=require(_0x3695('0x0'));module[_0x3695('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3695('0x2')]('rrmemory',_0x3695('0x3'),_0x3695('0x4'))},'description':{'type':Sequelize[_0x3695('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index c3ee811..79f3bdd 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 _0x7e82=['count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','WhatsappQueues','UserProfileResource','then','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','pick','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','User','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','status','end','undefined','limit'];(function(_0xbf8ef7,_0x572615){var _0x3314ae=function(_0xbdee95){while(--_0xbdee95){_0xbf8ef7['push'](_0xbf8ef7['shift']());}};_0x3314ae(++_0x572615);}(_0x7e82,0x181));var _0x27e8=function(_0x4bf126,_0x1b1498){_0x4bf126=_0x4bf126-0x0;var _0x12aa0e=_0x7e82[_0x4bf126];return _0x12aa0e;};'use strict';var emlformat=require(_0x27e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x27e8('0x1'));var jsonpatch=require(_0x27e8('0x2'));var rp=require(_0x27e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x27e8('0x4'));var util=require('util');var path=require(_0x27e8('0x5'));var sox=require(_0x27e8('0x6'));var csv=require(_0x27e8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27e8('0x8'));var squel=require(_0x27e8('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x27e8('0x7'));var querystring=require(_0x27e8('0xa'));var Papa=require(_0x27e8('0xb'));var Redis=require(_0x27e8('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x27e8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x27e8('0xe'));var utils=require(_0x27e8('0xf'));var config=require(_0x27e8('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x27e8('0x11')]=_[_0x27e8('0x12')](config[_0x27e8('0x11')],{'host':_0x27e8('0x13'),'port':0x18eb});var socket=require(_0x27e8('0x14'))(new Redis(config[_0x27e8('0x11')]));require(_0x27e8('0x15'))['register'](socket);function respondWithStatusCode(_0x3ad51d,_0x450c6f){_0x450c6f=_0x450c6f||0xcc;return function(_0x55622c){if(_0x55622c){return _0x3ad51d['sendStatus'](_0x450c6f);}return _0x3ad51d[_0x27e8('0x16')](_0x450c6f)[_0x27e8('0x17')]();};}function respondWithResult(_0x2f4c6f,_0x2ccc18){_0x2ccc18=_0x2ccc18||0xc8;return function(_0x37da0b){if(_0x37da0b){return _0x2f4c6f['status'](_0x2ccc18)['json'](_0x37da0b);}};}function respondWithFilteredResult(_0x2f64f9,_0x3b4ddb){return function(_0x2fed85){if(_0x2fed85){var _0x4d8803=typeof _0x3b4ddb['offset']===_0x27e8('0x18')&&typeof _0x3b4ddb[_0x27e8('0x19')]==='undefined';var _0x32f620=_0x2fed85[_0x27e8('0x1a')];var _0x307c23=_0x4d8803?0x0:_0x3b4ddb[_0x27e8('0x1b')];var _0x1edace=_0x4d8803?_0x2fed85['count']:_0x3b4ddb[_0x27e8('0x1b')]+_0x3b4ddb[_0x27e8('0x19')];var _0x102e0;if(_0x1edace>=_0x32f620){_0x1edace=_0x32f620;_0x102e0=0xc8;}else{_0x102e0=0xce;}_0x2f64f9[_0x27e8('0x16')](_0x102e0);return _0x2f64f9[_0x27e8('0x1c')](_0x27e8('0x1d'),_0x307c23+'-'+_0x1edace+'/'+_0x32f620)[_0x27e8('0x1e')](_0x2fed85);}return null;};}function patchUpdates(_0x219a1c){return function(_0x3eec0f){try{jsonpatch[_0x27e8('0x1f')](_0x3eec0f,_0x219a1c,!![]);}catch(_0x57fb82){return BPromise[_0x27e8('0x20')](_0x57fb82);}return _0x3eec0f[_0x27e8('0x21')]();};}function saveUpdates(_0x2c8185,_0x413e2d){return function(_0x1cf3cb){if(_0x1cf3cb){return _0x1cf3cb[_0x27e8('0x22')](_0x2c8185)['then'](function(_0x488d89){return _0x488d89;});}return null;};}function removeEntity(_0x47e0e6,_0x1e92f9){return function(_0x3f8adb){if(_0x3f8adb){return _0x3f8adb[_0x27e8('0x23')]()['then'](function(){var _0x3e4abb=_0x3f8adb[_0x27e8('0x24')]({'plain':!![]});var _0x1d11c1=_0x27e8('0x25');return db[_0x27e8('0x26')]['destroy']({'where':{'type':_0x1d11c1,'resourceId':_0x3e4abb['id']}})[_0x27e8('0x27')](function(){return _0x3f8adb;});})['then'](function(){_0x47e0e6[_0x27e8('0x16')](0xcc)[_0x27e8('0x17')]();});}};}function handleEntityNotFound(_0x21fd20,_0x359e3e){return function(_0x1cfa41){if(!_0x1cfa41){_0x21fd20['sendStatus'](0x194);}return _0x1cfa41;};}function handleError(_0x306ce0,_0x554bb0){_0x554bb0=_0x554bb0||0x1f4;return function(_0x1e011f){logger[_0x27e8('0x28')](_0x1e011f[_0x27e8('0x29')]);if(_0x1e011f[_0x27e8('0x2a')]){delete _0x1e011f['name'];}_0x306ce0[_0x27e8('0x16')](_0x554bb0)[_0x27e8('0x2b')](_0x1e011f);};}exports[_0x27e8('0x2c')]=function(_0x53e634,_0x193e32){var _0x4a3657={},_0x52d102={},_0x174a4f={'count':0x0,'rows':[]};var _0x498a29=_[_0x27e8('0x2d')](db[_0x27e8('0x2e')][_0x27e8('0x2f')],function(_0x49438a){return{'name':_0x49438a[_0x27e8('0x30')],'type':_0x49438a[_0x27e8('0x31')][_0x27e8('0x32')]};});_0x52d102[_0x27e8('0x33')]=_[_0x27e8('0x2d')](_0x498a29,_0x27e8('0x2a'));_0x52d102[_0x27e8('0x34')]=_[_0x27e8('0x35')](_0x53e634[_0x27e8('0x34')]);_0x52d102[_0x27e8('0x36')]=_[_0x27e8('0x37')](_0x52d102[_0x27e8('0x33')],_0x52d102[_0x27e8('0x34')]);_0x4a3657[_0x27e8('0x38')]=_[_0x27e8('0x37')](_0x52d102[_0x27e8('0x33')],qs[_0x27e8('0x39')](_0x53e634[_0x27e8('0x34')][_0x27e8('0x39')]));_0x4a3657[_0x27e8('0x38')]=_0x4a3657[_0x27e8('0x38')][_0x27e8('0x3a')]?_0x4a3657[_0x27e8('0x38')]:_0x52d102[_0x27e8('0x33')];if(!_0x53e634['query'][_0x27e8('0x3b')](_0x27e8('0x3c'))){_0x4a3657[_0x27e8('0x19')]=qs['limit'](_0x53e634[_0x27e8('0x34')][_0x27e8('0x19')]);_0x4a3657[_0x27e8('0x1b')]=qs[_0x27e8('0x1b')](_0x53e634[_0x27e8('0x34')][_0x27e8('0x1b')]);}_0x4a3657[_0x27e8('0x3d')]=qs[_0x27e8('0x3e')](_0x53e634['query']['sort']);_0x4a3657[_0x27e8('0x3f')]=qs['filters'](_['pick'](_0x53e634[_0x27e8('0x34')],_0x52d102['filters']),_0x498a29);if(_0x53e634['query'][_0x27e8('0x40')]){_0x4a3657[_0x27e8('0x3f')]=_[_0x27e8('0x41')](_0x4a3657[_0x27e8('0x3f')],{'$or':_[_0x27e8('0x2d')](_0x498a29,function(_0x5c9b06){if(_0x5c9b06['type']!==_0x27e8('0x42')){var _0x430b72={};_0x430b72[_0x5c9b06[_0x27e8('0x2a')]]={'$like':'%'+_0x53e634['query'][_0x27e8('0x40')]+'%'};return _0x430b72;}})});}_0x4a3657=_[_0x27e8('0x41')]({},_0x4a3657,_0x53e634[_0x27e8('0x43')]);var _0x369fae={'where':_0x4a3657[_0x27e8('0x3f')]};return db['WhatsappQueue'][_0x27e8('0x1a')](_0x369fae)[_0x27e8('0x27')](function(_0x41f1be){_0x174a4f[_0x27e8('0x1a')]=_0x41f1be;if(_0x53e634['query'][_0x27e8('0x44')]){_0x4a3657[_0x27e8('0x45')]=[{'all':!![]}];}return db[_0x27e8('0x2e')][_0x27e8('0x46')](_0x4a3657);})['then'](function(_0x5cb6ca){_0x174a4f[_0x27e8('0x47')]=_0x5cb6ca;return _0x174a4f;})[_0x27e8('0x27')](respondWithFilteredResult(_0x193e32,_0x4a3657))[_0x27e8('0x48')](handleError(_0x193e32,null));};exports['show']=function(_0x545d37,_0x3fed90){var _0x45f50b={'raw':!![],'where':{'id':_0x545d37[_0x27e8('0x49')]['id']}},_0x29a5c9={};_0x29a5c9['model']=_[_0x27e8('0x35')](db[_0x27e8('0x2e')][_0x27e8('0x2f')]);_0x29a5c9[_0x27e8('0x34')]=_['keys'](_0x545d37[_0x27e8('0x34')]);_0x29a5c9['filters']=_[_0x27e8('0x37')](_0x29a5c9[_0x27e8('0x33')],_0x29a5c9[_0x27e8('0x34')]);_0x45f50b[_0x27e8('0x38')]=_[_0x27e8('0x37')](_0x29a5c9[_0x27e8('0x33')],qs['fields'](_0x545d37['query'][_0x27e8('0x39')]));_0x45f50b[_0x27e8('0x38')]=_0x45f50b['attributes'][_0x27e8('0x3a')]?_0x45f50b[_0x27e8('0x38')]:_0x29a5c9[_0x27e8('0x33')];if(_0x545d37[_0x27e8('0x34')][_0x27e8('0x44')]){_0x45f50b[_0x27e8('0x45')]=[{'all':!![]}];}_0x45f50b=_['merge']({},_0x45f50b,_0x545d37[_0x27e8('0x43')]);return db['WhatsappQueue'][_0x27e8('0x4a')](_0x45f50b)['then'](handleEntityNotFound(_0x3fed90,null))[_0x27e8('0x27')](respondWithResult(_0x3fed90,null))[_0x27e8('0x48')](handleError(_0x3fed90,null));};exports[_0x27e8('0x4b')]=function(_0x4a3bfb,_0x472485){return db['WhatsappQueue'][_0x27e8('0x4b')](_0x4a3bfb[_0x27e8('0x4c')],{})['then'](function(_0x39e8d9){var _0x5c1ad1=_0x4a3bfb[_0x27e8('0x4d')][_0x27e8('0x24')]({'plain':!![]});if(!_0x5c1ad1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c1ad1[_0x27e8('0x4e')]===_0x27e8('0x4d')){var _0x57360d=_0x39e8d9['get']({'plain':!![]});var _0x3e9724=_0x27e8('0x25');return db[_0x27e8('0x4f')][_0x27e8('0x4a')]({'where':{'name':_0x3e9724,'userProfileId':_0x5c1ad1[_0x27e8('0x50')]},'raw':!![]})[_0x27e8('0x27')](function(_0x320a26){if(_0x320a26&&_0x320a26[_0x27e8('0x51')]===0x0){return db[_0x27e8('0x26')][_0x27e8('0x4b')]({'name':_0x57360d[_0x27e8('0x2a')],'resourceId':_0x57360d['id'],'type':_0x320a26[_0x27e8('0x2a')],'sectionId':_0x320a26['id']},{})[_0x27e8('0x27')](function(){return _0x39e8d9;});}else{return _0x39e8d9;}})[_0x27e8('0x48')](function(_0x22ef0d){logger[_0x27e8('0x28')](_0x27e8('0x52'),_0x22ef0d);throw _0x22ef0d;});}return _0x39e8d9;})[_0x27e8('0x27')](respondWithResult(_0x472485,0xc9))[_0x27e8('0x48')](handleError(_0x472485,null));};exports[_0x27e8('0x22')]=function(_0x230f4c,_0x239909){if(_0x230f4c[_0x27e8('0x4c')]['id']){delete _0x230f4c['body']['id'];}return db[_0x27e8('0x2e')][_0x27e8('0x4a')]({'where':{'id':_0x230f4c['params']['id']}})[_0x27e8('0x27')](handleEntityNotFound(_0x239909,null))['then'](saveUpdates(_0x230f4c['body'],null))[_0x27e8('0x27')](respondWithResult(_0x239909,null))[_0x27e8('0x48')](handleError(_0x239909,null));};exports['destroy']=function(_0x578342,_0x90e329){return db[_0x27e8('0x2e')][_0x27e8('0x4a')]({'where':{'id':_0x578342[_0x27e8('0x49')]['id']}})[_0x27e8('0x27')](handleEntityNotFound(_0x90e329,null))[_0x27e8('0x27')](removeEntity(_0x90e329,null))[_0x27e8('0x48')](handleError(_0x90e329,null));};exports[_0x27e8('0x53')]=function(_0x557a5f,_0x3937e9){return db[_0x27e8('0x2e')]['describe']()[_0x27e8('0x27')](respondWithResult(_0x3937e9,null))[_0x27e8('0x48')](handleError(_0x3937e9,null));};exports['getMembers']=function(_0x3da926,_0x7ec457,_0xd23240){var _0x38af4c={'raw':!![],'where':{}},_0x4cf1b3={},_0x45ec96;return db[_0x27e8('0x2e')][_0x27e8('0x54')]({'where':{'id':_0x3da926[_0x27e8('0x49')]['id']}})[_0x27e8('0x27')](handleEntityNotFound(_0x7ec457,null))[_0x27e8('0x27')](function(_0x460cfe){if(_0x460cfe){_0x45ec96=_0x460cfe[_0x27e8('0x24')]({'plain':!![]});_0x4cf1b3[_0x27e8('0x33')]=_['keys'](db[_0x27e8('0x55')][_0x27e8('0x2f')]);_0x4cf1b3[_0x27e8('0x34')]=_[_0x27e8('0x35')](_0x3da926[_0x27e8('0x34')]);_0x4cf1b3['filters']=_[_0x27e8('0x37')](_0x4cf1b3[_0x27e8('0x33')],_0x4cf1b3[_0x27e8('0x34')]);_0x38af4c[_0x27e8('0x38')]=_['intersection'](_0x4cf1b3['model'],qs[_0x27e8('0x39')](_0x3da926[_0x27e8('0x34')][_0x27e8('0x39')]));_0x38af4c['attributes']=_0x38af4c[_0x27e8('0x38')][_0x27e8('0x3a')]?_0x38af4c[_0x27e8('0x38')]:_0x4cf1b3[_0x27e8('0x33')];if(!_0x3da926['query']['hasOwnProperty']('nolimit')){_0x38af4c['limit']=qs[_0x27e8('0x19')](_0x3da926['query'][_0x27e8('0x19')]);_0x38af4c[_0x27e8('0x1b')]=qs[_0x27e8('0x1b')](_0x3da926['query'][_0x27e8('0x1b')]);}_0x38af4c[_0x27e8('0x3d')]=qs['sort'](_0x3da926[_0x27e8('0x34')][_0x27e8('0x3e')]);_0x38af4c['where']=qs[_0x27e8('0x36')](_[_0x27e8('0x56')](_0x3da926[_0x27e8('0x34')],_0x4cf1b3[_0x27e8('0x36')]));_0x38af4c[_0x27e8('0x3f')]['WhatsappQueueId']=_0x460cfe['id'];if(_0x3da926['query']['filter']){_0x38af4c['where']=_[_0x27e8('0x41')](_0x38af4c[_0x27e8('0x3f')],{'$or':_['map'](_0x38af4c['attributes'],function(_0x372144){var _0x1eda9a={};_0x1eda9a[_0x372144]={'$like':'%'+_0x3da926[_0x27e8('0x34')][_0x27e8('0x40')]+'%'};return _0x1eda9a;})});}_0x38af4c=_[_0x27e8('0x41')]({},_0x38af4c,_0x3da926['options']);return db[_0x27e8('0x55')][_0x27e8('0x46')](_0x38af4c);}})['then'](function(_0xaa4688){if(_0xaa4688){return db['User'][_0x27e8('0x57')]({'where':{'id':_[_0x27e8('0x2d')](_0xaa4688,_0x27e8('0x58')),'role':_0x27e8('0x59')},'attributes':['id',_0x27e8('0x2a'),_0x27e8('0x5a'),_0x27e8('0x5b'),_0x27e8('0x5c')]});}})['then'](function(_0x404194){if(_0x404194){return{'count':_0x404194[_0x27e8('0x1a')],'rows':_[_0x27e8('0x2d')](_0x404194['rows'],function(_0x1c517c){return{'membername':_0x1c517c[_0x27e8('0x2a')],'UserId':_0x1c517c['id'],'queue_name':_0x45ec96['name'],'WhatsappQueueId':_0x45ec96['id'],'interface':util[_0x27e8('0x5d')]('%s/%s',_0x27e8('0x5e'),_0x1c517c['name']),'penalty':0x0,'paused':_0x1c517c[_0x27e8('0x5a')],'createdAt':_0x1c517c[_0x27e8('0x5c')],'updatedAt':_0x1c517c[_0x27e8('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x27e8('0x27')](respondWithFilteredResult(_0x7ec457,_0x38af4c))[_0x27e8('0x48')](handleError(_0x7ec457,null));};exports[_0x27e8('0x5f')]=function(_0x378921,_0x367f95,_0x3c063f){var _0x27c885={};var _0x1e6dd5={};var _0x636479;var _0x4bf255;return db[_0x27e8('0x2e')][_0x27e8('0x54')]({'where':{'id':_0x378921[_0x27e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x367f95,null))[_0x27e8('0x27')](function(_0x1b2e0f){if(_0x1b2e0f){_0x636479=_0x1b2e0f;_0x1e6dd5[_0x27e8('0x33')]=_[_0x27e8('0x35')](db[_0x27e8('0x60')][_0x27e8('0x2f')]);_0x1e6dd5[_0x27e8('0x34')]=_[_0x27e8('0x35')](_0x378921[_0x27e8('0x34')]);_0x1e6dd5[_0x27e8('0x36')]=_[_0x27e8('0x37')](_0x1e6dd5[_0x27e8('0x33')],_0x1e6dd5[_0x27e8('0x34')]);_0x27c885[_0x27e8('0x38')]=_[_0x27e8('0x37')](_0x1e6dd5['model'],qs[_0x27e8('0x39')](_0x378921['query'][_0x27e8('0x39')]));_0x27c885['attributes']=_0x27c885[_0x27e8('0x38')]['length']?_0x27c885[_0x27e8('0x38')]:_0x1e6dd5[_0x27e8('0x33')];_0x27c885[_0x27e8('0x3d')]=qs[_0x27e8('0x3e')](_0x378921['query'][_0x27e8('0x3e')]);_0x27c885[_0x27e8('0x3f')]=qs['filters'](_[_0x27e8('0x56')](_0x378921[_0x27e8('0x34')],_0x1e6dd5[_0x27e8('0x36')]));if(_0x378921['query']['filter']){_0x27c885[_0x27e8('0x3f')]=_[_0x27e8('0x41')](_0x27c885[_0x27e8('0x3f')],{'$or':_[_0x27e8('0x2d')](_0x27c885[_0x27e8('0x38')],function(_0x32c256){var _0x31f59b={};_0x31f59b[_0x32c256]={'$like':'%'+_0x378921[_0x27e8('0x34')][_0x27e8('0x40')]+'%'};return _0x31f59b;})});}_0x27c885=_['merge']({},_0x27c885,_0x378921[_0x27e8('0x43')]);return _0x636479['getTeams'](_0x27c885);}})[_0x27e8('0x27')](function(_0xad0900){if(_0xad0900){_0x4bf255=_0xad0900[_0x27e8('0x3a')];if(!_0x378921[_0x27e8('0x34')][_0x27e8('0x3b')]('nolimit')){_0x27c885['limit']=qs[_0x27e8('0x19')](_0x378921['query'][_0x27e8('0x19')]);_0x27c885[_0x27e8('0x1b')]=qs['offset'](_0x378921['query']['offset']);}return _0x636479[_0x27e8('0x5f')](_0x27c885);}})[_0x27e8('0x27')](function(_0x2fab4a){if(_0x2fab4a){return _0x2fab4a?{'count':_0x4bf255,'rows':_0x2fab4a}:null;}})[_0x27e8('0x27')](respondWithResult(_0x367f95,null))['catch'](handleError(_0x367f95,null));};exports['addTeams']=function(_0x2b5f3a,_0x3332bc,_0x121d36){var _0x2eed07=_0x2b5f3a[_0x27e8('0x4c')][_0x27e8('0x61')];return db[_0x27e8('0x60')][_0x27e8('0x46')]({'where':{'id':_0x2eed07},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x27e8('0x2a'),_0x27e8('0x62'),_0x27e8('0x63'),_0x27e8('0x64')],'raw':!![]}]})[_0x27e8('0x27')](function(_0x56e6a0){if(_0x56e6a0){var _0x4c76c7=_[_0x27e8('0x65')](_0x56e6a0,function(_0x1699d2){var _0x5463a6=_0x1699d2['get']({'plain':!![]});return _0x5463a6[_0x27e8('0x66')];});return db[_0x27e8('0x2e')]['find']({'where':{'id':_0x2b5f3a[_0x27e8('0x49')]['id']}})['then'](function(_0x69955b){return db[_0x27e8('0x67')][_0x27e8('0x68')](function(_0x3ca549){return _0x69955b[_0x27e8('0x69')](_0x2eed07,{'transaction':_0x3ca549})[_0x27e8('0x27')](function(){return BPromise[_0x27e8('0x6a')](_0x4c76c7,function(_0x586ee5){return db[_0x27e8('0x55')][_0x27e8('0x6b')]({'where':{'UserId':_0x586ee5['id'],'WhatsappQueueId':_0x2b5f3a[_0x27e8('0x49')]['id']},'transaction':_0x3ca549});});})[_0x27e8('0x27')](function(){_0x4c76c7[_0x27e8('0x6c')](function(_0x5b173a){socket['emit'](_0x27e8('0x6d'),{'UserId':_0x5b173a['id'],'WhatsappQueueId':_0x69955b['id']});});});});});}})[_0x27e8('0x27')](respondWithStatusCode(_0x3332bc,null))[_0x27e8('0x48')](handleError(_0x3332bc,null));};exports[_0x27e8('0x6e')]=function(_0x57bcf4,_0x23cec4,_0x3793e2){return db[_0x27e8('0x60')][_0x27e8('0x46')]({'where':{'id':_0x57bcf4[_0x27e8('0x34')][_0x27e8('0x61')]},'attributes':['id'],'include':[{'model':db[_0x27e8('0x6f')],'as':_0x27e8('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x23cec4,null))[_0x27e8('0x27')](function(_0x554ff3){var _0x3cf7b2=_['map'](_0x554ff3,'id');var _0x5552e4=[];var _0x44056a=[];var _0x3098c5=squel[_0x27e8('0x70')]();_0x3098c5['field'](_0x27e8('0x71'))[_0x27e8('0x72')](_0x27e8('0x73'),'tq')[_0x27e8('0x74')](_0x27e8('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x27e8('0x3f')](_0x27e8('0x76'),_0x57bcf4[_0x27e8('0x49')]['id']);for(var _0x21f0f4=0x0;_0x21f0f4<_0x554ff3[_0x27e8('0x3a')];_0x21f0f4+=0x1){let _0xd4c866=_0x554ff3[_0x21f0f4];for(var _0x184fa8=0x0;_0x184fa8<_0xd4c866[_0x27e8('0x66')][_0x27e8('0x3a')];_0x184fa8+=0x1){let _0x3aaad3=_0xd4c866[_0x27e8('0x66')][_0x184fa8];var _0x515ce4=_0x3098c5[_0x27e8('0x77')]();_0x515ce4[_0x27e8('0x3f')](_0x27e8('0x78'),_0x3aaad3['id']);_0x44056a[_0x27e8('0x79')](db[_0x27e8('0x67')][_0x27e8('0x34')](_0x515ce4[_0x27e8('0x7a')](),{'type':db[_0x27e8('0x67')][_0x27e8('0x7b')][_0x27e8('0x7c')]})[_0x27e8('0x27')](function(_0x404919){if(_0x404919[_0x27e8('0x3a')]===0x1){return _0x3aaad3['id'];}else{var _0x44c8f2=_[_0x27e8('0x7d')](_[_0x27e8('0x2d')](_0x404919,_0x27e8('0x7e')),function(_0x451f46){return _[_0x27e8('0x7f')](_0x3cf7b2,_0x451f46);});if(_0x44c8f2){return _0x3aaad3['id'];}}}));}}return BPromise[_0x27e8('0x80')](_0x44056a)[_0x27e8('0x27')](function(_0x12d14f){_0x5552e4=_(_0x5552e4)['union'](_0x12d14f)['compact']()['value']();return db[_0x27e8('0x2e')][_0x27e8('0x4a')]({'where':{'id':_0x57bcf4[_0x27e8('0x49')]['id']}})['then'](function(_0x2fe5d5){return db['sequelize'][_0x27e8('0x68')](function(_0x3e3cc3){return _0x2fe5d5['removeTeams'](_0x57bcf4['query'][_0x27e8('0x61')],{'transaction':_0x3e3cc3})[_0x27e8('0x27')](function(){if(!_[_0x27e8('0x81')](_0x5552e4)){return _0x2fe5d5[_0x27e8('0x82')](_0x5552e4,{'transaction':_0x3e3cc3});}})[_0x27e8('0x27')](function(){_0x5552e4[_0x27e8('0x6c')](function(_0x477be1){socket[_0x27e8('0x83')](_0x27e8('0x84'),{'UserId':_0x477be1,'WhatsappQueueId':_0x2fe5d5['id']});});});});});});})[_0x27e8('0x27')](respondWithStatusCode(_0x23cec4,null))[_0x27e8('0x48')](handleError(_0x23cec4,null));};exports[_0x27e8('0x85')]=function(_0x57c43b,_0x327231,_0x56ac5b){return db['WhatsappQueue'][_0x27e8('0x4a')]({'where':{'id':_0x57c43b[_0x27e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x327231,null))[_0x27e8('0x27')](function(_0x1608b4){if(_0x1608b4){return _0x1608b4[_0x27e8('0x85')](_0x57c43b[_0x27e8('0x4c')]['ids'],_[_0x27e8('0x86')](_0x57c43b[_0x27e8('0x4c')],['ids','id'])||{})['spread'](function(_0x16d7cf){for(var _0x5876c0=0x0;_0x5876c0<_0x57c43b[_0x27e8('0x4c')]['ids'][_0x27e8('0x3a')];_0x5876c0+=0x1){socket[_0x27e8('0x83')](_0x27e8('0x6d'),{'UserId':Number(_0x57c43b[_0x27e8('0x4c')][_0x27e8('0x61')][_0x5876c0]),'WhatsappQueueId':Number(_0x57c43b['params']['id'])});}return _0x16d7cf;});}})[_0x27e8('0x27')](respondWithResult(_0x327231,null))[_0x27e8('0x48')](handleError(_0x327231,null));};exports[_0x27e8('0x82')]=function(_0x15bcf8,_0x1149ed,_0x13ffcd){return db[_0x27e8('0x2e')][_0x27e8('0x4a')]({'where':{'id':_0x15bcf8[_0x27e8('0x49')]['id']}})[_0x27e8('0x27')](handleEntityNotFound(_0x1149ed,null))['then'](function(_0x1d1d15){if(_0x1d1d15){return _0x1d1d15['removeAgents'](_0x15bcf8[_0x27e8('0x34')][_0x27e8('0x61')])['then'](function(){if(_[_0x27e8('0x87')](_0x15bcf8['query'][_0x27e8('0x61')])){for(var _0xa585ef=0x0;_0xa585ef<_0x15bcf8['query'][_0x27e8('0x61')]['length'];_0xa585ef+=0x1){socket['emit'](_0x27e8('0x84'),{'UserId':Number(_0x15bcf8[_0x27e8('0x34')][_0x27e8('0x61')][_0xa585ef]),'WhatsappQueueId':Number(_0x15bcf8[_0x27e8('0x49')]['id'])});}}else{socket[_0x27e8('0x83')](_0x27e8('0x84'),{'UserId':Number(_0x15bcf8[_0x27e8('0x34')][_0x27e8('0x61')]),'WhatsappQueueId':Number(_0x15bcf8[_0x27e8('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x1149ed,null))[_0x27e8('0x48')](handleError(_0x1149ed,null));};exports[_0x27e8('0x88')]=function(_0x2b4a00,_0x5546e3,_0x536647){var _0x435e6f={};var _0x51d538={};var _0x2f183b;var _0x517482;return db[_0x27e8('0x2e')]['findOne']({'where':{'id':_0x2b4a00['params']['id']}})[_0x27e8('0x27')](handleEntityNotFound(_0x5546e3,null))[_0x27e8('0x27')](function(_0x3db7d4){if(_0x3db7d4){_0x2f183b=_0x3db7d4;_0x51d538[_0x27e8('0x33')]=_[_0x27e8('0x35')](db['User'][_0x27e8('0x2f')]);_0x51d538['query']=_['keys'](_0x2b4a00['query']);_0x51d538[_0x27e8('0x36')]=_[_0x27e8('0x37')](_0x51d538['model'],_0x51d538[_0x27e8('0x34')]);_0x435e6f['attributes']=_[_0x27e8('0x37')](_0x51d538['model'],qs['fields'](_0x2b4a00[_0x27e8('0x34')]['fields']));_0x435e6f[_0x27e8('0x38')]=_0x435e6f['attributes'][_0x27e8('0x3a')]?_0x435e6f['attributes']:_0x51d538[_0x27e8('0x33')];_0x435e6f[_0x27e8('0x3d')]=qs[_0x27e8('0x3e')](_0x2b4a00[_0x27e8('0x34')][_0x27e8('0x3e')]);_0x435e6f[_0x27e8('0x3f')]=qs[_0x27e8('0x36')](_[_0x27e8('0x56')](_0x2b4a00[_0x27e8('0x34')],_0x51d538[_0x27e8('0x36')]));if(_0x2b4a00['query'][_0x27e8('0x40')]){_0x435e6f['where']=_[_0x27e8('0x41')](_0x435e6f[_0x27e8('0x3f')],{'$or':_['map'](_0x435e6f[_0x27e8('0x38')],function(_0x34230a){var _0x5d669b={};_0x5d669b[_0x34230a]={'$like':'%'+_0x2b4a00[_0x27e8('0x34')]['filter']+'%'};return _0x5d669b;})});}_0x435e6f=_[_0x27e8('0x41')]({},_0x435e6f,_0x2b4a00[_0x27e8('0x43')]);return _0x2f183b[_0x27e8('0x88')](_0x435e6f);}})[_0x27e8('0x27')](function(_0x1d2e88){if(_0x1d2e88){_0x517482=_0x1d2e88['length'];if(!_0x2b4a00[_0x27e8('0x34')][_0x27e8('0x3b')](_0x27e8('0x3c'))){_0x435e6f[_0x27e8('0x19')]=qs[_0x27e8('0x19')](_0x2b4a00[_0x27e8('0x34')][_0x27e8('0x19')]);_0x435e6f['offset']=qs[_0x27e8('0x1b')](_0x2b4a00['query'][_0x27e8('0x1b')]);}return _0x2f183b[_0x27e8('0x88')](_0x435e6f);}})[_0x27e8('0x27')](function(_0x192d69){if(_0x192d69){return _0x192d69?{'count':_0x517482,'rows':_0x192d69}:null;}})['then'](respondWithResult(_0x5546e3,null))[_0x27e8('0x48')](handleError(_0x5546e3,null));}; \ No newline at end of file +var _0xce96=['rawAttributes','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','include','rows','show','params','length','find','catch','create','body','user','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserWhatsappQueue','pick','WhatsappQueueId','findAll','findAndCountAll','UserId','agent','format','%s/%s','whatsappPause','createdAt','getTeams','addTeams','User','Agents','online','voicePause','flatMap','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','Team','ids','select','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','WhatsappQueue'];(function(_0x15204b,_0x12d6af){var _0x410d73=function(_0x48e1df){while(--_0x48e1df){_0x15204b['push'](_0x15204b['shift']());}};_0x410d73(++_0x12d6af);}(_0xce96,0x16c));var _0x6ce9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xce96[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x6ce9('0x0'));var rimraf=require(_0x6ce9('0x1'));var zipdir=require(_0x6ce9('0x2'));var jsonpatch=require(_0x6ce9('0x3'));var rp=require('request-promise');var moment=require(_0x6ce9('0x4'));var BPromise=require(_0x6ce9('0x5'));var Mustache=require(_0x6ce9('0x6'));var util=require(_0x6ce9('0x7'));var path=require(_0x6ce9('0x8'));var sox=require(_0x6ce9('0x9'));var csv=require(_0x6ce9('0xa'));var ejs=require(_0x6ce9('0xb'));var fs=require('fs');var fs_extra=require(_0x6ce9('0xc'));var _=require(_0x6ce9('0xd'));var squel=require(_0x6ce9('0xe'));var crypto=require(_0x6ce9('0xf'));var jsforce=require(_0x6ce9('0x10'));var deskjs=require(_0x6ce9('0x11'));var toCsv=require(_0x6ce9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ce9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ce9('0x13'));var logger=require(_0x6ce9('0x14'))(_0x6ce9('0x15'));var utils=require('../../config/utils');var config=require(_0x6ce9('0x16'));var licenseUtil=require(_0x6ce9('0x17'));var db=require(_0x6ce9('0x18'))['db'];config[_0x6ce9('0x19')]=_[_0x6ce9('0x1a')](config[_0x6ce9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ce9('0x1b'))(new Redis(config[_0x6ce9('0x19')]));require(_0x6ce9('0x1c'))['register'](socket);function respondWithStatusCode(_0x1a9d95,_0x4128d2){_0x4128d2=_0x4128d2||0xcc;return function(_0x229ebf){if(_0x229ebf){return _0x1a9d95[_0x6ce9('0x1d')](_0x4128d2);}return _0x1a9d95[_0x6ce9('0x1e')](_0x4128d2)[_0x6ce9('0x1f')]();};}function respondWithResult(_0x3f67dd,_0x3b2683){_0x3b2683=_0x3b2683||0xc8;return function(_0x5d732e){if(_0x5d732e){return _0x3f67dd[_0x6ce9('0x1e')](_0x3b2683)[_0x6ce9('0x20')](_0x5d732e);}};}function respondWithFilteredResult(_0x2e9821,_0x387fa8){return function(_0x457b46){if(_0x457b46){var _0x2a1f4e=typeof _0x387fa8[_0x6ce9('0x21')]===_0x6ce9('0x22')&&typeof _0x387fa8[_0x6ce9('0x23')]===_0x6ce9('0x22');var _0x45073e=_0x457b46[_0x6ce9('0x24')];var _0x1d5602=_0x2a1f4e?0x0:_0x387fa8[_0x6ce9('0x21')];var _0x41866a=_0x2a1f4e?_0x457b46[_0x6ce9('0x24')]:_0x387fa8['offset']+_0x387fa8[_0x6ce9('0x23')];var _0x32b2c4;if(_0x41866a>=_0x45073e){_0x41866a=_0x45073e;_0x32b2c4=0xc8;}else{_0x32b2c4=0xce;}_0x2e9821[_0x6ce9('0x1e')](_0x32b2c4);return _0x2e9821['set'](_0x6ce9('0x25'),_0x1d5602+'-'+_0x41866a+'/'+_0x45073e)['json'](_0x457b46);}return null;};}function patchUpdates(_0x4c62a8){return function(_0x237f5b){try{jsonpatch['apply'](_0x237f5b,_0x4c62a8,!![]);}catch(_0x4752c6){return BPromise[_0x6ce9('0x26')](_0x4752c6);}return _0x237f5b[_0x6ce9('0x27')]();};}function saveUpdates(_0x535555,_0x2f6a07){return function(_0x5bc9b9){if(_0x5bc9b9){return _0x5bc9b9[_0x6ce9('0x28')](_0x535555)[_0x6ce9('0x29')](function(_0x40cd98){return _0x40cd98;});}return null;};}function removeEntity(_0x336288,_0x34a878){return function(_0x585921){if(_0x585921){return _0x585921['destroy']()[_0x6ce9('0x29')](function(){var _0x1b2d0c=_0x585921[_0x6ce9('0x2a')]({'plain':!![]});var _0x2bac7a='WhatsappQueues';return db[_0x6ce9('0x2b')]['destroy']({'where':{'type':_0x2bac7a,'resourceId':_0x1b2d0c['id']}})[_0x6ce9('0x29')](function(){return _0x585921;});})['then'](function(){_0x336288[_0x6ce9('0x1e')](0xcc)[_0x6ce9('0x1f')]();});}};}function handleEntityNotFound(_0x57b40f,_0x55649a){return function(_0x535a95){if(!_0x535a95){_0x57b40f[_0x6ce9('0x1d')](0x194);}return _0x535a95;};}function handleError(_0xf4480,_0x3f6dcd){_0x3f6dcd=_0x3f6dcd||0x1f4;return function(_0x2ff59e){logger[_0x6ce9('0x2c')](_0x2ff59e[_0x6ce9('0x2d')]);if(_0x2ff59e[_0x6ce9('0x2e')]){delete _0x2ff59e[_0x6ce9('0x2e')];}_0xf4480[_0x6ce9('0x1e')](_0x3f6dcd)[_0x6ce9('0x2f')](_0x2ff59e);};}exports[_0x6ce9('0x30')]=function(_0xaa15a2,_0x100d85){var _0x1c8c43={},_0xf48ac5={},_0x4865b1={'count':0x0,'rows':[]};var _0x54ba0a=_['map'](db[_0x6ce9('0x31')][_0x6ce9('0x32')],function(_0x5514f2){return{'name':_0x5514f2['fieldName'],'type':_0x5514f2[_0x6ce9('0x33')][_0x6ce9('0x34')]};});_0xf48ac5[_0x6ce9('0x35')]=_['map'](_0x54ba0a,_0x6ce9('0x2e'));_0xf48ac5['query']=_[_0x6ce9('0x36')](_0xaa15a2['query']);_0xf48ac5['filters']=_['intersection'](_0xf48ac5[_0x6ce9('0x35')],_0xf48ac5[_0x6ce9('0x37')]);_0x1c8c43[_0x6ce9('0x38')]=_[_0x6ce9('0x39')](_0xf48ac5[_0x6ce9('0x35')],qs[_0x6ce9('0x3a')](_0xaa15a2[_0x6ce9('0x37')]['fields']));_0x1c8c43[_0x6ce9('0x38')]=_0x1c8c43[_0x6ce9('0x38')]['length']?_0x1c8c43[_0x6ce9('0x38')]:_0xf48ac5[_0x6ce9('0x35')];if(!_0xaa15a2['query'][_0x6ce9('0x3b')](_0x6ce9('0x3c'))){_0x1c8c43[_0x6ce9('0x23')]=qs[_0x6ce9('0x23')](_0xaa15a2[_0x6ce9('0x37')][_0x6ce9('0x23')]);_0x1c8c43['offset']=qs['offset'](_0xaa15a2[_0x6ce9('0x37')][_0x6ce9('0x21')]);}_0x1c8c43[_0x6ce9('0x3d')]=qs[_0x6ce9('0x3e')](_0xaa15a2[_0x6ce9('0x37')][_0x6ce9('0x3e')]);_0x1c8c43[_0x6ce9('0x3f')]=qs[_0x6ce9('0x40')](_['pick'](_0xaa15a2[_0x6ce9('0x37')],_0xf48ac5[_0x6ce9('0x40')]),_0x54ba0a);if(_0xaa15a2['query'][_0x6ce9('0x41')]){_0x1c8c43[_0x6ce9('0x3f')]=_[_0x6ce9('0x42')](_0x1c8c43['where'],{'$or':_[_0x6ce9('0x43')](_0x54ba0a,function(_0x224d9c){if(_0x224d9c[_0x6ce9('0x33')]!==_0x6ce9('0x44')){var _0xd5b2c8={};_0xd5b2c8[_0x224d9c[_0x6ce9('0x2e')]]={'$like':'%'+_0xaa15a2[_0x6ce9('0x37')][_0x6ce9('0x41')]+'%'};return _0xd5b2c8;}})});}_0x1c8c43=_[_0x6ce9('0x42')]({},_0x1c8c43,_0xaa15a2[_0x6ce9('0x45')]);var _0x409a77={'where':_0x1c8c43[_0x6ce9('0x3f')]};return db[_0x6ce9('0x31')]['count'](_0x409a77)[_0x6ce9('0x29')](function(_0x5e7cdb){_0x4865b1[_0x6ce9('0x24')]=_0x5e7cdb;if(_0xaa15a2[_0x6ce9('0x37')]['includeAll']){_0x1c8c43[_0x6ce9('0x46')]=[{'all':!![]}];}return db[_0x6ce9('0x31')]['findAll'](_0x1c8c43);})[_0x6ce9('0x29')](function(_0x2a0540){_0x4865b1[_0x6ce9('0x47')]=_0x2a0540;return _0x4865b1;})['then'](respondWithFilteredResult(_0x100d85,_0x1c8c43))['catch'](handleError(_0x100d85,null));};exports[_0x6ce9('0x48')]=function(_0xe87b60,_0x2441f1){var _0x5b8e54={'raw':!![],'where':{'id':_0xe87b60[_0x6ce9('0x49')]['id']}},_0x5e8cec={};_0x5e8cec[_0x6ce9('0x35')]=_['keys'](db['WhatsappQueue'][_0x6ce9('0x32')]);_0x5e8cec[_0x6ce9('0x37')]=_[_0x6ce9('0x36')](_0xe87b60[_0x6ce9('0x37')]);_0x5e8cec[_0x6ce9('0x40')]=_[_0x6ce9('0x39')](_0x5e8cec[_0x6ce9('0x35')],_0x5e8cec[_0x6ce9('0x37')]);_0x5b8e54[_0x6ce9('0x38')]=_[_0x6ce9('0x39')](_0x5e8cec['model'],qs[_0x6ce9('0x3a')](_0xe87b60[_0x6ce9('0x37')][_0x6ce9('0x3a')]));_0x5b8e54[_0x6ce9('0x38')]=_0x5b8e54[_0x6ce9('0x38')][_0x6ce9('0x4a')]?_0x5b8e54[_0x6ce9('0x38')]:_0x5e8cec[_0x6ce9('0x35')];if(_0xe87b60[_0x6ce9('0x37')]['includeAll']){_0x5b8e54[_0x6ce9('0x46')]=[{'all':!![]}];}_0x5b8e54=_['merge']({},_0x5b8e54,_0xe87b60[_0x6ce9('0x45')]);return db[_0x6ce9('0x31')][_0x6ce9('0x4b')](_0x5b8e54)['then'](handleEntityNotFound(_0x2441f1,null))[_0x6ce9('0x29')](respondWithResult(_0x2441f1,null))[_0x6ce9('0x4c')](handleError(_0x2441f1,null));};exports[_0x6ce9('0x4d')]=function(_0x363254,_0x5d0b78){return db[_0x6ce9('0x31')][_0x6ce9('0x4d')](_0x363254[_0x6ce9('0x4e')],{})['then'](function(_0x1d6fce){var _0x5abdf5=_0x363254[_0x6ce9('0x4f')][_0x6ce9('0x2a')]({'plain':!![]});if(!_0x5abdf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5abdf5['role']===_0x6ce9('0x4f')){var _0x129f2f=_0x1d6fce[_0x6ce9('0x2a')]({'plain':!![]});var _0x1b143e=_0x6ce9('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x1b143e,'userProfileId':_0x5abdf5[_0x6ce9('0x51')]},'raw':!![]})[_0x6ce9('0x29')](function(_0x3b7003){if(_0x3b7003&&_0x3b7003[_0x6ce9('0x52')]===0x0){return db[_0x6ce9('0x2b')]['create']({'name':_0x129f2f[_0x6ce9('0x2e')],'resourceId':_0x129f2f['id'],'type':_0x3b7003[_0x6ce9('0x2e')],'sectionId':_0x3b7003['id']},{})[_0x6ce9('0x29')](function(){return _0x1d6fce;});}else{return _0x1d6fce;}})[_0x6ce9('0x4c')](function(_0x335780){logger[_0x6ce9('0x2c')](_0x6ce9('0x53'),_0x335780);throw _0x335780;});}return _0x1d6fce;})[_0x6ce9('0x29')](respondWithResult(_0x5d0b78,0xc9))[_0x6ce9('0x4c')](handleError(_0x5d0b78,null));};exports[_0x6ce9('0x28')]=function(_0x2de623,_0x12a49f){if(_0x2de623[_0x6ce9('0x4e')]['id']){delete _0x2de623[_0x6ce9('0x4e')]['id'];}return db[_0x6ce9('0x31')]['find']({'where':{'id':_0x2de623[_0x6ce9('0x49')]['id']}})[_0x6ce9('0x29')](handleEntityNotFound(_0x12a49f,null))['then'](saveUpdates(_0x2de623[_0x6ce9('0x4e')],null))['then'](respondWithResult(_0x12a49f,null))[_0x6ce9('0x4c')](handleError(_0x12a49f,null));};exports[_0x6ce9('0x54')]=function(_0x2924f1,_0x567616){return db['WhatsappQueue']['find']({'where':{'id':_0x2924f1['params']['id']}})[_0x6ce9('0x29')](handleEntityNotFound(_0x567616,null))[_0x6ce9('0x29')](removeEntity(_0x567616,null))['catch'](handleError(_0x567616,null));};exports[_0x6ce9('0x55')]=function(_0x153338,_0x1acd23){return db[_0x6ce9('0x31')]['describe']()[_0x6ce9('0x29')](respondWithResult(_0x1acd23,null))[_0x6ce9('0x4c')](handleError(_0x1acd23,null));};exports[_0x6ce9('0x56')]=function(_0x314490,_0x2166a6,_0x11eec0){var _0x1d7e4d={'raw':!![],'where':{}},_0x5c32fa={},_0x48525b;return db[_0x6ce9('0x31')][_0x6ce9('0x57')]({'where':{'id':_0x314490[_0x6ce9('0x49')]['id']}})[_0x6ce9('0x29')](handleEntityNotFound(_0x2166a6,null))[_0x6ce9('0x29')](function(_0x584261){if(_0x584261){_0x48525b=_0x584261[_0x6ce9('0x2a')]({'plain':!![]});_0x5c32fa[_0x6ce9('0x35')]=_['keys'](db[_0x6ce9('0x58')]['rawAttributes']);_0x5c32fa[_0x6ce9('0x37')]=_[_0x6ce9('0x36')](_0x314490[_0x6ce9('0x37')]);_0x5c32fa[_0x6ce9('0x40')]=_[_0x6ce9('0x39')](_0x5c32fa['model'],_0x5c32fa[_0x6ce9('0x37')]);_0x1d7e4d[_0x6ce9('0x38')]=_[_0x6ce9('0x39')](_0x5c32fa[_0x6ce9('0x35')],qs[_0x6ce9('0x3a')](_0x314490['query']['fields']));_0x1d7e4d[_0x6ce9('0x38')]=_0x1d7e4d[_0x6ce9('0x38')][_0x6ce9('0x4a')]?_0x1d7e4d[_0x6ce9('0x38')]:_0x5c32fa[_0x6ce9('0x35')];if(!_0x314490[_0x6ce9('0x37')]['hasOwnProperty']('nolimit')){_0x1d7e4d[_0x6ce9('0x23')]=qs[_0x6ce9('0x23')](_0x314490[_0x6ce9('0x37')]['limit']);_0x1d7e4d[_0x6ce9('0x21')]=qs[_0x6ce9('0x21')](_0x314490[_0x6ce9('0x37')]['offset']);}_0x1d7e4d[_0x6ce9('0x3d')]=qs[_0x6ce9('0x3e')](_0x314490[_0x6ce9('0x37')]['sort']);_0x1d7e4d[_0x6ce9('0x3f')]=qs[_0x6ce9('0x40')](_[_0x6ce9('0x59')](_0x314490[_0x6ce9('0x37')],_0x5c32fa[_0x6ce9('0x40')]));_0x1d7e4d['where'][_0x6ce9('0x5a')]=_0x584261['id'];if(_0x314490[_0x6ce9('0x37')][_0x6ce9('0x41')]){_0x1d7e4d[_0x6ce9('0x3f')]=_[_0x6ce9('0x42')](_0x1d7e4d[_0x6ce9('0x3f')],{'$or':_[_0x6ce9('0x43')](_0x1d7e4d[_0x6ce9('0x38')],function(_0x3d770a){var _0x36560a={};_0x36560a[_0x3d770a]={'$like':'%'+_0x314490['query'][_0x6ce9('0x41')]+'%'};return _0x36560a;})});}_0x1d7e4d=_['merge']({},_0x1d7e4d,_0x314490[_0x6ce9('0x45')]);return db[_0x6ce9('0x58')][_0x6ce9('0x5b')](_0x1d7e4d);}})[_0x6ce9('0x29')](function(_0x419742){if(_0x419742){return db['User'][_0x6ce9('0x5c')]({'where':{'id':_[_0x6ce9('0x43')](_0x419742,_0x6ce9('0x5d')),'role':_0x6ce9('0x5e')},'attributes':['id',_0x6ce9('0x2e'),'whatsappPause','updatedAt','createdAt']});}})['then'](function(_0x18867c){if(_0x18867c){return{'count':_0x18867c[_0x6ce9('0x24')],'rows':_['map'](_0x18867c[_0x6ce9('0x47')],function(_0x6af793){return{'membername':_0x6af793[_0x6ce9('0x2e')],'UserId':_0x6af793['id'],'queue_name':_0x48525b[_0x6ce9('0x2e')],'WhatsappQueueId':_0x48525b['id'],'interface':util[_0x6ce9('0x5f')](_0x6ce9('0x60'),'SIP',_0x6af793[_0x6ce9('0x2e')]),'penalty':0x0,'paused':_0x6af793[_0x6ce9('0x61')],'createdAt':_0x6af793[_0x6ce9('0x62')],'updatedAt':_0x6af793['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ce9('0x29')](respondWithFilteredResult(_0x2166a6,_0x1d7e4d))[_0x6ce9('0x4c')](handleError(_0x2166a6,null));};exports['getTeams']=function(_0x47e208,_0x54644a,_0x29fa59){var _0x1dbccc={};var _0x37739a={};var _0x1e33c4;var _0x266b1c;return db['WhatsappQueue'][_0x6ce9('0x57')]({'where':{'id':_0x47e208[_0x6ce9('0x49')]['id']}})[_0x6ce9('0x29')](handleEntityNotFound(_0x54644a,null))[_0x6ce9('0x29')](function(_0xad260d){if(_0xad260d){_0x1e33c4=_0xad260d;_0x37739a[_0x6ce9('0x35')]=_[_0x6ce9('0x36')](db['Team'][_0x6ce9('0x32')]);_0x37739a[_0x6ce9('0x37')]=_[_0x6ce9('0x36')](_0x47e208[_0x6ce9('0x37')]);_0x37739a[_0x6ce9('0x40')]=_[_0x6ce9('0x39')](_0x37739a[_0x6ce9('0x35')],_0x37739a[_0x6ce9('0x37')]);_0x1dbccc[_0x6ce9('0x38')]=_[_0x6ce9('0x39')](_0x37739a[_0x6ce9('0x35')],qs[_0x6ce9('0x3a')](_0x47e208[_0x6ce9('0x37')][_0x6ce9('0x3a')]));_0x1dbccc['attributes']=_0x1dbccc[_0x6ce9('0x38')][_0x6ce9('0x4a')]?_0x1dbccc[_0x6ce9('0x38')]:_0x37739a[_0x6ce9('0x35')];_0x1dbccc[_0x6ce9('0x3d')]=qs[_0x6ce9('0x3e')](_0x47e208[_0x6ce9('0x37')][_0x6ce9('0x3e')]);_0x1dbccc[_0x6ce9('0x3f')]=qs['filters'](_[_0x6ce9('0x59')](_0x47e208[_0x6ce9('0x37')],_0x37739a['filters']));if(_0x47e208[_0x6ce9('0x37')][_0x6ce9('0x41')]){_0x1dbccc[_0x6ce9('0x3f')]=_[_0x6ce9('0x42')](_0x1dbccc[_0x6ce9('0x3f')],{'$or':_['map'](_0x1dbccc[_0x6ce9('0x38')],function(_0x5aa127){var _0x357a60={};_0x357a60[_0x5aa127]={'$like':'%'+_0x47e208[_0x6ce9('0x37')][_0x6ce9('0x41')]+'%'};return _0x357a60;})});}_0x1dbccc=_[_0x6ce9('0x42')]({},_0x1dbccc,_0x47e208['options']);return _0x1e33c4[_0x6ce9('0x63')](_0x1dbccc);}})['then'](function(_0x1694d1){if(_0x1694d1){_0x266b1c=_0x1694d1[_0x6ce9('0x4a')];if(!_0x47e208[_0x6ce9('0x37')][_0x6ce9('0x3b')]('nolimit')){_0x1dbccc[_0x6ce9('0x23')]=qs[_0x6ce9('0x23')](_0x47e208[_0x6ce9('0x37')][_0x6ce9('0x23')]);_0x1dbccc[_0x6ce9('0x21')]=qs[_0x6ce9('0x21')](_0x47e208['query'][_0x6ce9('0x21')]);}return _0x1e33c4['getTeams'](_0x1dbccc);}})[_0x6ce9('0x29')](function(_0x26aaf7){if(_0x26aaf7){return _0x26aaf7?{'count':_0x266b1c,'rows':_0x26aaf7}:null;}})[_0x6ce9('0x29')](respondWithResult(_0x54644a,null))[_0x6ce9('0x4c')](handleError(_0x54644a,null));};exports[_0x6ce9('0x64')]=function(_0x2fe659,_0xd14a50,_0x599a3c){var _0x381147=_0x2fe659[_0x6ce9('0x4e')]['ids'];return db['Team'][_0x6ce9('0x5b')]({'where':{'id':_0x381147},'attributes':['id'],'include':[{'model':db[_0x6ce9('0x65')],'as':_0x6ce9('0x66'),'attributes':['id','name',_0x6ce9('0x67'),_0x6ce9('0x68'),'interface'],'raw':!![]}]})['then'](function(_0x4d6b97){if(_0x4d6b97){var _0x518fcd=_[_0x6ce9('0x69')](_0x4d6b97,function(_0x245821){var _0x2a005d=_0x245821['get']({'plain':!![]});return _0x2a005d[_0x6ce9('0x66')];});return db[_0x6ce9('0x31')][_0x6ce9('0x4b')]({'where':{'id':_0x2fe659[_0x6ce9('0x49')]['id']}})[_0x6ce9('0x29')](function(_0x430fb1){return db['sequelize'][_0x6ce9('0x6a')](function(_0x301011){return _0x430fb1[_0x6ce9('0x64')](_0x381147,{'transaction':_0x301011})['then'](function(){return BPromise[_0x6ce9('0x6b')](_0x518fcd,function(_0x5f4806){return db[_0x6ce9('0x58')]['findOrCreate']({'where':{'UserId':_0x5f4806['id'],'WhatsappQueueId':_0x2fe659[_0x6ce9('0x49')]['id']},'transaction':_0x301011});});})[_0x6ce9('0x29')](function(){_0x518fcd[_0x6ce9('0x6c')](function(_0xc84ffd){socket[_0x6ce9('0x6d')](_0x6ce9('0x6e'),{'UserId':_0xc84ffd['id'],'WhatsappQueueId':_0x430fb1['id']});});});});});}})[_0x6ce9('0x29')](respondWithStatusCode(_0xd14a50,null))[_0x6ce9('0x4c')](handleError(_0xd14a50,null));};exports[_0x6ce9('0x6f')]=function(_0x36e7b8,_0x2c4fcb,_0x5190a1){return db[_0x6ce9('0x70')][_0x6ce9('0x5b')]({'where':{'id':_0x36e7b8[_0x6ce9('0x37')][_0x6ce9('0x71')]},'attributes':['id'],'include':[{'model':db[_0x6ce9('0x65')],'as':_0x6ce9('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2c4fcb,null))[_0x6ce9('0x29')](function(_0x3c6005){var _0x192525=_['map'](_0x3c6005,'id');var _0x217fea=[];var _0x5d828a=[];var _0xd6f89a=squel[_0x6ce9('0x72')]();_0xd6f89a[_0x6ce9('0x73')](_0x6ce9('0x74'))['from'](_0x6ce9('0x75'),'tq')[_0x6ce9('0x76')]('user_has_teams','ut',_0x6ce9('0x77'))[_0x6ce9('0x3f')](_0x6ce9('0x78'),_0x36e7b8[_0x6ce9('0x49')]['id']);for(var _0x387a84=0x0;_0x387a84<_0x3c6005[_0x6ce9('0x4a')];_0x387a84+=0x1){let _0x1e3b5e=_0x3c6005[_0x387a84];for(var _0x55a23c=0x0;_0x55a23c<_0x1e3b5e[_0x6ce9('0x66')][_0x6ce9('0x4a')];_0x55a23c+=0x1){let _0x21cc8c=_0x1e3b5e['Agents'][_0x55a23c];var _0x5d9ed0=_0xd6f89a[_0x6ce9('0x79')]();_0x5d9ed0[_0x6ce9('0x3f')](_0x6ce9('0x7a'),_0x21cc8c['id']);_0x5d828a[_0x6ce9('0x7b')](db[_0x6ce9('0x7c')][_0x6ce9('0x37')](_0x5d9ed0['toString'](),{'type':db[_0x6ce9('0x7c')][_0x6ce9('0x7d')][_0x6ce9('0x7e')]})[_0x6ce9('0x29')](function(_0x59f2c8){if(_0x59f2c8['length']===0x1){return _0x21cc8c['id'];}else{var _0x2ae37c=_[_0x6ce9('0x7f')](_[_0x6ce9('0x43')](_0x59f2c8,_0x6ce9('0x80')),function(_0x3ff5cb){return _[_0x6ce9('0x81')](_0x192525,_0x3ff5cb);});if(_0x2ae37c){return _0x21cc8c['id'];}}}));}}return BPromise['all'](_0x5d828a)[_0x6ce9('0x29')](function(_0x1454e9){_0x217fea=_(_0x217fea)[_0x6ce9('0x82')](_0x1454e9)[_0x6ce9('0x83')]()[_0x6ce9('0x84')]();return db[_0x6ce9('0x31')][_0x6ce9('0x4b')]({'where':{'id':_0x36e7b8[_0x6ce9('0x49')]['id']}})[_0x6ce9('0x29')](function(_0x336658){return db[_0x6ce9('0x7c')]['transaction'](function(_0x1d6964){return _0x336658[_0x6ce9('0x6f')](_0x36e7b8[_0x6ce9('0x37')][_0x6ce9('0x71')],{'transaction':_0x1d6964})[_0x6ce9('0x29')](function(){if(!_[_0x6ce9('0x85')](_0x217fea)){return _0x336658[_0x6ce9('0x86')](_0x217fea,{'transaction':_0x1d6964});}})[_0x6ce9('0x29')](function(){_0x217fea['forEach'](function(_0x58025a){socket[_0x6ce9('0x6d')](_0x6ce9('0x87'),{'UserId':_0x58025a,'WhatsappQueueId':_0x336658['id']});});});});});});})['then'](respondWithStatusCode(_0x2c4fcb,null))['catch'](handleError(_0x2c4fcb,null));};exports[_0x6ce9('0x88')]=function(_0x396aed,_0x3a79f9,_0x3b932e){return db['WhatsappQueue'][_0x6ce9('0x4b')]({'where':{'id':_0x396aed[_0x6ce9('0x49')]['id']}})[_0x6ce9('0x29')](handleEntityNotFound(_0x3a79f9,null))[_0x6ce9('0x29')](function(_0x4d59d6){if(_0x4d59d6){return _0x4d59d6[_0x6ce9('0x88')](_0x396aed['body']['ids'],_['omit'](_0x396aed[_0x6ce9('0x4e')],[_0x6ce9('0x71'),'id'])||{})['spread'](function(_0x201c76){for(var _0x11c93a=0x0;_0x11c93a<_0x396aed[_0x6ce9('0x4e')][_0x6ce9('0x71')][_0x6ce9('0x4a')];_0x11c93a+=0x1){socket[_0x6ce9('0x6d')]('userWhatsappQueue:save',{'UserId':Number(_0x396aed[_0x6ce9('0x4e')][_0x6ce9('0x71')][_0x11c93a]),'WhatsappQueueId':Number(_0x396aed['params']['id'])});}return _0x201c76;});}})[_0x6ce9('0x29')](respondWithResult(_0x3a79f9,null))[_0x6ce9('0x4c')](handleError(_0x3a79f9,null));};exports[_0x6ce9('0x86')]=function(_0x3c0bf8,_0x3248a2,_0x43a98b){return db['WhatsappQueue'][_0x6ce9('0x4b')]({'where':{'id':_0x3c0bf8[_0x6ce9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3248a2,null))[_0x6ce9('0x29')](function(_0x39d1d0){if(_0x39d1d0){return _0x39d1d0['removeAgents'](_0x3c0bf8[_0x6ce9('0x37')][_0x6ce9('0x71')])[_0x6ce9('0x29')](function(){if(_['isArray'](_0x3c0bf8[_0x6ce9('0x37')]['ids'])){for(var _0x3cbff0=0x0;_0x3cbff0<_0x3c0bf8['query'][_0x6ce9('0x71')][_0x6ce9('0x4a')];_0x3cbff0+=0x1){socket[_0x6ce9('0x6d')](_0x6ce9('0x87'),{'UserId':Number(_0x3c0bf8['query'][_0x6ce9('0x71')][_0x3cbff0]),'WhatsappQueueId':Number(_0x3c0bf8[_0x6ce9('0x49')]['id'])});}}else{socket[_0x6ce9('0x6d')](_0x6ce9('0x87'),{'UserId':Number(_0x3c0bf8['query'][_0x6ce9('0x71')]),'WhatsappQueueId':Number(_0x3c0bf8[_0x6ce9('0x49')]['id'])});}});}})[_0x6ce9('0x29')](respondWithStatusCode(_0x3248a2,null))[_0x6ce9('0x4c')](handleError(_0x3248a2,null));};exports[_0x6ce9('0x89')]=function(_0x5348fc,_0x54a8a1,_0x120034){var _0xf6c9b={};var _0x4990a0={};var _0x4e7b18;var _0x1b6187;return db[_0x6ce9('0x31')]['findOne']({'where':{'id':_0x5348fc[_0x6ce9('0x49')]['id']}})['then'](handleEntityNotFound(_0x54a8a1,null))[_0x6ce9('0x29')](function(_0x5464c0){if(_0x5464c0){_0x4e7b18=_0x5464c0;_0x4990a0[_0x6ce9('0x35')]=_[_0x6ce9('0x36')](db[_0x6ce9('0x65')]['rawAttributes']);_0x4990a0[_0x6ce9('0x37')]=_[_0x6ce9('0x36')](_0x5348fc[_0x6ce9('0x37')]);_0x4990a0[_0x6ce9('0x40')]=_[_0x6ce9('0x39')](_0x4990a0[_0x6ce9('0x35')],_0x4990a0[_0x6ce9('0x37')]);_0xf6c9b[_0x6ce9('0x38')]=_[_0x6ce9('0x39')](_0x4990a0[_0x6ce9('0x35')],qs['fields'](_0x5348fc[_0x6ce9('0x37')][_0x6ce9('0x3a')]));_0xf6c9b[_0x6ce9('0x38')]=_0xf6c9b[_0x6ce9('0x38')][_0x6ce9('0x4a')]?_0xf6c9b[_0x6ce9('0x38')]:_0x4990a0[_0x6ce9('0x35')];_0xf6c9b[_0x6ce9('0x3d')]=qs['sort'](_0x5348fc[_0x6ce9('0x37')][_0x6ce9('0x3e')]);_0xf6c9b[_0x6ce9('0x3f')]=qs['filters'](_[_0x6ce9('0x59')](_0x5348fc[_0x6ce9('0x37')],_0x4990a0[_0x6ce9('0x40')]));if(_0x5348fc['query'][_0x6ce9('0x41')]){_0xf6c9b[_0x6ce9('0x3f')]=_[_0x6ce9('0x42')](_0xf6c9b[_0x6ce9('0x3f')],{'$or':_[_0x6ce9('0x43')](_0xf6c9b[_0x6ce9('0x38')],function(_0x46147c){var _0x17a75e={};_0x17a75e[_0x46147c]={'$like':'%'+_0x5348fc[_0x6ce9('0x37')][_0x6ce9('0x41')]+'%'};return _0x17a75e;})});}_0xf6c9b=_[_0x6ce9('0x42')]({},_0xf6c9b,_0x5348fc[_0x6ce9('0x45')]);return _0x4e7b18[_0x6ce9('0x89')](_0xf6c9b);}})[_0x6ce9('0x29')](function(_0x32a77f){if(_0x32a77f){_0x1b6187=_0x32a77f[_0x6ce9('0x4a')];if(!_0x5348fc[_0x6ce9('0x37')][_0x6ce9('0x3b')](_0x6ce9('0x3c'))){_0xf6c9b[_0x6ce9('0x23')]=qs[_0x6ce9('0x23')](_0x5348fc[_0x6ce9('0x37')][_0x6ce9('0x23')]);_0xf6c9b[_0x6ce9('0x21')]=qs[_0x6ce9('0x21')](_0x5348fc['query'][_0x6ce9('0x21')]);}return _0x4e7b18[_0x6ce9('0x89')](_0xf6c9b);}})[_0x6ce9('0x29')](function(_0x11f9f9){if(_0x11f9f9){return _0x11f9f9?{'count':_0x1b6187,'rows':_0x11f9f9}:null;}})[_0x6ce9('0x29')](respondWithResult(_0x54a8a1,null))['catch'](handleError(_0x54a8a1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b0c3153..2b9e82a 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 _0xedb0=['update','remove','emit','hook','exports','WhatsappQueue','setMaxListeners','save'];(function(_0x394439,_0xf2f0a9){var _0x2f9468=function(_0x4edb2b){while(--_0x4edb2b){_0x394439['push'](_0x394439['shift']());}};_0x2f9468(++_0xf2f0a9);}(_0xedb0,0xe5));var _0x0edb=function(_0x8eca52,_0x30c6b9){_0x8eca52=_0x8eca52-0x0;var _0x1ac998=_0xedb0[_0x8eca52];return _0x1ac998;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x0edb('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0edb('0x1')](0x0);var events={'afterCreate':_0x0edb('0x2'),'afterUpdate':_0x0edb('0x3'),'afterDestroy':_0x0edb('0x4')};function emitEvent(_0x2db201){return function(_0x2e2932,_0x30996d,_0x5b1e3f){WhatsappQueueEvents[_0x0edb('0x5')](_0x2db201+':'+_0x2e2932['id'],_0x2e2932);WhatsappQueueEvents[_0x0edb('0x5')](_0x2db201,_0x2e2932);_0x5b1e3f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x0edb('0x6')](e,emitEvent(event));}}module[_0x0edb('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xfa2f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3a7b2f,_0x1a2b90){var _0x32653e=function(_0x1485c8){while(--_0x1485c8){_0x3a7b2f['push'](_0x3a7b2f['shift']());}};_0x32653e(++_0x1a2b90);}(_0xfa2f,0xc6));var _0xffa2=function(_0x5a9a99,_0x32d370){_0x5a9a99=_0x5a9a99-0x0;var _0x362cab=_0xfa2f[_0x5a9a99];return _0x362cab;};'use strict';var EventEmitter=require(_0xffa2('0x0'));var WhatsappQueue=require(_0xffa2('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xffa2('0x2')](0x0);var events={'afterCreate':_0xffa2('0x3'),'afterUpdate':_0xffa2('0x4'),'afterDestroy':_0xffa2('0x5')};function emitEvent(_0x200fe2){return function(_0x5dff15,_0x15e177,_0x274c00){WhatsappQueueEvents['emit'](_0x200fe2+':'+_0x5dff15['id'],_0x5dff15);WhatsappQueueEvents[_0xffa2('0x6')](_0x200fe2,_0x5dff15);_0x274c00(null);};}for(var e in events){if(events[_0xffa2('0x7')](e)){var event=events[e];WhatsappQueue[_0xffa2('0x8')](e,emitEvent(event));}}module[_0xffa2('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 250ffc2..46706f7 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 _0xc62c=['define','whatsapp_queues','lodash','util','request-promise','path','rimraf','./whatsappQueue.attributes','exports'];(function(_0xd7b7c4,_0x3bde33){var _0x3701d4=function(_0x37f7de){while(--_0x37f7de){_0xd7b7c4['push'](_0xd7b7c4['shift']());}};_0x3701d4(++_0x3bde33);}(_0xc62c,0x1f1));var _0xcc62=function(_0x136304,_0x5ab618){_0x136304=_0x136304-0x0;var _0x2281e4=_0xc62c[_0x136304];return _0x2281e4;};'use strict';var _=require(_0xcc62('0x0'));var util=require(_0xcc62('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc62('0x2'));var fs=require('fs');var path=require(_0xcc62('0x3'));var rimraf=require(_0xcc62('0x4'));var config=require('../../config/environment');var attributes=require(_0xcc62('0x5'));module[_0xcc62('0x6')]=function(_0x26341a,_0x1f4c57){return _0x26341a[_0xcc62('0x7')]('WhatsappQueue',attributes,{'tableName':_0xcc62('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x639c=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x39610f,_0x41d050){var _0x26f6f5=function(_0x59a97f){while(--_0x59a97f){_0x39610f['push'](_0x39610f['shift']());}};_0x26f6f5(++_0x41d050);}(_0x639c,0x11c));var _0xc639=function(_0x5d44ed,_0x3ff59b){_0x5d44ed=_0x5d44ed-0x0;var _0x124871=_0x639c[_0x5d44ed];return _0x124871;};'use strict';var _=require(_0xc639('0x0'));var util=require(_0xc639('0x1'));var logger=require(_0xc639('0x2'))('api');var moment=require(_0xc639('0x3'));var BPromise=require(_0xc639('0x4'));var rp=require(_0xc639('0x5'));var fs=require('fs');var path=require(_0xc639('0x6'));var rimraf=require('rimraf');var config=require(_0xc639('0x7'));var attributes=require(_0xc639('0x8'));module[_0xc639('0x9')]=function(_0x2dd3d8,_0x47d00d){return _0x2dd3d8[_0xc639('0xa')](_0xc639('0xb'),attributes,{'tableName':_0xc639('0xc'),'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 f0f7435..9d738fa 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 _0xb0dc=['error','code','message','catch','GetWhatsappQueue','findAll','options','attributes','limit','include','model','ShowWhatsappQueue','WhatsappQueue','find','raw','map','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40c081,_0x57b69a){var _0x1d0e72=function(_0x3c3842){while(--_0x3c3842){_0x40c081['push'](_0x40c081['shift']());}};_0x1d0e72(++_0x57b69a);}(_0xb0dc,0x181));var _0xcb0d=function(_0x3c58ae,_0x2c2fc7){_0x3c58ae=_0x3c58ae-0x0;var _0x473bf0=_0xb0dc[_0x3c58ae];return _0x473bf0;};'use strict';var _=require(_0xcb0d('0x0'));var util=require(_0xcb0d('0x1'));var moment=require(_0xcb0d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb0d('0x3'));var fs=require('fs');var Redis=require(_0xcb0d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb0d('0x5'));var logger=require(_0xcb0d('0x6'))(_0xcb0d('0x7'));var config=require('../../config/environment');var jayson=require(_0xcb0d('0x8'));var client=jayson[_0xcb0d('0x9')][_0xcb0d('0xa')]({'port':0x232a});config[_0xcb0d('0xb')]=_[_0xcb0d('0xc')](config['redis'],{'host':_0xcb0d('0xd'),'port':0x18eb});var socket=require(_0xcb0d('0xe'))(new Redis(config[_0xcb0d('0xb')]));require(_0xcb0d('0xf'))[_0xcb0d('0x10')](socket);function respondWithRpcPromise(_0x5de98c,_0x39b359,_0xe0d3e2){return new BPromise(function(_0x486d9a,_0x5de35e){return client[_0xcb0d('0x11')](_0x5de98c,_0xe0d3e2)[_0xcb0d('0x12')](function(_0x34f98a){logger[_0xcb0d('0x13')](_0xcb0d('0x14'),_0x39b359,_0xcb0d('0x15'));logger[_0xcb0d('0x16')](_0xcb0d('0x17'),_0x39b359,'request\x20sent',JSON[_0xcb0d('0x18')](_0x34f98a));if(_0x34f98a[_0xcb0d('0x19')]){if(_0x34f98a[_0xcb0d('0x19')][_0xcb0d('0x1a')]===0x1f4){logger[_0xcb0d('0x19')](_0xcb0d('0x14'),_0x39b359,_0x34f98a[_0xcb0d('0x19')]['message']);return _0x5de35e(_0x34f98a[_0xcb0d('0x19')][_0xcb0d('0x1b')]);}logger[_0xcb0d('0x19')](_0xcb0d('0x14'),_0x39b359,_0x34f98a[_0xcb0d('0x19')][_0xcb0d('0x1b')]);return _0x486d9a(_0x34f98a['error']['message']);}else{logger[_0xcb0d('0x13')](_0xcb0d('0x14'),_0x39b359,_0xcb0d('0x15'));_0x486d9a(_0x34f98a['result'][_0xcb0d('0x1b')]);}})[_0xcb0d('0x1c')](function(_0x588ae5){logger[_0xcb0d('0x19')](_0xcb0d('0x14'),_0x39b359,_0x588ae5);_0x5de35e(_0x588ae5);});});}exports[_0xcb0d('0x1d')]=function(_0x2a7962){var _0x5cdc10=this;return new Promise(function(_0x733755,_0x17b533){return db['WhatsappQueue'][_0xcb0d('0x1e')]({'raw':_0x2a7962[_0xcb0d('0x1f')]?_0x2a7962[_0xcb0d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2a7962[_0xcb0d('0x1f')]?_0x2a7962[_0xcb0d('0x1f')]['where']||null:null,'attributes':_0x2a7962[_0xcb0d('0x1f')]?_0x2a7962[_0xcb0d('0x1f')][_0xcb0d('0x20')]||null:null,'limit':_0x2a7962[_0xcb0d('0x1f')]?_0x2a7962[_0xcb0d('0x1f')][_0xcb0d('0x21')]||null:null,'include':_0x2a7962[_0xcb0d('0x1f')]?_0x2a7962[_0xcb0d('0x1f')][_0xcb0d('0x22')]?_['map'](_0x2a7962[_0xcb0d('0x1f')][_0xcb0d('0x22')],function(_0x108e85){return{'model':db[_0x108e85['model']],'as':_0x108e85['as'],'attributes':_0x108e85[_0xcb0d('0x20')],'include':_0x108e85[_0xcb0d('0x22')]?_['map'](_0x108e85[_0xcb0d('0x22')],function(_0x52afd3){return{'model':db[_0x52afd3[_0xcb0d('0x23')]],'as':_0x52afd3['as'],'attributes':_0x52afd3[_0xcb0d('0x20')],'include':_0x52afd3[_0xcb0d('0x22')]?_['map'](_0x52afd3[_0xcb0d('0x22')],function(_0x2f4371){return{'model':db[_0x2f4371['model']],'as':_0x2f4371['as'],'attributes':_0x2f4371[_0xcb0d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x958480){logger[_0xcb0d('0x13')]('GetWhatsappQueue',_0x2a7962);logger[_0xcb0d('0x16')](_0xcb0d('0x1d'),_0x2a7962,JSON[_0xcb0d('0x18')](_0x958480));_0x733755(_0x958480);})['catch'](function(_0x103a64){logger[_0xcb0d('0x19')](_0xcb0d('0x1d'),_0x103a64[_0xcb0d('0x1b')],_0x2a7962);_0x17b533(_0x5cdc10[_0xcb0d('0x19')](0x1f4,_0x103a64['message']));});});};exports[_0xcb0d('0x24')]=function(_0x2358dd){var _0x7bdfa0=this;return new Promise(function(_0x44b319,_0x5c993e){return db[_0xcb0d('0x25')][_0xcb0d('0x26')]({'raw':_0x2358dd[_0xcb0d('0x1f')]?_0x2358dd[_0xcb0d('0x1f')][_0xcb0d('0x27')]===undefined?!![]:![]:!![],'where':_0x2358dd[_0xcb0d('0x1f')]?_0x2358dd[_0xcb0d('0x1f')]['where']||null:null,'attributes':_0x2358dd['options']?_0x2358dd[_0xcb0d('0x1f')][_0xcb0d('0x20')]||null:null,'include':_0x2358dd['options']?_0x2358dd[_0xcb0d('0x1f')][_0xcb0d('0x22')]?_['map'](_0x2358dd[_0xcb0d('0x1f')][_0xcb0d('0x22')],function(_0x6d86f9){return{'model':db[_0x6d86f9[_0xcb0d('0x23')]],'as':_0x6d86f9['as'],'attributes':_0x6d86f9[_0xcb0d('0x20')],'include':_0x6d86f9[_0xcb0d('0x22')]?_[_0xcb0d('0x28')](_0x6d86f9[_0xcb0d('0x22')],function(_0x165e59){return{'model':db[_0x165e59[_0xcb0d('0x23')]],'as':_0x165e59['as'],'attributes':_0x165e59[_0xcb0d('0x20')],'include':_0x165e59[_0xcb0d('0x22')]?_['map'](_0x165e59[_0xcb0d('0x22')],function(_0x2c6a59){return{'model':db[_0x2c6a59['model']],'as':_0x2c6a59['as'],'attributes':_0x2c6a59[_0xcb0d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcb0d('0x12')](function(_0x39048a){logger['info'](_0xcb0d('0x24'),_0x2358dd);logger[_0xcb0d('0x16')]('ShowWhatsappQueue',_0x2358dd,JSON[_0xcb0d('0x18')](_0x39048a));_0x44b319(_0x39048a);})[_0xcb0d('0x1c')](function(_0x252870){logger[_0xcb0d('0x19')](_0xcb0d('0x24'),_0x252870[_0xcb0d('0x1b')],_0x2358dd);_0x5c993e(_0x7bdfa0[_0xcb0d('0x19')](0x1f4,_0x252870[_0xcb0d('0x1b')]));});});}; \ No newline at end of file +var _0x227b=['debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','catch','WhatsappQueue,\x20%s,\x20%s','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowWhatsappQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappQueue.socket','request','then','info','request\x20sent'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0x227b,0x125));var _0xb227=function(_0x400462,_0x413a4c){_0x400462=_0x400462-0x0;var _0xf4d7c0=_0x227b[_0x400462];return _0xf4d7c0;};'use strict';var _=require(_0xb227('0x0'));var util=require(_0xb227('0x1'));var moment=require(_0xb227('0x2'));var BPromise=require('bluebird');var rs=require(_0xb227('0x3'));var fs=require('fs');var Redis=require(_0xb227('0x4'));var db=require(_0xb227('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb227('0x6'))(_0xb227('0x7'));var config=require(_0xb227('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb227('0x9')][_0xb227('0xa')]({'port':0x232a});config[_0xb227('0xb')]=_[_0xb227('0xc')](config['redis'],{'host':_0xb227('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb227('0xb')]));require(_0xb227('0xe'))['register'](socket);function respondWithRpcPromise(_0x139f9d,_0x5f26a4,_0x39d37c){return new BPromise(function(_0x3e82a1,_0x41073d){return client[_0xb227('0xf')](_0x139f9d,_0x39d37c)[_0xb227('0x10')](function(_0x44e728){logger[_0xb227('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x5f26a4,_0xb227('0x12'));logger[_0xb227('0x13')](_0xb227('0x14'),_0x5f26a4,_0xb227('0x12'),JSON['stringify'](_0x44e728));if(_0x44e728[_0xb227('0x15')]){if(_0x44e728[_0xb227('0x15')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x5f26a4,_0x44e728[_0xb227('0x15')]['message']);return _0x41073d(_0x44e728[_0xb227('0x15')][_0xb227('0x16')]);}logger[_0xb227('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x5f26a4,_0x44e728[_0xb227('0x15')][_0xb227('0x16')]);return _0x3e82a1(_0x44e728[_0xb227('0x15')][_0xb227('0x16')]);}else{logger[_0xb227('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x5f26a4,_0xb227('0x12'));_0x3e82a1(_0x44e728['result'][_0xb227('0x16')]);}})[_0xb227('0x17')](function(_0x4a7c11){logger[_0xb227('0x15')](_0xb227('0x18'),_0x5f26a4,_0x4a7c11);_0x41073d(_0x4a7c11);});});}exports[_0xb227('0x19')]=function(_0x1372fd){var _0x2053a3=this;return new Promise(function(_0x250c99,_0x5c8eed){return db[_0xb227('0x1a')][_0xb227('0x1b')]({'raw':_0x1372fd[_0xb227('0x1c')]?_0x1372fd['options'][_0xb227('0x1d')]===undefined?!![]:![]:!![],'where':_0x1372fd[_0xb227('0x1c')]?_0x1372fd[_0xb227('0x1c')][_0xb227('0x1e')]||null:null,'attributes':_0x1372fd[_0xb227('0x1c')]?_0x1372fd['options'][_0xb227('0x1f')]||null:null,'limit':_0x1372fd[_0xb227('0x1c')]?_0x1372fd[_0xb227('0x1c')][_0xb227('0x20')]||null:null,'include':_0x1372fd[_0xb227('0x1c')]?_0x1372fd[_0xb227('0x1c')]['include']?_[_0xb227('0x21')](_0x1372fd[_0xb227('0x1c')][_0xb227('0x22')],function(_0x167eb2){return{'model':db[_0x167eb2[_0xb227('0x23')]],'as':_0x167eb2['as'],'attributes':_0x167eb2[_0xb227('0x1f')],'include':_0x167eb2[_0xb227('0x22')]?_[_0xb227('0x21')](_0x167eb2[_0xb227('0x22')],function(_0x534a19){return{'model':db[_0x534a19['model']],'as':_0x534a19['as'],'attributes':_0x534a19['attributes'],'include':_0x534a19['include']?_['map'](_0x534a19[_0xb227('0x22')],function(_0x46ff36){return{'model':db[_0x46ff36[_0xb227('0x23')]],'as':_0x46ff36['as'],'attributes':_0x46ff36[_0xb227('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb227('0x10')](function(_0x4b9e41){logger['info'](_0xb227('0x19'),_0x1372fd);logger[_0xb227('0x13')](_0xb227('0x19'),_0x1372fd,JSON[_0xb227('0x24')](_0x4b9e41));_0x250c99(_0x4b9e41);})[_0xb227('0x17')](function(_0x57c52b){logger[_0xb227('0x15')]('GetWhatsappQueue',_0x57c52b[_0xb227('0x16')],_0x1372fd);_0x5c8eed(_0x2053a3[_0xb227('0x15')](0x1f4,_0x57c52b[_0xb227('0x16')]));});});};exports[_0xb227('0x25')]=function(_0x592727){var _0x85286=this;return new Promise(function(_0x50cfa1,_0x590ab6){return db['WhatsappQueue'][_0xb227('0x26')]({'raw':_0x592727[_0xb227('0x1c')]?_0x592727[_0xb227('0x1c')][_0xb227('0x1d')]===undefined?!![]:![]:!![],'where':_0x592727['options']?_0x592727[_0xb227('0x1c')]['where']||null:null,'attributes':_0x592727[_0xb227('0x1c')]?_0x592727[_0xb227('0x1c')][_0xb227('0x1f')]||null:null,'include':_0x592727[_0xb227('0x1c')]?_0x592727[_0xb227('0x1c')]['include']?_['map'](_0x592727[_0xb227('0x1c')][_0xb227('0x22')],function(_0x4d3ae5){return{'model':db[_0x4d3ae5[_0xb227('0x23')]],'as':_0x4d3ae5['as'],'attributes':_0x4d3ae5[_0xb227('0x1f')],'include':_0x4d3ae5[_0xb227('0x22')]?_[_0xb227('0x21')](_0x4d3ae5[_0xb227('0x22')],function(_0x199d19){return{'model':db[_0x199d19[_0xb227('0x23')]],'as':_0x199d19['as'],'attributes':_0x199d19[_0xb227('0x1f')],'include':_0x199d19['include']?_[_0xb227('0x21')](_0x199d19['include'],function(_0x11fdbb){return{'model':db[_0x11fdbb[_0xb227('0x23')]],'as':_0x11fdbb['as'],'attributes':_0x11fdbb[_0xb227('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb227('0x10')](function(_0x3596c2){logger['info']('ShowWhatsappQueue',_0x592727);logger[_0xb227('0x13')]('ShowWhatsappQueue',_0x592727,JSON[_0xb227('0x24')](_0x3596c2));_0x50cfa1(_0x3596c2);})['catch'](function(_0x5959ab){logger[_0xb227('0x15')](_0xb227('0x25'),_0x5959ab[_0xb227('0x16')],_0x592727);_0x590ab6(_0x85286[_0xb227('0x15')](0x1f4,_0x5959ab[_0xb227('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4dec827..bf1a691 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 _0xcaae=['register','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x4009a4,_0x2a57e5){var _0x28bad6=function(_0x1505c1){while(--_0x1505c1){_0x4009a4['push'](_0x4009a4['shift']());}};_0x28bad6(++_0x2a57e5);}(_0xcaae,0xd2));var _0xecaa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaae[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0xecaa('0x0'));var events=[_0xecaa('0x1'),_0xecaa('0x2'),_0xecaa('0x3')];function createListener(_0x2c6654,_0x2eb374){return function(_0x1ebbe7){_0x2eb374[_0xecaa('0x4')](_0x2c6654,_0x1ebbe7);};}function removeListener(_0x299b90,_0xeb43f5){return function(){WhatsappQueueEvents[_0xecaa('0x5')](_0x299b90,_0xeb43f5);};}exports[_0xecaa('0x6')]=function(_0x3248f6){for(var _0x401019=0x0,_0x307d1f=events['length'];_0x401019<_0x307d1f;_0x401019++){var _0x29a7fd=events[_0x401019];var _0x91f395=createListener(_0xecaa('0x7')+_0x29a7fd,_0x3248f6);WhatsappQueueEvents['on'](_0x29a7fd,_0x91f395);}}; \ No newline at end of file +var _0x3346=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3346,0x73));var _0x6334=function(_0x12a4eb,_0x5349ae){_0x12a4eb=_0x12a4eb-0x0;var _0x766fe8=_0x3346[_0x12a4eb];return _0x766fe8;};'use strict';var WhatsappQueueEvents=require(_0x6334('0x0'));var events=[_0x6334('0x1'),_0x6334('0x2'),'update'];function createListener(_0xf43475,_0xdb493a){return function(_0x564692){_0xdb493a[_0x6334('0x3')](_0xf43475,_0x564692);};}function removeListener(_0x14718f,_0x2a856f){return function(){WhatsappQueueEvents['removeListener'](_0x14718f,_0x2a856f);};}exports[_0x6334('0x4')]=function(_0x126d8e){for(var _0x450cd4=0x0,_0x4d0445=events[_0x6334('0x5')];_0x450cd4<_0x4d0445;_0x450cd4++){var _0x1fc375=events[_0x450cd4];var _0x1de57e=createListener(_0x6334('0x6')+_0x1fc375,_0x126d8e);WhatsappQueueEvents['on'](_0x1fc375,_0x1de57e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8fb0dc7..59ee521 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 _0x17e9=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x5679fe,_0x4fc4f0){var _0x5565ed=function(_0x5407e7){while(--_0x5407e7){_0x5679fe['push'](_0x5679fe['shift']());}};_0x5565ed(++_0x4fc4f0);}(_0x17e9,0x142));var _0x917e=function(_0x41b531,_0x123f0a){_0x41b531=_0x41b531-0x0;var _0x574ee8=_0x17e9[_0x41b531];return _0x574ee8;};'use strict';var multer=require(_0x917e('0x0'));var util=require(_0x917e('0x1'));var path=require(_0x917e('0x2'));var timeout=require('connect-timeout');var express=require(_0x917e('0x3'));var router=express[_0x917e('0x4')]();var fs_extra=require(_0x917e('0x5'));var auth=require(_0x917e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x917e('0x7'));var controller=require(_0x917e('0x8'));router[_0x917e('0x9')]('/',auth[_0x917e('0xa')](),controller[_0x917e('0xb')]);router[_0x917e('0x9')](_0x917e('0xc'),auth[_0x917e('0xa')](),controller[_0x917e('0xd')]);router[_0x917e('0x9')]('/:id',auth[_0x917e('0xa')](),controller[_0x917e('0xe')]);router[_0x917e('0xf')]('/',auth[_0x917e('0xa')](),controller[_0x917e('0x10')]);router[_0x917e('0x11')](_0x917e('0x12'),auth[_0x917e('0xa')](),controller[_0x917e('0x13')]);router[_0x917e('0x14')](_0x917e('0x12'),auth[_0x917e('0xa')](),controller[_0x917e('0x15')]);module[_0x917e('0x16')]=router; \ No newline at end of file +var _0xfb6a=['get','index','isAuthenticated','describe','/:id','show','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller'];(function(_0x5dacdf,_0x32cd54){var _0x138f3c=function(_0x2ed478){while(--_0x2ed478){_0x5dacdf['push'](_0x5dacdf['shift']());}};_0x138f3c(++_0x32cd54);}(_0xfb6a,0x79));var _0xafb6=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xfb6a[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0xafb6('0x0'));var util=require('util');var path=require(_0xafb6('0x1'));var timeout=require(_0xafb6('0x2'));var express=require('express');var router=express[_0xafb6('0x3')]();var fs_extra=require(_0xafb6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xafb6('0x5'));var controller=require(_0xafb6('0x6'));router[_0xafb6('0x7')]('/',auth['isAuthenticated'](),controller[_0xafb6('0x8')]);router[_0xafb6('0x7')]('/describe',auth[_0xafb6('0x9')](),controller[_0xafb6('0xa')]);router[_0xafb6('0x7')](_0xafb6('0xb'),auth[_0xafb6('0x9')](),controller[_0xafb6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xafb6('0xd')](_0xafb6('0xb'),auth[_0xafb6('0x9')](),controller[_0xafb6('0xe')]);router[_0xafb6('0xf')](_0xafb6('0xb'),auth[_0xafb6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index f410bd6..095ad51 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x603526,_0x30e53a){var _0x4c7d27=function(_0x21fbde){while(--_0x21fbde){_0x603526['push'](_0x603526['shift']());}};_0x4c7d27(++_0x30e53a);}(_0x7a54,0x106));var _0x47a5=function(_0x16704c,_0x5430fc){_0x16704c=_0x16704c-0x0;var _0x1c6b2c=_0x7a54[_0x16704c];return _0x1c6b2c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4bfe98,_0x5034da){var _0x41b008=function(_0x10740c){while(--_0x10740c){_0x4bfe98['push'](_0x4bfe98['shift']());}};_0x41b008(++_0x5034da);}(_0x7a54,0x106));var _0x47a5=function(_0x2c0087,_0x58452b){_0x2c0087=_0x2c0087-0x0;var _0x1f3b31=_0x7a54[_0x2c0087];return _0x1f3b31;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 4d1f129..d0c6ace 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 _0xb03e=['destroy','error','stack','name','send','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then'];(function(_0x3e4d72,_0x69279){var _0x594622=function(_0x57a2ac){while(--_0x57a2ac){_0x3e4d72['push'](_0x3e4d72['shift']());}};_0x594622(++_0x69279);}(_0xb03e,0x1eb));var _0xeb03=function(_0x322785,_0x3fa796){_0x322785=_0x322785-0x0;var _0x2a9b47=_0xb03e[_0x322785];return _0x2a9b47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];function respondWithStatusCode(_0x367d36,_0x384cbe){_0x384cbe=_0x384cbe||0xcc;return function(_0x97f46d){if(_0x97f46d){return _0x367d36[_0xeb03('0x1b')](_0x384cbe);}return _0x367d36[_0xeb03('0x1c')](_0x384cbe)[_0xeb03('0x1d')]();};}function respondWithResult(_0x4d9c8e,_0x212082){_0x212082=_0x212082||0xc8;return function(_0x100bef){if(_0x100bef){return _0x4d9c8e[_0xeb03('0x1c')](_0x212082)[_0xeb03('0x1e')](_0x100bef);}};}function respondWithFilteredResult(_0x52be5b,_0x15f4fe){return function(_0x36f5d8){if(_0x36f5d8){var _0x3f26ef=typeof _0x15f4fe['offset']===_0xeb03('0x1f')&&typeof _0x15f4fe[_0xeb03('0x20')]===_0xeb03('0x1f');var _0x44716c=_0x36f5d8[_0xeb03('0x21')];var _0x1b4cbd=_0x3f26ef?0x0:_0x15f4fe[_0xeb03('0x22')];var _0x8d6725=_0x3f26ef?_0x36f5d8[_0xeb03('0x21')]:_0x15f4fe[_0xeb03('0x22')]+_0x15f4fe[_0xeb03('0x20')];var _0x2c238d;if(_0x8d6725>=_0x44716c){_0x8d6725=_0x44716c;_0x2c238d=0xc8;}else{_0x2c238d=0xce;}_0x52be5b[_0xeb03('0x1c')](_0x2c238d);return _0x52be5b[_0xeb03('0x23')]('Content-Range',_0x1b4cbd+'-'+_0x8d6725+'/'+_0x44716c)[_0xeb03('0x1e')](_0x36f5d8);}return null;};}function patchUpdates(_0x3855dd){return function(_0x413d3e){try{jsonpatch[_0xeb03('0x24')](_0x413d3e,_0x3855dd,!![]);}catch(_0xe5a1c2){return BPromise[_0xeb03('0x25')](_0xe5a1c2);}return _0x413d3e[_0xeb03('0x26')]();};}function saveUpdates(_0x2c795b,_0x3c3d09){return function(_0x5a704b){if(_0x5a704b){return _0x5a704b[_0xeb03('0x27')](_0x2c795b)[_0xeb03('0x28')](function(_0x11ea85){return _0x11ea85;});}return null;};}function removeEntity(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(_0x5dcda3){return _0x5dcda3[_0xeb03('0x29')]()[_0xeb03('0x28')](function(){_0x300dc0[_0xeb03('0x1c')](0xcc)[_0xeb03('0x1d')]();});}};}function handleEntityNotFound(_0x3f276a,_0x119697){return function(_0xb04f34){if(!_0xb04f34){_0x3f276a[_0xeb03('0x1b')](0x194);}return _0xb04f34;};}function handleError(_0xbb7ff,_0x4984f6){_0x4984f6=_0x4984f6||0x1f4;return function(_0x832372){logger[_0xeb03('0x2a')](_0x832372[_0xeb03('0x2b')]);if(_0x832372[_0xeb03('0x2c')]){delete _0x832372['name'];}_0xbb7ff['status'](_0x4984f6)[_0xeb03('0x2d')](_0x832372);};}exports['index']=function(_0x31a622,_0x8bd544){var _0x160a37={},_0x5db8bb={},_0xd4c8ec={'count':0x0,'rows':[]};var _0x5de53a=_['map'](db['WhatsappQueueReport']['rawAttributes'],function(_0x421a27){return{'name':_0x421a27[_0xeb03('0x2e')],'type':_0x421a27['type']['key']};});_0x5db8bb['model']=_['map'](_0x5de53a,_0xeb03('0x2c'));_0x5db8bb[_0xeb03('0x2f')]=_[_0xeb03('0x30')](_0x31a622[_0xeb03('0x2f')]);_0x5db8bb[_0xeb03('0x31')]=_['intersection'](_0x5db8bb[_0xeb03('0x32')],_0x5db8bb['query']);_0x160a37[_0xeb03('0x33')]=_[_0xeb03('0x34')](_0x5db8bb[_0xeb03('0x32')],qs[_0xeb03('0x35')](_0x31a622[_0xeb03('0x2f')][_0xeb03('0x35')]));_0x160a37[_0xeb03('0x33')]=_0x160a37[_0xeb03('0x33')]['length']?_0x160a37[_0xeb03('0x33')]:_0x5db8bb['model'];if(!_0x31a622[_0xeb03('0x2f')][_0xeb03('0x36')](_0xeb03('0x37'))){_0x160a37[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x31a622[_0xeb03('0x2f')]['limit']);_0x160a37[_0xeb03('0x22')]=qs['offset'](_0x31a622['query']['offset']);}_0x160a37[_0xeb03('0x38')]=qs[_0xeb03('0x39')](_0x31a622[_0xeb03('0x2f')][_0xeb03('0x39')]);_0x160a37[_0xeb03('0x3a')]=qs['filters'](_[_0xeb03('0x3b')](_0x31a622[_0xeb03('0x2f')],_0x5db8bb[_0xeb03('0x31')]),_0x5de53a);if(_0x31a622['query']['filter']){_0x160a37[_0xeb03('0x3a')]=_[_0xeb03('0x3c')](_0x160a37[_0xeb03('0x3a')],{'$or':_['map'](_0x5de53a,function(_0x328f72){if(_0x328f72[_0xeb03('0x3d')]!=='VIRTUAL'){var _0x49edb3={};_0x49edb3[_0x328f72[_0xeb03('0x2c')]]={'$like':'%'+_0x31a622[_0xeb03('0x2f')]['filter']+'%'};return _0x49edb3;}})});}_0x160a37=_[_0xeb03('0x3c')]({},_0x160a37,_0x31a622[_0xeb03('0x3e')]);var _0x3fa3de={'where':_0x160a37[_0xeb03('0x3a')]};return db[_0xeb03('0x3f')][_0xeb03('0x21')](_0x3fa3de)[_0xeb03('0x28')](function(_0x3c1c21){_0xd4c8ec[_0xeb03('0x21')]=_0x3c1c21;if(_0x31a622[_0xeb03('0x2f')][_0xeb03('0x40')]){_0x160a37[_0xeb03('0x41')]=[{'all':!![]}];}return db[_0xeb03('0x3f')][_0xeb03('0x42')](_0x160a37);})[_0xeb03('0x28')](function(_0x6b95dd){_0xd4c8ec[_0xeb03('0x43')]=_0x6b95dd;return _0xd4c8ec;})[_0xeb03('0x28')](respondWithFilteredResult(_0x8bd544,_0x160a37))[_0xeb03('0x44')](handleError(_0x8bd544,null));};exports[_0xeb03('0x45')]=function(_0x43e530,_0x2f83c3){var _0x2879b0={'raw':!![],'where':{'id':_0x43e530['params']['id']}},_0x5bb7d9={};_0x5bb7d9[_0xeb03('0x32')]=_[_0xeb03('0x30')](db[_0xeb03('0x3f')][_0xeb03('0x46')]);_0x5bb7d9[_0xeb03('0x2f')]=_[_0xeb03('0x30')](_0x43e530[_0xeb03('0x2f')]);_0x5bb7d9[_0xeb03('0x31')]=_['intersection'](_0x5bb7d9[_0xeb03('0x32')],_0x5bb7d9[_0xeb03('0x2f')]);_0x2879b0[_0xeb03('0x33')]=_[_0xeb03('0x34')](_0x5bb7d9[_0xeb03('0x32')],qs['fields'](_0x43e530['query'][_0xeb03('0x35')]));_0x2879b0['attributes']=_0x2879b0['attributes']['length']?_0x2879b0[_0xeb03('0x33')]:_0x5bb7d9[_0xeb03('0x32')];if(_0x43e530[_0xeb03('0x2f')][_0xeb03('0x40')]){_0x2879b0[_0xeb03('0x41')]=[{'all':!![]}];}_0x2879b0=_[_0xeb03('0x3c')]({},_0x2879b0,_0x43e530['options']);return db[_0xeb03('0x3f')]['find'](_0x2879b0)['then'](handleEntityNotFound(_0x2f83c3,null))[_0xeb03('0x28')](respondWithResult(_0x2f83c3,null))[_0xeb03('0x44')](handleError(_0x2f83c3,null));};exports[_0xeb03('0x47')]=function(_0x54d7ce,_0x404191){return db[_0xeb03('0x3f')][_0xeb03('0x47')](_0x54d7ce[_0xeb03('0x48')],{})[_0xeb03('0x28')](respondWithResult(_0x404191,0xc9))['catch'](handleError(_0x404191,null));};exports[_0xeb03('0x27')]=function(_0x4dc1f6,_0x13c295){if(_0x4dc1f6[_0xeb03('0x48')]['id']){delete _0x4dc1f6[_0xeb03('0x48')]['id'];}return db[_0xeb03('0x3f')][_0xeb03('0x49')]({'where':{'id':_0x4dc1f6[_0xeb03('0x4a')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x13c295,null))[_0xeb03('0x28')](saveUpdates(_0x4dc1f6[_0xeb03('0x48')],null))[_0xeb03('0x28')](respondWithResult(_0x13c295,null))[_0xeb03('0x44')](handleError(_0x13c295,null));};exports[_0xeb03('0x29')]=function(_0x2f2066,_0x345a98){return db[_0xeb03('0x3f')][_0xeb03('0x49')]({'where':{'id':_0x2f2066[_0xeb03('0x4a')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x345a98,null))[_0xeb03('0x28')](removeEntity(_0x345a98,null))[_0xeb03('0x44')](handleError(_0x345a98,null));};exports[_0xeb03('0x4b')]=function(_0x333fba,_0x1761ab){return db[_0xeb03('0x3f')]['describe']()[_0xeb03('0x28')](respondWithResult(_0x1761ab,null))[_0xeb03('0x44')](handleError(_0x1761ab,null));}; \ No newline at end of file +var _0x4024=['rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x4024,0x89));var _0x4402=function(_0x2add6a,_0x53f971){_0x2add6a=_0x2add6a-0x0;var _0x476d2e=_0x4024[_0x2add6a];return _0x476d2e;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){_0x258d10['status'](0xcc)[_0x4402('0x15')]();});}};}function handleEntityNotFound(_0x4e1c04,_0x3733cd){return function(_0x5ab28d){if(!_0x5ab28d){_0x4e1c04[_0x4402('0x13')](0x194);}return _0x5ab28d;};}function handleError(_0x211424,_0x5a43d0){_0x5a43d0=_0x5a43d0||0x1f4;return function(_0x15c19f){logger['error'](_0x15c19f['stack']);if(_0x15c19f[_0x4402('0x21')]){delete _0x15c19f[_0x4402('0x21')];}_0x211424[_0x4402('0x14')](_0x5a43d0)[_0x4402('0x22')](_0x15c19f);};}exports[_0x4402('0x23')]=function(_0x514e41,_0x41de44){var _0x52e625={},_0x71da2f={},_0x1e2340={'count':0x0,'rows':[]};var _0x42dd32=_['map'](db[_0x4402('0x24')][_0x4402('0x25')],function(_0x316239){return{'name':_0x316239[_0x4402('0x26')],'type':_0x316239[_0x4402('0x27')][_0x4402('0x28')]};});_0x71da2f[_0x4402('0x29')]=_[_0x4402('0x2a')](_0x42dd32,_0x4402('0x21'));_0x71da2f[_0x4402('0x2b')]=_[_0x4402('0x2c')](_0x514e41['query']);_0x71da2f[_0x4402('0x2d')]=_['intersection'](_0x71da2f[_0x4402('0x29')],_0x71da2f['query']);_0x52e625[_0x4402('0x2e')]=_[_0x4402('0x2f')](_0x71da2f[_0x4402('0x29')],qs[_0x4402('0x30')](_0x514e41[_0x4402('0x2b')]['fields']));_0x52e625[_0x4402('0x2e')]=_0x52e625[_0x4402('0x2e')][_0x4402('0x31')]?_0x52e625['attributes']:_0x71da2f[_0x4402('0x29')];if(!_0x514e41[_0x4402('0x2b')]['hasOwnProperty'](_0x4402('0x32'))){_0x52e625[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x514e41[_0x4402('0x2b')][_0x4402('0x19')]);_0x52e625[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x514e41[_0x4402('0x2b')][_0x4402('0x17')]);}_0x52e625['order']=qs[_0x4402('0x33')](_0x514e41[_0x4402('0x2b')][_0x4402('0x33')]);_0x52e625['where']=qs[_0x4402('0x2d')](_[_0x4402('0x34')](_0x514e41['query'],_0x71da2f['filters']),_0x42dd32);if(_0x514e41[_0x4402('0x2b')][_0x4402('0x35')]){_0x52e625[_0x4402('0x36')]=_[_0x4402('0x37')](_0x52e625['where'],{'$or':_['map'](_0x42dd32,function(_0x4b0672){if(_0x4b0672[_0x4402('0x27')]!==_0x4402('0x38')){var _0xcbfa06={};_0xcbfa06[_0x4b0672[_0x4402('0x21')]]={'$like':'%'+_0x514e41['query'][_0x4402('0x35')]+'%'};return _0xcbfa06;}})});}_0x52e625=_[_0x4402('0x37')]({},_0x52e625,_0x514e41[_0x4402('0x39')]);var _0x57843d={'where':_0x52e625[_0x4402('0x36')]};return db['WhatsappQueueReport'][_0x4402('0x1a')](_0x57843d)[_0x4402('0x1f')](function(_0x5c74b1){_0x1e2340[_0x4402('0x1a')]=_0x5c74b1;if(_0x514e41['query'][_0x4402('0x3a')]){_0x52e625[_0x4402('0x3b')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x4402('0x3c')](_0x52e625);})[_0x4402('0x1f')](function(_0x250f09){_0x1e2340[_0x4402('0x3d')]=_0x250f09;return _0x1e2340;})['then'](respondWithFilteredResult(_0x41de44,_0x52e625))['catch'](handleError(_0x41de44,null));};exports[_0x4402('0x3e')]=function(_0x47a3a3,_0x3a589b){var _0x2a6d78={'raw':!![],'where':{'id':_0x47a3a3[_0x4402('0x3f')]['id']}},_0xb9cf85={};_0xb9cf85[_0x4402('0x29')]=_[_0x4402('0x2c')](db[_0x4402('0x24')][_0x4402('0x25')]);_0xb9cf85[_0x4402('0x2b')]=_[_0x4402('0x2c')](_0x47a3a3['query']);_0xb9cf85[_0x4402('0x2d')]=_[_0x4402('0x2f')](_0xb9cf85['model'],_0xb9cf85[_0x4402('0x2b')]);_0x2a6d78[_0x4402('0x2e')]=_['intersection'](_0xb9cf85[_0x4402('0x29')],qs[_0x4402('0x30')](_0x47a3a3[_0x4402('0x2b')][_0x4402('0x30')]));_0x2a6d78[_0x4402('0x2e')]=_0x2a6d78['attributes'][_0x4402('0x31')]?_0x2a6d78[_0x4402('0x2e')]:_0xb9cf85[_0x4402('0x29')];if(_0x47a3a3[_0x4402('0x2b')][_0x4402('0x3a')]){_0x2a6d78[_0x4402('0x3b')]=[{'all':!![]}];}_0x2a6d78=_[_0x4402('0x37')]({},_0x2a6d78,_0x47a3a3[_0x4402('0x39')]);return db[_0x4402('0x24')][_0x4402('0x40')](_0x2a6d78)[_0x4402('0x1f')](handleEntityNotFound(_0x3a589b,null))['then'](respondWithResult(_0x3a589b,null))[_0x4402('0x41')](handleError(_0x3a589b,null));};exports['create']=function(_0xc45af6,_0x34ce00){return db['WhatsappQueueReport'][_0x4402('0x42')](_0xc45af6[_0x4402('0x43')],{})[_0x4402('0x1f')](respondWithResult(_0x34ce00,0xc9))[_0x4402('0x41')](handleError(_0x34ce00,null));};exports[_0x4402('0x1e')]=function(_0x2503eb,_0x5b094b){if(_0x2503eb[_0x4402('0x43')]['id']){delete _0x2503eb[_0x4402('0x43')]['id'];}return db[_0x4402('0x24')][_0x4402('0x40')]({'where':{'id':_0x2503eb[_0x4402('0x3f')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x5b094b,null))[_0x4402('0x1f')](saveUpdates(_0x2503eb[_0x4402('0x43')],null))[_0x4402('0x1f')](respondWithResult(_0x5b094b,null))['catch'](handleError(_0x5b094b,null));};exports['destroy']=function(_0x5ab12b,_0x4c2d2e){return db[_0x4402('0x24')][_0x4402('0x40')]({'where':{'id':_0x5ab12b[_0x4402('0x3f')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4c2d2e,null))['then'](removeEntity(_0x4c2d2e,null))[_0x4402('0x41')](handleError(_0x4c2d2e,null));};exports[_0x4402('0x44')]=function(_0x203b33,_0x2a4ea7){return db[_0x4402('0x24')][_0x4402('0x44')]()[_0x4402('0x1f')](respondWithResult(_0x2a4ea7,null))['catch'](handleError(_0x2a4ea7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index ab97ff6..6f45dc8 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 _0x2f6f=['moment','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','api'];(function(_0xc61b54,_0x28e6c6){var _0x5cb7fa=function(_0x2d72bb){while(--_0x2d72bb){_0xc61b54['push'](_0xc61b54['shift']());}};_0x5cb7fa(++_0x28e6c6);}(_0x2f6f,0x14e));var _0xf2f6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2f6f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf2f6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf2f6('0x1'));var moment=require(_0xf2f6('0x2'));var BPromise=require('bluebird');var rp=require(_0xf2f6('0x3'));var fs=require('fs');var path=require(_0xf2f6('0x4'));var rimraf=require(_0xf2f6('0x5'));var config=require(_0xf2f6('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0xf2f6('0x7')]=function(_0xc83229,_0x2d45f5){return _0xc83229[_0xf2f6('0x8')](_0xf2f6('0x9'),attributes,{'tableName':_0xf2f6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf2f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c63=['uniqueid','util','../../config/logger','api','moment','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0x8c63,0xdd));var _0x38c6=function(_0x12641c,_0x386de0){_0x12641c=_0x12641c-0x0;var _0x28745c=_0x8c63[_0x12641c];return _0x28745c;};'use strict';var _=require('lodash');var util=require(_0x38c6('0x0'));var logger=require(_0x38c6('0x1'))(_0x38c6('0x2'));var moment=require(_0x38c6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x38c6('0x4'));var config=require('../../config/environment');var attributes=require(_0x38c6('0x5'));module['exports']=function(_0x17910b,_0x5bd848){return _0x17910b[_0x38c6('0x6')](_0x38c6('0x7'),attributes,{'tableName':_0x38c6('0x8'),'paranoid':![],'indexes':[{'name':_0x38c6('0x9'),'fields':[_0x38c6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index d76a209..de8cb31 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 _0x179f=['code','WhatsappQueueReport,\x20%s,\x20%s','message','result','create','options','raw','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','body','where','limit','debug','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b136c,_0xa358f5){var _0x329e1f=function(_0xb93134){while(--_0xb93134){_0x5b136c['push'](_0x5b136c['shift']());}};_0x329e1f(++_0xa358f5);}(_0x179f,0x187));var _0xf179=function(_0x303aa8,_0x3fb7ec){_0x303aa8=_0x303aa8-0x0;var _0x2248bb=_0x179f[_0x303aa8];return _0x2248bb;};'use strict';var _=require(_0xf179('0x0'));var util=require('util');var moment=require(_0xf179('0x1'));var BPromise=require(_0xf179('0x2'));var rs=require(_0xf179('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf179('0x4'));var logger=require(_0xf179('0x5'))('rpc');var config=require(_0xf179('0x6'));var jayson=require(_0xf179('0x7'));var client=jayson[_0xf179('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31ad3a,_0x362cd6,_0x123d40){return new BPromise(function(_0x5202fb,_0x2ce615){return client['request'](_0x31ad3a,_0x123d40)[_0xf179('0x9')](function(_0x48c983){logger[_0xf179('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x362cd6,_0xf179('0xb'));logger['debug'](_0xf179('0xc'),_0x362cd6,_0xf179('0xb'),JSON[_0xf179('0xd')](_0x48c983));if(_0x48c983['error']){if(_0x48c983[_0xf179('0xe')][_0xf179('0xf')]===0x1f4){logger['error'](_0xf179('0x10'),_0x362cd6,_0x48c983['error'][_0xf179('0x11')]);return _0x2ce615(_0x48c983[_0xf179('0xe')][_0xf179('0x11')]);}logger[_0xf179('0xe')](_0xf179('0x10'),_0x362cd6,_0x48c983['error']['message']);return _0x5202fb(_0x48c983['error'][_0xf179('0x11')]);}else{logger[_0xf179('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x362cd6,_0xf179('0xb'));_0x5202fb(_0x48c983[_0xf179('0x12')][_0xf179('0x11')]);}})['catch'](function(_0x3472d0){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x362cd6,_0x3472d0);_0x2ce615(_0x3472d0);});});}exports['CreateWhatsappQueueReport']=function(_0x16b40b){var _0x3eb2f2=this;return new Promise(function(_0x10cfdb,_0x24fc63){return db['WhatsappQueueReport'][_0xf179('0x13')](_0x16b40b['body'],{'raw':_0x16b40b[_0xf179('0x14')]?_0x16b40b[_0xf179('0x14')][_0xf179('0x15')]===undefined?!![]:![]:!![]})[_0xf179('0x9')](function(_0x558127){logger[_0xf179('0xa')](_0xf179('0x16'),_0x16b40b);logger['debug'](_0xf179('0x16'),_0x16b40b,JSON['stringify'](_0x558127));_0x10cfdb(_0x558127);})[_0xf179('0x17')](function(_0xb10a4a){logger[_0xf179('0xe')](_0xf179('0x16'),_0xb10a4a[_0xf179('0x11')],_0x16b40b);_0x24fc63(_0x3eb2f2[_0xf179('0xe')](0x1f4,_0xb10a4a[_0xf179('0x11')]));});});};exports[_0xf179('0x18')]=function(_0x495229){var _0x121d9a=this;return new Promise(function(_0x54860b,_0x3961b7){return db['WhatsappQueueReport']['update'](_0x495229[_0xf179('0x19')],{'raw':_0x495229[_0xf179('0x14')]?_0x495229[_0xf179('0x14')][_0xf179('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495229[_0xf179('0x14')]?_0x495229[_0xf179('0x14')][_0xf179('0x1a')]||null:null,'attributes':_0x495229[_0xf179('0x14')]?_0x495229[_0xf179('0x14')]['attributes']||null:null,'limit':_0x495229[_0xf179('0x14')]?_0x495229[_0xf179('0x14')][_0xf179('0x1b')]||null:null})[_0xf179('0x9')](function(_0x3e4e3c){logger[_0xf179('0xa')](_0xf179('0x18'),_0x495229);logger[_0xf179('0x1c')](_0xf179('0x18'),_0x495229,JSON[_0xf179('0xd')](_0x3e4e3c));_0x54860b(_0x3e4e3c);})['catch'](function(_0x4613e8){logger[_0xf179('0xe')](_0xf179('0x18'),_0x4613e8[_0xf179('0x11')],_0x495229);_0x3961b7(_0x121d9a[_0xf179('0xe')](0x1f4,_0x4613e8[_0xf179('0x11')]));});});}; \ No newline at end of file +var _0xf64c=['WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','then','stringify','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xf64c,0xb6));var _0xcf64=function(_0x5220f0,_0x2daef4){_0x5220f0=_0x5220f0-0x0;var _0x555f23=_0xf64c[_0x5220f0];return _0x555f23;};'use strict';var _=require(_0xcf64('0x0'));var util=require('util');var moment=require(_0xcf64('0x1'));var BPromise=require(_0xcf64('0x2'));var rs=require(_0xcf64('0x3'));var fs=require('fs');var Redis=require(_0xcf64('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf64('0x5'));var logger=require(_0xcf64('0x6'))(_0xcf64('0x7'));var config=require(_0xcf64('0x8'));var jayson=require(_0xcf64('0x9'));var client=jayson['client'][_0xcf64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x198a25,_0x334d16,_0x31a02c){return new BPromise(function(_0x360393,_0x53674e){return client['request'](_0x198a25,_0x31a02c)['then'](function(_0x70838b){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x334d16,_0xcf64('0xb'));logger[_0xcf64('0xc')](_0xcf64('0xd'),_0x334d16,_0xcf64('0xb'),JSON['stringify'](_0x70838b));if(_0x70838b[_0xcf64('0xe')]){if(_0x70838b[_0xcf64('0xe')][_0xcf64('0xf')]===0x1f4){logger[_0xcf64('0xe')](_0xcf64('0x10'),_0x334d16,_0x70838b[_0xcf64('0xe')][_0xcf64('0x11')]);return _0x53674e(_0x70838b[_0xcf64('0xe')]['message']);}logger[_0xcf64('0xe')](_0xcf64('0x10'),_0x334d16,_0x70838b[_0xcf64('0xe')][_0xcf64('0x11')]);return _0x360393(_0x70838b[_0xcf64('0xe')]['message']);}else{logger[_0xcf64('0x12')](_0xcf64('0x10'),_0x334d16,_0xcf64('0xb'));_0x360393(_0x70838b[_0xcf64('0x13')][_0xcf64('0x11')]);}})[_0xcf64('0x14')](function(_0x1495cc){logger[_0xcf64('0xe')](_0xcf64('0x10'),_0x334d16,_0x1495cc);_0x53674e(_0x1495cc);});});}exports[_0xcf64('0x15')]=function(_0x45cdb3){var _0x500176=this;return new Promise(function(_0xa5ac98,_0x3fb02b){return db[_0xcf64('0x16')]['create'](_0x45cdb3[_0xcf64('0x17')],{'raw':_0x45cdb3[_0xcf64('0x18')]?_0x45cdb3[_0xcf64('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xcf64('0x19')](function(_0x13cdb6){logger[_0xcf64('0x12')]('CreateWhatsappQueueReport',_0x45cdb3);logger['debug']('CreateWhatsappQueueReport',_0x45cdb3,JSON[_0xcf64('0x1a')](_0x13cdb6));_0xa5ac98(_0x13cdb6);})[_0xcf64('0x14')](function(_0x4522e7){logger[_0xcf64('0xe')](_0xcf64('0x15'),_0x4522e7['message'],_0x45cdb3);_0x3fb02b(_0x500176[_0xcf64('0xe')](0x1f4,_0x4522e7[_0xcf64('0x11')]));});});};exports[_0xcf64('0x1b')]=function(_0x1bae69){var _0x5560c3=this;return new Promise(function(_0x391b47,_0xd9156c){return db[_0xcf64('0x16')][_0xcf64('0x1c')](_0x1bae69[_0xcf64('0x17')],{'raw':_0x1bae69[_0xcf64('0x18')]?_0x1bae69[_0xcf64('0x18')][_0xcf64('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bae69[_0xcf64('0x18')]?_0x1bae69[_0xcf64('0x18')][_0xcf64('0x1e')]||null:null,'attributes':_0x1bae69[_0xcf64('0x18')]?_0x1bae69[_0xcf64('0x18')][_0xcf64('0x1f')]||null:null,'limit':_0x1bae69[_0xcf64('0x18')]?_0x1bae69['options'][_0xcf64('0x20')]||null:null})[_0xcf64('0x19')](function(_0x320327){logger['info'](_0xcf64('0x1b'),_0x1bae69);logger['debug']('UpdateWhatsappQueueReport',_0x1bae69,JSON[_0xcf64('0x1a')](_0x320327));_0x391b47(_0x320327);})[_0xcf64('0x14')](function(_0x4bce1f){logger[_0xcf64('0xe')](_0xcf64('0x1b'),_0x4bce1f[_0xcf64('0x11')],_0x1bae69);_0xd9156c(_0x5560c3['error'](0x1f4,_0x4bce1f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index a8ee80d..3e58425 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 _0x89ce=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','show'];(function(_0x234732,_0x16d1e8){var _0x34dfb8=function(_0x4b6a32){while(--_0x4b6a32){_0x234732['push'](_0x234732['shift']());}};_0x34dfb8(++_0x16d1e8);}(_0x89ce,0x6c));var _0xe89c=function(_0x28ea2c,_0xd6a518){_0x28ea2c=_0x28ea2c-0x0;var _0x36b997=_0x89ce[_0x28ea2c];return _0x36b997;};'use strict';var multer=require(_0xe89c('0x0'));var util=require(_0xe89c('0x1'));var path=require(_0xe89c('0x2'));var timeout=require(_0xe89c('0x3'));var express=require('express');var router=express[_0xe89c('0x4')]();var fs_extra=require(_0xe89c('0x5'));var auth=require(_0xe89c('0x6'));var interaction=require(_0xe89c('0x7'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xe89c('0x8')](),controller['index']);router[_0xe89c('0x9')](_0xe89c('0xa'),auth[_0xe89c('0x8')](),controller['describe']);router[_0xe89c('0x9')]('/:id',auth[_0xe89c('0x8')](),controller[_0xe89c('0xb')]);router[_0xe89c('0xc')]('/',auth[_0xe89c('0x8')](),controller[_0xe89c('0xd')]);router[_0xe89c('0xe')](_0xe89c('0xf'),auth['isAuthenticated'](),controller[_0xe89c('0x10')]);router[_0xe89c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe89c('0x12')]);module[_0xe89c('0x13')]=router; \ No newline at end of file +var _0x9360=['../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','show','/:id','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x394c4c,_0x201031){var _0x5bfa5a=function(_0x4a5eed){while(--_0x4a5eed){_0x394c4c['push'](_0x394c4c['shift']());}};_0x5bfa5a(++_0x201031);}(_0x9360,0x1ea));var _0x0936=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9360[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0936('0x0'));var util=require('util');var path=require(_0x0936('0x1'));var timeout=require(_0x0936('0x2'));var express=require('express');var router=express[_0x0936('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0936('0x4'));var interaction=require(_0x0936('0x5'));var config=require(_0x0936('0x6'));var controller=require(_0x0936('0x7'));router[_0x0936('0x8')]('/',auth[_0x0936('0x9')](),controller['index']);router[_0x0936('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x0936('0xa')]);router[_0x0936('0x8')]('/:id',auth[_0x0936('0x9')](),controller[_0x0936('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0936('0xc'),auth[_0x0936('0x9')](),controller[_0x0936('0xd')]);router['delete'](_0x0936('0xc'),auth[_0x0936('0x9')](),controller[_0x0936('0xe')]);module[_0x0936('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 09ee2d5..cd11394 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 _0x74fd=['agent','queue','DATE','sequelize','STRING','ENUM','account'];(function(_0xa54031,_0x21531e){var _0x3c201f=function(_0x5a7ff4){while(--_0x5a7ff4){_0xa54031['push'](_0xa54031['shift']());}};_0x3c201f(++_0x21531e);}(_0x74fd,0x8f));var _0xd74f=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x74fd[_0x1f83a5];return _0x45edf0;};'use strict';var Sequelize=require(_0xd74f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd74f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd74f('0x2')](_0xd74f('0x3'),_0xd74f('0x4'),_0xd74f('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd74f('0x6')]}}; \ No newline at end of file +var _0xef0a=['ENUM','account','agent','queue','DATE','sequelize','exports','STRING'];(function(_0x24f821,_0x566367){var _0x591714=function(_0x3e8a89){while(--_0x3e8a89){_0x24f821['push'](_0x24f821['shift']());}};_0x591714(++_0x566367);}(_0xef0a,0xdd));var _0xaef0=function(_0x317605,_0x3d7d7f){_0x317605=_0x317605-0x0;var _0x4ca763=_0xef0a[_0x317605];return _0x4ca763;};'use strict';var Sequelize=require(_0xaef0('0x0'));module[_0xaef0('0x1')]={'uniqueid':{'type':Sequelize[_0xaef0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaef0('0x3')](_0xaef0('0x4'),_0xaef0('0x5'),_0xaef0('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xaef0('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 46a20a6..10fa509 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 _0x7e88=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x5c0ada,_0x4247e3){var _0x24c606=function(_0x8af665){while(--_0x8af665){_0x5c0ada['push'](_0x5c0ada['shift']());}};_0x24c606(++_0x4247e3);}(_0x7e88,0x81));var _0x87e8=function(_0x2961ac,_0x18808c){_0x2961ac=_0x2961ac-0x0;var _0xc32497=_0x7e88[_0x2961ac];return _0xc32497;};'use strict';var emlformat=require(_0x87e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87e8('0x1'));var jsonpatch=require(_0x87e8('0x2'));var rp=require(_0x87e8('0x3'));var moment=require('moment');var BPromise=require(_0x87e8('0x4'));var Mustache=require(_0x87e8('0x5'));var util=require(_0x87e8('0x6'));var path=require('path');var sox=require(_0x87e8('0x7'));var csv=require(_0x87e8('0x8'));var ejs=require(_0x87e8('0x9'));var fs=require('fs');var fs_extra=require(_0x87e8('0xa'));var _=require(_0x87e8('0xb'));var squel=require(_0x87e8('0xc'));var crypto=require(_0x87e8('0xd'));var jsforce=require(_0x87e8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x87e8('0x8'));var querystring=require(_0x87e8('0xf'));var Papa=require(_0x87e8('0x10'));var Redis=require('ioredis');var authService=require(_0x87e8('0x11'));var qs=require(_0x87e8('0x12'));var as=require(_0x87e8('0x13'));var hardwareService=require(_0x87e8('0x14'));var logger=require(_0x87e8('0x15'))(_0x87e8('0x16'));var utils=require(_0x87e8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x87e8('0x18'));var db=require(_0x87e8('0x19'))['db'];function respondWithStatusCode(_0x6fb291,_0x59040e){_0x59040e=_0x59040e||0xcc;return function(_0xbe7b93){if(_0xbe7b93){return _0x6fb291['sendStatus'](_0x59040e);}return _0x6fb291[_0x87e8('0x1a')](_0x59040e)['end']();};}function respondWithResult(_0x57f253,_0x495674){_0x495674=_0x495674||0xc8;return function(_0x2f0204){if(_0x2f0204){return _0x57f253[_0x87e8('0x1a')](_0x495674)['json'](_0x2f0204);}};}function respondWithFilteredResult(_0x47d03b,_0x5365ee){return function(_0x6d4ec5){if(_0x6d4ec5){var _0x4e2131=typeof _0x5365ee[_0x87e8('0x1b')]===_0x87e8('0x1c')&&typeof _0x5365ee[_0x87e8('0x1d')]===_0x87e8('0x1c');var _0x141406=_0x6d4ec5[_0x87e8('0x1e')];var _0x280874=_0x4e2131?0x0:_0x5365ee[_0x87e8('0x1b')];var _0x3dee8e=_0x4e2131?_0x6d4ec5[_0x87e8('0x1e')]:_0x5365ee[_0x87e8('0x1b')]+_0x5365ee['limit'];var _0x454db0;if(_0x3dee8e>=_0x141406){_0x3dee8e=_0x141406;_0x454db0=0xc8;}else{_0x454db0=0xce;}_0x47d03b[_0x87e8('0x1a')](_0x454db0);return _0x47d03b['set'](_0x87e8('0x1f'),_0x280874+'-'+_0x3dee8e+'/'+_0x141406)[_0x87e8('0x20')](_0x6d4ec5);}return null;};}function patchUpdates(_0x42826b){return function(_0x343938){try{jsonpatch[_0x87e8('0x21')](_0x343938,_0x42826b,!![]);}catch(_0x219a2a){return BPromise['reject'](_0x219a2a);}return _0x343938['save']();};}function saveUpdates(_0x111587,_0x2aaf1a){return function(_0x51fcab){if(_0x51fcab){return _0x51fcab[_0x87e8('0x22')](_0x111587)[_0x87e8('0x23')](function(_0x1bb41f){return _0x1bb41f;});}return null;};}function removeEntity(_0x52656e,_0x1666c4){return function(_0x368d67){if(_0x368d67){return _0x368d67[_0x87e8('0x24')]()[_0x87e8('0x23')](function(){_0x52656e[_0x87e8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3878dc,_0x530e35){return function(_0x2820c4){if(!_0x2820c4){_0x3878dc[_0x87e8('0x25')](0x194);}return _0x2820c4;};}function handleError(_0x4bd4d5,_0x452c2a){_0x452c2a=_0x452c2a||0x1f4;return function(_0x41f0e3){logger[_0x87e8('0x26')](_0x41f0e3[_0x87e8('0x27')]);if(_0x41f0e3[_0x87e8('0x28')]){delete _0x41f0e3[_0x87e8('0x28')];}_0x4bd4d5[_0x87e8('0x1a')](_0x452c2a)[_0x87e8('0x29')](_0x41f0e3);};}exports[_0x87e8('0x2a')]=function(_0x3cadf9,_0x4e2bf4){var _0x15d812={},_0x2f4309={},_0x2a4f9e={'count':0x0,'rows':[]};var _0xa0a5cb=_[_0x87e8('0x2b')](db[_0x87e8('0x2c')]['rawAttributes'],function(_0x51d332){return{'name':_0x51d332['fieldName'],'type':_0x51d332['type']['key']};});_0x2f4309[_0x87e8('0x2d')]=_['map'](_0xa0a5cb,'name');_0x2f4309[_0x87e8('0x2e')]=_['keys'](_0x3cadf9[_0x87e8('0x2e')]);_0x2f4309[_0x87e8('0x2f')]=_[_0x87e8('0x30')](_0x2f4309[_0x87e8('0x2d')],_0x2f4309[_0x87e8('0x2e')]);_0x15d812[_0x87e8('0x31')]=_[_0x87e8('0x30')](_0x2f4309[_0x87e8('0x2d')],qs[_0x87e8('0x32')](_0x3cadf9[_0x87e8('0x2e')]['fields']));_0x15d812[_0x87e8('0x31')]=_0x15d812['attributes'][_0x87e8('0x33')]?_0x15d812[_0x87e8('0x31')]:_0x2f4309[_0x87e8('0x2d')];if(!_0x3cadf9['query']['hasOwnProperty'](_0x87e8('0x34'))){_0x15d812['limit']=qs[_0x87e8('0x1d')](_0x3cadf9[_0x87e8('0x2e')][_0x87e8('0x1d')]);_0x15d812[_0x87e8('0x1b')]=qs[_0x87e8('0x1b')](_0x3cadf9[_0x87e8('0x2e')][_0x87e8('0x1b')]);}_0x15d812[_0x87e8('0x35')]=qs[_0x87e8('0x36')](_0x3cadf9[_0x87e8('0x2e')][_0x87e8('0x36')]);_0x15d812[_0x87e8('0x37')]=qs['filters'](_[_0x87e8('0x38')](_0x3cadf9['query'],_0x2f4309[_0x87e8('0x2f')]),_0xa0a5cb);if(_0x3cadf9[_0x87e8('0x2e')][_0x87e8('0x39')]){_0x15d812[_0x87e8('0x37')]=_[_0x87e8('0x3a')](_0x15d812[_0x87e8('0x37')],{'$or':_[_0x87e8('0x2b')](_0xa0a5cb,function(_0x272d07){if(_0x272d07[_0x87e8('0x3b')]!==_0x87e8('0x3c')){var _0x5b09a1={};_0x5b09a1[_0x272d07[_0x87e8('0x28')]]={'$like':'%'+_0x3cadf9[_0x87e8('0x2e')][_0x87e8('0x39')]+'%'};return _0x5b09a1;}})});}_0x15d812=_[_0x87e8('0x3a')]({},_0x15d812,_0x3cadf9[_0x87e8('0x3d')]);var _0x6f3b65={'where':_0x15d812[_0x87e8('0x37')]};return db[_0x87e8('0x2c')][_0x87e8('0x1e')](_0x6f3b65)[_0x87e8('0x23')](function(_0x5e6bfb){_0x2a4f9e[_0x87e8('0x1e')]=_0x5e6bfb;if(_0x3cadf9[_0x87e8('0x2e')][_0x87e8('0x3e')]){_0x15d812[_0x87e8('0x3f')]=[{'all':!![]}];}return db[_0x87e8('0x2c')][_0x87e8('0x40')](_0x15d812);})[_0x87e8('0x23')](function(_0x121607){_0x2a4f9e[_0x87e8('0x41')]=_0x121607;return _0x2a4f9e;})[_0x87e8('0x23')](respondWithFilteredResult(_0x4e2bf4,_0x15d812))[_0x87e8('0x42')](handleError(_0x4e2bf4,null));};exports['show']=function(_0x550301,_0x3e8924){var _0x35db8b={'raw':!![],'where':{'id':_0x550301['params']['id']}},_0x39aa47={};_0x39aa47[_0x87e8('0x2d')]=_[_0x87e8('0x43')](db['WhatsappTransferReport'][_0x87e8('0x44')]);_0x39aa47[_0x87e8('0x2e')]=_[_0x87e8('0x43')](_0x550301[_0x87e8('0x2e')]);_0x39aa47['filters']=_[_0x87e8('0x30')](_0x39aa47[_0x87e8('0x2d')],_0x39aa47[_0x87e8('0x2e')]);_0x35db8b[_0x87e8('0x31')]=_['intersection'](_0x39aa47[_0x87e8('0x2d')],qs[_0x87e8('0x32')](_0x550301[_0x87e8('0x2e')][_0x87e8('0x32')]));_0x35db8b[_0x87e8('0x31')]=_0x35db8b['attributes']['length']?_0x35db8b['attributes']:_0x39aa47[_0x87e8('0x2d')];if(_0x550301['query']['includeAll']){_0x35db8b[_0x87e8('0x3f')]=[{'all':!![]}];}_0x35db8b=_[_0x87e8('0x3a')]({},_0x35db8b,_0x550301[_0x87e8('0x3d')]);return db[_0x87e8('0x2c')]['find'](_0x35db8b)[_0x87e8('0x23')](handleEntityNotFound(_0x3e8924,null))[_0x87e8('0x23')](respondWithResult(_0x3e8924,null))[_0x87e8('0x42')](handleError(_0x3e8924,null));};exports[_0x87e8('0x45')]=function(_0x38040a,_0x2ffd8c){return db['WhatsappTransferReport'][_0x87e8('0x45')](_0x38040a[_0x87e8('0x46')],{})[_0x87e8('0x23')](respondWithResult(_0x2ffd8c,0xc9))[_0x87e8('0x42')](handleError(_0x2ffd8c,null));};exports[_0x87e8('0x22')]=function(_0x42a447,_0x5b3d48){if(_0x42a447['body']['id']){delete _0x42a447[_0x87e8('0x46')]['id'];}return db[_0x87e8('0x2c')][_0x87e8('0x47')]({'where':{'id':_0x42a447[_0x87e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b3d48,null))['then'](saveUpdates(_0x42a447[_0x87e8('0x46')],null))['then'](respondWithResult(_0x5b3d48,null))[_0x87e8('0x42')](handleError(_0x5b3d48,null));};exports[_0x87e8('0x24')]=function(_0x387187,_0x4da102){return db[_0x87e8('0x2c')][_0x87e8('0x47')]({'where':{'id':_0x387187[_0x87e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x4da102,null))['then'](removeEntity(_0x4da102,null))[_0x87e8('0x42')](handleError(_0x4da102,null));};exports[_0x87e8('0x49')]=function(_0x377930,_0x513a61){return db[_0x87e8('0x2c')][_0x87e8('0x49')]()[_0x87e8('0x23')](respondWithResult(_0x513a61,null))[_0x87e8('0x42')](handleError(_0x513a61,null));}; \ No newline at end of file +var _0xa5a4=['options','WhatsappTransferReport','includeAll','findAll','rows','catch','show','keys','rawAttributes','intersection','include','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x3f6e26,_0x811a34){var _0x474345=function(_0x4a0cbe){while(--_0x4a0cbe){_0x3f6e26['push'](_0x3f6e26['shift']());}};_0x474345(++_0x811a34);}(_0xa5a4,0xaf));var _0x4a5a=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xa5a4[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require(_0x4a5a('0x0'));var rimraf=require(_0x4a5a('0x1'));var zipdir=require(_0x4a5a('0x2'));var jsonpatch=require(_0x4a5a('0x3'));var rp=require(_0x4a5a('0x4'));var moment=require(_0x4a5a('0x5'));var BPromise=require(_0x4a5a('0x6'));var Mustache=require(_0x4a5a('0x7'));var util=require(_0x4a5a('0x8'));var path=require(_0x4a5a('0x9'));var sox=require(_0x4a5a('0xa'));var csv=require(_0x4a5a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a5a('0xc'));var _=require(_0x4a5a('0xd'));var squel=require(_0x4a5a('0xe'));var crypto=require(_0x4a5a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4a5a('0x10'));var toCsv=require(_0x4a5a('0xb'));var querystring=require(_0x4a5a('0x11'));var Papa=require('papaparse');var Redis=require(_0x4a5a('0x12'));var authService=require(_0x4a5a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a5a('0x14'));var logger=require('../../config/logger')(_0x4a5a('0x15'));var utils=require('../../config/utils');var config=require(_0x4a5a('0x16'));var licenseUtil=require(_0x4a5a('0x17'));var db=require(_0x4a5a('0x18'))['db'];function respondWithStatusCode(_0x2b2ca3,_0x4f5d05){_0x4f5d05=_0x4f5d05||0xcc;return function(_0x42af3e){if(_0x42af3e){return _0x2b2ca3[_0x4a5a('0x19')](_0x4f5d05);}return _0x2b2ca3['status'](_0x4f5d05)[_0x4a5a('0x1a')]();};}function respondWithResult(_0x25c659,_0x468892){_0x468892=_0x468892||0xc8;return function(_0x431075){if(_0x431075){return _0x25c659[_0x4a5a('0x1b')](_0x468892)[_0x4a5a('0x1c')](_0x431075);}};}function respondWithFilteredResult(_0x30f2b5,_0x3389a4){return function(_0x14f1ec){if(_0x14f1ec){var _0x4728e2=typeof _0x3389a4[_0x4a5a('0x1d')]==='undefined'&&typeof _0x3389a4[_0x4a5a('0x1e')]==='undefined';var _0x7f46ca=_0x14f1ec[_0x4a5a('0x1f')];var _0x4c2fa2=_0x4728e2?0x0:_0x3389a4['offset'];var _0x59b54c=_0x4728e2?_0x14f1ec['count']:_0x3389a4['offset']+_0x3389a4['limit'];var _0x38661e;if(_0x59b54c>=_0x7f46ca){_0x59b54c=_0x7f46ca;_0x38661e=0xc8;}else{_0x38661e=0xce;}_0x30f2b5[_0x4a5a('0x1b')](_0x38661e);return _0x30f2b5['set'](_0x4a5a('0x20'),_0x4c2fa2+'-'+_0x59b54c+'/'+_0x7f46ca)[_0x4a5a('0x1c')](_0x14f1ec);}return null;};}function patchUpdates(_0x5be26f){return function(_0x49ce9f){try{jsonpatch[_0x4a5a('0x21')](_0x49ce9f,_0x5be26f,!![]);}catch(_0x325eff){return BPromise[_0x4a5a('0x22')](_0x325eff);}return _0x49ce9f[_0x4a5a('0x23')]();};}function saveUpdates(_0x2f985c,_0x48da08){return function(_0x54a79c){if(_0x54a79c){return _0x54a79c['update'](_0x2f985c)[_0x4a5a('0x24')](function(_0x10df82){return _0x10df82;});}return null;};}function removeEntity(_0x17b0fc,_0x445e62){return function(_0x3d1973){if(_0x3d1973){return _0x3d1973[_0x4a5a('0x25')]()[_0x4a5a('0x24')](function(){_0x17b0fc[_0x4a5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17fc46,_0xa935f9){return function(_0x27ad7c){if(!_0x27ad7c){_0x17fc46[_0x4a5a('0x19')](0x194);}return _0x27ad7c;};}function handleError(_0x44517b,_0x46086d){_0x46086d=_0x46086d||0x1f4;return function(_0x5a8492){logger[_0x4a5a('0x26')](_0x5a8492[_0x4a5a('0x27')]);if(_0x5a8492['name']){delete _0x5a8492[_0x4a5a('0x28')];}_0x44517b[_0x4a5a('0x1b')](_0x46086d)[_0x4a5a('0x29')](_0x5a8492);};}exports[_0x4a5a('0x2a')]=function(_0x123984,_0x43f980){var _0x407c0c={},_0x50933c={},_0x59a59e={'count':0x0,'rows':[]};var _0x67cc2b=_[_0x4a5a('0x2b')](db['WhatsappTransferReport']['rawAttributes'],function(_0x44fc50){return{'name':_0x44fc50[_0x4a5a('0x2c')],'type':_0x44fc50[_0x4a5a('0x2d')][_0x4a5a('0x2e')]};});_0x50933c[_0x4a5a('0x2f')]=_[_0x4a5a('0x2b')](_0x67cc2b,_0x4a5a('0x28'));_0x50933c[_0x4a5a('0x30')]=_['keys'](_0x123984['query']);_0x50933c[_0x4a5a('0x31')]=_['intersection'](_0x50933c[_0x4a5a('0x2f')],_0x50933c[_0x4a5a('0x30')]);_0x407c0c[_0x4a5a('0x32')]=_['intersection'](_0x50933c[_0x4a5a('0x2f')],qs[_0x4a5a('0x33')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x33')]));_0x407c0c['attributes']=_0x407c0c['attributes'][_0x4a5a('0x34')]?_0x407c0c[_0x4a5a('0x32')]:_0x50933c[_0x4a5a('0x2f')];if(!_0x123984['query'][_0x4a5a('0x35')](_0x4a5a('0x36'))){_0x407c0c[_0x4a5a('0x1e')]=qs[_0x4a5a('0x1e')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x1e')]);_0x407c0c[_0x4a5a('0x1d')]=qs[_0x4a5a('0x1d')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x1d')]);}_0x407c0c[_0x4a5a('0x37')]=qs[_0x4a5a('0x38')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x38')]);_0x407c0c[_0x4a5a('0x39')]=qs[_0x4a5a('0x31')](_[_0x4a5a('0x3a')](_0x123984[_0x4a5a('0x30')],_0x50933c[_0x4a5a('0x31')]),_0x67cc2b);if(_0x123984['query']['filter']){_0x407c0c[_0x4a5a('0x39')]=_[_0x4a5a('0x3b')](_0x407c0c['where'],{'$or':_[_0x4a5a('0x2b')](_0x67cc2b,function(_0x4c7d17){if(_0x4c7d17[_0x4a5a('0x2d')]!==_0x4a5a('0x3c')){var _0xac1cb2={};_0xac1cb2[_0x4c7d17[_0x4a5a('0x28')]]={'$like':'%'+_0x123984[_0x4a5a('0x30')][_0x4a5a('0x3d')]+'%'};return _0xac1cb2;}})});}_0x407c0c=_[_0x4a5a('0x3b')]({},_0x407c0c,_0x123984[_0x4a5a('0x3e')]);var _0x4ca49a={'where':_0x407c0c[_0x4a5a('0x39')]};return db[_0x4a5a('0x3f')][_0x4a5a('0x1f')](_0x4ca49a)[_0x4a5a('0x24')](function(_0x492bdd){_0x59a59e[_0x4a5a('0x1f')]=_0x492bdd;if(_0x123984['query'][_0x4a5a('0x40')]){_0x407c0c['include']=[{'all':!![]}];}return db[_0x4a5a('0x3f')][_0x4a5a('0x41')](_0x407c0c);})['then'](function(_0x51e3e0){_0x59a59e[_0x4a5a('0x42')]=_0x51e3e0;return _0x59a59e;})[_0x4a5a('0x24')](respondWithFilteredResult(_0x43f980,_0x407c0c))[_0x4a5a('0x43')](handleError(_0x43f980,null));};exports[_0x4a5a('0x44')]=function(_0x22400e,_0x46b75d){var _0x551fd3={'raw':!![],'where':{'id':_0x22400e['params']['id']}},_0x57fa6a={};_0x57fa6a[_0x4a5a('0x2f')]=_[_0x4a5a('0x45')](db['WhatsappTransferReport'][_0x4a5a('0x46')]);_0x57fa6a[_0x4a5a('0x30')]=_['keys'](_0x22400e[_0x4a5a('0x30')]);_0x57fa6a[_0x4a5a('0x31')]=_[_0x4a5a('0x47')](_0x57fa6a['model'],_0x57fa6a[_0x4a5a('0x30')]);_0x551fd3[_0x4a5a('0x32')]=_[_0x4a5a('0x47')](_0x57fa6a[_0x4a5a('0x2f')],qs[_0x4a5a('0x33')](_0x22400e[_0x4a5a('0x30')][_0x4a5a('0x33')]));_0x551fd3[_0x4a5a('0x32')]=_0x551fd3[_0x4a5a('0x32')][_0x4a5a('0x34')]?_0x551fd3[_0x4a5a('0x32')]:_0x57fa6a[_0x4a5a('0x2f')];if(_0x22400e[_0x4a5a('0x30')]['includeAll']){_0x551fd3[_0x4a5a('0x48')]=[{'all':!![]}];}_0x551fd3=_['merge']({},_0x551fd3,_0x22400e[_0x4a5a('0x3e')]);return db[_0x4a5a('0x3f')][_0x4a5a('0x49')](_0x551fd3)[_0x4a5a('0x24')](handleEntityNotFound(_0x46b75d,null))[_0x4a5a('0x24')](respondWithResult(_0x46b75d,null))[_0x4a5a('0x43')](handleError(_0x46b75d,null));};exports[_0x4a5a('0x4a')]=function(_0x1bd98b,_0xca6ead){return db[_0x4a5a('0x3f')][_0x4a5a('0x4a')](_0x1bd98b[_0x4a5a('0x4b')],{})[_0x4a5a('0x24')](respondWithResult(_0xca6ead,0xc9))[_0x4a5a('0x43')](handleError(_0xca6ead,null));};exports[_0x4a5a('0x4c')]=function(_0x46b324,_0x4c7feb){if(_0x46b324[_0x4a5a('0x4b')]['id']){delete _0x46b324['body']['id'];}return db[_0x4a5a('0x3f')]['find']({'where':{'id':_0x46b324['params']['id']}})[_0x4a5a('0x24')](handleEntityNotFound(_0x4c7feb,null))['then'](saveUpdates(_0x46b324['body'],null))['then'](respondWithResult(_0x4c7feb,null))[_0x4a5a('0x43')](handleError(_0x4c7feb,null));};exports[_0x4a5a('0x25')]=function(_0x28645d,_0x3580fa){return db[_0x4a5a('0x3f')][_0x4a5a('0x49')]({'where':{'id':_0x28645d[_0x4a5a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3580fa,null))[_0x4a5a('0x24')](removeEntity(_0x3580fa,null))[_0x4a5a('0x43')](handleError(_0x3580fa,null));};exports[_0x4a5a('0x4e')]=function(_0x58386f,_0xf6b093){return db['WhatsappTransferReport'][_0x4a5a('0x4e')]()['then'](respondWithResult(_0xf6b093,null))[_0x4a5a('0x43')](handleError(_0xf6b093,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 3d548d8..5e359d7 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 _0xdfd6=['uniqueid','lodash','util','api','moment','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x265e07,_0x3ee166){var _0x47017a=function(_0x142cbd){while(--_0x142cbd){_0x265e07['push'](_0x265e07['shift']());}};_0x47017a(++_0x3ee166);}(_0xdfd6,0xeb));var _0x6dfd=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xdfd6[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x6dfd('0x0'));var util=require(_0x6dfd('0x1'));var logger=require('../../config/logger')(_0x6dfd('0x2'));var moment=require(_0x6dfd('0x3'));var BPromise=require('bluebird');var rp=require(_0x6dfd('0x4'));var fs=require('fs');var path=require(_0x6dfd('0x5'));var rimraf=require(_0x6dfd('0x6'));var config=require('../../config/environment');var attributes=require(_0x6dfd('0x7'));module[_0x6dfd('0x8')]=function(_0x160133,_0x3e772f){return _0x160133[_0x6dfd('0x9')](_0x6dfd('0xa'),attributes,{'tableName':_0x6dfd('0xb'),'paranoid':![],'indexes':[{'name':_0x6dfd('0xc'),'fields':[_0x6dfd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb701=['define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x29dda1,_0x508e13){var _0x21b0ef=function(_0x118906){while(--_0x118906){_0x29dda1['push'](_0x29dda1['shift']());}};_0x21b0ef(++_0x508e13);}(_0xb701,0x1e3));var _0x1b70=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb701[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1b70('0x0'));var util=require(_0x1b70('0x1'));var logger=require(_0x1b70('0x2'))('api');var moment=require(_0x1b70('0x3'));var BPromise=require(_0x1b70('0x4'));var rp=require(_0x1b70('0x5'));var fs=require('fs');var path=require(_0x1b70('0x6'));var rimraf=require('rimraf');var config=require(_0x1b70('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x1b70('0x8')]=function(_0x584e9e,_0x135a4b){return _0x584e9e[_0x1b70('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0x1b70('0xa'),'paranoid':![],'indexes':[{'name':_0x1b70('0xb'),'fields':[_0x1b70('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 f951545..9394f4e 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 _0xa9d5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4f3e7e,_0x242e1f){var _0x4ad68b=function(_0xda91ad){while(--_0xda91ad){_0x4f3e7e['push'](_0x4f3e7e['shift']());}};_0x4ad68b(++_0x242e1f);}(_0xa9d5,0xcb));var _0x5a9d=function(_0x7a0051,_0x5eb878){_0x7a0051=_0x7a0051-0x0;var _0x35e76a=_0xa9d5[_0x7a0051];return _0x35e76a;};'use strict';var _=require('lodash');var util=require(_0x5a9d('0x0'));var moment=require(_0x5a9d('0x1'));var BPromise=require(_0x5a9d('0x2'));var rs=require(_0x5a9d('0x3'));var fs=require('fs');var Redis=require(_0x5a9d('0x4'));var db=require(_0x5a9d('0x5'))['db'];var utils=require(_0x5a9d('0x6'));var logger=require(_0x5a9d('0x7'))(_0x5a9d('0x8'));var config=require(_0x5a9d('0x9'));var jayson=require(_0x5a9d('0xa'));var client=jayson[_0x5a9d('0xb')][_0x5a9d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x527287,_0x1a38ac,_0x155014){return new BPromise(function(_0x42aa1a,_0xe7e16d){return client['request'](_0x527287,_0x155014)[_0x5a9d('0xd')](function(_0x412d1a){logger[_0x5a9d('0xe')](_0x5a9d('0xf'),_0x1a38ac,_0x5a9d('0x10'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x1a38ac,'request\x20sent',JSON[_0x5a9d('0x11')](_0x412d1a));if(_0x412d1a['error']){if(_0x412d1a[_0x5a9d('0x12')][_0x5a9d('0x13')]===0x1f4){logger['error'](_0x5a9d('0xf'),_0x1a38ac,_0x412d1a[_0x5a9d('0x12')][_0x5a9d('0x14')]);return _0xe7e16d(_0x412d1a['error'][_0x5a9d('0x14')]);}logger['error'](_0x5a9d('0xf'),_0x1a38ac,_0x412d1a[_0x5a9d('0x12')]['message']);return _0x42aa1a(_0x412d1a[_0x5a9d('0x12')][_0x5a9d('0x14')]);}else{logger[_0x5a9d('0xe')](_0x5a9d('0xf'),_0x1a38ac,_0x5a9d('0x10'));_0x42aa1a(_0x412d1a[_0x5a9d('0x15')]['message']);}})[_0x5a9d('0x16')](function(_0x5c8219){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x1a38ac,_0x5c8219);_0xe7e16d(_0x5c8219);});});} \ No newline at end of file +var _0xeb90=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x52a48c,_0x1fcfab){var _0x56efde=function(_0x15f2ca){while(--_0x15f2ca){_0x52a48c['push'](_0x52a48c['shift']());}};_0x56efde(++_0x1fcfab);}(_0xeb90,0x1b3));var _0x0eb9=function(_0x2b1ce8,_0x1034e2){_0x2b1ce8=_0x2b1ce8-0x0;var _0x26ff4c=_0xeb90[_0x2b1ce8];return _0x26ff4c;};'use strict';var _=require('lodash');var util=require(_0x0eb9('0x0'));var moment=require(_0x0eb9('0x1'));var BPromise=require(_0x0eb9('0x2'));var rs=require(_0x0eb9('0x3'));var fs=require('fs');var Redis=require(_0x0eb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0eb9('0x5'));var logger=require(_0x0eb9('0x6'))('rpc');var config=require(_0x0eb9('0x7'));var jayson=require(_0x0eb9('0x8'));var client=jayson['client'][_0x0eb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10b147,_0x9fcad5,_0x3efb64){return new BPromise(function(_0x1a4209,_0x4f38d5){return client[_0x0eb9('0xa')](_0x10b147,_0x3efb64)[_0x0eb9('0xb')](function(_0x3ba9a1){logger[_0x0eb9('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x9fcad5,_0x0eb9('0xd'));logger[_0x0eb9('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x9fcad5,'request\x20sent',JSON[_0x0eb9('0xf')](_0x3ba9a1));if(_0x3ba9a1[_0x0eb9('0x10')]){if(_0x3ba9a1[_0x0eb9('0x10')]['code']===0x1f4){logger[_0x0eb9('0x10')](_0x0eb9('0x11'),_0x9fcad5,_0x3ba9a1['error'][_0x0eb9('0x12')]);return _0x4f38d5(_0x3ba9a1['error'][_0x0eb9('0x12')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x9fcad5,_0x3ba9a1[_0x0eb9('0x10')]['message']);return _0x1a4209(_0x3ba9a1[_0x0eb9('0x10')][_0x0eb9('0x12')]);}else{logger[_0x0eb9('0xc')](_0x0eb9('0x11'),_0x9fcad5,'request\x20sent');_0x1a4209(_0x3ba9a1[_0x0eb9('0x13')]['message']);}})[_0x0eb9('0x14')](function(_0x2fe7c6){logger[_0x0eb9('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x9fcad5,_0x2fe7c6);_0x4f38d5(_0x2fe7c6);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 98a9661..acdbc40 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc286=['./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xc286,0xd8));var _0x6c28=function(_0x5f3d4b,_0x896085){_0x5f3d4b=_0x5f3d4b-0x0;var _0x1eb2da=_0xc286[_0x5f3d4b];return _0x1eb2da;};'use strict';var _=require('lodash');var mysqldb=require(_0x6c28('0x0'));var rpc=require(_0x6c28('0x1'));var config=require(_0x6c28('0x2'));var logger=require(_0x6c28('0x3'))('app');var pm2=require(_0x6c28('0x4'));var pm2Config=require(_0x6c28('0x5'));var schedule=require(_0x6c28('0x6'));var chat=require(_0x6c28('0x7'));var whatsapp=require(_0x6c28('0x8'));var transcribe=require(_0x6c28('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return mysqldb['db'][_0x6c28('0xa')][_0x6c28('0xb')]()[_0x6c28('0xc')](function(){return rpc[_0x6c28('0xd')]();})[_0x6c28('0xc')](function(_0xd6fe30){logger[_0x6c28('0xe')](_0xd6fe30);return chat[_0x6c28('0xf')]();})[_0x6c28('0xc')](function(){return whatsapp[_0x6c28('0xf')]();})[_0x6c28('0xc')](function(){return schedule[_0x6c28('0xf')]();})[_0x6c28('0xc')](function(){return transcribe['start']();})[_0x6c28('0xc')](function(){return provider[_0x6c28('0xf')]();})[_0x6c28('0xc')](function(_0xc460e2){logger['info'](_0xc460e2);return pm2['start'](pm2Config);})['then'](function(_0x3a3f22){logger[_0x6c28('0xe')](_0x6c28('0x10'),_[_0x6c28('0x11')](_[_0x6c28('0x12')](_0x3a3f22,{'status':_0x6c28('0x13')}),_0x6c28('0x14'))[_0x6c28('0x15')]());logger[_0x6c28('0xe')](_0x6c28('0x16'),_[_0x6c28('0x11')](_[_0x6c28('0x12')](_0x3a3f22,function(_0x1b0849){return _0x1b0849[_0x6c28('0x17')]!=='online';}),_0x6c28('0x14'))['join']()||_0x6c28('0x18'));config['seedDB']&&require(_0x6c28('0x19'))[_0x6c28('0x1a')]();require(_0x6c28('0x1b'))[_0x6c28('0x1a')]();})[_0x6c28('0x1c')](function(_0x39886e){logger['error'](_0x6c28('0x1d'),_0x39886e);process[_0x6c28('0x1e')](0x1);});}main(); \ No newline at end of file +var _0xfc44=['./config/pm2/config','./config/schedule/whatsapp','sequelize','sync','then','listen','info','start','map','filter','online','name','join','Offline\x20apps:','status','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x114469,_0x1f7675){var _0x372345=function(_0x837dd7){while(--_0x837dd7){_0x114469['push'](_0x114469['shift']());}};_0x372345(++_0x1f7675);}(_0xfc44,0x181));var _0x4fc4=function(_0xd7e944,_0x586d1d){_0xd7e944=_0xd7e944-0x0;var _0x134591=_0xfc44[_0xd7e944];return _0x134591;};'use strict';var _=require(_0x4fc4('0x0'));var mysqldb=require(_0x4fc4('0x1'));var rpc=require(_0x4fc4('0x2'));var config=require(_0x4fc4('0x3'));var logger=require(_0x4fc4('0x4'))(_0x4fc4('0x5'));var pm2=require(_0x4fc4('0x6'));var pm2Config=require(_0x4fc4('0x7'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x4fc4('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return mysqldb['db'][_0x4fc4('0x9')][_0x4fc4('0xa')]()[_0x4fc4('0xb')](function(){return rpc[_0x4fc4('0xc')]();})[_0x4fc4('0xb')](function(_0x26ce44){logger[_0x4fc4('0xd')](_0x26ce44);return chat[_0x4fc4('0xe')]();})[_0x4fc4('0xb')](function(){return whatsapp[_0x4fc4('0xe')]();})[_0x4fc4('0xb')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x4fc4('0xe')]();})[_0x4fc4('0xb')](function(){return provider[_0x4fc4('0xe')]();})[_0x4fc4('0xb')](function(_0x4dba66){logger[_0x4fc4('0xd')](_0x4dba66);return pm2[_0x4fc4('0xe')](pm2Config);})['then'](function(_0x221d6e){logger[_0x4fc4('0xd')]('Online\x20apps:',_[_0x4fc4('0xf')](_[_0x4fc4('0x10')](_0x221d6e,{'status':_0x4fc4('0x11')}),_0x4fc4('0x12'))[_0x4fc4('0x13')]());logger['info'](_0x4fc4('0x14'),_[_0x4fc4('0xf')](_[_0x4fc4('0x10')](_0x221d6e,function(_0x48ae9c){return _0x48ae9c[_0x4fc4('0x15')]!==_0x4fc4('0x11');}),_0x4fc4('0x12'))['join']()||'None');config['seedDB']&&require(_0x4fc4('0x16'))[_0x4fc4('0x17')]();require('./config/license')['default']();})[_0x4fc4('0x18')](function(_0x3e5bd3){logger[_0x4fc4('0x19')](_0x4fc4('0x1a'),_0x3e5bd3);process[_0x4fc4('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 5351b74..167acdc 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 _0x532a=['crypto','bluebird','util','moment','secrets','session','role','fullname','internal','email','permissions','md5secret','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','then','status','disposition','Unmanaged.','use','headers','authorization','startsWith','Basic','User','find','authenticate','json','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','canUpdate','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','options','toString','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware'];(function(_0x135fe8,_0x51037a){var _0x408a29=function(_0x5cc7db){while(--_0x5cc7db){_0x135fe8['push'](_0x135fe8['shift']());}};_0x408a29(++_0x51037a);}(_0x532a,0x17e));var _0xa532=function(_0x4e215b,_0x597fbc){_0x4e215b=_0x4e215b-0x0;var _0x56d77a=_0x532a[_0x4e215b];return _0x56d77a;};'use strict';var db=require(_0xa532('0x0'))['db'];var config=require(_0xa532('0x1'));var hardwareConf=require(_0xa532('0x2'));var licenseUtil=require(_0xa532('0x3'));var encryptor=require(_0xa532('0x4'));var _=require(_0xa532('0x5'));var jwt=require(_0xa532('0x6'));var expressJwt=require('express-jwt');var compose=require(_0xa532('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0xa532('0x8'));var BPromise=require(_0xa532('0x9'));var util=require(_0xa532('0xa'));var moment=require(_0xa532('0xb'));var validateJwt=expressJwt({'secret':config[_0xa532('0xc')][_0xa532('0xd')]});var userAttributes=['id',_0xa532('0xe'),_0xa532('0xf'),'name',_0xa532('0x10'),_0xa532('0x11'),'userpic',_0xa532('0x12'),_0xa532('0x13'),'voicePause',_0xa532('0x14'),'mailPause',_0xa532('0x15'),_0xa532('0x16'),_0xa532('0x17'),_0xa532('0x18'),_0xa532('0x19'),_0xa532('0x1a'),_0xa532('0x1b'),_0xa532('0x1c'),_0xa532('0x1d'),_0xa532('0x1e'),'alias',_0xa532('0x1f'),_0xa532('0x20'),_0xa532('0x21'),_0xa532('0x22'),_0xa532('0x23'),'phoneBarEnableSettings',_0xa532('0x24'),_0xa532('0x25'),_0xa532('0x26'),_0xa532('0x27'),'hotdesk',_0xa532('0x28'),_0xa532('0x29'),_0xa532('0x2a'),_0xa532('0x2b'),_0xa532('0x2c'),'downloadVoiceRecordings',_0xa532('0x2d'),_0xa532('0x2e'),_0xa532('0x2f'),_0xa532('0x30')];exports[_0xa532('0x31')]=function(){return this[_0xa532('0x32')](!![])['use'](function(_0x80a25b,_0x3fa4b4,_0x31d45d){if(_0x80a25b[_0xa532('0x33')]){_0x31d45d();}else{return db[_0xa532('0x34')]['findOne']({'where':{'id':_0x80a25b[_0xa532('0x35')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xa532('0x36')](function(_0x393218){if(_0x393218&&_0x393218['closed']){return _0x3fa4b4[_0xa532('0x37')](_0x393218[_0xa532('0x38')]==='unmanaged'?0x195:0x193)['json']({'message':_0x393218['disposition']==='unmanaged'?_0xa532('0x39'):'Forbidden.'});}else{_0x31d45d();}})['catch'](function(_0x32c87e){_0x31d45d(_0x32c87e);});}});};exports[_0xa532('0x32')]=function isAuthenticated(_0xb924ba){return compose()[_0xa532('0x3a')](function(_0x1101b9,_0x224b16,_0x577b95){var _0x8f174c;if(_0x1101b9[_0xa532('0x3b')][_0xa532('0x3c')]){if(_[_0xa532('0x3d')](_0x1101b9[_0xa532('0x3b')]['authorization'],_0xa532('0x3e'))){var _0x565d1a=basicAuth(_0x1101b9);db[_0xa532('0x3f')][_0xa532('0x40')]({'where':{'name':_0x565d1a['name']}})[_0xa532('0x36')](function(_0xa031ec){if(!_0xa031ec||!_0xa031ec[_0xa532('0x41')](_0x565d1a['pass'])){return _0x224b16[_0xa532('0x37')](0x191)[_0xa532('0x42')]({'message':'Wrong\x20credentials.'});}_0x1101b9['user']={'id':_0xa031ec['id']};_0x577b95();})[_0xa532('0x43')](function(_0x368e3f){_0x577b95(_0x368e3f);});}else if(_[_0xa532('0x3d')](_0x1101b9['headers']['authorization'],_0xa532('0x44'))){validateJwt(_0x1101b9,_0x224b16,_0x577b95);}else{if(_0xb924ba){_0x577b95();}else{return _0x224b16[_0xa532('0x37')](0x193)[_0xa532('0x42')]({'message':_0xa532('0x45')});}}}else if(_0x1101b9[_0xa532('0x46')][_0xa532('0x47')]){try{var _0x206d90={'audience':hardwareConf[_0xa532('0x48')](),'issuer':hardwareConf[_0xa532('0x48')]()};verifyJwt(_0x1101b9[_0xa532('0x46')][_0xa532('0x47')],_0x206d90)['then'](function(_0x2f9f85){return db['User'][_0xa532('0x40')]({'where':{'id':_0x2f9f85[_0xa532('0x49')]}})['then'](function(_0xbc516d){_0x8f174c=_0xbc516d;return db[_0xa532('0x4a')][_0xa532('0x4b')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0xa532('0x36')](function(_0x3c9a52){if(!_0x8f174c||!_['isEqual'](_0x8f174c[_0xa532('0x4c')],_0x2f9f85[_0xa532('0x4d')])){return _0x224b16[_0xa532('0x37')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x8f174c[_0xa532('0x4e')]){return _0x224b16[_0xa532('0x37')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x8f174c[_0xa532('0x4f')]){if(_0x3c9a52[_0xa532('0x50')]>0x0){if(moment(_0x8f174c[_0xa532('0x51')])[_0xa532('0x52')](_0x3c9a52[_0xa532('0x50')],_0xa532('0x53'))>moment()){return _0x224b16['status'](0x191)[_0xa532('0x42')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x224b16[_0xa532('0x37')](0x191)['json']({'message':_0xa532('0x54')});}}_0x1101b9[_0xa532('0x33')]={'id':_0x8f174c['id']};_0x577b95();});})[_0xa532('0x43')](function(){return _0x224b16[_0xa532('0x37')](0x191)[_0xa532('0x42')]({'message':_0xa532('0x54')});});}catch(_0x4ceaba){_0x577b95(_0x4ceaba);}}else if(_0xb924ba){_0x577b95();}else{return _0x224b16['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xa532('0x3a')](function(_0x4bd35b,_0x102734,_0x1ffa42){if(_0x4bd35b['user']){db[_0xa532('0x3f')][_0xa532('0x40')]({'where':{'id':_0x4bd35b[_0xa532('0x33')]['id']},'attributes':userAttributes})[_0xa532('0x36')](function(_0x3f3f7a){if(!_0x3f3f7a){return _0x102734['status'](0x194)[_0xa532('0x42')]({'message':'User\x20not\x20found.'});}_0x4bd35b['user']=_0x3f3f7a;_0x1ffa42();})['catch'](function(_0x48d475){_0x1ffa42(_0x48d475);});}else if(_0xb924ba){_0x1ffa42();}else{return _0x102734[_0xa532('0x37')](0x194)[_0xa532('0x42')]({'message':_0xa532('0x55')});}});};exports[_0xa532('0x56')]=function canUpdate(){return compose()[_0xa532('0x3a')](function(_0x29e778,_0x1d4c5b,_0x31a7a2){return licenseUtil['getLicense']()[_0xa532('0x36')](function(_0x94860f){if(_0x94860f['update']){_0x31a7a2();}else{return _0x1d4c5b[_0xa532('0x37')](0x193)['json']({'message':'Forbidden'});}})[_0xa532('0x43')](function(_0xf75eb6){_0x31a7a2(_0xf75eb6);});});};exports[_0xa532('0x57')]=function isWebrtcLicence(){return compose()[_0xa532('0x3a')](function(_0x2c2093,_0x2fd5ef,_0x38f160){return licenseUtil[_0xa532('0x58')]()['then'](function(_0x3b00a8){if(_0x3b00a8[_0xa532('0x59')]){_0x38f160();}else{return _0x2fd5ef['status'](0x193)[_0xa532('0x42')]({'message':_0xa532('0x5a')});}})[_0xa532('0x43')](function(_0x145abe){_0x38f160(_0x145abe);});});};exports['isMiddleware']=function(_0x2957f5,_0x7ea772,_0x483172){_0x2957f5[_0xa532('0x5b')]=!![];return _0x483172();};exports[_0xa532('0x5c')]=function signToken(_0x2d5ee3){return signJwt(_0x2d5ee3);};exports[_0xa532('0x5d')]=function(_0xb9fd75,_0x106538){if(!_0xb9fd75[_0xa532('0x33')]){return _0x106538[_0xa532('0x37')](0x194)[_0xa532('0x42')]({'message':_0xa532('0x5e')});}var _0x27dd02={'payload':{'id':_0xb9fd75['user']['id'],'role':_0xb9fd75[_0xa532('0x33')][_0xa532('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x27dd02)['then'](function(_0x1f1d9f){_0x106538[_0xa532('0x5f')](_0xa532('0x60'),_0x1f1d9f);_0x106538[_0xa532('0x61')](_0xa532('0x62'));})[_0xa532('0x43')](function(_0x2e6577){return _0x106538[_0xa532('0x37')](0x1f4)[_0xa532('0x63')](_0x2e6577);});};exports[_0xa532('0x64')]=function(_0x801ee7){if(_['isNil'](_0x801ee7['apiKeyNonce'])||_[_0xa532('0x65')](_0x801ee7[_0xa532('0x66')])){return null;}else{return createJwt(_0x801ee7);}};exports[_0xa532('0x67')]=function(_0xaef261){_0xaef261[_0xa532('0x4c')]=generateNonce();_0xaef261['apiKeyIat']=generateIssuedAt();return createJwt(_0xaef261);};exports[_0xa532('0x68')]=function(_0x2b5e14,_0x5466a4){var _0x322238=_0x2b5e14['query']['apikey'];if(_0x322238){var _0x250cbb={'nonce':_0x5466a4[_0xa532('0x4c')],'iat':_0x5466a4[_0xa532('0x66')],'audience':hardwareConf[_0xa532('0x48')](),'issuer':hardwareConf[_0xa532('0x48')]()};return verifyJwt(_0x322238,_0x250cbb)['then'](function(){return generateApiKey(_0x5466a4);});}else{throw{'message':_0xa532('0x69')};}};exports[_0xa532('0x6a')]=function(_0x4fe210){var _0x3c9daa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3c9daa[_0xa532('0x6b')](_0x4fe210))throw new db[(_0xa532('0x6c'))][(_0xa532('0x6d'))](_0xa532('0x6e'));return;};exports[_0xa532('0x6f')]=function(_0x30dd51,_0x2c594c,_0x86b73c){var _0x1937a6=encryptor['decryptString'](_0x2c594c)[_0xa532('0x70')](',');for(var _0x366dc2=0x0;_0x366dc2<_0x86b73c;_0x366dc2++){if(!_0x1937a6[_0x366dc2])break;if(_0x30dd51[_0xa532('0x71')]()===_0x1937a6[_0x366dc2][_0xa532('0x71')]()){var _0x53686b=util[_0xa532('0x72')](_0xa532('0x73'),_0x86b73c);if(_0x86b73c===0x1){_0x53686b=_0xa532('0x74');}throw new db[(_0xa532('0x6c'))][(_0xa532('0x6d'))](_0x53686b);}}return;};exports[_0xa532('0x75')]=function(_0x41b8e6,_0x5f3c7e){var _0x41f4c8=_0x5f3c7e?encryptor[_0xa532('0x76')](_0x5f3c7e)[_0xa532('0x70')](','):[];if(_0x41f4c8[_0xa532('0x77')]===0x5){_0x41f4c8[_0xa532('0x78')](-0x1,0x1);}_0x41f4c8[_0xa532('0x79')](_0x41b8e6);return encryptor['encryptString'](_0x41f4c8[_0xa532('0x7a')](','));};function signJwt(_0x58aef9){var _0x1b398a=BPromise[_0xa532('0x7b')](jwt[_0xa532('0x7c')],{'context':jwt});var _0x47980f=_0x58aef9[_0xa532('0x7d')]||config[_0xa532('0xc')][_0xa532('0xd')];return new BPromise(function(_0x350aef,_0x1e2508){_0x1b398a(_0x58aef9['payload'],_0x47980f,_0x58aef9[_0xa532('0x7e')])[_0xa532('0x36')](function(_0x45dded){_0x350aef(_0x45dded);})[_0xa532('0x43')](function(_0x6953c2){_0x1e2508(_0x6953c2);});});}function verifyJwt(_0x30cf18,_0x53386d,_0x493753){var _0x13ece=BPromise[_0xa532('0x7b')](jwt['verify'],{'context':jwt});var _0x21b4ff=_0x493753||config['secrets'][_0xa532('0xd')];return new BPromise(function(_0x34808d,_0x2edc60){_0x13ece(_0x30cf18,_0x21b4ff,_0x53386d)['then'](function(_0x318b8c){_0x34808d(_0x318b8c);})[_0xa532('0x43')](function(_0xeb3f75){_0x2edc60(_0xeb3f75);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xa532('0x7f')]('hex');}function generateIssuedAt(){return Math[_0xa532('0x80')](Date['now']()/0x3e8)[_0xa532('0x7f')]();}function createJwt(_0x43f35b){var _0x5092a5={'payload':{'iat':_0x43f35b[_0xa532('0x66')],'nonce':_0x43f35b[_0xa532('0x4c')]},'options':{'algorithm':_0xa532('0x81'),'subject':_0x43f35b['id'][_0xa532('0x7f')](),'issuer':hardwareConf[_0xa532('0x48')](),'audience':hardwareConf[_0xa532('0x48')]()}};return signJwt(_0x5092a5)[_0xa532('0x36')](function(_0x449135){return{'iat':_0x43f35b[_0xa532('0x66')],'nonce':_0x43f35b['apiKeyNonce'],'token':_0x449135};});} \ No newline at end of file +var _0xd167=['Bearer','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','hex','floor','now','HS512','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','bluebird','util','moment','secrets','session','fullname','userpic','permissions','voicePause','chatPause','faxPause','smsPause','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','name','authenticate','pass','Wrong\x20credentials.'];(function(_0x1569cf,_0x19aae6){var _0x16faed=function(_0x3a1919){while(--_0x3a1919){_0x1569cf['push'](_0x1569cf['shift']());}};_0x16faed(++_0x19aae6);}(_0xd167,0xc3));var _0x7d16=function(_0x4f1919,_0x2d68c7){_0x4f1919=_0x4f1919-0x0;var _0x1b908f=_0xd167[_0x4f1919];return _0x1b908f;};'use strict';var db=require(_0x7d16('0x0'))['db'];var config=require(_0x7d16('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x7d16('0x2'));var encryptor=require(_0x7d16('0x3'));var _=require(_0x7d16('0x4'));var jwt=require(_0x7d16('0x5'));var expressJwt=require(_0x7d16('0x6'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x7d16('0x7'));var BPromise=require(_0x7d16('0x8'));var util=require(_0x7d16('0x9'));var moment=require(_0x7d16('0xa'));var validateJwt=expressJwt({'secret':config[_0x7d16('0xb')][_0x7d16('0xc')]});var userAttributes=['id','role',_0x7d16('0xd'),'name','internal','email',_0x7d16('0xe'),_0x7d16('0xf'),'md5secret',_0x7d16('0x10'),_0x7d16('0x11'),'mailPause',_0x7d16('0x12'),_0x7d16('0x13'),'openchannelPause','pauseType','showWebBar',_0x7d16('0x14'),_0x7d16('0x15'),_0x7d16('0x16'),_0x7d16('0x17'),_0x7d16('0x18'),_0x7d16('0x19'),_0x7d16('0x1a'),'phoneBarAutoAnswerDelay',_0x7d16('0x1b'),'phoneBarEnableRecording',_0x7d16('0x1c'),'phoneBarEnableSettings',_0x7d16('0x1d'),_0x7d16('0x1e'),_0x7d16('0x1f'),_0x7d16('0x20'),_0x7d16('0x21'),'interface','userProfileId',_0x7d16('0x22'),_0x7d16('0x23'),'wssPort',_0x7d16('0x24'),_0x7d16('0x25'),_0x7d16('0x26'),_0x7d16('0x27'),_0x7d16('0x28')];exports[_0x7d16('0x29')]=function(){return this[_0x7d16('0x2a')](!![])[_0x7d16('0x2b')](function(_0x1f74e8,_0x1965d5,_0x181c10){if(_0x1f74e8[_0x7d16('0x2c')]){_0x181c10();}else{return db[_0x7d16('0x2d')][_0x7d16('0x2e')]({'where':{'id':_0x1f74e8[_0x7d16('0x2f')]['id']},'attributes':['id',_0x7d16('0x30'),_0x7d16('0x31')],'raw':!![]})[_0x7d16('0x32')](function(_0x5ac2e6){if(_0x5ac2e6&&_0x5ac2e6['closed']){return _0x1965d5[_0x7d16('0x33')](_0x5ac2e6[_0x7d16('0x31')]==='unmanaged'?0x195:0x193)[_0x7d16('0x34')]({'message':_0x5ac2e6[_0x7d16('0x31')]==='unmanaged'?'Unmanaged.':_0x7d16('0x35')});}else{_0x181c10();}})[_0x7d16('0x36')](function(_0x543801){_0x181c10(_0x543801);});}});};exports[_0x7d16('0x2a')]=function isAuthenticated(_0x359424){return compose()[_0x7d16('0x2b')](function(_0x55dd3c,_0x2bc847,_0x559d34){var _0x5453f4;if(_0x55dd3c[_0x7d16('0x37')][_0x7d16('0x38')]){if(_[_0x7d16('0x39')](_0x55dd3c[_0x7d16('0x37')][_0x7d16('0x38')],_0x7d16('0x3a'))){var _0x358ec3=basicAuth(_0x55dd3c);db[_0x7d16('0x3b')][_0x7d16('0x3c')]({'where':{'name':_0x358ec3[_0x7d16('0x3d')]}})[_0x7d16('0x32')](function(_0x4f5c93){if(!_0x4f5c93||!_0x4f5c93[_0x7d16('0x3e')](_0x358ec3[_0x7d16('0x3f')])){return _0x2bc847['status'](0x191)['json']({'message':_0x7d16('0x40')});}_0x55dd3c[_0x7d16('0x2c')]={'id':_0x4f5c93['id']};_0x559d34();})[_0x7d16('0x36')](function(_0xa81026){_0x559d34(_0xa81026);});}else if(_[_0x7d16('0x39')](_0x55dd3c['headers'][_0x7d16('0x38')],_0x7d16('0x41'))){validateJwt(_0x55dd3c,_0x2bc847,_0x559d34);}else{if(_0x359424){_0x559d34();}else{return _0x2bc847[_0x7d16('0x33')](0x193)[_0x7d16('0x34')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x55dd3c[_0x7d16('0x42')]['apikey']){try{var _0x92a11a={'audience':hardwareConf[_0x7d16('0x43')](),'issuer':hardwareConf[_0x7d16('0x43')]()};verifyJwt(_0x55dd3c[_0x7d16('0x42')][_0x7d16('0x44')],_0x92a11a)[_0x7d16('0x32')](function(_0x5e68c8){return db['User'][_0x7d16('0x3c')]({'where':{'id':_0x5e68c8['sub']}})[_0x7d16('0x32')](function(_0x3ff454){_0x5453f4=_0x3ff454;return db[_0x7d16('0x45')][_0x7d16('0x2e')]({'where':{'id':0x1},'attributes':[_0x7d16('0x46'),_0x7d16('0x47')],'raw':!![]});})[_0x7d16('0x32')](function(_0x26e305){if(!_0x5453f4||!_[_0x7d16('0x48')](_0x5453f4[_0x7d16('0x49')],_0x5e68c8[_0x7d16('0x4a')])){return _0x2bc847[_0x7d16('0x33')](0x191)[_0x7d16('0x34')]({'message':_0x7d16('0x4b')});}if(_0x5453f4[_0x7d16('0x4c')]){return _0x2bc847[_0x7d16('0x33')](0x191)['json']({'message':_0x7d16('0x4d')});}if(_0x5453f4['blocked']){if(_0x26e305[_0x7d16('0x47')]>0x0){if(moment(_0x5453f4[_0x7d16('0x4e')])[_0x7d16('0x4f')](_0x26e305[_0x7d16('0x47')],_0x7d16('0x50'))>moment()){return _0x2bc847[_0x7d16('0x33')](0x191)[_0x7d16('0x34')]({'message':_0x7d16('0x4d')});}}else{return _0x2bc847[_0x7d16('0x33')](0x191)[_0x7d16('0x34')]({'message':_0x7d16('0x4d')});}}_0x55dd3c['user']={'id':_0x5453f4['id']};_0x559d34();});})[_0x7d16('0x36')](function(){return _0x2bc847['status'](0x191)['json']({'message':_0x7d16('0x4d')});});}catch(_0x210b6e){_0x559d34(_0x210b6e);}}else if(_0x359424){_0x559d34();}else{return _0x2bc847['status'](0x193)[_0x7d16('0x34')]({'message':_0x7d16('0x51')});}})[_0x7d16('0x2b')](function(_0xd7850e,_0x443d70,_0x4f3371){if(_0xd7850e[_0x7d16('0x2c')]){db[_0x7d16('0x3b')][_0x7d16('0x3c')]({'where':{'id':_0xd7850e['user']['id']},'attributes':userAttributes})['then'](function(_0xf3a62e){if(!_0xf3a62e){return _0x443d70[_0x7d16('0x33')](0x194)[_0x7d16('0x34')]({'message':_0x7d16('0x52')});}_0xd7850e['user']=_0xf3a62e;_0x4f3371();})[_0x7d16('0x36')](function(_0x1be2db){_0x4f3371(_0x1be2db);});}else if(_0x359424){_0x4f3371();}else{return _0x443d70[_0x7d16('0x33')](0x194)[_0x7d16('0x34')]({'message':_0x7d16('0x53')});}});};exports[_0x7d16('0x54')]=function canUpdate(){return compose()['use'](function(_0x362f0c,_0x1983f3,_0x55f946){return licenseUtil[_0x7d16('0x55')]()[_0x7d16('0x32')](function(_0x257ef1){if(_0x257ef1[_0x7d16('0x56')]){_0x55f946();}else{return _0x1983f3[_0x7d16('0x33')](0x193)[_0x7d16('0x34')]({'message':_0x7d16('0x57')});}})[_0x7d16('0x36')](function(_0x4f7d5a){_0x55f946(_0x4f7d5a);});});};exports[_0x7d16('0x58')]=function isWebrtcLicence(){return compose()[_0x7d16('0x2b')](function(_0x57d107,_0x3026b9,_0x2e0a4f){return licenseUtil[_0x7d16('0x55')]()['then'](function(_0x3a970a){if(_0x3a970a[_0x7d16('0x59')]){_0x2e0a4f();}else{return _0x3026b9[_0x7d16('0x33')](0x193)[_0x7d16('0x34')]({'message':'Forbidden'});}})[_0x7d16('0x36')](function(_0x97bf17){_0x2e0a4f(_0x97bf17);});});};exports['isMiddleware']=function(_0x10b7f,_0x334de5,_0x422746){_0x10b7f['isMiddleware']=!![];return _0x422746();};exports[_0x7d16('0x5a')]=function signToken(_0xa97cf8){return signJwt(_0xa97cf8);};exports[_0x7d16('0x5b')]=function(_0x42f8bb,_0x339106){if(!_0x42f8bb['user']){return _0x339106[_0x7d16('0x33')](0x194)[_0x7d16('0x34')]({'message':_0x7d16('0x5c')});}var _0x4ed21c={'payload':{'id':_0x42f8bb['user']['id'],'role':_0x42f8bb[_0x7d16('0x2c')][_0x7d16('0x5d')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4ed21c)['then'](function(_0x171e3b){_0x339106[_0x7d16('0x5e')]('motion.token',_0x171e3b);_0x339106['redirect'](_0x7d16('0x5f'));})[_0x7d16('0x36')](function(_0x20d009){return _0x339106[_0x7d16('0x33')](0x1f4)['send'](_0x20d009);});};exports[_0x7d16('0x60')]=function(_0x43e3be){if(_[_0x7d16('0x61')](_0x43e3be[_0x7d16('0x49')])||_[_0x7d16('0x61')](_0x43e3be[_0x7d16('0x62')])){return null;}else{return createJwt(_0x43e3be);}};exports[_0x7d16('0x63')]=function(_0x1313ec){_0x1313ec[_0x7d16('0x49')]=generateNonce();_0x1313ec[_0x7d16('0x62')]=generateIssuedAt();return createJwt(_0x1313ec);};exports[_0x7d16('0x64')]=function(_0x2e2f14,_0x5f23e1){var _0x341854=_0x2e2f14[_0x7d16('0x42')][_0x7d16('0x44')];if(_0x341854){var _0x21eba4={'nonce':_0x5f23e1[_0x7d16('0x49')],'iat':_0x5f23e1[_0x7d16('0x62')],'audience':hardwareConf[_0x7d16('0x43')](),'issuer':hardwareConf[_0x7d16('0x43')]()};return verifyJwt(_0x341854,_0x21eba4)[_0x7d16('0x32')](function(){return generateApiKey(_0x5f23e1);});}else{throw{'message':_0x7d16('0x65')};}};exports['validatePasswordPattern']=function(_0x3f4a00){var _0x3ed17d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3ed17d[_0x7d16('0x66')](_0x3f4a00))throw new db[(_0x7d16('0x67'))][(_0x7d16('0x68'))](_0x7d16('0x69'));return;};exports['validatePasswordHistory']=function(_0x396572,_0x39ce07,_0x5c5536){var _0x46e461=encryptor[_0x7d16('0x6a')](_0x39ce07)[_0x7d16('0x6b')](',');for(var _0xc84853=0x0;_0xc84853<_0x5c5536;_0xc84853++){if(!_0x46e461[_0xc84853])break;if(_0x396572['toLowerCase']()===_0x46e461[_0xc84853][_0x7d16('0x6c')]()){var _0x5178d2=util[_0x7d16('0x6d')](_0x7d16('0x6e'),_0x5c5536);if(_0x5c5536===0x1){_0x5178d2=_0x7d16('0x6f');}throw new db['Sequelize'][(_0x7d16('0x68'))](_0x5178d2);}}return;};exports[_0x7d16('0x70')]=function(_0x3f4555,_0x1ee0e8){var _0xffb009=_0x1ee0e8?encryptor[_0x7d16('0x6a')](_0x1ee0e8)[_0x7d16('0x6b')](','):[];if(_0xffb009[_0x7d16('0x71')]===0x5){_0xffb009[_0x7d16('0x72')](-0x1,0x1);}_0xffb009[_0x7d16('0x73')](_0x3f4555);return encryptor[_0x7d16('0x74')](_0xffb009[_0x7d16('0x75')](','));};function signJwt(_0x3f714d){var _0x2a5535=BPromise['promisify'](jwt[_0x7d16('0x76')],{'context':jwt});var _0xbdd009=_0x3f714d[_0x7d16('0x77')]||config[_0x7d16('0xb')]['session'];return new BPromise(function(_0x21eae5,_0x80d6f8){_0x2a5535(_0x3f714d[_0x7d16('0x78')],_0xbdd009,_0x3f714d[_0x7d16('0x79')])[_0x7d16('0x32')](function(_0x92e4b9){_0x21eae5(_0x92e4b9);})[_0x7d16('0x36')](function(_0x1543e2){_0x80d6f8(_0x1543e2);});});}function verifyJwt(_0x29d1a6,_0x309289,_0x484649){var _0x30a38f=BPromise[_0x7d16('0x7a')](jwt[_0x7d16('0x7b')],{'context':jwt});var _0x38f4c9=_0x484649||config[_0x7d16('0xb')][_0x7d16('0xc')];return new BPromise(function(_0x147fed,_0x408935){_0x30a38f(_0x29d1a6,_0x38f4c9,_0x309289)[_0x7d16('0x32')](function(_0x4f2098){_0x147fed(_0x4f2098);})[_0x7d16('0x36')](function(_0x2979e4){_0x408935(_0x2979e4);});});}function generateNonce(){return crypto[_0x7d16('0x7c')](0x10)['toString'](_0x7d16('0x7d'));}function generateIssuedAt(){return Math[_0x7d16('0x7e')](Date[_0x7d16('0x7f')]()/0x3e8)['toString']();}function createJwt(_0x103b57){var _0x48052d={'payload':{'iat':_0x103b57['apiKeyIat'],'nonce':_0x103b57[_0x7d16('0x49')]},'options':{'algorithm':_0x7d16('0x80'),'subject':_0x103b57['id'][_0x7d16('0x81')](),'issuer':hardwareConf[_0x7d16('0x43')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x48052d)[_0x7d16('0x32')](function(_0x30ef12){return{'iat':_0x103b57[_0x7d16('0x62')],'nonce':_0x103b57['apiKeyNonce'],'token':_0x30ef12};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index db1470f..2e4a0e6 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 _0x4128=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','write','end','final','binary','close','decryptFile','createReadStream','secret','utf8','base64','decryptString','createDecipher','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x138690,_0x39979d){var _0x4502c4=function(_0x825fd0){while(--_0x825fd0){_0x138690['push'](_0x138690['shift']());}};_0x4502c4(++_0x39979d);}(_0x4128,0x18d));var _0x8412=function(_0x2c879a,_0x2e76f1){_0x2c879a=_0x2c879a-0x0;var _0x491c46=_0x4128[_0x2c879a];return _0x491c46;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x8412('0x0'));var _=require('lodash');var config=require(_0x8412('0x1'));var logger=require(_0x8412('0x2'))(_0x8412('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8412('0x4')][_0x8412('0x5')],'algorithm':_0x8412('0x6')};const fileOptions={'algorithm':_0x8412('0x7')};if(config[_0x8412('0x8')]&&config[_0x8412('0x8')][_0x8412('0x9')]){var isSupported=isAlgorithmSupported(config[_0x8412('0x8')][_0x8412('0x9')]);if(isSupported){fileOptions[_0x8412('0x9')]=config[_0x8412('0x8')][_0x8412('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8412('0xa')](',\x20');logger[_0x8412('0xb')](config[_0x8412('0x8')][_0x8412('0x9')],_0x8412('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1a60ee){return AES_SUPPORTED_RX[_0x8412('0xd')](_0x1a60ee);}function getSupportedCiphers(){return crypto[_0x8412('0xe')]()[_0x8412('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xf8d260){return getSupportedCiphers()['indexOf'](_0xf8d260)>-0x1;}function combineOptions(_0x3f362d){var _0x4f9e46={};for(var _0x2a3810 in fileOptions){if(fileOptions[_0x8412('0x10')](_0x2a3810)){_0x4f9e46[_0x2a3810]=fileOptions[_0x2a3810];}}if(_0x3f362d){for(var _0xa568a8 in _0x3f362d){if(_0x3f362d[_0x8412('0x10')](_0xa568a8)){_0x4f9e46[_0xa568a8]=_0x3f362d[_0xa568a8];}}}return _0x4f9e46;}exports[_0x8412('0x11')]=function(_0x25a861,_0x539ee4,_0x276e6c,_0x3a8da5){return new BPromise(function(_0x26c3ef,_0x43f542){_0x3a8da5=combineOptions(_0x3a8da5);var _0x2d5012=new Buffer(_0x276e6c);var _0x46e527=fs['createReadStream'](_0x25a861);var _0x42f538=fs[_0x8412('0x12')](_0x539ee4);var _0x5df1f0=crypto[_0x8412('0x13')](_0x3a8da5[_0x8412('0x9')],_0x2d5012);_0x46e527['on'](_0x8412('0x14'),function(_0x159893){var _0x55b6fd=new Buffer(_0x5df1f0[_0x8412('0x15')](_0x159893),'binary');_0x42f538[_0x8412('0x16')](_0x55b6fd);});_0x46e527['on'](_0x8412('0x17'),function(){try{var _0x127ef6=new Buffer(_0x5df1f0[_0x8412('0x18')](_0x8412('0x19')),'binary');_0x42f538[_0x8412('0x16')](_0x127ef6);_0x42f538[_0x8412('0x17')]();_0x42f538['on'](_0x8412('0x1a'),function(){return _0x26c3ef(_0x539ee4);});}catch(_0x411449){fs['unlink'](_0x539ee4);return _0x43f542(_0x411449);}});});};exports[_0x8412('0x1b')]=function(_0x52d263,_0x53b58c,_0x22f948,_0xb06a5d){return new BPromise(function(_0x569c72,_0x2fe5a9){_0xb06a5d=combineOptions(_0xb06a5d);var _0x3d010a=new Buffer(_0x22f948);var _0x9fde14=fs[_0x8412('0x1c')](_0x52d263);var _0x3ddbef=fs[_0x8412('0x12')](_0x53b58c);var _0x2dd634=crypto['createDecipher'](_0xb06a5d[_0x8412('0x9')],_0x3d010a);_0x9fde14['on'](_0x8412('0x14'),function(_0x4cb765){var _0x820eef=new Buffer(_0x2dd634[_0x8412('0x15')](_0x4cb765),_0x8412('0x19'));_0x3ddbef[_0x8412('0x16')](_0x820eef);});_0x9fde14['on'](_0x8412('0x17'),function(){try{var _0x258087=new Buffer(_0x2dd634[_0x8412('0x18')](_0x8412('0x19')),_0x8412('0x19'));_0x3ddbef[_0x8412('0x16')](_0x258087);_0x3ddbef[_0x8412('0x17')]();_0x3ddbef['on']('close',function(){return _0x569c72(_0x53b58c);});}catch(_0x1cb6f9){fs['unlink'](_0x53b58c);return _0x2fe5a9(_0x1cb6f9);}});});};exports['encryptString']=function(_0x4b29ef,_0x3c41bd,_0x5879df){var _0x212b95=_0x5879df||stringOptions[_0x8412('0x9')];var _0xe59b68=_0x3c41bd||stringOptions[_0x8412('0x1d')];var _0x2be5ec=crypto[_0x8412('0x13')](_0x212b95,_0xe59b68);var _0x4a5cc0=_0x2be5ec[_0x8412('0x15')](_0x4b29ef,_0x8412('0x1e'),_0x8412('0x1f'));_0x4a5cc0+=_0x2be5ec[_0x8412('0x18')](_0x8412('0x1f'));return _0x4a5cc0;};exports[_0x8412('0x20')]=function(_0x58935b,_0x45d9ef,_0x4556eb){var _0x22ddd3=_0x4556eb||stringOptions[_0x8412('0x9')];var _0x5039b6=_0x45d9ef||stringOptions[_0x8412('0x1d')];var _0x55f0ba=crypto[_0x8412('0x21')](_0x22ddd3,_0x5039b6);var _0x32d0a6=_0x55f0ba[_0x8412('0x15')](_0x58935b,'base64',_0x8412('0x1e'));_0x32d0a6+=_0x55f0ba[_0x8412('0x18')]('utf8');return _0x32d0a6;}; \ No newline at end of file +var _0x7c31=['secret','utf8','base64','decryptString','crypto','bluebird','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher','data','update','binary','write','end','final','close','unlink','createWriteStream','createDecipher','encryptString'];(function(_0x18776a,_0x4fecab){var _0x484e4a=function(_0x2c8722){while(--_0x2c8722){_0x18776a['push'](_0x18776a['shift']());}};_0x484e4a(++_0x4fecab);}(_0x7c31,0x17a));var _0x17c3=function(_0x54c5e6,_0xe2462a){_0x54c5e6=_0x54c5e6-0x0;var _0x3948fa=_0x7c31[_0x54c5e6];return _0x3948fa;};'use strict';var crypto=require(_0x17c3('0x0'));var fs=require('fs');var BPromise=require(_0x17c3('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x17c3('0x2'))(_0x17c3('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x17c3('0x4')][_0x17c3('0x5')],'algorithm':_0x17c3('0x6')};const fileOptions={'algorithm':_0x17c3('0x7')};if(config[_0x17c3('0x8')]&&config[_0x17c3('0x8')][_0x17c3('0x9')]){var isSupported=isAlgorithmSupported(config[_0x17c3('0x8')][_0x17c3('0x9')]);if(isSupported){fileOptions[_0x17c3('0x9')]=config[_0x17c3('0x8')][_0x17c3('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x17c3('0xa')](',\x20');logger['error'](config[_0x17c3('0x8')]['algorithm'],_0x17c3('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x337fbb){return AES_SUPPORTED_RX[_0x17c3('0xc')](_0x337fbb);}function getSupportedCiphers(){return crypto[_0x17c3('0xd')]()[_0x17c3('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2159fa){return getSupportedCiphers()[_0x17c3('0xf')](_0x2159fa)>-0x1;}function combineOptions(_0x2d99b3){var _0x6f9977={};for(var _0x8f4f63 in fileOptions){if(fileOptions[_0x17c3('0x10')](_0x8f4f63)){_0x6f9977[_0x8f4f63]=fileOptions[_0x8f4f63];}}if(_0x2d99b3){for(var _0xdacab2 in _0x2d99b3){if(_0x2d99b3[_0x17c3('0x10')](_0xdacab2)){_0x6f9977[_0xdacab2]=_0x2d99b3[_0xdacab2];}}}return _0x6f9977;}exports[_0x17c3('0x11')]=function(_0x3719c9,_0x3de6e0,_0x3b1bc0,_0x55ebed){return new BPromise(function(_0x56d3c3,_0x5d33c7){_0x55ebed=combineOptions(_0x55ebed);var _0x2dd238=new Buffer(_0x3b1bc0);var _0x302007=fs['createReadStream'](_0x3719c9);var _0x2d0015=fs['createWriteStream'](_0x3de6e0);var _0x140517=crypto[_0x17c3('0x12')](_0x55ebed[_0x17c3('0x9')],_0x2dd238);_0x302007['on'](_0x17c3('0x13'),function(_0x397a5c){var _0x3dfc7c=new Buffer(_0x140517[_0x17c3('0x14')](_0x397a5c),_0x17c3('0x15'));_0x2d0015[_0x17c3('0x16')](_0x3dfc7c);});_0x302007['on'](_0x17c3('0x17'),function(){try{var _0x2d1537=new Buffer(_0x140517[_0x17c3('0x18')](_0x17c3('0x15')),_0x17c3('0x15'));_0x2d0015[_0x17c3('0x16')](_0x2d1537);_0x2d0015[_0x17c3('0x17')]();_0x2d0015['on'](_0x17c3('0x19'),function(){return _0x56d3c3(_0x3de6e0);});}catch(_0x36c6be){fs[_0x17c3('0x1a')](_0x3de6e0);return _0x5d33c7(_0x36c6be);}});});};exports['decryptFile']=function(_0x32fda2,_0x331a00,_0x43fc96,_0x1ef9b1){return new BPromise(function(_0x4ac86c,_0x4c92e7){_0x1ef9b1=combineOptions(_0x1ef9b1);var _0x45b299=new Buffer(_0x43fc96);var _0x131acc=fs['createReadStream'](_0x32fda2);var _0x4cb12e=fs[_0x17c3('0x1b')](_0x331a00);var _0x4c6707=crypto[_0x17c3('0x1c')](_0x1ef9b1[_0x17c3('0x9')],_0x45b299);_0x131acc['on']('data',function(_0x38bc85){var _0x1aa8de=new Buffer(_0x4c6707[_0x17c3('0x14')](_0x38bc85),_0x17c3('0x15'));_0x4cb12e[_0x17c3('0x16')](_0x1aa8de);});_0x131acc['on'](_0x17c3('0x17'),function(){try{var _0x29ed7f=new Buffer(_0x4c6707[_0x17c3('0x18')]('binary'),_0x17c3('0x15'));_0x4cb12e['write'](_0x29ed7f);_0x4cb12e['end']();_0x4cb12e['on'](_0x17c3('0x19'),function(){return _0x4ac86c(_0x331a00);});}catch(_0x15d8aa){fs[_0x17c3('0x1a')](_0x331a00);return _0x4c92e7(_0x15d8aa);}});});};exports[_0x17c3('0x1d')]=function(_0x42747f,_0xcc989,_0x5ab6eb){var _0x24ff00=_0x5ab6eb||stringOptions[_0x17c3('0x9')];var _0x5e29b3=_0xcc989||stringOptions[_0x17c3('0x1e')];var _0x41035c=crypto['createCipher'](_0x24ff00,_0x5e29b3);var _0x15e25a=_0x41035c[_0x17c3('0x14')](_0x42747f,_0x17c3('0x1f'),'base64');_0x15e25a+=_0x41035c[_0x17c3('0x18')](_0x17c3('0x20'));return _0x15e25a;};exports[_0x17c3('0x21')]=function(_0x42b9a0,_0x431e0a,_0x17e456){var _0x2a6c00=_0x17e456||stringOptions[_0x17c3('0x9')];var _0x491317=_0x431e0a||stringOptions[_0x17c3('0x1e')];var _0x4a3bd8=crypto[_0x17c3('0x1c')](_0x2a6c00,_0x491317);var _0x1671e7=_0x4a3bd8[_0x17c3('0x14')](_0x42b9a0,'base64',_0x17c3('0x1f'));_0x1671e7+=_0x4a3bd8['final'](_0x17c3('0x1f'));return _0x1671e7;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index d448dfb..37545ef 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 _0x4d51=['AnalyticExtractedReport','update','info','format','Setting','split','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','then','num','Empty','length','range','isInteger','query','QueryTypes','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename'];(function(_0x19b559,_0x5b6b50){var _0x41816e=function(_0x140bc0){while(--_0x140bc0){_0x19b559['push'](_0x19b559['shift']());}};_0x41816e(++_0x5b6b50);}(_0x4d51,0xb2));var _0x14d5=function(_0x1934b3,_0x392e1c){_0x1934b3=_0x1934b3-0x0;var _0x1e7daf=_0x4d51[_0x1934b3];return _0x1e7daf;};'use strict';var util=require(_0x14d5('0x0'));var path=require(_0x14d5('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x14d5('0x2'));var zipdir=require(_0x14d5('0x3'));var rimraf=require(_0x14d5('0x4'));var db=require(_0x14d5('0x5'))['db'];var dbH=require(_0x14d5('0x5'))[_0x14d5('0x6')];var logger=require(_0x14d5('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x14d5('0x8')][0x2]);var QUERY=process[_0x14d5('0x8')][0x3];var PATH=process[_0x14d5('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fd1ee,_0x4e5362){var _0x210257={'status':_0x2fd1ee};var _0x5d3a39={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e5362){_0x210257[_0x14d5('0x9')]=_0x4e5362;}return db[_0x14d5('0xa')][_0x14d5('0xb')](_0x210257,_0x5d3a39);}function main(){var _0x3ad107=0x1388;var _0x4b8e77;logger[_0x14d5('0xc')](util[_0x14d5('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x14d5('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x14d5('0xf'),'splitSizeCsv']})['then'](function(_0x6ef856){if(_0x6ef856){_0x4b8e77=_0x6ef856;_0x3ad107=_0x4b8e77[_0x14d5('0x10')]||0x1388;}})['then'](function(){return dbH[_0x14d5('0x11')]['query'](util[_0x14d5('0xd')](_0x14d5('0x12'),QUERY),{'type':dbH[_0x14d5('0x11')]['QueryTypes']['SELECT']});})[_0x14d5('0x13')](function(_0x229a0e){if(!_0x229a0e[0x0][_0x14d5('0x14')]){return analyticExtractedReport(_0x14d5('0x15'));}var _0xb76eac=[];var _0x5ef754=0x0;if(_0x4b8e77[_0x14d5('0xf')]){if(_0x229a0e&&_0x229a0e[_0x14d5('0x16')]){var _0x192ddc=_[_0x14d5('0x17')](_0x229a0e[0x0][_0x14d5('0x14')]/_0x3ad107);var _0x294a82=Number[_0x14d5('0x18')](_0x229a0e[0x0]['num']/_0x3ad107)?_0x229a0e[0x0]['num']%_0x3ad107:0x0;_0x192ddc['forEach'](function(_0xc4ff22){if(_0xc4ff22>0x0){_0x5ef754+=_0x3ad107;}_0xb76eac['push'](dbH['sequelize'][_0x14d5('0x19')](util[_0x14d5('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3ad107,_0x5ef754),{'type':dbH[_0x14d5('0x11')][_0x14d5('0x1a')][_0x14d5('0x1b')]}));});if(_0x294a82>0x0){_0x5ef754+=_0x3ad107;_0xb76eac[_0x14d5('0x1c')](dbH[_0x14d5('0x11')][_0x14d5('0x19')](util[_0x14d5('0xd')](_0x14d5('0x1d'),QUERY,_0x294a82,_0x5ef754),{'type':dbH['sequelize'][_0x14d5('0x1a')][_0x14d5('0x1b')]}));}}}else{_0xb76eac[_0x14d5('0x1c')](dbH[_0x14d5('0x11')][_0x14d5('0x19')](QUERY,{'type':dbH[_0x14d5('0x11')][_0x14d5('0x1a')][_0x14d5('0x1b')]}));}var _0x227a45=path['dirname'](PATH);var _0x266378=path['basename'](PATH,_0x14d5('0x1e'));var _0x234bda=_0x4b8e77[_0x14d5('0xf')]&&_0xb76eac[_0x14d5('0x16')]>0x1;var _0x9a60b7=[];if(!fs[_0x14d5('0x1f')](path[_0x14d5('0x20')](_0x227a45,_0x266378))&&_0x234bda){fs['mkdirSync'](path['join'](_0x227a45,_0x266378));}return BPromise[_0x14d5('0x21')](_0xb76eac,function(_0xc9eed1){_0x9a60b7[_0x14d5('0x1c')](_0xc9eed1);})['then'](function(){for(var _0x8c7ac8=0x0;_0x8c7ac8<_0x9a60b7[_0x14d5('0x16')];_0x8c7ac8+=0x1){var _0x347205;var _0x1c20af=_0x9a60b7[_0x8c7ac8];if(_0x234bda){_0x347205=path['join'](_0x227a45,_0x266378,util['format'](_0x14d5('0x22'),_0x266378,_0x8c7ac8,_0x14d5('0x23')));}else{_0x347205=path[_0x14d5('0x20')](_0x227a45,util[_0x14d5('0xd')](_0x14d5('0x24'),_0x266378,'csv'));}fs['writeFileSync'](_0x347205,csv(_0x1c20af));}})[_0x14d5('0x13')](function(){if(_0x234bda){return new Promise(function(_0x3015a3){zipdir(path[_0x14d5('0x20')](_0x227a45,_0x266378),{'saveTo':path[_0x14d5('0x20')](_0x227a45,util[_0x14d5('0xd')](_0x14d5('0x24'),_0x266378,_0x14d5('0x25')))},function(_0x34f36c,_0x1c8412){rimraf(path[_0x14d5('0x20')](_0x227a45,_0x266378),function(){});_0x3015a3(_0x14d5('0x26'));});});}})[_0x14d5('0x13')](function(){logger[_0x14d5('0xc')](util['format'](_0x14d5('0x27'),EXTRACTED_REPORT_ID,_0x14d5('0x28')));return analyticExtractedReport(_0x14d5('0x29'),_0x234bda?util[_0x14d5('0xd')]('%s.%s',_0x266378,_0x234bda?_0x14d5('0x25'):_0x14d5('0x23')):null);});})[_0x14d5('0x2a')](function(_0x4b8355){logger[_0x14d5('0xc')](util['format'](_0x14d5('0x2b'),EXTRACTED_REPORT_ID,_0x14d5('0x28')),util[_0x14d5('0x2c')](_0x4b8355,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x14d5('0x2d'));})[_0x14d5('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcd88=['to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','join','mkdirSync','each','%s.%s','csv','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','Failed','finally','exit','util','path'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0xcd88,0x15c));var _0x8cd8=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xcd88[_0x1bc013];return _0x55df36;};'use strict';var util=require(_0x8cd8('0x0'));var path=require(_0x8cd8('0x1'));var _=require('lodash');var csv=require(_0x8cd8('0x2'));var fs=require('fs');var BPromise=require(_0x8cd8('0x3'));var zipdir=require(_0x8cd8('0x4'));var rimraf=require(_0x8cd8('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8cd8('0x6'))[_0x8cd8('0x7')];var logger=require(_0x8cd8('0x8'))(_0x8cd8('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x8cd8('0xa')][0x2]);var QUERY=process[_0x8cd8('0xa')][0x3];var PATH=process[_0x8cd8('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5cee19,_0x450fe8){var _0x2ab925={'status':_0x5cee19};var _0x5960ae={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x450fe8){_0x2ab925[_0x8cd8('0xb')]=_0x450fe8;}return db[_0x8cd8('0xc')][_0x8cd8('0xd')](_0x2ab925,_0x5960ae);}function main(){var _0x3bf5c8=0x1388;var _0x91fca;logger[_0x8cd8('0xe')](util[_0x8cd8('0xf')](_0x8cd8('0x10'),EXTRACTED_REPORT_ID,_0x8cd8('0x11')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8cd8('0x12'),'splitSizeCsv']})[_0x8cd8('0x13')](function(_0x515d30){if(_0x515d30){_0x91fca=_0x515d30;_0x3bf5c8=_0x91fca[_0x8cd8('0x14')]||0x1388;}})[_0x8cd8('0x13')](function(){return dbH[_0x8cd8('0x15')][_0x8cd8('0x16')](util[_0x8cd8('0xf')](_0x8cd8('0x17'),QUERY),{'type':dbH[_0x8cd8('0x15')][_0x8cd8('0x18')][_0x8cd8('0x19')]});})[_0x8cd8('0x13')](function(_0x5e84e7){if(!_0x5e84e7[0x0][_0x8cd8('0x1a')]){return analyticExtractedReport(_0x8cd8('0x1b'));}var _0xce9cb0=[];var _0x2ff853=0x0;if(_0x91fca['split']){if(_0x5e84e7&&_0x5e84e7[_0x8cd8('0x1c')]){var _0x32d0e2=_[_0x8cd8('0x1d')](_0x5e84e7[0x0][_0x8cd8('0x1a')]/_0x3bf5c8);var _0x59302e=Number[_0x8cd8('0x1e')](_0x5e84e7[0x0][_0x8cd8('0x1a')]/_0x3bf5c8)?_0x5e84e7[0x0][_0x8cd8('0x1a')]%_0x3bf5c8:0x0;_0x32d0e2[_0x8cd8('0x1f')](function(_0x470ba5){if(_0x470ba5>0x0){_0x2ff853+=_0x3bf5c8;}_0xce9cb0[_0x8cd8('0x20')](dbH['sequelize'][_0x8cd8('0x16')](util['format'](_0x8cd8('0x21'),QUERY,_0x3bf5c8,_0x2ff853),{'type':dbH[_0x8cd8('0x15')]['QueryTypes'][_0x8cd8('0x19')]}));});if(_0x59302e>0x0){_0x2ff853+=_0x3bf5c8;_0xce9cb0[_0x8cd8('0x20')](dbH[_0x8cd8('0x15')][_0x8cd8('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x59302e,_0x2ff853),{'type':dbH[_0x8cd8('0x15')][_0x8cd8('0x18')][_0x8cd8('0x19')]}));}}}else{_0xce9cb0[_0x8cd8('0x20')](dbH['sequelize'][_0x8cd8('0x16')](QUERY,{'type':dbH[_0x8cd8('0x15')][_0x8cd8('0x18')]['SELECT']}));}var _0x114a88=path[_0x8cd8('0x22')](PATH);var _0x2b4880=path['basename'](PATH,_0x8cd8('0x23'));var _0x3a668d=_0x91fca[_0x8cd8('0x12')]&&_0xce9cb0[_0x8cd8('0x1c')]>0x1;var _0x1df5ef=[];if(!fs['existsSync'](path[_0x8cd8('0x24')](_0x114a88,_0x2b4880))&&_0x3a668d){fs[_0x8cd8('0x25')](path[_0x8cd8('0x24')](_0x114a88,_0x2b4880));}return BPromise[_0x8cd8('0x26')](_0xce9cb0,function(_0xec42c9){_0x1df5ef[_0x8cd8('0x20')](_0xec42c9);})[_0x8cd8('0x13')](function(){for(var _0x571d5f=0x0;_0x571d5f<_0x1df5ef[_0x8cd8('0x1c')];_0x571d5f+=0x1){var _0x1a3802;var _0x208b40=_0x1df5ef[_0x571d5f];if(_0x3a668d){_0x1a3802=path['join'](_0x114a88,_0x2b4880,util['format']('%s%d.%s',_0x2b4880,_0x571d5f,'csv'));}else{_0x1a3802=path[_0x8cd8('0x24')](_0x114a88,util[_0x8cd8('0xf')](_0x8cd8('0x27'),_0x2b4880,_0x8cd8('0x28')));}fs['writeFileSync'](_0x1a3802,csv(_0x208b40));}})[_0x8cd8('0x13')](function(){if(_0x3a668d){return new Promise(function(_0x1af2dd){zipdir(path[_0x8cd8('0x24')](_0x114a88,_0x2b4880),{'saveTo':path[_0x8cd8('0x24')](_0x114a88,util[_0x8cd8('0xf')]('%s.%s',_0x2b4880,_0x8cd8('0x29')))},function(_0x4571b6,_0x4d64f4){rimraf(path['join'](_0x114a88,_0x2b4880),function(){});_0x1af2dd(_0x8cd8('0x2a'));});});}})['then'](function(){logger[_0x8cd8('0xe')](util[_0x8cd8('0xf')](_0x8cd8('0x2b'),EXTRACTED_REPORT_ID,_0x8cd8('0x11')));return analyticExtractedReport('Completed',_0x3a668d?util[_0x8cd8('0xf')](_0x8cd8('0x27'),_0x2b4880,_0x3a668d?_0x8cd8('0x29'):'csv'):null);});})[_0x8cd8('0x2c')](function(_0x139b5e){logger[_0x8cd8('0xe')](util[_0x8cd8('0xf')](_0x8cd8('0x2d'),EXTRACTED_REPORT_ID,_0x8cd8('0x11')),util[_0x8cd8('0x2e')](_0x139b5e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8cd8('0x2f'));})[_0x8cd8('0x30')](function(){process[_0x8cd8('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 a17ea2a..6b7e98e 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 _0x63ec=['then','split','range','num','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','zip','zip\x20finished','info','%s.%s','PDF','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','pageBreak','margin','\x20/\x20','footer','black','right','Empty','Setting','splitSizePdf'];(function(_0x52088a,_0x40cc10){var _0x593048=function(_0x405588){while(--_0x405588){_0x52088a['push'](_0x52088a['shift']());}};_0x593048(++_0x40cc10);}(_0x63ec,0x1e8));var _0xc63e=function(_0x6d2a05,_0x4423e8){_0x6d2a05=_0x6d2a05-0x0;var _0x1e66d5=_0x63ec[_0x6d2a05];return _0x1e66d5;};'use strict';var _=require(_0xc63e('0x0'));var fs=require('fs');var util=require(_0xc63e('0x1'));var path=require(_0xc63e('0x2'));var moment=require(_0xc63e('0x3'));var htmlToPdfmake=require(_0xc63e('0x4'));var PdfPrinter=require(_0xc63e('0x5'));var zipdir=require(_0xc63e('0x6'));var rimraf=require(_0xc63e('0x7'));var JSDOM=require('jsdom')[_0xc63e('0x8')];var window=new JSDOM('')[_0xc63e('0x9')];var BPromise=require(_0xc63e('0xa'));var db=require(_0xc63e('0xb'))['db'];var dbH=require(_0xc63e('0xb'))[_0xc63e('0xc')];var logger=require('../../config/logger')(_0xc63e('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc63e('0xe')][0x3];var PATH=process[_0xc63e('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xc63e('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x263157,_0x2c71fa){var _0x45159d={'status':_0x263157};var _0x11362d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c71fa){_0x45159d[_0xc63e('0x10')]=_0x2c71fa;}return db[_0xc63e('0x11')]['update'](_0x45159d,_0x11362d);}function getHeaders(_0x499404){return _[_0xc63e('0x12')](_0x499404,function(_0x4d7043){return{'text':_0x4d7043,'style':_0xc63e('0x13')};});}function getRows(_0x8826f4,_0x334336){return _['map'](_0x334336,function(_0x30a722){return _(_0x30a722)[_0xc63e('0x14')](_0x8826f4)[_0xc63e('0x12')](function(_0x1326de){return _0x1326de?_[_0xc63e('0x15')](_0x1326de):'';})[_0xc63e('0x16')]();});}function createTable(_0x21d7df,_0xca8028){var _0x337228={'widths':_[_0xc63e('0x17')](Array(_0x21d7df[_0xc63e('0x18')]),0x91),'heights':function(_0x1cbfcf){return _0x1cbfcf===0x0?_0xc63e('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3754e5=getHeaders(_0x21d7df);_0x337228[_0xc63e('0x1a')]['push'](_0x3754e5);var _0x59efbb=getRows(_0x21d7df,_0xca8028);_0x337228[_0xc63e('0x1a')]=_0x337228['body'][_0xc63e('0x1b')](_0x59efbb);return _0x337228;}function createTables(_0x5c3b99){var _0x59f94c=[];var _0x53cec4=_[_0xc63e('0x1c')](Object[_0xc63e('0x1d')](_0x5c3b99[0x0]),0x5);_0x53cec4['forEach'](function(_0x3fe760){_0x59f94c['push'](createTable(_0x3fe760,_0x5c3b99));});return _0x59f94c;}function getPDFDocDefinition(_0x4c257f){var _0x3bbfac=util[_0xc63e('0x1e')](_0xc63e('0x1f'),NAME,EXTRACTED_REPORT[_0xc63e('0x20')],moment(EXTRACTED_REPORT[_0xc63e('0x21')])[_0xc63e('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xc63e('0x22')])['format'](FORMAT));var _0x3297a1=[];for(var _0xee26cf=0x0;_0xee26cf<_0x4c257f[_0xc63e('0x18')];_0xee26cf++){var _0x2ff649=[];if(_0xee26cf===0x0){_0x2ff649[_0xc63e('0x23')]({'text':_0x3bbfac,'style':_0xc63e('0x24')});}var _0x3bf8c3={'table':_0x4c257f[_0xee26cf]};if(_0xee26cf>0x0){_0x3bf8c3[_0xc63e('0x25')]='before';_0x3bf8c3[_0xc63e('0x26')]=[0x0,0x46,0x0,0x0];}_0x2ff649[_0xc63e('0x23')](_0x3bf8c3);_0x3297a1[_0xc63e('0x23')](_0x2ff649);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3297a1,'footer':function(_0x1d9fe4,_0x529ceb){return{'text':_0x1d9fe4['toString']()+_0xc63e('0x27')+_0x529ceb,'style':_0xc63e('0x28')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc63e('0x29')},'footer':{'alignment':_0xc63e('0x2a'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x325913){var _0x3346e9=0x1388;var _0x440a2d;if(!_0x325913[0x0]['num']){return analyticExtractedReport(_0xc63e('0x2b'));}return db[_0xc63e('0x2c')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xc63e('0x2d')]})[_0xc63e('0x2e')](function(_0x560fae){if(_0x560fae){_0x440a2d=_0x560fae;_0x3346e9=_0x440a2d[_0xc63e('0x2d')]||0x3e8;}})[_0xc63e('0x2e')](function(){var _0x21d34a=[];var _0x3d8bf7=0x0;if(_0x440a2d[_0xc63e('0x2f')]){if(_0x325913&&_0x325913[_0xc63e('0x18')]){var _0x17c15c=_[_0xc63e('0x30')](_0x325913[0x0][_0xc63e('0x31')]/_0x3346e9);var _0x3d467d=Number[_0xc63e('0x32')](_0x325913[0x0][_0xc63e('0x31')]/_0x3346e9)?_0x325913[0x0][_0xc63e('0x31')]%_0x3346e9:0x0;_0x17c15c[_0xc63e('0x33')](function(_0x3fd13a){if(_0x3fd13a>0x0){_0x3d8bf7+=_0x3346e9;}_0x21d34a[_0xc63e('0x23')](dbH[_0xc63e('0x34')][_0xc63e('0x35')](util[_0xc63e('0x1e')](_0xc63e('0x36'),QUERY,_0x3346e9,_0x3d8bf7),{'type':dbH['sequelize'][_0xc63e('0x37')][_0xc63e('0x38')]}));});if(_0x3d467d>0x0){_0x3d8bf7+=_0x3346e9;_0x21d34a[_0xc63e('0x23')](dbH[_0xc63e('0x34')][_0xc63e('0x35')](util[_0xc63e('0x1e')](_0xc63e('0x36'),QUERY,_0x3d467d,_0x3d8bf7),{'type':dbH['sequelize'][_0xc63e('0x37')]['SELECT']}));}}}else{_0x21d34a['push'](dbH['sequelize'][_0xc63e('0x35')](QUERY,{'type':dbH[_0xc63e('0x34')]['QueryTypes']['SELECT']}));}var _0xfcab80=path[_0xc63e('0x39')](PATH);var _0x422700=path[_0xc63e('0x3a')](PATH,'.pdf');var _0x585470=_0x440a2d['split']&&_0x21d34a['length']>0x1;var _0x49414c=[];if(!fs[_0xc63e('0x3b')](path[_0xc63e('0x3c')](_0xfcab80,_0x422700))&&_0x585470){fs[_0xc63e('0x3d')](path[_0xc63e('0x3c')](_0xfcab80,_0x422700));}return BPromise[_0xc63e('0x3e')](_0x21d34a,function(_0x58cd1d){_0x49414c[_0xc63e('0x23')](_0x58cd1d);})['then'](function(){var _0xc1496d=[];for(var _0x4a82f7=0x0;_0x4a82f7<_0x49414c[_0xc63e('0x18')];_0x4a82f7+=0x1){var _0x23ab17=_0x49414c[_0x4a82f7];var _0x1498d2=createTables(_[_0xc63e('0x3f')](_0x23ab17));var _0x5b9af5;var _0x891c2c=getPDFDocDefinition(_0x1498d2);var _0x53226a=getPDFPrinter();var _0xa6922a=_0x53226a[_0xc63e('0x40')](_0x891c2c);if(_0x585470){_0x5b9af5=path[_0xc63e('0x3c')](_0xfcab80,_0x422700,util[_0xc63e('0x1e')](_0xc63e('0x41'),_0x422700,_0x4a82f7,_0xc63e('0x42')));}else{_0x5b9af5=path[_0xc63e('0x3c')](_0xfcab80,util[_0xc63e('0x1e')]('%s.%s',_0x422700,_0xc63e('0x42')));}_0xc1496d[_0xc63e('0x23')](writePDFDocument(_0xa6922a,_0x5b9af5));}return Promise[_0xc63e('0x43')](_0xc1496d);})['then'](function(){if(_0x585470){return new Promise(function(_0x5601fa){zipdir(path['join'](_0xfcab80,_0x422700),{'saveTo':path[_0xc63e('0x3c')](_0xfcab80,util['format']('%s.%s',_0x422700,_0xc63e('0x44')))},function(){rimraf(path['join'](_0xfcab80,_0x422700),function(){});_0x5601fa(_0xc63e('0x45'));});});}})[_0xc63e('0x2e')](function(){if(!_0x585470)return;rimraf(path[_0xc63e('0x3c')](_0xfcab80,_0x422700),function(){});})[_0xc63e('0x2e')](function(){logger[_0xc63e('0x46')](util[_0xc63e('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x585470?util[_0xc63e('0x1e')](_0xc63e('0x47'),_0x422700,_0x585470?_0xc63e('0x44'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xc63e('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc63e('0x48')));return db[_0xc63e('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc63e('0x2e')](function(_0x2f5dcc){EXTRACTED_REPORT=_0x2f5dcc;return dbH[_0xc63e('0x34')][_0xc63e('0x35')](util[_0xc63e('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xc63e('0x37')][_0xc63e('0x38')]});})[_0xc63e('0x2e')](extractReport)[_0xc63e('0x49')](function(_0x5ed731){logger['info'](util[_0xc63e('0x1e')](_0xc63e('0x4a'),EXTRACTED_REPORT_ID,_0xc63e('0x48')),util['inspect'](_0x5ed731,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc63e('0x4b'));})[_0xc63e('0x4c')](function(){process[_0xc63e('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4172f5=new PdfPrinter({'Arial':{'normal':__dirname+_0xc63e('0x4e'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xc63e('0x4f'),'bolditalics':__dirname+_0xc63e('0x50')}});return _0x4172f5;}function getPDFDocDefinitionFromHTML(_0x315ab9,_0x1e6b51){var _0x44ef82=util[_0xc63e('0x1e')](_0xc63e('0x51'),_0x1e6b51[_0xc63e('0x52')],_0x1e6b51['interactionId']);var _0x5544d2=moment()[_0xc63e('0x1e')]('YYYY-MM-DD')[_0xc63e('0x15')]();var _0x318f89=htmlToPdfmake(_0x315ab9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x318f89],'defaultStyle':{'font':_0xc63e('0x53')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc63e('0x54'),'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':_0xc63e('0x54')}},'header':function(){return[{'text':_0xc63e('0x55'),'style':_0xc63e('0x24')}];},'footer':function(_0x51978a,_0x3364bd){return[{'text':util[_0xc63e('0x1e')](_0xc63e('0x56'),_0x44ef82,_0x51978a,_0x3364bd,_0x5544d2),'style':_0xc63e('0x28')}];}};}function writePDFDocument(_0x371eef,_0x33c15d){return new Promise(function(_0x104b50,_0x16c174){var _0x574698=_0x371eef['pipe'](fs[_0xc63e('0x57')](_0x33c15d));_0x574698['on'](_0xc63e('0x58'),function(){_0x104b50(_0xc63e('0x58'));});_0x574698['on']('error',function(_0x56a22a){_0x16c174(_0x56a22a);});_0x371eef['end']();});}exports['createPdfFromHTML']=function(_0x15843f,_0x3725a3){var _0x349f29=getPDFPrinter();var _0x573e4a=getPDFDocDefinitionFromHTML(_0x15843f,_0x3725a3);var _0x3dbfd7=_0x349f29[_0xc63e('0x40')](_0x573e4a);return writePDFDocument(_0x3dbfd7,_0x3725a3[_0xc63e('0x2')])[_0xc63e('0x49')](function(_0xba8473){throw _0xba8473;});}; \ No newline at end of file +var _0xaab2=['length','auto','body','push','concat','chunk','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','pdf','%s.%s','all','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','window','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','toString','value'];(function(_0x51533c,_0x282ee9){var _0x2fc45c=function(_0x242791){while(--_0x242791){_0x51533c['push'](_0x51533c['shift']());}};_0x2fc45c(++_0x282ee9);}(_0xaab2,0xf5));var _0x2aab=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xaab2[_0x550d12];return _0x12103d;};'use strict';var _=require(_0x2aab('0x0'));var fs=require('fs');var util=require(_0x2aab('0x1'));var path=require(_0x2aab('0x2'));var moment=require(_0x2aab('0x3'));var htmlToPdfmake=require(_0x2aab('0x4'));var PdfPrinter=require(_0x2aab('0x5'));var zipdir=require(_0x2aab('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0x2aab('0x7'))['JSDOM'];var window=new JSDOM('')[_0x2aab('0x8')];var BPromise=require('bluebird');var db=require(_0x2aab('0x9'))['db'];var dbH=require(_0x2aab('0x9'))[_0x2aab('0xa')];var logger=require('../../config/logger')(_0x2aab('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x2aab('0xc')][0x2]);var QUERY=process[_0x2aab('0xc')][0x3];var PATH=process[_0x2aab('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x2aab('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1a33f9,_0x1cfee3){var _0x18e11e={'status':_0x1a33f9};var _0x500774={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1cfee3){_0x18e11e[_0x2aab('0xe')]=_0x1cfee3;}return db[_0x2aab('0xf')]['update'](_0x18e11e,_0x500774);}function getHeaders(_0x5c71c0){return _['map'](_0x5c71c0,function(_0x445dac){return{'text':_0x445dac,'style':'tableHeader'};});}function getRows(_0x2aaa89,_0x26f650){return _[_0x2aab('0x10')](_0x26f650,function(_0x6cffbb){return _(_0x6cffbb)['pick'](_0x2aaa89)[_0x2aab('0x10')](function(_0xdfbc9f){return _0xdfbc9f?_[_0x2aab('0x11')](_0xdfbc9f):'';})[_0x2aab('0x12')]();});}function createTable(_0x3f459c,_0x5e04ad){var _0x2271ef={'widths':_['fill'](Array(_0x3f459c[_0x2aab('0x13')]),0x91),'heights':function(_0x50bff5){return _0x50bff5===0x0?_0x2aab('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2cf8c2=getHeaders(_0x3f459c);_0x2271ef[_0x2aab('0x15')][_0x2aab('0x16')](_0x2cf8c2);var _0x130b09=getRows(_0x3f459c,_0x5e04ad);_0x2271ef[_0x2aab('0x15')]=_0x2271ef[_0x2aab('0x15')][_0x2aab('0x17')](_0x130b09);return _0x2271ef;}function createTables(_0x261852){var _0x30e60c=[];var _0x3b1d5a=_[_0x2aab('0x18')](Object['keys'](_0x261852[0x0]),0x5);_0x3b1d5a['forEach'](function(_0x366cf4){_0x30e60c[_0x2aab('0x16')](createTable(_0x366cf4,_0x261852));});return _0x30e60c;}function getPDFDocDefinition(_0x1b2503){var _0x5a2853=util[_0x2aab('0x19')](_0x2aab('0x1a'),NAME,EXTRACTED_REPORT[_0x2aab('0x1b')],moment(EXTRACTED_REPORT[_0x2aab('0x1c')])[_0x2aab('0x19')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x2aab('0x19')](FORMAT));var _0x2c92ba=[];for(var _0x102b38=0x0;_0x102b38<_0x1b2503['length'];_0x102b38++){var _0x3b2858=[];if(_0x102b38===0x0){_0x3b2858[_0x2aab('0x16')]({'text':_0x5a2853,'style':_0x2aab('0x1d')});}var _0x380df6={'table':_0x1b2503[_0x102b38]};if(_0x102b38>0x0){_0x380df6['pageBreak']=_0x2aab('0x1e');_0x380df6[_0x2aab('0x1f')]=[0x0,0x46,0x0,0x0];}_0x3b2858[_0x2aab('0x16')](_0x380df6);_0x2c92ba[_0x2aab('0x16')](_0x3b2858);}return{'pageSize':'A4','pageOrientation':_0x2aab('0x20'),'content':_0x2c92ba,'footer':function(_0x41318a,_0xcdb8f9){return{'text':_0x41318a[_0x2aab('0x11')]()+_0x2aab('0x21')+_0xcdb8f9,'style':_0x2aab('0x22')};},'defaultStyle':{'font':_0x2aab('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x2aab('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xbb0d98){var _0x84c21f=0x1388;var _0x1418fc;if(!_0xbb0d98[0x0][_0x2aab('0x25')]){return analyticExtractedReport(_0x2aab('0x26'));}return db[_0x2aab('0x27')][_0x2aab('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2aab('0x29'),'splitSizePdf']})['then'](function(_0x1bbc32){if(_0x1bbc32){_0x1418fc=_0x1bbc32;_0x84c21f=_0x1418fc[_0x2aab('0x2a')]||0x3e8;}})[_0x2aab('0x2b')](function(){var _0x52e3fd=[];var _0x46c5cc=0x0;if(_0x1418fc['split']){if(_0xbb0d98&&_0xbb0d98['length']){var _0x3e4df9=_['range'](_0xbb0d98[0x0][_0x2aab('0x25')]/_0x84c21f);var _0x4b941b=Number[_0x2aab('0x2c')](_0xbb0d98[0x0][_0x2aab('0x25')]/_0x84c21f)?_0xbb0d98[0x0][_0x2aab('0x25')]%_0x84c21f:0x0;_0x3e4df9['forEach'](function(_0x32583c){if(_0x32583c>0x0){_0x46c5cc+=_0x84c21f;}_0x52e3fd['push'](dbH[_0x2aab('0x2d')]['query'](util['format'](_0x2aab('0x2e'),QUERY,_0x84c21f,_0x46c5cc),{'type':dbH['sequelize'][_0x2aab('0x2f')][_0x2aab('0x30')]}));});if(_0x4b941b>0x0){_0x46c5cc+=_0x84c21f;_0x52e3fd['push'](dbH[_0x2aab('0x2d')][_0x2aab('0x31')](util['format'](_0x2aab('0x2e'),QUERY,_0x4b941b,_0x46c5cc),{'type':dbH[_0x2aab('0x2d')][_0x2aab('0x2f')][_0x2aab('0x30')]}));}}}else{_0x52e3fd['push'](dbH['sequelize'][_0x2aab('0x31')](QUERY,{'type':dbH[_0x2aab('0x2d')]['QueryTypes'][_0x2aab('0x30')]}));}var _0x485ca4=path[_0x2aab('0x32')](PATH);var _0x5cca6a=path[_0x2aab('0x33')](PATH,_0x2aab('0x34'));var _0x13303b=_0x1418fc[_0x2aab('0x29')]&&_0x52e3fd[_0x2aab('0x13')]>0x1;var _0x3e982d=[];if(!fs[_0x2aab('0x35')](path[_0x2aab('0x36')](_0x485ca4,_0x5cca6a))&&_0x13303b){fs[_0x2aab('0x37')](path[_0x2aab('0x36')](_0x485ca4,_0x5cca6a));}return BPromise[_0x2aab('0x38')](_0x52e3fd,function(_0x1e29c2){_0x3e982d[_0x2aab('0x16')](_0x1e29c2);})[_0x2aab('0x2b')](function(){var _0x3d390b=[];for(var _0x2b4b0d=0x0;_0x2b4b0d<_0x3e982d['length'];_0x2b4b0d+=0x1){var _0x169351=_0x3e982d[_0x2b4b0d];var _0x1ee755=createTables(_['flatten'](_0x169351));var _0x430e4a;var _0x43a37c=getPDFDocDefinition(_0x1ee755);var _0x4a37e3=getPDFPrinter();var _0x499521=_0x4a37e3[_0x2aab('0x39')](_0x43a37c);if(_0x13303b){_0x430e4a=path[_0x2aab('0x36')](_0x485ca4,_0x5cca6a,util[_0x2aab('0x19')]('%s%d.%s',_0x5cca6a,_0x2b4b0d,_0x2aab('0x3a')));}else{_0x430e4a=path['join'](_0x485ca4,util[_0x2aab('0x19')](_0x2aab('0x3b'),_0x5cca6a,'pdf'));}_0x3d390b[_0x2aab('0x16')](writePDFDocument(_0x499521,_0x430e4a));}return Promise[_0x2aab('0x3c')](_0x3d390b);})['then'](function(){if(_0x13303b){return new Promise(function(_0x5a12f6){zipdir(path[_0x2aab('0x36')](_0x485ca4,_0x5cca6a),{'saveTo':path[_0x2aab('0x36')](_0x485ca4,util[_0x2aab('0x19')](_0x2aab('0x3b'),_0x5cca6a,'zip'))},function(){rimraf(path['join'](_0x485ca4,_0x5cca6a),function(){});_0x5a12f6('zip\x20finished');});});}})['then'](function(){if(!_0x13303b)return;rimraf(path['join'](_0x485ca4,_0x5cca6a),function(){});})[_0x2aab('0x2b')](function(){logger['info'](util[_0x2aab('0x19')](_0x2aab('0x3d'),EXTRACTED_REPORT_ID,_0x2aab('0x3e')));return analyticExtractedReport(_0x2aab('0x3f'),_0x13303b?util[_0x2aab('0x19')](_0x2aab('0x3b'),_0x5cca6a,_0x13303b?_0x2aab('0x40'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x2aab('0x41')](util[_0x2aab('0x19')](_0x2aab('0x42'),EXTRACTED_REPORT_ID,_0x2aab('0x3e')));return db[_0x2aab('0xf')][_0x2aab('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x2aab('0x2b')](function(_0x4ba9){EXTRACTED_REPORT=_0x4ba9;return dbH[_0x2aab('0x2d')][_0x2aab('0x31')](util['format'](_0x2aab('0x44'),QUERY),{'type':dbH[_0x2aab('0x2d')]['QueryTypes'][_0x2aab('0x30')]});})['then'](extractReport)[_0x2aab('0x45')](function(_0x24542c){logger['info'](util[_0x2aab('0x19')](_0x2aab('0x46'),EXTRACTED_REPORT_ID,_0x2aab('0x3e')),util[_0x2aab('0x47')](_0x24542c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2aab('0x48'));})[_0x2aab('0x49')](function(){process[_0x2aab('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x65c1ff=new PdfPrinter({'Arial':{'normal':__dirname+_0x2aab('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x2aab('0x4c'),'bolditalics':__dirname+_0x2aab('0x4d')}});return _0x65c1ff;}function getPDFDocDefinitionFromHTML(_0xc81546,_0x1fe88e){var _0x3ab0b1=util[_0x2aab('0x19')]('%s\x20#%d',_0x1fe88e[_0x2aab('0x4e')],_0x1fe88e[_0x2aab('0x4f')]);var _0x2796bf=moment()[_0x2aab('0x19')](_0x2aab('0x50'))[_0x2aab('0x11')]();var _0x40194e=htmlToPdfmake(_0xc81546,{'window':window,'tableAutoSize':!![]});return{'content':[_0x40194e],'defaultStyle':{'font':_0x2aab('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x2aab('0x51'),'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':_0x2aab('0x51')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x2aab('0x1d')}];},'footer':function(_0xfb95d5,_0x5ad3b7){return[{'text':util[_0x2aab('0x19')](_0x2aab('0x52'),_0x3ab0b1,_0xfb95d5,_0x5ad3b7,_0x2796bf),'style':_0x2aab('0x22')}];}};}function writePDFDocument(_0x498f0a,_0x3cde3b){return new Promise(function(_0x1e72cb,_0x61ed6c){var _0x18ab8c=_0x498f0a[_0x2aab('0x53')](fs[_0x2aab('0x54')](_0x3cde3b));_0x18ab8c['on'](_0x2aab('0x55'),function(){_0x1e72cb('finish');});_0x18ab8c['on'](_0x2aab('0x56'),function(_0x3a07fe){_0x61ed6c(_0x3a07fe);});_0x498f0a[_0x2aab('0x57')]();});}exports['createPdfFromHTML']=function(_0x4053b9,_0x5d0278){var _0x3952b5=getPDFPrinter();var _0xad151=getPDFDocDefinitionFromHTML(_0x4053b9,_0x5d0278);var _0x5f1d51=_0x3952b5[_0x2aab('0x39')](_0xad151);return writePDFDocument(_0x5f1d51,_0x5d0278['path'])['catch'](function(_0x4e7e49){throw _0x4e7e49;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index f9ce724..ae81e6b 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 _0x4c50=['split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','length','num','forEach','push','SELECT','dirname','basename','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find'];(function(_0x5c0297,_0x1e72be){var _0x4134c2=function(_0x1ff3c7){while(--_0x1ff3c7){_0x5c0297['push'](_0x5c0297['shift']());}};_0x4134c2(++_0x1e72be);}(_0x4c50,0x10f));var _0x04c5=function(_0x19756e,_0x3f9863){_0x19756e=_0x19756e-0x0;var _0x478b36=_0x4c50[_0x19756e];return _0x478b36;};'use strict';var util=require(_0x04c5('0x0'));var path=require(_0x04c5('0x1'));var _=require(_0x04c5('0x2'));var fs=require('fs');var json2xls=require(_0x04c5('0x3'));var BPromise=require(_0x04c5('0x4'));var zipdir=require(_0x04c5('0x5'));var rimraf=require(_0x04c5('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x04c5('0x7')];var logger=require(_0x04c5('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x04c5('0x9')][0x2]);var QUERY=process[_0x04c5('0x9')][0x3];var PATH=process[_0x04c5('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x34961a,_0x1fb2db){var _0x40a846={'status':_0x34961a};var _0x411e7f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1fb2db){_0x40a846[_0x04c5('0xa')]=_0x1fb2db;}return db['AnalyticExtractedReport']['update'](_0x40a846,_0x411e7f);}function main(){var _0x50d0ac=0x1388;var _0x24fc3d;logger[_0x04c5('0xb')](util[_0x04c5('0xc')](_0x04c5('0xd'),EXTRACTED_REPORT_ID,_0x04c5('0xe')));return db[_0x04c5('0xf')][_0x04c5('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x04c5('0x11'),_0x04c5('0x12')]})['then'](function(_0x49f740){if(_0x49f740){_0x24fc3d=_0x49f740;_0x50d0ac=_0x24fc3d[_0x04c5('0x12')]||0x1388;}})[_0x04c5('0x13')](function(){return dbH['sequelize'][_0x04c5('0x14')](util[_0x04c5('0xc')](_0x04c5('0x15'),QUERY),{'type':dbH[_0x04c5('0x16')][_0x04c5('0x17')]['SELECT']});})['then'](function(_0x4ed291){if(!_0x4ed291[0x0]['num']){return analyticExtractedReport('Empty');}var _0x35b3c2=[];var _0x52b825=0x0;if(_0x24fc3d['split']){if(_0x4ed291&&_0x4ed291[_0x04c5('0x18')]){var _0x5e50eb=_['range'](_0x4ed291[0x0][_0x04c5('0x19')]/_0x50d0ac);var _0x3fa42d=Number['isInteger'](_0x4ed291[0x0][_0x04c5('0x19')]/_0x50d0ac)?_0x4ed291[0x0]['num']%_0x50d0ac:0x0;_0x5e50eb[_0x04c5('0x1a')](function(_0xb64086){if(_0xb64086>0x0){_0x52b825+=_0x50d0ac;}_0x35b3c2[_0x04c5('0x1b')](dbH['sequelize'][_0x04c5('0x14')](util[_0x04c5('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x50d0ac,_0x52b825),{'type':dbH[_0x04c5('0x16')][_0x04c5('0x17')][_0x04c5('0x1c')]}));});if(_0x3fa42d>0x0){_0x52b825+=_0x50d0ac;_0x35b3c2[_0x04c5('0x1b')](dbH[_0x04c5('0x16')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3fa42d,_0x52b825),{'type':dbH[_0x04c5('0x16')][_0x04c5('0x17')][_0x04c5('0x1c')]}));}}}else{_0x35b3c2['push'](dbH[_0x04c5('0x16')]['query'](QUERY,{'type':dbH[_0x04c5('0x16')]['QueryTypes'][_0x04c5('0x1c')]}));}var _0x30ead=path[_0x04c5('0x1d')](PATH);var _0x51283f=path[_0x04c5('0x1e')](PATH,'.xlsx');var _0x4892bb=_0x24fc3d[_0x04c5('0x11')]&&_0x35b3c2[_0x04c5('0x18')]>0x1;var _0x15f0f8=[];if(!fs[_0x04c5('0x1f')](path['join'](_0x30ead,_0x51283f))&&_0x4892bb){fs[_0x04c5('0x20')](path[_0x04c5('0x21')](_0x30ead,_0x51283f));}return BPromise[_0x04c5('0x22')](_0x35b3c2,function(_0x15d01a){_0x15f0f8[_0x04c5('0x1b')](_0x15d01a);})[_0x04c5('0x13')](function(){for(var _0x23dd2=0x0;_0x23dd2<_0x15f0f8[_0x04c5('0x18')];_0x23dd2+=0x1){var _0x2ddb02;var _0x14a36=_0x15f0f8[_0x23dd2];if(_0x4892bb){_0x2ddb02=path['join'](_0x30ead,_0x51283f,util[_0x04c5('0xc')](_0x04c5('0x23'),_0x51283f,_0x23dd2,_0x04c5('0x24')));}else{_0x2ddb02=path[_0x04c5('0x21')](_0x30ead,util['format'](_0x04c5('0x25'),_0x51283f,'xlsx'));}fs[_0x04c5('0x26')](_0x2ddb02,json2xls(_0x14a36),_0x04c5('0x27'));}})[_0x04c5('0x13')](function(){if(_0x4892bb){return new Promise(function(_0x2ae771){zipdir(path[_0x04c5('0x21')](_0x30ead,_0x51283f),{'saveTo':path[_0x04c5('0x21')](_0x30ead,util[_0x04c5('0xc')]('%s.%s',_0x51283f,_0x04c5('0x28')))},function(_0x241e7b,_0x1f9fc2){rimraf(path['join'](_0x30ead,_0x51283f),function(){});_0x2ae771(_0x04c5('0x29'));});});}})[_0x04c5('0x13')](function(){logger[_0x04c5('0xb')](util[_0x04c5('0xc')](_0x04c5('0x2a'),EXTRACTED_REPORT_ID,_0x04c5('0xe')));return analyticExtractedReport(_0x04c5('0x2b'),_0x4892bb?util['format']('%s.%s',_0x51283f,_0x4892bb?'zip':_0x04c5('0x24')):null);});})[_0x04c5('0x2c')](function(_0x63259){logger[_0x04c5('0xb')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x04c5('0xe')),util[_0x04c5('0x2d')](_0x63259,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x04c5('0x2e'));})['finally'](function(){process[_0x04c5('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc6d3=['../../mysqldb','dbH','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','zip','zip\x20finished','XLSX','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf'];(function(_0xfacb1b,_0x3d62df){var _0x33bb6a=function(_0x1f2a90){while(--_0x1f2a90){_0xfacb1b['push'](_0xfacb1b['shift']());}};_0x33bb6a(++_0x3d62df);}(_0xc6d3,0x1e4));var _0x3c6d=function(_0x1f5e6,_0xde4ad1){_0x1f5e6=_0x1f5e6-0x0;var _0x2bb2ea=_0xc6d3[_0x1f5e6];return _0x2bb2ea;};'use strict';var util=require(_0x3c6d('0x0'));var path=require(_0x3c6d('0x1'));var _=require(_0x3c6d('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x3c6d('0x3'));var zipdir=require(_0x3c6d('0x4'));var rimraf=require(_0x3c6d('0x5'));var db=require(_0x3c6d('0x6'))['db'];var dbH=require('../../mysqldb')[_0x3c6d('0x7')];var logger=require(_0x3c6d('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3c6d('0x9')][0x2]);var QUERY=process[_0x3c6d('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x210230,_0x52f319){var _0x4a369a={'status':_0x210230};var _0x3dc90a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x52f319){_0x4a369a[_0x3c6d('0xa')]=_0x52f319;}return db['AnalyticExtractedReport'][_0x3c6d('0xb')](_0x4a369a,_0x3dc90a);}function main(){var _0xceecba=0x1388;var _0x5f5cc2;logger[_0x3c6d('0xc')](util[_0x3c6d('0xd')](_0x3c6d('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3c6d('0xf'),_0x3c6d('0x10')]})[_0x3c6d('0x11')](function(_0x52cf2f){if(_0x52cf2f){_0x5f5cc2=_0x52cf2f;_0xceecba=_0x5f5cc2[_0x3c6d('0x10')]||0x1388;}})[_0x3c6d('0x11')](function(){return dbH['sequelize'][_0x3c6d('0x12')](util[_0x3c6d('0xd')](_0x3c6d('0x13'),QUERY),{'type':dbH[_0x3c6d('0x14')]['QueryTypes'][_0x3c6d('0x15')]});})[_0x3c6d('0x11')](function(_0x3de7b2){if(!_0x3de7b2[0x0][_0x3c6d('0x16')]){return analyticExtractedReport(_0x3c6d('0x17'));}var _0x539a64=[];var _0x472577=0x0;if(_0x5f5cc2[_0x3c6d('0xf')]){if(_0x3de7b2&&_0x3de7b2[_0x3c6d('0x18')]){var _0x49caa8=_['range'](_0x3de7b2[0x0][_0x3c6d('0x16')]/_0xceecba);var _0x585277=Number[_0x3c6d('0x19')](_0x3de7b2[0x0][_0x3c6d('0x16')]/_0xceecba)?_0x3de7b2[0x0][_0x3c6d('0x16')]%_0xceecba:0x0;_0x49caa8[_0x3c6d('0x1a')](function(_0x1d57a9){if(_0x1d57a9>0x0){_0x472577+=_0xceecba;}_0x539a64[_0x3c6d('0x1b')](dbH[_0x3c6d('0x14')][_0x3c6d('0x12')](util['format'](_0x3c6d('0x1c'),QUERY,_0xceecba,_0x472577),{'type':dbH[_0x3c6d('0x14')][_0x3c6d('0x1d')][_0x3c6d('0x15')]}));});if(_0x585277>0x0){_0x472577+=_0xceecba;_0x539a64['push'](dbH[_0x3c6d('0x14')][_0x3c6d('0x12')](util[_0x3c6d('0xd')](_0x3c6d('0x1c'),QUERY,_0x585277,_0x472577),{'type':dbH[_0x3c6d('0x14')][_0x3c6d('0x1d')]['SELECT']}));}}}else{_0x539a64[_0x3c6d('0x1b')](dbH[_0x3c6d('0x14')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x3c6d('0x15')]}));}var _0x378947=path[_0x3c6d('0x1e')](PATH);var _0x56b699=path[_0x3c6d('0x1f')](PATH,_0x3c6d('0x20'));var _0x55963a=_0x5f5cc2[_0x3c6d('0xf')]&&_0x539a64[_0x3c6d('0x18')]>0x1;var _0x3f2669=[];if(!fs[_0x3c6d('0x21')](path[_0x3c6d('0x22')](_0x378947,_0x56b699))&&_0x55963a){fs[_0x3c6d('0x23')](path[_0x3c6d('0x22')](_0x378947,_0x56b699));}return BPromise[_0x3c6d('0x24')](_0x539a64,function(_0x3fe1c4){_0x3f2669[_0x3c6d('0x1b')](_0x3fe1c4);})[_0x3c6d('0x11')](function(){for(var _0x135261=0x0;_0x135261<_0x3f2669[_0x3c6d('0x18')];_0x135261+=0x1){var _0x4ec035;var _0x4a4e9c=_0x3f2669[_0x135261];if(_0x55963a){_0x4ec035=path[_0x3c6d('0x22')](_0x378947,_0x56b699,util[_0x3c6d('0xd')](_0x3c6d('0x25'),_0x56b699,_0x135261,_0x3c6d('0x26')));}else{_0x4ec035=path[_0x3c6d('0x22')](_0x378947,util[_0x3c6d('0xd')]('%s.%s',_0x56b699,_0x3c6d('0x26')));}fs[_0x3c6d('0x27')](_0x4ec035,json2xls(_0x4a4e9c),'binary');}})[_0x3c6d('0x11')](function(){if(_0x55963a){return new Promise(function(_0x1a904b){zipdir(path[_0x3c6d('0x22')](_0x378947,_0x56b699),{'saveTo':path['join'](_0x378947,util[_0x3c6d('0xd')]('%s.%s',_0x56b699,_0x3c6d('0x28')))},function(_0x39dc40,_0x1aff3b){rimraf(path[_0x3c6d('0x22')](_0x378947,_0x56b699),function(){});_0x1a904b(_0x3c6d('0x29'));});});}})[_0x3c6d('0x11')](function(){logger[_0x3c6d('0xc')](util[_0x3c6d('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3c6d('0x2a')));return analyticExtractedReport('Completed',_0x55963a?util['format'](_0x3c6d('0x2b'),_0x56b699,_0x55963a?'zip':_0x3c6d('0x26')):null);});})[_0x3c6d('0x2c')](function(_0x22f7be){logger[_0x3c6d('0xc')](util['format'](_0x3c6d('0x2d'),EXTRACTED_REPORT_ID,_0x3c6d('0x2a')),util['inspect'](_0x22f7be,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3c6d('0x2e'));})[_0x3c6d('0x2f')](function(){process[_0x3c6d('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8e86482..d1d5840 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 _0xd007=['*,*,*,*','intervals','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','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','lodash','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','filter','hasOwnProperty','priority','extensions','extension','find','type','Set','format','CDR(type)=%s','context','push','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','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=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt'];(function(_0x107129,_0x4f301c){var _0x53b940=function(_0x1cd058){while(--_0x1cd058){_0x107129['push'](_0x107129['shift']());}};_0x53b940(++_0x4f301c);}(_0xd007,0x131));var _0x7d00=function(_0x271152,_0x45570b){_0x271152=_0x271152-0x0;var _0x44dd12=_0xd007[_0x271152];return _0x44dd12;};'use strict';var _=require(_0x7d00('0x0'));var util=require('util');function rewrite(_0x4127ee,_0x104b5a){var _0x329347=this;return _0x4127ee[_0x7d00('0x1')][_0x7d00('0x2')][_0x7d00('0x3')]({'raw':!![]})[_0x7d00('0x4')](function(_0x328b68){_0x329347['intervals']=_0x328b68;return _0x4127ee[_0x7d00('0x1')][_0x7d00('0x5')][_0x7d00('0x3')]({'where':{'IntervalId':_0x104b5a[_0x7d00('0x6')]},'raw':!![]});})['then'](function(_0x242044){return _0x4127ee[_0x7d00('0x1')][_0x7d00('0x5')]['findAll']({'where':{'exten':{'$in':_[_0x7d00('0x7')](_[_0x7d00('0x8')](_0x242044,_0x7d00('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7d00('0x4')](function(_0x1890ce){var _0x40c8b2=_[_0x7d00('0xa')](_0x1890ce,{'priority':'1'});var _0x1a0b4c=_[_0x7d00('0xa')](_0x1890ce,{'isApp':0x1});var _0x1e8e49=_['groupBy'](_0x1a0b4c,_0x7d00('0x9'));var _0xa3228=['queue','playback'];var _0x355c64=[];var _0x162fa9=[];for(var _0x2d0ec1 in _0x1e8e49){if(_0x1e8e49[_0x7d00('0xb')](_0x2d0ec1)){_0x329347[_0x7d00('0xc')]=0x2;_0x329347[_0x7d00('0xd')]=[];_0x329347[_0x7d00('0xe')]=_[_0x7d00('0xf')](_0x40c8b2,{'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')]});_0x329347[_0x7d00('0xd')]['push']({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':util[_0x7d00('0x12')](_0x7d00('0x13'),_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')]),'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0]['VoiceExtensionId']});if(_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')]==='inbound'){_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x16')+_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')],'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0]['exten'],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0]['VoiceExtensionId']});}else if(_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')]===_0x7d00('0x18')){if(_0x329347[_0x7d00('0xe')]){_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0]['type'],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x19')+(_0x329347[_0x7d00('0xe')][_0x7d00('0x1a')]?_0x7d00('0x1b')+_0x329347[_0x7d00('0xe')][_0x7d00('0x1a')]+'}':_0x7d00('0x1c')),'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347['priority']++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0]['VoiceExtensionId']});}_0x329347[_0x7d00('0xd')]['push']({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':'Set','appdata':'CDR(routeid)='+_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')],'context':_0x1e8e49[_0x2d0ec1][0x0]['context'],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});var _0x5649ce=_0x329347['priority']++;_0x329347[_0x7d00('0xd')]['push']({'type':_0x1e8e49[_0x2d0ec1][0x0]['type'],'app':_0x7d00('0x1d'),'appdata':_0x7d00('0x1e')+(_0x5649ce+0x2)+_0x7d00('0x1f')+(_0x5649ce+0x1)+')','context':_0x1e8e49[_0x2d0ec1][0x0]['context'],'exten':_0x1e8e49[_0x2d0ec1][0x0]['exten'],'priority':_0x5649ce,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});if(_0x329347[_0x7d00('0xe')]){_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':_0x329347[_0x7d00('0xe')][_0x7d00('0x1a')]?_0x7d00('0x20')+_0x329347[_0x7d00('0xe')]['cutdigits']+'}':_0x7d00('0x21'),'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0]['VoiceExtensionId']});}_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0]['type'],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x22')+_0x1e8e49[_0x2d0ec1][0x0]['VoiceExtensionId'],'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});if(_0x329347[_0x7d00('0xe')]&&_0x329347[_0x7d00('0xe')][_0x7d00('0xb')](_0x7d00('0x23'))&&_0x329347[_0x7d00('0xe')][_0x7d00('0x23')]!==_0x7d00('0x24')){_0x329347['extensions'][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x25'),'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347['priority']++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});_0x329347['extensions']['push']({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x26')+_0x329347[_0x7d00('0xe')]['recordingFormat']||_0x7d00('0x27'),'context':_0x1e8e49[_0x2d0ec1][0x0]['context'],'exten':_0x1e8e49[_0x2d0ec1][0x0]['exten'],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0]['VoiceExtensionId']});}}_0x329347['extensions']['push']({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1e8e49[_0x2d0ec1][0x0]['context'],'exten':_0x1e8e49[_0x2d0ec1][0x0]['exten'],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x28'),'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0]['type'],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x29'),'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'priority':_0x329347[_0x7d00('0xc')]++,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});for(var _0x2a3323=0x0,_0x3d5d27=0x0;_0x2a3323<_0x1e8e49[_0x2d0ec1][_0x7d00('0x2a')];_0x2a3323+=0x1,_0x3d5d27=0x0){var _0x93922f=_0x1e8e49[_0x2d0ec1][_0x2a3323];if(_0x93922f[_0x7d00('0x10')]){_0x93922f[_0x7d00('0x10')]=_0x93922f['type'][_0x7d00('0x2b')]();}var _0x19e601=[];var _0x150a5d=[];delete _0x93922f['id'];delete _0x93922f[_0x7d00('0x2c')];delete _0x93922f['updatedAt'];var _0x402854=_0x93922f['interval']!==_0x7d00('0x2d')?[_0x93922f['interval']]:_0x93922f[_0x7d00('0x6')]?_['map'](_[_0x7d00('0xa')](_0x329347[_0x7d00('0x2e')],{'IntervalId':_0x93922f[_0x7d00('0x6')]}),_0x7d00('0x2f')):[];if(_0x93922f[_0x7d00('0xb')](_0x7d00('0x30'))){if(_0x93922f[_0x7d00('0x30')]&&_0x93922f[_0x7d00('0x30')]!=='--'){_0x19e601['push']({'type':_0x93922f[_0x7d00('0x10')],'app':'Set','appdata':_0x7d00('0x31')+_0x93922f[_0x7d00('0x30')],'context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f['exten'],'priority':_0x402854['length']+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f['VoiceExtensionId']});}}if(_0x93922f[_0x7d00('0x10')]===_0x7d00('0x18')&&_0x93922f[_0x7d00('0xb')](_0x7d00('0x32'))){if(_0x93922f['callerID']){_0x19e601['push']({'type':_0x93922f['type'],'app':_0x7d00('0x1d'),'appdata':_0x7d00('0x33')+_0x93922f[_0x7d00('0x32')]+')','context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f[_0x7d00('0x9')],'priority':_0x402854[_0x7d00('0x2a')]+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f[_0x7d00('0x17')]});}else{_0x19e601[_0x7d00('0x15')]({'type':_0x93922f[_0x7d00('0x10')],'app':_0x7d00('0x1d'),'appdata':_0x7d00('0x34'),'context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f[_0x7d00('0x9')],'priority':_0x402854[_0x7d00('0x2a')]+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f['VoiceExtensionId']});}}if(_0x93922f['hasOwnProperty'](_0x7d00('0x35'))){if(_0xa3228[_0x7d00('0x36')](_0x93922f[_0x7d00('0x37')][_0x7d00('0x2b')]())>=0x0&&_0x93922f[_0x7d00('0x38')]!==_0x7d00('0x39')){if(_0x93922f[_0x7d00('0x35')]){_0x19e601[_0x7d00('0x15')]({'type':_0x93922f[_0x7d00('0x10')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f[_0x7d00('0x9')],'priority':_0x402854[_0x7d00('0x2a')]+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f[_0x7d00('0x17')]});_0x19e601[_0x7d00('0x15')]({'type':_0x93922f[_0x7d00('0x10')],'app':'Set','appdata':_0x7d00('0x3a'),'context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f[_0x7d00('0x9')],'priority':_0x402854[_0x7d00('0x2a')]+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f[_0x7d00('0x17')]});}else{_0x19e601[_0x7d00('0x15')]({'type':_0x93922f[_0x7d00('0x10')],'app':_0x7d00('0x1d'),'appdata':_0x7d00('0x3b'),'context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f[_0x7d00('0x9')],'priority':_0x402854[_0x7d00('0x2a')]+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f[_0x7d00('0x17')]});_0x19e601['push']({'type':_0x93922f['type'],'app':_0x7d00('0x11'),'appdata':_0x7d00('0x3c'),'context':_0x93922f[_0x7d00('0x14')],'exten':_0x93922f['exten'],'priority':_0x402854[_0x7d00('0x2a')]+_0x329347[_0x7d00('0xc')]+_0x3d5d27++,'VoiceExtensionId':_0x93922f[_0x7d00('0x17')]});}}}for(var _0x5038bf=0x0;_0x5038bf<_0x402854['length'];_0x5038bf+=0x1){var _0x257b76=_0x329347[_0x7d00('0xc')]+_0x402854[_0x7d00('0x2a')];var _0x4b16d1=_0x5038bf===_0x402854[_0x7d00('0x2a')]-0x1?_0x329347['priority']+_0x19e601['length']+_0x150a5d[_0x7d00('0x2a')]+0x2:_0x329347[_0x7d00('0xc')]+_0x5038bf+0x1;_0x19e601['splice'](_0x5038bf,0x0,{'type':_0x93922f[_0x7d00('0x10')],'app':'GotoIfTime','appdata':_0x402854[_0x5038bf]+'?'+_0x93922f[_0x7d00('0x14')]+_0x7d00('0x3d')+_0x257b76+':'+_0x93922f['context']+_0x7d00('0x3d')+_0x4b16d1,'exten':_0x93922f[_0x7d00('0x9')],'context':_0x93922f[_0x7d00('0x14')],'priority':_0x329347[_0x7d00('0xc')]+_0x5038bf,'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});}_0x93922f[_0x7d00('0xc')]=_0x19e601[_0x7d00('0x2a')]?_[_0x7d00('0x3e')](_0x19e601)[_0x7d00('0xc')]+0x1:_0x329347[_0x7d00('0xc')];_0x329347[_0x7d00('0xc')]=(_0x150a5d[_0x7d00('0x2a')]?_[_0x7d00('0x3e')](_0x150a5d)[_0x7d00('0xc')]:_0x93922f[_0x7d00('0xc')])+0x1;_0x329347[_0x7d00('0xd')]=_[_0x7d00('0x3f')](_0x329347[_0x7d00('0xd')],_0x19e601,[_0x93922f],_0x150a5d);}_0x329347[_0x7d00('0xd')][_0x7d00('0x15')]({'type':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x10')],'app':_0x7d00('0x40'),'exten':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x9')],'context':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x14')],'priority':_0x329347[_0x7d00('0xc')],'VoiceExtensionId':_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]});_0x355c64[_0x7d00('0x15')](_0x1e8e49[_0x2d0ec1][0x0][_0x7d00('0x17')]);_0x162fa9=_[_0x7d00('0x3f')](_0x162fa9,_0x329347[_0x7d00('0xd')]);}}return _0x4127ee[_0x7d00('0x41')](function(_0x1edd0a){return _0x4127ee[_0x7d00('0x1')]['VoiceExtension'][_0x7d00('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x355c64}},'transaction':_0x1edd0a})['then'](function(_0x4fa015){return _0x4127ee['models']['VoiceExtension'][_0x7d00('0x43')](_['sortBy'](_0x162fa9,_0x7d00('0xc')),{'transaction':_0x1edd0a});});});})[_0x7d00('0x44')](function(_0x2dd9d8){console[_0x7d00('0x45')](_0x2dd9d8);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x6155=['util','models','Interval','then','intervals','VoiceExtension','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','Set','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','*,*,*,*','interval','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','answer','indexOf','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','error','lodash'];(function(_0x520da4,_0x172077){var _0x25445f=function(_0x1a7fea){while(--_0x1a7fea){_0x520da4['push'](_0x520da4['shift']());}};_0x25445f(++_0x172077);}(_0x6155,0x1bf));var _0x5615=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x6155[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x5615('0x0'));var util=require(_0x5615('0x1'));function rewrite(_0x40456d,_0x1b7a04){var _0x239baf=this;return _0x40456d[_0x5615('0x2')][_0x5615('0x3')]['findAll']({'raw':!![]})[_0x5615('0x4')](function(_0x30c1ca){_0x239baf[_0x5615('0x5')]=_0x30c1ca;return _0x40456d[_0x5615('0x2')][_0x5615('0x6')][_0x5615('0x7')]({'where':{'IntervalId':_0x1b7a04['IntervalId']},'raw':!![]});})[_0x5615('0x4')](function(_0x1925cb){return _0x40456d['models'][_0x5615('0x6')][_0x5615('0x7')]({'where':{'exten':{'$in':_[_0x5615('0x8')](_[_0x5615('0x9')](_0x1925cb,_0x5615('0xa')))}},'order':[{'raw':_0x5615('0xb')}],'raw':!![]});})[_0x5615('0x4')](function(_0x1247bb){var _0x5a129a=_[_0x5615('0xc')](_0x1247bb,{'priority':'1'});var _0x3f4f69=_[_0x5615('0xc')](_0x1247bb,{'isApp':0x1});var _0x309bf0=_[_0x5615('0xd')](_0x3f4f69,_0x5615('0xa'));var _0x147105=[_0x5615('0xe'),_0x5615('0xf')];var _0x460035=[];var _0x5c2881=[];for(var _0x44cd7e in _0x309bf0){if(_0x309bf0[_0x5615('0x10')](_0x44cd7e)){_0x239baf[_0x5615('0x11')]=0x2;_0x239baf['extensions']=[];_0x239baf[_0x5615('0x12')]=_[_0x5615('0x13')](_0x5a129a,{'exten':_0x309bf0[_0x44cd7e][0x0]['exten']});_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0]['type'],'app':_0x5615('0x16'),'appdata':util['format'](_0x5615('0x17'),_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')]),'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0]['exten'],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});if(_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')]===_0x5615('0x1b')){_0x239baf['extensions'][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0]['type'],'app':_0x5615('0x16'),'appdata':_0x5615('0x1c')+_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')],'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0]['exten'],'priority':_0x239baf['priority']++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});}else if(_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')]===_0x5615('0x1d')){if(_0x239baf[_0x5615('0x12')]){_0x239baf['extensions'][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0]['type'],'app':_0x5615('0x16'),'appdata':'CDR(destination)='+(_0x239baf[_0x5615('0x12')]['cutdigits']?_0x5615('0x1e')+_0x239baf[_0x5615('0x12')][_0x5615('0x1f')]+'}':_0x5615('0x20')),'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0]['VoiceExtensionId']});}_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':'Set','appdata':_0x5615('0x1c')+_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')],'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0]['exten'],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});var _0xb33bee=_0x239baf['priority']++;_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0]['type'],'app':'ExecIf','appdata':_0x5615('0x21')+(_0xb33bee+0x2)+_0x5615('0x22')+(_0xb33bee+0x1)+')','context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0]['exten'],'priority':_0xb33bee,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});if(_0x239baf[_0x5615('0x12')]){_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':'Set','appdata':_0x239baf[_0x5615('0x12')][_0x5615('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x239baf['extension'][_0x5615('0x1f')]+'}':_0x5615('0x23'),'context':_0x309bf0[_0x44cd7e][0x0]['context'],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf['priority']++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});}_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':_0x5615('0x16'),'appdata':_0x5615('0x24')+_0x309bf0[_0x44cd7e][0x0]['VoiceExtensionId'],'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});if(_0x239baf['extension']&&_0x239baf[_0x5615('0x12')]['hasOwnProperty'](_0x5615('0x25'))&&_0x239baf[_0x5615('0x12')][_0x5615('0x25')]!=='none'){_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':'Set','appdata':_0x5615('0x26'),'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':'Set','appdata':_0x5615('0x27')+_0x239baf[_0x5615('0x12')][_0x5615('0x25')]||_0x5615('0x28'),'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf['priority']++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});}}_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0]['type'],'app':_0x5615('0x16'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x309bf0[_0x44cd7e][0x0]['context'],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf['priority']++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});_0x239baf[_0x5615('0x14')]['push']({'type':_0x309bf0[_0x44cd7e][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x309bf0[_0x44cd7e][0x0]['context'],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0]['VoiceExtensionId']});_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':'Set','appdata':_0x5615('0x29'),'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'priority':_0x239baf[_0x5615('0x11')]++,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});for(var _0x5ecae5=0x0,_0x39131e=0x0;_0x5ecae5<_0x309bf0[_0x44cd7e][_0x5615('0x2a')];_0x5ecae5+=0x1,_0x39131e=0x0){var _0x2c8dac=_0x309bf0[_0x44cd7e][_0x5ecae5];if(_0x2c8dac[_0x5615('0x18')]){_0x2c8dac[_0x5615('0x18')]=_0x2c8dac[_0x5615('0x18')][_0x5615('0x2b')]();}var _0x30d473=[];var _0x59aa63=[];delete _0x2c8dac['id'];delete _0x2c8dac['createdAt'];delete _0x2c8dac[_0x5615('0x2c')];var _0x8d1118=_0x2c8dac['interval']!==_0x5615('0x2d')?[_0x2c8dac[_0x5615('0x2e')]]:_0x2c8dac[_0x5615('0x2f')]?_['map'](_[_0x5615('0xc')](_0x239baf[_0x5615('0x5')],{'IntervalId':_0x2c8dac['IntervalId']}),_0x5615('0x2e')):[];if(_0x2c8dac[_0x5615('0x10')]('tag')){if(_0x2c8dac[_0x5615('0x30')]&&_0x2c8dac[_0x5615('0x30')]!=='--'){_0x30d473['push']({'type':_0x2c8dac[_0x5615('0x18')],'app':'Set','appdata':'CDR(tag)='+_0x2c8dac[_0x5615('0x30')],'context':_0x2c8dac['context'],'exten':_0x2c8dac[_0x5615('0xa')],'priority':_0x8d1118[_0x5615('0x2a')]+_0x239baf[_0x5615('0x11')]+_0x39131e++,'VoiceExtensionId':_0x2c8dac['VoiceExtensionId']});}}if(_0x2c8dac[_0x5615('0x18')]===_0x5615('0x1d')&&_0x2c8dac['hasOwnProperty'](_0x5615('0x31'))){if(_0x2c8dac[_0x5615('0x31')]){_0x30d473[_0x5615('0x15')]({'type':_0x2c8dac[_0x5615('0x18')],'app':'ExecIf','appdata':_0x5615('0x32')+_0x2c8dac[_0x5615('0x31')]+')','context':_0x2c8dac[_0x5615('0x19')],'exten':_0x2c8dac[_0x5615('0xa')],'priority':_0x8d1118[_0x5615('0x2a')]+_0x239baf[_0x5615('0x11')]+_0x39131e++,'VoiceExtensionId':_0x2c8dac['VoiceExtensionId']});}else{_0x30d473[_0x5615('0x15')]({'type':_0x2c8dac['type'],'app':_0x5615('0x33'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2c8dac[_0x5615('0x19')],'exten':_0x2c8dac[_0x5615('0xa')],'priority':_0x8d1118[_0x5615('0x2a')]+_0x239baf['priority']+_0x39131e++,'VoiceExtensionId':_0x2c8dac[_0x5615('0x1a')]});}}if(_0x2c8dac[_0x5615('0x10')](_0x5615('0x34'))){if(_0x147105[_0x5615('0x35')](_0x2c8dac['app'][_0x5615('0x2b')]())>=0x0&&_0x2c8dac['appType']!==_0x5615('0x36')){if(_0x2c8dac[_0x5615('0x34')]){_0x30d473[_0x5615('0x15')]({'type':_0x2c8dac[_0x5615('0x18')],'app':_0x5615('0x33'),'appdata':_0x5615('0x37'),'context':_0x2c8dac['context'],'exten':_0x2c8dac['exten'],'priority':_0x8d1118[_0x5615('0x2a')]+_0x239baf[_0x5615('0x11')]+_0x39131e++,'VoiceExtensionId':_0x2c8dac[_0x5615('0x1a')]});_0x30d473[_0x5615('0x15')]({'type':_0x2c8dac[_0x5615('0x18')],'app':'Set','appdata':_0x5615('0x38'),'context':_0x2c8dac[_0x5615('0x19')],'exten':_0x2c8dac['exten'],'priority':_0x8d1118[_0x5615('0x2a')]+_0x239baf['priority']+_0x39131e++,'VoiceExtensionId':_0x2c8dac[_0x5615('0x1a')]});}else{_0x30d473[_0x5615('0x15')]({'type':_0x2c8dac[_0x5615('0x18')],'app':_0x5615('0x33'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2c8dac[_0x5615('0x19')],'exten':_0x2c8dac['exten'],'priority':_0x8d1118[_0x5615('0x2a')]+_0x239baf[_0x5615('0x11')]+_0x39131e++,'VoiceExtensionId':_0x2c8dac['VoiceExtensionId']});_0x30d473[_0x5615('0x15')]({'type':_0x2c8dac[_0x5615('0x18')],'app':_0x5615('0x16'),'appdata':_0x5615('0x39'),'context':_0x2c8dac['context'],'exten':_0x2c8dac[_0x5615('0xa')],'priority':_0x8d1118['length']+_0x239baf[_0x5615('0x11')]+_0x39131e++,'VoiceExtensionId':_0x2c8dac[_0x5615('0x1a')]});}}}for(var _0x569940=0x0;_0x569940<_0x8d1118[_0x5615('0x2a')];_0x569940+=0x1){var _0x21d809=_0x239baf[_0x5615('0x11')]+_0x8d1118[_0x5615('0x2a')];var _0x5e0fb5=_0x569940===_0x8d1118[_0x5615('0x2a')]-0x1?_0x239baf[_0x5615('0x11')]+_0x30d473[_0x5615('0x2a')]+_0x59aa63[_0x5615('0x2a')]+0x2:_0x239baf[_0x5615('0x11')]+_0x569940+0x1;_0x30d473[_0x5615('0x3a')](_0x569940,0x0,{'type':_0x2c8dac['type'],'app':'GotoIfTime','appdata':_0x8d1118[_0x569940]+'?'+_0x2c8dac[_0x5615('0x19')]+_0x5615('0x3b')+_0x21d809+':'+_0x2c8dac[_0x5615('0x19')]+_0x5615('0x3b')+_0x5e0fb5,'exten':_0x2c8dac[_0x5615('0xa')],'context':_0x2c8dac['context'],'priority':_0x239baf[_0x5615('0x11')]+_0x569940,'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});}_0x2c8dac[_0x5615('0x11')]=_0x30d473[_0x5615('0x2a')]?_[_0x5615('0x3c')](_0x30d473)[_0x5615('0x11')]+0x1:_0x239baf[_0x5615('0x11')];_0x239baf[_0x5615('0x11')]=(_0x59aa63[_0x5615('0x2a')]?_['last'](_0x59aa63)[_0x5615('0x11')]:_0x2c8dac[_0x5615('0x11')])+0x1;_0x239baf[_0x5615('0x14')]=_[_0x5615('0x3d')](_0x239baf[_0x5615('0x14')],_0x30d473,[_0x2c8dac],_0x59aa63);}_0x239baf[_0x5615('0x14')][_0x5615('0x15')]({'type':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x18')],'app':_0x5615('0x3e'),'exten':_0x309bf0[_0x44cd7e][0x0][_0x5615('0xa')],'context':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x19')],'priority':_0x239baf[_0x5615('0x11')],'VoiceExtensionId':_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]});_0x460035['push'](_0x309bf0[_0x44cd7e][0x0][_0x5615('0x1a')]);_0x5c2881=_['concat'](_0x5c2881,_0x239baf[_0x5615('0x14')]);}}return _0x40456d['transaction'](function(_0x17a4b9){return _0x40456d[_0x5615('0x2')][_0x5615('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x460035}},'transaction':_0x17a4b9})[_0x5615('0x4')](function(_0x3b994a){return _0x40456d['models'][_0x5615('0x6')]['bulkCreate'](_['sortBy'](_0x5c2881,'priority'),{'transaction':_0x17a4b9});});});})['catch'](function(_0x1f5a06){console[_0x5615('0x3f')](_0x1f5a06);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index eec9c6e..2a28a9b 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 _0x2d6a=['CmList','always','sequelize','query','VoiceQueueId','catch','all','BlackLists','Campaign','Lists','get','onlyIfOpen','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','create','keys','then','push','pick','stringify','cmContact','inspect','cm_hopper','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','insert','into','str','phone\x20NOT\x20IN\x20(?)','calleridnum','fromQuery','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType'];(function(_0x3177c2,_0x32d8b0){var _0x57815e=function(_0x19f422){while(--_0x19f422){_0x3177c2['push'](_0x3177c2['shift']());}};_0x57815e(++_0x32d8b0);}(_0x2d6a,0x161));var _0xa2d6=function(_0x438593,_0xa155ff){_0x438593=_0x438593-0x0;var _0x1eb230=_0x2d6a[_0x438593];return _0x1eb230;};'use strict';var BPromise=require(_0xa2d6('0x0'));var util=require(_0xa2d6('0x1'));var _=require(_0xa2d6('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xa2d6('0x3'));var Redis=require('ioredis');var db=require(_0xa2d6('0x4'))['db'];var config=require(_0xa2d6('0x5'));var logger=require(_0xa2d6('0x6'))(_0xa2d6('0x7'));config['redis']=_[_0xa2d6('0x8')](config[_0xa2d6('0x9')],{'host':_0xa2d6('0xa'),'port':0x18eb});var socket=require(_0xa2d6('0xb'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xa2d6('0xc')](socket);try{if(!process[_0xa2d6('0xd')][0x2]||process[_0xa2d6('0xd')][0x2]===_0xa2d6('0xe')||process[_0xa2d6('0xd')][0x2]===_0xa2d6('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xa2d6('0xd')][0x2];if(!process[_0xa2d6('0xd')][0x3]||process[_0xa2d6('0xd')][0x3]===_0xa2d6('0xe')||process[_0xa2d6('0xd')][0x3]===_0xa2d6('0xf')||!process[_0xa2d6('0xd')][0x4]||process[_0xa2d6('0xd')][0x4]===_0xa2d6('0xe')||process[_0xa2d6('0xd')][0x4]===_0xa2d6('0xf')){throw new Error(_0xa2d6('0x10'));}var FIELDS=_[_0xa2d6('0x11')](process['argv'][0x3][_0xa2d6('0x12')](','),process['argv'][0x4][_0xa2d6('0x12')](','));if(!process[_0xa2d6('0xd')][0x5]||process['argv'][0x5]===_0xa2d6('0xe')||process[_0xa2d6('0xd')][0x5]===_0xa2d6('0xf')){throw new Error(_0xa2d6('0x13'));}var LISTID=process[_0xa2d6('0xd')][0x5];var COMPANYID=process[_0xa2d6('0xd')][0x6]&&process[_0xa2d6('0xd')][0x6]!==_0xa2d6('0xe')&&process[_0xa2d6('0xd')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xa2d6('0xd')][0x7]&&process[_0xa2d6('0xd')][0x7]!==_0xa2d6('0xe')&&process[_0xa2d6('0xd')][0x7]!==_0xa2d6('0xf')?process[_0xa2d6('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0xa2d6('0xd')][0x8]===_0xa2d6('0xe')||process['argv'][0x8]==='null'){throw new Error(_0xa2d6('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x12f799){logger[_0xa2d6('0x15')](_0x12f799);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(_0xd075d1,_0x41746a,_0x3c5076,_0xd218ec){var _0x540a95={'message':_0x41746a};_0x540a95[_0xd075d1]=!![];if(_0x3c5076){_0x540a95[_0xa2d6('0x16')]=_0x3c5076;}if(_0xd218ec){_0x540a95[_0xa2d6('0x17')]=_0xd218ec;}return _0x540a95;}function isEmail(_0x853e20){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x853e20);}function checkRow(_0x43b1ad,_0x59fbc5,_0x4f969a){return new BPromise(function(_0x40aef2,_0x237c53){if(_['isNil'](_0x43b1ad)){return _0x237c53(handleCheckRowError(_0xa2d6('0x15'),_0xa2d6('0x18'),null,_0x4f969a));}if(_0x43b1ad['errors']&&_0x43b1ad[_0xa2d6('0x19')]['length']){var _0x1c232d=_[_0xa2d6('0x1a')](_0x43b1ad['errors'],_0xa2d6('0x1b'))['join'](';');return _0x237c53(handleCheckRowError(_0xa2d6('0x15'),_0x1c232d,null,_0x4f969a));}var _0x1790a2={};for(var _0x536cc4 in FIELDS){if(FIELDS[_0xa2d6('0x1c')](_0x536cc4)&&FIELDS[_0x536cc4]){_0x1790a2[_0x536cc4]=_0x43b1ad['data'][0x0][FIELDS[_0x536cc4]]||_0x43b1ad[_0xa2d6('0x1d')][0x0]['\ufeff'+FIELDS[_0x536cc4]];}}if(!_0x1790a2[_0xa2d6('0x1e')]){return _0x237c53(handleCheckRowError(_0xa2d6('0x15'),_0xa2d6('0x1f'),null,_0x4f969a));}if(!_0x1790a2['phone']){return _0x237c53(handleCheckRowError(_0xa2d6('0x15'),_0xa2d6('0x20'),null,_0x4f969a));}if(_0x1790a2[_0xa2d6('0x21')]){var _0x1409cf=moment(_0x1790a2[_0xa2d6('0x21')],'YYYY-MM-DD');if(!_0x1409cf['isValid']()){return _0x237c53(handleCheckRowError(_0xa2d6('0x15'),_0xa2d6('0x22'),null,_0x4f969a));}}if(_0x1790a2[_0xa2d6('0x23')]){if(!isEmail(_0x1790a2[_0xa2d6('0x23')])){return _0x237c53(handleCheckRowError('error',_0xa2d6('0x24'),null,_0x4f969a));}}_0x1790a2[_0xa2d6('0x25')]=LISTID;_0x1790a2[_0xa2d6('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x59fbc5){var _0xb6565e={};for(var _0x554068=0x0,_0x5701be=DUPLICATES[_0xa2d6('0x27')];_0x554068<_0x5701be;_0x554068+=0x1){_0xb6565e[DUPLICATES[_0x554068]]=_0x1790a2[DUPLICATES[_0x554068]];}var _0x3ca4b8=_[_0xa2d6('0x28')](_0x59fbc5,_0xb6565e);if(_0x3ca4b8){return _0x237c53(handleCheckRowError(_0xa2d6('0x29'),'Duplicate\x20Contact',_0x3ca4b8,_0x4f969a));}}return db[_0xa2d6('0x2a')][_0xa2d6('0x2b')](_0x1790a2,{'raw':!![],'hooks':![],'fields':_[_0xa2d6('0x2c')](_0x1790a2)})[_0xa2d6('0x2d')](function(_0x2ce4ca){if(DUPLICATES&&DUPLICATES[_0xa2d6('0x27')]&&_0x59fbc5){_0x59fbc5[_0xa2d6('0x2e')](_[_0xa2d6('0x2f')](_0x1790a2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2ce4ca['id'];return _0x40aef2();})['catch'](function(_0x23a95b){return _0x237c53(handleCheckRowError(_0xa2d6('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x23a95b['message']||JSON[_0xa2d6('0x30')](_0x23a95b)),null,_0x4f969a));});});}function checkHopper(){function _0x24940f(){return function(_0x3f196e){logger[_0xa2d6('0x15')](_0xa2d6('0x31'),'checkHopper',util[_0xa2d6('0x32')](_0x3f196e,{'showHidden':![],'depth':null}));};}var _0x222346=function(_0x1e70db,_0x59f9c0){var _0x4063aa=squel['insert']()['into'](_0xa2d6('0x33'))['fromQuery']([_0xa2d6('0x34'),_0xa2d6('0x35'),_0xa2d6('0x36'),_0xa2d6('0x25'),_0x59f9c0,_0xa2d6('0x37'),_0xa2d6('0x38')],squel[_0xa2d6('0x39')]()[_0xa2d6('0x3a')](_0xa2d6('0x34'),_0xa2d6('0x34'))[_0xa2d6('0x3a')]('NOW()',_0xa2d6('0x35'))[_0xa2d6('0x3a')]('id',_0xa2d6('0x36'))[_0xa2d6('0x3a')](LISTID[_0xa2d6('0x3b')](),_0xa2d6('0x25'))[_0xa2d6('0x3a')](_0x1e70db['id'][_0xa2d6('0x3b')](),_0x59f9c0)[_0xa2d6('0x3a')](_0xa2d6('0x3c'),'createdAt')[_0xa2d6('0x3a')](_0xa2d6('0x3c'),_0xa2d6('0x38'))[_0xa2d6('0x3d')](_0xa2d6('0x3e'))[_0xa2d6('0x3f')](_0xa2d6('0x40'))[_0xa2d6('0x3f')](_0xa2d6('0x41'),LISTID[_0xa2d6('0x3b')]())[_0xa2d6('0x3f')](_0xa2d6('0x42'))[_0xa2d6('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa2d6('0x39')]()[_0xa2d6('0x3a')](_0xa2d6('0x34'))['from'](_0xa2d6('0x33'))[_0xa2d6('0x3f')](_0x59f9c0+_0xa2d6('0x43'),_0x1e70db['id']['toString']())))[_0xa2d6('0x3b')]();return _0x4063aa;};var _0xeb26e9=function(_0x52f59c,_0x471470){var _0x2bc5b=squel[_0xa2d6('0x44')]()[_0xa2d6('0x45')](_0xa2d6('0x33'))['fromQuery'](['phone','scheduledAt',_0xa2d6('0x36'),'ListId',_0x471470,_0xa2d6('0x37'),_0xa2d6('0x38')],squel['select']()[_0xa2d6('0x3a')](_0xa2d6('0x34'),_0xa2d6('0x34'))[_0xa2d6('0x3a')](_0xa2d6('0x3c'),_0xa2d6('0x35'))[_0xa2d6('0x3a')]('id',_0xa2d6('0x36'))[_0xa2d6('0x3a')](LISTID[_0xa2d6('0x3b')](),'ListId')[_0xa2d6('0x3a')](_0x52f59c['id']['toString'](),_0x471470)[_0xa2d6('0x3a')](_0xa2d6('0x3c'),'createdAt')[_0xa2d6('0x3a')](_0xa2d6('0x3c'),_0xa2d6('0x38'))[_0xa2d6('0x3d')]('cm_contacts')[_0xa2d6('0x3f')](_0xa2d6('0x40'))[_0xa2d6('0x3f')](_0xa2d6('0x41'),LISTID[_0xa2d6('0x3b')]())['where']('id\x20IN\x20?',squel[_0xa2d6('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xa2d6('0x3f')](_0xa2d6('0x47'),squel[_0xa2d6('0x39')]()['field'](_0xa2d6('0x48'))['from']('cm_hopper_final')[_0xa2d6('0x3f')](_0x471470+_0xa2d6('0x43'),_0x52f59c['id'][_0xa2d6('0x3b')]()))[_0xa2d6('0x3f')](_0xa2d6('0x47'),squel['select']()['field'](_0xa2d6('0x34'))['from']('cm_hopper')[_0xa2d6('0x3f')](_0x471470+_0xa2d6('0x43'),_0x52f59c['id'][_0xa2d6('0x3b')]())))[_0xa2d6('0x3b')]();return _0x2bc5b;};function _0x3fde61(_0x5dfd3c,_0x12eabb){var _0x4356c5=squel['insert']()[_0xa2d6('0x45')]('cm_hopper')[_0xa2d6('0x49')]([_0xa2d6('0x34'),'scheduledAt',_0xa2d6('0x36'),_0xa2d6('0x25'),_0x12eabb,_0xa2d6('0x37'),_0xa2d6('0x38')],squel[_0xa2d6('0x39')]()['field']('phone','phone')['field']('NOW()',_0xa2d6('0x35'))[_0xa2d6('0x3a')]('id',_0xa2d6('0x36'))[_0xa2d6('0x3a')](LISTID[_0xa2d6('0x3b')](),_0xa2d6('0x25'))['field'](_0x5dfd3c['id'][_0xa2d6('0x3b')](),_0x12eabb)['field']('NOW()',_0xa2d6('0x37'))[_0xa2d6('0x3a')](_0xa2d6('0x3c'),_0xa2d6('0x38'))[_0xa2d6('0x3d')](_0xa2d6('0x3e'))['where'](_0xa2d6('0x40'))[_0xa2d6('0x3f')](_0xa2d6('0x41'),LISTID[_0xa2d6('0x3b')]())[_0xa2d6('0x3f')]('id\x20IN\x20?',squel[_0xa2d6('0x46')](hopperContacts))[_0xa2d6('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x4356c5;}function _0x2363b0(_0x2a56cc,_0x438af6){var _0x84baf8=squel['insert']()[_0xa2d6('0x45')](_0xa2d6('0x4a'))[_0xa2d6('0x49')](['phone',_0xa2d6('0x36'),_0xa2d6('0x25'),_0x438af6,'createdAt',_0xa2d6('0x38')],squel[_0xa2d6('0x39')]()[_0xa2d6('0x3a')](_0xa2d6('0x34'),'phone')[_0xa2d6('0x3a')]('id',_0xa2d6('0x36'))['field'](LISTID[_0xa2d6('0x3b')](),_0xa2d6('0x25'))[_0xa2d6('0x3a')](_0x2a56cc['id']['toString'](),_0x438af6)[_0xa2d6('0x3a')]('NOW()',_0xa2d6('0x37'))['field'](_0xa2d6('0x3c'),'updatedAt')[_0xa2d6('0x3d')](_0xa2d6('0x3e'))[_0xa2d6('0x3f')](_0xa2d6('0x40'))[_0xa2d6('0x3f')](_0xa2d6('0x41'),LISTID[_0xa2d6('0x3b')]())['where']('id\x20IN\x20?',squel[_0xa2d6('0x46')](hopperContacts))[_0xa2d6('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xa2d6('0x3b')]();return _0x84baf8;}return db[_0xa2d6('0x4b')][_0xa2d6('0x4c')]({'where':{'type':_0xa2d6('0x4d')},'attributes':['id',_0xa2d6('0x4e')],'include':[{'model':db[_0xa2d6('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0xa2d6('0x2d')](function(_0xb8ec22){var _0x38a720=[];if(_0xb8ec22){var _0xfe8f44;for(var _0x204846=0x0,_0x2f3f94;_0x204846<_0xb8ec22['length'];_0x204846+=0x1){_0x2f3f94=_0xb8ec22[_0x204846]['get']({'plain':!![]});switch(_0x2f3f94[_0xa2d6('0x4e')]){case _0xa2d6('0x50'):_0x38a720['push'](db[_0xa2d6('0x51')][_0xa2d6('0x52')](_0xeb26e9(_0x2f3f94,_0xa2d6('0x53')))[_0xa2d6('0x2d')](function(){})[_0xa2d6('0x54')](_0x24940f()));break;case'onlyIfOpen':_0x38a720[_0xa2d6('0x2e')](db[_0xa2d6('0x51')]['query'](_0x222346(_0x2f3f94,_0xa2d6('0x53')))['then'](function(){})['catch'](_0x24940f()));break;default:_0x38a720['push'](db[_0xa2d6('0x51')][_0xa2d6('0x52')](_0x3fde61(_0x2f3f94,_0xa2d6('0x53')))[_0xa2d6('0x2d')](function(){})[_0xa2d6('0x54')](_0x24940f()));}}}return _0x38a720;})[_0xa2d6('0x55')]()[_0xa2d6('0x2d')](function(){return db[_0xa2d6('0x4b')][_0xa2d6('0x4c')]({'where':{'type':_0xa2d6('0x4d')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xa2d6('0x56'),'where':{'id':LISTID}}]})[_0xa2d6('0x2d')](function(_0x177a35){var _0x500dac=[];if(_0x177a35){var _0xf80d82;for(var _0x417f5c=0x0,_0x1d0b99;_0x417f5c<_0x177a35[_0xa2d6('0x27')];_0x417f5c+=0x1){_0x1d0b99=_0x177a35[_0x417f5c]['get']({'plain':!![]});_0x500dac[_0xa2d6('0x2e')](db[_0xa2d6('0x51')]['query'](_0x2363b0(_0x1d0b99,_0xa2d6('0x53')))[_0xa2d6('0x2d')](function(){})[_0xa2d6('0x54')](_0x24940f()));}}return _0x500dac;})[_0xa2d6('0x55')]();})[_0xa2d6('0x2d')](function(){return db[_0xa2d6('0x57')]['findAll']({'attributes':['id',_0xa2d6('0x4e')],'include':[{'model':db[_0xa2d6('0x4f')],'as':_0xa2d6('0x58'),'where':{'id':LISTID}}]})[_0xa2d6('0x2d')](function(_0x4e2449){var _0x2d9def=[];if(_0x4e2449){for(var _0x35c333=0x0,_0x2786a5;_0x35c333<_0x4e2449['length'];_0x35c333+=0x1){_0x2786a5=_0x4e2449[_0x35c333][_0xa2d6('0x59')]({'plain':!![]});switch(_0x2786a5[_0xa2d6('0x4e')]){case _0xa2d6('0x50'):_0x2d9def[_0xa2d6('0x2e')](db[_0xa2d6('0x51')][_0xa2d6('0x52')](_0xeb26e9(_0x2786a5,'CampaignId'))[_0xa2d6('0x2d')](function(){})[_0xa2d6('0x54')](_0x24940f()));break;case _0xa2d6('0x5a'):_0x2d9def[_0xa2d6('0x2e')](db[_0xa2d6('0x51')]['query'](_0x222346(_0x2786a5,_0xa2d6('0x5b')))[_0xa2d6('0x2d')](function(){})['catch'](_0x24940f()));break;default:_0x2d9def['push'](db[_0xa2d6('0x51')][_0xa2d6('0x52')](_0x3fde61(_0x2786a5,'CampaignId'))[_0xa2d6('0x2d')](function(){})[_0xa2d6('0x54')](_0x24940f()));}}}return _0x2d9def;})['all']();})[_0xa2d6('0x2d')](function(){return db[_0xa2d6('0x57')][_0xa2d6('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xa2d6('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa2d6('0x2d')](function(_0x236cb2){var _0x4e2d62=[];if(_0x236cb2){for(var _0x4f0215=0x0,_0xda7fcf;_0x4f0215<_0x236cb2[_0xa2d6('0x27')];_0x4f0215+=0x1){_0xda7fcf=_0x236cb2[_0x4f0215][_0xa2d6('0x59')]({'plain':!![]});_0x4e2d62[_0xa2d6('0x2e')](db['sequelize'][_0xa2d6('0x52')](_0x2363b0(_0xda7fcf,_0xa2d6('0x5b')))[_0xa2d6('0x2d')](function(){})[_0xa2d6('0x54')](_0x24940f()));}}return _0x4e2d62;})['all']();})['catch'](function(_0x138829){logger[_0xa2d6('0x15')](_0xa2d6('0x5c'),_0xa2d6('0x5d'),_0x138829[_0xa2d6('0x1b')]);});}var processPromises=function(_0x3fa845){return BPromise[_0xa2d6('0x55')](promises)[_0xa2d6('0x2d')](function(_0x2ca6b0){})[_0xa2d6('0x54')](function(_0x6711ef){logger['error'](_0xa2d6('0x5e'),JSON[_0xa2d6('0x30')](_0x6711ef));})[_0xa2d6('0x5f')](function(){socket['emit'](_0xa2d6('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3fa845){return _0x3fa845['resume']();}});};var endCsv=function(){return BPromise[_0xa2d6('0x61')]()[_0xa2d6('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xa2d6('0x2d')](function(){socket[_0xa2d6('0x62')](_0xa2d6('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa2d6('0x63')](FILEPATH);}catch(_0x4aa654){logger['error'](_0xa2d6('0x64'),JSON[_0xa2d6('0x30')](_0x4aa654));}finally{process['exit'](0x0);}});};process['on'](_0xa2d6('0x65'),function(){logger[_0xa2d6('0x66')](_0xa2d6('0x67'));endCsv();});function main(){return BPromise[_0xa2d6('0x61')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa2d6('0x12')](',');return db[_0xa2d6('0x2a')][_0xa2d6('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa2d6('0x2d')](function(_0x244a2d){var _0x20f445=fs[_0xa2d6('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x20f445,{'header':!![],'skipEmptyLines':!![],'step':function(_0xd20f34,_0x22ceb7){total+=0x1;var _0xf2123c=total;promises[_0xa2d6('0x2e')](checkRow(_0xd20f34,_0x244a2d,_0xf2123c)[_0xa2d6('0x2d')](function(){success+=0x1;})[_0xa2d6('0x54')](function(_0x496adf){if(_0x496adf['error']){errors+=0x1;delete _0x496adf[_0xa2d6('0x15')];}else if(_0x496adf[_0xa2d6('0x29')]){duplicates+=0x1;delete _0x496adf[_0xa2d6('0x29')];}rows['push'](_0x496adf);}));if(total%0xc8===0x0){_0x22ceb7[_0xa2d6('0x69')]();return processPromises(_0x22ceb7);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xa2d6('0x6a'));endCsv();});},'error':function(_0x3a23f1,_0x3909a1){logger[_0xa2d6('0x66')](_0xa2d6('0x6b'),JSON[_0xa2d6('0x30')](_0x3a23f1));endCsv();}});})[_0xa2d6('0x54')](function(_0x297103){logger[_0xa2d6('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x297103));});}main(); \ No newline at end of file +var _0x30f9=['The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','error','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','then','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','field','NOW()','toString','createdAt','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','into','fromQuery','scheduledAt','ContactId','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','push','sequelize','query','onlyIfOpen','BlackLists','get','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','split','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','null','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil'];(function(_0x256430,_0x3a6723){var _0x33fa88=function(_0x3feec9){while(--_0x3feec9){_0x256430['push'](_0x256430['shift']());}};_0x33fa88(++_0x3a6723);}(_0x30f9,0x19b));var _0x930f=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x30f9[_0xbec8e6];return _0x4aa6f2;};'use strict';var BPromise=require(_0x930f('0x0'));var util=require('util');var _=require(_0x930f('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x930f('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0x930f('0x3'));var logger=require(_0x930f('0x4'))(_0x930f('0x5'));config[_0x930f('0x6')]=_['defaults'](config[_0x930f('0x6')],{'host':_0x930f('0x7'),'port':0x18eb});var socket=require(_0x930f('0x8'))(new Redis(config['redis']));require(_0x930f('0x9'))[_0x930f('0xa')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x930f('0xb')||process[_0x930f('0xc')][0x2]===_0x930f('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x930f('0xc')][0x3]||process['argv'][0x3]==='undefined'||process[_0x930f('0xc')][0x3]==='null'||!process[_0x930f('0xc')][0x4]||process['argv'][0x4]===_0x930f('0xb')||process[_0x930f('0xc')][0x4]===_0x930f('0xd')){throw new Error(_0x930f('0xe'));}var FIELDS=_['zipObject'](process[_0x930f('0xc')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x930f('0xc')][0x5]||process[_0x930f('0xc')][0x5]===_0x930f('0xb')||process['argv'][0x5]===_0x930f('0xd')){throw new Error(_0x930f('0xf'));}var LISTID=process[_0x930f('0xc')][0x5];var COMPANYID=process[_0x930f('0xc')][0x6]&&process[_0x930f('0xc')][0x6]!==_0x930f('0xb')&&process[_0x930f('0xc')][0x6]!==_0x930f('0xd')?process[_0x930f('0xc')][0x6]:null;var DUPLICATES=process[_0x930f('0xc')][0x7]&&process[_0x930f('0xc')][0x7]!==_0x930f('0xb')&&process[_0x930f('0xc')][0x7]!==_0x930f('0xd')?process['argv'][0x7]:null;if(!process[_0x930f('0xc')][0x8]||process['argv'][0x8]===_0x930f('0xb')||process['argv'][0x8]===_0x930f('0xd')){throw new Error(_0x930f('0x10'));}var SOCKET_TIMESTAMP=process[_0x930f('0xc')][0x8];}catch(_0x324a0e){logger['error'](_0x324a0e);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(_0xd9e5cb,_0x572acc,_0x4b9b8c,_0x126948){var _0x5c363f={'message':_0x572acc};_0x5c363f[_0xd9e5cb]=!![];if(_0x4b9b8c){_0x5c363f[_0x930f('0x11')]=_0x4b9b8c;}if(_0x126948){_0x5c363f[_0x930f('0x12')]=_0x126948;}return _0x5c363f;}function isEmail(_0x2ccf4e){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))*$/[_0x930f('0x13')](_0x2ccf4e);}function checkRow(_0x1420bf,_0x53b325,_0xedd9b2){return new BPromise(function(_0x35b97d,_0x1e56dc){if(_[_0x930f('0x14')](_0x1420bf)){return _0x1e56dc(handleCheckRowError('error',_0x930f('0x15'),null,_0xedd9b2));}if(_0x1420bf['errors']&&_0x1420bf[_0x930f('0x16')][_0x930f('0x17')]){var _0x12c54d=_['map'](_0x1420bf[_0x930f('0x16')],_0x930f('0x18'))[_0x930f('0x19')](';');return _0x1e56dc(handleCheckRowError('error',_0x12c54d,null,_0xedd9b2));}var _0x451c25={};for(var _0x2af430 in FIELDS){if(FIELDS[_0x930f('0x1a')](_0x2af430)&&FIELDS[_0x2af430]){_0x451c25[_0x2af430]=_0x1420bf[_0x930f('0x1b')][0x0][FIELDS[_0x2af430]]||_0x1420bf[_0x930f('0x1b')][0x0]['\ufeff'+FIELDS[_0x2af430]];}}if(!_0x451c25[_0x930f('0x1c')]){return _0x1e56dc(handleCheckRowError(_0x930f('0x1d'),_0x930f('0x1e'),null,_0xedd9b2));}if(!_0x451c25[_0x930f('0x1f')]){return _0x1e56dc(handleCheckRowError(_0x930f('0x1d'),'phone\x20not\x20specified!',null,_0xedd9b2));}if(_0x451c25[_0x930f('0x20')]){var _0x299268=moment(_0x451c25[_0x930f('0x20')],_0x930f('0x21'));if(!_0x299268[_0x930f('0x22')]()){return _0x1e56dc(handleCheckRowError(_0x930f('0x1d'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0xedd9b2));}}if(_0x451c25[_0x930f('0x23')]){if(!isEmail(_0x451c25['email'])){return _0x1e56dc(handleCheckRowError('error',_0x930f('0x24'),null,_0xedd9b2));}}_0x451c25[_0x930f('0x25')]=LISTID;_0x451c25[_0x930f('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x930f('0x17')]&&_0x53b325){var _0x1391a9={};for(var _0x5da01f=0x0,_0x513534=DUPLICATES[_0x930f('0x17')];_0x5da01f<_0x513534;_0x5da01f+=0x1){_0x1391a9[DUPLICATES[_0x5da01f]]=_0x451c25[DUPLICATES[_0x5da01f]];}var _0x38ca65=_[_0x930f('0x27')](_0x53b325,_0x1391a9);if(_0x38ca65){return _0x1e56dc(handleCheckRowError(_0x930f('0x28'),'Duplicate\x20Contact',_0x38ca65,_0xedd9b2));}}return db['CmContact'][_0x930f('0x29')](_0x451c25,{'raw':!![],'hooks':![],'fields':_['keys'](_0x451c25)})[_0x930f('0x2a')](function(_0x868de){if(DUPLICATES&&DUPLICATES[_0x930f('0x17')]&&_0x53b325){_0x53b325['push'](_['pick'](_0x451c25,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x868de['id'];return _0x35b97d();})[_0x930f('0x2b')](function(_0x1f4284){return _0x1e56dc(handleCheckRowError(_0x930f('0x1d'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1f4284[_0x930f('0x18')]||JSON[_0x930f('0x2c')](_0x1f4284)),null,_0xedd9b2));});});}function checkHopper(){function _0x4749b9(){return function(_0x3c9b6c){logger[_0x930f('0x1d')](_0x930f('0x2d'),_0x930f('0x2e'),util[_0x930f('0x2f')](_0x3c9b6c,{'showHidden':![],'depth':null}));};}var _0x835a64=function(_0x5bfe99,_0x3f2ac9){var _0x1a3a15=squel[_0x930f('0x30')]()['into'](_0x930f('0x31'))['fromQuery']([_0x930f('0x1f'),'scheduledAt','ContactId','ListId',_0x3f2ac9,'createdAt','updatedAt'],squel['select']()[_0x930f('0x32')](_0x930f('0x1f'),_0x930f('0x1f'))['field'](_0x930f('0x33'),'scheduledAt')[_0x930f('0x32')]('id','ContactId')['field'](LISTID['toString'](),_0x930f('0x25'))['field'](_0x5bfe99['id'][_0x930f('0x34')](),_0x3f2ac9)[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x35'))[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x36'))[_0x930f('0x37')](_0x930f('0x38'))[_0x930f('0x39')](_0x930f('0x3a'))[_0x930f('0x39')](_0x930f('0x3b'),LISTID[_0x930f('0x34')]())[_0x930f('0x39')](_0x930f('0x3c'))['where'](_0x930f('0x3d'),squel[_0x930f('0x3e')]()[_0x930f('0x32')](_0x930f('0x1f'))[_0x930f('0x37')](_0x930f('0x31'))[_0x930f('0x39')](_0x3f2ac9+_0x930f('0x3f'),_0x5bfe99['id'][_0x930f('0x34')]())))[_0x930f('0x34')]();return _0x1a3a15;};var _0x2301d6=function(_0x3613ec,_0x6d684){var _0x355623=squel[_0x930f('0x30')]()[_0x930f('0x40')](_0x930f('0x31'))[_0x930f('0x41')]([_0x930f('0x1f'),_0x930f('0x42'),_0x930f('0x43'),'ListId',_0x6d684,_0x930f('0x35'),_0x930f('0x36')],squel[_0x930f('0x3e')]()['field']('phone',_0x930f('0x1f'))[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x42'))[_0x930f('0x32')]('id',_0x930f('0x43'))[_0x930f('0x32')](LISTID[_0x930f('0x34')](),_0x930f('0x25'))[_0x930f('0x32')](_0x3613ec['id'][_0x930f('0x34')](),_0x6d684)['field'](_0x930f('0x33'),_0x930f('0x35'))[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x36'))['from'](_0x930f('0x38'))[_0x930f('0x39')](_0x930f('0x3a'))[_0x930f('0x39')]('ListId\x20=\x20?',LISTID[_0x930f('0x34')]())[_0x930f('0x39')]('id\x20IN\x20?',squel[_0x930f('0x44')](hopperContacts))[_0x930f('0x39')](_0x930f('0x3c'))[_0x930f('0x39')](_0x930f('0x3d'),squel[_0x930f('0x3e')]()['field'](_0x930f('0x45'))[_0x930f('0x37')](_0x930f('0x46'))[_0x930f('0x39')](_0x6d684+'\x20=\x20?',_0x3613ec['id'][_0x930f('0x34')]()))[_0x930f('0x39')](_0x930f('0x3d'),squel[_0x930f('0x3e')]()[_0x930f('0x32')](_0x930f('0x1f'))[_0x930f('0x37')](_0x930f('0x31'))['where'](_0x6d684+'\x20=\x20?',_0x3613ec['id'][_0x930f('0x34')]())))['toString']();return _0x355623;};function _0x2c2af0(_0x253e51,_0x5cbd9d){var _0x4e6808=squel['insert']()[_0x930f('0x40')]('cm_hopper')[_0x930f('0x41')]([_0x930f('0x1f'),_0x930f('0x42'),_0x930f('0x43'),_0x930f('0x25'),_0x5cbd9d,'createdAt','updatedAt'],squel[_0x930f('0x3e')]()[_0x930f('0x32')](_0x930f('0x1f'),'phone')[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x42'))[_0x930f('0x32')]('id',_0x930f('0x43'))[_0x930f('0x32')](LISTID['toString'](),_0x930f('0x25'))[_0x930f('0x32')](_0x253e51['id'][_0x930f('0x34')](),_0x5cbd9d)[_0x930f('0x32')](_0x930f('0x33'),'createdAt')['field'](_0x930f('0x33'),'updatedAt')['from'](_0x930f('0x38'))[_0x930f('0x39')](_0x930f('0x3a'))[_0x930f('0x39')](_0x930f('0x3b'),LISTID['toString']())[_0x930f('0x39')](_0x930f('0x47'),squel[_0x930f('0x44')](hopperContacts))[_0x930f('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x930f('0x34')]();return _0x4e6808;}function _0x4f443c(_0x1205a4,_0x23f284){var _0x5eab62=squel[_0x930f('0x30')]()[_0x930f('0x40')](_0x930f('0x48'))[_0x930f('0x41')]([_0x930f('0x1f'),'ContactId',_0x930f('0x25'),_0x23f284,_0x930f('0x35'),_0x930f('0x36')],squel[_0x930f('0x3e')]()[_0x930f('0x32')]('phone',_0x930f('0x1f'))[_0x930f('0x32')]('id','ContactId')[_0x930f('0x32')](LISTID[_0x930f('0x34')](),_0x930f('0x25'))[_0x930f('0x32')](_0x1205a4['id'][_0x930f('0x34')](),_0x23f284)[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x35'))[_0x930f('0x32')](_0x930f('0x33'),_0x930f('0x36'))[_0x930f('0x37')](_0x930f('0x38'))['where'](_0x930f('0x3a'))['where']('ListId\x20=\x20?',LISTID[_0x930f('0x34')]())[_0x930f('0x39')](_0x930f('0x47'),squel[_0x930f('0x44')](hopperContacts))['where'](_0x930f('0x3c')))['toString']();return _0x5eab62;}return db[_0x930f('0x49')][_0x930f('0x4a')]({'where':{'type':_0x930f('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x930f('0x4c')],'as':_0x930f('0x4d'),'where':{'id':LISTID}}]})[_0x930f('0x2a')](function(_0x2f70a8){var _0x10662e=[];if(_0x2f70a8){var _0x44728a;for(var _0x47eb04=0x0,_0x300c17;_0x47eb04<_0x2f70a8[_0x930f('0x17')];_0x47eb04+=0x1){_0x300c17=_0x2f70a8[_0x47eb04]['get']({'plain':!![]});switch(_0x300c17[_0x930f('0x4e')]){case'always':_0x10662e[_0x930f('0x4f')](db[_0x930f('0x50')][_0x930f('0x51')](_0x2301d6(_0x300c17,'VoiceQueueId'))[_0x930f('0x2a')](function(){})[_0x930f('0x2b')](_0x4749b9()));break;case _0x930f('0x52'):_0x10662e[_0x930f('0x4f')](db[_0x930f('0x50')][_0x930f('0x51')](_0x835a64(_0x300c17,'VoiceQueueId'))['then'](function(){})[_0x930f('0x2b')](_0x4749b9()));break;default:_0x10662e[_0x930f('0x4f')](db[_0x930f('0x50')][_0x930f('0x51')](_0x2c2af0(_0x300c17,'VoiceQueueId'))[_0x930f('0x2a')](function(){})[_0x930f('0x2b')](_0x4749b9()));}}}return _0x10662e;})['all']()[_0x930f('0x2a')](function(){return db['VoiceQueue'][_0x930f('0x4a')]({'where':{'type':_0x930f('0x4b')},'attributes':['id'],'include':[{'model':db[_0x930f('0x4c')],'as':_0x930f('0x53'),'where':{'id':LISTID}}]})[_0x930f('0x2a')](function(_0x3baa29){var _0x4372e8=[];if(_0x3baa29){var _0x159d24;for(var _0x437084=0x0,_0x5a2c96;_0x437084<_0x3baa29[_0x930f('0x17')];_0x437084+=0x1){_0x5a2c96=_0x3baa29[_0x437084][_0x930f('0x54')]({'plain':!![]});_0x4372e8['push'](db['sequelize']['query'](_0x4f443c(_0x5a2c96,'VoiceQueueId'))[_0x930f('0x2a')](function(){})[_0x930f('0x2b')](_0x4749b9()));}}return _0x4372e8;})[_0x930f('0x55')]();})[_0x930f('0x2a')](function(){return db[_0x930f('0x56')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x930f('0x4c')],'as':_0x930f('0x4d'),'where':{'id':LISTID}}]})['then'](function(_0x3d49d0){var _0x3ae01e=[];if(_0x3d49d0){for(var _0xfe9de6=0x0,_0x1e86b6;_0xfe9de6<_0x3d49d0[_0x930f('0x17')];_0xfe9de6+=0x1){_0x1e86b6=_0x3d49d0[_0xfe9de6][_0x930f('0x54')]({'plain':!![]});switch(_0x1e86b6[_0x930f('0x4e')]){case'always':_0x3ae01e['push'](db[_0x930f('0x50')][_0x930f('0x51')](_0x2301d6(_0x1e86b6,_0x930f('0x57')))[_0x930f('0x2a')](function(){})[_0x930f('0x2b')](_0x4749b9()));break;case _0x930f('0x52'):_0x3ae01e[_0x930f('0x4f')](db[_0x930f('0x50')][_0x930f('0x51')](_0x835a64(_0x1e86b6,_0x930f('0x57')))['then'](function(){})[_0x930f('0x2b')](_0x4749b9()));break;default:_0x3ae01e[_0x930f('0x4f')](db[_0x930f('0x50')][_0x930f('0x51')](_0x2c2af0(_0x1e86b6,_0x930f('0x57')))['then'](function(){})[_0x930f('0x2b')](_0x4749b9()));}}}return _0x3ae01e;})['all']();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x930f('0x2a')](function(_0x132bda){var _0x4a6ee0=[];if(_0x132bda){for(var _0x40554c=0x0,_0x362dee;_0x40554c<_0x132bda[_0x930f('0x17')];_0x40554c+=0x1){_0x362dee=_0x132bda[_0x40554c]['get']({'plain':!![]});_0x4a6ee0[_0x930f('0x4f')](db[_0x930f('0x50')][_0x930f('0x51')](_0x4f443c(_0x362dee,_0x930f('0x57')))[_0x930f('0x2a')](function(){})[_0x930f('0x2b')](_0x4749b9()));}}return _0x4a6ee0;})[_0x930f('0x55')]();})[_0x930f('0x2b')](function(_0x2abdc5){logger[_0x930f('0x1d')](_0x930f('0x58'),'generalCheckHopper',_0x2abdc5[_0x930f('0x18')]);});}var processPromises=function(_0x4e4630){return BPromise[_0x930f('0x55')](promises)[_0x930f('0x2a')](function(_0x1db0e8){})[_0x930f('0x2b')](function(_0x5c39a1){logger[_0x930f('0x1d')](_0x930f('0x59'),JSON[_0x930f('0x2c')](_0x5c39a1));})[_0x930f('0x5a')](function(){socket['emit'](_0x930f('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4e4630){return _0x4e4630[_0x930f('0x5c')]();}});};var endCsv=function(){return BPromise[_0x930f('0x5d')]()[_0x930f('0x2a')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x930f('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x930f('0x5f')](FILEPATH);}catch(_0x53ed62){logger[_0x930f('0x1d')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x930f('0x2c')](_0x53ed62));}finally{process[_0x930f('0x60')](0x0);}});};process['on'](_0x930f('0x61'),function(){logger[_0x930f('0x62')](_0x930f('0x63'));endCsv();});function main(){return BPromise[_0x930f('0x5d')]()[_0x930f('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x930f('0x64')](',');return db[_0x930f('0x65')][_0x930f('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x313e86){var _0x232be6=fs[_0x930f('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x930f('0x67')](_0x232be6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x89b8d0,_0x55243b){total+=0x1;var _0x21edae=total;promises['push'](checkRow(_0x89b8d0,_0x313e86,_0x21edae)[_0x930f('0x2a')](function(){success+=0x1;})[_0x930f('0x2b')](function(_0x537a1e){if(_0x537a1e['error']){errors+=0x1;delete _0x537a1e[_0x930f('0x1d')];}else if(_0x537a1e[_0x930f('0x28')]){duplicates+=0x1;delete _0x537a1e[_0x930f('0x28')];}rows[_0x930f('0x4f')](_0x537a1e);}));if(total%0xc8===0x0){_0x55243b[_0x930f('0x68')]();return processPromises(_0x55243b);}},'complete':function(){return processPromises()[_0x930f('0x2a')](function(){logger[_0x930f('0x62')](_0x930f('0x69'));endCsv();});},'error':function(_0x1189ae,_0x523a50){logger['info'](_0x930f('0x6a'),JSON[_0x930f('0x2c')](_0x1189ae));endCsv();}});})[_0x930f('0x2b')](function(_0x48c485){logger[_0x930f('0x1d')](_0x930f('0x6b'),JSON['stringify'](_0x48c485));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 8af518d..f8c949f 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 _0x643b=['squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.updatedAt','insert','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','spread','catch','send','start','binding','socket_timestamp','server/files/tmp','.csv','writeFileSync','createReadStream','data','length','errors','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','finish','affectedRows','unlink','complete','argv','root','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','util','moment'];(function(_0x3b9e74,_0x2c11cc){var _0x33c284=function(_0x5f2557){while(--_0x5f2557){_0x3b9e74['push'](_0x3b9e74['shift']());}};_0x33c284(++_0x2c11cc);}(_0x643b,0x81));var _0xb643=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x643b[_0x4b369d];return _0x571a98;};'use strict';var fs=require('fs');var path=require(_0xb643('0x0'));var _=require(_0xb643('0x1'));var Papa=require('papaparse');var util=require(_0xb643('0x2'));var BPromise=require('bluebird');var moment=require(_0xb643('0x3'));var squel=require(_0xb643('0x4'));var Redis=require(_0xb643('0x5'));var db=require(_0xb643('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xb643('0x7'))(_0xb643('0x8'));config['redis']=_[_0xb643('0x9')](config[_0xb643('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb643('0xb'))(new Redis(config[_0xb643('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xb643('0xc')](_0xb643('0xd'));function isEmail(_0x5c7f52){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))*$/[_0xb643('0xe')](_0x5c7f52);}function selectNotIn(_0x42ecdb,_0x520108,_0x606a18,_0x226b2b,_0x2a8f20){return squel['select']()[_0xb643('0xf')](_0xb643('0x10'))[_0xb643('0x11')](_0x226b2b)[_0xb643('0x12')](_0x520108,null,_0x520108+_0xb643('0x13')+_0x226b2b+'.'+_0x606a18)['where'](_0x226b2b+'.'+_0x606a18+_0xb643('0x14')+_0x42ecdb+'.'+_0x606a18)[_0xb643('0x15')](_0x520108+_0xb643('0x16')+_0x2a8f20['join']()+')');}function insertCmHopper(_0x105a2e,_0x4b121f,_0x582d8a,_0x5ce7c1,_0x5ab3dc){var _0x10a868=[_0xb643('0x17'),'cm_contacts.scheduledat','cm_contacts.id',_0xb643('0x18'),_0x4b121f+'.'+_0x5ce7c1,_0xb643('0x19'),'cm_contacts.updatedAt',_0xb643('0x1a'),_0xb643('0x1b'),'\x22'+_0x5ab3dc+'\x22'];return squel['insert']()[_0xb643('0x1c')](_0xb643('0x1d'))[_0xb643('0x1e')]([_0xb643('0x10'),_0xb643('0x1f'),_0xb643('0x20'),_0xb643('0x21'),_0x5ce7c1,_0xb643('0x22'),'updatedAt',_0xb643('0x23'),_0xb643('0x24'),_0xb643('0x25')],squel[_0xb643('0x26')]()[_0xb643('0x27')](_0x10a868)[_0xb643('0x11')](_0x4b121f)[_0xb643('0x12')](_0xb643('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x4b121f+_0xb643('0x29'))['join'](_0x582d8a,null,_0x582d8a+'.id\x20=\x20'+_0x4b121f+'.'+_0x5ce7c1)['where'](_0x4b121f+_0xb643('0x2a'),_0x105a2e)[_0xb643('0x15')](_0xb643('0x2b'),NOW)[_0xb643('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4b121f,_0x582d8a,_0x5ce7c1,_0xb643('0x1d'),[_0xb643('0x2c'),_0xb643('0x2d')]))[_0xb643('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4b121f,_0x582d8a,_0x5ce7c1,'cm_hopper',[_0xb643('0x2c')])))[_0xb643('0x2e')]();}function insertCmHopperBlack(_0x2f9499,_0x29ca49,_0x4e96da,_0x110cb6){var _0x568660=['cm_contacts.phone',_0xb643('0x2f'),_0xb643('0x18'),_0x29ca49+'.'+_0x110cb6,'cm_contacts.createdAt',_0xb643('0x30')];return squel[_0xb643('0x31')]()['into'](_0xb643('0x32'))[_0xb643('0x1e')](['phone',_0xb643('0x20'),_0xb643('0x21'),_0x110cb6,'createdAt',_0xb643('0x33')],squel[_0xb643('0x26')]()['fields'](_0x568660)[_0xb643('0x11')](_0x29ca49)[_0xb643('0x12')](_0xb643('0x28'),null,_0xb643('0x34')+_0x29ca49+_0xb643('0x29'))['join'](_0x4e96da,null,_0x4e96da+'.id\x20=\x20'+_0x29ca49+'.'+_0x110cb6)[_0xb643('0x15')](_0x29ca49+_0xb643('0x2a'),_0x2f9499)[_0xb643('0x15')](_0xb643('0x2b'),NOW)['where'](_0xb643('0x35'),squel[_0xb643('0x26')]()['field'](_0xb643('0x10'))[_0xb643('0x11')](_0xb643('0x32'))[_0xb643('0x15')](_0xb643('0x36'),_0x2f9499)[_0xb643('0x15')](_0x110cb6+'\x20=\x20?',_0x29ca49+'.'+_0x110cb6)))[_0xb643('0x2e')]();}function insertCmContact(_0x1b01e8,_0x31e6d7,_0x32a5ee,_0x5cb42d){var _0xabf328=_[_0xb643('0x37')](_[_0xb643('0x38')](_0x5cb42d),['ListId',_0xb643('0x39'),_0xb643('0x22'),'updatedAt']);return squel[_0xb643('0x31')]()[_0xb643('0x1c')](_0xb643('0x28'))[_0xb643('0x1e')](_0xabf328,squel[_0xb643('0x26')]()['fields'](_0xabf328)[_0xb643('0x11')](_0x31e6d7)[_0xb643('0x15')]('('+_0x32a5ee[_0xb643('0x12')](',')+')\x20NOT\x20IN\x20?',squel[_0xb643('0x26')]()[_0xb643('0x27')](_0x32a5ee)['from']('cm_contacts')['where']('ListId\x20=\x20?',_0x1b01e8)[_0xb643('0x15')](_0xb643('0x3a')))[_0xb643('0x15')](_0xb643('0x3b'),squel[_0xb643('0x26')]()['field'](_0xb643('0x3c'),_0xb643('0x3d'))[_0xb643('0x11')](_0x31e6d7)[_0xb643('0x3e')](_0x32a5ee[_0xb643('0x12')](','))))[_0xb643('0x2e')]();}function handleStop(){logger[_0xb643('0x3f')](_0xb643('0x40'));stopped=!![];}function handleUncaughtException(_0x139ac9){logger[_0xb643('0x41')](_0x139ac9[_0xb643('0x42')]);process[_0xb643('0x43')](0x1);}function handleError(_0x111f82,_0x2eeed1){stats['errors'][_0xb643('0x44')]({'name':_0x2eeed1[_0xb643('0x45')],'message':_0x2eeed1[_0xb643('0x42')],'row':_0x111f82});}function handleQuery(_0x11c24d){logger[_0xb643('0x3f')](_0x11c24d);return db[_0xb643('0x46')]['query'](_0x11c24d)[_0xb643('0x47')](function(_0x3a3093){results[_0xb643('0x44')](_0x3a3093);})[_0xb643('0x48')](function(_0x3b6449){logger[_0xb643('0x41')](_0x3b6449[_0xb643('0x42')]);});}function main(_0x376d1d,_0x17e005,_0x4b0e6f,_0x249fdf){logger[_0xb643('0x3f')]('main',_0x376d1d,JSON['stringify'](_0x17e005));process[_0xb643('0x49')](_0xb643('0x4a'));var _0x3c07b1=_0x17e005[_0xb643('0x4b')];var _0x11fb36=_0x17e005[_0xb643('0x4c')];var _0x48048a=path[_0xb643('0x12')](config['root'],_0xb643('0x4d'),_0x11fb36+_0xb643('0x4e'));var _0x6c0526=_[_0xb643('0x38')](_0x3c07b1)[_0xb643('0x12')]();logger[_0xb643('0x3f')]('header',_0x6c0526);fs[_0xb643('0x4f')](_0x48048a,_0x6c0526+'\x0a');Papa['parse'](fs[_0xb643('0x50')](_0x376d1d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x7634b3,_0x283a6a){try{for(var _0x4ed341=0x0,_0x6931ce=[];_0x4ed341<_0x7634b3[_0xb643('0x51')][_0xb643('0x52')];_0x4ed341++){stats['rows']+=0x1;if(_0x7634b3[_0xb643('0x53')][_0x4ed341]){handleError(_0x7634b3[_0xb643('0x51')][_0x4ed341],_0x7634b3[_0xb643('0x53')][_0x4ed341]);}else{var _0x92b6f2=[];for(var _0x1b17c2 in _0x3c07b1){if(_0x3c07b1[_0xb643('0x54')](_0x1b17c2)){if(_0x7634b3[_0xb643('0x51')][_0x4ed341][_0x3c07b1[_0x1b17c2]]){var _0x56d4e4=_[_0xb643('0x55')](_0x7634b3['data'][_0x4ed341][_0x3c07b1[_0x1b17c2]][_0xb643('0x56')](/"/g,'\x27'));switch(_0x1b17c2){case _0xb643('0x1f'):var _0x33ee10=moment(_0x56d4e4,_0xb643('0xd'),!![]);if(_0x33ee10[_0xb643('0x57')]()){_0x6931ce[_0xb643('0x44')]('\x22'+_0x56d4e4+'\x22');}else{_0x92b6f2[_0xb643('0x44')](_0xb643('0x58'));}break;case'priority':var _0x204825=parseInt(_0x56d4e4);_0x56d4e4=_['isNaN'](_0x204825)||_0x204825<0x0||_0x204825>0x4?_0x249fdf?0x3:0x2:_0x204825;_0x6931ce[_0xb643('0x44')]('\x22'+_0x56d4e4+'\x22');break;case _0xb643('0x24'):var _0x30b945=parseInt(_0x56d4e4);if(_[_0xb643('0x59')](_0x30b945)&&_[_0xb643('0x5a')](_0x4b0e6f,_0x30b945)){_0x6931ce[_0xb643('0x44')]('\x22'+_0x30b945+'\x22');}else{_0x92b6f2['push'](_0xb643('0x5b'));}break;case _0xb643('0x5c'):if(isEmail(_0x56d4e4)){_0x6931ce[_0xb643('0x44')]('\x22'+_0x56d4e4+'\x22');}else{_0x92b6f2['push'](_0xb643('0x5d'));}break;case _0xb643('0x5e'):var _0x17fec3=moment(_0x56d4e4,_0xb643('0x5f'),!![]);if(_0x17fec3[_0xb643('0x57')]()){_0x6931ce['push']('\x22'+_0x56d4e4+'\x22');}else{_0x92b6f2['push'](_0xb643('0x60'));}break;default:_0x6931ce[_0xb643('0x44')]('\x22'+_0x56d4e4+'\x22');}}else{switch(_0x1b17c2){case'firstName':case'phone':_0x92b6f2['push'](_0x1b17c2+_0xb643('0x61'));break;default:_0x6931ce[_0xb643('0x44')]('\x22\x22');}}}}if(_0x92b6f2[_0xb643('0x52')]){handleError(_0x7634b3[_0xb643('0x51')][_0x4ed341],{'code':'SystemRow','message':_0x92b6f2[_0xb643('0x12')]()});}else{fs[_0xb643('0x62')](_0x48048a,_0x6931ce[_0xb643('0x12')]()+'\x0a');}_0x6931ce=[];}if(!(stats[_0xb643('0x63')]%0xc8)){socket[_0xb643('0x64')](_0xb643('0x65')+_0x11fb36,stats);stats['errors']=[];}}if(stopped){logger[_0xb643('0x3f')](_0xb643('0x66'));_0x283a6a[_0xb643('0x67')]();}}catch(_0x40e6c1){handleError(_0x7634b3[_0xb643('0x51')][_0x4ed341],{'code':_0xb643('0x68'),'message':_0x40e6c1[_0xb643('0x42')]});logger['error'](_0xb643('0x69'),_0x40e6c1[_0xb643('0x42')]);}},'complete':function(){try{var _0x2dd074=[];var _0xc9fe02=_0xb643('0x28');if(_0x17e005[_0xb643('0x6a')]&&_0x17e005[_0xb643('0x6a')]['length']){_0xc9fe02=_0xb643('0x6b')+_0x11fb36;_0x2dd074[_0xb643('0x44')](_0xb643('0x6c')+_0xc9fe02+'\x20LIKE\x20cm_contacts;');}var _0x193cda=util['format'](_0xb643('0x6d'),_0x48048a,_0xc9fe02,_0x6c0526,_0x17e005[_0xb643('0x21')],_0x17e005[_0xb643('0x39')]||null,NOW,NOW);if(_[_0xb643('0x6e')](_0x3c07b1['scheduledat'])){_0x193cda+=_0xb643('0x6f');}_0x2dd074[_0xb643('0x44')](_0x193cda);if(_0x17e005[_0xb643('0x6a')]&&_0x17e005['duplicates'][_0xb643('0x52')]){_0x2dd074[_0xb643('0x44')](insertCmContact(_0x17e005[_0xb643('0x21')],_0xc9fe02,_0x17e005[_0xb643('0x6a')],_0x3c07b1));_0x2dd074[_0xb643('0x44')]('DROP\x20TABLE\x20'+_0xc9fe02+';');}_0x2dd074[_0xb643('0x44')](insertCmHopper(_0x17e005[_0xb643('0x21')],_0xb643('0x70'),_0xb643('0x71'),'VoiceQueueId',_0x249fdf));_0x2dd074['push'](insertCmHopperBlack(_0x17e005[_0xb643('0x21')],'voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId'));_0x2dd074['push'](insertCmHopper(_0x17e005[_0xb643('0x21')],_0xb643('0x72'),'campaigns',_0xb643('0x73'),_0x249fdf));_0x2dd074[_0xb643('0x44')](insertCmHopperBlack(_0x17e005[_0xb643('0x21')],_0xb643('0x74'),_0xb643('0x75'),'CampaignId'));BPromise[_0xb643('0x76')](_0x2dd074,handleQuery)['then'](function(_0x3513e0){stats[_0xb643('0x77')]=!![];stats[_0xb643('0x78')]=_0x17e005['duplicates']&&_0x17e005[_0xb643('0x6a')]['length']?results[0x2][_0xb643('0x78')]:results[0x0][_0xb643('0x78')];socket['emit'](_0xb643('0x65')+_0x11fb36,stats);fs[_0xb643('0x79')](_0x376d1d);fs[_0xb643('0x79')](_0x48048a);process[_0xb643('0x43')](0x0);})[_0xb643('0x48')](function(_0x534752){logger[_0xb643('0x41')](_0x534752[_0xb643('0x42')]);process['exit'](0x1);});}catch(_0x5114fd){logger[_0xb643('0x41')](_0xb643('0x7a'),_0x5114fd[_0xb643('0x42')]);process[_0xb643('0x43')](0x1);}},'error':function(_0x5a9edc,_0x29187c,_0x1f6ef6,_0x4d876d){throw new Error(_0x4d876d);}});}function validate(){if(process[_0xb643('0x7b')]&&process[_0xb643('0x7b')][_0xb643('0x52')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x43811f=path['join'](config[_0xb643('0x7c')],_0xb643('0x4d'),process[_0xb643('0x7b')][0x2]);if(!fs[_0xb643('0x7d')](_0x43811f)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x1d9296={};try{_0x1d9296=JSON['parse'](process['argv'][0x3]);if(!_0x1d9296['binding']){throw new Error(_0xb643('0x7e'));}if(!_0x1d9296[_0xb643('0x4b')]['phone']){throw new Error(_0xb643('0x7f'));}if(!_0x1d9296['binding'][_0xb643('0x80')]){throw new Error('firstName\x20is\x20mandatory');}var _0x1e5691=0x0;if(_0x1d9296[_0xb643('0x4b')][_0xb643('0x24')]){_0x1e5691=0x1;}if(!_0x1d9296[_0xb643('0x21')]){throw new Error(_0xb643('0x81'));}}catch(_0x1bc89d){throw new Error(_0xb643('0x82'));}var _0x2c18fe=[];try{_0x2c18fe=_[_0xb643('0x83')](JSON['parse'](process[_0xb643('0x7b')][0x4]),'id');}catch(_0x1e5649){logger['info']('No\x20agent\x20available');}main(_0x43811f,_0x1d9296,_0x2c18fe,_0x1e5691);}validate();process['on']('SIGINT',handleStop);process['on'](_0xb643('0x84'),handleUncaughtException); \ No newline at end of file +var _0xd8ad=['\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','affectedRows','unlink','catch','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','select','cm_contacts.ListId\x20=\x20','.CmListId','\x22always\x22','cm_contacts.ListId','cm_hopper_black','fromQuery','fields','cm_contacts','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x20=\x20?','toString','concat',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','error','message','exit','errors','push','code','sequelize','query','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','keys','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','priority','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName'];(function(_0x2fde2b,_0x5ad13e){var _0x4a6a6f=function(_0x5493ab){while(--_0x5493ab){_0x2fde2b['push'](_0x2fde2b['shift']());}};_0x4a6a6f(++_0x5ad13e);}(_0xd8ad,0x139));var _0xdd8a=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xd8ad[_0x481bf7];return _0x461787;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xdd8a('0x0'));var Papa=require(_0xdd8a('0x1'));var util=require(_0xdd8a('0x2'));var BPromise=require(_0xdd8a('0x3'));var moment=require(_0xdd8a('0x4'));var squel=require(_0xdd8a('0x5'));var Redis=require(_0xdd8a('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0xdd8a('0x7'));var logger=require(_0xdd8a('0x8'))(_0xdd8a('0x9'));config[_0xdd8a('0xa')]=_[_0xdd8a('0xb')](config['redis'],{'host':_0xdd8a('0xc'),'port':0x18eb});var socket=require(_0xdd8a('0xd'))(new Redis(config[_0xdd8a('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xdd8a('0xe')](_0xdd8a('0xf'));function isEmail(_0x24215d){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))*$/[_0xdd8a('0x10')](_0x24215d);}function selectNotIn(_0x31e409,_0x36dfad,_0x418132,_0xa427ae,_0x59f27b){return squel['select']()[_0xdd8a('0x11')]('phone')[_0xdd8a('0x12')](_0xa427ae)['join'](_0x36dfad,null,_0x36dfad+_0xdd8a('0x13')+_0xa427ae+'.'+_0x418132)[_0xdd8a('0x14')](_0xa427ae+'.'+_0x418132+_0xdd8a('0x15')+_0x31e409+'.'+_0x418132)[_0xdd8a('0x14')](_0x36dfad+_0xdd8a('0x16')+_0x59f27b[_0xdd8a('0x17')]()+')');}function insertCmHopper(_0x2b52f7,_0x5cc872,_0x48c004,_0x165edb,_0x5ea312){var _0x493b45=[_0xdd8a('0x18'),_0xdd8a('0x19'),'cm_contacts.id','cm_contacts.ListId',_0x5cc872+'.'+_0x165edb,_0xdd8a('0x1a'),_0xdd8a('0x1b'),_0xdd8a('0x1c'),'cm_contacts.UserId','\x22'+_0x5ea312+'\x22'];return squel[_0xdd8a('0x1d')]()[_0xdd8a('0x1e')](_0xdd8a('0x1f'))['fromQuery']([_0xdd8a('0x20'),_0xdd8a('0x21'),_0xdd8a('0x22'),_0xdd8a('0x23'),_0x165edb,_0xdd8a('0x24'),_0xdd8a('0x25'),'priority',_0xdd8a('0x26'),_0xdd8a('0x27')],squel[_0xdd8a('0x28')]()['fields'](_0x493b45)['from'](_0x5cc872)['join']('cm_contacts',null,_0xdd8a('0x29')+_0x5cc872+_0xdd8a('0x2a'))[_0xdd8a('0x17')](_0x48c004,null,_0x48c004+_0xdd8a('0x13')+_0x5cc872+'.'+_0x165edb)[_0xdd8a('0x14')](_0x5cc872+'.CmListId\x20=\x20?',_0x2b52f7)[_0xdd8a('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdd8a('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5cc872,_0x48c004,_0x165edb,_0xdd8a('0x1f'),[_0xdd8a('0x2b'),'\x22onlyIfOpen\x22']))[_0xdd8a('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5cc872,_0x48c004,_0x165edb,'cm_hopper',[_0xdd8a('0x2b')])))['toString']();}function insertCmHopperBlack(_0x1f17b6,_0x34ac29,_0x3e6b5f,_0x42e4e7){var _0x16a3e0=[_0xdd8a('0x18'),'cm_contacts.id',_0xdd8a('0x2c'),_0x34ac29+'.'+_0x42e4e7,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xdd8a('0x1d')]()[_0xdd8a('0x1e')](_0xdd8a('0x2d'))[_0xdd8a('0x2e')]([_0xdd8a('0x20'),_0xdd8a('0x22'),_0xdd8a('0x23'),_0x42e4e7,_0xdd8a('0x24'),_0xdd8a('0x25')],squel['select']()[_0xdd8a('0x2f')](_0x16a3e0)['from'](_0x34ac29)[_0xdd8a('0x17')](_0xdd8a('0x30'),null,_0xdd8a('0x29')+_0x34ac29+_0xdd8a('0x2a'))['join'](_0x3e6b5f,null,_0x3e6b5f+'.id\x20=\x20'+_0x34ac29+'.'+_0x42e4e7)[_0xdd8a('0x14')](_0x34ac29+'.CmListId\x20=\x20?',_0x1f17b6)['where'](_0xdd8a('0x31'),NOW)[_0xdd8a('0x14')](_0xdd8a('0x32'),squel[_0xdd8a('0x28')]()['field'](_0xdd8a('0x20'))[_0xdd8a('0x12')]('cm_hopper_black')[_0xdd8a('0x14')]('ListId\x20=\x20?',_0x1f17b6)['where'](_0x42e4e7+_0xdd8a('0x33'),_0x34ac29+'.'+_0x42e4e7)))[_0xdd8a('0x34')]();}function insertCmContact(_0x37d1a8,_0x66769,_0x53761c,_0x4597d5){var _0x5cb81e=_[_0xdd8a('0x35')](_['keys'](_0x4597d5),[_0xdd8a('0x23'),'CompanyId',_0xdd8a('0x24'),_0xdd8a('0x25')]);return squel['insert']()[_0xdd8a('0x1e')](_0xdd8a('0x30'))[_0xdd8a('0x2e')](_0x5cb81e,squel['select']()[_0xdd8a('0x2f')](_0x5cb81e)[_0xdd8a('0x12')](_0x66769)[_0xdd8a('0x14')]('('+_0x53761c[_0xdd8a('0x17')](',')+_0xdd8a('0x36'),squel[_0xdd8a('0x28')]()[_0xdd8a('0x2f')](_0x53761c)[_0xdd8a('0x12')](_0xdd8a('0x30'))[_0xdd8a('0x14')](_0xdd8a('0x37'),_0x37d1a8)[_0xdd8a('0x14')](_0xdd8a('0x38')))['where']('id\x20IN\x20?',squel[_0xdd8a('0x28')]()[_0xdd8a('0x11')](_0xdd8a('0x39'),_0xdd8a('0x3a'))[_0xdd8a('0x12')](_0x66769)[_0xdd8a('0x3b')](_0x53761c[_0xdd8a('0x17')](','))))[_0xdd8a('0x34')]();}function handleStop(){logger[_0xdd8a('0x3c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xfafa88){logger[_0xdd8a('0x3d')](_0xfafa88[_0xdd8a('0x3e')]);process[_0xdd8a('0x3f')](0x1);}function handleError(_0x1f822f,_0x337965){stats[_0xdd8a('0x40')][_0xdd8a('0x41')]({'name':_0x337965[_0xdd8a('0x42')],'message':_0x337965[_0xdd8a('0x3e')],'row':_0x1f822f});}function handleQuery(_0x27910c){logger[_0xdd8a('0x3c')](_0x27910c);return db[_0xdd8a('0x43')][_0xdd8a('0x44')](_0x27910c)['spread'](function(_0x5420fe){results[_0xdd8a('0x41')](_0x5420fe);})['catch'](function(_0x472acb){logger[_0xdd8a('0x3d')](_0x472acb['message']);});}function main(_0x2bcdd9,_0xdf3328,_0x1d20bc,_0x1fa1f6){logger['info'](_0xdd8a('0x45'),_0x2bcdd9,JSON[_0xdd8a('0x46')](_0xdf3328));process[_0xdd8a('0x47')](_0xdd8a('0x48'));var _0xab5a61=_0xdf3328[_0xdd8a('0x49')];var _0x146bc2=_0xdf3328[_0xdd8a('0x4a')];var _0x5328dd=path[_0xdd8a('0x17')](config[_0xdd8a('0x4b')],_0xdd8a('0x4c'),_0x146bc2+'.csv');var _0x15aa3d=_[_0xdd8a('0x4d')](_0xab5a61)['join']();logger[_0xdd8a('0x3c')]('header',_0x15aa3d);fs['writeFileSync'](_0x5328dd,_0x15aa3d+'\x0a');Papa[_0xdd8a('0x4e')](fs[_0xdd8a('0x4f')](_0x2bcdd9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c2400,_0x29d90f){try{for(var _0x3e7033=0x0,_0x2d7fbf=[];_0x3e7033<_0x3c2400[_0xdd8a('0x50')][_0xdd8a('0x51')];_0x3e7033++){stats[_0xdd8a('0x52')]+=0x1;if(_0x3c2400[_0xdd8a('0x40')][_0x3e7033]){handleError(_0x3c2400[_0xdd8a('0x50')][_0x3e7033],_0x3c2400[_0xdd8a('0x40')][_0x3e7033]);}else{var _0x22b292=[];for(var _0x2c4d9b in _0xab5a61){if(_0xab5a61[_0xdd8a('0x53')](_0x2c4d9b)){if(_0x3c2400[_0xdd8a('0x50')][_0x3e7033][_0xab5a61[_0x2c4d9b]]){var _0x4a186e=_[_0xdd8a('0x54')](_0x3c2400[_0xdd8a('0x50')][_0x3e7033][_0xab5a61[_0x2c4d9b]][_0xdd8a('0x55')](/"/g,'\x27'));switch(_0x2c4d9b){case _0xdd8a('0x21'):var _0xf7714b=moment(_0x4a186e,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xf7714b['isValid']()){_0x2d7fbf['push']('\x22'+_0x4a186e+'\x22');}else{_0x22b292['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xdd8a('0x56'):var _0x3aad48=parseInt(_0x4a186e);_0x4a186e=_[_0xdd8a('0x57')](_0x3aad48)||_0x3aad48<0x0||_0x3aad48>0x4?_0x1fa1f6?0x3:0x2:_0x3aad48;_0x2d7fbf[_0xdd8a('0x41')]('\x22'+_0x4a186e+'\x22');break;case _0xdd8a('0x26'):var _0x4c4460=parseInt(_0x4a186e);if(_[_0xdd8a('0x58')](_0x4c4460)&&_[_0xdd8a('0x59')](_0x1d20bc,_0x4c4460)){_0x2d7fbf[_0xdd8a('0x41')]('\x22'+_0x4c4460+'\x22');}else{_0x22b292[_0xdd8a('0x41')](_0xdd8a('0x5a'));}break;case'email':if(isEmail(_0x4a186e)){_0x2d7fbf[_0xdd8a('0x41')]('\x22'+_0x4a186e+'\x22');}else{_0x22b292[_0xdd8a('0x41')]('email\x20wrong\x20format');}break;case _0xdd8a('0x5b'):var _0x5653e3=moment(_0x4a186e,'YYYY-MM-DD',!![]);if(_0x5653e3[_0xdd8a('0x5c')]()){_0x2d7fbf['push']('\x22'+_0x4a186e+'\x22');}else{_0x22b292[_0xdd8a('0x41')](_0xdd8a('0x5d'));}break;default:_0x2d7fbf[_0xdd8a('0x41')]('\x22'+_0x4a186e+'\x22');}}else{switch(_0x2c4d9b){case _0xdd8a('0x5e'):case _0xdd8a('0x20'):_0x22b292[_0xdd8a('0x41')](_0x2c4d9b+_0xdd8a('0x5f'));break;default:_0x2d7fbf[_0xdd8a('0x41')]('\x22\x22');}}}}if(_0x22b292[_0xdd8a('0x51')]){handleError(_0x3c2400['data'][_0x3e7033],{'code':_0xdd8a('0x60'),'message':_0x22b292['join']()});}else{fs[_0xdd8a('0x61')](_0x5328dd,_0x2d7fbf[_0xdd8a('0x17')]()+'\x0a');}_0x2d7fbf=[];}if(!(stats[_0xdd8a('0x52')]%0xc8)){socket[_0xdd8a('0x62')](_0xdd8a('0x63')+_0x146bc2,stats);stats[_0xdd8a('0x40')]=[];}}if(stopped){logger[_0xdd8a('0x3c')](_0xdd8a('0x64'));_0x29d90f['abort']();}}catch(_0x318aa8){handleError(_0x3c2400['data'][_0x3e7033],{'code':'SystemError','message':_0x318aa8[_0xdd8a('0x3e')]});logger[_0xdd8a('0x3d')](_0xdd8a('0x65'),_0x318aa8[_0xdd8a('0x3e')]);}},'complete':function(){try{var _0x3b16be=[];var _0x5ee2ed=_0xdd8a('0x30');if(_0xdf3328[_0xdd8a('0x66')]&&_0xdf3328[_0xdd8a('0x66')][_0xdd8a('0x51')]){_0x5ee2ed=_0xdd8a('0x67')+_0x146bc2;_0x3b16be['push'](_0xdd8a('0x68')+_0x5ee2ed+_0xdd8a('0x69'));}var _0x36c5d1=util[_0xdd8a('0xe')](_0xdd8a('0x6a'),_0x5328dd,_0x5ee2ed,_0x15aa3d,_0xdf3328[_0xdd8a('0x23')],_0xdf3328['CompanyId']||null,NOW,NOW);if(_[_0xdd8a('0x6b')](_0xab5a61[_0xdd8a('0x21')])){_0x36c5d1+=_0xdd8a('0x6c');}_0x3b16be['push'](_0x36c5d1);if(_0xdf3328[_0xdd8a('0x66')]&&_0xdf3328[_0xdd8a('0x66')]['length']){_0x3b16be[_0xdd8a('0x41')](insertCmContact(_0xdf3328['ListId'],_0x5ee2ed,_0xdf3328[_0xdd8a('0x66')],_0xab5a61));_0x3b16be[_0xdd8a('0x41')](_0xdd8a('0x6d')+_0x5ee2ed+';');}_0x3b16be[_0xdd8a('0x41')](insertCmHopper(_0xdf3328[_0xdd8a('0x23')],_0xdd8a('0x6e'),'voice_queues','VoiceQueueId',_0x1fa1f6));_0x3b16be['push'](insertCmHopperBlack(_0xdf3328[_0xdd8a('0x23')],_0xdd8a('0x6f'),_0xdd8a('0x70'),_0xdd8a('0x71')));_0x3b16be['push'](insertCmHopper(_0xdf3328[_0xdd8a('0x23')],_0xdd8a('0x72'),'campaigns',_0xdd8a('0x73'),_0x1fa1f6));_0x3b16be['push'](insertCmHopperBlack(_0xdf3328[_0xdd8a('0x23')],_0xdd8a('0x74'),_0xdd8a('0x75'),'CampaignId'));BPromise[_0xdd8a('0x76')](_0x3b16be,handleQuery)[_0xdd8a('0x77')](function(_0x157fb0){stats['finish']=!![];stats[_0xdd8a('0x78')]=_0xdf3328[_0xdd8a('0x66')]&&_0xdf3328[_0xdd8a('0x66')][_0xdd8a('0x51')]?results[0x2]['affectedRows']:results[0x0][_0xdd8a('0x78')];socket[_0xdd8a('0x62')](_0xdd8a('0x63')+_0x146bc2,stats);fs[_0xdd8a('0x79')](_0x2bcdd9);fs[_0xdd8a('0x79')](_0x5328dd);process[_0xdd8a('0x3f')](0x0);})[_0xdd8a('0x7a')](function(_0x35f7a1){logger[_0xdd8a('0x3d')](_0x35f7a1[_0xdd8a('0x3e')]);process['exit'](0x1);});}catch(_0x40a307){logger[_0xdd8a('0x3d')]('complete',_0x40a307[_0xdd8a('0x3e')]);process[_0xdd8a('0x3f')](0x1);}},'error':function(_0x311cf9,_0x463edb,_0x40018a,_0x494c68){throw new Error(_0x494c68);}});}function validate(){if(process[_0xdd8a('0x7b')]&&process[_0xdd8a('0x7b')]['length']<0x4){throw new Error(_0xdd8a('0x7c'));}var _0x71f22a=path[_0xdd8a('0x17')](config[_0xdd8a('0x4b')],_0xdd8a('0x4c'),process['argv'][0x2]);if(!fs[_0xdd8a('0x7d')](_0x71f22a)){throw new Error(_0xdd8a('0x7e'));}var _0x91741c={};try{_0x91741c=JSON[_0xdd8a('0x4e')](process[_0xdd8a('0x7b')][0x3]);if(!_0x91741c[_0xdd8a('0x49')]){throw new Error(_0xdd8a('0x7f'));}if(!_0x91741c[_0xdd8a('0x49')]['phone']){throw new Error(_0xdd8a('0x80'));}if(!_0x91741c['binding'][_0xdd8a('0x5e')]){throw new Error(_0xdd8a('0x81'));}var _0xe7e1=0x0;if(_0x91741c['binding'][_0xdd8a('0x26')]){_0xe7e1=0x1;}if(!_0x91741c[_0xdd8a('0x23')]){throw new Error(_0xdd8a('0x82'));}}catch(_0x5ac3c1){throw new Error(_0xdd8a('0x83'));}var _0x45d530=[];try{_0x45d530=_[_0xdd8a('0x84')](JSON['parse'](process[_0xdd8a('0x7b')][0x4]),'id');}catch(_0x4b8293){logger[_0xdd8a('0x3c')](_0xdd8a('0x85'));}main(_0x71f22a,_0x91741c,_0x45d530,_0xe7e1);}validate();process['on'](_0xdd8a('0x86'),handleStop);process['on'](_0xdd8a('0x87'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 2b97f69..48aacb5 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 _0x58a5=['UniqueId','Date','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','agentcalledAt','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','membername','uniqueid','starttime','Answer\x20Time','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue'];(function(_0x1c238f,_0x36012b){var _0x344288=function(_0x59127f){while(--_0x59127f){_0x1c238f['push'](_0x1c238f['shift']());}};_0x344288(++_0x36012b);}(_0x58a5,0x1e4));var _0x558a=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x58a5[_0x22b8a3];return _0x199a0c;};'use strict';exports[_0x558a('0x0')]=function(_0x31840a,_0x441971){var _0x274e85=[{'type':_0x558a('0x1'),'content':_0x558a('0x2'),'variableName':null}];switch(_0x31840a[_0x558a('0x3')]()){case _0x558a('0x4'):switch(_0x441971['toLowerCase']()){case _0x558a('0x5'):_0x274e85['push']({'type':_0x558a('0x6'),'content':'','variableName':'queue'});_0x274e85[_0x558a('0x7')]({'type':_0x558a('0x6'),'content':'','variableName':_0x558a('0x8')});break;case _0x558a('0x9'):_0x274e85['push']({'type':'string','content':_0x558a('0xa'),'variableName':null});_0x274e85['push']({'type':_0x558a('0x6'),'content':'','variableName':_0x558a('0xb')});break;}}return _0x274e85;};exports['getDescriptions']=function(_0x26609c,_0x5f0189){var _0x5718d3=[];switch(_0x26609c['toLowerCase']()){case _0x558a('0x4'):switch(_0x5f0189[_0x558a('0x3')]()){case _0x558a('0x5'):_0x5718d3=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0xd'),'keyType':_0x558a('0x6'),'variableName':_0x558a('0x8')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0xe'),'keyType':_0x558a('0x6'),'variableName':_0x558a('0xf')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x10'),'keyType':'variable','variableName':_0x558a('0x11')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x12'),'keyType':_0x558a('0x6'),'variableName':_0x558a('0x13')},{'type':'keyValue','content':'','key':_0x558a('0x14'),'keyType':_0x558a('0x6'),'variableName':'uniqueid'},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x15'),'keyType':_0x558a('0x6'),'variableName':'agentcalledAt'},{'type':_0x558a('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x16'),'keyType':_0x558a('0x6'),'variableName':_0x558a('0x17')},{'type':_0x558a('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x558a('0x6'),'variableName':_0x558a('0xb')},{'type':_0x558a('0x1'),'content':_0x558a('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x558a('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x558a('0x19')},{'type':_0x558a('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x558a('0x6'),'variableName':_0x558a('0x1a')},{'type':'keyValue','content':'','key':_0x558a('0x1b'),'keyType':_0x558a('0x6'),'variableName':_0x558a('0x1c')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x1d'),'keyType':'variable','variableName':'holdtime'},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x1e'),'keyType':_0x558a('0x6'),'variableName':_0x558a('0x1f')}];break;case'outbound':_0x5718d3=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x20'),'keyType':_0x558a('0x6'),'keyContent':'','variableName':_0x558a('0xb')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x558a('0x6'),'keyContent':'','variableName':_0x558a('0x21')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x14'),'keyType':_0x558a('0x6'),'keyContent':'','variableName':_0x558a('0x22')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x15'),'keyType':_0x558a('0x6'),'keyContent':'','variableName':_0x558a('0x23')},{'type':_0x558a('0x1'),'content':_0x558a('0x18')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x24'),'keyType':_0x558a('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x25'),'keyType':_0x558a('0x6'),'keyContent':'','variableName':_0x558a('0x26')},{'type':_0x558a('0xc'),'content':'','key':'Duration','keyType':_0x558a('0x6'),'keyContent':'','variableName':_0x558a('0x27')},{'type':_0x558a('0xc'),'content':'','key':_0x558a('0x28'),'keyType':'variable','keyContent':'','variableName':_0x558a('0x29')}];break;}}return _0x5718d3;}; \ No newline at end of file +var _0x7e46=['Date','starttime','Answer\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','outbound','Called\x20Number'];(function(_0x325257,_0x174c8a){var _0x279ee1=function(_0x1a3ba3){while(--_0x1a3ba3){_0x325257['push'](_0x325257['shift']());}};_0x279ee1(++_0x174c8a);}(_0x7e46,0x194));var _0x67e4=function(_0x89bbde,_0xcab170){_0x89bbde=_0x89bbde-0x0;var _0x19e3cf=_0x7e46[_0x89bbde];return _0x19e3cf;};'use strict';exports[_0x67e4('0x0')]=function(_0x31d3b0,_0xea6547){var _0x5dcc38=[{'type':_0x67e4('0x1'),'content':_0x67e4('0x2'),'variableName':null}];switch(_0x31d3b0['toLowerCase']()){case _0x67e4('0x3'):switch(_0xea6547[_0x67e4('0x4')]()){case _0x67e4('0x5'):_0x5dcc38[_0x67e4('0x6')]({'type':_0x67e4('0x7'),'content':'','variableName':_0x67e4('0x8')});_0x5dcc38['push']({'type':_0x67e4('0x7'),'content':'','variableName':_0x67e4('0x9')});break;case'outbound':_0x5dcc38[_0x67e4('0x6')]({'type':_0x67e4('0x1'),'content':_0x67e4('0xa'),'variableName':null});_0x5dcc38[_0x67e4('0x6')]({'type':_0x67e4('0x7'),'content':'','variableName':_0x67e4('0xb')});break;}}return _0x5dcc38;};exports[_0x67e4('0xc')]=function(_0x3e9e55,_0x332124){var _0x3780fd=[];switch(_0x3e9e55[_0x67e4('0x4')]()){case'voice':switch(_0x332124[_0x67e4('0x4')]()){case _0x67e4('0x5'):_0x3780fd=[{'type':_0x67e4('0x1'),'content':_0x67e4('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0xf'),'keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x9')},{'type':'keyValue','content':'','key':_0x67e4('0x10'),'keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x11')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x12'),'keyType':'variable','variableName':_0x67e4('0x13')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x14'),'keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x8')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x15'),'keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x16')},{'type':_0x67e4('0xe'),'content':'','key':'Date','keyType':_0x67e4('0x7'),'variableName':'agentcalledAt'},{'type':'string','content':_0x67e4('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x67e4('0xe'),'content':'','key':'Agent\x20Name','keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x18')},{'type':_0x67e4('0xe'),'content':'','key':'Agent\x20Number','keyType':_0x67e4('0x7'),'variableName':'destcalleridnum'},{'type':_0x67e4('0x1'),'content':_0x67e4('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x1a'),'keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x1b')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x1c'),'keyType':'variable','variableName':_0x67e4('0x1d')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x1e'),'keyType':_0x67e4('0x7'),'variableName':'agentcompleteAt'},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x1f'),'keyType':_0x67e4('0x7'),'variableName':_0x67e4('0x20')},{'type':'keyValue','content':'','key':_0x67e4('0x21'),'keyType':_0x67e4('0x7'),'variableName':'talktime'}];break;case _0x67e4('0x22'):_0x3780fd=[{'type':_0x67e4('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x23'),'keyType':_0x67e4('0x7'),'keyContent':'','variableName':_0x67e4('0xb')},{'type':_0x67e4('0xe'),'content':'','key':'Member\x20Name','keyType':_0x67e4('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x15'),'keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x24'),'keyType':_0x67e4('0x7'),'keyContent':'','variableName':_0x67e4('0x25')},{'type':_0x67e4('0x1'),'content':_0x67e4('0x19')},{'type':'keyValue','content':'','key':_0x67e4('0x26'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x67e4('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x67e4('0x7'),'keyContent':'','variableName':_0x67e4('0x27')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x28'),'keyType':_0x67e4('0x7'),'keyContent':'','variableName':_0x67e4('0x29')},{'type':_0x67e4('0xe'),'content':'','key':_0x67e4('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x67e4('0x2b')}];break;}}return _0x3780fd;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index ab202af..1ae98b7 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 _0xa1c5=['upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','update','then','catch','error','tracked','user','query','body','omit','html','fax','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','InteractionId'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xa1c5,0x12d));var _0x5a1c=function(_0x1de5a6,_0x105958){_0x1de5a6=_0x1de5a6-0x0;var _0x3d43a7=_0xa1c5[_0x1de5a6];return _0x3d43a7;};'use strict';var _=require('lodash');var db=require(_0x5a1c('0x0'))['db'];var loggers={'openchannel':require(_0x5a1c('0x1'))(_0x5a1c('0x2')),'mail':require(_0x5a1c('0x1'))(_0x5a1c('0x3')),'fax':require(_0x5a1c('0x1'))('fax-interactions'),'sms':require(_0x5a1c('0x1'))(_0x5a1c('0x4')),'chat':require('../../config/logger')(_0x5a1c('0x5')),'whatsapp':require(_0x5a1c('0x1'))('whatsapp-interactions')};function getInteractionId(_0x5d0f50,_0x4bd40a,_0x35ec4e){if(_0x5d0f50&&_0x5d0f50[_['upperFirst'](_0x35ec4e)+_0x5a1c('0x6')]){return _0x5d0f50[_[_0x5a1c('0x7')](_0x35ec4e)+_0x5a1c('0x6')];}else if(_0x5d0f50&&_0x5d0f50['id']){return _0x5d0f50['id'];}else if(_0x4bd40a&&_0x4bd40a['id']){return _0x4bd40a['id'];}else{return _0x5a1c('0x8');}}function log(_0x2898d0,_0x1cf381,_0x1554d5,_0x2c3e33,_0x5af638,_0xa594fe){loggers[_0x5af638[_0x5a1c('0x9')]()][_0x2898d0](_0x5a1c('0xa'),_0xa594fe[_0x5a1c('0xb')](),_0x1cf381?_0x1cf381['id']:null,_0x1cf381?_0x1cf381[_0x5a1c('0xc')]:null,_0x1cf381?_0x1cf381[_0x5a1c('0xd')]:null,getInteractionId(_0x1554d5,_0x2c3e33,_0x5af638),_0x1554d5?JSON[_0x5a1c('0xe')](_0x1554d5):_0x5a1c('0xf'));}function updateUser(_0x405c5d,_0x3b9cd6,_0x4c2f9f,_0x197430,_0x137129){db[_[_0x5a1c('0x7')](_0x197430)+'Interaction'][_0x5a1c('0x10')]({'where':{'id':getInteractionId(_0x3b9cd6,_0x4c2f9f,_0x197430)}})['then'](function(_0x1179b4){if(_0x1179b4){return _0x1179b4[_0x5a1c('0x11')]({'UserId':_0x405c5d?_0x405c5d['id']:null});}})[_0x5a1c('0x12')](function(_0x51a9aa){if(_0x51a9aa){log('info',_0x405c5d,_0x3b9cd6,_0x4c2f9f,_0x197430,_0x137129);}})[_0x5a1c('0x13')](function(){log(_0x5a1c('0x14'),_0x405c5d,_0x3b9cd6,_0x4c2f9f,_0x197430,_0x137129);});}exports[_0x5a1c('0x15')]=function(_0x327fde,_0x5a309a){return function(_0x590144,_0x3065ae,_0xf299a0){var _0x5a73a3=_0x590144[_0x5a1c('0x16')];var _0xd383c0={};var _0x460292=_0x590144[_0x5a1c('0x17')];if(_0xd383c0){_0xd383c0=_['clone'](_0x590144[_0x5a1c('0x18')]);_0xd383c0=_[_0x5a1c('0x19')](_0xd383c0,[_0x5a1c('0x18'),_0x5a1c('0x1a'),'phone',_0x5a1c('0x1b'),'mobile']);}updateUser(_0x5a73a3,_0xd383c0,_0x460292,_0x327fde,_0x5a309a);_0xf299a0(null);};}; \ No newline at end of file +var _0x26e1=['stringify','findOne','update','catch','tracked','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase'];(function(_0x4eabe5,_0x35dc84){var _0x318871=function(_0x56505b){while(--_0x56505b){_0x4eabe5['push'](_0x4eabe5['shift']());}};_0x318871(++_0x35dc84);}(_0x26e1,0xbb));var _0x126e=function(_0x1f332e,_0x57c8c9){_0x1f332e=_0x1f332e-0x0;var _0x30bff0=_0x26e1[_0x1f332e];return _0x30bff0;};'use strict';var _=require(_0x126e('0x0'));var db=require(_0x126e('0x1'))['db'];var loggers={'openchannel':require(_0x126e('0x2'))(_0x126e('0x3')),'mail':require(_0x126e('0x2'))(_0x126e('0x4')),'fax':require(_0x126e('0x2'))(_0x126e('0x5')),'sms':require(_0x126e('0x2'))(_0x126e('0x6')),'chat':require(_0x126e('0x2'))('chat-interactions'),'whatsapp':require(_0x126e('0x2'))(_0x126e('0x7'))};function getInteractionId(_0x51d765,_0x1923cf,_0x5a02bb){if(_0x51d765&&_0x51d765[_[_0x126e('0x8')](_0x5a02bb)+_0x126e('0x9')]){return _0x51d765[_[_0x126e('0x8')](_0x5a02bb)+_0x126e('0x9')];}else if(_0x51d765&&_0x51d765['id']){return _0x51d765['id'];}else if(_0x1923cf&&_0x1923cf['id']){return _0x1923cf['id'];}else{return _0x126e('0xa');}}function log(_0x10557f,_0x27975a,_0x47bfc4,_0x1bb6ff,_0x565961,_0x8c6793){loggers[_0x565961['toLowerCase']()][_0x10557f](_0x126e('0xb'),_0x8c6793[_0x126e('0xc')](),_0x27975a?_0x27975a['id']:null,_0x27975a?_0x27975a['name']:null,_0x27975a?_0x27975a['role']:null,getInteractionId(_0x47bfc4,_0x1bb6ff,_0x565961),_0x47bfc4?JSON[_0x126e('0xd')](_0x47bfc4):'null');}function updateUser(_0x2623a4,_0x26c160,_0xabcf42,_0x4c2f22,_0x2f9870){db[_['upperFirst'](_0x4c2f22)+'Interaction'][_0x126e('0xe')]({'where':{'id':getInteractionId(_0x26c160,_0xabcf42,_0x4c2f22)}})['then'](function(_0x90a641){if(_0x90a641){return _0x90a641[_0x126e('0xf')]({'UserId':_0x2623a4?_0x2623a4['id']:null});}})['then'](function(_0x50bebd){if(_0x50bebd){log('info',_0x2623a4,_0x26c160,_0xabcf42,_0x4c2f22,_0x2f9870);}})[_0x126e('0x10')](function(){log('error',_0x2623a4,_0x26c160,_0xabcf42,_0x4c2f22,_0x2f9870);});}exports[_0x126e('0x11')]=function(_0x427668,_0x39607d){return function(_0x1eef47,_0x24f86a,_0x4584e0){var _0x50b7c1=_0x1eef47['user'];var _0xb02c05={};var _0x5173f5=_0x1eef47['query'];if(_0xb02c05){_0xb02c05=_[_0x126e('0x12')](_0x1eef47[_0x126e('0x13')]);_0xb02c05=_[_0x126e('0x14')](_0xb02c05,[_0x126e('0x13'),_0x126e('0x15'),_0x126e('0x16'),_0x126e('0x17'),_0x126e('0x18')]);}updateUser(_0x50b7c1,_0xb02c05,_0x5173f5,_0x427668,_0x39607d);_0x4584e0(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 3dc5d9e..b345a82 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 _0x2699=['users','User','admin','user','util','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','hasOwnProperty','License','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x2699,0x190));var _0x9269=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x2699[_0x4a7843];return _0x2c57fe;};'use strict';var crypto=require('crypto');var util=require(_0x9269('0x0'));var compose=require('composable-middleware');var db=require(_0x9269('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x31e155,_0x240c88){if(_0x31e155&&_0x240c88){if(_0x240c88[_0x9269('0x2')]&&_0x240c88['license']){var _0x2ca7c1=_0x240c88[_0x9269('0x2')];var _0x389e1d=_0x240c88[_0x9269('0x3')];var _0x204ea4=_0x2ca7c1[_0x9269('0x4')]('-')[0x4];var _0x3e925c=_0x2ca7c1['split']('-')[0x0];var _0x3d477d=crypto[_0x9269('0x5')](_0x9269('0x6'),util[_0x9269('0x7')](_0x9269('0x8'),_0x204ea4,_0x2ca7c1,_0x3e925c));var _0x18996d=_0x3d477d['update'](_0x389e1d,_0x9269('0x9'),_0x9269('0xa'));_0x18996d+=_0x3d477d[_0x9269('0xb')](_0x9269('0xa'));var _0x6f15ad=JSON['parse'](_0x18996d);return _0x6f15ad[_0x9269('0xc')](_0x31e155)?_0x6f15ad[_0x31e155]:null;}}return null;}function isLimit(_0x45310d,_0x54ca95,_0x306b12,_0x32985a){var _0x340b43=_0x54ca95;return compose()['use'](function(_0x1b23d4,_0x433717,_0x5a1935){return db[_0x9269('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x9269('0xe')](function(_0x20469a){var _0x395e3c=getValueFromLicense(_0x45310d,_0x20469a);return _0x395e3c?_0x395e3c:_0x340b43;})[_0x9269('0xe')](function(_0x2f648a){_0x340b43=_0x2f648a;return _0x306b12[_0x9269('0xf')](_0x32985a);})['then'](function(_0x139f76){if(_0x139f76>=_0x340b43){return _0x433717[_0x9269('0x10')](0x193)['json']({'message':util[_0x9269('0x7')](_0x9269('0x11'),_0x45310d)});}_0x5a1935();})['catch'](function(_0x215de9){_0x5a1935(_0x215de9);});});}function isUserLimit(){return isLimit(_0x9269('0x12'),0x1,db[_0x9269('0x13')],{'where':{'$or':[{'role':_0x9269('0x14')},{'role':_0x9269('0x15')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x9e9a=['utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64'];(function(_0xdf5912,_0x21b9b3){var _0x301092=function(_0x135206){while(--_0x135206){_0xdf5912['push'](_0xdf5912['shift']());}};_0x301092(++_0x21b9b3);}(_0x9e9a,0x89));var _0xa9e9=function(_0x4fca8e,_0x4c2162){_0x4fca8e=_0x4fca8e-0x0;var _0x23f51d=_0x9e9a[_0x4fca8e];return _0x23f51d;};'use strict';var crypto=require(_0xa9e9('0x0'));var util=require(_0xa9e9('0x1'));var compose=require(_0xa9e9('0x2'));var db=require(_0xa9e9('0x3'))['db'];var config=require(_0xa9e9('0x4'));function getValueFromLicense(_0x4e1507,_0xa9f903){if(_0x4e1507&&_0xa9f903){if(_0xa9f903[_0xa9e9('0x5')]&&_0xa9f903[_0xa9e9('0x6')]){var _0x66c532=_0xa9f903['data1'];var _0x87f5a2=_0xa9f903[_0xa9e9('0x6')];var _0x33978b=_0x66c532[_0xa9e9('0x7')]('-')[0x4];var _0x42225a=_0x66c532[_0xa9e9('0x7')]('-')[0x0];var _0x4619b0=crypto[_0xa9e9('0x8')](_0xa9e9('0x9'),util[_0xa9e9('0xa')](_0xa9e9('0xb'),_0x33978b,_0x66c532,_0x42225a));var _0x9f6b96=_0x4619b0['update'](_0x87f5a2,_0xa9e9('0xc'),_0xa9e9('0xd'));_0x9f6b96+=_0x4619b0[_0xa9e9('0xe')](_0xa9e9('0xd'));var _0x9dc587=JSON[_0xa9e9('0xf')](_0x9f6b96);return _0x9dc587[_0xa9e9('0x10')](_0x4e1507)?_0x9dc587[_0x4e1507]:null;}}return null;}function isLimit(_0x4c239c,_0x5e07b5,_0x5984ef,_0x26a605){var _0x570c29=_0x5e07b5;return compose()[_0xa9e9('0x11')](function(_0x5a713f,_0x48faaf,_0x576207){return db[_0xa9e9('0x12')][_0xa9e9('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xa9e9('0x14')](function(_0x49eda2){var _0x1129da=getValueFromLicense(_0x4c239c,_0x49eda2);return _0x1129da?_0x1129da:_0x570c29;})[_0xa9e9('0x14')](function(_0x7d4d9c){_0x570c29=_0x7d4d9c;return _0x5984ef[_0xa9e9('0x15')](_0x26a605);})[_0xa9e9('0x14')](function(_0xa29fd9){if(_0xa29fd9>=_0x570c29){return _0x48faaf[_0xa9e9('0x16')](0x193)['json']({'message':util['format'](_0xa9e9('0x17'),_0x4c239c)});}_0x576207();})[_0xa9e9('0x18')](function(_0x53104c){_0x576207(_0x53104c);});});}function isUserLimit(){return isLimit(_0xa9e9('0x19'),0x1,db[_0xa9e9('0x1a')],{'where':{'$or':[{'role':_0xa9e9('0x1b')},{'role':_0xa9e9('0x1c')}]}});}exports[_0xa9e9('0x1d')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 407d8ca..9248065 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 _0x1ff8=['$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','format','minutes','seconds','parseSearch','sqlOperator','[$or]','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x1ff8,0x1b6));var _0x81ff=function(_0x4d3cd6,_0x4c8e7a){_0x4d3cd6=_0x4d3cd6-0x0;var _0x1a258e=_0x1ff8[_0x4d3cd6];return _0x1a258e;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x81ff('0x0')]=function(_0x168afb){var _0x4b3723={'conditions':[]};_0x4b3723[_0x81ff('0x1')]=_['startsWith'](_0x168afb,_0x81ff('0x2'))?'or':'and';var _0x7e06f0=_0x168afb['replace']('[$and]','')['replace'](_0x81ff('0x2'),'')[_0x81ff('0x3')]('||');for(var _0x8b8624=0x0;_0x8b8624<_0x7e06f0['length'];_0x8b8624++){var _0x3948ef=_0x7e06f0[_0x8b8624][_0x81ff('0x3')](':=');var _0x20632b=_0x3948ef[0x0];var _0x235f35=_0x3948ef[_0x81ff('0x4')](0x1);_0x235f35[_0x81ff('0x5')](function(_0x566179){var _0x1150c7=_0x566179[_0x81ff('0x3')]('[')[_0x81ff('0x6')]();var _0x54aa2e=_0x566179[_0x81ff('0x7')](/\[(.*?)\]/g);_0x54aa2e[_0x81ff('0x5')](function(_0x68469b){var _0x2db280=_0x68469b['split']('[')[_0x81ff('0x8')](function(_0x37ad45){return _0x37ad45[_0x81ff('0x9')](']')>-0x1;})[_0x81ff('0xa')](function(_0x1e268b){return _0x1e268b[_0x81ff('0x3')](']')[0x0];})[0x0];_0x4b3723[_0x81ff('0xb')][_0x81ff('0xc')]({'field':_0x20632b,'operator':_0x1150c7,'value':_0x2db280});});});}return _0x4b3723;};exports[_0x81ff('0xd')]=function(_0x3a41f8,_0x5baa54,_0x1b0e8a){var _0x290d3c={};if(_0x5baa54===_0x81ff('0xe')){if(_0x1b0e8a[_0x81ff('0xf')]===_0x81ff('0x10')){_0x1b0e8a[_0x81ff('0xf')]=_0x81ff('0x11');_0x1b0e8a['value']+=','+_0x1b0e8a[_0x81ff('0x12')];}else if(_[_0x81ff('0x13')]([_0x81ff('0x14'),_0x81ff('0x15')],_0x1b0e8a[_0x81ff('0xf')])){_0x1b0e8a[_0x81ff('0x12')]=moment(_0x1b0e8a[_0x81ff('0x12')])[_0x81ff('0x16')](0x1,_0x81ff('0x17'))['format'](_0x81ff('0x18'));}}if(_0x1b0e8a[_0x81ff('0x19')]){_0x5baa54=_0x1b0e8a[_0x81ff('0x19')];_0x290d3c[_0x81ff('0x1a')]=_0x81ff('0x1b')+_0x3a41f8+'.'+_0x1b0e8a[_0x81ff('0x1c')]+_0x81ff('0x1d')+_0x1b0e8a['castTo']+')\x20'+parseOperator(_0x1b0e8a[_0x81ff('0xf')]);}else{_0x290d3c[_0x81ff('0x1a')]=_0x3a41f8+'.'+_0x1b0e8a[_0x81ff('0x1c')]+'\x20'+parseOperator(_0x1b0e8a[_0x81ff('0xf')]);}if(_[_0x81ff('0x13')](['$ne','$notIn'],_0x1b0e8a['operator']))_0x290d3c['text']='('+_0x290d3c[_0x81ff('0x1a')]+'\x20OR\x20'+_0x3a41f8+'.'+_0x1b0e8a[_0x81ff('0x1c')]+'\x20IS\x20NULL)';_0x290d3c[_0x81ff('0x12')]=parseValue(_0x5baa54,_0x1b0e8a[_0x81ff('0xf')],_0x1b0e8a[_0x81ff('0x12')]);return _0x290d3c;};function parseOperator(_0x4af728){var _0x13bdd2;switch(_0x4af728){case _0x81ff('0x1e'):_0x13bdd2=_0x81ff('0x1f');break;case'$notIn':_0x13bdd2=_0x81ff('0x20');break;case _0x81ff('0x10'):_0x13bdd2=_0x81ff('0x21');break;case _0x81ff('0x22'):_0x13bdd2=_0x81ff('0x23');break;case _0x81ff('0x24'):case _0x81ff('0x25'):case _0x81ff('0x26'):_0x13bdd2='LIKE\x20?';break;case _0x81ff('0x27'):_0x13bdd2=_0x81ff('0x28');break;case'$gt':_0x13bdd2=_0x81ff('0x29');break;case _0x81ff('0x15'):_0x13bdd2=_0x81ff('0x2a');break;case _0x81ff('0x2b'):_0x13bdd2=_0x81ff('0x2c');break;case _0x81ff('0x11'):_0x13bdd2='BETWEEN\x20?\x20AND\x20?';break;}return _0x13bdd2;}function parseValue(_0x2bf672,_0x577e9e,_0x36ac08){var _0x458474={'start':undefined,'end':undefined};switch(_0x577e9e){case _0x81ff('0x1e'):case'$notIn':_0x458474[_0x81ff('0x2d')]=_0x36ac08[_0x81ff('0x3')](',');break;case _0x81ff('0x24'):_0x458474[_0x81ff('0x2d')]='%'+_0x36ac08+'%';break;case _0x81ff('0x25'):_0x458474['start']=_0x36ac08+'%';break;case _0x81ff('0x26'):_0x458474['start']='%'+_0x36ac08;break;case _0x81ff('0x11'):var _0x4227c8=_0x36ac08[_0x81ff('0x3')](',');var _0x36ac08=_0x4227c8[_0x81ff('0x6')]();var _0x4a78cb=_0x4227c8[_0x81ff('0x2e')]();if(_0x2bf672==='DATE'){_0x36ac08=moment(_0x36ac08)[_0x81ff('0x2f')](0x0,!![])[_0x81ff('0x30')]();_0x4a78cb=moment(_0x4a78cb)[_0x81ff('0x2f')](0x0,!![])['add'](0x17,'hours')[_0x81ff('0x16')](0x3b,_0x81ff('0x31'))[_0x81ff('0x16')](0x3b,_0x81ff('0x32'))[_0x81ff('0x30')]();}_0x458474={'start':_0x36ac08,'end':_0x4a78cb};break;default:_0x458474[_0x81ff('0x2d')]=_0x36ac08;break;}return _0x458474;} \ No newline at end of file +var _0xa1df=['startsWith','and','replace','[$and]','[$or]','split','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','castTo','text','\x20AS\x20','$ne','$notIn','\x20IS\x20NULL)','IN\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in','start','$endsWith','utcOffset','format','minutes','seconds','lodash','moment','parseSearch','sqlOperator'];(function(_0x6f1f57,_0x6510a4){var _0x51dcf9=function(_0x2770c4){while(--_0x2770c4){_0x6f1f57['push'](_0x6f1f57['shift']());}};_0x51dcf9(++_0x6510a4);}(_0xa1df,0x66));var _0xfa1d=function(_0x309c51,_0x163281){_0x309c51=_0x309c51-0x0;var _0x4bcfb2=_0xa1df[_0x309c51];return _0x4bcfb2;};'use strict';var _=require(_0xfa1d('0x0'));var moment=require(_0xfa1d('0x1'));exports[_0xfa1d('0x2')]=function(_0x34ef36){var _0x3128b1={'conditions':[]};_0x3128b1[_0xfa1d('0x3')]=_[_0xfa1d('0x4')](_0x34ef36,'[$or]')?'or':_0xfa1d('0x5');var _0x220218=_0x34ef36[_0xfa1d('0x6')](_0xfa1d('0x7'),'')['replace'](_0xfa1d('0x8'),'')['split']('||');for(var _0x4dea1c=0x0;_0x4dea1c<_0x220218['length'];_0x4dea1c++){var _0x5b1fa0=_0x220218[_0x4dea1c][_0xfa1d('0x9')](':=');var _0x5452f9=_0x5b1fa0[0x0];var _0x76be87=_0x5b1fa0['slice'](0x1);_0x76be87[_0xfa1d('0xa')](function(_0x4b97dd){var _0x1aa9ec=_0x4b97dd['split']('[')[_0xfa1d('0xb')]();var _0x3e41fa=_0x4b97dd[_0xfa1d('0xc')](/\[(.*?)\]/g);_0x3e41fa[_0xfa1d('0xa')](function(_0x1d8b0c){var _0x13b89b=_0x1d8b0c[_0xfa1d('0x9')]('[')[_0xfa1d('0xd')](function(_0x5a2bcc){return _0x5a2bcc[_0xfa1d('0xe')](']')>-0x1;})[_0xfa1d('0xf')](function(_0x3bbc89){return _0x3bbc89[_0xfa1d('0x9')](']')[0x0];})[0x0];_0x3128b1[_0xfa1d('0x10')][_0xfa1d('0x11')]({'field':_0x5452f9,'operator':_0x1aa9ec,'value':_0x13b89b});});});}return _0x3128b1;};exports[_0xfa1d('0x12')]=function(_0x5ac9a7,_0x38055b,_0xbfa45e){var _0x3cb058={};if(_0x38055b===_0xfa1d('0x13')){if(_0xbfa45e[_0xfa1d('0x14')]===_0xfa1d('0x15')){_0xbfa45e['operator']='$between';_0xbfa45e[_0xfa1d('0x16')]+=','+_0xbfa45e[_0xfa1d('0x16')];}else if(_[_0xfa1d('0x17')]([_0xfa1d('0x18'),_0xfa1d('0x19')],_0xbfa45e['operator'])){_0xbfa45e[_0xfa1d('0x16')]=moment(_0xbfa45e[_0xfa1d('0x16')])[_0xfa1d('0x1a')](0x1,_0xfa1d('0x1b'))['format']('YYYY-MM-DD');}}if(_0xbfa45e['castTo']){_0x38055b=_0xbfa45e[_0xfa1d('0x1c')];_0x3cb058[_0xfa1d('0x1d')]='CAST('+_0x5ac9a7+'.'+_0xbfa45e['field']+_0xfa1d('0x1e')+_0xbfa45e[_0xfa1d('0x1c')]+')\x20'+parseOperator(_0xbfa45e[_0xfa1d('0x14')]);}else{_0x3cb058['text']=_0x5ac9a7+'.'+_0xbfa45e['field']+'\x20'+parseOperator(_0xbfa45e[_0xfa1d('0x14')]);}if(_[_0xfa1d('0x17')]([_0xfa1d('0x1f'),_0xfa1d('0x20')],_0xbfa45e['operator']))_0x3cb058[_0xfa1d('0x1d')]='('+_0x3cb058['text']+'\x20OR\x20'+_0x5ac9a7+'.'+_0xbfa45e['field']+_0xfa1d('0x21');_0x3cb058[_0xfa1d('0x16')]=parseValue(_0x38055b,_0xbfa45e['operator'],_0xbfa45e[_0xfa1d('0x16')]);return _0x3cb058;};function parseOperator(_0x1950ca){var _0x41df2c;switch(_0x1950ca){case'$in':_0x41df2c=_0xfa1d('0x22');break;case'$notIn':_0x41df2c='NOT\x20IN\x20?';break;case _0xfa1d('0x15'):_0x41df2c='=\x20?';break;case _0xfa1d('0x1f'):_0x41df2c=_0xfa1d('0x23');break;case _0xfa1d('0x24'):case _0xfa1d('0x25'):case'$endsWith':_0x41df2c=_0xfa1d('0x26');break;case _0xfa1d('0x27'):_0x41df2c=_0xfa1d('0x28');break;case _0xfa1d('0x18'):_0x41df2c='>\x20?';break;case _0xfa1d('0x19'):_0x41df2c=_0xfa1d('0x29');break;case _0xfa1d('0x2a'):_0x41df2c=_0xfa1d('0x2b');break;case _0xfa1d('0x2c'):_0x41df2c=_0xfa1d('0x2d');break;}return _0x41df2c;}function parseValue(_0x1b4f70,_0x3883bf,_0x544be3){var _0x2a28f8={'start':undefined,'end':undefined};switch(_0x3883bf){case _0xfa1d('0x2e'):case _0xfa1d('0x20'):_0x2a28f8['start']=_0x544be3[_0xfa1d('0x9')](',');break;case _0xfa1d('0x24'):_0x2a28f8['start']='%'+_0x544be3+'%';break;case _0xfa1d('0x25'):_0x2a28f8[_0xfa1d('0x2f')]=_0x544be3+'%';break;case _0xfa1d('0x30'):_0x2a28f8['start']='%'+_0x544be3;break;case _0xfa1d('0x2c'):var _0x41a4db=_0x544be3[_0xfa1d('0x9')](',');var _0x544be3=_0x41a4db['shift']();var _0x2981b5=_0x41a4db['pop']();if(_0x1b4f70==='DATE'){_0x544be3=moment(_0x544be3)[_0xfa1d('0x31')](0x0,!![])[_0xfa1d('0x32')]();_0x2981b5=moment(_0x2981b5)['utcOffset'](0x0,!![])[_0xfa1d('0x1a')](0x17,'hours')['add'](0x3b,_0xfa1d('0x33'))['add'](0x3b,_0xfa1d('0x34'))[_0xfa1d('0x32')]();}_0x2a28f8={'start':_0x544be3,'end':_0x2981b5};break;default:_0x2a28f8[_0xfa1d('0x2f')]=_0x544be3;break;}return _0x2a28f8;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 4412a49..4f1e4ef 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 _0x9957=['forOwn','type','DATE','isPlainObject','$gte','utc','format','$lte','YYYY-MM-DD','subtract','uniqueid','isArray','limit','map','priority','cast','col','unsigned','substr','ASC','omit','length','isObject','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','forEach','replace','join','$id','query','model','name','attributes','nolimit','offset','sort','where','pick','filter','merge','lower','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var sequelize=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x10a05d){var _0x5b96eb=['ne'];try{var _0x86c128=JSON[_0x7995('0x3')](_0x10a05d);var _0x1902b4=Object[_0x7995('0x4')](_0x86c128)[0x0];return _0x5b96eb['includes'](_0x1902b4);}catch(_0x744bea){return![];}}function getOperatorValue(_0x1a36d8){var _0x137b6b=JSON[_0x7995('0x3')](_0x1a36d8);var _0xbda126=Object[_0x7995('0x4')](_0x137b6b)[0x0];var _0x4996ca=_0x137b6b[_0xbda126];return{['$'+_0xbda126]:_0x4996ca};}exports[_0x7995('0x5')]=function(_0x1cad37){var _0x4a64f7=null;if(_0x1cad37){_0x4a64f7=_0x1cad37[_0x7995('0x6')](',');}return _0x4a64f7;};exports[_0x7995('0x7')]=function(_0x18c8a3,_0x35b5fe){var _0x3c1d19={};if(!_[_0x7995('0x8')](_0x18c8a3)){_[_0x7995('0x9')](_0x18c8a3,function(_0x524f7b,_0x245143){try{if(_0x35b5fe){var _0x41c652=_['find'](_0x35b5fe,{'name':_0x245143})||{};if(hasSequelizeOperator(_0x524f7b)){_0x3c1d19[_0x245143]=getOperatorValue(_0x524f7b);}else if(_0x41c652[_0x7995('0xa')]===_0x7995('0xb')&&_[_0x7995('0xc')](_0x524f7b)){var _0x385f00=JSON[_0x7995('0x3')](_0x524f7b);var _0x23999f={'$gte':moment(moment(_0x385f00[_0x7995('0xd')])['format']('YYYY-MM-DD'))[_0x7995('0xe')]()[_0x7995('0xf')](),'$lte':moment(moment(_0x385f00[_0x7995('0x10')])[_0x7995('0xf')](_0x7995('0x11')))[_0x7995('0xe')]()[_0x7995('0x12')](0x1,'s')[_0x7995('0xf')]()};_0x3c1d19[_0x245143]=_0x23999f;}else if(_0x41c652['name']===_0x7995('0x13')){_0x3c1d19[_0x245143]=_0x524f7b;}else{_0x3c1d19[_0x245143]=_['isArray'](_0x524f7b)?_0x524f7b:JSON[_0x7995('0x3')](_0x524f7b);}}else{_0x3c1d19[_0x245143]=_[_0x7995('0x14')](_0x524f7b)?_0x524f7b:JSON[_0x7995('0x3')](_0x524f7b);}}catch(_0x291317){_0x3c1d19[_0x245143]=_0x524f7b[_0x7995('0x6')](',');}});}return _0x3c1d19;};exports[_0x7995('0x15')]=function(_0x4faa60){_0x4faa60=parseInt(_0x4faa60,0xa);if(!_0x4faa60||_0x4faa60<0x0){_0x4faa60=LIMIT_VALUE;}return _0x4faa60;};exports['offset']=function(_0x2536c8){_0x2536c8=parseInt(_0x2536c8,0xa);if(!_0x2536c8||_0x2536c8<0x0){_0x2536c8=0x0;}return _0x2536c8;};exports['sort']=function(_0x555f74){var _0x3ec178,_0x3d463e=null;if(_0x555f74){_0x3ec178=_0x555f74['split'](',');_0x3d463e=_[_0x7995('0x16')](_0x3ec178,function(_0x51f276){if(_0x51f276['indexOf']('-')===0x0){return[_0x51f276===_0x7995('0x17')?sequelize[_0x7995('0x18')](sequelize[_0x7995('0x19')](_0x7995('0x17')),_0x7995('0x1a')):_0x51f276[_0x7995('0x1b')](0x1),'DESC'];}else{return[_0x51f276===_0x7995('0x17')?sequelize[_0x7995('0x18')](sequelize[_0x7995('0x19')](_0x7995('0x17')),_0x7995('0x1a')):_0x51f276,_0x7995('0x1c')];}});}return _0x3d463e;};exports[_0x7995('0x1d')]=function(_0x472195,_0x59405a){if(_[_0x7995('0x8')](_0x472195)){return _0x472195;}if(_[_0x7995('0x14')](_0x472195)){for(var _0x401dc3=0x0;_0x401dc3<_0x472195[_0x7995('0x1e')];_0x401dc3+=0x1){_0x472195[_0x401dc3]=this[_0x7995('0x1d')](_0x472195[_0x401dc3],_0x59405a);}return _0x472195;}if(!_[_0x7995('0x1f')](_0x472195)){return _0x472195;}if(_['isString'](_0x59405a)){_0x59405a=[_0x59405a];}if(!_[_0x7995('0x14')](_0x59405a)){return _0x472195;}for(var _0x5911c3=0x0;_0x5911c3<_0x59405a[_0x7995('0x1e')];_0x5911c3+=0x1){_[_0x7995('0x20')](_0x472195,_0x59405a[_0x5911c3]);}for(var _0xf16cc2 in _0x472195){if(_0x472195[_0x7995('0x21')](_0xf16cc2)){_0x472195[_0xf16cc2]=this[_0x7995('0x1d')](_0x472195[_0xf16cc2],_0x59405a);}}return _0x472195;};exports['isNumeric']=function(_0x9b2a15){return _0x9b2a15['match'](RegExp(_0x7995('0x22')))?!![]:![];};exports[_0x7995('0x23')]=function(_0x4253e5){return _0x4253e5['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x48e573){var _0x3573be=[];_0x48e573[_0x7995('0x6')](/[ ,]+/)[_0x7995('0x24')](function(_0x2b874d){_0x2b874d=_0x2b874d[_0x7995('0x25')](/([^:]")"+/g,'$1');_0x2b874d='+'+_0x2b874d+'*';var _0x1ca460=/[ `!@#$%^&*()_\-?~]/;if(_0x2b874d['match'](_0x1ca460))_0x2b874d='\x22'+_0x2b874d+'\x22';_0x3573be['push'](_0x2b874d);});return _0x3573be[_0x7995('0x26')]('\x20');};exports['getOptions']=function(_0x553671,_0x3eb566,_0x29fac5){var _0x1e9fa4={},_0x1f7d27={};if(_0x3eb566['query'][_0x7995('0x27')]){_0x3eb566[_0x7995('0x28')]['id']=_0x3eb566['query']['$id'];delete _0x3eb566['query'][_0x7995('0x27')];}_0x1e9fa4[_0x7995('0x29')]=_['map'](_0x553671,_0x7995('0x2a'));_0x1e9fa4['query']=_[_0x7995('0x4')](_0x3eb566[_0x7995('0x28')]);_0x1e9fa4[_0x7995('0x7')]=_['intersection'](_0x1e9fa4['model'],_0x1e9fa4[_0x7995('0x28')]);_0x1f7d27['attributes']=_['intersection'](_0x1e9fa4[_0x7995('0x29')],this[_0x7995('0x5')](_0x3eb566['query'][_0x7995('0x5')]));_0x1f7d27[_0x7995('0x2b')]=_0x1f7d27[_0x7995('0x2b')][_0x7995('0x1e')]?_0x1f7d27[_0x7995('0x2b')]:_0x1e9fa4['model'];if(!_0x3eb566[_0x7995('0x28')][_0x7995('0x21')](_0x7995('0x2c'))){_0x1f7d27[_0x7995('0x15')]=this['limit'](_0x3eb566[_0x7995('0x28')][_0x7995('0x15')]);_0x1f7d27[_0x7995('0x2d')]=this[_0x7995('0x2d')](_0x3eb566[_0x7995('0x28')][_0x7995('0x2d')]);}_0x1f7d27['order']=this[_0x7995('0x2e')](_0x3eb566[_0x7995('0x28')][_0x7995('0x2e')]);_0x1f7d27[_0x7995('0x2f')]=this[_0x7995('0x7')](_[_0x7995('0x30')](_0x3eb566[_0x7995('0x28')],_0x1e9fa4[_0x7995('0x7')]),_0x553671);if(_0x3eb566[_0x7995('0x28')][_0x7995('0x31')]){var _0x6fe77b=_0x553671;var _0x270d52=_0x3eb566[_0x7995('0x28')]['filter'];if(typeof _0x270d52==='object'){_0x6fe77b=_[_0x7995('0x31')](_0x553671,function(_0x7325e8){return _['includes'](_0x270d52['columns'],_0x7325e8[_0x7995('0x2a')]);});_0x270d52=_0x270d52['value'];}_0x1f7d27['where']=_[_0x7995('0x32')](_0x1f7d27[_0x7995('0x2f')],{'$or':_[_0x7995('0x16')](_0x6fe77b,function(_0x576b96){if(_0x576b96[_0x7995('0xa')]!=='VIRTUAL'){if(_0x29fac5){return sequelize[_0x7995('0x2f')](sequelize['fn']('lower',sequelize['col'](_0x576b96[_0x7995('0x2a')])),{'$like':sequelize['fn'](_0x7995('0x33'),'%'+_0x3eb566[_0x7995('0x28')][_0x7995('0x31')]+'%')});}else{var _0x599ecb={};_0x599ecb[_0x576b96[_0x7995('0x2a')]]={'$like':'%'+_0x3eb566[_0x7995('0x28')][_0x7995('0x31')]+'%'};return _0x599ecb;}}})});}_0x1f7d27=_[_0x7995('0x32')]({},_0x1f7d27,_0x3eb566['options']);return _0x1f7d27;}; \ No newline at end of file +var _0xe14b=['getFullTextValue','forEach','replace','push','join','getOptions','query','model','intersection','attributes','fields','nolimit','limit','order','where','pick','filter','object','includes','columns','name','merge','VIRTUAL','lower','options','lodash','sequelize','parse','keys','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','uniqueid','isArray','offset','sort','map','indexOf','priority','col','unsigned','DESC','cast','omit','isEmpty','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail'];(function(_0xe1fa6b,_0x24c4c9){var _0x16e21f=function(_0x2cd9bd){while(--_0x2cd9bd){_0xe1fa6b['push'](_0xe1fa6b['shift']());}};_0x16e21f(++_0x24c4c9);}(_0xe14b,0x93));var _0xbe14=function(_0x3046ac,_0x247477){_0x3046ac=_0x3046ac-0x0;var _0x48b92c=_0xe14b[_0x3046ac];return _0x48b92c;};'use strict';var _=require(_0xbe14('0x0'));var sequelize=require(_0xbe14('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5cc4d8){var _0x11c3a0=['ne'];try{var _0x36393a=JSON['parse'](_0x5cc4d8);var _0x7d3665=Object['keys'](_0x36393a)[0x0];return _0x11c3a0['includes'](_0x7d3665);}catch(_0x1833e3){return![];}}function getOperatorValue(_0x2d1a4a){var _0x1fe204=JSON[_0xbe14('0x2')](_0x2d1a4a);var _0x1d9ade=Object[_0xbe14('0x3')](_0x1fe204)[0x0];var _0x196fca=_0x1fe204[_0x1d9ade];return{['$'+_0x1d9ade]:_0x196fca};}exports['fields']=function(_0x50f909){var _0x496063=null;if(_0x50f909){_0x496063=_0x50f909[_0xbe14('0x4')](',');}return _0x496063;};exports[_0xbe14('0x5')]=function(_0xd68cd7,_0x90b4f){var _0x53c7ea={};if(!_['isEmpty'](_0xd68cd7)){_[_0xbe14('0x6')](_0xd68cd7,function(_0x3f70cb,_0x4935cc){try{if(_0x90b4f){var _0x254c3b=_[_0xbe14('0x7')](_0x90b4f,{'name':_0x4935cc})||{};if(hasSequelizeOperator(_0x3f70cb)){_0x53c7ea[_0x4935cc]=getOperatorValue(_0x3f70cb);}else if(_0x254c3b[_0xbe14('0x8')]===_0xbe14('0x9')&&_[_0xbe14('0xa')](_0x3f70cb)){var _0x3b898d=JSON[_0xbe14('0x2')](_0x3f70cb);var _0x2850cb={'$gte':moment(moment(_0x3b898d[_0xbe14('0xb')])[_0xbe14('0xc')](_0xbe14('0xd')))[_0xbe14('0xe')]()[_0xbe14('0xc')](),'$lte':moment(moment(_0x3b898d['$lte'])['format'](_0xbe14('0xd')))[_0xbe14('0xe')]()[_0xbe14('0xf')](0x1,'s')[_0xbe14('0xc')]()};_0x53c7ea[_0x4935cc]=_0x2850cb;}else if(_0x254c3b['name']===_0xbe14('0x10')){_0x53c7ea[_0x4935cc]=_0x3f70cb;}else{_0x53c7ea[_0x4935cc]=_[_0xbe14('0x11')](_0x3f70cb)?_0x3f70cb:JSON[_0xbe14('0x2')](_0x3f70cb);}}else{_0x53c7ea[_0x4935cc]=_[_0xbe14('0x11')](_0x3f70cb)?_0x3f70cb:JSON[_0xbe14('0x2')](_0x3f70cb);}}catch(_0x29ab73){_0x53c7ea[_0x4935cc]=_0x3f70cb[_0xbe14('0x4')](',');}});}return _0x53c7ea;};exports['limit']=function(_0x137ee5){_0x137ee5=parseInt(_0x137ee5,0xa);if(!_0x137ee5||_0x137ee5<0x0){_0x137ee5=LIMIT_VALUE;}return _0x137ee5;};exports[_0xbe14('0x12')]=function(_0x329588){_0x329588=parseInt(_0x329588,0xa);if(!_0x329588||_0x329588<0x0){_0x329588=0x0;}return _0x329588;};exports[_0xbe14('0x13')]=function(_0x3249da){var _0x37e4c1,_0x59a9e3=null;if(_0x3249da){_0x37e4c1=_0x3249da[_0xbe14('0x4')](',');_0x59a9e3=_[_0xbe14('0x14')](_0x37e4c1,function(_0x417c8d){if(_0x417c8d[_0xbe14('0x15')]('-')===0x0){return[_0x417c8d===_0xbe14('0x16')?sequelize['cast'](sequelize[_0xbe14('0x17')]('priority'),_0xbe14('0x18')):_0x417c8d['substr'](0x1),_0xbe14('0x19')];}else{return[_0x417c8d==='priority'?sequelize[_0xbe14('0x1a')](sequelize[_0xbe14('0x17')]('priority'),_0xbe14('0x18')):_0x417c8d,'ASC'];}});}return _0x59a9e3;};exports[_0xbe14('0x1b')]=function(_0x4851f8,_0x36a21e){if(_[_0xbe14('0x1c')](_0x4851f8)){return _0x4851f8;}if(_[_0xbe14('0x11')](_0x4851f8)){for(var _0x39cc81=0x0;_0x39cc81<_0x4851f8[_0xbe14('0x1d')];_0x39cc81+=0x1){_0x4851f8[_0x39cc81]=this[_0xbe14('0x1b')](_0x4851f8[_0x39cc81],_0x36a21e);}return _0x4851f8;}if(!_['isObject'](_0x4851f8)){return _0x4851f8;}if(_[_0xbe14('0x1e')](_0x36a21e)){_0x36a21e=[_0x36a21e];}if(!_[_0xbe14('0x11')](_0x36a21e)){return _0x4851f8;}for(var _0x391556=0x0;_0x391556<_0x36a21e[_0xbe14('0x1d')];_0x391556+=0x1){_['unset'](_0x4851f8,_0x36a21e[_0x391556]);}for(var _0x16f884 in _0x4851f8){if(_0x4851f8[_0xbe14('0x1f')](_0x16f884)){_0x4851f8[_0x16f884]=this['omit'](_0x4851f8[_0x16f884],_0x36a21e);}}return _0x4851f8;};exports[_0xbe14('0x20')]=function(_0x3b3e84){return _0x3b3e84[_0xbe14('0x21')](RegExp(_0xbe14('0x22')))?!![]:![];};exports[_0xbe14('0x23')]=function(_0x36d4b2){return _0x36d4b2[_0xbe14('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0xbe14('0x24')]=function(_0x4168c8){var _0x16a159=[];_0x4168c8[_0xbe14('0x4')](/[ ,]+/)[_0xbe14('0x25')](function(_0x39dc0a){_0x39dc0a=_0x39dc0a[_0xbe14('0x26')](/([^:]")"+/g,'$1');_0x39dc0a='+'+_0x39dc0a+'*';var _0x223f7a=/[ `!@#$%^&*()_\-?~]/;if(_0x39dc0a[_0xbe14('0x21')](_0x223f7a))_0x39dc0a='\x22'+_0x39dc0a+'\x22';_0x16a159[_0xbe14('0x27')](_0x39dc0a);});return _0x16a159[_0xbe14('0x28')]('\x20');};exports[_0xbe14('0x29')]=function(_0x14e7c4,_0x581e86,_0x2e33e1){var _0x499793={},_0x58f8de={};if(_0x581e86[_0xbe14('0x2a')]['$id']){_0x581e86[_0xbe14('0x2a')]['id']=_0x581e86[_0xbe14('0x2a')]['$id'];delete _0x581e86['query']['$id'];}_0x499793[_0xbe14('0x2b')]=_[_0xbe14('0x14')](_0x14e7c4,'name');_0x499793[_0xbe14('0x2a')]=_[_0xbe14('0x3')](_0x581e86[_0xbe14('0x2a')]);_0x499793[_0xbe14('0x5')]=_[_0xbe14('0x2c')](_0x499793['model'],_0x499793['query']);_0x58f8de[_0xbe14('0x2d')]=_['intersection'](_0x499793['model'],this['fields'](_0x581e86[_0xbe14('0x2a')][_0xbe14('0x2e')]));_0x58f8de[_0xbe14('0x2d')]=_0x58f8de[_0xbe14('0x2d')][_0xbe14('0x1d')]?_0x58f8de[_0xbe14('0x2d')]:_0x499793[_0xbe14('0x2b')];if(!_0x581e86[_0xbe14('0x2a')][_0xbe14('0x1f')](_0xbe14('0x2f'))){_0x58f8de[_0xbe14('0x30')]=this[_0xbe14('0x30')](_0x581e86['query']['limit']);_0x58f8de[_0xbe14('0x12')]=this[_0xbe14('0x12')](_0x581e86[_0xbe14('0x2a')]['offset']);}_0x58f8de[_0xbe14('0x31')]=this[_0xbe14('0x13')](_0x581e86[_0xbe14('0x2a')][_0xbe14('0x13')]);_0x58f8de[_0xbe14('0x32')]=this[_0xbe14('0x5')](_[_0xbe14('0x33')](_0x581e86[_0xbe14('0x2a')],_0x499793[_0xbe14('0x5')]),_0x14e7c4);if(_0x581e86['query'][_0xbe14('0x34')]){var _0x841b71=_0x14e7c4;var _0x3463c4=_0x581e86[_0xbe14('0x2a')][_0xbe14('0x34')];if(typeof _0x3463c4===_0xbe14('0x35')){_0x841b71=_['filter'](_0x14e7c4,function(_0xb0f143){return _[_0xbe14('0x36')](_0x3463c4[_0xbe14('0x37')],_0xb0f143[_0xbe14('0x38')]);});_0x3463c4=_0x3463c4['value'];}_0x58f8de['where']=_[_0xbe14('0x39')](_0x58f8de[_0xbe14('0x32')],{'$or':_[_0xbe14('0x14')](_0x841b71,function(_0x51c859){if(_0x51c859['type']!==_0xbe14('0x3a')){if(_0x2e33e1){return sequelize['where'](sequelize['fn']('lower',sequelize[_0xbe14('0x17')](_0x51c859[_0xbe14('0x38')])),{'$like':sequelize['fn'](_0xbe14('0x3b'),'%'+_0x581e86['query']['filter']+'%')});}else{var _0x5aaa4f={};_0x5aaa4f[_0x51c859[_0xbe14('0x38')]]={'$like':'%'+_0x581e86[_0xbe14('0x2a')][_0xbe14('0x34')]+'%'};return _0x5aaa4f;}}})});}_0x58f8de=_['merge']({},_0x58f8de,_0x581e86[_0xbe14('0x3c')]);return _0x58f8de;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e0ad10f..dcca9bf 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe47c=['passport','cors','moment','./environment','../mysqldb','default','get','production','set','appPath','join','root','public','development','test','client','use','json\x20replacer','toISOString','views','html','ejs','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path'];(function(_0x4322c6,_0x28f126){var _0x4e7537=function(_0x3cf272){while(--_0x3cf272){_0x4322c6['push'](_0x4322c6['shift']());}};_0x4e7537(++_0x28f126);}(_0xe47c,0x144));var _0xce47=function(_0x252782,_0x5b7839){_0x252782=_0x252782-0x0;var _0x5123ea=_0xe47c[_0x252782];return _0x5123ea;};'use strict';var express=require('express');var favicon=require(_0xce47('0x0'));var bodyParser=require(_0xce47('0x1'));var methodOverride=require(_0xce47('0x2'));var cookieParser=require(_0xce47('0x3'));var errorHandler=require(_0xce47('0x4'));var path=require(_0xce47('0x5'));var passport=require(_0xce47('0x6'));var cors=require(_0xce47('0x7'));var moment=require(_0xce47('0x8'));var config=require(_0xce47('0x9'));var db=require(_0xce47('0xa'))['db'];exports[_0xce47('0xb')]=function(_0x2eacd6){var _0x3fb215=_0x2eacd6[_0xce47('0xc')]('env');if(_0x3fb215===_0xce47('0xd')){_0x2eacd6[_0xce47('0xe')](_0xce47('0xf'),path[_0xce47('0x10')](config[_0xce47('0x11')],_0xce47('0x12')));}if(_0x3fb215===_0xce47('0x13')||_0x3fb215===_0xce47('0x14')){_0x2eacd6['set'](_0xce47('0xf'),path[_0xce47('0x10')](config[_0xce47('0x11')],_0xce47('0x15')));_0x2eacd6[_0xce47('0x16')](errorHandler());}_0x2eacd6[_0xce47('0xe')](_0xce47('0x17'),function(_0xc88a5a,_0x229885){if(this[_0xc88a5a]instanceof Date){_0x229885=this[_0xc88a5a][_0xce47('0x18')]()['split']('.')[0x0]+'Z';}return _0x229885;});_0x2eacd6[_0xce47('0x16')](express['static'](_0x2eacd6[_0xce47('0xc')](_0xce47('0xf'))));_0x2eacd6[_0xce47('0xe')](_0xce47('0x19'),config[_0xce47('0x11')]+'/server/views');_0x2eacd6['engine'](_0xce47('0x1a'),require(_0xce47('0x1b'))['renderFile']);_0x2eacd6[_0xce47('0xe')](_0xce47('0x1c'),_0xce47('0x1a'));_0x2eacd6[_0xce47('0x16')](bodyParser[_0xce47('0x1d')]({'limit':_0xce47('0x1e'),'extended':!![]}));_0x2eacd6[_0xce47('0x16')](bodyParser[_0xce47('0x1f')]({'limit':_0xce47('0x1e')}));_0x2eacd6[_0xce47('0x16')](cors());_0x2eacd6['use'](methodOverride());_0x2eacd6['use'](cookieParser());_0x2eacd6[_0xce47('0x16')](passport[_0xce47('0x20')]());}; \ No newline at end of file +var _0x24dd=['method-override','errorhandler','path','cors','moment','./environment','../mysqldb','get','env','production','set','join','root','development','test','client','json\x20replacer','toISOString','split','use','static','appPath','/server/views','engine','html','renderFile','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser'];(function(_0x14d140,_0x4ae4f1){var _0x21fb15=function(_0x460fd9){while(--_0x460fd9){_0x14d140['push'](_0x14d140['shift']());}};_0x21fb15(++_0x4ae4f1);}(_0x24dd,0xa2));var _0xd24d=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x24dd[_0x59d0cc];return _0x2ae79f;};'use strict';var express=require(_0xd24d('0x0'));var favicon=require(_0xd24d('0x1'));var bodyParser=require(_0xd24d('0x2'));var methodOverride=require(_0xd24d('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xd24d('0x4'));var path=require(_0xd24d('0x5'));var passport=require('passport');var cors=require(_0xd24d('0x6'));var moment=require(_0xd24d('0x7'));var config=require(_0xd24d('0x8'));var db=require(_0xd24d('0x9'))['db'];exports['default']=function(_0x2f33d2){var _0x50cddd=_0x2f33d2[_0xd24d('0xa')](_0xd24d('0xb'));if(_0x50cddd===_0xd24d('0xc')){_0x2f33d2[_0xd24d('0xd')]('appPath',path[_0xd24d('0xe')](config[_0xd24d('0xf')],'public'));}if(_0x50cddd===_0xd24d('0x10')||_0x50cddd===_0xd24d('0x11')){_0x2f33d2['set']('appPath',path[_0xd24d('0xe')](config[_0xd24d('0xf')],_0xd24d('0x12')));_0x2f33d2['use'](errorHandler());}_0x2f33d2['set'](_0xd24d('0x13'),function(_0x595cf0,_0x30ccae){if(this[_0x595cf0]instanceof Date){_0x30ccae=this[_0x595cf0][_0xd24d('0x14')]()[_0xd24d('0x15')]('.')[0x0]+'Z';}return _0x30ccae;});_0x2f33d2[_0xd24d('0x16')](express[_0xd24d('0x17')](_0x2f33d2['get'](_0xd24d('0x18'))));_0x2f33d2[_0xd24d('0xd')]('views',config[_0xd24d('0xf')]+_0xd24d('0x19'));_0x2f33d2[_0xd24d('0x1a')](_0xd24d('0x1b'),require('ejs')[_0xd24d('0x1c')]);_0x2f33d2['set'](_0xd24d('0x1d'),_0xd24d('0x1b'));_0x2f33d2[_0xd24d('0x16')](bodyParser['urlencoded']({'limit':_0xd24d('0x1e'),'extended':!![]}));_0x2f33d2['use'](bodyParser[_0xd24d('0x1f')]({'limit':_0xd24d('0x1e')}));_0x2f33d2['use'](cors());_0x2f33d2[_0xd24d('0x16')](methodOverride());_0x2f33d2[_0xd24d('0x16')](cookieParser());_0x2f33d2['use'](passport[_0xd24d('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 39b8990..6479846 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 _0x836d=['macAddress','createHash','substring','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','internal','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','join','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname'];(function(_0x3a634e,_0x273db2){var _0x2ecddb=function(_0x3a9d2d){while(--_0x3a9d2d){_0x3a634e['push'](_0x3a634e['shift']());}};_0x2ecddb(++_0x273db2);}(_0x836d,0x1a3));var _0xd836=function(_0x31a45c,_0x310d4e){_0x31a45c=_0x31a45c-0x0;var _0x47832e=_0x836d[_0x31a45c];return _0x47832e;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xd836('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xd836('0x1'))[_0xd836('0x2')];var config=require(_0xd836('0x3'));function getInterfaces(){var _0x59d0af=[];var _0x37e8f7=os[_0xd836('0x4')]();var _0x126593=_[_0xd836('0x5')](_[_0xd836('0x6')](_0x37e8f7));for(var _0x42b2d9=0x0;_0x42b2d9<_0x126593[_0xd836('0x7')];_0x42b2d9++){var _0x5be8d2=_0x37e8f7[_0x126593[_0x42b2d9]][_0xd836('0x8')](function(_0x5df311){return _0x5df311['family']==='IPv4'&&_0x5df311[_0xd836('0x9')]===![];});_0x59d0af=_0x59d0af['concat'](_0x5be8d2);}return _0x59d0af;}function getFirstInterface(){var _0x1b3730=_[_0xd836('0xa')](getInterfaces());return{'macAddress':_0x1b3730&&_0x1b3730['mac']?_0x1b3730[_0xd836('0xb')]:_0xd836('0xc'),'ipAddress':_0x1b3730&&_0x1b3730[_0xd836('0xd')]?_0x1b3730[_0xd836('0xd')]:'127.0.0.1'};}exports[_0xd836('0xe')]=getFirstInterface;function getCPUhash(){var _0xfb687a=_[_0xd836('0x5')](os[_0xd836('0xf')]()[_0xd836('0x10')](function(_0x52351a){return _0x52351a['model'];}))[_0xd836('0x11')](':');return crypto['createHash'](_0xd836('0x12'))[_0xd836('0x13')](_0xfb687a)[_0xd836('0x14')](_0xd836('0x15'));}exports[_0xd836('0x16')]=function(){var _0x5c8819=os['platform']();var _0x21639a=/[0-9a-f-]{36}/;if(config[_0xd836('0x17')]&&_0x21639a[_0xd836('0x18')](config['licenseToken'])){return config[_0xd836('0x17')];}else if(_0x5c8819===_0xd836('0x19')){return exec(_0xd836('0x1a'),{'encoding':'utf8'})[_0xd836('0x1b')]('\x0d\x0a','');}else{var _0x2c8602=getFirstInterface();var _0x3d3ebb=getCPUhash();var _0x4e9742=_0x3d3ebb+'|'+os[_0xd836('0x1c')]()+'|'+_0x2c8602[_0xd836('0x1d')]+'|'+_0x2c8602['ipAddress'];var _0x59f0b6=crypto[_0xd836('0x1e')](_0xd836('0x12'))[_0xd836('0x13')](_0x4e9742)[_0xd836('0x14')](_0xd836('0x15'));return _0x59f0b6['substring'](0x0,0x8)+'-'+_0x59f0b6[_0xd836('0x1f')](0x8,0xc)+'-'+_0x59f0b6['substring'](0xc,0x10)+'-'+_0x59f0b6[_0xd836('0x1f')](0x10,0x14)+'-'+_0x59f0b6['substring'](0x14);}}; \ No newline at end of file +var _0x4203=['map','model','update','digest','hex','platform','licenseToken','replace','hostname','macAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','length','filter','family','IPv4','concat','head','address','127.0.0.1','getFirstInterface','cpus'];(function(_0x3dde40,_0x4e105f){var _0x2dd7d0=function(_0x334a5b){while(--_0x334a5b){_0x3dde40['push'](_0x3dde40['shift']());}};_0x2dd7d0(++_0x4e105f);}(_0x4203,0x10f));var _0x3420=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x4203[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x3420('0x0'));var machine=require(_0x3420('0x1'));var exec=require(_0x3420('0x2'))[_0x3420('0x3')];var config=require('../environment');function getInterfaces(){var _0x13f0ef=[];var _0x13d3de=os['networkInterfaces']();var _0x2e11ee=_[_0x3420('0x4')](_['keys'](_0x13d3de));for(var _0x40ca64=0x0;_0x40ca64<_0x2e11ee[_0x3420('0x5')];_0x40ca64++){var _0x28c251=_0x13d3de[_0x2e11ee[_0x40ca64]][_0x3420('0x6')](function(_0x685882){return _0x685882[_0x3420('0x7')]===_0x3420('0x8')&&_0x685882['internal']===![];});_0x13f0ef=_0x13f0ef[_0x3420('0x9')](_0x28c251);}return _0x13f0ef;}function getFirstInterface(){var _0x1e3213=_[_0x3420('0xa')](getInterfaces());return{'macAddress':_0x1e3213&&_0x1e3213['mac']?_0x1e3213['mac']:'00:00:00:00:00:00','ipAddress':_0x1e3213&&_0x1e3213[_0x3420('0xb')]?_0x1e3213[_0x3420('0xb')]:_0x3420('0xc')};}exports[_0x3420('0xd')]=getFirstInterface;function getCPUhash(){var _0x32dafc=_[_0x3420('0x4')](os[_0x3420('0xe')]()[_0x3420('0xf')](function(_0x1f74cd){return _0x1f74cd[_0x3420('0x10')];}))['join'](':');return crypto['createHash']('md5')[_0x3420('0x11')](_0x32dafc)[_0x3420('0x12')](_0x3420('0x13'));}exports['getUuid']=function(){var _0x3abf5f=os[_0x3420('0x14')]();var _0x1e46cd=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x1e46cd['test'](config[_0x3420('0x15')])){return config[_0x3420('0x15')];}else if(_0x3abf5f==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x3420('0x16')]('\x0d\x0a','');}else{var _0x49ab92=getFirstInterface();var _0x5cbbdf=getCPUhash();var _0x3db9af=_0x5cbbdf+'|'+os[_0x3420('0x17')]()+'|'+_0x49ab92[_0x3420('0x18')]+'|'+_0x49ab92['ipAddress'];var _0x28a851=crypto['createHash']('md5')['update'](_0x3db9af)[_0x3420('0x12')](_0x3420('0x13'));return _0x28a851[_0x3420('0x19')](0x0,0x8)+'-'+_0x28a851['substring'](0x8,0xc)+'-'+_0x28a851['substring'](0xc,0x10)+'-'+_0x28a851[_0x3420('0x19')](0x10,0x14)+'-'+_0x28a851[_0x3420('0x19')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 111b929..4432ba8 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 _0x86bf=['update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','message','getUuid','License','spread','default','util','version','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','catch','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x86bf,0x170));var _0xf86b=function(_0x1eec9e,_0x2ceabc){_0x1eec9e=_0x1eec9e-0x0;var _0x42649a=_0x86bf[_0x1eec9e];return _0x42649a;};'use strict';var util=require(_0xf86b('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xf86b('0x1'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0xf86b('0x2'))(_0xf86b('0x3'));var HOST=_0xf86b('0x4');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3e658a){return new BPromise(function(_0x48d2b4,_0x222142){var _0x99c31e=util['format'](_0xf86b('0x5'),HOST,_0x3e658a,module['exports'][_0xf86b('0x1')]);if(oldToken){_0x99c31e=util[_0xf86b('0x6')](_0xf86b('0x7'),HOST,_0x3e658a,module[_0xf86b('0x8')][_0xf86b('0x1')],oldToken);}var _0x17fc74={'uri':_0x99c31e,'method':_0xf86b('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x17fc74)['then'](function(_0x240249){_0x48d2b4(_0x240249);})[_0xf86b('0xa')](function(_0x183f9d){_0x222142(_0x183f9d);});});}function manageLicense(_0x32caa5,_0x16ece8){var _0x56013f=_0x16ece8['get']({'plain':!![]});if(!isOldTokenSent&&_0x56013f[_0xf86b('0xb')]!==_0x32caa5&&!_0x56013f[_0xf86b('0xc')]){oldToken=_0x56013f['data1'];}httpRequest(_0x32caa5)[_0xf86b('0xd')](function(_0x933d0d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x933d0d[_0xf86b('0xe')]){isOldTokenSent=![];if(!_0x56013f[_0xf86b('0x3')]&&_0x56013f[_0xf86b('0x3')]!=_0x933d0d[_0xf86b('0x3')]||_0x56013f[_0xf86b('0x3')]&&_0x56013f[_0xf86b('0xc')]){logger[_0xf86b('0xf')](_0xf86b('0x10'));}if(_0x56013f[_0xf86b('0x3')]&&!_0x56013f[_0xf86b('0xc')]&&_0x56013f['license']!=_0x933d0d['license']){logger[_0xf86b('0xf')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x56013f['license']&&!_0x56013f[_0xf86b('0xc')]&&_0x56013f[_0xf86b('0x3')]==_0x933d0d[_0xf86b('0x3')]){return _0x16ece8;}return _0x16ece8[_0xf86b('0x11')]({'data1':_0x32caa5,'data2':null,'license':_0x933d0d[_0xf86b('0x3')]});}else{if(_0x933d0d[_0xf86b('0x3')]||_0x56013f[_0xf86b('0x3')]){if(!_0x56013f[_0xf86b('0xc')]){if(_0x56013f[_0xf86b('0xb')]==_0x32caa5){GRAY_PERIOD_REASON=_0xf86b('0x12');logger['info'](_0xf86b('0x13'));}else{GRAY_PERIOD_REASON=_0xf86b('0x14');logger[_0xf86b('0xf')](_0xf86b('0x15'),_0x56013f[_0xf86b('0xb')],_0x32caa5);}logger['info'](_0xf86b('0x16'),GRAY_PERIOD_REASON[_0xf86b('0x17')](),moment()[_0xf86b('0x6')]('YYYY-MM-DD\x20HH:mm'));return _0x16ece8[_0xf86b('0x11')]({'data2':encryptor[_0xf86b('0x18')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xf86b('0x19')](encryptor[_0xf86b('0x1a')](_0x56013f[_0xf86b('0xc')]),_0xf86b('0x1b'))>DAYS){logger[_0xf86b('0xf')](_0xf86b('0x1c'),moment()['format'](_0xf86b('0x1d')));isOldTokenSent=![];return _0x16ece8[_0xf86b('0x11')]({'data1':_0x32caa5,'data2':null,'license':null});}}}else{if(_0x56013f[_0xf86b('0xb')]!=_0x32caa5){logger[_0xf86b('0xf')](_0xf86b('0x15'),_0x56013f[_0xf86b('0xb')],_0x32caa5);return _0x16ece8[_0xf86b('0x11')]({'data1':_0x32caa5,'data2':null,'license':null});}}}return _0x16ece8;})['then'](function(_0x12cdab){_0x16ece8=_0x12cdab;})[_0xf86b('0xa')](function(_0x283dc7){logger['error'](_0x283dc7[_0xf86b('0x1e')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xf86b('0x1f')](),_0x16ece8);},TIME);});}function defaultLicense(){var _0x44f7b6=hardware[_0xf86b('0x1f')]();if(_0x44f7b6){return db[_0xf86b('0x20')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x44f7b6}})[_0xf86b('0x21')](function(_0x478e65,_0x145526){logger[_0xf86b('0xf')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x44f7b6);manageLicense(_0x44f7b6,_0x478e65);})[_0xf86b('0xa')](function(_0x12dd75){logger['error'](_0x12dd75['message']);});}}exports[_0xf86b('0x22')]=defaultLicense; \ No newline at end of file +var _0x46a0=['error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','data1','active','license','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x5ee038,_0x598c39){var _0x2e19c6=function(_0x3c0fbd){while(--_0x3c0fbd){_0x5ee038['push'](_0x5ee038['shift']());}};_0x2e19c6(++_0x598c39);}(_0x46a0,0x7d));var _0x046a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46a0[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x046a('0x0'));var moment=require('moment');var rp=require(_0x046a('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x046a('0x2'))(module,_0x046a('0x3'));var db=require(_0x046a('0x4'))['db'];var encryptor=require(_0x046a('0x5'));var hardware=require('./hardware');var logger=require(_0x046a('0x6'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4cec75){return new BPromise(function(_0x43ac38,_0x6e596d){var _0x2017b4=util[_0x046a('0x7')](_0x046a('0x8'),HOST,_0x4cec75,module[_0x046a('0x9')]['version']);if(oldToken){_0x2017b4=util['format'](_0x046a('0xa'),HOST,_0x4cec75,module['exports'][_0x046a('0x3')],oldToken);}var _0x5800c8={'uri':_0x2017b4,'method':_0x046a('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x5800c8)[_0x046a('0xc')](function(_0x10deb9){_0x43ac38(_0x10deb9);})[_0x046a('0xd')](function(_0x4ac200){_0x6e596d(_0x4ac200);});});}function manageLicense(_0x15c061,_0x9d9706){var _0x10d032=_0x9d9706[_0x046a('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x10d032['data1']!==_0x15c061&&!_0x10d032[_0x046a('0xf')]){oldToken=_0x10d032[_0x046a('0x10')];}httpRequest(_0x15c061)[_0x046a('0xc')](function(_0x2d7eb9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2d7eb9[_0x046a('0x11')]){isOldTokenSent=![];if(!_0x10d032[_0x046a('0x12')]&&_0x10d032['license']!=_0x2d7eb9['license']||_0x10d032[_0x046a('0x12')]&&_0x10d032[_0x046a('0xf')]){logger[_0x046a('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x10d032[_0x046a('0x12')]&&!_0x10d032[_0x046a('0xf')]&&_0x10d032[_0x046a('0x12')]!=_0x2d7eb9[_0x046a('0x12')]){logger[_0x046a('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x10d032[_0x046a('0x12')]&&!_0x10d032['data2']&&_0x10d032[_0x046a('0x12')]==_0x2d7eb9['license']){return _0x9d9706;}return _0x9d9706[_0x046a('0x14')]({'data1':_0x15c061,'data2':null,'license':_0x2d7eb9[_0x046a('0x12')]});}else{if(_0x2d7eb9[_0x046a('0x12')]||_0x10d032[_0x046a('0x12')]){if(!_0x10d032['data2']){if(_0x10d032['data1']==_0x15c061){GRAY_PERIOD_REASON=_0x046a('0x15');logger[_0x046a('0x13')](_0x046a('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x046a('0x13')](_0x046a('0x17'),_0x10d032[_0x046a('0x10')],_0x15c061);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x046a('0x18')](),moment()[_0x046a('0x7')](_0x046a('0x19')));return _0x9d9706[_0x046a('0x14')]({'data2':encryptor[_0x046a('0x1a')](moment()['format'](_0x046a('0x19')))});}else{if(moment()[_0x046a('0x1b')](encryptor[_0x046a('0x1c')](_0x10d032['data2']),_0x046a('0x1d'))>DAYS){logger['info'](_0x046a('0x1e'),moment()[_0x046a('0x7')](_0x046a('0x19')));isOldTokenSent=![];return _0x9d9706[_0x046a('0x14')]({'data1':_0x15c061,'data2':null,'license':null});}}}else{if(_0x10d032[_0x046a('0x10')]!=_0x15c061){logger['info'](_0x046a('0x17'),_0x10d032[_0x046a('0x10')],_0x15c061);return _0x9d9706['update']({'data1':_0x15c061,'data2':null,'license':null});}}}return _0x9d9706;})[_0x046a('0xc')](function(_0x5de986){_0x9d9706=_0x5de986;})[_0x046a('0xd')](function(_0x350298){logger[_0x046a('0x1f')](_0x350298[_0x046a('0x20')]);})[_0x046a('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x046a('0x22')](),_0x9d9706);},TIME);});}function defaultLicense(){var _0x16f2f7=hardware[_0x046a('0x22')]();if(_0x16f2f7){return db[_0x046a('0x23')][_0x046a('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x16f2f7}})['spread'](function(_0x1cd938,_0x9d93a0){logger[_0x046a('0x13')](_0x046a('0x25'),_0x16f2f7);manageLicense(_0x16f2f7,_0x1cd938);})['catch'](function(_0x3ba898){logger[_0x046a('0x1f')](_0x3ba898[_0x046a('0x20')]);});}}exports[_0x046a('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 52f3c93..a6c94fe 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 _0x5b8b=['pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','catch','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','uuid','machineUuid','gray','deadline','add','days','changed','disabled','message','then','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','telephones'];(function(_0x5ed413,_0x4f26c0){var _0x3cca33=function(_0x214afe){while(--_0x214afe){_0x5ed413['push'](_0x5ed413['shift']());}};_0x3cca33(++_0x4f26c0);}(_0x5b8b,0x14d));var _0xb5b8=function(_0x41a45d,_0x1e61c3){_0x41a45d=_0x41a45d-0x0;var _0x24b1d6=_0x5b8b[_0x41a45d];return _0x24b1d6;};'use strict';var util=require(_0xb5b8('0x0'));var _=require(_0xb5b8('0x1'));var moment=require(_0xb5b8('0x2'));var BPromise=require('bluebird');var hardware=require(_0xb5b8('0x3'));var encryptor=require(_0xb5b8('0x4'));var db=require(_0xb5b8('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb5b8('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xb5b8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb5b8('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb5b8('0x8'),'machineUuid':hardware[_0xb5b8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x42b2cb){return new BPromise(function(_0x2805f8,_0x4adb02){return db[_0xb5b8('0x9')][_0xb5b8('0xa')](_[_0xb5b8('0xb')](_0x42b2cb,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x71f6bc){return checkLicense(_0x71f6bc,null);})['then'](function(_0x1f0f87){_0x2805f8(_0x1f0f87);return;})[_0xb5b8('0xc')](function(_0xae3f63){_0x4adb02(_0xae3f63);});});}function checkLicense(_0xe1f2a6,_0x12deb4){if(!_0xe1f2a6){demoLicense['uuid']=_0xe1f2a6[_0xb5b8('0xd')];return demoLicense;}try{var _0x3d8092=_0x12deb4||_0xe1f2a6[_0xb5b8('0xe')];if(_[_0xb5b8('0xf')](_0x3d8092)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x35b914=_0xe1f2a6[_0xb5b8('0xd')];var _0x7cc2a4=_0xe1f2a6[_0xb5b8('0x10')];var _0x33b2af=_0x35b914[_0xb5b8('0x11')]('-')[0x4];var _0x32ab71=_0x35b914[_0xb5b8('0x11')]('-')[0x0];var _0x334935=encryptor[_0xb5b8('0x12')](_0x3d8092,util[_0xb5b8('0x13')](_0xb5b8('0x14'),_0x33b2af,_0x35b914,_0x32ab71));var _0xd7c9b9=JSON[_0xb5b8('0x15')](_0x334935);_0xd7c9b9['demo']=![];_0xd7c9b9[_0xb5b8('0x16')]=_0x35b914;_0xd7c9b9[_0xb5b8('0x17')]=hardware[_0xb5b8('0x7')]();if(_0x7cc2a4){var _0x1d5500=encryptor['decryptString'](_0x7cc2a4);_0xd7c9b9[_0xb5b8('0x18')]=_0x1d5500;_0xd7c9b9[_0xb5b8('0x19')]=moment(_0x1d5500)[_0xb5b8('0x1a')](0x7,_0xb5b8('0x1b'))[_0xb5b8('0x13')]();_0xd7c9b9['grayReason']=_0xd7c9b9['uuid']!=_0xd7c9b9[_0xb5b8('0x17')]?_0xb5b8('0x1c'):_0xb5b8('0x1d');}return _0xd7c9b9;}catch(_0x1fcafc){breakingLicense['uuid']=_0xe1f2a6[_0xb5b8('0xd')];breakingLicense[_0xb5b8('0x1e')]=_0x1fcafc[_0xb5b8('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x32b700,_0x1b3a04){getLicense()[_0xb5b8('0x1f')](function(_0xf9562c){return db['User'][_0xb5b8('0x20')]({'attributes':[_0xb5b8('0x21'),[db[_0xb5b8('0x22')]['fn'](_0xb5b8('0x23'),db[_0xb5b8('0x22')][_0xb5b8('0x24')]('role')),_0xb5b8('0x25')]],'group':_0xb5b8('0x21'),'where':{'role':{'$or':[_0xb5b8('0x26'),_0xb5b8('0x27'),_0xb5b8('0x28')]}},'raw':!![]})[_0xb5b8('0x1f')](function(_0x37de26){var _0x2e6c58={'user':_0xf9562c[_0xb5b8('0x29')]||0x0,'telephone':_0xf9562c[_0xb5b8('0x2a')]||0x0};_0x37de26['forEach'](function(_0x1dda2a){var _0x25f6d3=_0x1dda2a[_0xb5b8('0x21')]==='admin'?_0xb5b8('0x27'):_0x1dda2a[_0xb5b8('0x21')];_0x2e6c58[_0x25f6d3]-=_0x1dda2a['count'];if(_0x2e6c58[_0x25f6d3]<0x0)_0x2e6c58[_0x25f6d3]=0x0;});_0x32b700(_0x2e6c58);return;});})[_0xb5b8('0xc')](function(_0x2e4504){_0x1b3a04(_0x2e4504);});});}function checkUserLimits(_0x72be6f){return new BPromise(function(_0x5bbce7,_0x3f3c62){getLimits()[_0xb5b8('0x1f')](function(_0x12a332){var _0x4fb489=_[_0xb5b8('0x2b')](_['countBy'](_0x72be6f,_0xb5b8('0x21')),[_0xb5b8('0x26'),_0xb5b8('0x27'),'telephone']);var _0x5a3ffa=(_0x4fb489[_0xb5b8('0x26')]||0x0)+(_0x4fb489[_0xb5b8('0x27')]||0x0);var _0x467f4b=_0x4fb489[_0xb5b8('0x28')]||0x0;if(_0x5a3ffa>_0x12a332[_0xb5b8('0x27')])return _0x3f3c62(_0xb5b8('0x2c'));if(_0x467f4b>_0x12a332[_0xb5b8('0x28')])return _0x3f3c62(_0xb5b8('0x2d'));return _0x5bbce7();})[_0xb5b8('0xc')](function(_0x4b61c9){_0x3f3c62(_0x4b61c9);});});}module[_0xb5b8('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4413=['decryptString','format','parse','demo','uuid','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','User','sequelize','COUNT','col','role','count','admin','telephone','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','License\x20key\x20value\x20not\x20found','split'];(function(_0x1ff7e7,_0x2625c9){var _0x1e5008=function(_0x5c0042){while(--_0x5c0042){_0x1ff7e7['push'](_0x1ff7e7['shift']());}};_0x1e5008(++_0x2625c9);}(_0x4413,0xa6));var _0x3441=function(_0x5160b2,_0x5a8286){_0x5160b2=_0x5160b2-0x0;var _0xda089=_0x4413[_0x5160b2];return _0xda089;};'use strict';var util=require('util');var _=require(_0x3441('0x0'));var moment=require(_0x3441('0x1'));var BPromise=require(_0x3441('0x2'));var hardware=require(_0x3441('0x3'));var encryptor=require(_0x3441('0x4'));var db=require(_0x3441('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3441('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x3441('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3441('0x8'),'machineUuid':hardware[_0x3441('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3bfef5){return new BPromise(function(_0x4c54d3,_0x1d0623){return db[_0x3441('0x9')][_0x3441('0xa')](_[_0x3441('0xb')](_0x3bfef5,{'raw':!![],'where':{'id':0x1}}))[_0x3441('0xc')](function(_0x2fbdea){return checkLicense(_0x2fbdea,null);})['then'](function(_0x41278d){_0x4c54d3(_0x41278d);return;})[_0x3441('0xd')](function(_0x166f9b){_0x1d0623(_0x166f9b);});});}function checkLicense(_0x667139,_0x1d5882){if(!_0x667139){demoLicense['uuid']=_0x667139[_0x3441('0xe')];return demoLicense;}try{var _0x184d2c=_0x1d5882||_0x667139[_0x3441('0xf')];if(_['isEmpty'](_0x184d2c)){throw new Error(_0x3441('0x10'));}var _0xd8706c=_0x667139['data1'];var _0x4a0b9d=_0x667139['data2'];var _0x29a54e=_0xd8706c[_0x3441('0x11')]('-')[0x4];var _0x40721b=_0xd8706c['split']('-')[0x0];var _0x3a2084=encryptor[_0x3441('0x12')](_0x184d2c,util[_0x3441('0x13')]('%s:%s:%s',_0x29a54e,_0xd8706c,_0x40721b));var _0x4defec=JSON[_0x3441('0x14')](_0x3a2084);_0x4defec[_0x3441('0x15')]=![];_0x4defec[_0x3441('0x16')]=_0xd8706c;_0x4defec['machineUuid']=hardware[_0x3441('0x7')]();if(_0x4a0b9d){var _0x4d27c6=encryptor[_0x3441('0x12')](_0x4a0b9d);_0x4defec[_0x3441('0x17')]=_0x4d27c6;_0x4defec[_0x3441('0x18')]=moment(_0x4d27c6)[_0x3441('0x19')](0x7,_0x3441('0x1a'))[_0x3441('0x13')]();_0x4defec[_0x3441('0x1b')]=_0x4defec[_0x3441('0x16')]!=_0x4defec[_0x3441('0x1c')]?_0x3441('0x1d'):_0x3441('0x1e');}return _0x4defec;}catch(_0x334140){breakingLicense[_0x3441('0x16')]=_0x667139[_0x3441('0xe')];breakingLicense['message']=_0x334140['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x59c6bd,_0x393846){getLicense()['then'](function(_0x14910a){return db[_0x3441('0x1f')]['findAll']({'attributes':['role',[db[_0x3441('0x20')]['fn'](_0x3441('0x21'),db[_0x3441('0x20')][_0x3441('0x22')](_0x3441('0x23'))),_0x3441('0x24')]],'group':_0x3441('0x23'),'where':{'role':{'$or':[_0x3441('0x25'),'user',_0x3441('0x26')]}},'raw':!![]})[_0x3441('0xc')](function(_0x9c7caf){var _0x2a8822={'user':_0x14910a['users']||0x0,'telephone':_0x14910a[_0x3441('0x27')]||0x0};_0x9c7caf[_0x3441('0x28')](function(_0x4674ce){var _0x5600f1=_0x4674ce[_0x3441('0x23')]===_0x3441('0x25')?_0x3441('0x29'):_0x4674ce[_0x3441('0x23')];_0x2a8822[_0x5600f1]-=_0x4674ce[_0x3441('0x24')];if(_0x2a8822[_0x5600f1]<0x0)_0x2a8822[_0x5600f1]=0x0;});_0x59c6bd(_0x2a8822);return;});})['catch'](function(_0x45aa61){_0x393846(_0x45aa61);});});}function checkUserLimits(_0x326f86){return new BPromise(function(_0x496457,_0x285813){getLimits()[_0x3441('0xc')](function(_0x120894){var _0x1fb8d7=_[_0x3441('0x2a')](_[_0x3441('0x2b')](_0x326f86,_0x3441('0x23')),[_0x3441('0x25'),_0x3441('0x29'),_0x3441('0x26')]);var _0x4ebbd2=(_0x1fb8d7[_0x3441('0x25')]||0x0)+(_0x1fb8d7[_0x3441('0x29')]||0x0);var _0x4940e6=_0x1fb8d7['telephone']||0x0;if(_0x4ebbd2>_0x120894[_0x3441('0x29')])return _0x285813('License\x20limit\x20reached\x20for\x20users');if(_0x4940e6>_0x120894[_0x3441('0x26')])return _0x285813(_0x3441('0x2c'));return _0x496457();})[_0x3441('0xd')](function(_0x3bc756){_0x285813(_0x3bc756);});});}module[_0x3441('0x2d')]={'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 b96a104..16135d0 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 _0x1a85=['secret','myappanuglar-secret','app-id'];(function(_0x344c03,_0x3d04de){var _0xb7991d=function(_0xb7f35d){while(--_0xb7f35d){_0x344c03['push'](_0x344c03['shift']());}};_0xb7991d(++_0x3d04de);}(_0x1a85,0x178));var _0x51a8=function(_0x1181f3,_0xf81baa){_0x1181f3=_0x1181f3-0x0;var _0x37abb6=_0x1a85[_0x1181f3];return _0x37abb6;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x51a8('0x0'),'GOOGLE_ID':_0x51a8('0x1'),'GOOGLE_SECRET':_0x51a8('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x7916=['myappanuglar-secret','app-id','exports'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x7916,0x128));var _0x6791=function(_0x30f496,_0x4f0611){_0x30f496=_0x30f496-0x0;var _0x3960be=_0x7916[_0x30f496];return _0x3960be;};'use strict';module[_0x6791('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x6791('0x1'),'GOOGLE_ID':_0x6791('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 59a85eb..9476419 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98c7=['Console','debugLevel','moment','winston','path','/var','log','xcally','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','%s-%s','error','info'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x98c7,0xa3));var _0x798c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x98c7[_0x3fba9f];return _0x192cf1;};'use strict';var moment=require(_0x798c('0x0'));var winston=require(_0x798c('0x1'));var util=require('util');var path=require(_0x798c('0x2'));var debugLevel='INFO';function filename(_0x3b25b7,_0x6db960){return path['join'](_0x798c('0x3'),_0x798c('0x4'),_0x798c('0x5'),util[_0x798c('0x6')](_0x798c('0x7'),_0x3b25b7,_0x6db960));}function formatter(_0x4585ea,_0x5d974a){_0x5d974a[_0x798c('0x8')]=_0x5d974a[_0x798c('0x8')]['replace'](/@@{/g,_0x798c('0x9'))[_0x798c('0xa')](/}@@/g,_0x798c('0xb'))['replace'](/@{/g,'{{')[_0x798c('0xa')](/}@/g,'}}');return util[_0x798c('0x6')](_0x798c('0xc'),moment()[_0x798c('0x6')](_0x798c('0xd')),_0x5d974a[_0x798c('0xe')]['toUpperCase'](),_0x4585ea,_0x5d974a[_0x798c('0x8')]);}module[_0x798c('0xf')]=function(_0x11fc85){return new winston[(_0x798c('0x10'))]({'transports':[new winston[(_0x798c('0x11'))]['File']({'name':util[_0x798c('0x6')](_0x798c('0x12'),_0x11fc85,_0x798c('0x13')),'filename':filename(_0x11fc85,_0x798c('0x13')),'level':_0x798c('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x19bb80){return formatter(_0x11fc85,_0x19bb80);}}),new winston[(_0x798c('0x11'))]['File']({'name':util[_0x798c('0x6')]('%s-%s',_0x11fc85,_0x798c('0x14')),'filename':filename(_0x11fc85,_0x798c('0x14')),'level':_0x798c('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x141b9f){return formatter(_0x11fc85,_0x141b9f);}}),new winston[(_0x798c('0x11'))][(_0x798c('0x15'))]({'level':process['env'][_0x798c('0x16')]||debugLevel,'json':![],'formatter':function(_0x1def1c){return formatter(_0x11fc85,_0x1def1c);}})]});}; \ No newline at end of file +var _0x2192=['toUpperCase','exports','transports','File','error','%s-%s','info','Console','env','debugLevel','moment','util','INFO','/var','log','xcally','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x14d6da,_0x4569a7){var _0x22c538=function(_0x3e1287){while(--_0x3e1287){_0x14d6da['push'](_0x14d6da['shift']());}};_0x22c538(++_0x4569a7);}(_0x2192,0x82));var _0x2219=function(_0x2891c,_0x56cf3f){_0x2891c=_0x2891c-0x0;var _0xcc0cff=_0x2192[_0x2891c];return _0xcc0cff;};'use strict';var moment=require(_0x2219('0x0'));var winston=require('winston');var util=require(_0x2219('0x1'));var path=require('path');var debugLevel=_0x2219('0x2');function filename(_0x55c047,_0xe92efa){return path['join'](_0x2219('0x3'),_0x2219('0x4'),_0x2219('0x5'),util['format']('%s-%s.log',_0x55c047,_0xe92efa));}function formatter(_0x2fa9d8,_0x18a194){_0x18a194['message']=_0x18a194[_0x2219('0x6')][_0x2219('0x7')](/@@{/g,_0x2219('0x8'))['replace'](/}@@/g,_0x2219('0x9'))[_0x2219('0x7')](/@{/g,'{{')[_0x2219('0x7')](/}@/g,'}}');return util[_0x2219('0xa')](_0x2219('0xb'),moment()[_0x2219('0xa')](_0x2219('0xc')),_0x18a194[_0x2219('0xd')][_0x2219('0xe')](),_0x2fa9d8,_0x18a194['message']);}module[_0x2219('0xf')]=function(_0x2ac21e){return new winston['Logger']({'transports':[new winston[(_0x2219('0x10'))][(_0x2219('0x11'))]({'name':util[_0x2219('0xa')]('%s-%s',_0x2ac21e,'error'),'filename':filename(_0x2ac21e,'error'),'level':_0x2219('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3b6b3b){return formatter(_0x2ac21e,_0x3b6b3b);}}),new winston[(_0x2219('0x10'))][(_0x2219('0x11'))]({'name':util[_0x2219('0xa')](_0x2219('0x13'),_0x2ac21e,_0x2219('0x14')),'filename':filename(_0x2ac21e,'info'),'level':_0x2219('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x20639e){return formatter(_0x2ac21e,_0x20639e);}}),new winston[(_0x2219('0x10'))][(_0x2219('0x15'))]({'level':process[_0x2219('0x16')][_0x2219('0x17')]||debugLevel,'json':![],'formatter':function(_0x4cd47a){return formatter(_0x2ac21e,_0x4cd47a);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index de6cc07..a20252c 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 _0xee15=['exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xee15,0x14b));var _0x5ee1=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xee15[_0x26f702];return _0x11417d;};'use strict';var path=require(_0x5ee1('0x0'));var os=require('os');var config={'apps':[{'name':_0x5ee1('0x1'),'script':path[_0x5ee1('0x2')](__dirname,_0x5ee1('0x3'))},{'name':_0x5ee1('0x4'),'script':path[_0x5ee1('0x2')](__dirname,_0x5ee1('0x5'))},{'name':_0x5ee1('0x6'),'script':path[_0x5ee1('0x2')](__dirname,_0x5ee1('0x7'))},{'name':_0x5ee1('0x8'),'script':path[_0x5ee1('0x2')](__dirname,_0x5ee1('0x9'))},{'name':_0x5ee1('0xa'),'script':path['join'](__dirname,_0x5ee1('0xb'))},{'name':_0x5ee1('0xc'),'script':path['join'](__dirname,_0x5ee1('0xd'))}]};module[_0x5ee1('0xe')]=config; \ No newline at end of file +var _0xe7ac=['email','routing','xdr','../../services/xdr/index.js','exports','path','express','join','agi'];(function(_0x167470,_0x560709){var _0x34754b=function(_0x4e8940){while(--_0x4e8940){_0x167470['push'](_0x167470['shift']());}};_0x34754b(++_0x560709);}(_0xe7ac,0x1c7));var _0xce7a=function(_0x5ac327,_0x57bbba){_0x5ac327=_0x5ac327-0x0;var _0x3d446f=_0xe7ac[_0x5ac327];return _0x3d446f;};'use strict';var path=require(_0xce7a('0x0'));var os=require('os');var config={'apps':[{'name':_0xce7a('0x1'),'script':path[_0xce7a('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xce7a('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xce7a('0x3'),'script':path[_0xce7a('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xce7a('0x4'),'script':path[_0xce7a('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xce7a('0x5'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0xce7a('0x6'),'script':path[_0xce7a('0x2')](__dirname,_0xce7a('0x7'))}]};module[_0xce7a('0x8')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index df276c4..c11f226 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 _0x6366=['delete','dump','saved','bluebird','./config','start','disconnect','then','stop','restart','list','describe'];(function(_0x1835a7,_0x310a75){var _0x5e18e3=function(_0x775514){while(--_0x775514){_0x1835a7['push'](_0x1835a7['shift']());}};_0x5e18e3(++_0x310a75);}(_0x6366,0xf3));var _0x6636=function(_0x4729cb,_0x338a42){_0x4729cb=_0x4729cb-0x0;var _0x2180f9=_0x6366[_0x4729cb];return _0x2180f9;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6636('0x0'));var config=require(_0x6636('0x1'));function connect(){return new BPromise(function(_0xd27199,_0x4e54e8){return pm2['connect'](function(_0x3ab912){if(_0x3ab912){return _0x4e54e8(_0x3ab912);}return _0xd27199('connected');});});};exports[_0x6636('0x2')]=function(_0x1f99b8){return connect()['then'](function(){return new BPromise(function(_0x3a65e6,_0x11b0b1){return pm2['start'](_0x1f99b8,function(_0x157184,_0x35a546){if(_0x157184){return _0x11b0b1(_0x157184);}pm2[_0x6636('0x3')]();return _0x3a65e6(_0x35a546);});});});};exports['stop']=function(_0x554a4e){return connect()[_0x6636('0x4')](function(){return new BPromise(function(_0x303082,_0x231313){return pm2[_0x6636('0x5')](_0x554a4e,function(_0x5eee1c,_0x3da839){if(_0x5eee1c){return _0x231313(_0x5eee1c);}pm2[_0x6636('0x3')]();return _0x303082(_0x3da839);});});});};exports[_0x6636('0x6')]=function(_0x501e8f){return connect()[_0x6636('0x4')](function(){return new BPromise(function(_0x5a921c,_0x4fd82b){return pm2[_0x6636('0x6')](_0x501e8f,function(_0x1a5a22,_0x55db09){if(_0x1a5a22){return _0x4fd82b(_0x1a5a22);}pm2[_0x6636('0x3')]();return _0x5a921c(_0x55db09);});});});};exports[_0x6636('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x596907,_0x17649f){return pm2[_0x6636('0x7')](function(_0x7473f0,_0x11ec3e){if(_0x7473f0){return _0x17649f(_0x7473f0);}pm2[_0x6636('0x3')]();return _0x596907(_0x11ec3e);});});});};exports['describe']=function(_0x482c38){return connect()['then'](function(){return new BPromise(function(_0x331aef,_0xe6c3c9){return pm2[_0x6636('0x8')](_0x482c38,function(_0x38b07b,_0x18b24d){if(_0x38b07b){return _0xe6c3c9(_0x38b07b);}pm2[_0x6636('0x3')]();return _0x331aef(_0x18b24d);});});});};exports[_0x6636('0x9')]=function(_0xfa34e2){return connect()['then'](function(){return new BPromise(function(_0x4dd9fa,_0x14620e){return pm2['delete'](_0xfa34e2,function(_0x2d1659,_0x55d0e5){if(_0x2d1659){return _0x14620e(_0x2d1659);}pm2[_0x6636('0x3')]();return _0x4dd9fa(_0x55d0e5);});});});};exports[_0x6636('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x26a861,_0x55c312){return pm2[_0x6636('0xa')](function(_0x49f7e7){if(_0x49f7e7){return _0x55c312(_0x49f7e7);}return _0x26a861(_0x6636('0xb'));});});});}; \ No newline at end of file +var _0x7f8c=['./config','connect','start','then','disconnect','stop','restart','list','describe','delete','dump','pm2','bluebird'];(function(_0x22536f,_0x2853c8){var _0x5afe0f=function(_0x1b63a){while(--_0x1b63a){_0x22536f['push'](_0x22536f['shift']());}};_0x5afe0f(++_0x2853c8);}(_0x7f8c,0x80));var _0xc7f8=function(_0x598dac,_0x8d0363){_0x598dac=_0x598dac-0x0;var _0x2f5c75=_0x7f8c[_0x598dac];return _0x2f5c75;};'use strict';var pm2=require(_0xc7f8('0x0'));var BPromise=require(_0xc7f8('0x1'));var config=require(_0xc7f8('0x2'));function connect(){return new BPromise(function(_0x167b1c,_0x173b08){return pm2[_0xc7f8('0x3')](function(_0x567cd8){if(_0x567cd8){return _0x173b08(_0x567cd8);}return _0x167b1c('connected');});});};exports[_0xc7f8('0x4')]=function(_0x244998){return connect()[_0xc7f8('0x5')](function(){return new BPromise(function(_0x24092c,_0x58ab3e){return pm2[_0xc7f8('0x4')](_0x244998,function(_0x2ea7a7,_0x1bfa4a){if(_0x2ea7a7){return _0x58ab3e(_0x2ea7a7);}pm2[_0xc7f8('0x6')]();return _0x24092c(_0x1bfa4a);});});});};exports[_0xc7f8('0x7')]=function(_0x3e2aff){return connect()[_0xc7f8('0x5')](function(){return new BPromise(function(_0x1d3498,_0x5be1d0){return pm2[_0xc7f8('0x7')](_0x3e2aff,function(_0x242c00,_0x55e588){if(_0x242c00){return _0x5be1d0(_0x242c00);}pm2[_0xc7f8('0x6')]();return _0x1d3498(_0x55e588);});});});};exports['restart']=function(_0x7f2ade){return connect()['then'](function(){return new BPromise(function(_0x5ee508,_0x52201d){return pm2[_0xc7f8('0x8')](_0x7f2ade,function(_0x1ee749,_0x4b4ce4){if(_0x1ee749){return _0x52201d(_0x1ee749);}pm2[_0xc7f8('0x6')]();return _0x5ee508(_0x4b4ce4);});});});};exports[_0xc7f8('0x9')]=function(){return connect()[_0xc7f8('0x5')](function(){return new BPromise(function(_0x5161f3,_0x542e75){return pm2['list'](function(_0x4c2bc4,_0x4fe4b1){if(_0x4c2bc4){return _0x542e75(_0x4c2bc4);}pm2[_0xc7f8('0x6')]();return _0x5161f3(_0x4fe4b1);});});});};exports[_0xc7f8('0xa')]=function(_0x19cae3){return connect()['then'](function(){return new BPromise(function(_0x3cab35,_0x5cb151){return pm2[_0xc7f8('0xa')](_0x19cae3,function(_0x1b6309,_0x402775){if(_0x1b6309){return _0x5cb151(_0x1b6309);}pm2[_0xc7f8('0x6')]();return _0x3cab35(_0x402775);});});});};exports[_0xc7f8('0xb')]=function(_0x143717){return connect()['then'](function(){return new BPromise(function(_0x172909,_0x41f61e){return pm2[_0xc7f8('0xb')](_0x143717,function(_0x2527b2,_0x2ddd45){if(_0x2527b2){return _0x41f61e(_0x2527b2);}pm2['disconnect']();return _0x172909(_0x2ddd45);});});});};exports[_0xc7f8('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5dd586,_0x236708){return pm2['dump'](function(_0x3be968){if(_0x3be968){return _0x236708(_0x3be968);}return _0x5dd586('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 360a327..5a718cb 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 _0x417d=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','lodash','moment','util','../logger','schedule','redis','defaults','localhost','socket.io-emitter','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','then','length','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x57906a,_0x13923c){var _0x33cb5a=function(_0x3f47f5){while(--_0x3f47f5){_0x57906a['push'](_0x57906a['shift']());}};_0x33cb5a(++_0x13923c);}(_0x417d,0x66));var _0xd417=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x417d[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xd417('0x0'));var moment=require(_0xd417('0x1'));var Redis=require('ioredis');var util=require(_0xd417('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xd417('0x3'))(_0xd417('0x4'));config[_0xd417('0x5')]=_[_0xd417('0x6')](config['redis'],{'host':_0xd417('0x7'),'port':0x18eb});var io=require(_0xd417('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x42a439=0x0;var _0x357b7e=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xd417('0x9')],'where':{'id':0x1}})['then'](function(_0x3946da){_0x42a439=_0x3946da[_0xd417('0x9')];if(_0x42a439){return db[_0xd417('0xa')]['findAll']({'raw':!![],'attributes':['id',_0xd417('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd417('0xc')](_0x3946da['chatTimeout'],_0xd417('0xd'))}}});}else{return[];}})[_0xd417('0xe')](function(_0x40e180){if(_0x40e180&&_0x40e180[_0xd417('0xf')]){_0x357b7e=_['map'](_0x40e180||[],'id');logger[_0xd417('0x10')](_0xd417('0x11'),_0x357b7e['join']());return db[_0xd417('0xa')][_0xd417('0x12')]({'closeReason':_0xd417('0x13'),'disposition':_0xd417('0x14'),'closed':!![],'closedAt':moment()[_0xd417('0x15')](_0xd417('0x16'))},{'where':{'id':_0x357b7e}});}})[_0xd417('0xe')](function(){if(_0x357b7e&&_0x357b7e[_0xd417('0xf')]){logger[_0xd417('0x10')](_0xd417('0x17'),_0x357b7e[_0xd417('0x18')]());for(var _0x41cee7=0x0;_0x41cee7<_0x357b7e['length'];_0x41cee7++){io[_0xd417('0x19')](_0xd417('0x1a'),{'id':_0x357b7e[_0x41cee7],'closed':!![]});}}})[_0xd417('0x1b')](function(_0x325327){logger[_0xd417('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x325327?util[_0xd417('0x1d')](_0x325327,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x55ed=['[CHAT]\x20Interactions\x20to\x20close:','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','defaults','redis','socket.io-emitter','Setting','chatTimeout','ChatInteraction','findAll','subtract','then','length','map','info'];(function(_0x714375,_0x3aa329){var _0x38267a=function(_0x4a0c13){while(--_0x4a0c13){_0x714375['push'](_0x714375['shift']());}};_0x38267a(++_0x3aa329);}(_0x55ed,0x181));var _0xd55e=function(_0x1c1c5e,_0x270b07){_0x1c1c5e=_0x1c1c5e-0x0;var _0x236279=_0x55ed[_0x1c1c5e];return _0x236279;};'use strict';var _=require(_0xd55e('0x0'));var moment=require(_0xd55e('0x1'));var Redis=require('ioredis');var util=require(_0xd55e('0x2'));var config=require(_0xd55e('0x3'));var db=require(_0xd55e('0x4'))['db'];var logger=require('../logger')(_0xd55e('0x5'));config['redis']=_[_0xd55e('0x6')](config[_0xd55e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd55e('0x8'))(new Redis(config[_0xd55e('0x7')]));function closeInteractions(){var _0x4d7897=0x0;var _0x5a0ee9=[];return db[_0xd55e('0x9')]['find']({'raw':!![],'attributes':['id',_0xd55e('0xa')],'where':{'id':0x1}})['then'](function(_0x14cbc1){_0x4d7897=_0x14cbc1[_0xd55e('0xa')];if(_0x4d7897){return db[_0xd55e('0xb')][_0xd55e('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd55e('0xd')](_0x14cbc1[_0xd55e('0xa')],'minutes')}}});}else{return[];}})[_0xd55e('0xe')](function(_0xf71f29){if(_0xf71f29&&_0xf71f29[_0xd55e('0xf')]){_0x5a0ee9=_[_0xd55e('0x10')](_0xf71f29||[],'id');logger[_0xd55e('0x11')](_0xd55e('0x12'),_0x5a0ee9['join']());return db[_0xd55e('0xb')][_0xd55e('0x13')]({'closeReason':_0xd55e('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xd55e('0x15')](_0xd55e('0x16'))},{'where':{'id':_0x5a0ee9}});}})[_0xd55e('0xe')](function(){if(_0x5a0ee9&&_0x5a0ee9[_0xd55e('0xf')]){logger[_0xd55e('0x11')](_0xd55e('0x17'),_0x5a0ee9['join']());for(var _0x2ee73f=0x0;_0x2ee73f<_0x5a0ee9[_0xd55e('0xf')];_0x2ee73f++){io[_0xd55e('0x18')](_0xd55e('0x19'),{'id':_0x5a0ee9[_0x2ee73f],'closed':!![]});}}})[_0xd55e('0x1a')](function(_0xe3843){logger[_0xd55e('0x1b')](_0xd55e('0x1c'),_0xe3843?util[_0xd55e('0x1d')](_0xe3843,{'showHidden':![],'depth':null}):'');});}exports[_0xd55e('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 6150401..930ed81 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05ab=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x4567db,_0x13a6da){var _0x31aed4=function(_0x541ea9){while(--_0x541ea9){_0x4567db['push'](_0x4567db['shift']());}};_0x31aed4(++_0x13a6da);}(_0x05ab,0x1b7));var _0xb05a=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x05ab[_0xdea41a];return _0x15d0d8;};'use strict';function start(){var _0x50eb0a=require(_0xb05a('0x0'));return _0x50eb0a[_0xb05a('0x1')]();}module[_0xb05a('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xef90=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x44ba1b,_0x3a88cb){var _0x289442=function(_0x302ee5){while(--_0x302ee5){_0x44ba1b['push'](_0x44ba1b['shift']());}};_0x289442(++_0x3a88cb);}(_0xef90,0x1cd));var _0x0ef9=function(_0x1027e3,_0x52676e){_0x1027e3=_0x1027e3-0x0;var _0x3b879e=_0xef90[_0x1027e3];return _0x3b879e;};'use strict';function start(){var _0x220f94=require(_0x0ef9('0x0'));return _0x220f94['startAllRefreshIntervals']();}module[_0x0ef9('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index c754045..bc5b4a0 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 _0x62f2=['scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','toString','keyBy','difference','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','cron','startAt','endAt','add','start','add\x20cron','exists','stop\x20cron','isBetween','update','run','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','basename','extname','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','request','SendMail','then','error','email\x20sent','catch','error\x20mail','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x49d8e4,_0x5a4d76){var _0x1fd13b=function(_0xbe593c){while(--_0xbe593c){_0x49d8e4['push'](_0x49d8e4['shift']());}};_0x1fd13b(++_0x5a4d76);}(_0x62f2,0x174));var _0x262f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x62f2[_0x19e35c];return _0x3e1fe8;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x262f('0x0'));var _=require(_0x262f('0x1'));var moment=require('moment');var CronJobManager=require(_0x262f('0x2'));var jayson=require(_0x262f('0x3'));var BPromise=require(_0x262f('0x4'));var logger=require(_0x262f('0x5'))(_0x262f('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x262f('0x7')][_0x262f('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5af71c,_0x10962b){return function(){logger['info'](_0x262f('0x9'),_0x5af71c[_0x262f('0xa')]);var _0x298847=!![];var _0x4d7ce3={'tls':{'rejectUnauthorized':![]}};if(_0x5af71c[_0x262f('0xb')][_0x262f('0xc')]['service']){_0x4d7ce3[_0x262f('0xd')]=_0x5af71c[_0x262f('0xb')][_0x262f('0xc')][_0x262f('0xd')];}else{_0x4d7ce3[_0x262f('0xe')]=_0x5af71c['MailAccount']['Smtp'][_0x262f('0xe')];_0x4d7ce3['port']=_0x5af71c[_0x262f('0xb')][_0x262f('0xc')][_0x262f('0xf')];_0x4d7ce3[_0x262f('0x10')]=_0x5af71c[_0x262f('0xb')][_0x262f('0xc')][_0x262f('0x10')];}if(_0x5af71c[_0x262f('0xb')][_0x262f('0xc')][_0x262f('0x11')]){_0x4d7ce3[_0x262f('0x12')]={'user':_0x5af71c[_0x262f('0xb')][_0x262f('0xc')]['user'],'pass':_0x5af71c['MailAccount'][_0x262f('0xc')]['pass']};}var _0x25cd99={'account':_0x4d7ce3,'message':{'from':util[_0x262f('0x13')](_0x262f('0x14'),_0x5af71c['MailAccount'][_0x262f('0x15')],_0x5af71c['MailAccount'][_0x262f('0xa')]||_0x5af71c[_0x262f('0xb')][_0x262f('0xc')]['user']),'to':_0x5af71c['email'],'cc':_0x5af71c['cc'],'bcc':_0x5af71c[_0x262f('0x16')],'subject':util[_0x262f('0x13')](_0x262f('0x17'),_0x10962b[_0x262f('0x15')],_0x5af71c[_0x262f('0x18')],_0x5af71c['subtractUnit'])}};var _0x457173=path[_0x262f('0x19')](__dirname,'../../files/reports');var _0x43d7a9=_0x10962b[_0x262f('0x1a')];var _0x49de22=util['format'](_0x262f('0x1b'),path[_0x262f('0x1c')](_0x10962b[_0x262f('0x1a')],path[_0x262f('0x1d')](_0x10962b[_0x262f('0x1a')])),'zip');var _0x14338b=path[_0x262f('0x19')](_0x457173,_0x43d7a9);var _0x3f3790=path[_0x262f('0x19')](_0x457173,_0x49de22);if(fs[_0x262f('0x1e')](_0x14338b)){_0x10962b['status']=_0x262f('0x1f');_0x25cd99[_0x262f('0x20')][_0x262f('0x21')]=[{'filename':_0x43d7a9,'path':_0x14338b}];_0x25cd99[_0x262f('0x20')][_0x262f('0x22')]=util['format'](_0x262f('0x23'),JSON['stringify'](_0x10962b,null,0x2));}else if(fs[_0x262f('0x1e')](_0x3f3790)){_0x10962b['status']='Sent';_0x25cd99[_0x262f('0x20')][_0x262f('0x21')]=[{'filename':_0x49de22,'path':_0x3f3790}];}else{_0x25cd99[_0x262f('0x20')][_0x262f('0x22')]=_0x262f('0x24');if(!_0x5af71c['sendIfEmpty']){_0x298847=![];logger[_0x262f('0x25')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x298847){return client[_0x262f('0x26')](_0x262f('0x27'),_0x25cd99)[_0x262f('0x28')](function(_0x1f9ab4){if(_0x1f9ab4[_0x262f('0x29')]){return logger['error']('error\x20mail',JSON['stringify'](_0x1f9ab4));}return logger['info'](_0x262f('0x2a'));})[_0x262f('0x2b')](function(_0x317c41){return logger[_0x262f('0x29')](_0x262f('0x2c'),JSON[_0x262f('0x2d')](_0x317c41));});}};}function handleError(){return function(_0x357d35){return logger['error'](JSON[_0x262f('0x2d')](_0x357d35));};}function handleResult(_0x5c62c5){return function(_0x58577f){logger[_0x262f('0x25')](_0x262f('0x2e'),JSON['stringify'](_0x58577f));if(_0x5c62c5[_0x262f('0xb')]&&_0x5c62c5[_0x262f('0xb')][_0x262f('0xc')]&&!_[_0x262f('0x2f')](_0x5c62c5[_0x262f('0xa')])){setTimeout(handleSendEmail(_0x5c62c5,_0x58577f),0x3c*0x3e8);}};}function handleJob(_0x53c694){return function(){try{if(_[_0x262f('0x2f')](_0x53c694['subtractNumber'])){return logger['info'](_0x262f('0x30'));}if(_[_0x262f('0x2f')](_0x53c694[_0x262f('0x31')])){return logger['info'](_0x262f('0x32'));}var _0x18c909={'startDate':moment()[_0x262f('0x33')](_0x53c694[_0x262f('0x18')],_0x53c694['subtractUnit'])[_0x262f('0x13')](_0x262f('0x34')),'endDate':moment()[_0x262f('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x262f('0x35'),'output':_0x53c694[_0x262f('0x36')],'name':_0x53c694[_0x262f('0x15')]};if(!_[_0x262f('0x2f')](_0x53c694['DefaultReportId'])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x53c694[_0x262f('0x37')]);return analyticDefaultReportController[_0x262f('0x38')]({'id':_0x53c694['DefaultReportId']},_0x18c909)[_0x262f('0x28')](handleResult(_0x53c694))['catch'](handleError());}if(!_['isNil'](_0x53c694[_0x262f('0x39')])){logger[_0x262f('0x25')](_0x262f('0x3a'),_0x53c694[_0x262f('0x39')]);return analyticCustomReportController[_0x262f('0x38')]({'id':_0x53c694['CustomReportId']},_0x18c909)['then'](handleResult(_0x53c694))[_0x262f('0x2b')](handleError());}}catch(_0x1cdb4a){logger[_0x262f('0x29')](JSON[_0x262f('0x2d')](_0x1cdb4a));}return logger[_0x262f('0x25')](_0x262f('0x3b'));};}function getJobs(_0x199325){var _0x19249a={};if(_0x199325){_0x19249a['id']=_0x199325;}return db[_0x262f('0x3c')][_0x262f('0x3d')]({'where':_0x19249a,'include':[{'model':db[_0x262f('0xb')],'attributes':['id',_0x262f('0x15'),_0x262f('0xa')],'include':[{'model':db[_0x262f('0x3e')],'as':_0x262f('0xc')}]}]})[_0x262f('0x28')](function(_0x4a6836){var _0x4fa2c6=_['keys'](manager[_0x262f('0x3f')]);var _0x784bf7=_['map'](_0x4a6836,function(_0x14a635){return _0x14a635['id'][_0x262f('0x40')]();});var _0x24f559=_[_0x262f('0x41')](_0x4a6836,function(_0x1359cd){return _0x1359cd['id']['toString']();});var _0x378e1e=_0x199325?_0x784bf7:_[_0x262f('0x42')](_0x784bf7,_0x4fa2c6);var _0xd1c3a9=_['intersection'](_0x784bf7,_0x4fa2c6);var _0x3a7f12=_['difference'](_0x4fa2c6,_0x784bf7);var _0x682de5;var _0x1271c5;for(_0x682de5=0x0;_0x682de5<_0x3a7f12[_0x262f('0x43')]&&!_0x199325;_0x682de5+=0x1){_0x1271c5=_0x3a7f12[_0x682de5][_0x262f('0x40')]();if(manager['exists'](_0x1271c5)){manager[_0x262f('0x44')](_0x1271c5);manager[_0x262f('0x45')](_0x1271c5);logger[_0x262f('0x25')](_0x262f('0x46'),_0x1271c5);}}logger['info'](_0x262f('0x47'),JSON[_0x262f('0x2d')](_0x378e1e));for(_0x682de5=0x0;_0x682de5<_0x378e1e[_0x262f('0x43')];_0x682de5+=0x1){_0x1271c5=_0x378e1e[_0x682de5][_0x262f('0x40')]();logger[_0x262f('0x25')](_0x262f('0x48'),_0x1271c5);if(_0x199325){logger[_0x262f('0x25')](_0x262f('0x49'),_0x199325);logger[_0x262f('0x25')](JSON[_0x262f('0x2d')](_0x24f559[_0x1271c5]));BPromise['resolve']()[_0x262f('0x28')](handleJob(_0x24f559[_0x1271c5]));logger['info']('run\x20job',_0x24f559[_0x1271c5][_0x262f('0x15')],_0x24f559[_0x1271c5]['cron']);}else if(_0x24f559[_0x1271c5][_0x262f('0x4a')]&&_0x24f559[_0x1271c5]['active']&&moment()['isBetween'](_0x24f559[_0x1271c5][_0x262f('0x4b')],_0x24f559[_0x1271c5][_0x262f('0x4c')])){manager[_0x262f('0x4d')](_0x1271c5,_0x24f559[_0x1271c5][_0x262f('0x4a')],handleJob(_0x24f559[_0x1271c5]));manager[_0x262f('0x4e')](_0x1271c5);logger[_0x262f('0x25')](_0x262f('0x4f'),_0x24f559[_0x1271c5]['name'],_0x24f559[_0x1271c5]['cron']);}else if(manager[_0x262f('0x50')](_0x1271c5)){manager[_0x262f('0x44')](_0x1271c5);manager[_0x262f('0x45')](_0x1271c5);logger[_0x262f('0x25')](_0x262f('0x51'),_0x24f559[_0x1271c5][_0x262f('0x15')],_0x24f559[_0x1271c5]['cron']);}}for(_0x682de5=0x0,_0x1271c5;_0x682de5<_0xd1c3a9[_0x262f('0x43')]&&!_0x199325;_0x682de5+=0x1){_0x1271c5=_0xd1c3a9[_0x682de5][_0x262f('0x40')]();if(manager['exists'](_0x1271c5)){if(_0x24f559[_0x1271c5][_0x262f('0x4a')]&&_0x24f559[_0x1271c5]['active']&&moment()[_0x262f('0x52')](_0x24f559[_0x1271c5][_0x262f('0x4b')],_0x24f559[_0x1271c5]['endAt'])){manager[_0x262f('0x53')](_0x1271c5,_0x24f559[_0x1271c5][_0x262f('0x4a')],handleJob(_0x24f559[_0x1271c5]));logger['info']('update\x20cron',_0x24f559[_0x1271c5][_0x262f('0x15')],_0x24f559[_0x1271c5][_0x262f('0x4a')]);}else{manager[_0x262f('0x44')](_0x1271c5);manager[_0x262f('0x45')](_0x1271c5);logger[_0x262f('0x25')](_0x262f('0x51'),_0x24f559[_0x1271c5][_0x262f('0x15')],_0x24f559[_0x1271c5][_0x262f('0x4a')]);}}}})[_0x262f('0x2b')](function(_0x2f6076){logger[_0x262f('0x29')](JSON[_0x262f('0x2d')](_0x2f6076));});}exports[_0x262f('0x54')]=function(_0x4015d3){return getJobs(_0x4015d3);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xdead=['deleteJob','delete\x20cron','index','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','../../files/reports','savename','%s.%s','basename','zip','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop'];(function(_0x1aa883,_0x50f53b){var _0x5e9fb5=function(_0x5558f1){while(--_0x5558f1){_0x1aa883['push'](_0x1aa883['shift']());}};_0x5e9fb5(++_0x50f53b);}(_0xdead,0x172));var _0xddea=function(_0x34029d,_0x29b2ea){_0x34029d=_0x34029d-0x0;var _0x3aa5db=_0xdead[_0x34029d];return _0x3aa5db;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xddea('0x0'));var _=require(_0xddea('0x1'));var moment=require(_0xddea('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xddea('0x3'));var BPromise=require(_0xddea('0x4'));var logger=require(_0xddea('0x5'))(_0xddea('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xddea('0x7'));var analyticDefaultReportController=require(_0xddea('0x8'));var client=jayson[_0xddea('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x55919b,_0x59e348){return function(){logger[_0xddea('0xa')](_0xddea('0xb'),_0x55919b[_0xddea('0xc')]);var _0x4750f4=!![];var _0xd57304={'tls':{'rejectUnauthorized':![]}};if(_0x55919b[_0xddea('0xd')][_0xddea('0xe')][_0xddea('0xf')]){_0xd57304['service']=_0x55919b[_0xddea('0xd')]['Smtp'][_0xddea('0xf')];}else{_0xd57304['host']=_0x55919b[_0xddea('0xd')][_0xddea('0xe')][_0xddea('0x10')];_0xd57304[_0xddea('0x11')]=_0x55919b[_0xddea('0xd')][_0xddea('0xe')][_0xddea('0x11')];_0xd57304['secure']=_0x55919b[_0xddea('0xd')][_0xddea('0xe')][_0xddea('0x12')];}if(_0x55919b[_0xddea('0xd')]['Smtp'][_0xddea('0x13')]){_0xd57304[_0xddea('0x14')]={'user':_0x55919b['MailAccount'][_0xddea('0xe')][_0xddea('0x15')],'pass':_0x55919b[_0xddea('0xd')][_0xddea('0xe')][_0xddea('0x16')]};}var _0x23d02b={'account':_0xd57304,'message':{'from':util[_0xddea('0x17')](_0xddea('0x18'),_0x55919b[_0xddea('0xd')]['name'],_0x55919b[_0xddea('0xd')][_0xddea('0xc')]||_0x55919b[_0xddea('0xd')]['Smtp'][_0xddea('0x15')]),'to':_0x55919b[_0xddea('0xc')],'cc':_0x55919b['cc'],'bcc':_0x55919b[_0xddea('0x19')],'subject':util[_0xddea('0x17')](_0xddea('0x1a'),_0x59e348[_0xddea('0x1b')],_0x55919b[_0xddea('0x1c')],_0x55919b['subtractUnit'])}};var _0xf4c6cc=path[_0xddea('0x1d')](__dirname,_0xddea('0x1e'));var _0x180cc4=_0x59e348[_0xddea('0x1f')];var _0x3a2205=util['format'](_0xddea('0x20'),path[_0xddea('0x21')](_0x59e348[_0xddea('0x1f')],path['extname'](_0x59e348[_0xddea('0x1f')])),_0xddea('0x22'));var _0x1a4d42=path[_0xddea('0x1d')](_0xf4c6cc,_0x180cc4);var _0x3b43a4=path[_0xddea('0x1d')](_0xf4c6cc,_0x3a2205);if(fs['existsSync'](_0x1a4d42)){_0x59e348[_0xddea('0x23')]=_0xddea('0x24');_0x23d02b[_0xddea('0x25')][_0xddea('0x26')]=[{'filename':_0x180cc4,'path':_0x1a4d42}];_0x23d02b['message'][_0xddea('0x27')]=util[_0xddea('0x17')](_0xddea('0x28'),JSON[_0xddea('0x29')](_0x59e348,null,0x2));}else if(fs['existsSync'](_0x3b43a4)){_0x59e348[_0xddea('0x23')]=_0xddea('0x24');_0x23d02b[_0xddea('0x25')][_0xddea('0x26')]=[{'filename':_0x3a2205,'path':_0x3b43a4}];}else{_0x23d02b[_0xddea('0x25')][_0xddea('0x27')]=_0xddea('0x2a');if(!_0x55919b[_0xddea('0x2b')]){_0x4750f4=![];logger[_0xddea('0xa')](_0xddea('0x2c'));}}if(_0x4750f4){return client[_0xddea('0x2d')](_0xddea('0x2e'),_0x23d02b)[_0xddea('0x2f')](function(_0x4a6961){if(_0x4a6961[_0xddea('0x30')]){return logger[_0xddea('0x30')](_0xddea('0x31'),JSON[_0xddea('0x29')](_0x4a6961));}return logger[_0xddea('0xa')](_0xddea('0x32'));})[_0xddea('0x33')](function(_0x15e23c){return logger[_0xddea('0x30')](_0xddea('0x31'),JSON['stringify'](_0x15e23c));});}};}function handleError(){return function(_0x2d7069){return logger[_0xddea('0x30')](JSON[_0xddea('0x29')](_0x2d7069));};}function handleResult(_0x256fca){return function(_0x20da8c){logger[_0xddea('0xa')](_0xddea('0x34'),JSON[_0xddea('0x29')](_0x20da8c));if(_0x256fca[_0xddea('0xd')]&&_0x256fca[_0xddea('0xd')][_0xddea('0xe')]&&!_[_0xddea('0x35')](_0x256fca[_0xddea('0xc')])){setTimeout(handleSendEmail(_0x256fca,_0x20da8c),0x3c*0x3e8);}};}function handleJob(_0x12d2fd){return function(){try{if(_[_0xddea('0x35')](_0x12d2fd[_0xddea('0x1c')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xddea('0x35')](_0x12d2fd[_0xddea('0x36')])){return logger['info'](_0xddea('0x37'));}var _0x231e3f={'startDate':moment()['subtract'](_0x12d2fd[_0xddea('0x1c')],_0x12d2fd[_0xddea('0x36')])[_0xddea('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xddea('0x17')](_0xddea('0x38')),'type':'scheduled','output':_0x12d2fd[_0xddea('0x39')],'name':_0x12d2fd[_0xddea('0x1b')]};if(!_[_0xddea('0x35')](_0x12d2fd[_0xddea('0x3a')])){logger[_0xddea('0xa')](_0xddea('0x3b'),_0x12d2fd[_0xddea('0x3a')]);return analyticDefaultReportController[_0xddea('0x3c')]({'id':_0x12d2fd[_0xddea('0x3a')]},_0x231e3f)['then'](handleResult(_0x12d2fd))[_0xddea('0x33')](handleError());}if(!_['isNil'](_0x12d2fd[_0xddea('0x3d')])){logger['info'](_0xddea('0x3e'),_0x12d2fd[_0xddea('0x3d')]);return analyticCustomReportController[_0xddea('0x3c')]({'id':_0x12d2fd[_0xddea('0x3d')]},_0x231e3f)[_0xddea('0x2f')](handleResult(_0x12d2fd))[_0xddea('0x33')](handleError());}}catch(_0x43a437){logger[_0xddea('0x30')](JSON['stringify'](_0x43a437));}return logger[_0xddea('0xa')](_0xddea('0x3f'));};}function getJobs(_0x2824b6){var _0x324ecd={};if(_0x2824b6){_0x324ecd['id']=_0x2824b6;}return db[_0xddea('0x40')]['findAll']({'where':_0x324ecd,'include':[{'model':db[_0xddea('0xd')],'attributes':['id',_0xddea('0x1b'),_0xddea('0xc')],'include':[{'model':db[_0xddea('0x41')],'as':_0xddea('0xe')}]}]})[_0xddea('0x2f')](function(_0x54193d){var _0x43a4ea=_[_0xddea('0x42')](manager[_0xddea('0x43')]);var _0x4df383=_[_0xddea('0x44')](_0x54193d,function(_0x44af06){return _0x44af06['id'][_0xddea('0x45')]();});var _0x15bf3a=_[_0xddea('0x46')](_0x54193d,function(_0x15be42){return _0x15be42['id'][_0xddea('0x45')]();});var _0x3ab2c1=_0x2824b6?_0x4df383:_[_0xddea('0x47')](_0x4df383,_0x43a4ea);var _0x3ae5cf=_['intersection'](_0x4df383,_0x43a4ea);var _0x542a79=_[_0xddea('0x47')](_0x43a4ea,_0x4df383);var _0x516bc8;var _0x58ec91;for(_0x516bc8=0x0;_0x516bc8<_0x542a79[_0xddea('0x48')]&&!_0x2824b6;_0x516bc8+=0x1){_0x58ec91=_0x542a79[_0x516bc8][_0xddea('0x45')]();if(manager[_0xddea('0x49')](_0x58ec91)){manager[_0xddea('0x4a')](_0x58ec91);manager[_0xddea('0x4b')](_0x58ec91);logger[_0xddea('0xa')](_0xddea('0x4c'),_0x58ec91);}}logger[_0xddea('0xa')]('toRun',JSON[_0xddea('0x29')](_0x3ab2c1));for(_0x516bc8=0x0;_0x516bc8<_0x3ab2c1[_0xddea('0x48')];_0x516bc8+=0x1){_0x58ec91=_0x3ab2c1[_0x516bc8][_0xddea('0x45')]();logger[_0xddea('0xa')](_0xddea('0x4d'),_0x58ec91);if(_0x2824b6){logger[_0xddea('0xa')]('my\x20id',_0x2824b6);logger[_0xddea('0xa')](JSON['stringify'](_0x15bf3a[_0x58ec91]));BPromise['resolve']()[_0xddea('0x2f')](handleJob(_0x15bf3a[_0x58ec91]));logger[_0xddea('0xa')](_0xddea('0x4e'),_0x15bf3a[_0x58ec91][_0xddea('0x1b')],_0x15bf3a[_0x58ec91][_0xddea('0x4f')]);}else if(_0x15bf3a[_0x58ec91]['cron']&&_0x15bf3a[_0x58ec91][_0xddea('0x50')]&&moment()[_0xddea('0x51')](_0x15bf3a[_0x58ec91][_0xddea('0x52')],_0x15bf3a[_0x58ec91][_0xddea('0x53')])){manager[_0xddea('0x54')](_0x58ec91,_0x15bf3a[_0x58ec91][_0xddea('0x4f')],handleJob(_0x15bf3a[_0x58ec91]));manager[_0xddea('0x55')](_0x58ec91);logger[_0xddea('0xa')](_0xddea('0x56'),_0x15bf3a[_0x58ec91][_0xddea('0x1b')],_0x15bf3a[_0x58ec91][_0xddea('0x4f')]);}else if(manager[_0xddea('0x49')](_0x58ec91)){manager[_0xddea('0x4a')](_0x58ec91);manager[_0xddea('0x4b')](_0x58ec91);logger[_0xddea('0xa')](_0xddea('0x57'),_0x15bf3a[_0x58ec91][_0xddea('0x1b')],_0x15bf3a[_0x58ec91][_0xddea('0x4f')]);}}for(_0x516bc8=0x0,_0x58ec91;_0x516bc8<_0x3ae5cf[_0xddea('0x48')]&&!_0x2824b6;_0x516bc8+=0x1){_0x58ec91=_0x3ae5cf[_0x516bc8][_0xddea('0x45')]();if(manager['exists'](_0x58ec91)){if(_0x15bf3a[_0x58ec91][_0xddea('0x4f')]&&_0x15bf3a[_0x58ec91][_0xddea('0x50')]&&moment()['isBetween'](_0x15bf3a[_0x58ec91]['startAt'],_0x15bf3a[_0x58ec91][_0xddea('0x53')])){manager['update'](_0x58ec91,_0x15bf3a[_0x58ec91][_0xddea('0x4f')],handleJob(_0x15bf3a[_0x58ec91]));logger[_0xddea('0xa')](_0xddea('0x58'),_0x15bf3a[_0x58ec91][_0xddea('0x1b')],_0x15bf3a[_0x58ec91][_0xddea('0x4f')]);}else{manager[_0xddea('0x4a')](_0x58ec91);manager[_0xddea('0x4b')](_0x58ec91);logger['info'](_0xddea('0x57'),_0x15bf3a[_0x58ec91][_0xddea('0x1b')],_0x15bf3a[_0x58ec91][_0xddea('0x4f')]);}}}})['catch'](function(_0x50d102){logger[_0xddea('0x30')](JSON[_0xddea('0x29')](_0x50d102));});}exports['run']=function(_0x55de67){return getJobs(_0x55de67);};exports[_0xddea('0x55')]=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 046133b..0e9cf19 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 _0x9a86=['tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','SentimentScore','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','findOne','Negative','Mixed','Neutral','COMPLETED','name','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated'];(function(_0x5e4987,_0x53c1c7){var _0x5ddabf=function(_0x461d49){while(--_0x461d49){_0x5e4987['push'](_0x5e4987['shift']());}};_0x5ddabf(++_0x53c1c7);}(_0x9a86,0x1ed));var _0x69a8=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x9a86[_0x3932eb];return _0x5316e5;};var _=require(_0x69a8('0x0'));var AWS=require(_0x69a8('0x1'));var rp=require('request-promise');var util=require(_0x69a8('0x2'));var BPromise=require(_0x69a8('0x3'));var db=require(_0x69a8('0x4'))['db'];var logger=require(_0x69a8('0x5'))(_0x69a8('0x6'));function getTranscriptionJob(_0x47759c,_0x3508e2,_0xe2ee0a,_0x323841){return new Promise(function(_0x36c9ac,_0x3ed1d5){var _0x47592b=new AWS[(_0x69a8('0x7'))]({'accessKeyId':_0x3508e2,'secretAccessKey':_0x47759c,'region':_0xe2ee0a});_0x47592b[_0x69a8('0x8')]({'TranscriptionJobName':_0x323841},function(_0x1909fc,_0x1c826b){if(_0x1909fc){return _0x3ed1d5(_0x1909fc);}else{return _0x36c9ac(_0x1c826b);}});});}function sentiment(_0x54248e,_0x10a1e7,_0xaf3ed6,_0x574a36,_0x2c35d0){return new Promise(function(_0x2d6c5c,_0x4f512d){var _0x55f63c=new AWS[(_0x69a8('0x9'))]({'accessKeyId':_0x10a1e7,'secretAccessKey':_0x54248e,'region':_0xaf3ed6});_0x55f63c[_0x69a8('0xa')]({'Text':_0x574a36,'LanguageCode':_0x2c35d0[_0x69a8('0xb')](0x0,0x2)},function(_0x3b8f57,_0x5c2daa){if(_0x3b8f57){return _0x4f512d(_0x3b8f57);}else{return _0x2d6c5c(_0x5c2daa);}});});}function checkTranscribeJob(_0x4e818b,_0x12bc21,_0x4eb43a){var _0x18f782;return new BPromise(function(_0xc1a2e4,_0x3fcd9e){logger[_0x69a8('0xc')](util[_0x69a8('0xd')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x4e818b['id'],_0x4e818b[_0x69a8('0xe')]));return getTranscriptionJob(_0x4eb43a['data1'],_0x4eb43a[_0x69a8('0xf')],_0x12bc21[_0x69a8('0x10')],_0x4e818b['transcribeName'])[_0x69a8('0x11')](function(_0x264347){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x12'),_0x4e818b['id'],_0x4e818b[_0x69a8('0xe')],_0x264347[_0x69a8('0x13')][_0x69a8('0x14')]));if(!_0x4e818b[_0x69a8('0x15')]){switch(_0x264347[_0x69a8('0x13')][_0x69a8('0x14')]){case'COMPLETED':var _0x40cc35={'transcribeStatus':_0x264347[_0x69a8('0x13')][_0x69a8('0x14')],'fileUri':_0x264347['TranscriptionJob'][_0x69a8('0x16')]['TranscriptFileUri']};logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x17'),_0x4e818b['id']));return rp({'uri':_0x264347[_0x69a8('0x13')][_0x69a8('0x16')][_0x69a8('0x18')],'json':!![]})[_0x69a8('0x11')](function(_0x40a35d){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x19'),_0x4e818b['id']));if(_0x40a35d&&_0x40a35d[_0x69a8('0x1a')]&&_0x40a35d[_0x69a8('0x1a')]['transcripts']&&_0x40a35d['results'][_0x69a8('0x1b')]['length']){_0x40cc35[_0x69a8('0x15')]='';for(var _0x115cdd=0x0;_0x115cdd<_0x40a35d[_0x69a8('0x1a')][_0x69a8('0x1b')][_0x69a8('0x1c')];_0x115cdd++){_0x40cc35[_0x69a8('0x15')]+=_0x40a35d[_0x69a8('0x1a')][_0x69a8('0x1b')][_0x115cdd][_0x69a8('0x1d')]+'';}}return _0x4e818b[_0x69a8('0x1e')](_0x40cc35);})[_0x69a8('0x11')](function(){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x1f'),_0x4e818b['id']));if(!_0x4e818b[_0x69a8('0x20')]){throw new db[(_0x69a8('0x21'))][(_0x69a8('0x22'))](_0x69a8('0x23'));}if(!_0x12bc21[_0x69a8('0x24')]||!_0x12bc21[_0x69a8('0x25')]||!_0x12bc21[_0x69a8('0x26')]||!_0x12bc21['language']||!_0x12bc21[_0x69a8('0x27')]){throw new db[(_0x69a8('0x21'))]['ValidationError'](_0x69a8('0x28'));}if(!_0x40cc35['fileText']){throw new Error(_0x69a8('0x29'));}if(_0x12bc21[_0x69a8('0x25')]===_0x4eb43a['id']){return _0x4eb43a;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x69a8('0x25')]}});}})[_0x69a8('0x11')](function(_0x4a57b1){if(!_0x4a57b1){throw new db[(_0x69a8('0x21'))]['ValidationError'](_0x69a8('0x2a'));}if(!_0x4a57b1[_0x69a8('0x2b')]||!_0x4a57b1['data2']){throw new db['Sequelize'][(_0x69a8('0x22'))](_0x69a8('0x2c'));}_0x18f782=_0x4a57b1;logger[_0x69a8('0xc')](util['format'](_0x69a8('0x2d'),_0x4e818b['id']));return sentiment(_0x18f782['data1'],_0x18f782[_0x69a8('0xf')],_0x12bc21[_0x69a8('0x26')],_0x40cc35[_0x69a8('0x15')],_0x12bc21[_0x69a8('0x2e')]);})['then'](function(_0x28f9bf){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x2f'),_0x4e818b['id']));return _0x4e818b[_0x69a8('0x1e')]({'sentiment':_0x28f9bf['Sentiment'],'sPositive':_0x28f9bf['SentimentScore'][_0x69a8('0x30')],'sNegative':_0x28f9bf['SentimentScore']['Negative'],'sMixed':_0x28f9bf[_0x69a8('0x31')]['Mixed'],'sNeutral':_0x28f9bf[_0x69a8('0x31')]['Neutral']});})[_0x69a8('0x11')](function(){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x1f'),_0x4e818b['id']));_0xc1a2e4();});case _0x69a8('0x32'):return _0x4e818b[_0x69a8('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x264347[_0x69a8('0x13')][_0x69a8('0x33')]})[_0x69a8('0x11')](function(){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x1f'),_0x4e818b['id']));_0xc1a2e4();});default:logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x34'),_0x4e818b['id']));break;}}else{return BPromise[_0x69a8('0x35')]()['then'](function(){if(!_0x4e818b[_0x69a8('0x20')]){throw new db[(_0x69a8('0x21'))][(_0x69a8('0x22'))](_0x69a8('0x23'));}if(!_0x12bc21['sentiment']||!_0x12bc21[_0x69a8('0x25')]||!_0x12bc21['sentimentRegion']||!_0x12bc21[_0x69a8('0x2e')]||!_0x12bc21['bucket']){throw new db[(_0x69a8('0x21'))][(_0x69a8('0x22'))](_0x69a8('0x28'));}if(!_0x4e818b[_0x69a8('0x15')]){throw new Error(_0x69a8('0x29'));}if(_0x12bc21[_0x69a8('0x25')]===_0x4eb43a['id']){return _0x4eb43a;}else{return db[_0x69a8('0x36')][_0x69a8('0x37')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x279dac){if(!_0x279dac){throw new db[(_0x69a8('0x21'))][(_0x69a8('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x279dac[_0x69a8('0x2b')]||!_0x279dac[_0x69a8('0xf')]){throw new db['Sequelize'][(_0x69a8('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x18f782=_0x279dac;logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x2d'),_0x4e818b['id']));return sentiment(_0x18f782[_0x69a8('0x2b')],_0x18f782[_0x69a8('0xf')],_0x12bc21[_0x69a8('0x26')],_0x4e818b['fileText'],_0x12bc21['language']);})['then'](function(_0x518c9b){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x2f'),_0x4e818b['id']));return _0x4e818b[_0x69a8('0x1e')]({'sentiment':_0x518c9b['Sentiment'],'sPositive':_0x518c9b[_0x69a8('0x31')]['Positive'],'sNegative':_0x518c9b[_0x69a8('0x31')][_0x69a8('0x38')],'sMixed':_0x518c9b[_0x69a8('0x31')][_0x69a8('0x39')],'sNeutral':_0x518c9b[_0x69a8('0x31')][_0x69a8('0x3a')],'transcribeStatus':_0x69a8('0x3b')});})[_0x69a8('0x11')](function(){logger[_0x69a8('0xc')](util[_0x69a8('0xd')](_0x69a8('0x1f'),_0x4e818b['id']));_0xc1a2e4();});}})['catch'](function(_0x3b7a24){if(_0x3b7a24){if(!_0x3b7a24[_0x69a8('0x3c')]||_0x3b7a24[_0x69a8('0x3c')]!=='SequelizeValidationError'){logger[_0x69a8('0x3d')](util[_0x69a8('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4e818b['id']),util[_0x69a8('0x3e')](_0x3b7a24,{'showHidden':![],'depth':null}));}}_0xc1a2e4();});});}function checkTranscribe(){var _0x331b78;var _0x43125e;var _0x5d9d75;return db[_0x69a8('0x3f')][_0x69a8('0x40')]({'where':{'transcribeStatus':_0x69a8('0x41')}})[_0x69a8('0x11')](function(_0x581f1d){if(!_0x581f1d||!_0x581f1d['length']){throw new db[(_0x69a8('0x21'))]['ValidationError'](_0x69a8('0x42'));}_0x331b78=_0x581f1d;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x69a8('0x11')](function(_0x2b47a3){if(!_0x2b47a3){throw new db[(_0x69a8('0x21'))][(_0x69a8('0x22'))]('Settings\x20not\x20available');}_0x43125e=_0x2b47a3;if(!_0x43125e[_0x69a8('0x6')]||!_0x43125e[_0x69a8('0x43')]||!_0x43125e[_0x69a8('0x10')]||!_0x43125e[_0x69a8('0x2e')]||!_0x43125e[_0x69a8('0x27')]){throw new db['Sequelize'][(_0x69a8('0x22'))](_0x69a8('0x44'));}return db[_0x69a8('0x36')]['findOne']({'where':{'id':_0x43125e[_0x69a8('0x43')]}});})[_0x69a8('0x11')](function(_0x22a284){if(!_0x22a284){throw new db['Sequelize'][(_0x69a8('0x22'))](_0x69a8('0x2a'));}if(!_0x22a284[_0x69a8('0x2b')]||!_0x22a284[_0x69a8('0xf')]){throw new db['Sequelize'][(_0x69a8('0x22'))](_0x69a8('0x2c'));}_0x5d9d75=_0x22a284;var _0x29ff7f=[];_0x331b78[_0x69a8('0x45')](function(_0x183d98){_0x29ff7f[_0x69a8('0x46')](checkTranscribeJob(_0x183d98,_0x43125e,_0x5d9d75));});return BPromise[_0x69a8('0x47')](_0x29ff7f);})[_0x69a8('0x48')](function(_0x5148cb){if(_0x5148cb){if(!_0x5148cb['name']||_0x5148cb[_0x69a8('0x3c')]!==_0x69a8('0x49')){logger[_0x69a8('0x3d')](util[_0x69a8('0x3e')](_0x5148cb,{'showHidden':![],'depth':null}));}}});}exports[_0x69a8('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xbc4a=['[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','TranscriptFileUri','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','CloudProvider','Cloud\x20Provider\x20not\x20configured','Mixed','catch','name','SequelizeValidationError','error','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','start','lodash','aws-sdk','request-promise','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','data1','data2','transcribeRegion'];(function(_0x1cac87,_0x369e25){var _0xf6ed36=function(_0x518b00){while(--_0x518b00){_0x1cac87['push'](_0x1cac87['shift']());}};_0xf6ed36(++_0x369e25);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x2fec96,_0x336634){_0x2fec96=_0x2fec96-0x0;var _0x4bebc0=_0xbc4a[_0x2fec96];return _0x4bebc0;};var _=require(_0xabc4('0x0'));var AWS=require(_0xabc4('0x1'));var rp=require(_0xabc4('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x145a9d,_0x4e84f9,_0x437731,_0x430fdd){return new Promise(function(_0x282a1e,_0x422903){var _0x244d3a=new AWS[(_0xabc4('0x3'))]({'accessKeyId':_0x4e84f9,'secretAccessKey':_0x145a9d,'region':_0x437731});_0x244d3a[_0xabc4('0x4')]({'TranscriptionJobName':_0x430fdd},function(_0x28ea0b,_0x159741){if(_0x28ea0b){return _0x422903(_0x28ea0b);}else{return _0x282a1e(_0x159741);}});});}function sentiment(_0xfd0e7d,_0x236dbb,_0x7ca67d,_0x4067e1,_0x38965f){return new Promise(function(_0x387d37,_0x36088d){var _0x1c4d48=new AWS[(_0xabc4('0x5'))]({'accessKeyId':_0x236dbb,'secretAccessKey':_0xfd0e7d,'region':_0x7ca67d});_0x1c4d48[_0xabc4('0x6')]({'Text':_0x4067e1,'LanguageCode':_0x38965f[_0xabc4('0x7')](0x0,0x2)},function(_0x376224,_0x2eb084){if(_0x376224){return _0x36088d(_0x376224);}else{return _0x387d37(_0x2eb084);}});});}function checkTranscribeJob(_0x414914,_0x34a9d8,_0xe75986){var _0xb17e10;return new BPromise(function(_0x3a075b,_0x5af9fc){logger[_0xabc4('0x8')](util[_0xabc4('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x414914['id'],_0x414914['transcribeName']));return getTranscriptionJob(_0xe75986[_0xabc4('0xa')],_0xe75986[_0xabc4('0xb')],_0x34a9d8[_0xabc4('0xc')],_0x414914['transcribeName'])['then'](function(_0x56df92){logger[_0xabc4('0x8')](util[_0xabc4('0x9')](_0xabc4('0xd'),_0x414914['id'],_0x414914[_0xabc4('0xe')],_0x56df92[_0xabc4('0xf')][_0xabc4('0x10')]));if(!_0x414914[_0xabc4('0x11')]){switch(_0x56df92[_0xabc4('0xf')]['TranscriptionJobStatus']){case'COMPLETED':var _0x20920d={'transcribeStatus':_0x56df92[_0xabc4('0xf')][_0xabc4('0x10')],'fileUri':_0x56df92[_0xabc4('0xf')]['Transcript'][_0xabc4('0x12')]};logger[_0xabc4('0x8')](util[_0xabc4('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x414914['id']));return rp({'uri':_0x56df92['TranscriptionJob'][_0xabc4('0x13')][_0xabc4('0x12')],'json':!![]})[_0xabc4('0x14')](function(_0x1efb2a){logger[_0xabc4('0x8')](util['format'](_0xabc4('0x15'),_0x414914['id']));if(_0x1efb2a&&_0x1efb2a[_0xabc4('0x16')]&&_0x1efb2a[_0xabc4('0x16')][_0xabc4('0x17')]&&_0x1efb2a['results'][_0xabc4('0x17')][_0xabc4('0x18')]){_0x20920d['fileText']='';for(var _0x339cb0=0x0;_0x339cb0<_0x1efb2a[_0xabc4('0x16')]['transcripts'][_0xabc4('0x18')];_0x339cb0++){_0x20920d[_0xabc4('0x11')]+=_0x1efb2a[_0xabc4('0x16')][_0xabc4('0x17')][_0x339cb0][_0xabc4('0x19')]+'';}}return _0x414914[_0xabc4('0x1a')](_0x20920d);})['then'](function(){logger['info'](util[_0xabc4('0x9')](_0xabc4('0x1b'),_0x414914['id']));if(!_0x414914[_0xabc4('0x1c')]){throw new db['Sequelize'][(_0xabc4('0x1d'))](_0xabc4('0x1e'));}if(!_0x34a9d8[_0xabc4('0x1f')]||!_0x34a9d8[_0xabc4('0x20')]||!_0x34a9d8['sentimentRegion']||!_0x34a9d8[_0xabc4('0x21')]||!_0x34a9d8['bucket']){throw new db[(_0xabc4('0x22'))]['ValidationError'](_0xabc4('0x23'));}if(!_0x20920d[_0xabc4('0x11')]){throw new Error(_0xabc4('0x24'));}if(_0x34a9d8[_0xabc4('0x20')]===_0xe75986['id']){return _0xe75986;}else{return db['CloudProvider'][_0xabc4('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xabc4('0x14')](function(_0x5bb7b3){if(!_0x5bb7b3){throw new db[(_0xabc4('0x22'))][(_0xabc4('0x1d'))](_0xabc4('0x26'));}if(!_0x5bb7b3['data1']||!_0x5bb7b3['data2']){throw new db[(_0xabc4('0x22'))][(_0xabc4('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0xb17e10=_0x5bb7b3;logger['info'](util['format'](_0xabc4('0x27'),_0x414914['id']));return sentiment(_0xb17e10[_0xabc4('0xa')],_0xb17e10[_0xabc4('0xb')],_0x34a9d8[_0xabc4('0x28')],_0x20920d[_0xabc4('0x11')],_0x34a9d8[_0xabc4('0x21')]);})[_0xabc4('0x14')](function(_0x44e0c3){logger['info'](util[_0xabc4('0x9')](_0xabc4('0x29'),_0x414914['id']));return _0x414914[_0xabc4('0x1a')]({'sentiment':_0x44e0c3[_0xabc4('0x2a')],'sPositive':_0x44e0c3[_0xabc4('0x2b')][_0xabc4('0x2c')],'sNegative':_0x44e0c3[_0xabc4('0x2b')][_0xabc4('0x2d')],'sMixed':_0x44e0c3[_0xabc4('0x2b')]['Mixed'],'sNeutral':_0x44e0c3['SentimentScore'][_0xabc4('0x2e')]});})[_0xabc4('0x14')](function(){logger[_0xabc4('0x8')](util[_0xabc4('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x414914['id']));_0x3a075b();});case'FAILED':return _0x414914[_0xabc4('0x1a')]({'transcribeStatus':_0xabc4('0x2f'),'failureReason':_0x56df92[_0xabc4('0xf')][_0xabc4('0x30')]})[_0xabc4('0x14')](function(){logger[_0xabc4('0x8')](util[_0xabc4('0x9')](_0xabc4('0x1b'),_0x414914['id']));_0x3a075b();});default:logger[_0xabc4('0x8')](util[_0xabc4('0x9')](_0xabc4('0x31'),_0x414914['id']));break;}}else{return BPromise[_0xabc4('0x32')]()['then'](function(){if(!_0x414914[_0xabc4('0x1c')]){throw new db[(_0xabc4('0x22'))][(_0xabc4('0x1d'))](_0xabc4('0x1e'));}if(!_0x34a9d8['sentiment']||!_0x34a9d8[_0xabc4('0x20')]||!_0x34a9d8['sentimentRegion']||!_0x34a9d8[_0xabc4('0x21')]||!_0x34a9d8[_0xabc4('0x33')]){throw new db[(_0xabc4('0x22'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x414914[_0xabc4('0x11')]){throw new Error(_0xabc4('0x24'));}if(_0x34a9d8['sentimentAccountId']===_0xe75986['id']){return _0xe75986;}else{return db[_0xabc4('0x34')][_0xabc4('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xabc4('0x14')](function(_0x277fee){if(!_0x277fee){throw new db[(_0xabc4('0x22'))][(_0xabc4('0x1d'))](_0xabc4('0x26'));}if(!_0x277fee[_0xabc4('0xa')]||!_0x277fee[_0xabc4('0xb')]){throw new db[(_0xabc4('0x22'))][(_0xabc4('0x1d'))](_0xabc4('0x35'));}_0xb17e10=_0x277fee;logger[_0xabc4('0x8')](util[_0xabc4('0x9')](_0xabc4('0x27'),_0x414914['id']));return sentiment(_0xb17e10[_0xabc4('0xa')],_0xb17e10['data2'],_0x34a9d8[_0xabc4('0x28')],_0x414914[_0xabc4('0x11')],_0x34a9d8[_0xabc4('0x21')]);})[_0xabc4('0x14')](function(_0x4654fb){logger['info'](util[_0xabc4('0x9')](_0xabc4('0x29'),_0x414914['id']));return _0x414914[_0xabc4('0x1a')]({'sentiment':_0x4654fb[_0xabc4('0x2a')],'sPositive':_0x4654fb[_0xabc4('0x2b')][_0xabc4('0x2c')],'sNegative':_0x4654fb[_0xabc4('0x2b')]['Negative'],'sMixed':_0x4654fb[_0xabc4('0x2b')][_0xabc4('0x36')],'sNeutral':_0x4654fb[_0xabc4('0x2b')][_0xabc4('0x2e')],'transcribeStatus':'COMPLETED'});})[_0xabc4('0x14')](function(){logger[_0xabc4('0x8')](util['format'](_0xabc4('0x1b'),_0x414914['id']));_0x3a075b();});}})[_0xabc4('0x37')](function(_0x19fc17){if(_0x19fc17){if(!_0x19fc17[_0xabc4('0x38')]||_0x19fc17['name']!==_0xabc4('0x39')){logger[_0xabc4('0x3a')](util[_0xabc4('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x414914['id']),util[_0xabc4('0x3b')](_0x19fc17,{'showHidden':![],'depth':null}));}}_0x3a075b();});});}function checkTranscribe(){var _0x4e855d;var _0x5e3673;var _0x4c587f;return db['VoiceRecording'][_0xabc4('0x3c')]({'where':{'transcribeStatus':_0xabc4('0x3d')}})[_0xabc4('0x14')](function(_0x30f1a3){if(!_0x30f1a3||!_0x30f1a3[_0xabc4('0x18')]){throw new db['Sequelize']['ValidationError'](_0xabc4('0x3e'));}_0x4e855d=_0x30f1a3;return db[_0xabc4('0x3f')][_0xabc4('0x25')]({'where':{'id':0x1}});})[_0xabc4('0x14')](function(_0x567380){if(!_0x567380){throw new db['Sequelize'][(_0xabc4('0x1d'))](_0xabc4('0x40'));}_0x5e3673=_0x567380;if(!_0x5e3673[_0xabc4('0x41')]||!_0x5e3673[_0xabc4('0x42')]||!_0x5e3673[_0xabc4('0xc')]||!_0x5e3673[_0xabc4('0x21')]||!_0x5e3673[_0xabc4('0x33')]){throw new db['Sequelize'][(_0xabc4('0x1d'))](_0xabc4('0x43'));}return db[_0xabc4('0x34')]['findOne']({'where':{'id':_0x5e3673[_0xabc4('0x42')]}});})['then'](function(_0x2ae482){if(!_0x2ae482){throw new db[(_0xabc4('0x22'))]['ValidationError'](_0xabc4('0x26'));}if(!_0x2ae482[_0xabc4('0xa')]||!_0x2ae482['data2']){throw new db['Sequelize'][(_0xabc4('0x1d'))](_0xabc4('0x35'));}_0x4c587f=_0x2ae482;var _0x3488a9=[];_0x4e855d[_0xabc4('0x44')](function(_0x4157c0){_0x3488a9['push'](checkTranscribeJob(_0x4157c0,_0x5e3673,_0x4c587f));});return BPromise['all'](_0x3488a9);})[_0xabc4('0x37')](function(_0x27ff12){if(_0x27ff12){if(!_0x27ff12[_0xabc4('0x38')]||_0x27ff12['name']!==_0xabc4('0x39')){logger[_0xabc4('0x3a')](util[_0xabc4('0x3b')](_0x27ff12,{'showHidden':![],'depth':null}));}}});}exports[_0xabc4('0x45')]=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 ca950bc..dedf4be 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 _0x5a01=['then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../logger','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','timeout'];(function(_0x219c6b,_0x581f60){var _0x25bde4=function(_0x48e0a6){while(--_0x48e0a6){_0x219c6b['push'](_0x219c6b['shift']());}};_0x25bde4(++_0x581f60);}(_0x5a01,0x158));var _0x15a0=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0x5a01[_0xa522f];return _0x2083b0;};'use strict';var _=require(_0x15a0('0x0'));var moment=require(_0x15a0('0x1'));var Redis=require(_0x15a0('0x2'));var util=require(_0x15a0('0x3'));var config=require(_0x15a0('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x15a0('0x5'))('schedule');config[_0x15a0('0x6')]=_[_0x15a0('0x7')](config[_0x15a0('0x6')],{'host':_0x15a0('0x8'),'port':0x18eb});var io=require(_0x15a0('0x9'))(new Redis(config[_0x15a0('0x6')]));function closeInteractions(){var _0x5333fe=[];return db['WhatsappInteraction'][_0x15a0('0xa')]({'raw':!![],'attributes':['id',_0x15a0('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x15a0('0xc')](0x18,_0x15a0('0xd'))}}})['then'](function(_0x599986){if(_0x599986&&_0x599986['length']){_0x5333fe=_['map'](_0x599986||[],'id');logger[_0x15a0('0xe')](_0x15a0('0xf'),_0x5333fe[_0x15a0('0x10')]());return db[_0x15a0('0x11')][_0x15a0('0x12')]({'closeReason':'system','disposition':_0x15a0('0x13'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5333fe}});}})[_0x15a0('0x14')](function(){if(_0x5333fe&&_0x5333fe[_0x15a0('0x15')]){logger[_0x15a0('0xe')](_0x15a0('0x16'),_0x5333fe[_0x15a0('0x10')]());for(var _0x3a261e=0x0;_0x3a261e<_0x5333fe[_0x15a0('0x15')];_0x3a261e++){io['emit'](_0x15a0('0x17'),{'id':_0x5333fe[_0x3a261e],'closed':!![]});}}})[_0x15a0('0x18')](function(_0x34308f){logger[_0x15a0('0x19')](_0x15a0('0x1a'),_0x34308f?util['inspect'](_0x34308f,{'showHidden':![],'depth':null}):'');});}exports[_0x15a0('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xab64=['ioredis','util','../../mysqldb','schedule','defaults','redis','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','format','join','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment'];(function(_0x2a1ac3,_0x55ef1c){var _0x5ec3d4=function(_0x3f860e){while(--_0x3f860e){_0x2a1ac3['push'](_0x2a1ac3['shift']());}};_0x5ec3d4(++_0x55ef1c);}(_0xab64,0xa0));var _0x4ab6=function(_0x1cc570,_0xb11edc){_0x1cc570=_0x1cc570-0x0;var _0x49f5bd=_0xab64[_0x1cc570];return _0x49f5bd;};'use strict';var _=require(_0x4ab6('0x0'));var moment=require(_0x4ab6('0x1'));var Redis=require(_0x4ab6('0x2'));var util=require(_0x4ab6('0x3'));var config=require('../../config/environment');var db=require(_0x4ab6('0x4'))['db'];var logger=require('../logger')(_0x4ab6('0x5'));config['redis']=_[_0x4ab6('0x6')](config[_0x4ab6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4ab6('0x8'))(new Redis(config[_0x4ab6('0x7')]));function closeInteractions(){var _0x1701a9=[];return db['WhatsappInteraction'][_0x4ab6('0x9')]({'raw':!![],'attributes':['id',_0x4ab6('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4ab6('0xb')](0x18,_0x4ab6('0xc'))}}})[_0x4ab6('0xd')](function(_0xd8754d){if(_0xd8754d&&_0xd8754d[_0x4ab6('0xe')]){_0x1701a9=_[_0x4ab6('0xf')](_0xd8754d||[],'id');logger[_0x4ab6('0x10')](_0x4ab6('0x11'),_0x1701a9['join']());return db[_0x4ab6('0x12')][_0x4ab6('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x4ab6('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1701a9}});}})['then'](function(){if(_0x1701a9&&_0x1701a9[_0x4ab6('0xe')]){logger[_0x4ab6('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x1701a9[_0x4ab6('0x15')]());for(var _0x116b00=0x0;_0x116b00<_0x1701a9[_0x4ab6('0xe')];_0x116b00++){io['emit'](_0x4ab6('0x16'),{'id':_0x1701a9[_0x116b00],'closed':!![]});}}})[_0x4ab6('0x17')](function(_0x4d6505){logger[_0x4ab6('0x18')](_0x4ab6('0x19'),_0x4d6505?util['inspect'](_0x4d6505,{'showHidden':![],'depth':null}):'');});}exports[_0x4ab6('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 3c83d38..72042d8 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4832=['innocenzo.biondo','@xcally.com','now','Biondo','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','hopper1','contacts2','CmHopper','hopper2','catch','util','../mysqldb','push','Innocenzo'];(function(_0x5ddf8d,_0x143bbf){var _0x1d399e=function(_0x19ac9e){while(--_0x19ac9e){_0x5ddf8d['push'](_0x5ddf8d['shift']());}};_0x1d399e(++_0x143bbf);}(_0x4832,0xb0));var _0x2483=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x4832[_0x23c6f2];return _0x4c270b;};'use strict';var util=require(_0x2483('0x0'));var db=require(_0x2483('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2483('0x2')]({'id':i,'firstName':_0x2483('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x2483('0x4')+i+_0x2483('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2483('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2483('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x2483('0x3')+i,'lastName':_0x2483('0x7')+i,'phone':0xf879fb460+i,'email':_0x2483('0x4')+i+_0x2483('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2483('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x2483('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2483('0x6')](),'updatedAt':Date[_0x2483('0x6')]()});}db[_0x2483('0x8')]['destroy']({'where':{}})[_0x2483('0x9')](function(){return db[_0x2483('0x8')][_0x2483('0xa')](contacts);})[_0x2483('0x9')](function(){console[_0x2483('0xb')](_0x2483('0xc'),_0x2483('0xd'));return db['CmHopper'][_0x2483('0xe')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x2483('0xa')](hopper);})[_0x2483('0x9')](function(){console['log'](_0x2483('0xc'),_0x2483('0xf'));return db['CmContact'][_0x2483('0xa')](contacts2);})[_0x2483('0x9')](function(){console['log'](_0x2483('0xc'),_0x2483('0x10'));return db[_0x2483('0x11')][_0x2483('0xa')](hopper2);})[_0x2483('0x9')](function(){console[_0x2483('0xb')](_0x2483('0xc'),_0x2483('0x12'));})[_0x2483('0x13')](function(_0x598f45){console['log'](_0x598f45);}); \ No newline at end of file +var _0x2db5=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','bulkCreate','then','log','finished\x20populating','CmHopper','CmContact','contacts2','catch','util'];(function(_0x48e73d,_0x28cabf){var _0x1b3fb1=function(_0x42ea8e){while(--_0x42ea8e){_0x48e73d['push'](_0x48e73d['shift']());}};_0x1b3fb1(++_0x28cabf);}(_0x2db5,0x186));var _0x52db=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x2db5[_0x7d62cb];return _0x3a6266;};'use strict';var util=require(_0x52db('0x0'));var db=require(_0x52db('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x52db('0x2')]({'id':i,'firstName':_0x52db('0x3')+i,'lastName':_0x52db('0x4')+i,'phone':0xf879fb460+i,'email':_0x52db('0x5')+i+_0x52db('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x52db('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x52db('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x52db('0x7')](),'updatedAt':Date[_0x52db('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x52db('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x52db('0x4')+i,'phone':0xf879fb460+i,'email':_0x52db('0x5')+i+_0x52db('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x52db('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x52db('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x52db('0x7')](),'updatedAt':Date[_0x52db('0x7')]()});}db['CmContact'][_0x52db('0x8')]({'where':{}})['then'](function(){return db['CmContact'][_0x52db('0x9')](contacts);})[_0x52db('0xa')](function(){console[_0x52db('0xb')](_0x52db('0xc'),'contacts1');return db['CmHopper'][_0x52db('0x8')]({'where':{}});})[_0x52db('0xa')](function(){return db[_0x52db('0xd')][_0x52db('0x9')](hopper);})[_0x52db('0xa')](function(){console[_0x52db('0xb')](_0x52db('0xc'),'hopper1');return db[_0x52db('0xe')]['bulkCreate'](contacts2);})[_0x52db('0xa')](function(){console[_0x52db('0xb')]('finished\x20populating',_0x52db('0xf'));return db['CmHopper'][_0x52db('0x9')](hopper2);})['then'](function(){console[_0x52db('0xb')](_0x52db('0xc'),'hopper2');})[_0x52db('0x10')](function(_0x101946){console[_0x52db('0xb')](_0x101946);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 87b627f..c53d36f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bfe=['User','then','log','add\x20user','catch','util','push','%s%s','agent','format','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x1f79d3,_0x39dd07){var _0x49dd2d=function(_0x2c8306){while(--_0x2c8306){_0x1f79d3['push'](_0x1f79d3['shift']());}};_0x49dd2d(++_0x39dd07);}(_0x3bfe,0x91));var _0xe3bf=function(_0x16513a,_0x1b528b){_0x16513a=_0x16513a-0x0;var _0x3cbce7=_0x3bfe[_0x16513a];return _0x3cbce7;};'use strict';var util=require(_0xe3bf('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe3bf('0x1')]({'name':util['format'](_0xe3bf('0x2'),_0xe3bf('0x3'),i),'fullname':util[_0xe3bf('0x4')](_0xe3bf('0x2'),'agent',i),'email':util['format']('%s%s@xcally.com',_0xe3bf('0x3'),i),'role':_0xe3bf('0x3'),'password':_0xe3bf('0x5'),'internal':0xfa0+i,'type':_0xe3bf('0x6'),'transport':[_0xe3bf('0x7'),'ws',_0xe3bf('0x8')],'disallow':[_0xe3bf('0x9')],'allow':['ulaw'],'defaultuser':util[_0xe3bf('0x4')](_0xe3bf('0x2'),_0xe3bf('0x3'),i),'encryption':_0xe3bf('0xa'),'avpf':_0xe3bf('0xa'),'force_avp':_0xe3bf('0xa'),'icesupport':'yes','dtlsenable':_0xe3bf('0xa'),'dtlsverify':'no','dtlscertfile':_0xe3bf('0xb'),'dtlsprivatekey':_0xe3bf('0xc'),'dtlssetup':_0xe3bf('0xd'),'callerid':util[_0xe3bf('0x4')](_0xe3bf('0xe'),util['format'](_0xe3bf('0x2'),_0xe3bf('0x3'),i),0xfa0+i)});}db[_0xe3bf('0xf')]['bulkCreate'](users)[_0xe3bf('0x10')](function(){console[_0xe3bf('0x11')](_0xe3bf('0x12'));})[_0xe3bf('0x13')](function(_0x3479b5){console['log'](_0x3479b5);}); \ No newline at end of file +var _0x90f1=['format','%s%s','agent','%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','then','catch','log','util','push'];(function(_0x1343fe,_0x1b99ab){var _0x354bc7=function(_0x5e87d7){while(--_0x5e87d7){_0x1343fe['push'](_0x1343fe['shift']());}};_0x354bc7(++_0x1b99ab);}(_0x90f1,0x14e));var _0x190f=function(_0x1c5169,_0xebba2b){_0x1c5169=_0x1c5169-0x0;var _0x4ccb16=_0x90f1[_0x1c5169];return _0x4ccb16;};'use strict';var util=require(_0x190f('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x190f('0x1')]({'name':util[_0x190f('0x2')](_0x190f('0x3'),'agent',i),'fullname':util[_0x190f('0x2')]('%s%s',_0x190f('0x4'),i),'email':util[_0x190f('0x2')](_0x190f('0x5'),_0x190f('0x4'),i),'role':_0x190f('0x4'),'password':_0x190f('0x6'),'internal':0xfa0+i,'type':_0x190f('0x7'),'transport':['udp','ws',_0x190f('0x8')],'disallow':['all'],'allow':[_0x190f('0x9')],'defaultuser':util['format'](_0x190f('0x3'),_0x190f('0x4'),i),'encryption':_0x190f('0xa'),'avpf':_0x190f('0xa'),'force_avp':_0x190f('0xa'),'icesupport':'yes','dtlsenable':_0x190f('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x190f('0xb'),'dtlssetup':_0x190f('0xc'),'callerid':util[_0x190f('0x2')]('\x22%s\x22\x20<%s>',util[_0x190f('0x2')]('%s%s',_0x190f('0x4'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x190f('0xd')](function(){console['log']('add\x20user');})[_0x190f('0xe')](function(_0x369e32){console[_0x190f('0xf')](_0x369e32);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index e184f3a..025e208 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a05=['admin','voice:outbound','hasOwnProperty','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','SmsQueues','SmsQueue','Trunks','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','length','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','address','request','remoteAddress','connection','connectedAt','nsp','disconnect','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','map','where','telephone','Campaign','type','format','user:%s','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x1a05,0x153));var _0x51a0=function(_0x4d8c54,_0x1daa0c){_0x4d8c54=_0x4d8c54-0x0;var _0x3c62a3=_0x1a05[_0x4d8c54];return _0x3c62a3;};'use strict';var _=require(_0x51a0('0x0'));var util=require(_0x51a0('0x1'));var BPromise=require('bluebird');var db=require(_0x51a0('0x2'))['db'];var config=require(_0x51a0('0x3'));var queryQueues={'attributes':['id',_0x51a0('0x4')],'include':[{'as':_0x51a0('0x5'),'model':db[_0x51a0('0x6')],'attributes':['id',_0x51a0('0x4'),_0x51a0('0x7')],'raw':!![],'where':{'role':_0x51a0('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x51a0('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x51a0('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x51a0('0x4')],'where':{'role':_0x51a0('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x51a0('0x4'),'type'],'where':{'type':_0x51a0('0x9')}};function getAssociatedResources(_0x40f09a,_0x526185,_0xc97394){return db[_0x51a0('0xa')]['findOne']({'where':{'name':_0x40f09a,'userProfileId':_0x526185},'raw':!![]})[_0x51a0('0xb')](function(_0x8916a6){if(_0x8916a6){if(_0x8916a6[_0x51a0('0xc')]){switch(_0x40f09a){case _0x51a0('0xd'):case _0x51a0('0xe'):case'FaxQueues':case'SmsQueues':case'MailQueues':case _0x51a0('0xf'):case _0x51a0('0x10'):return db[_0xc97394][_0x51a0('0x11')](queryQueues);case _0x51a0('0x12'):return db[_0xc97394][_0x51a0('0x11')](queryTelephones);case'Trunks':return db[_0xc97394][_0x51a0('0x11')](queryTrunks);case'IvrCampaigns':return db[_0xc97394][_0x51a0('0x11')](queryCampaigns);}}else{return db[_0x51a0('0x13')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x8916a6['id']},'raw':!![]})[_0x51a0('0xb')](function(_0x29589e){if(_0x29589e){var _0x5a6449={'where':{'id':_[_0x51a0('0x14')](_0x29589e,'resourceId')},'raw':!![]};switch(_0xc97394){case _0x51a0('0x6'):_0x5a6449[_0x51a0('0x15')][_0x51a0('0x7')]=_0x51a0('0x16');break;case _0x51a0('0x17'):_0x5a6449[_0x51a0('0x15')][_0x51a0('0x18')]=_0x51a0('0x9');break;}return db[_0xc97394][_0x51a0('0x11')](_0x5a6449);}else{return[];}});}}else{return[];}})[_0x51a0('0xb')](function(_0x37ea2f){return _0x37ea2f;});}function joinOrLeaveQueues(_0x5e1bbe,_0x749cd4,_0x4022c8,_0xd32072){_0x5e1bbe[_0x749cd4](util[_0x51a0('0x19')]('%s:queue:%s',_0x4022c8,_0xd32072['name']));if(_0xd32072[_0x51a0('0x5')]){for(var _0x545e20=0x0;_0x545e20<_0xd32072[_0x51a0('0x5')]['length'];_0x545e20+=0x1){_0x5e1bbe[_0x749cd4](util['format'](_0x51a0('0x1a'),_0xd32072['Agents'][_0x545e20]['name']));}}}function joinOrLeave(_0x177ada,_0x4bd85e,_0x4af6ff){var _0x616fbb;if(_0x177ada['handshake']['query']['id']){db[_0x51a0('0x6')][_0x51a0('0x1b')]({'attributes':['id','name',_0x51a0('0x7'),_0x51a0('0x1c')],'where':{'id':_0x177ada[_0x51a0('0x1d')]['query']['id']},'include':[{'model':db[_0x51a0('0x1e')],'as':_0x51a0('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x51a0('0x20')],'as':_0x51a0('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x51a0('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x51a0('0x23')],'as':_0x51a0('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x51a0('0x25')],'as':_0x51a0('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x51a0('0x27')],'as':_0x51a0('0x28'),'attributes':['id'],'raw':!![]}]})[_0x51a0('0xb')](function(_0x445136){if(_0x445136){_0x616fbb=_0x445136;_0x177ada[_0x4bd85e](util[_0x51a0('0x19')]('user:%s',_0x445136[_0x51a0('0x4')]));var _0x36cdc0=[];switch(_0x445136['role']){case _0x51a0('0x29'):_0x177ada[_0x4bd85e]('voice:inbound');_0x177ada[_0x4bd85e](_0x51a0('0x2a'));if(queryQueues[_0x51a0('0x2b')]('include')){delete queryQueues['include'];}_0x36cdc0[_0x51a0('0x2c')](db[_0x51a0('0x2d')]['findAll'](queryQueues));_0x36cdc0['push'](db[_0x51a0('0x2e')][_0x51a0('0x11')](queryQueues));_0x36cdc0['push'](db[_0x51a0('0x2f')][_0x51a0('0x11')](queryQueues));_0x36cdc0[_0x51a0('0x2c')](db['SmsQueue']['findAll'](queryQueues));_0x36cdc0['push'](db[_0x51a0('0x30')][_0x51a0('0x11')](queryQueues));_0x36cdc0[_0x51a0('0x2c')](db[_0x51a0('0x31')][_0x51a0('0x11')](queryQueues));_0x36cdc0[_0x51a0('0x2c')](db[_0x51a0('0x32')][_0x51a0('0x11')](queryQueues));_0x36cdc0['push'](db[_0x51a0('0x6')][_0x51a0('0x11')](queryTelephones));_0x36cdc0[_0x51a0('0x2c')](db[_0x51a0('0x33')]['findAll'](queryTrunks));_0x36cdc0[_0x51a0('0x2c')](db['Campaign'][_0x51a0('0x11')](queryCampaigns));_0x36cdc0[_0x51a0('0x2c')](db['User'][_0x51a0('0x11')](queryAgents));break;case _0x51a0('0x34'):_0x177ada[_0x4bd85e](_0x51a0('0x35'));_0x177ada[_0x4bd85e](_0x51a0('0x2a'));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources(_0x51a0('0xd'),_0x445136[_0x51a0('0x1c')],_0x51a0('0x2d')));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources('ChatQueues',_0x445136[_0x51a0('0x1c')],'ChatQueue'));_0x36cdc0['push'](getAssociatedResources('FaxQueues',_0x445136[_0x51a0('0x1c')],'FaxQueue'));_0x36cdc0['push'](getAssociatedResources(_0x51a0('0x36'),_0x445136[_0x51a0('0x1c')],_0x51a0('0x37')));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources('MailQueues',_0x445136[_0x51a0('0x1c')],_0x51a0('0x30')));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources(_0x51a0('0xf'),_0x445136[_0x51a0('0x1c')],_0x51a0('0x31')));_0x36cdc0['push'](getAssociatedResources('WhatsappQueues',_0x445136[_0x51a0('0x1c')],_0x51a0('0x32')));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources(_0x51a0('0x12'),_0x445136[_0x51a0('0x1c')],_0x51a0('0x6')));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources(_0x51a0('0x38'),_0x445136[_0x51a0('0x1c')],_0x51a0('0x33')));_0x36cdc0[_0x51a0('0x2c')](getAssociatedResources(_0x51a0('0x39'),_0x445136['userProfileId'],_0x51a0('0x17')));_0x36cdc0['push'](db[_0x51a0('0x6')][_0x51a0('0x11')](queryAgents));break;case _0x51a0('0x8'):_0x177ada[_0x4bd85e](_0x51a0('0x35'));_0x177ada[_0x4bd85e](_0x51a0('0x2a'));_0x36cdc0[_0x51a0('0x2c')](_0x445136[_0x51a0('0x3a')]({'attributes':['id','name']}));_0x36cdc0[_0x51a0('0x2c')](_0x445136[_0x51a0('0x3b')]({'attributes':['id',_0x51a0('0x4')]}));_0x36cdc0[_0x51a0('0x2c')](_0x445136[_0x51a0('0x3c')]({'attributes':['id',_0x51a0('0x4')]}));_0x36cdc0[_0x51a0('0x2c')](_0x445136[_0x51a0('0x3d')]({'attributes':['id',_0x51a0('0x4')]}));_0x36cdc0[_0x51a0('0x2c')](_0x445136[_0x51a0('0x3e')]({'attributes':['id',_0x51a0('0x4')]}));_0x36cdc0[_0x51a0('0x2c')](_0x445136['getOpenchannelQueues']({'attributes':['id',_0x51a0('0x4')]}));_0x36cdc0[_0x51a0('0x2c')](_0x445136[_0x51a0('0x3f')]({'attributes':['id',_0x51a0('0x4')]}));break;}return BPromise['all'](_0x36cdc0);}})['then'](function(_0x50179a){if(_0x50179a&&_0x50179a[_0x51a0('0x40')]){for(var _0xde2ec8=0x0;_0xde2ec8<_0x50179a['length'];_0xde2ec8+=0x1){for(var _0x55721e=0x0;_0x55721e<_0x50179a[_0xde2ec8][_0x51a0('0x40')];_0x55721e+=0x1){switch(_0xde2ec8){case 0x0:joinOrLeaveQueues(_0x177ada,_0x4bd85e,_0x51a0('0x41'),_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x1:joinOrLeaveQueues(_0x177ada,_0x4bd85e,'chat',_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x2:joinOrLeaveQueues(_0x177ada,_0x4bd85e,_0x51a0('0x42'),_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x3:joinOrLeaveQueues(_0x177ada,_0x4bd85e,_0x51a0('0x43'),_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x4:joinOrLeaveQueues(_0x177ada,_0x4bd85e,_0x51a0('0x44'),_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x5:joinOrLeaveQueues(_0x177ada,_0x4bd85e,_0x51a0('0x45'),_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x6:joinOrLeaveQueues(_0x177ada,_0x4bd85e,_0x51a0('0x46'),_0x50179a[_0xde2ec8][_0x55721e]);break;case 0x7:if(_0x616fbb['role']!==_0x51a0('0x8'))_0x177ada[_0x4bd85e](util[_0x51a0('0x19')](_0x51a0('0x47'),_0x50179a[_0xde2ec8][_0x55721e][_0x51a0('0x4')]));break;case 0x8:if(_0x616fbb[_0x51a0('0x7')]!==_0x51a0('0x8'))_0x177ada[_0x4bd85e](util[_0x51a0('0x19')](_0x51a0('0x48'),_0x50179a[_0xde2ec8][_0x55721e][_0x51a0('0x4')]));break;case 0x9:if(_0x616fbb[_0x51a0('0x7')]!==_0x51a0('0x8'))_0x177ada[_0x4bd85e](util[_0x51a0('0x19')](_0x51a0('0x49'),_0x50179a[_0xde2ec8][_0x55721e][_0x51a0('0x18')],_0x50179a[_0xde2ec8][_0x55721e][_0x51a0('0x4')]));break;case 0xa:_0x177ada[_0x4bd85e](util[_0x51a0('0x19')](_0x51a0('0x1a'),_0x50179a[_0xde2ec8][_0x55721e][_0x51a0('0x4')]));break;}}}}})[_0x51a0('0xb')](function(){if(_0x4bd85e===_0x51a0('0x4a')){var _0x4dcf12=_[_0x51a0('0x14')](_0x616fbb[_0x51a0('0x1f')],'id');return _0x616fbb[_0x51a0('0x4b')](_0x4dcf12)[_0x51a0('0xb')](function(){for(var _0x41cccd=0x0;_0x41cccd<_0x4dcf12[_0x51a0('0x40')];_0x41cccd+=0x1){_0x4af6ff[_0x51a0('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4dcf12[_0x41cccd]),'UserId':Number(_0x616fbb['id'])});}});}})[_0x51a0('0xb')](function(){if(_0x4bd85e==='leave'){var _0x491b14=_[_0x51a0('0x14')](_0x616fbb['MailInteractions'],'id');return _0x616fbb['removeMailInteractions'](_0x491b14)['then'](function(){for(var _0x25485d=0x0;_0x25485d<_0x491b14[_0x51a0('0x40')];_0x25485d+=0x1){_0x4af6ff[_0x51a0('0x4c')](_0x51a0('0x4d'),{'MailInteractionId':Number(_0x491b14[_0x25485d]),'UserId':Number(_0x616fbb['id'])});}});}})[_0x51a0('0xb')](function(){if(_0x4bd85e===_0x51a0('0x4a')){var _0x2b47fe=_['map'](_0x616fbb[_0x51a0('0x22')],'id');return _0x616fbb[_0x51a0('0x4e')](_0x2b47fe)[_0x51a0('0xb')](function(){for(var _0x178c47=0x0;_0x178c47<_0x2b47fe[_0x51a0('0x40')];_0x178c47+=0x1){_0x4af6ff[_0x51a0('0x4c')](_0x51a0('0x4f'),{'FaxInteractionId':Number(_0x2b47fe[_0x178c47]),'UserId':Number(_0x616fbb['id'])});}});}})[_0x51a0('0xb')](function(){if(_0x4bd85e==='leave'){var _0x549232=_['map'](_0x616fbb[_0x51a0('0x24')],'id');return _0x616fbb['removeSmsInteractions'](_0x549232)['then'](function(){for(var _0x2428b4=0x0;_0x2428b4<_0x549232['length'];_0x2428b4+=0x1){_0x4af6ff[_0x51a0('0x4c')](_0x51a0('0x50'),{'SmsInteractionId':Number(_0x549232[_0x2428b4]),'UserId':Number(_0x616fbb['id'])});}});}})['then'](function(){if(_0x4bd85e==='leave'){var _0x50b339=_[_0x51a0('0x14')](_0x616fbb[_0x51a0('0x26')],'id');return _0x616fbb[_0x51a0('0x51')](_0x50b339)[_0x51a0('0xb')](function(){for(var _0x5d7497=0x0;_0x5d7497<_0x50b339[_0x51a0('0x40')];_0x5d7497+=0x1){_0x4af6ff['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x50b339[_0x5d7497]),'UserId':Number(_0x616fbb['id'])});}});}})[_0x51a0('0xb')](function(){if(_0x4bd85e===_0x51a0('0x4a')){var _0x3205cd=_[_0x51a0('0x14')](_0x616fbb['WhatsappInteractions'],'id');return _0x616fbb[_0x51a0('0x52')](_0x3205cd)['then'](function(){for(var _0x31ffce=0x0;_0x31ffce<_0x3205cd[_0x51a0('0x40')];_0x31ffce+=0x1){_0x4af6ff[_0x51a0('0x4c')](_0x51a0('0x53'),{'WhatsappInteractionId':Number(_0x3205cd[_0x31ffce]),'UserId':Number(_0x616fbb['id'])});}});}})[_0x51a0('0x54')](function(_0x167f31){_0x177ada[_0x51a0('0x55')](_0x167f31);});}}function onDisconnect(_0x3fad5d,_0x2ef0fd){joinOrLeave(_0x3fad5d,_0x51a0('0x4a'),_0x2ef0fd);}function onConnect(_0x2b4196){joinOrLeave(_0x2b4196,_0x51a0('0x56'));}exports[_0x51a0('0x57')]=function(_0x5e5439){_0x5e5439['on']('connection',function(_0xaea97d){_0xaea97d['setMaxListeners'](0x0);_0xaea97d[_0x51a0('0x58')]=_0xaea97d[_0x51a0('0x59')]['connection'][_0x51a0('0x5a')]+':'+_0xaea97d[_0x51a0('0x59')][_0x51a0('0x5b')]['remotePort'];_0xaea97d[_0x51a0('0x5c')]=new Date();_0xaea97d[_0x51a0('0x55')]=function(_0x85fad3){console['log']('SocketIO\x20'+_0xaea97d[_0x51a0('0x5d')][_0x51a0('0x4')]+'['+_0xaea97d[_0x51a0('0x58')]+']',_0x85fad3);};_0xaea97d['on'](_0x51a0('0x5e'),function(){onDisconnect(_0xaea97d,_0x5e5439);_0xaea97d['log']('DISCONNECTED');});onConnect(_0xaea97d);_0xaea97d[_0x51a0('0x55')]('CONNECTED');});}; \ No newline at end of file +var _0x723c=['SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueue','ChatQueues','ChatQueue','getVoiceQueues','getFaxQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','address','remoteAddress','request','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','./environment','Agents','User','name','role','agent','telephone','type','ivr','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','%s:queue:%s','length','format','user:%s','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','FaxQueue'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x723c,0x1ad));var _0xc723=function(_0xaae61d,_0x4e55fa){_0xaae61d=_0xaae61d-0x0;var _0x488827=_0x723c[_0xaae61d];return _0x488827;};'use strict';var _=require('lodash');var util=require(_0xc723('0x0'));var BPromise=require(_0xc723('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xc723('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc723('0x3'),'model':db[_0xc723('0x4')],'attributes':['id',_0xc723('0x5'),_0xc723('0x6')],'raw':!![],'where':{'role':_0xc723('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc723('0x5')],'where':{'role':_0xc723('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xc723('0x5')],'where':{'role':_0xc723('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xc723('0x9')],'where':{'type':_0xc723('0xa')}};function getAssociatedResources(_0x5a93e3,_0xff63c2,_0x3d17ff){return db['UserProfileSection']['findOne']({'where':{'name':_0x5a93e3,'userProfileId':_0xff63c2},'raw':!![]})[_0xc723('0xb')](function(_0x28da7f){if(_0x28da7f){if(_0x28da7f[_0xc723('0xc')]){switch(_0x5a93e3){case _0xc723('0xd'):case'ChatQueues':case _0xc723('0xe'):case _0xc723('0xf'):case _0xc723('0x10'):case _0xc723('0x11'):case _0xc723('0x12'):return db[_0x3d17ff]['findAll'](queryQueues);case _0xc723('0x13'):return db[_0x3d17ff][_0xc723('0x14')](queryTelephones);case _0xc723('0x15'):return db[_0x3d17ff][_0xc723('0x14')](queryTrunks);case _0xc723('0x16'):return db[_0x3d17ff]['findAll'](queryCampaigns);}}else{return db[_0xc723('0x17')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x28da7f['id']},'raw':!![]})[_0xc723('0xb')](function(_0x110d83){if(_0x110d83){var _0x212a77={'where':{'id':_[_0xc723('0x18')](_0x110d83,_0xc723('0x19'))},'raw':!![]};switch(_0x3d17ff){case _0xc723('0x4'):_0x212a77[_0xc723('0x1a')][_0xc723('0x6')]='telephone';break;case _0xc723('0x1b'):_0x212a77[_0xc723('0x1a')][_0xc723('0x9')]=_0xc723('0xa');break;}return db[_0x3d17ff]['findAll'](_0x212a77);}else{return[];}});}}else{return[];}})['then'](function(_0x1984ab){return _0x1984ab;});}function joinOrLeaveQueues(_0x298470,_0x133798,_0xcae217,_0x1fbfe0){_0x298470[_0x133798](util['format'](_0xc723('0x1c'),_0xcae217,_0x1fbfe0[_0xc723('0x5')]));if(_0x1fbfe0[_0xc723('0x3')]){for(var _0x172cf0=0x0;_0x172cf0<_0x1fbfe0[_0xc723('0x3')][_0xc723('0x1d')];_0x172cf0+=0x1){_0x298470[_0x133798](util[_0xc723('0x1e')](_0xc723('0x1f'),_0x1fbfe0[_0xc723('0x3')][_0x172cf0][_0xc723('0x5')]));}}}function joinOrLeave(_0x31d41e,_0xf77cc5,_0x545309){var _0x16ae56;if(_0x31d41e['handshake'][_0xc723('0x20')]['id']){db[_0xc723('0x4')][_0xc723('0x21')]({'attributes':['id','name',_0xc723('0x6'),_0xc723('0x22')],'where':{'id':_0x31d41e['handshake']['query']['id']},'include':[{'model':db[_0xc723('0x23')],'as':_0xc723('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xc723('0x25')],'as':_0xc723('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xc723('0x27')],'as':_0xc723('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xc723('0x29')],'as':_0xc723('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc723('0x2b')],'as':_0xc723('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xc723('0xb')](function(_0x49b188){if(_0x49b188){_0x16ae56=_0x49b188;_0x31d41e[_0xf77cc5](util[_0xc723('0x1e')](_0xc723('0x1f'),_0x49b188[_0xc723('0x5')]));var _0x5e1a1d=[];switch(_0x49b188['role']){case _0xc723('0x2d'):_0x31d41e[_0xf77cc5](_0xc723('0x2e'));_0x31d41e[_0xf77cc5](_0xc723('0x2f'));if(queryQueues['hasOwnProperty'](_0xc723('0x30'))){delete queryQueues[_0xc723('0x30')];}_0x5e1a1d[_0xc723('0x31')](db['VoiceQueue'][_0xc723('0x14')](queryQueues));_0x5e1a1d['push'](db['ChatQueue']['findAll'](queryQueues));_0x5e1a1d[_0xc723('0x31')](db[_0xc723('0x32')]['findAll'](queryQueues));_0x5e1a1d[_0xc723('0x31')](db[_0xc723('0x33')][_0xc723('0x14')](queryQueues));_0x5e1a1d[_0xc723('0x31')](db[_0xc723('0x34')][_0xc723('0x14')](queryQueues));_0x5e1a1d[_0xc723('0x31')](db[_0xc723('0x35')][_0xc723('0x14')](queryQueues));_0x5e1a1d[_0xc723('0x31')](db[_0xc723('0x36')][_0xc723('0x14')](queryQueues));_0x5e1a1d['push'](db[_0xc723('0x4')]['findAll'](queryTelephones));_0x5e1a1d['push'](db[_0xc723('0x37')]['findAll'](queryTrunks));_0x5e1a1d['push'](db[_0xc723('0x1b')][_0xc723('0x14')](queryCampaigns));_0x5e1a1d[_0xc723('0x31')](db[_0xc723('0x4')]['findAll'](queryAgents));break;case _0xc723('0x38'):_0x31d41e[_0xf77cc5](_0xc723('0x2e'));_0x31d41e[_0xf77cc5](_0xc723('0x2f'));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0xd'),_0x49b188['userProfileId'],_0xc723('0x39')));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0x3a'),_0x49b188[_0xc723('0x22')],_0xc723('0x3b')));_0x5e1a1d['push'](getAssociatedResources(_0xc723('0xe'),_0x49b188['userProfileId'],_0xc723('0x32')));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0xf'),_0x49b188[_0xc723('0x22')],_0xc723('0x33')));_0x5e1a1d['push'](getAssociatedResources(_0xc723('0x10'),_0x49b188[_0xc723('0x22')],_0xc723('0x34')));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0x11'),_0x49b188[_0xc723('0x22')],'OpenchannelQueue'));_0x5e1a1d['push'](getAssociatedResources(_0xc723('0x12'),_0x49b188[_0xc723('0x22')],_0xc723('0x36')));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0x13'),_0x49b188['userProfileId'],_0xc723('0x4')));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0x15'),_0x49b188[_0xc723('0x22')],_0xc723('0x37')));_0x5e1a1d[_0xc723('0x31')](getAssociatedResources(_0xc723('0x16'),_0x49b188[_0xc723('0x22')],_0xc723('0x1b')));_0x5e1a1d[_0xc723('0x31')](db['User']['findAll'](queryAgents));break;case'agent':_0x31d41e[_0xf77cc5](_0xc723('0x2e'));_0x31d41e[_0xf77cc5]('voice:outbound');_0x5e1a1d[_0xc723('0x31')](_0x49b188[_0xc723('0x3c')]({'attributes':['id',_0xc723('0x5')]}));_0x5e1a1d['push'](_0x49b188['getChatQueues']({'attributes':['id','name']}));_0x5e1a1d[_0xc723('0x31')](_0x49b188[_0xc723('0x3d')]({'attributes':['id',_0xc723('0x5')]}));_0x5e1a1d[_0xc723('0x31')](_0x49b188['getSmsQueues']({'attributes':['id',_0xc723('0x5')]}));_0x5e1a1d[_0xc723('0x31')](_0x49b188[_0xc723('0x3e')]({'attributes':['id',_0xc723('0x5')]}));_0x5e1a1d[_0xc723('0x31')](_0x49b188['getOpenchannelQueues']({'attributes':['id',_0xc723('0x5')]}));_0x5e1a1d[_0xc723('0x31')](_0x49b188[_0xc723('0x3f')]({'attributes':['id',_0xc723('0x5')]}));break;}return BPromise[_0xc723('0x40')](_0x5e1a1d);}})[_0xc723('0xb')](function(_0x389392){if(_0x389392&&_0x389392['length']){for(var _0x9f090=0x0;_0x9f090<_0x389392[_0xc723('0x1d')];_0x9f090+=0x1){for(var _0x42e0d4=0x0;_0x42e0d4<_0x389392[_0x9f090]['length'];_0x42e0d4+=0x1){switch(_0x9f090){case 0x0:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x41'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x1:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x42'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x2:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x43'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x3:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x44'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x4:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x45'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x5:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x46'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x6:joinOrLeaveQueues(_0x31d41e,_0xf77cc5,_0xc723('0x47'),_0x389392[_0x9f090][_0x42e0d4]);break;case 0x7:if(_0x16ae56[_0xc723('0x6')]!==_0xc723('0x7'))_0x31d41e[_0xf77cc5](util[_0xc723('0x1e')](_0xc723('0x48'),_0x389392[_0x9f090][_0x42e0d4][_0xc723('0x5')]));break;case 0x8:if(_0x16ae56['role']!=='agent')_0x31d41e[_0xf77cc5](util[_0xc723('0x1e')]('trunk:%s',_0x389392[_0x9f090][_0x42e0d4][_0xc723('0x5')]));break;case 0x9:if(_0x16ae56[_0xc723('0x6')]!==_0xc723('0x7'))_0x31d41e[_0xf77cc5](util[_0xc723('0x1e')]('campaign:%s:%s',_0x389392[_0x9f090][_0x42e0d4][_0xc723('0x9')],_0x389392[_0x9f090][_0x42e0d4][_0xc723('0x5')]));break;case 0xa:_0x31d41e[_0xf77cc5](util[_0xc723('0x1e')](_0xc723('0x1f'),_0x389392[_0x9f090][_0x42e0d4][_0xc723('0x5')]));break;}}}}})[_0xc723('0xb')](function(){if(_0xf77cc5===_0xc723('0x49')){var _0x5ad852=_[_0xc723('0x18')](_0x16ae56[_0xc723('0x24')],'id');return _0x16ae56[_0xc723('0x4a')](_0x5ad852)[_0xc723('0xb')](function(){for(var _0x4627a4=0x0;_0x4627a4<_0x5ad852[_0xc723('0x1d')];_0x4627a4+=0x1){_0x545309['emit'](_0xc723('0x4b'),{'ChatInteractionId':Number(_0x5ad852[_0x4627a4]),'UserId':Number(_0x16ae56['id'])});}});}})[_0xc723('0xb')](function(){if(_0xf77cc5===_0xc723('0x49')){var _0x56ba2f=_[_0xc723('0x18')](_0x16ae56[_0xc723('0x26')],'id');return _0x16ae56[_0xc723('0x4c')](_0x56ba2f)[_0xc723('0xb')](function(){for(var _0x3c0dfa=0x0;_0x3c0dfa<_0x56ba2f[_0xc723('0x1d')];_0x3c0dfa+=0x1){_0x545309[_0xc723('0x4d')](_0xc723('0x4e'),{'MailInteractionId':Number(_0x56ba2f[_0x3c0dfa]),'UserId':Number(_0x16ae56['id'])});}});}})['then'](function(){if(_0xf77cc5===_0xc723('0x49')){var _0x34a70b=_['map'](_0x16ae56[_0xc723('0x28')],'id');return _0x16ae56[_0xc723('0x4f')](_0x34a70b)[_0xc723('0xb')](function(){for(var _0x4aa9c2=0x0;_0x4aa9c2<_0x34a70b['length'];_0x4aa9c2+=0x1){_0x545309[_0xc723('0x4d')](_0xc723('0x50'),{'FaxInteractionId':Number(_0x34a70b[_0x4aa9c2]),'UserId':Number(_0x16ae56['id'])});}});}})['then'](function(){if(_0xf77cc5==='leave'){var _0x56abcf=_[_0xc723('0x18')](_0x16ae56['SmsInteractions'],'id');return _0x16ae56['removeSmsInteractions'](_0x56abcf)['then'](function(){for(var _0x1c03a9=0x0;_0x1c03a9<_0x56abcf[_0xc723('0x1d')];_0x1c03a9+=0x1){_0x545309[_0xc723('0x4d')](_0xc723('0x51'),{'SmsInteractionId':Number(_0x56abcf[_0x1c03a9]),'UserId':Number(_0x16ae56['id'])});}});}})['then'](function(){if(_0xf77cc5===_0xc723('0x49')){var _0x64beb=_['map'](_0x16ae56['OpenchannelInteractions'],'id');return _0x16ae56[_0xc723('0x52')](_0x64beb)[_0xc723('0xb')](function(){for(var _0x221d5a=0x0;_0x221d5a<_0x64beb[_0xc723('0x1d')];_0x221d5a+=0x1){_0x545309[_0xc723('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x64beb[_0x221d5a]),'UserId':Number(_0x16ae56['id'])});}});}})[_0xc723('0xb')](function(){if(_0xf77cc5==='leave'){var _0x3cfd3b=_[_0xc723('0x18')](_0x16ae56['WhatsappInteractions'],'id');return _0x16ae56['removeWhatsappInteractions'](_0x3cfd3b)[_0xc723('0xb')](function(){for(var _0x3ca291=0x0;_0x3ca291<_0x3cfd3b['length'];_0x3ca291+=0x1){_0x545309['emit'](_0xc723('0x53'),{'WhatsappInteractionId':Number(_0x3cfd3b[_0x3ca291]),'UserId':Number(_0x16ae56['id'])});}});}})['catch'](function(_0x29e786){_0x31d41e[_0xc723('0x54')](_0x29e786);});}}function onDisconnect(_0x40dc70,_0x2a1a1e){joinOrLeave(_0x40dc70,_0xc723('0x49'),_0x2a1a1e);}function onConnect(_0x42c410){joinOrLeave(_0x42c410,_0xc723('0x55'));}exports[_0xc723('0x56')]=function(_0x2fd100){_0x2fd100['on'](_0xc723('0x57'),function(_0xac63cb){_0xac63cb['setMaxListeners'](0x0);_0xac63cb[_0xc723('0x58')]=_0xac63cb['request']['connection'][_0xc723('0x59')]+':'+_0xac63cb[_0xc723('0x5a')]['connection']['remotePort'];_0xac63cb[_0xc723('0x5b')]=new Date();_0xac63cb[_0xc723('0x54')]=function(_0xca3854){console[_0xc723('0x54')]('SocketIO\x20'+_0xac63cb[_0xc723('0x5c')][_0xc723('0x5')]+'['+_0xac63cb[_0xc723('0x58')]+']',_0xca3854);};_0xac63cb['on'](_0xc723('0x5d'),function(){onDisconnect(_0xac63cb,_0x2fd100);_0xac63cb[_0xc723('0x54')](_0xc723('0x5e'));});onConnect(_0xac63cb);_0xac63cb[_0xc723('0x54')](_0xc723('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index c5ff262..89971a9 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 _0xdd1c=['query','AfterUpdate','email','internal','default','length','hasOwnProperty','model','hook','callback','condition','../logger','triggers','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','OpenchannelMessage','info','error','code','Trigger,\x20%s','EventManager','get','channel','motionChannel','direction','resolve','then','ContactId','sequelize','contact','UserId','undefined','format','SIP/%s','agent','outgoingmessage','catch','AfterCreateMessage','event','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','interface','name','changed','closed','substatus'];(function(_0x333a95,_0x4530a5){var _0x51bb6e=function(_0x4dffa9){while(--_0x4dffa9){_0x333a95['push'](_0x333a95['shift']());}};_0x51bb6e(++_0x4530a5);}(_0xdd1c,0x155));var _0xcdd1=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0xdd1c[_0x57da0a];return _0x3145d5;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0xcdd1('0x0'))(_0xcdd1('0x1'));var client=jayson['client'][_0xcdd1('0x2')]({'port':0x232a});var triggers=[{'channel':_0xcdd1('0x3'),'model':_0xcdd1('0x4'),'event':_0xcdd1('0x5'),'condition':_0xcdd1('0x6'),'callback':afterCreate},{'channel':'Chat','model':_0xcdd1('0x4'),'event':_0xcdd1('0x7'),'condition':_0xcdd1('0x8'),'callback':afterUpdate},{'channel':_0xcdd1('0x3'),'model':'ChatMessage','event':_0xcdd1('0x5'),'condition':_0xcdd1('0x9'),'callback':afterCreateMessage},{'channel':_0xcdd1('0x3'),'model':'ChatOfflineMessage','event':'afterCreate','condition':_0xcdd1('0x9'),'callback':afterCreateOfflineMessage},{'channel':_0xcdd1('0xa'),'model':_0xcdd1('0xb'),'event':_0xcdd1('0x5'),'condition':_0xcdd1('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0xcdd1('0xb'),'event':'afterUpdate','condition':_0xcdd1('0x8'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':'afterCreate','condition':_0xcdd1('0x9'),'callback':afterCreateMessage},{'channel':_0xcdd1('0xc'),'model':_0xcdd1('0xd'),'event':_0xcdd1('0x5'),'condition':_0xcdd1('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':_0xcdd1('0xd'),'event':_0xcdd1('0x7'),'condition':_0xcdd1('0x8'),'callback':afterUpdate},{'channel':_0xcdd1('0xc'),'model':'WhatsappMessage','event':_0xcdd1('0x5'),'condition':_0xcdd1('0x9'),'callback':afterCreateMessage},{'channel':_0xcdd1('0xe'),'model':_0xcdd1('0xf'),'event':_0xcdd1('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xcdd1('0xe'),'model':'FaxInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xcdd1('0xe'),'model':_0xcdd1('0x10'),'event':_0xcdd1('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xcdd1('0x11'),'model':'MailInteraction','event':'afterCreate','condition':_0xcdd1('0x6'),'callback':afterCreate},{'channel':_0xcdd1('0x11'),'model':_0xcdd1('0x12'),'event':_0xcdd1('0x7'),'condition':_0xcdd1('0x8'),'callback':afterUpdate},{'channel':_0xcdd1('0x11'),'model':'MailMessage','event':_0xcdd1('0x5'),'condition':_0xcdd1('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':'afterCreate','condition':_0xcdd1('0x6'),'callback':afterCreate},{'channel':'Openchannel','model':_0xcdd1('0x13'),'event':'afterUpdate','condition':_0xcdd1('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xcdd1('0x14'),'event':_0xcdd1('0x5'),'condition':_0xcdd1('0x9'),'callback':afterCreateMessage}];function request(_0x49cc5e){return client['request']('EventManager',_0x49cc5e)['then'](function(_0x5d2af8){logger[_0xcdd1('0x15')]('Trigger,\x20%s','EventManager',_0x5d2af8);if(_0x5d2af8[_0xcdd1('0x16')]){if(_0x5d2af8[_0xcdd1('0x16')][_0xcdd1('0x17')]===0x1f4){logger[_0xcdd1('0x16')](_0xcdd1('0x18'),'EventManager',_0x5d2af8[_0xcdd1('0x16')]);}}})['catch'](function(_0x26f861){logger[_0xcdd1('0x16')]('Trigger,\x20%s',_0xcdd1('0x19'),_0x26f861);});}function afterCreateMessage(_0x37d27b){return function(_0x2414d0){_0x2414d0=_0x2414d0[_0xcdd1('0x1a')]({'plain':!![]});_0x2414d0[_0xcdd1('0x1b')]=_0x37d27b;_0x2414d0[_0xcdd1('0x1c')]=_0x37d27b;_0x2414d0['event']=_0x2414d0[_0xcdd1('0x1d')];Promise[_0xcdd1('0x1e')]()[_0xcdd1('0x1f')](function(){if(typeof _0x2414d0[_0xcdd1('0x20')]==='undefined')return null;var _0x7070fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2414d0[_0xcdd1('0x20')];return db[_0xcdd1('0x21')]['query'](_0x7070fa,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x5b73d2){if(_0x5b73d2){_0x2414d0[_0xcdd1('0x22')]=_0x5b73d2[0x0];}if(typeof _0x2414d0[_0xcdd1('0x23')]===_0xcdd1('0x24'))return;return getAgent(_0x2414d0['UserId']);})['then'](function(_0x3a18c5){if(_0x3a18c5){_0x2414d0['interface']=util[_0xcdd1('0x25')](_0xcdd1('0x26'),_0x3a18c5['name']);_0x2414d0[_0xcdd1('0x27')]=_0x3a18c5;_0x2414d0[_0xcdd1('0x1b')]=_0x37d27b;return request({'event':'incomingmessage','message':_0x2414d0});}else{return request({'event':_0xcdd1('0x28'),'message':_0x2414d0});}})[_0xcdd1('0x29')](function(_0x34b40f){logger['error'](_0xcdd1('0x18'),_0xcdd1('0x2a'),_0x34b40f);});};}function afterCreateOfflineMessage(_0x3eedfa){return function(_0xb4bceb){_0xb4bceb=_0xb4bceb['get']({'plain':!![]});_0xb4bceb['channel']=_0x3eedfa;_0xb4bceb[_0xcdd1('0x1c')]=_0x3eedfa;_0xb4bceb[_0xcdd1('0x2b')]=_0xcdd1('0x2c');Promise['resolve']()[_0xcdd1('0x1f')](function(){return request({'event':_0xb4bceb[_0xcdd1('0x2b')],'message':_0xb4bceb});});};}function afterCreate(_0x27083d,_0x4206ed){return function(_0x3d7cb5){_0x3d7cb5=_0x3d7cb5['get']({'plain':!![]});_0x3d7cb5['channel']=_0x27083d;_0x3d7cb5['motionChannel']=_0x27083d;_0x3d7cb5[_0xcdd1('0x2b')]=_0xcdd1('0x2d');Promise[_0xcdd1('0x1e')]()[_0xcdd1('0x1f')](function(){var _0x41ccfa=_0xcdd1('0x2e')+_0x3d7cb5[_0xcdd1('0x20')];return db['sequelize']['query'](_0x41ccfa,{'type':db[_0xcdd1('0x2f')][_0xcdd1('0x30')][_0xcdd1('0x31')],'raw':!![]});})[_0xcdd1('0x1f')](function(_0x4c6860){if(_0x4c6860){_0x3d7cb5[_0xcdd1('0x22')]=_0x4c6860[0x0];}if(typeof _0x3d7cb5[_0xcdd1('0x23')]==='undefined')return;return getAgent(_0x3d7cb5[_0xcdd1('0x23')]);})[_0xcdd1('0x1f')](function(_0x3cd31a){if(_0x3cd31a){_0x3d7cb5[_0xcdd1('0x32')]=util['format']('SIP/%s',_0x3cd31a[_0xcdd1('0x33')]);_0x3d7cb5['agent']=_0x3cd31a;}return request({'event':_0x4206ed,'message':_0x3d7cb5});})[_0xcdd1('0x29')](function(_0x2a5706){logger[_0xcdd1('0x16')](_0xcdd1('0x18'),'AfterCreate',_0x2a5706);});};}function afterUpdate(_0x363dc9){return function(_0x120cce){var _0x2da371=_0x120cce[_0xcdd1('0x34')]('closed')&&_0x120cce[_0xcdd1('0x35')];var _0x301cff=_0x120cce[_0xcdd1('0x34')](_0xcdd1('0x36'));if(_0x2da371||_0x301cff){var _0x4ddcaa=_0x2da371?_0xcdd1('0x8'):_0xcdd1('0x36');var _0x1cf65b=_0x120cce[_0xcdd1('0x1a')]({'plain':!![]});_0x1cf65b[_0xcdd1('0x1b')]=_0x363dc9;_0x1cf65b['motionChannel']=_0x363dc9;_0x1cf65b[_0xcdd1('0x2b')]=_0x2da371?'closed':_0xcdd1('0x36');var _0x4d5925=_0xcdd1('0x2e')+_0x1cf65b[_0xcdd1('0x20')];return db['sequelize'][_0xcdd1('0x37')](_0x4d5925,{'type':db['Sequelize'][_0xcdd1('0x30')][_0xcdd1('0x31')],'raw':!![]})[_0xcdd1('0x1f')](function(_0x3ae301){if(_0x3ae301){_0x1cf65b[_0xcdd1('0x22')]=_0x3ae301[0x0];}if(typeof _0x1cf65b[_0xcdd1('0x23')]===_0xcdd1('0x24'))return;return getAgent(_0x1cf65b[_0xcdd1('0x23')]);})[_0xcdd1('0x1f')](function(_0x3d920){if(_0x3d920){_0x1cf65b['interface']=util[_0xcdd1('0x25')](_0xcdd1('0x26'),_0x3d920['name']);_0x1cf65b[_0xcdd1('0x27')]=_0x3d920;}return request({'event':_0x4ddcaa,'message':_0x1cf65b});})[_0xcdd1('0x29')](function(_0x1c70aa){logger[_0xcdd1('0x16')](_0xcdd1('0x18'),_0xcdd1('0x38'),_0x1c70aa);});}};}function getAgent(_0x310874){return db['User']['find']({'where':{'id':_0x310874},'attributes':['id','name','fullname',_0xcdd1('0x39'),_0xcdd1('0x3a')],'raw':!![]})[_0xcdd1('0x1f')](function(_0x2b7d02){return _0x2b7d02;});}exports[_0xcdd1('0x3b')]=function(){for(var _0x4b403d=0x0;_0x4b403d=_0x1d4cd5['agents']){throw Error(_0x41ef('0x15'));}_0xa60799(_0x978d7d);})[_0x41ef('0x16')](function(_0x560820){_0x39101e(_0x560820);});});}; \ No newline at end of file +var _0xcf60=['count','agents','catch','lodash','./license/util','voice','mail','fax','sms','getChannels','includes','isUndefined','updateAttributes','getLicense','role','agent','User'];(function(_0x1af762,_0x90fa82){var _0x5229ee=function(_0x2f247d){while(--_0x2f247d){_0x1af762['push'](_0x1af762['shift']());}};_0x5229ee(++_0x90fa82);}(_0xcf60,0xf1));var _0x0cf6=function(_0x3a7712,_0x234ae6){_0x3a7712=_0x3a7712-0x0;var _0x4ad2dc=_0xcf60[_0x3a7712];return _0x4ad2dc;};'use strict';var _=require(_0x0cf6('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x0cf6('0x1'));var channels=[_0x0cf6('0x2'),_0x0cf6('0x3'),'chat',_0x0cf6('0x4'),_0x0cf6('0x5'),'whatsapp','openchannel'];exports[_0x0cf6('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x375478){_0x375478=_0x375478['toLowerCase']();return _[_0x0cf6('0x7')](channels,_0x375478);};exports['clearBlockUser']=function(_0x30eadf,_0x4be4e7,_0x505c14,_0x5a4eac){var _0x51ce1c={'loginAttempts':_0x4be4e7,'blocked':_0x505c14};if(!_[_0x0cf6('0x8')](_0x5a4eac)){_0x51ce1c['blockedAt']=_0x5a4eac;}return _0x30eadf[_0x0cf6('0x9')](_0x51ce1c);};exports[_0x0cf6('0xa')]=function(_0x4b2ffa){return new BPromise(function(_0x1f6408,_0x17391e){var _0x11628a=0x0;if(_0x4b2ffa[_0x0cf6('0xb')]!==_0x0cf6('0xc')){_0x1f6408(_0x4b2ffa);}db[_0x0cf6('0xd')][_0x0cf6('0xe')]({'where':{'role':_0x0cf6('0xc'),'online':!![],'id':{'$ne':_0x4b2ffa['id']}}})['then'](function(_0x458919){_0x11628a=_0x458919;return util[_0x0cf6('0xa')]();})['then'](function(_0x5ef143){if(_0x5ef143&&_0x5ef143['agents']&&_0x11628a>=_0x5ef143[_0x0cf6('0xf')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1f6408(_0x4b2ffa);})[_0x0cf6('0x10')](function(_0x3e0e7a){_0x17391e(_0x3e0e7a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 29d3cf4..e7452f4 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62ca=['send','exports','404','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62ca,0x179));var _0xa62c=function(_0x3fa2b1,_0x49a05f){_0x3fa2b1=_0x3fa2b1-0x0;var _0x2a506e=_0x62ca[_0x3fa2b1];return _0x2a506e;};'use strict';module[_0xa62c('0x0')][0x194]=function pageNotFound(_0x4caa2d,_0x501c84){var _0x4fb3d1=_0xa62c('0x1');var _0x52dc78=0x194;var _0x2753c0={'status':_0x52dc78};_0x501c84[_0xa62c('0x2')](_0x2753c0[_0xa62c('0x2')]);_0x501c84['render'](_0x4fb3d1,{},function(_0x45b4ed,_0x1585d9){if(_0x45b4ed){return _0x501c84['status'](_0x2753c0[_0xa62c('0x2')])['json'](_0x2753c0);}_0x501c84[_0xa62c('0x3')](_0x1585d9);});}; \ No newline at end of file +var _0x69ae=['send','exports','status','json'];(function(_0x4c2ba2,_0x57dc7a){var _0x244f7c=function(_0x17599b){while(--_0x17599b){_0x4c2ba2['push'](_0x4c2ba2['shift']());}};_0x244f7c(++_0x57dc7a);}(_0x69ae,0x1b1));var _0xe69a=function(_0x421c01,_0x10b2b0){_0x421c01=_0x421c01-0x0;var _0x4ec78f=_0x69ae[_0x421c01];return _0x4ec78f;};'use strict';module[_0xe69a('0x0')][0x194]=function pageNotFound(_0x14779f,_0x34bd80){var _0x218ef8='404';var _0x3ec487=0x194;var _0x323572={'status':_0x3ec487};_0x34bd80[_0xe69a('0x1')](_0x323572['status']);_0x34bd80['render'](_0x218ef8,{},function(_0xe061e5,_0x56b408){if(_0xe061e5){return _0x34bd80[_0xe69a('0x1')](_0x323572[_0xe69a('0x1')])[_0xe69a('0x2')](_0x323572);}_0x34bd80[_0xe69a('0x3')](_0x56b408);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 786b1ae..529e6da 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x475a=['../api/attachment/attachment.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','User','Recordings','hasMany','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','MailMessage','Interactions','List','ListId','TemplateId','MailInteractionId','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','IntervalId','TagId','DashboardItem','FaxAccountId','Exntensions','Owner','fax_interaction_has_tags','Tags','FaxInteractionId','team_has_fax_queues','SmsAccount','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','ChatApplication','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','Website','CmCompany','CompanyId','cm_contact_has_tags','Agent','Campaign','CampaignId','OwnerId','CmHopperBlack','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','Configurations','AccountId','SalesforceField','Subjects','SubjectId','DescriptionId','FieldId','Subject','Field','VariableId','Descriptions','Description','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoField','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','FreshsalesAccount','FreshsalesField','FromId','ChatInternalMessage','ToId','SessionId','SmsQueueReport','ProjectId','MailQueues','team_has_whatsapp_queues','WhatsappQueues','campaigns_has_cm_lists','BlackLists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Contacts','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','defaultsDeep','xcall','utf8_general_ci','database','username','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','../api/network/network.model','ChatQueueReport','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','Attachment'];(function(_0x599d0b,_0x5e0318){var _0x250982=function(_0x520a59){while(--_0x520a59){_0x599d0b['push'](_0x599d0b['shift']());}};_0x250982(++_0x5e0318);}(_0x475a,0x10c));var _0xa475=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x475a[_0xa464c9];return _0x3d73c4;};'use strict';var config=require(_0xa475('0x0'));var Sequelize=require(_0xa475('0x1'));var _=require(_0xa475('0x2'));var jstz=require(_0xa475('0x3'));var timezone=jstz[_0xa475('0x4')]();config[_0xa475('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xa475('0x5'),'username':'xcall','password':_0xa475('0x6'),'options':{'host':_0xa475('0x7'),'port':0xcea,'dialect':_0xa475('0x8'),'dialectOptions':{'charset':_0xa475('0x9')},'logging':![],'timezone':timezone[_0xa475('0xa')](),'define':{'charset':_0xa475('0xb'),'collate':'utf8_general_ci'}}});config[_0xa475('0xc')]=_[_0xa475('0xd')](config[_0xa475('0xc')],{'database':_0xa475('0x5'),'username':_0xa475('0xe'),'password':'xC@LL1234','options':{'host':_0xa475('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa475('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa475('0xb'),'collate':_0xa475('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa475('0x1')][_0xa475('0x10')],config['sequelize'][_0xa475('0x11')],config[_0xa475('0x1')][_0xa475('0x12')],config[_0xa475('0x1')][_0xa475('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa475('0xc')][_0xa475('0x10')],config[_0xa475('0xc')][_0xa475('0x11')],config[_0xa475('0xc')][_0xa475('0x12')],config[_0xa475('0xc')]['options'])};db['User']=db[_0xa475('0x1')][_0xa475('0x14')]('../api/user/user.model');db[_0xa475('0x15')]=db['sequelize']['import'](_0xa475('0x16'));db[_0xa475('0x17')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x18'));db[_0xa475('0x19')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xa475('0x1a')]=db['sequelize']['import'](_0xa475('0x1b'));db[_0xa475('0x1c')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x1d'));db[_0xa475('0x1e')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0xa475('0x1f')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x20'));db[_0xa475('0x21')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x22'));db[_0xa475('0x23')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xa475('0x24')]=db['sequelize']['import'](_0xa475('0x25'));db['VoiceDialReport']=db['sequelize'][_0xa475('0x14')](_0xa475('0x26'));db['VoiceAgentReport']=db['sequelize']['import'](_0xa475('0x27'));db[_0xa475('0x28')]=db['sequelize'][_0xa475('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0xa475('0x1')]['import'](_0xa475('0x29'));db[_0xa475('0x2a')]=db[_0xa475('0x1')]['import'](_0xa475('0x2b'));db[_0xa475('0x2c')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x2d'));db[_0xa475('0x2e')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x2f'));db[_0xa475('0x30')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x31'));db[_0xa475('0x32')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x33'));db[_0xa475('0x34')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0xa475('0x35')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x36'));db[_0xa475('0x37')]=db[_0xa475('0x1')]['import'](_0xa475('0x38'));db[_0xa475('0x39')]=db[_0xa475('0x1')]['import'](_0xa475('0x3a'));db[_0xa475('0x3b')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xa475('0x3c')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0xa475('0x3d')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x3e'));db[_0xa475('0x3f')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x40'));db[_0xa475('0x41')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0xa475('0x42')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x43'));db['MailInteraction']=db['sequelize']['import'](_0xa475('0x44'));db['MailMessage']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x45'));db[_0xa475('0x46')]=db['sequelize'][_0xa475('0x14')]('../api/mailApplication/mailApplication.model');db[_0xa475('0x47')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x48'));db[_0xa475('0x49')]=db['sequelize'][_0xa475('0x14')](_0xa475('0x4a'));db['DashboardItem']=db[_0xa475('0x1')]['import'](_0xa475('0x4b'));db[_0xa475('0x4c')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/faxAccount/faxAccount.model');db[_0xa475('0x4d')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x4e'));db[_0xa475('0x4f')]=db['sequelize'][_0xa475('0x14')](_0xa475('0x50'));db[_0xa475('0x51')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x52'));db['FaxQueue']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x53'));db[_0xa475('0x54')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x55'));db['SmsAccount']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x56'));db[_0xa475('0x57')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x58'));db[_0xa475('0x59')]=db[_0xa475('0x1')]['import'](_0xa475('0x5a'));db[_0xa475('0x5b')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x5c'));db[_0xa475('0x5d')]=db['sequelize'][_0xa475('0x14')]('../api/smsQueue/smsQueue.model');db[_0xa475('0x5e')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x5f'));db[_0xa475('0x60')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x61'));db[_0xa475('0x62')]=db[_0xa475('0x1')]['import'](_0xa475('0x63'));db[_0xa475('0x64')]=db['sequelize']['import'](_0xa475('0x65'));db[_0xa475('0x66')]=db[_0xa475('0x1')]['import'](_0xa475('0x67'));db[_0xa475('0x68')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x69'));db['OpenchannelQueueReport']=db[_0xa475('0x1')]['import'](_0xa475('0x6a'));db['ChatApplication']=db[_0xa475('0x1')]['import'](_0xa475('0x6b'));db[_0xa475('0x6c')]=db['sequelize'][_0xa475('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0xa475('0x6d')]=db['sequelize'][_0xa475('0x14')](_0xa475('0x6e'));db[_0xa475('0x6f')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xa475('0x70')]=db[_0xa475('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0xa475('0x71')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/chatGroup/chatGroup.model');db[_0xa475('0x72')]=db[_0xa475('0x1')]['import'](_0xa475('0x73'));db['CmCompany']=db[_0xa475('0x1')][_0xa475('0x14')]('../api/cmCompany/cmCompany.model');db[_0xa475('0x74')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x75'));db[_0xa475('0x76')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db['sequelize']['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa475('0x77')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x78'));db[_0xa475('0x79')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x7a'));db[_0xa475('0x7b')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x7c'));db[_0xa475('0x7d')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0xa475('0x7e')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x7f'));db[_0xa475('0x80')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/automation/automation.model');db[_0xa475('0x81')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x82'));db['Disposition']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x83'));db[_0xa475('0x84')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/condition/condition.model');db[_0xa475('0x85')]=db['sequelize']['import']('../api/interval/interval.model');db[_0xa475('0x86')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x87'));db[_0xa475('0x88')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x89'));db['VoiceQueuesLog']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x8a'));db[_0xa475('0x8b')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x8c'));db[_0xa475('0x8d')]=db[_0xa475('0x1')]['import']('../api/sound/sound.model');db[_0xa475('0x8e')]=db[_0xa475('0x1')]['import'](_0xa475('0x8f'));db[_0xa475('0x90')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x91'));db[_0xa475('0x92')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x93'));db[_0xa475('0x94')]=db[_0xa475('0x1')]['import'](_0xa475('0x95'));db[_0xa475('0x96')]=db['sequelize'][_0xa475('0x14')](_0xa475('0x97'));db[_0xa475('0x98')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x99'));db[_0xa475('0x9a')]=db['sequelize'][_0xa475('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xa475('0x9b')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x9c'));db[_0xa475('0x9d')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xa475('0x9e')]=db[_0xa475('0x1')]['import'](_0xa475('0x9f'));db[_0xa475('0xa0')]=db[_0xa475('0x1')]['import'](_0xa475('0xa1'));db[_0xa475('0xa2')]=db['sequelize']['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xa475('0xa3')]=db['sequelize']['import'](_0xa475('0xa4'));db[_0xa475('0xa5')]=db[_0xa475('0x1')]['import'](_0xa475('0xa6'));db['SalesforceField']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xa7'));db[_0xa475('0xa8')]=db[_0xa475('0x1')]['import'](_0xa475('0xa9'));db[_0xa475('0xaa')]=db[_0xa475('0x1')]['import'](_0xa475('0xab'));db[_0xa475('0xac')]=db[_0xa475('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xad'));db['DeskConfiguration']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xae'));db[_0xa475('0xaf')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xb0'));db[_0xa475('0xb1')]=db[_0xa475('0x1')]['import'](_0xa475('0xb2'));db[_0xa475('0xb3')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db['sequelize'][_0xa475('0x14')](_0xa475('0xb4'));db[_0xa475('0xb5')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xb6'));db['ZendeskConfiguration']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xb7'));db['ZendeskField']=db['sequelize']['import'](_0xa475('0xb8'));db['FreshdeskAccount']=db['sequelize'][_0xa475('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xa475('0xb9')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xba'));db['FreshdeskField']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xbb'));db[_0xa475('0xbc')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xbd'));db['VtigerConfiguration']=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xbe'));db[_0xa475('0xbf')]=db['sequelize'][_0xa475('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0xa475('0xc0')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xc1'));db[_0xa475('0xc2')]=db[_0xa475('0x1')]['import'](_0xa475('0xc3'));db[_0xa475('0xc4')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xc5'));db[_0xa475('0xc6')]=db[_0xa475('0x1')]['import'](_0xa475('0xc7'));db[_0xa475('0xc8')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xc9'));db[_0xa475('0xca')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xcb'));db['FreshsalesAccount']=db['sequelize']['import'](_0xa475('0xcc'));db[_0xa475('0xcd')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xce'));db['FreshsalesField']=db[_0xa475('0x1')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0xa475('0x96')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x97'));db[_0xa475('0xcf')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xd0'));db[_0xa475('0xd1')]=db[_0xa475('0x1')]['import']('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0xa475('0x1')][_0xa475('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xa475('0xd2')]=db['sequelize'][_0xa475('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xa475('0xd3')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xd4'));db[_0xa475('0xd5')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xa475('0x1')][_0xa475('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa475('0xd6')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xd7'));db[_0xa475('0xd8')]=db[_0xa475('0x1')]['import'](_0xa475('0xd9'));db[_0xa475('0xda')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xa475('0xdb')]=db['sequelize'][_0xa475('0x14')]('../api/setting/setting.model');db[_0xa475('0xdc')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xdd'));db[_0xa475('0xde')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xdf'));db[_0xa475('0xe0')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xe1'));db[_0xa475('0xe2')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xe3'));db[_0xa475('0xe4')]=db['sequelize']['import'](_0xa475('0xe5'));db[_0xa475('0xe6')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xe7'));db['Campaign']=db[_0xa475('0x1')][_0xa475('0x14')]('../api/campaign/campaign.model');db[_0xa475('0xe8')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/migration/migration.model');db[_0xa475('0xe9')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xea'));db['Plugin']=db['sequelize'][_0xa475('0x14')]('../api/plugin/plugin.model');db[_0xa475('0xeb')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xa475('0xec')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xed'));db[_0xa475('0xee')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xef'));db[_0xa475('0xf0')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xf1'));db[_0xa475('0xf2')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xf3'));db[_0xa475('0xf4')]=db[_0xa475('0x1')]['import'](_0xa475('0xf5'));db[_0xa475('0xf6')]=db[_0xa475('0x1')]['import'](_0xa475('0xf7'));db[_0xa475('0xf8')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xf9'));db[_0xa475('0xfa')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xfb'));db[_0xa475('0xfc')]=db['sequelize'][_0xa475('0x14')](_0xa475('0xfd'));db[_0xa475('0xfe')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0xff'));db[_0xa475('0x100')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x101'));db[_0xa475('0x102')]=db[_0xa475('0x1')]['import'](_0xa475('0x103'));db['WhatsappInteraction']=db[_0xa475('0x1')]['import'](_0xa475('0x104'));db[_0xa475('0x105')]=db[_0xa475('0x1')][_0xa475('0x14')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db['sequelize'][_0xa475('0x14')](_0xa475('0x106'));db[_0xa475('0x107')]=db['sequelize'][_0xa475('0x14')](_0xa475('0x108'));db[_0xa475('0x109')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x10a'));db[_0xa475('0x10b')]=db['sequelize']['import'](_0xa475('0x10c'));db[_0xa475('0x10d')]=db[_0xa475('0x1')]['import'](_0xa475('0x10e'));db[_0xa475('0x10f')]=db[_0xa475('0x1')][_0xa475('0x14')](_0xa475('0x110'));db[_0xa475('0x111')]=db['sequelize'][_0xa475('0x14')](_0xa475('0x112'));db['User'][_0xa475('0x113')](db[_0xa475('0x21')],{'as':_0xa475('0x21'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')]['hasMany'](db[_0xa475('0x1e')],{'as':_0xa475('0x117'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')][_0xa475('0x118')](db['UserVoiceQueueRt'],{'as':_0xa475('0x119'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')][_0xa475('0x118')](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0xa475('0x116')][_0xa475('0x118')](db[_0xa475('0x77')],{'as':_0xa475('0x11a'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')]['hasMany'](db[_0xa475('0x79')],{'as':_0xa475('0x11b'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')][_0xa475('0x118')](db['ReportAgentPreview'],{'as':_0xa475('0x7b'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')][_0xa475('0x118')](db[_0xa475('0x62')],{'as':_0xa475('0x11c'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')]['hasMany'](db[_0xa475('0x6c')],{'as':_0xa475('0x11d'),'foreignKey':_0xa475('0x115')});db['User']['hasMany'](db['SmsInteraction'],{'as':_0xa475('0x11e'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')]['hasMany'](db['FaxInteraction'],{'as':_0xa475('0x11f'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')]['hasMany'](db[_0xa475('0x120')],{'as':_0xa475('0x121'),'foreignKey':'UserId'});db['User'][_0xa475('0x118')](db[_0xa475('0x122')],{'as':_0xa475('0x123'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x116')][_0xa475('0x118')](db[_0xa475('0xfe')],{'as':_0xa475('0x124'),'foreignKey':_0xa475('0x125')});db[_0xa475('0x116')]['belongsTo'](db[_0xa475('0xf8')],{'as':_0xa475('0xf8'),'foreignKey':_0xa475('0x126')});db['User'][_0xa475('0x127')](db[_0xa475('0x71')],{'as':_0xa475('0x128'),'through':'chat_group_has_users'});db[_0xa475('0x116')][_0xa475('0x127')](db['CmContact'],{'as':'Contacts','through':_0xa475('0x129')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0xf4')],{'as':_0xa475('0x12a'),'through':_0xa475('0x12b')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0xe4')],{'through':_0xa475('0x12c')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x120')],{'as':_0xa475('0x121'),'through':'user_has_mail_interactions'});db[_0xa475('0x116')]['belongsToMany'](db['ChatInteraction'],{'as':_0xa475('0x11d'),'through':_0xa475('0x12d')});db['User']['belongsToMany'](db[_0xa475('0x4f')],{'as':'FaxInteractions','through':_0xa475('0x12e')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x59')],{'as':_0xa475('0x11e'),'through':_0xa475('0x12f')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x62')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db['User'][_0xa475('0x127')](db[_0xa475('0x122')],{'as':_0xa475('0x123'),'through':_0xa475('0x130')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x1c')],{'as':_0xa475('0x131'),'through':_0xa475('0x30'),'required':![]});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0xf6')],{'as':_0xa475('0x132'),'through':_0xa475('0x111'),'required':![]});db['User'][_0xa475('0x127')](db[_0xa475('0x41')],{'as':'MailQueues','through':_0xa475('0x34'),'required':![]});db['User'][_0xa475('0x127')](db[_0xa475('0x70')],{'as':_0xa475('0x133'),'through':_0xa475('0x32'),'required':![],'hooks':!![]});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x134')],{'as':_0xa475('0x135'),'through':_0xa475('0x35'),'required':![]});db[_0xa475('0x116')][_0xa475('0x127')](db['SmsQueue'],{'as':_0xa475('0x136'),'through':'UserSmsQueue','required':![]});db['User'][_0xa475('0x127')](db[_0xa475('0x66')],{'as':_0xa475('0x137'),'through':_0xa475('0x39'),'required':![]});db[_0xa475('0x116')]['belongsToMany'](db[_0xa475('0x109')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0xf4')],{'through':_0xa475('0x12b')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x68')],{'as':_0xa475('0x138'),'through':'user_has_chat_websites'});db[_0xa475('0x116')][_0xa475('0x127')](db['FaxAccount'],{'as':_0xa475('0x139'),'through':_0xa475('0x13a')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x3f')],{'as':'MailAccounts','through':_0xa475('0x13b')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x5e')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xa475('0x116')][_0xa475('0x127')](db['SmsAccount'],{'as':_0xa475('0x13c'),'through':_0xa475('0x13d')});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0x100')],{'as':_0xa475('0x13e'),'through':'user_has_whatsapp_accounts'});db[_0xa475('0x116')][_0xa475('0x127')](db[_0xa475('0xde')],{'as':_0xa475('0x13f'),'through':_0xa475('0x140')});db[_0xa475('0x15')][_0xa475('0x118')](db[_0xa475('0x19')],{'as':_0xa475('0x141'),'onDelete':'cascade','foreignKey':_0xa475('0x142')});db[_0xa475('0x17')][_0xa475('0x118')](db[_0xa475('0x19')],{'onDelete':_0xa475('0x114')});db[_0xa475('0x19')][_0xa475('0x118')](db[_0xa475('0x19')],{'as':_0xa475('0x143'),'onDelete':_0xa475('0x114')});db[_0xa475('0x1a')][_0xa475('0x127')](db[_0xa475('0x8d')],{'as':_0xa475('0x144'),'through':_0xa475('0x145')});db[_0xa475('0x1c')]['hasMany'](db[_0xa475('0x2e')],{'as':_0xa475('0x146'),'foreignKey':_0xa475('0x147')});db[_0xa475('0x1c')][_0xa475('0x118')](db[_0xa475('0x76')],{'as':_0xa475('0x148'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xa475('0x77')],{'as':_0xa475('0x11a'),'foreignKey':'VoiceQueueId'});db[_0xa475('0x1c')][_0xa475('0x118')](db[_0xa475('0x79')],{'as':_0xa475('0x149'),'foreignKey':'VoiceQueueId'});db[_0xa475('0x1c')][_0xa475('0x118')](db[_0xa475('0x7b')],{'as':_0xa475('0x7b'),'foreignKey':_0xa475('0x147')});db['VoiceQueue'][_0xa475('0x118')](db['CmHopperBlack'],{'as':_0xa475('0x14a'),'foreignKey':_0xa475('0x147')});db[_0xa475('0x1c')][_0xa475('0x118')](db['JscriptySessionReport'],{'as':_0xa475('0x14b'),'foreignKey':'VoiceQueueId'});db[_0xa475('0x1c')][_0xa475('0x14c')](db[_0xa475('0x2a')],{'as':_0xa475('0x2a'),'foreignKey':_0xa475('0x14d')});db[_0xa475('0x1c')]['belongsTo'](db['Trunk'],{'as':_0xa475('0x14e'),'foreignKey':_0xa475('0x14f')});db[_0xa475('0x1c')]['belongsTo'](db[_0xa475('0x85')],{'as':_0xa475('0x85'),'foreignKey':'IntervalId'});db[_0xa475('0x1c')][_0xa475('0x14c')](db[_0xa475('0x86')],{'as':_0xa475('0x150'),'foreignKey':_0xa475('0x151')});db[_0xa475('0x1c')]['belongsToMany'](db[_0xa475('0xf4')],{'as':_0xa475('0x12a'),'through':_0xa475('0x152')});db[_0xa475('0x1c')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':_0xa475('0x30')});db[_0xa475('0x1c')][_0xa475('0x127')](db['Team'],{'as':_0xa475('0x154'),'through':_0xa475('0x10d')});db['VoiceQueue'][_0xa475('0x127')](db['CmList'],{'as':'BlackLists','through':_0xa475('0x155')});db[_0xa475('0x1e')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x116'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x1f')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':'User','foreignKey':_0xa475('0x115')});db[_0xa475('0x21')][_0xa475('0x118')](db['VoiceMailMessage'],{'as':_0xa475('0x156'),'onDelete':'cascade','foreignKey':_0xa475('0x157'),'sourceKey':_0xa475('0x158')});db['VoiceMailMessage'][_0xa475('0x14c')](db[_0xa475('0x21')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0xa475('0x24')][_0xa475('0x118')](db[_0xa475('0x28')],{'as':_0xa475('0x159'),'foreignKey':'uniqueid','constraints':![]});db[_0xa475('0x24')][_0xa475('0x118')](db[_0xa475('0x15a')],{'as':_0xa475('0x15b'),'foreignKey':_0xa475('0x15c'),'constraints':![]});db[_0xa475('0x24')][_0xa475('0x14c')](db['User'],{'as':_0xa475('0x116'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x24')][_0xa475('0x14c')](db['CmContact'],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db[_0xa475('0x3c')]['belongsTo'](db[_0xa475('0x3f')],{'as':_0xa475('0x3f'),'foreignKey':'MailAccountId'});db[_0xa475('0x3c')][_0xa475('0x14c')](db['CloudProvider'],{'as':_0xa475('0x10b'),'foreignKey':_0xa475('0x15f'),'onDelete':_0xa475('0x160')});db['MailServerOut']['belongsTo'](db['MailAccount'],{'as':_0xa475('0x3f'),'foreignKey':_0xa475('0x161')});db[_0xa475('0x3d')]['belongsTo'](db[_0xa475('0x10b')],{'as':_0xa475('0x10b'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xa475('0x3f')][_0xa475('0x113')](db[_0xa475('0x3c')],{'as':_0xa475('0x162'),'onDelete':_0xa475('0x114')});db[_0xa475('0x3f')][_0xa475('0x113')](db[_0xa475('0x3d')],{'as':_0xa475('0x163'),'onDelete':_0xa475('0x114')});db[_0xa475('0x3f')]['hasMany'](db[_0xa475('0x164')],{'as':_0xa475('0x165'),'foreignKey':_0xa475('0x161'),'onDelete':_0xa475('0x114')});db[_0xa475('0x3f')]['hasMany'](db[_0xa475('0x81')],{'as':_0xa475('0x166'),'foreignKey':'MailAccountId'});db[_0xa475('0x3f')][_0xa475('0x118')](db[_0xa475('0x167')],{'as':'Messages','foreignKey':_0xa475('0x161')});db[_0xa475('0x3f')][_0xa475('0x118')](db[_0xa475('0x120')],{'as':_0xa475('0x168')});db[_0xa475('0x3f')][_0xa475('0x118')](db[_0xa475('0x46')],{'as':_0xa475('0x143')});db[_0xa475('0x3f')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0x3f')]['belongsTo'](db[_0xa475('0x90')],{'as':_0xa475('0x90'),'foreignKey':_0xa475('0x16b')});db['MailAccount'][_0xa475('0x14c')](db['Pause'],{'as':_0xa475('0x150'),'foreignKey':_0xa475('0x151')});db[_0xa475('0x3f')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':_0xa475('0x13b')});db[_0xa475('0x41')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':_0xa475('0x34')});db['MailQueue'][_0xa475('0x127')](db[_0xa475('0xe4')],{'through':'team_has_mail_queues','as':_0xa475('0x154')});db[_0xa475('0x120')]['hasMany'](db[_0xa475('0x167')],{'as':_0xa475('0x156'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x16c')});db['MailInteraction'][_0xa475('0x14c')](db[_0xa475('0x3f')],{'as':'Account','foreignKey':_0xa475('0x161')});db[_0xa475('0x120')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa475('0x120')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':'Owner','foreignKey':_0xa475('0x115')});db['MailInteraction'][_0xa475('0x127')](db['Tag'],{'through':_0xa475('0x16d'),'as':'Tags'});db['MailInteraction'][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':_0xa475('0x16d'),'as':_0xa475('0x16e')});db[_0xa475('0x120')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xa475('0x16c')});db[_0xa475('0x167')][_0xa475('0x118')](db['Attachment'],{'as':_0xa475('0x170'),'onDelete':_0xa475('0x114')});db['MailMessage']['belongsTo'](db[_0xa475('0x116')],{'as':_0xa475('0x116')});db[_0xa475('0x167')][_0xa475('0x14c')](db['CmContact'],{'onDelete':'cascade','as':_0xa475('0x15d')});db[_0xa475('0x167')]['belongsTo'](db[_0xa475('0x120')],{'as':_0xa475('0x171'),'foreignKey':_0xa475('0x16c')});db[_0xa475('0x167')][_0xa475('0x14c')](db['MailAccount'],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x161')});db['MailMessage'][_0xa475('0x14c')](db[_0xa475('0x68')],{'as':'ChatWebsite','foreignKey':_0xa475('0x173')});db[_0xa475('0x167')][_0xa475('0x14c')](db[_0xa475('0x6f')],{'as':_0xa475('0x6f'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0xa475('0x14c')](db[_0xa475('0x116')],{'onDelete':'restrict'});db['MailApplication'][_0xa475('0x14c')](db[_0xa475('0x41')],{'onDelete':_0xa475('0x160')});db[_0xa475('0x46')]['belongsTo'](db[_0xa475('0x3f')],{'onDelete':_0xa475('0x160')});db[_0xa475('0x46')]['belongsTo'](db[_0xa475('0x85')],{'onDelete':'restrict','foreignKey':_0xa475('0x174')});db[_0xa475('0x46')][_0xa475('0x14c')](db[_0xa475('0x8e')],{'onDelete':_0xa475('0x160'),'foreignKey':_0xa475('0x175')});db[_0xa475('0x47')][_0xa475('0x14c')](db['MailAccount'],{});db[_0xa475('0x47')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':'List','foreignKey':_0xa475('0x16a')});db[_0xa475('0x47')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db[_0xa475('0x47')][_0xa475('0x14c')](db['MailInteraction'],{});db[_0xa475('0x47')]['belongsTo'](db['MailMessage'],{});db[_0xa475('0x47')][_0xa475('0x14c')](db[_0xa475('0x116')],{});db['MailQueueReport'][_0xa475('0x14c')](db[_0xa475('0x41')],{});db[_0xa475('0x49')][_0xa475('0x118')](db[_0xa475('0x176')],{'as':'Items','onDelete':_0xa475('0x114')});db[_0xa475('0x4c')][_0xa475('0x118')](db[_0xa475('0x164')],{'as':'Dispositions','foreignKey':_0xa475('0x177'),'onDelete':_0xa475('0x114')});db[_0xa475('0x4c')][_0xa475('0x118')](db['CannedAnswer'],{'as':_0xa475('0x166'),'foreignKey':_0xa475('0x177')});db[_0xa475('0x4c')][_0xa475('0x118')](db['FaxInteraction'],{'as':_0xa475('0x168')});db[_0xa475('0x4c')]['hasMany'](db['FaxApplication'],{'as':_0xa475('0x143')});db[_0xa475('0x4c')]['hasMany'](db[_0xa475('0x19')],{'as':_0xa475('0x178'),'onDelete':_0xa475('0x114')});db[_0xa475('0x4c')][_0xa475('0x118')](db[_0xa475('0x51')],{'as':'Messages'});db[_0xa475('0x4c')][_0xa475('0x14c')](db['Trunk'],{'as':'Trunk'});db[_0xa475('0x4c')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':'List','foreignKey':_0xa475('0x16a')});db['FaxAccount'][_0xa475('0x14c')](db['Pause'],{'as':_0xa475('0x150'),'foreignKey':_0xa475('0x151')});db[_0xa475('0x4c')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':'user_has_fax_accounts'});db[_0xa475('0x4d')][_0xa475('0x14c')](db[_0xa475('0x116')],{'onDelete':'restrict'});db[_0xa475('0x4d')]['belongsTo'](db[_0xa475('0x134')],{'onDelete':'restrict'});db['FaxApplication'][_0xa475('0x14c')](db[_0xa475('0x4c')],{'onDelete':_0xa475('0x160')});db[_0xa475('0x4d')][_0xa475('0x14c')](db[_0xa475('0x8e')],{'onDelete':'restrict','foreignKey':_0xa475('0x175')});db[_0xa475('0x4f')][_0xa475('0x118')](db['FaxMessage'],{'as':_0xa475('0x156'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xa475('0x14c')](db[_0xa475('0x4c')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x177')});db['FaxInteraction'][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db[_0xa475('0x4f')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x179'),'foreignKey':_0xa475('0x115')});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':_0xa475('0x17a'),'as':_0xa475('0x17b')});db['FaxInteraction'][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':'fax_interaction_has_tags','as':_0xa475('0x16e')});db['FaxInteraction']['belongsToMany'](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'through':_0xa475('0x12e'),'foreignKey':_0xa475('0x17c')});db[_0xa475('0x51')][_0xa475('0x14c')](db['User'],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x116')});db[_0xa475('0x51')][_0xa475('0x14c')](db[_0xa475('0x4f')],{'as':_0xa475('0x171'),'foreignKey':_0xa475('0x17c')});db['FaxMessage'][_0xa475('0x14c')](db[_0xa475('0x74')],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x15d')});db[_0xa475('0x51')][_0xa475('0x14c')](db[_0xa475('0xe9')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xa475('0x51')][_0xa475('0x14c')](db[_0xa475('0x4c')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x177')});db[_0xa475('0x134')][_0xa475('0x127')](db['User'],{'as':_0xa475('0x153'),'through':_0xa475('0x35')});db[_0xa475('0x134')][_0xa475('0x127')](db[_0xa475('0xe4')],{'through':_0xa475('0x17d'),'as':_0xa475('0x154')});db[_0xa475('0x54')][_0xa475('0x14c')](db['FaxAccount'],{});db[_0xa475('0x54')]['belongsTo'](db[_0xa475('0xf4')],{'as':_0xa475('0x169'),'foreignKey':'ListId'});db[_0xa475('0x54')][_0xa475('0x14c')](db['CmContact'],{'as':'Contact','foreignKey':_0xa475('0x15e')});db['FaxQueueReport'][_0xa475('0x14c')](db[_0xa475('0x4f')],{});db[_0xa475('0x54')]['belongsTo'](db['FaxMessage'],{});db['FaxQueueReport'][_0xa475('0x14c')](db[_0xa475('0x116')],{});db[_0xa475('0x54')][_0xa475('0x14c')](db[_0xa475('0x134')],{});db[_0xa475('0x17e')][_0xa475('0x118')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa475('0x17f'),'onDelete':_0xa475('0x114')});db['SmsAccount'][_0xa475('0x118')](db[_0xa475('0x81')],{'as':_0xa475('0x166'),'foreignKey':_0xa475('0x17f')});db['SmsAccount'][_0xa475('0x118')](db[_0xa475('0x5b')],{'as':_0xa475('0x156'),'foreignKey':'SmsAccountId'});db[_0xa475('0x17e')][_0xa475('0x118')](db['SmsInteraction'],{'as':_0xa475('0x168')});db['SmsAccount'][_0xa475('0x118')](db['SmsApplication'],{'as':_0xa475('0x143')});db[_0xa475('0x17e')]['belongsTo'](db[_0xa475('0xf4')],{'as':'List','foreignKey':_0xa475('0x16a')});db[_0xa475('0x17e')][_0xa475('0x14c')](db[_0xa475('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xa475('0x151')});db[_0xa475('0x17e')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':'user_has_sms_accounts'});db[_0xa475('0x57')]['belongsTo'](db['User'],{'onDelete':_0xa475('0x160')});db[_0xa475('0x57')]['belongsTo'](db[_0xa475('0x5d')],{'onDelete':'restrict'});db[_0xa475('0x57')][_0xa475('0x14c')](db['SmsAccount'],{'onDelete':_0xa475('0x160')});db[_0xa475('0x57')][_0xa475('0x14c')](db[_0xa475('0x85')],{'onDelete':'restrict','foreignKey':_0xa475('0x174')});db[_0xa475('0x57')]['belongsTo'](db[_0xa475('0x8e')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xa475('0x59')][_0xa475('0x118')](db[_0xa475('0x5b')],{'as':_0xa475('0x156'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x180')});db[_0xa475('0x59')][_0xa475('0x14c')](db[_0xa475('0x17e')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x17f')});db[_0xa475('0x59')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db['SmsInteraction'][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x179'),'foreignKey':'UserId'});db[_0xa475('0x59')][_0xa475('0x127')](db['Tag'],{'through':_0xa475('0x181'),'as':_0xa475('0x17b')});db[_0xa475('0x59')][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':_0xa475('0x181'),'as':_0xa475('0x16e')});db[_0xa475('0x59')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':'Users','through':_0xa475('0x12f'),'foreignKey':_0xa475('0x180')});db[_0xa475('0x5b')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x116')});db[_0xa475('0x5b')]['belongsTo'](db[_0xa475('0x74')],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x15d')});db[_0xa475('0x5b')][_0xa475('0x14c')](db[_0xa475('0x59')],{'onDelete':'cascade','as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xa475('0x5b')][_0xa475('0x14c')](db[_0xa475('0x17e')],{'as':_0xa475('0x172'),'foreignKey':'SmsAccountId'});db['SmsQueue']['belongsToMany'](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':_0xa475('0x37'),'foreignKey':_0xa475('0x182')});db[_0xa475('0x5d')][_0xa475('0x127')](db['Team'],{'through':_0xa475('0x183'),'as':'Teams'});db[_0xa475('0x5e')][_0xa475('0x118')](db[_0xa475('0x164')],{'as':_0xa475('0x165'),'foreignKey':_0xa475('0x184'),'onDelete':_0xa475('0x114')});db[_0xa475('0x5e')][_0xa475('0x118')](db[_0xa475('0x81')],{'as':_0xa475('0x166'),'foreignKey':_0xa475('0x184')});db['OpenchannelAccount'][_0xa475('0x118')](db[_0xa475('0x62')],{'as':'Interactions','foreignKey':_0xa475('0x184')});db[_0xa475('0x5e')]['hasMany'](db[_0xa475('0x64')],{'as':_0xa475('0x156'),'foreignKey':'OpenchannelAccountId'});db[_0xa475('0x5e')]['hasMany'](db[_0xa475('0x60')],{'as':_0xa475('0x143'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xa475('0x14c')](db['CmList'],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a')});db['OpenchannelAccount'][_0xa475('0x14c')](db[_0xa475('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xa475('0x151')});db[_0xa475('0x5e')]['belongsToMany'](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':_0xa475('0x185')});db[_0xa475('0x60')][_0xa475('0x14c')](db[_0xa475('0x116')],{'onDelete':_0xa475('0x160')});db['OpenchannelApplication'][_0xa475('0x14c')](db[_0xa475('0x66')],{'onDelete':_0xa475('0x160'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0xa475('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0xa475('0x60')]['belongsTo'](db[_0xa475('0x85')],{'onDelete':'restrict','foreignKey':_0xa475('0x174')});db[_0xa475('0x60')]['belongsTo'](db[_0xa475('0x8e')],{'onDelete':_0xa475('0x160'),'foreignKey':_0xa475('0x175')});db['OpenchannelInteraction']['hasMany'](db[_0xa475('0x64')],{'as':_0xa475('0x156'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x186')});db[_0xa475('0x62')][_0xa475('0x14c')](db['OpenchannelAccount'],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x184')});db[_0xa475('0x62')]['belongsTo'](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db[_0xa475('0x62')]['belongsTo'](db['User'],{'as':_0xa475('0x179'),'foreignKey':_0xa475('0x115')});db[_0xa475('0x62')][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':_0xa475('0x187'),'as':_0xa475('0x17b')});db[_0xa475('0x62')][_0xa475('0x127')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xa475('0x16e')});db[_0xa475('0x62')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':'Users','through':_0xa475('0x188'),'foreignKey':_0xa475('0x186')});db[_0xa475('0x64')]['belongsTo'](db[_0xa475('0x116')],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x116')});db[_0xa475('0x64')]['belongsTo'](db[_0xa475('0x74')],{'onDelete':_0xa475('0x114'),'as':'Contact'});db['OpenchannelMessage'][_0xa475('0x14c')](db[_0xa475('0x62')],{'onDelete':'cascade','as':_0xa475('0x171'),'foreignKey':_0xa475('0x186')});db[_0xa475('0x64')][_0xa475('0x14c')](db[_0xa475('0xe9')],{'as':_0xa475('0xe9'),'foreignKey':_0xa475('0x189')});db[_0xa475('0x64')][_0xa475('0x14c')](db[_0xa475('0x5e')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x184')});db[_0xa475('0x66')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':'UserOpenchannelQueue','foreignKey':_0xa475('0x18a')});db[_0xa475('0x66')]['belongsToMany'](db[_0xa475('0xe4')],{'through':_0xa475('0x18b'),'as':_0xa475('0x154')});db[_0xa475('0x68')][_0xa475('0x118')](db[_0xa475('0x164')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xa475('0x68')]['hasMany'](db[_0xa475('0x81')],{'as':_0xa475('0x166'),'foreignKey':'ChatWebsiteId'});db[_0xa475('0x68')][_0xa475('0x118')](db[_0xa475('0x72')],{'as':_0xa475('0x18c')});db[_0xa475('0x68')]['hasMany'](db[_0xa475('0x6c')],{'as':_0xa475('0x168')});db[_0xa475('0x68')][_0xa475('0x118')](db['ChatApplication'],{'as':_0xa475('0x143')});db[_0xa475('0x68')][_0xa475('0x118')](db[_0xa475('0x6d')],{'as':'Messages'});db['ChatWebsite'][_0xa475('0x14c')](db['CmList'],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0x68')]['belongsTo'](db[_0xa475('0x85')],{'as':_0xa475('0x85'),'foreignKey':_0xa475('0x174')});db[_0xa475('0x68')][_0xa475('0x14c')](db[_0xa475('0x3f')],{'as':_0xa475('0x3f'),'foreignKey':_0xa475('0x161')});db['ChatWebsite'][_0xa475('0x14c')](db[_0xa475('0x86')],{'as':_0xa475('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xa475('0x127')](db[_0xa475('0x116')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xa475('0x14c')](db['OpenchannelAccount'],{});db[_0xa475('0x18d')]['belongsTo'](db[_0xa475('0xf4')],{'as':'List','foreignKey':_0xa475('0x16a')});db[_0xa475('0x18d')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db['OpenchannelQueueReport'][_0xa475('0x14c')](db[_0xa475('0x62')],{});db[_0xa475('0x18d')][_0xa475('0x14c')](db[_0xa475('0x64')],{});db[_0xa475('0x18d')]['belongsTo'](db[_0xa475('0x116')],{});db[_0xa475('0x18d')][_0xa475('0x14c')](db[_0xa475('0x66')],{});db[_0xa475('0x18e')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':'Agent','foreignKey':_0xa475('0x115'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xa475('0x70')],{'as':_0xa475('0x18f'),'foreignKey':_0xa475('0x190'),'onDelete':_0xa475('0x160')});db[_0xa475('0x18e')][_0xa475('0x14c')](db[_0xa475('0x68')],{'as':'Website','foreignKey':_0xa475('0x173'),'onDelete':_0xa475('0x160')});db['ChatApplication']['belongsTo'](db[_0xa475('0x8e')],{'onDelete':_0xa475('0x160'),'foreignKey':_0xa475('0x175')});db['ChatInteraction'][_0xa475('0x118')](db['ChatMessage'],{'as':_0xa475('0x156'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x191')});db[_0xa475('0x6c')]['belongsTo'](db[_0xa475('0x68')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x173')});db[_0xa475('0x6c')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e')});db[_0xa475('0x6c')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':'Owner','foreignKey':'UserId'});db[_0xa475('0x6c')][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':_0xa475('0x192'),'as':_0xa475('0x17b')});db[_0xa475('0x6c')][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':_0xa475('0x192'),'as':_0xa475('0x16e')});db[_0xa475('0x6c')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'through':'user_has_chat_interactions','foreignKey':_0xa475('0x191')});db[_0xa475('0x6d')]['belongsTo'](db[_0xa475('0x116')],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x116')});db[_0xa475('0x6d')]['belongsTo'](db[_0xa475('0x74')],{'onDelete':_0xa475('0x114'),'as':'Contact','foreignKey':_0xa475('0x15e')});db[_0xa475('0x6d')]['belongsTo'](db[_0xa475('0x6c')],{'onDelete':_0xa475('0x114'),'as':'Interaction','foreignKey':_0xa475('0x191')});db[_0xa475('0x6d')]['belongsTo'](db['Attachment'],{'as':_0xa475('0xe9'),'foreignKey':'AttachmentId'});db[_0xa475('0x6d')][_0xa475('0x14c')](db[_0xa475('0x68')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x173')});db['ChatOfflineMessage']['hasMany'](db[_0xa475('0xe9')],{'as':'Attachments','foreignKey':_0xa475('0x193'),'onDelete':_0xa475('0x114'),'hooks':!![]});db[_0xa475('0x6f')][_0xa475('0x14c')](db[_0xa475('0x74')],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x15d'),'foreignKey':'ContactId'});db[_0xa475('0x6f')][_0xa475('0x14c')](db[_0xa475('0x68')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x173')});db[_0xa475('0x70')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xa475('0x32'),'hooks':!![]});db[_0xa475('0x70')][_0xa475('0x127')](db[_0xa475('0xe4')],{'through':_0xa475('0x194'),'as':_0xa475('0x154')});db['ChatGroup'][_0xa475('0x118')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xa475('0x195'),'onDelete':_0xa475('0x114')});db[_0xa475('0x71')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x146'),'through':'chat_group_has_users'});db[_0xa475('0x72')]['belongsTo'](db[_0xa475('0x68')],{'as':_0xa475('0x196'),'foreignKey':'ChatWebsiteId'});db[_0xa475('0x197')][_0xa475('0x118')](db['CmContact'],{'as':'Contacts','foreignKey':_0xa475('0x198')});db[_0xa475('0x74')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db[_0xa475('0x74')][_0xa475('0x118')](db[_0xa475('0x77')],{'as':_0xa475('0x11a'),'foreignKey':'ContactId'});db[_0xa475('0x74')][_0xa475('0x118')](db['CmHopperHistory'],{'as':_0xa475('0x149'),'foreignKey':_0xa475('0x15e')});db[_0xa475('0x74')]['hasMany'](db[_0xa475('0x7b')],{'as':_0xa475('0x7b'),'foreignKey':_0xa475('0x15e')});db['CmContact'][_0xa475('0x118')](db[_0xa475('0xd5')],{'as':_0xa475('0x14b'),'foreignKey':_0xa475('0x15e')});db['CmContact'][_0xa475('0x118')](db[_0xa475('0x62')],{'as':'OpenchannelInteractions','foreignKey':_0xa475('0x15e'),'onDelete':_0xa475('0x160')});db[_0xa475('0x74')]['hasMany'](db[_0xa475('0x6c')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0xa475('0x160')});db[_0xa475('0x74')]['hasMany'](db[_0xa475('0x59')],{'as':_0xa475('0x11e'),'foreignKey':_0xa475('0x15e'),'onDelete':_0xa475('0x160')});db['CmContact']['hasMany'](db[_0xa475('0x4f')],{'as':'FaxInteractions','foreignKey':_0xa475('0x15e'),'onDelete':_0xa475('0x160')});db[_0xa475('0x74')][_0xa475('0x118')](db[_0xa475('0x120')],{'as':_0xa475('0x121'),'foreignKey':_0xa475('0x15e'),'onDelete':_0xa475('0x160')});db[_0xa475('0x74')][_0xa475('0x14c')](db[_0xa475('0x197')],{'as':'Company','foreignKey':_0xa475('0x198')});db[_0xa475('0x74')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a'),'onDelete':_0xa475('0x114')});db[_0xa475('0x74')]['belongsToMany'](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'through':_0xa475('0x129')});db[_0xa475('0x74')]['belongsToMany'](db[_0xa475('0x8e')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xa475('0x74')][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':_0xa475('0x199'),'as':_0xa475('0x16e')});db[_0xa475('0x76')][_0xa475('0x14c')](db['CmContact'],{'as':_0xa475('0x15d'),'foreignKey':'ContactId','onDelete':_0xa475('0x114')});db[_0xa475('0x76')][_0xa475('0x14c')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0xa475('0x114')});db['CmHopper'][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x19a'),'foreignKey':'UserId'});db[_0xa475('0x76')][_0xa475('0x14c')](db[_0xa475('0x1c')],{'as':_0xa475('0x18f'),'foreignKey':'VoiceQueueId','onDelete':_0xa475('0x114')});db['CmHopper'][_0xa475('0x14c')](db[_0xa475('0x19b')],{'as':_0xa475('0x19b'),'foreignKey':_0xa475('0x19c'),'onDelete':'cascade'});db[_0xa475('0x76')][_0xa475('0x14c')](db['User'],{'as':_0xa475('0x179'),'foreignKey':_0xa475('0x19d')});db[_0xa475('0x19e')][_0xa475('0x14c')](db['CmContact'],{'as':_0xa475('0x15d'),'foreignKey':_0xa475('0x15e'),'onDelete':_0xa475('0x114')});db[_0xa475('0x19e')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':'List','foreignKey':_0xa475('0x16a'),'onDelete':_0xa475('0x114')});db['CmHopperBlack'][_0xa475('0x14c')](db[_0xa475('0x1c')],{'as':_0xa475('0x18f'),'foreignKey':_0xa475('0x147'),'onDelete':_0xa475('0x114')});db[_0xa475('0x19e')][_0xa475('0x14c')](db['Campaign'],{'as':_0xa475('0x19b'),'foreignKey':_0xa475('0x19c'),'onDelete':_0xa475('0x114')});db[_0xa475('0x80')][_0xa475('0x118')](db['Condition'],{'as':{'plural':_0xa475('0x19f'),'singular':'OneAll'},'foreignKey':_0xa475('0x1a0'),'onDelete':_0xa475('0x114'),'hooks':!![]});db['Automation'][_0xa475('0x118')](db[_0xa475('0x84')],{'as':{'plural':_0xa475('0x1a1'),'singular':_0xa475('0x1a2')},'foreignKey':_0xa475('0x1a3'),'onDelete':_0xa475('0x114'),'hooks':!![]});db[_0xa475('0x80')]['hasMany'](db['Action'],{'as':_0xa475('0x1a4'),'foreignKey':_0xa475('0x1a5'),'onDelete':'cascade','hooks':!![]});db[_0xa475('0x164')][_0xa475('0x118')](db[_0xa475('0x164')],{'as':_0xa475('0x165'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0xa475('0x85')][_0xa475('0x118')](db[_0xa475('0x85')],{'as':_0xa475('0x1a6'),'foreignKey':_0xa475('0x174'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xa475('0x85')][_0xa475('0x118')](db[_0xa475('0x19')],{'as':_0xa475('0x1a7'),'foreignKey':_0xa475('0x174'),'onDelete':_0xa475('0x160')});db[_0xa475('0x85')][_0xa475('0x118')](db[_0xa475('0x46')],{'as':_0xa475('0x1a8'),'foreignKey':'IntervalId'});db[_0xa475('0x85')][_0xa475('0x118')](db[_0xa475('0x18e')],{'as':_0xa475('0x1a9'),'foreignKey':'IntervalId'});db[_0xa475('0x85')][_0xa475('0x118')](db[_0xa475('0x4d')],{'as':_0xa475('0x1aa'),'foreignKey':_0xa475('0x174')});db[_0xa475('0x85')][_0xa475('0x118')](db[_0xa475('0x57')],{'as':_0xa475('0x1ab'),'foreignKey':_0xa475('0x174')});db[_0xa475('0x8b')][_0xa475('0x14c')](db['MailAccount'],{});db[_0xa475('0x8b')]['belongsTo'](db[_0xa475('0x9b')],{'foreignKey':_0xa475('0x1ac')});db['Schedule'][_0xa475('0x14c')](db[_0xa475('0x9a')],{'foreignKey':_0xa475('0x1ad')});db[_0xa475('0x8d')][_0xa475('0x127')](db[_0xa475('0x1a')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xa475('0x160')});db['Tag']['belongsToMany'](db['CmContact'],{'through':_0xa475('0x199')});db[_0xa475('0x8e')][_0xa475('0x127')](db[_0xa475('0x6c')],{'through':_0xa475('0x192')});db[_0xa475('0x8e')][_0xa475('0x127')](db['MailInteraction'],{'through':_0xa475('0x16d')});db[_0xa475('0x8e')][_0xa475('0x127')](db[_0xa475('0x59')],{'through':_0xa475('0x181')});db[_0xa475('0x8e')][_0xa475('0x127')](db[_0xa475('0x4f')],{'through':_0xa475('0x17a')});db[_0xa475('0x8e')][_0xa475('0x127')](db[_0xa475('0x62')],{'through':_0xa475('0x187')});db[_0xa475('0x8e')][_0xa475('0x127')](db[_0xa475('0x122')],{'through':_0xa475('0x1ae')});db[_0xa475('0x92')][_0xa475('0x118')](db[_0xa475('0x84')],{'as':{'plural':'AllConditions','singular':_0xa475('0x1af')},'foreignKey':_0xa475('0x1b0'),'onDelete':_0xa475('0x114'),'hooks':!![]});db[_0xa475('0x92')][_0xa475('0x118')](db[_0xa475('0x84')],{'as':{'plural':_0xa475('0x1b1'),'singular':_0xa475('0x1b2')},'foreignKey':_0xa475('0x1b3'),'onDelete':_0xa475('0x114'),'hooks':!![]});db[_0xa475('0x92')][_0xa475('0x118')](db['Action'],{'as':_0xa475('0x1a4'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0xa475('0x9a')]['hasMany'](db[_0xa475('0xa0')],{'as':_0xa475('0x1b4'),'onDelete':_0xa475('0x114'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xa475('0x118')](db[_0xa475('0xa0')],{'as':_0xa475('0x1b4'),'onDelete':'cascade','foreignKey':_0xa475('0x1ac')});db[_0xa475('0x9e')][_0xa475('0x118')](db[_0xa475('0xa0')],{'as':'Fields','onDelete':_0xa475('0x114'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0xa475('0x14c')](db[_0xa475('0x9e')],{'foreignKey':'MetricId'});db[_0xa475('0xa3')][_0xa475('0x118')](db['SalesforceConfiguration'],{'as':_0xa475('0x1b5'),'onDelete':'cascade','foreignKey':_0xa475('0x1b6')});db[_0xa475('0xa5')][_0xa475('0x118')](db[_0xa475('0x1b7')],{'as':_0xa475('0x1b8'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b9')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1ba')});db['SalesforceConfiguration']['hasMany'](db[_0xa475('0x1b7')],{'as':_0xa475('0x1b4'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1bb')});db['SalesforceConfiguration'][_0xa475('0x14c')](db[_0xa475('0xa3')],{'as':'Account','foreignKey':_0xa475('0x1b6')});db[_0xa475('0x1b7')][_0xa475('0x118')](db['SalesforceField'],{'as':_0xa475('0x1bc'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0x1b7')]['hasMany'](db[_0xa475('0x1b7')],{'as':'Description','foreignKey':_0xa475('0x1ba')});db['SalesforceField'][_0xa475('0x118')](db[_0xa475('0x1b7')],{'as':_0xa475('0x1bd'),'foreignKey':'FieldId'});db[_0xa475('0x1b7')][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':'Variable','foreignKey':_0xa475('0x1be')});db['SugarcrmAccount'][_0xa475('0x118')](db[_0xa475('0xaa')],{'as':_0xa475('0x1b5'),'onDelete':_0xa475('0x114'),'foreignKey':'AccountId'});db[_0xa475('0xaa')]['hasMany'](db[_0xa475('0xac')],{'as':_0xa475('0x1b8'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0xaa')][_0xa475('0x118')](db['SugarcrmField'],{'as':_0xa475('0x1bf'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xa475('0xaa')]['hasMany'](db[_0xa475('0xac')],{'as':_0xa475('0x1b4'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1bb')});db[_0xa475('0xaa')][_0xa475('0x14c')](db[_0xa475('0xa8')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1b6')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa475('0xac')][_0xa475('0x118')](db[_0xa475('0xac')],{'as':_0xa475('0x1c0'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0xac')][_0xa475('0x118')](db[_0xa475('0xac')],{'as':_0xa475('0x1bd'),'foreignKey':_0xa475('0x1bb')});db[_0xa475('0xac')][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':_0xa475('0x94'),'foreignKey':_0xa475('0x1be')});db[_0xa475('0x1c1')][_0xa475('0x118')](db[_0xa475('0x1c2')],{'as':_0xa475('0x1b5'),'onDelete':_0xa475('0x114'),'foreignKey':'AccountId'});db[_0xa475('0x1c2')][_0xa475('0x118')](db[_0xa475('0xaf')],{'as':_0xa475('0x1b8'),'onDelete':_0xa475('0x114'),'foreignKey':'SubjectId'});db[_0xa475('0x1c2')][_0xa475('0x118')](db['DeskField'],{'as':_0xa475('0x1bf'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0x1c2')][_0xa475('0x118')](db[_0xa475('0xaf')],{'as':'Fields','onDelete':_0xa475('0x114'),'foreignKey':'FieldId'});db['DeskConfiguration'][_0xa475('0x14c')](db[_0xa475('0x1c1')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1b6')});db['DeskConfiguration']['belongsToMany'](db[_0xa475('0x8e')],{'through':_0xa475('0x1c3')});db[_0xa475('0xaf')][_0xa475('0x118')](db[_0xa475('0xaf')],{'as':_0xa475('0x1bc'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0xaf')][_0xa475('0x118')](db[_0xa475('0xaf')],{'as':_0xa475('0x1c0'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0xaf')][_0xa475('0x118')](db[_0xa475('0xaf')],{'as':'Field','foreignKey':_0xa475('0x1bb')});db[_0xa475('0xaf')][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':_0xa475('0x94'),'foreignKey':_0xa475('0x1be')});db[_0xa475('0xb1')][_0xa475('0x118')](db['ZohoConfiguration'],{'as':_0xa475('0x1b5'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0xa475('0x118')](db[_0xa475('0x1c4')],{'as':'Subjects','onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0xb3')][_0xa475('0x118')](db[_0xa475('0x1c4')],{'as':_0xa475('0x1bf'),'onDelete':'cascade','foreignKey':_0xa475('0x1ba')});db[_0xa475('0xb3')][_0xa475('0x118')](db[_0xa475('0x1c4')],{'as':_0xa475('0x1b4'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xa475('0xb3')][_0xa475('0x14c')](db['ZohoAccount'],{'as':_0xa475('0x172'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db[_0xa475('0x1c4')],{'as':_0xa475('0x1bc'),'foreignKey':_0xa475('0x1b9')});db['ZohoField'][_0xa475('0x118')](db[_0xa475('0x1c4')],{'as':_0xa475('0x1c0'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0x1c4')][_0xa475('0x118')](db['ZohoField'],{'as':_0xa475('0x1bd'),'foreignKey':'FieldId'});db['ZohoField'][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':'Variable','foreignKey':_0xa475('0x1be')});db[_0xa475('0xb5')]['hasMany'](db[_0xa475('0x1c5')],{'as':_0xa475('0x1b5'),'onDelete':'cascade','foreignKey':_0xa475('0x1b6')});db['ZendeskConfiguration'][_0xa475('0x118')](db[_0xa475('0x1c6')],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xa475('0x118')](db[_0xa475('0x1c6')],{'as':_0xa475('0x1bf'),'foreignKey':_0xa475('0x1ba')});db['ZendeskConfiguration']['hasMany'](db[_0xa475('0x1c6')],{'as':'Fields','foreignKey':_0xa475('0x1bb')});db[_0xa475('0x1c5')][_0xa475('0x14c')](db[_0xa475('0xb5')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1b6')});db[_0xa475('0x1c5')]['belongsToMany'](db[_0xa475('0x8e')],{'through':_0xa475('0x1c7')});db[_0xa475('0x1c6')][_0xa475('0x118')](db[_0xa475('0x1c6')],{'as':_0xa475('0x1bc'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0x1c6')][_0xa475('0x118')](db['ZendeskField'],{'as':'Description','foreignKey':_0xa475('0x1ba')});db[_0xa475('0x1c6')]['hasMany'](db[_0xa475('0x1c6')],{'as':_0xa475('0x1bd'),'foreignKey':_0xa475('0x1bb')});db['ZendeskField'][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':_0xa475('0x94'),'foreignKey':_0xa475('0x1be')});db[_0xa475('0x1c8')]['hasMany'](db[_0xa475('0xb9')],{'as':_0xa475('0x1b5'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b6')});db[_0xa475('0xb9')][_0xa475('0x118')](db[_0xa475('0x1c9')],{'as':'Subjects','onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0xb9')][_0xa475('0x118')](db['FreshdeskField'],{'as':_0xa475('0x1bf'),'onDelete':_0xa475('0x114'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xa475('0x118')](db['FreshdeskField'],{'as':'Fields','onDelete':_0xa475('0x114'),'foreignKey':'FieldId'});db[_0xa475('0xb9')]['belongsTo'](db['FreshdeskAccount'],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1b6')});db[_0xa475('0xb9')][_0xa475('0x127')](db['Tag'],{'through':_0xa475('0x1ca')});db[_0xa475('0x1c9')]['hasMany'](db[_0xa475('0x1c9')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xa475('0x118')](db[_0xa475('0x1c9')],{'as':_0xa475('0x1c0'),'foreignKey':'DescriptionId'});db[_0xa475('0x1c9')][_0xa475('0x118')](db[_0xa475('0x1c9')],{'as':_0xa475('0x1bd'),'foreignKey':_0xa475('0x1bb')});db['FreshdeskField'][_0xa475('0x14c')](db['Variable'],{'as':_0xa475('0x94'),'foreignKey':'VariableId'});db['VtigerAccount'][_0xa475('0x118')](db[_0xa475('0x1cb')],{'as':'Configurations','onDelete':_0xa475('0x114'),'foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db[_0xa475('0xbf')],{'as':_0xa475('0x1b8'),'foreignKey':_0xa475('0x1b9')});db['VtigerConfiguration'][_0xa475('0x118')](db[_0xa475('0xbf')],{'as':_0xa475('0x1bf'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0x1cb')][_0xa475('0x118')](db[_0xa475('0xbf')],{'as':_0xa475('0x1b4'),'foreignKey':_0xa475('0x1bb')});db[_0xa475('0x1cb')][_0xa475('0x14c')](db['VtigerAccount'],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1b6')});db[_0xa475('0xbf')][_0xa475('0x118')](db[_0xa475('0xbf')],{'as':_0xa475('0x1bc'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0xbf')][_0xa475('0x118')](db[_0xa475('0xbf')],{'as':_0xa475('0x1c0'),'foreignKey':_0xa475('0x1ba')});db['VtigerField'][_0xa475('0x118')](db['VtigerField'],{'as':'Field','foreignKey':_0xa475('0x1bb')});db[_0xa475('0xbf')][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':_0xa475('0x94'),'foreignKey':'VariableId'});db[_0xa475('0xc0')][_0xa475('0x118')](db[_0xa475('0xc2')],{'as':_0xa475('0x1b5'),'onDelete':_0xa475('0x114'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xa475('0x118')](db[_0xa475('0xc4')],{'as':'Subjects','foreignKey':_0xa475('0x1b9')});db[_0xa475('0xc2')][_0xa475('0x118')](db[_0xa475('0xc4')],{'as':_0xa475('0x1bf'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0xc2')][_0xa475('0x118')](db[_0xa475('0xc4')],{'as':'Fields','foreignKey':'FieldId'});db[_0xa475('0xc2')][_0xa475('0x14c')](db[_0xa475('0xc0')],{'as':'Account','foreignKey':_0xa475('0x1b6')});db['ServicenowField'][_0xa475('0x118')](db[_0xa475('0xc4')],{'as':_0xa475('0x1bc'),'foreignKey':'SubjectId'});db[_0xa475('0xc4')][_0xa475('0x118')](db[_0xa475('0xc4')],{'as':_0xa475('0x1c0'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0xc4')]['hasMany'](db[_0xa475('0xc4')],{'as':_0xa475('0x1bd'),'foreignKey':'FieldId'});db[_0xa475('0xc4')][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':_0xa475('0x94'),'foreignKey':_0xa475('0x1be')});db[_0xa475('0xc6')]['hasMany'](db['Dynamics365Configuration'],{'as':_0xa475('0x1b5'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa475('0xc6')][_0xa475('0x14c')](db[_0xa475('0x10b')],{'as':'CloudProvider','foreignKey':_0xa475('0x15f')});db['Dynamics365Configuration']['hasMany'](db[_0xa475('0xca')],{'as':_0xa475('0x1b8'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b9')});db['Dynamics365Configuration']['hasMany'](db[_0xa475('0xca')],{'as':_0xa475('0x1bf'),'onDelete':'cascade','foreignKey':_0xa475('0x1ba')});db[_0xa475('0xc8')][_0xa475('0x118')](db[_0xa475('0xca')],{'as':_0xa475('0x1b4'),'onDelete':_0xa475('0x114'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xa475('0x14c')](db[_0xa475('0xc6')],{'as':'Account','foreignKey':_0xa475('0x1b6')});db[_0xa475('0xca')]['hasMany'](db['Dynamics365Field'],{'as':_0xa475('0x1bc'),'foreignKey':_0xa475('0x1b9')});db[_0xa475('0xca')][_0xa475('0x118')](db['Dynamics365Field'],{'as':_0xa475('0x1c0'),'foreignKey':'DescriptionId'});db[_0xa475('0xca')][_0xa475('0x118')](db['Dynamics365Field'],{'as':_0xa475('0x1bd'),'foreignKey':_0xa475('0x1bb')});db[_0xa475('0xca')]['belongsTo'](db['Variable'],{'as':_0xa475('0x94'),'foreignKey':'VariableId'});db[_0xa475('0x1cc')][_0xa475('0x118')](db[_0xa475('0xcd')],{'as':_0xa475('0x1b5'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1b6')});db[_0xa475('0xcd')]['hasMany'](db[_0xa475('0x1cd')],{'as':_0xa475('0x1b8'),'foreignKey':'SubjectId'});db[_0xa475('0xcd')][_0xa475('0x118')](db[_0xa475('0x1cd')],{'as':_0xa475('0x1bf'),'foreignKey':_0xa475('0x1ba')});db['FreshsalesConfiguration'][_0xa475('0x118')](db[_0xa475('0x1cd')],{'as':_0xa475('0x1b4'),'foreignKey':_0xa475('0x1bb')});db[_0xa475('0xcd')]['belongsTo'](db[_0xa475('0x1cc')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1b6')});db[_0xa475('0x1cd')]['hasMany'](db[_0xa475('0x1cd')],{'as':'Subject','foreignKey':_0xa475('0x1b9')});db[_0xa475('0x1cd')]['hasMany'](db[_0xa475('0x1cd')],{'as':_0xa475('0x1c0'),'foreignKey':_0xa475('0x1ba')});db[_0xa475('0x1cd')]['hasMany'](db[_0xa475('0x1cd')],{'as':'Field','foreignKey':'FieldId'});db['FreshsalesField'][_0xa475('0x14c')](db[_0xa475('0x94')],{'as':_0xa475('0x94'),'foreignKey':_0xa475('0x1be')});db[_0xa475('0xd1')][_0xa475('0x14c')](db[_0xa475('0x68')],{});db[_0xa475('0xd1')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':'List','foreignKey':_0xa475('0x16a')});db['ChatQueueReport'][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0xa475('0x14c')](db[_0xa475('0x6c')],{});db[_0xa475('0xd1')][_0xa475('0x14c')](db['ChatMessage'],{});db[_0xa475('0xd1')]['belongsTo'](db[_0xa475('0x116')],{});db[_0xa475('0xd1')][_0xa475('0x14c')](db[_0xa475('0x70')],{});db['ChatInternalMessage']['belongsTo'](db[_0xa475('0x116')],{'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1ce')});db[_0xa475('0x1cf')][_0xa475('0x14c')](db[_0xa475('0x116')],{'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1d0')});db[_0xa475('0xd5')][_0xa475('0x118')](db[_0xa475('0xd3')],{'foreignKey':_0xa475('0x1d1'),'onDelete':_0xa475('0x114')});db['JscriptySessionReport'][_0xa475('0x118')](db[_0xa475('0xd2')],{'foreignKey':_0xa475('0x1d1'),'onDelete':_0xa475('0x114')});db[_0xa475('0x1d2')][_0xa475('0x14c')](db[_0xa475('0x17e')],{});db[_0xa475('0x1d2')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0x1d2')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa475('0x1d2')][_0xa475('0x14c')](db[_0xa475('0x59')],{});db['SmsQueueReport'][_0xa475('0x14c')](db[_0xa475('0x5b')],{});db[_0xa475('0x1d2')][_0xa475('0x14c')](db[_0xa475('0x116')],{});db[_0xa475('0x1d2')][_0xa475('0x14c')](db[_0xa475('0x5d')],{});db[_0xa475('0xda')][_0xa475('0x118')](db[_0xa475('0xd5')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xa475('0x118')](db[_0xa475('0xd3')],{'foreignKey':_0xa475('0x1d3')});db[_0xa475('0xda')][_0xa475('0x118')](db['JscriptyAnswerReport'],{'foreignKey':_0xa475('0x1d3')});db['SquareProject']['belongsToMany'](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'through':_0xa475('0x140')});db[_0xa475('0xe4')]['belongsToMany'](db[_0xa475('0x116')],{'as':_0xa475('0x153'),'through':'user_has_teams'});db[_0xa475('0xe4')][_0xa475('0x127')](db[_0xa475('0x1c')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0xa475('0xe4')][_0xa475('0x127')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xa475('0x1d4')});db[_0xa475('0xe4')]['belongsToMany'](db[_0xa475('0x70')],{'through':_0xa475('0x194'),'as':_0xa475('0x133')});db['Team'][_0xa475('0x127')](db[_0xa475('0x134')],{'through':'team_has_fax_queues','as':_0xa475('0x135')});db[_0xa475('0xe4')][_0xa475('0x127')](db[_0xa475('0x5d')],{'through':_0xa475('0x183'),'as':_0xa475('0x136')});db['Team'][_0xa475('0x127')](db[_0xa475('0x66')],{'through':_0xa475('0x18b'),'as':'OpenchannelQueues'});db[_0xa475('0xe4')]['belongsToMany'](db[_0xa475('0x109')],{'through':_0xa475('0x1d5'),'as':_0xa475('0x1d6')});db[_0xa475('0xe4')][_0xa475('0x127')](db['VoicePrefix'],{'through':_0xa475('0x10f'),'as':_0xa475('0x132')});db[_0xa475('0x19b')][_0xa475('0x118')](db['CmHopper'],{'as':_0xa475('0x148'),'foreignKey':_0xa475('0x19c')});db[_0xa475('0x19b')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xa475('0x19c')});db[_0xa475('0x19b')]['hasMany'](db['CmHopperHistory'],{'as':_0xa475('0x149'),'foreignKey':_0xa475('0x19c')});db[_0xa475('0x19b')][_0xa475('0x118')](db[_0xa475('0x19e')],{'as':'HopperBlacks','foreignKey':_0xa475('0x19c')});db[_0xa475('0x19b')][_0xa475('0x14c')](db[_0xa475('0x2a')],{'as':_0xa475('0x2a'),'foreignKey':'TrunkId'});db[_0xa475('0x19b')][_0xa475('0x14c')](db['Trunk'],{'as':_0xa475('0x14e'),'foreignKey':_0xa475('0x14f')});db[_0xa475('0x19b')][_0xa475('0x14c')](db['Interval'],{'as':_0xa475('0x85'),'foreignKey':_0xa475('0x174')});db[_0xa475('0x19b')][_0xa475('0x14c')](db[_0xa475('0xde')],{'as':_0xa475('0xde'),'foreignKey':'SquareProjectId'});db[_0xa475('0x19b')]['belongsToMany'](db[_0xa475('0xf4')],{'as':_0xa475('0x12a'),'through':_0xa475('0x1d7')});db[_0xa475('0x19b')][_0xa475('0x127')](db[_0xa475('0xf4')],{'as':_0xa475('0x1d8'),'through':'campaigns_has_cm_blacklists'});db[_0xa475('0xe9')][_0xa475('0x14c')](db[_0xa475('0x6f')],{'as':'ChatOfflineMessage','foreignKey':_0xa475('0x193')});db['MailTransferReport']['belongsTo'](db[_0xa475('0x167')],{});db[_0xa475('0xeb')][_0xa475('0x14c')](db[_0xa475('0x120')],{});db[_0xa475('0xeb')][_0xa475('0x14c')](db[_0xa475('0x3f')],{'foreignKey':_0xa475('0x1d9'),'as':_0xa475('0x1da')});db[_0xa475('0xeb')][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':_0xa475('0x1db'),'as':_0xa475('0x1dc')});db[_0xa475('0xeb')][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':_0xa475('0x1dd'),'as':_0xa475('0x1de')});db[_0xa475('0xeb')][_0xa475('0x14c')](db[_0xa475('0x41')],{'foreignKey':'ToMailQueueId','as':_0xa475('0x1df')});db[_0xa475('0xeb')][_0xa475('0x14c')](db[_0xa475('0x3f')],{'foreignKey':_0xa475('0x1e0'),'as':_0xa475('0x1e1')});db[_0xa475('0xec')][_0xa475('0x14c')](db['ChatMessage'],{});db[_0xa475('0xec')][_0xa475('0x14c')](db[_0xa475('0x6c')],{});db['ChatTransferReport'][_0xa475('0x14c')](db[_0xa475('0x68')],{'foreignKey':_0xa475('0x1e2'),'as':_0xa475('0x1da')});db[_0xa475('0xec')][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa475('0xec')]['belongsTo'](db[_0xa475('0x116')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xa475('0xec')]['belongsTo'](db[_0xa475('0x70')],{'foreignKey':'ToChatQueueId','as':_0xa475('0x1df')});db[_0xa475('0xec')][_0xa475('0x14c')](db[_0xa475('0x68')],{'foreignKey':_0xa475('0x1e3'),'as':_0xa475('0x1e1')});db[_0xa475('0xee')]['belongsTo'](db['FaxMessage'],{});db[_0xa475('0xee')]['belongsTo'](db[_0xa475('0x4f')],{});db[_0xa475('0xee')][_0xa475('0x14c')](db[_0xa475('0x4c')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0xa475('0xee')][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':_0xa475('0x1db'),'as':_0xa475('0x1dc')});db[_0xa475('0xee')][_0xa475('0x14c')](db['User'],{'foreignKey':_0xa475('0x1dd'),'as':_0xa475('0x1de')});db[_0xa475('0xee')]['belongsTo'](db[_0xa475('0x134')],{'foreignKey':_0xa475('0x1e4'),'as':_0xa475('0x1df')});db['FaxTransferReport'][_0xa475('0x14c')](db[_0xa475('0x4c')],{'foreignKey':_0xa475('0x1e5'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0xa475('0x14c')](db[_0xa475('0x64')],{});db[_0xa475('0xf0')][_0xa475('0x14c')](db['OpenchannelInteraction'],{});db[_0xa475('0xf0')][_0xa475('0x14c')](db['OpenchannelAccount'],{'foreignKey':_0xa475('0x1e6'),'as':_0xa475('0x1da')});db['OpenchannelTransferReport'][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':_0xa475('0x1db'),'as':'FromAgent'});db[_0xa475('0xf0')][_0xa475('0x14c')](db['User'],{'foreignKey':_0xa475('0x1dd'),'as':_0xa475('0x1de')});db['OpenchannelTransferReport'][_0xa475('0x14c')](db[_0xa475('0x66')],{'foreignKey':_0xa475('0x1e7'),'as':_0xa475('0x1df')});db[_0xa475('0xf0')]['belongsTo'](db[_0xa475('0x5e')],{'foreignKey':_0xa475('0x1e8'),'as':_0xa475('0x1e1')});db[_0xa475('0xf2')]['belongsTo'](db[_0xa475('0x5b')],{});db[_0xa475('0xf2')]['belongsTo'](db[_0xa475('0x59')],{});db[_0xa475('0xf2')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xa475('0x1e9'),'as':_0xa475('0x1da')});db[_0xa475('0xf2')]['belongsTo'](db[_0xa475('0x116')],{'foreignKey':_0xa475('0x1db'),'as':_0xa475('0x1dc')});db['SmsTransferReport'][_0xa475('0x14c')](db['User'],{'foreignKey':_0xa475('0x1dd'),'as':_0xa475('0x1de')});db[_0xa475('0xf2')][_0xa475('0x14c')](db[_0xa475('0x5d')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xa475('0xf2')][_0xa475('0x14c')](db[_0xa475('0x17e')],{'foreignKey':_0xa475('0x1ea'),'as':_0xa475('0x1e1')});db[_0xa475('0xf4')][_0xa475('0x118')](db[_0xa475('0x164')],{'as':_0xa475('0x165'),'foreignKey':_0xa475('0x16a'),'onDelete':_0xa475('0x114')});db[_0xa475('0xf4')]['hasMany'](db[_0xa475('0x7d')],{'as':_0xa475('0x1eb'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0xf4')][_0xa475('0x118')](db[_0xa475('0x74')],{'as':_0xa475('0x1ec'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0xf4')]['hasMany'](db[_0xa475('0x77')],{'as':_0xa475('0x11a'),'foreignKey':'ListId'});db[_0xa475('0xf4')][_0xa475('0x118')](db[_0xa475('0x79')],{'as':_0xa475('0x11b'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0xf4')][_0xa475('0x118')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xa475('0x16a')});db['CmList']['belongsToMany'](db[_0xa475('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db['CmList'][_0xa475('0x127')](db['User'],{'as':_0xa475('0x153'),'through':_0xa475('0x12b')});db[_0xa475('0xf6')][_0xa475('0x118')](db[_0xa475('0x19')],{'as':_0xa475('0x1a7'),'onDelete':'cascade'});db[_0xa475('0xf6')][_0xa475('0x127')](db[_0xa475('0x116')],{'as':'Agents','through':_0xa475('0x111')});db[_0xa475('0xf6')][_0xa475('0x127')](db['Team'],{'through':_0xa475('0x10f'),'as':_0xa475('0x154')});db[_0xa475('0xf8')][_0xa475('0x118')](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'foreignKey':_0xa475('0x126')});db[_0xa475('0xf8')][_0xa475('0x118')](db[_0xa475('0xfa')],{'as':_0xa475('0x1ed'),'foreignKey':_0xa475('0x126'),'onDelete':_0xa475('0x114')});db[_0xa475('0xfa')][_0xa475('0x118')](db[_0xa475('0xfc')],{'as':'Resources','foreignKey':_0xa475('0x1ee'),'onDelete':_0xa475('0x114')});db['WhatsappAccount'][_0xa475('0x118')](db[_0xa475('0x164')],{'as':_0xa475('0x165'),'foreignKey':_0xa475('0x1ef'),'onDelete':_0xa475('0x114')});db['WhatsappAccount'][_0xa475('0x118')](db[_0xa475('0x81')],{'as':_0xa475('0x166'),'foreignKey':_0xa475('0x1ef')});db[_0xa475('0x100')][_0xa475('0x118')](db['WhatsappMessage'],{'as':_0xa475('0x156'),'foreignKey':_0xa475('0x1ef')});db[_0xa475('0x100')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db[_0xa475('0x100')][_0xa475('0x118')](db[_0xa475('0x102')],{'as':_0xa475('0x143')});db[_0xa475('0x100')][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0x100')]['belongsTo'](db[_0xa475('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xa475('0x151')});db[_0xa475('0x100')][_0xa475('0x127')](db['User'],{'as':_0xa475('0x153'),'through':_0xa475('0x1f0')});db[_0xa475('0x102')][_0xa475('0x14c')](db['User'],{'onDelete':'restrict'});db[_0xa475('0x102')][_0xa475('0x14c')](db['WhatsappQueue'],{'onDelete':_0xa475('0x160')});db['WhatsappApplication']['belongsTo'](db['WhatsappAccount'],{'onDelete':_0xa475('0x160')});db[_0xa475('0x102')]['belongsTo'](db[_0xa475('0x85')],{'onDelete':_0xa475('0x160'),'foreignKey':_0xa475('0x174')});db[_0xa475('0x102')][_0xa475('0x14c')](db[_0xa475('0x8e')],{'onDelete':_0xa475('0x160'),'foreignKey':_0xa475('0x175')});db[_0xa475('0x122')][_0xa475('0x118')](db[_0xa475('0x105')],{'as':_0xa475('0x156'),'onDelete':_0xa475('0x114'),'foreignKey':_0xa475('0x1f1')});db[_0xa475('0x122')][_0xa475('0x14c')](db[_0xa475('0x100')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1ef')});db[_0xa475('0x122')][_0xa475('0x14c')](db[_0xa475('0x74')],{'as':_0xa475('0x15d'),'foreignKey':'ContactId'});db[_0xa475('0x122')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x179'),'foreignKey':'UserId'});db[_0xa475('0x122')][_0xa475('0x127')](db[_0xa475('0x8e')],{'through':'whatsapp_interaction_has_tags','as':_0xa475('0x17b')});db[_0xa475('0x122')]['belongsToMany'](db[_0xa475('0x8e')],{'through':_0xa475('0x1ae'),'as':_0xa475('0x16e')});db['WhatsappInteraction'][_0xa475('0x127')](db[_0xa475('0x116')],{'as':_0xa475('0x16f'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0xa475('0x105')][_0xa475('0x14c')](db[_0xa475('0x116')],{'as':_0xa475('0x116')});db[_0xa475('0x105')][_0xa475('0x14c')](db['CmContact'],{'onDelete':_0xa475('0x114'),'as':_0xa475('0x15d')});db['WhatsappMessage'][_0xa475('0x14c')](db['WhatsappInteraction'],{'onDelete':_0xa475('0x114'),'as':'Interaction','foreignKey':_0xa475('0x1f1')});db[_0xa475('0x105')][_0xa475('0x14c')](db[_0xa475('0x100')],{'as':_0xa475('0x172'),'foreignKey':_0xa475('0x1ef')});db[_0xa475('0x1f2')][_0xa475('0x14c')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0xa475('0x14c')](db[_0xa475('0xf4')],{'as':_0xa475('0x169'),'foreignKey':_0xa475('0x16a')});db[_0xa475('0x1f2')]['belongsTo'](db[_0xa475('0x74')],{'as':'Contact','foreignKey':_0xa475('0x15e')});db[_0xa475('0x1f2')][_0xa475('0x14c')](db['WhatsappInteraction'],{});db[_0xa475('0x1f2')]['belongsTo'](db[_0xa475('0x109')],{});db['WhatsappQueueReport'][_0xa475('0x14c')](db['WhatsappMessage'],{});db[_0xa475('0x1f2')][_0xa475('0x14c')](db[_0xa475('0x116')],{});db[_0xa475('0x107')][_0xa475('0x14c')](db[_0xa475('0x105')],{});db[_0xa475('0x107')][_0xa475('0x14c')](db[_0xa475('0x122')],{});db['WhatsappTransferReport'][_0xa475('0x14c')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xa475('0x1da')});db[_0xa475('0x107')][_0xa475('0x14c')](db[_0xa475('0x100')],{'foreignKey':_0xa475('0x1f3'),'as':_0xa475('0x1e1')});db['WhatsappTransferReport'][_0xa475('0x14c')](db['WhatsappQueue'],{'foreignKey':_0xa475('0x1f4'),'as':_0xa475('0x1df')});db[_0xa475('0x107')][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':'FromUserId','as':_0xa475('0x1dc')});db[_0xa475('0x107')][_0xa475('0x14c')](db[_0xa475('0x116')],{'foreignKey':_0xa475('0x1dd'),'as':_0xa475('0x1de')});db[_0xa475('0x109')]['belongsToMany'](db['User'],{'as':_0xa475('0x153'),'through':_0xa475('0x3b'),'foreignKey':'WhatsappQueueId'});db[_0xa475('0x109')]['belongsToMany'](db[_0xa475('0xe4')],{'through':_0xa475('0x1d5'),'as':_0xa475('0x154')});db[_0xa475('0x10b')][_0xa475('0x113')](db[_0xa475('0xc6')],{'as':'Dynamics365Account','onDelete':'restrict'});db[_0xa475('0x10b')][_0xa475('0x113')](db[_0xa475('0x3c')],{'as':_0xa475('0x162'),'onDelete':'restrict'});db[_0xa475('0x10b')][_0xa475('0x113')](db[_0xa475('0x3d')],{'as':_0xa475('0x163'),'onDelete':_0xa475('0x160')});module[_0xa475('0x1f5')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x1baf=['SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','UserId','Recordings','hasMany','UserVoiceQueueRt','VoiceQueuesRt','CmHopperFinal','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoicePrefix','MailQueues','ChatQueue','ChatQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_square_projects','VoiceChanSpy','cascade','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','JscriptySessions','TrunkId','Trunk','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccount','CloudProviderId','Smtp','MailAccountId','List','ListId','Template','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','restrict','TagId','Dashboard','Items','Dispositions','FaxAccountId','Answers','Exntensions','FaxInteractionId','fax_interaction_has_tags','FaxQueueReport','SmsAccountId','Interactions','IntervalId','SmsInteraction','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','ProactiveActions','ChatApplication','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','JscriptySessionReport','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Queue','Campaign','CampaignId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','AccountId','SubjectId','Descriptions','FieldId','Description','DescriptionId','Field','Variable','VariableId','Configurations','Subjects','Subject','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','int_zendesk_configuration_has_tags','VtigerConfiguration','ServicenowField','Dynamics365Account','FreshsalesConfiguration','SessionId','ProjectId','team_has_fax_queues','FaxQueues','HopperBlacks','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','HopperHistory','voice_queues_has_cm_lists','UserProfileSections','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappTransferReport','ToQueueId','UserWhatsappQueue','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','name','database','username','options','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','OpenchannelMessage','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../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','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model'];(function(_0x357b1f,_0x343c9c){var _0xdec551=function(_0x1abadc){while(--_0x1abadc){_0x357b1f['push'](_0x357b1f['shift']());}};_0xdec551(++_0x343c9c);}(_0x1baf,0x14e));var _0xf1ba=function(_0x49c767,_0x2d909b){_0x49c767=_0x49c767-0x0;var _0x47886d=_0x1baf[_0x49c767];return _0x47886d;};'use strict';var config=require(_0xf1ba('0x0'));var Sequelize=require(_0xf1ba('0x1'));var _=require(_0xf1ba('0x2'));var jstz=require('jstz');var timezone=jstz[_0xf1ba('0x3')]();config[_0xf1ba('0x1')]=_[_0xf1ba('0x4')](config[_0xf1ba('0x1')],{'database':_0xf1ba('0x5'),'username':_0xf1ba('0x6'),'password':'xC@LL1234','options':{'host':_0xf1ba('0x7'),'port':0xcea,'dialect':_0xf1ba('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf1ba('0x9'),'collate':_0xf1ba('0xa')}}});config[_0xf1ba('0xb')]=_[_0xf1ba('0x4')](config[_0xf1ba('0xb')],{'database':_0xf1ba('0x5'),'username':_0xf1ba('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xf1ba('0xc')},'logging':![],'timezone':timezone[_0xf1ba('0xd')](),'define':{'charset':'utf8','collate':_0xf1ba('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf1ba('0x1')][_0xf1ba('0xe')],config[_0xf1ba('0x1')][_0xf1ba('0xf')],config[_0xf1ba('0x1')]['password'],config['sequelize'][_0xf1ba('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf1ba('0xb')][_0xf1ba('0xe')],config['sequelizeHistory'][_0xf1ba('0xf')],config[_0xf1ba('0xb')][_0xf1ba('0x11')],config[_0xf1ba('0xb')]['options'])};db[_0xf1ba('0x12')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x14'));db['VoiceChanSpy']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x15'));db['VoiceContext']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x16'));db[_0xf1ba('0x17')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x18'));db[_0xf1ba('0x19')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xf1ba('0x1a')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x1b'));db[_0xf1ba('0x1c')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x1d'));db[_0xf1ba('0x1e')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x1f'));db[_0xf1ba('0x20')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x21'));db[_0xf1ba('0x22')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x23'));db[_0xf1ba('0x24')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x25'));db[_0xf1ba('0x26')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x27'));db[_0xf1ba('0x28')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x29'));db[_0xf1ba('0x2a')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x2b'));db[_0xf1ba('0x2c')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x2d'));db['Trunk']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x2e'));db['VoiceTransferReport']=db[_0xf1ba('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x2f'));db[_0xf1ba('0x30')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x31'));db[_0xf1ba('0x32')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x33'));db[_0xf1ba('0x34')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x35'));db[_0xf1ba('0x36')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x37'));db[_0xf1ba('0x38')]=db['sequelize']['import'](_0xf1ba('0x39'));db['UserOpenchannelQueue']=db[_0xf1ba('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x3a'));db['MailServerIn']=db['sequelize'][_0xf1ba('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0xf1ba('0x3b')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x3c'));db['MailAccount']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x3d'));db[_0xf1ba('0x3e')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/mailQueue/mailQueue.model');db[_0xf1ba('0x3f')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x40'));db[_0xf1ba('0x41')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x42'));db[_0xf1ba('0x43')]=db[_0xf1ba('0x1')]['import']('../api/mailMessage/mailMessage.model');db[_0xf1ba('0x44')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x45'));db[_0xf1ba('0x46')]=db['sequelize']['import'](_0xf1ba('0x47'));db['Dashboard']=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x48'));db['DashboardItem']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x49'));db[_0xf1ba('0x4a')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x4b'));db[_0xf1ba('0x4c')]=db['sequelize']['import'](_0xf1ba('0x4d'));db['FaxInteraction']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x4e'));db[_0xf1ba('0x4f')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x50'));db[_0xf1ba('0x51')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x52'));db['FaxQueueReport']=db[_0xf1ba('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0xf1ba('0x53')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x54'));db[_0xf1ba('0x55')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x56'));db['SmsInteraction']=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/smsInteraction/smsInteraction.model');db[_0xf1ba('0x57')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x58'));db['SmsQueue']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x59'));db[_0xf1ba('0x5a')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x5b'));db[_0xf1ba('0x5c')]=db[_0xf1ba('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xf1ba('0x5d')]=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xf1ba('0x5e')]=db[_0xf1ba('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xf1ba('0x5f')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf1ba('0x60')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0xf1ba('0x61')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x62'));db['ChatApplication']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x63'));db[_0xf1ba('0x64')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xf1ba('0x65')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x66'));db[_0xf1ba('0x67')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x68'));db['ChatQueue']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x69'));db[_0xf1ba('0x6a')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x6b'));db[_0xf1ba('0x6c')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x6d'));db[_0xf1ba('0x6e')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x6f'));db[_0xf1ba('0x70')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x71'));db[_0xf1ba('0x72')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x73'));db[_0xf1ba('0x74')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x75'));db['CmHopperFinal']=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x76'));db[_0xf1ba('0x77')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xf1ba('0x78')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x79'));db[_0xf1ba('0x7a')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0xf1ba('0x7b')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x7c'));db[_0xf1ba('0x7d')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x7e'));db[_0xf1ba('0x7f')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x80'));db[_0xf1ba('0x81')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x82'));db['Condition']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x83'));db['Interval']=db['sequelize'][_0xf1ba('0x13')]('../api/interval/interval.model');db[_0xf1ba('0x84')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x85'));db[_0xf1ba('0x86')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/cdr/cdr.model');db[_0xf1ba('0x87')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf1ba('0x88')]=db['sequelize']['import']('../api/schedule/schedule.model');db[_0xf1ba('0x89')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x8a'));db[_0xf1ba('0x8b')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x8c'));db['Template']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x8d'));db[_0xf1ba('0x8e')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0x8f'));db['Variable']=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/variable/variable.model');db[_0xf1ba('0x90')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x91'));db[_0xf1ba('0x92')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x93'));db[_0xf1ba('0x94')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x95'));db[_0xf1ba('0x96')]=db['sequelize']['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xf1ba('0x97')]=db['sequelize'][_0xf1ba('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xf1ba('0x98')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x99'));db[_0xf1ba('0x9a')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x9b'));db['AnalyticTreeReport']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x9c'));db[_0xf1ba('0x9d')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x9e'));db['SalesforceConfiguration']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0x9f'));db[_0xf1ba('0xa0')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xa1'));db[_0xf1ba('0xa2')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xf1ba('0xa3')]=db[_0xf1ba('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf1ba('0xa4')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xa5'));db['DeskAccount']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xa6'));db['DeskConfiguration']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xa7'));db[_0xf1ba('0xa8')]=db['sequelize']['import'](_0xf1ba('0xa9'));db[_0xf1ba('0xaa')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize'][_0xf1ba('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xf1ba('0xab')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xac'));db[_0xf1ba('0xad')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xae'));db[_0xf1ba('0xaf')]=db['sequelize'][_0xf1ba('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf1ba('0xb0')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xb1'));db[_0xf1ba('0xb2')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xb3'));db[_0xf1ba('0xb4')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xf1ba('0xb5')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xb6'));db[_0xf1ba('0xb7')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xb8'));db[_0xf1ba('0xb9')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xba'));db[_0xf1ba('0xbb')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xbc'));db[_0xf1ba('0xbd')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xbe'));db['ServicenowField']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xbf'));db['Dynamics365Account']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xc0'));db[_0xf1ba('0xc1')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xc2'));db[_0xf1ba('0xc3')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xc4'));db[_0xf1ba('0xc5')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db['sequelize'][_0xf1ba('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xf1ba('0xc6')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xc7'));db[_0xf1ba('0x90')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x91'));db[_0xf1ba('0xc8')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/network/network.model');db[_0xf1ba('0xc9')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xca'));db[_0xf1ba('0xcb')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xcc'));db[_0xf1ba('0xcd')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xce'));db[_0xf1ba('0xcf')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xd0'));db['JscriptySessionReport']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xd1'));db[_0xf1ba('0xd2')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xd3'));db[_0xf1ba('0xd4')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xd5'));db['SquareDetailsReport']=db[_0xf1ba('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xf1ba('0xd6')]=db['sequelize'][_0xf1ba('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0xf1ba('0xd7')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xd8'));db['SquareOdbc']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xd9'));db[_0xf1ba('0xda')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xdb'));db['SquareRecording']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xdc'));db[_0xf1ba('0xdd')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xde'));db[_0xf1ba('0xdf')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xe0'));db[_0xf1ba('0xe1')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xe2'));db['Campaign']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xe3'));db['Migration']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xe4'));db[_0xf1ba('0xe5')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xe6'));db[_0xf1ba('0xe7')]=db['sequelize']['import']('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xe8'));db['ChatTransferReport']=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xe9'));db[_0xf1ba('0xea')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xeb'));db['OpenchannelTransferReport']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xec'));db[_0xf1ba('0xed')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xee'));db[_0xf1ba('0xef')]=db['sequelize'][_0xf1ba('0x13')](_0xf1ba('0xf0'));db['VoicePrefix']=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xf1'));db[_0xf1ba('0xf2')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xf3'));db[_0xf1ba('0xf4')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xf5'));db[_0xf1ba('0xf6')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xf7'));db[_0xf1ba('0xf8')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xf9'));db[_0xf1ba('0xfa')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0xfb'));db[_0xf1ba('0xfc')]=db[_0xf1ba('0x1')]['import'](_0xf1ba('0xfd'));db[_0xf1ba('0xfe')]=db['sequelize']['import'](_0xf1ba('0xff'));db[_0xf1ba('0x100')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x101'));db['WhatsappTransferReport']=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xf1ba('0x102')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x103'));db[_0xf1ba('0x104')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x105'));db[_0xf1ba('0x106')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x107'));db[_0xf1ba('0x108')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xf1ba('0x109')]=db[_0xf1ba('0x1')][_0xf1ba('0x13')](_0xf1ba('0x10a'));db[_0xf1ba('0x12')][_0xf1ba('0x10b')](db[_0xf1ba('0x20')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')]['hasMany'](db['VoiceRecording'],{'as':_0xf1ba('0x10d'),'foreignKey':'UserId'});db['User'][_0xf1ba('0x10e')](db[_0xf1ba('0x10f')],{'as':_0xf1ba('0x110'),'foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')][_0xf1ba('0x10e')](db[_0xf1ba('0x17')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0xf1ba('0x10e')](db[_0xf1ba('0x111')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0xf1ba('0x12')][_0xf1ba('0x10e')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')][_0xf1ba('0x10e')](db[_0xf1ba('0x78')],{'as':_0xf1ba('0x78'),'foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')][_0xf1ba('0x10e')](db[_0xf1ba('0x5d')],{'as':_0xf1ba('0x112'),'foreignKey':_0xf1ba('0x10c')});db['User'][_0xf1ba('0x10e')](db[_0xf1ba('0x64')],{'as':_0xf1ba('0x113'),'foreignKey':_0xf1ba('0x10c')});db['User']['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')]['hasMany'](db[_0xf1ba('0x114')],{'as':_0xf1ba('0x115'),'foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')][_0xf1ba('0x10e')](db[_0xf1ba('0x41')],{'as':'MailInteractions','foreignKey':_0xf1ba('0x10c')});db['User'][_0xf1ba('0x10e')](db[_0xf1ba('0xfc')],{'as':_0xf1ba('0x116'),'foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x12')]['hasMany'](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0xf1ba('0x117')});db['User'][_0xf1ba('0x118')](db[_0xf1ba('0xf2')],{'as':_0xf1ba('0xf2'),'foreignKey':_0xf1ba('0x119')});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0x6a')],{'as':_0xf1ba('0x11b'),'through':_0xf1ba('0x11c')});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x11d'),'through':_0xf1ba('0x11e')});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0xdf')],{'through':_0xf1ba('0x11f')});db[_0xf1ba('0x12')]['belongsToMany'](db['MailInteraction'],{'as':_0xf1ba('0x120'),'through':_0xf1ba('0x121')});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0x64')],{'as':'ChatInteractions','through':_0xf1ba('0x122')});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0x114')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db['User'][_0xf1ba('0x11a')](db['SmsInteraction'],{'as':_0xf1ba('0x123'),'through':_0xf1ba('0x124')});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0x5d')],{'as':_0xf1ba('0x112'),'through':_0xf1ba('0x125')});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0xfc')],{'as':_0xf1ba('0x116'),'through':'user_has_whatsapp_interactions'});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0x1a')],{'as':'VoiceQueues','through':_0xf1ba('0x30'),'required':![]});db['User']['belongsToMany'](db[_0xf1ba('0x126')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db['MailQueue'],{'as':_0xf1ba('0x127'),'through':_0xf1ba('0x34'),'required':![]});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0x128')],{'as':_0xf1ba('0x129'),'through':_0xf1ba('0x32'),'required':![],'hooks':!![]});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0x51')],{'as':'FaxQueues','through':_0xf1ba('0x36'),'required':![]});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0x12a')],{'as':_0xf1ba('0x12b'),'through':_0xf1ba('0x38'),'required':![]});db['User']['belongsToMany'](db[_0xf1ba('0x5f')],{'as':_0xf1ba('0x12c'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0x102')],{'as':_0xf1ba('0x12d'),'through':'UserWhatsappQueue','required':![]});db['User']['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0xf1ba('0x12')]['belongsToMany'](db[_0xf1ba('0x60')],{'as':'ChatWebsites','through':_0xf1ba('0x12e')});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0x4a')],{'as':_0xf1ba('0x12f'),'through':_0xf1ba('0x130')});db['User'][_0xf1ba('0x11a')](db['MailAccount'],{'as':_0xf1ba('0x131'),'through':'user_has_mail_accounts'});db[_0xf1ba('0x12')]['belongsToMany'](db[_0xf1ba('0x5a')],{'as':_0xf1ba('0x132'),'through':_0xf1ba('0x133')});db['User'][_0xf1ba('0x11a')](db[_0xf1ba('0x53')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xf1ba('0x12')][_0xf1ba('0x11a')](db[_0xf1ba('0xf8')],{'as':_0xf1ba('0x134'),'through':'user_has_whatsapp_accounts'});db[_0xf1ba('0x12')]['belongsToMany'](db[_0xf1ba('0xda')],{'as':'SquareProjects','through':_0xf1ba('0x135')});db[_0xf1ba('0x136')][_0xf1ba('0x10e')](db[_0xf1ba('0x17')],{'as':'SpiedAgents','onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x138')});db['VoiceContext']['hasMany'](db[_0xf1ba('0x17')],{'onDelete':'cascade'});db[_0xf1ba('0x17')]['hasMany'](db[_0xf1ba('0x17')],{'as':_0xf1ba('0x139'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x19')]['belongsToMany'](db[_0xf1ba('0x89')],{'as':_0xf1ba('0x13a'),'through':'moh_has_sounds'});db[_0xf1ba('0x1a')][_0xf1ba('0x10e')](db['UserVoiceQueueRt'],{'as':_0xf1ba('0x13b'),'foreignKey':_0xf1ba('0x13c')});db[_0xf1ba('0x1a')][_0xf1ba('0x10e')](db[_0xf1ba('0x72')],{'as':_0xf1ba('0x13d'),'foreignKey':_0xf1ba('0x13c')});db[_0xf1ba('0x1a')][_0xf1ba('0x10e')](db[_0xf1ba('0x111')],{'as':_0xf1ba('0x13e'),'foreignKey':'VoiceQueueId'});db[_0xf1ba('0x1a')][_0xf1ba('0x10e')](db['CmHopperHistory'],{'as':_0xf1ba('0x13f'),'foreignKey':_0xf1ba('0x13c')});db['VoiceQueue'][_0xf1ba('0x10e')](db[_0xf1ba('0x78')],{'as':_0xf1ba('0x78'),'foreignKey':'VoiceQueueId'});db[_0xf1ba('0x1a')]['hasMany'](db[_0xf1ba('0x74')],{'as':'HopperBlacks','foreignKey':_0xf1ba('0x13c')});db[_0xf1ba('0x1a')][_0xf1ba('0x10e')](db['JscriptySessionReport'],{'as':_0xf1ba('0x140'),'foreignKey':'VoiceQueueId'});db[_0xf1ba('0x1a')][_0xf1ba('0x118')](db['Trunk'],{'as':'Trunk','foreignKey':_0xf1ba('0x141')});db[_0xf1ba('0x1a')][_0xf1ba('0x118')](db[_0xf1ba('0x142')],{'as':_0xf1ba('0x143'),'foreignKey':_0xf1ba('0x144')});db[_0xf1ba('0x1a')]['belongsTo'](db[_0xf1ba('0x145')],{'as':_0xf1ba('0x145'),'foreignKey':'IntervalId'});db[_0xf1ba('0x1a')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf1ba('0x146')});db['VoiceQueue'][_0xf1ba('0x11a')](db[_0xf1ba('0xef')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xf1ba('0x1a')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':_0xf1ba('0x30')});db[_0xf1ba('0x1a')][_0xf1ba('0x11a')](db[_0xf1ba('0xdf')],{'as':_0xf1ba('0x148'),'through':'TeamVoiceQueue'});db[_0xf1ba('0x1a')][_0xf1ba('0x11a')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x149'),'through':_0xf1ba('0x14a')});db[_0xf1ba('0x1c')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x12'),'foreignKey':'UserId'});db[_0xf1ba('0x1e')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x12'),'foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x20')][_0xf1ba('0x10e')](db[_0xf1ba('0x22')],{'as':_0xf1ba('0x14b'),'onDelete':_0xf1ba('0x137'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0xf1ba('0x118')](db[_0xf1ba('0x20')],{'foreignKey':_0xf1ba('0x14c'),'targetKey':_0xf1ba('0x14d')});db[_0xf1ba('0x24')][_0xf1ba('0x10e')](db['VoiceQueueReport'],{'as':_0xf1ba('0x14e'),'foreignKey':_0xf1ba('0x14f'),'constraints':![]});db[_0xf1ba('0x24')][_0xf1ba('0x10e')](db[_0xf1ba('0x28')],{'as':_0xf1ba('0x150'),'foreignKey':_0xf1ba('0x14f'),'constraints':![]});db['VoiceCallReport'][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':'User','foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x24')]['belongsTo'](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x153')][_0xf1ba('0x118')](db[_0xf1ba('0x154')],{'as':_0xf1ba('0x154'),'foreignKey':'MailAccountId'});db[_0xf1ba('0x153')]['belongsTo'](db[_0xf1ba('0x104')],{'as':_0xf1ba('0x104'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db['MailServerOut']['belongsTo'](db[_0xf1ba('0x154')],{'as':_0xf1ba('0x154'),'foreignKey':'MailAccountId'});db[_0xf1ba('0x3b')][_0xf1ba('0x118')](db[_0xf1ba('0x104')],{'as':_0xf1ba('0x104'),'foreignKey':_0xf1ba('0x155'),'onDelete':'restrict'});db[_0xf1ba('0x154')][_0xf1ba('0x10b')](db[_0xf1ba('0x153')],{'as':'Imap','onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x154')]['hasOne'](db['MailServerOut'],{'as':_0xf1ba('0x156'),'onDelete':_0xf1ba('0x137')});db['MailAccount'][_0xf1ba('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xf1ba('0x157'),'onDelete':'cascade'});db[_0xf1ba('0x154')][_0xf1ba('0x10e')](db[_0xf1ba('0x7f')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xf1ba('0x154')][_0xf1ba('0x10e')](db['MailMessage'],{'as':_0xf1ba('0x14b'),'foreignKey':_0xf1ba('0x157')});db[_0xf1ba('0x154')][_0xf1ba('0x10e')](db['MailInteraction'],{'as':'Interactions'});db[_0xf1ba('0x154')]['hasMany'](db[_0xf1ba('0x44')],{'as':'Applications'});db['MailAccount']['belongsTo'](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0x154')][_0xf1ba('0x118')](db[_0xf1ba('0x15a')],{'as':_0xf1ba('0x15a'),'foreignKey':_0xf1ba('0x15b')});db['MailAccount'][_0xf1ba('0x118')](db[_0xf1ba('0x84')],{'as':_0xf1ba('0x15c'),'foreignKey':_0xf1ba('0x146')});db[_0xf1ba('0x154')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':_0xf1ba('0x15d')});db[_0xf1ba('0x3e')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Agents','through':_0xf1ba('0x34')});db[_0xf1ba('0x3e')][_0xf1ba('0x11a')](db['Team'],{'through':_0xf1ba('0x15e'),'as':'Teams'});db[_0xf1ba('0x41')]['hasMany'](db[_0xf1ba('0x43')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf1ba('0x15f')});db[_0xf1ba('0x41')][_0xf1ba('0x118')](db['MailAccount'],{'as':'Account','foreignKey':_0xf1ba('0x157')});db[_0xf1ba('0x41')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x41')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x160'),'foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x41')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xf1ba('0x161')});db[_0xf1ba('0x41')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x162'),'as':_0xf1ba('0x163')});db[_0xf1ba('0x41')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x164'),'through':_0xf1ba('0x121'),'foreignKey':_0xf1ba('0x15f')});db[_0xf1ba('0x43')][_0xf1ba('0x10e')](db[_0xf1ba('0xe5')],{'as':_0xf1ba('0x165'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x43')]['belongsTo'](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x12')});db[_0xf1ba('0x43')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x151')});db[_0xf1ba('0x43')][_0xf1ba('0x118')](db[_0xf1ba('0x41')],{'as':_0xf1ba('0x166'),'foreignKey':_0xf1ba('0x15f')});db[_0xf1ba('0x43')][_0xf1ba('0x118')](db['MailAccount'],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x157')});db[_0xf1ba('0x43')]['belongsTo'](db[_0xf1ba('0x60')],{'as':_0xf1ba('0x60'),'foreignKey':_0xf1ba('0x168')});db[_0xf1ba('0x43')][_0xf1ba('0x118')](db[_0xf1ba('0x67')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xf1ba('0x44')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x44')][_0xf1ba('0x118')](db[_0xf1ba('0x3e')],{'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x44')][_0xf1ba('0x118')](db['MailAccount'],{'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x44')][_0xf1ba('0x118')](db['Interval'],{'onDelete':_0xf1ba('0x169'),'foreignKey':'IntervalId'});db[_0xf1ba('0x44')][_0xf1ba('0x118')](db[_0xf1ba('0x8b')],{'onDelete':'restrict','foreignKey':_0xf1ba('0x16a')});db[_0xf1ba('0x46')][_0xf1ba('0x118')](db[_0xf1ba('0x154')],{});db[_0xf1ba('0x46')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':'List','foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0x46')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x46')][_0xf1ba('0x118')](db[_0xf1ba('0x41')],{});db[_0xf1ba('0x46')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0xf1ba('0x118')](db['User'],{});db[_0xf1ba('0x46')][_0xf1ba('0x118')](db[_0xf1ba('0x3e')],{});db[_0xf1ba('0x16b')][_0xf1ba('0x10e')](db['DashboardItem'],{'as':_0xf1ba('0x16c'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x4a')][_0xf1ba('0x10e')](db[_0xf1ba('0x81')],{'as':_0xf1ba('0x16d'),'foreignKey':_0xf1ba('0x16e'),'onDelete':_0xf1ba('0x137')});db['FaxAccount'][_0xf1ba('0x10e')](db[_0xf1ba('0x7f')],{'as':_0xf1ba('0x16f'),'foreignKey':_0xf1ba('0x16e')});db[_0xf1ba('0x4a')][_0xf1ba('0x10e')](db[_0xf1ba('0x114')],{'as':'Interactions'});db[_0xf1ba('0x4a')][_0xf1ba('0x10e')](db[_0xf1ba('0x4c')],{'as':_0xf1ba('0x139')});db[_0xf1ba('0x4a')][_0xf1ba('0x10e')](db['VoiceExtension'],{'as':_0xf1ba('0x170'),'onDelete':_0xf1ba('0x137')});db['FaxAccount'][_0xf1ba('0x10e')](db[_0xf1ba('0x4f')],{'as':'Messages'});db['FaxAccount'][_0xf1ba('0x118')](db[_0xf1ba('0x142')],{'as':_0xf1ba('0x142')});db[_0xf1ba('0x4a')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db['FaxAccount']['belongsTo'](db[_0xf1ba('0x84')],{'as':_0xf1ba('0x15c'),'foreignKey':_0xf1ba('0x146')});db[_0xf1ba('0x4a')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Agents','through':_0xf1ba('0x130')});db[_0xf1ba('0x4c')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x4c')][_0xf1ba('0x118')](db[_0xf1ba('0x51')],{'onDelete':'restrict'});db[_0xf1ba('0x4c')][_0xf1ba('0x118')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xf1ba('0x4c')][_0xf1ba('0x118')](db[_0xf1ba('0x8b')],{'onDelete':'restrict','foreignKey':_0xf1ba('0x16a')});db[_0xf1ba('0x114')][_0xf1ba('0x10e')](db[_0xf1ba('0x4f')],{'as':_0xf1ba('0x14b'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x171')});db[_0xf1ba('0x114')]['belongsTo'](db[_0xf1ba('0x4a')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x16e')});db[_0xf1ba('0x114')]['belongsTo'](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':'ContactId'});db[_0xf1ba('0x114')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0xf1ba('0x114')][_0xf1ba('0x11a')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xf1ba('0x161')});db[_0xf1ba('0x114')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x172'),'as':'ThroughTags'});db[_0xf1ba('0x114')][_0xf1ba('0x11a')](db['User'],{'as':_0xf1ba('0x164'),'through':'user_has_fax_interactions','foreignKey':_0xf1ba('0x171')});db[_0xf1ba('0x4f')]['belongsTo'](db['User'],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x12')});db[_0xf1ba('0x4f')][_0xf1ba('0x118')](db[_0xf1ba('0x114')],{'as':_0xf1ba('0x166'),'foreignKey':_0xf1ba('0x171')});db[_0xf1ba('0x4f')][_0xf1ba('0x118')](db['CmContact'],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x151')});db['FaxMessage'][_0xf1ba('0x118')](db[_0xf1ba('0xe5')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xf1ba('0x4f')][_0xf1ba('0x118')](db[_0xf1ba('0x4a')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x16e')});db['FaxQueue']['belongsToMany'](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':_0xf1ba('0x36')});db['FaxQueue'][_0xf1ba('0x11a')](db[_0xf1ba('0xdf')],{'through':'team_has_fax_queues','as':_0xf1ba('0x148')});db[_0xf1ba('0x173')][_0xf1ba('0x118')](db['FaxAccount'],{});db['FaxQueueReport'][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0x173')]['belongsTo'](db['CmContact'],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x173')][_0xf1ba('0x118')](db[_0xf1ba('0x114')],{});db[_0xf1ba('0x173')][_0xf1ba('0x118')](db[_0xf1ba('0x4f')],{});db['FaxQueueReport'][_0xf1ba('0x118')](db['User'],{});db['FaxQueueReport'][_0xf1ba('0x118')](db['FaxQueue'],{});db[_0xf1ba('0x53')][_0xf1ba('0x10e')](db[_0xf1ba('0x81')],{'as':_0xf1ba('0x16d'),'foreignKey':_0xf1ba('0x174'),'onDelete':_0xf1ba('0x137')});db['SmsAccount']['hasMany'](db[_0xf1ba('0x7f')],{'as':_0xf1ba('0x16f'),'foreignKey':_0xf1ba('0x174')});db[_0xf1ba('0x53')][_0xf1ba('0x10e')](db[_0xf1ba('0x57')],{'as':_0xf1ba('0x14b'),'foreignKey':_0xf1ba('0x174')});db[_0xf1ba('0x53')][_0xf1ba('0x10e')](db['SmsInteraction'],{'as':_0xf1ba('0x175')});db[_0xf1ba('0x53')][_0xf1ba('0x10e')](db[_0xf1ba('0x55')],{'as':_0xf1ba('0x139')});db[_0xf1ba('0x53')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0x53')][_0xf1ba('0x118')](db['Pause'],{'as':_0xf1ba('0x15c'),'foreignKey':_0xf1ba('0x146')});db['SmsAccount'][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':'user_has_sms_accounts'});db[_0xf1ba('0x55')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x55')][_0xf1ba('0x118')](db['SmsQueue'],{'onDelete':_0xf1ba('0x169')});db['SmsApplication'][_0xf1ba('0x118')](db[_0xf1ba('0x53')],{'onDelete':'restrict'});db['SmsApplication'][_0xf1ba('0x118')](db[_0xf1ba('0x145')],{'onDelete':_0xf1ba('0x169'),'foreignKey':_0xf1ba('0x176')});db['SmsApplication'][_0xf1ba('0x118')](db[_0xf1ba('0x8b')],{'onDelete':'restrict','foreignKey':_0xf1ba('0x16a')});db[_0xf1ba('0x177')][_0xf1ba('0x10e')](db[_0xf1ba('0x57')],{'as':'Messages','onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x178')});db[_0xf1ba('0x177')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0xf1ba('0x174')});db[_0xf1ba('0x177')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':'Contact','foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x177')][_0xf1ba('0x118')](db['User'],{'as':'Owner','foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0x177')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x179'),'as':_0xf1ba('0x161')});db[_0xf1ba('0x177')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x179'),'as':'ThroughTags'});db[_0xf1ba('0x177')]['belongsToMany'](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x164'),'through':_0xf1ba('0x124'),'foreignKey':_0xf1ba('0x178')});db[_0xf1ba('0x57')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x12')});db[_0xf1ba('0x57')]['belongsTo'](db[_0xf1ba('0x70')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x151')});db['SmsMessage'][_0xf1ba('0x118')](db[_0xf1ba('0x177')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x166'),'foreignKey':'SmsInteractionId'});db[_0xf1ba('0x57')][_0xf1ba('0x118')](db[_0xf1ba('0x53')],{'as':_0xf1ba('0x167'),'foreignKey':'SmsAccountId'});db[_0xf1ba('0x12a')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':'UserSmsQueue','foreignKey':_0xf1ba('0x17a')});db[_0xf1ba('0x12a')]['belongsToMany'](db[_0xf1ba('0xdf')],{'through':_0xf1ba('0x17b'),'as':'Teams'});db['OpenchannelAccount'][_0xf1ba('0x10e')](db[_0xf1ba('0x81')],{'as':'Dispositions','foreignKey':_0xf1ba('0x17c'),'onDelete':_0xf1ba('0x137')});db['OpenchannelAccount']['hasMany'](db[_0xf1ba('0x7f')],{'as':_0xf1ba('0x16f'),'foreignKey':_0xf1ba('0x17c')});db[_0xf1ba('0x5a')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xf1ba('0x175'),'foreignKey':_0xf1ba('0x17c')});db[_0xf1ba('0x5a')][_0xf1ba('0x10e')](db[_0xf1ba('0x5e')],{'as':'Messages','foreignKey':_0xf1ba('0x17c')});db[_0xf1ba('0x5a')][_0xf1ba('0x10e')](db[_0xf1ba('0x5c')],{'as':_0xf1ba('0x139'),'foreignKey':'OpenchannelAccountId'});db[_0xf1ba('0x5a')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':'List','foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0x5a')][_0xf1ba('0x118')](db[_0xf1ba('0x84')],{'as':_0xf1ba('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf1ba('0x5a')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0xf1ba('0x5c')]['belongsTo'](db['User'],{'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x5c')][_0xf1ba('0x118')](db['OpenchannelQueue'],{'onDelete':_0xf1ba('0x169'),'foreignKey':_0xf1ba('0x17d')});db[_0xf1ba('0x5c')][_0xf1ba('0x118')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xf1ba('0x5c')]['belongsTo'](db[_0xf1ba('0x145')],{'onDelete':_0xf1ba('0x169'),'foreignKey':_0xf1ba('0x176')});db[_0xf1ba('0x5c')][_0xf1ba('0x118')](db[_0xf1ba('0x8b')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf1ba('0x5d')][_0xf1ba('0x10e')](db[_0xf1ba('0x5e')],{'as':'Messages','onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x17e')});db[_0xf1ba('0x5d')][_0xf1ba('0x118')](db[_0xf1ba('0x5a')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x17c')});db[_0xf1ba('0x5d')]['belongsTo'](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':'ContactId'});db[_0xf1ba('0x5d')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x160'),'foreignKey':'UserId'});db[_0xf1ba('0x5d')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':'openchannel_interaction_has_tags','as':_0xf1ba('0x161')});db['OpenchannelInteraction'][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x17f'),'as':_0xf1ba('0x163')});db[_0xf1ba('0x5d')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x164'),'through':_0xf1ba('0x125'),'foreignKey':_0xf1ba('0x17e')});db[_0xf1ba('0x5e')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x12')});db['OpenchannelMessage'][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'onDelete':'cascade','as':_0xf1ba('0x151')});db['OpenchannelMessage'][_0xf1ba('0x118')](db[_0xf1ba('0x5d')],{'onDelete':_0xf1ba('0x137'),'as':'Interaction','foreignKey':_0xf1ba('0x17e')});db[_0xf1ba('0x5e')][_0xf1ba('0x118')](db[_0xf1ba('0xe5')],{'as':_0xf1ba('0xe5'),'foreignKey':_0xf1ba('0x180')});db[_0xf1ba('0x5e')]['belongsTo'](db[_0xf1ba('0x5a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xf1ba('0x5f')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':'UserOpenchannelQueue','foreignKey':_0xf1ba('0x17d')});db[_0xf1ba('0x5f')]['belongsToMany'](db[_0xf1ba('0xdf')],{'through':'team_has_openchannel_queues','as':_0xf1ba('0x148')});db[_0xf1ba('0x60')]['hasMany'](db[_0xf1ba('0x81')],{'as':_0xf1ba('0x16d'),'foreignKey':_0xf1ba('0x168'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x60')]['hasMany'](db[_0xf1ba('0x7f')],{'as':_0xf1ba('0x16f'),'foreignKey':_0xf1ba('0x168')});db[_0xf1ba('0x60')][_0xf1ba('0x10e')](db['ChatProactiveAction'],{'as':_0xf1ba('0x181')});db[_0xf1ba('0x60')][_0xf1ba('0x10e')](db['ChatInteraction'],{'as':_0xf1ba('0x175')});db[_0xf1ba('0x60')][_0xf1ba('0x10e')](db['ChatApplication'],{'as':'Applications'});db[_0xf1ba('0x60')][_0xf1ba('0x10e')](db['ChatMessage'],{'as':_0xf1ba('0x14b')});db[_0xf1ba('0x60')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':'ListId'});db[_0xf1ba('0x60')][_0xf1ba('0x118')](db[_0xf1ba('0x145')],{'as':'Interval','foreignKey':_0xf1ba('0x176')});db[_0xf1ba('0x60')][_0xf1ba('0x118')](db[_0xf1ba('0x154')],{'as':_0xf1ba('0x154'),'foreignKey':_0xf1ba('0x157')});db[_0xf1ba('0x60')][_0xf1ba('0x118')](db[_0xf1ba('0x84')],{'as':_0xf1ba('0x15c'),'foreignKey':_0xf1ba('0x146')});db['ChatWebsite'][_0xf1ba('0x11a')](db['User'],{'as':_0xf1ba('0x147'),'through':'user_has_chat_websites'});db[_0xf1ba('0x61')][_0xf1ba('0x118')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xf1ba('0x118')](db['CmList'],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0x61')]['belongsTo'](db[_0xf1ba('0x70')],{'as':'Contact','foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x61')][_0xf1ba('0x118')](db[_0xf1ba('0x5d')],{});db[_0xf1ba('0x61')][_0xf1ba('0x118')](db[_0xf1ba('0x5e')],{});db[_0xf1ba('0x61')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{});db[_0xf1ba('0x61')][_0xf1ba('0x118')](db[_0xf1ba('0x5f')],{});db[_0xf1ba('0x182')][_0xf1ba('0x118')](db['User'],{'as':_0xf1ba('0x183'),'foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication'][_0xf1ba('0x118')](db[_0xf1ba('0x128')],{'as':'Queue','foreignKey':_0xf1ba('0x184'),'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x182')][_0xf1ba('0x118')](db[_0xf1ba('0x60')],{'as':_0xf1ba('0x185'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0xf1ba('0x182')][_0xf1ba('0x118')](db[_0xf1ba('0x8b')],{'onDelete':_0xf1ba('0x169'),'foreignKey':'TagId'});db[_0xf1ba('0x64')][_0xf1ba('0x10e')](db[_0xf1ba('0x65')],{'as':_0xf1ba('0x14b'),'onDelete':'cascade','foreignKey':_0xf1ba('0x186')});db['ChatInteraction']['belongsTo'](db[_0xf1ba('0x60')],{'as':'Account','foreignKey':_0xf1ba('0x168')});db[_0xf1ba('0x64')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0xf1ba('0x64')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':'Owner','foreignKey':_0xf1ba('0x10c')});db['ChatInteraction'][_0xf1ba('0x11a')](db['Tag'],{'through':_0xf1ba('0x187'),'as':_0xf1ba('0x161')});db['ChatInteraction'][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x187'),'as':_0xf1ba('0x163')});db[_0xf1ba('0x64')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x164'),'through':'user_has_chat_interactions','foreignKey':_0xf1ba('0x186')});db[_0xf1ba('0x65')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':_0xf1ba('0x137'),'as':'User'});db['ChatMessage'][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x151'),'foreignKey':'ContactId'});db[_0xf1ba('0x65')][_0xf1ba('0x118')](db['ChatInteraction'],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x166'),'foreignKey':_0xf1ba('0x186')});db[_0xf1ba('0x65')][_0xf1ba('0x118')](db[_0xf1ba('0xe5')],{'as':_0xf1ba('0xe5'),'foreignKey':_0xf1ba('0x180')});db['ChatMessage']['belongsTo'](db[_0xf1ba('0x60')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x168')});db[_0xf1ba('0x67')][_0xf1ba('0x10e')](db['Attachment'],{'as':'Attachments','foreignKey':_0xf1ba('0x188'),'onDelete':_0xf1ba('0x137'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xf1ba('0x70')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x67')][_0xf1ba('0x118')](db[_0xf1ba('0x60')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x168')});db[_0xf1ba('0x128')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x147'),'through':_0xf1ba('0x32'),'hooks':!![]});db['ChatQueue'][_0xf1ba('0x11a')](db[_0xf1ba('0xdf')],{'through':_0xf1ba('0x189'),'as':_0xf1ba('0x148')});db[_0xf1ba('0x6a')][_0xf1ba('0x10e')](db[_0xf1ba('0xcb')],{'as':'Messages','foreignKey':_0xf1ba('0x18a'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x6a')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Members','through':_0xf1ba('0x11c')});db[_0xf1ba('0x6c')][_0xf1ba('0x118')](db[_0xf1ba('0x60')],{'as':_0xf1ba('0x185'),'foreignKey':_0xf1ba('0x168')});db[_0xf1ba('0x6e')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xf1ba('0x70')][_0xf1ba('0x10e')](db[_0xf1ba('0x72')],{'as':_0xf1ba('0x13d'),'foreignKey':_0xf1ba('0x152')});db['CmContact'][_0xf1ba('0x10e')](db[_0xf1ba('0x111')],{'as':_0xf1ba('0x13e'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x70')][_0xf1ba('0x10e')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xf1ba('0x70')][_0xf1ba('0x10e')](db['ReportAgentPreview'],{'as':_0xf1ba('0x78'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x70')][_0xf1ba('0x10e')](db[_0xf1ba('0x18b')],{'as':_0xf1ba('0x140'),'foreignKey':'ContactId'});db[_0xf1ba('0x70')][_0xf1ba('0x10e')](db[_0xf1ba('0x5d')],{'as':_0xf1ba('0x112'),'foreignKey':_0xf1ba('0x152'),'onDelete':'restrict'});db['CmContact'][_0xf1ba('0x10e')](db[_0xf1ba('0x64')],{'as':_0xf1ba('0x113'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':_0xf1ba('0x123'),'foreignKey':_0xf1ba('0x152'),'onDelete':_0xf1ba('0x169')});db['CmContact']['hasMany'](db[_0xf1ba('0x114')],{'as':_0xf1ba('0x115'),'foreignKey':_0xf1ba('0x152'),'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x70')][_0xf1ba('0x10e')](db[_0xf1ba('0x41')],{'as':'MailInteractions','foreignKey':_0xf1ba('0x152'),'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x70')][_0xf1ba('0x118')](db[_0xf1ba('0x6e')],{'as':_0xf1ba('0x18c'),'foreignKey':_0xf1ba('0x18d')});db[_0xf1ba('0x70')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159'),'onDelete':'cascade'});db[_0xf1ba('0x70')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Users','through':_0xf1ba('0x18e')});db[_0xf1ba('0x70')]['belongsToMany'](db[_0xf1ba('0x8b')],{'as':_0xf1ba('0x161'),'through':_0xf1ba('0x18f')});db[_0xf1ba('0x70')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xf1ba('0x72')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':'ContactId','onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x72')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x72')]['belongsTo'](db['User'],{'as':_0xf1ba('0x183'),'foreignKey':_0xf1ba('0x10c')});db['CmHopper'][_0xf1ba('0x118')](db[_0xf1ba('0x1a')],{'as':_0xf1ba('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x72')][_0xf1ba('0x118')](db[_0xf1ba('0x191')],{'as':_0xf1ba('0x191'),'foreignKey':_0xf1ba('0x192'),'onDelete':_0xf1ba('0x137')});db['CmHopper'][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x160'),'foreignKey':'OwnerId'});db[_0xf1ba('0x74')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':'ContactId','onDelete':_0xf1ba('0x137')});db['CmHopperBlack'][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':'List','foreignKey':_0xf1ba('0x159'),'onDelete':_0xf1ba('0x137')});db['CmHopperBlack'][_0xf1ba('0x118')](db['VoiceQueue'],{'as':_0xf1ba('0x190'),'foreignKey':_0xf1ba('0x13c'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0x74')][_0xf1ba('0x118')](db[_0xf1ba('0x191')],{'as':_0xf1ba('0x191'),'foreignKey':_0xf1ba('0x192'),'onDelete':'cascade'});db[_0xf1ba('0x7d')][_0xf1ba('0x10e')](db[_0xf1ba('0x193')],{'as':{'plural':_0xf1ba('0x194'),'singular':_0xf1ba('0x195')},'foreignKey':_0xf1ba('0x196'),'onDelete':_0xf1ba('0x137'),'hooks':!![]});db['Automation']['hasMany'](db[_0xf1ba('0x193')],{'as':{'plural':_0xf1ba('0x197'),'singular':_0xf1ba('0x198')},'foreignKey':_0xf1ba('0x199'),'onDelete':'cascade','hooks':!![]});db[_0xf1ba('0x7d')]['hasMany'](db['Action'],{'as':_0xf1ba('0x19a'),'foreignKey':_0xf1ba('0x19b'),'onDelete':_0xf1ba('0x137'),'hooks':!![]});db['Disposition'][_0xf1ba('0x10e')](db[_0xf1ba('0x81')],{'as':'Dispositions','foreignKey':_0xf1ba('0x19c'),'onDelete':'cascade'});db[_0xf1ba('0x145')][_0xf1ba('0x10e')](db[_0xf1ba('0x145')],{'as':'Intervals','foreignKey':_0xf1ba('0x176'),'onDelete':_0xf1ba('0x137'),'hooks':!![],'required':![]});db['Interval'][_0xf1ba('0x10e')](db[_0xf1ba('0x17')],{'as':_0xf1ba('0x19d'),'foreignKey':_0xf1ba('0x176'),'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x145')][_0xf1ba('0x10e')](db[_0xf1ba('0x44')],{'as':_0xf1ba('0x19e'),'foreignKey':'IntervalId'});db[_0xf1ba('0x145')][_0xf1ba('0x10e')](db['ChatApplication'],{'as':_0xf1ba('0x19f'),'foreignKey':_0xf1ba('0x176')});db['Interval']['hasMany'](db[_0xf1ba('0x4c')],{'as':_0xf1ba('0x1a0'),'foreignKey':_0xf1ba('0x176')});db[_0xf1ba('0x145')][_0xf1ba('0x10e')](db['SmsApplication'],{'as':_0xf1ba('0x1a1'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0xf1ba('0x154')],{});db[_0xf1ba('0x88')][_0xf1ba('0x118')](db[_0xf1ba('0x96')],{'foreignKey':_0xf1ba('0x1a2')});db['Schedule'][_0xf1ba('0x118')](db[_0xf1ba('0x94')],{'foreignKey':_0xf1ba('0x1a3')});db['Sound'][_0xf1ba('0x11a')](db[_0xf1ba('0x19')],{'as':_0xf1ba('0x1a4'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0xf1ba('0x8b')]['belongsToMany'](db[_0xf1ba('0x70')],{'through':_0xf1ba('0x18f')});db[_0xf1ba('0x8b')][_0xf1ba('0x11a')](db[_0xf1ba('0x64')],{'through':'chat_interaction_has_tags'});db[_0xf1ba('0x8b')][_0xf1ba('0x11a')](db[_0xf1ba('0x41')],{'through':_0xf1ba('0x162')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xf1ba('0x8b')]['belongsToMany'](db[_0xf1ba('0x114')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xf1ba('0x11a')](db['OpenchannelInteraction'],{'through':_0xf1ba('0x17f')});db[_0xf1ba('0x8b')][_0xf1ba('0x11a')](db[_0xf1ba('0xfc')],{'through':_0xf1ba('0x1a5')});db['Trigger'][_0xf1ba('0x10e')](db[_0xf1ba('0x193')],{'as':{'plural':'AllConditions','singular':_0xf1ba('0x1a6')},'foreignKey':_0xf1ba('0x1a7'),'onDelete':_0xf1ba('0x137'),'hooks':!![]});db[_0xf1ba('0x8e')][_0xf1ba('0x10e')](db[_0xf1ba('0x193')],{'as':{'plural':'AnyConditions','singular':_0xf1ba('0x1a8')},'foreignKey':_0xf1ba('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0xf1ba('0x8e')][_0xf1ba('0x10e')](db['Action'],{'as':_0xf1ba('0x19a'),'foreignKey':_0xf1ba('0x1aa'),'onDelete':'cascade','hooks':!![]});db[_0xf1ba('0x94')][_0xf1ba('0x10e')](db['AnalyticFieldReport'],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1a3'),'hooks':!![]});db[_0xf1ba('0x96')]['hasMany'](db[_0xf1ba('0x9a')],{'as':_0xf1ba('0x1ab'),'onDelete':'cascade','foreignKey':_0xf1ba('0x1a2')});db['AnalyticMetric'][_0xf1ba('0x10e')](db['AnalyticFieldReport'],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1ac')});db[_0xf1ba('0x9a')][_0xf1ba('0x118')](db[_0xf1ba('0x98')],{'foreignKey':'MetricId'});db[_0xf1ba('0x9d')][_0xf1ba('0x10e')](db[_0xf1ba('0x1ad')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf1ba('0x1ae')});db['SalesforceConfiguration'][_0xf1ba('0x10e')](db[_0xf1ba('0xa0')],{'as':'Subjects','onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1af')});db['SalesforceConfiguration'][_0xf1ba('0x10e')](db[_0xf1ba('0xa0')],{'as':_0xf1ba('0x1b0'),'onDelete':_0xf1ba('0x137'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xf1ba('0x10e')](db[_0xf1ba('0xa0')],{'as':'Fields','onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0x1ad')]['belongsTo'](db[_0xf1ba('0x9d')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xa0')][_0xf1ba('0x10e')](db[_0xf1ba('0xa0')],{'as':'Subject','foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xa0')][_0xf1ba('0x10e')](db[_0xf1ba('0xa0')],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db['SalesforceField']['hasMany'](db[_0xf1ba('0xa0')],{'as':_0xf1ba('0x1b4'),'foreignKey':_0xf1ba('0x1b1')});db['SalesforceField'][_0xf1ba('0x118')](db[_0xf1ba('0x1b5')],{'as':_0xf1ba('0x1b5'),'foreignKey':_0xf1ba('0x1b6')});db[_0xf1ba('0xa2')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xf1ba('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xf1ba('0xa3')][_0xf1ba('0x10e')](db[_0xf1ba('0xa4')],{'as':_0xf1ba('0x1b8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xf1ba('0xa3')]['hasMany'](db[_0xf1ba('0xa4')],{'as':_0xf1ba('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf1ba('0xa3')][_0xf1ba('0x10e')](db[_0xf1ba('0xa4')],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':'FieldId'});db[_0xf1ba('0xa3')][_0xf1ba('0x118')](db[_0xf1ba('0xa2')],{'as':'Account','foreignKey':_0xf1ba('0x1ae')});db['SugarcrmField']['hasMany'](db[_0xf1ba('0xa4')],{'as':_0xf1ba('0x1b9'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xa4')][_0xf1ba('0x10e')](db[_0xf1ba('0xa4')],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0xa4')]['hasMany'](db['SugarcrmField'],{'as':_0xf1ba('0x1b4'),'foreignKey':'FieldId'});db['SugarcrmField']['belongsTo'](db[_0xf1ba('0x1b5')],{'as':_0xf1ba('0x1b5'),'foreignKey':_0xf1ba('0x1b6')});db[_0xf1ba('0x1ba')][_0xf1ba('0x10e')](db[_0xf1ba('0x1bb')],{'as':_0xf1ba('0x1b7'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1ae')});db['DeskConfiguration'][_0xf1ba('0x10e')](db[_0xf1ba('0xa8')],{'as':_0xf1ba('0x1b8'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0x1bb')][_0xf1ba('0x10e')](db[_0xf1ba('0xa8')],{'as':'Descriptions','onDelete':_0xf1ba('0x137'),'foreignKey':'DescriptionId'});db[_0xf1ba('0x1bb')][_0xf1ba('0x10e')](db[_0xf1ba('0xa8')],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':'FieldId'});db['DeskConfiguration']['belongsTo'](db[_0xf1ba('0x1ba')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0x1bb')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x1bc')});db[_0xf1ba('0xa8')][_0xf1ba('0x10e')](db['DeskField'],{'as':_0xf1ba('0x1b9'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xa8')][_0xf1ba('0x10e')](db['DeskField'],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db['DeskField']['hasMany'](db[_0xf1ba('0xa8')],{'as':_0xf1ba('0x1b4'),'foreignKey':_0xf1ba('0x1b1')});db['DeskField']['belongsTo'](db[_0xf1ba('0x1b5')],{'as':_0xf1ba('0x1b5'),'foreignKey':_0xf1ba('0x1b6')});db[_0xf1ba('0xaa')][_0xf1ba('0x10e')](db[_0xf1ba('0x1bd')],{'as':_0xf1ba('0x1b7'),'onDelete':_0xf1ba('0x137'),'foreignKey':'AccountId'});db['ZohoConfiguration'][_0xf1ba('0x10e')](db['ZohoField'],{'as':_0xf1ba('0x1b8'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0x1bd')][_0xf1ba('0x10e')](db[_0xf1ba('0xab')],{'as':_0xf1ba('0x1b0'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0x1bd')][_0xf1ba('0x10e')](db['ZohoField'],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0x1bd')][_0xf1ba('0x118')](db['ZohoAccount'],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xab')][_0xf1ba('0x10e')](db[_0xf1ba('0xab')],{'as':_0xf1ba('0x1b9'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xab')][_0xf1ba('0x10e')](db[_0xf1ba('0xab')],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db['ZohoField'][_0xf1ba('0x10e')](db[_0xf1ba('0xab')],{'as':_0xf1ba('0x1b4'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0xab')]['belongsTo'](db[_0xf1ba('0x1b5')],{'as':'Variable','foreignKey':_0xf1ba('0x1b6')});db[_0xf1ba('0xad')][_0xf1ba('0x10e')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xaf')][_0xf1ba('0x10e')](db['ZendeskField'],{'as':_0xf1ba('0x1b8'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xaf')][_0xf1ba('0x10e')](db[_0xf1ba('0xb0')],{'as':'Descriptions','foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0xaf')][_0xf1ba('0x10e')](db['ZendeskField'],{'as':_0xf1ba('0x1ab'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0xaf')][_0xf1ba('0x118')](db[_0xf1ba('0xad')],{'as':'Account','foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xaf')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':_0xf1ba('0x1be')});db[_0xf1ba('0xb0')][_0xf1ba('0x10e')](db[_0xf1ba('0xb0')],{'as':_0xf1ba('0x1b9'),'foreignKey':'SubjectId'});db[_0xf1ba('0xb0')][_0xf1ba('0x10e')](db['ZendeskField'],{'as':_0xf1ba('0x1b2'),'foreignKey':'DescriptionId'});db[_0xf1ba('0xb0')][_0xf1ba('0x10e')](db[_0xf1ba('0xb0')],{'as':'Field','foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0xb0')][_0xf1ba('0x118')](db[_0xf1ba('0x1b5')],{'as':'Variable','foreignKey':_0xf1ba('0x1b6')});db['FreshdeskAccount']['hasMany'](db[_0xf1ba('0xb4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xb4')][_0xf1ba('0x10e')](db[_0xf1ba('0xb5')],{'as':_0xf1ba('0x1b8'),'onDelete':_0xf1ba('0x137'),'foreignKey':'SubjectId'});db[_0xf1ba('0xb4')][_0xf1ba('0x10e')](db['FreshdeskField'],{'as':_0xf1ba('0x1b0'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0xb4')][_0xf1ba('0x10e')](db[_0xf1ba('0xb5')],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':'FieldId'});db[_0xf1ba('0xb4')][_0xf1ba('0x118')](db['FreshdeskAccount'],{'as':_0xf1ba('0x167'),'foreignKey':'AccountId'});db[_0xf1ba('0xb4')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xf1ba('0x10e')](db[_0xf1ba('0xb5')],{'as':_0xf1ba('0x1b9'),'foreignKey':_0xf1ba('0x1af')});db['FreshdeskField'][_0xf1ba('0x10e')](db['FreshdeskField'],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0xb5')][_0xf1ba('0x10e')](db[_0xf1ba('0xb5')],{'as':_0xf1ba('0x1b4'),'foreignKey':'FieldId'});db[_0xf1ba('0xb5')][_0xf1ba('0x118')](db['Variable'],{'as':_0xf1ba('0x1b5'),'foreignKey':_0xf1ba('0x1b6')});db[_0xf1ba('0xb7')][_0xf1ba('0x10e')](db[_0xf1ba('0x1bf')],{'as':_0xf1ba('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xf1ba('0x1bf')]['hasMany'](db['VtigerField'],{'as':_0xf1ba('0x1b8'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0x1bf')][_0xf1ba('0x10e')](db[_0xf1ba('0xb9')],{'as':'Descriptions','foreignKey':_0xf1ba('0x1b3')});db['VtigerConfiguration'][_0xf1ba('0x10e')](db[_0xf1ba('0xb9')],{'as':_0xf1ba('0x1ab'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0x1bf')][_0xf1ba('0x118')](db[_0xf1ba('0xb7')],{'as':'Account','foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xb9')]['hasMany'](db[_0xf1ba('0xb9')],{'as':_0xf1ba('0x1b9'),'foreignKey':'SubjectId'});db['VtigerField'][_0xf1ba('0x10e')](db['VtigerField'],{'as':_0xf1ba('0x1b2'),'foreignKey':'DescriptionId'});db['VtigerField'][_0xf1ba('0x10e')](db[_0xf1ba('0xb9')],{'as':_0xf1ba('0x1b4'),'foreignKey':'FieldId'});db[_0xf1ba('0xb9')][_0xf1ba('0x118')](db[_0xf1ba('0x1b5')],{'as':'Variable','foreignKey':_0xf1ba('0x1b6')});db[_0xf1ba('0xbb')][_0xf1ba('0x10e')](db[_0xf1ba('0xbd')],{'as':'Configurations','onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xbd')][_0xf1ba('0x10e')](db[_0xf1ba('0x1c0')],{'as':_0xf1ba('0x1b8'),'foreignKey':_0xf1ba('0x1af')});db['ServicenowConfiguration']['hasMany'](db[_0xf1ba('0x1c0')],{'as':_0xf1ba('0x1b0'),'foreignKey':_0xf1ba('0x1b3')});db['ServicenowConfiguration'][_0xf1ba('0x10e')](db['ServicenowField'],{'as':'Fields','foreignKey':'FieldId'});db[_0xf1ba('0xbd')][_0xf1ba('0x118')](db[_0xf1ba('0xbb')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x1ae')});db['ServicenowField'][_0xf1ba('0x10e')](db[_0xf1ba('0x1c0')],{'as':_0xf1ba('0x1b9'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0x1c0')]['hasMany'](db['ServicenowField'],{'as':'Description','foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0x1c0')]['hasMany'](db['ServicenowField'],{'as':_0xf1ba('0x1b4'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0x1c0')]['belongsTo'](db[_0xf1ba('0x1b5')],{'as':_0xf1ba('0x1b5'),'foreignKey':'VariableId'});db[_0xf1ba('0x1c1')][_0xf1ba('0x10e')](db[_0xf1ba('0xc1')],{'as':_0xf1ba('0x1b7'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1ae')});db['Dynamics365Account'][_0xf1ba('0x118')](db[_0xf1ba('0x104')],{'as':_0xf1ba('0x104'),'foreignKey':_0xf1ba('0x155')});db['Dynamics365Configuration'][_0xf1ba('0x10e')](db['Dynamics365Field'],{'as':_0xf1ba('0x1b8'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xc1')][_0xf1ba('0x10e')](db[_0xf1ba('0xc3')],{'as':_0xf1ba('0x1b0'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1b3')});db['Dynamics365Configuration'][_0xf1ba('0x10e')](db['Dynamics365Field'],{'as':_0xf1ba('0x1ab'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0xc1')][_0xf1ba('0x118')](db[_0xf1ba('0x1c1')],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xc3')][_0xf1ba('0x10e')](db[_0xf1ba('0xc3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf1ba('0xc3')]['hasMany'](db[_0xf1ba('0xc3')],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0xc3')][_0xf1ba('0x10e')](db[_0xf1ba('0xc3')],{'as':_0xf1ba('0x1b4'),'foreignKey':'FieldId'});db[_0xf1ba('0xc3')][_0xf1ba('0x118')](db[_0xf1ba('0x1b5')],{'as':_0xf1ba('0x1b5'),'foreignKey':_0xf1ba('0x1b6')});db['FreshsalesAccount'][_0xf1ba('0x10e')](db[_0xf1ba('0x1c2')],{'as':_0xf1ba('0x1b7'),'onDelete':'cascade','foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0x1c2')]['hasMany'](db[_0xf1ba('0xc6')],{'as':_0xf1ba('0x1b8'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0x1c2')][_0xf1ba('0x10e')](db[_0xf1ba('0xc6')],{'as':'Descriptions','foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0x1c2')]['hasMany'](db[_0xf1ba('0xc6')],{'as':_0xf1ba('0x1ab'),'foreignKey':_0xf1ba('0x1b1')});db[_0xf1ba('0x1c2')]['belongsTo'](db[_0xf1ba('0xc5')],{'as':'Account','foreignKey':_0xf1ba('0x1ae')});db[_0xf1ba('0xc6')]['hasMany'](db[_0xf1ba('0xc6')],{'as':_0xf1ba('0x1b9'),'foreignKey':_0xf1ba('0x1af')});db[_0xf1ba('0xc6')][_0xf1ba('0x10e')](db['FreshsalesField'],{'as':_0xf1ba('0x1b2'),'foreignKey':_0xf1ba('0x1b3')});db[_0xf1ba('0xc6')][_0xf1ba('0x10e')](db['FreshsalesField'],{'as':_0xf1ba('0x1b4'),'foreignKey':'FieldId'});db[_0xf1ba('0xc6')][_0xf1ba('0x118')](db[_0xf1ba('0x1b5')],{'as':_0xf1ba('0x1b5'),'foreignKey':_0xf1ba('0x1b6')});db['ChatQueueReport'][_0xf1ba('0x118')](db[_0xf1ba('0x60')],{});db[_0xf1ba('0xc9')]['belongsTo'](db['CmList'],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0xc9')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0xc9')][_0xf1ba('0x118')](db[_0xf1ba('0x64')],{});db[_0xf1ba('0xc9')][_0xf1ba('0x118')](db[_0xf1ba('0x65')],{});db[_0xf1ba('0xc9')]['belongsTo'](db['User'],{});db[_0xf1ba('0xc9')][_0xf1ba('0x118')](db[_0xf1ba('0x128')],{});db['ChatInternalMessage'][_0xf1ba('0x118')](db['User'],{'onDelete':_0xf1ba('0x137'),'foreignKey':'FromId'});db[_0xf1ba('0xcb')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':_0xf1ba('0x137'),'foreignKey':'ToId'});db[_0xf1ba('0x18b')][_0xf1ba('0x10e')](db[_0xf1ba('0xcf')],{'foreignKey':_0xf1ba('0x1c3'),'onDelete':_0xf1ba('0x137')});db['JscriptySessionReport']['hasMany'](db[_0xf1ba('0xcd')],{'foreignKey':_0xf1ba('0x1c3'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0xd2')]['belongsTo'](db[_0xf1ba('0x53')],{});db[_0xf1ba('0xd2')][_0xf1ba('0x118')](db[_0xf1ba('0xef')],{'as':'List','foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0xd2')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0xd2')][_0xf1ba('0x118')](db[_0xf1ba('0x177')],{});db[_0xf1ba('0xd2')][_0xf1ba('0x118')](db['SmsMessage'],{});db[_0xf1ba('0xd2')][_0xf1ba('0x118')](db['User'],{});db[_0xf1ba('0xd2')][_0xf1ba('0x118')](db['SmsQueue'],{});db['JscriptyProject'][_0xf1ba('0x10e')](db[_0xf1ba('0x18b')],{'foreignKey':_0xf1ba('0x1c4')});db[_0xf1ba('0xd6')][_0xf1ba('0x10e')](db[_0xf1ba('0xcf')],{'foreignKey':_0xf1ba('0x1c4')});db[_0xf1ba('0xd6')][_0xf1ba('0x10e')](db['JscriptyAnswerReport'],{'foreignKey':_0xf1ba('0x1c4')});db[_0xf1ba('0xda')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x164'),'through':_0xf1ba('0x135')});db[_0xf1ba('0xdf')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf1ba('0x11f')});db['Team']['belongsToMany'](db[_0xf1ba('0x1a')],{'through':_0xf1ba('0x106'),'as':'VoiceQueues'});db[_0xf1ba('0xdf')]['belongsToMany'](db[_0xf1ba('0x3e')],{'through':_0xf1ba('0x15e'),'as':_0xf1ba('0x127')});db[_0xf1ba('0xdf')][_0xf1ba('0x11a')](db[_0xf1ba('0x128')],{'through':_0xf1ba('0x189'),'as':_0xf1ba('0x129')});db[_0xf1ba('0xdf')]['belongsToMany'](db['FaxQueue'],{'through':_0xf1ba('0x1c5'),'as':_0xf1ba('0x1c6')});db[_0xf1ba('0xdf')][_0xf1ba('0x11a')](db[_0xf1ba('0x12a')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xf1ba('0xdf')]['belongsToMany'](db[_0xf1ba('0x5f')],{'through':'team_has_openchannel_queues','as':_0xf1ba('0x12c')});db[_0xf1ba('0xdf')]['belongsToMany'](db[_0xf1ba('0x102')],{'through':'team_has_whatsapp_queues','as':_0xf1ba('0x12d')});db[_0xf1ba('0xdf')]['belongsToMany'](db[_0xf1ba('0x126')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db['Campaign'][_0xf1ba('0x10e')](db[_0xf1ba('0x72')],{'as':_0xf1ba('0x13d'),'foreignKey':_0xf1ba('0x192')});db[_0xf1ba('0x191')][_0xf1ba('0x10e')](db['CmHopperFinal'],{'as':_0xf1ba('0x13e'),'foreignKey':'CampaignId'});db['Campaign'][_0xf1ba('0x10e')](db['CmHopperHistory'],{'as':_0xf1ba('0x13f'),'foreignKey':_0xf1ba('0x192')});db[_0xf1ba('0x191')]['hasMany'](db[_0xf1ba('0x74')],{'as':_0xf1ba('0x1c7'),'foreignKey':_0xf1ba('0x192')});db['Campaign'][_0xf1ba('0x118')](db[_0xf1ba('0x142')],{'as':_0xf1ba('0x142'),'foreignKey':_0xf1ba('0x141')});db[_0xf1ba('0x191')]['belongsTo'](db[_0xf1ba('0x142')],{'as':_0xf1ba('0x143'),'foreignKey':_0xf1ba('0x144')});db[_0xf1ba('0x191')]['belongsTo'](db[_0xf1ba('0x145')],{'as':'Interval','foreignKey':_0xf1ba('0x176')});db[_0xf1ba('0x191')][_0xf1ba('0x118')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xf1ba('0x191')][_0xf1ba('0x11a')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x11d'),'through':_0xf1ba('0x1c8')});db['Campaign'][_0xf1ba('0x11a')](db[_0xf1ba('0xef')],{'as':_0xf1ba('0x149'),'through':'campaigns_has_cm_blacklists'});db[_0xf1ba('0xe5')][_0xf1ba('0x118')](db[_0xf1ba('0x67')],{'as':_0xf1ba('0x67'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0x43')],{});db[_0xf1ba('0x1c9')][_0xf1ba('0x118')](db[_0xf1ba('0x41')],{});db['MailTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0x154')],{'foreignKey':_0xf1ba('0x1ca'),'as':_0xf1ba('0x1cb')});db['MailTransferReport']['belongsTo'](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1cc'),'as':_0xf1ba('0x1cd')});db[_0xf1ba('0x1c9')]['belongsTo'](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1ce'),'as':_0xf1ba('0x1cf')});db[_0xf1ba('0x1c9')][_0xf1ba('0x118')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0xf1ba('0x1d0')});db[_0xf1ba('0x1c9')][_0xf1ba('0x118')](db[_0xf1ba('0x154')],{'foreignKey':_0xf1ba('0x1d1'),'as':_0xf1ba('0x1d2')});db[_0xf1ba('0x1d3')][_0xf1ba('0x118')](db[_0xf1ba('0x65')],{});db[_0xf1ba('0x1d3')][_0xf1ba('0x118')](db[_0xf1ba('0x64')],{});db[_0xf1ba('0x1d3')][_0xf1ba('0x118')](db['ChatWebsite'],{'foreignKey':_0xf1ba('0x1d4'),'as':_0xf1ba('0x1cb')});db[_0xf1ba('0x1d3')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1cc'),'as':'FromAgent'});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xf1ba('0x1ce'),'as':_0xf1ba('0x1cf')});db[_0xf1ba('0x1d3')]['belongsTo'](db[_0xf1ba('0x128')],{'foreignKey':'ToChatQueueId','as':_0xf1ba('0x1d0')});db[_0xf1ba('0x1d3')][_0xf1ba('0x118')](db[_0xf1ba('0x60')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0xf1ba('0xea')][_0xf1ba('0x118')](db['FaxMessage'],{});db[_0xf1ba('0xea')][_0xf1ba('0x118')](db['FaxInteraction'],{});db[_0xf1ba('0xea')][_0xf1ba('0x118')](db[_0xf1ba('0x4a')],{'foreignKey':_0xf1ba('0x1d5'),'as':_0xf1ba('0x1cb')});db[_0xf1ba('0xea')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1cc'),'as':'FromAgent'});db[_0xf1ba('0xea')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0x51')],{'foreignKey':_0xf1ba('0x1d6'),'as':'ToQueue'});db[_0xf1ba('0xea')][_0xf1ba('0x118')](db[_0xf1ba('0x4a')],{'foreignKey':_0xf1ba('0x1d7'),'as':_0xf1ba('0x1d2')});db[_0xf1ba('0x1d8')]['belongsTo'](db[_0xf1ba('0x5e')],{});db[_0xf1ba('0x1d8')][_0xf1ba('0x118')](db[_0xf1ba('0x5d')],{});db[_0xf1ba('0x1d8')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xf1ba('0x1d9'),'as':'FromAccount'});db[_0xf1ba('0x1d8')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'foreignKey':'FromUserId','as':_0xf1ba('0x1cd')});db[_0xf1ba('0x1d8')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1ce'),'as':_0xf1ba('0x1cf')});db['OpenchannelTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0x5f')],{'foreignKey':_0xf1ba('0x1da'),'as':_0xf1ba('0x1d0')});db['OpenchannelTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0x5a')],{'foreignKey':_0xf1ba('0x1db'),'as':_0xf1ba('0x1d2')});db[_0xf1ba('0xed')][_0xf1ba('0x118')](db[_0xf1ba('0x57')],{});db[_0xf1ba('0xed')][_0xf1ba('0x118')](db[_0xf1ba('0x177')],{});db[_0xf1ba('0xed')][_0xf1ba('0x118')](db[_0xf1ba('0x53')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport'][_0xf1ba('0x118')](db['User'],{'foreignKey':_0xf1ba('0x1cc'),'as':_0xf1ba('0x1cd')});db['SmsTransferReport'][_0xf1ba('0x118')](db['User'],{'foreignKey':_0xf1ba('0x1ce'),'as':_0xf1ba('0x1cf')});db[_0xf1ba('0xed')][_0xf1ba('0x118')](db['SmsQueue'],{'foreignKey':_0xf1ba('0x1dc'),'as':_0xf1ba('0x1d0')});db[_0xf1ba('0xed')][_0xf1ba('0x118')](db[_0xf1ba('0x53')],{'foreignKey':_0xf1ba('0x1dd'),'as':_0xf1ba('0x1d2')});db[_0xf1ba('0xef')]['hasMany'](db[_0xf1ba('0x81')],{'as':_0xf1ba('0x16d'),'foreignKey':'ListId','onDelete':_0xf1ba('0x137')});db['CmList'][_0xf1ba('0x10e')](db[_0xf1ba('0x7a')],{'as':_0xf1ba('0x1de'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0xef')]['hasMany'](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x1df'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0xef')]['hasMany'](db[_0xf1ba('0x111')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0xf1ba('0xef')][_0xf1ba('0x10e')](db[_0xf1ba('0x77')],{'as':_0xf1ba('0x1e0'),'foreignKey':_0xf1ba('0x159')});db['CmList'][_0xf1ba('0x10e')](db[_0xf1ba('0x78')],{'as':_0xf1ba('0x78'),'foreignKey':_0xf1ba('0x159')});db['CmList'][_0xf1ba('0x11a')](db[_0xf1ba('0x1a')],{'as':'Queues','through':_0xf1ba('0x1e1')});db[_0xf1ba('0xef')][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Agents','through':_0xf1ba('0x11e')});db[_0xf1ba('0x126')][_0xf1ba('0x10e')](db[_0xf1ba('0x17')],{'as':_0xf1ba('0x19d'),'onDelete':_0xf1ba('0x137')});db['VoicePrefix'][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Agents','through':_0xf1ba('0x109')});db[_0xf1ba('0x126')][_0xf1ba('0x11a')](db['Team'],{'through':_0xf1ba('0x108'),'as':'Teams'});db[_0xf1ba('0xf2')][_0xf1ba('0x10e')](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x164'),'foreignKey':'userProfileId'});db[_0xf1ba('0xf2')]['hasMany'](db['UserProfileSection'],{'as':_0xf1ba('0x1e2'),'foreignKey':_0xf1ba('0x119'),'onDelete':_0xf1ba('0x137')});db['UserProfileSection'][_0xf1ba('0x10e')](db[_0xf1ba('0xf6')],{'as':_0xf1ba('0x1e3'),'foreignKey':'sectionId','onDelete':_0xf1ba('0x137')});db[_0xf1ba('0xf8')][_0xf1ba('0x10e')](db[_0xf1ba('0x81')],{'as':_0xf1ba('0x16d'),'foreignKey':_0xf1ba('0x1e4'),'onDelete':_0xf1ba('0x137')});db[_0xf1ba('0xf8')][_0xf1ba('0x10e')](db['CannedAnswer'],{'as':_0xf1ba('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0xf1ba('0xf8')][_0xf1ba('0x10e')](db[_0xf1ba('0xfe')],{'as':_0xf1ba('0x14b'),'foreignKey':'WhatsappAccountId'});db[_0xf1ba('0xf8')][_0xf1ba('0x10e')](db['WhatsappInteraction'],{'as':_0xf1ba('0x175')});db[_0xf1ba('0xf8')][_0xf1ba('0x10e')](db[_0xf1ba('0xfa')],{'as':_0xf1ba('0x139')});db[_0xf1ba('0xf8')]['belongsTo'](db['CmList'],{'as':_0xf1ba('0x158'),'foreignKey':_0xf1ba('0x159')});db[_0xf1ba('0xf8')][_0xf1ba('0x118')](db[_0xf1ba('0x84')],{'as':_0xf1ba('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xf1ba('0x11a')](db[_0xf1ba('0x12')],{'as':'Agents','through':_0xf1ba('0x1e5')});db[_0xf1ba('0xfa')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'onDelete':'restrict'});db[_0xf1ba('0xfa')][_0xf1ba('0x118')](db[_0xf1ba('0x102')],{'onDelete':_0xf1ba('0x169')});db['WhatsappApplication'][_0xf1ba('0x118')](db['WhatsappAccount'],{'onDelete':_0xf1ba('0x169')});db['WhatsappApplication'][_0xf1ba('0x118')](db[_0xf1ba('0x145')],{'onDelete':_0xf1ba('0x169'),'foreignKey':_0xf1ba('0x176')});db[_0xf1ba('0xfa')][_0xf1ba('0x118')](db['Tag'],{'onDelete':_0xf1ba('0x169'),'foreignKey':_0xf1ba('0x16a')});db[_0xf1ba('0xfc')][_0xf1ba('0x10e')](db[_0xf1ba('0xfe')],{'as':_0xf1ba('0x14b'),'onDelete':_0xf1ba('0x137'),'foreignKey':_0xf1ba('0x1e6')});db['WhatsappInteraction'][_0xf1ba('0x118')](db['WhatsappAccount'],{'as':_0xf1ba('0x167'),'foreignKey':_0xf1ba('0x1e4')});db[_0xf1ba('0xfc')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'as':_0xf1ba('0x151'),'foreignKey':'ContactId'});db[_0xf1ba('0xfc')][_0xf1ba('0x118')](db['User'],{'as':'Owner','foreignKey':_0xf1ba('0x10c')});db[_0xf1ba('0xfc')]['belongsToMany'](db['Tag'],{'through':_0xf1ba('0x1a5'),'as':'Tags'});db[_0xf1ba('0xfc')][_0xf1ba('0x11a')](db[_0xf1ba('0x8b')],{'through':'whatsapp_interaction_has_tags','as':_0xf1ba('0x163')});db[_0xf1ba('0xfc')]['belongsToMany'](db[_0xf1ba('0x12')],{'as':'Users','through':_0xf1ba('0x1e7'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0xf1ba('0x12')],{'as':_0xf1ba('0x12')});db[_0xf1ba('0xfe')][_0xf1ba('0x118')](db[_0xf1ba('0x70')],{'onDelete':_0xf1ba('0x137'),'as':_0xf1ba('0x151')});db[_0xf1ba('0xfe')][_0xf1ba('0x118')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0xf1ba('0x166'),'foreignKey':'WhatsappInteractionId'});db[_0xf1ba('0xfe')][_0xf1ba('0x118')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xf1ba('0x100')][_0xf1ba('0x118')](db[_0xf1ba('0xf8')],{});db[_0xf1ba('0x100')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport']['belongsTo'](db['CmContact'],{'as':_0xf1ba('0x151'),'foreignKey':_0xf1ba('0x152')});db[_0xf1ba('0x100')]['belongsTo'](db[_0xf1ba('0xfc')],{});db[_0xf1ba('0x100')][_0xf1ba('0x118')](db[_0xf1ba('0x102')],{});db[_0xf1ba('0x100')]['belongsTo'](db['WhatsappMessage'],{});db[_0xf1ba('0x100')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{});db['WhatsappTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0xfe')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xf1ba('0xfc')],{});db['WhatsappTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0xf8')],{'foreignKey':_0xf1ba('0x1e8'),'as':_0xf1ba('0x1cb')});db['WhatsappTransferReport'][_0xf1ba('0x118')](db['WhatsappAccount'],{'foreignKey':_0xf1ba('0x1e9'),'as':'ToAccount'});db[_0xf1ba('0x1ea')][_0xf1ba('0x118')](db[_0xf1ba('0x102')],{'foreignKey':_0xf1ba('0x1eb'),'as':_0xf1ba('0x1d0')});db['WhatsappTransferReport'][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1cc'),'as':'FromAgent'});db[_0xf1ba('0x1ea')][_0xf1ba('0x118')](db[_0xf1ba('0x12')],{'foreignKey':_0xf1ba('0x1ce'),'as':_0xf1ba('0x1cf')});db['WhatsappQueue'][_0xf1ba('0x11a')](db['User'],{'as':_0xf1ba('0x147'),'through':_0xf1ba('0x1ec'),'foreignKey':_0xf1ba('0x1ed')});db['WhatsappQueue'][_0xf1ba('0x11a')](db[_0xf1ba('0xdf')],{'through':_0xf1ba('0x1ee'),'as':_0xf1ba('0x148')});db[_0xf1ba('0x104')][_0xf1ba('0x10b')](db[_0xf1ba('0x1c1')],{'as':_0xf1ba('0x1c1'),'onDelete':_0xf1ba('0x169')});db[_0xf1ba('0x104')]['hasOne'](db[_0xf1ba('0x153')],{'as':'Imap','onDelete':_0xf1ba('0x169')});db['CloudProvider'][_0xf1ba('0x10b')](db['MailServerOut'],{'as':'Smtp','onDelete':_0xf1ba('0x169')});module[_0xf1ba('0x1ef')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 96d0d35..4ffd08f 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bb6=['express','util','./errors','./config/environment','./config/logger','api','auth','./safe-template','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','connection','remoteAddress','url','statusCode','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','headers','x-forwarded-for','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','/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/square/messages','./api/squareMessage','/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/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','./api/voicePrefix','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','username','password','apiKey','firstName','lastName','mobile','fax','email','clientId','securityToken','code','tenantId','token','channelSecret','accessTokenSecret','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','isPlainObject','isArray','length','isString','@@{','replace','includes'];(function(_0xccebb8,_0x53233f){var _0x2f6a7f=function(_0x46df63){while(--_0x46df63){_0xccebb8['push'](_0xccebb8['shift']());}};_0x2f6a7f(++_0x53233f);}(_0x2bb6,0x146));var _0x62bb=function(_0x4c4101,_0x45a4ab){_0x4c4101=_0x4c4101-0x0;var _0x37a7f9=_0x2bb6[_0x4c4101];return _0x37a7f9;};'use strict';var _=require('lodash');var path=require('path');var express=require(_0x62bb('0x0'));var ewinston=require('express-winston');var util=require(_0x62bb('0x1'));var errors=require(_0x62bb('0x2'));var config=require(_0x62bb('0x3'));var logger=require(_0x62bb('0x4'))(_0x62bb('0x5'));var authLogger=require(_0x62bb('0x4'))(_0x62bb('0x6'));var safeTemplate=require(_0x62bb('0x7'))['safeTemplate'];exports[_0x62bb('0x8')]=function(_0x584727){_0x584727[_0x62bb('0x9')](ewinston[_0x62bb('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x36ed9b,_0x145d6f){var _0x4e3e39=_0x62bb('0xb');if(!_[_0x62bb('0xc')](_0x36ed9b['body'])){_0x4e3e39+=_0x62bb('0xd');var _0x19cb24=_0x36ed9b[_0x62bb('0xe')];maskSensitiveData(_0x19cb24);}return safeTemplate(util[_0x62bb('0xf')](_0x4e3e39,_0x36ed9b[_0x62bb('0x10')],_0x36ed9b['headers']['x-forwarded-for']?_0x36ed9b['headers']['x-forwarded-for']:_0x36ed9b[_0x62bb('0x11')][_0x62bb('0x12')]||_0x36ed9b['ip'],_0x36ed9b[_0x62bb('0x13')],_0x145d6f[_0x62bb('0x14')],_0x145d6f['responseTime'],_0x36ed9b['user']?_0x36ed9b[_0x62bb('0x15')]['id']:null,_0x36ed9b[_0x62bb('0x15')]?_0x36ed9b['user']['name']:null,_0x36ed9b['user']?_0x36ed9b[_0x62bb('0x15')][_0x62bb('0x16')]:null,_0x19cb24?util['inspect'](_0x19cb24,![],null):''));}}));_0x584727[_0x62bb('0x9')](ewinston[_0x62bb('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x341da9,_0x47442c){var _0x17b3fe=_0x62bb('0x17');if(_0x341da9[_0x62bb('0xe')]&&_0x341da9[_0x62bb('0xe')][_0x62bb('0x18')]&&_0x341da9['body'][_0x62bb('0x19')]){_0x17b3fe='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x62bb('0xf')](_0x17b3fe,_0x341da9[_0x62bb('0x10')],_0x341da9[_0x62bb('0x1a')]['x-forwarded-for']?_0x341da9['headers'][_0x62bb('0x1b')]:_0x341da9[_0x62bb('0x11')]['remoteAddress']||_0x341da9['ip'],_0x341da9[_0x62bb('0x13')],_0x47442c['statusCode'],_0x47442c['responseTime'],_0x341da9[_0x62bb('0x15')]?_0x341da9[_0x62bb('0x15')]['id']:null,_0x341da9[_0x62bb('0x15')]?_0x341da9[_0x62bb('0x15')]['name']:null,_0x341da9['user']?_0x341da9['user'][_0x62bb('0x16')]:null,_0x341da9['body']&&_0x341da9[_0x62bb('0xe')][_0x62bb('0x18')]?_0x341da9['body'][_0x62bb('0x18')]:_0x62bb('0x1c'),_0x341da9['body']&&_0x341da9[_0x62bb('0xe')][_0x62bb('0x19')]?_0x341da9['body']['agent_id']:'',_0x341da9[_0x62bb('0xe')]&&_0x341da9[_0x62bb('0xe')][_0x62bb('0x1d')]?_0x341da9['body'][_0x62bb('0x1d')]:'');},'ignoreRoute':function(_0x15c87d){var _0x370484=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x370484['test'](_0x15c87d[_0x62bb('0x13')]);}}));_0x584727[_0x62bb('0x9')](_0x62bb('0x1e'),require(_0x62bb('0x1f')));_0x584727[_0x62bb('0x9')](_0x62bb('0x20'),require(_0x62bb('0x21')));_0x584727[_0x62bb('0x9')](_0x62bb('0x22'),require(_0x62bb('0x23')));_0x584727[_0x62bb('0x9')](_0x62bb('0x24'),require(_0x62bb('0x25')));_0x584727[_0x62bb('0x9')](_0x62bb('0x26'),require(_0x62bb('0x27')));_0x584727[_0x62bb('0x9')](_0x62bb('0x28'),require(_0x62bb('0x29')));_0x584727[_0x62bb('0x9')]('/api/voice/recordings',require(_0x62bb('0x2a')));_0x584727[_0x62bb('0x9')](_0x62bb('0x2b'),require(_0x62bb('0x2c')));_0x584727[_0x62bb('0x9')]('/api/voice/mails',require(_0x62bb('0x2d')));_0x584727['use'](_0x62bb('0x2e'),require('./api/voiceMailMessage'));_0x584727[_0x62bb('0x9')](_0x62bb('0x2f'),require('./api/voiceCallReport'));_0x584727['use'](_0x62bb('0x30'),require(_0x62bb('0x31')));_0x584727[_0x62bb('0x9')](_0x62bb('0x32'),require(_0x62bb('0x33')));_0x584727['use']('/api/voice/queues/reports',require(_0x62bb('0x34')));_0x584727[_0x62bb('0x9')](_0x62bb('0x35'),require('./api/memberReport'));_0x584727[_0x62bb('0x9')](_0x62bb('0x36'),require(_0x62bb('0x37')));_0x584727[_0x62bb('0x9')]('/api/voice/transfers/reports',require(_0x62bb('0x38')));_0x584727[_0x62bb('0x9')](_0x62bb('0x39'),require(_0x62bb('0x3a')));_0x584727[_0x62bb('0x9')](_0x62bb('0x3b'),require(_0x62bb('0x3c')));_0x584727[_0x62bb('0x9')](_0x62bb('0x3d'),require(_0x62bb('0x3e')));_0x584727[_0x62bb('0x9')](_0x62bb('0x3f'),require(_0x62bb('0x40')));_0x584727[_0x62bb('0x9')]('/api/mail/interactions',require(_0x62bb('0x41')));_0x584727[_0x62bb('0x9')](_0x62bb('0x42'),require('./api/mailMessage'));_0x584727[_0x62bb('0x9')](_0x62bb('0x43'),require(_0x62bb('0x44')));_0x584727[_0x62bb('0x9')](_0x62bb('0x45'),require('./api/mailQueueReport'));_0x584727['use'](_0x62bb('0x46'),require('./api/dashboard'));_0x584727['use'](_0x62bb('0x47'),require(_0x62bb('0x48')));_0x584727['use'](_0x62bb('0x49'),require(_0x62bb('0x4a')));_0x584727['use'](_0x62bb('0x4b'),require(_0x62bb('0x4c')));_0x584727[_0x62bb('0x9')](_0x62bb('0x4d'),require('./api/faxInteraction'));_0x584727[_0x62bb('0x9')]('/api/fax/messages',require(_0x62bb('0x4e')));_0x584727[_0x62bb('0x9')]('/api/fax/queues',require(_0x62bb('0x4f')));_0x584727['use'](_0x62bb('0x50'),require('./api/faxQueueReport'));_0x584727[_0x62bb('0x9')]('/api/sms/accounts',require(_0x62bb('0x51')));_0x584727[_0x62bb('0x9')](_0x62bb('0x52'),require(_0x62bb('0x53')));_0x584727[_0x62bb('0x9')](_0x62bb('0x54'),require(_0x62bb('0x55')));_0x584727[_0x62bb('0x9')](_0x62bb('0x56'),require(_0x62bb('0x57')));_0x584727[_0x62bb('0x9')](_0x62bb('0x58'),require(_0x62bb('0x59')));_0x584727[_0x62bb('0x9')](_0x62bb('0x5a'),require(_0x62bb('0x5b')));_0x584727['use'](_0x62bb('0x5c'),require(_0x62bb('0x5d')));_0x584727[_0x62bb('0x9')]('/api/openchannel/interactions',require(_0x62bb('0x5e')));_0x584727[_0x62bb('0x9')](_0x62bb('0x5f'),require(_0x62bb('0x60')));_0x584727[_0x62bb('0x9')](_0x62bb('0x61'),require(_0x62bb('0x62')));_0x584727[_0x62bb('0x9')](_0x62bb('0x63'),require('./api/chatWebsite'));_0x584727['use'](_0x62bb('0x64'),require(_0x62bb('0x65')));_0x584727[_0x62bb('0x9')](_0x62bb('0x66'),require(_0x62bb('0x67')));_0x584727[_0x62bb('0x9')]('/api/chat/interactions',require(_0x62bb('0x68')));_0x584727[_0x62bb('0x9')](_0x62bb('0x69'),require('./api/chatMessage'));_0x584727[_0x62bb('0x9')](_0x62bb('0x6a'),require('./api/chatOfflineMessage'));_0x584727[_0x62bb('0x9')](_0x62bb('0x6b'),require('./api/chatQueue'));_0x584727[_0x62bb('0x9')]('/api/chat/groups',require(_0x62bb('0x6c')));_0x584727[_0x62bb('0x9')](_0x62bb('0x6d'),require(_0x62bb('0x6e')));_0x584727['use'](_0x62bb('0x6f'),require(_0x62bb('0x70')));_0x584727[_0x62bb('0x9')](_0x62bb('0x71'),require(_0x62bb('0x72')));_0x584727['use']('/api/cm/hopper',require('./api/cmHopper'));_0x584727[_0x62bb('0x9')](_0x62bb('0x73'),require('./api/cmHopperBlack'));_0x584727['use'](_0x62bb('0x74'),require(_0x62bb('0x75')));_0x584727['use'](_0x62bb('0x76'),require(_0x62bb('0x77')));_0x584727['use']('/api/cm/custom_fields',require(_0x62bb('0x78')));_0x584727[_0x62bb('0x9')](_0x62bb('0x79'),require(_0x62bb('0x7a')));_0x584727[_0x62bb('0x9')]('/api/automations',require(_0x62bb('0x7b')));_0x584727[_0x62bb('0x9')](_0x62bb('0x7c'),require(_0x62bb('0x7d')));_0x584727[_0x62bb('0x9')](_0x62bb('0x7e'),require('./api/disposition'));_0x584727[_0x62bb('0x9')](_0x62bb('0x7f'),require(_0x62bb('0x80')));_0x584727['use'](_0x62bb('0x81'),require(_0x62bb('0x82')));_0x584727[_0x62bb('0x9')](_0x62bb('0x83'),require(_0x62bb('0x84')));_0x584727[_0x62bb('0x9')](_0x62bb('0x85'),require(_0x62bb('0x86')));_0x584727[_0x62bb('0x9')]('/api/voiceQueuesLog',require(_0x62bb('0x87')));_0x584727[_0x62bb('0x9')](_0x62bb('0x88'),require(_0x62bb('0x89')));_0x584727[_0x62bb('0x9')](_0x62bb('0x8a'),require(_0x62bb('0x8b')));_0x584727['use'](_0x62bb('0x8c'),require(_0x62bb('0x8d')));_0x584727[_0x62bb('0x9')]('/api/templates',require(_0x62bb('0x8e')));_0x584727[_0x62bb('0x9')](_0x62bb('0x8f'),require(_0x62bb('0x90')));_0x584727[_0x62bb('0x9')](_0x62bb('0x91'),require(_0x62bb('0x92')));_0x584727[_0x62bb('0x9')](_0x62bb('0x93'),require('./api/integration'));_0x584727[_0x62bb('0x9')](_0x62bb('0x94'),require(_0x62bb('0x95')));_0x584727[_0x62bb('0x9')](_0x62bb('0x96'),require('./api/analyticCustomReport'));_0x584727[_0x62bb('0x9')](_0x62bb('0x97'),require(_0x62bb('0x98')));_0x584727[_0x62bb('0x9')]('/api/analytics/extracted_reports',require(_0x62bb('0x99')));_0x584727[_0x62bb('0x9')]('/api/analytics/metrics',require(_0x62bb('0x9a')));_0x584727[_0x62bb('0x9')](_0x62bb('0x9b'),require(_0x62bb('0x9c')));_0x584727[_0x62bb('0x9')]('/api/analytics/tree_reports',require(_0x62bb('0x9d')));_0x584727[_0x62bb('0x9')]('/api/integrations/salesforce/accounts',require(_0x62bb('0x9e')));_0x584727[_0x62bb('0x9')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x584727[_0x62bb('0x9')](_0x62bb('0x9f'),require(_0x62bb('0xa0')));_0x584727[_0x62bb('0x9')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x584727[_0x62bb('0x9')](_0x62bb('0xa1'),require(_0x62bb('0xa2')));_0x584727[_0x62bb('0x9')]('/api/integrations/sugarcrm/fields',require(_0x62bb('0xa3')));_0x584727[_0x62bb('0x9')]('/api/integrations/desk/accounts',require(_0x62bb('0xa4')));_0x584727[_0x62bb('0x9')](_0x62bb('0xa5'),require(_0x62bb('0xa6')));_0x584727[_0x62bb('0x9')](_0x62bb('0xa7'),require('./api/intDeskField'));_0x584727['use']('/api/integrations/zoho/accounts',require(_0x62bb('0xa8')));_0x584727['use']('/api/integrations/zoho/configurations',require(_0x62bb('0xa9')));_0x584727[_0x62bb('0x9')](_0x62bb('0xaa'),require(_0x62bb('0xab')));_0x584727['use'](_0x62bb('0xac'),require(_0x62bb('0xad')));_0x584727[_0x62bb('0x9')](_0x62bb('0xae'),require('./api/intZendeskConfiguration'));_0x584727[_0x62bb('0x9')](_0x62bb('0xaf'),require('./api/intZendeskField'));_0x584727[_0x62bb('0x9')](_0x62bb('0xb0'),require(_0x62bb('0xb1')));_0x584727[_0x62bb('0x9')](_0x62bb('0xb2'),require(_0x62bb('0xb3')));_0x584727[_0x62bb('0x9')](_0x62bb('0xb4'),require(_0x62bb('0xb5')));_0x584727[_0x62bb('0x9')](_0x62bb('0xb6'),require('./api/intVtigerAccount'));_0x584727[_0x62bb('0x9')](_0x62bb('0xb7'),require(_0x62bb('0xb8')));_0x584727[_0x62bb('0x9')]('/api/integrations/vtiger/fields',require(_0x62bb('0xb9')));_0x584727[_0x62bb('0x9')](_0x62bb('0xba'),require('./api/intServicenowAccount'));_0x584727[_0x62bb('0x9')](_0x62bb('0xbb'),require(_0x62bb('0xbc')));_0x584727['use'](_0x62bb('0xbd'),require('./api/intServicenowField'));_0x584727[_0x62bb('0x9')]('/api/integrations/dynamics365/accounts',require(_0x62bb('0xbe')));_0x584727[_0x62bb('0x9')](_0x62bb('0xbf'),require(_0x62bb('0xc0')));_0x584727[_0x62bb('0x9')](_0x62bb('0xc1'),require(_0x62bb('0xc2')));_0x584727['use']('/api/integrations/freshsales/accounts',require(_0x62bb('0xc3')));_0x584727['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x584727['use'](_0x62bb('0xc4'),require(_0x62bb('0xc5')));_0x584727[_0x62bb('0x9')]('/api/networks',require(_0x62bb('0xc6')));_0x584727[_0x62bb('0x9')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x584727[_0x62bb('0x9')](_0x62bb('0xc7'),require('./api/chatInternalMessage'));_0x584727[_0x62bb('0x9')]('/api/jscripty/answers/reports',require(_0x62bb('0xc8')));_0x584727['use'](_0x62bb('0xc9'),require(_0x62bb('0xca')));_0x584727[_0x62bb('0x9')](_0x62bb('0xcb'),require('./api/jscriptySessionReport'));_0x584727[_0x62bb('0x9')](_0x62bb('0xcc'),require('./api/smsQueueReport'));_0x584727['use'](_0x62bb('0xcd'),require(_0x62bb('0xce')));_0x584727['use'](_0x62bb('0xcf'),require('./api/squareReportDetail'));_0x584727[_0x62bb('0x9')](_0x62bb('0xd0'),require(_0x62bb('0xd1')));_0x584727[_0x62bb('0x9')](_0x62bb('0xd2'),require(_0x62bb('0xd3')));_0x584727[_0x62bb('0x9')](_0x62bb('0xd4'),require(_0x62bb('0xd5')));_0x584727['use'](_0x62bb('0xd6'),require('./api/squareProject'));_0x584727[_0x62bb('0x9')]('/api/square/recordings',require('./api/squareRecording'));_0x584727[_0x62bb('0x9')](_0x62bb('0xd7'),require(_0x62bb('0xd8')));_0x584727[_0x62bb('0x9')](_0x62bb('0xd9'),require(_0x62bb('0xda')));_0x584727['use'](_0x62bb('0xdb'),require(_0x62bb('0xdc')));_0x584727[_0x62bb('0x9')](_0x62bb('0xdd'),require(_0x62bb('0xde')));_0x584727['use'](_0x62bb('0xdf'),require(_0x62bb('0xe0')));_0x584727['use'](_0x62bb('0xe1'),require(_0x62bb('0xe2')));_0x584727[_0x62bb('0x9')](_0x62bb('0xe3'),require(_0x62bb('0xe4')));_0x584727['use'](_0x62bb('0xe5'),require(_0x62bb('0xe6')));_0x584727[_0x62bb('0x9')](_0x62bb('0xe7'),require(_0x62bb('0xe8')));_0x584727['use'](_0x62bb('0xe9'),require('./api/faxTransferReport'));_0x584727[_0x62bb('0x9')](_0x62bb('0xea'),require(_0x62bb('0xeb')));_0x584727[_0x62bb('0x9')](_0x62bb('0xec'),require('./api/smsTransferReport'));_0x584727[_0x62bb('0x9')]('/api/cm/lists',require(_0x62bb('0xed')));_0x584727[_0x62bb('0x9')]('/api/voice/prefixes',require(_0x62bb('0xee')));_0x584727[_0x62bb('0x9')]('/api/userProfiles',require('./api/userProfile'));_0x584727[_0x62bb('0x9')](_0x62bb('0xef'),require(_0x62bb('0xf0')));_0x584727[_0x62bb('0x9')](_0x62bb('0xf1'),require(_0x62bb('0xf2')));_0x584727[_0x62bb('0x9')](_0x62bb('0xf3'),require(_0x62bb('0xf4')));_0x584727[_0x62bb('0x9')](_0x62bb('0xf5'),require('./api/whatsappAccount'));_0x584727[_0x62bb('0x9')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x584727[_0x62bb('0x9')]('/api/whatsapp/interactions',require(_0x62bb('0xf6')));_0x584727['use'](_0x62bb('0xf7'),require(_0x62bb('0xf8')));_0x584727[_0x62bb('0x9')](_0x62bb('0xf9'),require(_0x62bb('0xfa')));_0x584727[_0x62bb('0x9')](_0x62bb('0xfb'),require(_0x62bb('0xfc')));_0x584727[_0x62bb('0x9')](_0x62bb('0xfd'),require(_0x62bb('0xfe')));_0x584727[_0x62bb('0x9')]('/api/cloudProviders',require(_0x62bb('0xff')));_0x584727[_0x62bb('0x9')](_0x62bb('0x100'),require('./api/realtime'));_0x584727[_0x62bb('0x9')](_0x62bb('0x101'),require(_0x62bb('0x102')));_0x584727['use'](_0x62bb('0x103'),require(_0x62bb('0x104')));_0x584727[_0x62bb('0x9')](_0x62bb('0x105'),require(_0x62bb('0x106')));_0x584727['use'](_0x62bb('0x107'),require(_0x62bb('0x108')));_0x584727[_0x62bb('0x9')]('/api/rpc',require(_0x62bb('0x109')));_0x584727['use'](_0x62bb('0x10a'),require(_0x62bb('0x10b')));_0x584727[_0x62bb('0x9')](_0x62bb('0x10c'),require('./api/system'));_0x584727[_0x62bb('0x9')](_0x62bb('0x10d'),require(_0x62bb('0x10e')));_0x584727[_0x62bb('0x9')]('/api/webbar',require(_0x62bb('0x10f')));_0x584727[_0x62bb('0x9')]('/apidoc',express[_0x62bb('0x110')](path[_0x62bb('0x111')](config[_0x62bb('0x112')],_0x62bb('0x113'))));_0x584727[_0x62bb('0x9')](_0x62bb('0x114'),express[_0x62bb('0x110')](path[_0x62bb('0x111')](config['root'],_0x62bb('0x114'))));_0x584727[_0x62bb('0x9')](_0x62bb('0x115'),express['static'](path[_0x62bb('0x111')](config[_0x62bb('0x112')],_0x62bb('0x115'))));_0x584727['use'](_0x62bb('0x116'),express[_0x62bb('0x110')](path['join'](config[_0x62bb('0x112')],'snippet',_0x62bb('0x117'))));_0x584727[_0x62bb('0x9')](_0x62bb('0x118'),express[_0x62bb('0x110')](path[_0x62bb('0x111')](config['root'],_0x62bb('0x119'))));_0x584727[_0x62bb('0x11a')](_0x62bb('0x11b'))[_0x62bb('0x11c')](errors[0x194]);_0x584727['route']('/*')[_0x62bb('0x11c')](function(_0x42e7c1,_0x351571){_0x351571[_0x62bb('0x11d')](path[_0x62bb('0x11e')](_0x584727[_0x62bb('0x11c')]('appPath')+_0x62bb('0x11f')));});};var sensitiveFields=[_0x62bb('0x120'),_0x62bb('0x121'),'newPassword',_0x62bb('0x122'),_0x62bb('0x123'),_0x62bb('0x124'),'street','phone',_0x62bb('0x125'),_0x62bb('0x126'),_0x62bb('0x127'),_0x62bb('0x128'),'clientSecret',_0x62bb('0x129'),_0x62bb('0x12a'),'accessKey',_0x62bb('0x12b'),_0x62bb('0x12c'),_0x62bb('0x12d'),'accessToken',_0x62bb('0x12e'),'authToken','consumerKey',_0x62bb('0x12f'),_0x62bb('0x130'),_0x62bb('0x131'),_0x62bb('0x132'),_0x62bb('0x133'),_0x62bb('0x134'),_0x62bb('0x135'),_0x62bb('0x136'),_0x62bb('0x137'),_0x62bb('0x138'),_0x62bb('0x139'),_0x62bb('0x15'),_0x62bb('0x13a'),_0x62bb('0x13b'),_0x62bb('0x13c'),_0x62bb('0x13d'),_0x62bb('0x13e'),'registry','oldPassword'];function maskSensitiveData(_0x3aefca){var _0x322dd6=/(?!^)[\s\S](?!$)/g;if(!_[_0x62bb('0x13f')](_0x3aefca))return;for(var _0x364758 in _0x3aefca){if(_[_0x62bb('0x140')](_0x3aefca[_0x364758])){for(var _0x372228=0x0;_0x372228<_0x3aefca[_0x364758][_0x62bb('0x141')];_0x372228++){maskSensitiveData(_0x3aefca[_0x364758][_0x372228]);}}else if(_[_0x62bb('0x13f')](_0x3aefca[_0x364758])){maskSensitiveData(_0x3aefca[_0x364758]);}else if(_[_0x62bb('0x142')](_0x3aefca[_0x364758])){_0x3aefca[_0x364758]=_0x3aefca[_0x364758]['replace'](/{{{/g,_0x62bb('0x143'))[_0x62bb('0x144')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0x62bb('0x144')](/}}/g,'}@');if(_[_0x62bb('0x145')](sensitiveFields,_0x364758)){_0x3aefca[_0x364758]=_0x3aefca[_0x364758][_0x62bb('0x144')](_0x322dd6,'*');}}}} \ No newline at end of file +var _0x9b12=['./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','3.0.0','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','/index.html','username','apiKey','lastName','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','accessToken','accessTokenSecret','consumerSecret','membername','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','lodash','path','express-winston','./errors','api','./config/logger','auth','./safe-template','safeTemplate','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','device','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','./api/integration','./api/integrationReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts'];(function(_0x53f019,_0x1dbc2e){var _0x42f8f6=function(_0x79dc65){while(--_0x79dc65){_0x53f019['push'](_0x53f019['shift']());}};_0x42f8f6(++_0x1dbc2e);}(_0x9b12,0x83));var _0x29b1=function(_0x46d55e,_0x1145cd){_0x46d55e=_0x46d55e-0x0;var _0x3b9597=_0x9b12[_0x46d55e];return _0x3b9597;};'use strict';var _=require(_0x29b1('0x0'));var path=require(_0x29b1('0x1'));var express=require('express');var ewinston=require(_0x29b1('0x2'));var util=require('util');var errors=require(_0x29b1('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0x29b1('0x4'));var authLogger=require(_0x29b1('0x5'))(_0x29b1('0x6'));var safeTemplate=require(_0x29b1('0x7'))[_0x29b1('0x8')];exports[_0x29b1('0x9')]=function(_0x5085e6){_0x5085e6[_0x29b1('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x21dbee,_0x296b84){var _0x22be68=_0x29b1('0xb');if(!_[_0x29b1('0xc')](_0x21dbee[_0x29b1('0xd')])){_0x22be68+=_0x29b1('0xe');var _0x4b4000=_0x21dbee[_0x29b1('0xd')];maskSensitiveData(_0x4b4000);}return safeTemplate(util[_0x29b1('0xf')](_0x22be68,_0x21dbee[_0x29b1('0x10')],_0x21dbee['headers']['x-forwarded-for']?_0x21dbee['headers']['x-forwarded-for']:_0x21dbee[_0x29b1('0x11')][_0x29b1('0x12')]||_0x21dbee['ip'],_0x21dbee[_0x29b1('0x13')],_0x296b84[_0x29b1('0x14')],_0x296b84[_0x29b1('0x15')],_0x21dbee[_0x29b1('0x16')]?_0x21dbee['user']['id']:null,_0x21dbee[_0x29b1('0x16')]?_0x21dbee['user'][_0x29b1('0x17')]:null,_0x21dbee['user']?_0x21dbee[_0x29b1('0x16')][_0x29b1('0x18')]:null,_0x4b4000?util[_0x29b1('0x19')](_0x4b4000,![],null):''));}}));_0x5085e6[_0x29b1('0xa')](ewinston[_0x29b1('0x1a')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x559e67,_0x45d685){var _0x181f7c=_0x29b1('0x1b');if(_0x559e67[_0x29b1('0xd')]&&_0x559e67[_0x29b1('0xd')]['device']&&_0x559e67[_0x29b1('0xd')][_0x29b1('0x1c')]){_0x181f7c=_0x29b1('0x1d');}return util['format'](_0x181f7c,_0x559e67[_0x29b1('0x10')],_0x559e67['headers'][_0x29b1('0x1e')]?_0x559e67['headers']['x-forwarded-for']:_0x559e67[_0x29b1('0x11')][_0x29b1('0x12')]||_0x559e67['ip'],_0x559e67[_0x29b1('0x13')],_0x45d685[_0x29b1('0x14')],_0x45d685['responseTime'],_0x559e67['user']?_0x559e67[_0x29b1('0x16')]['id']:null,_0x559e67[_0x29b1('0x16')]?_0x559e67['user'][_0x29b1('0x17')]:null,_0x559e67[_0x29b1('0x16')]?_0x559e67[_0x29b1('0x16')][_0x29b1('0x18')]:null,_0x559e67[_0x29b1('0xd')]&&_0x559e67[_0x29b1('0xd')][_0x29b1('0x1f')]?_0x559e67['body'][_0x29b1('0x1f')]:_0x29b1('0x20'),_0x559e67[_0x29b1('0xd')]&&_0x559e67[_0x29b1('0xd')]['agent_id']?_0x559e67['body'][_0x29b1('0x1c')]:'',_0x559e67[_0x29b1('0xd')]&&_0x559e67[_0x29b1('0xd')][_0x29b1('0x21')]?_0x559e67[_0x29b1('0xd')][_0x29b1('0x21')]:'');},'ignoreRoute':function(_0x1c4b0a){var _0x2b72a8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2b72a8[_0x29b1('0x22')](_0x1c4b0a[_0x29b1('0x13')]);}}));_0x5085e6[_0x29b1('0xa')]('/api/users',require(_0x29b1('0x23')));_0x5085e6['use'](_0x29b1('0x24'),require(_0x29b1('0x25')));_0x5085e6['use'](_0x29b1('0x26'),require('./api/voiceContext'));_0x5085e6['use'](_0x29b1('0x27'),require('./api/voiceExtension'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x28'),require(_0x29b1('0x29')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x2a'),require(_0x29b1('0x2b')));_0x5085e6['use'](_0x29b1('0x2c'),require(_0x29b1('0x2d')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x2e'),require('./api/screenRecording'));_0x5085e6[_0x29b1('0xa')]('/api/voice/mails',require('./api/voiceMail'));_0x5085e6[_0x29b1('0xa')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x5085e6[_0x29b1('0xa')]('/api/voice/calls/reports',require(_0x29b1('0x2f')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x30'),require('./api/voiceDialReport'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x31'),require(_0x29b1('0x32')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x33'),require(_0x29b1('0x34')));_0x5085e6[_0x29b1('0xa')]('/api/members/reports',require('./api/memberReport'));_0x5085e6['use'](_0x29b1('0x35'),require(_0x29b1('0x36')));_0x5085e6['use'](_0x29b1('0x37'),require(_0x29b1('0x38')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x39'),require(_0x29b1('0x3a')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x3b'),require(_0x29b1('0x3c')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x3d'),require(_0x29b1('0x3e')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x3f'),require('./api/mailSubstatus'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x40'),require(_0x29b1('0x41')));_0x5085e6[_0x29b1('0xa')]('/api/mail/messages',require('./api/mailMessage'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x42'),require(_0x29b1('0x43')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x44'),require(_0x29b1('0x45')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x46'),require(_0x29b1('0x47')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x48'),require(_0x29b1('0x49')));_0x5085e6[_0x29b1('0xa')]('/api/fax/accounts',require('./api/faxAccount'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x4a'),require(_0x29b1('0x4b')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x4c'),require('./api/faxInteraction'));_0x5085e6['use'](_0x29b1('0x4d'),require(_0x29b1('0x4e')));_0x5085e6['use'](_0x29b1('0x4f'),require(_0x29b1('0x50')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x51'),require(_0x29b1('0x52')));_0x5085e6[_0x29b1('0xa')]('/api/sms/accounts',require(_0x29b1('0x53')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x54'),require(_0x29b1('0x55')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x56'),require(_0x29b1('0x57')));_0x5085e6[_0x29b1('0xa')]('/api/sms/messages',require(_0x29b1('0x58')));_0x5085e6['use'](_0x29b1('0x59'),require(_0x29b1('0x5a')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x5b'),require('./api/openchannelAccount'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x5c'),require(_0x29b1('0x5d')));_0x5085e6[_0x29b1('0xa')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x5e'),require(_0x29b1('0x5f')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x60'),require(_0x29b1('0x61')));_0x5085e6[_0x29b1('0xa')]('/api/chat/websites',require(_0x29b1('0x62')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x63'),require('./api/openchannelQueueReport'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x64'),require(_0x29b1('0x65')));_0x5085e6['use']('/api/chat/interactions',require(_0x29b1('0x66')));_0x5085e6['use'](_0x29b1('0x67'),require('./api/chatMessage'));_0x5085e6[_0x29b1('0xa')]('/api/chat/offline_messages',require(_0x29b1('0x68')));_0x5085e6[_0x29b1('0xa')]('/api/chat/queues',require(_0x29b1('0x69')));_0x5085e6['use'](_0x29b1('0x6a'),require(_0x29b1('0x6b')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x6c'),require(_0x29b1('0x6d')));_0x5085e6[_0x29b1('0xa')]('/api/cm/companies',require(_0x29b1('0x6e')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x6f'),require(_0x29b1('0x70')));_0x5085e6[_0x29b1('0xa')]('/api/cm/hopper',require('./api/cmHopper'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x71'),require(_0x29b1('0x72')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x73'),require(_0x29b1('0x74')));_0x5085e6['use'](_0x29b1('0x75'),require(_0x29b1('0x76')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x77'),require(_0x29b1('0x78')));_0x5085e6['use'](_0x29b1('0x79'),require(_0x29b1('0x7a')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x7b'),require(_0x29b1('0x7c')));_0x5085e6['use']('/api/canned_answers',require(_0x29b1('0x7d')));_0x5085e6['use'](_0x29b1('0x7e'),require(_0x29b1('0x7f')));_0x5085e6[_0x29b1('0xa')]('/api/conditions',require(_0x29b1('0x80')));_0x5085e6['use'](_0x29b1('0x81'),require(_0x29b1('0x82')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x83'),require(_0x29b1('0x84')));_0x5085e6[_0x29b1('0xa')]('/api/cdr',require(_0x29b1('0x85')));_0x5085e6[_0x29b1('0xa')]('/api/voiceQueuesLog',require(_0x29b1('0x86')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x87'),require(_0x29b1('0x88')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x89'),require(_0x29b1('0x8a')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x8b'),require('./api/tag'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x8c'),require(_0x29b1('0x8d')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x8e'),require('./api/trigger'));_0x5085e6[_0x29b1('0xa')]('/api/variables',require(_0x29b1('0x8f')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x90'),require(_0x29b1('0x91')));_0x5085e6[_0x29b1('0xa')]('/api/integrations/reports',require(_0x29b1('0x92')));_0x5085e6['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x5085e6[_0x29b1('0xa')]('/api/analytics/default_reports',require(_0x29b1('0x93')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x94'),require(_0x29b1('0x95')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x96'),require('./api/analyticMetric'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x97'),require(_0x29b1('0x98')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x99'),require(_0x29b1('0x9a')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x9b'),require(_0x29b1('0x9c')));_0x5085e6[_0x29b1('0xa')]('/api/integrations/salesforce/configurations',require(_0x29b1('0x9d')));_0x5085e6['use']('/api/integrations/salesforce/fields',require(_0x29b1('0x9e')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x9f'),require(_0x29b1('0xa0')));_0x5085e6['use'](_0x29b1('0xa1'),require('./api/intSugarcrmConfiguration'));_0x5085e6[_0x29b1('0xa')]('/api/integrations/sugarcrm/fields',require(_0x29b1('0xa2')));_0x5085e6['use'](_0x29b1('0xa3'),require(_0x29b1('0xa4')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xa5'),require(_0x29b1('0xa6')));_0x5085e6[_0x29b1('0xa')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xa7'),require('./api/intZohoAccount'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xa8'),require('./api/intZohoConfiguration'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xa9'),require('./api/intZohoField'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xaa'),require(_0x29b1('0xab')));_0x5085e6['use'](_0x29b1('0xac'),require(_0x29b1('0xad')));_0x5085e6[_0x29b1('0xa')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x5085e6['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x5085e6[_0x29b1('0xa')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xae'),require('./api/intFreshdeskField'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xaf'),require(_0x29b1('0xb0')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xb1'),require('./api/intVtigerConfiguration'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xb2'),require(_0x29b1('0xb3')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xb4'),require('./api/intServicenowAccount'));_0x5085e6[_0x29b1('0xa')]('/api/integrations/servicenow/configurations',require(_0x29b1('0xb5')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xb6'),require(_0x29b1('0xb7')));_0x5085e6['use'](_0x29b1('0xb8'),require(_0x29b1('0xb9')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xba'),require(_0x29b1('0xbb')));_0x5085e6[_0x29b1('0xa')]('/api/integrations/dynamics365/fields',require(_0x29b1('0xbc')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xbd'),require(_0x29b1('0xbe')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xbf'),require('./api/intFreshsalesConfiguration'));_0x5085e6['use'](_0x29b1('0xc0'),require(_0x29b1('0xc1')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xc2'),require('./api/network'));_0x5085e6['use'](_0x29b1('0xc3'),require(_0x29b1('0xc4')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xc5'),require(_0x29b1('0xc6')));_0x5085e6['use'](_0x29b1('0xc7'),require('./api/jscriptyAnswerReport'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xc8'),require(_0x29b1('0xc9')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xca'),require('./api/jscriptySessionReport'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xcb'),require(_0x29b1('0xcc')));_0x5085e6['use'](_0x29b1('0xcd'),require(_0x29b1('0xce')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xcf'),require('./api/squareReportDetail'));_0x5085e6[_0x29b1('0xa')]('/api/jscripty/projects',require(_0x29b1('0xd0')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xd1'),require('./api/setting'));_0x5085e6['use'](_0x29b1('0xd2'),require(_0x29b1('0xd3')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xd4'),require(_0x29b1('0xd5')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xd6'),require(_0x29b1('0xd7')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xd8'),require(_0x29b1('0xd9')));_0x5085e6['use'](_0x29b1('0xda'),require(_0x29b1('0xdb')));_0x5085e6['use'](_0x29b1('0xdc'),require('./api/license'));_0x5085e6[_0x29b1('0xa')]('/api/campaigns',require(_0x29b1('0xdd')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xde'),require(_0x29b1('0xdf')));_0x5085e6['use'](_0x29b1('0xe0'),require(_0x29b1('0xe1')));_0x5085e6[_0x29b1('0xa')]('/api/plugins',require('./api/plugin'));_0x5085e6[_0x29b1('0xa')]('/api/mail/reports/transfer',require(_0x29b1('0xe2')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xe3'),require(_0x29b1('0xe4')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xe5'),require('./api/faxTransferReport'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xe6'),require(_0x29b1('0xe7')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xe8'),require(_0x29b1('0xe9')));_0x5085e6['use']('/api/cm/lists',require(_0x29b1('0xea')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xeb'),require(_0x29b1('0xec')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xed'),require(_0x29b1('0xee')));_0x5085e6['use'](_0x29b1('0xef'),require(_0x29b1('0xf0')));_0x5085e6[_0x29b1('0xa')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xf1'),require('./api/userNotification'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xf2'),require('./api/whatsappAccount'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xf3'),require(_0x29b1('0xf4')));_0x5085e6['use']('/api/whatsapp/interactions',require(_0x29b1('0xf5')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xf6'),require(_0x29b1('0xf7')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xf8'),require(_0x29b1('0xf9')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xfa'),require('./api/whatsappTransferReport'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xfb'),require(_0x29b1('0xfc')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0xfd'),require('./api/cloudProvider'));_0x5085e6['use'](_0x29b1('0xfe'),require(_0x29b1('0xff')));_0x5085e6[_0x29b1('0xa')]('/api/auth/local',require(_0x29b1('0x100')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x101'),require('./api/authGoogle'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x102'),require(_0x29b1('0x103')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x104'),require(_0x29b1('0x105')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x106'),require('./api/rpc'));_0x5085e6[_0x29b1('0xa')]('/api/version',require('./api/version'));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x107'),require(_0x29b1('0x108')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x109'),require(_0x29b1('0x10a')));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x10b'),require('./api/webbar'));_0x5085e6[_0x29b1('0xa')]('/apidoc',express[_0x29b1('0x10c')](path[_0x29b1('0x10d')](config[_0x29b1('0x10e')],_0x29b1('0x10f'))));_0x5085e6['use']('/www',express[_0x29b1('0x10c')](path[_0x29b1('0x10d')](config[_0x29b1('0x10e')],_0x29b1('0x110'))));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x111'),express['static'](path[_0x29b1('0x10d')](config[_0x29b1('0x10e')],_0x29b1('0x111'))));_0x5085e6[_0x29b1('0xa')](_0x29b1('0x112'),express[_0x29b1('0x10c')](path[_0x29b1('0x10d')](config[_0x29b1('0x10e')],'snippet',_0x29b1('0x113'))));_0x5085e6['use'](_0x29b1('0x114'),express[_0x29b1('0x10c')](path[_0x29b1('0x10d')](config[_0x29b1('0x10e')],'/server/files/plugins')));_0x5085e6['route'](_0x29b1('0x115'))[_0x29b1('0x116')](errors[0x194]);_0x5085e6[_0x29b1('0x117')]('/*')[_0x29b1('0x116')](function(_0x388a26,_0x5658e7){_0x5658e7['sendFile'](path[_0x29b1('0x118')](_0x5085e6[_0x29b1('0x116')]('appPath')+_0x29b1('0x119')));});};var sensitiveFields=[_0x29b1('0x11a'),'password','newPassword',_0x29b1('0x11b'),'firstName',_0x29b1('0x11c'),'street',_0x29b1('0x11d'),'mobile',_0x29b1('0x11e'),_0x29b1('0x11f'),_0x29b1('0x120'),_0x29b1('0x121'),_0x29b1('0x122'),_0x29b1('0x123'),_0x29b1('0x124'),'tenantId','token','channelSecret',_0x29b1('0x125'),_0x29b1('0x126'),'authToken','consumerKey',_0x29b1('0x127'),_0x29b1('0x128'),'calleridname',_0x29b1('0x129'),_0x29b1('0x12a'),_0x29b1('0x12b'),_0x29b1('0x12c'),_0x29b1('0x12d'),_0x29b1('0x12e'),_0x29b1('0x12f'),_0x29b1('0x130'),_0x29b1('0x16'),_0x29b1('0x131'),'accountSid',_0x29b1('0x132'),_0x29b1('0x133'),_0x29b1('0x134'),'registry',_0x29b1('0x135')];function maskSensitiveData(_0x44579b){var _0x465d44=/(?!^)[\s\S](?!$)/g;if(!_[_0x29b1('0x136')](_0x44579b))return;for(var _0x2ad221 in _0x44579b){if(_[_0x29b1('0x137')](_0x44579b[_0x2ad221])){for(var _0x85abca=0x0;_0x85abca<_0x44579b[_0x2ad221][_0x29b1('0x138')];_0x85abca++){maskSensitiveData(_0x44579b[_0x2ad221][_0x85abca]);}}else if(_[_0x29b1('0x136')](_0x44579b[_0x2ad221])){maskSensitiveData(_0x44579b[_0x2ad221]);}else if(_[_0x29b1('0x139')](_0x44579b[_0x2ad221])){_0x44579b[_0x2ad221]=_0x44579b[_0x2ad221][_0x29b1('0x13a')](/{{{/g,_0x29b1('0x13b'))[_0x29b1('0x13a')](/}}}/g,'}@@')[_0x29b1('0x13a')](/{{/g,'@{')[_0x29b1('0x13a')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x2ad221)){_0x44579b[_0x2ad221]=_0x44579b[_0x2ad221][_0x29b1('0x13a')](_0x465d44,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ea66080..e92b358 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07e4=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc'];(function(_0x59643e,_0x4aec3f){var _0x45b64f=function(_0x272069){while(--_0x272069){_0x59643e['push'](_0x59643e['shift']());}};_0x45b64f(++_0x4aec3f);}(_0x07e4,0x70));var _0x407e=function(_0x59ad0c,_0x461a19){_0x59ad0c=_0x59ad0c-0x0;var _0x478043=_0x07e4[_0x59ad0c];return _0x478043;};'use strict';var jayson=require(_0x407e('0x0'));var BPromise=require(_0x407e('0x1'));var _=require(_0x407e('0x2'));var config=require(_0x407e('0x3'));exports['listen']=function(){return new BPromise(function(_0x182894,_0x54a1fb){var _0x2d7fbe={};_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x5')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x6')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x7')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x8')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x9')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0xa')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0xb')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0xc')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0xd')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0xe')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0xf')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x10')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/mailServerIn/mailServerIn.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/mailAccount/mailAccount.rpc'));_0x2d7fbe=_['merge'](_0x2d7fbe,require('../api/mailQueue/mailQueue.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x11')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x12')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x13')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x14')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x15')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/faxApplication/faxApplication.rpc'));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x16')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x17')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x18')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x19')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x1a')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x1b')));_0x2d7fbe=_['merge'](_0x2d7fbe,require('../api/smsMessage/smsMessage.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x1c')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x1d')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x1e')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x1f')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x20')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/chatInteraction/chatInteraction.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/chatMessage/chatMessage.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x21')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x22')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x23')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x24')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x25')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x26')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x27')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x28')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x29')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/template/template.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x2a')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x2b')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x2c')));_0x2d7fbe=_['merge'](_0x2d7fbe,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x2d')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x2e')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x2f')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x30')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x31')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x32')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x33')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x34')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x35')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x36')));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x37')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x38')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x39')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/campaign/campaign.rpc'));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x3a')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x3b')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require(_0x407e('0x3c')));_0x2d7fbe=_['merge'](_0x2d7fbe,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x2d7fbe=_['merge'](_0x2d7fbe,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x2d7fbe=_['merge'](_0x2d7fbe,require(_0x407e('0x3d')));_0x2d7fbe=_[_0x407e('0x4')](_0x2d7fbe,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x96cff=jayson[_0x407e('0x3e')](_0x2d7fbe)['http']();var _0x5bcd72=config[_0x407e('0x3f')]['port']||config[_0x407e('0x40')]+0x1;var _0xa92bee=config[_0x407e('0x3f')]['ip']||_0x407e('0x41');_0x96cff['on'](_0x407e('0x42'),function(_0x1323ae){return _0x54a1fb(_0x1323ae);});_0x96cff[_0x407e('0x43')](_0x5bcd72,_0xa92bee,function(){console['log'](_0x407e('0x44'),_0xa92bee,_0x5bcd72);require('../config/triggers')[_0x407e('0x45')]();return _0x182894(_0x407e('0x46')+_0xa92bee+':'+_0x5bcd72);});});}; \ No newline at end of file +var _0x59fc=['log','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.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','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost'];(function(_0xb1174e,_0x1e68a7){var _0x285bac=function(_0x32c505){while(--_0x32c505){_0xb1174e['push'](_0xb1174e['shift']());}};_0x285bac(++_0x1e68a7);}(_0x59fc,0xd5));var _0xc59f=function(_0x112b2e,_0x547aee){_0x112b2e=_0x112b2e-0x0;var _0xf0eff2=_0x59fc[_0x112b2e];return _0xf0eff2;};'use strict';var jayson=require(_0xc59f('0x0'));var BPromise=require('bluebird');var _=require(_0xc59f('0x1'));var config=require(_0xc59f('0x2'));exports[_0xc59f('0x3')]=function(){return new BPromise(function(_0x5b39dd,_0x5582c1){var _0x55f049={};_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x5')));_0x55f049=_['merge'](_0x55f049,require('../api/voiceExtension/voiceExtension.rpc'));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x6')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x7')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x8')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x9')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0xa')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0xb')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/trunk/trunk.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0xc')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0xd')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/mailAccount/mailAccount.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0xe')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0xf')));_0x55f049=_['merge'](_0x55f049,require('../api/mailMessage/mailMessage.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x10')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/faxAccount/faxAccount.rpc'));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x11')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/faxInteraction/faxInteraction.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x12')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x13')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x14')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x15')));_0x55f049=_['merge'](_0x55f049,require('../api/smsInteraction/smsInteraction.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x16')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x17')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x18')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x19')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x1a')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x1b')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x1c')));_0x55f049=_['merge'](_0x55f049,require('../api/chatInteraction/chatInteraction.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x1d')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x1e')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x1f')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x20')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x21')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x22')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x23')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/interval/interval.rpc'));_0x55f049=_['merge'](_0x55f049,require('../api/pause/pause.rpc'));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x24')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/template/template.rpc'));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x25')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x26')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x27')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x28')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x29')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x2a')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x2b')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x2c')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x2d')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x2e')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x2f')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x30')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x31')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x32')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/squareReport/squareReport.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x33')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x34')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/squareOdbc/squareOdbc.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x35')));_0x55f049=_['merge'](_0x55f049,require('../api/squareRecording/squareRecording.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x36')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require('../api/campaign/campaign.rpc'));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x37')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x38')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x39')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x3a')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x3b')));_0x55f049=_['merge'](_0x55f049,require(_0xc59f('0x3c')));_0x55f049=_[_0xc59f('0x4')](_0x55f049,require(_0xc59f('0x3d')));var _0x495270=jayson[_0xc59f('0x3e')](_0x55f049)[_0xc59f('0x3f')]();var _0x13f3d9=config[_0xc59f('0x40')][_0xc59f('0x41')]||config[_0xc59f('0x41')]+0x1;var _0x5720c5=config[_0xc59f('0x40')]['ip']||_0xc59f('0x42');_0x495270['on']('error',function(_0x2de5d6){return _0x5582c1(_0x2de5d6);});_0x495270[_0xc59f('0x3')](_0x13f3d9,_0x5720c5,function(){console[_0xc59f('0x43')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5720c5,_0x13f3d9);require('../config/triggers')[_0xc59f('0x44')]();return _0x5b39dd(_0xc59f('0x45')+_0x5720c5+':'+_0x13f3d9);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index ad1f09b..b868856 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','string'];(function(_0x536d4c,_0x234555){var _0x29d0f2=function(_0x3b8915){while(--_0x3b8915){_0x536d4c['push'](_0x536d4c['shift']());}};_0x29d0f2(++_0x234555);}(_0x5c00,0x17e));var _0x05c0=function(_0x2918cb,_0x5ce880){_0x2918cb=_0x2918cb-0x0;var _0x4c5d63=_0x5c00[_0x2918cb];return _0x4c5d63;};var _=require(_0x05c0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x7f1364){return _0x7f1364==='{{'?_0x05c0('0x1'):'\x20}\x20}';}function safeTemplate(_0x1e76da){var _0x5859bc=_0x1e76da;if(typeof _0x1e76da===_0x05c0('0x2')){_0x5859bc=_0x1e76da[_0x05c0('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x05c0('0x4')](_0x1e76da)){_0x5859bc=_0x1e76da[_0x05c0('0x5')](function(_0x565efc){return safeTemplate(_0x565efc);});}else if(_[_0x05c0('0x6')](_0x1e76da)){_0x5859bc=Object[_0x05c0('0x7')](_0x1e76da)[_0x05c0('0x8')](function(_0x27dc10,_0x5b9f09){_0x27dc10[_0x5b9f09]=safeTemplate(_0x1e76da[_0x5b9f09]);return _0x27dc10;},{});}return _0x5859bc;}module[_0x05c0('0x9')][_0x05c0('0xa')]=safeTemplate; \ No newline at end of file +var _0x4fc2=['reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map','keys'];(function(_0x3e2040,_0x660381){var _0x38e3ec=function(_0x2e61bd){while(--_0x2e61bd){_0x3e2040['push'](_0x3e2040['shift']());}};_0x38e3ec(++_0x660381);}(_0x4fc2,0x111));var _0x24fc=function(_0x30c30d,_0x11af19){_0x30c30d=_0x30c30d-0x0;var _0x148de0=_0x4fc2[_0x30c30d];return _0x148de0;};var _=require(_0x24fc('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b05a5){return _0x2b05a5==='{{'?_0x24fc('0x1'):_0x24fc('0x2');}function safeTemplate(_0x5aaa74){var _0x365c56=_0x5aaa74;if(typeof _0x5aaa74===_0x24fc('0x3')){_0x365c56=_0x5aaa74[_0x24fc('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x5aaa74)){_0x365c56=_0x5aaa74[_0x24fc('0x5')](function(_0x3772eb){return safeTemplate(_0x3772eb);});}else if(_['isPlainObject'](_0x5aaa74)){_0x365c56=Object[_0x24fc('0x6')](_0x5aaa74)[_0x24fc('0x7')](function(_0x4889f4,_0x115851){_0x4889f4[_0x115851]=safeTemplate(_0x5aaa74[_0x115851]);return _0x4889f4;},{});}return _0x365c56;}module[_0x24fc('0x8')][_0x24fc('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3ea28c3..3a93f77 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 _0xe0c1=['length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','sendRequest','sync','answer','ANSWER','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split'];(function(_0x56608c,_0x29eb74){var _0x3c7fb0=function(_0x154b1c){while(--_0x154b1c){_0x56608c['push'](_0x56608c['shift']());}};_0x3c7fb0(++_0x29eb74);}(_0xe0c1,0x175));var _0x1e0c=function(_0xc0bb14,_0x285b3d){_0xc0bb14=_0xc0bb14-0x0;var _0x212e60=_0xe0c1[_0xc0bb14];return _0x212e60;};'use strict';var util=require(_0x1e0c('0x0'));var _=require(_0x1e0c('0x1'));var EventEmitter=require(_0x1e0c('0x2'))[_0x1e0c('0x3')];var AGIReply=require(_0x1e0c('0x4'));var AGIError=require(_0x1e0c('0x5'));function AGIChannel(_0x3d207c){var _0x1f3e8f=this,_0x3798cb=new AGIReply(),_0x41fd7a=![],_0x5403e3={};EventEmitter[_0x1e0c('0x6')](_0x1f3e8f);_0x3d207c['setEncoding'](_0x1e0c('0x7'));_0x3d207c[_0x1e0c('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3798cb[_0x1e0c('0x9')]('utf8');_0x3798cb['on']('headers',function(_0x34d053){for(var _0x59a6aa in _0x34d053){_0x1f3e8f[_0x59a6aa]=_0x34d053[_0x59a6aa];}_0x1f3e8f[_0x1e0c('0xa')](_0x1e0c('0xb'));});_0x3798cb['on'](_0x1e0c('0xc'),function(_0x6b7042){if(_0x6b7042[_0x1e0c('0xd')]()==_0x1e0c('0xe')){_0x1f3e8f[_0x1e0c('0xa')]('hangup');return;}if(_0x6b7042[_0x1e0c('0xf')](0x0,0xb)==_0x1e0c('0x10')){_0x41fd7a=!![];}if(_0x41fd7a){_0x5403e3['rx']+=_0x6b7042+'\x0a';if(_0x6b7042[_0x1e0c('0x11')](_0x1e0c('0x12'))!=-0x1){_0x41fd7a=![];}}else{_0x5403e3['rx']=_0x6b7042;}if(_0x41fd7a){return;}if(typeof _0x5403e3['cb']==_0x1e0c('0x13')){var _0x55b085=_0x5403e3['rx'][_0x1e0c('0xf')](0x0,0x3),_0x45869e=null,_0x2925ae=null;_0x55b085=parseInt(_0x55b085);if(isNaN(_0x55b085)){_0x5403e3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1e0c('0x14')});return;}if(_0x55b085!=0xc8){_0x5403e3['cb'](null,{'code':_0x55b085,'result':-0x1,'extra':'KO'});return;}_0x45869e=_0x5403e3['rx'][_0x1e0c('0xf')](0x4)[_0x1e0c('0x15')](_0x1e0c('0x16'),'');if(_0x45869e[_0x1e0c('0x17')]('\x20')!=-0x1){_0x45869e=_0x45869e[_0x1e0c('0x18')](0x0,_0x45869e[_0x1e0c('0x17')]('\x20'));}if(_[_0x1e0c('0x19')](_0x45869e,'-1')){_0x45869e=parseInt(_0x45869e);}_0x2925ae=_0x5403e3['rx'][_0x1e0c('0x1a')]('\x20');if(_0x2925ae[_0x1e0c('0x1b')]==0x3){_0x2925ae=_0x2925ae[0x2][_0x1e0c('0xf')](0x1,_0x2925ae[0x2]['length']-0x1);}else if(_0x2925ae[_0x1e0c('0x1b')]>0x3){var _0x1b23bf=/\((.+)\)/;var _0x411bc4=_0x5403e3['rx']['match'](_0x1b23bf);if(_0x411bc4){_0x2925ae=_0x411bc4[0x1];}else{_0x2925ae=null;}}else{_0x2925ae=null;}_0x5403e3['cb'](null,{'code':_0x55b085,'result':_0x45869e,'extra':_0x2925ae});}});_0x3d207c['on'](_0x1e0c('0x1c'),function(_0x5eb11f){_0x1f3e8f[_0x1e0c('0xa')]('error',new AGIError(_0x1e0c('0x1d'),_0x5eb11f[_0x1e0c('0x1e')]));});_0x3d207c['on']('close',function(){_0x1f3e8f['emit'](_0x1e0c('0x1f'),new AGIError(_0x1e0c('0x20')));});_0x3d207c['on'](_0x1e0c('0x21'),function(){_0x1f3e8f[_0x1e0c('0xa')](_0x1e0c('0x21'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3d207c[_0x1e0c('0x22')]();});_0x3d207c[_0x1e0c('0x23')](_0x3798cb);this[_0x1e0c('0x24')]=function(_0x2be845,_0x256250){var _0x2be845=_0x2be845||'',_0x256250=typeof _0x256250==_0x1e0c('0x13')?_0x256250:new Function();_0x5403e3={'tx':_0x2be845,'rx':'','cb':_0x256250};_0x3d207c[_0x1e0c('0x25')](_0x2be845+'\x0a');},this['close']=function(){_0x3d207c[_0x1e0c('0x22')]();};}util[_0x1e0c('0x26')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x1e0c('0x27')]=function(_0xc09979){return this[_0x1e0c('0x24')][_0x1e0c('0x28')](this,_0xc09979);};AGIChannel['prototype'][_0x1e0c('0x29')]=function(){return this[_0x1e0c('0x27')](_0x1e0c('0x2a'));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x2c')]=function(_0x148e02,_0x54d498,_0xb91155){_0x148e02=_0x148e02===undefined?_0x1e0c('0x2d'):_0x148e02;_0x54d498=_0x54d498===undefined?'5':_0x54d498;_0xb91155=_0xb91155===undefined?'1':_0xb91155;return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x2f'),_0x148e02,_0x54d498*0x3e8,_0xb91155));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x30')]=function(_0x396fda){_0x396fda=_0x396fda||'NO\x20MESSAGE';return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x31'),_0x396fda));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x32')]=function(_0x2edfa8,_0x3f9ec9){if(_[_0x1e0c('0x33')](_0x3f9ec9)){return this['sendRequest'](util[_0x1e0c('0x2e')]('EXEC\x20%s\x20%s',_0x2edfa8,_0x3f9ec9[_0x1e0c('0x34')](',')));}return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')]('EXEC\x20%s\x20%s',_0x2edfa8,_0x3f9ec9));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x35')]=function(_0x17dd40){return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x36'),_0x17dd40));};AGIChannel['prototype'][_0x1e0c('0x37')]=function(_0x111029){return this[_0x1e0c('0x27')](util['format']('SET\x20EXTENSION\x20%s',_0x111029));};AGIChannel['prototype']['setPriority']=function(_0x4b6786){return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x38'),_0x4b6786));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0xe')]=function(){return this['sendRequest'](_0x1e0c('0x39'));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x3a')]=function(_0x2b47ec,_0x335959){var _0x16ff61=_['isBoolean'](_0x335959)||_['isNumber'](_0x335959)?_0x335959[_0x1e0c('0x3b')]():_0x335959;return this['sendRequest'](util[_0x1e0c('0x2e')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x2b47ec,_0x16ff61?_0x16ff61[_0x1e0c('0x3b')]()[_0x1e0c('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x3c')]=function(_0x463141,_0xa96f0b){return this[_0x1e0c('0x27')](util['format'](_0x1e0c('0x3d'),_0x463141,_0xa96f0b));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x3e')]=function(_0x3eddef,_0xaa8d62){return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x3f'),_0x3eddef,_0xaa8d62));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x40')]=function(_0x4ddc5f,_0x3f6ce4){return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x41'),_0x4ddc5f,_0x3f6ce4));};AGIChannel['prototype'][_0x1e0c('0x42')]=function(_0x23a24f,_0x5e6b00,_0x4b219b){_0x5e6b00=_0x5e6b00||this[_0x1e0c('0x43')];_0x4b219b=_0x4b219b||0x1;this[_0x1e0c('0x35')](_0x23a24f);this[_0x1e0c('0x37')](_0x5e6b00);this[_0x1e0c('0x44')](_0x4b219b);return this[_0x1e0c('0x30')](util[_0x1e0c('0x2e')](_0x1e0c('0x45'),_0x23a24f,_0x5e6b00,_0x4b219b));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x46')]=function(_0x45aa72){return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x47'),_0x45aa72));};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x48')]=function(_0x292dfc,_0x6f91aa,_0x1b460f,_0x460cbe,_0x351436,_0x4351dc){_0x6f91aa=_0x6f91aa||_0x1e0c('0x49');_0x1b460f=_0x1b460f||'';_0x460cbe=_0x460cbe===undefined?-0x1:_0x460cbe==='-1'?-0x1:_0x460cbe*0x3e8;_0x351436=_0x351436===undefined?'':'s='+_0x351436;_0x4351dc=_0x4351dc?_0x1e0c('0x4a'):'';return this[_0x1e0c('0x27')](util[_0x1e0c('0x2e')](_0x1e0c('0x4b'),_0x292dfc,_0x6f91aa,_0x1b460f,_0x460cbe,_0x4351dc,_0x351436));};AGIChannel['prototype']['streamFile']=function(_0x2fec89,_0x17dd2){_0x17dd2=_0x17dd2||'';return this['sendRequest'](util['format'](_0x1e0c('0x4c'),_0x2fec89,_0x17dd2));};AGIChannel[_0x1e0c('0x2b')]['agi']=function(_0x43a1a7){return this[_0x1e0c('0x32')](_0x1e0c('0x4d'),_0x43a1a7);};AGIChannel[_0x1e0c('0x2b')]['wait']=function(_0x7a882a){return this[_0x1e0c('0x32')](_0x1e0c('0x4e'),_0x7a882a);};AGIChannel[_0x1e0c('0x2b')][_0x1e0c('0x1c')]=function(_0x5722de,_0x41169e){this[_0x1e0c('0x30')](util['format'](_0x1e0c('0x4f'),_0x5722de['id'],_0x5722de['label'],_0x41169e));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xa5cf=['sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','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','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','./reply','call','setEncoding','utf8','setTimeout','headers','emit','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','write','inherits','prototype','sendRequest','command'];(function(_0xf0330b,_0x814253){var _0x538518=function(_0x9c7d43){while(--_0x9c7d43){_0xf0330b['push'](_0xf0330b['shift']());}};_0x538518(++_0x814253);}(_0xa5cf,0xc8));var _0xfa5c=function(_0x1e1927,_0x56e90b){_0x1e1927=_0x1e1927-0x0;var _0x4661c9=_0xa5cf[_0x1e1927];return _0x4661c9;};'use strict';var util=require('util');var _=require(_0xfa5c('0x0'));var EventEmitter=require(_0xfa5c('0x1'))['EventEmitter'];var AGIReply=require(_0xfa5c('0x2'));var AGIError=require('./error');function AGIChannel(_0x13d1fa){var _0x5186c8=this,_0x1f7d01=new AGIReply(),_0x530c9a=![],_0x48405f={};EventEmitter[_0xfa5c('0x3')](_0x5186c8);_0x13d1fa[_0xfa5c('0x4')](_0xfa5c('0x5'));_0x13d1fa[_0xfa5c('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1f7d01[_0xfa5c('0x4')](_0xfa5c('0x5'));_0x1f7d01['on'](_0xfa5c('0x7'),function(_0x1d4742){for(var _0x5ce7d2 in _0x1d4742){_0x5186c8[_0x5ce7d2]=_0x1d4742[_0x5ce7d2];}_0x5186c8[_0xfa5c('0x8')]('ready');});_0x1f7d01['on'](_0xfa5c('0x9'),function(_0xb35684){if(_0xb35684['toLowerCase']()==_0xfa5c('0xa')){_0x5186c8['emit'](_0xfa5c('0xa'));return;}if(_0xb35684[_0xfa5c('0xb')](0x0,0xb)==_0xfa5c('0xc')){_0x530c9a=!![];}if(_0x530c9a){_0x48405f['rx']+=_0xb35684+'\x0a';if(_0xb35684[_0xfa5c('0xd')](_0xfa5c('0xe'))!=-0x1){_0x530c9a=![];}}else{_0x48405f['rx']=_0xb35684;}if(_0x530c9a){return;}if(typeof _0x48405f['cb']==_0xfa5c('0xf')){var _0x56a6d9=_0x48405f['rx'][_0xfa5c('0xb')](0x0,0x3),_0x136d4c=null,_0x462487=null;_0x56a6d9=parseInt(_0x56a6d9);if(isNaN(_0x56a6d9)){_0x48405f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xfa5c('0x10')});return;}if(_0x56a6d9!=0xc8){_0x48405f['cb'](null,{'code':_0x56a6d9,'result':-0x1,'extra':'KO'});return;}_0x136d4c=_0x48405f['rx'][_0xfa5c('0xb')](0x4)[_0xfa5c('0x11')](_0xfa5c('0x12'),'');if(_0x136d4c['indexOf']('\x20')!=-0x1){_0x136d4c=_0x136d4c[_0xfa5c('0x13')](0x0,_0x136d4c[_0xfa5c('0x14')]('\x20'));}if(_[_0xfa5c('0x15')](_0x136d4c,'-1')){_0x136d4c=parseInt(_0x136d4c);}_0x462487=_0x48405f['rx'][_0xfa5c('0x16')]('\x20');if(_0x462487[_0xfa5c('0x17')]==0x3){_0x462487=_0x462487[0x2][_0xfa5c('0xb')](0x1,_0x462487[0x2][_0xfa5c('0x17')]-0x1);}else if(_0x462487[_0xfa5c('0x17')]>0x3){var _0x6ffd98=/\((.+)\)/;var _0x5d49df=_0x48405f['rx'][_0xfa5c('0x18')](_0x6ffd98);if(_0x5d49df){_0x462487=_0x5d49df[0x1];}else{_0x462487=null;}}else{_0x462487=null;}_0x48405f['cb'](null,{'code':_0x56a6d9,'result':_0x136d4c,'extra':_0x462487});}});_0x13d1fa['on'](_0xfa5c('0x19'),function(_0x4ed210){_0x5186c8['emit'](_0xfa5c('0x19'),new AGIError(_0xfa5c('0x1a'),_0x4ed210[_0xfa5c('0x1b')]));});_0x13d1fa['on'](_0xfa5c('0x1c'),function(){_0x5186c8[_0xfa5c('0x8')]('close',new AGIError(_0xfa5c('0x1d')));});_0x13d1fa['on'](_0xfa5c('0x1e'),function(){_0x5186c8['emit'](_0xfa5c('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x13d1fa[_0xfa5c('0x1f')]();});_0x13d1fa['pipe'](_0x1f7d01);this['command']=function(_0xef7541,_0x5cc679){var _0xef7541=_0xef7541||'',_0x5cc679=typeof _0x5cc679==_0xfa5c('0xf')?_0x5cc679:new Function();_0x48405f={'tx':_0xef7541,'rx':'','cb':_0x5cc679};_0x13d1fa[_0xfa5c('0x20')](_0xef7541+'\x0a');},this[_0xfa5c('0x1c')]=function(){_0x13d1fa[_0xfa5c('0x1f')]();};}util[_0xfa5c('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x23')]=function(_0x2ecdc6){return this[_0xfa5c('0x24')][_0xfa5c('0x25')](this,_0x2ecdc6);};AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x26')]=function(){return this[_0xfa5c('0x23')](_0xfa5c('0x27'));};AGIChannel['prototype'][_0xfa5c('0x28')]=function(_0x26a2f1,_0x32ee3d,_0x554a75){_0x26a2f1=_0x26a2f1===undefined?_0xfa5c('0x29'):_0x26a2f1;_0x32ee3d=_0x32ee3d===undefined?'5':_0x32ee3d;_0x554a75=_0x554a75===undefined?'1':_0x554a75;return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x2b'),_0x26a2f1,_0x32ee3d*0x3e8,_0x554a75));};AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x2c')]=function(_0x24c31f){_0x24c31f=_0x24c31f||_0xfa5c('0x2d');return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x2e'),_0x24c31f));};AGIChannel[_0xfa5c('0x22')]['exec']=function(_0x5a1c49,_0x35b208){if(_['isArray'](_0x35b208)){return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x2f'),_0x5a1c49,_0x35b208[_0xfa5c('0x30')](',')));}return this['sendRequest'](util[_0xfa5c('0x2a')](_0xfa5c('0x2f'),_0x5a1c49,_0x35b208));};AGIChannel['prototype'][_0xfa5c('0x31')]=function(_0xde481a){return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x32'),_0xde481a));};AGIChannel[_0xfa5c('0x22')]['setExtension']=function(_0x1c4e89){return this['sendRequest'](util[_0xfa5c('0x2a')](_0xfa5c('0x33'),_0x1c4e89));};AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x34')]=function(_0x1ebc8b){return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x35'),_0x1ebc8b));};AGIChannel['prototype']['hangup']=function(){return this[_0xfa5c('0x23')](_0xfa5c('0x36'));};AGIChannel['prototype']['setVariable']=function(_0x17b42d,_0x2f4000){var _0x1d5ec1=_['isBoolean'](_0x2f4000)||_[_0xfa5c('0x37')](_0x2f4000)?_0x2f4000[_0xfa5c('0x38')]():_0x2f4000;return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x39'),_0x17b42d,_0x1d5ec1?_0x1d5ec1['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfa5c('0x22')]['sayNumber']=function(_0x304783,_0x361a6e){return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x3a'),_0x304783,_0x361a6e));};AGIChannel['prototype'][_0xfa5c('0x3b')]=function(_0x1645d0,_0x58a1bb){return this[_0xfa5c('0x23')](util['format'](_0xfa5c('0x3c'),_0x1645d0,_0x58a1bb));};AGIChannel['prototype'][_0xfa5c('0x3d')]=function(_0x2e2045,_0x2a20b4){return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2e2045,_0x2a20b4));};AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x3e')]=function(_0x51a770,_0x132a88,_0x59ed65){_0x132a88=_0x132a88||this[_0xfa5c('0x3f')];_0x59ed65=_0x59ed65||0x1;this[_0xfa5c('0x31')](_0x51a770);this['setExtension'](_0x132a88);this['setPriority'](_0x59ed65);return this[_0xfa5c('0x2c')](util[_0xfa5c('0x2a')](_0xfa5c('0x40'),_0x51a770,_0x132a88,_0x59ed65));};AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x41')]=function(_0x1611b0){return this[_0xfa5c('0x23')](util[_0xfa5c('0x2a')](_0xfa5c('0x42'),_0x1611b0));};AGIChannel['prototype'][_0xfa5c('0x43')]=function(_0x8c01cd,_0x491331,_0x44b9c5,_0x3a1dad,_0x4caea9,_0x5433e2){_0x491331=_0x491331||_0xfa5c('0x44');_0x44b9c5=_0x44b9c5||'';_0x3a1dad=_0x3a1dad===undefined?-0x1:_0x3a1dad==='-1'?-0x1:_0x3a1dad*0x3e8;_0x4caea9=_0x4caea9===undefined?'':'s='+_0x4caea9;_0x5433e2=_0x5433e2?_0xfa5c('0x45'):'';return this['sendRequest'](util['format'](_0xfa5c('0x46'),_0x8c01cd,_0x491331,_0x44b9c5,_0x3a1dad,_0x5433e2,_0x4caea9));};AGIChannel[_0xfa5c('0x22')][_0xfa5c('0x47')]=function(_0x445857,_0x912c1b){_0x912c1b=_0x912c1b||'';return this[_0xfa5c('0x23')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x445857,_0x912c1b));};AGIChannel['prototype'][_0xfa5c('0x48')]=function(_0x107e95){return this[_0xfa5c('0x49')](_0xfa5c('0x4a'),_0x107e95);};AGIChannel['prototype']['wait']=function(_0x7b04ad){return this[_0xfa5c('0x49')](_0xfa5c('0x4b'),_0x7b04ad);};AGIChannel['prototype'][_0xfa5c('0x19')]=function(_0x7ef92c,_0x150c19){this[_0xfa5c('0x2c')](util[_0xfa5c('0x2a')](_0xfa5c('0x4c'),_0x7ef92c['id'],_0x7ef92c[_0xfa5c('0x4d')],_0x150c19));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfa5c('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 8c8dcc4..08649c4 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 _0x350f=['util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','exports'];(function(_0x238722,_0x2d9388){var _0xbb3003=function(_0x39f769){while(--_0x39f769){_0x238722['push'](_0x238722['shift']());}};_0xbb3003(++_0x2d9388);}(_0x350f,0x9c));var _0xf350=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x350f[_0x55e08b];return _0xd1a7ff;};'use strict';var util=require(_0xf350('0x0'));var error={'E_AGI_UNDEFINED':_0xf350('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xf350('0x2'),'E_AGI_SERVER_CLOSE':_0xf350('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xf350('0x4'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf350('0x5'),'E_AGI_IVR_ENTRY':_0xf350('0x6')};function AGIError(_0x1e2f3e){var _0x1e2f3e=_0x1e2f3e||null,_0x5b9da0=_0x5b9da0||[],_0x5ec465=0x1,_0x463da5='';if(!error[_0x1e2f3e]){_0x1e2f3e=_0xf350('0x7');}_0x5b9da0[_0xf350('0x8')](error[_0x1e2f3e]);while(arguments[_0x5ec465]){_0x5b9da0['push'](arguments[_0x5ec465]);_0x5ec465++;}_0x463da5=util[_0xf350('0x9')][_0xf350('0xa')](util,_0x5b9da0);this['message']=_0x463da5;this[_0xf350('0xb')]=_0x1e2f3e;}module[_0xf350('0xc')]=AGIError; \ No newline at end of file +var _0xb89b=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','name','exports'];(function(_0x25a6eb,_0x1995c4){var _0x175cd7=function(_0x5d9598){while(--_0x5d9598){_0x25a6eb['push'](_0x25a6eb['shift']());}};_0x175cd7(++_0x1995c4);}(_0xb89b,0x150));var _0xbb89=function(_0x25fded,_0x34216e){_0x25fded=_0x25fded-0x0;var _0x269156=_0xb89b[_0x25fded];return _0x269156;};'use strict';var util=require(_0xbb89('0x0'));var error={'E_AGI_UNDEFINED':_0xbb89('0x1'),'E_AGI_ARGUMENT_PORT':_0xbb89('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xbb89('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xbb89('0x4'),'E_AGI_COMMAND_EMPTY':_0xbb89('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xbb89('0x6')};function AGIError(_0x28b0e9){var _0x28b0e9=_0x28b0e9||null,_0x390184=_0x390184||[],_0x3b9011=0x1,_0x1ee363='';if(!error[_0x28b0e9]){_0x28b0e9=_0xbb89('0x7');}_0x390184['push'](error[_0x28b0e9]);while(arguments[_0x3b9011]){_0x390184[_0xbb89('0x8')](arguments[_0x3b9011]);_0x3b9011++;}_0x1ee363=util['format'][_0xbb89('0x9')](util,_0x390184);this['message']=_0x1ee363;this[_0xbb89('0xa')]=_0x28b0e9;}module[_0xbb89('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 096173b..b1727e3 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 _0xf1f2=['getVertex','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','invalid','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getsecretdigits','edges','numberOfEdges','prototype','addEdge','size','vertices','relations'];(function(_0x5be0d5,_0x51cd7f){var _0x2a4b71=function(_0x1e27b8){while(--_0x1e27b8){_0x5be0d5['push'](_0x5be0d5['shift']());}};_0x2a4b71(++_0x51cd7f);}(_0xf1f2,0x145));var _0x2f1f=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0xf1f2[_0x47b15f];return _0x55bf25;};'use strict';var _=require('lodash');var logger=require(_0x2f1f('0x0'))(_0x2f1f('0x1'));var verticesWithRetry=[_0x2f1f('0x2'),'getdigits',_0x2f1f('0x3')];var Graph=function(){this['vertices']={};this[_0x2f1f('0x4')]={};this[_0x2f1f('0x5')]=0x0;};Graph[_0x2f1f('0x6')]['addVertex']=function(_0x158d28){this['vertices'][_0x158d28['id']]=_0x158d28;this['edges'][_0x158d28['id']]=[];};Graph[_0x2f1f('0x6')][_0x2f1f('0x7')]=function(_0x4c6a95,_0x34d091,_0x1f2e3e){this['edges'][_0x4c6a95]['push']({'target':_0x34d091,'condition':_0x1f2e3e});this[_0x2f1f('0x5')]+=0x1;};Graph[_0x2f1f('0x6')][_0x2f1f('0x8')]=function(){return _[_0x2f1f('0x8')](this[_0x2f1f('0x9')]);};Graph[_0x2f1f('0x6')][_0x2f1f('0xa')]=function(){return this[_0x2f1f('0x5')];};Graph[_0x2f1f('0x6')][_0x2f1f('0xb')]=function(_0x14b01e){return this['vertices'][_0x14b01e];};Graph[_0x2f1f('0x6')]['traverseBFS']=function(_0x88f617,_0x48406c){if(!this[_0x2f1f('0x9')][_0x88f617]){return logger[_0x2f1f('0xc')]('no\x20vertex\x20found');}var _0x4873c6=_0x48406c(this[_0x2f1f('0x9')][_0x88f617]);if(!_0x4873c6){return logger[_0x2f1f('0xc')](_0x2f1f('0xd'));}if(this[_0x2f1f('0x4')][_0x88f617][_0x2f1f('0xe')]===0x0){return logger['info'](_0x2f1f('0xf'));}for(var _0x4b4141=0x0,_0x3afadf=[],_0x4a5682=![];_0x4b4141\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','agi_','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','traverseBFS','vertex','gotoc','context','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','connection','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./rpc'];(function(_0x43de73,_0x1a8a20){var _0x87db10=function(_0x397b75){while(--_0x397b75){_0x43de73['push'](_0x43de73['shift']());}};_0x87db10(++_0x1a8a20);}(_0x4233,0x103));var _0x3423=function(_0x276cbd,_0x5059f3){_0x276cbd=_0x276cbd-0x0;var _0x160712=_0x4233[_0x276cbd];return _0x160712;};'use strict';var parser=require('xml2json');var _=require(_0x3423('0x0'));var syncho=require(_0x3423('0x1'));var util=require(_0x3423('0x2'));var moment=require(_0x3423('0x3'));var config=require(_0x3423('0x4'));var logger=require('../../config/logger')(_0x3423('0x5'));var utilLicense=require(_0x3423('0x6'));var rpc=require(_0x3423('0x7'));var mailRpc=require(_0x3423('0x8'));var Graph=require(_0x3423('0x9'));var Vertices=require(_0x3423('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x3423('0x5')],{'ip':_0x3423('0xb'),'port':0x11dd});function connectionHandler(_0x17b223){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x17b223);agiHandler(_0x17b223);}catch(_0x2d2b6e){logger['error'](_0x2d2b6e[_0x3423('0xc')]);}});});}function listeningHandler(){console[_0x3423('0xd')](_0x3423('0xe'),config[_0x3423('0x5')][_0x3423('0xf')]);logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x12'),config[_0x3423('0x5')]['ip'],config[_0x3423('0x5')]['port']));}function errorHandler(_0x1bef19){if(_0x1bef19&&_0x1bef19[_0x3423('0x13')]&&_0x1bef19['message']){logger[_0x3423('0x14')](util[_0x3423('0x11')](_0x3423('0x15'),_0x1bef19[_0x3423('0x13')],_0x1bef19[_0x3423('0x16')]));}else{logger[_0x3423('0x14')](util['format']('[ERROR]\x20%s',_0x1bef19[_0x3423('0xc')]));}}function closeHandler(){logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x17'),this['arg_1'],this[_0x3423('0x18')],this[_0x3423('0x19')],this[_0x3423('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x53fda6){logger[_0x3423('0x14')](_0x53fda6[_0x3423('0xc')]);}}function timeoutHandler(){logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x1b'),this[_0x3423('0x1c')],this[_0x3423('0x18')],this['callerid'],this[_0x3423('0x1a')],this[_0x3423('0x1d')]));}function hangupHandler(){logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x1e'),this['arg_1'],this[_0x3423('0x18')],this['callerid'],this[_0x3423('0x1a')],this['uniqueid']));this[_0x3423('0x1f')]=!![];}function getRoot(_0x2b1d8f){return parser['toJson'](_0x2b1d8f,{'object':!![]})['mxGraphModel'][_0x3423('0x20')];}function addVertex(_0x59cefe,_0x1abf18,_0x22fcb3){_0x1abf18[_0x3423('0x21')]=_0x22fcb3;if(_0x1abf18[_0x3423('0x22')](_0x3423('0x23'))){_0x1abf18[_0x3423('0x24')]=parseInt(_0x1abf18[_0x3423('0x23')],0xa);}_0x59cefe[_0x3423('0x25')](_['omit'](_0x1abf18,'mxCell'));}function initGraph(_0x2dc1a3,_0x7d429e){var _0x4af07a=new Graph();for(var _0x12ef2c in _0x2dc1a3){if(_0x2dc1a3['hasOwnProperty'](_0x12ef2c)){if(_[_0x3423('0x26')](_0x2dc1a3[_0x12ef2c])){for(var _0x1991b6=0x0;_0x1991b6<_0x2dc1a3[_0x12ef2c][_0x3423('0x27')];_0x1991b6+=0x1){addVertex(_0x4af07a,_0x2dc1a3[_0x12ef2c][_0x1991b6],_0x12ef2c);}}else{addVertex(_0x4af07a,_0x2dc1a3[_0x12ef2c],_0x12ef2c);}}}for(var _0x52e9e4=0x0;_0x52e9e4<_0x7d429e[_0x3423('0x27')];_0x52e9e4+=0x1){if(_0x7d429e[_0x52e9e4][_0x3423('0x28')]&&_0x7d429e[_0x52e9e4][_0x3423('0x29')]){_0x4af07a[_0x3423('0x2a')](_0x7d429e[_0x52e9e4][_0x3423('0x28')],_0x7d429e[_0x52e9e4]['target'],_0x7d429e[_0x52e9e4]['value']);}}return _0x4af07a;}function getSquareProject(_0x41eb4d,_0x521195){rpc[_0x3423('0x2b')](_0x41eb4d)[_0x3423('0x2c')](function(_0x659559){_0x521195(null,_0x659559);})[_0x3423('0x2d')](function(_0x17b647){_0x521195(null,_0x17b647);});}function createSquareReport(_0x44a4cf,_0x265e90){rpc[_0x3423('0x2e')](_0x44a4cf)[_0x3423('0x2c')](function(_0x33f604){if(_0x265e90){_0x265e90(null,_0x33f604);}})['catch'](function(_0x5eb809){if(_0x265e90){_0x265e90(null,_0x5eb809);}});}function setChannelVariables(_0x2b69d3){for(var _0x280750 in _0x2b69d3){if(_0x2b69d3[_0x3423('0x22')](_0x280750)){if(_0x280750['indexOf'](_0x3423('0x2f'))===0x0){_0x2b69d3[_0x280750['substring'](0x4)]=_0x2b69d3[_0x280750];delete _0x2b69d3[_0x280750];}}}}function getLogFromObject(_0x38fbe2){return util[_0x3423('0x30')](_0x38fbe2,{'showHidden':![],'depth':null});}function agiHandler(_0x22e32a){var _0x541d02,_0x1e686c,_0x15dd16,_0x3cb78f,_0x84286f;logger['debug'](_0x3423('0x31'),JSON[_0x3423('0x32')](_0x22e32a,null,0x2));logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x33'),_0x22e32a[_0x3423('0x1c')],_0x22e32a['calleridname'],_0x22e32a['callerid'],_0x22e32a['dnid'],_0x22e32a[_0x3423('0x1d')]));_0x22e32a['on'](_0x3423('0x14'),errorHandler);_0x22e32a['on'](_0x3423('0x34'),closeHandler);_0x22e32a['on'](_0x3423('0x35'),timeoutHandler);_0x22e32a['evtHangup']=![];_0x22e32a['on'](_0x3423('0x36'),hangupHandler);var _0x50233a=getSquareProject[_0x3423('0x37')](null,_0x22e32a[_0x3423('0x1c')]);if(_0x50233a){if(_0x50233a[_0x3423('0x38')]){_0x541d02=getRoot(_0x50233a[_0x3423('0x38')]);if(_0x541d02&&_0x541d02[_0x3423('0x39')]){logger[_0x3423('0x3a')]('root',JSON['stringify'](_0x541d02,null,0x2));_0x22e32a[_0x3423('0x3b')]=moment()[_0x3423('0x11')](_0x3423('0x3c'));_0x1e686c=initGraph(_[_0x3423('0x3d')](_0x541d02,_0x3423('0x3e')),_0x541d02[_0x3423('0x3e')]);_0x15dd16=new Vertices(_0x22e32a,rpc,mailRpc);logger[_0x3423('0x10')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x22e32a['arg_1'],_0x22e32a[_0x3423('0x18')],_0x22e32a[_0x3423('0x19')],_0x22e32a[_0x3423('0x1a')],_0x22e32a[_0x3423('0x1d')]));_0x1e686c[_0x3423('0x3f')](_0x541d02[_0x3423('0x39')]['id'],function(_0x373214){try{_0x373214=_0x15dd16['clear'](_0x373214);logger[_0x3423('0x3a')](_0x3423('0x40'),JSON[_0x3423('0x32')](_0x373214,null,0x2));if(_0x373214[_0x3423('0x21')]===_0x3423('0x41')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x22e32a[_0x3423('0x42')]=_0x373214[_0x3423('0x42')]||_0x22e32a['context'];_0x22e32a[_0x3423('0x43')]=_0x373214[_0x3423('0x43')];_0x22e32a[_0x3423('0x44')]=_0x373214['priority']?_0x373214[_0x3423('0x44')]-0x1:0x1;return null;}else if(_0x373214&&_0x15dd16[_0x373214['agicommand']]){_0x84286f=_0x15dd16[_0x373214[_0x3423('0x21')]](_0x373214);logger['info'](_0x3423('0x45'),JSON[_0x3423('0x32')](_0x84286f,null,0x2));if(_0x84286f&&_0x84286f['code']===AGI_CODE_SUCCESS&&_0x84286f[_0x3423('0x46')]!==AGI_RESULT_ERROR&&!_0x22e32a[_0x3423('0x1f')]){logger[_0x3423('0x3a')](_0x3423('0x45'),getLogFromObject(_0x84286f));return _[_0x3423('0x47')](_0x84286f[_0x3423('0x46')])?null:_0x84286f['result'][_0x3423('0x48')]();}else{logger[_0x3423('0x14')](_0x3423('0x45'),getLogFromObject(_0x84286f));return null;}}else{logger[_0x3423('0x14')](_0x3423('0x49'));return null;}}catch(_0x1e7d3d){logger['error'](_0x1e7d3d[_0x3423('0xc')]);return null;}});if(_0x541d02[_0x3423('0x4a')]){logger[_0x3423('0x10')](util['format'](_0x3423('0x4b'),_0x22e32a[_0x3423('0x1c')],_0x22e32a['calleridname'],_0x22e32a[_0x3423('0x19')],_0x22e32a['dnid'],_0x22e32a[_0x3423('0x1d')]));_0x1e686c[_0x3423('0x3f')](_0x541d02[_0x3423('0x4a')]['id'],function(_0x1f3f93){try{_0x1f3f93=_0x15dd16[_0x3423('0x4c')](_0x1f3f93);logger[_0x3423('0x3a')](_0x3423('0x40'),JSON[_0x3423('0x32')](_0x1f3f93,null,0x2));if(_0x1f3f93&&_0x15dd16[_0x1f3f93['agicommand']]){_0x84286f=_0x15dd16[_0x1f3f93['agicommand']](_0x1f3f93);if(_0x84286f){logger[_0x3423('0x3a')](_0x3423('0x45'),getLogFromObject(_0x84286f));return _[_0x3423('0x47')](_0x84286f['result'])?null:_0x84286f[_0x3423('0x46')][_0x3423('0x48')]();}else{logger[_0x3423('0x14')](_0x3423('0x45'),getLogFromObject(_0x84286f));return null;}}else{logger[_0x3423('0x14')](_0x3423('0x49'));return null;}}catch(_0x3d892e){logger[_0x3423('0x14')](_0x3d892e[_0x3423('0xc')]);return null;}});}logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x4d'),_0x22e32a[_0x3423('0x1c')],_0x22e32a['calleridname'],_0x22e32a['callerid'],_0x22e32a[_0x3423('0x1a')],_0x22e32a[_0x3423('0x1d')]));logger[_0x3423('0x10')](util[_0x3423('0x11')](_0x3423('0x4e'),_0x22e32a[_0x3423('0x42')],_0x22e32a[_0x3423('0x43')],parseInt(_0x22e32a[_0x3423('0x44')],0xa)+0x1));_0x22e32a[_0x3423('0x4f')](_0x22e32a['context'],_0x22e32a[_0x3423('0x43')],parseInt(_0x22e32a[_0x3423('0x44')],0xa)+0x1);_0x22e32a['close']();}}else{logger[_0x3423('0x14')](util[_0x3423('0x11')](_0x3423('0x50'),_0x22e32a['arg_1']));_0x22e32a[_0x3423('0x4f')](_0x22e32a[_0x3423('0x42')],_0x22e32a[_0x3423('0x43')],parseInt(_0x22e32a[_0x3423('0x44')],0xa)+0x1);_0x22e32a[_0x3423('0x34')]();}}else{logger[_0x3423('0x14')](util[_0x3423('0x11')]('Project\x20%s\x20not\x20found',_0x22e32a[_0x3423('0x1c')]));_0x22e32a['continueAt'](_0x22e32a['context'],_0x22e32a[_0x3423('0x43')],parseInt(_0x22e32a['priority'],0xa)+0x1);_0x22e32a[_0x3423('0x34')]();}}function main(){var _0x4b23e8;return utilLicense[_0x3423('0x51')]()[_0x3423('0x2c')](function(_0x2b1b29){if(_0x2b1b29){if(_0x2b1b29[_0x3423('0x52')]){if(_0x2b1b29[_0x3423('0x53')]&&_0x2b1b29[_0x3423('0x53')]>0x0){logger[_0x3423('0x10')](util['format'](_0x3423('0x54'),_0x2b1b29['callysquare']));_0x4b23e8=_0x2b1b29['callysquare'];}else{logger[_0x3423('0x10')](_0x3423('0x55'));}}else{logger[_0x3423('0x10')](_0x3423('0x56'));_0x4b23e8=-0x1;}}})[_0x3423('0x2d')](function(_0x4957ff){logger[_0x3423('0x14')]('[LICENSE]',_0x4957ff[_0x3423('0xc')]);})['finally'](function(){var _0x32874b=require(_0x3423('0x57'))(config[_0x3423('0x5')][_0x3423('0xf')],config[_0x3423('0x5')]['ip'],_0x4b23e8);_0x32874b['on'](_0x3423('0x14'),errorHandler);_0x32874b['on']('listening',listeningHandler);_0x32874b['on'](_0x3423('0x58'),connectionHandler);_0x32874b['on'](_0x3423('0x34'),closeHandler);});}main(); \ No newline at end of file +var _0xf58e=['mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','indexOf','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','clear','gotoc','context','extension','priority','response','result','isUndefined','agicommand\x20not\x20found','traverseBFS','vertex','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20published','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','./server','listening','connection','xml2json','lodash','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','format','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit'];(function(_0x4dd235,_0x475575){var _0x2903e5=function(_0x3b472c){while(--_0x3b472c){_0x4dd235['push'](_0x4dd235['shift']());}};_0x2903e5(++_0x475575);}(_0xf58e,0x18f));var _0xef58=function(_0x10327a,_0x9dfaa7){_0x10327a=_0x10327a-0x0;var _0x560e1d=_0xf58e[_0x10327a];return _0x560e1d;};'use strict';var parser=require(_0xef58('0x0'));var _=require(_0xef58('0x1'));var syncho=require(_0xef58('0x2'));var util=require('util');var moment=require(_0xef58('0x3'));var config=require(_0xef58('0x4'));var logger=require(_0xef58('0x5'))(_0xef58('0x6'));var utilLicense=require(_0xef58('0x7'));var rpc=require(_0xef58('0x8'));var mailRpc=require(_0xef58('0x9'));var Graph=require(_0xef58('0xa'));var Vertices=require(_0xef58('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xef58('0x6')]=_[_0xef58('0xc')](config[_0xef58('0x6')],{'ip':_0xef58('0xd'),'port':0x11dd});function connectionHandler(_0x2ad715){process[_0xef58('0xe')](function(){syncho(function(){try{setChannelVariables(_0x2ad715);agiHandler(_0x2ad715);}catch(_0x4ed057){logger[_0xef58('0xf')](_0x4ed057[_0xef58('0x10')]);}});});}function listeningHandler(){console[_0xef58('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xef58('0x6')]['port']);logger[_0xef58('0x12')](util['format'](_0xef58('0x13'),config[_0xef58('0x6')]['ip'],config[_0xef58('0x6')][_0xef58('0x14')]));}function errorHandler(_0x461fb8){if(_0x461fb8&&_0x461fb8[_0xef58('0x15')]&&_0x461fb8[_0xef58('0x16')]){logger[_0xef58('0xf')](util['format']('[%s]\x20%s',_0x461fb8[_0xef58('0x15')],_0x461fb8[_0xef58('0x16')]));}else{logger[_0xef58('0xf')](util[_0xef58('0x17')]('[ERROR]\x20%s',_0x461fb8[_0xef58('0x10')]));}}function closeHandler(){logger[_0xef58('0x12')](util[_0xef58('0x17')](_0xef58('0x18'),this['arg_1'],this[_0xef58('0x19')],this[_0xef58('0x1a')],this[_0xef58('0x1b')],this[_0xef58('0x1c')]));try{createSquareReport(this);}catch(_0x52ba4e){logger[_0xef58('0xf')](_0x52ba4e['stack']);}}function timeoutHandler(){logger[_0xef58('0x12')](util[_0xef58('0x17')](_0xef58('0x1d'),this[_0xef58('0x1e')],this['calleridname'],this[_0xef58('0x1a')],this[_0xef58('0x1b')],this[_0xef58('0x1c')]));}function hangupHandler(){logger[_0xef58('0x12')](util[_0xef58('0x17')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xef58('0x19')],this['callerid'],this['dnid'],this[_0xef58('0x1c')]));this[_0xef58('0x1f')]=!![];}function getRoot(_0x1877bf){return parser[_0xef58('0x20')](_0x1877bf,{'object':!![]})[_0xef58('0x21')][_0xef58('0x22')];}function addVertex(_0x13c2f1,_0x4ae5c9,_0x2049d2){_0x4ae5c9[_0xef58('0x23')]=_0x2049d2;if(_0x4ae5c9[_0xef58('0x24')](_0xef58('0x25'))){_0x4ae5c9[_0xef58('0x26')]=parseInt(_0x4ae5c9['retry'],0xa);}_0x13c2f1[_0xef58('0x27')](_[_0xef58('0x28')](_0x4ae5c9,_0xef58('0x29')));}function initGraph(_0x1aabb3,_0x1ec96d){var _0x22c184=new Graph();for(var _0x572b45 in _0x1aabb3){if(_0x1aabb3[_0xef58('0x24')](_0x572b45)){if(_[_0xef58('0x2a')](_0x1aabb3[_0x572b45])){for(var _0x25955a=0x0;_0x25955a<_0x1aabb3[_0x572b45][_0xef58('0x2b')];_0x25955a+=0x1){addVertex(_0x22c184,_0x1aabb3[_0x572b45][_0x25955a],_0x572b45);}}else{addVertex(_0x22c184,_0x1aabb3[_0x572b45],_0x572b45);}}}for(var _0x4da1c3=0x0;_0x4da1c3<_0x1ec96d['length'];_0x4da1c3+=0x1){if(_0x1ec96d[_0x4da1c3][_0xef58('0x2c')]&&_0x1ec96d[_0x4da1c3][_0xef58('0x2d')]){_0x22c184[_0xef58('0x2e')](_0x1ec96d[_0x4da1c3][_0xef58('0x2c')],_0x1ec96d[_0x4da1c3][_0xef58('0x2d')],_0x1ec96d[_0x4da1c3][_0xef58('0x2f')]);}}return _0x22c184;}function getSquareProject(_0x26127a,_0x50bf8f){rpc[_0xef58('0x30')](_0x26127a)['then'](function(_0x3539f0){_0x50bf8f(null,_0x3539f0);})['catch'](function(_0x4ac157){_0x50bf8f(null,_0x4ac157);});}function createSquareReport(_0x150339,_0x59f701){rpc['createSquareReport'](_0x150339)[_0xef58('0x31')](function(_0x1764d2){if(_0x59f701){_0x59f701(null,_0x1764d2);}})['catch'](function(_0x286422){if(_0x59f701){_0x59f701(null,_0x286422);}});}function setChannelVariables(_0x1a4089){for(var _0x31e585 in _0x1a4089){if(_0x1a4089[_0xef58('0x24')](_0x31e585)){if(_0x31e585[_0xef58('0x32')](_0xef58('0x33'))===0x0){_0x1a4089[_0x31e585[_0xef58('0x34')](0x4)]=_0x1a4089[_0x31e585];delete _0x1a4089[_0x31e585];}}}}function getLogFromObject(_0x321191){return util[_0xef58('0x35')](_0x321191,{'showHidden':![],'depth':null});}function agiHandler(_0x5b7a9d){var _0x38b843,_0x422531,_0x8fc90c,_0x4d508f,_0x4c35f4;logger[_0xef58('0x36')]('variables',JSON[_0xef58('0x37')](_0x5b7a9d,null,0x2));logger['info'](util[_0xef58('0x17')](_0xef58('0x38'),_0x5b7a9d[_0xef58('0x1e')],_0x5b7a9d[_0xef58('0x19')],_0x5b7a9d[_0xef58('0x1a')],_0x5b7a9d[_0xef58('0x1b')],_0x5b7a9d['uniqueid']));_0x5b7a9d['on'](_0xef58('0xf'),errorHandler);_0x5b7a9d['on']('close',closeHandler);_0x5b7a9d['on'](_0xef58('0x39'),timeoutHandler);_0x5b7a9d[_0xef58('0x1f')]=![];_0x5b7a9d['on']('hangup',hangupHandler);var _0x1b8cfc=getSquareProject[_0xef58('0x3a')](null,_0x5b7a9d[_0xef58('0x1e')]);if(_0x1b8cfc){if(_0x1b8cfc[_0xef58('0x3b')]){_0x38b843=getRoot(_0x1b8cfc['production']);if(_0x38b843&&_0x38b843[_0xef58('0x3c')]){logger[_0xef58('0x36')](_0xef58('0x22'),JSON[_0xef58('0x37')](_0x38b843,null,0x2));_0x5b7a9d[_0xef58('0x3d')]=moment()[_0xef58('0x17')](_0xef58('0x3e'));_0x422531=initGraph(_['omit'](_0x38b843,_0xef58('0x29')),_0x38b843['mxCell']);_0x8fc90c=new Vertices(_0x5b7a9d,rpc,mailRpc);logger[_0xef58('0x12')](util[_0xef58('0x17')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b7a9d['arg_1'],_0x5b7a9d[_0xef58('0x19')],_0x5b7a9d[_0xef58('0x1a')],_0x5b7a9d[_0xef58('0x1b')],_0x5b7a9d[_0xef58('0x1c')]));_0x422531['traverseBFS'](_0x38b843[_0xef58('0x3c')]['id'],function(_0x221b1a){try{_0x221b1a=_0x8fc90c[_0xef58('0x3f')](_0x221b1a);logger[_0xef58('0x36')]('vertex',JSON[_0xef58('0x37')](_0x221b1a,null,0x2));if(_0x221b1a[_0xef58('0x23')]===_0xef58('0x40')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x5b7a9d[_0xef58('0x41')]=_0x221b1a[_0xef58('0x41')]||_0x5b7a9d[_0xef58('0x41')];_0x5b7a9d[_0xef58('0x42')]=_0x221b1a['extension'];_0x5b7a9d[_0xef58('0x43')]=_0x221b1a[_0xef58('0x43')]?_0x221b1a[_0xef58('0x43')]-0x1:0x1;return null;}else if(_0x221b1a&&_0x8fc90c[_0x221b1a[_0xef58('0x23')]]){_0x4c35f4=_0x8fc90c[_0x221b1a[_0xef58('0x23')]](_0x221b1a);logger[_0xef58('0x12')](_0xef58('0x44'),JSON[_0xef58('0x37')](_0x4c35f4,null,0x2));if(_0x4c35f4&&_0x4c35f4['code']===AGI_CODE_SUCCESS&&_0x4c35f4[_0xef58('0x45')]!==AGI_RESULT_ERROR&&!_0x5b7a9d[_0xef58('0x1f')]){logger[_0xef58('0x36')](_0xef58('0x44'),getLogFromObject(_0x4c35f4));return _[_0xef58('0x46')](_0x4c35f4['result'])?null:_0x4c35f4[_0xef58('0x45')]['toString']();}else{logger[_0xef58('0xf')](_0xef58('0x44'),getLogFromObject(_0x4c35f4));return null;}}else{logger[_0xef58('0xf')](_0xef58('0x47'));return null;}}catch(_0x33b896){logger[_0xef58('0xf')](_0x33b896['stack']);return null;}});if(_0x38b843['finally']){logger['info'](util[_0xef58('0x17')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b7a9d['arg_1'],_0x5b7a9d[_0xef58('0x19')],_0x5b7a9d[_0xef58('0x1a')],_0x5b7a9d[_0xef58('0x1b')],_0x5b7a9d['uniqueid']));_0x422531[_0xef58('0x48')](_0x38b843['finally']['id'],function(_0x362fee){try{_0x362fee=_0x8fc90c[_0xef58('0x3f')](_0x362fee);logger[_0xef58('0x36')](_0xef58('0x49'),JSON[_0xef58('0x37')](_0x362fee,null,0x2));if(_0x362fee&&_0x8fc90c[_0x362fee['agicommand']]){_0x4c35f4=_0x8fc90c[_0x362fee[_0xef58('0x23')]](_0x362fee);if(_0x4c35f4){logger[_0xef58('0x36')](_0xef58('0x44'),getLogFromObject(_0x4c35f4));return _[_0xef58('0x46')](_0x4c35f4[_0xef58('0x45')])?null:_0x4c35f4[_0xef58('0x45')]['toString']();}else{logger['error'](_0xef58('0x44'),getLogFromObject(_0x4c35f4));return null;}}else{logger[_0xef58('0xf')](_0xef58('0x47'));return null;}}catch(_0x1b125c){logger[_0xef58('0xf')](_0x1b125c[_0xef58('0x10')]);return null;}});}logger['info'](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b7a9d[_0xef58('0x1e')],_0x5b7a9d[_0xef58('0x19')],_0x5b7a9d[_0xef58('0x1a')],_0x5b7a9d[_0xef58('0x1b')],_0x5b7a9d[_0xef58('0x1c')]));logger[_0xef58('0x12')](util['format'](_0xef58('0x4a'),_0x5b7a9d[_0xef58('0x41')],_0x5b7a9d[_0xef58('0x42')],parseInt(_0x5b7a9d[_0xef58('0x43')],0xa)+0x1));_0x5b7a9d['continueAt'](_0x5b7a9d[_0xef58('0x41')],_0x5b7a9d['extension'],parseInt(_0x5b7a9d['priority'],0xa)+0x1);_0x5b7a9d[_0xef58('0x4b')]();}}else{logger[_0xef58('0xf')](util[_0xef58('0x17')](_0xef58('0x4c'),_0x5b7a9d[_0xef58('0x1e')]));_0x5b7a9d[_0xef58('0x4d')](_0x5b7a9d[_0xef58('0x41')],_0x5b7a9d[_0xef58('0x42')],parseInt(_0x5b7a9d[_0xef58('0x43')],0xa)+0x1);_0x5b7a9d['close']();}}else{logger[_0xef58('0xf')](util['format']('Project\x20%s\x20not\x20found',_0x5b7a9d[_0xef58('0x1e')]));_0x5b7a9d[_0xef58('0x4d')](_0x5b7a9d[_0xef58('0x41')],_0x5b7a9d['extension'],parseInt(_0x5b7a9d[_0xef58('0x43')],0xa)+0x1);_0x5b7a9d['close']();}}function main(){var _0x29a369;return utilLicense[_0xef58('0x4e')]()[_0xef58('0x31')](function(_0x29d552){if(_0x29d552){if(_0x29d552[_0xef58('0x4f')]){if(_0x29d552[_0xef58('0x50')]&&_0x29d552[_0xef58('0x50')]>0x0){logger[_0xef58('0x12')](util[_0xef58('0x17')](_0xef58('0x51'),_0x29d552[_0xef58('0x50')]));_0x29a369=_0x29d552[_0xef58('0x50')];}else{logger[_0xef58('0x12')](_0xef58('0x52'));}}else{logger[_0xef58('0x12')](_0xef58('0x53'));_0x29a369=-0x1;}}})[_0xef58('0x54')](function(_0x586cdd){logger['error']('[LICENSE]',_0x586cdd[_0xef58('0x10')]);})['finally'](function(){var _0x6c3fbc=require(_0xef58('0x55'))(config[_0xef58('0x6')][_0xef58('0x14')],config[_0xef58('0x6')]['ip'],_0x29a369);_0x6c3fbc['on'](_0xef58('0xf'),errorHandler);_0x6c3fbc['on'](_0xef58('0x56'),listeningHandler);_0x6c3fbc['on'](_0xef58('0x57'),connectionHandler);_0x6c3fbc['on'](_0xef58('0x4b'),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 f1e8f00..ca3fb78 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 _0xbcc4=['message','catch','sendMailMessage','SendMail','bluebird','client','http','then'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbcc4,0x1cc));var _0x4bcc=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xbcc4[_0x187ee1];return _0x388160;};'use strict';var BPromise=require(_0x4bcc('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x4bcc('0x1')][_0x4bcc('0x2')]({'port':0x232b});function request(_0x632531,_0x4c623d){return new BPromise(function(_0x4345f5,_0x39da15){return client['request'](_0x632531,_0x4c623d)[_0x4bcc('0x3')](function(_0x529b92){if(_0x529b92['error']){return _0x39da15(_0x529b92['error'][_0x4bcc('0x4')]);}else{return _0x4345f5(_0x529b92['result']);}})[_0x4bcc('0x5')](function(_0xdbe952){return _0x39da15(_0xdbe952);});});}exports[_0x4bcc('0x6')]=function(_0x49aecd,_0x36e706){return request(_0x4bcc('0x7'),{'account':_0x49aecd,'message':_0x36e706});}; \ No newline at end of file +var _0x742d=['error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','request'];(function(_0x58b3c4,_0x272937){var _0x2d658d=function(_0x41c4b7){while(--_0x41c4b7){_0x58b3c4['push'](_0x58b3c4['shift']());}};_0x2d658d(++_0x272937);}(_0x742d,0xcc));var _0xd742=function(_0x29e1f5,_0xc63331){_0x29e1f5=_0x29e1f5-0x0;var _0x5391cf=_0x742d[_0x29e1f5];return _0x5391cf;};'use strict';var BPromise=require(_0xd742('0x0'));var jayson=require(_0xd742('0x1'));var client=jayson[_0xd742('0x2')]['http']({'port':0x232b});function request(_0x2e2ca5,_0xfea333){return new BPromise(function(_0x5c6a26,_0x3c414a){return client[_0xd742('0x3')](_0x2e2ca5,_0xfea333)['then'](function(_0x4661ea){if(_0x4661ea[_0xd742('0x4')]){return _0x3c414a(_0x4661ea[_0xd742('0x4')]['message']);}else{return _0x5c6a26(_0x4661ea['result']);}})[_0xd742('0x5')](function(_0x4d7af2){return _0x3c414a(_0x4d7af2);});});}exports[_0xd742('0x6')]=function(_0x4ee410,_0x52b349){return request(_0xd742('0x7'),{'account':_0x4ee410,'message':_0x52b349});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e1edb51..865e639 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 _0x4628=['split','slice','trim','emit','headers','line','exports','stream','call','_inBody','prototype','_transform','_localBuffer','indexOf','length'];(function(_0x3f687a,_0xd28e49){var _0x52ea92=function(_0x1b9d2e){while(--_0x1b9d2e){_0x3f687a['push'](_0x3f687a['shift']());}};_0x52ea92(++_0xd28e49);}(_0x4628,0x70));var _0x8462=function(_0x49895f,_0x3097d5){_0x49895f=_0x49895f-0x0;var _0x1ba801=_0x4628[_0x49895f];return _0x1ba801;};'use strict';var util=require('util');var Transform=require(_0x8462('0x0'))['Transform'];function AGIReply(_0x59cd29){Transform[_0x8462('0x1')](this,_0x59cd29);this['_localBuffer']='';this[_0x8462('0x2')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x8462('0x3')][_0x8462('0x4')]=function(_0x50a97d,_0x534563,_0x421ec7){var _0x1864b5='\x0a',_0xc4c73a=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x36a09d=-0x1,_0x470457=-0x1,_0x578718='',_0x1d4de9=0x0,_0x196584='',_0xecdce8='';this['_localBuffer']+=_0x50a97d['toString']();_0x196584=this[_0x8462('0x5')];if(!this['_inBody']){_0x1d4de9=0x0;while(_0xc4c73a[_0x1d4de9]){while((_0x470457=_0x196584[_0x8462('0x6')](_0xc4c73a[_0x1d4de9]))!=-0x1){_0x578718=_0xc4c73a[_0x1d4de9];_0xecdce8=_0x196584['substring'](0x0,_0x470457);_0x196584=_0x196584['substring'](_0x470457+_0x578718[_0x8462('0x7')]);var _0x50ab54=_0xecdce8[_0x8462('0x8')](_0x1864b5),_0x20f66f=0x0,_0x32e244={},_0x1651b1='',_0x3e31a5='',_0x440128=-0x1;while(_0x50ab54[_0x20f66f]){_0x440128=_0x50ab54[_0x20f66f][_0x8462('0x6')](':');if(_0x440128!=-0x1){_0x1651b1=_0x50ab54[_0x20f66f][_0x8462('0x9')](0x0,_0x440128)[_0x8462('0xa')]();_0x3e31a5=_0x50ab54[_0x20f66f][_0x8462('0x9')](_0x440128+0x1)['trim']();if(_0x1651b1[_0x8462('0x7')]>0x0){_0x32e244[_0x1651b1]=_0x3e31a5;}}else{}_0x20f66f++;}this[_0x8462('0xb')](_0x8462('0xc'),_0x32e244);this[_0x8462('0x2')]=!![];}_0x1d4de9++;}this[_0x8462('0x5')]=_0x196584;}else{while((_0x36a09d=_0x196584[_0x8462('0x6')](_0x1864b5))!=-0x1){_0xecdce8=_0x196584['substring'](0x0,_0x36a09d);this[_0x8462('0xb')](_0x8462('0xd'),_0xecdce8);_0x196584=_0x196584['substring'](_0x36a09d+_0x1864b5[_0x8462('0x7')]);}this[_0x8462('0x5')]=_0x196584;}_0x421ec7();};module[_0x8462('0xe')]=AGIReply; \ No newline at end of file +var _0x30d6=['_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody','indexOf','substring','slice','trim','length','emit','headers','line','exports','stream','Transform','call','inherits','prototype'];(function(_0x4f5fbc,_0x59fb50){var _0x53989f=function(_0x3e501e){while(--_0x3e501e){_0x4f5fbc['push'](_0x4f5fbc['shift']());}};_0x53989f(++_0x59fb50);}(_0x30d6,0x80));var _0x630d=function(_0x197d5c,_0x1936b0){_0x197d5c=_0x197d5c-0x0;var _0x13dc71=_0x30d6[_0x197d5c];return _0x13dc71;};'use strict';var util=require('util');var Transform=require(_0x630d('0x0'))[_0x630d('0x1')];function AGIReply(_0x361725){Transform[_0x630d('0x2')](this,_0x361725);this['_localBuffer']='';this['_inBody']=![];}util[_0x630d('0x3')](AGIReply,Transform);AGIReply[_0x630d('0x4')][_0x630d('0x5')]=function(_0x1fe7a3,_0x4d5edd,_0x318f72){var _0x114b34='\x0a',_0x1c2972=['\x0a\x0a',_0x630d('0x6')],_0x2eeff3=-0x1,_0x16619b=-0x1,_0x372f3e='',_0x500bbb=0x0,_0x3ca8e7='',_0x4b59ee='';this[_0x630d('0x7')]+=_0x1fe7a3[_0x630d('0x8')]();_0x3ca8e7=this[_0x630d('0x7')];if(!this[_0x630d('0x9')]){_0x500bbb=0x0;while(_0x1c2972[_0x500bbb]){while((_0x16619b=_0x3ca8e7[_0x630d('0xa')](_0x1c2972[_0x500bbb]))!=-0x1){_0x372f3e=_0x1c2972[_0x500bbb];_0x4b59ee=_0x3ca8e7[_0x630d('0xb')](0x0,_0x16619b);_0x3ca8e7=_0x3ca8e7['substring'](_0x16619b+_0x372f3e['length']);var _0x478bce=_0x4b59ee['split'](_0x114b34),_0x532143=0x0,_0x1a4ebb={},_0x575291='',_0x507c26='',_0x47381f=-0x1;while(_0x478bce[_0x532143]){_0x47381f=_0x478bce[_0x532143][_0x630d('0xa')](':');if(_0x47381f!=-0x1){_0x575291=_0x478bce[_0x532143][_0x630d('0xc')](0x0,_0x47381f)[_0x630d('0xd')]();_0x507c26=_0x478bce[_0x532143][_0x630d('0xc')](_0x47381f+0x1)[_0x630d('0xd')]();if(_0x575291[_0x630d('0xe')]>0x0){_0x1a4ebb[_0x575291]=_0x507c26;}}else{}_0x532143++;}this[_0x630d('0xf')](_0x630d('0x10'),_0x1a4ebb);this[_0x630d('0x9')]=!![];}_0x500bbb++;}this[_0x630d('0x7')]=_0x3ca8e7;}else{while((_0x2eeff3=_0x3ca8e7[_0x630d('0xa')](_0x114b34))!=-0x1){_0x4b59ee=_0x3ca8e7['substring'](0x0,_0x2eeff3);this['emit'](_0x630d('0x11'),_0x4b59ee);_0x3ca8e7=_0x3ca8e7[_0x630d('0xb')](_0x2eeff3+_0x114b34[_0x630d('0xe')]);}this[_0x630d('0x7')]=_0x3ca8e7;}_0x318f72();};module[_0x630d('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 88543d8..2469e34 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 _0x561a=['catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','request','then','error','result'];(function(_0x5c10c6,_0xd02bbe){var _0x47637d=function(_0x58d6d7){while(--_0x58d6d7){_0x5c10c6['push'](_0x5c10c6['shift']());}};_0x47637d(++_0xd02bbe);}(_0x561a,0x153));var _0xa561=function(_0x1ce3cc,_0x4f0bfa){_0x1ce3cc=_0x1ce3cc-0x0;var _0x1de825=_0x561a[_0x1ce3cc];return _0x1de825;};'use strict';var BPromise=require(_0xa561('0x0'));var moment=require(_0xa561('0x1'));var _=require('lodash');var util=require(_0xa561('0x2'));var jayson=require(_0xa561('0x3'));var client=jayson[_0xa561('0x4')]['http']({'port':0x2329});function request(_0x6601f1,_0x4d59d3){return new BPromise(function(_0x42b0b3,_0x25a02e){return client[_0xa561('0x5')](_0x6601f1,_0x4d59d3)[_0xa561('0x6')](function(_0x1d2a56){if(_0x1d2a56['error']){return _0x25a02e(_0x1d2a56[_0xa561('0x7')]['message']);}else{return _0x42b0b3(_0x1d2a56[_0xa561('0x8')]);}})[_0xa561('0x9')](function(_0x5c74ed){return _0x25a02e(_0x5c74ed);});});}exports['getSquareProject']=function(_0x13214f){return request(_0xa561('0xa'),{'options':{'raw':![],'where':{'name':_0x13214f},'attributes':[_0xa561('0xb')]}});};exports[_0xa561('0xc')]=function(_0x3a22c4){return request(_0xa561('0xd'),{'options':{'raw':![],'where':{'id':_0x3a22c4},'include':[{'model':_0xa561('0xe'),'as':'Smtp'}],'attributes':['id',_0xa561('0xf'),_0xa561('0x10')]}});};exports[_0xa561('0x11')]=function(_0x3b43e3){return request('ShowSquareProject',{'options':{'where':{'id':_0x3b43e3},'attributes':[_0xa561('0xf')]}});};exports[_0xa561('0x12')]=function(_0x2097e3){return request(_0xa561('0x13'),{'options':{'where':{'id':_0x2097e3},'attributes':[_0xa561('0xf')]}});};exports[_0xa561('0x14')]=function(_0x5a8cd3){return request(_0xa561('0x15'),{'options':{'where':{'id':_0x5a8cd3},'attributes':['name']}});};exports[_0xa561('0x16')]=function(_0x3e4738){return request(_0xa561('0x17'),{'options':{'where':{'id':_0x3e4738},'attributes':['dsn']}});};exports[_0xa561('0x18')]=function(_0x419dcc){return request('ShowUser',{'options':{'where':{'id':_0x419dcc},'attributes':['name']}});};exports['getTrunkById']=function(_0x1b9e1b){return request(_0xa561('0x19'),{'options':{'where':{'id':_0x1b9e1b},'attributes':[_0xa561('0xf')]}});};exports[_0xa561('0x1a')]=function(_0xd78e79){return request('ShowSound',{'options':{'where':{'id':_0xd78e79},'attributes':['save_name']}});};exports[_0xa561('0x1b')]=function(_0xb27492){return request(_0xa561('0x1c'),{'options':{'raw':![],'where':{'id':_0xb27492},'include':[{'model':_0xa561('0x1d'),'as':_0xa561('0x1e')}]}});};exports['getSmsAccountById']=function(_0x1c5c40){return request('ShowSmsAccount',{'options':{'where':{'id':_0x1c5c40},'attributes':['id',_0xa561('0xf')]}});};exports[_0xa561('0x1f')]=function(_0x22e38d){return request(_0xa561('0x20'),{'body':_0x22e38d});};exports[_0xa561('0x21')]=function(_0x1cab5a){return request(_0xa561('0x22'),{'body':_0x1cab5a});};exports[_0xa561('0x23')]=function(_0x34017e){return request(_0xa561('0x24'),{'body':_['merge'](_0x34017e,{'project_name':_0x34017e[_0xa561('0x25')],'prev_project_name':_0x34017e[_0xa561('0x26')]||'','is_subproject':_0x34017e[_0xa561('0x26')]?!![]:![],'leaveAt':moment()[_0xa561('0x27')](_0xa561('0x28'))})});};exports[_0xa561('0x29')]=function(_0x3fff3b){return request(_0xa561('0x2a'),{'body':_0x3fff3b});};exports[_0xa561('0x2b')]=function(_0x3b368c){return request(_0xa561('0x2c'),{'body':_0x3b368c});};exports[_0xa561('0x2d')]=function(_0x56ed15){return request(_0xa561('0x2e'),{'options':{'raw':![],'where':{'phone':_0x56ed15[_0xa561('0x2f')],'ListId':_0x56ed15[_0xa561('0x30')]}}})[_0xa561('0x6')](function(_0x2970f3){if(_0x2970f3){return _0x2970f3;}return request(_0xa561('0x31'),{'body':_0x56ed15});});};exports['getPauseById']=function(_0x419edd){return request(_0xa561('0x32'),{'options':{'where':{'id':_0x419edd},'attributes':[_0xa561('0xf')]}});};exports['agentLogin']=function(_0x321d4f,_0x17e07c){return request(_0xa561('0x33'),{'body':{'interface':_0x17e07c},'options':{'where':_0x321d4f}});};exports[_0xa561('0x34')]=function(_0x18c3c3,_0x5dc459,_0x436a11){return request(_0xa561('0x35'),{'body':{'type':_0x5dc459,'uniqueid':_0x436a11},'options':{'where':_0x18c3c3}});};exports[_0xa561('0x36')]=function(_0x4dd65a){return request(_0xa561('0x37'),{'body':{},'options':{'where':_0x4dd65a}});};exports[_0xa561('0x38')]=function(_0x29008e){return request(_0xa561('0x39'),{'body':{},'options':{'where':_0x29008e}});}; \ No newline at end of file +var _0x2339=['createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','http','request','then','error','message','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x2339,0x1e5));var _0x9233=function(_0x58b6b8,_0x18f8b3){_0x58b6b8=_0x58b6b8-0x0;var _0x46cac2=_0x2339[_0x58b6b8];return _0x46cac2;};'use strict';var BPromise=require(_0x9233('0x0'));var moment=require(_0x9233('0x1'));var _=require(_0x9233('0x2'));var util=require(_0x9233('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x9233('0x4')][_0x9233('0x5')]({'port':0x2329});function request(_0x3ab983,_0x21c570){return new BPromise(function(_0x2f4a57,_0x30b7a9){return client[_0x9233('0x6')](_0x3ab983,_0x21c570)[_0x9233('0x7')](function(_0x1b605e){if(_0x1b605e[_0x9233('0x8')]){return _0x30b7a9(_0x1b605e[_0x9233('0x8')][_0x9233('0x9')]);}else{return _0x2f4a57(_0x1b605e['result']);}})[_0x9233('0xa')](function(_0x237cda){return _0x30b7a9(_0x237cda);});});}exports[_0x9233('0xb')]=function(_0x929139){return request(_0x9233('0xc'),{'options':{'raw':![],'where':{'name':_0x929139},'attributes':['production']}});};exports[_0x9233('0xd')]=function(_0x947637){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x947637},'include':[{'model':_0x9233('0xe'),'as':_0x9233('0xf')}],'attributes':['id',_0x9233('0x10'),_0x9233('0x11')]}});};exports['getSquareProjectById']=function(_0x2e413f){return request('ShowSquareProject',{'options':{'where':{'id':_0x2e413f},'attributes':[_0x9233('0x10')]}});};exports[_0x9233('0x12')]=function(_0x54985e){return request(_0x9233('0x13'),{'options':{'where':{'id':_0x54985e},'attributes':[_0x9233('0x10')]}});};exports[_0x9233('0x14')]=function(_0x380cf2){return request(_0x9233('0x15'),{'options':{'where':{'id':_0x380cf2},'attributes':[_0x9233('0x10')]}});};exports[_0x9233('0x16')]=function(_0xbf1580){return request(_0x9233('0x17'),{'options':{'where':{'id':_0xbf1580},'attributes':[_0x9233('0x18')]}});};exports[_0x9233('0x19')]=function(_0x7781b5){return request(_0x9233('0x1a'),{'options':{'where':{'id':_0x7781b5},'attributes':[_0x9233('0x10')]}});};exports[_0x9233('0x1b')]=function(_0x1869fa){return request(_0x9233('0x1c'),{'options':{'where':{'id':_0x1869fa},'attributes':[_0x9233('0x10')]}});};exports[_0x9233('0x1d')]=function(_0x44d42d){return request(_0x9233('0x1e'),{'options':{'where':{'id':_0x44d42d},'attributes':['save_name']}});};exports[_0x9233('0x1f')]=function(_0x3c7be8){return request(_0x9233('0x20'),{'options':{'raw':![],'where':{'id':_0x3c7be8},'include':[{'model':_0x9233('0x21'),'as':'Intervals'}]}});};exports[_0x9233('0x22')]=function(_0x59f45c){return request(_0x9233('0x23'),{'options':{'where':{'id':_0x59f45c},'attributes':['id','name']}});};exports[_0x9233('0x24')]=function(_0x56f353){return request(_0x9233('0x25'),{'body':_0x56f353});};exports['createSquareDetailsReport']=function(_0x376ed2){return request('CreateSquareDetailsReport',{'body':_0x376ed2});};exports['createSquareReport']=function(_0x407067){return request(_0x9233('0x26'),{'body':_[_0x9233('0x27')](_0x407067,{'project_name':_0x407067[_0x9233('0x28')],'prev_project_name':_0x407067['arg_2']||'','is_subproject':_0x407067[_0x9233('0x29')]?!![]:![],'leaveAt':moment()[_0x9233('0x2a')](_0x9233('0x2b'))})});};exports[_0x9233('0x2c')]=function(_0x110cd4){return request(_0x9233('0x2d'),{'body':_0x110cd4});};exports[_0x9233('0x2e')]=function(_0x4c7a76){return request(_0x9233('0x2f'),{'body':_0x4c7a76});};exports[_0x9233('0x30')]=function(_0x1499df){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1499df[_0x9233('0x31')],'ListId':_0x1499df[_0x9233('0x32')]}}})[_0x9233('0x7')](function(_0x566d0b){if(_0x566d0b){return _0x566d0b;}return request(_0x9233('0x33'),{'body':_0x1499df});});};exports['getPauseById']=function(_0x47185f){return request('ShowPause',{'options':{'where':{'id':_0x47185f},'attributes':['name']}});};exports['agentLogin']=function(_0x179edc,_0xe61ab6){return request(_0x9233('0x34'),{'body':{'interface':_0xe61ab6},'options':{'where':_0x179edc}});};exports[_0x9233('0x35')]=function(_0x31fd15,_0x54aac2,_0x3cf49f){return request(_0x9233('0x36'),{'body':{'type':_0x54aac2,'uniqueid':_0x3cf49f},'options':{'where':_0x31fd15}});};exports[_0x9233('0x37')]=function(_0x58c5f6){return request(_0x9233('0x38'),{'body':{},'options':{'where':_0x58c5f6}});};exports[_0x9233('0x39')]=function(_0x11c78e){return request(_0x9233('0x3a'),{'body':{},'options':{'where':_0x11c78e}});}; \ 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 868781c..83dbcbe 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 _0x67d1=['exports','./lex'];(function(_0x18d202,_0x309b7e){var _0x5c5d91=function(_0x57a733){while(--_0x57a733){_0x18d202['push'](_0x18d202['shift']());}};_0x5c5d91(++_0x309b7e);}(_0x67d1,0xf1));var _0x167d=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x67d1[_0x4b7895];return _0x264180;};var polly=require('./polly');var lex=require(_0x167d('0x0'));module[_0x167d('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xee55=['./polly','exports'];(function(_0x3e9734,_0x32bc2b){var _0x4bcb9f=function(_0x18b9c1){while(--_0x18b9c1){_0x3e9734['push'](_0x3e9734['shift']());}};_0x4bcb9f(++_0x32bc2b);}(_0xee55,0x1a0));var _0x5ee5=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xee55[_0x25701b];return _0x3a8a2c;};var polly=require(_0x5ee5('0x0'));var lex=require('./lex');module[_0x5ee5('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 880ff28..423e260 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 _0x153f=['exports','./lib/api'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0x153f,0x15b));var _0xf153=function(_0x4f5492,_0x3b7f62){_0x4f5492=_0x4f5492-0x0;var _0x4cfcf5=_0x153f[_0x4f5492];return _0x4cfcf5;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x2f304a,_0x371b63){var _0x786eb2=function(_0x51bc74){while(--_0x51bc74){_0x2f304a['push'](_0x2f304a['shift']());}};_0x786eb2(++_0x371b63);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ 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 2f35335..5870301 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(_0x5cbdc2,_0x341118){var _0x18667d=function(_0x2dfec3){while(--_0x2dfec3){_0x5cbdc2['push'](_0x5cbdc2['shift']());}};_0x18667d(++_0x341118);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x1bfdb0,_0x93579e){var _0x56b688=function(_0xc6df72){while(--_0xc6df72){_0x1bfdb0['push'](_0x1bfdb0['shift']());}};_0x56b688(++_0x93579e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 d45ce2e..6db2c70 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 _0x9132=['exports'];(function(_0x283ddb,_0x4929ad){var _0x2d3740=function(_0x41660e){while(--_0x41660e){_0x283ddb['push'](_0x283ddb['shift']());}};_0x2d3740(++_0x4929ad);}(_0x9132,0x16d));var _0x2913=function(_0x550ab5,_0xf59385){_0x550ab5=_0x550ab5-0x0;var _0x5f1e42=_0x9132[_0x550ab5];return _0x5f1e42;};'use strict';var polly=require('./lib/api');module[_0x2913('0x0')]=function(_0x527642,_0x34d99c,_0x3b0107,_0x28ebf9,_0x3bf9e4,_0x30ca42,_0x475245){return polly(_0x527642,_0x34d99c,_0x3b0107,_0x28ebf9,_0x3bf9e4,_0x30ca42,_0x475245);}; \ No newline at end of file +var _0x45b0=['./lib/api','exports'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x45b0,0x1ca));var _0x045b=function(_0x5b7b93,_0x147b09){_0x5b7b93=_0x5b7b93-0x0;var _0x12cbf9=_0x45b0[_0x5b7b93];return _0x12cbf9;};'use strict';var polly=require(_0x045b('0x0'));module[_0x045b('0x1')]=function(_0x9ef428,_0x23cc59,_0x5087c0,_0x95d13,_0x4de9fd,_0x3652df,_0x3c41eb){return polly(_0x9ef428,_0x23cc59,_0x5087c0,_0x95d13,_0x4de9fd,_0x3652df,_0x3c41eb);}; \ 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 1d18b73..d0e5a76 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 _0xc6e3=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','bluebird','randomstring'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0xc6e3,0x7c));var _0x3c6e=function(_0x2eee3c,_0x4d2017){_0x2eee3c=_0x2eee3c-0x0;var _0x21bb7d=_0xc6e3[_0x2eee3c];return _0x21bb7d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x3c6e('0x0'));var rs=require(_0x3c6e('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x21ca3b,_0x5c8001,_0x449046){return new BPromise(function(_0x1416fd,_0x3a4bd0){_0x21ca3b[_0x3c6e('0x2')](_0x5c8001,function(_0x5ed746,_0x558fcf){if(_0x5ed746){_0x3a4bd0(_0x5ed746);}else if(_0x558fcf){if(_0x558fcf['AudioStream']instanceof Buffer){fs[_0x3c6e('0x3')](_0x449046,_0x558fcf[_0x3c6e('0x4')],function(_0x349153){if(_0x349153){_0x3a4bd0(_0x349153);}else{_0x1416fd();}});}else{_0x3a4bd0(new Error(_0x3c6e('0x5')));}}else{_0x3a4bd0(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x3c6e('0x6')]=function(_0x5e7b5c,_0x8bda83,_0x253f05,_0x101bfc,_0xf0d9a2,_0x1ffbd1,_0x30996e){var _0x379b5f=new AWS[(_0x3c6e('0x7'))]({'accessKeyId':_0x5e7b5c,'secretAccessKey':_0x8bda83,'region':_0x253f05});var _0x1ba08e={'Text':_0xf0d9a2,'TextType':_0x1ffbd1||_0x3c6e('0x8'),'OutputFormat':'mp3','VoiceId':_0x101bfc};return pollyResult(_0x379b5f,_0x1ba08e,_0x30996e);}; \ No newline at end of file +var _0xb310=['randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x2ce843,_0xc993a3){var _0x3454a7=function(_0x4ec79f){while(--_0x4ec79f){_0x2ce843['push'](_0x2ce843['shift']());}};_0x3454a7(++_0xc993a3);}(_0xb310,0x153));var _0x0b31=function(_0x3071ab,_0x2d6819){_0x3071ab=_0x3071ab-0x0;var _0x22910b=_0xb310[_0x3071ab];return _0x22910b;};'use strict';var fs=require('fs');var path=require(_0x0b31('0x0'));var BPromise=require(_0x0b31('0x1'));var rs=require(_0x0b31('0x2'));var AWS=require(_0x0b31('0x3'));function pollyResult(_0x174c67,_0x19d7c0,_0x422028){return new BPromise(function(_0x22158d,_0x2f4bfc){_0x174c67['synthesizeSpeech'](_0x19d7c0,function(_0x392683,_0xd85d03){if(_0x392683){_0x2f4bfc(_0x392683);}else if(_0xd85d03){if(_0xd85d03[_0x0b31('0x4')]instanceof Buffer){fs[_0x0b31('0x5')](_0x422028,_0xd85d03[_0x0b31('0x4')],function(_0x20b665){if(_0x20b665){_0x2f4bfc(_0x20b665);}else{_0x22158d();}});}else{_0x2f4bfc(new Error(_0x0b31('0x6')));}}else{_0x2f4bfc(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x0b31('0x7')]=function(_0x334d61,_0xe63cd9,_0x1aa38d,_0x4415e6,_0x5daee2,_0x1072f7,_0x313c24){var _0xd728ae=new AWS[(_0x0b31('0x8'))]({'accessKeyId':_0x334d61,'secretAccessKey':_0xe63cd9,'region':_0x1aa38d});var _0x1e1458={'Text':_0x5daee2,'TextType':_0x1072f7||_0x0b31('0x9'),'OutputFormat':_0x0b31('0xa'),'VoiceId':_0x4415e6};return pollyResult(_0xd728ae,_0x1e1458,_0x313c24);}; \ 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 4ba45ac..8d02964 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 _0x2844=['./lib/api','exports'];(function(_0x300fca,_0x44129f){var _0x26187c=function(_0x49e2f9){while(--_0x49e2f9){_0x300fca['push'](_0x300fca['shift']());}};_0x26187c(++_0x44129f);}(_0x2844,0x180));var _0x4284=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x2844[_0x18ab2a];return _0x16dcee;};'use strict';var asr=require(_0x4284('0x0'));module[_0x4284('0x1')]=function(_0x65ff0,_0x14b340,_0x1fa5ff,_0x416449){return asr(_0x65ff0,_0x14b340,_0x1fa5ff);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x28ab2e,_0xc891ec,_0x24c91e,_0x246c23){return asr(_0x28ab2e,_0xc891ec,_0x24c91e);}; \ 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 71b15a2..775788a 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 _0x94dc=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x3931e4,_0x2c346e){var _0x36f54a=function(_0x52599b){while(--_0x52599b){_0x3931e4['push'](_0x3931e4['shift']());}};_0x36f54a(++_0x2c346e);}(_0x94dc,0xb1));var _0xc94d=function(_0xbda2ca,_0x10deb4){_0xbda2ca=_0xbda2ca-0x0;var _0x127060=_0x94dc[_0xbda2ca];return _0x127060;};'use strict';var url=require(_0xc94d('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xc94d('0x1');module['exports']=function(_0x1645b0,_0x1b2070,_0x40e7d8){return new BPromise(function(_0x4b2dcc,_0x306706){var _0x41d4ec;if(typeof _0x1645b0!==_0xc94d('0x2')||_0x1645b0[_0xc94d('0x3')]===0x0){return _0x306706(_0xc94d('0x4'));}if(typeof _0x1b2070!==_0xc94d('0x2')||_0x1b2070[_0xc94d('0x3')]===0x0){return _0x306706('key\x20should\x20be\x20a\x20string');}if(typeof _0x40e7d8!==_0xc94d('0x5')&&(typeof _0x40e7d8!==_0xc94d('0x2')||_0x40e7d8[_0xc94d('0x3')]===0x0)){return _0x306706(_0xc94d('0x6'));}try{_0x41d4ec=fs[_0xc94d('0x7')](_0x1645b0)['toString'](_0xc94d('0x8'));}catch(_0x13096c){return _0x306706(_0x13096c);}return _0x4b2dcc({'method':_0xc94d('0x9'),'uri':host+_0xc94d('0xa')+_0x1b2070,'body':{'config':{'encoding':_0xc94d('0xb'),'sampleRateHertz':_0xc94d('0xc'),'languageCode':_0x40e7d8},'audio':{'content':_0x41d4ec}},'json':!![]});});}; \ No newline at end of file +var _0x073e=['undefined','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x073e,0x181));var _0xe073=function(_0x40e39f,_0x13396a){_0x40e39f=_0x40e39f-0x0;var _0x5166bc=_0x073e[_0x40e39f];return _0x5166bc;};'use strict';var url=require(_0xe073('0x0'));var BPromise=require(_0xe073('0x1'));var fs=require('fs');var host=_0xe073('0x2');module[_0xe073('0x3')]=function(_0x4a6f42,_0x488838,_0x4e8df8){return new BPromise(function(_0x3eff57,_0x4534b6){var _0x29444b;if(typeof _0x4a6f42!=='string'||_0x4a6f42['length']===0x0){return _0x4534b6('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x488838!==_0xe073('0x4')||_0x488838[_0xe073('0x5')]===0x0){return _0x4534b6(_0xe073('0x6'));}if(typeof _0x4e8df8!==_0xe073('0x7')&&(typeof _0x4e8df8!==_0xe073('0x4')||_0x4e8df8[_0xe073('0x5')]===0x0)){return _0x4534b6('lang\x20should\x20be\x20a\x20string');}try{_0x29444b=fs[_0xe073('0x8')](_0x4a6f42)[_0xe073('0x9')](_0xe073('0xa'));}catch(_0x118048){return _0x4534b6(_0x118048);}return _0x3eff57({'method':'POST','uri':host+_0xe073('0xb')+_0x488838,'body':{'config':{'encoding':_0xe073('0xc'),'sampleRateHertz':_0xe073('0xd'),'languageCode':_0x4e8df8},'audio':{'content':_0x29444b}},'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 c7226cb..13740d1 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 _0xec36=['exports','./asr'];(function(_0x3fc938,_0x1746c0){var _0x1da21f=function(_0x2f4b49){while(--_0x2f4b49){_0x3fc938['push'](_0x3fc938['shift']());}};_0x1da21f(++_0x1746c0);}(_0xec36,0xe5));var _0x6ec3=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xec36[_0x2e4e19];return _0x9ba20b;};var asr=require(_0x6ec3('0x0'));module[_0x6ec3('0x1')]={'asr':asr}; \ No newline at end of file +var _0xfcf9=['./asr'];(function(_0x3e2dee,_0x2fc712){var _0x4d333a=function(_0x432b3f){while(--_0x432b3f){_0x3e2dee['push'](_0x3e2dee['shift']());}};_0x4d333a(++_0x2fc712);}(_0xfcf9,0x93));var _0x9fcf=function(_0xfd693f,_0x1e46ca){_0xfd693f=_0xfd693f-0x0;var _0x34818a=_0xfcf9[_0xfd693f];return _0x34818a;};var asr=require(_0x9fcf('0x0'));module['exports']={'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 52d2118..47c5f1d 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 _0xa7bb=['../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','finish\x20download\x20file','close','download\x20error','pipe','end','get','data','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','generate','.mp3','from','audioContent','writeFile','chmodSync','resolve','unlink','777','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','source','resolvedQuery','action','result','actionIncomplete','fulfillment','score','status','metadata','isFallbackIntent','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','parse','sestekNDA','nda','CustomAction','channelData','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','./aws','./sestek','./tilde'];(function(_0x3ac539,_0x5dc5b0){var _0x3cf0e4=function(_0x3b3d27){while(--_0x3b3d27){_0x3ac539['push'](_0x3ac539['shift']());}};_0x3cf0e4(++_0x5dc5b0);}(_0xa7bb,0x7b));var _0xba7b=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xa7bb[_0x279d37];return _0x530173;};'use strict';var apiai=require(_0xba7b('0x0'));var BPromise=require(_0xba7b('0x1'));var dialogflow=require(_0xba7b('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xba7b('0x3'));var md5=require(_0xba7b('0x4'));var path=require(_0xba7b('0x5'));var querystring=require(_0xba7b('0x6'));var rp=require(_0xba7b('0x7'));var rs=require(_0xba7b('0x8'));var sox=require(_0xba7b('0x9'));var tts=require(_0xba7b('0xa'));var urlParse=require('url')['parse'];var util=require('util');var aws=require(_0xba7b('0xb'));var google=require('./google');var sestek=require(_0xba7b('0xc'));var tilde=require(_0xba7b('0xd'));var logger=require(_0xba7b('0xe'))(_0xba7b('0xf'));var ISPEECH_API=_0xba7b('0x10');function downloadFile(_0x3a5660,_0xdd480f){return new BPromise(function(_0x3e40fe,_0x326ed9){var _0x39be17=urlParse(_0x3a5660);var _0x1afce7=_0x39be17[_0xba7b('0x11')]===_0xba7b('0x12')?https:http;var _0xc39aec={'host':_0x39be17[_0xba7b('0x13')],'path':_0x39be17[_0xba7b('0x5')],'headers':{'user-agent':_0xba7b('0x14')}};_0x1afce7['get'](_0xc39aec,function(_0x28b81e){if(_0x28b81e[_0xba7b('0x15')]!==0xc8){logger[_0xba7b('0x16')](_0xba7b('0x17')+_0x3a5660+'\x20failed,\x20status\x20code\x20=\x20'+_0x28b81e['statusCode']+'\x20('+_0x28b81e[_0xba7b('0x18')]+')');_0x326ed9(new Error(_0xba7b('0x17')+_0x3a5660+_0xba7b('0x19')+_0x28b81e[_0xba7b('0x15')]+'\x20('+_0x28b81e[_0xba7b('0x18')]+')'));return;}var _0xe9e3bb=fs['createWriteStream'](_0xdd480f);_0xe9e3bb['on'](_0xba7b('0x1a'),function(){logger['info'](_0xba7b('0x1b'));_0xe9e3bb[_0xba7b('0x1c')](_0x3e40fe);});_0xe9e3bb['on']('error',function(_0x204fc8){fs['unlink'](_0xdd480f);logger[_0xba7b('0x16')](_0xba7b('0x1d'),_0x204fc8);_0x326ed9(_0x204fc8);});_0x28b81e[_0xba7b('0x1e')](_0xe9e3bb);})['on'](_0xba7b('0x16'),function(_0x427395){logger[_0xba7b('0x16')](_0x427395);_0x326ed9(_0x427395);})[_0xba7b('0x1f')]();});}function uploadFile(_0x42159f){return new BPromise(function(_0x39ffe8,_0x441e31){var _0xd80af9=urlParse(_0x42159f);var _0x123c54=_0xd80af9['protocol']===_0xba7b('0x12')?https:http;var _0x3efac8={'host':_0xd80af9[_0xba7b('0x13')],'path':_0xd80af9[_0xba7b('0x5')],'headers':{'user-agent':_0xba7b('0x14')}};_0x123c54[_0xba7b('0x20')](_0x3efac8,function(_0x462b28){if(_0x462b28['statusCode']!==0xc8){_0x441e31(new Error(_0xba7b('0x17')+_0x42159f+_0xba7b('0x19')+_0x462b28[_0xba7b('0x15')]+'\x20('+_0x462b28[_0xba7b('0x18')]+')'));return;}var _0x5670e7='';_0x462b28['on'](_0xba7b('0x21'),function(_0xb051e0){_0x5670e7+=_0xb051e0;});_0x462b28['on']('end',function(){_0x39ffe8(_0x5670e7);});})['on'](_0xba7b('0x16'),function(_0x26cd09){_0x441e31(_0x26cd09);})[_0xba7b('0x1f')]();});}function convertFile(_0x4b8be1,_0x55e154){return new BPromise(function(_0x460fd0,_0x253b99){var _0x4ceba6=sox['transcode'](_0x4b8be1,_0x55e154,{'sampleRate':0x1f40,'format':_0xba7b('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4ceba6['on']('error',function(_0x37cd3b){logger[_0xba7b('0x16')](_0xba7b('0x23'),_0x37cd3b);_0x253b99(_0x37cd3b);});_0x4ceba6['on']('end',function(){logger[_0xba7b('0x24')](_0xba7b('0x25'));_0x460fd0();});_0x4ceba6[_0xba7b('0x26')]();});}function base64Decode(_0x4bc649,_0x2260be){var _0x5d3773=path['resolve'](__dirname,_0xba7b('0x27'),rs['generate'](0x4)+_0xba7b('0x28'));fs['writeFileSync'](_0x5d3773,_0x4bc649,_0xba7b('0x29'));return convertFile(_0x5d3773,_0x2260be)['then'](function(){try{fs['unlink'](_0x5d3773);fs['chmodSync'](_0x2260be,'777');}catch(_0x34cdf0){logger[_0xba7b('0x16')](_0x34cdf0);}return _0x2260be['split']('.')[0x0];});}function base64Encode(_0x2a5952){var _0x2467dc=fs[_0xba7b('0x2a')](_0x2a5952);return new Buffer(_0x2467dc)['toString'](_0xba7b('0x29'));}exports['googleCloudTTS']=function(_0x3529d8,_0x5b4e24,_0x1d4743,_0x5af879,_0x55c8bb,_0x4ad8dd){var _0x46f415,_0x5d7e67;var _0x246460=_0xba7b('0x2b');var _0x5ea610=_0xba7b('0x2c')+_0x3529d8;var _0x5fb27a={};if(_0x5b4e24===_0xba7b('0x2d')){_0x5fb27a[_0xba7b('0x2e')]={'ssml':_0x1d4743};}else{_0x5fb27a[_0xba7b('0x2e')]={'text':_0x1d4743};};_0x5fb27a[_0xba7b('0x2f')]={'languageCode':_0x5af879,'ssmlGender':_0x55c8bb};_0x5fb27a[_0xba7b('0x30')]={'audioEncoding':_0xba7b('0x31'),'sampleRateHertz':0x1f40};var _0x28b101={'url':_0x246460+_0xba7b('0x32')+_0x5ea610,'method':_0xba7b('0x33'),'json':!![],'body':_0x5fb27a};return rp(_0x28b101)[_0xba7b('0x34')](function(_0x2b568d){return new BPromise(function(_0x2242be,_0x423eb5){_0x46f415=path['resolve'](__dirname,_0xba7b('0x27'),rs[_0xba7b('0x35')](0x4)+_0xba7b('0x36'));var _0x37e612=Buffer[_0xba7b('0x37')](_0x2b568d[_0xba7b('0x38')],_0xba7b('0x29'));return fs[_0xba7b('0x39')](_0x46f415,_0x37e612,function(_0x445577){_0x423eb5(_0x445577);},function(_0x363a44){fs[_0xba7b('0x3a')](_0x46f415,'777');_0x2242be(_0x363a44);});});})[_0xba7b('0x34')](function(_0x314a45){_0x5d7e67=path[_0xba7b('0x3b')](__dirname,'tmp',rs[_0xba7b('0x35')](0x4)+'.wav');return convertFile(_0x46f415,_0x5d7e67);})['then'](function(){try{fs[_0xba7b('0x3c')](_0x46f415);fs[_0xba7b('0x3a')](_0x5d7e67,_0xba7b('0x3d'));}catch(_0x2acdff){logger[_0xba7b('0x16')](_0x2acdff);}logger[_0xba7b('0x24')]('googleCloudTTS\x20path',_0x5d7e67[_0xba7b('0x3e')]('.')[0x0]);return _0x5d7e67[_0xba7b('0x3e')]('.')[0x0];});};exports['googleTTS']=function(_0x37bf65,_0x39afb5){var _0xac167e=_0xba7b('0x3f');var _0x2ef91a,_0x42ae9d;var _0x29b0ab;var _0x35795d={'encoding':_0xba7b('0x40'),'method':_0xba7b('0x33'),'timeout':0x2710,'url':_0xac167e,'headers':{'Content-Type':_0xba7b('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0xba7b('0x42')]([[[_0xba7b('0x43'),JSON[_0xba7b('0x42')]([_0x37bf65,_0x39afb5||'en',![],_0xba7b('0x44')]),null,_0xba7b('0x45')]]]))};return rp(_0x35795d)[_0xba7b('0x34')](function(_0x4fbbe3){try{_0x29b0ab=eval(_0x4fbbe3[_0xba7b('0x46')](0x5))[0x0][0x2];}catch(_0x1010af){throw new Error(_0xba7b('0x47')+_0x4fbbe3[_0xba7b('0x21')]);}if(!_0x29b0ab){if(_0x37bf65[_0xba7b('0x48')]>0xc8){throw new Error(_0xba7b('0x49'));}else{throw new Error(_0xba7b('0x4a')+_0x39afb5+'\x22\x20might\x20not\x20exist');}}try{_0x29b0ab=eval(_0x29b0ab)[0x0];}catch(_0x1b08b5){throw new Error(_0xba7b('0x47')+res[_0xba7b('0x21')]);}const _0x3c44ec=_0x29b0ab;_0x2ef91a=path[_0xba7b('0x3b')](__dirname,_0xba7b('0x27'),rs['generate'](0x4)+_0xba7b('0x36'));fs[_0xba7b('0x4b')](_0x2ef91a,_0x29b0ab,{'encoding':_0xba7b('0x29')});_0x42ae9d=path['resolve'](__dirname,_0xba7b('0x27'),rs[_0xba7b('0x35')](0x4)+_0xba7b('0x28'));return convertFile(_0x2ef91a,_0x42ae9d);})[_0xba7b('0x34')](function(){try{fs[_0xba7b('0x3c')](_0x2ef91a);fs['chmodSync'](_0x42ae9d,_0xba7b('0x3d'));}catch(_0x5803fc){logger[_0xba7b('0x16')](_0x5803fc);}logger[_0xba7b('0x24')](_0xba7b('0x4c'),_0x42ae9d[_0xba7b('0x3e')]('.')[0x0]);return _0x42ae9d['split']('.')[0x0];});};exports[_0xba7b('0x4d')]=function(_0x40aa27,_0xbd3b1f,_0xf0f97e){return google[_0xba7b('0x4e')](_0x40aa27,_0xbd3b1f,_0xf0f97e)[_0xba7b('0x34')](function(_0x5037e3){logger[_0xba7b('0x24')](_0x5037e3['uri']);return rp(_0x5037e3);})[_0xba7b('0x34')](function(_0x4c280a){var _0xd2969a='';var _0x45cd89=0x0;try{fs[_0xba7b('0x3c')](_0x40aa27);}catch(_0x1d795c){logger[_0xba7b('0x16')](_0x1d795c);}if(_0x4c280a&&_0x4c280a[_0xba7b('0x4f')]){_0xd2969a=_0x4c280a[_0xba7b('0x4f')][_0xba7b('0x50')](function(_0x290079){return _0x290079&&_0x290079[_0xba7b('0x51')][0x0]&&_0x290079[_0xba7b('0x51')][0x0][_0xba7b('0x52')]?_0x290079[_0xba7b('0x51')][0x0][_0xba7b('0x52')]:'';})[_0xba7b('0x53')]('\x0a');_0x45cd89=_0x4c280a[_0xba7b('0x4f')][_0xba7b('0x50')](function(_0x15f0b7){return _0x15f0b7&&_0x15f0b7[_0xba7b('0x51')][0x0]&&_0x15f0b7[_0xba7b('0x51')][0x0]['confidence']?_0x15f0b7['alternatives'][0x0][_0xba7b('0x54')]:0x0;})['join']('\x0a');}logger[_0xba7b('0x24')](_0xba7b('0x55'),_0xd2969a);logger[_0xba7b('0x24')](_0xba7b('0x56'),_0x45cd89);return{'transcript':_0xd2969a,'confidence':_0x45cd89};})[_0xba7b('0x57')](function(_0x39c0eb){logger[_0xba7b('0x16')]('[%s]\x20%s:%s',_0x39c0eb['statusCode'],_0x39c0eb[_0xba7b('0x58')],_0x39c0eb[_0xba7b('0x59')]);});};exports[_0xba7b('0x5a')]=function(_0x17c823,_0x42ed5d,_0x445af4,_0x2e95ff){var _0x2df991=apiai(_0x42ed5d,{'language':_0x2e95ff||'en'});return _0x2df991[_0xba7b('0x5b')](_0x445af4,{'sessionId':md5(_0x17c823)})['then'](function(_0x3e8a58){logger[_0xba7b('0x24')](JSON['stringify'](_0x3e8a58));return{'source':_0x3e8a58['result'][_0xba7b('0x5c')],'resolvedQuery':_0x3e8a58['result'][_0xba7b('0x5d')],'action':_0x3e8a58['result'][_0xba7b('0x5e')],'actionIncomplete':_0x3e8a58[_0xba7b('0x5f')][_0xba7b('0x60')],'speech':_0x3e8a58[_0xba7b('0x5f')][_0xba7b('0x61')]['speech'],'score':_0x3e8a58[_0xba7b('0x5f')][_0xba7b('0x62')],'statusCode':_0x3e8a58[_0xba7b('0x63')]['code'],'endConversation':_0x3e8a58['result'][_0xba7b('0x64')]['endConversation']||![],'isFallbackIntent':_0x3e8a58[_0xba7b('0x5f')][_0xba7b('0x64')][_0xba7b('0x65')]};});};exports['googleDialogflowV2']=function(_0x33a8a3,_0x52cd2e,_0x2c91bb,_0x4c81c2,_0x15a4fb,_0x1e9d48){var _0x220c09=_0x4c81c2[_0xba7b('0x66')](/\\n/g,'\x0a');var _0x268d25={'credentials':{'private_key':_0x220c09,'client_email':_0x2c91bb}};var _0x10a091=new dialogflow[(_0xba7b('0x67'))](_0x268d25);var _0x300827=_0x10a091['sessionPath'](_0x52cd2e,md5(_0x33a8a3));var _0x374bf3={'session':_0x300827,'queryInput':{'text':{'text':_0x15a4fb,'languageCode':_0x1e9d48}}};return _0x10a091[_0xba7b('0x68')](_0x374bf3)[_0xba7b('0x34')](function(_0x5be00c){if(_0x5be00c&&_0x5be00c['length']){logger[_0xba7b('0x24')](_0xba7b('0x69'),JSON[_0xba7b('0x42')](_0x5be00c));var _0x416efb=_0x5be00c[0x0];if(_0x416efb){var _0x40ad1d={'action':_0x416efb[_0xba7b('0x6a')][_0xba7b('0x5e')],'allRequiredParamsPresent':_0x416efb[_0xba7b('0x6a')][_0xba7b('0x6b')],'endConversation':_0x416efb[_0xba7b('0x6a')][_0xba7b('0x6c')]&&_0x416efb[_0xba7b('0x6a')][_0xba7b('0x6c')][_0xba7b('0x6d')]?_0x416efb[_0xba7b('0x6a')][_0xba7b('0x6c')]['fields']['end_conversation'][_0xba7b('0x6e')]:![],'fulfillmentText':_0x416efb[_0xba7b('0x6a')][_0xba7b('0x6f')],'intentName':_0x416efb['queryResult'][_0xba7b('0x70')][_0xba7b('0x58')],'intentDisplayName':_0x416efb[_0xba7b('0x6a')][_0xba7b('0x70')][_0xba7b('0x71')],'isFallbackIntent':_0x416efb['queryResult']['intent']['isFallback'],'languageCode':_0x416efb['queryResult'][_0xba7b('0x72')],'queryText':_0x416efb[_0xba7b('0x6a')]['queryText'],'responseId':_0x416efb[_0xba7b('0x73')],'score':_0x416efb[_0xba7b('0x6a')][_0xba7b('0x74')],'speech':_0x416efb[_0xba7b('0x6a')]['fulfillmentText'],'providerResponse':JSON[_0xba7b('0x42')](_0x5be00c)};return _0x40ad1d;}}});};exports[_0xba7b('0x75')]=function(_0x5a3266,_0xf161c0,_0x12b889,_0x742aec){return tilde[_0xba7b('0x4e')](_0x5a3266,_0xf161c0,_0x12b889,_0x742aec)[_0xba7b('0x34')](function(_0x274d85){try{fs['unlink'](_0x5a3266);}catch(_0x545e33){logger['error'](_0x545e33);}logger[_0xba7b('0x24')](_0xba7b('0x76'),_0x274d85[_0xba7b('0x52')]);logger[_0xba7b('0x24')](_0xba7b('0x77'),_0x274d85[_0xba7b('0x54')]);return _0x274d85;});};exports[_0xba7b('0x78')]=function(_0x4ede8f,_0x58c5c0,_0x5a0f2a,_0x1a2a56,_0x3ec9ec,_0x24689c){var _0x4ce1a4=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xba7b('0x36'));var _0x51ec07;return aws[_0xba7b('0x79')](_0x4ede8f,_0x58c5c0,_0x5a0f2a,_0x1a2a56,_0x3ec9ec,_0x24689c,_0x4ce1a4)[_0xba7b('0x34')](function(){_0x51ec07=path[_0xba7b('0x3b')](__dirname,'tmp',rs['generate'](0x4)+_0xba7b('0x28'));return convertFile(_0x4ce1a4,_0x51ec07);})['then'](function(){try{fs[_0xba7b('0x3c')](_0x4ce1a4);fs['chmodSync'](_0x51ec07,_0xba7b('0x3d'));}catch(_0x26d548){logger[_0xba7b('0x16')](_0x26d548);}return _0x51ec07['split']('.')[0x0];});};exports['awsLex']=function(_0x59f30a,_0x5b7e51,_0x33aea4,_0x3736f6,_0x20f516,_0x41a685){return aws[_0xba7b('0x7a')](_0x59f30a,_0x5b7e51,_0x33aea4,_0x3736f6,_0x20f516,_0x41a685)[_0xba7b('0x34')](function(_0x3b5979){logger[_0xba7b('0x24')](JSON[_0xba7b('0x42')](_0x3b5979));return _0x3b5979;});};exports[_0xba7b('0x7b')]=function(_0xfe00e5,_0x56bd19,_0x3dfd5a,_0xede1f4){var _0x344df7=util[_0xba7b('0x7c')](_0xba7b('0x7d'),ISPEECH_API,_0xfe00e5,encodeURIComponent(_0x56bd19),_0x3dfd5a,_0xede1f4);var _0xb6ce4e=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xba7b('0x36'));var _0x138a65;return downloadFile(_0x344df7,_0xb6ce4e)[_0xba7b('0x34')](function(){_0x138a65=path['resolve'](__dirname,'tmp',rs[_0xba7b('0x35')](0x4)+_0xba7b('0x28'));return convertFile(_0xb6ce4e,_0x138a65);})[_0xba7b('0x34')](function(){try{fs[_0xba7b('0x3c')](_0xb6ce4e);fs['chmodSync'](_0x138a65,'777');}catch(_0x5bb656){logger[_0xba7b('0x16')](_0x5bb656);}return _0x138a65[_0xba7b('0x3e')]('.')[0x0];});};exports[_0xba7b('0x7e')]=function(_0x300dd1,_0x3214c9,_0x4a644e,_0x70e881){var _0x56832a=util[_0xba7b('0x7c')](_0xba7b('0x7f'),ISPEECH_API,_0x3214c9,_0x4a644e,base64Encode(_0x300dd1),_0x70e881?util[_0xba7b('0x7c')]('model=%s',encodeURIComponent(_0x70e881)):'freeform=3');return uploadFile(_0x56832a)[_0xba7b('0x34')](function(_0x14edd6){return querystring[_0xba7b('0x80')](_0x14edd6);});};exports[_0xba7b('0x81')]=function(_0x1dc290,_0x1dd71f){return sestek[_0xba7b('0x82')](_0x1dc290,_0x1dd71f)[_0xba7b('0x34')](function(_0x171f3f){logger[_0xba7b('0x24')](JSON[_0xba7b('0x42')](_0x171f3f));var _0x10a3b9={'speech':_0x171f3f['text'],'action':_0x171f3f['channelData']?_0x171f3f['channelData'][_0xba7b('0x83')]:undefined,'actiondata':_0x171f3f[_0xba7b('0x84')]?_0x171f3f[_0xba7b('0x84')][_0xba7b('0x85')]:undefined};if(_0x171f3f[_0xba7b('0x84')]&&_0x171f3f['channelData']['AudioFromTts']){return base64Decode(_0x171f3f['channelData'][_0xba7b('0x86')][_0xba7b('0x87')],path[_0xba7b('0x3b')](__dirname,_0xba7b('0x27'),rs[_0xba7b('0x35')](0x4)+'.wav'))[_0xba7b('0x34')](function(_0x5597dc){_0x10a3b9['audiofile']=_0x5597dc;return _0x10a3b9;});}return _0x10a3b9;});};exports[_0xba7b('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0x4306=['action','actionIncomplete','fulfillment','score','status','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','util','./google','./sestek','./tilde','https://api.ispeech.org/api/rest','https:','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','pipe','end','protocol','host','WHAT_EVER','get','transcode','wav','error\x20convert','info','start','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','POST','resolve','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','utf8','f.req=','null','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','tmp','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','name','textRequest','result','source','resolvedQuery'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4306,0xac));var _0x6430=function(_0x5becf7,_0x47df7b){_0x5becf7=_0x5becf7-0x0;var _0x1c4d17=_0x4306[_0x5becf7];return _0x1c4d17;};'use strict';var apiai=require(_0x6430('0x0'));var BPromise=require(_0x6430('0x1'));var dialogflow=require(_0x6430('0x2'));var fs=require('fs');var http=require(_0x6430('0x3'));var https=require(_0x6430('0x4'));var md5=require(_0x6430('0x5'));var path=require(_0x6430('0x6'));var querystring=require('querystring');var rp=require(_0x6430('0x7'));var rs=require(_0x6430('0x8'));var sox=require(_0x6430('0x9'));var tts=require(_0x6430('0xa'));var urlParse=require(_0x6430('0xb'))['parse'];var util=require(_0x6430('0xc'));var aws=require('./aws');var google=require(_0x6430('0xd'));var sestek=require(_0x6430('0xe'));var tilde=require(_0x6430('0xf'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x6430('0x10');function downloadFile(_0x125a2e,_0x16d6fe){return new BPromise(function(_0x1a8980,_0x570466){var _0x8e7f2d=urlParse(_0x125a2e);var _0x220bb5=_0x8e7f2d['protocol']===_0x6430('0x11')?https:http;var _0x3fe0d3={'host':_0x8e7f2d['host'],'path':_0x8e7f2d[_0x6430('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x220bb5['get'](_0x3fe0d3,function(_0x10f235){if(_0x10f235[_0x6430('0x12')]!==0xc8){logger[_0x6430('0x13')](_0x6430('0x14')+_0x125a2e+_0x6430('0x15')+_0x10f235[_0x6430('0x12')]+'\x20('+_0x10f235['statusMessage']+')');_0x570466(new Error(_0x6430('0x14')+_0x125a2e+_0x6430('0x15')+_0x10f235['statusCode']+'\x20('+_0x10f235[_0x6430('0x16')]+')'));return;}var _0x4fc89f=fs['createWriteStream'](_0x16d6fe);_0x4fc89f['on'](_0x6430('0x17'),function(){logger['info'](_0x6430('0x18'));_0x4fc89f['close'](_0x1a8980);});_0x4fc89f['on'](_0x6430('0x13'),function(_0x3f760f){fs['unlink'](_0x16d6fe);logger[_0x6430('0x13')]('download\x20error',_0x3f760f);_0x570466(_0x3f760f);});_0x10f235[_0x6430('0x19')](_0x4fc89f);})['on'](_0x6430('0x13'),function(_0x4d6509){logger[_0x6430('0x13')](_0x4d6509);_0x570466(_0x4d6509);})[_0x6430('0x1a')]();});}function uploadFile(_0x1bb06b){return new BPromise(function(_0x3a5c18,_0x13a07a){var _0x2f5446=urlParse(_0x1bb06b);var _0x5324c8=_0x2f5446[_0x6430('0x1b')]===_0x6430('0x11')?https:http;var _0x5e0d95={'host':_0x2f5446[_0x6430('0x1c')],'path':_0x2f5446[_0x6430('0x6')],'headers':{'user-agent':_0x6430('0x1d')}};_0x5324c8[_0x6430('0x1e')](_0x5e0d95,function(_0x4cf92f){if(_0x4cf92f[_0x6430('0x12')]!==0xc8){_0x13a07a(new Error(_0x6430('0x14')+_0x1bb06b+_0x6430('0x15')+_0x4cf92f['statusCode']+'\x20('+_0x4cf92f[_0x6430('0x16')]+')'));return;}var _0x4f0f93='';_0x4cf92f['on']('data',function(_0x54b2fa){_0x4f0f93+=_0x54b2fa;});_0x4cf92f['on'](_0x6430('0x1a'),function(){_0x3a5c18(_0x4f0f93);});})['on'](_0x6430('0x13'),function(_0x2850a9){_0x13a07a(_0x2850a9);})[_0x6430('0x1a')]();});}function convertFile(_0x56fc1c,_0x1a075d){return new BPromise(function(_0x320464,_0x4b0ae9){var _0x49aae7=sox[_0x6430('0x1f')](_0x56fc1c,_0x1a075d,{'sampleRate':0x1f40,'format':_0x6430('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x49aae7['on'](_0x6430('0x13'),function(_0x4e0ced){logger[_0x6430('0x13')](_0x6430('0x21'),_0x4e0ced);_0x4b0ae9(_0x4e0ced);});_0x49aae7['on'](_0x6430('0x1a'),function(){logger[_0x6430('0x22')]('finish\x20to\x20convert');_0x320464();});_0x49aae7[_0x6430('0x23')]();});}function base64Decode(_0x338fa0,_0x5e987c){var _0x1009a5=path['resolve'](__dirname,'tmp',rs[_0x6430('0x24')](0x4)+_0x6430('0x25'));fs[_0x6430('0x26')](_0x1009a5,_0x338fa0,_0x6430('0x27'));return convertFile(_0x1009a5,_0x5e987c)[_0x6430('0x28')](function(){try{fs[_0x6430('0x29')](_0x1009a5);fs[_0x6430('0x2a')](_0x5e987c,_0x6430('0x2b'));}catch(_0x291af3){logger['error'](_0x291af3);}return _0x5e987c['split']('.')[0x0];});}function base64Encode(_0x4d6b82){var _0x38c405=fs[_0x6430('0x2c')](_0x4d6b82);return new Buffer(_0x38c405)[_0x6430('0x2d')](_0x6430('0x27'));}exports[_0x6430('0x2e')]=function(_0x141df5,_0x1b8d4c,_0x58427f,_0x334fd0,_0x153b99,_0x4d0c3b){var _0x27d98c,_0x33eb21;var _0x4c7d5f=_0x6430('0x2f');var _0x56f85c=_0x6430('0x30')+_0x141df5;var _0xc89db1={};if(_0x1b8d4c==='ssml'){_0xc89db1[_0x6430('0x31')]={'ssml':_0x58427f};}else{_0xc89db1[_0x6430('0x31')]={'text':_0x58427f};};_0xc89db1[_0x6430('0x32')]={'languageCode':_0x334fd0,'ssmlGender':_0x153b99};_0xc89db1[_0x6430('0x33')]={'audioEncoding':_0x6430('0x34'),'sampleRateHertz':0x1f40};var _0x412937={'url':_0x4c7d5f+'text:synthesize'+_0x56f85c,'method':_0x6430('0x35'),'json':!![],'body':_0xc89db1};return rp(_0x412937)[_0x6430('0x28')](function(_0x1e4d0b){return new BPromise(function(_0x4779cf,_0x2b9bb3){_0x27d98c=path[_0x6430('0x36')](__dirname,'tmp',rs[_0x6430('0x24')](0x4)+_0x6430('0x37'));var _0x301c85=Buffer[_0x6430('0x38')](_0x1e4d0b[_0x6430('0x39')],_0x6430('0x27'));return fs[_0x6430('0x3a')](_0x27d98c,_0x301c85,function(_0x229ef3){_0x2b9bb3(_0x229ef3);},function(_0x1462a5){fs[_0x6430('0x2a')](_0x27d98c,_0x6430('0x2b'));_0x4779cf(_0x1462a5);});});})[_0x6430('0x28')](function(_0x366329){_0x33eb21=path[_0x6430('0x36')](__dirname,'tmp',rs[_0x6430('0x24')](0x4)+_0x6430('0x25'));return convertFile(_0x27d98c,_0x33eb21);})[_0x6430('0x28')](function(){try{fs[_0x6430('0x29')](_0x27d98c);fs[_0x6430('0x2a')](_0x33eb21,'777');}catch(_0xe8827d){logger[_0x6430('0x13')](_0xe8827d);}logger[_0x6430('0x22')](_0x6430('0x3b'),_0x33eb21[_0x6430('0x3c')]('.')[0x0]);return _0x33eb21[_0x6430('0x3c')]('.')[0x0];});};exports['googleTTS']=function(_0x56f3f2,_0x22dfe0){var _0x4d619e='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x111ae0,_0x42d8a8;var _0x1bb609;var _0x1eae10={'encoding':_0x6430('0x3d'),'method':'POST','timeout':0x2710,'url':_0x4d619e,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x6430('0x3e')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x56f3f2,_0x22dfe0||'en',![],_0x6430('0x3f')]),null,'generic']]]))};return rp(_0x1eae10)[_0x6430('0x28')](function(_0x5b6541){try{_0x1bb609=eval(_0x5b6541[_0x6430('0x40')](0x5))[0x0][0x2];}catch(_0x4c5069){throw new Error(_0x6430('0x41')+_0x5b6541[_0x6430('0x42')]);}if(!_0x1bb609){if(_0x56f3f2[_0x6430('0x43')]>0xc8){throw new Error(_0x6430('0x44'));}else{throw new Error(_0x6430('0x45')+_0x22dfe0+_0x6430('0x46'));}}try{_0x1bb609=eval(_0x1bb609)[0x0];}catch(_0x176e59){throw new Error(_0x6430('0x41')+res[_0x6430('0x42')]);}const _0x339d89=_0x1bb609;_0x111ae0=path[_0x6430('0x36')](__dirname,_0x6430('0x47'),rs[_0x6430('0x24')](0x4)+_0x6430('0x37'));fs[_0x6430('0x26')](_0x111ae0,_0x1bb609,{'encoding':_0x6430('0x27')});_0x42d8a8=path[_0x6430('0x36')](__dirname,_0x6430('0x47'),rs[_0x6430('0x24')](0x4)+_0x6430('0x25'));return convertFile(_0x111ae0,_0x42d8a8);})['then'](function(){try{fs[_0x6430('0x29')](_0x111ae0);fs['chmodSync'](_0x42d8a8,_0x6430('0x2b'));}catch(_0x5193e6){logger[_0x6430('0x13')](_0x5193e6);}logger[_0x6430('0x22')](_0x6430('0x48'),_0x42d8a8[_0x6430('0x3c')]('.')[0x0]);return _0x42d8a8[_0x6430('0x3c')]('.')[0x0];});};exports[_0x6430('0x49')]=function(_0x8d84f,_0x4fd0a1,_0x5e96d4){return google[_0x6430('0x4a')](_0x8d84f,_0x4fd0a1,_0x5e96d4)[_0x6430('0x28')](function(_0x5abc1a){logger[_0x6430('0x22')](_0x5abc1a['uri']);return rp(_0x5abc1a);})[_0x6430('0x28')](function(_0x40666a){var _0x4fe5f5='';var _0x444832=0x0;try{fs['unlink'](_0x8d84f);}catch(_0x147cb2){logger[_0x6430('0x13')](_0x147cb2);}if(_0x40666a&&_0x40666a[_0x6430('0x4b')]){_0x4fe5f5=_0x40666a['results'][_0x6430('0x4c')](function(_0x581687){return _0x581687&&_0x581687[_0x6430('0x4d')][0x0]&&_0x581687['alternatives'][0x0][_0x6430('0x4e')]?_0x581687[_0x6430('0x4d')][0x0]['transcript']:'';})[_0x6430('0x4f')]('\x0a');_0x444832=_0x40666a['results'][_0x6430('0x4c')](function(_0x4259a7){return _0x4259a7&&_0x4259a7['alternatives'][0x0]&&_0x4259a7[_0x6430('0x4d')][0x0][_0x6430('0x50')]?_0x4259a7['alternatives'][0x0][_0x6430('0x50')]:0x0;})[_0x6430('0x4f')]('\x0a');}logger['info']('googleASR\x20transcription',_0x4fe5f5);logger[_0x6430('0x22')]('googleASR\x20confidence',_0x444832);return{'transcript':_0x4fe5f5,'confidence':_0x444832};})['catch'](function(_0x91d03d){logger[_0x6430('0x13')]('[%s]\x20%s:%s',_0x91d03d[_0x6430('0x12')],_0x91d03d[_0x6430('0x51')],_0x91d03d['message']);});};exports['googleDialogflow']=function(_0x20a2fd,_0x223892,_0x18814b,_0x528aed){var _0x2626fd=apiai(_0x223892,{'language':_0x528aed||'en'});return _0x2626fd[_0x6430('0x52')](_0x18814b,{'sessionId':md5(_0x20a2fd)})['then'](function(_0x14590b){logger[_0x6430('0x22')](JSON['stringify'](_0x14590b));return{'source':_0x14590b[_0x6430('0x53')][_0x6430('0x54')],'resolvedQuery':_0x14590b[_0x6430('0x53')][_0x6430('0x55')],'action':_0x14590b[_0x6430('0x53')][_0x6430('0x56')],'actionIncomplete':_0x14590b[_0x6430('0x53')][_0x6430('0x57')],'speech':_0x14590b[_0x6430('0x53')][_0x6430('0x58')]['speech'],'score':_0x14590b[_0x6430('0x53')][_0x6430('0x59')],'statusCode':_0x14590b[_0x6430('0x5a')]['code'],'endConversation':_0x14590b[_0x6430('0x53')]['metadata']['endConversation']||![],'isFallbackIntent':_0x14590b[_0x6430('0x53')][_0x6430('0x5b')][_0x6430('0x5c')]};});};exports[_0x6430('0x5d')]=function(_0x13a70a,_0x100144,_0x1298bb,_0x5aaa77,_0x287c8b,_0x42c8ad){var _0xb05b9c=_0x5aaa77[_0x6430('0x5e')](/\\n/g,'\x0a');var _0x4ef431={'credentials':{'private_key':_0xb05b9c,'client_email':_0x1298bb}};var _0x379c47=new dialogflow[(_0x6430('0x5f'))](_0x4ef431);var _0xf37698=_0x379c47[_0x6430('0x60')](_0x100144,md5(_0x13a70a));var _0x3649cb={'session':_0xf37698,'queryInput':{'text':{'text':_0x287c8b,'languageCode':_0x42c8ad}}};return _0x379c47[_0x6430('0x61')](_0x3649cb)['then'](function(_0x59994d){if(_0x59994d&&_0x59994d[_0x6430('0x43')]){logger[_0x6430('0x22')]('Dialogflow\x20V2\x20response:',JSON[_0x6430('0x62')](_0x59994d));var _0x2a072c=_0x59994d[0x0];if(_0x2a072c){var _0x2e8e7f={'action':_0x2a072c[_0x6430('0x63')][_0x6430('0x56')],'allRequiredParamsPresent':_0x2a072c[_0x6430('0x63')][_0x6430('0x64')],'endConversation':_0x2a072c[_0x6430('0x63')][_0x6430('0x65')]&&_0x2a072c[_0x6430('0x63')][_0x6430('0x65')]['fields']?_0x2a072c[_0x6430('0x63')]['diagnosticInfo'][_0x6430('0x66')][_0x6430('0x67')]['boolValue']:![],'fulfillmentText':_0x2a072c[_0x6430('0x63')][_0x6430('0x68')],'intentName':_0x2a072c[_0x6430('0x63')][_0x6430('0x69')][_0x6430('0x51')],'intentDisplayName':_0x2a072c[_0x6430('0x63')][_0x6430('0x69')][_0x6430('0x6a')],'isFallbackIntent':_0x2a072c['queryResult'][_0x6430('0x69')][_0x6430('0x6b')],'languageCode':_0x2a072c[_0x6430('0x63')][_0x6430('0x6c')],'queryText':_0x2a072c['queryResult'][_0x6430('0x6d')],'responseId':_0x2a072c['responseId'],'score':_0x2a072c[_0x6430('0x63')][_0x6430('0x6e')],'speech':_0x2a072c[_0x6430('0x63')][_0x6430('0x68')],'providerResponse':JSON[_0x6430('0x62')](_0x59994d)};return _0x2e8e7f;}}});};exports['tildeASR']=function(_0xc61761,_0x5bd902,_0x40e51d,_0x53ef9e){return tilde[_0x6430('0x4a')](_0xc61761,_0x5bd902,_0x40e51d,_0x53ef9e)[_0x6430('0x28')](function(_0x425484){try{fs['unlink'](_0xc61761);}catch(_0x135a97){logger[_0x6430('0x13')](_0x135a97);}logger[_0x6430('0x22')](_0x6430('0x6f'),_0x425484[_0x6430('0x4e')]);logger[_0x6430('0x22')](_0x6430('0x70'),_0x425484[_0x6430('0x50')]);return _0x425484;});};exports['awsPolly']=function(_0x4cb5a7,_0x1530d1,_0x3408d4,_0x4551d9,_0x5447cd,_0x5cf783){var _0x5f11bd=path[_0x6430('0x36')](__dirname,_0x6430('0x47'),rs[_0x6430('0x24')](0x4)+_0x6430('0x37'));var _0x34bb1b;return aws[_0x6430('0x71')](_0x4cb5a7,_0x1530d1,_0x3408d4,_0x4551d9,_0x5447cd,_0x5cf783,_0x5f11bd)[_0x6430('0x28')](function(){_0x34bb1b=path[_0x6430('0x36')](__dirname,_0x6430('0x47'),rs[_0x6430('0x24')](0x4)+_0x6430('0x25'));return convertFile(_0x5f11bd,_0x34bb1b);})[_0x6430('0x28')](function(){try{fs[_0x6430('0x29')](_0x5f11bd);fs['chmodSync'](_0x34bb1b,_0x6430('0x2b'));}catch(_0x2c8222){logger[_0x6430('0x13')](_0x2c8222);}return _0x34bb1b[_0x6430('0x3c')]('.')[0x0];});};exports[_0x6430('0x72')]=function(_0x1ea861,_0x5bee3a,_0x86e832,_0x15cd8f,_0x355e3f,_0x32fa18){return aws[_0x6430('0x73')](_0x1ea861,_0x5bee3a,_0x86e832,_0x15cd8f,_0x355e3f,_0x32fa18)['then'](function(_0x12c869){logger[_0x6430('0x22')](JSON['stringify'](_0x12c869));return _0x12c869;});};exports['ispeechTTS']=function(_0x41791d,_0x523b8a,_0x130a14,_0x2c5100){var _0x211bb1=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x41791d,encodeURIComponent(_0x523b8a),_0x130a14,_0x2c5100);var _0x5820c9=path[_0x6430('0x36')](__dirname,_0x6430('0x47'),rs[_0x6430('0x24')](0x4)+_0x6430('0x37'));var _0x69f649;return downloadFile(_0x211bb1,_0x5820c9)[_0x6430('0x28')](function(){_0x69f649=path[_0x6430('0x36')](__dirname,'tmp',rs['generate'](0x4)+_0x6430('0x25'));return convertFile(_0x5820c9,_0x69f649);})[_0x6430('0x28')](function(){try{fs[_0x6430('0x29')](_0x5820c9);fs[_0x6430('0x2a')](_0x69f649,_0x6430('0x2b'));}catch(_0x5df73e){logger['error'](_0x5df73e);}return _0x69f649[_0x6430('0x3c')]('.')[0x0];});};exports[_0x6430('0x74')]=function(_0x31c813,_0x20ce3b,_0x178c6b,_0x476f08){var _0x81bf80=util[_0x6430('0x75')](_0x6430('0x76'),ISPEECH_API,_0x20ce3b,_0x178c6b,base64Encode(_0x31c813),_0x476f08?util[_0x6430('0x75')](_0x6430('0x77'),encodeURIComponent(_0x476f08)):_0x6430('0x78'));return uploadFile(_0x81bf80)[_0x6430('0x28')](function(_0x4dc03b){return querystring[_0x6430('0x79')](_0x4dc03b);});};exports['sestekNDA']=function(_0x4b7458,_0x315fec){return sestek['nda'](_0x4b7458,_0x315fec)[_0x6430('0x28')](function(_0x3e5283){logger[_0x6430('0x22')](JSON['stringify'](_0x3e5283));var _0x206a8e={'speech':_0x3e5283['text'],'action':_0x3e5283[_0x6430('0x7a')]?_0x3e5283[_0x6430('0x7a')][_0x6430('0x7b')]:undefined,'actiondata':_0x3e5283[_0x6430('0x7a')]?_0x3e5283['channelData'][_0x6430('0x7c')]:undefined};if(_0x3e5283[_0x6430('0x7a')]&&_0x3e5283[_0x6430('0x7a')][_0x6430('0x7d')]){return base64Decode(_0x3e5283['channelData'][_0x6430('0x7d')][_0x6430('0x7e')],path['resolve'](__dirname,_0x6430('0x47'),rs[_0x6430('0x24')](0x4)+_0x6430('0x25')))[_0x6430('0x28')](function(_0x247c9e){_0x206a8e[_0x6430('0x7f')]=_0x247c9e;return _0x206a8e;});}return _0x206a8e;});};exports[_0x6430('0x80')]=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 acebce8..31ff961 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 _0x05ac=['./nda','exports'];(function(_0x410e66,_0x35208f){var _0x178b9e=function(_0x6bc933){while(--_0x6bc933){_0x410e66['push'](_0x410e66['shift']());}};_0x178b9e(++_0x35208f);}(_0x05ac,0x72));var _0xc05a=function(_0x2b09cc,_0x322adf){_0x2b09cc=_0x2b09cc-0x0;var _0x50ec0d=_0x05ac[_0x2b09cc];return _0x50ec0d;};var nda=require(_0xc05a('0x0'));module[_0xc05a('0x1')]={'nda':nda}; \ No newline at end of file +var _0x404e=['./nda'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0x404e,0x163));var _0xe404=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x404e[_0x4b174a];return _0x3cd7bf;};var nda=require(_0xe404('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 10aa742..41989c8 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 _0x2e35=['uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','request-promise','url','../../../../../config/logger','exports','resolve','ndauth_url','/token','password','ndassistant_url','ndaactivity_type','message'];(function(_0x517706,_0x525d73){var _0x3b2305=function(_0x148a13){while(--_0x148a13){_0x517706['push'](_0x517706['shift']());}};_0x3b2305(++_0x525d73);}(_0x2e35,0x1d0));var _0x52e3=function(_0x7f0a3b,_0x378ca2){_0x7f0a3b=_0x7f0a3b-0x0;var _0x213534=_0x2e35[_0x7f0a3b];return _0x213534;};'use strict';var rp=require(_0x52e3('0x0'));var url=require(_0x52e3('0x1'));var logger=require(_0x52e3('0x2'))('agi');module[_0x52e3('0x3')]=function(_0xcbe6c5,_0x16d807){var _0x3dc244={'method':'POST','uri':url[_0x52e3('0x4')](_0x16d807[_0x52e3('0x5')],_0x52e3('0x6')),'form':{'grant_type':_0x52e3('0x7'),'username':_0x16d807['username'],'password':_0x16d807['password']},'json':!![]};return rp(_0x3dc244)['then'](function(_0x21ae13){var _0x4d77a0={'method':'POST','uri':url[_0x52e3('0x4')](_0x16d807[_0x52e3('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x16d807[_0x52e3('0x9')]||_0x52e3('0xa'),'channelId':'Nda','conversation':{'id':_0xcbe6c5[_0x52e3('0xb')]},'from':{'id':_0xcbe6c5['callerid'],'name':_0xcbe6c5[_0x52e3('0xc')]},'recipient':{'id':_0xcbe6c5[_0x52e3('0xd')],'name':_0xcbe6c5[_0x52e3('0xe')]},'text':_0x16d807['text'],'channelData':{}},'headers':{'Authorization':_0x52e3('0xf')+_0x21ae13[_0x52e3('0x10')]},'json':!![]};if(_0x16d807['project']){_0x4d77a0[_0x52e3('0x11')]['channelData']['ProjectName']=_0x16d807['project'];}if(_0x16d807['ndagenerate_audio']=='1'){_0x4d77a0['body'][_0x52e3('0x12')][_0x52e3('0x13')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x52e3('0x14')};}if(_0x16d807[_0x52e3('0x15')]){_0x4d77a0[_0x52e3('0x11')][_0x52e3('0x12')][_0x52e3('0x16')]=_0x16d807[_0x52e3('0x15')];if(_0x16d807[_0x52e3('0x17')]){_0x4d77a0[_0x52e3('0x11')][_0x52e3('0x12')]['CustomActionData']=_0x16d807[_0x52e3('0x17')];}}logger[_0x52e3('0x18')](JSON['stringify'](_0x4d77a0));return rp(_0x4d77a0);});}; \ No newline at end of file +var _0xe829=['body','channelData','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','request-promise','url','../../../../../config/logger','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe829,0x1d8));var _0x9e82=function(_0x298b27,_0x47ab26){_0x298b27=_0x298b27-0x0;var _0x2074bb=_0xe829[_0x298b27];return _0x2074bb;};'use strict';var rp=require(_0x9e82('0x0'));var url=require(_0x9e82('0x1'));var logger=require(_0x9e82('0x2'))('agi');module['exports']=function(_0xf56525,_0x337730){var _0x1b47d8={'method':_0x9e82('0x3'),'uri':url[_0x9e82('0x4')](_0x337730[_0x9e82('0x5')],'/token'),'form':{'grant_type':_0x9e82('0x6'),'username':_0x337730[_0x9e82('0x7')],'password':_0x337730[_0x9e82('0x6')]},'json':!![]};return rp(_0x1b47d8)[_0x9e82('0x8')](function(_0x2d91ba){var _0x5c4c57={'method':_0x9e82('0x3'),'uri':url['resolve'](_0x337730[_0x9e82('0x9')],_0x9e82('0xa')),'body':{'type':_0x337730['ndaactivity_type']||'message','channelId':_0x9e82('0xb'),'conversation':{'id':_0xf56525[_0x9e82('0xc')]},'from':{'id':_0xf56525[_0x9e82('0xd')],'name':_0xf56525[_0x9e82('0xe')]},'recipient':{'id':_0xf56525[_0x9e82('0xf')],'name':_0xf56525[_0x9e82('0x10')]},'text':_0x337730[_0x9e82('0x11')],'channelData':{}},'headers':{'Authorization':_0x9e82('0x12')+_0x2d91ba[_0x9e82('0x13')]},'json':!![]};if(_0x337730[_0x9e82('0x14')]){_0x5c4c57[_0x9e82('0x15')][_0x9e82('0x16')]['ProjectName']=_0x337730['project'];}if(_0x337730[_0x9e82('0x17')]=='1'){_0x5c4c57[_0x9e82('0x15')][_0x9e82('0x16')][_0x9e82('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x337730[_0x9e82('0x19')]){_0x5c4c57[_0x9e82('0x15')][_0x9e82('0x16')][_0x9e82('0x1a')]=_0x337730['custom_action'];if(_0x337730[_0x9e82('0x1b')]){_0x5c4c57[_0x9e82('0x15')][_0x9e82('0x16')][_0x9e82('0x1c')]=_0x337730['custom_action_data'];}}logger['info'](JSON['stringify'](_0x5c4c57));return rp(_0x5c4c57);});}; \ 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 77a00b9..109ce8c 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x31910c,_0x295ecb,_0x34660e,_0x47aed8){return asr(_0x31910c,_0x295ecb,_0x34660e,_0x47aed8);}; \ No newline at end of file +var _0x77c0=['./lib/api','exports'];(function(_0x10cec9,_0x301932){var _0x5cf6de=function(_0x252540){while(--_0x252540){_0x10cec9['push'](_0x10cec9['shift']());}};_0x5cf6de(++_0x301932);}(_0x77c0,0x96));var _0x077c=function(_0xb02598,_0x4a6330){_0xb02598=_0xb02598-0x0;var _0x34b3c1=_0x77c0[_0xb02598];return _0x34b3c1;};'use strict';var asr=require(_0x077c('0x0'));module[_0x077c('0x1')]=function(_0x477a19,_0x30fc0d,_0x42d103,_0x1d6b1d){return asr(_0x477a19,_0x30fc0d,_0x42d103,_0x1d6b1d);}; \ 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 c56af16..ca51789 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 _0x1c7e=['parse','result','final','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','moment','crypto','agi','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','info','unix','send','createReadStream','close','EOS','stringify','terminate'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1c7e,0x1a3));var _0xe1c7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1c7e[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0xe1c7('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe1c7('0x1'));var crypto=require(_0xe1c7('0x2'));var logger=require('../../../../../../config/logger')(_0xe1c7('0x3'));module['exports']=function(_0x4d69ae,_0x305373,_0x282ee0,_0x28c780){return new BPromise(function(_0x40e9d0,_0x1a27f1){logger['info'](_0xe1c7('0x4'),_0x28c780||_0xe1c7('0x5'));var _0x2e7657=new WebSocket(_0x28c780||_0xe1c7('0x5'),{'perMessageDeflate':![]});var _0x39895e='';var _0x398eb8='0';var _0x274b17='1';var _0x5a7c47=_0xe1c7('0x6');function _0xd2663a(_0x5b4f06){var _0x367707=crypto['createHash']('sha1');_0x367707['update'](_0x5b4f06);return _0x367707['digest']('hex');}function _0x5d781e(){try{logger[_0xe1c7('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x41306f=moment()[_0xe1c7('0x8')]();var _0x271eb5=_0xd2663a(_0x41306f+_0x305373+_0x282ee0);_0x2e7657[_0xe1c7('0x9')](JSON['stringify']({'appID':_0x305373,'timestamp':_0x41306f,'appKey':_0x271eb5}));var _0x180b70=fs[_0xe1c7('0xa')](_0x4d69ae);_0x180b70['on']('data',function(_0x234b4b){_0x2e7657['send'](_0x234b4b);});_0x180b70['on'](_0xe1c7('0xb'),function(){_0x2e7657[_0xe1c7('0x9')](_0xe1c7('0xc'));});}catch(_0x55dba2){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0xe1c7('0xd')](_0x55dba2));_0x2e7657[_0xe1c7('0xe')]();}}function _0x31733e(_0x4a4c3d){try{if(_0x4a4c3d){var _0xbb145d=JSON[_0xe1c7('0xf')](_0x4a4c3d);switch(_0xbb145d['status']){case 0x0:if(_0xbb145d[_0xe1c7('0x10')]){if(_0xbb145d[_0xe1c7('0x10')][_0xe1c7('0x11')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xe1c7('0xd')](_0xbb145d[_0xe1c7('0x10')][_0xe1c7('0x12')]));_0x39895e=_0xbb145d[_0xe1c7('0x10')]['hypotheses'][0x0][_0xe1c7('0x13')];_0x398eb8=_0xbb145d[_0xe1c7('0x10')][_0xe1c7('0x12')][0x0][_0xe1c7('0x14')];_0x274b17='0';_0x5a7c47='Success.';_0x2e7657[_0xe1c7('0xe')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x274b17='1';_0x5a7c47='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xe1c7('0x7')](_0xe1c7('0x15'));_0x274b17='2';_0x5a7c47='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xe1c7('0x7')](_0xe1c7('0x16'));_0x274b17='9';_0x5a7c47=_0xe1c7('0x16');break;case 0xa:logger['info'](_0xe1c7('0x17'));_0x274b17='10';_0x5a7c47=_0xe1c7('0x17');break;case 0xb:logger[_0xe1c7('0x7')](_0xe1c7('0x18'));_0x274b17='11';_0x5a7c47=_0xe1c7('0x18');}}}catch(_0x1f4e8e){logger[_0xe1c7('0x19')](_0xe1c7('0x1a'),JSON[_0xe1c7('0xd')](_0x1f4e8e));_0x2e7657['terminate']();}}function _0x1ad12b(){logger[_0xe1c7('0x7')](_0xe1c7('0x1b'));_0x40e9d0({'transcript':_0x39895e,'confidence':_0x398eb8,'status':_0x274b17,'status_message':_0x5a7c47});}function _0x55a2e7(_0x4a6170){logger[_0xe1c7('0x19')](_0xe1c7('0x1c'));if(!_[_0xe1c7('0x1d')](_0x4a6170)){logger[_0xe1c7('0x19')](_['isObject'](_0x4a6170)?JSON[_0xe1c7('0xd')](_0x4a6170):_0x4a6170);}}_0x2e7657['on'](_0xe1c7('0x1e'),_0x5d781e);_0x2e7657['on']('message',_0x31733e);_0x2e7657['on'](_0xe1c7('0xb'),_0x1ad12b);_0x2e7657['on'](_0xe1c7('0x19'),_0x55a2e7);});}; \ No newline at end of file +var _0x8ad6=['close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto','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','createHash','sha1','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data'];(function(_0xb6e4d7,_0x532cc7){var _0x4a80c3=function(_0x27d74d){while(--_0x27d74d){_0xb6e4d7['push'](_0xb6e4d7['shift']());}};_0x4a80c3(++_0x532cc7);}(_0x8ad6,0x145));var _0x68ad=function(_0x2f3dc5,_0x49a85e){_0x2f3dc5=_0x2f3dc5-0x0;var _0x14c5bd=_0x8ad6[_0x2f3dc5];return _0x14c5bd;};'use strict';var BPromise=require('bluebird');var _=require(_0x68ad('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x68ad('0x1'));var crypto=require(_0x68ad('0x2'));var logger=require('../../../../../../config/logger')('agi');module[_0x68ad('0x3')]=function(_0x4c9796,_0x499092,_0x526db9,_0xbaadb3){return new BPromise(function(_0x372da3,_0x4bef0e){logger[_0x68ad('0x4')](_0x68ad('0x5'),_0xbaadb3||_0x68ad('0x6'));var _0x68dbb0=new WebSocket(_0xbaadb3||_0x68ad('0x6'),{'perMessageDeflate':![]});var _0x467303='';var _0x42b70d='0';var _0x13f050='1';var _0x596733=_0x68ad('0x7');function _0x47dd5a(_0x8307d){var _0xa4ecb6=crypto[_0x68ad('0x8')](_0x68ad('0x9'));_0xa4ecb6['update'](_0x8307d);return _0xa4ecb6['digest'](_0x68ad('0xa'));}function _0x1c794b(){try{logger[_0x68ad('0x4')](_0x68ad('0xb'));var _0x3c46c5=moment()[_0x68ad('0xc')]();var _0x453700=_0x47dd5a(_0x3c46c5+_0x499092+_0x526db9);_0x68dbb0[_0x68ad('0xd')](JSON[_0x68ad('0xe')]({'appID':_0x499092,'timestamp':_0x3c46c5,'appKey':_0x453700}));var _0x5f0708=fs[_0x68ad('0xf')](_0x4c9796);_0x5f0708['on'](_0x68ad('0x10'),function(_0x4c3470){_0x68dbb0[_0x68ad('0xd')](_0x4c3470);});_0x5f0708['on'](_0x68ad('0x11'),function(){_0x68dbb0['send']('EOS');});}catch(_0x1b0e01){logger[_0x68ad('0x12')](_0x68ad('0x13'),JSON[_0x68ad('0xe')](_0x1b0e01));_0x68dbb0[_0x68ad('0x14')]();}}function _0x4bb502(_0x5959c2){try{if(_0x5959c2){var _0x32c09d=JSON[_0x68ad('0x15')](_0x5959c2);switch(_0x32c09d[_0x68ad('0x16')]){case 0x0:if(_0x32c09d[_0x68ad('0x17')]){if(_0x32c09d[_0x68ad('0x17')][_0x68ad('0x18')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x68ad('0xe')](_0x32c09d[_0x68ad('0x17')][_0x68ad('0x19')]));_0x467303=_0x32c09d[_0x68ad('0x17')][_0x68ad('0x19')][0x0]['transcript'];_0x42b70d=_0x32c09d[_0x68ad('0x17')]['hypotheses'][0x0][_0x68ad('0x1a')];_0x13f050='0';_0x596733=_0x68ad('0x1b');_0x68dbb0[_0x68ad('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x13f050='1';_0x596733=_0x68ad('0x7');break;case 0x2:logger[_0x68ad('0x4')](_0x68ad('0x1c'));_0x13f050='2';_0x596733=_0x68ad('0x1c');break;case 0x9:logger['info'](_0x68ad('0x1d'));_0x13f050='9';_0x596733=_0x68ad('0x1d');break;case 0xa:logger[_0x68ad('0x4')](_0x68ad('0x1e'));_0x13f050='10';_0x596733=_0x68ad('0x1e');break;case 0xb:logger['info'](_0x68ad('0x1f'));_0x13f050='11';_0x596733=_0x68ad('0x1f');}}}catch(_0x387538){logger['error'](_0x68ad('0x20'),JSON[_0x68ad('0xe')](_0x387538));_0x68dbb0[_0x68ad('0x14')]();}}function _0x579927(){logger[_0x68ad('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x372da3({'transcript':_0x467303,'confidence':_0x42b70d,'status':_0x13f050,'status_message':_0x596733});}function _0x4c9b34(_0x26cd20){logger['error'](_0x68ad('0x21'));if(!_[_0x68ad('0x22')](_0x26cd20)){logger[_0x68ad('0x12')](_[_0x68ad('0x23')](_0x26cd20)?JSON[_0x68ad('0xe')](_0x26cd20):_0x26cd20);}}_0x68dbb0['on'](_0x68ad('0x24'),_0x1c794b);_0x68dbb0['on'](_0x68ad('0x25'),_0x4bb502);_0x68dbb0['on'](_0x68ad('0x11'),_0x579927);_0x68dbb0['on'](_0x68ad('0x12'),_0x4c9b34);});}; \ 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 bdc47c2..18c5430 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 _0x3863=['exports','./asr'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x3863,0x1d9));var _0x3386=function(_0x469112,_0x55e3a4){_0x469112=_0x469112-0x0;var _0x9ef574=_0x3863[_0x469112];return _0x9ef574;};var asr=require(_0x3386('0x0'));module[_0x3386('0x1')]={'asr':asr}; \ No newline at end of file +var _0x660f=['./asr'];(function(_0x4d00e5,_0x35d731){var _0x38218a=function(_0x9aedbd){while(--_0x9aedbd){_0x4d00e5['push'](_0x4d00e5['shift']());}};_0x38218a(++_0x35d731);}(_0x660f,0xc9));var _0xf660=function(_0x1fe06d,_0x555513){_0x1fe06d=_0x1fe06d-0x0;var _0xfcb0b4=_0x660f[_0x1fe06d];return _0xfcb0b4;};var asr=require(_0xf660('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 1cafba8..e1eef57 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 _0xfd0d=['inherits','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x4b4542,_0x456112){var _0x53983b=function(_0xd634e7){while(--_0xd634e7){_0x4b4542['push'](_0x4b4542['shift']());}};_0x53983b(++_0x456112);}(_0xfd0d,0x1e2));var _0xdfd0=function(_0x426c55,_0x2356eb){_0x426c55=_0x426c55-0x0;var _0x55f62f=_0xfd0d[_0x426c55];return _0x55f62f;};'use strict';var util=require(_0xdfd0('0x0'));var net=require(_0xdfd0('0x1'));var EventEmitter=require(_0xdfd0('0x2'))[_0xdfd0('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xdfd0('0x4'));var AGIServer=function(_0x5ba8cd,_0x547948,_0x1a69eb){var _0xf7aea1=this,_0x5ba8cd=_0x5ba8cd||0x11dd,_0x547948=_0x547948||_0xdfd0('0x5'),_0x5e8a0b=null,_0x2bb590=0x0;EventEmitter[_0xdfd0('0x6')](_0xf7aea1);function _0x50678c(){if(!_0x5ba8cd){_0xf7aea1[_0xdfd0('0x7')](_0xdfd0('0x8'),new AGIError(_0xdfd0('0x9')));return![];}_0x5e8a0b=net['createServer']();_0x5e8a0b[_0xdfd0('0xa')](_0x5ba8cd,_0x547948);_0x5e8a0b['on']('listening',function(){_0xf7aea1[_0xdfd0('0x7')](_0xdfd0('0xb'));});_0x5e8a0b['on'](_0xdfd0('0xc'),function(_0x48cbb8){_0x5e8a0b[_0xdfd0('0xd')](function(_0x196aae,_0x10b6d1){if(_0x196aae){_0xf7aea1[_0xdfd0('0x7')]('error',new AGIError(_0xdfd0('0xe'),_0x196aae));}else if(_0x1a69eb&&_0x1a69eb<0x0){_0xf7aea1['emit'](_0xdfd0('0x8'),new AGIError(_0xdfd0('0xf')));_0x48cbb8[_0xdfd0('0x10')]();}else if(_0x1a69eb&&_0x1a69eb>0x0&&_0x1a69eb<_0x10b6d1){_0x2bb590+=0x1;_0xf7aea1[_0xdfd0('0x7')]('error',new AGIError(_0xdfd0('0x11'),_0x2bb590));_0x48cbb8[_0xdfd0('0x10')]();}else{var _0x16b9b5=new AGIChannel(_0x48cbb8);_0x16b9b5['on']('ready',function(){_0xf7aea1[_0xdfd0('0x7')](_0xdfd0('0xc'),_0x16b9b5);});}});});_0x5e8a0b['on']('error',function(_0x820d0f){_0xf7aea1[_0xdfd0('0x7')](_0xdfd0('0x8'),new AGIError(_0xdfd0('0xe'),_0x820d0f[_0xdfd0('0x12')]));});_0x5e8a0b['on'](_0xdfd0('0x13'),function(){_0xf7aea1[_0xdfd0('0x7')](_0xdfd0('0x13'),new AGIError(_0xdfd0('0x14')));});}process[_0xdfd0('0x15')](function(){_0x50678c();});};util[_0xdfd0('0x16')](AGIServer,EventEmitter);module[_0xdfd0('0x17')]=function(_0x1d833b,_0x56b4a1,_0x52968f){return new AGIServer(_0x1d833b,_0x56b4a1,_0x52968f);}; \ No newline at end of file +var _0xf77d=['connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','call','emit','E_AGI_ARGUMENT_PORT','listen','listening'];(function(_0xf97eb0,_0x1578b7){var _0xea70f4=function(_0x574c8d){while(--_0x574c8d){_0xf97eb0['push'](_0xf97eb0['shift']());}};_0xea70f4(++_0x1578b7);}(_0xf77d,0x153));var _0xdf77=function(_0x1302cf,_0x388178){_0x1302cf=_0x1302cf-0x0;var _0x39729a=_0xf77d[_0x1302cf];return _0x39729a;};'use strict';var util=require(_0xdf77('0x0'));var net=require(_0xdf77('0x1'));var EventEmitter=require(_0xdf77('0x2'))[_0xdf77('0x3')];var AGIError=require(_0xdf77('0x4'));var AGIChannel=require(_0xdf77('0x5'));var AGIServer=function(_0xc4db93,_0x2a9999,_0x459c61){var _0x28abeb=this,_0xc4db93=_0xc4db93||0x11dd,_0x2a9999=_0x2a9999||'127.0.0.1',_0x3ee103=null,_0x2dfaef=0x0;EventEmitter[_0xdf77('0x6')](_0x28abeb);function _0x1710f0(){if(!_0xc4db93){_0x28abeb[_0xdf77('0x7')]('error',new AGIError(_0xdf77('0x8')));return![];}_0x3ee103=net['createServer']();_0x3ee103[_0xdf77('0x9')](_0xc4db93,_0x2a9999);_0x3ee103['on']('listening',function(){_0x28abeb[_0xdf77('0x7')](_0xdf77('0xa'));});_0x3ee103['on'](_0xdf77('0xb'),function(_0x4b61df){_0x3ee103[_0xdf77('0xc')](function(_0x53e92a,_0x4ca900){if(_0x53e92a){_0x28abeb['emit'](_0xdf77('0xd'),new AGIError(_0xdf77('0xe'),_0x53e92a));}else if(_0x459c61&&_0x459c61<0x0){_0x28abeb[_0xdf77('0x7')]('error',new AGIError(_0xdf77('0xf')));_0x4b61df[_0xdf77('0x10')]();}else if(_0x459c61&&_0x459c61>0x0&&_0x459c61<_0x4ca900){_0x2dfaef+=0x1;_0x28abeb[_0xdf77('0x7')](_0xdf77('0xd'),new AGIError(_0xdf77('0x11'),_0x2dfaef));_0x4b61df['destroy']();}else{var _0x4479f6=new AGIChannel(_0x4b61df);_0x4479f6['on'](_0xdf77('0x12'),function(){_0x28abeb[_0xdf77('0x7')]('connection',_0x4479f6);});}});});_0x3ee103['on'](_0xdf77('0xd'),function(_0x11df2d){_0x28abeb[_0xdf77('0x7')]('error',new AGIError(_0xdf77('0xe'),_0x11df2d[_0xdf77('0x13')]));});_0x3ee103['on'](_0xdf77('0x14'),function(){_0x28abeb[_0xdf77('0x7')](_0xdf77('0x14'),new AGIError(_0xdf77('0x15')));});}process[_0xdf77('0x16')](function(){_0x1710f0();});};util[_0xdf77('0x17')](AGIServer,EventEmitter);module[_0xdf77('0x18')]=function(_0x4e3149,_0xd8ae64,_0x4da8bb){return new AGIServer(_0x4e3149,_0xd8ae64,_0x4da8bb);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4bdac9e..1e5aabb 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 _0xe4f4=['EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%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','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','statusCode','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','bcc','service','host','secure','authentication','auth','pass','template_id','sendMail\x20message','account_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','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','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','calleridname','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','sesteknda','ndauth_url','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','url','finally','getdigits','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','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','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false'];(function(_0x36cbba,_0x5b3ffa){var _0x33d4d3=function(_0x484737){while(--_0x484737){_0x36cbba['push'](_0x36cbba['shift']());}};_0x33d4d3(++_0x5b3ffa);}(_0xe4f4,0x89));var _0x4e4f=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0xe4f4[_0x38fbc2];return _0x43c7d4;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x4e4f('0x0'));var _=require(_0x4e4f('0x1'));var sh=require('shelljs');var odbc=require(_0x4e4f('0x2'))();var rs=require(_0x4e4f('0x3'));var moment=require(_0x4e4f('0x4'));var Mustache=require(_0x4e4f('0x5'));var rp=require(_0x4e4f('0x6'));var logger=require(_0x4e4f('0x7'))(_0x4e4f('0x8'));var config=require('../../config/environment');var scripts=require(_0x4e4f('0x9'));var FILES_PATH=_0x4e4f('0xa');var recursiveMapAttributes=['rawHeaders',_0x4e4f('0xb')];var verticesWithRetry=[_0x4e4f('0xc'),'getdigits',_0x4e4f('0xd')];var AGIVertices=function(_0x74fc9,_0x3c308c,_0x182ba2){this[_0x4e4f('0xe')]=_0x74fc9;this[_0x4e4f('0xf')]=_0x3c308c;this['mailRpc']=_0x182ba2;};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x11')]=function(_0x106e5d,_0x418c1d){this['rpc'][_0x4e4f('0x12')](_0x106e5d)[_0x4e4f('0x13')](function(_0x1fed3b){_0x418c1d(null,_0x1fed3b?_0x1fed3b[_0x4e4f('0x14')]:![]);})[_0x4e4f('0x15')](function(_0x1fbbb2){_0x418c1d(_0x1fbbb2);});};AGIVertices['prototype'][_0x4e4f('0x16')]=function(_0x414a8e,_0x2e7525){this['rpc'][_0x4e4f('0x17')](_0x414a8e)[_0x4e4f('0x13')](function(_0x3d689d){_0x2e7525(null,_0x3d689d?_0x3d689d[_0x4e4f('0x14')]:![]);})['catch'](function(_0x5a5ad6){_0x2e7525(_0x5a5ad6);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x18')]=function(_0x227eca,_0x32bfbb){this['rpc'][_0x4e4f('0x19')](_0x227eca)['then'](function(_0x339fe0){_0x32bfbb(null,_0x339fe0?_0x339fe0[_0x4e4f('0x14')]:![]);})[_0x4e4f('0x15')](function(_0x2cf588){_0x32bfbb(_0x2cf588);});};AGIVertices['prototype'][_0x4e4f('0x1a')]=function(_0x37d4a8,_0x19f7ff){this[_0x4e4f('0xf')]['getSquareOdbcById'](_0x37d4a8)[_0x4e4f('0x13')](function(_0x308c98){_0x19f7ff(null,_0x308c98?_0x308c98[_0x4e4f('0x1b')]:![]);})[_0x4e4f('0x15')](function(_0x4d1936){_0x19f7ff(_0x4d1936);});};AGIVertices['prototype']['getUser']=function(_0x297b6f,_0x599d4c){this[_0x4e4f('0xf')][_0x4e4f('0x1c')](_0x297b6f)[_0x4e4f('0x13')](function(_0x363ade){_0x599d4c(null,_0x363ade?_0x363ade['name']:![]);})[_0x4e4f('0x15')](function(_0x5aad7e){_0x599d4c(_0x5aad7e);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x1d')]=function(_0x301412,_0x16d51a){this[_0x4e4f('0xf')][_0x4e4f('0x1e')](_0x301412)[_0x4e4f('0x13')](function(_0x29b15e){_0x16d51a(null,_0x29b15e?_0x29b15e[_0x4e4f('0x14')]:![]);})['catch'](function(_0xd0dbe){_0x16d51a(_0xd0dbe);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x1f')]=function(_0x58b7cd,_0x136453){var _0x4567b6=this;this[_0x4e4f('0xf')]['getSoundById'](_0x58b7cd)[_0x4e4f('0x13')](function(_0x380f72){_0x136453(null,_0x380f72?_0x4567b6[_0x4e4f('0x20')](_0x380f72[_0x4e4f('0x21')]):![]);})[_0x4e4f('0x15')](function(_0x5fee23){_0x136453(_0x5fee23);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x22')]=function(_0xf543dc,_0x394512){this[_0x4e4f('0xf')]['getMailAccountById'](_0xf543dc)[_0x4e4f('0x13')](function(_0x17935d){_0x394512(null,_0x17935d?_0x17935d:![]);})[_0x4e4f('0x15')](function(_0x3bacb2){_0x394512(_0x3bacb2);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x23')]=function(_0x262916,_0x7702fa,_0x3e6b8b){this[_0x4e4f('0x24')][_0x4e4f('0x23')](_0x262916,_0x7702fa)[_0x4e4f('0x13')](function(){_0x3e6b8b(null);})[_0x4e4f('0x15')](function(_0x262061){_0x3e6b8b(_0x262061);});};AGIVertices[_0x4e4f('0x10')]['getIntervals']=function(_0x3cbde4,_0x5af36a){this[_0x4e4f('0xf')][_0x4e4f('0x25')](_0x3cbde4)[_0x4e4f('0x13')](function(_0x3197e6){if(_0x3197e6){if(_0x3197e6[_0x4e4f('0x26')]){_0x5af36a(null,[_0x3197e6[_0x4e4f('0x27')]]);}else{_0x5af36a(null,_[_0x4e4f('0x28')](_0x3197e6[_0x4e4f('0x29')],'interval'));}}else{_0x5af36a(null,![]);}})[_0x4e4f('0x15')](function(_0x55c675){_0x5af36a(_0x55c675);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x20')]=function(_0x384892){return util[_0x4e4f('0x2a')](_0x4e4f('0x2b'),FILES_PATH,_0x384892);};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x2c')]=function(_0x391161,_0x54abd0,_0x4a50bb){odbc[_0x4e4f('0x2d')](_0x391161,function(_0x50ba50){if(_0x50ba50){logger[_0x4e4f('0x2e')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x50ba50);_0x4a50bb(_0x50ba50);}else{logger[_0x4e4f('0x2f')](_0x4e4f('0x30'));odbc[_0x4e4f('0x31')](_0x54abd0,function(_0x47f3d3,_0x3aa08c){if(_0x47f3d3){logger['info'](_0x4e4f('0x32'),_0x54abd0);_0x4a50bb(_0x47f3d3);}else{logger[_0x4e4f('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x54abd0);odbc['close'](function(_0x3671ab){if(_0x3671ab){logger[_0x4e4f('0x2e')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3671ab);}_0x4a50bb(null,_0x3aa08c);});}});}});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x33')]=function(_0x9af4f6,_0x2e7278){this[_0x4e4f('0xf')][_0x4e4f('0x34')](_0x9af4f6)[_0x4e4f('0x13')](function(_0x3748f6){_0x2e7278(null,_0x3748f6?_0x3748f6:![]);})['catch'](function(_0x1d72b6){_0x2e7278(_0x1d72b6);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x35')]=function(_0x33fda8,_0x5ce481){this['rpc'][_0x4e4f('0x35')](_0x33fda8)[_0x4e4f('0x13')](function(_0x345b22){_0x5ce481(null,_0x345b22);})[_0x4e4f('0x15')](function(_0x1d8c2){_0x5ce481(_0x1d8c2);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x36')]=function(_0x30c2e6,_0x49d2e6,_0x137953){this[_0x4e4f('0xf')][_0x4e4f('0x36')]({'uniqueid':this[_0x4e4f('0xe')][_0x4e4f('0x37')],'node':_0x30c2e6['label'],'application':_0x30c2e6[_0x4e4f('0x38')],'data':_0x49d2e6||null,'project_name':this[_0x4e4f('0xe')][_0x4e4f('0x39')],'callerid':this[_0x4e4f('0xe')]['callerid']})[_0x4e4f('0x13')](function(_0x61baa0){if(_0x137953){_0x137953(null,_0x61baa0);}})[_0x4e4f('0x15')](function(_0x34ee5f){if(_0x137953){_0x137953(_0x34ee5f);}});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x3a')]=function(_0x959add,_0x4d006c,_0x7f19f,_0xa52ae9){this[_0x4e4f('0xf')]['createSquareRecording']({'uniqueid':this[_0x4e4f('0xe')][_0x4e4f('0x37')],'callerid':this[_0x4e4f('0xe')]['callerid'],'calleridname':this[_0x4e4f('0xe')][_0x4e4f('0x3b')],'context':this[_0x4e4f('0xe')][_0x4e4f('0x3c')],'extension':this[_0x4e4f('0xe')]['extension'],'priority':this[_0x4e4f('0xe')][_0x4e4f('0x3d')],'accountcode':this[_0x4e4f('0xe')][_0x4e4f('0x3e')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0x4e4f('0x39')],'saveName':_0x4d006c,'filename':_0x959add[_0x4e4f('0x3f')]||_0x4d006c,'savePath':_0x7f19f})[_0x4e4f('0x13')](function(_0x2fd737){_0xa52ae9(null,_0x2fd737);})[_0x4e4f('0x15')](function(_0x38f1bd){_0xa52ae9(_0x38f1bd);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x40')]=function(_0x215b3d,_0x26c7a3,_0x593832,_0x53f4e5,_0x33ef23){this['rpc'][_0x4e4f('0x40')]({'uniqueid':this[_0x4e4f('0xe')][_0x4e4f('0x37')],'body':_0x215b3d,'direction':_0x26c7a3,'providerName':_0x593832,'providerResponse':_0x53f4e5})[_0x4e4f('0x13')](function(_0x2d8ba9){if(_0x33ef23){_0x33ef23(null,_0x2d8ba9);}})['catch'](function(_0xdcc134){if(_0x33ef23){_0x33ef23(_0xdcc134);}});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x41')]=function(_0x1f9237,_0x389fff){this[_0x4e4f('0xf')][_0x4e4f('0x41')]({'firstName':_[_0x4e4f('0x42')](_0x1f9237['name'])||_[_0x4e4f('0x43')](_0x1f9237['name'])?_0x4e4f('0x44')+Math['random']():_0x1f9237[_0x4e4f('0x14')],'lastName':_['isEmpty'](_0x1f9237['lastName'])||_[_0x4e4f('0x43')](_0x1f9237[_0x4e4f('0x45')])?null:_0x1f9237[_0x4e4f('0x45')],'phone':_0x1f9237[_0x4e4f('0x46')],'ListId':_0x1f9237[_0x4e4f('0x47')],'scheduledat':_0x1f9237[_0x4e4f('0x48')],'callbackUniqueid':this[_0x4e4f('0xe')][_0x4e4f('0x37')],'tags':_0x4e4f('0x49'),'description':_0x4e4f('0x4a')+_0x1f9237[_0x4e4f('0x48')][_0x4e4f('0x4b')](),'priority':_0x1f9237[_0x4e4f('0x4c')]})[_0x4e4f('0x13')](function(_0x526113){_0x389fff(null,_0x526113);})['catch'](function(_0x3ebd12){_0x389fff(_0x3ebd12);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x4d')]=function(_0x23e150,_0x48e962){this[_0x4e4f('0xf')][_0x4e4f('0x4e')](_0x23e150)['then'](function(_0x5dc4a7){_0x48e962(null,_0x5dc4a7?_0x5dc4a7[_0x4e4f('0x14')]:![]);})[_0x4e4f('0x15')](function(_0x29d6d2){_0x48e962(_0x29d6d2);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x4f')]=function(_0x4b6518,_0x34adfd,_0x130178){var _0x1f131b={'role':_0x4e4f('0x50')};_0x1f131b[_0x4b6518]=this[_0x4e4f('0xe')][_0x4e4f('0x51')];this[_0x4e4f('0xf')][_0x4e4f('0x4f')](_0x1f131b,_0x34adfd,this[_0x4e4f('0xe')][_0x4e4f('0x37')])[_0x4e4f('0x13')](function(_0x1dc288){_0x130178(null,_[_0x4e4f('0x43')](_0x1dc288)?![]:!![]);})['catch'](function(_0x4e4ca7){logger[_0x4e4f('0x2e')](_0x4e4ca7);_0x130178(null,![]);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x52')]=function(_0x7dadb9,_0x264d2e){var _0x4bcd70={'role':_0x4e4f('0x50')};_0x4bcd70[_0x7dadb9]=this[_0x4e4f('0xe')][_0x4e4f('0x51')];this[_0x4e4f('0xf')][_0x4e4f('0x52')](_0x4bcd70)[_0x4e4f('0x13')](function(_0x4a6971){_0x264d2e(null,_[_0x4e4f('0x43')](_0x4a6971)?![]:!![]);})[_0x4e4f('0x15')](function(_0xa4474){logger['error'](_0xa4474);_0x264d2e(null,![]);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x53')]=function(_0x444f33,_0x30e1f0){var _0x3622fd={'role':_0x4e4f('0x50')};_0x3622fd[_0x444f33]=this['channel']['callerid'];this['rpc']['agentLogout'](_0x3622fd)[_0x4e4f('0x13')](function(_0x2e3915){_0x30e1f0(null,_[_0x4e4f('0x43')](_0x2e3915)?![]:!![]);})[_0x4e4f('0x15')](function(_0x3a6e1a){logger['error'](_0x3a6e1a);_0x30e1f0(null,![]);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x54')]=function(_0x46fabe,_0x4aa25c){var _0x1dbf2f={'role':_0x4e4f('0x50')};_0x1dbf2f[_0x46fabe]=this[_0x4e4f('0xe')][_0x4e4f('0x51')];var _0x2fb4d2=_0x46fabe!=_0x4e4f('0x55')?util['format'](_0x4e4f('0x56'),_0x4e4f('0x57'),this[_0x4e4f('0xe')][_0x4e4f('0x51')]):undefined;this[_0x4e4f('0xf')][_0x4e4f('0x54')](_0x1dbf2f,_0x2fb4d2)[_0x4e4f('0x13')](function(_0xc6c6fc){_0x4aa25c(null,_[_0x4e4f('0x43')](_0xc6c6fc)?![]:!![]);})[_0x4e4f('0x15')](function(_0x543ed6){logger[_0x4e4f('0x2e')](_0x543ed6);_0x4aa25c(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x3b9e82,_0x22eb44){sh[_0x4e4f('0x58')](_[_0x4e4f('0x59')](_0x3b9e82),function(_0x45b1be,_0x15c083){var _0x372942=_0x15c083['replace'](/(\r\n|\n|\r)/gm,'');_0x22eb44(null,_0x372942);});};AGIVertices['prototype'][_0x4e4f('0x5a')]=function(_0x468987,_0x3b15b7){scripts[_0x4e4f('0x5a')](_0x468987[_0x4e4f('0x5b')],_0x468987[_0x4e4f('0x5c')]||_0x4e4f('0x5d'),_0x468987[_0x4e4f('0x5d')],_0x468987[_0x4e4f('0x5e')]||_0x4e4f('0x5f'),_0x468987[_0x4e4f('0x60')]||_0x4e4f('0x61'),_0x468987['audioEncoding']||'MP3')[_0x4e4f('0x13')](function(_0x3b48b1){_0x3b15b7(null,_0x3b48b1);})['catch'](function(_0x20dde8){_0x3b15b7(_0x20dde8);});};AGIVertices[_0x4e4f('0x10')]['googleTTS']=function(_0x12f602,_0x48ee0d){scripts[_0x4e4f('0x62')](_0x12f602['text'],_0x12f602['google_tts_language']||'en',0x1)[_0x4e4f('0x13')](function(_0x13eb07){_0x48ee0d(null,_0x13eb07);})['catch'](function(_0x164573){_0x48ee0d(_0x164573);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x63')]=function(_0x324eba,_0x35c0da){var _0x40812c={'uri':_0x324eba['url'],'method':_0x324eba[_0x4e4f('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x324eba[_0x4e4f('0x65')])===_0x4e4f('0x66')&&parseInt(_0x324eba[_0x4e4f('0x65')])>=0x1?parseInt(_0x324eba[_0x4e4f('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x4e4f('0x67')]([_0x4e4f('0x68'),_0x4e4f('0x69')],_0x40812c[_0x4e4f('0x64')][_0x4e4f('0x6a')]())){try{_0x40812c[_0x4e4f('0x6b')]=_0x324eba[_0x4e4f('0xb')]?JSON[_0x4e4f('0x6c')](_0x324eba[_0x4e4f('0xb')]):{};}catch(_0x1aa049){logger[_0x4e4f('0x2e')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1aa049);}}try{_0x40812c[_0x4e4f('0x6d')]=_0x324eba['rawHeaders']?JSON[_0x4e4f('0x6c')](_0x324eba[_0x4e4f('0x6e')]):{};}catch(_0x25907f){logger[_0x4e4f('0x2e')](_0x4e4f('0x6f'),_0x25907f);}if(_0x324eba[_0x4e4f('0x70')]){try{var _0x124e7e=require(_0x324eba[_0x4e4f('0x70')])[_0x4e4f('0x71')](this,_0x40812c);_0x40812c['uri']=Mustache[_0x4e4f('0x72')](_0x324eba['url'],_0x124e7e,{},['$$','$$']);if(_0x40812c[_0x4e4f('0x6d')]){_0x40812c['headers']=JSON['parse'](Mustache[_0x4e4f('0x72')](JSON[_0x4e4f('0x73')](_0x40812c[_0x4e4f('0x6d')]),_0x124e7e,{},['$$','$$']));}if(_0x40812c[_0x4e4f('0x6b')]){_0x40812c[_0x4e4f('0x6b')]=JSON[_0x4e4f('0x6c')](Mustache[_0x4e4f('0x72')](JSON['stringify'](_0x40812c['body']),_0x124e7e,{},['$$','$$']));}}catch(_0x3311b0){logger[_0x4e4f('0x2e')](_0x4e4f('0x74'),_0x3311b0);}}rp(_0x40812c)[_0x4e4f('0x13')](function(_0x540b16){var _0x733dfc={'statusCode':_0x540b16['statusCode']||0xc8,'statusMessage':_0x540b16[_0x4e4f('0x75')]||'OK','headers':_0x540b16[_0x4e4f('0x6d')]||{},'body':_0x540b16[_0x4e4f('0x6b')]||{}};_0x35c0da(null,_0x733dfc);})['catch'](function(_0x42231a){var _0x3bd7e8={'statusCode':_0x42231a['statusCode']||0x1f4,'statusMessage':_0x42231a[_0x4e4f('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x42231a[_0x4e4f('0x77')][_0x4e4f('0x6d')]||{},'body':_0x42231a[_0x4e4f('0x77')][_0x4e4f('0x6b')]||{}};_0x35c0da(null,_0x3bd7e8);});};AGIVertices['prototype'][_0x4e4f('0x78')]=function(_0x3d2502,_0x26df69){scripts['googleDialogflow'](this[_0x4e4f('0xe')][_0x4e4f('0x37')],_0x3d2502['key'],_0x3d2502['text'],_0x3d2502[_0x4e4f('0x79')]||'en')['then'](function(_0x17c46f){_0x26df69(null,_0x17c46f);})[_0x4e4f('0x15')](function(_0x491b65){_0x26df69(_0x491b65);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x7a')]=function(_0x550036,_0xde6792){scripts[_0x4e4f('0x7a')](this[_0x4e4f('0xe')][_0x4e4f('0x37')],_0x550036[_0x4e4f('0x7b')],_0x550036[_0x4e4f('0x7c')],_0x550036['private_key'],_0x550036[_0x4e4f('0x5d')],_0x550036[_0x4e4f('0x7d')]||'en')[_0x4e4f('0x13')](function(_0x5b9465){_0xde6792(null,_0x5b9465);})[_0x4e4f('0x15')](function(_0x3deab1){_0xde6792(_0x3deab1);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x7e')]=function(_0x37f2ff,_0x65cd5){scripts[_0x4e4f('0x7e')](this[_0x4e4f('0xe')],_0x37f2ff)['then'](function(_0x51c03c){_0x65cd5(null,_0x51c03c);})[_0x4e4f('0x15')](function(_0x444b0c){_0x65cd5(_0x444b0c);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x7f')]=function(_0x3335bc,_0x45be9b){scripts[_0x4e4f('0x7f')](_0x3335bc[_0x4e4f('0x80')],_0x3335bc[_0x4e4f('0x5d')],_0x3335bc[_0x4e4f('0x81')]||'en-US',_0x3335bc[_0x4e4f('0x82')])[_0x4e4f('0x13')](function(_0x36df34){_0x45be9b(null,_0x36df34);})[_0x4e4f('0x15')](function(_0x5474c2){_0x45be9b(_0x5474c2);});};AGIVertices['prototype'][_0x4e4f('0x83')]=function(_0x122532,_0x5ba777,_0x283e2e){scripts['ispeechASR'](_0x5ba777,_0x122532[_0x4e4f('0x80')],_0x122532['ispeech_asr_language']||_0x4e4f('0x5f'),this[_0x4e4f('0x84')](_0x122532[_0x4e4f('0x85')])?_0x122532['model']:undefined)[_0x4e4f('0x13')](function(_0x189825){_0x283e2e(null,_0x189825);})[_0x4e4f('0x15')](function(_0x10f78b){_0x283e2e(_0x10f78b);});};AGIVertices[_0x4e4f('0x10')]['awsPolly']=function(_0x54f181,_0x2a6e51){scripts['awsPolly'](_0x54f181[_0x4e4f('0x86')],_0x54f181[_0x4e4f('0x87')],_0x54f181[_0x4e4f('0x88')],_0x54f181[_0x4e4f('0x89')]||_0x4e4f('0x8a'),_0x54f181['text'],_0x54f181[_0x4e4f('0x8b')]||'text')['then'](function(_0x2eb83f){_0x2a6e51(null,_0x2eb83f);})[_0x4e4f('0x15')](function(_0x146a59){_0x2a6e51(_0x146a59);});};AGIVertices[_0x4e4f('0x10')]['awsLex']=function(_0x451635,_0x136789){scripts['awsLex'](this[_0x4e4f('0xe')][_0x4e4f('0x37')],_0x451635[_0x4e4f('0x86')],_0x451635[_0x4e4f('0x87')],_0x451635[_0x4e4f('0x8c')],_0x451635[_0x4e4f('0x5d')],_0x451635['aws_bot_name'])[_0x4e4f('0x13')](function(_0xbb1ed8){_0x136789(null,_0xbb1ed8);})['catch'](function(_0x13e674){_0x136789(_0x13e674);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x8d')]=function(_0x2e658f,_0x2b4089,_0x494489){scripts['googleASR'](_0x2b4089,_0x2e658f[_0x4e4f('0x80')],_0x2e658f[_0x4e4f('0x8e')]||_0x4e4f('0x5f'))['then'](function(_0xaf1c9d){_0x494489(null,_0xaf1c9d);})[_0x4e4f('0x15')](function(_0x4b501e){_0x494489(_0x4b501e);});};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x8f')]=function(_0x2522e9,_0x19135e,_0x2c6ce3){scripts[_0x4e4f('0x8f')](_0x19135e,_0x2522e9[_0x4e4f('0x90')],_0x2522e9[_0x4e4f('0x91')],_0x2522e9[_0x4e4f('0x92')])['then'](function(_0x2f6a93){_0x2c6ce3(null,_0x2f6a93);})[_0x4e4f('0x15')](function(_0x372f25){_0x2c6ce3(_0x372f25);});};AGIVertices[_0x4e4f('0x10')]['clear']=function(_0x3f288c){var _0x374ac9=_[_0x4e4f('0x67')](verticesWithRetry,_0x3f288c[_0x4e4f('0x38')])?_0x3f288c:_['clone'](_0x3f288c);for(var _0x2f2aa1 in _0x374ac9){if(_0x374ac9[_0x4e4f('0x93')](_0x2f2aa1)){if(_0x374ac9[_0x2f2aa1]&&_[_0x4e4f('0x94')](_0x374ac9[_0x2f2aa1])){if(_[_0x4e4f('0x67')](recursiveMapAttributes,_0x2f2aa1)){_0x374ac9[_0x2f2aa1]=this['replaceObjectAllVariables'](_0x374ac9[_0x2f2aa1]);}else{_0x374ac9[_0x2f2aa1]=this[_0x4e4f('0x95')](_0x374ac9[_0x2f2aa1]);}}}}return _0x374ac9;};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x96')]=function(_0x579b9d){for(var _0x448aeb in _0x579b9d){if(_0x579b9d['hasOwnProperty'](_0x448aeb)){if(_[_0x4e4f('0x97')](_0x579b9d[_0x448aeb])){this[_0x4e4f('0x96')](_0x579b9d[_0x448aeb]);}else if(_[_0x4e4f('0x98')](_0x579b9d[_0x448aeb])){for(var _0x30d2b0=0x0;_0x30d2b0<_0x579b9d[_0x448aeb][_0x4e4f('0x99')];_0x30d2b0++){this[_0x4e4f('0x96')](_0x579b9d[_0x448aeb][_0x30d2b0]);}}else if(_['isString'](_0x579b9d[_0x448aeb])){_0x579b9d[_0x448aeb]=this[_0x4e4f('0x95')](_0x579b9d[_0x448aeb]);}}}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x9a')]=function(_0x5761a7,_0x4a42dd){for(var _0xb581bd in _0x5761a7){if(_0x5761a7[_0x4e4f('0x93')](_0xb581bd)){if(_[_0x4e4f('0x97')](_0x5761a7[_0xb581bd])){if(!_[_0x4e4f('0x42')](_0x5761a7[_0xb581bd])){this[_0x4e4f('0x9a')](_0x5761a7[_0xb581bd],util[_0x4e4f('0x2a')](_0x4e4f('0x9b'),_0x4a42dd,_0xb581bd));}}else if(_['isArray'](_0x5761a7[_0xb581bd])){for(var _0x370e64=0x0;_0x370e64<_0x5761a7[_0xb581bd][_0x4e4f('0x99')];_0x370e64++){this[_0x4e4f('0x9a')](_0x5761a7[_0xb581bd][_0x370e64],util[_0x4e4f('0x2a')](_0x4e4f('0x9b'),_0x4a42dd,_0xb581bd+'['+_0x370e64+']'));}}else{if(!_['isNil'](_0x5761a7[_0xb581bd])){this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')]('%s.%s',_0x4a42dd,_0xb581bd),_0x5761a7[_0xb581bd]);}}}}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x9d')]=function(_0x14b4b3){try{var _0x4a4a87=JSON[_0x4e4f('0x6c')](_0x14b4b3);this[_0x4e4f('0x96')](_0x4a4a87);return JSON[_0x4e4f('0x73')](_0x4a4a87);}catch(_0x47073e){return this[_0x4e4f('0x95')](_0x14b4b3);}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x95')]=function(_0x3afe44){var _0x2498ea=_0x3afe44[_0x4e4f('0x9e')]('{');for(var _0x5b15a4=0x1;_0x5b15a4<_0x2498ea[_0x4e4f('0x99')];_0x5b15a4+=0x1){var _0x39decc=_0x2498ea[_0x5b15a4][_0x4e4f('0x9e')]('}');if(_0x39decc[_0x4e4f('0x99')]>0x1){_0x3afe44=_0x3afe44[_0x4e4f('0x9f')]('{'+_0x39decc[0x0]+'}',this[_0x4e4f('0xe')][_0x4e4f('0x11')](_0x39decc[0x0])[_0x4e4f('0xa0')]||_0x39decc[0x0]);}}if(_0x2498ea['length']===0x1){return _0x3afe44[_0x4e4f('0x4b')]();}return this[_0x4e4f('0x95')](_0x3afe44);};AGIVertices['prototype'][_0x4e4f('0xa1')]=function(_0xe16f51,_0x16df24){var _0x1faecd=this[_0x4e4f('0xe')]['getVariable'](_0xe16f51);if(_0x1faecd[_0x4e4f('0xa2')]===-0x1){return _0x1faecd;}logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xa3'),_0x16df24,_0x1faecd[_0x4e4f('0xa0')]));return this[_0x4e4f('0xe')][_0x4e4f('0x9c')](_0x16df24,_0x1faecd[_0x4e4f('0xa0')]);};AGIVertices['prototype']['isConfigured']=function(_0xe3f4d6){return _0xe3f4d6&&_0xe3f4d6!=='0'&&_0xe3f4d6!=='-1'&&_0xe3f4d6!=='';};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xa4')]=function(_0x3af2d1){this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x3af2d1,'-');_0x3af2d1[_0x4e4f('0xa5')]=_0x3af2d1[_0x4e4f('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x2d69cd){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xa6'),_0x2d69cd[_0x4e4f('0xa7')]));if(!this['isConfigured'](_0x2d69cd[_0x4e4f('0x5d')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xa9'));}var _0x478c5a='\x22'+_0x2d69cd[_0x4e4f('0x5d')]+'\x22';if(this['isConfigured'](_0x2d69cd['options'])){_0x478c5a+=','+_0x2d69cd[_0x4e4f('0x77')];}var _0x297735=this[_0x4e4f('0xe')][_0x4e4f('0x58')](_0x4e4f('0xaa'),_0x478c5a);if(_0x297735[_0x4e4f('0xa2')]===-0x1){return _0x297735;}return this['channel']['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0xab'),_0x478c5a));};AGIVertices['prototype'][_0x4e4f('0xac')]=function(_0x332e60){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xad'),_0x332e60[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x332e60['grammar'])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xae'));}var _0x132ec6=_0x332e60[_0x4e4f('0xaf')];if(this['isConfigured'](_0x332e60[_0x4e4f('0x77')])){_0x132ec6+=','+_0x332e60[_0x4e4f('0x77')];}var _0x10cc74=this['channel'][_0x4e4f('0x58')]('MRCPRecog',_0x132ec6);if(_0x10cc74[_0x4e4f('0xa2')]===-0x1){return _0x10cc74;}var _0x4aa801=this[_0x4e4f('0xa1')]('RECOG_CONFIDENCE()',_0x4e4f('0xb0'));if(_0x4aa801['result']===-0x1){return _0x4aa801;}var _0x369f99=this[_0x4e4f('0xa1')](_0x4e4f('0xb1'),_0x4e4f('0xb2'));if(_0x369f99[_0x4e4f('0xa2')]===-0x1){return _0x369f99;}var _0x31531f=this[_0x4e4f('0xa1')](_0x4e4f('0xb3'),_0x4e4f('0xb4'));if(_0x31531f[_0x4e4f('0xa2')]===-0x1){return _0x31531f;}return this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x132ec6));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x8')]=function(_0x43fa41){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x43fa41[_0x4e4f('0xa7')]));return this[_0x4e4f('0xe')][_0x4e4f('0x8')]([_0x43fa41[_0x4e4f('0xb5')],_0x43fa41[_0x4e4f('0xb6')]]);};AGIVertices['prototype']['answer']=function(_0x1abf10){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xb7'),_0x1abf10[_0x4e4f('0xa7')]));if(this[_0x4e4f('0x84')](_0x1abf10[_0x4e4f('0x65')])){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1abf10[_0x4e4f('0x65')]));var _0x39b2b5=this[_0x4e4f('0xe')][_0x4e4f('0xb8')](_0x1abf10['timeout']);if(_0x39b2b5[_0x4e4f('0xa2')]===-0x1){return _0x39b2b5;}}return this[_0x4e4f('0xe')][_0x4e4f('0xb9')]();};AGIVertices[_0x4e4f('0x10')]['callback']=function(_0x2bd027){logger[_0x4e4f('0x2f')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2bd027[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x2bd027['list_id'])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x2bd027,'no\x20list\x20selected');}_0x2bd027[_0x4e4f('0x48')]=moment();if(this['isConfigured'](_0x2bd027[_0x4e4f('0xba')])){_0x2bd027[_0x4e4f('0x48')]=moment()[_0x4e4f('0xbb')](_0x2bd027['delay'],_0x4e4f('0xbc'));}if(!this['isConfigured'](_0x2bd027['callback_priority'])){_0x2bd027['callback_priority']=0x2;}this[_0x4e4f('0x41')][_0x4e4f('0x71')](this,_0x2bd027);return this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xbd'),_0x2bd027[_0x4e4f('0x46')],_0x2bd027[_0x4e4f('0x47')],_0x2bd027[_0x4e4f('0x48')]));};AGIVertices[_0x4e4f('0x10')]['custom_app']=function(_0x39e334){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xbe'),_0x39e334[_0x4e4f('0xa7')]));var _0x1ea5ce=this['channel']['exec'](_0x39e334[_0x4e4f('0xbf')],_0x39e334[_0x4e4f('0x77')]);if(_0x1ea5ce['result']===-0x1){return _0x1ea5ce;}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0xc0'),_0x39e334[_0x4e4f('0xbf')],_0x39e334['options']));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xc1')]=function(_0x2a23fa){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xc2'),_0x2a23fa['label']));if(!this[_0x4e4f('0x84')](_0x2a23fa[_0x4e4f('0x5d')])){return this[_0x4e4f('0xe')]['noop']('no\x20text\x20configured');}var _0x125632='\x22'+_0x2a23fa[_0x4e4f('0x5d')]+'\x22';if(this['isConfigured'](_0x2a23fa['options'])){_0x125632+=','+_0x2a23fa[_0x4e4f('0x77')];}var _0x3e1360=this[_0x4e4f('0xe')][_0x4e4f('0x58')]('MRCPSynth',_0x125632);if(_0x3e1360[_0x4e4f('0xa2')]===-0x1){return _0x3e1360;}return this['channel'][_0x4e4f('0xa8')](util['format'](_0x4e4f('0xab'),_0x125632));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xc3')]=function(_0x78b732){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x78b732['label']));if(!this['isConfigured'](_0x78b732[_0x4e4f('0x5d')])){return this['channel'][_0x4e4f('0xa8')]('no\x20text\x20configured');}var _0xba57cc='\x22'+_0x78b732[_0x4e4f('0x5d')]+'\x22';if(this[_0x4e4f('0x84')](_0x78b732[_0x4e4f('0x77')])){_0xba57cc+=','+_0x78b732[_0x4e4f('0x77')];}var _0x2104b6=this[_0x4e4f('0xe')][_0x4e4f('0x58')](_0x4e4f('0xaa'),_0xba57cc);if(_0x2104b6[_0x4e4f('0xa2')]===-0x1){return _0x2104b6;}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xab'),_0xba57cc));};AGIVertices[_0x4e4f('0x10')]['lumenvoxasr']=function(_0x503a8a){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xc4'),_0x503a8a['label']));if(!this[_0x4e4f('0x84')](_0x503a8a[_0x4e4f('0xaf')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xae'));}var _0x2f378b=_0x503a8a[_0x4e4f('0xaf')];if(this[_0x4e4f('0x84')](_0x503a8a[_0x4e4f('0x77')])){_0x2f378b+=','+_0x503a8a[_0x4e4f('0x77')];}var _0x37fc99=this[_0x4e4f('0xe')]['exec'](_0x4e4f('0xc5'),_0x2f378b);if(_0x37fc99[_0x4e4f('0xa2')]===-0x1){return _0x37fc99;}var _0x1817db=this[_0x4e4f('0xa1')](_0x4e4f('0xc6'),_0x4e4f('0xc7'));if(_0x1817db[_0x4e4f('0xa2')]===-0x1){return _0x1817db;}var _0x1b9d68=this['getAndSetVariable'](_0x4e4f('0xb1'),_0x4e4f('0xc8'));if(_0x1b9d68[_0x4e4f('0xa2')]===-0x1){return _0x1b9d68;}var _0x59fc53=this[_0x4e4f('0xa1')](_0x4e4f('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0x59fc53['result']===-0x1){return _0x59fc53;}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x2f378b));};AGIVertices[_0x4e4f('0x10')]['sestekasr']=function(_0x1380b3){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xc9'),_0x1380b3['label']));if(!this['isConfigured'](_0x1380b3[_0x4e4f('0xaf')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xae'));}var _0x5c1ebf=_0x1380b3[_0x4e4f('0xaf')];if(this[_0x4e4f('0x84')](_0x1380b3[_0x4e4f('0x77')])){_0x5c1ebf+=','+_0x1380b3[_0x4e4f('0x77')];}var _0x507fca=this['channel'][_0x4e4f('0x58')](_0x4e4f('0xc5'),_0x5c1ebf);if(_0x507fca['result']===-0x1){return _0x507fca;}var _0xc2ea8b=this[_0x4e4f('0xa1')](_0x4e4f('0xc6'),_0x4e4f('0xca'));if(_0xc2ea8b[_0x4e4f('0xa2')]===-0x1){return _0xc2ea8b;}var _0x45d1a7=this[_0x4e4f('0xa1')](_0x4e4f('0xb1'),_0x4e4f('0xcb'));if(_0x45d1a7[_0x4e4f('0xa2')]===-0x1){return _0x45d1a7;}var _0xe089aa=this[_0x4e4f('0xa1')](_0x4e4f('0xb3'),'SESTEK_ASR_INSTANCE');if(_0xe089aa[_0x4e4f('0xa2')]===-0x1){return _0xe089aa;}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xcc'),_0x5c1ebf));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xcd')]=function(_0x52c2ca){logger['info'](util[_0x4e4f('0x2a')](_0x4e4f('0xce'),_0x52c2ca['label']));if(!this['isConfigured'](_0x52c2ca[_0x4e4f('0xcf')])){return this['channel'][_0x4e4f('0x2e')](_0x52c2ca,_0x4e4f('0xd0'));}var _0x7364d6=this[_0x4e4f('0x1a')][_0x4e4f('0x71')](this,_0x52c2ca[_0x4e4f('0xcf')]);if(!_0x7364d6){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x52c2ca,'no\x20odbc\x20database\x20found');}if(!this[_0x4e4f('0x84')](_0x52c2ca[_0x4e4f('0x31')])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x52c2ca,_0x4e4f('0xd1'));}var _0x373fc9=_0x52c2ca[_0x4e4f('0x31')][_0x4e4f('0xd2')](/(\r\n|\n|\r)/gm,'\x20');this[_0x4e4f('0xe')]['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0xd3'),_0x373fc9));var _0x565443=this['getQueryOdbc'][_0x4e4f('0x71')](this,_0x7364d6,_0x373fc9);this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x52c2ca,_0x373fc9);if(!this[_0x4e4f('0x84')](_0x52c2ca[_0x4e4f('0xd4')])){return this['channel']['noop'](_0x4e4f('0xd5'));}var _0x1aad47=this['getVariable'][_0x4e4f('0x71')](this,_0x52c2ca[_0x4e4f('0xd4')]);if(!_0x1aad47){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x52c2ca,'no\x20variable\x20found');}var _0x51bbec=this;_0x565443[_0x4e4f('0xd6')](function(_0x46a744,_0x14a7cb){Object[_0x4e4f('0xd7')](_0x46a744)[_0x4e4f('0xd6')](function(_0x290650){_0x51bbec[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')](_0x4e4f('0xd8'),_0x1aad47,_0x14a7cb,_0x290650),_0x46a744[_0x290650]);});});this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')]('%s_ROWS_COUNT',_0x1aad47),_0x565443['length']);return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0xd9'),_0x1aad47));};AGIVertices[_0x4e4f('0x10')]['dial']=function(_0x272412){logger[_0x4e4f('0xda')](util['format'](_0x4e4f('0xdb'),_0x272412['label']));if(!this[_0x4e4f('0x84')](_0x272412[_0x4e4f('0xdc')])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x272412,_0x4e4f('0xdd'));}var _0x5090c1=this['getUser'][_0x4e4f('0x71')](this,_0x272412[_0x4e4f('0xdc')]);if(!_0x5090c1){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x272412,_0x4e4f('0xde'));}var _0x1655e3=this[_0x4e4f('0xe')]['exec'](_0x4e4f('0xdf'),[util[_0x4e4f('0x2a')](_0x4e4f('0xe0'),_0x5090c1),_0x272412[_0x4e4f('0x65')],_0x272412[_0x4e4f('0xe1')],_0x272412['url']]);if(_0x1655e3[_0x4e4f('0xa2')]===-0x1){return _0x1655e3;}return this[_0x4e4f('0xe')]['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0xe2'),_0x4e4f('0xdf')));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xe3')]=function(_0x5386a7){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0xe4'),_0x5386a7[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x5386a7['key'])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0xe5'));}if(!this['isConfigured'](_0x5386a7['text'])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xa9'));}this[_0x4e4f('0xe')][_0x4e4f('0xe6')]=!![];this[_0x4e4f('0x36')](_0x5386a7);this[_0x4e4f('0x40')](_0x5386a7[_0x4e4f('0x5d')],'in','','');this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x5386a7[_0x4e4f('0x5d')]));var _0x3b1614=this[_0x4e4f('0x78')][_0x4e4f('0x71')](this,_0x5386a7);if(_0x3b1614){for(var _0x1a3f9f in _0x3b1614){if(_0x3b1614['hasOwnProperty'](_0x1a3f9f)){this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')](_0x4e4f('0xe7'),_0x1a3f9f[_0x4e4f('0x6a')]()),_0x3b1614[_0x1a3f9f]);}}this['createSquareMessage'](_0x3b1614[_0x4e4f('0xe8')],_0x4e4f('0xe9'),_0x4e4f('0xe3'),'');return this[_0x4e4f('0xe')]['noop'](util[_0x4e4f('0x2a')]('Dialogflow\x20Result\x20%s',_0x3b1614[_0x4e4f('0xe8')]));}return this['channel'][_0x4e4f('0x2e')](_0x5386a7,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x4e4f('0x10')]['dialogflowV2']=function(_0xce92b7){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0xea'),_0xce92b7[_0x4e4f('0xa7')]));if(!this['isConfigured'](_0xce92b7['dialogflowV2_project_id'])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0xeb'));}if(!this[_0x4e4f('0x84')](_0xce92b7['client_email'])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0xec'));}if(!this[_0x4e4f('0x84')](_0xce92b7[_0x4e4f('0xed')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xee'));}if(!this[_0x4e4f('0x84')](_0xce92b7[_0x4e4f('0x7d')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('no\x20anguage\x20configured');}if(!this[_0x4e4f('0x84')](_0xce92b7[_0x4e4f('0x5d')])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0xa9'));}this[_0x4e4f('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0xce92b7);this[_0x4e4f('0x40')](_0xce92b7[_0x4e4f('0x5d')],'in','','');this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xef'),_0xce92b7[_0x4e4f('0x5d')]));var _0x1a4a6c=this[_0x4e4f('0x7a')][_0x4e4f('0x71')](this,_0xce92b7);if(_0x1a4a6c){for(var _0x101ab9 in _0x1a4a6c){if(_0x1a4a6c[_0x4e4f('0x93')](_0x101ab9)){if(_0x101ab9!==_0x4e4f('0xf0')){this['channel'][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')](_0x4e4f('0xe7'),_0x101ab9[_0x4e4f('0x6a')]()),_0x1a4a6c[_0x101ab9]);}}}this[_0x4e4f('0x40')](_0x1a4a6c[_0x4e4f('0xe8')],_0x4e4f('0xe9'),_0x4e4f('0xf1'),_0x1a4a6c[_0x4e4f('0xf0')]);return this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('DialogflowV2\x20Result\x20%s',_0x1a4a6c[_0x4e4f('0xe8')]));}return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0xce92b7,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x4e4f('0xf2')]=function(_0x4a826b){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4a826b[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x4a826b[_0x4e4f('0xf3')])){return this['channel'][_0x4e4f('0xa8')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x4e4f('0x84')](_0x4a826b['username'])){return this[_0x4e4f('0xe')]['noop']('no\x20username\x20configured');}if(!this[_0x4e4f('0x84')](_0x4a826b[_0x4e4f('0xf4')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xf5'));}if(!this[_0x4e4f('0x84')](_0x4a826b[_0x4e4f('0xf6')])){return this[_0x4e4f('0xe')]['noop']('no\x20text\x20configured');}this[_0x4e4f('0xe')]['bot']=!![];this[_0x4e4f('0x36')](_0x4a826b);this['createSquareMessage'](_0x4a826b['text'],'in','','');this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xf7'),_0x4a826b[_0x4e4f('0x5d')]));var _0x2c7338=this[_0x4e4f('0x7e')][_0x4e4f('0x71')](this,_0x4a826b);if(_0x2c7338){for(var _0x255241 in _0x2c7338){if(_0x2c7338[_0x4e4f('0x93')](_0x255241)){this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util['format'](_0x4e4f('0xf8'),_0x255241[_0x4e4f('0x6a')]()),_0x2c7338[_0x255241]);}}this['createSquareMessage'](_0x2c7338[_0x4e4f('0xe8')],_0x4e4f('0xe9'),_0x4e4f('0xf2'),'');if(_0x2c7338[_0x4e4f('0xf9')]){this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xfa'),_0x2c7338[_0x4e4f('0xf9')]));var _0x1f49ff=this['channel']['streamFile'](_0x2c7338[_0x4e4f('0xf9')]);try{fs[_0x4e4f('0xfb')](_0x2c7338[_0x4e4f('0xf9')]+'.wav');}catch(_0xe2830e){logger[_0x4e4f('0x2e')](_0xe2830e);}return _0x1f49ff;}else{return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xfc'),_0x2c7338['speech']));}}return this[_0x4e4f('0xe')]['error'](_0x4a826b,_0x4e4f('0xfd'));};AGIVertices[_0x4e4f('0x10')]['end']=function(_0x303bb3){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x303bb3[_0x4e4f('0xa7')]));return this['channel']['noop']('end');};AGIVertices[_0x4e4f('0x10')]['ext_dial']=function(_0xd37339){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0xfe'),_0xd37339[_0x4e4f('0xa7')]));var _0x2db956='';if(_0xd37339[_0x4e4f('0xff')]){if(!this[_0x4e4f('0x84')](_0xd37339['trunk_id'])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0xd37339,'no\x20trunk\x20selected');}else{var _0x3a71cf=parseInt(_0xd37339[_0x4e4f('0xff')],0xa);if(isNaN(_0x3a71cf)){_0x2db956=_0xd37339[_0x4e4f('0xff')];}else{_0x2db956=this[_0x4e4f('0x1d')][_0x4e4f('0x71')](this,_0xd37339[_0x4e4f('0xff')]);if(!_0x2db956){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0xd37339,_0x4e4f('0x100'));}}}}else if(_0xd37339['trunk_name']){_0x2db956=_0xd37339[_0x4e4f('0x101')];}else{return this[_0x4e4f('0xe')]['error'](_0xd37339,_0x4e4f('0x102'));}var _0x8d59c3=this[_0x4e4f('0xe')][_0x4e4f('0x58')]('DIAL',[util[_0x4e4f('0x2a')](_0x4e4f('0x103'),_0x2db956,_0xd37339[_0x4e4f('0x46')]),_0xd37339['timeout'],_0xd37339[_0x4e4f('0xe1')],_0xd37339[_0x4e4f('0x104')]]);if(_0x8d59c3[_0x4e4f('0xa2')]===-0x1){return _0x8d59c3;}return this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xe2'),_0x4e4f('0xdf')));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x105')]=function(_0xcfbe40){logger[_0x4e4f('0x2f')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xcfbe40[_0x4e4f('0xa7')]));return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x105'));};AGIVertices['prototype'][_0x4e4f('0x106')]=function(_0x27df6c){logger['info'](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x27df6c[_0x4e4f('0xa7')]));if(_0x27df6c[_0x4e4f('0xa5')]===0x0){return this[_0x4e4f('0xa4')](_0x27df6c);}_0x27df6c[_0x4e4f('0xa5')]-=0x1;if(!this[_0x4e4f('0x84')](_0x27df6c['file_id'])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x27df6c,_0x4e4f('0x107'));}var _0x250f84=this[_0x4e4f('0x1f')][_0x4e4f('0x71')](this,_0x27df6c[_0x4e4f('0x108')]);if(!_0x250f84){return this[_0x4e4f('0xe')]['error'](_0x27df6c,_0x4e4f('0x109'));}if(!this['isConfigured'](_0x27df6c['variable_id'])){return this[_0x4e4f('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5192dc=this[_0x4e4f('0xe')][_0x4e4f('0x10a')](_0x250f84,_0x27df6c['response'],_0x27df6c[_0x4e4f('0x10b')]);var _0x313da3=_0x5192dc[_0x4e4f('0xa2')]?_0x5192dc[_0x4e4f('0xa2')][_0x4e4f('0x4b')]():'';logger[_0x4e4f('0x2f')]('test',JSON[_0x4e4f('0x73')](_0x5192dc));if(_0x5192dc[_0x4e4f('0xa2')]===-0x1){this[_0x4e4f('0x36')]['sync'](this,_0x27df6c,_0x313da3);return _0x5192dc;}else if(_0x5192dc['extra']==='timeout'){_0x5192dc[_0x4e4f('0xa2')]=_0x313da3[_0x4e4f('0x99')]>=parseInt(_0x27df6c[_0x4e4f('0x10c')])?'x':'i';}else{_0x5192dc[_0x4e4f('0xa2')]=_0x313da3[_0x4e4f('0x99')]>=parseInt(_0x27df6c[_0x4e4f('0x10c')])&&_0x313da3[_0x4e4f('0x99')]<=parseInt(_0x27df6c['maxdigit'])?'x':'i';}var _0x5ac195=this[_0x4e4f('0x11')]['sync'](this,_0x27df6c['variable_id']);if(!_0x5ac195){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x27df6c,'no\x20variable\x20found');}this[_0x4e4f('0xe')][_0x4e4f('0x9c')](_0x5ac195,_0x313da3);if(this[_0x4e4f('0x84')](_0x27df6c[_0x4e4f('0x10d')])){var _0x321332=parseInt(_0x27df6c['hiddendigitsnum'],0xa);var _0x25b7d9=rs[_0x4e4f('0x10e')]({'charset':'*','length':_0x321332});var _0x1fb4de=_0x313da3['length'];if(_0x1fb4de>0x0){if(_0x1fb4de>_0x321332){this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x27df6c,_0x27df6c[_0x4e4f('0x10f')]==='first'?_0x25b7d9+_0x313da3[_0x4e4f('0x110')](_0x321332):_0x313da3[_0x4e4f('0x110')](0x0,_0x1fb4de-_0x321332)+_0x25b7d9);}else{this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x27df6c,rs[_0x4e4f('0x10e')]({'charset':'*','length':_0x1fb4de}));}}else{this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x27df6c,'');}}else{this['createSquareDetailsReport'][_0x4e4f('0x71')](this,_0x27df6c,_0x313da3);}return _0x5192dc;};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xd')]=function(_0x37648e){logger[_0x4e4f('0x2f')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x37648e[_0x4e4f('0xa7')]));return this[_0x4e4f('0x106')](_0x37648e);};AGIVertices['prototype'][_0x4e4f('0x111')]=function(_0xdea220){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x112'),_0xdea220['label']));this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0xdea220,_0xdea220[_0x4e4f('0x113')]);return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x114'),_0xdea220[_0x4e4f('0x113')]));};AGIVertices['prototype'][_0x4e4f('0x115')]=function(_0x263664){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x116'),_0x263664[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x263664[_0x4e4f('0x86')])||!this['isConfigured'](_0x263664['aws_secret_access_key'])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x117'));}if(!this[_0x4e4f('0x84')](_0x263664[_0x4e4f('0x5d')])){return this[_0x4e4f('0xe')]['noop'](_0x4e4f('0xa9'));}this['channel']['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0x118'),_0x263664[_0x4e4f('0x5d')]));var _0x1bc82d=this['awsPolly'][_0x4e4f('0x71')](this,_0x263664);if(_0x1bc82d){this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('aws\x20Polly\x20%s\x20file\x20created',_0x1bc82d));var _0x12288a=this[_0x4e4f('0xe')][_0x4e4f('0x119')](_0x1bc82d);try{fs[_0x4e4f('0xfb')](_0x1bc82d+_0x4e4f('0x11a'));}catch(_0x421ca9){logger[_0x4e4f('0x2e')](_0x421ca9);}return _0x12288a;}return this['channel'][_0x4e4f('0x2e')](_0x263664,_0x4e4f('0x11b'));};AGIVertices[_0x4e4f('0x10')]['awslex']=function(_0x2cd512){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x11c'),_0x2cd512[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x2cd512['aws_access_key_id'])||!this[_0x4e4f('0x84')](_0x2cd512[_0x4e4f('0x87')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x117'));}if(!this[_0x4e4f('0x84')](_0x2cd512[_0x4e4f('0x11d')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('no\x20bot\x20name\x20configured');}if(!this[_0x4e4f('0x84')](_0x2cd512[_0x4e4f('0x5d')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('no\x20text\x20configured');}this[_0x4e4f('0xe')][_0x4e4f('0xe6')]=!![];this['createSquareDetailsReport'](_0x2cd512);this['createSquareMessage'](_0x2cd512[_0x4e4f('0x5d')],'in','','');this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x11e'),_0x2cd512[_0x4e4f('0x5d')]));var _0x16c69b=this[_0x4e4f('0x11f')][_0x4e4f('0x71')](this,_0x2cd512);if(_0x16c69b){for(var _0x2d5b6a in _0x16c69b){if(_0x16c69b[_0x4e4f('0x93')](_0x2d5b6a)&&_[_0x4e4f('0x94')](_0x16c69b[_0x2d5b6a])){this['channel'][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')](_0x4e4f('0x120'),_0x2d5b6a[_0x4e4f('0x6a')]()),_0x16c69b[_0x2d5b6a]);}}if(_[_0x4e4f('0x43')](_0x16c69b[_0x4e4f('0x76')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x121'));}else{this['createSquareMessage'](_0x16c69b[_0x4e4f('0x76')],_0x4e4f('0xe9'),_0x4e4f('0x122'),'');return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x123'),_0x16c69b['message']));}}return this[_0x4e4f('0xe')]['error'](_0x2cd512,_0x4e4f('0x124'));};AGIVertices[_0x4e4f('0x10')]['googleasr']=function(_0x1c4631){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x125'),_0x1c4631['label'],_0x1c4631['timeout']));if(!this['isConfigured'](_0x1c4631[_0x4e4f('0x80')])){return this['channel']['noop'](_0x4e4f('0xe5'));}var _0x1ecb90='wav';var _0x2650f1=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x4e4f('0x10e')](0x4));var _0x378b78=util[_0x4e4f('0x2a')](_0x4e4f('0x9b'),_0x2650f1,_0x1ecb90);var _0x4784e4=!![];if(_0x1c4631[_0x4e4f('0x126')]===_0x4e4f('0x127')){_0x4784e4=![];}var _0x381639=this['channel'][_0x4e4f('0x128')](_0x2650f1,_0x1ecb90,_0x1c4631['intKey'],_0x1c4631['timeout'],undefined,_0x4784e4);if(_0x381639[_0x4e4f('0xa2')]!==-0x1){this['channel']['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0x129'),_0x378b78));var _0x41fca3=this[_0x4e4f('0x8d')][_0x4e4f('0x71')](this,_0x1c4631,_0x378b78);if(_0x41fca3){for(var _0x325798 in _0x41fca3){if(_0x41fca3['hasOwnProperty'](_0x325798)){this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')]('GOOGLE_ASR_%s',_0x325798['toUpperCase']()),_0x41fca3[_0x325798]);}}return this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x41fca3)));}}return _0x381639;};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x12a')]=function(_0x29f2cb){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x12b'),_0x29f2cb['label']));if(!this[_0x4e4f('0x84')](_0x29f2cb[_0x4e4f('0x90')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x12c'));}if(!this[_0x4e4f('0x84')](_0x29f2cb[_0x4e4f('0x91')])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0x12d'));}var _0x1ba6af='wav';var _0x3cfe93=util[_0x4e4f('0x2a')](_0x4e4f('0x12e'),FILES_PATH,rs[_0x4e4f('0x10e')](0x4));var _0x4f2bf3=util['format'](_0x4e4f('0x9b'),_0x3cfe93,_0x1ba6af);var _0x29e4cd=!![];if(_0x29f2cb['beep']===_0x4e4f('0x127')){_0x29e4cd=![];}var _0x42d554=this['channel'][_0x4e4f('0x128')](_0x3cfe93,_0x1ba6af,_0x29f2cb['intKey'],_0x29f2cb[_0x4e4f('0x65')],undefined,_0x29e4cd);if(_0x42d554[_0x4e4f('0xa2')]!==-0x1){this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('tilde\x20%s\x20file\x20created',_0x4f2bf3));var _0x5ead2f=this[_0x4e4f('0x8f')]['sync'](this,_0x29f2cb,_0x4f2bf3);if(_0x5ead2f){for(var _0x267d6b in _0x5ead2f){if(_0x5ead2f[_0x4e4f('0x93')](_0x267d6b)){this[_0x4e4f('0xe')]['setVariable'](util['format'](_0x4e4f('0x12f'),_0x267d6b[_0x4e4f('0x6a')]()),_0x5ead2f[_0x267d6b]);}}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x130'),JSON[_0x4e4f('0x73')](_0x5ead2f)));}}return _0x42d554;};AGIVertices['prototype'][_0x4e4f('0x131')]=function(_0x3d90b4){logger['info'](util[_0x4e4f('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3d90b4[_0x4e4f('0xa7')]));return this[_0x4e4f('0xe')][_0x4e4f('0x132')](_0x3d90b4[_0x4e4f('0x3c')],_0x3d90b4['extension'],_0x3d90b4['priority']);};AGIVertices['prototype'][_0x4e4f('0x133')]=function(_0x565b32){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x134'),_0x565b32['label']));if(!this[_0x4e4f('0x84')](_0x565b32[_0x4e4f('0x135')])){return this['channel'][_0x4e4f('0x2e')](_0x565b32,_0x4e4f('0x136'));}try{var _0x1e3447=eval(_0x565b32[_0x4e4f('0x135')])?_0x4e4f('0x137'):_0x4e4f('0x138');this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x139'),_0x565b32['condition'],_0x1e3447));return{'code':0xc8,'result':_0x1e3447};}catch(_0x58c89b){return{'code':0xc8,'result':_0x4e4f('0x138')};}};AGIVertices[_0x4e4f('0x10')]['gotoiftime']=function(_0x378e60){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x13a'),_0x378e60['label']));if(!this[_0x4e4f('0x84')](_0x378e60[_0x4e4f('0x13b')])){return this['channel'][_0x4e4f('0x2e')](_0x378e60,_0x4e4f('0x13c'));}var _0x15c700=this[_0x4e4f('0x13d')][_0x4e4f('0x71')](this,_0x378e60['interval_id']);if(!_0x15c700){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x378e60,'no\x20intervals\x20found');}for(var _0x40f34e=0x0;_0x40f34e<_0x15c700['length'];_0x40f34e+=0x1){var _0x4bb250=this[_0x4e4f('0xe')][_0x4e4f('0x11')](util[_0x4e4f('0x2a')](_0x4e4f('0x13e'),_0x15c700[_0x40f34e]));if(_0x4bb250[_0x4e4f('0xa2')]===-0x1){return _0x4bb250;}logger['info'](util[_0x4e4f('0x2a')](_0x4e4f('0x13f'),_0x15c700[_0x40f34e],_0x4bb250[_0x4e4f('0xa0')]));if(_0x4bb250[_0x4e4f('0xa0')]===_0x4e4f('0x137')){logger['info'](util['format'](_0x4e4f('0x13f'),_0x15c700[_0x40f34e],_0x4e4f('0x137')));this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('IFTIME\x20%s\x20%s',_0x15c700[_0x40f34e],'true'));return{'code':0xc8,'result':_0x4e4f('0x137')};}else{logger['info'](util['format'](_0x4e4f('0x13f'),_0x15c700[_0x40f34e],_0x4e4f('0x138')));this[_0x4e4f('0xe')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x15c700[_0x40f34e],_0x4e4f('0x138')));}}return{'code':0xc8,'result':_0x4e4f('0x138')};};AGIVertices['prototype']['hangup']=function(_0x46ab8f){logger['info'](util['format'](_0x4e4f('0x140'),_0x46ab8f['label']));return this[_0x4e4f('0xe')][_0x4e4f('0x141')]();};AGIVertices[_0x4e4f('0x10')]['ispeechasr']=function(_0x52d93b){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x142'),_0x52d93b[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x52d93b[_0x4e4f('0x80')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('no\x20key\x20configured');}var _0x289917='wav';var _0x487f4a=util[_0x4e4f('0x2a')](_0x4e4f('0x12e'),FILES_PATH,rs[_0x4e4f('0x10e')](0x4));var _0x4b4c4e=util[_0x4e4f('0x2a')](_0x4e4f('0x9b'),_0x487f4a,_0x289917);var _0x4b6b6f=!![];if(_0x52d93b['beep']===_0x4e4f('0x127')){_0x4b6b6f=![];}var _0xaea6e3=this['channel'][_0x4e4f('0x128')](_0x487f4a,_0x289917,_0x52d93b[_0x4e4f('0x143')],_0x52d93b[_0x4e4f('0x65')],undefined,_0x4b6b6f);if(_0xaea6e3[_0x4e4f('0xa2')]!==-0x1){this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x144'),_0x4b4c4e));var _0x126c97=this[_0x4e4f('0x83')][_0x4e4f('0x71')](this,_0x52d93b,_0x4b4c4e);if(_0x126c97){for(var _0x416785 in _0x126c97){if(_0x126c97[_0x4e4f('0x93')](_0x416785)){this[_0x4e4f('0xe')]['setVariable'](util[_0x4e4f('0x2a')](_0x4e4f('0x145'),_0x416785[_0x4e4f('0x6a')]()),_0x126c97[_0x416785]);}}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x146'),JSON[_0x4e4f('0x73')](_0x126c97)));}}return _0xaea6e3;};AGIVertices['prototype'][_0x4e4f('0x147')]=function(_0x387e7d){logger['info'](util[_0x4e4f('0x2a')](_0x4e4f('0x148'),_0x387e7d[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x387e7d[_0x4e4f('0x80')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('no\x20key\x20configured');}if(!this[_0x4e4f('0x84')](_0x387e7d['text'])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xa9'));}this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x149'),_0x387e7d[_0x4e4f('0x5d')]));var _0x4ce257=this[_0x4e4f('0x7f')][_0x4e4f('0x71')](this,_0x387e7d);if(_0x4ce257){this[_0x4e4f('0xe')]['noop'](util[_0x4e4f('0x2a')]('ispeech\x20%s\x20file\x20created',_0x4ce257));var _0x5100dc=this[_0x4e4f('0xe')]['streamFile'](_0x4ce257,_0x387e7d[_0x4e4f('0x143')]);try{fs[_0x4e4f('0xfb')](_0x4ce257+_0x4e4f('0x11a'));}catch(_0x27a30d){logger['error'](_0x27a30d);}return _0x5100dc;}return this[_0x4e4f('0xe')]['error'](_0x387e7d,_0x4e4f('0x14a'));};AGIVertices['prototype'][_0x4e4f('0x14b')]=function(_0xac3bfe){logger['info'](util['format'](_0x4e4f('0x14c'),_0xac3bfe[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0xac3bfe[_0x4e4f('0x14d')])){return this['channel'][_0x4e4f('0x2e')](_0xac3bfe,'no\x20find\x20by\x20configured');}logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0xac3bfe[_0x4e4f('0x14d')]));var _0x25d109=this['agentLogin'][_0x4e4f('0x71')](this,_0xac3bfe[_0x4e4f('0x14d')]);if(_0x25d109){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x14e'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0xac3bfe[_0x4e4f('0x14d')]));this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0x14e'),this['channel'][_0x4e4f('0x51')],_0xac3bfe['findBy']));return{'code':0xc8,'result':_0x4e4f('0x14f')};}else{logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4e4f('0xe')]['callerid'],_0xac3bfe[_0x4e4f('0x14d')]));this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x150'),this['channel']['callerid'],_0xac3bfe[_0x4e4f('0x14d')]));return{'code':0xc8,'result':_0x4e4f('0x151')};}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x152')]=function(_0x544416){logger['info'](util['format'](_0x4e4f('0x153'),_0x544416[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x544416[_0x4e4f('0x14d')])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x544416,_0x4e4f('0x154'));}logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x155'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x544416['findBy']));var _0x1076fe=this['agentLogout']['sync'](this,_0x544416[_0x4e4f('0x14d')]);if(_0x1076fe){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4e4f('0xe')]['callerid'],_0x544416[_0x4e4f('0x14d')]));this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0x14e'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x544416[_0x4e4f('0x14d')]));return{'code':0xc8,'result':_0x4e4f('0x14f')};}else{logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4e4f('0xe')]['callerid'],_0x544416['findBy']));this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x150'),this[_0x4e4f('0xe')]['callerid'],_0x544416['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x156')]=function(_0x53debf){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x157'),_0x53debf[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x53debf[_0x4e4f('0x158')])){return this['channel'][_0x4e4f('0x2e')](_0x53debf,_0x4e4f('0x159'));}this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x15a'),_0x53debf[_0x4e4f('0x158')]));var _0x27202b=eval(_0x53debf[_0x4e4f('0x158')]);if(!this[_0x4e4f('0x84')](_0x53debf[_0x4e4f('0xd4')])){return this[_0x4e4f('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x12182f=this[_0x4e4f('0x11')][_0x4e4f('0x71')](this,_0x53debf[_0x4e4f('0xd4')]);if(!_0x12182f){return this[_0x4e4f('0xe')]['error'](_0x53debf,_0x4e4f('0x15b'));}if(_['isArray'](_0x27202b)){var _0x42ace1=this;_0x27202b[_0x4e4f('0xd6')](function(_0x591277,_0x22f3b4){_0x42ace1['channel'][_0x4e4f('0x9c')](util['format'](_0x4e4f('0x15c'),_0x12182f,_0x22f3b4),_0x591277);});return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('variable\x20%s[key]\x20set',_0x12182f));}else{return this['channel'][_0x4e4f('0x9c')](_0x12182f,_0x27202b);}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0xc')]=function(_0x169242){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x15d'),_0x169242[_0x4e4f('0xa7')]));if(_0x169242[_0x4e4f('0xa5')]===0x0){return this[_0x4e4f('0xa4')](_0x169242);}_0x169242['retry']-=0x1;if(!this['isConfigured'](_0x169242[_0x4e4f('0x108')])){return this['channel']['error'](_0x169242,'no\x20file\x20audio\x20selected');}var _0xd02bb8=this[_0x4e4f('0x1f')]['sync'](this,_0x169242[_0x4e4f('0x108')]);if(!_0xd02bb8){return this[_0x4e4f('0xe')]['error'](_0x169242,'no\x20file\x20audio\x20found');}var _0x4b0b8e=this[_0x4e4f('0xe')][_0x4e4f('0x10a')](_0xd02bb8,_0x169242[_0x4e4f('0x15e')],_0x169242['digit']);var _0x56195e=_0x4b0b8e[_0x4e4f('0xa2')];if(_0x4b0b8e[_0x4e4f('0xa2')]===-0x1){this['createSquareDetailsReport'][_0x4e4f('0x71')](this,_0x169242,'-1');return _0x4b0b8e;}else if(_0x4b0b8e[_0x4e4f('0xa0')]===_0x4e4f('0x65')){_0x4b0b8e[_0x4e4f('0xa2')]=_0x4b0b8e[_0x4e4f('0xa2')][_0x4e4f('0x99')]>0x0?_0x4b0b8e[_0x4e4f('0xa2')]:'t';}else if(_[_0x4e4f('0x42')](_0x4b0b8e[_0x4e4f('0xa2')])){_0x4b0b8e[_0x4e4f('0xa2')]='#';_0x56195e='#';}if(!this[_0x4e4f('0x84')](_0x169242['variable_id'])){this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0xd5'));}else{var _0x5af3d1=this[_0x4e4f('0x11')]['sync'](this,_0x169242['variable_id']);if(!_0x5af3d1){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x169242,'no\x20variable\x20found');}this[_0x4e4f('0xe')]['setVariable'](_0x5af3d1,_0x56195e);}this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x169242,_0x56195e);return _0x4b0b8e;};AGIVertices['prototype']['noop']=function(_0x7805a6){logger[_0x4e4f('0x2f')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x7805a6[_0x4e4f('0xa7')]));return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x7805a6[_0x4e4f('0x15f')]||_0x7805a6[_0x4e4f('0xa7')]);};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x160')]=function(_0x20d78c){logger['info'](util[_0x4e4f('0x2a')](_0x4e4f('0x161'),_0x20d78c['label']));if(!this[_0x4e4f('0x84')](_0x20d78c[_0x4e4f('0x14d')])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x20d78c,_0x4e4f('0x154'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x20d78c[_0x4e4f('0x14d')]));var _0x10409b=this[_0x4e4f('0x4d')][_0x4e4f('0x71')](this,_0x20d78c[_0x4e4f('0x162')]);var _0x2115d0=this[_0x4e4f('0x4f')][_0x4e4f('0x71')](this,_0x20d78c[_0x4e4f('0x14d')],_0x10409b);if(_0x2115d0){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x14e'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x20d78c['findBy']));this[_0x4e4f('0xe')]['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0x14e'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x20d78c['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x150'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x20d78c['findBy']));this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x14e'),this['channel']['callerid'],_0x20d78c['findBy']));return{'code':0xc8,'result':_0x4e4f('0x151')};}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x163')]=function(_0x48e0f6){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x164'),_0x48e0f6[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x48e0f6['file_id'])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x48e0f6,'no\x20file\x20audio\x20selected');}var _0x6c660e=this[_0x4e4f('0x1f')][_0x4e4f('0x71')](this,_0x48e0f6['file_id']);if(!_0x6c660e){return this['channel'][_0x4e4f('0x2e')](_0x48e0f6,'no\x20file\x20audio\x20found');}var _0xf17bd8=this[_0x4e4f('0xe')][_0x4e4f('0x58')](_0x4e4f('0x165'),[_0x6c660e,_0x48e0f6[_0x4e4f('0xe1')]]);if(_0xf17bd8[_0x4e4f('0xa2')]===-0x1){return _0xf17bd8;}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xc0'),_0x4e4f('0x165'),_0x6c660e));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x166')]=function(_0x22fcf1){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x167'),_0x22fcf1[_0x4e4f('0xa7')]));if(!this['isConfigured'](_0x22fcf1[_0x4e4f('0x168')])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x22fcf1,_0x4e4f('0x169'));}var _0x10671d='';var _0x28d43f=parseInt(_0x22fcf1[_0x4e4f('0x168')],0xa);if(isNaN(_0x28d43f)){_0x10671d=_0x22fcf1[_0x4e4f('0x168')];}else{_0x10671d=this[_0x4e4f('0x16')][_0x4e4f('0x71')](this,_0x22fcf1[_0x4e4f('0x168')]);if(!_0x10671d){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x22fcf1,'no\x20queue\x20found');}}var _0x21cef4='';if(this[_0x4e4f('0x84')](_0x22fcf1['file_id'])){var _0x12a03f=this[_0x4e4f('0x1f')][_0x4e4f('0x71')](this,_0x22fcf1[_0x4e4f('0x108')]);if(_0x12a03f){_0x21cef4=_0x12a03f;}}this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x22fcf1,_0x10671d);if(_0x22fcf1[_0x4e4f('0xe1')][_0x4e4f('0x16a')]('x')<0x0){_0x22fcf1[_0x4e4f('0xe1')]+='x';}if(_0x22fcf1[_0x4e4f('0xe1')]['indexOf']('X')<0x0){_0x22fcf1['opts']+='X';}this['channel'][_0x4e4f('0x9c')](_0x4e4f('0x16b'),_0x10671d?_0x10671d[_0x4e4f('0x16c')]():'');var _0x3cdb18=this[_0x4e4f('0xe')][_0x4e4f('0x58')](_0x4e4f('0x16d'),[_0x10671d,_0x22fcf1[_0x4e4f('0xe1')],_0x22fcf1[_0x4e4f('0x104')],_0x21cef4,_0x22fcf1[_0x4e4f('0x65')],_0x22fcf1[_0x4e4f('0x8')],_0x22fcf1[_0x4e4f('0x16e')],_0x22fcf1[_0x4e4f('0x16f')],'',_0x22fcf1[_0x4e4f('0x170')]]);if(_0x3cdb18[_0x4e4f('0xa2')]===-0x1){return _0x3cdb18;}return this['channel']['noop'](util[_0x4e4f('0x2a')]('Executed\x20command\x20%s\x20%s',_0x4e4f('0x16d'),_0x10671d));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x171')]=function(_0x50a5fc){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x172'),_0x50a5fc[_0x4e4f('0xa7')]));var _0x477d4a=_0x50a5fc[_0x4e4f('0x173')]||'wav';var _0x40f123=util[_0x4e4f('0x2a')](_0x4e4f('0x174'),this['channel'][_0x4e4f('0x37')],rs[_0x4e4f('0x10e')](0x5));var _0x19e763=util[_0x4e4f('0x2a')](_0x4e4f('0x175'),FILES_PATH,_0x40f123,_0x477d4a);var _0x1dca49=util[_0x4e4f('0x2a')](_0x4e4f('0x12e'),FILES_PATH,_0x40f123);this[_0x4e4f('0x3a')][_0x4e4f('0x71')](this,_0x50a5fc,_0x40f123,_0x19e763);this['channel']['setVariable']('RECORDING_SAVENAME',_0x40f123);logger[_0x4e4f('0x2f')](_0x4e4f('0x176'),_0x1dca49,_0x477d4a,_0x50a5fc[_0x4e4f('0x177')],_0x50a5fc[_0x4e4f('0x65')]);return this[_0x4e4f('0xe')][_0x4e4f('0x128')](_0x1dca49,_0x477d4a,_0x50a5fc['escape_digits'],_0x50a5fc[_0x4e4f('0x65')],undefined,!![]);};AGIVertices[_0x4e4f('0x10')]['restapi']=function(_0x278182){logger['info'](util[_0x4e4f('0x2a')](_0x4e4f('0x178'),_0x278182[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x278182[_0x4e4f('0x104')])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0x179'));}var _0x5737ad=this[_0x4e4f('0x63')][_0x4e4f('0x71')](this,_0x278182);logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x17a'),util['inspect'](_0x5737ad,{'showHidden':![],'depth':null})));if(!this[_0x4e4f('0x84')](_0x278182[_0x4e4f('0xd4')])){return this[_0x4e4f('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1f85b6=this[_0x4e4f('0x11')]['sync'](this,_0x278182['variable_id']);if(!_0x1f85b6){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x278182,'no\x20variable\x20found');}this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')]('%s_STATUS_CODE',_0x1f85b6),_0x5737ad[_0x4e4f('0x17b')]?_0x5737ad[_0x4e4f('0x17b')]:'200');this[_0x4e4f('0xe')][_0x4e4f('0x9c')](util[_0x4e4f('0x2a')]('%s_STATUS_MESSAGE',_0x1f85b6),_0x5737ad['statusMessage']?_0x5737ad[_0x4e4f('0x75')]:'OK');if(_0x5737ad['body']){try{this['saveRestApiResult'](_0x5737ad[_0x4e4f('0x6b')],_0x1f85b6);}catch(_0x83b778){logger['error'](util[_0x4e4f('0x2a')](_0x4e4f('0x17c'),_0x1f85b6));}}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xd9'),_0x1f85b6));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x17d')]=function(_0x3ee583){logger['info'](util['format'](_0x4e4f('0x17e'),_0x3ee583['label']));return this['channel'][_0x4e4f('0x17f')](_0x3ee583[_0x4e4f('0x180')][_0x4e4f('0xd2')](/\s+/g,''),_0x3ee583['escape_digits']);};AGIVertices['prototype'][_0x4e4f('0x181')]=function(_0x1df9e9){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x182'),_0x1df9e9[_0x4e4f('0xa7')]));return this[_0x4e4f('0xe')][_0x4e4f('0x183')](_0x1df9e9[_0x4e4f('0x66')][_0x4e4f('0xd2')](/\s+/g,''),_0x1df9e9[_0x4e4f('0x177')]);};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x184')]=function(_0x52c50d){logger['info'](util['format'](_0x4e4f('0x185'),_0x52c50d[_0x4e4f('0xa7')]));return this[_0x4e4f('0xe')]['sayPhonetic'](_0x52c50d[_0x4e4f('0x5d')],_0x52c50d['escape_digits']);};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x186')]=function(_0x53a1c3){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x187'),_0x53a1c3[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x53a1c3['account_id'])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x188'));}var _0x5a94ab=this[_0x4e4f('0x22')][_0x4e4f('0x71')](this,_0x53a1c3['account_id']);if(!_0x5a94ab||!_0x5a94ab['Smtp']){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x53a1c3,_0x4e4f('0x189'));}var _0x26ab4a={'from':util[_0x4e4f('0x2a')](_0x4e4f('0x18a'),_0x5a94ab[_0x4e4f('0x14')],_0x5a94ab[_0x4e4f('0x18b')]||_0x5a94ab[_0x4e4f('0x18c')]['user']),'to':_0x53a1c3['to']||'','cc':_0x53a1c3['cc']||'','bcc':_0x53a1c3[_0x4e4f('0x18d')]||'','subject':_0x53a1c3['subject'],'html':_0x53a1c3[_0x4e4f('0x5d')],'text':_0x53a1c3['text']};var _0x1b7d2d={'tls':{'rejectUnauthorized':![]}};if(_0x5a94ab[_0x4e4f('0x18c')][_0x4e4f('0x18e')]){_0x1b7d2d[_0x4e4f('0x18e')]=_0x5a94ab['Smtp'][_0x4e4f('0x18e')];}else{_0x1b7d2d[_0x4e4f('0x18f')]=_0x5a94ab[_0x4e4f('0x18c')]['host'];_0x1b7d2d['port']=_0x5a94ab[_0x4e4f('0x18c')]['port'];_0x1b7d2d[_0x4e4f('0x190')]=_0x5a94ab[_0x4e4f('0x18c')][_0x4e4f('0x190')];}if(_0x5a94ab['Smtp'][_0x4e4f('0x191')]){_0x1b7d2d[_0x4e4f('0x192')]={'user':_0x5a94ab[_0x4e4f('0x18c')]['user'],'pass':_0x5a94ab[_0x4e4f('0x18c')][_0x4e4f('0x193')]};}if(this[_0x4e4f('0x84')](_0x53a1c3[_0x4e4f('0x194')])){}logger[_0x4e4f('0xda')](_0x4e4f('0x195'),JSON[_0x4e4f('0x73')](_0x26ab4a));this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x53a1c3,_0x53a1c3[_0x4e4f('0x196')]);this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x5a94ab[_0x4e4f('0x14')]));this[_0x4e4f('0x23')][_0x4e4f('0x71')](this,_0x1b7d2d,_0x26ab4a);return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x197'));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x198')]=function(_0x4bd6a7){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x199'),_0x4bd6a7['label']));return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x19a'));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x19b')]=function(_0x5c75bc){logger['info'](util['format'](_0x4e4f('0x19c'),_0x5c75bc[_0x4e4f('0xa7')]));if(!this[_0x4e4f('0x84')](_0x5c75bc[_0x4e4f('0x19d')])){return this['channel']['noop'](_0x4e4f('0x19e'));}var _0x2d259c=this[_0x4e4f('0x33')]['sync'](this,_0x5c75bc['sms_account_id']);if(!_0x2d259c){return this[_0x4e4f('0xe')]['error'](_0x5c75bc,_0x4e4f('0x19f'));}var _0x150fee={'body':_0x5c75bc['sms_text'],'phone':_0x5c75bc['to']||'','SmsAccountId':_0x2d259c['id']};logger[_0x4e4f('0xda')]('sendSMS\x20message',JSON[_0x4e4f('0x73')](_0x150fee));this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x5c75bc,_0x5c75bc['sms_account_id']);this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0x1a0'),_0x2d259c[_0x4e4f('0x14')]));this[_0x4e4f('0x35')][_0x4e4f('0x71')](this,_0x150fee);return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x1a1'));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x1a2')]=function(_0xba03a6){logger[_0x4e4f('0x2f')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0xba03a6[_0x4e4f('0xa7')]));if(!this['isConfigured'](_0xba03a6[_0x4e4f('0xd4')])){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0xba03a6,_0x4e4f('0x1a3'));}var _0x1777ad=this[_0x4e4f('0x11')]['sync'](this,_0xba03a6[_0x4e4f('0xd4')]);if(!_0x1777ad){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0xba03a6,'no\x20variable\x20found');}return this[_0x4e4f('0xe')][_0x4e4f('0x9c')](_0x1777ad,_0xba03a6[_0x4e4f('0x1a4')]);};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x1a5')]=function(_0x1b49b8){logger['info'](util[_0x4e4f('0x2a')](_0x4e4f('0x1a6'),_0x1b49b8[_0x4e4f('0xa7')]));this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x1a7'));if(_0x1b49b8[_0x4e4f('0xb9')]==='yes'){this[_0x4e4f('0xe')]['noop']('Answer');return this[_0x4e4f('0xe')][_0x4e4f('0xb9')]();}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('Skipped\x20Answer');};AGIVertices[_0x4e4f('0x10')]['subproject']=function(_0x15fc65){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x1a8'),_0x15fc65[_0x4e4f('0xa7')]));if(!this['isConfigured'](_0x15fc65[_0x4e4f('0x1a9')])){return this['channel']['error'](_0x15fc65,'no\x20subproject\x20selected');}var _0x5eb6a6=this[_0x4e4f('0x18')][_0x4e4f('0x71')](this,_0x15fc65[_0x4e4f('0x1a9')]);if(!this[_0x4e4f('0x84')](_0x5eb6a6)){return this['channel'][_0x4e4f('0x2e')](_0x15fc65,util['format'](_0x4e4f('0x1aa'),_0x15fc65[_0x4e4f('0x1a9')]));}if(_0x5eb6a6===this[_0x4e4f('0xe')][_0x4e4f('0x39')]){return this[_0x4e4f('0xe')][_0x4e4f('0x2e')](_0x15fc65,_0x4e4f('0x1ab'));}this[_0x4e4f('0x36')][_0x4e4f('0x71')](this,_0x15fc65,_0x5eb6a6);var _0x12bf16=this['channel'][_0x4e4f('0x58')](_0x4e4f('0x1ac'),util[_0x4e4f('0x2a')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x4e4f('0x18f')]||_0x4e4f('0x1ad'),_0x5eb6a6,this[_0x4e4f('0xe')][_0x4e4f('0x39')]));if(_0x12bf16[_0x4e4f('0xa2')]===-0x1){return _0x12bf16;}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x5eb6a6));};AGIVertices['prototype'][_0x4e4f('0x1ae')]=function(_0x5bdbfa){logger['info'](util[_0x4e4f('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5bdbfa['label']));var _0x462810=this[_0x4e4f('0x1af')]['sync'](this,_0x5bdbfa[_0x4e4f('0xb5')]);this[_0x4e4f('0x36')]['sync'](this,_0x5bdbfa,_0x5bdbfa[_0x4e4f('0xb5')]);if(this[_0x4e4f('0x84')](_0x5bdbfa[_0x4e4f('0xd4')])){var _0x5a677b=this[_0x4e4f('0x11')][_0x4e4f('0x71')](this,_0x5bdbfa['variable_id']);if(_0x5a677b){this[_0x4e4f('0xe')][_0x4e4f('0x9c')](_0x5a677b,_0x462810);return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x1b0'),_0x5bdbfa[_0x4e4f('0xb5')],_0x5a677b));}}return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x1b1'),_0x5bdbfa[_0x4e4f('0xb5')]));};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x1b2')]=function(_0x3355f2){logger['info'](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3355f2['label']));_0x3355f2[_0x4e4f('0x5d')]=_0x3355f2['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4e4f('0x84')](_0x3355f2[_0x4e4f('0x5b')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')](_0x4e4f('0x1b3'));}if(!this[_0x4e4f('0x84')](_0x3355f2['text'])){return this['channel'][_0x4e4f('0xa8')](_0x4e4f('0xa9'));}this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0x1b4'),_0x3355f2['text']));var _0x46f2e2=this['googleCloudTTS'][_0x4e4f('0x71')](this,_0x3355f2);if(_0x46f2e2){this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x1b5'),_0x46f2e2));var _0x3c1f12=this[_0x4e4f('0xe')][_0x4e4f('0x119')](_0x46f2e2);try{fs[_0x4e4f('0xfb')](_0x46f2e2+_0x4e4f('0x11a'));}catch(_0x1dbef4){logger[_0x4e4f('0x2e')](_0x1dbef4);}return _0x3c1f12;}return this['channel'][_0x4e4f('0x2e')](_0x3355f2,_0x4e4f('0x1b6'));};AGIVertices['prototype']['tts']=function(_0x45847c){logger['info'](util['format'](_0x4e4f('0x1b7'),_0x45847c[_0x4e4f('0xa7')]));_0x45847c[_0x4e4f('0x5d')]=_0x45847c[_0x4e4f('0x5d')][_0x4e4f('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4e4f('0x84')](_0x45847c[_0x4e4f('0x5d')])){return this[_0x4e4f('0xe')][_0x4e4f('0xa8')]('no\x20text\x20configured');}this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0x1b8'),_0x45847c[_0x4e4f('0x5d')]));var _0x5a1e36=this['googleTTS'][_0x4e4f('0x71')](this,_0x45847c);if(_0x5a1e36){this[_0x4e4f('0xe')]['noop'](util[_0x4e4f('0x2a')](_0x4e4f('0x1b9'),_0x5a1e36));var _0x38db3c=this[_0x4e4f('0xe')][_0x4e4f('0x119')](_0x5a1e36);try{fs[_0x4e4f('0xfb')](_0x5a1e36+_0x4e4f('0x11a'));}catch(_0x71817e){logger[_0x4e4f('0x2e')](_0x71817e);}return _0x38db3c;}return this[_0x4e4f('0xe')]['error'](_0x45847c,_0x4e4f('0x1ba'));};AGIVertices['prototype'][_0x4e4f('0x1bb')]=function(_0x2c0c84){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x1bc'),_0x2c0c84['label']));if(!this[_0x4e4f('0x84')](_0x2c0c84[_0x4e4f('0x14d')])){return this['channel']['error'](_0x2c0c84,_0x4e4f('0x154'));}logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x155'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x2c0c84[_0x4e4f('0x14d')]));var _0x54221d=this[_0x4e4f('0x52')][_0x4e4f('0x71')](this,_0x2c0c84[_0x4e4f('0x14d')]);if(_0x54221d){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x14e'),this['channel'][_0x4e4f('0x51')],_0x2c0c84['findBy']));this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x4e4f('0x51')],_0x2c0c84[_0x4e4f('0x14d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')](_0x4e4f('0x150'),this[_0x4e4f('0xe')][_0x4e4f('0x51')],_0x2c0c84[_0x4e4f('0x14d')]));this[_0x4e4f('0xe')][_0x4e4f('0xa8')](util['format'](_0x4e4f('0x150'),this['channel']['callerid'],_0x2c0c84['findBy']));return{'code':0xc8,'result':_0x4e4f('0x151')};}};AGIVertices[_0x4e4f('0x10')][_0x4e4f('0x1bd')]=function(_0x36ad7f){logger[_0x4e4f('0x2f')](util[_0x4e4f('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x36ad7f[_0x4e4f('0xa7')]));var _0x1253b0=this[_0x4e4f('0xe')][_0x4e4f('0x58')](_0x4e4f('0x1be'),[_0x36ad7f[_0x4e4f('0x1bf')],_0x36ad7f['options']]);if(_0x1253b0[_0x4e4f('0xa2')]===-0x1){return _0x1253b0;}return this['channel'][_0x4e4f('0xa8')](util[_0x4e4f('0x2a')](_0x4e4f('0xc0'),_0x4e4f('0x1be'),_0x36ad7f['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x284027){logger[_0x4e4f('0x2f')](util['format'](_0x4e4f('0x1c0'),_0x284027[_0x4e4f('0xa7')]));if(!this['isConfigured'](_0x284027[_0x4e4f('0xd4')])){return this['channel'][_0x4e4f('0x2e')](_0x284027,_0x4e4f('0x1a3'));}var _0x3dc14e=this[_0x4e4f('0x11')][_0x4e4f('0x71')](this,_0x284027['variable_id']);if(!_0x3dc14e){return this[_0x4e4f('0xe')]['error'](_0x284027,_0x4e4f('0x15b'));}var _0x24755e=this[_0x4e4f('0xe')][_0x4e4f('0x11')](_0x3dc14e);return{'code':0xc8,'result':_0x24755e[_0x4e4f('0xa0')]?_0x24755e['extra']:'-'};};String['prototype'][_0x4e4f('0x9f')]=function(_0x34ec31,_0x43b03f){return this['split'](_0x34ec31)[_0x4e4f('0x1c1')](_0x43b03f);};module['exports']=AGIVertices; \ No newline at end of file +var _0xf9fd=['sestekNDA','speed','ispeechASR','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_INPUT()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','replace','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechTTS','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','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20selected','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','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','POST','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','text','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language'];(function(_0x5b1fcc,_0x2efff1){var _0x4ebec4=function(_0x4051df){while(--_0x4051df){_0x5b1fcc['push'](_0x5b1fcc['shift']());}};_0x4ebec4(++_0x2efff1);}(_0xf9fd,0x14f));var _0xdf9f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf9fd[_0x2dafbe];return _0x58a45a;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xdf9f('0x0'));var _=require(_0xdf9f('0x1'));var sh=require(_0xdf9f('0x2'));var odbc=require(_0xdf9f('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xdf9f('0x4'));var rp=require(_0xdf9f('0x5'));var logger=require(_0xdf9f('0x6'))(_0xdf9f('0x7'));var config=require(_0xdf9f('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xdf9f('0x9');var recursiveMapAttributes=[_0xdf9f('0xa'),'rawBody'];var verticesWithRetry=['menu',_0xdf9f('0xb'),_0xdf9f('0xc')];var AGIVertices=function(_0x4adc0d,_0x1fd476,_0x27d82e){this[_0xdf9f('0xd')]=_0x4adc0d;this[_0xdf9f('0xe')]=_0x1fd476;this[_0xdf9f('0xf')]=_0x27d82e;};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x11')]=function(_0x1af9b0,_0x4ca8ea){this[_0xdf9f('0xe')]['getVariableById'](_0x1af9b0)[_0xdf9f('0x12')](function(_0x23d979){_0x4ca8ea(null,_0x23d979?_0x23d979[_0xdf9f('0x13')]:![]);})[_0xdf9f('0x14')](function(_0x6de850){_0x4ca8ea(_0x6de850);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x15')]=function(_0x56da0f,_0x431eda){this['rpc'][_0xdf9f('0x16')](_0x56da0f)['then'](function(_0x503ded){_0x431eda(null,_0x503ded?_0x503ded[_0xdf9f('0x13')]:![]);})[_0xdf9f('0x14')](function(_0x135cbc){_0x431eda(_0x135cbc);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x17')]=function(_0x504362,_0xb5a52){this[_0xdf9f('0xe')]['getSquareProjectById'](_0x504362)['then'](function(_0x5e7498){_0xb5a52(null,_0x5e7498?_0x5e7498[_0xdf9f('0x13')]:![]);})['catch'](function(_0x3f0b55){_0xb5a52(_0x3f0b55);});};AGIVertices['prototype'][_0xdf9f('0x18')]=function(_0x4dd288,_0x1ab8a6){this[_0xdf9f('0xe')]['getSquareOdbcById'](_0x4dd288)[_0xdf9f('0x12')](function(_0x245c3f){_0x1ab8a6(null,_0x245c3f?_0x245c3f[_0xdf9f('0x19')]:![]);})[_0xdf9f('0x14')](function(_0xf9e067){_0x1ab8a6(_0xf9e067);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1a')]=function(_0x39db27,_0x7a4f66){this[_0xdf9f('0xe')][_0xdf9f('0x1b')](_0x39db27)[_0xdf9f('0x12')](function(_0x498eeb){_0x7a4f66(null,_0x498eeb?_0x498eeb[_0xdf9f('0x13')]:![]);})[_0xdf9f('0x14')](function(_0x561c79){_0x7a4f66(_0x561c79);});};AGIVertices[_0xdf9f('0x10')]['getTrunk']=function(_0xce473a,_0x3430d2){this[_0xdf9f('0xe')][_0xdf9f('0x1c')](_0xce473a)[_0xdf9f('0x12')](function(_0x4ac426){_0x3430d2(null,_0x4ac426?_0x4ac426[_0xdf9f('0x13')]:![]);})[_0xdf9f('0x14')](function(_0x3be0a1){_0x3430d2(_0x3be0a1);});};AGIVertices['prototype'][_0xdf9f('0x1d')]=function(_0x45cb6f,_0x455980){var _0x33a822=this;this[_0xdf9f('0xe')][_0xdf9f('0x1e')](_0x45cb6f)['then'](function(_0x4f0f28){_0x455980(null,_0x4f0f28?_0x33a822['getSoundPath'](_0x4f0f28[_0xdf9f('0x1f')]):![]);})[_0xdf9f('0x14')](function(_0x23efeb){_0x455980(_0x23efeb);});};AGIVertices['prototype'][_0xdf9f('0x20')]=function(_0x3dda8e,_0x4f7663){this[_0xdf9f('0xe')][_0xdf9f('0x21')](_0x3dda8e)[_0xdf9f('0x12')](function(_0xb6fc11){_0x4f7663(null,_0xb6fc11?_0xb6fc11:![]);})[_0xdf9f('0x14')](function(_0x5626d8){_0x4f7663(_0x5626d8);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x22')]=function(_0x546c82,_0x3503db,_0x219624){this[_0xdf9f('0xf')][_0xdf9f('0x22')](_0x546c82,_0x3503db)[_0xdf9f('0x12')](function(){_0x219624(null);})['catch'](function(_0x248ff2){_0x219624(_0x248ff2);});};AGIVertices['prototype'][_0xdf9f('0x23')]=function(_0x2e43e0,_0x2268df){this[_0xdf9f('0xe')]['getIntervalById'](_0x2e43e0)[_0xdf9f('0x12')](function(_0x1a102d){if(_0x1a102d){if(_0x1a102d[_0xdf9f('0x24')]){_0x2268df(null,[_0x1a102d['interval']]);}else{_0x2268df(null,_[_0xdf9f('0x25')](_0x1a102d['Intervals'],_0xdf9f('0x26')));}}else{_0x2268df(null,![]);}})[_0xdf9f('0x14')](function(_0x344aa4){_0x2268df(_0x344aa4);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x27')]=function(_0x4c68fc){return util[_0xdf9f('0x28')](_0xdf9f('0x29'),FILES_PATH,_0x4c68fc);};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x2a')]=function(_0x523a4e,_0x18e005,_0x588f63){odbc[_0xdf9f('0x2b')](_0x523a4e,function(_0x230455){if(_0x230455){logger[_0xdf9f('0x2c')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x230455);_0x588f63(_0x230455);}else{logger[_0xdf9f('0x2d')](_0xdf9f('0x2e'));odbc[_0xdf9f('0x2f')](_0x18e005,function(_0x543a9c,_0x255dde){if(_0x543a9c){logger[_0xdf9f('0x2d')](_0xdf9f('0x30'),_0x18e005);_0x588f63(_0x543a9c);}else{logger[_0xdf9f('0x2d')](_0xdf9f('0x31'),_0x18e005);odbc[_0xdf9f('0x32')](function(_0x1bc7b7){if(_0x1bc7b7){logger[_0xdf9f('0x2c')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1bc7b7);}_0x588f63(null,_0x255dde);});}});}});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x33')]=function(_0x31fb5a,_0x18e552){this[_0xdf9f('0xe')]['getSmsAccountById'](_0x31fb5a)[_0xdf9f('0x12')](function(_0x25b26d){_0x18e552(null,_0x25b26d?_0x25b26d:![]);})[_0xdf9f('0x14')](function(_0x2916de){_0x18e552(_0x2916de);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x34')]=function(_0x478cc1,_0x1bcbcf){this['rpc'][_0xdf9f('0x34')](_0x478cc1)[_0xdf9f('0x12')](function(_0x2ed1a8){_0x1bcbcf(null,_0x2ed1a8);})[_0xdf9f('0x14')](function(_0x32ca20){_0x1bcbcf(_0x32ca20);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x35')]=function(_0x68200f,_0x522f06,_0x1e8726){this[_0xdf9f('0xe')][_0xdf9f('0x35')]({'uniqueid':this[_0xdf9f('0xd')][_0xdf9f('0x36')],'node':_0x68200f[_0xdf9f('0x37')],'application':_0x68200f[_0xdf9f('0x38')],'data':_0x522f06||null,'project_name':this['channel'][_0xdf9f('0x39')],'callerid':this[_0xdf9f('0xd')][_0xdf9f('0x3a')]})[_0xdf9f('0x12')](function(_0x893245){if(_0x1e8726){_0x1e8726(null,_0x893245);}})[_0xdf9f('0x14')](function(_0x4cadb1){if(_0x1e8726){_0x1e8726(_0x4cadb1);}});};AGIVertices[_0xdf9f('0x10')]['createSquareRecording']=function(_0x53d8ef,_0x4c26fd,_0x234cf7,_0x861af2){this[_0xdf9f('0xe')][_0xdf9f('0x3b')]({'uniqueid':this['channel'][_0xdf9f('0x36')],'callerid':this[_0xdf9f('0xd')]['callerid'],'calleridname':this[_0xdf9f('0xd')][_0xdf9f('0x3c')],'context':this[_0xdf9f('0xd')][_0xdf9f('0x3d')],'extension':this[_0xdf9f('0xd')][_0xdf9f('0x3e')],'priority':this['channel'][_0xdf9f('0x3f')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xdf9f('0xd')][_0xdf9f('0x40')],'projectName':this[_0xdf9f('0xd')]['arg_1'],'saveName':_0x4c26fd,'filename':_0x53d8ef[_0xdf9f('0x41')]||_0x4c26fd,'savePath':_0x234cf7})['then'](function(_0x3592f5){_0x861af2(null,_0x3592f5);})['catch'](function(_0x127c0a){_0x861af2(_0x127c0a);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x42')]=function(_0x52a676,_0x46f655,_0x384c32,_0x372520,_0x9cb875){this['rpc'][_0xdf9f('0x42')]({'uniqueid':this['channel'][_0xdf9f('0x36')],'body':_0x52a676,'direction':_0x46f655,'providerName':_0x384c32,'providerResponse':_0x372520})['then'](function(_0xed62a7){if(_0x9cb875){_0x9cb875(null,_0xed62a7);}})[_0xdf9f('0x14')](function(_0x1cc827){if(_0x9cb875){_0x9cb875(_0x1cc827);}});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x43')]=function(_0x4d32d1,_0x20fc6c){this['rpc'][_0xdf9f('0x43')]({'firstName':_[_0xdf9f('0x44')](_0x4d32d1[_0xdf9f('0x13')])||_[_0xdf9f('0x45')](_0x4d32d1['name'])?'callback_'+Math['random']():_0x4d32d1[_0xdf9f('0x13')],'lastName':_[_0xdf9f('0x44')](_0x4d32d1['lastName'])||_[_0xdf9f('0x45')](_0x4d32d1[_0xdf9f('0x46')])?null:_0x4d32d1[_0xdf9f('0x46')],'phone':_0x4d32d1[_0xdf9f('0x47')],'ListId':_0x4d32d1[_0xdf9f('0x48')],'scheduledat':_0x4d32d1[_0xdf9f('0x49')],'callbackUniqueid':this['channel'][_0xdf9f('0x36')],'tags':_0xdf9f('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x4d32d1['scheduledAt'][_0xdf9f('0x4b')](),'priority':_0x4d32d1[_0xdf9f('0x4c')]})[_0xdf9f('0x12')](function(_0x5a5d57){_0x20fc6c(null,_0x5a5d57);})[_0xdf9f('0x14')](function(_0x4d90fe){_0x20fc6c(_0x4d90fe);});};AGIVertices[_0xdf9f('0x10')]['getPause']=function(_0x5a3de2,_0x23ed3f){this[_0xdf9f('0xe')][_0xdf9f('0x4d')](_0x5a3de2)[_0xdf9f('0x12')](function(_0x240935){_0x23ed3f(null,_0x240935?_0x240935[_0xdf9f('0x13')]:![]);})[_0xdf9f('0x14')](function(_0x1e8485){_0x23ed3f(_0x1e8485);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x4e')]=function(_0x1dcd98,_0x2cb76e,_0x87d254){var _0x2e2d24={'role':_0xdf9f('0x4f')};_0x2e2d24[_0x1dcd98]=this[_0xdf9f('0xd')]['callerid'];this[_0xdf9f('0xe')][_0xdf9f('0x4e')](_0x2e2d24,_0x2cb76e,this['channel'][_0xdf9f('0x36')])['then'](function(_0x364552){_0x87d254(null,_[_0xdf9f('0x45')](_0x364552)?![]:!![]);})['catch'](function(_0x5b006d){logger['error'](_0x5b006d);_0x87d254(null,![]);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x50')]=function(_0x442c49,_0xc01d27){var _0x5effe1={'role':'agent'};_0x5effe1[_0x442c49]=this[_0xdf9f('0xd')][_0xdf9f('0x3a')];this['rpc'][_0xdf9f('0x50')](_0x5effe1)[_0xdf9f('0x12')](function(_0x26c6b5){_0xc01d27(null,_[_0xdf9f('0x45')](_0x26c6b5)?![]:!![]);})[_0xdf9f('0x14')](function(_0x3d4dcf){logger[_0xdf9f('0x2c')](_0x3d4dcf);_0xc01d27(null,![]);});};AGIVertices['prototype'][_0xdf9f('0x51')]=function(_0x1ed95c,_0x310d77){var _0x32ae8f={'role':_0xdf9f('0x4f')};_0x32ae8f[_0x1ed95c]=this[_0xdf9f('0xd')][_0xdf9f('0x3a')];this[_0xdf9f('0xe')][_0xdf9f('0x51')](_0x32ae8f)[_0xdf9f('0x12')](function(_0x589147){_0x310d77(null,_[_0xdf9f('0x45')](_0x589147)?![]:!![]);})['catch'](function(_0x37ee96){logger[_0xdf9f('0x2c')](_0x37ee96);_0x310d77(null,![]);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x52')]=function(_0x5cd375,_0x32f679){var _0xcfe934={'role':_0xdf9f('0x4f')};_0xcfe934[_0x5cd375]=this[_0xdf9f('0xd')][_0xdf9f('0x3a')];var _0x4a685b=_0x5cd375!=_0xdf9f('0x53')?util['format'](_0xdf9f('0x54'),_0xdf9f('0x55'),this[_0xdf9f('0xd')][_0xdf9f('0x3a')]):undefined;this[_0xdf9f('0xe')][_0xdf9f('0x52')](_0xcfe934,_0x4a685b)[_0xdf9f('0x12')](function(_0x4586a0){_0x32f679(null,_['isNil'](_0x4586a0)?![]:!![]);})[_0xdf9f('0x14')](function(_0x382500){logger[_0xdf9f('0x2c')](_0x382500);_0x32f679(null,![]);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x56')]=function(_0x3470d7,_0x461588){sh[_0xdf9f('0x57')](_[_0xdf9f('0x58')](_0x3470d7),function(_0x82a600,_0x1c87a8){var _0x3104db=_0x1c87a8['replace'](/(\r\n|\n|\r)/gm,'');_0x461588(null,_0x3104db);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x59')]=function(_0x2105e7,_0x6feb8b){scripts['googleCloudTTS'](_0x2105e7[_0xdf9f('0x5a')],_0x2105e7[_0xdf9f('0x5b')]||'text',_0x2105e7['text'],_0x2105e7[_0xdf9f('0x5c')]||_0xdf9f('0x5d'),_0x2105e7['ssmlGender']||_0xdf9f('0x5e'),_0x2105e7[_0xdf9f('0x5f')]||_0xdf9f('0x60'))[_0xdf9f('0x12')](function(_0x3b7dc8){_0x6feb8b(null,_0x3b7dc8);})[_0xdf9f('0x14')](function(_0x1f9782){_0x6feb8b(_0x1f9782);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x61')]=function(_0x466fa3,_0x510417){scripts[_0xdf9f('0x61')](_0x466fa3['text'],_0x466fa3['google_tts_language']||'en',0x1)[_0xdf9f('0x12')](function(_0x35f746){_0x510417(null,_0x35f746);})[_0xdf9f('0x14')](function(_0x145509){_0x510417(_0x145509);});};AGIVertices['prototype'][_0xdf9f('0x62')]=function(_0x4e832c,_0x2563c0){var _0x21f22b={'uri':_0x4e832c[_0xdf9f('0x63')],'method':_0x4e832c[_0xdf9f('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4e832c['timeout'])===_0xdf9f('0x65')&&parseInt(_0x4e832c['timeout'])>=0x1?parseInt(_0x4e832c[_0xdf9f('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xdf9f('0x67'),'PUT'],_0x21f22b[_0xdf9f('0x64')]['toUpperCase']())){try{_0x21f22b['body']=_0x4e832c[_0xdf9f('0x68')]?JSON[_0xdf9f('0x69')](_0x4e832c[_0xdf9f('0x68')]):{};}catch(_0x4f0bbf){logger[_0xdf9f('0x2c')](_0xdf9f('0x6a'),_0x4f0bbf);}}try{_0x21f22b[_0xdf9f('0x6b')]=_0x4e832c['rawHeaders']?JSON[_0xdf9f('0x69')](_0x4e832c[_0xdf9f('0xa')]):{};}catch(_0x412124){logger[_0xdf9f('0x2c')](_0xdf9f('0x6c'),_0x412124);}if(_0x4e832c[_0xdf9f('0x6d')]){try{var _0x294009=require(_0x4e832c[_0xdf9f('0x6d')])[_0xdf9f('0x6e')](this,_0x21f22b);_0x21f22b[_0xdf9f('0x6f')]=Mustache[_0xdf9f('0x70')](_0x4e832c['url'],_0x294009,{},['$$','$$']);if(_0x21f22b[_0xdf9f('0x6b')]){_0x21f22b[_0xdf9f('0x6b')]=JSON[_0xdf9f('0x69')](Mustache[_0xdf9f('0x70')](JSON[_0xdf9f('0x71')](_0x21f22b['headers']),_0x294009,{},['$$','$$']));}if(_0x21f22b[_0xdf9f('0x72')]){_0x21f22b[_0xdf9f('0x72')]=JSON[_0xdf9f('0x69')](Mustache['render'](JSON[_0xdf9f('0x71')](_0x21f22b[_0xdf9f('0x72')]),_0x294009,{},['$$','$$']));}}catch(_0x3fdb27){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3fdb27);}}rp(_0x21f22b)[_0xdf9f('0x12')](function(_0x437ce7){var _0x82f5c8={'statusCode':_0x437ce7[_0xdf9f('0x73')]||0xc8,'statusMessage':_0x437ce7[_0xdf9f('0x74')]||'OK','headers':_0x437ce7[_0xdf9f('0x6b')]||{},'body':_0x437ce7[_0xdf9f('0x72')]||{}};_0x2563c0(null,_0x82f5c8);})[_0xdf9f('0x14')](function(_0x3e0819){var _0x3bf1e6={'statusCode':_0x3e0819['statusCode']||0x1f4,'statusMessage':_0x3e0819['message']||_0xdf9f('0x75'),'headers':_0x3e0819[_0xdf9f('0x76')]['headers']||{},'body':_0x3e0819['options'][_0xdf9f('0x72')]||{}};_0x2563c0(null,_0x3bf1e6);});};AGIVertices['prototype']['googleDialogflow']=function(_0x3abf79,_0x50e0a1){scripts[_0xdf9f('0x77')](this[_0xdf9f('0xd')][_0xdf9f('0x36')],_0x3abf79[_0xdf9f('0x78')],_0x3abf79[_0xdf9f('0x79')],_0x3abf79[_0xdf9f('0x7a')]||'en')[_0xdf9f('0x12')](function(_0x5aa967){_0x50e0a1(null,_0x5aa967);})['catch'](function(_0x4cc973){_0x50e0a1(_0x4cc973);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x7b')]=function(_0x179cd0,_0x15a7f4){scripts[_0xdf9f('0x7b')](this['channel']['uniqueid'],_0x179cd0['dialogflowV2_project_id'],_0x179cd0[_0xdf9f('0x7c')],_0x179cd0[_0xdf9f('0x7d')],_0x179cd0[_0xdf9f('0x79')],_0x179cd0[_0xdf9f('0x7e')]||'en')[_0xdf9f('0x12')](function(_0x3b9937){_0x15a7f4(null,_0x3b9937);})[_0xdf9f('0x14')](function(_0x466a0d){_0x15a7f4(_0x466a0d);});};AGIVertices['prototype'][_0xdf9f('0x7f')]=function(_0x586616,_0x96a1d6){scripts['sestekNDA'](this[_0xdf9f('0xd')],_0x586616)[_0xdf9f('0x12')](function(_0x20db0c){_0x96a1d6(null,_0x20db0c);})['catch'](function(_0x48e324){_0x96a1d6(_0x48e324);});};AGIVertices['prototype']['ispeechTTS']=function(_0x274d42,_0xc5ce58){scripts['ispeechTTS'](_0x274d42['key'],_0x274d42[_0xdf9f('0x79')],_0x274d42['ispeech_tts_language']||'en-US',_0x274d42[_0xdf9f('0x80')])[_0xdf9f('0x12')](function(_0x2e65db){_0xc5ce58(null,_0x2e65db);})[_0xdf9f('0x14')](function(_0x24d0fb){_0xc5ce58(_0x24d0fb);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x81')]=function(_0x107109,_0x126d98,_0x3db01f){scripts[_0xdf9f('0x81')](_0x126d98,_0x107109[_0xdf9f('0x78')],_0x107109['ispeech_asr_language']||_0xdf9f('0x5d'),this['isConfigured'](_0x107109['model'])?_0x107109[_0xdf9f('0x82')]:undefined)['then'](function(_0x5d607c){_0x3db01f(null,_0x5d607c);})['catch'](function(_0x3d1c13){_0x3db01f(_0x3d1c13);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x83')]=function(_0x3d898a,_0x542f0c){scripts['awsPolly'](_0x3d898a['aws_access_key_id'],_0x3d898a[_0xdf9f('0x84')],_0x3d898a[_0xdf9f('0x85')],_0x3d898a[_0xdf9f('0x86')]||_0xdf9f('0x87'),_0x3d898a[_0xdf9f('0x79')],_0x3d898a[_0xdf9f('0x88')]||_0xdf9f('0x79'))[_0xdf9f('0x12')](function(_0x3f9f3e){_0x542f0c(null,_0x3f9f3e);})[_0xdf9f('0x14')](function(_0x3bd84e){_0x542f0c(_0x3bd84e);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x89')]=function(_0x4b1862,_0x519c13){scripts[_0xdf9f('0x89')](this[_0xdf9f('0xd')]['uniqueid'],_0x4b1862[_0xdf9f('0x8a')],_0x4b1862[_0xdf9f('0x84')],_0x4b1862[_0xdf9f('0x8b')],_0x4b1862[_0xdf9f('0x79')],_0x4b1862[_0xdf9f('0x8c')])[_0xdf9f('0x12')](function(_0xc5d2b7){_0x519c13(null,_0xc5d2b7);})['catch'](function(_0x53ab61){_0x519c13(_0x53ab61);});};AGIVertices['prototype'][_0xdf9f('0x8d')]=function(_0x257695,_0x43b420,_0x4c5005){scripts['googleASR'](_0x43b420,_0x257695[_0xdf9f('0x78')],_0x257695[_0xdf9f('0x8e')]||_0xdf9f('0x5d'))['then'](function(_0x4332fc){_0x4c5005(null,_0x4332fc);})['catch'](function(_0x47a79c){_0x4c5005(_0x47a79c);});};AGIVertices[_0xdf9f('0x10')]['tildeASR']=function(_0x3873fe,_0x46558f,_0x140ce3){scripts[_0xdf9f('0x8f')](_0x46558f,_0x3873fe[_0xdf9f('0x90')],_0x3873fe[_0xdf9f('0x91')],_0x3873fe[_0xdf9f('0x6f')])[_0xdf9f('0x12')](function(_0x370c1d){_0x140ce3(null,_0x370c1d);})['catch'](function(_0x4bff8d){_0x140ce3(_0x4bff8d);});};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x92')]=function(_0x4506e8){var _0x14ce74=_[_0xdf9f('0x93')](verticesWithRetry,_0x4506e8[_0xdf9f('0x38')])?_0x4506e8:_[_0xdf9f('0x94')](_0x4506e8);for(var _0x133545 in _0x14ce74){if(_0x14ce74[_0xdf9f('0x95')](_0x133545)){if(_0x14ce74[_0x133545]&&_['isString'](_0x14ce74[_0x133545])){if(_[_0xdf9f('0x93')](recursiveMapAttributes,_0x133545)){_0x14ce74[_0x133545]=this[_0xdf9f('0x96')](_0x14ce74[_0x133545]);}else{_0x14ce74[_0x133545]=this[_0xdf9f('0x97')](_0x14ce74[_0x133545]);}}}}return _0x14ce74;};AGIVertices[_0xdf9f('0x10')]['recursiveNodeIndex']=function(_0xf8ef5f){for(var _0x4f95e4 in _0xf8ef5f){if(_0xf8ef5f[_0xdf9f('0x95')](_0x4f95e4)){if(_[_0xdf9f('0x98')](_0xf8ef5f[_0x4f95e4])){this[_0xdf9f('0x99')](_0xf8ef5f[_0x4f95e4]);}else if(_[_0xdf9f('0x9a')](_0xf8ef5f[_0x4f95e4])){for(var _0x46a33b=0x0;_0x46a33b<_0xf8ef5f[_0x4f95e4][_0xdf9f('0x9b')];_0x46a33b++){this['recursiveNodeIndex'](_0xf8ef5f[_0x4f95e4][_0x46a33b]);}}else if(_['isString'](_0xf8ef5f[_0x4f95e4])){_0xf8ef5f[_0x4f95e4]=this[_0xdf9f('0x97')](_0xf8ef5f[_0x4f95e4]);}}}};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x9c')]=function(_0x3e3402,_0x212603){for(var _0x54914d in _0x3e3402){if(_0x3e3402[_0xdf9f('0x95')](_0x54914d)){if(_[_0xdf9f('0x98')](_0x3e3402[_0x54914d])){if(!_[_0xdf9f('0x44')](_0x3e3402[_0x54914d])){this[_0xdf9f('0x9c')](_0x3e3402[_0x54914d],util[_0xdf9f('0x28')](_0xdf9f('0x9d'),_0x212603,_0x54914d));}}else if(_[_0xdf9f('0x9a')](_0x3e3402[_0x54914d])){for(var _0x2a6079=0x0;_0x2a6079<_0x3e3402[_0x54914d][_0xdf9f('0x9b')];_0x2a6079++){this[_0xdf9f('0x9c')](_0x3e3402[_0x54914d][_0x2a6079],util[_0xdf9f('0x28')](_0xdf9f('0x9d'),_0x212603,_0x54914d+'['+_0x2a6079+']'));}}else{if(!_['isNil'](_0x3e3402[_0x54914d])){this[_0xdf9f('0xd')][_0xdf9f('0x9e')](util[_0xdf9f('0x28')](_0xdf9f('0x9d'),_0x212603,_0x54914d),_0x3e3402[_0x54914d]);}}}}};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x96')]=function(_0x245091){try{var _0x43db66=JSON[_0xdf9f('0x69')](_0x245091);this[_0xdf9f('0x99')](_0x43db66);return JSON['stringify'](_0x43db66);}catch(_0x4620a3){return this[_0xdf9f('0x97')](_0x245091);}};AGIVertices['prototype'][_0xdf9f('0x97')]=function(_0x57b7e9){var _0x530a4e=_0x57b7e9[_0xdf9f('0x9f')]('{');for(var _0x5ed124=0x1;_0x5ed124<_0x530a4e[_0xdf9f('0x9b')];_0x5ed124+=0x1){var _0x406dab=_0x530a4e[_0x5ed124][_0xdf9f('0x9f')]('}');if(_0x406dab[_0xdf9f('0x9b')]>0x1){_0x57b7e9=_0x57b7e9[_0xdf9f('0xa0')]('{'+_0x406dab[0x0]+'}',this['channel'][_0xdf9f('0x11')](_0x406dab[0x0])[_0xdf9f('0xa1')]||_0x406dab[0x0]);}}if(_0x530a4e['length']===0x1){return _0x57b7e9[_0xdf9f('0x4b')]();}return this[_0xdf9f('0x97')](_0x57b7e9);};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xa2')]=function(_0xd34d20,_0x28213b){var _0x51a069=this[_0xdf9f('0xd')][_0xdf9f('0x11')](_0xd34d20);if(_0x51a069[_0xdf9f('0xa3')]===-0x1){return _0x51a069;}logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0xa4'),_0x28213b,_0x51a069[_0xdf9f('0xa1')]));return this['channel']['setVariable'](_0x28213b,_0x51a069[_0xdf9f('0xa1')]);};AGIVertices['prototype'][_0xdf9f('0xa5')]=function(_0x559bee){return _0x559bee&&_0x559bee!=='0'&&_0x559bee!=='-1'&&_0x559bee!=='';};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xa6')]=function(_0x1f83b1){this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x1f83b1,'-');_0x1f83b1[_0xdf9f('0xa7')]=_0x1f83b1[_0xdf9f('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xdf9f('0x10')]['mrcpsynth']=function(_0x2628af){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xa8'),_0x2628af[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x2628af[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}var _0x2d99a9='\x22'+_0x2628af[_0xdf9f('0x79')]+'\x22';if(this['isConfigured'](_0x2628af[_0xdf9f('0x76')])){_0x2d99a9+=','+_0x2628af[_0xdf9f('0x76')];}var _0x2423b6=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xdf9f('0xab'),_0x2d99a9);if(_0x2423b6[_0xdf9f('0xa3')]===-0x1){return _0x2423b6;}return this[_0xdf9f('0xd')]['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xac'),_0x2d99a9));};AGIVertices[_0xdf9f('0x10')]['mrcprecog']=function(_0x2f2162){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x2f2162[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x2f2162['grammar'])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xad'));}var _0x11ebaa=_0x2f2162[_0xdf9f('0xae')];if(this[_0xdf9f('0xa5')](_0x2f2162[_0xdf9f('0x76')])){_0x11ebaa+=','+_0x2f2162[_0xdf9f('0x76')];}var _0x56c18e=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xdf9f('0xaf'),_0x11ebaa);if(_0x56c18e[_0xdf9f('0xa3')]===-0x1){return _0x56c18e;}var _0x4cc340=this['getAndSetVariable'](_0xdf9f('0xb0'),_0xdf9f('0xb1'));if(_0x4cc340[_0xdf9f('0xa3')]===-0x1){return _0x4cc340;}var _0x4c805a=this[_0xdf9f('0xa2')]('RECOG_INPUT()',_0xdf9f('0xb2'));if(_0x4c805a[_0xdf9f('0xa3')]===-0x1){return _0x4c805a;}var _0x4ca606=this[_0xdf9f('0xa2')](_0xdf9f('0xb3'),_0xdf9f('0xb4'));if(_0x4ca606['result']===-0x1){return _0x4ca606;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x11ebaa));};AGIVertices['prototype'][_0xdf9f('0x7')]=function(_0x599d78){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xb5'),_0x599d78[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0x7')]([_0x599d78[_0xdf9f('0xb6')],_0x599d78[_0xdf9f('0xb7')]]);};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xb8')]=function(_0x384a84){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0xb9'),_0x384a84[_0xdf9f('0x37')]));if(this[_0xdf9f('0xa5')](_0x384a84[_0xdf9f('0x66')])){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xba'),_0x384a84[_0xdf9f('0x66')]));var _0x2a32ac=this[_0xdf9f('0xd')]['wait'](_0x384a84[_0xdf9f('0x66')]);if(_0x2a32ac[_0xdf9f('0xa3')]===-0x1){return _0x2a32ac;}}return this[_0xdf9f('0xd')]['answer']();};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x4a')]=function(_0xdfc042){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0xbb'),_0xdfc042['label']));if(!this[_0xdf9f('0xa5')](_0xdfc042[_0xdf9f('0x48')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0xdfc042,_0xdf9f('0xbc'));}_0xdfc042[_0xdf9f('0x49')]=moment();if(this[_0xdf9f('0xa5')](_0xdfc042['delay'])){_0xdfc042[_0xdf9f('0x49')]=moment()['add'](_0xdfc042[_0xdf9f('0xbd')],_0xdf9f('0xbe'));}if(!this[_0xdf9f('0xa5')](_0xdfc042[_0xdf9f('0x4c')])){_0xdfc042[_0xdf9f('0x4c')]=0x2;}this[_0xdf9f('0x43')][_0xdf9f('0x6e')](this,_0xdfc042);return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util['format'](_0xdf9f('0xbf'),_0xdfc042[_0xdf9f('0x47')],_0xdfc042['list_id'],_0xdfc042[_0xdf9f('0x49')]));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xc0')]=function(_0xcc2429){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0xc1'),_0xcc2429[_0xdf9f('0x37')]));var _0x1f1f42=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xcc2429['application'],_0xcc2429[_0xdf9f('0x76')]);if(_0x1f1f42[_0xdf9f('0xa3')]===-0x1){return _0x1f1f42;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util['format'](_0xdf9f('0xc2'),_0xcc2429[_0xdf9f('0xc3')],_0xcc2429[_0xdf9f('0x76')]));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xc4')]=function(_0x416359){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xc5'),_0x416359['label']));if(!this[_0xdf9f('0xa5')](_0x416359[_0xdf9f('0x79')])){return this['channel'][_0xdf9f('0xa9')]('no\x20text\x20configured');}var _0x51da65='\x22'+_0x416359['text']+'\x22';if(this['isConfigured'](_0x416359[_0xdf9f('0x76')])){_0x51da65+=','+_0x416359['options'];}var _0x231cff=this[_0xdf9f('0xd')][_0xdf9f('0x57')]('MRCPSynth',_0x51da65);if(_0x231cff[_0xdf9f('0xa3')]===-0x1){return _0x231cff;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xac'),_0x51da65));};AGIVertices['prototype'][_0xdf9f('0xc6')]=function(_0x350d0a){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x350d0a[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x350d0a[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')]('no\x20text\x20configured');}var _0x21e9b8='\x22'+_0x350d0a[_0xdf9f('0x79')]+'\x22';if(this['isConfigured'](_0x350d0a[_0xdf9f('0x76')])){_0x21e9b8+=','+_0x350d0a['options'];}var _0x52c733=this[_0xdf9f('0xd')]['exec'](_0xdf9f('0xab'),_0x21e9b8);if(_0x52c733[_0xdf9f('0xa3')]===-0x1){return _0x52c733;}return this[_0xdf9f('0xd')]['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xac'),_0x21e9b8));};AGIVertices['prototype'][_0xdf9f('0xc7')]=function(_0x1d7103){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xc8'),_0x1d7103[_0xdf9f('0x37')]));if(!this['isConfigured'](_0x1d7103[_0xdf9f('0xae')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xad'));}var _0x767b47=_0x1d7103[_0xdf9f('0xae')];if(this[_0xdf9f('0xa5')](_0x1d7103[_0xdf9f('0x76')])){_0x767b47+=','+_0x1d7103['options'];}var _0x47a1f4=this[_0xdf9f('0xd')]['exec']('MRCPRecog',_0x767b47);if(_0x47a1f4[_0xdf9f('0xa3')]===-0x1){return _0x47a1f4;}var _0xf4be46=this[_0xdf9f('0xa2')](_0xdf9f('0xb0'),'LUMENVOX_ASR_CONFIDENCE');if(_0xf4be46['result']===-0x1){return _0xf4be46;}var _0x300653=this[_0xdf9f('0xa2')](_0xdf9f('0xc9'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x300653[_0xdf9f('0xa3')]===-0x1){return _0x300653;}var _0x5ae00a=this['getAndSetVariable'](_0xdf9f('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0x5ae00a[_0xdf9f('0xa3')]===-0x1){return _0x5ae00a;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xca'),_0x767b47));};AGIVertices['prototype'][_0xdf9f('0xcb')]=function(_0x58bad7){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0xcc'),_0x58bad7[_0xdf9f('0x37')]));if(!this['isConfigured'](_0x58bad7[_0xdf9f('0xae')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xad'));}var _0x4bc62e=_0x58bad7[_0xdf9f('0xae')];if(this[_0xdf9f('0xa5')](_0x58bad7[_0xdf9f('0x76')])){_0x4bc62e+=','+_0x58bad7[_0xdf9f('0x76')];}var _0xb806e6=this[_0xdf9f('0xd')]['exec'](_0xdf9f('0xaf'),_0x4bc62e);if(_0xb806e6[_0xdf9f('0xa3')]===-0x1){return _0xb806e6;}var _0x1482cf=this[_0xdf9f('0xa2')](_0xdf9f('0xb0'),'SESTEK_ASR_CONFIDENCE');if(_0x1482cf[_0xdf9f('0xa3')]===-0x1){return _0x1482cf;}var _0x730d5f=this[_0xdf9f('0xa2')](_0xdf9f('0xc9'),'SESTEK_ASR_TRANSCRIPT');if(_0x730d5f[_0xdf9f('0xa3')]===-0x1){return _0x730d5f;}var _0x2165a4=this['getAndSetVariable'](_0xdf9f('0xb3'),'SESTEK_ASR_INSTANCE');if(_0x2165a4[_0xdf9f('0xa3')]===-0x1){return _0x2165a4;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4bc62e));};AGIVertices['prototype']['database']=function(_0x5a567d){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0xcd'),_0x5a567d['label']));if(!this[_0xdf9f('0xa5')](_0x5a567d[_0xdf9f('0xce')])){return this[_0xdf9f('0xd')]['error'](_0x5a567d,'no\x20database\x20selected');}var _0x33291c=this['getSquareOdbc']['sync'](this,_0x5a567d[_0xdf9f('0xce')]);if(!_0x33291c){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x5a567d,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x5a567d[_0xdf9f('0x2f')])){return this[_0xdf9f('0xd')]['error'](_0x5a567d,_0xdf9f('0xcf'));}var _0x5181ff=_0x5a567d[_0xdf9f('0x2f')][_0xdf9f('0xd0')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xdf9f('0xa9')](util['format']('query:\x20%s',_0x5181ff));var _0x4c052a=this[_0xdf9f('0x2a')][_0xdf9f('0x6e')](this,_0x33291c,_0x5181ff);this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x5a567d,_0x5181ff);if(!this['isConfigured'](_0x5a567d[_0xdf9f('0xd1')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xd2'));}var _0x51939f=this[_0xdf9f('0x11')][_0xdf9f('0x6e')](this,_0x5a567d[_0xdf9f('0xd1')]);if(!_0x51939f){return this['channel'][_0xdf9f('0x2c')](_0x5a567d,_0xdf9f('0xd3'));}var _0x93480f=this;_0x4c052a[_0xdf9f('0xd4')](function(_0x565969,_0x272d67){Object['keys'](_0x565969)[_0xdf9f('0xd4')](function(_0xa60b5d){_0x93480f[_0xdf9f('0xd')][_0xdf9f('0x9e')](util[_0xdf9f('0x28')](_0xdf9f('0xd5'),_0x51939f,_0x272d67,_0xa60b5d),_0x565969[_0xa60b5d]);});});this[_0xdf9f('0xd')]['setVariable'](util[_0xdf9f('0x28')](_0xdf9f('0xd6'),_0x51939f),_0x4c052a[_0xdf9f('0x9b')]);return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xd7'),_0x51939f));};AGIVertices[_0xdf9f('0x10')]['dial']=function(_0x5eddbd){logger[_0xdf9f('0xd8')](util[_0xdf9f('0x28')](_0xdf9f('0xd9'),_0x5eddbd[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x5eddbd['sip_id'])){return this[_0xdf9f('0xd')]['error'](_0x5eddbd,_0xdf9f('0xda'));}var _0x41cb1d=this['getUser'][_0xdf9f('0x6e')](this,_0x5eddbd[_0xdf9f('0xdb')]);if(!_0x41cb1d){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x5eddbd,_0xdf9f('0xdc'));}var _0x540df2=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xdf9f('0xdd'),[util[_0xdf9f('0x28')]('SIP/%s',_0x41cb1d),_0x5eddbd['timeout'],_0x5eddbd[_0xdf9f('0xde')],_0x5eddbd['url']]);if(_0x540df2['result']===-0x1){return _0x540df2;}return this['channel']['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xdf'),'DIAL'));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xe0')]=function(_0x5d1fb6){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5d1fb6[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x5d1fb6[_0xdf9f('0x78')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xe1'));}if(!this[_0xdf9f('0xa5')](_0x5d1fb6[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')]('no\x20text\x20configured');}this[_0xdf9f('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x5d1fb6);this[_0xdf9f('0x42')](_0x5d1fb6['text'],'in','','');this['channel']['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xe2'),_0x5d1fb6[_0xdf9f('0x79')]));var _0x4eeef4=this['googleDialogflow'][_0xdf9f('0x6e')](this,_0x5d1fb6);if(_0x4eeef4){for(var _0x1fb900 in _0x4eeef4){if(_0x4eeef4[_0xdf9f('0x95')](_0x1fb900)){this[_0xdf9f('0xd')][_0xdf9f('0x9e')](util[_0xdf9f('0x28')](_0xdf9f('0xe3'),_0x1fb900[_0xdf9f('0xe4')]()),_0x4eeef4[_0x1fb900]);}}this[_0xdf9f('0x42')](_0x4eeef4[_0xdf9f('0xe5')],_0xdf9f('0xe6'),_0xdf9f('0xe0'),'');return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util['format'](_0xdf9f('0xe7'),_0x4eeef4['speech']));}return this['channel'][_0xdf9f('0x2c')](_0x5d1fb6,_0xdf9f('0xe8'));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xe9')]=function(_0x24339c){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xea'),_0x24339c[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x24339c[_0xdf9f('0xeb')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xec'));}if(!this[_0xdf9f('0xa5')](_0x24339c[_0xdf9f('0x7c')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')]('no\x20client_email\x20configured');}if(!this[_0xdf9f('0xa5')](_0x24339c['private_key'])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xed'));}if(!this[_0xdf9f('0xa5')](_0x24339c[_0xdf9f('0x7e')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xee'));}if(!this[_0xdf9f('0xa5')](_0x24339c[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}this[_0xdf9f('0xd')][_0xdf9f('0xef')]=!![];this[_0xdf9f('0x35')](_0x24339c);this[_0xdf9f('0x42')](_0x24339c[_0xdf9f('0x79')],'in','','');this['channel']['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xf0'),_0x24339c[_0xdf9f('0x79')]));var _0x5b38fb=this[_0xdf9f('0x7b')][_0xdf9f('0x6e')](this,_0x24339c);if(_0x5b38fb){for(var _0x42385d in _0x5b38fb){if(_0x5b38fb[_0xdf9f('0x95')](_0x42385d)){if(_0x42385d!=='providerResponse'){this[_0xdf9f('0xd')][_0xdf9f('0x9e')](util[_0xdf9f('0x28')](_0xdf9f('0xe3'),_0x42385d[_0xdf9f('0xe4')]()),_0x5b38fb[_0x42385d]);}}}this[_0xdf9f('0x42')](_0x5b38fb['speech'],_0xdf9f('0xe6'),_0xdf9f('0xe9'),_0x5b38fb[_0xdf9f('0xf1')]);return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xf2'),_0x5b38fb[_0xdf9f('0xe5')]));}return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x24339c,_0xdf9f('0xf3'));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xf4')]=function(_0x377658){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0xf5'),_0x377658[_0xdf9f('0x37')]));if(!this['isConfigured'](_0x377658[_0xdf9f('0xf6')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xf7'));}if(!this[_0xdf9f('0xa5')](_0x377658[_0xdf9f('0xf8')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xf9'));}if(!this[_0xdf9f('0xa5')](_0x377658[_0xdf9f('0xfa')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xfb'));}if(!this[_0xdf9f('0xa5')](_0x377658[_0xdf9f('0xfc')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xaa'));}this[_0xdf9f('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x377658);this[_0xdf9f('0x42')](_0x377658[_0xdf9f('0x79')],'in','','');this[_0xdf9f('0xd')]['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xfd'),_0x377658['text']));var _0xa6d381=this['sestekNDA']['sync'](this,_0x377658);if(_0xa6d381){for(var _0x175d41 in _0xa6d381){if(_0xa6d381[_0xdf9f('0x95')](_0x175d41)){this[_0xdf9f('0xd')][_0xdf9f('0x9e')](util['format']('SESTEK_NDA_%s',_0x175d41[_0xdf9f('0xe4')]()),_0xa6d381[_0x175d41]);}}this[_0xdf9f('0x42')](_0xa6d381[_0xdf9f('0xe5')],_0xdf9f('0xe6'),'sesteknda','');if(_0xa6d381[_0xdf9f('0xfe')]){this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0xa6d381[_0xdf9f('0xfe')]));var _0xf1fc92=this[_0xdf9f('0xd')][_0xdf9f('0xff')](_0xa6d381[_0xdf9f('0xfe')]);try{fs[_0xdf9f('0x100')](_0xa6d381[_0xdf9f('0xfe')]+_0xdf9f('0x101'));}catch(_0x152812){logger['error'](_0x152812);}return _0xf1fc92;}else{return this['channel'][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('SestekNDA\x20Result\x20%s',_0xa6d381[_0xdf9f('0xe5')]));}}return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x377658,_0xdf9f('0x102'));};AGIVertices['prototype']['end']=function(_0x1aaea6){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x103'),_0x1aaea6[_0xdf9f('0x37')]));return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0x104'));};AGIVertices[_0xdf9f('0x10')]['ext_dial']=function(_0x49dbb1){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x105'),_0x49dbb1[_0xdf9f('0x37')]));var _0x2052c4='';if(_0x49dbb1['trunk_id']){if(!this[_0xdf9f('0xa5')](_0x49dbb1[_0xdf9f('0x106')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x49dbb1,'no\x20trunk\x20selected');}else{var _0x304c92=parseInt(_0x49dbb1[_0xdf9f('0x106')],0xa);if(isNaN(_0x304c92)){_0x2052c4=_0x49dbb1[_0xdf9f('0x106')];}else{_0x2052c4=this[_0xdf9f('0x107')][_0xdf9f('0x6e')](this,_0x49dbb1['trunk_id']);if(!_0x2052c4){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x49dbb1,_0xdf9f('0x108'));}}}}else if(_0x49dbb1[_0xdf9f('0x109')]){_0x2052c4=_0x49dbb1[_0xdf9f('0x109')];}else{return this[_0xdf9f('0xd')]['error'](_0x49dbb1,_0xdf9f('0x10a'));}var _0x2474c7=this[_0xdf9f('0xd')][_0xdf9f('0x57')]('DIAL',[util[_0xdf9f('0x28')](_0xdf9f('0x10b'),_0x2052c4,_0x49dbb1['phone']),_0x49dbb1['timeout'],_0x49dbb1[_0xdf9f('0xde')],_0x49dbb1[_0xdf9f('0x63')]]);if(_0x2474c7[_0xdf9f('0xa3')]===-0x1){return _0x2474c7;}return this[_0xdf9f('0xd')]['noop'](util[_0xdf9f('0x28')](_0xdf9f('0xdf'),_0xdf9f('0xdd')));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x10c')]=function(_0x403e58){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0x10d'),_0x403e58[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')]['noop']('finally');};AGIVertices['prototype'][_0xdf9f('0xb')]=function(_0x30c321){logger['info'](util[_0xdf9f('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x30c321[_0xdf9f('0x37')]));if(_0x30c321[_0xdf9f('0xa7')]===0x0){return this[_0xdf9f('0xa6')](_0x30c321);}_0x30c321[_0xdf9f('0xa7')]-=0x1;if(!this[_0xdf9f('0xa5')](_0x30c321[_0xdf9f('0x10e')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x30c321,_0xdf9f('0x10f'));}var _0x570343=this['getSound']['sync'](this,_0x30c321[_0xdf9f('0x10e')]);if(!_0x570343){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x30c321,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x30c321[_0xdf9f('0xd1')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0xdf9f('0xd2'));}var _0x51ae43=this[_0xdf9f('0xd')][_0xdf9f('0x110')](_0x570343,_0x30c321[_0xdf9f('0x111')],_0x30c321['maxdigit']);var _0x4cb6ef=_0x51ae43[_0xdf9f('0xa3')]?_0x51ae43[_0xdf9f('0xa3')][_0xdf9f('0x4b')]():'';logger[_0xdf9f('0x2d')](_0xdf9f('0x112'),JSON['stringify'](_0x51ae43));if(_0x51ae43[_0xdf9f('0xa3')]===-0x1){this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x30c321,_0x4cb6ef);return _0x51ae43;}else if(_0x51ae43[_0xdf9f('0xa1')]===_0xdf9f('0x66')){_0x51ae43[_0xdf9f('0xa3')]=_0x4cb6ef['length']>=parseInt(_0x30c321[_0xdf9f('0x113')])?'x':'i';}else{_0x51ae43['result']=_0x4cb6ef[_0xdf9f('0x9b')]>=parseInt(_0x30c321[_0xdf9f('0x113')])&&_0x4cb6ef['length']<=parseInt(_0x30c321[_0xdf9f('0x114')])?'x':'i';}var _0x29e5c2=this[_0xdf9f('0x11')][_0xdf9f('0x6e')](this,_0x30c321[_0xdf9f('0xd1')]);if(!_0x29e5c2){return this['channel'][_0xdf9f('0x2c')](_0x30c321,_0xdf9f('0xd3'));}this['channel'][_0xdf9f('0x9e')](_0x29e5c2,_0x4cb6ef);if(this[_0xdf9f('0xa5')](_0x30c321[_0xdf9f('0x115')])){var _0x129efa=parseInt(_0x30c321[_0xdf9f('0x115')],0xa);var _0x3a6293=rs[_0xdf9f('0x116')]({'charset':'*','length':_0x129efa});var _0x1d7bb3=_0x4cb6ef['length'];if(_0x1d7bb3>0x0){if(_0x1d7bb3>_0x129efa){this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x30c321,_0x30c321[_0xdf9f('0x117')]===_0xdf9f('0x118')?_0x3a6293+_0x4cb6ef[_0xdf9f('0x119')](_0x129efa):_0x4cb6ef[_0xdf9f('0x119')](0x0,_0x1d7bb3-_0x129efa)+_0x3a6293);}else{this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x30c321,rs[_0xdf9f('0x116')]({'charset':'*','length':_0x1d7bb3}));}}else{this[_0xdf9f('0x35')]['sync'](this,_0x30c321,'');}}else{this[_0xdf9f('0x35')]['sync'](this,_0x30c321,_0x4cb6ef);}return _0x51ae43;};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xc')]=function(_0x439c86){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x11a'),_0x439c86[_0xdf9f('0x37')]));return this[_0xdf9f('0xb')](_0x439c86);};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x11b')]=function(_0x385051){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x11c'),_0x385051[_0xdf9f('0x37')]));this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x385051,_0x385051[_0xdf9f('0x11d')]);return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('GOAL\x20%s',_0x385051['goalname']));};AGIVertices['prototype'][_0xdf9f('0x11e')]=function(_0x42d1e3){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x11f'),_0x42d1e3['label']));if(!this[_0xdf9f('0xa5')](_0x42d1e3['aws_access_key_id'])||!this['isConfigured'](_0x42d1e3[_0xdf9f('0x84')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0x120'));}if(!this['isConfigured'](_0x42d1e3[_0xdf9f('0x79')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x121'),_0x42d1e3[_0xdf9f('0x79')]));var _0x3f5533=this['awsPolly'][_0xdf9f('0x6e')](this,_0x42d1e3);if(_0x3f5533){this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x122'),_0x3f5533));var _0x451302=this[_0xdf9f('0xd')]['streamFile'](_0x3f5533);try{fs[_0xdf9f('0x100')](_0x3f5533+'.wav');}catch(_0x59b7e3){logger[_0xdf9f('0x2c')](_0x59b7e3);}return _0x451302;}return this[_0xdf9f('0xd')]['error'](_0x42d1e3,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x123')]=function(_0x5aa7fd){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5aa7fd[_0xdf9f('0x37')]));if(!this['isConfigured'](_0x5aa7fd[_0xdf9f('0x8a')])||!this[_0xdf9f('0xa5')](_0x5aa7fd[_0xdf9f('0x84')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0x120'));}if(!this[_0xdf9f('0xa5')](_0x5aa7fd[_0xdf9f('0x8c')])){return this['channel']['noop'](_0xdf9f('0x124'));}if(!this['isConfigured'](_0x5aa7fd[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}this[_0xdf9f('0xd')][_0xdf9f('0xef')]=!![];this[_0xdf9f('0x35')](_0x5aa7fd);this[_0xdf9f('0x42')](_0x5aa7fd[_0xdf9f('0x79')],'in','','');this['channel'][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x125'),_0x5aa7fd[_0xdf9f('0x79')]));var _0x4c521a=this[_0xdf9f('0x89')][_0xdf9f('0x6e')](this,_0x5aa7fd);if(_0x4c521a){for(var _0x9e8f8a in _0x4c521a){if(_0x4c521a[_0xdf9f('0x95')](_0x9e8f8a)&&_[_0xdf9f('0x126')](_0x4c521a[_0x9e8f8a])){this[_0xdf9f('0xd')]['setVariable'](util['format']('AWS_LEX_%s',_0x9e8f8a[_0xdf9f('0xe4')]()),_0x4c521a[_0x9e8f8a]);}}if(_[_0xdf9f('0x45')](_0x4c521a[_0xdf9f('0x127')])){return this[_0xdf9f('0xd')]['noop'](_0xdf9f('0x128'));}else{this[_0xdf9f('0x42')](_0x4c521a['message'],'out',_0xdf9f('0x129'),'');return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x4c521a['message']));}}return this['channel'][_0xdf9f('0x2c')](_0x5aa7fd,_0xdf9f('0x12a'));};AGIVertices['prototype'][_0xdf9f('0x12b')]=function(_0x4c1b20){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x12c'),_0x4c1b20[_0xdf9f('0x37')],_0x4c1b20[_0xdf9f('0x66')]));if(!this['isConfigured'](_0x4c1b20[_0xdf9f('0x78')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0xe1'));}var _0x2abf76=_0xdf9f('0x12d');var _0x57485b=util[_0xdf9f('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xdf9f('0x116')](0x4));var _0x50e450=util[_0xdf9f('0x28')](_0xdf9f('0x9d'),_0x57485b,_0x2abf76);var _0x1a2682=!![];if(_0x4c1b20['beep']===_0xdf9f('0x12e')){_0x1a2682=![];}var _0x3358af=this[_0xdf9f('0xd')][_0xdf9f('0x12f')](_0x57485b,_0x2abf76,_0x4c1b20[_0xdf9f('0x130')],_0x4c1b20[_0xdf9f('0x66')],undefined,_0x1a2682);if(_0x3358af[_0xdf9f('0xa3')]!==-0x1){this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x131'),_0x50e450));var _0xfcbce6=this[_0xdf9f('0x8d')]['sync'](this,_0x4c1b20,_0x50e450);if(_0xfcbce6){for(var _0x429169 in _0xfcbce6){if(_0xfcbce6[_0xdf9f('0x95')](_0x429169)){this['channel']['setVariable'](util['format'](_0xdf9f('0x132'),_0x429169[_0xdf9f('0xe4')]()),_0xfcbce6[_0x429169]);}}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x133'),JSON[_0xdf9f('0x71')](_0xfcbce6)));}}return _0x3358af;};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x134')]=function(_0x47ac71){logger[_0xdf9f('0x2d')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x47ac71[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x47ac71[_0xdf9f('0x90')])){return this[_0xdf9f('0xd')]['noop']('no\x20appid\x20configured');}if(!this[_0xdf9f('0xa5')](_0x47ac71['appsecret'])){return this['channel']['noop'](_0xdf9f('0x135'));}var _0x3b7c22=_0xdf9f('0x12d');var _0x2e7caa=util[_0xdf9f('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xdf9f('0x116')](0x4));var _0x5e9ff3=util[_0xdf9f('0x28')](_0xdf9f('0x9d'),_0x2e7caa,_0x3b7c22);var _0x41f0f6=!![];if(_0x47ac71[_0xdf9f('0x136')]===_0xdf9f('0x12e')){_0x41f0f6=![];}var _0x426176=this[_0xdf9f('0xd')][_0xdf9f('0x12f')](_0x2e7caa,_0x3b7c22,_0x47ac71[_0xdf9f('0x130')],_0x47ac71[_0xdf9f('0x66')],undefined,_0x41f0f6);if(_0x426176[_0xdf9f('0xa3')]!==-0x1){this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util['format'](_0xdf9f('0x137'),_0x5e9ff3));var _0x380fe4=this[_0xdf9f('0x8f')]['sync'](this,_0x47ac71,_0x5e9ff3);if(_0x380fe4){for(var _0x1d46e0 in _0x380fe4){if(_0x380fe4['hasOwnProperty'](_0x1d46e0)){this[_0xdf9f('0xd')][_0xdf9f('0x9e')](util[_0xdf9f('0x28')]('TILDE_ASR_%s',_0x1d46e0[_0xdf9f('0xe4')]()),_0x380fe4[_0x1d46e0]);}}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x138'),JSON['stringify'](_0x380fe4)));}}return _0x426176;};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x139')]=function(_0x110d68){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x13a'),_0x110d68[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0x13b')](_0x110d68[_0xdf9f('0x3d')],_0x110d68[_0xdf9f('0x3e')],_0x110d68[_0xdf9f('0x3f')]);};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x13c')]=function(_0x110423){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x13d'),_0x110423[_0xdf9f('0x37')]));if(!this['isConfigured'](_0x110423['condition'])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x110423,_0xdf9f('0x13e'));}try{var _0x19aa57=eval(_0x110423[_0xdf9f('0x13f')])?'true':_0xdf9f('0x140');this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x141'),_0x110423[_0xdf9f('0x13f')],_0x19aa57));return{'code':0xc8,'result':_0x19aa57};}catch(_0x129ac4){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x142')]=function(_0x388c70){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x143'),_0x388c70[_0xdf9f('0x37')]));if(!this['isConfigured'](_0x388c70['interval_id'])){return this['channel'][_0xdf9f('0x2c')](_0x388c70,_0xdf9f('0x144'));}var _0x41c855=this['getIntervals'][_0xdf9f('0x6e')](this,_0x388c70[_0xdf9f('0x145')]);if(!_0x41c855){return this[_0xdf9f('0xd')]['error'](_0x388c70,_0xdf9f('0x146'));}for(var _0x4e9ee1=0x0;_0x4e9ee1<_0x41c855[_0xdf9f('0x9b')];_0x4e9ee1+=0x1){var _0x214484=this[_0xdf9f('0xd')]['getVariable'](util[_0xdf9f('0x28')]('IFTIME(%s?true:false)',_0x41c855[_0x4e9ee1]));if(_0x214484['result']===-0x1){return _0x214484;}logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x147'),_0x41c855[_0x4e9ee1],_0x214484[_0xdf9f('0xa1')]));if(_0x214484[_0xdf9f('0xa1')]===_0xdf9f('0x148')){logger[_0xdf9f('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x41c855[_0x4e9ee1],'true'));this['channel'][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x147'),_0x41c855[_0x4e9ee1],_0xdf9f('0x148')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0x147'),_0x41c855[_0x4e9ee1],'false'));this['channel']['noop'](util[_0xdf9f('0x28')](_0xdf9f('0x147'),_0x41c855[_0x4e9ee1],_0xdf9f('0x140')));}}return{'code':0xc8,'result':_0xdf9f('0x140')};};AGIVertices['prototype']['hangup']=function(_0x57d6b4){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x149'),_0x57d6b4[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0x14a')]();};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x14b')]=function(_0x507fb8){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0x14c'),_0x507fb8[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x507fb8[_0xdf9f('0x78')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0xe1'));}var _0xbeba69=_0xdf9f('0x12d');var _0x391dac=util[_0xdf9f('0x28')](_0xdf9f('0x14d'),FILES_PATH,rs[_0xdf9f('0x116')](0x4));var _0x3e75e8=util['format'](_0xdf9f('0x9d'),_0x391dac,_0xbeba69);var _0x5a56c7=!![];if(_0x507fb8['beep']===_0xdf9f('0x12e')){_0x5a56c7=![];}var _0x402da3=this[_0xdf9f('0xd')][_0xdf9f('0x12f')](_0x391dac,_0xbeba69,_0x507fb8[_0xdf9f('0x130')],_0x507fb8[_0xdf9f('0x66')],undefined,_0x5a56c7);if(_0x402da3[_0xdf9f('0xa3')]!==-0x1){this['channel'][_0xdf9f('0xa9')](util['format'](_0xdf9f('0x14e'),_0x3e75e8));var _0x24497d=this[_0xdf9f('0x81')]['sync'](this,_0x507fb8,_0x3e75e8);if(_0x24497d){for(var _0x238fea in _0x24497d){if(_0x24497d[_0xdf9f('0x95')](_0x238fea)){this[_0xdf9f('0xd')]['setVariable'](util['format'](_0xdf9f('0x14f'),_0x238fea[_0xdf9f('0xe4')]()),_0x24497d[_0x238fea]);}}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x150'),JSON[_0xdf9f('0x71')](_0x24497d)));}}return _0x402da3;};AGIVertices[_0xdf9f('0x10')]['ispeechtts']=function(_0x1f80fc){logger['info'](util[_0xdf9f('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1f80fc[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x1f80fc[_0xdf9f('0x78')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xe1'));}if(!this[_0xdf9f('0xa5')](_0x1f80fc[_0xdf9f('0x79')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}this[_0xdf9f('0xd')]['noop'](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x1f80fc[_0xdf9f('0x79')]));var _0x5ecc90=this[_0xdf9f('0x151')][_0xdf9f('0x6e')](this,_0x1f80fc);if(_0x5ecc90){this[_0xdf9f('0xd')]['noop'](util[_0xdf9f('0x28')](_0xdf9f('0x14e'),_0x5ecc90));var _0x421347=this[_0xdf9f('0xd')]['streamFile'](_0x5ecc90,_0x1f80fc[_0xdf9f('0x130')]);try{fs[_0xdf9f('0x100')](_0x5ecc90+_0xdf9f('0x101'));}catch(_0x135317){logger[_0xdf9f('0x2c')](_0x135317);}return _0x421347;}return this['channel'][_0xdf9f('0x2c')](_0x1f80fc,_0xdf9f('0x152'));};AGIVertices['prototype'][_0xdf9f('0x153')]=function(_0x461590){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0x154'),_0x461590['label']));if(!this[_0xdf9f('0xa5')](_0x461590[_0xdf9f('0x155')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x461590,_0xdf9f('0x156'));}logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x157'),this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x461590['findBy']));var _0x5d78da=this[_0xdf9f('0x52')][_0xdf9f('0x6e')](this,_0x461590[_0xdf9f('0x155')]);if(_0x5d78da){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x158'),this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x461590[_0xdf9f('0x155')]));this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xdf9f('0x3a')],_0x461590[_0xdf9f('0x155')]));return{'code':0xc8,'result':_0xdf9f('0x159')};}else{logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x15a'),this['channel'][_0xdf9f('0x3a')],_0x461590[_0xdf9f('0x155')]));this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x15a'),this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x461590['findBy']));return{'code':0xc8,'result':_0xdf9f('0x15b')};}};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x15c')]=function(_0x5e9ceb){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5e9ceb[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x5e9ceb[_0xdf9f('0x155')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x5e9ceb,_0xdf9f('0x156'));}logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x157'),this[_0xdf9f('0xd')]['callerid'],_0x5e9ceb[_0xdf9f('0x155')]));var _0x192023=this[_0xdf9f('0x51')][_0xdf9f('0x6e')](this,_0x5e9ceb[_0xdf9f('0x155')]);if(_0x192023){logger['info'](util['format'](_0xdf9f('0x158'),this['channel']['callerid'],_0x5e9ceb[_0xdf9f('0x155')]));this[_0xdf9f('0xd')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xdf9f('0x3a')],_0x5e9ceb[_0xdf9f('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x15a'),this['channel']['callerid'],_0x5e9ceb['findBy']));this['channel']['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xdf9f('0x3a')],_0x5e9ceb[_0xdf9f('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x15d')]=function(_0x5119a6){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x15e'),_0x5119a6[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x5119a6[_0xdf9f('0x15f')])){return this['channel'][_0xdf9f('0x2c')](_0x5119a6,'no\x20operation\x20configured');}this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x160'),_0x5119a6[_0xdf9f('0x15f')]));var _0x4e0c0f=eval(_0x5119a6['operation']);if(!this[_0xdf9f('0xa5')](_0x5119a6[_0xdf9f('0xd1')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xd2'));}var _0x1c48fb=this['getVariable'][_0xdf9f('0x6e')](this,_0x5119a6[_0xdf9f('0xd1')]);if(!_0x1c48fb){return this['channel']['error'](_0x5119a6,'no\x20variable\x20found');}if(_[_0xdf9f('0x9a')](_0x4e0c0f)){var _0x500489=this;_0x4e0c0f['forEach'](function(_0x1df9fb,_0x28a4c2){_0x500489[_0xdf9f('0xd')][_0xdf9f('0x9e')](util['format'](_0xdf9f('0x161'),_0x1c48fb,_0x28a4c2),_0x1df9fb);});return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x162'),_0x1c48fb));}else{return this['channel'][_0xdf9f('0x9e')](_0x1c48fb,_0x4e0c0f);}};AGIVertices['prototype'][_0xdf9f('0x163')]=function(_0x15ce93){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x164'),_0x15ce93[_0xdf9f('0x37')]));if(_0x15ce93[_0xdf9f('0xa7')]===0x0){return this[_0xdf9f('0xa6')](_0x15ce93);}_0x15ce93[_0xdf9f('0xa7')]-=0x1;if(!this[_0xdf9f('0xa5')](_0x15ce93[_0xdf9f('0x10e')])){return this[_0xdf9f('0xd')]['error'](_0x15ce93,_0xdf9f('0x10f'));}var _0x40ac2e=this[_0xdf9f('0x1d')][_0xdf9f('0x6e')](this,_0x15ce93[_0xdf9f('0x10e')]);if(!_0x40ac2e){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x15ce93,_0xdf9f('0x165'));}var _0x38b8a8=this[_0xdf9f('0xd')][_0xdf9f('0x110')](_0x40ac2e,_0x15ce93[_0xdf9f('0x111')],_0x15ce93[_0xdf9f('0x166')]);var _0xa5b2d3=_0x38b8a8['result'];if(_0x38b8a8[_0xdf9f('0xa3')]===-0x1){this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x15ce93,'-1');return _0x38b8a8;}else if(_0x38b8a8['extra']===_0xdf9f('0x66')){_0x38b8a8['result']=_0x38b8a8[_0xdf9f('0xa3')]['length']>0x0?_0x38b8a8[_0xdf9f('0xa3')]:'t';}else if(_[_0xdf9f('0x44')](_0x38b8a8[_0xdf9f('0xa3')])){_0x38b8a8['result']='#';_0xa5b2d3='#';}if(!this['isConfigured'](_0x15ce93[_0xdf9f('0xd1')])){this[_0xdf9f('0xd')]['noop'](_0xdf9f('0xd2'));}else{var _0x3752d7=this[_0xdf9f('0x11')][_0xdf9f('0x6e')](this,_0x15ce93[_0xdf9f('0xd1')]);if(!_0x3752d7){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x15ce93,_0xdf9f('0xd3'));}this[_0xdf9f('0xd')]['setVariable'](_0x3752d7,_0xa5b2d3);}this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x15ce93,_0xa5b2d3);return _0x38b8a8;};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0xa9')]=function(_0x388ca3){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x167'),_0x388ca3[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0x388ca3[_0xdf9f('0x168')]||_0x388ca3[_0xdf9f('0x37')]);};AGIVertices['prototype'][_0xdf9f('0x169')]=function(_0x487820){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x16a'),_0x487820['label']));if(!this[_0xdf9f('0xa5')](_0x487820['findBy'])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x487820,'no\x20find\x20by\x20configured');}logger[_0xdf9f('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x487820['findBy']));var _0x287b59=this[_0xdf9f('0x16b')][_0xdf9f('0x6e')](this,_0x487820['pause_id']);var _0x5aa982=this[_0xdf9f('0x4e')][_0xdf9f('0x6e')](this,_0x487820['findBy'],_0x287b59);if(_0x5aa982){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x158'),this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x487820[_0xdf9f('0x155')]));this['channel'][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x158'),this['channel'][_0xdf9f('0x3a')],_0x487820[_0xdf9f('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x15a'),this['channel'][_0xdf9f('0x3a')],_0x487820[_0xdf9f('0x155')]));this[_0xdf9f('0xd')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x487820[_0xdf9f('0x155')]));return{'code':0xc8,'result':_0xdf9f('0x15b')};}};AGIVertices[_0xdf9f('0x10')]['playback']=function(_0xec5c02){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x16c'),_0xec5c02[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0xec5c02['file_id'])){return this[_0xdf9f('0xd')]['error'](_0xec5c02,'no\x20file\x20audio\x20selected');}var _0x3a8fd4=this['getSound'][_0xdf9f('0x6e')](this,_0xec5c02[_0xdf9f('0x10e')]);if(!_0x3a8fd4){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0xec5c02,'no\x20file\x20audio\x20found');}var _0x43e560=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xdf9f('0x16d'),[_0x3a8fd4,_0xec5c02[_0xdf9f('0xde')]]);if(_0x43e560[_0xdf9f('0xa3')]===-0x1){return _0x43e560;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xc2'),_0xdf9f('0x16d'),_0x3a8fd4));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x16e')]=function(_0x15e81e){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x16f'),_0x15e81e['label']));if(!this['isConfigured'](_0x15e81e[_0xdf9f('0x170')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x15e81e,'no\x20queue\x20selected');}var _0x914803='';var _0x26fb70=parseInt(_0x15e81e['queue_id'],0xa);if(isNaN(_0x26fb70)){_0x914803=_0x15e81e[_0xdf9f('0x170')];}else{_0x914803=this[_0xdf9f('0x15')][_0xdf9f('0x6e')](this,_0x15e81e[_0xdf9f('0x170')]);if(!_0x914803){return this['channel']['error'](_0x15e81e,_0xdf9f('0x171'));}}var _0x44e6c='';if(this[_0xdf9f('0xa5')](_0x15e81e['file_id'])){var _0x3d7597=this[_0xdf9f('0x1d')]['sync'](this,_0x15e81e['file_id']);if(_0x3d7597){_0x44e6c=_0x3d7597;}}this['createSquareDetailsReport'][_0xdf9f('0x6e')](this,_0x15e81e,_0x914803);if(_0x15e81e['opts']['indexOf']('x')<0x0){_0x15e81e[_0xdf9f('0xde')]+='x';}if(_0x15e81e['opts']['indexOf']('X')<0x0){_0x15e81e['opts']+='X';}this[_0xdf9f('0xd')][_0xdf9f('0x9e')](_0xdf9f('0x172'),_0x914803?_0x914803[_0xdf9f('0x173')]():'');var _0x4bb3cd=this[_0xdf9f('0xd')][_0xdf9f('0x57')]('QUEUE',[_0x914803,_0x15e81e['opts'],_0x15e81e[_0xdf9f('0x63')],_0x44e6c,_0x15e81e[_0xdf9f('0x66')],_0x15e81e['agi'],_0x15e81e[_0xdf9f('0x174')],_0x15e81e[_0xdf9f('0x175')],'',_0x15e81e[_0xdf9f('0x176')]]);if(_0x4bb3cd['result']===-0x1){return _0x4bb3cd;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xc2'),_0xdf9f('0x177'),_0x914803));};AGIVertices['prototype']['record']=function(_0x240ce0){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x178'),_0x240ce0[_0xdf9f('0x37')]));var _0x180ca4=_0x240ce0[_0xdf9f('0x179')]||_0xdf9f('0x12d');var _0x34e9fa=util['format'](_0xdf9f('0x17a'),this[_0xdf9f('0xd')][_0xdf9f('0x36')],rs['generate'](0x5));var _0x13f5e3=util['format'](_0xdf9f('0x17b'),FILES_PATH,_0x34e9fa,_0x180ca4);var _0x1a5f0f=util[_0xdf9f('0x28')](_0xdf9f('0x14d'),FILES_PATH,_0x34e9fa);this['createSquareRecording'][_0xdf9f('0x6e')](this,_0x240ce0,_0x34e9fa,_0x13f5e3);this[_0xdf9f('0xd')][_0xdf9f('0x9e')](_0xdf9f('0x17c'),_0x34e9fa);logger[_0xdf9f('0x2d')](_0xdf9f('0x17d'),_0x1a5f0f,_0x180ca4,_0x240ce0['escape_digits'],_0x240ce0[_0xdf9f('0x66')]);return this[_0xdf9f('0xd')][_0xdf9f('0x12f')](_0x1a5f0f,_0x180ca4,_0x240ce0['escape_digits'],_0x240ce0[_0xdf9f('0x66')],undefined,!![]);};AGIVertices['prototype'][_0xdf9f('0x17e')]=function(_0x3b96f7){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x17f'),_0x3b96f7[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x3b96f7['url'])){return this[_0xdf9f('0xd')]['noop']('no\x20url\x20configured');}var _0x416245=this[_0xdf9f('0x62')][_0xdf9f('0x6e')](this,_0x3b96f7);logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x180'),util['inspect'](_0x416245,{'showHidden':![],'depth':null})));if(!this[_0xdf9f('0xa5')](_0x3b96f7['variable_id'])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x235df1=this['getVariable'][_0xdf9f('0x6e')](this,_0x3b96f7[_0xdf9f('0xd1')]);if(!_0x235df1){return this[_0xdf9f('0xd')]['error'](_0x3b96f7,_0xdf9f('0xd3'));}this[_0xdf9f('0xd')][_0xdf9f('0x9e')](util[_0xdf9f('0x28')](_0xdf9f('0x181'),_0x235df1),_0x416245[_0xdf9f('0x73')]?_0x416245['statusCode']:_0xdf9f('0x182'));this['channel']['setVariable'](util[_0xdf9f('0x28')](_0xdf9f('0x183'),_0x235df1),_0x416245[_0xdf9f('0x74')]?_0x416245[_0xdf9f('0x74')]:'OK');if(_0x416245[_0xdf9f('0x72')]){try{this[_0xdf9f('0x9c')](_0x416245[_0xdf9f('0x72')],_0x235df1);}catch(_0x2357b8){logger[_0xdf9f('0x2c')](util[_0xdf9f('0x28')](_0xdf9f('0x184'),_0x235df1));}}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xd7'),_0x235df1));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x185')]=function(_0x1856fa){logger['info'](util['format'](_0xdf9f('0x186'),_0x1856fa[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0x187')](_0x1856fa[_0xdf9f('0x188')][_0xdf9f('0xd0')](/\s+/g,''),_0x1856fa[_0xdf9f('0x189')]);};AGIVertices['prototype'][_0xdf9f('0x18a')]=function(_0x112e57){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x18b'),_0x112e57[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0x18c')](_0x112e57[_0xdf9f('0x65')][_0xdf9f('0xd0')](/\s+/g,''),_0x112e57['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x165e5c){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0x18d'),_0x165e5c['label']));return this[_0xdf9f('0xd')][_0xdf9f('0x18e')](_0x165e5c['text'],_0x165e5c['escape_digits']);};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x18f')]=function(_0x11384a){logger['info'](util[_0xdf9f('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x11384a['label']));if(!this[_0xdf9f('0xa5')](_0x11384a['account_id'])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0x190'));}var _0x165123=this['getMailAccount'][_0xdf9f('0x6e')](this,_0x11384a[_0xdf9f('0x191')]);if(!_0x165123||!_0x165123[_0xdf9f('0x192')]){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x11384a,_0xdf9f('0x193'));}var _0x40cbfc={'from':util['format'](_0xdf9f('0x194'),_0x165123[_0xdf9f('0x13')],_0x165123['email']||_0x165123[_0xdf9f('0x192')][_0xdf9f('0x195')]),'to':_0x11384a['to']||'','cc':_0x11384a['cc']||'','bcc':_0x11384a[_0xdf9f('0x196')]||'','subject':_0x11384a[_0xdf9f('0x197')],'html':_0x11384a[_0xdf9f('0x79')],'text':_0x11384a['text']};var _0x469603={'tls':{'rejectUnauthorized':![]}};if(_0x165123[_0xdf9f('0x192')]['service']){_0x469603[_0xdf9f('0x198')]=_0x165123[_0xdf9f('0x192')]['service'];}else{_0x469603[_0xdf9f('0x199')]=_0x165123['Smtp']['host'];_0x469603[_0xdf9f('0x19a')]=_0x165123[_0xdf9f('0x192')][_0xdf9f('0x19a')];_0x469603['secure']=_0x165123[_0xdf9f('0x192')][_0xdf9f('0x19b')];}if(_0x165123[_0xdf9f('0x192')][_0xdf9f('0x19c')]){_0x469603[_0xdf9f('0x19d')]={'user':_0x165123[_0xdf9f('0x192')][_0xdf9f('0x195')],'pass':_0x165123['Smtp'][_0xdf9f('0x19e')]};}if(this['isConfigured'](_0x11384a[_0xdf9f('0x19f')])){}logger[_0xdf9f('0xd8')]('sendMail\x20message',JSON['stringify'](_0x40cbfc));this[_0xdf9f('0x35')][_0xdf9f('0x6e')](this,_0x11384a,_0x11384a[_0xdf9f('0x191')]);this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x1a0'),_0x165123[_0xdf9f('0x13')]));this[_0xdf9f('0x22')]['sync'](this,_0x469603,_0x40cbfc);return this[_0xdf9f('0xd')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1a1')]=function(_0x1c7362){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x1a2'),_0x1c7362[_0xdf9f('0x37')]));return this[_0xdf9f('0xd')][_0xdf9f('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1a3')]=function(_0xfe2576){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x1a4'),_0xfe2576[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0xfe2576[_0xdf9f('0x1a5')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0x1a6'));}var _0x2d66ef=this[_0xdf9f('0x33')][_0xdf9f('0x6e')](this,_0xfe2576[_0xdf9f('0x1a5')]);if(!_0x2d66ef){return this['channel'][_0xdf9f('0x2c')](_0xfe2576,_0xdf9f('0x1a7'));}var _0x2cb0c2={'body':_0xfe2576[_0xdf9f('0x1a8')],'phone':_0xfe2576['to']||'','SmsAccountId':_0x2d66ef['id']};logger[_0xdf9f('0xd8')](_0xdf9f('0x1a9'),JSON[_0xdf9f('0x71')](_0x2cb0c2));this['createSquareDetailsReport'][_0xdf9f('0x6e')](this,_0xfe2576,_0xfe2576[_0xdf9f('0x1a5')]);this['channel'][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x1aa'),_0x2d66ef[_0xdf9f('0x13')]));this[_0xdf9f('0x34')]['sync'](this,_0x2cb0c2);return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0x1ab'));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1ac')]=function(_0x26e50c){logger['info'](util[_0xdf9f('0x28')](_0xdf9f('0x1ad'),_0x26e50c[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x26e50c[_0xdf9f('0xd1')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x26e50c,_0xdf9f('0x1ae'));}var _0x245055=this[_0xdf9f('0x11')][_0xdf9f('0x6e')](this,_0x26e50c[_0xdf9f('0xd1')]);if(!_0x245055){return this['channel'][_0xdf9f('0x2c')](_0x26e50c,_0xdf9f('0xd3'));}return this[_0xdf9f('0xd')][_0xdf9f('0x9e')](_0x245055,_0x26e50c[_0xdf9f('0x1af')]);};AGIVertices[_0xdf9f('0x10')]['start']=function(_0xb75a34){logger['info'](util['format'](_0xdf9f('0x1b0'),_0xb75a34[_0xdf9f('0x37')]));this['channel'][_0xdf9f('0xa9')](_0xdf9f('0x1b1'));if(_0xb75a34['answer']===_0xdf9f('0x1b2')){this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0x1b3'));return this[_0xdf9f('0xd')][_0xdf9f('0xb8')]();}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')]('Skipped\x20Answer');};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1b4')]=function(_0x49573a){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x49573a[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x49573a[_0xdf9f('0x1b5')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x49573a,_0xdf9f('0x1b6'));}var _0x63e7d6=this[_0xdf9f('0x17')][_0xdf9f('0x6e')](this,_0x49573a[_0xdf9f('0x1b5')]);if(!this['isConfigured'](_0x63e7d6)){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x49573a,util[_0xdf9f('0x28')](_0xdf9f('0x1b7'),_0x49573a[_0xdf9f('0x1b5')]));}if(_0x63e7d6===this[_0xdf9f('0xd')][_0xdf9f('0x39')]){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x49573a,_0xdf9f('0x1b8'));}this['createSquareDetailsReport'][_0xdf9f('0x6e')](this,_0x49573a,_0x63e7d6);var _0x79660a=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xdf9f('0x1b9'),util[_0xdf9f('0x28')](_0xdf9f('0x1ba'),config[_0xdf9f('0x7')][_0xdf9f('0x199')]||_0xdf9f('0x1bb'),_0x63e7d6,this[_0xdf9f('0xd')][_0xdf9f('0x39')]));if(_0x79660a[_0xdf9f('0xa3')]===-0x1){return _0x79660a;}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0xc2'),_0xdf9f('0x1b9'),_0x63e7d6));};AGIVertices[_0xdf9f('0x10')]['system']=function(_0x55a518){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x1bc'),_0x55a518[_0xdf9f('0x37')]));var _0x40ff62=this[_0xdf9f('0x56')]['sync'](this,_0x55a518[_0xdf9f('0xb6')]);this[_0xdf9f('0x35')]['sync'](this,_0x55a518,_0x55a518['command']);if(this[_0xdf9f('0xa5')](_0x55a518[_0xdf9f('0xd1')])){var _0xefb7e5=this[_0xdf9f('0x11')][_0xdf9f('0x6e')](this,_0x55a518[_0xdf9f('0xd1')]);if(_0xefb7e5){this[_0xdf9f('0xd')]['setVariable'](_0xefb7e5,_0x40ff62);return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x1bd'),_0x55a518[_0xdf9f('0xb6')],_0xefb7e5));}}return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x1be'),_0x55a518[_0xdf9f('0xb6')]));};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1bf')]=function(_0x151761){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x1c0'),_0x151761[_0xdf9f('0x37')]));_0x151761[_0xdf9f('0x79')]=_0x151761[_0xdf9f('0x79')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdf9f('0xa5')](_0x151761[_0xdf9f('0x5a')])){return this['channel'][_0xdf9f('0xa9')](_0xdf9f('0x1c1'));}if(!this[_0xdf9f('0xa5')](_0x151761[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x1c2'),_0x151761[_0xdf9f('0x79')]));var _0x43c8bf=this[_0xdf9f('0x59')][_0xdf9f('0x6e')](this,_0x151761);if(_0x43c8bf){this[_0xdf9f('0xd')]['noop'](util[_0xdf9f('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x43c8bf));var _0xfee810=this[_0xdf9f('0xd')][_0xdf9f('0xff')](_0x43c8bf);try{fs[_0xdf9f('0x100')](_0x43c8bf+'.wav');}catch(_0x1d92bf){logger[_0xdf9f('0x2c')](_0x1d92bf);}return _0xfee810;}return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x151761,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xdf9f('0x10')][_0xdf9f('0x1c3')]=function(_0x5b34e7){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x1c4'),_0x5b34e7[_0xdf9f('0x37')]));_0x5b34e7['text']=_0x5b34e7['text'][_0xdf9f('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdf9f('0xa5')](_0x5b34e7[_0xdf9f('0x79')])){return this[_0xdf9f('0xd')][_0xdf9f('0xa9')](_0xdf9f('0xaa'));}this['channel'][_0xdf9f('0xa9')](util[_0xdf9f('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x5b34e7[_0xdf9f('0x79')]));var _0x37e347=this[_0xdf9f('0x61')][_0xdf9f('0x6e')](this,_0x5b34e7);if(_0x37e347){this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x1c5'),_0x37e347));var _0x5c981c=this[_0xdf9f('0xd')][_0xdf9f('0xff')](_0x37e347);try{fs[_0xdf9f('0x100')](_0x37e347+'.wav');}catch(_0x30b8ec){logger[_0xdf9f('0x2c')](_0x30b8ec);}return _0x5c981c;}return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x5b34e7,_0xdf9f('0x1c6'));};AGIVertices[_0xdf9f('0x10')]['unpause']=function(_0x3cece9){logger['info'](util[_0xdf9f('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3cece9[_0xdf9f('0x37')]));if(!this[_0xdf9f('0xa5')](_0x3cece9[_0xdf9f('0x155')])){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x3cece9,'no\x20find\x20by\x20configured');}logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x157'),this[_0xdf9f('0xd')][_0xdf9f('0x3a')],_0x3cece9[_0xdf9f('0x155')]));var _0x499ffa=this[_0xdf9f('0x50')][_0xdf9f('0x6e')](this,_0x3cece9['findBy']);if(_0x499ffa){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xdf9f('0x3a')],_0x3cece9['findBy']));this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util[_0xdf9f('0x28')](_0xdf9f('0x158'),this[_0xdf9f('0xd')]['callerid'],_0x3cece9['findBy']));return{'code':0xc8,'result':_0xdf9f('0x159')};}else{logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x15a'),this['channel'][_0xdf9f('0x3a')],_0x3cece9[_0xdf9f('0x155')]));this[_0xdf9f('0xd')][_0xdf9f('0xa9')](util['format'](_0xdf9f('0x15a'),this[_0xdf9f('0xd')]['callerid'],_0x3cece9[_0xdf9f('0x155')]));return{'code':0xc8,'result':_0xdf9f('0x15b')};}};AGIVertices['prototype']['voicemail']=function(_0x20e5ba){logger[_0xdf9f('0x2d')](util['format'](_0xdf9f('0x1c7'),_0x20e5ba[_0xdf9f('0x37')]));var _0x1fd94b=this[_0xdf9f('0xd')][_0xdf9f('0x57')](_0xdf9f('0x1c8'),[_0x20e5ba[_0xdf9f('0x1c9')],_0x20e5ba[_0xdf9f('0x76')]]);if(_0x1fd94b['result']===-0x1){return _0x1fd94b;}return this['channel']['noop'](util[_0xdf9f('0x28')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x20e5ba[_0xdf9f('0x1c9')]));};AGIVertices['prototype'][_0xdf9f('0x1ca')]=function(_0x35b671){logger[_0xdf9f('0x2d')](util[_0xdf9f('0x28')](_0xdf9f('0x1cb'),_0x35b671['label']));if(!this['isConfigured'](_0x35b671[_0xdf9f('0xd1')])){return this[_0xdf9f('0xd')]['error'](_0x35b671,_0xdf9f('0x1ae'));}var _0x2fa86b=this['getVariable'][_0xdf9f('0x6e')](this,_0x35b671[_0xdf9f('0xd1')]);if(!_0x2fa86b){return this[_0xdf9f('0xd')][_0xdf9f('0x2c')](_0x35b671,_0xdf9f('0xd3'));}var _0x530f8a=this['channel'][_0xdf9f('0x11')](_0x2fa86b);return{'code':0xc8,'result':_0x530f8a[_0xdf9f('0xa1')]?_0x530f8a['extra']:'-'};};String[_0xdf9f('0x10')][_0xdf9f('0xa0')]=function(_0x56dc15,_0x326612){return this[_0xdf9f('0x9f')](_0x56dc15)[_0xdf9f('0x1cc')](_0x326612);};module[_0xdf9f('0x1cd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4caa364..1b32969 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 _0xe01b=['[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally'];(function(_0x5a18ed,_0x9936d2){var _0x12d357=function(_0x1bfa4c){while(--_0x1bfa4c){_0x5a18ed['push'](_0x5a18ed['shift']());}};_0x12d357(++_0x9936d2);}(_0xe01b,0x72));var _0xbe01=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe01b[_0x2064e5];return _0x21a233;};'use strict';var util=require(_0xbe01('0x0'));var _=require(_0xbe01('0x1'));var moment=require('moment');var ami=require(_0xbe01('0x2'));var logger=require(_0xbe01('0x3'))(_0xbe01('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xbe01('0x5'));function Acw(_0x1b526d){this[_0xbe01('0x6')]=_0x1b526d[_0xbe01('0x6')];this['agents']=_0x1b526d[_0xbe01('0x7')];this[_0xbe01('0x8')]=_0x1b526d['timers'];this[_0xbe01('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xbe01('0xa')](this));ami['on'](_0xbe01('0xb'),this[_0xbe01('0xc')]['bind'](this));ami['on'](_0xbe01('0xd'),this[_0xbe01('0xe')][_0xbe01('0xa')](this));ami['on'](_0xbe01('0xf'),this['syncAgentRingNoAnswer'][_0xbe01('0xa')](this));ami['on']('attendedtransfer',this[_0xbe01('0x10')]['bind'](this));ami['on'](_0xbe01('0x11'),this[_0xbe01('0x12')][_0xbe01('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0xbe01('0x13')][_0xbe01('0xa')](this));}function getDiff(_0x44bf48){var _0x56ed10=moment()[_0xbe01('0x14')](0x0);var _0x40e018=moment(_0x44bf48)[_0xbe01('0x14')](0x0);return _0x56ed10[_0xbe01('0x15')](_0x40e018,'seconds');}Acw[_0xbe01('0x16')][_0xbe01('0x17')]=function(_0x18ee99){try{var _0x3f7dc8=this;var _0x5afa61=this[_0xbe01('0x9')][_0x18ee99]['interface'];var _0x8382eb=this['channels'][_0x18ee99]['queue'];var _0x479066=this['voiceQueues'][_0x8382eb];var _0x1485ab=![];var _0xdbd8bd=_0xbe01('0x18');if(_0x479066[_0xbe01('0x19')]){if(_0x479066['mandatoryDispositionPause']['name']){_0x1485ab=!![];_0xdbd8bd=_0x479066[_0xbe01('0x1a')][_0xbe01('0x1b')];}}ami[_0xbe01('0x1c')]({'action':'QueuePause','interface':_0x5afa61,'paused':!![],'reason':_0xdbd8bd})[_0xbe01('0x1d')](function(_0x3972ac){if(_0x3f7dc8[_0xbe01('0x7')][_0x5afa61]){return RpcUser[_0xbe01('0x1e')](_0x3f7dc8['agents'][_0x5afa61]['id'])[_0xbe01('0x1d')](function(_0x37c938){if(_0x37c938&&!_0x37c938[_0xbe01('0x1f')]){logger['info'](_0xbe01('0x20'),_0x18ee99,_0x5afa61,_0x8382eb);var _0x1b439b=_0x3f7dc8[_0xbe01('0x9')][_0x18ee99][_0xbe01('0x21')]&&_0x3f7dc8[_0xbe01('0x9')][_0x18ee99][_0xbe01('0x22')]?_0x3f7dc8[_0xbe01('0x9')][_0x18ee99][_0xbe01('0x22')]:_0x18ee99;return RpcUser[_0xbe01('0x23')](_0x3f7dc8[_0xbe01('0x7')][_0x5afa61],_0xdbd8bd,_0x1b439b)['then'](function(_0x501c67){if(!_0x1485ab){_0x3f7dc8[_0xbe01('0x8')][_0x5afa61]={};logger[_0xbe01('0x24')](_0xbe01('0x25'),_0x18ee99,_0x3f7dc8['voiceQueues'][_0x8382eb][_0xbe01('0x26')],_0x5afa61,_0x8382eb);_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x27')]=setTimeout(_0x3f7dc8[_0xbe01('0x28')][_0xbe01('0xa')](_0x3f7dc8,_0x5afa61),_0x3f7dc8[_0xbe01('0x6')][_0x8382eb][_0xbe01('0x26')]*0x3e8);_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x29')]=moment()[_0xbe01('0x2a')](_0xbe01('0x2b'));_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x2c')]=_0x18ee99;_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x2d')]=_0x8382eb;_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x2e')]=function(){var _0x4a08e8=getDiff(_0x3f7dc8['timers'][_0x5afa61]['lastPauseAt']);clearTimeout(_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x27')]);_0x3f7dc8['timers'][_0x5afa61][_0xbe01('0x27')]=![];RpcVoiceAgentReport[_0xbe01('0x2f')]({'acwtime':_0x4a08e8},_0x3f7dc8[_0xbe01('0x8')][_0x5afa61][_0xbe01('0x2c')],_0x5afa61)[_0xbe01('0x1d')](function(_0x46848b){logger[_0xbe01('0x24')](_0xbe01('0x30'),_0x18ee99,_0x4a08e8,_0x46848b);})[_0xbe01('0x31')](function(_0x20700b){logger[_0xbe01('0x32')](_0xbe01('0x33'),_0x18ee99,_0x20700b);});delete _0x3f7dc8['timers'][_0x5afa61];};}});}else{logger[_0xbe01('0x24')](_0xbe01('0x34'),_0x18ee99,_0x5afa61,_0x8382eb);}});}})[_0xbe01('0x31')](function(_0x30ad91){logger[_0xbe01('0x32')](_0xbe01('0x25'),_0x18ee99,_0x3f7dc8['voiceQueues'][_0x8382eb][_0xbe01('0x26')],_0x5afa61,_0x8382eb);})[_0xbe01('0x35')](function(){delete _0x3f7dc8['channels'][_0x18ee99];});}catch(_0x4b9712){logger[_0xbe01('0x32')](_0xbe01('0x36'),_0x4b9712[_0xbe01('0x37')]);}};Acw[_0xbe01('0x16')]['stopAcw']=function(_0x3d366b){try{var _0x19c08e=this;if(_0x19c08e[_0xbe01('0x8')][_0x3d366b]){_0x19c08e[_0xbe01('0x8')][_0x3d366b]['timer']=![];var _0x3fd3d9=_0x19c08e['timers'][_0x3d366b][_0xbe01('0x2c')];var _0x289cff=_0x19c08e['timers'][_0x3d366b][_0xbe01('0x2d')];var _0x1d8712=_0x19c08e['voiceQueues'][_0x289cff][_0xbe01('0x26')];logger['info'](_0xbe01('0x38'),_0x3fd3d9,_0x3d366b);RpcUser[_0xbe01('0x39')](this[_0xbe01('0x7')][_0x3d366b]);RpcVoiceAgentReport['update']({'acwtime':_0x1d8712,'agentacw':!![]},_0x3fd3d9,_0x3d366b)[_0xbe01('0x1d')](function(_0x2f63a4){logger[_0xbe01('0x24')](_0xbe01('0x30'),_0x3fd3d9,_0x1d8712,_0x2f63a4);})['catch'](function(_0x5bde98){logger[_0xbe01('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x3fd3d9,_0x5bde98);});}else{logger['error'](_0xbe01('0x3a'),_0x3d366b);if(_0x19c08e[_0xbe01('0x8')]){logger[_0xbe01('0x24')](_0xbe01('0x3b'),JSON[_0xbe01('0x3c')](_0x19c08e[_0xbe01('0x8')]));}}}catch(_0x421f85){logger[_0xbe01('0x32')](_0xbe01('0x3d'),_0x421f85['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x19384e){try{if(this['voiceQueues'][_0x19384e[_0xbe01('0x2d')]]&&(this[_0xbe01('0x6')][_0x19384e[_0xbe01('0x2d')]][_0xbe01('0x4')]||this[_0xbe01('0x6')][_0x19384e[_0xbe01('0x2d')]][_0xbe01('0x19')])){if(this[_0xbe01('0x7')][_0x19384e['interface']]){this[_0xbe01('0x9')][_0x19384e['uniqueid']]={'queue':_0x19384e[_0xbe01('0x2d')],'interface':_0x19384e[_0xbe01('0x3e')],'destlinkedid':_0x19384e[_0xbe01('0x22')]};}}}catch(_0x191bf8){logger['error'](_0xbe01('0x3f'),_0x191bf8[_0xbe01('0x37')]);}};Acw[_0xbe01('0x16')]['syncAgentConnectPreview']=function(_0x31f56e){try{if(this[_0xbe01('0x6')][_0x31f56e['queue']]&&(this['voiceQueues'][_0x31f56e[_0xbe01('0x2d')]][_0xbe01('0x4')]||this[_0xbe01('0x6')][_0x31f56e['queue']][_0xbe01('0x19')])){if(this[_0xbe01('0x7')][_0x31f56e[_0xbe01('0x3e')]]){this[_0xbe01('0x9')][_0x31f56e[_0xbe01('0x2c')]]={'queue':_0x31f56e[_0xbe01('0x2d')],'interface':_0x31f56e['interface']};}}}catch(_0x1bc362){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x1bc362[_0xbe01('0x37')]);}};Acw[_0xbe01('0x16')]['syncHangupRequest']=function(_0x7dc789){try{if(this['channels'][_0x7dc789['uniqueid']]&&_[_0xbe01('0x40')](this[_0xbe01('0x9')][_0x7dc789['uniqueid']][_0xbe01('0x21')])){logger['info'](_0xbe01('0x41'),_0x7dc789[_0xbe01('0x2c')]);this[_0xbe01('0x17')](_0x7dc789[_0xbe01('0x2c')]);}else if(this[_0xbe01('0x9')][_0x7dc789[_0xbe01('0x42')]]&&_['isUndefined'](this[_0xbe01('0x9')][_0x7dc789[_0xbe01('0x42')]][_0xbe01('0x21')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x7dc789['linkedid']);this[_0xbe01('0x17')](_0x7dc789[_0xbe01('0x42')]);}}catch(_0x1597d1){logger['error'](_0xbe01('0x43'),_0x1597d1['message']);}};Acw[_0xbe01('0x16')][_0xbe01('0xe')]=function(_0xdedce8){try{if(this[_0xbe01('0x9')][_0xdedce8[_0xbe01('0x2c')]]&&this[_0xbe01('0x9')][_0xdedce8[_0xbe01('0x2c')]][_0xbe01('0x21')]){logger[_0xbe01('0x24')](_0xbe01('0x44'),_0xdedce8['uniqueid']);this[_0xbe01('0x17')](_0xdedce8[_0xbe01('0x2c')]);}else if(this['channels'][_0xdedce8[_0xbe01('0x42')]]&&this[_0xbe01('0x9')][_0xdedce8[_0xbe01('0x42')]][_0xbe01('0x21')]){logger['info'](_0xbe01('0x45'),_0xdedce8['linkedid']);this['startAcw'](_0xdedce8[_0xbe01('0x42')]);}}catch(_0x4f9a6a){logger[_0xbe01('0x32')](_0xbe01('0x46'),_0x4f9a6a['message']);}};Acw['prototype'][_0xbe01('0x10')]=function(_0x41eda7){try{if(!_[_0xbe01('0x47')](this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x48')]])){this['startAcw'](_0x41eda7[_0xbe01('0x48')]);if(this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x49')]]){this[_0xbe01('0x9')][_0x41eda7['secondtransfereruniqueid']]['attended']=!![];this[_0xbe01('0x9')][_0x41eda7['transfertargetuniqueid']]=this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x49')]];delete this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x49')]];}}else if(!_[_0xbe01('0x47')](this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x4a')]])){this['startAcw'](_0x41eda7[_0xbe01('0x4a')]);if(this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x4b')]]){this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x4b')]]['attended']=!![];this['channels'][_0x41eda7['transfereeuniqueid']]=this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x4b')]];delete this[_0xbe01('0x9')][_0x41eda7[_0xbe01('0x4b')]];}}}catch(_0x379712){logger['error'](_0xbe01('0x4c'),_0x379712[_0xbe01('0x37')]);}};Acw[_0xbe01('0x16')][_0xbe01('0x12')]=function(_0x233ec2){try{if(this['channels'][_0x233ec2['transfereruniqueid']]){logger[_0xbe01('0x24')](_0xbe01('0x4d'),JSON[_0xbe01('0x3c')](_0x233ec2[_0xbe01('0x4e')]));this[_0xbe01('0x17')](_0x233ec2[_0xbe01('0x4e')]);}else if(this[_0xbe01('0x9')][_0x233ec2[_0xbe01('0x4f')]]){logger[_0xbe01('0x24')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xbe01('0x3c')](_0x233ec2[_0xbe01('0x4f')]));this[_0xbe01('0x17')](_0x233ec2[_0xbe01('0x4f')]);}}catch(_0x1a40bc){logger[_0xbe01('0x32')](_0xbe01('0x50'),_0x1a40bc[_0xbe01('0x37')]);}};Acw[_0xbe01('0x16')]['syncAgentRingNoAnswer']=function(_0x32dc97){try{if(this['voiceQueues'][_0x32dc97['queue']]&&this['voiceQueues'][_0x32dc97[_0xbe01('0x2d')]]['autopause']===_0xbe01('0x51')){if(this[_0xbe01('0x7')][_0x32dc97[_0xbe01('0x3e')]]){logger[_0xbe01('0x24')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x32dc97[_0xbe01('0x2c')],_0x32dc97['interface'],_0x32dc97[_0xbe01('0x2d')]);return RpcUser[_0xbe01('0x23')](this['agents'][_0x32dc97['interface']],_0xbe01('0x52'),_0x32dc97[_0xbe01('0x2c')]);}}}catch(_0x3e98d1){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x3e98d1['message']);}};module[_0xbe01('0x53')]=Acw; \ No newline at end of file +var _0x31fc=['[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','name','mandatoryDispositionPause','Action','then','voicePause','info','attended','destlinkedid','savePause','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','timer','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid'];(function(_0x16a14c,_0x2dbe5c){var _0x12d727=function(_0x15af80){while(--_0x15af80){_0x16a14c['push'](_0x16a14c['shift']());}};_0x12d727(++_0x2dbe5c);}(_0x31fc,0x117));var _0xc31f=function(_0x2bda4c,_0x5ab9b5){_0x2bda4c=_0x2bda4c-0x0;var _0x1c7ac5=_0x31fc[_0x2bda4c];return _0x1c7ac5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xc31f('0x0'));var ami=require(_0xc31f('0x1'));var logger=require(_0xc31f('0x2'))(_0xc31f('0x3'));var RpcUser=require(_0xc31f('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1d1103){this[_0xc31f('0x5')]=_0x1d1103[_0xc31f('0x5')];this['agents']=_0x1d1103[_0xc31f('0x6')];this[_0xc31f('0x7')]=_0x1d1103['timers'];this[_0xc31f('0x8')]={};ami['on'](_0xc31f('0x9'),this[_0xc31f('0xa')]['bind'](this));ami['on'](_0xc31f('0xb'),this[_0xc31f('0xc')][_0xc31f('0xd')](this));ami['on']('hangup',this[_0xc31f('0xe')][_0xc31f('0xd')](this));ami['on'](_0xc31f('0xf'),this[_0xc31f('0x10')][_0xc31f('0xd')](this));ami['on'](_0xc31f('0x11'),this[_0xc31f('0x12')][_0xc31f('0xd')](this));ami['on'](_0xc31f('0x13'),this[_0xc31f('0x14')][_0xc31f('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0xc31f('0x15')][_0xc31f('0xd')](this));}function getDiff(_0x264cf5){var _0x230c6e=moment()[_0xc31f('0x16')](0x0);var _0x136497=moment(_0x264cf5)[_0xc31f('0x16')](0x0);return _0x230c6e[_0xc31f('0x17')](_0x136497,_0xc31f('0x18'));}Acw[_0xc31f('0x19')][_0xc31f('0x1a')]=function(_0x2a4c7d){try{var _0x41a98b=this;var _0x21673d=this[_0xc31f('0x8')][_0x2a4c7d][_0xc31f('0x1b')];var _0x58326a=this[_0xc31f('0x8')][_0x2a4c7d][_0xc31f('0x1c')];var _0x2061e9=this[_0xc31f('0x5')][_0x58326a];var _0x5dacb9=![];var _0x4d1196=_0xc31f('0x1d');if(_0x2061e9['mandatoryDisposition']){if(_0x2061e9['mandatoryDispositionPause'][_0xc31f('0x1e')]){_0x5dacb9=!![];_0x4d1196=_0x2061e9[_0xc31f('0x1f')]['name'];}}ami[_0xc31f('0x20')]({'action':'QueuePause','interface':_0x21673d,'paused':!![],'reason':_0x4d1196})[_0xc31f('0x21')](function(_0x417909){if(_0x41a98b[_0xc31f('0x6')][_0x21673d]){return RpcUser['getAgent'](_0x41a98b[_0xc31f('0x6')][_0x21673d]['id'])['then'](function(_0x221157){if(_0x221157&&!_0x221157[_0xc31f('0x22')]){logger[_0xc31f('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2a4c7d,_0x21673d,_0x58326a);var _0x1470da=_0x41a98b[_0xc31f('0x8')][_0x2a4c7d][_0xc31f('0x24')]&&_0x41a98b[_0xc31f('0x8')][_0x2a4c7d][_0xc31f('0x25')]?_0x41a98b[_0xc31f('0x8')][_0x2a4c7d][_0xc31f('0x25')]:_0x2a4c7d;return RpcUser[_0xc31f('0x26')](_0x41a98b[_0xc31f('0x6')][_0x21673d],_0x4d1196,_0x1470da)[_0xc31f('0x21')](function(_0xb79226){if(!_0x5dacb9){_0x41a98b['timers'][_0x21673d]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2a4c7d,_0x41a98b[_0xc31f('0x5')][_0x58326a][_0xc31f('0x27')],_0x21673d,_0x58326a);_0x41a98b[_0xc31f('0x7')][_0x21673d]['timer']=setTimeout(_0x41a98b['stopAcw'][_0xc31f('0xd')](_0x41a98b,_0x21673d),_0x41a98b[_0xc31f('0x5')][_0x58326a][_0xc31f('0x27')]*0x3e8);_0x41a98b[_0xc31f('0x7')][_0x21673d][_0xc31f('0x28')]=moment()[_0xc31f('0x29')](_0xc31f('0x2a'));_0x41a98b[_0xc31f('0x7')][_0x21673d][_0xc31f('0x2b')]=_0x2a4c7d;_0x41a98b[_0xc31f('0x7')][_0x21673d][_0xc31f('0x1c')]=_0x58326a;_0x41a98b[_0xc31f('0x7')][_0x21673d]['updateAcw']=function(){var _0x1a6f3a=getDiff(_0x41a98b['timers'][_0x21673d][_0xc31f('0x28')]);clearTimeout(_0x41a98b['timers'][_0x21673d]['timer']);_0x41a98b[_0xc31f('0x7')][_0x21673d][_0xc31f('0x2c')]=![];RpcVoiceAgentReport[_0xc31f('0x2d')]({'acwtime':_0x1a6f3a},_0x41a98b['timers'][_0x21673d][_0xc31f('0x2b')],_0x21673d)[_0xc31f('0x21')](function(_0x9d680){logger[_0xc31f('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x2a4c7d,_0x1a6f3a,_0x9d680);})[_0xc31f('0x2e')](function(_0x18328f){logger[_0xc31f('0x2f')](_0xc31f('0x30'),_0x2a4c7d,_0x18328f);});delete _0x41a98b[_0xc31f('0x7')][_0x21673d];};}});}else{logger[_0xc31f('0x23')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2a4c7d,_0x21673d,_0x58326a);}});}})[_0xc31f('0x2e')](function(_0x58fd63){logger[_0xc31f('0x2f')](_0xc31f('0x31'),_0x2a4c7d,_0x41a98b[_0xc31f('0x5')][_0x58326a]['acwTimeout'],_0x21673d,_0x58326a);})[_0xc31f('0x32')](function(){delete _0x41a98b[_0xc31f('0x8')][_0x2a4c7d];});}catch(_0x178640){logger['error'](_0xc31f('0x33'),_0x178640[_0xc31f('0x34')]);}};Acw['prototype'][_0xc31f('0x35')]=function(_0x5e667f){try{var _0xc5c7c9=this;if(_0xc5c7c9['timers'][_0x5e667f]){_0xc5c7c9['timers'][_0x5e667f][_0xc31f('0x2c')]=![];var _0x5502ef=_0xc5c7c9[_0xc31f('0x7')][_0x5e667f]['uniqueid'];var _0x23372e=_0xc5c7c9[_0xc31f('0x7')][_0x5e667f][_0xc31f('0x1c')];var _0x3064a1=_0xc5c7c9['voiceQueues'][_0x23372e][_0xc31f('0x27')];logger[_0xc31f('0x23')](_0xc31f('0x36'),_0x5502ef,_0x5e667f);RpcUser[_0xc31f('0x37')](this[_0xc31f('0x6')][_0x5e667f]);RpcVoiceAgentReport['update']({'acwtime':_0x3064a1,'agentacw':!![]},_0x5502ef,_0x5e667f)['then'](function(_0x292eff){logger[_0xc31f('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x5502ef,_0x3064a1,_0x292eff);})[_0xc31f('0x2e')](function(_0x1a9500){logger[_0xc31f('0x2f')](_0xc31f('0x30'),_0x5502ef,_0x1a9500);});}else{logger['error'](_0xc31f('0x38'),_0x5e667f);if(_0xc5c7c9[_0xc31f('0x7')]){logger[_0xc31f('0x23')](_0xc31f('0x39'),JSON[_0xc31f('0x3a')](_0xc5c7c9[_0xc31f('0x7')]));}}}catch(_0x3ef883){logger['error']('[ACW][STOP]\x20%s',_0x3ef883['message']);}};Acw['prototype'][_0xc31f('0xa')]=function(_0x5b609b){try{if(this[_0xc31f('0x5')][_0x5b609b[_0xc31f('0x1c')]]&&(this[_0xc31f('0x5')][_0x5b609b[_0xc31f('0x1c')]]['acw']||this[_0xc31f('0x5')][_0x5b609b[_0xc31f('0x1c')]][_0xc31f('0x3b')])){if(this[_0xc31f('0x6')][_0x5b609b['interface']]){this['channels'][_0x5b609b[_0xc31f('0x2b')]]={'queue':_0x5b609b['queue'],'interface':_0x5b609b[_0xc31f('0x1b')],'destlinkedid':_0x5b609b[_0xc31f('0x25')]};}}}catch(_0x2bfcbe){logger[_0xc31f('0x2f')](_0xc31f('0x3c'),_0x2bfcbe[_0xc31f('0x34')]);}};Acw[_0xc31f('0x19')][_0xc31f('0x15')]=function(_0x5a27ce){try{if(this['voiceQueues'][_0x5a27ce[_0xc31f('0x1c')]]&&(this[_0xc31f('0x5')][_0x5a27ce['queue']][_0xc31f('0x3')]||this[_0xc31f('0x5')][_0x5a27ce[_0xc31f('0x1c')]][_0xc31f('0x3b')])){if(this[_0xc31f('0x6')][_0x5a27ce['interface']]){this[_0xc31f('0x8')][_0x5a27ce[_0xc31f('0x2b')]]={'queue':_0x5a27ce[_0xc31f('0x1c')],'interface':_0x5a27ce['interface']};}}}catch(_0x5612d1){logger[_0xc31f('0x2f')](_0xc31f('0x3d'),_0x5612d1['message']);}};Acw['prototype'][_0xc31f('0xc')]=function(_0x5cb6f1){try{if(this[_0xc31f('0x8')][_0x5cb6f1[_0xc31f('0x2b')]]&&_[_0xc31f('0x3e')](this[_0xc31f('0x8')][_0x5cb6f1['uniqueid']]['attended'])){logger[_0xc31f('0x23')](_0xc31f('0x3f'),_0x5cb6f1[_0xc31f('0x2b')]);this[_0xc31f('0x1a')](_0x5cb6f1['uniqueid']);}else if(this['channels'][_0x5cb6f1[_0xc31f('0x40')]]&&_['isUndefined'](this[_0xc31f('0x8')][_0x5cb6f1['linkedid']]['attended'])){logger[_0xc31f('0x23')](_0xc31f('0x41'),_0x5cb6f1[_0xc31f('0x40')]);this[_0xc31f('0x1a')](_0x5cb6f1[_0xc31f('0x40')]);}}catch(_0x36e89b){logger[_0xc31f('0x2f')](_0xc31f('0x42'),_0x36e89b['message']);}};Acw[_0xc31f('0x19')][_0xc31f('0xe')]=function(_0x413280){try{if(this[_0xc31f('0x8')][_0x413280[_0xc31f('0x2b')]]&&this[_0xc31f('0x8')][_0x413280['uniqueid']][_0xc31f('0x24')]){logger[_0xc31f('0x23')](_0xc31f('0x43'),_0x413280[_0xc31f('0x2b')]);this[_0xc31f('0x1a')](_0x413280[_0xc31f('0x2b')]);}else if(this[_0xc31f('0x8')][_0x413280[_0xc31f('0x40')]]&&this[_0xc31f('0x8')][_0x413280['linkedid']][_0xc31f('0x24')]){logger[_0xc31f('0x23')](_0xc31f('0x44'),_0x413280[_0xc31f('0x40')]);this[_0xc31f('0x1a')](_0x413280[_0xc31f('0x40')]);}}catch(_0x131e7c){logger[_0xc31f('0x2f')]('[ACW][syncHangup]\x20%s',_0x131e7c[_0xc31f('0x34')]);}};Acw[_0xc31f('0x19')][_0xc31f('0x12')]=function(_0x2b480a){try{if(!_[_0xc31f('0x45')](this[_0xc31f('0x8')][_0x2b480a['transfereeuniqueid']])){this[_0xc31f('0x1a')](_0x2b480a[_0xc31f('0x46')]);if(this['channels'][_0x2b480a[_0xc31f('0x47')]]){this[_0xc31f('0x8')][_0x2b480a['secondtransfereruniqueid']][_0xc31f('0x24')]=!![];this[_0xc31f('0x8')][_0x2b480a[_0xc31f('0x48')]]=this['channels'][_0x2b480a[_0xc31f('0x47')]];delete this[_0xc31f('0x8')][_0x2b480a[_0xc31f('0x47')]];}}else if(!_['isNil'](this[_0xc31f('0x8')][_0x2b480a[_0xc31f('0x48')]])){this[_0xc31f('0x1a')](_0x2b480a[_0xc31f('0x48')]);if(this[_0xc31f('0x8')][_0x2b480a[_0xc31f('0x49')]]){this[_0xc31f('0x8')][_0x2b480a[_0xc31f('0x49')]][_0xc31f('0x24')]=!![];this[_0xc31f('0x8')][_0x2b480a[_0xc31f('0x46')]]=this[_0xc31f('0x8')][_0x2b480a['origtransfereruniqueid']];delete this[_0xc31f('0x8')][_0x2b480a['origtransfereruniqueid']];}}}catch(_0x4b9e51){logger[_0xc31f('0x2f')](_0xc31f('0x4a'),_0x4b9e51[_0xc31f('0x34')]);}};Acw[_0xc31f('0x19')]['syncBlindTransfer']=function(_0x44cd18){try{if(this[_0xc31f('0x8')][_0x44cd18[_0xc31f('0x4b')]]){logger[_0xc31f('0x23')](_0xc31f('0x4c'),JSON['stringify'](_0x44cd18[_0xc31f('0x4b')]));this['startAcw'](_0x44cd18[_0xc31f('0x4b')]);}else if(this[_0xc31f('0x8')][_0x44cd18[_0xc31f('0x4d')]]){logger[_0xc31f('0x23')](_0xc31f('0x4e'),JSON[_0xc31f('0x3a')](_0x44cd18[_0xc31f('0x4d')]));this[_0xc31f('0x1a')](_0x44cd18[_0xc31f('0x4d')]);}}catch(_0x2b04b4){logger['error'](_0xc31f('0x4f'),_0x2b04b4[_0xc31f('0x34')]);}};Acw[_0xc31f('0x19')]['syncAgentRingNoAnswer']=function(_0x2c6c7e){try{if(this[_0xc31f('0x5')][_0x2c6c7e[_0xc31f('0x1c')]]&&this[_0xc31f('0x5')][_0x2c6c7e[_0xc31f('0x1c')]][_0xc31f('0x50')]===_0xc31f('0x51')){if(this[_0xc31f('0x6')][_0x2c6c7e[_0xc31f('0x1b')]]){logger['info'](_0xc31f('0x52'),_0x2c6c7e[_0xc31f('0x2b')],_0x2c6c7e[_0xc31f('0x1b')],_0x2c6c7e[_0xc31f('0x1c')]);return RpcUser[_0xc31f('0x26')](this[_0xc31f('0x6')][_0x2c6c7e[_0xc31f('0x1b')]],_0xc31f('0x53'),_0x2c6c7e[_0xc31f('0x2b')]);}}}catch(_0x158d1c){logger[_0xc31f('0x2f')](_0xc31f('0x54'),_0x158d1c['message']);}};module[_0xc31f('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 0aed67e..78e734f 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 _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x1adc00,_0x42477a){var _0x54b5c5=function(_0x2fa826){while(--_0x2fa826){_0x1adc00['push'](_0x1adc00['shift']());}};_0x54b5c5(++_0x42477a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file +var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x27362c,_0x5cbce1){var _0x32977b=function(_0xce2fbb){while(--_0xce2fbb){_0x27362c['push'](_0x27362c['shift']());}};_0x32977b(++_0x5cbce1);}(_0x757a,0xde));var _0xa757=function(_0x4398b4,_0xd5d1d2){_0x4398b4=_0x4398b4-0x0;var _0x4c783f=_0x757a[_0x4398b4];return _0x4c783f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 0830a8a..00e8ea8 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 _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x9bde,0xe1));var _0xe9bd=function(_0x297017,_0x2f300f){_0x297017=_0x297017-0x0;var _0x339284=_0x9bde[_0x297017];return _0x339284;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xcb91[_0x506172];return _0x2723c0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 9d219c3..9a27403 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 _0x76ca=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x76ca,0x167));var _0xa76c=function(_0x2e8877,_0x2056eb){_0x2e8877=_0x2e8877-0x0;var _0x256264=_0x76ca[_0x2e8877];return _0x256264;};'use strict';var util=require(_0xa76c('0x0'));var _=require(_0xa76c('0x1'));var moment=require('moment');function checkNameSurname(_0x1be295,_0xd632dc,_0x5cf18e){var _0x45c51c='';if(!_[_0xa76c('0x2')](_0xd632dc)&&_0xa76c('0x3')===typeof _0xd632dc){_0x45c51c+=_0xd632dc;}if(!_[_0xa76c('0x2')](_0x5cf18e)&&_0xa76c('0x3')===typeof _0x5cf18e){_0x45c51c+='\x20'+_0x5cf18e;}if(_0x45c51c!==''){return _0x45c51c;}return _0x1be295;}function Action(_0x45217a,_0x4b118a,_0x446afb){this[_0xa76c('0x4')]=_0x45217a;this[_0xa76c('0x5')]=_0x446afb||undefined;this[_0xa76c('0x6')]=checkNameSurname(_0x4b118a[_0xa76c('0x7')][_0xa76c('0x8')],_0x4b118a[_0xa76c('0x7')]['firstName'],_0x4b118a['Contact']['lastName']);this['number']=_0x4b118a['Contact'][_0xa76c('0x8')];this['queue']=_0x45217a[_0xa76c('0x6')];this[_0xa76c('0x9')]=_0x4b118a[_0xa76c('0x9')]||![];this[_0xa76c('0xa')]=_0x45217a[_0xa76c('0xa')];this['dialQueueTimeout']=_0x45217a[_0xa76c('0xb')]||0x3;this[_0xa76c('0xc')]=_0x4b118a[_0xa76c('0xc')];this['countbusyretry']=_0x4b118a['countbusyretry'];this[_0xa76c('0xd')]=_0x4b118a[_0xa76c('0xd')];this[_0xa76c('0xe')]=_0x4b118a[_0xa76c('0xe')];this[_0xa76c('0xf')]=_0x4b118a['countnosuchnumberretry'];this[_0xa76c('0x10')]=_0x4b118a[_0xa76c('0x10')];this['countabandonedretry']=_0x4b118a[_0xa76c('0x11')];this['countmachineretry']=_0x4b118a[_0xa76c('0x12')];this[_0xa76c('0x13')]=_0x4b118a[_0xa76c('0x13')];this['ContactId']=_0x4b118a[_0xa76c('0x14')];this[_0xa76c('0x15')]=_0x4b118a['ListId'];this[_0xa76c('0x16')]=_0x4b118a[_0xa76c('0x16')];this[_0xa76c('0x17')]=_0x4b118a[_0xa76c('0x17')];this[_0xa76c('0x18')]=_0x4b118a[_0xa76c('0x18')];this[_0xa76c('0x19')]=_0x4b118a['id'];this[_0xa76c('0x1a')]=_0x4b118a['Contact'][_0xa76c('0x1b')]||'';this['starttime']=moment()['format'](_0xa76c('0x1c'));this['callback']=_0x4b118a[_0xa76c('0x1d')];this[_0xa76c('0x1e')]=_0x4b118a['callbackuniqueid'];this['callbackat']=_0x4b118a[_0xa76c('0x1f')];this[_0xa76c('0x20')]=_0x4b118a[_0xa76c('0x20')];this[_0xa76c('0x21')]='';this[_0xa76c('0x22')]='';}Action[_0xa76c('0x23')]['getCaller']=function(){return util['format'](_0xa76c('0x24'),this[_0xa76c('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0xa76c('0x25')](this['voiceQueue'][_0xa76c('0x26')]):this['number']);};Action[_0xa76c('0x23')][_0xa76c('0x27')]=function(){return this[_0xa76c('0x28')];};module[_0xa76c('0x29')]=Action; \ No newline at end of file +var _0x0c6d=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','voiceQueue','getQueue','lodash','moment','isNil','string','uniqueid','Contact','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x52e213,_0x358279){var _0x4585da=function(_0x2c99f7){while(--_0x2c99f7){_0x52e213['push'](_0x52e213['shift']());}};_0x4585da(++_0x358279);}(_0x0c6d,0x148));var _0xd0c6=function(_0x1b8146,_0x2a3a48){_0x1b8146=_0x1b8146-0x0;var _0x30883e=_0x0c6d[_0x1b8146];return _0x30883e;};'use strict';var util=require('util');var _=require(_0xd0c6('0x0'));var moment=require(_0xd0c6('0x1'));function checkNameSurname(_0x8a120e,_0x5c805c,_0x104422){var _0x267c28='';if(!_[_0xd0c6('0x2')](_0x5c805c)&&_0xd0c6('0x3')===typeof _0x5c805c){_0x267c28+=_0x5c805c;}if(!_[_0xd0c6('0x2')](_0x104422)&&'string'===typeof _0x104422){_0x267c28+='\x20'+_0x104422;}if(_0x267c28!==''){return _0x267c28;}return _0x8a120e;}function Action(_0x54d789,_0x536f54,_0x477e80){this['voiceQueue']=_0x54d789;this[_0xd0c6('0x4')]=_0x477e80||undefined;this['name']=checkNameSurname(_0x536f54[_0xd0c6('0x5')]['phone'],_0x536f54[_0xd0c6('0x5')][_0xd0c6('0x6')],_0x536f54[_0xd0c6('0x5')][_0xd0c6('0x7')]);this[_0xd0c6('0x8')]=_0x536f54[_0xd0c6('0x5')]['phone'];this[_0xd0c6('0x9')]=_0x54d789[_0xd0c6('0xa')];this['active']=_0x536f54[_0xd0c6('0xb')]||![];this[_0xd0c6('0xc')]=_0x54d789[_0xd0c6('0xc')];this['dialQueueTimeout']=_0x54d789[_0xd0c6('0xd')]||0x3;this[_0xd0c6('0xe')]=_0x536f54[_0xd0c6('0xe')];this[_0xd0c6('0xf')]=_0x536f54[_0xd0c6('0xf')];this['countcongestionretry']=_0x536f54[_0xd0c6('0x10')];this[_0xd0c6('0x11')]=_0x536f54['countnoanswerretry'];this[_0xd0c6('0x12')]=_0x536f54[_0xd0c6('0x12')];this[_0xd0c6('0x13')]=_0x536f54[_0xd0c6('0x13')];this['countabandonedretry']=_0x536f54['countabandonedretry'];this[_0xd0c6('0x14')]=_0x536f54[_0xd0c6('0x14')];this[_0xd0c6('0x15')]=_0x536f54[_0xd0c6('0x15')];this['ContactId']=_0x536f54[_0xd0c6('0x16')];this['ListId']=_0x536f54[_0xd0c6('0x17')];this[_0xd0c6('0x18')]=_0x536f54[_0xd0c6('0x18')];this[_0xd0c6('0x19')]=_0x536f54['VoiceQueueId'];this[_0xd0c6('0x1a')]=_0x536f54[_0xd0c6('0x1a')];this[_0xd0c6('0x1b')]=_0x536f54['id'];this[_0xd0c6('0x1c')]=_0x536f54[_0xd0c6('0x5')][_0xd0c6('0x6')]||'';this[_0xd0c6('0x1d')]=moment()[_0xd0c6('0x1e')](_0xd0c6('0x1f'));this[_0xd0c6('0x20')]=_0x536f54['callback'];this[_0xd0c6('0x21')]=_0x536f54['callbackuniqueid'];this[_0xd0c6('0x22')]=_0x536f54[_0xd0c6('0x22')];this[_0xd0c6('0x23')]=_0x536f54['recallme'];this[_0xd0c6('0x24')]='';this[_0xd0c6('0x25')]='';}Action[_0xd0c6('0x26')][_0xd0c6('0x27')]=function(){return util['format'](_0xd0c6('0x28'),this[_0xd0c6('0xa')],this['voiceQueue'][_0xd0c6('0x29')]>0x0?this[_0xd0c6('0x8')][_0xd0c6('0x2a')](this[_0xd0c6('0x2b')][_0xd0c6('0x29')]):this[_0xd0c6('0x8')]);};Action[_0xd0c6('0x26')][_0xd0c6('0x2c')]=function(){return this[_0xd0c6('0x9')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 30ef92c..bdf7332 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 _0xc181=['CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId'];(function(_0xa2c15f,_0x1c02d6){var _0x47bbb7=function(_0x5c1839){while(--_0x5c1839){_0xa2c15f['push'](_0xa2c15f['shift']());}};_0x47bbb7(++_0x1c02d6);}(_0xc181,0x117));var _0x1c18=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0xc181[_0x3388d8];return _0x2bbe73;};'use strict';var util=require(_0x1c18('0x0'));var _=require(_0x1c18('0x1'));var moment=require(_0x1c18('0x2'));function getSeconds(_0x4e71f2,_0x39da38){var _0x53fd3b=moment(_0x4e71f2)[_0x1c18('0x3')](0x0);var _0x557f19=moment(_0x39da38)['milliseconds'](0x0);return _0x53fd3b['diff'](_0x557f19,_0x1c18('0x4'));}function AgentComplete(_0x3b7bb8,_0x2abbbd){this['state']=0x4;this[_0x1c18('0x5')]=_0x1c18('0x6');this[_0x1c18('0x7')]=_0x3b7bb8[_0x1c18('0x7')];this['type']=_0x3b7bb8['type'];this[_0x1c18('0x8')]=_0x3b7bb8[_0x1c18('0x9')]===_0x1c18('0xa')?_0x1c18('0xb'):_0x3b7bb8[_0x1c18('0x9')];this[_0x1c18('0xc')]=_0x3b7bb8[_0x1c18('0xc')];this[_0x1c18('0xd')]=_0x3b7bb8[_0x1c18('0xd')];this[_0x1c18('0xe')]=_0x3b7bb8[_0x1c18('0xe')];this[_0x1c18('0xf')]=_0x3b7bb8[_0x1c18('0xc')]+_0x3b7bb8[_0x1c18('0xd')]+_0x3b7bb8[_0x1c18('0xe')]+_0x3b7bb8[_0x1c18('0x10')]+_0x3b7bb8['countdropretry']+_0x3b7bb8['countabandonedretry']+_0x3b7bb8['countmachineretry']+_0x3b7bb8[_0x1c18('0x11')];this[_0x1c18('0x10')]=_0x3b7bb8[_0x1c18('0x10')];this['countdropretry']=_0x3b7bb8[_0x1c18('0x12')];this[_0x1c18('0x13')]=_0x3b7bb8[_0x1c18('0x13')];this[_0x1c18('0x14')]=_0x3b7bb8[_0x1c18('0x14')];this[_0x1c18('0x11')]=_0x3b7bb8[_0x1c18('0x11')];this[_0x1c18('0x15')]=_0x2abbbd[_0x1c18('0x15')];this[_0x1c18('0x16')]=_0x3b7bb8[_0x1c18('0x17')];this[_0x1c18('0x18')]=_0x3b7bb8[_0x1c18('0x19')];this[_0x1c18('0x1a')]=_0x3b7bb8['starttime'];this[_0x1c18('0x1b')]=_0x3b7bb8[_0x1c18('0x1b')];this[_0x1c18('0x1c')]=_0x3b7bb8[_0x1c18('0x1c')];this[_0x1c18('0x1d')]=moment()[_0x1c18('0x1e')](_0x1c18('0x1f'));this[_0x1c18('0x20')]=getSeconds(_0x3b7bb8[_0x1c18('0x1b')],_0x3b7bb8[_0x1c18('0x1a')]);this[_0x1c18('0x21')]=getSeconds(_0x3b7bb8[_0x1c18('0x1c')],_0x3b7bb8['responsetime']);this['talktime']=getSeconds(this[_0x1c18('0x1d')],_0x3b7bb8['answertime']);this[_0x1c18('0xb')]=_0x2abbbd[_0x1c18('0xb')];this[_0x1c18('0x22')]=_0x2abbbd[_0x1c18('0x22')];this[_0x1c18('0x23')]=_0x2abbbd[_0x1c18('0x23')];this[_0x1c18('0x24')]=_0x3b7bb8[_0x1c18('0x24')];this[_0x1c18('0x25')]=_0x3b7bb8[_0x1c18('0x25')];this[_0x1c18('0x26')]=_0x3b7bb8['callbackat'];this[_0x1c18('0x27')]=_0x3b7bb8['recallme'];this['ContactId']=_0x3b7bb8['ContactId'];this[_0x1c18('0x28')]=_0x3b7bb8[_0x1c18('0x28')];this[_0x1c18('0x29')]=_0x3b7bb8[_0x1c18('0x29')];this[_0x1c18('0x2a')]=_0x3b7bb8[_0x1c18('0x2a')];this[_0x1c18('0x2b')]=_0x3b7bb8[_0x1c18('0x2b')];this[_0x1c18('0x2c')]=_0x3b7bb8[_0x1c18('0x2c')]||'';this[_0x1c18('0x2d')]=_0x3b7bb8[_0x1c18('0x2d')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x251b=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','answertime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x383e64,_0x2c3425){var _0x12725d=function(_0x186a04){while(--_0x186a04){_0x383e64['push'](_0x383e64['shift']());}};_0x12725d(++_0x2c3425);}(_0x251b,0x196));var _0xb251=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0x251b[_0x8afdd0];return _0x3de7ac;};'use strict';var util=require('util');var _=require(_0xb251('0x0'));var moment=require(_0xb251('0x1'));function getSeconds(_0x8ad84a,_0x1c27a9){var _0x2fdc20=moment(_0x8ad84a)[_0xb251('0x2')](0x0);var _0x3e082d=moment(_0x1c27a9)[_0xb251('0x2')](0x0);return _0x2fdc20['diff'](_0x3e082d,_0xb251('0x3'));}function AgentComplete(_0x5c824f,_0x2586d1){this[_0xb251('0x4')]=0x4;this[_0xb251('0x5')]=_0xb251('0x6');this[_0xb251('0x7')]=_0x5c824f[_0xb251('0x7')];this[_0xb251('0x8')]=_0x5c824f[_0xb251('0x8')];this[_0xb251('0x9')]=_0x5c824f[_0xb251('0x8')]===_0xb251('0xa')?_0xb251('0xb'):_0x5c824f['type'];this[_0xb251('0xc')]=_0x5c824f[_0xb251('0xc')];this[_0xb251('0xd')]=_0x5c824f[_0xb251('0xd')];this['countnoanswerretry']=_0x5c824f[_0xb251('0xe')];this[_0xb251('0xf')]=_0x5c824f[_0xb251('0xc')]+_0x5c824f[_0xb251('0xd')]+_0x5c824f[_0xb251('0xe')]+_0x5c824f[_0xb251('0x10')]+_0x5c824f['countdropretry']+_0x5c824f['countabandonedretry']+_0x5c824f[_0xb251('0x11')]+_0x5c824f[_0xb251('0x12')];this['countnosuchnumberretry']=_0x5c824f['countnosuchnumberretry'];this[_0xb251('0x13')]=_0x5c824f[_0xb251('0x13')];this[_0xb251('0x14')]=_0x5c824f[_0xb251('0x14')];this[_0xb251('0x11')]=_0x5c824f[_0xb251('0x11')];this[_0xb251('0x12')]=_0x5c824f[_0xb251('0x12')];this[_0xb251('0x15')]=_0x2586d1['uniqueid'];this[_0xb251('0x16')]=_0x5c824f[_0xb251('0x17')];this[_0xb251('0x18')]=_0x5c824f[_0xb251('0x19')];this[_0xb251('0x1a')]=_0x5c824f[_0xb251('0x1a')];this[_0xb251('0x1b')]=_0x5c824f['responsetime'];this['answertime']=_0x5c824f['answertime'];this['endtime']=moment()[_0xb251('0x1c')](_0xb251('0x1d'));this[_0xb251('0x1e')]=getSeconds(_0x5c824f['responsetime'],_0x5c824f[_0xb251('0x1a')]);this[_0xb251('0x1f')]=getSeconds(_0x5c824f['answertime'],_0x5c824f[_0xb251('0x1b')]);this[_0xb251('0x20')]=getSeconds(this[_0xb251('0x21')],_0x5c824f[_0xb251('0x22')]);this[_0xb251('0xb')]=_0x2586d1[_0xb251('0xb')];this['membername']=_0x2586d1[_0xb251('0x23')];this[_0xb251('0x24')]=_0x2586d1['reason'];this[_0xb251('0x25')]=_0x5c824f[_0xb251('0x25')];this[_0xb251('0x26')]=_0x5c824f[_0xb251('0x26')];this[_0xb251('0x27')]=_0x5c824f[_0xb251('0x27')];this[_0xb251('0x28')]=_0x5c824f['recallme'];this['ContactId']=_0x5c824f['ContactId'];this['ListId']=_0x5c824f[_0xb251('0x29')];this[_0xb251('0x2a')]=_0x5c824f[_0xb251('0x2a')];this[_0xb251('0x2b')]=_0x5c824f['VoiceQueueId'];this[_0xb251('0x2c')]=_0x5c824f[_0xb251('0x2c')];this['originatecalleridnum']=_0x5c824f[_0xb251('0x2d')]||'';this[_0xb251('0x2e')]=_0x5c824f[_0xb251('0x2e')]||'';}module[_0xb251('0x2f')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index d0f5999..1a98f4a 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 _0x31f0=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime'];(function(_0x308fe7,_0x3dedd8){var _0x2f29fe=function(_0x1721a7){while(--_0x1721a7){_0x308fe7['push'](_0x308fe7['shift']());}};_0x2f29fe(++_0x3dedd8);}(_0x31f0,0xb7));var _0x031f=function(_0x122aaa,_0x13c714){_0x122aaa=_0x122aaa-0x0;var _0x52ba2b=_0x31f0[_0x122aaa];return _0x52ba2b;};'use strict';var util=require(_0x031f('0x0'));var _=require('lodash');var moment=require(_0x031f('0x1'));function getSeconds(_0x50a1ab,_0x3747a5){var _0x2021ea=moment(_0x50a1ab)[_0x031f('0x2')](0x0);var _0xf20620=moment(_0x3747a5)['milliseconds'](0x0);return _0x2021ea[_0x031f('0x3')](_0xf20620,_0x031f('0x4'));}function Final(_0x4f6059){this['uniqueid']=_0x4f6059['uniqueid'];this[_0x031f('0x5')]=_0x4f6059['scheduledat'];this[_0x031f('0x6')]=_0x4f6059[_0x031f('0x6')];this[_0x031f('0x7')]=_0x4f6059[_0x031f('0x6')]==='outbound'?_0x031f('0x8'):_0x4f6059[_0x031f('0x6')];this[_0x031f('0x9')]=_0x4f6059[_0x031f('0x9')];this[_0x031f('0xa')]=_0x4f6059[_0x031f('0xa')];this[_0x031f('0xb')]=_0x4f6059[_0x031f('0xb')];this['countglobal']=_0x4f6059[_0x031f('0x9')]+_0x4f6059[_0x031f('0xa')]+_0x4f6059[_0x031f('0xb')]+_0x4f6059[_0x031f('0xc')]+_0x4f6059[_0x031f('0xd')]+_0x4f6059[_0x031f('0xe')]+_0x4f6059[_0x031f('0xf')]+_0x4f6059['countagentrejectretry'];this[_0x031f('0xc')]=_0x4f6059[_0x031f('0xc')];this[_0x031f('0xd')]=_0x4f6059[_0x031f('0xd')];this[_0x031f('0xe')]=_0x4f6059['countabandonedretry'];this['countmachineretry']=_0x4f6059[_0x031f('0xf')];this[_0x031f('0x10')]=_0x4f6059[_0x031f('0x10')];this[_0x031f('0x8')]=_0x4f6059['queue'];this[_0x031f('0x11')]=_0x4f6059[_0x031f('0x11')];this['calleridnum']=_0x4f6059[_0x031f('0x12')];this['starttime']=_0x4f6059[_0x031f('0x13')];this[_0x031f('0x14')]=_0x4f6059[_0x031f('0x14')];this[_0x031f('0x15')]=_0x4f6059[_0x031f('0x14')];this[_0x031f('0x16')]=_0x4f6059[_0x031f('0x16')]||0x0;this[_0x031f('0x17')]=_0x4f6059[_0x031f('0x17')]||0x0;this[_0x031f('0x18')]=_0x4f6059[_0x031f('0x18')]||0x0;this['callback']=_0x4f6059[_0x031f('0x19')];this[_0x031f('0x1a')]=_0x4f6059[_0x031f('0x1a')];this['callbackat']=_0x4f6059['callbackat'];this[_0x031f('0x1b')]=_0x4f6059['recallme'];this[_0x031f('0x1c')]=_0x4f6059['ContactId'];this['ListId']=_0x4f6059['ListId'];this[_0x031f('0x1d')]=_0x4f6059[_0x031f('0x1d')];this[_0x031f('0x1e')]=_0x4f6059[_0x031f('0x1e')];this['CampaignId']=_0x4f6059[_0x031f('0x1f')];this['originatecalleridnum']=_0x4f6059[_0x031f('0x20')]||'';this[_0x031f('0x21')]=_0x4f6059[_0x031f('0x21')]||'';}module['exports']=Final; \ No newline at end of file +var _0x7579=['endtime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime'];(function(_0x26d977,_0x24de56){var _0x352b39=function(_0xcf4c39){while(--_0xcf4c39){_0x26d977['push'](_0x26d977['shift']());}};_0x352b39(++_0x24de56);}(_0x7579,0x1e2));var _0x9757=function(_0x1b0555,_0x4fc645){_0x1b0555=_0x1b0555-0x0;var _0x2a21f1=_0x7579[_0x1b0555];return _0x2a21f1;};'use strict';var util=require(_0x9757('0x0'));var _=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));function getSeconds(_0x30eeec,_0x2e6afa){var _0x304b14=moment(_0x30eeec)['milliseconds'](0x0);var _0x399165=moment(_0x2e6afa)[_0x9757('0x3')](0x0);return _0x304b14[_0x9757('0x4')](_0x399165,_0x9757('0x5'));}function Final(_0x4c1a67){this[_0x9757('0x6')]=_0x4c1a67[_0x9757('0x6')];this[_0x9757('0x7')]=_0x4c1a67['scheduledat'];this[_0x9757('0x8')]=_0x4c1a67['type'];this[_0x9757('0x9')]=_0x4c1a67[_0x9757('0x8')]===_0x9757('0xa')?'queue':_0x4c1a67[_0x9757('0x8')];this[_0x9757('0xb')]=_0x4c1a67[_0x9757('0xb')];this[_0x9757('0xc')]=_0x4c1a67[_0x9757('0xc')];this[_0x9757('0xd')]=_0x4c1a67[_0x9757('0xd')];this[_0x9757('0xe')]=_0x4c1a67[_0x9757('0xb')]+_0x4c1a67[_0x9757('0xc')]+_0x4c1a67[_0x9757('0xd')]+_0x4c1a67['countnosuchnumberretry']+_0x4c1a67[_0x9757('0xf')]+_0x4c1a67[_0x9757('0x10')]+_0x4c1a67[_0x9757('0x11')]+_0x4c1a67['countagentrejectretry'];this[_0x9757('0x12')]=_0x4c1a67[_0x9757('0x12')];this[_0x9757('0xf')]=_0x4c1a67[_0x9757('0xf')];this[_0x9757('0x10')]=_0x4c1a67[_0x9757('0x10')];this[_0x9757('0x11')]=_0x4c1a67['countmachineretry'];this[_0x9757('0x13')]=_0x4c1a67['countagentrejectretry'];this[_0x9757('0x14')]=_0x4c1a67[_0x9757('0x14')];this[_0x9757('0x15')]=_0x4c1a67[_0x9757('0x15')];this[_0x9757('0x16')]=_0x4c1a67[_0x9757('0x16')];this['starttime']=_0x4c1a67[_0x9757('0x17')];this[_0x9757('0x18')]=_0x4c1a67[_0x9757('0x18')];this[_0x9757('0x19')]=_0x4c1a67[_0x9757('0x18')];this[_0x9757('0x1a')]=_0x4c1a67[_0x9757('0x1a')]||0x0;this['holdtime']=_0x4c1a67[_0x9757('0x1b')]||0x0;this['talktime']=_0x4c1a67['talktime']||0x0;this[_0x9757('0x1c')]=_0x4c1a67[_0x9757('0x1c')];this[_0x9757('0x1d')]=_0x4c1a67[_0x9757('0x1d')];this['callbackat']=_0x4c1a67['callbackat'];this['recallme']=_0x4c1a67[_0x9757('0x1e')];this[_0x9757('0x1f')]=_0x4c1a67[_0x9757('0x1f')];this[_0x9757('0x20')]=_0x4c1a67['ListId'];this[_0x9757('0x21')]=_0x4c1a67[_0x9757('0x21')];this['VoiceQueueId']=_0x4c1a67[_0x9757('0x22')];this[_0x9757('0x23')]=_0x4c1a67['CampaignId'];this[_0x9757('0x24')]=_0x4c1a67[_0x9757('0x24')]||'';this[_0x9757('0x25')]=_0x4c1a67[_0x9757('0x25')]||'';}module[_0x9757('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8b8e3dc..e0e8a78 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 _0x2794=['countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry'];(function(_0x1993a8,_0xd34e39){var _0x353428=function(_0x1b5ab5){while(--_0x1b5ab5){_0x1993a8['push'](_0x1993a8['shift']());}};_0x353428(++_0xd34e39);}(_0x2794,0x181));var _0x4279=function(_0x30fe78,_0x4a9d55){_0x30fe78=_0x30fe78-0x0;var _0x5bd9e6=_0x2794[_0x30fe78];return _0x5bd9e6;};'use strict';var util=require(_0x4279('0x0'));var _=require('lodash');var moment=require(_0x4279('0x1'));function getSeconds(_0x4992d2,_0x3bf781){var _0x4b5359=moment(_0x4992d2)[_0x4279('0x2')](0x0);var _0x42a3af=moment(_0x3bf781)[_0x4279('0x2')](0x0);return _0x4b5359[_0x4279('0x3')](_0x42a3af,_0x4279('0x4'));}function Hangup(_0x2d9a1e,_0x180904){this[_0x4279('0x5')]=0x4;this[_0x4279('0x6')]=_0x4279('0x7');this['scheduledat']=_0x2d9a1e['scheduledat'];this['type']=_0x2d9a1e[_0x4279('0x8')];this[_0x4279('0x9')]=_0x2d9a1e[_0x4279('0x8')]===_0x4279('0xa')?_0x4279('0xb'):_0x2d9a1e[_0x4279('0x8')];this[_0x4279('0xc')]=_0x2d9a1e[_0x4279('0xc')];this[_0x4279('0xd')]=_0x2d9a1e['countcongestionretry'];this[_0x4279('0xe')]=_0x2d9a1e['countnoanswerretry'];this[_0x4279('0xf')]=_0x2d9a1e[_0x4279('0xc')]+_0x2d9a1e['countcongestionretry']+_0x2d9a1e[_0x4279('0xe')]+_0x2d9a1e[_0x4279('0x10')]+_0x2d9a1e[_0x4279('0x11')]+_0x2d9a1e[_0x4279('0x12')]+_0x2d9a1e['countmachineretry']+_0x2d9a1e[_0x4279('0x13')];this[_0x4279('0x10')]=_0x2d9a1e[_0x4279('0x10')];this[_0x4279('0x11')]=_0x2d9a1e['countdropretry'];this[_0x4279('0x12')]=_0x2d9a1e[_0x4279('0x12')];this[_0x4279('0x14')]=_0x2d9a1e[_0x4279('0x14')];this[_0x4279('0x13')]=_0x2d9a1e['countagentrejectretry'];this[_0x4279('0x15')]=_0x180904[_0x4279('0x15')];this[_0x4279('0x16')]=_0x2d9a1e[_0x4279('0x17')];this[_0x4279('0x18')]=_0x2d9a1e[_0x4279('0x19')];this[_0x4279('0x1a')]=_0x2d9a1e[_0x4279('0x1a')];this[_0x4279('0x1b')]=_0x2d9a1e['responsetime'];this[_0x4279('0x1c')]=moment()[_0x4279('0x1d')](_0x4279('0x1e'));this['ringtime']=getSeconds(_0x2d9a1e[_0x4279('0x1b')],_0x2d9a1e[_0x4279('0x1a')]);this[_0x4279('0x1f')]=0x0;this[_0x4279('0x20')]=getSeconds(this[_0x4279('0x1c')],_0x2d9a1e[_0x4279('0x1b')]);this['queue']=_0x2d9a1e[_0x4279('0xb')];this[_0x4279('0x21')]=_0x4279('0x22');this['reason']=_0x180904[_0x4279('0x23')];this['callback']=_0x2d9a1e[_0x4279('0x24')];this[_0x4279('0x25')]=_0x2d9a1e['callbackuniqueid'];this[_0x4279('0x26')]=_0x2d9a1e[_0x4279('0x26')];this['recallme']=_0x2d9a1e['recallme'];this[_0x4279('0x27')]=_0x2d9a1e[_0x4279('0x27')];this[_0x4279('0x28')]=_0x2d9a1e['ListId'];this[_0x4279('0x29')]=_0x2d9a1e[_0x4279('0x29')];this[_0x4279('0x2a')]=_0x2d9a1e[_0x4279('0x2a')];this[_0x4279('0x2b')]=_0x2d9a1e[_0x4279('0x2b')];}module[_0x4279('0x2c')]=Hangup; \ No newline at end of file +var _0x749a=['moment','milliseconds','diff','state','Answer','scheduledat','type','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x749a,0x11d));var _0xa749=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x749a[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xa749('0x0'));var _=require(_0xa749('0x1'));var moment=require(_0xa749('0x2'));function getSeconds(_0x5364cc,_0x7d453c){var _0x33f052=moment(_0x5364cc)[_0xa749('0x3')](0x0);var _0x24d843=moment(_0x7d453c)['milliseconds'](0x0);return _0x33f052[_0xa749('0x4')](_0x24d843,'seconds');}function Hangup(_0x5b7ad0,_0x15acf2){this[_0xa749('0x5')]=0x4;this['statedesc']=_0xa749('0x6');this['scheduledat']=_0x5b7ad0[_0xa749('0x7')];this[_0xa749('0x8')]=_0x5b7ad0[_0xa749('0x8')];this['campaigntype']=_0x5b7ad0[_0xa749('0x8')]==='outbound'?_0xa749('0x9'):_0x5b7ad0[_0xa749('0x8')];this[_0xa749('0xa')]=_0x5b7ad0[_0xa749('0xa')];this['countcongestionretry']=_0x5b7ad0['countcongestionretry'];this[_0xa749('0xb')]=_0x5b7ad0[_0xa749('0xb')];this['countglobal']=_0x5b7ad0[_0xa749('0xa')]+_0x5b7ad0[_0xa749('0xc')]+_0x5b7ad0[_0xa749('0xb')]+_0x5b7ad0[_0xa749('0xd')]+_0x5b7ad0[_0xa749('0xe')]+_0x5b7ad0[_0xa749('0xf')]+_0x5b7ad0['countmachineretry']+_0x5b7ad0[_0xa749('0x10')];this[_0xa749('0xd')]=_0x5b7ad0[_0xa749('0xd')];this[_0xa749('0xe')]=_0x5b7ad0[_0xa749('0xe')];this[_0xa749('0xf')]=_0x5b7ad0[_0xa749('0xf')];this[_0xa749('0x11')]=_0x5b7ad0[_0xa749('0x11')];this[_0xa749('0x10')]=_0x5b7ad0['countagentrejectretry'];this[_0xa749('0x12')]=_0x15acf2[_0xa749('0x12')];this[_0xa749('0x13')]=_0x5b7ad0[_0xa749('0x14')];this[_0xa749('0x15')]=_0x5b7ad0[_0xa749('0x16')];this[_0xa749('0x17')]=_0x5b7ad0['starttime'];this[_0xa749('0x18')]=_0x5b7ad0[_0xa749('0x18')];this['endtime']=moment()['format'](_0xa749('0x19'));this[_0xa749('0x1a')]=getSeconds(_0x5b7ad0[_0xa749('0x18')],_0x5b7ad0['starttime']);this['holdtime']=0x0;this[_0xa749('0x1b')]=getSeconds(this[_0xa749('0x1c')],_0x5b7ad0[_0xa749('0x18')]);this[_0xa749('0x9')]=_0x5b7ad0['queue'];this['membername']=_0xa749('0x1d');this[_0xa749('0x1e')]=_0x15acf2['cause-txt'];this[_0xa749('0x1f')]=_0x5b7ad0['callback'];this[_0xa749('0x20')]=_0x5b7ad0['callbackuniqueid'];this[_0xa749('0x21')]=_0x5b7ad0['callbackat'];this[_0xa749('0x22')]=_0x5b7ad0['recallme'];this[_0xa749('0x23')]=_0x5b7ad0[_0xa749('0x23')];this[_0xa749('0x24')]=_0x5b7ad0['ListId'];this['UserId']=_0x5b7ad0[_0xa749('0x25')];this[_0xa749('0x26')]=_0x5b7ad0[_0xa749('0x26')];this[_0xa749('0x27')]=_0x5b7ad0[_0xa749('0x27')];}module[_0xa749('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 312c6ce..a44bbfa 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 _0xe5f0=['responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','calleridnum','number','starttime'];(function(_0x5e90ba,_0xe16f66){var _0x1300f0=function(_0x26e79a){while(--_0x26e79a){_0x5e90ba['push'](_0x5e90ba['shift']());}};_0x1300f0(++_0xe16f66);}(_0xe5f0,0x1f0));var _0x0e5f=function(_0xb392bc,_0x165ff5){_0xb392bc=_0xb392bc-0x0;var _0x365053=_0xe5f0[_0xb392bc];return _0x365053;};'use strict';var util=require('util');var _=require(_0x0e5f('0x0'));var moment=require('moment');function getSeconds(_0x367cbe,_0x37ee17){var _0xaf1b73=moment(_0x367cbe)[_0x0e5f('0x1')](0x0);var _0xd0fc10=moment(_0x37ee17)[_0x0e5f('0x1')](0x0);return _0xaf1b73[_0x0e5f('0x2')](_0xd0fc10,_0x0e5f('0x3'));}function History(_0x52eade){this[_0x0e5f('0x4')]=_0x52eade[_0x0e5f('0x4')];this[_0x0e5f('0x5')]=_0x52eade[_0x0e5f('0x5')]||undefined;this[_0x0e5f('0x6')]=_0x52eade[_0x0e5f('0x6')];this[_0x0e5f('0x7')]=_0x52eade[_0x0e5f('0x6')]===_0x0e5f('0x8')?_0x0e5f('0x9'):_0x52eade[_0x0e5f('0x6')];this['countbusyretry']=_0x52eade[_0x0e5f('0xa')];this['countcongestionretry']=_0x52eade[_0x0e5f('0xb')];this[_0x0e5f('0xc')]=_0x52eade[_0x0e5f('0xc')];this['countglobal']=_0x52eade[_0x0e5f('0xa')]+_0x52eade[_0x0e5f('0xb')]+_0x52eade[_0x0e5f('0xc')]+_0x52eade[_0x0e5f('0xd')]+_0x52eade[_0x0e5f('0xe')]+_0x52eade[_0x0e5f('0xf')]+_0x52eade['countmachineretry']+_0x52eade[_0x0e5f('0x10')];this[_0x0e5f('0xd')]=_0x52eade[_0x0e5f('0xd')];this['countdropretry']=_0x52eade[_0x0e5f('0xe')];this['countabandonedretry']=_0x52eade[_0x0e5f('0xf')];this[_0x0e5f('0x11')]=_0x52eade[_0x0e5f('0x11')];this['countagentrejectretry']=_0x52eade['countagentrejectretry'];this[_0x0e5f('0x9')]=_0x52eade[_0x0e5f('0x9')];this['calleridname']=_0x52eade[_0x0e5f('0x12')];this[_0x0e5f('0x13')]=_0x52eade[_0x0e5f('0x14')];this[_0x0e5f('0x15')]=_0x52eade[_0x0e5f('0x15')];this['responsetime']=_0x52eade[_0x0e5f('0x16')];this[_0x0e5f('0x17')]=_0x52eade[_0x0e5f('0x16')];this[_0x0e5f('0x18')]=getSeconds(_0x52eade[_0x0e5f('0x16')],_0x52eade[_0x0e5f('0x15')]);this['holdtime']=0x0;this[_0x0e5f('0x19')]=0x0;this['callback']=_0x52eade[_0x0e5f('0x1a')];this[_0x0e5f('0x1b')]=_0x52eade['callbackuniqueid'];this[_0x0e5f('0x1c')]=_0x52eade[_0x0e5f('0x1c')];this[_0x0e5f('0x1d')]=_0x52eade[_0x0e5f('0x1d')];this['ContactId']=_0x52eade[_0x0e5f('0x1e')];this[_0x0e5f('0x1f')]=_0x52eade[_0x0e5f('0x1f')];this[_0x0e5f('0x20')]=_0x52eade[_0x0e5f('0x20')];this[_0x0e5f('0x21')]=_0x52eade[_0x0e5f('0x21')];this[_0x0e5f('0x22')]=_0x52eade[_0x0e5f('0x22')];this[_0x0e5f('0x23')]=_0x52eade['originatecalleridnum']||'';this[_0x0e5f('0x24')]=_0x52eade[_0x0e5f('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0x008e=['countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x4e7c1a,_0x356c24){var _0xfe44dd=function(_0x21e29c){while(--_0x21e29c){_0x4e7c1a['push'](_0x4e7c1a['shift']());}};_0xfe44dd(++_0x356c24);}(_0x008e,0x1d1));var _0xe008=function(_0x209d36,_0x3eacb4){_0x209d36=_0x209d36-0x0;var _0x4067b0=_0x008e[_0x209d36];return _0x4067b0;};'use strict';var util=require(_0xe008('0x0'));var _=require(_0xe008('0x1'));var moment=require('moment');function getSeconds(_0x5e3625,_0x33b0c2){var _0x4ab08a=moment(_0x5e3625)['milliseconds'](0x0);var _0x56f465=moment(_0x33b0c2)[_0xe008('0x2')](0x0);return _0x4ab08a['diff'](_0x56f465,_0xe008('0x3'));}function History(_0x2cd7bc){this[_0xe008('0x4')]=_0x2cd7bc[_0xe008('0x4')];this[_0xe008('0x5')]=_0x2cd7bc[_0xe008('0x5')]||undefined;this[_0xe008('0x6')]=_0x2cd7bc['type'];this[_0xe008('0x7')]=_0x2cd7bc['type']===_0xe008('0x8')?_0xe008('0x9'):_0x2cd7bc[_0xe008('0x6')];this[_0xe008('0xa')]=_0x2cd7bc[_0xe008('0xa')];this[_0xe008('0xb')]=_0x2cd7bc[_0xe008('0xb')];this[_0xe008('0xc')]=_0x2cd7bc[_0xe008('0xc')];this['countglobal']=_0x2cd7bc['countbusyretry']+_0x2cd7bc[_0xe008('0xb')]+_0x2cd7bc['countnoanswerretry']+_0x2cd7bc[_0xe008('0xd')]+_0x2cd7bc['countdropretry']+_0x2cd7bc[_0xe008('0xe')]+_0x2cd7bc[_0xe008('0xf')]+_0x2cd7bc['countagentrejectretry'];this[_0xe008('0xd')]=_0x2cd7bc[_0xe008('0xd')];this['countdropretry']=_0x2cd7bc[_0xe008('0x10')];this[_0xe008('0xe')]=_0x2cd7bc[_0xe008('0xe')];this[_0xe008('0xf')]=_0x2cd7bc[_0xe008('0xf')];this[_0xe008('0x11')]=_0x2cd7bc[_0xe008('0x11')];this[_0xe008('0x9')]=_0x2cd7bc[_0xe008('0x9')];this[_0xe008('0x12')]=_0x2cd7bc['name'];this[_0xe008('0x13')]=_0x2cd7bc['number'];this[_0xe008('0x14')]=_0x2cd7bc[_0xe008('0x14')];this['responsetime']=_0x2cd7bc['responsetime'];this[_0xe008('0x15')]=_0x2cd7bc[_0xe008('0x16')];this[_0xe008('0x17')]=getSeconds(_0x2cd7bc[_0xe008('0x16')],_0x2cd7bc['starttime']);this[_0xe008('0x18')]=0x0;this[_0xe008('0x19')]=0x0;this[_0xe008('0x1a')]=_0x2cd7bc[_0xe008('0x1a')];this[_0xe008('0x1b')]=_0x2cd7bc[_0xe008('0x1b')];this[_0xe008('0x1c')]=_0x2cd7bc[_0xe008('0x1c')];this[_0xe008('0x1d')]=_0x2cd7bc[_0xe008('0x1d')];this[_0xe008('0x1e')]=_0x2cd7bc['ContactId'];this['ListId']=_0x2cd7bc[_0xe008('0x1f')];this[_0xe008('0x20')]=_0x2cd7bc[_0xe008('0x20')];this[_0xe008('0x21')]=_0x2cd7bc[_0xe008('0x21')];this[_0xe008('0x22')]=_0x2cd7bc[_0xe008('0x22')];this[_0xe008('0x23')]=_0x2cd7bc[_0xe008('0x23')]||'';this[_0xe008('0x24')]=_0x2cd7bc[_0xe008('0x24')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 8098557..39795a5 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 _0x37ee=['add','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','paused','stateinterface','locked','rrmemory','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','Failure','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','handleIvr','dialGlobalInterval','dialPreviewRecallmeReminder','syncCampaigns','dialTimezone','\x5cw{0,','pow','replace','random','match','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','stateGlobal','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','averageHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','abandonmentRate','[CatchErlangB]','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[countReScheduled]\x20','[getContactDialer2]','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','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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]','Ts\x20=\x20','Umin\x20=\x20','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','actions','enqueue','isNil','Action','status','channel','catch','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','trunks','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','minutes','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnoanswerretry','countagentrejectretry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropMaxRetry'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x37ee,0x103));var _0xe37e=function(_0x163115,_0x4d4207){_0x163115=_0x163115-0x0;var _0x53f6cf=_0x37ee[_0x163115];return _0x53f6cf;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xe37e('0x0'));var uuid=require(_0xe37e('0x1'));var moment=require(_0xe37e('0x2'));var rr=require('rr');var md5=require(_0xe37e('0x3'));var Redis=require(_0xe37e('0x4'));var ut=require('../preview/util/util');var config=require(_0xe37e('0x5'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xe37e('0x6'))(_0xe37e('0x7'));var loggerPredictive=require('../../../config/logger')(_0xe37e('0x8'));var loggerPredictiveCalls=require(_0xe37e('0x6'))(_0xe37e('0x9'));var loggerSyncQueueSummary=require(_0xe37e('0x6'))('syncQueueSummary');var ami=require(_0xe37e('0xa'));config[_0xe37e('0xb')]=_[_0xe37e('0xc')](config[_0xe37e('0xb')],{'host':_0xe37e('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xe37e('0xe'));var cmHopperHistory=require(_0xe37e('0xf'));var cmHopperBlack=require(_0xe37e('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xe37e('0x11'));var Action=require(_0xe37e('0x12'));var History=require(_0xe37e('0x13'));var Final=require(_0xe37e('0x14'));var AgentComplete=require(_0xe37e('0x15'));var QueueCallerAbandon=require(_0xe37e('0x16'));var Hangup=require(_0xe37e('0x17'));var ipAgi=process[_0xe37e('0x18')]['XCALLY_IP_AGI']||_0xe37e('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0xe37e('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe37e('0x1b')]['enqueue']=function(_0x13079a){this['tail']=this[_0xe37e('0x1c')]?this[_0xe37e('0x1c')][_0xe37e('0x1d')](_0x13079a):_0x13079a();};function Dialer(_0x4cd7c0,_0x3f80a6){this[_0xe37e('0x1e')]=new Sequence();this['preview']=_0x3f80a6;this[_0xe37e('0x1f')]=_0x4cd7c0[_0xe37e('0x1f')];this[_0xe37e('0x20')]=_0x4cd7c0['campaigns'];this['agents']=_0x4cd7c0[_0xe37e('0x21')];this['trunks']=_0x4cd7c0['trunks'];this['maxNumberOriginate']=config[_0xe37e('0x22')]||0x2;this[_0xe37e('0x23')]={};this['actions']={};this[_0xe37e('0x24')]={};this[_0xe37e('0x25')]={};this[_0xe37e('0x26')]={};this['startPredictive']={};this[_0xe37e('0x27')]={};this[_0xe37e('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xe37e('0x29')][_0xe37e('0x2a')](this));ami['on']('queuecallerabandon',this[_0xe37e('0x2b')][_0xe37e('0x2a')](this));ami['on'](_0xe37e('0x2c'),this[_0xe37e('0x2d')][_0xe37e('0x2a')](this));ami['on'](_0xe37e('0x2e'),this[_0xe37e('0x2f')]['bind'](this));ami['on']('custom:queuesummary',this[_0xe37e('0x30')][_0xe37e('0x2a')](this));ami['on'](_0xe37e('0x31'),this[_0xe37e('0x32')]['bind'](this));ami['on'](_0xe37e('0x33'),this['syncNewExten'][_0xe37e('0x2a')](this));ami['on'](_0xe37e('0x34'),this[_0xe37e('0x35')][_0xe37e('0x2a')](this));ami['on'](_0xe37e('0x36'),this[_0xe37e('0x37')][_0xe37e('0x2a')](this));ami['on'](_0xe37e('0x38'),this['syncQueueStatusComplete'][_0xe37e('0x2a')](this));this[_0xe37e('0x39')]();this[_0xe37e('0x3a')]();RpcSetting['getSettings']()['then'](function(_0x4599ed){previewRecallmeReminderInterval=_0x4599ed[_0xe37e('0x3b')];});}function isNotNull(_0x1fdbbc){return _0x1fdbbc!==null&&!_[_0xe37e('0x3c')](_0x1fdbbc);}function checkIsLoggedIn(_0x13037f,_0xd5a4a1){return function(){if(_0xd5a4a1<=0x0){_0x13037f['message']=_0xe37e('0x3d');throw _0x13037f[_0xe37e('0x3e')]+_0xe37e('0x3f');}};}function isActive(_0x4f6abb){return _0x4f6abb;}function checkIsActive(_0x259dda,_0x4ca5e4){return function(){if(!isActive(_0x4ca5e4)){_0x259dda[_0xe37e('0x40')]=_0xe37e('0x41');throw _0x259dda[_0xe37e('0x3e')]+_0xe37e('0x42');}};}function checkInterval(_0x4b8f85){return function(){if(!isNotNull(_0x4b8f85['Interval'])){_0x4b8f85[_0xe37e('0x40')]=_0xe37e('0x43');throw _0x4b8f85[_0xe37e('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4b8f85['Interval'][_0xe37e('0x44')])){_0x4b8f85[_0xe37e('0x40')]='INTERVAL_IS_NULL';throw _0x4b8f85[_0xe37e('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x4b8f85['Interval'][_0xe37e('0x44')]))){_0x4b8f85[_0xe37e('0x40')]=_0xe37e('0x43');throw _0x4b8f85[_0xe37e('0x3e')]+_0xe37e('0x45');}};}function msgResponse(_0x228b2e,_0x1a25bb,_0x51356a){return{'action':_0x228b2e,'response':_0x1a25bb,'message':_0x51356a,'stack':_0x51356a};}function myreject(_0x58d8c0){return function(_0x4d1c8b){return _0x58d8c0(msgResponse(_0xe37e('0x46'),_0xe37e('0x47'),JSON['stringify'](_0x4d1c8b)));};}function getSeconds(_0x39ff91,_0x3e34c3){var _0xe7c58=moment(_0x39ff91)[_0xe37e('0x48')](0x0);var _0x1aeb41=moment(_0x3e34c3)['milliseconds'](0x0);return _0xe7c58[_0xe37e('0x49')](_0x1aeb41,_0xe37e('0x4a'));}function emit(_0x3c8e64,_0x1e444c,_0x1e16ad){io['to'](_0x3c8e64)[_0xe37e('0x4b')](_0x1e444c,_0x1e16ad);}function emitVoiceQueueSummary(_0x4a7ff1){if(_0x4a7ff1[_0xe37e('0x4c')]===_0xe37e('0x4d')){var _0x2a502c={'id':_0x4a7ff1['id'],'name':_0x4a7ff1[_0xe37e('0x3e')],'strategy':_0x4a7ff1[_0xe37e('0x4e')],'answered':_0x4a7ff1[_0xe37e('0x4f')],'available':_0x4a7ff1[_0xe37e('0x50')],'loggedIn':_0x4a7ff1[_0xe37e('0x51')],'pTalking':_0x4a7ff1[_0xe37e('0x52')],'sumBillable':_0x4a7ff1['sumBillable'],'sumDuration':_0x4a7ff1[_0xe37e('0x53')],'sumHoldTime':_0x4a7ff1[_0xe37e('0x54')]||0x0,'talking':_0x4a7ff1[_0xe37e('0x55')],'total':_0x4a7ff1[_0xe37e('0x56')],'type':_0x4a7ff1[_0xe37e('0x4c')],'unmanaged':_0x4a7ff1['unmanaged'],'abandoned':_0x4a7ff1[_0xe37e('0x57')],'waiting':_0x4a7ff1[_0xe37e('0x58')],'loggedInDb':_0x4a7ff1[_0xe37e('0x59')],'dialActive':_0x4a7ff1[_0xe37e('0x5a')],'dialMethod':_0x4a7ff1[_0xe37e('0x5b')],'dialOriginateCallerIdName':_0x4a7ff1[_0xe37e('0x5c')],'dialOriginateCallerIdNumber':_0x4a7ff1[_0xe37e('0x5d')],'dialOriginateTimeout':_0x4a7ff1[_0xe37e('0x5e')],'dialPrefix':_0x4a7ff1[_0xe37e('0x5f')],'outboundAnswerAgiCallsDay':_0x4a7ff1[_0xe37e('0x60')],'outboundAnswerCallsDay':_0x4a7ff1['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4a7ff1[_0xe37e('0x61')],'outboundBusyCallsDay':_0x4a7ff1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4a7ff1[_0xe37e('0x62')],'outboundDropCallsDayACS':_0x4a7ff1[_0xe37e('0x63')],'outboundDropCallsDayCallersExit':_0x4a7ff1[_0xe37e('0x64')],'outboundDropCallsDayTimeout':_0x4a7ff1[_0xe37e('0x65')],'outboundNoAnswerCallsDay':_0x4a7ff1[_0xe37e('0x66')],'outboundNoSuchCallsDay':_0x4a7ff1[_0xe37e('0x67')],'outboundOriginateFailureCallsDay':_0x4a7ff1[_0xe37e('0x68')],'outboundReCallsDay':_0x4a7ff1[_0xe37e('0x69')],'outboundRejectCallsDay':_0x4a7ff1[_0xe37e('0x6a')],'outboundUnknownCallsDay':_0x4a7ff1[_0xe37e('0x6b')],'predictiveIntervalAnsweredCalls':_0x4a7ff1[_0xe37e('0x6c')],'predictiveIntervalAvgHoldtime':_0x4a7ff1[_0xe37e('0x6d')],'predictiveIntervalAvgTalktime':_0x4a7ff1[_0xe37e('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x4a7ff1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4a7ff1['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4a7ff1['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4a7ff1['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4a7ff1['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4a7ff1[_0xe37e('0x6f')],'predictiveIntervalPauses':_0x4a7ff1[_0xe37e('0x70')],'predictiveIntervalAvailable':_0x4a7ff1[_0xe37e('0x71')],'predictiveIntervalTotalCalls':_0x4a7ff1[_0xe37e('0x72')],'message':_0x4a7ff1[_0xe37e('0x40')],'originated':_0x4a7ff1[_0xe37e('0x73')],'erlangCalls':_0x4a7ff1[_0xe37e('0x74')],'erlangCallToSecond':_0x4a7ff1[_0xe37e('0x75')],'erlangAbandonmentRate':_0x4a7ff1[_0xe37e('0x76')],'erlangBusyFactor':_0x4a7ff1[_0xe37e('0x77')],'startPredictive':_0x4a7ff1['startPredictive'],'startProgressive':_0x4a7ff1[_0xe37e('0x27')]};if(_0x4a7ff1[_0xe37e('0x78')]){_0x2a502c[_0xe37e('0x78')]={'id':_0x4a7ff1['Trunk']['id'],'name':_0x4a7ff1[_0xe37e('0x78')][_0xe37e('0x3e')],'active':_0x4a7ff1[_0xe37e('0x78')][_0xe37e('0x79')],'callerid':_0x4a7ff1[_0xe37e('0x78')][_0xe37e('0x7a')]};}if(_0x4a7ff1[_0xe37e('0x7b')]){_0x2a502c[_0xe37e('0x7b')]={'id':_0x4a7ff1[_0xe37e('0x7b')]['id'],'name':_0x4a7ff1[_0xe37e('0x7b')]['name']};}var _0xd52894=md5(JSON[_0xe37e('0x7c')](_0x2a502c));if(_0x4a7ff1[_0xe37e('0x3')]!==_0xd52894){_0x4a7ff1[_0xe37e('0x3')]=_0xd52894;emit(util[_0xe37e('0x7d')](_0xe37e('0x7e'),_0x2a502c['name']),'voice_queue:save',_0x2a502c);}}}function emitCampaignSummary(_0x15de30){if(_0x15de30['type']==='ivr'){emit(util[_0xe37e('0x7d')](_0xe37e('0x7f'),_0x15de30[_0xe37e('0x3e')]),'campaign:save',_0x15de30);}}function checkGetDataPredictive(_0x1861d8){if(isNotNull(_0x1861d8)&&!_[_0xe37e('0x80')](_0x1861d8)){loggerPredictive[_0xe37e('0x81')](_0xe37e('0x82'));loggerPredictive[_0xe37e('0x81')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1861d8[_0xe37e('0x72')]);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x83'),_0x1861d8[_0xe37e('0x6c')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1861d8['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x84'),_0x1861d8['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x85'),_0x1861d8[_0xe37e('0x6d')]);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x86'),_0x1861d8[_0xe37e('0x6e')]);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x87'));if(_0x1861d8[_0xe37e('0x72')]>0x0){if(!_[_0xe37e('0x3c')](_0x1861d8[_0xe37e('0x6e')])&&_0x1861d8[_0xe37e('0x6e')]>0x0){return!![];}loggerPredictive[_0xe37e('0x81')](_0xe37e('0x88'));if(!_['isUndefined'](_0x1861d8[_0xe37e('0x6d')])&&_0x1861d8[_0xe37e('0x6d')]>0x0){return!![];}loggerPredictive[_0xe37e('0x81')](_0xe37e('0x89'));}else{loggerPredictive[_0xe37e('0x81')](_0xe37e('0x8a'));}}else{loggerPredictive[_0xe37e('0x81')](_0xe37e('0x8b'));}return![];}function mergeDataErlangB(_0x49791c){return function(_0x2bbec0){loggerPredictive[_0xe37e('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xe37e('0x81')](_0xe37e('0x8c'),_0x2bbec0[_0xe37e('0x74')]);loggerPredictive[_0xe37e('0x81')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bbec0[_0xe37e('0x75')]);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x8d'),_0x2bbec0['erlangAbandonmentRate']);loggerPredictive[_0xe37e('0x81')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bbec0[_0xe37e('0x77')]);loggerPredictive['info'](_0xe37e('0x8d'),_0x2bbec0[_0xe37e('0x76')]);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x87'));_[_0xe37e('0x8e')](_0x49791c,_0x2bbec0);};}function getDiff(_0x292997){var _0x42d37a=moment()['milliseconds'](0x0);var _0x57773d=moment(_0x292997)[_0xe37e('0x48')](0x0);return _0x42d37a[_0xe37e('0x49')](_0x57773d,'seconds');}function ifInterval(_0x43eab1,_0x1ecf45){if(_[_0xe37e('0x3c')](_0x1ecf45)){return![];}return getDiff(_0x1ecf45)<_0x43eab1*0x3c;}function freeVariablesPredictive(_0x865f97){if(isNotNull(_0x865f97)){if(!_[_0xe37e('0x3c')](_0x865f97[_0xe37e('0x27')])){_0x865f97[_0xe37e('0x27')]=undefined;loggerPredictive[_0xe37e('0x81')](_0x865f97[_0xe37e('0x3e')],_0xe37e('0x8f'));}if(!_[_0xe37e('0x3c')](_0x865f97['startPredictive'])){_0x865f97[_0xe37e('0x90')]=undefined;loggerPredictive[_0xe37e('0x81')](_0x865f97[_0xe37e('0x3e')],_0xe37e('0x91'));}if(!_[_0xe37e('0x3c')](_0x865f97['handlePredictive'])){clearInterval(_0x865f97[_0xe37e('0x92')]);_0x865f97[_0xe37e('0x92')]=undefined;loggerPredictive[_0xe37e('0x81')](_0x865f97[_0xe37e('0x3e')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x400d04,_0x16815b){if(_0x16815b===0x0){return 0x0;}var _0x403451=0x1;for(var _0xa10a36=0x1;_0xa10a36<=_0x16815b;_0xa10a36+=0x1){_0x403451=0x1+_0x403451*_0xa10a36/_0x400d04;}return 0x1/_0x403451;}function isVoiceQueueOutbound(_0x2ff591){return _0x2ff591==='outbound';}function isNotPreview(_0x15ee86){return _0x15ee86!==_0xe37e('0x93');}function isCampaignIvr(_0x47069b){return _0x47069b==='ivr';}function getCallerId(_0x3ac8ad,_0x584702,_0x3a2773){if(!_[_0xe37e('0x3c')](_0x3a2773)&&typeof _0x3a2773===_0xe37e('0x94')&&!_['isEmpty'](_0x3a2773)){if(!_['isUndefined'](_0x584702)&&typeof _0x584702===_0xe37e('0x94')&&!_['isEmpty'](_0x584702)){return util[_0xe37e('0x7d')](_0xe37e('0x95'),_0x584702,_0x3a2773);}return util[_0xe37e('0x7d')](_0xe37e('0x95'),_0x3a2773,_0x3a2773);}if(!_[_0xe37e('0x3c')](_0x3ac8ad)&&typeof _0x3ac8ad==='string'&&!_[_0xe37e('0x80')](_0x3ac8ad)){return _0x3ac8ad;}return _0xe37e('0x96');}function loggerCatchQueueSummary(_0x1a0472,_0x120802){return function(_0x1e2279){freeVariablesPredictive(_0x120802);emitVoiceQueueSummary(_0x120802);emitCampaignSummary(_0x120802);loggerSyncQueueSummary[_0xe37e('0x97')](_0x1a0472,util[_0xe37e('0x98')](_0x1e2279,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x480190,_0x52fb6c){return function(_0xe6c856){loggerPredictive[_0xe37e('0x97')](_0x52fb6c[_0xe37e('0x3e')],_0x480190);loggerPredictive['error'](_0xe6c856['stack']);freeVariablesPredictive(_0x52fb6c);};}function loggerCatch(_0x3ae14c){return function(_0xce12f1){logger[_0xe37e('0x97')](_0x3ae14c,util[_0xe37e('0x98')](_0xce12f1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x48ae1f){return _0x48ae1f&&!_[_0xe37e('0x3c')](_0x48ae1f)&&_0x48ae1f[_0xe37e('0x99')]>0x0;}function decremetOriginate(_0x10ade0){if(!_['isUndefined'](_0x10ade0)&&_0x10ade0!==null){if(typeof _0x10ade0[_0xe37e('0x73')]!==_0xe37e('0x9a')){if(_0x10ade0['originated']>0x0){_0x10ade0[_0xe37e('0x73')]-=0x1;}else{logger[_0xe37e('0x97')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xe37e('0x97')](_0xe37e('0x9b'));}}function checkContactLowerLimitOriginate(_0x462b6d,_0x1d1d46,_0x49541c){if(_0x1d1d46>_0x49541c){for(var _0x4d162c=0x0;_0x4d162c<_0x1d1d46-_0x49541c;_0x4d162c+=0x1){decremetOriginate(_0x462b6d);}}}function loggerGetContactDialer(_0x20aeeb,_0x49a959,_0x274e85){return function(_0x1d9d8){checkContactLowerLimitOriginate(_0x49a959,_0x274e85,0x0);logger['error'](_0x20aeeb,util['inspect'](_0x1d9d8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2475a4){return function(_0x3ea6d0){if(isNotNull(_0x3ea6d0)&&isNotNull(_0x3ea6d0[0x0])){if(_0x3ea6d0[0x0][_0xe37e('0x9c')]>0x0){_0x2475a4['message']=_0xe37e('0x9d');logger['info'](_0xe37e('0x9e')+_0x2475a4['name'],_0x3ea6d0[0x0]['contactsRescheduled'],_0xe37e('0x9f'));}else{_0x2475a4[_0xe37e('0x40')]='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactDialer2][Empty]'+_0x2475a4[_0xe37e('0x3e')]);}}};}function notSendMessagesQueue(_0x1ffbf7){if(_0x1ffbf7[_0xe37e('0xa0')]){freeVariablesPredictive(_0x1ffbf7);if(_0x1ffbf7['originated']===0x0&&_0x1ffbf7[_0xe37e('0x55')]===0x0&&_0x1ffbf7['waiting']===0x0&&(_0x1ffbf7['pTalking']||0x0)===0x0){_0x1ffbf7['sendMessageOneNotActive']=![];_0x1ffbf7[_0xe37e('0x50')]=0x0;_0x1ffbf7['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xe37e('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1ffbf7[_0xe37e('0x3e')],_0xe37e('0xa1'));}else{_0x1ffbf7['message']=_0xe37e('0xa2');loggerSyncQueueSummary['error'](_0xe37e('0xa3'),_0x1ffbf7['name'],_0xe37e('0xa4'));}emitVoiceQueueSummary(_0x1ffbf7);}}function notSendMessagesCampaign(_0x2da7fc){if(_0x2da7fc[_0xe37e('0xa0')]){if(_0x2da7fc[_0xe37e('0x73')]===0x0){_0x2da7fc['sendMessageOneNotActive']=![];_0x2da7fc[_0xe37e('0x40')]=_0xe37e('0x41');loggerSyncQueueSummary[_0xe37e('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2da7fc[_0xe37e('0x3e')],_0xe37e('0xa1'));}else{_0x2da7fc[_0xe37e('0x40')]=_0xe37e('0xa2');loggerSyncQueueSummary[_0xe37e('0x97')](_0xe37e('0xa5'),_0x2da7fc[_0xe37e('0x3e')],_0xe37e('0xa4'));}emitCampaignSummary(_0x2da7fc);}}function createObjHistory(_0x291a48,_0x2b531f,_0x28e7d3,_0x2dba4a,_0x207a83){_0x291a48['message']=_0x28e7d3;var _0x342256=new Action(_0x291a48,_0x2b531f);var _0x3b15b4=new History(_0x342256);_0x3b15b4[_0xe37e('0xa6')]=_0x2dba4a;_0x3b15b4[_0xe37e('0xa7')]=_0x207a83;_0x3b15b4[_0xe37e('0xa8')]=_0x342256[_0xe37e('0xa9')];return _0x3b15b4;}Dialer[_0xe37e('0x1b')]['loopClearZombieChannels']=function(){var _0x132fd8=this;setInterval(function(){_0x132fd8[_0xe37e('0xaa')](_0x132fd8[_0xe37e('0x25')],_0xe37e('0xab'));_0x132fd8[_0xe37e('0xaa')](_0x132fd8[_0xe37e('0xac')],'[actions]');},0x32c8);};Dialer[_0xe37e('0x1b')][_0xe37e('0xaa')]=function(_0xec208b,_0x2497d6){var _0x529232=this;for(var _0x32f681 in _0xec208b){if(typeof _0xec208b[_0x32f681]!==_0xe37e('0x9a')){this[_0xe37e('0x1e')][_0xe37e('0xad')](function(){if(!_[_0xe37e('0xae')](_0xec208b[_0x32f681])){return ami[_0xe37e('0xaf')]({'action':_0xe37e('0xb0'),'channel':_0xec208b[_0x32f681][_0xe37e('0xb1')]})[_0xe37e('0xb2')](function(_0x32e694){if(_0x32e694[_0xe37e('0x40')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xec208b[_0x32f681]&&_0xec208b[_0x32f681][_0xe37e('0x4c')]!==_0xe37e('0xb3')){_0x529232[_0xe37e('0xb4')](_0x529232['voiceQueues'][_0xec208b[_0x32f681][_0xe37e('0xb5')]]);logger[_0xe37e('0x97')](_0xe37e('0xb6'),_0x2497d6,_0x32f681,_0xec208b[_0x32f681][_0xe37e('0xb5')]);delete _0xec208b[_0x32f681];}if(_0xec208b[_0x32f681]&&_0xec208b[_0x32f681][_0xe37e('0x4c')]===_0xe37e('0xb3')){_0x529232[_0xe37e('0xb4')](_0x529232['campaigns'][_0xec208b[_0x32f681][_0xe37e('0xb5')]]);logger[_0xe37e('0x97')](_0xe37e('0xb7'),_0x2497d6,_0x32f681,_0xec208b[_0x32f681][_0xe37e('0xb5')]);delete _0xec208b[_0x32f681];}},0x2328);}});}});}}};Dialer['prototype'][_0xe37e('0xb8')]=function(_0x40285b){return BPromise[_0xe37e('0xb9')]()['then'](cmHopper[_0xe37e('0xb8')](_0x40285b))[_0xe37e('0xb2')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xe37e('0x1b')]['checkIsBlackList']=function(_0x963aa9){return BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](cmHopperBlack[_0xe37e('0xbb')](_0x963aa9))[_0xe37e('0xb2')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xe37e('0x1b')][_0xe37e('0xbc')]=function(_0x4f3aad){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x4f3aad))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xbd')));};Dialer[_0xe37e('0x1b')]['averageHandleTime']=function(_0x1fd7ff){return BPromise[_0xe37e('0xb9')]()['then'](cmHopperHistory[_0xe37e('0xbe')](_0x1fd7ff))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xbf')));};Dialer[_0xe37e('0x1b')][_0xe37e('0xc0')]=function(_0x15744d){return BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](cmHopper[_0xe37e('0xc0')](_0x15744d))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xc1')));};Dialer['prototype'][_0xe37e('0xc2')]=function(_0x2c1f16,_0x37d156,_0x23dd11){return BPromise['resolve']()[_0xe37e('0xba')](cmHopper[_0xe37e('0xc2')](_0x2c1f16,_0x37d156,_0x23dd11))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xc3')));};Dialer['prototype'][_0xe37e('0xc4')]=function(_0x5bfa0a,_0x5bdf67,_0x1a2e0f,_0x3c512c,_0x464360){return BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](cmHopper[_0xe37e('0xc4')](_0x5bfa0a,_0x5bdf67,_0x1a2e0f,_0x3c512c))[_0xe37e('0xb2')](function(_0x31948b){_0x464360[_0xe37e('0xc5')]-=_0x1a2e0f;_0x464360[_0xe37e('0xc5')]=_0x464360[_0xe37e('0xc5')]>0x0?_0x464360[_0xe37e('0xc5')]:0x0;loggerCatch(_0xe37e('0xc6'))(_0x31948b);});};Dialer[_0xe37e('0x1b')][_0xe37e('0xc7')]=function(_0x21d051,_0xfa19ff,_0x3b01b5,_0xf34ac6){return BPromise[_0xe37e('0xb9')]()['then'](cmHopper[_0xe37e('0xc7')](_0x21d051,_0xfa19ff,_0x3b01b5))[_0xe37e('0xb2')](function(_0x5c7d0f){_0xf34ac6['temp']-=_0xfa19ff;_0xf34ac6['temp']=_0xf34ac6[_0xe37e('0xc5')]>0x0?_0xf34ac6[_0xe37e('0xc5')]:0x0;loggerCatch(_0xe37e('0xc8'))(_0x5c7d0f);});};Dialer[_0xe37e('0x1b')]['getVoiceQueueRtPauses']=function(_0x50f8a2){return BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](voiceQueueRt[_0xe37e('0xc9')](_0x50f8a2))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xca')));};Dialer[_0xe37e('0x1b')][_0xe37e('0xcb')]=function(_0x876685){return BPromise[_0xe37e('0xb9')]()['then'](cmHopper[_0xe37e('0xcb')](_0x876685))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xcc')));};Dialer[_0xe37e('0x1b')][_0xe37e('0xcd')]=function(_0x2b0598){return BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](cmHopperHistory[_0xe37e('0xcd')](_0x2b0598))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xce')));};Dialer[_0xe37e('0x1b')][_0xe37e('0xb4')]=function(_0x6ae65b){if(!_[_0xe37e('0x3c')](_0x6ae65b)&&_0x6ae65b!==null){if(typeof _0x6ae65b[_0xe37e('0x73')]!==_0xe37e('0x9a')){if(_0x6ae65b[_0xe37e('0x73')]>0x0){_0x6ae65b[_0xe37e('0x73')]-=0x1;}else{logger[_0xe37e('0x97')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xe37e('0x97')](_0xe37e('0xcf'));}};Dialer[_0xe37e('0x1b')][_0xe37e('0xd0')]=function(_0x5a818d,_0x59e770){var _0x35ac94=this;return function(_0xdf9d6e){_0x35ac94[_0xe37e('0xb4')](_0x59e770);logger['error'](_0x5a818d,util['inspect'](_0xdf9d6e,{'showHidden':![],'depth':null}));};};Dialer[_0xe37e('0x1b')][_0xe37e('0xd1')]=function(_0x4a3dc4,_0xa34662,_0x297a04){var _0x5c3577={'state':0x19,'statedesc':_0xe37e('0xd2')};this[_0xe37e('0xb4')](_0xa34662);this[_0xe37e('0xd3')](_[_0xe37e('0x8e')](_0x5c3577,_[_0xe37e('0xd4')](_0x297a04,[_0xe37e('0xd5'),_0xe37e('0xd6'),_0xe37e('0xd7'),_0xe37e('0xd8'),_0xe37e('0xd9')])),_0xe37e('0xda'),_0xe37e('0xdb'));logger[_0xe37e('0x97')](_0x4a3dc4);};Dialer[_0xe37e('0x1b')][_0xe37e('0xdc')]=function(_0x4de5b5){return _0x4de5b5===_0xe37e('0xdd');};Dialer[_0xe37e('0x1b')]['isTrunkReachable']=function(_0x230fd0){return!_[_0xe37e('0x3c')](_0x230fd0)&&_0x230fd0&&!_[_0xe37e('0x3c')](_0x230fd0[_0xe37e('0x3e')])&&!_[_0xe37e('0x3c')](_0x230fd0['active'])&&_0x230fd0['active']&&(this[_0xe37e('0xde')][util['format'](_0xe37e('0xdf'),_0x230fd0['name'])][_0xe37e('0xb0')]==='reachable'||this[_0xe37e('0xde')][util[_0xe37e('0x7d')](_0xe37e('0xdf'),_0x230fd0[_0xe37e('0x3e')])][_0xe37e('0xb0')]==='unmonitored');};Dialer['prototype']['saveInDb']=function(_0x337163,_0x511d70,_0x88dc1){this[_0xe37e('0xcd')](_0x337163)[_0xe37e('0xb2')](loggerCatch(_0x511d70));this[_0xe37e('0xcb')](_0x337163)[_0xe37e('0xb2')](loggerCatch(_0x88dc1));};Dialer[_0xe37e('0x1b')][_0xe37e('0x35')]=function(_0x533522){var _0x4379dc=this[_0xe37e('0x25')][_0x533522[_0xe37e('0xe0')]];var _0x5cfb13;if(!_['isNil'](_0x533522)&&!_[_0xe37e('0xae')](_0x533522[_0xe37e('0xe1')])&&!_[_0xe37e('0xae')](_0x533522[_0xe37e('0xe1')][_0xe37e('0xe2')])&&_0x533522[_0xe37e('0xe3')]===_0xe37e('0xe4')&&_0x4379dc){if(_0x4379dc[_0xe37e('0x4c')]!=='ivr'&&this[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]]['dialAMDActive']&&_0x533522[_0xe37e('0xe5')]===_0xe37e('0xe6')){delete this[_0xe37e('0x25')][_0x533522['uniqueid']];this[_0xe37e('0xb4')](this[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]]);this['voiceQueues'][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0xe7')]+=0x1;this[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0x60')]+=0x1;_0x5cfb13=new Hangup(_0x4379dc,_0x533522);_0x5cfb13[_0xe37e('0xa6')]=0x12;_0x5cfb13[_0xe37e('0xa7')]=_0xe37e('0xe8');_0x5cfb13[_0xe37e('0xe9')]=_0xe37e('0xea');ami[_0xe37e('0x4b')](_0xe37e('0xeb'),ut['buildObj'](_0x5cfb13,_0xe37e('0xec')));this['saveInDb'](_0x5cfb13,_0xe37e('0xed'),_0xe37e('0xee'));}if(_0x4379dc[_0xe37e('0x4c')]!==_0xe37e('0xb3')&&this[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0xef')]&&_0x533522[_0xe37e('0xe5')]===_0xe37e('0xf0')){var _0x1c8e80=this;return new BPromise(function(_0x5c4265,_0x156ef4){delete _0x1c8e80['uniqueId'][_0x533522[_0xe37e('0xe0')]];_0x1c8e80[_0xe37e('0xb4')](_0x1c8e80[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]]);_0x1c8e80[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0xe7')]+=0x1;_0x1c8e80[_0xe37e('0x1f')][_0x4379dc['queue']][_0xe37e('0x60')]+=0x1;var _0x241b93=_0x1c8e80[_0xe37e('0x1f')][_0x4379dc[_0xe37e('0xb5')]];var _0x592453=new Hangup(_0x4379dc,_0x533522);_0x592453[_0xe37e('0xa6')]=0x13;_0x592453[_0xe37e('0xa7')]=_0xe37e('0xf1');_0x592453[_0xe37e('0xe9')]=_0xe37e('0xea');_0x592453[_0xe37e('0xf2')]+=0x1;_0x592453[_0xe37e('0xf3')]+=0x1;_0x592453[_0xe37e('0xec')]=!![];ami[_0xe37e('0x4b')]('custom:amd',ut['buildObj'](_0x592453,_0xe37e('0xec')));_0x1c8e80[_0xe37e('0xcd')](_0x592453)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xf4')));if(_0x592453[_0xe37e('0xf5')]+_0x592453['countcongestionretry']+_0x592453['countnoanswerretry']+_0x592453[_0xe37e('0xf6')]+_0x592453[_0xe37e('0xf7')]+_0x592453[_0xe37e('0xf8')]+_0x592453[_0xe37e('0xf2')]+_0x592453['countagentrejectretry']>=_0x241b93[_0xe37e('0xf9')]){_0x1c8e80['stateGlobal'](_0x592453,_0x5c4265,_0x156ef4,_0xe37e('0xfa'));}else{if(_0x592453[_0xe37e('0xf2')]>=_0x241b93[_0xe37e('0xfb')]){_0x1c8e80[_0xe37e('0xfc')](_0x592453,_0x5c4265,_0x156ef4,_0xe37e('0xfd'));}else{_0x1c8e80['rescheduleContact']({'active':![],'countmachineretry':_0x592453['countmachineretry'],'scheduledat':moment()['add'](_0x241b93['dialMachineRetryFrequency'],_0xe37e('0xfe'))[_0xe37e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x592453[_0xe37e('0xd5')],'ListId':_0x592453['ListId'],'VoiceQueueId':_0x592453[_0xe37e('0xd8')]||undefined,'CampaignId':_0x592453[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xff')));_0x5c4265({'reschedule':0x1});}}});}if(_0x4379dc[_0xe37e('0x4c')]==='ivr'&&this[_0xe37e('0x20')][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0xef')]&&_0x533522[_0xe37e('0xe5')]===_0xe37e('0xe6')){delete this[_0xe37e('0x25')][_0x533522[_0xe37e('0xe0')]];this[_0xe37e('0xb4')](this[_0xe37e('0x20')][_0x4379dc[_0xe37e('0xb5')]]);_0x5cfb13=new Hangup(_0x4379dc,_0x533522);_0x5cfb13[_0xe37e('0xa6')]=0x12;_0x5cfb13[_0xe37e('0xa7')]=_0xe37e('0xe8');_0x5cfb13[_0xe37e('0xe9')]=_0xe37e('0xea');ami[_0xe37e('0x4b')](_0xe37e('0xeb'),ut[_0xe37e('0x100')](_0x5cfb13,_0xe37e('0xec')));this['saveInDb'](_0x5cfb13,_0xe37e('0x101'),_0xe37e('0x102'));}if(_0x4379dc[_0xe37e('0x4c')]===_0xe37e('0xb3')&&this[_0xe37e('0x20')][_0x4379dc['queue']]['dialAMDActive']&&_0x533522[_0xe37e('0xe5')]===_0xe37e('0xf0')){var _0x1c8e80=this;return new BPromise(function(_0x5c26f0,_0x11e29f){delete _0x1c8e80['uniqueId'][_0x533522[_0xe37e('0xe0')]];_0x1c8e80[_0xe37e('0xb4')](_0x1c8e80['campaigns'][_0x4379dc[_0xe37e('0xb5')]]);_0x1c8e80[_0xe37e('0x20')][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0xe7')]+=0x1;_0x1c8e80[_0xe37e('0x20')][_0x4379dc[_0xe37e('0xb5')]][_0xe37e('0x60')]+=0x1;var _0x4aa606=_0x1c8e80[_0xe37e('0x20')][_0x4379dc[_0xe37e('0xb5')]];var _0x35e3f9=new Hangup(_0x4379dc,_0x533522);_0x35e3f9[_0xe37e('0xa6')]=0x13;_0x35e3f9[_0xe37e('0xa7')]='Machine';_0x35e3f9[_0xe37e('0xe9')]=_0xe37e('0xea');_0x35e3f9[_0xe37e('0xf2')]+=0x1;_0x35e3f9['countglobal']+=0x1;_0x35e3f9[_0xe37e('0xec')]=!![];ami[_0xe37e('0x4b')](_0xe37e('0xeb'),ut[_0xe37e('0x100')](_0x35e3f9,_0xe37e('0xec')));_0x1c8e80['createHistory'](_0x35e3f9)['catch'](loggerCatch(_0xe37e('0xf4')));if(_0x35e3f9[_0xe37e('0xf5')]+_0x35e3f9['countcongestionretry']+_0x35e3f9[_0xe37e('0x103')]+_0x35e3f9[_0xe37e('0xf6')]+_0x35e3f9[_0xe37e('0xf7')]+_0x35e3f9[_0xe37e('0xf8')]+_0x35e3f9[_0xe37e('0xf2')]+_0x35e3f9[_0xe37e('0x104')]>=_0x4aa606['dialGlobalMaxRetry']){_0x1c8e80['stateGlobal'](_0x35e3f9,_0x5c26f0,_0x11e29f,_0xe37e('0xfa'));}else{if(_0x35e3f9[_0xe37e('0xf2')]>=_0x4aa606[_0xe37e('0xfb')]){_0x1c8e80[_0xe37e('0xfc')](_0x35e3f9,_0x5c26f0,_0x11e29f,_0xe37e('0xfd'));}else{_0x1c8e80['rescheduleContact']({'active':![],'countmachineretry':_0x35e3f9[_0xe37e('0xf2')],'scheduledat':moment()['add'](_0x4aa606[_0xe37e('0x105')],_0xe37e('0xfe'))[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x35e3f9[_0xe37e('0xd5')],'ListId':_0x35e3f9[_0xe37e('0xd6')],'VoiceQueueId':_0x35e3f9[_0xe37e('0xd8')]||undefined,'CampaignId':_0x35e3f9[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xff')));_0x5c26f0({'reschedule':0x1});}}});}}};Dialer[_0xe37e('0x1b')][_0xe37e('0x32')]=function(_0x1839a4){var _0x545720=this[_0xe37e('0x25')][_0x1839a4['uniqueid']];var _0x1b0397=this;var _0x1c89b0;if(_0x545720&&_0x545720[_0xe37e('0x4c')]===_0xe37e('0xb3')){delete this[_0xe37e('0x25')][_0x1839a4[_0xe37e('0xe0')]];this['updateOriginated'](this[_0xe37e('0x20')][_0x545720[_0xe37e('0xb5')]]);this['campaigns'][_0x545720[_0xe37e('0xb5')]][_0xe37e('0x107')]+=0x1;_0x1c89b0=new Hangup(_0x545720,_0x1839a4);this[_0xe37e('0xcd')](_0x1c89b0)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x108')));this[_0xe37e('0xcb')](_0x1c89b0)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x109')));}if(_0x545720&&_0x545720[_0xe37e('0x4c')]!==_0xe37e('0xb3')&&isNotNull(this[_0xe37e('0x1f')][_0x545720[_0xe37e('0xb5')]][_0xe37e('0x10a')])){delete this[_0xe37e('0x25')][_0x1839a4[_0xe37e('0xe0')]];this[_0xe37e('0xb4')](this[_0xe37e('0x1f')][_0x545720[_0xe37e('0xb5')]]);this[_0xe37e('0x1f')][_0x545720[_0xe37e('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0xe37e('0x1f')][_0x545720['queue']][_0xe37e('0x60')]+=0x1;_0x1c89b0=new Hangup(_0x545720,_0x1839a4);_0x1c89b0[_0xe37e('0xa6')]=0x10;_0x1c89b0[_0xe37e('0xa7')]=_0xe37e('0x10b');_0x1c89b0[_0xe37e('0xe9')]='AGI';this[_0xe37e('0xcd')](_0x1c89b0)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x1c89b0)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x109')));}if(_0x545720&&_0x545720['type']!==_0xe37e('0xb3')&&!isNotNull(this[_0xe37e('0x1f')][_0x545720['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x1839a4['uniqueid']];this[_0xe37e('0xb4')](this['voiceQueues'][_0x545720['queue']]);this[_0xe37e('0x1f')][_0x545720[_0xe37e('0xb5')]][_0xe37e('0x6b')]+=0x1;_0x1c89b0=new Hangup(_0x545720,_0x1839a4);_0x1c89b0['state']=0xc;_0x1c89b0[_0xe37e('0xa7')]=_0x1839a4['cause-txt'];_0x1c89b0[_0xe37e('0xe9')]=_0xe37e('0x10c');this[_0xe37e('0xcd')](_0x1c89b0)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xe37e('0xcb')](_0x1c89b0)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x109')));}};Dialer['prototype'][_0xe37e('0x2f')]=function(_0x1c4592){var _0x248c56=this[_0xe37e('0x25')][_0x1c4592[_0xe37e('0xe0')]];var _0x55a42c=this;if(this[_0xe37e('0x1f')][_0x1c4592[_0xe37e('0xb5')]]){if(_0x248c56&&_0x248c56[_0xe37e('0x4c')]!==_0xe37e('0xb3')){delete this[_0xe37e('0x25')][_0x1c4592[_0xe37e('0xe0')]];this[_0xe37e('0x1f')][_0x1c4592['queue']][_0xe37e('0xe7')]+=0x1;var _0x387212=new AgentComplete(_0x248c56,_0x1c4592);if(_0x1c4592[_0xe37e('0x10d')]===_0xe37e('0x10e')){_0x387212[_0xe37e('0x10f')]=this['voiceQueues'][_0x1c4592[_0xe37e('0xb5')]][_0xe37e('0x110')]&&this[_0xe37e('0x1f')][_0x1c4592[_0xe37e('0xb5')]][_0xe37e('0x111')]?moment()[_0xe37e('0x7d')](_0xe37e('0x106')):undefined;}this['createHistory'](_0x387212)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x112')));this[_0xe37e('0xcb')](_0x387212)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x113')));}}};Dialer[_0xe37e('0x1b')][_0xe37e('0x29')]=function(_0x465ba7){if(this['voiceQueues'][_0x465ba7[_0xe37e('0xb5')]]){if(this[_0xe37e('0x25')][_0x465ba7[_0xe37e('0xe0')]]&&this[_0xe37e('0x25')][_0x465ba7[_0xe37e('0xe0')]][_0xe37e('0x4c')]!==_0xe37e('0xb3')){this['updateOriginated'](this[_0xe37e('0x1f')][_0x465ba7['queue']]);this['uniqueId'][_0x465ba7[_0xe37e('0xe0')]]['answertime']=moment()[_0xe37e('0x7d')](_0xe37e('0x106'));}}};Dialer[_0xe37e('0x1b')][_0xe37e('0x114')]=function(_0x48cfbd){this['createHistory'](_0x48cfbd)['catch'](loggerCatch(_0xe37e('0x112')));this[_0xe37e('0xcb')](_0x48cfbd)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x115')));};Dialer['prototype'][_0xe37e('0x2b')]=function(_0x3cc60b){var _0x56a2b2=this[_0xe37e('0x25')][_0x3cc60b[_0xe37e('0xe0')]];var _0x134d67=this;if(this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]]){if(_0x56a2b2&&_0x56a2b2[_0xe37e('0x4c')]!=='ivr'){delete this[_0xe37e('0x25')][_0x3cc60b[_0xe37e('0xe0')]];this[_0xe37e('0xb4')](this[_0xe37e('0x1f')][_0x3cc60b['queue']]);_0x56a2b2[_0xe37e('0x116')]=moment()[_0xe37e('0x7d')](_0xe37e('0x106'));var _0x4c7f7e=new QueueCallerAbandon(_0x56a2b2,_0x3cc60b);if(getSeconds(_0x56a2b2[_0xe37e('0x116')],_0x56a2b2['responsetime'])>=_0x56a2b2[_0xe37e('0x117')]){this['voiceQueues'][_0x3cc60b[_0xe37e('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]][_0xe37e('0x65')]+=0x1;this[_0xe37e('0x1f')][_0x3cc60b['queue']][_0xe37e('0x118')]+=0x1;_0x4c7f7e['state']=0xa;_0x4c7f7e[_0xe37e('0xa7')]=_0xe37e('0x119');_0x4c7f7e[_0xe37e('0x11a')]=_0xe37e('0x11b');_0x4c7f7e[_0xe37e('0x10f')]=this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]][_0xe37e('0x110')]?moment()['format'](_0xe37e('0x106')):undefined;_0x4c7f7e[_0xe37e('0xf7')]+=0x1;_0x4c7f7e[_0xe37e('0xf3')]+=0x1;if(_0x4c7f7e[_0xe37e('0xf7')]>=this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]][_0xe37e('0x11c')]){this['queueCallerAbandonCreateState'](_0x4c7f7e);}else{this[_0xe37e('0xc0')]({'active':![],'countdropretry':_0x4c7f7e[_0xe37e('0xf7')],'scheduledat':moment()[_0xe37e('0x11d')](this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]][_0xe37e('0x11e')],_0xe37e('0xfe'))[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x56a2b2[_0xe37e('0xd5')],'ListId':_0x56a2b2[_0xe37e('0xd6')],'VoiceQueueId':_0x56a2b2[_0xe37e('0xd8')]||undefined,'CampaignId':_0x56a2b2[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x11f')));var _0x480165=new History(_0x4c7f7e);_0x480165[_0xe37e('0xa6')]=0xa;_0x480165[_0xe37e('0xa7')]=_0xe37e('0x119');_0x480165[_0xe37e('0xa9')]=moment()['format'](_0xe37e('0x106'));_0x480165[_0xe37e('0xa8')]=_0x480165[_0xe37e('0xa9')];_0x480165[_0xe37e('0x120')]=_0x4c7f7e[_0xe37e('0x120')];_0x480165[_0xe37e('0x121')]=_0x4c7f7e[_0xe37e('0x121')];this['createHistory'](_0x480165)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x122')));}}else{this[_0xe37e('0x1f')][_0x3cc60b['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]][_0xe37e('0x64')]+=0x1;_0x4c7f7e[_0xe37e('0xa6')]=0xb;_0x4c7f7e[_0xe37e('0xa7')]=_0xe37e('0x123');_0x4c7f7e[_0xe37e('0x11a')]=_0xe37e('0x124');_0x4c7f7e['countabandonedretry']+=0x1;_0x4c7f7e[_0xe37e('0xf3')]+=0x1;if(_0x4c7f7e[_0xe37e('0xf8')]>=this[_0xe37e('0x1f')][_0x3cc60b['queue']][_0xe37e('0x125')]){this['queueCallerAbandonCreateState'](_0x4c7f7e);}else{this[_0xe37e('0xc0')]({'active':![],'countabandonedretry':_0x4c7f7e[_0xe37e('0xf8')],'scheduledat':moment()['add'](this[_0xe37e('0x1f')][_0x3cc60b[_0xe37e('0xb5')]]['dialAbandonedRetryFrequency'],'minutes')[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x56a2b2[_0xe37e('0xd5')],'ListId':_0x56a2b2[_0xe37e('0xd6')],'VoiceQueueId':_0x56a2b2[_0xe37e('0xd8')]||undefined,'CampaignId':_0x56a2b2[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x126')));var _0x480165=new History(_0x4c7f7e);_0x480165[_0xe37e('0xa6')]=0xb;_0x480165[_0xe37e('0xa7')]=_0xe37e('0x123');_0x480165[_0xe37e('0xa9')]=moment()[_0xe37e('0x7d')](_0xe37e('0x106'));_0x480165['endtime']=_0x480165['starttime'];_0x480165[_0xe37e('0x120')]=_0x4c7f7e[_0xe37e('0x120')];_0x480165[_0xe37e('0x121')]=_0x4c7f7e[_0xe37e('0x121')];this['createHistory'](_0x480165)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x127')));}}}}};Dialer[_0xe37e('0x1b')][_0xe37e('0x128')]=function(_0x544869){if(this[_0xe37e('0xac')][_0x544869[_0xe37e('0xe0')]]){this[_0xe37e('0xac')][_0x544869[_0xe37e('0xe0')]][_0xe37e('0xb1')]=_0x544869[_0xe37e('0xb1')];}if(this[_0xe37e('0x25')][_0x544869['uniqueid']]){this[_0xe37e('0x25')][_0x544869[_0xe37e('0xe0')]]['channel']=_0x544869['channel'];}};Dialer[_0xe37e('0x1b')]['syncQueueMember']=function(_0x1ab31b){if(strategy[this['voiceQueues'][this[_0xe37e('0xac')][_0x1ab31b['actionid']][_0xe37e('0xb5')]][_0xe37e('0x4e')]]==='roundrobin'){if(this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]]&&_[_0xe37e('0xae')](this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]]['locked'])&&_0x1ab31b[_0xe37e('0xb0')]==='1'&&_0x1ab31b[_0xe37e('0x12a')]==='0'){if(this[_0xe37e('0x21')][_0x1ab31b[_0xe37e('0x12b')]]){if(!this['agents'][_0x1ab31b['stateinterface']][_0xe37e('0x12c')]){this[_0xe37e('0x21')][_0x1ab31b[_0xe37e('0x12b')]]['locked']=!![];this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0x12c')]=!![];this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0x12b')]=_0x1ab31b['stateinterface'];}}}}else if((strategy[this[_0xe37e('0x1f')][this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0xb5')]]['strategy']]||_0xe37e('0x12d'))===_0xe37e('0x12d')){if(this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]]){if(this['agents'][_0x1ab31b['stateinterface']]){this['actions'][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0x12b')]=_0x1ab31b[_0xe37e('0x12b')];if(_[_0xe37e('0xae')](this['queueBooked'][this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0xb5')]])){this['queueBooked'][this['actions'][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0xb5')]]=[];}this[_0xe37e('0x12e')][this[_0xe37e('0xac')][_0x1ab31b[_0xe37e('0x129')]][_0xe37e('0xb5')]][_0xe37e('0x12f')](_[_0xe37e('0x8e')](_['pick'](this['actions'][_0x1ab31b[_0xe37e('0x129')]],[_0xe37e('0x130'),_0xe37e('0x12b')]),{'status':_0x1ab31b[_0xe37e('0xb0')],'paused':_0x1ab31b[_0xe37e('0x12a')]}));}}}};function unlockQueueStatus(_0x55ae02,_0x2d1426){setTimeout(function(){if(_[_0xe37e('0x3c')](_0x55ae02[_0xe37e('0x131')])){loggerBooked[_0xe37e('0x97')](_0xe37e('0x132'),_0x2d1426);}_0x55ae02[_0xe37e('0x131')]=!![];loggerBooked[_0xe37e('0x81')]('[booked][unlockQueueStatus]',_0x2d1426,JSON[_0xe37e('0x7c')](_[_0xe37e('0xd4')](_0x55ae02,['name',_0xe37e('0x131')])));},0x1f3);}Dialer[_0xe37e('0x1b')][_0xe37e('0x133')]=function(_0x52dd1b){var _0x2edcd3=this;var _0x3aff9c=_0x2edcd3['voiceQueues'][_0x2edcd3['actions'][_0x52dd1b['actionid']]['queue']];if(strategy[this['voiceQueues'][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xb5')]][_0xe37e('0x4e')]]===_0xe37e('0x1a')){if(this['actions'][_0x52dd1b[_0xe37e('0x129')]]&&this[_0xe37e('0xac')][_0x52dd1b['actionid']][_0xe37e('0x12b')]){this[_0xe37e('0x93')]['run'](this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0x130')],this[_0xe37e('0xac')][_0x52dd1b['actionid']][_0xe37e('0x12b')])[_0xe37e('0xb2')](function(_0x432c3d){logger['error'](_0xe37e('0x134'),util['inspect'](_0x432c3d,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2edcd3[_0xe37e('0xb4')](_0x2edcd3[_0xe37e('0x1f')][_0x2edcd3['actions'][_0x52dd1b[_0xe37e('0x129')]]['queue']]);_0x2edcd3['agents'][_0x2edcd3[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0x12b')]][_0xe37e('0x12c')]=![];delete _0x2edcd3[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]];unlockQueueStatus(_0x3aff9c);});}else{this[_0xe37e('0xb4')](this[_0xe37e('0x1f')][this['actions'][_0x52dd1b[_0xe37e('0x129')]]['queue']]);this[_0xe37e('0xc0')]({'active':![],'ContactId':this[_0xe37e('0xac')][_0x52dd1b['actionid']]['ContactId'],'ListId':this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]]['ListId'],'VoiceQueueId':this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xd9')]||undefined})['catch'](loggerCatch(_0xe37e('0x135')));delete this['actions'][_0x52dd1b[_0xe37e('0x129')]];unlockQueueStatus(_0x3aff9c);}}else if((strategy[this['voiceQueues'][this[_0xe37e('0xac')][_0x52dd1b['actionid']]['queue']][_0xe37e('0x4e')]]||_0xe37e('0x12d'))===_0xe37e('0x12d')){var _0x373664;if(this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]]&&!_[_0xe37e('0x80')](this['queueBooked'][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xb5')]])){if(this[_0xe37e('0x136')][_0x2edcd3[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xb5')]]){this['queueBookedRR'][_0x2edcd3[_0xe37e('0xac')][_0x52dd1b['actionid']]['queue']]=this[_0xe37e('0x136')][this[_0xe37e('0xac')][_0x52dd1b['actionid']][_0xe37e('0xb5')]]?this[_0xe37e('0x136')][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]]['queue']]:this[_0xe37e('0x12e')][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xb5')]]?this['queueBooked'][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xb5')]][_0xe37e('0x137')]||0x0:0x0;}this['queueBooked'][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]][_0xe37e('0xb5')]][_0xe37e('0x137')]=this[_0xe37e('0x136')][this[_0xe37e('0xac')][_0x52dd1b[_0xe37e('0x129')]]['queue']];for(var _0x5317e4=0x0;_0x5317e4=0x0;})[_0xe37e('0xb2')](myreject(_0x401ace)));}}else{_0x59c873[_0xe37e('0x12f')](ami[_0xe37e('0xaf')]({'action':_0xe37e('0x150'),'command':util['format'](_0xe37e('0x151'),_0x2fd16a,!_[_0xe37e('0x3c')](config['timezones'][_0x32d21a])?_0x32d21a:'')})[_0xe37e('0xba')](function(_0x35daf7){return _0x35daf7[_0xe37e('0x153')]['indexOf']('true')>=0x0;})[_0xe37e('0xb2')](myreject(_0x401ace)));}BPromise[_0xe37e('0x156')](_0x59c873)[_0xe37e('0xba')](function(_0x41b9cc){var _0x2c1c80=_[_0xe37e('0x157')](_0x41b9cc);if(_0x2c1c80){return _0x43634c(_0x2c1c80);}else{_0x113844[_0xe37e('0x40')]=_0x2c997e?_0xe37e('0x158'):_0xe37e('0x159');return _0x401ace(msgResponse(_0xe37e('0x15a'),'Failure','Global:\x20'+_0x2c997e+'\x20'+_0xc293b9+_0xe37e('0x15b')+util[_0xe37e('0x98')](_0x2fd16a,{'showHidden':![],'depth':null})+_0xe37e('0x15c')+_0x32d21a));}})[_0xe37e('0xb2')](function(_0x1f6924){return _0x401ace(msgResponse(_0xe37e('0x148'),_0xe37e('0x15d'),JSON['stringify'](_0x1f6924)));});});};Dialer['prototype'][_0xe37e('0x15e')]=function(_0x270a0c){var _0x5bac72=this;return function(){switch(_0x270a0c[_0xe37e('0x5b')]){case _0xe37e('0x15f'):freeVariablesPredictive(_0x270a0c);_0x5bac72[_0xe37e('0x160')](_0x270a0c,0x1);break;case _0xe37e('0x161'):freeVariablesPredictive(_0x270a0c);_0x5bac72[_0xe37e('0x160')](_0x270a0c,_0x270a0c[_0xe37e('0x162')]);break;case _0xe37e('0x8'):_0x5bac72['predictive'](_0x270a0c);break;case'booked':freeVariablesPredictive(_0x270a0c);_0x5bac72[_0xe37e('0x160')](_0x270a0c,0x1);break;default:freeVariablesPredictive(_0x270a0c);logger[_0xe37e('0x97')](_0xe37e('0x163'),_0x270a0c[_0xe37e('0x3e')],'method\x20not\x20recognized');}};};Dialer[_0xe37e('0x1b')][_0xe37e('0x164')]=function(_0xf26a68){return BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](cmHopper[_0xe37e('0x165')](_0xf26a68['id'],previewRecallmeReminderInterval))[_0xe37e('0xba')](function(_0xd20e74){for(var _0x203005=0x0;_0x203005<_0xd20e74[_0xe37e('0x99')];_0x203005++){var _0x4d3693=_0xd20e74[_0x203005][_0xe37e('0x166')]['name'];if(_0x4d3693)io['to'](util[_0xe37e('0x7d')](_0xe37e('0x167'),_0x4d3693))[_0xe37e('0x4b')]('user:dialPreviewRecallReminder',{'hopper':_0xd20e74[_0x203005]});}})['catch'](function(_0x2aaf3){});};Dialer[_0xe37e('0x1b')][_0xe37e('0x168')]=function(_0x3dcae3){var _0x34c8af=this;return function(){_0x34c8af[_0xe37e('0x169')](_0x3dcae3);};};Dialer['prototype'][_0xe37e('0x30')]=function(_0x4fc59b){var _0xf7d9c2=this;if(isNotPreview(_0x4fc59b[_0xe37e('0x5b')])){if(isVoiceQueueOutbound(_0x4fc59b[_0xe37e('0x4c')])&&isActive(_0x4fc59b[_0xe37e('0x5a')])){_0x4fc59b[_0xe37e('0xa0')]=!![];BPromise[_0xe37e('0xb9')]()['then'](checkIsLoggedIn(_0x4fc59b,_0x4fc59b[_0xe37e('0x51')]))[_0xe37e('0xba')](checkIsActive(_0x4fc59b,_0x4fc59b['dialActive']))['then'](checkInterval(_0x4fc59b))[_0xe37e('0xba')](_0xf7d9c2['checkIsTrunkReachable'](_0x4fc59b))[_0xe37e('0xba')](_0xf7d9c2[_0xe37e('0x147')](_0x4fc59b[_0xe37e('0x16a')],_0x4fc59b['dialTimezone'],_0x4fc59b[_0xe37e('0x3e')],_0x4fc59b))[_0xe37e('0xba')](_0xf7d9c2['checkIfTimeIntervals'](_0x4fc59b[_0xe37e('0x7b')],_0x4fc59b['dialTimezone'],_0x4fc59b[_0xe37e('0x3e')],_0x4fc59b))['then'](_0xf7d9c2['checkDialMethod'](_0x4fc59b))[_0xe37e('0xb2')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4fc59b));}else{notSendMessagesQueue(_0x4fc59b);}}else{freeVariablesPredictive(_0x4fc59b);if(_0x4fc59b[_0xe37e('0x16b')]){_0xf7d9c2[_0xe37e('0x164')](_0x4fc59b);}}};Dialer['prototype'][_0xe37e('0x16c')]=function(){var _0x27ff1e=this;var _0x1efc77;for(var _0xdd9c96 in this['campaigns']){if(typeof this[_0xe37e('0x20')][_0xdd9c96]!=='undefined'){_0x1efc77=this[_0xe37e('0x20')][_0xdd9c96];if(isCampaignIvr(_0x1efc77['type'])&&isActive(_0x1efc77[_0xe37e('0x79')])){_0x1efc77[_0xe37e('0xa0')]=!![];BPromise[_0xe37e('0xb9')]()[_0xe37e('0xba')](checkIsActive(_0x1efc77,_0x1efc77[_0xe37e('0x79')]))['then'](checkInterval(_0x1efc77))['then'](_0x27ff1e[_0xe37e('0x143')](_0x1efc77))['then'](_0x27ff1e[_0xe37e('0x147')](_0x1efc77['dialGlobalInterval'],_0x1efc77[_0xe37e('0x16d')],_0x1efc77['name'],_0x1efc77))['then'](_0x27ff1e['checkIfTimeIntervals'](_0x1efc77[_0xe37e('0x7b')],_0x1efc77[_0xe37e('0x16d')],_0x1efc77['name'],_0x1efc77))[_0xe37e('0xba')](_0x27ff1e['launchHandleIvr'](_0x1efc77))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x1efc77));}else{notSendMessagesCampaign(_0x1efc77);}}}};function getCallerIdRandom(_0x1126d5,_0x5c5ff4){var _0x4178a7;var _0x30b71f;var _0x28be63;if(_0x5c5ff4<=0x0){_0x5c5ff4=0x1;}_0x4178a7=new RegExp(_0xe37e('0x16e')+_0x5c5ff4+'}$');_0x30b71f=Math['pow'](0xa,_0x5c5ff4-0x1);_0x28be63=Math[_0xe37e('0x16f')](0xa,_0x5c5ff4)-0x1;return util['format']('%s',_[_0xe37e('0x170')](_0x1126d5,_0x4178a7,_[_0xe37e('0x171')](_0x30b71f,_0x28be63)));}function extractCalleridName(_0x1bf3cb){var _0xcb9a52=_0x1bf3cb[_0xe37e('0x172')](/"(.*?)"/);return _0xcb9a52?_0xcb9a52[0x1]:_0x1bf3cb;}function extractCalleridNumber(_0x49c0c1){var _0x398cab=_0x49c0c1[_0xe37e('0x172')](/<(.*?)>/);return _0x398cab?_0x398cab[0x1]:_0x49c0c1;}Dialer[_0xe37e('0x1b')]['actionOriginate']=function(_0x4f265b,_0x4648f6){var _0x40a7f0=this;var _0x3155fe=uuid['v4']();this['actions'][_0x3155fe]=new Action(_0x4f265b,_0x4648f6,_0x3155fe);return new BPromise(function(_0x2b9f5b,_0x36e971){if(_[_0xe37e('0x3c')](_0x4f265b)&&typeof _0x4f265b!=='object'){return _0x36e971(msgResponse(_0xe37e('0x173'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xe37e('0x3c')](_0x4648f6[_0xe37e('0x174')][_0xe37e('0x175')])||_0x4648f6[_0xe37e('0x174')][_0xe37e('0x175')]===null){return _0x36e971(msgResponse('originate',_0xe37e('0x15d'),_0xe37e('0x176')));}var _0x5b61ec={'XMD-CALLERID':_0x40a7f0[_0xe37e('0xac')][_0x3155fe][_0xe37e('0x177')](),'XMD-AGI':_0x4f265b[_0xe37e('0x10a')]?util[_0xe37e('0x7d')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4f265b[_0xe37e('0x10a')]):'NONE','XMD-AGIAFTER':_0x4f265b[_0xe37e('0x110')]?util['format'](_0xe37e('0x178'),ipAgi,_0x4f265b[_0xe37e('0x110')]):_0xe37e('0x179'),'XMD-QUEUE':_0x4f265b['type']===_0xe37e('0x4d')?util[_0xe37e('0x7d')]('\x22%s,%s%s,,,%s\x22',_0x4f265b['name'],_0x4f265b[_0xe37e('0x17a')]||'',_0x4f265b[_0xe37e('0x111')]?'c':'',_0x4f265b[_0xe37e('0x117')]||0x3):_0xe37e('0x179'),'XMD-CONTACTID':_0x4648f6[_0xe37e('0xd5')],'XMD-CDRTYPE':_0xe37e('0x17b'),'CALLERID(all)':_0x40a7f0[_0xe37e('0xac')][_0x3155fe]['getCaller'](),'XMD-AMD':_0x4f265b[_0xe37e('0xef')]?_0xe37e('0x17c'):_0xe37e('0x179'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4f265b['dialAMDActive']){_0x5b61ec[_0xe37e('0x17d')]=_0x4f265b[_0xe37e('0x17e')]||0x9c4;_0x5b61ec['XMD-AMDGREETING']=_0x4f265b[_0xe37e('0x17f')]||0x5dc;_0x5b61ec[_0xe37e('0x180')]=_0x4f265b[_0xe37e('0x181')]||0x320;_0x5b61ec[_0xe37e('0x182')]=_0x4f265b['dialAMDTotalAnalysisTime']||0x1388;_0x5b61ec['XMD-AMDMINWORDLENGTH']=_0x4f265b['dialAMDMinWordLength']||0x64;_0x5b61ec[_0xe37e('0x183')]=_0x4f265b[_0xe37e('0x184')]||0x32;_0x5b61ec[_0xe37e('0x185')]=_0x4f265b[_0xe37e('0x186')]||0x3;_0x5b61ec['XMD-AMDSILENCETHRESHOLD']=_0x4f265b[_0xe37e('0x187')]||0x100;_0x5b61ec['XMD-AMDMAXIMUMWORDLENGTH']=_0x4f265b['dialAMDMaximumWordLength']||0x1388;}if(_0x4f265b['type']===_0xe37e('0x4d')){_0x5b61ec['XMD-VOICEQUEUEID']=_0x4648f6[_0xe37e('0xd8')];}else{_0x5b61ec['XMD-CAMPAIGNID']=_0x4648f6[_0xe37e('0xd9')];}for(var _0x29824c in _0x4648f6['Contact']){if(typeof _0x4648f6['Contact'][_0x29824c]!=='undefined'){if(isNotNull(_0x4648f6['Contact'][_0x29824c])&&_0x29824c!=='id'&&_0x29824c!==_0xe37e('0x188')&&_0x29824c!==_0xe37e('0x189')&&_0x29824c!==_0xe37e('0x18a')){_0x5b61ec[util[_0xe37e('0x7d')]('%s%s',_0xe37e('0x18b'),_[_0xe37e('0x18c')](_0x29824c))]=_0x4648f6[_0xe37e('0x174')][_0x29824c];}}}var _0x40727a=_0x40a7f0[_0xe37e('0x144')](_0x4f265b[_0xe37e('0x78')])?getCallerId(_0x4f265b[_0xe37e('0x78')]['callerid'],_0x4f265b[_0xe37e('0x5c')],_0x4f265b[_0xe37e('0x18d')]>0x0?getCallerIdRandom(_0x4f265b[_0xe37e('0x5d')],_0x4f265b[_0xe37e('0x18d')]):_0x4f265b[_0xe37e('0x5d')]):getCallerId(_[_0xe37e('0xae')](_0x4f265b[_0xe37e('0x145')])?_0x4f265b[_0xe37e('0x78')][_0xe37e('0x7a')]:_0x4f265b['TrunkBackup'][_0xe37e('0x7a')],_0x4f265b[_0xe37e('0x5c')],_0x4f265b[_0xe37e('0x18d')]>0x0?getCallerIdRandom(_0x4f265b[_0xe37e('0x5d')],_0x4f265b[_0xe37e('0x18d')]):_0x4f265b['dialOriginateCallerIdNumber']);if(_0x40727a){_0x5b61ec[_0xe37e('0x18e')]=_0x40a7f0[_0xe37e('0xac')][_0x3155fe][_0xe37e('0x18f')]=extractCalleridName(_0x40727a);_0x5b61ec[_0xe37e('0x190')]=_0x40a7f0[_0xe37e('0xac')][_0x3155fe]['originatecalleridnum']=extractCalleridNumber(_0x40727a);}return ami[_0xe37e('0xaf')]({'actionid':_0x3155fe,'action':'originate','channel':_0x40a7f0['isTrunkReachable'](_0x4f265b['Trunk'])?util['format']('SIP/%s/%s%s',_0x4f265b[_0xe37e('0x78')][_0xe37e('0x3e')],isNotNull(_0x4f265b[_0xe37e('0x5f')])?_0x4f265b['dialPrefix'][_0xe37e('0x191')]()||'':'',_0x4f265b[_0xe37e('0x192')]>0x0?_0x4648f6['Contact'][_0xe37e('0x175')][_0xe37e('0x193')](_0x4f265b[_0xe37e('0x192')]):_0x4648f6[_0xe37e('0x174')]['phone']):util[_0xe37e('0x7d')](_0xe37e('0x194'),_['isNil'](_0x4f265b[_0xe37e('0x145')])?_0x4f265b['Trunk'][_0xe37e('0x3e')]:_0x4f265b[_0xe37e('0x145')]['name'],isNotNull(_0x4f265b['dialPrefix'])?_0x4f265b['dialPrefix'][_0xe37e('0x191')]()||'':'',_0x4f265b[_0xe37e('0x192')]>0x0?_0x4648f6[_0xe37e('0x174')][_0xe37e('0x175')][_0xe37e('0x193')](_0x4f265b[_0xe37e('0x192')]):_0x4648f6['Contact'][_0xe37e('0x175')]),'callerid':_0x40727a,'Exten':'xcally-motion-dialer','Context':_0xe37e('0x195'),'Priority':'1','variable':_0x5b61ec,'timeout':(_0x4f265b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3155fe})[_0xe37e('0xba')](function(_0x2e2745){return _0x2b9f5b(_0x2e2745);})[_0xe37e('0xb2')](function(_0x31d8ff){_0x4f265b['outboundOriginateFailureCallsDay']+=0x1;var _0x59add3=new History(_0x40a7f0[_0xe37e('0xac')][_0x3155fe]);logger[_0xe37e('0x97')](util['format']('[originateError]:\x20%s',JSON[_0xe37e('0x7c')](_0x31d8ff)));_0x59add3[_0xe37e('0xa6')]=0xe;_0x59add3[_0xe37e('0xa7')]=_0xe37e('0x196');_0x59add3[_0xe37e('0xa9')]=moment()[_0xe37e('0x7d')](_0xe37e('0x106'));_0x59add3[_0xe37e('0xa8')]=_0x59add3['starttime'];_0x40a7f0[_0xe37e('0xcd')](_0x59add3)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x197')));_0x40a7f0[_0xe37e('0xcb')](_0x59add3)['catch'](loggerCatch('[originate][error]'))[_0xe37e('0x1d')](function(){delete _0x40a7f0[_0xe37e('0xac')][_0x3155fe];return _0x36e971(msgResponse(_0xe37e('0x173'),_0xe37e('0x47'),'originate\x20action\x20Error'));});});});};Dialer[_0xe37e('0x1b')][_0xe37e('0x2d')]=function(_0x449625){var _0xc6d394=this[_0xe37e('0xac')][_0x449625['actionid']];if(_0xc6d394){delete this[_0xe37e('0xac')][_0x449625[_0xe37e('0x129')]];_0xc6d394['responsetime']=moment()[_0xe37e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');var _0xaae0d2=_0xc6d394[_0xe37e('0x4c')]==='ivr'?this[_0xe37e('0x20')][_0xc6d394['queue']]:this[_0xe37e('0x1f')][_0xc6d394[_0xe37e('0x198')]()];if(!this[_0xe37e('0xdc')](_0x449625[_0xe37e('0x199')])){this[_0xe37e('0xb4')](_0xaae0d2);return this[_0xe37e('0x19a')](_0xc6d394,_0xaae0d2,_0x449625)['catch'](loggerCatch(_0xe37e('0x19b')));}this[_0xe37e('0x25')][_0x449625[_0xe37e('0xe0')]]=_0xc6d394;}};Dialer['prototype'][_0xe37e('0x19c')]=function(_0x9f16a6,_0xc07c58,_0x8174aa){var _0x4911f6=new History(_0xc07c58);if(_0x4911f6[_0xe37e('0xf5')]+_0x4911f6[_0xe37e('0x19d')]+_0x4911f6['countnoanswerretry']+_0x4911f6[_0xe37e('0xf6')]+_0x4911f6[_0xe37e('0xf7')]+_0x4911f6[_0xe37e('0xf8')]+_0x4911f6[_0xe37e('0xf2')]+_0x4911f6[_0xe37e('0x104')]>=_0x8174aa[_0xe37e('0xf9')]-0x1){return!![];}switch(_0x9f16a6){case 0x3:if(_0x4911f6[_0xe37e('0x103')]>=_0x8174aa[_0xe37e('0x19e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4911f6[_0xe37e('0x103')]+=0x1,'scheduledat':moment()[_0xe37e('0x11d')](_0x8174aa['dialNoAnswerRetryFrequency'],'minutes')[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x4911f6[_0xe37e('0xd5')],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6[_0xe37e('0xd8')]||undefined,'CampaignId':_0x4911f6['CampaignId']||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x19f')));break;case 0x5:if(_0x4911f6[_0xe37e('0xf5')]>=_0x8174aa[_0xe37e('0x1a0')]-0x1){return!![];}this[_0xe37e('0xc0')]({'active':![],'countbusyretry':_0x4911f6['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x8174aa[_0xe37e('0x1a1')],'minutes')[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x4911f6[_0xe37e('0xd5')],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6['VoiceQueueId']||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4911f6['countcongestionretry']>=_0x8174aa['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x4911f6[_0xe37e('0x19d')]+=0x1,'scheduledat':moment()[_0xe37e('0x11d')](_0x8174aa['dialCongestionRetryFrequency'],_0xe37e('0xfe'))['format'](_0xe37e('0x106')),'ContactId':_0x4911f6[_0xe37e('0xd5')],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6[_0xe37e('0xd8')]||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4911f6['countnosuchnumberretry']>=_0x8174aa[_0xe37e('0x1a2')]-0x1){return!![];}else{this[_0xe37e('0xc0')]({'active':![],'countnosuchnumberretry':_0x4911f6[_0xe37e('0xf6')]+=0x1,'scheduledat':moment()[_0xe37e('0x11d')](_0x8174aa[_0xe37e('0x1a3')],'minutes')[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x4911f6['ContactId'],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6[_0xe37e('0xd8')]||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4911f6[_0xe37e('0xf7')]>=_0x8174aa[_0xe37e('0x11c')]-0x1){return!![];}this[_0xe37e('0xc0')]({'active':![],'countdropretry':_0x4911f6[_0xe37e('0xf7')]+=0x1,'scheduledat':moment()[_0xe37e('0x11d')](_0x8174aa[_0xe37e('0x11e')],'minutes')[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x4911f6[_0xe37e('0xd5')],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6['VoiceQueueId']||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x4911f6['countabandonedretry']>=_0x8174aa[_0xe37e('0x125')]-0x1){return!![];}this[_0xe37e('0xc0')]({'active':![],'countabandonedretry':_0x4911f6['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x8174aa[_0xe37e('0x1a4')],_0xe37e('0xfe'))[_0xe37e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4911f6['ContactId'],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6[_0xe37e('0xd8')]||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x126')));break;case 0x13:if(_0x4911f6[_0xe37e('0xf2')]>=_0x8174aa[_0xe37e('0xfb')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x4911f6[_0xe37e('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x8174aa[_0xe37e('0x105')],_0xe37e('0xfe'))[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x4911f6[_0xe37e('0xd5')],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6[_0xe37e('0xd8')]||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})['catch'](loggerCatch(_0xe37e('0xff')));break;case 0x14:if(_0x4911f6[_0xe37e('0x104')]>=_0x8174aa['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xe37e('0xc0')]({'active':![],'countagentrejectretry':_0x4911f6['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xe37e('0x11d')](_0x8174aa[_0xe37e('0x1a5')],_0xe37e('0xfe'))[_0xe37e('0x7d')](_0xe37e('0x106')),'ContactId':_0x4911f6['ContactId'],'ListId':_0x4911f6[_0xe37e('0xd6')],'VoiceQueueId':_0x4911f6[_0xe37e('0xd8')]||undefined,'CampaignId':_0x4911f6[_0xe37e('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xe37e('0x1b')][_0xe37e('0x19a')]=function(_0x31e37b,_0x3ffbe2,_0x4ac679){var _0x1a724b=this;var _0x5b5a48=new History(_0x31e37b);return new BPromise(function(_0x288dde,_0x59eb14){if(_[_0xe37e('0x3c')](_0x3ffbe2)&&typeof _0x3ffbe2!==_0xe37e('0x1a6')){return _0x59eb14(msgResponse(_0xe37e('0x1a7'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x4ac679)&&typeof _0x4ac679!==_0xe37e('0x1a6')){return _0x59eb14(msgResponse('[callProgressDetecting]',_0xe37e('0x15d'),_0xe37e('0x1a8')));}switch(_0x4ac679[_0xe37e('0x10d')]){case'0':_0x3ffbe2[_0xe37e('0x67')]+=0x1;_0x5b5a48[_0xe37e('0xa6')]=0x0;_0x5b5a48['statedesc']=_0xe37e('0x1a9');_0x5b5a48[_0xe37e('0xf6')]+=0x1;_0x5b5a48[_0xe37e('0xf3')]+=0x1;ami[_0xe37e('0x4b')](_0xe37e('0x1aa'),ut[_0xe37e('0x100')](_0x31e37b,_0xe37e('0x1ab')));_0x1a724b[_0xe37e('0xcd')](_0x5b5a48)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0xf4')));if(_0x1a724b[_0xe37e('0x19c')](0x0,_0x31e37b,_0x3ffbe2)){if(_0x5b5a48['countnosuchnumberretry']>=_0x3ffbe2[_0xe37e('0x1a2')]){_0x1a724b[_0xe37e('0xfc')](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1ac'));}else{_0x1a724b[_0xe37e('0x1ad')](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1ac'));}}break;case'3':_0x3ffbe2[_0xe37e('0x66')]+=0x1;_0x5b5a48[_0xe37e('0xa6')]=0x3;_0x5b5a48[_0xe37e('0xa7')]=_0xe37e('0x1ae');_0x5b5a48[_0xe37e('0x103')]+=0x1;_0x5b5a48['countglobal']+=0x1;ami[_0xe37e('0x4b')](_0xe37e('0x1af'),ut[_0xe37e('0x100')](_0x31e37b,_0xe37e('0x1b0')));_0x1a724b[_0xe37e('0xcd')](_0x5b5a48)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x1b1')));if(_0x1a724b[_0xe37e('0x19c')](0x3,_0x31e37b,_0x3ffbe2)){if(_0x5b5a48[_0xe37e('0x103')]>=_0x3ffbe2[_0xe37e('0x19e')]){_0x1a724b[_0xe37e('0xfc')](_0x5b5a48,_0x288dde,_0x59eb14,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1a724b['stateGlobal'](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1b2'));}}break;case'5':_0x3ffbe2['outboundBusyCallsDay']+=0x1;_0x5b5a48[_0xe37e('0xa6')]=0x5;_0x5b5a48[_0xe37e('0xa7')]=_0xe37e('0x1b3');_0x5b5a48['countbusyretry']+=0x1;_0x5b5a48[_0xe37e('0xf3')]+=0x1;ami['emit'](_0xe37e('0x1b4'),ut['buildObj'](_0x31e37b,_0xe37e('0x1b5')));_0x1a724b[_0xe37e('0xcd')](_0x5b5a48)['catch'](loggerCatch(_0xe37e('0x1b6')));if(_0x1a724b[_0xe37e('0x19c')](0x5,_0x31e37b,_0x3ffbe2)){if(_0x5b5a48[_0xe37e('0xf5')]>=_0x3ffbe2[_0xe37e('0x1a0')]){_0x1a724b[_0xe37e('0xfc')](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1b7'));}else{_0x1a724b[_0xe37e('0x1ad')](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1b7'));}}break;case'8':_0x3ffbe2[_0xe37e('0x62')]+=0x1;_0x5b5a48[_0xe37e('0xa6')]=0x8;_0x5b5a48[_0xe37e('0xa7')]=_0xe37e('0x1b8');_0x5b5a48[_0xe37e('0x19d')]+=0x1;_0x5b5a48[_0xe37e('0xf3')]+=0x1;ami['emit']('custom:agentcongestion',ut['buildObj'](_0x31e37b,_0xe37e('0x1b9')));_0x1a724b[_0xe37e('0xcd')](_0x5b5a48)[_0xe37e('0xb2')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1a724b[_0xe37e('0x19c')](0x8,_0x31e37b,_0x3ffbe2)){if(_0x5b5a48[_0xe37e('0x19d')]>=_0x3ffbe2[_0xe37e('0x1ba')]){_0x1a724b['createStateFinal'](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1bb'));}else{_0x1a724b[_0xe37e('0x1ad')](_0x5b5a48,_0x288dde,_0x59eb14,'reason\x208\x20congestion');}}break;case'11':_0x3ffbe2['outboundAbandonedCallsDay']+=0x1;_0x5b5a48[_0xe37e('0xa6')]=0xb;_0x5b5a48['statedesc']='Abandoned';_0x5b5a48[_0xe37e('0xf8')]+=0x1;_0x5b5a48[_0xe37e('0xf3')]+=0x1;_0x1a724b[_0xe37e('0xcd')](_0x5b5a48)[_0xe37e('0xb2')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1a724b[_0xe37e('0x19c')](0xb,_0x31e37b,_0x3ffbe2)){if(_0x5b5a48[_0xe37e('0xf8')]>=_0x3ffbe2[_0xe37e('0x125')]){_0x1a724b[_0xe37e('0xfc')](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1bc'));}else{_0x1a724b[_0xe37e('0x1ad')](_0x5b5a48,_0x288dde,_0x59eb14,_0xe37e('0x1bc'));}}break;case'20':_0x3ffbe2['outboundRejectCallsDay']+=0x1;_0x5b5a48['state']=0x14;_0x5b5a48['statedesc']=_0xe37e('0x1bd');_0x5b5a48[_0xe37e('0x104')]+=0x1;_0x5b5a48['countglobal']+=0x1;ami['emit'](_0xe37e('0x1be'),ut[_0xe37e('0x100')](_0x31e37b,'agentreject'));_0x1a724b['createHistory'](_0x5b5a48)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x1bf')));if(_0x1a724b[_0xe37e('0x19c')](0x14,_0x31e37b,_0x3ffbe2)){if(_0x5b5a48[_0xe37e('0x104')]>=_0x3ffbe2[_0xe37e('0x1c0')]){_0x1a724b['createStateFinal'](_0x5b5a48,_0x288dde,_0x59eb14,'reason\x2020\x20agentreject');}else{_0x1a724b[_0xe37e('0x1ad')](_0x5b5a48,_0x288dde,_0x59eb14,'reason\x2020\x20agentreject');}}break;default:_0x3ffbe2['outboundUnknownCallsDay']+=0x1;_0x5b5a48[_0xe37e('0xa6')]=0xc;_0x5b5a48[_0xe37e('0xa7')]=_0x4ac679[_0xe37e('0x10d')];_0x1a724b[_0xe37e('0xcd')](_0x5b5a48)[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x1c1')));if(_0x1a724b[_0xe37e('0x19c')](_0x4ac679[_0xe37e('0x10d')],_0x31e37b,_0x3ffbe2)){if(_0x5b5a48[_0xe37e('0xf5')]+_0x5b5a48['countcongestionretry']+_0x5b5a48[_0xe37e('0x103')]+_0x5b5a48['countnosuchnumberretry']+_0x5b5a48[_0xe37e('0xf7')]+_0x5b5a48[_0xe37e('0xf8')]+_0x5b5a48['countmachineretry']+_0x5b5a48[_0xe37e('0x104')]>=_0x3ffbe2[_0xe37e('0xf9')]){_0x1a724b[_0xe37e('0x1ad')](_0x5b5a48,_0x288dde,_0x59eb14,_0x4ac679['reason']);}else{_0x1a724b['createStateFinal'](_0x5b5a48,_0x288dde,_0x59eb14,_0x4ac679['reason']);}}}});};Dialer[_0xe37e('0x1b')]['stateGlobal']=function(_0x1295df,_0x197088,_0x4d567b,_0x29d014){var _0x400953=new Final(_0x1295df);_0x400953[_0xe37e('0xa6')]=0xf;_0x400953['statedesc']=_0xe37e('0x1c2');this[_0xe37e('0xfc')](_0x400953,_0x197088,_0x4d567b,_0x29d014);};Dialer['prototype'][_0xe37e('0xfc')]=function(_0xf84528,_0x3d2302,_0x1ebc83,_0x36c6dd){this[_0xe37e('0xcb')](_0xf84528)[_0xe37e('0xba')](function(){return _0x3d2302(msgResponse(_0xe37e('0x1a7'),_0xe37e('0xdd'),_0x36c6dd));})[_0xe37e('0xb2')](function(){return _0x1ebc83(msgResponse('[moveContactManagedDialer][0]',_0xe37e('0x15d'),_0xe37e('0x1c3')));});};Dialer[_0xe37e('0x1b')][_0xe37e('0x8')]=function(_0x27f34c){var _0x1cabf0=_0x27f34c[_0xe37e('0x1c4')]/0x64;var _0xa09487=_0x27f34c[_0xe37e('0x65')]/(_0x27f34c[_0xe37e('0x65')]+_0x27f34c['outboundAnswerCallsDay']);var _0x486e4f=Math[_0xe37e('0x1c5')](_0x27f34c['predictiveIntervalAvailable']*(_0x27f34c[_0xe37e('0x1c6')]/0x64));var _0x2e1f79=Math[_0xe37e('0x1c5')](_0x27f34c['predictiveIntervalAvailable']*(_0x27f34c['predictiveIntervalMinThreshold']/0x64));var _0x491c8e=_0x27f34c['available']+_0x27f34c[_0xe37e('0x55')];var _0x592092=Math[_0xe37e('0x1c7')](_0x27f34c[_0xe37e('0x74')]*_0x27f34c[_0xe37e('0x76')]*_0x27f34c[_0xe37e('0x1c8')]*_0x27f34c[_0xe37e('0x6f')]);if(_[_0xe37e('0x3c')](_0x27f34c[_0xe37e('0x27')])){if(!_['isUndefined'](_0x27f34c['startPredictive'])){_0x27f34c[_0xe37e('0x90')]=undefined;loggerPredictive[_0xe37e('0x97')]('[startMethodPredictive][StartProgressive]',_0xe37e('0x1c9'));}if(!_['isUndefined'](_0x27f34c[_0xe37e('0x92')])){loggerPredictive[_0xe37e('0x97')](_0xe37e('0x1ca'),_0xe37e('0x1cb'));clearInterval(_0x27f34c['handlePredictive']);_0x27f34c[_0xe37e('0x92')]=undefined;}_0x27f34c[_0xe37e('0x27')]=moment()[_0xe37e('0x7d')](_0xe37e('0x106'));loggerPredictive[_0xe37e('0x81')](_0x27f34c[_0xe37e('0x3e')],_0xe37e('0x1cc'),_0x27f34c[_0xe37e('0x27')]);this[_0xe37e('0x160')](_0x27f34c,0x1);}else if(ifInterval(_0x27f34c[_0xe37e('0x1cd')],_0x27f34c['startProgressive'])){this[_0xe37e('0x160')](_0x27f34c,0x1);loggerPredictiveCalls[_0xe37e('0x81')](_0xe37e('0x1ce'),_0x27f34c[_0xe37e('0x27')],_0x27f34c[_0xe37e('0x3e')]);_0x27f34c[_0xe37e('0x74')]=0x0;_0x27f34c[_0xe37e('0x118')]=0x0;}else if(_0x1cabf0<_0xa09487&&_0x27f34c[_0xe37e('0x1cf')]===_0xe37e('0x1d0')){freeVariablesPredictive(_0x27f34c);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x1d1'),'Dropped\x20calls\x20day',_0xa09487,_0xe37e('0x27'),_0x27f34c['name']);}else if(_0x592092<_0x27f34c[_0xe37e('0x118')]&&_0x27f34c[_0xe37e('0x1cf')]==='dropRate'){freeVariablesPredictive(_0x27f34c);loggerPredictive['info'](_0xe37e('0x1d2'),_0xe37e('0x1d3'),_0x592092,_0xe37e('0x1d4'),_0x27f34c['predictiveIntervalErlangCallsDroppedCalls'],_0xe37e('0x27'),_0x27f34c[_0xe37e('0x3e')]);}else if(!ifInterval(_0x27f34c[_0xe37e('0x1cd')],_0x27f34c[_0xe37e('0x27')])&&_[_0xe37e('0x3c')](_0x27f34c[_0xe37e('0x90')])&&!_[_0xe37e('0x3c')](_0x27f34c[_0xe37e('0x27')])){_0x27f34c[_0xe37e('0x90')]=moment()['format'](_0xe37e('0x106'));loggerPredictive[_0xe37e('0x81')](_0x27f34c[_0xe37e('0x3e')],_0xe37e('0x1d5'),_0x27f34c['startPredictive']);this['averageHandleTime'](_0x27f34c['dialPredictiveInterval'])[_0xe37e('0xba')](this[_0xe37e('0x1d6')](_0x27f34c))[_0xe37e('0xba')](mergeDataErlangB(_0x27f34c))[_0xe37e('0xba')](this[_0xe37e('0x1d7')](_0x27f34c))['catch'](loggerCatchPredictive(_0xe37e('0x1d8'),_0x27f34c));}else if(!ifInterval(_0x27f34c[_0xe37e('0x1cd')],_0x27f34c['startPredictive'])){_0x27f34c[_0xe37e('0x118')]=0x0;_0x27f34c['startPredictive']=moment()[_0xe37e('0x7d')](_0xe37e('0x106'));loggerPredictive[_0xe37e('0x81')](_0x27f34c[_0xe37e('0x3e')],_0xe37e('0x1d9'),_0x27f34c['startPredictive']);clearInterval(_0x27f34c[_0xe37e('0x92')]);_0x27f34c['handlePredictive']=undefined;this[_0xe37e('0x1da')](_0x27f34c[_0xe37e('0x1cd')])['then'](this[_0xe37e('0x1d6')](_0x27f34c))[_0xe37e('0xba')](mergeDataErlangB(_0x27f34c))[_0xe37e('0xba')](this[_0xe37e('0x1d7')](_0x27f34c))[_0xe37e('0xb2')](loggerCatchPredictive(_0xe37e('0x1db'),_0x27f34c));}else if(_0x27f34c[_0xe37e('0x71')]&&_0x491c8e<_0x27f34c[_0xe37e('0x71')]-_0x2e1f79){freeVariablesPredictive(_0x27f34c);loggerPredictive['info'](_0x27f34c[_0xe37e('0x3e')],_0xe37e('0x1dc'),_0x491c8e,_0xe37e('0x1dd'),_0x27f34c[_0xe37e('0x71')],'-',_0x2e1f79,'=',_0x27f34c[_0xe37e('0x71')]-_0x2e1f79,')');}else if(_0x27f34c[_0xe37e('0x71')]&&_0x491c8e>_0x27f34c[_0xe37e('0x71')]+_0x486e4f){freeVariablesPredictive(_0x27f34c);loggerPredictive[_0xe37e('0x81')](_0x27f34c[_0xe37e('0x3e')],_0xe37e('0x1dc'),_0x491c8e,')\x20are\x20more\x20than\x20threshold\x20(',_0x27f34c[_0xe37e('0x71')],'+',_0x486e4f,'=',_0x27f34c[_0xe37e('0x71')]+_0x486e4f,')');}};Dialer[_0xe37e('0x1b')][_0xe37e('0x1d6')]=function(_0x34fbf5){var _0x2a4f07=this;return function(_0x4b8fb1){return new BPromise(function(_0x119404,_0x362f06){_['merge'](_0x34fbf5,_0x4b8fb1[0x0]);if(checkGetDataPredictive(_0x4b8fb1[0x0])){var _0x2fedfb=_0x34fbf5[_0xe37e('0x71')]=_0x34fbf5[_0xe37e('0x55')]+_0x34fbf5[_0xe37e('0x50')];var _0x5b2a01=_0x34fbf5[_0xe37e('0x1cd')]*0x3c;var _0xa60dd4=_0x4b8fb1[0x0]['predictiveIntervalAvgTalktime']+_0x4b8fb1[0x0][_0xe37e('0x6d')];var _0x18e450=(_0x4b8fb1[0x0][_0xe37e('0x6c')]+_0x4b8fb1[0x0][_0xe37e('0x1de')]+_0x4b8fb1[0x0][_0xe37e('0x1df')])/_0x4b8fb1[0x0]['predictiveIntervalTotalCalls'];_0x34fbf5[_0xe37e('0x1c8')]=_0x18e450>0x0?_0x18e450:0x1;switch(_0x34fbf5[_0xe37e('0x1cf')]){case'dropRate':var _0x4d6e1d=_0x34fbf5[_0xe37e('0x1c4')]/0x64;return _0x2a4f07['abandonmentRate'](_0x2fedfb,_0x5b2a01,_0xa60dd4,_0x18e450,_0x4d6e1d)[_0xe37e('0xba')](function(_0xec3932){return _0x119404(_0xec3932);});case _0xe37e('0x1e0'):var _0x4c06f0=_0x34fbf5[_0xe37e('0x1c4')]/0x64;return _0x2a4f07[_0xe37e('0x1e1')](_0x2fedfb,_0x5b2a01,_0xa60dd4,_0x18e450,_0x4c06f0)[_0xe37e('0xba')](function(_0x3238bc){return _0x119404(_0x3238bc);});default:return _0x362f06(msgResponse(_0xe37e('0x1e2'),_0xe37e('0x15d'),_0xe37e('0x1e3')));}}else{return _0x362f06(msgResponse(_0xe37e('0x1e2'),_0xe37e('0x15d'),_0xe37e('0x1e4')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x21ba40){var _0x242c9e=this;return function(_0x9f183f){return new BPromise(function(_0x1f17e6,_0x509a86){_['merge'](_0x21ba40,_0x9f183f[0x0]);if(checkGetDataPredictive(_0x9f183f[0x0])){loggerPredictive['info'](JSON[_0xe37e('0x7c')](_0x9f183f[0x0]));if(_0x21ba40[_0xe37e('0x1cf')]===_0xe37e('0x1d0')){return _0x242c9e[_0xe37e('0xc9')](_0x21ba40['id'])[_0xe37e('0xba')](function(_0x5a09df){var _0xfe68a5=_0x21ba40[_0xe37e('0x51')]-_0x5a09df[0x0][_0xe37e('0x1e5')];var _0x20d0bf=_0x21ba40[_0xe37e('0x1cd')]*0x3c;var _0x409ddf=_0x9f183f[0x0]['predictiveIntervalAvgTalktime']+_0x9f183f[0x0]['predictiveIntervalAvgHoldtime'];var _0x11a297=(_0x9f183f[0x0][_0xe37e('0x6c')]+_0x9f183f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x9f183f[0x0][_0xe37e('0x1df')])/_0x9f183f[0x0]['predictiveIntervalTotalCalls'];var _0x41c21d=_0x21ba40[_0xe37e('0x1c4')]/0x64;_0x21ba40[_0xe37e('0x70')]=_0x5a09df[0x0][_0xe37e('0x1e5')]||0x0;_0x21ba40['predictiveIntervalHitRate']=_0x11a297>0x0?_0x11a297:0x1;return _0x242c9e[_0xe37e('0x1e6')](_0xfe68a5,_0x20d0bf,_0x409ddf,_0x11a297,_0x41c21d);})[_0xe37e('0xba')](function(_0x5309d0){return _0x1f17e6(_0x5309d0);})[_0xe37e('0xb2')](function(_0x189d47){return _0x509a86(msgResponse(_0xe37e('0x1e7'),_0xe37e('0x15d'),JSON['stringify'](_0x189d47)));});}if(_0x21ba40['dialPredictiveOptimization']==='agentBusyFactor'){return _0x242c9e[_0xe37e('0xc9')](_0x21ba40['id'])[_0xe37e('0xba')](function(_0xc2f18e){var _0x1bf973=_0x21ba40[_0xe37e('0x51')]-_0xc2f18e[0x0]['outboundQueuePauses'];var _0x3f713a=_0x21ba40['dialPredictiveInterval']*0x3c;var _0x2a9041=_0x9f183f[0x0][_0xe37e('0x6e')]+_0x9f183f[0x0][_0xe37e('0x6d')];var _0x4a223a=(_0x9f183f[0x0][_0xe37e('0x6c')]+_0x9f183f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x9f183f[0x0][_0xe37e('0x1df')])/_0x9f183f[0x0]['predictiveIntervalTotalCalls'];var _0x52e22b=_0x21ba40['dialPredictiveOptimizationPercentage']/0x64;_0x21ba40[_0xe37e('0x70')]=_0xc2f18e[0x0][_0xe37e('0x1e5')]||0x0;_0x21ba40['predictiveIntervalHitRate']=_0x4a223a>0x0?_0x4a223a:0x1;return _0x242c9e[_0xe37e('0x1e1')](_0x1bf973,_0x3f713a,_0x2a9041,_0x4a223a,_0x52e22b);})[_0xe37e('0xba')](function(_0xe33cf1){return _0x1f17e6(_0xe33cf1);})['catch'](function(_0x3a1f1e){return _0x509a86(msgResponse('[CatchErlangB]',_0xe37e('0x15d'),JSON[_0xe37e('0x7c')](_0x3a1f1e)));});}}else{return _0x509a86(msgResponse(_0xe37e('0x1e2'),_0xe37e('0x15d'),_0xe37e('0x1e4')));}});};};Dialer[_0xe37e('0x1b')][_0xe37e('0x1d7')]=function(_0x591860){var _0x13c64d=this;return function(){var _0xe0f7e6=0x0;var _0x207958=Math[_0xe37e('0x1c7')](_0x591860['erlangCallToSecond']*0x3e8);if(_0x207958>0x0){_0x207958=_0x207958<0x64?0x64:_0x207958;loggerPredictive[_0xe37e('0x81')](_0x591860[_0xe37e('0x3e')],'one\x20call\x20every:',_0x207958,_0xe37e('0x48'));_0x591860[_0xe37e('0x92')]=setInterval(function(){_0x13c64d[_0xe37e('0x92')](_0x591860);loggerPredictiveCalls['info'](_0xe37e('0x1e8'),_0xe0f7e6+=0x1);},_0x207958);}else{loggerPredictive[_0xe37e('0x81')](_0x591860['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xe37e('0x1b')][_0xe37e('0x1e9')]=function(_0xbadc69,_0x1a4be1){var _0x5c1452=this;return function(_0x565cba){if(_['isEmpty'](_0x565cba)){if(_['isNil'](_0x1a4be1[_0xe37e('0xd7')])||!_0x1a4be1[_0xe37e('0x1ea')]){if(_0xbadc69['dialMethod']===_0xe37e('0x7')){_0xbadc69[_0xe37e('0x131')]=_['isUndefined'](_0xbadc69[_0xe37e('0x131')])?!![]:_0xbadc69[_0xe37e('0x131')];var _0x1e1558=uuid['v4']();_0x5c1452[_0xe37e('0xac')][_0x1e1558]=new Action(_0xbadc69,_0x1a4be1,_0x1e1558);loggerBooked[_0xe37e('0x81')](_0xe37e('0x1eb'),_0x1e1558,_0xe37e('0x1ec'),JSON[_0xe37e('0x7c')](_0xbadc69[_0xe37e('0x131')]),_0xe37e('0x1ed'),_0xbadc69[_0xe37e('0x3e')]);if(_0xbadc69[_0xe37e('0x131')]){_0xbadc69[_0xe37e('0x131')]=![];_0x5c1452[_0xe37e('0x12e')][_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xb5')]]=[];ami[_0xe37e('0xaf')]({'actionid':_0x1e1558,'action':_0xe37e('0x1ee'),'queue':_0xbadc69[_0xe37e('0x3e')]})[_0xe37e('0xb2')](function(){_0x5c1452['updateOriginated'](_0xbadc69);_0x5c1452[_0xe37e('0xc0')]({'active':![],'ContactId':_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xd5')],'ListId':_0x5c1452[_0xe37e('0xac')][_0x1e1558]['ListId'],'VoiceQueueId':_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xd8')]||undefined,'CampaignId':_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x1ef')));delete _0x5c1452[_0xe37e('0xac')][_0x1e1558];});}else{loggerBooked[_0xe37e('0x81')](_0xe37e('0x1f0'),JSON[_0xe37e('0x7c')](_0xbadc69['queueStatusComplete']),_0xe37e('0x1ed'),_0xbadc69['name']);_0x5c1452['updateOriginated'](_0xbadc69);_0x5c1452[_0xe37e('0xc0')]({'active':![],'ContactId':_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xd5')],'ListId':_0x5c1452[_0xe37e('0xac')][_0x1e1558]['ListId'],'VoiceQueueId':_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xd8')]||undefined,'CampaignId':_0x5c1452[_0xe37e('0xac')][_0x1e1558][_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x1ef')));delete _0x5c1452[_0xe37e('0xac')][_0x1e1558];}}else{return _0x5c1452['actionOriginate'](_0xbadc69,_0x1a4be1);}}else{if(getDiff(_0x1a4be1['scheduledat'])<_0xbadc69[_0xe37e('0x1f1')]*0x3c){if(_0x1a4be1['Agent']&&!_0x1a4be1[_0xe37e('0x166')][_0xe37e('0x1f2')]){_0x5c1452[_0xe37e('0x93')]['run'](_0x1a4be1['id'])[_0xe37e('0x1d')](function(){_0x5c1452[_0xe37e('0xb4')](_0xbadc69);});}else{_0x5c1452[_0xe37e('0xc2')]({'active':![]},_0x1a4be1['id'],0x1)[_0xe37e('0x1d')](function(){_0x5c1452[_0xe37e('0xb4')](_0xbadc69);});}}else{_0xbadc69[_0xe37e('0x69')]+=0x1;_0x5c1452['updateOriginated'](_0xbadc69);if(_0xbadc69[_0xe37e('0x1f3')]){_0x5c1452['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a4be1['ContactId'],'ListId':_0x1a4be1[_0xe37e('0xd6')],'VoiceQueueId':_0x1a4be1[_0xe37e('0xd8')]||undefined,'CampaignId':_0x1a4be1[_0xe37e('0xd9')]||undefined})[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x1f4')));_0x5c1452['createHistory'](createObjHistory(_0xbadc69,_0x1a4be1,_0xe37e('0x1f5'),0x17,_0xe37e('0x1f6')))[_0xe37e('0xb2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5c1452[_0xe37e('0xd3')](createObjHistory(_0xbadc69,_0x1a4be1,_0xe37e('0x1f7'),0x16,_0xe37e('0x1f8')),_0xe37e('0x1f9'),_0xe37e('0x1fa'));}}}}else{_0xbadc69['outboundBlacklistCallsDay']+=0x1;_0x5c1452[_0xe37e('0xd3')](createObjHistory(_0xbadc69,_0x1a4be1,_0xe37e('0x1fb'),0xd,_0xe37e('0x1fc')),_0xe37e('0x1fd'),_0xe37e('0x1fe'));throw'inBlackList';}};};Dialer['prototype'][_0xe37e('0x169')]=function(_0x2b92ed){var _0x11a254=this;var _0x14f611=_0x2b92ed[_0xe37e('0x1ff')]-_0x2b92ed[_0xe37e('0x73')]-_0x2b92ed['temp'];emitCampaignSummary(_0x2b92ed);if(_0x14f611>0x0){if(_0x14f611>this[_0xe37e('0x22')]){_0x14f611=this[_0xe37e('0x22')];}_0x2b92ed[_0xe37e('0xc5')]+=_0x14f611;this[_0xe37e('0xc7')](_0x2b92ed['id'],_0x14f611,_0x2b92ed[_0xe37e('0x200')],_0x2b92ed)[_0xe37e('0xba')](function(_0x218d7c){_0x2b92ed[_0xe37e('0xc5')]-=_0x14f611;_0x2b92ed['temp']=_0x2b92ed[_0xe37e('0xc5')]>0x0?_0x2b92ed[_0xe37e('0xc5')]:0x0;if(!checkContactEmpty(_0x218d7c)){_0x2b92ed[_0xe37e('0x40')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xe37e('0x81')](_0xe37e('0x201')+_0x2b92ed[_0xe37e('0x3e')]);}else{_0x2b92ed[_0xe37e('0x73')]+=_0x218d7c['length'];_0x2b92ed[_0xe37e('0x40')]=_0xe37e('0x202');for(var _0x3b0c61=0x0;_0x3b0c61<_0x218d7c[_0xe37e('0x99')];_0x3b0c61+=0x1){_0x2b92ed['ivrTotalCallsDays']+=0x1;if(_[_0xe37e('0xae')](_0x218d7c[_0x3b0c61])||_['isNil'](_0x218d7c[_0x3b0c61][_0xe37e('0x174')])||_['isNil'](_0x218d7c[_0x3b0c61][_0xe37e('0x174')][_0xe37e('0x175')])){_0x11a254[_0xe37e('0xd1')](_0xe37e('0x203'),_0x2b92ed,_0x218d7c[_0x3b0c61]);}else{_0x11a254[_0xe37e('0xbc')](_[_0xe37e('0xd4')](_0x218d7c[_0x3b0c61],[_0xe37e('0xd9'),_0xe37e('0x204')]))[_0xe37e('0xba')](_0x11a254[_0xe37e('0x1e9')](_0x2b92ed,_0x218d7c[_0x3b0c61]))['catch'](_0x11a254['loggerHandler'](_0xe37e('0x205'),_0x2b92ed));}}}})[_0xe37e('0xb2')](loggerGetContactDialer(_0xe37e('0x206'),_0x2b92ed,_0x14f611));}};Dialer['prototype']['handlePower']=function(_0xadbfe9,_0x3b74db){var _0x5e5707=this;var _0x481b1f=[];var _0x5946e8=_0x3b74db>=0x1?_0x3b74db:0x1;if(_0xadbfe9['dialMethod']===_0xe37e('0x7')){_0x5946e8=0x1;}var _0x4cae62=Math[_0xe37e('0x1c7')](_0xadbfe9['available']*_0x5946e8)-_0xadbfe9[_0xe37e('0x73')]-_0xadbfe9['temp'];emitVoiceQueueSummary(_0xadbfe9);if(_0xadbfe9[_0xe37e('0x207')]>0x0){var _0x27ba3d=_0xadbfe9[_0xe37e('0x207')]-_0xadbfe9[_0xe37e('0x73')]-_0xadbfe9[_0xe37e('0x55')]-_0xadbfe9[_0xe37e('0xc5')]-_0xadbfe9['pTalking'];if(_0x4cae62>_0x27ba3d){_0x4cae62=_0x27ba3d;}}if(_0x4cae62>0x0){if(_0xadbfe9[_0xe37e('0x5b')]===_0xe37e('0x7')){_0x4cae62=0x1;}if(_0x4cae62>this[_0xe37e('0x22')]){_0x4cae62=this['maxNumberOriginate'];}_0xadbfe9[_0xe37e('0xc5')]+=_0x4cae62;for(var _0x51b0d9 in this[_0xe37e('0x21')]){if(typeof this['agents'][_0x51b0d9]!==_0xe37e('0x9a')){if(this['agents'][_0x51b0d9][_0xe37e('0xa6')]===_0xe37e('0x208')&&this[_0xe37e('0x21')][_0x51b0d9][_0xe37e('0xb0')]===_0xe37e('0x209')){_0x481b1f['push'](this[_0xe37e('0x21')][_0x51b0d9]['id']);}}}this[_0xe37e('0xc4')](_0xadbfe9['id'],_0x481b1f,_0x4cae62,_0xadbfe9[_0xe37e('0x200')],_0xadbfe9)[_0xe37e('0xba')](function(_0x3858da){_0xadbfe9['temp']-=_0x4cae62;_0xadbfe9[_0xe37e('0xc5')]=_0xadbfe9[_0xe37e('0xc5')]>0x0?_0xadbfe9[_0xe37e('0xc5')]:0x0;if(!checkContactEmpty(_0x3858da)){_0x5e5707[_0xe37e('0xb8')](_0xadbfe9)['then'](sendMessageReschedule(_0xadbfe9))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x20a')));}else{_0xadbfe9[_0xe37e('0x73')]+=_0x3858da[_0xe37e('0x99')];_0xadbfe9[_0xe37e('0x40')]=_0xadbfe9[_0xe37e('0x5b')]===_0xe37e('0x7')?'ACTIVE':'RUNNING';for(var _0x28d5f2=0x0;_0x28d5f2<_0x3858da[_0xe37e('0x99')];_0x28d5f2+=0x1){if(_['isNil'](_0x3858da[_0x28d5f2])||_[_0xe37e('0xae')](_0x3858da[_0x28d5f2]['Contact'])||_[_0xe37e('0xae')](_0x3858da[_0x28d5f2][_0xe37e('0x174')][_0xe37e('0x175')])){_0x5e5707[_0xe37e('0xd1')]('[actionOriginate]\x20',_0xadbfe9,_0x3858da[_0x28d5f2]);}else{_0x5e5707[_0xe37e('0xbb')](_['pick'](_0x3858da[_0x28d5f2],['VoiceQueueId','Contact.phone']))[_0xe37e('0xba')](_0x5e5707['checkContactBlack'](_0xadbfe9,_0x3858da[_0x28d5f2]))[_0xe37e('0xb2')](_0x5e5707[_0xe37e('0xd0')]('[actionOriginate]\x20',_0xadbfe9));}}}})[_0xe37e('0xb2')](loggerGetContactDialer(_0xe37e('0x20b'),_0xadbfe9,_0x4cae62));}};Dialer['prototype']['handlePredictive']=function(_0xbb4044){if(_0xbb4044[_0xe37e('0x207')]>0x0){var _0x1a7966=_0xbb4044[_0xe37e('0x207')]-_0xbb4044['originated']-_0xbb4044['talking'];if(_0x1a7966>0x0){this[_0xe37e('0x20c')](_0xbb4044);}else{loggerPredictiveCalls[_0xe37e('0x81')](_0xe37e('0x20d'));}}else{this[_0xe37e('0x20c')](_0xbb4044);}};Dialer[_0xe37e('0x1b')][_0xe37e('0x20c')]=function(_0x39f17f){var _0x966d57=this;var _0x31dd72=[];_0x39f17f[_0xe37e('0x73')]+=0x1;for(var _0x2bde44 in this[_0xe37e('0x21')]){if(typeof this[_0xe37e('0x21')][_0x2bde44]!==_0xe37e('0x9a')){if(this[_0xe37e('0x21')][_0x2bde44][_0xe37e('0xa6')]==='not_inuse'&&this[_0xe37e('0x21')][_0x2bde44][_0xe37e('0xb0')]===_0xe37e('0x209')){_0x31dd72['push'](this[_0xe37e('0x21')][_0x2bde44]['id']);}}}this[_0xe37e('0xc4')](_0x39f17f['id'],_0x31dd72,0x1,_0x39f17f[_0xe37e('0x200')],_0x39f17f)[_0xe37e('0xba')](function(_0x5b15f4){if(!checkContactEmpty(_0x5b15f4)){checkContactLowerLimitOriginate(_0x39f17f,0x1,0x0);_0x966d57[_0xe37e('0xb8')](_0x39f17f)['then'](sendMessageReschedule(_0x39f17f))[_0xe37e('0xb2')](loggerCatch(_0xe37e('0x20a')));}else{_0x39f17f[_0xe37e('0x40')]=_0xe37e('0x202');if(_[_0xe37e('0xae')](_0x5b15f4[0x0])||_[_0xe37e('0xae')](_0x5b15f4[0x0][_0xe37e('0x174')])||_[_0xe37e('0xae')](_0x5b15f4[0x0][_0xe37e('0x174')][_0xe37e('0x175')])){_0x966d57[_0xe37e('0xd1')]('[actionOriginate]\x20',_0x39f17f,_0x5b15f4[0x0]);}else{_0x966d57[_0xe37e('0xbb')](_[_0xe37e('0xd4')](_0x5b15f4[0x0],[_0xe37e('0xd8'),_0xe37e('0x204')]))[_0xe37e('0xba')](_0x966d57[_0xe37e('0x1e9')](_0x39f17f,_0x5b15f4[0x0]))[_0xe37e('0xb2')](_0x966d57[_0xe37e('0xd0')](_0xe37e('0x20e'),_0x39f17f));}}})[_0xe37e('0xb2')](loggerGetContactDialer(_0xe37e('0x20f'),_0x39f17f,0x1));emitVoiceQueueSummary(_0x39f17f);};Dialer[_0xe37e('0x1b')][_0xe37e('0x1e6')]=function(_0x3d85cd,_0x37f14d,_0x3fffb8,_0x176317,_0xa97920,_0x474d10){loggerPredictive['info'](_0xe37e('0x210'));loggerPredictive[_0xe37e('0x81')](_0xe37e('0x211'),_0x3d85cd);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x212'),_0x37f14d);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x213'),_0x3fffb8);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x214'),_0x176317);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x215'),_0xa97920);loggerPredictive['info'](_0xe37e('0x87'));return new BPromise(function(_0x530544,_0x1f3ae3){if(_0x3d85cd<=0x0||isNaN(_0x3d85cd)){return _0x1f3ae3(msgResponse(_0xe37e('0x216'),_0xe37e('0x47'),_0xe37e('0x217')+_0x3d85cd));}if(_0x3fffb8<=0x0||isNaN(_0x3fffb8)){return _0x1f3ae3(msgResponse('[abandonmentRate]','Error','Ts\x20=\x20'+_0x3fffb8));}if(_0x176317<=0x0||isNaN(_0x176317)){return _0x1f3ae3(msgResponse(_0xe37e('0x216'),_0xe37e('0x47'),_0xe37e('0x218')+_0x176317));}if(_0x37f14d<=0x0||isNaN(_0x37f14d)){return _0x1f3ae3(msgResponse(_0xe37e('0x216'),_0xe37e('0x47'),_0xe37e('0x219')+_0x37f14d));}if(_0xa97920<=0x0||isNaN(_0xa97920)){return _0x1f3ae3(msgResponse(_0xe37e('0x216'),_0xe37e('0x47'),_0xe37e('0x21a')+_0xa97920));}_0x474d10=_0x474d10||0x0;var _0x405034=0x1/_0x3fffb8;var _0xe1b355=0x0;var _0x213537=0x0;var _0x248caf=0x0;var _0xa96092=0x0;for(var _0x13df88=0x0;_0x248caf<_0xa97920;_0x13df88+=0x1){_0x213537=_0x13df88/_0x37f14d;_0xe1b355=(_0x176317*_0x213537+_0x474d10)/_0x405034;_0x248caf=erlangb(_0xe1b355,_0x3d85cd);_0xa96092=_0xe1b355/_0x3d85cd*(0x1-erlangb(_0xe1b355,_0x3d85cd));}return _0x530544({'erlangCalls':_0x13df88,'erlangCallToSecond':_0x37f14d/_0x13df88,'erlangAbandonmentRate':_0x248caf,'erlangBusyFactor':_0xa96092});});};Dialer[_0xe37e('0x1b')][_0xe37e('0x1e1')]=function(_0xfc3094,_0x4d58db,_0x132b82,_0x55353b,_0x9cbd4c,_0x411a7b){loggerPredictive[_0xe37e('0x81')](_0xe37e('0x21b'));loggerPredictive['info'](_0xe37e('0x211'),_0xfc3094);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x212'),_0x4d58db);loggerPredictive['info'](_0xe37e('0x213'),_0x132b82);loggerPredictive[_0xe37e('0x81')]('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',_0x55353b);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x21c'),_0x9cbd4c);loggerPredictive[_0xe37e('0x81')](_0xe37e('0x87'));return new BPromise(function(_0x17f7a1,_0x3be2e4){if(_0xfc3094<=0x0||isNaN(_0xfc3094)){return _0x3be2e4(msgResponse('[busyFactor]',_0xe37e('0x47'),_0xe37e('0x217')+_0xfc3094));}if(_0x132b82<=0x0||isNaN(_0x132b82)){return _0x3be2e4(msgResponse(_0xe37e('0x21d'),_0xe37e('0x47'),_0xe37e('0x21e')+_0x132b82));}if(_0x55353b<=0x0||isNaN(_0x55353b)){return _0x3be2e4(msgResponse(_0xe37e('0x21d'),'Error',_0xe37e('0x218')+_0x55353b));}if(_0x4d58db<=0x0||isNaN(_0x4d58db)){return _0x3be2e4(msgResponse(_0xe37e('0x21d'),_0xe37e('0x47'),_0xe37e('0x219')+_0x4d58db));}if(_0x9cbd4c<=0x0||isNaN(_0x9cbd4c)){return _0x3be2e4(msgResponse(_0xe37e('0x21d'),_0xe37e('0x47'),_0xe37e('0x21f')+_0x9cbd4c));}_0x411a7b=_0x411a7b||0x0;var _0x1d6274=0x1/_0x132b82;var _0x105789=0x0;var _0x4ac5a9=0x0;var _0x124fc9=0x0;var _0x5638f2=0x0;for(var _0x45a873=0x0;_0x5638f2<_0x9cbd4c;_0x45a873+=0x1){_0x4ac5a9=_0x45a873/_0x4d58db;_0x105789=(_0x55353b*_0x4ac5a9+_0x411a7b)/_0x1d6274;_0x124fc9=erlangb(_0x105789,_0xfc3094);_0x5638f2=_0x105789/_0xfc3094*(0x1-erlangb(_0x105789,_0xfc3094));}return _0x17f7a1({'erlangCalls':_0x45a873,'erlangCallToSecond':_0x4d58db/_0x45a873,'erlangAbandonmentRate':_0x124fc9,'erlangBusyFactor':_0x5638f2});});};module['exports']=Dialer; \ No newline at end of file +var _0x5891=['outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','startProgressive','Trunk','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','milliseconds','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]','undefined','isNil','Action','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','active','SIP/%s','status','unmonitored','saveInDb','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','agent','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','Abandoned','channel','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','indexOf','content','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','predictive','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','handleIvr','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','checkIfTime','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','check\x20failure','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','abandonmentRate','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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','m\x20=\x20','p\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','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./agentComplete','./queueCallerAbandon','env','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','diff','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout'];(function(_0x42c58d,_0x1ee158){var _0x5d6213=function(_0x2018f9){while(--_0x2018f9){_0x42c58d['push'](_0x42c58d['shift']());}};_0x5d6213(++_0x1ee158);}(_0x5891,0x1c1));var _0x1589=function(_0x5d109b,_0x2c17ea){_0x5d109b=_0x5d109b-0x0;var _0x17e59c=_0x5891[_0x5d109b];return _0x17e59c;};'use strict';var util=require(_0x1589('0x0'));var _=require(_0x1589('0x1'));var BPromise=require(_0x1589('0x2'));var uuid=require(_0x1589('0x3'));var moment=require(_0x1589('0x4'));var rr=require('rr');var md5=require(_0x1589('0x5'));var Redis=require(_0x1589('0x6'));var ut=require(_0x1589('0x7'));var config=require(_0x1589('0x8'));var logger=require(_0x1589('0x9'))(_0x1589('0xa'));var loggerBooked=require(_0x1589('0x9'))(_0x1589('0xb'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x1589('0x9'))(_0x1589('0xc'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x1589('0xd'));config[_0x1589('0xe')]=_[_0x1589('0xf')](config[_0x1589('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1589('0xe')]));var cmHopper=require(_0x1589('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1589('0x11'));var voiceQueueRt=require(_0x1589('0x12'));var RpcSetting=require(_0x1589('0x13'));var Action=require(_0x1589('0x14'));var History=require(_0x1589('0x15'));var Final=require('./final');var AgentComplete=require(_0x1589('0x16'));var QueueCallerAbandon=require(_0x1589('0x17'));var Hangup=require('./hangup');var ipAgi=process[_0x1589('0x18')]['XCALLY_IP_AGI']||_0x1589('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x1589('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1589('0x1b')][_0x1589('0x1c')]=function(_0xa64f96){this[_0x1589('0x1d')]=this[_0x1589('0x1d')]?this['tail'][_0x1589('0x1e')](_0xa64f96):_0xa64f96();};function Dialer(_0x402cda,_0x4383e2){this[_0x1589('0x1f')]=new Sequence();this[_0x1589('0x20')]=_0x4383e2;this[_0x1589('0x21')]=_0x402cda[_0x1589('0x21')];this[_0x1589('0x22')]=_0x402cda[_0x1589('0x22')];this[_0x1589('0x23')]=_0x402cda[_0x1589('0x23')];this[_0x1589('0x24')]=_0x402cda[_0x1589('0x24')];this['maxNumberOriginate']=config[_0x1589('0x25')]||0x2;this[_0x1589('0x26')]={};this[_0x1589('0x27')]={};this[_0x1589('0x28')]={};this[_0x1589('0x29')]={};this[_0x1589('0x2a')]={};this[_0x1589('0x2b')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x1589('0x2c')]={};this['queueBookedRR']={};ami['on'](_0x1589('0x2d'),this[_0x1589('0x2e')][_0x1589('0x2f')](this));ami['on'](_0x1589('0x30'),this[_0x1589('0x31')][_0x1589('0x2f')](this));ami['on'](_0x1589('0x32'),this[_0x1589('0x33')][_0x1589('0x2f')](this));ami['on'](_0x1589('0x34'),this[_0x1589('0x35')]['bind'](this));ami['on'](_0x1589('0x36'),this[_0x1589('0x37')]['bind'](this));ami['on'](_0x1589('0x38'),this[_0x1589('0x39')][_0x1589('0x2f')](this));ami['on']('newexten',this[_0x1589('0x3a')][_0x1589('0x2f')](this));ami['on'](_0x1589('0x3b'),this[_0x1589('0x3c')][_0x1589('0x2f')](this));ami['on']('queuemember',this['syncQueueMember'][_0x1589('0x2f')](this));ami['on'](_0x1589('0x3d'),this[_0x1589('0x3e')][_0x1589('0x2f')](this));this[_0x1589('0x3f')]();this[_0x1589('0x40')]();RpcSetting['getSettings']()[_0x1589('0x41')](function(_0x5915e3){previewRecallmeReminderInterval=_0x5915e3['previewRecallmeReminderInterval'];});}function isNotNull(_0x5afe7a){return _0x5afe7a!==null&&!_[_0x1589('0x42')](_0x5afe7a);}function checkIsLoggedIn(_0x47f040,_0x44572c){return function(){if(_0x44572c<=0x0){_0x47f040[_0x1589('0x43')]=_0x1589('0x44');throw _0x47f040[_0x1589('0x45')]+_0x1589('0x46');}};}function isActive(_0x234739){return _0x234739;}function checkIsActive(_0x279b39,_0x5d963c){return function(){if(!isActive(_0x5d963c)){_0x279b39[_0x1589('0x43')]=_0x1589('0x47');throw _0x279b39[_0x1589('0x45')]+_0x1589('0x48');}};}function checkInterval(_0x230378){return function(){if(!isNotNull(_0x230378[_0x1589('0x49')])){_0x230378[_0x1589('0x43')]=_0x1589('0x4a');throw _0x230378[_0x1589('0x45')]+_0x1589('0x4b');}if(!isNotNull(_0x230378[_0x1589('0x49')][_0x1589('0x4c')])){_0x230378[_0x1589('0x43')]='INTERVAL_IS_NULL';throw _0x230378[_0x1589('0x45')]+_0x1589('0x4b');}if(!isNotNull(_[_0x1589('0x4d')](_0x230378['Interval'][_0x1589('0x4c')]))){_0x230378[_0x1589('0x43')]=_0x1589('0x4a');throw _0x230378[_0x1589('0x45')]+_0x1589('0x4b');}};}function msgResponse(_0x8345c6,_0x5aaaf8,_0xce3915){return{'action':_0x8345c6,'response':_0x5aaaf8,'message':_0xce3915,'stack':_0xce3915};}function myreject(_0x432360){return function(_0x147018){return _0x432360(msgResponse('[ifTime][Action]','Error',JSON['stringify'](_0x147018)));};}function getSeconds(_0x58be2e,_0x329c17){var _0x40545b=moment(_0x58be2e)['milliseconds'](0x0);var _0x5b190e=moment(_0x329c17)['milliseconds'](0x0);return _0x40545b[_0x1589('0x4e')](_0x5b190e,'seconds');}function emit(_0x1f75b3,_0x58f38c,_0x5895a6){io['to'](_0x1f75b3)['emit'](_0x58f38c,_0x5895a6);}function emitVoiceQueueSummary(_0x7d7ee9){if(_0x7d7ee9[_0x1589('0x4f')]===_0x1589('0x50')){var _0x5b2ac0={'id':_0x7d7ee9['id'],'name':_0x7d7ee9[_0x1589('0x45')],'strategy':_0x7d7ee9[_0x1589('0x51')],'answered':_0x7d7ee9[_0x1589('0x52')],'available':_0x7d7ee9[_0x1589('0x53')],'loggedIn':_0x7d7ee9[_0x1589('0x54')],'pTalking':_0x7d7ee9[_0x1589('0x55')],'sumBillable':_0x7d7ee9[_0x1589('0x56')],'sumDuration':_0x7d7ee9[_0x1589('0x57')],'sumHoldTime':_0x7d7ee9[_0x1589('0x58')]||0x0,'talking':_0x7d7ee9[_0x1589('0x59')],'total':_0x7d7ee9[_0x1589('0x5a')],'type':_0x7d7ee9[_0x1589('0x4f')],'unmanaged':_0x7d7ee9['unmanaged'],'abandoned':_0x7d7ee9['abandoned'],'waiting':_0x7d7ee9[_0x1589('0x5b')],'loggedInDb':_0x7d7ee9['loggedInDb'],'dialActive':_0x7d7ee9[_0x1589('0x5c')],'dialMethod':_0x7d7ee9['dialMethod'],'dialOriginateCallerIdName':_0x7d7ee9[_0x1589('0x5d')],'dialOriginateCallerIdNumber':_0x7d7ee9[_0x1589('0x5e')],'dialOriginateTimeout':_0x7d7ee9[_0x1589('0x5f')],'dialPrefix':_0x7d7ee9[_0x1589('0x60')],'outboundAnswerAgiCallsDay':_0x7d7ee9[_0x1589('0x61')],'outboundAnswerCallsDay':_0x7d7ee9[_0x1589('0x62')],'outboundBlacklistCallsDay':_0x7d7ee9[_0x1589('0x63')],'outboundBusyCallsDay':_0x7d7ee9['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x7d7ee9[_0x1589('0x64')],'outboundDropCallsDayACS':_0x7d7ee9[_0x1589('0x65')],'outboundDropCallsDayCallersExit':_0x7d7ee9[_0x1589('0x66')],'outboundDropCallsDayTimeout':_0x7d7ee9[_0x1589('0x67')],'outboundNoAnswerCallsDay':_0x7d7ee9[_0x1589('0x68')],'outboundNoSuchCallsDay':_0x7d7ee9[_0x1589('0x69')],'outboundOriginateFailureCallsDay':_0x7d7ee9[_0x1589('0x6a')],'outboundReCallsDay':_0x7d7ee9[_0x1589('0x6b')],'outboundRejectCallsDay':_0x7d7ee9[_0x1589('0x6c')],'outboundUnknownCallsDay':_0x7d7ee9[_0x1589('0x6d')],'predictiveIntervalAnsweredCalls':_0x7d7ee9[_0x1589('0x6e')],'predictiveIntervalAvgHoldtime':_0x7d7ee9[_0x1589('0x6f')],'predictiveIntervalAvgTalktime':_0x7d7ee9[_0x1589('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x7d7ee9[_0x1589('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x7d7ee9[_0x1589('0x72')],'predictiveIntervalErlangCalls':_0x7d7ee9[_0x1589('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x7d7ee9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x7d7ee9[_0x1589('0x74')],'predictiveIntervalMultiplicativeFactor':_0x7d7ee9[_0x1589('0x75')],'predictiveIntervalPauses':_0x7d7ee9['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x7d7ee9[_0x1589('0x76')],'predictiveIntervalTotalCalls':_0x7d7ee9['predictiveIntervalTotalCalls'],'message':_0x7d7ee9[_0x1589('0x43')],'originated':_0x7d7ee9[_0x1589('0x77')],'erlangCalls':_0x7d7ee9[_0x1589('0x78')],'erlangCallToSecond':_0x7d7ee9[_0x1589('0x79')],'erlangAbandonmentRate':_0x7d7ee9['erlangAbandonmentRate'],'erlangBusyFactor':_0x7d7ee9['erlangBusyFactor'],'startPredictive':_0x7d7ee9[_0x1589('0x2b')],'startProgressive':_0x7d7ee9[_0x1589('0x7a')]};if(_0x7d7ee9[_0x1589('0x7b')]){_0x5b2ac0['Trunk']={'id':_0x7d7ee9[_0x1589('0x7b')]['id'],'name':_0x7d7ee9[_0x1589('0x7b')][_0x1589('0x45')],'active':_0x7d7ee9[_0x1589('0x7b')]['active'],'callerid':_0x7d7ee9[_0x1589('0x7b')][_0x1589('0x7c')]};}if(_0x7d7ee9['Interval']){_0x5b2ac0[_0x1589('0x49')]={'id':_0x7d7ee9['Interval']['id'],'name':_0x7d7ee9[_0x1589('0x49')][_0x1589('0x45')]};}var _0x3d8317=md5(JSON[_0x1589('0x7d')](_0x5b2ac0));if(_0x7d7ee9[_0x1589('0x5')]!==_0x3d8317){_0x7d7ee9[_0x1589('0x5')]=_0x3d8317;emit(util[_0x1589('0x7e')](_0x1589('0x7f'),_0x5b2ac0[_0x1589('0x45')]),_0x1589('0x80'),_0x5b2ac0);}}}function emitCampaignSummary(_0x4d38e1){if(_0x4d38e1[_0x1589('0x4f')]==='ivr'){emit(util[_0x1589('0x7e')]('campaign:ivr:%s',_0x4d38e1[_0x1589('0x45')]),_0x1589('0x81'),_0x4d38e1);}}function checkGetDataPredictive(_0x3a8691){if(isNotNull(_0x3a8691)&&!_[_0x1589('0x4d')](_0x3a8691)){loggerPredictive[_0x1589('0x82')](_0x1589('0x83'));loggerPredictive['info'](_0x1589('0x84'),_0x3a8691[_0x1589('0x85')]);loggerPredictive[_0x1589('0x82')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a8691['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x1589('0x82')](_0x1589('0x86'),_0x3a8691['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x1589('0x82')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a8691[_0x1589('0x71')]);loggerPredictive['info'](_0x1589('0x87'),_0x3a8691[_0x1589('0x6f')]);loggerPredictive['info'](_0x1589('0x88'),_0x3a8691[_0x1589('0x70')]);loggerPredictive['info']('---------------------------');if(_0x3a8691[_0x1589('0x85')]>0x0){if(!_[_0x1589('0x42')](_0x3a8691['predictiveIntervalAvgTalktime'])&&_0x3a8691[_0x1589('0x70')]>0x0){return!![];}loggerPredictive[_0x1589('0x82')](_0x1589('0x89'));if(!_['isUndefined'](_0x3a8691[_0x1589('0x6f')])&&_0x3a8691[_0x1589('0x6f')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x1589('0x82')](_0x1589('0x8a'));}}else{loggerPredictive['info'](_0x1589('0x8b'));}return![];}function mergeDataErlangB(_0x34e391){return function(_0x41edfd){loggerPredictive[_0x1589('0x82')](_0x1589('0x8c'));loggerPredictive[_0x1589('0x82')](_0x1589('0x8d'),_0x41edfd[_0x1589('0x78')]);loggerPredictive[_0x1589('0x82')](_0x1589('0x8e'),_0x41edfd['erlangCallToSecond']);loggerPredictive[_0x1589('0x82')](_0x1589('0x8f'),_0x41edfd[_0x1589('0x90')]);loggerPredictive[_0x1589('0x82')](_0x1589('0x91'),_0x41edfd[_0x1589('0x92')]);loggerPredictive[_0x1589('0x82')](_0x1589('0x8f'),_0x41edfd[_0x1589('0x90')]);loggerPredictive[_0x1589('0x82')](_0x1589('0x93'));_[_0x1589('0x94')](_0x34e391,_0x41edfd);};}function getDiff(_0x1fa2a3){var _0x85ca4d=moment()[_0x1589('0x95')](0x0);var _0x10d135=moment(_0x1fa2a3)[_0x1589('0x95')](0x0);return _0x85ca4d[_0x1589('0x4e')](_0x10d135,_0x1589('0x96'));}function ifInterval(_0x2d9e94,_0x4b442a){if(_[_0x1589('0x42')](_0x4b442a)){return![];}return getDiff(_0x4b442a)<_0x2d9e94*0x3c;}function freeVariablesPredictive(_0xb6878a){if(isNotNull(_0xb6878a)){if(!_[_0x1589('0x42')](_0xb6878a[_0x1589('0x7a')])){_0xb6878a[_0x1589('0x7a')]=undefined;loggerPredictive['info'](_0xb6878a[_0x1589('0x45')],_0x1589('0x97'));}if(!_[_0x1589('0x42')](_0xb6878a[_0x1589('0x2b')])){_0xb6878a['startPredictive']=undefined;loggerPredictive[_0x1589('0x82')](_0xb6878a[_0x1589('0x45')],_0x1589('0x98'));}if(!_['isUndefined'](_0xb6878a['handlePredictive'])){clearInterval(_0xb6878a['handlePredictive']);_0xb6878a[_0x1589('0x99')]=undefined;loggerPredictive[_0x1589('0x82')](_0xb6878a[_0x1589('0x45')],_0x1589('0x9a'));}}}function erlangb(_0x5bd523,_0x5d6bae){if(_0x5d6bae===0x0){return 0x0;}var _0x1c4d87=0x1;for(var _0x45a076=0x1;_0x45a076<=_0x5d6bae;_0x45a076+=0x1){_0x1c4d87=0x1+_0x1c4d87*_0x45a076/_0x5bd523;}return 0x1/_0x1c4d87;}function isVoiceQueueOutbound(_0x271a1a){return _0x271a1a===_0x1589('0x50');}function isNotPreview(_0x241e41){return _0x241e41!=='preview';}function isCampaignIvr(_0x9a24da){return _0x9a24da===_0x1589('0x9b');}function getCallerId(_0x4123f6,_0x2dbe14,_0x5f5812){if(!_[_0x1589('0x42')](_0x5f5812)&&typeof _0x5f5812===_0x1589('0x9c')&&!_[_0x1589('0x4d')](_0x5f5812)){if(!_['isUndefined'](_0x2dbe14)&&typeof _0x2dbe14===_0x1589('0x9c')&&!_[_0x1589('0x4d')](_0x2dbe14)){return util[_0x1589('0x7e')](_0x1589('0x9d'),_0x2dbe14,_0x5f5812);}return util[_0x1589('0x7e')](_0x1589('0x9d'),_0x5f5812,_0x5f5812);}if(!_[_0x1589('0x42')](_0x4123f6)&&typeof _0x4123f6===_0x1589('0x9c')&&!_[_0x1589('0x4d')](_0x4123f6)){return _0x4123f6;}return _0x1589('0x9e');}function loggerCatchQueueSummary(_0x22f64d,_0x4acc4f){return function(_0x5e4e7c){freeVariablesPredictive(_0x4acc4f);emitVoiceQueueSummary(_0x4acc4f);emitCampaignSummary(_0x4acc4f);loggerSyncQueueSummary['error'](_0x22f64d,util[_0x1589('0x9f')](_0x5e4e7c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x49b1bb,_0x40efdd){return function(_0x3044ac){loggerPredictive[_0x1589('0xa0')](_0x40efdd[_0x1589('0x45')],_0x49b1bb);loggerPredictive[_0x1589('0xa0')](_0x3044ac[_0x1589('0xa1')]);freeVariablesPredictive(_0x40efdd);};}function loggerCatch(_0x3ebeaa){return function(_0x1629ce){logger['error'](_0x3ebeaa,util['inspect'](_0x1629ce,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x340a8c){return _0x340a8c&&!_['isUndefined'](_0x340a8c)&&_0x340a8c['length']>0x0;}function decremetOriginate(_0x4887bb){if(!_['isUndefined'](_0x4887bb)&&_0x4887bb!==null){if(typeof _0x4887bb[_0x1589('0x77')]!=='undefined'){if(_0x4887bb[_0x1589('0x77')]>0x0){_0x4887bb['originated']-=0x1;}else{logger[_0x1589('0xa0')](_0x1589('0xa2'));}}}else{logger[_0x1589('0xa0')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0xa0cafa,_0x423898,_0xe8fe86){if(_0x423898>_0xe8fe86){for(var _0x165375=0x0;_0x165375<_0x423898-_0xe8fe86;_0x165375+=0x1){decremetOriginate(_0xa0cafa);}}}function loggerGetContactDialer(_0x5c93f0,_0x340363,_0x257133){return function(_0x15190d){checkContactLowerLimitOriginate(_0x340363,_0x257133,0x0);logger['error'](_0x5c93f0,util[_0x1589('0x9f')](_0x15190d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xf062e5){return function(_0x542877){if(isNotNull(_0x542877)&&isNotNull(_0x542877[0x0])){if(_0x542877[0x0][_0x1589('0xa3')]>0x0){_0xf062e5[_0x1589('0x43')]=_0x1589('0xa4');logger[_0x1589('0x82')](_0x1589('0xa5')+_0xf062e5[_0x1589('0x45')],_0x542877[0x0]['contactsRescheduled'],_0x1589('0xa6'));}else{_0xf062e5[_0x1589('0x43')]=_0x1589('0xa7');logger['info'](_0x1589('0xa8')+_0xf062e5[_0x1589('0x45')]);}}};}function notSendMessagesQueue(_0x553f43){if(_0x553f43[_0x1589('0xa9')]){freeVariablesPredictive(_0x553f43);if(_0x553f43[_0x1589('0x77')]===0x0&&_0x553f43[_0x1589('0x59')]===0x0&&_0x553f43[_0x1589('0x5b')]===0x0&&(_0x553f43['pTalking']||0x0)===0x0){_0x553f43['sendMessageOneNotActive']=![];_0x553f43[_0x1589('0x53')]=0x0;_0x553f43[_0x1589('0x43')]=_0x1589('0x47');loggerSyncQueueSummary['error'](_0x1589('0xaa'),_0x553f43[_0x1589('0x45')],_0x1589('0xab'));}else{_0x553f43[_0x1589('0x43')]=_0x1589('0xac');loggerSyncQueueSummary[_0x1589('0xa0')](_0x1589('0xaa'),_0x553f43['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x553f43);}}function notSendMessagesCampaign(_0x1dc183){if(_0x1dc183[_0x1589('0xa9')]){if(_0x1dc183['originated']===0x0){_0x1dc183[_0x1589('0xa9')]=![];_0x1dc183[_0x1589('0x43')]=_0x1589('0x47');loggerSyncQueueSummary[_0x1589('0xa0')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1dc183['name'],_0x1589('0xab'));}else{_0x1dc183[_0x1589('0x43')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x1589('0xa0')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1dc183[_0x1589('0x45')],_0x1589('0xad'));}emitCampaignSummary(_0x1dc183);}}function createObjHistory(_0x57cf6e,_0x1ffd33,_0x104fb5,_0x4ad7c2,_0xa10864){_0x57cf6e['message']=_0x104fb5;var _0xa8691c=new Action(_0x57cf6e,_0x1ffd33);var _0x5ef6ea=new History(_0xa8691c);_0x5ef6ea[_0x1589('0xae')]=_0x4ad7c2;_0x5ef6ea[_0x1589('0xaf')]=_0xa10864;_0x5ef6ea[_0x1589('0xb0')]=_0xa8691c[_0x1589('0xb1')];return _0x5ef6ea;}Dialer[_0x1589('0x1b')]['loopClearZombieChannels']=function(){var _0x3581ad=this;setInterval(function(){_0x3581ad['clearZombieChannels'](_0x3581ad[_0x1589('0x29')],_0x1589('0xb2'));_0x3581ad[_0x1589('0xb3')](_0x3581ad[_0x1589('0x27')],_0x1589('0xb4'));},0x32c8);};Dialer[_0x1589('0x1b')][_0x1589('0xb3')]=function(_0x3bf74a,_0x2df1a2){var _0x5c14e0=this;for(var _0x421210 in _0x3bf74a){if(typeof _0x3bf74a[_0x421210]!==_0x1589('0xb5')){this['sequence'][_0x1589('0x1c')](function(){if(!_[_0x1589('0xb6')](_0x3bf74a[_0x421210])){return ami[_0x1589('0xb7')]({'action':'status','channel':_0x3bf74a[_0x421210]['channel']})[_0x1589('0xb8')](function(_0x3f12f9){if(_0x3f12f9[_0x1589('0x43')]===_0x1589('0xb9')){setTimeout(function(){if(_0x3bf74a[_0x421210]&&_0x3bf74a[_0x421210]['type']!=='ivr'){_0x5c14e0[_0x1589('0xba')](_0x5c14e0['voiceQueues'][_0x3bf74a[_0x421210][_0x1589('0xbb')]]);logger[_0x1589('0xa0')](_0x1589('0xbc'),_0x2df1a2,_0x421210,_0x3bf74a[_0x421210][_0x1589('0xbb')]);delete _0x3bf74a[_0x421210];}if(_0x3bf74a[_0x421210]&&_0x3bf74a[_0x421210]['type']==='ivr'){_0x5c14e0[_0x1589('0xba')](_0x5c14e0[_0x1589('0x22')][_0x3bf74a[_0x421210][_0x1589('0xbb')]]);logger[_0x1589('0xa0')](_0x1589('0xbd'),_0x2df1a2,_0x421210,_0x3bf74a[_0x421210][_0x1589('0xbb')]);delete _0x3bf74a[_0x421210];}},0x2328);}});}});}}};Dialer[_0x1589('0x1b')][_0x1589('0xbe')]=function(_0x53b467){return BPromise['resolve']()[_0x1589('0x41')](cmHopper[_0x1589('0xbe')](_0x53b467))['catch'](loggerCatch(_0x1589('0xbf')));};Dialer['prototype'][_0x1589('0xc0')]=function(_0x236642){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](cmHopperBlack['checkIsBlackList'](_0x236642))[_0x1589('0xb8')](loggerCatch(_0x1589('0xc2')));};Dialer[_0x1589('0x1b')]['checkIsBlackListIvr']=function(_0x18f634){return BPromise[_0x1589('0xc1')]()['then'](cmHopperBlack[_0x1589('0xc3')](_0x18f634))['catch'](loggerCatch(_0x1589('0xc4')));};Dialer[_0x1589('0x1b')]['averageHandleTime']=function(_0x425733){return BPromise['resolve']()[_0x1589('0x41')](cmHopperHistory[_0x1589('0xc5')](_0x425733))[_0x1589('0xb8')](loggerCatch(_0x1589('0xc6')));};Dialer['prototype'][_0x1589('0xc7')]=function(_0x2a49d0){return BPromise['resolve']()[_0x1589('0x41')](cmHopper['rescheduleContact'](_0x2a49d0))[_0x1589('0xb8')](loggerCatch(_0x1589('0xc8')));};Dialer[_0x1589('0x1b')][_0x1589('0xc9')]=function(_0x30603f,_0x438860,_0x32329d){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](cmHopper[_0x1589('0xc9')](_0x30603f,_0x438860,_0x32329d))[_0x1589('0xb8')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x1589('0x1b')][_0x1589('0xca')]=function(_0x54c1cf,_0x408a05,_0x400069,_0xbef874,_0x2f5d68){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](cmHopper[_0x1589('0xca')](_0x54c1cf,_0x408a05,_0x400069,_0xbef874))['catch'](function(_0x5a3cd5){_0x2f5d68['temp']-=_0x400069;_0x2f5d68['temp']=_0x2f5d68[_0x1589('0xcb')]>0x0?_0x2f5d68[_0x1589('0xcb')]:0x0;loggerCatch(_0x1589('0xcc'))(_0x5a3cd5);});};Dialer[_0x1589('0x1b')][_0x1589('0xcd')]=function(_0x514091,_0x53c1a9,_0x510d11,_0x153bc5){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](cmHopper[_0x1589('0xcd')](_0x514091,_0x53c1a9,_0x510d11))[_0x1589('0xb8')](function(_0xfed136){_0x153bc5[_0x1589('0xcb')]-=_0x53c1a9;_0x153bc5[_0x1589('0xcb')]=_0x153bc5['temp']>0x0?_0x153bc5[_0x1589('0xcb')]:0x0;loggerCatch(_0x1589('0xce'))(_0xfed136);});};Dialer['prototype'][_0x1589('0xcf')]=function(_0x2ab13c){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](voiceQueueRt[_0x1589('0xcf')](_0x2ab13c))[_0x1589('0xb8')](loggerCatch(_0x1589('0xd0')));};Dialer[_0x1589('0x1b')]['moveContactManagedDialer']=function(_0x3fa090){return BPromise[_0x1589('0xc1')]()['then'](cmHopper['moveContactManagedDialer'](_0x3fa090))[_0x1589('0xb8')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x1589('0xd1')]=function(_0x3cd3f6){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](cmHopperHistory['createHistory'](_0x3cd3f6))[_0x1589('0xb8')](loggerCatch(_0x1589('0xd2')));};Dialer[_0x1589('0x1b')][_0x1589('0xba')]=function(_0xe79805){if(!_[_0x1589('0x42')](_0xe79805)&&_0xe79805!==null){if(typeof _0xe79805[_0x1589('0x77')]!==_0x1589('0xb5')){if(_0xe79805[_0x1589('0x77')]>0x0){_0xe79805['originated']-=0x1;}else{logger[_0x1589('0xa0')](_0x1589('0xd3'));}}}else{logger[_0x1589('0xa0')](_0x1589('0xd4'));}};Dialer[_0x1589('0x1b')][_0x1589('0xd5')]=function(_0x34a00f,_0x273e72){var _0x910d70=this;return function(_0x1ef60c){_0x910d70['updateOriginated'](_0x273e72);logger[_0x1589('0xa0')](_0x34a00f,util[_0x1589('0x9f')](_0x1ef60c,{'showHidden':![],'depth':null}));};};Dialer[_0x1589('0x1b')][_0x1589('0xd6')]=function(_0x3e3822,_0x2b236d,_0x36afc2){var _0x5c9252={'state':0x19,'statedesc':_0x1589('0xd7')};this[_0x1589('0xba')](_0x2b236d);this['saveInDb'](_[_0x1589('0x94')](_0x5c9252,_[_0x1589('0xd8')](_0x36afc2,[_0x1589('0xd9'),_0x1589('0xda'),_0x1589('0xdb'),_0x1589('0xdc'),'CampaignId'])),_0x1589('0xdd'),'[emptyContact]');logger[_0x1589('0xa0')](_0x3e3822);};Dialer[_0x1589('0x1b')][_0x1589('0xde')]=function(_0x22e319){return _0x22e319==='Success';};Dialer[_0x1589('0x1b')][_0x1589('0xdf')]=function(_0x9f69fd){return!_[_0x1589('0x42')](_0x9f69fd)&&_0x9f69fd&&!_[_0x1589('0x42')](_0x9f69fd[_0x1589('0x45')])&&!_['isUndefined'](_0x9f69fd['active'])&&_0x9f69fd[_0x1589('0xe0')]&&(this[_0x1589('0x24')][util[_0x1589('0x7e')](_0x1589('0xe1'),_0x9f69fd[_0x1589('0x45')])][_0x1589('0xe2')]==='reachable'||this[_0x1589('0x24')][util[_0x1589('0x7e')](_0x1589('0xe1'),_0x9f69fd['name'])][_0x1589('0xe2')]===_0x1589('0xe3'));};Dialer['prototype'][_0x1589('0xe4')]=function(_0x48b4bb,_0x2f5ba1,_0x4cc2c6){this[_0x1589('0xd1')](_0x48b4bb)[_0x1589('0xb8')](loggerCatch(_0x2f5ba1));this['moveContactManagedDialer'](_0x48b4bb)['catch'](loggerCatch(_0x4cc2c6));};Dialer[_0x1589('0x1b')][_0x1589('0x3c')]=function(_0x59675c){var _0x57e6dd=this[_0x1589('0x29')][_0x59675c[_0x1589('0xe5')]];var _0x22de71;if(!_[_0x1589('0xb6')](_0x59675c)&&!_[_0x1589('0xb6')](_0x59675c[_0x1589('0xe6')])&&!_[_0x1589('0xb6')](_0x59675c[_0x1589('0xe6')]['amdstatus'])&&_0x59675c[_0x1589('0xe7')]===_0x1589('0xe8')&&_0x57e6dd){if(_0x57e6dd['type']!==_0x1589('0x9b')&&this['voiceQueues'][_0x57e6dd['queue']][_0x1589('0xe9')]&&_0x59675c[_0x1589('0xea')]===_0x1589('0xeb')){delete this[_0x1589('0x29')][_0x59675c[_0x1589('0xe5')]];this['updateOriginated'](this[_0x1589('0x21')][_0x57e6dd['queue']]);this[_0x1589('0x21')][_0x57e6dd[_0x1589('0xbb')]][_0x1589('0x62')]+=0x1;this['voiceQueues'][_0x57e6dd[_0x1589('0xbb')]][_0x1589('0x61')]+=0x1;_0x22de71=new Hangup(_0x57e6dd,_0x59675c);_0x22de71[_0x1589('0xae')]=0x12;_0x22de71[_0x1589('0xaf')]=_0x1589('0xec');_0x22de71[_0x1589('0xed')]=_0x1589('0xee');ami['emit'](_0x1589('0xef'),ut[_0x1589('0xf0')](_0x22de71,_0x1589('0xf1')));this['saveInDb'](_0x22de71,_0x1589('0xf2'),_0x1589('0xf3'));}if(_0x57e6dd[_0x1589('0x4f')]!==_0x1589('0x9b')&&this[_0x1589('0x21')][_0x57e6dd['queue']][_0x1589('0xe9')]&&_0x59675c['value']===_0x1589('0xf4')){var _0x4a699e=this;return new BPromise(function(_0x166bc7,_0x59973b){delete _0x4a699e[_0x1589('0x29')][_0x59675c[_0x1589('0xe5')]];_0x4a699e[_0x1589('0xba')](_0x4a699e[_0x1589('0x21')][_0x57e6dd['queue']]);_0x4a699e[_0x1589('0x21')][_0x57e6dd[_0x1589('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x4a699e[_0x1589('0x21')][_0x57e6dd['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x12f429=_0x4a699e[_0x1589('0x21')][_0x57e6dd['queue']];var _0x7016d7=new Hangup(_0x57e6dd,_0x59675c);_0x7016d7[_0x1589('0xae')]=0x13;_0x7016d7['statedesc']=_0x1589('0xf5');_0x7016d7['membername']='AMD';_0x7016d7[_0x1589('0xf6')]+=0x1;_0x7016d7[_0x1589('0xf7')]+=0x1;_0x7016d7[_0x1589('0xf1')]=!![];ami[_0x1589('0xf8')](_0x1589('0xef'),ut[_0x1589('0xf0')](_0x7016d7,_0x1589('0xf1')));_0x4a699e[_0x1589('0xd1')](_0x7016d7)[_0x1589('0xb8')](loggerCatch(_0x1589('0xf9')));if(_0x7016d7[_0x1589('0xfa')]+_0x7016d7[_0x1589('0xfb')]+_0x7016d7['countnoanswerretry']+_0x7016d7['countnosuchnumberretry']+_0x7016d7[_0x1589('0xfc')]+_0x7016d7['countabandonedretry']+_0x7016d7['countmachineretry']+_0x7016d7['countagentrejectretry']>=_0x12f429[_0x1589('0xfd')]){_0x4a699e[_0x1589('0xfe')](_0x7016d7,_0x166bc7,_0x59973b,_0x1589('0xff'));}else{if(_0x7016d7[_0x1589('0xf6')]>=_0x12f429[_0x1589('0x100')]){_0x4a699e[_0x1589('0x101')](_0x7016d7,_0x166bc7,_0x59973b,_0x1589('0x102'));}else{_0x4a699e['rescheduleContact']({'active':![],'countmachineretry':_0x7016d7['countmachineretry'],'scheduledat':moment()[_0x1589('0x103')](_0x12f429[_0x1589('0x104')],_0x1589('0x105'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x7016d7[_0x1589('0xd9')],'ListId':_0x7016d7['ListId'],'VoiceQueueId':_0x7016d7[_0x1589('0xdc')]||undefined,'CampaignId':_0x7016d7[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x107')));_0x166bc7({'reschedule':0x1});}}});}if(_0x57e6dd[_0x1589('0x4f')]===_0x1589('0x9b')&&this[_0x1589('0x22')][_0x57e6dd['queue']][_0x1589('0xe9')]&&_0x59675c[_0x1589('0xea')]===_0x1589('0xeb')){delete this[_0x1589('0x29')][_0x59675c[_0x1589('0xe5')]];this['updateOriginated'](this[_0x1589('0x22')][_0x57e6dd[_0x1589('0xbb')]]);_0x22de71=new Hangup(_0x57e6dd,_0x59675c);_0x22de71[_0x1589('0xae')]=0x12;_0x22de71[_0x1589('0xaf')]=_0x1589('0xec');_0x22de71['membername']='AMD';ami[_0x1589('0xf8')](_0x1589('0xef'),ut[_0x1589('0xf0')](_0x22de71,_0x1589('0xf1')));this[_0x1589('0xe4')](_0x22de71,'[syncHangupInAMDIvr][createHistory]',_0x1589('0x108'));}if(_0x57e6dd[_0x1589('0x4f')]===_0x1589('0x9b')&&this[_0x1589('0x22')][_0x57e6dd[_0x1589('0xbb')]][_0x1589('0xe9')]&&_0x59675c['value']===_0x1589('0xf4')){var _0x4a699e=this;return new BPromise(function(_0x1d663d,_0xe682b1){delete _0x4a699e['uniqueId'][_0x59675c[_0x1589('0xe5')]];_0x4a699e[_0x1589('0xba')](_0x4a699e[_0x1589('0x22')][_0x57e6dd[_0x1589('0xbb')]]);_0x4a699e[_0x1589('0x22')][_0x57e6dd[_0x1589('0xbb')]][_0x1589('0x62')]+=0x1;_0x4a699e[_0x1589('0x22')][_0x57e6dd[_0x1589('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1d38d3=_0x4a699e[_0x1589('0x22')][_0x57e6dd[_0x1589('0xbb')]];var _0x3a15cf=new Hangup(_0x57e6dd,_0x59675c);_0x3a15cf[_0x1589('0xae')]=0x13;_0x3a15cf[_0x1589('0xaf')]=_0x1589('0xf5');_0x3a15cf['membername']=_0x1589('0xee');_0x3a15cf[_0x1589('0xf6')]+=0x1;_0x3a15cf[_0x1589('0xf7')]+=0x1;_0x3a15cf[_0x1589('0xf1')]=!![];ami[_0x1589('0xf8')]('custom:amd',ut['buildObj'](_0x3a15cf,'amd'));_0x4a699e['createHistory'](_0x3a15cf)[_0x1589('0xb8')](loggerCatch(_0x1589('0xf9')));if(_0x3a15cf[_0x1589('0xfa')]+_0x3a15cf[_0x1589('0xfb')]+_0x3a15cf[_0x1589('0x109')]+_0x3a15cf[_0x1589('0x10a')]+_0x3a15cf[_0x1589('0xfc')]+_0x3a15cf[_0x1589('0x10b')]+_0x3a15cf[_0x1589('0xf6')]+_0x3a15cf[_0x1589('0x10c')]>=_0x1d38d3[_0x1589('0xfd')]){_0x4a699e[_0x1589('0xfe')](_0x3a15cf,_0x1d663d,_0xe682b1,'reason19\x20machine....');}else{if(_0x3a15cf['countmachineretry']>=_0x1d38d3['dialMachineMaxRetry']){_0x4a699e[_0x1589('0x101')](_0x3a15cf,_0x1d663d,_0xe682b1,_0x1589('0x102'));}else{_0x4a699e[_0x1589('0xc7')]({'active':![],'countmachineretry':_0x3a15cf[_0x1589('0xf6')],'scheduledat':moment()[_0x1589('0x103')](_0x1d38d3['dialMachineRetryFrequency'],'minutes')['format'](_0x1589('0x10d')),'ContactId':_0x3a15cf[_0x1589('0xd9')],'ListId':_0x3a15cf['ListId'],'VoiceQueueId':_0x3a15cf[_0x1589('0xdc')]||undefined,'CampaignId':_0x3a15cf[_0x1589('0x106')]||undefined})['catch'](loggerCatch(_0x1589('0x107')));_0x1d663d({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x1589('0x39')]=function(_0x3d7a5b){var _0x471900=this['uniqueId'][_0x3d7a5b[_0x1589('0xe5')]];var _0x55bf2b=this;var _0x528421;if(_0x471900&&_0x471900[_0x1589('0x4f')]==='ivr'){delete this['uniqueId'][_0x3d7a5b[_0x1589('0xe5')]];this[_0x1589('0xba')](this[_0x1589('0x22')][_0x471900[_0x1589('0xbb')]]);this[_0x1589('0x22')][_0x471900['queue']][_0x1589('0x10e')]+=0x1;_0x528421=new Hangup(_0x471900,_0x3d7a5b);this[_0x1589('0xd1')](_0x528421)[_0x1589('0xb8')](loggerCatch(_0x1589('0x10f')));this[_0x1589('0x110')](_0x528421)['catch'](loggerCatch(_0x1589('0x111')));}if(_0x471900&&_0x471900[_0x1589('0x4f')]!=='ivr'&&isNotNull(this[_0x1589('0x21')][_0x471900[_0x1589('0xbb')]][_0x1589('0x112')])){delete this[_0x1589('0x29')][_0x3d7a5b[_0x1589('0xe5')]];this[_0x1589('0xba')](this[_0x1589('0x21')][_0x471900['queue']]);this[_0x1589('0x21')][_0x471900['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x1589('0x21')][_0x471900[_0x1589('0xbb')]][_0x1589('0x61')]+=0x1;_0x528421=new Hangup(_0x471900,_0x3d7a5b);_0x528421['state']=0x10;_0x528421['statedesc']=_0x1589('0x113');_0x528421[_0x1589('0xed')]='AGI';this[_0x1589('0xd1')](_0x528421)[_0x1589('0xb8')](loggerCatch(_0x1589('0x10f')));this[_0x1589('0x110')](_0x528421)[_0x1589('0xb8')](loggerCatch(_0x1589('0x111')));}if(_0x471900&&_0x471900['type']!=='ivr'&&!isNotNull(this[_0x1589('0x21')][_0x471900['queue']][_0x1589('0x112')])){delete this[_0x1589('0x29')][_0x3d7a5b[_0x1589('0xe5')]];this[_0x1589('0xba')](this[_0x1589('0x21')][_0x471900[_0x1589('0xbb')]]);this[_0x1589('0x21')][_0x471900['queue']][_0x1589('0x6d')]+=0x1;_0x528421=new Hangup(_0x471900,_0x3d7a5b);_0x528421[_0x1589('0xae')]=0xc;_0x528421[_0x1589('0xaf')]=_0x3d7a5b['cause-txt'];_0x528421[_0x1589('0xed')]=_0x1589('0x114');this[_0x1589('0xd1')](_0x528421)['catch'](loggerCatch(_0x1589('0x10f')));this[_0x1589('0x110')](_0x528421)[_0x1589('0xb8')](loggerCatch(_0x1589('0x111')));}};Dialer[_0x1589('0x1b')][_0x1589('0x35')]=function(_0x192111){var _0x2f62bb=this[_0x1589('0x29')][_0x192111[_0x1589('0xe5')]];var _0x41d957=this;if(this[_0x1589('0x21')][_0x192111['queue']]){if(_0x2f62bb&&_0x2f62bb['type']!=='ivr'){delete this[_0x1589('0x29')][_0x192111[_0x1589('0xe5')]];this[_0x1589('0x21')][_0x192111[_0x1589('0xbb')]][_0x1589('0x62')]+=0x1;var _0x468a5a=new AgentComplete(_0x2f62bb,_0x192111);if(_0x192111['reason']===_0x1589('0x115')){_0x468a5a['agiafterat']=this[_0x1589('0x21')][_0x192111[_0x1589('0xbb')]]['dialQueueProject2']&&this['voiceQueues'][_0x192111[_0x1589('0xbb')]]['dialAgiAfterHangupAgent']?moment()[_0x1589('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x468a5a)[_0x1589('0xb8')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1589('0x110')](_0x468a5a)[_0x1589('0xb8')](loggerCatch(_0x1589('0x116')));}}};Dialer['prototype'][_0x1589('0x2e')]=function(_0x1fa3df){if(this[_0x1589('0x21')][_0x1fa3df['queue']]){if(this[_0x1589('0x29')][_0x1fa3df[_0x1589('0xe5')]]&&this['uniqueId'][_0x1fa3df[_0x1589('0xe5')]]['type']!=='ivr'){this[_0x1589('0xba')](this[_0x1589('0x21')][_0x1fa3df[_0x1589('0xbb')]]);this[_0x1589('0x29')][_0x1fa3df['uniqueid']][_0x1589('0x117')]=moment()['format'](_0x1589('0x10d'));}}};Dialer[_0x1589('0x1b')]['queueCallerAbandonCreateState']=function(_0x1c4586){this[_0x1589('0xd1')](_0x1c4586)['catch'](loggerCatch(_0x1589('0x118')));this[_0x1589('0x110')](_0x1c4586)[_0x1589('0xb8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x1589('0x1b')]['syncQueueCallerAbandon']=function(_0x29aba2){var _0x1919bb=this['uniqueId'][_0x29aba2[_0x1589('0xe5')]];var _0x5860b3=this;if(this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]]){if(_0x1919bb&&_0x1919bb['type']!=='ivr'){delete this[_0x1589('0x29')][_0x29aba2[_0x1589('0xe5')]];this[_0x1589('0xba')](this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]]);_0x1919bb['droptime']=moment()[_0x1589('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1b3d1a=new QueueCallerAbandon(_0x1919bb,_0x29aba2);if(getSeconds(_0x1919bb[_0x1589('0x119')],_0x1919bb[_0x1589('0x11a')])>=_0x1919bb[_0x1589('0x11b')]){this[_0x1589('0x21')][_0x29aba2['queue']][_0x1589('0x72')]+=0x1;this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x11c')]+=0x1;_0x1b3d1a[_0x1589('0xae')]=0xa;_0x1b3d1a['statedesc']=_0x1589('0x11d');_0x1b3d1a[_0x1589('0x11e')]=_0x1589('0x11f');_0x1b3d1a[_0x1589('0x120')]=this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x121')]?moment()[_0x1589('0x7e')](_0x1589('0x10d')):undefined;_0x1b3d1a[_0x1589('0xfc')]+=0x1;_0x1b3d1a['countglobal']+=0x1;if(_0x1b3d1a[_0x1589('0xfc')]>=this[_0x1589('0x21')][_0x29aba2['queue']][_0x1589('0x122')]){this[_0x1589('0x123')](_0x1b3d1a);}else{this[_0x1589('0xc7')]({'active':![],'countdropretry':_0x1b3d1a['countdropretry'],'scheduledat':moment()['add'](this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x124')],_0x1589('0x105'))['format'](_0x1589('0x10d')),'ContactId':_0x1919bb['ContactId'],'ListId':_0x1919bb['ListId'],'VoiceQueueId':_0x1919bb[_0x1589('0xdc')]||undefined,'CampaignId':_0x1919bb[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x125')));var _0x5d285e=new History(_0x1b3d1a);_0x5d285e[_0x1589('0xae')]=0xa;_0x5d285e[_0x1589('0xaf')]=_0x1589('0x11d');_0x5d285e[_0x1589('0xb1')]=moment()[_0x1589('0x7e')](_0x1589('0x10d'));_0x5d285e['endtime']=_0x5d285e['starttime'];_0x5d285e[_0x1589('0x126')]=_0x1b3d1a['calleridname'];_0x5d285e[_0x1589('0x127')]=_0x1b3d1a[_0x1589('0x127')];this[_0x1589('0xd1')](_0x5d285e)[_0x1589('0xb8')](loggerCatch(_0x1589('0x128')));}}else{this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x71')]+=0x1;this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x66')]+=0x1;_0x1b3d1a[_0x1589('0xae')]=0xb;_0x1b3d1a['statedesc']='Abandoned';_0x1b3d1a['dropreason']=_0x1589('0x129');_0x1b3d1a[_0x1589('0x10b')]+=0x1;_0x1b3d1a[_0x1589('0xf7')]+=0x1;if(_0x1b3d1a[_0x1589('0x10b')]>=this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x12a')]){this[_0x1589('0x123')](_0x1b3d1a);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x1b3d1a[_0x1589('0x10b')],'scheduledat':moment()['add'](this[_0x1589('0x21')][_0x29aba2[_0x1589('0xbb')]][_0x1589('0x12b')],_0x1589('0x105'))['format'](_0x1589('0x10d')),'ContactId':_0x1919bb[_0x1589('0xd9')],'ListId':_0x1919bb[_0x1589('0xda')],'VoiceQueueId':_0x1919bb[_0x1589('0xdc')]||undefined,'CampaignId':_0x1919bb[_0x1589('0x106')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5d285e=new History(_0x1b3d1a);_0x5d285e[_0x1589('0xae')]=0xb;_0x5d285e[_0x1589('0xaf')]=_0x1589('0x12c');_0x5d285e[_0x1589('0xb1')]=moment()[_0x1589('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d285e[_0x1589('0xb0')]=_0x5d285e[_0x1589('0xb1')];_0x5d285e['calleridname']=_0x1b3d1a[_0x1589('0x126')];_0x5d285e['calleridnum']=_0x1b3d1a[_0x1589('0x127')];this[_0x1589('0xd1')](_0x5d285e)[_0x1589('0xb8')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x1589('0x1b')]['syncNewExten']=function(_0x431cc6){if(this['actions'][_0x431cc6[_0x1589('0xe5')]]){this[_0x1589('0x27')][_0x431cc6['uniqueid']][_0x1589('0x12d')]=_0x431cc6[_0x1589('0x12d')];}if(this[_0x1589('0x29')][_0x431cc6[_0x1589('0xe5')]]){this[_0x1589('0x29')][_0x431cc6[_0x1589('0xe5')]]['channel']=_0x431cc6[_0x1589('0x12d')];}};Dialer['prototype']['syncQueueMember']=function(_0x3f2ab4){if(strategy[this[_0x1589('0x21')][this[_0x1589('0x27')][_0x3f2ab4['actionid']][_0x1589('0xbb')]][_0x1589('0x51')]]==='roundrobin'){if(this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]]&&_[_0x1589('0xb6')](this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]][_0x1589('0x12f')])&&_0x3f2ab4[_0x1589('0xe2')]==='1'&&_0x3f2ab4[_0x1589('0x130')]==='0'){if(this[_0x1589('0x23')][_0x3f2ab4[_0x1589('0x131')]]){if(!this[_0x1589('0x23')][_0x3f2ab4[_0x1589('0x131')]][_0x1589('0x12f')]){this[_0x1589('0x23')][_0x3f2ab4[_0x1589('0x131')]]['locked']=!![];this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]][_0x1589('0x12f')]=!![];this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]][_0x1589('0x131')]=_0x3f2ab4[_0x1589('0x131')];}}}}else if((strategy[this[_0x1589('0x21')][this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]]['queue']][_0x1589('0x51')]]||'rrmemory')===_0x1589('0x132')){if(this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]]){if(this[_0x1589('0x23')][_0x3f2ab4['stateinterface']]){this['actions'][_0x3f2ab4[_0x1589('0x12e')]][_0x1589('0x131')]=_0x3f2ab4[_0x1589('0x131')];if(_[_0x1589('0xb6')](this[_0x1589('0x2c')][this['actions'][_0x3f2ab4[_0x1589('0x12e')]]['queue']])){this['queueBooked'][this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]][_0x1589('0xbb')]]=[];}this[_0x1589('0x2c')][this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]][_0x1589('0xbb')]][_0x1589('0x133')](_[_0x1589('0x94')](_[_0x1589('0xd8')](this[_0x1589('0x27')][_0x3f2ab4[_0x1589('0x12e')]],[_0x1589('0x134'),'stateinterface']),{'status':_0x3f2ab4[_0x1589('0xe2')],'paused':_0x3f2ab4[_0x1589('0x130')]}));}}}};function unlockQueueStatus(_0xbcd0d4,_0x179b31){setTimeout(function(){if(_['isUndefined'](_0xbcd0d4['queueStatusComplete'])){loggerBooked[_0x1589('0xa0')](_0x1589('0x135'),_0x179b31);}_0xbcd0d4[_0x1589('0x136')]=!![];loggerBooked[_0x1589('0x82')](_0x1589('0x137'),_0x179b31,JSON[_0x1589('0x7d')](_[_0x1589('0xd8')](_0xbcd0d4,[_0x1589('0x45'),_0x1589('0x136')])));},0x1f3);}Dialer[_0x1589('0x1b')][_0x1589('0x3e')]=function(_0x284d73){var _0x4bde8a=this;var _0x4ae2c6=_0x4bde8a[_0x1589('0x21')][_0x4bde8a[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]['queue']];if(strategy[this[_0x1589('0x21')][this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0xbb')]]['strategy']]===_0x1589('0x1a')){if(this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]&&this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0x131')]){this['preview'][_0x1589('0x138')](this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0x134')],this[_0x1589('0x27')][_0x284d73['actionid']][_0x1589('0x131')])[_0x1589('0xb8')](function(_0x5155a6){logger[_0x1589('0xa0')](_0x1589('0x139'),util[_0x1589('0x9f')](_0x5155a6,{'showHidden':![],'depth':null}));})[_0x1589('0x1e')](function(){_0x4bde8a['updateOriginated'](_0x4bde8a[_0x1589('0x21')][_0x4bde8a[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]['queue']]);_0x4bde8a[_0x1589('0x23')][_0x4bde8a[_0x1589('0x27')][_0x284d73['actionid']][_0x1589('0x131')]][_0x1589('0x12f')]=![];delete _0x4bde8a[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]];unlockQueueStatus(_0x4ae2c6);});}else{this[_0x1589('0xba')](this[_0x1589('0x21')][this[_0x1589('0x27')][_0x284d73['actionid']]['queue']]);this[_0x1589('0xc7')]({'active':![],'ContactId':this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]['ContactId'],'ListId':this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0xda')],'VoiceQueueId':this[_0x1589('0x27')][_0x284d73['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x1589('0x27')][_0x284d73['actionid']][_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x284d73[_0x1589('0x12e')]];unlockQueueStatus(_0x4ae2c6);}}else if((strategy[this[_0x1589('0x21')][this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0xbb')]]['strategy']]||_0x1589('0x132'))===_0x1589('0x132')){var _0x4dba04;if(this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]&&!_['isEmpty'](this[_0x1589('0x2c')][this['actions'][_0x284d73['actionid']][_0x1589('0xbb')]])){if(this[_0x1589('0x13a')][_0x4bde8a[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]['queue']]){this['queueBookedRR'][_0x4bde8a[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0xbb')]]=this[_0x1589('0x13a')][this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0xbb')]]?this['queueBookedRR'][this[_0x1589('0x27')][_0x284d73['actionid']][_0x1589('0xbb')]]:this[_0x1589('0x2c')][this['actions'][_0x284d73['actionid']][_0x1589('0xbb')]]?this[_0x1589('0x2c')][this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]][_0x1589('0xbb')]][_0x1589('0x13b')]||0x0:0x0;}this[_0x1589('0x2c')][this[_0x1589('0x27')][_0x284d73[_0x1589('0x12e')]]['queue']][_0x1589('0x13b')]=this[_0x1589('0x13a')][this[_0x1589('0x27')][_0x284d73['actionid']]['queue']];for(var _0x52a259=0x0;_0x52a259=0x0;})[_0x1589('0xb8')](myreject(_0x3af5ea)));}}else{_0x486da7[_0x1589('0x133')](ami['Action']({'action':'command','command':util['format']('iftime\x20%s,%s',_0x390021,!_[_0x1589('0x42')](config[_0x1589('0x150')][_0xe2ca30])?_0xe2ca30:'')})[_0x1589('0x41')](function(_0x2a22cc){return _0x2a22cc[_0x1589('0x157')]['indexOf'](_0x1589('0x158'))>=0x0;})[_0x1589('0xb8')](myreject(_0x3af5ea)));}BPromise['all'](_0x486da7)['then'](function(_0xd4c13e){var _0x175229=_[_0x1589('0x159')](_0xd4c13e);if(_0x175229){return _0x4ae6d3(_0x175229);}else{_0xdcb934[_0x1589('0x43')]=_0x4ecbd4?_0x1589('0x15a'):_0x1589('0x15b');return _0x3af5ea(msgResponse('[ifTime][promiseAll]',_0x1589('0x14c'),_0x1589('0x15c')+_0x4ecbd4+'\x20'+_0x348e37+_0x1589('0x15d')+util[_0x1589('0x9f')](_0x390021,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xe2ca30));}})['catch'](function(_0x1019ef){return _0x3af5ea(msgResponse(_0x1589('0x14a'),_0x1589('0x14c'),JSON[_0x1589('0x7d')](_0x1019ef)));});});};Dialer['prototype'][_0x1589('0x15e')]=function(_0x38d593){var _0x230b38=this;return function(){switch(_0x38d593[_0x1589('0x15f')]){case'progressive':freeVariablesPredictive(_0x38d593);_0x230b38[_0x1589('0x160')](_0x38d593,0x1);break;case _0x1589('0x161'):freeVariablesPredictive(_0x38d593);_0x230b38[_0x1589('0x160')](_0x38d593,_0x38d593[_0x1589('0x162')]);break;case _0x1589('0x163'):_0x230b38['predictive'](_0x38d593);break;case'booked':freeVariablesPredictive(_0x38d593);_0x230b38['handlePower'](_0x38d593,0x1);break;default:freeVariablesPredictive(_0x38d593);logger['error'](_0x1589('0x164'),_0x38d593[_0x1589('0x45')],'method\x20not\x20recognized');}};};Dialer[_0x1589('0x1b')][_0x1589('0x165')]=function(_0x386a36){return BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](cmHopper[_0x1589('0x166')](_0x386a36['id'],previewRecallmeReminderInterval))[_0x1589('0x41')](function(_0x1fa5ae){for(var _0x4dce1c=0x0;_0x4dce1c<_0x1fa5ae[_0x1589('0x13c')];_0x4dce1c++){var _0x37f9a2=_0x1fa5ae[_0x4dce1c]['Agent'][_0x1589('0x45')];if(_0x37f9a2)io['to'](util[_0x1589('0x7e')](_0x1589('0x167'),_0x37f9a2))[_0x1589('0xf8')](_0x1589('0x168'),{'hopper':_0x1fa5ae[_0x4dce1c]});}})[_0x1589('0xb8')](function(_0x1ba949){});};Dialer[_0x1589('0x1b')]['launchHandleIvr']=function(_0x2152f6){var _0x102876=this;return function(){_0x102876[_0x1589('0x169')](_0x2152f6);};};Dialer[_0x1589('0x1b')][_0x1589('0x37')]=function(_0x2639f9){var _0x1fdb3e=this;if(isNotPreview(_0x2639f9['dialMethod'])){if(isVoiceQueueOutbound(_0x2639f9['type'])&&isActive(_0x2639f9[_0x1589('0x5c')])){_0x2639f9[_0x1589('0xa9')]=!![];BPromise['resolve']()[_0x1589('0x41')](checkIsLoggedIn(_0x2639f9,_0x2639f9[_0x1589('0x54')]))[_0x1589('0x41')](checkIsActive(_0x2639f9,_0x2639f9[_0x1589('0x5c')]))['then'](checkInterval(_0x2639f9))['then'](_0x1fdb3e[_0x1589('0x147')](_0x2639f9))[_0x1589('0x41')](_0x1fdb3e['checkIfTime'](_0x2639f9[_0x1589('0x16a')],_0x2639f9[_0x1589('0x16b')],_0x2639f9['name'],_0x2639f9))['then'](_0x1fdb3e['checkIfTimeIntervals'](_0x2639f9[_0x1589('0x49')],_0x2639f9['dialTimezone'],_0x2639f9['name'],_0x2639f9))[_0x1589('0x41')](_0x1fdb3e[_0x1589('0x15e')](_0x2639f9))[_0x1589('0xb8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x2639f9));}else{notSendMessagesQueue(_0x2639f9);}}else{freeVariablesPredictive(_0x2639f9);if(_0x2639f9[_0x1589('0x16c')]){_0x1fdb3e[_0x1589('0x165')](_0x2639f9);}}};Dialer[_0x1589('0x1b')][_0x1589('0x146')]=function(){var _0x128d25=this;var _0x2f9819;for(var _0x417b29 in this[_0x1589('0x22')]){if(typeof this['campaigns'][_0x417b29]!==_0x1589('0xb5')){_0x2f9819=this[_0x1589('0x22')][_0x417b29];if(isCampaignIvr(_0x2f9819['type'])&&isActive(_0x2f9819[_0x1589('0xe0')])){_0x2f9819[_0x1589('0xa9')]=!![];BPromise[_0x1589('0xc1')]()[_0x1589('0x41')](checkIsActive(_0x2f9819,_0x2f9819['active']))[_0x1589('0x41')](checkInterval(_0x2f9819))[_0x1589('0x41')](_0x128d25[_0x1589('0x147')](_0x2f9819))[_0x1589('0x41')](_0x128d25[_0x1589('0x16d')](_0x2f9819[_0x1589('0x16a')],_0x2f9819[_0x1589('0x16b')],_0x2f9819['name'],_0x2f9819))[_0x1589('0x41')](_0x128d25[_0x1589('0x14b')](_0x2f9819[_0x1589('0x49')],_0x2f9819['dialTimezone'],_0x2f9819[_0x1589('0x45')],_0x2f9819))[_0x1589('0x41')](_0x128d25['launchHandleIvr'](_0x2f9819))[_0x1589('0xb8')](loggerCatchQueueSummary(_0x1589('0x16e'),_0x2f9819));}else{notSendMessagesCampaign(_0x2f9819);}}}};function getCallerIdRandom(_0x580d0e,_0x2dde32){var _0x1cd128;var _0x1bae81;var _0x54fe5a;if(_0x2dde32<=0x0){_0x2dde32=0x1;}_0x1cd128=new RegExp(_0x1589('0x16f')+_0x2dde32+'}$');_0x1bae81=Math[_0x1589('0x170')](0xa,_0x2dde32-0x1);_0x54fe5a=Math['pow'](0xa,_0x2dde32)-0x1;return util[_0x1589('0x7e')]('%s',_[_0x1589('0x171')](_0x580d0e,_0x1cd128,_[_0x1589('0x172')](_0x1bae81,_0x54fe5a)));}function extractCalleridName(_0x16a4e2){var _0x5317b2=_0x16a4e2[_0x1589('0x173')](/"(.*?)"/);return _0x5317b2?_0x5317b2[0x1]:_0x16a4e2;}function extractCalleridNumber(_0x56ba55){var _0x44ad6c=_0x56ba55[_0x1589('0x173')](/<(.*?)>/);return _0x44ad6c?_0x44ad6c[0x1]:_0x56ba55;}Dialer['prototype'][_0x1589('0x174')]=function(_0xbd641c,_0x15bd3a){var _0x250363=this;var _0x261906=uuid['v4']();this[_0x1589('0x27')][_0x261906]=new Action(_0xbd641c,_0x15bd3a,_0x261906);return new BPromise(function(_0x573877,_0x196a71){if(_['isUndefined'](_0xbd641c)&&typeof _0xbd641c!==_0x1589('0x175')){return _0x196a71(msgResponse(_0x1589('0x176'),_0x1589('0x14c'),_0x1589('0x177')));}if(_['isUndefined'](_0x15bd3a[_0x1589('0x178')][_0x1589('0x179')])||_0x15bd3a['Contact'][_0x1589('0x179')]===null){return _0x196a71(msgResponse(_0x1589('0x176'),_0x1589('0x14c'),'contact\x20is\x20undefine'));}var _0x1b2ffd={'XMD-CALLERID':_0x250363[_0x1589('0x27')][_0x261906][_0x1589('0x17a')](),'XMD-AGI':_0xbd641c[_0x1589('0x112')]?util[_0x1589('0x7e')](_0x1589('0x17b'),ipAgi,_0xbd641c[_0x1589('0x112')]):_0x1589('0x17c'),'XMD-AGIAFTER':_0xbd641c[_0x1589('0x121')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xbd641c[_0x1589('0x121')]):_0x1589('0x17c'),'XMD-QUEUE':_0xbd641c[_0x1589('0x4f')]==='outbound'?util[_0x1589('0x7e')](_0x1589('0x17d'),_0xbd641c[_0x1589('0x45')],_0xbd641c[_0x1589('0x17e')]||'',_0xbd641c[_0x1589('0x17f')]?'c':'',_0xbd641c[_0x1589('0x11b')]||0x3):'NONE','XMD-CONTACTID':_0x15bd3a[_0x1589('0xd9')],'XMD-CDRTYPE':_0x1589('0xa'),'CALLERID(all)':_0x250363[_0x1589('0x27')][_0x261906][_0x1589('0x17a')](),'XMD-AMD':_0xbd641c['dialAMDActive']?_0x1589('0x180'):_0x1589('0x17c'),'XMD-DESTINATION':_0x1589('0xe8')};if(_0xbd641c[_0x1589('0xe9')]){_0x1b2ffd[_0x1589('0x181')]=_0xbd641c['dialAMDInitialSilence']||0x9c4;_0x1b2ffd[_0x1589('0x182')]=_0xbd641c['dialAMDGreeting']||0x5dc;_0x1b2ffd['XMD-AMDAFTERGREETINGSILENCE']=_0xbd641c[_0x1589('0x183')]||0x320;_0x1b2ffd[_0x1589('0x184')]=_0xbd641c[_0x1589('0x185')]||0x1388;_0x1b2ffd[_0x1589('0x186')]=_0xbd641c[_0x1589('0x187')]||0x64;_0x1b2ffd[_0x1589('0x188')]=_0xbd641c['dialAMDBetweenWordsSilence']||0x32;_0x1b2ffd[_0x1589('0x189')]=_0xbd641c[_0x1589('0x18a')]||0x3;_0x1b2ffd[_0x1589('0x18b')]=_0xbd641c['dialAMDSilenceThreshold']||0x100;_0x1b2ffd['XMD-AMDMAXIMUMWORDLENGTH']=_0xbd641c['dialAMDMaximumWordLength']||0x1388;}if(_0xbd641c[_0x1589('0x4f')]==='outbound'){_0x1b2ffd[_0x1589('0x18c')]=_0x15bd3a[_0x1589('0xdc')];}else{_0x1b2ffd['XMD-CAMPAIGNID']=_0x15bd3a['CampaignId'];}for(var _0x5254af in _0x15bd3a[_0x1589('0x178')]){if(typeof _0x15bd3a[_0x1589('0x178')][_0x5254af]!==_0x1589('0xb5')){if(isNotNull(_0x15bd3a[_0x1589('0x178')][_0x5254af])&&_0x5254af!=='id'&&_0x5254af!==_0x1589('0x18d')&&_0x5254af!==_0x1589('0x18e')&&_0x5254af!==_0x1589('0x18f')){_0x1b2ffd[util['format'](_0x1589('0x190'),_0x1589('0x191'),_['toUpper'](_0x5254af))]=_0x15bd3a[_0x1589('0x178')][_0x5254af];}}}var _0x55b3b6=_0x250363[_0x1589('0xdf')](_0xbd641c[_0x1589('0x7b')])?getCallerId(_0xbd641c[_0x1589('0x7b')][_0x1589('0x7c')],_0xbd641c['dialOriginateCallerIdName'],_0xbd641c[_0x1589('0x192')]>0x0?getCallerIdRandom(_0xbd641c[_0x1589('0x5e')],_0xbd641c[_0x1589('0x192')]):_0xbd641c['dialOriginateCallerIdNumber']):getCallerId(_[_0x1589('0xb6')](_0xbd641c[_0x1589('0x193')])?_0xbd641c[_0x1589('0x7b')][_0x1589('0x7c')]:_0xbd641c[_0x1589('0x193')][_0x1589('0x7c')],_0xbd641c[_0x1589('0x5d')],_0xbd641c[_0x1589('0x192')]>0x0?getCallerIdRandom(_0xbd641c[_0x1589('0x5e')],_0xbd641c[_0x1589('0x192')]):_0xbd641c[_0x1589('0x5e')]);if(_0x55b3b6){_0x1b2ffd['XMD-ORIGINATECALLERIDNAME']=_0x250363[_0x1589('0x27')][_0x261906][_0x1589('0x194')]=extractCalleridName(_0x55b3b6);_0x1b2ffd['XMD-ORIGINATECALLERIDNUM']=_0x250363['actions'][_0x261906][_0x1589('0x195')]=extractCalleridNumber(_0x55b3b6);}return ami[_0x1589('0xb7')]({'actionid':_0x261906,'action':_0x1589('0x176'),'channel':_0x250363['isTrunkReachable'](_0xbd641c[_0x1589('0x7b')])?util['format'](_0x1589('0x196'),_0xbd641c[_0x1589('0x7b')]['name'],isNotNull(_0xbd641c[_0x1589('0x60')])?_0xbd641c[_0x1589('0x60')][_0x1589('0x197')]()||'':'',_0xbd641c[_0x1589('0x198')]>0x0?_0x15bd3a[_0x1589('0x178')][_0x1589('0x179')][_0x1589('0x199')](_0xbd641c[_0x1589('0x198')]):_0x15bd3a[_0x1589('0x178')]['phone']):util[_0x1589('0x7e')](_0x1589('0x196'),_[_0x1589('0xb6')](_0xbd641c[_0x1589('0x193')])?_0xbd641c[_0x1589('0x7b')][_0x1589('0x45')]:_0xbd641c['TrunkBackup'][_0x1589('0x45')],isNotNull(_0xbd641c[_0x1589('0x60')])?_0xbd641c[_0x1589('0x60')][_0x1589('0x197')]()||'':'',_0xbd641c[_0x1589('0x198')]>0x0?_0x15bd3a[_0x1589('0x178')]['phone']['substring'](_0xbd641c[_0x1589('0x198')]):_0x15bd3a[_0x1589('0x178')][_0x1589('0x179')]),'callerid':_0x55b3b6,'Exten':'xcally-motion-dialer','Context':_0x1589('0x19a'),'Priority':'1','variable':_0x1b2ffd,'timeout':(_0xbd641c[_0x1589('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x261906})[_0x1589('0x41')](function(_0x41e727){return _0x573877(_0x41e727);})[_0x1589('0xb8')](function(_0x485d8a){_0xbd641c[_0x1589('0x6a')]+=0x1;var _0x21ef36=new History(_0x250363[_0x1589('0x27')][_0x261906]);logger['error'](util[_0x1589('0x7e')](_0x1589('0x19b'),JSON[_0x1589('0x7d')](_0x485d8a)));_0x21ef36[_0x1589('0xae')]=0xe;_0x21ef36[_0x1589('0xaf')]=_0x1589('0x19c');_0x21ef36['starttime']=moment()[_0x1589('0x7e')](_0x1589('0x10d'));_0x21ef36[_0x1589('0xb0')]=_0x21ef36[_0x1589('0xb1')];_0x250363[_0x1589('0xd1')](_0x21ef36)[_0x1589('0xb8')](loggerCatch(_0x1589('0x19d')));_0x250363[_0x1589('0x110')](_0x21ef36)[_0x1589('0xb8')](loggerCatch(_0x1589('0x19d')))[_0x1589('0x1e')](function(){delete _0x250363['actions'][_0x261906];return _0x196a71(msgResponse(_0x1589('0x176'),'Error',_0x1589('0x19e')));});});});};Dialer[_0x1589('0x1b')][_0x1589('0x33')]=function(_0x102709){var _0x1633a8=this[_0x1589('0x27')][_0x102709['actionid']];if(_0x1633a8){delete this[_0x1589('0x27')][_0x102709[_0x1589('0x12e')]];_0x1633a8['responsetime']=moment()[_0x1589('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x28f23c=_0x1633a8[_0x1589('0x4f')]===_0x1589('0x9b')?this[_0x1589('0x22')][_0x1633a8['queue']]:this[_0x1589('0x21')][_0x1633a8[_0x1589('0x19f')]()];if(!this[_0x1589('0xde')](_0x102709[_0x1589('0x1a0')])){this[_0x1589('0xba')](_0x28f23c);return this[_0x1589('0x1a1')](_0x1633a8,_0x28f23c,_0x102709)[_0x1589('0xb8')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x1589('0x29')][_0x102709['uniqueid']]=_0x1633a8;}};Dialer[_0x1589('0x1b')]['checkRetriveMax']=function(_0x123367,_0xfb9f28,_0x2ad627){var _0x4db23a=new History(_0xfb9f28);if(_0x4db23a['countbusyretry']+_0x4db23a[_0x1589('0xfb')]+_0x4db23a['countnoanswerretry']+_0x4db23a['countnosuchnumberretry']+_0x4db23a[_0x1589('0xfc')]+_0x4db23a['countabandonedretry']+_0x4db23a[_0x1589('0xf6')]+_0x4db23a[_0x1589('0x10c')]>=_0x2ad627['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x123367){case 0x3:if(_0x4db23a['countnoanswerretry']>=_0x2ad627[_0x1589('0x1a2')]-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countnoanswerretry':_0x4db23a['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x1589('0x103')](_0x2ad627[_0x1589('0x1a3')],'minutes')['format'](_0x1589('0x10d')),'ContactId':_0x4db23a[_0x1589('0xd9')],'ListId':_0x4db23a['ListId'],'VoiceQueueId':_0x4db23a[_0x1589('0xdc')]||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x4db23a[_0x1589('0xfa')]>=_0x2ad627[_0x1589('0x1a4')]-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countbusyretry':_0x4db23a[_0x1589('0xfa')]+=0x1,'scheduledat':moment()[_0x1589('0x103')](_0x2ad627[_0x1589('0x1a5')],_0x1589('0x105'))[_0x1589('0x7e')](_0x1589('0x10d')),'ContactId':_0x4db23a[_0x1589('0xd9')],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a[_0x1589('0xdc')]||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})['catch'](loggerCatch(_0x1589('0x1a6')));break;case 0x8:if(_0x4db23a[_0x1589('0xfb')]>=_0x2ad627['dialCongestionMaxRetry']-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countcongestionretry':_0x4db23a['countcongestionretry']+=0x1,'scheduledat':moment()[_0x1589('0x103')](_0x2ad627[_0x1589('0x1a7')],'minutes')[_0x1589('0x7e')](_0x1589('0x10d')),'ContactId':_0x4db23a[_0x1589('0xd9')],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a[_0x1589('0xdc')]||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})['catch'](loggerCatch(_0x1589('0x1a8')));break;case 0x0:if(_0x4db23a[_0x1589('0x10a')]>=_0x2ad627[_0x1589('0x1a9')]-0x1){return!![];}else{this[_0x1589('0xc7')]({'active':![],'countnosuchnumberretry':_0x4db23a[_0x1589('0x10a')]+=0x1,'scheduledat':moment()['add'](_0x2ad627['dialNoSuchNumberRetryFrequency'],_0x1589('0x105'))[_0x1589('0x7e')](_0x1589('0x10d')),'ContactId':_0x4db23a['ContactId'],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a[_0x1589('0xdc')]||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x1aa')));}break;case 0xa:if(_0x4db23a[_0x1589('0xfc')]>=_0x2ad627['dialDropMaxRetry']-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countdropretry':_0x4db23a[_0x1589('0xfc')]+=0x1,'scheduledat':moment()[_0x1589('0x103')](_0x2ad627[_0x1589('0x124')],_0x1589('0x105'))[_0x1589('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4db23a[_0x1589('0xd9')],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a[_0x1589('0xdc')]||undefined,'CampaignId':_0x4db23a['CampaignId']||undefined})[_0x1589('0xb8')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x4db23a[_0x1589('0x10b')]>=_0x2ad627[_0x1589('0x12a')]-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countabandonedretry':_0x4db23a[_0x1589('0x10b')]+=0x1,'scheduledat':moment()['add'](_0x2ad627[_0x1589('0x12b')],'minutes')[_0x1589('0x7e')](_0x1589('0x10d')),'ContactId':_0x4db23a[_0x1589('0xd9')],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a['VoiceQueueId']||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x1ab')));break;case 0x13:if(_0x4db23a['countmachineretry']>=_0x2ad627[_0x1589('0x100')]-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countmachineretry':_0x4db23a[_0x1589('0xf6')]+=0x1,'scheduledat':moment()[_0x1589('0x103')](_0x2ad627[_0x1589('0x104')],'minutes')[_0x1589('0x7e')](_0x1589('0x10d')),'ContactId':_0x4db23a['ContactId'],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a['VoiceQueueId']||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x107')));break;case 0x14:if(_0x4db23a[_0x1589('0x10c')]>=_0x2ad627['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x1589('0xc7')]({'active':![],'countagentrejectretry':_0x4db23a[_0x1589('0x10c')]+=0x1,'scheduledat':moment()[_0x1589('0x103')](_0x2ad627[_0x1589('0x1ac')],_0x1589('0x105'))['format'](_0x1589('0x10d')),'ContactId':_0x4db23a[_0x1589('0xd9')],'ListId':_0x4db23a[_0x1589('0xda')],'VoiceQueueId':_0x4db23a['VoiceQueueId']||undefined,'CampaignId':_0x4db23a[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x1ad')));break;default:return!![];}};Dialer[_0x1589('0x1b')][_0x1589('0x1a1')]=function(_0x1f7a28,_0x3670d4,_0x5c9a8c){var _0x39602c=this;var _0x814e82=new History(_0x1f7a28);return new BPromise(function(_0x278fa4,_0x1d8a0d){if(_['isUndefined'](_0x3670d4)&&typeof _0x3670d4!=='object'){return _0x1d8a0d(msgResponse('[callProgressDetecting]',_0x1589('0x14c'),_0x1589('0x1ae')));}if(_['isUndefined'](_0x5c9a8c)&&typeof _0x5c9a8c!==_0x1589('0x175')){return _0x1d8a0d(msgResponse(_0x1589('0x1af'),_0x1589('0x14c'),'evt\x20is\x20undefine'));}switch(_0x5c9a8c[_0x1589('0x1b0')]){case'0':_0x3670d4[_0x1589('0x69')]+=0x1;_0x814e82['state']=0x0;_0x814e82['statedesc']=_0x1589('0x1b1');_0x814e82[_0x1589('0x10a')]+=0x1;_0x814e82[_0x1589('0xf7')]+=0x1;ami[_0x1589('0xf8')](_0x1589('0x1b2'),ut[_0x1589('0xf0')](_0x1f7a28,_0x1589('0x1b3')));_0x39602c[_0x1589('0xd1')](_0x814e82)[_0x1589('0xb8')](loggerCatch(_0x1589('0xf9')));if(_0x39602c[_0x1589('0x1b4')](0x0,_0x1f7a28,_0x3670d4)){if(_0x814e82[_0x1589('0x10a')]>=_0x3670d4['dialNoSuchNumberMaxRetry']){_0x39602c[_0x1589('0x101')](_0x814e82,_0x278fa4,_0x1d8a0d,'reason\x200\x20no\x20such\x20number....');}else{_0x39602c[_0x1589('0xfe')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1b5'));}}break;case'3':_0x3670d4[_0x1589('0x68')]+=0x1;_0x814e82[_0x1589('0xae')]=0x3;_0x814e82[_0x1589('0xaf')]=_0x1589('0x1b6');_0x814e82[_0x1589('0x109')]+=0x1;_0x814e82[_0x1589('0xf7')]+=0x1;ami[_0x1589('0xf8')]('custom:agentnoanswer',ut[_0x1589('0xf0')](_0x1f7a28,_0x1589('0x1b7')));_0x39602c[_0x1589('0xd1')](_0x814e82)[_0x1589('0xb8')](loggerCatch(_0x1589('0x1b8')));if(_0x39602c[_0x1589('0x1b4')](0x3,_0x1f7a28,_0x3670d4)){if(_0x814e82['countnoanswerretry']>=_0x3670d4[_0x1589('0x1a2')]){_0x39602c[_0x1589('0x101')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1b9'));}else{_0x39602c[_0x1589('0xfe')](_0x814e82,_0x278fa4,_0x1d8a0d,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3670d4[_0x1589('0x1ba')]+=0x1;_0x814e82[_0x1589('0xae')]=0x5;_0x814e82[_0x1589('0xaf')]=_0x1589('0x1bb');_0x814e82[_0x1589('0xfa')]+=0x1;_0x814e82['countglobal']+=0x1;ami[_0x1589('0xf8')](_0x1589('0x1bc'),ut[_0x1589('0xf0')](_0x1f7a28,_0x1589('0x1bd')));_0x39602c[_0x1589('0xd1')](_0x814e82)[_0x1589('0xb8')](loggerCatch(_0x1589('0x1be')));if(_0x39602c[_0x1589('0x1b4')](0x5,_0x1f7a28,_0x3670d4)){if(_0x814e82['countbusyretry']>=_0x3670d4[_0x1589('0x1a4')]){_0x39602c[_0x1589('0x101')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1bf'));}else{_0x39602c[_0x1589('0xfe')](_0x814e82,_0x278fa4,_0x1d8a0d,'reason\x205\x20busy');}}break;case'8':_0x3670d4[_0x1589('0x64')]+=0x1;_0x814e82['state']=0x8;_0x814e82[_0x1589('0xaf')]=_0x1589('0x1c0');_0x814e82[_0x1589('0xfb')]+=0x1;_0x814e82[_0x1589('0xf7')]+=0x1;ami['emit'](_0x1589('0x1c1'),ut[_0x1589('0xf0')](_0x1f7a28,'congestion'));_0x39602c[_0x1589('0xd1')](_0x814e82)[_0x1589('0xb8')](loggerCatch(_0x1589('0x1c2')));if(_0x39602c[_0x1589('0x1b4')](0x8,_0x1f7a28,_0x3670d4)){if(_0x814e82[_0x1589('0xfb')]>=_0x3670d4[_0x1589('0x1c3')]){_0x39602c[_0x1589('0x101')](_0x814e82,_0x278fa4,_0x1d8a0d,'reason\x208\x20congestion');}else{_0x39602c['stateGlobal'](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1c4'));}}break;case'11':_0x3670d4[_0x1589('0x1c5')]+=0x1;_0x814e82[_0x1589('0xae')]=0xb;_0x814e82[_0x1589('0xaf')]=_0x1589('0x12c');_0x814e82['countabandonedretry']+=0x1;_0x814e82[_0x1589('0xf7')]+=0x1;_0x39602c[_0x1589('0xd1')](_0x814e82)[_0x1589('0xb8')](loggerCatch(_0x1589('0x1c6')));if(_0x39602c['checkRetriveMax'](0xb,_0x1f7a28,_0x3670d4)){if(_0x814e82[_0x1589('0x10b')]>=_0x3670d4['dialAbandonedMaxRetry']){_0x39602c['createStateFinal'](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1c7'));}else{_0x39602c[_0x1589('0xfe')](_0x814e82,_0x278fa4,_0x1d8a0d,'reason\x2011\x20abandoned');}}break;case'20':_0x3670d4[_0x1589('0x6c')]+=0x1;_0x814e82['state']=0x14;_0x814e82[_0x1589('0xaf')]=_0x1589('0x1c8');_0x814e82[_0x1589('0x10c')]+=0x1;_0x814e82['countglobal']+=0x1;ami['emit']('custom:agentreject',ut['buildObj'](_0x1f7a28,_0x1589('0x1c9')));_0x39602c[_0x1589('0xd1')](_0x814e82)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x39602c['checkRetriveMax'](0x14,_0x1f7a28,_0x3670d4)){if(_0x814e82[_0x1589('0x10c')]>=_0x3670d4[_0x1589('0x1ca')]){_0x39602c[_0x1589('0x101')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1cb'));}else{_0x39602c[_0x1589('0xfe')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x1589('0x1cb'));}}break;default:_0x3670d4[_0x1589('0x6d')]+=0x1;_0x814e82['state']=0xc;_0x814e82[_0x1589('0xaf')]=_0x5c9a8c[_0x1589('0x1b0')];_0x39602c[_0x1589('0xd1')](_0x814e82)[_0x1589('0xb8')](loggerCatch(_0x1589('0x1cc')));if(_0x39602c[_0x1589('0x1b4')](_0x5c9a8c[_0x1589('0x1b0')],_0x1f7a28,_0x3670d4)){if(_0x814e82[_0x1589('0xfa')]+_0x814e82['countcongestionretry']+_0x814e82[_0x1589('0x109')]+_0x814e82[_0x1589('0x10a')]+_0x814e82[_0x1589('0xfc')]+_0x814e82[_0x1589('0x10b')]+_0x814e82['countmachineretry']+_0x814e82[_0x1589('0x10c')]>=_0x3670d4[_0x1589('0xfd')]){_0x39602c[_0x1589('0xfe')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x5c9a8c['reason']);}else{_0x39602c[_0x1589('0x101')](_0x814e82,_0x278fa4,_0x1d8a0d,_0x5c9a8c[_0x1589('0x1b0')]);}}}});};Dialer[_0x1589('0x1b')][_0x1589('0xfe')]=function(_0x99af55,_0x1d3cd9,_0x2d55f1,_0x5265e1){var _0x253774=new Final(_0x99af55);_0x253774[_0x1589('0xae')]=0xf;_0x253774['statedesc']=_0x1589('0x1cd');this[_0x1589('0x101')](_0x253774,_0x1d3cd9,_0x2d55f1,_0x5265e1);};Dialer[_0x1589('0x1b')][_0x1589('0x101')]=function(_0x1e1de5,_0x102aab,_0x215b67,_0x805833){this[_0x1589('0x110')](_0x1e1de5)[_0x1589('0x41')](function(){return _0x102aab(msgResponse(_0x1589('0x1af'),'Success',_0x805833));})['catch'](function(){return _0x215b67(msgResponse(_0x1589('0x1ce'),_0x1589('0x14c'),_0x1589('0x1cf')));});};Dialer[_0x1589('0x1b')][_0x1589('0x163')]=function(_0x1687aa){var _0x3a9e16=_0x1687aa[_0x1589('0x1d0')]/0x64;var _0x575c3b=_0x1687aa[_0x1589('0x67')]/(_0x1687aa[_0x1589('0x67')]+_0x1687aa[_0x1589('0x62')]);var _0x465b00=Math[_0x1589('0x1d1')](_0x1687aa[_0x1589('0x76')]*(_0x1687aa[_0x1589('0x1d2')]/0x64));var _0x952643=Math['round'](_0x1687aa['predictiveIntervalAvailable']*(_0x1687aa[_0x1589('0x1d3')]/0x64));var _0x4074c5=_0x1687aa[_0x1589('0x53')]+_0x1687aa['talking'];var _0x437845=Math[_0x1589('0x1d4')](_0x1687aa[_0x1589('0x78')]*_0x1687aa['erlangAbandonmentRate']*_0x1687aa['predictiveIntervalHitRate']*_0x1687aa[_0x1589('0x75')]);if(_['isUndefined'](_0x1687aa[_0x1589('0x7a')])){if(!_[_0x1589('0x42')](_0x1687aa[_0x1589('0x2b')])){_0x1687aa[_0x1589('0x2b')]=undefined;loggerPredictive[_0x1589('0xa0')](_0x1589('0x1d5'),_0x1589('0x1d6'));}if(!_[_0x1589('0x42')](_0x1687aa[_0x1589('0x99')])){loggerPredictive[_0x1589('0xa0')](_0x1589('0x1d5'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x1687aa[_0x1589('0x99')]);_0x1687aa[_0x1589('0x99')]=undefined;}_0x1687aa[_0x1589('0x7a')]=moment()[_0x1589('0x7e')](_0x1589('0x10d'));loggerPredictive[_0x1589('0x82')](_0x1687aa[_0x1589('0x45')],_0x1589('0x1d7'),_0x1687aa[_0x1589('0x7a')]);this['handlePower'](_0x1687aa,0x1);}else if(ifInterval(_0x1687aa[_0x1589('0x1d8')],_0x1687aa[_0x1589('0x7a')])){this[_0x1589('0x160')](_0x1687aa,0x1);loggerPredictiveCalls[_0x1589('0x82')](_0x1589('0x1d9'),_0x1687aa['startProgressive'],_0x1687aa['name']);_0x1687aa[_0x1589('0x78')]=0x0;_0x1687aa['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3a9e16<_0x575c3b&&_0x1687aa[_0x1589('0x1da')]==='dropRate'){freeVariablesPredictive(_0x1687aa);loggerPredictive[_0x1589('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x1589('0x1db'),_0x575c3b,_0x1589('0x7a'),_0x1687aa[_0x1589('0x45')]);}else if(_0x437845<_0x1687aa[_0x1589('0x11c')]&&_0x1687aa[_0x1589('0x1da')]===_0x1589('0x1dc')){freeVariablesPredictive(_0x1687aa);loggerPredictive[_0x1589('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x1589('0x1dd'),_0x437845,_0x1589('0x1de'),_0x1687aa[_0x1589('0x11c')],_0x1589('0x7a'),_0x1687aa[_0x1589('0x45')]);}else if(!ifInterval(_0x1687aa[_0x1589('0x1d8')],_0x1687aa[_0x1589('0x7a')])&&_[_0x1589('0x42')](_0x1687aa['startPredictive'])&&!_[_0x1589('0x42')](_0x1687aa[_0x1589('0x7a')])){_0x1687aa[_0x1589('0x2b')]=moment()['format'](_0x1589('0x10d'));loggerPredictive['info'](_0x1687aa[_0x1589('0x45')],_0x1589('0x1df'),_0x1687aa[_0x1589('0x2b')]);this[_0x1589('0x1e0')](_0x1687aa[_0x1589('0x1d8')])[_0x1589('0x41')](this[_0x1589('0x1e1')](_0x1687aa))[_0x1589('0x41')](mergeDataErlangB(_0x1687aa))['then'](this[_0x1589('0x1e2')](_0x1687aa))[_0x1589('0xb8')](loggerCatchPredictive(_0x1589('0x1e3'),_0x1687aa));}else if(!ifInterval(_0x1687aa[_0x1589('0x1d8')],_0x1687aa[_0x1589('0x2b')])){_0x1687aa[_0x1589('0x11c')]=0x0;_0x1687aa['startPredictive']=moment()[_0x1589('0x7e')](_0x1589('0x10d'));loggerPredictive[_0x1589('0x82')](_0x1687aa[_0x1589('0x45')],_0x1589('0x1e4'),_0x1687aa[_0x1589('0x2b')]);clearInterval(_0x1687aa[_0x1589('0x99')]);_0x1687aa['handlePredictive']=undefined;this['averageHandleTime'](_0x1687aa[_0x1589('0x1d8')])[_0x1589('0x41')](this[_0x1589('0x1e1')](_0x1687aa))['then'](mergeDataErlangB(_0x1687aa))[_0x1589('0x41')](this[_0x1589('0x1e2')](_0x1687aa))[_0x1589('0xb8')](loggerCatchPredictive(_0x1589('0x1e5'),_0x1687aa));}else if(_0x1687aa[_0x1589('0x76')]&&_0x4074c5<_0x1687aa[_0x1589('0x76')]-_0x952643){freeVariablesPredictive(_0x1687aa);loggerPredictive[_0x1589('0x82')](_0x1687aa[_0x1589('0x45')],_0x1589('0x1e6'),_0x4074c5,_0x1589('0x1e7'),_0x1687aa[_0x1589('0x76')],'-',_0x952643,'=',_0x1687aa[_0x1589('0x76')]-_0x952643,')');}else if(_0x1687aa[_0x1589('0x76')]&&_0x4074c5>_0x1687aa[_0x1589('0x76')]+_0x465b00){freeVariablesPredictive(_0x1687aa);loggerPredictive[_0x1589('0x82')](_0x1687aa[_0x1589('0x45')],_0x1589('0x1e6'),_0x4074c5,_0x1589('0x1e8'),_0x1687aa[_0x1589('0x76')],'+',_0x465b00,'=',_0x1687aa[_0x1589('0x76')]+_0x465b00,')');}};Dialer[_0x1589('0x1b')]['getDataPredictive']=function(_0x744aee){var _0x32d81c=this;return function(_0x1b2f07){return new BPromise(function(_0x4caffb,_0x56bf2e){_['merge'](_0x744aee,_0x1b2f07[0x0]);if(checkGetDataPredictive(_0x1b2f07[0x0])){var _0x4e4431=_0x744aee['predictiveIntervalAvailable']=_0x744aee['talking']+_0x744aee[_0x1589('0x53')];var _0x662ea2=_0x744aee[_0x1589('0x1d8')]*0x3c;var _0x112cec=_0x1b2f07[0x0][_0x1589('0x70')]+_0x1b2f07[0x0][_0x1589('0x6f')];var _0x261f5a=(_0x1b2f07[0x0]['predictiveIntervalAnsweredCalls']+_0x1b2f07[0x0][_0x1589('0x72')]+_0x1b2f07[0x0][_0x1589('0x71')])/_0x1b2f07[0x0]['predictiveIntervalTotalCalls'];_0x744aee[_0x1589('0x74')]=_0x261f5a>0x0?_0x261f5a:0x1;switch(_0x744aee[_0x1589('0x1da')]){case _0x1589('0x1dc'):var _0xf7b27c=_0x744aee['dialPredictiveOptimizationPercentage']/0x64;return _0x32d81c['abandonmentRate'](_0x4e4431,_0x662ea2,_0x112cec,_0x261f5a,_0xf7b27c)[_0x1589('0x41')](function(_0x19054b){return _0x4caffb(_0x19054b);});case _0x1589('0x1e9'):var _0x2616b3=_0x744aee[_0x1589('0x1d0')]/0x64;return _0x32d81c['busyFactor'](_0x4e4431,_0x662ea2,_0x112cec,_0x261f5a,_0x2616b3)[_0x1589('0x41')](function(_0x3f5642){return _0x4caffb(_0x3f5642);});default:return _0x56bf2e(msgResponse(_0x1589('0x1ea'),_0x1589('0x14c'),_0x1589('0x1eb')));}}else{return _0x56bf2e(msgResponse(_0x1589('0x1ea'),'Failure','check\x20failure'));}});};};Dialer[_0x1589('0x1b')][_0x1589('0x1ec')]=function(_0x58fcf2){var _0x53288b=this;return function(_0x222bee){return new BPromise(function(_0x16db55,_0x1eee15){_['merge'](_0x58fcf2,_0x222bee[0x0]);if(checkGetDataPredictive(_0x222bee[0x0])){loggerPredictive['info'](JSON['stringify'](_0x222bee[0x0]));if(_0x58fcf2[_0x1589('0x1da')]===_0x1589('0x1dc')){return _0x53288b['getVoiceQueueRtPauses'](_0x58fcf2['id'])[_0x1589('0x41')](function(_0x4df251){var _0x560130=_0x58fcf2[_0x1589('0x54')]-_0x4df251[0x0][_0x1589('0x1ed')];var _0x3aeac9=_0x58fcf2[_0x1589('0x1d8')]*0x3c;var _0x386115=_0x222bee[0x0][_0x1589('0x70')]+_0x222bee[0x0][_0x1589('0x6f')];var _0x3c8d67=(_0x222bee[0x0][_0x1589('0x6e')]+_0x222bee[0x0][_0x1589('0x72')]+_0x222bee[0x0][_0x1589('0x71')])/_0x222bee[0x0][_0x1589('0x85')];var _0x11f9e2=_0x58fcf2[_0x1589('0x1d0')]/0x64;_0x58fcf2[_0x1589('0x1ee')]=_0x4df251[0x0][_0x1589('0x1ed')]||0x0;_0x58fcf2[_0x1589('0x74')]=_0x3c8d67>0x0?_0x3c8d67:0x1;return _0x53288b['abandonmentRate'](_0x560130,_0x3aeac9,_0x386115,_0x3c8d67,_0x11f9e2);})[_0x1589('0x41')](function(_0x3136c4){return _0x16db55(_0x3136c4);})['catch'](function(_0x37c369){return _0x1eee15(msgResponse(_0x1589('0x1ef'),_0x1589('0x14c'),JSON[_0x1589('0x7d')](_0x37c369)));});}if(_0x58fcf2[_0x1589('0x1da')]===_0x1589('0x1e9')){return _0x53288b[_0x1589('0xcf')](_0x58fcf2['id'])[_0x1589('0x41')](function(_0x428bde){var _0x2c4f68=_0x58fcf2[_0x1589('0x54')]-_0x428bde[0x0][_0x1589('0x1ed')];var _0x3f491c=_0x58fcf2[_0x1589('0x1d8')]*0x3c;var _0x3e45e1=_0x222bee[0x0][_0x1589('0x70')]+_0x222bee[0x0][_0x1589('0x6f')];var _0x3fb97b=(_0x222bee[0x0][_0x1589('0x6e')]+_0x222bee[0x0][_0x1589('0x72')]+_0x222bee[0x0][_0x1589('0x71')])/_0x222bee[0x0][_0x1589('0x85')];var _0x51bc81=_0x58fcf2[_0x1589('0x1d0')]/0x64;_0x58fcf2[_0x1589('0x1ee')]=_0x428bde[0x0][_0x1589('0x1ed')]||0x0;_0x58fcf2['predictiveIntervalHitRate']=_0x3fb97b>0x0?_0x3fb97b:0x1;return _0x53288b[_0x1589('0x1f0')](_0x2c4f68,_0x3f491c,_0x3e45e1,_0x3fb97b,_0x51bc81);})[_0x1589('0x41')](function(_0x3c90a6){return _0x16db55(_0x3c90a6);})[_0x1589('0xb8')](function(_0x570fcc){return _0x1eee15(msgResponse(_0x1589('0x1ef'),_0x1589('0x14c'),JSON['stringify'](_0x570fcc)));});}}else{return _0x1eee15(msgResponse(_0x1589('0x1ea'),'Failure',_0x1589('0x1f1')));}});};};Dialer[_0x1589('0x1b')][_0x1589('0x1e2')]=function(_0x4d3404){var _0x4e0c6d=this;return function(){var _0x5e33bd=0x0;var _0x42772a=Math[_0x1589('0x1d4')](_0x4d3404[_0x1589('0x79')]*0x3e8);if(_0x42772a>0x0){_0x42772a=_0x42772a<0x64?0x64:_0x42772a;loggerPredictive[_0x1589('0x82')](_0x4d3404[_0x1589('0x45')],'one\x20call\x20every:',_0x42772a,_0x1589('0x95'));_0x4d3404['handlePredictive']=setInterval(function(){_0x4e0c6d[_0x1589('0x99')](_0x4d3404);loggerPredictiveCalls['info'](_0x1589('0x1f2'),_0x5e33bd+=0x1);},_0x42772a);}else{loggerPredictive['info'](_0x4d3404[_0x1589('0x45')],_0x1589('0x1f3'));}};};Dialer[_0x1589('0x1b')][_0x1589('0x1f4')]=function(_0x1a74e3,_0x3723ae){var _0x2f1774=this;return function(_0x4f2e86){if(_[_0x1589('0x4d')](_0x4f2e86)){if(_[_0x1589('0xb6')](_0x3723ae[_0x1589('0xdb')])||!_0x3723ae[_0x1589('0x1f5')]){if(_0x1a74e3[_0x1589('0x15f')]===_0x1589('0xb')){_0x1a74e3[_0x1589('0x136')]=_[_0x1589('0x42')](_0x1a74e3['queueStatusComplete'])?!![]:_0x1a74e3[_0x1589('0x136')];var _0xed79ad=uuid['v4']();_0x2f1774['actions'][_0xed79ad]=new Action(_0x1a74e3,_0x3723ae,_0xed79ad);loggerBooked[_0x1589('0x82')]('[booked][checkContactBlack]',_0xed79ad,_0x1589('0x1f6'),JSON[_0x1589('0x7d')](_0x1a74e3[_0x1589('0x136')]),'Queue:\x20',_0x1a74e3[_0x1589('0x45')]);if(_0x1a74e3[_0x1589('0x136')]){_0x1a74e3[_0x1589('0x136')]=![];_0x2f1774['queueBooked'][_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0xbb')]]=[];ami[_0x1589('0xb7')]({'actionid':_0xed79ad,'action':_0x1589('0x1f7'),'queue':_0x1a74e3[_0x1589('0x45')]})[_0x1589('0xb8')](function(){_0x2f1774[_0x1589('0xba')](_0x1a74e3);_0x2f1774[_0x1589('0xc7')]({'active':![],'ContactId':_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0xd9')],'ListId':_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0xda')],'VoiceQueueId':_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0xdc')]||undefined,'CampaignId':_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x1f8')));delete _0x2f1774[_0x1589('0x27')][_0xed79ad];});}else{loggerBooked[_0x1589('0x82')](_0x1589('0x1f9'),JSON[_0x1589('0x7d')](_0x1a74e3[_0x1589('0x136')]),_0x1589('0x1fa'),_0x1a74e3['name']);_0x2f1774['updateOriginated'](_0x1a74e3);_0x2f1774[_0x1589('0xc7')]({'active':![],'ContactId':_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0xd9')],'ListId':_0x2f1774['actions'][_0xed79ad][_0x1589('0xda')],'VoiceQueueId':_0x2f1774[_0x1589('0x27')][_0xed79ad][_0x1589('0xdc')]||undefined,'CampaignId':_0x2f1774[_0x1589('0x27')][_0xed79ad]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f1774[_0x1589('0x27')][_0xed79ad];}}else{return _0x2f1774[_0x1589('0x174')](_0x1a74e3,_0x3723ae);}}else{if(getDiff(_0x3723ae[_0x1589('0x1fb')])<_0x1a74e3[_0x1589('0x1fc')]*0x3c){if(_0x3723ae[_0x1589('0x1fd')]&&!_0x3723ae[_0x1589('0x1fd')]['voicePause']){_0x2f1774[_0x1589('0x20')][_0x1589('0x138')](_0x3723ae['id'])[_0x1589('0x1e')](function(){_0x2f1774[_0x1589('0xba')](_0x1a74e3);});}else{_0x2f1774[_0x1589('0xc9')]({'active':![]},_0x3723ae['id'],0x1)[_0x1589('0x1e')](function(){_0x2f1774[_0x1589('0xba')](_0x1a74e3);});}}else{_0x1a74e3[_0x1589('0x6b')]+=0x1;_0x2f1774[_0x1589('0xba')](_0x1a74e3);if(_0x1a74e3[_0x1589('0x1fe')]){_0x2f1774[_0x1589('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3723ae[_0x1589('0xd9')],'ListId':_0x3723ae[_0x1589('0xda')],'VoiceQueueId':_0x3723ae['VoiceQueueId']||undefined,'CampaignId':_0x3723ae[_0x1589('0x106')]||undefined})[_0x1589('0xb8')](loggerCatch(_0x1589('0x1ff')));_0x2f1774['createHistory'](createObjHistory(_0x1a74e3,_0x3723ae,_0x1589('0x200'),0x17,'RecallInQueue'))[_0x1589('0xb8')](loggerCatch(_0x1589('0x201')));}else{_0x2f1774['saveInDb'](createObjHistory(_0x1a74e3,_0x3723ae,_0x1589('0x202'),0x16,_0x1589('0x203')),_0x1589('0x204'),'[Originate][HistoryRecallClose]');}}}}else{_0x1a74e3[_0x1589('0x63')]+=0x1;_0x2f1774[_0x1589('0xe4')](createObjHistory(_0x1a74e3,_0x3723ae,_0x1589('0x205'),0xd,_0x1589('0x206')),_0x1589('0x207'),_0x1589('0x208'));throw _0x1589('0x209');}};};Dialer[_0x1589('0x1b')][_0x1589('0x169')]=function(_0x3f3a69){var _0x26cfc3=this;var _0x33cee0=_0x3f3a69[_0x1589('0x20a')]-_0x3f3a69['originated']-_0x3f3a69[_0x1589('0xcb')];emitCampaignSummary(_0x3f3a69);if(_0x33cee0>0x0){if(_0x33cee0>this[_0x1589('0x25')]){_0x33cee0=this[_0x1589('0x25')];}_0x3f3a69[_0x1589('0xcb')]+=_0x33cee0;this[_0x1589('0xcd')](_0x3f3a69['id'],_0x33cee0,_0x3f3a69[_0x1589('0x20b')],_0x3f3a69)[_0x1589('0x41')](function(_0x791f2b){_0x3f3a69[_0x1589('0xcb')]-=_0x33cee0;_0x3f3a69[_0x1589('0xcb')]=_0x3f3a69[_0x1589('0xcb')]>0x0?_0x3f3a69[_0x1589('0xcb')]:0x0;if(!checkContactEmpty(_0x791f2b)){_0x3f3a69[_0x1589('0x43')]=_0x1589('0xa7');logger[_0x1589('0x82')](_0x1589('0x20c')+_0x3f3a69[_0x1589('0x45')]);}else{_0x3f3a69[_0x1589('0x77')]+=_0x791f2b[_0x1589('0x13c')];_0x3f3a69['message']=_0x1589('0x20d');for(var _0x5ea696=0x0;_0x5ea696<_0x791f2b[_0x1589('0x13c')];_0x5ea696+=0x1){_0x3f3a69['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x791f2b[_0x5ea696])||_[_0x1589('0xb6')](_0x791f2b[_0x5ea696][_0x1589('0x178')])||_['isNil'](_0x791f2b[_0x5ea696][_0x1589('0x178')][_0x1589('0x179')])){_0x26cfc3['emptyContact'](_0x1589('0x20e'),_0x3f3a69,_0x791f2b[_0x5ea696]);}else{_0x26cfc3[_0x1589('0xc3')](_[_0x1589('0xd8')](_0x791f2b[_0x5ea696],['CampaignId',_0x1589('0x20f')]))['then'](_0x26cfc3[_0x1589('0x1f4')](_0x3f3a69,_0x791f2b[_0x5ea696]))['catch'](_0x26cfc3[_0x1589('0xd5')](_0x1589('0x210'),_0x3f3a69));}}}})['catch'](loggerGetContactDialer(_0x1589('0x211'),_0x3f3a69,_0x33cee0));}};Dialer['prototype']['handlePower']=function(_0x57be80,_0x19bd42){var _0x3f2d92=this;var _0x21447e=[];var _0x360041=_0x19bd42>=0x1?_0x19bd42:0x1;if(_0x57be80[_0x1589('0x15f')]===_0x1589('0xb')){_0x360041=0x1;}var _0x1e201c=Math[_0x1589('0x1d4')](_0x57be80[_0x1589('0x53')]*_0x360041)-_0x57be80[_0x1589('0x77')]-_0x57be80[_0x1589('0xcb')];emitVoiceQueueSummary(_0x57be80);if(_0x57be80[_0x1589('0x212')]>0x0){var _0x829fac=_0x57be80[_0x1589('0x212')]-_0x57be80[_0x1589('0x77')]-_0x57be80[_0x1589('0x59')]-_0x57be80[_0x1589('0xcb')]-_0x57be80[_0x1589('0x55')];if(_0x1e201c>_0x829fac){_0x1e201c=_0x829fac;}}if(_0x1e201c>0x0){if(_0x57be80[_0x1589('0x15f')]===_0x1589('0xb')){_0x1e201c=0x1;}if(_0x1e201c>this[_0x1589('0x25')]){_0x1e201c=this[_0x1589('0x25')];}_0x57be80['temp']+=_0x1e201c;for(var _0x460679 in this['agents']){if(typeof this[_0x1589('0x23')][_0x460679]!=='undefined'){if(this[_0x1589('0x23')][_0x460679][_0x1589('0xae')]===_0x1589('0x213')&&this[_0x1589('0x23')][_0x460679]['status']===_0x1589('0x214')){_0x21447e[_0x1589('0x133')](this[_0x1589('0x23')][_0x460679]['id']);}}}this[_0x1589('0xca')](_0x57be80['id'],_0x21447e,_0x1e201c,_0x57be80[_0x1589('0x20b')],_0x57be80)['then'](function(_0x36aff9){_0x57be80[_0x1589('0xcb')]-=_0x1e201c;_0x57be80[_0x1589('0xcb')]=_0x57be80[_0x1589('0xcb')]>0x0?_0x57be80[_0x1589('0xcb')]:0x0;if(!checkContactEmpty(_0x36aff9)){_0x3f2d92['countReScheduled'](_0x57be80)[_0x1589('0x41')](sendMessageReschedule(_0x57be80))[_0x1589('0xb8')](loggerCatch(_0x1589('0xbf')));}else{_0x57be80[_0x1589('0x77')]+=_0x36aff9[_0x1589('0x13c')];_0x57be80[_0x1589('0x43')]=_0x57be80['dialMethod']===_0x1589('0xb')?_0x1589('0x180'):_0x1589('0x20d');for(var _0x37b058=0x0;_0x37b058<_0x36aff9[_0x1589('0x13c')];_0x37b058+=0x1){if(_[_0x1589('0xb6')](_0x36aff9[_0x37b058])||_[_0x1589('0xb6')](_0x36aff9[_0x37b058][_0x1589('0x178')])||_[_0x1589('0xb6')](_0x36aff9[_0x37b058][_0x1589('0x178')]['phone'])){_0x3f2d92['emptyContact']('[actionOriginate]\x20',_0x57be80,_0x36aff9[_0x37b058]);}else{_0x3f2d92[_0x1589('0xc0')](_['pick'](_0x36aff9[_0x37b058],[_0x1589('0xdc'),_0x1589('0x20f')]))[_0x1589('0x41')](_0x3f2d92[_0x1589('0x1f4')](_0x57be80,_0x36aff9[_0x37b058]))[_0x1589('0xb8')](_0x3f2d92[_0x1589('0xd5')](_0x1589('0x20e'),_0x57be80));}}}})[_0x1589('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x57be80,_0x1e201c));}};Dialer[_0x1589('0x1b')][_0x1589('0x99')]=function(_0x247a45){if(_0x247a45[_0x1589('0x212')]>0x0){var _0x5e3e5a=_0x247a45[_0x1589('0x212')]-_0x247a45[_0x1589('0x77')]-_0x247a45[_0x1589('0x59')];if(_0x5e3e5a>0x0){this[_0x1589('0x215')](_0x247a45);}else{loggerPredictiveCalls[_0x1589('0x82')](_0x1589('0x216'));}}else{this['tryOriginatePredictive'](_0x247a45);}};Dialer['prototype'][_0x1589('0x215')]=function(_0x41bc35){var _0x1e791b=this;var _0x24e351=[];_0x41bc35[_0x1589('0x77')]+=0x1;for(var _0x4001cd in this[_0x1589('0x23')]){if(typeof this[_0x1589('0x23')][_0x4001cd]!=='undefined'){if(this[_0x1589('0x23')][_0x4001cd][_0x1589('0xae')]==='not_inuse'&&this[_0x1589('0x23')][_0x4001cd][_0x1589('0xe2')]===_0x1589('0x214')){_0x24e351[_0x1589('0x133')](this[_0x1589('0x23')][_0x4001cd]['id']);}}}this[_0x1589('0xca')](_0x41bc35['id'],_0x24e351,0x1,_0x41bc35['dialOrderByScheduledAt'],_0x41bc35)['then'](function(_0xbc313){if(!checkContactEmpty(_0xbc313)){checkContactLowerLimitOriginate(_0x41bc35,0x1,0x0);_0x1e791b[_0x1589('0xbe')](_0x41bc35)[_0x1589('0x41')](sendMessageReschedule(_0x41bc35))[_0x1589('0xb8')](loggerCatch('[countReScheduled]\x20'));}else{_0x41bc35[_0x1589('0x43')]=_0x1589('0x20d');if(_[_0x1589('0xb6')](_0xbc313[0x0])||_[_0x1589('0xb6')](_0xbc313[0x0]['Contact'])||_[_0x1589('0xb6')](_0xbc313[0x0]['Contact'][_0x1589('0x179')])){_0x1e791b[_0x1589('0xd6')](_0x1589('0x20e'),_0x41bc35,_0xbc313[0x0]);}else{_0x1e791b[_0x1589('0xc0')](_['pick'](_0xbc313[0x0],[_0x1589('0xdc'),_0x1589('0x20f')]))[_0x1589('0x41')](_0x1e791b[_0x1589('0x1f4')](_0x41bc35,_0xbc313[0x0]))[_0x1589('0xb8')](_0x1e791b['loggerHandler']('[actionOriginatePredictive]\x20',_0x41bc35));}}})[_0x1589('0xb8')](loggerGetContactDialer(_0x1589('0x217'),_0x41bc35,0x1));emitVoiceQueueSummary(_0x41bc35);};Dialer[_0x1589('0x1b')][_0x1589('0x218')]=function(_0x3baa1e,_0x32d719,_0x170c11,_0x30b4e8,_0x309d4e,_0x227f48){loggerPredictive[_0x1589('0x82')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x1589('0x82')](_0x1589('0x219'),_0x3baa1e);loggerPredictive[_0x1589('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32d719);loggerPredictive[_0x1589('0x82')]('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',_0x170c11);loggerPredictive[_0x1589('0x82')](_0x1589('0x21a'),_0x30b4e8);loggerPredictive[_0x1589('0x82')](_0x1589('0x21b'),_0x309d4e);loggerPredictive[_0x1589('0x82')](_0x1589('0x93'));return new BPromise(function(_0x162b98,_0x3febcd){if(_0x3baa1e<=0x0||isNaN(_0x3baa1e)){return _0x3febcd(msgResponse(_0x1589('0x21c'),_0x1589('0x21d'),_0x1589('0x21e')+_0x3baa1e));}if(_0x170c11<=0x0||isNaN(_0x170c11)){return _0x3febcd(msgResponse(_0x1589('0x21c'),_0x1589('0x21d'),'Ts\x20=\x20'+_0x170c11));}if(_0x30b4e8<=0x0||isNaN(_0x30b4e8)){return _0x3febcd(msgResponse(_0x1589('0x21c'),_0x1589('0x21d'),_0x1589('0x21f')+_0x30b4e8));}if(_0x32d719<=0x0||isNaN(_0x32d719)){return _0x3febcd(msgResponse(_0x1589('0x21c'),_0x1589('0x21d'),_0x1589('0x220')+_0x32d719));}if(_0x309d4e<=0x0||isNaN(_0x309d4e)){return _0x3febcd(msgResponse(_0x1589('0x21c'),_0x1589('0x21d'),_0x1589('0x221')+_0x309d4e));}_0x227f48=_0x227f48||0x0;var _0x4c588e=0x1/_0x170c11;var _0x26f261=0x0;var _0x2e93d1=0x0;var _0x2c1fdf=0x0;var _0x164446=0x0;for(var _0x532bb8=0x0;_0x2c1fdf<_0x309d4e;_0x532bb8+=0x1){_0x2e93d1=_0x532bb8/_0x32d719;_0x26f261=(_0x30b4e8*_0x2e93d1+_0x227f48)/_0x4c588e;_0x2c1fdf=erlangb(_0x26f261,_0x3baa1e);_0x164446=_0x26f261/_0x3baa1e*(0x1-erlangb(_0x26f261,_0x3baa1e));}return _0x162b98({'erlangCalls':_0x532bb8,'erlangCallToSecond':_0x32d719/_0x532bb8,'erlangAbandonmentRate':_0x2c1fdf,'erlangBusyFactor':_0x164446});});};Dialer['prototype']['busyFactor']=function(_0x5b30d4,_0x682ab8,_0x23ffe6,_0x3cb964,_0x56bf39,_0x47f931){loggerPredictive[_0x1589('0x82')](_0x1589('0x222'));loggerPredictive[_0x1589('0x82')](_0x1589('0x219'),_0x5b30d4);loggerPredictive[_0x1589('0x82')](_0x1589('0x223'),_0x682ab8);loggerPredictive['info'](_0x1589('0x224'),_0x23ffe6);loggerPredictive[_0x1589('0x82')](_0x1589('0x21a'),_0x3cb964);loggerPredictive[_0x1589('0x82')](_0x1589('0x225'),_0x56bf39);loggerPredictive[_0x1589('0x82')](_0x1589('0x93'));return new BPromise(function(_0x802cd4,_0xd3603b){if(_0x5b30d4<=0x0||isNaN(_0x5b30d4)){return _0xd3603b(msgResponse('[busyFactor]',_0x1589('0x21d'),'m\x20=\x20'+_0x5b30d4));}if(_0x23ffe6<=0x0||isNaN(_0x23ffe6)){return _0xd3603b(msgResponse(_0x1589('0x226'),_0x1589('0x21d'),'Ts\x20=\x20'+_0x23ffe6));}if(_0x3cb964<=0x0||isNaN(_0x3cb964)){return _0xd3603b(msgResponse(_0x1589('0x226'),_0x1589('0x21d'),_0x1589('0x21f')+_0x3cb964));}if(_0x682ab8<=0x0||isNaN(_0x682ab8)){return _0xd3603b(msgResponse(_0x1589('0x226'),'Error',_0x1589('0x220')+_0x682ab8));}if(_0x56bf39<=0x0||isNaN(_0x56bf39)){return _0xd3603b(msgResponse('[busyFactor]',_0x1589('0x21d'),_0x1589('0x227')+_0x56bf39));}_0x47f931=_0x47f931||0x0;var _0x3e1a5e=0x1/_0x23ffe6;var _0x2af96d=0x0;var _0x16bf12=0x0;var _0x1c6cef=0x0;var _0xe42b91=0x0;for(var _0x21ba4d=0x0;_0xe42b91<_0x56bf39;_0x21ba4d+=0x1){_0x16bf12=_0x21ba4d/_0x682ab8;_0x2af96d=(_0x3cb964*_0x16bf12+_0x47f931)/_0x3e1a5e;_0x1c6cef=erlangb(_0x2af96d,_0x5b30d4);_0xe42b91=_0x2af96d/_0x5b30d4*(0x1-erlangb(_0x2af96d,_0x5b30d4));}return _0x802cd4({'erlangCalls':_0x21ba4d,'erlangCallToSecond':_0x682ab8/_0x21ba4d,'erlangAbandonmentRate':_0x1c6cef,'erlangBusyFactor':_0xe42b91});});};module[_0x1589('0x228')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index d73e595..a962f4b 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 _0x9ca2=['countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x9ca2,0xe4));var _0x29ca=function(_0x361f7d,_0x43d821){_0x361f7d=_0x361f7d-0x0;var _0x9e35d5=_0x9ca2[_0x361f7d];return _0x9e35d5;};'use strict';var util=require('util');var _=require(_0x29ca('0x0'));var moment=require(_0x29ca('0x1'));function getSeconds(_0x2aff0c,_0x4d817d){var _0x2e8747=moment(_0x2aff0c)[_0x29ca('0x2')](0x0);var _0x2bf38d=moment(_0x4d817d)[_0x29ca('0x2')](0x0);return _0x2e8747[_0x29ca('0x3')](_0x2bf38d,'seconds');}function QueueCallerAbandon(_0x311faf,_0xcbd11f){this['scheduledat']=_0x311faf['scheduledat'];this[_0x29ca('0x4')]=_0x311faf[_0x29ca('0x4')];this[_0x29ca('0x5')]=_0x311faf[_0x29ca('0x4')]===_0x29ca('0x6')?_0x29ca('0x7'):_0x311faf[_0x29ca('0x4')];this[_0x29ca('0x8')]=_0x311faf[_0x29ca('0x8')];this[_0x29ca('0x9')]=_0x311faf[_0x29ca('0x9')];this[_0x29ca('0xa')]=_0x311faf[_0x29ca('0xa')];this[_0x29ca('0xb')]=_0x311faf['countbusyretry']+_0x311faf['countcongestionretry']+_0x311faf[_0x29ca('0xa')]+_0x311faf['countnosuchnumberretry']+_0x311faf[_0x29ca('0xc')]+_0x311faf[_0x29ca('0xd')]+_0x311faf['countmachineretry']+_0x311faf['countagentrejectretry'];this[_0x29ca('0xe')]=_0x311faf[_0x29ca('0xe')];this[_0x29ca('0xc')]=_0x311faf[_0x29ca('0xc')];this['countabandonedretry']=_0x311faf[_0x29ca('0xd')];this[_0x29ca('0xf')]=_0x311faf[_0x29ca('0xf')];this[_0x29ca('0x10')]=_0x311faf[_0x29ca('0x10')];this[_0x29ca('0x11')]=_0xcbd11f[_0x29ca('0x11')];this['calleridname']=_0x311faf['name'];this[_0x29ca('0x12')]=_0x311faf[_0x29ca('0x13')];this['starttime']=_0x311faf[_0x29ca('0x14')];this[_0x29ca('0x15')]=_0x311faf[_0x29ca('0x15')];this[_0x29ca('0x16')]=_0x311faf['droptime'];this[_0x29ca('0x17')]=this[_0x29ca('0x16')];this['ringtime']=getSeconds(_0x311faf['responsetime'],_0x311faf[_0x29ca('0x14')]);this['holdtime']=getSeconds(this['droptime'],_0x311faf['responsetime']);this[_0x29ca('0x18')]=0x0;this[_0x29ca('0x7')]=_0xcbd11f[_0x29ca('0x7')];this[_0x29ca('0x19')]=_0xcbd11f[_0x29ca('0x1a')];this[_0x29ca('0x1b')]=_0xcbd11f[_0x29ca('0x1b')];this[_0x29ca('0x1c')]=_0x311faf['callback'];this[_0x29ca('0x1d')]=_0x311faf['callbackuniqueid'];this[_0x29ca('0x1e')]=_0x311faf[_0x29ca('0x1e')];this[_0x29ca('0x1f')]=_0x311faf['recallme'];this['ContactId']=_0x311faf[_0x29ca('0x20')];this[_0x29ca('0x21')]=_0x311faf[_0x29ca('0x21')];this[_0x29ca('0x22')]=_0x311faf[_0x29ca('0x22')];this[_0x29ca('0x23')]=_0x311faf[_0x29ca('0x23')];this['CampaignId']=_0x311faf[_0x29ca('0x24')];this['originatecalleridnum']=_0x311faf[_0x29ca('0x25')]||'';this[_0x29ca('0x26')]=_0x311faf[_0x29ca('0x26')]||'';}module[_0x29ca('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x76a4=['uniqueid','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x1cd795,_0x21a55c){var _0x499cea=function(_0x27b10a){while(--_0x27b10a){_0x1cd795['push'](_0x1cd795['shift']());}};_0x499cea(++_0x21a55c);}(_0x76a4,0xe9));var _0x476a=function(_0x1d5887,_0x55f0d5){_0x1d5887=_0x1d5887-0x0;var _0x58d547=_0x76a4[_0x1d5887];return _0x58d547;};'use strict';var util=require(_0x476a('0x0'));var _=require(_0x476a('0x1'));var moment=require(_0x476a('0x2'));function getSeconds(_0x9914e5,_0x186c55){var _0x1f403e=moment(_0x9914e5)[_0x476a('0x3')](0x0);var _0x42b17d=moment(_0x186c55)[_0x476a('0x3')](0x0);return _0x1f403e[_0x476a('0x4')](_0x42b17d,_0x476a('0x5'));}function QueueCallerAbandon(_0xf4efc9,_0x1af568){this[_0x476a('0x6')]=_0xf4efc9[_0x476a('0x6')];this['type']=_0xf4efc9['type'];this[_0x476a('0x7')]=_0xf4efc9[_0x476a('0x8')]===_0x476a('0x9')?_0x476a('0xa'):_0xf4efc9[_0x476a('0x8')];this[_0x476a('0xb')]=_0xf4efc9[_0x476a('0xb')];this[_0x476a('0xc')]=_0xf4efc9[_0x476a('0xc')];this['countnoanswerretry']=_0xf4efc9['countnoanswerretry'];this[_0x476a('0xd')]=_0xf4efc9['countbusyretry']+_0xf4efc9[_0x476a('0xc')]+_0xf4efc9['countnoanswerretry']+_0xf4efc9[_0x476a('0xe')]+_0xf4efc9[_0x476a('0xf')]+_0xf4efc9[_0x476a('0x10')]+_0xf4efc9[_0x476a('0x11')]+_0xf4efc9[_0x476a('0x12')];this[_0x476a('0xe')]=_0xf4efc9[_0x476a('0xe')];this['countdropretry']=_0xf4efc9[_0x476a('0xf')];this['countabandonedretry']=_0xf4efc9[_0x476a('0x10')];this[_0x476a('0x11')]=_0xf4efc9[_0x476a('0x11')];this[_0x476a('0x12')]=_0xf4efc9[_0x476a('0x12')];this['uniqueid']=_0x1af568[_0x476a('0x13')];this['calleridname']=_0xf4efc9[_0x476a('0x14')];this['calleridnum']=_0xf4efc9[_0x476a('0x15')];this[_0x476a('0x16')]=_0xf4efc9[_0x476a('0x16')];this[_0x476a('0x17')]=_0xf4efc9[_0x476a('0x17')];this[_0x476a('0x18')]=_0xf4efc9['droptime'];this[_0x476a('0x19')]=this[_0x476a('0x18')];this[_0x476a('0x1a')]=getSeconds(_0xf4efc9['responsetime'],_0xf4efc9[_0x476a('0x16')]);this[_0x476a('0x1b')]=getSeconds(this[_0x476a('0x18')],_0xf4efc9[_0x476a('0x17')]);this[_0x476a('0x1c')]=0x0;this['queue']=_0x1af568[_0x476a('0xa')];this[_0x476a('0x1d')]=_0x1af568[_0x476a('0x1e')];this[_0x476a('0x1f')]=_0x1af568['reason'];this['callback']=_0xf4efc9[_0x476a('0x20')];this[_0x476a('0x21')]=_0xf4efc9[_0x476a('0x21')];this[_0x476a('0x22')]=_0xf4efc9[_0x476a('0x22')];this[_0x476a('0x23')]=_0xf4efc9['recallme'];this[_0x476a('0x24')]=_0xf4efc9[_0x476a('0x24')];this['ListId']=_0xf4efc9[_0x476a('0x25')];this['UserId']=_0xf4efc9['UserId'];this[_0x476a('0x26')]=_0xf4efc9[_0x476a('0x26')];this[_0x476a('0x27')]=_0xf4efc9[_0x476a('0x27')];this['originatecalleridnum']=_0xf4efc9['originatecalleridnum']||'';this[_0x476a('0x28')]=_0xf4efc9['originatecalleridname']||'';}module[_0x476a('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 b13cc5c..391bfd3 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(_0x4157e5,_0x2f5382){var _0x54b7d1=function(_0x366c51){while(--_0x366c51){_0x4157e5['push'](_0x4157e5['shift']());}};_0x54b7d1(++_0x2f5382);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x1a7fb8,_0x2d89b0){var _0x55c96b=function(_0x114195){while(--_0x114195){_0x1a7fb8['push'](_0x1a7fb8['shift']());}};_0x55c96b(++_0x2d89b0);}(_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 188adea..2a9934c 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 _0x0102=['[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkTrunk','Trunk','isValid','format','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype','context','from-voip-provider','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','info','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','fax','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger'];(function(_0x40b99b,_0x4b72f4){var _0x11d8cf=function(_0x4d0d44){while(--_0x4d0d44){_0x40b99b['push'](_0x40b99b['shift']());}};_0x11d8cf(++_0x4b72f4);}(_0x0102,0x186));var _0x2010=function(_0x39ba65,_0x7edd1a){_0x39ba65=_0x39ba65-0x0;var _0x59dd60=_0x0102[_0x39ba65];return _0x59dd60;};'use strict';var util=require('util');var _=require(_0x2010('0x0'));var BPromise=require(_0x2010('0x1'));var uuid=require(_0x2010('0x2'));var moment=require(_0x2010('0x3'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require(_0x2010('0x4'));var rpcDb=require(_0x2010('0x5'));var Channel=require(_0x2010('0x6'));var ut=require(_0x2010('0x7'));var Action=require('./action');var faxAccount=require(_0x2010('0x8'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x2010('0x9'));function Fax(_0x160e41){this['channels']={};this[_0x2010('0xa')]=_0x160e41[_0x2010('0xa')];this[_0x2010('0xb')]=_0x160e41[_0x2010('0xb')];this[_0x2010('0xc')]={};ami['on'](_0x2010('0xd'),this[_0x2010('0xe')][_0x2010('0xf')](this));ami['on'](_0x2010('0x10'),this[_0x2010('0x11')][_0x2010('0xf')](this));ami['on'](_0x2010('0x12'),this[_0x2010('0x13')][_0x2010('0xf')](this));ami['on'](_0x2010('0x14'),this[_0x2010('0x15')]['bind'](this));ami['on']('faxstatus',this[_0x2010('0x16')][_0x2010('0xf')](this));ami['on'](_0x2010('0x17'),this[_0x2010('0x18')][_0x2010('0xf')](this));ami['on'](_0x2010('0x19'),this['syncHangup'][_0x2010('0xf')](this));ami['on'](_0x2010('0x1a'),this['syncOriginateResponse'][_0x2010('0xf')](this));}Fax[_0x2010('0x1b')][_0x2010('0xe')]=function(_0x2b403a){if(_0x2b403a[_0x2010('0x1c')]===_0x2010('0x1d')){for(var _0x83cd35 in this[_0x2010('0xa')]){if(this[_0x2010('0xa')]['hasOwnProperty'](_0x83cd35)){if(_0x2b403a['exten']===this[_0x2010('0xa')][_0x83cd35][_0x2010('0x1e')]){this[_0x2010('0x1f')][_0x2b403a[_0x2010('0x20')]]={};this['channels'][_0x2b403a['uniqueid']][_0x2010('0x21')]=_0x2b403a[_0x2010('0x21')];this[_0x2010('0x1f')][_0x2b403a[_0x2010('0x20')]]['id']=this[_0x2010('0xa')][_0x83cd35]['id'];this[_0x2010('0x1f')][_0x2b403a['uniqueid']][_0x2010('0x22')]=this[_0x2010('0xa')][_0x83cd35]['name'];logger['info'](_0x2b403a['uniqueid'],_0x2010('0x23'));}}}}if(this['actions'][_0x2b403a[_0x2010('0x20')]]){this['channels'][_0x2b403a['uniqueid']]={};this[_0x2010('0x1f')][_0x2b403a[_0x2010('0x20')]]['channel']=_0x2b403a[_0x2010('0x21')];logger['info'](_0x2b403a[_0x2010('0x20')],_0x2010('0x23'));}};Fax[_0x2010('0x1b')][_0x2010('0x11')]=function(_0x3c5862){if(this[_0x2010('0x1f')][_0x3c5862[_0x2010('0x20')]]){for(var _0x3eb4dc in _0x3c5862[_0x2010('0x24')]){if(_0x3c5862[_0x2010('0x24')][_0x2010('0x25')](_0x3eb4dc)){this[_0x2010('0x1f')][_0x3c5862['uniqueid']][_0x3eb4dc]=_0x3c5862[_0x2010('0x26')];}}}};Fax['prototype'][_0x2010('0x13')]=function(_0x147a5a){if(this[_0x2010('0x1f')][_0x147a5a[_0x2010('0x20')]]){this['channels'][_0x147a5a['uniqueid']][_0x2010('0x27')]=_0x147a5a['channelstate'];this[_0x2010('0x1f')][_0x147a5a[_0x2010('0x20')]]['channelstatedesc']=_0x147a5a[_0x2010('0x28')];}};Fax[_0x2010('0x1b')][_0x2010('0x15')]=function(_0x1288cf){if(this[_0x2010('0x1f')][_0x1288cf['uniqueid']]){for(var _0x9be262 in _0x1288cf[_0x2010('0x24')]){if(_0x1288cf[_0x2010('0x24')]['hasOwnProperty'](_0x9be262)){this['channels'][_0x1288cf[_0x2010('0x20')]][_0x9be262]=_0x1288cf[_0x2010('0x26')];}}}};Fax[_0x2010('0x1b')]['syncFaxStatus']=function(_0x590a8b){if(this[_0x2010('0x1f')][_0x590a8b[_0x2010('0x20')]]){this[_0x2010('0x1f')][_0x590a8b[_0x2010('0x20')]][_0x2010('0x29')]=_0x590a8b['operation'];this['channels'][_0x590a8b['uniqueid']][_0x2010('0x2a')]=_0x590a8b[_0x2010('0x2a')];this[_0x2010('0x1f')][_0x590a8b['uniqueid']][_0x2010('0x1e')]=_0x590a8b[_0x2010('0x1e')];this[_0x2010('0x1f')][_0x590a8b[_0x2010('0x20')]]['filename']=_0x590a8b[_0x2010('0x2b')];logger[_0x2010('0x2c')](_0x590a8b[_0x2010('0x20')],'\x20syncFaxStatus\x20');}};Fax[_0x2010('0x1b')]['syncReceiveFax']=function(_0x13f88a){var _0x194221=this;if(this[_0x2010('0x1f')][_0x13f88a[_0x2010('0x20')]]){var _0x7b4a4d=this[_0x2010('0x1f')][_0x13f88a['uniqueid']]['id'];this[_0x2010('0x1f')][_0x13f88a['uniqueid']][_0x2010('0x2d')]=_0x13f88a[_0x2010('0x2d')];this[_0x2010('0x1f')][_0x13f88a[_0x2010('0x20')]][_0x2010('0x2e')]=_0x13f88a[_0x2010('0x2e')];this[_0x2010('0x1f')][_0x13f88a[_0x2010('0x20')]][_0x2010('0x1e')]=_0x13f88a[_0x2010('0x1e')];this[_0x2010('0x1f')][_0x13f88a[_0x2010('0x20')]][_0x2010('0x2f')]=_0x13f88a[_0x2010('0x2f')];this['channels'][_0x13f88a['uniqueid']][_0x2010('0x30')]=_0x13f88a[_0x2010('0x30')];this[_0x2010('0x1f')][_0x13f88a[_0x2010('0x20')]][_0x2010('0x2b')]=_0x13f88a[_0x2010('0x2b')];this[_0x2010('0x1f')][_0x13f88a['uniqueid']][_0x2010('0x31')]=_0x13f88a['calleridnum'];if(this[_0x2010('0x1f')][_0x13f88a[_0x2010('0x20')]][_0x2010('0x2e')]>0x0){tiff2pdf(_0x13f88a[_0x2010('0x2b')],_0x2010('0x32'),function(_0x4e0637){logger[_0x2010('0x2c')](_0x13f88a[_0x2010('0x20')],_0x2010('0x33'),_0x4e0637[_0x2010('0x34')]);attachment['create']({'name':path[_0x2010('0x35')](_0x13f88a['filename'])['name'],'basename':path['parse'](_0x13f88a[_0x2010('0x2b')])[_0x2010('0x22')]+_0x2010('0x36'),'type':_0x2010('0x37')})[_0x2010('0x38')](function(_0x2c4d3a){faxAccount['notify'](_0x7b4a4d,{'from':_0x13f88a[_0x2010('0x31')],'mapKey':_0x2010('0x39'),'body':path[_0x2010('0x35')](_0x13f88a['filename'])['name']+_0x2010('0x36'),'AttachmentId':_0x2c4d3a['id']})['catch'](function(_0x31ff4c){logger[_0x2010('0x3a')](_0x13f88a[_0x2010('0x20')],_0x2010('0x3b'),JSON['stringify'](_0x31ff4c));});})[_0x2010('0x3c')](function(_0x3aabb3){logger[_0x2010('0x3a')](_0x13f88a[_0x2010('0x20')],_0x2010('0x3d'),JSON[_0x2010('0x3e')](_0x3aabb3));});});}logger['info'](_0x13f88a[_0x2010('0x20')],_0x2010('0x3d'));}};Fax[_0x2010('0x1b')]['syncOriginateResponse']=function(_0x30e5d0){if(this[_0x2010('0xc')][_0x30e5d0['uniqueid']]){_[_0x2010('0x3f')](this[_0x2010('0x1f')][_0x30e5d0[_0x2010('0x20')]],_[_0x2010('0x40')](_0x30e5d0,[_0x2010('0x41'),_0x2010('0x42')]));}};function updateStatus(_0x273241){if(_0x273241[_0x2010('0x43')]){faxMessage['update'](_0x273241['AttachmentId'],{'failMessage':_0x2010('0x44')})[_0x2010('0x38')](function(_0x5397f4){ut[_0x2010('0x45')](_0x2010('0x46'),_0x5397f4);})[_0x2010('0x3c')](function(_0xba8504){ut[_0x2010('0x45')]('[Fax][Message][Error][NoUpdate1]',_0xba8504);});}else{ut['logger'](_0x2010('0x47'));}}Fax[_0x2010('0x1b')][_0x2010('0x48')]=function(_0x3b89de,_0x38e596,_0x2d8164){var _0xbe689e=this;var _0x141f55={};if(_0x38e596){_0x141f55={'read':_0x38e596};}else{_0x141f55={'failMessage':_0x2d8164};}if(this[_0x2010('0xc')][_0x3b89de][_0x2010('0x43')]){faxMessage[_0x2010('0x49')](this['actions'][_0x3b89de][_0x2010('0x43')],_0x141f55)[_0x2010('0x38')](function(_0x56555e){ut[_0x2010('0x45')](_0x2010('0x4a'),_0x56555e);})[_0x2010('0x3c')](function(_0x22e553){ut[_0x2010('0x45')](_0x2010('0x4b'),_0x22e553);})[_0x2010('0x4c')](function(){delete _0xbe689e[_0x2010('0x1f')][_0x3b89de];delete _0xbe689e[_0x2010('0xc')][_0x3b89de];});}else{ut[_0x2010('0x45')](_0x2010('0x4d'));delete this[_0x2010('0x1f')][_0x3b89de];delete this[_0x2010('0xc')][_0x3b89de];}};Fax[_0x2010('0x1b')][_0x2010('0x4e')]=function(_0x3c03ee){var _0x3a8c76=this;if(this[_0x2010('0x1f')][_0x3c03ee[_0x2010('0x20')]]){if(this[_0x2010('0xc')][_0x3c03ee[_0x2010('0x20')]]){this[_0x2010('0x1f')][_0x3c03ee[_0x2010('0x20')]]['id']=this['actions'][_0x3c03ee[_0x2010('0x20')]]['id'];this['channels'][_0x3c03ee['uniqueid']][_0x2010('0x22')]=this[_0x2010('0xc')][_0x3c03ee['uniqueid']][_0x2010('0x22')];}logger[_0x2010('0x2c')](_0x3c03ee[_0x2010('0x20')],this[_0x2010('0xc')][_0x3c03ee['uniqueid']]?_0x2010('0x4f'):_0x2010('0x50'),JSON[_0x2010('0x3e')](this[_0x2010('0x1f')][_0x3c03ee['uniqueid']]));if(this[_0x2010('0xc')][_0x3c03ee['uniqueid']]){if(this[_0x2010('0x1f')][_0x3c03ee[_0x2010('0x20')]][_0x2010('0x51')]>0x0&&this[_0x2010('0x1f')][_0x3c03ee['uniqueid']]['faxstatus']===_0x2010('0x52')){this[_0x2010('0x48')](_0x3c03ee['uniqueid'],!![]);}else{this['updateStatus'](_0x3c03ee[_0x2010('0x20')],![],this[_0x2010('0x1f')][_0x3c03ee[_0x2010('0x20')]][_0x2010('0x53')]?'SENDING\x20FAILED:\x20'+this[_0x2010('0x1f')][_0x3c03ee['uniqueid']][_0x2010('0x53')]:_0x2010('0x54'));}}}};Fax[_0x2010('0x1b')][_0x2010('0x55')]=function(_0x4bde43){var _0x340882=this;return new BPromise(function(_0x31d8be,_0x478b8e){_0x340882[_0x2010('0x56')](_0x4bde43,_0x340882[_0x2010('0xa')][_0x4bde43[_0x2010('0x57')]])[_0x2010('0x38')](function(_0x262caa){ut[_0x2010('0x45')](_0x2010('0x58'),_0x262caa);_0x31d8be(ut[_0x2010('0x34')](_0x2010('0x59')));})[_0x2010('0x3c')](function(_0x3a8cfb){ut[_0x2010('0x45')]('[Fax][execOriginate][failure]',_0x3a8cfb);updateStatus(_0x4bde43);_0x478b8e(ut[_0x2010('0x34')](_0x2010('0x5a')));});});};Fax[_0x2010('0x1b')]['checkAfterSend']=function(_0x5ca75a){var _0x24466f=this;return new BPromise(function(_0x16c583,_0x38a37b){var _0x2b0d44=_0x24466f[_0x2010('0x5b')](_0x24466f[_0x2010('0xa')][_0x5ca75a['FaxAccountId']][_0x2010('0x5c')],_0x5ca75a);if(_0x2b0d44[_0x2010('0x5d')]){_0x16c583(ut[_0x2010('0x34')]('Trunk\x20Reachable'));}else{_0x38a37b(ut[_0x2010('0x34')](_0x2b0d44[_0x2010('0x34')]));}});};function originate(_0x13d06d,_0x5182b2,_0x20dea1){return new BPromise(function(_0x22f654,_0x4adc1c){if(_0x20dea1){var _0x493c89=util[_0x2010('0x5e')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x13d06d[_0x2010('0x5f')])[_0x2010('0x22')],_0x13d06d[_0x2010('0x5f')]);gs[_0x2010('0x60')](_0x493c89)[_0x2010('0x38')](function(){_0x13d06d[_0x2010('0x5f')]=util[_0x2010('0x5e')](_0x2010('0x61'),path[_0x2010('0x35')](_0x13d06d[_0x2010('0x5f')])['dir'],path[_0x2010('0x35')](_0x13d06d[_0x2010('0x5f')])['name']);_0x5182b2[_0x2010('0x62')]=_0x13d06d[_0x2010('0x5f')];ut[_0x2010('0x45')](_0x2010('0x63'),'');ami['Action'](ut[_0x2010('0x64')](_0x13d06d,_0x5182b2))[_0x2010('0x38')](function(_0x4ae6b7){_0x22f654(_0x4ae6b7);})['catch'](function(_0x7f599d){_0x4adc1c(_0x7f599d);});})['catch'](function(_0x14555c){_0x4adc1c(_0x14555c);});}else{ami[_0x2010('0x65')](ut[_0x2010('0x64')](_0x13d06d,_0x5182b2))[_0x2010('0x38')](function(_0x43abf2){_0x22f654(_0x43abf2);})[_0x2010('0x3c')](function(_0x381c5c){_0x4adc1c(_0x381c5c);});}});}Fax['prototype'][_0x2010('0x56')]=function(_0x1eef06,_0x3c32c0){var _0x4db525=this;return new BPromise(function(_0x421016,_0x340a20){var _0x13d7ff=uuid['v4']();var _0x44604d=ut[_0x2010('0x66')](_0x1eef06,_0x3c32c0);_0x4db525[_0x2010('0xc')][_0x13d7ff]=new Action(_0x13d7ff,_0x3c32c0,_0x1eef06);var _0x40885b=_0x4db525[_0x2010('0xc')][_0x13d7ff];if(path['parse'](_0x1eef06[_0x2010('0x5f')])[_0x2010('0x67')]===_0x2010('0x36')){originate(_0x40885b,_0x44604d,!![])['then'](function(_0xb6ba3f){_0x421016(_0xb6ba3f);})[_0x2010('0x3c')](function(_0x490483){_0x340a20(_0x490483);});}else{originate(_0x40885b,_0x44604d,![])[_0x2010('0x38')](function(_0x10f81c){_0x421016(_0x10f81c);})[_0x2010('0x3c')](function(_0x61921d){_0x340a20(_0x61921d);});}});};Fax[_0x2010('0x1b')]['isTrunkReachable']=function(_0xe2c487){return!_[_0x2010('0x68')](_0xe2c487)&&!_['isNil'](_0xe2c487[_0x2010('0x22')])&&!_[_0x2010('0x68')](_0xe2c487['active'])&&_0xe2c487[_0x2010('0x69')]&&!_['isNil'](this['trunks'][util[_0x2010('0x5e')](_0x2010('0x6a'),_0xe2c487[_0x2010('0x22')])])&&!_[_0x2010('0x68')](this[_0x2010('0xb')][util[_0x2010('0x5e')]('SIP/%s',_0xe2c487[_0x2010('0x22')])][_0x2010('0x2a')])&&(this[_0x2010('0xb')][util[_0x2010('0x5e')]('SIP/%s',_0xe2c487[_0x2010('0x22')])]['status']===_0x2010('0x6b')||this[_0x2010('0xb')][util[_0x2010('0x5e')](_0x2010('0x6a'),_0xe2c487['name'])]['status']==='unmonitored');};Fax[_0x2010('0x1b')]['checkTrunk']=function(_0x2f91f5,_0x475d6a){if(!this['isTrunkReachable'](_0x2f91f5)){ut[_0x2010('0x45')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x2010('0x68')](_0x2f91f5)?'':_0x2f91f5[_0x2010('0x22')]+_0x2010('0x6c'));return{'isValid':![],'message':_0x2010('0x6d')};}if(_['isNil'](_0x475d6a['fax'])){ut['logger'](_0x2010('0x6e'),JSON[_0x2010('0x3e')](_0x475d6a));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x2010('0x68')](_0x475d6a['path'])){ut[_0x2010('0x45')](_0x2010('0x6f'),JSON[_0x2010('0x3e')](_0x475d6a));return{'isValid':![],'message':_0x2010('0x70')};}return{'isValid':!![],'message':_0x2010('0x71')};};module[_0x2010('0x72')]=Fax; \ No newline at end of file +var _0x7916=['\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','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','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','variable','channelstatedesc','value','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','info','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','fax','catch','error'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x7916,0x128));var _0x6791=function(_0x4e448b,_0x10dee3){_0x4e448b=_0x4e448b-0x0;var _0x13638d=_0x7916[_0x4e448b];return _0x13638d;};'use strict';var util=require(_0x6791('0x0'));var _=require('lodash');var BPromise=require(_0x6791('0x1'));var uuid=require(_0x6791('0x2'));var moment=require('moment');var path=require(_0x6791('0x3'));var tiff2pdf=require(_0x6791('0x4'));var gs=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('fax');var ami=require(_0x6791('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x6791('0x8'));var ut=require(_0x6791('0x9'));var Action=require('./action');var faxAccount=require(_0x6791('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x6791('0xb'));function Fax(_0x50c563){this['channels']={};this[_0x6791('0xc')]=_0x50c563[_0x6791('0xc')];this['trunks']=_0x50c563[_0x6791('0xd')];this[_0x6791('0xe')]={};ami['on'](_0x6791('0xf'),this['syncNewchannel'][_0x6791('0x10')](this));ami['on'](_0x6791('0x11'),this[_0x6791('0x12')][_0x6791('0x10')](this));ami['on'](_0x6791('0x13'),this[_0x6791('0x14')][_0x6791('0x10')](this));ami['on'](_0x6791('0x15'),this[_0x6791('0x16')][_0x6791('0x10')](this));ami['on'](_0x6791('0x17'),this['syncFaxStatus']['bind'](this));ami['on'](_0x6791('0x18'),this['syncReceiveFax'][_0x6791('0x10')](this));ami['on']('hangup',this[_0x6791('0x19')][_0x6791('0x10')](this));ami['on']('originateresponse',this[_0x6791('0x1a')]['bind'](this));}Fax[_0x6791('0x1b')][_0x6791('0x1c')]=function(_0x596a06){if(_0x596a06[_0x6791('0x1d')]===_0x6791('0x1e')){for(var _0x5bec14 in this[_0x6791('0xc')]){if(this['faxAccounts'][_0x6791('0x1f')](_0x5bec14)){if(_0x596a06[_0x6791('0x20')]===this[_0x6791('0xc')][_0x5bec14][_0x6791('0x21')]){this[_0x6791('0x22')][_0x596a06[_0x6791('0x23')]]={};this[_0x6791('0x22')][_0x596a06['uniqueid']][_0x6791('0x24')]=_0x596a06[_0x6791('0x24')];this['channels'][_0x596a06[_0x6791('0x23')]]['id']=this[_0x6791('0xc')][_0x5bec14]['id'];this['channels'][_0x596a06[_0x6791('0x23')]][_0x6791('0x25')]=this[_0x6791('0xc')][_0x5bec14][_0x6791('0x25')];logger['info'](_0x596a06[_0x6791('0x23')],_0x6791('0x26'));}}}}if(this['actions'][_0x596a06['uniqueid']]){this['channels'][_0x596a06[_0x6791('0x23')]]={};this['channels'][_0x596a06[_0x6791('0x23')]]['channel']=_0x596a06['channel'];logger['info'](_0x596a06[_0x6791('0x23')],_0x6791('0x26'));}};Fax[_0x6791('0x1b')]['syncVarSet']=function(_0x3def2e){if(this[_0x6791('0x22')][_0x3def2e['uniqueid']]){for(var _0x342107 in _0x3def2e['variable']){if(_0x3def2e[_0x6791('0x27')]['hasOwnProperty'](_0x342107)){this['channels'][_0x3def2e[_0x6791('0x23')]][_0x342107]=_0x3def2e['value'];}}}};Fax[_0x6791('0x1b')][_0x6791('0x14')]=function(_0x483d6c){if(this[_0x6791('0x22')][_0x483d6c[_0x6791('0x23')]]){this[_0x6791('0x22')][_0x483d6c[_0x6791('0x23')]]['channelstate']=_0x483d6c['channelstate'];this[_0x6791('0x22')][_0x483d6c['uniqueid']][_0x6791('0x28')]=_0x483d6c[_0x6791('0x28')];}};Fax[_0x6791('0x1b')][_0x6791('0x16')]=function(_0x1d551b){if(this[_0x6791('0x22')][_0x1d551b[_0x6791('0x23')]]){for(var _0x14307e in _0x1d551b[_0x6791('0x27')]){if(_0x1d551b[_0x6791('0x27')]['hasOwnProperty'](_0x14307e)){this[_0x6791('0x22')][_0x1d551b[_0x6791('0x23')]][_0x14307e]=_0x1d551b[_0x6791('0x29')];}}}};Fax[_0x6791('0x1b')][_0x6791('0x2a')]=function(_0x36f673){if(this['channels'][_0x36f673['uniqueid']]){this['channels'][_0x36f673[_0x6791('0x23')]][_0x6791('0x2b')]=_0x36f673[_0x6791('0x2b')];this['channels'][_0x36f673['uniqueid']][_0x6791('0x2c')]=_0x36f673[_0x6791('0x2c')];this[_0x6791('0x22')][_0x36f673[_0x6791('0x23')]]['localstationid']=_0x36f673[_0x6791('0x21')];this[_0x6791('0x22')][_0x36f673[_0x6791('0x23')]]['filename']=_0x36f673[_0x6791('0x2d')];logger['info'](_0x36f673['uniqueid'],_0x6791('0x2e'));}};Fax[_0x6791('0x1b')]['syncReceiveFax']=function(_0x764f15){var _0x70b2b7=this;if(this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]]){var _0x3e5676=this['channels'][_0x764f15[_0x6791('0x23')]]['id'];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]]['remotestationid']=_0x764f15[_0x6791('0x2f')];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]]['pagestransferred']=_0x764f15[_0x6791('0x30')];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x21')]=_0x764f15['localstationid'];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x31')]=_0x764f15[_0x6791('0x31')];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x32')]=_0x764f15[_0x6791('0x32')];this[_0x6791('0x22')][_0x764f15['uniqueid']]['filename']=_0x764f15[_0x6791('0x2d')];this[_0x6791('0x22')][_0x764f15['uniqueid']][_0x6791('0x33')]=_0x764f15[_0x6791('0x33')];if(this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x30')]>0x0){tiff2pdf(_0x764f15[_0x6791('0x2d')],_0x6791('0x34'),function(_0x58f6da){logger[_0x6791('0x35')](_0x764f15['uniqueid'],_0x6791('0x36'),_0x58f6da[_0x6791('0x37')]);attachment[_0x6791('0x38')]({'name':path[_0x6791('0x39')](_0x764f15['filename'])[_0x6791('0x25')],'basename':path[_0x6791('0x39')](_0x764f15[_0x6791('0x2d')])[_0x6791('0x25')]+_0x6791('0x3a'),'type':_0x6791('0x3b')})[_0x6791('0x3c')](function(_0x453ccd){faxAccount['notify'](_0x3e5676,{'from':_0x764f15[_0x6791('0x33')],'mapKey':_0x6791('0x3d'),'body':path[_0x6791('0x39')](_0x764f15[_0x6791('0x2d')])['name']+_0x6791('0x3a'),'AttachmentId':_0x453ccd['id']})[_0x6791('0x3e')](function(_0x540ebe){logger[_0x6791('0x3f')](_0x764f15['uniqueid'],_0x6791('0x40'),JSON[_0x6791('0x41')](_0x540ebe));});})[_0x6791('0x3e')](function(_0x3ddccc){logger[_0x6791('0x3f')](_0x764f15[_0x6791('0x23')],_0x6791('0x42'),JSON[_0x6791('0x41')](_0x3ddccc));});});}logger[_0x6791('0x35')](_0x764f15['uniqueid'],_0x6791('0x42'));}};Fax['prototype'][_0x6791('0x1a')]=function(_0x2bb86a){if(this[_0x6791('0xe')][_0x2bb86a[_0x6791('0x23')]]){_[_0x6791('0x43')](this['channels'][_0x2bb86a[_0x6791('0x23')]],_[_0x6791('0x44')](_0x2bb86a,[_0x6791('0x45'),_0x6791('0x46')]));}};function updateStatus(_0x2b1656){if(_0x2b1656['AttachmentId']){faxMessage[_0x6791('0x47')](_0x2b1656[_0x6791('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x6791('0x3c')](function(_0x56f6c6){ut[_0x6791('0x49')](_0x6791('0x4a'),_0x56f6c6);})[_0x6791('0x3e')](function(_0x37e360){ut['logger'](_0x6791('0x4b'),_0x37e360);});}else{ut[_0x6791('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x6791('0x1b')][_0x6791('0x4c')]=function(_0x3a895b,_0x5df56e,_0x355e97){var _0x166b9a=this;var _0x54272c={};if(_0x5df56e){_0x54272c={'read':_0x5df56e};}else{_0x54272c={'failMessage':_0x355e97};}if(this[_0x6791('0xe')][_0x3a895b][_0x6791('0x48')]){faxMessage['update'](this[_0x6791('0xe')][_0x3a895b][_0x6791('0x48')],_0x54272c)[_0x6791('0x3c')](function(_0x285bfd){ut['logger'](_0x6791('0x4d'),_0x285bfd);})[_0x6791('0x3e')](function(_0x32f36b){ut['logger']('[Fax][Message][NoUpdate1]',_0x32f36b);})[_0x6791('0x4e')](function(){delete _0x166b9a[_0x6791('0x22')][_0x3a895b];delete _0x166b9a[_0x6791('0xe')][_0x3a895b];});}else{ut[_0x6791('0x49')](_0x6791('0x4f'));delete this['channels'][_0x3a895b];delete this['actions'][_0x3a895b];}};Fax[_0x6791('0x1b')]['syncHangup']=function(_0x51f071){var _0x8fc04b=this;if(this[_0x6791('0x22')][_0x51f071[_0x6791('0x23')]]){if(this[_0x6791('0xe')][_0x51f071[_0x6791('0x23')]]){this[_0x6791('0x22')][_0x51f071['uniqueid']]['id']=this['actions'][_0x51f071[_0x6791('0x23')]]['id'];this[_0x6791('0x22')][_0x51f071['uniqueid']][_0x6791('0x25')]=this['actions'][_0x51f071[_0x6791('0x23')]][_0x6791('0x25')];}logger['info'](_0x51f071[_0x6791('0x23')],this[_0x6791('0xe')][_0x51f071[_0x6791('0x23')]]?'\x20hangup\x20sendFile\x20':_0x6791('0x50'),JSON[_0x6791('0x41')](this[_0x6791('0x22')][_0x51f071[_0x6791('0x23')]]));if(this[_0x6791('0xe')][_0x51f071['uniqueid']]){if(this['channels'][_0x51f071[_0x6791('0x23')]][_0x6791('0x51')]>0x0&&this['channels'][_0x51f071[_0x6791('0x23')]][_0x6791('0x17')]===_0x6791('0x52')){this[_0x6791('0x4c')](_0x51f071[_0x6791('0x23')],!![]);}else{this[_0x6791('0x4c')](_0x51f071[_0x6791('0x23')],![],this[_0x6791('0x22')][_0x51f071['uniqueid']][_0x6791('0x53')]?_0x6791('0x54')+this[_0x6791('0x22')][_0x51f071[_0x6791('0x23')]]['faxstatusstring']:_0x6791('0x55'));}}}};Fax[_0x6791('0x1b')][_0x6791('0x56')]=function(_0x5ca809){var _0x205320=this;return new BPromise(function(_0x1fcbb6,_0x99d4ee){_0x205320[_0x6791('0x57')](_0x5ca809,_0x205320['faxAccounts'][_0x5ca809[_0x6791('0x58')]])[_0x6791('0x3c')](function(_0x5522db){ut[_0x6791('0x49')](_0x6791('0x59'),_0x5522db);_0x1fcbb6(ut[_0x6791('0x37')](_0x6791('0x5a')));})[_0x6791('0x3e')](function(_0x36d02a){ut['logger'](_0x6791('0x5b'),_0x36d02a);updateStatus(_0x5ca809);_0x99d4ee(ut[_0x6791('0x37')](_0x6791('0x5c')));});});};Fax['prototype'][_0x6791('0x5d')]=function(_0x530e1c){var _0x2648fa=this;return new BPromise(function(_0x11f3b2,_0xf0941a){var _0x2d5818=_0x2648fa[_0x6791('0x5e')](_0x2648fa['faxAccounts'][_0x530e1c[_0x6791('0x58')]][_0x6791('0x5f')],_0x530e1c);if(_0x2d5818[_0x6791('0x60')]){_0x11f3b2(ut[_0x6791('0x37')]('Trunk\x20Reachable'));}else{_0xf0941a(ut[_0x6791('0x37')](_0x2d5818[_0x6791('0x37')]));}});};function originate(_0x546995,_0x34691c,_0x1fa44a){return new BPromise(function(_0x567302,_0x201465){if(_0x1fa44a){var _0x23b9b4=util[_0x6791('0x61')](_0x6791('0x62'),path['parse'](_0x546995[_0x6791('0x3')])[_0x6791('0x25')],_0x546995['path']);gs[_0x6791('0x63')](_0x23b9b4)[_0x6791('0x3c')](function(){_0x546995[_0x6791('0x3')]=util[_0x6791('0x61')](_0x6791('0x64'),path['parse'](_0x546995[_0x6791('0x3')])[_0x6791('0x65')],path['parse'](_0x546995[_0x6791('0x3')])[_0x6791('0x25')]);_0x34691c[_0x6791('0x66')]=_0x546995['path'];ut[_0x6791('0x49')](_0x6791('0x67'),'');ami[_0x6791('0x68')](ut[_0x6791('0x69')](_0x546995,_0x34691c))[_0x6791('0x3c')](function(_0x1a1c3b){_0x567302(_0x1a1c3b);})[_0x6791('0x3e')](function(_0x30b3e6){_0x201465(_0x30b3e6);});})['catch'](function(_0x2ec629){_0x201465(_0x2ec629);});}else{ami[_0x6791('0x68')](ut['variablesAction'](_0x546995,_0x34691c))[_0x6791('0x3c')](function(_0x2b39d1){_0x567302(_0x2b39d1);})[_0x6791('0x3e')](function(_0x4bca9f){_0x201465(_0x4bca9f);});}});}Fax[_0x6791('0x1b')]['execOriginate']=function(_0xa1e941,_0x304e2a){var _0x126732=this;return new BPromise(function(_0x30d606,_0x3a964a){var _0x2d15b5=uuid['v4']();var _0x45712e=ut[_0x6791('0x6a')](_0xa1e941,_0x304e2a);_0x126732[_0x6791('0xe')][_0x2d15b5]=new Action(_0x2d15b5,_0x304e2a,_0xa1e941);var _0x1fa853=_0x126732[_0x6791('0xe')][_0x2d15b5];if(path[_0x6791('0x39')](_0xa1e941[_0x6791('0x3')])[_0x6791('0x6b')]===_0x6791('0x3a')){originate(_0x1fa853,_0x45712e,!![])[_0x6791('0x3c')](function(_0x3b53b8){_0x30d606(_0x3b53b8);})[_0x6791('0x3e')](function(_0xc6c959){_0x3a964a(_0xc6c959);});}else{originate(_0x1fa853,_0x45712e,![])['then'](function(_0x49e48e){_0x30d606(_0x49e48e);})['catch'](function(_0x15af12){_0x3a964a(_0x15af12);});}});};Fax[_0x6791('0x1b')][_0x6791('0x6c')]=function(_0x194a0b){return!_[_0x6791('0x6d')](_0x194a0b)&&!_[_0x6791('0x6d')](_0x194a0b[_0x6791('0x25')])&&!_[_0x6791('0x6d')](_0x194a0b[_0x6791('0x6e')])&&_0x194a0b[_0x6791('0x6e')]&&!_[_0x6791('0x6d')](this[_0x6791('0xd')][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b[_0x6791('0x25')])])&&!_[_0x6791('0x6d')](this[_0x6791('0xd')][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b[_0x6791('0x25')])][_0x6791('0x2c')])&&(this[_0x6791('0xd')][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b[_0x6791('0x25')])]['status']===_0x6791('0x70')||this['trunks'][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b['name'])][_0x6791('0x2c')]==='unmonitored');};Fax[_0x6791('0x1b')][_0x6791('0x5e')]=function(_0x5945cb,_0x33ed3b){if(!this[_0x6791('0x6c')](_0x5945cb)){ut[_0x6791('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x6791('0x6d')](_0x5945cb)?'':_0x5945cb[_0x6791('0x25')]+_0x6791('0x71'));return{'isValid':![],'message':_0x6791('0x72')};}if(_[_0x6791('0x6d')](_0x33ed3b[_0x6791('0x3d')])){ut['logger'](_0x6791('0x73'),JSON[_0x6791('0x41')](_0x33ed3b));return{'isValid':![],'message':_0x6791('0x74')};}if(_[_0x6791('0x6d')](_0x33ed3b[_0x6791('0x3')])){ut[_0x6791('0x49')](_0x6791('0x75'),JSON['stringify'](_0x33ed3b));return{'isValid':![],'message':_0x6791('0x76')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x6791('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 4f39193..649fe05 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 _0x17ac=['catch','[Notify]\x20','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','then'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x17ac,0x14c));var _0xc17a=function(_0x50222b,_0x535589){_0x50222b=_0x50222b-0x0;var _0x4d14c8=_0x17ac[_0x50222b];return _0x4d14c8;};'use strict';var util=require('util');var BPromise=require(_0xc17a('0x0'));var logger=require('../../../config/logger')(_0xc17a('0x1'));var _=require(_0xc17a('0x2'));var faxAccount=require(_0xc17a('0x3'));function loggerCatch(_0x41522d){return function(_0x1aad41){logger[_0xc17a('0x4')](_0x41522d,util[_0xc17a('0x5')](_0x1aad41,{'showHidden':![],'depth':null}));};}exports[_0xc17a('0x6')]=function(_0x335787,_0x5b157c){return BPromise['resolve']()[_0xc17a('0x7')](faxAccount[_0xc17a('0x6')](_0x335787,_0x5b157c))[_0xc17a('0x8')](loggerCatch(_0xc17a('0x9')));}; \ No newline at end of file +var _0x30c2=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch','[Notify]\x20','util'];(function(_0x236380,_0x25476c){var _0x2e4104=function(_0x2b6a71){while(--_0x2b6a71){_0x236380['push'](_0x236380['shift']());}};_0x2e4104(++_0x25476c);}(_0x30c2,0xfb));var _0x230c=function(_0x453176,_0x1b27c5){_0x453176=_0x453176-0x0;var _0x19ad3=_0x30c2[_0x453176];return _0x19ad3;};'use strict';var util=require(_0x230c('0x0'));var BPromise=require(_0x230c('0x1'));var logger=require(_0x230c('0x2'))(_0x230c('0x3'));var _=require(_0x230c('0x4'));var faxAccount=require(_0x230c('0x5'));function loggerCatch(_0x29b18){return function(_0x538695){logger[_0x230c('0x6')](_0x29b18,util[_0x230c('0x7')](_0x538695,{'showHidden':![],'depth':null}));};}exports[_0x230c('0x8')]=function(_0x73126e,_0x37398e){return BPromise['resolve']()[_0x230c('0x9')](faxAccount[_0x230c('0x8')](_0x73126e,_0x37398e))[_0x230c('0xa')](loggerCatch(_0x230c('0xb')));}; \ 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 d28b81e..05294d0 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 _0x064f=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x15c88d,_0x4078a9){var _0x4d6d62=function(_0x3c9fe4){while(--_0x3c9fe4){_0x15c88d['push'](_0x15c88d['shift']());}};_0x4d6d62(++_0x4078a9);}(_0x064f,0xe3));var _0xf064=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x064f[_0x346737];return _0x1ade2e;};'use strict';var util=require(_0xf064('0x0'));var logger=require(_0xf064('0x1'))(_0xf064('0x2'));var BPromise=require(_0xf064('0x3'));var exec=require(_0xf064('0x4'))[_0xf064('0x5')];exports[_0xf064('0x6')]=function(_0x212011){return new BPromise(function(_0x477258,_0x372274){exec(_0x212011,function(_0x3238be,_0x1354e2,_0xa07052){logger[_0xf064('0x7')](_0xf064('0x8'),_0x1354e2);if(_0x3238be){logger['info'](_0xf064('0x8'),_0xf064('0x9'),util[_0xf064('0xa')](_0x3238be,{'showHidden':![],'depth':null}),_0x1354e2,_0xa07052);_0x372274(_0x3238be);}_0x477258(_0x1354e2);});});}; \ No newline at end of file +var _0xf157=['\x20Error\x20:','util','../../../../config/logger','child_process','exec','execute','info','Exec\x20gs'];(function(_0x62d562,_0x488fc2){var _0xfb250d=function(_0x25f6f4){while(--_0x25f6f4){_0x62d562['push'](_0x62d562['shift']());}};_0xfb250d(++_0x488fc2);}(_0xf157,0x69));var _0x7f15=function(_0x24aca4,_0x2cecd7){_0x24aca4=_0x24aca4-0x0;var _0x3b1677=_0xf157[_0x24aca4];return _0x3b1677;};'use strict';var util=require(_0x7f15('0x0'));var logger=require(_0x7f15('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x7f15('0x2'))[_0x7f15('0x3')];exports[_0x7f15('0x4')]=function(_0x4f37f7){return new BPromise(function(_0x578a26,_0x5cb25e){exec(_0x4f37f7,function(_0x18f4fd,_0x88de7d,_0x1bacba){logger[_0x7f15('0x5')]('Exec\x20gs',_0x88de7d);if(_0x18f4fd){logger[_0x7f15('0x5')](_0x7f15('0x6'),_0x7f15('0x7'),util['inspect'](_0x18f4fd,{'showHidden':![],'depth':null}),_0x88de7d,_0x1bacba);_0x5cb25e(_0x18f4fd);}_0x578a26(_0x88de7d);});});}; \ 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 b39a47b..88813a0 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 _0x357f=['format','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate'];(function(_0x562eea,_0x1f9ea7){var _0x39caf9=function(_0x14f022){while(--_0x14f022){_0x562eea['push'](_0x562eea['shift']());}};_0x39caf9(++_0x1f9ea7);}(_0x357f,0x16a));var _0xf357=function(_0x1c4752,_0x2fe7f6){_0x1c4752=_0x1c4752-0x0;var _0x228d38=_0x357f[_0x1c4752];return _0x228d38;};'use strict';var util=require(_0xf357('0x0'));var _=require(_0xf357('0x1'));var moment=require(_0xf357('0x2'));var logger=require(_0xf357('0x3'))(_0xf357('0x4'));exports[_0xf357('0x5')]=function(_0x124c27){return{'message':_0x124c27};};exports[_0xf357('0x6')]=function(_0x32514b,_0x33e09e){logger[_0xf357('0x7')](_0x32514b,util[_0xf357('0x8')](_0x33e09e,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x18a35c,_0x5df905){var _0x1e7d1a={'XMF-ECM':_0x5df905[_0xf357('0x9')],'XMF-HEADERINFO':_0x5df905[_0xf357('0xa')],'XMF-MINRATE':_0x5df905[_0xf357('0xb')],'XMF-MAXRATE':_0x5df905[_0xf357('0xc')],'XMF-MODEM':util[_0xf357('0xd')](_0xf357('0xe'),_0x5df905[_0xf357('0xf')]),'XMF-GATEWAY':_0x5df905['gateway'],'XMF-FAXDETECT':_0x5df905['faxdetect'],'XMF-T38TIMEOUT':_0x5df905[_0xf357('0x10')],'XMF-LOCALSTATIONID':_0x5df905[_0xf357('0x11')],'XMF-PATH':_0x18a35c[_0xf357('0x12')]};return _0x1e7d1a;};exports[_0xf357('0x13')]=function(_0x525de0,_0x1bae39){return{'actionid':_0x525de0[_0xf357('0x14')],'action':_0xf357('0x15'),'channel':_0x525de0[_0xf357('0x16')],'Exten':'xcally-motion-fax','Context':_0xf357('0x17'),'Priority':'1','callerid':util['format'](_0xf357('0x18'),_0x525de0['headerinfo']?_0x525de0[_0xf357('0xa')]:'',_0x525de0[_0xf357('0x11')]),'variable':_0x1bae39,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x525de0[_0xf357('0x14')]};}; \ No newline at end of file +var _0x5996=['t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x2fa2e5,_0x48fa14){var _0x2e6480=function(_0x1c71bc){while(--_0x1c71bc){_0x2fa2e5['push'](_0x2fa2e5['shift']());}};_0x2e6480(++_0x48fa14);}(_0x5996,0x133));var _0x6599=function(_0x5320ed,_0x1b4223){_0x5320ed=_0x5320ed-0x0;var _0x51bb8a=_0x5996[_0x5320ed];return _0x51bb8a;};'use strict';var util=require(_0x6599('0x0'));var _=require(_0x6599('0x1'));var moment=require(_0x6599('0x2'));var logger=require(_0x6599('0x3'))('fax');exports[_0x6599('0x4')]=function(_0x4ae998){return{'message':_0x4ae998};};exports[_0x6599('0x5')]=function(_0x2ce1a9,_0x140065){logger[_0x6599('0x6')](_0x2ce1a9,util[_0x6599('0x7')](_0x140065,{'showHidden':![],'depth':null}));};exports[_0x6599('0x8')]=function(_0x2e0a98,_0x23476e){var _0x39913d={'XMF-ECM':_0x23476e['ecm'],'XMF-HEADERINFO':_0x23476e[_0x6599('0x9')],'XMF-MINRATE':_0x23476e[_0x6599('0xa')],'XMF-MAXRATE':_0x23476e[_0x6599('0xb')],'XMF-MODEM':util[_0x6599('0xc')](_0x6599('0xd'),_0x23476e[_0x6599('0xe')]),'XMF-GATEWAY':_0x23476e[_0x6599('0xf')],'XMF-FAXDETECT':_0x23476e[_0x6599('0x10')],'XMF-T38TIMEOUT':_0x23476e[_0x6599('0x11')],'XMF-LOCALSTATIONID':_0x23476e[_0x6599('0x12')],'XMF-PATH':_0x2e0a98[_0x6599('0x13')]};return _0x39913d;};exports[_0x6599('0x14')]=function(_0x154fe5,_0x4a7d9a){return{'actionid':_0x154fe5[_0x6599('0x15')],'action':_0x6599('0x16'),'channel':_0x154fe5[_0x6599('0x17')],'Exten':_0x6599('0x18'),'Context':_0x6599('0x19'),'Priority':'1','callerid':util['format'](_0x6599('0x1a'),_0x154fe5[_0x6599('0x9')]?_0x154fe5[_0x6599('0x9')]:'',_0x154fe5[_0x6599('0x12')]),'variable':_0x4a7d9a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x154fe5[_0x6599('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4d36c59..ae4b55f 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 _0xa091=['getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','error','[index.js][initParams]','listen','[index.js][main]','bluebird','util','moment','./server','./realtime','./acw','./trigger','./preview','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa091,0x11a));var _0x1a09=function(_0x2b676e,_0x4760e1){_0x2b676e=_0x2b676e-0x0;var _0x255e2d=_0xa091[_0x2b676e];return _0x255e2d;};'use strict';var BPromise=require(_0x1a09('0x0'));var util=require(_0x1a09('0x1'));var moment=require(_0x1a09('0x2'));var server=require(_0x1a09('0x3'));var Realtime=require(_0x1a09('0x4'));var Report=require('./report');var Acw=require(_0x1a09('0x5'));var Trigger=require(_0x1a09('0x6'));var Dialer=require('./dialer');var Preview=require(_0x1a09('0x7'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x1a09('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x1a09('0x9'));var trunk=require(_0x1a09('0xa'));var trigger=require(_0x1a09('0xb'));var template=require(_0x1a09('0xc'));var cmHopperHistory=require(_0x1a09('0xd'));var campaign=require(_0x1a09('0xe'));var voiceExtension=require(_0x1a09('0xf'));var faxAccount=require(_0x1a09('0x10'));var zendesk=require(_0x1a09('0x11'));var salesforce=require(_0x1a09('0x12'));var sugarcrm=require(_0x1a09('0x13'));var freshdesk=require(_0x1a09('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x1a09('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x1a09('0x16'));var servicenow=require(_0x1a09('0x17'));var dynamics365=require(_0x1a09('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('../../config/logger')(_0x1a09('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1a09('0x1a')](_0x1a09('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1a09('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1a09('0x1c')]()[_0x1a09('0x1d')](user[_0x1a09('0x1e')]())['then'](realtime[_0x1a09('0x1f')]())[_0x1a09('0x1d')](user[_0x1a09('0x20')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x21')]())[_0x1a09('0x1d')](trunk['getTrunks']())['then'](realtime[_0x1a09('0x22')]())[_0x1a09('0x1d')](voiceQueue[_0x1a09('0x23')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x24')]())[_0x1a09('0x1d')](trigger[_0x1a09('0x25')]())[_0x1a09('0x1d')](realtime['initTriggers']())['then'](template[_0x1a09('0x26')]())[_0x1a09('0x1d')](realtime['initTemplates']())[_0x1a09('0x1d')](zendesk['getZendeskAccounts']())[_0x1a09('0x1d')](realtime['initZendeskAccounts']())[_0x1a09('0x1d')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x1a09('0x27')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x1a09('0x1d')](realtime[_0x1a09('0x28')]())[_0x1a09('0x1d')](freshdesk[_0x1a09('0x29')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x2a')]())[_0x1a09('0x1d')](desk[_0x1a09('0x2b')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x2c')]())[_0x1a09('0x1d')](zoho[_0x1a09('0x2d')]())[_0x1a09('0x1d')](realtime['initZohoAccounts']())[_0x1a09('0x1d')](vtiger[_0x1a09('0x2e')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x2f')]())[_0x1a09('0x1d')](freshsales[_0x1a09('0x30')]())['then'](realtime['initFreshsalesAccounts']())[_0x1a09('0x1d')](servicenow[_0x1a09('0x31')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x32')]())[_0x1a09('0x1d')](dynamics365[_0x1a09('0x33')]())['then'](realtime['initDynamics365Accounts']())['then'](campaign[_0x1a09('0x34')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x35')]())[_0x1a09('0x1d')](voiceExtension['getVoiceExtensions']())[_0x1a09('0x1d')](realtime[_0x1a09('0x36')]())[_0x1a09('0x1d')](faxAccount[_0x1a09('0x37')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x38')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x1a09('0x1c')]()[_0x1a09('0x1d')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x1a09('0x39')]())[_0x1a09('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x1a09('0x1d')](realtime[_0x1a09('0x3a')]())[_0x1a09('0x1d')](cmHopperHistory[_0x1a09('0x3b')]())[_0x1a09('0x1d')](realtime[_0x1a09('0x3c')]())[_0x1a09('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x1a09('0x1d')](realtime['initVoiceCallReports']())[_0x1a09('0x3d')](function(_0x2743dc){logger[_0x1a09('0x3e')](_0x1a09('0x3f'),util['inspect'](_0x2743dc,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1a09('0x40')](realtime,preview,fax)[_0x1a09('0x1d')](function(_0xb04cf3){return initRealtime();})[_0x1a09('0x1d')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x1a09('0x3d')](function(_0x4c6bbd){logger[_0x1a09('0x3e')](_0x1a09('0x41'),util['inspect'](_0x4c6bbd,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xdf39=['initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceCallReports','error','inspect','listen','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','initAgents','then','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts'];(function(_0x1322a1,_0x17f5f6){var _0x389fd4=function(_0xfdf171){while(--_0xfdf171){_0x1322a1['push'](_0x1322a1['shift']());}};_0x389fd4(++_0x17f5f6);}(_0xdf39,0xd0));var _0x9df3=function(_0x22376f,_0x1d3e6c){_0x22376f=_0x22376f-0x0;var _0x45c934=_0xdf39[_0x22376f];return _0x45c934;};'use strict';var BPromise=require(_0x9df3('0x0'));var util=require(_0x9df3('0x1'));var moment=require(_0x9df3('0x2'));var server=require(_0x9df3('0x3'));var Realtime=require(_0x9df3('0x4'));var Report=require(_0x9df3('0x5'));var Acw=require(_0x9df3('0x6'));var Trigger=require(_0x9df3('0x7'));var Dialer=require(_0x9df3('0x8'));var Preview=require(_0x9df3('0x9'));var Fax=require(_0x9df3('0xa'));var user=require('./rpc/user');var voiceQueue=require(_0x9df3('0xb'));var voiceQueueReport=require(_0x9df3('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x9df3('0xd'));var cmHopperHistory=require(_0x9df3('0xe'));var campaign=require(_0x9df3('0xf'));var voiceExtension=require(_0x9df3('0x10'));var faxAccount=require(_0x9df3('0x11'));var zendesk=require(_0x9df3('0x12'));var salesforce=require(_0x9df3('0x13'));var sugarcrm=require(_0x9df3('0x14'));var freshdesk=require(_0x9df3('0x15'));var desk=require(_0x9df3('0x16'));var zoho=require(_0x9df3('0x17'));var vtiger=require(_0x9df3('0x18'));var freshsales=require(_0x9df3('0x19'));var servicenow=require(_0x9df3('0x1a'));var dynamics365=require(_0x9df3('0x1b'));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')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x9df3('0x1c')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9df3('0x1c')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x9df3('0x1d')]()['then'](user['getAgents']())['then'](realtime[_0x9df3('0x1e')]())[_0x9df3('0x1f')](user['getTelephones']())[_0x9df3('0x1f')](realtime[_0x9df3('0x20')]())[_0x9df3('0x1f')](trunk[_0x9df3('0x21')]())[_0x9df3('0x1f')](realtime['initTrunks']())['then'](voiceQueue[_0x9df3('0x22')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x23')]())[_0x9df3('0x1f')](trigger[_0x9df3('0x24')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x25')]())['then'](template['getTemplates']())[_0x9df3('0x1f')](realtime[_0x9df3('0x26')]())['then'](zendesk[_0x9df3('0x27')]())['then'](realtime[_0x9df3('0x28')]())[_0x9df3('0x1f')](salesforce[_0x9df3('0x29')]())[_0x9df3('0x1f')](realtime['initSalesforceAccounts']())[_0x9df3('0x1f')](sugarcrm[_0x9df3('0x2a')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x2b')]())['then'](freshdesk[_0x9df3('0x2c')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x2d')]())['then'](desk[_0x9df3('0x2e')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x2f')]())['then'](zoho['getZohoAccounts']())[_0x9df3('0x1f')](realtime[_0x9df3('0x30')]())[_0x9df3('0x1f')](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())['then'](freshsales[_0x9df3('0x31')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x32')]())[_0x9df3('0x1f')](servicenow['getServicenowAccounts']())[_0x9df3('0x1f')](realtime['initServicenowAccounts']())[_0x9df3('0x1f')](dynamics365[_0x9df3('0x33')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x34')]())[_0x9df3('0x1f')](campaign[_0x9df3('0x35')]())[_0x9df3('0x1f')](realtime[_0x9df3('0x36')]())[_0x9df3('0x1f')](voiceExtension[_0x9df3('0x37')]())['then'](realtime[_0x9df3('0x38')]())[_0x9df3('0x1f')](faxAccount[_0x9df3('0x39')]())['then'](realtime[_0x9df3('0x3a')]())[_0x9df3('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0x9df3('0x1d')]()[_0x9df3('0x1f')](voiceQueueReport[_0x9df3('0x3b')]())[_0x9df3('0x1f')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x9df3('0x1f')](realtime['initVoiceQueueHopperHistory']())[_0x9df3('0x1f')](cmHopperHistory['getCampaignHopperHistory']())[_0x9df3('0x1f')](realtime['initCampaignHopperHistory']())[_0x9df3('0x1f')](voiceCallReport[_0x9df3('0x3c')]())[_0x9df3('0x1f')](realtime['initVoiceCallReports']())['catch'](function(_0x383c12){logger[_0x9df3('0x3d')]('[index.js][initParams]',util[_0x9df3('0x3e')](_0x383c12,{'showHidden':![],'depth':null}));});}function main(){return server[_0x9df3('0x3f')](realtime,preview,fax)[_0x9df3('0x1f')](function(_0x47dcda){return initRealtime();})[_0x9df3('0x1f')](function(){return initParams();})[_0x9df3('0x1f')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0xd478e4){logger[_0x9df3('0x3d')](_0x9df3('0x40'),util[_0x9df3('0x3e')](_0xd478e4,{'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 2a65cfe..99b5b00 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x230973,_0x2c5bab){var _0x8f1fb3=function(_0x1eeb03){while(--_0x1eeb03){_0x230973['push'](_0x230973['shift']());}};_0x8f1fb3(++_0x2c5bab);}(_0x70e0,0x17b));var _0x070e=function(_0x39af46,_0x9f34e9){_0x39af46=_0x39af46-0x0;var _0x1514bd=_0x70e0[_0x39af46];return _0x1514bd;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +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(_0x120625,_0x1f7c9c){var _0x335138=function(_0x30e8a0){while(--_0x30e8a0){_0x120625['push'](_0x120625['shift']());}};_0x335138(++_0x1f7c9c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ba740,_0x62a305){_0x2ba740=_0x2ba740-0x0;var _0x358bda=_0xcb91[_0x2ba740];return _0x358bda;};'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 9053bc3..794e2b0 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 _0x707d=['ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp'];(function(_0xf64500,_0x410815){var _0x58a6e0=function(_0x1fee17){while(--_0x1fee17){_0xf64500['push'](_0xf64500['shift']());}};_0x58a6e0(++_0x410815);}(_0x707d,0x161));var _0xd707=function(_0x3bef2b,_0xc2cb31){_0x3bef2b=_0x3bef2b-0x0;var _0x4a0b3c=_0x707d[_0x3bef2b];return _0x4a0b3c;};'use strict';function Campaign(_0x1b1297){this['id']=_0x1b1297['id']||0x0;this[_0xd707('0x0')]=_0x1b1297[_0xd707('0x0')]||'';this[_0xd707('0x1')]=_0x1b1297[_0xd707('0x1')]||_0xd707('0x2');this['originated']=0x0;this[_0xd707('0x3')]=0x0;this[_0xd707('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xd707('0x5')]='';this[_0xd707('0x6')]=!![];this[_0xd707('0x7')]=_0x1b1297[_0xd707('0x7')];this[_0xd707('0x8')]=_0x1b1297['limitCalls'];this[_0xd707('0x9')]=_0x1b1297['dialTimezone']||null;this[_0xd707('0xa')]=_0x1b1297[_0xd707('0xa')]?_0x1b1297[_0xd707('0xa')]:null;this['dialOriginateCallerIdName']=_0x1b1297[_0xd707('0xb')];this[_0xd707('0xc')]=_0x1b1297[_0xd707('0xc')];this[_0xd707('0xd')]=_0x1b1297[_0xd707('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x1b1297['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x1b1297[_0xd707('0xe')];this[_0xd707('0xf')]=_0x1b1297[_0xd707('0xf')];this['dialBusyRetryFrequency']=_0x1b1297[_0xd707('0x10')];this[_0xd707('0x11')]=_0x1b1297[_0xd707('0x11')];this[_0xd707('0x12')]=_0x1b1297[_0xd707('0x12')];this[_0xd707('0x13')]=_0x1b1297[_0xd707('0x13')];this[_0xd707('0x14')]=_0x1b1297[_0xd707('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1b1297[_0xd707('0x15')]||0x96;this[_0xd707('0x16')]=_0x1b1297['dialDropMaxRetry']||0x3;this[_0xd707('0x17')]=_0x1b1297[_0xd707('0x17')]||0x96;this[_0xd707('0x18')]=_0x1b1297['dialAbandonedMaxRetry']||0x3;this[_0xd707('0x19')]=_0x1b1297['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x1b1297[_0xd707('0x1a')]||0x3;this[_0xd707('0x1b')]=_0x1b1297[_0xd707('0x1b')]||0x96;this[_0xd707('0x1c')]=_0x1b1297[_0xd707('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1b1297[_0xd707('0x1d')]||0x96;this[_0xd707('0x1e')]=_0x1b1297[_0xd707('0x1e')]||_0xd707('0x1f');this['dialPrefix']=_0x1b1297[_0xd707('0x20')]||undefined;this[_0xd707('0x21')]=_0x1b1297[_0xd707('0x21')]||undefined;this[_0xd707('0x22')]=_0x1b1297[_0xd707('0x22')]||undefined;this[_0xd707('0x23')]=_0x1b1297[_0xd707('0x23')]?_0x1b1297[_0xd707('0x23')]:undefined;this[_0xd707('0x24')]=_0x1b1297[_0xd707('0x24')]?_0x1b1297[_0xd707('0x24')]:undefined;this[_0xd707('0x25')]=_0x1b1297[_0xd707('0x25')]?_0x1b1297[_0xd707('0x25')]:undefined;this[_0xd707('0x26')]=_0x1b1297[_0xd707('0x26')]?_0x1b1297[_0xd707('0x26')]:undefined;this[_0xd707('0x27')]=_0x1b1297[_0xd707('0x26')]?_0x1b1297[_0xd707('0x26')][_0xd707('0x0')]:undefined;this[_0xd707('0x28')]=_0x1b1297[_0xd707('0x28')]||![];this[_0xd707('0x29')]=_0x1b1297[_0xd707('0x29')];this[_0xd707('0x2a')]=_0x1b1297['dialAMDGreeting'];this[_0xd707('0x2b')]=_0x1b1297[_0xd707('0x2b')];this['dialAMDTotalAnalysisTime']=_0x1b1297[_0xd707('0x2c')];this[_0xd707('0x2d')]=_0x1b1297[_0xd707('0x2d')];this[_0xd707('0x2e')]=_0x1b1297['dialAMDBetweenWordsSilence'];this[_0xd707('0x2f')]=_0x1b1297[_0xd707('0x2f')];this[_0xd707('0x30')]=_0x1b1297[_0xd707('0x30')];this[_0xd707('0x31')]=_0x1b1297[_0xd707('0x31')];}module[_0xd707('0x32')]=Campaign; \ No newline at end of file +var _0xd582=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x267d24,_0x3875e1){var _0x3d0742=function(_0x32ee98){while(--_0x32ee98){_0x267d24['push'](_0x267d24['shift']());}};_0x3d0742(++_0x3875e1);}(_0xd582,0x78));var _0x2d58=function(_0x16842f,_0x16f2d1){_0x16842f=_0x16842f-0x0;var _0x40e6d9=_0xd582[_0x16842f];return _0x40e6d9;};'use strict';function Campaign(_0x2a94e2){this['id']=_0x2a94e2['id']||0x0;this[_0x2d58('0x0')]=_0x2a94e2[_0x2d58('0x0')]||'';this['type']=_0x2a94e2[_0x2d58('0x1')]||_0x2d58('0x2');this[_0x2d58('0x3')]=0x0;this[_0x2d58('0x4')]=0x0;this[_0x2d58('0x5')]=0x0;this[_0x2d58('0x6')]=0x0;this[_0x2d58('0x7')]='';this[_0x2d58('0x8')]=!![];this[_0x2d58('0x9')]=_0x2a94e2[_0x2d58('0x9')];this[_0x2d58('0xa')]=_0x2a94e2[_0x2d58('0xa')];this[_0x2d58('0xb')]=_0x2a94e2[_0x2d58('0xb')]||null;this['dialGlobalInterval']=_0x2a94e2['dialGlobalInterval']?_0x2a94e2['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x2a94e2['dialOriginateCallerIdName'];this[_0x2d58('0xc')]=_0x2a94e2['dialOriginateCallerIdNumber'];this[_0x2d58('0xd')]=_0x2a94e2[_0x2d58('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x2a94e2[_0x2d58('0xe')];this['dialCongestionRetryFrequency']=_0x2a94e2[_0x2d58('0xf')];this[_0x2d58('0x10')]=_0x2a94e2[_0x2d58('0x10')];this[_0x2d58('0x11')]=_0x2a94e2[_0x2d58('0x11')];this['dialNoAnswerMaxRetry']=_0x2a94e2['dialNoAnswerMaxRetry'];this[_0x2d58('0x12')]=_0x2a94e2[_0x2d58('0x12')];this[_0x2d58('0x13')]=_0x2a94e2[_0x2d58('0x13')];this[_0x2d58('0x14')]=_0x2a94e2[_0x2d58('0x14')]||0x3;this[_0x2d58('0x15')]=_0x2a94e2[_0x2d58('0x15')]||0x96;this['dialDropMaxRetry']=_0x2a94e2[_0x2d58('0x16')]||0x3;this[_0x2d58('0x17')]=_0x2a94e2[_0x2d58('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x2a94e2[_0x2d58('0x18')]||0x3;this[_0x2d58('0x19')]=_0x2a94e2[_0x2d58('0x19')]||0x96;this[_0x2d58('0x1a')]=_0x2a94e2[_0x2d58('0x1a')]||0x3;this[_0x2d58('0x1b')]=_0x2a94e2[_0x2d58('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x2a94e2[_0x2d58('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2a94e2[_0x2d58('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x2a94e2[_0x2d58('0x1e')]||_0x2d58('0x1f');this[_0x2d58('0x20')]=_0x2a94e2[_0x2d58('0x20')]||undefined;this[_0x2d58('0x21')]=_0x2a94e2[_0x2d58('0x21')]||undefined;this['dialCutDigit']=_0x2a94e2[_0x2d58('0x22')]||undefined;this[_0x2d58('0x23')]=_0x2a94e2['TrunkBackup']?_0x2a94e2[_0x2d58('0x23')]:undefined;this['Trunk']=_0x2a94e2[_0x2d58('0x24')]?_0x2a94e2['Trunk']:undefined;this[_0x2d58('0x25')]=_0x2a94e2[_0x2d58('0x25')]?_0x2a94e2[_0x2d58('0x25')]:undefined;this[_0x2d58('0x26')]=_0x2a94e2[_0x2d58('0x26')]?_0x2a94e2[_0x2d58('0x26')]:undefined;this['dialQueueProject']=_0x2a94e2[_0x2d58('0x26')]?_0x2a94e2[_0x2d58('0x26')]['name']:undefined;this[_0x2d58('0x27')]=_0x2a94e2[_0x2d58('0x27')]||![];this[_0x2d58('0x28')]=_0x2a94e2[_0x2d58('0x28')];this[_0x2d58('0x29')]=_0x2a94e2['dialAMDGreeting'];this[_0x2d58('0x2a')]=_0x2a94e2[_0x2d58('0x2a')];this[_0x2d58('0x2b')]=_0x2a94e2[_0x2d58('0x2b')];this['dialAMDMinWordLength']=_0x2a94e2[_0x2d58('0x2c')];this[_0x2d58('0x2d')]=_0x2a94e2[_0x2d58('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x2a94e2[_0x2d58('0x2e')];this[_0x2d58('0x2f')]=_0x2a94e2['dialAMDSilenceThreshold'];this[_0x2d58('0x30')]=_0x2a94e2['dialAMDMaximumWordLength'];}module[_0x2d58('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 125856f..8d8bbfb 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 _0x32f4=['monitors','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','unmanaged','abandoned','lastdata','billableseconds','holdtime','type','tag','disposition','monitorFilename'];(function(_0x3ccda6,_0x44c581){var _0x1097e7=function(_0x3fa98b){while(--_0x3fa98b){_0x3ccda6['push'](_0x3ccda6['shift']());}};_0x1097e7(++_0x44c581);}(_0x32f4,0x154));var _0x432f=function(_0x19d265,_0x5816bc){_0x19d265=_0x19d265-0x0;var _0x32888e=_0x32f4[_0x19d265];return _0x32888e;};'use strict';function Channel(){this[_0x432f('0x0')]=null;this[_0x432f('0x1')]='';this[_0x432f('0x2')]='';this[_0x432f('0x3')]=0x0;this['calleridname']='';this[_0x432f('0x4')]=undefined;this[_0x432f('0x5')]=undefined;this['accountcode']=0x0;this[_0x432f('0x6')]='';this[_0x432f('0x7')]=0x0;this[_0x432f('0x8')]=0x0;this[_0x432f('0x9')]=0x0;this[_0x432f('0xa')]=![];this['answertime']=null;this['endtime']=null;this[_0x432f('0xb')]=![];this[_0x432f('0xc')]=![];this['lastapplication']='';this[_0x432f('0xd')]='';this['duration']=0x0;this[_0x432f('0xe')]=0x0;this[_0x432f('0xf')]=0x0;this[_0x432f('0x10')]=null;this[_0x432f('0x11')]=null;this[_0x432f('0x12')]=null;this['monitor']=![];this[_0x432f('0x13')]=null;this['queue']=null;this[_0x432f('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x432f('0x15')]=undefined;this[_0x432f('0x16')]=undefined;this['mohtime']=0x0;}module[_0x432f('0x17')]=Channel; \ No newline at end of file +var _0x4f9b=['exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime'];(function(_0xa4cca9,_0x33cde6){var _0x4fe5be=function(_0x3e0630){while(--_0x3e0630){_0xa4cca9['push'](_0xa4cca9['shift']());}};_0x4fe5be(++_0x33cde6);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x13c3c8,_0x255be3){_0x13c3c8=_0x13c3c8-0x0;var _0x5ee04a=_0x4f9b[_0x13c3c8];return _0x5ee04a;};'use strict';function Channel(){this[_0xb4f9('0x0')]=null;this[_0xb4f9('0x1')]='';this[_0xb4f9('0x2')]='';this[_0xb4f9('0x3')]=0x0;this[_0xb4f9('0x4')]='';this[_0xb4f9('0x5')]=undefined;this[_0xb4f9('0x6')]=undefined;this[_0xb4f9('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xb4f9('0x8')]=0x0;this[_0xb4f9('0x9')]=![];this[_0xb4f9('0xa')]=null;this[_0xb4f9('0xb')]=null;this[_0xb4f9('0xc')]=![];this[_0xb4f9('0xd')]=![];this['lastapplication']='';this[_0xb4f9('0xe')]='';this[_0xb4f9('0xf')]=0x0;this[_0xb4f9('0x10')]=0x0;this['holdtime']=0x0;this[_0xb4f9('0x11')]=null;this['tag']=null;this[_0xb4f9('0x12')]=null;this[_0xb4f9('0x13')]=![];this[_0xb4f9('0x14')]=null;this[_0xb4f9('0x15')]=null;this[_0xb4f9('0x16')]=[];this[_0xb4f9('0x17')]=undefined;this[_0xb4f9('0x18')]=undefined;this['transferType']=undefined;this[_0xb4f9('0x19')]=0x0;}module[_0xb4f9('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 6c9631b..5347fcb 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 _0xdf50=['consumerKey','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x5f02ab,_0x3b78ad){var _0x2b13d5=function(_0x5e9589){while(--_0x5e9589){_0x5f02ab['push'](_0x5f02ab['shift']());}};_0x2b13d5(++_0x3b78ad);}(_0xdf50,0x80));var _0x0df5=function(_0xe406e8,_0x2dbfd8){_0xe406e8=_0xe406e8-0x0;var _0x3f8fbe=_0xdf50[_0xe406e8];return _0x3f8fbe;};'use strict';function DeskAccount(_0x993fb1){this['id']=_0x993fb1['id']||0x0;this[_0x0df5('0x0')]=_0x993fb1[_0x0df5('0x0')]||'';this['username']=_0x993fb1[_0x0df5('0x1')]||'';this['remoteUri']=_0x993fb1[_0x0df5('0x2')]||'';this[_0x0df5('0x3')]=_0x993fb1[_0x0df5('0x3')]||'';this['password']=_0x993fb1['password']||'';this[_0x0df5('0x4')]=_0x993fb1[_0x0df5('0x4')]||'';this['consumerSecret']=_0x993fb1['consumerSecret']||'';this['token']=_0x993fb1[_0x0df5('0x5')]||'';this[_0x0df5('0x6')]=_0x993fb1['tokenSecret']||'';this[_0x0df5('0x7')]=_0x993fb1[_0x0df5('0x7')]||'';this[_0x0df5('0x8')]=_0x993fb1[_0x0df5('0x8')]||'';this[_0x0df5('0x9')]=_0x993fb1['Configurations']||{};}module[_0x0df5('0xa')]=DeskAccount; \ No newline at end of file +var _0xda00=['tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x89c575,_0x129979){var _0x330fb3=function(_0x1a9137){while(--_0x1a9137){_0x89c575['push'](_0x89c575['shift']());}};_0x330fb3(++_0x129979);}(_0xda00,0xad));var _0x0da0=function(_0x3e18ed,_0x47a0ec){_0x3e18ed=_0x3e18ed-0x0;var _0x5ed495=_0xda00[_0x3e18ed];return _0x5ed495;};'use strict';function DeskAccount(_0x2469d0){this['id']=_0x2469d0['id']||0x0;this['name']=_0x2469d0['name']||'';this[_0x0da0('0x0')]=_0x2469d0[_0x0da0('0x0')]||'';this[_0x0da0('0x1')]=_0x2469d0[_0x0da0('0x1')]||'';this[_0x0da0('0x2')]=_0x2469d0[_0x0da0('0x2')]||'';this[_0x0da0('0x3')]=_0x2469d0[_0x0da0('0x3')]||'';this[_0x0da0('0x4')]=_0x2469d0[_0x0da0('0x4')]||'';this[_0x0da0('0x5')]=_0x2469d0[_0x0da0('0x5')]||'';this[_0x0da0('0x6')]=_0x2469d0['token']||'';this[_0x0da0('0x7')]=_0x2469d0[_0x0da0('0x7')]||'';this[_0x0da0('0x8')]=_0x2469d0[_0x0da0('0x8')]||'';this[_0x0da0('0x9')]=_0x2469d0[_0x0da0('0x9')]||'';this[_0x0da0('0xa')]=_0x2469d0['Configurations']||{};}module[_0x0da0('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 2472297..548b889 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 _0x6075=['Configurations','CloudProvider','exports','name','username','password','tenantId','clientId','clientSecret','modernAuthentication'];(function(_0xe8b9c7,_0x534838){var _0x4b606f=function(_0x355178){while(--_0x355178){_0xe8b9c7['push'](_0xe8b9c7['shift']());}};_0x4b606f(++_0x534838);}(_0x6075,0x193));var _0x5607=function(_0x44e65f,_0x27e256){_0x44e65f=_0x44e65f-0x0;var _0x4a79a0=_0x6075[_0x44e65f];return _0x4a79a0;};'use strict';function Dynamics365Account(_0x766965){this['id']=_0x766965['id']||0x0;this[_0x5607('0x0')]=_0x766965[_0x5607('0x0')]||'';this['username']=_0x766965[_0x5607('0x1')]||'';this[_0x5607('0x2')]=_0x766965['password']||'';this['remoteUri']=_0x766965['remoteUri']||'';this[_0x5607('0x3')]=_0x766965[_0x5607('0x3')]||'';this[_0x5607('0x4')]=_0x766965[_0x5607('0x4')]||'';this[_0x5607('0x5')]=_0x766965[_0x5607('0x5')]||{};this['serverUrl']=_0x766965['serverUrl']||'';this[_0x5607('0x6')]=_0x766965['modernAuthentication']||![];this['Configurations']=_0x766965[_0x5607('0x7')]||{};this['CloudProvider']=_0x766965[_0x5607('0x8')]||{};}module[_0x5607('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x22ce=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x80fac1,_0x3a0990){var _0x432b8a=function(_0x266628){while(--_0x266628){_0x80fac1['push'](_0x80fac1['shift']());}};_0x432b8a(++_0x3a0990);}(_0x22ce,0xf1));var _0xe22c=function(_0x45c52e,_0xa338b3){_0x45c52e=_0x45c52e-0x0;var _0x49688e=_0x22ce[_0x45c52e];return _0x49688e;};'use strict';function Dynamics365Account(_0x195299){this['id']=_0x195299['id']||0x0;this[_0xe22c('0x0')]=_0x195299['name']||'';this[_0xe22c('0x1')]=_0x195299[_0xe22c('0x1')]||'';this['password']=_0x195299[_0xe22c('0x2')]||'';this[_0xe22c('0x3')]=_0x195299[_0xe22c('0x3')]||'';this['tenantId']=_0x195299[_0xe22c('0x4')]||'';this[_0xe22c('0x5')]=_0x195299[_0xe22c('0x5')]||'';this[_0xe22c('0x6')]=_0x195299[_0xe22c('0x6')]||{};this[_0xe22c('0x7')]=_0x195299[_0xe22c('0x7')]||'';this[_0xe22c('0x8')]=_0x195299[_0xe22c('0x8')]||![];this[_0xe22c('0x9')]=_0x195299[_0xe22c('0x9')]||{};this[_0xe22c('0xa')]=_0x195299['CloudProvider']||{};}module[_0xe22c('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 97369a7..c0fe098 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 _0xce87=['SIP','Trunk','ListId','key','exports','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xce87,0x65));var _0x7ce8=function(_0x2a4b92,_0x294ffb){_0x2a4b92=_0x2a4b92-0x0;var _0x1274b5=_0xce87[_0x2a4b92];return _0x1274b5;};'use strict';function FaxAccount(_0x2ebf81){this['id']=_0x2ebf81['id']||0x0;this['name']=_0x2ebf81['name']||'';this['description']=_0x2ebf81['description'];this[_0x7ce8('0x0')]=_0x2ebf81['ecm'];this['headerinfo']=_0x2ebf81[_0x7ce8('0x1')];this[_0x7ce8('0x2')]=_0x2ebf81[_0x7ce8('0x2')];this[_0x7ce8('0x3')]=_0x2ebf81[_0x7ce8('0x3')]||0x960;this[_0x7ce8('0x4')]=_0x2ebf81['maxrate']||0x3840;this[_0x7ce8('0x5')]=_0x2ebf81[_0x7ce8('0x5')]||_0x7ce8('0x6');this[_0x7ce8('0x7')]=_0x2ebf81[_0x7ce8('0x7')]||'no';this[_0x7ce8('0x8')]=_0x2ebf81[_0x7ce8('0x8')]||'no';this[_0x7ce8('0x9')]=_0x2ebf81[_0x7ce8('0x9')]||0x1388;this[_0x7ce8('0xa')]=_0x2ebf81['tech']||_0x7ce8('0xb');this[_0x7ce8('0xc')]=_0x2ebf81[_0x7ce8('0xc')]?_0x2ebf81[_0x7ce8('0xc')]:undefined;this[_0x7ce8('0xd')]=_0x2ebf81[_0x7ce8('0xd')];this['key']=_0x2ebf81[_0x7ce8('0xe')];}module[_0x7ce8('0xf')]=FaxAccount; \ No newline at end of file +var _0xa222=['name','description','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports'];(function(_0x205e56,_0x366e77){var _0x489d5d=function(_0x130a84){while(--_0x130a84){_0x205e56['push'](_0x205e56['shift']());}};_0x489d5d(++_0x366e77);}(_0xa222,0x1d1));var _0x2a22=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0xa222[_0x24f326];return _0x488e2d;};'use strict';function FaxAccount(_0x374a54){this['id']=_0x374a54['id']||0x0;this[_0x2a22('0x0')]=_0x374a54[_0x2a22('0x0')]||'';this[_0x2a22('0x1')]=_0x374a54['description'];this['ecm']=_0x374a54['ecm'];this[_0x2a22('0x2')]=_0x374a54[_0x2a22('0x2')];this['localstationid']=_0x374a54[_0x2a22('0x3')];this[_0x2a22('0x4')]=_0x374a54['minrate']||0x960;this[_0x2a22('0x5')]=_0x374a54['maxrate']||0x3840;this[_0x2a22('0x6')]=_0x374a54['modem']||'v17,v27,v29';this['gateway']=_0x374a54[_0x2a22('0x7')]||'no';this[_0x2a22('0x8')]=_0x374a54[_0x2a22('0x8')]||'no';this['t38timeout']=_0x374a54[_0x2a22('0x9')]||0x1388;this[_0x2a22('0xa')]=_0x374a54[_0x2a22('0xa')]||'SIP';this[_0x2a22('0xb')]=_0x374a54['Trunk']?_0x374a54[_0x2a22('0xb')]:undefined;this['ListId']=_0x374a54[_0x2a22('0xc')];this[_0x2a22('0xd')]=_0x374a54[_0x2a22('0xd')];}module[_0x2a22('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 49c5173..d5e74d4 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 _0x1ad4=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x77b868,_0x45ea4b){var _0x1f54ea=function(_0x3cb8a6){while(--_0x3cb8a6){_0x77b868['push'](_0x77b868['shift']());}};_0x1f54ea(++_0x45ea4b);}(_0x1ad4,0x102));var _0x41ad=function(_0x737a04,_0x1779c1){_0x737a04=_0x737a04-0x0;var _0x160830=_0x1ad4[_0x737a04];return _0x160830;};'use strict';function FreshdeskAccount(_0xb8f5b9){this['id']=_0xb8f5b9['id']||0x0;this[_0x41ad('0x0')]=_0xb8f5b9[_0x41ad('0x0')]||'';this[_0x41ad('0x1')]=_0xb8f5b9['username']||'';this[_0x41ad('0x2')]=_0xb8f5b9[_0x41ad('0x3')]||'';this[_0x41ad('0x4')]=_0xb8f5b9[_0x41ad('0x4')]||'';this['serverUrl']=_0xb8f5b9[_0x41ad('0x5')]||'';this[_0x41ad('0x6')]=_0xb8f5b9[_0x41ad('0x6')]||{};}module[_0x41ad('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xa685=['token','remoteUri','Configurations','exports','name','username','apiKey'];(function(_0x2a5a9e,_0x57b8bd){var _0xad442f=function(_0x122c58){while(--_0x122c58){_0x2a5a9e['push'](_0x2a5a9e['shift']());}};_0xad442f(++_0x57b8bd);}(_0xa685,0xe4));var _0x5a68=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xa685[_0x4fa0ea];return _0x51d027;};'use strict';function FreshdeskAccount(_0x1872e3){this['id']=_0x1872e3['id']||0x0;this[_0x5a68('0x0')]=_0x1872e3['name']||'';this[_0x5a68('0x1')]=_0x1872e3['username']||'';this[_0x5a68('0x2')]=_0x1872e3[_0x5a68('0x3')]||'';this[_0x5a68('0x4')]=_0x1872e3[_0x5a68('0x4')]||'';this['serverUrl']=_0x1872e3['serverUrl']||'';this['Configurations']=_0x1872e3[_0x5a68('0x5')]||{};}module[_0x5a68('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index bf0063e..6a2cfa1 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 _0xa87e=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xa87e,0x1c2));var _0xea87=function(_0x383521,_0x5e87de){_0x383521=_0x383521-0x0;var _0x3310de=_0xa87e[_0x383521];return _0x3310de;};'use strict';function FreshsalesAccount(_0x236765){this['id']=_0x236765['id']||0x0;this[_0xea87('0x0')]=_0x236765[_0xea87('0x0')]||'';this[_0xea87('0x1')]=_0x236765['username']||'';this[_0xea87('0x2')]=_0x236765[_0xea87('0x3')]||'';this[_0xea87('0x4')]=_0x236765['remoteUri']||'';this[_0xea87('0x5')]=_0x236765[_0xea87('0x5')]||'';this[_0xea87('0x6')]=_0x236765[_0xea87('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x1a28=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a28,0x10e));var _0x81a2=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x1a28[_0x5ca353];return _0x4f2fe5;};'use strict';function FreshsalesAccount(_0x1f631f){this['id']=_0x1f631f['id']||0x0;this[_0x81a2('0x0')]=_0x1f631f[_0x81a2('0x0')]||'';this[_0x81a2('0x1')]=_0x1f631f[_0x81a2('0x1')]||'';this[_0x81a2('0x2')]=_0x1f631f['token']||'';this['remoteUri']=_0x1f631f[_0x81a2('0x3')]||'';this[_0x81a2('0x4')]=_0x1f631f[_0x81a2('0x4')]||'';this['Configurations']=_0x1f631f[_0x81a2('0x5')]||{};}module[_0x81a2('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 008f2f2..856ff5b 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 _0x0558=['queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','motionChannel','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x0558,0x160));var _0x8055=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x0558[_0x5a5395];return _0x4da43d;};'use strict';function QueueReport(){this[_0x8055('0x0')]='inbound';this[_0x8055('0x1')]='';this[_0x8055('0x2')]='';this[_0x8055('0x3')]='';this[_0x8055('0x4')]='';this[_0x8055('0x5')]=null;this[_0x8055('0x6')]=null;this['position']=0x1;this[_0x8055('0x7')]=0x1;this[_0x8055('0x8')]=![];this[_0x8055('0x9')]=null;this[_0x8055('0xa')]=![];this['queuecallercompleteAt']=null;this[_0x8055('0xb')]=![];this[_0x8055('0xc')]=null;this[_0x8055('0xd')]=0x1;this['channel']='';this[_0x8055('0xe')]='';this[_0x8055('0xf')]='';this[_0x8055('0x10')]='';this[_0x8055('0x11')]='';this[_0x8055('0x12')]='';this[_0x8055('0x13')]='';this[_0x8055('0x14')]=0x0;this[_0x8055('0x15')]=![];this['lastAssignedTo']='';this[_0x8055('0x16')]='voice';this[_0x8055('0x17')]=0x0;this[_0x8055('0x18')]={};}module[_0x8055('0x19')]=QueueReport; \ No newline at end of file +var _0x9b91=['exten','priority','holdtime','assigned','lastAssignedTo','voice','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','accountcode'];(function(_0x15be0f,_0x58e1ef){var _0x550beb=function(_0x34a8c7){while(--_0x34a8c7){_0x15be0f['push'](_0x15be0f['shift']());}};_0x550beb(++_0x58e1ef);}(_0x9b91,0x188));var _0x19b9=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x9b91[_0x4ba380];return _0x4b111b;};'use strict';function QueueReport(){this[_0x19b9('0x0')]='inbound';this[_0x19b9('0x1')]='';this[_0x19b9('0x2')]='';this[_0x19b9('0x3')]='';this[_0x19b9('0x4')]='';this['queuecallerjoinAt']=null;this[_0x19b9('0x5')]=null;this[_0x19b9('0x6')]=0x1;this[_0x19b9('0x7')]=0x1;this[_0x19b9('0x8')]=![];this[_0x19b9('0x9')]=null;this[_0x19b9('0xa')]=![];this[_0x19b9('0xb')]=null;this[_0x19b9('0xc')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x19b9('0xd')]='';this[_0x19b9('0xe')]='';this['connectedlinename']='';this[_0x19b9('0xf')]='';this['context']='';this[_0x19b9('0x10')]='';this[_0x19b9('0x11')]='';this[_0x19b9('0x12')]=0x0;this[_0x19b9('0x13')]=![];this[_0x19b9('0x14')]='';this['motionChannel']=_0x19b9('0x15');this['mohtime']=0x0;this[_0x19b9('0x16')]={};}module[_0x19b9('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 68ef0e7..5ae261a 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 _0xa329=['serverUrl','Configurations','exports','name','username','remoteUri','clientId','clientSecret','securityToken'];(function(_0x6f3151,_0x406745){var _0x305fb8=function(_0x24e5a8){while(--_0x24e5a8){_0x6f3151['push'](_0x6f3151['shift']());}};_0x305fb8(++_0x406745);}(_0xa329,0x162));var _0x9a32=function(_0x49194d,_0x2e5f51){_0x49194d=_0x49194d-0x0;var _0x3138ae=_0xa329[_0x49194d];return _0x3138ae;};'use strict';function SalesforceAccount(_0x1eba3d){this['id']=_0x1eba3d['id']||0x0;this[_0x9a32('0x0')]=_0x1eba3d['name']||'';this[_0x9a32('0x1')]=_0x1eba3d['username']||'';this[_0x9a32('0x2')]=_0x1eba3d[_0x9a32('0x2')]||'';this['password']=_0x1eba3d['password']||'';this[_0x9a32('0x3')]=_0x1eba3d[_0x9a32('0x3')]||'';this[_0x9a32('0x4')]=_0x1eba3d[_0x9a32('0x4')]||'';this[_0x9a32('0x5')]=_0x1eba3d[_0x9a32('0x5')]||'';this['type']=_0x1eba3d['type']||'integrationTab';this[_0x9a32('0x6')]=_0x1eba3d[_0x9a32('0x6')]||'';this['Configurations']=_0x1eba3d[_0x9a32('0x7')]||{};}module[_0x9a32('0x8')]=SalesforceAccount; \ No newline at end of file +var _0x1baf=['type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x25da80,_0x21b025){var _0x3f4c2a=function(_0xbf61e5){while(--_0xbf61e5){_0x25da80['push'](_0x25da80['shift']());}};_0x3f4c2a(++_0x21b025);}(_0x1baf,0x14e));var _0xf1ba=function(_0x287300,_0x579bdc){_0x287300=_0x287300-0x0;var _0x5be7c5=_0x1baf[_0x287300];return _0x5be7c5;};'use strict';function SalesforceAccount(_0x2a75fa){this['id']=_0x2a75fa['id']||0x0;this[_0xf1ba('0x0')]=_0x2a75fa[_0xf1ba('0x0')]||'';this['username']=_0x2a75fa[_0xf1ba('0x1')]||'';this[_0xf1ba('0x2')]=_0x2a75fa[_0xf1ba('0x2')]||'';this[_0xf1ba('0x3')]=_0x2a75fa[_0xf1ba('0x3')]||'';this[_0xf1ba('0x4')]=_0x2a75fa['clientId']||'';this[_0xf1ba('0x5')]=_0x2a75fa[_0xf1ba('0x5')]||'';this['securityToken']=_0x2a75fa['securityToken']||'';this[_0xf1ba('0x6')]=_0x2a75fa[_0xf1ba('0x6')]||_0xf1ba('0x7');this[_0xf1ba('0x8')]=_0x2a75fa[_0xf1ba('0x8')]||'';this[_0xf1ba('0x9')]=_0x2a75fa[_0xf1ba('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index f795f16..7f8f202 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 _0xa595=['Configurations','exports','name','username','password','serverUrl'];(function(_0x4a7199,_0x8a8660){var _0x2d03e6=function(_0x2e54d8){while(--_0x2e54d8){_0x4a7199['push'](_0x4a7199['shift']());}};_0x2d03e6(++_0x8a8660);}(_0xa595,0x1b8));var _0x5a59=function(_0x1847e3,_0x67cecd){_0x1847e3=_0x1847e3-0x0;var _0x27c536=_0xa595[_0x1847e3];return _0x27c536;};'use strict';function ServicenowAccount(_0x379545){this['id']=_0x379545['id']||0x0;this[_0x5a59('0x0')]=_0x379545['name']||'';this['username']=_0x379545[_0x5a59('0x1')]||'';this[_0x5a59('0x2')]=_0x379545[_0x5a59('0x2')]||'';this['remoteUri']=_0x379545['remoteUri']||'';this[_0x5a59('0x3')]=_0x379545[_0x5a59('0x3')]||'';this[_0x5a59('0x4')]=_0x379545['Configurations']||{};}module[_0x5a59('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x4cf9=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x191596,_0x100e36){var _0x32f574=function(_0x1eaa02){while(--_0x1eaa02){_0x191596['push'](_0x191596['shift']());}};_0x32f574(++_0x100e36);}(_0x4cf9,0x1cc));var _0x94cf=function(_0xbcbbbc,_0x4ae4f6){_0xbcbbbc=_0xbcbbbc-0x0;var _0x51f523=_0x4cf9[_0xbcbbbc];return _0x51f523;};'use strict';function ServicenowAccount(_0xf1e658){this['id']=_0xf1e658['id']||0x0;this[_0x94cf('0x0')]=_0xf1e658[_0x94cf('0x0')]||'';this[_0x94cf('0x1')]=_0xf1e658[_0x94cf('0x1')]||'';this[_0x94cf('0x2')]=_0xf1e658[_0x94cf('0x2')]||'';this[_0x94cf('0x3')]=_0xf1e658[_0x94cf('0x3')]||'';this[_0x94cf('0x4')]=_0xf1e658['serverUrl']||'';this[_0x94cf('0x5')]=_0xf1e658[_0x94cf('0x5')]||{};}module[_0x94cf('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 1f321c6..4d778a9 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 _0xbb1f=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xbb1f,0x1a7));var _0xfbb1=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xbb1f[_0x1597e2];return _0x4c8c0a;};'use strict';function SugarcrmAccount(_0x344f01){this['id']=_0x344f01['id']||0x0;this['name']=_0x344f01[_0xfbb1('0x0')]||'';this[_0xfbb1('0x1')]=_0x344f01[_0xfbb1('0x1')]||'';this['password']=_0x344f01[_0xfbb1('0x2')]||'';this['remoteUri']=_0x344f01[_0xfbb1('0x3')]||'';this['serverUrl']=_0x344f01[_0xfbb1('0x4')]||'';this[_0xfbb1('0x5')]=_0x344f01[_0xfbb1('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x0185=['password','remoteUri','Configurations','name','username'];(function(_0xdef717,_0x2fda4c){var _0x2d0fe5=function(_0x5c3fa4){while(--_0x5c3fa4){_0xdef717['push'](_0xdef717['shift']());}};_0x2d0fe5(++_0x2fda4c);}(_0x0185,0x1ac));var _0x5018=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x0185[_0x387777];return _0x3f84c0;};'use strict';function SugarcrmAccount(_0x3ea85f){this['id']=_0x3ea85f['id']||0x0;this['name']=_0x3ea85f[_0x5018('0x0')]||'';this[_0x5018('0x1')]=_0x3ea85f[_0x5018('0x1')]||'';this[_0x5018('0x2')]=_0x3ea85f['password']||'';this[_0x5018('0x3')]=_0x3ea85f['remoteUri']||'';this['serverUrl']=_0x3ea85f['serverUrl']||'';this[_0x5018('0x4')]=_0x3ea85f[_0x5018('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index cf04e89..51f4d0b 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 _0xea28=['accountcode','state','unknown','stateTime','address','exports','name'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xea28,0x13a));var _0x8ea2=function(_0x5b7351,_0x1831ba){_0x5b7351=_0x5b7351-0x0;var _0xcbd915=_0xea28[_0x5b7351];return _0xcbd915;};'use strict';function Telephone(_0x12ee06){this['id']=_0x12ee06['id']||0x0;this[_0x8ea2('0x0')]=_0x12ee06[_0x8ea2('0x0')]||'';this[_0x8ea2('0x1')]=_0x12ee06[_0x8ea2('0x1')]||'';this[_0x8ea2('0x2')]=_0x8ea2('0x3');this[_0x8ea2('0x4')]=0x0;this['status']=_0x8ea2('0x3');this[_0x8ea2('0x5')]='';}module[_0x8ea2('0x6')]=Telephone; \ No newline at end of file +var _0x16e3=['accountcode','state','unknown','status','address','exports'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x16e3,0x168));var _0x316e=function(_0x42cd45,_0x4b5863){_0x42cd45=_0x42cd45-0x0;var _0x177472=_0x16e3[_0x42cd45];return _0x177472;};'use strict';function Telephone(_0x1f107f){this['id']=_0x1f107f['id']||0x0;this['name']=_0x1f107f['name']||'';this[_0x316e('0x0')]=_0x1f107f['accountcode']||'';this[_0x316e('0x1')]=_0x316e('0x2');this['stateTime']=0x0;this[_0x316e('0x3')]='unknown';this[_0x316e('0x4')]='';}module[_0x316e('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 8555bbc..4473d1c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x4fa072,_0x5bfc04){var _0x3cd454=function(_0x10c993){while(--_0x10c993){_0x4fa072['push'](_0x4fa072['shift']());}};_0x3cd454(++_0x5bfc04);}(_0xb10b,0x12a));var _0xbb10=function(_0x5613de,_0x479c93){_0x5613de=_0x5613de-0x0;var _0x5b40cb=_0xb10b[_0x5613de];return _0x5b40cb;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x42cfc3,_0x4c9584){var _0x3d6b3b=function(_0x18cc51){while(--_0x18cc51){_0x42cfc3['push'](_0x42cfc3['shift']());}};_0x3d6b3b(++_0x4c9584);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b3f52,_0x4f5b13){_0x1b3f52=_0x1b3f52-0x0;var _0x36bf2c=_0xb10b[_0x1b3f52];return _0x36bf2c;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 0d2a2c1..da2a123 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x21a70c,_0x312458){var _0x1b729d=function(_0x5c60ae){while(--_0x5c60ae){_0x21a70c['push'](_0x21a70c['shift']());}};_0x1b729d(++_0x312458);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x6f3782,_0x329efe){_0x6f3782=_0x6f3782-0x0;var _0x346d88=_0x9ffd[_0x6f3782];return _0x346d88;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x17b416,_0x16dec0){var _0x196c41=function(_0x2bd20b){while(--_0x2bd20b){_0x17b416['push'](_0x17b416['shift']());}};_0x196c41(++_0x16dec0);}(_0x8603,0x190));var _0x3860=function(_0x1b982d,_0x184357){_0x1b982d=_0x1b982d-0x0;var _0x26e916=_0x8603[_0x1b982d];return _0x26e916;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 918d14b..c35ae47 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 _0x5396=['domain','domainport','registrationtime','defaultuser','exports','active','name','state','status','unknown','registry','indexOf','split','host'];(function(_0x410c0d,_0x5079cb){var _0x552ae2=function(_0x377d51){while(--_0x377d51){_0x410c0d['push'](_0x410c0d['shift']());}};_0x552ae2(++_0x5079cb);}(_0x5396,0x1d3));var _0x6539=function(_0x280464,_0xc98f57){_0x280464=_0x280464-0x0;var _0x34fe8b=_0x5396[_0x280464];return _0x34fe8b;};'use strict';function Trunk(_0x34913d){this['id']=_0x34913d['id']||0x0;this[_0x6539('0x0')]=_0x34913d['active']||![];this[_0x6539('0x1')]=_0x34913d[_0x6539('0x1')]||'';this[_0x6539('0x2')]='unknown';this['stateTime']=0x0;this[_0x6539('0x3')]=_0x6539('0x4');this[_0x6539('0x5')]=_0x34913d[_0x6539('0x5')]&&_0x34913d[_0x6539('0x5')][_0x6539('0x6')](':')?_0x34913d[_0x6539('0x5')][_0x6539('0x7')](':')[0x0]:'';this[_0x6539('0x8')]='';this['port']='';this[_0x6539('0x9')]='';this[_0x6539('0xa')]='';this['refresh']='';this['stateRegistry']=_0x6539('0x4');this[_0x6539('0xb')]='';this['address']='';this[_0x6539('0xc')]=_0x34913d[_0x6539('0xc')]||'';}module[_0x6539('0xd')]=Trunk; \ No newline at end of file +var _0xa5c0=['unknown','status','registry','split','host','port','domain','stateRegistry','registrationtime','defaultuser','exports','active','name'];(function(_0x3dcc2c,_0x262440){var _0x192177=function(_0x365064){while(--_0x365064){_0x3dcc2c['push'](_0x3dcc2c['shift']());}};_0x192177(++_0x262440);}(_0xa5c0,0x102));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x37bd72){this['id']=_0x37bd72['id']||0x0;this['active']=_0x37bd72[_0x0a5c('0x0')]||![];this[_0x0a5c('0x1')]=_0x37bd72[_0x0a5c('0x1')]||'';this['state']=_0x0a5c('0x2');this['stateTime']=0x0;this[_0x0a5c('0x3')]=_0x0a5c('0x2');this[_0x0a5c('0x4')]=_0x37bd72['registry']&&_0x37bd72[_0x0a5c('0x4')]['indexOf'](':')?_0x37bd72['registry'][_0x0a5c('0x5')](':')[0x0]:'';this[_0x0a5c('0x6')]='';this[_0x0a5c('0x7')]='';this[_0x0a5c('0x8')]='';this['domainport']='';this['refresh']='';this[_0x0a5c('0x9')]=_0x0a5c('0x2');this[_0x0a5c('0xa')]='';this['address']='';this[_0x0a5c('0xb')]=_0x37bd72[_0x0a5c('0xb')]||'';}module[_0x0a5c('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e5fa500..d121a12 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 _0x8de0=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8de0,0xba));var _0x08de=function(_0x12a034,_0x250f99){_0x12a034=_0x12a034-0x0;var _0x33a5e2=_0x8de0[_0x12a034];return _0x33a5e2;};'use strict';function voiceExtension(_0x538c8e){this['id']=_0x538c8e['id']||0x0;this[_0x08de('0x0')]=_0x538c8e[_0x08de('0x0')]||'';this[_0x08de('0x1')]=_0x538c8e[_0x08de('0x1')]||_0x08de('0x2');this[_0x08de('0x3')]=_0x538c8e[_0x08de('0x3')]||![];}module[_0x08de('0x4')]=voiceExtension; \ No newline at end of file +var _0x3c67=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x3dec0c,_0x15c39b){var _0x36f404=function(_0x5070f7){while(--_0x5070f7){_0x3dec0c['push'](_0x3dec0c['shift']());}};_0x36f404(++_0x15c39b);}(_0x3c67,0xd1));var _0x73c6=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x3c67[_0x565ed7];return _0x183ad7;};'use strict';function voiceExtension(_0x3dbe03){this['id']=_0x3dbe03['id']||0x0;this[_0x73c6('0x0')]=_0x3dbe03[_0x73c6('0x0')]||'';this[_0x73c6('0x1')]=_0x3dbe03[_0x73c6('0x1')]||'none';this[_0x73c6('0x2')]=_0x3dbe03['mandatoryDisposition']||![];}module[_0x73c6('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 28b7c66..347d381 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 _0xaecf=['dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel'];(function(_0x405100,_0x5ba91b){var _0xdaee16=function(_0x21b5ae){while(--_0x21b5ae){_0x405100['push'](_0x405100['shift']());}};_0xdaee16(++_0x5ba91b);}(_0xaecf,0xc6));var _0xfaec=function(_0x472473,_0x531c60){_0x472473=_0x472473-0x0;var _0x37fbe9=_0xaecf[_0x472473];return _0x37fbe9;};'use strict';var statusDesc=[_0xfaec('0x0'),'not_inuse',_0xfaec('0x1'),'busy',_0xfaec('0x2'),_0xfaec('0x3'),_0xfaec('0x4'),_0xfaec('0x5'),'onhold'];var monitorFormat={'wav':_0xfaec('0x6'),'wav49':_0xfaec('0x7'),'gsm':_0xfaec('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xfaec('0x9')};function VoiceQueue(_0x561826){this['id']=_0x561826['id']||0x0;this[_0xfaec('0xa')]=_0x561826[_0xfaec('0xa')]||'';this[_0xfaec('0xb')]=_0x561826['monitor_format']||'';this[_0xfaec('0xc')]=_0x561826['type']||_0xfaec('0xd');this[_0xfaec('0xe')]=0x0;this['talking']=0x0;this[_0xfaec('0xf')]=0x0;this[_0xfaec('0x10')]=0x0;this[_0xfaec('0x11')]=0x0;this[_0xfaec('0x12')]=0x0;this['sumBillable']=0x0;this[_0xfaec('0x13')]=0x0;this[_0xfaec('0x14')]=0x0;this[_0xfaec('0x15')]=0x0;this['available']=0x0;this['acw']=_0x561826[_0xfaec('0x16')]||![];this[_0xfaec('0x17')]=_0x561826[_0xfaec('0x17')]||0xa;this['autopause']=_0x561826[_0xfaec('0x18')]||'no';this[_0xfaec('0x19')]=!![];this[_0xfaec('0x1a')]='';this[_0xfaec('0x1b')]=0x0;this[_0xfaec('0x1c')]=0x0;this[_0xfaec('0x1d')]=_0x561826[_0xfaec('0x1d')]||null;this[_0xfaec('0x1e')]=_0x561826['dialGlobalInterval']?_0x561826[_0xfaec('0x1e')]:null;this['dialActive']=_0x561826[_0xfaec('0x1f')];this['dialMethod']=_0x561826['dialMethod']||_0xfaec('0x20');this['dialLimitChannel']=_0x561826[_0xfaec('0x21')]||0x0;this[_0xfaec('0x22')]=_0x561826[_0xfaec('0x22')]||0x0;this[_0xfaec('0x23')]=_0x561826['dialPowerLevel']||0x1;this[_0xfaec('0x24')]=_0x561826[_0xfaec('0x24')]||_0xfaec('0x25');this[_0xfaec('0x26')]=_0x561826[_0xfaec('0x26')]||0.03;this[_0xfaec('0x27')]=_0x561826[_0xfaec('0x27')]||0x258;this[_0xfaec('0x28')]=_0x561826[_0xfaec('0x28')]||_0xfaec('0x29');this[_0xfaec('0x2a')]=_0x561826[_0xfaec('0x2a')]||_0xfaec('0x29');this[_0xfaec('0x2b')]=_0x561826[_0xfaec('0x2b')]||0x1e;this[_0xfaec('0x2c')]=_0x561826[_0xfaec('0x2c')]||_0xfaec('0x2d');this['dialQueueTimeout']=_0x561826[_0xfaec('0x2e')]||0x3;this[_0xfaec('0x2f')]=_0x561826[_0xfaec('0x2f')]||undefined;this[_0xfaec('0x30')]=_0x561826['dialCongestionMaxRetry']||0x3;this[_0xfaec('0x31')]=_0x561826['dialCongestionRetryFrequency']||0x96;this[_0xfaec('0x32')]=_0x561826['dialBusyMaxRetry']||0x3;this[_0xfaec('0x33')]=_0x561826[_0xfaec('0x33')]||0x96;this[_0xfaec('0x34')]=_0x561826['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x561826[_0xfaec('0x35')]||0x96;this[_0xfaec('0x36')]=_0x561826[_0xfaec('0x36')]||0x3;this[_0xfaec('0x37')]=_0x561826[_0xfaec('0x37')]||0x96;this[_0xfaec('0x38')]=_0x561826['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x561826['dialDropRetryFrequency']||0x96;this[_0xfaec('0x39')]=_0x561826[_0xfaec('0x39')]||0x3;this[_0xfaec('0x3a')]=_0x561826['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x561826[_0xfaec('0x3b')]||0x3;this[_0xfaec('0x3c')]=_0x561826[_0xfaec('0x3c')]||0x96;this['dialAgentRejectMaxRetry']=_0x561826['dialAgentRejectMaxRetry']||0x3;this[_0xfaec('0x3d')]=_0x561826[_0xfaec('0x3d')]||0x96;this['dialGlobalMaxRetry']=_0x561826['dialGlobalMaxRetry']||0x4;this[_0xfaec('0x3e')]=_0x561826['Trunk']?_0x561826[_0xfaec('0x3e')]:undefined;this[_0xfaec('0x3f')]=_0x561826[_0xfaec('0x3f')]?_0x561826[_0xfaec('0x3f')]:undefined;this[_0xfaec('0x40')]=_0x561826['dialPrefix']||undefined;this[_0xfaec('0x41')]=_0x561826[_0xfaec('0x41')]?_0x561826['Interval']:undefined;this[_0xfaec('0x42')]=_0x561826['dialOrderByScheduledAt']||'DESC';this[_0xfaec('0x43')]=_0x561826[_0xfaec('0x43')]||undefined;this['dialCutDigit']=_0x561826['dialCutDigit']||undefined;this[_0xfaec('0x44')]=strategy[_0x561826[_0xfaec('0x44')]]||_0xfaec('0x45');this['queueStatusComplete']=!![];this[_0xfaec('0x46')]=_0x561826['dialAMDActive']||![];this[_0xfaec('0x47')]=_0x561826[_0xfaec('0x47')];this[_0xfaec('0x48')]=_0x561826['dialAMDGreeting'];this[_0xfaec('0x49')]=_0x561826[_0xfaec('0x49')];this[_0xfaec('0x4a')]=_0x561826[_0xfaec('0x4a')];this['dialAMDMinWordLength']=_0x561826[_0xfaec('0x4b')];this['dialAMDBetweenWordsSilence']=_0x561826[_0xfaec('0x4c')];this[_0xfaec('0x4d')]=_0x561826[_0xfaec('0x4d')];this[_0xfaec('0x4e')]=_0x561826[_0xfaec('0x4e')];this[_0xfaec('0x4f')]=_0x561826[_0xfaec('0x4f')];this['outboundRejectCallsDay']=0x0;this[_0xfaec('0x50')]=0x0;this[_0xfaec('0x51')]=_0x561826[_0xfaec('0x51')];this[_0xfaec('0x52')]=0x0;this[_0xfaec('0x53')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xfaec('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xfaec('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xfaec('0x56')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xfaec('0x57')]=0x0;this[_0xfaec('0x58')]=0x0;this[_0xfaec('0x59')]=0x0;this['startProgressive']=undefined;this[_0xfaec('0x5a')]=undefined;this[_0xfaec('0x5b')]=undefined;this[_0xfaec('0x5c')]=1.05;this[_0xfaec('0x5d')]=0x0;this[_0xfaec('0x5e')]=0x0;this[_0xfaec('0x5f')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xfaec('0x60')]=0x0;this[_0xfaec('0x61')]=0x0;this[_0xfaec('0x62')]=0x0;this[_0xfaec('0x63')]=0x0;this['predictiveIntervalMaxThreshold']=_0x561826[_0xfaec('0x64')]||0x14;this[_0xfaec('0x65')]=_0x561826['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xfaec('0x66')]=0x0;this[_0xfaec('0x67')]=0x0;this[_0xfaec('0x68')]=0x1;this[_0xfaec('0x69')]=0x0;this[_0xfaec('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0xfaec('0x6b')]=_0x561826[_0xfaec('0x6b')]||0x1e;this[_0xfaec('0x6c')]=_0x561826[_0xfaec('0x6c')]||![];this['dialPreviewAutoRecallMe']=!!_0x561826[_0xfaec('0x6d')]||![];this[_0xfaec('0x6e')]=!!_0x561826['dialPreviewRecallmeReminder']||![];this[_0xfaec('0x6f')]=_0x561826[_0xfaec('0x6f')]||undefined;this[_0xfaec('0x70')]=_0x561826[_0xfaec('0x70')]||![];this[_0xfaec('0x71')]=_0x561826[_0xfaec('0x71')]||![];this[_0xfaec('0xb')]=monitorFormat[_0x561826[_0xfaec('0xb')]]?monitorFormat[_0x561826['monitor_format']]:undefined;this[_0xfaec('0x72')]=_0x561826[_0xfaec('0x72')]||![];this[_0xfaec('0x73')]=_0x561826['mandatoryDispositionPause']?_0x561826[_0xfaec('0x73')]:undefined;}module[_0xfaec('0x74')]=VoiceQueue; \ No newline at end of file +var _0x09e6=['inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown'];(function(_0x372831,_0x93e4d4){var _0x41657f=function(_0x32d521){while(--_0x32d521){_0x372831['push'](_0x372831['shift']());}};_0x41657f(++_0x93e4d4);}(_0x09e6,0xf1));var _0x609e=function(_0x114426,_0xb0d836){_0x114426=_0x114426-0x0;var _0x5c58a5=_0x09e6[_0x114426];return _0x5c58a5;};'use strict';var statusDesc=[_0x609e('0x0'),'not_inuse',_0x609e('0x1'),_0x609e('0x2'),_0x609e('0x3'),_0x609e('0x4'),_0x609e('0x5'),'ringinuse',_0x609e('0x6')];var monitorFormat={'wav':_0x609e('0x7'),'wav49':_0x609e('0x8'),'gsm':_0x609e('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x609e('0xa')};function VoiceQueue(_0x3ccbac){this['id']=_0x3ccbac['id']||0x0;this[_0x609e('0xb')]=_0x3ccbac[_0x609e('0xb')]||'';this[_0x609e('0xc')]=_0x3ccbac[_0x609e('0xc')]||'';this[_0x609e('0xd')]=_0x3ccbac['type']||_0x609e('0xe');this[_0x609e('0xf')]=0x0;this[_0x609e('0x10')]=0x0;this[_0x609e('0x11')]=0x0;this['answered']=0x0;this[_0x609e('0x12')]=0x0;this['sumHoldTime']=0x0;this[_0x609e('0x13')]=0x0;this[_0x609e('0x14')]=0x0;this['abandoned']=0x0;this[_0x609e('0x15')]=0x0;this[_0x609e('0x16')]=0x0;this[_0x609e('0x17')]=_0x3ccbac['acw']||![];this[_0x609e('0x18')]=_0x3ccbac[_0x609e('0x18')]||0xa;this[_0x609e('0x19')]=_0x3ccbac[_0x609e('0x19')]||'no';this[_0x609e('0x1a')]=!![];this[_0x609e('0x1b')]='';this['originated']=0x0;this[_0x609e('0x1c')]=0x0;this[_0x609e('0x1d')]=_0x3ccbac[_0x609e('0x1d')]||null;this['dialGlobalInterval']=_0x3ccbac[_0x609e('0x1e')]?_0x3ccbac[_0x609e('0x1e')]:null;this[_0x609e('0x1f')]=_0x3ccbac['dialActive'];this[_0x609e('0x20')]=_0x3ccbac[_0x609e('0x20')]||_0x609e('0x21');this[_0x609e('0x22')]=_0x3ccbac[_0x609e('0x22')]||0x0;this[_0x609e('0x23')]=_0x3ccbac[_0x609e('0x23')]||0x0;this['dialPowerLevel']=_0x3ccbac[_0x609e('0x24')]||0x1;this[_0x609e('0x25')]=_0x3ccbac[_0x609e('0x25')]||'dropRate';this[_0x609e('0x26')]=_0x3ccbac['dialPredictiveOptimizationPercentage']||0.03;this[_0x609e('0x27')]=_0x3ccbac[_0x609e('0x27')]||0x258;this[_0x609e('0x28')]=_0x3ccbac[_0x609e('0x28')]||'anonymous';this[_0x609e('0x29')]=_0x3ccbac[_0x609e('0x29')]||'anonymous';this[_0x609e('0x2a')]=_0x3ccbac[_0x609e('0x2a')]||0x1e;this[_0x609e('0x2b')]=_0x3ccbac[_0x609e('0x2b')]||_0x609e('0x2c');this[_0x609e('0x2d')]=_0x3ccbac[_0x609e('0x2d')]||0x3;this[_0x609e('0x2e')]=_0x3ccbac[_0x609e('0x2e')]||undefined;this[_0x609e('0x2f')]=_0x3ccbac[_0x609e('0x2f')]||0x3;this[_0x609e('0x30')]=_0x3ccbac[_0x609e('0x30')]||0x96;this[_0x609e('0x31')]=_0x3ccbac[_0x609e('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x3ccbac[_0x609e('0x32')]||0x96;this[_0x609e('0x33')]=_0x3ccbac[_0x609e('0x33')]||0x3;this[_0x609e('0x34')]=_0x3ccbac[_0x609e('0x34')]||0x96;this[_0x609e('0x35')]=_0x3ccbac[_0x609e('0x35')]||0x3;this[_0x609e('0x36')]=_0x3ccbac[_0x609e('0x36')]||0x96;this['dialDropMaxRetry']=_0x3ccbac[_0x609e('0x37')]||0x3;this['dialDropRetryFrequency']=_0x3ccbac['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x3ccbac[_0x609e('0x38')]||0x3;this[_0x609e('0x39')]=_0x3ccbac[_0x609e('0x39')]||0x96;this[_0x609e('0x3a')]=_0x3ccbac[_0x609e('0x3a')]||0x3;this[_0x609e('0x3b')]=_0x3ccbac[_0x609e('0x3b')]||0x96;this[_0x609e('0x3c')]=_0x3ccbac['dialAgentRejectMaxRetry']||0x3;this[_0x609e('0x3d')]=_0x3ccbac[_0x609e('0x3d')]||0x96;this[_0x609e('0x3e')]=_0x3ccbac[_0x609e('0x3e')]||0x4;this['Trunk']=_0x3ccbac[_0x609e('0x3f')]?_0x3ccbac[_0x609e('0x3f')]:undefined;this[_0x609e('0x40')]=_0x3ccbac[_0x609e('0x40')]?_0x3ccbac['TrunkBackup']:undefined;this['dialPrefix']=_0x3ccbac[_0x609e('0x41')]||undefined;this[_0x609e('0x42')]=_0x3ccbac[_0x609e('0x42')]?_0x3ccbac['Interval']:undefined;this['dialOrderByScheduledAt']=_0x3ccbac['dialOrderByScheduledAt']||_0x609e('0x43');this[_0x609e('0x44')]=_0x3ccbac[_0x609e('0x44')]||undefined;this[_0x609e('0x45')]=_0x3ccbac[_0x609e('0x45')]||undefined;this['strategy']=strategy[_0x3ccbac[_0x609e('0x46')]]||_0x609e('0x47');this['queueStatusComplete']=!![];this[_0x609e('0x48')]=_0x3ccbac[_0x609e('0x48')]||![];this[_0x609e('0x49')]=_0x3ccbac[_0x609e('0x49')];this[_0x609e('0x4a')]=_0x3ccbac[_0x609e('0x4a')];this[_0x609e('0x4b')]=_0x3ccbac[_0x609e('0x4b')];this[_0x609e('0x4c')]=_0x3ccbac['dialAMDTotalAnalysisTime'];this[_0x609e('0x4d')]=_0x3ccbac[_0x609e('0x4d')];this[_0x609e('0x4e')]=_0x3ccbac[_0x609e('0x4e')];this['dialAMDMaximumNumberOfWords']=_0x3ccbac[_0x609e('0x4f')];this[_0x609e('0x50')]=_0x3ccbac[_0x609e('0x50')];this['dialAMDMaximumWordLength']=_0x3ccbac[_0x609e('0x51')];this['outboundRejectCallsDay']=0x0;this[_0x609e('0x52')]=0x0;this[_0x609e('0x53')]=_0x3ccbac['timeout'];this[_0x609e('0x54')]=0x0;this[_0x609e('0x55')]=0x0;this[_0x609e('0x56')]=0x0;this[_0x609e('0x57')]=0x0;this[_0x609e('0x58')]=0x0;this[_0x609e('0x59')]=0x0;this[_0x609e('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x609e('0x5b')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x609e('0x5c')]=0x0;this[_0x609e('0x5d')]=0x0;this[_0x609e('0x5e')]=0x0;this[_0x609e('0x5f')]=undefined;this[_0x609e('0x60')]=undefined;this[_0x609e('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x609e('0x62')]=0x0;this[_0x609e('0x63')]=0x0;this[_0x609e('0x64')]=0x0;this[_0x609e('0x65')]=0x0;this[_0x609e('0x66')]=0x0;this[_0x609e('0x67')]=0x0;this[_0x609e('0x68')]=_0x3ccbac[_0x609e('0x69')]||0x14;this[_0x609e('0x6a')]=_0x3ccbac[_0x609e('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x609e('0x6b')]=0x0;this[_0x609e('0x6c')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x609e('0x6d')]=0x0;this[_0x609e('0x6e')]=0x0;this[_0x609e('0x6f')]=_0x3ccbac[_0x609e('0x6f')]||0x1e;this[_0x609e('0x70')]=_0x3ccbac[_0x609e('0x70')]||![];this[_0x609e('0x71')]=!!_0x3ccbac[_0x609e('0x71')]||![];this[_0x609e('0x72')]=!!_0x3ccbac[_0x609e('0x72')]||![];this['dialQueueProject2']=_0x3ccbac[_0x609e('0x73')]||undefined;this[_0x609e('0x74')]=_0x3ccbac[_0x609e('0x74')]||![];this[_0x609e('0x75')]=_0x3ccbac[_0x609e('0x75')]||![];this[_0x609e('0xc')]=monitorFormat[_0x3ccbac[_0x609e('0xc')]]?monitorFormat[_0x3ccbac[_0x609e('0xc')]]:undefined;this[_0x609e('0x76')]=_0x3ccbac[_0x609e('0x76')]||![];this[_0x609e('0x77')]=_0x3ccbac[_0x609e('0x77')]?_0x3ccbac['mandatoryDispositionPause']:undefined;}module[_0x609e('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index ef67596..15023a6 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 _0xd36d=['username','accessKey','remoteUri','serverUrl','name'];(function(_0x3b9747,_0x19bb5e){var _0x5dc573=function(_0x5487e2){while(--_0x5487e2){_0x3b9747['push'](_0x3b9747['shift']());}};_0x5dc573(++_0x19bb5e);}(_0xd36d,0x72));var _0xdd36=function(_0x48de7d,_0x35dd6e){_0x48de7d=_0x48de7d-0x0;var _0xd55fe7=_0xd36d[_0x48de7d];return _0xd55fe7;};'use strict';function VtigerAccount(_0x280880){this['id']=_0x280880['id']||0x0;this['name']=_0x280880[_0xdd36('0x0')]||'';this[_0xdd36('0x1')]=_0x280880[_0xdd36('0x1')]||'';this[_0xdd36('0x2')]=_0x280880[_0xdd36('0x2')]||'';this[_0xdd36('0x3')]=_0x280880[_0xdd36('0x3')]||'';this[_0xdd36('0x4')]=_0x280880[_0xdd36('0x4')]||'';this['Configurations']=_0x280880['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xb9bc=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x210200,_0x150b2e){var _0x52e0e5=function(_0x41431d){while(--_0x41431d){_0x210200['push'](_0x210200['shift']());}};_0x52e0e5(++_0x150b2e);}(_0xb9bc,0x144));var _0xcb9b=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0xb9bc[_0x200827];return _0x120047;};'use strict';function VtigerAccount(_0x575510){this['id']=_0x575510['id']||0x0;this[_0xcb9b('0x0')]=_0x575510['name']||'';this['username']=_0x575510[_0xcb9b('0x1')]||'';this[_0xcb9b('0x2')]=_0x575510[_0xcb9b('0x2')]||'';this['remoteUri']=_0x575510[_0xcb9b('0x3')]||'';this[_0xcb9b('0x4')]=_0x575510['serverUrl']||'';this[_0xcb9b('0x5')]=_0x575510[_0xcb9b('0x5')]||{};}module[_0xcb9b('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 4c1bb86..27c63af 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 _0x7226=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x182186,_0x3aafe2){var _0x4b1338=function(_0x1b71f7){while(--_0x1b71f7){_0x182186['push'](_0x182186['shift']());}};_0x4b1338(++_0x3aafe2);}(_0x7226,0x157));var _0x6722=function(_0x4863dc,_0x134546){_0x4863dc=_0x4863dc-0x0;var _0x3d0ef1=_0x7226[_0x4863dc];return _0x3d0ef1;};'use strict';function ZendeskAccount(_0x5b957e){this['id']=_0x5b957e['id']||0x0;this['name']=_0x5b957e[_0x6722('0x0')]||'';this[_0x6722('0x1')]=_0x5b957e[_0x6722('0x1')]||'';this[_0x6722('0x2')]=_0x5b957e[_0x6722('0x2')]||'';this['token']=_0x5b957e[_0x6722('0x3')]||'';this[_0x6722('0x4')]=_0x5b957e[_0x6722('0x4')]||'';this[_0x6722('0x5')]=_0x5b957e['authType']||'';this[_0x6722('0x6')]=_0x5b957e[_0x6722('0x6')]||_0x6722('0x7');this[_0x6722('0x8')]=_0x5b957e[_0x6722('0x8')]||'';this[_0x6722('0x9')]=_0x5b957e[_0x6722('0x9')]||{};}module[_0x6722('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xe977=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe977,0x12c));var _0x7e97=function(_0x3a2b33,_0x4cc8a3){_0x3a2b33=_0x3a2b33-0x0;var _0x30dd48=_0xe977[_0x3a2b33];return _0x30dd48;};'use strict';function ZendeskAccount(_0x1bd417){this['id']=_0x1bd417['id']||0x0;this[_0x7e97('0x0')]=_0x1bd417[_0x7e97('0x0')]||'';this[_0x7e97('0x1')]=_0x1bd417[_0x7e97('0x1')]||'';this['password']=_0x1bd417[_0x7e97('0x2')]||'';this['token']=_0x1bd417[_0x7e97('0x3')]||'';this['remoteUri']=_0x1bd417[_0x7e97('0x4')]||'';this[_0x7e97('0x5')]=_0x1bd417[_0x7e97('0x5')]||'';this[_0x7e97('0x6')]=_0x1bd417[_0x7e97('0x6')]||_0x7e97('0x7');this[_0x7e97('0x8')]=_0x1bd417[_0x7e97('0x8')]||'';this[_0x7e97('0x9')]=_0x1bd417[_0x7e97('0x9')]||{};}module[_0x7e97('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 7d61211..8ca26ea 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 _0xa9dc=['host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x3f2e31,_0x15b110){var _0x505ae5=function(_0x3db8bf){while(--_0x3db8bf){_0x3f2e31['push'](_0x3f2e31['shift']());}};_0x505ae5(++_0x15b110);}(_0xa9dc,0x80));var _0xca9d=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0xa9dc[_0x4492af];return _0x216729;};'use strict';function ZohoAccount(_0x5694c3){this['id']=_0x5694c3['id']||0x0;this[_0xca9d('0x0')]=_0x5694c3['name']||'';this[_0xca9d('0x1')]=_0x5694c3[_0xca9d('0x1')]||'';this[_0xca9d('0x2')]=_0x5694c3[_0xca9d('0x2')]||'';this['zone']=_0x5694c3[_0xca9d('0x3')]||'';this[_0xca9d('0x4')]=_0x5694c3[_0xca9d('0x4')]||'';this['clientSecret']=_0x5694c3['clientSecret']||'';this[_0xca9d('0x5')]=_0x5694c3[_0xca9d('0x5')]||'';this['code']=_0x5694c3[_0xca9d('0x6')]||'';this[_0xca9d('0x7')]=_0x5694c3[_0xca9d('0x7')]||'';this[_0xca9d('0x8')]=_0x5694c3[_0xca9d('0x8')]||{};}module[_0xca9d('0x9')]=ZohoAccount; \ No newline at end of file +var _0xe25e=['host','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x43cc3d,_0x2ddaea){var _0x274af9=function(_0x2575f7){while(--_0x2575f7){_0x43cc3d['push'](_0x43cc3d['shift']());}};_0x274af9(++_0x2ddaea);}(_0xe25e,0x10c));var _0xee25=function(_0x20778c,_0x9c81a0){_0x20778c=_0x20778c-0x0;var _0x32d193=_0xe25e[_0x20778c];return _0x32d193;};'use strict';function ZohoAccount(_0x1b03c0){this['id']=_0x1b03c0['id']||0x0;this[_0xee25('0x0')]=_0x1b03c0[_0xee25('0x0')]||'';this[_0xee25('0x1')]=_0x1b03c0['description']||'';this[_0xee25('0x2')]=_0x1b03c0[_0xee25('0x2')]||'';this['zone']=_0x1b03c0['zone']||'';this[_0xee25('0x3')]=_0x1b03c0['clientId']||'';this[_0xee25('0x4')]=_0x1b03c0['clientSecret']||'';this[_0xee25('0x5')]=_0x1b03c0['serverUrl']||'';this[_0xee25('0x6')]=_0x1b03c0[_0xee25('0x6')]||'';this[_0xee25('0x7')]=_0x1b03c0[_0xee25('0x7')]||'';this[_0xee25('0x8')]=_0x1b03c0['Configurations']||{};}module[_0xee25('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 e7927b0..b9454bd 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 _0xaa03=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','\x22%s\x22\x20<%s>','number','exports','util','moment','string','isNil','uniqueid','idContact','queue','type','Agent','format','membername','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0xf9d40b,_0xbb19d9){var _0x188530=function(_0x3b0a9c){while(--_0x3b0a9c){_0xf9d40b['push'](_0xf9d40b['shift']());}};_0x188530(++_0xbb19d9);}(_0xaa03,0x12a));var _0x3aa0=function(_0x425a82,_0x2bc97b){_0x425a82=_0x425a82-0x0;var _0x4ee60b=_0xaa03[_0x425a82];return _0x4ee60b;};'use strict';var util=require(_0x3aa0('0x0'));var _=require('lodash');var moment=require(_0x3aa0('0x1'));function checkNameSurname(_0x2d39de,_0x36ac04,_0xab344a){var _0x226f73='';if(!_['isNil'](_0x36ac04)&&_0x3aa0('0x2')===typeof _0x36ac04){_0x226f73+=_0x36ac04;}if(!_[_0x3aa0('0x3')](_0xab344a)&&'string'===typeof _0xab344a){_0x226f73+='\x20'+_0xab344a;}if(_0x226f73!==''){return _0x226f73;}return _0x2d39de;}function Action(_0x518818,_0x4a12a6,_0xc80011,_0x2ccaa0,_0xc9930e){this[_0x3aa0('0x4')]=_0xc80011||undefined;this[_0x3aa0('0x5')]=_0x518818['id'];this[_0x3aa0('0x6')]=_0x4a12a6['name'];this['type']=_0x4a12a6[_0x3aa0('0x7')];this['campaigntype']='queue';this['dialAnswer']=![];this['membername']=_['isNil'](_0x518818[_0x3aa0('0x8')])?undefined:_0x518818[_0x3aa0('0x8')]['name'];this['channelAgent']=this['membername']?util[_0x3aa0('0x9')]('SIP/%s',this[_0x3aa0('0xa')]):_0x2ccaa0||undefined;this[_0x3aa0('0xb')]=checkNameSurname(_0x518818[_0x3aa0('0xc')][_0x3aa0('0xd')],_0x518818[_0x3aa0('0xc')][_0x3aa0('0xe')],_0x518818[_0x3aa0('0xc')][_0x3aa0('0xf')]);this[_0x3aa0('0x10')]=_0x518818['active']||![];this[_0x3aa0('0x11')]=_0x518818[_0x3aa0('0xc')][_0x3aa0('0xd')];this[_0x3aa0('0x12')]=_0x518818[_0x3aa0('0x12')];this[_0x3aa0('0x13')]=_0x518818[_0x3aa0('0x13')]||0x0;this[_0x3aa0('0x14')]=_0x518818[_0x3aa0('0x14')]||0x0;this[_0x3aa0('0x15')]=_0x518818['countnoanswerretry']||0x0;this[_0x3aa0('0x16')]=(_0x518818['countbusyretry']||0x0)+(_0x518818['countcongestionretry']||0x0)+(_0x518818[_0x3aa0('0x15')]||0x0)+(_0x518818[_0x3aa0('0x17')]||0x0)+(_0x518818[_0x3aa0('0x18')]||0x0)+(_0x518818[_0x3aa0('0x19')]||0x0)+(_0x518818[_0x3aa0('0x1a')]||0x0)+(_0x518818[_0x3aa0('0x1b')]||0x0);this[_0x3aa0('0x17')]=_0x518818[_0x3aa0('0x17')]||0x0;this[_0x3aa0('0x18')]=_0x518818['countdropretry']||0x0;this[_0x3aa0('0x19')]=_0x518818['countabandonedretry']||0x0;this[_0x3aa0('0x1a')]=_0x518818[_0x3aa0('0x1a')]||0x0;this[_0x3aa0('0x1b')]=_0x518818[_0x3aa0('0x1b')]||0x0;this[_0x3aa0('0x1c')]=_0x518818[_0x3aa0('0x1c')];this[_0x3aa0('0x1d')]=_0x518818['callbackuniqueid'];this[_0x3aa0('0x1e')]=_0x518818['callbackat'];this[_0x3aa0('0x1f')]=_0x518818[_0x3aa0('0x1f')];this['ContactId']=_0x518818[_0x3aa0('0x20')];this[_0x3aa0('0x21')]=_0x518818['ListId'];this[_0x3aa0('0x22')]=_[_0x3aa0('0x3')](_0x518818[_0x3aa0('0x8')])?_0x518818[_0x3aa0('0x22')]:_0x518818[_0x3aa0('0x8')]['id'];this[_0x3aa0('0x23')]=_0x518818['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3aa0('0x24')]['getCaller']=function(){return util[_0x3aa0('0x9')](_0x3aa0('0x25'),this['calleridname'],this[_0x3aa0('0x26')]);};module[_0x3aa0('0x27')]=Action; \ No newline at end of file +var _0xb537=['countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','exports','util','lodash','string','uniqueid','queue','type','campaigntype','dialAnswer','membername','isNil','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','active','calleridnum','countbusyretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x1147f6,_0x481411){var _0x2165d8=function(_0x7a43c0){while(--_0x7a43c0){_0x1147f6['push'](_0x1147f6['shift']());}};_0x2165d8(++_0x481411);}(_0xb537,0x1ba));var _0x7b53=function(_0x358cbe,_0x1a5f73){_0x358cbe=_0x358cbe-0x0;var _0x22456b=_0xb537[_0x358cbe];return _0x22456b;};'use strict';var util=require(_0x7b53('0x0'));var _=require(_0x7b53('0x1'));var moment=require('moment');function checkNameSurname(_0x1ea971,_0x23073c,_0x3eec30){var _0x56c695='';if(!_['isNil'](_0x23073c)&&'string'===typeof _0x23073c){_0x56c695+=_0x23073c;}if(!_['isNil'](_0x3eec30)&&_0x7b53('0x2')===typeof _0x3eec30){_0x56c695+='\x20'+_0x3eec30;}if(_0x56c695!==''){return _0x56c695;}return _0x1ea971;}function Action(_0x24871c,_0x19f90d,_0x2047d3,_0x4e379d,_0x1b1be2){this[_0x7b53('0x3')]=_0x2047d3||undefined;this['idContact']=_0x24871c['id'];this[_0x7b53('0x4')]=_0x19f90d['name'];this['type']=_0x19f90d[_0x7b53('0x5')];this[_0x7b53('0x6')]='queue';this[_0x7b53('0x7')]=![];this[_0x7b53('0x8')]=_[_0x7b53('0x9')](_0x24871c[_0x7b53('0xa')])?undefined:_0x24871c[_0x7b53('0xa')][_0x7b53('0xb')];this[_0x7b53('0xc')]=this[_0x7b53('0x8')]?util[_0x7b53('0xd')](_0x7b53('0xe'),this['membername']):_0x4e379d||undefined;this[_0x7b53('0xf')]=checkNameSurname(_0x24871c['Contact'][_0x7b53('0x10')],_0x24871c[_0x7b53('0x11')]['firstName'],_0x24871c[_0x7b53('0x11')]['lastName']);this[_0x7b53('0x12')]=_0x24871c[_0x7b53('0x12')]||![];this[_0x7b53('0x13')]=_0x24871c['Contact'][_0x7b53('0x10')];this['scheduledat']=_0x24871c['scheduledat'];this['countbusyretry']=_0x24871c[_0x7b53('0x14')]||0x0;this['countcongestionretry']=_0x24871c['countcongestionretry']||0x0;this['countnoanswerretry']=_0x24871c['countnoanswerretry']||0x0;this[_0x7b53('0x15')]=(_0x24871c[_0x7b53('0x14')]||0x0)+(_0x24871c['countcongestionretry']||0x0)+(_0x24871c[_0x7b53('0x16')]||0x0)+(_0x24871c['countnosuchnumberretry']||0x0)+(_0x24871c[_0x7b53('0x17')]||0x0)+(_0x24871c[_0x7b53('0x18')]||0x0)+(_0x24871c[_0x7b53('0x19')]||0x0)+(_0x24871c[_0x7b53('0x1a')]||0x0);this[_0x7b53('0x1b')]=_0x24871c[_0x7b53('0x1b')]||0x0;this[_0x7b53('0x17')]=_0x24871c[_0x7b53('0x17')]||0x0;this[_0x7b53('0x18')]=_0x24871c[_0x7b53('0x18')]||0x0;this['countmachineretry']=_0x24871c[_0x7b53('0x19')]||0x0;this[_0x7b53('0x1a')]=_0x24871c['countagentrejectretry']||0x0;this['callback']=_0x24871c[_0x7b53('0x1c')];this[_0x7b53('0x1d')]=_0x24871c[_0x7b53('0x1d')];this['callbackat']=_0x24871c[_0x7b53('0x1e')];this['recallme']=_0x24871c['recallme'];this[_0x7b53('0x1f')]=_0x24871c[_0x7b53('0x1f')];this[_0x7b53('0x20')]=_0x24871c[_0x7b53('0x20')];this[_0x7b53('0x21')]=_[_0x7b53('0x9')](_0x24871c[_0x7b53('0xa')])?_0x24871c['UserId']:_0x24871c['Agent']['id'];this[_0x7b53('0x22')]=_0x24871c[_0x7b53('0x22')];this[_0x7b53('0x23')]='';this[_0x7b53('0x24')]='';}Action['prototype'][_0x7b53('0x25')]=function(){return util[_0x7b53('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this['number']);};module[_0x7b53('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 38bea2b..130b873 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 _0x84ab=['syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','voice:queue:%s','voice_queue:save','info','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','contactId','VoiceQueueId','ListId','Action','status','channel','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','dialRecallMeTimeout','Agent','run','then','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','AGENTS_NOT_LOGGED','isActive','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','talktime','[syncHangup][talking][decrement]','uniqueid','outboundBusyCallsDay','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','originated','ANSWER','isUndefined','object','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','isTrunkReachable','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','[originated][increment]','actionid','logLookAgent','clone','isFailure','response','rejected','callProgressDetectingAgent','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','variables','filterKey','variable','addVariable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./util/util','defaults','redis','socket.io-emitter','prototype','enqueue','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset'];(function(_0x54157e,_0x258aef){var _0x42768f=function(_0x3ff18a){while(--_0x3ff18a){_0x54157e['push'](_0x54157e['shift']());}};_0x42768f(++_0x258aef);}(_0x84ab,0x12f));var _0xb84a=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x84ab[_0x31bab3];return _0x4fd382;};'use strict';var util=require(_0xb84a('0x0'));var _=require(_0xb84a('0x1'));var BPromise=require(_0xb84a('0x2'));var uuid=require(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var md5=require('md5');var Redis=require(_0xb84a('0x5'));var config=require(_0xb84a('0x6'));var logger=require('../../../config/logger')(_0xb84a('0x7'));var loggerAction=require(_0xb84a('0x8'))(_0xb84a('0x9'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xb84a('0xa'));config['redis']=_[_0xb84a('0xb')](config[_0xb84a('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xb84a('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb84a('0xe')][_0xb84a('0xf')]=function(_0x42daf5){this['tail']=this['tail']?this['tail'][_0xb84a('0x10')](_0x42daf5):_0x42daf5();};function Preview(_0x17379b){this[_0xb84a('0x11')]=new Sequence();this[_0xb84a('0x12')]=_0x17379b[_0xb84a('0x13')];this['trunks']=_0x17379b[_0xb84a('0x14')];this[_0xb84a('0x15')]={};this[_0xb84a('0x16')]=_0x17379b[_0xb84a('0x16')];this[_0xb84a('0x17')]=0x0;ami['on'](_0xb84a('0x18'),this[_0xb84a('0x19')][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x1b'),this[_0xb84a('0x1c')][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x1d'),this['syncHangupRequest'][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x1e'),this[_0xb84a('0x1f')][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x20'),this[_0xb84a('0x21')][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x22'),this[_0xb84a('0x23')][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x24'),this[_0xb84a('0x25')][_0xb84a('0x1a')](this));ami['on'](_0xb84a('0x26'),this['syncBlindTransfer'][_0xb84a('0x1a')](this));this[_0xb84a('0x27')](this['campaignsPreview']);}function emit(_0xac76d3,_0x61ef03,_0x42c788){io['to'](_0xac76d3)[_0xb84a('0x28')](_0x61ef03,_0x42c788);}function emitCampaignPreview(_0x50bac5){if(_0x50bac5['type']===_0xb84a('0x29')){var _0x19097d={'id':_0x50bac5['id'],'name':_0x50bac5[_0xb84a('0x2a')],'strategy':_0x50bac5[_0xb84a('0x2b')],'answered':_0x50bac5[_0xb84a('0x2c')],'available':_0x50bac5[_0xb84a('0x2d')],'loggedIn':_0x50bac5[_0xb84a('0x2e')],'pTalking':_0x50bac5[_0xb84a('0x2f')],'sumBillable':_0x50bac5[_0xb84a('0x30')],'sumDuration':_0x50bac5[_0xb84a('0x31')],'sumHoldTime':_0x50bac5[_0xb84a('0x32')]||0x0,'talking':_0x50bac5[_0xb84a('0x33')],'total':_0x50bac5[_0xb84a('0x34')],'type':_0x50bac5[_0xb84a('0x35')],'unmanaged':_0x50bac5[_0xb84a('0x36')],'abandoned':_0x50bac5[_0xb84a('0x37')],'waiting':_0x50bac5[_0xb84a('0x38')],'loggedInDb':_0x50bac5[_0xb84a('0x39')],'dialActive':_0x50bac5[_0xb84a('0x3a')],'dialMethod':_0x50bac5[_0xb84a('0x3b')],'dialOriginateCallerIdName':_0x50bac5[_0xb84a('0x3c')],'dialOriginateCallerIdNumber':_0x50bac5[_0xb84a('0x3d')],'dialOriginateTimeout':_0x50bac5[_0xb84a('0x3e')],'dialPrefix':_0x50bac5[_0xb84a('0x3f')],'outboundAnswerAgiCallsDay':_0x50bac5[_0xb84a('0x40')],'outboundAnswerCallsDay':_0x50bac5[_0xb84a('0x41')],'outboundBlacklistCallsDay':_0x50bac5['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x50bac5['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x50bac5[_0xb84a('0x42')],'outboundDropCallsDayACS':_0x50bac5[_0xb84a('0x43')],'outboundDropCallsDayCallersExit':_0x50bac5['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x50bac5[_0xb84a('0x44')],'outboundNoAnswerCallsDay':_0x50bac5[_0xb84a('0x45')],'outboundNoSuchCallsDay':_0x50bac5['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x50bac5['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x50bac5[_0xb84a('0x46')],'outboundRejectCallsDay':_0x50bac5[_0xb84a('0x47')],'outboundUnknownCallsDay':_0x50bac5['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x50bac5[_0xb84a('0x48')],'predictiveIntervalAnsweredCalls':_0x50bac5[_0xb84a('0x49')],'predictiveIntervalAvgHoldtime':_0x50bac5[_0xb84a('0x4a')],'predictiveIntervalAvgTalktime':_0x50bac5[_0xb84a('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0x50bac5[_0xb84a('0x4c')],'predictiveIntervalDroppedCallsTimeout':_0x50bac5[_0xb84a('0x4d')],'predictiveIntervalErlangCalls':_0x50bac5[_0xb84a('0x4e')],'predictiveIntervalErlangCallsDroppedCalls':_0x50bac5[_0xb84a('0x4f')],'predictiveIntervalHitRate':_0x50bac5['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x50bac5[_0xb84a('0x50')],'predictiveIntervalPauses':_0x50bac5['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x50bac5['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x50bac5[_0xb84a('0x51')],'message':_0x50bac5[_0xb84a('0x52')],'originated':_0x50bac5['originated'],'erlangCalls':_0x50bac5['erlangCalls'],'erlangCallToSecond':_0x50bac5[_0xb84a('0x53')],'erlangAbandonmentRate':_0x50bac5[_0xb84a('0x54')],'erlangBusyFactor':_0x50bac5[_0xb84a('0x55')],'startPredictive':_0x50bac5[_0xb84a('0x56')],'startProgressive':_0x50bac5[_0xb84a('0x57')]};if(_0x50bac5[_0xb84a('0x58')]){_0x19097d[_0xb84a('0x58')]={'id':_0x50bac5[_0xb84a('0x58')]['id'],'name':_0x50bac5['Trunk'][_0xb84a('0x2a')],'active':_0x50bac5[_0xb84a('0x58')][_0xb84a('0x59')],'callerid':_0x50bac5[_0xb84a('0x58')][_0xb84a('0x5a')]};}if(_0x50bac5[_0xb84a('0x5b')]){_0x19097d[_0xb84a('0x5b')]={'id':_0x50bac5['Interval']['id'],'name':_0x50bac5[_0xb84a('0x5b')]['name']};}var _0x1a3115=md5(JSON[_0xb84a('0x5c')](_0x19097d));if(_0x50bac5[_0xb84a('0x5d')]!==_0x1a3115){_0x50bac5['md5']=_0x1a3115;emit(util['format'](_0xb84a('0x5e'),_0x19097d[_0xb84a('0x2a')]),_0xb84a('0x5f'),_0x19097d);}}}function emitVoiceQueueChannelRemove(_0x2d3e08){logger[_0xb84a('0x60')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xb84a('0x5c')](_0x2d3e08));emit(util[_0xb84a('0x61')]('voice:queue:%s',_0x2d3e08[_0xb84a('0x2a')]),_0xb84a('0x62'),_0x2d3e08);io[_0xb84a('0x28')](_0xb84a('0x63'),_0x2d3e08);}function notSendMessagesQueue(_0x5675a8){if(_0x5675a8['sendMessageOneNotActive']){if(_0x5675a8['originated']===0x0&&_0x5675a8[_0xb84a('0x2f')]===0x0){_0x5675a8[_0xb84a('0x64')]=![];_0x5675a8[_0xb84a('0x2d')]=0x0;_0x5675a8[_0xb84a('0x65')]=0x0;_0x5675a8['message']=_0xb84a('0x66');ut['logger'](_0xb84a('0x67'),_0x5675a8['name']+'\x20is\x20not\x20active');}else{_0x5675a8['message']=_0xb84a('0x68');ut[_0xb84a('0x69')](_0xb84a('0x67'),_0x5675a8[_0xb84a('0x2a')]+'\x20is\x20disactive');}emitCampaignPreview(_0x5675a8);}}Preview[_0xb84a('0xe')][_0xb84a('0x27')]=function(){var _0x3908c3=this;setInterval(function(){_0x3908c3[_0xb84a('0x6a')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x15a621=this[_0xb84a('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x1045ee in _0x15a621){if(_0x15a621[_0xb84a('0x6b')](_0x1045ee)&&(_0x15a621[_0x1045ee][_0xb84a('0x3b')]===_0xb84a('0x7')||_0x15a621[_0x1045ee][_0xb84a('0x3b')]===_0xb84a('0x6c'))&&_0x15a621[_0x1045ee][_0xb84a('0x35')]===_0xb84a('0x29')){if(this[_0xb84a('0x17')]>0x7){this[_0xb84a('0x17')]=0x0;this[_0xb84a('0x6d')]();}}if(_0x15a621[_0xb84a('0x6b')](_0x1045ee)&&_0x15a621[_0x1045ee][_0xb84a('0x3b')]===_0xb84a('0x7')&&_0x15a621[_0x1045ee][_0xb84a('0x35')]==='outbound'){if(_0x15a621[_0x1045ee][_0xb84a('0x3a')]){this[_0xb84a('0x6e')](_0x15a621[_0x1045ee]);if(_0x15a621[_0x1045ee][_0xb84a('0x6f')])this[_0xb84a('0x70')](_0x15a621[_0x1045ee]);}else{notSendMessagesQueue(_0x15a621[_0x1045ee]);}}}};Preview[_0xb84a('0xe')][_0xb84a('0x71')]=function(_0x550eb1){var _0xfd2927=this;this['sequence'][_0xb84a('0xf')](function(){if(!_[_0xb84a('0x72')](_0xfd2927[_0xb84a('0x15')][_0x550eb1])){loggerAction[_0xb84a('0x60')]('[clearZombieChannels][talking]',_0x550eb1,_0xb84a('0x73'),_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x74')],'originated:\x20',JSON['stringify'](_0xfd2927[_0xb84a('0x12')][_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x74')]]['originated']),'pTalking:\x20',JSON['stringify'](_0xfd2927[_0xb84a('0x12')][_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x74')]][_0xb84a('0x2f')]),JSON[_0xb84a('0x5c')](_0xfd2927['actions'][_0x550eb1]['dialAnswer']),JSON['stringify'](_['pick'](_0xfd2927[_0xb84a('0x15')][_0x550eb1],[_0xb84a('0x75'),'UserId',_0xb84a('0x76'),_0xb84a('0x77')])));return ami[_0xb84a('0x78')]({'action':_0xb84a('0x79'),'channel':_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x7a')]})['catch'](function(_0x5bb7d5){if(_0x5bb7d5[_0xb84a('0x52')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xfd2927[_0xb84a('0x15')][_0x550eb1]){ut['updateOriginated'](_0xfd2927['campaignsPreview'][_0xfd2927['actions'][_0x550eb1][_0xb84a('0x74')]],_0xb84a('0x7b'));if(_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x7c')]===!![]){ut[_0xb84a('0x7d')](_0xfd2927[_0xb84a('0x12')][_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x74')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x550eb1,_0xfd2927[_0xb84a('0x15')][_0x550eb1][_0xb84a('0x74')]);}ut['loggerError'](_0xb84a('0x7e')+_0x550eb1,_0xfd2927['actions'][_0x550eb1]['queue']);delete _0xfd2927['actions'][_0x550eb1];}},0x2328);}});}});};Preview[_0xb84a('0xe')][_0xb84a('0x6d')]=function(){var _0x49a0e2=this;loggerAction['info'](_0xb84a('0x7f'),_[_0xb84a('0x80')](this[_0xb84a('0x15')]));for(var _0x505994 in this[_0xb84a('0x15')]){if(_0x49a0e2['actions']['hasOwnProperty'](_0x505994)){_0x49a0e2[_0xb84a('0x71')](_0x505994);}}};Preview['prototype'][_0xb84a('0x70')]=function(_0x540742){var _0x1aad15=this;rpcDb[_0xb84a('0x81')](_0x540742['id'],ut[_0xb84a('0x82')](this[_0xb84a('0x16')]))['then'](function(_0x50a514){if(!_['isNil'](_0x50a514)){for(var _0x40b392=0x0;_0x40b392<_0x50a514[_0xb84a('0x83')];_0x40b392+=0x1){if(ut['getDiff'](_0x50a514[_0x40b392]['scheduledat'])<_0x540742[_0xb84a('0x84')]*0x3c){if(_0x50a514[_0x40b392][_0xb84a('0x85')]&&!_0x50a514[_0x40b392][_0xb84a('0x85')]['voicePause']){_0x1aad15[_0xb84a('0x86')](_0x50a514[_0x40b392]['id'])[_0xb84a('0x87')](ut['logger2'](_0xb84a('0x88')))[_0xb84a('0x89')](ut[_0xb84a('0x8a')](_0xb84a('0x88')));}else{rpcDb[_0xb84a('0x8b')](_0x50a514[_0x40b392]['id']);}}else{var _0x46cc6a=new Action(_0x50a514[_0x40b392],_0x540742);_0x46cc6a[_0xb84a('0x8c')]=moment()['format'](_0xb84a('0x8d'));_0x540742[_0xb84a('0x46')]+=0x1;ut['logCustomer'](_0x46cc6a,0x17,_0xb84a('0x8e'));if(_0x540742[_0xb84a('0x8f')]){rpcDb[_0xb84a('0x90')](ut[_0xb84a('0x91')](_0x50a514[_0x40b392]));rpcDb[_0xb84a('0x92')](_0x46cc6a,_0xb84a('0x93'));}else{ut[_0xb84a('0x94')](_0x46cc6a,0x16,_0xb84a('0x95'));rpcDb[_0xb84a('0x92')](_0x46cc6a,'[HistoryRecallClose]');rpcDb[_0xb84a('0x96')](_0x46cc6a,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xb84a('0x8a')]('[getContactRecallMe]'));};Preview[_0xb84a('0xe')]['setMessage']=function(_0x2bcc96){_0x2bcc96[_0xb84a('0x64')]=!![];if(ut['IsNotLoggedIn'](_0x2bcc96[_0xb84a('0x2e')])){_0x2bcc96[_0xb84a('0x52')]=_0xb84a('0x97');}else if(!ut[_0xb84a('0x98')](_0x2bcc96[_0xb84a('0x3a')])){_0x2bcc96[_0xb84a('0x52')]=_0xb84a('0x66');}else if(!this['isTrunkReachable'](_0x2bcc96[_0xb84a('0x58')])){if(!this['isTrunkReachable'](_0x2bcc96['TrunkBackup'])){_0x2bcc96[_0xb84a('0x52')]=_0xb84a('0x99');}else{_0x2bcc96[_0xb84a('0x52')]=_0xb84a('0x9a');}}else{_0x2bcc96['message']='ACTIVE';}emitCampaignPreview(_0x2bcc96);};Preview[_0xb84a('0xe')][_0xb84a('0x9b')]=function(_0xedd11,_0x1a2e1a,_0x4cea27){var _0x10b3f1=this;var _0x5eced1=this[_0xb84a('0x15')][_0x1a2e1a];var _0x57b784=this[_0xb84a('0x12')][_0x5eced1['queue']];var _0x55fabf;if(_0x57b784){switch(_0x4cea27){case'1':_0x57b784['outboundNoSuchCallsDay']+=0x1;_0x5eced1[_0xb84a('0x9c')]+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x0,'NoSuchNumber');ami[_0xb84a('0x28')](_0xb84a('0x9f'),ut[_0xb84a('0xa0')](_0x5eced1,_0xb84a('0xa1')));rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xa2'));if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784['dialGlobalMaxRetry']){_0x55fabf=ut[_0xb84a('0xa3')](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb[_0xb84a('0x96')](_0x55fabf,_0xb84a('0xa5'));}else{if(_0x5eced1[_0xb84a('0x9c')]>=_0x57b784[_0xb84a('0xa6')]){rpcDb['createCustomerFinal'](_0x5eced1,_0xb84a('0xa5'));}else{rpcDb[_0xb84a('0xa7')](ut[_0xb84a('0xa8')](_0x5eced1,_0xb84a('0x9c'),_0x57b784[_0xb84a('0xa9')]),_0x5eced1['unlockAgent'],_0x5eced1[_0xb84a('0xaa')]);}}delete this['actions'][_0xedd11[_0xb84a('0xab')]];break;case'ANSWER':var _0x381169=moment()[_0xb84a('0x61')](_0xb84a('0x8d'));_0x5eced1['responsetime']=_0x381169;_0x5eced1[_0xb84a('0xac')]=_0x381169;_0x5eced1[_0xb84a('0x7c')]=!![];_0x57b784[_0xb84a('0x2f')]+=0x1;logger[_0xb84a('0x60')](_0xb84a('0xad'),_0x5eced1['uniqueid'],_0xb84a('0xae'),_0x57b784[_0xb84a('0x2a')],_0xb84a('0xaf'),_0x57b784['pTalking']);ami[_0xb84a('0x28')]('custom:agentconnect',ut['buildObj'](_0x5eced1,_0xb84a('0xb0'),this[_0xb84a('0x12')][_0x5eced1[_0xb84a('0x74')]]));if(_0x57b784[_0xb84a('0xb1')]){ami[_0xb84a('0x28')](_0xb84a('0xb2'),ut[_0xb84a('0xb3')](_0x5eced1));}break;case'16':ami[_0xb84a('0x28')](_0xb84a('0xb4'),ut[_0xb84a('0xa0')](_0x5eced1,_0xb84a('0xb5'),this[_0xb84a('0x12')][_0x5eced1[_0xb84a('0x74')]]));emitVoiceQueueChannelRemove(ut[_0xb84a('0xa0')](_0x5eced1,_0xb84a('0xb5')));_0x57b784[_0xb84a('0x41')]+=0x1;_0x57b784[_0xb84a('0x34')]+=0x1;_0x57b784[_0xb84a('0x2c')]+=0x1;ut['decrementTalkink'](_0x57b784,_0xb84a('0xb6'));_0x5eced1[_0xb84a('0x9d')]=ut['totalGlobal'](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x4,'Answer');rpcDb[_0xb84a('0x92')](_0x5eced1,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xb84a('0x96')](_0x5eced1,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x5eced1);_0x57b784[_0xb84a('0x31')]+=_0x5eced1[_0xb84a('0xb7')];_0x57b784['sumBillable']+=_0x5eced1[_0xb84a('0xb7')];logger[_0xb84a('0x60')](_0xb84a('0xb8'),_0x5eced1[_0xb84a('0xb9')],_0xb84a('0xae'),_0x57b784['name'],_0xb84a('0xaf'),_0x57b784[_0xb84a('0x2f')]);delete this[_0xb84a('0x15')][_0xedd11[_0xb84a('0xab')]];break;case'BUSY':_0x57b784[_0xb84a('0xba')]+=0x1;_0x5eced1['countbusyretry']+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x5,_0xb84a('0xbb'));ami[_0xb84a('0x28')](_0xb84a('0xbc'),ut['buildObj'](_0x5eced1,'busy'));rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xbd'));if(ut['totalGlobal'](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut['cloneAction'](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb['createCustomerFinal'](_0x55fabf,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5eced1[_0xb84a('0xbf')]>=_0x57b784[_0xb84a('0xc0')]){rpcDb[_0xb84a('0x96')](_0x5eced1,_0xb84a('0xbd'));}else{rpcDb[_0xb84a('0xa7')](ut['scheduledAt'](_0x5eced1,'countbusyretry',_0x57b784[_0xb84a('0xc1')]),_0x5eced1[_0xb84a('0xc2')],_0x5eced1['activeContact']);}}break;case _0xb84a('0xc3'):_0x57b784[_0xb84a('0x45')]+=0x1;_0x5eced1[_0xb84a('0xc4')]+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut['totalGlobal'](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x3,'NoAnswer');ami[_0xb84a('0x28')](_0xb84a('0xc5'),ut[_0xb84a('0xa0')](_0x5eced1,_0xb84a('0xc6')));rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xc7'));if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut[_0xb84a('0xa3')](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb[_0xb84a('0x96')](_0x55fabf,_0xb84a('0xc8'));}else{if(_0x5eced1['countnoanswerretry']>=_0x57b784[_0xb84a('0xc9')]){rpcDb[_0xb84a('0x96')](_0x5eced1,_0xb84a('0xc7'));}else{rpcDb[_0xb84a('0xa7')](ut[_0xb84a('0xa8')](_0x5eced1,_0xb84a('0xc4'),_0x57b784[_0xb84a('0xca')]),_0x5eced1['unlockAgent'],_0x5eced1[_0xb84a('0xaa')]);}}break;case _0xb84a('0xcb'):_0x57b784[_0xb84a('0x42')]+=0x1;_0x5eced1[_0xb84a('0xcc')]+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x8,'Congestion');ami[_0xb84a('0x28')](_0xb84a('0xcd'),ut[_0xb84a('0xa0')](_0x5eced1,_0xb84a('0xce')));rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xcf'));if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut[_0xb84a('0xa3')](_0x5eced1,0xf,'Global');rpcDb[_0xb84a('0x96')](_0x55fabf,_0xb84a('0xd0'));}else{if(_0x5eced1[_0xb84a('0xcc')]>=_0x57b784[_0xb84a('0xd1')]){rpcDb['createCustomerFinal'](_0x5eced1,_0xb84a('0xcf'));}else{rpcDb[_0xb84a('0xa7')](ut[_0xb84a('0xa8')](_0x5eced1,_0xb84a('0xcc'),_0x57b784['dialBusyRetryFrequency']),_0x5eced1[_0xb84a('0xc2')],_0x5eced1['activeContact']);}}break;case'CANCEL':_0x57b784[_0xb84a('0x47')]+=0x1;_0x5eced1['countagentrejectretry']+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut['logCustomer'](_0x5eced1,0x14,_0xb84a('0xd2'));ami['emit'](_0xb84a('0xd3'),ut['buildObj'](_0x5eced1,_0xb84a('0xd4')));rpcDb[_0xb84a('0x92')](_0x5eced1,'[syncHangupRequest][logAgentReject]');if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut[_0xb84a('0xa3')](_0x5eced1,0x14,_0xb84a('0xd2'));rpcDb['createCustomerFinal'](_0x55fabf,_0xb84a('0xd5'));}else{if(_0x5eced1[_0xb84a('0xd6')]>=_0x57b784[_0xb84a('0xd7')]){rpcDb[_0xb84a('0x96')](_0x5eced1,_0xb84a('0xd5'));}else{rpcDb[_0xb84a('0xa7')](ut[_0xb84a('0xa8')](_0x5eced1,_0xb84a('0xd6'),_0x57b784[_0xb84a('0xd8')]),_0x5eced1[_0xb84a('0xc2')],_0x5eced1[_0xb84a('0xaa')]);}}break;case _0xb84a('0xd9'):_0x57b784[_0xb84a('0x48')]+=0x1;_0x5eced1[_0xb84a('0xda')]+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0xb,'Abandoned');rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xdb'));if(ut['totalGlobal'](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut['cloneAction'](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb['createCustomerFinal'](_0x55fabf,_0xb84a('0xdb'));}else{if(_0x5eced1['countabandonedetry']>=_0x57b784['dialAbandonedMaxRety']){rpcDb[_0xb84a('0x96')](_0x5eced1,_0xb84a('0xdb'));}else{rpcDb[_0xb84a('0xa7')](ut[_0xb84a('0xa8')](_0x5eced1,_0xb84a('0xda'),_0x57b784[_0xb84a('0xdc')]),_0x5eced1[_0xb84a('0xc2')],_0x5eced1['activeContact']);}}break;case'18':_0x57b784[_0xb84a('0xdd')]+=0x1;_0x5eced1['countmachineretry']+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x12,_0xedd11[_0xb84a('0xde')]||_0xedd11['dialstatus']);ami['emit'](_0xb84a('0xdf'),ut['buildObj'](_0x5eced1,_0xb84a('0xe0')));rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xe1'));if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut['cloneAction'](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb['createCustomerFinal'](_0x55fabf,_0xb84a('0xe1'));}else{rpcDb[_0xb84a('0x96')](_0x5eced1,_0xb84a('0xe1'));}delete this[_0xb84a('0x15')][_0xedd11[_0xb84a('0xab')]];break;case'19':_0x57b784['outboundUnknownCallsDay']+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0x13,_0xedd11[_0xb84a('0xde')]||_0xedd11[_0xb84a('0xe2')]);ami[_0xb84a('0x28')]('custom:amd',ut[_0xb84a('0xa0')](_0x5eced1,'amd'));rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xe3'));if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut[_0xb84a('0xa3')](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb['createCustomerFinal'](_0x55fabf,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x5eced1,_0xb84a('0xe3'));}delete this[_0xb84a('0x15')][_0xedd11[_0xb84a('0xab')]];break;default:if(_0x5eced1['dialAnswer']){ut['decrementTalkink'](_0x57b784,_0xb84a('0xe4'));ut[_0xb84a('0xe5')](_0xb84a('0xe6')+_0x57b784[_0xb84a('0x2a')],_0xedd11);}_0x57b784[_0xb84a('0xdd')]+=0x1;_0x5eced1[_0xb84a('0x9d')]=ut[_0xb84a('0x9e')](_0x5eced1);ut[_0xb84a('0x94')](_0x5eced1,0xc,_0xedd11[_0xb84a('0xde')]||_0xedd11[_0xb84a('0xe2')]);rpcDb[_0xb84a('0x92')](_0x5eced1,_0xb84a('0xe7'));if(ut[_0xb84a('0x9e')](_0x5eced1)>=_0x57b784[_0xb84a('0xbe')]){_0x55fabf=ut[_0xb84a('0xa3')](_0x5eced1,0xf,_0xb84a('0xa4'));rpcDb[_0xb84a('0x96')](_0x55fabf,_0xb84a('0xe8'));}else{rpcDb[_0xb84a('0x96')](_0x5eced1,_0xb84a('0xe8'));}delete this[_0xb84a('0x15')][_0xedd11[_0xb84a('0xab')]];}if(!(_0x5eced1[_0xb84a('0x7c')]&&_0x4cea27==='16')){ut['updateOriginated'](_0x57b784,_0xb84a('0xe9'));logger['info'](_0xb84a('0xea'),_0x5eced1[_0xb84a('0xb9')],'\x20Queue',_0x57b784[_0xb84a('0x2a')],_0xb84a('0xeb'),_0x57b784[_0xb84a('0xec')]);}if(_0x4cea27!==_0xb84a('0xed')){delete this[_0xb84a('0x15')][_0xedd11['linkedid']];delete this[_0xb84a('0x15')][_0xedd11['destlinkedid']];}}};Preview[_0xb84a('0xe')]['callProgressDetectingAgent']=function(_0x102ed2,_0x592d57,_0x31f6f2){if(_[_0xb84a('0xee')](_0x592d57)&&'object'!==typeof _0x592d57){return;}if(_[_0xb84a('0xee')](_0x31f6f2)&&_0xb84a('0xef')!==typeof _0x31f6f2){return;}switch(_0x31f6f2['reason']){case'0':ut['logAgent'](_0x102ed2,0x0,_0xb84a('0xf0'));rpcDb[_0xb84a('0xf1')](_0x102ed2,_0xb84a('0xf2'));break;case'3':ut[_0xb84a('0xf3')](_0x102ed2,0x3,_0xb84a('0xf4'));rpcDb['createAgentHistory'](_0x102ed2,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb84a('0xf3')](_0x102ed2,0x5,'Busy');rpcDb[_0xb84a('0xf1')](_0x102ed2,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xb84a('0xf3')](_0x102ed2,0x8,_0xb84a('0xf5'));rpcDb[_0xb84a('0xf1')](_0x102ed2,_0xb84a('0xf6'));break;case'22':ut[_0xb84a('0xf3')](_0x102ed2,0x16,_0xb84a('0xf7'));rpcDb[_0xb84a('0xf1')](_0x102ed2,_0xb84a('0xf8'));break;default:ut[_0xb84a('0xf3')](_0x102ed2,0xc,_0x31f6f2['reason']);rpcDb[_0xb84a('0xf1')](_0x102ed2,_0xb84a('0xf6'));}ut[_0xb84a('0xf9')](_0x592d57,'[callProgressDetectingAgent]');logger[_0xb84a('0x60')]('[originated][decrement][callProgressDetectingAgent]',_0x102ed2[_0xb84a('0xb9')],_0xb84a('0xae'),_0x592d57[_0xb84a('0x2a')],_0xb84a('0xeb'),_0x592d57[_0xb84a('0xec')]);delete this[_0xb84a('0x15')][_0x102ed2[_0xb84a('0xb9')]];};Preview['prototype'][_0xb84a('0xfa')]=function(_0xcb0995,_0x4f10a9,_0x5d1cf5,_0x3e433a,_0x185cc9){var _0x3fb0f3=this;return new BPromise(function(_0x328328,_0x15725d){if(_[_0xb84a('0x72')](_0x4f10a9)||_[_0xb84a('0x72')](_0x4f10a9[_0xb84a('0xfb')])||_[_0xb84a('0x72')](_0x4f10a9[_0xb84a('0xfb')][_0xb84a('0xfc')])||_[_0xb84a('0x72')](_0x4f10a9[_0xb84a('0x76')])){_0x15725d(ut[_0xb84a('0x52')](_0xb84a('0xfd'),_0x3e433a,_0x185cc9));return;}var _0x29773a=uuid['v4']();var _0x1a0bd0=_0x3fb0f3[_0xb84a('0x12')][_0x4f10a9[_0xb84a('0x73')][_0xb84a('0x2a')]];var _0x5a4d19=_0x5d1cf5?_0x3fb0f3[_0xb84a('0x16')][_0x5d1cf5]['id']:undefined;_0x3fb0f3['actions'][_0x29773a]=new Action(_0x4f10a9,_0x1a0bd0,_0x29773a,_0x5d1cf5,_0x5a4d19);var _0x1e54cb=_0x3fb0f3[_0xb84a('0x15')][_0x29773a];_0x1e54cb[_0xb84a('0xc2')]=_0x3e433a;_0x1e54cb[_0xb84a('0xaa')]=_0x185cc9;_0x1e54cb[_0xb84a('0xfe')]=_0x5d1cf5;if(_[_0xb84a('0xff')](_0xcb0995)){_0x3fb0f3[_0xb84a('0x100')](_0x1e54cb,_0x1a0bd0,_0x4f10a9,_0x5d1cf5)[_0xb84a('0x87')](function(_0x5db04b){logger[_0xb84a('0x60')](_0xb84a('0x101'),'Queue:\x20'+_0x1e54cb[_0xb84a('0x74')]+_0xb84a('0x102')+_0x1e54cb[_0xb84a('0x103')],JSON[_0xb84a('0x5c')](_0x5db04b));ami['emit'](_0xb84a('0x104'),ut[_0xb84a('0xa0')](_0x1e54cb,_0xb84a('0x105'),_0x3fb0f3[_0xb84a('0x12')][_0x1e54cb[_0xb84a('0x74')]]));_0x328328(ut['message'](_0xb84a('0x106')));})[_0xb84a('0x89')](function(_0x5f424e){ut[_0xb84a('0x69')]('[Preview][execCall][failure]',_0x5f424e);_0x15725d(ut[_0xb84a('0x52')](_0xb84a('0x107'),_0x3e433a,_0x185cc9));});}else{_0x1a0bd0[_0xb84a('0x108')]+=0x1;ut[_0xb84a('0x109')](_0x1e54cb);rpcDb['createHistory'](_0x1e54cb,_0xb84a('0x10a'));delete _0x3fb0f3[_0xb84a('0x15')][_0x29773a];_0x15725d(ut['message']('Contact\x20in\x20black\x20List',_0x3e433a,_0x185cc9));}});};Preview['prototype'][_0xb84a('0x10b')]=function(_0x28e6ed){return!_['isNil'](_0x28e6ed)&&!_['isNil'](_0x28e6ed[_0xb84a('0x2a')])&&!_['isNil'](_0x28e6ed[_0xb84a('0x59')])&&_0x28e6ed[_0xb84a('0x59')]&&!_[_0xb84a('0x72')](this['trunks'][util['format'](_0xb84a('0x10c'),_0x28e6ed['name'])])&&!_[_0xb84a('0x72')](this[_0xb84a('0x14')][util[_0xb84a('0x61')](_0xb84a('0x10c'),_0x28e6ed[_0xb84a('0x2a')])][_0xb84a('0x79')])&&(this['trunks'][util[_0xb84a('0x61')](_0xb84a('0x10c'),_0x28e6ed[_0xb84a('0x2a')])][_0xb84a('0x79')]===_0xb84a('0x10d')||this[_0xb84a('0x14')][util[_0xb84a('0x61')](_0xb84a('0x10c'),_0x28e6ed[_0xb84a('0x2a')])][_0xb84a('0x79')]===_0xb84a('0x10e'));};Preview[_0xb84a('0xe')][_0xb84a('0x86')]=function(_0x28e81a,_0x1c47c8){var _0x552325=this;return new BPromise(function(_0x32bad3,_0x1d9f50){_0x552325[_0xb84a('0x10f')](_0x28e81a,_0x1c47c8)[_0xb84a('0x87')](function(_0x87df65){_0x32bad3(_['pick'](_0x87df65,['message']));})['catch'](function(_0x1ea81c){if(_0x1ea81c[_0xb84a('0x110')]){rpcDb[_0xb84a('0x111')](_0x28e81a);}if(_0x1ea81c['active']){rpcDb['disableContact'](_0x28e81a);}_0x1d9f50(_[_0xb84a('0x112')](_0x1ea81c,[_0xb84a('0x52')]));});});};Preview['prototype'][_0xb84a('0x10f')]=function(_0x3cca20,_0x25a231){var _0xe168fc=this;return new BPromise(function(_0x59ef73,_0x1dfc2a){var _0x57442c,_0x4c2c7f;rpcDb[_0xb84a('0x113')](_0x3cca20)[_0xb84a('0x87')](function(_0x10c6c3){if(!_[_0xb84a('0x72')](_0x10c6c3[0x0])){_0x4c2c7f=_0x10c6c3[0x0][_0xb84a('0x114')]?![]:!![];_0x57442c=_0x10c6c3[0x0][_0xb84a('0x114')]?!![]:![];_0x57442c=_0x25a231?!![]:_0x57442c;}var _0x1bb36c=_0xe168fc[_0xb84a('0x115')](_0x10c6c3);if(_0x1bb36c[_0xb84a('0x116')]){rpcDb[_0xb84a('0x117')](_[_0xb84a('0x112')](_0x10c6c3[0x0],[_0xb84a('0x76'),_0xb84a('0x118')]))[_0xb84a('0x87')](function(_0x553df7){_0xe168fc[_0xb84a('0xfa')](_0x553df7,_0x10c6c3[0x0],_0x25a231,_0x4c2c7f,_0x57442c)[_0xb84a('0x87')](function(_0x32a70c){_0x59ef73(_0x32a70c);})[_0xb84a('0x89')](function(_0x3667f2){_0x1dfc2a(_0x3667f2);});})[_0xb84a('0x89')](function(_0x33ec5d){ut[_0xb84a('0x69')](_0xb84a('0x119'),_0x33ec5d);_0x1dfc2a(ut['message'](_0xb84a('0x11a'),_0x4c2c7f,_0x57442c));});}else{_0x1dfc2a(ut[_0xb84a('0x52')](_0x1bb36c['message'],_0x4c2c7f,_0x57442c));}})['catch'](function(_0x24e3fb){ut[_0xb84a('0x69')](_0xb84a('0x11b'),_0x24e3fb);_0x1dfc2a(ut[_0xb84a('0x52')](_0xb84a('0x11a'),![],!![]));});});};Preview[_0xb84a('0xe')]['validateContact']=function(_0x4167d){if(_[_0xb84a('0x72')](_0x4167d)||_[_0xb84a('0xff')](_0x4167d)||!_[_0xb84a('0x72')](_0x4167d[0x0][_0xb84a('0x85')])&&_[_0xb84a('0x72')](_0x4167d[0x0][_0xb84a('0x85')][_0xb84a('0x2a')])){ut[_0xb84a('0x69')]('[Preview][validateContact][Empty\x20Contact]',_0x4167d);return{'isValid':![],'message':_0xb84a('0x11c')};}var _0x3d1fa0=this[_0xb84a('0x12')][_0x4167d[0x0][_0xb84a('0x73')][_0xb84a('0x2a')]];_0x3d1fa0[_0xb84a('0x52')]='ACTIVE';if(_['isNil'](_0x3d1fa0)){ut[_0xb84a('0x69')](_0xb84a('0x11d'),_0x3d1fa0);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xb84a('0x10b')](_0x3d1fa0['Trunk'])){ut[_0xb84a('0x69')](_0xb84a('0x11e'),_0xb84a('0x11f')+_0x3d1fa0[_0xb84a('0x2a')]+_0xb84a('0x120'));if(!this['isTrunkReachable'](_0x3d1fa0[_0xb84a('0x121')])){ut[_0xb84a('0x69')](_0xb84a('0x11e'),_0x3d1fa0[_0xb84a('0x2a')]+_0xb84a('0x122'));return{'isValid':![],'message':_0xb84a('0x123')};}}if(!ut[_0xb84a('0x98')](_0x3d1fa0['dialActive'])){ut[_0xb84a('0x69')]('[Preview][validateContact][Campaign\x20Active]',_0x3d1fa0[_0xb84a('0x2a')]+_0xb84a('0x124'));return{'isValid':![],'message':_0xb84a('0x11f')+_0x3d1fa0[_0xb84a('0x2a')]+_0xb84a('0x124')};}return{'isValid':!![],'message':_0xb84a('0x125')};};Preview[_0xb84a('0xe')][_0xb84a('0x100')]=function(_0x3d8db1,_0x5e84b4,_0x283a05,_0xf31cc5){var _0x306184=this;return new BPromise(function(_0x51bee0,_0x5a5c01){var _0xe599eb=_0x3d8db1[_0xb84a('0xb9')];var _0x57ac60=_0x306184[_0xb84a('0x10b')](_0x5e84b4[_0xb84a('0x58')])?util[_0xb84a('0x61')](_0xb84a('0x126'),_0x5e84b4['Trunk'][_0xb84a('0x2a')],_[_0xb84a('0x72')](_0x5e84b4[_0xb84a('0x3f')])?'':_0x5e84b4[_0xb84a('0x3f')][_0xb84a('0x127')]()||'',_0x5e84b4[_0xb84a('0x128')]>0x0?_0x283a05[_0xb84a('0xfb')][_0xb84a('0xfc')]['substring'](_0x5e84b4['dialCutDigit']):_0x283a05[_0xb84a('0xfb')][_0xb84a('0xfc')]):util[_0xb84a('0x61')]('SIP/%s/%s%s',_[_0xb84a('0x72')](_0x5e84b4['TrunkBackup'])?_0x5e84b4[_0xb84a('0x58')]['name']:_0x5e84b4[_0xb84a('0x121')][_0xb84a('0x2a')],_['isNil'](_0x5e84b4[_0xb84a('0x3f')])?'':_0x5e84b4[_0xb84a('0x3f')][_0xb84a('0x127')]()||'',_0x5e84b4[_0xb84a('0x128')]>0x0?_0x283a05[_0xb84a('0xfb')][_0xb84a('0xfc')]['substring'](_0x5e84b4[_0xb84a('0x128')]):_0x283a05[_0xb84a('0xfb')]['phone']);var _0x519f63=_0x306184[_0xb84a('0x10b')](_0x5e84b4['Trunk'])?ut[_0xb84a('0x129')](_0x5e84b4[_0xb84a('0x58')]['callerid'],_0x5e84b4[_0xb84a('0x3c')],_0x5e84b4[_0xb84a('0x12a')]>0x0?ut[_0xb84a('0x12b')](_0x5e84b4[_0xb84a('0x3d')],_0x5e84b4[_0xb84a('0x12a')]):_0x5e84b4['dialOriginateCallerIdNumber']):ut['getCallerId'](_['isNil'](_0x5e84b4[_0xb84a('0x121')])?_0x5e84b4['Trunk'][_0xb84a('0x5a')]:_0x5e84b4[_0xb84a('0x121')][_0xb84a('0x5a')],_0x5e84b4[_0xb84a('0x3c')],_0x5e84b4[_0xb84a('0x12a')]>0x0?ut[_0xb84a('0x12b')](_0x5e84b4[_0xb84a('0x3d')],_0x5e84b4[_0xb84a('0x12a')]):_0x5e84b4[_0xb84a('0x3d')]);if(_0x519f63){_0x3d8db1['originatecalleridname']=ut[_0xb84a('0x12c')](_0x519f63);_0x3d8db1[_0xb84a('0x12d')]=ut[_0xb84a('0x12e')](_0x519f63);}var _0x8b1ea=ut[_0xb84a('0x12f')](_0x5e84b4,_0x283a05,_0x57ac60,_0x519f63,_0xe599eb,_0x3d8db1);_['merge'](_0x3d8db1,ut[_0xb84a('0x130')](_0x8b1ea));_0x3d8db1[_0xb84a('0x8c')]=moment()[_0xb84a('0x61')](_0xb84a('0x8d'));ami['Action'](ut['variablesAction'](_0x3d8db1,_0x5e84b4,_0x8b1ea,_0x3d8db1['activeContact'],_0xf31cc5))[_0xb84a('0x87')](function(_0x66c0a4){_0x5e84b4[_0xb84a('0xec')]+=0x1;logger[_0xb84a('0x60')](_0xb84a('0x131'),_0xe599eb,_0xb84a('0xae'),_0x5e84b4[_0xb84a('0x2a')],'originated:\x20',_0x5e84b4[_0xb84a('0xec')]);_0x51bee0(_0x66c0a4);})['catch'](function(_0x776aa3){ut[_0xb84a('0xf3')](_0x3d8db1,0xe,'OriginateError');rpcDb[_0xb84a('0xf1')](_0x3d8db1,'[originateFailure][logOriginateFailure]');_0x5a5c01(_0x776aa3);});});};Preview[_0xb84a('0xe')][_0xb84a('0x21')]=function(_0x171c1a){if(this[_0xb84a('0x15')][_0x171c1a[_0xb84a('0xab')]]){this[_0xb84a('0x15')][_0x171c1a[_0xb84a('0xab')]][_0xb84a('0x7a')]=_0x171c1a[_0xb84a('0x7a')];}};Preview['prototype'][_0xb84a('0x19')]=function(_0x3e9e4e){var _0x45fdb3=this;var _0x5557c4=this['actions'][_0x3e9e4e[_0xb84a('0x132')]];if(_0x5557c4){if(_0x5557c4[_0xb84a('0xfe')]&&this['agents'][_0x5557c4['lookAgent']]){ut[_0xb84a('0x133')](_0x5557c4,this[_0xb84a('0x16')][_0x5557c4['lookAgent']]['name'],this['agents'][_0x5557c4['lookAgent']]['id']);}var _0xa91c0d=_[_0xb84a('0x134')](_0x5557c4);_0xa91c0d['responsetime']=moment()[_0xb84a('0x61')](_0xb84a('0x8d'));var _0x1a1fbf=_0x45fdb3[_0xb84a('0x12')][_0x5557c4[_0xb84a('0x74')]];if(ut[_0xb84a('0x135')](_0x3e9e4e[_0xb84a('0x136')])){if(_0x5557c4['unlockAgent']){rpcDb[_0xb84a('0x111')](_0x5557c4['idContact']);}if(_0x5557c4[_0xb84a('0xaa')]){rpcDb['disableContact'](_0x5557c4[_0xb84a('0x103')]);}ami['emit']('custom:agentringnoanswer',ut[_0xb84a('0xa0')](_0x5557c4,_0xb84a('0x137'),this[_0xb84a('0x12')][_0x5557c4[_0xb84a('0x74')]]));this[_0xb84a('0x138')](_0xa91c0d,_0x1a1fbf,_0x3e9e4e);}else{_0x5557c4[_0xb84a('0x8c')]=moment()['format'](_0xb84a('0x8d'));ut[_0xb84a('0xf3')](_0xa91c0d,0x4,'Answer');rpcDb['createAgentHistory'](_0xa91c0d,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype']['syncHangup']=function(_0x40bbeb){var _0x22cfb0=this;var _0x39dffe=this[_0xb84a('0x15')][_0x40bbeb[_0xb84a('0xab')]];var _0x110faa;if(_0x39dffe){_0x110faa=this[_0xb84a('0x12')][_0x39dffe['queue']];logger[_0xb84a('0x60')](_0xb84a('0x139'),_0x40bbeb[_0xb84a('0xab')],_0xb84a('0xae'),_0x110faa['name'],_0xb84a('0xaf'),_0x110faa[_0xb84a('0x2f')]);}if(this[_0xb84a('0x15')][_0x40bbeb[_0xb84a('0xab')]]&&_0x40bbeb['linkedid']!==_0x40bbeb['uniqueid']){if(_0x40bbeb['cause']==='16'&&this[_0xb84a('0x15')][_0x40bbeb['linkedid']][_0xb84a('0x7c')]){this[_0xb84a('0x9b')](_0x40bbeb,_0x40bbeb[_0xb84a('0xab')],_0x40bbeb[_0xb84a('0x13a')]);}else if(this[_0xb84a('0x15')][_0x40bbeb[_0xb84a('0xab')]][_0xb84a('0x7c')]){logger[_0xb84a('0x60')](_0xb84a('0x13b'),_0x40bbeb[_0xb84a('0xab')],_0x40bbeb[_0xb84a('0x13a')],_0xb84a('0xae'),_0x110faa[_0xb84a('0x2a')],'pTalking:\x20',_0x110faa[_0xb84a('0x2f')]);this['callProgressDetectingCustomer'](_0x40bbeb,_0x40bbeb[_0xb84a('0xab')],_0x40bbeb[_0xb84a('0x13a')]);}}else if(_0x39dffe&&_['isNil'](_0x39dffe[_0xb84a('0x13c')])&&_0x110faa[_0xb84a('0x13d')]&&_0x40bbeb['linkedid']===_0x40bbeb[_0xb84a('0xb9')]&&_[_0xb84a('0x72')](_0x40bbeb[_0xb84a('0x13e')])&&_0x40bbeb[_0xb84a('0x13a')]==='16'&&_0x40bbeb[_0xb84a('0x13f')]==='6'&&_[_0xb84a('0xee')](_0x39dffe[_0xb84a('0x140')])){if(_0x39dffe['unlockAgent']){rpcDb[_0xb84a('0x111')](_0x39dffe[_0xb84a('0x103')]);}if(_0x39dffe[_0xb84a('0xaa')]){rpcDb[_0xb84a('0x8b')](_0x39dffe[_0xb84a('0x103')]);}_0x40bbeb[_0xb84a('0x13e')]='22';this[_0xb84a('0x138')](_0x39dffe,_0x110faa,_0x40bbeb);}else if(_0x39dffe&&_0x39dffe[_0xb84a('0x140')]){if(_0x40bbeb[_0xb84a('0x13a')]==='16'&&this[_0xb84a('0x15')][_0x40bbeb[_0xb84a('0xab')]][_0xb84a('0x7c')]){logger[_0xb84a('0x60')](_0xb84a('0x141'),_0x40bbeb[_0xb84a('0xab')],_0x40bbeb['cause'],_0xb84a('0xae'),_0x110faa[_0xb84a('0x2a')],_0xb84a('0xaf'),_0x110faa['pTalking']);this['callProgressDetectingCustomer'](_0x40bbeb,_0x40bbeb['linkedid'],_0x40bbeb[_0xb84a('0x13a')]);}else if(this[_0xb84a('0x15')][_0x40bbeb[_0xb84a('0xab')]][_0xb84a('0x7c')]){logger[_0xb84a('0x60')](_0xb84a('0x13b'),_0x40bbeb[_0xb84a('0xab')],_0x40bbeb[_0xb84a('0x13a')],_0xb84a('0xae'),_0x110faa[_0xb84a('0x2a')],_0xb84a('0xaf'),_0x110faa['pTalking']);this[_0xb84a('0x9b')](_0x40bbeb,_0x40bbeb['linkedid'],_0x40bbeb['cause']);}}};Preview[_0xb84a('0xe')]['syncDialEnd']=function(_0x1dda6d){if(this['actions'][_0x1dda6d[_0xb84a('0x142')]]&&_0x1dda6d[_0xb84a('0x142')]!==_0x1dda6d[_0xb84a('0x143')]){this['callProgressDetectingCustomer'](_0x1dda6d,_0x1dda6d[_0xb84a('0x142')],_0x1dda6d[_0xb84a('0xe2')]);}};Preview[_0xb84a('0xe')][_0xb84a('0x144')]=function(_0x2f29a5){if(this['actions'][_0x2f29a5[_0xb84a('0xab')]]&&_0x2f29a5[_0xb84a('0xab')]!==_0x2f29a5[_0xb84a('0xb9')]&&!this[_0xb84a('0x15')][_0x2f29a5[_0xb84a('0xab')]]['dialAnswer']){if(_0x2f29a5[_0xb84a('0x13a')]==='1'){this[_0xb84a('0x9b')](_0x2f29a5,_0x2f29a5['linkedid'],_0x2f29a5['cause']);}}};Preview[_0xb84a('0xe')]['addVariable']=function(_0x3ab10f,_0x37f143,_0x2eeaaa){if(this[_0xb84a('0x15')][_0x3ab10f]){if(_[_0xb84a('0x72')](this['actions'][_0x3ab10f][_0xb84a('0x145')])){this['actions'][_0x3ab10f][_0xb84a('0x145')]={};}this[_0xb84a('0x15')][_0x3ab10f]['variables'][_0x37f143]=_0x2eeaaa;}};Preview[_0xb84a('0xe')][_0xb84a('0x23')]=function(_0x33fb1d){try{if(!_[_0xb84a('0x72')](_0x33fb1d)){if(ut[_0xb84a('0x146')](_['keys'](_0x33fb1d[_0xb84a('0x147')])[0x0])){this[_0xb84a('0x148')](_0x33fb1d['uniqueid'],_[_0xb84a('0x149')](_0x33fb1d[_0xb84a('0x147')])[0x0],_0x33fb1d[_0xb84a('0x14a')]);}}}catch(_0xe1562a){logger[_0xb84a('0x14b')](_0xb84a('0x14c'),util[_0xb84a('0x14d')](_0xe1562a,{'showHidden':![],'depth':null}));}};Preview[_0xb84a('0xe')]['syncAttendedTransfer']=function(_0x51a820){if(_0x51a820){if(this['actions'][_0x51a820[_0xb84a('0x14e')]]){this[_0xb84a('0x15')][_0x51a820[_0xb84a('0x14e')]][_0xb84a('0x140')]=!![];}}};Preview[_0xb84a('0xe')][_0xb84a('0x14f')]=function(_0x736f32){if(_0x736f32){if(this[_0xb84a('0x15')][_0x736f32[_0xb84a('0x150')]]){this[_0xb84a('0x15')][_0x736f32[_0xb84a('0x150')]][_0xb84a('0x140')]=!![];}}};module[_0xb84a('0x151')]=Preview; \ No newline at end of file +var _0xb138=['dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','activeContact','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','checkInBlack','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','unlockContact','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','clearZombieChannel','isNil','actions','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','stringify','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','sendMessageOneNotActive','IsNotLoggedIn','isActive','dialActive','isTrunkReachable','ACTIVE','countnosuchnumberretry','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]'];(function(_0x49b61f,_0x2f6d88){var _0x2d1558=function(_0xe9bc95){while(--_0xe9bc95){_0x49b61f['push'](_0x49b61f['shift']());}};_0x2d1558(++_0x2f6d88);}(_0xb138,0x1dd));var _0x8b13=function(_0x42b321,_0x28fbcc){_0x42b321=_0x42b321-0x0;var _0x1e7672=_0xb138[_0x42b321];return _0x1e7672;};'use strict';var util=require(_0x8b13('0x0'));var _=require(_0x8b13('0x1'));var BPromise=require(_0x8b13('0x2'));var uuid=require(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var md5=require(_0x8b13('0x5'));var Redis=require(_0x8b13('0x6'));var config=require('../../../config/environment');var logger=require(_0x8b13('0x7'))(_0x8b13('0x8'));var loggerAction=require(_0x8b13('0x7'))('actionPreview');var ami=require(_0x8b13('0x9'));var rpcDb=require(_0x8b13('0xa'));var Action=require('./action');var ut=require(_0x8b13('0xb'));config[_0x8b13('0xc')]=_[_0x8b13('0xd')](config['redis'],{'host':_0x8b13('0xe'),'port':0x18eb});var io=require(_0x8b13('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x8b13('0x10')]=function(_0x21fcd9){this[_0x8b13('0x11')]=this[_0x8b13('0x11')]?this[_0x8b13('0x11')]['finally'](_0x21fcd9):_0x21fcd9();};function Preview(_0x11bc89){this[_0x8b13('0x12')]=new Sequence();this[_0x8b13('0x13')]=_0x11bc89[_0x8b13('0x14')];this[_0x8b13('0x15')]=_0x11bc89[_0x8b13('0x15')];this['actions']={};this['agents']=_0x11bc89[_0x8b13('0x16')];this[_0x8b13('0x17')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0x8b13('0x18'),this[_0x8b13('0x19')][_0x8b13('0x1a')](this));ami['on'](_0x8b13('0x1b'),this[_0x8b13('0x1c')]['bind'](this));ami['on'](_0x8b13('0x1d'),this[_0x8b13('0x1e')][_0x8b13('0x1a')](this));ami['on'](_0x8b13('0x1f'),this[_0x8b13('0x20')][_0x8b13('0x1a')](this));ami['on'](_0x8b13('0x21'),this[_0x8b13('0x22')]['bind'](this));ami['on']('attendedtransfer',this[_0x8b13('0x23')][_0x8b13('0x1a')](this));ami['on'](_0x8b13('0x24'),this[_0x8b13('0x25')][_0x8b13('0x1a')](this));this[_0x8b13('0x26')](this['campaignsPreview']);}function emit(_0x1e8a48,_0x3c4d4f,_0x1595d8){io['to'](_0x1e8a48)['emit'](_0x3c4d4f,_0x1595d8);}function emitCampaignPreview(_0x51dd1d){if(_0x51dd1d[_0x8b13('0x27')]===_0x8b13('0x28')){var _0x4f9902={'id':_0x51dd1d['id'],'name':_0x51dd1d[_0x8b13('0x29')],'strategy':_0x51dd1d[_0x8b13('0x2a')],'answered':_0x51dd1d[_0x8b13('0x2b')],'available':_0x51dd1d[_0x8b13('0x2c')],'loggedIn':_0x51dd1d[_0x8b13('0x2d')],'pTalking':_0x51dd1d['pTalking'],'sumBillable':_0x51dd1d[_0x8b13('0x2e')],'sumDuration':_0x51dd1d[_0x8b13('0x2f')],'sumHoldTime':_0x51dd1d['sumHoldTime']||0x0,'talking':_0x51dd1d[_0x8b13('0x30')],'total':_0x51dd1d['total'],'type':_0x51dd1d[_0x8b13('0x27')],'unmanaged':_0x51dd1d[_0x8b13('0x31')],'abandoned':_0x51dd1d['abandoned'],'waiting':_0x51dd1d[_0x8b13('0x32')],'loggedInDb':_0x51dd1d[_0x8b13('0x33')],'dialActive':_0x51dd1d['dialActive'],'dialMethod':_0x51dd1d[_0x8b13('0x34')],'dialOriginateCallerIdName':_0x51dd1d[_0x8b13('0x35')],'dialOriginateCallerIdNumber':_0x51dd1d[_0x8b13('0x36')],'dialOriginateTimeout':_0x51dd1d[_0x8b13('0x37')],'dialPrefix':_0x51dd1d[_0x8b13('0x38')],'outboundAnswerAgiCallsDay':_0x51dd1d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x51dd1d[_0x8b13('0x39')],'outboundBlacklistCallsDay':_0x51dd1d[_0x8b13('0x3a')],'outboundBusyCallsDay':_0x51dd1d[_0x8b13('0x3b')],'outboundCongestionCallsDay':_0x51dd1d[_0x8b13('0x3c')],'outboundDropCallsDayACS':_0x51dd1d[_0x8b13('0x3d')],'outboundDropCallsDayCallersExit':_0x51dd1d[_0x8b13('0x3e')],'outboundDropCallsDayTimeout':_0x51dd1d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x51dd1d[_0x8b13('0x3f')],'outboundNoSuchCallsDay':_0x51dd1d[_0x8b13('0x40')],'outboundOriginateFailureCallsDay':_0x51dd1d[_0x8b13('0x41')],'outboundReCallsDay':_0x51dd1d[_0x8b13('0x42')],'outboundRejectCallsDay':_0x51dd1d[_0x8b13('0x43')],'outboundUnknownCallsDay':_0x51dd1d[_0x8b13('0x44')],'outboundAbandonedCallsDay':_0x51dd1d[_0x8b13('0x45')],'predictiveIntervalAnsweredCalls':_0x51dd1d[_0x8b13('0x46')],'predictiveIntervalAvgHoldtime':_0x51dd1d[_0x8b13('0x47')],'predictiveIntervalAvgTalktime':_0x51dd1d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x51dd1d[_0x8b13('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x51dd1d[_0x8b13('0x49')],'predictiveIntervalErlangCalls':_0x51dd1d[_0x8b13('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x51dd1d[_0x8b13('0x4b')],'predictiveIntervalHitRate':_0x51dd1d['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x51dd1d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x51dd1d[_0x8b13('0x4c')],'predictiveIntervalAvailable':_0x51dd1d['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x51dd1d['predictiveIntervalTotalCalls'],'message':_0x51dd1d[_0x8b13('0x4d')],'originated':_0x51dd1d['originated'],'erlangCalls':_0x51dd1d[_0x8b13('0x4e')],'erlangCallToSecond':_0x51dd1d[_0x8b13('0x4f')],'erlangAbandonmentRate':_0x51dd1d[_0x8b13('0x50')],'erlangBusyFactor':_0x51dd1d[_0x8b13('0x51')],'startPredictive':_0x51dd1d[_0x8b13('0x52')],'startProgressive':_0x51dd1d[_0x8b13('0x53')]};if(_0x51dd1d[_0x8b13('0x54')]){_0x4f9902[_0x8b13('0x54')]={'id':_0x51dd1d[_0x8b13('0x54')]['id'],'name':_0x51dd1d[_0x8b13('0x54')]['name'],'active':_0x51dd1d[_0x8b13('0x54')][_0x8b13('0x55')],'callerid':_0x51dd1d[_0x8b13('0x54')][_0x8b13('0x56')]};}if(_0x51dd1d[_0x8b13('0x57')]){_0x4f9902[_0x8b13('0x57')]={'id':_0x51dd1d[_0x8b13('0x57')]['id'],'name':_0x51dd1d[_0x8b13('0x57')]['name']};}var _0x219bdf=md5(JSON['stringify'](_0x4f9902));if(_0x51dd1d[_0x8b13('0x5')]!==_0x219bdf){_0x51dd1d[_0x8b13('0x5')]=_0x219bdf;emit(util[_0x8b13('0x58')](_0x8b13('0x59'),_0x4f9902[_0x8b13('0x29')]),_0x8b13('0x5a'),_0x4f9902);}}}function emitVoiceQueueChannelRemove(_0x4ec1a5){logger['info'](_0x8b13('0x5b'),JSON['stringify'](_0x4ec1a5));emit(util[_0x8b13('0x58')]('voice:queue:%s',_0x4ec1a5[_0x8b13('0x29')]),_0x8b13('0x5c'),_0x4ec1a5);io[_0x8b13('0x5d')](_0x8b13('0x5e'),_0x4ec1a5);}function notSendMessagesQueue(_0x3a221d){if(_0x3a221d['sendMessageOneNotActive']){if(_0x3a221d['originated']===0x0&&_0x3a221d[_0x8b13('0x5f')]===0x0){_0x3a221d['sendMessageOneNotActive']=![];_0x3a221d[_0x8b13('0x2c')]=0x0;_0x3a221d[_0x8b13('0x60')]=0x0;_0x3a221d['message']=_0x8b13('0x61');ut[_0x8b13('0x62')](_0x8b13('0x63'),_0x3a221d[_0x8b13('0x29')]+_0x8b13('0x64'));}else{_0x3a221d[_0x8b13('0x4d')]=_0x8b13('0x65');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3a221d['name']+_0x8b13('0x66'));}emitCampaignPreview(_0x3a221d);}}Preview[_0x8b13('0x67')][_0x8b13('0x26')]=function(){var _0x3968bf=this;setInterval(function(){_0x3968bf[_0x8b13('0x68')]();},0x7cf);};Preview[_0x8b13('0x67')]['syncCampaigns']=function(){var _0x4342db=this['campaignsPreview'];this[_0x8b13('0x17')]+=0x1;for(var _0x5ce9c8 in _0x4342db){if(_0x4342db[_0x8b13('0x69')](_0x5ce9c8)&&(_0x4342db[_0x5ce9c8][_0x8b13('0x34')]===_0x8b13('0x8')||_0x4342db[_0x5ce9c8][_0x8b13('0x34')]===_0x8b13('0x6a'))&&_0x4342db[_0x5ce9c8][_0x8b13('0x27')]===_0x8b13('0x28')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x4342db[_0x8b13('0x69')](_0x5ce9c8)&&_0x4342db[_0x5ce9c8][_0x8b13('0x34')]===_0x8b13('0x8')&&_0x4342db[_0x5ce9c8][_0x8b13('0x27')]==='outbound'){if(_0x4342db[_0x5ce9c8]['dialActive']){this[_0x8b13('0x6b')](_0x4342db[_0x5ce9c8]);if(_0x4342db[_0x5ce9c8]['dialPreviewAutoRecallMe'])this[_0x8b13('0x6c')](_0x4342db[_0x5ce9c8]);}else{notSendMessagesQueue(_0x4342db[_0x5ce9c8]);}}}};Preview[_0x8b13('0x67')][_0x8b13('0x6d')]=function(_0x28ae75){var _0x46556f=this;this['sequence'][_0x8b13('0x10')](function(){if(!_[_0x8b13('0x6e')](_0x46556f[_0x8b13('0x6f')][_0x28ae75])){loggerAction[_0x8b13('0x70')](_0x8b13('0x71'),_0x28ae75,_0x8b13('0x72'),_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x73')],_0x8b13('0x74'),JSON['stringify'](_0x46556f[_0x8b13('0x13')][_0x46556f['actions'][_0x28ae75][_0x8b13('0x73')]][_0x8b13('0x75')]),_0x8b13('0x76'),JSON['stringify'](_0x46556f[_0x8b13('0x13')][_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x73')]][_0x8b13('0x5f')]),JSON[_0x8b13('0x77')](_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x78')]),JSON['stringify'](_[_0x8b13('0x79')](_0x46556f['actions'][_0x28ae75],[_0x8b13('0x7a'),_0x8b13('0x7b'),_0x8b13('0x7c'),_0x8b13('0x7d')])));return ami[_0x8b13('0x7e')]({'action':_0x8b13('0x7f'),'channel':_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x80')]})[_0x8b13('0x81')](function(_0xce98f7){if(_0xce98f7[_0x8b13('0x4d')]===_0x8b13('0x82')){setTimeout(function(){if(_0x46556f[_0x8b13('0x6f')][_0x28ae75]){ut[_0x8b13('0x83')](_0x46556f[_0x8b13('0x13')][_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x73')]],'[clearZombieChannel]');if(_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x78')]===!![]){ut['decrementTalkink'](_0x46556f[_0x8b13('0x13')][_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x73')]],_0x8b13('0x84'));ut[_0x8b13('0x85')](_0x8b13('0x86')+_0x28ae75,_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x73')]);}ut[_0x8b13('0x85')](_0x8b13('0x87')+_0x28ae75,_0x46556f[_0x8b13('0x6f')][_0x28ae75][_0x8b13('0x73')]);delete _0x46556f[_0x8b13('0x6f')][_0x28ae75];}},0x2328);}});}});};Preview[_0x8b13('0x67')][_0x8b13('0x88')]=function(){var _0x49e5f4=this;loggerAction[_0x8b13('0x70')](_0x8b13('0x89'),_['size'](this[_0x8b13('0x6f')]));for(var _0x73aba5 in this[_0x8b13('0x6f')]){if(_0x49e5f4[_0x8b13('0x6f')][_0x8b13('0x69')](_0x73aba5)){_0x49e5f4['clearZombieChannel'](_0x73aba5);}}};Preview[_0x8b13('0x67')][_0x8b13('0x6c')]=function(_0x46850a){var _0x52e2a6=this;rpcDb[_0x8b13('0x8a')](_0x46850a['id'],ut[_0x8b13('0x8b')](this['agents']))[_0x8b13('0x8c')](function(_0x348c11){if(!_[_0x8b13('0x6e')](_0x348c11)){for(var _0xd29067=0x0;_0xd29067<_0x348c11['length'];_0xd29067+=0x1){if(ut[_0x8b13('0x8d')](_0x348c11[_0xd29067][_0x8b13('0x8e')])<_0x46850a['dialRecallMeTimeout']*0x3c){if(_0x348c11[_0xd29067][_0x8b13('0x8f')]&&!_0x348c11[_0xd29067][_0x8b13('0x8f')][_0x8b13('0x90')]){_0x52e2a6[_0x8b13('0x91')](_0x348c11[_0xd29067]['id'])['then'](ut[_0x8b13('0x92')](_0x8b13('0x93')))[_0x8b13('0x81')](ut[_0x8b13('0x92')](_0x8b13('0x93')));}else{rpcDb[_0x8b13('0x94')](_0x348c11[_0xd29067]['id']);}}else{var _0x571e89=new Action(_0x348c11[_0xd29067],_0x46850a);_0x571e89[_0x8b13('0x95')]=moment()[_0x8b13('0x58')](_0x8b13('0x96'));_0x46850a['outboundReCallsDay']+=0x1;ut[_0x8b13('0x97')](_0x571e89,0x17,_0x8b13('0x98'));if(_0x46850a[_0x8b13('0x99')]){rpcDb[_0x8b13('0x9a')](ut['createBody'](_0x348c11[_0xd29067]));rpcDb['createCustomerHistory'](_0x571e89,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x571e89,0x16,'RecallFailedTimeout');rpcDb[_0x8b13('0x9b')](_0x571e89,_0x8b13('0x9c'));rpcDb['createCustomerFinal'](_0x571e89,_0x8b13('0x9c'));}}}}})['catch'](ut[_0x8b13('0x92')](_0x8b13('0x9d')));};Preview[_0x8b13('0x67')][_0x8b13('0x6b')]=function(_0x43f12a){_0x43f12a[_0x8b13('0x9e')]=!![];if(ut[_0x8b13('0x9f')](_0x43f12a['loggedIn'])){_0x43f12a[_0x8b13('0x4d')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x8b13('0xa0')](_0x43f12a[_0x8b13('0xa1')])){_0x43f12a[_0x8b13('0x4d')]=_0x8b13('0x61');}else if(!this[_0x8b13('0xa2')](_0x43f12a[_0x8b13('0x54')])){if(!this[_0x8b13('0xa2')](_0x43f12a['TrunkBackup'])){_0x43f12a[_0x8b13('0x4d')]='TRUNK_IS_NOT_REACHABLE';}else{_0x43f12a[_0x8b13('0x4d')]=_0x8b13('0xa3');}}else{_0x43f12a[_0x8b13('0x4d')]=_0x8b13('0xa3');}emitCampaignPreview(_0x43f12a);};Preview[_0x8b13('0x67')]['callProgressDetectingCustomer']=function(_0x52b546,_0x319923,_0x37a243){var _0x5ccf4e=this;var _0x180866=this[_0x8b13('0x6f')][_0x319923];var _0x670b3e=this['campaignsPreview'][_0x180866[_0x8b13('0x73')]];var _0x215a8a;if(_0x670b3e){switch(_0x37a243){case'1':_0x670b3e[_0x8b13('0x40')]+=0x1;_0x180866[_0x8b13('0xa4')]+=0x1;_0x180866['countglobal']=ut[_0x8b13('0xa5')](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x0,'NoSuchNumber');ami[_0x8b13('0x5d')](_0x8b13('0xa6'),ut[_0x8b13('0xa7')](_0x180866,_0x8b13('0xa8')));rpcDb[_0x8b13('0x9b')](_0x180866,_0x8b13('0xa9'));if(ut[_0x8b13('0xa5')](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,_0x8b13('0xac'));rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xae'));}else{if(_0x180866[_0x8b13('0xa4')]>=_0x670b3e[_0x8b13('0xaf')]){rpcDb['createCustomerFinal'](_0x180866,_0x8b13('0xae'));}else{rpcDb['rescheduleContact'](ut[_0x8b13('0xb0')](_0x180866,_0x8b13('0xa4'),_0x670b3e[_0x8b13('0xb1')]),_0x180866[_0x8b13('0xb2')],_0x180866['activeContact']);}}delete this['actions'][_0x52b546[_0x8b13('0xb3')]];break;case _0x8b13('0xb4'):var _0x4d8c62=moment()[_0x8b13('0x58')](_0x8b13('0x96'));_0x180866[_0x8b13('0xb5')]=_0x4d8c62;_0x180866[_0x8b13('0xb6')]=_0x4d8c62;_0x180866[_0x8b13('0x78')]=!![];_0x670b3e[_0x8b13('0x5f')]+=0x1;logger[_0x8b13('0x70')](_0x8b13('0xb7'),_0x180866[_0x8b13('0xb8')],_0x8b13('0xb9'),_0x670b3e['name'],_0x8b13('0x76'),_0x670b3e[_0x8b13('0x5f')]);ami['emit'](_0x8b13('0xba'),ut[_0x8b13('0xa7')](_0x180866,'connect',this[_0x8b13('0x13')][_0x180866[_0x8b13('0x73')]]));if(_0x670b3e[_0x8b13('0xbb')]){ami[_0x8b13('0x5d')](_0x8b13('0xbc'),ut[_0x8b13('0xbd')](_0x180866));}break;case'16':ami[_0x8b13('0x5d')](_0x8b13('0xbe'),ut['buildObj'](_0x180866,_0x8b13('0xbf'),this[_0x8b13('0x13')][_0x180866[_0x8b13('0x73')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x180866,_0x8b13('0xbf')));_0x670b3e['outboundAnswerCallsDay']+=0x1;_0x670b3e[_0x8b13('0xc0')]+=0x1;_0x670b3e[_0x8b13('0x2b')]+=0x1;ut[_0x8b13('0xc1')](_0x670b3e,_0x8b13('0xc2'));_0x180866[_0x8b13('0xc3')]=ut[_0x8b13('0xa5')](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x4,_0x8b13('0xc4'));rpcDb[_0x8b13('0x9b')](_0x180866,_0x8b13('0xc5'));rpcDb['createCustomerFinal'](_0x180866,_0x8b13('0xc6'));rpcDb[_0x8b13('0xc7')](_0x180866);_0x670b3e[_0x8b13('0x2f')]+=_0x180866[_0x8b13('0xc8')];_0x670b3e[_0x8b13('0x2e')]+=_0x180866[_0x8b13('0xc8')];logger[_0x8b13('0x70')](_0x8b13('0xc9'),_0x180866[_0x8b13('0xb8')],_0x8b13('0xb9'),_0x670b3e[_0x8b13('0x29')],_0x8b13('0x76'),_0x670b3e[_0x8b13('0x5f')]);delete this['actions'][_0x52b546['linkedid']];break;case _0x8b13('0xca'):_0x670b3e['outboundBusyCallsDay']+=0x1;_0x180866[_0x8b13('0xcb')]+=0x1;_0x180866[_0x8b13('0xc3')]=ut['totalGlobal'](_0x180866);ut['logCustomer'](_0x180866,0x5,_0x8b13('0xcc'));ami[_0x8b13('0x5d')](_0x8b13('0xcd'),ut[_0x8b13('0xa7')](_0x180866,_0x8b13('0xce')));rpcDb['createCustomerHistory'](_0x180866,_0x8b13('0xcf'));if(ut['totalGlobal'](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,'Global');rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xd0'));}else{if(_0x180866[_0x8b13('0xcb')]>=_0x670b3e[_0x8b13('0xd1')]){rpcDb[_0x8b13('0xad')](_0x180866,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x8b13('0xd2')](ut[_0x8b13('0xb0')](_0x180866,_0x8b13('0xcb'),_0x670b3e['dialBusyRetryFrequency']),_0x180866[_0x8b13('0xb2')],_0x180866['activeContact']);}}break;case _0x8b13('0xd3'):_0x670b3e[_0x8b13('0x3f')]+=0x1;_0x180866[_0x8b13('0xd4')]+=0x1;_0x180866[_0x8b13('0xc3')]=ut[_0x8b13('0xa5')](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x3,_0x8b13('0xd5'));ami[_0x8b13('0x5d')](_0x8b13('0xd6'),ut[_0x8b13('0xa7')](_0x180866,'noanswer'));rpcDb[_0x8b13('0x9b')](_0x180866,_0x8b13('0xd7'));if(ut[_0x8b13('0xa5')](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,'Global');rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xd8'));}else{if(_0x180866[_0x8b13('0xd4')]>=_0x670b3e[_0x8b13('0xd9')]){rpcDb[_0x8b13('0xad')](_0x180866,_0x8b13('0xd7'));}else{rpcDb['rescheduleContact'](ut[_0x8b13('0xb0')](_0x180866,_0x8b13('0xd4'),_0x670b3e['dialNoAnswerRetryFrequency']),_0x180866[_0x8b13('0xb2')],_0x180866['activeContact']);}}break;case _0x8b13('0xda'):_0x670b3e['outboundCongestionCallsDay']+=0x1;_0x180866[_0x8b13('0xdb')]+=0x1;_0x180866[_0x8b13('0xc3')]=ut[_0x8b13('0xa5')](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x8,_0x8b13('0xdc'));ami[_0x8b13('0x5d')](_0x8b13('0xdd'),ut[_0x8b13('0xa7')](_0x180866,'congestion'));rpcDb[_0x8b13('0x9b')](_0x180866,_0x8b13('0xde'));if(ut['totalGlobal'](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,'Global');rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xdf'));}else{if(_0x180866[_0x8b13('0xdb')]>=_0x670b3e[_0x8b13('0xe0')]){rpcDb[_0x8b13('0xad')](_0x180866,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x8b13('0xb0')](_0x180866,_0x8b13('0xdb'),_0x670b3e[_0x8b13('0xe1')]),_0x180866[_0x8b13('0xb2')],_0x180866[_0x8b13('0xe2')]);}}break;case _0x8b13('0xe3'):_0x670b3e[_0x8b13('0x43')]+=0x1;_0x180866[_0x8b13('0xe4')]+=0x1;_0x180866[_0x8b13('0xc3')]=ut[_0x8b13('0xa5')](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x14,_0x8b13('0xe5'));ami[_0x8b13('0x5d')](_0x8b13('0xe6'),ut[_0x8b13('0xa7')](_0x180866,_0x8b13('0xe7')));rpcDb['createCustomerHistory'](_0x180866,_0x8b13('0xe8'));if(ut['totalGlobal'](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0x14,_0x8b13('0xe5'));rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xe9'));}else{if(_0x180866[_0x8b13('0xe4')]>=_0x670b3e[_0x8b13('0xea')]){rpcDb['createCustomerFinal'](_0x180866,_0x8b13('0xe9'));}else{rpcDb['rescheduleContact'](ut[_0x8b13('0xb0')](_0x180866,_0x8b13('0xe4'),_0x670b3e['dialAgentRejectRetryFrequency']),_0x180866['unlockAgent'],_0x180866[_0x8b13('0xe2')]);}}break;case _0x8b13('0xeb'):_0x670b3e[_0x8b13('0x45')]+=0x1;_0x180866[_0x8b13('0xec')]+=0x1;_0x180866[_0x8b13('0xc3')]=ut[_0x8b13('0xa5')](_0x180866);ut['logCustomer'](_0x180866,0xb,_0x8b13('0xed'));rpcDb[_0x8b13('0x9b')](_0x180866,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x180866)>=_0x670b3e['dialGlobalMaxRetry']){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,_0x8b13('0xac'));rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xee'));}else{if(_0x180866[_0x8b13('0xef')]>=_0x670b3e[_0x8b13('0xf0')]){rpcDb[_0x8b13('0xad')](_0x180866,_0x8b13('0xee'));}else{rpcDb['rescheduleContact'](ut[_0x8b13('0xb0')](_0x180866,'countabandonedretry',_0x670b3e[_0x8b13('0xf1')]),_0x180866['unlockAgent'],_0x180866[_0x8b13('0xe2')]);}}break;case'18':_0x670b3e[_0x8b13('0x44')]+=0x1;_0x180866['countmachineretry']+=0x1;_0x180866[_0x8b13('0xc3')]=ut[_0x8b13('0xa5')](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x12,_0x52b546[_0x8b13('0xf2')]||_0x52b546[_0x8b13('0xf3')]);ami['emit'](_0x8b13('0xf4'),ut[_0x8b13('0xa7')](_0x180866,_0x8b13('0xf5')));rpcDb[_0x8b13('0x9b')](_0x180866,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x8b13('0xa5')](_0x180866)>=_0x670b3e['dialGlobalMaxRetry']){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,_0x8b13('0xac'));rpcDb[_0x8b13('0xad')](_0x215a8a,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x180866,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x52b546[_0x8b13('0xb3')]];break;case'19':_0x670b3e['outboundUnknownCallsDay']+=0x1;_0x180866[_0x8b13('0xc3')]=ut['totalGlobal'](_0x180866);ut[_0x8b13('0x97')](_0x180866,0x13,_0x52b546[_0x8b13('0xf2')]||_0x52b546[_0x8b13('0xf3')]);ami[_0x8b13('0x5d')](_0x8b13('0xf4'),ut[_0x8b13('0xa7')](_0x180866,_0x8b13('0xf5')));rpcDb[_0x8b13('0x9b')](_0x180866,_0x8b13('0xf6'));if(ut[_0x8b13('0xa5')](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,_0x8b13('0xac'));rpcDb['createCustomerFinal'](_0x215a8a,_0x8b13('0xf6'));}else{rpcDb['createCustomerFinal'](_0x180866,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x52b546[_0x8b13('0xb3')]];break;default:if(_0x180866[_0x8b13('0x78')]){ut[_0x8b13('0xc1')](_0x670b3e,_0x8b13('0xf7'));ut['loggerError'](_0x8b13('0xf8')+_0x670b3e['name'],_0x52b546);}_0x670b3e[_0x8b13('0x44')]+=0x1;_0x180866[_0x8b13('0xc3')]=ut['totalGlobal'](_0x180866);ut[_0x8b13('0x97')](_0x180866,0xc,_0x52b546[_0x8b13('0xf2')]||_0x52b546[_0x8b13('0xf3')]);rpcDb['createCustomerHistory'](_0x180866,_0x8b13('0xf9'));if(ut[_0x8b13('0xa5')](_0x180866)>=_0x670b3e[_0x8b13('0xaa')]){_0x215a8a=ut[_0x8b13('0xab')](_0x180866,0xf,_0x8b13('0xac'));rpcDb[_0x8b13('0xad')](_0x215a8a,_0x8b13('0xfa'));}else{rpcDb[_0x8b13('0xad')](_0x180866,_0x8b13('0xfa'));}delete this[_0x8b13('0x6f')][_0x52b546[_0x8b13('0xb3')]];}if(!(_0x180866[_0x8b13('0x78')]&&_0x37a243==='16')){ut[_0x8b13('0x83')](_0x670b3e,_0x8b13('0xfb'));logger[_0x8b13('0x70')](_0x8b13('0xfc'),_0x180866['uniqueid'],_0x8b13('0xb9'),_0x670b3e[_0x8b13('0x29')],_0x8b13('0x74'),_0x670b3e['originated']);}if(_0x37a243!==_0x8b13('0xb4')){delete this['actions'][_0x52b546[_0x8b13('0xb3')]];delete this[_0x8b13('0x6f')][_0x52b546[_0x8b13('0xfd')]];}}};Preview['prototype'][_0x8b13('0xfe')]=function(_0x1a5ecb,_0x506ab2,_0x52ca71){if(_[_0x8b13('0xff')](_0x506ab2)&&_0x8b13('0x100')!==typeof _0x506ab2){return;}if(_['isUndefined'](_0x52ca71)&&_0x8b13('0x100')!==typeof _0x52ca71){return;}switch(_0x52ca71[_0x8b13('0x101')]){case'0':ut[_0x8b13('0x102')](_0x1a5ecb,0x0,_0x8b13('0x103'));rpcDb['createAgentHistory'](_0x1a5ecb,_0x8b13('0x104'));break;case'3':ut[_0x8b13('0x102')](_0x1a5ecb,0x3,_0x8b13('0xd5'));rpcDb['createAgentHistory'](_0x1a5ecb,_0x8b13('0x105'));break;case'5':ut[_0x8b13('0x102')](_0x1a5ecb,0x5,'Busy');rpcDb[_0x8b13('0x106')](_0x1a5ecb,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x8b13('0x102')](_0x1a5ecb,0x8,_0x8b13('0xdc'));rpcDb['createAgentHistory'](_0x1a5ecb,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8b13('0x102')](_0x1a5ecb,0x16,_0x8b13('0x107'));rpcDb[_0x8b13('0x106')](_0x1a5ecb,_0x8b13('0x108'));break;default:ut[_0x8b13('0x102')](_0x1a5ecb,0xc,_0x52ca71[_0x8b13('0x101')]);rpcDb[_0x8b13('0x106')](_0x1a5ecb,_0x8b13('0x109'));}ut[_0x8b13('0x83')](_0x506ab2,_0x8b13('0x10a'));logger[_0x8b13('0x70')]('[originated][decrement][callProgressDetectingAgent]',_0x1a5ecb[_0x8b13('0xb8')],_0x8b13('0xb9'),_0x506ab2['name'],_0x8b13('0x74'),_0x506ab2['originated']);delete this[_0x8b13('0x6f')][_0x1a5ecb[_0x8b13('0xb8')]];};Preview[_0x8b13('0x67')]['checkInBlack']=function(_0x46bc13,_0x169609,_0xbd12b2,_0x3e0cf8,_0x117b27){var _0x58bc60=this;return new BPromise(function(_0x1d87f1,_0x2dba23){if(_[_0x8b13('0x6e')](_0x169609)||_[_0x8b13('0x6e')](_0x169609[_0x8b13('0x10b')])||_[_0x8b13('0x6e')](_0x169609['Contact'][_0x8b13('0x10c')])||_[_0x8b13('0x6e')](_0x169609[_0x8b13('0x7c')])){_0x2dba23(ut[_0x8b13('0x4d')]('Contact\x20is\x20undefined',_0x3e0cf8,_0x117b27));return;}var _0x1eb8cf=uuid['v4']();var _0x4c7f95=_0x58bc60['campaignsPreview'][_0x169609[_0x8b13('0x72')][_0x8b13('0x29')]];var _0x4d98b2=_0xbd12b2?_0x58bc60[_0x8b13('0x16')][_0xbd12b2]['id']:undefined;_0x58bc60['actions'][_0x1eb8cf]=new Action(_0x169609,_0x4c7f95,_0x1eb8cf,_0xbd12b2,_0x4d98b2);var _0x38cbc5=_0x58bc60['actions'][_0x1eb8cf];_0x38cbc5[_0x8b13('0xb2')]=_0x3e0cf8;_0x38cbc5[_0x8b13('0xe2')]=_0x117b27;_0x38cbc5[_0x8b13('0x10d')]=_0xbd12b2;if(_[_0x8b13('0x10e')](_0x46bc13)){_0x58bc60[_0x8b13('0x10f')](_0x38cbc5,_0x4c7f95,_0x169609,_0xbd12b2)[_0x8b13('0x8c')](function(_0x38fc1d){logger[_0x8b13('0x70')](_0x8b13('0x110'),'Queue:\x20'+_0x38cbc5[_0x8b13('0x73')]+_0x8b13('0x111')+_0x38cbc5['idContact'],JSON[_0x8b13('0x77')](_0x38fc1d));ami[_0x8b13('0x5d')](_0x8b13('0x112'),ut['buildObj'](_0x38cbc5,_0x8b13('0x113'),_0x58bc60[_0x8b13('0x13')][_0x38cbc5[_0x8b13('0x73')]]));_0x1d87f1(ut[_0x8b13('0x4d')]('Calling'));})[_0x8b13('0x81')](function(_0x1f8c53){ut[_0x8b13('0x62')](_0x8b13('0x114'),_0x1f8c53);_0x2dba23(ut[_0x8b13('0x4d')](_0x8b13('0x115'),_0x3e0cf8,_0x117b27));});}else{_0x4c7f95[_0x8b13('0x3a')]+=0x1;ut[_0x8b13('0x116')](_0x38cbc5);rpcDb[_0x8b13('0x117')](_0x38cbc5,_0x8b13('0x118'));delete _0x58bc60[_0x8b13('0x6f')][_0x1eb8cf];_0x2dba23(ut['message'](_0x8b13('0x119'),_0x3e0cf8,_0x117b27));}});};Preview[_0x8b13('0x67')]['isTrunkReachable']=function(_0x191ddf){return!_['isNil'](_0x191ddf)&&!_[_0x8b13('0x6e')](_0x191ddf[_0x8b13('0x29')])&&!_[_0x8b13('0x6e')](_0x191ddf[_0x8b13('0x55')])&&_0x191ddf[_0x8b13('0x55')]&&!_[_0x8b13('0x6e')](this[_0x8b13('0x15')][util[_0x8b13('0x58')](_0x8b13('0x11a'),_0x191ddf[_0x8b13('0x29')])])&&!_[_0x8b13('0x6e')](this[_0x8b13('0x15')][util[_0x8b13('0x58')](_0x8b13('0x11a'),_0x191ddf[_0x8b13('0x29')])][_0x8b13('0x7f')])&&(this[_0x8b13('0x15')][util[_0x8b13('0x58')](_0x8b13('0x11a'),_0x191ddf[_0x8b13('0x29')])]['status']===_0x8b13('0x11b')||this['trunks'][util[_0x8b13('0x58')]('SIP/%s',_0x191ddf[_0x8b13('0x29')])]['status']===_0x8b13('0x11c'));};Preview['prototype'][_0x8b13('0x91')]=function(_0x33d707,_0x3629cb){var _0x4dd9fc=this;return new BPromise(function(_0x416e4f,_0x41782b){_0x4dd9fc[_0x8b13('0x11d')](_0x33d707,_0x3629cb)[_0x8b13('0x8c')](function(_0x4f0b0b){_0x416e4f(_[_0x8b13('0x79')](_0x4f0b0b,[_0x8b13('0x4d')]));})[_0x8b13('0x81')](function(_0x2abab6){if(_0x2abab6[_0x8b13('0x11e')]){rpcDb['unlockContact'](_0x33d707);}if(_0x2abab6[_0x8b13('0x55')]){rpcDb[_0x8b13('0x94')](_0x33d707);}_0x41782b(_[_0x8b13('0x79')](_0x2abab6,[_0x8b13('0x4d')]));});});};Preview[_0x8b13('0x67')]['execRun']=function(_0x521da5,_0x408300){var _0x5d6aeb=this;return new BPromise(function(_0x35d90b,_0x3ce2f6){var _0x467779,_0x905cf6;rpcDb[_0x8b13('0x11f')](_0x521da5)[_0x8b13('0x8c')](function(_0x360e01){if(!_[_0x8b13('0x6e')](_0x360e01[0x0])){_0x905cf6=_0x360e01[0x0][_0x8b13('0x120')]?![]:!![];_0x467779=_0x360e01[0x0][_0x8b13('0x120')]?!![]:![];_0x467779=_0x408300?!![]:_0x467779;}var _0x147eed=_0x5d6aeb[_0x8b13('0x121')](_0x360e01);if(_0x147eed['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x360e01[0x0],['VoiceQueueId','Contact.phone']))[_0x8b13('0x8c')](function(_0x10c97f){_0x5d6aeb[_0x8b13('0x122')](_0x10c97f,_0x360e01[0x0],_0x408300,_0x905cf6,_0x467779)[_0x8b13('0x8c')](function(_0x28c8ab){_0x35d90b(_0x28c8ab);})[_0x8b13('0x81')](function(_0x33ab8d){_0x3ce2f6(_0x33ab8d);});})[_0x8b13('0x81')](function(_0x33afb6){ut[_0x8b13('0x62')]('[Preview][checkIsBlackList]',_0x33afb6);_0x3ce2f6(ut[_0x8b13('0x4d')](_0x8b13('0x123'),_0x905cf6,_0x467779));});}else{_0x3ce2f6(ut[_0x8b13('0x4d')](_0x147eed['message'],_0x905cf6,_0x467779));}})['catch'](function(_0x12e91a){ut[_0x8b13('0x62')]('[Preview][getContactPreview]',_0x12e91a);_0x3ce2f6(ut[_0x8b13('0x4d')](_0x8b13('0x123'),![],!![]));});});};Preview['prototype'][_0x8b13('0x121')]=function(_0x112d5c){if(_[_0x8b13('0x6e')](_0x112d5c)||_[_0x8b13('0x10e')](_0x112d5c)||!_[_0x8b13('0x6e')](_0x112d5c[0x0]['Agent'])&&_['isNil'](_0x112d5c[0x0][_0x8b13('0x8f')]['name'])){ut[_0x8b13('0x62')](_0x8b13('0x124'),_0x112d5c);return{'isValid':![],'message':_0x8b13('0x125')};}var _0x58b8af=this[_0x8b13('0x13')][_0x112d5c[0x0][_0x8b13('0x72')][_0x8b13('0x29')]];_0x58b8af[_0x8b13('0x4d')]='ACTIVE';if(_[_0x8b13('0x6e')](_0x58b8af)){ut['logger'](_0x8b13('0x126'),_0x58b8af);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x8b13('0xa2')](_0x58b8af[_0x8b13('0x54')])){ut[_0x8b13('0x62')](_0x8b13('0x127'),_0x8b13('0x128')+_0x58b8af[_0x8b13('0x29')]+_0x8b13('0x129'));if(!this[_0x8b13('0xa2')](_0x58b8af[_0x8b13('0x12a')])){ut[_0x8b13('0x62')](_0x8b13('0x127'),_0x58b8af['name']+_0x8b13('0x12b'));return{'isValid':![],'message':_0x8b13('0x12c')};}}if(!ut['isActive'](_0x58b8af[_0x8b13('0xa1')])){ut[_0x8b13('0x62')](_0x8b13('0x12d'),_0x58b8af[_0x8b13('0x29')]+_0x8b13('0x12e'));return{'isValid':![],'message':_0x8b13('0x128')+_0x58b8af[_0x8b13('0x29')]+_0x8b13('0x12e')};}return{'isValid':!![],'message':_0x8b13('0x12f')};};Preview[_0x8b13('0x67')]['execCall']=function(_0x1b8bf6,_0x4908d3,_0x360b37,_0x52f93b){var _0x2955b4=this;return new BPromise(function(_0x577931,_0x3a6b62){var _0x545b33=_0x1b8bf6[_0x8b13('0xb8')];var _0x31aa09=_0x2955b4[_0x8b13('0xa2')](_0x4908d3[_0x8b13('0x54')])?util[_0x8b13('0x58')](_0x8b13('0x130'),_0x4908d3[_0x8b13('0x54')][_0x8b13('0x29')],_[_0x8b13('0x6e')](_0x4908d3[_0x8b13('0x38')])?'':_0x4908d3[_0x8b13('0x38')]['trim']()||'',_0x4908d3[_0x8b13('0x131')]>0x0?_0x360b37[_0x8b13('0x10b')][_0x8b13('0x10c')][_0x8b13('0x132')](_0x4908d3['dialCutDigit']):_0x360b37[_0x8b13('0x10b')][_0x8b13('0x10c')]):util[_0x8b13('0x58')](_0x8b13('0x130'),_[_0x8b13('0x6e')](_0x4908d3[_0x8b13('0x12a')])?_0x4908d3['Trunk'][_0x8b13('0x29')]:_0x4908d3[_0x8b13('0x12a')][_0x8b13('0x29')],_[_0x8b13('0x6e')](_0x4908d3[_0x8b13('0x38')])?'':_0x4908d3[_0x8b13('0x38')][_0x8b13('0x133')]()||'',_0x4908d3[_0x8b13('0x131')]>0x0?_0x360b37[_0x8b13('0x10b')][_0x8b13('0x10c')]['substring'](_0x4908d3[_0x8b13('0x131')]):_0x360b37[_0x8b13('0x10b')]['phone']);var _0x457873=_0x2955b4['isTrunkReachable'](_0x4908d3[_0x8b13('0x54')])?ut[_0x8b13('0x134')](_0x4908d3[_0x8b13('0x54')][_0x8b13('0x56')],_0x4908d3['dialOriginateCallerIdName'],_0x4908d3[_0x8b13('0x135')]>0x0?ut[_0x8b13('0x136')](_0x4908d3['dialOriginateCallerIdNumber'],_0x4908d3[_0x8b13('0x135')]):_0x4908d3['dialOriginateCallerIdNumber']):ut[_0x8b13('0x134')](_[_0x8b13('0x6e')](_0x4908d3[_0x8b13('0x12a')])?_0x4908d3[_0x8b13('0x54')][_0x8b13('0x56')]:_0x4908d3[_0x8b13('0x12a')][_0x8b13('0x56')],_0x4908d3['dialOriginateCallerIdName'],_0x4908d3[_0x8b13('0x135')]>0x0?ut[_0x8b13('0x136')](_0x4908d3[_0x8b13('0x36')],_0x4908d3[_0x8b13('0x135')]):_0x4908d3['dialOriginateCallerIdNumber']);if(_0x457873){_0x1b8bf6['originatecalleridname']=ut['extractCalleridName'](_0x457873);_0x1b8bf6[_0x8b13('0x137')]=ut['extractCalleridNumber'](_0x457873);}var _0x4cb020=ut[_0x8b13('0x138')](_0x4908d3,_0x360b37,_0x31aa09,_0x457873,_0x545b33,_0x1b8bf6);_[_0x8b13('0x139')](_0x1b8bf6,ut[_0x8b13('0x13a')](_0x4cb020));_0x1b8bf6[_0x8b13('0x95')]=moment()[_0x8b13('0x58')](_0x8b13('0x96'));ami[_0x8b13('0x7e')](ut['variablesAction'](_0x1b8bf6,_0x4908d3,_0x4cb020,_0x1b8bf6['activeContact'],_0x52f93b))[_0x8b13('0x8c')](function(_0x4e6a68){_0x4908d3[_0x8b13('0x75')]+=0x1;logger[_0x8b13('0x70')](_0x8b13('0x13b'),_0x545b33,'\x20Queue',_0x4908d3[_0x8b13('0x29')],'originated:\x20',_0x4908d3[_0x8b13('0x75')]);_0x577931(_0x4e6a68);})[_0x8b13('0x81')](function(_0x4176d9){ut['logAgent'](_0x1b8bf6,0xe,_0x8b13('0x13c'));rpcDb[_0x8b13('0x106')](_0x1b8bf6,_0x8b13('0x13d'));_0x3a6b62(_0x4176d9);});});};Preview[_0x8b13('0x67')][_0x8b13('0x20')]=function(_0x28bb5c){if(this[_0x8b13('0x6f')][_0x28bb5c['linkedid']]){this['actions'][_0x28bb5c['linkedid']][_0x8b13('0x80')]=_0x28bb5c[_0x8b13('0x80')];}};Preview['prototype'][_0x8b13('0x13e')]=function(_0x58dd3b){var _0x32bfff=this;var _0x2ca28a=this['actions'][_0x58dd3b[_0x8b13('0x13f')]];if(_0x2ca28a){if(_0x2ca28a[_0x8b13('0x10d')]&&this[_0x8b13('0x16')][_0x2ca28a[_0x8b13('0x10d')]]){ut[_0x8b13('0x140')](_0x2ca28a,this['agents'][_0x2ca28a['lookAgent']][_0x8b13('0x29')],this[_0x8b13('0x16')][_0x2ca28a[_0x8b13('0x10d')]]['id']);}var _0x1e3cc8=_[_0x8b13('0x141')](_0x2ca28a);_0x1e3cc8[_0x8b13('0xb5')]=moment()[_0x8b13('0x58')](_0x8b13('0x96'));var _0x4ac60d=_0x32bfff[_0x8b13('0x13')][_0x2ca28a['queue']];if(ut[_0x8b13('0x142')](_0x58dd3b[_0x8b13('0x143')])){if(_0x2ca28a[_0x8b13('0xb2')]){rpcDb[_0x8b13('0x144')](_0x2ca28a[_0x8b13('0x145')]);}if(_0x2ca28a[_0x8b13('0xe2')]){rpcDb[_0x8b13('0x94')](_0x2ca28a[_0x8b13('0x145')]);}ami[_0x8b13('0x5d')](_0x8b13('0x146'),ut[_0x8b13('0xa7')](_0x2ca28a,_0x8b13('0x147'),this[_0x8b13('0x13')][_0x2ca28a[_0x8b13('0x73')]]));this['callProgressDetectingAgent'](_0x1e3cc8,_0x4ac60d,_0x58dd3b);}else{_0x2ca28a[_0x8b13('0x95')]=moment()[_0x8b13('0x58')](_0x8b13('0x96'));ut[_0x8b13('0x102')](_0x1e3cc8,0x4,_0x8b13('0xc4'));rpcDb[_0x8b13('0x106')](_0x1e3cc8,_0x8b13('0x148'));}}};Preview[_0x8b13('0x67')][_0x8b13('0x19')]=function(_0x3ca469){var _0xddccf7=this;var _0x170d79=this[_0x8b13('0x6f')][_0x3ca469['linkedid']];var _0x571ff2;if(_0x170d79){_0x571ff2=this[_0x8b13('0x13')][_0x170d79[_0x8b13('0x73')]];logger['info'](_0x8b13('0x149'),_0x3ca469[_0x8b13('0xb3')],_0x8b13('0xb9'),_0x571ff2[_0x8b13('0x29')],'pTalking:\x20',_0x571ff2['pTalking']);}if(this[_0x8b13('0x6f')][_0x3ca469[_0x8b13('0xb3')]]&&_0x3ca469[_0x8b13('0xb3')]!==_0x3ca469[_0x8b13('0xb8')]){if(_0x3ca469[_0x8b13('0x14a')]==='16'&&this[_0x8b13('0x6f')][_0x3ca469['linkedid']][_0x8b13('0x78')]){this[_0x8b13('0x14b')](_0x3ca469,_0x3ca469['linkedid'],_0x3ca469['cause']);}else if(this[_0x8b13('0x6f')][_0x3ca469[_0x8b13('0xb3')]][_0x8b13('0x78')]){logger['info'](_0x8b13('0x14c'),_0x3ca469['linkedid'],_0x3ca469['cause'],_0x8b13('0xb9'),_0x571ff2[_0x8b13('0x29')],'pTalking:\x20',_0x571ff2['pTalking']);this[_0x8b13('0x14b')](_0x3ca469,_0x3ca469['linkedid'],_0x3ca469[_0x8b13('0x14a')]);}}else if(_0x170d79&&_[_0x8b13('0x6e')](_0x170d79[_0x8b13('0x14d')])&&_0x571ff2[_0x8b13('0x14e')]&&_0x3ca469[_0x8b13('0xb3')]===_0x3ca469['uniqueid']&&_['isNil'](_0x3ca469[_0x8b13('0x101')])&&_0x3ca469['cause']==='16'&&_0x3ca469['channelstate']==='6'&&_[_0x8b13('0xff')](_0x170d79[_0x8b13('0x14f')])){if(_0x170d79[_0x8b13('0xb2')]){rpcDb[_0x8b13('0x144')](_0x170d79[_0x8b13('0x145')]);}if(_0x170d79[_0x8b13('0xe2')]){rpcDb['disableContact'](_0x170d79[_0x8b13('0x145')]);}_0x3ca469[_0x8b13('0x101')]='22';this[_0x8b13('0xfe')](_0x170d79,_0x571ff2,_0x3ca469);}else if(_0x170d79&&_0x170d79[_0x8b13('0x14f')]){if(_0x3ca469['cause']==='16'&&this['actions'][_0x3ca469[_0x8b13('0xb3')]][_0x8b13('0x78')]){logger[_0x8b13('0x70')](_0x8b13('0x150'),_0x3ca469[_0x8b13('0xb3')],_0x3ca469['cause'],_0x8b13('0xb9'),_0x571ff2['name'],_0x8b13('0x76'),_0x571ff2[_0x8b13('0x5f')]);this[_0x8b13('0x14b')](_0x3ca469,_0x3ca469['linkedid'],_0x3ca469[_0x8b13('0x14a')]);}else if(this[_0x8b13('0x6f')][_0x3ca469[_0x8b13('0xb3')]]['dialAnswer']){logger[_0x8b13('0x70')](_0x8b13('0x14c'),_0x3ca469[_0x8b13('0xb3')],_0x3ca469[_0x8b13('0x14a')],_0x8b13('0xb9'),_0x571ff2[_0x8b13('0x29')],'pTalking:\x20',_0x571ff2[_0x8b13('0x5f')]);this[_0x8b13('0x14b')](_0x3ca469,_0x3ca469['linkedid'],_0x3ca469['cause']);}}};Preview['prototype'][_0x8b13('0x1e')]=function(_0x5dbd68){if(this[_0x8b13('0x6f')][_0x5dbd68[_0x8b13('0xfd')]]&&_0x5dbd68[_0x8b13('0xfd')]!==_0x5dbd68['destuniqueid']){this['callProgressDetectingCustomer'](_0x5dbd68,_0x5dbd68['destlinkedid'],_0x5dbd68[_0x8b13('0xf3')]);}};Preview[_0x8b13('0x67')][_0x8b13('0x1c')]=function(_0x54a76f){if(this[_0x8b13('0x6f')][_0x54a76f['linkedid']]&&_0x54a76f[_0x8b13('0xb3')]!==_0x54a76f['uniqueid']&&!this['actions'][_0x54a76f[_0x8b13('0xb3')]][_0x8b13('0x78')]){if(_0x54a76f[_0x8b13('0x14a')]==='1'){this[_0x8b13('0x14b')](_0x54a76f,_0x54a76f['linkedid'],_0x54a76f['cause']);}}};Preview[_0x8b13('0x67')][_0x8b13('0x151')]=function(_0x490945,_0x4e3219,_0x36cf0c){if(this[_0x8b13('0x6f')][_0x490945]){if(_[_0x8b13('0x6e')](this[_0x8b13('0x6f')][_0x490945][_0x8b13('0x152')])){this[_0x8b13('0x6f')][_0x490945]['variables']={};}this[_0x8b13('0x6f')][_0x490945][_0x8b13('0x152')][_0x4e3219]=_0x36cf0c;}};Preview[_0x8b13('0x67')][_0x8b13('0x22')]=function(_0x49e85f){try{if(!_['isNil'](_0x49e85f)){if(ut[_0x8b13('0x153')](_[_0x8b13('0x154')](_0x49e85f[_0x8b13('0x155')])[0x0])){this[_0x8b13('0x151')](_0x49e85f['uniqueid'],_[_0x8b13('0x154')](_0x49e85f[_0x8b13('0x155')])[0x0],_0x49e85f['value']);}}}catch(_0x43222c){logger['error'](_0x8b13('0x156'),util[_0x8b13('0x157')](_0x43222c,{'showHidden':![],'depth':null}));}};Preview[_0x8b13('0x67')][_0x8b13('0x23')]=function(_0x39ae60){if(_0x39ae60){if(this[_0x8b13('0x6f')][_0x39ae60[_0x8b13('0x158')]]){this['actions'][_0x39ae60[_0x8b13('0x158')]]['transfer']=!![];}}};Preview['prototype'][_0x8b13('0x25')]=function(_0x14a2b2){if(_0x14a2b2){if(this[_0x8b13('0x6f')][_0x14a2b2[_0x8b13('0x159')]]){this['actions'][_0x14a2b2[_0x8b13('0x159')]][_0x8b13('0x14f')]=!![];}}};module[_0x8b13('0x15a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 3ac4fa5..a881e7f 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 _0x4660=['membername','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x4660,0x119));var _0x0466=function(_0x7dc811,_0x29128b){_0x7dc811=_0x7dc811-0x0;var _0x11ab18=_0x4660[_0x7dc811];return _0x11ab18;};'use strict';var util=require(_0x0466('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x0466('0x1'));var cmHopper=require(_0x0466('0x2'));var cmHopperFinal=require(_0x0466('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x0466('0x4'));var voiceQueueRt=require(_0x0466('0x5'));var agentReportPreview=require(_0x0466('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2d0a29){return function(_0x43d09e){logger[_0x0466('0x7')](_0x2d0a29,util[_0x0466('0x8')](_0x43d09e,{'showHidden':![],'depth':null}));};}function create(_0x102495){return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](cmHopperHistory[_0x0466('0xb')](_0x102495))[_0x0466('0xc')](loggerCatch(_0x0466('0xd')));}function createAgent(_0xffe0e){return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](agentReportPreview[_0x0466('0xb')](_0xffe0e))[_0x0466('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4c500c){return BPromise[_0x0466('0x9')]()['then'](cmHopper[_0x0466('0xe')](_0x4c500c,!![]))[_0x0466('0xc')](loggerCatch(_0x0466('0xf')));}exports['checkIsBlackList']=function(_0x2dfe7a){return BPromise['resolve']()[_0x0466('0xa')](cmHopperBlack[_0x0466('0x10')](_0x2dfe7a))[_0x0466('0xc')](loggerCatch(_0x0466('0x11')));};exports[_0x0466('0x12')]=function(_0xd122b4){return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](cmHopper[_0x0466('0x12')](_0xd122b4))[_0x0466('0xc')](loggerCatch(_0x0466('0x13')));};exports['createHistory']=function(_0x24b7f0,_0x14733e){create(_0x24b7f0)['catch'](loggerCatch(_0x14733e));moveContact(_0x24b7f0)[_0x0466('0xc')](loggerCatch(_0x14733e));};exports[_0x0466('0x14')]=function(_0x120d2e,_0x17b5cb){createAgent(_0x120d2e)[_0x0466('0xc')](loggerCatch(_0x17b5cb));};exports['createCustomerHistory']=function(_0x165616,_0x373ba6){create(_0x165616)[_0x0466('0xc')](loggerCatch(_0x373ba6));};exports[_0x0466('0x15')]=function(_0x1aed6b,_0x58294a){moveContact(_0x1aed6b)[_0x0466('0xc')](loggerCatch(_0x58294a));};exports['rescheduleContact']=function(_0x42d0cf,_0x5d4d4f,_0x24e594){if(_0x5d4d4f){_0x42d0cf[_0x0466('0x16')]=null;}if(_0x24e594){_0x42d0cf[_0x0466('0x17')]=![];}return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](cmHopper[_0x0466('0x18')](_0x42d0cf))[_0x0466('0xc')](loggerCatch(_0x0466('0x19')));};exports[_0x0466('0x1a')]=function(_0x25efa8){return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](cmHopper[_0x0466('0x1a')](_0x25efa8))[_0x0466('0xc')](loggerCatch(_0x0466('0x1b')));};exports['unlockContact']=function(_0xbd1a80){return BPromise['resolve']()['then'](cmHopper[_0x0466('0x1c')]({'UserId':null},_0xbd1a80,0x1))[_0x0466('0xc')](loggerCatch(_0x0466('0x1d')));};exports[_0x0466('0x1e')]=function(_0x69b5d1){return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](cmHopper['unlockContact']({'active':![]},_0x69b5d1,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x0466('0x1f')]=function(_0x4302c4){var _0x34e0bc={};_0x34e0bc[_0x0466('0x20')]=_0x4302c4['type'];_0x34e0bc['uniqueid']=_0x4302c4['uniqueid'];_0x34e0bc[_0x0466('0x21')]=_0x4302c4[_0x0466('0x21')];_0x34e0bc[_0x0466('0x22')]=_0x4302c4['calleridname'];_0x34e0bc['queue']=_0x4302c4[_0x0466('0x23')];_0x34e0bc[_0x0466('0x24')]=_0x4302c4['answertime'];_0x34e0bc[_0x0466('0x25')]=_0x4302c4[_0x0466('0x26')];_0x34e0bc[_0x0466('0x27')]=0x1;_0x34e0bc[_0x0466('0x28')]=_0x4302c4[_0x0466('0x29')];_0x34e0bc[_0x0466('0x2a')]=_0x4302c4[_0x0466('0x2b')];_0x34e0bc['context']=_0x0466('0x2c');_0x34e0bc[_0x0466('0x2d')]='xcally-motion-preview';_0x34e0bc['holdtime']=0x0;_0x34e0bc[_0x0466('0x2e')]=0x1;_0x34e0bc[_0x0466('0x2f')]=_0x4302c4['membername'];_0x34e0bc[_0x0466('0x30')]=_0x0466('0x31');return BPromise[_0x0466('0x9')]()[_0x0466('0xa')](voiceQueueReport[_0x0466('0x32')](_0x34e0bc))[_0x0466('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x0466('0x33')]=function(_0x5b386b,_0x220a49){return BPromise['resolve']()['then'](cmHopper[_0x0466('0x33')](_0x5b386b,_0x220a49))[_0x0466('0xc')](loggerCatch(_0x0466('0x34')));};exports['rescheduleContactInQueue']=function(_0x1b5572){return BPromise['resolve']()[_0x0466('0xa')](cmHopper[_0x0466('0x18')](_0x1b5572,!![],!![]))['catch'](loggerCatch(_0x0466('0x35')));}; \ No newline at end of file +var _0x83a3=['../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x83a3,0xa7));var _0x383a=function(_0x327b49,_0xc232b8){_0x327b49=_0x327b49-0x0;var _0x4e7265=_0x83a3[_0x327b49];return _0x4e7265;};'use strict';var util=require(_0x383a('0x0'));var BPromise=require(_0x383a('0x1'));var logger=require(_0x383a('0x2'))(_0x383a('0x3'));var _=require('lodash');var cmHopper=require(_0x383a('0x4'));var cmHopperFinal=require(_0x383a('0x5'));var cmHopperHistory=require(_0x383a('0x6'));var cmHopperBlack=require(_0x383a('0x7'));var voiceQueueRt=require(_0x383a('0x8'));var agentReportPreview=require(_0x383a('0x9'));var voiceQueueReport=require(_0x383a('0xa'));function loggerCatch(_0x28db4d){return function(_0x5e8030){logger['error'](_0x28db4d,util[_0x383a('0xb')](_0x5e8030,{'showHidden':![],'depth':null}));};}function create(_0x35e575){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopperHistory[_0x383a('0xe')](_0x35e575))[_0x383a('0xf')](loggerCatch(_0x383a('0x10')));}function createAgent(_0x1a5e9d){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](agentReportPreview['createHistory'](_0x1a5e9d))['catch'](loggerCatch(_0x383a('0x10')));}function moveContact(_0x2ad06c){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopper[_0x383a('0x11')](_0x2ad06c,!![]))[_0x383a('0xf')](loggerCatch(_0x383a('0x12')));}exports['checkIsBlackList']=function(_0x10940b){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopperBlack[_0x383a('0x13')](_0x10940b))['catch'](loggerCatch(_0x383a('0x14')));};exports[_0x383a('0x15')]=function(_0x5a87b1){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopper[_0x383a('0x15')](_0x5a87b1))[_0x383a('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0x383a('0xe')]=function(_0x1705bc,_0x1fa8ba){create(_0x1705bc)[_0x383a('0xf')](loggerCatch(_0x1fa8ba));moveContact(_0x1705bc)[_0x383a('0xf')](loggerCatch(_0x1fa8ba));};exports[_0x383a('0x16')]=function(_0x50fda9,_0x569817){createAgent(_0x50fda9)[_0x383a('0xf')](loggerCatch(_0x569817));};exports[_0x383a('0x17')]=function(_0x3e89e7,_0x5c6a86){create(_0x3e89e7)[_0x383a('0xf')](loggerCatch(_0x5c6a86));};exports[_0x383a('0x18')]=function(_0x144866,_0x202c0e){moveContact(_0x144866)[_0x383a('0xf')](loggerCatch(_0x202c0e));};exports[_0x383a('0x19')]=function(_0x10eb84,_0x2e5ded,_0x355404){if(_0x2e5ded){_0x10eb84[_0x383a('0x1a')]=null;}if(_0x355404){_0x10eb84['active']=![];}return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopper[_0x383a('0x19')](_0x10eb84))[_0x383a('0xf')](loggerCatch(_0x383a('0x1b')));};exports['countReScheduled']=function(_0x153fd0){return BPromise['resolve']()[_0x383a('0xd')](cmHopper[_0x383a('0x1c')](_0x153fd0))[_0x383a('0xf')](loggerCatch(_0x383a('0x1d')));};exports[_0x383a('0x1e')]=function(_0x527e24){return BPromise['resolve']()[_0x383a('0xd')](cmHopper[_0x383a('0x1e')]({'UserId':null},_0x527e24,0x1))[_0x383a('0xf')](loggerCatch(_0x383a('0x1f')));};exports[_0x383a('0x20')]=function(_0x53dbe7){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopper[_0x383a('0x1e')]({'active':![]},_0x53dbe7,0x1))['catch'](loggerCatch(_0x383a('0x21')));};exports[_0x383a('0x22')]=function(_0x3a8f28){var _0x13fbdc={};_0x13fbdc[_0x383a('0x23')]=_0x3a8f28[_0x383a('0x23')];_0x13fbdc[_0x383a('0x24')]=_0x3a8f28[_0x383a('0x24')];_0x13fbdc[_0x383a('0x25')]=_0x3a8f28[_0x383a('0x25')];_0x13fbdc[_0x383a('0x26')]=_0x3a8f28[_0x383a('0x26')];_0x13fbdc[_0x383a('0x27')]=_0x3a8f28[_0x383a('0x27')];_0x13fbdc[_0x383a('0x28')]=_0x3a8f28[_0x383a('0x29')];_0x13fbdc[_0x383a('0x2a')]=_0x3a8f28['answertime'];_0x13fbdc['queuecallercomplete']=0x1;_0x13fbdc['queuecallercompleteAt']=_0x3a8f28['endtime'];_0x13fbdc[_0x383a('0x2b')]=_0x3a8f28[_0x383a('0x2c')];_0x13fbdc[_0x383a('0x2d')]=_0x383a('0x2e');_0x13fbdc[_0x383a('0x2f')]=_0x383a('0x30');_0x13fbdc[_0x383a('0x31')]=0x0;_0x13fbdc['assigned']=0x1;_0x13fbdc[_0x383a('0x32')]=_0x3a8f28[_0x383a('0x2c')];_0x13fbdc[_0x383a('0x33')]=_0x383a('0x34');return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](voiceQueueReport[_0x383a('0x35')](_0x13fbdc))[_0x383a('0xf')](loggerCatch(_0x383a('0x36')));};exports[_0x383a('0x37')]=function(_0x5ecea3,_0x13a289){return BPromise[_0x383a('0xc')]()['then'](cmHopper[_0x383a('0x37')](_0x5ecea3,_0x13a289))['catch'](loggerCatch(_0x383a('0x38')));};exports[_0x383a('0x39')]=function(_0x241528){return BPromise[_0x383a('0xc')]()[_0x383a('0xd')](cmHopper[_0x383a('0x19')](_0x241528,!![],!![]))[_0x383a('0xf')](loggerCatch(_0x383a('0x3a')));}; \ 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 9d2d53c..0bc1100 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 _0x18f6=['U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','Failure','RECALL','BOOKED','uniqueid','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','type','dialAnswer','countcongestionretry','countglobal','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','\x22%s\x22\x20<%s>','isEmpty','isActive','isNil','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format'];(function(_0x1fdaf4,_0x145ba8){var _0x37e619=function(_0x5d378b){while(--_0x5d378b){_0x1fdaf4['push'](_0x1fdaf4['shift']());}};_0x37e619(++_0x145ba8);}(_0x18f6,0xf5));var _0x618f=function(_0x4f5068,_0x5608a3){_0x4f5068=_0x4f5068-0x0;var _0x2ce177=_0x18f6[_0x4f5068];return _0x2ce177;};'use strict';var util=require(_0x618f('0x0'));var _=require(_0x618f('0x1'));var moment=require('moment');var logger=require(_0x618f('0x2'))(_0x618f('0x3'));var ipAgi=process['env'][_0x618f('0x4')]||_0x618f('0x5');function getSeconds(_0x5572c8,_0x3616a1){var _0x58812f=moment(_0x5572c8)[_0x618f('0x6')](0x0);var _0x40c659=moment(_0x3616a1)[_0x618f('0x6')](0x0);return _0x58812f[_0x618f('0x7')](_0x40c659,'seconds');}exports['loggerCatch']=function(_0x442c3c){return function(_0x34a90d){logger[_0x618f('0x8')](_0x442c3c,util[_0x618f('0x9')](_0x34a90d,{'showHidden':![],'depth':null}));};};exports[_0x618f('0xa')]=function(_0x4d0695,_0x8e3393){logger[_0x618f('0xb')](_0x4d0695,util[_0x618f('0x9')](_0x8e3393,{'showHidden':![],'depth':null}));};exports[_0x618f('0xc')]=function(_0x27f597,_0x32f371){logger[_0x618f('0x8')](_0x27f597,util['inspect'](_0x32f371,{'showHidden':![],'depth':null}));};exports[_0x618f('0xd')]=function(_0x470af8){return function(_0x853a41){logger[_0x618f('0xb')](_0x470af8,util[_0x618f('0x9')](_0x853a41,{'showHidden':![],'depth':null}));};};exports[_0x618f('0xe')]=function(_0x568bf1,_0x3419bc,_0x562646){return{'message':_0x568bf1,'unlock':_0x3419bc,'active':_0x562646};};exports['getCallerId']=function(_0x1c852e,_0x26fe55,_0x36f4a4){if(!_[_0x618f('0xf')](_0x36f4a4)&&_0x618f('0x10')===typeof _0x36f4a4&&!_['isEmpty'](_0x36f4a4)){if(!_[_0x618f('0xf')](_0x26fe55)&&_0x618f('0x10')===typeof _0x26fe55&&!_['isEmpty'](_0x26fe55)){return util['format']('\x22%s\x22\x20<%s>',_0x26fe55,_0x36f4a4);}return util['format'](_0x618f('0x11'),_0x36f4a4,_0x36f4a4);}if(!_[_0x618f('0xf')](_0x1c852e)&&_0x618f('0x10')===typeof _0x1c852e&&!_[_0x618f('0x12')](_0x1c852e)){return _0x1c852e;}return'\x22\x22\x20<>';};exports[_0x618f('0x13')]=function(_0x385a7a){if(_[_0x618f('0x14')](_0x385a7a)){return![];}return _0x385a7a;};exports['addVariables']=function(_0x152716,_0x512ca3,_0xac6be7,_0x54fa3a,_0x5e3857,_0x2e6fe2){var _0x51e9ca={'XMD-QUEUE':_0x512ca3[_0x618f('0x15')]?_0x512ca3['Queue'][_0x618f('0x16')]:'','XMD-CALLERID':_0x54fa3a,'XMD-CALLERID-PREVIEW':_0x2e6fe2?util[_0x618f('0x17')]('\x22%s\x22\x20<%s>',_0x2e6fe2[_0x618f('0x18')],_0x2e6fe2[_0x618f('0x19')]):_0x54fa3a,'XMD-DIALID':_0x5e3857,'XMD-CONTACTID':_0x512ca3[_0x618f('0x1a')],'XMD-CDRTYPE':_0x618f('0x1b'),'CALLERID(all)':_0x54fa3a,'XMD-VOICEQUEUEID':_0x512ca3[_0x618f('0x1c')],'XMD-DIALCHANNEL':_0xac6be7,'XMD-DIALTIMEOUT':_0x152716[_0x618f('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x618f('0x17')](_0x618f('0x1e'),_0x152716[_0x618f('0x1f')]?'g':'',_[_0x618f('0x12')](_0x152716[_0x618f('0x20')])?'':_0x618f('0x21')),'XMD-DIALURL':_0x152716[_0x618f('0x22')]||'','XMD-AGI':_0x152716[_0x618f('0x23')]?util['format'](_0x618f('0x24'),ipAgi,_0x152716[_0x618f('0x23')]):_0x618f('0x25'),'XMD-AGIAFTER':_0x152716[_0x618f('0x1f')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x152716[_0x618f('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2e6fe2?_0x2e6fe2[_0x618f('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x2e6fe2?_0x2e6fe2['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x618f('0x27')};if(!_[_0x618f('0x12')](_0x152716[_0x618f('0x20')])){_0x51e9ca[util[_0x618f('0x17')]('%s',_0x618f('0x28'))]=_0x152716[_0x618f('0x20')];_0x51e9ca[util[_0x618f('0x17')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5e3857;}if(_0x512ca3&&_0x512ca3[_0x618f('0x29')]){for(var _0x4a9677 in _0x512ca3[_0x618f('0x29')]){if(_0x512ca3[_0x618f('0x29')]['hasOwnProperty'](_0x4a9677)){if(!_['isNil'](_0x512ca3[_0x618f('0x29')][_0x4a9677])&&_0x4a9677!=='id'&&_0x4a9677!==_0x618f('0x2a')&&_0x4a9677!==_0x618f('0x2b')&&_0x4a9677!==_0x618f('0x2c')){_0x51e9ca[util[_0x618f('0x17')](_0x618f('0x2d'),_0x618f('0x2e'),_[_0x618f('0x2f')](_0x4a9677))]=_0x512ca3[_0x618f('0x29')][_0x4a9677];}}}}return _0x51e9ca;};exports[_0x618f('0x30')]=function(_0x1ca0de){var _0x49c7bf={};for(var _0x146af4 in _0x1ca0de){if(_0x1ca0de[_0x618f('0x31')](_0x146af4)){_0x49c7bf[util[_0x618f('0x17')]('%s',_['toLower'](_0x146af4))]=_0x1ca0de[_0x146af4];}}return{'variables':_0x49c7bf};};exports[_0x618f('0x32')]=function(_0x1e95ec,_0x372fa1){if(!_[_0x618f('0x14')](_0x1e95ec)){if(_0x1e95ec[_0x618f('0x31')](_0x618f('0x33'))){if(_0x1e95ec[_0x618f('0x33')]>0x0){_0x1e95ec['originated']-=0x1;}else{logger[_0x618f('0x8')](_0x618f('0x34'),_0x372fa1);}}}else{logger['error'](_0x618f('0x35'),_0x372fa1);}};exports[_0x618f('0x36')]=function(_0x2a8f27){var _0x28eafb=moment()[_0x618f('0x17')](_0x618f('0x37'));_0x2a8f27[_0x618f('0x38')]=0xd;_0x2a8f27[_0x618f('0x39')]='Blacklist';_0x2a8f27[_0x618f('0x3a')]=_0x28eafb;_0x2a8f27[_0x618f('0x3b')]=_0x28eafb;_0x2a8f27['endtime']=_0x28eafb;};exports[_0x618f('0x3c')]=function(_0x3b03ab,_0x33486e,_0x7c0928){var _0x243876=moment()[_0x618f('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b03ab['state']=_0x33486e;_0x3b03ab[_0x618f('0x39')]=_0x7c0928;_0x3b03ab['responsetime']=_0x243876;_0x3b03ab[_0x618f('0x3d')]=getSeconds(_0x3b03ab['responsetime'],_0x3b03ab[_0x618f('0x3a')]);};exports[_0x618f('0x3e')]=function(_0x1679d0,_0x5e48a7,_0x5d4817){_0x1679d0[_0x618f('0x3f')]=_0x5e48a7;_0x1679d0[_0x618f('0x40')]=_0x5d4817;};exports[_0x618f('0x41')]=function(_0xdb439,_0x442d67,_0x434b3d){var _0x4f3652=moment()[_0x618f('0x17')](_0x618f('0x37'));_0xdb439['state']=_0x442d67;_0xdb439['statedesc']=_0x434b3d;_0xdb439[_0x618f('0x3b')]=_0xdb439[_0x618f('0x3b')]?_0xdb439[_0x618f('0x3b')]:_0x4f3652;_0xdb439[_0x618f('0x42')]=_0xdb439[_0x618f('0x42')]?_0xdb439['endtime']:_0x4f3652;_0xdb439[_0x618f('0x3d')]=getSeconds(_0xdb439[_0x618f('0x3b')]||0x0,_0xdb439[_0x618f('0x3a')]||0x0);_0xdb439['talktime']=_0xdb439[_0x618f('0x43')]?getSeconds(_0xdb439[_0x618f('0x42')],_0xdb439[_0x618f('0x43')]):0x0;};exports['isFailure']=function(_0x54a0ac){return _0x54a0ac===_0x618f('0x44');};exports['variablesAction']=function(_0x464fa0,_0x3d165a,_0x29e4a0,_0x1ad4db,_0x1d2d7c){var _0x56be8e=_0x1ad4db?_0x618f('0x45'):_0x464fa0[_0x618f('0x18')];_0x56be8e=_0x1d2d7c?_0x618f('0x46'):_0x56be8e;return{'actionid':_0x464fa0[_0x618f('0x47')],'action':'originate','channel':_0x464fa0['channelAgent'],'callerid':util[_0x618f('0x17')](_0x618f('0x11'),_0x56be8e,_0x464fa0[_0x618f('0x19')]),'Exten':_0x618f('0x48'),'Context':_0x618f('0x49'),'Priority':'1','variable':_0x29e4a0,'timeout':(_0x3d165a[_0x618f('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x464fa0['uniqueid']};};exports[_0x618f('0x4b')]=function(_0x195dea){return _0x195dea[_0x618f('0x4c')]+_0x195dea['countcongestionretry']+_0x195dea[_0x618f('0x4d')]+_0x195dea[_0x618f('0x4e')]+_0x195dea[_0x618f('0x4f')];};exports[_0x618f('0x50')]=function(_0x4caae1){var _0x29aa80=_[_0x618f('0x51')](_0x4caae1);_0x29aa80[_0x618f('0x38')]=0xf;_0x29aa80['statedesc']=_0x618f('0x52');return _0x29aa80;};exports['scheduledAt']=function(_0x5592bb,_0x24f087,_0x479353){var _0x1e28e6={};_0x1e28e6[_0x24f087]=_0x5592bb[_0x24f087];_0x1e28e6[_0x618f('0x53')]=![];_0x1e28e6['scheduledat']=moment()[_0x618f('0x54')](_0x479353,_0x618f('0x55'))['format'](_0x618f('0x37'));_0x1e28e6[_0x618f('0x1a')]=_0x5592bb[_0x618f('0x1a')];_0x1e28e6[_0x618f('0x56')]=_0x5592bb['ListId'];_0x1e28e6['VoiceQueueId']=_0x5592bb[_0x618f('0x1c')]||undefined;return _0x1e28e6;};exports['decrementTalkink']=function(_0x991fd9,_0x4f5f27){if(!_[_0x618f('0x14')](_0x991fd9)){if(_0x991fd9[_0x618f('0x57')]>0x0){_0x991fd9['pTalking']-=0x1;}else{logger['error'](_0x4f5f27,_0x618f('0x58'));}}else{logger[_0x618f('0x8')](_0x4f5f27,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x618f('0x59')]=function(_0x3b7a92){if(_0x3b7a92<=0x0){return!![];}return![];};exports[_0x618f('0x5a')]=function(_0x2438a7,_0x46d1eb,_0x2aaf2b){_0x2438a7[_0x618f('0x5b')]=_0x46d1eb;_0x2438a7[_0x618f('0x16')]=_0x2438a7[_0x618f('0x5c')];_0x2438a7[_0x618f('0x5d')]=_0x2438a7[_0x618f('0x5e')];_0x2438a7[_0x618f('0x5f')]=_0x618f('0x60');if(_0x2aaf2b){_0x2438a7[_0x618f('0x61')]=_0x2aaf2b[_0x618f('0x61')];}return _0x2438a7;};exports[_0x618f('0x62')]=function(_0x57c0b6){var _0x98fdee={};_0x98fdee[_0x618f('0x5c')]=_0x57c0b6[_0x618f('0x5c')];_0x98fdee['interface']=_0x57c0b6[_0x618f('0x5e')];_0x98fdee['uniqueid']=_0x57c0b6[_0x618f('0x47')];return _0x98fdee;};exports[_0x618f('0x63')]=function(_0x5af3c5){var _0x1da2f7=[];for(var _0x3ef4fd in _0x5af3c5){if(_0x5af3c5[_0x618f('0x31')](_0x3ef4fd)){if(!_[_0x618f('0x14')](_0x5af3c5[_0x3ef4fd])&&_0x5af3c5[_0x3ef4fd][_0x618f('0x38')]===_0x618f('0x64')&&_0x5af3c5[_0x3ef4fd][_0x618f('0x65')]===_0x618f('0x66')){_0x1da2f7[_0x618f('0x67')](_0x5af3c5[_0x3ef4fd]['id']);}}}return _0x1da2f7;};exports[_0x618f('0x68')]=function(_0x1267ea){var _0x32d977=moment()['milliseconds'](0x0);var _0x59d630=moment(_0x1267ea)['milliseconds'](0x0);return _0x32d977[_0x618f('0x7')](_0x59d630,_0x618f('0x69'));};exports[_0x618f('0x6a')]=function(_0x731ae2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x731ae2[_0x618f('0x1a')],'ListId':_0x731ae2[_0x618f('0x56')],'VoiceQueueId':_0x731ae2[_0x618f('0x1c')]||undefined,'CampaignId':_0x731ae2[_0x618f('0x6b')]||undefined};};exports['filterKey']=function(_0xa0c074){if(_0xa0c074==='uniqueid'||_0xa0c074==='idContact'||_0xa0c074===_0x618f('0x5c')||_0xa0c074===_0x618f('0x6c')||_0xa0c074==='campaigntype'||_0xa0c074===_0x618f('0x6d')||_0xa0c074===_0x618f('0x3f')||_0xa0c074===_0x618f('0x5e')||_0xa0c074==='calleridname'||_0xa0c074===_0x618f('0x53')||_0xa0c074==='calleridnum'||_0xa0c074==='scheduledat'||_0xa0c074===_0x618f('0x4c')||_0xa0c074===_0x618f('0x6e')||_0xa0c074==='countnoanswerretry'||_0xa0c074===_0x618f('0x6f')||_0xa0c074===_0x618f('0x70')||_0xa0c074===_0x618f('0x71')||_0xa0c074==='callbackat'||_0xa0c074===_0x618f('0x72')||_0xa0c074===_0x618f('0x1a')||_0xa0c074===_0x618f('0x56')||_0xa0c074==='UserId'||_0xa0c074==='VoiceQueueId'||_0xa0c074==='sipcallid'||_0xa0c074===_0x618f('0x73')||_0xa0c074==='xmd-queue'||_0xa0c074==='xmd-phone'||_0xa0c074===_0x618f('0x74')||_0xa0c074==='xmd-dialurl'||_0xa0c074===_0x618f('0x75')||_0xa0c074==='xmd-dialoptions'||_0xa0c074===_0x618f('0x76')||_0xa0c074===_0x618f('0x77')||_0xa0c074===_0x618f('0x78')||_0xa0c074===_0x618f('0x79')||_0xa0c074==='xmd-callerid'||_0xa0c074===_0x618f('0x7a')||_0xa0c074==='xmd-agi'||_0xa0c074===_0x618f('0x7b')||_0xa0c074===_0x618f('0x7c')||_0xa0c074===_0x618f('0x7d')||_0xa0c074===_0x618f('0x7e')||_0xa0c074===_0x618f('0x7f')||_0xa0c074==='rtpaudioqoslossbridged'||_0xa0c074==='rtpaudioqosrtt'||_0xa0c074===_0x618f('0x80')||_0xa0c074==='rtpaudioqos'||_0xa0c074===_0x618f('0x7c')||_0xa0c074===_0x618f('0x7d')||_0xa0c074==='rtpaudioqosjitterbridged'||_0xa0c074==='rtpaudioqosloss'||_0xa0c074==='rtpaudioqoslossbridged'||_0xa0c074===_0x618f('0x81')||_0xa0c074===_0x618f('0x80')||_0xa0c074===_0x618f('0x82')||_0xa0c074===_0x618f('0x83')||_0xa0c074==='state'||_0xa0c074===_0x618f('0x39')){return![];}return!![];};exports[_0x618f('0x84')]=function(_0x44667b,_0x287fb1){var _0x35469d,_0x1e18e5,_0x2c6b1c;if(_0x287fb1<=0x0){_0x287fb1=0x1;}_0x35469d=new RegExp(_0x618f('0x85')+_0x287fb1+'}$');_0x1e18e5=Math[_0x618f('0x86')](0xa,_0x287fb1-0x1);_0x2c6b1c=Math[_0x618f('0x86')](0xa,_0x287fb1)-0x1;return util[_0x618f('0x17')]('%s',_[_0x618f('0x87')](_0x44667b,_0x35469d,_[_0x618f('0x88')](_0x1e18e5,_0x2c6b1c)));};exports[_0x618f('0x89')]=function(_0x1cf7c6){var _0x591270=_0x1cf7c6[_0x618f('0x8a')](/"(.*?)"/);return _0x591270?_0x591270[0x1]:_0x1cf7c6;};exports['extractCalleridNumber']=function(_0x51d218){var _0x30c02a=_0x51d218[_0x618f('0x8a')](/<(.*?)>/);return _0x30c02a?_0x30c02a[0x1]:_0x51d218;}; \ No newline at end of file +var _0xcc9b=['clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildAcw','not_inuse','status','reachable','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callbackuniqueid','UserId','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','responsetime','ringtime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry'];(function(_0x1a2ef3,_0x31d8cc){var _0x3920dd=function(_0x325524){while(--_0x325524){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x3920dd(++_0x31d8cc);}(_0xcc9b,0x146));var _0xbcc9=function(_0x8fd0cf,_0x47bb4e){_0x8fd0cf=_0x8fd0cf-0x0;var _0x3f68b9=_0xcc9b[_0x8fd0cf];return _0x3f68b9;};'use strict';var util=require(_0xbcc9('0x0'));var _=require(_0xbcc9('0x1'));var moment=require(_0xbcc9('0x2'));var logger=require(_0xbcc9('0x3'))(_0xbcc9('0x4'));var ipAgi=process['env'][_0xbcc9('0x5')]||'127.0.0.1';function getSeconds(_0x4d3ab2,_0x595ebe){var _0x29dc10=moment(_0x4d3ab2)[_0xbcc9('0x6')](0x0);var _0x30a4da=moment(_0x595ebe)['milliseconds'](0x0);return _0x29dc10[_0xbcc9('0x7')](_0x30a4da,_0xbcc9('0x8'));}exports[_0xbcc9('0x9')]=function(_0x32466c){return function(_0xc30fc1){logger['error'](_0x32466c,util[_0xbcc9('0xa')](_0xc30fc1,{'showHidden':![],'depth':null}));};};exports[_0xbcc9('0xb')]=function(_0x414f1f,_0x8ec616){logger[_0xbcc9('0xc')](_0x414f1f,util[_0xbcc9('0xa')](_0x8ec616,{'showHidden':![],'depth':null}));};exports[_0xbcc9('0xd')]=function(_0x362f1f,_0x54b5d1){logger[_0xbcc9('0xe')](_0x362f1f,util['inspect'](_0x54b5d1,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x77895a){return function(_0x345a08){logger[_0xbcc9('0xc')](_0x77895a,util[_0xbcc9('0xa')](_0x345a08,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2ee6ba,_0x4113d2,_0x407c96){return{'message':_0x2ee6ba,'unlock':_0x4113d2,'active':_0x407c96};};exports[_0xbcc9('0xf')]=function(_0x8d1abc,_0x5847d2,_0x1dfa2a){if(!_[_0xbcc9('0x10')](_0x1dfa2a)&&_0xbcc9('0x11')===typeof _0x1dfa2a&&!_[_0xbcc9('0x12')](_0x1dfa2a)){if(!_[_0xbcc9('0x10')](_0x5847d2)&&_0xbcc9('0x11')===typeof _0x5847d2&&!_[_0xbcc9('0x12')](_0x5847d2)){return util[_0xbcc9('0x13')](_0xbcc9('0x14'),_0x5847d2,_0x1dfa2a);}return util[_0xbcc9('0x13')](_0xbcc9('0x14'),_0x1dfa2a,_0x1dfa2a);}if(!_[_0xbcc9('0x10')](_0x8d1abc)&&_0xbcc9('0x11')===typeof _0x8d1abc&&!_[_0xbcc9('0x12')](_0x8d1abc)){return _0x8d1abc;}return _0xbcc9('0x15');};exports[_0xbcc9('0x16')]=function(_0x50b68c){if(_[_0xbcc9('0x17')](_0x50b68c)){return![];}return _0x50b68c;};exports[_0xbcc9('0x18')]=function(_0x564b50,_0x3c8945,_0x3dd3ea,_0x525e64,_0x3c4ea7,_0x1e6d90){var _0x2bb4a7={'XMD-QUEUE':_0x3c8945['Queue']?_0x3c8945[_0xbcc9('0x19')][_0xbcc9('0x1a')]:'','XMD-CALLERID':_0x525e64,'XMD-CALLERID-PREVIEW':_0x1e6d90?util[_0xbcc9('0x13')]('\x22%s\x22\x20<%s>',_0x1e6d90[_0xbcc9('0x1b')],_0x1e6d90[_0xbcc9('0x1c')]):_0x525e64,'XMD-DIALID':_0x3c4ea7,'XMD-CONTACTID':_0x3c8945[_0xbcc9('0x1d')],'XMD-CDRTYPE':_0xbcc9('0x1e'),'CALLERID(all)':_0x525e64,'XMD-VOICEQUEUEID':_0x3c8945[_0xbcc9('0x1f')],'XMD-DIALCHANNEL':_0x3dd3ea,'XMD-DIALTIMEOUT':_0x564b50['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xbcc9('0x13')]('\x22rtTxX%s%s\x22',_0x564b50[_0xbcc9('0x20')]?'g':'',_[_0xbcc9('0x12')](_0x564b50[_0xbcc9('0x21')])?'':_0xbcc9('0x22')),'XMD-DIALURL':_0x564b50[_0xbcc9('0x23')]||'','XMD-AGI':_0x564b50[_0xbcc9('0x24')]?util[_0xbcc9('0x13')](_0xbcc9('0x25'),ipAgi,_0x564b50['dialQueueProject']):_0xbcc9('0x26'),'XMD-AGIAFTER':_0x564b50[_0xbcc9('0x20')]?util[_0xbcc9('0x13')](_0xbcc9('0x25'),ipAgi,_0x564b50[_0xbcc9('0x20')]):_0xbcc9('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x1e6d90?_0x1e6d90[_0xbcc9('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x1e6d90?_0x1e6d90['originatecalleridname']:'','XMD-DESTINATION':_0xbcc9('0x28'),'SIPADDHEADER':_0xbcc9('0x29')};if(!_['isEmpty'](_0x564b50[_0xbcc9('0x21')])){_0x2bb4a7[util[_0xbcc9('0x13')]('%s',_0xbcc9('0x2a'))]=_0x564b50['monitor_format'];_0x2bb4a7[util[_0xbcc9('0x13')]('%s',_0xbcc9('0x2b'))]=_0x3c4ea7;}if(_0x3c8945&&_0x3c8945[_0xbcc9('0x2c')]){for(var _0x46884c in _0x3c8945[_0xbcc9('0x2c')]){if(_0x3c8945[_0xbcc9('0x2c')][_0xbcc9('0x2d')](_0x46884c)){if(!_['isNil'](_0x3c8945[_0xbcc9('0x2c')][_0x46884c])&&_0x46884c!=='id'&&_0x46884c!=='tags'&&_0x46884c!==_0xbcc9('0x2e')&&_0x46884c!=='updatedAt'){_0x2bb4a7[util['format']('%s%s',_0xbcc9('0x2f'),_[_0xbcc9('0x30')](_0x46884c))]=_0x3c8945[_0xbcc9('0x2c')][_0x46884c];}}}}return _0x2bb4a7;};exports[_0xbcc9('0x31')]=function(_0x20b401){var _0x54f651={};for(var _0x5480d5 in _0x20b401){if(_0x20b401[_0xbcc9('0x2d')](_0x5480d5)){_0x54f651[util[_0xbcc9('0x13')]('%s',_[_0xbcc9('0x32')](_0x5480d5))]=_0x20b401[_0x5480d5];}}return{'variables':_0x54f651};};exports[_0xbcc9('0x33')]=function(_0x5c49cf,_0x426de1){if(!_[_0xbcc9('0x17')](_0x5c49cf)){if(_0x5c49cf['hasOwnProperty'](_0xbcc9('0x34'))){if(_0x5c49cf[_0xbcc9('0x34')]>0x0){_0x5c49cf[_0xbcc9('0x34')]-=0x1;}else{logger[_0xbcc9('0xe')](_0xbcc9('0x35'),_0x426de1);}}}else{logger[_0xbcc9('0xe')](_0xbcc9('0x36'),_0x426de1);}};exports['logBlacklist']=function(_0x229b9d){var _0x4bf8d8=moment()[_0xbcc9('0x13')](_0xbcc9('0x37'));_0x229b9d[_0xbcc9('0x38')]=0xd;_0x229b9d[_0xbcc9('0x39')]='Blacklist';_0x229b9d[_0xbcc9('0x3a')]=_0x4bf8d8;_0x229b9d['responsetime']=_0x4bf8d8;_0x229b9d[_0xbcc9('0x3b')]=_0x4bf8d8;};exports['logAgent']=function(_0x553413,_0x42eda4,_0x58d483){var _0x143ab9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x553413[_0xbcc9('0x38')]=_0x42eda4;_0x553413[_0xbcc9('0x39')]=_0x58d483;_0x553413[_0xbcc9('0x3c')]=_0x143ab9;_0x553413[_0xbcc9('0x3d')]=getSeconds(_0x553413[_0xbcc9('0x3c')],_0x553413[_0xbcc9('0x3a')]);};exports[_0xbcc9('0x3e')]=function(_0x23823f,_0x1b4d5f,_0x30aff8){_0x23823f[_0xbcc9('0x3f')]=_0x1b4d5f;_0x23823f['UserId']=_0x30aff8;};exports[_0xbcc9('0x40')]=function(_0x3b8661,_0x1382ec,_0x10d884){var _0x26fcc1=moment()['format'](_0xbcc9('0x37'));_0x3b8661[_0xbcc9('0x38')]=_0x1382ec;_0x3b8661[_0xbcc9('0x39')]=_0x10d884;_0x3b8661[_0xbcc9('0x3c')]=_0x3b8661[_0xbcc9('0x3c')]?_0x3b8661[_0xbcc9('0x3c')]:_0x26fcc1;_0x3b8661['endtime']=_0x3b8661[_0xbcc9('0x3b')]?_0x3b8661[_0xbcc9('0x3b')]:_0x26fcc1;_0x3b8661[_0xbcc9('0x3d')]=getSeconds(_0x3b8661[_0xbcc9('0x3c')]||0x0,_0x3b8661[_0xbcc9('0x3a')]||0x0);_0x3b8661[_0xbcc9('0x41')]=_0x3b8661['answertime']?getSeconds(_0x3b8661[_0xbcc9('0x3b')],_0x3b8661[_0xbcc9('0x42')]):0x0;};exports[_0xbcc9('0x43')]=function(_0x269e47){return _0x269e47===_0xbcc9('0x44');};exports[_0xbcc9('0x45')]=function(_0x4d8cde,_0x24d15c,_0x39ee29,_0x254fa0,_0x2e9b86){var _0x362519=_0x254fa0?_0xbcc9('0x46'):_0x4d8cde[_0xbcc9('0x1b')];_0x362519=_0x2e9b86?'BOOKED':_0x362519;return{'actionid':_0x4d8cde[_0xbcc9('0x47')],'action':'originate','channel':_0x4d8cde['channelAgent'],'callerid':util['format'](_0xbcc9('0x14'),_0x362519,_0x4d8cde[_0xbcc9('0x1c')]),'Exten':_0xbcc9('0x28'),'Context':_0xbcc9('0x48'),'Priority':'1','variable':_0x39ee29,'timeout':(_0x24d15c[_0xbcc9('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d8cde[_0xbcc9('0x47')]};};exports[_0xbcc9('0x4a')]=function(_0x399bb2){return _0x399bb2[_0xbcc9('0x4b')]+_0x399bb2[_0xbcc9('0x4c')]+_0x399bb2[_0xbcc9('0x4d')]+_0x399bb2[_0xbcc9('0x4e')]+_0x399bb2['countnosuchnumberretry'];};exports['cloneAction']=function(_0x112b54){var _0x31d607=_[_0xbcc9('0x4f')](_0x112b54);_0x31d607[_0xbcc9('0x38')]=0xf;_0x31d607['statedesc']='Global';return _0x31d607;};exports[_0xbcc9('0x50')]=function(_0x1255ef,_0x1e2445,_0x20ca64){var _0x159c37={};_0x159c37[_0x1e2445]=_0x1255ef[_0x1e2445];_0x159c37[_0xbcc9('0x51')]=![];_0x159c37[_0xbcc9('0x52')]=moment()[_0xbcc9('0x53')](_0x20ca64,_0xbcc9('0x54'))[_0xbcc9('0x13')](_0xbcc9('0x37'));_0x159c37[_0xbcc9('0x1d')]=_0x1255ef[_0xbcc9('0x1d')];_0x159c37[_0xbcc9('0x55')]=_0x1255ef['ListId'];_0x159c37['VoiceQueueId']=_0x1255ef[_0xbcc9('0x1f')]||undefined;return _0x159c37;};exports[_0xbcc9('0x56')]=function(_0x5ab5ba,_0x1ef967){if(!_['isNil'](_0x5ab5ba)){if(_0x5ab5ba[_0xbcc9('0x57')]>0x0){_0x5ab5ba[_0xbcc9('0x57')]-=0x1;}else{logger[_0xbcc9('0xe')](_0x1ef967,_0xbcc9('0x58'));}}else{logger[_0xbcc9('0xe')](_0x1ef967,_0xbcc9('0x59'));}};exports['IsNotLoggedIn']=function(_0x4f7cb8){if(_0x4f7cb8<=0x0){return!![];}return![];};exports[_0xbcc9('0x5a')]=function(_0x16ff26,_0x434f10,_0xf64eef){_0x16ff26[_0xbcc9('0x5b')]=_0x434f10;_0x16ff26[_0xbcc9('0x1a')]=_0x16ff26[_0xbcc9('0x5c')];_0x16ff26[_0xbcc9('0x5d')]=_0x16ff26[_0xbcc9('0x5e')];_0x16ff26[_0xbcc9('0x5f')]='voice';if(_0xf64eef){_0x16ff26[_0xbcc9('0x60')]=_0xf64eef['mandatoryDisposition'];}return _0x16ff26;};exports[_0xbcc9('0x61')]=function(_0x555c95){var _0x108584={};_0x108584[_0xbcc9('0x5c')]=_0x555c95[_0xbcc9('0x5c')];_0x108584['interface']=_0x555c95[_0xbcc9('0x5e')];_0x108584[_0xbcc9('0x47')]=_0x555c95['uniqueid'];return _0x108584;};exports['agentReadyId']=function(_0x25b217){var _0x546a3f=[];for(var _0x2d064a in _0x25b217){if(_0x25b217[_0xbcc9('0x2d')](_0x2d064a)){if(!_[_0xbcc9('0x17')](_0x25b217[_0x2d064a])&&_0x25b217[_0x2d064a][_0xbcc9('0x38')]===_0xbcc9('0x62')&&_0x25b217[_0x2d064a][_0xbcc9('0x63')]===_0xbcc9('0x64')){_0x546a3f['push'](_0x25b217[_0x2d064a]['id']);}}}return _0x546a3f;};exports['getDiff']=function(_0x11e788){var _0x5941ab=moment()[_0xbcc9('0x6')](0x0);var _0x101f7f=moment(_0x11e788)[_0xbcc9('0x6')](0x0);return _0x5941ab['diff'](_0x101f7f,_0xbcc9('0x8'));};exports['createBody']=function(_0x2d63b7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2d63b7[_0xbcc9('0x1d')],'ListId':_0x2d63b7[_0xbcc9('0x55')],'VoiceQueueId':_0x2d63b7['VoiceQueueId']||undefined,'CampaignId':_0x2d63b7[_0xbcc9('0x65')]||undefined};};exports['filterKey']=function(_0x2417d5){if(_0x2417d5===_0xbcc9('0x47')||_0x2417d5===_0xbcc9('0x66')||_0x2417d5===_0xbcc9('0x5c')||_0x2417d5===_0xbcc9('0x67')||_0x2417d5===_0xbcc9('0x68')||_0x2417d5===_0xbcc9('0x69')||_0x2417d5===_0xbcc9('0x3f')||_0x2417d5==='channelAgent'||_0x2417d5==='calleridname'||_0x2417d5===_0xbcc9('0x51')||_0x2417d5==='calleridnum'||_0x2417d5===_0xbcc9('0x52')||_0x2417d5===_0xbcc9('0x4b')||_0x2417d5==='countcongestionretry'||_0x2417d5===_0xbcc9('0x4d')||_0x2417d5===_0xbcc9('0x6a')||_0x2417d5==='callback'||_0x2417d5===_0xbcc9('0x6b')||_0x2417d5==='callbackat'||_0x2417d5==='recallme'||_0x2417d5==='ContactId'||_0x2417d5===_0xbcc9('0x55')||_0x2417d5===_0xbcc9('0x6c')||_0x2417d5==='VoiceQueueId'||_0x2417d5==='sipcallid'||_0x2417d5===_0xbcc9('0x6d')||_0x2417d5==='xmd-queue'||_0x2417d5===_0xbcc9('0x6e')||_0x2417d5===_0xbcc9('0x6f')||_0x2417d5===_0xbcc9('0x70')||_0x2417d5===_0xbcc9('0x71')||_0x2417d5===_0xbcc9('0x72')||_0x2417d5===_0xbcc9('0x73')||_0x2417d5===_0xbcc9('0x74')||_0x2417d5===_0xbcc9('0x75')||_0x2417d5==='xmd-cdrtype'||_0x2417d5==='xmd-callerid'||_0x2417d5==='xmd-agiafter'||_0x2417d5===_0xbcc9('0x76')||_0x2417d5===_0xbcc9('0x77')||_0x2417d5===_0xbcc9('0x78')||_0x2417d5===_0xbcc9('0x79')||_0x2417d5===_0xbcc9('0x7a')||_0x2417d5===_0xbcc9('0x7b')||_0x2417d5===_0xbcc9('0x7c')||_0x2417d5===_0xbcc9('0x7d')||_0x2417d5===_0xbcc9('0x7e')||_0x2417d5===_0xbcc9('0x77')||_0x2417d5==='rtpaudioqosbridged'||_0x2417d5===_0xbcc9('0x79')||_0x2417d5===_0xbcc9('0x7a')||_0x2417d5===_0xbcc9('0x7b')||_0x2417d5===_0xbcc9('0x7c')||_0x2417d5==='rtpaudioqosrtt'||_0x2417d5===_0xbcc9('0x7e')||_0x2417d5===_0xbcc9('0x7f')||_0x2417d5===_0xbcc9('0x80')||_0x2417d5===_0xbcc9('0x38')||_0x2417d5==='statedesc'){return![];}return!![];};exports[_0xbcc9('0x81')]=function(_0x224e1e,_0x468c6b){var _0x173d6d,_0xea5be5,_0x1e516a;if(_0x468c6b<=0x0){_0x468c6b=0x1;}_0x173d6d=new RegExp(_0xbcc9('0x82')+_0x468c6b+'}$');_0xea5be5=Math['pow'](0xa,_0x468c6b-0x1);_0x1e516a=Math['pow'](0xa,_0x468c6b)-0x1;return util[_0xbcc9('0x13')]('%s',_[_0xbcc9('0x83')](_0x224e1e,_0x173d6d,_[_0xbcc9('0x84')](_0xea5be5,_0x1e516a)));};exports[_0xbcc9('0x85')]=function(_0x1a5897){var _0x154a68=_0x1a5897[_0xbcc9('0x86')](/"(.*?)"/);return _0x154a68?_0x154a68[0x1]:_0x1a5897;};exports['extractCalleridNumber']=function(_0x537248){var _0x5da8e7=_0x537248[_0xbcc9('0x86')](/<(.*?)>/);return _0x5da8e7?_0x5da8e7[0x1]:_0x537248;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 32c94b5..34fabfe 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 _0xcc68=['reload','voicequeuechannel','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause'];(function(_0x524d1d,_0x1a30b4){var _0x8ca1eb=function(_0x271959){while(--_0x271959){_0x524d1d['push'](_0x524d1d['shift']());}};_0x8ca1eb(++_0x1a30b4);}(_0xcc68,0x193));var _0x8cc6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcc68[_0x40a045];return _0x1a687c;};'use strict';exports['queueadd']={'queue':{'type':_0x8cc6('0x0'),'required':!![]},'interface':{'type':_0x8cc6('0x0'),'required':!![]},'membername':{'type':_0x8cc6('0x0'),'required':!![]},'penalty':{'type':_0x8cc6('0x1'),'required':![]},'paused':{'type':_0x8cc6('0x2'),'required':![]}};exports[_0x8cc6('0x3')]={'queue':{'type':_0x8cc6('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x8cc6('0x4')]={'interface':{'type':_0x8cc6('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x8cc6('0x0'),'required':![]}};exports[_0x8cc6('0x5')]={'module':{'type':_0x8cc6('0x0'),'required':![]}};exports[_0x8cc6('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x8cc6('0x0'),'required':!![]},'filename':{'type':_0x8cc6('0x0')},'format':{'type':_0x8cc6('0x0')},'mixmonitorid':{'type':_0x8cc6('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x8cc6('0x0'),'required':!![]}};exports[_0x8cc6('0x7')]={'uniqueid':{'type':_0x8cc6('0x0'),'required':!![]},'exten':{'type':_0x8cc6('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x92c3=['number','boolean','queueremove','string','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x510319,_0x19b0a8){var _0x2e5dbc=function(_0x47b799){while(--_0x47b799){_0x510319['push'](_0x510319['shift']());}};_0x2e5dbc(++_0x19b0a8);}(_0x92c3,0x99));var _0x392c=function(_0x93a020,_0x2026ab){_0x93a020=_0x93a020-0x0;var _0x15bcfb=_0x92c3[_0x93a020];return _0x15bcfb;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x392c('0x0'),'required':![]},'paused':{'type':_0x392c('0x1'),'required':![]}};exports[_0x392c('0x2')]={'queue':{'type':_0x392c('0x3'),'required':!![]},'interface':{'type':_0x392c('0x3'),'required':!![]}};exports[_0x392c('0x4')]={'interface':{'type':_0x392c('0x3'),'required':!![]},'paused':{'type':_0x392c('0x1')},'reason':{'type':'string','required':![]}};exports[_0x392c('0x5')]={'module':{'type':'string','required':![]}};exports[_0x392c('0x6')]={'uniqueid':{'type':_0x392c('0x3'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x392c('0x3'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x392c('0x3')},'mixmonitorid':{'type':_0x392c('0x3')}};exports[_0x392c('0x7')]={'uniqueid':{'type':_0x392c('0x3'),'required':!![]}};exports[_0x392c('0x8')]={'uniqueid':{'type':_0x392c('0x3'),'required':!![]},'exten':{'type':_0x392c('0x3'),'required':!![]},'context':{'type':_0x392c('0x3')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 16eaa77..787085c 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 _0xfb35=['dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','trunks','voiceQueues','templates','voiceExtensions','queueChannels','timers','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','isNil','name','interface','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','agents','initTelephones','isUndefined','telephones','format','initTrunks','initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','outbound','duration','disposition','billableseconds','initCampaigns','campaigns'];(function(_0x3d175,_0x8634e0){var _0x508de4=function(_0x29b8c4){while(--_0x29b8c4){_0x3d175['push'](_0x3d175['shift']());}};_0x508de4(++_0x8634e0);}(_0xfb35,0x1c2));var _0x5fb3=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0xfb35[_0x19dd7a];return _0x3feb6a;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x5fb3('0x0'));var moment=require(_0x5fb3('0x1'));var Agent=require(_0x5fb3('0x2'));var Telephone=require(_0x5fb3('0x3'));var Trunk=require(_0x5fb3('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5fb3('0x5'));var Template=require('../model/template');var Campaign=require(_0x5fb3('0x6'));var VoiceExtension=require(_0x5fb3('0x7'));var ZendeskAccount=require(_0x5fb3('0x8'));var SalesforceAccount=require(_0x5fb3('0x9'));var FreshdeskAccount=require(_0x5fb3('0xa'));var SugarcrmAccount=require(_0x5fb3('0xb'));var ZohoAccount=require(_0x5fb3('0xc'));var DeskAccount=require(_0x5fb3('0xd'));var VtigerAccount=require(_0x5fb3('0xe'));var ServicenowAccount=require(_0x5fb3('0xf'));var Dynamics365Account=require(_0x5fb3('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x5fb3('0x11'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x5fb3('0x12')]={};this[_0x5fb3('0x13')]={};this['triggers']={};this['campaigns']={};this[_0x5fb3('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5fb3('0x15')]={};this['channels']={};this[_0x5fb3('0x16')]={};this['outboundChannels']={};this[_0x5fb3('0x17')]={};this['settings']={};this['zendeskAccounts']={};this[_0x5fb3('0x18')]={};this[_0x5fb3('0x19')]={};this['freshdeskAccounts']={};this[_0x5fb3('0x1a')]={};this[_0x5fb3('0x1b')]={};this[_0x5fb3('0x1c')]={};this[_0x5fb3('0x1d')]={};this[_0x5fb3('0x1e')]={};this[_0x5fb3('0x1f')]={};this[_0x5fb3('0x20')]={};};function freeIsNotKey(_0x2c1a6a,_0x502116,_0x718314){var _0x58b384=_[_0x5fb3('0x21')](_0x2c1a6a,function(_0x2be919,_0x1fe437){return _0x2be919[_0x718314];});for(var _0x474c70 in _0x502116){if(_0x502116[_0x5fb3('0x22')](_0x474c70)){if(!_0x58b384[_0x474c70]){delete _0x502116[_0x474c70];}}}}function freeIsNotKeySip(_0xc7f442,_0x5430af){var _0x240353=_[_0x5fb3('0x21')](_0xc7f442,function(_0x155863,_0x1e0977){return util['format'](_0x5fb3('0x23'),_0x155863['name']);});for(var _0x41c395 in _0x5430af){if(_0x5430af[_0x5fb3('0x22')](_0x41c395)){if(!_0x240353[_0x41c395]){delete _0x5430af[_0x41c395];}}}}function freeIsNotKeyAgent(_0x345845,_0x49c1af){var _0x19473f=_[_0x5fb3('0x21')](_0x345845,function(_0x2b07a5,_0x7b6dec){var _0x1fa8b9=_[_0x5fb3('0x24')](_0x2b07a5['interface'])?util['format'](_0x5fb3('0x23'),_0x2b07a5[_0x5fb3('0x25')]):_0x2b07a5[_0x5fb3('0x26')];return _0x1fa8b9;});for(var _0x4e8858 in _0x49c1af){if(_0x49c1af['hasOwnProperty'](_0x4e8858)){if(!_0x19473f[_0x4e8858]){delete _0x49c1af[_0x4e8858];}}}}function clearVoiceCallReports(_0x2e1cfb){_0x2e1cfb['total']=0x0;_0x2e1cfb[_0x5fb3('0x27')]=0x0;_0x2e1cfb[_0x5fb3('0x28')]=0x0;_0x2e1cfb[_0x5fb3('0x29')]=0x0;_0x2e1cfb[_0x5fb3('0x2a')]=0x0;}function clearCampaigns(_0x4352ee){if(!_[_0x5fb3('0x2b')](_0x4352ee)){for(var _0x17aa49 in _0x4352ee){if(_0x4352ee['hasOwnProperty'](_0x17aa49)){_0x4352ee[_0x17aa49][_0x5fb3('0x2c')]=0x0;_0x4352ee[_0x17aa49][_0x5fb3('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x51730d){if(!_[_0x5fb3('0x2b')](_0x51730d)){for(var _0x5410d6 in _0x51730d){if(_0x51730d[_0x5fb3('0x22')](_0x5410d6)){_0x51730d[_0x5410d6][_0x5fb3('0x2e')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x27')]=0x0;_0x51730d[_0x5410d6]['unmanaged']=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x2f')]=0x0;_0x51730d[_0x5410d6]['sumHoldTime']=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x29')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x2a')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x30')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x31')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x32')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x33')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x34')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x35')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x36')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x37')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x38')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x39')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x3a')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x3b')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x30')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x3c')]=0x0;_0x51730d[_0x5410d6][_0x5fb3('0x3d')]=!![];}}}}Realtime['prototype'][_0x5fb3('0x3e')]=function(_0x39bbef,_0x16dad3){for(var _0x48b365 in _0x16dad3){if(_0x39bbef['hasOwnProperty'](_0x48b365)){_0x39bbef[_0x48b365]=_0x16dad3[_0x48b365];}}};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x40')]=function(){var _0x5450ee=this;return function(_0x1d30e7){if(_0x1d30e7){freeIsNotKeyAgent(_0x1d30e7,_0x5450ee['agents']);for(var _0x2fd1fe=0x0,_0x9d1e7={},_0x1d5bd2={};_0x2fd1fe<_0x1d30e7[_0x5fb3('0x41')];_0x2fd1fe+=0x1){_0x9d1e7=_0x1d30e7[_0x2fd1fe];var _0x305a01=_['isNil'](_0x9d1e7['interface'])?util['format'](_0x5fb3('0x23'),_0x9d1e7[_0x5fb3('0x25')]):_0x9d1e7[_0x5fb3('0x26')];if(_['isUndefined'](_0x5450ee[_0x5fb3('0x42')][_0x305a01])){_0x5450ee[_0x5fb3('0x42')][_0x305a01]=new Agent(_0x9d1e7);}else{_0x5450ee[_0x5fb3('0x3e')](_0x5450ee[_0x5fb3('0x42')][_0x305a01],_0x9d1e7);}}}return _0x5450ee[_0x5fb3('0x42')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x43')]=function(){var _0x5067c4=this;return function(_0x2b2e4e){if(_0x2b2e4e){freeIsNotKeySip(_0x2b2e4e,_0x5067c4['telephones']);for(var _0x2a920a=0x0,_0x5df1e4={},_0x484056={};_0x2a920a<_0x2b2e4e[_0x5fb3('0x41')];_0x2a920a+=0x1){_0x5df1e4=_0x2b2e4e[_0x2a920a];if(_[_0x5fb3('0x44')](_0x5067c4[_0x5fb3('0x45')][util[_0x5fb3('0x46')](_0x5fb3('0x23'),_0x5df1e4[_0x5fb3('0x25')])])){_0x5067c4[_0x5fb3('0x45')][util[_0x5fb3('0x46')]('SIP/%s',_0x5df1e4[_0x5fb3('0x25')])]=new Telephone(_0x5df1e4);}else{_0x5067c4[_0x5fb3('0x3e')](_0x5067c4[_0x5fb3('0x45')][util[_0x5fb3('0x46')](_0x5fb3('0x23'),_0x5df1e4['name'])],_0x5df1e4);}}}return _0x5067c4[_0x5fb3('0x45')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x47')]=function(){var _0x578a52=this;return function(_0x221104){if(_0x221104){freeIsNotKeySip(_0x221104,_0x578a52['trunks']);for(var _0x1d75bf=0x0,_0x21e15c={},_0x1ad983={};_0x1d75bf<_0x221104[_0x5fb3('0x41')];_0x1d75bf+=0x1){_0x21e15c=_0x221104[_0x1d75bf];if(_['isUndefined'](_0x578a52[_0x5fb3('0x12')][util[_0x5fb3('0x46')]('SIP/%s',_0x21e15c[_0x5fb3('0x25')])])){_0x578a52[_0x5fb3('0x12')][util[_0x5fb3('0x46')](_0x5fb3('0x23'),_0x21e15c['name'])]=new Trunk(_0x21e15c);}else{_0x578a52[_0x5fb3('0x3e')](_0x578a52['trunks'][util[_0x5fb3('0x46')](_0x5fb3('0x23'),_0x21e15c[_0x5fb3('0x25')])],_0x21e15c);}}}return _0x578a52[_0x5fb3('0x12')];};};Realtime[_0x5fb3('0x3f')]['initVoiceQueues']=function(){var _0x22127b=this;return function(_0x300fc8){if(_0x300fc8){freeIsNotKey(_0x300fc8,_0x22127b['voiceQueues'],_0x5fb3('0x25'));for(var _0x3f084c=0x0,_0x5b9fc8={},_0x1a61b3={};_0x3f084c<_0x300fc8[_0x5fb3('0x41')];_0x3f084c+=0x1){_0x5b9fc8=_0x300fc8[_0x3f084c];if(_[_0x5fb3('0x44')](_0x22127b[_0x5fb3('0x13')][_0x5b9fc8['name']])){_0x22127b[_0x5fb3('0x13')][_0x5b9fc8['name']]=new VoiceQueue(_0x5b9fc8);}else{_0x22127b['mergeFromDatabase'](_0x22127b[_0x5fb3('0x13')][_0x5b9fc8['name']],_0x5b9fc8);}}}return _0x22127b[_0x5fb3('0x13')];};};Realtime['prototype'][_0x5fb3('0x48')]=function(){var _0x4f2e5e=this;return function(_0x55d8b0){if(_0x55d8b0){freeIsNotKey(_0x55d8b0,_0x4f2e5e[_0x5fb3('0x49')],'id');for(var _0x5ebde9=0x0,_0x31f702={},_0x281883={};_0x5ebde9<_0x55d8b0['length'];_0x5ebde9+=0x1){_0x31f702=_0x55d8b0[_0x5ebde9];if(_[_0x5fb3('0x44')](_0x4f2e5e[_0x5fb3('0x49')][_0x31f702['id']])){_0x4f2e5e[_0x5fb3('0x49')][_0x31f702['id']]=new Trigger(_0x31f702);}else{_0x4f2e5e[_0x5fb3('0x3e')](_0x4f2e5e[_0x5fb3('0x49')][_0x31f702['id']],_0x31f702);}}}return _0x4f2e5e[_0x5fb3('0x49')];};};Realtime['prototype'][_0x5fb3('0x4a')]=function(){var _0x161857=this;return function(_0x350c31){if(_0x350c31){freeIsNotKey(_0x350c31,_0x161857[_0x5fb3('0x14')],'id');for(var _0x1942cb=0x0,_0x1af004={},_0x2fef80={};_0x1942cb<_0x350c31[_0x5fb3('0x41')];_0x1942cb+=0x1){_0x1af004=_0x350c31[_0x1942cb];if(_[_0x5fb3('0x44')](_0x161857[_0x5fb3('0x14')][_0x1af004['id']])){_0x161857[_0x5fb3('0x14')][_0x1af004['id']]=new Template(_0x1af004);}else{_0x161857['mergeFromDatabase'](_0x161857[_0x5fb3('0x14')][_0x1af004['id']],_0x1af004);}}}return _0x161857['templates'];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x4b')]=function(){var _0x275d34=this;return function(_0x5654b6){if(_0x5654b6){freeIsNotKey(_0x5654b6,_0x275d34[_0x5fb3('0x4c')],'id');for(var _0x2fc4e6=0x0,_0x641936={},_0x2fd45e={};_0x2fc4e6<_0x5654b6['length'];_0x2fc4e6+=0x1){_0x641936=_0x5654b6[_0x2fc4e6];if(_[_0x5fb3('0x44')](_0x275d34['zendeskAccounts'][_0x641936['id']])){_0x275d34[_0x5fb3('0x4c')][_0x641936['id']]=new ZendeskAccount(_0x641936);}else{_0x275d34[_0x5fb3('0x3e')](_0x275d34[_0x5fb3('0x4c')][_0x641936['id']],_0x641936);}}}return _0x275d34[_0x5fb3('0x4c')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x4d')]=function(){var _0x53689f=this;return function(_0x4696a9){if(_0x4696a9){freeIsNotKey(_0x4696a9,_0x53689f[_0x5fb3('0x18')],'id');for(var _0x2cc0f6=0x0,_0x5bc3b6={},_0x5c1ed3={};_0x2cc0f6<_0x4696a9['length'];_0x2cc0f6+=0x1){_0x5bc3b6=_0x4696a9[_0x2cc0f6];if(_['isUndefined'](_0x53689f[_0x5fb3('0x18')][_0x5bc3b6['id']])){_0x53689f['salesforceAccounts'][_0x5bc3b6['id']]=new SalesforceAccount(_0x5bc3b6);}else{_0x53689f[_0x5fb3('0x3e')](_0x53689f['salesforceAccounts'][_0x5bc3b6['id']],_0x5bc3b6);}}}return _0x53689f['salesforceAccounts'];};};Realtime[_0x5fb3('0x3f')]['initFreshdeskAccounts']=function(){var _0x1407a6=this;return function(_0x78be48){if(_0x78be48){freeIsNotKey(_0x78be48,_0x1407a6[_0x5fb3('0x4e')],'id');for(var _0x3bffff=0x0,_0x303b41={},_0xd289ea={};_0x3bffff<_0x78be48[_0x5fb3('0x41')];_0x3bffff+=0x1){_0x303b41=_0x78be48[_0x3bffff];if(_[_0x5fb3('0x44')](_0x1407a6[_0x5fb3('0x4e')][_0x303b41['id']])){_0x1407a6[_0x5fb3('0x4e')][_0x303b41['id']]=new FreshdeskAccount(_0x303b41);}else{_0x1407a6[_0x5fb3('0x3e')](_0x1407a6[_0x5fb3('0x4e')][_0x303b41['id']],_0x303b41);}}}return _0x1407a6[_0x5fb3('0x4e')];};};Realtime[_0x5fb3('0x3f')]['initZohoAccounts']=function(){var _0x5cbe6f=this;return function(_0x29ebcc){if(_0x29ebcc){freeIsNotKey(_0x29ebcc,_0x5cbe6f['zohoAccounts'],'id');for(var _0x12e728=0x0,_0x24c5ac={},_0x5f55c5={};_0x12e728<_0x29ebcc[_0x5fb3('0x41')];_0x12e728+=0x1){_0x24c5ac=_0x29ebcc[_0x12e728];if(_[_0x5fb3('0x44')](_0x5cbe6f['zohoAccounts'][_0x24c5ac['id']])){_0x5cbe6f['zohoAccounts'][_0x24c5ac['id']]=new ZohoAccount(_0x24c5ac);}else{_0x5cbe6f[_0x5fb3('0x3e')](_0x5cbe6f[_0x5fb3('0x1a')][_0x24c5ac['id']],_0x24c5ac);}}}return _0x5cbe6f[_0x5fb3('0x1a')];};};Realtime['prototype'][_0x5fb3('0x4f')]=function(){var _0x504e01=this;return function(_0x243f48){if(_0x243f48){freeIsNotKey(_0x243f48,_0x504e01[_0x5fb3('0x1b')],'id');for(var _0xfa0c65=0x0,_0x3c2519={},_0x547654={};_0xfa0c65<_0x243f48['length'];_0xfa0c65+=0x1){_0x3c2519=_0x243f48[_0xfa0c65];if(_[_0x5fb3('0x44')](_0x504e01[_0x5fb3('0x1b')][_0x3c2519['id']])){_0x504e01[_0x5fb3('0x1b')][_0x3c2519['id']]=new DeskAccount(_0x3c2519);}else{_0x504e01[_0x5fb3('0x3e')](_0x504e01['deskAccounts'][_0x3c2519['id']],_0x3c2519);}}}return _0x504e01['deskAccounts'];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x50')]=function(){var _0x54a55d=this;return function(_0x590fc6){if(_0x590fc6){freeIsNotKey(_0x590fc6,_0x54a55d[_0x5fb3('0x19')],'id');for(var _0x327487=0x0,_0x5dfba6={},_0x538859={};_0x327487<_0x590fc6[_0x5fb3('0x41')];_0x327487+=0x1){_0x5dfba6=_0x590fc6[_0x327487];if(_[_0x5fb3('0x44')](_0x54a55d[_0x5fb3('0x19')][_0x5dfba6['id']])){_0x54a55d['sugarcrmAccounts'][_0x5dfba6['id']]=new SugarcrmAccount(_0x5dfba6);}else{_0x54a55d[_0x5fb3('0x3e')](_0x54a55d[_0x5fb3('0x19')][_0x5dfba6['id']],_0x5dfba6);}}}return _0x54a55d[_0x5fb3('0x19')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x51')]=function(){var _0x515b9b=this;return function(_0x458df3){if(_0x458df3){freeIsNotKey(_0x458df3,_0x515b9b[_0x5fb3('0x1c')],'id');for(var _0x175e1a=0x0,_0x2f8e3a={},_0x44e013={};_0x175e1a<_0x458df3['length'];_0x175e1a+=0x1){_0x2f8e3a=_0x458df3[_0x175e1a];if(_[_0x5fb3('0x44')](_0x515b9b[_0x5fb3('0x1c')][_0x2f8e3a['id']])){_0x515b9b[_0x5fb3('0x1c')][_0x2f8e3a['id']]=new VtigerAccount(_0x2f8e3a);}else{_0x515b9b[_0x5fb3('0x3e')](_0x515b9b['vtigerAccounts'][_0x2f8e3a['id']],_0x2f8e3a);}}}return _0x515b9b['vtigerAccounts'];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x52')]=function(){var _0x178d6b=this;return function(_0x309861){if(_0x309861){freeIsNotKey(_0x309861,_0x178d6b[_0x5fb3('0x1d')],'id');for(var _0x3a3cf8=0x0,_0x505db2={},_0x401151={};_0x3a3cf8<_0x309861[_0x5fb3('0x41')];_0x3a3cf8+=0x1){_0x505db2=_0x309861[_0x3a3cf8];if(_[_0x5fb3('0x44')](_0x178d6b[_0x5fb3('0x1d')][_0x505db2['id']])){_0x178d6b[_0x5fb3('0x1d')][_0x505db2['id']]=new ServicenowAccount(_0x505db2);}else{_0x178d6b[_0x5fb3('0x3e')](_0x178d6b[_0x5fb3('0x1d')][_0x505db2['id']],_0x505db2);}}}return _0x178d6b[_0x5fb3('0x1d')];};};Realtime['prototype'][_0x5fb3('0x53')]=function(){var _0x28929a=this;return function(_0x3e92e5){if(_0x3e92e5){freeIsNotKey(_0x3e92e5,_0x28929a[_0x5fb3('0x1e')],'id');for(var _0x58982d=0x0,_0x4674c6={},_0x5c8393={};_0x58982d<_0x3e92e5[_0x5fb3('0x41')];_0x58982d+=0x1){_0x4674c6=_0x3e92e5[_0x58982d];if(_[_0x5fb3('0x44')](_0x28929a[_0x5fb3('0x1e')][_0x4674c6['id']])){_0x28929a[_0x5fb3('0x1e')][_0x4674c6['id']]=new Dynamics365Account(_0x4674c6);}else{_0x28929a[_0x5fb3('0x3e')](_0x28929a['dynamics365Accounts'][_0x4674c6['id']],_0x4674c6);}}}return _0x28929a[_0x5fb3('0x1e')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x335a81=this;return function(_0x5d82c0){if(_0x5d82c0){freeIsNotKey(_0x5d82c0,_0x335a81['freshsalesAccounts'],'id');for(var _0x3d0af5=0x0,_0x39104d={},_0x4687ad={};_0x3d0af5<_0x5d82c0[_0x5fb3('0x41')];_0x3d0af5+=0x1){_0x39104d=_0x5d82c0[_0x3d0af5];if(_[_0x5fb3('0x44')](_0x335a81['freshsalesAccounts'][_0x39104d['id']])){_0x335a81['freshsalesAccounts'][_0x39104d['id']]=new FreshsalesAccount(_0x39104d);}else{_0x335a81[_0x5fb3('0x3e')](_0x335a81['freshsalesAccounts'][_0x39104d['id']],_0x39104d);}}}return _0x335a81[_0x5fb3('0x1f')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x54')]=function(){var _0x13aef2=this;return function(_0x2444bb){for(var _0x34c5bf=0x0;_0x34c5bf<_0x2444bb[_0x5fb3('0x41')];_0x34c5bf+=0x1){_[_0x5fb3('0x55')](_0x13aef2['voiceQueues'][_0x2444bb[_0x34c5bf][_0x5fb3('0x25')]],_0x2444bb[_0x34c5bf]);}return _0x13aef2[_0x5fb3('0x13')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x56')]=function(){var _0x4ca903=this;return function(_0x1c4228){clearVoiceQueues(_0x4ca903['voiceQueues']);if(_0x1c4228){_0x1c4228=_[_0x5fb3('0x57')](_0x1c4228,_0x5fb3('0x58'));for(var _0x28d239 in _0x1c4228){if(_0x1c4228[_0x5fb3('0x22')](_0x28d239)){var _0x5401c0={};for(var _0xf7c866=0x0;_0xf7c866<_0x1c4228[_0x28d239][_0x5fb3('0x41')];_0xf7c866+=0x1){var _0x3b0fc6=_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x59')];if(_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6]){if(_0x1c4228[_0x28d239][_0xf7c866]['queuecallerexit']){_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x5a')]+=0x1;}if(_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x5b')]){_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x2f')]+=0x1;}_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x28')]+=moment(_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x5c')])[_0x5fb3('0x5d')](moment(_0x1c4228[_0x28d239][_0xf7c866]['queuecallerjoinAt']),_0x5fb3('0x5e'))||0x0;if(_0xf7c866===_0x1c4228[_0x28d239]['length']-0x1){_0x4ca903['voiceQueues'][_0x3b0fc6]['sumDuration']+=moment(_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x5f')]||_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x60')]||_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x61')])[_0x5fb3('0x5d')](moment(_0x1c4228[_0x28d239][_0xf7c866]['queuecallerjoinAt']),'seconds')||0x0;_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x2e')]+=0x1;if(_0x1c4228[_0x28d239][_0xf7c866]['queuecallercomplete']){_0x4ca903['voiceQueues'][_0x3b0fc6][_0x5fb3('0x27')]+=0x1;_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x2a')]+=moment(_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x5f')])[_0x5fb3('0x5d')](moment(_0x1c4228[_0x28d239][_0xf7c866][_0x5fb3('0x5c')]),'seconds')||0x0;}}else{_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x29')]+=_0x4ca903[_0x5fb3('0x13')][_0x3b0fc6][_0x5fb3('0x28')]||0x0;}}}}}}return _0x4ca903[_0x5fb3('0x13')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x62')]=function(){var _0x5a44f4=this;return function(_0x2ff50d){clearVoiceCallReports(_0x5a44f4[_0x5fb3('0x63')]);if(_0x2ff50d){for(var _0x5a682d=0x0;_0x5a682d<_0x2ff50d[_0x5fb3('0x41')];_0x5a682d+=0x1){_0x5a44f4[_0x5fb3('0x63')][_0x5fb3('0x2e')]+=0x1;_0x5a44f4[_0x5fb3('0x63')][_0x5fb3('0x29')]+=_0x2ff50d[_0x5a682d][_0x5fb3('0x64')];if(_0x2ff50d[_0x5a682d][_0x5fb3('0x65')]==='ANSWERED'){_0x5a44f4[_0x5fb3('0x63')][_0x5fb3('0x27')]+=0x1;_0x5a44f4[_0x5fb3('0x63')][_0x5fb3('0x28')]+=_0x2ff50d[_0x5a682d]['duration']-_0x2ff50d[_0x5a682d]['billableseconds']||0x0;_0x5a44f4['outbound'][_0x5fb3('0x2a')]+=_0x2ff50d[_0x5a682d][_0x5fb3('0x66')];}}}return _0x5a44f4['outbound'];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x67')]=function(){var _0x583531=this;return function(_0x5f2264){if(_0x5f2264){freeIsNotKey(_0x5f2264,_0x583531['campaigns'],_0x5fb3('0x25'));for(var _0x185738=0x0,_0x51e5f4={};_0x185738<_0x5f2264[_0x5fb3('0x41')];_0x185738+=0x1){_0x51e5f4=_0x5f2264[_0x185738];if(_['isUndefined'](_0x583531['campaigns'][_0x51e5f4['name']])){_0x583531['campaigns'][_0x51e5f4[_0x5fb3('0x25')]]=new Campaign(_0x51e5f4);}else{_0x583531[_0x5fb3('0x3e')](_0x583531[_0x5fb3('0x68')][_0x51e5f4[_0x5fb3('0x25')]],_0x51e5f4);_0x583531[_0x5fb3('0x68')][_0x51e5f4[_0x5fb3('0x25')]][_0x5fb3('0x69')]=_0x51e5f4[_0x5fb3('0x6a')]?_0x51e5f4['SquareProject'][_0x5fb3('0x25')]:undefined;}}}return _0x583531['campaigns'];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x6b')]=function(){var _0xc8b893=this;return function(_0x2bbf9f){if(_0x2bbf9f){freeIsNotKey(_0x2bbf9f,_0xc8b893['voiceExtensions'],'id');for(var _0x103b26=0x0,_0x544364={};_0x103b26<_0x2bbf9f[_0x5fb3('0x41')];_0x103b26+=0x1){_0x544364=_0x2bbf9f[_0x103b26];if(_['isUndefined'](_0xc8b893[_0x5fb3('0x15')][_0x544364['id']])){_0xc8b893[_0x5fb3('0x15')][_0x544364['id']]=new VoiceExtension(_0x544364);}else{_0xc8b893[_0x5fb3('0x3e')](_0xc8b893[_0x5fb3('0x15')][_0x544364['id']],_0x544364);}}}return _0xc8b893[_0x5fb3('0x15')];};};Realtime['prototype'][_0x5fb3('0x6c')]=function(){var _0xaee42e=this;return function(_0x1db885){clearCampaigns(_0xaee42e[_0x5fb3('0x68')]);for(var _0x8ed5c4=0x0;_0x8ed5c4<_0x1db885[_0x5fb3('0x41')];_0x8ed5c4+=0x1){_['merge'](_0xaee42e[_0x5fb3('0x68')][_0x1db885[_0x8ed5c4][_0x5fb3('0x25')]],_0x1db885[_0x8ed5c4]);}return _0xaee42e[_0x5fb3('0x68')];};};Realtime[_0x5fb3('0x3f')][_0x5fb3('0x6d')]=function(){var _0x6e5ca8=this;return function(_0x38661f){if(_0x38661f){freeIsNotKey(_0x38661f,_0x6e5ca8[_0x5fb3('0x20')],'id');for(var _0x1eb4e4=0x0,_0x213564={},_0x1a2b19={};_0x1eb4e4<_0x38661f['length'];_0x1eb4e4+=0x1){_0x213564=_0x38661f[_0x1eb4e4];if(_['isUndefined'](_0x6e5ca8[_0x5fb3('0x20')][_0x213564['id']])){_0x6e5ca8[_0x5fb3('0x20')][_0x213564['id']]=new FaxAccount(_0x213564);}else{_0x6e5ca8[_0x5fb3('0x3e')](_0x6e5ca8[_0x5fb3('0x20')][_0x213564['id']],_0x213564);}}}return _0x6e5ca8[_0x5fb3('0x20')];};};module[_0x5fb3('0x6e')]=Realtime; \ No newline at end of file +var _0x4208=['billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','interface','SIP/%s','total','answered','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','isUndefined','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration','ANSWERED'];(function(_0x425f4b,_0xd7c177){var _0x2992a9=function(_0x20bb62){while(--_0x20bb62){_0x425f4b['push'](_0x425f4b['shift']());}};_0x2992a9(++_0xd7c177);}(_0x4208,0x14f));var _0x8420=function(_0x2880d8,_0x284ded){_0x2880d8=_0x2880d8-0x0;var _0x51f5a9=_0x4208[_0x2880d8];return _0x51f5a9;};'use strict';var BPromise=require(_0x8420('0x0'));var util=require('util');var _=require(_0x8420('0x1'));var moment=require(_0x8420('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x8420('0x3'));var Trunk=require(_0x8420('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x8420('0x5'));var Template=require(_0x8420('0x6'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x8420('0x7'));var ZendeskAccount=require(_0x8420('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x8420('0x9'));var ZohoAccount=require(_0x8420('0xa'));var DeskAccount=require(_0x8420('0xb'));var VtigerAccount=require(_0x8420('0xc'));var ServicenowAccount=require(_0x8420('0xd'));var Dynamics365Account=require(_0x8420('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x8420('0xf'));var Realtime=function(){this[_0x8420('0x10')]={};this[_0x8420('0x11')]={};this[_0x8420('0x12')]={};this[_0x8420('0x13')]={};this[_0x8420('0x14')]={};this['campaigns']={};this[_0x8420('0x15')]={};this[_0x8420('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8420('0x17')]={};this[_0x8420('0x18')]={};this['queueChannels']={};this['outboundChannels']={};this['timers']={};this['settings']={};this[_0x8420('0x19')]={};this[_0x8420('0x1a')]={};this[_0x8420('0x1b')]={};this[_0x8420('0x1c')]={};this[_0x8420('0x1d')]={};this[_0x8420('0x1e')]={};this['vtigerAccounts']={};this[_0x8420('0x1f')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0x8420('0x20')]={};};function freeIsNotKey(_0x58e82b,_0x172816,_0x1e070c){var _0x3f0437=_[_0x8420('0x21')](_0x58e82b,function(_0x511437,_0xe55e50){return _0x511437[_0x1e070c];});for(var _0xbaee93 in _0x172816){if(_0x172816['hasOwnProperty'](_0xbaee93)){if(!_0x3f0437[_0xbaee93]){delete _0x172816[_0xbaee93];}}}}function freeIsNotKeySip(_0x5cd65a,_0x4d839e){var _0x49d047=_[_0x8420('0x21')](_0x5cd65a,function(_0x5065c1,_0x4fb314){return util[_0x8420('0x22')]('SIP/%s',_0x5065c1[_0x8420('0x23')]);});for(var _0x1854c7 in _0x4d839e){if(_0x4d839e[_0x8420('0x24')](_0x1854c7)){if(!_0x49d047[_0x1854c7]){delete _0x4d839e[_0x1854c7];}}}}function freeIsNotKeyAgent(_0x461150,_0x2da527){var _0x26525b=_[_0x8420('0x21')](_0x461150,function(_0x5a66a5,_0x53bc21){var _0x4b3bb3=_['isNil'](_0x5a66a5[_0x8420('0x25')])?util['format'](_0x8420('0x26'),_0x5a66a5[_0x8420('0x23')]):_0x5a66a5[_0x8420('0x25')];return _0x4b3bb3;});for(var _0x35d9e6 in _0x2da527){if(_0x2da527['hasOwnProperty'](_0x35d9e6)){if(!_0x26525b[_0x35d9e6]){delete _0x2da527[_0x35d9e6];}}}}function clearVoiceCallReports(_0xf1a1ef){_0xf1a1ef[_0x8420('0x27')]=0x0;_0xf1a1ef[_0x8420('0x28')]=0x0;_0xf1a1ef['sumHoldTime']=0x0;_0xf1a1ef['sumDuration']=0x0;_0xf1a1ef[_0x8420('0x29')]=0x0;}function clearCampaigns(_0x2116d6){if(!_[_0x8420('0x2a')](_0x2116d6)){for(var _0x4b6204 in _0x2116d6){if(_0x2116d6[_0x8420('0x24')](_0x4b6204)){_0x2116d6[_0x4b6204][_0x8420('0x2b')]=0x0;_0x2116d6[_0x4b6204][_0x8420('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x5ece3a){if(!_[_0x8420('0x2a')](_0x5ece3a)){for(var _0x46f5f8 in _0x5ece3a){if(_0x5ece3a[_0x8420('0x24')](_0x46f5f8)){_0x5ece3a[_0x46f5f8]['total']=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x28')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x2d')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x2e')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x2f')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x30')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x29')]=0x0;_0x5ece3a[_0x46f5f8]['outboundAnswerAgiCallsDay']=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x31')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x32')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x33')]=0x0;_0x5ece3a[_0x46f5f8]['outboundNoSuchCallsDay']=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x34')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x35')]=0x0;_0x5ece3a[_0x46f5f8]['outboundDropCallsDayCallersExit']=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x36')]=0x0;_0x5ece3a[_0x46f5f8]['outboundOriginateFailureCallsDay']=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x37')]=0x0;_0x5ece3a[_0x46f5f8]['outboundReCallsDay']=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x38')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x39')]=0x0;_0x5ece3a[_0x46f5f8][_0x8420('0x3a')]=!![];}}}}Realtime[_0x8420('0x3b')]['mergeFromDatabase']=function(_0x48207c,_0x4b6b4b){for(var _0x1e9a9e in _0x4b6b4b){if(_0x48207c[_0x8420('0x24')](_0x1e9a9e)){_0x48207c[_0x1e9a9e]=_0x4b6b4b[_0x1e9a9e];}}};Realtime[_0x8420('0x3b')][_0x8420('0x3c')]=function(){var _0xdc34d9=this;return function(_0x33a571){if(_0x33a571){freeIsNotKeyAgent(_0x33a571,_0xdc34d9[_0x8420('0x10')]);for(var _0x63b4dd=0x0,_0x20300a={},_0x2a823c={};_0x63b4dd<_0x33a571[_0x8420('0x3d')];_0x63b4dd+=0x1){_0x20300a=_0x33a571[_0x63b4dd];var _0x548c7c=_[_0x8420('0x3e')](_0x20300a['interface'])?util[_0x8420('0x22')](_0x8420('0x26'),_0x20300a[_0x8420('0x23')]):_0x20300a[_0x8420('0x25')];if(_[_0x8420('0x3f')](_0xdc34d9[_0x8420('0x10')][_0x548c7c])){_0xdc34d9[_0x8420('0x10')][_0x548c7c]=new Agent(_0x20300a);}else{_0xdc34d9[_0x8420('0x40')](_0xdc34d9[_0x8420('0x10')][_0x548c7c],_0x20300a);}}}return _0xdc34d9['agents'];};};Realtime[_0x8420('0x3b')][_0x8420('0x41')]=function(){var _0x257608=this;return function(_0x49cc22){if(_0x49cc22){freeIsNotKeySip(_0x49cc22,_0x257608[_0x8420('0x11')]);for(var _0x2244b7=0x0,_0x55a790={},_0x236b3b={};_0x2244b7<_0x49cc22[_0x8420('0x3d')];_0x2244b7+=0x1){_0x55a790=_0x49cc22[_0x2244b7];if(_[_0x8420('0x3f')](_0x257608[_0x8420('0x11')][util[_0x8420('0x22')](_0x8420('0x26'),_0x55a790[_0x8420('0x23')])])){_0x257608[_0x8420('0x11')][util[_0x8420('0x22')](_0x8420('0x26'),_0x55a790['name'])]=new Telephone(_0x55a790);}else{_0x257608[_0x8420('0x40')](_0x257608[_0x8420('0x11')][util[_0x8420('0x22')]('SIP/%s',_0x55a790[_0x8420('0x23')])],_0x55a790);}}}return _0x257608[_0x8420('0x11')];};};Realtime[_0x8420('0x3b')][_0x8420('0x42')]=function(){var _0x3f5922=this;return function(_0x49c078){if(_0x49c078){freeIsNotKeySip(_0x49c078,_0x3f5922[_0x8420('0x12')]);for(var _0x563c60=0x0,_0x2909a5={},_0x2889e4={};_0x563c60<_0x49c078[_0x8420('0x3d')];_0x563c60+=0x1){_0x2909a5=_0x49c078[_0x563c60];if(_[_0x8420('0x3f')](_0x3f5922[_0x8420('0x12')][util[_0x8420('0x22')]('SIP/%s',_0x2909a5['name'])])){_0x3f5922['trunks'][util['format'](_0x8420('0x26'),_0x2909a5[_0x8420('0x23')])]=new Trunk(_0x2909a5);}else{_0x3f5922[_0x8420('0x40')](_0x3f5922[_0x8420('0x12')][util['format'](_0x8420('0x26'),_0x2909a5[_0x8420('0x23')])],_0x2909a5);}}}return _0x3f5922[_0x8420('0x12')];};};Realtime[_0x8420('0x3b')][_0x8420('0x43')]=function(){var _0x47fe28=this;return function(_0x431e83){if(_0x431e83){freeIsNotKey(_0x431e83,_0x47fe28['voiceQueues'],_0x8420('0x23'));for(var _0x143b01=0x0,_0x307884={},_0x27fec0={};_0x143b01<_0x431e83[_0x8420('0x3d')];_0x143b01+=0x1){_0x307884=_0x431e83[_0x143b01];if(_['isUndefined'](_0x47fe28['voiceQueues'][_0x307884[_0x8420('0x23')]])){_0x47fe28[_0x8420('0x13')][_0x307884[_0x8420('0x23')]]=new VoiceQueue(_0x307884);}else{_0x47fe28[_0x8420('0x40')](_0x47fe28[_0x8420('0x13')][_0x307884[_0x8420('0x23')]],_0x307884);}}}return _0x47fe28[_0x8420('0x13')];};};Realtime[_0x8420('0x3b')][_0x8420('0x44')]=function(){var _0x3c9519=this;return function(_0x12411d){if(_0x12411d){freeIsNotKey(_0x12411d,_0x3c9519[_0x8420('0x14')],'id');for(var _0x9e26e2=0x0,_0x2c6e6b={},_0x32de77={};_0x9e26e2<_0x12411d[_0x8420('0x3d')];_0x9e26e2+=0x1){_0x2c6e6b=_0x12411d[_0x9e26e2];if(_[_0x8420('0x3f')](_0x3c9519[_0x8420('0x14')][_0x2c6e6b['id']])){_0x3c9519[_0x8420('0x14')][_0x2c6e6b['id']]=new Trigger(_0x2c6e6b);}else{_0x3c9519[_0x8420('0x40')](_0x3c9519[_0x8420('0x14')][_0x2c6e6b['id']],_0x2c6e6b);}}}return _0x3c9519[_0x8420('0x14')];};};Realtime[_0x8420('0x3b')][_0x8420('0x45')]=function(){var _0x38afff=this;return function(_0x2de5a6){if(_0x2de5a6){freeIsNotKey(_0x2de5a6,_0x38afff[_0x8420('0x15')],'id');for(var _0x168919=0x0,_0x45c2ce={},_0x491eb8={};_0x168919<_0x2de5a6[_0x8420('0x3d')];_0x168919+=0x1){_0x45c2ce=_0x2de5a6[_0x168919];if(_[_0x8420('0x3f')](_0x38afff[_0x8420('0x15')][_0x45c2ce['id']])){_0x38afff[_0x8420('0x15')][_0x45c2ce['id']]=new Template(_0x45c2ce);}else{_0x38afff['mergeFromDatabase'](_0x38afff[_0x8420('0x15')][_0x45c2ce['id']],_0x45c2ce);}}}return _0x38afff[_0x8420('0x15')];};};Realtime['prototype'][_0x8420('0x46')]=function(){var _0x3e879c=this;return function(_0x1c2695){if(_0x1c2695){freeIsNotKey(_0x1c2695,_0x3e879c[_0x8420('0x19')],'id');for(var _0x6a87f3=0x0,_0x2c180f={},_0x9d7d82={};_0x6a87f3<_0x1c2695[_0x8420('0x3d')];_0x6a87f3+=0x1){_0x2c180f=_0x1c2695[_0x6a87f3];if(_[_0x8420('0x3f')](_0x3e879c['zendeskAccounts'][_0x2c180f['id']])){_0x3e879c[_0x8420('0x19')][_0x2c180f['id']]=new ZendeskAccount(_0x2c180f);}else{_0x3e879c['mergeFromDatabase'](_0x3e879c[_0x8420('0x19')][_0x2c180f['id']],_0x2c180f);}}}return _0x3e879c[_0x8420('0x19')];};};Realtime['prototype'][_0x8420('0x47')]=function(){var _0x9ce8d8=this;return function(_0x2ced94){if(_0x2ced94){freeIsNotKey(_0x2ced94,_0x9ce8d8[_0x8420('0x1a')],'id');for(var _0xe48f2c=0x0,_0x3a6e53={},_0x1ff14e={};_0xe48f2c<_0x2ced94[_0x8420('0x3d')];_0xe48f2c+=0x1){_0x3a6e53=_0x2ced94[_0xe48f2c];if(_[_0x8420('0x3f')](_0x9ce8d8[_0x8420('0x1a')][_0x3a6e53['id']])){_0x9ce8d8['salesforceAccounts'][_0x3a6e53['id']]=new SalesforceAccount(_0x3a6e53);}else{_0x9ce8d8[_0x8420('0x40')](_0x9ce8d8[_0x8420('0x1a')][_0x3a6e53['id']],_0x3a6e53);}}}return _0x9ce8d8['salesforceAccounts'];};};Realtime[_0x8420('0x3b')]['initFreshdeskAccounts']=function(){var _0x300b2e=this;return function(_0x4de04f){if(_0x4de04f){freeIsNotKey(_0x4de04f,_0x300b2e[_0x8420('0x1c')],'id');for(var _0x527d1c=0x0,_0x125003={},_0x18646b={};_0x527d1c<_0x4de04f[_0x8420('0x3d')];_0x527d1c+=0x1){_0x125003=_0x4de04f[_0x527d1c];if(_[_0x8420('0x3f')](_0x300b2e[_0x8420('0x1c')][_0x125003['id']])){_0x300b2e[_0x8420('0x1c')][_0x125003['id']]=new FreshdeskAccount(_0x125003);}else{_0x300b2e[_0x8420('0x40')](_0x300b2e[_0x8420('0x1c')][_0x125003['id']],_0x125003);}}}return _0x300b2e[_0x8420('0x1c')];};};Realtime[_0x8420('0x3b')][_0x8420('0x48')]=function(){var _0xc3ac40=this;return function(_0x42b5b9){if(_0x42b5b9){freeIsNotKey(_0x42b5b9,_0xc3ac40[_0x8420('0x1d')],'id');for(var _0x3d2e8c=0x0,_0x298d03={},_0x478580={};_0x3d2e8c<_0x42b5b9[_0x8420('0x3d')];_0x3d2e8c+=0x1){_0x298d03=_0x42b5b9[_0x3d2e8c];if(_[_0x8420('0x3f')](_0xc3ac40['zohoAccounts'][_0x298d03['id']])){_0xc3ac40[_0x8420('0x1d')][_0x298d03['id']]=new ZohoAccount(_0x298d03);}else{_0xc3ac40[_0x8420('0x40')](_0xc3ac40[_0x8420('0x1d')][_0x298d03['id']],_0x298d03);}}}return _0xc3ac40[_0x8420('0x1d')];};};Realtime[_0x8420('0x3b')][_0x8420('0x49')]=function(){var _0x24b5b1=this;return function(_0x298cb3){if(_0x298cb3){freeIsNotKey(_0x298cb3,_0x24b5b1[_0x8420('0x1e')],'id');for(var _0x4a4667=0x0,_0x2133c7={},_0x500106={};_0x4a4667<_0x298cb3['length'];_0x4a4667+=0x1){_0x2133c7=_0x298cb3[_0x4a4667];if(_[_0x8420('0x3f')](_0x24b5b1[_0x8420('0x1e')][_0x2133c7['id']])){_0x24b5b1[_0x8420('0x1e')][_0x2133c7['id']]=new DeskAccount(_0x2133c7);}else{_0x24b5b1[_0x8420('0x40')](_0x24b5b1[_0x8420('0x1e')][_0x2133c7['id']],_0x2133c7);}}}return _0x24b5b1[_0x8420('0x1e')];};};Realtime[_0x8420('0x3b')][_0x8420('0x4a')]=function(){var _0x5381b8=this;return function(_0x1e6b63){if(_0x1e6b63){freeIsNotKey(_0x1e6b63,_0x5381b8['sugarcrmAccounts'],'id');for(var _0x475884=0x0,_0x4ccbf5={},_0x15f327={};_0x475884<_0x1e6b63[_0x8420('0x3d')];_0x475884+=0x1){_0x4ccbf5=_0x1e6b63[_0x475884];if(_[_0x8420('0x3f')](_0x5381b8['sugarcrmAccounts'][_0x4ccbf5['id']])){_0x5381b8[_0x8420('0x1b')][_0x4ccbf5['id']]=new SugarcrmAccount(_0x4ccbf5);}else{_0x5381b8['mergeFromDatabase'](_0x5381b8[_0x8420('0x1b')][_0x4ccbf5['id']],_0x4ccbf5);}}}return _0x5381b8['sugarcrmAccounts'];};};Realtime[_0x8420('0x3b')][_0x8420('0x4b')]=function(){var _0x1faef2=this;return function(_0x5f41e5){if(_0x5f41e5){freeIsNotKey(_0x5f41e5,_0x1faef2[_0x8420('0x4c')],'id');for(var _0x5072a6=0x0,_0x2e7603={},_0x4f9ea1={};_0x5072a6<_0x5f41e5['length'];_0x5072a6+=0x1){_0x2e7603=_0x5f41e5[_0x5072a6];if(_[_0x8420('0x3f')](_0x1faef2[_0x8420('0x4c')][_0x2e7603['id']])){_0x1faef2[_0x8420('0x4c')][_0x2e7603['id']]=new VtigerAccount(_0x2e7603);}else{_0x1faef2[_0x8420('0x40')](_0x1faef2['vtigerAccounts'][_0x2e7603['id']],_0x2e7603);}}}return _0x1faef2[_0x8420('0x4c')];};};Realtime[_0x8420('0x3b')][_0x8420('0x4d')]=function(){var _0x426788=this;return function(_0x1dd57d){if(_0x1dd57d){freeIsNotKey(_0x1dd57d,_0x426788[_0x8420('0x1f')],'id');for(var _0x2ff087=0x0,_0x57bfed={},_0x312905={};_0x2ff087<_0x1dd57d['length'];_0x2ff087+=0x1){_0x57bfed=_0x1dd57d[_0x2ff087];if(_[_0x8420('0x3f')](_0x426788[_0x8420('0x1f')][_0x57bfed['id']])){_0x426788[_0x8420('0x1f')][_0x57bfed['id']]=new ServicenowAccount(_0x57bfed);}else{_0x426788[_0x8420('0x40')](_0x426788[_0x8420('0x1f')][_0x57bfed['id']],_0x57bfed);}}}return _0x426788[_0x8420('0x1f')];};};Realtime[_0x8420('0x3b')][_0x8420('0x4e')]=function(){var _0x53bbfe=this;return function(_0x2c518){if(_0x2c518){freeIsNotKey(_0x2c518,_0x53bbfe[_0x8420('0x4f')],'id');for(var _0x1eed19=0x0,_0x362dcb={},_0x55d22d={};_0x1eed19<_0x2c518[_0x8420('0x3d')];_0x1eed19+=0x1){_0x362dcb=_0x2c518[_0x1eed19];if(_[_0x8420('0x3f')](_0x53bbfe[_0x8420('0x4f')][_0x362dcb['id']])){_0x53bbfe[_0x8420('0x4f')][_0x362dcb['id']]=new Dynamics365Account(_0x362dcb);}else{_0x53bbfe[_0x8420('0x40')](_0x53bbfe[_0x8420('0x4f')][_0x362dcb['id']],_0x362dcb);}}}return _0x53bbfe[_0x8420('0x4f')];};};Realtime[_0x8420('0x3b')][_0x8420('0x50')]=function(){var _0x5bc433=this;return function(_0x434197){if(_0x434197){freeIsNotKey(_0x434197,_0x5bc433[_0x8420('0x51')],'id');for(var _0x5d926f=0x0,_0xdd3406={},_0x4c4c83={};_0x5d926f<_0x434197[_0x8420('0x3d')];_0x5d926f+=0x1){_0xdd3406=_0x434197[_0x5d926f];if(_[_0x8420('0x3f')](_0x5bc433['freshsalesAccounts'][_0xdd3406['id']])){_0x5bc433[_0x8420('0x51')][_0xdd3406['id']]=new FreshsalesAccount(_0xdd3406);}else{_0x5bc433['mergeFromDatabase'](_0x5bc433[_0x8420('0x51')][_0xdd3406['id']],_0xdd3406);}}}return _0x5bc433[_0x8420('0x51')];};};Realtime[_0x8420('0x3b')][_0x8420('0x52')]=function(){var _0x264720=this;return function(_0x3489d4){for(var _0x151f66=0x0;_0x151f66<_0x3489d4[_0x8420('0x3d')];_0x151f66+=0x1){_[_0x8420('0x53')](_0x264720[_0x8420('0x13')][_0x3489d4[_0x151f66][_0x8420('0x23')]],_0x3489d4[_0x151f66]);}return _0x264720[_0x8420('0x13')];};};Realtime[_0x8420('0x3b')][_0x8420('0x54')]=function(){var _0x43c88d=this;return function(_0x58b659){clearVoiceQueues(_0x43c88d[_0x8420('0x13')]);if(_0x58b659){_0x58b659=_[_0x8420('0x55')](_0x58b659,_0x8420('0x56'));for(var _0x360a9e in _0x58b659){if(_0x58b659['hasOwnProperty'](_0x360a9e)){var _0x594478={};for(var _0x59903b=0x0;_0x59903b<_0x58b659[_0x360a9e][_0x8420('0x3d')];_0x59903b+=0x1){var _0x55ce12=_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x57')];if(_0x43c88d[_0x8420('0x13')][_0x55ce12]){if(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x58')]){_0x43c88d['voiceQueues'][_0x55ce12][_0x8420('0x2d')]+=0x1;}if(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x59')]){_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x2e')]+=0x1;}_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x2f')]+=moment(_0x58b659[_0x360a9e][_0x59903b]['queuecallerleaveAt'])[_0x8420('0x5a')](moment(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x5b')]),'seconds')||0x0;if(_0x59903b===_0x58b659[_0x360a9e][_0x8420('0x3d')]-0x1){_0x43c88d['voiceQueues'][_0x55ce12][_0x8420('0x30')]+=moment(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x5c')]||_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x5d')]||_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x5e')])[_0x8420('0x5a')](moment(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x5b')]),_0x8420('0x5f'))||0x0;_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x27')]+=0x1;if(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x60')]){_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x28')]+=0x1;_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x29')]+=moment(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x5c')])[_0x8420('0x5a')](moment(_0x58b659[_0x360a9e][_0x59903b][_0x8420('0x61')]),_0x8420('0x5f'))||0x0;}}else{_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x30')]+=_0x43c88d[_0x8420('0x13')][_0x55ce12][_0x8420('0x2f')]||0x0;}}}}}}return _0x43c88d['voiceQueues'];};};Realtime[_0x8420('0x3b')][_0x8420('0x62')]=function(){var _0x13c002=this;return function(_0x1680f4){clearVoiceCallReports(_0x13c002['outbound']);if(_0x1680f4){for(var _0x2ed947=0x0;_0x2ed947<_0x1680f4[_0x8420('0x3d')];_0x2ed947+=0x1){_0x13c002[_0x8420('0x16')][_0x8420('0x27')]+=0x1;_0x13c002[_0x8420('0x16')][_0x8420('0x30')]+=_0x1680f4[_0x2ed947][_0x8420('0x63')];if(_0x1680f4[_0x2ed947]['disposition']===_0x8420('0x64')){_0x13c002[_0x8420('0x16')]['answered']+=0x1;_0x13c002[_0x8420('0x16')][_0x8420('0x2f')]+=_0x1680f4[_0x2ed947][_0x8420('0x63')]-_0x1680f4[_0x2ed947][_0x8420('0x65')]||0x0;_0x13c002[_0x8420('0x16')]['sumBillable']+=_0x1680f4[_0x2ed947][_0x8420('0x65')];}}}return _0x13c002['outbound'];};};Realtime[_0x8420('0x3b')][_0x8420('0x66')]=function(){var _0x4960f8=this;return function(_0x246dfe){if(_0x246dfe){freeIsNotKey(_0x246dfe,_0x4960f8['campaigns'],_0x8420('0x23'));for(var _0x1368a2=0x0,_0x3dfa43={};_0x1368a2<_0x246dfe['length'];_0x1368a2+=0x1){_0x3dfa43=_0x246dfe[_0x1368a2];if(_['isUndefined'](_0x4960f8[_0x8420('0x67')][_0x3dfa43[_0x8420('0x23')]])){_0x4960f8['campaigns'][_0x3dfa43[_0x8420('0x23')]]=new Campaign(_0x3dfa43);}else{_0x4960f8[_0x8420('0x40')](_0x4960f8[_0x8420('0x67')][_0x3dfa43[_0x8420('0x23')]],_0x3dfa43);_0x4960f8['campaigns'][_0x3dfa43[_0x8420('0x23')]][_0x8420('0x68')]=_0x3dfa43['SquareProject']?_0x3dfa43[_0x8420('0x69')][_0x8420('0x23')]:undefined;}}}return _0x4960f8[_0x8420('0x67')];};};Realtime[_0x8420('0x3b')]['initVoiceExtensions']=function(){var _0x384315=this;return function(_0x3d99f4){if(_0x3d99f4){freeIsNotKey(_0x3d99f4,_0x384315[_0x8420('0x17')],'id');for(var _0x4c467f=0x0,_0x194e60={};_0x4c467f<_0x3d99f4['length'];_0x4c467f+=0x1){_0x194e60=_0x3d99f4[_0x4c467f];if(_['isUndefined'](_0x384315[_0x8420('0x17')][_0x194e60['id']])){_0x384315[_0x8420('0x17')][_0x194e60['id']]=new VoiceExtension(_0x194e60);}else{_0x384315[_0x8420('0x40')](_0x384315[_0x8420('0x17')][_0x194e60['id']],_0x194e60);}}}return _0x384315[_0x8420('0x17')];};};Realtime['prototype'][_0x8420('0x6a')]=function(){var _0x3d40cb=this;return function(_0x544cf7){clearCampaigns(_0x3d40cb[_0x8420('0x67')]);for(var _0x32a8db=0x0;_0x32a8db<_0x544cf7[_0x8420('0x3d')];_0x32a8db+=0x1){_[_0x8420('0x53')](_0x3d40cb[_0x8420('0x67')][_0x544cf7[_0x32a8db][_0x8420('0x23')]],_0x544cf7[_0x32a8db]);}return _0x3d40cb[_0x8420('0x67')];};};Realtime['prototype'][_0x8420('0x6b')]=function(){var _0x3d6dcd=this;return function(_0x3b2d37){if(_0x3b2d37){freeIsNotKey(_0x3b2d37,_0x3d6dcd[_0x8420('0x20')],'id');for(var _0x4d4138=0x0,_0x13440f={},_0x5760ae={};_0x4d4138<_0x3b2d37[_0x8420('0x3d')];_0x4d4138+=0x1){_0x13440f=_0x3b2d37[_0x4d4138];if(_[_0x8420('0x3f')](_0x3d6dcd[_0x8420('0x20')][_0x13440f['id']])){_0x3d6dcd[_0x8420('0x20')][_0x13440f['id']]=new FaxAccount(_0x13440f);}else{_0x3d6dcd[_0x8420('0x40')](_0x3d6dcd['faxAccounts'][_0x13440f['id']],_0x13440f);}}}return _0x3d6dcd[_0x8420('0x20')];};};module[_0x8420('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 2b6f674..9722893 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 _0xd8ea=['transfers','linkedid','uniqueid','type','getCallType','UserId','membername','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','phone','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','prototype','findAgent','name','isNil','find','accountcode','interface','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','format','getAgentByInternal','keys','split','calleridnum','outbound','exten','lastapplication','queue','context','from-voip-provider','destination','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname'];(function(_0x128add,_0x3606bd){var _0x184d48=function(_0x4a2bd9){while(--_0x4a2bd9){_0x128add['push'](_0x128add['shift']());}};_0x184d48(++_0x3606bd);}(_0xd8ea,0x78));var _0xad8e=function(_0x40e5e9,_0x24f21d){_0x40e5e9=_0x40e5e9-0x0;var _0x49de8c=_0xd8ea[_0x40e5e9];return _0x49de8c;};'use strict';var _=require(_0xad8e('0x0'));var moment=require(_0xad8e('0x1'));var util=require('util');var config=require(_0xad8e('0x2'));var ami=require(_0xad8e('0x3'));var RpcVoiceAgentReport=require(_0xad8e('0x4'));var RpcVoiceCallReport=require(_0xad8e('0x5'));var RpcVoiceDialReport=require(_0xad8e('0x6'));var RpcMemberReport=require(_0xad8e('0x7'));var RpcVoiceQueueReport=require(_0xad8e('0x8'));var RpcVoiceRecording=require(_0xad8e('0x9'));var RpcVoiceTransferReport=require(_0xad8e('0xa'));var VoiceQueueReport=require(_0xad8e('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xad8e('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xad8e('0xd'));function Report(_0x308a33){this[_0xad8e('0xe')]=_0x308a33;this['agents']=_0x308a33[_0xad8e('0xf')];this['telephones']=_0x308a33[_0xad8e('0x10')];}Report['prototype'][_0xad8e('0x11')]=function(_0x9a9ace){var _0x2192c3=new VoiceQueueReport(this[_0xad8e('0xe')]);var _0x4a9974=new VoiceAgentReport(this[_0xad8e('0xe')]);var _0xdb41eb=new VoiceDialReport(this[_0xad8e('0xe')]);var _0x3496e1=new VoiceCallReport(this[_0xad8e('0xe')]);var _0x30b10d=new UserReport(this[_0xad8e('0xe')]);if(config[_0xad8e('0x12')]&&config[_0xad8e('0x12')][_0xad8e('0x13')]){ami['on'](_0xad8e('0x14'),this['voiceQueueReport'][_0xad8e('0x15')](this));ami['on'](_0xad8e('0x16'),this[_0xad8e('0x17')][_0xad8e('0x15')](this));ami['on'](_0xad8e('0x18'),this[_0xad8e('0x19')][_0xad8e('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xad8e('0x1a')][_0xad8e('0x15')](this));ami['on']('blindtransfer',this[_0xad8e('0x1b')]['bind'](this));ami['on'](_0xad8e('0x1c'),this['attendedTransfer']['bind'](this));}};Report[_0xad8e('0x1d')][_0xad8e('0x1e')]=function(_0x517241){var _0x417f38;_0x417f38=_['find'](this[_0xad8e('0xf')],function(_0x5de598){return _0x5de598['accountcode']==_0x517241||_0x5de598[_0xad8e('0x1f')]==_0x517241;});if(_[_0xad8e('0x20')](_0x417f38)){var _0x3adf02=_[_0xad8e('0x21')](this[_0xad8e('0x10')],function(_0x4a7240){return _0x4a7240[_0xad8e('0x22')]==_0x517241||_0x4a7240[_0xad8e('0x1f')]==_0x517241;});if(_0x3adf02){_0x417f38=_[_0xad8e('0x21')](this[_0xad8e('0xf')],function(_0x544de6){return _0x544de6[_0xad8e('0x23')]==util['format']('SIP/%s',_0x3adf02[_0xad8e('0x1f')]);});}}return _0x417f38;};Report['prototype'][_0xad8e('0x24')]=function(_0x2114d6){for(var _0x44c700=0x0;_0x44c700<_0x2114d6[_0xad8e('0x25')];_0x44c700+=0x1){var _0x6bfc3a=this[_0xad8e('0x1e')](_0x2114d6[_0x44c700][_0xad8e('0x26')]);if(_0x6bfc3a){_0x2114d6[_0x44c700][_0xad8e('0x22')]=_0x6bfc3a['accountcode'];_0x2114d6[_0x44c700][_0xad8e('0x27')]=!![];_0x2114d6[_0x44c700][_0xad8e('0x28')]=_0x6bfc3a[_0xad8e('0x1f')];_0x2114d6[_0x44c700][_0xad8e('0x23')]=_[_0xad8e('0x20')](_0x6bfc3a['interface'])?util['format'](_0xad8e('0x29'),_0x6bfc3a[_0xad8e('0x1f')]):_0x6bfc3a[_0xad8e('0x23')];if(_0x2114d6[_0x44c700][_0xad8e('0x2a')]){_0x2114d6[_0x44c700][_0xad8e('0x2b')]=moment()['format'](_0xad8e('0x2c'));}if(_0x2114d6[_0x44c700][_0xad8e('0x2d')]){_0x2114d6[_0x44c700][_0xad8e('0x2e')]=moment()[_0xad8e('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xad8e('0x24')](_0x2114d6[_0x44c700]);}RpcVoiceQueueReport['create'](_0x2114d6[_0x44c700]);}};function extractCalleridNumber(_0x4b3e4f){var _0x5ccf8d=_0x4b3e4f['match'](/<(.*?)>/);return _0x5ccf8d?_0x5ccf8d[0x1]:_0x4b3e4f;}Report[_0xad8e('0x1d')][_0xad8e('0x30')]=function(_0x53c5bc){for(var _0x19caf9=0x0;_0x19caf9','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','type','membername','monitor','monitors','filename','createdAt','calleridname','connectedlinename','exten','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceAgentReport'];(function(_0x1c0e87,_0x37ebff){var _0x5c6fb2=function(_0x247487){while(--_0x247487){_0x1c0e87['push'](_0x1c0e87['shift']());}};_0x5c6fb2(++_0x37ebff);}(_0x25d6,0x16e));var _0x625d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x625d('0x0'));var moment=require(_0x625d('0x1'));var util=require(_0x625d('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x625d('0x3'));var RpcVoiceCallReport=require(_0x625d('0x4'));var RpcVoiceDialReport=require(_0x625d('0x5'));var RpcMemberReport=require(_0x625d('0x6'));var RpcVoiceQueueReport=require(_0x625d('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x625d('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x625d('0x9'));var VoiceDialReport=require(_0x625d('0xa'));var UserReport=require('./userReport');function Report(_0x2bbd4a){this[_0x625d('0xb')]=_0x2bbd4a;this[_0x625d('0xc')]=_0x2bbd4a[_0x625d('0xc')];this[_0x625d('0xd')]=_0x2bbd4a[_0x625d('0xd')];}Report['prototype'][_0x625d('0xe')]=function(_0x2a5c76){var _0xa1f053=new VoiceQueueReport(this['realtime']);var _0x3575cd=new VoiceAgentReport(this['realtime']);var _0x98dc3d=new VoiceDialReport(this['realtime']);var _0x1d521d=new VoiceCallReport(this[_0x625d('0xb')]);var _0x35a07=new UserReport(this[_0x625d('0xb')]);if(config['xdr']&&config['xdr'][_0x625d('0xf')]){ami['on'](_0x625d('0x10'),this[_0x625d('0x11')][_0x625d('0x12')](this));ami['on'](_0x625d('0x13'),this[_0x625d('0x14')][_0x625d('0x12')](this));ami['on'](_0x625d('0x15'),this[_0x625d('0x16')]['bind'](this));ami['on'](_0x625d('0x17'),this[_0x625d('0x18')][_0x625d('0x12')](this));ami['on'](_0x625d('0x19'),this['blindTransfer']['bind'](this));ami['on'](_0x625d('0x1a'),this['attendedTransfer']['bind'](this));}};Report['prototype'][_0x625d('0x1b')]=function(_0x1e172a){var _0x49c6f0;_0x49c6f0=_[_0x625d('0x1c')](this[_0x625d('0xc')],function(_0x1eac22){return _0x1eac22[_0x625d('0x1d')]==_0x1e172a||_0x1eac22[_0x625d('0x1e')]==_0x1e172a;});if(_['isNil'](_0x49c6f0)){var _0x4390d0=_[_0x625d('0x1c')](this['telephones'],function(_0x1e3d16){return _0x1e3d16['accountcode']==_0x1e172a||_0x1e3d16[_0x625d('0x1e')]==_0x1e172a;});if(_0x4390d0){_0x49c6f0=_[_0x625d('0x1c')](this[_0x625d('0xc')],function(_0x5d1758){return _0x5d1758[_0x625d('0x1f')]==util[_0x625d('0x20')](_0x625d('0x21'),_0x4390d0[_0x625d('0x1e')]);});}}return _0x49c6f0;};Report[_0x625d('0x22')][_0x625d('0x11')]=function(_0xa7ac3f){for(var _0x157e56=0x0;_0x157e56<_0xa7ac3f[_0x625d('0x23')];_0x157e56+=0x1){var _0x2fe76b=this[_0x625d('0x1b')](_0xa7ac3f[_0x157e56][_0x625d('0x24')]);if(_0x2fe76b){_0xa7ac3f[_0x157e56]['accountcode']=_0x2fe76b['accountcode'];_0xa7ac3f[_0x157e56][_0x625d('0x25')]=!![];_0xa7ac3f[_0x157e56][_0x625d('0x26')]=_0x2fe76b[_0x625d('0x1e')];_0xa7ac3f[_0x157e56][_0x625d('0x1f')]=_[_0x625d('0x27')](_0x2fe76b[_0x625d('0x1f')])?util[_0x625d('0x20')]('SIP/%s',_0x2fe76b['name']):_0x2fe76b[_0x625d('0x1f')];if(_0xa7ac3f[_0x157e56][_0x625d('0x28')]){_0xa7ac3f[_0x157e56][_0x625d('0x29')]=moment()[_0x625d('0x20')](_0x625d('0x2a'));}if(_0xa7ac3f[_0x157e56][_0x625d('0x2b')]){_0xa7ac3f[_0x157e56][_0x625d('0x2c')]=moment()[_0x625d('0x20')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0xa7ac3f[_0x157e56]);}RpcVoiceQueueReport[_0x625d('0x2d')](_0xa7ac3f[_0x157e56]);}};function extractCalleridNumber(_0x3b62bc){var _0x67257c=_0x3b62bc[_0x625d('0x2e')](/<(.*?)>/);return _0x67257c?_0x67257c[0x1]:_0x3b62bc;}Report[_0x625d('0x22')][_0x625d('0x2f')]=function(_0x4d23e5){for(var _0x2cfa=0x0;_0x2cfa0x0?_0x2eff6a:0x0;this[_0xa19f('0x15')][_0x4fe106[_0xa19f('0x62')]][_0xa19f('0x2b')]=this[_0xa19f('0x15')][_0x4fe106[_0xa19f('0x62')]][_0xa19f('0x2b')]>_[_0xa19f('0x67')](_0x4fe106[_0xa19f('0x69')])?_[_0xa19f('0x67')](_0x4fe106[_0xa19f('0x69')]):this[_0xa19f('0x15')][_0x4fe106['queue']][_0xa19f('0x2b')];this[_0xa19f('0x4a')](this[_0xa19f('0x15')][_0x4fe106['queue']],_0xa19f('0x5e'));}logger['debug'](_0xa19f('0x6a'),util[_0xa19f('0x36')](this[_0xa19f('0x15')][_0x4fe106['queue']],{'showHidden':![],'depth':null}));ami[_0xa19f('0x3d')](_0xa19f('0x6b'),this[_0xa19f('0x15')][_0x4fe106[_0xa19f('0x62')]]);}}}catch(_0x253548){logger[_0xa19f('0x34')](_0xa19f('0x60'),util[_0xa19f('0x36')](_0x253548,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x13e04f){logger[_0xa19f('0x3f')](_0xa19f('0x6c'),util[_0xa19f('0x36')](_0x13e04f,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0x6d')]=function(_0x4e7ce0){try{if(this[_0xa19f('0x61')](_0x4e7ce0)){logger[_0xa19f('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4e7ce0[_0xa19f('0x42')],util[_0xa19f('0x36')](_0x4e7ce0,{'showHidden':![],'depth':null}));if(_[_0xa19f('0x59')](this[_0xa19f('0x11')][_0x4e7ce0[_0xa19f('0x42')]]))this['queueReports'][_0x4e7ce0['uniqueid']]=[];if(_[_0xa19f('0x59')](this['channels'][_0x4e7ce0[_0xa19f('0x42')]]))this['channels'][_0x4e7ce0[_0xa19f('0x42')]]={};var _0x1657b3=new QueueReport();_0x1657b3[_0xa19f('0x47')]=_0x4e7ce0[_0xa19f('0x62')];_0x1657b3['type']=this[_0xa19f('0x15')][_0x1657b3[_0xa19f('0x47')]]&&this[_0xa19f('0x15')][_0x1657b3[_0xa19f('0x47')]][_0xa19f('0x4b')]?this[_0xa19f('0x15')][_0x1657b3['name']][_0xa19f('0x4b')]||_0xa19f('0x4c'):'inbound';_0x1657b3[_0xa19f('0x62')]=_0x4e7ce0['queue'];_0x1657b3[_0xa19f('0x6e')]=moment()[_0xa19f('0x43')](_0xa19f('0x6f'));_0x1657b3['position']=_0x4e7ce0['position'];_0x1657b3['count']=_0x4e7ce0[_0xa19f('0x70')];_0x1657b3[_0xa19f('0x42')]=_0x4e7ce0[_0xa19f('0x42')];_0x1657b3[_0xa19f('0x71')]=this[_0xa19f('0x13')][_0x4e7ce0['uniqueid']][_0xa19f('0x71')];logger[_0xa19f('0x63')](_0xa19f('0x72'),_0x1657b3[_0xa19f('0x47')],_0x1657b3[_0xa19f('0x4b')]);_[_0xa19f('0x73')](_0x1657b3,_[_0xa19f('0x74')](_0x4e7ce0,_[_0xa19f('0x75')](_0x1657b3)));this[_0xa19f('0x11')][_0x4e7ce0[_0xa19f('0x42')]][_0xa19f('0x76')](_0x1657b3);this[_0xa19f('0x13')][_0x4e7ce0[_0xa19f('0x42')]]=_0x1657b3;this[_0xa19f('0x3e')](_0x1657b3,'queuecallerjoin');}}catch(_0xe0ba72){logger[_0xa19f('0x34')](_0xa19f('0x77'),_0x4e7ce0[_0xa19f('0x42')],util[_0xa19f('0x36')](_0xe0ba72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0x1c')]=function(_0x1b5cf9){try{if(this['isNotNull'](_0x1b5cf9)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x1b5cf9['uniqueid'],util['inspect'](_0x1b5cf9,{'showHidden':![],'depth':null}));if(this[_0xa19f('0x11')][_0x1b5cf9[_0xa19f('0x42')]]){var _0x386841=_[_0xa19f('0x78')](this[_0xa19f('0x11')][_0x1b5cf9['uniqueid']]);_0x386841[_0xa19f('0x79')]=![];_0x386841[_0xa19f('0x7a')]=null;_0x386841[_0xa19f('0x7b')]=_0x1b5cf9['holdtime'];_0x386841[_0xa19f('0x7c')]=_0x1b5cf9[_0xa19f('0x7c')];_0x386841[_0xa19f('0x1b')]=!![];_0x386841[_0xa19f('0x7d')]=moment()['format'](_0xa19f('0x6f'));_0x386841['queuecallerexitreason']=_0xa19f('0x7e');_0x386841[_0xa19f('0x7f')]=null;logger[_0xa19f('0x63')](_0xa19f('0x80'),_0x386841[_0xa19f('0x47')],_0x386841[_0xa19f('0x4b')]);this['channels'][_0x1b5cf9[_0xa19f('0x42')]]=_0x386841;this[_0xa19f('0x3c')](_0x386841,'queuecallerabandon');}}}catch(_0xb32c03){logger[_0xa19f('0x34')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1b5cf9[_0xa19f('0x42')],util[_0xa19f('0x36')](_0xb32c03,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0x81')]=function(_0x26889a){try{if(this[_0xa19f('0x61')](_0x26889a)){logger[_0xa19f('0x3f')](_0xa19f('0x82'),_0x26889a[_0xa19f('0x42')],util[_0xa19f('0x36')](_0x26889a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x26889a[_0xa19f('0x42')]]){var _0x3e002c=_['last'](this[_0xa19f('0x11')][_0x26889a[_0xa19f('0x42')]]);_0x3e002c[_0xa19f('0x83')]=moment()[_0xa19f('0x43')](_0xa19f('0x6f'));_0x3e002c[_0xa19f('0x84')]=_0x26889a[_0xa19f('0x84')];_0x3e002c['connectedlinename']=_0x26889a[_0xa19f('0x85')];logger[_0xa19f('0x63')](_0xa19f('0x86'),_0x3e002c[_0xa19f('0x47')],_0x3e002c[_0xa19f('0x4b')],_0x26889a[_0xa19f('0x84')],_0x26889a[_0xa19f('0x85')]);this[_0xa19f('0x13')][_0x26889a['uniqueid']]=_0x3e002c;this[_0xa19f('0x3e')](_0x3e002c,_0xa19f('0x87'));}}}catch(_0x10f69a){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x26889a[_0xa19f('0x42')],util['inspect'](_0x10f69a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0x1d')]=function(_0x21cb71){try{if(this[_0xa19f('0x61')](_0x21cb71)){logger[_0xa19f('0x3f')](_0xa19f('0x88'),_0x21cb71[_0xa19f('0x42')],util['inspect'](_0x21cb71,{'showHidden':![],'depth':null}));if(this[_0xa19f('0x11')][_0x21cb71[_0xa19f('0x42')]]){var _0x5ea0c8=_[_0xa19f('0x78')](this['queueReports'][_0x21cb71[_0xa19f('0x42')]]);_0x5ea0c8[_0xa19f('0x79')]=!![];_0x5ea0c8[_0xa19f('0x89')]=_0xa19f('0x8a');logger[_0xa19f('0x63')](_0xa19f('0x8b'),_0x5ea0c8['name'],_0x5ea0c8['type']);}}}catch(_0x1c68fc){logger[_0xa19f('0x34')]('[%s][voiceQueueReport][agentconnect]',_0x21cb71[_0xa19f('0x42')],util['inspect'](_0x1c68fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0x8c')]=function(_0x171764){try{if(this['isNotNull'](_0x171764)){logger[_0xa19f('0x3f')](_0xa19f('0x8d'),_0x171764['uniqueid'],util[_0xa19f('0x36')](_0x171764,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x171764['uniqueid']]){var _0x150d90=_[_0xa19f('0x78')](this[_0xa19f('0x11')][_0x171764['uniqueid']]);_0x150d90[_0xa19f('0x1b')]=![];_0x150d90[_0xa19f('0x7d')]=null;_0x150d90[_0xa19f('0x8e')]=!![];_0x150d90[_0xa19f('0x7f')]=_0x171764[_0xa19f('0x8f')];_0x150d90[_0xa19f('0x7b')]=_0x171764[_0xa19f('0x7b')];_0x150d90[_0xa19f('0x79')]=!![];_0x150d90[_0xa19f('0x90')]=![];_0x150d90[_0xa19f('0x91')]=null;if(!_0x150d90[_0xa19f('0x92')]){if(_0x171764[_0xa19f('0x93')]=='transfer'){_0x150d90[_0xa19f('0x89')]='COMPLETED';logger[_0xa19f('0x63')](_0xa19f('0x94'),_0x150d90[_0xa19f('0x47')],_0x150d90[_0xa19f('0x4b')]);}else{if(_[_0xa19f('0x95')](_0x171764[_0xa19f('0x32')][_0xa19f('0x96')](),_0xa19f('0x97'))){if(this['queueReports'][_0x171764[_0xa19f('0x98')]]){var _0x3f5f58=_[_0xa19f('0x78')](this[_0xa19f('0x11')][_0x171764['linkedid']]);_0x3f5f58[_0xa19f('0x79')]=![];_0x3f5f58[_0xa19f('0x90')]=!![];_0x3f5f58[_0xa19f('0x91')]=moment(_0x150d90[_0xa19f('0x6e')])[_0xa19f('0x99')](_0x171764[_0xa19f('0x7b')],'seconds')['format'](_0xa19f('0x6f'));_0x3f5f58['queuecallerexitreason']=_0xa19f('0x9a');_0x3f5f58['transfer']=!![];_0x3f5f58[_0xa19f('0x9b')]='FORWARD';_0x3f5f58[_0xa19f('0x9c')]=_0x171764['destexten'];_0x3f5f58[_0xa19f('0x9d')]=_0x171764[_0xa19f('0x42')];logger[_0xa19f('0x63')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3f5f58['name'],_0x3f5f58[_0xa19f('0x4b')]);var _0x1814f1=this[_0xa19f('0x11')][_0x171764['linkedid']];this['queueReports'][_0x171764[_0xa19f('0x98')]]=this[_0xa19f('0x11')][_0x171764[_0xa19f('0x42')]];this[_0xa19f('0x11')][_0x171764[_0xa19f('0x42')]]=_0x1814f1;}}else{_0x150d90[_0xa19f('0x89')]=_0xa19f('0x9e')+_0x171764['reason']['toUpperCase']();logger[_0xa19f('0x63')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x150d90['name'],_0x150d90[_0xa19f('0x4b')],_0x150d90[_0xa19f('0x89')]);}}}this['channels'][_0x171764[_0xa19f('0x42')]]=_0x150d90;this['emitVoiceQueueChannelRemove'](_0x150d90,_0xa19f('0x9f'));}}}catch(_0x37b7cc){logger[_0xa19f('0x34')](_0xa19f('0x8d'),_0x171764[_0xa19f('0x42')],util[_0xa19f('0x36')](_0x37b7cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa19f('0xd')]['syncVarSet']=function(_0x37f497){try{if(this['isNotNull'](_0x37f497)){logger[_0xa19f('0x3f')]('[%s][voiceQueueReport][varset]',_0x37f497[_0xa19f('0x42')],util[_0xa19f('0x36')](_0x37f497,{'showHidden':![],'depth':null}));this[_0xa19f('0xa0')](_0x37f497[_0xa19f('0x42')],_[_0xa19f('0x75')](_0x37f497[_0xa19f('0xa1')])[0x0],_0x37f497[_0xa19f('0xa2')]);if(this[_0xa19f('0x11')][_0x37f497[_0xa19f('0x42')]]){var _0x5abc30=_['last'](this['queueReports'][_0x37f497[_0xa19f('0x42')]]);if(_0x5abc30){if(this[_0xa19f('0x61')](_0x37f497[_0xa19f('0xa1')])&&this['isNotNull'](_0x37f497[_0xa19f('0xa1')]['queuestatus'])){switch(_0x37f497[_0xa19f('0xa2')]){case _0xa19f('0xa3'):_0x5abc30['queuecallerexit']=![];_0x5abc30[_0xa19f('0x91')]=null;break;case'TIMEOUT':_0x5abc30[_0xa19f('0xa4')]=_0xa19f('0xa5');_0x5abc30[_0xa19f('0x90')]=!![];_0x5abc30['queuecallerexitAt']=moment()['format'](_0xa19f('0x6f'));_0x5abc30[_0xa19f('0x83')]=moment()[_0xa19f('0x43')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xa19f('0x3f')](_0xa19f('0xa6'),_0x37f497[_0xa19f('0x42')],util[_0xa19f('0x36')](_0x5abc30,{'showHidden':![],'depth':null}));ami[_0xa19f('0x3d')](_0xa19f('0xa7'),_0x5abc30);break;default:_0x5abc30[_0xa19f('0x90')]=!![];_0x5abc30[_0xa19f('0x91')]=moment()[_0xa19f('0x43')](_0xa19f('0x6f'));_0x5abc30[_0xa19f('0x83')]=moment()[_0xa19f('0x43')](_0xa19f('0x6f'));}_0x5abc30[_0xa19f('0x1b')]=![];_0x5abc30[_0xa19f('0x7d')]=null;_0x5abc30['queuecallerexitreason']=_0x37f497[_0xa19f('0xa2')];this[_0xa19f('0x13')][_0x37f497[_0xa19f('0x42')]]=_0x5abc30;this[_0xa19f('0x3c')](_0x5abc30,_0xa19f('0x1e'));}else if(this['isNotNull'](_0x37f497[_0xa19f('0xa1')])&&this['isNotNull'](_0x37f497[_0xa19f('0xa1')][_0xa19f('0xa8')])){if(!_0x5abc30['queuecallerabandon']){_0x5abc30[_0xa19f('0x90')]=!![];_0x5abc30[_0xa19f('0x91')]=moment()[_0xa19f('0x43')](_0xa19f('0x6f'));_0x5abc30[_0xa19f('0x89')]='EXITWITHKEY';_0x5abc30[_0xa19f('0x83')]=moment()[_0xa19f('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x37f497[_0xa19f('0x42')]]=_0x5abc30;}}logger[_0xa19f('0x63')](_0xa19f('0xa9'),_0x37f497[_0xa19f('0x42')],_0x5abc30[_0xa19f('0x47')],_0x5abc30[_0xa19f('0x4b')],_[_0xa19f('0x75')](_0x37f497[_0xa19f('0xa1')])[0x0],_0x37f497[_0xa19f('0xa2')]);_0x5abc30[_0xa19f('0x38')]=this[_0xa19f('0x38')][_0x37f497['uniqueid']];}}}}catch(_0x58205){logger[_0xa19f('0x34')]('[%s][voiceQueueReport][varset]',_0x37f497['uniqueid'],util[_0xa19f('0x36')](_0x58205,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0xa0')]=function(_0x347542,_0x8890cf,_0x1047ba){var _0x13a086=[_0xa19f('0xaa'),_0xa19f('0xab'),_0xa19f('0xac'),'rtpaudioqosjitterbridged',_0xa19f('0xad'),_0xa19f('0xae'),'rtpaudioqosrtt',_0xa19f('0xaf'),_0xa19f('0xb0'),_0xa19f('0xb1'),_0xa19f('0xb2'),'bridgepvtcallid',_0xa19f('0xb3'),_0xa19f('0xb4'),_0xa19f('0xb5'),_0xa19f('0xb6'),_0xa19f('0x8f'),_0xa19f('0xb7'),_0xa19f('0xb8')];if(!_['isNil'](_0x8890cf)&&!_['includes'](_0x13a086,_0x8890cf)){if(_[_0xa19f('0x59')](this['variables'][_0x347542])){this[_0xa19f('0x38')][_0x347542]={};}this[_0xa19f('0x38')][_0x347542][_0x8890cf]=_0x1047ba;}};VoiceQueueReport[_0xa19f('0xd')][_0xa19f('0x21')]=function(_0x55f18f){try{if(this[_0xa19f('0x61')](_0x55f18f)){logger[_0xa19f('0x3f')](_0xa19f('0xb9'),_0x55f18f[_0xa19f('0x42')],util[_0xa19f('0x36')](_0x55f18f,{'showHidden':![],'depth':null}));if(this[_0xa19f('0x11')][_0x55f18f[_0xa19f('0x42')]]){for(var _0x28865b=0x0,_0x20a668={};_0x28865b0x0?_0x292ba7:0x0;this[_0x17f6('0x12')][_0xf4e3ca[_0x17f6('0x69')]]['talking']=this[_0x17f6('0x12')][_0xf4e3ca[_0x17f6('0x69')]]['talking']>_[_0x17f6('0x6e')](_0xf4e3ca[_0x17f6('0x6f')])?_[_0x17f6('0x6e')](_0xf4e3ca[_0x17f6('0x6f')]):this[_0x17f6('0x12')][_0xf4e3ca['queue']][_0x17f6('0x2d')];this['emitVoiceQueueSummary'](this[_0x17f6('0x12')][_0xf4e3ca[_0x17f6('0x69')]],_0x17f6('0x15'));}logger['debug'](_0x17f6('0x70'),util[_0x17f6('0x3b')](this[_0x17f6('0x12')][_0xf4e3ca[_0x17f6('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0x17f6('0x71'),this['voiceQueues'][_0xf4e3ca['queue']]);}}}catch(_0x5c3efe){logger[_0x17f6('0x38')](_0x17f6('0x67'),util[_0x17f6('0x3b')](_0x5c3efe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x17f6('0xa')]['syncQueueSummaryComplete']=function(_0xad000c){logger['debug'](_0x17f6('0x72'),util[_0x17f6('0x3b')](_0xad000c,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x17f6('0x1a')]=function(_0x5e3308){try{if(this[_0x17f6('0x60')](_0x5e3308)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x5e3308['uniqueid'],util[_0x17f6('0x3b')](_0x5e3308,{'showHidden':![],'depth':null}));if(_[_0x17f6('0x61')](this[_0x17f6('0xe')][_0x5e3308['uniqueid']]))this[_0x17f6('0xe')][_0x5e3308[_0x17f6('0x45')]]=[];if(_[_0x17f6('0x61')](this[_0x17f6('0x10')][_0x5e3308[_0x17f6('0x45')]]))this[_0x17f6('0x10')][_0x5e3308[_0x17f6('0x45')]]={};var _0x4c9e39=new QueueReport();_0x4c9e39[_0x17f6('0x4e')]=_0x5e3308[_0x17f6('0x69')];_0x4c9e39[_0x17f6('0x4c')]=this[_0x17f6('0x12')][_0x4c9e39[_0x17f6('0x4e')]]&&this['voiceQueues'][_0x4c9e39[_0x17f6('0x4e')]][_0x17f6('0x4c')]?this[_0x17f6('0x12')][_0x4c9e39[_0x17f6('0x4e')]][_0x17f6('0x4c')]||'inbound':_0x17f6('0x4d');_0x4c9e39['queue']=_0x5e3308[_0x17f6('0x69')];_0x4c9e39[_0x17f6('0x73')]=moment()['format'](_0x17f6('0x74'));_0x4c9e39[_0x17f6('0x75')]=_0x5e3308['position'];_0x4c9e39[_0x17f6('0x76')]=_0x5e3308[_0x17f6('0x76')];_0x4c9e39['uniqueid']=_0x5e3308[_0x17f6('0x45')];_0x4c9e39[_0x17f6('0x77')]=this[_0x17f6('0x10')][_0x5e3308[_0x17f6('0x45')]][_0x17f6('0x77')];logger[_0x17f6('0x6a')](_0x17f6('0x78'),_0x4c9e39[_0x17f6('0x4e')],_0x4c9e39[_0x17f6('0x4c')]);_[_0x17f6('0x79')](_0x4c9e39,_[_0x17f6('0x7a')](_0x5e3308,_['keys'](_0x4c9e39)));this[_0x17f6('0xe')][_0x5e3308['uniqueid']][_0x17f6('0x7b')](_0x4c9e39);this['channels'][_0x5e3308[_0x17f6('0x45')]]=_0x4c9e39;this[_0x17f6('0x7c')](_0x4c9e39,_0x17f6('0x7d'));}}catch(_0x22edb7){logger[_0x17f6('0x38')](_0x17f6('0x7e'),_0x5e3308['uniqueid'],util[_0x17f6('0x3b')](_0x22edb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x17f6('0xa')][_0x17f6('0x1c')]=function(_0x301d3a){try{if(this['isNotNull'](_0x301d3a)){logger[_0x17f6('0x5c')](_0x17f6('0x7f'),_0x301d3a[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x301d3a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x301d3a[_0x17f6('0x45')]]){var _0x20b61f=_[_0x17f6('0x80')](this[_0x17f6('0xe')][_0x301d3a[_0x17f6('0x45')]]);_0x20b61f[_0x17f6('0x81')]=![];_0x20b61f[_0x17f6('0x82')]=null;_0x20b61f[_0x17f6('0x83')]=_0x301d3a[_0x17f6('0x83')];_0x20b61f[_0x17f6('0x84')]=_0x301d3a[_0x17f6('0x84')];_0x20b61f['queuecallerabandon']=!![];_0x20b61f[_0x17f6('0x85')]=moment()['format'](_0x17f6('0x74'));_0x20b61f[_0x17f6('0x86')]='ABANDONED';_0x20b61f[_0x17f6('0x87')]=null;logger[_0x17f6('0x6a')](_0x17f6('0x88'),_0x20b61f[_0x17f6('0x4e')],_0x20b61f['type']);this[_0x17f6('0x10')][_0x301d3a[_0x17f6('0x45')]]=_0x20b61f;this['emitVoiceQueueChannelRemove'](_0x20b61f,_0x17f6('0x1b'));}}}catch(_0x26be3c){logger[_0x17f6('0x38')](_0x17f6('0x7f'),_0x301d3a['uniqueid'],util[_0x17f6('0x3b')](_0x26be3c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x17f6('0xa')][_0x17f6('0x1e')]=function(_0x383c92){try{if(this[_0x17f6('0x60')](_0x383c92)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x383c92[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x383c92,{'showHidden':![],'depth':null}));if(this[_0x17f6('0xe')][_0x383c92[_0x17f6('0x45')]]){var _0x185935=_[_0x17f6('0x80')](this[_0x17f6('0xe')][_0x383c92[_0x17f6('0x45')]]);_0x185935[_0x17f6('0x89')]=moment()[_0x17f6('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x185935['connectedlinenum']=_0x383c92[_0x17f6('0x8a')];_0x185935[_0x17f6('0x8b')]=_0x383c92['connectedlinename'];logger[_0x17f6('0x6a')](_0x17f6('0x8c'),_0x185935[_0x17f6('0x4e')],_0x185935[_0x17f6('0x4c')],_0x383c92['connectedlinenum'],_0x383c92[_0x17f6('0x8b')]);this['channels'][_0x383c92[_0x17f6('0x45')]]=_0x185935;this[_0x17f6('0x7c')](_0x185935,_0x17f6('0x1d'));}}}catch(_0x23b699){logger['error'](_0x17f6('0x8d'),_0x383c92[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x23b699,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x17f6('0x20')]=function(_0x469ffc){try{if(this['isNotNull'](_0x469ffc)){logger[_0x17f6('0x5c')](_0x17f6('0x8e'),_0x469ffc[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x469ffc,{'showHidden':![],'depth':null}));if(this[_0x17f6('0xe')][_0x469ffc[_0x17f6('0x45')]]){var _0x1ad24c=_['last'](this['queueReports'][_0x469ffc[_0x17f6('0x45')]]);_0x1ad24c[_0x17f6('0x81')]=!![];_0x1ad24c['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x17f6('0x6a')](_0x17f6('0x8f'),_0x1ad24c[_0x17f6('0x4e')],_0x1ad24c[_0x17f6('0x4c')]);}}}catch(_0x121743){logger[_0x17f6('0x38')](_0x17f6('0x8e'),_0x469ffc[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x121743,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x17f6('0xa')][_0x17f6('0x90')]=function(_0x13bd78){try{if(this['isNotNull'](_0x13bd78)){logger[_0x17f6('0x5c')](_0x17f6('0x91'),_0x13bd78[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x13bd78,{'showHidden':![],'depth':null}));if(this[_0x17f6('0xe')][_0x13bd78[_0x17f6('0x45')]]){var _0x405405=_[_0x17f6('0x80')](this[_0x17f6('0xe')][_0x13bd78['uniqueid']]);_0x405405[_0x17f6('0x1b')]=![];_0x405405[_0x17f6('0x85')]=null;_0x405405[_0x17f6('0x92')]=!![];_0x405405[_0x17f6('0x87')]=_0x13bd78[_0x17f6('0x93')];_0x405405[_0x17f6('0x83')]=_0x13bd78['holdtime'];_0x405405[_0x17f6('0x81')]=!![];_0x405405[_0x17f6('0x94')]=![];_0x405405[_0x17f6('0x95')]=null;if(!_0x405405['transfer']){if(_0x13bd78[_0x17f6('0x96')]==_0x17f6('0x97')){_0x405405['queuecallerexitreason']=_0x17f6('0x98');logger[_0x17f6('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x405405['name'],_0x405405[_0x17f6('0x4c')]);}else{if(_['startsWith'](_0x13bd78[_0x17f6('0x36')]['toLowerCase'](),_0x17f6('0x99'))){if(this[_0x17f6('0xe')][_0x13bd78['linkedid']]){var _0x45a93d=_[_0x17f6('0x80')](this[_0x17f6('0xe')][_0x13bd78[_0x17f6('0x9a')]]);_0x45a93d[_0x17f6('0x81')]=![];_0x45a93d[_0x17f6('0x94')]=!![];_0x45a93d[_0x17f6('0x95')]=moment(_0x405405[_0x17f6('0x73')])[_0x17f6('0x9b')](_0x13bd78['holdtime'],_0x17f6('0x9c'))[_0x17f6('0x46')](_0x17f6('0x74'));_0x45a93d[_0x17f6('0x86')]='FORWARDTRANSFER';_0x45a93d[_0x17f6('0x97')]=!![];_0x45a93d[_0x17f6('0x9d')]='FORWARD';_0x45a93d[_0x17f6('0x9e')]=_0x13bd78[_0x17f6('0x9f')];_0x45a93d[_0x17f6('0xa0')]=_0x13bd78['uniqueid'];logger['info'](_0x17f6('0xa1'),_0x45a93d[_0x17f6('0x4e')],_0x45a93d[_0x17f6('0x4c')]);var _0x45732c=this[_0x17f6('0xe')][_0x13bd78[_0x17f6('0x9a')]];this['queueReports'][_0x13bd78[_0x17f6('0x9a')]]=this[_0x17f6('0xe')][_0x13bd78[_0x17f6('0x45')]];this[_0x17f6('0xe')][_0x13bd78[_0x17f6('0x45')]]=_0x45732c;}}else{_0x405405[_0x17f6('0x86')]='COMPLETEDBY'+_0x13bd78[_0x17f6('0x96')][_0x17f6('0xa2')]();logger[_0x17f6('0x6a')](_0x17f6('0xa3'),_0x405405[_0x17f6('0x4e')],_0x405405[_0x17f6('0x4c')],_0x405405[_0x17f6('0x86')]);}}}this[_0x17f6('0x10')][_0x13bd78[_0x17f6('0x45')]]=_0x405405;this['emitVoiceQueueChannelRemove'](_0x405405,_0x17f6('0x1f'));}}}catch(_0x56cb0f){logger[_0x17f6('0x38')]('[%s][voiceQueueReport][agentcomplete]',_0x13bd78['uniqueid'],util[_0x17f6('0x3b')](_0x56cb0f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x17f6('0xa')]['syncVarSet']=function(_0x5e3790){try{if(this[_0x17f6('0x60')](_0x5e3790)){logger[_0x17f6('0x5c')]('[%s][voiceQueueReport][varset]',_0x5e3790[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x5e3790,{'showHidden':![],'depth':null}));this[_0x17f6('0xa4')](_0x5e3790[_0x17f6('0x45')],_[_0x17f6('0xa5')](_0x5e3790[_0x17f6('0xa6')])[0x0],_0x5e3790[_0x17f6('0xa7')]);if(this[_0x17f6('0xe')][_0x5e3790[_0x17f6('0x45')]]){var _0x5eca3e=_[_0x17f6('0x80')](this['queueReports'][_0x5e3790[_0x17f6('0x45')]]);if(_0x5eca3e){if(this[_0x17f6('0x60')](_0x5e3790[_0x17f6('0xa6')])&&this['isNotNull'](_0x5e3790[_0x17f6('0xa6')]['queuestatus'])){switch(_0x5e3790['value']){case _0x17f6('0xa8'):_0x5eca3e[_0x17f6('0x94')]=![];_0x5eca3e[_0x17f6('0x95')]=null;break;case'TIMEOUT':_0x5eca3e[_0x17f6('0xa9')]=_0x17f6('0xaa');_0x5eca3e['queuecallerexit']=!![];_0x5eca3e[_0x17f6('0x95')]=moment()[_0x17f6('0x46')](_0x17f6('0x74'));_0x5eca3e['queuecallerleaveAt']=moment()[_0x17f6('0x46')](_0x17f6('0x74'));logger[_0x17f6('0x5c')](_0x17f6('0xab'),_0x5e3790[_0x17f6('0x45')],util['inspect'](_0x5eca3e,{'showHidden':![],'depth':null}));ami['emit'](_0x17f6('0xac'),_0x5eca3e);break;default:_0x5eca3e[_0x17f6('0x94')]=!![];_0x5eca3e[_0x17f6('0x95')]=moment()[_0x17f6('0x46')](_0x17f6('0x74'));_0x5eca3e[_0x17f6('0x89')]=moment()[_0x17f6('0x46')](_0x17f6('0x74'));}_0x5eca3e[_0x17f6('0x1b')]=![];_0x5eca3e[_0x17f6('0x85')]=null;_0x5eca3e[_0x17f6('0x86')]=_0x5e3790[_0x17f6('0xa7')];this[_0x17f6('0x10')][_0x5e3790[_0x17f6('0x45')]]=_0x5eca3e;this[_0x17f6('0x40')](_0x5eca3e,_0x17f6('0xad'));}else if(this[_0x17f6('0x60')](_0x5e3790[_0x17f6('0xa6')])&&this[_0x17f6('0x60')](_0x5e3790[_0x17f6('0xa6')]['queueposition'])){if(!_0x5eca3e[_0x17f6('0x1b')]){_0x5eca3e[_0x17f6('0x94')]=!![];_0x5eca3e[_0x17f6('0x95')]=moment()['format'](_0x17f6('0x74'));_0x5eca3e['queuecallerexitreason']=_0x17f6('0xae');_0x5eca3e[_0x17f6('0x89')]=moment()['format'](_0x17f6('0x74'));this[_0x17f6('0x10')][_0x5e3790[_0x17f6('0x45')]]=_0x5eca3e;}}logger[_0x17f6('0x6a')](_0x17f6('0xaf'),_0x5e3790[_0x17f6('0x45')],_0x5eca3e[_0x17f6('0x4e')],_0x5eca3e[_0x17f6('0x4c')],_[_0x17f6('0xa5')](_0x5e3790[_0x17f6('0xa6')])[0x0],_0x5e3790[_0x17f6('0xa7')]);_0x5eca3e[_0x17f6('0x14')]=this[_0x17f6('0x14')][_0x5e3790[_0x17f6('0x45')]];}}}}catch(_0x1e8413){logger[_0x17f6('0x38')](_0x17f6('0xb0'),_0x5e3790[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x1e8413,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x17f6('0xa')][_0x17f6('0xa4')]=function(_0x512b59,_0x57afb7,_0x55ea96){var _0x23ef23=[_0x17f6('0xb1'),_0x17f6('0xb2'),_0x17f6('0xb3'),_0x17f6('0xb4'),'rtpaudioqosloss',_0x17f6('0xb5'),_0x17f6('0xb6'),'rtpaudioqosrttbridged','sipcallid','sipuri',_0x17f6('0xb7'),_0x17f6('0xb8'),_0x17f6('0xb9'),'memberdynamic',_0x17f6('0xba'),_0x17f6('0xbb'),_0x17f6('0x93'),_0x17f6('0xbc'),_0x17f6('0xbd')];if(!_[_0x17f6('0x34')](_0x57afb7)&&!_[_0x17f6('0xbe')](_0x23ef23,_0x57afb7)){if(_[_0x17f6('0x61')](this[_0x17f6('0x14')][_0x512b59])){this[_0x17f6('0x14')][_0x512b59]={};}this[_0x17f6('0x14')][_0x512b59][_0x57afb7]=_0x55ea96;}};VoiceQueueReport[_0x17f6('0xa')][_0x17f6('0xbf')]=function(_0x197313){try{if(this[_0x17f6('0x60')](_0x197313)){logger['debug'](_0x17f6('0xc0'),_0x197313[_0x17f6('0x45')],util[_0x17f6('0x3b')](_0x197313,{'showHidden':![],'depth':null}));if(this[_0x17f6('0xe')][_0x197313[_0x17f6('0x45')]]){for(var _0x350424=0x0,_0x4faf26={};_0x350424=0x0?moment(_0x268680['endtime'])[_0xd38f('0xe')](_0x268680[_0xd38f('0x18')],_0xd38f('0x1a')):null,'data1':_0xd38f('0x1b'),'data2':_0x268680[_0xd38f('0x13')],'data3':_0x268680[_0xd38f('0x10')],'data4':_0x268680['dialstring']||null,'role':_0xd38f('0x12'),'internal':_0x268680[_0xd38f('0x13')]?_[_0xd38f('0x14')](_0x268680[_0xd38f('0x13')]):undefined,'uniqueid':_0x268680[_0xd38f('0x15')]},'log':_0xd38f('0x8')});}; \ No newline at end of file +var _0x2289=['diff','outbound','moment','lodash','util','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','interface','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','seconds','exten','queue','agent','accountcode','toNumber','uniqueid','voice','membername','starttime','endtime'];(function(_0x35908e,_0x13be6e){var _0x31a30c=function(_0x272132){while(--_0x272132){_0x35908e['push'](_0x35908e['shift']());}};_0x31a30c(++_0x13be6e);}(_0x2289,0x98));var _0x9228=function(_0x5b4b55,_0x17d592){_0x5b4b55=_0x5b4b55-0x0;var _0x603594=_0x2289[_0x5b4b55];return _0x603594;};'use strict';var moment=require(_0x9228('0x0'));var _=require(_0x9228('0x1'));var util=require(_0x9228('0x2'));var client=require('../client');exports[_0x9228('0x3')]=function(_0xcad9a1){var _0x337f0a=_0xcad9a1['queuecallercompleteAt']||_0xcad9a1[_0x9228('0x4')];return client[_0x9228('0x5')](_0x9228('0x6'),{'body':{'channel':'voice','membername':_0xcad9a1['lastAssignedTo'],'interface':_['isNil'](_0xcad9a1[_0x9228('0x7')])?util['format'](_0x9228('0x8'),_0xcad9a1[_0x9228('0x9')]):_0xcad9a1['interface'],'type':_0x9228('0xa'),'enterAt':_0xcad9a1[_0x9228('0xb')],'exitAt':_0x337f0a,'duration':moment(_0x337f0a)['diff'](_0xcad9a1[_0x9228('0xb')],_0x9228('0xc')),'data1':'inbound','data2':_0xcad9a1['calleridnum'],'data3':_0xcad9a1[_0x9228('0xd')],'data4':null,'data5':_0xcad9a1[_0x9228('0xe')],'role':_0x9228('0xf'),'internal':_0xcad9a1[_0x9228('0x10')]?_[_0x9228('0x11')](_0xcad9a1[_0x9228('0x10')]):undefined,'uniqueid':_0xcad9a1[_0x9228('0x12')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x5d119d){return client[_0x9228('0x5')](_0x9228('0x6'),{'body':{'channel':_0x9228('0x13'),'membername':_0x5d119d[_0x9228('0x14')],'interface':_0x5d119d['interface'],'type':_0x9228('0xa'),'enterAt':_0x5d119d[_0x9228('0x15')],'exitAt':_0x5d119d[_0x9228('0x16')],'duration':moment(_0x5d119d['endtime'])[_0x9228('0x17')](_0x5d119d['starttime'],_0x9228('0xc'))>=0x0?moment(_0x5d119d[_0x9228('0x16')])[_0x9228('0x17')](_0x5d119d[_0x9228('0x15')],'seconds'):null,'data1':_0x9228('0x18'),'data2':_0x5d119d[_0x9228('0x10')],'data3':_0x5d119d['exten'],'data4':_0x5d119d['dialstring']||null,'role':'agent','internal':_0x5d119d[_0x9228('0x10')]?_[_0x9228('0x11')](_0x5d119d[_0x9228('0x10')]):undefined,'uniqueid':_0x5d119d[_0x9228('0x12')]},'log':_0x9228('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5f6e999..76e1a06 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 _0x29a1=['previewRecallmeReminderInterval','GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x4bbd33,_0x18a999){var _0xad0679=function(_0x22c209){while(--_0x22c209){_0x4bbd33['push'](_0x4bbd33['shift']());}};_0xad0679(++_0x18a999);}(_0x29a1,0x98));var _0x129a=function(_0x2e6165,_0x8ad92b){_0x2e6165=_0x2e6165-0x0;var _0x11b5b6=_0x29a1[_0x2e6165];return _0x11b5b6;};'use strict';var client=require('../client');exports[_0x129a('0x0')]=function(){return client[_0x129a('0x1')](_0x129a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x129a('0x3'),_0x129a('0x4')]},'log':_0x129a('0x5')});}; \ No newline at end of file +var _0xfc64=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xfc64,0x1b3));var _0x4fc6=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xfc64[_0x5608a3];return _0x1ed50a;};'use strict';var client=require(_0x4fc6('0x0'));exports[_0x4fc6('0x1')]=function(){return client[_0x4fc6('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4fc6('0x3'),_0x4fc6('0x4')]},'log':_0x4fc6('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 1ac02a0..9738cc7 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 _0x5b0a=['getTemplates','GetTemplate','name','../client'];(function(_0x45049c,_0x4f3666){var _0x25bda3=function(_0x84544f){while(--_0x84544f){_0x45049c['push'](_0x45049c['shift']());}};_0x25bda3(++_0x4f3666);}(_0x5b0a,0x1af));var _0xa5b0=function(_0x2f7ac9,_0x4c23db){_0x2f7ac9=_0x2f7ac9-0x0;var _0x381df1=_0x5b0a[_0x2f7ac9];return _0x381df1;};'use strict';var client=require(_0xa5b0('0x0'));exports[_0xa5b0('0x1')]=function(_0x25e30b){return function(_0x369c67){return client['Request'](_0xa5b0('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa5b0('0x3'),'html']},'log':_0xa5b0('0x2')});};}; \ No newline at end of file +var _0x58c4=['name','../client','Request','GetTemplate'];(function(_0x417234,_0x28ac37){var _0x33f3b8=function(_0x112361){while(--_0x112361){_0x417234['push'](_0x417234['shift']());}};_0x33f3b8(++_0x28ac37);}(_0x58c4,0x135));var _0x458c=function(_0x2386e8,_0x35bf72){_0x2386e8=_0x2386e8-0x0;var _0x51748a=_0x58c4[_0x2386e8];return _0x51748a;};'use strict';var client=require(_0x458c('0x0'));exports['getTemplates']=function(_0x357186){return function(_0x16ef90){return client[_0x458c('0x1')](_0x458c('0x2'),{'options':{'raw':!![],'attributes':['id',_0x458c('0x3'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ec52bbf..bd33555 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 _0x6eb2=['value','Action','Actions','action','data1','data2','data3','data4','data5','data6','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','operator'];(function(_0x1d8db5,_0x311038){var _0x5861a0=function(_0x3644a7){while(--_0x3644a7){_0x1d8db5['push'](_0x1d8db5['shift']());}};_0x5861a0(++_0x311038);}(_0x6eb2,0x19a));var _0x26eb=function(_0x22153b,_0x4528ec){_0x22153b=_0x22153b-0x0;var _0x217dae=_0x6eb2[_0x22153b];return _0x217dae;};'use strict';var client=require(_0x26eb('0x0'));exports[_0x26eb('0x1')]=function(_0x2e3a4d){return function(_0x28de12){return client[_0x26eb('0x2')](_0x26eb('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x26eb('0x4'),_0x26eb('0x5')],'include':[{'model':_0x26eb('0x6'),'as':_0x26eb('0x7'),'attributes':['id',_0x26eb('0x8'),_0x26eb('0x9'),_0x26eb('0xa')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x26eb('0x8'),'operator',_0x26eb('0xa')]},{'model':_0x26eb('0xb'),'as':_0x26eb('0xc'),'attributes':['id',_0x26eb('0xd'),_0x26eb('0xe'),_0x26eb('0xf'),_0x26eb('0x10'),_0x26eb('0x11'),_0x26eb('0x12'),_0x26eb('0x13'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x3347=['Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data5','data6'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3347,0x154));var _0x7334=function(_0x2d1676,_0x41468d){_0x2d1676=_0x2d1676-0x0;var _0x2e0243=_0x3347[_0x2d1676];return _0x2e0243;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x5e8bc5){return function(_0x45db3c){return client[_0x7334('0x0')](_0x7334('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x7334('0x2'),_0x7334('0x3')],'include':[{'model':_0x7334('0x4'),'as':_0x7334('0x5'),'attributes':['id',_0x7334('0x6'),_0x7334('0x7'),_0x7334('0x8')]},{'model':_0x7334('0x4'),'as':_0x7334('0x9'),'attributes':['id',_0x7334('0x6'),_0x7334('0x7'),_0x7334('0x8')]},{'model':_0x7334('0xa'),'as':_0x7334('0xb'),'attributes':['id',_0x7334('0xc'),_0x7334('0xd'),_0x7334('0xe'),'data3','data4',_0x7334('0xf'),_0x7334('0x10'),'data7']}]},'log':_0x7334('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c4ceb2c..9a25e69 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 _0xd943=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x27895b,_0x2eb832){var _0x532ecf=function(_0x52090d){while(--_0x52090d){_0x27895b['push'](_0x27895b['shift']());}};_0x532ecf(++_0x2eb832);}(_0xd943,0x14a));var _0x3d94=function(_0x128fab,_0x2c0641){_0x128fab=_0x128fab-0x0;var _0x182a44=_0xd943[_0x128fab];return _0x182a44;};'use strict';var client=require(_0x3d94('0x0'));exports[_0x3d94('0x1')]=function(_0x206cef){return function(_0x296678){return client[_0x3d94('0x2')](_0x3d94('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3d94('0x4'),_0x3d94('0x5'),_0x3d94('0x6')]},'log':_0x3d94('0x3')});};}; \ No newline at end of file +var _0xa947=['../client','getTrunks','Request','GetTrunk','name'];(function(_0x537d93,_0x2052ee){var _0x40e38c=function(_0x51b219){while(--_0x51b219){_0x537d93['push'](_0x537d93['shift']());}};_0x40e38c(++_0x2052ee);}(_0xa947,0x11d));var _0x7a94=function(_0x2d3448,_0x5a5e9e){_0x2d3448=_0x2d3448-0x0;var _0x538cfa=_0xa947[_0x2d3448];return _0x538cfa;};'use strict';var client=require(_0x7a94('0x0'));exports[_0x7a94('0x1')]=function(_0x2ee103){return function(_0x161c31){return client[_0x7a94('0x2')](_0x7a94('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7a94('0x4'),'registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 6c84aa6..e5f156e 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0xa8e6dd,_0x45b518){var _0x1f353e=function(_0xf989f1){while(--_0xf989f1){_0xa8e6dd['push'](_0xa8e6dd['shift']());}};_0x1f353e(++_0x45b518);}(_0xedd9,0xfc));var _0x9edd=function(_0x281958,_0x15b761){_0x281958=_0x281958-0x0;var _0x31dab8=_0xedd9[_0x281958];return _0x31dab8;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9e03fdf..9377b84 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 _0x6738=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0xbb54da,_0x179f48){var _0x47d1ef=function(_0x212317){while(--_0x212317){_0xbb54da['push'](_0xbb54da['shift']());}};_0x47d1ef(++_0x179f48);}(_0x6738,0x73));var _0x8673=function(_0x1ee71b,_0x41e9d0){_0x1ee71b=_0x1ee71b-0x0;var _0x58f673=_0x6738[_0x1ee71b];return _0x58f673;};'use strict';var client=require(_0x8673('0x0'));exports[_0x8673('0x1')]=function(_0x1ab9c2){return client[_0x8673('0x2')](_0x8673('0x3'),{'body':_0x1ab9c2,'log':'CreateVoiceAgentReport'});};exports[_0x8673('0x4')]=function(_0x311802,_0x551592,_0xf420d3){return client[_0x8673('0x2')](_0x8673('0x5'),{'body':_0x311802,'options':{'where':{'uniqueid':_0x551592,'interface':_0xf420d3,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x3ed8=['create','Request','CreateVoiceAgentReport','update','../client'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3ed8,0x9a));var _0x83ed=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x3ed8[_0x4c445a];return _0x2f611c;};'use strict';var client=require(_0x83ed('0x0'));exports[_0x83ed('0x1')]=function(_0x513435){return client[_0x83ed('0x2')](_0x83ed('0x3'),{'body':_0x513435,'log':'CreateVoiceAgentReport'});};exports[_0x83ed('0x4')]=function(_0x3cfb28,_0x2d40ed,_0x3778c1){return client[_0x83ed('0x2')]('UpdateVoiceAgentReport',{'body':_0x3cfb28,'options':{'where':{'uniqueid':_0x2d40ed,'interface':_0x3778c1,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6939ec3..2867657 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 _0x64a3=['format','YYYY-MM-DD\x20HH:mm:ss','day','disposition','duration','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','startOf'];(function(_0x33b486,_0x588e13){var _0x52cd6c=function(_0x7faf2f){while(--_0x7faf2f){_0x33b486['push'](_0x33b486['shift']());}};_0x52cd6c(++_0x588e13);}(_0x64a3,0xcb));var _0x364a=function(_0x530462,_0xd5c89c){_0x530462=_0x530462-0x0;var _0x1c4a88=_0x64a3[_0x530462];return _0x1c4a88;};'use strict';var moment=require(_0x364a('0x0'));var util=require('util');var _=require(_0x364a('0x1'));var client=require(_0x364a('0x2'));exports[_0x364a('0x3')]=function(_0x1bc6ea){return client[_0x364a('0x4')](_0x364a('0x5'),{'body':_[_0x364a('0x6')](_0x1bc6ea,{'source':_0x1bc6ea[_0x364a('0x7')],'destinationcontext':_0x1bc6ea[_0x364a('0x8')],'callerid':_0x1bc6ea[_0x364a('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x364a('0x5')});};exports[_0x364a('0xa')]=function(){return function(){return client[_0x364a('0x4')](_0x364a('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x364a('0xc')]('day')[_0x364a('0xd')](_0x364a('0xe')),moment()['endOf'](_0x364a('0xf'))[_0x364a('0xd')](_0x364a('0xe'))]}},'attributes':['type',_0x364a('0x10'),_0x364a('0x11'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x91a8=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x33aa85,_0x1cb0e3){var _0x25001f=function(_0xea87){while(--_0xea87){_0x33aa85['push'](_0x33aa85['shift']());}};_0x25001f(++_0x1cb0e3);}(_0x91a8,0xf9));var _0x891a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x91a8[_0x2d7f0e];return _0x110b07;};'use strict';var moment=require(_0x891a('0x0'));var util=require(_0x891a('0x1'));var _=require(_0x891a('0x2'));var client=require('../client');exports[_0x891a('0x3')]=function(_0x25405e){return client[_0x891a('0x4')](_0x891a('0x5'),{'body':_[_0x891a('0x6')](_0x25405e,{'source':_0x25405e['calleridnum'],'destinationcontext':_0x25405e['context'],'callerid':_0x25405e[_0x891a('0x7')],'amaflags':_0x891a('0x8')}),'log':_0x891a('0x5')});};exports[_0x891a('0x9')]=function(){return function(){return client[_0x891a('0x4')](_0x891a('0xa'),{'options':{'where':{'type':[_0x891a('0xb')],'createdAt':{'$between':[moment()[_0x891a('0xc')](_0x891a('0xd'))[_0x891a('0xe')](_0x891a('0xf')),moment()[_0x891a('0x10')](_0x891a('0xd'))[_0x891a('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x891a('0x11'),'disposition',_0x891a('0x12'),'billableseconds']},'log':_0x891a('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index a81d2d7..2174770 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 _0xfe76=['../client','create','Request','CreateVoiceDialReport'];(function(_0x16e6e6,_0xd5cfc){var _0x55fc52=function(_0x570bfc){while(--_0x570bfc){_0x16e6e6['push'](_0x16e6e6['shift']());}};_0x55fc52(++_0xd5cfc);}(_0xfe76,0x1c8));var _0x6fe7=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xfe76[_0xee3051];return _0x139e81;};'use strict';var client=require(_0x6fe7('0x0'));exports[_0x6fe7('0x1')]=function(_0x342173){return client[_0x6fe7('0x2')](_0x6fe7('0x3'),{'body':_0x342173,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x9bb4=['CreateVoiceDialReport','../client'];(function(_0x28b7ab,_0x16a764){var _0x56791b=function(_0x25d20d){while(--_0x25d20d){_0x28b7ab['push'](_0x28b7ab['shift']());}};_0x56791b(++_0x16a764);}(_0x9bb4,0x81));var _0x49bb=function(_0x2a4d4a,_0x22d92a){_0x2a4d4a=_0x2a4d4a-0x0;var _0x2ebd61=_0x9bb4[_0x2a4d4a];return _0x2ebd61;};'use strict';var client=require(_0x49bb('0x0'));exports['create']=function(_0x43c880){return client['Request'](_0x49bb('0x1'),{'body':_0x43c880,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 50cbe2b..5cec204 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 _0x6e6c=['getVoiceExtensions','GetVoiceExtension','exten','../client'];(function(_0xf51182,_0x20ed75){var _0x3ead35=function(_0xecd33f){while(--_0xecd33f){_0xf51182['push'](_0xf51182['shift']());}};_0x3ead35(++_0x20ed75);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0xc6e6('0x0'));exports[_0xc6e6('0x1')]=function(){return function(){return client['Request'](_0xc6e6('0x2'),{'options':{'raw':!![],'attributes':['id',_0xc6e6('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x668b=['../client','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x4817cd,_0x2b9149){var _0x2cb486=function(_0x3ef90e){while(--_0x3ef90e){_0x4817cd['push'](_0x4817cd['shift']());}};_0x2cb486(++_0x2b9149);}(_0x668b,0x140));var _0xb668=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0x668b[_0x92713a];return _0x1893e1;};'use strict';var client=require(_0xb668('0x0'));exports[_0xb668('0x1')]=function(){return function(){return client['Request'](_0xb668('0x2'),{'options':{'raw':!![],'attributes':['id',_0xb668('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb668('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index eb6bf3c..6d10553 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 _0xe0bf=['dialRecallInQueue','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout'];(function(_0x17740e,_0xffd9ed){var _0x3cf54d=function(_0x7a5c4f){while(--_0x7a5c4f){_0x17740e['push'](_0x17740e['shift']());}};_0x3cf54d(++_0xffd9ed);}(_0xe0bf,0xc0));var _0xfe0b=function(_0x39fe3d,_0x33e35d){_0x39fe3d=_0x39fe3d-0x0;var _0x496e73=_0xe0bf[_0x39fe3d];return _0x496e73;};'use strict';var client=require('../client');exports[_0xfe0b('0x0')]=function(){return function(){return client['Request'](_0xfe0b('0x1'),{'options':{'raw':![],'attributes':['id',_0xfe0b('0x2'),_0xfe0b('0x3'),_0xfe0b('0x4'),'autopause',_0xfe0b('0x5'),'type',_0xfe0b('0x6'),_0xfe0b('0x7'),_0xfe0b('0x8'),'dialLimitQueue',_0xfe0b('0x9'),_0xfe0b('0xa'),_0xfe0b('0xb'),_0xfe0b('0xc'),_0xfe0b('0xd'),_0xfe0b('0xe'),'dialOriginateTimeout',_0xfe0b('0xf'),'dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0xfe0b('0x10'),_0xfe0b('0x11'),_0xfe0b('0x12'),'dialNoAnswerMaxRetry',_0xfe0b('0x13'),_0xfe0b('0x14'),_0xfe0b('0x15'),'dialGlobalInterval',_0xfe0b('0x16'),'dialCheckDuplicateType',_0xfe0b('0x17'),_0xfe0b('0x18'),'dialAMDGreeting',_0xfe0b('0x19'),_0xfe0b('0x1a'),_0xfe0b('0x1b'),'dialAMDBetweenWordsSilence',_0xfe0b('0x1c'),_0xfe0b('0x1d'),_0xfe0b('0x1e'),'timeout',_0xfe0b('0x1f'),_0xfe0b('0x20'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xfe0b('0x21'),'dialQueueProject2',_0xfe0b('0x5'),_0xfe0b('0x22'),_0xfe0b('0x23'),_0xfe0b('0x24'),_0xfe0b('0x25'),_0xfe0b('0x26'),_0xfe0b('0x27'),_0xfe0b('0x28'),_0xfe0b('0x29'),'dialAbandonedRetryFrequency',_0xfe0b('0x2a'),_0xfe0b('0x2b'),_0xfe0b('0x2c'),_0xfe0b('0x2d'),'mandatoryDisposition',_0xfe0b('0x2e'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe',_0xfe0b('0x2f')],'include':[{'model':_0xfe0b('0x30'),'as':_0xfe0b('0x30'),'attributes':['id','name',_0xfe0b('0x31'),_0xfe0b('0x32')]},{'model':_0xfe0b('0x33'),'as':_0xfe0b('0x34'),'attributes':['id',_0xfe0b('0x2')]},{'model':_0xfe0b('0x30'),'as':_0xfe0b('0x35'),'attributes':['id',_0xfe0b('0x2'),'callerid','active']},{'model':'Interval','as':_0xfe0b('0x36'),'attributes':['id',_0xfe0b('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xfe0b('0x2'),_0xfe0b('0x37')]}]}]},'log':_0xfe0b('0x0')});};}; \ No newline at end of file +var _0x7043=['dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','Pause','mandatoryDispositionPause','callerid','active','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel'];(function(_0x425d13,_0x3733ee){var _0x2f9112=function(_0x4bc077){while(--_0x4bc077){_0x425d13['push'](_0x425d13['shift']());}};_0x2f9112(++_0x3733ee);}(_0x7043,0x120));var _0x3704=function(_0x2cbc02,_0x2a3a6b){_0x2cbc02=_0x2cbc02-0x0;var _0x2fffa0=_0x7043[_0x2cbc02];return _0x2fffa0;};'use strict';var client=require(_0x3704('0x0'));exports[_0x3704('0x1')]=function(){return function(){return client[_0x3704('0x2')](_0x3704('0x3'),{'options':{'raw':![],'attributes':['id',_0x3704('0x4'),_0x3704('0x5'),'acwTimeout',_0x3704('0x6'),_0x3704('0x7'),_0x3704('0x8'),_0x3704('0x9'),_0x3704('0xa'),_0x3704('0xb'),_0x3704('0xc'),'dialPowerLevel','dialPredictiveOptimization',_0x3704('0xd'),_0x3704('0xe'),_0x3704('0xf'),_0x3704('0x10'),_0x3704('0x11'),'dialQueueOptions','dialQueueTimeout',_0x3704('0x12'),_0x3704('0x13'),_0x3704('0x14'),'dialBusyMaxRetry',_0x3704('0x15'),_0x3704('0x16'),_0x3704('0x17'),_0x3704('0x18'),_0x3704('0x19'),'dialGlobalInterval',_0x3704('0x1a'),'dialCheckDuplicateType',_0x3704('0x1b'),_0x3704('0x1c'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x3704('0x1d'),_0x3704('0x1e'),'dialAMDBetweenWordsSilence',_0x3704('0x1f'),'dialAMDSilenceThreshold',_0x3704('0x20'),_0x3704('0x21'),_0x3704('0x22'),_0x3704('0x23'),_0x3704('0x24'),_0x3704('0x25'),'dialAgiAfterHangupClient',_0x3704('0x26'),_0x3704('0x7'),'strategy',_0x3704('0x27'),_0x3704('0x28'),_0x3704('0x29'),'dialNoSuchNumberRetryFrequency',_0x3704('0x2a'),'dialDropRetryFrequency',_0x3704('0x2b'),_0x3704('0x2c'),_0x3704('0x2d'),_0x3704('0x2e'),_0x3704('0x2f'),_0x3704('0x30'),_0x3704('0x31'),_0x3704('0x32'),_0x3704('0x33'),_0x3704('0x34'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x3704('0x35'),'as':'Trunk','attributes':['id','name','callerid','active']},{'model':_0x3704('0x36'),'as':_0x3704('0x37'),'attributes':['id',_0x3704('0x4')]},{'model':_0x3704('0x35'),'as':'TrunkBackup','attributes':['id',_0x3704('0x4'),_0x3704('0x38'),_0x3704('0x39')]},{'model':_0x3704('0x3a'),'as':_0x3704('0x3a'),'attributes':['id','name'],'include':[{'model':_0x3704('0x3a'),'as':'Intervals','attributes':['id','name',_0x3704('0x3b')]}]}]},'log':_0x3704('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d891f00..6aa5d05 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(_0x1c18ef,_0x431c42){var _0x217cd6=function(_0x49ce55){while(--_0x49ce55){_0x1c18ef['push'](_0x1c18ef['shift']());}};_0x217cd6(++_0x431c42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x2ab4bd,_0x305c1b){var _0x234c49=function(_0x38c9d0){while(--_0x38c9d0){_0x2ab4bd['push'](_0x2ab4bd['shift']());}};_0x234c49(++_0x305c1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 d105a5c..61909f8 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 _0xd59a=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xd59a,0x127));var _0xad59=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd59a[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0xad59('0x0'));exports[_0xad59('0x1')]=function(_0xbd64b7){return function(){return client[_0xad59('0x2')](_0xad59('0x3'),{'options':{'where':{'VoiceQueueId':_0xbd64b7,'paused':!![]},'raw':!![]},'log':_0xad59('0x1')});};}; \ No newline at end of file +var _0x5b6a=['getVoiceQueueRtPauses','Request'];(function(_0x49ec54,_0x356288){var _0x1c58f3=function(_0x44ae12){while(--_0x44ae12){_0x49ec54['push'](_0x49ec54['shift']());}};_0x1c58f3(++_0x356288);}(_0x5b6a,0xd1));var _0xa5b6=function(_0x7bba38,_0x2c37b0){_0x7bba38=_0x7bba38-0x0;var _0x3559b1=_0x5b6a[_0x7bba38];return _0x3559b1;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x12e4e1){return function(){return client[_0xa5b6('0x0')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x12e4e1,'paused':!![]},'raw':!![]},'log':_0xa5b6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 58662b6..061f705 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(_0x729f2,_0x51b2e4){var _0x589a3=function(_0x40b351){while(--_0x40b351){_0x729f2['push'](_0x729f2['shift']());}};_0x589a3(++_0x51b2e4);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x56bf4a,_0x443dce){var _0x5b582a=function(_0x5af997){while(--_0x5af997){_0x56bf4a['push'](_0x56bf4a['shift']());}};_0x5b582a(++_0x443dce);}(_0x7a54,0x106));var _0x47a5=function(_0x376fe3,_0x20535e){_0x376fe3=_0x376fe3-0x0;var _0x83936f=_0x7a54[_0x376fe3];return _0x83936f;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index a601476..b4782a8 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 _0xe062=['CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','transfers','blindTransfer','Request'];(function(_0x14eb24,_0x6adbbb){var _0x122c4a=function(_0x55470a){while(--_0x55470a){_0x14eb24['push'](_0x14eb24['shift']());}};_0x122c4a(++_0x6adbbb);}(_0xe062,0xa6));var _0x2e06=function(_0x17aa6e,_0x5c5495){_0x17aa6e=_0x17aa6e-0x0;var _0x297ef2=_0xe062[_0x17aa6e];return _0x297ef2;};'use strict';var client=require(_0x2e06('0x0'));exports[_0x2e06('0x1')]={};exports[_0x2e06('0x2')]=function(_0x31a79a){return client[_0x2e06('0x3')](_0x2e06('0x4'),{'body':{'result':_0x31a79a[_0x2e06('0x5')],'transfererchannel':_0x31a79a[_0x2e06('0x6')],'transferercalleridnum':_0x31a79a['transferercalleridnum'],'transferercalleridname':_0x31a79a[_0x2e06('0x7')],'transfererconnectedlinenum':_0x31a79a['transfererconnectedlinenum'],'transfererconnectedlinename':_0x31a79a['transfererconnectedlinename'],'transfereraccountcode':_0x31a79a['transfereraccountcode'],'transferercontext':_0x31a79a['transferercontext'],'transfererexten':_0x31a79a[_0x2e06('0x8')],'transfererlinkedid':_0x31a79a[_0x2e06('0x9')],'transfereechannel':_0x31a79a[_0x2e06('0xa')],'transfereecalleridnum':_0x31a79a['transfereecalleridnum'],'transfereecalleridname':_0x31a79a[_0x2e06('0xb')],'transfereeconnectedlinenum':_0x31a79a[_0x2e06('0xc')],'transfereeconnectedlinename':_0x31a79a[_0x2e06('0xd')],'transfereeaccountcode':_0x31a79a['transfereeaccountcode'],'transfereecontext':_0x31a79a['transfereecontext'],'transfereeexten':_0x31a79a[_0x2e06('0xe')],'transfereelinkedid':_0x31a79a[_0x2e06('0xf')],'isexternal':_0x31a79a['isexternal'],'context':_0x31a79a[_0x2e06('0x10')],'extension':_0x31a79a[_0x2e06('0x11')],'type':_0x2e06('0x12')},'log':_0x2e06('0x4')});};exports[_0x2e06('0x13')]=function(_0xafbad7){return client[_0x2e06('0x3')](_0x2e06('0x4'),{'body':{'result':_0xafbad7['result'],'transfererchannel':_0xafbad7[_0x2e06('0x14')],'transferercalleridnum':_0xafbad7[_0x2e06('0x15')],'transferercalleridname':_0xafbad7[_0x2e06('0x16')],'transfererconnectedlinenum':_0xafbad7['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xafbad7['secondtransfererconnectedlinename'],'transfereraccountcode':_0xafbad7[_0x2e06('0x17')],'transferercontext':_0xafbad7[_0x2e06('0x18')],'transfererexten':_0xafbad7[_0x2e06('0x19')],'transfererlinkedid':_0xafbad7['origtransfererlinkedid'],'transfereechannel':_0xafbad7['transfertargetchannel'],'transfereecalleridnum':_0xafbad7[_0x2e06('0x1a')],'transfereecalleridname':_0xafbad7[_0x2e06('0x1b')],'transfereeconnectedlinenum':_0xafbad7[_0x2e06('0x1c')],'transfereeconnectedlinename':_0xafbad7['transfertargetconnectedlinename'],'transfereeaccountcode':_0xafbad7[_0x2e06('0x1d')],'transfereecontext':_0xafbad7[_0x2e06('0x1e')],'transfereeexten':_0xafbad7[_0x2e06('0x1f')],'transfereelinkedid':_0xafbad7['transfertargetlinkedid'],'isexternal':_0xafbad7['isexternal'],'context':_0xafbad7[_0x2e06('0x20')],'extension':_0xafbad7['origtransfererexten'],'type':_0x2e06('0x21')},'log':_0x2e06('0x4')});}; \ No newline at end of file +var _0xe5e8=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transferercontext','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext'];(function(_0x5eebac,_0x31a380){var _0x1418ff=function(_0x1dc5cf){while(--_0x1dc5cf){_0x5eebac['push'](_0x5eebac['shift']());}};_0x1418ff(++_0x31a380);}(_0xe5e8,0x173));var _0x8e5e=function(_0x84b217,_0x5c72dd){_0x84b217=_0x84b217-0x0;var _0x20235c=_0xe5e8[_0x84b217];return _0x20235c;};'use strict';var client=require(_0x8e5e('0x0'));exports[_0x8e5e('0x1')]={};exports[_0x8e5e('0x2')]=function(_0x370cdc){return client[_0x8e5e('0x3')](_0x8e5e('0x4'),{'body':{'result':_0x370cdc[_0x8e5e('0x5')],'transfererchannel':_0x370cdc['transfererchannel'],'transferercalleridnum':_0x370cdc[_0x8e5e('0x6')],'transferercalleridname':_0x370cdc[_0x8e5e('0x7')],'transfererconnectedlinenum':_0x370cdc['transfererconnectedlinenum'],'transfererconnectedlinename':_0x370cdc['transfererconnectedlinename'],'transfereraccountcode':_0x370cdc['transfereraccountcode'],'transferercontext':_0x370cdc[_0x8e5e('0x8')],'transfererexten':_0x370cdc['transfererexten'],'transfererlinkedid':_0x370cdc['transfererlinkedid'],'transfereechannel':_0x370cdc['transfereechannel'],'transfereecalleridnum':_0x370cdc[_0x8e5e('0x9')],'transfereecalleridname':_0x370cdc[_0x8e5e('0xa')],'transfereeconnectedlinenum':_0x370cdc[_0x8e5e('0xb')],'transfereeconnectedlinename':_0x370cdc[_0x8e5e('0xc')],'transfereeaccountcode':_0x370cdc[_0x8e5e('0xd')],'transfereecontext':_0x370cdc['transfereecontext'],'transfereeexten':_0x370cdc[_0x8e5e('0xe')],'transfereelinkedid':_0x370cdc[_0x8e5e('0xf')],'isexternal':_0x370cdc[_0x8e5e('0x10')],'context':_0x370cdc[_0x8e5e('0x11')],'extension':_0x370cdc[_0x8e5e('0x12')],'type':_0x8e5e('0x13')},'log':_0x8e5e('0x4')});};exports['attendedTransfer']=function(_0x587699){return client[_0x8e5e('0x3')](_0x8e5e('0x4'),{'body':{'result':_0x587699['result'],'transfererchannel':_0x587699[_0x8e5e('0x14')],'transferercalleridnum':_0x587699['origtransferercalleridnum'],'transferercalleridname':_0x587699[_0x8e5e('0x15')],'transfererconnectedlinenum':_0x587699[_0x8e5e('0x16')],'transfererconnectedlinename':_0x587699['secondtransfererconnectedlinename'],'transfereraccountcode':_0x587699[_0x8e5e('0x17')],'transferercontext':_0x587699[_0x8e5e('0x18')],'transfererexten':_0x587699['secondtransfererexten'],'transfererlinkedid':_0x587699['origtransfererlinkedid'],'transfereechannel':_0x587699['transfertargetchannel'],'transfereecalleridnum':_0x587699['transfertargetcalleridnum'],'transfereecalleridname':_0x587699['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x587699[_0x8e5e('0x19')],'transfereeconnectedlinename':_0x587699[_0x8e5e('0x1a')],'transfereeaccountcode':_0x587699[_0x8e5e('0x1b')],'transfereecontext':_0x587699[_0x8e5e('0x1c')],'transfereeexten':_0x587699['transfertargetexten'],'transfereelinkedid':_0x587699[_0x8e5e('0x1d')],'isexternal':_0x587699[_0x8e5e('0x10')],'context':_0x587699[_0x8e5e('0x1e')],'extension':_0x587699[_0x8e5e('0x1f')],'type':_0x8e5e('0x20')},'log':_0x8e5e('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b376e02..d11425e 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 _0xee3c=['originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','wav','MixMonitor','ai(mixmonitorid)','toLowerCase','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','monitors','stop','%s.%s','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','context','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','join','keys','action','Reload','then','message','catch','error','isConnected','username','ami\x20disconnected','pick','command','Command','Action','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumBillable','sumDuration','talking','unmanaged','waiting','loggedInDb','type','outbound','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','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls'];(function(_0x8454d9,_0x423929){var _0x5df708=function(_0x1894cc){while(--_0x1894cc){_0x8454d9['push'](_0x8454d9['shift']());}};_0x5df708(++_0x423929);}(_0xee3c,0x14a));var _0xcee3=function(_0x661470,_0x491a5c){_0x661470=_0x661470-0x0;var _0x2477a0=_0xee3c[_0x661470];return _0x2477a0;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var jayson=require(_0xcee3('0x2'));var schema=require(_0xcee3('0x3'));var BPromise=require(_0xcee3('0x4'));var moment=require(_0xcee3('0x5'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xcee3('0x6'));exports[_0xcee3('0x7')]=function(_0x39d2a8,_0x2c3409,_0x9350f3){return new BPromise(function(_0x44e46f,_0x3b8ffe){var _0x97f00e={'QueuePause':function(_0x22953c){return new Promise(function(_0x364eb2,_0x4770ed){var _0x2d13c3=util[_0xcee3('0x8')](_0xcee3('0x9'),_0xcee3('0xa'),_0x22953c['name']);if(_0x39d2a8[_0xcee3('0xb')]&&_0x39d2a8[_0xcee3('0xb')][_0x2d13c3]&&_0x39d2a8[_0xcee3('0xb')][_0x2d13c3][_0xcee3('0xc')]){_0x39d2a8[_0xcee3('0xb')][_0x2d13c3][_0xcee3('0xd')]();}if(_0x39d2a8['agents'][_0x2d13c3]){_0x39d2a8[_0xcee3('0xe')][_0x2d13c3][_0xcee3('0xf')]({'statePause':_0x22953c[_0xcee3('0x10')]?!![]:![]});}_0x364eb2({'code':0xc8,'message':_0xcee3('0x11')});});},'Reload':function(_0xc4f4f2){var _0x520ac6=this;return new Promise(function(_0x34e3b2,_0x573561){if(ami['isConnected']()==![]){return _0x573561(_0x520ac6['error'](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')]['username'],'ami\x20disconnected'][_0xcee3('0x13')]('\x20')));}_0xc4f4f2=_['pick'](_0xc4f4f2,_[_0xcee3('0x14')](properties['module']));_0xc4f4f2[_0xcee3('0x15')]=_0xcee3('0x16');return ami['Action'](_0xc4f4f2)[_0xcee3('0x17')](function(_0x3fe37f){_0x34e3b2({'code':0xc8,'message':_0x3fe37f[_0xcee3('0x18')]});})[_0xcee3('0x19')](function(_0x50bf6e){_0x573561(_0x520ac6[_0xcee3('0x1a')](0x1f5,_0x50bf6e[_0xcee3('0x18')]));});});},'Command':function(_0x135bb0){var _0x11bf37=this;return new Promise(function(_0x52f4d7,_0x254de7){if(ami[_0xcee3('0x1b')]()==![]){return _0x254de7(_0x11bf37[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')][_0xcee3('0x1c')],_0xcee3('0x1d')][_0xcee3('0x13')]('\x20')));}_0x135bb0=_[_0xcee3('0x1e')](_0x135bb0,_0xcee3('0x1f'));_0x135bb0[_0xcee3('0x15')]=_0xcee3('0x20');return ami[_0xcee3('0x21')](_0x135bb0)['then'](function(_0x1fee89){_0x52f4d7({'code':0xc8,'message':_0x1fee89[_0xcee3('0x22')]});})[_0xcee3('0x19')](function(_0x1ee247){_0x254de7(_0x11bf37[_0xcee3('0x1a')](0x1f5,_0x1ee247['message']));});});},'VoiceQueues':function(_0x5dae8f){return new Promise(function(_0x42f4d1,_0x5b92ba){var _0x544509=[];for(var _0x228ff6 in _0x39d2a8['voiceQueues']){if(_0x39d2a8[_0xcee3('0x23')][_0xcee3('0x24')](_0x228ff6)){var _0x19a15e=_0x39d2a8['voiceQueues'][_0x228ff6];var _0x46f37e={'id':_0x19a15e['id'],'name':_0x19a15e['name'],'strategy':_0x19a15e[_0xcee3('0x25')],'answered':_0x19a15e['answered'],'available':_0x19a15e[_0xcee3('0x26')],'loggedIn':_0x19a15e[_0xcee3('0x27')],'pTalking':_0x19a15e['pTalking'],'sumBillable':_0x19a15e[_0xcee3('0x28')],'sumDuration':_0x19a15e[_0xcee3('0x29')],'sumHoldTime':_0x19a15e['sumHoldTime']||0x0,'talking':_0x19a15e[_0xcee3('0x2a')],'total':_0x19a15e['total'],'type':_0x19a15e['type'],'unmanaged':_0x19a15e[_0xcee3('0x2b')],'abandoned':_0x19a15e['abandoned'],'waiting':_0x19a15e[_0xcee3('0x2c')],'loggedInDb':_0x19a15e[_0xcee3('0x2d')]};if(_0x19a15e[_0xcee3('0x2e')]===_0xcee3('0x2f')){_0x46f37e[_0xcee3('0x30')]=_0x19a15e[_0xcee3('0x30')];_0x46f37e[_0xcee3('0x31')]=_0x19a15e['dialMethod'];_0x46f37e[_0xcee3('0x32')]=_0x19a15e['dialOriginateCallerIdName'];_0x46f37e[_0xcee3('0x33')]=_0x19a15e[_0xcee3('0x33')];_0x46f37e[_0xcee3('0x34')]=_0x19a15e[_0xcee3('0x34')];_0x46f37e[_0xcee3('0x35')]=_0x19a15e[_0xcee3('0x35')];_0x46f37e[_0xcee3('0x36')]=_0x19a15e[_0xcee3('0x36')];_0x46f37e['outboundAnswerAgiCallsDay']=_0x19a15e[_0xcee3('0x37')];_0x46f37e[_0xcee3('0x38')]=_0x19a15e[_0xcee3('0x38')];_0x46f37e['outboundBlacklistCallsDay']=_0x19a15e[_0xcee3('0x39')];_0x46f37e[_0xcee3('0x3a')]=_0x19a15e['outboundBusyCallsDay'];_0x46f37e[_0xcee3('0x3b')]=_0x19a15e['outboundCongestionCallsDay'];_0x46f37e[_0xcee3('0x3c')]=_0x19a15e['outboundDropCallsDayACS'];_0x46f37e['outboundDropCallsDayCallersExit']=_0x19a15e[_0xcee3('0x3d')];_0x46f37e['outboundDropCallsDayTimeout']=_0x19a15e[_0xcee3('0x3e')];_0x46f37e[_0xcee3('0x3f')]=_0x19a15e[_0xcee3('0x3f')];_0x46f37e[_0xcee3('0x40')]=_0x19a15e['outboundNoSuchCallsDay'];_0x46f37e['outboundOriginateFailureCallsDay']=_0x19a15e[_0xcee3('0x41')];_0x46f37e[_0xcee3('0x42')]=_0x19a15e['outboundReCallsDay'];_0x46f37e[_0xcee3('0x43')]=_0x19a15e[_0xcee3('0x43')];_0x46f37e['outboundUnknownCallsDay']=_0x19a15e[_0xcee3('0x44')];_0x46f37e[_0xcee3('0x45')]=_0x19a15e[_0xcee3('0x45')];_0x46f37e[_0xcee3('0x46')]=_0x19a15e[_0xcee3('0x46')];_0x46f37e[_0xcee3('0x47')]=_0x19a15e['predictiveIntervalAvgTalktime'];_0x46f37e[_0xcee3('0x48')]=_0x19a15e[_0xcee3('0x48')];_0x46f37e[_0xcee3('0x49')]=_0x19a15e[_0xcee3('0x49')];_0x46f37e[_0xcee3('0x4a')]=_0x19a15e[_0xcee3('0x4a')];_0x46f37e[_0xcee3('0x4b')]=_0x19a15e['predictiveIntervalErlangCallsDroppedCalls'];_0x46f37e[_0xcee3('0x4c')]=_0x19a15e[_0xcee3('0x4c')];_0x46f37e[_0xcee3('0x4d')]=_0x19a15e['predictiveIntervalMultiplicativeFactor'];_0x46f37e[_0xcee3('0x4e')]=_0x19a15e[_0xcee3('0x4e')];_0x46f37e['predictiveIntervalAvailable']=_0x19a15e[_0xcee3('0x4f')];_0x46f37e[_0xcee3('0x50')]=_0x19a15e[_0xcee3('0x50')];_0x46f37e['message']=_0x19a15e[_0xcee3('0x18')];_0x46f37e[_0xcee3('0x51')]=_0x19a15e[_0xcee3('0x51')];_0x46f37e[_0xcee3('0x52')]=_0x19a15e[_0xcee3('0x52')];_0x46f37e['erlangCallToSecond']=_0x19a15e['erlangCallToSecond'];_0x46f37e[_0xcee3('0x53')]=_0x19a15e[_0xcee3('0x53')];_0x46f37e[_0xcee3('0x54')]=_0x19a15e[_0xcee3('0x54')];_0x46f37e[_0xcee3('0x55')]=_0x19a15e[_0xcee3('0x55')];_0x46f37e[_0xcee3('0x56')]=_0x19a15e[_0xcee3('0x56')];}if(_0x19a15e['Trunk']){_0x46f37e[_0xcee3('0x57')]={'id':_0x19a15e[_0xcee3('0x57')]['id'],'name':_0x19a15e[_0xcee3('0x57')][_0xcee3('0x58')],'active':_0x19a15e[_0xcee3('0x57')][_0xcee3('0x59')],'callerid':_0x19a15e[_0xcee3('0x57')]['callerid']};}if(_0x19a15e[_0xcee3('0x5a')]){_0x46f37e['Interval']={'id':_0x19a15e[_0xcee3('0x5a')]['id'],'name':_0x19a15e[_0xcee3('0x5a')]['name']};}_0x544509[_0xcee3('0x5b')](_0x46f37e);}}_0x42f4d1({'count':_0x544509[_0xcee3('0x5c')],'rows':_0x544509});});},'UpdateVoiceQueue':function(_0x206c46){return new Promise(function(_0x16edab,_0x12d32e){var _0x14e0ca=_[_0xcee3('0x5d')](_0x39d2a8[_0xcee3('0x23')],{'id':parseInt(_0x206c46['id'])});var _0x92712c=_[_0xcee3('0x5e')](_0x206c46,['id']);if(_0x14e0ca){for(var _0x5afc13 in _0x92712c){if(typeof _0x92712c[_0x5afc13]!==_0xcee3('0x5f')&&typeof _0x14e0ca[_0x5afc13]!==_0xcee3('0x5f')){_0x14e0ca[_0x5afc13]=_0x92712c[_0x5afc13];}}_0x16edab(_0x14e0ca);}else{_0x12d32e();}});},'VoiceChannels':function(_0x5df9a8){return new Promise(function(_0x3f0b1e,_0x1b8077){var _0x31393e=_[_0xcee3('0x60')](_0x39d2a8[_0xcee3('0x61')]);_0x3f0b1e({'count':_0x31393e[_0xcee3('0x5c')],'rows':_0x31393e});});},'VoiceChannelMixMonitor':function(_0x1c8bb2){var _0x5aae9a=this;return new Promise(function(_0xefda1d,_0x1a2ebc){if(ami[_0xcee3('0x1b')]()==![]){return _0x1a2ebc(_0x5aae9a[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')]['username'],_0xcee3('0x1d')]['join']('\x20')));}var _0xc0d104=schema(properties[_0xcee3('0x62')])[_0xcee3('0x3')](_0x1c8bb2);if(_0xc0d104['length']>0x0){return _0x1a2ebc(_0x5aae9a['error'](0x1f4,_[_0xcee3('0x63')](_0xc0d104,_0xcee3('0x18'))['join'](',\x20')));}var _0x210cdf=_['find'](_0x39d2a8[_0xcee3('0x61')],{'uniqueid':_0x1c8bb2[_0xcee3('0x64')]});if(_0x210cdf&&_0x210cdf[_0xcee3('0x65')]){var _0x189dbd=util['format']('%s.%s',_0x1c8bb2['filename']||_0x1c8bb2[_0xcee3('0x64')],_0x1c8bb2[_0xcee3('0x8')]||_0xcee3('0x66'));return ami['Action']({'action':_0xcee3('0x67'),'channel':_0x210cdf[_0xcee3('0x65')],'file':_0x189dbd,'options':_0xcee3('0x68')})[_0xcee3('0x17')](function(_0x183aee){var _0x33fdce=_[_0xcee3('0x5d')](_0x210cdf['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x189dbd[_0xcee3('0x69')]()});if(_['isNil'](_0x33fdce)){_0x210cdf['monitors']['push']({'filename':_0xcee3('0x6a')+_0x189dbd[_0xcee3('0x69')](),'createdAt':moment()[_0xcee3('0x8')](_0xcee3('0x6b')),'mixmonitorid':_0x183aee[_0xcee3('0x6c')],'status':'rec'});}else{_0x33fdce[_0xcee3('0x6c')]=_0x183aee[_0xcee3('0x6c')];_0x33fdce[_0xcee3('0x6d')]=_0xcee3('0x6e');}_0xefda1d({'code':0xc8,'message':[_0x1c8bb2[_0xcee3('0x64')],_0xcee3('0x6f'),_0x183aee[_0xcee3('0x6c')]][_0xcee3('0x13')]('\x20'),'mixmonitorid':_0x183aee[_0xcee3('0x6c')]});})['catch'](function(_0x2ed9ec){_0x1a2ebc(_0x5aae9a[_0xcee3('0x1a')](0x1f5,[_0x1c8bb2[_0xcee3('0x64')],_0x2ed9ec['message'][_0xcee3('0x69')]()]['join']('\x20')));});}else{return _0x1a2ebc(_0x5aae9a['error'](0x1f5,_0xcee3('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x31e6c2){var _0x468ed5=this;return new Promise(function(_0x14d12e,_0x506455){if(ami[_0xcee3('0x1b')]()==![]){return _0x506455(_0x468ed5[_0xcee3('0x1a')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xcee3('0x1c')],_0xcee3('0x1d')][_0xcee3('0x13')]('\x20')));}var _0x2ab773=schema(properties[_0xcee3('0x62')])[_0xcee3('0x3')](_0x31e6c2);if(_0x2ab773[_0xcee3('0x5c')]>0x0){return _0x506455(_0x468ed5['error'](0x1f4,_[_0xcee3('0x63')](_0x2ab773,_0xcee3('0x18'))['join'](',\x20')));}var _0x4a674d=_['find'](_0x39d2a8[_0xcee3('0x61')],{'uniqueid':_0x31e6c2[_0xcee3('0x64')]});if(_0x4a674d){return BPromise['resolve']()['then'](function(){if(_0x4a674d[_0xcee3('0x65')]){return ami['Action']({'action':_0xcee3('0x71'),'channel':_0x4a674d[_0xcee3('0x65')],'mixmonitorid':_0x31e6c2[_0xcee3('0x6c')]})['catch'](function(_0x1db43d){});}})[_0xcee3('0x17')](function(){if(_0x4a674d[_0xcee3('0x72')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4a674d[_0xcee3('0x72')],'mixmonitorid':_0x31e6c2[_0xcee3('0x6c')]})['catch'](function(_0x4eda0f){});}})[_0xcee3('0x17')](function(_0x3ce8ad){var _0x1d0ae9=_[_0xcee3('0x5d')](_0x4a674d[_0xcee3('0x73')],{'mixmonitorid':_0x31e6c2['mixmonitorid']});if(_0x1d0ae9){_0x1d0ae9[_0xcee3('0x6d')]=_0xcee3('0x74');}})['then'](function(){var _0x384ae8=util[_0xcee3('0x8')](_0xcee3('0x75'),_0x31e6c2['filename']||_0x31e6c2[_0xcee3('0x64')],_0x31e6c2[_0xcee3('0x8')]||'wav');var _0x52dd87=_[_0xcee3('0x5d')](_0x4a674d[_0xcee3('0x73')],{'filename':_0xcee3('0x6a')+_0x384ae8[_0xcee3('0x69')]()});if(_0x52dd87){_0x52dd87[_0xcee3('0x6d')]=_0xcee3('0x74');}})[_0xcee3('0x17')](function(){_0x14d12e({'code':0xc8,'message':[_0x31e6c2[_0xcee3('0x64')],_0xcee3('0x76')][_0xcee3('0x13')]('\x20')});})['catch'](function(_0x85a8c6){_0x506455(_0x468ed5[_0xcee3('0x1a')](0x1f5,[_0x31e6c2[_0xcee3('0x64')],_0x85a8c6[_0xcee3('0x18')][_0xcee3('0x69')]()]['join']('\x20')));});}else{return _0x506455(_0x468ed5[_0xcee3('0x1a')](0x1f5,_0xcee3('0x70')));}});},'VoiceQueuesChannels':function(_0xa0102e){return new Promise(function(_0x5ecaf5,_0x40be5d){var _0x2a012d=_['values'](_0x39d2a8['queueChannels']);_0x5ecaf5({'count':_0x2a012d[_0xcee3('0x5c')],'rows':_0x2a012d});});},'VoiceQueuesChannel':function(_0x1d4245){var _0x2bb979=this;return new Promise(function(_0x5b3b07,_0x2b0050){var _0xb084d3=schema(properties[_0xcee3('0x77')])['validate'](_0x1d4245);if(_0xb084d3['length']>0x0){return _0x2b0050(_0x2bb979[_0xcee3('0x1a')](0x1f4,_['map'](_0xb084d3,_0xcee3('0x18'))[_0xcee3('0x13')](',\x20')));}var _0xcc9b98=_[_0xcee3('0x5d')](_0x39d2a8[_0xcee3('0x78')],{'uniqueid':_0x1d4245[_0xcee3('0x64')]});if(_0xcc9b98){_0x5b3b07(_0xcc9b98);}else{return _0x2b0050(_0x2bb979['error'](0x1f5,_0xcee3('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x584b04){var _0x3945a2=this;return new Promise(function(_0x31d6fb,_0x4b58f9){if(ami[_0xcee3('0x1b')]()==![]){return _0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')][_0xcee3('0x1c')],'ami\x20disconnected'][_0xcee3('0x13')]('\x20')));}var _0x1f6238=schema(properties[_0xcee3('0x79')])['validate'](_0x584b04);if(_0x1f6238['length']>0x0){return _0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f4,_[_0xcee3('0x63')](_0x1f6238,_0xcee3('0x18'))[_0xcee3('0x13')](',\x20')));}var _0xfb99fd=_['find'](_0x39d2a8[_0xcee3('0x78')],{'uniqueid':_0x584b04['uniqueid']});if(_0xfb99fd&&_0xfb99fd['channel']){return ami['Action']({'action':_0xcee3('0x7a'),'channel':_0xfb99fd[_0xcee3('0x65')]})[_0xcee3('0x17')](function(_0x4c0c69){_0x31d6fb({'code':0xc8,'message':[_0x584b04[_0xcee3('0x64')],_0x4c0c69[_0xcee3('0x18')][_0xcee3('0x69')]()][_0xcee3('0x13')]('\x20')});})[_0xcee3('0x19')](function(_0x281369){_0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f5,[_0x584b04[_0xcee3('0x64')],_0x281369[_0xcee3('0x18')]['toLowerCase']()][_0xcee3('0x13')]('\x20')));});}else{return _0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x6d6431){var _0xc71255=this;return new Promise(function(_0x2ba860,_0x37c64a){if(ami[_0xcee3('0x1b')]()==![]){return _0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')][_0xcee3('0x1c')],_0xcee3('0x1d')][_0xcee3('0x13')]('\x20')));}var _0x228f45=schema(properties['voicequeuechannelredirect'])['validate'](_0x6d6431);if(_0x228f45['length']>0x0){return _0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f4,_[_0xcee3('0x63')](_0x228f45,_0xcee3('0x18'))['join'](',\x20')));}var _0x50aa78=_['find'](_0x39d2a8[_0xcee3('0x78')],{'uniqueid':_0x6d6431['uniqueid']});if(_0x50aa78&&_0x50aa78[_0xcee3('0x65')]){return ami[_0xcee3('0x21')]({'action':'Redirect','channel':_0x50aa78[_0xcee3('0x65')],'exten':_0x6d6431['exten'],'context':_0x6d6431[_0xcee3('0x7b')]||_0x50aa78['context'],'priority':0x1})[_0xcee3('0x17')](function(_0x6469cf){_0x2ba860({'code':0xc8,'message':[_0x6d6431[_0xcee3('0x64')],_0x6469cf['message'][_0xcee3('0x69')]()][_0xcee3('0x13')]('\x20')});})['catch'](function(_0x223e2e){_0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f5,[_0x6d6431[_0xcee3('0x64')],_0x223e2e[_0xcee3('0x18')][_0xcee3('0x69')]()][_0xcee3('0x13')]('\x20')));});}else{return _0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x54bdef){return new Promise(function(_0x54f2d3,_0x40d39b){var _0x2233d5=_[_0xcee3('0x60')](_0x39d2a8['agents']);_0x54f2d3({'count':_0x2233d5[_0xcee3('0x5c')],'rows':_0x2233d5});});},'Telephones':function(_0x4b6f66){return new Promise(function(_0x3731d8,_0xe47ecf){var _0x55c878=_[_0xcee3('0x60')](_0x39d2a8['telephones']);_0x3731d8({'count':_0x55c878[_0xcee3('0x5c')],'rows':_0x55c878});});},'Trunks':function(_0xe1bb60){return new Promise(function(_0x44aa1f,_0x480ee1){var _0x242e97=_[_0xcee3('0x60')](_0x39d2a8['trunks']);_0x44aa1f({'count':_0x242e97[_0xcee3('0x5c')],'rows':_0x242e97});});},'OutboundChannels':function(_0x5645b9){return new Promise(function(_0x5d6af4,_0x423868){var _0x17de6d=_[_0xcee3('0x60')](_0x39d2a8[_0xcee3('0x7c')]);_0x5d6af4({'count':_0x17de6d['length'],'rows':_0x17de6d});});},'Outbound':function(_0x52b5e6){return new Promise(function(_0x2408c3,_0x93db38){_0x2408c3(_0x39d2a8[_0xcee3('0x2f')]);});},'Campaigns':function(_0x38895d){return new Promise(function(_0x177e0c,_0x272988){var _0x49b093=_[_0xcee3('0x60')](_0x39d2a8[_0xcee3('0x7d')]);_0x177e0c({'count':_0x49b093[_0xcee3('0x5c')],'rows':_0x49b093});});},'VoiceQueuesPreview':function(_0x26f987){var _0x22c354=this;return new Promise(function(_0x1ec1aa,_0x21143a){_0x2c3409[_0xcee3('0x7e')](_0x26f987['id'])[_0xcee3('0x17')](function(_0x823914){_0x1ec1aa({'code':0xc8,'message':_0x823914[_0xcee3('0x18')]});})[_0xcee3('0x19')](function(_0x4cf682){_0x21143a(_0x22c354[_0xcee3('0x1a')](0x1f4,_0x4cf682[_0xcee3('0x18')]));});});},'EventManager':function(_0x190f1d){var _0x3e5c73=this;return new Promise(function(_0x3bd156,_0x1fdb4b){if(!_0x190f1d[_0xcee3('0x7f')]){return _0x1fdb4b(_0x3e5c73[_0xcee3('0x1a')](0x1f4,_0xcee3('0x80')));}ami['emit'](_0xcee3('0x81')+_0x190f1d[_0xcee3('0x7f')],_0x190f1d['message']);_0x3bd156({'code':0xc8,'message':_0x190f1d});});},'FaxAccounts':function(_0x2d3602){return new Promise(function(_0x22146b,_0x72d5d){var _0x54beee=_[_0xcee3('0x60')](_0x39d2a8['faxAccounts']);_0x22146b({'count':_0x54beee[_0xcee3('0x5c')],'rows':_0x54beee});});},'SendFax':function(_0x4064d5){var _0x25c2ec=this;return new Promise(function(_0x154dad,_0x39bee6){_0x9350f3[_0xcee3('0x82')](_0x4064d5)[_0xcee3('0x17')](function(_0x56596a){_0x154dad({'code':0xc8,'message':_0x56596a[_0xcee3('0x18')]});})['catch'](function(_0x123e5c){_0x39bee6(_0x25c2ec['error'](0x1f4,_0x123e5c[_0xcee3('0x18')]));});});},'CheckAfterSend':function(_0x1fe31d){var _0x513858=this;return new Promise(function(_0x1d85e6,_0xe7e41b){_0x9350f3[_0xcee3('0x83')](_0x1fe31d)[_0xcee3('0x17')](function(_0x5509b0){_0x1d85e6({'code':0xc8,'message':_0x5509b0[_0xcee3('0x18')]});})[_0xcee3('0x19')](function(_0x412412){_0xe7e41b(_0x513858['error'](0x1f4,_0x412412['message']));});});}};var _0x2bf190=jayson['server'](_0x97f00e)[_0xcee3('0x84')]();_0x2bf190['on'](_0xcee3('0x1a'),function(_0x2de8fc){return _0x3b8ffe(_0x2de8fc);});_0x2bf190[_0xcee3('0x7')](0x232a,_0xcee3('0x85'),function(){console[_0xcee3('0x86')](_0xcee3('0x87'),0x232a);return _0x44e46f(_0xcee3('0x88')+0x232a);});});}; \ No newline at end of file +var _0xb145=['Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','trunks','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','%s/%s','SIP','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','command','Action','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','type','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','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','push','length','find','omit','values','channels','voicechannel','map','channel','format','filename','uniqueid','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','catch'];(function(_0x3fd209,_0x419432){var _0x5cbc95=function(_0x5ae0e2){while(--_0x5ae0e2){_0x3fd209['push'](_0x3fd209['shift']());}};_0x5cbc95(++_0x419432);}(_0xb145,0xa3));var _0x5b14=function(_0x1e04eb,_0x40d6c2){_0x1e04eb=_0x1e04eb-0x0;var _0x52d18d=_0xb145[_0x1e04eb];return _0x52d18d;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var jayson=require(_0x5b14('0x1'));var schema=require(_0x5b14('0x2'));var BPromise=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var config=require(_0x5b14('0x5'));var properties=require(_0x5b14('0x6'));var ami=require(_0x5b14('0x7'));exports['listen']=function(_0x1e0b5b,_0x15490e,_0x392425){return new BPromise(function(_0x4d82ad,_0x50fd91){var _0x1d12ed={'QueuePause':function(_0x2a3921){return new Promise(function(_0x34530a,_0x62cdcd){var _0x473cfe=util['format'](_0x5b14('0x8'),_0x5b14('0x9'),_0x2a3921['name']);if(_0x1e0b5b[_0x5b14('0xa')]&&_0x1e0b5b[_0x5b14('0xa')][_0x473cfe]&&_0x1e0b5b[_0x5b14('0xa')][_0x473cfe][_0x5b14('0xb')]){_0x1e0b5b[_0x5b14('0xa')][_0x473cfe]['updateAcw']();}if(_0x1e0b5b[_0x5b14('0xc')][_0x473cfe]){_0x1e0b5b['agents'][_0x473cfe][_0x5b14('0xd')]({'statePause':_0x2a3921[_0x5b14('0xe')]?!![]:![]});}_0x34530a({'code':0xc8,'message':_0x5b14('0xf')});});},'Reload':function(_0x1cb56b){var _0x18b267=this;return new Promise(function(_0x40577a,_0x52ffa9){if(ami[_0x5b14('0x10')]()==![]){return _0x52ffa9(_0x18b267[_0x5b14('0x11')](0x1f4,[config[_0x5b14('0x12')]['ip'],config[_0x5b14('0x12')][_0x5b14('0x13')],_0x5b14('0x14')][_0x5b14('0x15')]('\x20')));}_0x1cb56b=_[_0x5b14('0x16')](_0x1cb56b,_[_0x5b14('0x17')](properties[_0x5b14('0x18')]));_0x1cb56b[_0x5b14('0x19')]=_0x5b14('0x1a');return ami['Action'](_0x1cb56b)[_0x5b14('0x1b')](function(_0x50866a){_0x40577a({'code':0xc8,'message':_0x50866a['message']});})['catch'](function(_0x3f397d){_0x52ffa9(_0x18b267[_0x5b14('0x11')](0x1f5,_0x3f397d[_0x5b14('0x1c')]));});});},'Command':function(_0x89b7a0){var _0x3786f7=this;return new Promise(function(_0x16fba5,_0x19e6f8){if(ami['isConnected']()==![]){return _0x19e6f8(_0x3786f7['error'](0x1f4,[config['asterisk']['ip'],config[_0x5b14('0x12')][_0x5b14('0x13')],_0x5b14('0x14')][_0x5b14('0x15')]('\x20')));}_0x89b7a0=_['pick'](_0x89b7a0,_0x5b14('0x1d'));_0x89b7a0[_0x5b14('0x19')]='Command';return ami[_0x5b14('0x1e')](_0x89b7a0)[_0x5b14('0x1b')](function(_0x50951f){_0x16fba5({'code':0xc8,'message':_0x50951f[_0x5b14('0x1f')]});})['catch'](function(_0x59282c){_0x19e6f8(_0x3786f7['error'](0x1f5,_0x59282c['message']));});});},'VoiceQueues':function(_0x2d62d1){return new Promise(function(_0x2d5f56,_0x153a25){var _0x5da505=[];for(var _0x46f86a in _0x1e0b5b[_0x5b14('0x20')]){if(_0x1e0b5b[_0x5b14('0x20')][_0x5b14('0x21')](_0x46f86a)){var _0xe6851b=_0x1e0b5b[_0x5b14('0x20')][_0x46f86a];var _0x422d22={'id':_0xe6851b['id'],'name':_0xe6851b[_0x5b14('0x22')],'strategy':_0xe6851b[_0x5b14('0x23')],'answered':_0xe6851b[_0x5b14('0x24')],'available':_0xe6851b[_0x5b14('0x25')],'loggedIn':_0xe6851b[_0x5b14('0x26')],'pTalking':_0xe6851b[_0x5b14('0x27')],'sumBillable':_0xe6851b[_0x5b14('0x28')],'sumDuration':_0xe6851b['sumDuration'],'sumHoldTime':_0xe6851b[_0x5b14('0x29')]||0x0,'talking':_0xe6851b[_0x5b14('0x2a')],'total':_0xe6851b['total'],'type':_0xe6851b['type'],'unmanaged':_0xe6851b[_0x5b14('0x2b')],'abandoned':_0xe6851b[_0x5b14('0x2c')],'waiting':_0xe6851b['waiting'],'loggedInDb':_0xe6851b['loggedInDb']};if(_0xe6851b[_0x5b14('0x2d')]==='outbound'){_0x422d22[_0x5b14('0x2e')]=_0xe6851b[_0x5b14('0x2e')];_0x422d22['dialMethod']=_0xe6851b['dialMethod'];_0x422d22[_0x5b14('0x2f')]=_0xe6851b[_0x5b14('0x2f')];_0x422d22[_0x5b14('0x30')]=_0xe6851b['dialOriginateCallerIdNumber'];_0x422d22[_0x5b14('0x31')]=_0xe6851b['dialOriginateTimeout'];_0x422d22[_0x5b14('0x32')]=_0xe6851b[_0x5b14('0x32')];_0x422d22[_0x5b14('0x33')]=_0xe6851b[_0x5b14('0x33')];_0x422d22['outboundAnswerAgiCallsDay']=_0xe6851b[_0x5b14('0x34')];_0x422d22[_0x5b14('0x35')]=_0xe6851b[_0x5b14('0x35')];_0x422d22[_0x5b14('0x36')]=_0xe6851b['outboundBlacklistCallsDay'];_0x422d22[_0x5b14('0x37')]=_0xe6851b[_0x5b14('0x37')];_0x422d22[_0x5b14('0x38')]=_0xe6851b['outboundCongestionCallsDay'];_0x422d22[_0x5b14('0x39')]=_0xe6851b['outboundDropCallsDayACS'];_0x422d22[_0x5b14('0x3a')]=_0xe6851b[_0x5b14('0x3a')];_0x422d22['outboundDropCallsDayTimeout']=_0xe6851b[_0x5b14('0x3b')];_0x422d22[_0x5b14('0x3c')]=_0xe6851b['outboundNoAnswerCallsDay'];_0x422d22[_0x5b14('0x3d')]=_0xe6851b['outboundNoSuchCallsDay'];_0x422d22[_0x5b14('0x3e')]=_0xe6851b[_0x5b14('0x3e')];_0x422d22[_0x5b14('0x3f')]=_0xe6851b[_0x5b14('0x3f')];_0x422d22['outboundRejectCallsDay']=_0xe6851b[_0x5b14('0x40')];_0x422d22[_0x5b14('0x41')]=_0xe6851b[_0x5b14('0x41')];_0x422d22[_0x5b14('0x42')]=_0xe6851b[_0x5b14('0x42')];_0x422d22[_0x5b14('0x43')]=_0xe6851b[_0x5b14('0x43')];_0x422d22[_0x5b14('0x44')]=_0xe6851b[_0x5b14('0x44')];_0x422d22[_0x5b14('0x45')]=_0xe6851b[_0x5b14('0x45')];_0x422d22[_0x5b14('0x46')]=_0xe6851b[_0x5b14('0x46')];_0x422d22[_0x5b14('0x47')]=_0xe6851b[_0x5b14('0x47')];_0x422d22[_0x5b14('0x48')]=_0xe6851b['predictiveIntervalErlangCallsDroppedCalls'];_0x422d22[_0x5b14('0x49')]=_0xe6851b['predictiveIntervalHitRate'];_0x422d22[_0x5b14('0x4a')]=_0xe6851b[_0x5b14('0x4a')];_0x422d22['predictiveIntervalPauses']=_0xe6851b['predictiveIntervalPauses'];_0x422d22['predictiveIntervalAvailable']=_0xe6851b[_0x5b14('0x4b')];_0x422d22[_0x5b14('0x4c')]=_0xe6851b['predictiveIntervalTotalCalls'];_0x422d22[_0x5b14('0x1c')]=_0xe6851b[_0x5b14('0x1c')];_0x422d22[_0x5b14('0x4d')]=_0xe6851b[_0x5b14('0x4d')];_0x422d22[_0x5b14('0x4e')]=_0xe6851b['erlangCalls'];_0x422d22[_0x5b14('0x4f')]=_0xe6851b[_0x5b14('0x4f')];_0x422d22['erlangAbandonmentRate']=_0xe6851b[_0x5b14('0x50')];_0x422d22[_0x5b14('0x51')]=_0xe6851b[_0x5b14('0x51')];_0x422d22[_0x5b14('0x52')]=_0xe6851b['startPredictive'];_0x422d22[_0x5b14('0x53')]=_0xe6851b[_0x5b14('0x53')];}if(_0xe6851b[_0x5b14('0x54')]){_0x422d22[_0x5b14('0x54')]={'id':_0xe6851b['Trunk']['id'],'name':_0xe6851b[_0x5b14('0x54')][_0x5b14('0x22')],'active':_0xe6851b[_0x5b14('0x54')][_0x5b14('0x55')],'callerid':_0xe6851b['Trunk']['callerid']};}if(_0xe6851b[_0x5b14('0x56')]){_0x422d22[_0x5b14('0x56')]={'id':_0xe6851b['Interval']['id'],'name':_0xe6851b[_0x5b14('0x56')]['name']};}_0x5da505[_0x5b14('0x57')](_0x422d22);}}_0x2d5f56({'count':_0x5da505[_0x5b14('0x58')],'rows':_0x5da505});});},'UpdateVoiceQueue':function(_0x2df4fa){return new Promise(function(_0x3bf048,_0x30d8d4){var _0x557ff4=_[_0x5b14('0x59')](_0x1e0b5b[_0x5b14('0x20')],{'id':parseInt(_0x2df4fa['id'])});var _0x285881=_[_0x5b14('0x5a')](_0x2df4fa,['id']);if(_0x557ff4){for(var _0x46e8ba in _0x285881){if(typeof _0x285881[_0x46e8ba]!=='undefined'&&typeof _0x557ff4[_0x46e8ba]!=='undefined'){_0x557ff4[_0x46e8ba]=_0x285881[_0x46e8ba];}}_0x3bf048(_0x557ff4);}else{_0x30d8d4();}});},'VoiceChannels':function(_0x370f19){return new Promise(function(_0x51af0f,_0x4a93e9){var _0x4825b4=_[_0x5b14('0x5b')](_0x1e0b5b[_0x5b14('0x5c')]);_0x51af0f({'count':_0x4825b4[_0x5b14('0x58')],'rows':_0x4825b4});});},'VoiceChannelMixMonitor':function(_0x16af6f){var _0x3740bb=this;return new Promise(function(_0x3eb335,_0x1d550f){if(ami['isConnected']()==![]){return _0x1d550f(_0x3740bb['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x5b14('0x14')][_0x5b14('0x15')]('\x20')));}var _0x31b527=schema(properties[_0x5b14('0x5d')])[_0x5b14('0x2')](_0x16af6f);if(_0x31b527['length']>0x0){return _0x1d550f(_0x3740bb['error'](0x1f4,_[_0x5b14('0x5e')](_0x31b527,_0x5b14('0x1c'))['join'](',\x20')));}var _0x286879=_[_0x5b14('0x59')](_0x1e0b5b['channels'],{'uniqueid':_0x16af6f['uniqueid']});if(_0x286879&&_0x286879[_0x5b14('0x5f')]){var _0x1d6fdc=util[_0x5b14('0x60')]('%s.%s',_0x16af6f[_0x5b14('0x61')]||_0x16af6f[_0x5b14('0x62')],_0x16af6f[_0x5b14('0x60')]||_0x5b14('0x63'));return ami[_0x5b14('0x1e')]({'action':_0x5b14('0x64'),'channel':_0x286879[_0x5b14('0x5f')],'file':_0x1d6fdc,'options':'ai(mixmonitorid)'})[_0x5b14('0x1b')](function(_0x5e99a4){var _0x44e625=_[_0x5b14('0x59')](_0x286879[_0x5b14('0x65')],{'filename':_0x5b14('0x66')+_0x1d6fdc[_0x5b14('0x67')]()});if(_[_0x5b14('0x68')](_0x44e625)){_0x286879[_0x5b14('0x65')][_0x5b14('0x57')]({'filename':_0x5b14('0x66')+_0x1d6fdc[_0x5b14('0x67')](),'createdAt':moment()[_0x5b14('0x60')](_0x5b14('0x69')),'mixmonitorid':_0x5e99a4['mixmonitorid'],'status':'rec'});}else{_0x44e625['mixmonitorid']=_0x5e99a4[_0x5b14('0x6a')];_0x44e625[_0x5b14('0x6b')]=_0x5b14('0x6c');}_0x3eb335({'code':0xc8,'message':[_0x16af6f[_0x5b14('0x62')],_0x5b14('0x6d'),_0x5e99a4[_0x5b14('0x6a')]][_0x5b14('0x15')]('\x20'),'mixmonitorid':_0x5e99a4['mixmonitorid']});})[_0x5b14('0x6e')](function(_0x19e88a){_0x1d550f(_0x3740bb['error'](0x1f5,[_0x16af6f['uniqueid'],_0x19e88a[_0x5b14('0x1c')][_0x5b14('0x67')]()][_0x5b14('0x15')]('\x20')));});}else{return _0x1d550f(_0x3740bb[_0x5b14('0x11')](0x1f5,_0x5b14('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x1009e5){var _0x5a21af=this;return new Promise(function(_0x2629ad,_0x48ffb3){if(ami[_0x5b14('0x10')]()==![]){return _0x48ffb3(_0x5a21af['error'](0x1f4,[config[_0x5b14('0x12')]['ip'],config[_0x5b14('0x12')][_0x5b14('0x13')],'ami\x20disconnected'][_0x5b14('0x15')]('\x20')));}var _0x566063=schema(properties[_0x5b14('0x5d')])[_0x5b14('0x2')](_0x1009e5);if(_0x566063[_0x5b14('0x58')]>0x0){return _0x48ffb3(_0x5a21af['error'](0x1f4,_[_0x5b14('0x5e')](_0x566063,_0x5b14('0x1c'))[_0x5b14('0x15')](',\x20')));}var _0x2e5bd4=_['find'](_0x1e0b5b[_0x5b14('0x5c')],{'uniqueid':_0x1009e5['uniqueid']});if(_0x2e5bd4){return BPromise[_0x5b14('0x70')]()[_0x5b14('0x1b')](function(){if(_0x2e5bd4['channel']){return ami['Action']({'action':_0x5b14('0x71'),'channel':_0x2e5bd4[_0x5b14('0x5f')],'mixmonitorid':_0x1009e5[_0x5b14('0x6a')]})['catch'](function(_0x474999){});}})[_0x5b14('0x1b')](function(){if(_0x2e5bd4['destinationchannel']){return ami[_0x5b14('0x1e')]({'action':_0x5b14('0x71'),'channel':_0x2e5bd4[_0x5b14('0x72')],'mixmonitorid':_0x1009e5[_0x5b14('0x6a')]})[_0x5b14('0x6e')](function(_0x49af2e){});}})[_0x5b14('0x1b')](function(_0x465907){var _0x521513=_['find'](_0x2e5bd4[_0x5b14('0x65')],{'mixmonitorid':_0x1009e5[_0x5b14('0x6a')]});if(_0x521513){_0x521513['status']='stop';}})[_0x5b14('0x1b')](function(){var _0x3824e6=util[_0x5b14('0x60')]('%s.%s',_0x1009e5[_0x5b14('0x61')]||_0x1009e5[_0x5b14('0x62')],_0x1009e5[_0x5b14('0x60')]||'wav');var _0x453e4b=_[_0x5b14('0x59')](_0x2e5bd4[_0x5b14('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x3824e6[_0x5b14('0x67')]()});if(_0x453e4b){_0x453e4b[_0x5b14('0x6b')]=_0x5b14('0x73');}})[_0x5b14('0x1b')](function(){_0x2629ad({'code':0xc8,'message':[_0x1009e5[_0x5b14('0x62')],_0x5b14('0x74')][_0x5b14('0x15')]('\x20')});})['catch'](function(_0x5ac604){_0x48ffb3(_0x5a21af['error'](0x1f5,[_0x1009e5['uniqueid'],_0x5ac604[_0x5b14('0x1c')][_0x5b14('0x67')]()][_0x5b14('0x15')]('\x20')));});}else{return _0x48ffb3(_0x5a21af[_0x5b14('0x11')](0x1f5,_0x5b14('0x6f')));}});},'VoiceQueuesChannels':function(_0x58f544){return new Promise(function(_0x56f20e,_0x1df8b2){var _0x5d9348=_[_0x5b14('0x5b')](_0x1e0b5b[_0x5b14('0x75')]);_0x56f20e({'count':_0x5d9348[_0x5b14('0x58')],'rows':_0x5d9348});});},'VoiceQueuesChannel':function(_0x4870f9){var _0x540f81=this;return new Promise(function(_0x1dded6,_0x1b76a0){var _0x160a4f=schema(properties[_0x5b14('0x76')])[_0x5b14('0x2')](_0x4870f9);if(_0x160a4f[_0x5b14('0x58')]>0x0){return _0x1b76a0(_0x540f81[_0x5b14('0x11')](0x1f4,_[_0x5b14('0x5e')](_0x160a4f,_0x5b14('0x1c'))['join'](',\x20')));}var _0x18960b=_['find'](_0x1e0b5b[_0x5b14('0x75')],{'uniqueid':_0x4870f9[_0x5b14('0x62')]});if(_0x18960b){_0x1dded6(_0x18960b);}else{return _0x1b76a0(_0x540f81[_0x5b14('0x11')](0x1f5,_0x5b14('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x4665d7){var _0x223faa=this;return new Promise(function(_0x2b8286,_0x4f9e57){if(ami['isConnected']()==![]){return _0x4f9e57(_0x223faa[_0x5b14('0x11')](0x1f4,[config[_0x5b14('0x12')]['ip'],config[_0x5b14('0x12')][_0x5b14('0x13')],_0x5b14('0x14')]['join']('\x20')));}var _0x1310a5=schema(properties[_0x5b14('0x77')])[_0x5b14('0x2')](_0x4665d7);if(_0x1310a5[_0x5b14('0x58')]>0x0){return _0x4f9e57(_0x223faa[_0x5b14('0x11')](0x1f4,_[_0x5b14('0x5e')](_0x1310a5,_0x5b14('0x1c'))[_0x5b14('0x15')](',\x20')));}var _0x44c3a2=_[_0x5b14('0x59')](_0x1e0b5b['queueChannels'],{'uniqueid':_0x4665d7['uniqueid']});if(_0x44c3a2&&_0x44c3a2[_0x5b14('0x5f')]){return ami[_0x5b14('0x1e')]({'action':'Hangup','channel':_0x44c3a2[_0x5b14('0x5f')]})[_0x5b14('0x1b')](function(_0x2c24cb){_0x2b8286({'code':0xc8,'message':[_0x4665d7[_0x5b14('0x62')],_0x2c24cb['message'][_0x5b14('0x67')]()][_0x5b14('0x15')]('\x20')});})[_0x5b14('0x6e')](function(_0x35f241){_0x4f9e57(_0x223faa[_0x5b14('0x11')](0x1f5,[_0x4665d7[_0x5b14('0x62')],_0x35f241[_0x5b14('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x4f9e57(_0x223faa['error'](0x1f5,_0x5b14('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x23c285){var _0xaf4676=this;return new Promise(function(_0x7541a1,_0x3449df){if(ami[_0x5b14('0x10')]()==![]){return _0x3449df(_0xaf4676[_0x5b14('0x11')](0x1f4,[config[_0x5b14('0x12')]['ip'],config[_0x5b14('0x12')][_0x5b14('0x13')],_0x5b14('0x14')]['join']('\x20')));}var _0xd28c0d=schema(properties[_0x5b14('0x78')])[_0x5b14('0x2')](_0x23c285);if(_0xd28c0d[_0x5b14('0x58')]>0x0){return _0x3449df(_0xaf4676['error'](0x1f4,_[_0x5b14('0x5e')](_0xd28c0d,_0x5b14('0x1c'))[_0x5b14('0x15')](',\x20')));}var _0xc16146=_[_0x5b14('0x59')](_0x1e0b5b[_0x5b14('0x75')],{'uniqueid':_0x23c285[_0x5b14('0x62')]});if(_0xc16146&&_0xc16146[_0x5b14('0x5f')]){return ami[_0x5b14('0x1e')]({'action':_0x5b14('0x79'),'channel':_0xc16146[_0x5b14('0x5f')],'exten':_0x23c285[_0x5b14('0x7a')],'context':_0x23c285[_0x5b14('0x7b')]||_0xc16146[_0x5b14('0x7b')],'priority':0x1})[_0x5b14('0x1b')](function(_0x49fbbc){_0x7541a1({'code':0xc8,'message':[_0x23c285[_0x5b14('0x62')],_0x49fbbc[_0x5b14('0x1c')][_0x5b14('0x67')]()][_0x5b14('0x15')]('\x20')});})[_0x5b14('0x6e')](function(_0x5939ae){_0x3449df(_0xaf4676['error'](0x1f5,[_0x23c285[_0x5b14('0x62')],_0x5939ae['message'][_0x5b14('0x67')]()][_0x5b14('0x15')]('\x20')));});}else{return _0x3449df(_0xaf4676[_0x5b14('0x11')](0x1f5,_0x5b14('0x6f')));}});},'Agents':function(_0x1af04d){return new Promise(function(_0x1eebf1,_0x4f09d5){var _0x1f08e3=_['values'](_0x1e0b5b['agents']);_0x1eebf1({'count':_0x1f08e3[_0x5b14('0x58')],'rows':_0x1f08e3});});},'Telephones':function(_0x3c79bb){return new Promise(function(_0x110968,_0x5ef4aa){var _0x5b8e11=_['values'](_0x1e0b5b['telephones']);_0x110968({'count':_0x5b8e11[_0x5b14('0x58')],'rows':_0x5b8e11});});},'Trunks':function(_0x1f7304){return new Promise(function(_0x30ad09,_0x47e418){var _0x5761cf=_[_0x5b14('0x5b')](_0x1e0b5b[_0x5b14('0x7c')]);_0x30ad09({'count':_0x5761cf['length'],'rows':_0x5761cf});});},'OutboundChannels':function(_0x293016){return new Promise(function(_0x16931d,_0x4bead1){var _0x4e7109=_['values'](_0x1e0b5b['outboundChannels']);_0x16931d({'count':_0x4e7109[_0x5b14('0x58')],'rows':_0x4e7109});});},'Outbound':function(_0x4b8775){return new Promise(function(_0x30d043,_0x7de41b){_0x30d043(_0x1e0b5b['outbound']);});},'Campaigns':function(_0x1fc726){return new Promise(function(_0x5ce32a,_0x908c23){var _0x57ba59=_[_0x5b14('0x5b')](_0x1e0b5b[_0x5b14('0x7d')]);_0x5ce32a({'count':_0x57ba59['length'],'rows':_0x57ba59});});},'VoiceQueuesPreview':function(_0x1c2ebf){var _0x14b2e9=this;return new Promise(function(_0x21161b,_0x2a3a92){_0x15490e['run'](_0x1c2ebf['id'])[_0x5b14('0x1b')](function(_0x2b6397){_0x21161b({'code':0xc8,'message':_0x2b6397['message']});})[_0x5b14('0x6e')](function(_0x4042ec){_0x2a3a92(_0x14b2e9[_0x5b14('0x11')](0x1f4,_0x4042ec['message']));});});},'EventManager':function(_0x22eef3){var _0x3e22b9=this;return new Promise(function(_0xe32822,_0x4eb5d7){if(!_0x22eef3[_0x5b14('0x7e')]){return _0x4eb5d7(_0x3e22b9['error'](0x1f4,_0x5b14('0x7f')));}ami['emit'](_0x5b14('0x80')+_0x22eef3[_0x5b14('0x7e')],_0x22eef3['message']);_0xe32822({'code':0xc8,'message':_0x22eef3});});},'FaxAccounts':function(_0x389410){return new Promise(function(_0x49381f,_0x253054){var _0x891dee=_[_0x5b14('0x5b')](_0x1e0b5b[_0x5b14('0x81')]);_0x49381f({'count':_0x891dee[_0x5b14('0x58')],'rows':_0x891dee});});},'SendFax':function(_0x55c0e2){var _0x56a634=this;return new Promise(function(_0x343fe3,_0x5c5f1c){_0x392425[_0x5b14('0x82')](_0x55c0e2)[_0x5b14('0x1b')](function(_0x3b9788){_0x343fe3({'code':0xc8,'message':_0x3b9788[_0x5b14('0x1c')]});})['catch'](function(_0x4221bc){_0x5c5f1c(_0x56a634[_0x5b14('0x11')](0x1f4,_0x4221bc[_0x5b14('0x1c')]));});});},'CheckAfterSend':function(_0x89d622){var _0x16d778=this;return new Promise(function(_0xd637cb,_0x869232){_0x392425[_0x5b14('0x83')](_0x89d622)[_0x5b14('0x1b')](function(_0x61a051){_0xd637cb({'code':0xc8,'message':_0x61a051['message']});})['catch'](function(_0x54911b){_0x869232(_0x16d778['error'](0x1f4,_0x54911b['message']));});});}};var _0x43c239=jayson[_0x5b14('0x84')](_0x1d12ed)[_0x5b14('0x85')]();_0x43c239['on'](_0x5b14('0x11'),function(_0x57021a){return _0x50fd91(_0x57021a);});_0x43c239[_0x5b14('0x86')](0x232a,_0x5b14('0x87'),function(){console[_0x5b14('0x88')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4d82ad('RPC\x20listening\x20on\x20port:'+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 e062e25..c76c6a6 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 _0xd6d6=['isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','destcalleridnum','calleridnum','firstName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x10e508,_0x325d03){_0x10e508=_0x10e508-0x0;var _0x1f65e5=_0xd6d6[_0x10e508];return _0x1f65e5;};'use strict';var _=require(_0x6d6d('0x0'));var BPromise=require(_0x6d6d('0x1'));var Redis=require(_0x6d6d('0x2'));var util=require(_0x6d6d('0x3'));var config=require('../../../../config/environment');var logger=require(_0x6d6d('0x4'))(_0x6d6d('0x5'));var cmContactRpc=require(_0x6d6d('0x6'));config[_0x6d6d('0x7')]=_[_0x6d6d('0x8')](config[_0x6d6d('0x7')],{'host':_0x6d6d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6d6d('0x7')]));function emit(_0x1bf731,_0x44f83d,_0x18f824,_0xd49f57,_0x408f88){logger[_0x6d6d('0xa')]('[CM][%s][%s]',_0x1bf731,_0x44f83d['id'],_0x18f824,_0xd49f57,JSON['stringify'](_0x408f88));io['to'](_0x18f824)[_0x6d6d('0xb')](_0xd49f57,_0x408f88);}exports[_0x6d6d('0xc')]=function(_0x23b18a,_0x290dfb,_0xf84314,_0x576c88){var _0x1f2b86,_0x158f82;var _0x49b59c={};var _0x4fbe9c=Number(_0xf84314[_0x6d6d('0xd')]);var _0x32146d=_0xf84314[_0x6d6d('0xe')]?Boolean(Number(_0xf84314[_0x6d6d('0xe')])):![];var _0x2b74ed;var _0x41fbdf=![];if(!_[_0x6d6d('0xf')](_0xf84314[_0x6d6d('0x10')])){if(_0xf84314['data5']=='1')_0x41fbdf=!![];}if(!_0x41fbdf){if(_0x576c88[_0x6d6d('0x11')]){_0x49b59c['id']=_0x576c88[_0x6d6d('0x11')];}}if(!_0x49b59c['id']){_0x49b59c[_0x6d6d('0x12')]=_0x4fbe9c;_0x2b74ed=_0xf84314[_0x6d6d('0x13')]&&_0xf84314[_0x6d6d('0x13')]!=='0'?_0xf84314['data3'][_0x6d6d('0x14')](','):['phone'];_0x49b59c[_0x6d6d('0x15')]=_[_0x6d6d('0x16')](_0x2b74ed,function(_0x1cc02b){var _0x4bb3d1={};_0x4bb3d1[_0x1cc02b]=_0x576c88['routeId']?_0x576c88[_0x6d6d('0x17')]:_0x576c88[_0x6d6d('0x18')];return _0x4bb3d1;});}var _0x2b59d4=['id',_0x6d6d('0x19'),'lastName','phone',_0x6d6d('0x1a'),'fax',_0x6d6d('0x12'),_0x6d6d('0x1b'),_0x6d6d('0x1c'),_0x6d6d('0x1d')];var _0x40d35b=_[_0x6d6d('0x1e')](_0x2b59d4,_0x2b74ed);BPromise[_0x6d6d('0x1f')]()[_0x6d6d('0x20')](cmContactRpc[_0x6d6d('0x21')]({'attributes':_0x40d35b,'where':_0x49b59c}))[_0x6d6d('0x20')](function(_0x24b10d){_0x158f82=_0x24b10d;if(!_[_0x6d6d('0x22')](_0x158f82)){if(_0x158f82[_0x6d6d('0x23')]===0x1){_0x1f2b86=_0x158f82[0x0];logger[_0x6d6d('0xa')](_0x6d6d('0x24'),_0x576c88[_0x6d6d('0x25')],_0x290dfb['id'],_0x1f2b86['id']);}else{logger[_0x6d6d('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x576c88[_0x6d6d('0x25')],_0x290dfb['id'],_[_0x6d6d('0x16')](_0x158f82,'id')[_0x6d6d('0x26')](','));}return;}else{logger[_0x6d6d('0xa')](_0x6d6d('0x27'),_0x576c88[_0x6d6d('0x25')],_0x290dfb['id']);var _0x554f8e={'ListId':_0x4fbe9c};var _0x2851dd=_0xf84314[_0x6d6d('0x28')]&&_0xf84314[_0x6d6d('0x28')]!=='0'?_0xf84314[_0x6d6d('0x28')]:_0x6d6d('0x29');if(_0x32146d){logger[_0x6d6d('0xa')](_0x6d6d('0x2a'),_0x576c88['uniqueid'],_0x290dfb['id']);_0x554f8e[_0x2851dd]=_[_0x6d6d('0xf')](_0x576c88[_0x6d6d('0x2b')])?_0x576c88['calleridnum']:_0x576c88['destcalleridnum'];if(_[_0x6d6d('0xf')](_0x576c88[_0x6d6d('0x2b')])){_0x554f8e[_0x6d6d('0x19')]=_0x576c88['calleridname']&&_0x576c88[_0x6d6d('0x2c')]!==_0x6d6d('0x2d')?_0x576c88[_0x6d6d('0x2c')]:_0x6d6d('0x2e');}else{_0x554f8e[_0x6d6d('0x19')]=_0x576c88[_0x6d6d('0x2f')]&&_0x576c88[_0x6d6d('0x2f')]!==_0x6d6d('0x2d')?_0x576c88[_0x6d6d('0x2f')]:_0x6d6d('0x2e');}return BPromise['resolve']()[_0x6d6d('0x20')](cmContactRpc['createContact'](_0x554f8e))[_0x6d6d('0x20')](function(_0x1ea9b2){_0x1f2b86=_0x1ea9b2;_0x158f82[_0x6d6d('0x30')](_0x1ea9b2);if(_0x1f2b86){logger[_0x6d6d('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x576c88[_0x6d6d('0x25')],_0x290dfb['id'],_0x1f2b86['id']);}return;});}else{logger['info'](_0x6d6d('0x31'),_0x576c88[_0x6d6d('0x25')],_0x290dfb['id']);_0x554f8e[_0x2851dd]=_['isNil'](_0x576c88[_0x6d6d('0x2b')])?_0x576c88[_0x6d6d('0x18')]:_0x576c88[_0x6d6d('0x17')];if(_[_0x6d6d('0xf')](_0x576c88[_0x6d6d('0x2b')])){_0x554f8e[_0x6d6d('0x19')]=_0x576c88[_0x6d6d('0x2c')]&&_0x576c88[_0x6d6d('0x2c')]!==_0x6d6d('0x2d')?_0x576c88[_0x6d6d('0x2c')]:_0x6d6d('0x2e');}else{_0x554f8e[_0x6d6d('0x19')]=_0x576c88[_0x6d6d('0x2f')]&&_0x576c88[_0x6d6d('0x2f')]!==''?_0x576c88[_0x6d6d('0x2f')]:_0x6d6d('0x2e');}_0x1f2b86=_0x554f8e;_0x158f82[_0x6d6d('0x30')](_0x554f8e);return;}}})[_0x6d6d('0x20')](function(){if(_0x23b18a){emit(_0x576c88['uniqueid'],_0x290dfb,util['format'](_0x6d6d('0x32'),_0x23b18a[_0x6d6d('0x33')]),util[_0x6d6d('0x34')]('trigger:%s',_0xf84314[_0x6d6d('0x35')][_0x6d6d('0x36')]()),{'evt':_[_0x6d6d('0x37')](_0x576c88,{'autoCreate':_0x32146d}),'contact':_0x1f2b86===undefined?{}:_0x1f2b86,'contacts':_0x158f82[_0x6d6d('0x23')]===0x0?undefined:_0x158f82});}});}; \ No newline at end of file +var _0x0e85=['data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x0e85,0x7c));var _0x50e8=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0e85[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x50e8('0x0'));var BPromise=require(_0x50e8('0x1'));var Redis=require('ioredis');var util=require(_0x50e8('0x2'));var config=require(_0x50e8('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x50e8('0x4')]=_['defaults'](config[_0x50e8('0x4')],{'host':_0x50e8('0x5'),'port':0x18eb});var io=require(_0x50e8('0x6'))(new Redis(config[_0x50e8('0x4')]));function emit(_0x5e8b01,_0x3ce904,_0x108edc,_0x42665e,_0x988da0){logger[_0x50e8('0x7')](_0x50e8('0x8'),_0x5e8b01,_0x3ce904['id'],_0x108edc,_0x42665e,JSON['stringify'](_0x988da0));io['to'](_0x108edc)[_0x50e8('0x9')](_0x42665e,_0x988da0);}exports[_0x50e8('0xa')]=function(_0x19d1bc,_0x2d4750,_0x154b9e,_0x194a89){var _0x45dc6f,_0x3d25ea;var _0x55ba0a={};var _0x56707f=Number(_0x154b9e[_0x50e8('0xb')]);var _0x24d381=_0x154b9e['data2']?Boolean(Number(_0x154b9e['data2'])):![];var _0x3cb45c;var _0x2abda1=![];if(!_[_0x50e8('0xc')](_0x154b9e[_0x50e8('0xd')])){if(_0x154b9e['data5']=='1')_0x2abda1=!![];}if(!_0x2abda1){if(_0x194a89[_0x50e8('0xe')]){_0x55ba0a['id']=_0x194a89[_0x50e8('0xe')];}}if(!_0x55ba0a['id']){_0x55ba0a[_0x50e8('0xf')]=_0x56707f;_0x3cb45c=_0x154b9e['data3']&&_0x154b9e['data3']!=='0'?_0x154b9e[_0x50e8('0x10')][_0x50e8('0x11')](','):[_0x50e8('0x12')];_0x55ba0a[_0x50e8('0x13')]=_[_0x50e8('0x14')](_0x3cb45c,function(_0x1f0338){var _0x5642bf={};_0x5642bf[_0x1f0338]=_0x194a89['routeId']?_0x194a89[_0x50e8('0x15')]:_0x194a89[_0x50e8('0x16')];return _0x5642bf;});}var _0x40d060=['id',_0x50e8('0x17'),_0x50e8('0x18'),_0x50e8('0x12'),_0x50e8('0x19'),'fax',_0x50e8('0xf'),'createdAt',_0x50e8('0x1a'),_0x50e8('0x1b')];var _0xd263d=_[_0x50e8('0x1c')](_0x40d060,_0x3cb45c);BPromise[_0x50e8('0x1d')]()['then'](cmContactRpc[_0x50e8('0x1e')]({'attributes':_0xd263d,'where':_0x55ba0a}))[_0x50e8('0x1f')](function(_0x58110d){_0x3d25ea=_0x58110d;if(!_[_0x50e8('0x20')](_0x3d25ea)){if(_0x3d25ea[_0x50e8('0x21')]===0x1){_0x45dc6f=_0x3d25ea[0x0];logger['info'](_0x50e8('0x22'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id'],_0x45dc6f['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x194a89['uniqueid'],_0x2d4750['id'],_[_0x50e8('0x14')](_0x3d25ea,'id')[_0x50e8('0x24')](','));}return;}else{logger[_0x50e8('0x7')](_0x50e8('0x25'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);var _0x13b6e9={'ListId':_0x56707f};var _0x53d848=_0x154b9e[_0x50e8('0x26')]&&_0x154b9e[_0x50e8('0x26')]!=='0'?_0x154b9e['data4']:_0x50e8('0x12');if(_0x24d381){logger[_0x50e8('0x7')](_0x50e8('0x27'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);_0x13b6e9[_0x53d848]=_['isNil'](_0x194a89[_0x50e8('0x28')])?_0x194a89['calleridnum']:_0x194a89[_0x50e8('0x15')];if(_[_0x50e8('0xc')](_0x194a89[_0x50e8('0x28')])){_0x13b6e9['firstName']=_0x194a89[_0x50e8('0x29')]&&_0x194a89[_0x50e8('0x29')]!==_0x50e8('0x2a')?_0x194a89[_0x50e8('0x29')]:_0x50e8('0x2b');}else{_0x13b6e9[_0x50e8('0x17')]=_0x194a89[_0x50e8('0x2c')]&&_0x194a89['destcalleridname']!==_0x50e8('0x2a')?_0x194a89[_0x50e8('0x2c')]:'Unknown';}return BPromise['resolve']()[_0x50e8('0x1f')](cmContactRpc[_0x50e8('0x2d')](_0x13b6e9))[_0x50e8('0x1f')](function(_0x47ace2){_0x45dc6f=_0x47ace2;_0x3d25ea['push'](_0x47ace2);if(_0x45dc6f){logger[_0x50e8('0x7')](_0x50e8('0x2e'),_0x194a89['uniqueid'],_0x2d4750['id'],_0x45dc6f['id']);}return;});}else{logger[_0x50e8('0x7')](_0x50e8('0x2f'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);_0x13b6e9[_0x53d848]=_[_0x50e8('0xc')](_0x194a89['routeId'])?_0x194a89[_0x50e8('0x16')]:_0x194a89['destcalleridnum'];if(_[_0x50e8('0xc')](_0x194a89[_0x50e8('0x28')])){_0x13b6e9[_0x50e8('0x17')]=_0x194a89['calleridname']&&_0x194a89[_0x50e8('0x29')]!==_0x50e8('0x2a')?_0x194a89['calleridname']:_0x50e8('0x2b');}else{_0x13b6e9[_0x50e8('0x17')]=_0x194a89[_0x50e8('0x2c')]&&_0x194a89[_0x50e8('0x2c')]!==''?_0x194a89[_0x50e8('0x2c')]:_0x50e8('0x2b');}_0x45dc6f=_0x13b6e9;_0x3d25ea[_0x50e8('0x30')](_0x13b6e9);return;}}})[_0x50e8('0x1f')](function(){if(_0x19d1bc){emit(_0x194a89['uniqueid'],_0x2d4750,util[_0x50e8('0x31')](_0x50e8('0x32'),_0x19d1bc[_0x50e8('0x33')]),util['format']('trigger:%s',_0x154b9e['action'][_0x50e8('0x34')]()),{'evt':_[_0x50e8('0x35')](_0x194a89,{'autoCreate':_0x24d381}),'contact':_0x45dc6f===undefined?{}:_0x45dc6f,'contacts':_0x3d25ea[_0x50e8('0x21')]===0x0?undefined:_0x3d25ea});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5125bf5..7172cc8 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 _0xe2bc=['data3','data4','location','data5','800','data6','600','winApplication','winArguments','user:%s','name','trigger:%s:%s','action','format','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','parse','query','search','channel','AllConditions','length','every','checkConditions','AnyConditions','some','field','chat','operator','value','upperFirst','AccountId','interaction','event','membername','lastevent','mailSubstatus','null','substatus','created','equals','util','url','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','clone','undefined','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','toLowerCase','contactmanager','motionbar','data1','data2','html','render','template\x20not\x20found','uri','isNil'];(function(_0x489306,_0x46033e){var _0xdaad78=function(_0x384e76){while(--_0x384e76){_0x489306['push'](_0x489306['shift']());}};_0xdaad78(++_0x46033e);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe2bc[_0x138adb];return _0x1b27f2;};'use strict';var util=require(_0xce2b('0x0'));var _=require('lodash');var url=require(_0xce2b('0x1'));var Mustache=require('mustache');var Redis=require(_0xce2b('0x2'));var urlforward=require(_0xce2b('0x3'));var integration=require(_0xce2b('0x4'));var cmContact=require(_0xce2b('0x5'));var script=require(_0xce2b('0x6'));var config=require('../../../config/environment');var logger=require(_0xce2b('0x7'))(_0xce2b('0x8'));var ami=require(_0xce2b('0x9'));config[_0xce2b('0xa')]=_[_0xce2b('0xb')](config['redis'],{'host':_0xce2b('0xc'),'port':0x18eb});var io=require(_0xce2b('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x97112a,_0x7dee3c){return _0x97112a==_0x7dee3c;},'not_equals':function(_0x27b525,_0x3786aa){return _0x27b525!=_0x3786aa;}};var barAndWebActions=[_0xce2b('0xe'),_0xce2b('0x1'),_0xce2b('0xf')];function Trigger(_0xa7941){this[_0xce2b('0x10')]=_0xa7941[_0xce2b('0x10')];this['agents']=_0xa7941[_0xce2b('0x11')];this['voiceQueues']=_0xa7941[_0xce2b('0x12')];this[_0xce2b('0x13')]=_0xa7941[_0xce2b('0x13')];this[_0xce2b('0x14')]=_0xa7941[_0xce2b('0x14')];this[_0xce2b('0x15')]=_0xa7941[_0xce2b('0x15')];this[_0xce2b('0x16')]=_0xa7941['freshdeskAccounts'];this[_0xce2b('0x17')]=_0xa7941[_0xce2b('0x17')];this['sugarcrmAccounts']=_0xa7941['sugarcrmAccounts'];this['zohoAccounts']=_0xa7941[_0xce2b('0x18')];this[_0xce2b('0x19')]=_0xa7941[_0xce2b('0x19')];this['vtigerAccounts']=_0xa7941['vtigerAccounts'];this[_0xce2b('0x1a')]=_0xa7941[_0xce2b('0x1a')];this[_0xce2b('0x1b')]=_0xa7941[_0xce2b('0x1b')];this[_0xce2b('0x1c')]=_0xa7941[_0xce2b('0x1c')];this[_0xce2b('0x1d')]={'zendesk':this[_0xce2b('0x15')],'salesforce':this[_0xce2b('0x17')],'freshdesk':this[_0xce2b('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xce2b('0x18')],'desk':this[_0xce2b('0x19')],'vtiger':this[_0xce2b('0x1e')],'dynamics365':this[_0xce2b('0x1b')],'freshsales':this[_0xce2b('0x1c')],'servicenow':this[_0xce2b('0x1a')]};ami['on'](_0xce2b('0x1f'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x22'),this['syncCustomEvent'][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x23'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x24'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x25'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x26'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this[_0xce2b('0x20')]['bind'](this));ami['on'](_0xce2b('0x27'),this[_0xce2b('0x20')]['bind'](this));ami['on'](_0xce2b('0x28'),this[_0xce2b('0x20')]['bind'](this));ami['on'](_0xce2b('0x29'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x2a'),this[_0xce2b('0x20')]['bind'](this));ami['on']('custom:dialbegin',this[_0xce2b('0x2b')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x2c'),this['syncAgentDial'][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x2d'),this[_0xce2b('0x2b')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x2e'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on']('custom:closedinteraction',this[_0xce2b('0x20')]['bind'](this));ami['on'](_0xce2b('0x2f'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x30'),this[_0xce2b('0x20')]['bind'](this));ami['on'](_0xce2b('0x31'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x32'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x33'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));ami['on'](_0xce2b('0x34'),this[_0xce2b('0x20')][_0xce2b('0x21')](this));}Trigger[_0xce2b('0x35')][_0xce2b('0x36')]=function(_0x427e7a,_0x160571,_0x4e9741){logger[_0xce2b('0x37')](_0x427e7a,_0x160571,JSON['stringify'](_0x4e9741));io['to'](_0x427e7a)[_0xce2b('0x36')](_0x160571,_0x4e9741);};Trigger[_0xce2b('0x35')][_0xce2b('0x20')]=function(_0xa6ce4e){var _0x6f1ea1=_[_0xce2b('0x38')](_0xa6ce4e);if(typeof _0x6f1ea1['motionChannel']===_0xce2b('0x39')){_0x6f1ea1[_0xce2b('0x3a')]=_0xce2b('0x3b');}this[_0xce2b('0x3c')](_0x6f1ea1);};Trigger[_0xce2b('0x35')][_0xce2b('0x2b')]=function(_0x585de8){if(this[_0xce2b('0x11')][_0x585de8[_0xce2b('0x3d')]]){this[_0xce2b('0x20')](_0x585de8);}};Trigger[_0xce2b('0x35')][_0xce2b('0x3c')]=function(_0x30aaf5){var _0x5a3593;for(var _0x54c7a1 in this[_0xce2b('0x10')]){if(this[_0xce2b('0x10')][_0xce2b('0x3e')](_0x54c7a1)){if(this[_0xce2b('0x10')][_0x54c7a1][_0xce2b('0x3f')]){_0x5a3593=this[_0xce2b('0x40')](this[_0xce2b('0x10')][_0x54c7a1],_0x30aaf5);if(_0x5a3593){_[_0xce2b('0x41')](_0x30aaf5,_0x30aaf5[_0xce2b('0x42')]);for(var _0x2e6085=0x0,_0x586145,_0x3e8a3b,_0x3e2096;_0x2e60850x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ 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(_0x5ab69b,_0x1957f8){var _0x10a54b=function(_0x2f983c){while(--_0x2f983c){_0x5ab69b['push'](_0x5ab69b['shift']());}};_0x10a54b(++_0x1957f8);}(_0x814b,0x1a2));var _0xb814=function(_0xbf19d7,_0x58b2bf){_0xbf19d7=_0xbf19d7-0x0;var _0x376e11=_0x814b[_0xbf19d7];return _0x376e11;};'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 fc21f1c..73fe4b9 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 _0xf63b=[']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','name','ticketId','error','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','modernAuthentication','CloudProvider','data7','tenantId','resolve','POST','remoteUri','username','password','clientSecret','toUpperCase','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','catch','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','headers','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]'];(function(_0x53446c,_0x203c4a){var _0x1ef3a8=function(_0x26fbe5){while(--_0x26fbe5){_0x53446c['push'](_0x53446c['shift']());}};_0x1ef3a8(++_0x203c4a);}(_0xf63b,0x71));var _0xbf63=function(_0x57c180,_0x4303ee){_0x57c180=_0x57c180-0x0;var _0x5b7062=_0xf63b[_0x57c180];return _0x5b7062;};'use strict';var _=require(_0xbf63('0x0'));var rp=require(_0xbf63('0x1'));var util=require(_0xbf63('0x2'));var intUtil=require(_0xbf63('0x3'));var md5=require(_0xbf63('0x4'));var Redis=require(_0xbf63('0x5'));var logger=require(_0xbf63('0x6'))(_0xbf63('0x7'));var config=require(_0xbf63('0x8'));config['redis']=_[_0xbf63('0x9')](config[_0xbf63('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbf63('0xa')]));function getAuthToken(_0x2a7066,_0x2c7a01,_0x6f66b0){if(_0x2a7066[_0xbf63('0xb')]){_0x2a7066['remoteUri']=_0x2a7066[_0xbf63('0xc')][_0xbf63('0xd')];_0x2a7066[_0xbf63('0xe')]=_0x2a7066[_0xbf63('0xc')]['data2'];return Promise[_0xbf63('0xf')](_0x2a7066[_0xbf63('0xc')]['data5']);}var _0x27db51={'method':_0xbf63('0x10'),'uri':_0x2c7a01,'form':{'client_id':_0x2a7066['clientId'],'resource':_0x2a7066[_0xbf63('0x11')],'username':_0x2a7066[_0xbf63('0x12')],'password':_0x2a7066[_0xbf63('0x13')],'grant_type':_0xbf63('0x13'),'client_secret':_0x2a7066[_0xbf63('0x14')]},'json':!![]};return rp(_0x27db51)['then'](function(_0x171b71){return _0x171b71['access_token'];})['catch'](function(_0x378f9f){logger['error']('['+[_0x6f66b0[_0xbf63('0x15')]()]+']\x20Wrong\x20credentials!');return _0x378f9f[_0xbf63('0x16')];});}function getUser(_0x23dd0f,_0x2ee762,_0xc4b9e1,_0x17d0a2,_0x435fe3,_0x589858){return new Promise(function(_0x1a1cc6,_0x2b024a){return getAuthToken(_0x2ee762,_0x17d0a2,_0x589858)[_0xbf63('0x17')](function(_0x836c8c){var _0x1c7729={'method':_0xbf63('0x18'),'uri':_0x435fe3+_0xbf63('0x19'),'headers':{'Authorization':_0xbf63('0x1a')+_0x836c8c,'OData-Version':_0xbf63('0x1b')},'json':!![]};return rp(_0x1c7729);})[_0xbf63('0x17')](function(_0x1d53aa){var _0x207263=_0x1d53aa[_0xbf63('0x1c')];var _0x195a55=![];var _0x34d6ec=null;if(!_[_0xbf63('0x1d')](_0xc4b9e1)){if(intUtil[_0xbf63('0x1e')](_0xc4b9e1[_0xbf63('0x1f')])){_0x23dd0f['userEmail']=_0xc4b9e1['email'];for(_0x34d6ec=0x0;_0x34d6ec<_0x207263[_0xbf63('0x20')];_0x34d6ec++){if(_0x207263[_0x34d6ec]['internalemailaddress']===_0xc4b9e1[_0xbf63('0x1f')]&&!_0x207263[_0x34d6ec][_0xbf63('0x21')]){_0x195a55=!![];logger[_0xbf63('0x22')]('['+[_0x589858['toUpperCase']()]+_0xbf63('0x23')+_0x207263[_0x34d6ec][_0xbf63('0x24')]+'!');_0x23dd0f[_0xbf63('0x25')]=_0x207263[_0x34d6ec][_0xbf63('0x24')];}}}}if(!_0x195a55){logger[_0xbf63('0x22')]('['+[_0x589858[_0xbf63('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x23dd0f[_0xbf63('0x26')]=_0x2ee762['username'];for(_0x34d6ec=0x0;_0x34d6ec<_0x207263[_0xbf63('0x20')];_0x34d6ec++){if(_0x207263[_0x34d6ec]['internalemailaddress']===_0x2ee762[_0xbf63('0x12')]){_0x23dd0f[_0xbf63('0x25')]=_0x207263[_0x34d6ec]['systemuserid'];}}}_0x1a1cc6(_0x23dd0f);})[_0xbf63('0x27')](function(_0x434e32){_0x2b024a(_0x434e32[_0xbf63('0x16')]);});});}function createEndUser(_0x4490c0,_0x275277,_0x56bdc9,_0x562279,_0x2759ae,_0x5e68c7){return new Promise(function(_0x1f1780,_0xd8c87){return getAuthToken(_0x275277,_0x56bdc9,_0x5e68c7)[_0xbf63('0x17')](function(_0x7cb621){var _0x55fd77=_0x5e68c7[_0xbf63('0x28')]()===_0xbf63('0x29')?_0x2759ae[_0xbf63('0x2a')]:_0x2759ae[_0xbf63('0x2b')];var _0x58b5f5={'method':_0xbf63('0x10'),'uri':_0x562279+'contacts','body':{'telephone1':_0x55fd77,'fullname':_0x55fd77,'firstname':_0x55fd77,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xbf63('0x2c')+_0x4490c0[_0xbf63('0x25')]+')'},'headers':{'Authorization':_0xbf63('0x1a')+_0x7cb621,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x58b5f5);})[_0xbf63('0x17')](function(_0x53840e){var _0x3a054f=_0x53840e[_0xbf63('0x2d')]['odata-entityid'];var _0x597b00=_0x3a054f[_0xbf63('0x2e')](_0x3a054f[_0xbf63('0x2f')]('(')+0x1,_0x3a054f['lastIndexOf'](')'));_0x4490c0[_0xbf63('0x30')]=_0x597b00;_0x1f1780(_0x4490c0);})[_0xbf63('0x27')](function(_0x154662){_0xd8c87(_0x154662[_0xbf63('0x16')]);});});}function getEndUser(_0x5487b7,_0x16493f,_0x50f36b,_0x6f0b07,_0x2732d6,_0x4bf566,_0xf3c615){var _0x5e1408=_0x4bf566[_0xbf63('0x28')]()==='outbound'?_0x2732d6['destcalleridnum']:_0x2732d6[_0xbf63('0x2b')];return getAuthToken(_0x16493f,_0x50f36b,_0x4bf566)[_0xbf63('0x17')](function(_0xce313f){var _0x2de8d5={'method':_0xbf63('0x18'),'uri':_0x6f0b07+_0xbf63('0x31')+_0x5e1408[_0xbf63('0x32')]('+',_0xbf63('0x33'))+'\x27','headers':{'Authorization':_0xbf63('0x1a')+_0xce313f,'If-None-Match':null,'OData-Version':_0xbf63('0x1b')},'json':!![]};return rp(_0x2de8d5);})[_0xbf63('0x17')](function(_0x408ba6){var _0x1bdd11=![];if(!_0x408ba6)return _0x1bdd11;var _0x145ba1=_0x408ba6[_0xbf63('0x1c')];for(var _0x2d3e87=0x0;_0x2d3e87<_0x145ba1[_0xbf63('0x20')];_0x2d3e87++){if(_0x145ba1[_0x2d3e87][_0xbf63('0x34')]===_0x5e1408){_0x1bdd11=!![];_0x5487b7[_0xbf63('0x30')]=_0x145ba1[_0x2d3e87][_0xbf63('0x35')];}}return _0x1bdd11;})['then'](function(_0x28f01b){if(_0x28f01b)return _0x5487b7;if(_0xf3c615==='nothing'){logger[_0xbf63('0x22')]('['+[_0x4bf566['toUpperCase']()]+_0xbf63('0x36'));return _0x5487b7;}return createEndUser(_0x5487b7,_0x16493f,_0x50f36b,_0x6f0b07,_0x2732d6,_0x4bf566)['then'](function(_0x1b38bf){logger[_0xbf63('0x22')]('['+[_0x4bf566['toUpperCase']()]+_0xbf63('0x37'),_0x1b38bf[_0xbf63('0x30')]);return _0x1b38bf;});});}function getCustomFields(_0x3a0300,_0x2847ce,_0x3e57c8){var _0x21f8f9={};if(_0x3a0300[_0xbf63('0x20')]>0x0){_[_0xbf63('0x38')](_0x3a0300,function(_0x43faa9){if(_[_0xbf63('0x39')](['string',_0xbf63('0x3a')],_0x43faa9[_0xbf63('0x3b')])&&_0x43faa9[_0xbf63('0x3c')]&&!_0x43faa9[_0xbf63('0x3d')]){var _0x517bc7=_0x43faa9[_0xbf63('0x3e')]['toLowerCase']();var _0x29613e=_0x517bc7['substring'](0x0,_0x517bc7[_0xbf63('0x3f')]('_'));var _0x4213cc=_0x517bc7['substring'](_0x517bc7[_0xbf63('0x3f')]('_')+0x1);if(_0x29613e===_0x3e57c8){_0x21f8f9[_0x4213cc]=_0x43faa9[_0xbf63('0x40')];}}});}return _0x21f8f9;}function getTicket(_0x49ec9b,_0x49711c,_0x564273,_0x4081ae,_0x5dadc2,_0x238f28,_0x387b70){return new Promise(function(_0x476bb1,_0x1f725e){var _0x3e3371;return getAuthToken(_0x49711c,_0x564273,_0x387b70)[_0xbf63('0x17')](function(_0x50ec45){if(_0x238f28[_0xbf63('0x41')]===_0xbf63('0x42')){_0x3e3371={'method':_0xbf63('0x10'),'uri':_0x4081ae+_0xbf63('0x43'),'body':Object[_0xbf63('0x44')]({},{'title':intUtil[_0xbf63('0x45')](_0x238f28[_0xbf63('0x46')],_0x5dadc2,'\x20'),'description':intUtil[_0xbf63('0x45')](_0x238f28[_0xbf63('0x47')],_0x5dadc2,'\x0a'),'customerid_contact@odata.bind':_0x49ec9b[_0xbf63('0x30')]?_0xbf63('0x48')+_0x49ec9b[_0xbf63('0x30')]+')':undefined,'ownerid@odata.bind':_0xbf63('0x2c')+_0x49ec9b[_0xbf63('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x238f28[_0xbf63('0x49')],_0x5dadc2,_0x238f28[_0xbf63('0x41')])),'headers':{'Authorization':_0xbf63('0x1a')+_0x50ec45,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x238f28[_0xbf63('0x41')]==='phonecall'){var _0x4dd5ef=_0x49ec9b[_0xbf63('0x30')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x49ec9b[_0xbf63('0x25')]+')','participationtypemask':_0x49ec9b[_0xbf63('0x4a')]===_0xbf63('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x49ec9b['enduserId']+')','participationtypemask':_0x49ec9b[_0xbf63('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xbf63('0x2c')+_0x49ec9b['userId']+')','participationtypemask':_0x49ec9b[_0xbf63('0x4a')]===_0xbf63('0x4b')?0x2:0x1}];_0x3e3371={'method':_0xbf63('0x10'),'uri':_0x4081ae+_0xbf63('0x4c'),'body':Object[_0xbf63('0x44')]({},{'subject':intUtil['getString'](_0x238f28[_0xbf63('0x46')],_0x5dadc2,'\x20'),'phonenumber':String(_0x5dadc2['calleridnum']),'description':intUtil[_0xbf63('0x45')](_0x238f28[_0xbf63('0x47')],_0x5dadc2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x49ec9b[_0xbf63('0x30')]?_0xbf63('0x48')+_0x49ec9b['enduserId']+')':undefined,'ownerid@odata.bind':_0xbf63('0x2c')+_0x49ec9b['userId']+')','directioncode':_0x49ec9b[_0xbf63('0x4a')]===_0xbf63('0x4b')?![]:!![],'phonecall_activity_parties':_0x4dd5ef},getCustomFields(_0x238f28['Fields'],_0x5dadc2,_0x238f28[_0xbf63('0x41')])),'headers':{'Authorization':_0xbf63('0x1a')+_0x50ec45,'OData-Version':_0xbf63('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e3371);})[_0xbf63('0x17')](function(_0x548fd4){var _0x3e11a2=_0x548fd4[_0xbf63('0x2d')]['odata-entityid'];var _0x227088=_0x3e11a2[_0xbf63('0x2e')](_0x3e11a2[_0xbf63('0x2f')]('(')+0x1,_0x3e11a2[_0xbf63('0x2f')](')'));_0x49ec9b['ticketId']=_0x227088;_0x476bb1(_0x49ec9b);})[_0xbf63('0x27')](function(_0x25af92){_0x1f725e(_0x25af92[_0xbf63('0x16')]);});});}function emit(_0x51cd4a,_0x445a15,_0x56a770,_0x4a253f){var _0x285ef5={'uri':util['format'](_0xbf63('0x4d'),_0x51cd4a,_0x56a770,_0x4a253f)};io['to'](util[_0xbf63('0x4e')](_0xbf63('0x4f'),_0x445a15))['emit'](_0xbf63('0x50'),_0x285ef5);}exports['cs']=function(_0x381827,_0x9e5886,_0x4447f3,_0x27fc46,_0x4b2e82,_0x5665b6,_0x4bd4f5,_0x103d89){var _0x11c030={};_0x5665b6[_0xbf63('0x11')]=_0x5665b6['modernAuthentication']?intUtil[_0xbf63('0x51')](_0x5665b6['CloudProvider'][_0xbf63('0xd')]):intUtil[_0xbf63('0x51')](_0x5665b6['remoteUri']);_0x5665b6[_0xbf63('0x52')]=intUtil['stripTrailingSlash'](_0x5665b6['serverUrl']);_0x11c030['callDirection']=_0x103d89==='queue'||_0x103d89===_0xbf63('0x53')?'queue':_0xbf63('0x29');var _0x1376d5=_0x5665b6[_0xbf63('0xb')]?util[_0xbf63('0x4e')]('%s/api/data/v9.0/',_0x5665b6['CloudProvider'][_0xbf63('0xd')]):util['format'](_0xbf63('0x54'),_0x5665b6[_0xbf63('0x11')]);var _0x3bb39e=util[_0xbf63('0x4e')](_0xbf63('0x55'),_0x5665b6['tenantId']);var _0x37ec7d=util['format'](_0xbf63('0x56'),_0x5665b6[_0xbf63('0x52')],_0x9e5886[_0xbf63('0x57')],md5(_0x9e5886[_0xbf63('0x57')]));if(_0x4b2e82&&_0x4b2e82[_0xbf63('0x58')]){logger[_0xbf63('0x22')](_0xbf63('0x59'),_0xbf63('0x5a'));_0x9e5886[_0xbf63('0x5b')]=_0x37ec7d;}else if(_0x4bd4f5&&_0x4bd4f5[_0xbf63('0x5c')]&&_0x4bd4f5[_0xbf63('0x5c')]!==_0xbf63('0x5d')){logger[_0xbf63('0x22')](_0xbf63('0x5e'),_0xbf63('0x5a'));_0x9e5886[_0xbf63('0x5b')]=_0x37ec7d;}else{_0x9e5886[_0xbf63('0x5b')]='';}return getUser(_0x11c030,_0x5665b6,_0x27fc46,_0x3bb39e,_0x1376d5,_0x103d89)[_0xbf63('0x17')](function(_0x2f5219){logger[_0xbf63('0x22')]('['+_0x103d89[_0xbf63('0x15')]()+_0xbf63('0x5f'),_0x2f5219[_0xbf63('0x25')]);logger['info']('['+_0x103d89[_0xbf63('0x15')]()+_0xbf63('0x60'),_0x2f5219[_0xbf63('0x26')]);return getEndUser(_0x2f5219,_0x5665b6,_0x3bb39e,_0x1376d5,_0x9e5886,_0x103d89,_0x4447f3[_0xbf63('0x61')]);})['then'](function(_0x4171f8){logger[_0xbf63('0x22')]('['+_0x103d89[_0xbf63('0x15')]()+_0xbf63('0x62'),_0x4171f8[_0xbf63('0x30')]);logger[_0xbf63('0x22')]('['+_0x103d89[_0xbf63('0x15')]()+_0xbf63('0x63'),_0x9e5886['calleridnum']);return getTicket(_0x4171f8,_0x5665b6,_0x3bb39e,_0x1376d5,_0x9e5886,_0x4447f3,_0x103d89);})['then'](function(_0x4f40a8){logger[_0xbf63('0x22')](util[_0xbf63('0x4e')]('['+_0x103d89['toUpperCase']()+_0xbf63('0x64'),_0x4447f3[_0xbf63('0x41')],_0x4f40a8['ticketId']));logger[_0xbf63('0x22')](util[_0xbf63('0x4e')]('['+_0x103d89[_0xbf63('0x15')]()+']\x20Call\x20direction:\x20%s',_0x103d89));if(_0x103d89!==_0xbf63('0x53')){logger[_0xbf63('0x22')]('['+_0x103d89[_0xbf63('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5665b6[_0xbf63('0x11')],_0x27fc46[_0xbf63('0x65')],_0x4447f3['ticketType'],_0x4f40a8[_0xbf63('0x66')]);}})[_0xbf63('0x27')](function(_0x4b162c){logger[_0xbf63('0x67')]('['+_0x103d89[_0xbf63('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x4b162c[_0xbf63('0x16')]);});}; \ No newline at end of file +var _0x5016=['password','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','internalemailaddress','userId','catch','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','outbound','replace','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','customField','idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','enduserId','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','POST','clientId','username'];(function(_0x3e8450,_0x3d95a1){var _0x40a872=function(_0x12993e){while(--_0x12993e){_0x3e8450['push'](_0x3e8450['shift']());}};_0x40a872(++_0x3d95a1);}(_0x5016,0xba));var _0x6501=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0x5016[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require(_0x6501('0x0'));var rp=require(_0x6501('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0x6501('0x2'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x6501('0x3'));var config=require('../../../../config/environment');config[_0x6501('0x4')]=_[_0x6501('0x5')](config[_0x6501('0x4')],{'host':_0x6501('0x6'),'port':0x18eb});var io=require(_0x6501('0x7'))(new Redis(config[_0x6501('0x4')]));function getAuthToken(_0x1c1ea6,_0x3fd5de,_0x556068){if(_0x1c1ea6[_0x6501('0x8')]){_0x1c1ea6[_0x6501('0x9')]=_0x1c1ea6[_0x6501('0xa')][_0x6501('0xb')];_0x1c1ea6[_0x6501('0xc')]=_0x1c1ea6['CloudProvider'][_0x6501('0xd')];return Promise[_0x6501('0xe')](_0x1c1ea6['CloudProvider']['data5']);}var _0x5e938e={'method':_0x6501('0xf'),'uri':_0x3fd5de,'form':{'client_id':_0x1c1ea6[_0x6501('0x10')],'resource':_0x1c1ea6['remoteUri'],'username':_0x1c1ea6[_0x6501('0x11')],'password':_0x1c1ea6[_0x6501('0x12')],'grant_type':'password','client_secret':_0x1c1ea6[_0x6501('0x13')]},'json':!![]};return rp(_0x5e938e)['then'](function(_0x13fcbc){return _0x13fcbc[_0x6501('0x14')];})['catch'](function(_0x65738){logger[_0x6501('0x15')]('['+[_0x556068[_0x6501('0x16')]()]+_0x6501('0x17'));return _0x65738[_0x6501('0x18')];});}function getUser(_0x4b10d7,_0x5de264,_0x8dfba9,_0x20a1d3,_0x4faac8,_0x4acaa2){return new Promise(function(_0x5ecd15,_0x35eaf1){return getAuthToken(_0x5de264,_0x20a1d3,_0x4acaa2)[_0x6501('0x19')](function(_0x5175b0){var _0x389485={'method':_0x6501('0x1a'),'uri':_0x4faac8+_0x6501('0x1b'),'headers':{'Authorization':_0x6501('0x1c')+_0x5175b0,'OData-Version':_0x6501('0x1d')},'json':!![]};return rp(_0x389485);})[_0x6501('0x19')](function(_0x2e2014){var _0x29c114=_0x2e2014[_0x6501('0x1e')];var _0xe00503=![];var _0x4fc5e9=null;if(!_['isNil'](_0x8dfba9)){if(intUtil['validateEmail'](_0x8dfba9[_0x6501('0x1f')])){_0x4b10d7[_0x6501('0x20')]=_0x8dfba9[_0x6501('0x1f')];for(_0x4fc5e9=0x0;_0x4fc5e9<_0x29c114[_0x6501('0x21')];_0x4fc5e9++){if(_0x29c114[_0x4fc5e9]['internalemailaddress']===_0x8dfba9['email']&&!_0x29c114[_0x4fc5e9][_0x6501('0x22')]){_0xe00503=!![];logger[_0x6501('0x23')]('['+[_0x4acaa2['toUpperCase']()]+_0x6501('0x24')+_0x29c114[_0x4fc5e9][_0x6501('0x25')]+'!');_0x4b10d7['userId']=_0x29c114[_0x4fc5e9][_0x6501('0x25')];}}}}if(!_0xe00503){logger[_0x6501('0x23')]('['+[_0x4acaa2[_0x6501('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4b10d7[_0x6501('0x20')]=_0x5de264[_0x6501('0x11')];for(_0x4fc5e9=0x0;_0x4fc5e9<_0x29c114[_0x6501('0x21')];_0x4fc5e9++){if(_0x29c114[_0x4fc5e9][_0x6501('0x26')]===_0x5de264[_0x6501('0x11')]){_0x4b10d7[_0x6501('0x27')]=_0x29c114[_0x4fc5e9][_0x6501('0x25')];}}}_0x5ecd15(_0x4b10d7);})[_0x6501('0x28')](function(_0x25eae8){_0x35eaf1(_0x25eae8[_0x6501('0x18')]);});});}function createEndUser(_0x47a76a,_0x6e6554,_0x5ab369,_0x2473a4,_0x188fe0,_0x5c75d5){return new Promise(function(_0x54111e,_0x1834fe){return getAuthToken(_0x6e6554,_0x5ab369,_0x5c75d5)[_0x6501('0x19')](function(_0x560fbd){var _0x3d48db=_0x5c75d5[_0x6501('0x29')]()==='outbound'?_0x188fe0[_0x6501('0x2a')]:_0x188fe0[_0x6501('0x2b')];var _0x32783a={'method':_0x6501('0xf'),'uri':_0x2473a4+_0x6501('0x2c'),'body':{'telephone1':_0x3d48db,'fullname':_0x3d48db,'firstname':_0x3d48db,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6501('0x2d')+_0x47a76a[_0x6501('0x27')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x560fbd,'OData-Version':_0x6501('0x1d')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x32783a);})[_0x6501('0x19')](function(_0x113695){var _0x42cde6=_0x113695['headers'][_0x6501('0x2e')];var _0x1f2b18=_0x42cde6[_0x6501('0x2f')](_0x42cde6[_0x6501('0x30')]('(')+0x1,_0x42cde6[_0x6501('0x30')](')'));_0x47a76a['enduserId']=_0x1f2b18;_0x54111e(_0x47a76a);})['catch'](function(_0x218fed){_0x1834fe(_0x218fed[_0x6501('0x18')]);});});}function getEndUser(_0x27a231,_0x256eb7,_0x147d7e,_0x4b02ba,_0x4ecc68,_0x483fc8,_0x347fc8){var _0x382d4e=_0x483fc8[_0x6501('0x29')]()===_0x6501('0x31')?_0x4ecc68[_0x6501('0x2a')]:_0x4ecc68['calleridnum'];return getAuthToken(_0x256eb7,_0x147d7e,_0x483fc8)[_0x6501('0x19')](function(_0x54e9c6){var _0x675607={'method':_0x6501('0x1a'),'uri':_0x4b02ba+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x382d4e[_0x6501('0x32')]('+','%2b')+'\x27','headers':{'Authorization':_0x6501('0x1c')+_0x54e9c6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x675607);})[_0x6501('0x19')](function(_0x4841a0){var _0x3820eb=![];if(!_0x4841a0)return _0x3820eb;var _0x55d021=_0x4841a0[_0x6501('0x1e')];for(var _0x49ffdb=0x0;_0x49ffdb<_0x55d021[_0x6501('0x21')];_0x49ffdb++){if(_0x55d021[_0x49ffdb][_0x6501('0x33')]===_0x382d4e){_0x3820eb=!![];_0x27a231['enduserId']=_0x55d021[_0x49ffdb][_0x6501('0x34')];}}return _0x3820eb;})[_0x6501('0x19')](function(_0x1439c0){if(_0x1439c0)return _0x27a231;if(_0x347fc8===_0x6501('0x35')){logger[_0x6501('0x23')]('['+[_0x483fc8[_0x6501('0x16')]()]+_0x6501('0x36'));return _0x27a231;}return createEndUser(_0x27a231,_0x256eb7,_0x147d7e,_0x4b02ba,_0x4ecc68,_0x483fc8)[_0x6501('0x19')](function(_0xf6e088){logger[_0x6501('0x23')]('['+[_0x483fc8[_0x6501('0x16')]()]+_0x6501('0x37'),_0xf6e088['enduserId']);return _0xf6e088;});});}function getCustomFields(_0x3e51d3,_0x1b5738,_0x12e83e){var _0x32b9fa={};if(_0x3e51d3[_0x6501('0x21')]>0x0){_[_0x6501('0x38')](_0x3e51d3,function(_0x24a621){if(_['includes']([_0x6501('0x39'),_0x6501('0x3a')],_0x24a621[_0x6501('0x3b')])&&_0x24a621['nameField']&&!_0x24a621[_0x6501('0x3c')]){var _0x509cef=_0x24a621[_0x6501('0x3d')][_0x6501('0x29')]();var _0x3ea014=_0x509cef['substring'](0x0,_0x509cef[_0x6501('0x3e')]('_'));var _0xfa8485=_0x509cef[_0x6501('0x2f')](_0x509cef[_0x6501('0x3e')]('_')+0x1);if(_0x3ea014===_0x12e83e){_0x32b9fa[_0xfa8485]=_0x24a621[_0x6501('0x3f')];}}});}return _0x32b9fa;}function getTicket(_0x581b87,_0x87ac2d,_0x4b3b77,_0x4b793c,_0x448526,_0x476a96,_0x2ac512){return new Promise(function(_0x162358,_0x1450cc){var _0x169eb7;return getAuthToken(_0x87ac2d,_0x4b3b77,_0x2ac512)[_0x6501('0x19')](function(_0x4781a1){if(_0x476a96[_0x6501('0x40')]===_0x6501('0x41')){_0x169eb7={'method':_0x6501('0xf'),'uri':_0x4b793c+_0x6501('0x42'),'body':Object['assign']({},{'title':intUtil[_0x6501('0x43')](_0x476a96[_0x6501('0x44')],_0x448526,'\x20'),'description':intUtil[_0x6501('0x43')](_0x476a96[_0x6501('0x45')],_0x448526,'\x0a'),'customerid_contact@odata.bind':_0x581b87[_0x6501('0x46')]?_0x6501('0x47')+_0x581b87['enduserId']+')':undefined,'ownerid@odata.bind':_0x6501('0x2d')+_0x581b87[_0x6501('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x476a96[_0x6501('0x48')],_0x448526,_0x476a96[_0x6501('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x4781a1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x476a96[_0x6501('0x40')]===_0x6501('0x49')){var _0x3a0b3b=_0x581b87['enduserId']?[{'partyid_systemuser@odata.bind':_0x6501('0x2d')+_0x581b87[_0x6501('0x27')]+')','participationtypemask':_0x581b87[_0x6501('0x4a')]===_0x6501('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x6501('0x47')+_0x581b87[_0x6501('0x46')]+')','participationtypemask':_0x581b87[_0x6501('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6501('0x2d')+_0x581b87[_0x6501('0x27')]+')','participationtypemask':_0x581b87[_0x6501('0x4a')]==='queue'?0x2:0x1}];_0x169eb7={'method':_0x6501('0xf'),'uri':_0x4b793c+_0x6501('0x4c'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x476a96[_0x6501('0x44')],_0x448526,'\x20'),'phonenumber':String(_0x448526[_0x6501('0x2b')]),'description':intUtil['getString'](_0x476a96[_0x6501('0x45')],_0x448526,'\x0a'),'regardingobjectid_contact@odata.bind':_0x581b87[_0x6501('0x46')]?_0x6501('0x47')+_0x581b87[_0x6501('0x46')]+')':undefined,'ownerid@odata.bind':_0x6501('0x2d')+_0x581b87[_0x6501('0x27')]+')','directioncode':_0x581b87[_0x6501('0x4a')]===_0x6501('0x4b')?![]:!![],'phonecall_activity_parties':_0x3a0b3b},getCustomFields(_0x476a96['Fields'],_0x448526,_0x476a96[_0x6501('0x40')])),'headers':{'Authorization':_0x6501('0x1c')+_0x4781a1,'OData-Version':_0x6501('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x169eb7);})[_0x6501('0x19')](function(_0x29c578){var _0x36bc1a=_0x29c578[_0x6501('0x4d')][_0x6501('0x2e')];var _0x1c01d1=_0x36bc1a[_0x6501('0x2f')](_0x36bc1a[_0x6501('0x30')]('(')+0x1,_0x36bc1a[_0x6501('0x30')](')'));_0x581b87['ticketId']=_0x1c01d1;_0x162358(_0x581b87);})[_0x6501('0x28')](function(_0x11396f){_0x1450cc(_0x11396f[_0x6501('0x18')]);});});}function emit(_0x593b29,_0x54f6b3,_0x45a045,_0x1cc891){var _0x4eb868={'uri':util[_0x6501('0x4e')](_0x6501('0x4f'),_0x593b29,_0x45a045,_0x1cc891)};io['to'](util[_0x6501('0x4e')](_0x6501('0x50'),_0x54f6b3))[_0x6501('0x51')](_0x6501('0x52'),_0x4eb868);}exports['cs']=function(_0x3c983b,_0x24a979,_0x18e60f,_0x3f91ac,_0x27612a,_0x111991,_0x2ab03d,_0x373857){var _0x3db07b={};_0x111991[_0x6501('0x9')]=_0x111991[_0x6501('0x8')]?intUtil[_0x6501('0x53')](_0x111991['CloudProvider'][_0x6501('0xb')]):intUtil[_0x6501('0x53')](_0x111991[_0x6501('0x9')]);_0x111991['serverUrl']=intUtil[_0x6501('0x53')](_0x111991[_0x6501('0x54')]);_0x3db07b[_0x6501('0x4a')]=_0x373857===_0x6501('0x4b')||_0x373857==='unmanaged'?_0x6501('0x4b'):_0x6501('0x31');var _0x3b3814=_0x111991[_0x6501('0x8')]?util['format']('%s/api/data/v9.0/',_0x111991['CloudProvider']['data7']):util[_0x6501('0x4e')](_0x6501('0x55'),_0x111991[_0x6501('0x9')]);var _0x5849f6=util[_0x6501('0x4e')]('https://login.microsoftonline.com/%s/oauth2/token',_0x111991[_0x6501('0xc')]);var _0x2a743a=util[_0x6501('0x4e')](_0x6501('0x56'),_0x111991['serverUrl'],_0x24a979['uniqueid'],md5(_0x24a979[_0x6501('0x57')]));if(_0x27612a&&_0x27612a['monitor_format']){logger[_0x6501('0x23')](_0x6501('0x58'),_0x6501('0x59'));_0x24a979['recordingURL']=_0x2a743a;}else if(_0x2ab03d&&_0x2ab03d[_0x6501('0x5a')]&&_0x2ab03d[_0x6501('0x5a')]!==_0x6501('0x5b')){logger[_0x6501('0x23')]('[OUTBOUND]',_0x6501('0x59'));_0x24a979[_0x6501('0x5c')]=_0x2a743a;}else{_0x24a979[_0x6501('0x5c')]='';}return getUser(_0x3db07b,_0x111991,_0x3f91ac,_0x5849f6,_0x3b3814,_0x373857)[_0x6501('0x19')](function(_0x12aca3){logger['info']('['+_0x373857[_0x6501('0x16')]()+_0x6501('0x5d'),_0x12aca3[_0x6501('0x27')]);logger[_0x6501('0x23')]('['+_0x373857[_0x6501('0x16')]()+_0x6501('0x5e'),_0x12aca3[_0x6501('0x20')]);return getEndUser(_0x12aca3,_0x111991,_0x5849f6,_0x3b3814,_0x24a979,_0x373857,_0x18e60f['moduleCreate']);})['then'](function(_0x363b55){logger[_0x6501('0x23')]('['+_0x373857[_0x6501('0x16')]()+_0x6501('0x5f'),_0x363b55[_0x6501('0x46')]);logger[_0x6501('0x23')]('['+_0x373857[_0x6501('0x16')]()+_0x6501('0x60'),_0x24a979['calleridnum']);return getTicket(_0x363b55,_0x111991,_0x5849f6,_0x3b3814,_0x24a979,_0x18e60f,_0x373857);})[_0x6501('0x19')](function(_0x57ad96){logger['info'](util[_0x6501('0x4e')]('['+_0x373857['toUpperCase']()+_0x6501('0x61'),_0x18e60f[_0x6501('0x40')],_0x57ad96[_0x6501('0x62')]));logger[_0x6501('0x23')](util[_0x6501('0x4e')]('['+_0x373857[_0x6501('0x16')]()+']\x20Call\x20direction:\x20%s',_0x373857));if(_0x373857!==_0x6501('0x63')){logger[_0x6501('0x23')]('['+_0x373857[_0x6501('0x16')]()+']',_0x6501('0x64'));emit(_0x111991[_0x6501('0x9')],_0x3f91ac[_0x6501('0x65')],_0x18e60f[_0x6501('0x40')],_0x57ad96[_0x6501('0x62')]);}})[_0x6501('0x28')](function(_0x2d33cf){logger[_0x6501('0x15')]('['+_0x373857[_0x6501('0x16')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2d33cf[_0x6501('0x18')]);});}; \ 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 c4e7369..7c56df8 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 _0x44f8=['calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','remoteUri','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','calleridname','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s'];(function(_0x11303c,_0x3414ea){var _0x80dad9=function(_0x4a9a03){while(--_0x4a9a03){_0x11303c['push'](_0x11303c['shift']());}};_0x80dad9(++_0x3414ea);}(_0x44f8,0x1c6));var _0x844f=function(_0x1e87c3,_0x3498b3){_0x1e87c3=_0x1e87c3-0x0;var _0x4dfccf=_0x44f8[_0x1e87c3];return _0x4dfccf;};'use strict';var _=require(_0x844f('0x0'));var rp=require(_0x844f('0x1'));var md5=require('md5');var util=require(_0x844f('0x2'));var Redis=require(_0x844f('0x3'));var intUtil=require(_0x844f('0x4'));var config=require('../../../../config/environment');var logger=require(_0x844f('0x5'))(_0x844f('0x6'));config[_0x844f('0x7')]=_[_0x844f('0x8')](config[_0x844f('0x7')],{'host':_0x844f('0x9'),'port':0x18eb});var io=require(_0x844f('0xa'))(new Redis(config[_0x844f('0x7')]));var headers={'Content-Type':_0x844f('0xb'),'Accept':_0x844f('0xb')};function emit(_0x33a4ce,_0xfc9efa,_0x33c575){io['to'](_0x33a4ce)[_0x844f('0xc')](_0xfc9efa,_0x33c575);}function getTicket(_0x8e5626,_0x58f149,_0x465d6d,_0x38f182,_0xa10918){logger['info'](_0x844f('0xd'));var _0xdf221c=_['merge']({'responder_id':_0x58f149['id'],'requester_id':_0x465d6d['id'],'name':util[_0x844f('0xe')](_0x844f('0xf'),_0xa10918['calleridname']),'phone':_0xa10918[_0x844f('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x38f182[_0x844f('0x11')],_0xa10918,'\x20'),'description':intUtil[_0x844f('0x12')](_0x38f182[_0x844f('0x13')],_0xa10918,_0x844f('0x14')),'tags':getTags(_0x38f182[_0x844f('0x15')],_0x844f('0x16'))},getCustomFields(_0x38f182[_0x844f('0x17')],_0xa10918));_0xdf221c[_0x844f('0x18')]=_[_0x844f('0x19')](_['keyBy'](_0xdf221c[_0x844f('0x18')],'id'),_0x844f('0x1a'));return request({'uri':util[_0x844f('0xe')]('%s/api/v2/tickets',_0x8e5626[_0x844f('0x1b')]),'method':'POST','body':_0xdf221c})[_0x844f('0x1c')](function(_0x5aa06e){logger[_0x844f('0x1d')](_0x844f('0x1e'));return _0x5aa06e;});}function getUser(_0x19a79d,_0x3ac3a2){if(intUtil[_0x844f('0x1f')](_0x3ac3a2)){return request({'uri':util[_0x844f('0xe')](_0x844f('0x20'),_0x19a79d[_0x844f('0x1b')]),'qs':{'email':_0x3ac3a2}})[_0x844f('0x1c')](function(_0x4d69a9){if(_0x4d69a9[_0x844f('0x21')]){logger[_0x844f('0x1d')]('Agent\x20found!');return _[_0x844f('0x22')](_0x4d69a9,function(_0xb11016){return _0xb11016[_0x844f('0x23')][_0x844f('0x24')]===_0x3ac3a2;});}else{logger[_0x844f('0x1d')](_0x844f('0x25'));return request({'uri':util['format'](_0x844f('0x26'),_0x19a79d[_0x844f('0x1b')])})[_0x844f('0x1c')](function(_0x407e9b){logger[_0x844f('0x1d')](_0x844f('0x27'));return _0x407e9b;});}});}else{logger[_0x844f('0x1d')](_0x844f('0x28'));return request({'uri':util[_0x844f('0xe')]('%s/api/v2/agents/me',_0x19a79d['remoteUri'])})[_0x844f('0x1c')](function(_0x20e695){logger[_0x844f('0x1d')](_0x844f('0x27'));return _0x20e695;});}}function getEndUser(_0x280425,_0x1d92d1,_0x5a2454){logger[_0x844f('0x1d')]('Searching\x20enduser\x20with\x20phone',_0x5a2454);return request({'uri':util[_0x844f('0xe')](_0x844f('0x29'),_0x280425['remoteUri']),'qs':{'phone':_0x5a2454}})['then'](function(_0x51339c){if(_0x51339c[_0x844f('0x21')]){logger[_0x844f('0x1d')](_0x844f('0x2a'));return _['find'](_0x51339c,{'phone':_0x5a2454});}else{logger['info'](_0x844f('0x2b'));return request({'uri':util[_0x844f('0xe')]('%s/api/v2/contacts',_0x280425['remoteUri']),'method':'POST','body':{'name':_0x1d92d1,'phone':_0x5a2454}})['then'](function(_0x2795d9){logger['info'](_0x844f('0x2c'));return _0x2795d9;});}});}function getAuth(_0x18a972){return util[_0x844f('0xe')](_0x844f('0x2d'),new Buffer(_0x18a972[_0x844f('0x2e')]+':X')[_0x844f('0x2f')]('base64'));}function request(_0xa806df){logger['debug'](_0x844f('0x30'),JSON['stringify'](_0xa806df));return rp(_[_0x844f('0x8')](_0xa806df,{'method':_0x844f('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1c3bb8,_0x30c799){var _0x1259a8=[];if(_0x1c3bb8&&_0x1c3bb8[_0x844f('0x21')]>0x0){_0x1259a8=_[_0x844f('0x32')](_0x1c3bb8,_0x30c799);}return _0x1259a8;}function getCustomFields(_0x47a2ba,_0x210a3d){var _0x9f5a17=[];var _0x542472={'custom_fields':[]};if(_0x47a2ba[_0x844f('0x21')]>0x0){_[_0x844f('0x33')](_0x47a2ba,function(_0x6cc7ce){if(_[_0x844f('0x34')]([_0x844f('0x35'),_0x844f('0x36')],_0x6cc7ce[_0x844f('0x37')])&&_0x6cc7ce[_0x844f('0x38')]&&!_0x6cc7ce[_0x844f('0x39')]){_0x542472[_0x6cc7ce[_0x844f('0x38')][_0x844f('0x3a')]()]=_0x6cc7ce[_0x844f('0x3b')][_0x844f('0x2f')]();}else if(_[_0x844f('0x34')]([_0x844f('0x35'),_0x844f('0x36')],_0x6cc7ce['type'])&&_0x6cc7ce[_0x844f('0x3c')]&&_0x6cc7ce['customField']){_0x542472['custom_fields']['push']({'id':_0x6cc7ce[_0x844f('0x3c')],'value':_0x6cc7ce[_0x844f('0x3b')][_0x844f('0x2f')]()});}else if(_0x6cc7ce[_0x844f('0x37')]===_0x844f('0x3d')&&_0x6cc7ce[_0x844f('0x3e')]&&_0x6cc7ce[_0x844f('0x3c')]&&_0x6cc7ce['customField']){_0x210a3d[_0x6cc7ce[_0x844f('0x3e')]]&&_0x542472[_0x844f('0x18')][_0x844f('0x3f')]({'id':_0x6cc7ce[_0x844f('0x3c')],'value':_0x210a3d[_0x6cc7ce[_0x844f('0x3e')]][_0x844f('0x2f')]()});}else if(_0x6cc7ce[_0x844f('0x37')]===_0x844f('0x40')&&_0x6cc7ce['Variable']&&_0x6cc7ce['Variable'][_0x844f('0x16')]&&_0x6cc7ce[_0x844f('0x3c')]&&_0x6cc7ce['customField']){_0x210a3d[_0x6cc7ce[_0x844f('0x41')][_0x844f('0x16')][_0x844f('0x3a')]()]&&_0x542472[_0x844f('0x18')][_0x844f('0x3f')]({'id':_0x6cc7ce[_0x844f('0x3c')],'value':_0x210a3d[_0x6cc7ce[_0x844f('0x41')]['name'][_0x844f('0x3a')]()][_0x844f('0x2f')]()});}});}return _0x542472;}exports['queue']=function(_0x5989ab,_0x116da9,_0x4cdad7,_0x138118,_0x14d2c3,_0x20a57c){var _0x3b8dae,_0x3e0969;_0x20a57c[_0x844f('0x1b')]=intUtil['stripTrailingSlash'](_0x20a57c['remoteUri']);_0x20a57c['serverUrl']=intUtil['stripTrailingSlash'](_0x20a57c['serverUrl']);if(_0x14d2c3&&_0x14d2c3[_0x844f('0x42')]){logger[_0x844f('0x1d')](_0x844f('0x43'),_0x844f('0x44'));_0x116da9[_0x844f('0x45')]=util['format'](_0x844f('0x46'),_0x20a57c[_0x844f('0x47')],_0x116da9[_0x844f('0x48')],md5(_0x116da9[_0x844f('0x48')]));}else{_0x116da9[_0x844f('0x45')]='';}headers['Authorization']=getAuth(_0x20a57c);return getUser(_0x20a57c,_0x138118[_0x844f('0x24')])[_0x844f('0x1c')](function(_0x1045cd){_0x3b8dae=_0x1045cd;logger[_0x844f('0x1d')](_0x844f('0x49'),_0x3b8dae['id']);return getEndUser(_0x20a57c,_0x116da9['calleridname'],_0x116da9[_0x844f('0x10')]);})[_0x844f('0x1c')](function(_0x542986){_0x3e0969=_0x542986;logger[_0x844f('0x1d')](_0x844f('0x4a'),_0x3e0969['id']);return getTicket(_0x20a57c,_0x3b8dae,_0x3e0969,_0x4cdad7,_0x116da9);})[_0x844f('0x1c')](function(_0x2e1029){if(_0x2e1029&&_0x2e1029['id']){logger[_0x844f('0x1d')](_0x844f('0x1e'));logger[_0x844f('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x2e1029['id']);logger[_0x844f('0x1d')](_0x844f('0x43'),_0x844f('0x4b'));emit(util['format'](_0x844f('0x4c'),_0x138118[_0x844f('0x16')]),_0x844f('0x4d'),{'uri':util[_0x844f('0xe')](_0x844f('0x4e'),_0x20a57c[_0x844f('0x1b')],_0x2e1029['id'])});}})[_0x844f('0x4f')](function(_0x59224a){logger[_0x844f('0x50')](_0x844f('0x43'),JSON[_0x844f('0x51')](_0x59224a));});};exports[_0x844f('0x52')]=function(_0x340290,_0x53cd95,_0x24226a,_0x5e02e0,_0x255516,_0x4a690a,_0x103136){var _0x155501,_0x5c4fe5;_0x4a690a[_0x844f('0x1b')]=intUtil[_0x844f('0x53')](_0x4a690a['remoteUri']);_0x4a690a[_0x844f('0x47')]=intUtil[_0x844f('0x53')](_0x4a690a[_0x844f('0x47')]);if(_0x103136&&_0x103136[_0x844f('0x54')]&&_0x103136[_0x844f('0x54')]!==_0x844f('0x55')){logger[_0x844f('0x1d')](_0x844f('0x56'),_0x844f('0x44'));_0x53cd95[_0x844f('0x45')]=util[_0x844f('0xe')](_0x844f('0x46'),_0x4a690a[_0x844f('0x47')],_0x53cd95['uniqueid'],md5(_0x53cd95[_0x844f('0x48')]));}headers[_0x844f('0x57')]=getAuth(_0x4a690a);return getUser(_0x4a690a,_0x5e02e0[_0x844f('0x24')])['then'](function(_0x4746d0){_0x155501=_0x4746d0;logger[_0x844f('0x1d')](_0x844f('0x49'),_0x155501['id']);return getEndUser(_0x4a690a,_0x53cd95[_0x844f('0x58')],_0x53cd95[_0x844f('0x59')]);})[_0x844f('0x1c')](function(_0x143312){_0x5c4fe5=_0x143312;logger[_0x844f('0x1d')](_0x844f('0x4a'),_0x5c4fe5['id']);return getTicket(_0x4a690a,_0x155501,_0x5c4fe5,_0x24226a,_0x53cd95);})['then'](function(_0x55ebb6){if(_0x55ebb6&&_0x55ebb6['id']){logger[_0x844f('0x1d')](_0x844f('0x1e'));logger[_0x844f('0x1d')](_0x844f('0x5a'),_0x55ebb6['id']);logger[_0x844f('0x1d')](_0x844f('0x56'),_0x844f('0x4b'));emit(util[_0x844f('0xe')]('user:%s',_0x5e02e0[_0x844f('0x16')]),_0x844f('0x4d'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x4a690a[_0x844f('0x1b')],_0x55ebb6['id'])});}})[_0x844f('0x4f')](function(_0x4cdbc1){logger[_0x844f('0x50')](_0x844f('0x56'),JSON['stringify'](_0x4cdbc1));});};exports['unmanaged']=function(_0x137704,_0x59fe79,_0x16c464,_0x410d48,_0x424ad9,_0xd2e346){var _0x4a9c1f,_0x15357a;_0xd2e346[_0x844f('0x1b')]=intUtil[_0x844f('0x53')](_0xd2e346[_0x844f('0x1b')]);_0xd2e346[_0x844f('0x47')]=intUtil[_0x844f('0x53')](_0xd2e346[_0x844f('0x47')]);if(_0x424ad9&&_0x424ad9[_0x844f('0x42')]){logger[_0x844f('0x1d')]('['+_0x59fe79['lastevent']['toUpperCase']()+']',_0x844f('0x44'));_0x59fe79[_0x844f('0x45')]=util[_0x844f('0xe')](_0x844f('0x46'),_0xd2e346[_0x844f('0x47')],_0x59fe79[_0x844f('0x48')],md5(_0x59fe79[_0x844f('0x48')]));}else{_0x59fe79['recordingURL']='';}headers[_0x844f('0x57')]=getAuth(_0xd2e346);return getUser(_0xd2e346,'')[_0x844f('0x1c')](function(_0x556f83){_0x4a9c1f=_0x556f83;logger[_0x844f('0x1d')]('The\x20User\x20ID\x20is:',_0x4a9c1f['id']);return getEndUser(_0xd2e346,_0x59fe79[_0x844f('0x5b')],_0x59fe79[_0x844f('0x10')]);})['then'](function(_0x3cd3e9){_0x15357a=_0x3cd3e9;logger[_0x844f('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x15357a['id']);return getTicket(_0xd2e346,_0x4a9c1f,_0x15357a,_0x16c464,_0x59fe79);})[_0x844f('0x1c')](function(_0x227a9e){if(_0x227a9e){logger[_0x844f('0x1d')](_0x844f('0x1e'));logger[_0x844f('0x1d')](_0x844f('0x5a'),_0x227a9e['id']);}})[_0x844f('0x4f')](function(_0x20f33b){logger[_0x844f('0x50')]('['+_0x59fe79[_0x844f('0x5c')][_0x844f('0x5d')]()+']',JSON[_0x844f('0x51')](_0x20f33b));});}; \ No newline at end of file +var _0x76da=['push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','unmanaged','lastevent','calleridnum','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','merge','format','Caller\x20-\x20%s','Subjects','getString','Descriptions','
','Tags','name','mapValues','custom_fields','value','remoteUri','POST','info','Ticket\x20created!','length','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','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','toString','base64','[HTTP]','stringify','defaults','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField'];(function(_0x10bd94,_0x46b509){var _0x364677=function(_0x417683){while(--_0x417683){_0x10bd94['push'](_0x10bd94['shift']());}};_0x364677(++_0x46b509);}(_0x76da,0x121));var _0xa76d=function(_0x1bd482,_0x464db6){_0x1bd482=_0x1bd482-0x0;var _0x891abc=_0x76da[_0x1bd482];return _0x891abc;};'use strict';var _=require(_0xa76d('0x0'));var rp=require(_0xa76d('0x1'));var md5=require(_0xa76d('0x2'));var util=require('util');var Redis=require(_0xa76d('0x3'));var intUtil=require(_0xa76d('0x4'));var config=require(_0xa76d('0x5'));var logger=require('../../../../config/logger')(_0xa76d('0x6'));config[_0xa76d('0x7')]=_['defaults'](config[_0xa76d('0x7')],{'host':_0xa76d('0x8'),'port':0x18eb});var io=require(_0xa76d('0x9'))(new Redis(config[_0xa76d('0x7')]));var headers={'Content-Type':'application/json','Accept':_0xa76d('0xa')};function emit(_0x4cbf25,_0x52f7ed,_0x333b23){io['to'](_0x4cbf25)['emit'](_0x52f7ed,_0x333b23);}function getTicket(_0x49439b,_0x2a5ef7,_0x16c2eb,_0x45fc9c,_0x5b91b9){logger['info']('Creating\x20new\x20ticket...');var _0x5278c2=_[_0xa76d('0xb')]({'responder_id':_0x2a5ef7['id'],'requester_id':_0x16c2eb['id'],'name':util[_0xa76d('0xc')](_0xa76d('0xd'),_0x5b91b9['calleridname']),'phone':_0x5b91b9['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x45fc9c[_0xa76d('0xe')],_0x5b91b9,'\x20'),'description':intUtil[_0xa76d('0xf')](_0x45fc9c[_0xa76d('0x10')],_0x5b91b9,_0xa76d('0x11')),'tags':getTags(_0x45fc9c[_0xa76d('0x12')],_0xa76d('0x13'))},getCustomFields(_0x45fc9c['Fields'],_0x5b91b9));_0x5278c2['custom_fields']=_[_0xa76d('0x14')](_['keyBy'](_0x5278c2[_0xa76d('0x15')],'id'),_0xa76d('0x16'));return request({'uri':util[_0xa76d('0xc')]('%s/api/v2/tickets',_0x49439b[_0xa76d('0x17')]),'method':_0xa76d('0x18'),'body':_0x5278c2})['then'](function(_0x8413bc){logger[_0xa76d('0x19')](_0xa76d('0x1a'));return _0x8413bc;});}function getUser(_0x194e53,_0x5eda65){if(intUtil['validateEmail'](_0x5eda65)){return request({'uri':util['format']('%s/api/v2/agents',_0x194e53['remoteUri']),'qs':{'email':_0x5eda65}})['then'](function(_0x5269d1){if(_0x5269d1[_0xa76d('0x1b')]){logger['info']('Agent\x20found!');return _['find'](_0x5269d1,function(_0x4afc2e){return _0x4afc2e[_0xa76d('0x1c')][_0xa76d('0x1d')]===_0x5eda65;});}else{logger['info'](_0xa76d('0x1e'));return request({'uri':util[_0xa76d('0xc')](_0xa76d('0x1f'),_0x194e53[_0xa76d('0x17')])})[_0xa76d('0x20')](function(_0x4eda5a){logger[_0xa76d('0x19')](_0xa76d('0x21'));return _0x4eda5a;});}});}else{logger['info'](_0xa76d('0x22'));return request({'uri':util['format'](_0xa76d('0x1f'),_0x194e53['remoteUri'])})[_0xa76d('0x20')](function(_0x2aaf54){logger['info'](_0xa76d('0x21'));return _0x2aaf54;});}}function getEndUser(_0x55e216,_0x49bf19,_0xbb1fc0){logger[_0xa76d('0x19')](_0xa76d('0x23'),_0xbb1fc0);return request({'uri':util[_0xa76d('0xc')](_0xa76d('0x24'),_0x55e216['remoteUri']),'qs':{'phone':_0xbb1fc0}})[_0xa76d('0x20')](function(_0x512bb5){if(_0x512bb5[_0xa76d('0x1b')]){logger[_0xa76d('0x19')](_0xa76d('0x25'));return _['find'](_0x512bb5,{'phone':_0xbb1fc0});}else{logger['info'](_0xa76d('0x26'));return request({'uri':util[_0xa76d('0xc')](_0xa76d('0x24'),_0x55e216[_0xa76d('0x17')]),'method':_0xa76d('0x18'),'body':{'name':_0x49bf19,'phone':_0xbb1fc0}})['then'](function(_0x58d4d0){logger[_0xa76d('0x19')](_0xa76d('0x27'));return _0x58d4d0;});}});}function getAuth(_0x5a1b40){return util[_0xa76d('0xc')]('Basic\x20%s',new Buffer(_0x5a1b40['apiKey']+':X')[_0xa76d('0x28')](_0xa76d('0x29')));}function request(_0x264411){logger['debug'](_0xa76d('0x2a'),JSON[_0xa76d('0x2b')](_0x264411));return rp(_[_0xa76d('0x2c')](_0x264411,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x42bdc7,_0x19a954){var _0x8b288a=[];if(_0x42bdc7&&_0x42bdc7['length']>0x0){_0x8b288a=_['map'](_0x42bdc7,_0x19a954);}return _0x8b288a;}function getCustomFields(_0x17b79e,_0x2c339){var _0x38789b=[];var _0x1be08e={'custom_fields':[]};if(_0x17b79e[_0xa76d('0x1b')]>0x0){_[_0xa76d('0x2d')](_0x17b79e,function(_0x4414ce){if(_[_0xa76d('0x2e')](['string',_0xa76d('0x2f')],_0x4414ce[_0xa76d('0x30')])&&_0x4414ce[_0xa76d('0x31')]&&!_0x4414ce[_0xa76d('0x32')]){_0x1be08e[_0x4414ce['nameField'][_0xa76d('0x33')]()]=_0x4414ce[_0xa76d('0x34')][_0xa76d('0x28')]();}else if(_[_0xa76d('0x2e')]([_0xa76d('0x35'),'picklist'],_0x4414ce['type'])&&_0x4414ce[_0xa76d('0x36')]&&_0x4414ce[_0xa76d('0x32')]){_0x1be08e['custom_fields'][_0xa76d('0x37')]({'id':_0x4414ce[_0xa76d('0x36')],'value':_0x4414ce[_0xa76d('0x34')]['toString']()});}else if(_0x4414ce[_0xa76d('0x30')]===_0xa76d('0x38')&&_0x4414ce[_0xa76d('0x39')]&&_0x4414ce[_0xa76d('0x36')]&&_0x4414ce[_0xa76d('0x32')]){_0x2c339[_0x4414ce['variableName']]&&_0x1be08e[_0xa76d('0x15')][_0xa76d('0x37')]({'id':_0x4414ce[_0xa76d('0x36')],'value':_0x2c339[_0x4414ce['variableName']][_0xa76d('0x28')]()});}else if(_0x4414ce[_0xa76d('0x30')]===_0xa76d('0x3a')&&_0x4414ce['Variable']&&_0x4414ce[_0xa76d('0x3b')][_0xa76d('0x13')]&&_0x4414ce[_0xa76d('0x36')]&&_0x4414ce[_0xa76d('0x32')]){_0x2c339[_0x4414ce[_0xa76d('0x3b')][_0xa76d('0x13')][_0xa76d('0x33')]()]&&_0x1be08e[_0xa76d('0x15')][_0xa76d('0x37')]({'id':_0x4414ce[_0xa76d('0x36')],'value':_0x2c339[_0x4414ce['Variable'][_0xa76d('0x13')][_0xa76d('0x33')]()][_0xa76d('0x28')]()});}});}return _0x1be08e;}exports['queue']=function(_0x5d76cb,_0x5b8ed3,_0x27fa20,_0x5c1666,_0x1e7727,_0x3d514c){var _0x34526f,_0x432606;_0x3d514c[_0xa76d('0x17')]=intUtil[_0xa76d('0x3c')](_0x3d514c[_0xa76d('0x17')]);_0x3d514c['serverUrl']=intUtil[_0xa76d('0x3c')](_0x3d514c[_0xa76d('0x3d')]);if(_0x1e7727&&_0x1e7727[_0xa76d('0x3e')]){logger[_0xa76d('0x19')](_0xa76d('0x3f'),_0xa76d('0x40'));_0x5b8ed3[_0xa76d('0x41')]=util['format'](_0xa76d('0x42'),_0x3d514c[_0xa76d('0x3d')],_0x5b8ed3['uniqueid'],md5(_0x5b8ed3[_0xa76d('0x43')]));}else{_0x5b8ed3['recordingURL']='';}headers[_0xa76d('0x44')]=getAuth(_0x3d514c);return getUser(_0x3d514c,_0x5c1666[_0xa76d('0x1d')])[_0xa76d('0x20')](function(_0x15b50c){_0x34526f=_0x15b50c;logger[_0xa76d('0x19')](_0xa76d('0x45'),_0x34526f['id']);return getEndUser(_0x3d514c,_0x5b8ed3[_0xa76d('0x46')],_0x5b8ed3['calleridnum']);})[_0xa76d('0x20')](function(_0x5b91d3){_0x432606=_0x5b91d3;logger[_0xa76d('0x19')](_0xa76d('0x47'),_0x432606['id']);return getTicket(_0x3d514c,_0x34526f,_0x432606,_0x27fa20,_0x5b8ed3);})['then'](function(_0x255a7b){if(_0x255a7b&&_0x255a7b['id']){logger['info'](_0xa76d('0x1a'));logger[_0xa76d('0x19')]('The\x20Ticket\x20ID\x20is:',_0x255a7b['id']);logger[_0xa76d('0x19')](_0xa76d('0x3f'),_0xa76d('0x48'));emit(util['format']('user:%s',_0x5c1666[_0xa76d('0x13')]),_0xa76d('0x49'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x3d514c[_0xa76d('0x17')],_0x255a7b['id'])});}})[_0xa76d('0x4a')](function(_0x50b891){logger[_0xa76d('0x4b')](_0xa76d('0x3f'),JSON[_0xa76d('0x2b')](_0x50b891));});};exports['outbound']=function(_0x3962fb,_0x447cd6,_0x38d48f,_0x6f87f7,_0xc66d,_0x325e40,_0x3e2f8b){var _0x24ad3d,_0x279729;_0x325e40[_0xa76d('0x17')]=intUtil[_0xa76d('0x3c')](_0x325e40[_0xa76d('0x17')]);_0x325e40[_0xa76d('0x3d')]=intUtil['stripTrailingSlash'](_0x325e40[_0xa76d('0x3d')]);if(_0x3e2f8b&&_0x3e2f8b[_0xa76d('0x4c')]&&_0x3e2f8b['recordingFormat']!=='none'){logger[_0xa76d('0x19')](_0xa76d('0x4d'),_0xa76d('0x40'));_0x447cd6[_0xa76d('0x41')]=util['format'](_0xa76d('0x42'),_0x325e40[_0xa76d('0x3d')],_0x447cd6['uniqueid'],md5(_0x447cd6[_0xa76d('0x43')]));}headers[_0xa76d('0x44')]=getAuth(_0x325e40);return getUser(_0x325e40,_0x6f87f7[_0xa76d('0x1d')])['then'](function(_0x40f03e){_0x24ad3d=_0x40f03e;logger['info']('The\x20User\x20ID\x20is:',_0x24ad3d['id']);return getEndUser(_0x325e40,_0x447cd6[_0xa76d('0x4e')],_0x447cd6[_0xa76d('0x4f')]);})[_0xa76d('0x20')](function(_0x5d4440){_0x279729=_0x5d4440;logger['info'](_0xa76d('0x47'),_0x279729['id']);return getTicket(_0x325e40,_0x24ad3d,_0x279729,_0x38d48f,_0x447cd6);})['then'](function(_0x574733){if(_0x574733&&_0x574733['id']){logger[_0xa76d('0x19')](_0xa76d('0x1a'));logger[_0xa76d('0x19')](_0xa76d('0x50'),_0x574733['id']);logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa76d('0xc')](_0xa76d('0x51'),_0x6f87f7[_0xa76d('0x13')]),_0xa76d('0x49'),{'uri':util['format'](_0xa76d('0x52'),_0x325e40[_0xa76d('0x17')],_0x574733['id'])});}})[_0xa76d('0x4a')](function(_0x1120e0){logger[_0xa76d('0x4b')](_0xa76d('0x4d'),JSON[_0xa76d('0x2b')](_0x1120e0));});};exports[_0xa76d('0x53')]=function(_0x5174eb,_0x1f60cf,_0x1c2385,_0x3a1d87,_0x1f45bc,_0x5c2417){var _0x5c8d85,_0x396de9;_0x5c2417[_0xa76d('0x17')]=intUtil[_0xa76d('0x3c')](_0x5c2417[_0xa76d('0x17')]);_0x5c2417['serverUrl']=intUtil[_0xa76d('0x3c')](_0x5c2417[_0xa76d('0x3d')]);if(_0x1f45bc&&_0x1f45bc[_0xa76d('0x3e')]){logger[_0xa76d('0x19')]('['+_0x1f60cf[_0xa76d('0x54')]['toUpperCase']()+']',_0xa76d('0x40'));_0x1f60cf[_0xa76d('0x41')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c2417['serverUrl'],_0x1f60cf[_0xa76d('0x43')],md5(_0x1f60cf['uniqueid']));}else{_0x1f60cf['recordingURL']='';}headers[_0xa76d('0x44')]=getAuth(_0x5c2417);return getUser(_0x5c2417,'')[_0xa76d('0x20')](function(_0x54c0bb){_0x5c8d85=_0x54c0bb;logger[_0xa76d('0x19')](_0xa76d('0x45'),_0x5c8d85['id']);return getEndUser(_0x5c2417,_0x1f60cf[_0xa76d('0x46')],_0x1f60cf[_0xa76d('0x55')]);})[_0xa76d('0x20')](function(_0x6413ad){_0x396de9=_0x6413ad;logger['info'](_0xa76d('0x47'),_0x396de9['id']);return getTicket(_0x5c2417,_0x5c8d85,_0x396de9,_0x1c2385,_0x1f60cf);})[_0xa76d('0x20')](function(_0x507f30){if(_0x507f30){logger['info'](_0xa76d('0x1a'));logger['info'](_0xa76d('0x50'),_0x507f30['id']);}})[_0xa76d('0x4a')](function(_0x155202){logger[_0xa76d('0x4b')]('['+_0x1f60cf['lastevent']['toUpperCase']()+']',JSON[_0xa76d('0x2b')](_0x155202));});}; \ 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 2d68295..8532ee9 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 _0x2b6b=['endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','toLowerCase','outbound','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','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','bluebird','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','then','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','User\x20found:','Admin\x20selected','userId','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','contactNumber','mobile_number'];(function(_0x1946aa,_0x493b74){var _0x3c4133=function(_0xdce9b){while(--_0xdce9b){_0x1946aa['push'](_0x1946aa['shift']());}};_0x3c4133(++_0x493b74);}(_0x2b6b,0x81));var _0xb2b6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2b6b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xb2b6('0x0'));var rp=require(_0xb2b6('0x1'));var md5=require(_0xb2b6('0x2'));var util=require(_0xb2b6('0x3'));var moment=require('moment');var Promise=require(_0xb2b6('0x4'));var Redis=require(_0xb2b6('0x5'));var intUtil=require('./util');var config=require(_0xb2b6('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0xb2b6('0x7')]=_[_0xb2b6('0x8')](config['redis'],{'host':_0xb2b6('0x9'),'port':0x18eb});var io=require(_0xb2b6('0xa'))(new Redis(config[_0xb2b6('0x7')]));function getAdminId(_0x44d5e8,_0x27518d,_0x56128c,_0xdd42c6){return new Promise(function(_0x8d96a2,_0x5aed0f){var _0x221d07=![];var _0x2b4b1f={'method':_0xb2b6('0xb'),'uri':_0xdd42c6+_0xb2b6('0xc'),'json':!![]};_0x2b4b1f[_0xb2b6('0xd')]=_0x56128c;logger[_0xb2b6('0xe')](_0xb2b6('0xf'));return rp(_0x2b4b1f)['then'](function(_0xe8be5a){if(_0xe8be5a){var _0x15dd50=_0xe8be5a['users'];var _0x20dbd7=null;for(_0x20dbd7=0x0;_0x20dbd7<_0x15dd50['length'];_0x20dbd7++){if(_0x15dd50[_0x20dbd7][_0xb2b6('0x10')]===_0x44d5e8['adminEmail']){_0x44d5e8[_0xb2b6('0x11')]=_0x15dd50[_0x20dbd7]['id'];_0x221d07=!![];}}if(_0x221d07){logger[_0xb2b6('0xe')](_0xb2b6('0x12'),_0x44d5e8[_0xb2b6('0x11')]);_0x8d96a2(_0x44d5e8);}else{_0x5aed0f({'statusCode':0x194,'message':_0xb2b6('0x13')});}}else{_0x5aed0f({'statusCode':0x194,'message':_0xb2b6('0x13')});}})[_0xb2b6('0x14')](function(_0x38a6ea){logger[_0xb2b6('0x15')]('['+[_0x27518d[_0xb2b6('0x16')]()]+']',_0x38a6ea['message']);_0x5aed0f(_0x38a6ea);});});}function getUser(_0x18213f,_0x652a5c,_0x1a6fce){return function(_0x2f8bcd){return new Promise(function(_0x1ccf73,_0x542c5e){var _0x2be69d={'method':'GET','uri':_0x1a6fce+_0xb2b6('0xc'),'json':!![]};_0x2be69d[_0xb2b6('0xd')]=_0x652a5c;logger['info'](_0xb2b6('0x17'));return rp(_0x2be69d)[_0xb2b6('0x18')](function(_0x4e038d){if(_0x4e038d){var _0x1ccda7=_0x4e038d[_0xb2b6('0x19')];var _0x8cf263=![];var _0x46da81=null;if(_0x2f8bcd['agentEmail']!==null){logger['info'](_0xb2b6('0x1a'),_0x2f8bcd[_0xb2b6('0x1b')]);_0x2f8bcd[_0xb2b6('0x1c')]=_0x2f8bcd[_0xb2b6('0x1b')];for(_0x46da81=0x0;_0x46da81<_0x1ccda7[_0xb2b6('0x1d')];_0x46da81++){if(_0x1ccda7[_0x46da81]['email']===_0x2f8bcd[_0xb2b6('0x1b')]){_0x8cf263=!![];_0x2f8bcd['userId']=_0x1ccda7[_0x46da81]['id'];logger[_0xb2b6('0xe')](_0xb2b6('0x1e'),_0x2f8bcd['userId']);}}}if(!_0x8cf263){logger[_0xb2b6('0xe')](_0xb2b6('0x1f'));_0x2f8bcd[_0xb2b6('0x1c')]=_0x2f8bcd['adminEmail'];_0x2f8bcd[_0xb2b6('0x20')]=_0x2f8bcd[_0xb2b6('0x11')];_0x8cf263=!![];}if(_0x8cf263){_0x1ccf73(_0x2f8bcd);}else{_0x542c5e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x542c5e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xb2b6('0x14')](function(_0x545f2a){logger[_0xb2b6('0x15')]('['+[_0x18213f[_0xb2b6('0x16')]()]+']',_0x545f2a[_0xb2b6('0x21')]);_0x542c5e(_0x545f2a);});});};}function searchContact(_0x3a5fd0,_0x3d0cc5,_0xaf2353,_0x4c1bc0){return new Promise(function(_0x59a535,_0x320f78){var _0x14b98e={'method':'GET','headers':_0x3d0cc5,'uri':_0x3a5fd0+_0xb2b6('0x22')+_0x4c1bc0+_0xb2b6('0x23')+_0xaf2353+_0xb2b6('0x24'),'json':!![]};rp(_0x14b98e)[_0xb2b6('0x18')](function(_0x273fe5){var _0x31bda6=_[_0xb2b6('0x25')](_0x273fe5[_0xb2b6('0x26')][_0xb2b6('0x26')],[_0xaf2353,_0x4c1bc0]);_0x59a535(_0x31bda6);})[_0xb2b6('0x14')](function(_0x4e3ce8){_0x320f78(_0x4e3ce8);});});}function getEndUser(_0x5014d9,_0x555b82,_0x56373e){return function(_0x49b088){return new Promise(function(_0x2d2170,_0x432030){logger['info'](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x49b088[_0xb2b6('0x27')]));searchContact(_0x56373e,_0x555b82,_0xb2b6('0x28'),_0x49b088['contactNumber'])[_0xb2b6('0x18')](function(_0x226d41){if(_0x226d41){_0x49b088[_0xb2b6('0x29')]=_0x226d41['id'];logger[_0xb2b6('0xe')]('Contact\x20found\x20mobile_number:',_0x49b088['endUserId']);return _0x2d2170(_0x49b088);}searchContact(_0x56373e,_0x555b82,_0xb2b6('0x2a'),_0x49b088[_0xb2b6('0x27')])[_0xb2b6('0x18')](function(_0x37bca3){if(_0x37bca3){_0x49b088[_0xb2b6('0x29')]=_0x37bca3['id'];logger[_0xb2b6('0xe')](_0xb2b6('0x2b'),_0x49b088[_0xb2b6('0x29')]);return _0x2d2170(_0x49b088);}createEndUser(_0x49b088,_0x5014d9,_0x555b82,_0x56373e)['then'](function(_0x3c1845){logger[_0xb2b6('0xe')](_0xb2b6('0x2c'),_0x3c1845[_0xb2b6('0x29')]);return _0x2d2170(_0x3c1845);});});})['catch'](function(_0x2c8052){_0x432030(_0x2c8052);});});};}function createEndUser(_0x440b91,_0xa45f8a,_0x12c925,_0x4a6157){return new Promise(function(_0x1306da,_0x29cca8){var _0xa3f7c6=moment();var _0x2bd754={'method':'POST','uri':_0x4a6157+_0xb2b6('0x2d'),'body':{'contact':{'last_name':_0x440b91[_0xb2b6('0x27')],'work_number':_0x440b91[_0xb2b6('0x27')],'mobile_number':_0x440b91[_0xb2b6('0x27')],'owner_id':_0x440b91[_0xb2b6('0x20')],'created_at':_0xa3f7c6[_0xb2b6('0x2e')](_0xb2b6('0x2f'))}},'json':!![]};_0x2bd754[_0xb2b6('0xd')]=_0x12c925;logger[_0xb2b6('0xe')](_0xb2b6('0x30'));return rp(_0x2bd754)[_0xb2b6('0x18')](function(_0x508dfc){_0x440b91[_0xb2b6('0x29')]=_0x508dfc[_0xb2b6('0x31')]['id'];_0x1306da(_0x440b91);})[_0xb2b6('0x14')](function(_0x1352fd){logger[_0xb2b6('0x15')]('['+[_0xa45f8a[_0xb2b6('0x16')]()]+']',_0x1352fd[_0xb2b6('0x21')]);_0x29cca8(_0x1352fd['message']);});});}function getTicket(_0x4fe8ee,_0x1a0308,_0xf75387,_0xc2ec52,_0x4ecba2){return function(_0x275e4c){logger[_0xb2b6('0xe')](_0xb2b6('0x32'));return new Promise(function(_0xfd3cf3,_0x4d858f){var _0x1ad932=moment();var _0x343239={'method':'POST','uri':_0xf75387+_0xb2b6('0x33'),'body':{'title':intUtil[_0xb2b6('0x34')](_0xc2ec52['Subjects'],_0x4ecba2,'\x20'),'description':intUtil[_0xb2b6('0x34')](_0xc2ec52[_0xb2b6('0x35')],_0x4ecba2,'\x0a'),'owner_id':_0x275e4c[_0xb2b6('0x20')],'creater_id':_0x275e4c[_0xb2b6('0x11')],'targetable_id':_0x275e4c[_0xb2b6('0x29')],'targetable_type':_0xb2b6('0x36'),'created_at':_0x1ad932[_0xb2b6('0x2e')](_0xb2b6('0x2f')),'due_date':_0x1ad932[_0xb2b6('0x37')](0x1e,'m')[_0xb2b6('0x2e')](_0xb2b6('0x2f'))},'json':!![]};_0x343239[_0xb2b6('0xd')]=_0x1a0308;return rp(_0x343239)[_0xb2b6('0x18')](function(_0x495572){_0x275e4c[_0xb2b6('0x38')]=_0x495572[_0xb2b6('0x39')]['id'];logger[_0xb2b6('0xe')]('Task\x20created:',_0x275e4c['ticketId']);_0xfd3cf3(_0x275e4c);})[_0xb2b6('0x14')](function(_0x1a0499){logger['error']('['+[_0x4fe8ee[_0xb2b6('0x16')]()]+']',_0x1a0499[_0xb2b6('0x21')]);_0x4d858f(_0x1a0499[_0xb2b6('0x21')]);});});};}function emit(_0x33843d,_0x5e2936,_0x31e045){var _0x547f86={'uri':_0x33843d+_0xb2b6('0x3a')+_0x31e045};io['to'](util['format'](_0xb2b6('0x3b'),_0x5e2936))[_0xb2b6('0x3c')](_0xb2b6('0x3d'),_0x547f86);}exports['cs']=function(_0x3a14fe,_0x4bca4a,_0x4bfbaf,_0x4e36da,_0x5de4d4,_0x274978,_0x347217,_0x2fbc57){var _0x5d8ac8={};var _0x4868df={'Authorization':_0xb2b6('0x3e')+_0x274978[_0xb2b6('0x3f')]};_0x274978['remoteUri']=intUtil['stripTrailingSlash'](_0x274978['remoteUri']);_0x274978['serverUrl']=intUtil[_0xb2b6('0x40')](_0x274978[_0xb2b6('0x41')]);var _0x23b96e=_0x274978[_0xb2b6('0x42')];_0x5d8ac8['adminEmail']=_0x274978['username'];_0x5d8ac8[_0xb2b6('0x27')]=_0x2fbc57[_0xb2b6('0x43')]()===_0xb2b6('0x44')?_0x4bca4a[_0xb2b6('0x45')]:_0x4bca4a['calleridnum'];_0x5d8ac8[_0xb2b6('0x46')]=_0x2fbc57==='queue'||_0x2fbc57==='unmanaged'?_0xb2b6('0x47'):_0xb2b6('0x44');if(_0x4e36da){_0x5d8ac8[_0xb2b6('0x1b')]=_0x4e36da[_0xb2b6('0x10')];}var _0x5eaa75=util['format'](_0xb2b6('0x48'),_0x274978['serverUrl'],_0x4bca4a[_0xb2b6('0x49')],md5(_0x4bca4a[_0xb2b6('0x49')]));if(_0x5de4d4&&_0x5de4d4[_0xb2b6('0x4a')]){logger[_0xb2b6('0xe')]('[QUEUE]',_0xb2b6('0x4b'));_0x4bca4a['recordingURL']=_0x5eaa75;}else if(_0x347217&&_0x347217['recordingFormat']&&_0x347217[_0xb2b6('0x4c')]!==_0xb2b6('0x4d')){logger[_0xb2b6('0xe')]('[OUTBOUND]',_0xb2b6('0x4b'));_0x4bca4a[_0xb2b6('0x4e')]=_0x5eaa75;}else{_0x4bca4a[_0xb2b6('0x4e')]='';}return getAdminId(_0x5d8ac8,_0x2fbc57,_0x4868df,_0x23b96e)[_0xb2b6('0x18')](getUser(_0x2fbc57,_0x4868df,_0x23b96e))[_0xb2b6('0x18')](getEndUser(_0x2fbc57,_0x4868df,_0x23b96e))[_0xb2b6('0x18')](getTicket(_0x2fbc57,_0x4868df,_0x23b96e,_0x4bfbaf,_0x4bca4a))[_0xb2b6('0x18')](function(_0x24f2d4){logger[_0xb2b6('0xe')](util[_0xb2b6('0x2e')](_0xb2b6('0x4f'),_0x24f2d4[_0xb2b6('0x38')]));if(_0x2fbc57!==_0xb2b6('0x50')){logger[_0xb2b6('0xe')]('['+[_0x2fbc57[_0xb2b6('0x16')]()]+']',_0xb2b6('0x51'));emit(_0x23b96e,_0x4e36da[_0xb2b6('0x52')],_0x24f2d4[_0xb2b6('0x29')]);}})['catch'](function(_0x271df5){logger['error']('['+[_0x2fbc57[_0xb2b6('0x16')]()]+_0xb2b6('0x53'),util[_0xb2b6('0x54')](_0x271df5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9dec=['Admin\x20selected','catch','message','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:'];(function(_0x18ae14,_0x942c83){var _0x3d2767=function(_0x4726c2){while(--_0x4726c2){_0x18ae14['push'](_0x18ae14['shift']());}};_0x3d2767(++_0x942c83);}(_0x9dec,0x1d8));var _0xc9de=function(_0x270012,_0xe0c38b){_0x270012=_0x270012-0x0;var _0x1c2b99=_0x9dec[_0x270012];return _0x1c2b99;};'use strict';var _=require('lodash');var rp=require(_0xc9de('0x0'));var md5=require(_0xc9de('0x1'));var util=require(_0xc9de('0x2'));var moment=require(_0xc9de('0x3'));var Promise=require(_0xc9de('0x4'));var Redis=require(_0xc9de('0x5'));var intUtil=require(_0xc9de('0x6'));var config=require('../../../../config/environment');var logger=require(_0xc9de('0x7'))(_0xc9de('0x8'));config[_0xc9de('0x9')]=_[_0xc9de('0xa')](config[_0xc9de('0x9')],{'host':_0xc9de('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc9de('0x9')]));function getAdminId(_0x2a6266,_0x5c530a,_0x2d19b3,_0x51fbaf){return new Promise(function(_0x55db9a,_0x249ddb){var _0x5632de=![];var _0x591a78={'method':_0xc9de('0xc'),'uri':_0x51fbaf+_0xc9de('0xd'),'json':!![]};_0x591a78[_0xc9de('0xe')]=_0x2d19b3;logger['info'](_0xc9de('0xf'));return rp(_0x591a78)[_0xc9de('0x10')](function(_0x272934){if(_0x272934){var _0x43368d=_0x272934[_0xc9de('0x11')];var _0x3cd057=null;for(_0x3cd057=0x0;_0x3cd057<_0x43368d[_0xc9de('0x12')];_0x3cd057++){if(_0x43368d[_0x3cd057][_0xc9de('0x13')]===_0x2a6266[_0xc9de('0x14')]){_0x2a6266[_0xc9de('0x15')]=_0x43368d[_0x3cd057]['id'];_0x5632de=!![];}}if(_0x5632de){logger['info']('Admin\x20found:',_0x2a6266[_0xc9de('0x15')]);_0x55db9a(_0x2a6266);}else{_0x249ddb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x249ddb({'statusCode':0x194,'message':_0xc9de('0x16')});}})['catch'](function(_0x311ce7){logger[_0xc9de('0x17')]('['+[_0x5c530a[_0xc9de('0x18')]()]+']',_0x311ce7['message']);_0x249ddb(_0x311ce7);});});}function getUser(_0x253f83,_0x49f2fd,_0x5dc103){return function(_0x496542){return new Promise(function(_0xb80f8d,_0xa30cf0){var _0x3e010c={'method':_0xc9de('0xc'),'uri':_0x5dc103+_0xc9de('0xd'),'json':!![]};_0x3e010c[_0xc9de('0xe')]=_0x49f2fd;logger[_0xc9de('0x19')](_0xc9de('0x1a'));return rp(_0x3e010c)[_0xc9de('0x10')](function(_0x157ca2){if(_0x157ca2){var _0x1da604=_0x157ca2[_0xc9de('0x11')];var _0x122b8c=![];var _0x1dbfb5=null;if(_0x496542[_0xc9de('0x1b')]!==null){logger[_0xc9de('0x19')](_0xc9de('0x1c'),_0x496542[_0xc9de('0x1b')]);_0x496542[_0xc9de('0x1d')]=_0x496542[_0xc9de('0x1b')];for(_0x1dbfb5=0x0;_0x1dbfb5<_0x1da604['length'];_0x1dbfb5++){if(_0x1da604[_0x1dbfb5][_0xc9de('0x13')]===_0x496542[_0xc9de('0x1b')]){_0x122b8c=!![];_0x496542[_0xc9de('0x1e')]=_0x1da604[_0x1dbfb5]['id'];logger[_0xc9de('0x19')](_0xc9de('0x1f'),_0x496542['userId']);}}}if(!_0x122b8c){logger['info'](_0xc9de('0x20'));_0x496542['userEmail']=_0x496542[_0xc9de('0x14')];_0x496542[_0xc9de('0x1e')]=_0x496542['adminId'];_0x122b8c=!![];}if(_0x122b8c){_0xb80f8d(_0x496542);}else{_0xa30cf0({'statusCode':0x194,'message':_0xc9de('0x16')});}}else{_0xa30cf0({'statusCode':0x194,'message':_0xc9de('0x16')});}})[_0xc9de('0x21')](function(_0x1cdcbd){logger[_0xc9de('0x17')]('['+[_0x253f83[_0xc9de('0x18')]()]+']',_0x1cdcbd[_0xc9de('0x22')]);_0xa30cf0(_0x1cdcbd);});});};}function searchContact(_0x172400,_0x5ca64a,_0xb1e2fc,_0x119979){return new Promise(function(_0x3716b5,_0x54131e){var _0x35cd14={'method':_0xc9de('0xc'),'headers':_0x5ca64a,'uri':_0x172400+_0xc9de('0x23')+_0x119979+_0xc9de('0x24')+_0xb1e2fc+_0xc9de('0x25'),'json':!![]};rp(_0x35cd14)[_0xc9de('0x10')](function(_0x8849da){var _0x90aa4b=_['find'](_0x8849da[_0xc9de('0x26')]['contacts'],[_0xb1e2fc,_0x119979]);_0x3716b5(_0x90aa4b);})[_0xc9de('0x21')](function(_0x1edc3f){_0x54131e(_0x1edc3f);});});}function getEndUser(_0x358b12,_0x2efc6a,_0x466bfa){return function(_0x31c722){return new Promise(function(_0x499be5,_0x2d06d3){logger[_0xc9de('0x19')](util[_0xc9de('0x27')](_0xc9de('0x28'),_0x31c722[_0xc9de('0x29')]));searchContact(_0x466bfa,_0x2efc6a,_0xc9de('0x2a'),_0x31c722[_0xc9de('0x29')])[_0xc9de('0x10')](function(_0x33de91){if(_0x33de91){_0x31c722[_0xc9de('0x2b')]=_0x33de91['id'];logger[_0xc9de('0x19')](_0xc9de('0x2c'),_0x31c722[_0xc9de('0x2b')]);return _0x499be5(_0x31c722);}searchContact(_0x466bfa,_0x2efc6a,'work_number',_0x31c722['contactNumber'])[_0xc9de('0x10')](function(_0x2dbf6e){if(_0x2dbf6e){_0x31c722[_0xc9de('0x2b')]=_0x2dbf6e['id'];logger[_0xc9de('0x19')](_0xc9de('0x2d'),_0x31c722[_0xc9de('0x2b')]);return _0x499be5(_0x31c722);}createEndUser(_0x31c722,_0x358b12,_0x2efc6a,_0x466bfa)['then'](function(_0x2e3784){logger[_0xc9de('0x19')]('Contact\x20created:',_0x2e3784[_0xc9de('0x2b')]);return _0x499be5(_0x2e3784);});});})[_0xc9de('0x21')](function(_0x5780e7){_0x2d06d3(_0x5780e7);});});};}function createEndUser(_0x5f07e6,_0x2a0640,_0x3e1659,_0x3d5cea){return new Promise(function(_0x4982b9,_0x4e7ed6){var _0x4c84e8=moment();var _0x2cf1ee={'method':'POST','uri':_0x3d5cea+'/api/contacts','body':{'contact':{'last_name':_0x5f07e6['contactNumber'],'work_number':_0x5f07e6[_0xc9de('0x29')],'mobile_number':_0x5f07e6[_0xc9de('0x29')],'owner_id':_0x5f07e6[_0xc9de('0x1e')],'created_at':_0x4c84e8[_0xc9de('0x27')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x2cf1ee['headers']=_0x3e1659;logger[_0xc9de('0x19')](_0xc9de('0x2e'));return rp(_0x2cf1ee)[_0xc9de('0x10')](function(_0x348545){_0x5f07e6[_0xc9de('0x2b')]=_0x348545[_0xc9de('0x2f')]['id'];_0x4982b9(_0x5f07e6);})['catch'](function(_0x3f9486){logger[_0xc9de('0x17')]('['+[_0x2a0640[_0xc9de('0x18')]()]+']',_0x3f9486['message']);_0x4e7ed6(_0x3f9486[_0xc9de('0x22')]);});});}function getTicket(_0x2e9b18,_0x4eed48,_0x25ed1e,_0x3dd5f9,_0x38e0ee){return function(_0x1b70c3){logger[_0xc9de('0x19')](_0xc9de('0x30'));return new Promise(function(_0x42f96e,_0xc95e6d){var _0x22e1e9=moment();var _0x2aa1ba={'method':'POST','uri':_0x25ed1e+_0xc9de('0x31'),'body':{'title':intUtil[_0xc9de('0x32')](_0x3dd5f9[_0xc9de('0x33')],_0x38e0ee,'\x20'),'description':intUtil[_0xc9de('0x32')](_0x3dd5f9[_0xc9de('0x34')],_0x38e0ee,'\x0a'),'owner_id':_0x1b70c3[_0xc9de('0x1e')],'creater_id':_0x1b70c3[_0xc9de('0x15')],'targetable_id':_0x1b70c3[_0xc9de('0x2b')],'targetable_type':_0xc9de('0x35'),'created_at':_0x22e1e9['format'](_0xc9de('0x36')),'due_date':_0x22e1e9['add'](0x1e,'m')[_0xc9de('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x2aa1ba[_0xc9de('0xe')]=_0x4eed48;return rp(_0x2aa1ba)[_0xc9de('0x10')](function(_0x25fc01){_0x1b70c3['ticketId']=_0x25fc01[_0xc9de('0x37')]['id'];logger[_0xc9de('0x19')](_0xc9de('0x38'),_0x1b70c3[_0xc9de('0x39')]);_0x42f96e(_0x1b70c3);})[_0xc9de('0x21')](function(_0x59eb8f){logger[_0xc9de('0x17')]('['+[_0x2e9b18[_0xc9de('0x18')]()]+']',_0x59eb8f['message']);_0xc95e6d(_0x59eb8f['message']);});});};}function emit(_0x447dbb,_0x1d560e,_0x102e9e){var _0x2aeda0={'uri':_0x447dbb+_0xc9de('0x3a')+_0x102e9e};io['to'](util[_0xc9de('0x27')]('user:%s',_0x1d560e))[_0xc9de('0x3b')](_0xc9de('0x3c'),_0x2aeda0);}exports['cs']=function(_0x181eb6,_0x41b012,_0xc8a505,_0xa2bbc2,_0x502a89,_0x1014c1,_0x3eab1c,_0x5c4737){var _0x27a733={};var _0x5573f6={'Authorization':'Token\x20token='+_0x1014c1[_0xc9de('0x3d')]};_0x1014c1[_0xc9de('0x3e')]=intUtil[_0xc9de('0x3f')](_0x1014c1[_0xc9de('0x3e')]);_0x1014c1[_0xc9de('0x40')]=intUtil[_0xc9de('0x3f')](_0x1014c1['serverUrl']);var _0x56f0fa=_0x1014c1[_0xc9de('0x3e')];_0x27a733[_0xc9de('0x14')]=_0x1014c1[_0xc9de('0x41')];_0x27a733[_0xc9de('0x29')]=_0x5c4737[_0xc9de('0x42')]()===_0xc9de('0x43')?_0x41b012['destcalleridnum']:_0x41b012[_0xc9de('0x44')];_0x27a733[_0xc9de('0x45')]=_0x5c4737===_0xc9de('0x46')||_0x5c4737===_0xc9de('0x47')?_0xc9de('0x46'):_0xc9de('0x43');if(_0xa2bbc2){_0x27a733['agentEmail']=_0xa2bbc2[_0xc9de('0x13')];}var _0x2c5c48=util[_0xc9de('0x27')](_0xc9de('0x48'),_0x1014c1[_0xc9de('0x40')],_0x41b012[_0xc9de('0x49')],md5(_0x41b012[_0xc9de('0x49')]));if(_0x502a89&&_0x502a89[_0xc9de('0x4a')]){logger[_0xc9de('0x19')](_0xc9de('0x4b'),_0xc9de('0x4c'));_0x41b012[_0xc9de('0x4d')]=_0x2c5c48;}else if(_0x3eab1c&&_0x3eab1c[_0xc9de('0x4e')]&&_0x3eab1c[_0xc9de('0x4e')]!=='none'){logger[_0xc9de('0x19')](_0xc9de('0x4f'),_0xc9de('0x4c'));_0x41b012[_0xc9de('0x4d')]=_0x2c5c48;}else{_0x41b012[_0xc9de('0x4d')]='';}return getAdminId(_0x27a733,_0x5c4737,_0x5573f6,_0x56f0fa)[_0xc9de('0x10')](getUser(_0x5c4737,_0x5573f6,_0x56f0fa))[_0xc9de('0x10')](getEndUser(_0x5c4737,_0x5573f6,_0x56f0fa))[_0xc9de('0x10')](getTicket(_0x5c4737,_0x5573f6,_0x56f0fa,_0xc8a505,_0x41b012))[_0xc9de('0x10')](function(_0x1d3199){logger[_0xc9de('0x19')](util[_0xc9de('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1d3199[_0xc9de('0x39')]));if(_0x5c4737!==_0xc9de('0x47')){logger['info']('['+[_0x5c4737[_0xc9de('0x18')]()]+']',_0xc9de('0x50'));emit(_0x56f0fa,_0xa2bbc2[_0xc9de('0x51')],_0x1d3199[_0xc9de('0x2b')]);}})[_0xc9de('0x21')](function(_0x1c2d91){logger['error']('['+[_0x5c4737[_0xc9de('0x18')]()]+_0xc9de('0x52'),util[_0xc9de('0x53')](_0x1c2d91,{'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 4709633..08b10f0 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 _0x322b=['freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','sugarcrm','freshdesk','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','zoho','desk','vtiger','dynamics365'];(function(_0xa64842,_0x1b5970){var _0xd036ae=function(_0x32ff28){while(--_0x32ff28){_0xa64842['push'](_0xa64842['shift']());}};_0xd036ae(++_0x1b5970);}(_0x322b,0x107));var _0xb322=function(_0x18c1c2,_0x5cee88){_0x18c1c2=_0x18c1c2-0x0;var _0x409822=_0x322b[_0x18c1c2];return _0x409822;};'use strict';var _=require(_0xb322('0x0'));var util=require(_0xb322('0x1'));var zendesk=require(_0xb322('0x2'));var salesforce=require(_0xb322('0x3'));var sugarcrm=require(_0xb322('0x4'));var freshdesk=require(_0xb322('0x5'));var zoho=require(_0xb322('0x6'));var desk=require(_0xb322('0x7'));var vtiger=require(_0xb322('0x8'));var servicenow=require(_0xb322('0x9'));var dynamics365=require(_0xb322('0xa'));var freshsales=require(_0xb322('0xb'));var integrations=[_0xb322('0xc'),'salesforce','sugarcrm','freshdesk',_0xb322('0xd'),_0xb322('0xe'),_0xb322('0xf'),_0xb322('0x10'),_0xb322('0x11'),_0xb322('0x12')];exports[_0xb322('0x13')]=function(_0x2037f8,_0xeb69fb,_0x31af70,_0x151e90,_0x2a8c65,_0x372ef4){if(_0x31af70){if(_[_0xb322('0x14')](integrations,_0x2037f8[_0xb322('0x15')][_0xb322('0x16')]())){try{var _0xe000ac=null;var _0x1bc591='';var _0x2351b2=_0x31af70[_0x2037f8['data1'][_0xb322('0x16')]()];if(_0x2351b2){var _0x39fa9f=_0x2351b2[_0x2037f8[_0xb322('0x17')]];if(_0x39fa9f){var _0x582ae7=_[_0xb322('0x18')](_0x39fa9f[_0xb322('0x19')],{'id':parseInt(_0x2037f8[_0xb322('0x1a')],0xa)});if(_0x582ae7){if(_0x151e90){if(_0x2a8c65&&_0xeb69fb['queue']){_0x1bc591='queue';}else if(_0xeb69fb[_0xb322('0x1b')]){_0x1bc591=_0xb322('0x1c');}else{console['log'](_0xb322('0x1d'),_0xeb69fb);}}else{_0x1bc591=_0xb322('0x1e');}switch(_0x2037f8[_0xb322('0x15')]['toLowerCase']()){case'zendesk':zendesk[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case _0xb322('0x1f'):salesforce[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case _0xb322('0x20'):sugarcrm[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case _0xb322('0x21'):freshdesk[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case'zoho':zoho[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case'desk':desk[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case _0xb322('0xf'):vtiger[_0x1bc591](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4);break;case _0xb322('0x11'):freshsales['cs'](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4,_0x1bc591);break;case _0xb322('0x12'):servicenow['cs'](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4,_0x1bc591);break;case'dynamics365':dynamics365['cs'](_0x2037f8,_0xeb69fb,_0x582ae7,_0x151e90,_0x2a8c65,_0x39fa9f,_0x372ef4,_0x1bc591);break;default:console[_0xb322('0x22')](_0xb322('0x23'));}}else{_0xe000ac=require(_0xb322('0x24'))(_0x2037f8['data1'][_0xb322('0x16')]());_0xe000ac[_0xb322('0x25')](_0xb322('0x26'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x2037f8[_0xb322('0x15')][_0xb322('0x16')](),_0x2037f8[_0xb322('0x1a')]));}}else{_0xe000ac=require(_0xb322('0x24'))(_0x2037f8[_0xb322('0x15')]['toLowerCase']());_0xe000ac[_0xb322('0x25')](_0xb322('0x26'),util['format'](_0xb322('0x27'),_0x2037f8['data1'][_0xb322('0x16')](),_0x2037f8[_0xb322('0x17')]));}}else{}}catch(_0x4ed52e){console['error'](_0x4ed52e);}}}}; \ No newline at end of file +var _0x0f8f=['exec','includes','toLowerCase','data1','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','unknown\x20integration','error','[EXEC]','format','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./freshsales','zendesk','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow'];(function(_0x15a14b,_0x38a709){var _0x509b26=function(_0x4f053f){while(--_0x4f053f){_0x15a14b['push'](_0x15a14b['shift']());}};_0x509b26(++_0x38a709);}(_0x0f8f,0x14d));var _0xf0f8=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0x0f8f[_0x265003];return _0x33c743;};'use strict';var _=require(_0xf0f8('0x0'));var util=require(_0xf0f8('0x1'));var zendesk=require(_0xf0f8('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xf0f8('0x3'));var freshdesk=require(_0xf0f8('0x4'));var zoho=require(_0xf0f8('0x5'));var desk=require('./desk');var vtiger=require(_0xf0f8('0x6'));var servicenow=require(_0xf0f8('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xf0f8('0x8'));var integrations=[_0xf0f8('0x9'),'salesforce','sugarcrm',_0xf0f8('0xa'),_0xf0f8('0xb'),_0xf0f8('0xc'),_0xf0f8('0xd'),_0xf0f8('0xe'),_0xf0f8('0xf'),_0xf0f8('0x10')];exports[_0xf0f8('0x11')]=function(_0x52cd13,_0xde8c1d,_0x17ddad,_0x33b35c,_0x2f5867,_0x56c9c6){if(_0x17ddad){if(_[_0xf0f8('0x12')](integrations,_0x52cd13['data1'][_0xf0f8('0x13')]())){try{var _0x2d0e79=null;var _0x57bdec='';var _0x51292b=_0x17ddad[_0x52cd13[_0xf0f8('0x14')][_0xf0f8('0x13')]()];if(_0x51292b){var _0x376fde=_0x51292b[_0x52cd13[_0xf0f8('0x15')]];if(_0x376fde){var _0x200f55=_['find'](_0x376fde['Configurations'],{'id':parseInt(_0x52cd13[_0xf0f8('0x16')],0xa)});if(_0x200f55){if(_0x33b35c){if(_0x2f5867&&_0xde8c1d['queue']){_0x57bdec=_0xf0f8('0x17');}else if(_0xde8c1d[_0xf0f8('0x18')]){_0x57bdec=_0xf0f8('0x19');}else{console[_0xf0f8('0x1a')](_0xf0f8('0x1b'),_0xde8c1d);}}else{_0x57bdec='unmanaged';}switch(_0x52cd13[_0xf0f8('0x14')]['toLowerCase']()){case _0xf0f8('0x9'):zendesk[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case _0xf0f8('0x1c'):salesforce[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case'sugarcrm':sugarcrm[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case _0xf0f8('0xa'):freshdesk[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case _0xf0f8('0xb'):zoho[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case _0xf0f8('0xc'):desk[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case _0xf0f8('0xd'):vtiger[_0x57bdec](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6);break;case _0xf0f8('0xf'):freshsales['cs'](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6,_0x57bdec);break;case _0xf0f8('0x10'):servicenow['cs'](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6,_0x57bdec);break;case _0xf0f8('0xe'):dynamics365['cs'](_0x52cd13,_0xde8c1d,_0x200f55,_0x33b35c,_0x2f5867,_0x376fde,_0x56c9c6,_0x57bdec);break;default:console[_0xf0f8('0x1a')](_0xf0f8('0x1d'));}}else{_0x2d0e79=require('../../../../config/logger')(_0x52cd13[_0xf0f8('0x14')]['toLowerCase']());_0x2d0e79[_0xf0f8('0x1e')](_0xf0f8('0x1f'),util[_0xf0f8('0x20')]('%s\x20configuration\x20#%s\x20not\x20found',_0x52cd13[_0xf0f8('0x14')][_0xf0f8('0x13')](),_0x52cd13[_0xf0f8('0x16')]));}}else{_0x2d0e79=require(_0xf0f8('0x21'))(_0x52cd13[_0xf0f8('0x14')][_0xf0f8('0x13')]());_0x2d0e79[_0xf0f8('0x1e')](_0xf0f8('0x1f'),util[_0xf0f8('0x20')](_0xf0f8('0x22'),_0x52cd13[_0xf0f8('0x14')]['toLowerCase'](),_0x52cd13[_0xf0f8('0x15')]));}}else{}}catch(_0x464c6b){console[_0xf0f8('0x1e')](_0x464c6b);}}}}; \ 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 0fcad91..f3fbdd4 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 _0x5bde=['queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','destcalleridnum','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','calleridname',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','localhost','socket.io-emitter','redis','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','endUserType','contact','lead','WhoId','ContactId','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','execute','then','length','find','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','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.','LastName','format','Caller\x20-\x20%s','moduleCreate','No\x20Company','','upperFirst','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login'];(function(_0x20f20e,_0x35f388){var _0x464278=function(_0x4b8d4b){while(--_0x4b8d4b){_0x20f20e['push'](_0x20f20e['shift']());}};_0x464278(++_0x35f388);}(_0x5bde,0x127));var _0xe5bd=function(_0x5ea286,_0x27d231){_0x5ea286=_0x5ea286-0x0;var _0x582adc=_0x5bde[_0x5ea286];return _0x582adc;};'use strict';var _=require(_0xe5bd('0x0'));var rp=require(_0xe5bd('0x1'));var moment=require(_0xe5bd('0x2'));var BPromise=require(_0xe5bd('0x3'));var md5=require(_0xe5bd('0x4'));var jsforce=require(_0xe5bd('0x5'));var util=require(_0xe5bd('0x6'));var Redis=require(_0xe5bd('0x7'));var intUtil=require(_0xe5bd('0x8'));var config=require(_0xe5bd('0x9'));var logger=require(_0xe5bd('0xa'))(_0xe5bd('0xb'));config['redis']=_[_0xe5bd('0xc')](config['redis'],{'host':_0xe5bd('0xd'),'port':0x18eb});var io=require(_0xe5bd('0xe'))(new Redis(config[_0xe5bd('0xf')]));function emit(_0x22ec57,_0xd54d98,_0x5ca7fe){io['to'](_0x22ec57)['emit'](_0xd54d98,_0x5ca7fe);}function getTicket(_0x2d5f7e,_0x10e44c,_0x24a4ba,_0x48423f,_0x2b677f,_0x16b1b8,_0x2b0dff,_0x4c4402){var _0x293fde=Object[_0xe5bd('0x10')]({},{'OwnerId':_0x10e44c['id'],'Subject':intUtil[_0xe5bd('0x11')](_0x48423f[_0xe5bd('0x12')],_0x2b677f,'\x20'),'Description':intUtil[_0xe5bd('0x11')](_0x48423f[_0xe5bd('0x13')],_0x2b677f,'\x0a')},getCustomFields(_0x16b1b8,_0x2b677f));if(_0x24a4ba){if(_0x48423f[_0xe5bd('0x14')]===_0xe5bd('0x15')){_0x293fde['ActivityDate']=moment[_0xe5bd('0x16')]();_0x293fde[_0xe5bd('0x17')]=![];_0x293fde['IsRecurrence']=![];if(_0x24a4ba[_0xe5bd('0x18')]===_0xe5bd('0x19')||_0x24a4ba[_0xe5bd('0x18')]===_0xe5bd('0x1a')){_0x293fde[_0xe5bd('0x1b')]=_0x24a4ba['id'];}else if(_0x24a4ba[_0xe5bd('0x18')]==='account'){_0x293fde['WhatId']=_0x24a4ba['id'];}}else if(_0x48423f[_0xe5bd('0x14')]==='Case'){if(_0x24a4ba[_0xe5bd('0x18')]===_0xe5bd('0x19')){_0x293fde[_0xe5bd('0x1c')]=_0x24a4ba['id'];}else if(_0x24a4ba['endUserType']===_0xe5bd('0x1d')){_0x293fde['AccountId']=_0x24a4ba['id'];}else if(_0x24a4ba[_0xe5bd('0x18')]===_0xe5bd('0x1a')&&_0x48423f['leadId']){_0x293fde[_0x48423f[_0xe5bd('0x1e')]]=_0x24a4ba['id'];}else{logger[_0xe5bd('0x1f')](_0xe5bd('0x20'));}}}return _0x2b0dff['sobject'](_0x48423f[_0xe5bd('0x14')])[_0xe5bd('0x21')](_0x293fde);}function getUser(_0x5860d2,_0x47eda3,_0x4f84e7){if(!_['isNil'](_0x47eda3)&&intUtil[_0xe5bd('0x22')](_0x47eda3)){var _0x3ad397={'Email':_0x47eda3};var _0x4a222f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4f84e7[_0xe5bd('0x23')](_0xe5bd('0x24'))['find'](_0x3ad397,_0x4a222f)[_0xe5bd('0x25')]()[_0xe5bd('0x26')](function(_0x37c585){if(_0x37c585[_0xe5bd('0x27')]){var _0x1acbcc=_[_0xe5bd('0x28')](_0x37c585,function(_0x2d7dfd){return _0x2d7dfd[_0xe5bd('0x29')]===_0x47eda3;});if(_0x1acbcc){logger[_0xe5bd('0x1f')]('Agent\x20%s\x20found.',_0x47eda3);return BPromise[_0xe5bd('0x2a')]({'id':_0x1acbcc['Id'],'name':_0x1acbcc[_0xe5bd('0x2b')]});}}else{logger[_0xe5bd('0x1f')](_0xe5bd('0x2c'),_0x47eda3);return _0x4f84e7[_0xe5bd('0x2d')]()['then'](function(_0x2197cd){return BPromise[_0xe5bd('0x2a')]({'id':_0x2197cd['user_id'],'name':_0x2197cd[_0xe5bd('0x2e')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x47eda3);return _0x4f84e7['identity']()[_0xe5bd('0x26')](function(_0x1ae6a0){return BPromise[_0xe5bd('0x2a')]({'id':_0x1ae6a0[_0xe5bd('0x2f')],'name':_0x1ae6a0['display_name']});});}}function getEndUser(_0x108c07,_0x6fe3ae,_0x1df4c2,_0x1f6643,_0x336798){var _0xa617dd={'$or':{'Phone':_0x1f6643}};var _0x10d59c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe5bd('0x2a')]()[_0xe5bd('0x26')](function(){logger[_0xe5bd('0x1f')](_0xe5bd('0x30'),_0x1f6643,_0x6fe3ae[_0xe5bd('0x31')]);switch(_0x6fe3ae[_0xe5bd('0x31')]){case _0xe5bd('0x32'):var _0x28e040=_[_0xe5bd('0x33')](_0xa617dd);if(_0x6fe3ae[_0xe5bd('0x34')]){var _0x5a07a5={};_0x5a07a5[_0x6fe3ae[_0xe5bd('0x34')]]=_0x1f6643;_[_0xe5bd('0x35')](_0x28e040['$or'],_0x5a07a5);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x36'))[_0xe5bd('0x28')](_0x28e040,_0x10d59c)[_0xe5bd('0x25')]()[_0xe5bd('0x26')](function(_0x3a2fad){if(_0x3a2fad&&_0x3a2fad[_0xe5bd('0x27')]){return _0x3a2fad;}else{var _0x5d6502=_[_0xe5bd('0x33')](_0xa617dd);if(_0x6fe3ae[_0xe5bd('0x37')]){var _0x496507={};_0x496507[_0x6fe3ae[_0xe5bd('0x37')]]=_0x1f6643;_[_0xe5bd('0x35')](_0x5d6502[_0xe5bd('0x38')],_0x496507);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x39'))[_0xe5bd('0x28')](_0x5d6502,_0x10d59c);}});case _0xe5bd('0x3a'):var _0x49391d=_[_0xe5bd('0x33')](_0xa617dd);if(_0x6fe3ae[_0xe5bd('0x3b')]){var _0x5a07a5={};_0x5a07a5[_0x6fe3ae[_0xe5bd('0x3b')]]=_0x1f6643;_[_0xe5bd('0x35')](_0x49391d['$or'],_0x5a07a5);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x3c'))[_0xe5bd('0x28')](_0x49391d,_0x10d59c)['execute']()['then'](function(_0x2be23e){if(_0x2be23e&&_0x2be23e[_0xe5bd('0x27')]){return _0x2be23e;}else{var _0x29e688=_[_0xe5bd('0x33')](_0xa617dd);if(_0x6fe3ae['additionalSearchContact']){var _0x45426e={};_0x45426e[_0x6fe3ae[_0xe5bd('0x34')]]=_0x1f6643;_[_0xe5bd('0x35')](_0x29e688[_0xe5bd('0x38')],_0x45426e);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x36'))[_0xe5bd('0x28')](_0x29e688,_0x10d59c)[_0xe5bd('0x26')](function(_0x1f6d1b){if(_0x1f6d1b&&_0x1f6d1b[_0xe5bd('0x27')]){return _0x1f6d1b;}else{var _0x1f8aba=_['cloneDeep'](_0xa617dd);if(_0x6fe3ae['additionalSearchLead']){var _0x31b982={};_0x31b982[_0x6fe3ae['additionalSearchLead']]=_0x1f6643;_[_0xe5bd('0x35')](_0x1f8aba['$or'],_0x31b982);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x39'))[_0xe5bd('0x28')](_0x1f8aba,_0x10d59c);}});}});case _0xe5bd('0x19'):var _0x28e040=_[_0xe5bd('0x33')](_0xa617dd);if(_0x6fe3ae['additionalSearchContact']){var _0x5a07a5={};_0x5a07a5[_0x6fe3ae[_0xe5bd('0x34')]]=_0x1f6643;_[_0xe5bd('0x35')](_0x28e040[_0xe5bd('0x38')],_0x5a07a5);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x36'))[_0xe5bd('0x28')](_0x28e040,_0x10d59c)[_0xe5bd('0x25')]();case _0xe5bd('0x1a'):var _0x3aba7b=_['cloneDeep'](_0xa617dd);if(_0x6fe3ae[_0xe5bd('0x37')]){var _0x5a07a5={};_0x5a07a5[_0x6fe3ae[_0xe5bd('0x37')]]=_0x1f6643;_[_0xe5bd('0x35')](_0x3aba7b['$or'],_0x5a07a5);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x39'))[_0xe5bd('0x28')](_0x3aba7b,_0x10d59c);case'account':var _0x49391d=_['cloneDeep'](_0xa617dd);if(_0x6fe3ae[_0xe5bd('0x3b')]){var _0x5a07a5={};_0x5a07a5[_0x6fe3ae[_0xe5bd('0x3b')]]=_0x1f6643;_['merge'](_0x49391d[_0xe5bd('0x38')],_0x5a07a5);}return _0x336798[_0xe5bd('0x23')](_0xe5bd('0x3c'))[_0xe5bd('0x28')](_0x49391d,_0x10d59c);default:return null;}})['then'](function(_0x42c285){if(_0x42c285&&_0x42c285[_0xe5bd('0x27')]){var _0x772933=_['first'](_0x42c285);if(_0x772933){return BPromise['resolve']({'id':_0x772933['Id'],'name':_0x772933['Name'],'phone':_0x772933[_0xe5bd('0x3d')],'endUserType':_0x772933[_0xe5bd('0x3e')][_0xe5bd('0x3f')][_0xe5bd('0x40')]()});}}})['then'](function(_0x16ecd4){if(_0x16ecd4){logger[_0xe5bd('0x1f')](_0xe5bd('0x41'),_0x16ecd4['endUserType'],_0x1f6643);return BPromise[_0xe5bd('0x2a')](_0x16ecd4);}else{logger[_0xe5bd('0x1f')](_0xe5bd('0x42'),_0x1f6643);var _0x10f130={'Phone':_0x1f6643};if(_0x6fe3ae['moduleCreate']){if(_0x6fe3ae['moduleCreate']===_0xe5bd('0x19')){logger[_0xe5bd('0x1f')](_0xe5bd('0x43'),_0x1f6643,_0x6fe3ae['moduleCreate']);_0x10f130[_0xe5bd('0x44')]=_0x1df4c2!==''?_0x1df4c2:util[_0xe5bd('0x45')](_0xe5bd('0x46'),_0x1f6643);}else if(_0x6fe3ae[_0xe5bd('0x47')]===_0xe5bd('0x1a')){logger[_0xe5bd('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1f6643,_0x6fe3ae[_0xe5bd('0x47')]);_0x10f130['LastName']=_0x1df4c2!==''?_0x1df4c2:util['format'](_0xe5bd('0x46'),_0x1f6643);_0x10f130['Company']=_0xe5bd('0x48');}else if(_0x6fe3ae[_0xe5bd('0x47')]===_0xe5bd('0x1d')){logger[_0xe5bd('0x1f')](_0xe5bd('0x43'),_0x1f6643,_0x6fe3ae[_0xe5bd('0x47')]);_0x10f130[_0xe5bd('0x2b')]=_0x1df4c2!==_0xe5bd('0x49')?_0x1df4c2:util['format']('Caller\x20-\x20%s',_0x1f6643);}else{return null;}}return _0x336798['sobject'](_[_0xe5bd('0x4a')](_0x6fe3ae['moduleCreate']))[_0xe5bd('0x21')](_0x10f130)['then'](function(_0x3e6274){return BPromise[_0xe5bd('0x2a')]({'id':_0x3e6274['id'],'endUserType':_0x6fe3ae['moduleCreate']});});}});}function getCustomFields(_0x501d44,_0x3a43bb){var _0x43f3fc={};if(_0x501d44[_0xe5bd('0x27')]>0x0){_['forEach'](_0x501d44,function(_0x2339b7){if(_[_0xe5bd('0x4b')]([_0xe5bd('0x4c'),_0xe5bd('0x4d')],_0x2339b7[_0xe5bd('0x3f')])&&_0x2339b7[_0xe5bd('0x4e')]){_0x43f3fc[_0x2339b7[_0xe5bd('0x4e')]]=_0x2339b7[_0xe5bd('0x4f')][_0xe5bd('0x50')]();}else if(_0x2339b7[_0xe5bd('0x3f')]===_0xe5bd('0x51')&&_0x2339b7[_0xe5bd('0x52')]&&_0x2339b7['idField']){_0x3a43bb[_0x2339b7[_0xe5bd('0x52')]]&&(_0x43f3fc[_0x2339b7[_0xe5bd('0x4e')]]=_0x3a43bb[_0x2339b7[_0xe5bd('0x52')]][_0xe5bd('0x50')]());}else if(_0x2339b7[_0xe5bd('0x3f')]===_0xe5bd('0x53')&&_0x2339b7['Variable']&&_0x2339b7[_0xe5bd('0x54')]['name']&&_0x2339b7[_0xe5bd('0x4e')]){_0x3a43bb[_0x2339b7[_0xe5bd('0x54')][_0xe5bd('0x55')][_0xe5bd('0x40')]()]&&(_0x43f3fc[_0x2339b7['idField']]=_0x3a43bb[_0x2339b7[_0xe5bd('0x54')][_0xe5bd('0x55')][_0xe5bd('0x40')]()]['toString']());}});}return _0x43f3fc;}function getConnection(_0x10bec2){var _0x44303d=_0x10bec2[_0xe5bd('0x56')][_0xe5bd('0x57')](_0x10bec2[_0xe5bd('0x58')]);var _0x4e9ca3=new jsforce[(_0xe5bd('0x59'))]({'oauth2':{'loginUrl':_0x10bec2[_0xe5bd('0x5a')]||_0xe5bd('0x5b'),'clientId':_0x10bec2[_0xe5bd('0x5c')],'clientSecret':_0x10bec2[_0xe5bd('0x5d')]}});return _0x4e9ca3[_0xe5bd('0x5e')](_0x10bec2['username'],_0x44303d)[_0xe5bd('0x26')](function(){logger[_0xe5bd('0x1f')]('Connection\x20established.');return _0x4e9ca3;});}exports[_0xe5bd('0x5f')]=function(_0x4ff6f2,_0x2d3587,_0xe639b8,_0x110593,_0x17d369,_0x2ec99a){var _0x878395,_0x1214dd,_0xc79a4e,_0x28fb14;_0x2ec99a[_0xe5bd('0x60')]=intUtil[_0xe5bd('0x61')](_0x2ec99a[_0xe5bd('0x60')]);_0x2ec99a[_0xe5bd('0x5a')]=intUtil[_0xe5bd('0x61')](_0x2ec99a[_0xe5bd('0x5a')]);if(_0x17d369&&_0x17d369['monitor_format']){logger[_0xe5bd('0x1f')](_0xe5bd('0x62'),_0xe5bd('0x63'));_0x2d3587[_0xe5bd('0x64')]=util['format'](_0xe5bd('0x65'),_0x2ec99a[_0xe5bd('0x60')],_0x2d3587[_0xe5bd('0x66')],md5(_0x2d3587[_0xe5bd('0x66')]));}else{_0x2d3587[_0xe5bd('0x64')]='';}return getConnection(_0x2ec99a)['then'](function(_0x477dd0){_0x28fb14=_0x477dd0;return getUser(_0x2ec99a,_0x110593['email'],_0x28fb14);})['then'](function(_0x47eb35){_0x878395=_0x47eb35;return getEndUser(_0x2ec99a,_0xe639b8,_0x2d3587['calleridname'],_0x2d3587[_0xe5bd('0x67')],_0x28fb14);})[_0xe5bd('0x26')](function(_0x287ec4){_0x1214dd=_0x287ec4;return getTicket(_0x2ec99a,_0x878395,_0x1214dd,_0xe639b8,_0x2d3587,_0xe639b8['Fields'],_0x28fb14,_0xe5bd('0x5f'));})['then'](function(_0x172e2f){_0xc79a4e=_0x172e2f;logger[_0xe5bd('0x1f')](_0xe5bd('0x68'),_0xc79a4e['id']);logger[_0xe5bd('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xc79a4e['id'],_0x110593['name'],_0x2ec99a['type']);switch(_0x2ec99a[_0xe5bd('0x3f')]){case'integrationTab':emit(util['format']('user:%s',_0x110593['name']),'trigger:salesforce:display',{'recordId':_0xc79a4e['id']});break;case _0xe5bd('0x69'):emit(util[_0xe5bd('0x45')](_0xe5bd('0x6a'),_0x110593[_0xe5bd('0x55')]),_0xe5bd('0x6b'),{'uri':util['format'](_0xe5bd('0x6c'),_0x28fb14[_0xe5bd('0x6d')],_0xc79a4e['id'])});break;default:logger[_0xe5bd('0x6e')](_0xe5bd('0x6f'));}})['catch'](function(_0x5d1569){logger['error'](_0xe5bd('0x62'),_0x5d1569);});};exports['outbound']=function(_0xeb501d,_0x7a9a04,_0x1c2154,_0x1ca13f,_0x751cd4,_0x3d6063,_0x53a775){var _0x217cb2,_0x226b6c,_0x38da23,_0x341577;_0x3d6063['serverUrl']=intUtil['stripTrailingSlash'](_0x3d6063[_0xe5bd('0x60')]);_0x3d6063[_0xe5bd('0x5a')]=intUtil['stripTrailingSlash'](_0x3d6063[_0xe5bd('0x5a')]);if(_0x53a775&&_0x53a775['recordingFormat']&&_0x53a775[_0xe5bd('0x70')]!==_0xe5bd('0x71')){logger['info'](_0xe5bd('0x72'),_0xe5bd('0x63'));_0x7a9a04[_0xe5bd('0x64')]=util[_0xe5bd('0x45')](_0xe5bd('0x65'),_0x3d6063[_0xe5bd('0x60')],_0x7a9a04[_0xe5bd('0x66')],md5(_0x7a9a04[_0xe5bd('0x66')]));}return getConnection(_0x3d6063)['then'](function(_0x4d133c){_0x341577=_0x4d133c;return getUser(_0x3d6063,_0x1ca13f['email'],_0x341577);})[_0xe5bd('0x26')](function(_0x1c483b){_0x217cb2=_0x1c483b;return getEndUser(_0x3d6063,_0x1c2154,_0x7a9a04['destcalleridname'],_0x7a9a04[_0xe5bd('0x73')],_0x341577);})[_0xe5bd('0x26')](function(_0x1535df){_0x226b6c=_0x1535df;return getTicket(_0x3d6063,_0x217cb2,_0x226b6c,_0x1c2154,_0x7a9a04,_0x1c2154[_0xe5bd('0x74')],_0x341577,_0xe5bd('0x75'));})[_0xe5bd('0x26')](function(_0x38545a){_0x38da23=_0x38545a;logger[_0xe5bd('0x1f')](_0xe5bd('0x76'),_0x38da23['id']);logger[_0xe5bd('0x1f')](_0xe5bd('0x77'),_0x38da23['id'],_0x1ca13f[_0xe5bd('0x55')],_0x3d6063[_0xe5bd('0x3f')]);switch(_0x3d6063[_0xe5bd('0x3f')]){case _0xe5bd('0x78'):emit(util['format'](_0xe5bd('0x6a'),_0x1ca13f[_0xe5bd('0x55')]),_0xe5bd('0x79'),{'recordId':_0x38da23['id']});break;case'newTab':emit(util['format']('user:%s',_0x1ca13f['name']),_0xe5bd('0x6b'),{'uri':util[_0xe5bd('0x45')](_0xe5bd('0x6c'),_0x341577['instanceUrl'],_0x38da23['id'])});break;default:logger['error']('[OUTBOUND]',_0xe5bd('0x7a'));}})[_0xe5bd('0x7b')](function(_0x5786d1){logger[_0xe5bd('0x6e')]('[OUTBOUND]',_0x5786d1);});};exports['unmanaged']=function(_0x54433a,_0x1f60ac,_0x44affe,_0x4d60f5,_0x2b348f,_0x23d7de){var _0x246917,_0x58aeb3,_0x3555f9,_0x389d45;_0x23d7de['serverUrl']=intUtil['stripTrailingSlash'](_0x23d7de['serverUrl']);_0x23d7de[_0xe5bd('0x5a')]=intUtil[_0xe5bd('0x61')](_0x23d7de[_0xe5bd('0x5a')]);if(_0x2b348f&&_0x2b348f[_0xe5bd('0x7c')]){logger[_0xe5bd('0x1f')]('['+_0x1f60ac[_0xe5bd('0x7d')]['toUpperCase']()+']',_0xe5bd('0x63'));_0x1f60ac['recordingURL']=util[_0xe5bd('0x45')](_0xe5bd('0x65'),_0x23d7de[_0xe5bd('0x60')],_0x1f60ac[_0xe5bd('0x66')],md5(_0x1f60ac['uniqueid']));}else{_0x1f60ac['recordingURL']='';}return getConnection(_0x23d7de)[_0xe5bd('0x26')](function(_0x5ed0e6){_0x389d45=_0x5ed0e6;if(!_['isNil'](_0x4d60f5)){return getUser(_0x23d7de,_0x4d60f5[_0xe5bd('0x55')],_0x389d45);}else{return getUser(_0x23d7de,null,_0x389d45);}})[_0xe5bd('0x26')](function(_0x29bb6f){_0x246917=_0x29bb6f;return getEndUser(_0x23d7de,_0x44affe,_0x1f60ac[_0xe5bd('0x7e')],_0x1f60ac[_0xe5bd('0x67')],_0x389d45);})[_0xe5bd('0x26')](function(_0x246985){_0x58aeb3=_0x246985;return getTicket(_0x23d7de,_0x246917,_0x58aeb3,_0x44affe,_0x1f60ac,_0x44affe[_0xe5bd('0x74')],_0x389d45);})[_0xe5bd('0x26')](function(_0x2d509b){_0x3555f9=_0x2d509b;logger['info']('['+_0x1f60ac[_0xe5bd('0x7d')]['toUpperCase']()+_0xe5bd('0x7f'),_0x3555f9['id']);logger['info']('['+_0x1f60ac['lastevent'][_0xe5bd('0x80')]()+_0xe5bd('0x81'),_0x23d7de['type']);})[_0xe5bd('0x7b')](function(_0x27afa4){logger[_0xe5bd('0x6e')]('['+_0x1f60ac[_0xe5bd('0x7d')][_0xe5bd('0x80')]()+']',_0x27afa4);});}; \ No newline at end of file +var _0x82f8=['Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','trigger:salesforce:display','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Email'];(function(_0x2cf683,_0x3213de){var _0x5cddff=function(_0x454eed){while(--_0x454eed){_0x2cf683['push'](_0x2cf683['shift']());}};_0x5cddff(++_0x3213de);}(_0x82f8,0x1dd));var _0x882f=function(_0x100f42,_0x3521f7){_0x100f42=_0x100f42-0x0;var _0x4fe254=_0x82f8[_0x100f42];return _0x4fe254;};'use strict';var _=require(_0x882f('0x0'));var rp=require('request-promise');var moment=require(_0x882f('0x1'));var BPromise=require(_0x882f('0x2'));var md5=require(_0x882f('0x3'));var jsforce=require(_0x882f('0x4'));var util=require(_0x882f('0x5'));var Redis=require(_0x882f('0x6'));var intUtil=require(_0x882f('0x7'));var config=require(_0x882f('0x8'));var logger=require(_0x882f('0x9'))('salesforce');config['redis']=_[_0x882f('0xa')](config[_0x882f('0xb')],{'host':_0x882f('0xc'),'port':0x18eb});var io=require(_0x882f('0xd'))(new Redis(config[_0x882f('0xb')]));function emit(_0x558f82,_0x121cd6,_0x16356f){io['to'](_0x558f82)[_0x882f('0xe')](_0x121cd6,_0x16356f);}function getTicket(_0x524ab3,_0x439f0b,_0x527714,_0x472e16,_0x6b8ab8,_0x1fba26,_0x39eddc,_0x52763e){var _0x3ddc09=Object[_0x882f('0xf')]({},{'OwnerId':_0x439f0b['id'],'Subject':intUtil[_0x882f('0x10')](_0x472e16['Subjects'],_0x6b8ab8,'\x20'),'Description':intUtil[_0x882f('0x10')](_0x472e16[_0x882f('0x11')],_0x6b8ab8,'\x0a')},getCustomFields(_0x1fba26,_0x6b8ab8));if(_0x527714){if(_0x472e16[_0x882f('0x12')]===_0x882f('0x13')){_0x3ddc09[_0x882f('0x14')]=moment[_0x882f('0x15')]();_0x3ddc09['IsReminderSet']=![];_0x3ddc09[_0x882f('0x16')]=![];if(_0x527714[_0x882f('0x17')]===_0x882f('0x18')||_0x527714[_0x882f('0x17')]===_0x882f('0x19')){_0x3ddc09[_0x882f('0x1a')]=_0x527714['id'];}else if(_0x527714[_0x882f('0x17')]===_0x882f('0x1b')){_0x3ddc09[_0x882f('0x1c')]=_0x527714['id'];}}else if(_0x472e16[_0x882f('0x12')]===_0x882f('0x1d')){if(_0x527714[_0x882f('0x17')]==='contact'){_0x3ddc09[_0x882f('0x1e')]=_0x527714['id'];}else if(_0x527714['endUserType']==='account'){_0x3ddc09['AccountId']=_0x527714['id'];}else if(_0x527714['endUserType']===_0x882f('0x19')&&_0x472e16[_0x882f('0x1f')]){_0x3ddc09[_0x472e16[_0x882f('0x1f')]]=_0x527714['id'];}else{logger[_0x882f('0x20')](_0x882f('0x21'));}}}return _0x39eddc[_0x882f('0x22')](_0x472e16[_0x882f('0x12')])[_0x882f('0x23')](_0x3ddc09);}function getUser(_0x121485,_0x47470e,_0x358528){if(!_[_0x882f('0x24')](_0x47470e)&&intUtil[_0x882f('0x25')](_0x47470e)){var _0xf8dd8b={'Email':_0x47470e};var _0x4dab55={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x358528['sobject'](_0x882f('0x26'))[_0x882f('0x27')](_0xf8dd8b,_0x4dab55)[_0x882f('0x28')]()['then'](function(_0x9864e7){if(_0x9864e7[_0x882f('0x29')]){var _0x3ec4bd=_[_0x882f('0x27')](_0x9864e7,function(_0x49b493){return _0x49b493[_0x882f('0x2a')]===_0x47470e;});if(_0x3ec4bd){logger[_0x882f('0x20')](_0x882f('0x2b'),_0x47470e);return BPromise[_0x882f('0x2c')]({'id':_0x3ec4bd['Id'],'name':_0x3ec4bd[_0x882f('0x2d')]});}}else{logger[_0x882f('0x20')](_0x882f('0x2e'),_0x47470e);return _0x358528['identity']()[_0x882f('0x2f')](function(_0x41d4fb){return BPromise[_0x882f('0x2c')]({'id':_0x41d4fb[_0x882f('0x30')],'name':_0x41d4fb[_0x882f('0x31')]});});}});}else{logger[_0x882f('0x20')](_0x882f('0x2e'),_0x47470e);return _0x358528[_0x882f('0x32')]()[_0x882f('0x2f')](function(_0x27311b){return BPromise[_0x882f('0x2c')]({'id':_0x27311b[_0x882f('0x30')],'name':_0x27311b[_0x882f('0x31')]});});}}function getEndUser(_0xb5c9a9,_0x31d475,_0x247287,_0xc8346d,_0x13d20d){var _0x2a6e12={'$or':{'Phone':_0xc8346d}};var _0x7fa67c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x882f('0x2c')]()[_0x882f('0x2f')](function(){logger['info'](_0x882f('0x33'),_0xc8346d,_0x31d475[_0x882f('0x34')]);switch(_0x31d475[_0x882f('0x34')]){case _0x882f('0x35'):var _0x17c277=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475[_0x882f('0x37')]){var _0xe53b47={};_0xe53b47[_0x31d475[_0x882f('0x37')]]=_0xc8346d;_[_0x882f('0x38')](_0x17c277[_0x882f('0x39')],_0xe53b47);}return _0x13d20d[_0x882f('0x22')](_0x882f('0x3a'))[_0x882f('0x27')](_0x17c277,_0x7fa67c)[_0x882f('0x28')]()[_0x882f('0x2f')](function(_0x42ae56){if(_0x42ae56&&_0x42ae56['length']){return _0x42ae56;}else{var _0x5d8777=_['cloneDeep'](_0x2a6e12);if(_0x31d475[_0x882f('0x3b')]){var _0x1894e8={};_0x1894e8[_0x31d475[_0x882f('0x3b')]]=_0xc8346d;_['merge'](_0x5d8777[_0x882f('0x39')],_0x1894e8);}return _0x13d20d[_0x882f('0x22')](_0x882f('0x3c'))[_0x882f('0x27')](_0x5d8777,_0x7fa67c);}});case _0x882f('0x3d'):var _0x133b17=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475[_0x882f('0x3e')]){var _0xe53b47={};_0xe53b47[_0x31d475['additionalSearchAccount']]=_0xc8346d;_['merge'](_0x133b17[_0x882f('0x39')],_0xe53b47);}return _0x13d20d[_0x882f('0x22')]('Account')['find'](_0x133b17,_0x7fa67c)['execute']()['then'](function(_0x7e2916){if(_0x7e2916&&_0x7e2916['length']){return _0x7e2916;}else{var _0x5a8c23=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475[_0x882f('0x37')]){var _0x3e937d={};_0x3e937d[_0x31d475[_0x882f('0x37')]]=_0xc8346d;_[_0x882f('0x38')](_0x5a8c23[_0x882f('0x39')],_0x3e937d);}return _0x13d20d[_0x882f('0x22')](_0x882f('0x3a'))[_0x882f('0x27')](_0x5a8c23,_0x7fa67c)[_0x882f('0x2f')](function(_0x370e47){if(_0x370e47&&_0x370e47['length']){return _0x370e47;}else{var _0x1348b6=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475['additionalSearchLead']){var _0x5dd75b={};_0x5dd75b[_0x31d475[_0x882f('0x3b')]]=_0xc8346d;_[_0x882f('0x38')](_0x1348b6[_0x882f('0x39')],_0x5dd75b);}return _0x13d20d[_0x882f('0x22')]('Lead')[_0x882f('0x27')](_0x1348b6,_0x7fa67c);}});}});case _0x882f('0x18'):var _0x17c277=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475[_0x882f('0x37')]){var _0xe53b47={};_0xe53b47[_0x31d475[_0x882f('0x37')]]=_0xc8346d;_['merge'](_0x17c277[_0x882f('0x39')],_0xe53b47);}return _0x13d20d[_0x882f('0x22')]('Contact')['find'](_0x17c277,_0x7fa67c)[_0x882f('0x28')]();case _0x882f('0x19'):var _0x19a76b=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475[_0x882f('0x3b')]){var _0xe53b47={};_0xe53b47[_0x31d475[_0x882f('0x3b')]]=_0xc8346d;_[_0x882f('0x38')](_0x19a76b[_0x882f('0x39')],_0xe53b47);}return _0x13d20d[_0x882f('0x22')](_0x882f('0x3c'))[_0x882f('0x27')](_0x19a76b,_0x7fa67c);case'account':var _0x133b17=_[_0x882f('0x36')](_0x2a6e12);if(_0x31d475[_0x882f('0x3e')]){var _0xe53b47={};_0xe53b47[_0x31d475['additionalSearchAccount']]=_0xc8346d;_[_0x882f('0x38')](_0x133b17[_0x882f('0x39')],_0xe53b47);}return _0x13d20d[_0x882f('0x22')](_0x882f('0x3f'))[_0x882f('0x27')](_0x133b17,_0x7fa67c);default:return null;}})[_0x882f('0x2f')](function(_0xa11a96){if(_0xa11a96&&_0xa11a96['length']){var _0x3376aa=_[_0x882f('0x40')](_0xa11a96);if(_0x3376aa){return BPromise[_0x882f('0x2c')]({'id':_0x3376aa['Id'],'name':_0x3376aa['Name'],'phone':_0x3376aa['Phone'],'endUserType':_0x3376aa['attributes'][_0x882f('0x41')]['toLowerCase']()});}}})[_0x882f('0x2f')](function(_0x51c825){if(_0x51c825){logger[_0x882f('0x20')](_0x882f('0x42'),_0x51c825['endUserType'],_0xc8346d);return BPromise[_0x882f('0x2c')](_0x51c825);}else{logger[_0x882f('0x20')](_0x882f('0x43'),_0xc8346d);var _0x5d7534={'Phone':_0xc8346d};if(_0x31d475[_0x882f('0x44')]){if(_0x31d475[_0x882f('0x44')]==='contact'){logger[_0x882f('0x20')](_0x882f('0x45'),_0xc8346d,_0x31d475[_0x882f('0x44')]);_0x5d7534[_0x882f('0x46')]=_0x247287!==_0x882f('0x47')?_0x247287:util[_0x882f('0x48')](_0x882f('0x49'),_0xc8346d);}else if(_0x31d475['moduleCreate']===_0x882f('0x19')){logger[_0x882f('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xc8346d,_0x31d475['moduleCreate']);_0x5d7534[_0x882f('0x46')]=_0x247287!==_0x882f('0x47')?_0x247287:util[_0x882f('0x48')](_0x882f('0x49'),_0xc8346d);_0x5d7534[_0x882f('0x4a')]=_0x882f('0x4b');}else if(_0x31d475['moduleCreate']===_0x882f('0x1b')){logger[_0x882f('0x20')](_0x882f('0x45'),_0xc8346d,_0x31d475[_0x882f('0x44')]);_0x5d7534[_0x882f('0x2d')]=_0x247287!==_0x882f('0x47')?_0x247287:util[_0x882f('0x48')]('Caller\x20-\x20%s',_0xc8346d);}else{return null;}}return _0x13d20d[_0x882f('0x22')](_['upperFirst'](_0x31d475[_0x882f('0x44')]))['create'](_0x5d7534)['then'](function(_0x543ce8){return BPromise['resolve']({'id':_0x543ce8['id'],'endUserType':_0x31d475['moduleCreate']});});}});}function getCustomFields(_0x541782,_0x1ab74f){var _0x56978d={};if(_0x541782[_0x882f('0x29')]>0x0){_['forEach'](_0x541782,function(_0x5c1b5d){if(_[_0x882f('0x4c')]([_0x882f('0x4d'),_0x882f('0x4e')],_0x5c1b5d['type'])&&_0x5c1b5d[_0x882f('0x4f')]){_0x56978d[_0x5c1b5d[_0x882f('0x4f')]]=_0x5c1b5d[_0x882f('0x50')][_0x882f('0x51')]();}else if(_0x5c1b5d[_0x882f('0x41')]===_0x882f('0x52')&&_0x5c1b5d[_0x882f('0x53')]&&_0x5c1b5d[_0x882f('0x4f')]){_0x1ab74f[_0x5c1b5d[_0x882f('0x53')]]&&(_0x56978d[_0x5c1b5d['idField']]=_0x1ab74f[_0x5c1b5d[_0x882f('0x53')]][_0x882f('0x51')]());}else if(_0x5c1b5d[_0x882f('0x41')]==='customVariable'&&_0x5c1b5d[_0x882f('0x54')]&&_0x5c1b5d[_0x882f('0x54')][_0x882f('0x55')]&&_0x5c1b5d[_0x882f('0x4f')]){_0x1ab74f[_0x5c1b5d['Variable'][_0x882f('0x55')][_0x882f('0x56')]()]&&(_0x56978d[_0x5c1b5d['idField']]=_0x1ab74f[_0x5c1b5d['Variable'][_0x882f('0x55')][_0x882f('0x56')]()]['toString']());}});}return _0x56978d;}function getConnection(_0x20fe58){var _0x217117=_0x20fe58[_0x882f('0x57')][_0x882f('0x58')](_0x20fe58[_0x882f('0x59')]);var _0x3fa4ef=new jsforce[(_0x882f('0x5a'))]({'oauth2':{'loginUrl':_0x20fe58[_0x882f('0x5b')]||_0x882f('0x5c'),'clientId':_0x20fe58['clientId'],'clientSecret':_0x20fe58['clientSecret']}});return _0x3fa4ef['login'](_0x20fe58[_0x882f('0x5d')],_0x217117)[_0x882f('0x2f')](function(){logger['info'](_0x882f('0x5e'));return _0x3fa4ef;});}exports[_0x882f('0x5f')]=function(_0x5a958c,_0x3505f8,_0x517f06,_0x5500eb,_0xbf0a5e,_0x25cc7a){var _0x5433be,_0x26795a,_0x56e9f7,_0x1a102f;_0x25cc7a['serverUrl']=intUtil[_0x882f('0x60')](_0x25cc7a[_0x882f('0x61')]);_0x25cc7a[_0x882f('0x5b')]=intUtil[_0x882f('0x60')](_0x25cc7a['remoteUri']);if(_0xbf0a5e&&_0xbf0a5e[_0x882f('0x62')]){logger[_0x882f('0x20')]('[QUEUE]',_0x882f('0x63'));_0x3505f8[_0x882f('0x64')]=util[_0x882f('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25cc7a[_0x882f('0x61')],_0x3505f8[_0x882f('0x65')],md5(_0x3505f8['uniqueid']));}else{_0x3505f8['recordingURL']='';}return getConnection(_0x25cc7a)[_0x882f('0x2f')](function(_0x5b21b4){_0x1a102f=_0x5b21b4;return getUser(_0x25cc7a,_0x5500eb[_0x882f('0x66')],_0x1a102f);})['then'](function(_0x16dacf){_0x5433be=_0x16dacf;return getEndUser(_0x25cc7a,_0x517f06,_0x3505f8['calleridname'],_0x3505f8[_0x882f('0x67')],_0x1a102f);})['then'](function(_0x5e3a14){_0x26795a=_0x5e3a14;return getTicket(_0x25cc7a,_0x5433be,_0x26795a,_0x517f06,_0x3505f8,_0x517f06[_0x882f('0x68')],_0x1a102f,'queue');})[_0x882f('0x2f')](function(_0x1e955b){_0x56e9f7=_0x1e955b;logger[_0x882f('0x20')](_0x882f('0x69'),_0x56e9f7['id']);logger['info'](_0x882f('0x6a'),_0x56e9f7['id'],_0x5500eb[_0x882f('0x55')],_0x25cc7a['type']);switch(_0x25cc7a[_0x882f('0x41')]){case _0x882f('0x6b'):emit(util[_0x882f('0x48')](_0x882f('0x6c'),_0x5500eb['name']),'trigger:salesforce:display',{'recordId':_0x56e9f7['id']});break;case'newTab':emit(util[_0x882f('0x48')](_0x882f('0x6c'),_0x5500eb[_0x882f('0x55')]),'trigger:browser:url',{'uri':util[_0x882f('0x48')](_0x882f('0x6d'),_0x1a102f[_0x882f('0x6e')],_0x56e9f7['id'])});break;default:logger['error'](_0x882f('0x6f'));}})[_0x882f('0x70')](function(_0x4d186a){logger[_0x882f('0x71')]('[QUEUE]',_0x4d186a);});};exports[_0x882f('0x72')]=function(_0xe50f83,_0x444e92,_0x3d0922,_0x1e92f3,_0x30d3b,_0x1df352,_0x56060c){var _0x89967c,_0x2be5ae,_0x36f958,_0x4aebba;_0x1df352[_0x882f('0x61')]=intUtil[_0x882f('0x60')](_0x1df352['serverUrl']);_0x1df352['remoteUri']=intUtil[_0x882f('0x60')](_0x1df352[_0x882f('0x5b')]);if(_0x56060c&&_0x56060c[_0x882f('0x73')]&&_0x56060c[_0x882f('0x73')]!==_0x882f('0x74')){logger[_0x882f('0x20')](_0x882f('0x75'),'Recording\x20is\x20enabled!');_0x444e92[_0x882f('0x64')]=util[_0x882f('0x48')](_0x882f('0x76'),_0x1df352['serverUrl'],_0x444e92[_0x882f('0x65')],md5(_0x444e92[_0x882f('0x65')]));}return getConnection(_0x1df352)['then'](function(_0x408b64){_0x4aebba=_0x408b64;return getUser(_0x1df352,_0x1e92f3[_0x882f('0x66')],_0x4aebba);})[_0x882f('0x2f')](function(_0x407b5c){_0x89967c=_0x407b5c;return getEndUser(_0x1df352,_0x3d0922,_0x444e92[_0x882f('0x77')],_0x444e92[_0x882f('0x78')],_0x4aebba);})[_0x882f('0x2f')](function(_0xc66de7){_0x2be5ae=_0xc66de7;return getTicket(_0x1df352,_0x89967c,_0x2be5ae,_0x3d0922,_0x444e92,_0x3d0922[_0x882f('0x68')],_0x4aebba,_0x882f('0x72'));})[_0x882f('0x2f')](function(_0x1a7895){_0x36f958=_0x1a7895;logger[_0x882f('0x20')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x36f958['id']);logger[_0x882f('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x36f958['id'],_0x1e92f3['name'],_0x1df352[_0x882f('0x41')]);switch(_0x1df352['type']){case _0x882f('0x6b'):emit(util[_0x882f('0x48')]('user:%s',_0x1e92f3[_0x882f('0x55')]),_0x882f('0x79'),{'recordId':_0x36f958['id']});break;case _0x882f('0x7a'):emit(util[_0x882f('0x48')](_0x882f('0x6c'),_0x1e92f3['name']),_0x882f('0x7b'),{'uri':util[_0x882f('0x48')](_0x882f('0x6d'),_0x4aebba[_0x882f('0x6e')],_0x36f958['id'])});break;default:logger[_0x882f('0x71')](_0x882f('0x75'),_0x882f('0x7c'));}})[_0x882f('0x70')](function(_0x42e8c7){logger[_0x882f('0x71')](_0x882f('0x75'),_0x42e8c7);});};exports[_0x882f('0x7d')]=function(_0x2b66cd,_0x1eba53,_0x16d165,_0x521f89,_0x17a643,_0x2f61c9){var _0x4be698,_0x25a5f8,_0x351c60,_0x4ec0c2;_0x2f61c9[_0x882f('0x61')]=intUtil[_0x882f('0x60')](_0x2f61c9[_0x882f('0x61')]);_0x2f61c9[_0x882f('0x5b')]=intUtil[_0x882f('0x60')](_0x2f61c9[_0x882f('0x5b')]);if(_0x17a643&&_0x17a643['monitor_format']){logger[_0x882f('0x20')]('['+_0x1eba53[_0x882f('0x7e')][_0x882f('0x7f')]()+']',_0x882f('0x63'));_0x1eba53[_0x882f('0x64')]=util['format'](_0x882f('0x76'),_0x2f61c9[_0x882f('0x61')],_0x1eba53[_0x882f('0x65')],md5(_0x1eba53[_0x882f('0x65')]));}else{_0x1eba53[_0x882f('0x64')]='';}return getConnection(_0x2f61c9)[_0x882f('0x2f')](function(_0x94c027){_0x4ec0c2=_0x94c027;if(!_[_0x882f('0x24')](_0x521f89)){return getUser(_0x2f61c9,_0x521f89['name'],_0x4ec0c2);}else{return getUser(_0x2f61c9,null,_0x4ec0c2);}})[_0x882f('0x2f')](function(_0x538539){_0x4be698=_0x538539;return getEndUser(_0x2f61c9,_0x16d165,_0x1eba53['calleridname'],_0x1eba53[_0x882f('0x67')],_0x4ec0c2);})['then'](function(_0x49b7e1){_0x25a5f8=_0x49b7e1;return getTicket(_0x2f61c9,_0x4be698,_0x25a5f8,_0x16d165,_0x1eba53,_0x16d165[_0x882f('0x68')],_0x4ec0c2);})[_0x882f('0x2f')](function(_0x592dc6){_0x351c60=_0x592dc6;logger[_0x882f('0x20')]('['+_0x1eba53[_0x882f('0x7e')]['toUpperCase']()+_0x882f('0x80'),_0x351c60['id']);logger[_0x882f('0x20')]('['+_0x1eba53[_0x882f('0x7e')][_0x882f('0x7f')]()+_0x882f('0x81'),_0x2f61c9[_0x882f('0x41')]);})[_0x882f('0x70')](function(_0x45c0c1){logger[_0x882f('0x71')]('['+_0x1eba53[_0x882f('0x7e')][_0x882f('0x7f')]()+']',_0x45c0c1);});}; \ 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 148f14f..dc0c198 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 _0x54e2=['incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','ticketId','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','GET','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminId','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x54e2,0x185));var _0x254e=function(_0x41d14a,_0x356a08){_0x41d14a=_0x41d14a-0x0;var _0x404b67=_0x54e2[_0x41d14a];return _0x404b67;};'use strict';var _=require(_0x254e('0x0'));var Promise=require('bluebird');var rp=require(_0x254e('0x1'));var util=require(_0x254e('0x2'));var md5=require(_0x254e('0x3'));var Redis=require(_0x254e('0x4'));var intUtil=require('./util');var config=require(_0x254e('0x5'));var logger=require(_0x254e('0x6'))(_0x254e('0x7'));config[_0x254e('0x8')]=_[_0x254e('0x9')](config[_0x254e('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x254e('0x8')]));function getAdminUser(_0x2f7b26,_0x3d828f,_0x299a0e,_0x189fde,_0x69bf3f,_0x473ee2){return new Promise(function(_0x13a909,_0x13b97a){var _0x2de77e={'method':'GET','uri':_0x189fde+_0x254e('0xa')+'&'+_0x69bf3f+'&'+_0x473ee2,'auth':_0x3d828f,'json':!![]};return rp(_0x2de77e)[_0x254e('0xb')](function(_0x3ced50){if(_0x3ced50[_0x254e('0xc')][_0x254e('0xd')]>0x0){_0x299a0e['adminId']=_0x3ced50[_0x254e('0xc')][0x0][_0x254e('0xe')];}logger['info']('['+[_0x2f7b26[_0x254e('0xf')]()]+_0x254e('0x10'),_0x299a0e);_0x13a909(_0x299a0e);})['catch'](function(_0x22483b){logger[_0x254e('0x11')]('['+[_0x2f7b26[_0x254e('0xf')]()]+']',_0x22483b[_0x254e('0x12')]);_0x13b97a(_0x22483b[_0x254e('0x12')]);});});}function getUser(_0x45d567,_0x1bf0c6,_0x2e6913,_0x517129,_0x3ff1f7){return function(_0x25b0a7){logger[_0x254e('0x13')]('['+[_0x45d567[_0x254e('0xf')]()]+_0x254e('0x14'),_0x25b0a7);return new Promise(function(_0x25830b,_0x303c30){if(intUtil[_0x254e('0x15')](_0x25b0a7['userEmail'])){var _0x56f4aa={'method':_0x254e('0x16'),'uri':_0x2e6913+_0x254e('0x17')+_0x25b0a7[_0x254e('0x18')]+'&'+_0x517129+'&'+_0x3ff1f7,'auth':_0x1bf0c6,'json':!![]};logger[_0x254e('0x13')]('['+[_0x45d567[_0x254e('0xf')]()]+_0x254e('0x19'),_0x56f4aa);return rp(_0x56f4aa)['then'](function(_0xd5be57){logger[_0x254e('0x13')]('['+[_0x45d567[_0x254e('0xf')]()]+_0x254e('0x1a'),_0xd5be57);if(_0xd5be57[_0x254e('0xc')][_0x254e('0xd')]>0x0&&String(_0xd5be57[_0x254e('0xc')][0x0]['active'])===_0x254e('0x1b')){_0x25b0a7[_0x254e('0x1c')]=_0xd5be57[_0x254e('0xc')][0x0][_0x254e('0xe')];}else{_0x25b0a7[_0x254e('0x1c')]=_0x25b0a7[_0x254e('0x1d')];_0x25b0a7[_0x254e('0x18')]=_0x25b0a7['adminEmail'];}logger[_0x254e('0x13')]('['+[_0x45d567[_0x254e('0xf')]()]+'],\x20getUser\x20crm',_0x25b0a7);_0x25830b(_0x25b0a7);})[_0x254e('0x1e')](function(_0x46ecc6){logger['error']('['+[_0x45d567['toUpperCase']()]+']',_0x46ecc6[_0x254e('0x12')]);_0x303c30(_0x46ecc6[_0x254e('0x12')]);});}else{logger[_0x254e('0x13')]('['+[_0x45d567['toUpperCase']()]+_0x254e('0x1f'));_0x25b0a7[_0x254e('0x1c')]=_0x25b0a7['adminId'];_0x25b0a7['userEmail']=_0x25b0a7[_0x254e('0x20')];_0x25830b(_0x25b0a7);}});};}function createEndUser(_0x7c807e,_0x31b886,_0x53a923,_0x304af9,_0x4de14e){logger[_0x254e('0x13')]('['+[_0x7c807e['toUpperCase']()]+_0x254e('0x21'),_0x53a923);return new Promise(function(_0x814792,_0x37150d){var _0x1415e9={'method':_0x254e('0x22'),'uri':_0x304af9+_0x254e('0x23')+_0x4de14e,'body':{'user_name':_0x53a923[_0x254e('0x24')],'roles':_0x254e('0x25'),'first_name':_0x53a923[_0x254e('0x24')],'active':_0x254e('0x1b'),'date_format':'System','phone':_0x53a923[_0x254e('0x24')]},'auth':_0x31b886,'json':!![]};return rp(_0x1415e9)['then'](function(_0x42b64f){logger[_0x254e('0x13')]('['+[_0x7c807e[_0x254e('0xf')]()]+_0x254e('0x26'),_0x42b64f[_0x254e('0xc')]);_0x53a923[_0x254e('0x27')]=_0x42b64f[_0x254e('0xc')]['sys_id'];_0x814792(_0x53a923);})[_0x254e('0x1e')](function(_0x323950){logger['error']('['+[_0x7c807e['toUpperCase']()]+']',_0x323950[_0x254e('0x12')]);_0x37150d(_0x323950[_0x254e('0x12')]);});});}function getEndUser(_0x57a616,_0xfc5e1e,_0x2a05a3,_0x38631a,_0x2dd19e){return function(_0x11f466){logger[_0x254e('0x13')]('['+[_0x57a616[_0x254e('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x11f466);return new Promise(function(_0x3ee9ea,_0x301077){var _0x159190={'method':_0x254e('0x16'),'uri':_0x2a05a3+'sys_user?sysparm_query=phone%3D'+_0x11f466[_0x254e('0x24')]+'&'+_0x38631a+'&'+_0x2dd19e,'auth':_0xfc5e1e,'json':!![]};return rp(_0x159190)[_0x254e('0xb')](function(_0x4986d0){if(_0x4986d0[_0x254e('0xc')][_0x254e('0xd')]>0x0){_0x11f466[_0x254e('0x27')]=_0x4986d0[_0x254e('0xc')][0x0]['sys_id'];logger[_0x254e('0x13')]('['+[_0x57a616[_0x254e('0xf')]()]+_0x254e('0x28'),_0x11f466);_0x3ee9ea(_0x11f466);}else{return createEndUser(_0x57a616,_0xfc5e1e,_0x11f466,_0x2a05a3,_0x38631a)['then'](function(_0x5c3b60){logger[_0x254e('0x13')]('['+[_0x57a616[_0x254e('0xf')]()]+_0x254e('0x29'),_0x5c3b60);_0x3ee9ea(_0x5c3b60);});}})[_0x254e('0x1e')](function(_0x37771a){logger['error']('['+[_0x57a616[_0x254e('0xf')]()]+']',_0x37771a['message']);_0x301077(_0x37771a[_0x254e('0x12')]);});});};}function getCustomFields(_0x2fca23,_0x126289){var _0x183bdb={};if(_0x2fca23[_0x254e('0xd')]>0x0){_['forEach'](_0x2fca23,function(_0x523593){if(_['includes']([_0x254e('0x2a'),_0x254e('0x2b')],_0x523593[_0x254e('0x2c')])&&_0x523593[_0x254e('0x2d')]&&!_0x523593[_0x254e('0x2e')]){_0x183bdb[_0x523593[_0x254e('0x2d')][_0x254e('0x2f')]()]=_0x523593[_0x254e('0x30')][_0x254e('0x31')]();}else if(_[_0x254e('0x32')](['string','picklist'],_0x523593[_0x254e('0x2c')])&&_0x523593[_0x254e('0x33')]&&_0x523593['customField']){_0x183bdb[_0x523593['idField'][_0x254e('0x2f')]()]=_0x523593[_0x254e('0x30')]['toString']();}else if(_0x523593[_0x254e('0x2c')]===_0x254e('0x34')&&_0x523593[_0x254e('0x35')]&&_0x523593[_0x254e('0x33')]&&_0x523593[_0x254e('0x2e')]){_0x183bdb[_0x523593[_0x254e('0x33')][_0x254e('0x2f')]()]=_0x126289[_0x523593[_0x254e('0x35')]][_0x254e('0x31')]();}else if(_0x523593[_0x254e('0x2c')]===_0x254e('0x36')&&_0x523593[_0x254e('0x37')]&&_0x523593[_0x254e('0x37')]['name']&&_0x523593[_0x254e('0x33')]&&_0x523593[_0x254e('0x2e')]){_0x183bdb[_0x523593[_0x254e('0x33')]['toLowerCase']()]=_0x126289[_0x523593['Variable'][_0x254e('0x38')]['toLowerCase']()]['toString']();}});}return _0x183bdb;}function getTicket(_0x11114f,_0xa95566,_0x382a53,_0x4f517e,_0x4b6abd,_0x6097d3){return function(_0x4e4e2f){logger['info']('['+[_0x11114f[_0x254e('0xf')]()]+_0x254e('0x39'),_0x4e4e2f);return new Promise(function(_0x20bb43,_0x51bb42){var _0x17d560=_0x11114f[_0x254e('0x2f')]()===_0x254e('0x3a')?_0x4e4e2f[_0x254e('0x1c')]:_0x4e4e2f['endUserId'];var _0x4ef59a={'method':_0x254e('0x22'),'uri':_0x382a53+_0x254e('0x3b')+'?'+_0x6097d3,'body':Object['assign']({},{'active':_0x254e('0x1b'),'caller_id':_0x17d560,'assigned_to':_0x4e4e2f[_0x254e('0x1c')],'short_description':intUtil[_0x254e('0x3c')](_0x4f517e['Subjects'],_0x4b6abd,'\x20'),'description':intUtil[_0x254e('0x3c')](_0x4f517e[_0x254e('0x3d')],_0x4b6abd,'\x0a')},getCustomFields(_0x4f517e[_0x254e('0x3e')],_0x4b6abd)),'auth':_0xa95566,'json':!![]};return rp(_0x4ef59a)['then'](function(_0x4d4a36){logger[_0x254e('0x13')]('['+[_0x11114f[_0x254e('0xf')]()]+_0x254e('0x3f'),_0x4d4a36[_0x254e('0xc')]);_0x4e4e2f['ticketId']=_0x4d4a36[_0x254e('0xc')]['sys_id'];_0x4e4e2f[_0x254e('0x40')]=_0x4d4a36[_0x254e('0xc')]['number'];logger[_0x254e('0x13')]('['+[_0x11114f[_0x254e('0xf')]()]+_0x254e('0x41'),_0x4e4e2f);_0x20bb43(_0x4e4e2f);})[_0x254e('0x1e')](function(_0x3df4d9){logger[_0x254e('0x11')]('['+[_0x11114f['toUpperCase']()]+']',_0x3df4d9[_0x254e('0x12')]);_0x51bb42(_0x3df4d9[_0x254e('0x12')]);});});};}function createRemoteTag(_0x24de0a,_0xf23f1b,_0x3fcc88,_0x3eadb6){return new Promise(function(_0x447d78,_0x2743be){var _0x594580={'method':_0x254e('0x22'),'uri':_0x3fcc88+_0x254e('0x42')+'?'+_0x3eadb6,'body':{'short_description':_0x24de0a,'global':!![],'active':!![],'name':_0x24de0a},'auth':_0xf23f1b,'json':!![]};return rp(_0x594580)[_0x254e('0xb')](function(_0x1045d2){var _0x2675f3=_0x1045d2[_0x254e('0xc')][_0x254e('0xe')];_0x447d78(_0x2675f3);});});}function getRemoteTag(_0x8edecc,_0x576d42,_0x22ab3c,_0xa9c01a,_0x3df31b){return new Promise(function(_0x15e30d,_0x5daf5d){var _0x19c3b1={'method':_0x254e('0x16'),'uri':_0x22ab3c+'label'+_0x254e('0x43')+_0x8edecc+'&'+_0xa9c01a,'auth':_0x576d42,'json':!![]};return rp(_0x19c3b1)['then'](function(_0x2979e3){if(_0x2979e3[_0x254e('0xc')][_0x254e('0xd')]>0x0){var _0x50a759=_0x2979e3[_0x254e('0xc')][0x0][_0x254e('0xe')];_0x15e30d(_0x50a759);}else{return createRemoteTag(_0x8edecc,_0x576d42,_0x22ab3c,_0xa9c01a)[_0x254e('0xb')](function(_0x35970a){_0x15e30d(_0x35970a);});}});});}function assignTagToIncident(_0x1cfd0b,_0x17628a,_0x597397,_0x1644ae,_0x11e1fb){return new Promise(function(_0x2f7b87,_0x250912){var _0x2367aa={'method':_0x254e('0x22'),'uri':_0x597397+_0x254e('0x44')+'?'+_0x11e1fb,'body':{'label':_0x1cfd0b,'table':_0x254e('0x3b'),'id_type':'Incident','table_key':_0x1644ae[_0x254e('0x45')],'title':_0x254e('0x46')+_0x1644ae[_0x254e('0x40')],'id_display':_0x1644ae[_0x254e('0x40')]},'auth':_0x17628a,'json':!![]};return rp(_0x2367aa)[_0x254e('0xb')](function(_0x3597ca){_0x2f7b87();})[_0x254e('0x1e')](function(){_0x2f7b87();});});}function manageTags(_0x39c463,_0x51c33e,_0x17d283,_0x474789,_0x3e8cb2,_0xef8ee8,_0x518d2c){return new Promise(function(_0x764ddc,_0x35f104){var _0x3a7876=[];_0x51c33e[_0x254e('0x47')](function(_0x25b788){_0x3a7876[_0x254e('0x48')](getRemoteTag(_0x25b788,_0x17d283,_0x474789,_0xef8ee8,_0x518d2c));});return Promise[_0x254e('0x49')](_0x3a7876)[_0x254e('0xb')](function(_0x3611c2){if(_0x3611c2[_0x254e('0xd')]){logger['info']('['+[_0x39c463['toUpperCase']()]+_0x254e('0x4a'),_0x3611c2);var _0x4b189a=[];_0x3611c2[_0x254e('0x47')](function(_0x2f361e){_0x4b189a[_0x254e('0x48')](assignTagToIncident(_0x2f361e,_0x17d283,_0x474789,_0x3e8cb2,_0xef8ee8));});return Promise['all'](_0x4b189a)[_0x254e('0xb')](function(){_0x764ddc();})[_0x254e('0x1e')](function(){_0x764ddc();});}else{_0x764ddc();}});});}function getTags(_0x43ea14,_0x4caab1,_0x4c27d6,_0x410b82,_0x425afc,_0x3849a6){return function(_0x4f2b5b){return new Promise(function(_0x5c83c6,_0x445f4e){var _0x573547=[];var _0x19d667=_0x410b82[_0x254e('0x4b')];if(_0x19d667&&_0x19d667[_0x254e('0xd')]>0x0){_0x573547=_[_0x254e('0x4c')](_0x19d667,_0x254e('0x38'));}if(_0x573547['length']>0x0){return manageTags(_0x43ea14,_0x573547,_0x4caab1,_0x4c27d6,_0x4f2b5b,_0x425afc,_0x3849a6)[_0x254e('0xb')](function(){_0x5c83c6(_0x4f2b5b);});}else{_0x5c83c6(_0x4f2b5b);}});};}function emit(_0x410c23,_0x18e884,_0x5d7056){var _0x5606ed=_0x254e('0x4d')+_0x254e('0x4e')+_0x254e('0x4f')+_0x254e('0x50');var _0x25c369={'uri':_0x410c23+_0x254e('0x51')+_0x5d7056+_0x5606ed};io['to'](util[_0x254e('0x52')](_0x254e('0x53'),_0x18e884))[_0x254e('0x54')](_0x254e('0x55'),_0x25c369);}exports['cs']=function(_0x5dc8b7,_0x14fbcc,_0x2c09a2,_0x1f0483,_0x3d35ab,_0x5b365c,_0x40315d,_0x23a030){var _0x4b0da7={};var _0xb936ff={'user':_0x5b365c[_0x254e('0x56')],'pass':_0x5b365c[_0x254e('0x57')]};var _0x1174c4='sysparm_limit=1';var _0x2c3497=_0x254e('0x58');_0x5b365c[_0x254e('0x59')]=intUtil[_0x254e('0x5a')](_0x5b365c[_0x254e('0x59')]);_0x5b365c[_0x254e('0x5b')]=intUtil[_0x254e('0x5a')](_0x5b365c[_0x254e('0x5b')]);var _0x222d22=util[_0x254e('0x52')](_0x254e('0x5c'),_0x5b365c[_0x254e('0x59')]);_0x4b0da7[_0x254e('0x18')]=!_[_0x254e('0x5d')](_0x1f0483)?_0x1f0483[_0x254e('0x5e')]:null;_0x4b0da7[_0x254e('0x20')]=_0x5b365c[_0x254e('0x5e')];_0x4b0da7[_0x254e('0x24')]=_0x23a030[_0x254e('0x2f')]()==='outbound'?_0x14fbcc[_0x254e('0x5f')]:_0x14fbcc['calleridnum'];_0x4b0da7[_0x254e('0x60')]=_0x23a030==='queue'||_0x23a030==='unmanaged'?_0x254e('0x61'):'outbound';var _0x307a36=util[_0x254e('0x52')](_0x254e('0x62'),_0x5b365c['serverUrl'],_0x14fbcc[_0x254e('0x63')],md5(_0x14fbcc[_0x254e('0x63')]));if(_0x3d35ab&&_0x3d35ab[_0x254e('0x64')]){logger['info'](_0x254e('0x65'),'Recording\x20is\x20enabled!');_0x14fbcc['recordingURL']=_0x307a36;}else if(_0x40315d&&_0x40315d[_0x254e('0x66')]&&_0x40315d[_0x254e('0x66')]!==_0x254e('0x67')){logger['info'](_0x254e('0x68'),_0x254e('0x69'));_0x14fbcc[_0x254e('0x6a')]=_0x307a36;}else{_0x14fbcc[_0x254e('0x6a')]='';}return getAdminUser(_0x23a030,_0xb936ff,_0x4b0da7,_0x222d22,_0x2c3497,_0x1174c4)[_0x254e('0xb')](getUser(_0x23a030,_0xb936ff,_0x222d22,_0x2c3497,_0x1174c4))[_0x254e('0xb')](getEndUser(_0x23a030,_0xb936ff,_0x222d22,_0x2c3497,_0x1174c4))[_0x254e('0xb')](getTicket(_0x23a030,_0xb936ff,_0x222d22,_0x2c09a2,_0x14fbcc,_0x2c3497))[_0x254e('0xb')](function(_0x17a9c8){logger[_0x254e('0x13')](util[_0x254e('0x52')](_0x254e('0x6b'),_0x17a9c8['ticketId']));logger['info'](util['format'](_0x254e('0x6c'),_0x23a030));if(_0x23a030!==_0x254e('0x6d')){logger[_0x254e('0x13')]('['+[_0x23a030[_0x254e('0xf')]()]+']',_0x254e('0x6e'));emit(_0x5b365c[_0x254e('0x59')],_0x1f0483['name'],_0x17a9c8[_0x254e('0x45')]);}})[_0x254e('0x1e')](function(_0x18f895){logger[_0x254e('0x11')]('['+[_0x23a030['toUpperCase']()]+_0x254e('0x6f'),util['inspect'](_0x18f895,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xae52=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','catch','error','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variableName','customVariable','Variable','name','outbound','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','format','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xae52,0xe9));var _0x2ae5=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xae52[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x2ae5('0x0'));var Promise=require(_0x2ae5('0x1'));var rp=require(_0x2ae5('0x2'));var util=require(_0x2ae5('0x3'));var md5=require(_0x2ae5('0x4'));var Redis=require(_0x2ae5('0x5'));var intUtil=require(_0x2ae5('0x6'));var config=require(_0x2ae5('0x7'));var logger=require('../../../../config/logger')('servicenow');config[_0x2ae5('0x8')]=_[_0x2ae5('0x9')](config[_0x2ae5('0x8')],{'host':_0x2ae5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2ae5('0x8')]));function getAdminUser(_0x1ee7d2,_0xcf0cb3,_0x45621d,_0x8182d1,_0x125930,_0x5af9a6){return new Promise(function(_0x38517b,_0x20afe3){var _0x1f2539={'method':_0x2ae5('0xb'),'uri':_0x8182d1+_0x2ae5('0xc')+'&'+_0x125930+'&'+_0x5af9a6,'auth':_0xcf0cb3,'json':!![]};return rp(_0x1f2539)['then'](function(_0xd690cb){if(_0xd690cb[_0x2ae5('0xd')][_0x2ae5('0xe')]>0x0){_0x45621d[_0x2ae5('0xf')]=_0xd690cb['result'][0x0][_0x2ae5('0x10')];}logger[_0x2ae5('0x11')]('['+[_0x1ee7d2[_0x2ae5('0x12')]()]+'],\x20getAdminUser\x20crm',_0x45621d);_0x38517b(_0x45621d);})[_0x2ae5('0x13')](function(_0x4fc4da){logger[_0x2ae5('0x14')]('['+[_0x1ee7d2[_0x2ae5('0x12')]()]+']',_0x4fc4da['message']);_0x20afe3(_0x4fc4da[_0x2ae5('0x15')]);});});}function getUser(_0x554ddf,_0x37ce11,_0x154a78,_0x3bb860,_0x200a74){return function(_0x5bad2e){logger['info']('['+[_0x554ddf[_0x2ae5('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x5bad2e);return new Promise(function(_0x2a61ba,_0x323fbe){if(intUtil['validateEmail'](_0x5bad2e[_0x2ae5('0x16')])){var _0x4e304a={'method':_0x2ae5('0xb'),'uri':_0x154a78+_0x2ae5('0x17')+_0x5bad2e[_0x2ae5('0x16')]+'&'+_0x3bb860+'&'+_0x200a74,'auth':_0x37ce11,'json':!![]};logger[_0x2ae5('0x11')]('['+[_0x554ddf[_0x2ae5('0x12')]()]+_0x2ae5('0x18'),_0x4e304a);return rp(_0x4e304a)[_0x2ae5('0x19')](function(_0x24c489){logger[_0x2ae5('0x11')]('['+[_0x554ddf[_0x2ae5('0x12')]()]+_0x2ae5('0x1a'),_0x24c489);if(_0x24c489[_0x2ae5('0xd')]['length']>0x0&&String(_0x24c489[_0x2ae5('0xd')][0x0][_0x2ae5('0x1b')])===_0x2ae5('0x1c')){_0x5bad2e['userId']=_0x24c489[_0x2ae5('0xd')][0x0]['sys_id'];}else{_0x5bad2e[_0x2ae5('0x1d')]=_0x5bad2e['adminId'];_0x5bad2e['userEmail']=_0x5bad2e[_0x2ae5('0x1e')];}logger[_0x2ae5('0x11')]('['+[_0x554ddf['toUpperCase']()]+_0x2ae5('0x1f'),_0x5bad2e);_0x2a61ba(_0x5bad2e);})['catch'](function(_0xad8dc){logger[_0x2ae5('0x14')]('['+[_0x554ddf[_0x2ae5('0x12')]()]+']',_0xad8dc[_0x2ae5('0x15')]);_0x323fbe(_0xad8dc[_0x2ae5('0x15')]);});}else{logger[_0x2ae5('0x11')]('['+[_0x554ddf[_0x2ae5('0x12')]()]+_0x2ae5('0x20'));_0x5bad2e[_0x2ae5('0x1d')]=_0x5bad2e['adminId'];_0x5bad2e['userEmail']=_0x5bad2e[_0x2ae5('0x1e')];_0x2a61ba(_0x5bad2e);}});};}function createEndUser(_0x51d53b,_0x29d85a,_0x3a10c1,_0x4d7f05,_0x44afde){logger[_0x2ae5('0x11')]('['+[_0x51d53b[_0x2ae5('0x12')]()]+_0x2ae5('0x21'),_0x3a10c1);return new Promise(function(_0x257702,_0x5b3c99){var _0x17af72={'method':'POST','uri':_0x4d7f05+_0x2ae5('0x22')+_0x44afde,'body':{'user_name':_0x3a10c1[_0x2ae5('0x23')],'roles':_0x2ae5('0x24'),'first_name':_0x3a10c1[_0x2ae5('0x23')],'active':_0x2ae5('0x1c'),'date_format':_0x2ae5('0x25'),'phone':_0x3a10c1['endUserNumber']},'auth':_0x29d85a,'json':!![]};return rp(_0x17af72)[_0x2ae5('0x19')](function(_0x4fb83e){logger['info']('['+[_0x51d53b[_0x2ae5('0x12')]()]+'],\x20EndUser\x20schema',_0x4fb83e['result']);_0x3a10c1[_0x2ae5('0x26')]=_0x4fb83e[_0x2ae5('0xd')][_0x2ae5('0x10')];_0x257702(_0x3a10c1);})[_0x2ae5('0x13')](function(_0x91052a){logger[_0x2ae5('0x14')]('['+[_0x51d53b[_0x2ae5('0x12')]()]+']',_0x91052a['message']);_0x5b3c99(_0x91052a[_0x2ae5('0x15')]);});});}function getEndUser(_0x30961c,_0x3eb4d6,_0x1479ed,_0x68562e,_0xe9e16f){return function(_0x38eb79){logger[_0x2ae5('0x11')]('['+[_0x30961c['toUpperCase']()]+_0x2ae5('0x27'),_0x38eb79);return new Promise(function(_0x4e73d3,_0x390eb6){var _0x4277b2={'method':_0x2ae5('0xb'),'uri':_0x1479ed+_0x2ae5('0x28')+_0x38eb79[_0x2ae5('0x23')]+'&'+_0x68562e+'&'+_0xe9e16f,'auth':_0x3eb4d6,'json':!![]};return rp(_0x4277b2)[_0x2ae5('0x19')](function(_0x796520){if(_0x796520[_0x2ae5('0xd')]['length']>0x0){_0x38eb79[_0x2ae5('0x26')]=_0x796520[_0x2ae5('0xd')][0x0]['sys_id'];logger['info']('['+[_0x30961c[_0x2ae5('0x12')]()]+_0x2ae5('0x29'),_0x38eb79);_0x4e73d3(_0x38eb79);}else{return createEndUser(_0x30961c,_0x3eb4d6,_0x38eb79,_0x1479ed,_0x68562e)['then'](function(_0x175525){logger[_0x2ae5('0x11')]('['+[_0x30961c[_0x2ae5('0x12')]()]+_0x2ae5('0x2a'),_0x175525);_0x4e73d3(_0x175525);});}})[_0x2ae5('0x13')](function(_0x3e2daf){logger[_0x2ae5('0x14')]('['+[_0x30961c[_0x2ae5('0x12')]()]+']',_0x3e2daf['message']);_0x390eb6(_0x3e2daf[_0x2ae5('0x15')]);});});};}function getCustomFields(_0x5aa8f,_0x406dda){var _0x53360f={};if(_0x5aa8f[_0x2ae5('0xe')]>0x0){_[_0x2ae5('0x2b')](_0x5aa8f,function(_0x58f1e3){if(_['includes']([_0x2ae5('0x2c'),_0x2ae5('0x2d')],_0x58f1e3[_0x2ae5('0x2e')])&&_0x58f1e3[_0x2ae5('0x2f')]&&!_0x58f1e3['customField']){_0x53360f[_0x58f1e3[_0x2ae5('0x2f')][_0x2ae5('0x30')]()]=_0x58f1e3[_0x2ae5('0x31')][_0x2ae5('0x32')]();}else if(_['includes']([_0x2ae5('0x2c'),_0x2ae5('0x2d')],_0x58f1e3['type'])&&_0x58f1e3[_0x2ae5('0x33')]&&_0x58f1e3[_0x2ae5('0x34')]){_0x53360f[_0x58f1e3[_0x2ae5('0x33')]['toLowerCase']()]=_0x58f1e3[_0x2ae5('0x31')][_0x2ae5('0x32')]();}else if(_0x58f1e3[_0x2ae5('0x2e')]==='variable'&&_0x58f1e3[_0x2ae5('0x35')]&&_0x58f1e3[_0x2ae5('0x33')]&&_0x58f1e3[_0x2ae5('0x34')]){_0x53360f[_0x58f1e3[_0x2ae5('0x33')]['toLowerCase']()]=_0x406dda[_0x58f1e3[_0x2ae5('0x35')]][_0x2ae5('0x32')]();}else if(_0x58f1e3[_0x2ae5('0x2e')]===_0x2ae5('0x36')&&_0x58f1e3['Variable']&&_0x58f1e3['Variable']['name']&&_0x58f1e3[_0x2ae5('0x33')]&&_0x58f1e3['customField']){_0x53360f[_0x58f1e3[_0x2ae5('0x33')][_0x2ae5('0x30')]()]=_0x406dda[_0x58f1e3[_0x2ae5('0x37')][_0x2ae5('0x38')]['toLowerCase']()][_0x2ae5('0x32')]();}});}return _0x53360f;}function getTicket(_0x3c2ae6,_0x4d313,_0x3c0d7e,_0x9cd709,_0x417247,_0x33409a){return function(_0x42a499){logger[_0x2ae5('0x11')]('['+[_0x3c2ae6[_0x2ae5('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x42a499);return new Promise(function(_0x10c13c,_0x7cbcc6){var _0x548ba8=_0x3c2ae6[_0x2ae5('0x30')]()===_0x2ae5('0x39')?_0x42a499[_0x2ae5('0x1d')]:_0x42a499[_0x2ae5('0x26')];var _0x17a78d={'method':_0x2ae5('0x3a'),'uri':_0x3c0d7e+_0x2ae5('0x3b')+'?'+_0x33409a,'body':Object[_0x2ae5('0x3c')]({},{'active':_0x2ae5('0x1c'),'caller_id':_0x548ba8,'assigned_to':_0x42a499[_0x2ae5('0x1d')],'short_description':intUtil[_0x2ae5('0x3d')](_0x9cd709[_0x2ae5('0x3e')],_0x417247,'\x20'),'description':intUtil['getString'](_0x9cd709['Descriptions'],_0x417247,'\x0a')},getCustomFields(_0x9cd709[_0x2ae5('0x3f')],_0x417247)),'auth':_0x4d313,'json':!![]};return rp(_0x17a78d)[_0x2ae5('0x19')](function(_0x3b2c92){logger[_0x2ae5('0x11')]('['+[_0x3c2ae6[_0x2ae5('0x12')]()]+_0x2ae5('0x40'),_0x3b2c92[_0x2ae5('0xd')]);_0x42a499[_0x2ae5('0x41')]=_0x3b2c92[_0x2ae5('0xd')][_0x2ae5('0x10')];_0x42a499[_0x2ae5('0x42')]=_0x3b2c92[_0x2ae5('0xd')][_0x2ae5('0x43')];logger[_0x2ae5('0x11')]('['+[_0x3c2ae6[_0x2ae5('0x12')]()]+_0x2ae5('0x44'),_0x42a499);_0x10c13c(_0x42a499);})[_0x2ae5('0x13')](function(_0x33b45e){logger[_0x2ae5('0x14')]('['+[_0x3c2ae6[_0x2ae5('0x12')]()]+']',_0x33b45e[_0x2ae5('0x15')]);_0x7cbcc6(_0x33b45e[_0x2ae5('0x15')]);});});};}function createRemoteTag(_0x1b7024,_0x11581d,_0x2c3eff,_0x121402){return new Promise(function(_0x50d587,_0x26adc4){var _0x40fa62={'method':'POST','uri':_0x2c3eff+_0x2ae5('0x45')+'?'+_0x121402,'body':{'short_description':_0x1b7024,'global':!![],'active':!![],'name':_0x1b7024},'auth':_0x11581d,'json':!![]};return rp(_0x40fa62)[_0x2ae5('0x19')](function(_0x4efd3c){var _0x549f5b=_0x4efd3c[_0x2ae5('0xd')][_0x2ae5('0x10')];_0x50d587(_0x549f5b);});});}function getRemoteTag(_0x36fd32,_0x26871f,_0x243b09,_0x41d4ba,_0x5acd7e){return new Promise(function(_0x1b7c37,_0x404557){var _0x48602e={'method':'GET','uri':_0x243b09+'label'+_0x2ae5('0x46')+_0x36fd32+'&'+_0x41d4ba,'auth':_0x26871f,'json':!![]};return rp(_0x48602e)[_0x2ae5('0x19')](function(_0x422c9d){if(_0x422c9d[_0x2ae5('0xd')][_0x2ae5('0xe')]>0x0){var _0xa8c51e=_0x422c9d[_0x2ae5('0xd')][0x0][_0x2ae5('0x10')];_0x1b7c37(_0xa8c51e);}else{return createRemoteTag(_0x36fd32,_0x26871f,_0x243b09,_0x41d4ba)[_0x2ae5('0x19')](function(_0x555d96){_0x1b7c37(_0x555d96);});}});});}function assignTagToIncident(_0x19d6f0,_0x402262,_0x4f2d9d,_0xd6b7dc,_0x54b3df){return new Promise(function(_0x2c4550,_0x352c00){var _0x5941ac={'method':_0x2ae5('0x3a'),'uri':_0x4f2d9d+_0x2ae5('0x47')+'?'+_0x54b3df,'body':{'label':_0x19d6f0,'table':'incident','id_type':'Incident','table_key':_0xd6b7dc[_0x2ae5('0x41')],'title':_0x2ae5('0x48')+_0xd6b7dc['ticketNumber'],'id_display':_0xd6b7dc[_0x2ae5('0x42')]},'auth':_0x402262,'json':!![]};return rp(_0x5941ac)['then'](function(_0x5424e0){_0x2c4550();})[_0x2ae5('0x13')](function(){_0x2c4550();});});}function manageTags(_0x2912fb,_0x500888,_0x14e8c8,_0x4dbe94,_0x21bec4,_0x1640a0,_0x5b3ac6){return new Promise(function(_0x15e4e6,_0xfadb87){var _0x48663f=[];_0x500888[_0x2ae5('0x2b')](function(_0x33102d){_0x48663f['push'](getRemoteTag(_0x33102d,_0x14e8c8,_0x4dbe94,_0x1640a0,_0x5b3ac6));});return Promise[_0x2ae5('0x49')](_0x48663f)['then'](function(_0x152f99){if(_0x152f99['length']){logger[_0x2ae5('0x11')]('['+[_0x2912fb[_0x2ae5('0x12')]()]+_0x2ae5('0x4a'),_0x152f99);var _0x1aba21=[];_0x152f99[_0x2ae5('0x2b')](function(_0x18b965){_0x1aba21[_0x2ae5('0x4b')](assignTagToIncident(_0x18b965,_0x14e8c8,_0x4dbe94,_0x21bec4,_0x1640a0));});return Promise[_0x2ae5('0x49')](_0x1aba21)[_0x2ae5('0x19')](function(){_0x15e4e6();})[_0x2ae5('0x13')](function(){_0x15e4e6();});}else{_0x15e4e6();}});});}function getTags(_0x433ef9,_0x3f9f31,_0x2fbf4c,_0x3afa39,_0x923576,_0x18dfea){return function(_0x52d965){return new Promise(function(_0x936953,_0x3418fb){var _0x4a903c=[];var _0x1e1640=_0x3afa39[_0x2ae5('0x4c')];if(_0x1e1640&&_0x1e1640[_0x2ae5('0xe')]>0x0){_0x4a903c=_['map'](_0x1e1640,_0x2ae5('0x38'));}if(_0x4a903c[_0x2ae5('0xe')]>0x0){return manageTags(_0x433ef9,_0x4a903c,_0x3f9f31,_0x2fbf4c,_0x52d965,_0x923576,_0x18dfea)[_0x2ae5('0x19')](function(){_0x936953(_0x52d965);});}else{_0x936953(_0x52d965);}});};}function emit(_0x324267,_0x2ecaf2,_0x14283e){var _0x4d2035=_0x2ae5('0x4d')+_0x2ae5('0x4e')+_0x2ae5('0x4f')+'%255EORDERBYDESCnumber';var _0x4ee93c={'uri':_0x324267+_0x2ae5('0x50')+_0x14283e+_0x4d2035};io['to'](util['format']('user:%s',_0x2ecaf2))['emit'](_0x2ae5('0x51'),_0x4ee93c);}exports['cs']=function(_0x368ef3,_0x1fe316,_0x2b8ff4,_0x5d6fba,_0x508afb,_0x34838a,_0x342997,_0x1bcfc5){var _0x3715e5={};var _0x265417={'user':_0x34838a[_0x2ae5('0x52')],'pass':_0x34838a[_0x2ae5('0x53')]};var _0x3382ca=_0x2ae5('0x54');var _0x11f35f=_0x2ae5('0x55');_0x34838a['remoteUri']=intUtil[_0x2ae5('0x56')](_0x34838a[_0x2ae5('0x57')]);_0x34838a[_0x2ae5('0x58')]=intUtil['stripTrailingSlash'](_0x34838a[_0x2ae5('0x58')]);var _0x18de9a=util[_0x2ae5('0x59')]('%s/api/now/table/',_0x34838a[_0x2ae5('0x57')]);_0x3715e5['userEmail']=!_[_0x2ae5('0x5a')](_0x5d6fba)?_0x5d6fba[_0x2ae5('0x5b')]:null;_0x3715e5['adminEmail']=_0x34838a[_0x2ae5('0x5b')];_0x3715e5['endUserNumber']=_0x1bcfc5[_0x2ae5('0x30')]()==='outbound'?_0x1fe316[_0x2ae5('0x5c')]:_0x1fe316['calleridnum'];_0x3715e5[_0x2ae5('0x5d')]=_0x1bcfc5===_0x2ae5('0x5e')||_0x1bcfc5===_0x2ae5('0x5f')?_0x2ae5('0x5e'):_0x2ae5('0x39');var _0x36ccf0=util['format'](_0x2ae5('0x60'),_0x34838a['serverUrl'],_0x1fe316['uniqueid'],md5(_0x1fe316[_0x2ae5('0x61')]));if(_0x508afb&&_0x508afb[_0x2ae5('0x62')]){logger[_0x2ae5('0x11')](_0x2ae5('0x63'),_0x2ae5('0x64'));_0x1fe316[_0x2ae5('0x65')]=_0x36ccf0;}else if(_0x342997&&_0x342997['recordingFormat']&&_0x342997[_0x2ae5('0x66')]!==_0x2ae5('0x67')){logger['info'](_0x2ae5('0x68'),_0x2ae5('0x64'));_0x1fe316[_0x2ae5('0x65')]=_0x36ccf0;}else{_0x1fe316['recordingURL']='';}return getAdminUser(_0x1bcfc5,_0x265417,_0x3715e5,_0x18de9a,_0x11f35f,_0x3382ca)[_0x2ae5('0x19')](getUser(_0x1bcfc5,_0x265417,_0x18de9a,_0x11f35f,_0x3382ca))['then'](getEndUser(_0x1bcfc5,_0x265417,_0x18de9a,_0x11f35f,_0x3382ca))[_0x2ae5('0x19')](getTicket(_0x1bcfc5,_0x265417,_0x18de9a,_0x2b8ff4,_0x1fe316,_0x11f35f))['then'](function(_0x2262a2){logger[_0x2ae5('0x11')](util[_0x2ae5('0x59')](_0x2ae5('0x69'),_0x2262a2[_0x2ae5('0x41')]));logger['info'](util[_0x2ae5('0x59')](_0x2ae5('0x6a'),_0x1bcfc5));if(_0x1bcfc5!==_0x2ae5('0x5f')){logger[_0x2ae5('0x11')]('['+[_0x1bcfc5[_0x2ae5('0x12')]()]+']',_0x2ae5('0x6b'));emit(_0x34838a['remoteUri'],_0x5d6fba['name'],_0x2262a2[_0x2ae5('0x41')]);}})[_0x2ae5('0x13')](function(_0x13e780){logger[_0x2ae5('0x14')]('['+[_0x1bcfc5['toUpperCase']()]+_0x2ae5('0x6c'),util[_0x2ae5('0x6d')](_0x13e780,{'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 bb8e883..0989ce4 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 _0x555d=['Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Outbound','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridname','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','entry_list','length','find','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','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','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','customField','toLowerCase','content','custom_fields','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x555d,0x189));var _0xd555=function(_0x2f4363,_0x2f3e1b){_0x2f4363=_0x2f4363-0x0;var _0xd9e20b=_0x555d[_0x2f4363];return _0xd9e20b;};'use strict';var _=require('lodash');var rp=require(_0xd555('0x0'));var BPromise=require(_0xd555('0x1'));var md5=require('md5');var util=require(_0xd555('0x2'));var Redis=require(_0xd555('0x3'));var intUtil=require(_0xd555('0x4'));var config=require(_0xd555('0x5'));var logger=require('../../../../config/logger')(_0xd555('0x6'));config[_0xd555('0x7')]=_[_0xd555('0x8')](config['redis'],{'host':_0xd555('0x9'),'port':0x18eb});var io=require(_0xd555('0xa'))(new Redis(config[_0xd555('0x7')]));var def={'method':_0xd555('0xb'),'json':!![]};function emit(_0xc334c3,_0x34f072,_0x525220){io['to'](_0xc334c3)['emit'](_0x34f072,_0x525220);}function getTicket(_0x27ca74,_0x354c5b,_0xd7a1cd,_0x398205,_0x19a621,_0x346a05,_0x432cc6,_0x969438){logger['info'](_0xd555('0xc'));var _0x2a5450=new Date();var _0x501cf2=[{'name':_0xd555('0xd'),'value':intUtil[_0xd555('0xe')](_0x398205[_0xd555('0xf')],_0x19a621,'\x20')},{'name':_0xd555('0x10'),'value':_0x354c5b['id']},{'name':'created_by','value':_0x354c5b['id']},{'name':_0xd555('0x11'),'value':intUtil[_0xd555('0xe')](_0x398205[_0xd555('0x12')],_0x19a621,'\x0a')},{'name':_0xd555('0x13'),'value':_0x2a5450[_0xd555('0x14')]()[_0xd555('0x15')](0x0,0x13)[_0xd555('0x16')]('T','\x20')},{'name':_0xd555('0x17'),'value':'0'},{'name':_0xd555('0x18'),'value':'15'},{'name':_0xd555('0x19'),'value':_0xd7a1cd['id']},{'name':'parent_type','value':_0xd555('0x1a')},{'name':_0xd555('0x1b'),'value':_0xd7a1cd['name']},{'name':'direction','value':_0x969438}];if(_0x346a05['length']){_[_0xd555('0x1c')](_0x346a05,function(_0x3e0ea7){if(_0x19a621[_0x3e0ea7[_0xd555('0x1d')]]){_0x501cf2[_0xd555('0x1e')]({'name':_0x3e0ea7[_0xd555('0x1f')],'value':_0x19a621[_0x3e0ea7[_0xd555('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xd555('0x20'),'response_type':_0xd555('0x20'),'rest_data':JSON[_0xd555('0x21')]({'session':_0x432cc6['id'],'module_name':_0xd555('0x22'),'name_value_list':_0x501cf2})}});}function getAuth(_0x44e920){return util[_0xd555('0x23')](_0xd555('0x24'),new Buffer(_0x44e920[_0xd555('0x25')]+':X')[_0xd555('0x26')]('base64'));}function getServerInfo(_0x5f13d8){return request({'form':{'method':_0xd555('0x27'),'input_type':'JSON','response_type':_0xd555('0x20'),'rest_data':JSON[_0xd555('0x21')]({'session':_0x5f13d8['id']})}});}function getUser(_0x7197d0,_0x4bac10,_0x951b52){if(!_[_0xd555('0x28')](_0x4bac10)){logger[_0xd555('0x29')](_0xd555('0x2a'),_0x4bac10);return request({'form':{'method':_0xd555('0x2b'),'input_type':_0xd555('0x20'),'response_type':'JSON','rest_data':JSON[_0xd555('0x21')]({'session':_0x951b52['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4bac10),'order_by':'','offset':'0','select_fields':['id','name',_0xd555('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd555('0x2d')](function(_0x55c603){if(_0x55c603[_0xd555('0x2e')][_0xd555('0x2f')]){var _0x516e48=_[_0xd555('0x30')](_0x55c603[_0xd555('0x2e')],function(_0x2fce60){return _0x2fce60[_0xd555('0x31')][_0xd555('0x2c')]['value']===_0x4bac10;});if(_0x516e48){logger[_0xd555('0x29')](_0xd555('0x32'));return BPromise['resolve']({'id':_0x516e48[_0xd555('0x31')]['id'][_0xd555('0x33')],'name':_0x516e48['name_value_list'][_0xd555('0xd')][_0xd555('0x33')]});}}logger[_0xd555('0x29')](_0xd555('0x34'));return BPromise[_0xd555('0x35')]({'id':_0x951b52[_0xd555('0x31')][_0xd555('0x36')]['value'],'name':_0x951b52[_0xd555('0x31')][_0xd555('0x2c')][_0xd555('0x33')]});});}else{logger[_0xd555('0x29')](_0xd555('0x37'));return BPromise['resolve']({'id':_0x951b52[_0xd555('0x31')][_0xd555('0x36')][_0xd555('0x33')],'name':_0x951b52[_0xd555('0x31')][_0xd555('0x2c')][_0xd555('0x33')]});}}function getEndUser(_0x4305d7,_0xafb7ec,_0xaf2cf0,_0x488978){logger[_0xd555('0x29')]('Searching\x20enduser\x20with\x20phone',_0xaf2cf0);return request({'form':{'method':_0xd555('0x2b'),'input_type':_0xd555('0x20'),'response_type':_0xd555('0x20'),'rest_data':JSON[_0xd555('0x21')]({'session':_0x488978['id'],'module_name':_0xd555('0x1a'),'query':util[_0xd555('0x23')](_0xd555('0x38'),_0xaf2cf0),'order_by':'','offset':'0','select_fields':['id',_0xd555('0xd'),_0xd555('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x31d328){if(_0x31d328[_0xd555('0x2e')]['length']){var _0x55f9fd=_[_0xd555('0x30')](_0x31d328[_0xd555('0x2e')],function(_0xc6fab3){return _0xc6fab3[_0xd555('0x31')][_0xd555('0x39')]['value']===_0xaf2cf0;});if(_0x55f9fd){logger[_0xd555('0x29')](_0xd555('0x3a'));return BPromise[_0xd555('0x35')]({'id':_0x55f9fd[_0xd555('0x31')]['id'][_0xd555('0x33')],'name':_0x55f9fd[_0xd555('0x31')][_0xd555('0xd')]['value'],'phone':_0x55f9fd[_0xd555('0x31')][_0xd555('0x39')]['value']});}}else{logger[_0xd555('0x29')](_0xd555('0x3b'));return request({'form':{'method':_0xd555('0x3c'),'input_type':_0xd555('0x20'),'response_type':_0xd555('0x20'),'rest_data':JSON['stringify']({'session':_0x488978['id'],'module_name':'Contacts','name_value_list':[{'name':_0xd555('0x3d'),'value':_0xafb7ec!==_0xd555('0x3e')?_0xafb7ec:util[_0xd555('0x23')](_0xd555('0x3f'),_0xaf2cf0)},{'name':_0xd555('0x39'),'value':_0xaf2cf0}]})}})[_0xd555('0x2d')](function(_0x4434b3){logger['info'](_0xd555('0x40'));return BPromise[_0xd555('0x35')]({'id':_0x4434b3['id'],'name':_0x4434b3[_0xd555('0x2e')][_0xd555('0x3d')][_0xd555('0x33')],'phone':_0x4434b3[_0xd555('0x2e')][_0xd555('0x39')][_0xd555('0x33')]});});}});}function request(_0x26cf07){logger[_0xd555('0x41')](_0xd555('0x42'),JSON[_0xd555('0x21')](_0x26cf07));return rp(_[_0xd555('0x43')](def,_0x26cf07));}function getTags(_0x285eed,_0x511543){var _0x5d4eba=[];if(_0x285eed&&_0x285eed[_0xd555('0x2f')]>0x0){_0x5d4eba=_['map'](_0x285eed,_0x511543);}return _0x5d4eba;}function getCustomFields(_0x46a49a,_0x3f1c9d){var _0x31c786=[];var _0x358a6a={'custom_fields':[]};if(_0x46a49a['length']>0x0){_[_0xd555('0x1c')](_0x46a49a,function(_0x453af1){if(_0x453af1[_0xd555('0x44')]===_0xd555('0x45')&&_0x453af1[_0xd555('0x46')]&&!_0x453af1[_0xd555('0x47')]){_0x358a6a[_0x453af1['nameField'][_0xd555('0x48')]()]=_0x453af1[_0xd555('0x49')][_0xd555('0x26')]();}else if(_0x453af1[_0xd555('0x44')]===_0xd555('0x45')&&_0x453af1[_0xd555('0x1f')]&&_0x453af1[_0xd555('0x47')]){_0x358a6a[_0xd555('0x4a')][_0xd555('0x1e')]({'id':_0x453af1[_0xd555('0x1f')],'value':_0x453af1['content'][_0xd555('0x26')]()});}else if(_0x453af1['type']==='variable'&&_0x453af1[_0xd555('0x1d')]&&_0x453af1['idField']&&_0x453af1[_0xd555('0x47')]){_0x3f1c9d[_0x453af1['variableName']]&&_0x358a6a[_0xd555('0x4a')]['push']({'id':_0x453af1[_0xd555('0x1f')],'value':_0x3f1c9d[_0x453af1[_0xd555('0x1d')]]['toString']()});}else if(_0x453af1[_0xd555('0x44')]==='customVariable'&&_0x453af1[_0xd555('0x4b')]&&_0x453af1[_0xd555('0x4b')][_0xd555('0xd')]&&_0x453af1['idField']&&_0x453af1[_0xd555('0x47')]){_0x3f1c9d[_0x453af1['Variable'][_0xd555('0xd')][_0xd555('0x48')]()]&&_0x358a6a[_0xd555('0x4a')]['push']({'id':_0x453af1[_0xd555('0x1f')],'value':_0x3f1c9d[_0x453af1[_0xd555('0x4b')][_0xd555('0xd')][_0xd555('0x48')]()][_0xd555('0x26')]()});}});}return _0x358a6a;}function getConnection(_0xc2aa93){return request({'method':_0xd555('0xb'),'form':{'method':_0xd555('0x4c'),'input_type':'JSON','response_type':_0xd555('0x20'),'rest_data':JSON[_0xd555('0x21')]({'user_auth':{'user_name':_0xc2aa93[_0xd555('0x4d')],'password':_0xc2aa93['password'],'encryption':_0xd555('0x4e')},'application':_0xd555('0x4f')})}})[_0xd555('0x2d')](function(_0x530486){var _0xa86f96=_0x530486;if(_0xa86f96['id']){def[_0xd555('0x50')]=_0xa86f96['id'];return BPromise[_0xd555('0x35')](_0xa86f96);}else{throw new Error(util[_0xd555('0x23')](_0xd555('0x51'),_0xc2aa93['id']));}});}function setRelationship(_0x42099f,_0x15a644,_0x2f02bb,_0x1e1f63){return request({'form':{'method':_0xd555('0x52'),'input_type':_0xd555('0x20'),'response_type':_0xd555('0x20'),'rest_data':JSON[_0xd555('0x21')]({'session':_0x42099f['id'],'module_name':_0xd555('0x22'),'module_id':_0x2f02bb['id'],'link_field_name':_0x1e1f63,'related_ids':[_0x15a644['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1dc2eb,_0x190526,_0x407bfe,_0xc30e1,_0x42aa95,_0x35488f){var _0x509922,_0x221bbd,_0x3e5d89,_0x40096d;_0x35488f[_0xd555('0x53')]=intUtil[_0xd555('0x54')](_0x35488f[_0xd555('0x53')]);_0x35488f['serverUrl']=intUtil[_0xd555('0x54')](_0x35488f[_0xd555('0x55')]);def[_0xd555('0x56')]=util[_0xd555('0x23')](_0xd555('0x57'),_0x35488f['remoteUri']);if(_0x42aa95&&_0x42aa95[_0xd555('0x58')]){logger[_0xd555('0x29')](_0xd555('0x59'),'Recording\x20is\x20enabled!');_0x190526['recordingURL']=util[_0xd555('0x23')](_0xd555('0x5a'),_0x35488f['serverUrl'],_0x190526['uniqueid'],md5(_0x190526[_0xd555('0x5b')]));}else{_0x190526[_0xd555('0x5c')]='';}return getConnection(_0x35488f)[_0xd555('0x2d')](function(_0x203053){_0x40096d=_0x203053;return getUser(_0x35488f,_0xc30e1[_0xd555('0xd')],_0x40096d);})[_0xd555('0x2d')](function(_0x653cbe){_0x509922=_0x653cbe;logger[_0xd555('0x29')]('The\x20User\x20ID\x20is:',_0x509922['id']);return getEndUser(_0x35488f,_0x190526['calleridname'],_0x190526[_0xd555('0x5d')],_0x40096d);})['then'](function(_0x37513a){_0x221bbd=_0x37513a;logger[_0xd555('0x29')](_0xd555('0x5e'),_0x221bbd['id']);return getTicket(_0x35488f,_0x509922,_0x221bbd,_0x407bfe,_0x190526,_0x407bfe['Fields'],_0x40096d,_0xd555('0x5f'));})['then'](function(_0x344b31){_0x3e5d89=_0x344b31;logger[_0xd555('0x29')](_0xd555('0x60'));logger[_0xd555('0x29')](_0xd555('0x61'),_0x3e5d89['id']);return setRelationship(_0x40096d,_0x509922,_0x3e5d89,_0xd555('0x62'));})[_0xd555('0x2d')](function(){return setRelationship(_0x40096d,_0x221bbd,_0x3e5d89,_0xd555('0x63'));})[_0xd555('0x2d')](function(){return getServerInfo(_0x40096d);})['then'](function(_0x228188){var _0x58cdc0=parseInt(_0x228188[_0xd555('0x64')]['charAt'](0x0));var _0x4a7103=util[_0xd555('0x23')](_0xd555('0x65'),_0x35488f['remoteUri'],_0x3e5d89['id']);if(_0x58cdc0>0x6){_0x4a7103=util[_0xd555('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x35488f['remoteUri'],_0x3e5d89['id']);}logger[_0xd555('0x29')](_0xd555('0x59'),_0xd555('0x66'));emit(util[_0xd555('0x23')](_0xd555('0x67'),_0xc30e1[_0xd555('0xd')]),_0xd555('0x68'),{'uri':_0x4a7103});})[_0xd555('0x69')](function(_0x5a4956){logger[_0xd555('0x6a')](_0xd555('0x59'),JSON['stringify'](_0x5a4956));});};exports[_0xd555('0x6b')]=function(_0x7ae49d,_0x8198ca,_0x1cdf19,_0xdd6356,_0x1f1367,_0x3b5182,_0x30aaba){var _0x10de99,_0x201609,_0xa61f48,_0x13f797;_0x3b5182[_0xd555('0x53')]=intUtil[_0xd555('0x54')](_0x3b5182[_0xd555('0x53')]);_0x3b5182['serverUrl']=intUtil['stripTrailingSlash'](_0x3b5182[_0xd555('0x55')]);def[_0xd555('0x56')]=util[_0xd555('0x23')](_0xd555('0x57'),_0x3b5182[_0xd555('0x53')]);if(_0x30aaba&&_0x30aaba['recordingFormat']&&_0x30aaba['recordingFormat']!==_0xd555('0x6c')){logger[_0xd555('0x29')]('[OUTBOUND]',_0xd555('0x6d'));_0x8198ca[_0xd555('0x5c')]=util['format'](_0xd555('0x5a'),_0x3b5182[_0xd555('0x55')],_0x8198ca[_0xd555('0x5b')],md5(_0x8198ca[_0xd555('0x5b')]));}return getConnection(_0x3b5182)[_0xd555('0x2d')](function(_0x5d615f){_0x13f797=_0x5d615f;return getUser(_0x3b5182,_0xdd6356[_0xd555('0xd')],_0x13f797);})['then'](function(_0x3da143){_0x10de99=_0x3da143;logger['info'](_0xd555('0x6e'),_0x10de99['id']);return getEndUser(_0x3b5182,_0x8198ca[_0xd555('0x6f')],_0x8198ca[_0xd555('0x70')],_0x13f797);})[_0xd555('0x2d')](function(_0x39256c){_0x201609=_0x39256c;logger[_0xd555('0x29')](_0xd555('0x5e'),_0x201609['id']);return getTicket(_0x3b5182,_0x10de99,_0x201609,_0x1cdf19,_0x8198ca,_0x1cdf19[_0xd555('0x71')],_0x13f797,_0xd555('0x72'));})['then'](function(_0xdb63f0){_0xa61f48=_0xdb63f0;logger[_0xd555('0x29')]('Ticket\x20created!');logger[_0xd555('0x29')](_0xd555('0x61'),_0xa61f48['id']);return setRelationship(_0x13f797,_0x10de99,_0xa61f48,'users');})[_0xd555('0x2d')](function(){return setRelationship(_0x13f797,_0x201609,_0xa61f48,_0xd555('0x63'));})['then'](function(){return getServerInfo(_0x13f797);})[_0xd555('0x2d')](function(_0x237ee6){var _0x5a55ba=parseInt(_0x237ee6[_0xd555('0x64')][_0xd555('0x73')](0x0));var _0x2f0355=util[_0xd555('0x23')](_0xd555('0x65'),_0x3b5182[_0xd555('0x53')],_0xa61f48['id']);if(_0x5a55ba>0x6){_0x2f0355=util[_0xd555('0x23')](_0xd555('0x74'),_0x3b5182[_0xd555('0x53')],_0xa61f48['id']);}logger[_0xd555('0x29')](_0xd555('0x75'),_0xd555('0x66'));emit(util[_0xd555('0x23')]('user:%s',_0xdd6356[_0xd555('0xd')]),_0xd555('0x68'),{'uri':_0x2f0355});})[_0xd555('0x69')](function(_0x3f8a11){logger[_0xd555('0x6a')](_0xd555('0x75'),JSON[_0xd555('0x21')](_0x3f8a11));});};exports[_0xd555('0x76')]=function(_0x50dc1d,_0x3a86a2,_0x3f4967,_0x2a2cbf,_0x10c1d2,_0x154c9c){var _0x50a111,_0x55b7b8,_0x3562c3,_0x54e8f3;_0x154c9c[_0xd555('0x53')]=intUtil[_0xd555('0x54')](_0x154c9c[_0xd555('0x53')]);_0x154c9c['serverUrl']=intUtil[_0xd555('0x54')](_0x154c9c['serverUrl']);def[_0xd555('0x56')]=util[_0xd555('0x23')](_0xd555('0x57'),_0x154c9c[_0xd555('0x53')]);if(_0x10c1d2&&_0x10c1d2[_0xd555('0x58')]){logger[_0xd555('0x29')]('['+_0x3a86a2[_0xd555('0x77')][_0xd555('0x78')]()+']',_0xd555('0x6d'));_0x3a86a2[_0xd555('0x5c')]=util['format'](_0xd555('0x5a'),_0x154c9c['serverUrl'],_0x3a86a2[_0xd555('0x5b')],md5(_0x3a86a2[_0xd555('0x5b')]));}else{_0x3a86a2[_0xd555('0x5c')]='';}return getConnection(_0x154c9c)[_0xd555('0x2d')](function(_0x45b670){_0x54e8f3=_0x45b670;if(!_['isNil'](_0x2a2cbf)){return getUser(_0x154c9c,_0x2a2cbf['name'],_0x54e8f3);}else{return getUser(_0x154c9c,null,_0x54e8f3);}})[_0xd555('0x2d')](function(_0x28541b){_0x50a111=_0x28541b;logger[_0xd555('0x29')](_0xd555('0x6e'),_0x50a111['id']);return getEndUser(_0x154c9c,_0x3a86a2[_0xd555('0x79')],_0x3a86a2['calleridnum'],_0x54e8f3);})['then'](function(_0x5ad7a1){_0x55b7b8=_0x5ad7a1;logger['info'](_0xd555('0x5e'),_0x55b7b8['id']);return getTicket(_0x154c9c,_0x50a111,_0x55b7b8,_0x3f4967,_0x3a86a2,_0x3f4967[_0xd555('0x71')],_0x54e8f3,_0xd555('0x5f'));})['then'](function(_0x1b132e){_0x3562c3=_0x1b132e;logger[_0xd555('0x29')](_0xd555('0x60'));logger['info'](_0xd555('0x61'),_0x3562c3['id']);return setRelationship(_0x54e8f3,_0x50a111,_0x3562c3,_0xd555('0x62'));})[_0xd555('0x2d')](function(){return setRelationship(_0x54e8f3,_0x55b7b8,_0x3562c3,_0xd555('0x63'));})[_0xd555('0x2d')](function(){return getServerInfo(_0x54e8f3);})[_0xd555('0x69')](function(_0x374495){logger[_0xd555('0x6a')]('['+_0x3a86a2[_0xd555('0x77')]['toUpperCase']()+']',JSON[_0xd555('0x21')](_0x374495));});}; \ No newline at end of file +var _0xd598=['date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','variableName','push','idField','set_entry','JSON','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','get_entry_list','Employees','then','length','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','nameField','customField','string','custom_fields','content','variable','customVariable','Variable','toLowerCase','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','destcalleridname','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','unmanaged','monitor_format','calleridname','calleridnum','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xd598,0x1d2));var _0x8d59=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd598[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var rp=require(_0x8d59('0x0'));var BPromise=require('bluebird');var md5=require(_0x8d59('0x1'));var util=require(_0x8d59('0x2'));var Redis=require(_0x8d59('0x3'));var intUtil=require(_0x8d59('0x4'));var config=require(_0x8d59('0x5'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_[_0x8d59('0x6')](config[_0x8d59('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8d59('0x8'))(new Redis(config[_0x8d59('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x28030c,_0x34fb73,_0x1809d5){io['to'](_0x28030c)[_0x8d59('0x9')](_0x34fb73,_0x1809d5);}function getTicket(_0x6231a,_0x1473de,_0x3079d0,_0x215cc3,_0x4d4e45,_0x51c090,_0x590a1a,_0x562ea5){logger[_0x8d59('0xa')](_0x8d59('0xb'));var _0x1c7d93=new Date();var _0x55f851=[{'name':_0x8d59('0xc'),'value':intUtil[_0x8d59('0xd')](_0x215cc3[_0x8d59('0xe')],_0x4d4e45,'\x20')},{'name':'assigned_user_id','value':_0x1473de['id']},{'name':_0x8d59('0xf'),'value':_0x1473de['id']},{'name':_0x8d59('0x10'),'value':intUtil[_0x8d59('0xd')](_0x215cc3[_0x8d59('0x11')],_0x4d4e45,'\x0a')},{'name':_0x8d59('0x12'),'value':_0x1c7d93[_0x8d59('0x13')]()[_0x8d59('0x14')](0x0,0x13)[_0x8d59('0x15')]('T','\x20')},{'name':_0x8d59('0x16'),'value':'0'},{'name':_0x8d59('0x17'),'value':'15'},{'name':_0x8d59('0x18'),'value':_0x3079d0['id']},{'name':_0x8d59('0x19'),'value':_0x8d59('0x1a')},{'name':_0x8d59('0x1b'),'value':_0x3079d0[_0x8d59('0xc')]},{'name':_0x8d59('0x1c'),'value':_0x562ea5}];if(_0x51c090['length']){_['forEach'](_0x51c090,function(_0x1ff314){if(_0x4d4e45[_0x1ff314[_0x8d59('0x1d')]]){_0x55f851[_0x8d59('0x1e')]({'name':_0x1ff314[_0x8d59('0x1f')],'value':_0x4d4e45[_0x1ff314[_0x8d59('0x1d')]]});}});}return request({'form':{'method':_0x8d59('0x20'),'input_type':'JSON','response_type':_0x8d59('0x21'),'rest_data':JSON['stringify']({'session':_0x590a1a['id'],'module_name':'Calls','name_value_list':_0x55f851})}});}function getAuth(_0x4b3d80){return util[_0x8d59('0x22')](_0x8d59('0x23'),new Buffer(_0x4b3d80[_0x8d59('0x24')]+':X')[_0x8d59('0x25')](_0x8d59('0x26')));}function getServerInfo(_0x578372){return request({'form':{'method':_0x8d59('0x27'),'input_type':_0x8d59('0x21'),'response_type':_0x8d59('0x21'),'rest_data':JSON[_0x8d59('0x28')]({'session':_0x578372['id']})}});}function getUser(_0x466704,_0x17d832,_0x327891){if(!_[_0x8d59('0x29')](_0x17d832)){logger['info']('Getting\x20agent\x20with\x20name',_0x17d832);return request({'form':{'method':_0x8d59('0x2a'),'input_type':_0x8d59('0x21'),'response_type':_0x8d59('0x21'),'rest_data':JSON[_0x8d59('0x28')]({'session':_0x327891['id'],'module_name':_0x8d59('0x2b'),'query':util[_0x8d59('0x22')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x17d832),'order_by':'','offset':'0','select_fields':['id',_0x8d59('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8d59('0x2c')](function(_0x5ea920){if(_0x5ea920['entry_list'][_0x8d59('0x2d')]){var _0x5e3f5e=_[_0x8d59('0x2e')](_0x5ea920[_0x8d59('0x2f')],function(_0x13d5bf){return _0x13d5bf[_0x8d59('0x30')][_0x8d59('0x31')][_0x8d59('0x32')]===_0x17d832;});if(_0x5e3f5e){logger[_0x8d59('0xa')](_0x8d59('0x33'));return BPromise[_0x8d59('0x34')]({'id':_0x5e3f5e[_0x8d59('0x30')]['id'][_0x8d59('0x32')],'name':_0x5e3f5e[_0x8d59('0x30')][_0x8d59('0xc')][_0x8d59('0x32')]});}}logger['info'](_0x8d59('0x35'));return BPromise['resolve']({'id':_0x327891[_0x8d59('0x30')][_0x8d59('0x36')]['value'],'name':_0x327891[_0x8d59('0x30')]['user_name'][_0x8d59('0x32')]});});}else{logger['info'](_0x8d59('0x37'));return BPromise['resolve']({'id':_0x327891[_0x8d59('0x30')][_0x8d59('0x36')]['value'],'name':_0x327891[_0x8d59('0x30')][_0x8d59('0x31')][_0x8d59('0x32')]});}}function getEndUser(_0xfc7fa3,_0x4a35b9,_0x3d5ac3,_0x25c0a2){logger[_0x8d59('0xa')]('Searching\x20enduser\x20with\x20phone',_0x3d5ac3);return request({'form':{'method':_0x8d59('0x2a'),'input_type':_0x8d59('0x21'),'response_type':_0x8d59('0x21'),'rest_data':JSON[_0x8d59('0x28')]({'session':_0x25c0a2['id'],'module_name':'Contacts','query':util[_0x8d59('0x22')](_0x8d59('0x38'),_0x3d5ac3),'order_by':'','offset':'0','select_fields':['id',_0x8d59('0xc'),_0x8d59('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8d59('0x2c')](function(_0x58aaa0){if(_0x58aaa0[_0x8d59('0x2f')][_0x8d59('0x2d')]){var _0x1771f1=_[_0x8d59('0x2e')](_0x58aaa0['entry_list'],function(_0x3c4963){return _0x3c4963[_0x8d59('0x30')]['phone_home'][_0x8d59('0x32')]===_0x3d5ac3;});if(_0x1771f1){logger[_0x8d59('0xa')](_0x8d59('0x3a'));return BPromise[_0x8d59('0x34')]({'id':_0x1771f1[_0x8d59('0x30')]['id']['value'],'name':_0x1771f1[_0x8d59('0x30')]['name']['value'],'phone':_0x1771f1['name_value_list'][_0x8d59('0x39')][_0x8d59('0x32')]});}}else{logger[_0x8d59('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x8d59('0x20'),'input_type':_0x8d59('0x21'),'response_type':'JSON','rest_data':JSON[_0x8d59('0x28')]({'session':_0x25c0a2['id'],'module_name':'Contacts','name_value_list':[{'name':_0x8d59('0x3b'),'value':_0x4a35b9!==''?_0x4a35b9:util[_0x8d59('0x22')](_0x8d59('0x3c'),_0x3d5ac3)},{'name':_0x8d59('0x39'),'value':_0x3d5ac3}]})}})['then'](function(_0xdd6449){logger[_0x8d59('0xa')](_0x8d59('0x3d'));return BPromise[_0x8d59('0x34')]({'id':_0xdd6449['id'],'name':_0xdd6449[_0x8d59('0x2f')]['first_name']['value'],'phone':_0xdd6449['entry_list'][_0x8d59('0x39')]['value']});});}});}function request(_0x418887){logger['debug'](_0x8d59('0x3e'),JSON[_0x8d59('0x28')](_0x418887));return rp(_[_0x8d59('0x3f')](def,_0x418887));}function getTags(_0xce349a,_0x268300){var _0x19dcc7=[];if(_0xce349a&&_0xce349a[_0x8d59('0x2d')]>0x0){_0x19dcc7=_[_0x8d59('0x40')](_0xce349a,_0x268300);}return _0x19dcc7;}function getCustomFields(_0x2ab83f,_0x46d5fa){var _0x435f26=[];var _0x211b92={'custom_fields':[]};if(_0x2ab83f[_0x8d59('0x2d')]>0x0){_['forEach'](_0x2ab83f,function(_0x8d1898){if(_0x8d1898[_0x8d59('0x41')]==='string'&&_0x8d1898[_0x8d59('0x42')]&&!_0x8d1898[_0x8d59('0x43')]){_0x211b92[_0x8d1898[_0x8d59('0x42')]['toLowerCase']()]=_0x8d1898['content']['toString']();}else if(_0x8d1898[_0x8d59('0x41')]===_0x8d59('0x44')&&_0x8d1898[_0x8d59('0x1f')]&&_0x8d1898[_0x8d59('0x43')]){_0x211b92[_0x8d59('0x45')][_0x8d59('0x1e')]({'id':_0x8d1898[_0x8d59('0x1f')],'value':_0x8d1898[_0x8d59('0x46')][_0x8d59('0x25')]()});}else if(_0x8d1898[_0x8d59('0x41')]===_0x8d59('0x47')&&_0x8d1898[_0x8d59('0x1d')]&&_0x8d1898[_0x8d59('0x1f')]&&_0x8d1898[_0x8d59('0x43')]){_0x46d5fa[_0x8d1898[_0x8d59('0x1d')]]&&_0x211b92[_0x8d59('0x45')][_0x8d59('0x1e')]({'id':_0x8d1898[_0x8d59('0x1f')],'value':_0x46d5fa[_0x8d1898['variableName']][_0x8d59('0x25')]()});}else if(_0x8d1898[_0x8d59('0x41')]===_0x8d59('0x48')&&_0x8d1898[_0x8d59('0x49')]&&_0x8d1898['Variable'][_0x8d59('0xc')]&&_0x8d1898[_0x8d59('0x1f')]&&_0x8d1898[_0x8d59('0x43')]){_0x46d5fa[_0x8d1898[_0x8d59('0x49')][_0x8d59('0xc')][_0x8d59('0x4a')]()]&&_0x211b92[_0x8d59('0x45')]['push']({'id':_0x8d1898[_0x8d59('0x1f')],'value':_0x46d5fa[_0x8d1898[_0x8d59('0x49')][_0x8d59('0xc')]['toLowerCase']()][_0x8d59('0x25')]()});}});}return _0x211b92;}function getConnection(_0x47c341){return request({'method':_0x8d59('0x4b'),'form':{'method':_0x8d59('0x4c'),'input_type':_0x8d59('0x21'),'response_type':_0x8d59('0x21'),'rest_data':JSON[_0x8d59('0x28')]({'user_auth':{'user_name':_0x47c341[_0x8d59('0x4d')],'password':_0x47c341[_0x8d59('0x4e')],'encryption':'PLAIN'},'application':_0x8d59('0x4f')})}})['then'](function(_0x50db75){var _0x26196e=_0x50db75;if(_0x26196e['id']){def[_0x8d59('0x50')]=_0x26196e['id'];return BPromise[_0x8d59('0x34')](_0x26196e);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x47c341['id']));}});}function setRelationship(_0x2dc2a2,_0x57d436,_0x8225ae,_0x18045d){return request({'form':{'method':_0x8d59('0x51'),'input_type':_0x8d59('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2dc2a2['id'],'module_name':_0x8d59('0x52'),'module_id':_0x8225ae['id'],'link_field_name':_0x18045d,'related_ids':[_0x57d436['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3df7f4,_0x2e7d90,_0x5b97a4,_0x3b6483,_0x30967d,_0x2a835f){var _0x1ea3ab,_0x5b2b43,_0x53d33d,_0x53f5fa;_0x2a835f[_0x8d59('0x53')]=intUtil[_0x8d59('0x54')](_0x2a835f['remoteUri']);_0x2a835f[_0x8d59('0x55')]=intUtil[_0x8d59('0x54')](_0x2a835f['serverUrl']);def[_0x8d59('0x56')]=util['format'](_0x8d59('0x57'),_0x2a835f[_0x8d59('0x53')]);if(_0x30967d&&_0x30967d['monitor_format']){logger[_0x8d59('0xa')](_0x8d59('0x58'),_0x8d59('0x59'));_0x2e7d90[_0x8d59('0x5a')]=util[_0x8d59('0x22')](_0x8d59('0x5b'),_0x2a835f[_0x8d59('0x55')],_0x2e7d90['uniqueid'],md5(_0x2e7d90[_0x8d59('0x5c')]));}else{_0x2e7d90[_0x8d59('0x5a')]='';}return getConnection(_0x2a835f)['then'](function(_0x587c69){_0x53f5fa=_0x587c69;return getUser(_0x2a835f,_0x3b6483[_0x8d59('0xc')],_0x53f5fa);})[_0x8d59('0x2c')](function(_0x1fb8ab){_0x1ea3ab=_0x1fb8ab;logger[_0x8d59('0xa')](_0x8d59('0x5d'),_0x1ea3ab['id']);return getEndUser(_0x2a835f,_0x2e7d90['calleridname'],_0x2e7d90['calleridnum'],_0x53f5fa);})[_0x8d59('0x2c')](function(_0x5052ee){_0x5b2b43=_0x5052ee;logger[_0x8d59('0xa')](_0x8d59('0x5e'),_0x5b2b43['id']);return getTicket(_0x2a835f,_0x1ea3ab,_0x5b2b43,_0x5b97a4,_0x2e7d90,_0x5b97a4[_0x8d59('0x5f')],_0x53f5fa,_0x8d59('0x60'));})['then'](function(_0x21fc76){_0x53d33d=_0x21fc76;logger['info']('Ticket\x20created!');logger[_0x8d59('0xa')]('The\x20Ticket\x20ID\x20is:',_0x53d33d['id']);return setRelationship(_0x53f5fa,_0x1ea3ab,_0x53d33d,_0x8d59('0x61'));})[_0x8d59('0x2c')](function(){return setRelationship(_0x53f5fa,_0x5b2b43,_0x53d33d,'contacts');})[_0x8d59('0x2c')](function(){return getServerInfo(_0x53f5fa);})[_0x8d59('0x2c')](function(_0x247c50){var _0x1d2bc8=parseInt(_0x247c50[_0x8d59('0x62')][_0x8d59('0x63')](0x0));var _0x237d62=util['format'](_0x8d59('0x64'),_0x2a835f[_0x8d59('0x53')],_0x53d33d['id']);if(_0x1d2bc8>0x6){_0x237d62=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2a835f[_0x8d59('0x53')],_0x53d33d['id']);}logger['info'](_0x8d59('0x58'),_0x8d59('0x65'));emit(util['format'](_0x8d59('0x66'),_0x3b6483[_0x8d59('0xc')]),_0x8d59('0x67'),{'uri':_0x237d62});})[_0x8d59('0x68')](function(_0x53d58d){logger[_0x8d59('0x69')](_0x8d59('0x58'),JSON['stringify'](_0x53d58d));});};exports[_0x8d59('0x6a')]=function(_0x20a507,_0x1cbad2,_0x43541b,_0xfcd32a,_0x449f0f,_0x29a760,_0xf1cc1d){var _0x1a6d42,_0x582757,_0x7e6782,_0xfc99c8;_0x29a760['remoteUri']=intUtil[_0x8d59('0x54')](_0x29a760['remoteUri']);_0x29a760[_0x8d59('0x55')]=intUtil['stripTrailingSlash'](_0x29a760[_0x8d59('0x55')]);def[_0x8d59('0x56')]=util[_0x8d59('0x22')](_0x8d59('0x57'),_0x29a760['remoteUri']);if(_0xf1cc1d&&_0xf1cc1d[_0x8d59('0x6b')]&&_0xf1cc1d[_0x8d59('0x6b')]!==_0x8d59('0x6c')){logger[_0x8d59('0xa')]('[OUTBOUND]',_0x8d59('0x59'));_0x1cbad2[_0x8d59('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29a760[_0x8d59('0x55')],_0x1cbad2[_0x8d59('0x5c')],md5(_0x1cbad2[_0x8d59('0x5c')]));}return getConnection(_0x29a760)[_0x8d59('0x2c')](function(_0x3e00af){_0xfc99c8=_0x3e00af;return getUser(_0x29a760,_0xfcd32a[_0x8d59('0xc')],_0xfc99c8);})[_0x8d59('0x2c')](function(_0x48cdaf){_0x1a6d42=_0x48cdaf;logger[_0x8d59('0xa')]('The\x20User\x20ID\x20is:',_0x1a6d42['id']);return getEndUser(_0x29a760,_0x1cbad2[_0x8d59('0x6d')],_0x1cbad2['destcalleridnum'],_0xfc99c8);})[_0x8d59('0x2c')](function(_0x4edbdc){_0x582757=_0x4edbdc;logger[_0x8d59('0xa')](_0x8d59('0x5e'),_0x582757['id']);return getTicket(_0x29a760,_0x1a6d42,_0x582757,_0x43541b,_0x1cbad2,_0x43541b['Fields'],_0xfc99c8,_0x8d59('0x6e'));})[_0x8d59('0x2c')](function(_0x593339){_0x7e6782=_0x593339;logger[_0x8d59('0xa')](_0x8d59('0x6f'));logger[_0x8d59('0xa')](_0x8d59('0x70'),_0x7e6782['id']);return setRelationship(_0xfc99c8,_0x1a6d42,_0x7e6782,_0x8d59('0x61'));})[_0x8d59('0x2c')](function(){return setRelationship(_0xfc99c8,_0x582757,_0x7e6782,'contacts');})['then'](function(){return getServerInfo(_0xfc99c8);})[_0x8d59('0x2c')](function(_0x19578e){var _0xd625c9=parseInt(_0x19578e[_0x8d59('0x62')][_0x8d59('0x63')](0x0));var _0x4f560e=util[_0x8d59('0x22')](_0x8d59('0x64'),_0x29a760['remoteUri'],_0x7e6782['id']);if(_0xd625c9>0x6){_0x4f560e=util[_0x8d59('0x22')](_0x8d59('0x71'),_0x29a760[_0x8d59('0x53')],_0x7e6782['id']);}logger[_0x8d59('0xa')]('[OUTBOUND]',_0x8d59('0x65'));emit(util[_0x8d59('0x22')]('user:%s',_0xfcd32a[_0x8d59('0xc')]),_0x8d59('0x67'),{'uri':_0x4f560e});})[_0x8d59('0x68')](function(_0x153a3d){logger[_0x8d59('0x69')](_0x8d59('0x72'),JSON[_0x8d59('0x28')](_0x153a3d));});};exports[_0x8d59('0x73')]=function(_0x275ef8,_0x4aea68,_0x2005ac,_0x1fc61e,_0x532988,_0x4d6525){var _0x47fd4a,_0x8c7d9d,_0x1d58ae,_0x1d0043;_0x4d6525['remoteUri']=intUtil[_0x8d59('0x54')](_0x4d6525['remoteUri']);_0x4d6525['serverUrl']=intUtil[_0x8d59('0x54')](_0x4d6525['serverUrl']);def[_0x8d59('0x56')]=util[_0x8d59('0x22')](_0x8d59('0x57'),_0x4d6525[_0x8d59('0x53')]);if(_0x532988&&_0x532988[_0x8d59('0x74')]){logger['info']('['+_0x4aea68['lastevent']['toUpperCase']()+']',_0x8d59('0x59'));_0x4aea68['recordingURL']=util[_0x8d59('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d6525[_0x8d59('0x55')],_0x4aea68['uniqueid'],md5(_0x4aea68[_0x8d59('0x5c')]));}else{_0x4aea68[_0x8d59('0x5a')]='';}return getConnection(_0x4d6525)[_0x8d59('0x2c')](function(_0x24b872){_0x1d0043=_0x24b872;if(!_[_0x8d59('0x29')](_0x1fc61e)){return getUser(_0x4d6525,_0x1fc61e[_0x8d59('0xc')],_0x1d0043);}else{return getUser(_0x4d6525,null,_0x1d0043);}})[_0x8d59('0x2c')](function(_0x20bc0f){_0x47fd4a=_0x20bc0f;logger[_0x8d59('0xa')](_0x8d59('0x5d'),_0x47fd4a['id']);return getEndUser(_0x4d6525,_0x4aea68[_0x8d59('0x75')],_0x4aea68[_0x8d59('0x76')],_0x1d0043);})[_0x8d59('0x2c')](function(_0x17961d){_0x8c7d9d=_0x17961d;logger['info'](_0x8d59('0x5e'),_0x8c7d9d['id']);return getTicket(_0x4d6525,_0x47fd4a,_0x8c7d9d,_0x2005ac,_0x4aea68,_0x2005ac[_0x8d59('0x5f')],_0x1d0043,_0x8d59('0x60'));})[_0x8d59('0x2c')](function(_0x2061c7){_0x1d58ae=_0x2061c7;logger[_0x8d59('0xa')]('Ticket\x20created!');logger[_0x8d59('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1d58ae['id']);return setRelationship(_0x1d0043,_0x47fd4a,_0x1d58ae,_0x8d59('0x61'));})['then'](function(){return setRelationship(_0x1d0043,_0x8c7d9d,_0x1d58ae,'contacts');})['then'](function(){return getServerInfo(_0x1d0043);})[_0x8d59('0x68')](function(_0x4e10e9){logger[_0x8d59('0x69')]('['+_0x4aea68[_0x8d59('0x77')][_0x8d59('0x78')]()+']',JSON['stringify'](_0x4e10e9));});}; \ 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 c96a3ff..2d28e68 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 _0xa2ce=['Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','variable','keyType','join','slice','substring','lastIndexOf','isNil','test','lodash','util','length','sortBy','type','string','push','variableName','toString'];(function(_0x440bdb,_0x22a128){var _0x363c42=function(_0x21a5a5){while(--_0x21a5a5){_0x440bdb['push'](_0x440bdb['shift']());}};_0x363c42(++_0x22a128);}(_0xa2ce,0x1b9));var _0xea2c=function(_0x3bb556,_0x5a2e74){_0x3bb556=_0x3bb556-0x0;var _0x346e9f=_0xa2ce[_0x3bb556];return _0x346e9f;};'use strict';var _=require(_0xea2c('0x0'));var util=require(_0xea2c('0x1'));exports['getString']=function(_0x3bcda1,_0x12b7f8,_0x28e7c1){var _0xcef791=[];if(_0x3bcda1[_0xea2c('0x2')]>0x0){var _0x3377f3=_[_0xea2c('0x3')](_0x3bcda1,['id']);for(var _0x55bfe5=0x0;_0x55bfe5<_0x3377f3[_0xea2c('0x2')];_0x55bfe5++){var _0x189293=_0x3377f3[_0x55bfe5];if(_0x189293[_0xea2c('0x4')]===_0xea2c('0x5')){_0xcef791[_0xea2c('0x6')](_0x189293['content']);}else if(_0x189293[_0xea2c('0x4')]==='variable'&&_0x189293[_0xea2c('0x7')]){_0x12b7f8[_0x189293['variableName']]&&_0xcef791[_0xea2c('0x6')](_0x12b7f8[_0x189293['variableName']][_0xea2c('0x8')]());}else if(_0x189293[_0xea2c('0x4')]==='customVariable'&&_0x189293[_0xea2c('0x9')]&&_0x189293['Variable'][_0xea2c('0xa')]){_0x12b7f8[_0x189293[_0xea2c('0x9')][_0xea2c('0xa')]['toLowerCase']()]&&_0xcef791['push'](_0x12b7f8[_0x189293[_0xea2c('0x9')][_0xea2c('0xa')][_0xea2c('0xb')]()][_0xea2c('0x8')]());}else if(_0x189293['type']===_0xea2c('0xc')){if(_0x189293['keyType']===_0xea2c('0x5')&&_0x189293[_0xea2c('0xd')]){_0xcef791['push'](util[_0xea2c('0xe')](_0xea2c('0xf'),_0x189293[_0xea2c('0xd')],_0x189293[_0xea2c('0x10')]));}else if(_0x189293['keyType']===_0xea2c('0x11')&&_0x189293['variableName']&&_0x189293[_0xea2c('0xd')]){_0x12b7f8[_0x189293['variableName']]&&_0xcef791[_0xea2c('0x6')](util[_0xea2c('0xe')](_0xea2c('0xf'),_0x189293[_0xea2c('0xd')],_0x12b7f8[_0x189293['variableName']]));}else if(_0x189293[_0xea2c('0x12')]==='customVariable'&&_0x189293['Variable']&&_0x189293['Variable'][_0xea2c('0xa')]&&_0x189293[_0xea2c('0xd')]){_0x12b7f8[_0x189293['Variable'][_0xea2c('0xa')][_0xea2c('0xb')]()]&&_0xcef791['push'](util[_0xea2c('0xe')](_0xea2c('0xf'),_0x189293['key'],_0x12b7f8[_0x189293[_0xea2c('0x9')][_0xea2c('0xa')][_0xea2c('0xb')]()]));}}}}return _0xcef791[_0xea2c('0x13')](_0x28e7c1);};exports['stripTrailingSlash']=function(_0xc39f8c){var _0x2a5dba=_0xc39f8c[_0xea2c('0x14')](-0x1);if(_0x2a5dba==='/'){_0xc39f8c=_0xc39f8c[_0xea2c('0x15')](0x0,_0xc39f8c[_0xea2c('0x16')](_0x2a5dba));}return _0xc39f8c;};exports['validateEmail']=function(_0x3dde01){if(!_[_0xea2c('0x17')](_0x3dde01)&&_0x3dde01!==''){var _0x34f443=/^(([^<>()\[\]\\.,;:\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 _0x34f443[_0xea2c('0x18')](String(_0x3dde01)[_0xea2c('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xac81=['format','%s:\x20%s','keyContent','join','substring','lastIndexOf','isNil','test','lodash','util','getString','length','string','push','type','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xac81,0x98));var _0x1ac8=function(_0x2afc24,_0x5a7d12){_0x2afc24=_0x2afc24-0x0;var _0x343d2c=_0xac81[_0x2afc24];return _0x343d2c;};'use strict';var _=require(_0x1ac8('0x0'));var util=require(_0x1ac8('0x1'));exports[_0x1ac8('0x2')]=function(_0x318c19,_0xf5c15b,_0x3b2b11){var _0x1a8290=[];if(_0x318c19[_0x1ac8('0x3')]>0x0){var _0x4fe556=_['sortBy'](_0x318c19,['id']);for(var _0x37547d=0x0;_0x37547d<_0x4fe556[_0x1ac8('0x3')];_0x37547d++){var _0x5396f1=_0x4fe556[_0x37547d];if(_0x5396f1['type']===_0x1ac8('0x4')){_0x1a8290[_0x1ac8('0x5')](_0x5396f1['content']);}else if(_0x5396f1[_0x1ac8('0x6')]==='variable'&&_0x5396f1[_0x1ac8('0x7')]){_0xf5c15b[_0x5396f1['variableName']]&&_0x1a8290['push'](_0xf5c15b[_0x5396f1['variableName']]['toString']());}else if(_0x5396f1[_0x1ac8('0x6')]===_0x1ac8('0x8')&&_0x5396f1[_0x1ac8('0x9')]&&_0x5396f1['Variable'][_0x1ac8('0xa')]){_0xf5c15b[_0x5396f1[_0x1ac8('0x9')][_0x1ac8('0xa')]['toLowerCase']()]&&_0x1a8290[_0x1ac8('0x5')](_0xf5c15b[_0x5396f1[_0x1ac8('0x9')][_0x1ac8('0xa')][_0x1ac8('0xb')]()][_0x1ac8('0xc')]());}else if(_0x5396f1[_0x1ac8('0x6')]===_0x1ac8('0xd')){if(_0x5396f1[_0x1ac8('0xe')]===_0x1ac8('0x4')&&_0x5396f1[_0x1ac8('0xf')]){_0x1a8290[_0x1ac8('0x5')](util[_0x1ac8('0x10')](_0x1ac8('0x11'),_0x5396f1[_0x1ac8('0xf')],_0x5396f1[_0x1ac8('0x12')]));}else if(_0x5396f1['keyType']==='variable'&&_0x5396f1[_0x1ac8('0x7')]&&_0x5396f1[_0x1ac8('0xf')]){_0xf5c15b[_0x5396f1[_0x1ac8('0x7')]]&&_0x1a8290[_0x1ac8('0x5')](util[_0x1ac8('0x10')](_0x1ac8('0x11'),_0x5396f1[_0x1ac8('0xf')],_0xf5c15b[_0x5396f1[_0x1ac8('0x7')]]));}else if(_0x5396f1[_0x1ac8('0xe')]===_0x1ac8('0x8')&&_0x5396f1[_0x1ac8('0x9')]&&_0x5396f1[_0x1ac8('0x9')][_0x1ac8('0xa')]&&_0x5396f1['key']){_0xf5c15b[_0x5396f1[_0x1ac8('0x9')]['name'][_0x1ac8('0xb')]()]&&_0x1a8290[_0x1ac8('0x5')](util[_0x1ac8('0x10')](_0x1ac8('0x11'),_0x5396f1['key'],_0xf5c15b[_0x5396f1[_0x1ac8('0x9')][_0x1ac8('0xa')][_0x1ac8('0xb')]()]));}}}}return _0x1a8290[_0x1ac8('0x13')](_0x3b2b11);};exports['stripTrailingSlash']=function(_0x28371c){var _0x209f58=_0x28371c['slice'](-0x1);if(_0x209f58==='/'){_0x28371c=_0x28371c[_0x1ac8('0x14')](0x0,_0x28371c[_0x1ac8('0x15')](_0x209f58));}return _0x28371c;};exports['validateEmail']=function(_0x7520d){if(!_[_0x1ac8('0x16')](_0x7520d)&&_0x7520d!==''){var _0x1f6843=/^(([^<>()\[\]\\.,;:\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 _0x1f6843[_0x1ac8('0x17')](String(_0x7520d)[_0x1ac8('0xb')]());}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 859f4d3..cefa387 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x3fa142,_0x2b8a96){var _0x341ffb=function(_0x39558d){while(--_0x39558d){_0x3fa142['push'](_0x3fa142['shift']());}};_0x341ffb(++_0x2b8a96);}(_0x34e8,0x12c));var _0x834e=function(_0x39724d,_0x401ec7){_0x39724d=_0x39724d-0x0;var _0x1f25d2=_0x34e8[_0x39724d];return _0x1f25d2;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index f13a2c8..6501979 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 _0x94f2=['Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','recordingURL','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','./util','../../../../config/logger','zendesk','defaults','redis','localhost','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','getString','Descriptions','then','Ticket\x20created!','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','%s:%s','username','password','token','Basic\x20%s','base64','[HTTP]','stringify','GET','length','map','forEach','picklist','nameField','customField','toLowerCase','content','toString','includes','string','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','serverUrl','stripTrailingSlash','monitor_format'];(function(_0x293675,_0x4325f3){var _0x50096c=function(_0x3616b8){while(--_0x3616b8){_0x293675['push'](_0x293675['shift']());}};_0x50096c(++_0x4325f3);}(_0x94f2,0xf2));var _0x294f=function(_0x3a362b,_0x461d93){_0x3a362b=_0x3a362b-0x0;var _0x1a1943=_0x94f2[_0x3a362b];return _0x1a1943;};'use strict';var _=require(_0x294f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x294f('0x1'));var Redis=require('ioredis');var intUtil=require(_0x294f('0x2'));var config=require('../../../../config/environment');var logger=require(_0x294f('0x3'))(_0x294f('0x4'));config['redis']=_[_0x294f('0x5')](config[_0x294f('0x6')],{'host':_0x294f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x294f('0x6')]));function emit(_0x2c8d13,_0x4f836f,_0xe51dcb){io['to'](_0x2c8d13)['emit'](_0x4f836f,_0xe51dcb);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0xd24710,_0x4c4ea6,_0x7963c8,_0x3426af,_0xe1fb25){logger[_0x294f('0x8')](_0x294f('0x9'));return request({'uri':util[_0x294f('0xa')]('%s/tickets.json',_0xd24710[_0x294f('0xb')]),'method':_0x294f('0xc'),'body':{'ticket':_[_0x294f('0xd')]({'requester_id':_0x7963c8['id'],'submitter_id':_0x4c4ea6?_0x4c4ea6['id']:undefined,'assignee_id':_0x4c4ea6?_0x4c4ea6['id']:undefined,'tags':getTags(_0x3426af['Tags'],'name'),'subject':intUtil['getString'](_0x3426af['Subjects'],_0xe1fb25,'\x20'),'description':intUtil[_0x294f('0xe')](_0x3426af[_0x294f('0xf')],_0xe1fb25,'\x0a'),'comment':{'public':![],'body':intUtil[_0x294f('0xe')](_0x3426af[_0x294f('0xf')],_0xe1fb25,'\x0a')}},getCustomFields(_0x3426af['Fields'],_0xe1fb25))}})[_0x294f('0x10')](function(_0x53e4e8){logger[_0x294f('0x8')](_0x294f('0x11'));return _0x53e4e8[_0x294f('0x12')];});}function getUser(_0x324904,_0xa149c3){if(intUtil['validateEmail'](_0xa149c3)){logger[_0x294f('0x8')]('Getting\x20agent\x20with\x20email',_0xa149c3);return request({'uri':util[_0x294f('0xa')](_0x294f('0x13'),_0x324904[_0x294f('0xb')]),'qs':{'query':util[_0x294f('0xa')](_0x294f('0x14'),_0xa149c3)}})[_0x294f('0x10')](function(_0x276e0e){if(_0x276e0e[_0x294f('0x15')]){logger['info'](_0x294f('0x16'));return _[_0x294f('0x17')](_0x276e0e[_0x294f('0x18')],{'email':_0xa149c3,'role':'agent'});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x294f('0xa')]('%s/users/me.json',_0x324904[_0x294f('0xb')])})[_0x294f('0x10')](function(_0x2dd70c){logger['info']('Admin\x20account\x20selected.');return _0x2dd70c[_0x294f('0x19')];});}});}else{logger[_0x294f('0x8')](_0x294f('0x1a'));return request({'uri':util[_0x294f('0xa')](_0x294f('0x1b'),_0x324904[_0x294f('0xb')])})['then'](function(_0x14fc83){logger['info'](_0x294f('0x1c'));return _0x14fc83[_0x294f('0x19')];});}}function getEndUser(_0x354922,_0x2e98b4,_0x402987){logger[_0x294f('0x8')](_0x294f('0x1d'),_0x402987);return request({'uri':util['format'](_0x294f('0x13'),_0x354922[_0x294f('0xb')]),'qs':{'query':util[_0x294f('0xa')]('type:user\x20role:end-user\x20phone:%s',_0x402987)}})[_0x294f('0x10')](function(_0x5c5eb7){var _0x35759e;if(_0x5c5eb7['results']['length']){_0x5c5eb7[_0x294f('0x18')]=_[_0x294f('0x1e')](_0x5c5eb7[_0x294f('0x18')],{'suspended':![],'role':_0x294f('0x1f')});if(_0x5c5eb7['results']['length']){_0x35759e=_[_0x294f('0x20')](_0x5c5eb7[_0x294f('0x18')]);}}if(_0x35759e){logger[_0x294f('0x8')](_0x294f('0x21'));return _0x35759e;}else{logger[_0x294f('0x8')](_0x294f('0x22'));return request({'uri':util[_0x294f('0xa')](_0x294f('0x23'),_0x354922['remoteUri']),'method':_0x294f('0xc'),'body':{'user':{'role':_0x294f('0x1f'),'name':util[_0x294f('0xa')](_0x294f('0x24'),_0x2e98b4||_0x402987),'phone':_0x402987}}})['then'](function(_0x542576){logger[_0x294f('0x8')]('Enduser\x20created.');return _0x542576['user'];});}});}function getAuth(_0x205039){var _0x3992a0;if(_0x205039[_0x294f('0x25')]==='password'){_0x3992a0=util[_0x294f('0xa')](_0x294f('0x26'),_0x205039[_0x294f('0x27')],_0x205039[_0x294f('0x28')]);}else if(_0x205039[_0x294f('0x25')]===_0x294f('0x29')){_0x3992a0=util['format']('%s/token:%s',_0x205039[_0x294f('0x27')],_0x205039[_0x294f('0x29')]);}return util[_0x294f('0xa')](_0x294f('0x2a'),new Buffer(_0x3992a0)['toString'](_0x294f('0x2b')));}function request(_0x52466d){logger['debug'](_0x294f('0x2c'),JSON[_0x294f('0x2d')](_0x52466d));return rp(_['defaults'](_0x52466d,{'method':_0x294f('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x1440d3,_0xec4a3e){var _0x31024d=[];if(_0x1440d3&&_0x1440d3[_0x294f('0x2f')]>0x0){_0x31024d=_[_0x294f('0x30')](_0x1440d3,_0xec4a3e);}return _0x31024d;}function getCustomFields(_0x23158d,_0x28419b){var _0x48b20b=[];var _0x4fac57={'custom_fields':[]};if(_0x23158d[_0x294f('0x2f')]>0x0){_[_0x294f('0x31')](_0x23158d,function(_0x236efb){if(_['includes'](['string',_0x294f('0x32')],_0x236efb['type'])&&_0x236efb[_0x294f('0x33')]&&!_0x236efb[_0x294f('0x34')]){_0x4fac57[_0x236efb[_0x294f('0x33')][_0x294f('0x35')]()]=_0x236efb[_0x294f('0x36')][_0x294f('0x37')]();}else if(_[_0x294f('0x38')]([_0x294f('0x39'),_0x294f('0x32')],_0x236efb[_0x294f('0x3a')])&&_0x236efb[_0x294f('0x3b')]&&_0x236efb[_0x294f('0x34')]){_0x4fac57[_0x294f('0x3c')][_0x294f('0x3d')]({'id':_0x236efb['idField'],'value':_0x236efb['content']['toString']()});}else if(_0x236efb[_0x294f('0x3a')]===_0x294f('0x3e')&&_0x236efb[_0x294f('0x3f')]&&_0x236efb[_0x294f('0x3b')]&&_0x236efb['customField']){_0x28419b[_0x236efb[_0x294f('0x3f')]]&&_0x4fac57['custom_fields']['push']({'id':_0x236efb['idField'],'value':_0x28419b[_0x236efb[_0x294f('0x3f')]][_0x294f('0x37')]()});}else if(_0x236efb[_0x294f('0x3a')]===_0x294f('0x40')&&_0x236efb['Variable']&&_0x236efb[_0x294f('0x41')][_0x294f('0x42')]&&_0x236efb[_0x294f('0x3b')]&&_0x236efb[_0x294f('0x34')]){_0x28419b[_0x236efb[_0x294f('0x41')][_0x294f('0x42')][_0x294f('0x35')]()]&&_0x4fac57[_0x294f('0x3c')][_0x294f('0x3d')]({'id':_0x236efb[_0x294f('0x3b')],'value':_0x28419b[_0x236efb[_0x294f('0x41')]['name']['toLowerCase']()][_0x294f('0x37')]()});}});}return _0x4fac57;}exports['queue']=function(_0x5542ab,_0x15ec7b,_0x30aac4,_0xa40d55,_0x3383ec,_0x585e12){var _0x25fa24,_0x4f0ae7;_0x585e12[_0x294f('0xb')]=intUtil['stripTrailingSlash'](_0x585e12[_0x294f('0xb')]);_0x585e12[_0x294f('0x43')]=intUtil[_0x294f('0x44')](_0x585e12[_0x294f('0x43')]);if(_0x3383ec&&_0x3383ec[_0x294f('0x45')]){logger[_0x294f('0x8')]('[QUEUE]',_0x294f('0x46'));_0x15ec7b['recordingURL']=util[_0x294f('0xa')](_0x294f('0x47'),_0x585e12[_0x294f('0x43')],_0x15ec7b[_0x294f('0x48')],md5(_0x15ec7b[_0x294f('0x48')]));}else{_0x15ec7b['recordingURL']='';}headers['Authorization']=getAuth(_0x585e12);return getUser(_0x585e12,_0xa40d55[_0x294f('0x49')])['then'](function(_0x4d3d08){_0x25fa24=_0x4d3d08;logger[_0x294f('0x8')]('The\x20User\x20ID\x20is:',_0x25fa24['id']);return getEndUser(_0x585e12,_0x15ec7b['calleridname'],_0x15ec7b[_0x294f('0x4a')]);})[_0x294f('0x10')](function(_0x592ef2){_0x4f0ae7=_0x592ef2;logger[_0x294f('0x8')]('The\x20Enduser\x20ID\x20is:',_0x4f0ae7['id']);return getTicket(_0x585e12,_0x25fa24,_0x4f0ae7,_0x30aac4,_0x15ec7b);})[_0x294f('0x10')](function(_0x285e4c){if(_0x285e4c){logger[_0x294f('0x8')]('The\x20Ticket\x20ID\x20is:',_0x285e4c['id']);switch(_0x585e12[_0x294f('0x3a')]){case _0x294f('0x4b'):logger[_0x294f('0x8')](_0x294f('0x4c'),_0x294f('0x4d'));return request({'uri':util[_0x294f('0xa')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x585e12[_0x294f('0xb')],_0x25fa24['id'],_0x285e4c['id']),'method':_0x294f('0xc')});case _0x294f('0x4e'):logger[_0x294f('0x8')](_0x294f('0x4c'),_0x294f('0x4f'));emit(util['format']('user:%s',_0xa40d55[_0x294f('0x42')]),'trigger:browser:url',{'uri':util[_0x294f('0xa')]('%s/agent/tickets/%s',_0x585e12[_0x294f('0xb')][_0x294f('0x50')]('/api/v2',''),_0x285e4c['id'])});break;default:logger[_0x294f('0x51')](_0x294f('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x294f('0x52')](function(_0x54f13c){logger[_0x294f('0x51')](_0x294f('0x53'),util['inspect'](_0x54f13c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x43a6a5,_0x295978,_0x165d10,_0xe57761,_0x473a89,_0x19e911,_0x1c11d8){var _0x792058,_0x1f4fd5;_0x19e911[_0x294f('0xb')]=intUtil[_0x294f('0x44')](_0x19e911[_0x294f('0xb')]);_0x19e911['serverUrl']=intUtil[_0x294f('0x44')](_0x19e911['serverUrl']);if(_0x1c11d8&&_0x1c11d8[_0x294f('0x54')]&&_0x1c11d8['recordingFormat']!==_0x294f('0x55')){logger[_0x294f('0x8')](_0x294f('0x56'),_0x294f('0x46'));_0x295978[_0x294f('0x57')]=util[_0x294f('0xa')](_0x294f('0x47'),_0x19e911['serverUrl'],_0x295978['uniqueid'],md5(_0x295978[_0x294f('0x48')]));}headers[_0x294f('0x58')]=getAuth(_0x19e911);return getUser(_0x19e911,_0xe57761[_0x294f('0x49')])[_0x294f('0x10')](function(_0x343e75){_0x792058=_0x343e75;logger[_0x294f('0x8')](_0x294f('0x59'),_0x792058['id']);return getEndUser(_0x19e911,_0x295978[_0x294f('0x5a')],_0x295978[_0x294f('0x5b')]);})['then'](function(_0x55146b){_0x1f4fd5=_0x55146b;logger[_0x294f('0x8')]('The\x20Enduser\x20ID\x20is:',_0x1f4fd5['id']);return getTicket(_0x19e911,_0x792058,_0x1f4fd5,_0x165d10,_0x295978);})[_0x294f('0x10')](function(_0x4a68e6){if(_0x4a68e6){logger[_0x294f('0x8')](_0x294f('0x5c'),_0x4a68e6['id']);switch(_0x19e911[_0x294f('0x3a')]){case _0x294f('0x4b'):logger['info'](_0x294f('0x56'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x294f('0x5d'),_0x19e911[_0x294f('0xb')],_0x792058['id'],_0x4a68e6['id']),'method':_0x294f('0xc')});case _0x294f('0x4e'):logger[_0x294f('0x8')](_0x294f('0x56'),_0x294f('0x4f'));emit(util[_0x294f('0xa')](_0x294f('0x5e'),_0xe57761[_0x294f('0x42')]),_0x294f('0x5f'),{'uri':util[_0x294f('0xa')](_0x294f('0x60'),_0x19e911['remoteUri'][_0x294f('0x50')]('/api/v2',''),_0x4a68e6['id'])});break;default:logger[_0x294f('0x51')](_0x294f('0x56'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x294f('0x52')](function(_0x4eaccd){logger[_0x294f('0x51')](_0x294f('0x61'),util[_0x294f('0x62')](_0x4eaccd,{'showHidden':!![],'depth':null}));});};exports[_0x294f('0x63')]=function(_0xbe1f33,_0x933e5,_0x3739a3,_0x2120ec,_0x3ebf76,_0x3dc5e2){var _0xf52f1b,_0x38f7d3;_0x3dc5e2[_0x294f('0xb')]=intUtil['stripTrailingSlash'](_0x3dc5e2[_0x294f('0xb')]);_0x3dc5e2[_0x294f('0x43')]=intUtil[_0x294f('0x44')](_0x3dc5e2[_0x294f('0x43')]);if(_0x3ebf76&&_0x3ebf76['monitor_format']){logger[_0x294f('0x8')]('['+_0x933e5[_0x294f('0x64')][_0x294f('0x65')]()+']',_0x294f('0x46'));_0x933e5[_0x294f('0x57')]=util[_0x294f('0xa')](_0x294f('0x47'),_0x3dc5e2[_0x294f('0x43')],_0x933e5[_0x294f('0x48')],md5(_0x933e5[_0x294f('0x48')]));}else{_0x933e5[_0x294f('0x57')]='';}headers['Authorization']=getAuth(_0x3dc5e2);return getUser(_0x3dc5e2)[_0x294f('0x10')](function(_0x1d12cf){_0xf52f1b=_0x1d12cf;logger[_0x294f('0x8')](_0x294f('0x59'),_0xf52f1b['id']);return getEndUser(_0x3dc5e2,_0x933e5[_0x294f('0x66')],_0x933e5[_0x294f('0x4a')]);})[_0x294f('0x10')](function(_0x48c271){_0x38f7d3=_0x48c271;logger[_0x294f('0x8')]('The\x20Enduser\x20ID\x20is:',_0x38f7d3['id']);return getTicket(_0x3dc5e2,_0xf52f1b,_0x38f7d3,_0x3739a3,_0x933e5);})['then'](function(_0x539348){if(_0x539348){logger[_0x294f('0x8')](_0x294f('0x5c'),_0x539348['id']);}})[_0x294f('0x52')](function(_0x403e3f){logger['error']('['+_0x933e5[_0x294f('0x64')][_0x294f('0x65')]()+']'+_0x294f('0x67'),util[_0x294f('0x62')](_0x403e3f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x94e9=['Agent\x20found!','find','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','nameField','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','%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','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','newTab','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','getString','Subjects','Descriptions','Fields','then','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x94e9,0x146));var _0x994e=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x94e9[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x994e('0x0'));var rp=require(_0x994e('0x1'));var md5=require(_0x994e('0x2'));var util=require(_0x994e('0x3'));var Redis=require(_0x994e('0x4'));var intUtil=require(_0x994e('0x5'));var config=require(_0x994e('0x6'));var logger=require(_0x994e('0x7'))('zendesk');config[_0x994e('0x8')]=_['defaults'](config[_0x994e('0x8')],{'host':_0x994e('0x9'),'port':0x18eb});var io=require(_0x994e('0xa'))(new Redis(config[_0x994e('0x8')]));function emit(_0x2dc70a,_0x604766,_0x2cf1c6){io['to'](_0x2dc70a)[_0x994e('0xb')](_0x604766,_0x2cf1c6);}var headers={'Content-Type':_0x994e('0xc'),'Accept':_0x994e('0xc')};function getTicket(_0x310d98,_0x1514ee,_0x274acb,_0x3becb2,_0x41fc74){logger[_0x994e('0xd')](_0x994e('0xe'));return request({'uri':util[_0x994e('0xf')](_0x994e('0x10'),_0x310d98[_0x994e('0x11')]),'method':'POST','body':{'ticket':_[_0x994e('0x12')]({'requester_id':_0x274acb['id'],'submitter_id':_0x1514ee?_0x1514ee['id']:undefined,'assignee_id':_0x1514ee?_0x1514ee['id']:undefined,'tags':getTags(_0x3becb2['Tags'],'name'),'subject':intUtil[_0x994e('0x13')](_0x3becb2[_0x994e('0x14')],_0x41fc74,'\x20'),'description':intUtil['getString'](_0x3becb2[_0x994e('0x15')],_0x41fc74,'\x0a'),'comment':{'public':![],'body':intUtil[_0x994e('0x13')](_0x3becb2[_0x994e('0x15')],_0x41fc74,'\x0a')}},getCustomFields(_0x3becb2[_0x994e('0x16')],_0x41fc74))}})[_0x994e('0x17')](function(_0x540622){logger[_0x994e('0xd')]('Ticket\x20created!');return _0x540622[_0x994e('0x18')];});}function getUser(_0x11397c,_0x2aac9b){if(intUtil['validateEmail'](_0x2aac9b)){logger['info']('Getting\x20agent\x20with\x20email',_0x2aac9b);return request({'uri':util[_0x994e('0xf')](_0x994e('0x19'),_0x11397c[_0x994e('0x11')]),'qs':{'query':util[_0x994e('0xf')](_0x994e('0x1a'),_0x2aac9b)}})[_0x994e('0x17')](function(_0x2d8bb3){if(_0x2d8bb3[_0x994e('0x1b')]){logger[_0x994e('0xd')](_0x994e('0x1c'));return _[_0x994e('0x1d')](_0x2d8bb3['results'],{'email':_0x2aac9b,'role':_0x994e('0x1e')});}else{logger[_0x994e('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x994e('0xf')](_0x994e('0x1f'),_0x11397c[_0x994e('0x11')])})[_0x994e('0x17')](function(_0x4b6d9a){logger[_0x994e('0xd')]('Admin\x20account\x20selected.');return _0x4b6d9a[_0x994e('0x20')];});}});}else{logger['info'](_0x994e('0x21'));return request({'uri':util[_0x994e('0xf')](_0x994e('0x1f'),_0x11397c[_0x994e('0x11')])})[_0x994e('0x17')](function(_0x34e01d){logger[_0x994e('0xd')](_0x994e('0x22'));return _0x34e01d['user'];});}}function getEndUser(_0x1aba3f,_0x97e98c,_0x4d6a8e){logger[_0x994e('0xd')](_0x994e('0x23'),_0x4d6a8e);return request({'uri':util[_0x994e('0xf')](_0x994e('0x19'),_0x1aba3f[_0x994e('0x11')]),'qs':{'query':util['format'](_0x994e('0x24'),_0x4d6a8e)}})[_0x994e('0x17')](function(_0x5567ba){var _0x2fb883;if(_0x5567ba['results']['length']){_0x5567ba[_0x994e('0x25')]=_['filter'](_0x5567ba['results'],{'suspended':![],'role':_0x994e('0x26')});if(_0x5567ba[_0x994e('0x25')][_0x994e('0x27')]){_0x2fb883=_[_0x994e('0x28')](_0x5567ba['results']);}}if(_0x2fb883){logger[_0x994e('0xd')](_0x994e('0x29'));return _0x2fb883;}else{logger[_0x994e('0xd')](_0x994e('0x2a'));return request({'uri':util[_0x994e('0xf')]('%s/users.json',_0x1aba3f[_0x994e('0x11')]),'method':_0x994e('0x2b'),'body':{'user':{'role':_0x994e('0x26'),'name':util[_0x994e('0xf')](_0x994e('0x2c'),_0x97e98c||_0x4d6a8e),'phone':_0x4d6a8e}}})[_0x994e('0x17')](function(_0x1b9bb7){logger[_0x994e('0xd')]('Enduser\x20created.');return _0x1b9bb7[_0x994e('0x20')];});}});}function getAuth(_0x412662){var _0x35e586;if(_0x412662[_0x994e('0x2d')]===_0x994e('0x2e')){_0x35e586=util[_0x994e('0xf')](_0x994e('0x2f'),_0x412662[_0x994e('0x30')],_0x412662[_0x994e('0x2e')]);}else if(_0x412662[_0x994e('0x2d')]==='token'){_0x35e586=util[_0x994e('0xf')]('%s/token:%s',_0x412662[_0x994e('0x30')],_0x412662[_0x994e('0x31')]);}return util[_0x994e('0xf')](_0x994e('0x32'),new Buffer(_0x35e586)[_0x994e('0x33')](_0x994e('0x34')));}function request(_0x13abc1){logger[_0x994e('0x35')](_0x994e('0x36'),JSON[_0x994e('0x37')](_0x13abc1));return rp(_[_0x994e('0x38')](_0x13abc1,{'method':_0x994e('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x1456d2,_0x9fe774){var _0x1ab79e=[];if(_0x1456d2&&_0x1456d2[_0x994e('0x27')]>0x0){_0x1ab79e=_[_0x994e('0x3a')](_0x1456d2,_0x9fe774);}return _0x1ab79e;}function getCustomFields(_0x55dc35,_0x2d6937){var _0x539da5=[];var _0x28d53b={'custom_fields':[]};if(_0x55dc35[_0x994e('0x27')]>0x0){_[_0x994e('0x3b')](_0x55dc35,function(_0x55af39){if(_[_0x994e('0x3c')]([_0x994e('0x3d'),_0x994e('0x3e')],_0x55af39[_0x994e('0x3f')])&&_0x55af39['nameField']&&!_0x55af39[_0x994e('0x40')]){_0x28d53b[_0x55af39[_0x994e('0x41')]['toLowerCase']()]=_0x55af39[_0x994e('0x42')][_0x994e('0x33')]();}else if(_[_0x994e('0x3c')]([_0x994e('0x3d'),'picklist'],_0x55af39['type'])&&_0x55af39[_0x994e('0x43')]&&_0x55af39['customField']){_0x28d53b[_0x994e('0x44')][_0x994e('0x45')]({'id':_0x55af39[_0x994e('0x43')],'value':_0x55af39[_0x994e('0x42')][_0x994e('0x33')]()});}else if(_0x55af39[_0x994e('0x3f')]===_0x994e('0x46')&&_0x55af39[_0x994e('0x47')]&&_0x55af39[_0x994e('0x43')]&&_0x55af39['customField']){_0x2d6937[_0x55af39[_0x994e('0x47')]]&&_0x28d53b['custom_fields']['push']({'id':_0x55af39[_0x994e('0x43')],'value':_0x2d6937[_0x55af39['variableName']][_0x994e('0x33')]()});}else if(_0x55af39[_0x994e('0x3f')]===_0x994e('0x48')&&_0x55af39[_0x994e('0x49')]&&_0x55af39['Variable'][_0x994e('0x4a')]&&_0x55af39[_0x994e('0x43')]&&_0x55af39['customField']){_0x2d6937[_0x55af39[_0x994e('0x49')]['name'][_0x994e('0x4b')]()]&&_0x28d53b[_0x994e('0x44')]['push']({'id':_0x55af39[_0x994e('0x43')],'value':_0x2d6937[_0x55af39[_0x994e('0x49')][_0x994e('0x4a')][_0x994e('0x4b')]()][_0x994e('0x33')]()});}});}return _0x28d53b;}exports[_0x994e('0x4c')]=function(_0x4d46b5,_0x4af4b6,_0x31a308,_0x5032b7,_0xc887ab,_0x150419){var _0x3ea897,_0x2659af;_0x150419[_0x994e('0x11')]=intUtil[_0x994e('0x4d')](_0x150419['remoteUri']);_0x150419[_0x994e('0x4e')]=intUtil[_0x994e('0x4d')](_0x150419[_0x994e('0x4e')]);if(_0xc887ab&&_0xc887ab[_0x994e('0x4f')]){logger[_0x994e('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4af4b6['recordingURL']=util['format'](_0x994e('0x50'),_0x150419['serverUrl'],_0x4af4b6['uniqueid'],md5(_0x4af4b6[_0x994e('0x51')]));}else{_0x4af4b6[_0x994e('0x52')]='';}headers[_0x994e('0x53')]=getAuth(_0x150419);return getUser(_0x150419,_0x5032b7[_0x994e('0x54')])[_0x994e('0x17')](function(_0x352c62){_0x3ea897=_0x352c62;logger[_0x994e('0xd')](_0x994e('0x55'),_0x3ea897['id']);return getEndUser(_0x150419,_0x4af4b6[_0x994e('0x56')],_0x4af4b6[_0x994e('0x57')]);})['then'](function(_0x568fca){_0x2659af=_0x568fca;logger[_0x994e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2659af['id']);return getTicket(_0x150419,_0x3ea897,_0x2659af,_0x31a308,_0x4af4b6);})[_0x994e('0x17')](function(_0x192f2e){if(_0x192f2e){logger[_0x994e('0xd')](_0x994e('0x58'),_0x192f2e['id']);switch(_0x150419[_0x994e('0x3f')]){case _0x994e('0x59'):logger[_0x994e('0xd')](_0x994e('0x5a'),_0x994e('0x5b'));return request({'uri':util[_0x994e('0xf')](_0x994e('0x5c'),_0x150419['remoteUri'],_0x3ea897['id'],_0x192f2e['id']),'method':'POST'});case'newTab':logger[_0x994e('0xd')](_0x994e('0x5a'),_0x994e('0x5d'));emit(util[_0x994e('0xf')]('user:%s',_0x5032b7['name']),_0x994e('0x5e'),{'uri':util[_0x994e('0xf')](_0x994e('0x5f'),_0x150419[_0x994e('0x11')][_0x994e('0x60')](_0x994e('0x61'),''),_0x192f2e['id'])});break;default:logger[_0x994e('0x62')]('[QUEUE]',_0x994e('0x63'));}}})[_0x994e('0x64')](function(_0x55b191){logger['error'](_0x994e('0x65'),util[_0x994e('0x66')](_0x55b191,{'showHidden':!![],'depth':null}));});};exports[_0x994e('0x67')]=function(_0x598b0c,_0x138781,_0x2ee995,_0x1d2fed,_0x214cd6,_0x5930e4,_0x3a6914){var _0x59a475,_0x4bbc0c;_0x5930e4[_0x994e('0x11')]=intUtil['stripTrailingSlash'](_0x5930e4[_0x994e('0x11')]);_0x5930e4[_0x994e('0x4e')]=intUtil[_0x994e('0x4d')](_0x5930e4[_0x994e('0x4e')]);if(_0x3a6914&&_0x3a6914['recordingFormat']&&_0x3a6914[_0x994e('0x68')]!==_0x994e('0x69')){logger['info'](_0x994e('0x6a'),_0x994e('0x6b'));_0x138781['recordingURL']=util[_0x994e('0xf')](_0x994e('0x50'),_0x5930e4['serverUrl'],_0x138781[_0x994e('0x51')],md5(_0x138781[_0x994e('0x51')]));}headers[_0x994e('0x53')]=getAuth(_0x5930e4);return getUser(_0x5930e4,_0x1d2fed[_0x994e('0x54')])[_0x994e('0x17')](function(_0x954833){_0x59a475=_0x954833;logger[_0x994e('0xd')](_0x994e('0x55'),_0x59a475['id']);return getEndUser(_0x5930e4,_0x138781[_0x994e('0x6c')],_0x138781[_0x994e('0x6d')]);})[_0x994e('0x17')](function(_0x25426e){_0x4bbc0c=_0x25426e;logger['info'](_0x994e('0x6e'),_0x4bbc0c['id']);return getTicket(_0x5930e4,_0x59a475,_0x4bbc0c,_0x2ee995,_0x138781);})['then'](function(_0x244b00){if(_0x244b00){logger[_0x994e('0xd')]('The\x20Ticket\x20ID\x20is:',_0x244b00['id']);switch(_0x5930e4[_0x994e('0x3f')]){case _0x994e('0x59'):logger['info'](_0x994e('0x6a'),_0x994e('0x5b'));return request({'uri':util[_0x994e('0xf')](_0x994e('0x5c'),_0x5930e4[_0x994e('0x11')],_0x59a475['id'],_0x244b00['id']),'method':_0x994e('0x2b')});case _0x994e('0x6f'):logger[_0x994e('0xd')](_0x994e('0x6a'),_0x994e('0x5d'));emit(util['format'](_0x994e('0x70'),_0x1d2fed[_0x994e('0x4a')]),_0x994e('0x5e'),{'uri':util[_0x994e('0xf')](_0x994e('0x5f'),_0x5930e4['remoteUri'][_0x994e('0x60')]('/api/v2',''),_0x244b00['id'])});break;default:logger['error'](_0x994e('0x6a'),_0x994e('0x63'));}}})[_0x994e('0x64')](function(_0x4a8d4e){logger[_0x994e('0x62')](_0x994e('0x71'),util[_0x994e('0x66')](_0x4a8d4e,{'showHidden':!![],'depth':null}));});};exports[_0x994e('0x72')]=function(_0x402161,_0x6ea773,_0x52c0e6,_0x665d01,_0x3c197f,_0xe8a920){var _0x1484ec,_0x4b9d6d;_0xe8a920[_0x994e('0x11')]=intUtil[_0x994e('0x4d')](_0xe8a920['remoteUri']);_0xe8a920[_0x994e('0x4e')]=intUtil[_0x994e('0x4d')](_0xe8a920[_0x994e('0x4e')]);if(_0x3c197f&&_0x3c197f[_0x994e('0x4f')]){logger[_0x994e('0xd')]('['+_0x6ea773[_0x994e('0x73')]['toUpperCase']()+']',_0x994e('0x6b'));_0x6ea773[_0x994e('0x52')]=util[_0x994e('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe8a920['serverUrl'],_0x6ea773[_0x994e('0x51')],md5(_0x6ea773[_0x994e('0x51')]));}else{_0x6ea773[_0x994e('0x52')]='';}headers['Authorization']=getAuth(_0xe8a920);return getUser(_0xe8a920)[_0x994e('0x17')](function(_0x2b6ab6){_0x1484ec=_0x2b6ab6;logger['info'](_0x994e('0x55'),_0x1484ec['id']);return getEndUser(_0xe8a920,_0x6ea773[_0x994e('0x56')],_0x6ea773[_0x994e('0x57')]);})[_0x994e('0x17')](function(_0x13b035){_0x4b9d6d=_0x13b035;logger[_0x994e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4b9d6d['id']);return getTicket(_0xe8a920,_0x1484ec,_0x4b9d6d,_0x52c0e6,_0x6ea773);})[_0x994e('0x17')](function(_0x1d6acd){if(_0x1d6acd){logger[_0x994e('0xd')](_0x994e('0x58'),_0x1d6acd['id']);}})[_0x994e('0x64')](function(_0x313a0d){logger['error']('['+_0x6ea773['lastevent'][_0x994e('0x74')]()+']'+_0x994e('0x75'),util[_0x994e('0x66')](_0x313a0d,{'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 a84e9a2..a03344c 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 _0x2fb5=['refresh_token','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','error','Error:\x20','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','https://www.zohoapis.','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','connect','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','starttime','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','com','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','user:%s','toUpperCase','lodash','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','socket.io-emitter','redis','[HTTP]','stringify','length','string','picklist','type','idField','content','toString','variable','customVariable','Variable','name','toLowerCase','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','clientId'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x2fb5,0xff));var _0x52fb=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x2fb5[_0xfc406a];return _0x395473;};'use strict';var _=require(_0x52fb('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x52fb('0x1'));var intUtil=require(_0x52fb('0x2'));var moment=require(_0x52fb('0x3'));var Redis=require('ioredis');var BPromise=require(_0x52fb('0x4'));var config=require(_0x52fb('0x5'));var logger=require(_0x52fb('0x6'))(_0x52fb('0x7'));config['redis']=_[_0x52fb('0x8')](config['redis'],{'host':_0x52fb('0x9'),'port':0x18eb});var io=require(_0x52fb('0xa'))(new Redis(config[_0x52fb('0xb')]));function emit(_0x101e9c,_0x30fed4,_0x32a7bb){io['to'](_0x101e9c)['emit'](_0x30fed4,_0x32a7bb);}function request(_0x3e7c15){logger['debug'](_0x52fb('0xc'),JSON[_0x52fb('0xd')](_0x3e7c15));return rp(_0x3e7c15);}function getCustomFields(_0x435584,_0x48b701){var _0x5cd0a0={};if(_0x435584[_0x52fb('0xe')]>0x0){_['forEach'](_0x435584,function(_0x2f1a92){if(_['includes']([_0x52fb('0xf'),_0x52fb('0x10')],_0x2f1a92[_0x52fb('0x11')])&&_0x2f1a92[_0x52fb('0x12')]){_0x5cd0a0[_0x2f1a92['idField']]=_0x2f1a92[_0x52fb('0x13')][_0x52fb('0x14')]();}else if(_0x2f1a92[_0x52fb('0x11')]===_0x52fb('0x15')&&_0x2f1a92['variableName']&&_0x2f1a92[_0x52fb('0x12')]&&_0x48b701[_0x2f1a92['variableName']]){_0x5cd0a0[_0x2f1a92['idField']]=_0x48b701[_0x2f1a92['variableName']][_0x52fb('0x14')]();}else if(_0x2f1a92[_0x52fb('0x11')]===_0x52fb('0x16')&&_0x2f1a92[_0x52fb('0x17')]&&_0x2f1a92['Variable'][_0x52fb('0x18')]&&_0x2f1a92['idField']&&_0x48b701[_0x2f1a92[_0x52fb('0x17')][_0x52fb('0x18')][_0x52fb('0x19')]()]){_0x5cd0a0[_0x2f1a92['idField']]=_0x48b701[_0x2f1a92[_0x52fb('0x17')][_0x52fb('0x18')][_0x52fb('0x19')]()]['toString']();}});}return _0x5cd0a0;}function getName(_0x429928){if(_0x429928['indexOf']('\x20')>0x0){var _0x144af9=_0x429928[_0x52fb('0x1a')](/ (.+)/);if(_0x144af9[0x1]){return _0x144af9;}}return[_0x429928,_0x429928];}var accountsTokens={};function getAccessToken(_0x505ce7){return new Promise(function(_0x6d8157,_0x2f3864){if(!_[_0x52fb('0x1b')](accountsTokens[_0x505ce7['id']])&&!_[_0x52fb('0x1b')](accountsTokens[_0x505ce7['id']][_0x52fb('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x505ce7['id']][_0x52fb('0x1d')])){_0x6d8157(accountsTokens[_0x505ce7['id']][_0x52fb('0x1c')]);}}var _0x214703;switch(_0x505ce7[_0x52fb('0x1e')]){case'US':_0x214703=_0x52fb('0x1f');break;case'AU':_0x214703=_0x52fb('0x20');break;case'EU':_0x214703=_0x52fb('0x21');break;case'IN':_0x214703='https://accounts.zoho.in';break;case'CN':_0x214703=_0x52fb('0x22');break;default:_0x214703=_0x52fb('0x21');break;}var _0x28542b={'method':'POST','uri':_0x214703+_0x52fb('0x23'),'qs':{'refresh_token':_0x505ce7['refreshToken'],'client_id':_0x505ce7[_0x52fb('0x24')],'client_secret':_0x505ce7['clientSecret'],'grant_type':_0x52fb('0x25')},'json':!![]};return rp(_0x28542b)[_0x52fb('0x26')](function(_0x51a009){accountsTokens[_0x505ce7['id']]={'access_token':_0x51a009[_0x52fb('0x1c')],'expires_in':moment()[_0x52fb('0x27')](_0x51a009[_0x52fb('0x1d')],'seconds')};_0x6d8157(_0x51a009[_0x52fb('0x1c')]);})[_0x52fb('0x28')](function(_0x405095){logger['error'](_0x52fb('0x29'),_0x405095[_0x52fb('0x2a')]);_0x2f3864(_0x405095);});});}function getUser(_0x10fcc5,_0x305a50,_0x3bc7f0,_0x431e5d){logger[_0x52fb('0x2b')](_0x52fb('0x2c'));return request({'method':'GET','uri':util[_0x52fb('0x2d')](_0x52fb('0x2e'),_0x305a50),'qs':{'type':_0x52fb('0x2f')},'headers':{'Authorization':_0x52fb('0x30')+_0x10fcc5},'json':!![]})[_0x52fb('0x26')](function(_0x325cfb){if(_0x325cfb[_0x52fb('0x31')]){var _0x5c3020=-0x1;if(_['isArrayLikeObject'](_0x325cfb['users'])){if(!_[_0x52fb('0x1b')](_0x431e5d)){_0x5c3020=_[_0x52fb('0x32')](_0x325cfb['users'],function(_0x13d752){return _0x13d752[_0x52fb('0x33')]===_0x431e5d;});}if(_0x5c3020>=0x0){logger[_0x52fb('0x2b')](_0x52fb('0x34'));}else{logger[_0x52fb('0x2b')](_0x52fb('0x35'));_0x5c3020=_[_0x52fb('0x32')](_0x325cfb[_0x52fb('0x31')],function(_0x262efd){return _0x262efd[_0x52fb('0x36')][_0x52fb('0x18')]===_0x52fb('0x37');});}return _0x325cfb[_0x52fb('0x31')][_0x5c3020];}else{if(_0x325cfb['user']['profile'][_0x52fb('0x18')]===_0x52fb('0x37')){logger[_0x52fb('0x2b')]('Using\x20the\x20admin\x20account!');user=_0x325cfb[_0x52fb('0x38')];return user;}else{logger['error'](_0x52fb('0x39'),JSON['stringify'](_0x325cfb));throw new Error(_0x52fb('0x3a')+JSON[_0x52fb('0xd')](_0x325cfb));}}}else{logger['error'](_0x52fb('0x39'),JSON['stringify'](_0x325cfb));throw new Error(_0x52fb('0x3a')+JSON[_0x52fb('0xd')](_0x325cfb));}})['catch'](function(_0x5150b7){console['error'](_0x5150b7);});}function getZohoUser(_0x5a8982,_0xdfbf80){return new BPromise(function(_0x34604b,_0xcbc9f8){request(_0x5a8982)[_0x52fb('0x26')](function(_0x508318){var _0xc5da7d=null;if(_0x508318){_0xc5da7d=_0x508318[_0x52fb('0x3b')][0x0];_0xc5da7d[_0x52fb('0x3c')]=_0xdfbf80;}_0x34604b(_0xc5da7d);})[_0x52fb('0x28')](function(_0x21fe07){_0xcbc9f8(_0x21fe07);});});}function createEndUser(_0x2ad8d6,_0xc2dbad,_0xcdc8cf,_0x31db4c,_0x24ba46,_0x2a881d){var _0xcdc8cf=getName(_0xcdc8cf);return request({'method':_0x52fb('0x3d'),'uri':'https://www.zohoapis.'+_0xc2dbad+'/crm/v2/'+_['startCase'](_0x2a881d[_0x52fb('0x3e')])+'s','body':{'data':[{'Last_Name':_0xcdc8cf[0x1],'First_Name':_0xcdc8cf[0x0],'Phone':_0x31db4c,'Owner':{'name':!_[_0x52fb('0x1b')](_0x24ba46[_0x52fb('0x3f')]['name'])?_0x24ba46[_0x52fb('0x3f')][_0x52fb('0x18')]:!_[_0x52fb('0x1b')](_0x24ba46[_0x52fb('0x40')])?_0x24ba46['first_name']+'\x20'+_0x24ba46[_0x52fb('0x41')]:_0x24ba46[_0x52fb('0x41')],'id':_0x24ba46['id']}}]},'headers':{'Authorization':_0x52fb('0x30')+_0x2ad8d6},'json':!![]})[_0x52fb('0x26')](function(_0x3b507a){if(_0x3b507a&&_0x3b507a[_0x52fb('0x3b')][0x0][_0x52fb('0x42')]===_0x52fb('0x43')){var _0x4173b7=_0x3b507a[_0x52fb('0x3b')][0x0][_0x52fb('0x44')];_0x4173b7[_0x52fb('0x3c')]=_[_0x52fb('0x45')](_0x2a881d[_0x52fb('0x3e')])+'s';return _0x4173b7;}logger[_0x52fb('0x46')](_0x52fb('0x39'),JSON[_0x52fb('0xd')](data));throw new Error(_0x52fb('0x47')+JSON[_0x52fb('0xd')](data));})[_0x52fb('0x28')](function(_0x4c03ac){console['log'](_0x52fb('0x48'),_0x4c03ac);});}function getEndUser(_0x7d7469,_0x3e3b25,_0x11a264,_0x18bf27,_0x37a307,_0x564c34,_0x3c5005){var _0x5def2={'method':_0x52fb('0x49'),'uri':'','headers':{'Authorization':_0x52fb('0x30')+_0x7d7469},'json':!![]};switch(_0x3c5005[_0x52fb('0x4a')]){case _0x52fb('0x4b'):_0x5def2[_0x52fb('0x4c')]='https://www.zohoapis.'+_0x3e3b25+_0x52fb('0x4d')+_0x37a307+'))';return getZohoUser(_0x5def2,'Contacts')[_0x52fb('0x26')](function(_0x4e5ff4){if(_0x4e5ff4)return _0x4e5ff4;_0x5def2[_0x52fb('0x4c')]='https://www.zohoapis.'+_0x3e3b25+_0x52fb('0x4e')+_0x37a307+'))';return getZohoUser(_0x5def2,_0x52fb('0x4f'))['then'](function(_0x3b8ec3){if(_0x3b8ec3)return _0x3b8ec3;if(_0x3c5005[_0x52fb('0x3e')]!=_0x52fb('0x50')){return createEndUser(_0x7d7469,_0x3e3b25,_0x18bf27,_0x37a307,_0x564c34,_0x3c5005);}else{return{};}});});break;case _0x52fb('0x51'):_0x5def2[_0x52fb('0x4c')]='https://www.zohoapis.'+_0x3e3b25+_0x52fb('0x4d')+_0x37a307+'))';return getZohoUser(_0x5def2,'Contacts')[_0x52fb('0x26')](function(_0xc737f8){if(_0xc737f8)return _0xc737f8;if(_0x3c5005['moduleCreate']!='nothing'){return createEndUser(_0x7d7469,_0x3e3b25,_0x18bf27,_0x37a307,_0x564c34,_0x3c5005);}else{return{};}});break;case'lead':_0x5def2[_0x52fb('0x4c')]=_0x52fb('0x52')+_0x3e3b25+_0x52fb('0x4e')+_0x37a307+'))';return getZohoUser(_0x5def2,_0x52fb('0x4f'))[_0x52fb('0x26')](function(_0x35fb9a){if(_0x35fb9a)return _0x35fb9a;if(_0x3c5005[_0x52fb('0x3e')]!=_0x52fb('0x50')){return createEndUser(_0x7d7469,_0x3e3b25,_0x18bf27,_0x37a307,_0x564c34,_0x3c5005);}else{return{};}});break;}}function getCall(_0x1e2dd8,_0x2c7fd8,_0x1df312,_0x4c8b4f,_0x28cdd5,_0x40b209,_0x504151,_0x3a9c2){logger[_0x52fb('0x2b')](_0x52fb('0x53'));var _0x2f0202={};_0x2f0202['Owner']={'name':!_[_0x52fb('0x1b')](_0x4c8b4f[_0x52fb('0x3f')][_0x52fb('0x18')])&&!_[_0x52fb('0x1b')](_0x4c8b4f[_0x52fb('0x36')][_0x52fb('0x18')])&&_0x4c8b4f[_0x52fb('0x36')]['name']===_0x52fb('0x54')?_0x4c8b4f['role'][_0x52fb('0x18')]:!_[_0x52fb('0x1b')](_0x4c8b4f[_0x52fb('0x40')])?_0x4c8b4f[_0x52fb('0x40')]+'\x20'+_0x4c8b4f['last_name']:_0x4c8b4f['last_name'],'id':_0x4c8b4f['id']};_0x2f0202['Subject']=intUtil[_0x52fb('0x55')](_0x40b209[_0x52fb('0x56')],_0x504151,'\x20');_0x2f0202[_0x52fb('0x57')]=intUtil['getString'](_0x40b209[_0x52fb('0x58')],_0x504151,'\x0a');if(_0x28cdd5[_0x52fb('0x3c')]===_0x52fb('0x59')){_0x2f0202[_0x52fb('0x5a')]={'name':!_[_0x52fb('0x1b')](_0x28cdd5[_0x52fb('0x5b')])?_0x28cdd5[_0x52fb('0x5b')]:!_[_0x52fb('0x1b')](_0x28cdd5[_0x52fb('0x5c')])?_0x28cdd5['First_Name']+'\x20'+_0x28cdd5['Last_Name']:_0x28cdd5[_0x52fb('0x5d')],'id':_0x28cdd5['id']};}if(_0x28cdd5[_0x52fb('0x3c')]===_0x52fb('0x4f')){_0x2f0202['What_Id']={'name':!_['isNil'](_0x28cdd5[_0x52fb('0x5b')])?_0x28cdd5[_0x52fb('0x5b')]:!_[_0x52fb('0x1b')](_0x28cdd5[_0x52fb('0x5c')])?_0x28cdd5[_0x52fb('0x5c')]+'\x20'+_0x28cdd5['Last_Name']:_0x28cdd5[_0x52fb('0x5d')],'id':_0x28cdd5['id']};_0x2f0202[_0x52fb('0x5e')]=_[_0x52fb('0x45')](_0x28cdd5['enduserType']);}if(_0x504151[_0x52fb('0x5f')]){_0x2f0202[_0x52fb('0x60')]=moment[_0x52fb('0x61')](parseInt(_0x504151[_0x52fb('0x5f')])*0x3e8)[_0x52fb('0x2d')](_0x52fb('0x62'));}else if(_0x504151[_0x52fb('0x63')]&&_0x504151[_0x52fb('0x64')]){_0x2f0202[_0x52fb('0x60')]=moment['utc'](moment(_0x504151[_0x52fb('0x64')],_0x52fb('0x65'))['diff'](moment(_0x504151['starttime'],_0x52fb('0x65'))))[_0x52fb('0x2d')]('mm:ss');}switch(_0x504151[_0x52fb('0x66')]){case _0x52fb('0x67'):_0x2f0202[_0x52fb('0x68')]='Called';break;case'complete':case _0x52fb('0x69'):_0x2f0202[_0x52fb('0x68')]=_0x52fb('0x6a');break;case _0x52fb('0x6b'):_0x2f0202[_0x52fb('0x68')]=_0x52fb('0x6c');break;case _0x52fb('0x6d'):_0x2f0202['Call_Result']='Abandoned';break;case'timeout':_0x2f0202['Call_Result']=_0x52fb('0x6e');default:}_0x2f0202[_0x52fb('0x6f')]=(_0x3a9c2==='outbound'?moment(_0x504151[_0x52fb('0x70')])[_0x52fb('0x2d')](_0x52fb('0x65')):moment(_0x504151[_0x52fb('0x71')])[_0x52fb('0x2d')](_0x52fb('0x65')))||moment()[_0x52fb('0x2d')](_0x52fb('0x65'));_0x2f0202['Call_Type']=_0x3a9c2||_0x52fb('0x72');_0x2f0202=_[_0x52fb('0x73')](_0x2f0202,getCustomFields(_0x40b209[_0x52fb('0x74')],_0x504151));return request({'method':_0x52fb('0x3d'),'uri':_0x52fb('0x52')+_0x2c7fd8+_0x52fb('0x75'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1e2dd8},'body':{'data':[_0x2f0202]},'json':!![]})['then'](function(_0x1a261f){if(_0x1a261f&&_0x1a261f['data'][0x0][_0x52fb('0x42')]===_0x52fb('0x43')){logger['info']('Call\x20created!');return{'id':_0x1a261f[_0x52fb('0x3b')][0x0][_0x52fb('0x44')]['id']};}})['catch'](function(_0x3f24eb){logger[_0x52fb('0x2b')](_0x52fb('0x76'),_0x3f24eb[_0x52fb('0x2a')]);console['log'](_0x52fb('0x76'),_0x3f24eb);});}exports[_0x52fb('0x77')]=function(_0xc59db2,_0xf9d689,_0x2d6ab0,_0x4c496f,_0x1531eb,_0x39b392){var _0x576bc0,_0x34d588,_0x5c3b46;_0x39b392[_0x52fb('0x78')]=intUtil[_0x52fb('0x79')](_0x39b392[_0x52fb('0x78')]);_0x39b392[_0x52fb('0x7a')]=intUtil['stripTrailingSlash'](_0x39b392[_0x52fb('0x7a')]);if(_0x1531eb&&_0x1531eb[_0x52fb('0x7b')]){logger[_0x52fb('0x2b')](_0x52fb('0x7c'),_0x52fb('0x7d'));_0xf9d689[_0x52fb('0x7e')]=_0x39b392[_0x52fb('0x7a')]+_0x52fb('0x7f')+_0xf9d689[_0x52fb('0x80')]+_0x52fb('0x81')+md5(_0xf9d689[_0x52fb('0x80')]);}else{_0xf9d689[_0x52fb('0x7e')]='';}var _0x11ff8c=_0x39b392[_0x52fb('0x78')]===_0x52fb('0x82')?'eu':'com';return getAccessToken(_0x39b392)[_0x52fb('0x26')](function(_0x437bc7){_0x5c3b46=_0x437bc7;return getUser(_0x5c3b46,_0x11ff8c,_0x39b392,_0x4c496f[_0x52fb('0x33')]);})['then'](function(_0x4578d9){_0x576bc0=_0x4578d9;logger[_0x52fb('0x2b')](_0x52fb('0x83'),_0x576bc0['id']);return getEndUser(_0x5c3b46,_0x11ff8c,_0x39b392,_0xf9d689[_0x52fb('0x84')],_0xf9d689[_0x52fb('0x85')],_0x576bc0,_0x2d6ab0);})[_0x52fb('0x26')](function(_0x471afd){_0x34d588=_0x471afd;return getCall(_0x5c3b46,_0x11ff8c,_0x39b392,_0x576bc0,_0x34d588,_0x2d6ab0,_0xf9d689,_0x52fb('0x72'));})['then'](function(_0x3a4887){if(_0x3a4887){logger[_0x52fb('0x2b')]('The\x20Call\x20ID\x20is:',_0x3a4887['id']);logger['info'](_0x52fb('0x7c'),_0x52fb('0x86'));emit(util[_0x52fb('0x2d')]('user:%s',_0x4c496f['name']),_0x52fb('0x87'),{'uri':_0x52fb('0x88')+_0x39b392[_0x52fb('0x78')]+_0x52fb('0x89')+_0x3a4887['id']});}})[_0x52fb('0x28')](function(_0x369a7d){logger[_0x52fb('0x46')]('[QUEUE]',JSON[_0x52fb('0xd')](_0x369a7d));});};exports['outbound']=function(_0x5aebb5,_0x477536,_0xfffc44,_0x4e4ce0,_0x5ebe62,_0x3b51d9,_0x4a58a6){var _0xfc16b0,_0x54ab10,_0x254f10;_0x3b51d9[_0x52fb('0x78')]=intUtil[_0x52fb('0x79')](_0x3b51d9[_0x52fb('0x78')]);_0x3b51d9[_0x52fb('0x7a')]=intUtil[_0x52fb('0x79')](_0x3b51d9[_0x52fb('0x7a')]);if(_0x4a58a6&&_0x4a58a6[_0x52fb('0x8a')]&&_0x4a58a6[_0x52fb('0x8a')]!=='none'){logger[_0x52fb('0x2b')](_0x52fb('0x8b'),_0x52fb('0x7d'));_0x477536[_0x52fb('0x7e')]=_0x3b51d9[_0x52fb('0x7a')]+_0x52fb('0x7f')+_0x477536['uniqueid']+_0x52fb('0x81')+md5(_0x477536[_0x52fb('0x80')]);}var _0x54bcb0=_0x3b51d9[_0x52fb('0x78')]===_0x52fb('0x82')?'eu':_0x52fb('0x8c');return getAccessToken(_0x3b51d9)[_0x52fb('0x26')](function(_0x123936){_0x254f10=_0x123936;return getUser(_0x254f10,_0x54bcb0,_0x3b51d9,_0x4e4ce0[_0x52fb('0x33')]);})[_0x52fb('0x26')](function(_0x370d83){_0xfc16b0=_0x370d83;logger[_0x52fb('0x2b')](_0x52fb('0x83'),_0xfc16b0['id']);return getEndUser(_0x254f10,_0x54bcb0,_0x3b51d9,_0x477536[_0x52fb('0x8d')],_0x477536['destcalleridnum'],_0xfc16b0,_0xfffc44);})[_0x52fb('0x26')](function(_0x8bf3f3){_0x54ab10=_0x8bf3f3;return getCall(_0x254f10,_0x54bcb0,_0x3b51d9,_0xfc16b0,_0x54ab10,_0xfffc44,_0x477536,_0x52fb('0x8e'));})[_0x52fb('0x26')](function(_0x2ead9c){if(_0x2ead9c){logger[_0x52fb('0x2b')](_0x52fb('0x8f'),_0x2ead9c['id']);logger['info'](_0x52fb('0x8b'),_0x52fb('0x86'));emit(util[_0x52fb('0x2d')](_0x52fb('0x90'),_0x4e4ce0[_0x52fb('0x18')]),_0x52fb('0x87'),{'uri':_0x52fb('0x88')+_0x3b51d9[_0x52fb('0x78')]+_0x52fb('0x89')+_0x2ead9c['id']});}})[_0x52fb('0x28')](function(_0x3dea1c){logger[_0x52fb('0x46')](_0x52fb('0x8b'),JSON['stringify'](_0x3dea1c));});};exports['unmanaged']=function(_0x2d608a,_0x5bac71,_0x315218,_0x47321a,_0x48f8fc,_0x37349d){var _0xa2d4f2,_0x157bcd,_0x2190e8;_0x37349d[_0x52fb('0x78')]=intUtil[_0x52fb('0x79')](_0x37349d[_0x52fb('0x78')]);_0x37349d[_0x52fb('0x7a')]=intUtil[_0x52fb('0x79')](_0x37349d[_0x52fb('0x7a')]);if(_0x48f8fc&&_0x48f8fc[_0x52fb('0x7b')]){logger[_0x52fb('0x2b')]('['+_0x5bac71['lastevent']['toUpperCase']()+']',_0x52fb('0x7d'));_0x5bac71[_0x52fb('0x7e')]=_0x37349d['serverUrl']+_0x52fb('0x7f')+_0x5bac71[_0x52fb('0x80')]+_0x52fb('0x81')+md5(_0x5bac71[_0x52fb('0x80')]);}else{_0x5bac71[_0x52fb('0x7e')]='';}var _0x162db6=_0x37349d[_0x52fb('0x78')]==='zoho.eu'?'eu':_0x52fb('0x8c');return getAccessToken(_0x37349d)[_0x52fb('0x26')](function(_0x2c85fd){_0x2190e8=_0x2c85fd;return getUser(_0x2190e8,_0x162db6,_0x37349d);})[_0x52fb('0x26')](function(_0x1d5c33){_0xa2d4f2=_0x1d5c33;logger['info'](_0x52fb('0x83'),_0xa2d4f2['id']);return getEndUser(_0x2190e8,_0x162db6,_0x37349d,_0x5bac71[_0x52fb('0x84')],_0x5bac71['calleridnum'],_0xa2d4f2,_0x315218);})[_0x52fb('0x26')](function(_0x5c3261){_0x157bcd=_0x5c3261;return getCall(_0x2190e8,_0x162db6,_0x37349d,_0xa2d4f2,_0x157bcd,_0x315218,_0x5bac71,_0x52fb('0x72'));})[_0x52fb('0x26')](function(_0x2412cf){if(_0x2412cf){logger['info'](_0x52fb('0x8f'),_0x2412cf['id']);}})['catch'](function(_0x492bb7){logger[_0x52fb('0x46')]('['+_0x5bac71[_0x52fb('0x66')][_0x52fb('0x91')]()+']',JSON[_0x52fb('0xd')](_0x492bb7));});}; \ No newline at end of file +var _0xbe85=['user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','mm:ss','answertime','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','diff','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','data','code','Call\x20created!','err','stack','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Outbound','unmanaged','lastevent','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Agent\x20found!','info','Using\x20the\x20admin\x20account!','Administrator'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe85,0x19c));var _0x5be8=function(_0x462a83,_0x25490f){_0x462a83=_0x462a83-0x0;var _0x32d59a=_0xbe85[_0x462a83];return _0x32d59a;};'use strict';var _=require(_0x5be8('0x0'));var rp=require(_0x5be8('0x1'));var md5=require(_0x5be8('0x2'));var util=require('util');var intUtil=require(_0x5be8('0x3'));var moment=require(_0x5be8('0x4'));var Redis=require(_0x5be8('0x5'));var BPromise=require(_0x5be8('0x6'));var config=require(_0x5be8('0x7'));var logger=require(_0x5be8('0x8'))(_0x5be8('0x9'));config[_0x5be8('0xa')]=_[_0x5be8('0xb')](config[_0x5be8('0xa')],{'host':_0x5be8('0xc'),'port':0x18eb});var io=require(_0x5be8('0xd'))(new Redis(config[_0x5be8('0xa')]));function emit(_0x33d5be,_0x544647,_0x57b74e){io['to'](_0x33d5be)[_0x5be8('0xe')](_0x544647,_0x57b74e);}function request(_0x42613c){logger[_0x5be8('0xf')](_0x5be8('0x10'),JSON[_0x5be8('0x11')](_0x42613c));return rp(_0x42613c);}function getCustomFields(_0x41e55d,_0x54c052){var _0x110447={};if(_0x41e55d[_0x5be8('0x12')]>0x0){_['forEach'](_0x41e55d,function(_0x51fabe){if(_['includes']([_0x5be8('0x13'),'picklist'],_0x51fabe[_0x5be8('0x14')])&&_0x51fabe[_0x5be8('0x15')]){_0x110447[_0x51fabe[_0x5be8('0x15')]]=_0x51fabe[_0x5be8('0x16')][_0x5be8('0x17')]();}else if(_0x51fabe[_0x5be8('0x14')]===_0x5be8('0x18')&&_0x51fabe[_0x5be8('0x19')]&&_0x51fabe[_0x5be8('0x15')]&&_0x54c052[_0x51fabe[_0x5be8('0x19')]]){_0x110447[_0x51fabe[_0x5be8('0x15')]]=_0x54c052[_0x51fabe[_0x5be8('0x19')]]['toString']();}else if(_0x51fabe['type']===_0x5be8('0x1a')&&_0x51fabe[_0x5be8('0x1b')]&&_0x51fabe['Variable'][_0x5be8('0x1c')]&&_0x51fabe[_0x5be8('0x15')]&&_0x54c052[_0x51fabe[_0x5be8('0x1b')]['name']['toLowerCase']()]){_0x110447[_0x51fabe[_0x5be8('0x15')]]=_0x54c052[_0x51fabe[_0x5be8('0x1b')][_0x5be8('0x1c')][_0x5be8('0x1d')]()][_0x5be8('0x17')]();}});}return _0x110447;}function getName(_0x49700c){if(_0x49700c[_0x5be8('0x1e')]('\x20')>0x0){var _0x36b4a0=_0x49700c['split'](/ (.+)/);if(_0x36b4a0[0x1]){return _0x36b4a0;}}return[_0x49700c,_0x49700c];}var accountsTokens={};function getAccessToken(_0x55f63b){return new Promise(function(_0x29ac9d,_0x365925){if(!_['isNil'](accountsTokens[_0x55f63b['id']])&&!_[_0x5be8('0x1f')](accountsTokens[_0x55f63b['id']][_0x5be8('0x20')])){if(moment()[_0x5be8('0x21')](accountsTokens[_0x55f63b['id']][_0x5be8('0x22')])){_0x29ac9d(accountsTokens[_0x55f63b['id']]['access_token']);}}var _0x52ca81;switch(_0x55f63b[_0x5be8('0x23')]){case'US':_0x52ca81='https://accounts.zoho.com';break;case'AU':_0x52ca81='https://accounts.zoho.com.au';break;case'EU':_0x52ca81='https://accounts.zoho.eu';break;case'IN':_0x52ca81=_0x5be8('0x24');break;case'CN':_0x52ca81=_0x5be8('0x25');break;default:_0x52ca81=_0x5be8('0x26');break;}var _0x5e056c={'method':_0x5be8('0x27'),'uri':_0x52ca81+_0x5be8('0x28'),'qs':{'refresh_token':_0x55f63b[_0x5be8('0x29')],'client_id':_0x55f63b[_0x5be8('0x2a')],'client_secret':_0x55f63b['clientSecret'],'grant_type':_0x5be8('0x2b')},'json':!![]};return rp(_0x5e056c)[_0x5be8('0x2c')](function(_0x164fa9){accountsTokens[_0x55f63b['id']]={'access_token':_0x164fa9[_0x5be8('0x20')],'expires_in':moment()['add'](_0x164fa9[_0x5be8('0x22')],'seconds')};_0x29ac9d(_0x164fa9[_0x5be8('0x20')]);})[_0x5be8('0x2d')](function(_0x39d217){logger[_0x5be8('0x2e')](_0x5be8('0x2f'),_0x39d217['stack']);_0x365925(_0x39d217);});});}function getUser(_0x2ea087,_0x58206e,_0x534a13,_0x4f20fb){logger['info'](_0x5be8('0x30'));return request({'method':_0x5be8('0x31'),'uri':util[_0x5be8('0x32')](_0x5be8('0x33'),_0x58206e),'qs':{'type':_0x5be8('0x34')},'headers':{'Authorization':_0x5be8('0x35')+_0x2ea087},'json':!![]})[_0x5be8('0x2c')](function(_0x17ed76){if(_0x17ed76['users']){var _0x5cf5a9=-0x1;if(_[_0x5be8('0x36')](_0x17ed76[_0x5be8('0x37')])){if(!_['isNil'](_0x4f20fb)){_0x5cf5a9=_[_0x5be8('0x38')](_0x17ed76[_0x5be8('0x37')],function(_0x4cd243){return _0x4cd243[_0x5be8('0x39')]===_0x4f20fb;});}if(_0x5cf5a9>=0x0){logger['info'](_0x5be8('0x3a'));}else{logger[_0x5be8('0x3b')](_0x5be8('0x3c'));_0x5cf5a9=_['findIndex'](_0x17ed76[_0x5be8('0x37')],function(_0x82192){return _0x82192['profile'][_0x5be8('0x1c')]===_0x5be8('0x3d');});}return _0x17ed76[_0x5be8('0x37')][_0x5cf5a9];}else{if(_0x17ed76[_0x5be8('0x3e')]['profile']['name']===_0x5be8('0x3d')){logger[_0x5be8('0x3b')](_0x5be8('0x3c'));user=_0x17ed76[_0x5be8('0x3e')];return user;}else{logger[_0x5be8('0x2e')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x17ed76));throw new Error(_0x5be8('0x3f')+JSON[_0x5be8('0x11')](_0x17ed76));}}}else{logger[_0x5be8('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x5be8('0x11')](_0x17ed76));throw new Error(_0x5be8('0x3f')+JSON[_0x5be8('0x11')](_0x17ed76));}})[_0x5be8('0x2d')](function(_0x4bc5ff){console[_0x5be8('0x2e')](_0x4bc5ff);});}function getZohoUser(_0x2b7011,_0x25eef9){return new BPromise(function(_0x1342cc,_0x4293b1){request(_0x2b7011)[_0x5be8('0x2c')](function(_0x5c4ca0){var _0x3dc0c0=null;if(_0x5c4ca0){_0x3dc0c0=_0x5c4ca0['data'][0x0];_0x3dc0c0[_0x5be8('0x40')]=_0x25eef9;}_0x1342cc(_0x3dc0c0);})[_0x5be8('0x2d')](function(_0x3c6e44){_0x4293b1(_0x3c6e44);});});}function createEndUser(_0x3ed97f,_0x39ed1f,_0x3f1a2f,_0x3943dd,_0x3d6991,_0x57c504){var _0x3f1a2f=getName(_0x3f1a2f);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x39ed1f+_0x5be8('0x41')+_[_0x5be8('0x42')](_0x57c504[_0x5be8('0x43')])+'s','body':{'data':[{'Last_Name':_0x3f1a2f[0x1],'First_Name':_0x3f1a2f[0x0],'Phone':_0x3943dd,'Owner':{'name':!_[_0x5be8('0x1f')](_0x3d6991[_0x5be8('0x44')][_0x5be8('0x1c')])?_0x3d6991['role'][_0x5be8('0x1c')]:!_[_0x5be8('0x1f')](_0x3d6991['first_name'])?_0x3d6991[_0x5be8('0x45')]+'\x20'+_0x3d6991[_0x5be8('0x46')]:_0x3d6991['last_name'],'id':_0x3d6991['id']}}]},'headers':{'Authorization':_0x5be8('0x35')+_0x3ed97f},'json':!![]})[_0x5be8('0x2c')](function(_0x4cb12f){if(_0x4cb12f&&_0x4cb12f['data'][0x0]['code']===_0x5be8('0x47')){var _0x45e821=_0x4cb12f['data'][0x0][_0x5be8('0x48')];_0x45e821[_0x5be8('0x40')]=_['startCase'](_0x57c504[_0x5be8('0x43')])+'s';return _0x45e821;}logger[_0x5be8('0x2e')](_0x5be8('0x49'),JSON[_0x5be8('0x11')](data));throw new Error(_0x5be8('0x4a')+JSON[_0x5be8('0x11')](data));})[_0x5be8('0x2d')](function(_0xaf08c7){console[_0x5be8('0x4b')](_0x5be8('0x4c'),_0xaf08c7);});}function getEndUser(_0x5495b1,_0x29c01e,_0x12ef87,_0x17b58b,_0x4b9bf6,_0x3026a7,_0x230317){var _0x330bab={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5495b1},'json':!![]};switch(_0x230317[_0x5be8('0x4d')]){case _0x5be8('0x4e'):_0x330bab[_0x5be8('0x4f')]=_0x5be8('0x50')+_0x29c01e+_0x5be8('0x51')+_0x4b9bf6+'))';return getZohoUser(_0x330bab,_0x5be8('0x52'))[_0x5be8('0x2c')](function(_0xce4291){if(_0xce4291)return _0xce4291;_0x330bab['uri']=_0x5be8('0x50')+_0x29c01e+_0x5be8('0x53')+_0x4b9bf6+'))';return getZohoUser(_0x330bab,_0x5be8('0x54'))[_0x5be8('0x2c')](function(_0x546825){if(_0x546825)return _0x546825;if(_0x230317['moduleCreate']!=_0x5be8('0x55')){return createEndUser(_0x5495b1,_0x29c01e,_0x17b58b,_0x4b9bf6,_0x3026a7,_0x230317);}else{return{};}});});break;case _0x5be8('0x56'):_0x330bab[_0x5be8('0x4f')]='https://www.zohoapis.'+_0x29c01e+_0x5be8('0x51')+_0x4b9bf6+'))';return getZohoUser(_0x330bab,_0x5be8('0x52'))[_0x5be8('0x2c')](function(_0x473a3f){if(_0x473a3f)return _0x473a3f;if(_0x230317[_0x5be8('0x43')]!=_0x5be8('0x55')){return createEndUser(_0x5495b1,_0x29c01e,_0x17b58b,_0x4b9bf6,_0x3026a7,_0x230317);}else{return{};}});break;case _0x5be8('0x57'):_0x330bab['uri']=_0x5be8('0x50')+_0x29c01e+_0x5be8('0x53')+_0x4b9bf6+'))';return getZohoUser(_0x330bab,_0x5be8('0x54'))[_0x5be8('0x2c')](function(_0x4f774a){if(_0x4f774a)return _0x4f774a;if(_0x230317[_0x5be8('0x43')]!=_0x5be8('0x55')){return createEndUser(_0x5495b1,_0x29c01e,_0x17b58b,_0x4b9bf6,_0x3026a7,_0x230317);}else{return{};}});break;}}function getCall(_0x261afc,_0x24cf31,_0x4b6749,_0xc67f1,_0x2c7bde,_0x39013d,_0x2b2a44,_0x31dc66){logger[_0x5be8('0x3b')](_0x5be8('0x58'));var _0x279052={};_0x279052[_0x5be8('0x59')]={'name':!_[_0x5be8('0x1f')](_0xc67f1[_0x5be8('0x44')][_0x5be8('0x1c')])&&!_[_0x5be8('0x1f')](_0xc67f1['profile'][_0x5be8('0x1c')])&&_0xc67f1[_0x5be8('0x5a')][_0x5be8('0x1c')]===_0x5be8('0x5b')?_0xc67f1[_0x5be8('0x44')][_0x5be8('0x1c')]:!_['isNil'](_0xc67f1[_0x5be8('0x45')])?_0xc67f1['first_name']+'\x20'+_0xc67f1['last_name']:_0xc67f1['last_name'],'id':_0xc67f1['id']};_0x279052[_0x5be8('0x5c')]=intUtil[_0x5be8('0x5d')](_0x39013d[_0x5be8('0x5e')],_0x2b2a44,'\x20');_0x279052['Description']=intUtil[_0x5be8('0x5d')](_0x39013d['Descriptions'],_0x2b2a44,'\x0a');if(_0x2c7bde[_0x5be8('0x40')]===_0x5be8('0x52')){_0x279052[_0x5be8('0x5f')]={'name':!_[_0x5be8('0x1f')](_0x2c7bde[_0x5be8('0x60')])?_0x2c7bde[_0x5be8('0x60')]:!_['isNil'](_0x2c7bde[_0x5be8('0x61')])?_0x2c7bde['First_Name']+'\x20'+_0x2c7bde[_0x5be8('0x62')]:_0x2c7bde[_0x5be8('0x62')],'id':_0x2c7bde['id']};}if(_0x2c7bde[_0x5be8('0x40')]===_0x5be8('0x54')){_0x279052[_0x5be8('0x63')]={'name':!_['isNil'](_0x2c7bde['Full_Name'])?_0x2c7bde[_0x5be8('0x60')]:!_[_0x5be8('0x1f')](_0x2c7bde[_0x5be8('0x61')])?_0x2c7bde['First_Name']+'\x20'+_0x2c7bde['Last_Name']:_0x2c7bde['Last_Name'],'id':_0x2c7bde['id']};_0x279052[_0x5be8('0x64')]=_[_0x5be8('0x42')](_0x2c7bde[_0x5be8('0x40')]);}if(_0x2b2a44['talktime']){_0x279052['Call_Duration']=moment[_0x5be8('0x65')](parseInt(_0x2b2a44['talktime'])*0x3e8)['format'](_0x5be8('0x66'));}else if(_0x2b2a44[_0x5be8('0x67')]&&_0x2b2a44['endtime']){_0x279052[_0x5be8('0x68')]=moment[_0x5be8('0x65')](moment(_0x2b2a44[_0x5be8('0x69')],_0x5be8('0x6a'))[_0x5be8('0x6b')](moment(_0x2b2a44['starttime'],_0x5be8('0x6a'))))[_0x5be8('0x32')]('mm:ss');}switch(_0x2b2a44['lastevent']){case'called':_0x279052[_0x5be8('0x6c')]=_0x5be8('0x6d');break;case _0x5be8('0x6e'):case _0x5be8('0x6f'):_0x279052[_0x5be8('0x6c')]=_0x5be8('0x70');break;case'rejected':_0x279052[_0x5be8('0x6c')]=_0x5be8('0x71');break;case _0x5be8('0x72'):_0x279052[_0x5be8('0x6c')]=_0x5be8('0x73');break;case _0x5be8('0x74'):_0x279052[_0x5be8('0x6c')]=_0x5be8('0x75');default:}_0x279052['Call_Start_Time']=(_0x31dc66===_0x5be8('0x76')?moment(_0x2b2a44[_0x5be8('0x77')])['format'](_0x5be8('0x6a')):moment(_0x2b2a44[_0x5be8('0x78')])['format'](_0x5be8('0x6a')))||moment()[_0x5be8('0x32')](_0x5be8('0x6a'));_0x279052[_0x5be8('0x79')]=_0x31dc66||_0x5be8('0x7a');_0x279052=_[_0x5be8('0x7b')](_0x279052,getCustomFields(_0x39013d[_0x5be8('0x7c')],_0x2b2a44));return request({'method':_0x5be8('0x27'),'uri':_0x5be8('0x50')+_0x24cf31+'/crm/v2/Calls','headers':{'Authorization':_0x5be8('0x35')+_0x261afc},'body':{'data':[_0x279052]},'json':!![]})[_0x5be8('0x2c')](function(_0x38640c){if(_0x38640c&&_0x38640c[_0x5be8('0x7d')][0x0][_0x5be8('0x7e')]===_0x5be8('0x47')){logger[_0x5be8('0x3b')](_0x5be8('0x7f'));return{'id':_0x38640c[_0x5be8('0x7d')][0x0]['details']['id']};}})[_0x5be8('0x2d')](function(_0x2b6d06){logger[_0x5be8('0x3b')](_0x5be8('0x80'),_0x2b6d06[_0x5be8('0x81')]);console['log']('err',_0x2b6d06);});}exports[_0x5be8('0x82')]=function(_0x2dcc06,_0x5e1548,_0x504ef1,_0x3e9932,_0x2ce68c,_0x270f45){var _0x240edf,_0x311dd8,_0x26394b;_0x270f45['host']=intUtil[_0x5be8('0x83')](_0x270f45['host']);_0x270f45[_0x5be8('0x84')]=intUtil[_0x5be8('0x83')](_0x270f45[_0x5be8('0x84')]);if(_0x2ce68c&&_0x2ce68c[_0x5be8('0x85')]){logger['info'](_0x5be8('0x86'),'Recording\x20is\x20enabled!');_0x5e1548[_0x5be8('0x87')]=_0x270f45[_0x5be8('0x84')]+_0x5be8('0x88')+_0x5e1548[_0x5be8('0x89')]+_0x5be8('0x8a')+md5(_0x5e1548[_0x5be8('0x89')]);}else{_0x5e1548['recordingURL']='';}var _0x522fae=_0x270f45[_0x5be8('0x8b')]===_0x5be8('0x8c')?'eu':_0x5be8('0x8d');return getAccessToken(_0x270f45)[_0x5be8('0x2c')](function(_0x23382f){_0x26394b=_0x23382f;return getUser(_0x26394b,_0x522fae,_0x270f45,_0x3e9932[_0x5be8('0x39')]);})[_0x5be8('0x2c')](function(_0x539e31){_0x240edf=_0x539e31;logger[_0x5be8('0x3b')](_0x5be8('0x8e'),_0x240edf['id']);return getEndUser(_0x26394b,_0x522fae,_0x270f45,_0x5e1548['calleridname'],_0x5e1548[_0x5be8('0x8f')],_0x240edf,_0x504ef1);})[_0x5be8('0x2c')](function(_0x2e191b){_0x311dd8=_0x2e191b;return getCall(_0x26394b,_0x522fae,_0x270f45,_0x240edf,_0x311dd8,_0x504ef1,_0x5e1548,'Inbound');})[_0x5be8('0x2c')](function(_0x312026){if(_0x312026){logger[_0x5be8('0x3b')](_0x5be8('0x90'),_0x312026['id']);logger[_0x5be8('0x3b')]('[QUEUE]',_0x5be8('0x91'));emit(util['format'](_0x5be8('0x92'),_0x3e9932['name']),_0x5be8('0x93'),{'uri':_0x5be8('0x94')+_0x270f45[_0x5be8('0x8b')]+_0x5be8('0x95')+_0x312026['id']});}})['catch'](function(_0x5d6280){logger[_0x5be8('0x2e')](_0x5be8('0x86'),JSON[_0x5be8('0x11')](_0x5d6280));});};exports[_0x5be8('0x76')]=function(_0x53586d,_0x4ffe6d,_0x2fb68f,_0x22725e,_0x1bed02,_0x4f3a37,_0x22dd9c){var _0x3fa798,_0x237d63,_0xab4161;_0x4f3a37[_0x5be8('0x8b')]=intUtil['stripTrailingSlash'](_0x4f3a37[_0x5be8('0x8b')]);_0x4f3a37[_0x5be8('0x84')]=intUtil[_0x5be8('0x83')](_0x4f3a37[_0x5be8('0x84')]);if(_0x22dd9c&&_0x22dd9c[_0x5be8('0x96')]&&_0x22dd9c['recordingFormat']!==_0x5be8('0x97')){logger[_0x5be8('0x3b')](_0x5be8('0x98'),_0x5be8('0x99'));_0x4ffe6d[_0x5be8('0x87')]=_0x4f3a37[_0x5be8('0x84')]+'/api/voice/recordings/'+_0x4ffe6d[_0x5be8('0x89')]+_0x5be8('0x8a')+md5(_0x4ffe6d['uniqueid']);}var _0x2c72dc=_0x4f3a37[_0x5be8('0x8b')]===_0x5be8('0x8c')?'eu':_0x5be8('0x8d');return getAccessToken(_0x4f3a37)[_0x5be8('0x2c')](function(_0x38a6a2){_0xab4161=_0x38a6a2;return getUser(_0xab4161,_0x2c72dc,_0x4f3a37,_0x22725e[_0x5be8('0x39')]);})[_0x5be8('0x2c')](function(_0x409342){_0x3fa798=_0x409342;logger[_0x5be8('0x3b')]('The\x20User\x20ID\x20is:',_0x3fa798['id']);return getEndUser(_0xab4161,_0x2c72dc,_0x4f3a37,_0x4ffe6d['destcalleridname'],_0x4ffe6d[_0x5be8('0x9a')],_0x3fa798,_0x2fb68f);})[_0x5be8('0x2c')](function(_0x3c5a0d){_0x237d63=_0x3c5a0d;return getCall(_0xab4161,_0x2c72dc,_0x4f3a37,_0x3fa798,_0x237d63,_0x2fb68f,_0x4ffe6d,_0x5be8('0x9b'));})[_0x5be8('0x2c')](function(_0xcd59bf){if(_0xcd59bf){logger['info'](_0x5be8('0x90'),_0xcd59bf['id']);logger[_0x5be8('0x3b')](_0x5be8('0x98'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5be8('0x92'),_0x22725e[_0x5be8('0x1c')]),_0x5be8('0x93'),{'uri':_0x5be8('0x94')+_0x4f3a37[_0x5be8('0x8b')]+_0x5be8('0x95')+_0xcd59bf['id']});}})[_0x5be8('0x2d')](function(_0x2d4e0e){logger['error'](_0x5be8('0x98'),JSON[_0x5be8('0x11')](_0x2d4e0e));});};exports[_0x5be8('0x9c')]=function(_0x47e397,_0x91e291,_0x1be9af,_0x17cd38,_0x5eb351,_0x3988d4){var _0x242a02,_0x4e5635,_0x5db843;_0x3988d4[_0x5be8('0x8b')]=intUtil[_0x5be8('0x83')](_0x3988d4[_0x5be8('0x8b')]);_0x3988d4[_0x5be8('0x84')]=intUtil[_0x5be8('0x83')](_0x3988d4[_0x5be8('0x84')]);if(_0x5eb351&&_0x5eb351[_0x5be8('0x85')]){logger[_0x5be8('0x3b')]('['+_0x91e291[_0x5be8('0x9d')]['toUpperCase']()+']',_0x5be8('0x99'));_0x91e291[_0x5be8('0x87')]=_0x3988d4['serverUrl']+_0x5be8('0x88')+_0x91e291[_0x5be8('0x89')]+_0x5be8('0x8a')+md5(_0x91e291[_0x5be8('0x89')]);}else{_0x91e291[_0x5be8('0x87')]='';}var _0x3d1ee8=_0x3988d4[_0x5be8('0x8b')]===_0x5be8('0x8c')?'eu':'com';return getAccessToken(_0x3988d4)['then'](function(_0x1a07fd){_0x5db843=_0x1a07fd;return getUser(_0x5db843,_0x3d1ee8,_0x3988d4);})['then'](function(_0x49d02b){_0x242a02=_0x49d02b;logger[_0x5be8('0x3b')](_0x5be8('0x8e'),_0x242a02['id']);return getEndUser(_0x5db843,_0x3d1ee8,_0x3988d4,_0x91e291['calleridname'],_0x91e291[_0x5be8('0x8f')],_0x242a02,_0x1be9af);})[_0x5be8('0x2c')](function(_0x2af732){_0x4e5635=_0x2af732;return getCall(_0x5db843,_0x3d1ee8,_0x3988d4,_0x242a02,_0x4e5635,_0x1be9af,_0x91e291,_0x5be8('0x7a'));})[_0x5be8('0x2c')](function(_0x5b2fa2){if(_0x5b2fa2){logger['info'](_0x5be8('0x90'),_0x5b2fa2['id']);}})[_0x5be8('0x2d')](function(_0x46192b){logger[_0x5be8('0x2e')]('['+_0x91e291[_0x5be8('0x9d')]['toUpperCase']()+']',JSON[_0x5be8('0x11')](_0x46192b));});}; \ 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 61c4120..cdfe58e 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 _0xa76c=['data2','Script','render','data3','error','info','util','shelljs','mustache'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xa76c,0x138));var _0xca76=function(_0x197d5c,_0x1936b0){_0x197d5c=_0x197d5c-0x0;var _0x13dc71=_0xa76c[_0x197d5c];return _0x13dc71;};'use strict';var util=require(_0xca76('0x0'));var sh=require(_0xca76('0x1'));var Mustache=require(_0xca76('0x2'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x61b552,_0x31c4c1){var _0x54c6ba=_0x61b552['data2']?_0x61b552[_0xca76('0x3')]:_0xca76('0x4');var _0x3fa84f=_0x61b552['data3']?Mustache[_0xca76('0x5')](_0x61b552[_0xca76('0x6')],_0x31c4c1):_0x31c4c1;sh['exec'](_0x3fa84f,function(_0x566163,_0x3258a0,_0x36b0d4){if(_0x566163!==0x0){logger[_0xca76('0x7')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x54c6ba,_0x3fa84f,_0x566163,_0x36b0d4));}else{logger[_0xca76('0x8')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x54c6ba,_0x3fa84f,_0x3258a0));}});}; \ No newline at end of file +var _0xe71d=['data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','trigger','exec','data2','Script'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe71d,0x72));var _0xde71=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xe71d[_0x9fd887];return _0x1a54ab;};'use strict';var util=require(_0xde71('0x0'));var sh=require(_0xde71('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xde71('0x2'));exports[_0xde71('0x3')]=function(_0x4ef503,_0x595c9b){var _0x3a632b=_0x4ef503[_0xde71('0x4')]?_0x4ef503[_0xde71('0x4')]:_0xde71('0x5');var _0x3e0be3=_0x4ef503[_0xde71('0x6')]?Mustache['render'](_0x4ef503[_0xde71('0x6')],_0x595c9b):_0x595c9b;sh[_0xde71('0x3')](_0x3e0be3,function(_0x348577,_0x16539d,_0x533ff1){if(_0x348577!==0x0){logger['error'](util[_0xde71('0x7')](_0xde71('0x8'),_0x3a632b,_0x3e0be3,_0x348577,_0x533ff1));}else{logger[_0xde71('0x9')](util[_0xde71('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3a632b,_0x3e0be3,_0x16539d));}});}; \ 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 7d15584..9a3c057 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 _0x82a8=['data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','render','data2','data5','number','headers','parse','error','stack','GET','DELETE','POST'];(function(_0x1484e5,_0x2a588b){var _0x1243f7=function(_0x4fd767){while(--_0x4fd767){_0x1484e5['push'](_0x1484e5['shift']());}};_0x1243f7(++_0x2a588b);}(_0x82a8,0x16f));var _0x882a=function(_0x7384fa,_0x205b2d){_0x7384fa=_0x7384fa-0x0;var _0x59b618=_0x82a8[_0x7384fa];return _0x59b618;};'use strict';var rp=require(_0x882a('0x0'));var util=require(_0x882a('0x1'));var _=require(_0x882a('0x2'));var Mustache=require(_0x882a('0x3'));var logger=require(_0x882a('0x4'))(_0x882a('0x5'));exports['exec']=function(_0x33aa88,_0x4af185){var _0x48cf80,_0x3371e6;var _0xa26b0={'method':_0x33aa88[_0x882a('0x6')]['toUpperCase'](),'uri':Mustache[_0x882a('0x7')](_0x33aa88[_0x882a('0x8')],_0x4af185),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x33aa88[_0x882a('0x9')])===_0x882a('0xa')&&parseInt(_0x33aa88[_0x882a('0x9')])>=0x1&&parseInt(_0x33aa88['data5'])<=0xa?parseInt(_0x33aa88[_0x882a('0x9')])*0x3e8:0x5*0x3e8};try{_0xa26b0[_0x882a('0xb')]=_0x33aa88['data6']?JSON[_0x882a('0xc')](Mustache[_0x882a('0x7')](_0x33aa88['data6'],_0x4af185)):{};}catch(_0x51a097){logger[_0x882a('0xd')](_0x51a097[_0x882a('0xe')]);}switch(_0x33aa88[_0x882a('0x6')]['toUpperCase']()){case _0x882a('0xf'):case _0x882a('0x10'):_0x48cf80=null;_0xa26b0['qs']=_0x4af185;break;case _0x882a('0x11'):case'PUT':if(_0x33aa88[_0x882a('0x12')]){try{_0x48cf80=JSON[_0x882a('0xc')](Mustache['render'](_0x33aa88[_0x882a('0x12')],_0x4af185));_0xa26b0[_0x882a('0x13')]=_0x48cf80;}catch(_0x4c6e3a){logger['error'](_0x4c6e3a[_0x882a('0xe')]);logger[_0x882a('0xd')](_0x882a('0x14'));}}else{_0x48cf80=_0x4af185;_0xa26b0[_0x882a('0x13')]=_0x48cf80;}break;}logger[_0x882a('0x15')](util[_0x882a('0x16')](_0x882a('0x17'),_0x33aa88[_0x882a('0x6')],_0x33aa88['data2'],JSON[_0x882a('0x18')](_0xa26b0)));rp(_0xa26b0)[_0x882a('0x19')](function(_0x1d6046){_0x48cf80=!_[_0x882a('0x1a')](_0x48cf80)?_0x882a('0x1b')+_0x48cf80:'';_0x3371e6=typeof _0x1d6046['body']===_0x882a('0x1c')?JSON[_0x882a('0x18')](_0x1d6046[_0x882a('0x13')]):_0x1d6046['body'];logger[_0x882a('0x15')](util['format'](_0x882a('0x1d'),_0x33aa88['data1'],_0x33aa88[_0x882a('0x8')],_0x1d6046[_0x882a('0x1e')],_0x3371e6));})[_0x882a('0x1f')](function(_0x3e66bc){logger['error'](util['format'](_0x882a('0x20'),_0x33aa88[_0x882a('0x6')],_0x33aa88['data2'],_0x3e66bc[_0x882a('0x1e')],_0x3e66bc[_0x882a('0x21')],_0x3e66bc[_0x882a('0x22')]));});}; \ No newline at end of file +var _0xc409=['stringify','then',',\x20request\x20body:\x20','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','message','request-promise','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','headers','data6','parse','render','error','GET','DELETE','POST','PUT','data7','stack','body','info','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc409,0x100));var _0x9c40=function(_0x361caa,_0x532281){_0x361caa=_0x361caa-0x0;var _0x45954f=_0xc409[_0x361caa];return _0x45954f;};'use strict';var rp=require(_0x9c40('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x9c40('0x1'));var logger=require(_0x9c40('0x2'))(_0x9c40('0x3'));exports[_0x9c40('0x4')]=function(_0x4379f9,_0x582b06){var _0x340f7f,_0x3a6bd2;var _0x2ba021={'method':_0x4379f9[_0x9c40('0x5')][_0x9c40('0x6')](),'uri':Mustache['render'](_0x4379f9[_0x9c40('0x7')],_0x582b06),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4379f9['data5'])==='number'&&parseInt(_0x4379f9['data5'])>=0x1&&parseInt(_0x4379f9[_0x9c40('0x8')])<=0xa?parseInt(_0x4379f9[_0x9c40('0x8')])*0x3e8:0x5*0x3e8};try{_0x2ba021[_0x9c40('0x9')]=_0x4379f9[_0x9c40('0xa')]?JSON[_0x9c40('0xb')](Mustache[_0x9c40('0xc')](_0x4379f9[_0x9c40('0xa')],_0x582b06)):{};}catch(_0x468e55){logger[_0x9c40('0xd')](_0x468e55['stack']);}switch(_0x4379f9['data1']['toUpperCase']()){case _0x9c40('0xe'):case _0x9c40('0xf'):_0x340f7f=null;_0x2ba021['qs']=_0x582b06;break;case _0x9c40('0x10'):case _0x9c40('0x11'):if(_0x4379f9[_0x9c40('0x12')]){try{_0x340f7f=JSON['parse'](Mustache[_0x9c40('0xc')](_0x4379f9[_0x9c40('0x12')],_0x582b06));_0x2ba021['body']=_0x340f7f;}catch(_0x5a8ac6){logger['error'](_0x5a8ac6[_0x9c40('0x13')]);logger[_0x9c40('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x340f7f=_0x582b06;_0x2ba021[_0x9c40('0x14')]=_0x340f7f;}break;}logger[_0x9c40('0x15')](util[_0x9c40('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4379f9[_0x9c40('0x5')],_0x4379f9['data2'],JSON[_0x9c40('0x17')](_0x2ba021)));rp(_0x2ba021)[_0x9c40('0x18')](function(_0x32c66c){_0x340f7f=!_['isNil'](_0x340f7f)?_0x9c40('0x19')+_0x340f7f:'';_0x3a6bd2=typeof _0x32c66c[_0x9c40('0x14')]===_0x9c40('0x1a')?JSON[_0x9c40('0x17')](_0x32c66c[_0x9c40('0x14')]):_0x32c66c['body'];logger[_0x9c40('0x15')](util[_0x9c40('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4379f9['data1'],_0x4379f9['data2'],_0x32c66c['statusCode'],_0x3a6bd2));})[_0x9c40('0x1b')](function(_0x4e6f35){logger[_0x9c40('0xd')](util[_0x9c40('0x16')](_0x9c40('0x1c'),_0x4379f9[_0x9c40('0x5')],_0x4379f9[_0x9c40('0x7')],_0x4e6f35[_0x9c40('0x1d')],_0x4e6f35['name'],_0x4e6f35[_0x9c40('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3673786..2d0f73e 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 _0xaf42=['result','catch','exports','jayson/promise','bluebird','routing','client','request','then','rpc','error','message'];(function(_0x598019,_0x3c9a4f){var _0x3cc2cb=function(_0x549879){while(--_0x549879){_0x598019['push'](_0x598019['shift']());}};_0x3cc2cb(++_0x3c9a4f);}(_0xaf42,0x183));var _0x2af4=function(_0x4f8a2e,_0x47d53f){_0x4f8a2e=_0x4f8a2e-0x0;var _0x389b47=_0xaf42[_0x4f8a2e];return _0x389b47;};'use strict';var jayson=require(_0x2af4('0x0'));var BPromise=require(_0x2af4('0x1'));var logger=require('../../config/logger')(_0x2af4('0x2'));var client=jayson[_0x2af4('0x3')]['http']({'port':0x2329});client['Request']=function(_0x384806,_0x1dc73d){return new BPromise(function(_0x8ec206,_0x1fa4c4){return client[_0x2af4('0x4')](_0x384806,_0x1dc73d)[_0x2af4('0x5')](function(_0x1adc7c){logger['debug'](_0x2af4('0x6'),_0x2af4('0x2'),_0x384806,_0x1dc73d,_0x1adc7c);if(_0x1adc7c[_0x2af4('0x7')]){logger['error'](_0x2af4('0x6'),_0x2af4('0x2'),_0x384806,_0x1adc7c[_0x2af4('0x7')][_0x2af4('0x8')],_0x1dc73d);return _0x1fa4c4(_0x1adc7c[_0x2af4('0x7')]['message']);}else{return _0x8ec206(_0x1adc7c[_0x2af4('0x9')]);}})[_0x2af4('0xa')](function(_0x3b4bf1){logger['error'](_0x2af4('0x6'),_0x2af4('0x2'),_0x384806,_0x3b4bf1,_0x1dc73d);return _0x1fa4c4(_0x3b4bf1);});});};module[_0x2af4('0xb')]=client; \ No newline at end of file +var _0x5986=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','then','rpc','error','message'];(function(_0x26a45e,_0x137e6e){var _0xb5ce4b=function(_0x37aab6){while(--_0x37aab6){_0x26a45e['push'](_0x26a45e['shift']());}};_0xb5ce4b(++_0x137e6e);}(_0x5986,0xd3));var _0x6598=function(_0x1e39d8,_0x669688){_0x1e39d8=_0x1e39d8-0x0;var _0x2b7ebf=_0x5986[_0x1e39d8];return _0x2b7ebf;};'use strict';var jayson=require(_0x6598('0x0'));var BPromise=require(_0x6598('0x1'));var logger=require(_0x6598('0x2'))(_0x6598('0x3'));var client=jayson[_0x6598('0x4')][_0x6598('0x5')]({'port':0x2329});client['Request']=function(_0xdc6a29,_0x43c24b){return new BPromise(function(_0x1cd79b,_0x1cf242){return client['request'](_0xdc6a29,_0x43c24b)[_0x6598('0x6')](function(_0x2b1ec4){logger['debug'](_0x6598('0x7'),_0x6598('0x3'),_0xdc6a29,_0x43c24b,_0x2b1ec4);if(_0x2b1ec4[_0x6598('0x8')]){logger[_0x6598('0x8')]('rpc','routing',_0xdc6a29,_0x2b1ec4[_0x6598('0x8')]['message'],_0x43c24b);return _0x1cf242(_0x2b1ec4[_0x6598('0x8')][_0x6598('0x9')]);}else{return _0x1cd79b(_0x2b1ec4[_0x6598('0xa')]);}})[_0x6598('0xb')](function(_0x52e608){logger[_0x6598('0x8')]('rpc',_0x6598('0x3'),_0xdc6a29,_0x52e608,_0x43c24b);return _0x1cf242(_0x52e608);});});};module[_0x6598('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ad9c091..39ae55d 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 _0x0c8e=['getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','./server','./realtime','./rpc/mailAccount','../../config/logger','email','resolve','then'];(function(_0x648cef,_0x53eb11){var _0x2e1f21=function(_0x25d080){while(--_0x25d080){_0x648cef['push'](_0x648cef['shift']());}};_0x2e1f21(++_0x53eb11);}(_0x0c8e,0x93));var _0xe0c8=function(_0x5c348d,_0xe3d1ed){_0x5c348d=_0x5c348d-0x0;var _0x4865fa=_0x0c8e[_0x5c348d];return _0x4865fa;};'use strict';var server=require(_0xe0c8('0x0'));var Realtime=require(_0xe0c8('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xe0c8('0x2'));var setting=require('./rpc/setting');var logger=require(_0xe0c8('0x3'))(_0xe0c8('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe0c8('0x5')]()[_0xe0c8('0x6')](mailAccount[_0xe0c8('0x7')]())[_0xe0c8('0x6')](realtime['initMailAccounts']())[_0xe0c8('0x6')](function(){email[_0xe0c8('0x8')](realtime[_0xe0c8('0x9')]);return realtime;});}function main(){return server[_0xe0c8('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0xe0c8('0x6')](function(){return setting[_0xe0c8('0xb')]();})[_0xe0c8('0x6')](function(_0xaf3493){return setInterval(initRealtime,_0xaf3493[_0xe0c8('0xc')]*0x3e8);})[_0xe0c8('0xd')](function(_0x6c058){logger['error']('Email\x20service\x20initialization',_0x6c058);});}main(); \ No newline at end of file +var _0xd5ca=['getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/setting','../../config/logger','email','resolve','then'];(function(_0x5aba6b,_0x1520ed){var _0x232e48=function(_0x2b32dd){while(--_0x2b32dd){_0x5aba6b['push'](_0x5aba6b['shift']());}};_0x232e48(++_0x1520ed);}(_0xd5ca,0x1e9));var _0xad5c=function(_0x452275,_0x459d03){_0x452275=_0x452275-0x0;var _0x15e3c8=_0xd5ca[_0x452275];return _0x15e3c8;};'use strict';var server=require('./server');var Realtime=require(_0xad5c('0x0'));var EmailChannel=require(_0xad5c('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xad5c('0x2'));var logger=require(_0xad5c('0x3'))(_0xad5c('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xad5c('0x5')]()[_0xad5c('0x6')](mailAccount[_0xad5c('0x7')]())[_0xad5c('0x6')](realtime[_0xad5c('0x8')]())['then'](function(){email['refresh'](realtime[_0xad5c('0x9')]);return realtime;});}function main(){return server[_0xad5c('0xa')](realtime,email)[_0xad5c('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xad5c('0xb')]();})[_0xad5c('0x6')](function(_0x15bf9e){return setInterval(initRealtime,_0x15bf9e[_0xad5c('0xc')]*0x3e8);})[_0xad5c('0xd')](function(_0x1eaa1d){logger[_0xad5c('0xe')](_0xad5c('0xf'),_0x1eaa1d);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e593472..0abfd56 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 _0xe593=['md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit','name','active','Imap','messageStatus','total','mailAccount:update','refresh','hasOwnProperty','service','provider','imapAccounts','handleImapBox','bind','end','handleImapEnd','error','isNil','disabled','status','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapError','sendMail','verifySmtp','Smtp','verify','exports','lodash'];(function(_0x241a9d,_0x365b61){var _0x71c972=function(_0x654edc){while(--_0x654edc){_0x241a9d['push'](_0x241a9d['shift']());}};_0x71c972(++_0x365b61);}(_0xe593,0x9e));var _0x3e59=function(_0x1218fe,_0x3d02b8){_0x1218fe=_0x1218fe-0x0;var _0x1bc8fb=_0xe593[_0x1218fe];return _0x1bc8fb;};'use strict';var _=require(_0x3e59('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x3e59('0x1'));var Redis=require(_0x3e59('0x2'));var config=require('../../../config/environment');var logger=require(_0x3e59('0x3'))(_0x3e59('0x4'));config[_0x3e59('0x5')]=_[_0x3e59('0x6')](config[_0x3e59('0x5')],{'host':_0x3e59('0x7'),'port':0x18eb});var io=require(_0x3e59('0x8'))(new Redis(config[_0x3e59('0x5')]));var EmailImap=require(_0x3e59('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3e59('0xa'));var md5Accounts={};function EmailChannel(_0x6bc60b){logger[_0x3e59('0xb')]('start\x20email\x20channel');this[_0x3e59('0xc')]=_0x6bc60b[_0x3e59('0xc')];this['imapAccounts']={};this[_0x3e59('0xd')]=new EmailSmtp();}EmailChannel[_0x3e59('0xe')][_0x3e59('0xf')]=function(_0x306a1b){var _0x541f55=this['mailAccounts'][_0x306a1b];var _0x4629b6={'id':_0x541f55['id'],'name':_0x541f55[_0x3e59('0x10')],'key':_0x541f55['key'],'active':_0x541f55[_0x3e59('0x11')],'Imap':{'status':_0x541f55[_0x3e59('0x12')]['status'],'messageStatus':_0x541f55[_0x3e59('0x12')][_0x3e59('0x13')],'total':_0x541f55[_0x3e59('0x12')][_0x3e59('0x14')]}};if(_['isNil'](md5Accounts[_0x306a1b])){md5Accounts[_0x306a1b]={};}var _0x3019f0=md5(JSON['stringify'](_0x4629b6));if(md5Accounts[_0x306a1b][_0x3e59('0x1')]!==_0x3019f0){md5Accounts[_0x306a1b]['md5']=_0x3019f0;io[_0x3e59('0xf')](_0x3e59('0x15'),_0x4629b6);}};EmailChannel[_0x3e59('0xe')][_0x3e59('0x16')]=function(_0x15e565){for(var _0x3bf479 in _0x15e565){if(_0x15e565[_0x3e59('0x17')](_0x3bf479)){if(_0x15e565[_0x3bf479][_0x3e59('0x12')]&&_0x15e565[_0x3bf479][_0x3e59('0x11')]){var _0x343a4e=_0x15e565[_0x3bf479][_0x3e59('0x12')];if(!_0x343a4e[_0x3e59('0x18')]&&_0x15e565[_0x3bf479][_0x3e59('0x19')]!=='custom')_0x343a4e['service']=_0x15e565[_0x3bf479][_0x3e59('0x19')];if(!this[_0x3e59('0x1a')][_0x3e59('0x17')](_0x343a4e['id'])){this[_0x3e59('0x1a')][_0x343a4e['id']]=new EmailImap(_0x343a4e,_0x15e565[_0x3bf479][_0x3e59('0x4')]);this[_0x3e59('0x1a')][_0x343a4e['id']]['on']('box',this[_0x3e59('0x1b')][_0x3e59('0x1c')](this,_0x3bf479));this[_0x3e59('0x1a')][_0x343a4e['id']]['on'](_0x3e59('0x4'),this['handleImapEmail']['bind'](this,_0x3bf479));this['imapAccounts'][_0x343a4e['id']]['on'](_0x3e59('0x1d'),this[_0x3e59('0x1e')][_0x3e59('0x1c')](this,_0x3bf479));this[_0x3e59('0x1a')][_0x343a4e['id']]['on'](_0x3e59('0x1f'),this['handleImapError'][_0x3e59('0x1c')](this,_0x3bf479));}}else{if(_[_0x3e59('0x20')](this[_0x3e59('0xc')][_0x3bf479]['Imap'])){this[_0x3e59('0xc')][_0x3bf479][_0x3e59('0x12')]={};}this[_0x3e59('0xc')][_0x3bf479]['Imap']['status']=_0x3e59('0x21');this[_0x3e59('0xc')][_0x3bf479][_0x3e59('0x12')]['messageStatus']='';this[_0x3e59('0xf')](_0x3bf479);}}}};EmailChannel['prototype'][_0x3e59('0x1b')]=function(_0x993f97,_0x1fd31e){if(this[_0x3e59('0xc')][_0x993f97]){this['mailAccounts'][_0x993f97]['Imap'][_0x3e59('0x22')]=_0x3e59('0x23');this[_0x3e59('0xc')][_0x993f97]['Imap']['messageStatus']=_0x1fd31e[_0x3e59('0x10')];if(_0x1fd31e[_0x3e59('0x24')]){this[_0x3e59('0xc')][_0x993f97][_0x3e59('0x12')][_0x3e59('0x14')]=_0x1fd31e[_0x3e59('0x24')][_0x3e59('0x14')];}return this[_0x3e59('0xf')](_0x993f97);}};EmailChannel[_0x3e59('0xe')][_0x3e59('0x25')]=function(_0x447deb,_0x1fd6b6){logger[_0x3e59('0xb')](_0x3e59('0x26'),_0x1fd6b6['firstName'],_0x1fd6b6[_0x3e59('0x27')],_0x1fd6b6[_0x3e59('0x28')],_0x447deb);if(this[_0x3e59('0xc')][_0x447deb]){return mailAccount[_0x3e59('0x29')](_0x447deb,_0x1fd6b6)[_0x3e59('0x2a')](function(_0x3e4d5c){if(_0x3e4d5c){logger['info'](_0x3e59('0x2b'));}})[_0x3e59('0x2c')](function(_0x418939){logger[_0x3e59('0x1f')](_0x3e59('0x2d'),JSON[_0x3e59('0x2e')](_0x418939));});}};EmailChannel[_0x3e59('0xe')][_0x3e59('0x1e')]=function(_0xeb5bb3){if(this[_0x3e59('0xc')][_0xeb5bb3]&&this[_0x3e59('0xc')][_0xeb5bb3]['Imap']){if(this[_0x3e59('0x1a')][this[_0x3e59('0xc')][_0xeb5bb3][_0x3e59('0x12')]['id']]){delete this[_0x3e59('0x1a')][this['mailAccounts'][_0xeb5bb3][_0x3e59('0x12')]['id']];}this[_0x3e59('0xc')][_0xeb5bb3]['Imap']['lastSync']=moment();this[_0x3e59('0xf')](_0xeb5bb3);}};EmailChannel['prototype'][_0x3e59('0x2f')]=function(_0x233930,_0x4e3df3){if(this['mailAccounts'][_0x233930]){this[_0x3e59('0xc')][_0x233930][_0x3e59('0x12')]['status']='error';this[_0x3e59('0xc')][_0x233930][_0x3e59('0x12')][_0x3e59('0x13')]=_0x4e3df3;return this[_0x3e59('0xf')](_0x233930);}};EmailChannel[_0x3e59('0xe')][_0x3e59('0x30')]=function(_0x3ac0d5,_0x3a2b6f){return this[_0x3e59('0xd')]['send'](_0x3ac0d5,_0x3a2b6f);};EmailChannel['prototype'][_0x3e59('0x31')]=function(_0x3d5155){var _0x3147ac=this;if(this[_0x3e59('0xc')][_0x3d5155['id']]){if(_[_0x3e59('0x20')](this['mailAccounts'][_0x3d5155['id']][_0x3e59('0x32')])){this['mailAccounts'][_0x3d5155['id']][_0x3e59('0x32')]={};}this[_0x3e59('0xc')][_0x3d5155['id']][_0x3e59('0x32')]['lastSync']=moment();return new BPromise(function(_0x5eeba7,_0x1ebc13){return _0x3147ac['smtp'][_0x3e59('0x33')](_0x3d5155)[_0x3e59('0x2a')](function(_0x452dc4){_0x3147ac[_0x3e59('0xc')][_0x3d5155['id']][_0x3e59('0x32')][_0x3e59('0x22')]='verified';_0x3147ac[_0x3e59('0xc')][_0x3d5155['id']][_0x3e59('0x32')][_0x3e59('0x13')]='';_0x3147ac[_0x3e59('0xf')](_0x3d5155['id']);_0x5eeba7(_0x452dc4);})[_0x3e59('0x2c')](function(_0x5ee6cc){_0x3147ac[_0x3e59('0xc')][_0x3d5155['id']]['Smtp'][_0x3e59('0x22')]='error';_0x3147ac[_0x3e59('0xc')][_0x3d5155['id']][_0x3e59('0x32')]['messageStatus']=_0x5ee6cc;_0x3147ac['emit'](_0x3d5155['id']);_0x1ebc13(_0x5ee6cc);});});}return this[_0x3e59('0xd')]['verify'](_0x3d5155);};module[_0x3e59('0x34')]=EmailChannel; \ No newline at end of file +var _0xdc64=['prototype','emit','active','Imap','status','total','isNil','stringify','mailAccount:update','hasOwnProperty','service','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','messageStatus','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','Smtp','verify','then','exports','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp'];(function(_0x486056,_0x22903d){var _0x43eb97=function(_0x4f0811){while(--_0x4f0811){_0x486056['push'](_0x486056['shift']());}};_0x43eb97(++_0x22903d);}(_0xdc64,0x1de));var _0x4dc6=function(_0x3a58e4,_0x360969){_0x3a58e4=_0x3a58e4-0x0;var _0x636790=_0xdc64[_0x3a58e4];return _0x636790;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x4dc6('0x0'));var md5=require(_0x4dc6('0x1'));var Redis=require(_0x4dc6('0x2'));var config=require(_0x4dc6('0x3'));var logger=require(_0x4dc6('0x4'))(_0x4dc6('0x5'));config['redis']=_['defaults'](config[_0x4dc6('0x6')],{'host':_0x4dc6('0x7'),'port':0x18eb});var io=require(_0x4dc6('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x4dc6('0x9'));var EmailSmtp=require(_0x4dc6('0xa'));var mailAccount=require(_0x4dc6('0xb'));var md5Accounts={};function EmailChannel(_0x47c7be){logger[_0x4dc6('0xc')](_0x4dc6('0xd'));this[_0x4dc6('0xe')]=_0x47c7be[_0x4dc6('0xe')];this[_0x4dc6('0xf')]={};this[_0x4dc6('0x10')]=new EmailSmtp();}EmailChannel[_0x4dc6('0x11')][_0x4dc6('0x12')]=function(_0xf0aa42){var _0x385e2b=this[_0x4dc6('0xe')][_0xf0aa42];var _0x123522={'id':_0x385e2b['id'],'name':_0x385e2b['name'],'key':_0x385e2b['key'],'active':_0x385e2b[_0x4dc6('0x13')],'Imap':{'status':_0x385e2b[_0x4dc6('0x14')][_0x4dc6('0x15')],'messageStatus':_0x385e2b[_0x4dc6('0x14')]['messageStatus'],'total':_0x385e2b[_0x4dc6('0x14')][_0x4dc6('0x16')]}};if(_[_0x4dc6('0x17')](md5Accounts[_0xf0aa42])){md5Accounts[_0xf0aa42]={};}var _0x5bee25=md5(JSON[_0x4dc6('0x18')](_0x123522));if(md5Accounts[_0xf0aa42][_0x4dc6('0x1')]!==_0x5bee25){md5Accounts[_0xf0aa42]['md5']=_0x5bee25;io[_0x4dc6('0x12')](_0x4dc6('0x19'),_0x123522);}};EmailChannel[_0x4dc6('0x11')]['refresh']=function(_0x554151){for(var _0x420ba9 in _0x554151){if(_0x554151[_0x4dc6('0x1a')](_0x420ba9)){if(_0x554151[_0x420ba9][_0x4dc6('0x14')]&&_0x554151[_0x420ba9][_0x4dc6('0x13')]){var _0x400554=_0x554151[_0x420ba9][_0x4dc6('0x14')];if(!_0x400554[_0x4dc6('0x1b')]&&_0x554151[_0x420ba9][_0x4dc6('0x1c')]!=='custom')_0x400554[_0x4dc6('0x1b')]=_0x554151[_0x420ba9][_0x4dc6('0x1c')];if(!this[_0x4dc6('0xf')][_0x4dc6('0x1a')](_0x400554['id'])){this[_0x4dc6('0xf')][_0x400554['id']]=new EmailImap(_0x400554,_0x554151[_0x420ba9][_0x4dc6('0x5')]);this[_0x4dc6('0xf')][_0x400554['id']]['on'](_0x4dc6('0x1d'),this[_0x4dc6('0x1e')][_0x4dc6('0x1f')](this,_0x420ba9));this[_0x4dc6('0xf')][_0x400554['id']]['on'](_0x4dc6('0x5'),this[_0x4dc6('0x20')]['bind'](this,_0x420ba9));this['imapAccounts'][_0x400554['id']]['on'](_0x4dc6('0x21'),this[_0x4dc6('0x22')][_0x4dc6('0x1f')](this,_0x420ba9));this[_0x4dc6('0xf')][_0x400554['id']]['on'](_0x4dc6('0x23'),this['handleImapError'][_0x4dc6('0x1f')](this,_0x420ba9));}}else{if(_[_0x4dc6('0x17')](this[_0x4dc6('0xe')][_0x420ba9][_0x4dc6('0x14')])){this[_0x4dc6('0xe')][_0x420ba9][_0x4dc6('0x14')]={};}this[_0x4dc6('0xe')][_0x420ba9][_0x4dc6('0x14')][_0x4dc6('0x15')]=_0x4dc6('0x24');this[_0x4dc6('0xe')][_0x420ba9][_0x4dc6('0x14')][_0x4dc6('0x25')]='';this[_0x4dc6('0x12')](_0x420ba9);}}}};EmailChannel[_0x4dc6('0x11')]['handleImapBox']=function(_0x328cfa,_0xe2ec7b){if(this[_0x4dc6('0xe')][_0x328cfa]){this[_0x4dc6('0xe')][_0x328cfa][_0x4dc6('0x14')]['status']=_0x4dc6('0x26');this[_0x4dc6('0xe')][_0x328cfa][_0x4dc6('0x14')][_0x4dc6('0x25')]=_0xe2ec7b[_0x4dc6('0x27')];if(_0xe2ec7b[_0x4dc6('0x28')]){this[_0x4dc6('0xe')][_0x328cfa][_0x4dc6('0x14')][_0x4dc6('0x16')]=_0xe2ec7b[_0x4dc6('0x28')][_0x4dc6('0x16')];}return this[_0x4dc6('0x12')](_0x328cfa);}};EmailChannel['prototype']['handleImapEmail']=function(_0x69e66c,_0x176cb6){logger[_0x4dc6('0xc')](_0x4dc6('0x29'),_0x176cb6['firstName'],_0x176cb6[_0x4dc6('0x2a')],_0x176cb6[_0x4dc6('0x2b')],_0x69e66c);if(this['mailAccounts'][_0x69e66c]){return mailAccount[_0x4dc6('0x2c')](_0x69e66c,_0x176cb6)['then'](function(_0x2e011c){if(_0x2e011c){logger['info'](_0x4dc6('0x2d'));}})[_0x4dc6('0x2e')](function(_0xd41008){logger['error'](_0x4dc6('0x2f'),JSON[_0x4dc6('0x18')](_0xd41008));});}};EmailChannel['prototype'][_0x4dc6('0x22')]=function(_0x2131ed){if(this[_0x4dc6('0xe')][_0x2131ed]&&this['mailAccounts'][_0x2131ed][_0x4dc6('0x14')]){if(this[_0x4dc6('0xf')][this['mailAccounts'][_0x2131ed][_0x4dc6('0x14')]['id']]){delete this[_0x4dc6('0xf')][this[_0x4dc6('0xe')][_0x2131ed]['Imap']['id']];}this[_0x4dc6('0xe')][_0x2131ed][_0x4dc6('0x14')][_0x4dc6('0x30')]=moment();this[_0x4dc6('0x12')](_0x2131ed);}};EmailChannel[_0x4dc6('0x11')][_0x4dc6('0x31')]=function(_0x43a5ed,_0x32cb80){if(this['mailAccounts'][_0x43a5ed]){this[_0x4dc6('0xe')][_0x43a5ed][_0x4dc6('0x14')][_0x4dc6('0x15')]=_0x4dc6('0x23');this[_0x4dc6('0xe')][_0x43a5ed]['Imap'][_0x4dc6('0x25')]=_0x32cb80;return this[_0x4dc6('0x12')](_0x43a5ed);}};EmailChannel[_0x4dc6('0x11')][_0x4dc6('0x32')]=function(_0x13bf48,_0x16e0ea){return this[_0x4dc6('0x10')]['send'](_0x13bf48,_0x16e0ea);};EmailChannel['prototype']['verifySmtp']=function(_0x1cf6aa){var _0xff32cd=this;if(this['mailAccounts'][_0x1cf6aa['id']]){if(_[_0x4dc6('0x17')](this[_0x4dc6('0xe')][_0x1cf6aa['id']][_0x4dc6('0x33')])){this[_0x4dc6('0xe')][_0x1cf6aa['id']]['Smtp']={};}this[_0x4dc6('0xe')][_0x1cf6aa['id']][_0x4dc6('0x33')][_0x4dc6('0x30')]=moment();return new BPromise(function(_0x1f0cda,_0x427a19){return _0xff32cd[_0x4dc6('0x10')][_0x4dc6('0x34')](_0x1cf6aa)[_0x4dc6('0x35')](function(_0x2d2f18){_0xff32cd['mailAccounts'][_0x1cf6aa['id']][_0x4dc6('0x33')][_0x4dc6('0x15')]='verified';_0xff32cd[_0x4dc6('0xe')][_0x1cf6aa['id']]['Smtp'][_0x4dc6('0x25')]='';_0xff32cd['emit'](_0x1cf6aa['id']);_0x1f0cda(_0x2d2f18);})['catch'](function(_0x28d27d){_0xff32cd[_0x4dc6('0xe')][_0x1cf6aa['id']]['Smtp'][_0x4dc6('0x15')]=_0x4dc6('0x23');_0xff32cd[_0x4dc6('0xe')][_0x1cf6aa['id']][_0x4dc6('0x33')][_0x4dc6('0x25')]=_0x28d27d;_0xff32cd[_0x4dc6('0x12')](_0x1cf6aa['id']);_0x427a19(_0x28d27d);});});}return this['smtp']['verify'](_0x1cf6aa);};module[_0x4dc6('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 1bc3e22..e9d697c 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 _0xfdbd=['error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','autotls','required','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','user','email','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','getAccount','once','ready','handleReady','bind','handleEnd'];(function(_0x2d6fa6,_0x4895be){var _0x6a8759=function(_0x3a8cc6){while(--_0x3a8cc6){_0x2d6fa6['push'](_0x2d6fa6['shift']());}};_0x6a8759(++_0x4895be);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1265fa,_0x1a1fed){_0x1265fa=_0x1265fa-0x0;var _0x1fe35e=_0xfdbd[_0x1265fa];return _0x1fe35e;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var Imap=require(_0xdfdb('0x2'));var simpleParser=require(_0xdfdb('0x3'))[_0xdfdb('0x4')];var Iconv=require(_0xdfdb('0x5'))[_0xdfdb('0x6')];var EventEmitter=require(_0xdfdb('0x7'))[_0xdfdb('0x8')];var utils=require('./utils');var logger=require(_0xdfdb('0x9'))('email');function EmailImap(_0x453ef6,_0x41bd5e){this['mailbox']='INBOX';this['account']=this[_0xdfdb('0xa')](_0x453ef6,_0x41bd5e);this[_0xdfdb('0x2')]=new Imap(this['account']);this[_0xdfdb('0x2')][_0xdfdb('0xb')](_0xdfdb('0xc'),this[_0xdfdb('0xd')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0xb')]('end',this[_0xdfdb('0xf')][_0xdfdb('0xe')](this));this['imap']['on'](_0xdfdb('0x10'),this[_0xdfdb('0x11')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0x12')]();}util[_0xdfdb('0x13')](EmailImap,EventEmitter);EmailImap[_0xdfdb('0x14')][_0xdfdb('0xa')]=function(_0x51162f,_0x48a66a){var _0x2c44dc={'connTimeout':_0x51162f['connTimeout']?_0x51162f[_0xdfdb('0x15')]*0x3e8:0x2710,'authTimeout':_0x51162f[_0xdfdb('0x16')]?_0x51162f[_0xdfdb('0x16')]*0x3e8:0x1388};if(_[_0xdfdb('0x17')](_0x51162f[_0xdfdb('0x18')])){if(_0x51162f[_0xdfdb('0x19')]){_0x2c44dc['user']=_0x51162f['user'];_0x2c44dc[_0xdfdb('0x1a')]=_0x51162f[_0xdfdb('0x1a')];}_0x2c44dc[_0xdfdb('0x1b')]=_0x51162f['host'];_0x2c44dc[_0xdfdb('0x1c')]=_0x51162f[_0xdfdb('0x1c')]||0x3e1;if(_0x51162f[_0xdfdb('0x1d')]){_0x2c44dc[_0xdfdb('0x1d')]=!![];}else{_0x2c44dc[_0xdfdb('0x1d')]=![];_0x2c44dc[_0xdfdb('0x1e')]=_0xdfdb('0x1f');}}else{if(_0x51162f[_0xdfdb('0x20')]){_0x2c44dc['xoauth2']=utils[_0xdfdb('0x21')](_0x51162f[_0xdfdb('0x22')][_0xdfdb('0x23')],_0x51162f['user']);_0x2c44dc[_0xdfdb('0x24')]=_0x51162f[_0xdfdb('0x24')];}else{_0x2c44dc[_0xdfdb('0x24')]=_0x51162f['user'];_0x2c44dc[_0xdfdb('0x1a')]=_0x51162f[_0xdfdb('0x1a')];}_0x2c44dc[_0xdfdb('0x1b')]=utils['getHost'](_0x51162f[_0xdfdb('0x18')]);_0x2c44dc['port']=0x3e1;_0x2c44dc[_0xdfdb('0x1d')]=!![];}_0x2c44dc[_0xdfdb('0x25')]=_0x48a66a||_0x51162f[_0xdfdb('0x24')]||_0xdfdb('0x26');return _0x2c44dc;};EmailImap['prototype'][_0xdfdb('0xd')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x27')](this[_0xdfdb('0x28')],![],this[_0xdfdb('0x29')][_0xdfdb('0xe')](this));};EmailImap['prototype'][_0xdfdb('0x29')]=function(_0x2d5fe2,_0xdf3a5c){if(_0x2d5fe2){this['handleError'](_0x2d5fe2,!![]);}else{this[_0xdfdb('0x2a')]('box',_0xdf3a5c);this[_0xdfdb('0x2b')]();}};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2c')]=function(_0x513fa0){if(_0x513fa0){this['handleError'](_0x513fa0,!![]);}else{this[_0xdfdb('0x2')][_0xdfdb('0x2d')]();}};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2b')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x2e')](['UNSEEN'],this[_0xdfdb('0x2f')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2f')]=function(_0x10f4f6,_0x157de8){if(_0x10f4f6){this[_0xdfdb('0x11')](_0x10f4f6,!![]);}else{if(_0x157de8[_0xdfdb('0x30')]){try{var _0x68398d=this[_0xdfdb('0x2')][_0xdfdb('0x31')](_0x157de8,{'bodies':'','markSeen':!![]});_0x68398d['on']('message',this['handleFetchMessage'][_0xdfdb('0xe')](this));_0x68398d['once'](_0xdfdb('0x10'),this[_0xdfdb('0x32')][_0xdfdb('0xe')](this));_0x68398d[_0xdfdb('0xb')]('end',this[_0xdfdb('0x33')]['bind'](this));}catch(_0x341f0d){logger[_0xdfdb('0x10')](_0x341f0d);}}else{this[_0xdfdb('0x2')][_0xdfdb('0x34')](!![],this[_0xdfdb('0x2c')][_0xdfdb('0xe')](this));}}};EmailImap['prototype'][_0xdfdb('0x35')]=function(_0xd8528d){_0xd8528d['on']('body',this[_0xdfdb('0x36')][_0xdfdb('0xe')](this));_0xd8528d[_0xdfdb('0xb')](_0xdfdb('0x37'),this[_0xdfdb('0x38')][_0xdfdb('0xe')](this));_0xd8528d[_0xdfdb('0xb')](_0xdfdb('0x2d'),this[_0xdfdb('0x39')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleMessageBody']=function(_0x2defcc){simpleParser(_0x2defcc,{'Iconv':Iconv},this[_0xdfdb('0x3a')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x38')]=function(){};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x39')]=function(){};EmailImap[_0xdfdb('0x14')]['handleSimpleParser']=function(_0x55d707,_0x435557){if(_0x55d707){logger[_0xdfdb('0x10')](_0x55d707);}else{var _0x16e100=this;utils[_0xdfdb('0x3b')](this[_0xdfdb('0x3c')],_0x435557,function(_0x300884){_0x16e100[_0xdfdb('0x2a')](_0xdfdb('0x25'),_0x300884);});}};EmailImap[_0xdfdb('0x14')]['handleFetchEnd']=function(){this[_0xdfdb('0x2')][_0xdfdb('0x34')](!![],this[_0xdfdb('0x2c')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleFetchError']=function(_0x281cec){this[_0xdfdb('0x11')](_0x281cec);this[_0xdfdb('0x2')][_0xdfdb('0x34')](!![],this[_0xdfdb('0x2c')]['bind'](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0xf')]=function(){this[_0xdfdb('0x2a')]('end');};EmailImap[_0xdfdb('0x14')]['handleError']=function(_0x4c9850,_0x4ce8de){logger[_0xdfdb('0x10')](_0xdfdb('0x11'),this['account'][_0xdfdb('0x25')],JSON['stringify'](_0x4c9850));var _0xfea790='';if(_0x4c9850){if(_0x4c9850[_0xdfdb('0x3d')]){_0xfea790=_0x4c9850[_0xdfdb('0x3d')];}else{for(var _0x2566f8 in _0x4c9850){if(_0x4c9850[_0xdfdb('0x3e')](_0x2566f8)){_0xfea790+=_['upperFirst'](_0x2566f8)+':\x20'+_0x4c9850[_0x2566f8]+'\x0a';}}}}if(_0x4ce8de){this['imap'][_0xdfdb('0x2d')]();}else{this[_0xdfdb('0x2a')]('error',_0xfea790);this[_0xdfdb('0x2a')]('end');}};module[_0xdfdb('0x3f')]=EmailImap; \ No newline at end of file +var _0x2675=['../../../config/logger','email','mailbox','INBOX','getAccount','imap','ready','handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','xoauth2','generateXOAuth2Token','CloudProvider','data5','anonymous@xcally.com','openBox','handleOpenBox','readUnseen','handleCloseBox','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','end','handleMessageEnd','handleSimpleParser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','simpleParser','iconv','events','EventEmitter'];(function(_0x168f17,_0x371e7b){var _0x527037=function(_0x224a72){while(--_0x224a72){_0x168f17['push'](_0x168f17['shift']());}};_0x527037(++_0x371e7b);}(_0x2675,0x75));var _0x5267=function(_0x3b6fe8,_0x64079b){_0x3b6fe8=_0x3b6fe8-0x0;var _0x41f548=_0x2675[_0x3b6fe8];return _0x41f548;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require('mailparser')[_0x5267('0x1')];var Iconv=require(_0x5267('0x2'))['Iconv'];var EventEmitter=require(_0x5267('0x3'))[_0x5267('0x4')];var utils=require('./utils');var logger=require(_0x5267('0x5'))(_0x5267('0x6'));function EmailImap(_0x4bd042,_0x10f92c){this[_0x5267('0x7')]=_0x5267('0x8');this['account']=this[_0x5267('0x9')](_0x4bd042,_0x10f92c);this[_0x5267('0xa')]=new Imap(this['account']);this[_0x5267('0xa')]['once'](_0x5267('0xb'),this[_0x5267('0xc')][_0x5267('0xd')](this));this['imap'][_0x5267('0xe')]('end',this[_0x5267('0xf')]['bind'](this));this[_0x5267('0xa')]['on'](_0x5267('0x10'),this[_0x5267('0x11')][_0x5267('0xd')](this));this[_0x5267('0xa')][_0x5267('0x12')]();}util[_0x5267('0x13')](EmailImap,EventEmitter);EmailImap[_0x5267('0x14')][_0x5267('0x9')]=function(_0x1e2d3b,_0x16e5a7){var _0x29349a={'connTimeout':_0x1e2d3b[_0x5267('0x15')]?_0x1e2d3b['connTimeout']*0x3e8:0x2710,'authTimeout':_0x1e2d3b['authTimeout']?_0x1e2d3b[_0x5267('0x16')]*0x3e8:0x1388};if(_[_0x5267('0x17')](_0x1e2d3b[_0x5267('0x18')])){if(_0x1e2d3b[_0x5267('0x19')]){_0x29349a[_0x5267('0x1a')]=_0x1e2d3b[_0x5267('0x1a')];_0x29349a[_0x5267('0x1b')]=_0x1e2d3b[_0x5267('0x1b')];}_0x29349a[_0x5267('0x1c')]=_0x1e2d3b[_0x5267('0x1c')];_0x29349a[_0x5267('0x1d')]=_0x1e2d3b[_0x5267('0x1d')]||0x3e1;if(_0x1e2d3b['tls']){_0x29349a[_0x5267('0x1e')]=!![];}else{_0x29349a[_0x5267('0x1e')]=![];_0x29349a['autotls']=_0x5267('0x1f');}}else{if(_0x1e2d3b['modernAuthentication']){_0x29349a[_0x5267('0x20')]=utils[_0x5267('0x21')](_0x1e2d3b[_0x5267('0x22')][_0x5267('0x23')],_0x1e2d3b[_0x5267('0x1a')]);_0x29349a['user']=_0x1e2d3b[_0x5267('0x1a')];}else{_0x29349a['user']=_0x1e2d3b[_0x5267('0x1a')];_0x29349a[_0x5267('0x1b')]=_0x1e2d3b[_0x5267('0x1b')];}_0x29349a['host']=utils['getHost'](_0x1e2d3b['service']);_0x29349a['port']=0x3e1;_0x29349a['tls']=!![];}_0x29349a[_0x5267('0x6')]=_0x16e5a7||_0x1e2d3b[_0x5267('0x1a')]||_0x5267('0x24');return _0x29349a;};EmailImap[_0x5267('0x14')][_0x5267('0xc')]=function(){this[_0x5267('0xa')][_0x5267('0x25')](this[_0x5267('0x7')],![],this[_0x5267('0x26')]['bind'](this));};EmailImap['prototype'][_0x5267('0x26')]=function(_0x472938,_0x5abf95){if(_0x472938){this[_0x5267('0x11')](_0x472938,!![]);}else{this['emit']('box',_0x5abf95);this[_0x5267('0x27')]();}};EmailImap[_0x5267('0x14')][_0x5267('0x28')]=function(_0x2d2ace){if(_0x2d2ace){this[_0x5267('0x11')](_0x2d2ace,!![]);}else{this['imap']['end']();}};EmailImap[_0x5267('0x14')][_0x5267('0x27')]=function(){this[_0x5267('0xa')]['search'](['UNSEEN'],this[_0x5267('0x29')][_0x5267('0xd')](this));};EmailImap[_0x5267('0x14')]['handleReadUnseen']=function(_0x59b091,_0x2249a1){if(_0x59b091){this[_0x5267('0x11')](_0x59b091,!![]);}else{if(_0x2249a1[_0x5267('0x2a')]){try{var _0x189ed7=this['imap'][_0x5267('0x2b')](_0x2249a1,{'bodies':'','markSeen':!![]});_0x189ed7['on'](_0x5267('0x2c'),this[_0x5267('0x2d')][_0x5267('0xd')](this));_0x189ed7[_0x5267('0xe')](_0x5267('0x10'),this[_0x5267('0x2e')][_0x5267('0xd')](this));_0x189ed7['once']('end',this[_0x5267('0x2f')]['bind'](this));}catch(_0x38c0b8){logger[_0x5267('0x10')](_0x38c0b8);}}else{this[_0x5267('0xa')][_0x5267('0x30')](!![],this['handleCloseBox'][_0x5267('0xd')](this));}}};EmailImap[_0x5267('0x14')][_0x5267('0x2d')]=function(_0x1b79a3){_0x1b79a3['on'](_0x5267('0x31'),this[_0x5267('0x32')][_0x5267('0xd')](this));_0x1b79a3[_0x5267('0xe')]('attributes',this[_0x5267('0x33')]['bind'](this));_0x1b79a3[_0x5267('0xe')](_0x5267('0x34'),this[_0x5267('0x35')][_0x5267('0xd')](this));};EmailImap[_0x5267('0x14')][_0x5267('0x32')]=function(_0x465ad9){simpleParser(_0x465ad9,{'Iconv':Iconv},this['handleSimpleParser'][_0x5267('0xd')](this));};EmailImap[_0x5267('0x14')][_0x5267('0x33')]=function(){};EmailImap[_0x5267('0x14')][_0x5267('0x35')]=function(){};EmailImap[_0x5267('0x14')][_0x5267('0x36')]=function(_0x487dfc,_0x2dc5cc){if(_0x487dfc){logger['error'](_0x487dfc);}else{var _0x3db34d=this;utils['parser'](this['account'],_0x2dc5cc,function(_0x51bddd){_0x3db34d[_0x5267('0x37')]('email',_0x51bddd);});}};EmailImap[_0x5267('0x14')][_0x5267('0x2f')]=function(){this[_0x5267('0xa')][_0x5267('0x30')](!![],this['handleCloseBox'][_0x5267('0xd')](this));};EmailImap[_0x5267('0x14')]['handleFetchError']=function(_0x54a5e5){this[_0x5267('0x11')](_0x54a5e5);this['imap'][_0x5267('0x30')](!![],this[_0x5267('0x28')][_0x5267('0xd')](this));};EmailImap[_0x5267('0x14')][_0x5267('0xf')]=function(){this[_0x5267('0x37')](_0x5267('0x34'));};EmailImap['prototype']['handleError']=function(_0x28ea4a,_0x56e627){logger[_0x5267('0x10')](_0x5267('0x11'),this['account'][_0x5267('0x6')],JSON[_0x5267('0x38')](_0x28ea4a));var _0x299a13='';if(_0x28ea4a){if(_0x28ea4a[_0x5267('0x39')]){_0x299a13=_0x28ea4a[_0x5267('0x39')];}else{for(var _0x38a75c in _0x28ea4a){if(_0x28ea4a[_0x5267('0x3a')](_0x38a75c)){_0x299a13+=_[_0x5267('0x3b')](_0x38a75c)+':\x20'+_0x28ea4a[_0x38a75c]+'\x0a';}}}}if(_0x56e627){this[_0x5267('0xa')]['end']();}else{this[_0x5267('0x37')](_0x5267('0x10'),_0x299a13);this[_0x5267('0x37')](_0x5267('0x34'));}};module[_0x5267('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 49f73fa..b2d8f0b 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 _0x005e=['send','createTransport','use','sendMail','toString','Not\x20verified','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x3dd43e,_0x4e8959){var _0x146fcd=function(_0x3df74c){while(--_0x3df74c){_0x3dd43e['push'](_0x3dd43e['shift']());}};_0x146fcd(++_0x4e8959);}(_0x005e,0x6a));var _0xe005=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x005e[_0x456fb1];return _0x4083d6;};'use strict';var nodemailer=require(_0xe005('0x0'));var inlineBase64=require(_0xe005('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xe005('0x2')]=function(_0x18a2dc,_0x3ec441){return new Promise(function(_0x326a07,_0x598b5a){var _0x5b268a=nodemailer[_0xe005('0x3')](_0x18a2dc);_0x5b268a[_0xe005('0x4')]('compile',inlineBase64());_0x5b268a[_0xe005('0x5')](_0x3ec441,function(_0x1424e1,_0x572f26){if(_0x1424e1)return _0x598b5a(_0x1424e1[_0xe005('0x6')]());return _0x326a07(_0x572f26);});});};EmailSmtp['prototype']['verify']=function(_0x6b798a){return new Promise(function(_0x5d98aa,_0x5a5f62){var _0x1ba7c5=nodemailer[_0xe005('0x3')](_0x6b798a);_0x1ba7c5['verify'](function(_0x1be568,_0x150534){if(_0x1be568)return _0x5a5f62(_0x1be568[_0xe005('0x6')]());if(!_0x150534)return _0x5a5f62(_0xe005('0x7'));return _0x5d98aa(_0x150534);});});};module[_0xe005('0x8')]=EmailSmtp; \ No newline at end of file +var _0x71b5=['compile','sendMail','toString','verify','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x124f91,_0x1cb298){var _0x383655=function(_0x4806e8){while(--_0x4806e8){_0x124f91['push'](_0x124f91['shift']());}};_0x383655(++_0x1cb298);}(_0x71b5,0x1a3));var _0x571b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71b5[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x571b('0x0'));function EmailSmtp(){}EmailSmtp[_0x571b('0x1')][_0x571b('0x2')]=function(_0x1a1971,_0x56c221){return new Promise(function(_0x8e9e5f,_0x2a8396){var _0x16f81e=nodemailer[_0x571b('0x3')](_0x1a1971);_0x16f81e['use'](_0x571b('0x4'),inlineBase64());_0x16f81e[_0x571b('0x5')](_0x56c221,function(_0x299e9d,_0xd788bf){if(_0x299e9d)return _0x2a8396(_0x299e9d[_0x571b('0x6')]());return _0x8e9e5f(_0xd788bf);});});};EmailSmtp[_0x571b('0x1')][_0x571b('0x7')]=function(_0x770262){return new Promise(function(_0x48ffe2,_0x432e99){var _0x420c2b=nodemailer[_0x571b('0x3')](_0x770262);_0x420c2b['verify'](function(_0xe73234,_0x57713f){if(_0xe73234)return _0x432e99(_0xe73234['toString']());if(!_0x57713f)return _0x432e99('Not\x20verified');return _0x48ffe2(_0x57713f);});});};module[_0x571b('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e95baea..a987aaf 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 _0xf616=['Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','length','slice','join','split','pop','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

'];(function(_0xe7ad6,_0x25391c){var _0x5af158=function(_0x3faa68){while(--_0x3faa68){_0xe7ad6['push'](_0xe7ad6['shift']());}};_0x5af158(++_0x25391c);}(_0xf616,0x176));var _0x6f61=function(_0x18ec5c,_0x258212){_0x18ec5c=_0x18ec5c-0x0;var _0x5569e3=_0xf616[_0x18ec5c];return _0x5569e3;};'use strict';var _=require('lodash');var moment=require(_0x6f61('0x0'));var random=require(_0x6f61('0x1'));var fs=require('fs');var path=require(_0x6f61('0x2'));var util=require(_0x6f61('0x3'));var tnef=require(_0x6f61('0x4'));var logger=require(_0x6f61('0x5'))(_0x6f61('0x6'));var config=require(_0x6f61('0x7'));function getAddress(_0x44292e){var _0x63ef8b=_['head'](_0x44292e[_0x6f61('0x8')]);return _0x63ef8b&&_0x63ef8b[_0x6f61('0x9')]?_0x63ef8b['address']:_0x6f61('0xa')+random[_0x6f61('0xb')](0x6)+_0x6f61('0xc');}function getFirstName(_0x242ef6){var _0x527fb6=_['head'](_0x242ef6[_0x6f61('0x8')]);if(_0x527fb6&&_0x527fb6['name']){if(_0x527fb6[_0x6f61('0xd')]==_0x527fb6[_0x6f61('0x9')]){return _0x527fb6[_0x6f61('0xd')][_0x6f61('0xe')](0x0,_0x527fb6['name'][_0x6f61('0xf')]('@'));}var _0x1ea4ff=_0x527fb6[_0x6f61('0xd')]['split'](/\s+/);return _0x1ea4ff[_0x6f61('0x10')]>0x1?_0x1ea4ff[_0x6f61('0x11')](0x0,-0x1)[_0x6f61('0x12')]('\x20'):_0x527fb6['name'];}return'Anonymous';}function getLastName(_0x1cc692){var _0x1f9737=_['head'](_0x1cc692[_0x6f61('0x8')]);if(_0x1f9737&&_0x1f9737[_0x6f61('0xd')]){var _0x3b8b5d=_0x1f9737[_0x6f61('0xd')][_0x6f61('0x13')](/\s+/);return _0x3b8b5d[_0x6f61('0x10')]>0x1?_0x3b8b5d[_0x6f61('0x14')]():'';}return'';}function getMails(_0x4165d0,_0x2063df){var _0x5f2bc4='';for(var _0x1ae315=0x0;_0x1ae315<_0x2063df[_0x6f61('0x8')]['length'];_0x1ae315+=0x1){if(_0x2063df[_0x6f61('0x8')][_0x1ae315][_0x6f61('0x9')]!==_0x4165d0){if(!_['isEmpty'](_0x5f2bc4)){_0x5f2bc4+=',';}_0x5f2bc4+=_0x2063df['value'][_0x1ae315][_0x6f61('0xd')]||_0x2063df[_0x6f61('0x8')][_0x1ae315][_0x6f61('0x9')]||'';_0x5f2bc4+='\x20<';_0x5f2bc4+=_0x2063df['value'][_0x1ae315][_0x6f61('0x9')]?_0x2063df[_0x6f61('0x8')][_0x1ae315][_0x6f61('0x9')]:_0x6f61('0xa')+random['generate'](0x6)+_0x6f61('0xc');_0x5f2bc4+='>';}}return _0x5f2bc4;}function parseEmail(_0x213c86,_0x474f3c,_0x2f57af){if(_0x474f3c[_0x6f61('0x15')]){var _0x3d9421=/)<[^<]*)*<\/script>/gi;while(_0x3d9421[_0x6f61('0x16')](_0x474f3c[_0x6f61('0x15')])){_0x474f3c[_0x6f61('0x15')]=_0x474f3c[_0x6f61('0x15')][_0x6f61('0x17')](_0x3d9421,'');}if(_0x474f3c[_0x6f61('0x15')]['includes'](_0x6f61('0x18'))){var _0x401d4b=[];_0x474f3c[_0x6f61('0x19')][_0x6f61('0x1a')](_0xc93b32=>{_0x401d4b['push'](_0xc93b32[_0x6f61('0x1b')]);});var _0x4ad220=/]+>/g;var _0x238b7e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x18cae9=_0x474f3c[_0x6f61('0x15')]['replace'](_0x238b7e,_0x6f61('0x1c'));var _0xae5122=_0x18cae9['replace'](_0x4ad220,_0x6f61('0x1d'));for(let _0x2461bc=0x0;_0x2461bc<_0x401d4b['length'];_0x2461bc++){var _0x4cf8c7=_0xae5122['replace'](_0x6f61('0x1d'),_0x6f61('0x1e')+_0x401d4b[_0x2461bc]+_0x6f61('0x1f'));_0xae5122=_0x4cf8c7;}_0x474f3c[_0x6f61('0x15')]=_0xae5122;}_0x2f57af[_0x6f61('0x20')]=_0x474f3c[_0x6f61('0x15')];}else{_0x2f57af[_0x6f61('0x20')]=_0x474f3c[_0x6f61('0x21')];}if(_0x2f57af[_0x6f61('0x20')]){_0x2f57af['body']=_0x2f57af[_0x6f61('0x20')][_0x6f61('0x17')](/0x0){var _0x37bdd4=[_0x6f61('0x37'),_0x6f61('0x38'),'Precedence:\x20auto_reply'];for(var _0x3989d8=0x0;_0x3989d8<_0x474f3c['headerLines']['length'];_0x3989d8++){var _0x21ef0c=_[_0x6f61('0xf')](_0x37bdd4,_0x474f3c[_0x6f61('0x36')][_0x3989d8]['line']);if(_0x21ef0c>=0x0){_0x2f57af['isAutoreply']=!![];}}}return _0x2f57af;}exports[_0x6f61('0x39')]=function(_0x1ab7b5,_0x48afdd,_0x329024){var _0x5ed248={'from':getAddress(_0x48afdd[_0x6f61('0x3a')]),'firstName':getFirstName(_0x48afdd[_0x6f61('0x3a')]),'lastName':getLastName(_0x48afdd[_0x6f61('0x3a')]),'mapKey':'email','message':{'from':getMails(_0x1ab7b5[_0x6f61('0x6')],_0x48afdd[_0x6f61('0x3a')]),'to':_0x1ab7b5[_0x6f61('0x6')],'cc':'','subject':_0x48afdd[_0x6f61('0x3b')]||'','messageId':_0x48afdd[_0x6f61('0x3c')],'inReplyTo':_0x48afdd[_0x6f61('0x3d')],'sentAt':moment(_0x48afdd[_0x6f61('0x3e')])[_0x6f61('0x2d')](_0x6f61('0x3f')),'attach':![],'attachments':[]}};if(!_0x48afdd['html']&&!_0x48afdd[_0x6f61('0x21')]){var _0x3b9fd2=_[_0x6f61('0x40')](_0x48afdd[_0x6f61('0x19')],{'contentType':_0x6f61('0x41')});if(_0x3b9fd2[_0x6f61('0x10')]){logger[_0x6f61('0x42')](util[_0x6f61('0x2d')](_0x6f61('0x43'),_0x48afdd[_0x6f61('0x3c')]));tnef[_0x6f61('0x44')](_[_0x6f61('0x45')](_0x3b9fd2)['content'],function(_0x567017,_0x38d3d1){if(_0x38d3d1){_0x48afdd[_0x6f61('0x15')]=_0x38d3d1['BodyHTML']||_0x6f61('0x46');if(_0x38d3d1[_0x6f61('0x47')]){for(var _0x12e91c=0x0;_0x12e91c<_0x38d3d1['Attachments'][_0x6f61('0x10')];_0x12e91c++){var _0x597c3f=_0x38d3d1['Attachments'][_0x12e91c];_0x5ed248[_0x6f61('0x25')][_0x6f61('0x19')][_0x6f61('0x34')]({'filename':_0x597c3f[_0x6f61('0x48')],'content':Buffer[_0x6f61('0x3a')](_0x597c3f[_0x6f61('0x49')])});}}}_0x329024(parseEmail(_0x1ab7b5,_0x48afdd,_0x5ed248));});}else{_0x48afdd[_0x6f61('0x15')]=_0x6f61('0x46');_0x329024(parseEmail(_0x1ab7b5,_0x48afdd,_0x5ed248));}}else{_0x329024(parseEmail(_0x1ab7b5,_0x48afdd,_0x5ed248));}};exports[_0x6f61('0x4a')]=function(_0x485268){switch(_0x485268){case _0x6f61('0x4b'):return _0x6f61('0x4c');case _0x6f61('0x4d'):return _0x6f61('0x4e');case _0x6f61('0x4f'):return'imap-mail.outlook.com';case _0x6f61('0x50'):return _0x6f61('0x51');}return _0x6f61('0x52');};exports[_0x6f61('0x53')]=function(_0x22f5fd,_0x4276bc){var _0xc5da30=[_0x6f61('0x54')+(_0x4276bc||''),_0x6f61('0x55')+_0x22f5fd,'',''];return Buffer[_0x6f61('0x3a')](_0xc5da30[_0x6f61('0x12')](''),_0x6f61('0x56'))[_0x6f61('0x57')](_0x6f61('0x58'));}; \ No newline at end of file +var _0x3701=['isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Data','getHost','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','toString','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','anonymous','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','email','isEmpty','message','originCc','originTo','bcc','type','attachment','attachment-','format','%s-%s','now','join','root','writeFileSync','content','contentType','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','headerLines','line'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3701,0x1b1));var _0x1370=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3701[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x1370('0x0'));var random=require(_0x1370('0x1'));var fs=require('fs');var path=require(_0x1370('0x2'));var util=require(_0x1370('0x3'));var tnef=require(_0x1370('0x4'));var logger=require(_0x1370('0x5'))('email');var config=require(_0x1370('0x6'));function getAddress(_0x4ed43a){var _0x4b1986=_[_0x1370('0x7')](_0x4ed43a[_0x1370('0x8')]);return _0x4b1986&&_0x4b1986['address']?_0x4b1986[_0x1370('0x9')]:'anonymous'+random[_0x1370('0xa')](0x6)+_0x1370('0xb');}function getFirstName(_0xe6eeea){var _0x151a11=_[_0x1370('0x7')](_0xe6eeea[_0x1370('0x8')]);if(_0x151a11&&_0x151a11[_0x1370('0xc')]){if(_0x151a11['name']==_0x151a11[_0x1370('0x9')]){return _0x151a11[_0x1370('0xc')][_0x1370('0xd')](0x0,_0x151a11['name'][_0x1370('0xe')]('@'));}var _0x58fb10=_0x151a11['name'][_0x1370('0xf')](/\s+/);return _0x58fb10[_0x1370('0x10')]>0x1?_0x58fb10[_0x1370('0x11')](0x0,-0x1)['join']('\x20'):_0x151a11[_0x1370('0xc')];}return'Anonymous';}function getLastName(_0x1322fe){var _0x39aab5=_[_0x1370('0x7')](_0x1322fe[_0x1370('0x8')]);if(_0x39aab5&&_0x39aab5[_0x1370('0xc')]){var _0x52fa00=_0x39aab5[_0x1370('0xc')][_0x1370('0xf')](/\s+/);return _0x52fa00[_0x1370('0x10')]>0x1?_0x52fa00['pop']():'';}return'';}function getMails(_0x191c2f,_0x550fb2){var _0x196238='';for(var _0x534246=0x0;_0x534246<_0x550fb2[_0x1370('0x8')]['length'];_0x534246+=0x1){if(_0x550fb2['value'][_0x534246][_0x1370('0x9')]!==_0x191c2f){if(!_['isEmpty'](_0x196238)){_0x196238+=',';}_0x196238+=_0x550fb2[_0x1370('0x8')][_0x534246][_0x1370('0xc')]||_0x550fb2[_0x1370('0x8')][_0x534246]['address']||'';_0x196238+='\x20<';_0x196238+=_0x550fb2[_0x1370('0x8')][_0x534246][_0x1370('0x9')]?_0x550fb2['value'][_0x534246]['address']:_0x1370('0x12')+random[_0x1370('0xa')](0x6)+_0x1370('0xb');_0x196238+='>';}}return _0x196238;}function parseEmail(_0x31a435,_0x22c8a2,_0x4f2961){if(_0x22c8a2['html']){var _0x54d8fc=/)<[^<]*)*<\/script>/gi;while(_0x54d8fc[_0x1370('0x13')](_0x22c8a2[_0x1370('0x14')])){_0x22c8a2[_0x1370('0x14')]=_0x22c8a2[_0x1370('0x14')][_0x1370('0x15')](_0x54d8fc,'');}if(_0x22c8a2[_0x1370('0x14')][_0x1370('0x16')](_0x1370('0x17'))){var _0x427441=[];_0x22c8a2[_0x1370('0x18')][_0x1370('0x19')](_0x173815=>{_0x427441[_0x1370('0x1a')](_0x173815[_0x1370('0x1b')]);});var _0x1e0f02=/]+>/g;var _0x34bff7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x379f2e=_0x22c8a2[_0x1370('0x14')][_0x1370('0x15')](_0x34bff7,'_SRC');var _0xa49590=_0x379f2e[_0x1370('0x15')](_0x1e0f02,'_IMG');for(let _0x2963ee=0x0;_0x2963ee<_0x427441[_0x1370('0x10')];_0x2963ee++){var _0x494749=_0xa49590['replace']('_IMG',_0x1370('0x1c')+_0x427441[_0x2963ee]+_0x1370('0x1d'));_0xa49590=_0x494749;}_0x22c8a2['html']=_0xa49590;}_0x4f2961[_0x1370('0x1e')]=_0x22c8a2[_0x1370('0x14')];}else{_0x4f2961[_0x1370('0x1e')]=_0x22c8a2[_0x1370('0x1f')];}if(_0x4f2961['body']){_0x4f2961[_0x1370('0x1e')]=_0x4f2961[_0x1370('0x1e')][_0x1370('0x15')](/0x0){var _0x62036f=[_0x1370('0x31'),_0x1370('0x32'),'Precedence:\x20auto_reply'];for(var _0x5972cf=0x0;_0x5972cf<_0x22c8a2[_0x1370('0x33')][_0x1370('0x10')];_0x5972cf++){var _0x3c3142=_[_0x1370('0xe')](_0x62036f,_0x22c8a2[_0x1370('0x33')][_0x5972cf][_0x1370('0x34')]);if(_0x3c3142>=0x0){_0x4f2961[_0x1370('0x35')]=!![];}}}return _0x4f2961;}exports[_0x1370('0x36')]=function(_0x323d4c,_0x205794,_0x27a018){var _0x57ff12={'from':getAddress(_0x205794[_0x1370('0x37')]),'firstName':getFirstName(_0x205794[_0x1370('0x37')]),'lastName':getLastName(_0x205794['from']),'mapKey':'email','message':{'from':getMails(_0x323d4c['email'],_0x205794[_0x1370('0x37')]),'to':_0x323d4c[_0x1370('0x20')],'cc':'','subject':_0x205794[_0x1370('0x38')]||'','messageId':_0x205794[_0x1370('0x39')],'inReplyTo':_0x205794[_0x1370('0x3a')],'sentAt':moment(_0x205794[_0x1370('0x3b')])['format'](_0x1370('0x3c')),'attach':![],'attachments':[]}};if(!_0x205794[_0x1370('0x14')]&&!_0x205794[_0x1370('0x1f')]){var _0x44711e=_['filter'](_0x205794[_0x1370('0x18')],{'contentType':_0x1370('0x3d')});if(_0x44711e[_0x1370('0x10')]){logger[_0x1370('0x3e')](util[_0x1370('0x29')](_0x1370('0x3f'),_0x205794[_0x1370('0x39')]));tnef[_0x1370('0x40')](_['first'](_0x44711e)['content'],function(_0x20e500,_0x3763cc){if(_0x3763cc){_0x205794[_0x1370('0x14')]=_0x3763cc[_0x1370('0x41')]||_0x1370('0x42');if(_0x3763cc[_0x1370('0x43')]){for(var _0x9fa060=0x0;_0x9fa060<_0x3763cc[_0x1370('0x43')]['length'];_0x9fa060++){var _0x3f82f6=_0x3763cc[_0x1370('0x43')][_0x9fa060];_0x57ff12['message'][_0x1370('0x18')][_0x1370('0x1a')]({'filename':_0x3f82f6['Title'],'content':Buffer[_0x1370('0x37')](_0x3f82f6[_0x1370('0x44')])});}}}_0x27a018(parseEmail(_0x323d4c,_0x205794,_0x57ff12));});}else{_0x205794[_0x1370('0x14')]=_0x1370('0x42');_0x27a018(parseEmail(_0x323d4c,_0x205794,_0x57ff12));}}else{_0x27a018(parseEmail(_0x323d4c,_0x205794,_0x57ff12));}};exports[_0x1370('0x45')]=function(_0x73d3dc){switch(_0x73d3dc){case _0x1370('0x46'):return'imap.gmail.com';case _0x1370('0x47'):return'imap.mail.yahoo.com';case _0x1370('0x48'):return _0x1370('0x49');case _0x1370('0x4a'):return _0x1370('0x4b');}return _0x1370('0x4c');};exports[_0x1370('0x4d')]=function(_0x1da7b6,_0x74394){var _0x4eddc2=[_0x1370('0x4e')+(_0x74394||''),_0x1370('0x4f')+_0x1da7b6,'',''];return Buffer['from'](_0x4eddc2['join'](''),'utf-8')[_0x1370('0x50')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index adbcf21..7ad3759 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 _0x404a=['active','Imap','Smtp','lodash','name','Service','key'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x404a,0x1a0));var _0xa404=function(_0x33c920,_0x239187){_0x33c920=_0x33c920-0x0;var _0x3445e3=_0x404a[_0x33c920];return _0x3445e3;};'use strict';var _=require(_0xa404('0x0'));function MailAccount(_0x8339b9){this['id']=_0x8339b9['id']||0x0;this[_0xa404('0x1')]=_0x8339b9['name']||_0xa404('0x2');this[_0xa404('0x3')]=_0x8339b9[_0xa404('0x3')]||'SERV';this['active']=_0x8339b9[_0xa404('0x4')]||![];this[_0xa404('0x5')]=_0x8339b9[_0xa404('0x5')]||[];this[_0xa404('0x6')]=_0x8339b9['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xbcc2=['exports','name','key','active','Imap','Smtp'];(function(_0x287007,_0x14b144){var _0x37e46a=function(_0x13e224){while(--_0x13e224){_0x287007['push'](_0x287007['shift']());}};_0x37e46a(++_0x14b144);}(_0xbcc2,0x1c3));var _0x2bcc=function(_0x432d50,_0x4161af){_0x432d50=_0x432d50-0x0;var _0x115ad1=_0xbcc2[_0x432d50];return _0x115ad1;};'use strict';var _=require('lodash');function MailAccount(_0x1e71ea){this['id']=_0x1e71ea['id']||0x0;this[_0x2bcc('0x0')]=_0x1e71ea['name']||'Service';this[_0x2bcc('0x1')]=_0x1e71ea[_0x2bcc('0x1')]||'SERV';this['active']=_0x1e71ea[_0x2bcc('0x2')]||![];this[_0x2bcc('0x3')]=_0x1e71ea['Imap']||[];this[_0x2bcc('0x4')]=_0x1e71ea['Smtp']||[];}module[_0x2bcc('0x5')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2d203ba..13089bd 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 _0xb722=['lodash','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','length','exports'];(function(_0x3306bf,_0x46f5d7){var _0x999469=function(_0x7de932){while(--_0x7de932){_0x3306bf['push'](_0x3306bf['shift']());}};_0x999469(++_0x46f5d7);}(_0xb722,0xf5));var _0x2b72=function(_0x4e1d35,_0x31d878){_0x4e1d35=_0x4e1d35-0x0;var _0x2c1ead=_0xb722[_0x4e1d35];return _0x2c1ead;};'use strict';var _=require(_0x2b72('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x2b72('0x1')]={};};function freeIsNotKey(_0x10f1d2,_0x330f5e,_0x548c71){var _0x4d0b9e=_['mapKeys'](_0x10f1d2,function(_0x5e5c19,_0x36c952){return _0x5e5c19[_0x548c71];});for(var _0x53bc07 in _0x330f5e){if(_0x330f5e[_0x2b72('0x2')](_0x53bc07)){if(!_0x4d0b9e[_0x53bc07]){delete _0x330f5e[_0x53bc07];}}}}Realtime[_0x2b72('0x3')][_0x2b72('0x4')]=function(_0x135703,_0x38fdd0){for(var _0x392bd6 in _0x38fdd0){if(_0x135703['hasOwnProperty'](_0x392bd6)){_0x135703[_0x392bd6]=_0x38fdd0[_0x392bd6];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x5d518d=this;return function(_0x84a5d8){if(_0x84a5d8){freeIsNotKey(_0x84a5d8,_0x5d518d[_0x2b72('0x1')],'id');for(var _0x14e0a4=0x0,_0x2f2fc8={},_0x4bffa2={};_0x14e0a4<_0x84a5d8[_0x2b72('0x5')];_0x14e0a4+=0x1){_0x2f2fc8=_0x84a5d8[_0x14e0a4];if(_['isUndefined'](_0x5d518d[_0x2b72('0x1')][_0x2f2fc8['id']])){_0x5d518d[_0x2b72('0x1')][_0x2f2fc8['id']]=new MailAccount(_0x2f2fc8);}else{_['merge'](_0x5d518d[_0x2b72('0x1')][_0x2f2fc8['id']],_0x2f2fc8);}}}return _0x5d518d['mailAccounts'];};};module[_0x2b72('0x6')]=Realtime; \ No newline at end of file +var _0x612c=['initMailAccounts','mailAccounts','length','exports','../model/mailAccount','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x705bb2,_0x116850){var _0x5b7461=function(_0x51c9f5){while(--_0x51c9f5){_0x705bb2['push'](_0x705bb2['shift']());}};_0x5b7461(++_0x116850);}(_0x612c,0x16c));var _0xc612=function(_0x4f945d,_0x4a592b){_0x4f945d=_0x4f945d-0x0;var _0x323ae6=_0x612c[_0x4f945d];return _0x323ae6;};'use strict';var _=require('lodash');var MailAccount=require(_0xc612('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1a8f48,_0x4707a1,_0x5b1396){var _0x556a58=_['mapKeys'](_0x1a8f48,function(_0x18946b,_0x371cef){return _0x18946b[_0x5b1396];});for(var _0x47ff71 in _0x4707a1){if(_0x4707a1[_0xc612('0x1')](_0x47ff71)){if(!_0x556a58[_0x47ff71]){delete _0x4707a1[_0x47ff71];}}}}Realtime[_0xc612('0x2')][_0xc612('0x3')]=function(_0x3df225,_0x1fb7fb){for(var _0x5a59a5 in _0x1fb7fb){if(_0x3df225[_0xc612('0x1')](_0x5a59a5)){_0x3df225[_0x5a59a5]=_0x1fb7fb[_0x5a59a5];}}};Realtime[_0xc612('0x2')][_0xc612('0x4')]=function(){var _0x5d49d4=this;return function(_0x176ced){if(_0x176ced){freeIsNotKey(_0x176ced,_0x5d49d4[_0xc612('0x5')],'id');for(var _0x394ebf=0x0,_0x4d7012={},_0x2ba4cf={};_0x394ebf<_0x176ced[_0xc612('0x6')];_0x394ebf+=0x1){_0x4d7012=_0x176ced[_0x394ebf];if(_['isUndefined'](_0x5d49d4[_0xc612('0x5')][_0x4d7012['id']])){_0x5d49d4['mailAccounts'][_0x4d7012['id']]=new MailAccount(_0x4d7012);}else{_['merge'](_0x5d49d4[_0xc612('0x5')][_0x4d7012['id']],_0x4d7012);}}}return _0x5d49d4[_0xc612('0x5')];};};module[_0xc612('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 77620f5..3622371 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 _0xb3a9=['email','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','data5','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xb3a9,0xa2));var _0x9b3a=function(_0xc8813d,_0x2cf24e){_0xc8813d=_0xc8813d-0x0;var _0x450d39=_0xb3a9[_0xc8813d];return _0x450d39;};'use strict';var client=require(_0x9b3a('0x0'));exports[_0x9b3a('0x1')]=function(){return function(){return client[_0x9b3a('0x2')](_0x9b3a('0x3'),{'options':{'attributes':['id',_0x9b3a('0x4'),_0x9b3a('0x5'),'service',_0x9b3a('0x6'),_0x9b3a('0x7'),'key',_0x9b3a('0x8'),_0x9b3a('0x9')],'raw':![],'include':[{'model':_0x9b3a('0xa'),'as':_0x9b3a('0xb'),'include':[{'model':_0x9b3a('0xc'),'attributes':['id',_0x9b3a('0x4'),_0x9b3a('0xd'),'type',_0x9b3a('0xe')],'as':'CloudProvider'}]},{'model':_0x9b3a('0xf'),'as':_0x9b3a('0x10'),'include':[{'model':'CloudProvider','attributes':['id',_0x9b3a('0x4'),_0x9b3a('0xd'),_0x9b3a('0x11'),_0x9b3a('0xe')],'as':_0x9b3a('0xc')}]}]},'log':_0x9b3a('0x12')});};};exports[_0x9b3a('0x13')]=function(_0x47d779,_0x53c6f7){return client[_0x9b3a('0x2')](_0x9b3a('0x14'),{'account':{'id':_0x47d779},'body':_0x53c6f7,'log':_0x9b3a('0x14')});}; \ No newline at end of file +var _0xc9c3=['Request','name','provider','service','email','active','key','ListId','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','NotifyMailAccount'];(function(_0xec6167,_0x867fb9){var _0x1c3359=function(_0x4c4de8){while(--_0x4c4de8){_0xec6167['push'](_0xec6167['shift']());}};_0x1c3359(++_0x867fb9);}(_0xc9c3,0x96));var _0x3c9c=function(_0xe3f767,_0x227b95){_0xe3f767=_0xe3f767-0x0;var _0xb8c13e=_0xc9c3[_0xe3f767];return _0xb8c13e;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x3c9c('0x0')]('GetMailAccount',{'options':{'attributes':['id',_0x3c9c('0x1'),_0x3c9c('0x2'),_0x3c9c('0x3'),_0x3c9c('0x4'),_0x3c9c('0x5'),_0x3c9c('0x6'),_0x3c9c('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x3c9c('0x8'),'attributes':['id',_0x3c9c('0x1'),_0x3c9c('0x3'),_0x3c9c('0x9'),_0x3c9c('0xa')],'as':_0x3c9c('0x8')}]},{'model':_0x3c9c('0xb'),'as':_0x3c9c('0xc'),'include':[{'model':_0x3c9c('0x8'),'attributes':['id',_0x3c9c('0x1'),'service',_0x3c9c('0x9'),_0x3c9c('0xa')],'as':'CloudProvider'}]}]},'log':_0x3c9c('0xd')});};};exports['notify']=function(_0x12f832,_0xff516c){return client[_0x3c9c('0x0')](_0x3c9c('0xe'),{'account':{'id':_0x12f832},'body':_0xff516c,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 9d0c97f..681d590 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 _0x2f2e=['Request','loginMailFrequency','../client','getSettings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f2e,0xc6));var _0xe2f2=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x2f2e[_0x32729c];return _0x482cfd;};'use strict';var client=require(_0xe2f2('0x0'));exports[_0xe2f2('0x1')]=function(){return client[_0xe2f2('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe2f2('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x0a24=['loginMailFrequency','GetSettings','getSettings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a24,0x17f));var _0x40a2=function(_0x58e32c,_0x309781){_0x58e32c=_0x58e32c-0x0;var _0x481e60=_0x0a24[_0x58e32c];return _0x481e60;};'use strict';var client=require('../client');exports[_0x40a2('0x0')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x40a2('0x1')]},'log':_0x40a2('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c8d2705..cfc3e78 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 39fce85..a03eb0e 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 _0x5e5d=['listen','port','socket.io','websocket','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','http','express','ioredis','../../config/environment','createServer'];(function(_0x27bd57,_0x40c4d5){var _0x35e9c6=function(_0x49568e){while(--_0x49568e){_0x27bd57['push'](_0x27bd57['shift']());}};_0x35e9c6(++_0x40c4d5);}(_0x5e5d,0x187));var _0xd5e5=function(_0x43b6f1,_0x534062){_0x43b6f1=_0x43b6f1-0x0;var _0x20d865=_0x5e5d[_0x43b6f1];return _0x20d865;};'use strict';var _=require('lodash');var http=require(_0xd5e5('0x0'));var express=require(_0xd5e5('0x1'));var sticky=require('sticky-session');var Redis=require(_0xd5e5('0x2'));var config=require(_0xd5e5('0x3'));var app=express();var server=http[_0xd5e5('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xd5e5('0x5')](server,config[_0xd5e5('0x6')])){var socketio=require(_0xd5e5('0x7'))(server,{'transports':[_0xd5e5('0x8'),'polling']});config[_0xd5e5('0x9')]=_[_0xd5e5('0xa')](config[_0xd5e5('0x9')],{'host':_0xd5e5('0xb'),'port':0x18eb});socketio[_0xd5e5('0xc')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xd5e5('0x9')])}));require(_0xd5e5('0xd'))[_0xd5e5('0xe')]();require(_0xd5e5('0xf'))['default'](socketio);require(_0xd5e5('0x10'))[_0xd5e5('0xe')](app);require(_0xd5e5('0x11'))['default'](app);}else{server[_0xd5e5('0x12')](_0xd5e5('0x13'),function(){console[_0xd5e5('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xd5e5('0x6')]);});}exports=module[_0xd5e5('0x15')]=app; \ No newline at end of file +var _0x998f=['../../config/environment','createServer','timeout','listen','websocket','polling','redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express','sticky-session','ioredis'];(function(_0x143697,_0xfdeee){var _0x41e5a7=function(_0x43a348){while(--_0x43a348){_0x143697['push'](_0x143697['shift']());}};_0x41e5a7(++_0xfdeee);}(_0x998f,0x104));var _0xf998=function(_0x1dd467,_0x4fd5aa){_0x1dd467=_0x1dd467-0x0;var _0x27eb54=_0x998f[_0x1dd467];return _0x27eb54;};'use strict';var _=require('lodash');var http=require(_0xf998('0x0'));var express=require(_0xf998('0x1'));var sticky=require(_0xf998('0x2'));var Redis=require(_0xf998('0x3'));var config=require(_0xf998('0x4'));var app=express();var server=http[_0xf998('0x5')](app);server[_0xf998('0x6')]=0xdbba0;if(sticky[_0xf998('0x7')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0xf998('0x8'),_0xf998('0x9')]});config[_0xf998('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0xf998('0xb')](require(_0xf998('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xf998('0xa')])}));require(_0xf998('0xd'))[_0xf998('0xe')]();require(_0xf998('0xf'))[_0xf998('0xe')](socketio);require(_0xf998('0x10'))[_0xf998('0xe')](app);require(_0xf998('0x11'))[_0xf998('0xe')](app);}else{server[_0xf998('0x12')]('listening',function(){console['log'](_0xf998('0x13'),config[_0xf998('0x14')]);});}exports=module[_0xf998('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 018df4c..06c13a5 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 _0xd3b7=['then','debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','request'];(function(_0x2816dc,_0xa8157b){var _0x3678e9=function(_0x42985c){while(--_0x42985c){_0x2816dc['push'](_0x2816dc['shift']());}};_0x3678e9(++_0xa8157b);}(_0xd3b7,0x69));var _0x7d3b=function(_0x2d3289,_0x2799f0){_0x2d3289=_0x2d3289-0x0;var _0x370584=_0xd3b7[_0x2d3289];return _0x370584;};'use strict';var jayson=require(_0x7d3b('0x0'));var BPromise=require(_0x7d3b('0x1'));var logger=require(_0x7d3b('0x2'))(_0x7d3b('0x3'));var client=jayson[_0x7d3b('0x4')][_0x7d3b('0x5')]({'port':0x2329});client['Request']=function(_0x2e2624,_0x32632b){return new BPromise(function(_0x5408c6,_0x3a2575){return client[_0x7d3b('0x6')](_0x2e2624,_0x32632b)[_0x7d3b('0x7')](function(_0xc9d172){logger[_0x7d3b('0x8')](_0x7d3b('0x9'),_0x7d3b('0x3'),_0x2e2624,_0x32632b,_0xc9d172);if(_0xc9d172[_0x7d3b('0xa')]){logger[_0x7d3b('0xa')](_0x7d3b('0x9'),'routing',_0x2e2624,_0xc9d172['error'][_0x7d3b('0xb')],_0x32632b);return _0x3a2575(_0xc9d172[_0x7d3b('0xa')][_0x7d3b('0xb')]);}else{return _0x5408c6(_0xc9d172[_0x7d3b('0xc')]);}})[_0x7d3b('0xd')](function(_0x26f795){logger[_0x7d3b('0xa')](_0x7d3b('0x9'),_0x7d3b('0x3'),_0x2e2624,_0x26f795,_0x32632b);return _0x3a2575(_0x26f795);});});};module['exports']=client; \ No newline at end of file +var _0xf141=['result','catch','exports','jayson/promise','bluebird','routing','client','http','then','rpc','error','message'];(function(_0x44d874,_0x2257d8){var _0x487e12=function(_0x384710){while(--_0x384710){_0x44d874['push'](_0x44d874['shift']());}};_0x487e12(++_0x2257d8);}(_0xf141,0x123));var _0x1f14=function(_0x3f58d1,_0x17a0c1){_0x3f58d1=_0x3f58d1-0x0;var _0xeac9b5=_0xf141[_0x3f58d1];return _0xeac9b5;};'use strict';var jayson=require(_0x1f14('0x0'));var BPromise=require(_0x1f14('0x1'));var logger=require('../../config/logger')(_0x1f14('0x2'));var client=jayson[_0x1f14('0x3')][_0x1f14('0x4')]({'port':0x2329});client['Request']=function(_0x3d6891,_0x488a76){return new BPromise(function(_0x4ca6f1,_0x4c69c5){return client['request'](_0x3d6891,_0x488a76)[_0x1f14('0x5')](function(_0x4e81f1){logger['debug'](_0x1f14('0x6'),'routing',_0x3d6891,_0x488a76,_0x4e81f1);if(_0x4e81f1['error']){logger[_0x1f14('0x7')](_0x1f14('0x6'),_0x1f14('0x2'),_0x3d6891,_0x4e81f1[_0x1f14('0x7')][_0x1f14('0x8')],_0x488a76);return _0x4c69c5(_0x4e81f1[_0x1f14('0x7')]['message']);}else{return _0x4ca6f1(_0x4e81f1[_0x1f14('0x9')]);}})[_0x1f14('0xa')](function(_0x229994){logger['error'](_0x1f14('0x6'),_0x1f14('0x2'),_0x3d6891,_0x229994,_0x488a76);return _0x4c69c5(_0x229994);});});};module[_0x1f14('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 4d0bf0f..46e17f0 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 _0xe912=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0xe75596,_0x181f3c){var _0x2dc99a=function(_0x44f71d){while(--_0x44f71d){_0xe75596['push'](_0xe75596['shift']());}};_0x2dc99a(++_0x181f3c);}(_0xe912,0x1a9));var _0x2e91=function(_0x23d237,_0x5bf15a){_0x23d237=_0x23d237-0x0;var _0x2dd41d=_0xe912[_0x23d237];return _0x2dd41d;};'use strict';var BPromise=require('bluebird');var server=require(_0x2e91('0x0'));var Realtime=require(_0x2e91('0x1'));var user=require(_0x2e91('0x2'));var interval=require(_0x2e91('0x3'));var openchannelQueue=require(_0x2e91('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x2e91('0x5'));var mailQueue=require(_0x2e91('0x6'));var faxQueue=require(_0x2e91('0x7'));var whatsappQueue=require(_0x2e91('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x2e91('0x9')]()['then'](user[_0x2e91('0xa')]())[_0x2e91('0xb')](realtime[_0x2e91('0xc')]())[_0x2e91('0xb')](interval[_0x2e91('0xd')]())[_0x2e91('0xb')](realtime['initIntervals']())['then'](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x2e91('0xe')]())['then'](chatQueue[_0x2e91('0xf')]())[_0x2e91('0xb')](realtime[_0x2e91('0x10')]())[_0x2e91('0xb')](smsQueue['getSmsQueues']())[_0x2e91('0xb')](realtime[_0x2e91('0x11')]())[_0x2e91('0xb')](mailQueue[_0x2e91('0x12')]())[_0x2e91('0xb')](realtime[_0x2e91('0x13')]())['then'](faxQueue[_0x2e91('0x14')]())[_0x2e91('0xb')](realtime[_0x2e91('0x15')]())['then'](whatsappQueue[_0x2e91('0x16')]())['then'](realtime[_0x2e91('0x17')]())[_0x2e91('0xb')](function(){return realtime;});}function main(){return server[_0x2e91('0x18')](realtime)[_0x2e91('0xb')](function(_0x3eb080){return initRealtime();})[_0x2e91('0xb')](function(_0x41b221){return setInterval(initRealtime,0x1388);})[_0x2e91('0x19')](function(_0xe278c3){console[_0x2e91('0x1a')](_0xe278c3);});}main(); \ No newline at end of file +var _0x0126=['./rpc/smsQueue','./rpc/whatsappQueue','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','then','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x40dad,_0x3dab13){var _0x2c8b1e=function(_0x187669){while(--_0x187669){_0x40dad['push'](_0x40dad['shift']());}};_0x2c8b1e(++_0x3dab13);}(_0x0126,0x127));var _0x6012=function(_0x110185,_0x107643){_0x110185=_0x110185-0x0;var _0x62ca67=_0x0126[_0x110185];return _0x62ca67;};'use strict';var BPromise=require('bluebird');var server=require(_0x6012('0x0'));var Realtime=require('./realtime');var user=require(_0x6012('0x1'));var interval=require(_0x6012('0x2'));var openchannelQueue=require(_0x6012('0x3'));var chatQueue=require(_0x6012('0x4'));var smsQueue=require(_0x6012('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x6012('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0x6012('0x7')]())['then'](realtime[_0x6012('0x8')]())['then'](interval[_0x6012('0x9')]())['then'](realtime[_0x6012('0xa')]())['then'](openchannelQueue[_0x6012('0xb')]())['then'](realtime[_0x6012('0xc')]())['then'](chatQueue[_0x6012('0xd')]())[_0x6012('0xe')](realtime[_0x6012('0xf')]())[_0x6012('0xe')](smsQueue[_0x6012('0x10')]())[_0x6012('0xe')](realtime[_0x6012('0x11')]())[_0x6012('0xe')](mailQueue['getMailQueues']())[_0x6012('0xe')](realtime['initMailQueues']())[_0x6012('0xe')](faxQueue[_0x6012('0x12')]())[_0x6012('0xe')](realtime[_0x6012('0x13')]())[_0x6012('0xe')](whatsappQueue[_0x6012('0x14')]())['then'](realtime[_0x6012('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0x6012('0x16')](realtime)[_0x6012('0xe')](function(_0x362bc1){return initRealtime();})['then'](function(_0x285a4c){return setInterval(initRealtime,0x1388);})[_0x6012('0x17')](function(_0x231107){console[_0x6012('0x18')](_0x231107);});}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 211eb2d..d7a7b12 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x12f9e3,_0x3fadc1){_0x12f9e3=_0x12f9e3-0x0;var _0x2de0c8=_0x1261[_0x12f9e3];return _0x2de0c8;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _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(_0x10d6f2,_0x18ae62){_0x10d6f2=_0x10d6f2-0x0;var _0x59e5c7=_0x1261[_0x10d6f2];return _0x59e5c7;};'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 129e514..b2a34a0 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 _0xf1be=['SendMail','jayson/promise','http','request','error','message','result','sendMailMessage'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xf1be,0x1c9));var _0xef1b=function(_0x1ff56e,_0x520abe){_0x1ff56e=_0x1ff56e-0x0;var _0x39361e=_0xf1be[_0x1ff56e];return _0x39361e;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xef1b('0x0'));var client=jayson['client'][_0xef1b('0x1')]({'port':0x232b});function request(_0xd3aa09,_0x30ff7a){return new BPromise(function(_0x4cbe44,_0x41c7f2){return client[_0xef1b('0x2')](_0xd3aa09,_0x30ff7a)['then'](function(_0x309303){if(_0x309303[_0xef1b('0x3')]){return _0x41c7f2(_0x309303['error'][_0xef1b('0x4')]);}else{return _0x4cbe44(_0x309303[_0xef1b('0x5')]);}})['catch'](function(_0x38a3a5){return _0x41c7f2(_0x38a3a5);});});}exports[_0xef1b('0x6')]=function(_0x14c375,_0x2842c3){return request(_0xef1b('0x7'),{'account':_0x14c375,'message':_0x2842c3});}; \ No newline at end of file +var _0xcd04=['request','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0xdd51dd,_0x1dbee6){var _0x24682f=function(_0x5284b1){while(--_0x5284b1){_0xdd51dd['push'](_0xdd51dd['shift']());}};_0x24682f(++_0x1dbee6);}(_0xcd04,0x1aa));var _0x4cd0=function(_0x4b7527,_0x13e515){_0x4b7527=_0x4b7527-0x0;var _0x2efff1=_0xcd04[_0x4b7527];return _0x2efff1;};'use strict';var BPromise=require(_0x4cd0('0x0'));var jayson=require(_0x4cd0('0x1'));var client=jayson[_0x4cd0('0x2')][_0x4cd0('0x3')]({'port':0x232b});function request(_0x523e63,_0x39a4f7){return new BPromise(function(_0x433309,_0xc35ca7){return client[_0x4cd0('0x4')](_0x523e63,_0x39a4f7)['then'](function(_0x32a329){if(_0x32a329[_0x4cd0('0x5')]){return _0xc35ca7(_0x32a329['error'][_0x4cd0('0x6')]);}else{return _0x433309(_0x32a329['result']);}})[_0x4cd0('0x7')](function(_0x1c511c){return _0xc35ca7(_0x1c511c);});});}exports[_0x4cd0('0x8')]=function(_0x355c31,_0x8f8da5){return request(_0x4cd0('0x9'),{'account':_0x355c31,'message':_0x8f8da5});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index ec684a0..15170f4 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 _0xbbfd=['mailStatus','faxStatusTime','faxCurrentCapacity','busyQueue','emit','user:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','sms','length','Status','StatusTime','toNumber'];(function(_0x286c14,_0x3a1892){var _0x24a41a=function(_0x418c01){while(--_0x418c01){_0x286c14['push'](_0x286c14['shift']());}};_0x24a41a(++_0x3a1892);}(_0xbbfd,0x1df));var _0xdbbf=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xbbfd[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xdbbf('0x0'));var Redis=require(_0xdbbf('0x1'));var config=require(_0xdbbf('0x2'));config[_0xdbbf('0x3')]=_['defaults'](config['redis'],{'host':_0xdbbf('0x4'),'port':0x18eb});var io=require(_0xdbbf('0x5'))(new Redis(config[_0xdbbf('0x3')]));function Agent(_0x74a1e9){this['id']=_0x74a1e9['id']||0x0;this[_0xdbbf('0x6')]=_0x74a1e9[_0xdbbf('0x6')]||'';this[_0xdbbf('0x7')]=_0x74a1e9[_0xdbbf('0x7')]||!![];this[_0xdbbf('0x8')]=_0x74a1e9[_0xdbbf('0x8')]||![];this[_0xdbbf('0x9')]=_0x74a1e9[_0xdbbf('0x9')]||![];this[_0xdbbf('0xa')]=_0x74a1e9[_0xdbbf('0xa')]||![];this[_0xdbbf('0xb')]=_0x74a1e9[_0xdbbf('0xb')]||![];this[_0xdbbf('0xc')]=_0x74a1e9[_0xdbbf('0xc')]||![];this['openchannelPause']=_0x74a1e9[_0xdbbf('0xd')]||![];this[_0xdbbf('0xe')]=_0xdbbf('0xf');this[_0xdbbf('0x10')]=0x0;this[_0xdbbf('0x11')]=_0x74a1e9['chatCapacity']||0x0;this[_0xdbbf('0x12')]=0x0;this['mailStatus']=_0xdbbf('0xf');this[_0xdbbf('0x13')]=0x0;this[_0xdbbf('0x14')]=_0x74a1e9[_0xdbbf('0x14')]||0x0;this[_0xdbbf('0x15')]=0x0;this[_0xdbbf('0x16')]=_0xdbbf('0xf');this['faxStatusTime']=0x0;this[_0xdbbf('0x17')]=_0x74a1e9[_0xdbbf('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xdbbf('0x18')]=_0xdbbf('0xf');this[_0xdbbf('0x19')]=0x0;this['smsCapacity']=_0x74a1e9[_0xdbbf('0x1a')]||0x0;this[_0xdbbf('0x1b')]=0x0;this[_0xdbbf('0x1c')]='unknown';this[_0xdbbf('0x1d')]=0x0;this[_0xdbbf('0x1e')]=_0x74a1e9[_0xdbbf('0x1e')]||0x0;this[_0xdbbf('0x1f')]=0x0;this[_0xdbbf('0x20')]=_0xdbbf('0xf');this[_0xdbbf('0x21')]=0x0;this[_0xdbbf('0x22')]=_0x74a1e9[_0xdbbf('0x22')]||0x0;this[_0xdbbf('0x23')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xdbbf('0x0')]='';this[_0xdbbf('0x24')]();}Agent['prototype'][_0xdbbf('0x25')]=function(_0x28c14f){if(this[_0x28c14f+'CurrentCapacity']>0x0){if(this[_0x28c14f+_0xdbbf('0x26')]>0x0&&this[_0x28c14f+_0xdbbf('0x27')]>=this[_0x28c14f+_0xdbbf('0x26')]){return _0xdbbf('0x28');}else{return _0xdbbf('0x29');}}else{return _0xdbbf('0x2a');}};Agent[_0xdbbf('0x2b')][_0xdbbf('0x24')]=function(){var _0x4f4956=[_0xdbbf('0x2c'),_0xdbbf('0x2d'),_0xdbbf('0x2e'),'fax',_0xdbbf('0x2f'),'whatsapp'];for(var _0x1a0020=0x0;_0x1a0020<_0x4f4956[_0xdbbf('0x30')];_0x1a0020+=0x1){var _0x2a5c06=this[_0xdbbf('0x25')](_0x4f4956[_0x1a0020]);if(this[_0x4f4956[_0x1a0020]+_0xdbbf('0x31')]!==_0x2a5c06){this[_0x4f4956[_0x1a0020]+_0xdbbf('0x32')]=_[_0xdbbf('0x33')](moment()['format']('x'));}this[_0x4f4956[_0x1a0020]+_0xdbbf('0x31')]=_0x2a5c06;}var _0x3ac612={'id':this['id'],'name':this[_0xdbbf('0x6')],'online':this[_0xdbbf('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0xdbbf('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xdbbf('0xc')],'faxPause':this[_0xdbbf('0xb')],'openchannelPause':this[_0xdbbf('0xd')],'chatStatus':this[_0xdbbf('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xdbbf('0x11')],'chatCurrentCapacity':this[_0xdbbf('0x12')],'mailStatus':this[_0xdbbf('0x34')],'mailStatusTime':this[_0xdbbf('0x13')],'mailCapacity':this[_0xdbbf('0x14')],'mailCurrentCapacity':this[_0xdbbf('0x15')],'faxStatus':this[_0xdbbf('0x16')],'faxStatusTime':this[_0xdbbf('0x35')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xdbbf('0x36')],'smsStatus':this[_0xdbbf('0x18')],'smsStatusTime':this[_0xdbbf('0x19')],'smsCapacity':this[_0xdbbf('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xdbbf('0x1c')],'whatsappStatusTime':this[_0xdbbf('0x1d')],'whatsappCapacity':this[_0xdbbf('0x1e')],'whatsappCurrentCapacity':this[_0xdbbf('0x1f')],'openchannelStatus':this[_0xdbbf('0x20')],'openchannelStatusTime':this[_0xdbbf('0x21')],'openchannelCapacity':this[_0xdbbf('0x22')],'openchannelCurrentCapacity':this[_0xdbbf('0x23')],'busy':this['busy'],'busyQueue':this[_0xdbbf('0x37')]};var _0x1db1f0=md5(JSON['stringify'](_0x3ac612));if(this[_0xdbbf('0x0')]!==_0x1db1f0){this[_0xdbbf('0x0')]=_0x1db1f0;io[_0xdbbf('0x38')](_0xdbbf('0x39'),_0x3ac612);}};module[_0xdbbf('0x3a')]=Agent; \ No newline at end of file +var _0x0c8c=['Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','faxStatusTime','smsStatusTime','smsCurrentCapacity','openchannelStatus','busy','emit','user:save','exports','lodash','moment','md5','../../../config/environment','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','prototype','getChannelStatus'];(function(_0x9df7c4,_0x1bab82){var _0x4bac2c=function(_0x246145){while(--_0x246145){_0x9df7c4['push'](_0x9df7c4['shift']());}};_0x4bac2c(++_0x1bab82);}(_0x0c8c,0x179));var _0xc0c8=function(_0x50029c,_0x342d20){_0x50029c=_0x50029c-0x0;var _0x304237=_0x0c8c[_0x50029c];return _0x304237;};'use strict';var _=require(_0xc0c8('0x0'));var moment=require(_0xc0c8('0x1'));var md5=require(_0xc0c8('0x2'));var Redis=require('ioredis');var config=require(_0xc0c8('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0xc0c8('0x4'),'port':0x18eb});var io=require(_0xc0c8('0x5'))(new Redis(config['redis']));function Agent(_0x21e1ad){this['id']=_0x21e1ad['id']||0x0;this[_0xc0c8('0x6')]=_0x21e1ad[_0xc0c8('0x6')]||'';this[_0xc0c8('0x7')]=_0x21e1ad[_0xc0c8('0x7')]||!![];this[_0xc0c8('0x8')]=_0x21e1ad[_0xc0c8('0x8')]||![];this['chatPause']=_0x21e1ad[_0xc0c8('0x9')]||![];this['mailPause']=_0x21e1ad[_0xc0c8('0xa')]||![];this[_0xc0c8('0xb')]=_0x21e1ad[_0xc0c8('0xb')]||![];this[_0xc0c8('0xc')]=_0x21e1ad['smsPause']||![];this[_0xc0c8('0xd')]=_0x21e1ad[_0xc0c8('0xd')]||![];this['chatStatus']=_0xc0c8('0xe');this[_0xc0c8('0xf')]=0x0;this[_0xc0c8('0x10')]=_0x21e1ad[_0xc0c8('0x10')]||0x0;this[_0xc0c8('0x11')]=0x0;this[_0xc0c8('0x12')]=_0xc0c8('0xe');this['mailStatusTime']=0x0;this[_0xc0c8('0x13')]=_0x21e1ad[_0xc0c8('0x13')]||0x0;this[_0xc0c8('0x14')]=0x0;this[_0xc0c8('0x15')]=_0xc0c8('0xe');this['faxStatusTime']=0x0;this[_0xc0c8('0x16')]=_0x21e1ad[_0xc0c8('0x16')]||0x0;this[_0xc0c8('0x17')]=0x0;this[_0xc0c8('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0xc0c8('0x19')]=_0x21e1ad[_0xc0c8('0x19')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xc0c8('0x1a')]=_0xc0c8('0xe');this[_0xc0c8('0x1b')]=0x0;this[_0xc0c8('0x1c')]=_0x21e1ad['whatsappCapacity']||0x0;this[_0xc0c8('0x1d')]=0x0;this['openchannelStatus']=_0xc0c8('0xe');this[_0xc0c8('0x1e')]=0x0;this[_0xc0c8('0x1f')]=_0x21e1ad[_0xc0c8('0x1f')]||0x0;this[_0xc0c8('0x20')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xc0c8('0x2')]='';this[_0xc0c8('0x21')]();}Agent[_0xc0c8('0x22')][_0xc0c8('0x23')]=function(_0x5d3e6c){if(this[_0x5d3e6c+'CurrentCapacity']>0x0){if(this[_0x5d3e6c+_0xc0c8('0x24')]>0x0&&this[_0x5d3e6c+_0xc0c8('0x25')]>=this[_0x5d3e6c+'Capacity']){return _0xc0c8('0x26');}else{return _0xc0c8('0x27');}}else{return _0xc0c8('0x28');}};Agent['prototype'][_0xc0c8('0x21')]=function(){var _0x317ca7=[_0xc0c8('0x29'),_0xc0c8('0x2a'),_0xc0c8('0x2b'),_0xc0c8('0x2c'),_0xc0c8('0x2d'),_0xc0c8('0x2e')];for(var _0xb7b590=0x0;_0xb7b590<_0x317ca7[_0xc0c8('0x2f')];_0xb7b590+=0x1){var _0x5a599a=this[_0xc0c8('0x23')](_0x317ca7[_0xb7b590]);if(this[_0x317ca7[_0xb7b590]+'Status']!==_0x5a599a){this[_0x317ca7[_0xb7b590]+_0xc0c8('0x30')]=_[_0xc0c8('0x31')](moment()[_0xc0c8('0x32')]('x'));}this[_0x317ca7[_0xb7b590]+'Status']=_0x5a599a;}var _0x3ef72b={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xc0c8('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0xc0c8('0xa')],'smsPause':this[_0xc0c8('0xc')],'faxPause':this[_0xc0c8('0xb')],'openchannelPause':this[_0xc0c8('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xc0c8('0xf')],'chatCapacity':this[_0xc0c8('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xc0c8('0x13')],'mailCurrentCapacity':this[_0xc0c8('0x14')],'faxStatus':this[_0xc0c8('0x15')],'faxStatusTime':this[_0xc0c8('0x33')],'faxCapacity':this[_0xc0c8('0x16')],'faxCurrentCapacity':this[_0xc0c8('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xc0c8('0x34')],'smsCapacity':this[_0xc0c8('0x19')],'smsCurrentCapacity':this[_0xc0c8('0x35')],'whatsappStatus':this[_0xc0c8('0x1a')],'whatsappStatusTime':this[_0xc0c8('0x1b')],'whatsappCapacity':this[_0xc0c8('0x1c')],'whatsappCurrentCapacity':this[_0xc0c8('0x1d')],'openchannelStatus':this[_0xc0c8('0x36')],'openchannelStatusTime':this[_0xc0c8('0x1e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xc0c8('0x37')],'busyQueue':this['busyQueue']};var _0x38c37f=md5(JSON['stringify'](_0x3ef72b));if(this[_0xc0c8('0x2')]!==_0x38c37f){this[_0xc0c8('0x2')]=_0x38c37f;io[_0xc0c8('0x38')](_0xc0c8('0x39'),_0x3ef72b);}};module[_0xc0c8('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ffd39dc..81d52d7 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 _0x6222=['stringify','chat:queue:%s','exports','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','prototype','loggedIn','length','online','chatPause','paused','available'];(function(_0x1ccc9a,_0x576639){var _0x47104e=function(_0x1dffad){while(--_0x1dffad){_0x1ccc9a['push'](_0x1ccc9a['shift']());}};_0x47104e(++_0x576639);}(_0x6222,0x148));var _0x2622=function(_0x3e25ad,_0x312f94){_0x3e25ad=_0x3e25ad-0x0;var _0x595401=_0x6222[_0x3e25ad];return _0x595401;};'use strict';var _=require('lodash');var md5=require(_0x2622('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x2622('0x1'));config[_0x2622('0x2')]=_[_0x2622('0x3')](config[_0x2622('0x2')],{'host':_0x2622('0x4'),'port':0x18eb});var io=require(_0x2622('0x5'))(new Redis(config['redis']));function ChatQueue(_0x3c257a){this['id']=_0x3c257a['id']||0x0;this['name']=_0x3c257a[_0x2622('0x6')]||'';this[_0x2622('0x7')]=_0x3c257a[_0x2622('0x7')]||0xa;this[_0x2622('0x8')]=_0x3c257a['strategy']||'beepall';this[_0x2622('0x9')]=_0x3c257a['Agents'];this['mapAgentsId']={};this[_0x2622('0xa')]=0x0;this[_0x2622('0x0')]='';this[_0x2622('0xb')]();this[_0x2622('0xc')]();}ChatQueue['prototype'][_0x2622('0xb')]=function(){var _0x48521e=this['mapAgentsId'][_0x2622('0xd')];this[_0x2622('0xe')]=_['map'](this[_0x2622('0x9')],'id');this[_0x2622('0xe')][_0x2622('0xd')]=_0x48521e;};ChatQueue[_0x2622('0xf')]['updateRealtime']=function(){this[_0x2622('0x10')]=0x0;this['paused']=0x0;for(var _0x4a279a=0x0;_0x4a279a=0x0?this[_0x2622('0x15')]:0x0;var _0x55606c={'id':this['id'],'available':this[_0x2622('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x2622('0x6')],'paused':this[_0x2622('0x14')],'waiting':this[_0x2622('0xa')]};var _0x247d62=md5(JSON[_0x2622('0x16')](_0x55606c));if(this[_0x2622('0x0')]!==_0x247d62){this['md5']=_0x247d62;io['to'](util['format'](_0x2622('0x17'),_0x55606c[_0x2622('0x6')]))['emit']('chat_queue:save',_0x55606c);}};module[_0x2622('0x18')]=ChatQueue; \ No newline at end of file +var _0xdbe8=['paused','length','online','chatPause','available','waiting','format','chat_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xdbe8,0xa4));var _0x8dbe=function(_0x59c6b3,_0x3f30f3){_0x59c6b3=_0x59c6b3-0x0;var _0x3e517e=_0xdbe8[_0x59c6b3];return _0x3e517e;};'use strict';var _=require(_0x8dbe('0x0'));var md5=require(_0x8dbe('0x1'));var util=require(_0x8dbe('0x2'));var Redis=require('ioredis');var config=require(_0x8dbe('0x3'));config[_0x8dbe('0x4')]=_[_0x8dbe('0x5')](config[_0x8dbe('0x4')],{'host':_0x8dbe('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8dbe('0x4')]));function ChatQueue(_0x2127f3){this['id']=_0x2127f3['id']||0x0;this[_0x8dbe('0x7')]=_0x2127f3['name']||'';this[_0x8dbe('0x8')]=_0x2127f3[_0x8dbe('0x8')]||0xa;this[_0x8dbe('0x9')]=_0x2127f3[_0x8dbe('0x9')]||_0x8dbe('0xa');this['Agents']=_0x2127f3[_0x8dbe('0xb')];this[_0x8dbe('0xc')]={};this['waiting']=0x0;this[_0x8dbe('0x1')]='';this[_0x8dbe('0xd')]();this[_0x8dbe('0xe')]();}ChatQueue[_0x8dbe('0xf')][_0x8dbe('0xd')]=function(){var _0x276e24=this['mapAgentsId'][_0x8dbe('0x10')];this[_0x8dbe('0xc')]=_['map'](this[_0x8dbe('0xb')],'id');this[_0x8dbe('0xc')][_0x8dbe('0x10')]=_0x276e24;};ChatQueue[_0x8dbe('0xf')][_0x8dbe('0xe')]=function(){this[_0x8dbe('0x11')]=0x0;this[_0x8dbe('0x12')]=0x0;for(var _0x3aa555=0x0;_0x3aa555=0x0?this[_0x8dbe('0x16')]:0x0;var _0x390d24={'id':this['id'],'available':this[_0x8dbe('0x16')],'loggedIn':this[_0x8dbe('0x11')],'name':this[_0x8dbe('0x7')],'paused':this['paused'],'waiting':this[_0x8dbe('0x17')]};var _0x37f25d=md5(JSON['stringify'](_0x390d24));if(this['md5']!==_0x37f25d){this[_0x8dbe('0x1')]=_0x37f25d;io['to'](util[_0x8dbe('0x18')]('chat:queue:%s',_0x390d24['name']))['emit'](_0x8dbe('0x19'),_0x390d24);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index f0e5010..6e9c207 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 _0x6983=['md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','emit','exports','lodash'];(function(_0x4178d9,_0x457645){var _0x4c0932=function(_0x2d678e){while(--_0x2d678e){_0x4178d9['push'](_0x4178d9['shift']());}};_0x4c0932(++_0x457645);}(_0x6983,0x179));var _0x3698=function(_0x226331,_0xe1bbb0){_0x226331=_0x226331-0x0;var _0x12c7aa=_0x6983[_0x226331];return _0x12c7aa;};'use strict';var _=require(_0x3698('0x0'));var md5=require(_0x3698('0x1'));var util=require(_0x3698('0x2'));var Redis=require(_0x3698('0x3'));var config=require(_0x3698('0x4'));config[_0x3698('0x5')]=_[_0x3698('0x6')](config[_0x3698('0x5')],{'host':_0x3698('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3698('0x5')]));function FaxQueue(_0x5f5250){this['id']=_0x5f5250['id']||0x0;this[_0x3698('0x8')]=_0x5f5250['name']||'';this['timeout']=_0x5f5250[_0x3698('0x9')]||0xa;this[_0x3698('0xa')]=_0x5f5250['strategy']||'beepall';this[_0x3698('0xb')]=_0x5f5250[_0x3698('0xb')];this[_0x3698('0xc')]={};this[_0x3698('0xd')]=0x0;this[_0x3698('0x1')]='';this[_0x3698('0xe')]();this[_0x3698('0xf')]();}FaxQueue[_0x3698('0x10')]['updateRouting']=function(){var _0x4f3ef8=this['mapAgentsId'][_0x3698('0x11')];this[_0x3698('0xc')]=_[_0x3698('0x12')](this[_0x3698('0xb')],'id');this[_0x3698('0xc')][_0x3698('0x11')]=_0x4f3ef8;};FaxQueue[_0x3698('0x10')]['updateRealtime']=function(){this[_0x3698('0x13')]=0x0;this[_0x3698('0x14')]=0x0;for(var _0x55dbe5=0x0;_0x55dbe5=0x0?this[_0x3698('0x17')]:0x0;var _0x30e770={'id':this['id'],'available':this[_0x3698('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x3698('0x14')],'waiting':this[_0x3698('0xd')]};var _0xfeea4=md5(JSON[_0x3698('0x18')](_0x30e770));if(this[_0x3698('0x1')]!==_0xfeea4){this[_0x3698('0x1')]=_0xfeea4;io['to'](util['format']('fax:queue:%s',_0x30e770[_0x3698('0x8')]))[_0x3698('0x19')]('fax_queue:save',_0x30e770);}};module[_0x3698('0x1a')]=FaxQueue; \ No newline at end of file +var _0xadfb=['length','faxPause','available','waiting','stringify','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xadfb,0xcd));var _0xbadf=function(_0xebaa92,_0x5bacb2){_0xebaa92=_0xebaa92-0x0;var _0x1f2153=_0xadfb[_0xebaa92];return _0x1f2153;};'use strict';var _=require(_0xbadf('0x0'));var md5=require(_0xbadf('0x1'));var util=require(_0xbadf('0x2'));var Redis=require(_0xbadf('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xbadf('0x4')](config[_0xbadf('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbadf('0x5')]));function FaxQueue(_0xc1dd71){this['id']=_0xc1dd71['id']||0x0;this[_0xbadf('0x6')]=_0xc1dd71[_0xbadf('0x6')]||'';this['timeout']=_0xc1dd71[_0xbadf('0x7')]||0xa;this[_0xbadf('0x8')]=_0xc1dd71[_0xbadf('0x8')]||_0xbadf('0x9');this[_0xbadf('0xa')]=_0xc1dd71[_0xbadf('0xa')];this[_0xbadf('0xb')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xbadf('0xc')][_0xbadf('0xd')]=function(){var _0x2438a6=this[_0xbadf('0xb')][_0xbadf('0xe')];this[_0xbadf('0xb')]=_[_0xbadf('0xf')](this[_0xbadf('0xa')],'id');this[_0xbadf('0xb')][_0xbadf('0xe')]=_0x2438a6;};FaxQueue['prototype'][_0xbadf('0x10')]=function(){this[_0xbadf('0x11')]=0x0;this[_0xbadf('0x12')]=0x0;for(var _0x1b8ae0=0x0;_0x1b8ae0=0x0?this[_0xbadf('0x15')]:0x0;var _0x31cba8={'id':this['id'],'available':this[_0xbadf('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xbadf('0x6')],'paused':this['paused'],'waiting':this[_0xbadf('0x16')]};var _0x5d1d7a=md5(JSON[_0xbadf('0x17')](_0x31cba8));if(this[_0xbadf('0x1')]!==_0x5d1d7a){this[_0xbadf('0x1')]=_0x5d1d7a;io['to'](util[_0xbadf('0x18')]('fax:queue:%s',_0x31cba8[_0xbadf('0x6')]))[_0xbadf('0x19')](_0xbadf('0x1a'),_0x31cba8);}};module[_0xbadf('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 d18a195..d34a201 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 _0xf426=['Intervals','exports','name'];(function(_0x170b0b,_0x4aa600){var _0x33cd22=function(_0x35263c){while(--_0x35263c){_0x170b0b['push'](_0x170b0b['shift']());}};_0x33cd22(++_0x4aa600);}(_0xf426,0x98));var _0x6f42=function(_0x5815af,_0x361f0b){_0x5815af=_0x5815af-0x0;var _0x3f14cb=_0xf426[_0x5815af];return _0x3f14cb;};'use strict';function Interval(_0x586a78){this['id']=_0x586a78['id']||0x0;this['name']=_0x586a78[_0x6f42('0x0')]||'';this[_0x6f42('0x1')]=_0x586a78['Intervals']||{};}module[_0x6f42('0x2')]=Interval; \ No newline at end of file +var _0x2a92=['name','Intervals','exports'];(function(_0x353f52,_0xe40124){var _0x44e3ec=function(_0x3c1be5){while(--_0x3c1be5){_0x353f52['push'](_0x353f52['shift']());}};_0x44e3ec(++_0xe40124);}(_0x2a92,0x1c8));var _0x22a9=function(_0x1e896c,_0x3f9948){_0x1e896c=_0x1e896c-0x0;var _0xd149d9=_0x2a92[_0x1e896c];return _0xd149d9;};'use strict';function Interval(_0x3c6af1){this['id']=_0x3c6af1['id']||0x0;this[_0x22a9('0x0')]=_0x3c6af1[_0x22a9('0x0')]||'';this[_0x22a9('0x1')]=_0x3c6af1[_0x22a9('0x1')]||{};}module[_0x22a9('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 8ea5aaa..e7d0fdc 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 _0xb9b8=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','paused','length','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5'];(function(_0x51ad4f,_0x45d87d){var _0x592932=function(_0x24f8b0){while(--_0x24f8b0){_0x51ad4f['push'](_0x51ad4f['shift']());}};_0x592932(++_0x45d87d);}(_0xb9b8,0x132));var _0x8b9b=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xb9b8[_0x424501];return _0xb719af;};'use strict';var _=require(_0x8b9b('0x0'));var md5=require(_0x8b9b('0x1'));var util=require(_0x8b9b('0x2'));var Redis=require(_0x8b9b('0x3'));var config=require(_0x8b9b('0x4'));config[_0x8b9b('0x5')]=_['defaults'](config[_0x8b9b('0x5')],{'host':_0x8b9b('0x6'),'port':0x18eb});var io=require(_0x8b9b('0x7'))(new Redis(config[_0x8b9b('0x5')]));function MailQueue(_0x280410){this['id']=_0x280410['id']||0x0;this['name']=_0x280410[_0x8b9b('0x8')]||'';this['timeout']=_0x280410['timeout']||0xa;this[_0x8b9b('0x9')]=_0x280410[_0x8b9b('0x9')]||'beepall';this[_0x8b9b('0xa')]=_0x280410[_0x8b9b('0xa')];this[_0x8b9b('0xb')]={};this[_0x8b9b('0xc')]=0x0;this[_0x8b9b('0x1')]='';this[_0x8b9b('0xd')]();this[_0x8b9b('0xe')]();}MailQueue[_0x8b9b('0xf')][_0x8b9b('0xd')]=function(){var _0x3ab6e3=this[_0x8b9b('0xb')]['_rr'];this['mapAgentsId']=_[_0x8b9b('0x10')](this[_0x8b9b('0xa')],'id');this[_0x8b9b('0xb')]['_rr']=_0x3ab6e3;};MailQueue[_0x8b9b('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x8b9b('0x11')]=0x0;for(var _0x3e233c=0x0;_0x3e233c=0x0?this[_0x8b9b('0x16')]:0x0;var _0x32a2da={'id':this['id'],'available':this[_0x8b9b('0x16')],'loggedIn':this[_0x8b9b('0x14')],'name':this['name'],'paused':this[_0x8b9b('0x11')],'waiting':this[_0x8b9b('0xc')]};var _0x175ecd=md5(JSON[_0x8b9b('0x17')](_0x32a2da));if(this['md5']!==_0x175ecd){this[_0x8b9b('0x1')]=_0x175ecd;io['to'](util[_0x8b9b('0x18')](_0x8b9b('0x19'),_0x32a2da['name']))['emit'](_0x8b9b('0x1a'),_0x32a2da);}};module[_0x8b9b('0x1b')]=MailQueue; \ No newline at end of file +var _0x0746=['beepall','mapAgentsId','waiting','updateRealtime','prototype','map','_rr','paused','Agents','online','mailPause','available','loggedIn','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x219932,_0x4fc086){var _0x3978b1=function(_0x1d1767){while(--_0x1d1767){_0x219932['push'](_0x219932['shift']());}};_0x3978b1(++_0x4fc086);}(_0x0746,0x151));var _0x6074=function(_0x2ebca1,_0x1c2a3f){_0x2ebca1=_0x2ebca1-0x0;var _0x4f5b67=_0x0746[_0x2ebca1];return _0x4f5b67;};'use strict';var _=require('lodash');var md5=require(_0x6074('0x0'));var util=require(_0x6074('0x1'));var Redis=require(_0x6074('0x2'));var config=require(_0x6074('0x3'));config['redis']=_[_0x6074('0x4')](config[_0x6074('0x5')],{'host':_0x6074('0x6'),'port':0x18eb});var io=require(_0x6074('0x7'))(new Redis(config[_0x6074('0x5')]));function MailQueue(_0x3c6c13){this['id']=_0x3c6c13['id']||0x0;this['name']=_0x3c6c13[_0x6074('0x8')]||'';this['timeout']=_0x3c6c13[_0x6074('0x9')]||0xa;this[_0x6074('0xa')]=_0x3c6c13[_0x6074('0xa')]||_0x6074('0xb');this['Agents']=_0x3c6c13['Agents'];this[_0x6074('0xc')]={};this[_0x6074('0xd')]=0x0;this[_0x6074('0x0')]='';this['updateRouting']();this[_0x6074('0xe')]();}MailQueue[_0x6074('0xf')]['updateRouting']=function(){var _0x1f7403=this[_0x6074('0xc')]['_rr'];this[_0x6074('0xc')]=_[_0x6074('0x10')](this['Agents'],'id');this[_0x6074('0xc')][_0x6074('0x11')]=_0x1f7403;};MailQueue[_0x6074('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x6074('0x12')]=0x0;for(var _0x5a8cd1=0x0;_0x5a8cd1=0x0?this['available']:0x0;var _0x286285={'id':this['id'],'available':this[_0x6074('0x16')],'loggedIn':this[_0x6074('0x17')],'name':this[_0x6074('0x8')],'paused':this['paused'],'waiting':this[_0x6074('0xd')]};var _0x56ac19=md5(JSON['stringify'](_0x286285));if(this['md5']!==_0x56ac19){this[_0x6074('0x0')]=_0x56ac19;io['to'](util[_0x6074('0x18')](_0x6074('0x19'),_0x286285[_0x6074('0x8')]))[_0x6074('0x1a')](_0x6074('0x1b'),_0x286285);}};module[_0x6074('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 1af640e..fcf99ed 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x7a54,0x106));var _0x47a5=function(_0x378c1d,_0x437055){_0x378c1d=_0x378c1d-0x0;var _0x4559ec=_0x7a54[_0x378c1d];return _0x4559ec;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x326f,0xd1));var _0xf326=function(_0x58924b,_0x2f46fd){_0x58924b=_0x58924b-0x0;var _0xf61741=_0x326f[_0x58924b];return _0xf61741;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('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 7eb10c7..d6d3757 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 _0x9d02=['smsPause','paused','available','name','stringify','md5','format','sms:queue:%s','sms_queue:save','exports','lodash','util','../../../config/environment','defaults','redis','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online'];(function(_0x3f3ab1,_0x378b55){var _0x41e871=function(_0x5745c6){while(--_0x5745c6){_0x3f3ab1['push'](_0x3f3ab1['shift']());}};_0x41e871(++_0x378b55);}(_0x9d02,0x118));var _0x29d0=function(_0x469664,_0x2b4695){_0x469664=_0x469664-0x0;var _0x727df2=_0x9d02[_0x469664];return _0x727df2;};'use strict';var _=require(_0x29d0('0x0'));var md5=require('md5');var util=require(_0x29d0('0x1'));var Redis=require('ioredis');var config=require(_0x29d0('0x2'));config['redis']=_[_0x29d0('0x3')](config[_0x29d0('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x29d0('0x5'))(new Redis(config[_0x29d0('0x4')]));function SmsQueue(_0x242299){this['id']=_0x242299['id']||0x0;this['name']=_0x242299['name']||'';this['timeout']=_0x242299[_0x29d0('0x6')]||0xa;this[_0x29d0('0x7')]=_0x242299['strategy']||_0x29d0('0x8');this[_0x29d0('0x9')]=_0x242299['Agents'];this[_0x29d0('0xa')]={};this[_0x29d0('0xb')]=0x0;this['md5']='';this[_0x29d0('0xc')]();this[_0x29d0('0xd')]();}SmsQueue[_0x29d0('0xe')][_0x29d0('0xc')]=function(){var _0x5beb4c=this['mapAgentsId'][_0x29d0('0xf')];this[_0x29d0('0xa')]=_[_0x29d0('0x10')](this[_0x29d0('0x9')],'id');this[_0x29d0('0xa')][_0x29d0('0xf')]=_0x5beb4c;};SmsQueue[_0x29d0('0xe')][_0x29d0('0xd')]=function(){this[_0x29d0('0x11')]=0x0;this['paused']=0x0;for(var _0x22903c=0x0;_0x22903c=0x0?this[_0x29d0('0x16')]:0x0;var _0x2b83e7={'id':this['id'],'available':this[_0x29d0('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x29d0('0x17')],'paused':this[_0x29d0('0x15')],'waiting':this[_0x29d0('0xb')]};var _0x18dd1a=md5(JSON[_0x29d0('0x18')](_0x2b83e7));if(this[_0x29d0('0x19')]!==_0x18dd1a){this['md5']=_0x18dd1a;io['to'](util[_0x29d0('0x1a')](_0x29d0('0x1b'),_0x2b83e7[_0x29d0('0x17')]))['emit'](_0x29d0('0x1c'),_0x2b83e7);}};module[_0x29d0('0x1d')]=SmsQueue; \ No newline at end of file +var _0xd2ea=['online','loggedIn','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1f0fde,_0x135c9b){_0x1f0fde=_0x1f0fde-0x0;var _0x38c7bd=_0xd2ea[_0x1f0fde];return _0x38c7bd;};'use strict';var _=require(_0xad2e('0x0'));var md5=require(_0xad2e('0x1'));var util=require(_0xad2e('0x2'));var Redis=require(_0xad2e('0x3'));var config=require(_0xad2e('0x4'));config['redis']=_[_0xad2e('0x5')](config[_0xad2e('0x6')],{'host':_0xad2e('0x7'),'port':0x18eb});var io=require(_0xad2e('0x8'))(new Redis(config[_0xad2e('0x6')]));function SmsQueue(_0x2fd28e){this['id']=_0x2fd28e['id']||0x0;this[_0xad2e('0x9')]=_0x2fd28e['name']||'';this[_0xad2e('0xa')]=_0x2fd28e[_0xad2e('0xa')]||0xa;this[_0xad2e('0xb')]=_0x2fd28e['strategy']||_0xad2e('0xc');this[_0xad2e('0xd')]=_0x2fd28e['Agents'];this[_0xad2e('0xe')]={};this['waiting']=0x0;this[_0xad2e('0x1')]='';this[_0xad2e('0xf')]();this[_0xad2e('0x10')]();}SmsQueue[_0xad2e('0x11')]['updateRouting']=function(){var _0x7df3c6=this['mapAgentsId'][_0xad2e('0x12')];this[_0xad2e('0xe')]=_[_0xad2e('0x13')](this[_0xad2e('0xd')],'id');this['mapAgentsId'][_0xad2e('0x12')]=_0x7df3c6;};SmsQueue['prototype'][_0xad2e('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4a812b=0x0;_0x4a812b=0x0?this[_0xad2e('0x19')]:0x0;var _0x1b4889={'id':this['id'],'available':this[_0xad2e('0x19')],'loggedIn':this['loggedIn'],'name':this[_0xad2e('0x9')],'paused':this[_0xad2e('0x18')],'waiting':this['waiting']};var _0x50eb1a=md5(JSON['stringify'](_0x1b4889));if(this['md5']!==_0x50eb1a){this[_0xad2e('0x1')]=_0x50eb1a;io['to'](util[_0xad2e('0x1a')](_0xad2e('0x1b'),_0x1b4889[_0xad2e('0x9')]))[_0xad2e('0x1c')](_0xad2e('0x1d'),_0x1b4889);}};module[_0xad2e('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index eaf8ba0..c32969e 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 _0x4fba=['paused','length','online','available','waiting','format','whatsapp:queue:%s','emit','whatsapp_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn'];(function(_0xf7541,_0x3e47a1){var _0x139bc7=function(_0x4f18c2){while(--_0x4f18c2){_0xf7541['push'](_0xf7541['shift']());}};_0x139bc7(++_0x3e47a1);}(_0x4fba,0x191));var _0xa4fb=function(_0x532788,_0x232362){_0x532788=_0x532788-0x0;var _0x23c64f=_0x4fba[_0x532788];return _0x23c64f;};'use strict';var _=require('lodash');var md5=require(_0xa4fb('0x0'));var util=require(_0xa4fb('0x1'));var Redis=require(_0xa4fb('0x2'));var config=require(_0xa4fb('0x3'));config[_0xa4fb('0x4')]=_[_0xa4fb('0x5')](config[_0xa4fb('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa4fb('0x6'))(new Redis(config[_0xa4fb('0x4')]));function WhatsappQueue(_0x384b15){this['id']=_0x384b15['id']||0x0;this[_0xa4fb('0x7')]=_0x384b15[_0xa4fb('0x7')]||'';this[_0xa4fb('0x8')]=_0x384b15[_0xa4fb('0x8')]||0xa;this[_0xa4fb('0x9')]=_0x384b15[_0xa4fb('0x9')]||_0xa4fb('0xa');this[_0xa4fb('0xb')]=_0x384b15[_0xa4fb('0xb')];this[_0xa4fb('0xc')]={};this['waiting']=0x0;this[_0xa4fb('0x0')]='';this[_0xa4fb('0xd')]();this[_0xa4fb('0xe')]();}WhatsappQueue[_0xa4fb('0xf')][_0xa4fb('0xd')]=function(){var _0x466965=this[_0xa4fb('0xc')]['_rr'];this[_0xa4fb('0xc')]=_[_0xa4fb('0x10')](this[_0xa4fb('0xb')],'id');this[_0xa4fb('0xc')][_0xa4fb('0x11')]=_0x466965;};WhatsappQueue['prototype'][_0xa4fb('0xe')]=function(){this[_0xa4fb('0x12')]=0x0;this[_0xa4fb('0x13')]=0x0;for(var _0xb315a3=0x0;_0xb315a3=0x0?this[_0xa4fb('0x16')]:0x0;var _0x2dc9ec={'id':this['id'],'available':this[_0xa4fb('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xa4fb('0x7')],'paused':this[_0xa4fb('0x13')],'waiting':this[_0xa4fb('0x17')]};var _0x1a0594=md5(JSON['stringify'](_0x2dc9ec));if(this[_0xa4fb('0x0')]!==_0x1a0594){this[_0xa4fb('0x0')]=_0x1a0594;io['to'](util[_0xa4fb('0x18')](_0xa4fb('0x19'),_0x2dc9ec['name']))[_0xa4fb('0x1a')](_0xa4fb('0x1b'),_0x2dc9ec);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xb628=['timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','_rr','map','loggedIn','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','name'];(function(_0x2db63f,_0x5e3dcc){var _0x2da78c=function(_0x3598ea){while(--_0x3598ea){_0x2db63f['push'](_0x2db63f['shift']());}};_0x2da78c(++_0x5e3dcc);}(_0xb628,0x13d));var _0x8b62=function(_0xcc2811,_0x105054){_0xcc2811=_0xcc2811-0x0;var _0x2e9299=_0xb628[_0xcc2811];return _0x2e9299;};'use strict';var _=require(_0x8b62('0x0'));var md5=require(_0x8b62('0x1'));var util=require(_0x8b62('0x2'));var Redis=require(_0x8b62('0x3'));var config=require(_0x8b62('0x4'));config['redis']=_[_0x8b62('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x5858cf){this['id']=_0x5858cf['id']||0x0;this[_0x8b62('0x6')]=_0x5858cf[_0x8b62('0x6')]||'';this[_0x8b62('0x7')]=_0x5858cf[_0x8b62('0x7')]||0xa;this[_0x8b62('0x8')]=_0x5858cf['strategy']||_0x8b62('0x9');this[_0x8b62('0xa')]=_0x5858cf[_0x8b62('0xa')];this[_0x8b62('0xb')]={};this['waiting']=0x0;this[_0x8b62('0x1')]='';this['updateRouting']();this[_0x8b62('0xc')]();}WhatsappQueue[_0x8b62('0xd')]['updateRouting']=function(){var _0x286d3b=this[_0x8b62('0xb')][_0x8b62('0xe')];this[_0x8b62('0xb')]=_[_0x8b62('0xf')](this['Agents'],'id');this[_0x8b62('0xb')][_0x8b62('0xe')]=_0x286d3b;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x8b62('0x10')]=0x0;this['paused']=0x0;for(var _0x274fbd=0x0;_0x274fbd=0x0?this['available']:0x0;var _0x2c63fb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8b62('0x10')],'name':this['name'],'paused':this[_0x8b62('0x13')],'waiting':this['waiting']};var _0x2c4789=md5(JSON[_0x8b62('0x15')](_0x2c63fb));if(this[_0x8b62('0x1')]!==_0x2c4789){this[_0x8b62('0x1')]=_0x2c4789;io['to'](util[_0x8b62('0x16')](_0x8b62('0x17'),_0x2c63fb[_0x8b62('0x6')]))[_0x8b62('0x18')](_0x8b62('0x19'),_0x2c63fb);}};module[_0x8b62('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 534c334..e2a2052 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 _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(_0xf4a8df,_0x462a7b){var _0x54a69b=function(_0x3b69d7){while(--_0x3b69d7){_0xf4a8df['push'](_0xf4a8df['shift']());}};_0x54a69b(++_0x462a7b);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a7b40,_0x585230){_0x5a7b40=_0x5a7b40-0x0;var _0x463559=_0xb10b[_0x5a7b40];return _0x463559;};'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 +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 02b5d29..4289f8e 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 _0x72ed=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x72ed,0x1e4));var _0xd72e=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x72ed[_0x576170];return _0x397c70;};'use strict';var client=require(_0xd72e('0x0'));exports[_0xd72e('0x1')]=function(_0x1f18da,_0x35c2f4){return client['Request'](_0xd72e('0x2'),{'body':_0x35c2f4,'options':{'where':{'id':_0x1f18da}},'log':_0xd72e('0x3')});};exports[_0xd72e('0x4')]=function(_0x24bdb4,_0x399883){return client[_0xd72e('0x5')](_0xd72e('0x6'),{'body':_0x399883,'options':{'where':{'id':_0x24bdb4}},'log':_0xd72e('0x7')});}; \ No newline at end of file +var _0x95d3=['../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x95d3,0x126));var _0x395d=function(_0x5a4f3b,_0x344159){_0x5a4f3b=_0x5a4f3b-0x0;var _0x33e973=_0x95d3[_0x5a4f3b];return _0x33e973;};'use strict';var client=require(_0x395d('0x0'));exports['update']=function(_0xc5a316,_0x157564){return client[_0x395d('0x1')](_0x395d('0x2'),{'body':_0x157564,'options':{'where':{'id':_0xc5a316}},'log':_0x395d('0x3')});};exports[_0x395d('0x4')]=function(_0x3c4252,_0x388ba5){return client[_0x395d('0x1')](_0x395d('0x5'),{'body':_0x388ba5,'options':{'where':{'id':_0x3c4252}},'log':_0x395d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 7e705cc..70045bc 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 _0x0618=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0x0618,0x121));var _0x8061=function(_0x442430,_0x1b3577){_0x442430=_0x442430-0x0;var _0x2440c1=_0x0618[_0x442430];return _0x2440c1;};'use strict';var client=require(_0x8061('0x0'));exports[_0x8061('0x1')]=function(_0x361c32){return client[_0x8061('0x2')](_0x8061('0x3'),{'body':_0x361c32,'log':_0x8061('0x4')});}; \ No newline at end of file +var _0x4545=['CreateChatMessage','../client','Request'];(function(_0x333a36,_0x205c29){var _0x4a15f7=function(_0x4bd734){while(--_0x4bd734){_0x333a36['push'](_0x333a36['shift']());}};_0x4a15f7(++_0x205c29);}(_0x4545,0x157));var _0x5454=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4545[_0x1cc8fe];return _0x230054;};'use strict';var client=require(_0x5454('0x0'));exports['create']=function(_0x2cd4bb){return client[_0x5454('0x1')](_0x5454('0x2'),{'body':_0x2cd4bb,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2a98f61..0a89420 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 _0x1c3b=['../client','getChatQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x1c3b,0xab));var _0xb1c3=function(_0x329601,_0x53aea5){_0x329601=_0x329601-0x0;var _0x5d5fde=_0x1c3b[_0x329601];return _0x5d5fde;};'use strict';var client=require(_0xb1c3('0x0'));exports[_0xb1c3('0x1')]=function(){return function(){return client[_0xb1c3('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0xb1c3('0x3'),_0xb1c3('0x4')],'include':[{'model':_0xb1c3('0x5'),'as':_0xb1c3('0x6'),'attributes':['id',_0xb1c3('0x7'),_0xb1c3('0x8'),'chatPause']}]},'log':_0xb1c3('0x1')});};}; \ No newline at end of file +var _0xe0c3=['../client','Request','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x1e8826,_0x5425b6){var _0x351d2f=function(_0x540fb8){while(--_0x540fb8){_0x1e8826['push'](_0x1e8826['shift']());}};_0x351d2f(++_0x5425b6);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x3e0c('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x3e0c('0x1')](_0x3e0c('0x2'),{'options':{'raw':![],'attributes':['id',_0x3e0c('0x3'),_0x3e0c('0x4'),_0x3e0c('0x5')],'include':[{'model':_0x3e0c('0x6'),'as':_0x3e0c('0x7'),'attributes':['id',_0x3e0c('0x3'),_0x3e0c('0x8'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 836cec4..18ee474 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 _0xeb5d=['CreateChatQueueReport','UpdateChatQueueReport','DESC','create','Request'];(function(_0x1aa741,_0x1080fb){var _0x338f56=function(_0x1199ff){while(--_0x1199ff){_0x1aa741['push'](_0x1aa741['shift']());}};_0x338f56(++_0x1080fb);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeb5d[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0xdeb5('0x0')]=function(_0x1ede03){return client[_0xdeb5('0x1')](_0xdeb5('0x2'),{'body':_0x1ede03,'log':'CreateChatQueueReport'});};exports['update']=function(_0x17d77f,_0x16c31b){return client['Request'](_0xdeb5('0x3'),{'body':_0x16c31b,'options':{'where':{'uniqueid':_0x17d77f},'order':[['id',_0xdeb5('0x4')]],'limit':0x1},'log':_0xdeb5('0x3')});}; \ No newline at end of file +var _0x6ddd=['DESC','UpdateChatQueueReport','Request','CreateChatQueueReport'];(function(_0x20230f,_0x270c08){var _0x18b830=function(_0x20556a){while(--_0x20556a){_0x20230f['push'](_0x20230f['shift']());}};_0x18b830(++_0x270c08);}(_0x6ddd,0xae));var _0xd6dd=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6ddd[_0x2b4411];return _0x8e41ef;};'use strict';var client=require('../client');exports['create']=function(_0x468b4c){return client[_0xd6dd('0x0')](_0xd6dd('0x1'),{'body':_0x468b4c,'log':_0xd6dd('0x1')});};exports['update']=function(_0x3651aa,_0x5aebd8){return client[_0xd6dd('0x0')]('UpdateChatQueueReport',{'body':_0x5aebd8,'options':{'where':{'uniqueid':_0x3651aa},'order':[['id',_0xd6dd('0x2')]],'limit':0x1},'log':_0xd6dd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 734eadc..99c9f45 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(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x7a54,0x106));var _0x47a5=function(_0x5ad6f2,_0x59691e){_0x5ad6f2=_0x5ad6f2-0x0;var _0x448fd3=_0x7a54[_0x5ad6f2];return _0x448fd3;};'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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 8fad875..b1b3549 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 _0x5eda=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x59b439,_0x4e16b6){var _0x74d02b=function(_0x319ddc){while(--_0x319ddc){_0x59b439['push'](_0x59b439['shift']());}};_0x74d02b(++_0x4e16b6);}(_0x5eda,0x8b));var _0xa5ed=function(_0xb06a92,_0x38eacf){_0xb06a92=_0xb06a92-0x0;var _0x324522=_0x5eda[_0xb06a92];return _0x324522;};'use strict';var client=require(_0xa5ed('0x0'));exports[_0xa5ed('0x1')]=function(_0x36348d){return client[_0xa5ed('0x2')](_0xa5ed('0x3'),{'body':_0x36348d,'log':_0xa5ed('0x4')});}; \ No newline at end of file +var _0x5fbf=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x53e9fa,_0x6a01f4){var _0x295bf8=function(_0x3c42c3){while(--_0x3c42c3){_0x53e9fa['push'](_0x53e9fa['shift']());}};_0x295bf8(++_0x6a01f4);}(_0x5fbf,0x78));var _0xf5fb=function(_0x3cb5d5,_0x4be75b){_0x3cb5d5=_0x3cb5d5-0x0;var _0x490ec8=_0x5fbf[_0x3cb5d5];return _0x490ec8;};'use strict';var client=require(_0xf5fb('0x0'));exports[_0xf5fb('0x1')]=function(_0x4e980e){return client[_0xf5fb('0x2')](_0xf5fb('0x3'),{'body':_0x4e980e,'log':_0xf5fb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index eb5e111..b8d4413 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 _0xffbc=['online','faxPause','getFaxQueues','Request','name','timeout','User','Agents'];(function(_0x5e2447,_0x52aeef){var _0x2efef7=function(_0x17d811){while(--_0x17d811){_0x5e2447['push'](_0x5e2447['shift']());}};_0x2efef7(++_0x52aeef);}(_0xffbc,0x142));var _0xcffb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xffbc[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require('../client');exports[_0xcffb('0x0')]=function(){return function(){return client[_0xcffb('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xcffb('0x2'),_0xcffb('0x3'),'strategy'],'include':[{'model':_0xcffb('0x4'),'as':_0xcffb('0x5'),'attributes':['id',_0xcffb('0x2'),_0xcffb('0x6'),_0xcffb('0x7')]}]},'log':_0xcffb('0x0')});};}; \ No newline at end of file +var _0xbf2b=['strategy','User','faxPause','../client','getFaxQueues','Request','name','timeout'];(function(_0x162f62,_0x1a0ab1){var _0x26c56e=function(_0x1ae1ac){while(--_0x1ae1ac){_0x162f62['push'](_0x162f62['shift']());}};_0x26c56e(++_0x1a0ab1);}(_0xbf2b,0xbb));var _0xbbf2=function(_0x33fc06,_0x2de9d7){_0x33fc06=_0x33fc06-0x0;var _0x381279=_0xbf2b[_0x33fc06];return _0x381279;};'use strict';var client=require(_0xbbf2('0x0'));exports[_0xbbf2('0x1')]=function(){return function(){return client[_0xbbf2('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xbbf2('0x3'),_0xbbf2('0x4'),_0xbbf2('0x5')],'include':[{'model':_0xbbf2('0x6'),'as':'Agents','attributes':['id',_0xbbf2('0x3'),'online',_0xbbf2('0x7')]}]},'log':_0xbbf2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6f35df2..6132a99 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 _0x7c75=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x7c75,0x1dd));var _0x57c7=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x7c75[_0x3ab9ee];return _0x82ee88;};'use strict';var client=require(_0x57c7('0x0'));exports[_0x57c7('0x1')]=function(_0x479320){return client[_0x57c7('0x2')](_0x57c7('0x3'),{'body':_0x479320,'log':'CreateFaxQueueReport'});};exports[_0x57c7('0x4')]=function(_0x44f8aa,_0x156360){return client[_0x57c7('0x2')](_0x57c7('0x5'),{'body':_0x156360,'options':{'where':{'uniqueid':_0x44f8aa},'order':[['id',_0x57c7('0x6')]],'limit':0x1},'log':_0x57c7('0x5')});}; \ No newline at end of file +var _0x0706=['UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport','update'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0706,0x1dc));var _0x6070=function(_0x1f32cb,_0x2b5ff2){_0x1f32cb=_0x1f32cb-0x0;var _0x48df95=_0x0706[_0x1f32cb];return _0x48df95;};'use strict';var client=require('../client');exports[_0x6070('0x0')]=function(_0x22be13){return client[_0x6070('0x1')]('CreateFaxQueueReport',{'body':_0x22be13,'log':_0x6070('0x2')});};exports[_0x6070('0x3')]=function(_0x35b6b1,_0x45a8a2){return client[_0x6070('0x1')](_0x6070('0x4'),{'body':_0x45a8a2,'options':{'where':{'uniqueid':_0x35b6b1},'order':[['id',_0x6070('0x5')]],'limit':0x1},'log':_0x6070('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 97d308f..b35c1bd 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 _0x5116=['name','getIntervals','../client','Request','GetInterval'];(function(_0x5ea7b0,_0x5f367f){var _0x1ceb39=function(_0x48d714){while(--_0x48d714){_0x5ea7b0['push'](_0x5ea7b0['shift']());}};_0x1ceb39(++_0x5f367f);}(_0x5116,0xa7));var _0x6511=function(_0x4b29b0,_0x5d0465){_0x4b29b0=_0x4b29b0-0x0;var _0x535835=_0x5116[_0x4b29b0];return _0x535835;};'use strict';var client=require(_0x6511('0x0'));exports['getIntervals']=function(){return function(){return client[_0x6511('0x1')](_0x6511('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x6511('0x3'),'interval']}]},'log':_0x6511('0x4')});};}; \ No newline at end of file +var _0xac5a=['Intervals','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x58dd0b,_0x39de95){var _0x30fd30=function(_0x31d052){while(--_0x31d052){_0x58dd0b['push'](_0x58dd0b['shift']());}};_0x30fd30(++_0x39de95);}(_0xac5a,0x17b));var _0xaac5=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xac5a[_0x172747];return _0x509692;};'use strict';var client=require(_0xaac5('0x0'));exports[_0xaac5('0x1')]=function(){return function(){return client[_0xaac5('0x2')](_0xaac5('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xaac5('0x4')],'include':[{'model':_0xaac5('0x5'),'as':_0xaac5('0x6'),'attributes':['id',_0xaac5('0x4'),'interval']}]},'log':_0xaac5('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index d7361d4..bf8825a 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 _0xf61e=['addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0xf61e,0x191));var _0xef61=function(_0x53f1e9,_0x4d56c3){_0x53f1e9=_0x53f1e9-0x0;var _0x3b8531=_0xf61e[_0x53f1e9];return _0x3b8531;};'use strict';var client=require(_0xef61('0x0'));exports[_0xef61('0x1')]=function(_0xe535c3,_0xcf15bd){return client[_0xef61('0x2')](_0xef61('0x3'),{'body':_0xcf15bd,'options':{'where':{'id':_0xe535c3}},'log':_0xef61('0x4')});};exports[_0xef61('0x5')]=function(_0x2bd1d0,_0x14122a){return client[_0xef61('0x2')](_0xef61('0x6'),{'body':_0x14122a,'options':{'where':{'id':_0x2bd1d0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x4213=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x36efc6,_0xaec4c1){var _0x2ec02f=function(_0xd7bda7){while(--_0xd7bda7){_0x36efc6['push'](_0x36efc6['shift']());}};_0x2ec02f(++_0xaec4c1);}(_0x4213,0x77));var _0x3421=function(_0x3d9418,_0x3c48be){_0x3d9418=_0x3d9418-0x0;var _0x1d16c5=_0x4213[_0x3d9418];return _0x1d16c5;};'use strict';var client=require(_0x3421('0x0'));exports[_0x3421('0x1')]=function(_0x324515,_0x7870a4){return client[_0x3421('0x2')](_0x3421('0x3'),{'body':_0x7870a4,'options':{'where':{'id':_0x324515}},'log':_0x3421('0x4')});};exports['addTags']=function(_0xdbd54e,_0x5c3719){return client[_0x3421('0x2')](_0x3421('0x5'),{'body':_0x5c3719,'options':{'where':{'id':_0xdbd54e}},'log':_0x3421('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index ddc22ac..55d3078 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 _0xc43e=['createMailMessage','../client','create','Request'];(function(_0x397284,_0x319d8b){var _0xf50033=function(_0xc2d075){while(--_0xc2d075){_0x397284['push'](_0x397284['shift']());}};_0xf50033(++_0x319d8b);}(_0xc43e,0xbd));var _0xec43=function(_0xb47dc8,_0x4c3ab2){_0xb47dc8=_0xb47dc8-0x0;var _0x2ae1c6=_0xc43e[_0xb47dc8];return _0x2ae1c6;};'use strict';var client=require(_0xec43('0x0'));exports[_0xec43('0x1')]=function(_0x25099b){return client[_0xec43('0x2')]('CreateMailMessage',{'body':_0x25099b,'log':_0xec43('0x3')});}; \ No newline at end of file +var _0x54d6=['create','Request','CreateMailMessage'];(function(_0x324db2,_0x33ba50){var _0x3bb14b=function(_0x292658){while(--_0x292658){_0x324db2['push'](_0x324db2['shift']());}};_0x3bb14b(++_0x33ba50);}(_0x54d6,0x141));var _0x654d=function(_0x5ea288,_0x2e13e4){_0x5ea288=_0x5ea288-0x0;var _0x3b026b=_0x54d6[_0x5ea288];return _0x3b026b;};'use strict';var client=require('../client');exports[_0x654d('0x0')]=function(_0x639438){return client[_0x654d('0x1')](_0x654d('0x2'),{'body':_0x639438,'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 5815ba7..42306a6 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 _0x6e7d=['strategy','Agents','online','mailPause','getMailQueues','Request','GetMailQueue','name'];(function(_0x900d3c,_0x5b6aa3){var _0x502079=function(_0x387ea1){while(--_0x387ea1){_0x900d3c['push'](_0x900d3c['shift']());}};_0x502079(++_0x5b6aa3);}(_0x6e7d,0xbc));var _0xd6e7=function(_0x586140,_0x1e35ed){_0x586140=_0x586140-0x0;var _0x62b615=_0x6e7d[_0x586140];return _0x62b615;};'use strict';var client=require('../client');exports[_0xd6e7('0x0')]=function(){return function(){return client[_0xd6e7('0x1')](_0xd6e7('0x2'),{'options':{'raw':![],'attributes':['id',_0xd6e7('0x3'),'timeout',_0xd6e7('0x4')],'include':[{'model':'User','as':_0xd6e7('0x5'),'attributes':['id',_0xd6e7('0x3'),_0xd6e7('0x6'),_0xd6e7('0x7')]}]},'log':_0xd6e7('0x0')});};}; \ No newline at end of file +var _0xe6da=['timeout','strategy','User','Agents','name','online','getMailQueues','../client','Request','GetMailQueue'];(function(_0x5ab6a5,_0x4977b1){var _0x3cb85c=function(_0x585e95){while(--_0x585e95){_0x5ab6a5['push'](_0x5ab6a5['shift']());}};_0x3cb85c(++_0x4977b1);}(_0xe6da,0x1ab));var _0xae6d=function(_0x457f42,_0x2348ca){_0x457f42=_0x457f42-0x0;var _0x5ce972=_0xe6da[_0x457f42];return _0x5ce972;};'use strict';var client=require(_0xae6d('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xae6d('0x1')](_0xae6d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xae6d('0x3'),_0xae6d('0x4')],'include':[{'model':_0xae6d('0x5'),'as':_0xae6d('0x6'),'attributes':['id',_0xae6d('0x7'),_0xae6d('0x8'),'mailPause']}]},'log':_0xae6d('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 243eb44..a1b1cc5 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 _0xbc48=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','DESC'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0xbc48,0x199));var _0x8bc4=function(_0x1bfe14,_0xd4d4f4){_0x1bfe14=_0x1bfe14-0x0;var _0x44daae=_0xbc48[_0x1bfe14];return _0x44daae;};'use strict';var client=require(_0x8bc4('0x0'));exports[_0x8bc4('0x1')]=function(_0x5c5826){return client[_0x8bc4('0x2')](_0x8bc4('0x3'),{'body':_0x5c5826,'log':'CreateMailQueueReport'});};exports['update']=function(_0x3b79f2,_0x39704c){return client[_0x8bc4('0x2')]('UpdateMailQueueReport',{'body':_0x39704c,'options':{'where':{'uniqueid':_0x3b79f2},'order':[['id',_0x8bc4('0x4')]],'limit':0x1},'log':_0x8bc4('0x5')});}; \ No newline at end of file +var _0x8233=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update','DESC'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x8233,0x7f));var _0x3823=function(_0x4485b2,_0x473572){_0x4485b2=_0x4485b2-0x0;var _0x10a23d=_0x8233[_0x4485b2];return _0x10a23d;};'use strict';var client=require(_0x3823('0x0'));exports[_0x3823('0x1')]=function(_0x5bb9ea){return client[_0x3823('0x2')](_0x3823('0x3'),{'body':_0x5bb9ea,'log':_0x3823('0x3')});};exports[_0x3823('0x4')]=function(_0x1f8443,_0x49f00f){return client['Request']('UpdateMailQueueReport',{'body':_0x49f00f,'options':{'where':{'uniqueid':_0x1f8443},'order':[['id',_0x3823('0x5')]],'limit':0x1},'log':_0x3823('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 17fc94f..4ef8ed4 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 _0xc4f7=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client'];(function(_0x345ffb,_0x38106b){var _0x21f1d1=function(_0x33899b){while(--_0x33899b){_0x345ffb['push'](_0x345ffb['shift']());}};_0x21f1d1(++_0x38106b);}(_0xc4f7,0xdd));var _0x7c4f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4f7[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x7c4f('0x0'));exports['update']=function(_0x3bb3a3,_0x391e7c){return client[_0x7c4f('0x1')](_0x7c4f('0x2'),{'body':_0x391e7c,'options':{'where':{'id':_0x3bb3a3}},'log':_0x7c4f('0x3')});};exports[_0x7c4f('0x4')]=function(_0x36e76b,_0x46540c){return client['Request'](_0x7c4f('0x5'),{'body':_0x46540c,'options':{'where':{'id':_0x36e76b}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xf83f=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x5b3502,_0x35a9d1){var _0x382ab9=function(_0xd8ce99){while(--_0xd8ce99){_0x5b3502['push'](_0x5b3502['shift']());}};_0x382ab9(++_0x35a9d1);}(_0xf83f,0xd3));var _0xff83=function(_0x3354db,_0x17c526){_0x3354db=_0x3354db-0x0;var _0x2d3402=_0xf83f[_0x3354db];return _0x2d3402;};'use strict';var client=require(_0xff83('0x0'));exports['update']=function(_0x519f86,_0x57904a){return client[_0xff83('0x1')](_0xff83('0x2'),{'body':_0x57904a,'options':{'where':{'id':_0x519f86}},'log':_0xff83('0x3')});};exports[_0xff83('0x4')]=function(_0x51e906,_0x24c745){return client[_0xff83('0x1')](_0xff83('0x5'),{'body':_0x24c745,'options':{'where':{'id':_0x51e906}},'log':_0xff83('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d18d605..395c855 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 _0xcdf0=['create'];(function(_0x4f1e54,_0x48d099){var _0x505b73=function(_0x597c61){while(--_0x597c61){_0x4f1e54['push'](_0x4f1e54['shift']());}};_0x505b73(++_0x48d099);}(_0xcdf0,0x165));var _0x0cdf=function(_0x4e9f29,_0x1bbcbf){_0x4e9f29=_0x4e9f29-0x0;var _0x8e1ab3=_0xcdf0[_0x4e9f29];return _0x8e1ab3;};'use strict';var client=require('../client');exports[_0x0cdf('0x0')]=function(_0x134a27){return client['Request']('CreateOpenchannelMessage',{'body':_0x134a27,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x9937=['../client','create','Request','CreateOpenchannelMessage'];(function(_0x216239,_0x5b2418){var _0x275078=function(_0x361015){while(--_0x361015){_0x216239['push'](_0x216239['shift']());}};_0x275078(++_0x5b2418);}(_0x9937,0x1dc));var _0x7993=function(_0x395735,_0x2ff09a){_0x395735=_0x395735-0x0;var _0x2f71ab=_0x9937[_0x395735];return _0x2f71ab;};'use strict';var client=require(_0x7993('0x0'));exports[_0x7993('0x1')]=function(_0x553cf6){return client[_0x7993('0x2')](_0x7993('0x3'),{'body':_0x553cf6,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 51facfc..93d34f2 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 _0x1e52=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','openchannelPause'];(function(_0x127a78,_0x167e62){var _0x2d7dd2=function(_0x58cb0f){while(--_0x58cb0f){_0x127a78['push'](_0x127a78['shift']());}};_0x2d7dd2(++_0x167e62);}(_0x1e52,0x15f));var _0x21e5=function(_0x27c156,_0x14ce9b){_0x27c156=_0x27c156-0x0;var _0x4a94af=_0x1e52[_0x27c156];return _0x4a94af;};'use strict';var client=require(_0x21e5('0x0'));exports[_0x21e5('0x1')]=function(){return function(){return client[_0x21e5('0x2')](_0x21e5('0x3'),{'options':{'raw':![],'attributes':['id',_0x21e5('0x4'),_0x21e5('0x5'),_0x21e5('0x6')],'include':[{'model':_0x21e5('0x7'),'as':'Agents','attributes':['id',_0x21e5('0x4'),'online',_0x21e5('0x8')]}]},'log':_0x21e5('0x1')});};}; \ No newline at end of file +var _0xdb60=['openchannelPause','../client','getOpenchannelQueues','timeout','strategy','User'];(function(_0x1422da,_0x2362eb){var _0x19b5be=function(_0x1b6389){while(--_0x1b6389){_0x1422da['push'](_0x1422da['shift']());}};_0x19b5be(++_0x2362eb);}(_0xdb60,0xfd));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0db6('0x0'));exports[_0x0db6('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x0db6('0x2'),_0x0db6('0x3')],'include':[{'model':_0x0db6('0x4'),'as':'Agents','attributes':['id','name','online',_0x0db6('0x5')]}]},'log':_0x0db6('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b95b9c4..6d17f4d 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 _0x077f=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x2d719c,_0x59b346){var _0x16c7e8=function(_0x2cd5a8){while(--_0x2cd5a8){_0x2d719c['push'](_0x2d719c['shift']());}};_0x16c7e8(++_0x59b346);}(_0x077f,0x64));var _0xf077=function(_0x981486,_0x5e2bf7){_0x981486=_0x981486-0x0;var _0x354ee3=_0x077f[_0x981486];return _0x354ee3;};'use strict';var client=require(_0xf077('0x0'));exports[_0xf077('0x1')]=function(_0x47c81e){return client[_0xf077('0x2')](_0xf077('0x3'),{'body':_0x47c81e,'log':_0xf077('0x3')});};exports['update']=function(_0x205779,_0x1e19fe){return client[_0xf077('0x2')](_0xf077('0x4'),{'body':_0x1e19fe,'options':{'where':{'uniqueid':_0x205779},'order':[['id',_0xf077('0x5')]],'limit':0x1},'log':_0xf077('0x4')});}; \ No newline at end of file +var _0xd136=['update','Request','UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xd136,0x94));var _0x6d13=function(_0x46287c,_0x9a6ba7){_0x46287c=_0x46287c-0x0;var _0x55dfdf=_0xd136[_0x46287c];return _0x55dfdf;};'use strict';var client=require('../client');exports[_0x6d13('0x0')]=function(_0x44e53c){return client['Request'](_0x6d13('0x1'),{'body':_0x44e53c,'log':_0x6d13('0x1')});};exports[_0x6d13('0x2')]=function(_0x2a3702,_0xec09ab){return client[_0x6d13('0x3')](_0x6d13('0x4'),{'body':_0xec09ab,'options':{'where':{'uniqueid':_0x2a3702},'order':[['id',_0x6d13('0x5')]],'limit':0x1},'log':_0x6d13('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 8568f65..d46f94a 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 _0x54da=['Request','../client','UpdateSmsInteraction','addTags'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x54da,0x9d));var _0xa54d=function(_0x57a711,_0x419635){_0x57a711=_0x57a711-0x0;var _0x3e4c01=_0x54da[_0x57a711];return _0x3e4c01;};'use strict';var client=require(_0xa54d('0x0'));exports['update']=function(_0x11791a,_0x4e4b1b){return client['Request'](_0xa54d('0x1'),{'body':_0x4e4b1b,'options':{'where':{'id':_0x11791a}},'log':'updateSmsInteraction'});};exports[_0xa54d('0x2')]=function(_0x280f78,_0x936fe1){return client[_0xa54d('0x3')]('AddTagsToSmsInteraction',{'body':_0x936fe1,'options':{'where':{'id':_0x280f78}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xff3c=['update','Request','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xff3c,0x179));var _0xcff3=function(_0x53abf7,_0x407072){_0x53abf7=_0x53abf7-0x0;var _0x2b72ef=_0xff3c[_0x53abf7];return _0x2b72ef;};'use strict';var client=require(_0xcff3('0x0'));exports[_0xcff3('0x1')]=function(_0x5878ac,_0x1c3482){return client[_0xcff3('0x2')]('UpdateSmsInteraction',{'body':_0x1c3482,'options':{'where':{'id':_0x5878ac}},'log':'updateSmsInteraction'});};exports[_0xcff3('0x3')]=function(_0x17ae92,_0x45c7f6){return client[_0xcff3('0x2')](_0xcff3('0x4'),{'body':_0x45c7f6,'options':{'where':{'id':_0x17ae92}},'log':_0xcff3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e94d9be..009338e 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 _0x33f7=['createSmsMessage','../client','create','Request'];(function(_0x41ba41,_0x145412){var _0x22d385=function(_0x571d2a){while(--_0x571d2a){_0x41ba41['push'](_0x41ba41['shift']());}};_0x22d385(++_0x145412);}(_0x33f7,0x195));var _0x733f=function(_0x21a534,_0x1f8347){_0x21a534=_0x21a534-0x0;var _0x3b9e98=_0x33f7[_0x21a534];return _0x3b9e98;};'use strict';var client=require(_0x733f('0x0'));exports[_0x733f('0x1')]=function(_0xe392f9){return client[_0x733f('0x2')]('CreateSmsMessage',{'body':_0xe392f9,'log':_0x733f('0x3')});}; \ No newline at end of file +var _0xd2fb=['Request','CreateSmsMessage','createSmsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2fb,0x1b9));var _0xbd2f=function(_0x17e0b4,_0x233a66){_0x17e0b4=_0x17e0b4-0x0;var _0x22e3c7=_0xd2fb[_0x17e0b4];return _0x22e3c7;};'use strict';var client=require('../client');exports['create']=function(_0x47dde5){return client[_0xbd2f('0x0')](_0xbd2f('0x1'),{'body':_0x47dde5,'log':_0xbd2f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4983bc1..37edb5e 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0xba07ae,_0xd876a5){var _0x2c5399=function(_0x5b84df){while(--_0x5b84df){_0xba07ae['push'](_0xba07ae['shift']());}};_0x2c5399(++_0xd876a5);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x3b8ea3,_0x2751d7){var _0x30208a=function(_0x477b8e){while(--_0x477b8e){_0x3b8ea3['push'](_0x3b8ea3['shift']());}};_0x30208a(++_0x2751d7);}(_0xe706,0xa3));var _0x6e70=function(_0x59cf8a,_0x163bb9){_0x59cf8a=_0x59cf8a-0x0;var _0x22dde8=_0xe706[_0x59cf8a];return _0x22dde8;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 1f1e3c5..a30f468 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x22f18d,_0x33e49e){var _0x2d837e=function(_0x216fd9){while(--_0x216fd9){_0x22f18d['push'](_0x22f18d['shift']());}};_0x2d837e(++_0x33e49e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4283e1,_0x80344){var _0x201855=function(_0x132623){while(--_0x132623){_0x4283e1['push'](_0x4283e1['shift']());}};_0x201855(++_0x80344);}(_0x70e0,0x17b));var _0x070e=function(_0x324374,_0x2dcbf2){_0x324374=_0x324374-0x0;var _0x5e0996=_0x70e0[_0x324374];return _0x5e0996;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index d3edf0d..6fe7363 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(_0x26c7ba,_0x4d31aa){var _0x194f3f=function(_0x82c157){while(--_0x82c157){_0x26c7ba['push'](_0x26c7ba['shift']());}};_0x194f3f(++_0x4d31aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x3bb39e,_0x2ca25d){var _0x28814f=function(_0x19e5bb){while(--_0x19e5bb){_0x3bb39e['push'](_0x3bb39e['shift']());}};_0x28814f(++_0x2ca25d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 3fe46b2..62c8ad2 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 _0x0650=['UpdateWhatsappInteraction','Request','../client','update'];(function(_0x2b1f93,_0x1c84c5){var _0x55d8e9=function(_0x31ef56){while(--_0x31ef56){_0x2b1f93['push'](_0x2b1f93['shift']());}};_0x55d8e9(++_0x1c84c5);}(_0x0650,0x1aa));var _0x0065=function(_0x25b9a1,_0x3e141b){_0x25b9a1=_0x25b9a1-0x0;var _0x2dff67=_0x0650[_0x25b9a1];return _0x2dff67;};'use strict';var client=require(_0x0065('0x0'));exports[_0x0065('0x1')]=function(_0x22261b,_0x34e760){return client['Request'](_0x0065('0x2'),{'body':_0x34e760,'options':{'where':{'id':_0x22261b}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x1798d6,_0xe2785){return client[_0x0065('0x3')]('AddTagsToWhatsappInteraction',{'body':_0xe2785,'options':{'where':{'id':_0x1798d6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xa6bb=['update','Request','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction'];(function(_0x58a6a7,_0x778223){var _0x55952b=function(_0x471ad4){while(--_0x471ad4){_0x58a6a7['push'](_0x58a6a7['shift']());}};_0x55952b(++_0x778223);}(_0xa6bb,0x12c));var _0xba6b=function(_0x2cd78f,_0x4d94ef){_0x2cd78f=_0x2cd78f-0x0;var _0x34d945=_0xa6bb[_0x2cd78f];return _0x34d945;};'use strict';var client=require('../client');exports[_0xba6b('0x0')]=function(_0x33c1f1,_0x1d13d3){return client[_0xba6b('0x1')](_0xba6b('0x2'),{'body':_0x1d13d3,'options':{'where':{'id':_0x33c1f1}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x5d1f87,_0x17e34b){return client[_0xba6b('0x1')](_0xba6b('0x3'),{'body':_0x17e34b,'options':{'where':{'id':_0x5d1f87}},'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 00dd619..e30f883 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 _0xd142=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0xd142,0x86));var _0x2d14=function(_0x29c2bb,_0x1bde54){_0x29c2bb=_0x29c2bb-0x0;var _0x5446f1=_0xd142[_0x29c2bb];return _0x5446f1;};'use strict';var client=require(_0x2d14('0x0'));exports[_0x2d14('0x1')]=function(_0x2effe6){return client[_0x2d14('0x2')](_0x2d14('0x3'),{'body':_0x2effe6,'log':_0x2d14('0x4')});}; \ No newline at end of file +var _0xc5a1=['Request','createWhatsappMessage','../client','create'];(function(_0x2ecdbe,_0x114206){var _0x44d6d4=function(_0x2e592a){while(--_0x2e592a){_0x2ecdbe['push'](_0x2ecdbe['shift']());}};_0x44d6d4(++_0x114206);}(_0xc5a1,0x1da));var _0x1c5a=function(_0x300a26,_0x1ad864){_0x300a26=_0x300a26-0x0;var _0x43bccd=_0xc5a1[_0x300a26];return _0x43bccd;};'use strict';var client=require(_0x1c5a('0x0'));exports[_0x1c5a('0x1')]=function(_0x5d472c){return client[_0x1c5a('0x2')]('CreateWhatsappMessage',{'body':_0x5d472c,'log':_0x1c5a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 13d34e8..24e202f 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 _0xe78d=['name','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','timeout','strategy','User','Agents'];(function(_0x10bcf4,_0x200e8f){var _0x347b51=function(_0x20855e){while(--_0x20855e){_0x10bcf4['push'](_0x10bcf4['shift']());}};_0x347b51(++_0x200e8f);}(_0xe78d,0xfe));var _0xde78=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xe78d[_0x1fa759];return _0x2da9f4;};'use strict';var client=require(_0xde78('0x0'));exports[_0xde78('0x1')]=function(){return function(){return client['Request'](_0xde78('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xde78('0x3'),_0xde78('0x4')],'include':[{'model':_0xde78('0x5'),'as':_0xde78('0x6'),'attributes':['id',_0xde78('0x7'),'online',_0xde78('0x8')]}]},'log':_0xde78('0x1')});};}; \ No newline at end of file +var _0x9b18=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','Agents'];(function(_0x11fb30,_0x54ab4f){var _0x12e22e=function(_0xbd5bec){while(--_0xbd5bec){_0x11fb30['push'](_0x11fb30['shift']());}};_0x12e22e(++_0x54ab4f);}(_0x9b18,0xeb));var _0x89b1=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x9b18[_0x29ae80];return _0x5d6d71;};'use strict';var client=require(_0x89b1('0x0'));exports[_0x89b1('0x1')]=function(){return function(){return client[_0x89b1('0x2')](_0x89b1('0x3'),{'options':{'raw':![],'attributes':['id',_0x89b1('0x4'),_0x89b1('0x5'),_0x89b1('0x6')],'include':[{'model':'User','as':_0x89b1('0x7'),'attributes':['id',_0x89b1('0x4'),'online',_0x89b1('0x8')]}]},'log':_0x89b1('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index ee1d185..211fa9f 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 _0x4396=['../client','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport'];(function(_0x412ce0,_0x19252c){var _0x37e79b=function(_0x221da3){while(--_0x221da3){_0x412ce0['push'](_0x412ce0['shift']());}};_0x37e79b(++_0x19252c);}(_0x4396,0xf6));var _0x6439=function(_0x52246c,_0x32403f){_0x52246c=_0x52246c-0x0;var _0x3a690c=_0x4396[_0x52246c];return _0x3a690c;};'use strict';var client=require(_0x6439('0x0'));exports['create']=function(_0xfc7f39){return client[_0x6439('0x1')](_0x6439('0x2'),{'body':_0xfc7f39,'log':_0x6439('0x2')});};exports[_0x6439('0x3')]=function(_0x21b73a,_0x50d589){return client[_0x6439('0x1')]('UpdateWhatsappQueueReport',{'body':_0x50d589,'options':{'where':{'uniqueid':_0x21b73a},'order':[['id',_0x6439('0x4')]],'limit':0x1},'log':_0x6439('0x5')});}; \ No newline at end of file +var _0xd67a=['DESC','../client','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x8b4e03,_0x500ba3){var _0x63f1a3=function(_0x2455b5){while(--_0x2455b5){_0x8b4e03['push'](_0x8b4e03['shift']());}};_0x63f1a3(++_0x500ba3);}(_0xd67a,0x15d));var _0xad67=function(_0x429440,_0xe92d7c){_0x429440=_0x429440-0x0;var _0x1a7de6=_0xd67a[_0x429440];return _0x1a7de6;};'use strict';var client=require(_0xad67('0x0'));exports[_0xad67('0x1')]=function(_0x5e008e){return client[_0xad67('0x2')](_0xad67('0x3'),{'body':_0x5e008e,'log':_0xad67('0x3')});};exports['update']=function(_0x35022e,_0x5981c5){return client[_0xad67('0x2')](_0xad67('0x4'),{'body':_0x5981c5,'options':{'where':{'uniqueid':_0x35022e},'order':[['id',_0xad67('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c76ee40..762b2b2 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 _0x0467=['stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','log','[%s][QUEUE]\x20%s'];(function(_0x525ba1,_0x1c4650){var _0x4c82ec=function(_0x4323a8){while(--_0x4323a8){_0x525ba1['push'](_0x525ba1['shift']());}};_0x4c82ec(++_0x1c4650);}(_0x0467,0x198));var _0x7046=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0467[_0x432682];return _0x463d05;};'use strict';var schema=require(_0x7046('0x0'));var _=require(_0x7046('0x1'));var util=require(_0x7046('0x2'));var seqqueue=require(_0x7046('0x3'));var logger=require(_0x7046('0x4'))(_0x7046('0x5'));var strategy=require(_0x7046('0x6'));var queue=schema({'name':{'type':_0x7046('0x7'),'required':!![],'message':_0x7046('0x8')},'timeout':{'type':_0x7046('0x9'),'message':_0x7046('0xa')}});function writeLog(_0x1bd379,_0x357496,_0x2f9188){return logger['info'](util[_0x7046('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x1bd379,_0x357496[_0x7046('0xc')],_0x2f9188));}function handleFindAgent(_0x259c1a){return function(_0x40ce43){return _0x40ce43['name']['toLowerCase']()===_0x259c1a[_0x7046('0xd')]();};}exports[_0x7046('0xe')]=function(_0x541933,_0x4e35f6,_0x32dbf7,_0x13e6a1){return function(_0x38fa7b){try{var _0x55e756={'name':_0x4e35f6[0x0],'timeout':_0x4e35f6[0x1]};var _0x2d5296=queue['validate'](_0x55e756,{'typecast':!![]});if(_0x2d5296['length']){logger[_0x7046('0xf')](_0x7046('0x10'),_0x541933,_[_0x7046('0x11')](_0x2d5296,_0x7046('0x12'))['join'](',\x20'));_0x38fa7b[_0x7046('0x13')]();}else{var _0x87c974=_[_0x7046('0x14')](_0x32dbf7[_0x7046('0x15')],handleFindAgent(_0x55e756[_0x7046('0xc')]));if(_0x87c974){var _0x43d3ab=(_0x55e756[_0x7046('0x16')]||0xa)*0x3e8;var _0x10bfca,_0x2141f6;var _0x407e20=seqqueue[_0x7046('0x17')](_0x43d3ab);_0x407e20['id']=_0x541933;_0x407e20[_0x7046('0x18')]=_0x43d3ab;_0x407e20[_0x7046('0x19')]=_0x13e6a1[_0x7046('0x19')];writeLog(_0x541933,_0x87c974,util[_0x7046('0xb')](_0x7046('0x1a'),_0x43d3ab));_0x32dbf7[_0x7046('0x1b')][_0x541933]['on']('end',function(){logger[_0x7046('0x1c')](_0x7046('0x1d'),_0x541933);clearTimeout(_0x2141f6);_0x2141f6=undefined;_0x407e20['close']();if(_0x32dbf7[_0x7046('0x1b')][_0x541933]){delete _0x32dbf7[_0x7046('0x1b')][_0x541933];}_0x38fa7b[_0x7046('0x13')]();});_0x32dbf7[_0x7046('0x1b')][_0x541933]['on'](_0x7046('0x1e'),function(){if(_0x32dbf7['rules'][_0x541933]){delete _0x32dbf7['rules'][_0x541933];}});_0x2141f6=setTimeout(function(){logger[_0x7046('0x1c')](_0x7046('0x1f'),_0x541933);clearTimeout(_0x2141f6);_0x407e20[_0x7046('0x20')]();_0x38fa7b[_0x7046('0x21')]();},_0x43d3ab);strategy['agent'](_0x407e20,_0x87c974,_0x32dbf7,_0x13e6a1);}else{logger[_0x7046('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x541933,_0x55e756['name']);_0x38fa7b[_0x7046('0x13')]();}}}catch(_0x41482f){console[_0x7046('0x22')](_0x41482f);logger[_0x7046('0xf')](_0x7046('0x23'),_0x541933,_0x41482f[_0x7046('0x24')]);_0x38fa7b[_0x7046('0x13')]();}};}; \ No newline at end of file +var _0x1e0e=['end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','validate','lodash','util','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','stop','agents','timeout','channel','format','START:%s','rules'];(function(_0x116fba,_0x5228df){var _0x27ef7d=function(_0x28a837){while(--_0x28a837){_0x116fba['push'](_0x116fba['shift']());}};_0x27ef7d(++_0x5228df);}(_0x1e0e,0x17b));var _0xe1e0=function(_0x4261ce,_0xb10b58){_0x4261ce=_0x4261ce-0x0;var _0xafffa3=_0x1e0e[_0x4261ce];return _0xafffa3;};'use strict';var schema=require(_0xe1e0('0x0'));var _=require(_0xe1e0('0x1'));var util=require(_0xe1e0('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xe1e0('0x3'))(_0xe1e0('0x4'));var strategy=require(_0xe1e0('0x5'));var queue=schema({'name':{'type':_0xe1e0('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xe1e0('0x7'),'message':_0xe1e0('0x8')}});function writeLog(_0x414453,_0x4dc390,_0x36a8b6){return logger['info'](util['format'](_0xe1e0('0x9'),_0x414453,_0x4dc390[_0xe1e0('0xa')],_0x36a8b6));}function handleFindAgent(_0x1a6fed){return function(_0x5780e7){return _0x5780e7[_0xe1e0('0xa')][_0xe1e0('0xb')]()===_0x1a6fed[_0xe1e0('0xb')]();};}exports['consequence']=function(_0x459b1b,_0x264ca1,_0x31bbb3,_0x262618){return function(_0x4d65e0){try{var _0x10d192={'name':_0x264ca1[0x0],'timeout':_0x264ca1[0x1]};var _0x44b633=queue[_0xe1e0('0x0')](_0x10d192,{'typecast':!![]});if(_0x44b633[_0xe1e0('0xc')]){logger[_0xe1e0('0xd')](_0xe1e0('0xe'),_0x459b1b,_[_0xe1e0('0xf')](_0x44b633,_0xe1e0('0x10'))['join'](',\x20'));_0x4d65e0[_0xe1e0('0x11')]();}else{var _0x3876d7=_['find'](_0x31bbb3[_0xe1e0('0x12')],handleFindAgent(_0x10d192[_0xe1e0('0xa')]));if(_0x3876d7){var _0x575d3b=(_0x10d192[_0xe1e0('0x13')]||0xa)*0x3e8;var _0x544616,_0x194ca8;var _0x5ecdb1=seqqueue['createQueue'](_0x575d3b);_0x5ecdb1['id']=_0x459b1b;_0x5ecdb1['atimeout']=_0x575d3b;_0x5ecdb1[_0xe1e0('0x14')]=_0x262618[_0xe1e0('0x14')];writeLog(_0x459b1b,_0x3876d7,util[_0xe1e0('0x15')](_0xe1e0('0x16'),_0x575d3b));_0x31bbb3[_0xe1e0('0x17')][_0x459b1b]['on'](_0xe1e0('0x18'),function(){logger[_0xe1e0('0x19')](_0xe1e0('0x1a'),_0x459b1b);clearTimeout(_0x194ca8);_0x194ca8=undefined;_0x5ecdb1[_0xe1e0('0x1b')]();if(_0x31bbb3['rules'][_0x459b1b]){delete _0x31bbb3[_0xe1e0('0x17')][_0x459b1b];}_0x4d65e0['stop']();});_0x31bbb3['rules'][_0x459b1b]['on'](_0xe1e0('0x1c'),function(){if(_0x31bbb3[_0xe1e0('0x17')][_0x459b1b]){delete _0x31bbb3[_0xe1e0('0x17')][_0x459b1b];}});_0x194ca8=setTimeout(function(){logger['info'](_0xe1e0('0x1d'),_0x459b1b);clearTimeout(_0x194ca8);_0x5ecdb1[_0xe1e0('0x1b')]();_0x4d65e0[_0xe1e0('0x1e')]();},_0x575d3b);strategy['agent'](_0x5ecdb1,_0x3876d7,_0x31bbb3,_0x262618);}else{logger[_0xe1e0('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x459b1b,_0x10d192[_0xe1e0('0xa')]);_0x4d65e0[_0xe1e0('0x11')]();}}}catch(_0x3f29b4){console['log'](_0x3f29b4);logger['error']('[%s][QUEUE]\x20%s',_0x459b1b,_0x3f29b4['stack']);_0x4d65e0[_0xe1e0('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index c019bf6..ab5dca1 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 _0xdc3f=['dialogState','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','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','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','create','then','catch','stringify','finally','stop','LexRuntime','$LATEST','toString','postText','error','amazonlex','message','providerName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc3f,0x8b));var _0xfdc3=function(_0x561261,_0x1d1de9){_0x561261=_0x561261-0x0;var _0x2b6e44=_0xdc3f[_0x561261];return _0x2b6e44;};'use strict';var _=require(_0xfdc3('0x0'));var moment=require(_0xfdc3('0x1'));var AWS=require('aws-sdk');var utils=require(_0xfdc3('0x2'));var logger=require('../../../../config/logger')(_0xfdc3('0x3'));var rpc={'chatMessage':require(_0xfdc3('0x4')),'openchannelMessage':require(_0xfdc3('0x5')),'mailMessage':require(_0xfdc3('0x6')),'smsMessage':require(_0xfdc3('0x7')),'faxMessage':require(_0xfdc3('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xfdc3('0x9')]=function(_0x2ddb00,_0x593631){return function(_0x14c01d){try{if(!_[_0xfdc3('0xa')](this[_0xfdc3('0xb')][_0xfdc3('0xc')])){logger[_0xfdc3('0xd')](_0xfdc3('0xe'),_0x2ddb00,_0xfdc3('0xf'));return _0x14c01d[_0xfdc3('0x10')]();}var _0x5506a3={'ContactId':this[_0xfdc3('0x11')]['id'],'sentAt':moment()[_0xfdc3('0x12')](_0xfdc3('0x13')),'direction':_0xfdc3('0x14')};if(this[_0xfdc3('0x15')]==='sms'||this[_0xfdc3('0x15')]===_0xfdc3('0x16')){_0x5506a3[_0xfdc3('0x17')]=this[_0xfdc3('0xb')]['phone'];}var _0x47bf01=this[_0xfdc3('0x15')];if(_0x47bf01==='chat'){_0x5506a3[_0xfdc3('0x18')]=this[_0xfdc3('0x19')]['id'];}else{_0x5506a3[_[_0xfdc3('0x1a')](_0x47bf01)+_0xfdc3('0x1b')]=this['account']['id'];}_0x5506a3[_['upperFirst'](_0x47bf01)+'InteractionId']=this[_0xfdc3('0xb')]['id'];if(this['interaction'][_0xfdc3('0x1c')]){var _0x44ffe0=_0x593631[0x4];if(!_[_0xfdc3('0x1d')](_0x44ffe0)){_0x5506a3[_0xfdc3('0x1e')]=utils['getMustacheRender'](_0x44ffe0,this);return rpc[_0x47bf01+'Message'][_0xfdc3('0x1f')](_0x5506a3)[_0xfdc3('0x20')](function(_0x2b8738){logger['info'](_0xfdc3('0xe'),_0x2ddb00,_0x5506a3['body']);})[_0xfdc3('0x21')](function(_0x15edce){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2ddb00,JSON[_0xfdc3('0x22')](_0x15edce));})[_0xfdc3('0x23')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2ddb00);_0x14c01d[_0xfdc3('0x24')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2ddb00);_0x14c01d[_0xfdc3('0x24')]();}}else{var _0x2b2b22=this;var _0x466be9=new AWS[(_0xfdc3('0x25'))]({'accessKeyId':_0x593631[0x0],'secretAccessKey':_0x593631[0x1],'region':_0x593631[0x2]});var _0x3eb8b0={'botAlias':_0xfdc3('0x26'),'botName':_0x593631[0x3],'inputText':this['message'][_0xfdc3('0x1e')],'userId':this['channel']+':'+this['interaction']['id'][_0xfdc3('0x27')]()};_0x466be9[_0xfdc3('0x28')](_0x3eb8b0,function(_0xb47acc,_0x197e06){if(_0xb47acc){logger[_0xfdc3('0x29')](_0xfdc3('0xe'),_0x2ddb00,_0xb47acc['message']);_0x14c01d[_0xfdc3('0x10')]();}else if(_0x197e06&&_0x197e06['message']){_0x2b2b22[_0xfdc3('0x1e')][_0xfdc3('0x2a')]=_0x197e06;_0x5506a3[_0xfdc3('0x1e')]=_0x197e06[_0xfdc3('0x2b')];_0x5506a3[_0xfdc3('0x2c')]=_0xfdc3('0x2a');_0x5506a3['providerResponse']=JSON['stringify'](_0x197e06);return rpc[_0x47bf01+'Message'][_0xfdc3('0x1f')](_0x5506a3)[_0xfdc3('0x20')](function(_0x5cd24e){logger[_0xfdc3('0xd')](_0xfdc3('0xe'),_0x2ddb00,_0x5506a3[_0xfdc3('0x1e')]);if(_0x197e06[_0xfdc3('0x2d')]=='Failed'){_0x14c01d['next']();}else{_0x14c01d[_0xfdc3('0x24')]();}})[_0xfdc3('0x21')](function(_0x591283){logger[_0xfdc3('0x29')](_0xfdc3('0xe'),_0x2ddb00,JSON[_0xfdc3('0x22')](_0x591283));_0x14c01d[_0xfdc3('0x10')]();});}else{_0x14c01d[_0xfdc3('0x10')]();}});}}catch(_0xc928a8){logger[_0xfdc3('0x29')](_0xfdc3('0xe'),_0x2ddb00,JSON[_0xfdc3('0x22')](_0xc928a8));_0x14c01d[_0xfdc3('0x24')]();}};}; \ No newline at end of file +var _0xee66=['toString','postText','error','message','amazonlex','providerName','dialogState','Failed','catch','lodash','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee66,0x1a1));var _0x6ee6=function(_0x308c00,_0x3cbd67){_0x308c00=_0x308c00-0x0;var _0x2b21b2=_0xee66[_0x308c00];return _0x2b21b2;};'use strict';var _=require(_0x6ee6('0x0'));var moment=require('moment');var AWS=require(_0x6ee6('0x1'));var utils=require(_0x6ee6('0x2'));var logger=require(_0x6ee6('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6ee6('0x4')),'mailMessage':require(_0x6ee6('0x5')),'smsMessage':require(_0x6ee6('0x6')),'faxMessage':require(_0x6ee6('0x7')),'whatsappMessage':require(_0x6ee6('0x8'))};exports[_0x6ee6('0x9')]=function(_0x1699a7,_0x31d05c){return function(_0x57eb87){try{if(!_['isNil'](this[_0x6ee6('0xa')][_0x6ee6('0xb')])){logger[_0x6ee6('0xc')](_0x6ee6('0xd'),_0x1699a7,_0x6ee6('0xe'));return _0x57eb87[_0x6ee6('0xf')]();}var _0x56f3d1={'ContactId':this[_0x6ee6('0x10')]['id'],'sentAt':moment()['format'](_0x6ee6('0x11')),'direction':_0x6ee6('0x12')};if(this['channel']===_0x6ee6('0x13')||this['channel']===_0x6ee6('0x14')){_0x56f3d1[_0x6ee6('0x15')]=this[_0x6ee6('0xa')]['phone'];}var _0x147e31=this['channel'];if(_0x147e31===_0x6ee6('0x16')){_0x56f3d1[_0x6ee6('0x17')]=this[_0x6ee6('0x18')]['id'];}else{_0x56f3d1[_[_0x6ee6('0x19')](_0x147e31)+_0x6ee6('0x1a')]=this[_0x6ee6('0x18')]['id'];}_0x56f3d1[_[_0x6ee6('0x19')](_0x147e31)+'InteractionId']=this[_0x6ee6('0xa')]['id'];if(this[_0x6ee6('0xa')][_0x6ee6('0x1b')]){var _0x1084c8=_0x31d05c[0x4];if(!_[_0x6ee6('0x1c')](_0x1084c8)){_0x56f3d1[_0x6ee6('0x1d')]=utils[_0x6ee6('0x1e')](_0x1084c8,this);return rpc[_0x147e31+_0x6ee6('0x1f')][_0x6ee6('0x20')](_0x56f3d1)[_0x6ee6('0x21')](function(_0x603ea){logger['info'](_0x6ee6('0xd'),_0x1699a7,_0x56f3d1[_0x6ee6('0x1d')]);})['catch'](function(_0x3bfdcf){logger['error'](_0x6ee6('0xd'),_0x1699a7,JSON[_0x6ee6('0x22')](_0x3bfdcf));})[_0x6ee6('0x23')](function(){logger[_0x6ee6('0xc')](_0x6ee6('0x24'),_0x1699a7);_0x57eb87[_0x6ee6('0x25')]();});}else{logger[_0x6ee6('0xc')](_0x6ee6('0x26'),_0x1699a7);_0x57eb87[_0x6ee6('0x25')]();}}else{var _0x7a241e=this;var _0xaf9d0=new AWS[(_0x6ee6('0x27'))]({'accessKeyId':_0x31d05c[0x0],'secretAccessKey':_0x31d05c[0x1],'region':_0x31d05c[0x2]});var _0x2e86a4={'botAlias':_0x6ee6('0x28'),'botName':_0x31d05c[0x3],'inputText':this['message'][_0x6ee6('0x1d')],'userId':this[_0x6ee6('0x29')]+':'+this[_0x6ee6('0xa')]['id'][_0x6ee6('0x2a')]()};_0xaf9d0[_0x6ee6('0x2b')](_0x2e86a4,function(_0x535fe7,_0x1ee422){if(_0x535fe7){logger[_0x6ee6('0x2c')](_0x6ee6('0xd'),_0x1699a7,_0x535fe7[_0x6ee6('0x2d')]);_0x57eb87['next']();}else if(_0x1ee422&&_0x1ee422[_0x6ee6('0x2d')]){_0x7a241e[_0x6ee6('0x1d')][_0x6ee6('0x2e')]=_0x1ee422;_0x56f3d1[_0x6ee6('0x1d')]=_0x1ee422[_0x6ee6('0x2d')];_0x56f3d1[_0x6ee6('0x2f')]=_0x6ee6('0x2e');_0x56f3d1['providerResponse']=JSON[_0x6ee6('0x22')](_0x1ee422);return rpc[_0x147e31+_0x6ee6('0x1f')]['create'](_0x56f3d1)[_0x6ee6('0x21')](function(_0x2f59db){logger[_0x6ee6('0xc')](_0x6ee6('0xd'),_0x1699a7,_0x56f3d1[_0x6ee6('0x1d')]);if(_0x1ee422[_0x6ee6('0x30')]==_0x6ee6('0x31')){_0x57eb87['next']();}else{_0x57eb87[_0x6ee6('0x25')]();}})[_0x6ee6('0x32')](function(_0x238100){logger[_0x6ee6('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x1699a7,JSON[_0x6ee6('0x22')](_0x238100));_0x57eb87['next']();});}else{_0x57eb87['next']();}});}}catch(_0x52c587){logger[_0x6ee6('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x1699a7,JSON[_0x6ee6('0x22')](_0x52c587));_0x57eb87[_0x6ee6('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 e44faa2..b147344 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 _0xce3a=['Re:\x20','chat','account','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','','replace','','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','then','stringify','error','finally','resolve','autoreplyExecuted','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','from','message','subject','startsWith','Re:'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xce3a,0x101));var _0xace3=function(_0x299385,_0x42b90b){_0x299385=_0x299385-0x0;var _0x39ce86=_0xce3a[_0x299385];return _0x39ce86;};'use strict';var _=require(_0xace3('0x0'));var moment=require(_0xace3('0x1'));var utils=require(_0xace3('0x2'));var logger=require(_0xace3('0x3'))('routing');var rpc={'chatMessage':require(_0xace3('0x4')),'openchannelMessage':require(_0xace3('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xace3('0x6')),'faxMessage':require(_0xace3('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xace3('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xace3('0x9')),'smsInteraction':require(_0xace3('0xa')),'faxInteraction':require(_0xace3('0xb')),'whatsappInteraction':require(_0xace3('0xc'))};var mailRpc=require(_0xace3('0xd'));exports[_0xace3('0xe')]=function(_0x3c0206,_0x43b5e2,_0x4c29f9,_0x557ccc){return function(_0x2edeb2){try{var _0x11b394=this[_0xace3('0xf')];if(_0x11b394===_0xace3('0x10')&&_0x557ccc[_0xace3('0x11')][_0xace3('0x12')]){logger[_0xace3('0x13')]('[%s][AUTOREPLY]\x20%s',_0x3c0206,_0xace3('0x14'));return _0x2edeb2['next']();}if(_0x43b5e2[0x0]==='1'&&(_[_0xace3('0x15')](this['interaction']['created'])||!this['interaction'][_0xace3('0x16')])){logger[_0xace3('0x13')](_0xace3('0x17'),_0x3c0206,_0xace3('0x18'));return _0x2edeb2[_0xace3('0x19')]();}if(_0x43b5e2[0x0]==='2'&&this[_0xace3('0x1a')]['autoreplyExecuted']){logger['info'](_0xace3('0x1b'),_0x3c0206,_0xace3('0x1c'));return _0x2edeb2[_0xace3('0x19')]();}var _0x40caee={'ContactId':this[_0xace3('0x1d')]['id'],'sentAt':moment()[_0xace3('0x1e')](_0xace3('0x1f')),'direction':_0xace3('0x20')};if(this[_0xace3('0xf')]===_0xace3('0x10')){_0x40caee[_0xace3('0x11')]=utils[_0xace3('0x21')](_0x43b5e2[0x2],this);}else{_0x40caee[_0xace3('0x11')]=utils[_0xace3('0x21')](_0x43b5e2[0x1],this);}if(this['message']){_0x40caee['to']=this['message'][_0xace3('0x22')]||'';if(this[_0xace3('0xf')]==='mail'&&_0x43b5e2[0x1]==='1'){_0x40caee['cc']=this[_0xace3('0x23')]['cc']||'';}_0x40caee[_0xace3('0x22')]=this['message']['to']||'';_0x40caee['phone']=this[_0xace3('0x23')]['phone']||'';_0x40caee['read']=!![];if(this[_0xace3('0x23')][_0xace3('0x24')]){_0x40caee[_0xace3('0x24')]='';_0x40caee[_0xace3('0x24')]+=_[_0xace3('0x25')](this['message']['subject'],_0xace3('0x26'))?'':_0xace3('0x27');_0x40caee[_0xace3('0x24')]+=this[_0xace3('0x23')]['subject'];}}if(this['channel']===_0xace3('0x28')){_0x40caee['ChatWebsiteId']=this[_0xace3('0x29')]['id'];}else{_0x40caee[_['upperFirst'](this[_0xace3('0xf')])+_0xace3('0x2a')]=this[_0xace3('0x29')]['id'];}_0x40caee[_['upperFirst'](this[_0xace3('0xf')])+_0xace3('0x2b')]=this[_0xace3('0x1a')]['id'];var _0x3be1f9=this['interaction'];if(rpc[this[_0xace3('0xf')]+_0xace3('0x2c')]){if(this['channel']===_0xace3('0x10')){var _0x63611={'tls':{'rejectUnauthorized':![]}};if(this[_0xace3('0x29')][_0xace3('0x2d')][_0xace3('0x2e')]){_0x63611[_0xace3('0x2e')]=this[_0xace3('0x29')][_0xace3('0x2d')][_0xace3('0x2e')];}else{_0x63611[_0xace3('0x2f')]=this[_0xace3('0x29')][_0xace3('0x2d')]['host'];_0x63611[_0xace3('0x30')]=this['account'][_0xace3('0x2d')]['port'];_0x63611[_0xace3('0x31')]=this['account']['Smtp']['secure'];}if(this[_0xace3('0x29')][_0xace3('0x2d')][_0xace3('0x32')]){_0x63611['auth']={'user':this[_0xace3('0x29')][_0xace3('0x2d')][_0xace3('0x33')],'pass':this[_0xace3('0x29')][_0xace3('0x2d')][_0xace3('0x34')]};}_0x40caee[_0xace3('0x35')]=this[_0xace3('0x23')]['messageId'];_0x40caee['html']=_0xace3('0x36')+_[_0xace3('0x37')](_0x40caee[_0xace3('0x11')],'','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','Interaction','update','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils'];(function(_0x1c8697,_0x47bb41){var _0x289968=function(_0x40c835){while(--_0x40c835){_0x1c8697['push'](_0x1c8697['shift']());}};_0x289968(++_0x47bb41);}(_0xd373,0x192));var _0x3d37=function(_0x1990ef,_0x995bed){_0x1990ef=_0x1990ef-0x0;var _0x2eda3f=_0xd373[_0x1990ef];return _0x2eda3f;};'use strict';var _=require(_0x3d37('0x0'));var moment=require(_0x3d37('0x1'));var utils=require(_0x3d37('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x3d37('0x3')),'openchannelMessage':require(_0x3d37('0x4')),'mailMessage':require(_0x3d37('0x5')),'smsMessage':require(_0x3d37('0x6')),'faxMessage':require(_0x3d37('0x7')),'whatsappMessage':require(_0x3d37('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3d37('0x9')),'mailInteraction':require(_0x3d37('0xa')),'smsInteraction':require(_0x3d37('0xb')),'faxInteraction':require(_0x3d37('0xc')),'whatsappInteraction':require(_0x3d37('0xd'))};var mailRpc=require(_0x3d37('0xe'));exports[_0x3d37('0xf')]=function(_0x3ff8be,_0x70b07e,_0x51b82d,_0x4ca504){return function(_0x5e1443){try{var _0x243a86=this[_0x3d37('0x10')];if(_0x243a86===_0x3d37('0x11')&&_0x4ca504[_0x3d37('0x12')][_0x3d37('0x13')]){logger[_0x3d37('0x14')](_0x3d37('0x15'),_0x3ff8be,_0x3d37('0x16'));return _0x5e1443[_0x3d37('0x17')]();}if(_0x70b07e[0x0]==='1'&&(_['isNil'](this['interaction']['created'])||!this[_0x3d37('0x18')][_0x3d37('0x19')])){logger[_0x3d37('0x14')](_0x3d37('0x15'),_0x3ff8be,_0x3d37('0x1a'));return _0x5e1443['next']();}if(_0x70b07e[0x0]==='2'&&this['interaction'][_0x3d37('0x1b')]){logger[_0x3d37('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3ff8be,_0x3d37('0x1c'));return _0x5e1443[_0x3d37('0x17')]();}var _0x39af56={'ContactId':this[_0x3d37('0x1d')]['id'],'sentAt':moment()[_0x3d37('0x1e')](_0x3d37('0x1f')),'direction':_0x3d37('0x20')};if(this[_0x3d37('0x10')]===_0x3d37('0x11')){_0x39af56[_0x3d37('0x12')]=utils['getMustacheRender'](_0x70b07e[0x2],this);}else{_0x39af56[_0x3d37('0x12')]=utils[_0x3d37('0x21')](_0x70b07e[0x1],this);}if(this[_0x3d37('0x22')]){_0x39af56['to']=this[_0x3d37('0x22')][_0x3d37('0x23')]||'';if(this[_0x3d37('0x10')]===_0x3d37('0x11')&&_0x70b07e[0x1]==='1'){_0x39af56['cc']=this['message']['cc']||'';}_0x39af56['from']=this[_0x3d37('0x22')]['to']||'';_0x39af56['phone']=this['message'][_0x3d37('0x24')]||'';_0x39af56[_0x3d37('0x25')]=!![];if(this[_0x3d37('0x22')][_0x3d37('0x26')]){_0x39af56[_0x3d37('0x26')]='';_0x39af56[_0x3d37('0x26')]+=_[_0x3d37('0x27')](this[_0x3d37('0x22')]['subject'],_0x3d37('0x28'))?'':_0x3d37('0x29');_0x39af56['subject']+=this['message'][_0x3d37('0x26')];}}if(this[_0x3d37('0x10')]===_0x3d37('0x2a')){_0x39af56[_0x3d37('0x2b')]=this[_0x3d37('0x2c')]['id'];}else{_0x39af56[_[_0x3d37('0x2d')](this['channel'])+_0x3d37('0x2e')]=this[_0x3d37('0x2c')]['id'];}_0x39af56[_[_0x3d37('0x2d')](this[_0x3d37('0x10')])+_0x3d37('0x2f')]=this[_0x3d37('0x18')]['id'];var _0x3ac9b8=this['interaction'];if(rpc[this['channel']+_0x3d37('0x30')]){if(this[_0x3d37('0x10')]===_0x3d37('0x11')){var _0x1bc58b={'tls':{'rejectUnauthorized':![]}};if(this[_0x3d37('0x2c')][_0x3d37('0x31')][_0x3d37('0x32')]){_0x1bc58b[_0x3d37('0x32')]=this[_0x3d37('0x2c')][_0x3d37('0x31')][_0x3d37('0x32')];}else{_0x1bc58b[_0x3d37('0x33')]=this[_0x3d37('0x2c')]['Smtp'][_0x3d37('0x33')];_0x1bc58b[_0x3d37('0x34')]=this[_0x3d37('0x2c')][_0x3d37('0x31')][_0x3d37('0x34')];_0x1bc58b['secure']=this['account'][_0x3d37('0x31')][_0x3d37('0x35')];}if(this[_0x3d37('0x2c')][_0x3d37('0x31')][_0x3d37('0x36')]){_0x1bc58b[_0x3d37('0x37')]={'user':this[_0x3d37('0x2c')][_0x3d37('0x31')]['user'],'pass':this['account']['Smtp']['pass']};}_0x39af56[_0x3d37('0x38')]=this[_0x3d37('0x22')][_0x3d37('0x39')];_0x39af56[_0x3d37('0x3a')]=_0x3d37('0x3b')+_[_0x3d37('0x3c')](_0x39af56[_0x3d37('0x12')],_0x3d37('0x3d'),_0x3d37('0x3e'))+_0x3d37('0x3f');_0x39af56[_0x3d37('0x40')]={'Auto-Submitted':_0x3d37('0x41'),'X-Auto-Response-Suppress':_0x3d37('0x42'),'Precedence':_0x3d37('0x43')};return mailRpc[_0x3d37('0x44')](_0x1bc58b,_0x39af56)[_0x3d37('0x45')](function(_0x64ce6e){logger[_0x3d37('0x14')](_0x3d37('0x46'),_0x3ff8be);_0x39af56[_0x3d37('0x39')]=_0x64ce6e[_0x3d37('0x22')][_0x3d37('0x39')];return rpc[_0x243a86+_0x3d37('0x30')][_0x3d37('0x47')](_0x39af56);})[_0x3d37('0x45')](function(_0x247f11){logger[_0x3d37('0x14')](_0x3d37('0x15'),_0x3ff8be,JSON['stringify'](_0x247f11));})[_0x3d37('0x48')](function(_0x57ea40){logger[_0x3d37('0x49')](_0x3d37('0x4a'),_0x3ff8be,JSON[_0x3d37('0x4b')](_0x57ea40));})[_0x3d37('0x4c')](function(){Promise['resolve']()[_0x3d37('0x45')](function(){if(_0x70b07e[0x0]!=='2'||_0x3ac9b8[_0x3d37('0x1b')])return;return rpc[_0x243a86+_0x3d37('0x4d')][_0x3d37('0x4e')](_0x3ac9b8['id'],{'autoreplyExecuted':!![]})[_0x3d37('0x45')](function(_0x29c4ea){logger[_0x3d37('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3ff8be,JSON[_0x3d37('0x4b')](_0x29c4ea));})[_0x3d37('0x48')](function(_0x221b25){logger[_0x3d37('0x49')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3ff8be,JSON[_0x3d37('0x4b')](_0x221b25));});})[_0x3d37('0x45')](function(){_0x5e1443[_0x3d37('0x17')]();});});}else{return rpc[this[_0x3d37('0x10')]+_0x3d37('0x30')][_0x3d37('0x47')](_0x39af56)[_0x3d37('0x45')](function(_0x7dc507){logger[_0x3d37('0x14')](_0x3d37('0x15'),_0x3ff8be,_0x39af56[_0x3d37('0x12')]);})[_0x3d37('0x48')](function(_0x26af28){logger[_0x3d37('0x49')]('[%s][AUTOREPLY]\x20%s',_0x3ff8be,JSON[_0x3d37('0x4b')](_0x26af28));})['finally'](function(){Promise[_0x3d37('0x4f')]()[_0x3d37('0x45')](function(){if(_0x70b07e[0x0]!=='2'||_0x3ac9b8[_0x3d37('0x1b')])return;return rpc[_0x243a86+_0x3d37('0x4d')][_0x3d37('0x4e')](_0x3ac9b8['id'],{'autoreplyExecuted':!![]})[_0x3d37('0x45')](function(_0x4638d1){logger[_0x3d37('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3ff8be,JSON['stringify'](_0x4638d1));})[_0x3d37('0x48')](function(_0x41bcf0){logger[_0x3d37('0x49')](_0x3d37('0x50'),_0x3ff8be,JSON[_0x3d37('0x4b')](_0x41bcf0));});})['then'](function(){_0x5e1443[_0x3d37('0x17')]();});});}}}catch(_0x13a87e){logger[_0x3d37('0x49')]('[%s][AUTOREPLY]\x20%s',_0x3ff8be,JSON[_0x3d37('0x4b')](_0x13a87e));_0x5e1443['stop']();}};}; \ 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 8ea7a5d..a0e61b4 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 _0xb432=['stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','format','system','Interaction','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x171ac7,_0x339c8d){var _0x94478d=function(_0xedf6e6){while(--_0xedf6e6){_0x171ac7['push'](_0x171ac7['shift']());}};_0x94478d(++_0x339c8d);}(_0xb432,0x17b));var _0x2b43=function(_0x307b51,_0x35d5b3){_0x307b51=_0x307b51-0x0;var _0x38d4a6=_0xb432[_0x307b51];return _0x38d4a6;};'use strict';var moment=require(_0x2b43('0x0'));var logger=require(_0x2b43('0x1'))(_0x2b43('0x2'));var rpc={'chatInteraction':require(_0x2b43('0x3')),'openchannelInteraction':require(_0x2b43('0x4')),'smsInteraction':require(_0x2b43('0x5')),'mailInteraction':require(_0x2b43('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2b43('0x7'))};exports[_0x2b43('0x8')]=function(_0xaa1202,_0x57c669,_0x10febf,_0x41cc89){return function(_0x49ab06){try{logger[_0x2b43('0x9')]('[%s][CLOSE]\x20reason\x20%s',_0xaa1202,_0x57c669[0x0]);var _0x1536da={'closed':0x1,'closedAt':moment()[_0x2b43('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x2b43('0xb'),'disposition':_0x57c669[0x0]};if(rpc[_0x41cc89['channel']+_0x2b43('0xc')]){rpc[_0x41cc89[_0x2b43('0xd')]+'Interaction'][_0x2b43('0xe')](_0x41cc89['interaction']['id'],_0x1536da)[_0x2b43('0xf')](function(_0x279085){logger[_0x2b43('0x9')](_0x2b43('0x10'),_0xaa1202,_0x41cc89['interaction']['id']);})['catch'](function(_0x31bbe){logger[_0x2b43('0x11')](_0x2b43('0x12'),_0xaa1202,JSON[_0x2b43('0x13')](_0x31bbe));})['finally'](function(){_0x49ab06[_0x2b43('0x14')]();});}}catch(_0x3991f4){logger['error']('[%s][CLOSE]\x20%s',_0xaa1202,JSON[_0x2b43('0x13')](_0x3991f4));_0x49ab06[_0x2b43('0x14')]();}};}; \ No newline at end of file +var _0xb1cf=['channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x2d2079,_0x10d52f){var _0x5ed14b=function(_0x584d92){while(--_0x584d92){_0x2d2079['push'](_0x2d2079['shift']());}};_0x5ed14b(++_0x10d52f);}(_0xb1cf,0xeb));var _0xfb1c=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0xb1cf[_0x2b1bb9];return _0x59f401;};'use strict';var moment=require(_0xfb1c('0x0'));var logger=require(_0xfb1c('0x1'))(_0xfb1c('0x2'));var rpc={'chatInteraction':require(_0xfb1c('0x3')),'openchannelInteraction':require(_0xfb1c('0x4')),'smsInteraction':require(_0xfb1c('0x5')),'mailInteraction':require(_0xfb1c('0x6')),'faxInteraction':require(_0xfb1c('0x7')),'whatsappInteraction':require(_0xfb1c('0x8'))};exports[_0xfb1c('0x9')]=function(_0x312857,_0x58017f,_0x5bd3f0,_0x503a8c){return function(_0x4ba88c){try{logger[_0xfb1c('0xa')](_0xfb1c('0xb'),_0x312857,_0x58017f[0x0]);var _0x948254={'closed':0x1,'closedAt':moment()[_0xfb1c('0xc')](_0xfb1c('0xd')),'closeReason':_0xfb1c('0xe'),'disposition':_0x58017f[0x0]};if(rpc[_0x503a8c[_0xfb1c('0xf')]+'Interaction']){rpc[_0x503a8c[_0xfb1c('0xf')]+_0xfb1c('0x10')][_0xfb1c('0x11')](_0x503a8c[_0xfb1c('0x12')]['id'],_0x948254)['then'](function(_0x2050db){logger[_0xfb1c('0xa')](_0xfb1c('0x13'),_0x312857,_0x503a8c[_0xfb1c('0x12')]['id']);})['catch'](function(_0x51173b){logger[_0xfb1c('0x14')](_0xfb1c('0x15'),_0x312857,JSON[_0xfb1c('0x16')](_0x51173b));})[_0xfb1c('0x17')](function(){_0x4ba88c[_0xfb1c('0x18')]();});}}catch(_0x5ed669){logger[_0xfb1c('0x14')](_0xfb1c('0x15'),_0x312857,JSON[_0xfb1c('0x16')](_0x5ed669));_0x4ba88c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index b35fc26..84c0d09 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 _0x31f0=['interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','then','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','result','speech','providerName','metadata','endConversation','message','lodash','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x31f0,0xb7));var _0x031f=function(_0x146d0e,_0x234c83){_0x146d0e=_0x146d0e-0x0;var _0x3435f7=_0x31f0[_0x146d0e];return _0x3435f7;};'use strict';var _=require(_0x031f('0x0'));var moment=require('moment');var apiai=require(_0x031f('0x1'));var md5=require('md5');var utils=require(_0x031f('0x2'));var logger=require(_0x031f('0x3'))(_0x031f('0x4'));var rpc={'chatMessage':require(_0x031f('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x031f('0x6')),'smsMessage':require(_0x031f('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x3dc98e,_0x487e65){return function(_0x365f59){try{if(!_[_0x031f('0x8')](this[_0x031f('0x9')][_0x031f('0xa')])){logger['info'](_0x031f('0xb'),_0x3dc98e,_0x031f('0xc'));return _0x365f59[_0x031f('0xd')]();}var _0x439940={'ContactId':this[_0x031f('0xe')]['id'],'sentAt':moment()[_0x031f('0xf')](_0x031f('0x10')),'direction':_0x031f('0x11')};if(this['channel']===_0x031f('0x12')||this[_0x031f('0x13')]===_0x031f('0x14')){_0x439940[_0x031f('0x15')]=this[_0x031f('0x9')][_0x031f('0x15')];}var _0x1c230d=this['channel'];if(_0x1c230d===_0x031f('0x16')){_0x439940[_0x031f('0x17')]=this[_0x031f('0x18')]['id'];}else{_0x439940[_[_0x031f('0x19')](_0x1c230d)+_0x031f('0x1a')]=this['account']['id'];}_0x439940[_['upperFirst'](_0x1c230d)+_0x031f('0x1b')]=this[_0x031f('0x9')]['id'];if(this[_0x031f('0x9')][_0x031f('0x1c')]){var _0x5196b1=_0x487e65[0x2];if(!_[_0x031f('0x1d')](_0x5196b1)){_0x439940[_0x031f('0x1e')]=utils['getMustacheRender'](_0x5196b1,this);return rpc[_0x1c230d+_0x031f('0x1f')]['create'](_0x439940)[_0x031f('0x20')](function(_0x5f2199){logger[_0x031f('0x21')](_0x031f('0xb'),_0x3dc98e,_0x439940[_0x031f('0x1e')]);})[_0x031f('0x22')](function(_0x1b76d6){logger[_0x031f('0x23')](_0x031f('0xb'),_0x3dc98e,JSON[_0x031f('0x24')](_0x1b76d6));})[_0x031f('0x25')](function(){logger['info'](_0x031f('0x26'),_0x3dc98e);_0x365f59[_0x031f('0x27')]();});}else{logger[_0x031f('0x21')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3dc98e);_0x365f59['stop']();}}else{var _0xa11a2b=this;var _0x4d0f92=apiai(_0x487e65[0x0],{'language':_0x487e65[0x1]||'en'});return _0x4d0f92[_0x031f('0x28')](this['message']['body'],{'sessionId':md5(this['interaction']['id'])})[_0x031f('0x20')](function(_0x12c406){_0xa11a2b[_0x031f('0x1e')][_0x031f('0x29')]=_0x12c406;_0x439940['body']=_0x12c406[_0x031f('0x2a')]['fulfillment'][_0x031f('0x2b')];_0x439940[_0x031f('0x2c')]=_0x031f('0x29');_0x439940['providerResponse']=JSON[_0x031f('0x24')](_0x12c406);return rpc[_0x1c230d+_0x031f('0x1f')]['create'](_0x439940)[_0x031f('0x20')](function(_0x28a617){logger[_0x031f('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x3dc98e,_0x439940[_0x031f('0x1e')]);if(_0x12c406[_0x031f('0x2a')][_0x031f('0x2d')][_0x031f('0x2e')]){_0x365f59[_0x031f('0xd')]();}else{_0x365f59[_0x031f('0x27')]();}})['catch'](function(_0x1f62eb){logger[_0x031f('0x23')](_0x031f('0xb'),_0x3dc98e,JSON[_0x031f('0x24')](_0x1f62eb));_0x365f59[_0x031f('0xd')]();});})[_0x031f('0x22')](function(_0x378692){logger[_0x031f('0x23')](_0x031f('0xb'),_0x3dc98e,_0x378692[_0x031f('0x2f')]);_0x365f59[_0x031f('0xd')]();});}}catch(_0x5ec564){logger[_0x031f('0x23')](_0x031f('0xb'),_0x3dc98e,JSON[_0x031f('0x24')](_0x5ec564));_0x365f59[_0x031f('0x27')]();}};}; \ No newline at end of file +var _0xba18=['sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','info','catch','error','stringify','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','providerName','create','metadata','endConversation','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var moment=require(_0x8ba1('0x1'));var apiai=require(_0x8ba1('0x2'));var md5=require(_0x8ba1('0x3'));var utils=require(_0x8ba1('0x4'));var logger=require(_0x8ba1('0x5'))(_0x8ba1('0x6'));var rpc={'chatMessage':require(_0x8ba1('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8ba1('0x8')),'smsMessage':require(_0x8ba1('0x9')),'faxMessage':require(_0x8ba1('0xa')),'whatsappMessage':require(_0x8ba1('0xb'))};exports[_0x8ba1('0xc')]=function(_0x2ffa15,_0x51a988){return function(_0x3a87eb){try{if(!_[_0x8ba1('0xd')](this['interaction']['UserId'])){logger['info'](_0x8ba1('0xe'),_0x2ffa15,_0x8ba1('0xf'));return _0x3a87eb['next']();}var _0x457158={'ContactId':this[_0x8ba1('0x10')]['id'],'sentAt':moment()[_0x8ba1('0x11')](_0x8ba1('0x12')),'direction':_0x8ba1('0x13')};if(this['channel']===_0x8ba1('0x14')||this[_0x8ba1('0x15')]===_0x8ba1('0x16')){_0x457158[_0x8ba1('0x17')]=this[_0x8ba1('0x18')][_0x8ba1('0x17')];}var _0x58e32b=this[_0x8ba1('0x15')];if(_0x58e32b===_0x8ba1('0x19')){_0x457158[_0x8ba1('0x1a')]=this[_0x8ba1('0x1b')]['id'];}else{_0x457158[_['upperFirst'](_0x58e32b)+'AccountId']=this['account']['id'];}_0x457158[_[_0x8ba1('0x1c')](_0x58e32b)+_0x8ba1('0x1d')]=this[_0x8ba1('0x18')]['id'];if(this[_0x8ba1('0x18')][_0x8ba1('0x1e')]){var _0x3880aa=_0x51a988[0x2];if(!_[_0x8ba1('0x1f')](_0x3880aa)){_0x457158[_0x8ba1('0x20')]=utils[_0x8ba1('0x21')](_0x3880aa,this);return rpc[_0x58e32b+_0x8ba1('0x22')]['create'](_0x457158)['then'](function(_0x1a48fa){logger[_0x8ba1('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x2ffa15,_0x457158[_0x8ba1('0x20')]);})[_0x8ba1('0x24')](function(_0x3fadfc){logger[_0x8ba1('0x25')](_0x8ba1('0xe'),_0x2ffa15,JSON[_0x8ba1('0x26')](_0x3fadfc));})['finally'](function(){logger[_0x8ba1('0x23')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2ffa15);_0x3a87eb[_0x8ba1('0x27')]();});}else{logger[_0x8ba1('0x23')](_0x8ba1('0x28'),_0x2ffa15);_0x3a87eb[_0x8ba1('0x27')]();}}else{var _0x4e66e1=this;var _0x1d619c=apiai(_0x51a988[0x0],{'language':_0x51a988[0x1]||'en'});return _0x1d619c[_0x8ba1('0x29')](this[_0x8ba1('0x2a')][_0x8ba1('0x20')],{'sessionId':md5(this[_0x8ba1('0x18')]['id'])})[_0x8ba1('0x2b')](function(_0x845108){_0x4e66e1[_0x8ba1('0x20')][_0x8ba1('0x2c')]=_0x845108;_0x457158[_0x8ba1('0x20')]=_0x845108[_0x8ba1('0x2d')]['fulfillment']['speech'];_0x457158[_0x8ba1('0x2e')]=_0x8ba1('0x2c');_0x457158['providerResponse']=JSON[_0x8ba1('0x26')](_0x845108);return rpc[_0x58e32b+_0x8ba1('0x22')][_0x8ba1('0x2f')](_0x457158)[_0x8ba1('0x2b')](function(_0x15e419){logger[_0x8ba1('0x23')](_0x8ba1('0xe'),_0x2ffa15,_0x457158[_0x8ba1('0x20')]);if(_0x845108[_0x8ba1('0x2d')][_0x8ba1('0x30')][_0x8ba1('0x31')]){_0x3a87eb[_0x8ba1('0x32')]();}else{_0x3a87eb[_0x8ba1('0x27')]();}})[_0x8ba1('0x24')](function(_0x5e28b7){logger[_0x8ba1('0x25')](_0x8ba1('0xe'),_0x2ffa15,JSON[_0x8ba1('0x26')](_0x5e28b7));_0x3a87eb[_0x8ba1('0x32')]();});})[_0x8ba1('0x24')](function(_0x24bf95){logger['error'](_0x8ba1('0xe'),_0x2ffa15,_0x24bf95[_0x8ba1('0x2a')]);_0x3a87eb['next']();});}}catch(_0x1015c8){logger['error'](_0x8ba1('0xe'),_0x2ffa15,JSON[_0x8ba1('0x26')](_0x1015c8));_0x3a87eb['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 793c88d..c3a90f2 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 _0xeb54=['UserId','info','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','end_conversation','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','stringify','fulfillmentText','push','lodash','md5','moment','bluebird','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','isNil'];(function(_0x173eff,_0x55a7d0){var _0x119fbd=function(_0x31a223){while(--_0x31a223){_0x173eff['push'](_0x173eff['shift']());}};_0x119fbd(++_0x55a7d0);}(_0xeb54,0xfa));var _0x4eb5=function(_0x232e36,_0x40652a){_0x232e36=_0x232e36-0x0;var _0x44461e=_0xeb54[_0x232e36];return _0x44461e;};'use strict';var _=require(_0x4eb5('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x4eb5('0x1'));var moment=require(_0x4eb5('0x2'));var Promise=require(_0x4eb5('0x3'));var logger=require(_0x4eb5('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4eb5('0x5')),'mailMessage':require(_0x4eb5('0x6')),'smsMessage':require(_0x4eb5('0x7')),'faxMessage':require(_0x4eb5('0x8')),'whatsappMessage':require(_0x4eb5('0x9'))};function createMessage(_0x5dac61,_0x8207ef,_0x115dbc,_0x34ca31){return new Promise(function(_0x2dafae,_0xefb886){var _0x1ec6a2=_[_0x4eb5('0xa')](_0x115dbc);_0x1ec6a2[_0x4eb5('0xb')]=_0x34ca31;return rpc[_0x8207ef+_0x4eb5('0xc')][_0x4eb5('0xd')](_0x1ec6a2)[_0x4eb5('0xe')](function(){logger['info'](_0x4eb5('0xf'),_0x5dac61,_0x1ec6a2[_0x4eb5('0xb')]);_0x2dafae();})[_0x4eb5('0x10')](function(_0x4f2115){logger['error'](_0x4eb5('0xf'),_0x5dac61,JSON['stringify'](_0x4f2115));_0xefb886(_0x4f2115);});});}exports['consequence']=function(_0x2b0ab0,_0x5d2dcf){return function(_0x567009){try{if(!_[_0x4eb5('0x11')](this['interaction'][_0x4eb5('0x12')])){logger[_0x4eb5('0x13')](_0x4eb5('0xf'),_0x2b0ab0,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x567009[_0x4eb5('0x14')]();}var _0x5f3918={'ContactId':this['contact']['id'],'sentAt':moment()[_0x4eb5('0x15')](_0x4eb5('0x16')),'direction':_0x4eb5('0x17')};if(this[_0x4eb5('0x18')]===_0x4eb5('0x19')||this[_0x4eb5('0x18')]===_0x4eb5('0x1a')){_0x5f3918[_0x4eb5('0x1b')]=this[_0x4eb5('0x1c')][_0x4eb5('0x1b')];}var _0x3fa7cb=this[_0x4eb5('0x18')];if(_0x3fa7cb==='chat'){_0x5f3918[_0x4eb5('0x1d')]=this[_0x4eb5('0x1e')]['id'];}else{_0x5f3918[_[_0x4eb5('0x1f')](_0x3fa7cb)+_0x4eb5('0x20')]=this[_0x4eb5('0x1e')]['id'];}_0x5f3918[_[_0x4eb5('0x1f')](_0x3fa7cb)+_0x4eb5('0x21')]=this['interaction']['id'];if(this[_0x4eb5('0x1c')][_0x4eb5('0x22')]){var _0x4e01b6=_0x5d2dcf[0x4];if(!_[_0x4eb5('0x23')](_0x4e01b6)){_0x5f3918['body']=utils[_0x4eb5('0x24')](_0x4e01b6,this);return rpc[_0x3fa7cb+_0x4eb5('0xc')][_0x4eb5('0xd')](_0x5f3918)['then'](function(_0x453fa1){logger[_0x4eb5('0x13')](_0x4eb5('0xf'),_0x2b0ab0,_0x5f3918[_0x4eb5('0xb')]);})[_0x4eb5('0x10')](function(_0x19fdad){logger[_0x4eb5('0x25')](_0x4eb5('0xf'),_0x2b0ab0,JSON['stringify'](_0x19fdad));})[_0x4eb5('0x26')](function(){logger['info'](_0x4eb5('0x27'),_0x2b0ab0);_0x567009[_0x4eb5('0x28')]();});}else{logger[_0x4eb5('0x13')](_0x4eb5('0x29'),_0x2b0ab0);_0x567009['stop']();}}else{var _0x3374ca=this;var _0x550302=_0x5d2dcf[0x2]['replace'](/\\n/g,'\x0a');var _0x332aea={'credentials':{'private_key':_0x550302,'client_email':_0x5d2dcf[0x1]}};var _0x1b4954=new dialogflow[(_0x4eb5('0x2a'))](_0x332aea);var _0x24a95a=_0x1b4954[_0x4eb5('0x2b')](_0x5d2dcf[0x0],md5(_0x3374ca[_0x4eb5('0x1c')]['id']));var _0x3e3282={'session':_0x24a95a,'queryInput':{'text':{'text':_0x3374ca[_0x4eb5('0x2c')][_0x4eb5('0xb')],'languageCode':_0x5d2dcf[0x3]||'en'}}};return _0x1b4954[_0x4eb5('0x2d')](_0x3e3282)['then'](function(_0x49d497){if(_0x49d497&&_0x49d497[_0x4eb5('0x2e')]){_0x3374ca[_0x4eb5('0xb')][_0x4eb5('0x2f')]=_0x49d497;var _0x15d06d=_0x49d497[0x0];var _0x5ede0c=_0x15d06d['queryResult'][_0x4eb5('0x30')]&&_0x15d06d[_0x4eb5('0x31')][_0x4eb5('0x30')]['fields']?_0x15d06d['queryResult']['diagnosticInfo']['fields'][_0x4eb5('0x32')][_0x4eb5('0x33')]:![];_0x3374ca[_0x4eb5('0xb')][_0x4eb5('0x34')]=_0x15d06d['queryResult']['action'];_0x3374ca[_0x4eb5('0xb')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x15d06d[_0x4eb5('0x31')][_0x4eb5('0x35')];_0x3374ca[_0x4eb5('0xb')][_0x4eb5('0x36')]=_0x15d06d[_0x4eb5('0x31')][_0x4eb5('0x30')]&&_0x15d06d[_0x4eb5('0x31')]['diagnosticInfo'][_0x4eb5('0x37')]?_0x15d06d[_0x4eb5('0x31')][_0x4eb5('0x30')]['fields']['end_conversation']['boolValue']:![];_0x3374ca[_0x4eb5('0xb')][_0x4eb5('0x38')]=_0x15d06d[_0x4eb5('0x31')][_0x4eb5('0x39')]['name'];_0x3374ca[_0x4eb5('0xb')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x15d06d[_0x4eb5('0x31')]['intent'][_0x4eb5('0x3a')];_0x3374ca['body'][_0x4eb5('0x3b')]=_0x15d06d['queryResult'][_0x4eb5('0x39')]['isFallback'];_0x3374ca[_0x4eb5('0xb')]['DIALOGFLOWV2_LANGUAGECODE']=_0x15d06d[_0x4eb5('0x31')][_0x4eb5('0x3c')];_0x3374ca[_0x4eb5('0xb')]['DIALOGFLOWV2_QUERYTEXT']=_0x15d06d[_0x4eb5('0x31')]['queryText'];_0x3374ca[_0x4eb5('0xb')][_0x4eb5('0x3d')]=_0x15d06d['queryResult'][_0x4eb5('0x3e')];_0x5f3918[_0x4eb5('0x3f')]='dialogflowV2';_0x5f3918['providerResponse']=JSON[_0x4eb5('0x40')](_0x49d497);var _0x5053d2=[];for(var _0x1423b5=0x0;_0x1423b5<_0x49d497[_0x4eb5('0x2e')];_0x1423b5++){var _0x46cedd=_0x49d497[_0x1423b5];if(_0x46cedd&&_0x46cedd[_0x4eb5('0x31')]&&_0x46cedd[_0x4eb5('0x31')][_0x4eb5('0x41')]){_0x5053d2[_0x4eb5('0x42')](createMessage(_0x2b0ab0,_0x3fa7cb,_0x5f3918,_0x46cedd[_0x4eb5('0x31')][_0x4eb5('0x41')]));}}return Promise['all'](_0x5053d2)[_0x4eb5('0xe')](function(){if(_0x5ede0c){_0x567009[_0x4eb5('0x14')]();}else{_0x567009[_0x4eb5('0x28')]();}})[_0x4eb5('0x10')](function(_0x4d47e1){logger[_0x4eb5('0x25')](_0x4eb5('0xf'),_0x2b0ab0,JSON[_0x4eb5('0x40')](_0x4d47e1));_0x567009[_0x4eb5('0x14')]();});}})[_0x4eb5('0x10')](function(_0x26541c){logger[_0x4eb5('0x25')](_0x4eb5('0xf'),_0x2b0ab0,_0x26541c[_0x4eb5('0x2c')]);_0x567009[_0x4eb5('0x14')]();});}}catch(_0x4e4972){logger[_0x4eb5('0x25')](_0x4eb5('0xf'),_0x2b0ab0,JSON[_0x4eb5('0x40')](_0x4e4972));_0x567009['stop']();}};}; \ No newline at end of file +var _0x5e39=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20%s','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','dialogflowV2','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','next','message','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','catch','error','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat'];(function(_0x35ebbb,_0xe862ef){var _0x29d9b=function(_0x4fee98){while(--_0x4fee98){_0x35ebbb['push'](_0x35ebbb['shift']());}};_0x29d9b(++_0xe862ef);}(_0x5e39,0xbb));var _0x95e3=function(_0x11c1d0,_0x53eced){_0x11c1d0=_0x11c1d0-0x0;var _0x4ad50f=_0x5e39[_0x11c1d0];return _0x4ad50f;};'use strict';var _=require(_0x95e3('0x0'));var dialogflow=require(_0x95e3('0x1'));var md5=require(_0x95e3('0x2'));var moment=require('moment');var Promise=require(_0x95e3('0x3'));var logger=require(_0x95e3('0x4'))(_0x95e3('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x95e3('0x6')),'openchannelMessage':require(_0x95e3('0x7')),'mailMessage':require(_0x95e3('0x8')),'smsMessage':require(_0x95e3('0x9')),'faxMessage':require(_0x95e3('0xa')),'whatsappMessage':require(_0x95e3('0xb'))};function createMessage(_0x17eabd,_0x7ee33b,_0x188355,_0x48a7af){return new Promise(function(_0x2aa5f2,_0x1d7f8d){var _0xfcc6af=_[_0x95e3('0xc')](_0x188355);_0xfcc6af[_0x95e3('0xd')]=_0x48a7af;return rpc[_0x7ee33b+_0x95e3('0xe')]['create'](_0xfcc6af)[_0x95e3('0xf')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x17eabd,_0xfcc6af[_0x95e3('0xd')]);_0x2aa5f2();})[_0x95e3('0x10')](function(_0x545c29){logger[_0x95e3('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x17eabd,JSON['stringify'](_0x545c29));_0x1d7f8d(_0x545c29);});});}exports[_0x95e3('0x12')]=function(_0x3cce2b,_0x4c9181){return function(_0x47ffab){try{if(!_[_0x95e3('0x13')](this[_0x95e3('0x14')]['UserId'])){logger[_0x95e3('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x3cce2b,_0x95e3('0x16'));return _0x47ffab['next']();}var _0x18f392={'ContactId':this[_0x95e3('0x17')]['id'],'sentAt':moment()['format'](_0x95e3('0x18')),'direction':'out'};if(this[_0x95e3('0x19')]==='sms'||this[_0x95e3('0x19')]===_0x95e3('0x1a')){_0x18f392['phone']=this[_0x95e3('0x14')][_0x95e3('0x1b')];}var _0x299929=this[_0x95e3('0x19')];if(_0x299929===_0x95e3('0x1c')){_0x18f392[_0x95e3('0x1d')]=this[_0x95e3('0x1e')]['id'];}else{_0x18f392[_[_0x95e3('0x1f')](_0x299929)+_0x95e3('0x20')]=this['account']['id'];}_0x18f392[_['upperFirst'](_0x299929)+_0x95e3('0x21')]=this['interaction']['id'];if(this[_0x95e3('0x14')][_0x95e3('0x22')]){var _0x31d1d1=_0x4c9181[0x4];if(!_[_0x95e3('0x23')](_0x31d1d1)){_0x18f392[_0x95e3('0xd')]=utils[_0x95e3('0x24')](_0x31d1d1,this);return rpc[_0x299929+_0x95e3('0xe')]['create'](_0x18f392)[_0x95e3('0xf')](function(_0x480213){logger[_0x95e3('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x3cce2b,_0x18f392[_0x95e3('0xd')]);})[_0x95e3('0x10')](function(_0x1f4e0b){logger[_0x95e3('0x11')](_0x95e3('0x25'),_0x3cce2b,JSON[_0x95e3('0x26')](_0x1f4e0b));})[_0x95e3('0x27')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3cce2b);_0x47ffab[_0x95e3('0x28')]();});}else{logger[_0x95e3('0x15')](_0x95e3('0x29'),_0x3cce2b);_0x47ffab[_0x95e3('0x28')]();}}else{var _0x5cbc41=this;var _0x246eb0=_0x4c9181[0x2][_0x95e3('0x2a')](/\\n/g,'\x0a');var _0x5b3979={'credentials':{'private_key':_0x246eb0,'client_email':_0x4c9181[0x1]}};var _0x751489=new dialogflow['SessionsClient'](_0x5b3979);var _0x282f4d=_0x751489[_0x95e3('0x2b')](_0x4c9181[0x0],md5(_0x5cbc41[_0x95e3('0x14')]['id']));var _0x45ba89={'session':_0x282f4d,'queryInput':{'text':{'text':_0x5cbc41['message'][_0x95e3('0xd')],'languageCode':_0x4c9181[0x3]||'en'}}};return _0x751489['detectIntent'](_0x45ba89)[_0x95e3('0xf')](function(_0x491459){if(_0x491459&&_0x491459['length']){_0x5cbc41[_0x95e3('0xd')][_0x95e3('0x2c')]=_0x491459;var _0x381059=_0x491459[0x0];var _0x35ed64=_0x381059[_0x95e3('0x2d')]['diagnosticInfo']&&_0x381059['queryResult'][_0x95e3('0x2e')]['fields']?_0x381059[_0x95e3('0x2d')][_0x95e3('0x2e')][_0x95e3('0x2f')]['end_conversation']['boolValue']:![];_0x5cbc41['body'][_0x95e3('0x30')]=_0x381059[_0x95e3('0x2d')][_0x95e3('0x31')];_0x5cbc41[_0x95e3('0xd')][_0x95e3('0x32')]=_0x381059['queryResult'][_0x95e3('0x33')];_0x5cbc41['body'][_0x95e3('0x34')]=_0x381059[_0x95e3('0x2d')][_0x95e3('0x2e')]&&_0x381059['queryResult'][_0x95e3('0x2e')][_0x95e3('0x2f')]?_0x381059['queryResult'][_0x95e3('0x2e')]['fields'][_0x95e3('0x35')][_0x95e3('0x36')]:![];_0x5cbc41[_0x95e3('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x381059[_0x95e3('0x2d')]['intent'][_0x95e3('0x37')];_0x5cbc41[_0x95e3('0xd')][_0x95e3('0x38')]=_0x381059['queryResult'][_0x95e3('0x39')]['displayName'];_0x5cbc41[_0x95e3('0xd')][_0x95e3('0x3a')]=_0x381059[_0x95e3('0x2d')][_0x95e3('0x39')][_0x95e3('0x3b')];_0x5cbc41['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x381059[_0x95e3('0x2d')]['languageCode'];_0x5cbc41[_0x95e3('0xd')][_0x95e3('0x3c')]=_0x381059[_0x95e3('0x2d')][_0x95e3('0x3d')];_0x5cbc41[_0x95e3('0xd')][_0x95e3('0x3e')]=_0x381059[_0x95e3('0x2d')][_0x95e3('0x3f')];_0x18f392[_0x95e3('0x40')]=_0x95e3('0x2c');_0x18f392[_0x95e3('0x41')]=JSON[_0x95e3('0x26')](_0x491459);var _0x49bbb7=[];for(var _0x4a03db=0x0;_0x4a03db<_0x491459[_0x95e3('0x42')];_0x4a03db++){var _0x494aa9=_0x491459[_0x4a03db];if(_0x494aa9&&_0x494aa9['queryResult']&&_0x494aa9['queryResult'][_0x95e3('0x43')]){_0x49bbb7[_0x95e3('0x44')](createMessage(_0x3cce2b,_0x299929,_0x18f392,_0x494aa9[_0x95e3('0x2d')][_0x95e3('0x43')]));}}return Promise[_0x95e3('0x45')](_0x49bbb7)[_0x95e3('0xf')](function(){if(_0x35ed64){_0x47ffab['next']();}else{_0x47ffab[_0x95e3('0x28')]();}})['catch'](function(_0x8b2c81){logger[_0x95e3('0x11')](_0x95e3('0x25'),_0x3cce2b,JSON['stringify'](_0x8b2c81));_0x47ffab[_0x95e3('0x46')]();});}})[_0x95e3('0x10')](function(_0xd4b01e){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x3cce2b,_0xd4b01e[_0x95e3('0x47')]);_0x47ffab[_0x95e3('0x46')]();});}}catch(_0x6ccaa2){logger[_0x95e3('0x11')](_0x95e3('0x25'),_0x3cce2b,JSON['stringify'](_0x6ccaa2));_0x47ffab[_0x95e3('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index a315a42..9f57539 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 _0xe03c=['string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','map','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stop','[%s][GOTOIF]\x20%s','validate','html-to-text','../../../../config/logger'];(function(_0x77844f,_0x37cd80){var _0x381a96=function(_0x38d054){while(--_0x38d054){_0x77844f['push'](_0x77844f['shift']());}};_0x381a96(++_0x37cd80);}(_0xe03c,0x142));var _0xce03=function(_0xc923,_0x3c0d55){_0xc923=_0xc923-0x0;var _0x2ff917=_0xe03c[_0xc923];return _0x2ff917;};'use strict';var schema=require(_0xce03('0x0'));var _=require('lodash');var htmlToText=require(_0xce03('0x1'));var utils=require('./utils');var logger=require(_0xce03('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xce03('0x3'),'required':!![],'message':_0xce03('0x4')},'priorityTrue':{'type':_0xce03('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xce03('0x5'),'message':_0xce03('0x6')}});exports[_0xce03('0x7')]=function(_0x393b90,_0x5258ab){return function(_0xd9fad5){try{var _0x2bea76={'condition':htmlToText['fromString'](utils[_0xce03('0x8')](_0x5258ab[0x0],this),{'wordwrap':![]})[_0xce03('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5258ab[0x1],'priorityFalse':_0x5258ab[0x2]};var _0x1f6d1b=gotoif['validate'](_0x2bea76,{'typecast':!![]});if(_0x1f6d1b['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x393b90,_[_0xce03('0xa')](_0x1f6d1b,'message')[_0xce03('0xb')](',\x20'));_0xd9fad5['stop']();}else{try{var _0x2cfdd2=eval('('+_0x2bea76[_0xce03('0xc')]+')');var _0x1fc7f3=_0x2cfdd2?_0x2bea76[_0xce03('0xd')]:_0x2bea76[_0xce03('0xe')];logger['info'](_0xce03('0xf'),_0x393b90,_0x2bea76[_0xce03('0xc')],_0x2cfdd2,_0x1fc7f3||_0xce03('0x10'));if(_0x1fc7f3){var _0x2f57ed=_[_0xce03('0x11')](_0xd9fad5[_0xce03('0x12')](),{'p':_0x1fc7f3});if(_0x2f57ed>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x393b90,_0x1fc7f3||_0xce03('0x10'),_0x2f57ed);_0xd9fad5[_0xce03('0x10')](_0x2f57ed);}else{logger[_0xce03('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x393b90,_0x1fc7f3||_0xce03('0x10'));_0xd9fad5['stop']();}}else{_0xd9fad5['next']();}}catch(_0x13c9ff){logger[_0xce03('0x14')](_0xce03('0x15'),_0x393b90,_0x13c9ff[_0xce03('0x16')]);_0xd9fad5[_0xce03('0x17')]();}}}catch(_0x2c2a1c){logger[_0xce03('0x14')](_0xce03('0x18'),_0x393b90,JSON['stringify'](_0x2c2a1c));_0xd9fad5[_0xce03('0x17')]();}};}; \ No newline at end of file +var _0x12df=['html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash'];(function(_0x531399,_0x276a7d){var _0x12709f=function(_0x24f7e7){while(--_0x24f7e7){_0x531399['push'](_0x531399['shift']());}};_0x12709f(++_0x276a7d);}(_0x12df,0xac));var _0xf12d=function(_0x3c5c4e,_0x479de1){_0x3c5c4e=_0x3c5c4e-0x0;var _0x6e69e=_0x12df[_0x3c5c4e];return _0x6e69e;};'use strict';var schema=require(_0xf12d('0x0'));var _=require(_0xf12d('0x1'));var htmlToText=require(_0xf12d('0x2'));var utils=require(_0xf12d('0x3'));var logger=require(_0xf12d('0x4'))(_0xf12d('0x5'));var gotoif=schema({'condition':{'type':_0xf12d('0x6'),'required':!![],'message':_0xf12d('0x7')},'priorityTrue':{'type':_0xf12d('0x8'),'message':_0xf12d('0x9')},'priorityFalse':{'type':_0xf12d('0x8'),'message':_0xf12d('0xa')}});exports[_0xf12d('0xb')]=function(_0x3a3cb7,_0x20750b){return function(_0x5d897e){try{var _0x375fba={'condition':htmlToText['fromString'](utils[_0xf12d('0xc')](_0x20750b[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x20750b[0x1],'priorityFalse':_0x20750b[0x2]};var _0x208c5e=gotoif[_0xf12d('0x0')](_0x375fba,{'typecast':!![]});if(_0x208c5e['length']){logger[_0xf12d('0xd')](_0xf12d('0xe'),_0x3a3cb7,_[_0xf12d('0xf')](_0x208c5e,'message')[_0xf12d('0x10')](',\x20'));_0x5d897e[_0xf12d('0x11')]();}else{try{var _0x29f2f2=eval('('+_0x375fba[_0xf12d('0x12')]+')');var _0xa8cb39=_0x29f2f2?_0x375fba[_0xf12d('0x13')]:_0x375fba['priorityFalse'];logger['info'](_0xf12d('0x14'),_0x3a3cb7,_0x375fba[_0xf12d('0x12')],_0x29f2f2,_0xa8cb39||'next');if(_0xa8cb39){var _0x415936=_[_0xf12d('0x15')](_0x5d897e[_0xf12d('0x16')](),{'p':_0xa8cb39});if(_0x415936>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3a3cb7,_0xa8cb39||'next',_0x415936);_0x5d897e['next'](_0x415936);}else{logger[_0xf12d('0x17')](_0xf12d('0x18'),_0x3a3cb7,_0xa8cb39||_0xf12d('0x19'));_0x5d897e[_0xf12d('0x11')]();}}else{_0x5d897e[_0xf12d('0x19')]();}}catch(_0x206f52){logger[_0xf12d('0xd')](_0xf12d('0x1a'),_0x3a3cb7,_0x206f52[_0xf12d('0x1b')]);_0x5d897e[_0xf12d('0x11')]();}}}catch(_0xae2472){logger[_0xf12d('0xd')](_0xf12d('0xe'),_0x3a3cb7,JSON[_0xf12d('0x1c')](_0xae2472));_0x5d897e[_0xf12d('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 43fb037..f6c0c2f 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 _0xf058=['priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x4c0d5d,_0x3f028a){var _0x2a98ed=function(_0x4fa903){while(--_0x4fa903){_0x4c0d5d['push'](_0x4c0d5d['shift']());}};_0x2a98ed(++_0x3f028a);}(_0xf058,0xde));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x8f05('0x0'));var _=require('lodash');var logger=require(_0x8f05('0x1'))(_0x8f05('0x2'));var gotop=schema({'priority':{'type':_0x8f05('0x3'),'required':!![],'message':_0x8f05('0x4')}});exports['consequence']=function(_0x42b909,_0x2d0525){return function(_0x5390d4){try{var _0x3c900b={'priority':_0x2d0525[0x0]};var _0x17f27d=gotop[_0x8f05('0x0')](_0x3c900b,{'typecast':!![]});if(_0x17f27d['length']){logger[_0x8f05('0x5')](_0x8f05('0x6'),_0x42b909,_[_0x8f05('0x7')](_0x17f27d,_0x8f05('0x8'))['join'](',\x20'));_0x5390d4[_0x8f05('0x9')]();}else{logger[_0x8f05('0xa')](_0x8f05('0xb'),_0x42b909,_0x3c900b[_0x8f05('0xc')]);if(_0x3c900b[_0x8f05('0xc')]){var _0xdc01c7=_[_0x8f05('0xd')](_0x5390d4['rules'](),{'p':_0x3c900b[_0x8f05('0xc')]});if(_0xdc01c7>=0x0){logger['info'](_0x8f05('0xe'),_0x42b909,_0x3c900b[_0x8f05('0xc')]||'next',_0xdc01c7);_0x5390d4['next'](_0xdc01c7);}else{logger['info'](_0x8f05('0xf'),_0x42b909,_0x3c900b[_0x8f05('0xc')]||_0x8f05('0x10'));_0x5390d4['stop']();}}else{_0x5390d4[_0x8f05('0x10')]();}}}catch(_0x30a9bf){logger[_0x8f05('0x5')](_0x8f05('0x6'),_0x42b909,JSON[_0x8f05('0x11')](_0x30a9bf));_0x5390d4['stop']();}};}; \ No newline at end of file +var _0x9960=['info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','message','join','stop'];(function(_0x530f64,_0x91250c){var _0xe279d3=function(_0x277d08){while(--_0x277d08){_0x530f64['push'](_0x530f64['shift']());}};_0xe279d3(++_0x91250c);}(_0x9960,0x100));var _0x0996=function(_0x5626fb,_0x12a3cc){_0x5626fb=_0x5626fb-0x0;var _0x15b2c3=_0x9960[_0x5626fb];return _0x15b2c3;};'use strict';var schema=require('validate');var _=require(_0x0996('0x0'));var logger=require('../../../../config/logger')(_0x0996('0x1'));var gotop=schema({'priority':{'type':_0x0996('0x2'),'required':!![],'message':_0x0996('0x3')}});exports[_0x0996('0x4')]=function(_0x598601,_0x1db021){return function(_0x59ab8e){try{var _0x13d999={'priority':_0x1db021[0x0]};var _0x2e00c6=gotop['validate'](_0x13d999,{'typecast':!![]});if(_0x2e00c6[_0x0996('0x5')]){logger['error'](_0x0996('0x6'),_0x598601,_['map'](_0x2e00c6,_0x0996('0x7'))[_0x0996('0x8')](',\x20'));_0x59ab8e[_0x0996('0x9')]();}else{logger[_0x0996('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x598601,_0x13d999[_0x0996('0xb')]);if(_0x13d999[_0x0996('0xb')]){var _0x23ced9=_[_0x0996('0xc')](_0x59ab8e[_0x0996('0xd')](),{'p':_0x13d999[_0x0996('0xb')]});if(_0x23ced9>=0x0){logger[_0x0996('0xa')](_0x0996('0xe'),_0x598601,_0x13d999['priority']||'next',_0x23ced9);_0x59ab8e[_0x0996('0xf')](_0x23ced9);}else{logger[_0x0996('0xa')](_0x0996('0x10'),_0x598601,_0x13d999[_0x0996('0xb')]||'next');_0x59ab8e[_0x0996('0x9')]();}}else{_0x59ab8e['next']();}}}catch(_0x98671a){logger[_0x0996('0x11')](_0x0996('0x6'),_0x598601,JSON[_0x0996('0x12')](_0x98671a));_0x59ab8e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index f0366d0..26d2447 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 _0x1477=['../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','ChatWebsiteId','account','channel','AccountId','Message','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x309a5e,_0x1ec246){var _0x1d21f1=function(_0x1d902d){while(--_0x1d902d){_0x309a5e['push'](_0x309a5e['shift']());}};_0x1d21f1(++_0x1ec246);}(_0x1477,0x122));var _0x7147=function(_0x4dc72d,_0x4014e1){_0x4dc72d=_0x4dc72d-0x0;var _0xa6743b=_0x1477[_0x4dc72d];return _0xa6743b;};'use strict';var _=require(_0x7147('0x0'));var utils=require(_0x7147('0x1'));var logger=require(_0x7147('0x2'))(_0x7147('0x3'));var rpc={'chatMessage':require(_0x7147('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7147('0x5')),'smsMessage':require(_0x7147('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7147('0x7'))};exports[_0x7147('0x8')]=function(_0x43dd2a,_0x2dc2c7){return function(_0x9a5dd5){try{var _0x35ded6={'body':utils['getMustacheRender'](_0x2dc2c7[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x35ded6[_0x7147('0x9')]=this[_0x7147('0xa')]['id'];}else{_0x35ded6[_['upperFirst'](this[_0x7147('0xb')])+_0x7147('0xc')]=this[_0x7147('0xa')]['id'];}_0x35ded6[_['upperFirst'](this[_0x7147('0xb')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x7147('0xb')]+'Message']){return rpc[this[_0x7147('0xb')]+_0x7147('0xd')]['create'](_0x35ded6)['then'](function(_0x24d58b){logger[_0x7147('0xe')](_0x7147('0xf'),_0x43dd2a,_0x35ded6[_0x7147('0x10')]);_0x9a5dd5[_0x7147('0x11')]();})['catch'](function(_0xe1a401){logger[_0x7147('0x12')](_0x7147('0xf'),_0x43dd2a,JSON[_0x7147('0x13')](_0xe1a401));_0x9a5dd5[_0x7147('0x14')]();});}}catch(_0x40d373){logger[_0x7147('0x12')]('[%s][MESSAGE]\x20%s',_0x43dd2a,JSON[_0x7147('0x13')](_0x40d373));_0x9a5dd5[_0x7147('0x14')]();}};}; \ No newline at end of file +var _0x5dda=['error','[%s][MESSAGE]\x20%s','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','body','next','catch'];(function(_0x18a48e,_0x16cd5b){var _0x142e1c=function(_0x326051){while(--_0x326051){_0x18a48e['push'](_0x18a48e['shift']());}};_0x142e1c(++_0x16cd5b);}(_0x5dda,0x8f));var _0xa5dd=function(_0x51cfe7,_0x4b9403){_0x51cfe7=_0x51cfe7-0x0;var _0x526405=_0x5dda[_0x51cfe7];return _0x526405;};'use strict';var _=require('lodash');var utils=require(_0xa5dd('0x0'));var logger=require(_0xa5dd('0x1'))(_0xa5dd('0x2'));var rpc={'chatMessage':require(_0xa5dd('0x3')),'openchannelMessage':require(_0xa5dd('0x4')),'mailMessage':require(_0xa5dd('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa5dd('0x6')),'whatsappMessage':require(_0xa5dd('0x7'))};exports['consequence']=function(_0x423c19,_0xde7084){return function(_0x359097){try{var _0x190698={'body':utils[_0xa5dd('0x8')](_0xde7084[0x0],this),'ContactId':this[_0xa5dd('0x9')]['id']};if(this['channel']===_0xa5dd('0xa')){_0x190698[_0xa5dd('0xb')]=this[_0xa5dd('0xc')]['id'];}else{_0x190698[_[_0xa5dd('0xd')](this[_0xa5dd('0xe')])+_0xa5dd('0xf')]=this[_0xa5dd('0xc')]['id'];}_0x190698[_['upperFirst'](this[_0xa5dd('0xe')])+_0xa5dd('0x10')]=this[_0xa5dd('0x11')]['id'];if(rpc[this[_0xa5dd('0xe')]+_0xa5dd('0x12')]){return rpc[this[_0xa5dd('0xe')]+_0xa5dd('0x12')][_0xa5dd('0x13')](_0x190698)[_0xa5dd('0x14')](function(_0x20acba){logger[_0xa5dd('0x15')]('[%s][MESSAGE]\x20%s',_0x423c19,_0x190698[_0xa5dd('0x16')]);_0x359097[_0xa5dd('0x17')]();})[_0xa5dd('0x18')](function(_0x325e8c){logger[_0xa5dd('0x19')](_0xa5dd('0x1a'),_0x423c19,JSON['stringify'](_0x325e8c));_0x359097[_0xa5dd('0x1b')]();});}}catch(_0x27a64c){logger[_0xa5dd('0x19')](_0xa5dd('0x1a'),_0x423c19,JSON['stringify'](_0x27a64c));_0x359097[_0xa5dd('0x1b')]();}};}; \ 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 2558cbf..bdacf8f 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 _0xd0f3=['next','stop','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x272f8d,_0x415a8e){var _0xf8bfae=function(_0x38e5e6){while(--_0x38e5e6){_0x272f8d['push'](_0x272f8d['shift']());}};_0xf8bfae(++_0x415a8e);}(_0xd0f3,0xcd));var _0x3d0f=function(_0x3c0c9e,_0x3ecdee){_0x3c0c9e=_0x3c0c9e-0x0;var _0x5ba5fe=_0xd0f3[_0x3c0c9e];return _0x5ba5fe;};'use strict';var utils=require('./utils');var logger=require(_0x3d0f('0x0'))(_0x3d0f('0x1'));exports['consequence']=function(_0x22e8b6,_0x18a4bc){return function(_0x4c200c){try{logger[_0x3d0f('0x2')](_0x3d0f('0x3'),_0x22e8b6,utils[_0x3d0f('0x4')](_0x18a4bc[0x0],this));_0x4c200c[_0x3d0f('0x5')]();}catch(_0x6e4069){logger['error'](_0x3d0f('0x3'),_0x22e8b6,JSON['stringify'](_0x6e4069));_0x4c200c[_0x3d0f('0x6')]();}};}; \ No newline at end of file +var _0x2e46=['stop','routing','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x262811,_0x26000e){var _0x588235=function(_0xb37345){while(--_0xb37345){_0x262811['push'](_0x262811['shift']());}};_0x588235(++_0x26000e);}(_0x2e46,0xf7));var _0x62e4=function(_0x39a659,_0x139049){_0x39a659=_0x39a659-0x0;var _0x7fa818=_0x2e46[_0x39a659];return _0x7fa818;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x62e4('0x0'));exports['consequence']=function(_0x4bd432,_0x31d97e){return function(_0x2b2a6d){try{logger['info'](_0x62e4('0x1'),_0x4bd432,utils[_0x62e4('0x2')](_0x31d97e[0x0],this));_0x2b2a6d[_0x62e4('0x3')]();}catch(_0x157c6a){logger[_0x62e4('0x4')](_0x62e4('0x1'),_0x4bd432,JSON['stringify'](_0x157c6a));_0x2b2a6d[_0x62e4('0x5')]();}};}; \ 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 af3c506..61b9f32 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 _0xfbfb=['[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','strategy','rrmemory','beepall','log','stack','validate','lodash','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','emit','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','update','update\x20queue\x20report','timeout'];(function(_0x151029,_0x45fe12){var _0x1d7977=function(_0xa71543){while(--_0xa71543){_0x151029['push'](_0x151029['shift']());}};_0x1d7977(++_0x45fe12);}(_0xfbfb,0xfa));var _0xbfbf=function(_0x57e976,_0x1c6f4d){_0x57e976=_0x57e976-0x0;var _0x145e8b=_0xfbfb[_0x57e976];return _0x145e8b;};'use strict';var schema=require(_0xbfbf('0x0'));var _=require(_0xbfbf('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xbfbf('0x2'));var Redis=require(_0xbfbf('0x3'));var config=require(_0xbfbf('0x4'));var logger=require(_0xbfbf('0x5'))(_0xbfbf('0x6'));var strategy=require('./strategy');config[_0xbfbf('0x7')]=_[_0xbfbf('0x8')](config[_0xbfbf('0x7')],{'host':_0xbfbf('0x9'),'port':0x18eb});var io=require(_0xbfbf('0xa'))(new Redis(config[_0xbfbf('0x7')]));var attributes=['id',_0xbfbf('0xb'),'account',_0xbfbf('0xc'),_0xbfbf('0xd'),'joinAt'];function emit(_0x448353,_0x319218,_0x40cce1){io['to'](_0x448353)[_0xbfbf('0xe')](_0x319218,_0x40cce1);}function emitChannelQueueInteraction(_0x2f6623,_0x195dc4,_0x59c82c,_0x2b6cba,_0x4c9ddf,_0x3ea49f,_0xbe07d1,_0x3bb99d){var _0x7aa045=_[_0xbfbf('0xf')](_0x59c82c);_0x7aa045[_0xbfbf('0xb')]=_0x3bb99d;_0x7aa045[_0xbfbf('0xc')]=_0x195dc4;_0x7aa045[_0xbfbf('0x10')]=_0x2b6cba;_0x7aa045['id']=_0x4c9ddf;if(_0x3ea49f){_0xbe07d1[util[_0xbfbf('0x11')](_0xbfbf('0x12'),_0x2f6623)][_0x4c9ddf]=_[_0xbfbf('0x13')](_0x7aa045,attributes);}else{delete _0xbe07d1[util[_0xbfbf('0x11')](_0xbfbf('0x12'),_0x2f6623)][_0x4c9ddf];}emit(util[_0xbfbf('0x11')](_0xbfbf('0x14'),_0x2f6623,_0x195dc4),util[_0xbfbf('0x11')](_0xbfbf('0x15'),_0x2f6623,_0x3ea49f?_0xbfbf('0x16'):_0xbfbf('0x17')),_[_0xbfbf('0x13')](_0x7aa045,attributes));}var rpc={'openchannelQueueReport':require(_0xbfbf('0x18')),'mailQueueReport':require(_0xbfbf('0x19')),'chatQueueReport':require(_0xbfbf('0x1a')),'smsQueueReport':require(_0xbfbf('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xbfbf('0x1c'))};var queue=schema({'name':{'type':_0xbfbf('0x1d'),'required':!![],'message':_0xbfbf('0x1e')},'timeout':{'type':_0xbfbf('0x1f'),'message':_0xbfbf('0x20')}});function startRouting(_0xd06ef3,_0x1ebb12,_0x363e81,_0x2c6398){if(_0xd06ef3&&_0x1ebb12&&_0x363e81){_0x1ebb12[_0xbfbf('0x21')]+=0x1;var _0x583d32={'uniqueid':_0xd06ef3,'from':_0x363e81[_0xbfbf('0x22')]?_0x363e81['body']['from']:'','joinAt':moment()[_0xbfbf('0x11')](_0xbfbf('0x23')),'ContactId':_0x363e81['contact']?_0x363e81[_0xbfbf('0x24')]['id']:null,'ListId':_0x363e81[_0xbfbf('0x25')]?_0x363e81[_0xbfbf('0x25')]['id']:null};_0x583d32[_[_0xbfbf('0x26')](_0x363e81['channel'])+_0xbfbf('0x27')]=_0x1ebb12['id']||null;_0x583d32[_['upperFirst'](_0x363e81[_0xbfbf('0x28')])+'InteractionId']=_0x363e81[_0xbfbf('0x29')]?_0x363e81['interaction']['id']:null;_0x583d32[_[_0xbfbf('0x26')](_0x363e81[_0xbfbf('0x28')])+_0xbfbf('0x2a')]=_0x363e81['message']?_0x363e81[_0xbfbf('0x2b')]['id']:null;_0x583d32[_['upperFirst'](_0x363e81[_0xbfbf('0x28')])+(_0x363e81['channel']!==_0xbfbf('0x2c')?_0xbfbf('0x2d'):_0xbfbf('0x2e'))]=_0x363e81[_0xbfbf('0x10')]?_0x363e81['account']['id']:null;logger[_0xbfbf('0x2f')](util[_0xbfbf('0x11')](_0xbfbf('0x30'),_0xd06ef3,_0x1ebb12[_0xbfbf('0x31')]));emitChannelQueueInteraction(_0x363e81[_0xbfbf('0x28')],_0x1ebb12[_0xbfbf('0x31')],_0x583d32,_0x363e81[_0xbfbf('0x10')]['name'],_0x363e81[_0xbfbf('0x2b')]['id'],!![],_0x2c6398,_0x1ebb12['id']);if(rpc[_0x363e81[_0xbfbf('0x28')]+_0xbfbf('0x32')]){return rpc[_0x363e81[_0xbfbf('0x28')]+_0xbfbf('0x32')][_0xbfbf('0x33')](_0x583d32)[_0xbfbf('0x34')](function(_0x360f0d){logger[_0xbfbf('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0x4a1a56,_0xef4a42,_0x52a866,_0x25df93){if(_0x4a1a56&&_0xef4a42){_0xef4a42[_0xbfbf('0x21')]-=0x1;var _0x332380={'leaveAt':moment()['format'](_0xbfbf('0x23')),'acceptAt':moment()['format'](_0xbfbf('0x23')),'reason':_0xbfbf('0x36')};logger[_0xbfbf('0x2f')](util[_0xbfbf('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x4a1a56,_0xef4a42[_0xbfbf('0x31')]));emitChannelQueueInteraction(_0x52a866['channel'],_0xef4a42[_0xbfbf('0x31')],_0x52a866[_0xbfbf('0x22')],_0x52a866['account']['name'],_0x52a866['message']['id'],![],_0x25df93,_0xef4a42['id']);if(rpc[_0x52a866[_0xbfbf('0x28')]+_0xbfbf('0x32')]){return rpc[_0x52a866['channel']+'QueueReport'][_0xbfbf('0x37')](_0x4a1a56,_0x332380)[_0xbfbf('0x34')](function(_0x3645bc){logger[_0xbfbf('0x35')](_0xbfbf('0x38'));});}}}function endRouting(_0x3de65d,_0xf3c9b,_0x20c98d,_0x25ebb6){if(_0x3de65d&&_0xf3c9b){_0xf3c9b[_0xbfbf('0x21')]-=0x1;var _0x560af9={'leaveAt':moment()['format'](_0xbfbf('0x23')),'exitAt':moment()[_0xbfbf('0x11')](_0xbfbf('0x23')),'reason':_0xbfbf('0x39')};logger['info'](util[_0xbfbf('0x11')](_0xbfbf('0x3a'),_0x3de65d,_0xf3c9b[_0xbfbf('0x31')]));emitChannelQueueInteraction(_0x20c98d[_0xbfbf('0x28')],_0xf3c9b['name'],_0x20c98d[_0xbfbf('0x22')],_0x20c98d['account'][_0xbfbf('0x31')],_0x20c98d['message']['id'],![],_0x25ebb6);if(rpc[_0x20c98d[_0xbfbf('0x28')]+_0xbfbf('0x32')]){return rpc[_0x20c98d[_0xbfbf('0x28')]+'QueueReport']['update'](_0x3de65d,_0x560af9)[_0xbfbf('0x34')](function(_0x440b91){logger[_0xbfbf('0x35')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x41625e){return function(_0x284f25){return _0x284f25[_0xbfbf('0x31')]['toLowerCase']()===_0x41625e[_0xbfbf('0x3b')]();};}exports[_0xbfbf('0x3c')]=function(_0x5a74c0,_0x126f09,_0xe22d90,_0x295dfb){return function(_0x144205){try{var _0xb86003={'name':_0x126f09[0x0],'timeout':_0x126f09[0x1]};var _0x2ff4ea=queue[_0xbfbf('0x0')](_0xb86003,{'typecast':!![]});if(_0x2ff4ea[_0xbfbf('0x3d')]){logger[_0xbfbf('0x35')](_0xbfbf('0x3e'),_0x5a74c0,_[_0xbfbf('0x3f')](_0x2ff4ea,'message')[_0xbfbf('0x40')](',\x20'));_0x144205[_0xbfbf('0x41')]();}else{var _0x56e103=_[_0xbfbf('0x42')](_0xe22d90[_0x295dfb[_0xbfbf('0x28')]+_0xbfbf('0x43')],handleFindQueue(_0xb86003[_0xbfbf('0x31')]));if(_0x56e103){startRouting(_0x5a74c0,_0x56e103,_0x295dfb,_0xe22d90);var _0x14996a=(_0x56e103[_0xbfbf('0x39')]||0xa)*0x3e8;var _0x1af2db=(_0xb86003[_0xbfbf('0x39')]||0x14)*0x3e8;var _0x4ce003,_0x257df3;if(_0x14996a>_0x1af2db){_0x1af2db=_0x14996a;}var _0x4b8790=seqqueue['createQueue'](_0x14996a);_0x4b8790['id']=_0x5a74c0;_0x4b8790['atimeout']=_0x14996a;_0x4b8790['qtimeout']=_0x1af2db;_0x4b8790[_0xbfbf('0x28')]=_0x295dfb[_0xbfbf('0x28')];_0xe22d90[_0xbfbf('0x44')][_0x5a74c0]['on']('end',function(){logger[_0xbfbf('0x2f')](_0xbfbf('0x45'),_0x5a74c0);stopRouting(_0x5a74c0,_0x56e103,_0x295dfb,_0xe22d90);clearTimeout(_0x4ce003);_0x4ce003=undefined;_0x4b8790[_0xbfbf('0x46')](!![]);if(_0xe22d90[_0xbfbf('0x44')][_0x5a74c0]){delete _0xe22d90[_0xbfbf('0x44')][_0x5a74c0];}_0x144205[_0xbfbf('0x41')]();});_0xe22d90[_0xbfbf('0x44')][_0x5a74c0]['on'](_0xbfbf('0x47'),function(){if(_0xe22d90[_0xbfbf('0x44')][_0x5a74c0]){delete _0xe22d90[_0xbfbf('0x44')][_0x5a74c0];}});_0x4ce003=setTimeout(function(){logger[_0xbfbf('0x2f')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x5a74c0);endRouting(_0x5a74c0,_0x56e103,_0x295dfb,_0xe22d90);clearTimeout(_0x4ce003);_0x4b8790[_0xbfbf('0x46')](!![]);_0x144205['next']();},_0x1af2db);switch(_0x56e103[_0xbfbf('0x48')]){case'rrmemory':strategy[_0xbfbf('0x49')](_0x4b8790,_0x56e103,_0xe22d90,_0x295dfb);break;default:strategy[_0xbfbf('0x4a')](_0x4b8790,_0x56e103,_0xe22d90,_0x295dfb);}}else{logger[_0xbfbf('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x5a74c0,_0xb86003[_0xbfbf('0x31')]);_0x144205[_0xbfbf('0x41')]();}}}catch(_0xbe75db){console[_0xbfbf('0x4b')](_0xbe75db);logger[_0xbfbf('0x35')]('[%s][QUEUE]\x20%s',_0x5a74c0,_0xbe75db[_0xbfbf('0x4c')]);_0x144205['stop']();}};}; \ No newline at end of file +var _0x4386=['map','join','stop','find','Queues','createQueue','atimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','close','rrmemory','beepall','log','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','queue_id','account','queue','from','joinAt','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','QueueReport','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x4386,0xe9));var _0x6438=function(_0x302d0b,_0x2c7dbb){_0x302d0b=_0x302d0b-0x0;var _0x3b9e1d=_0x4386[_0x302d0b];return _0x3b9e1d;};'use strict';var schema=require(_0x6438('0x0'));var _=require(_0x6438('0x1'));var util=require('util');var seqqueue=require(_0x6438('0x2'));var moment=require(_0x6438('0x3'));var Redis=require(_0x6438('0x4'));var config=require(_0x6438('0x5'));var logger=require(_0x6438('0x6'))('routing');var strategy=require(_0x6438('0x7'));config[_0x6438('0x8')]=_[_0x6438('0x9')](config[_0x6438('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6438('0x8')]));var attributes=['id',_0x6438('0xa'),_0x6438('0xb'),_0x6438('0xc'),_0x6438('0xd'),_0x6438('0xe')];function emit(_0x1b871c,_0xc8cc8f,_0x4cdedc){io['to'](_0x1b871c)['emit'](_0xc8cc8f,_0x4cdedc);}function emitChannelQueueInteraction(_0x2439c1,_0x25aa5f,_0x18dc88,_0x1241fa,_0xecc208,_0x1eb71a,_0x32c325,_0x5647f8){var _0x6bceb1=_['clone'](_0x18dc88);_0x6bceb1[_0x6438('0xa')]=_0x5647f8;_0x6bceb1[_0x6438('0xc')]=_0x25aa5f;_0x6bceb1[_0x6438('0xb')]=_0x1241fa;_0x6bceb1['id']=_0xecc208;if(_0x1eb71a){_0x32c325[util['format'](_0x6438('0xf'),_0x2439c1)][_0xecc208]=_[_0x6438('0x10')](_0x6bceb1,attributes);}else{delete _0x32c325[util[_0x6438('0x11')]('%sQueuesWaitingInteractions',_0x2439c1)][_0xecc208];}emit(util[_0x6438('0x11')]('%s:queue:%s',_0x2439c1,_0x25aa5f),util[_0x6438('0x11')](_0x6438('0x12'),_0x2439c1,_0x1eb71a?'save':_0x6438('0x13')),_['pick'](_0x6bceb1,attributes));}var rpc={'openchannelQueueReport':require(_0x6438('0x14')),'mailQueueReport':require(_0x6438('0x15')),'chatQueueReport':require(_0x6438('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x6438('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x6438('0x18'),'required':!![],'message':_0x6438('0x19')},'timeout':{'type':_0x6438('0x1a'),'message':_0x6438('0x1b')}});function startRouting(_0x5e9fe5,_0x2e7392,_0x11f336,_0x32462e){if(_0x5e9fe5&&_0x2e7392&&_0x11f336){_0x2e7392[_0x6438('0x1c')]+=0x1;var _0x8d11ae={'uniqueid':_0x5e9fe5,'from':_0x11f336['body']?_0x11f336[_0x6438('0x1d')][_0x6438('0xd')]:'','joinAt':moment()[_0x6438('0x11')](_0x6438('0x1e')),'ContactId':_0x11f336[_0x6438('0x1f')]?_0x11f336[_0x6438('0x1f')]['id']:null,'ListId':_0x11f336['list']?_0x11f336[_0x6438('0x20')]['id']:null};_0x8d11ae[_['upperFirst'](_0x11f336[_0x6438('0x21')])+_0x6438('0x22')]=_0x2e7392['id']||null;_0x8d11ae[_[_0x6438('0x23')](_0x11f336[_0x6438('0x21')])+_0x6438('0x24')]=_0x11f336[_0x6438('0x25')]?_0x11f336['interaction']['id']:null;_0x8d11ae[_[_0x6438('0x23')](_0x11f336[_0x6438('0x21')])+_0x6438('0x26')]=_0x11f336[_0x6438('0x27')]?_0x11f336['message']['id']:null;_0x8d11ae[_[_0x6438('0x23')](_0x11f336[_0x6438('0x21')])+(_0x11f336[_0x6438('0x21')]!==_0x6438('0x28')?'AccountId':_0x6438('0x29'))]=_0x11f336[_0x6438('0xb')]?_0x11f336['account']['id']:null;logger[_0x6438('0x2a')](util[_0x6438('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x5e9fe5,_0x2e7392['name']));emitChannelQueueInteraction(_0x11f336[_0x6438('0x21')],_0x2e7392['name'],_0x8d11ae,_0x11f336[_0x6438('0xb')][_0x6438('0x2b')],_0x11f336[_0x6438('0x27')]['id'],!![],_0x32462e,_0x2e7392['id']);if(rpc[_0x11f336[_0x6438('0x21')]+'QueueReport']){return rpc[_0x11f336['channel']+'QueueReport'][_0x6438('0x2c')](_0x8d11ae)[_0x6438('0x2d')](function(_0x4856e4){logger[_0x6438('0x2e')](_0x6438('0x2f'));});}}}function stopRouting(_0x56c45f,_0x5a995e,_0x15d53d,_0x2b52e4){if(_0x56c45f&&_0x5a995e){_0x5a995e[_0x6438('0x1c')]-=0x1;var _0x330377={'leaveAt':moment()[_0x6438('0x11')](_0x6438('0x1e')),'acceptAt':moment()[_0x6438('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6438('0x30')};logger[_0x6438('0x2a')](util[_0x6438('0x11')](_0x6438('0x31'),_0x56c45f,_0x5a995e[_0x6438('0x2b')]));emitChannelQueueInteraction(_0x15d53d[_0x6438('0x21')],_0x5a995e[_0x6438('0x2b')],_0x15d53d[_0x6438('0x1d')],_0x15d53d['account'][_0x6438('0x2b')],_0x15d53d['message']['id'],![],_0x2b52e4,_0x5a995e['id']);if(rpc[_0x15d53d[_0x6438('0x21')]+'QueueReport']){return rpc[_0x15d53d[_0x6438('0x21')]+'QueueReport']['update'](_0x56c45f,_0x330377)[_0x6438('0x2d')](function(_0x2ee422){logger[_0x6438('0x2e')](_0x6438('0x32'));});}}}function endRouting(_0x3ae79a,_0x311832,_0x12085b,_0x208dd5){if(_0x3ae79a&&_0x311832){_0x311832[_0x6438('0x1c')]-=0x1;var _0x4f1baa={'leaveAt':moment()[_0x6438('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x6438('0x11')](_0x6438('0x1e')),'reason':_0x6438('0x33')};logger[_0x6438('0x2a')](util[_0x6438('0x11')](_0x6438('0x34'),_0x3ae79a,_0x311832['name']));emitChannelQueueInteraction(_0x12085b[_0x6438('0x21')],_0x311832['name'],_0x12085b[_0x6438('0x1d')],_0x12085b[_0x6438('0xb')][_0x6438('0x2b')],_0x12085b[_0x6438('0x27')]['id'],![],_0x208dd5);if(rpc[_0x12085b[_0x6438('0x21')]+_0x6438('0x35')]){return rpc[_0x12085b[_0x6438('0x21')]+_0x6438('0x35')][_0x6438('0x36')](_0x3ae79a,_0x4f1baa)[_0x6438('0x2d')](function(_0x277afd){logger[_0x6438('0x2e')](_0x6438('0x32'));});}}}function handleFindQueue(_0x112526){return function(_0x42a89e){return _0x42a89e[_0x6438('0x2b')][_0x6438('0x37')]()===_0x112526[_0x6438('0x37')]();};}exports[_0x6438('0x38')]=function(_0x3e8b81,_0x80a266,_0x2bbbec,_0x5a5239){return function(_0x460169){try{var _0x56bac8={'name':_0x80a266[0x0],'timeout':_0x80a266[0x1]};var _0x21d93a=queue['validate'](_0x56bac8,{'typecast':!![]});if(_0x21d93a[_0x6438('0x39')]){logger['error'](_0x6438('0x3a'),_0x3e8b81,_[_0x6438('0x3b')](_0x21d93a,_0x6438('0x27'))[_0x6438('0x3c')](',\x20'));_0x460169[_0x6438('0x3d')]();}else{var _0x139838=_[_0x6438('0x3e')](_0x2bbbec[_0x5a5239[_0x6438('0x21')]+_0x6438('0x3f')],handleFindQueue(_0x56bac8[_0x6438('0x2b')]));if(_0x139838){startRouting(_0x3e8b81,_0x139838,_0x5a5239,_0x2bbbec);var _0x32bf3e=(_0x139838[_0x6438('0x33')]||0xa)*0x3e8;var _0x16225f=(_0x56bac8[_0x6438('0x33')]||0x14)*0x3e8;var _0x96c63a,_0x3e0fd9;if(_0x32bf3e>_0x16225f){_0x16225f=_0x32bf3e;}var _0x2a6299=seqqueue[_0x6438('0x40')](_0x32bf3e);_0x2a6299['id']=_0x3e8b81;_0x2a6299[_0x6438('0x41')]=_0x32bf3e;_0x2a6299['qtimeout']=_0x16225f;_0x2a6299[_0x6438('0x21')]=_0x5a5239[_0x6438('0x21')];_0x2bbbec['rules'][_0x3e8b81]['on']('end',function(){logger['info'](_0x6438('0x42'),_0x3e8b81);stopRouting(_0x3e8b81,_0x139838,_0x5a5239,_0x2bbbec);clearTimeout(_0x96c63a);_0x96c63a=undefined;_0x2a6299['close'](!![]);if(_0x2bbbec[_0x6438('0x43')][_0x3e8b81]){delete _0x2bbbec[_0x6438('0x43')][_0x3e8b81];}_0x460169[_0x6438('0x3d')]();});_0x2bbbec[_0x6438('0x43')][_0x3e8b81]['on']('complete',function(){if(_0x2bbbec[_0x6438('0x43')][_0x3e8b81]){delete _0x2bbbec[_0x6438('0x43')][_0x3e8b81];}});_0x96c63a=setTimeout(function(){logger[_0x6438('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3e8b81);endRouting(_0x3e8b81,_0x139838,_0x5a5239,_0x2bbbec);clearTimeout(_0x96c63a);_0x2a6299[_0x6438('0x44')](!![]);_0x460169['next']();},_0x16225f);switch(_0x139838['strategy']){case _0x6438('0x45'):strategy[_0x6438('0x45')](_0x2a6299,_0x139838,_0x2bbbec,_0x5a5239);break;default:strategy[_0x6438('0x46')](_0x2a6299,_0x139838,_0x2bbbec,_0x5a5239);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3e8b81,_0x56bac8['name']);_0x460169[_0x6438('0x3d')]();}}}catch(_0x4f38ff){console[_0x6438('0x47')](_0x4f38ff);logger[_0x6438('0x2e')](_0x6438('0x3a'),_0x3e8b81,_0x4f38ff[_0x6438('0x48')]);_0x460169[_0x6438('0x3d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 2a30fca..30ebce2 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 _0x022d=['[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','channel','busy','busyQueue','notificationId','RINGING',':FORCED','hideNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','routing','squeue','agent','push','bind','timeout','handleTimeout','handleDrained','prototype','handleRun','info'];(function(_0x4ee41d,_0x15430e){var _0x46caf3=function(_0x1cd239){while(--_0x1cd239){_0x4ee41d['push'](_0x4ee41d['shift']());}};_0x46caf3(++_0x15430e);}(_0x022d,0x10a));var _0xd022=function(_0x450034,_0x2fc866){_0x450034=_0x450034-0x0;var _0x57a30c=_0x022d[_0x450034];return _0x57a30c;};'use strict';var _=require('lodash');var uuid=require(_0xd022('0x0'));var util=require(_0xd022('0x1'));var logger=require('../../../../../config/logger')(_0xd022('0x2'));var Agent=function(_0xbd5007,_0x51ada1,_0x432c83,_0x1196bb){this['notificationId']=uuid['v4']();this[_0xd022('0x3')]=_0xbd5007;this[_0xd022('0x4')]=_0x51ada1;this['realtime']=_0x432c83;this[_0xd022('0x2')]=_0x1196bb;this[_0xd022('0x3')][_0xd022('0x5')](this['handleRun']['bind'](this),this['handleTimeout'][_0xd022('0x6')](this));this[_0xd022('0x3')]['on'](_0xd022('0x7'),this[_0xd022('0x8')][_0xd022('0x6')](this));this[_0xd022('0x3')]['on']('drained',this[_0xd022('0x9')][_0xd022('0x6')](this));};Agent[_0xd022('0xa')][_0xd022('0x5')]=function(){this[_0xd022('0x3')]['push'](this['handleRun'][_0xd022('0x6')](this),this['handleTimeout'][_0xd022('0x6')](this));};Agent[_0xd022('0xa')][_0xd022('0x9')]=function(){this[_0xd022('0x8')](!![]);};Agent[_0xd022('0xa')][_0xd022('0xb')]=function(_0x5b8b02){logger[_0xd022('0xc')](_0xd022('0xd'),this['squeue']['id'],this['agent']['id']);if(_[_0xd022('0xe')](this['realtime'][_0xd022('0xf')][this[_0xd022('0x4')]['id']])){logger[_0xd022('0xc')](_0xd022('0x10'),this[_0xd022('0x3')]['id'],this[_0xd022('0x4')]['id']);setTimeout(this['push'][_0xd022('0x6')](this),0x3e8);}else{if(this['routing'][_0xd022('0x11')]||util[_0xd022('0x12')](this[_0xd022('0x3')]['id'],this[_0xd022('0x13')][_0xd022('0xf')][this[_0xd022('0x4')]['id']],this[_0xd022('0x3')][_0xd022('0x14')],![])){this[_0xd022('0x13')][_0xd022('0xf')][this[_0xd022('0x4')]['id']][_0xd022('0x15')]=!![];this[_0xd022('0x13')][_0xd022('0xf')][this[_0xd022('0x4')]['id']][_0xd022('0x16')]=undefined;util['showNotification'](this[_0xd022('0x17')],this[_0xd022('0x3')]['id'],this['realtime'][_0xd022('0xf')][this[_0xd022('0x4')]['id']],null,this[_0xd022('0x2')]);util['writeLog'](this[_0xd022('0x3')]['id'],this[_0xd022('0x13')][_0xd022('0xf')][this[_0xd022('0x4')]['id']],_0xd022('0x18')+(this[_0xd022('0x2')][_0xd022('0x11')]?_0xd022('0x19'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0xd022('0x4')]['id']);setTimeout(this[_0xd022('0x5')][_0xd022('0x6')](this),0x3e8);}}};Agent[_0xd022('0xa')][_0xd022('0x8')]=function(_0x3d7c67){if(_[_0xd022('0xe')](this[_0xd022('0x13')][_0xd022('0xf')][this[_0xd022('0x4')]['id']])){return logger[_0xd022('0xc')](_0xd022('0x10'),this['squeue']['id'],this[_0xd022('0x4')]['id']);}else{logger[_0xd022('0xc')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xd022('0x3')]['id'],this[_0xd022('0x4')]['id']);util[_0xd022('0x1a')](this[_0xd022('0x17')],this['squeue']['id'],this['realtime'][_0xd022('0xf')][this[_0xd022('0x4')]['id']],null,this['routing']);this[_0xd022('0x13')]['agents'][this[_0xd022('0x4')]['id']][_0xd022('0x15')]=![];this[_0xd022('0x13')][_0xd022('0xf')][this['agent']['id']][_0xd022('0x16')]=undefined;util[_0xd022('0x1b')](this[_0xd022('0x3')]['id'],this[_0xd022('0x13')][_0xd022('0xf')][this[_0xd022('0x4')]['id']],_0x3d7c67?_0xd022('0x1c'):_0xd022('0x1d'));}if(!_0x3d7c67){setTimeout(this[_0xd022('0x5')][_0xd022('0x6')](this),0x3e8);}};function agent(_0x3c912c,_0x2fe20d,_0x1aea20,_0x2c50c6){return new Agent(_0x3c912c,_0x2fe20d,_0x1aea20,_0x2c50c6);}module[_0xd022('0x1e')]=agent; \ No newline at end of file +var _0x3cc7=['isNil','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','writeLog','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','busy','showNotification','RINGING',':FORCED','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','handleTimeout'];(function(_0x5c72e1,_0x66185c){var _0x1a523a=function(_0x5e85cb){while(--_0x5e85cb){_0x5c72e1['push'](_0x5c72e1['shift']());}};_0x1a523a(++_0x66185c);}(_0x3cc7,0x116));var _0x73cc=function(_0x531b1e,_0x301978){_0x531b1e=_0x531b1e-0x0;var _0x1208b6=_0x3cc7[_0x531b1e];return _0x1208b6;};'use strict';var _=require(_0x73cc('0x0'));var uuid=require(_0x73cc('0x1'));var util=require(_0x73cc('0x2'));var logger=require(_0x73cc('0x3'))('routing');var Agent=function(_0x182788,_0x441c58,_0x1977cc,_0x52df5a){this[_0x73cc('0x4')]=uuid['v4']();this[_0x73cc('0x5')]=_0x182788;this[_0x73cc('0x6')]=_0x441c58;this[_0x73cc('0x7')]=_0x1977cc;this[_0x73cc('0x8')]=_0x52df5a;this[_0x73cc('0x5')][_0x73cc('0x9')](this[_0x73cc('0xa')][_0x73cc('0xb')](this),this['handleTimeout']['bind'](this));this['squeue']['on'](_0x73cc('0xc'),this['handleTimeout'][_0x73cc('0xb')](this));this[_0x73cc('0x5')]['on'](_0x73cc('0xd'),this[_0x73cc('0xe')]['bind'](this));};Agent[_0x73cc('0xf')]['push']=function(){this[_0x73cc('0x5')]['push'](this[_0x73cc('0xa')][_0x73cc('0xb')](this),this['handleTimeout'][_0x73cc('0xb')](this));};Agent[_0x73cc('0xf')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0x73cc('0xf')][_0x73cc('0xa')]=function(_0x21c8de){logger['info'](_0x73cc('0x10'),this[_0x73cc('0x5')]['id'],this[_0x73cc('0x6')]['id']);if(_['isNil'](this['realtime']['agents'][this[_0x73cc('0x6')]['id']])){logger['info'](_0x73cc('0x11'),this[_0x73cc('0x5')]['id'],this[_0x73cc('0x6')]['id']);setTimeout(this[_0x73cc('0x9')]['bind'](this),0x3e8);}else{if(this[_0x73cc('0x8')]['forcedOwnership']||util[_0x73cc('0x12')](this[_0x73cc('0x5')]['id'],this['realtime'][_0x73cc('0x13')][this[_0x73cc('0x6')]['id']],this[_0x73cc('0x5')][_0x73cc('0x14')],![])){this[_0x73cc('0x7')][_0x73cc('0x13')][this[_0x73cc('0x6')]['id']][_0x73cc('0x15')]=!![];this[_0x73cc('0x7')][_0x73cc('0x13')][this['agent']['id']]['busyQueue']=undefined;util[_0x73cc('0x16')](this[_0x73cc('0x4')],this[_0x73cc('0x5')]['id'],this[_0x73cc('0x7')]['agents'][this[_0x73cc('0x6')]['id']],null,this[_0x73cc('0x8')]);util['writeLog'](this[_0x73cc('0x5')]['id'],this[_0x73cc('0x7')][_0x73cc('0x13')][this['agent']['id']],_0x73cc('0x17')+(this[_0x73cc('0x8')]['forcedOwnership']?_0x73cc('0x18'):''));}else{logger[_0x73cc('0x19')](_0x73cc('0x1a'),this[_0x73cc('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x73cc('0x9')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x73cc('0x1b')]=function(_0x159fef){if(_[_0x73cc('0x1c')](this[_0x73cc('0x7')][_0x73cc('0x13')][this[_0x73cc('0x6')]['id']])){return logger[_0x73cc('0x19')](_0x73cc('0x11'),this[_0x73cc('0x5')]['id'],this['agent']['id']);}else{logger['info'](_0x73cc('0x1d'),this[_0x73cc('0x5')]['id'],this['agent']['id']);util['hideNotification'](this[_0x73cc('0x4')],this['squeue']['id'],this['realtime'][_0x73cc('0x13')][this['agent']['id']],null,this[_0x73cc('0x8')]);this[_0x73cc('0x7')][_0x73cc('0x13')][this[_0x73cc('0x6')]['id']][_0x73cc('0x15')]=![];this[_0x73cc('0x7')][_0x73cc('0x13')][this[_0x73cc('0x6')]['id']][_0x73cc('0x1e')]=undefined;util[_0x73cc('0x1f')](this[_0x73cc('0x5')]['id'],this[_0x73cc('0x7')][_0x73cc('0x13')][this['agent']['id']],_0x159fef?_0x73cc('0x20'):_0x73cc('0x21'));}if(!_0x159fef){setTimeout(this[_0x73cc('0x9')][_0x73cc('0xb')](this),0x3e8);}};function agent(_0x11f7dd,_0x43febc,_0x5c9783,_0x22038a){return new Agent(_0x11f7dd,_0x43febc,_0x5c9783,_0x22038a);}module['exports']=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 2c2dd01..dcd3ba7 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 _0x6183=['handleTimeout','timeout','drained','handleDrained','prototype','push','handleRun','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','isNil','hideNotification','STOP','TIMEOUT','busyQueue','exports','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','bind'];(function(_0x9664b9,_0x51d10e){var _0x420c36=function(_0x131a18){while(--_0x131a18){_0x9664b9['push'](_0x9664b9['shift']());}};_0x420c36(++_0x51d10e);}(_0x6183,0x19b));var _0x3618=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0x6183[_0x495b3d];return _0x4cb329;};'use strict';var _=require('lodash');var uuid=require(_0x3618('0x0'));var util=require(_0x3618('0x1'));var logger=require(_0x3618('0x2'))('routing');var Beepall=function(_0x2d9b70,_0x3ec8a8,_0x176f61,_0x2d62a7){this[_0x3618('0x3')]=uuid['v4']();this[_0x3618('0x4')]=_0x2d9b70;this[_0x3618('0x5')]=_0x3ec8a8;this[_0x3618('0x6')]=_0x176f61;this[_0x3618('0x7')]=_0x2d62a7;this[_0x3618('0x4')]['push'](this['handleRun'][_0x3618('0x8')](this),this[_0x3618('0x9')][_0x3618('0x8')](this));this[_0x3618('0x4')]['on'](_0x3618('0xa'),this[_0x3618('0x9')][_0x3618('0x8')](this));this[_0x3618('0x4')]['on'](_0x3618('0xb'),this[_0x3618('0xc')][_0x3618('0x8')](this));};Beepall[_0x3618('0xd')]['push']=function(){this['squeue'][_0x3618('0xe')](this['handleRun'][_0x3618('0x8')](this),this[_0x3618('0x9')]['bind'](this));};Beepall[_0x3618('0xd')][_0x3618('0xc')]=function(_0x638c87){this[_0x3618('0x9')](!![]);};Beepall[_0x3618('0xd')][_0x3618('0xf')]=function(_0x186a53){var _0x31530b=!![];if(!_['isNil'](this[_0x3618('0x5')])&&!_['isNil'](this[_0x3618('0x5')][_0x3618('0x10')])&&this[_0x3618('0x5')]['Agents']['length']>0x0){for(var _0x5e9c82=0x0,_0x422061;_0x5e9c820x0){for(var _0x729572=0x0,_0x3eaca5;_0x7295720x0&&_0x31555d[_0x2a22e3+_0x47b8('0x28')]>=_0x31555d[_0x2a22e3+'Capacity']){writeLog(_0x54f6bc,_0x31555d,_0x2a22e3[_0x47b8('0x29')]()+_0x47b8('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0){return sendNotification(!![],_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0);};exports[_0x47b8('0x2b')]=function(_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d){return sendNotification(![],_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x524e=['getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','Pause','hasOwnProperty','Capacity','CurrentCapacity','showNotification','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','emit','format','user:%s','name','user:save','split','account','notificationSound','notificationShake','body','queue'];(function(_0x15809a,_0x595893){var _0x38c9ff=function(_0xa45c75){while(--_0xa45c75){_0x15809a['push'](_0x15809a['shift']());}};_0x38c9ff(++_0x595893);}(_0x524e,0x15e));var _0xe524=function(_0x43ac7f,_0x114bb8){_0x43ac7f=_0x43ac7f-0x0;var _0x5cfdfc=_0x524e[_0x43ac7f];return _0x5cfdfc;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xe524('0x0'));var Mustache=require(_0xe524('0x1'));var Redis=require(_0xe524('0x2'));var config=require(_0xe524('0x3'));var logger=require(_0xe524('0x4'))(_0xe524('0x5'));config[_0xe524('0x6')]=_[_0xe524('0x7')](config[_0xe524('0x6')],{'host':_0xe524('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe524('0x6')]));function emit(_0x41e1a3,_0x347bed,_0x533c14){io['to'](_0x41e1a3)[_0xe524('0x9')](_0x347bed,_0x533c14);}function sendNotification(_0x3e4cda,_0x24114d,_0x1f36e5,_0x991924,_0x4082b1,_0x1a08e2){io['to'](util[_0xe524('0xa')](_0xe524('0xb'),_0x991924[_0xe524('0xc')]))[_0xe524('0x9')](_0xe524('0xd'),_0x991924);var _0x1184df=_0x1a08e2||{};var _0x2f0e86=_0x1f36e5[_0xe524('0xe')]('.');var _0x26cc77={'uniqueid':_0x24114d,'channel':_0x2f0e86[0x0],'id':_0x2f0e86[0x1],'title':_0x2f0e86[0x0]+'\x20interaction','interactionId':_0x2f0e86[0x2],'queue':_0x4082b1?_0x4082b1['name']:null,'sound':_0x1184df[_0xe524('0xf')][_0xe524('0x10')],'shake':_0x1184df[_0xe524('0xf')][_0xe524('0x11')]};try{if(!_0x1184df[_0xe524('0x12')]){_0x1184df['body']={};}if(_0x4082b1){_0x1184df[_0xe524('0x12')]['queue']=_0x4082b1;}else if(_0x1184df[_0xe524('0x12')][_0xe524('0x13')]){delete _0x1184df['body'][_0xe524('0x13')];}_0x26cc77['msg']=utils[_0xe524('0x14')](_0x1184df['account'][_0xe524('0x15')],_0x1184df);}catch(_0x5f17fe){_0x26cc77['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0xe524('0x16')](util['format'](_0xe524('0x17'),_0x24114d,_0x5f17fe[_0xe524('0x18')]));}io['to'](util[_0xe524('0xa')](_0xe524('0xb'),_0x991924['name']))[_0xe524('0x9')](util[_0xe524('0xa')]('notification:%s',_0x3e4cda?_0xe524('0x19'):_0xe524('0x1a')),_0x26cc77);}function writeLog(_0x43a4f9,_0x1dcc0f,_0x1c4194){return logger[_0xe524('0x1b')](util[_0xe524('0xa')](_0xe524('0x1c'),_0x43a4f9,_0x1dcc0f[_0xe524('0xc')],_0x1c4194));}exports['isAgentAvailable']=function(_0x7d1f92,_0x5bb00b,_0x577d1f,_0x2d2f83){if(_0x5bb00b[_0xe524('0x1d')]){writeLog(_0x7d1f92,_0x5bb00b,_0xe524('0x1e'));return![];}if(!_0x5bb00b[_0xe524('0x1f')]){writeLog(_0x7d1f92,_0x5bb00b,'OFFLINE');return![];}if(_0x5bb00b[_0x577d1f+_0xe524('0x20')]){writeLog(_0x7d1f92,_0x5bb00b,'PAUSE');return![];}if(_0x2d2f83&&_0x5bb00b[_0xe524('0x21')](_0x577d1f+_0xe524('0x22'))&&_0x5bb00b[_0xe524('0x21')](_0x577d1f+_0xe524('0x23'))){if(_0x5bb00b[_0x577d1f+_0xe524('0x22')]>0x0&&_0x5bb00b[_0x577d1f+_0xe524('0x23')]>=_0x5bb00b[_0x577d1f+_0xe524('0x22')]){writeLog(_0x7d1f92,_0x5bb00b,_0x577d1f['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xe524('0x24')]=function(_0x45abad,_0x476572,_0x109a96,_0x359c8b,_0x5405e4){return sendNotification(!![],_0x45abad,_0x476572,_0x109a96,_0x359c8b,_0x5405e4);};exports['hideNotification']=function(_0x4b1ff,_0x25e7a7,_0x3aedd9,_0x8070e4,_0x25c0a1){return sendNotification(![],_0x4b1ff,_0x25e7a7,_0x3aedd9,_0x8070e4,_0x25c0a1);};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 34022be..5a4b3ce 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 _0xb1e0=['getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x3a42dd,_0x30611d){var _0x4b0798=function(_0x5a9ed4){while(--_0x5a9ed4){_0x3a42dd['push'](_0x3a42dd['shift']());}};_0x4b0798(++_0x30611d);}(_0xb1e0,0x126));var _0x0b1e=function(_0x1aa3f9,_0x186e9e){_0x1aa3f9=_0x1aa3f9-0x0;var _0x40ee8e=_0xb1e0[_0x1aa3f9];return _0x40ee8e;};'use strict';var schema=require(_0x0b1e('0x0'));var sh=require(_0x0b1e('0x1'));var _=require('lodash');var utils=require(_0x0b1e('0x2'));var logger=require(_0x0b1e('0x3'))(_0x0b1e('0x4'));var system=schema({'command':{'type':_0x0b1e('0x5'),'required':!![],'message':_0x0b1e('0x6')}});exports[_0x0b1e('0x7')]=function(_0x397902,_0x30462f){return function(_0x22242b){try{var _0x2d20a6={'command':_0x30462f[0x0]};var _0x1cc263=system[_0x0b1e('0x0')](_0x2d20a6,{'typecast':!![]});if(_0x1cc263['length']){logger[_0x0b1e('0x8')]('[%s][SYSTEM]\x20%s',_0x397902,_['map'](_0x1cc263,_0x0b1e('0x9'))[_0x0b1e('0xa')](',\x20'));logger[_0x0b1e('0xb')](_0x0b1e('0xc'),_0x397902);_0x22242b[_0x0b1e('0xd')]();}else{var _0xaf84f7=this;var _0x2ad2e5=utils[_0x0b1e('0xe')](_0x30462f[0x0],this);logger[_0x0b1e('0xb')](_0x0b1e('0xf'),_0x397902,_0x2ad2e5);sh[_0x0b1e('0x10')](_[_0x0b1e('0x11')](_0x2ad2e5),function(_0x49035e,_0x259d8a){logger['info'](_0x0b1e('0x12'),_0x397902,_0x49035e);if(_0x49035e==0x0){var _0x2a3494=_0x259d8a[_0x0b1e('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x0b1e('0x14')](_0x30462f[0x1])||_[_0x0b1e('0x15')](_0x30462f[0x1])){logger[_0x0b1e('0xb')](_0x0b1e('0x16'),_0x397902);_0xaf84f7[_0x0b1e('0x17')][_0x30462f[0x1]]=_0x2a3494;}else{logger[_0x0b1e('0xb')](_0x0b1e('0x18'),_0x397902,_0x30462f[0x1],_0x2a3494);_0xaf84f7[_0x0b1e('0x17')][_0x30462f[0x1]]=_0x2a3494;}}_0x22242b[_0x0b1e('0xd')]();});}}catch(_0x3b2aa7){logger['error'](_0x0b1e('0x19'),_0x397902,_[_0x0b1e('0x1a')](_0x3b2aa7)?JSON[_0x0b1e('0x1b')](_0x3b2aa7):_0x3b2aa7);logger[_0x0b1e('0xb')](_0x0b1e('0xc'),_0x397902);_0x22242b[_0x0b1e('0xd')]();}};}; \ No newline at end of file +var _0xa882=['next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x9f3ae6,_0x11d4e2){var _0x45d699=function(_0x1b2c4a){while(--_0x1b2c4a){_0x9f3ae6['push'](_0x9f3ae6['shift']());}};_0x45d699(++_0x11d4e2);}(_0xa882,0x135));var _0x2a88=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xa882[_0x5eaa0b];return _0x28b295;};'use strict';var schema=require(_0x2a88('0x0'));var sh=require(_0x2a88('0x1'));var _=require(_0x2a88('0x2'));var utils=require('./utils');var logger=require(_0x2a88('0x3'))('routing');var system=schema({'command':{'type':_0x2a88('0x4'),'required':!![],'message':_0x2a88('0x5')}});exports[_0x2a88('0x6')]=function(_0x30511f,_0x3753ad){return function(_0x47b23d){try{var _0x106b35={'command':_0x3753ad[0x0]};var _0x58339c=system[_0x2a88('0x0')](_0x106b35,{'typecast':!![]});if(_0x58339c['length']){logger[_0x2a88('0x7')](_0x2a88('0x8'),_0x30511f,_[_0x2a88('0x9')](_0x58339c,_0x2a88('0xa'))['join'](',\x20'));logger[_0x2a88('0xb')](_0x2a88('0xc'),_0x30511f);_0x47b23d[_0x2a88('0xd')]();}else{var _0x7be108=this;var _0x14c57a=utils['getMustacheRender'](_0x3753ad[0x0],this);logger[_0x2a88('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x30511f,_0x14c57a);sh[_0x2a88('0xe')](_[_0x2a88('0xf')](_0x14c57a),function(_0x4d29d2,_0x53b1c5){logger[_0x2a88('0xb')](_0x2a88('0x10'),_0x30511f,_0x4d29d2);if(_0x4d29d2==0x0){var _0xe5c4c0=_0x53b1c5['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3753ad[0x1])||_[_0x2a88('0x11')](_0x3753ad[0x1])){logger[_0x2a88('0xb')](_0x2a88('0x12'),_0x30511f);_0x7be108[_0x2a88('0x13')][_0x3753ad[0x1]]=_0xe5c4c0;}else{logger['info'](_0x2a88('0x14'),_0x30511f,_0x3753ad[0x1],_0xe5c4c0);_0x7be108[_0x2a88('0x13')][_0x3753ad[0x1]]=_0xe5c4c0;}}_0x47b23d[_0x2a88('0xd')]();});}}catch(_0x1d26a9){logger[_0x2a88('0x7')](_0x2a88('0x8'),_0x30511f,_[_0x2a88('0x15')](_0x1d26a9)?JSON[_0x2a88('0x16')](_0x1d26a9):_0x1d26a9);logger[_0x2a88('0xb')](_0x2a88('0xc'),_0x30511f);_0x47b23d[_0x2a88('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 54697bb..1f0067b 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 _0xd2ac=['../../../../config/logger','consequence','length','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x4cc6d0,_0xc08cb9){var _0x2b53c8=function(_0x6b250f){while(--_0x6b250f){_0x4cc6d0['push'](_0x4cc6d0['shift']());}};_0x2b53c8(++_0xc08cb9);}(_0xd2ac,0x1de));var _0xcd2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2ac[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xcd2a('0x0'));var _=require(_0xcd2a('0x1'));var rpc={'chatInteraction':require(_0xcd2a('0x2')),'openchannelInteraction':require(_0xcd2a('0x3')),'smsInteraction':require(_0xcd2a('0x4')),'mailInteraction':require(_0xcd2a('0x5')),'faxInteraction':require(_0xcd2a('0x6')),'whatsappInteraction':require(_0xcd2a('0x7'))};var logger=require(_0xcd2a('0x8'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xcd2a('0x9')]=function(_0xa2896c,_0x2a0442,_0x25dda9,_0x47a6e4){return function(_0x31aeea){try{var _0x65b316={'tag':_0x2a0442[0x0]};var _0xad5487=tag[_0xcd2a('0x0')](_0x65b316,{'typecast':!![]});if(_0xad5487[_0xcd2a('0xa')]){logger['error'](_0xcd2a('0xb'),_0xa2896c,_[_0xcd2a('0xc')](_0xad5487,_0xcd2a('0xd'))[_0xcd2a('0xe')](',\x20'));logger[_0xcd2a('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xa2896c);_0x31aeea[_0xcd2a('0x10')]();}else{var _0x296960={'ids':[_0x2a0442[0x0]]};if(rpc[_0x47a6e4[_0xcd2a('0x11')]+_0xcd2a('0x12')]){rpc[_0x47a6e4[_0xcd2a('0x11')]+_0xcd2a('0x12')][_0xcd2a('0x13')](_0x47a6e4[_0xcd2a('0x14')]['id'],_0x296960)['then'](function(_0x8518df){logger['info'](_0xcd2a('0x15'),_0xa2896c,_0x2a0442[0x1],_0x47a6e4[_0xcd2a('0x11')],_0x47a6e4[_0xcd2a('0x14')]['id']);})[_0xcd2a('0x16')](function(_0x24fc37){logger[_0xcd2a('0x17')]('[%s][TAG]\x20%s',_0xa2896c,JSON[_0xcd2a('0x18')](_0x24fc37));logger[_0xcd2a('0xf')](_0xcd2a('0x19'),_0xa2896c);})['finally'](function(){_0x31aeea[_0xcd2a('0x10')]();});}}}catch(_0x204049){logger['error'](_0xcd2a('0xb'),_0xa2896c,_[_0xcd2a('0x1a')](_0x204049)?JSON[_0xcd2a('0x18')](_0x204049):_0x204049);logger[_0xcd2a('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xa2896c);_0x31aeea['next']();}};}; \ No newline at end of file +var _0xd2f7=['error','map','message','next','Interaction','channel','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','validate'];(function(_0x41f2c2,_0x4ad655){var _0x193e77=function(_0x3113c0){while(--_0x3113c0){_0x41f2c2['push'](_0x41f2c2['shift']());}};_0x193e77(++_0x4ad655);}(_0xd2f7,0x1ec));var _0x7d2f=function(_0x3acef9,_0x65d155){_0x3acef9=_0x3acef9-0x0;var _0x4bb694=_0xd2f7[_0x3acef9];return _0x4bb694;};'use strict';var schema=require('validate');var _=require(_0x7d2f('0x0'));var rpc={'chatInteraction':require(_0x7d2f('0x1')),'openchannelInteraction':require(_0x7d2f('0x2')),'smsInteraction':require(_0x7d2f('0x3')),'mailInteraction':require(_0x7d2f('0x4')),'faxInteraction':require(_0x7d2f('0x5')),'whatsappInteraction':require(_0x7d2f('0x6'))};var logger=require(_0x7d2f('0x7'))(_0x7d2f('0x8'));var tag=schema({'tag':{'type':_0x7d2f('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x7d2f('0xa')]=function(_0x275938,_0x2e471d,_0x111191,_0x5d647b){return function(_0x29ec10){try{var _0x54c61b={'tag':_0x2e471d[0x0]};var _0x2faf55=tag[_0x7d2f('0xb')](_0x54c61b,{'typecast':!![]});if(_0x2faf55['length']){logger[_0x7d2f('0xc')]('[%s][TAG]\x20%s',_0x275938,_[_0x7d2f('0xd')](_0x2faf55,_0x7d2f('0xe'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x275938);_0x29ec10[_0x7d2f('0xf')]();}else{var _0x56d497={'ids':[_0x2e471d[0x0]]};if(rpc[_0x5d647b['channel']+_0x7d2f('0x10')]){rpc[_0x5d647b[_0x7d2f('0x11')]+_0x7d2f('0x10')][_0x7d2f('0x12')](_0x5d647b[_0x7d2f('0x13')]['id'],_0x56d497)[_0x7d2f('0x14')](function(_0x5ba401){logger[_0x7d2f('0x15')](_0x7d2f('0x16'),_0x275938,_0x2e471d[0x1],_0x5d647b[_0x7d2f('0x11')],_0x5d647b[_0x7d2f('0x13')]['id']);})[_0x7d2f('0x17')](function(_0x57f4a5){logger[_0x7d2f('0xc')](_0x7d2f('0x18'),_0x275938,JSON[_0x7d2f('0x19')](_0x57f4a5));logger[_0x7d2f('0x15')](_0x7d2f('0x1a'),_0x275938);})['finally'](function(){_0x29ec10[_0x7d2f('0xf')]();});}}}catch(_0x39e184){logger['error']('[%s][TAG]\x20%s',_0x275938,_[_0x7d2f('0x1b')](_0x39e184)?JSON[_0x7d2f('0x19')](_0x39e184):_0x39e184);logger[_0x7d2f('0x15')](_0x7d2f('0x1a'),_0x275938);_0x29ec10[_0x7d2f('0xf')]();}};}; \ 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 ca85374..ac5725e 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 _0xad7f=['[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','lodash','consequence','replace','push','urlOnAnswer','?params=','title','jsonrpc','2.0','params','stringify','utf8','POST','then','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','catch','error'];(function(_0x12cc20,_0x2c4aed){var _0xc48b2b=function(_0x5d6794){while(--_0x5d6794){_0x12cc20['push'](_0x12cc20['shift']());}};_0xc48b2b(++_0x2c4aed);}(_0xad7f,0x198));var _0xfad7=function(_0x2d48fa,_0x103065){_0x2d48fa=_0x2d48fa-0x0;var _0x4645b7=_0xad7f[_0x2d48fa];return _0x4645b7;};'use strict';var rp=require('request-promise');var logger=require(_0xfad7('0x0'))('routing');var _=require(_0xfad7('0x1'));var arr=[];exports[_0xfad7('0x2')]=function(_0x56d912,_0x171e08){return function(_0x754c7e){var _0x4d4b96=_0x171e08[0xa];var _0x11e3cf=_0x171e08[0xb];var _0x2538eb=_0x171e08[0xc];var _0x4f3092=_0x171e08[0xd];var _0x211f8a=_0x171e08[0xe];var _0x193196=_0x171e08[0xf][_0xfad7('0x3')](/\n/g,'\x20-\x20');var _0x5e467b=_0x171e08[0x10][_0xfad7('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x11e3cf)){arr[_0xfad7('0x4')](_0x11e3cf);var _0x136e01=_0x171e08[0x3];var _0x5435c9=_0x171e08[0x4];var _0x3f094f=_0x171e08[0x1];var _0x155b8f=_0x171e08[0x0];var _0x1f05b6={};_0x1f05b6[_0xfad7('0x5')]=_0x171e08[0x8]+_0xfad7('0x6')+_0x2538eb+'|'+_0x4d4b96+'|'+_0x4f3092+'|'+_0x11e3cf+'|'+_0x211f8a;_0x1f05b6['urlOnRing']=_0x171e08[0x7]+_0xfad7('0x6')+_0x2538eb+'|'+_0x4d4b96+'|'+_0x4f3092+'|'+_0x11e3cf+'|'+_0x211f8a+'|'+_0x193196+'|'+_0x5e467b;_0x1f05b6[_0xfad7('0x7')]=_0x171e08[0x9];var _0x1799cc={};_0x1799cc[_0xfad7('0x8')]=_0xfad7('0x9');_0x1799cc['method']='login';var _0x49c32c=[];_0x49c32c[_0xfad7('0x4')](_0x171e08[0x2]);_0x49c32c[_0xfad7('0x4')](_0x171e08[0x5]);_0x49c32c[_0xfad7('0x4')](_0x171e08[0x6]);_0x1799cc[_0xfad7('0xa')]=_0x49c32c;_0x1799cc['id']=0x1;var _0x481f6e=JSON[_0xfad7('0xb')](_0x1799cc);var _0x280618={'encoding':_0xfad7('0xc'),'method':_0xfad7('0xd'),'timeout':0x2710,'url':_0x136e01,'headers':{'Content-Type':'application/json-rpc'},'body':_0x481f6e};return rp(_0x280618)[_0xfad7('0xe')](function(_0x2d68bc){const _0x3e80f7=JSON['parse'](_0x2d68bc);if(!_0x3e80f7[_0xfad7('0xf')]['logged']){throw new Error(_0xfad7('0x10'));}var _0x4d9b03=_0x11e3cf;var _0x562d35=_0xfad7('0x11')+_0x3f094f+_0xfad7('0x12')+_0x155b8f+_0xfad7('0x13')+_0x4d9b03+_0xfad7('0x14')+JSON[_0xfad7('0xb')](_0x1f05b6);var _0x1b5474=_0x5435c9+'?'+_0x562d35;return rp(_0x1b5474);})[_0xfad7('0xe')](function(_0x21917d){logger[_0xfad7('0x15')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x56d912,_0x21917d);_0x754c7e['stop']();})[_0xfad7('0x16')](function(_0xf19525){logger[_0xfad7('0x17')](_0xfad7('0x18'),_0x56d912,_[_0xfad7('0x19')](_0xf19525)?JSON[_0xfad7('0xb')](_0xf19525):_0xf19525);_0x754c7e['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x56d912);_0x754c7e[_0xfad7('0x1a')]();}};}; \ No newline at end of file +var _0x7bd8=['method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','routing','lodash','consequence','replace','\x20-\x20','push','?params=','urlOnRing','jsonrpc'];(function(_0x54483e,_0x207a77){var _0x286d76=function(_0x1f8572){while(--_0x1f8572){_0x54483e['push'](_0x54483e['shift']());}};_0x286d76(++_0x207a77);}(_0x7bd8,0x1b9));var _0x87bd=function(_0x46fa59,_0x3c7da7){_0x46fa59=_0x46fa59-0x0;var _0x171b59=_0x7bd8[_0x46fa59];return _0x171b59;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')(_0x87bd('0x0'));var _=require(_0x87bd('0x1'));var arr=[];exports[_0x87bd('0x2')]=function(_0x4f95f2,_0x128333){return function(_0x36e68d){var _0x3551f9=_0x128333[0xa];var _0x3d7358=_0x128333[0xb];var _0x292e68=_0x128333[0xc];var _0x48eb92=_0x128333[0xd];var _0x30ea65=_0x128333[0xe];var _0x51f243=_0x128333[0xf][_0x87bd('0x3')](/\n/g,_0x87bd('0x4'));var _0x27480=_0x128333[0x10][_0x87bd('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x3d7358)){arr[_0x87bd('0x5')](_0x3d7358);var _0x263b2d=_0x128333[0x3];var _0xc4e226=_0x128333[0x4];var _0x42a21b=_0x128333[0x1];var _0x21d19a=_0x128333[0x0];var _0x4a4ac8={};_0x4a4ac8['urlOnAnswer']=_0x128333[0x8]+_0x87bd('0x6')+_0x292e68+'|'+_0x3551f9+'|'+_0x48eb92+'|'+_0x3d7358+'|'+_0x30ea65;_0x4a4ac8[_0x87bd('0x7')]=_0x128333[0x7]+_0x87bd('0x6')+_0x292e68+'|'+_0x3551f9+'|'+_0x48eb92+'|'+_0x3d7358+'|'+_0x30ea65+'|'+_0x51f243+'|'+_0x27480;_0x4a4ac8['title']=_0x128333[0x9];var _0x3a1c71={};_0x3a1c71[_0x87bd('0x8')]='2.0';_0x3a1c71[_0x87bd('0x9')]=_0x87bd('0xa');var _0x1aca02=[];_0x1aca02[_0x87bd('0x5')](_0x128333[0x2]);_0x1aca02[_0x87bd('0x5')](_0x128333[0x5]);_0x1aca02[_0x87bd('0x5')](_0x128333[0x6]);_0x3a1c71[_0x87bd('0xb')]=_0x1aca02;_0x3a1c71['id']=0x1;var _0x3f55a9=JSON[_0x87bd('0xc')](_0x3a1c71);var _0x5a8fd9={'encoding':_0x87bd('0xd'),'method':_0x87bd('0xe'),'timeout':0x2710,'url':_0x263b2d,'headers':{'Content-Type':_0x87bd('0xf')},'body':_0x3f55a9};return rp(_0x5a8fd9)[_0x87bd('0x10')](function(_0x29d6a2){const _0x149c49=JSON[_0x87bd('0x11')](_0x29d6a2);if(!_0x149c49[_0x87bd('0x12')][_0x87bd('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x28fc2a=_0x3d7358;var _0x14e9d6='channelId='+_0x42a21b+_0x87bd('0x14')+_0x21d19a+_0x87bd('0x15')+_0x28fc2a+_0x87bd('0x16')+JSON['stringify'](_0x4a4ac8);var _0x2a5058=_0xc4e226+'?'+_0x14e9d6;return rp(_0x2a5058);})[_0x87bd('0x10')](function(_0x4fd51a){logger[_0x87bd('0x17')](_0x87bd('0x18'),_0x4f95f2,_0x4fd51a);_0x36e68d[_0x87bd('0x19')]();})[_0x87bd('0x1a')](function(_0x5ebbde){logger[_0x87bd('0x1b')]('[%s][TVOX]\x20%s',_0x4f95f2,_[_0x87bd('0x1c')](_0x5ebbde)?JSON['stringify'](_0x5ebbde):_0x5ebbde);_0x36e68d[_0x87bd('0x19')]();});}else{logger[_0x87bd('0x17')](_0x87bd('0x1d'),_0x4f95f2);_0x36e68d['next']();}};}; \ 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 f65137f..0c26e04 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(_0x599451,_0x59b85b){var _0x5013af=function(_0xde8b08){while(--_0xde8b08){_0x599451['push'](_0x599451['shift']());}};_0x5013af(++_0x59b85b);}(_0xe706,0xa3));var _0x6e70=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0xe706[_0x51af96];return _0x2bb16b;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x305695,_0x25fffa){var _0x82d5ae=function(_0x54251b){while(--_0x54251b){_0x305695['push'](_0x305695['shift']());}};_0x82d5ae(++_0x25fffa);}(_0xe706,0xa3));var _0x6e70=function(_0x4ed786,_0x74f270){_0x4ed786=_0x4ed786-0x0;var _0x2f0243=_0xe706[_0x4ed786];return _0x2f0243;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index fe9f381..4e0681a 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 _0xaa88=['hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','channel','interaction','isArray','applications','length','existsSync','join','app','toLowerCase','split','mail','push','slice','dialogflowv2','appdata','tag','TagId','getMustacheRender','notificationTemplate','message','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','.js','rules','Applications\x20executed','stringify','matchPath','emit','error','stack','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity'];(function(_0x13b109,_0x2c9371){var _0x54aa84=function(_0xa50753){while(--_0xa50753){_0x13b109['push'](_0x13b109['shift']());}};_0x54aa84(++_0x2c9371);}(_0xaa88,0x137));var _0x8aa8=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0xaa88[_0x2dc7c9];return _0x3e6536;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var fs=require('fs');var jayson=require(_0x8aa8('0x3'));var BPromise=require('bluebird');var uuid=require(_0x8aa8('0x4'));var utils=require(_0x8aa8('0x5'));var config=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var rpc={'openchannelQueueReport':require(_0x8aa8('0x9')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x8aa8('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8aa8('0xb'))};var RuleEngine=require(_0x8aa8('0xc'));function getId(_0x27c08d,_0x40826f,_0x4adfb9){return util[_0x8aa8('0xd')](_0x8aa8('0xe'),_0x27c08d,_0x40826f||0x0,_0x4adfb9||0x0);}function getIntervals(_0x224f25,_0x5c94d4){var _0x4702ab=[];if(!_[_0x8aa8('0xf')](_0x5c94d4[_0x8aa8('0x10')])&&!_[_0x8aa8('0xf')](_0x224f25[_0x5c94d4['IntervalId']])&&!_[_0x8aa8('0xf')](_0x224f25[_0x5c94d4[_0x8aa8('0x10')]]['Intervals'])){_0x4702ab=_[_0x8aa8('0x11')](_0x224f25[_0x5c94d4[_0x8aa8('0x10')]][_0x8aa8('0x12')],'interval');}else if(!_[_0x8aa8('0xf')](_0x5c94d4[_0x8aa8('0x13')])){_0x4702ab=[_0x5c94d4[_0x8aa8('0x13')]];}return _0x4702ab;}exports['listen']=function(_0x391642){_0x391642['rules']={};return new BPromise(function(_0x4f3a2e,_0x433e95){var _0x200662={'Start':function(_0xae81a0){var _0xa6c2af=this;return new Promise(function(_0x42a6a4,_0x3778f4){if(_0xae81a0){try{var _0x1bdd39=[];var _0xd59fb8=getId(_0xae81a0[_0x8aa8('0x14')],_0xae81a0['message']?_0xae81a0['message']['id']:0x0,_0xae81a0[_0x8aa8('0x15')]?_0xae81a0['interaction']['id']:0x0);if(_0xae81a0['applications']&&_[_0x8aa8('0x16')](_0xae81a0['applications'])&&_0xae81a0[_0x8aa8('0x17')][_0x8aa8('0x18')]){for(var _0x2a9f56=0x0;_0x2a9f56<_0xae81a0[_0x8aa8('0x17')]['length'];_0x2a9f56+=0x1){var _0xcc2c19=_0xae81a0[_0x8aa8('0x17')][_0x2a9f56];if(fs[_0x8aa8('0x19')](path[_0x8aa8('0x1a')](__dirname,_0x8aa8('0x17'),_0xcc2c19[_0x8aa8('0x1b')]+'.js'))){var _0x26cf63=[];switch(_0xcc2c19['app'][_0x8aa8('0x1c')]()){case'autoreply':var _0x2c1828=_0xcc2c19['appdata'][_0x8aa8('0x1d')](',');if(_0xae81a0[_0x8aa8('0x14')]===_0x8aa8('0x1e')){_0x26cf63['push'](_0x2c1828[0x0]);_0x26cf63[_0x8aa8('0x1f')](_0x2c1828[0x1]);_0x26cf63[_0x8aa8('0x1f')](_0x2c1828[_0x8aa8('0x20')](0x2,_0x2c1828['length'])['join'](','));}else{_0x26cf63[_0x8aa8('0x1f')](_0x2c1828[0x0]);_0x26cf63[_0x8aa8('0x1f')](_0x2c1828[_0x8aa8('0x20')](0x1,_0x2c1828[_0x8aa8('0x18')])[_0x8aa8('0x1a')](','));}break;case'dialogflow':var _0x2bc34a=_0xcc2c19['appdata'][_0x8aa8('0x1d')](',');_0x26cf63[_0x8aa8('0x1f')](_0x2bc34a[0x0]);_0x26cf63[_0x8aa8('0x1f')](_0x2bc34a[0x1]);_0x26cf63['push'](_0x2bc34a['slice'](0x2,_0x2bc34a[_0x8aa8('0x18')])['join'](','));break;case _0x8aa8('0x21'):var _0x14be8b=_0xcc2c19[_0x8aa8('0x22')][_0x8aa8('0x1d')](',');_0x26cf63[_0x8aa8('0x1f')](_0x14be8b[0x0]);_0x26cf63['push'](_0x14be8b[0x1]);_0x26cf63[_0x8aa8('0x1f')](_0x14be8b[0x2]);_0x26cf63[_0x8aa8('0x1f')](_0x14be8b[0x3]);_0x26cf63['push'](_0x14be8b[_0x8aa8('0x20')](0x4,_0x14be8b[_0x8aa8('0x18')])[_0x8aa8('0x1a')](','));break;case'amazonlex':var _0x28182b=_0xcc2c19[_0x8aa8('0x22')][_0x8aa8('0x1d')](',');_0x26cf63[_0x8aa8('0x1f')](_0x28182b[0x0]);_0x26cf63[_0x8aa8('0x1f')](_0x28182b[0x1]);_0x26cf63[_0x8aa8('0x1f')](_0x28182b[0x2]);_0x26cf63[_0x8aa8('0x1f')](_0x28182b[0x3]);_0x26cf63[_0x8aa8('0x1f')](_0x28182b[_0x8aa8('0x20')](0x4,_0x28182b[_0x8aa8('0x18')])[_0x8aa8('0x1a')](','));break;case'message':_0x26cf63['push'](_0xcc2c19[_0x8aa8('0x22')]);break;case _0x8aa8('0x23'):_0x26cf63[_0x8aa8('0x1f')](_0xcc2c19[_0x8aa8('0x24')]);_0x26cf63[_0x8aa8('0x1f')](_0xcc2c19[_0x8aa8('0x22')]);break;case'tvox':var _0x4b8118=utils[_0x8aa8('0x25')](_0xae81a0['account'][_0x8aa8('0x26')],_0xae81a0);var _0x2c5c84=_0xcc2c19[_0x8aa8('0x22')]['split'](',');_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x0]);_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x1]);_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x2]);_0x26cf63['push'](_0x2c5c84[0x3]);_0x26cf63['push'](_0x2c5c84[0x4]);_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x5]);_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x6]);_0x26cf63['push'](_0x2c5c84[0x7]);_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x8]);_0x26cf63[_0x8aa8('0x1f')](_0x2c5c84[0x9]);_0x26cf63['push'](_0x2c5c84[0xa]);_0x26cf63[_0x8aa8('0x1f')](_0xae81a0['interaction']['id']);_0x26cf63['push'](_0xae81a0[_0x8aa8('0x27')]['id']);_0x26cf63['push'](_0xcc2c19[_0x8aa8('0x28')]);_0x26cf63[_0x8aa8('0x1f')](_0xae81a0[_0x8aa8('0x15')][_0x8aa8('0x29')]);_0x26cf63['push'](_0xae81a0[_0x8aa8('0x2a')][_0x8aa8('0x2a')]);_0x26cf63['push'](_0x4b8118);break;default:_0x26cf63=_[_0x8aa8('0xf')](_0xcc2c19[_0x8aa8('0x22')])?[]:_0xcc2c19['appdata'][_0x8aa8('0x1d')](',');}var _0x3c6115={'id':util[_0x8aa8('0xd')](_0x8aa8('0x2b'),_0xd59fb8,_0xcc2c19['id'],_0xcc2c19[_0x8aa8('0x1b')]),'condition':require(_0x8aa8('0x2c'))[_0x8aa8('0x2d')](_0xd59fb8,getIntervals(_0x391642[_0x8aa8('0x2e')],_0xcc2c19),_0x391642),'consequence':require(_0x8aa8('0x2f')+_0xcc2c19[_0x8aa8('0x1b')])[_0x8aa8('0x30')](_0xd59fb8,_0x26cf63,_0x391642,_0xae81a0),'p':_0xcc2c19[_0x8aa8('0x31')]||0x0};logger[_0x8aa8('0x32')](_0x8aa8('0x33'),_0x3c6115['id'],_0x8aa8('0x34'),getIntervals(_0x391642[_0x8aa8('0x2e')],_0xcc2c19)['join'](_0x8aa8('0x35')));_0x1bdd39['push'](_0x3c6115);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x8aa8('0x1a')](__dirname,'applications',_0xcc2c19['app']+_0x8aa8('0x36')));}}_0x391642['rules'][_0xd59fb8]=new RuleEngine(_0x1bdd39);_0x391642[_0x8aa8('0x37')][_0xd59fb8]['execute'](_0xae81a0,function(_0x5a132a){logger[_0x8aa8('0x32')](_0x8aa8('0x38'),JSON[_0x8aa8('0x39')](_0x5a132a[_0x8aa8('0x3a')]));if(_0x391642[_0x8aa8('0x37')][_0xd59fb8]){_0x391642[_0x8aa8('0x37')][_0xd59fb8][_0x8aa8('0x3b')]('complete');}});return _0x42a6a4({'code':0xc8,'message':_0xae81a0});}else{logger[_0x8aa8('0x32')]('No\x20applications\x20to\x20execute');return _0x42a6a4({'code':0xc8,'message':_0xae81a0});}}catch(_0x2aec13){logger[_0x8aa8('0x3c')](_0x2aec13[_0x8aa8('0x3d')]);return _0x3778f4(_0xa6c2af[_0x8aa8('0x3c')](0x1f4,_0x2aec13));}}return _0x3778f4(_0x8aa8('0x3e'));});},'AcceptMessage':function(_0x44f2b4){var _0x5adcda=this;return new Promise(function(_0x56e13f,_0x29e760){if(_0x44f2b4[_0x8aa8('0x3f')]&&_0x44f2b4['agent']['id']){if(_0x391642[_0x8aa8('0x40')][_0x44f2b4[_0x8aa8('0x3f')]['id']]){_0x391642[_0x8aa8('0x40')][_0x44f2b4['agent']['id']]['busy']=![];_0x391642['agents'][_0x44f2b4['agent']['id']][_0x8aa8('0x41')]=undefined;}}if(_0x44f2b4[_0x8aa8('0x27')]&&_0x44f2b4['message']['id']){try{var _0x3db0d3=getId(_0x44f2b4[_0x8aa8('0x14')],_0x44f2b4[_0x8aa8('0x27')]?_0x44f2b4[_0x8aa8('0x27')]['id']:0x0,_0x44f2b4[_0x8aa8('0x15')]?_0x44f2b4[_0x8aa8('0x15')]['id']:0x0);if(_0x391642['rules'][_0x3db0d3]){_0x391642['rules'][_0x3db0d3][_0x8aa8('0x3b')]('end');if(rpc[_0x44f2b4[_0x8aa8('0x14')]+'QueueReport']){rpc[_0x44f2b4[_0x8aa8('0x14')]+_0x8aa8('0x42')][_0x8aa8('0x43')](_0x3db0d3,{'UserId':_0x44f2b4[_0x8aa8('0x27')][_0x8aa8('0x44')]})[_0x8aa8('0x45')](function(_0x997597){logger[_0x8aa8('0x3c')](_0x8aa8('0x46'));});}}return _0x56e13f({'code':0xc8,'message':_0x44f2b4});}catch(_0x850854){logger[_0x8aa8('0x3c')](_0x850854[_0x8aa8('0x3d')]);return _0x29e760(_0x5adcda['error'](0x1f4,_0x850854));}}logger[_0x8aa8('0x3c')]('message\x20is\x20empty');return _0x29e760(_0x5adcda['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x40d3f3){var _0x490e6a=this;return new Promise(function(_0x1de402,_0x1474fd){if(_0x40d3f3[_0x8aa8('0x3f')]&&_0x40d3f3['agent']['id']){try{if(_0x391642[_0x8aa8('0x40')][_0x40d3f3[_0x8aa8('0x3f')]['id']]){_0x391642[_0x8aa8('0x40')][_0x40d3f3[_0x8aa8('0x3f')]['id']]['busy']=![];_0x391642['agents'][_0x40d3f3[_0x8aa8('0x3f')]['id']][_0x8aa8('0x41')]=undefined;}return _0x1de402({'code':0xc8,'message':_0x40d3f3});}catch(_0x45ef2d){logger[_0x8aa8('0x3c')](_0x45ef2d['stack']);return _0x1474fd(_0x490e6a['error'](0x1f4,_0x45ef2d));}}logger[_0x8aa8('0x3c')](_0x8aa8('0x47'));return _0x1474fd(_0x490e6a[_0x8aa8('0x3c')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x33e9ae){var _0x3a814f=this;return new Promise(function(_0x501805,_0x5aa8a5){if(_0x33e9ae['channel']&&_0x33e9ae['interaction']&&_0x33e9ae[_0x8aa8('0x15')]['id']){try{var _0x4ab098=getId(_0x33e9ae[_0x8aa8('0x14')],_0x33e9ae[_0x8aa8('0x27')]?_0x33e9ae['message']['id']:0x0,_0x33e9ae['interaction']?_0x33e9ae[_0x8aa8('0x15')]['id']:0x0);if(_0x391642[_0x8aa8('0x37')][_0x4ab098]){_0x391642['rules'][_0x4ab098]['emit']('end');}return _0x501805({'code':0xc8,'message':_0x33e9ae});}catch(_0x3d2076){logger[_0x8aa8('0x3c')](_0x3d2076['stack']);return _0x5aa8a5(_0x3a814f['error'](0x1f4,_0x3d2076));}}logger[_0x8aa8('0x3c')](_0x8aa8('0x47'));return _0x5aa8a5(_0x3a814f['error'](0x1f4,_0x8aa8('0x47')));});},'AgentCapacity':function(_0x43e352){var _0x572e88=this;return new Promise(function(_0x4c8431,_0x5dddbb){if(_0x391642[_0x8aa8('0x40')]['hasOwnProperty'](_0x43e352['id'])){for(var _0x26f771 in _0x43e352[_0x8aa8('0x48')]){if(_0x43e352[_0x8aa8('0x48')][_0x8aa8('0x49')](_0x26f771)){if(_0x391642[_0x8aa8('0x40')][_0x43e352['id']]['hasOwnProperty'](_0x26f771+_0x8aa8('0x4a'))){_0x391642[_0x8aa8('0x40')][_0x43e352['id']][_0x26f771+_0x8aa8('0x4a')]=parseInt(_0x43e352[_0x8aa8('0x48')][_0x26f771],0xa);}}}_0x391642['agents'][_0x43e352['id']][_0x8aa8('0x4b')]();return _0x4c8431({'code':0xc8,'message':_0x391642[_0x8aa8('0x40')][_0x43e352['id']]});}else{return _0x5dddbb(_0x572e88['error'](0x1f4,_0x8aa8('0x4c')));}});},'Agents':function(_0x357013){return new Promise(function(_0x2d322a,_0xec3379){var _0xe1c1c6=_[_0x8aa8('0x4d')](_0x391642[_0x8aa8('0x40')]);_0x2d322a({'count':_0xe1c1c6['length'],'rows':_0xe1c1c6});});},'ChatQueues':function(_0x54f38b){return new Promise(function(_0x53dd80,_0x16d659){var _0x3396fe=[];for(var _0x3b7b2f in _0x391642[_0x8aa8('0x4e')]){if(_0x391642[_0x8aa8('0x4e')][_0x8aa8('0x49')](_0x3b7b2f)){var _0xffab23=_0x391642[_0x8aa8('0x4e')][_0x3b7b2f];var _0x1a6bf2={'id':_0xffab23['id'],'available':_0xffab23[_0x8aa8('0x4f')],'loggedIn':_0xffab23[_0x8aa8('0x50')],'name':_0xffab23[_0x8aa8('0x51')],'paused':_0xffab23[_0x8aa8('0x52')],'waiting':_0xffab23[_0x8aa8('0x53')]};_0x3396fe[_0x8aa8('0x1f')](_0x1a6bf2);}}_0x53dd80({'count':_0x3396fe[_0x8aa8('0x18')],'rows':_0x3396fe});});},'MailQueues':function(_0x84c520){return new Promise(function(_0x2f561d,_0x28cf8a){var _0x57c6f5=[];for(var _0x3b0e4d in _0x391642[_0x8aa8('0x54')]){if(_0x391642[_0x8aa8('0x54')][_0x8aa8('0x49')](_0x3b0e4d)){var _0x46fe7e=_0x391642[_0x8aa8('0x54')][_0x3b0e4d];var _0x127c03={'id':_0x46fe7e['id'],'available':_0x46fe7e[_0x8aa8('0x4f')],'loggedIn':_0x46fe7e[_0x8aa8('0x50')],'name':_0x46fe7e['name'],'paused':_0x46fe7e[_0x8aa8('0x52')],'waiting':_0x46fe7e[_0x8aa8('0x53')]};_0x57c6f5['push'](_0x127c03);}}_0x2f561d({'count':_0x57c6f5[_0x8aa8('0x18')],'rows':_0x57c6f5});});},'OpenchannelQueues':function(_0x5d72d0){return new Promise(function(_0x1e52fc,_0x12dbc8){var _0x4c45a6=[];for(var _0x2fcdf2 in _0x391642[_0x8aa8('0x55')]){if(_0x391642[_0x8aa8('0x55')][_0x8aa8('0x49')](_0x2fcdf2)){var _0xd136db=_0x391642[_0x8aa8('0x55')][_0x2fcdf2];var _0x7236f9={'id':_0xd136db['id'],'available':_0xd136db['available'],'loggedIn':_0xd136db[_0x8aa8('0x50')],'name':_0xd136db[_0x8aa8('0x51')],'paused':_0xd136db[_0x8aa8('0x52')],'waiting':_0xd136db[_0x8aa8('0x53')]};_0x4c45a6['push'](_0x7236f9);}}_0x1e52fc({'count':_0x4c45a6['length'],'rows':_0x4c45a6});});},'SmsQueues':function(_0x284600){return new Promise(function(_0x3cfdc4,_0x430fc9){var _0x39505e=[];for(var _0x486e83 in _0x391642['smsQueues']){if(_0x391642['smsQueues'][_0x8aa8('0x49')](_0x486e83)){var _0x3719b7=_0x391642[_0x8aa8('0x56')][_0x486e83];var _0x306436={'id':_0x3719b7['id'],'available':_0x3719b7[_0x8aa8('0x4f')],'loggedIn':_0x3719b7[_0x8aa8('0x50')],'name':_0x3719b7[_0x8aa8('0x51')],'paused':_0x3719b7[_0x8aa8('0x52')],'waiting':_0x3719b7[_0x8aa8('0x53')]};_0x39505e['push'](_0x306436);}}_0x3cfdc4({'count':_0x39505e[_0x8aa8('0x18')],'rows':_0x39505e});});},'FaxQueues':function(_0x5c90b3){return new Promise(function(_0x51e328,_0x376a37){var _0xf2556b=[];for(var _0x1850af in _0x391642['faxQueues']){if(_0x391642[_0x8aa8('0x57')]['hasOwnProperty'](_0x1850af)){var _0x30b1c4=_0x391642[_0x8aa8('0x57')][_0x1850af];var _0x46a637={'id':_0x30b1c4['id'],'available':_0x30b1c4[_0x8aa8('0x4f')],'loggedIn':_0x30b1c4[_0x8aa8('0x50')],'name':_0x30b1c4['name'],'paused':_0x30b1c4['paused'],'waiting':_0x30b1c4[_0x8aa8('0x53')]};_0xf2556b[_0x8aa8('0x1f')](_0x46a637);}}_0x51e328({'count':_0xf2556b[_0x8aa8('0x18')],'rows':_0xf2556b});});},'WhatsappQueues':function(_0x21f3f8){return new Promise(function(_0x3364db,_0x358fb6){var _0x2be0c5=[];for(var _0x8e3ae6 in _0x391642['whatsappQueues']){if(_0x391642[_0x8aa8('0x58')][_0x8aa8('0x49')](_0x8e3ae6)){var _0x4f39f2=_0x391642['whatsappQueues'][_0x8e3ae6];var _0x202b9c={'id':_0x4f39f2['id'],'available':_0x4f39f2[_0x8aa8('0x4f')],'loggedIn':_0x4f39f2['loggedIn'],'name':_0x4f39f2[_0x8aa8('0x51')],'paused':_0x4f39f2[_0x8aa8('0x52')],'waiting':_0x4f39f2[_0x8aa8('0x53')]};_0x2be0c5['push'](_0x202b9c);}}_0x3364db({'count':_0x2be0c5['length'],'rows':_0x2be0c5});});},'ChatQueuesWaitingInteractions':function(_0x5a2ef1){return new Promise(function(_0x378de8,_0x2dcf5a){var _0xc6f4e6=_[_0x8aa8('0x4d')](_0x391642['chatQueuesWaitingInteractions']);_0x378de8({'count':_0xc6f4e6[_0x8aa8('0x18')],'rows':_0xc6f4e6});});},'MailQueuesWaitingInteractions':function(_0x5ed97b){return new Promise(function(_0x323aca,_0x126133){var _0x5bfcb3=_[_0x8aa8('0x4d')](_0x391642['mailQueuesWaitingInteractions']);_0x323aca({'count':_0x5bfcb3['length'],'rows':_0x5bfcb3});});},'OpenchannelQueuesWaitingInteractions':function(_0x430bb1){return new Promise(function(_0x47e120,_0x2307ff){var _0x34a5a9=_[_0x8aa8('0x4d')](_0x391642['openchannelQueuesWaitingInteractions']);_0x47e120({'count':_0x34a5a9[_0x8aa8('0x18')],'rows':_0x34a5a9});});},'SmsQueuesWaitingInteractions':function(_0x3d30b7){return new Promise(function(_0x19ecab,_0x3926a8){var _0x20260e=_[_0x8aa8('0x4d')](_0x391642['smsQueuesWaitingInteractions']);_0x19ecab({'count':_0x20260e['length'],'rows':_0x20260e});});},'FaxQueuesWaitingInteractions':function(_0x839d86){return new Promise(function(_0x4bd4ff,_0x5e864a){var _0x514f6e=_['values'](_0x391642['faxQueuesWaitingInteractions']);_0x4bd4ff({'count':_0x514f6e[_0x8aa8('0x18')],'rows':_0x514f6e});});},'WhatsappQueuesWaitingInteractions':function(_0x26092c){return new Promise(function(_0x183945,_0x1ab514){var _0x2f74db=_[_0x8aa8('0x4d')](_0x391642[_0x8aa8('0x59')]);_0x183945({'count':_0x2f74db[_0x8aa8('0x18')],'rows':_0x2f74db});});}};var _0x1582bd=jayson[_0x8aa8('0x5a')](_0x200662)['http']();_0x1582bd['on']('error',function(_0x11b395){logger[_0x8aa8('0x3c')](JSON[_0x8aa8('0x39')](_0x11b395));return _0x433e95(_0x11b395);});_0x1582bd[_0x8aa8('0x5b')](0x232c,_0x8aa8('0x5c'),function(){console[_0x8aa8('0x5d')](_0x8aa8('0x5e'),0x232c);return _0x4f3a2e(_0x8aa8('0x5f')+0x232c);});});}; \ No newline at end of file +var _0x6075=['catch','message\x20is\x20empty','hasOwnProperty','capacity','updateRealtime','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../../../config/environment','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','push','appdata','dialogflowv2','slice','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId'];(function(_0x2fa44f,_0x3569f6){var _0x472000=function(_0x559072){while(--_0x559072){_0x2fa44f['push'](_0x2fa44f['shift']());}};_0x472000(++_0x3569f6);}(_0x6075,0x142));var _0x5607=function(_0x43f6c1,_0x5ae841){_0x43f6c1=_0x43f6c1-0x0;var _0x551f0b=_0x6075[_0x43f6c1];return _0x551f0b;};'use strict';var _=require(_0x5607('0x0'));var util=require(_0x5607('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x5607('0x2'));var BPromise=require(_0x5607('0x3'));var uuid=require('uuid');var utils=require('./applications/utils');var config=require(_0x5607('0x4'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x5607('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x5607('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x5607('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x5607('0x8'));function getId(_0x5f92ad,_0xbdf802,_0xea0d09){return util[_0x5607('0x9')](_0x5607('0xa'),_0x5f92ad,_0xbdf802||0x0,_0xea0d09||0x0);}function getIntervals(_0x3769ef,_0x24d65d){var _0x16db79=[];if(!_[_0x5607('0xb')](_0x24d65d[_0x5607('0xc')])&&!_[_0x5607('0xb')](_0x3769ef[_0x24d65d[_0x5607('0xc')]])&&!_['isNil'](_0x3769ef[_0x24d65d[_0x5607('0xc')]][_0x5607('0xd')])){_0x16db79=_[_0x5607('0xe')](_0x3769ef[_0x24d65d['IntervalId']][_0x5607('0xd')],_0x5607('0xf'));}else if(!_['isNil'](_0x24d65d[_0x5607('0xf')])){_0x16db79=[_0x24d65d[_0x5607('0xf')]];}return _0x16db79;}exports['listen']=function(_0x44642d){_0x44642d['rules']={};return new BPromise(function(_0x28cf69,_0x22750d){var _0x255936={'Start':function(_0x381634){var _0x5ba100=this;return new Promise(function(_0x17ede4,_0x127f46){if(_0x381634){try{var _0x2decbc=[];var _0x156060=getId(_0x381634[_0x5607('0x10')],_0x381634[_0x5607('0x11')]?_0x381634[_0x5607('0x11')]['id']:0x0,_0x381634[_0x5607('0x12')]?_0x381634[_0x5607('0x12')]['id']:0x0);if(_0x381634[_0x5607('0x13')]&&_[_0x5607('0x14')](_0x381634[_0x5607('0x13')])&&_0x381634['applications']['length']){for(var _0x49f89c=0x0;_0x49f89c<_0x381634['applications'][_0x5607('0x15')];_0x49f89c+=0x1){var _0x19ffff=_0x381634[_0x5607('0x13')][_0x49f89c];if(fs[_0x5607('0x16')](path[_0x5607('0x17')](__dirname,_0x5607('0x13'),_0x19ffff[_0x5607('0x18')]+_0x5607('0x19')))){var _0x5ecb83=[];switch(_0x19ffff['app'][_0x5607('0x1a')]()){case _0x5607('0x1b'):var _0x302033=_0x19ffff['appdata'][_0x5607('0x1c')](',');if(_0x381634[_0x5607('0x10')]===_0x5607('0x1d')){_0x5ecb83[_0x5607('0x1e')](_0x302033[0x0]);_0x5ecb83[_0x5607('0x1e')](_0x302033[0x1]);_0x5ecb83[_0x5607('0x1e')](_0x302033['slice'](0x2,_0x302033['length'])[_0x5607('0x17')](','));}else{_0x5ecb83[_0x5607('0x1e')](_0x302033[0x0]);_0x5ecb83[_0x5607('0x1e')](_0x302033['slice'](0x1,_0x302033['length'])[_0x5607('0x17')](','));}break;case'dialogflow':var _0x2b53d9=_0x19ffff[_0x5607('0x1f')][_0x5607('0x1c')](',');_0x5ecb83[_0x5607('0x1e')](_0x2b53d9[0x0]);_0x5ecb83[_0x5607('0x1e')](_0x2b53d9[0x1]);_0x5ecb83['push'](_0x2b53d9['slice'](0x2,_0x2b53d9[_0x5607('0x15')])[_0x5607('0x17')](','));break;case _0x5607('0x20'):var _0x464ffa=_0x19ffff[_0x5607('0x1f')][_0x5607('0x1c')](',');_0x5ecb83[_0x5607('0x1e')](_0x464ffa[0x0]);_0x5ecb83[_0x5607('0x1e')](_0x464ffa[0x1]);_0x5ecb83['push'](_0x464ffa[0x2]);_0x5ecb83[_0x5607('0x1e')](_0x464ffa[0x3]);_0x5ecb83[_0x5607('0x1e')](_0x464ffa[_0x5607('0x21')](0x4,_0x464ffa[_0x5607('0x15')])[_0x5607('0x17')](','));break;case _0x5607('0x22'):var _0x337216=_0x19ffff[_0x5607('0x1f')][_0x5607('0x1c')](',');_0x5ecb83[_0x5607('0x1e')](_0x337216[0x0]);_0x5ecb83['push'](_0x337216[0x1]);_0x5ecb83[_0x5607('0x1e')](_0x337216[0x2]);_0x5ecb83['push'](_0x337216[0x3]);_0x5ecb83[_0x5607('0x1e')](_0x337216[_0x5607('0x21')](0x4,_0x337216[_0x5607('0x15')])[_0x5607('0x17')](','));break;case _0x5607('0x11'):_0x5ecb83['push'](_0x19ffff[_0x5607('0x1f')]);break;case _0x5607('0x23'):_0x5ecb83[_0x5607('0x1e')](_0x19ffff[_0x5607('0x24')]);_0x5ecb83[_0x5607('0x1e')](_0x19ffff[_0x5607('0x1f')]);break;case _0x5607('0x25'):var _0x46851a=utils[_0x5607('0x26')](_0x381634['account'][_0x5607('0x27')],_0x381634);var _0x3cb857=_0x19ffff[_0x5607('0x1f')][_0x5607('0x1c')](',');_0x5ecb83['push'](_0x3cb857[0x0]);_0x5ecb83['push'](_0x3cb857[0x1]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x2]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x3]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x4]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x5]);_0x5ecb83['push'](_0x3cb857[0x6]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x7]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x8]);_0x5ecb83[_0x5607('0x1e')](_0x3cb857[0x9]);_0x5ecb83['push'](_0x3cb857[0xa]);_0x5ecb83[_0x5607('0x1e')](_0x381634['interaction']['id']);_0x5ecb83[_0x5607('0x1e')](_0x381634[_0x5607('0x11')]['id']);_0x5ecb83[_0x5607('0x1e')](_0x19ffff[_0x5607('0x28')]);_0x5ecb83[_0x5607('0x1e')](_0x381634[_0x5607('0x12')][_0x5607('0x29')]);_0x5ecb83[_0x5607('0x1e')](_0x381634[_0x5607('0x2a')][_0x5607('0x2a')]);_0x5ecb83[_0x5607('0x1e')](_0x46851a);break;default:_0x5ecb83=_[_0x5607('0xb')](_0x19ffff[_0x5607('0x1f')])?[]:_0x19ffff['appdata'][_0x5607('0x1c')](',');}var _0x4f5b0f={'id':util[_0x5607('0x9')](_0x5607('0x2b'),_0x156060,_0x19ffff['id'],_0x19ffff[_0x5607('0x18')]),'condition':require(_0x5607('0x2c'))[_0x5607('0x2d')](_0x156060,getIntervals(_0x44642d[_0x5607('0x2e')],_0x19ffff),_0x44642d),'consequence':require(_0x5607('0x2f')+_0x19ffff[_0x5607('0x18')])['consequence'](_0x156060,_0x5ecb83,_0x44642d,_0x381634),'p':_0x19ffff[_0x5607('0x30')]||0x0};logger['info']('Push\x20new\x20rule',_0x4f5b0f['id'],'on\x20interval',getIntervals(_0x44642d[_0x5607('0x2e')],_0x19ffff)[_0x5607('0x17')]('\x20|\x20'));_0x2decbc[_0x5607('0x1e')](_0x4f5b0f);}else{logger[_0x5607('0x31')](_0x5607('0x32'),path[_0x5607('0x17')](__dirname,_0x5607('0x13'),_0x19ffff[_0x5607('0x18')]+_0x5607('0x19')));}}_0x44642d[_0x5607('0x33')][_0x156060]=new RuleEngine(_0x2decbc);_0x44642d['rules'][_0x156060][_0x5607('0x34')](_0x381634,function(_0x543a6b){logger[_0x5607('0x35')](_0x5607('0x36'),JSON[_0x5607('0x37')](_0x543a6b[_0x5607('0x38')]));if(_0x44642d[_0x5607('0x33')][_0x156060]){_0x44642d[_0x5607('0x33')][_0x156060][_0x5607('0x39')](_0x5607('0x3a'));}});return _0x17ede4({'code':0xc8,'message':_0x381634});}else{logger[_0x5607('0x35')](_0x5607('0x3b'));return _0x17ede4({'code':0xc8,'message':_0x381634});}}catch(_0x3af45e){logger['error'](_0x3af45e[_0x5607('0x3c')]);return _0x127f46(_0x5ba100[_0x5607('0x31')](0x1f4,_0x3af45e));}}return _0x127f46(_0x5607('0x3d'));});},'AcceptMessage':function(_0x146b72){var _0x5a01e2=this;return new Promise(function(_0x228dbd,_0x3e1bfc){if(_0x146b72['agent']&&_0x146b72[_0x5607('0x3e')]['id']){if(_0x44642d[_0x5607('0x3f')][_0x146b72[_0x5607('0x3e')]['id']]){_0x44642d['agents'][_0x146b72[_0x5607('0x3e')]['id']][_0x5607('0x40')]=![];_0x44642d[_0x5607('0x3f')][_0x146b72[_0x5607('0x3e')]['id']][_0x5607('0x41')]=undefined;}}if(_0x146b72['message']&&_0x146b72[_0x5607('0x11')]['id']){try{var _0x4c0119=getId(_0x146b72[_0x5607('0x10')],_0x146b72[_0x5607('0x11')]?_0x146b72[_0x5607('0x11')]['id']:0x0,_0x146b72['interaction']?_0x146b72[_0x5607('0x12')]['id']:0x0);if(_0x44642d[_0x5607('0x33')][_0x4c0119]){_0x44642d[_0x5607('0x33')][_0x4c0119][_0x5607('0x39')](_0x5607('0x42'));if(rpc[_0x146b72[_0x5607('0x10')]+_0x5607('0x43')]){rpc[_0x146b72[_0x5607('0x10')]+_0x5607('0x43')][_0x5607('0x44')](_0x4c0119,{'UserId':_0x146b72[_0x5607('0x11')][_0x5607('0x45')]})[_0x5607('0x46')](function(_0x48f25e){logger[_0x5607('0x31')]('error\x20update\x20queue\x20report');});}}return _0x228dbd({'code':0xc8,'message':_0x146b72});}catch(_0x423996){logger['error'](_0x423996[_0x5607('0x3c')]);return _0x3e1bfc(_0x5a01e2[_0x5607('0x31')](0x1f4,_0x423996));}}logger[_0x5607('0x31')](_0x5607('0x47'));return _0x3e1bfc(_0x5a01e2[_0x5607('0x31')](0x1f4,_0x5607('0x47')));});},'RejectMessage':function(_0x2757cd){var _0x11eca5=this;return new Promise(function(_0x3bd213,_0x46924c){if(_0x2757cd[_0x5607('0x3e')]&&_0x2757cd[_0x5607('0x3e')]['id']){try{if(_0x44642d[_0x5607('0x3f')][_0x2757cd[_0x5607('0x3e')]['id']]){_0x44642d[_0x5607('0x3f')][_0x2757cd[_0x5607('0x3e')]['id']]['busy']=![];_0x44642d['agents'][_0x2757cd[_0x5607('0x3e')]['id']]['busyQueue']=undefined;}return _0x3bd213({'code':0xc8,'message':_0x2757cd});}catch(_0x36e4ee){logger[_0x5607('0x31')](_0x36e4ee['stack']);return _0x46924c(_0x11eca5[_0x5607('0x31')](0x1f4,_0x36e4ee));}}logger['error'](_0x5607('0x47'));return _0x46924c(_0x11eca5[_0x5607('0x31')](0x1f4,_0x5607('0x47')));});},'AbandonInteraction':function(_0x59c29c){var _0x9bf8c5=this;return new Promise(function(_0x144324,_0x4fa3c9){if(_0x59c29c[_0x5607('0x10')]&&_0x59c29c['interaction']&&_0x59c29c['interaction']['id']){try{var _0x4b5180=getId(_0x59c29c[_0x5607('0x10')],_0x59c29c[_0x5607('0x11')]?_0x59c29c[_0x5607('0x11')]['id']:0x0,_0x59c29c[_0x5607('0x12')]?_0x59c29c[_0x5607('0x12')]['id']:0x0);if(_0x44642d['rules'][_0x4b5180]){_0x44642d[_0x5607('0x33')][_0x4b5180][_0x5607('0x39')](_0x5607('0x42'));}return _0x144324({'code':0xc8,'message':_0x59c29c});}catch(_0x5882cf){logger[_0x5607('0x31')](_0x5882cf[_0x5607('0x3c')]);return _0x4fa3c9(_0x9bf8c5['error'](0x1f4,_0x5882cf));}}logger[_0x5607('0x31')](_0x5607('0x47'));return _0x4fa3c9(_0x9bf8c5[_0x5607('0x31')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1d327d){var _0x2e5e41=this;return new Promise(function(_0xae9cec,_0x49db6b){if(_0x44642d['agents'][_0x5607('0x48')](_0x1d327d['id'])){for(var _0x29b339 in _0x1d327d[_0x5607('0x49')]){if(_0x1d327d[_0x5607('0x49')]['hasOwnProperty'](_0x29b339)){if(_0x44642d['agents'][_0x1d327d['id']][_0x5607('0x48')](_0x29b339+'CurrentCapacity')){_0x44642d[_0x5607('0x3f')][_0x1d327d['id']][_0x29b339+'CurrentCapacity']=parseInt(_0x1d327d[_0x5607('0x49')][_0x29b339],0xa);}}}_0x44642d['agents'][_0x1d327d['id']][_0x5607('0x4a')]();return _0xae9cec({'code':0xc8,'message':_0x44642d[_0x5607('0x3f')][_0x1d327d['id']]});}else{return _0x49db6b(_0x2e5e41[_0x5607('0x31')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2c37c8){return new Promise(function(_0x58841e,_0xf67523){var _0x13fc19=_[_0x5607('0x4b')](_0x44642d['agents']);_0x58841e({'count':_0x13fc19[_0x5607('0x15')],'rows':_0x13fc19});});},'ChatQueues':function(_0x4682ed){return new Promise(function(_0x2070e1,_0x296493){var _0x532efc=[];for(var _0x3ba30c in _0x44642d[_0x5607('0x4c')]){if(_0x44642d[_0x5607('0x4c')][_0x5607('0x48')](_0x3ba30c)){var _0x199de7=_0x44642d[_0x5607('0x4c')][_0x3ba30c];var _0x154176={'id':_0x199de7['id'],'available':_0x199de7[_0x5607('0x4d')],'loggedIn':_0x199de7['loggedIn'],'name':_0x199de7[_0x5607('0x4e')],'paused':_0x199de7[_0x5607('0x4f')],'waiting':_0x199de7[_0x5607('0x50')]};_0x532efc[_0x5607('0x1e')](_0x154176);}}_0x2070e1({'count':_0x532efc[_0x5607('0x15')],'rows':_0x532efc});});},'MailQueues':function(_0x1449c2){return new Promise(function(_0x3b282a,_0x44d294){var _0x215c19=[];for(var _0x2678f5 in _0x44642d[_0x5607('0x51')]){if(_0x44642d[_0x5607('0x51')]['hasOwnProperty'](_0x2678f5)){var _0x10e477=_0x44642d['mailQueues'][_0x2678f5];var _0x3407b9={'id':_0x10e477['id'],'available':_0x10e477[_0x5607('0x4d')],'loggedIn':_0x10e477[_0x5607('0x52')],'name':_0x10e477[_0x5607('0x4e')],'paused':_0x10e477['paused'],'waiting':_0x10e477[_0x5607('0x50')]};_0x215c19['push'](_0x3407b9);}}_0x3b282a({'count':_0x215c19[_0x5607('0x15')],'rows':_0x215c19});});},'OpenchannelQueues':function(_0x52c121){return new Promise(function(_0x17fa4f,_0x3aa308){var _0xf6a11e=[];for(var _0x4faede in _0x44642d[_0x5607('0x53')]){if(_0x44642d['openchannelQueues'][_0x5607('0x48')](_0x4faede)){var _0x535199=_0x44642d[_0x5607('0x53')][_0x4faede];var _0x46b361={'id':_0x535199['id'],'available':_0x535199[_0x5607('0x4d')],'loggedIn':_0x535199['loggedIn'],'name':_0x535199['name'],'paused':_0x535199[_0x5607('0x4f')],'waiting':_0x535199['waiting']};_0xf6a11e[_0x5607('0x1e')](_0x46b361);}}_0x17fa4f({'count':_0xf6a11e['length'],'rows':_0xf6a11e});});},'SmsQueues':function(_0x1279cd){return new Promise(function(_0x3c07ba,_0x44c78c){var _0xbbf534=[];for(var _0x62d623 in _0x44642d[_0x5607('0x54')]){if(_0x44642d[_0x5607('0x54')]['hasOwnProperty'](_0x62d623)){var _0x3c768f=_0x44642d[_0x5607('0x54')][_0x62d623];var _0x507d84={'id':_0x3c768f['id'],'available':_0x3c768f[_0x5607('0x4d')],'loggedIn':_0x3c768f[_0x5607('0x52')],'name':_0x3c768f['name'],'paused':_0x3c768f[_0x5607('0x4f')],'waiting':_0x3c768f[_0x5607('0x50')]};_0xbbf534[_0x5607('0x1e')](_0x507d84);}}_0x3c07ba({'count':_0xbbf534['length'],'rows':_0xbbf534});});},'FaxQueues':function(_0x2c13a3){return new Promise(function(_0x57fead,_0x3c690d){var _0x4462f3=[];for(var _0x25af8d in _0x44642d['faxQueues']){if(_0x44642d[_0x5607('0x55')]['hasOwnProperty'](_0x25af8d)){var _0x15fbe1=_0x44642d[_0x5607('0x55')][_0x25af8d];var _0x2f095b={'id':_0x15fbe1['id'],'available':_0x15fbe1[_0x5607('0x4d')],'loggedIn':_0x15fbe1[_0x5607('0x52')],'name':_0x15fbe1[_0x5607('0x4e')],'paused':_0x15fbe1[_0x5607('0x4f')],'waiting':_0x15fbe1[_0x5607('0x50')]};_0x4462f3['push'](_0x2f095b);}}_0x57fead({'count':_0x4462f3[_0x5607('0x15')],'rows':_0x4462f3});});},'WhatsappQueues':function(_0x2e0e47){return new Promise(function(_0x3da889,_0xd61bd5){var _0x31a70d=[];for(var _0x415071 in _0x44642d[_0x5607('0x56')]){if(_0x44642d[_0x5607('0x56')][_0x5607('0x48')](_0x415071)){var _0x55cf6a=_0x44642d[_0x5607('0x56')][_0x415071];var _0x5f4547={'id':_0x55cf6a['id'],'available':_0x55cf6a['available'],'loggedIn':_0x55cf6a[_0x5607('0x52')],'name':_0x55cf6a[_0x5607('0x4e')],'paused':_0x55cf6a[_0x5607('0x4f')],'waiting':_0x55cf6a[_0x5607('0x50')]};_0x31a70d[_0x5607('0x1e')](_0x5f4547);}}_0x3da889({'count':_0x31a70d[_0x5607('0x15')],'rows':_0x31a70d});});},'ChatQueuesWaitingInteractions':function(_0x17b163){return new Promise(function(_0x6cd7c9,_0x2d3496){var _0x451d9f=_[_0x5607('0x4b')](_0x44642d['chatQueuesWaitingInteractions']);_0x6cd7c9({'count':_0x451d9f[_0x5607('0x15')],'rows':_0x451d9f});});},'MailQueuesWaitingInteractions':function(_0x15ebad){return new Promise(function(_0x2c237e,_0x2f9286){var _0x3fb72a=_['values'](_0x44642d[_0x5607('0x57')]);_0x2c237e({'count':_0x3fb72a[_0x5607('0x15')],'rows':_0x3fb72a});});},'OpenchannelQueuesWaitingInteractions':function(_0x38cff5){return new Promise(function(_0x47f6b8,_0x545560){var _0x8e1705=_[_0x5607('0x4b')](_0x44642d[_0x5607('0x58')]);_0x47f6b8({'count':_0x8e1705[_0x5607('0x15')],'rows':_0x8e1705});});},'SmsQueuesWaitingInteractions':function(_0x1629ca){return new Promise(function(_0x375795,_0x2bca5f){var _0x588f33=_[_0x5607('0x4b')](_0x44642d[_0x5607('0x59')]);_0x375795({'count':_0x588f33[_0x5607('0x15')],'rows':_0x588f33});});},'FaxQueuesWaitingInteractions':function(_0x461ba4){return new Promise(function(_0x2c8f08,_0x223910){var _0x4a2489=_[_0x5607('0x4b')](_0x44642d[_0x5607('0x5a')]);_0x2c8f08({'count':_0x4a2489[_0x5607('0x15')],'rows':_0x4a2489});});},'WhatsappQueuesWaitingInteractions':function(_0x20363c){return new Promise(function(_0x4ed8f8,_0xb2cef6){var _0x396c99=_[_0x5607('0x4b')](_0x44642d[_0x5607('0x5b')]);_0x4ed8f8({'count':_0x396c99[_0x5607('0x15')],'rows':_0x396c99});});}};var _0x15f215=jayson[_0x5607('0x5c')](_0x255936)[_0x5607('0x5d')]();_0x15f215['on']('error',function(_0x125851){logger[_0x5607('0x31')](JSON[_0x5607('0x37')](_0x125851));return _0x22750d(_0x125851);});_0x15f215[_0x5607('0x5e')](0x232c,'127.0.0.1',function(){console[_0x5607('0x5f')](_0x5607('0x60'),0x232c);return _0x28cf69(_0x5607('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 61116ef..9f880fb 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 _0x4c27=['routing','client','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x4c27,0xdc));var _0x74c2=function(_0x3ef025,_0x482650){_0x3ef025=_0x3ef025-0x0;var _0x31da17=_0x4c27[_0x3ef025];return _0x31da17;};'use strict';var util=require('util');var BPromise=require(_0x74c2('0x0'));var jayson=require(_0x74c2('0x1'));var _=require(_0x74c2('0x2'));var logger=require(_0x74c2('0x3'))(_0x74c2('0x4'));var client=jayson[_0x74c2('0x5')][_0x74c2('0x6')]({'port':0x232a});function request(_0xe339c,_0x1f6881){return new BPromise(function(_0x3770c7,_0x223ba8){return client[_0x74c2('0x7')](_0xe339c,_0x1f6881)[_0x74c2('0x8')](function(_0x22058c){if(_0x22058c[_0x74c2('0x9')]){return _0x223ba8(_0x22058c[_0x74c2('0x9')][_0x74c2('0xa')]);}else{return _0x3770c7(_0x22058c['result']);}})[_0x74c2('0xb')](function(_0x32e00e){return _0x223ba8(_0x32e00e);});});}exports[_0x74c2('0xc')]=function(_0x311571,_0x3f4199,_0x3bddf1){return function(_0x2100a1){if(_0x3bddf1['rules']&&!_0x3bddf1[_0x74c2('0xd')][_0x311571]){logger[_0x74c2('0xe')](_0x74c2('0xf'),_0x311571);return _0x2100a1[_0x74c2('0x10')]();}var _0x52dad3=[];for(var _0x26a011=0x0;_0x26a011<_0x3f4199[_0x74c2('0x11')];_0x26a011+=0x1){_0x52dad3[_0x74c2('0x12')](request(_0x74c2('0x13'),{'command':util[_0x74c2('0x14')]('iftime\x20%s',_0x3f4199[_0x26a011])})[_0x74c2('0x8')](function(_0x1c31e6){return _0x1c31e6&&_0x1c31e6[_0x74c2('0xa')]&&_0x1c31e6[_0x74c2('0xa')][_0x74c2('0x15')](_0x74c2('0x16'))>=0x0?!![]:![];})[_0x74c2('0xb')](function(_0x42d8cd){logger['error'](_0x74c2('0x17'),_0x311571,_0x3f4199[_0x26a011]);}));}BPromise[_0x74c2('0x18')](_0x52dad3)[_0x74c2('0x8')](function(_0x2765e1){var _0x71870=_[_0x74c2('0x19')](_0x2765e1);logger[_0x74c2('0xe')](_0x74c2('0x1a'),_0x311571,_0x3f4199[_0x74c2('0x1b')](_0x74c2('0x1c')),_0x71870);_0x2100a1[_0x74c2('0x1d')](_0x71870);})[_0x74c2('0xb')](function(_0x2fe482){console[_0x74c2('0x1e')](_0x2fe482);logger[_0x74c2('0x9')](_0x74c2('0x1a'),_0x311571,_0x3f4199['join']('\x20|\x20'),_0x2fe482[_0x74c2('0x1f')]);_0x2100a1[_0x74c2('0x10')]();});};}; \ No newline at end of file +var _0xf1b7=['[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','stop','util','bluebird','../../../config/logger','routing','client','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','iftime\x20%s'];(function(_0x4f4be7,_0x26b8c8){var _0x2dd428=function(_0x5bc822){while(--_0x5bc822){_0x4f4be7['push'](_0x4f4be7['shift']());}};_0x2dd428(++_0x26b8c8);}(_0xf1b7,0xd8));var _0x7f1b=function(_0x194f8c,_0x3faf0d){_0x194f8c=_0x194f8c-0x0;var _0x32e3c9=_0xf1b7[_0x194f8c];return _0x32e3c9;};'use strict';var util=require(_0x7f1b('0x0'));var BPromise=require(_0x7f1b('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x7f1b('0x2'))(_0x7f1b('0x3'));var client=jayson[_0x7f1b('0x4')][_0x7f1b('0x5')]({'port':0x232a});function request(_0x2e686f,_0x2e01a2){return new BPromise(function(_0x33531b,_0xe56c38){return client[_0x7f1b('0x6')](_0x2e686f,_0x2e01a2)[_0x7f1b('0x7')](function(_0x145e13){if(_0x145e13['error']){return _0xe56c38(_0x145e13[_0x7f1b('0x8')][_0x7f1b('0x9')]);}else{return _0x33531b(_0x145e13['result']);}})[_0x7f1b('0xa')](function(_0x3f6d87){return _0xe56c38(_0x3f6d87);});});}exports[_0x7f1b('0xb')]=function(_0x427ae4,_0x3cd91f,_0x1d8b53){return function(_0x3d9d37){if(_0x1d8b53[_0x7f1b('0xc')]&&!_0x1d8b53[_0x7f1b('0xc')][_0x427ae4]){logger[_0x7f1b('0xd')](_0x7f1b('0xe'),_0x427ae4);return _0x3d9d37['stop']();}var _0x245bf5=[];for(var _0x16d7f8=0x0;_0x16d7f8<_0x3cd91f[_0x7f1b('0xf')];_0x16d7f8+=0x1){_0x245bf5['push'](request(_0x7f1b('0x10'),{'command':util['format'](_0x7f1b('0x11'),_0x3cd91f[_0x16d7f8])})['then'](function(_0x5ad30c){return _0x5ad30c&&_0x5ad30c[_0x7f1b('0x9')]&&_0x5ad30c['message']['indexOf']('true')>=0x0?!![]:![];})[_0x7f1b('0xa')](function(_0x401099){logger[_0x7f1b('0x8')](_0x7f1b('0x12'),_0x427ae4,_0x3cd91f[_0x16d7f8]);}));}BPromise[_0x7f1b('0x13')](_0x245bf5)[_0x7f1b('0x7')](function(_0x9680aa){var _0x36af8f=_['some'](_0x9680aa);logger[_0x7f1b('0xd')](_0x7f1b('0x14'),_0x427ae4,_0x3cd91f[_0x7f1b('0x15')](_0x7f1b('0x16')),_0x36af8f);_0x3d9d37['when'](_0x36af8f);})[_0x7f1b('0xa')](function(_0x2a3970){console[_0x7f1b('0x17')](_0x2a3970);logger[_0x7f1b('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x427ae4,_0x3cd91f[_0x7f1b('0x15')](_0x7f1b('0x16')),_0x2a3970[_0x7f1b('0x18')]);_0x3d9d37[_0x7f1b('0x19')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ed4229a..714a6cd 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xf45e,0x115));var _0xef45=function(_0x1c2230,_0x823fa7){_0x1c2230=_0x1c2230-0x0;var _0x454241=_0xf45e[_0x1c2230];return _0x454241;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file +var _0x13f6=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','calleridname','agententerreason','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','format','uniqueid','channel','queue','interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','membername','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]'];(function(_0x1dcfd8,_0x27f5bc){var _0x3026f8=function(_0x200189){while(--_0x200189){_0x1dcfd8['push'](_0x1dcfd8['shift']());}};_0x3026f8(++_0x27f5bc);}(_0x13f6,0x124));var _0x613f=function(_0x37ea1e,_0x1a0f89){_0x37ea1e=_0x37ea1e-0x0;var _0x2f1d97=_0x13f6[_0x37ea1e];return _0x2f1d97;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563492,_0xd04cfd){utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x563492[_0x613f('0x4')],_0x563492[_0x613f('0x5')],_0x563492[_0x613f('0x6')],_0x563492['membername'],_0x563492[_0x613f('0x7')],_0x563492[_0x613f('0x8')],_0x563492['connectedlinenum'],_0x563492['lastevent']));if(_0x563492['queue']){utils['getVoiceQueueByName'](_0x563492[_0x613f('0x6')])[_0x613f('0x9')](function(_0x363736){if(_0x363736){_0x563492[_0x613f('0xa')]=_0x363736['type'];_0x563492[_0x613f('0xb')]=_0x563492[_0x613f('0xc')]?_0x363736[_0x613f('0xd')]:![];_0x563492['acwtime']=_0x563492[_0x613f('0xb')]?_0x363736[_0x613f('0xe')]:0x0;}utils[_0x613f('0xf')]('CreateVoiceAgentReport',_0x563492);});}else{utils[_0x613f('0xf')](_0x613f('0x10'),_0x563492);}if(_0xd04cfd){delete transfers[_0x563492['uniqueid']];}else{delete agents[_0x563492['destuniqueid']];}}exports['agentcalled']=function(_0x38d90a){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x12'),_0x38d90a[_0x613f('0x4')]),_0x38d90a);agents[_0x38d90a[_0x613f('0x13')]]=_0x38d90a;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();agents[_0x38d90a[_0x613f('0x13')]]['lastevent']=_0x613f('0x16');agents[_0x38d90a['destuniqueid']]['connectedlinenum']=null;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x17')]=null;utils['info'](util[_0x613f('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x38d90a[_0x613f('0x4')],agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x18')],_0x38d90a[_0x613f('0x13')]));}catch(_0x3c0feb){utils[_0x613f('0x19')](util['format']('[%s][agents][agentcalled]',_0x38d90a[_0x613f('0x4')]),_0x3c0feb);}};exports['agentringnoanswer']=function(_0x48493c){try{if(!_[_0x613f('0x1a')](agents[_0x48493c[_0x613f('0x13')]])){utils['debug'](util[_0x613f('0x3')](_0x613f('0x1b'),_0x48493c[_0x613f('0x4')]),_0x48493c);utils['info'](util['format'](_0x613f('0x1c'),_0x48493c[_0x613f('0x4')],agents[_0x48493c[_0x613f('0x13')]]['membername'],_0x48493c[_0x613f('0x13')]));agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1d')]=!![];agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1e')]=utils['now']();agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1f')]='timeout';agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x20')]=_0x613f('0x21');agents[_0x48493c['destuniqueid']]['holdtime']=_0x48493c['ringtime']?parseInt(_0x48493c[_0x613f('0x22')])/0x3e8:0x0;agents[_0x48493c['destuniqueid']][_0x613f('0x23')]=0x0;unanswered[_0x613f('0x24')](_0x48493c['destuniqueid']);}}catch(_0x121241){utils[_0x613f('0x19')](util['format']('[%s][agents][agentringnoanswer]',_0x48493c['uniqueid']),_0x121241);}};exports[_0x613f('0x25')]=function(_0x7c1a94){try{_[_0x613f('0x26')](agents,function(_0x47f4af,_0x23eda8){if(_0x47f4af[_0x613f('0x4')]==_0x7c1a94[_0x613f('0x4')]&&!_[_0x613f('0x27')](unanswered,_0x47f4af['destuniqueid'])){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x7c1a94);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x7c1a94[_0x613f('0x4')],_0x47f4af[_0x613f('0x18')],_0x47f4af[_0x613f('0x13')]));_0x47f4af['agentringnoanswer']=!![];_0x47f4af[_0x613f('0x1e')]=utils['now']();_0x47f4af[_0x613f('0x1f')]=_0x613f('0x29');_0x47f4af[_0x613f('0x20')]=_0x613f('0x29');_0x47f4af[_0x613f('0x2a')]=_0x7c1a94[_0x613f('0x2a')];_0x47f4af['talktime']=0x0;writeDB(_0x47f4af);}});}catch(_0x1a18ce){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x1a18ce);}};exports['agentconnect']=function(_0x59236e){try{if(agents[_0x59236e['destuniqueid']]){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x59236e);utils['info'](util[_0x613f('0x3')](_0x613f('0x2c'),_0x59236e['uniqueid'],agents[_0x59236e[_0x613f('0x13')]]['membername'],_0x59236e[_0x613f('0x13')]));agents[_0x59236e['destuniqueid']][_0x613f('0x2d')]=utils['now']();agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2e')]=_0x59236e[_0x613f('0x2e')];agents[_0x59236e['destuniqueid']][_0x613f('0x17')]=_0x59236e[_0x613f('0x17')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x2f');_[_0x613f('0x26')](agents,function(_0x3313c1,_0x4da8d3){if(_0x3313c1[_0x613f('0x13')]!=_0x59236e[_0x613f('0x13')]&&_0x3313c1[_0x613f('0x4')]==_0x59236e[_0x613f('0x4')]){_0x3313c1[_0x613f('0x23')]=0x0;_0x3313c1[_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];_0x3313c1['agentringnoanswer']=!![];_0x3313c1[_0x613f('0x1e')]=utils[_0x613f('0x15')]();_0x3313c1[_0x613f('0x1f')]=_0x613f('0x30');_0x3313c1[_0x613f('0x20')]=_0x613f('0x30');_0x3313c1[_0x613f('0x31')]=_0x59236e['destuniqueid'];_0x3313c1[_0x613f('0x32')]=_0x59236e[_0x613f('0x18')];writeDB(_0x3313c1);}});}}catch(_0x3bb605){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x3bb605);}};exports[_0x613f('0xc')]=function(_0x403feb){try{if(!_[_0x613f('0x1a')](agents[_0x403feb[_0x613f('0x13')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][agentcomplete]',_0x403feb[_0x613f('0x4')]),_0x403feb);utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x33'),_0x403feb['uniqueid'],agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x18')],_0x403feb[_0x613f('0x13')]));agents[_0x403feb[_0x613f('0x13')]][_0x613f('0xc')]=!![];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x23')]=utils['diffTime'](agents[_0x403feb['destuniqueid']][_0x613f('0x34')],agents[_0x403feb[_0x613f('0x13')]]['agentconnectAt']);agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x20')]=_0x403feb[_0x613f('0x20')];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x35');writeDB(agents[_0x403feb[_0x613f('0x13')]]);}}catch(_0x3a7f95){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x36'),_0x403feb[_0x613f('0x4')]),_0x3a7f95);}};exports[_0x613f('0x37')]=function(_0x17f8e5){try{if(!_[_0x613f('0x1a')](agents[_0x17f8e5[_0x613f('0x38')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]',_0x17f8e5['uniqueid']),_0x17f8e5);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x17f8e5['uniqueid'],agents[_0x17f8e5[_0x613f('0x38')]]['membername'],agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x4')]));agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x39')]=!![];agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x3b');agents[_0x17f8e5['transfereruniqueid']]['transferexten']=_0x17f8e5[_0x613f('0x3c')];agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x3d')]=agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x4')];}}catch(_0x395357){utils[_0x613f('0x19')](util['format']('[%s][agents][blindtransfer]',_0x17f8e5[_0x613f('0x4')]),_0x395357);}};exports['attendedtransfer']=function(_0x5dd54e){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x3e'),_0x5dd54e['origtransfereruniqueid']),_0x5dd54e);if(_0x5dd54e[_0x613f('0x3f')]==_0x5dd54e[_0x613f('0x40')]){if(!_[_0x613f('0x1a')](agents[_0x5dd54e[_0x613f('0x41')]])){utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e[_0x613f('0x41')]]['membername']));agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x39')]=!![];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x44')]=_0x5dd54e[_0x613f('0x45')];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3d')]=_0x5dd54e[_0x613f('0x3f')];}if(_0x5dd54e[_0x613f('0x46')]&&agents[_0x5dd54e[_0x613f('0x46')]]){agents[_0x5dd54e['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x5dd54e[_0x613f('0x46')]]=_['clone'](agents[_0x5dd54e[_0x613f('0x46')]]);transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x47')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x14')]=utils['now']();transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x2d')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x46')]]['holdtime']=0x0;transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x48')]=0x2;}}else if(_0x5dd54e['secondtransfereruniqueid']==_0x5dd54e['secondtransfererlinkedid']){if(!_[_0x613f('0x1a')](agents[_0x5dd54e['origtransfereruniqueid']])){utils['info'](util['format'](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e['origtransfereruniqueid']]['membername']));agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x39')]=!![];agents[_0x5dd54e['origtransfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x44')]=_0x5dd54e['secondtransfererexten'];agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x3d')]=_0x5dd54e['secondtransfereruniqueid'];}if(_0x5dd54e[_0x613f('0x49')]&&agents[_0x5dd54e[_0x613f('0x49')]]){agents[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x1;transfers[_0x5dd54e[_0x613f('0x49')]]=_[_0x613f('0x4a')](agents[_0x5dd54e[_0x613f('0x49')]]);transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x49')]]['calleridname']=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]]['agentconnectAt']=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x2a')]=0x0;transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x2;}}}catch(_0x2ae459){utils['error'](util['format'](_0x613f('0x3e'),_0x5dd54e[_0x613f('0x3f')]),_0x2ae459);}};exports[_0x613f('0x4b')]=function(_0xddcd6){try{utils['debug'](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0xddcd6);if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6['uniqueid']][_0x613f('0x20')]===_0x613f('0x21')){if(_0xddcd6[_0x613f('0x4d')]==='21'){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x4e');agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]='rejected';}utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x18')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]));writeDB(agents[_0xddcd6['uniqueid']]);var _0x2c4b88=unanswered[_0x613f('0x50')](_0xddcd6[_0x613f('0x4')]);if(_0x2c4b88>-0x1){unanswered[_0x613f('0x51')](_0x2c4b88,0x1);}}if(transfers[_0xddcd6[_0x613f('0x4')]]){transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();transfers[_0xddcd6[_0x613f('0x4')]]['talktime']=utils[_0x613f('0x52')](transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')],transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x53');transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]=_0x613f('0x35');utils[_0x613f('0x2')](util['format'](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],transfers[_0xddcd6['uniqueid']][_0x613f('0x18')],transfers[_0xddcd6['uniqueid']][_0x613f('0x20')],transfers[_0xddcd6['uniqueid']]['lastevent']));writeDB(transfers[_0xddcd6[_0x613f('0x4')]],!![]);}if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt']=utils[_0x613f('0x15')]();agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x23')]=utils[_0x613f('0x52')](agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt'],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);agents[_0xddcd6['uniqueid']][_0x613f('0x20')]=agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x39')]?'transfer':'agent';agents[_0xddcd6['uniqueid']][_0x613f('0x1f')]=_0x613f('0x35');utils['info'](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6['uniqueid']][_0x613f('0x18')],agents[_0xddcd6['uniqueid']][_0x613f('0x20')],agents[_0xddcd6['uniqueid']]['lastevent']));writeDB(agents[_0xddcd6[_0x613f('0x4')]]);}}catch(_0x1b5f6e){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0x1b5f6e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index fb950d4..e30468c 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 _0x77a9=['transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','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','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','includes','noop','set','gotoif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime'];(function(_0x4e07e0,_0x777188){var _0x1c2911=function(_0x1df698){while(--_0x1df698){_0x4e07e0['push'](_0x4e07e0['shift']());}};_0x1c2911(++_0x777188);}(_0x77a9,0x19e));var _0x977a=function(_0xc72b0f,_0xacc5e8){_0xc72b0f=_0xc72b0f-0x0;var _0xd66522=_0x77a9[_0xc72b0f];return _0xd66522;};'use strict';var _=require(_0x977a('0x0'));var util=require('util');var utils=require(_0x977a('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x977a('0x2'),_0x977a('0x3'),_0x977a('0x3'),_0x977a('0x2'),'NO\x20ANSWER',_0x977a('0x2'),_0x977a('0x4'),_0x977a('0x5'),_0x977a('0x3'),_0x977a('0x3'),'FAILED'];var channels={};function writeDB(_0x51950c){var _0x2e177f;if(transfers[_0x977a('0x6')][_0x51950c['uniqueid']]){_0x2e177f=_0x51950c[_0x977a('0x7')];_0x51950c[_0x977a('0x7')]=transfers[_0x977a('0x6')][_0x51950c[_0x977a('0x7')]][_0x977a('0x8')];}utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0xb'),_0x51950c[_0x977a('0x7')],_0x51950c[_0x977a('0xc')],_0x51950c['queue'],_0x51950c[_0x977a('0xd')],_0x51950c[_0x977a('0xe')],_0x51950c[_0x977a('0xf')],_0x51950c[_0x977a('0x10')],_0x51950c[_0x977a('0x11')]));if(_0x51950c[_0x977a('0x12')]){utils[_0x977a('0x13')](_0x51950c[_0x977a('0x12')])[_0x977a('0x14')](function(_0x3192b4){if(_0x3192b4){_0x51950c['UserId']=_0x3192b4['id'];}utils[_0x977a('0x15')]('CreateVoiceCallReport',_0x51950c);});}else{utils[_0x977a('0x15')](_0x977a('0x16'),_0x51950c);}if(channels[_0x51950c['uniqueid']]){delete channels[_0x51950c[_0x977a('0x7')]];}else if(_0x2e177f&&channels[_0x2e177f]){if(!transfers[_0x977a('0x6')][_0x2e177f][_0x977a('0x17')])delete transfers[_0x977a('0x6')][_0x2e177f];delete channels[_0x2e177f];}}exports['newchannel']=function(_0x3ab4f9){try{utils[_0x977a('0x18')](util[_0x977a('0xa')]('[%s][calls][newchannel]',_0x3ab4f9[_0x977a('0x7')]),_0x3ab4f9);if(_0x3ab4f9[_0x977a('0x7')]==_0x3ab4f9['linkedid']&&_0x3ab4f9[_0x977a('0xc')]!='OutgoingSpoolFailed'){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x19'),_0x3ab4f9[_0x977a('0x7')],_0x3ab4f9[_0x977a('0x1a')],_0x3ab4f9['exten']));channels[_0x3ab4f9[_0x977a('0x7')]]={'uniqueid':_0x3ab4f9[_0x977a('0x7')],'accountcode':_0x3ab4f9[_0x977a('0x12')],'source':_0x3ab4f9[_0x977a('0xf')],'destination':_0x3ab4f9[_0x977a('0x1b')],'destinationcontext':_0x3ab4f9['context'],'channel':_0x3ab4f9['channel'],'starttime':utils[_0x977a('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x977a('0x2'),'amaflags':_0x977a('0x1d')};}}catch(_0x10408d){utils[_0x977a('0x1e')](util['format'](_0x977a('0x1f'),_0x3ab4f9['uniqueid']),_0x10408d);}};exports[_0x977a('0x20')]=function(_0x3cc264){try{utils[_0x977a('0x18')](util['format'](_0x977a('0x21'),_0x3cc264[_0x977a('0x7')]),_0x3cc264);if(!_[_0x977a('0x22')](channels[_0x3cc264['uniqueid']])&&_0x3cc264[_0x977a('0x23')]==0x6){utils['info'](util[_0x977a('0xa')](_0x977a('0x24'),_0x3cc264[_0x977a('0x7')],_0x3cc264['context'],_0x3cc264['channel']));if(_['isNil'](channels[_0x3cc264[_0x977a('0x7')]]['systemanswertime'])){channels[_0x3cc264['uniqueid']][_0x977a('0x25')]=utils['now']();}}else if(!_[_0x977a('0x22')](channels[_0x3cc264['linkedid']])&&_0x3cc264[_0x977a('0x23')]==0x6&&_0x3cc264[_0x977a('0x1a')]!=_0x977a('0x26')){utils[_0x977a('0x9')](util['format'](_0x977a('0x27'),_0x3cc264[_0x977a('0x7')],_0x3cc264[_0x977a('0x28')],_0x3cc264[_0x977a('0x1a')],_0x3cc264[_0x977a('0xc')]));channels[_0x3cc264['linkedid']]['accountcode']=_0x3cc264[_0x977a('0x12')];channels[_0x3cc264[_0x977a('0x28')]][_0x977a('0x29')]=_0x3cc264['channel'];if(_[_0x977a('0x22')](channels[_0x3cc264[_0x977a('0x28')]][_0x977a('0x2a')])){channels[_0x3cc264['linkedid']][_0x977a('0x2a')]=utils[_0x977a('0x1c')]();}channels[_0x3cc264[_0x977a('0x28')]][_0x977a('0x2b')]=dispositions[_[_0x977a('0x2c')](_0x3cc264['channelstate'])]||_0x977a('0x4');}}catch(_0xe08a54){utils[_0x977a('0x1e')](util[_0x977a('0xa')](_0x977a('0x21'),_0x3cc264[_0x977a('0x7')]),_0xe08a54);}};exports[_0x977a('0x2d')]=function(_0x6346af){try{if(!_['isNil'](channels[_0x6346af[_0x977a('0x7')]])){utils[_0x977a('0x18')](util[_0x977a('0xa')](_0x977a('0x2e'),_0x6346af[_0x977a('0x7')]),_0x6346af);if(_[_0x977a('0x22')](channels[_0x6346af[_0x977a('0x7')]]['callerid'])){channels[_0x6346af[_0x977a('0x7')]]['callerid']=_0x6346af[_0x977a('0x2f')]+'\x20<'+_0x6346af['calleridnum']+'>';}utils['info'](util[_0x977a('0xa')](_0x977a('0x30'),_0x6346af[_0x977a('0x7')],channels[_0x6346af['uniqueid']]['callerid'],_0x6346af[_0x977a('0x31')]));channels[_0x6346af[_0x977a('0x7')]][_0x977a('0x32')]=utils[_0x977a('0x1c')]();channels[_0x6346af['uniqueid']]['duration']=utils[_0x977a('0x33')](channels[_0x6346af[_0x977a('0x7')]][_0x977a('0x32')],channels[_0x6346af['uniqueid']][_0x977a('0x34')]);channels[_0x6346af['uniqueid']]['billableseconds']=channels[_0x6346af[_0x977a('0x7')]]['answertime']?utils[_0x977a('0x33')](channels[_0x6346af[_0x977a('0x7')]][_0x977a('0x32')],channels[_0x6346af[_0x977a('0x7')]][_0x977a('0x2a')]):0x0;writeDB(channels[_0x6346af[_0x977a('0x7')]]);}}catch(_0x375a45){utils['error'](util['format'](_0x977a('0x2e'),_0x6346af[_0x977a('0x7')]),_0x375a45);}};exports[_0x977a('0x35')]=function(_0x3025da){try{if(!_[_0x977a('0x22')](channels[_0x3025da[_0x977a('0x36')]])){utils[_0x977a('0x18')](util[_0x977a('0xa')](_0x977a('0x37'),_0x3025da['origtransfereruniqueid']),_0x3025da);if(channels[_0x3025da[_0x977a('0x36')]][_0x977a('0xc')]==_0x3025da[_0x977a('0x38')]){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x39'),_0x3025da['origtransfereruniqueid'],_0x3025da[_0x977a('0x36')],_0x3025da[_0x977a('0x3a')]));channels[_0x3025da[_0x977a('0x36')]]['destinationchannel']=_0x3025da['secondtransfererchannel'];channels[_0x3025da['localtwolinkedid']]['userfield']=_0x977a('0x3b');}else if(channels[_0x3025da[_0x977a('0x36')]][_0x977a('0xc')]=_0x3025da[_0x977a('0x3c')]){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x39'),_0x3025da[_0x977a('0x3d')],_0x3025da[_0x977a('0x36')],_0x3025da[_0x977a('0x3e')]));channels[_0x3025da[_0x977a('0x36')]][_0x977a('0x29')]=_0x3025da['origtransfererchannel'];channels[_0x3025da[_0x977a('0x36')]][_0x977a('0x3f')]='_attended';}}}catch(_0x501186){utils[_0x977a('0x1e')](util[_0x977a('0xa')]('[%s][calls][attendedtransfer]',_0x3025da[_0x977a('0x3d')]),_0x501186);}};exports['musiconholdstart']=function(_0x8b40df){try{if(!_[_0x977a('0x22')](channels[_0x8b40df[_0x977a('0x7')]])){utils['debug'](util[_0x977a('0xa')](_0x977a('0x40'),_0x8b40df['uniqueid']),_0x8b40df);channels[_0x8b40df[_0x977a('0x7')]]['musiconholdstartAt']=utils[_0x977a('0x1c')]();utils[_0x977a('0x9')](util['format'](_0x977a('0x41'),_0x8b40df[_0x977a('0x7')],channels[_0x8b40df[_0x977a('0x7')]][_0x977a('0x42')]));}}catch(_0x189bb4){utils[_0x977a('0x1e')](util[_0x977a('0xa')](_0x977a('0x40'),_0x8b40df[_0x977a('0x7')]),_0x189bb4);}};exports[_0x977a('0x43')]=function(_0x50b117){try{if(!_['isNil'](channels[_0x50b117[_0x977a('0x7')]])){utils['debug'](util['format'](_0x977a('0x44'),_0x50b117['uniqueid']),_0x50b117);if(!_['isNil'](channels[_0x50b117['uniqueid']][_0x977a('0x42')])){channels[_0x50b117[_0x977a('0x7')]]['mohtime']+=utils['diffTime'](utils[_0x977a('0x1c')](),channels[_0x50b117[_0x977a('0x7')]][_0x977a('0x42')]);utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x45'),_0x50b117[_0x977a('0x7')],channels[_0x50b117[_0x977a('0x7')]][_0x977a('0x46')]));delete channels[_0x50b117[_0x977a('0x7')]][_0x977a('0x42')];}}}catch(_0x4a9ed9){utils[_0x977a('0x1e')](util[_0x977a('0xa')](_0x977a('0x44'),_0x50b117['uniqueid']),_0x4a9ed9);}};exports[_0x977a('0x47')]=function(_0x5598f7){try{if(!_[_0x977a('0x22')](channels[_0x5598f7[_0x977a('0x7')]])){utils[_0x977a('0x18')](util['format'](_0x977a('0x48'),_0x5598f7['uniqueid']),_0x5598f7);if(!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')][_0x977a('0x4a')])){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x4b'),_0x5598f7[_0x977a('0x7')],_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7[_0x977a('0x7')]][_0x977a('0x4d')]=_0x5598f7[_0x977a('0x4c')];}if(!_['isNil'](_0x5598f7['variable']['xmd-phone'])){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x4e'),_0x5598f7[_0x977a('0x7')],_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7[_0x977a('0x7')]][_0x977a('0x4f')]=_0x5598f7[_0x977a('0x4c')];channels[_0x5598f7[_0x977a('0x7')]]['callerid']='\x22'+_0x5598f7['value']+_0x977a('0x50')+_0x5598f7[_0x977a('0x4c')]+'>';}if(!_['isNil'](_0x5598f7[_0x977a('0x49')]['xmd-callerid-preview'])||!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')][_0x977a('0x51')])){utils[_0x977a('0x9')](util['format'](_0x977a('0x52'),_0x5598f7['uniqueid'],!_[_0x977a('0x22')](_0x5598f7['variable'][_0x977a('0x53')])?'xmd-callerid-preview':_0x977a('0x51'),_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7[_0x977a('0x7')]]['callerid']=_0x5598f7[_0x977a('0x4c')];}if(!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')]['xmd-queue'])||!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')][_0x977a('0x54')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5598f7[_0x977a('0x7')],!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')]['xmd-queue'])?_0x977a('0x55'):_0x977a('0x54'),_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7[_0x977a('0x7')]][_0x977a('0x56')]=_0x977a('0x57');channels[_0x5598f7['uniqueid']][_0x977a('0x58')]=_0x5598f7[_0x977a('0x4c')];channels[_0x5598f7[_0x977a('0x7')]][_0x977a('0x59')]=!![];}if(!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')][_0x977a('0x5a')])){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x5b'),_0x5598f7[_0x977a('0x7')],_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7[_0x977a('0x7')]]['ContactId']=_0x5598f7[_0x977a('0x4c')];}if(!_['isNil'](_0x5598f7[_0x977a('0x49')][_0x977a('0x5c')])){utils[_0x977a('0x9')](util[_0x977a('0xa')](_0x977a('0x5d'),_0x5598f7[_0x977a('0x7')],_0x5598f7['value']));channels[_0x5598f7[_0x977a('0x7')]][_0x977a('0x5e')]=_0x5598f7[_0x977a('0x4c')];}if(!_[_0x977a('0x22')](_0x5598f7['variable'][_0x977a('0x5f')])){utils[_0x977a('0x9')](util['format'](_0x977a('0x60'),_0x5598f7[_0x977a('0x7')],_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7[_0x977a('0x7')]][_0x977a('0x61')]=_0x5598f7[_0x977a('0x4c')];}if(!_[_0x977a('0x22')](_0x5598f7[_0x977a('0x49')][_0x977a('0x62')])){utils['info'](util['format'](_0x977a('0x63'),_0x5598f7['uniqueid'],_0x5598f7[_0x977a('0x4c')]));channels[_0x5598f7['uniqueid']][_0x977a('0x62')]=_0x5598f7['value'];}}}catch(_0x3200fd){utils[_0x977a('0x1e')](util[_0x977a('0xa')](_0x977a('0x48'),_0x5598f7[_0x977a('0x7')]),_0x3200fd);}};exports['newexten']=function(_0x342f73){try{if(!_['isNil'](channels[_0x342f73[_0x977a('0x7')]])){utils['debug'](util[_0x977a('0xa')](_0x977a('0x64'),_0x342f73[_0x977a('0x7')]),_0x342f73);utils['info'](util[_0x977a('0xa')](_0x977a('0x65'),_0x342f73['uniqueid'],_0x342f73[_0x977a('0x66')],_0x342f73[_0x977a('0x67')]));if(_0x342f73['application'][_0x977a('0x68')]()=='set'&&_[_0x977a('0x69')](_0x342f73[_0x977a('0x67')][_0x977a('0x68')](),_0x977a('0x6a'))){var _0x440b8c=_0x342f73[_0x977a('0x67')][_0x977a('0x6b')]('=');var _0x5b7e35=_0x440b8c[0x0][_0x977a('0x6c')](_0x440b8c[0x0]['lastIndexOf']('(')+0x1,_0x440b8c[0x0]['lastIndexOf'](')'));var _0x3c8c77=_0x440b8c[0x1];channels[_0x342f73['uniqueid']][_0x5b7e35]=_0x3c8c77;}if(!_[_0x977a('0x6d')]([_0x977a('0x2d'),_0x977a('0x6e'),'execif',_0x977a('0x6f'),_0x977a('0x70')],_0x342f73[_0x977a('0x66')][_0x977a('0x68')]())){channels[_0x342f73[_0x977a('0x7')]][_0x977a('0x56')]=_0x342f73[_0x977a('0x66')];channels[_0x342f73[_0x977a('0x7')]][_0x977a('0x58')]=_0x342f73['appdata'];}}}catch(_0x1d5ca7){utils['error'](util['format'](_0x977a('0x64'),_0x342f73[_0x977a('0x7')]),_0x1d5ca7);}}; \ No newline at end of file +var _0xb30f=['xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','context','exten','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','answertime','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source'];(function(_0x1884f7,_0x14d73d){var _0x14347c=function(_0x578e0e){while(--_0x578e0e){_0x1884f7['push'](_0x1884f7['shift']());}};_0x14347c(++_0x14d73d);}(_0xb30f,0x109));var _0xfb30=function(_0x531989,_0x52a546){_0x531989=_0x531989-0x0;var _0x3f6fc8=_0xb30f[_0x531989];return _0x3f6fc8;};'use strict';var _=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var utils=require(_0xfb30('0x2'));var transfers=require(_0xfb30('0x3'));var dispositions=[_0xfb30('0x4'),'FAILED',_0xfb30('0x5'),_0xfb30('0x4'),_0xfb30('0x4'),'NO\x20ANSWER',_0xfb30('0x6'),_0xfb30('0x7'),_0xfb30('0x5'),_0xfb30('0x5'),_0xfb30('0x5')];var channels={};function writeDB(_0x5a4227){var _0x180cb1;if(transfers[_0xfb30('0x8')][_0x5a4227[_0xfb30('0x9')]]){_0x180cb1=_0x5a4227[_0xfb30('0x9')];_0x5a4227[_0xfb30('0x9')]=transfers['blinds'][_0x5a4227[_0xfb30('0x9')]][_0xfb30('0xa')];}utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0xd'),_0x5a4227[_0xfb30('0x9')],_0x5a4227[_0xfb30('0xe')],_0x5a4227[_0xfb30('0xf')],_0x5a4227['membername'],_0x5a4227[_0xfb30('0x10')],_0x5a4227['calleridnum'],_0x5a4227[_0xfb30('0x11')],_0x5a4227[_0xfb30('0x12')]));if(_0x5a4227[_0xfb30('0x13')]){utils[_0xfb30('0x14')](_0x5a4227[_0xfb30('0x13')])[_0xfb30('0x15')](function(_0x4ce80a){if(_0x4ce80a){_0x5a4227['UserId']=_0x4ce80a['id'];}utils[_0xfb30('0x16')](_0xfb30('0x17'),_0x5a4227);});}else{utils[_0xfb30('0x16')](_0xfb30('0x17'),_0x5a4227);}if(channels[_0x5a4227[_0xfb30('0x9')]]){delete channels[_0x5a4227[_0xfb30('0x9')]];}else if(_0x180cb1&&channels[_0x180cb1]){if(!transfers[_0xfb30('0x8')][_0x180cb1]['recording'])delete transfers['blinds'][_0x180cb1];delete channels[_0x180cb1];}}exports[_0xfb30('0x18')]=function(_0x1261e3){try{utils[_0xfb30('0x19')](util[_0xfb30('0xc')](_0xfb30('0x1a'),_0x1261e3[_0xfb30('0x9')]),_0x1261e3);if(_0x1261e3['uniqueid']==_0x1261e3['linkedid']&&_0x1261e3[_0xfb30('0xe')]!=_0xfb30('0x1b')){utils['info'](util[_0xfb30('0xc')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x1261e3['uniqueid'],_0x1261e3[_0xfb30('0x1c')],_0x1261e3[_0xfb30('0x1d')]));channels[_0x1261e3['uniqueid']]={'uniqueid':_0x1261e3[_0xfb30('0x9')],'accountcode':_0x1261e3[_0xfb30('0x13')],'source':_0x1261e3[_0xfb30('0x1e')],'destination':_0x1261e3['exten'],'destinationcontext':_0x1261e3['context'],'channel':_0x1261e3[_0xfb30('0xe')],'starttime':utils[_0xfb30('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfb30('0x4'),'amaflags':_0xfb30('0x20')};}}catch(_0x5899c0){utils[_0xfb30('0x21')](util[_0xfb30('0xc')]('[%s][calls][newchannel]',_0x1261e3[_0xfb30('0x9')]),_0x5899c0);}};exports[_0xfb30('0x22')]=function(_0x2b47a3){try{utils[_0xfb30('0x19')](util[_0xfb30('0xc')](_0xfb30('0x23'),_0x2b47a3[_0xfb30('0x9')]),_0x2b47a3);if(!_[_0xfb30('0x24')](channels[_0x2b47a3[_0xfb30('0x9')]])&&_0x2b47a3[_0xfb30('0x25')]==0x6){utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0x26'),_0x2b47a3[_0xfb30('0x9')],_0x2b47a3[_0xfb30('0x1c')],_0x2b47a3[_0xfb30('0xe')]));if(_[_0xfb30('0x24')](channels[_0x2b47a3[_0xfb30('0x9')]]['systemanswertime'])){channels[_0x2b47a3[_0xfb30('0x9')]][_0xfb30('0x27')]=utils['now']();}}else if(!_[_0xfb30('0x24')](channels[_0x2b47a3['linkedid']])&&_0x2b47a3[_0xfb30('0x25')]==0x6&&_0x2b47a3[_0xfb30('0x1c')]!='transfer'){utils['info'](util[_0xfb30('0xc')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2b47a3[_0xfb30('0x9')],_0x2b47a3[_0xfb30('0x28')],_0x2b47a3[_0xfb30('0x1c')],_0x2b47a3['channel']));channels[_0x2b47a3[_0xfb30('0x28')]][_0xfb30('0x13')]=_0x2b47a3[_0xfb30('0x13')];channels[_0x2b47a3[_0xfb30('0x28')]]['destinationchannel']=_0x2b47a3[_0xfb30('0xe')];if(_[_0xfb30('0x24')](channels[_0x2b47a3[_0xfb30('0x28')]]['answertime'])){channels[_0x2b47a3[_0xfb30('0x28')]][_0xfb30('0x29')]=utils['now']();}channels[_0x2b47a3[_0xfb30('0x28')]]['disposition']=dispositions[_[_0xfb30('0x2a')](_0x2b47a3[_0xfb30('0x25')])]||_0xfb30('0x6');}}catch(_0x26d3f7){utils[_0xfb30('0x21')](util[_0xfb30('0xc')](_0xfb30('0x23'),_0x2b47a3[_0xfb30('0x9')]),_0x26d3f7);}};exports[_0xfb30('0x2b')]=function(_0x51b8b5){try{if(!_[_0xfb30('0x24')](channels[_0x51b8b5[_0xfb30('0x9')]])){utils[_0xfb30('0x19')](util[_0xfb30('0xc')]('[%s][calls][hangup]',_0x51b8b5[_0xfb30('0x9')]),_0x51b8b5);if(_['isNil'](channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x2c')])){channels[_0x51b8b5['uniqueid']][_0xfb30('0x2c')]=_0x51b8b5[_0xfb30('0x2d')]+'\x20<'+_0x51b8b5['calleridnum']+'>';}utils[_0xfb30('0xb')](util['format'](_0xfb30('0x2e'),_0x51b8b5[_0xfb30('0x9')],channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x2c')],_0x51b8b5['cause-txt']));channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x2f')]=utils[_0xfb30('0x1f')]();channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x30')]=utils[_0xfb30('0x31')](channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x2f')],channels[_0x51b8b5[_0xfb30('0x9')]]['starttime']);channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x32')]=channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x29')]?utils[_0xfb30('0x31')](channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x2f')],channels[_0x51b8b5[_0xfb30('0x9')]][_0xfb30('0x29')]):0x0;writeDB(channels[_0x51b8b5[_0xfb30('0x9')]]);}}catch(_0x2c8c61){utils[_0xfb30('0x21')](util[_0xfb30('0xc')](_0xfb30('0x33'),_0x51b8b5[_0xfb30('0x9')]),_0x2c8c61);}};exports[_0xfb30('0x34')]=function(_0x171174){try{if(!_[_0xfb30('0x24')](channels[_0x171174[_0xfb30('0x35')]])){utils[_0xfb30('0x19')](util[_0xfb30('0xc')](_0xfb30('0x36'),_0x171174[_0xfb30('0x37')]),_0x171174);if(channels[_0x171174['localtwolinkedid']][_0xfb30('0xe')]==_0x171174[_0xfb30('0x38')]){utils['info'](util[_0xfb30('0xc')](_0xfb30('0x39'),_0x171174[_0xfb30('0x37')],_0x171174[_0xfb30('0x35')],_0x171174[_0xfb30('0x3a')]));channels[_0x171174[_0xfb30('0x35')]][_0xfb30('0x3b')]=_0x171174[_0xfb30('0x3a')];channels[_0x171174[_0xfb30('0x35')]][_0xfb30('0x3c')]=_0xfb30('0x3d');}else if(channels[_0x171174['localtwolinkedid']]['channel']=_0x171174['transfertargetchannel']){utils['info'](util[_0xfb30('0xc')](_0xfb30('0x39'),_0x171174[_0xfb30('0x37')],_0x171174['localtwolinkedid'],_0x171174[_0xfb30('0x3e')]));channels[_0x171174[_0xfb30('0x35')]][_0xfb30('0x3b')]=_0x171174[_0xfb30('0x3e')];channels[_0x171174['localtwolinkedid']][_0xfb30('0x3c')]='_attended';}}}catch(_0x2cf0c2){utils[_0xfb30('0x21')](util['format'](_0xfb30('0x36'),_0x171174[_0xfb30('0x37')]),_0x2cf0c2);}};exports[_0xfb30('0x3f')]=function(_0x2132be){try{if(!_[_0xfb30('0x24')](channels[_0x2132be['uniqueid']])){utils[_0xfb30('0x19')](util[_0xfb30('0xc')](_0xfb30('0x40'),_0x2132be[_0xfb30('0x9')]),_0x2132be);channels[_0x2132be[_0xfb30('0x9')]][_0xfb30('0x41')]=utils[_0xfb30('0x1f')]();utils[_0xfb30('0xb')](util['format'](_0xfb30('0x42'),_0x2132be[_0xfb30('0x9')],channels[_0x2132be['uniqueid']][_0xfb30('0x41')]));}}catch(_0x195b44){utils[_0xfb30('0x21')](util[_0xfb30('0xc')]('[%s][calls][musiconholdstart]',_0x2132be[_0xfb30('0x9')]),_0x195b44);}};exports[_0xfb30('0x43')]=function(_0xd9edea){try{if(!_[_0xfb30('0x24')](channels[_0xd9edea[_0xfb30('0x9')]])){utils[_0xfb30('0x19')](util['format'](_0xfb30('0x44'),_0xd9edea[_0xfb30('0x9')]),_0xd9edea);if(!_[_0xfb30('0x24')](channels[_0xd9edea[_0xfb30('0x9')]]['musiconholdstartAt'])){channels[_0xd9edea['uniqueid']]['mohtime']+=utils[_0xfb30('0x31')](utils['now'](),channels[_0xd9edea[_0xfb30('0x9')]][_0xfb30('0x41')]);utils['info'](util[_0xfb30('0xc')](_0xfb30('0x45'),_0xd9edea[_0xfb30('0x9')],channels[_0xd9edea['uniqueid']][_0xfb30('0x46')]));delete channels[_0xd9edea[_0xfb30('0x9')]][_0xfb30('0x41')];}}}catch(_0x2945e4){utils['error'](util[_0xfb30('0xc')](_0xfb30('0x44'),_0xd9edea[_0xfb30('0x9')]),_0x2945e4);}};exports['varset']=function(_0x3f0034){try{if(!_[_0xfb30('0x24')](channels[_0x3f0034[_0xfb30('0x9')]])){utils[_0xfb30('0x19')](util['format'](_0xfb30('0x47'),_0x3f0034['uniqueid']),_0x3f0034);if(!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x49')])){utils['info'](util[_0xfb30('0xc')](_0xfb30('0x4a'),_0x3f0034[_0xfb30('0x9')],_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x4c')]=_0x3f0034[_0xfb30('0x4b')];}if(!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x4d')])){utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0x4e'),_0x3f0034['uniqueid'],_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x4f')]=_0x3f0034[_0xfb30('0x4b')];channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x2c')]='\x22'+_0x3f0034[_0xfb30('0x4b')]+_0xfb30('0x50')+_0x3f0034[_0xfb30('0x4b')]+'>';}if(!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x51')])||!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')]['xmd-callerid'])){utils[_0xfb30('0xb')](util[_0xfb30('0xc')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3f0034[_0xfb30('0x9')],!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x51')])?_0xfb30('0x51'):'xmd-callerid',_0x3f0034['value']));channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x2c')]=_0x3f0034['value'];}if(!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x52')])||!_[_0xfb30('0x24')](_0x3f0034['variable']['xmcs-queue'])){utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0x53'),_0x3f0034[_0xfb30('0x9')],!_['isNil'](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x52')])?_0xfb30('0x52'):'xmcs-queue',_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034['uniqueid']]['lastapplication']=_0xfb30('0x54');channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x55')]=_0x3f0034['value'];channels[_0x3f0034['uniqueid']][_0xfb30('0xf')]=!![];}if(!_[_0xfb30('0x24')](_0x3f0034['variable'][_0xfb30('0x56')])){utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0x57'),_0x3f0034[_0xfb30('0x9')],_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034['uniqueid']][_0xfb30('0x58')]=_0x3f0034['value'];}if(!_[_0xfb30('0x24')](_0x3f0034[_0xfb30('0x48')][_0xfb30('0x59')])){utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0x5a'),_0x3f0034[_0xfb30('0x9')],_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034['uniqueid']][_0xfb30('0x5b')]=_0x3f0034[_0xfb30('0x4b')];}if(!_['isNil'](_0x3f0034['variable'][_0xfb30('0x5c')])){utils[_0xfb30('0xb')](util['format'](_0xfb30('0x5d'),_0x3f0034[_0xfb30('0x9')],_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x5e')]=_0x3f0034[_0xfb30('0x4b')];}if(!_['isNil'](_0x3f0034[_0xfb30('0x48')]['sipcallid'])){utils['info'](util[_0xfb30('0xc')](_0xfb30('0x5f'),_0x3f0034[_0xfb30('0x9')],_0x3f0034[_0xfb30('0x4b')]));channels[_0x3f0034[_0xfb30('0x9')]][_0xfb30('0x60')]=_0x3f0034['value'];}}}catch(_0x1bf6f0){utils['error'](util[_0xfb30('0xc')](_0xfb30('0x47'),_0x3f0034[_0xfb30('0x9')]),_0x1bf6f0);}};exports[_0xfb30('0x61')]=function(_0xf3f6ba){try{if(!_[_0xfb30('0x24')](channels[_0xf3f6ba[_0xfb30('0x9')]])){utils[_0xfb30('0x19')](util[_0xfb30('0xc')](_0xfb30('0x62'),_0xf3f6ba[_0xfb30('0x9')]),_0xf3f6ba);utils[_0xfb30('0xb')](util[_0xfb30('0xc')](_0xfb30('0x63'),_0xf3f6ba[_0xfb30('0x9')],_0xf3f6ba[_0xfb30('0x64')],_0xf3f6ba[_0xfb30('0x65')]));if(_0xf3f6ba[_0xfb30('0x64')][_0xfb30('0x66')]()=='set'&&_[_0xfb30('0x67')](_0xf3f6ba[_0xfb30('0x65')][_0xfb30('0x66')](),_0xfb30('0x68'))){var _0x292b16=_0xf3f6ba[_0xfb30('0x65')][_0xfb30('0x69')]('=');var _0x3d1308=_0x292b16[0x0][_0xfb30('0x6a')](_0x292b16[0x0][_0xfb30('0x6b')]('(')+0x1,_0x292b16[0x0][_0xfb30('0x6b')](')'));var _0x45ac69=_0x292b16[0x1];channels[_0xf3f6ba[_0xfb30('0x9')]][_0x3d1308]=_0x45ac69;}if(!_[_0xfb30('0x6c')]([_0xfb30('0x2b'),_0xfb30('0x6d'),_0xfb30('0x6e'),_0xfb30('0x6f'),_0xfb30('0x70')],_0xf3f6ba['application'][_0xfb30('0x66')]())){channels[_0xf3f6ba['uniqueid']][_0xfb30('0x71')]=_0xf3f6ba[_0xfb30('0x64')];channels[_0xf3f6ba[_0xfb30('0x9')]]['lastdata']=_0xf3f6ba[_0xfb30('0x65')];}}}catch(_0x5607a3){utils[_0xfb30('0x21')](util[_0xfb30('0xc')](_0xfb30('0x62'),_0xf3f6ba[_0xfb30('0x9')]),_0x5607a3);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 463df7c..faf9981 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 _0xffaa=['[core]\x20close','managerevent','connect','info','[core]\x20connected','error','[core]\x20error','close'];(function(_0xd90fbb,_0x3ed4e7){var _0x22070f=function(_0x126875){while(--_0x126875){_0xd90fbb['push'](_0xd90fbb['shift']());}};_0x22070f(++_0x3ed4e7);}(_0xffaa,0x6a));var _0xaffa=function(_0x37ef4e,_0x13625b){_0x37ef4e=_0x37ef4e-0x0;var _0x87e114=_0xffaa[_0x37ef4e];return _0x87e114;};'use strict';var utils=require('./utils');exports[_0xaffa('0x0')]=function(){utils[_0xaffa('0x1')](_0xaffa('0x2'));};exports['shutdown']=function(){utils[_0xaffa('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0xaffa('0x1')]('[core]\x20fullybooted');};exports['error']=function(_0x33735b){utils[_0xaffa('0x3')](_0xaffa('0x4'),_0x33735b);};exports[_0xaffa('0x5')]=function(){utils[_0xaffa('0x1')](_0xaffa('0x6'));};exports[_0xaffa('0x7')]=function(_0x5e8be5){}; \ No newline at end of file +var _0x37b2=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','managerevent','connect','info','[core]\x20connected'];(function(_0x49bc23,_0x41c909){var _0x4fe344=function(_0x53df66){while(--_0x53df66){_0x49bc23['push'](_0x49bc23['shift']());}};_0x4fe344(++_0x41c909);}(_0x37b2,0x1f1));var _0x237b=function(_0x4d918c,_0x598560){_0x4d918c=_0x4d918c-0x0;var _0xa5069a=_0x37b2[_0x4d918c];return _0xa5069a;};'use strict';var utils=require('./utils');exports[_0x237b('0x0')]=function(){utils[_0x237b('0x1')](_0x237b('0x2'));};exports[_0x237b('0x3')]=function(){utils[_0x237b('0x1')](_0x237b('0x4'));};exports[_0x237b('0x5')]=function(){utils[_0x237b('0x1')](_0x237b('0x6'));};exports[_0x237b('0x7')]=function(_0x59c8a0){utils[_0x237b('0x7')](_0x237b('0x8'),_0x59c8a0);};exports['close']=function(){utils[_0x237b('0x1')]('[core]\x20close');};exports[_0x237b('0x9')]=function(_0x5b03c9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index a84b8ac..da3a5c2 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 _0x688c=['diffTime','endtime','holdtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','error','[%s][dials][newexten]','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','calleridname','cause-txt','complete','duration'];(function(_0x45ae72,_0x483504){var _0x528b43=function(_0x57b845){while(--_0x57b845){_0x45ae72['push'](_0x45ae72['shift']());}};_0x528b43(++_0x483504);}(_0x688c,0xd0));var _0xc688=function(_0x452055,_0x23ebfb){_0x452055=_0x452055-0x0;var _0x218d81=_0x688c[_0x452055];return _0x218d81;};'use strict';var _=require(_0xc688('0x0'));var util=require(_0xc688('0x1'));var utils=require(_0xc688('0x2'));var dials={};function writeDB(_0x1e3275){utils[_0xc688('0x3')](util[_0xc688('0x4')](_0xc688('0x5'),_0x1e3275[_0xc688('0x6')],_0x1e3275[_0xc688('0x7')],_0x1e3275[_0xc688('0x8')],_0x1e3275[_0xc688('0x9')],_0x1e3275[_0xc688('0xa')],_0x1e3275[_0xc688('0xb')]));utils[_0xc688('0xc')](_0xc688('0xd'),_0x1e3275);delete dials[_0x1e3275[_0xc688('0x6')]];}exports['newexten']=function(_0x202bfe){try{utils[_0xc688('0xe')](util[_0xc688('0x4')]('[%s][dials][newexten]',_0x202bfe[_0xc688('0x6')]),_0x202bfe);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x202bfe[_0xc688('0x6')],_0x202bfe[_0xc688('0xf')],_0x202bfe[_0xc688('0x10')]));if(_0x202bfe[_0xc688('0xf')]['toLowerCase']()==_0xc688('0x11')&&_[_0xc688('0x12')](_0x202bfe[_0xc688('0x10')][_0xc688('0x13')](),_0xc688('0x14'))){var _0x17590b=_0x202bfe[_0xc688('0x10')]['split']('=');dials[_0x202bfe['uniqueid']]={'routeId':_0x17590b[0x1]};}}catch(_0x2cb445){utils[_0xc688('0x15')](util[_0xc688('0x4')](_0xc688('0x16'),_0x202bfe[_0xc688('0x6')]),_0x2cb445);}};exports[_0xc688('0x17')]=function(_0x5ad521){try{utils[_0xc688('0xe')](util[_0xc688('0x4')](_0xc688('0x18'),_0x5ad521[_0xc688('0x6')]),_0x5ad521);if(!_['isNil'](_0x5ad521[_0xc688('0x19')][_0xc688('0x1a')])){utils[_0xc688('0x3')](util[_0xc688('0x4')](_0xc688('0x1b'),_0x5ad521[_0xc688('0x6')],_0x5ad521[_0xc688('0x1c')]));dials[_0x5ad521[_0xc688('0x6')]]={'routeId':_0x5ad521['value']};}}catch(_0xf760f7){utils[_0xc688('0x15')](util['format']('[%s][dials][varset]',_0x5ad521[_0xc688('0x6')]),_0xf760f7);}};exports['dialbegin']=function(_0x28a0f5){try{if(!_[_0xc688('0x1d')](dials[_0x28a0f5[_0xc688('0x6')]])){utils[_0xc688('0xe')](util[_0xc688('0x4')]('[%s][dials][dialbegin]',_0x28a0f5[_0xc688('0x6')]),_0x28a0f5);dials[_0x28a0f5[_0xc688('0x6')]]=_['assign'](dials[_0x28a0f5[_0xc688('0x6')]],_0x28a0f5);dials[_0x28a0f5['uniqueid']]['starttime']=utils[_0xc688('0x1e')]();dials[_0x28a0f5[_0xc688('0x6')]][_0xc688('0x1f')]=_0xc688('0x20');utils[_0xc688('0x3')](util[_0xc688('0x4')](_0xc688('0x21'),_0x28a0f5[_0xc688('0x6')],dials[_0x28a0f5[_0xc688('0x6')]][_0xc688('0x22')]));}}catch(_0x3ced59){utils[_0xc688('0x15')](util[_0xc688('0x4')]('[%s][dials][dialbegin]',_0x28a0f5[_0xc688('0x6')]),_0x3ced59);}};exports[_0xc688('0x23')]=function(_0x22b740){try{if(!_['isNil'](dials[_0x22b740[_0xc688('0x6')]])){utils['debug'](util['format'](_0xc688('0x24'),_0x22b740[_0xc688('0x6')]),_0x22b740);dials[_0x22b740[_0xc688('0x6')]]['dialstatus']=_0x22b740['dialstatus'];if(_0x22b740[_0xc688('0xb')]==_0xc688('0x25')){dials[_0x22b740['uniqueid']]=_[_0xc688('0x26')](dials[_0x22b740[_0xc688('0x6')]],_0x22b740);dials[_0x22b740[_0xc688('0x6')]][_0xc688('0x27')]=utils[_0xc688('0x1e')]();dials[_0x22b740[_0xc688('0x6')]][_0xc688('0x1f')]=_0xc688('0x28');utils[_0xc688('0x3')](util[_0xc688('0x4')](_0xc688('0x29'),_0x22b740['uniqueid'],_0x22b740['dialstatus'],dials[_0x22b740['uniqueid']][_0xc688('0x27')]));}else{utils[_0xc688('0x3')](util[_0xc688('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x22b740['uniqueid'],_0x22b740['dialstatus']));}}}catch(_0x963a56){utils[_0xc688('0x15')](util[_0xc688('0x4')](_0xc688('0x24'),_0x22b740[_0xc688('0x6')]),_0x963a56);}};exports[_0xc688('0x2a')]=function(_0x11a124){try{if(!_['isNil'](dials[_0x11a124[_0xc688('0x6')]])){utils['debug'](util[_0xc688('0x4')]('[%s][dials][hangup]',_0x11a124[_0xc688('0x6')]),_0x11a124);utils['info'](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x11a124[_0xc688('0x6')],_0x11a124[_0xc688('0x9')],_0x11a124[_0xc688('0x2b')],_0x11a124[_0xc688('0x2c')]));dials[_0x11a124['uniqueid']]=_['assign'](dials[_0x11a124[_0xc688('0x6')]],{'endtime':utils[_0xc688('0x1e')](),'lastevent':_0xc688('0x2d')});dials[_0x11a124['uniqueid']][_0xc688('0x2e')]=utils[_0xc688('0x2f')](dials[_0x11a124['uniqueid']][_0xc688('0x30')],dials[_0x11a124[_0xc688('0x6')]][_0xc688('0x22')]);dials[_0x11a124['uniqueid']][_0xc688('0x31')]=utils[_0xc688('0x2f')](dials[_0x11a124['uniqueid']][_0xc688('0x27')]||dials[_0x11a124[_0xc688('0x6')]][_0xc688('0x30')],dials[_0x11a124[_0xc688('0x6')]][_0xc688('0x22')]);dials[_0x11a124[_0xc688('0x6')]]['billableseconds']=dials[_0x11a124[_0xc688('0x6')]]['answertime']?utils['diffTime'](dials[_0x11a124[_0xc688('0x6')]][_0xc688('0x30')],dials[_0x11a124['uniqueid']][_0xc688('0x27')]):0x0;writeDB(dials[_0x11a124[_0xc688('0x6')]]);}}catch(_0xe15714){utils['error'](util['format'](_0xc688('0x32'),_0x11a124[_0xc688('0x6')]),_0xe15714);}}; \ No newline at end of file +var _0xbdbe=['[%s][dials][hangup]','cause-txt','complete','duration','diffTime','endtime','lodash','util','format','uniqueid','dialstring','calleridnum','connectedlinenum','request','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','cdr(routeid)','error','varset','isNil','outboundrouteid','value','[%s][dials][varset]','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','connect','hangup'];(function(_0x3e0c63,_0x189028){var _0x4c0fd8=function(_0x34c618){while(--_0x34c618){_0x3e0c63['push'](_0x3e0c63['shift']());}};_0x4c0fd8(++_0x189028);}(_0xbdbe,0x84));var _0xebdb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbdbe[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xebdb('0x0'));var util=require(_0xebdb('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x205ddb){utils['info'](util[_0xebdb('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x205ddb[_0xebdb('0x3')],_0x205ddb['channel'],_0x205ddb[_0xebdb('0x4')],_0x205ddb[_0xebdb('0x5')],_0x205ddb[_0xebdb('0x6')],_0x205ddb['dialstatus']));utils[_0xebdb('0x7')]('CreateVoiceDialReport',_0x205ddb);delete dials[_0x205ddb['uniqueid']];}exports['newexten']=function(_0x291a78){try{utils[_0xebdb('0x8')](util[_0xebdb('0x2')](_0xebdb('0x9'),_0x291a78['uniqueid']),_0x291a78);utils[_0xebdb('0xa')](util['format'](_0xebdb('0xb'),_0x291a78[_0xebdb('0x3')],_0x291a78['application'],_0x291a78[_0xebdb('0xc')]));if(_0x291a78['application'][_0xebdb('0xd')]()==_0xebdb('0xe')&&_['startsWith'](_0x291a78[_0xebdb('0xc')][_0xebdb('0xd')](),_0xebdb('0xf'))){var _0x1151e5=_0x291a78['appdata']['split']('=');dials[_0x291a78[_0xebdb('0x3')]]={'routeId':_0x1151e5[0x1]};}}catch(_0x241475){utils[_0xebdb('0x10')](util['format'](_0xebdb('0x9'),_0x291a78[_0xebdb('0x3')]),_0x241475);}};exports[_0xebdb('0x11')]=function(_0x40d891){try{utils[_0xebdb('0x8')](util[_0xebdb('0x2')]('[%s][dials][varset]',_0x40d891['uniqueid']),_0x40d891);if(!_[_0xebdb('0x12')](_0x40d891['variable'][_0xebdb('0x13')])){utils[_0xebdb('0xa')](util[_0xebdb('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x40d891[_0xebdb('0x3')],_0x40d891[_0xebdb('0x14')]));dials[_0x40d891[_0xebdb('0x3')]]={'routeId':_0x40d891['value']};}}catch(_0x20c287){utils[_0xebdb('0x10')](util[_0xebdb('0x2')](_0xebdb('0x15'),_0x40d891[_0xebdb('0x3')]),_0x20c287);}};exports['dialbegin']=function(_0x14cfae){try{if(!_[_0xebdb('0x12')](dials[_0x14cfae[_0xebdb('0x3')]])){utils['debug'](util[_0xebdb('0x2')](_0xebdb('0x16'),_0x14cfae[_0xebdb('0x3')]),_0x14cfae);dials[_0x14cfae[_0xebdb('0x3')]]=_['assign'](dials[_0x14cfae[_0xebdb('0x3')]],_0x14cfae);dials[_0x14cfae[_0xebdb('0x3')]][_0xebdb('0x17')]=utils[_0xebdb('0x18')]();dials[_0x14cfae[_0xebdb('0x3')]][_0xebdb('0x19')]=_0xebdb('0x1a');utils[_0xebdb('0xa')](util[_0xebdb('0x2')](_0xebdb('0x1b'),_0x14cfae[_0xebdb('0x3')],dials[_0x14cfae[_0xebdb('0x3')]]['starttime']));}}catch(_0x13694c){utils[_0xebdb('0x10')](util[_0xebdb('0x2')](_0xebdb('0x16'),_0x14cfae[_0xebdb('0x3')]),_0x13694c);}};exports[_0xebdb('0x1c')]=function(_0x1e5405){try{if(!_[_0xebdb('0x12')](dials[_0x1e5405[_0xebdb('0x3')]])){utils[_0xebdb('0x8')](util['format'](_0xebdb('0x1d'),_0x1e5405['uniqueid']),_0x1e5405);dials[_0x1e5405[_0xebdb('0x3')]]['dialstatus']=_0x1e5405[_0xebdb('0x1e')];if(_0x1e5405[_0xebdb('0x1e')]==_0xebdb('0x1f')){dials[_0x1e5405[_0xebdb('0x3')]]=_[_0xebdb('0x20')](dials[_0x1e5405[_0xebdb('0x3')]],_0x1e5405);dials[_0x1e5405[_0xebdb('0x3')]][_0xebdb('0x21')]=utils[_0xebdb('0x18')]();dials[_0x1e5405['uniqueid']]['lastevent']=_0xebdb('0x22');utils[_0xebdb('0xa')](util[_0xebdb('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1e5405['uniqueid'],_0x1e5405[_0xebdb('0x1e')],dials[_0x1e5405[_0xebdb('0x3')]][_0xebdb('0x21')]));}else{utils[_0xebdb('0xa')](util[_0xebdb('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x1e5405[_0xebdb('0x3')],_0x1e5405[_0xebdb('0x1e')]));}}}catch(_0x1f244c){utils['error'](util['format'](_0xebdb('0x1d'),_0x1e5405['uniqueid']),_0x1f244c);}};exports[_0xebdb('0x23')]=function(_0x2b4339){try{if(!_['isNil'](dials[_0x2b4339[_0xebdb('0x3')]])){utils['debug'](util[_0xebdb('0x2')](_0xebdb('0x24'),_0x2b4339[_0xebdb('0x3')]),_0x2b4339);utils[_0xebdb('0xa')](util[_0xebdb('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x2b4339[_0xebdb('0x3')],_0x2b4339[_0xebdb('0x5')],_0x2b4339['calleridname'],_0x2b4339[_0xebdb('0x25')]));dials[_0x2b4339[_0xebdb('0x3')]]=_[_0xebdb('0x20')](dials[_0x2b4339[_0xebdb('0x3')]],{'endtime':utils[_0xebdb('0x18')](),'lastevent':_0xebdb('0x26')});dials[_0x2b4339[_0xebdb('0x3')]][_0xebdb('0x27')]=utils[_0xebdb('0x28')](dials[_0x2b4339[_0xebdb('0x3')]][_0xebdb('0x29')],dials[_0x2b4339[_0xebdb('0x3')]][_0xebdb('0x17')]);dials[_0x2b4339['uniqueid']]['holdtime']=utils[_0xebdb('0x28')](dials[_0x2b4339[_0xebdb('0x3')]][_0xebdb('0x21')]||dials[_0x2b4339['uniqueid']][_0xebdb('0x29')],dials[_0x2b4339['uniqueid']][_0xebdb('0x17')]);dials[_0x2b4339[_0xebdb('0x3')]]['billableseconds']=dials[_0x2b4339[_0xebdb('0x3')]]['answertime']?utils['diffTime'](dials[_0x2b4339[_0xebdb('0x3')]][_0xebdb('0x29')],dials[_0x2b4339[_0xebdb('0x3')]]['answertime']):0x0;writeDB(dials[_0x2b4339[_0xebdb('0x3')]]);}}catch(_0x2df78b){utils[_0xebdb('0x10')](util[_0xebdb('0x2')](_0xebdb('0x24'),_0x2b4339[_0xebdb('0x3')]),_0x2df78b);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1169b89..c9d4a02 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 _0xb90e=['dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','port','asterisk','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]'];(function(_0x3ac591,_0x5df6c2){var _0x43b82a=function(_0x3f8942){while(--_0x3f8942){_0x3ac591['push'](_0x3ac591['shift']());}};_0x43b82a(++_0x5df6c2);}(_0xb90e,0x144));var _0xeb90=function(_0x6d4a34,_0x206c12){_0x6d4a34=_0x6d4a34-0x0;var _0x572583=_0xb90e[_0x6d4a34];return _0x572583;};var AsteriskManager=require(_0xeb90('0x0'));var config=require(_0xeb90('0x1'));var utils=require('./utils');var util=require(_0xeb90('0x2'));var ami=new AsteriskManager(config['asterisk'][_0xeb90('0x3')],config['asterisk']['ip'],config[_0xeb90('0x4')][_0xeb90('0x5')],config[_0xeb90('0x4')]['password'],!![]);ami[_0xeb90('0x6')]();if(config[_0xeb90('0x7')]&&config['xdr'][_0xeb90('0x8')]){utils[_0xeb90('0x9')](_0xeb90('0xa'));}else{var agents=require(_0xeb90('0xb'));var calls=require(_0xeb90('0xc'));var queues=require(_0xeb90('0xd'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xeb90('0xe'));var transfers=require(_0xeb90('0xf'));var core=require(_0xeb90('0x10'));ami['on'](_0xeb90('0x11'),core[_0xeb90('0x11')]);ami['on']('shutdown',core[_0xeb90('0x12')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0xeb90('0x13'),core[_0xeb90('0x13')]);ami['on'](_0xeb90('0x14'),core[_0xeb90('0x14')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0xeb90('0x15'),function(_0xf0000f){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x18'),_0xf0000f[_0xeb90('0x19')]),_0xf0000f);members[_0xeb90('0x15')](_0xf0000f);}catch(_0x1aedd5){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x18'),_0xf0000f[_0xeb90('0x19')]),_0x1aedd5);}});ami['on'](_0xeb90('0x1a'),function(_0x13f463){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x1b'),_0x13f463[_0xeb90('0x1c')]),_0x13f463);agents['agentcalled'](_0x13f463);}catch(_0x5d355c){utils[_0xeb90('0x13')](util[_0xeb90('0x17')](_0xeb90('0x1b'),_0x13f463[_0xeb90('0x1c')]),_0x5d355c);}});ami['on']('agentringnoanswer',function(_0x20ed3a){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x1d'),_0x20ed3a[_0xeb90('0x1c')]),_0x20ed3a);agents['agentringnoanswer'](_0x20ed3a);}catch(_0x49e0f9){utils[_0xeb90('0x13')](util[_0xeb90('0x17')]('[%s][index][agentringnoanswer]',_0x20ed3a[_0xeb90('0x1c')]),_0x49e0f9);}});ami['on'](_0xeb90('0x1e'),function(_0x4b2731){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x1f'),_0x4b2731['uniqueid']),_0x4b2731);agents['agentconnect'](_0x4b2731);queues['agentconnect'](_0x4b2731);}catch(_0x5b2e68){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x1f'),_0x4b2731['uniqueid']),_0x5b2e68);}});ami['on'](_0xeb90('0x20'),function(_0x38edc4){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')]('[%s][index][agentcomplete]',_0x38edc4[_0xeb90('0x1c')]),_0x38edc4);agents[_0xeb90('0x20')](_0x38edc4);queues['agentcomplete'](_0x38edc4);members['agentcomplete'](_0x38edc4);}catch(_0x312071){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x21'),_0x38edc4['uniqueid']),_0x312071);}});ami['on'](_0xeb90('0x22'),function(_0x49bffe){try{utils[_0xeb90('0x16')](util['format'](_0xeb90('0x23'),_0x49bffe[_0xeb90('0x1c')]),_0x49bffe);agents[_0xeb90('0x22')](_0x49bffe);queues[_0xeb90('0x22')](_0x49bffe);}catch(_0xfb61a7){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x23'),_0x49bffe[_0xeb90('0x1c')]),_0xfb61a7);}});ami['on']('queuecallerjoin',function(_0x17bea1){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x24'),_0x17bea1[_0xeb90('0x1c')]),_0x17bea1);queues[_0xeb90('0x25')](_0x17bea1);recordings[_0xeb90('0x25')](_0x17bea1);}catch(_0x594b22){utils[_0xeb90('0x13')](util[_0xeb90('0x17')](_0xeb90('0x24'),_0x17bea1[_0xeb90('0x1c')]),_0x594b22);}});ami['on'](_0xeb90('0x26'),function(_0x475f42){try{utils['debug'](util['format'](_0xeb90('0x27'),_0x475f42[_0xeb90('0x1c')]),_0x475f42);queues[_0xeb90('0x26')](_0x475f42);}catch(_0xd763e0){utils[_0xeb90('0x13')](util[_0xeb90('0x17')]('[%s][index][queuecallerleave]',_0x475f42[_0xeb90('0x1c')]),_0xd763e0);}});ami['on']('musiconholdstart',function(_0x4c3637){try{utils[_0xeb90('0x16')](util['format'](_0xeb90('0x28'),_0x4c3637['uniqueid']),_0x4c3637);queues[_0xeb90('0x29')](_0x4c3637);calls['musiconholdstart'](_0x4c3637);}catch(_0x5cae81){utils['error'](util['format'](_0xeb90('0x28'),_0x4c3637['uniqueid']),_0x5cae81);}});ami['on'](_0xeb90('0x2a'),function(_0x471565){try{utils[_0xeb90('0x16')](util['format'](_0xeb90('0x2b'),_0x471565[_0xeb90('0x1c')]),_0x471565);queues['musiconholdstop'](_0x471565);calls['musiconholdstop'](_0x471565);}catch(_0x52e638){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x2b'),_0x471565['uniqueid']),_0x52e638);}});ami['on'](_0xeb90('0x2c'),function(_0x5f0bf7){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x2d'),_0x5f0bf7[_0xeb90('0x1c')]),_0x5f0bf7);calls['newstate'](_0x5f0bf7);recordings[_0xeb90('0x2c')](_0x5f0bf7);}catch(_0x3f0e74){utils[_0xeb90('0x13')](util['format'](_0xeb90('0x2d'),_0x5f0bf7['uniqueid']),_0x3f0e74);}});ami['on'](_0xeb90('0x2e'),function(_0x22679e){try{utils['debug'](util[_0xeb90('0x17')]('[%s][index][hangup]',_0x22679e[_0xeb90('0x1c')]),_0x22679e);calls['hangup'](_0x22679e);recordings[_0xeb90('0x2e')](_0x22679e);dials[_0xeb90('0x2e')](_0x22679e);agents[_0xeb90('0x2e')](_0x22679e);queues[_0xeb90('0x2e')](_0x22679e);}catch(_0x1fb7b4){utils[_0xeb90('0x13')](util['format']('[%s][index][hangup]',_0x22679e[_0xeb90('0x1c')]),_0x1fb7b4);}});ami['on']('cdr',function(_0x223d8b){try{utils['debug'](util[_0xeb90('0x17')](_0xeb90('0x2f'),_0x223d8b[_0xeb90('0x1c')]),_0x223d8b);members[_0xeb90('0x30')](_0x223d8b);}catch(_0x5c7909){utils[_0xeb90('0x13')](util['format'](_0xeb90('0x2f'),_0x223d8b[_0xeb90('0x1c')]),_0x5c7909);}});ami['on'](_0xeb90('0x31'),function(_0x3b575f){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x32'),_0x3b575f[_0xeb90('0x1c')]),_0x3b575f);queues['blindtransfer'](_0x3b575f);agents[_0xeb90('0x31')](_0x3b575f);transfers['blindtransfer'](_0x3b575f);recordings[_0xeb90('0x31')](_0x3b575f);}catch(_0x2cc275){utils[_0xeb90('0x13')](util[_0xeb90('0x17')](_0xeb90('0x32'),_0x3b575f[_0xeb90('0x1c')]),_0x2cc275);}});ami['on'](_0xeb90('0x33'),function(_0x5147d8){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x34'),_0x5147d8[_0xeb90('0x35')]),_0x5147d8);queues[_0xeb90('0x33')](_0x5147d8);transfers['attendedtransfer'](_0x5147d8);agents[_0xeb90('0x33')](_0x5147d8);calls[_0xeb90('0x33')](_0x5147d8);}catch(_0x365f0d){utils[_0xeb90('0x13')](util['format'](_0xeb90('0x34'),_0x5147d8[_0xeb90('0x35')]),_0x365f0d);}});ami['on'](_0xeb90('0x36'),function(_0x3f22fa){try{utils[_0xeb90('0x16')](util['format'](_0xeb90('0x37'),_0x3f22fa[_0xeb90('0x1c')]),_0x3f22fa);queues[_0xeb90('0x36')](_0x3f22fa);recordings[_0xeb90('0x36')](_0x3f22fa);calls[_0xeb90('0x36')](_0x3f22fa);dials[_0xeb90('0x36')](_0x3f22fa);}catch(_0x2c6d4d){utils[_0xeb90('0x13')](util[_0xeb90('0x17')]('[%s][index][varset]',_0x3f22fa[_0xeb90('0x1c')]),_0x2c6d4d);}});ami['on']('newexten',function(_0x443725){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x38'),_0x443725[_0xeb90('0x1c')]),_0x443725);calls[_0xeb90('0x39')](_0x443725);recordings['newexten'](_0x443725);dials['newexten'](_0x443725);}catch(_0x11ec5a){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x38'),_0x443725['uniqueid']),_0x11ec5a);}});ami['on'](_0xeb90('0x3a'),function(_0x240157){try{utils[_0xeb90('0x16')](util['format'](_0xeb90('0x3b'),_0x240157[_0xeb90('0x1c')]),_0x240157);calls[_0xeb90('0x3a')](_0x240157);recordings[_0xeb90('0x3a')](_0x240157);}catch(_0x532cf5){utils[_0xeb90('0x13')](util[_0xeb90('0x17')](_0xeb90('0x3b'),_0x240157[_0xeb90('0x1c')]),_0x532cf5);}});ami['on'](_0xeb90('0x3c'),function(_0x22329b){try{utils[_0xeb90('0x16')](util[_0xeb90('0x17')](_0xeb90('0x3d'),_0x22329b[_0xeb90('0x1c')]),_0x22329b);dials[_0xeb90('0x3c')](_0x22329b);}catch(_0x34fec7){utils['error'](util[_0xeb90('0x17')]('[%s]dialbegin',_0x22329b[_0xeb90('0x1c')]),_0x34fec7);}});ami['on'](_0xeb90('0x3e'),function(_0x1e5755){try{utils[_0xeb90('0x16')](util['format'](_0xeb90('0x3f'),_0x1e5755['uniqueid']),_0x1e5755);dials[_0xeb90('0x3e')](_0x1e5755);}catch(_0x1ba0cd){utils['error'](util[_0xeb90('0x17')](_0xeb90('0x3f'),_0x1e5755[_0xeb90('0x1c')]),_0x1ba0cd);}});} \ No newline at end of file +var _0x18a1=['origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','debug','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','attendedtransfer'];(function(_0xd71040,_0x1eaf9e){var _0x36446d=function(_0x4848ab){while(--_0x4848ab){_0xd71040['push'](_0xd71040['shift']());}};_0x36446d(++_0x1eaf9e);}(_0x18a1,0x191));var _0x118a=function(_0x568571,_0x3cf013){_0x568571=_0x568571-0x0;var _0x24deec=_0x18a1[_0x568571];return _0x24deec;};var AsteriskManager=require(_0x118a('0x0'));var config=require(_0x118a('0x1'));var utils=require('./utils');var util=require(_0x118a('0x2'));var ami=new AsteriskManager(config[_0x118a('0x3')]['port'],config[_0x118a('0x3')]['ip'],config['asterisk']['username'],config['asterisk'][_0x118a('0x4')],!![]);ami[_0x118a('0x5')]();if(config[_0x118a('0x6')]&&config[_0x118a('0x6')][_0x118a('0x7')]){utils['info'](_0x118a('0x8'));}else{var agents=require('./agents.controller');var calls=require(_0x118a('0x9'));var queues=require(_0x118a('0xa'));var recordings=require('./recordings.controller');var members=require(_0x118a('0xb'));var dials=require('./dials.controller');var transfers=require(_0x118a('0xc'));var core=require(_0x118a('0xd'));ami['on'](_0x118a('0xe'),core[_0x118a('0xe')]);ami['on'](_0x118a('0xf'),core[_0x118a('0xf')]);ami['on'](_0x118a('0x10'),core[_0x118a('0x10')]);ami['on'](_0x118a('0x11'),core[_0x118a('0x11')]);ami['on'](_0x118a('0x12'),core[_0x118a('0x12')]);ami['on'](_0x118a('0x13'),core[_0x118a('0x13')]);ami['on'](_0x118a('0x14'),function(_0x47ec9f){try{utils['debug'](util['format'](_0x118a('0x15'),_0x47ec9f[_0x118a('0x16')]),_0x47ec9f);members[_0x118a('0x14')](_0x47ec9f);}catch(_0x3056e5){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x15'),_0x47ec9f[_0x118a('0x16')]),_0x3056e5);}});ami['on']('agentcalled',function(_0x417d5c){try{utils[_0x118a('0x18')](util['format'](_0x118a('0x19'),_0x417d5c[_0x118a('0x1a')]),_0x417d5c);agents[_0x118a('0x1b')](_0x417d5c);}catch(_0x54213e){utils[_0x118a('0x11')](util['format'](_0x118a('0x19'),_0x417d5c['uniqueid']),_0x54213e);}});ami['on'](_0x118a('0x1c'),function(_0x3cacf7){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x1d'),_0x3cacf7[_0x118a('0x1a')]),_0x3cacf7);agents[_0x118a('0x1c')](_0x3cacf7);}catch(_0x27256f){utils['error'](util[_0x118a('0x17')](_0x118a('0x1d'),_0x3cacf7['uniqueid']),_0x27256f);}});ami['on'](_0x118a('0x1e'),function(_0x3da8f4){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x1f'),_0x3da8f4['uniqueid']),_0x3da8f4);agents[_0x118a('0x1e')](_0x3da8f4);queues[_0x118a('0x1e')](_0x3da8f4);}catch(_0x5c2818){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x1f'),_0x3da8f4[_0x118a('0x1a')]),_0x5c2818);}});ami['on'](_0x118a('0x20'),function(_0x3aea4c){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x21'),_0x3aea4c[_0x118a('0x1a')]),_0x3aea4c);agents[_0x118a('0x20')](_0x3aea4c);queues[_0x118a('0x20')](_0x3aea4c);members['agentcomplete'](_0x3aea4c);}catch(_0x422579){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x21'),_0x3aea4c[_0x118a('0x1a')]),_0x422579);}});ami['on'](_0x118a('0x22'),function(_0x54c5da){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x23'),_0x54c5da[_0x118a('0x1a')]),_0x54c5da);agents[_0x118a('0x22')](_0x54c5da);queues[_0x118a('0x22')](_0x54c5da);}catch(_0x4fd941){utils[_0x118a('0x11')](util['format'](_0x118a('0x23'),_0x54c5da[_0x118a('0x1a')]),_0x4fd941);}});ami['on']('queuecallerjoin',function(_0x79bc3e){try{utils[_0x118a('0x18')](util[_0x118a('0x17')]('[%s][index][queuecallerjoin]',_0x79bc3e['uniqueid']),_0x79bc3e);queues[_0x118a('0x24')](_0x79bc3e);recordings['queuecallerjoin'](_0x79bc3e);}catch(_0x3cfb0b){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x25'),_0x79bc3e[_0x118a('0x1a')]),_0x3cfb0b);}});ami['on'](_0x118a('0x26'),function(_0x16f6ef){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x27'),_0x16f6ef[_0x118a('0x1a')]),_0x16f6ef);queues[_0x118a('0x26')](_0x16f6ef);}catch(_0x41c7b1){utils['error'](util[_0x118a('0x17')]('[%s][index][queuecallerleave]',_0x16f6ef[_0x118a('0x1a')]),_0x41c7b1);}});ami['on'](_0x118a('0x28'),function(_0x29564f){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x29'),_0x29564f[_0x118a('0x1a')]),_0x29564f);queues[_0x118a('0x28')](_0x29564f);calls[_0x118a('0x28')](_0x29564f);}catch(_0x12c0ce){utils['error'](util[_0x118a('0x17')](_0x118a('0x29'),_0x29564f[_0x118a('0x1a')]),_0x12c0ce);}});ami['on'](_0x118a('0x2a'),function(_0x4f5e21){try{utils[_0x118a('0x18')](util[_0x118a('0x17')]('[%s][index][musiconholdstop]',_0x4f5e21[_0x118a('0x1a')]),_0x4f5e21);queues[_0x118a('0x2a')](_0x4f5e21);calls[_0x118a('0x2a')](_0x4f5e21);}catch(_0x15d9c2){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x2b'),_0x4f5e21[_0x118a('0x1a')]),_0x15d9c2);}});ami['on'](_0x118a('0x2c'),function(_0x2b6ba0){try{utils[_0x118a('0x18')](util['format']('[%s][index][newstate]',_0x2b6ba0[_0x118a('0x1a')]),_0x2b6ba0);calls[_0x118a('0x2c')](_0x2b6ba0);recordings[_0x118a('0x2c')](_0x2b6ba0);}catch(_0x39ad23){utils[_0x118a('0x11')](util['format'](_0x118a('0x2d'),_0x2b6ba0[_0x118a('0x1a')]),_0x39ad23);}});ami['on'](_0x118a('0x2e'),function(_0x24a0a7){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x2f'),_0x24a0a7[_0x118a('0x1a')]),_0x24a0a7);calls[_0x118a('0x2e')](_0x24a0a7);recordings[_0x118a('0x2e')](_0x24a0a7);dials['hangup'](_0x24a0a7);agents[_0x118a('0x2e')](_0x24a0a7);queues[_0x118a('0x2e')](_0x24a0a7);}catch(_0xb81b85){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x2f'),_0x24a0a7[_0x118a('0x1a')]),_0xb81b85);}});ami['on'](_0x118a('0x30'),function(_0x595692){try{utils['debug'](util[_0x118a('0x17')](_0x118a('0x31'),_0x595692[_0x118a('0x1a')]),_0x595692);members[_0x118a('0x30')](_0x595692);}catch(_0x14a49c){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x31'),_0x595692[_0x118a('0x1a')]),_0x14a49c);}});ami['on']('blindtransfer',function(_0x2b75dd){try{utils[_0x118a('0x18')](util['format'](_0x118a('0x32'),_0x2b75dd[_0x118a('0x1a')]),_0x2b75dd);queues[_0x118a('0x33')](_0x2b75dd);agents[_0x118a('0x33')](_0x2b75dd);transfers[_0x118a('0x33')](_0x2b75dd);recordings[_0x118a('0x33')](_0x2b75dd);}catch(_0x409fa2){utils[_0x118a('0x11')](util[_0x118a('0x17')]('[%s][index][blindtransfer]',_0x2b75dd[_0x118a('0x1a')]),_0x409fa2);}});ami['on']('attendedtransfer',function(_0x57bc22){try{utils['debug'](util[_0x118a('0x17')](_0x118a('0x34'),_0x57bc22['origtransfereruniqueid']),_0x57bc22);queues['attendedtransfer'](_0x57bc22);transfers['attendedtransfer'](_0x57bc22);agents[_0x118a('0x35')](_0x57bc22);calls['attendedtransfer'](_0x57bc22);}catch(_0x34f5e7){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x34'),_0x57bc22[_0x118a('0x36')]),_0x34f5e7);}});ami['on']('varset',function(_0x33c3a3){try{utils['debug'](util[_0x118a('0x17')](_0x118a('0x37'),_0x33c3a3[_0x118a('0x1a')]),_0x33c3a3);queues[_0x118a('0x38')](_0x33c3a3);recordings['varset'](_0x33c3a3);calls['varset'](_0x33c3a3);dials['varset'](_0x33c3a3);}catch(_0x312e77){utils[_0x118a('0x11')](util['format'](_0x118a('0x37'),_0x33c3a3['uniqueid']),_0x312e77);}});ami['on'](_0x118a('0x39'),function(_0x422e0c){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x3a'),_0x422e0c[_0x118a('0x1a')]),_0x422e0c);calls[_0x118a('0x39')](_0x422e0c);recordings[_0x118a('0x39')](_0x422e0c);dials[_0x118a('0x39')](_0x422e0c);}catch(_0x598c41){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x3a'),_0x422e0c[_0x118a('0x1a')]),_0x598c41);}});ami['on'](_0x118a('0x3b'),function(_0x744dd4){try{utils[_0x118a('0x18')](util[_0x118a('0x17')](_0x118a('0x3c'),_0x744dd4[_0x118a('0x1a')]),_0x744dd4);calls[_0x118a('0x3b')](_0x744dd4);recordings[_0x118a('0x3b')](_0x744dd4);}catch(_0x4e51e1){utils['error'](util[_0x118a('0x17')](_0x118a('0x3c'),_0x744dd4[_0x118a('0x1a')]),_0x4e51e1);}});ami['on'](_0x118a('0x3d'),function(_0x36448f){try{utils[_0x118a('0x18')](util[_0x118a('0x17')]('[%s][index][dialbegin]',_0x36448f[_0x118a('0x1a')]),_0x36448f);dials[_0x118a('0x3d')](_0x36448f);}catch(_0x3de8ac){utils[_0x118a('0x11')](util['format'](_0x118a('0x3e'),_0x36448f[_0x118a('0x1a')]),_0x3de8ac);}});ami['on'](_0x118a('0x3f'),function(_0x4b8a00){try{utils[_0x118a('0x18')](util['format'](_0x118a('0x40'),_0x4b8a00[_0x118a('0x1a')]),_0x4b8a00);dials['dialend'](_0x4b8a00);}catch(_0x332acf){utils[_0x118a('0x11')](util[_0x118a('0x17')](_0x118a('0x40'),_0x4b8a00[_0x118a('0x1a')]),_0x332acf);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 54ff422..47ff2a9 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 _0x159b=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','[%s][members][devicestatechange]','debug','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','split','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','error','some','devicestatechange'];(function(_0x2d066f,_0x2081f9){var _0x32a980=function(_0x5e5f10){while(--_0x5e5f10){_0x2d066f['push'](_0x2d066f['shift']());}};_0x32a980(++_0x2081f9);}(_0x159b,0x181));var _0xb159=function(_0x1af8f0,_0x355ee4){_0x1af8f0=_0x1af8f0-0x0;var _0x3b5878=_0x159b[_0x1af8f0];return _0x3b5878;};'use strict';var _=require(_0xb159('0x0'));var util=require(_0xb159('0x1'));var utils=require(_0xb159('0x2'));var members={};var exclude=[_0xb159('0x3'),_0xb159('0x4')];function writeDB(_0x19ceab){utils[_0xb159('0x5')](util[_0xb159('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x19ceab[_0xb159('0x7')],_0x19ceab[_0xb159('0x8')],_0x19ceab[_0xb159('0x9')],_0x19ceab[_0xb159('0xa')],_0x19ceab['membername'],_0x19ceab[_0xb159('0xb')]));if(_0x19ceab[_0xb159('0x8')]){utils[_0xb159('0xc')](_0x19ceab[_0xb159('0x8')])[_0xb159('0xd')](function(_0x7f9727){if(_0x7f9727){_0x19ceab[_0xb159('0xe')]=_0x7f9727[_0xb159('0xf')];_0x19ceab[_0xb159('0x10')]=_0x7f9727[_0xb159('0x10')];utils[_0xb159('0x11')](_0xb159('0x12'),_0x19ceab);}else{utils[_0xb159('0x13')](_0x19ceab['interface']['split']('/')[0x1])[_0xb159('0xd')](function(_0xc81bb7){if(_0xc81bb7){_0x19ceab[_0xb159('0xe')]=_0xc81bb7[_0xb159('0xf')];_0x19ceab[_0xb159('0x10')]=_0xc81bb7[_0xb159('0x10')];utils['request'](_0xb159('0x12'),_0x19ceab);}});}})['catch'](function(_0xd264a1){utils[_0xb159('0x14')](util['format']('[%s][members][writeDB]',_0x19ceab[_0xb159('0x7')]),_0xd264a1);});}delete members[_0x19ceab[_0xb159('0x8')]];}function startsWith(_0x69c5e2,_0x5e755c){return _[_0xb159('0x15')](_0x69c5e2,function(_0x20bbb8){return _['startsWith'](_0x5e755c,_0x20bbb8);});}exports[_0xb159('0x16')]=function(_0x2094e5){try{utils['debug'](util[_0xb159('0x6')]('[%s][members][devicestatechange]',members[_0x2094e5[_0xb159('0x17')]]?members[_0x2094e5[_0xb159('0x17')]][_0xb159('0x7')]:_0x2094e5['device']),_0x2094e5);utils[_0xb159('0x5')](util['format'](_0xb159('0x18'),members[_0x2094e5[_0xb159('0x17')]]?members[_0x2094e5[_0xb159('0x17')]][_0xb159('0x7')]:_0x2094e5[_0xb159('0x17')],_0x2094e5[_0xb159('0x19')],_0x2094e5[_0xb159('0x17')]));switch(_0x2094e5[_0xb159('0x19')]){case _0xb159('0x1a'):case _0xb159('0x1b'):if(!startsWith(exclude,_0x2094e5[_0xb159('0x17')])){members[_0x2094e5[_0xb159('0x17')]]={'channel':_0xb159('0x1c'),'interface':_0x2094e5['device'],'type':_0xb159('0x1d'),'enterAt':utils['now'](),'role':'agent'};}break;case _0xb159('0x1e'):if(!_[_0xb159('0x1f')](members[_0x2094e5[_0xb159('0x17')]])){members[_0x2094e5['device']][_0xb159('0x20')]=utils[_0xb159('0x21')]();members[_0x2094e5['device']][_0xb159('0x22')]=utils[_0xb159('0x23')](members[_0x2094e5[_0xb159('0x17')]][_0xb159('0x20')],members[_0x2094e5[_0xb159('0x17')]][_0xb159('0x24')]);if(members[_0x2094e5[_0xb159('0x17')]][_0xb159('0x7')]){writeDB(members[_0x2094e5['device']]);}}break;default:break;}}catch(_0x116988){utils[_0xb159('0x14')](util['format'](_0xb159('0x25'),members[_0x2094e5['device']]?members[_0x2094e5['device']]['uniqueid']:_0x2094e5[_0xb159('0x17')]),_0x116988);}};exports['agentcomplete']=function(_0x3eb8b0){try{if(!_[_0xb159('0x1f')](members[_0x3eb8b0[_0xb159('0x8')]])){utils[_0xb159('0x26')](util['format'](_0xb159('0x27'),_0x3eb8b0[_0xb159('0x7')]),_0x3eb8b0);utils[_0xb159('0x5')](util[_0xb159('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3eb8b0[_0xb159('0x7')],_0x3eb8b0['interface'],_0x3eb8b0[_0xb159('0x28')]));members[_0x3eb8b0[_0xb159('0x8')]]=_[_0xb159('0x29')](members[_0x3eb8b0[_0xb159('0x8')]],{'data4':_0x3eb8b0[_0xb159('0x28')],'uniqueid':_0x3eb8b0[_0xb159('0x7')]});}}catch(_0x2aa053){utils[_0xb159('0x14')](util['format'](_0xb159('0x27'),_0x3eb8b0[_0xb159('0x7')]),_0x2aa053);}};exports[_0xb159('0x2a')]=function(_0x18175a){try{utils[_0xb159('0x26')](util['format'](_0xb159('0x2b'),_0x18175a['uniqueid']),_0x18175a);if(_0x18175a[_0xb159('0x9')]){var _0x2ef5e9=_0x18175a[_0xb159('0x9')][_0xb159('0x2c')]('-')[0x0];if(!_[_0xb159('0x1f')](members[_0x2ef5e9])){members[_0x2ef5e9]=_[_0xb159('0x29')](members[_0x2ef5e9],{'data1':members[_0x2ef5e9]['data1']||_0x18175a[_0xb159('0xb')],'data2':members[_0x2ef5e9][_0xb159('0xa')]||_0x18175a[_0xb159('0x2d')],'data3':members[_0x2ef5e9][_0xb159('0x2e')]||_0x18175a['destination'],'uniqueid':members[_0x2ef5e9][_0xb159('0x7')]||_0x18175a['uniqueid']});utils['info'](util[_0xb159('0x6')](_0xb159('0x2f'),_0x18175a['uniqueid'],members[_0x2ef5e9][_0xb159('0x30')],members[_0x2ef5e9][_0xb159('0xa')],members[_0x2ef5e9]['data3']));if(members[_0x2ef5e9][_0xb159('0x20')]){writeDB(members[_0x2ef5e9]);}}}if(_0x18175a[_0xb159('0x31')]){var _0x38b8c0=_0x18175a[_0xb159('0x31')][_0xb159('0x2c')]('-')[0x0];if(!_[_0xb159('0x1f')](members[_0x38b8c0])){members[_0x38b8c0]=_[_0xb159('0x29')](members[_0x38b8c0],{'data1':members[_0x38b8c0][_0xb159('0x30')]||_0x18175a[_0xb159('0xb')],'data2':members[_0x38b8c0]['data2']||_0x18175a[_0xb159('0x2d')],'data3':members[_0x38b8c0][_0xb159('0x2e')]||_0x18175a[_0xb159('0x32')],'uniqueid':members[_0x38b8c0][_0xb159('0x7')]||_0x18175a['uniqueid']});utils[_0xb159('0x5')](util[_0xb159('0x6')](_0xb159('0x2f'),_0x18175a[_0xb159('0x7')],members[_0x38b8c0]['data1'],members[_0x38b8c0][_0xb159('0xa')],members[_0x38b8c0][_0xb159('0x2e')]));if(members[_0x38b8c0][_0xb159('0x20')]){writeDB(members[_0x38b8c0]);}}}}catch(_0x1eda41){utils[_0xb159('0x14')](util[_0xb159('0x6')](_0xb159('0x2b'),_0x18175a['uniqueid']),_0x1eda41);}}; \ No newline at end of file +var _0x996b=['queue','[%s][members][cdr]','data1','source','destination','destinationchannel','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','uniqueid','interface','channel','data2','membername','type','then','internal','request','split','CreateMemberReport','catch','error','format','[%s][members][writeDB]','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','assign'];(function(_0x2d4d84,_0x3fb18c){var _0x2920f0=function(_0x4c4c7f){while(--_0x4c4c7f){_0x2d4d84['push'](_0x2d4d84['shift']());}};_0x2920f0(++_0x3fb18c);}(_0x996b,0x9b));var _0xb996=function(_0x4dba54,_0x2d7269){_0x4dba54=_0x4dba54-0x0;var _0x153b15=_0x996b[_0x4dba54];return _0x153b15;};'use strict';var _=require(_0xb996('0x0'));var util=require(_0xb996('0x1'));var utils=require(_0xb996('0x2'));var members={};var exclude=[_0xb996('0x3'),_0xb996('0x4')];function writeDB(_0x402d44){utils[_0xb996('0x5')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x402d44[_0xb996('0x6')],_0x402d44[_0xb996('0x7')],_0x402d44[_0xb996('0x8')],_0x402d44[_0xb996('0x9')],_0x402d44[_0xb996('0xa')],_0x402d44[_0xb996('0xb')]));if(_0x402d44[_0xb996('0x7')]){utils['getUserByInterface'](_0x402d44[_0xb996('0x7')])[_0xb996('0xc')](function(_0x1ec3a2){if(_0x1ec3a2){_0x402d44['membername']=_0x1ec3a2['name'];_0x402d44[_0xb996('0xd')]=_0x1ec3a2[_0xb996('0xd')];utils[_0xb996('0xe')]('CreateMemberReport',_0x402d44);}else{utils['getUserByName'](_0x402d44[_0xb996('0x7')][_0xb996('0xf')]('/')[0x1])[_0xb996('0xc')](function(_0x4d547e){if(_0x4d547e){_0x402d44['membername']=_0x4d547e['name'];_0x402d44[_0xb996('0xd')]=_0x4d547e[_0xb996('0xd')];utils[_0xb996('0xe')](_0xb996('0x10'),_0x402d44);}});}})[_0xb996('0x11')](function(_0x2212de){utils[_0xb996('0x12')](util[_0xb996('0x13')](_0xb996('0x14'),_0x402d44[_0xb996('0x6')]),_0x2212de);});}delete members[_0x402d44[_0xb996('0x7')]];}function startsWith(_0x38de69,_0x2ee153){return _['some'](_0x38de69,function(_0x383042){return _[_0xb996('0x15')](_0x2ee153,_0x383042);});}exports[_0xb996('0x16')]=function(_0xaccf2e){try{utils[_0xb996('0x17')](util[_0xb996('0x13')]('[%s][members][devicestatechange]',members[_0xaccf2e[_0xb996('0x18')]]?members[_0xaccf2e[_0xb996('0x18')]][_0xb996('0x6')]:_0xaccf2e['device']),_0xaccf2e);utils[_0xb996('0x5')](util['format'](_0xb996('0x19'),members[_0xaccf2e[_0xb996('0x18')]]?members[_0xaccf2e[_0xb996('0x18')]][_0xb996('0x6')]:_0xaccf2e[_0xb996('0x18')],_0xaccf2e[_0xb996('0x1a')],_0xaccf2e[_0xb996('0x18')]));switch(_0xaccf2e[_0xb996('0x1a')]){case _0xb996('0x1b'):case'BUSY':if(!startsWith(exclude,_0xaccf2e[_0xb996('0x18')])){members[_0xaccf2e[_0xb996('0x18')]]={'channel':_0xb996('0x1c'),'interface':_0xaccf2e[_0xb996('0x18')],'type':_0xb996('0x1d'),'enterAt':utils[_0xb996('0x1e')](),'role':_0xb996('0x1f')};}break;case'NOT_INUSE':if(!_[_0xb996('0x20')](members[_0xaccf2e[_0xb996('0x18')]])){members[_0xaccf2e[_0xb996('0x18')]][_0xb996('0x21')]=utils[_0xb996('0x1e')]();members[_0xaccf2e[_0xb996('0x18')]][_0xb996('0x22')]=utils[_0xb996('0x23')](members[_0xaccf2e[_0xb996('0x18')]][_0xb996('0x21')],members[_0xaccf2e['device']][_0xb996('0x24')]);if(members[_0xaccf2e['device']][_0xb996('0x6')]){writeDB(members[_0xaccf2e[_0xb996('0x18')]]);}}break;default:break;}}catch(_0x4db507){utils[_0xb996('0x12')](util['format'](_0xb996('0x25'),members[_0xaccf2e['device']]?members[_0xaccf2e[_0xb996('0x18')]][_0xb996('0x6')]:_0xaccf2e[_0xb996('0x18')]),_0x4db507);}};exports[_0xb996('0x26')]=function(_0x37f75c){try{if(!_[_0xb996('0x20')](members[_0x37f75c[_0xb996('0x7')]])){utils[_0xb996('0x17')](util['format'](_0xb996('0x27'),_0x37f75c[_0xb996('0x6')]),_0x37f75c);utils[_0xb996('0x5')](util[_0xb996('0x13')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x37f75c['uniqueid'],_0x37f75c['interface'],_0x37f75c['queue']));members[_0x37f75c[_0xb996('0x7')]]=_[_0xb996('0x28')](members[_0x37f75c[_0xb996('0x7')]],{'data4':_0x37f75c[_0xb996('0x29')],'uniqueid':_0x37f75c['uniqueid']});}}catch(_0x4bac40){utils[_0xb996('0x12')](util[_0xb996('0x13')](_0xb996('0x27'),_0x37f75c[_0xb996('0x6')]),_0x4bac40);}};exports['cdr']=function(_0x5f1b48){try{utils[_0xb996('0x17')](util[_0xb996('0x13')](_0xb996('0x2a'),_0x5f1b48[_0xb996('0x6')]),_0x5f1b48);if(_0x5f1b48['channel']){var _0xd1c27=_0x5f1b48[_0xb996('0x8')][_0xb996('0xf')]('-')[0x0];if(!_[_0xb996('0x20')](members[_0xd1c27])){members[_0xd1c27]=_['assign'](members[_0xd1c27],{'data1':members[_0xd1c27][_0xb996('0x2b')]||_0x5f1b48[_0xb996('0xb')],'data2':members[_0xd1c27][_0xb996('0x9')]||_0x5f1b48[_0xb996('0x2c')],'data3':members[_0xd1c27]['data3']||_0x5f1b48[_0xb996('0x2d')],'uniqueid':members[_0xd1c27][_0xb996('0x6')]||_0x5f1b48[_0xb996('0x6')]});utils[_0xb996('0x5')](util[_0xb996('0x13')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5f1b48['uniqueid'],members[_0xd1c27]['data1'],members[_0xd1c27][_0xb996('0x9')],members[_0xd1c27]['data3']));if(members[_0xd1c27][_0xb996('0x21')]){writeDB(members[_0xd1c27]);}}}if(_0x5f1b48['destinationchannel']){var _0x4c14e6=_0x5f1b48[_0xb996('0x2e')]['split']('-')[0x0];if(!_[_0xb996('0x20')](members[_0x4c14e6])){members[_0x4c14e6]=_['assign'](members[_0x4c14e6],{'data1':members[_0x4c14e6]['data1']||_0x5f1b48[_0xb996('0xb')],'data2':members[_0x4c14e6]['data2']||_0x5f1b48['source'],'data3':members[_0x4c14e6][_0xb996('0x2f')]||_0x5f1b48[_0xb996('0x2d')],'uniqueid':members[_0x4c14e6][_0xb996('0x6')]||_0x5f1b48[_0xb996('0x6')]});utils[_0xb996('0x5')](util['format'](_0xb996('0x30'),_0x5f1b48['uniqueid'],members[_0x4c14e6][_0xb996('0x2b')],members[_0x4c14e6]['data2'],members[_0x4c14e6][_0xb996('0x2f')]));if(members[_0x4c14e6]['exitAt']){writeDB(members[_0x4c14e6]);}}}}catch(_0x2fcd89){utils[_0xb996('0x12')](util[_0xb996('0x13')](_0xb996('0x2a'),_0x5f1b48[_0xb996('0x6')]),_0x2fcd89);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3a29f55..c55e4f3 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 _0x4fa3=['info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexitAt','[%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','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','queuecallerabandonAt','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils'];(function(_0x4431f,_0x1990b6){var _0x34809f=function(_0x59eb38){while(--_0x59eb38){_0x4431f['push'](_0x4431f['shift']());}};_0x34809f(++_0x1990b6);}(_0x4fa3,0x1a9));var _0x34fa=function(_0x498699,_0xd9ba7f){_0x498699=_0x498699-0x0;var _0x399f77=_0x4fa3[_0x498699];return _0x399f77;};'use strict';var _=require(_0x34fa('0x0'));var util=require(_0x34fa('0x1'));var utils=require(_0x34fa('0x2'));var queues={};function writeDB(_0x46159d){utils[_0x34fa('0x3')](util[_0x34fa('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x46159d[_0x34fa('0x5')],_0x46159d[_0x34fa('0x6')],_0x46159d[_0x34fa('0x7')],_0x46159d[_0x34fa('0x8')],_0x46159d[_0x34fa('0x9')],_0x46159d[_0x34fa('0xa')],_0x46159d[_0x34fa('0xb')]));if(_0x46159d[_0x34fa('0x7')]){utils[_0x34fa('0xc')](_0x46159d[_0x34fa('0x7')])[_0x34fa('0xd')](function(_0x119420){if(_0x119420){_0x46159d[_0x34fa('0xe')]=_0x119420[_0x34fa('0xe')];}utils[_0x34fa('0xf')](_0x34fa('0x10'),_0x46159d);});}else{utils[_0x34fa('0xf')](_0x34fa('0x10'),_0x46159d);}if(_0x46159d[_0x34fa('0x11')]){delete queues[_0x46159d['transfereduniqueid']];}else{delete queues[_0x46159d[_0x34fa('0x5')]];}}exports[_0x34fa('0x12')]=function(_0x4c61c9){try{utils[_0x34fa('0x13')](util[_0x34fa('0x4')]('[%s][queues][queuecallerjoin]',_0x4c61c9[_0x34fa('0x5')]),_0x4c61c9);utils[_0x34fa('0x3')](util['format'](_0x34fa('0x14'),_0x4c61c9['uniqueid'],_0x4c61c9[_0x34fa('0x7')],_0x4c61c9[_0x34fa('0x15')]));queues[_0x4c61c9[_0x34fa('0x5')]]=_['assign'](_0x4c61c9,{'originalposition':_0x4c61c9[_0x34fa('0x15')],'queuecallerjoinAt':utils[_0x34fa('0x16')](),'mohtime':0x0});}catch(_0x26acce){utils[_0x34fa('0x17')](util[_0x34fa('0x4')]('[%s][queues][queuecallerjoin]',_0x4c61c9[_0x34fa('0x5')]),_0x26acce);}};exports[_0x34fa('0x18')]=function(_0xc3a7e7){try{if(!_[_0x34fa('0x19')](queues[_0xc3a7e7[_0x34fa('0x5')]])){utils[_0x34fa('0x13')](util[_0x34fa('0x4')]('[%s][queues][hangup]',_0xc3a7e7[_0x34fa('0x5')]),_0xc3a7e7);if(queues[_0xc3a7e7[_0x34fa('0x5')]]['queuecallerleaveAt']){if(!queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x1a')]&&!queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x1b')]){queues[_0xc3a7e7[_0x34fa('0x5')]]['queuecallercomplete']=!![];queues[_0xc3a7e7['uniqueid']][_0x34fa('0x1c')]=utils[_0x34fa('0x16')]();queues[_0xc3a7e7['uniqueid']][_0x34fa('0xb')]=_0x34fa('0x1d');}utils[_0x34fa('0x3')](util['format'](_0x34fa('0x1e'),_0xc3a7e7['uniqueid'],queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x1f')],queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0xb')]));writeDB(queues[_0xc3a7e7[_0x34fa('0x5')]]);}else if(queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x11')]){utils['info'](util['format'](_0x34fa('0x20'),_0xc3a7e7[_0x34fa('0x5')],queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x1f')],queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x11')]));queues[queues[_0xc3a7e7[_0x34fa('0x5')]]['transfereduniqueid']]=queues[_0xc3a7e7['uniqueid']];queues[queues[_0xc3a7e7[_0x34fa('0x5')]][_0x34fa('0x11')]][_0x34fa('0x21')]=0x2;delete queues[_0xc3a7e7[_0x34fa('0x5')]];}}}catch(_0x295abd){utils[_0x34fa('0x17')](util[_0x34fa('0x4')](_0x34fa('0x22'),_0xc3a7e7['uniqueid']),_0x295abd);}};exports[_0x34fa('0x23')]=function(_0x3709c0){try{utils[_0x34fa('0x13')](util['format'](_0x34fa('0x24'),_0x3709c0['uniqueid']),_0x3709c0);if(!_[_0x34fa('0x19')](_0x3709c0[_0x34fa('0x25')][_0x34fa('0x26')])&&_0x3709c0[_0x34fa('0x27')][_0x34fa('0x28')]()!=='CONTINUE'){if(!_[_0x34fa('0x19')](queues[_0x3709c0['uniqueid']])){queues[_0x3709c0['uniqueid']][_0x34fa('0x1a')]=![];queues[_0x3709c0[_0x34fa('0x5')]]['queuecallerabandonAt']=null;queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0x1b')]=!![];queues[_0x3709c0[_0x34fa('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0xb')]=_0x3709c0['value']['toUpperCase']();utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x29'),_0x3709c0['uniqueid'],queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0x1f')],_0x3709c0['value'],queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0xb')]));writeDB(queues[_0x3709c0[_0x34fa('0x5')]]);}}else if(!_[_0x34fa('0x19')](_0x3709c0[_0x34fa('0x25')][_0x34fa('0x2a')])){if(!_[_0x34fa('0x19')](queues[_0x3709c0[_0x34fa('0x5')]])&&!queues[_0x3709c0['uniqueid']][_0x34fa('0x1a')]){queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0x1a')]=![];queues[_0x3709c0[_0x34fa('0x5')]]['queuecallerabandonAt']=null;queues[_0x3709c0['uniqueid']]['queuecallerexit']=!![];queues[_0x3709c0[_0x34fa('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0xb')]=_0x34fa('0x2b');utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x2c'),_0x3709c0['uniqueid'],queues[_0x3709c0[_0x34fa('0x5')]]['name'],_0x3709c0[_0x34fa('0x27')],queues[_0x3709c0[_0x34fa('0x5')]][_0x34fa('0xb')]));}}}catch(_0x51e5f9){utils[_0x34fa('0x17')](util[_0x34fa('0x4')]('[%s][queues][varset]',_0x3709c0[_0x34fa('0x5')]),_0x51e5f9);}};exports[_0x34fa('0x1a')]=function(_0x544c74){try{if(!_[_0x34fa('0x19')](queues[_0x544c74[_0x34fa('0x5')]])){utils[_0x34fa('0x13')](util[_0x34fa('0x4')](_0x34fa('0x2d'),_0x544c74[_0x34fa('0x5')]),_0x544c74);queues[_0x544c74['uniqueid']][_0x34fa('0x1b')]=![];queues[_0x544c74['uniqueid']][_0x34fa('0x2e')]=null;queues[_0x544c74['uniqueid']][_0x34fa('0x1a')]=!![];queues[_0x544c74[_0x34fa('0x5')]]['queuecallerabandonAt']=utils[_0x34fa('0x16')]();queues[_0x544c74[_0x34fa('0x5')]][_0x34fa('0xb')]='ABANDONED';utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x2f'),_0x544c74[_0x34fa('0x5')],queues[_0x544c74[_0x34fa('0x5')]]['name'],queues[_0x544c74[_0x34fa('0x5')]]['queuecallerexitreason']));}}catch(_0x6a96b7){utils['error'](util['format']('[%s][queues][queuecallerabandon]',_0x544c74[_0x34fa('0x5')]),_0x6a96b7);}};exports[_0x34fa('0x30')]=function(_0x400d1f){try{if(!_['isNil'](queues[_0x400d1f['uniqueid']])){utils[_0x34fa('0x13')](util['format'](_0x34fa('0x31'),_0x400d1f[_0x34fa('0x5')]),_0x400d1f);utils[_0x34fa('0x3')](util['format'](_0x34fa('0x32'),_0x400d1f[_0x34fa('0x5')],queues[_0x400d1f[_0x34fa('0x5')]]['name'],_0x400d1f[_0x34fa('0x33')],_0x400d1f[_0x34fa('0x34')]));queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x30')]=!![];queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x35')]=utils[_0x34fa('0x16')]();queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x36')]=utils[_0x34fa('0x37')](queues[_0x400d1f[_0x34fa('0x5')]]['queuecallerleaveAt'],queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x38')]);queues[_0x400d1f['uniqueid']][_0x34fa('0x15')]=_0x400d1f[_0x34fa('0x15')];queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x39')]=_0x400d1f[_0x34fa('0x39')];queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x33')]=_0x400d1f[_0x34fa('0x33')];queues[_0x400d1f[_0x34fa('0x5')]][_0x34fa('0x34')]=_0x400d1f[_0x34fa('0x34')];}}catch(_0x5e5b63){utils[_0x34fa('0x17')](util[_0x34fa('0x4')](_0x34fa('0x31'),_0x400d1f[_0x34fa('0x5')]),_0x5e5b63);}};exports['agentconnect']=function(_0x323201){try{if(!_[_0x34fa('0x19')](queues[_0x323201['uniqueid']])){utils['debug'](util[_0x34fa('0x4')]('[%s][queues][agentconnect]',_0x323201['uniqueid']),_0x323201);utils['info'](util[_0x34fa('0x4')](_0x34fa('0x3a'),_0x323201[_0x34fa('0x5')],queues[_0x323201[_0x34fa('0x5')]]['name'],_0x323201[_0x34fa('0x3b')],_0x323201[_0x34fa('0x3c')]));queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x1a')]=![];queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x1a')]=![];queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x3d')]=null;queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x1b')]=![];queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0xb')]=null;queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x2e')]=null;queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x3e')]=!![];queues[_0x323201['uniqueid']][_0x34fa('0xa')]=_0x323201[_0x34fa('0x3c')];queues[_0x323201[_0x34fa('0x5')]][_0x34fa('0x8')]=_0x323201[_0x34fa('0x3b')];}}catch(_0x4b3415){utils[_0x34fa('0x17')](util[_0x34fa('0x4')](_0x34fa('0x3f'),_0x323201['uniqueid']),_0x4b3415);}};exports[_0x34fa('0x40')]=function(_0x15d08c){try{if(!_[_0x34fa('0x19')](queues[_0x15d08c[_0x34fa('0x5')]])){if(queues[_0x15d08c[_0x34fa('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0x34fa('0x4')](_0x34fa('0x41'),_0x15d08c[_0x34fa('0x5')]),_0x15d08c);queues[_0x15d08c['uniqueid']][_0x34fa('0x1a')]=![];queues[_0x15d08c['uniqueid']][_0x34fa('0x1a')]=![];queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0x3d')]=null;queues[_0x15d08c['uniqueid']][_0x34fa('0x1b')]=![];queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0x2e')]=null;queues[_0x15d08c['uniqueid']][_0x34fa('0x3e')]=!![];queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0x8')]=_0x15d08c['membername'];queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0x42')]=!![];queues[_0x15d08c[_0x34fa('0x5')]]['queuecallercompleteAt']=utils['now']();if(_0x15d08c['reason']==_0x34fa('0x43')){if(!queues[_0x15d08c[_0x34fa('0x5')]]['transfer']){queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0xb')]=_0x34fa('0x44');}}else{queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0xb')]=_0x34fa('0x45')+_0x15d08c[_0x34fa('0x46')][_0x34fa('0x28')]();}utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x47'),_0x15d08c[_0x34fa('0x5')],queues[_0x15d08c[_0x34fa('0x5')]][_0x34fa('0x1f')],_0x15d08c['membername'],queues[_0x15d08c['uniqueid']][_0x34fa('0xb')]));writeDB(queues[_0x15d08c[_0x34fa('0x5')]]);}}}catch(_0xb3266f){utils[_0x34fa('0x17')](util['format'](_0x34fa('0x41'),_0x15d08c['uniqueid']),_0xb3266f);}};exports['blindtransfer']=function(_0x5eceec){try{if(!_['isNil'](queues[_0x5eceec[_0x34fa('0x48')]])){utils[_0x34fa('0x13')](util[_0x34fa('0x4')](_0x34fa('0x49'),_0x5eceec[_0x34fa('0x5')]),_0x5eceec);queues[_0x5eceec['transfereeuniqueid']]['transfer']=!![];queues[_0x5eceec[_0x34fa('0x48')]][_0x34fa('0x4a')]='BLIND';queues[_0x5eceec[_0x34fa('0x48')]]['transferexten']=_0x5eceec[_0x34fa('0x4b')];queues[_0x5eceec[_0x34fa('0x48')]][_0x34fa('0x4c')]=_0x5eceec['transfereeuniqueid'];queues[_0x5eceec['transfereeuniqueid']][_0x34fa('0xb')]=_0x34fa('0x4d');utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x4e'),_0x5eceec[_0x34fa('0x5')],queues[_0x5eceec[_0x34fa('0x48')]][_0x34fa('0x1f')],_0x5eceec['transfereeuniqueid'],_0x5eceec[_0x34fa('0x4b')]));}}catch(_0x5f401e){utils['error'](util[_0x34fa('0x4')](_0x34fa('0x49'),_0x5eceec[_0x34fa('0x5')]),_0x5f401e);}};exports[_0x34fa('0x4f')]=function(_0x33587b){try{utils['debug'](util[_0x34fa('0x4')](_0x34fa('0x50'),_0x33587b[_0x34fa('0x51')]),_0x33587b);if(_0x33587b['origtransfereruniqueid']==_0x33587b['origtransfererlinkedid']){if(!_[_0x34fa('0x19')](queues[_0x33587b[_0x34fa('0x52')]])){utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x53'),_0x33587b[_0x34fa('0x51')],queues[_0x33587b[_0x34fa('0x52')]][_0x34fa('0x1f')],_0x33587b[_0x34fa('0x54')]));queues[_0x33587b[_0x34fa('0x52')]]['transfer']=!![];queues[_0x33587b[_0x34fa('0x52')]][_0x34fa('0x4a')]=_0x34fa('0x55');queues[_0x33587b[_0x34fa('0x52')]]['transferexten']=_0x33587b[_0x34fa('0x54')];queues[_0x33587b[_0x34fa('0x52')]]['transferuniqueid']=_0x33587b[_0x34fa('0x51')];queues[_0x33587b[_0x34fa('0x52')]]['queuecallerexitreason']=_0x34fa('0x56');}if(!_[_0x34fa('0x19')](queues[_0x33587b[_0x34fa('0x57')]])){if(_0x33587b[_0x34fa('0x58')]&&queues[_0x33587b[_0x34fa('0x58')]]){queues[_0x33587b[_0x34fa('0x58')]][_0x34fa('0x21')]=0x1;queues[_0x33587b[_0x34fa('0x48')]]=_[_0x34fa('0x59')](queues[_0x33587b[_0x34fa('0x58')]]);queues[_0x33587b[_0x34fa('0x48')]]['transfereduniqueid']=_0x33587b['transfertargetuniqueid'];queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x21')]=0x2;queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x9')]=queues[_0x33587b[_0x34fa('0x52')]][_0x34fa('0x9')];queues[_0x33587b['transfereeuniqueid']][_0x34fa('0x5a')]=queues[_0x33587b['secondtransfererlinkedid']][_0x34fa('0x5a')];queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x38')]=utils[_0x34fa('0x16')]();queues[_0x33587b['transfereeuniqueid']][_0x34fa('0x35')]=utils[_0x34fa('0x16')]();queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x36')]=0x0;queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x5b')]=0x0;utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x5c'),_0x33587b[_0x34fa('0x51')],queues[_0x33587b['transfereeuniqueid']][_0x34fa('0x1f')],queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x9')],queues[_0x33587b[_0x34fa('0x48')]][_0x34fa('0x5a')]));}else{utils[_0x34fa('0x3')](util['format'](_0x34fa('0x5d'),_0x33587b['origtransfereruniqueid'],queues[_0x33587b['origtransfererlinkedid']]['name'],_0x33587b[_0x34fa('0x52')]));queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0x11')]=_0x33587b[_0x34fa('0x52')];}}}else if(_0x33587b[_0x34fa('0x5e')]==_0x33587b[_0x34fa('0x52')]){if(!_[_0x34fa('0x19')](queues[_0x33587b[_0x34fa('0x57')]])){utils['info'](util['format'](_0x34fa('0x5f'),_0x33587b[_0x34fa('0x51')],queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0x1f')],_0x33587b[_0x34fa('0x5e')],_0x33587b[_0x34fa('0x60')]));queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0x43')]=!![];queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0x4a')]=_0x34fa('0x55');queues[_0x33587b['origtransfererlinkedid']][_0x34fa('0x61')]=_0x33587b[_0x34fa('0x60')];queues[_0x33587b['origtransfererlinkedid']]['transferuniqueid']=_0x33587b['secondtransfereruniqueid'];queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x34fa('0x19')](queues[_0x33587b[_0x34fa('0x52')]])){if(_0x33587b['transfertargetlinkedid']&&queues[_0x33587b[_0x34fa('0x62')]]){queues[_0x33587b[_0x34fa('0x62')]][_0x34fa('0x21')]=0x1;queues[_0x33587b[_0x34fa('0x63')]]=_[_0x34fa('0x59')](queues[_0x33587b[_0x34fa('0x62')]]);queues[_0x33587b[_0x34fa('0x63')]]['transfereduniqueid']=_0x33587b[_0x34fa('0x63')];queues[_0x33587b['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x33587b[_0x34fa('0x63')]][_0x34fa('0x9')]=queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0x9')];queues[_0x33587b['transfertargetuniqueid']][_0x34fa('0x5a')]=queues[_0x33587b[_0x34fa('0x57')]][_0x34fa('0x5a')];queues[_0x33587b[_0x34fa('0x63')]][_0x34fa('0x38')]=utils[_0x34fa('0x16')]();queues[_0x33587b[_0x34fa('0x63')]]['queuecallerleaveAt']=utils[_0x34fa('0x16')]();queues[_0x33587b[_0x34fa('0x63')]][_0x34fa('0x36')]=0x0;queues[_0x33587b['transfertargetuniqueid']][_0x34fa('0x5b')]=0x0;utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x64'),_0x33587b[_0x34fa('0x51')],queues[_0x33587b[_0x34fa('0x63')]][_0x34fa('0x1f')],queues[_0x33587b['transfertargetuniqueid']][_0x34fa('0x11')],queues[_0x33587b[_0x34fa('0x63')]][_0x34fa('0x9')],queues[_0x33587b[_0x34fa('0x63')]][_0x34fa('0x5a')]));}else{utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x5d'),_0x33587b['origtransfereruniqueid'],queues[_0x33587b[_0x34fa('0x52')]][_0x34fa('0x1f')],_0x33587b[_0x34fa('0x57')]));queues[_0x33587b[_0x34fa('0x52')]][_0x34fa('0x11')]=_0x33587b[_0x34fa('0x57')];}}}}catch(_0x2f3e58){utils['error'](util['format'](_0x34fa('0x50'),_0x33587b[_0x34fa('0x51')]),_0x2f3e58);}};exports[_0x34fa('0x65')]=function(_0x40d5e3){try{if(!_[_0x34fa('0x19')](queues[_0x40d5e3['uniqueid']])){utils[_0x34fa('0x13')](util['format']('[%s][queues][musiconholdstart]',_0x40d5e3[_0x34fa('0x5')]),_0x40d5e3);queues[_0x40d5e3[_0x34fa('0x5')]][_0x34fa('0x66')]=utils[_0x34fa('0x16')]();utils['info'](util[_0x34fa('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x40d5e3[_0x34fa('0x5')],queues[_0x40d5e3[_0x34fa('0x5')]][_0x34fa('0x1f')],queues[_0x40d5e3['uniqueid']][_0x34fa('0x66')]));}}catch(_0x5cf786){utils['error'](util[_0x34fa('0x4')](_0x34fa('0x67'),_0x40d5e3[_0x34fa('0x5')]),_0x5cf786);}};exports[_0x34fa('0x68')]=function(_0x3b9ff9){try{if(!_[_0x34fa('0x19')](queues[_0x3b9ff9[_0x34fa('0x5')]])){if(!_[_0x34fa('0x19')](queues[_0x3b9ff9[_0x34fa('0x5')]][_0x34fa('0x66')])){utils['debug'](util[_0x34fa('0x4')](_0x34fa('0x69'),_0x3b9ff9['uniqueid']),_0x3b9ff9);queues[_0x3b9ff9[_0x34fa('0x5')]][_0x34fa('0x5b')]+=utils[_0x34fa('0x37')](utils['now'](),queues[_0x3b9ff9[_0x34fa('0x5')]]['musiconholdstartAt']);utils[_0x34fa('0x3')](util[_0x34fa('0x4')](_0x34fa('0x6a'),_0x3b9ff9[_0x34fa('0x5')],queues[_0x3b9ff9[_0x34fa('0x5')]]['name'],queues[_0x3b9ff9[_0x34fa('0x5')]]['mohtime']));delete queues[_0x3b9ff9[_0x34fa('0x5')]][_0x34fa('0x66')];}}}catch(_0x59c4d2){utils[_0x34fa('0x17')](util[_0x34fa('0x4')](_0x34fa('0x69'),_0x3b9ff9['uniqueid']),_0x59c4d2);}}; \ No newline at end of file +var _0xf490=['blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','now','error','debug','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','name','transfereduniqueid','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','isNil','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','accountcode','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xf490,0xe7));var _0x0f49=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xf490[_0x5beda8];return _0x2aa042;};'use strict';var _=require(_0x0f49('0x0'));var util=require(_0x0f49('0x1'));var utils=require(_0x0f49('0x2'));var queues={};function writeDB(_0x2ee408){utils[_0x0f49('0x3')](util[_0x0f49('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x2ee408[_0x0f49('0x5')],_0x2ee408[_0x0f49('0x6')],_0x2ee408[_0x0f49('0x7')],_0x2ee408[_0x0f49('0x8')],_0x2ee408[_0x0f49('0x9')],_0x2ee408['accountcode'],_0x2ee408[_0x0f49('0xa')]));if(_0x2ee408[_0x0f49('0x7')]){utils[_0x0f49('0xb')](_0x2ee408['queue'])[_0x0f49('0xc')](function(_0x1f4547){if(_0x1f4547){_0x2ee408[_0x0f49('0xd')]=_0x1f4547['type'];}utils['request'](_0x0f49('0xe'),_0x2ee408);});}else{utils[_0x0f49('0xf')](_0x0f49('0xe'),_0x2ee408);}if(_0x2ee408['transfereduniqueid']){delete queues[_0x2ee408['transfereduniqueid']];}else{delete queues[_0x2ee408[_0x0f49('0x5')]];}}exports['queuecallerjoin']=function(_0x5e1332){try{utils['debug'](util['format'](_0x0f49('0x10'),_0x5e1332[_0x0f49('0x5')]),_0x5e1332);utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x11'),_0x5e1332['uniqueid'],_0x5e1332[_0x0f49('0x7')],_0x5e1332['position']));queues[_0x5e1332[_0x0f49('0x5')]]=_['assign'](_0x5e1332,{'originalposition':_0x5e1332['position'],'queuecallerjoinAt':utils[_0x0f49('0x12')](),'mohtime':0x0});}catch(_0x3e3788){utils[_0x0f49('0x13')](util['format'](_0x0f49('0x10'),_0x5e1332[_0x0f49('0x5')]),_0x3e3788);}};exports['hangup']=function(_0x400a72){try{if(!_['isNil'](queues[_0x400a72[_0x0f49('0x5')]])){utils[_0x0f49('0x14')](util[_0x0f49('0x4')]('[%s][queues][hangup]',_0x400a72[_0x0f49('0x5')]),_0x400a72);if(queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x15')]){if(!queues[_0x400a72['uniqueid']][_0x0f49('0x16')]&&!queues[_0x400a72[_0x0f49('0x5')]]['queuecallerexit']){queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x17')]=!![];queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x18')]=utils[_0x0f49('0x12')]();queues[_0x400a72['uniqueid']][_0x0f49('0xa')]='COMPLETEDBYAGENT';}utils[_0x0f49('0x3')](util[_0x0f49('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x400a72[_0x0f49('0x5')],queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x19')],queues[_0x400a72['uniqueid']][_0x0f49('0xa')]));writeDB(queues[_0x400a72['uniqueid']]);}else if(queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x1a')]){utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x1b'),_0x400a72['uniqueid'],queues[_0x400a72['uniqueid']][_0x0f49('0x19')],queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x1a')]));queues[queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x1a')]]=queues[_0x400a72[_0x0f49('0x5')]];queues[queues[_0x400a72[_0x0f49('0x5')]][_0x0f49('0x1a')]]['queuecallerenterreason']=0x2;delete queues[_0x400a72[_0x0f49('0x5')]];}}}catch(_0x41510d){utils[_0x0f49('0x13')](util['format'](_0x0f49('0x1c'),_0x400a72['uniqueid']),_0x41510d);}};exports[_0x0f49('0x1d')]=function(_0x1ea8e6){try{utils['debug'](util[_0x0f49('0x4')](_0x0f49('0x1e'),_0x1ea8e6[_0x0f49('0x5')]),_0x1ea8e6);if(!_['isNil'](_0x1ea8e6['variable'][_0x0f49('0x1f')])&&_0x1ea8e6[_0x0f49('0x20')][_0x0f49('0x21')]()!=='CONTINUE'){if(!_[_0x0f49('0x22')](queues[_0x1ea8e6[_0x0f49('0x5')]])){queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x16')]=![];queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x23')]=null;queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x24')]=!![];queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x25')]=utils[_0x0f49('0x12')]();queues[_0x1ea8e6['uniqueid']][_0x0f49('0xa')]=_0x1ea8e6[_0x0f49('0x20')][_0x0f49('0x21')]();utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x26'),_0x1ea8e6[_0x0f49('0x5')],queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x19')],_0x1ea8e6[_0x0f49('0x20')],queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0xa')]));writeDB(queues[_0x1ea8e6['uniqueid']]);}}else if(!_['isNil'](_0x1ea8e6['variable']['queueposition'])){if(!_['isNil'](queues[_0x1ea8e6[_0x0f49('0x5')]])&&!queues[_0x1ea8e6[_0x0f49('0x5')]]['queuecallerabandon']){queues[_0x1ea8e6['uniqueid']][_0x0f49('0x16')]=![];queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x23')]=null;queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x24')]=!![];queues[_0x1ea8e6['uniqueid']][_0x0f49('0x25')]=utils[_0x0f49('0x12')]();queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0xa')]=_0x0f49('0x27');utils['info'](util[_0x0f49('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1ea8e6['uniqueid'],queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0x19')],_0x1ea8e6[_0x0f49('0x20')],queues[_0x1ea8e6[_0x0f49('0x5')]][_0x0f49('0xa')]));}}}catch(_0x32f710){utils['error'](util[_0x0f49('0x4')](_0x0f49('0x1e'),_0x1ea8e6[_0x0f49('0x5')]),_0x32f710);}};exports[_0x0f49('0x16')]=function(_0x2f1e5f){try{if(!_[_0x0f49('0x22')](queues[_0x2f1e5f[_0x0f49('0x5')]])){utils[_0x0f49('0x14')](util[_0x0f49('0x4')](_0x0f49('0x28'),_0x2f1e5f[_0x0f49('0x5')]),_0x2f1e5f);queues[_0x2f1e5f[_0x0f49('0x5')]][_0x0f49('0x24')]=![];queues[_0x2f1e5f[_0x0f49('0x5')]]['queuecallerexitAt']=null;queues[_0x2f1e5f['uniqueid']]['queuecallerabandon']=!![];queues[_0x2f1e5f['uniqueid']][_0x0f49('0x23')]=utils[_0x0f49('0x12')]();queues[_0x2f1e5f['uniqueid']]['queuecallerexitreason']=_0x0f49('0x29');utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x2a'),_0x2f1e5f[_0x0f49('0x5')],queues[_0x2f1e5f['uniqueid']][_0x0f49('0x19')],queues[_0x2f1e5f[_0x0f49('0x5')]][_0x0f49('0xa')]));}}catch(_0x1fea62){utils['error'](util[_0x0f49('0x4')](_0x0f49('0x28'),_0x2f1e5f[_0x0f49('0x5')]),_0x1fea62);}};exports['queuecallerleave']=function(_0x5e2c36){try{if(!_[_0x0f49('0x22')](queues[_0x5e2c36['uniqueid']])){utils[_0x0f49('0x14')](util[_0x0f49('0x4')](_0x0f49('0x2b'),_0x5e2c36['uniqueid']),_0x5e2c36);utils[_0x0f49('0x3')](util['format'](_0x0f49('0x2c'),_0x5e2c36[_0x0f49('0x5')],queues[_0x5e2c36[_0x0f49('0x5')]][_0x0f49('0x19')],_0x5e2c36[_0x0f49('0x2d')],_0x5e2c36[_0x0f49('0x2e')]));queues[_0x5e2c36[_0x0f49('0x5')]]['queuecallerleave']=!![];queues[_0x5e2c36['uniqueid']][_0x0f49('0x15')]=utils[_0x0f49('0x12')]();queues[_0x5e2c36[_0x0f49('0x5')]]['holdtime']=utils[_0x0f49('0x2f')](queues[_0x5e2c36[_0x0f49('0x5')]][_0x0f49('0x15')],queues[_0x5e2c36['uniqueid']][_0x0f49('0x30')]);queues[_0x5e2c36['uniqueid']]['position']=_0x5e2c36['position'];queues[_0x5e2c36['uniqueid']]['count']=_0x5e2c36[_0x0f49('0x31')];queues[_0x5e2c36['uniqueid']][_0x0f49('0x2d')]=_0x5e2c36[_0x0f49('0x2d')];queues[_0x5e2c36[_0x0f49('0x5')]][_0x0f49('0x2e')]=_0x5e2c36[_0x0f49('0x2e')];}}catch(_0x57f75e){utils[_0x0f49('0x13')](util[_0x0f49('0x4')](_0x0f49('0x2b'),_0x5e2c36['uniqueid']),_0x57f75e);}};exports['agentconnect']=function(_0x3ca57c){try{if(!_[_0x0f49('0x22')](queues[_0x3ca57c[_0x0f49('0x5')]])){utils[_0x0f49('0x14')](util[_0x0f49('0x4')]('[%s][queues][agentconnect]',_0x3ca57c[_0x0f49('0x5')]),_0x3ca57c);utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x32'),_0x3ca57c[_0x0f49('0x5')],queues[_0x3ca57c[_0x0f49('0x5')]][_0x0f49('0x19')],_0x3ca57c[_0x0f49('0x33')],_0x3ca57c['destaccountcode']));queues[_0x3ca57c[_0x0f49('0x5')]][_0x0f49('0x16')]=![];queues[_0x3ca57c[_0x0f49('0x5')]][_0x0f49('0x16')]=![];queues[_0x3ca57c[_0x0f49('0x5')]]['queuecallerabandonAt']=null;queues[_0x3ca57c['uniqueid']]['queuecallerexit']=![];queues[_0x3ca57c['uniqueid']]['queuecallerexitreason']=null;queues[_0x3ca57c['uniqueid']][_0x0f49('0x25')]=null;queues[_0x3ca57c[_0x0f49('0x5')]]['assigned']=!![];queues[_0x3ca57c['uniqueid']][_0x0f49('0x34')]=_0x3ca57c[_0x0f49('0x35')];queues[_0x3ca57c[_0x0f49('0x5')]][_0x0f49('0x8')]=_0x3ca57c[_0x0f49('0x33')];}}catch(_0x31052b){utils['error'](util[_0x0f49('0x4')]('[%s][queues][agentconnect]',_0x3ca57c[_0x0f49('0x5')]),_0x31052b);}};exports[_0x0f49('0x36')]=function(_0xbe128){try{if(!_[_0x0f49('0x22')](queues[_0xbe128['uniqueid']])){if(queues[_0xbe128[_0x0f49('0x5')]][_0x0f49('0x15')]){utils[_0x0f49('0x14')](util['format'](_0x0f49('0x37'),_0xbe128[_0x0f49('0x5')]),_0xbe128);queues[_0xbe128[_0x0f49('0x5')]]['queuecallerabandon']=![];queues[_0xbe128[_0x0f49('0x5')]][_0x0f49('0x16')]=![];queues[_0xbe128[_0x0f49('0x5')]][_0x0f49('0x23')]=null;queues[_0xbe128['uniqueid']][_0x0f49('0x24')]=![];queues[_0xbe128[_0x0f49('0x5')]]['queuecallerexitAt']=null;queues[_0xbe128['uniqueid']]['assigned']=!![];queues[_0xbe128['uniqueid']][_0x0f49('0x8')]=_0xbe128[_0x0f49('0x33')];queues[_0xbe128[_0x0f49('0x5')]][_0x0f49('0x17')]=!![];queues[_0xbe128[_0x0f49('0x5')]]['queuecallercompleteAt']=utils[_0x0f49('0x12')]();if(_0xbe128[_0x0f49('0x38')]==_0x0f49('0x39')){if(!queues[_0xbe128[_0x0f49('0x5')]][_0x0f49('0x39')]){queues[_0xbe128[_0x0f49('0x5')]][_0x0f49('0xa')]=_0x0f49('0x3a');}}else{queues[_0xbe128['uniqueid']][_0x0f49('0xa')]=_0x0f49('0x3b')+_0xbe128[_0x0f49('0x38')][_0x0f49('0x21')]();}utils[_0x0f49('0x3')](util[_0x0f49('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xbe128[_0x0f49('0x5')],queues[_0xbe128['uniqueid']][_0x0f49('0x19')],_0xbe128[_0x0f49('0x33')],queues[_0xbe128[_0x0f49('0x5')]]['queuecallerexitreason']));writeDB(queues[_0xbe128[_0x0f49('0x5')]]);}}}catch(_0x5871a1){utils[_0x0f49('0x13')](util[_0x0f49('0x4')](_0x0f49('0x37'),_0xbe128[_0x0f49('0x5')]),_0x5871a1);}};exports[_0x0f49('0x3c')]=function(_0x18c597){try{if(!_[_0x0f49('0x22')](queues[_0x18c597[_0x0f49('0x3d')]])){utils[_0x0f49('0x14')](util[_0x0f49('0x4')](_0x0f49('0x3e'),_0x18c597[_0x0f49('0x5')]),_0x18c597);queues[_0x18c597[_0x0f49('0x3d')]][_0x0f49('0x39')]=!![];queues[_0x18c597[_0x0f49('0x3d')]][_0x0f49('0x3f')]=_0x0f49('0x40');queues[_0x18c597['transfereeuniqueid']][_0x0f49('0x41')]=_0x18c597[_0x0f49('0x42')];queues[_0x18c597[_0x0f49('0x3d')]][_0x0f49('0x43')]=_0x18c597[_0x0f49('0x3d')];queues[_0x18c597[_0x0f49('0x3d')]][_0x0f49('0xa')]=_0x0f49('0x44');utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x45'),_0x18c597[_0x0f49('0x5')],queues[_0x18c597[_0x0f49('0x3d')]][_0x0f49('0x19')],_0x18c597['transfereeuniqueid'],_0x18c597[_0x0f49('0x42')]));}}catch(_0x4e02a2){utils[_0x0f49('0x13')](util[_0x0f49('0x4')](_0x0f49('0x3e'),_0x18c597[_0x0f49('0x5')]),_0x4e02a2);}};exports['attendedtransfer']=function(_0xe1d351){try{utils['debug'](util['format']('[%s][queues][attendedtransfer]',_0xe1d351[_0x0f49('0x46')]),_0xe1d351);if(_0xe1d351[_0x0f49('0x46')]==_0xe1d351[_0x0f49('0x47')]){if(!_['isNil'](queues[_0xe1d351[_0x0f49('0x48')]])){utils[_0x0f49('0x3')](util[_0x0f49('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xe1d351[_0x0f49('0x46')],queues[_0xe1d351[_0x0f49('0x48')]][_0x0f49('0x19')],_0xe1d351[_0x0f49('0x49')]));queues[_0xe1d351[_0x0f49('0x48')]]['transfer']=!![];queues[_0xe1d351[_0x0f49('0x48')]][_0x0f49('0x3f')]='ATTENDED';queues[_0xe1d351['secondtransfererlinkedid']][_0x0f49('0x41')]=_0xe1d351[_0x0f49('0x49')];queues[_0xe1d351[_0x0f49('0x48')]]['transferuniqueid']=_0xe1d351[_0x0f49('0x46')];queues[_0xe1d351[_0x0f49('0x48')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x0f49('0x22')](queues[_0xe1d351[_0x0f49('0x47')]])){if(_0xe1d351[_0x0f49('0x4a')]&&queues[_0xe1d351[_0x0f49('0x4a')]]){queues[_0xe1d351[_0x0f49('0x4a')]][_0x0f49('0x4b')]=0x1;queues[_0xe1d351['transfereeuniqueid']]=_[_0x0f49('0x4c')](queues[_0xe1d351[_0x0f49('0x4a')]]);queues[_0xe1d351[_0x0f49('0x3d')]][_0x0f49('0x1a')]=_0xe1d351[_0x0f49('0x4d')];queues[_0xe1d351[_0x0f49('0x3d')]]['queuecallerenterreason']=0x2;queues[_0xe1d351['transfereeuniqueid']][_0x0f49('0x9')]=queues[_0xe1d351[_0x0f49('0x48')]]['calleridnum'];queues[_0xe1d351['transfereeuniqueid']][_0x0f49('0x4e')]=queues[_0xe1d351[_0x0f49('0x48')]][_0x0f49('0x4e')];queues[_0xe1d351['transfereeuniqueid']][_0x0f49('0x30')]=utils[_0x0f49('0x12')]();queues[_0xe1d351[_0x0f49('0x3d')]][_0x0f49('0x15')]=utils[_0x0f49('0x12')]();queues[_0xe1d351['transfereeuniqueid']][_0x0f49('0x4f')]=0x0;queues[_0xe1d351['transfereeuniqueid']][_0x0f49('0x50')]=0x0;utils[_0x0f49('0x3')](util['format'](_0x0f49('0x51'),_0xe1d351[_0x0f49('0x46')],queues[_0xe1d351[_0x0f49('0x3d')]][_0x0f49('0x19')],queues[_0xe1d351[_0x0f49('0x3d')]][_0x0f49('0x9')],queues[_0xe1d351[_0x0f49('0x3d')]][_0x0f49('0x4e')]));}else{utils[_0x0f49('0x3')](util['format'](_0x0f49('0x52'),_0xe1d351[_0x0f49('0x46')],queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x19')],_0xe1d351[_0x0f49('0x48')]));queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x1a')]=_0xe1d351[_0x0f49('0x48')];}}}else if(_0xe1d351[_0x0f49('0x53')]==_0xe1d351[_0x0f49('0x48')]){if(!_[_0x0f49('0x22')](queues[_0xe1d351[_0x0f49('0x47')]])){utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x54'),_0xe1d351[_0x0f49('0x46')],queues[_0xe1d351[_0x0f49('0x47')]]['name'],_0xe1d351[_0x0f49('0x53')],_0xe1d351[_0x0f49('0x55')]));queues[_0xe1d351['origtransfererlinkedid']][_0x0f49('0x39')]=!![];queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x3f')]='ATTENDED';queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x41')]=_0xe1d351['secondtransfererexten'];queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x43')]=_0xe1d351[_0x0f49('0x53')];queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0xa')]=_0x0f49('0x56');}if(!_[_0x0f49('0x22')](queues[_0xe1d351['secondtransfererlinkedid']])){if(_0xe1d351[_0x0f49('0x57')]&&queues[_0xe1d351[_0x0f49('0x57')]]){queues[_0xe1d351[_0x0f49('0x57')]][_0x0f49('0x4b')]=0x1;queues[_0xe1d351[_0x0f49('0x4d')]]=_[_0x0f49('0x4c')](queues[_0xe1d351[_0x0f49('0x57')]]);queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x1a')]=_0xe1d351['transfertargetuniqueid'];queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x4b')]=0x2;queues[_0xe1d351['transfertargetuniqueid']]['calleridnum']=queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x9')];queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x4e')]=queues[_0xe1d351[_0x0f49('0x47')]][_0x0f49('0x4e')];queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x30')]=utils[_0x0f49('0x12')]();queues[_0xe1d351['transfertargetuniqueid']][_0x0f49('0x15')]=utils[_0x0f49('0x12')]();queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x4f')]=0x0;queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x50')]=0x0;utils['info'](util[_0x0f49('0x4')](_0x0f49('0x58'),_0xe1d351[_0x0f49('0x46')],queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x19')],queues[_0xe1d351[_0x0f49('0x4d')]]['transfereduniqueid'],queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x9')],queues[_0xe1d351[_0x0f49('0x4d')]][_0x0f49('0x4e')]));}else{utils[_0x0f49('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xe1d351[_0x0f49('0x46')],queues[_0xe1d351['secondtransfererlinkedid']][_0x0f49('0x19')],_0xe1d351[_0x0f49('0x47')]));queues[_0xe1d351[_0x0f49('0x48')]][_0x0f49('0x1a')]=_0xe1d351[_0x0f49('0x47')];}}}}catch(_0x7c80e4){utils[_0x0f49('0x13')](util['format'](_0x0f49('0x59'),_0xe1d351['origtransfereruniqueid']),_0x7c80e4);}};exports[_0x0f49('0x5a')]=function(_0xe8df0f){try{if(!_[_0x0f49('0x22')](queues[_0xe8df0f['uniqueid']])){utils['debug'](util[_0x0f49('0x4')](_0x0f49('0x5b'),_0xe8df0f[_0x0f49('0x5')]),_0xe8df0f);queues[_0xe8df0f[_0x0f49('0x5')]][_0x0f49('0x5c')]=utils[_0x0f49('0x12')]();utils[_0x0f49('0x3')](util[_0x0f49('0x4')](_0x0f49('0x5d'),_0xe8df0f[_0x0f49('0x5')],queues[_0xe8df0f['uniqueid']][_0x0f49('0x19')],queues[_0xe8df0f[_0x0f49('0x5')]][_0x0f49('0x5c')]));}}catch(_0x4a77d7){utils['error'](util[_0x0f49('0x4')](_0x0f49('0x5b'),_0xe8df0f[_0x0f49('0x5')]),_0x4a77d7);}};exports[_0x0f49('0x5e')]=function(_0x5f29a7){try{if(!_[_0x0f49('0x22')](queues[_0x5f29a7['uniqueid']])){if(!_['isNil'](queues[_0x5f29a7[_0x0f49('0x5')]][_0x0f49('0x5c')])){utils[_0x0f49('0x14')](util[_0x0f49('0x4')]('[%s][queues][musiconholdstop]',_0x5f29a7[_0x0f49('0x5')]),_0x5f29a7);queues[_0x5f29a7[_0x0f49('0x5')]][_0x0f49('0x50')]+=utils[_0x0f49('0x2f')](utils[_0x0f49('0x12')](),queues[_0x5f29a7[_0x0f49('0x5')]][_0x0f49('0x5c')]);utils['info'](util[_0x0f49('0x4')](_0x0f49('0x5f'),_0x5f29a7['uniqueid'],queues[_0x5f29a7[_0x0f49('0x5')]][_0x0f49('0x19')],queues[_0x5f29a7[_0x0f49('0x5')]][_0x0f49('0x50')]));delete queues[_0x5f29a7['uniqueid']][_0x0f49('0x5c')];}}}catch(_0x3c3d10){utils[_0x0f49('0x13')](util[_0x0f49('0x4')](_0x0f49('0x60'),_0x5f29a7[_0x0f49('0x5')]),_0x3c3d10);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 165d9a4..3711207 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 _0xee6e=['uniqueid','blinds','accountcode','getUserByInternal','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','channel','error','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','mixmonitor_filename','variable','value','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','[%s][recordings][writeDB]'];(function(_0x3ae9e4,_0x5f0bc2){var _0x41176a=function(_0x565d7d){while(--_0x565d7d){_0x3ae9e4['push'](_0x3ae9e4['shift']());}};_0x41176a(++_0x5f0bc2);}(_0xee6e,0x199));var _0xeee6=function(_0x41962c,_0x11a8f9){_0x41962c=_0x41962c-0x0;var _0x48be94=_0xee6e[_0x41962c];return _0x48be94;};'use strict';var _=require(_0xeee6('0x0'));var util=require(_0xeee6('0x1'));var utils=require(_0xeee6('0x2'));var transfers=require(_0xeee6('0x3'));var recordings={};function writeDB(_0x2df885){var _0x5e09bc;utils['info'](util['format'](_0xeee6('0x4'),_0x2df885[_0xeee6('0x5')]));if(transfers[_0xeee6('0x6')][_0x2df885[_0xeee6('0x5')]]){_0x5e09bc=_0x2df885['uniqueid'];_0x2df885[_0xeee6('0x5')]=transfers[_0xeee6('0x6')][_0x2df885[_0xeee6('0x5')]]['transfereeuniqueid'];}if(_0x2df885[_0xeee6('0x7')]){utils[_0xeee6('0x8')](_0x2df885['accountcode'])['then'](function(_0x25ec7b){if(_0x25ec7b){_0x2df885['membername']=_0x25ec7b[_0xeee6('0x9')];_0x2df885[_0xeee6('0xa')]=_0x25ec7b['id'];}utils[_0xeee6('0xb')](_0xeee6('0xc'),_0x2df885);});}else{utils[_0xeee6('0xb')](_0xeee6('0xc'),_0x2df885);}if(_0x5e09bc)delete transfers['blinds'][_0x5e09bc];}exports[_0xeee6('0xd')]=function(_0x1fa948){try{utils[_0xeee6('0xe')](util[_0xeee6('0xf')](_0xeee6('0x10'),_0x1fa948[_0xeee6('0x5')]),_0x1fa948);if(_0x1fa948[_0xeee6('0x5')]==_0x1fa948['linkedid']){utils[_0xeee6('0x11')](util[_0xeee6('0xf')](_0xeee6('0x12'),_0x1fa948[_0xeee6('0x5')],_0x1fa948['context'],_0x1fa948['exten']));recordings[_0x1fa948['uniqueid']]={'uniqueid':_0x1fa948[_0xeee6('0x5')],'accountcode':_0x1fa948[_0xeee6('0x7')],'exten':_0x1fa948['exten'],'context':_0x1fa948['context'],'channel':_0x1fa948[_0xeee6('0x13')],'monitors':[]};}}catch(_0x4b72fb){utils[_0xeee6('0x14')](util['format'](_0xeee6('0x10'),_0x1fa948[_0xeee6('0x5')]),_0x4b72fb);}};exports['newstate']=function(_0x136b3d){try{utils['debug'](util[_0xeee6('0xf')](_0xeee6('0x15'),_0x136b3d['uniqueid']),_0x136b3d);if(!_['isNil'](recordings[_0x136b3d[_0xeee6('0x5')]])&&_0x136b3d[_0xeee6('0x16')]==0x6){utils['info'](util[_0xeee6('0xf')](_0xeee6('0x17'),_0x136b3d['uniqueid'],_0x136b3d['context'],_0x136b3d[_0xeee6('0x13')]));}else if(!_['isNil'](recordings[_0x136b3d[_0xeee6('0x18')]])&&_0x136b3d[_0xeee6('0x16')]==0x6&&_0x136b3d['context']!=_0xeee6('0x19')){utils['info'](util[_0xeee6('0xf')](_0xeee6('0x1a'),_0x136b3d[_0xeee6('0x5')],_0x136b3d[_0xeee6('0x18')],_0x136b3d['context'],_0x136b3d['channel']));recordings[_0x136b3d[_0xeee6('0x18')]][_0xeee6('0x7')]=_0x136b3d[_0xeee6('0x7')];}}catch(_0x32808e){utils[_0xeee6('0x14')](util[_0xeee6('0xf')](_0xeee6('0x15'),_0x136b3d[_0xeee6('0x5')]),_0x32808e);}};exports[_0xeee6('0x1b')]=function(_0x4a0a2d){try{if(!_[_0xeee6('0x1c')](_0x4a0a2d['variable'])&&!_[_0xeee6('0x1c')](_0x4a0a2d['variable'][_0xeee6('0x1d')])){utils[_0xeee6('0xe')](util[_0xeee6('0xf')]('[%s][recordings][varset]',_0x4a0a2d['uniqueid']),_0x4a0a2d);utils[_0xeee6('0x11')](util[_0xeee6('0xf')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4a0a2d[_0xeee6('0x5')],_0x4a0a2d[_0xeee6('0x1e')],_0x4a0a2d[_0xeee6('0x1f')]));if(_['endsWith'](_0x4a0a2d['value'],_0xeee6('0x20'))){_0x4a0a2d[_0xeee6('0x1f')]=_0x4a0a2d[_0xeee6('0x1f')][_0xeee6('0x21')]('.wav49',_0xeee6('0x22'));}if(recordings[_0x4a0a2d[_0xeee6('0x18')]]){var _0x39e4c6=_['find'](recordings[_0x4a0a2d[_0xeee6('0x18')]][_0xeee6('0x23')],{'value':_0x4a0a2d[_0xeee6('0x1f')]});if(_['isNil'](_0x39e4c6)){recordings[_0x4a0a2d[_0xeee6('0x18')]][_0xeee6('0x23')][_0xeee6('0x24')]({'value':_0x4a0a2d[_0xeee6('0x1f')]});}}}}catch(_0x1b06c5){utils['error'](util[_0xeee6('0xf')]('[%s][recordings][varset]',_0x4a0a2d['uniqueid']),_0x1b06c5);}};exports[_0xeee6('0x25')]=function(_0x134850){try{if(!_[_0xeee6('0x1c')](recordings[_0x134850[_0xeee6('0x5')]])){utils[_0xeee6('0xe')](util[_0xeee6('0xf')]('[%s][recordings][hangup]',_0x134850[_0xeee6('0x5')]),_0x134850);utils[_0xeee6('0x11')](util[_0xeee6('0xf')](_0xeee6('0x26'),_0x134850[_0xeee6('0x5')],_0x134850[_0xeee6('0x27')],_0x134850[_0xeee6('0x28')],_0x134850['cause-txt']));recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x27')]=_0x134850[_0xeee6('0x27')];recordings[_0x134850['uniqueid']][_0xeee6('0x28')]=_0x134850[_0xeee6('0x28')];recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x29')]=_0x134850[_0xeee6('0x29')];recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x2a')]=_0x134850[_0xeee6('0x2a')];if(recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x2b')]==_0xeee6('0x2c')&&recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x7')]){recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x29')]=recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x7')];recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x2a')]='';}recordings[_0x134850[_0xeee6('0x5')]][_0xeee6('0x23')][_0xeee6('0x2d')](function(_0x128d05){var _0x30471a=_['clone'](recordings[_0x134850['uniqueid']]);_0x30471a[_0xeee6('0x1f')]=_0x128d05[_0xeee6('0x1f')];writeDB(_0x30471a);});delete recordings[_0x134850[_0xeee6('0x5')]];}}catch(_0x30631a){utils[_0xeee6('0x14')](util['format'](_0xeee6('0x2e'),_0x134850[_0xeee6('0x5')]),_0x30631a);}};exports[_0xeee6('0x2f')]=function(_0x3beba0){try{if(!_[_0xeee6('0x1c')](recordings[_0x3beba0[_0xeee6('0x5')]])){utils[_0xeee6('0xe')](util[_0xeee6('0xf')](_0xeee6('0x30'),_0x3beba0[_0xeee6('0x5')]),_0x3beba0);utils[_0xeee6('0x11')](util['format'](_0xeee6('0x31'),_0x3beba0[_0xeee6('0x5')],_0x3beba0[_0xeee6('0x32')],_0x3beba0[_0xeee6('0x33')]));if(_0x3beba0['application'][_0xeee6('0x34')]()=='set'&&_['startsWith'](_0x3beba0['appdata'][_0xeee6('0x34')](),_0xeee6('0x35'))){var _0x1a7074=_0x3beba0[_0xeee6('0x33')][_0xeee6('0x36')]('=');var _0x279bc6=_0x1a7074[0x0][_0xeee6('0x37')](_0x1a7074[0x0][_0xeee6('0x38')]('(')+0x1,_0x1a7074[0x0][_0xeee6('0x38')](')'));var _0x1c0d81=_0x1a7074[0x1];recordings[_0x3beba0[_0xeee6('0x5')]][_0x279bc6]=_0x1c0d81;}}}catch(_0x315094){utils[_0xeee6('0x14')](util[_0xeee6('0xf')](_0xeee6('0x30'),_0x3beba0[_0xeee6('0x5')]),_0x315094);}};exports[_0xeee6('0x39')]=function(_0x200686){try{if(!_[_0xeee6('0x1c')](recordings[_0x200686[_0xeee6('0x5')]])){utils[_0xeee6('0xe')](util[_0xeee6('0xf')]('[%s][recordings][queuecallerjoin]',_0x200686['uniqueid']),_0x200686);utils[_0xeee6('0x11')](util[_0xeee6('0xf')](_0xeee6('0x3a'),_0x200686[_0xeee6('0x5')],_0x200686[_0xeee6('0x3b')]));recordings[_0x200686[_0xeee6('0x5')]][_0xeee6('0x3b')]=_0x200686[_0xeee6('0x3b')];}}catch(_0x4b58d0){utils[_0xeee6('0x14')](util['format'](_0xeee6('0x3c'),_0x200686[_0xeee6('0x5')]),_0x4b58d0);}};exports[_0xeee6('0x3d')]=function(_0x2045fc){try{utils[_0xeee6('0xe')](util[_0xeee6('0xf')](_0xeee6('0x3e'),_0x2045fc[_0xeee6('0x5')]),_0x2045fc);utils[_0xeee6('0x11')](util[_0xeee6('0xf')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2045fc[_0xeee6('0x5')],_0x2045fc[_0xeee6('0x3f')],_0x2045fc[_0xeee6('0x40')],_0x2045fc[_0xeee6('0x41')],_0x2045fc[_0xeee6('0x42')]));if(recordings[_0x2045fc[_0xeee6('0x43')]]&&transfers[_0xeee6('0x6')][_0x2045fc['transfereruniqueid']]){transfers[_0xeee6('0x6')][_0x2045fc[_0xeee6('0x43')]][_0xeee6('0x44')]=!![];}}catch(_0x346a22){utils[_0xeee6('0x14')](util[_0xeee6('0xf')](_0xeee6('0x3e'),_0x2045fc[_0xeee6('0x5')]),_0x346a22);}}; \ No newline at end of file +var _0xeed3=['find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV'];(function(_0x54c820,_0x319c30){var _0x1fbef4=function(_0x29413b){while(--_0x29413b){_0x54c820['push'](_0x54c820['shift']());}};_0x1fbef4(++_0x319c30);}(_0xeed3,0xf3));var _0x3eed=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xeed3[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3eed('0x0'));var transfers=require(_0x3eed('0x1'));var recordings={};function writeDB(_0x456790){var _0x1091f0;utils[_0x3eed('0x2')](util[_0x3eed('0x3')](_0x3eed('0x4'),_0x456790['uniqueid']));if(transfers['blinds'][_0x456790[_0x3eed('0x5')]]){_0x1091f0=_0x456790[_0x3eed('0x5')];_0x456790[_0x3eed('0x5')]=transfers[_0x3eed('0x6')][_0x456790['uniqueid']][_0x3eed('0x7')];}if(_0x456790[_0x3eed('0x8')]){utils[_0x3eed('0x9')](_0x456790['accountcode'])['then'](function(_0x76cdb0){if(_0x76cdb0){_0x456790[_0x3eed('0xa')]=_0x76cdb0['name'];_0x456790['UserId']=_0x76cdb0['id'];}utils[_0x3eed('0xb')]('CreateVoiceRecording',_0x456790);});}else{utils['request'](_0x3eed('0xc'),_0x456790);}if(_0x1091f0)delete transfers[_0x3eed('0x6')][_0x1091f0];}exports[_0x3eed('0xd')]=function(_0x4b5341){try{utils[_0x3eed('0xe')](util[_0x3eed('0x3')](_0x3eed('0xf'),_0x4b5341['uniqueid']),_0x4b5341);if(_0x4b5341[_0x3eed('0x5')]==_0x4b5341[_0x3eed('0x10')]){utils[_0x3eed('0x2')](util[_0x3eed('0x3')](_0x3eed('0x11'),_0x4b5341['uniqueid'],_0x4b5341[_0x3eed('0x12')],_0x4b5341['exten']));recordings[_0x4b5341[_0x3eed('0x5')]]={'uniqueid':_0x4b5341[_0x3eed('0x5')],'accountcode':_0x4b5341['accountcode'],'exten':_0x4b5341[_0x3eed('0x13')],'context':_0x4b5341['context'],'channel':_0x4b5341[_0x3eed('0x14')],'monitors':[]};}}catch(_0x50bf06){utils[_0x3eed('0x15')](util['format'](_0x3eed('0xf'),_0x4b5341[_0x3eed('0x5')]),_0x50bf06);}};exports[_0x3eed('0x16')]=function(_0x2f698d){try{utils[_0x3eed('0xe')](util[_0x3eed('0x3')](_0x3eed('0x17'),_0x2f698d[_0x3eed('0x5')]),_0x2f698d);if(!_[_0x3eed('0x18')](recordings[_0x2f698d['uniqueid']])&&_0x2f698d[_0x3eed('0x19')]==0x6){utils[_0x3eed('0x2')](util[_0x3eed('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2f698d[_0x3eed('0x5')],_0x2f698d[_0x3eed('0x12')],_0x2f698d['channel']));}else if(!_[_0x3eed('0x18')](recordings[_0x2f698d['linkedid']])&&_0x2f698d[_0x3eed('0x19')]==0x6&&_0x2f698d[_0x3eed('0x12')]!=_0x3eed('0x1a')){utils[_0x3eed('0x2')](util['format'](_0x3eed('0x1b'),_0x2f698d[_0x3eed('0x5')],_0x2f698d['linkedid'],_0x2f698d['context'],_0x2f698d[_0x3eed('0x14')]));recordings[_0x2f698d[_0x3eed('0x10')]][_0x3eed('0x8')]=_0x2f698d[_0x3eed('0x8')];}}catch(_0x338cd1){utils[_0x3eed('0x15')](util[_0x3eed('0x3')](_0x3eed('0x17'),_0x2f698d[_0x3eed('0x5')]),_0x338cd1);}};exports['varset']=function(_0x579630){try{if(!_[_0x3eed('0x18')](_0x579630[_0x3eed('0x1c')])&&!_[_0x3eed('0x18')](_0x579630[_0x3eed('0x1c')][_0x3eed('0x1d')])){utils[_0x3eed('0xe')](util[_0x3eed('0x3')](_0x3eed('0x1e'),_0x579630[_0x3eed('0x5')]),_0x579630);utils[_0x3eed('0x2')](util[_0x3eed('0x3')](_0x3eed('0x1f'),_0x579630[_0x3eed('0x5')],_0x579630[_0x3eed('0x1c')],_0x579630['value']));if(_[_0x3eed('0x20')](_0x579630[_0x3eed('0x21')],_0x3eed('0x22'))){_0x579630['value']=_0x579630[_0x3eed('0x21')][_0x3eed('0x23')](_0x3eed('0x22'),_0x3eed('0x24'));}if(recordings[_0x579630[_0x3eed('0x10')]]){var _0x19df16=_[_0x3eed('0x25')](recordings[_0x579630[_0x3eed('0x10')]][_0x3eed('0x26')],{'value':_0x579630[_0x3eed('0x21')]});if(_[_0x3eed('0x18')](_0x19df16)){recordings[_0x579630['linkedid']][_0x3eed('0x26')]['push']({'value':_0x579630[_0x3eed('0x21')]});}}}}catch(_0x5bbd47){utils['error'](util['format']('[%s][recordings][varset]',_0x579630[_0x3eed('0x5')]),_0x5bbd47);}};exports[_0x3eed('0x27')]=function(_0x5c5612){try{if(!_['isNil'](recordings[_0x5c5612[_0x3eed('0x5')]])){utils['debug'](util['format'](_0x3eed('0x28'),_0x5c5612['uniqueid']),_0x5c5612);utils[_0x3eed('0x2')](util[_0x3eed('0x3')](_0x3eed('0x29'),_0x5c5612[_0x3eed('0x5')],_0x5c5612[_0x3eed('0x2a')],_0x5c5612['calleridname'],_0x5c5612[_0x3eed('0x2b')]));recordings[_0x5c5612[_0x3eed('0x5')]][_0x3eed('0x2a')]=_0x5c5612[_0x3eed('0x2a')];recordings[_0x5c5612[_0x3eed('0x5')]][_0x3eed('0x2c')]=_0x5c5612[_0x3eed('0x2c')];recordings[_0x5c5612[_0x3eed('0x5')]]['connectedlinenum']=_0x5c5612[_0x3eed('0x2d')];recordings[_0x5c5612['uniqueid']][_0x3eed('0x2e')]=_0x5c5612[_0x3eed('0x2e')];if(recordings[_0x5c5612['uniqueid']]['type']=='outbound'&&recordings[_0x5c5612[_0x3eed('0x5')]][_0x3eed('0x8')]){recordings[_0x5c5612[_0x3eed('0x5')]][_0x3eed('0x2d')]=recordings[_0x5c5612[_0x3eed('0x5')]][_0x3eed('0x8')];recordings[_0x5c5612[_0x3eed('0x5')]][_0x3eed('0x2e')]='';}recordings[_0x5c5612['uniqueid']][_0x3eed('0x26')]['forEach'](function(_0x495c1f){var _0xfb0de3=_[_0x3eed('0x2f')](recordings[_0x5c5612[_0x3eed('0x5')]]);_0xfb0de3[_0x3eed('0x21')]=_0x495c1f[_0x3eed('0x21')];writeDB(_0xfb0de3);});delete recordings[_0x5c5612['uniqueid']];}}catch(_0x1d9521){utils[_0x3eed('0x15')](util['format'](_0x3eed('0x28'),_0x5c5612[_0x3eed('0x5')]),_0x1d9521);}};exports[_0x3eed('0x30')]=function(_0x4b0c28){try{if(!_[_0x3eed('0x18')](recordings[_0x4b0c28['uniqueid']])){utils[_0x3eed('0xe')](util['format'](_0x3eed('0x31'),_0x4b0c28['uniqueid']),_0x4b0c28);utils[_0x3eed('0x2')](util[_0x3eed('0x3')](_0x3eed('0x32'),_0x4b0c28[_0x3eed('0x5')],_0x4b0c28[_0x3eed('0x33')],_0x4b0c28[_0x3eed('0x34')]));if(_0x4b0c28[_0x3eed('0x33')][_0x3eed('0x35')]()==_0x3eed('0x36')&&_[_0x3eed('0x37')](_0x4b0c28[_0x3eed('0x34')][_0x3eed('0x35')](),'cdr')){var _0x507d3a=_0x4b0c28[_0x3eed('0x34')][_0x3eed('0x38')]('=');var _0x43c7ff=_0x507d3a[0x0][_0x3eed('0x39')](_0x507d3a[0x0][_0x3eed('0x3a')]('(')+0x1,_0x507d3a[0x0][_0x3eed('0x3a')](')'));var _0x43a445=_0x507d3a[0x1];recordings[_0x4b0c28[_0x3eed('0x5')]][_0x43c7ff]=_0x43a445;}}}catch(_0x4c96ed){utils[_0x3eed('0x15')](util[_0x3eed('0x3')](_0x3eed('0x31'),_0x4b0c28[_0x3eed('0x5')]),_0x4c96ed);}};exports['queuecallerjoin']=function(_0x198301){try{if(!_[_0x3eed('0x18')](recordings[_0x198301['uniqueid']])){utils[_0x3eed('0xe')](util[_0x3eed('0x3')](_0x3eed('0x3b'),_0x198301[_0x3eed('0x5')]),_0x198301);utils[_0x3eed('0x2')](util[_0x3eed('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x198301[_0x3eed('0x5')],_0x198301[_0x3eed('0x3c')]));recordings[_0x198301[_0x3eed('0x5')]][_0x3eed('0x3c')]=_0x198301[_0x3eed('0x3c')];}}catch(_0x4bd4df){utils[_0x3eed('0x15')](util['format'](_0x3eed('0x3b'),_0x198301[_0x3eed('0x5')]),_0x4bd4df);}};exports[_0x3eed('0x3d')]=function(_0xf5e66e){try{utils[_0x3eed('0xe')](util[_0x3eed('0x3')](_0x3eed('0x3e'),_0xf5e66e[_0x3eed('0x5')]),_0xf5e66e);utils[_0x3eed('0x2')](util['format'](_0x3eed('0x3f'),_0xf5e66e[_0x3eed('0x5')],_0xf5e66e[_0x3eed('0x40')],_0xf5e66e[_0x3eed('0x41')],_0xf5e66e[_0x3eed('0x42')],_0xf5e66e[_0x3eed('0x43')]));if(recordings[_0xf5e66e[_0x3eed('0x44')]]&&transfers[_0x3eed('0x6')][_0xf5e66e[_0x3eed('0x44')]]){transfers[_0x3eed('0x6')][_0xf5e66e[_0x3eed('0x44')]][_0x3eed('0x45')]=!![];}}catch(_0xc45a8){utils['error'](util[_0x3eed('0x3')](_0x3eed('0x3e'),_0xf5e66e[_0x3eed('0x5')]),_0xc45a8);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2800196..1fb2d52 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 _0xd15b=['transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd15b,0xbc));var _0xbd15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd15b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbd15('0x0'));var util=require('util');var utils=require(_0xbd15('0x1'));function writeDB(_0x1bcc76){utils['info'](util[_0xbd15('0x2')](_0xbd15('0x3'),_0x1bcc76[_0xbd15('0x4')]===_0xbd15('0x5')?_0x1bcc76[_0xbd15('0x6')]:_0x1bcc76[_0xbd15('0x7')],_0x1bcc76[_0xbd15('0x4')]));utils[_0xbd15('0x8')](_0xbd15('0x9'),_0x1bcc76);}exports[_0xbd15('0xa')]={};exports[_0xbd15('0xb')]=function(_0x468e82){try{utils['debug'](util[_0xbd15('0x2')](_0xbd15('0xc'),_0x468e82['uniqueid']),_0x468e82);utils[_0xbd15('0xd')](util[_0xbd15('0x2')](_0xbd15('0xe'),_0x468e82[_0xbd15('0x7')],_0x468e82[_0xbd15('0xf')],_0x468e82['transferercalleridname'],_0x468e82[_0xbd15('0x10')],_0x468e82[_0xbd15('0x11')]));_0x468e82[_0xbd15('0x4')]='blind';exports[_0xbd15('0xa')][_0x468e82[_0xbd15('0x12')]]=_0x468e82;writeDB(_0x468e82);}catch(_0x2bb605){utils[_0xbd15('0x13')](util['format'](_0xbd15('0xc'),_0x468e82[_0xbd15('0x7')]),_0x2bb605);}};exports[_0xbd15('0x14')]=function(_0x479a6c){try{utils[_0xbd15('0x15')](util[_0xbd15('0x2')](_0xbd15('0x16'),_0x479a6c[_0xbd15('0x6')]),_0x479a6c);utils[_0xbd15('0xd')](util['format'](_0xbd15('0x17'),_0x479a6c[_0xbd15('0x6')],_0x479a6c[_0xbd15('0x18')],_0x479a6c[_0xbd15('0x19')],_0x479a6c[_0xbd15('0x1a')],_0x479a6c[_0xbd15('0x1b')]));_0x479a6c=_[_0xbd15('0x1c')](_0x479a6c,{'transfererchannel':_0x479a6c[_0xbd15('0x1d')],'transferercalleridnum':_0x479a6c[_0xbd15('0x18')],'transferercalleridname':_0x479a6c[_0xbd15('0x19')],'transfererconnectedlinenum':_0x479a6c[_0xbd15('0x1e')],'transfererconnectedlinename':_0x479a6c[_0xbd15('0x1f')],'transfereraccountcode':_0x479a6c[_0xbd15('0x20')],'transferercontext':_0x479a6c[_0xbd15('0x21')],'transfererexten':_0x479a6c[_0xbd15('0x22')],'transfererlinkedid':_0x479a6c['origtransfererlinkedid'],'context':_0x479a6c[_0xbd15('0x23')],'extension':_0x479a6c[_0xbd15('0x24')],'type':_0xbd15('0x5')});if(_['isNil'](_0x479a6c[_0xbd15('0x25')])){_0x479a6c=_[_0xbd15('0x1c')](_0x479a6c,{'transfereechannel':_0x479a6c[_0xbd15('0x26')],'transfereecalleridnum':_0x479a6c[_0xbd15('0x1a')],'transfereecalleridname':_0x479a6c['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x479a6c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x479a6c[_0xbd15('0x27')],'transfereeaccountcode':_0x479a6c[_0xbd15('0x28')],'transfereecontext':_0x479a6c[_0xbd15('0x29')],'transfereeexten':_0x479a6c[_0xbd15('0x2a')],'transfereelinkedid':_0x479a6c['transfertargetlinkedid']});}writeDB(_0x479a6c);}catch(_0x4492ec){utils[_0xbd15('0x13')](util[_0xbd15('0x2')]('[%s][transfers][attendedtransfer]',_0x479a6c[_0xbd15('0x6')]),_0x4492ec);}}; \ No newline at end of file +var _0xf2f0=['transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','util','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf2f0,0xb7));var _0x0f2f=function(_0xf2dc32,_0x2f00dd){_0xf2dc32=_0xf2dc32-0x0;var _0x2d6d45=_0xf2f0[_0xf2dc32];return _0x2d6d45;};'use strict';var _=require('lodash');var util=require(_0x0f2f('0x0'));var utils=require('./utils');function writeDB(_0x45d5cd){utils['info'](util[_0x0f2f('0x1')](_0x0f2f('0x2'),_0x45d5cd['type']==='attended'?_0x45d5cd[_0x0f2f('0x3')]:_0x45d5cd[_0x0f2f('0x4')],_0x45d5cd[_0x0f2f('0x5')]));utils[_0x0f2f('0x6')](_0x0f2f('0x7'),_0x45d5cd);}exports[_0x0f2f('0x8')]={};exports['blindtransfer']=function(_0x266372){try{utils[_0x0f2f('0x9')](util[_0x0f2f('0x1')](_0x0f2f('0xa'),_0x266372[_0x0f2f('0x4')]),_0x266372);utils[_0x0f2f('0xb')](util[_0x0f2f('0x1')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x266372[_0x0f2f('0x4')],_0x266372[_0x0f2f('0xc')],_0x266372[_0x0f2f('0xd')],_0x266372[_0x0f2f('0xe')],_0x266372[_0x0f2f('0xf')]));_0x266372[_0x0f2f('0x5')]=_0x0f2f('0x10');exports[_0x0f2f('0x8')][_0x266372[_0x0f2f('0x11')]]=_0x266372;writeDB(_0x266372);}catch(_0x3c7bbb){utils['error'](util[_0x0f2f('0x1')](_0x0f2f('0xa'),_0x266372[_0x0f2f('0x4')]),_0x3c7bbb);}};exports['attendedtransfer']=function(_0x463c64){try{utils[_0x0f2f('0x9')](util[_0x0f2f('0x1')]('[%s][transfers][attendedtransfer]',_0x463c64[_0x0f2f('0x3')]),_0x463c64);utils['info'](util[_0x0f2f('0x1')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x463c64[_0x0f2f('0x3')],_0x463c64[_0x0f2f('0x12')],_0x463c64[_0x0f2f('0x13')],_0x463c64['transfertargetcalleridnum'],_0x463c64[_0x0f2f('0x14')]));_0x463c64=_['assign'](_0x463c64,{'transfererchannel':_0x463c64['origtransfererchannel'],'transferercalleridnum':_0x463c64[_0x0f2f('0x12')],'transferercalleridname':_0x463c64[_0x0f2f('0x13')],'transfererconnectedlinenum':_0x463c64[_0x0f2f('0x15')],'transfererconnectedlinename':_0x463c64[_0x0f2f('0x16')],'transfereraccountcode':_0x463c64[_0x0f2f('0x17')],'transferercontext':_0x463c64[_0x0f2f('0x18')],'transfererexten':_0x463c64[_0x0f2f('0x19')],'transfererlinkedid':_0x463c64['origtransfererlinkedid'],'context':_0x463c64[_0x0f2f('0x1a')],'extension':_0x463c64[_0x0f2f('0x1b')],'type':'attended'});if(_[_0x0f2f('0x1c')](_0x463c64[_0x0f2f('0x1d')])){_0x463c64=_[_0x0f2f('0x1e')](_0x463c64,{'transfereechannel':_0x463c64[_0x0f2f('0x1f')],'transfereecalleridnum':_0x463c64[_0x0f2f('0x20')],'transfereecalleridname':_0x463c64[_0x0f2f('0x14')],'transfereeconnectedlinenum':_0x463c64['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x463c64[_0x0f2f('0x21')],'transfereeaccountcode':_0x463c64[_0x0f2f('0x22')],'transfereecontext':_0x463c64['transfertargetcontext'],'transfereeexten':_0x463c64[_0x0f2f('0x23')],'transfereelinkedid':_0x463c64[_0x0f2f('0x24')]});}writeDB(_0x463c64);}catch(_0xe03c78){utils[_0x0f2f('0x25')](util['format'](_0x0f2f('0x26'),_0x463c64[_0x0f2f('0x3')]),_0xe03c78);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index d8fc1dd..2ea6818 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 _0x97ce=['stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','name'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x97ce,0x151));var _0xe97c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97ce[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0xe97c('0x0'));var jayson=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var util=require(_0xe97c('0x3'));var client=jayson['client'][_0xe97c('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xe97c('0x5'));exports['info']=function(_0x443ea2,_0x259e69){logger[_0xe97c('0x6')](_0x443ea2,_0x259e69?util[_0xe97c('0x7')](_0x259e69,{'showHidden':![],'depth':null}):'');};exports[_0xe97c('0x8')]=function(_0x6603e0,_0x522f0a){logger[_0xe97c('0x8')](_0x6603e0,_0x522f0a?util[_0xe97c('0x7')](_0x522f0a,{'showHidden':![],'depth':null}):'');};exports[_0xe97c('0x9')]=function(_0x48a21e,_0x96d593){logger['error'](_0x48a21e,_0x96d593?util[_0xe97c('0x7')](_0x96d593,{'showHidden':![],'depth':null}):'');};exports[_0xe97c('0xa')]=function(_0xbe3b8a,_0x23e6a2){return client[_0xe97c('0xa')](_0xbe3b8a,{'body':_0x23e6a2})[_0xe97c('0xb')](function(_0xcb42d6){logger['debug'](_0xe97c('0xc'),_0xbe3b8a,_0xcb42d6?util[_0xe97c('0x7')](_0xcb42d6,{'showHidden':![],'depth':null}):'');})[_0xe97c('0xd')](function(_0x15ab00){logger[_0xe97c('0x9')](_0xe97c('0xc'),_0xbe3b8a,_0x15ab00?util[_0xe97c('0x7')](_0x15ab00,{'showHidden':![],'depth':null}):'');});};function getUser(_0x8fb84d){return client[_0xe97c('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xe97c('0xe'),'interface'],'where':_0x8fb84d,'limit':0x1}})[_0xe97c('0xb')](function(_0x4006a6){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xe97c('0xf')](_0x8fb84d),_0x4006a6?util[_0xe97c('0x7')](_0x4006a6,{'showHidden':![],'depth':null}):'');return _0x4006a6[_0xe97c('0x10')][_0xe97c('0x11')]?_0x4006a6['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x52f63d){return new BPromise(function(_0x42d95c,_0x1ceb22){if(_0x52f63d){return getUser({'internal':_0x52f63d})[_0xe97c('0xb')](function(_0x4ca281){logger[_0xe97c('0x6')](_0xe97c('0x12'),_0x52f63d,_0x4ca281?_0xe97c('0x13'):_0xe97c('0x14'));return _0x42d95c(_0x4ca281);})[_0xe97c('0xd')](function(_0x5a7c4b){logger[_0xe97c('0x9')](_0xe97c('0x15'),_0x5a7c4b?util[_0xe97c('0x7')](_0x5a7c4b,{'showHidden':![],'depth':null}):'');return _0x42d95c(null);});}return _0x42d95c(null);});};exports[_0xe97c('0x16')]=function(_0x32eb7a){return new BPromise(function(_0x44c334,_0x1585fc){if(_0x32eb7a){return getUser({'interface':_0x32eb7a})[_0xe97c('0xb')](function(_0xc1be51){logger[_0xe97c('0x6')](_0xe97c('0x17'),_0x32eb7a,_0xc1be51?_0xe97c('0x13'):_0xe97c('0x14'));return _0x44c334(_0xc1be51);})[_0xe97c('0xd')](function(_0x3b957c){logger[_0xe97c('0x9')](_0xe97c('0x18'),_0x3b957c?util[_0xe97c('0x7')](_0x3b957c,{'showHidden':![],'depth':null}):'');return _0x44c334(null);});}return _0x44c334(null);});};exports[_0xe97c('0x19')]=function(_0x49b81f){return new BPromise(function(_0x23ff1d,_0x6e14cc){if(_0x49b81f){return getUser({'name':_0x49b81f})[_0xe97c('0xb')](function(_0x30914a){logger[_0xe97c('0x6')](_0xe97c('0x1a'),_0x49b81f,_0x30914a?_0xe97c('0x13'):_0xe97c('0x14'));return _0x23ff1d(_0x30914a);})[_0xe97c('0xd')](function(_0x118866){logger[_0xe97c('0x9')](_0xe97c('0x1b'),_0x118866?util['inspect'](_0x118866,{'showHidden':![],'depth':null}):'');return _0x23ff1d(null);});}return _0x23ff1d(null);});};exports['getVoiceQueueByName']=function(_0x132678){return new BPromise(function(_0x1a3f69,_0x1273a2){if(_0x132678){return client[_0xe97c('0xa')](_0xe97c('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xe97c('0xe'),_0xe97c('0x1d'),'acw','acwTimeout'],'where':{'name':_0x132678},'limit':0x1}})[_0xe97c('0xb')](function(_0x36536c){logger[_0xe97c('0x8')](_0xe97c('0x1e'),_0x132678,_0x36536c?util['inspect'](_0x36536c,{'showHidden':![],'depth':null}):'');logger['info'](_0xe97c('0x1f'),_0x132678,_0x36536c?_0xe97c('0x13'):_0xe97c('0x14'));return _0x1a3f69(_0x36536c['result']['length']?_0x36536c[_0xe97c('0x10')][0x0]:null);})[_0xe97c('0xd')](function(_0x3d894a){logger[_0xe97c('0x9')](_0xe97c('0x20'),_0x3d894a?util[_0xe97c('0x7')](_0x3d894a,{'showHidden':![],'depth':null}):'');return _0x1a3f69(null);});}return _0x1a3f69(null);});};exports[_0xe97c('0x21')]=function(_0x5177d3,_0x3df60c){return moment(_0x5177d3)[_0xe97c('0x22')](_0x3df60c,'seconds')[_0xe97c('0x23')](_0xe97c('0x24'));};exports[_0xe97c('0x25')]=function(_0x22db3c,_0x23ae98){return moment(_0x22db3c)[_0xe97c('0x26')](_0x23ae98,_0xe97c('0x27'))[_0xe97c('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x269f2e,_0x8099a9){return moment(_0x269f2e)[_0xe97c('0x28')](moment(_0x8099a9),_0xe97c('0x27'));};exports['sumTime']=function(_0x132e9e,_0x57db43){return parseInt(_0x132e9e,0xa)+parseInt(_0x57db43,0xa);};exports[_0xe97c('0x29')]=function(){return moment()[_0xe97c('0x23')](_0xe97c('0x24'));};exports['isAfter']=function(_0x1586d5,_0x3e9395){if(_0x3e9395){return moment(_0x1586d5)[_0xe97c('0x2a')](_0x3e9395);}return!![];};exports[_0xe97c('0x2b')]=function(_0x2c287c,_0x5e54f5){if(_0x5e54f5){return moment(_0x2c287c)[_0xe97c('0x2b')](_0x5e54f5);}else if(_0x2c287c){return!![];}return![];}; \ No newline at end of file +var _0xd6fe=['catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','acw','acwTimeout','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s'];(function(_0x5856af,_0x6a158d){var _0x22a93a=function(_0x732b60){while(--_0x732b60){_0x5856af['push'](_0x5856af['shift']());}};_0x22a93a(++_0x6a158d);}(_0xd6fe,0x192));var _0xed6f=function(_0x10ec3b,_0x55cfda){_0x10ec3b=_0x10ec3b-0x0;var _0x5d6d22=_0xd6fe[_0x10ec3b];return _0x5d6d22;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xed6f('0x0'));var util=require(_0xed6f('0x1'));var client=jayson['client'][_0xed6f('0x2')]({'port':0x2329});var logger=require(_0xed6f('0x3'))(_0xed6f('0x4'));exports[_0xed6f('0x5')]=function(_0x35f58c,_0x1497f7){logger['info'](_0x35f58c,_0x1497f7?util[_0xed6f('0x6')](_0x1497f7,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0xec4c79,_0x1006f9){logger[_0xed6f('0x7')](_0xec4c79,_0x1006f9?util[_0xed6f('0x6')](_0x1006f9,{'showHidden':![],'depth':null}):'');};exports[_0xed6f('0x8')]=function(_0x5e8fa8,_0x4eff1a){logger[_0xed6f('0x8')](_0x5e8fa8,_0x4eff1a?util[_0xed6f('0x6')](_0x4eff1a,{'showHidden':![],'depth':null}):'');};exports[_0xed6f('0x9')]=function(_0xc227c7,_0x39b925){return client[_0xed6f('0x9')](_0xc227c7,{'body':_0x39b925})[_0xed6f('0xa')](function(_0x4c1c15){logger[_0xed6f('0x7')](_0xed6f('0xb'),_0xc227c7,_0x4c1c15?util[_0xed6f('0x6')](_0x4c1c15,{'showHidden':![],'depth':null}):'');})[_0xed6f('0xc')](function(_0x412177){logger[_0xed6f('0x8')](_0xed6f('0xb'),_0xc227c7,_0x412177?util[_0xed6f('0x6')](_0x412177,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4e60f7){return client[_0xed6f('0x9')](_0xed6f('0xd'),{'options':{'raw':!![],'attributes':['id',_0xed6f('0xe'),_0xed6f('0xf'),_0xed6f('0x10')],'where':_0x4e60f7,'limit':0x1}})[_0xed6f('0xa')](function(_0xb902a1){logger[_0xed6f('0x7')](_0xed6f('0x11'),JSON[_0xed6f('0x12')](_0x4e60f7),_0xb902a1?util['inspect'](_0xb902a1,{'showHidden':![],'depth':null}):'');return _0xb902a1[_0xed6f('0x13')][_0xed6f('0x14')]?_0xb902a1[_0xed6f('0x13')][0x0]:null;});}exports[_0xed6f('0x15')]=function(_0x865719){return new BPromise(function(_0x987e8d,_0x4a0956){if(_0x865719){return getUser({'internal':_0x865719})['then'](function(_0x8a2301){logger[_0xed6f('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x865719,_0x8a2301?'found':_0xed6f('0x16'));return _0x987e8d(_0x8a2301);})[_0xed6f('0xc')](function(_0x4b7ca3){logger[_0xed6f('0x8')](_0xed6f('0x17'),_0x4b7ca3?util[_0xed6f('0x6')](_0x4b7ca3,{'showHidden':![],'depth':null}):'');return _0x987e8d(null);});}return _0x987e8d(null);});};exports[_0xed6f('0x18')]=function(_0x36406a){return new BPromise(function(_0x376515,_0x3f51d3){if(_0x36406a){return getUser({'interface':_0x36406a})[_0xed6f('0xa')](function(_0x183e4f){logger[_0xed6f('0x5')](_0xed6f('0x19'),_0x36406a,_0x183e4f?_0xed6f('0x1a'):'notfound');return _0x376515(_0x183e4f);})[_0xed6f('0xc')](function(_0x795f29){logger[_0xed6f('0x8')](_0xed6f('0x1b'),_0x795f29?util[_0xed6f('0x6')](_0x795f29,{'showHidden':![],'depth':null}):'');return _0x376515(null);});}return _0x376515(null);});};exports[_0xed6f('0x1c')]=function(_0x4077b3){return new BPromise(function(_0x511ac6,_0x114a4f){if(_0x4077b3){return getUser({'name':_0x4077b3})[_0xed6f('0xa')](function(_0x5380fb){logger[_0xed6f('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4077b3,_0x5380fb?'found':_0xed6f('0x16'));return _0x511ac6(_0x5380fb);})[_0xed6f('0xc')](function(_0x424aa4){logger['error'](_0xed6f('0x1d'),_0x424aa4?util[_0xed6f('0x6')](_0x424aa4,{'showHidden':![],'depth':null}):'');return _0x511ac6(null);});}return _0x511ac6(null);});};exports[_0xed6f('0x1e')]=function(_0x1f3d12){return new BPromise(function(_0x143acc,_0x4d4143){if(_0x1f3d12){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xed6f('0xf'),'type',_0xed6f('0x1f'),_0xed6f('0x20')],'where':{'name':_0x1f3d12},'limit':0x1}})[_0xed6f('0xa')](function(_0x1ecd6a){logger[_0xed6f('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x1f3d12,_0x1ecd6a?util[_0xed6f('0x6')](_0x1ecd6a,{'showHidden':![],'depth':null}):'');logger[_0xed6f('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1f3d12,_0x1ecd6a?'found':_0xed6f('0x16'));return _0x143acc(_0x1ecd6a[_0xed6f('0x13')]['length']?_0x1ecd6a[_0xed6f('0x13')][0x0]:null);})['catch'](function(_0x1bfd7d){logger[_0xed6f('0x8')](_0xed6f('0x21'),_0x1bfd7d?util['inspect'](_0x1bfd7d,{'showHidden':![],'depth':null}):'');return _0x143acc(null);});}return _0x143acc(null);});};exports[_0xed6f('0x22')]=function(_0x1584af,_0x173a74){return moment(_0x1584af)[_0xed6f('0x23')](_0x173a74,_0xed6f('0x24'))[_0xed6f('0x25')](_0xed6f('0x26'));};exports[_0xed6f('0x27')]=function(_0x519812,_0x3487de){return moment(_0x519812)[_0xed6f('0x28')](_0x3487de,_0xed6f('0x24'))[_0xed6f('0x25')](_0xed6f('0x26'));};exports[_0xed6f('0x29')]=function(_0x4b873d,_0x2a28df){return moment(_0x4b873d)[_0xed6f('0x2a')](moment(_0x2a28df),'seconds');};exports['sumTime']=function(_0x649f6e,_0x571c45){return parseInt(_0x649f6e,0xa)+parseInt(_0x571c45,0xa);};exports[_0xed6f('0x2b')]=function(){return moment()[_0xed6f('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xed6f('0x2c')]=function(_0x42c63c,_0x10113c){if(_0x10113c){return moment(_0x42c63c)['isAfter'](_0x10113c);}return!![];};exports[_0xed6f('0x2d')]=function(_0x166265,_0x42e899){if(_0x42e899){return moment(_0x166265)['isBefore'](_0x42e899);}else if(_0x166265){return!![];}return![];}; \ No newline at end of file -- 1.7.1